1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5694],{53317:function(e,t,r){r.r(t),r.d(t,{addDisposer:function(){return eo},addMiddleware:function(){return eM},applyAction:function(){return eV},applyPatch:function(){return x},applySnapshot:function(){return M},cast:function(){return ef},castFlowReturn:function(){return tE},castToReferenceSnapshot:function(){return eb},castToSnapshot:function(){return ep},clone:function(){return er},createActionTrackingMiddleware:function(){return eT},createActionTrackingMiddleware2:function(){return eE},decorate:function(){return eL},destroy:function(){return ei},detach:function(){return en},escapeJsonPath:function(){return tD},flow:function(){return tC},getChildType:function(){return N},getEnv:function(){return eu},getIdentifier:function(){return q},getLivelinessChecking:function(){return P},getMembers:function(){return es},getNodeId:function(){return ed},getParent:function(){return U},getParentOfType:function(){return G},getPath:function(){return Z},getPathParts:function(){return Y},getPropertyMembers:function(){return ec},getRelativePath:function(){return et},getRoot:function(){return W},getRunningActionContext:function(){return eU},getSnapshot:function(){return L},getType:function(){return E},hasEnv:function(){return el},hasParent:function(){return H},hasParentOfType:function(){return $},isActionContextChildOf:function(){return eG},isActionContextThisOrChildOf:function(){return eW},isAlive:function(){return ea},isArrayType:function(){return tY},isFrozenType:function(){return rP},isIdentifierType:function(){return rx},isLateType:function(){return rv},isLiteralType:function(){return rn},isMapType:function(){return tU},isModelType:function(){return tX},isOptionalType:function(){return rp},isPrimitiveType:function(){return re},isProtected:function(){return F},isReferenceType:function(){return rT},isRefinementType:function(){return ra},isRoot:function(){return J},isStateTreeNode:function(){return e4},isType:function(){return eS},isUnionType:function(){return rl},isValidReference:function(){return X},joinJsonPath:function(){return tk},onAction:function(){return ex},onPatch:function(){return V},onSnapshot:function(){return D},process:function(){return tn},protect:function(){return R},recordActions:function(){return eD},recordPatches:function(){return k},resolveIdentifier:function(){return K},resolvePath:function(){return B},setLivelinessChecking:function(){return w},setLivelynessChecking:function(){return O},splitJsonPath:function(){return tR},t:function(){return rz},toGenerator:function(){return tV},toGeneratorFunction:function(){return tN},tryReference:function(){return Q},tryResolve:function(){return ee},typecheck:function(){return eQ},types:function(){return rz},unescapeJsonPath:function(){return tx},unprotect:function(){return z},walk:function(){return function e(t,r){var n=e3(t);
1n.getChildren().forEach(function(t){e4(t.storedValue)&&e(t.storedValue,r)}),r(n.storedValue)}}});var n,i,a,o,u,l,c,s,f,p,b,d,h,y,v=r(59533),g=r(68571),m="warn";function w(e){m=e}function P(){return m}function O(e){m=e}(n=c||(c={})).afterCreate="afterCreate",n.afterAttach="afterAttach",n.afterCreationFinalization="afterCreationFinalization",n.beforeDetach="beforeDetach",n.beforeDestroy="beforeDestroy";var j=function(e,t){return(j=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function _(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}j(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var S=function(){return(S=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function A(e,t){var r,n,i,a,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(u){return function(l){return function(u){if(r)throw TypeError("Generator is already executing.");for(;a&&(a=0,u[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&u[0]?n.return:u[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,u[1])).done)return i;switch(n=0,i&&(u=[2&u[0],i.value]),u[0]){case 0:case 1:i=u;break;case 4:return o.label++,{value:u[1],done:!1};case 5:o.label++,n=u[1],u=[0];continue;case 7:u=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===u[0]||2===u[0])){o=0;continue}if(3===u[0]&&(!i||u[1]>i[0]&&u[1]<i[3])){o.label=u[1];break}if(6===u[0]&&o.label<i[1]){o.label=i[1],i=u;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(u);break}i[2]&&o.ops.pop(),o.trys.pop();continue}u=t.call(e,o)}catch(e){u=[6,e],n=0}finally{r=i=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,l])}}}function I(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function T(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function C(e,t,r){if(r||2==arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function E(e){return e3(e).type}function N(e,t){return e3(e).getChildType(t)}function V(e,t){return e3(e).onPatch(t)}function D(e,t){return e3(e).onSnapshot(t)}function x(e,t){e3(e).applyPatches(tp(t))}function k(e,t){var r,n={patches:[],inversePatches:[]},i={},a={get recording(){return!!r},get patches(){return i.patches||(i.patches=n.patches.slice()),i.patches},get reversedInversePatches(){return i.reversedInversePatches||(i.reversedInversePatches=n.inversePatches.slice().reverse()),i.reversedInversePatches},get inversePatches(){return i.inversePatches||(i.inversePatches=n.inversePatches.slice()),i.inversePatches},stop:function(){r&&(r(),r=void 0)},resume:function(){r||(r=V(e,function(e,r){(!t||t(e,r,eU()))&&(n.patches.push(e),n.inversePatches.push(r),i.patches=void 0,i.inversePatches=void 0,i.reversedInversePatches=void 0)}))},replay:function(t){x(t||e,n.patches)},undo:function(t){x(t||e,n.inversePatches.slice().reverse())}};return a.resume(),a}function R(e){var t=e3(e);if(!t.isRoot)throw new tl("`protect` can only be invoked on root nodes");t.isProtectionEnabled=!0}function z(e){var t=e3(e);if(!t.isRoot)throw new tl("`unprotect` can only be invoked on root nodes");t.isProtectionEnabled=!1}function F(e){return e3(e).isProtected}
1function M(e,t){return e3(e).applySnapshot(t)}function L(e,t){void 0===t&&(t=!0);var r=e3(e);return t?r.snapshot:function(e){return e}(r.type.getSnapshot(r,!1))}function H(e,t){void 0===t&&(t=1);for(var r=e3(e).parent;r;){if(0==--t)return!0;r=r.parent}return!1}function U(e,t){void 0===t&&(t=1);for(var r=t,n=e3(e).parent;n;){if(0==--r)return n.storedValue;n=n.parent}throw new tl("Failed to find the parent of ".concat(e3(e)," at depth ").concat(t))}function $(e,t){for(var r=e3(e).parent;r;){if(t.is(r.storedValue))return!0;r=r.parent}return!1}function G(e,t){for(var r=e3(e).parent;r;){if(t.is(r.storedValue))return r.storedValue;r=r.parent}throw new tl("Failed to find the parent of ".concat(e3(e)," of a given type"))}function W(e){return e3(e).root.storedValue}function Z(e){return e3(e).path}function Y(e){return tR(e3(e).path)}function J(e){return e3(e).isRoot}function B(e,t){tI(t,2);var r=te(e3(e),t);return r?r.value:void 0}function K(e,t,r){var n=e3(t).root.identifierCache.resolve(e,""+r);return null==n?void 0:n.value}function q(e){return e3(e).identifier}function Q(e,t){void 0===t&&(t=!0);try{var r=e();if(null==r)return;if(e4(r)){if(!t)return r;return ea(r)?r:void 0}throw new tl("The reference to be checked is not one of node, null or undefined")}catch(e){if(e instanceof rj)return;throw e}}function X(e,t){void 0===t&&(t=!0);try{var r=e();if(null==r)return!1;if(e4(r))return!t||ea(r);throw new tl("The reference to be checked is not one of node, null or undefined")}catch(e){if(e instanceof rj)return!1;throw e}}function ee(e,t){tI(t,2);var r=te(e3(e),t,!1);if(void 0!==r)try{return r.value}catch(e){return}}function et(e,t){return e9(e3(e),e3(t))}function er(e,t){void 0===t&&(t=!0);var r=e3(e);return r.type.create(r.snapshot,!0===t?r.root.environment:!1===t?void 0:t)}function en(e){return e3(e).detach(),e}function ei(e){var t=e3(e);t.isRoot?t.die():t.parent.removeChild(t.subpath)}function ea(e){return e3(e).observableIsAlive}function eo(e,t){return e3(e).addDisposer(t),t}function eu(e){var t=e3(e),r=t.root.environment;if(!r)throw new tl("Failed to find the environment of ".concat(t," ").concat(t.path));return r}function el(e){return!!e3(e).root.environment}function ec(e){var t;return{name:(t=e4(e)?E(e):e).name,properties:S({},t.properties)}}function es(e){var t=e3(e).type,r=S(S({},ec(t)),{actions:[],volatile:[],views:[],flowActions:[]});return Object.getOwnPropertyNames(e).forEach(function(t){if(!(t in r.properties)){var n=Object.getOwnPropertyDescriptor(e,t);if(n.get){(0,v.isComputedProp)(e,t)?r.views.push(t):r.volatile.push(t);return}!0===n.value._isFlowAction&&r.flowActions.push(t),!0===n.value._isMSTAction?r.actions.push(t):(0,v.isObservableProp)(e,t)?r.volatile.push(t):r.views.push(t)}}),r}function ef(e){return e}function ep(e){return e}function eb(e){return e}function ed(e){return e3(e).nodeId}"function"==typeof SuppressedError&&SuppressedError;var eh=function(){function e(e,t,r,n){Object.defineProperty(this,"type",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"environment",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(this,"_escapedSubpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_subpathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_pathUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"storedValue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"aliveAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_state",{enumerable:!0,configurable:!0,writable:!0,value:h.INITIALIZING}),Object.defineProperty(this,"_hookSubscribers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_parent",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"pathAtom",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.environment=n,this.baseSetParent(t,r)}return Object.defineProperty(e.prototype,"subpath",{get:function(){return this._subpath}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"subpathUponDeath",{get:function(){return this._subpathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"pathUponDeath",{get:function(){return this._pathUponDeath},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"state",{get:function(){return this._state},set:function(e){var t=this.isAlive;this._state=e;var r=this.isAlive;this.aliveAtom&&t!==r&&this.aliveAtom.reportChanged()},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fireInternalHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._hookSubscribers&&this._hookSubscribers.emit(e,this,e)}}),Object.defineProperty(e.prototype,"registerHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._hookSubscribers||(this._hookSubscribers=new tP),this._hookSubscribers.register(e,t)}}),Object.defineProperty(e.prototype,"parent",{get:function(){return this._parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getReconciliationType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type}}),Object.defineProperty(e.prototype,"baseSetParent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._parent=e,this._subpath=t,this._escapedSubpath=void 0,this.pathAtom&&this.pathAtom.reportChanged()}}),Object.defineProperty(e.prototype,"path",{get:function(){return this.getEscapedPath(!0)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getEscapedPath",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(e&&(this.pathAtom||(this.pathAtom=(0,v.createAtom)("path")),this.pathAtom.reportObserved()),this.parent)?(void 0===this._escapedSubpath&&(this._escapedSubpath=this._subpath?tD(this._subpath):""),this.parent.getEscapedPath(e)+"/"+this._escapedSubpath):""}}),Object.defineProperty(e.prototype,"isRoot",{get:function(){return null===this.parent},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isAlive",{get:function(){return this.state!==h.DEAD},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"isDetaching",{get:function(){return this.state===h.DETACHING},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"observableIsAlive",{get:function(){return this.aliveAtom||(this.aliveAtom=(0,v.createAtom)("alive")),this.aliveAtom.reportObserved(),this.isAlive},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"baseFinalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.state===h.CREATED){if(this.parent){if(this.parent.state!==h.FINALIZED)return;this.fireHook(c.afterAttach)}this.state=h.FINALIZED,e&&e()}}}),Object.defineProperty(e.prototype,"baseFinalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._hookSubscribers&&this._hookSubscribers.clearAll(),this._subpathUponDeath=this._subpath,this._pathUponDeath=this.getEscapedPath(!1),this.baseSetParent(null,""),this.state=h.DEAD}}),Object.defineProperty(e.prototype,"baseAboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.fireHook(c.beforeDestroy)}}),e}(),ey=function(e){function t(t,r,n,i,a){var o=e.call(this,t,r,n,i)||this;try{o.storedValue=t.createNewInstance(a)}catch(e){throw o.state=h.DEAD,e}return o.state=h.CREATED,o.finalizeCreation(),o}return _(t,e),Object.defineProperty(t.prototype,"root",{get:function(){if(!this.parent)throw new tl("This scalar node is not part of a tree");return this.parent.root},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.parent!==e,n=this.subpath!==t;(r||n)&&(this.environment=void 0,this.baseSetParent(this.parent,t))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return function(e){return e}(this.getSnapshot())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,
1configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=(this.isAlive?this.path:this.pathUponDeath)||"<root>";return"".concat(this.type.name,"@").concat(e).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isAlive&&this.state!==h.DETACHING&&(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeCreation()}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseAboutToDie()}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.fireInternalHook(e)}}),t}(eh);ey.prototype.die=(0,v.action)(ey.prototype.die);var ev=1;(i=s||(s={}))[i.UNINITIALIZED=0]="UNINITIALIZED",i[i.CREATING=1]="CREATING",i[i.CREATED=2]="CREATED",(a=f||(f={})).Dispose="dispose",a.Patch="patch",a.Snapshot="snapshot";var eg={onError:function(e){throw e}},em=function(e){function t(t,r,n,i,a){var o=e.call(this,t,r,n,i)||this;if(Object.defineProperty(o,"nodeId",{enumerable:!0,configurable:!0,writable:!0,value:++ev}),Object.defineProperty(o,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"unnormalizedIdentifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"identifierCache",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"isProtectionEnabled",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(o,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"hasSnapshotPostProcessor",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_applyPatches",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_applySnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_autoUnbox",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(o,"_isRunningAction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_hasSnapshotReaction",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_observableInstanceState",{enumerable:!0,configurable:!0,writable:!0,value:s.UNINITIALIZED}),Object.defineProperty(o,"_childNodes",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_initialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_cachedInitialSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_cachedInitialSnapshotCreated",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(o,"_snapshotComputed",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_snapshotUponDeath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(o,"_internalEvents",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),o._snapshotComputed=(0,v.computed)(function(){return function(e){return e}(o.getSnapshot())}),o.unbox=o.unbox.bind(o),o._initialSnapshot=function(e){return e}(a),o.identifierAttribute=t.identifierAttribute,r||(o.identifierCache=new e0),o._childNodes=t.initializeChildNodes(o,o._initialSnapshot),o.identifier=null,o.unnormalizedIdentifier=null,o.identifierAttribute&&o._initialSnapshot){var u=o._initialSnapshot[o.identifierAttribute];if(void 0===u){var l=o._childNodes[o.identifierAttribute];l&&(u=l.value)}if("string"!=typeof u&&"number"!=typeof u)throw new tl("Instance identifier '".concat(o.identifierAttribute,"' for type '").concat(o.type.name,"' must be a string or a number"));o.identifier=""+u,o.unnormalizedIdentifier=u}
1return r?r.root.identifierCache.addNodeToCache(o):o.identifierCache.addNodeToCache(o),o}return _(t,e),Object.defineProperty(t.prototype,"applyPatches",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.createObservableInstanceIfNeeded(),this._applyPatches(e)}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.createObservableInstanceIfNeeded(),this._applySnapshot(e)}}),Object.defineProperty(t.prototype,"createObservableInstanceIfNeeded",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=!0),this._observableInstanceState===s.UNINITIALIZED&&this.createObservableInstance(e)}}),Object.defineProperty(t.prototype,"createObservableInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(e){void 0===e&&(e=!0),this._observableInstanceState=s.CREATING;for(var t,r,n,i,a=[],o=this.parent;o&&o._observableInstanceState===s.UNINITIALIZED;)a.unshift(o),o=o.parent;try{for(var u=I(a),l=u.next();!l.done;l=u.next()){var f=l.value;f.createObservableInstanceIfNeeded(!1)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}var p=this.type;try{this.storedValue=p.createNewInstance(this._childNodes),this.preboot(),this._isRunningAction=!0,p.finalizeNewInstance(this,this.storedValue)}catch(e){throw this.state=h.DEAD,e}finally{this._isRunningAction=!1}if(this._observableInstanceState=s.CREATED,this._snapshotComputed.trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this._childNodes=to,this.state=h.CREATED,e){this.fireHook(c.afterCreate),this.finalizeCreation();try{for(var b=I(a.reverse()),d=b.next();!d.done;d=b.next()){var f=d.value;f.fireHook(c.afterCreate),f.finalizeCreation()}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=b.return)&&i.call(b)}finally{if(n)throw n.error}}}}}),Object.defineProperty(t.prototype,"root",{get:function(){var e=this.parent;return e?e.root:this},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"clearParent",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.parent){this.fireHook(c.beforeDetach);var e=this.state;this.state=h.DETACHING;var t=this.root,r=t.environment,n=t.identifierCache.splitCache(this);try{this.parent.removeChild(this.subpath),this.baseSetParent(null,""),this.environment=r,this.identifierCache=n}finally{this.state=e}}}}),Object.defineProperty(t.prototype,"setParent",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e!==this.parent,n=t!==this.subpath;(r||n)&&(r?(this.environment=void 0,e.root.identifierCache.mergeCache(this),this.baseSetParent(e,t),this.fireHook(c.afterAttach)):n&&this.baseSetParent(this.parent,t))}}),Object.defineProperty(t.prototype,"fireHook",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this.fireInternalHook(e);var r=this.storedValue&&"object"==typeof this.storedValue&&this.storedValue[e];"function"==typeof r&&(v._allowStateChangesInsideComputed?(0,v._allowStateChangesInsideComputed)(function(){r.apply(t.storedValue)}):r.apply(this.storedValue))}}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return this.hasSnapshotPostProcessor&&this.createObservableInstanceIfNeeded(),this._snapshotComputed.get()},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.isAlive?this._observableInstanceState===s.CREATED?this._getActualSnapshot():this._getCachedInitialSnapshot():this._snapshotUponDeath}}),Object.defineProperty(t.prototype,"_getActualSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.type.getSnapshot(this)}}),Object.defineProperty(t.prototype,"_getCachedInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this._cachedInitialSnapshotCreated){var e=this.type,t=this._childNodes,r=this._initialSnapshot;this._cachedInitialSnapshot=e.processInitialSnapshot(t,r),this._cachedInitialSnapshotCreated=!0}return this._cachedInitialSnapshot}}),Object.defineProperty(t.prototype,"isRunningAction",{enumerable:!1,
1configurable:!0,writable:!0,value:function(){return!!this._isRunningAction||!this.isRoot&&this.parent.isRunningAction()}}),Object.defineProperty(t.prototype,"assertAlive",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=m;if(!this.isAlive&&"ignore"!==t){var r=this._getAssertAliveError(e);switch(t){case"error":throw new tl(r);case"warn":(function(e){console.warn(Error("[mobx-state-tree] ".concat(e)))})(r)}}}}),Object.defineProperty(t.prototype,"_getAssertAliveError",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getEscapedPath(!1)||this.pathUponDeath||"",r=e.subpath&&tD(e.subpath)||"",n=e.actionContext||d;n&&"action"!==n.type&&n.parentActionEvent&&(n=n.parentActionEvent);var i="";if(n&&null!=n.name){var a=n&&n.context&&Z(n.context)||t;i="".concat(a,".").concat(n.name,"()")}return"You are trying to read or write to an object that is no longer part of a state tree. (Object type: '".concat(this.type.name,"', Path upon death: '").concat(t,"', Subpath: '").concat(r,"', Action: '").concat(i,"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.")}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.assertAlive({subpath:e}),this._autoUnbox=!1;try{return this._observableInstanceState===s.CREATED?this.type.getChildNode(this,e):this._childNodes[e]}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.assertAlive(to),this._autoUnbox=!1;try{return this._observableInstanceState===s.CREATED?this.type.getChildren(this):tr(this._childNodes)}finally{this._autoUnbox=!0}}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.type.getChildType(e)}}),Object.defineProperty(t.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"assertWritable",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.assertAlive(e),!this.isRunningAction()&&this.isProtected)throw new tl("Cannot modify '".concat(this,"', the object is protected and can only be modified by using an action."))}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.type.removeChild(this,e)}}),Object.defineProperty(t.prototype,"unbox",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e?(this.assertAlive({subpath:e.subpath||e.subpathUponDeath}),this._autoUnbox?e.value:e):e}}),Object.defineProperty(t.prototype,"toString",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=(this.isAlive?this.path:this.pathUponDeath)||"<root>",t=this.identifier?"(id: ".concat(this.identifier,")"):"";return"".concat(this.type.name,"@").concat(e).concat(t).concat(this.isAlive?"":" [dead]")}}),Object.defineProperty(t.prototype,"finalizeCreation",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this.baseFinalizeCreation(function(){var t,r;try{for(var n=I(e.getChildren()),i=n.next();!i.done;i=n.next())i.value.finalizeCreation()}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}e.fireInternalHook(c.afterCreationFinalization)})}}),Object.defineProperty(t.prototype,"detach",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(!this.isAlive)throw new tl("Error while detaching, node is not alive.");this.clearParent()}}),Object.defineProperty(t.prototype,"preboot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;this._applyPatches=eF(this.storedValue,"@APPLY_PATCHES",function(t){t.forEach(function(t){if(!t.path){e.type.applySnapshot(e,t.value);return}var r=tR(t.path);tt(e,r.slice(0,-1)).applyPatchLocally(r[r.length-1],t)})}),this._applySnapshot=eF(this.storedValue,"@APPLY_SNAPSHOT",function(t){if(t!==e.snapshot)return e.type.applySnapshot(e,t)}),tm(this.storedValue,"$treenode",this),tm(this.storedValue,"toJSON",e8)}}
1),Object.defineProperty(t.prototype,"die",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.isAlive&&this.state!==h.DETACHING&&(this.aboutToDie(),this.finalizeDeath())}}),Object.defineProperty(t.prototype,"aboutToDie",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._observableInstanceState!==s.UNINITIALIZED&&(this.getChildren().forEach(function(e){e.aboutToDie()}),this.baseAboutToDie(),this._internalEventsEmit(f.Dispose),this._internalEventsClear(f.Dispose))}}),Object.defineProperty(t.prototype,"finalizeDeath",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.getChildren().forEach(function(e){e.finalizeDeath()}),this.root.identifierCache.notifyDied(this);var e=this.snapshot;this._snapshotUponDeath=e,this._internalEventsClearAll(),this.baseFinalizeDeath()}}),Object.defineProperty(t.prototype,"onSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._addSnapshotReaction(),this._internalEventsRegister(f.Snapshot,e)}}),Object.defineProperty(t.prototype,"emitSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._internalEventsEmit(f.Snapshot,e)}}),Object.defineProperty(t.prototype,"onPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._internalEventsRegister(f.Patch,e)}}),Object.defineProperty(t.prototype,"emitPatch",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._internalEventsHasSubscribers(f.Patch)){var r=t.path.substr(this.path.length)+(e.path?"/"+e.path:""),n=T(function(e){if(!("oldValue"in e))throw new tl("Patches without `oldValue` field cannot be inversed");return[function(e){switch(e.op){case"add":return{op:"add",path:e.path,value:e.value};case"remove":return{op:"remove",path:e.path};case"replace":return{op:"replace",path:e.path,value:e.value}}}(e),function(e){switch(e.op){case"add":return{op:"remove",path:e.path};case"remove":return{op:"add",path:e.path,value:e.oldValue};case"replace":return{op:"replace",path:e.path,value:e.oldValue}}}(e)]}(function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];for(var n=0;n<t.length;n++){var i=t[n];for(var a in i)e[a]=i[a]}return e}({},e,{path:r})),2),i=n[0],a=n[1];this._internalEventsEmit(f.Patch,i,a)}this.parent&&this.parent.emitPatch(e,t)}}),Object.defineProperty(t.prototype,"hasDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._internalEventsHas(f.Dispose,e)}}),Object.defineProperty(t.prototype,"addDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this.hasDisposer(e)){this._internalEventsRegister(f.Dispose,e,!0);return}throw new tl("cannot add a disposer when it is already registered for execution")}}),Object.defineProperty(t.prototype,"removeDisposer",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this._internalEventsHas(f.Dispose,e))throw new tl("cannot remove a disposer which was never registered for execution");this._internalEventsUnregister(f.Dispose,e)}}),Object.defineProperty(t.prototype,"removeMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(this.middlewares){var t=this.middlewares.indexOf(e);t>=0&&this.middlewares.splice(t,1)}}}),Object.defineProperty(t.prototype,"addMiddleWare",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=!0);var n={handler:e,includeHooks:t};return this.middlewares?this.middlewares.push(n):this.middlewares=[n],function(){r.removeMiddleware(n)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this.assertWritable({subpath:e}),this.createObservableInstanceIfNeeded(),this.type.applyPatchLocally(this,e,t)}}),Object.defineProperty(t.prototype,"_addSnapshotReaction",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;if(!this._hasSnapshotReaction){var t=(0,v.reaction)(function(){return e.snapshot},function(t){return e.emitSnapshot(t)},eg);this.addDisposer(t),this._hasSnapshotReaction=!0}}}),Object.defineProperty(t.prototype,"_internalEventsHasSubscribers",{enumerable:!1,
1configurable:!0,writable:!0,value:function(e){return!!this._internalEvents&&this._internalEvents.hasSubscribers(e)}}),Object.defineProperty(t.prototype,"_internalEventsRegister",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){return void 0===r&&(r=!1),this._internalEvents||(this._internalEvents=new tP),this._internalEvents.register(e,t,r)}}),Object.defineProperty(t.prototype,"_internalEventsHas",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return!!this._internalEvents&&this._internalEvents.has(e,t)}}),Object.defineProperty(t.prototype,"_internalEventsUnregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){this._internalEvents&&this._internalEvents.unregister(e,t)}}),Object.defineProperty(t.prototype,"_internalEventsEmit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];this._internalEvents&&(t=this._internalEvents).emit.apply(t,C([e],T(r),!1))}}),Object.defineProperty(t.prototype,"_internalEventsClear",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this._internalEvents&&this._internalEvents.clear(e)}}),Object.defineProperty(t.prototype,"_internalEventsClearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this._internalEvents&&this._internalEvents.clearAll()}}),t}(eh);em.prototype.createObservableInstance=(0,v.action)(em.prototype.createObservableInstance),em.prototype.detach=(0,v.action)(em.prototype.detach),em.prototype.die=(0,v.action)(em.prototype.die),(o=b||(b={}))[o.String=1]="String",o[o.Number=2]="Number",o[o.Boolean=4]="Boolean",o[o.Date=8]="Date",o[o.Literal=16]="Literal",o[o.Array=32]="Array",o[o.Map=64]="Map",o[o.Object=128]="Object",o[o.Frozen=256]="Frozen",o[o.Optional=512]="Optional",o[o.Reference=1024]="Reference",o[o.Identifier=2048]="Identifier",o[o.Late=4096]="Late",o[o.Refinement=8192]="Refinement",o[o.Union=16384]="Union",o[o.Null=32768]="Null",o[o.Undefined=65536]="Undefined",o[o.Integer=131072]="Integer",o[o.Custom=262144]="Custom",o[o.SnapshotProcessor=524288]="SnapshotProcessor",o[o.Lazy=1048576]="Lazy",o[o.Finite=2097152]="Finite",o[o.Float=4194304]="Float";var ew="cannotDetermine",eP=Symbol("$type"),eO=function(){function e(e){Object.defineProperty(this,p,{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"C",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"S",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"T",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"N",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isType",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e}return Object.defineProperty(e.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return eq(this,e),this.instantiate(null,"",t,e).value}}),Object.defineProperty(e.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){throw new tl("unimplemented method")}}),Object.defineProperty(e.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e===this}}),Object.defineProperty(e.prototype,"validate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(e5(e)){var r=E(e);return this.isAssignableFrom(r)?ta:eB(t,e)}return this.isValidSnapshot(e,t)}}),Object.defineProperty(e.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return 0===this.validate(e,[{path:"",type:this}]).length}}),Object.defineProperty(e.prototype,"Type",{get:function(){throw new tl("Factory.Type should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.Type`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"TypeWithoutSTN",{get:function(){throw new tl("Factory.TypeWithoutSTN should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.TypeWithoutSTN`")}
1,enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"SnapshotType",{get:function(){throw new tl("Factory.SnapshotType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.SnapshotType`")},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CreationType",{get:function(){throw new tl("Factory.CreationType should not be actually called. It is just a Type signature that can be used at compile time with Typescript, by using `typeof type.CreationType`")},enumerable:!1,configurable:!0}),e}();p=eP,eO.prototype.create=(0,v.action)(eO.prototype.create);var ej=function(e){function t(t){var r=e.call(this,t)||this;return Object.defineProperty(r,"identifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),r}return _(t,e),Object.defineProperty(t.prototype,"create",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return void 0===t&&(t=this.getDefaultSnapshot()),e.prototype.create.call(this,t,r)}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.createObservableInstanceIfNeeded(),e.storedValue}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return!e.identifierAttribute||e.identifier===""+t[e.identifierAttribute]}}),Object.defineProperty(t.prototype,"tryToReconcileNode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return!e.isDetaching&&(!!(e.snapshot===t||e4(t)&&e3(t)===e)||!!(e.type===this&&td(t)&&!e4(t)&&this.isMatchingSnapshotId(e,t))&&(e.applySnapshot(t),!0))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(this.tryToReconcileNode(e,t))return e.setParent(r,n),e;if(e.die(),e4(t)&&this.isAssignableFrom(E(t))){var i=e3(t);return i.setParent(r,n),i}return this.instantiate(r,n,void 0,t)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(eO);ej.prototype.create=(0,v.action)(ej.prototype.create);var e_=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return _(t,e),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e}}),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(!e.isDetaching&&e.type===this&&e.storedValue===t)return e;var i=this.instantiate(r,n,void 0,t);return e.die(),i}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return null}}),t}(eO);function eS(e){return"object"==typeof e&&e&&!0===e.isType}function eA(e,t){}var eI=new Map;function eT(e){return function(t,r,n){switch(t.type){case"action":if(e.filter&&!0!==e.filter(t))return r(t);var i=e.onStart(t);e.onResume(t,i),eI.set(t.id,{call:t,context:i,async:!1});try{var a=r(t);return e.onSuspend(t,i),!1===eI.get(t.id).async&&(eI.delete(t.id),e.onSuccess(t,i,a)),a}catch(r){throw eI.delete(t.id),e.onFail(t,i,r),r}case"flow_spawn":var o=eI.get(t.rootId);return o.async=!0,r(t);case"flow_resume":case"flow_resume_error":var o=eI.get(t.rootId);e.onResume(t,o.context);try{return r(t)}finally{e.onSuspend(t,o.context)}case"flow_throw":var o=eI.get(t.rootId);return eI.delete(t.rootId),e.onFail(t,o.context,t.args[0]),r(t);case"flow_return":var o=eI.get(t.rootId);return eI.delete(t.rootId),e.onSuccess(t,o.context,t.args[0]),r(t)}}}var eC=function(){function e(e,t){Object.defineProperty(this,"hooks",{enumerable:!0,configurable:!0,writable:!0,value:e}),Object.defineProperty(this,"call",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"flowsPending",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"running",{enumerable:!0,configurable:!0,writable:!0,value:!0}),e&&e.onStart(t)}return Object.defineProperty(e.prototype,"finish",{enumerable:!1,
1configurable:!0,writable:!0,value:function(e){this.running&&(this.running=!1,this.hooks&&this.hooks.onFinish(this.call,e))}}),Object.defineProperty(e.prototype,"incFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending++}}),Object.defineProperty(e.prototype,"decFlowsPending",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.flowsPending--}}),Object.defineProperty(e.prototype,"hasFlowsPending",{get:function(){return this.flowsPending>0},enumerable:!1,configurable:!0}),e}();function eE(e){var t=new Map;return function(r,n){var i=r.parentActionEvent?t.get(r.parentActionEvent.id):void 0;if("action"===r.type){var a=S(S({},r),{env:i&&i.call.env,parentCall:i&&i.call}),o=new eC(!e.filter||e.filter(a)?e:void 0,a);t.set(r.id,o);var u=void 0;try{u=n(r)}catch(e){throw t.delete(r.id),o.finish(e),e}return o.hasFlowsPending||(t.delete(r.id),o.finish()),u}if(!i)return n(r);switch(r.type){case"flow_spawn":return i.incFlowsPending(),n(r);case"flow_resume":case"flow_resume_error":return n(r);case"flow_throw":var l=r.args[0];try{return n(r)}finally{i.decFlowsPending(),i.hasFlowsPending||(t.delete(r.parentActionEvent.id),i.finish(l))}case"flow_return":try{return n(r)}finally{i.decFlowsPending(),i.hasFlowsPending||(t.delete(r.parentActionEvent.id),i.finish())}}}}function eN(e){return{$MST_UNSERIALIZABLE:!0,type:e}}function eV(e,t){(0,v.runInAction)(function(){tp(t).forEach(function(t){return function(e,t){var r=ee(e,t.path||"");if(!r)throw new tl("Invalid action path: ".concat(t.path||""));var n=e3(r);if("@APPLY_PATCHES"===t.name)return x.call(null,r,t.args[0]);if("@APPLY_SNAPSHOT"===t.name)return M.call(null,r,t.args[0]);if("function"!=typeof r[t.name])throw new tl("Action '".concat(t.name,"' does not exist in '").concat(n.path,"'"));return r[t.name].apply(r,t.args?t.args.map(function(e){return e&&"object"==typeof e&&"$MST_DATE"in e?new Date(e.$MST_DATE):e}):[])}(e,t)})})}function eD(e,t){var r,n=[],i=function(e){(!t||t(e,eU()))&&n.push(e)},a={actions:n,get recording(){return!!r},stop:function(){r&&(r(),r=void 0)},resume:function(){r||(r=ex(e,i))},replay:function(e){eV(e,n)}};return a.resume(),a}function ex(e,t,r){return void 0===r&&(r=!1),eM(e,function(n,i){if("action"!==n.type||n.id!==n.rootId)return i(n);var a=e3(n.context),o={name:n.name,path:e9(e3(e),a),args:n.args.map(function(e,t){return function(e,t,r,n){if(n instanceof Date)return{$MST_DATE:n.getTime()};if(th(n))return n;if(e4(n))return eN("[MSTNode: ".concat(E(n).name,"]"));if("function"==typeof n)return eN("[function]");if("object"==typeof n&&!tb(n)&&!tf(n))return eN("[object ".concat(n&&n.c
1onstructor&&n.constructor.name||"Complex Object","]"));try{return JSON.stringify(n),n}catch(e){return eN(""+e)}}(0,n.name,0,e)})};if(!r)return t(o),i(n);var u=i(n);return t(o),u})}var ek=1;function eR(e,t){var r=e3(e.context);"action"===e.type&&r.assertAlive({actionContext:e});var n=r._isRunningAction;r._isRunningAction=!0;var i=d;d=e;try{return function(e,t,r){var n=new eH(e,r);if(n.isEmpty)return(0,v.action)(r).apply(null,t.args);var i=null;return function e(t){var a,o=n.getNextMiddleware(),u=o&&o.handler;if(!u)return(0,v.action)(r).apply(null,t.args);if(!o.includeHooks&&c[t.name])return e(t);var l=!1,s=!1;u(t,function(t,r){l=!0,i=e(t),r&&(i=r(i))},function(e){s=!0,i=e});return i}(t)}(r,e,t)}finally{d=i,r._isRunningAction=n}}function ez(e){if(e)return"action"===e.type?e:e.parentActionEvent}function eF(e,t,r){var n=function(){var n=ek++,i=d,a=ez(i);return eR({type:"action",name:t,id:n,args:tO(arguments),context:e,tree:W(e),rootId:i?i.rootId:n,parentId:i?i.id:0,allParentIds:i?C(C([],T(i.allParentIds),!1),[i.id],!1):[],parentEvent:i,parentActionEvent:a},r)};return n._isMSTAction=!0,n._isFlowAction=r._isFlowAction,n}function eM(e,t,r){return void 0===r&&(r=!0),e3(e).addMiddleWare(t,r)}function eL(e,t,r){void 0===r&&(r=!0);var n={handler:e,includeHooks:r};return t.$mst_middleware=t.$mst_middleware||[],t.$mst_middleware.push(n),t}var eH=function(){function e(e,t){Object.defineProperty(this,"arrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"inArrayIndex",{enumerable:!0,configurable:!0,writable:!0,value:0}),Object.defineProperty(this,"middlewares",{enumerable:!0,configurable:!0,writable:!0,value:[]}),t.$mst_middleware&&this.middlewares.push(t.$mst_middleware);for(var r=e;r;)r.middlewares&&this.middlewares.push(r.middlewares),r=r.parent}return Object.defineProperty(e.prototype,"isEmpty",{get:function(){return this.middlewares.length<=0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"getNextMiddleware",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.middlewares[this.arrayIndex];if(e)return e[this.inArrayIndex++]||(this.arrayIndex++,this.inArrayIndex=0,this.getNextMiddleware())}}),e}();function eU(){for(var e=d;e&&"action"!==e.type;)e=e.parentActionEvent;return e}function e$(e,t,r){for(var n="number"==typeof t?t:t.id,i=r?e:e.parentActionEvent;i;){if(i.id===n)return!0;i=i.parentActionEvent}return!1}function eG(e,t){return e$(e,t,!1)}function eW(e,t){return e$(e,t,!0)}function eZ(e){return"function"==typeof e?"<function".concat(e.name?" "+e.name:"",">"):e4(e)?"<".concat(e,">"):"`".concat(function(e){try{return JSON.stringify(e)}catch(e){return"<Unserializable: ".concat(e,">")}}(e),"`")}function eY(e){var t=e.value,r=e.context[e.context.length-1].type,n=e.context.map(function(e){return e.path}).filter(function(e){return e.length>0}).join("/"),i=n.length>0?'at path "/'.concat(n,'" '):"",a=e4(t)?"value of type ".concat(e3(t).type.name,":"):th(t)?"value":"snapshot",o=r&&e4(t)&&r.is(e3(t).snapshot);return"".concat(i).concat(a," ").concat(eZ(t)," is not assignable ").concat(r?"to type: `".concat(r.name,"`"):"")+(e.message?" (".concat(e.message,")"):"")+(r?re(r)||th(t)?".":", expected an instance of `".concat(r.name,"` or a snapshot like `").concat(r.describe(),"` instead.")+(o?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function eJ(e,t,r){return e.concat([{path:t,type:r}])}function eB(e,t,r){return[{context:e,value:t,message:r}]}function eK(e){return e.reduce(function(e,t){return e.concat(t)},[])}function eq(e,t){void 0!==g&&g.env&&"true"===g.env.ENABLE_TYPE_CHECK&&eQ(e,t)}function eQ(e,t){var r=e.validate(t,[{path:"",type:e}]);if(r.length>0)throw new tl(function(e,t,r){var n;if(0!==r.length)return"Error while converting ".concat((n=eZ(t)).length<280?n:"".concat(n.substring(0,272),"......").concat(n.substring(n.length-8))," to `").concat(e.name,"`:\n\n ")+r.map(eY).join("\n ")}(e,t,r))}var eX=0,e0=function(){function e(){Object.defineProperty(this,"cacheId",{enumerable:!0,configurable:!0,writable:!0,value:eX++}
1),Object.defineProperty(this,"cache",{enumerable:!0,configurable:!0,writable:!0,value:v.observable.map()}),Object.defineProperty(this,"lastCacheModificationPerId",{enumerable:!0,configurable:!0,writable:!0,value:v.observable.map()})}return Object.defineProperty(e.prototype,"updateLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.lastCacheModificationPerId.get(e);this.lastCacheModificationPerId.set(e,void 0===t?1:t+1)}}),Object.defineProperty(e.prototype,"getLastCacheModificationPerId",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.lastCacheModificationPerId.get(e)||0;return"".concat(this.cacheId,"-").concat(t)}}),Object.defineProperty(e.prototype,"addNodeToCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(void 0===t&&(t=!0),e.identifierAttribute){var r=e.identifier;this.cache.has(r)||this.cache.set(r,v.observable.array([],tu));var n=this.cache.get(r);if(-1!==n.indexOf(e))throw new tl("Already registered");n.push(e),t&&this.updateLastCacheModificationPerId(r)}}}),Object.defineProperty(e.prototype,"mergeCache",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(0,v.values)(e.identifierCache.cache).forEach(function(e){return e.forEach(function(e){t.addNodeToCache(e)})})}}),Object.defineProperty(e.prototype,"notifyDied",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.identifierAttribute){var t=e.identifier,r=this.cache.get(t);r&&(r.remove(e),r.length||this.cache.delete(t),this.updateLastCacheModificationPerId(e.identifier))}}}),Object.defineProperty(e.prototype,"splitCache",{enumerable:!1,configurable:!0,writable:!0,value:function(t){var r=this,n=new e,i=t.path+"/";return(0,v.entries)(this.cache).forEach(function(e){for(var a=T(e,2),o=a[0],u=a[1],l=!1,c=u.length-1;c>=0;c--){var s=u[c];(s===t||0===s.path.indexOf(i))&&(n.addNodeToCache(s,!1),u.splice(c,1),u.length||r.cache.delete(o),l=!0)}l&&r.updateLastCacheModificationPerId(o)}),n}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.cache.get(t);
1return!!r&&r.some(function(t){return e.isAssignableFrom(t.type)})}}),Object.defineProperty(e.prototype,"resolve",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.cache.get(t);if(!r)return null;var n=r.filter(function(t){return e.isAssignableFrom(t.type)});switch(n.length){case 0:return null;case 1:return n[0];default:throw new tl("Cannot resolve a reference to type '".concat(e.name,"' with id: '").concat(t,"' unambigously, there are multiple candidates: ").concat(n.map(function(e){return e.path}).join(", ")))}}}),e}();function e1(e,t,r,n,i){var a=e5(i);if(a){if(a.parent)throw new tl("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(t?t.path:"","/").concat(r,"', but it lives already at '").concat(a.path,"'"));return t&&a.setParent(t,r),a}return new em(e,t,r,n,i)}function e2(e,t,r,n,i){return new ey(e,t,r,n,i)}function e4(e){return!!(e&&e.$treenode)}function e6(e,t){}function e3(e){if(!e4(e))throw new tl("Value ".concat(e," is no MST Node"));return e.$treenode}function e5(e){return e&&e.$treenode||null}function e8(){return e3(this).snapshot}(u=h||(h={}))[u.INITIALIZING=0]="INITIALIZING",u[u.CREATED=1]="CREATED",u[u.FINALIZED=2]="FINALIZED",u[u.DETACHING=3]="DETACHING",u[u.DEAD=4]="DEAD";var e7=function(e){return".."};function e9(e,t){if(e.root!==t.root)throw new tl("Cannot calculate relative path: objects '".concat(e,"' and '").concat(t,"' are not part of the same object tree"));for(var r=tR(e.path),n=tR(t.path),i=0;i<r.length&&r[i]===n[i];i++);return r.slice(i).map(e7).join("/")+tk(n.slice(i))}function te(e,t,r){return void 0===r&&(r=!0),tt(e,tR(t),r)}function tt(e,t,r){void 0===r&&(r=!0);var n=e;try{for(var i=0;i<t.length;i++){var a=t[i];if(".."===a){if(n=n.parent)continue}else if("."===a)continue;else if(n){if(n instanceof ey){var o=n.value;e4(o)&&(n=e3(o))}if(n instanceof em&&n.getChildType(a)&&(n=n.getChildNode(a)))continue}throw new tl("Could not resolve '".concat(a,"' in path '").concat(tk(t.slice(0,i))||"/","' while resolving '").concat(tk(t),"'"))}}catch(e){if(!r)return;throw e}return n}function tr(e){if(!e)return ta;var t=Object.keys(e);if(!t.length)return ta;var r=Array(t.length);return t.forEach(function(t,n){r[n]=e[t]}),r}function tn(e){return t_("process","`process()` has been renamed to `flow()`. See https://github.com/mobxjs/mobx-state-tree/issues/399 for more information. Note that the middleware event types starting with `process` now start with `flow`."),tC(e)}var ti=Object.toString(),ta=Object.freeze([]),to=Object.freeze({}),tu=(0,v._getGlobalState)().useProxies?{deep:!1}:{deep:!1,proxy:!1};Object.freeze(tu);var tl=function(e){function t(t){return void 0===t&&(t="Illegal state"),e.call(this,"[mobx-state-tree] ".concat(t))||this}return _(t,e),t}(Error);function tc(e){return e}var ts=Number.isInteger;function tf(e){return Array.isArray(e)||(0,v.isObservableArray)(e)}function tp(e){return e?tf(e)?e:[e]:ta}function tb(e){if(null===e||"object"!=typeof e)return!1;var t,r=Object.getPrototypeOf(e);return null==r||(null===(t=r.constructor)||void 0===t?void 0:t.toString())===ti}function td(e){return null!==e&&"object"==typeof e&&!(e instanceof Date)&&!(e instanceof RegExp)}function th(e,t){return void 0===t&&(t=!0),null==e||"string"==typeof e||"number"==typeof e||"boolean"==typeof e||t&&e instanceof Date}function ty(e){return e}function tv(e){return e}function tg(e){return"function"!=typeof e}function tm(e,t,r){var n,i,a;n=e,i=t,a={enumerable:!1,writable:!1,configurable:!0,value:r},(0,v.isObservableObject)(n)?(0,v.defineProperty)(n,i,a):Object.defineProperty(n,i,a)}var tw=function(){function e(){Object.defineProperty(this,"handlers",{enumerable:!0,configurable:!0,writable:!0,value:[]})}return Object.defineProperty(e.prototype,"hasSubscribers",{get:function(){return this.handlers.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return void 0===t&&(t=!1),t?this.handlers.unshift(e):this.handlers.push(e),function(){r.unregister(e)}}}
1),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.handlers.indexOf(e)>=0}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.handlers.indexOf(e);t>=0&&this.handlers.splice(t,1)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.handlers.length=0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.handlers.slice().forEach(function(t){return t.apply(void 0,C([],T(e),!1))})}}),e}(),tP=function(){function e(){Object.defineProperty(this,"eventHandlers",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}return Object.defineProperty(e.prototype,"hasSubscribers",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.eventHandlers&&this.eventHandlers[e];return!!t&&t.hasSubscribers}}),Object.defineProperty(e.prototype,"register",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){void 0===r&&(r=!1),this.eventHandlers||(this.eventHandlers={});var n=this.eventHandlers[e];return n||(n=this.eventHandlers[e]=new tw),n.register(t,r)}}),Object.defineProperty(e.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.eventHandlers&&this.eventHandlers[e];return!!r&&r.has(t)}}),Object.defineProperty(e.prototype,"unregister",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.eventHandlers&&this.eventHandlers[e];r&&r.unregister(t)}}),Object.defineProperty(e.prototype,"clear",{enumerable:!1,configurable:!0,writable:!0,value:function(e){this.eventHandlers&&delete this.eventHandlers[e]}}),Object.defineProperty(e.prototype,"clearAll",{enumerable:!1,configurable:!0,writable:!0,value:function(){this.eventHandlers=void 0}}),Object.defineProperty(e.prototype,"emit",{enumerable:!1,configurable:!0,writable:!0,value:function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=this.eventHandlers&&this.eventHandlers[e];n&&n.emit.apply(n,C([],T(t),!1))}}),e}();function tO(e){for(var t=Array(e.length),r=0;r<e.length;r++)t[r]=e[r];return t}function tj(e,t){return 0===e.indexOf(t)}var t_=function(e,t){};function tS(e,t){}function tA(e,t,r,n){}function tI(e,t,r){void 0===r&&(r=!0)}function tT(e){"function"==typeof queueMicrotask?queueMicrotask(e):"function"==typeof setImmediate?setImmediate(e):setTimeout(e,1)}function tC(e){var t,r;return t=e.name,(r=function(){var n=ek++,i=d;if(!i)throw new tl("a mst flow must always have a parent context");var a=ez(i);if(!a)throw new tl("a mst flow must always have a parent action context");var o={name:t,id:n,tree:i.tree,context:i.context,parentId:i.id,allParentIds:C(C([],T(i.allParentIds),!1),[i.id],!1),rootId:i.rootId,parentEvent:i,parentActionEvent:a},u=arguments;function l(e,t,n){return e.$mst_middleware=r.$mst_middleware,eR(S(S({},o),{type:t,args:[n]}),e)}return new Promise(function(t,n){var i,a=function(){i=e.apply(null,arguments),c(void 0)};function c(e){var t;try{var r=l(function(e){t=i.next(e)},"flow_resume",e);r instanceof Error&&(t=i.throw(r))}catch(e){tT(function(){l(function(t){n(e)},"flow_throw",e)});return}f(t)}function s(e){var t;try{l(function(e){t=i.throw(e)},"flow_resume_error",e)}catch(e){tT(function(){l(function(t){n(e)},"flow_throw",e)});return}f(t)}function f(e){if(e.done){tT(function(){l(function(e){t(e)},"flow_return",e.value)});return}if(!e.value||"function"!=typeof e.value.then)throw new tl("Only promises can be yielded to `async`, got: "+e);return e.value.then(c,s)}a.$mst_middleware=r.$mst_middleware,eR(S(S({},o),{type:"flow_spawn",args:tO(u)}),a)})})._isFlowAction=!0,r}function tE(e){return e}function tN(e){return function(){var t,r=[];for(t=0;t<arguments.length;t++)r[t]=arguments[t];return A(this,function(t){switch(t.label){case 0:return[4,e.apply(void 0,C([],T(r),!1))];case 1:return[2,t.sent()]}})}}function tV(e){return A(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent()]}})}function tD(e){return!0==("number"==typeof e)?""+e:-1===e.indexOf("/")&&-1===e.indexOf("~")?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function tx(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function tk(e){if(0===e.length)return"";var t=function(e){return e.map(tD).join("/")};return"."===e[0]||".."===e[0]?t(e):"/"+t(e)}function tR(e){var t=e.split("/").map(tx);if(!(""===e||"."===e||".."===e||tj(e,"/")||tj(e,"./")||tj(e,"../")))throw new tl("a json path must be either rooted, empty or relative, but got '".concat(e,"'"));return""===t[0]&&t.shift(),t}t_.ids={};var tz=Symbol("$preProcessorFailed"),tF=function(e){function t(t,r,n){var i=e.call(this,n||t.name)||this;return Object.defineProperty(i,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}
1),Object.defineProperty(i,"_processors",{enumerable:!0,configurable:!0,writable:!0,value:r}),i}return _(t,e),Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|b.SnapshotProcessor},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"snapshotProcessor(".concat(this._subtype.describe(),")")}}),Object.defineProperty(t.prototype,"preProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._processors.preProcessor?this._processors.preProcessor.call(null,e):e}}),Object.defineProperty(t.prototype,"preProcessSnapshotSafe",{enumerable:!1,configurable:!0,writable:!0,value:function(e){try{return this.preProcessSnapshot(e)}catch(e){return tz}}}),Object.defineProperty(t.prototype,"postProcessSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._processors.postProcessor?this._processors.postProcessor.call(null,e,t.storedValue):e}}),Object.defineProperty(t.prototype,"_fixNode",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;(function(e,t){for(var r,n,i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];try{for(var o=I(i),u=o.next();!u.done;u=o.next()){var l=u.value;e[l]=t[l].bind(t)}}catch(e){r={error:e}}finally{try{u&&!u.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}})(e.type,this,"create"),e instanceof em&&(e.hasSnapshotPostProcessor=!!this._processors.postProcessor);var r=e.getSnapshot;e.getSnapshot=function(){return t.postProcessSnapshot(r.call(e),e)},rl(this._subtype)||(e.getReconciliationType=function(){return t})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=e4(n)?n:this.preProcessSnapshot(n),a=this._subtype.instantiate(e,t,r,i);return this._fixNode(a),a}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this._subtype.reconcile(e,e4(t)?t:this.preProcessSnapshot(t),r,n);return i!==e&&this._fixNode(i),i}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=!0);var r=this._subtype.getSnapshot(e);return t?this.postProcessSnapshot(r,e):r}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.preProcessSnapshotSafe(e);return r===tz?eB(t,e,"Failed to preprocess value"):this._subtype.validate(r,t)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),Object.defineProperty(t.prototype,"is",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=eS(e)?this._subtype:e4(e)?L(e,!1):this.preProcessSnapshotSafe(e);return t!==tz&&0===this._subtype.validate(t,[{path:"",type:this._subtype}]).length}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._subtype.isAssignableFrom(e)}}),Object.defineProperty(t.prototype,"isMatchingSnapshotId",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!(this._subtype instanceof ej))return!1;var r=this.preProcessSnapshot(t);return this._subtype.isMatchingSnapshotId(e,r)}}),t}(eO),tM="Map.put can only be used to store complex values that have an identifier type attribute";(l=y||(y={}))[l.UNKNOWN=0]="UNKNOWN",l[l.YES=1]="YES",l[l.NO=2]="NO";var tL=function(e){function t(t,r){return e.call(this,t,v.observable.ref.enhancer,r)||this}return _(t,e),Object.defineProperty(t.prototype,"get",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.get.call(this,""+t)}}),Object.defineProperty(t.prototype,"has",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.has.call(this,""+t)}}),Object.defineProperty(t.prototype,"delete",{enumerable:!1,configurable:!0,writable:!0,value:function(t){return e.prototype.delete.call(this,""+t)}}
1),Object.defineProperty(t.prototype,"set",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r){return e.prototype.set.call(this,""+t,r)}}),Object.defineProperty(t.prototype,"put",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!e)throw new tl("Map.put cannot be used to set empty values");if(e4(e)){var t=e3(e);if(null===t.identifier)throw new tl(tM);return this.set(t.identifier,e),e}if(td(e)){var r=e3(this),n=r.type;if(n.identifierMode!==y.YES)throw new tl(tM);var i=e[n.mapIdentifierAttribute];if(!rk(i)){var a=this.put(n.getChildType().create(e,r.environment));return this.put(L(a))}var o=""+i;return this.set(o,e),this.get(o)}throw new tl("Map.put can only be used to store complex values")}}),t}(v.ObservableMap),tH=function(e){function t(t,r,n){void 0===n&&(n=[]);var i=e.call(this,t)||this;return Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"identifierMode",{enumerable:!0,configurable:!0,writable:!0,value:y.UNKNOWN}),Object.defineProperty(i,"mapIdentifierAttribute",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:b.Map}),Object.defineProperty(i,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),i._determineIdentifierMode(),i.hookInitializers=n,i}return _(t,e),Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.hookInitializers.length>0?this.hookInitializers.concat(e):[e];return new t(this.name,this._subType,r)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._determineIdentifierMode(),e1(this,e,t,r,n)}}),Object.defineProperty(t.prototype,"_determineIdentifierMode",{enumerable:!1,configurable:!0,writable:!0,value:function(){if(this.identifierMode===y.UNKNOWN){var e=[];if(function e(t,r){var n,i,a=t.getSubTypes();if(a===ew)return!1;if(a){var o=tp(a);try{for(var u=I(o),l=u.next();!l.done;l=u.next()){var c=l.value;if(!e(c,r))return!1}}catch(e){n={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(n)throw n.error}}}return t instanceof tQ&&r.push(t),!0}(this._subType,e)){var t=e.reduce(function(e,t){if(!t.identifierAttribute)return e;if(e&&e!==t.identifierAttribute)throw new tl("The objects in a map should all have the same identifier attribute, expected '".concat(e,"', but child of type '").concat(t.name,"' declared attribute '").concat(t.identifierAttribute,"' as identifier"));return t.identifierAttribute},void 0);t?(this.identifierMode=y.YES,this.mapIdentifierAttribute=t):this.identifierMode=y.NO}}}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t={});var r=e.type._subType,n={};return Object.keys(t).forEach(function(i){n[i]=r.instantiate(e,i,void 0,t[i])}),n}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new tL(e,this.name)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){(0,v._interceptReads)(t,e.unbox),e.type.hookInitializers.forEach(function(e){var r=e(t);Object.keys(r).forEach(function(e){var n=r[e],i=eF(t,e,n);tm(t,e,i)})}),(0,v.intercept)(t,this.willChange),(0,v.observe)(t,this.didChange)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return(0,v.values)(e.storedValue)}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=e.storedValue.get(""+t);if(!r)throw new tl("Not a child "+t);return r}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e3(e.object),r=e.name;t.assertWritable({subpath:r});var n=t.type,i=n._subType;switch(e.type){case"update":var a=e.newValue;if(a===e.object.get(r))return null;eq(i,a),e.newValue=i.reconcile(t.getChildNode(r),e.newValue,t,r),n.processIdentifier(r,e.newValue);break;case"add":eq(i,e.newValue),e.newValue=i.instantiate(t,r,void 0,e.newValue),n.processIdentifier(r,e.newValue)}return e}}),Object.defineProperty(t.prototype,"processIdentifier",{enumerable:!1,
1configurable:!0,writable:!0,value:function(e,t){if(this.identifierMode===y.YES&&t instanceof em){var r=t.identifier;if(r!==e)throw new tl("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '".concat(r,"', but expected: '").concat(e,"'"))}}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};return e.getChildren().forEach(function(e){t[e.subpath]=e.snapshot}),t}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};return Object.keys(e).forEach(function(r){t[r]=e[r].getSnapshot()}),t}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e3(e.object);switch(e.type){case"update":return void t.emitPatch({op:"replace",path:tD(e.name),value:e.newValue.snapshot,oldValue:e.oldValue?e.oldValue.snapshot:void 0},t);case"add":return void t.emitPatch({op:"add",path:tD(e.name),value:e.newValue.snapshot,oldValue:void 0},t);case"delete":var r=e.oldValue.snapshot;return e.oldValue.die(),void t.emitPatch({op:"remove",path:tD(e.name),oldValue:r},t)}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=e.storedValue;switch(r.op){case"add":case"replace":n.set(t,r.value);break;case"remove":n.delete(t)}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){eq(this,t);var r=e.storedValue,n={};if(Array.from(r.keys()).forEach(function(e){n[e]=!1}),t)for(var i in t)r.set(i,t[i]),n[""+i]=!0;Object.keys(n).forEach(function(e){!1===n[e]&&r.delete(e)})}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return tb(e)?eK(Object.keys(e).map(function(n){return r._subType.validate(e[n],eJ(t,n,r._subType))})):eB(t,e,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return to}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e.storedValue.delete(t)}}),t}(ej);function tU(e){return eS(e)&&(e.flags&b.Map)>0}tH.prototype.applySnapshot=(0,v.action)(tH.prototype.applySnapshot);var t$=function(e){function t(t,r,n){void 0===n&&(n=[]);var i=e.call(this,t)||this;return Object.defineProperty(i,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"flags",{enumerable:!0,configurable:!0,writable:!0,value:b.Array}),Object.defineProperty(i,"hookInitializers",{enumerable:!0,configurable:!0,writable:!0,value:[]}),i.hookInitializers=n,i}return _(t,e),Object.defineProperty(t.prototype,"hooks",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var r=this.hookInitializers.length>0?this.hookInitializers.concat(e):[e];return new t(this.name,this._subType,r)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return e1(this,e,t,r,n)}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t=[]);var r=e.type._subType,n={};return t.forEach(function(t,i){var a=""+i;n[a]=r.instantiate(e,a,void 0,t)}),n}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=S(S({},tu),{name:this.name});return v.observable.array(tr(e),t)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){(0,v._getAdministration)(t).dehancer=e.unbox,e.type.hookInitializers.forEach(function(e){var r=e(t);Object.keys(r).forEach(function(e){var n=r[e],i=eF(t,e,n);tm(t,e,i)})}),(0,v.intercept)(t,this.willChange),(0,v.observe)(t,this.didChange)}}
1),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue.slice()}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=Number(t);if(r<e.storedValue.length)return e.storedValue[r];throw new tl("Not a child: "+t)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e3(e.object);t.assertWritable({subpath:""+e.index});var r=t.type._subType,n=t.getChildren();switch(e.type){case"update":if(e.newValue===e.object[e.index])return null;var i=tG(t,r,[n[e.index]],[e.newValue],[e.index]);if(!i)return null;e.newValue=i[0];break;case"splice":var a=e.index,o=e.removedCount,u=e.added,l=tG(t,r,n.slice(a,a+o),u,u.map(function(e,t){return a+t}));if(!l)return null;e.added=l;for(var c=a+o;c<n.length;c++)n[c].setParent(t,""+(c+u.length-o))}return e}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.getChildren().map(function(e){return e.snapshot})}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=[];return Object.keys(e).forEach(function(r){t.push(e[r].getSnapshot())}),t}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e3(e.object);switch(e.type){case"update":return void t.emitPatch({op:"replace",path:""+e.index,value:e.newValue.snapshot,oldValue:e.oldValue?e.oldValue.snapshot:void 0},t);case"splice":if(e.removedCount&&e.addedCount===e.object.length)return void t.emitPatch({op:"replace",path:"",value:t.snapshot,oldValue:e.removed.map(function(e){return e.snapshot})},t);for(var r=e.removedCount-1;r>=0;r--)t.emitPatch({op:"remove",path:""+(e.index+r),oldValue:e.removed[r].snapshot},t);for(var r=0;r<e.addedCount;r++)t.emitPatch({op:"add",path:""+(e.index+r),value:e.added[r].snapshot,oldValue:void 0},t);return}}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n=e.storedValue,i="-"===t?n.length:Number(t);switch(r.op){case"replace":n[i]=r.value;break;case"add":n.splice(i,0,r.value);break;case"remove":n.splice(i,1)}}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){eq(this,t),e.storedValue.replace(t)}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subType}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;return tf(e)?eK(e.map(function(e,n){return r._subType.validate(e,eJ(t,""+n,r._subType))})):eB(t,e,"Value is not an array")}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return ta}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e.storedValue.splice(Number(t),1)}}),t}(ej);function tG(e,t,r,n,i){for(var a=!0,o=0;;o++){var u,l=o<=n.length-1,c=r[o],s=l?n[o]:void 0,f=""+i[o];if(((u=s)instanceof ey||u instanceof em)&&(s=s.storedValue),c||l){if(l){if(c){if(tZ(c,s))r[o]=tW(t,e,f,s,c);else{for(var p=void 0,b=o;b<r.length;b++)if(tZ(r[b],s)){p=r.splice(b,1)[0];break}a=!1;var d=tW(t,e,f,s,p);r.splice(o,0,d)}}else{if(e4(s)&&e3(s).parent===e)throw new tl("Cannot add an object to a state tree if it is already part of the same or another state tree. Tried to assign an object to '".concat(e.path,"/").concat(f,"', but it lives already at '").concat(e3(s).path,"'"));a=!1;var d=tW(t,e,f,s);r.splice(o,0,d)}}else a=!1,r.splice(o,1),c instanceof em&&c.createObservableInstanceIfNeeded(),c.die(),o--}else break}return a?null:r}function tW(e,t,r,n,i){eq(e,n);var a=function(){if(e4(n)){var a=e3(n);if(a.assertAlive(to),null!==a.parent&&a.parent===t)return a.setParent(t,r),a}return i?e.reconcile(i,n,t,r):e.instantiate(t,r,void 0,n)}();return i&&i!==a&&(i instanceof em&&i.createObservableInstanceIfNeeded(),i.die()),a}function tZ(e,t){if(!e.isAlive)return!1;if(e4(t)){var r=e3(t);return r.isAlive&&r===e}if(e.snapshot===t)return!0;
1if(!(e instanceof em))return!1;var n=e.getReconciliationType();return null!==e.identifier&&e.identifierAttribute&&tb(t)&&n.is(t)&&n.isMatchingSnapshotId(e,t)}function tY(e){return eS(e)&&(e.flags&b.Array)>0}t$.prototype.applySnapshot=(0,v.action)(t$.prototype.applySnapshot);var tJ="preProcessSnapshot",tB="postProcessSnapshot";function tK(){return e3(this).toString()}var tq={name:"AnonymousModel",properties:{},initializers:ta},tQ=function(e){function t(t){var r,n,i,a=e.call(this,t.name||tq.name)||this;return Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:b.Object}),Object.defineProperty(a,"initializers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"properties",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"preProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"postProcessor",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"propertyNames",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(a,"named",{enumerable:!0,configurable:!0,writable:!0,value:function(e){return a.cloneAndEnhance({name:e})}}),Object.defineProperty(a,"props",{enumerable:!0,configurable:!0,writable:!0,value:function(e){return a.cloneAndEnhance({properties:e})}}),Object.defineProperty(a,"preProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=a.preProcessor;return t?a.cloneAndEnhance({preProcessor:function(r){return t(e(r))}}):a.cloneAndEnhance({preProcessor:e})}}),Object.defineProperty(a,"postProcessSnapshot",{enumerable:!0,configurable:!0,writable:!0,value:function(e){var t=a.postProcessor;return t?a.cloneAndEnhance({postProcessor:function(r){return e(t(r))}}):a.cloneAndEnhance({postProcessor:e})}}),Object.assign(a,tq,t),a.properties=(n=Object.keys(r=a.properties),i=new Set,n.forEach(function(e){if(i.has(e))throw new tl("".concat(e," is declared twice in the model. Model should not contain the same keys"));i.add(e)}),n.reduce(function(e,t){if(t in c)throw new tl("Hook '".concat(t,"' was defined as property. Hooks should be defined as part of the actions"));var n=Object.getOwnPropertyDescriptor(r,t);if("get"in n)throw new tl("Getters are not supported as properties. Please use views instead");var i=n.value;if(null==i)throw new tl("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");if(th(i))e[t]=rs(function(e){switch(typeof e){case"string":return t1;case"number":return t2;case"boolean":return t5;case"object":if(e instanceof Date)return t9}throw new tl("Cannot determine primitive type from value "+e)}(i),i);else if(i instanceof tH)e[t]=rs(i,{});else if(i instanceof t$)e[t]=rs(i,[]);else if(eS(i));else throw new tl("Invalid type definition for property '".concat(t,"', cannot infer a type from a value like '").concat(i,"' (").concat(typeof i,")"));return e},S({},r))),a.properties,a.propertyNames=Object.keys(a.properties),a.identifierAttribute=a._getIdentifierAttribute(),a}return _(t,e),Object.defineProperty(t.prototype,"_getIdentifierAttribute",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=void 0;return this.forAllProps(function(t,r){if(r.flags&b.Identifier){if(e)throw new tl("Cannot define property '".concat(t,"' as object identifier, property '").concat(e,"' is already defined as identifier property"));e=t}}),e}}),Object.defineProperty(t.prototype,"cloneAndEnhance",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return new t({name:e.name||this.name,properties:Object.assign({},this.properties,e.properties),initializers:this.initializers.concat(e.initializers||[]),preProcessor:e.preProcessor||this.preProcessor,postProcessor:e.postProcessor||this.postProcessor})}}),Object.defineProperty(t.prototype,"actions",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return this.cloneAndEnhance({initializers:[function(r){return t.instantiateActions(r,e(r)),r}]})}}),Object.defineProperty(t.prototype,"instantiateActions",{enumerable:!1,
1configurable:!0,writable:!0,value:function(e,t){if(!tb(t))throw new tl("actions initializer should return a plain object containing actions");Object.keys(t).forEach(function(r){if(r===tJ)throw new tl("Cannot define action '".concat(tJ,"', it should be defined using 'type.preProcessSnapshot(fn)' instead"));if(r===tB)throw new tl("Cannot define action '".concat(tB,"', it should be defined using 'type.postProcessSnapshot(fn)' instead"));var n=t[r],i=e[r];if(r in c&&i){var a=n;n=function(){i.apply(null,arguments),a.apply(null,arguments)}}var o=n.$mst_middleware,u=n.bind(t);u._isFlowAction=n._isFlowAction||!1,u.$mst_middleware=o;var l=eF(e,r,u);t[r]=l,tm(e,r,l)})}}),Object.defineProperty(t.prototype,"volatile",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;if("function"!=typeof e)throw new tl("You passed an ".concat(typeof e," to volatile state as an argument, when function is expected"));return this.cloneAndEnhance({initializers:[function(r){return t.instantiateVolatileState(r,e(r)),r}]})}}),Object.defineProperty(t.prototype,"instantiateVolatileState",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!tb(t))throw new tl("volatile state initializer should return a plain object c
1ontaining state");(0,v.set)(e,t)}}),Object.defineProperty(t.prototype,"extend",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return this.cloneAndEnhance({initializers:[function(r){var n=e(r),i=n.actions,a=n.views,o=n.state,u=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}(n,["actions","views","state"]);for(var l in u)throw new tl("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '".concat(l,"'"));return o&&t.instantiateVolatileState(r,o),a&&t.instantiateViews(r,a),i&&t.instantiateActions(r,i),r}]})}}),Object.defineProperty(t.prototype,"views",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;return this.cloneAndEnhance({initializers:[function(r){return t.instantiateViews(r,e(r)),r}]})}}),Object.defineProperty(t.prototype,"instantiateViews",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!tb(t))throw new tl("views initializer should return a plain object c
1ontaining views");Object.getOwnPropertyNames(t).forEach(function(r){var n,i=Object.getOwnPropertyDescriptor(t,r);if("get"in i)(0,v.defineProperty)(e,r,i),(0,v.makeObservable)(e,((n={})[r]=v.computed,n));else if("function"==typeof i.value)tm(e,r,i.value);else throw new tl("A view member should either be a function or getter based property")})}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return e1(this,e,t,r,e4(n)?n:this.applySnapshotPreProcessor(n))}}),Object.defineProperty(t.prototype,"initializeChildNodes",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){void 0===t&&(t={});var r=e.type,n={};return r.forAllProps(function(r,i){n[r]=i.instantiate(e,r,void 0,t[r])}),n}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=S(S({},tu),{name:this.name});return v.observable.object(e,to,t)}}),Object.defineProperty(t.prototype,"finalizeNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){tm(t,"toString",tK),this.forAllProps(function(r){(0,v._interceptReads)(t,r,e.unbox)}),this.initializers.reduce(function(e,t){return t(e)},t),(0,v.intercept)(t,this.willChange),(0,v.observe)(t,this.didChange)}}),Object.defineProperty(t.prototype,"willChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e3(e.object),r=e.name;t.assertWritable({subpath:r});var n=t.type.properties[r];return n&&(eq(n,e.newValue),e.newValue=n.reconcile(t.getChildNode(r),e.newValue,t,r)),e}}),Object.defineProperty(t.prototype,"didChange",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=e3(e.object);if(t.type.properties[e.name]){var r=e.oldValue?e.oldValue.snapshot:void 0;t.emitPatch({op:"replace",path:tD(e.name),value:e.newValue.snapshot,oldValue:r},t)}}}),Object.defineProperty(t.prototype,"getChildren",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this,r=[];return this.forAllProps(function(n){r.push(t.getChildNode(e,n))}),r}}),Object.defineProperty(t.prototype,"getChildNode",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(!(t in this.properties))throw new tl("Not a value property: "+t);var r,n=(0,v._getAdministration)(e.storedValue,t),i=null===(r=n.raw)||void 0===r?void 0:r.call(n);if(!i)throw new tl("Node not available for property "+t);return i}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this;void 0===t&&(t=!0);var n={};return(this.forAllProps(function(t,i){try{(0,v.getAtom)(e.storedValue,t).reportObserved()}catch(e){throw new tl("".concat(t," property is declared twice"))}n[t]=r.getChildNode(e,t).snapshot}),t)?this.applySnapshotPostProcessor(n):n}}),Object.defineProperty(t.prototype,"processInitialSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t={};return Object.keys(e).forEach(function(r){t[r]=e[r].getSnapshot()}),this.applySnapshotPostProcessor(t)}}),Object.defineProperty(t.prototype,"applyPatchLocally",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){if(!("replace"===r.op||"add"===r.op))throw new tl("object does not support operation ".concat(r.op));e.storedValue[t]=r.value}}),Object.defineProperty(t.prototype,"applySnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){eq(this,t);var r=this.applySnapshotPreProcessor(t);this.forAllProps(function(t){e.storedValue[t]=r[t]})}}),Object.defineProperty(t.prototype,"applySnapshotPreProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.preProcessor;return t?t.call(null,e):e}}),Object.defineProperty(t.prototype,"applySnapshotPostProcessor",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.postProcessor;return t?t.call(null,e):e}}),Object.defineProperty(t.prototype,"getChildType",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return tI(e,1),this.properties[e]}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=this.applySnapsh
1otPreProcessor(e);return tb(n)?eK(this.propertyNames.map(function(e){return r.properties[e].validate(n[e],eJ(t,e,r.properties[e]))})):eB(t,n,"Value is not a plain object")}}),Object.defineProperty(t.prototype,"forAllProps",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this;this.propertyNames.forEach(function(r){return e(r,t.properties[r])})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this;return"{ "+this.propertyNames.map(function(t){return t+": "+e.properties[t].describe()}).join("; ")+" }"}}),Object.defineProperty(t.prototype,"getDefaultSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){return to}}),Object.defineProperty(t.prototype,"removeChild",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){e.storedValue[t]=void 0}}),t}(ej);function tX(e){return eS(e)&&(e.flags&b.Object)>0}tQ.prototype.applySnapshot=(0,v.action)(tQ.prototype.applySnapshot);var t0=function(e){function t(t,r,n,i){void 0===i&&(i=tc);var a=e.call(this,t)||this;return Object.defineProperty(a,"flags",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"checker",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"initializer",{enumerable:!0,configurable:!0,writable:!0,value:i}),a.flags=r,a}return _(t,e),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return e2(this,e,t,r,n)}}),Object.defineProperty(t.prototype,"createNewInstance",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.initializer(e)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(th(e)&&this.checker(e))return ta;var r="Date"===this.name?"Date or a unix milliseconds timestamp":this.name;return eB(t,e,"Value is not a ".concat(r))}}),t}(e_),t1=new t0("string",b.String,function(e){return"string"==typeof e}),t2=new t0("number",b.Number,function(e){return"number"==typeof e}),t4=new t0("integer",b.Integer,function(e){return ts(e)}),t6=new t0("float",b.Float,function(e){return Number(e)===e&&e%1!=0}),t3=new t0("finite",b.Finite,function(e){return Number.isFinite(e)}),t5=new t0("boolean",b.Boolean,function(e){return"boolean"==typeof e}),t8=new t0("null",b.Null,function(e){return null===e}),t7=new t0("undefined",b.Undefined,function(e){return void 0===e}),t9=new t0("Date",b.Date,function(e){return"number"==typeof e||e instanceof Date},function(e){return e instanceof Date?e:new Date(e)});function re(e){return eS(e)&&(e.flags&(b.String|b.Number|b.Integer|b.Boolean|b.Date))>0}t9.getSnapshot=function(e){return e.storedValue.getTime()};var rt=function(e){function t(t){var r=e.call(this,JSON.stringify(t))||this;return Object.defineProperty(r,"value",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:b.Literal}),r.value=t,r}return _(t,e),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return e2(this,e,t,r,n)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return JSON.stringify(this.value)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return th(e)&&e===this.value?ta:eB(t,e,"Value is not a literal ".concat(JSON.stringify(this.value)))}}),t}(e_);function rr(e){return new rt(e)}function rn(e){return eS(e)&&(e.flags&b.Literal)>0}var ri=function(e){function t(t,r,n,i){var a=e.call(this,t)||this;return Object.defineProperty(a,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(a,"_predicate",{enumerable:!0,configurable:!0,writable:!0,value:n}),Object.defineProperty(a,"_message",{enumerable:!0,configurable:!0,writable:!0,value:i}),a}return _(t,e),Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|b.Refinement}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._subtype.instantiate(e,t,r,n)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._subtype.isAssignableFrom(e)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this._subtype.validate(e,t);if(r.length>0)return r;var n=e4(e)?e3(e).snapshot:e;return this._predicate(n)?ta:eB(t,e,this._message(e))}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._subtype.reconcile(e,t,r,n)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(eO);function ra(e){return eS(e)&&(e.flags&b.Refinement)>0}var ro=function(e){function t(t,r,n){var i=e.call(this,t)||this;return Object.defineProperty(i,"_types",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"_dispatcher",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(i,"_eager",{enumerable:!0,configurable:!0,writable:!0,value:!0}),n=S({eager:!0,dispatcher:void 0},n),i._dispatcher=n.dispatcher,n.eager||(i._eager=!1),i}return _(t,e),Object.defineProperty(t.prototype,"flags",{get:function(){var e=b.Union;return this._types.forEach(function(t){e|=t.flags}),e},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._types.some(function(t){return t.isAssignableFrom(e)})}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"("+this._types.map(function(e){return e.describe()}).join(" | ")+")"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this.determineType(n,void 0);if(!i)throw new tl("No matching type for union "+this.describe());return i.instantiate(e,t,r,n)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this.determineType(t,e.getReconciliationType());if(!i)throw new tl("No matching type for union "+this.describe());return i.reconcile(e,t,r,n)}}),Object.defineProperty(t.prototype,"determineType",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this._dispatcher?this._dispatcher(e):t?t.is(e)?t:this._types.filter(function(e){return e!==t}).find(function(t){return t.is(e)}):this._types.find(function(t){return t.is(e)})}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this._dispatcher)return this._dispatcher(e).validate(e,t);for(var r=[],n=0,i=0;i<this._types.length;i++){var a=this._types[i].validate(e,t);if(0===a.length){if(this._eager)return ta;n++}else r.push(a)}return 1===n?ta:eB(t,e,"No type is applicable for the union").concat(eK(r))}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._types}}),t}(eO);function ru(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=eS(e)?void 0:e,i=eS(e)?C([e],T(t),!1):t;return new ro("("+i.map(function(e){return e.name}).join(" | ")+")",i,n)}function rl(e){return eS(e)&&(e.flags&b.Union)>0}var rc=function(e){function t(t,r,n){var i=e.call(this,t.name)||this;return Object.defineProperty(i,"_subtype",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(i,"_defaultValue",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(i,"optionalValues",{enumerable:!0,configurable:!0,writable:!0,value:n}),i}return _(t,e),Object.defineProperty(t.prototype,"flags",{get:function(){return this._subtype.flags|b.Optional}
1,enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype.describe()+"?"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(this.optionalValues.indexOf(n)>=0){var i=this.getDefaultInstanceOrSnapshot();return this._subtype.instantiate(e,t,r,i)}return this._subtype.instantiate(e,t,r,n)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this._subtype.reconcile(e,0>this.optionalValues.indexOf(t)&&this._subtype.is(t)?t:this.getDefaultInstanceOrSnapshot(),r,n)}}),Object.defineProperty(t.prototype,"getDefaultInstanceOrSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e="function"==typeof this._defaultValue?this._defaultValue():this._defaultValue;return"function"==typeof this._defaultValue&&eq(this,e),e}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.optionalValues.indexOf(e)>=0?ta:this._subtype.validate(e,t)}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this._subtype.isAssignableFrom(e)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this._subtype}}),t}(eO);function rs(e,t,r){return!function(e,t){if("function"!=typeof t&&e4(t))throw new tl("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead")}(e,t),new rc(e,t,r||rf)}var rf=[void 0];function rp(e){return eS(e)&&(e.flags&b.Optional)>0}var rb=rs(t7,void 0),rd=rs(t8,null);function rh(e){return ru(e,rb)}var ry=function(e){function t(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"_definition",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"_subType",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),n}return _(t,e),Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|b.Late},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"getSubType",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(!this._subType){var t=void 0;try{t=this._definition()}catch(e){if(e instanceof ReferenceError)t=void 0;else throw e}if(e&&void 0===t)throw new tl("Late type seems to be used too early, the definition (still) returns undefined");t&&(this._subType=t)}return this._subType}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this.getSubType(!0).instantiate(e,t,r,n)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return this.getSubType(!0).reconcile(e,t,r,n)}}),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){var e=this.getSubType(!1);return e?e.name:"<uknown late type>"}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this.getSubType(!1);return r?r.validate(e,t):ta}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=this.getSubType(!1);return!!t&&t.isAssignableFrom(e)}}),Object.defineProperty(t.prototype,"getSubTypes",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.getSubType(!1)||ew}}),t}(eO);function rv(e){return eS(e)&&(e.flags&b.Late)>0}var rg=function(e){function t(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:b.Lazy}),Object.defineProperty(n,"loadedType",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(n,"pendingNodeList",{enumerable:!0,configurable:!0,writable:!0,value:v.observable.array()}),(0,v.when)(function(){return n.pendingNodeList.length>0&&n.pendingNodeList.some(function(e){return e.isAlive&&n.options.shouldLoadPredicate(e.parent?e.parent.value:null)})},function(){n.options.loadType().then((0,v.action)(function(e){n.loadedType=e,n.pendingNodeList.forEach(function(e){e.parent&&n.loadedType&&e.parent.applyPatches([{op:"replace",path:"/".concat(e.subpath),value:e.snapshot}])})}))}),n}return _(t,e),Object.defineProperty(t.prototype,"describe",{enumerable:!1,
1configurable:!0,writable:!0,value:function(){return"<lazy ".concat(this.name,">")}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this;if(this.loadedType)return this.loadedType.instantiate(e,t,r,n);var a=e2(this,e,t,r,n);return this.pendingNodeList.push(a),(0,v.when)(function(){return!a.isAlive},function(){return i.pendingNodeList.splice(i.pendingNodeList.indexOf(a),1)}),a}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return this.loadedType?this.loadedType.validate(e,t):tg(e)?ta:eB(t,e,"Value is not serializable and cannot be lazy")}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(t,r,n,i){return this.loadedType?(t.die(),this.loadedType.instantiate(n,i,n.environment,r)):e.prototype.reconcile.call(this,t,r,n,i)}}),t}(e_),rm=function(e){function t(t){var r=e.call(this,t?"frozen(".concat(t.name,")"):"frozen")||this;return Object.defineProperty(r,"subType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:b.Frozen}),r}return _(t,e),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"<any immutable value>"}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){return e2(this,e,t,r,n)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return tg(e)?this.subType?this.subType.validate(e,t):ta:eB(t,e,"Value is not serializable and cannot be frozen")}}),t}(e_),rw=new rm;function rP(e){return eS(e)&&(e.flags&b.Frozen)>0}var rO=function(){function e(e,t){if(Object.defineProperty(this,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(this,"identifier",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"node",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"resolvedReference",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),rk(e))this.identifier=e;else if(e4(e)){var r=e3(e);if(!r.identifierAttribute)throw new tl("Can only store references with a defined identifier attribute.");var n=r.unnormalizedIdentifier;if(null==n)throw new tl("Can only store references to tree nodes with a defined identifier.");this.identifier=n}else throw new tl("Can only store references to tree nodes or identifiers, got: '".concat(e,"'"))}return Object.defineProperty(e.prototype,"updateResolvedReference",{enumerable:!1,configurable:!0,writable:!0,value:function(e){var t=""+this.identifier,r=e.root,n=r.identifierCache.getLastCacheModificationPerId(t);if(!this.resolvedReference||this.resolvedReference.lastCacheModification!==n){var i=this.targetType,a=r.identifierCache.resolve(i,t);if(!a)throw new rj("[mobx-state-tree] Failed to resolve reference '".concat(this.identifier,"' to type '").concat(this.targetType.name,"' (from node: ").concat(e.path,")"));this.resolvedReference={node:a,lastCacheModification:n}}}}),Object.defineProperty(e.prototype,"resolvedValue",{get:function(){return this.updateResolvedReference(this.node),this.resolvedReference.node.value},enumerable:!1,configurable:!0}),e}(),rj=function(e){function t(r){var n=e.call(this,r)||this;return Object.setPrototypeOf(n,t.prototype),n}return _(t,e),t}(Error),r_=function(e){function t(t,r){var n=e.call(this,"reference(".concat(t.name,")"))||this;return Object.defineProperty(n,"targetType",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(n,"onInvalidated",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:b.Reference}),n}return _(t,e),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isAssignableFrom",{enumerable:!1,
1configurable:!0,writable:!0,value:function(e){return this.targetType.isAssignableFrom(e)}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return rk(e)?ta:eB(t,e,"Value is not a valid identifier, which is a string or a number")}}),Object.defineProperty(t.prototype,"fireInvalidated",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=t.parent;if(i&&i.isAlive){var a=i.storedValue;a&&this.onInvalidated({cause:e,parent:a,invalidTarget:n?n.storedValue:void 0,invalidId:r,replaceRef:function(e){x(t.root.storedValue,{op:"replace",value:e,path:t.path})},removeRef:function(){tX(i.type)?this.replaceRef(void 0):x(t.root.storedValue,{op:"remove",path:t.path})}})}}}),Object.defineProperty(t.prototype,"addTargetNodeWatcher",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){var r=this,n=this.getValue(e);if(n){var i=e3(n),a=function(n,a){var o=function(e){switch(e){case c.beforeDestroy:return"destroy";case c.beforeDetach:return"detach";default:return}}(a);o&&r.fireInvalidated(o,e,t,i)},o=i.registerHook(c.beforeDetach,a),u=i.registerHook(c.beforeDestroy,a);return function(){o(),u()}}}}),Object.defineProperty(t.prototype,"watchTargetNodeForInvalidations",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r){var n,i=this;if(this.onInvalidated){e.registerHook(c.beforeDestroy,function(){n&&n()});var a=function(a){n&&n();var o=e.parent,u=o&&o.storedValue;o&&o.isAlive&&u&&((r?!!r.get(t,u):e.root.identifierCache.has(i.targetType,""+t))?n=i.addTargetNodeWatcher(e,t):a||i.fireInvalidated("invalidSnapsh
1otReference",e,t,null))};e.state===h.FINALIZED?a(!0):(e.isRoot||e.root.registerHook(c.afterCreationFinalization,function(){e.parent&&e.parent.createObservableInstanceIfNeeded()}),e.registerHook(c.afterAttach,function(){a(!1)}))}}}),t}(e_),rS=function(e){function t(t,r){return e.call(this,t,r)||this}return _(t,e),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.isAlive)return e.storedValue.resolvedValue}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue.identifier}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=e4(n)?q(n):n,a=new rO(n,this.targetType),o=e2(this,e,t,r,a);return a.node=o,this.watchTargetNodeForInvalidations(o,i,void 0),o}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(!e.isDetaching&&e.type===this){var i=e4(t),a=e.storedValue;if(!i&&a.identifier===t||i&&a.resolvedValue===t)return e.setParent(r,n),e}var o=this.instantiate(r,n,void 0,t);return e.die(),o}}),t}(r_),rA=function(e){function t(t,r,n){var i=e.call(this,t,n)||this;return Object.defineProperty(i,"options",{enumerable:!0,configurable:!0,writable:!0,value:r}),i}return _(t,e),Object.defineProperty(t.prototype,"getValue",{enumerable:!1,configurable:!0,writable:!0,value:function(e){if(e.isAlive)return this.options.get(e.storedValue,e.parent?e.parent.storedValue:null)}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=e4(n)?this.options.set(n,e?e.storedValue:null):n,a=e2(this,e,t,r,i);return this.watchTargetNodeForInvalidations(a,i,this.options),a}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=e4(t)?this.options.set(t,e?e.storedValue:null):t;if(!e.isDetaching&&e.type===this&&e.storedValue===i)return e.setParent(r,n),e;var a=this.instantiate(r,n,void 0,i);return e.die(),a}}),t}(r_);function rI(e,t){var r=t||void 0,n=t?t.onInvalidated:void 0;return r&&(r.get||r.set)?new rA(e,{get:r.get,set:r.set},n):new rS(e,n)}function rT(e){return eS(e)&&(e.flags&b.Reference)>0}var rC=function(e){function t(t,r){var n=e.call(this,t)||this;return Object.defineProperty(n,"validType",{enumerable:!0,configurable:!0,writable:!0,value:r}),Object.defineProperty(n,"flags",{enumerable:!0,configurable:!0,writable:!0,value:b.Identifier}),n}return _(t,e),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(!e||!(e.type instanceof tQ))throw new tl("Identifier types can only be instantiated as direct child of a model type");return e2(this,e,t,r,n)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){if(e.storedValue!==t)throw new tl("Tried to change identifier from '".concat(e.storedValue,"' to '").concat(t,"'. Changing identifiers is not allowed."));return e.setParent(r,n),e}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){return typeof e!==this.validType?eB(t,e,"Value is not a valid ".concat(this.describe(),", expected a ").concat(this.validType)):ta}}),t}(e_),rE=function(e){function t(){var t=e.call(this,"identifier","string")||this;return Object.defineProperty(t,"flags",{enumerable:!0,configurable:!0,writable:!0,value:b.Identifier}),t}return _(t,e),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifier"}}),t}(rC),rN=function(e){function t(){return e.call(this,"identifierNumber","number")||this}return _(t,e),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return e.storedValue}}
1),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return"identifierNumber"}}),t}(rC),rV=new rE,rD=new rN;function rx(e){return eS(e)&&(e.flags&b.Identifier)>0}function rk(e){return"string"==typeof e||"number"==typeof e}var rR=function(e){function t(t){var r=e.call(this,t.name)||this;return Object.defineProperty(r,"options",{enumerable:!0,configurable:!0,writable:!0,value:t}),Object.defineProperty(r,"flags",{enumerable:!0,configurable:!0,writable:!0,value:b.Custom}),r}return _(t,e),Object.defineProperty(t.prototype,"describe",{enumerable:!1,configurable:!0,writable:!0,value:function(){return this.name}}),Object.defineProperty(t.prototype,"isValidSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t){if(this.options.isTargetType(e))return ta;var r=this.options.getValidationMessage(e);return r?eB(t,e,"Invalid value for type '".concat(this.name,"': ").concat(r)):ta}}),Object.defineProperty(t.prototype,"getSnapshot",{enumerable:!1,configurable:!0,writable:!0,value:function(e){return this.options.toSnapshot(e.storedValue)}}),Object.defineProperty(t.prototype,"instantiate",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=this.options.isTargetType(n)?n:this.options.fromSnapshot(n,e&&e.root.environment);return e2(this,e,t,r,i)}}),Object.defineProperty(t.prototype,"reconcile",{enumerable:!1,configurable:!0,writable:!0,value:function(e,t,r,n){var i=!this.options.isTargetType(t);if(!e.isDetaching&&e.type===this&&(i?t===e.snapshot:t===e.storedValue))return e.setParent(r,n),e;var a=i?this.options.fromSnapshot(t,r.root.environment):t,o=this.instantiate(r,n,void 0,a);return e.die(),o}}),t}(e_),rz={enumeration:function(e,t){var r=ru.apply(void 0,C([],T(("string"==typeof e?t:e).map(function(e){return rr(""+e)})),!1));return"string"==typeof e&&(r.name=e),r},model:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return new tQ({name:"string"==typeof e[0]?e.shift():"AnonymousModel",properties:e.shift()||{}})},compose:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r="string"==typeof e[0],n=r?e[0]:"AnonymousModel";return r&&e.shift(),e.reduce(function(e,t){return e.cloneAndEnhance({name:e.name+"_"+t.name,properties:t.properties,initializers:t.initializers,preProcessor:function(r){return t.applySnapshotPreProcessor(e.applySnapshotPreProcessor(r))},postProcessor:function(r){return t.applySnapshotPostProcessor(e.applySnapshotPostProcessor(r))}})}).named(n)},custom:function(e){return new rR(e)},reference:rI,safeReference:function(e,t){var r=rI(e,S(S({},t),{onInvalidated:function(e){t&&t.onInvalidated&&t.onInvalidated(e),e.removeRef()}}));return t&&!1===t.acceptsUndefined?r:rh(r)},union:ru,optional:rs,literal:rr,maybe:rh,maybeNull:function(e){return ru(e,rd)},refinement:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r="string"==typeof e[0]?e.shift():eS(e[0])?e[0].name:null,n=e[0],i=e[1],a=e[2]?e[2]:function(e){return"Value does not respect the refinement predicate"};return tI(r,1),new ri(r,n,i,a)},string:t1,boolean:t5,number:t2,integer:t4,float:t6,finite:t3,Date:t9,map:function(e){return new tH("Map<string, ".concat(e.name,">"),e)},array:function(e){return new t$("".concat(e.name,"[]"),e)},frozen:function(e){return 0==arguments.length?rw:eS(e)?new rm(e):rs(rw,e)},identifier:rV,identifierNumber:rD,late:function(e,t){return new ry("string"==typeof e?e:"late(".concat(e.toString(),")"),"string"==typeof e?t:e)},lazy:function(e,t){return new rg(e,t)},undefined:t7,null:t8,snapshotProcessor:function(e,t,r){return new tF(e,t,r)}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.