mobx-state-tree
Advanced tools
Comparing version 3.5.0 to 3.6.0
@@ -29,2 +29,3 @@ import { IContext, IValidationResult, IStateTreeNode, ModelPrimitive } from "../../internal"; | ||
export declare type ExtractT<T extends IAnyType> = T extends IType<any, any, infer X> ? X : never; | ||
export declare type ExtractCST<IT extends IAnyType> = IT extends IType<infer C, infer S, infer T> ? C | S | T : never; | ||
export declare type ExtractIStateTreeNode<C, S, T> = T extends ModelPrimitive ? T : TAndInterface<T, IStateTreeNode<C, S>>; | ||
@@ -31,0 +32,0 @@ export declare type Instance<T> = T extends IStateTreeNode ? T : T extends IType<any, any, infer TT> ? TT : T; |
@@ -29,3 +29,3 @@ import "./internal"; | ||
}; | ||
import { IModelType, IAnyModelType, IMSTMap, IMapType, IMSTArray, IArrayType, IType, IAnyType, ISimpleType, IComplexType, IAnyComplexType, IReferenceType, typecheck, escapeJsonPath, unescapeJsonPath, joinJsonPath, splitJsonPath, IJsonPatch, IReversibleJsonPatch, decorate, addMiddleware, IMiddlewareEvent, IMiddlewareHandler, IMiddlewareEventType, process, isStateTreeNode, IStateTreeNode, IAnyStateTreeNode, flow, applyAction, onAction, IActionRecorder, ISerializedActionCall, recordActions, createActionTrackingMiddleware, setLivelynessChecking, LivelynessMode, ModelSnapshotType, ModelCreationType, ModelInstanceType, ModelPropertiesDeclarationToProperties, ModelProperties, ModelPropertiesDeclaration, OptionalProperty, ModelActions, CustomTypeOptions, UnionOptions, Instance, SnapshotIn, SnapshotOut, SnapshotOrInstance, TypeOrStateTreeNodeToStateTreeNode, UnionStringArray, getType, getChildType, onPatch, onSnapshot, applyPatch, IPatchRecorder, recordPatches, protect, unprotect, isProtected, applySnapshot, getSnapshot, hasParent, getParent, hasParentOfType, getParentOfType, getRoot, getPath, getPathParts, isRoot, resolvePath, resolveIdentifier, getIdentifier, tryResolve, getRelativePath, clone, detach, destroy, isAlive, addDisposer, getEnv, walk, IModelReflectionData, IModelReflectionPropertiesData, getMembers, getPropertyMembers, CastedType, cast, isType, isArrayType, isFrozenType, isIdentifierType, isLateType, isLiteralType, isMapType, isModelType, isOptionalType, isPrimitiveType, isReferenceType, isRefinementType, isUnionType, ExtractIStateTreeNode } from "./internal"; | ||
export { IModelType, IAnyModelType, IMSTMap, IMapType, IMSTArray, IArrayType, IType, IAnyType, ISimpleType, IComplexType, IAnyComplexType, IReferenceType, typecheck, escapeJsonPath, unescapeJsonPath, joinJsonPath, splitJsonPath, IJsonPatch, IReversibleJsonPatch, decorate, addMiddleware, IMiddlewareEvent, IMiddlewareHandler, IMiddlewareEventType, process, isStateTreeNode, IStateTreeNode, IAnyStateTreeNode, flow, applyAction, onAction, IActionRecorder, ISerializedActionCall, recordActions, createActionTrackingMiddleware, setLivelynessChecking, LivelynessMode, ModelSnapshotType, ModelCreationType, ModelInstanceType, ModelPropertiesDeclarationToProperties, ModelProperties, ModelPropertiesDeclaration, OptionalProperty, ModelActions, CustomTypeOptions, UnionOptions, Instance, SnapshotIn, SnapshotOut, SnapshotOrInstance, TypeOrStateTreeNodeToStateTreeNode, UnionStringArray, getType, getChildType, onPatch, onSnapshot, applyPatch, IPatchRecorder, recordPatches, protect, unprotect, isProtected, applySnapshot, getSnapshot, hasParent, getParent, hasParentOfType, getParentOfType, getRoot, getPath, getPathParts, isRoot, resolvePath, resolveIdentifier, getIdentifier, tryResolve, getRelativePath, clone, detach, destroy, isAlive, addDisposer, getEnv, walk, IModelReflectionData, IModelReflectionPropertiesData, getMembers, getPropertyMembers, CastedType, cast, isType, isArrayType, isFrozenType, isIdentifierType, isLateType, isLiteralType, isMapType, isModelType, isOptionalType, isPrimitiveType, isReferenceType, isRefinementType, isUnionType, ExtractIStateTreeNode }; | ||
import { IModelType, IAnyModelType, IMSTMap, IMapType, IMSTArray, IArrayType, IType, IAnyType, ISimpleType, IComplexType, IAnyComplexType, IReferenceType, typecheck, escapeJsonPath, unescapeJsonPath, joinJsonPath, splitJsonPath, IJsonPatch, IReversibleJsonPatch, decorate, addMiddleware, IMiddlewareEvent, IMiddlewareHandler, IMiddlewareEventType, process, isStateTreeNode, IStateTreeNode, IAnyStateTreeNode, _CustomCSProcessor, _CustomOrOther, _CustomJoin, _NotCustomized, flow, applyAction, onAction, IActionRecorder, ISerializedActionCall, recordActions, createActionTrackingMiddleware, setLivelynessChecking, LivelynessMode, ModelSnapshotType, ModelCreationType, ModelSnapshotType2, ModelCreationType2, ModelInstanceType, ModelInstanceTypeProps, ModelPropertiesDeclarationToProperties, ModelProperties, ModelPropertiesDeclaration, OptionalProperty, ModelActions, ModelUnion, CustomTypeOptions, UnionOptions, Instance, SnapshotIn, SnapshotOut, SnapshotOrInstance, TypeOrStateTreeNodeToStateTreeNode, UnionStringArray, getType, getChildType, onPatch, onSnapshot, applyPatch, IPatchRecorder, recordPatches, protect, unprotect, isProtected, applySnapshot, getSnapshot, hasParent, getParent, hasParentOfType, getParentOfType, getRoot, getPath, getPathParts, isRoot, resolvePath, resolveIdentifier, getIdentifier, tryResolve, getRelativePath, clone, detach, destroy, isAlive, addDisposer, getEnv, walk, IModelReflectionData, IModelReflectionPropertiesData, IMaybeIComplexType, IMaybeIType, IOptionalIComplexType, IOptionalIType, OptionalDefaultValueOrFunction, getMembers, getPropertyMembers, CastedType, cast, isType, isArrayType, isFrozenType, isIdentifierType, isLateType, isLiteralType, isMapType, isModelType, isOptionalType, isPrimitiveType, isReferenceType, isRefinementType, isUnionType, ExtractIStateTreeNode } from "./internal"; | ||
export { IModelType, IAnyModelType, IMSTMap, IMapType, IMSTArray, IArrayType, IType, IAnyType, ISimpleType, IComplexType, IAnyComplexType, IReferenceType, _CustomCSProcessor, _CustomOrOther, _CustomJoin, _NotCustomized, typecheck, escapeJsonPath, unescapeJsonPath, joinJsonPath, splitJsonPath, IJsonPatch, IReversibleJsonPatch, decorate, addMiddleware, IMiddlewareEvent, IMiddlewareHandler, IMiddlewareEventType, process, isStateTreeNode, IStateTreeNode, IAnyStateTreeNode, flow, applyAction, onAction, IActionRecorder, ISerializedActionCall, recordActions, createActionTrackingMiddleware, setLivelynessChecking, LivelynessMode, ModelSnapshotType, ModelCreationType, ModelSnapshotType2, ModelCreationType2, ModelInstanceType, ModelInstanceTypeProps, ModelPropertiesDeclarationToProperties, ModelProperties, ModelPropertiesDeclaration, OptionalProperty, ModelActions, ModelUnion, CustomTypeOptions, UnionOptions, Instance, SnapshotIn, SnapshotOut, SnapshotOrInstance, TypeOrStateTreeNodeToStateTreeNode, UnionStringArray, getType, getChildType, onPatch, onSnapshot, applyPatch, IPatchRecorder, recordPatches, protect, unprotect, isProtected, applySnapshot, getSnapshot, hasParent, getParent, hasParentOfType, getParentOfType, getRoot, getPath, getPathParts, isRoot, resolvePath, resolveIdentifier, getIdentifier, tryResolve, getRelativePath, clone, detach, destroy, isAlive, addDisposer, getEnv, walk, IModelReflectionData, IModelReflectionPropertiesData, IMaybeIComplexType, IMaybeIType, IOptionalIComplexType, IOptionalIType, OptionalDefaultValueOrFunction, getMembers, getPropertyMembers, CastedType, cast, isType, isArrayType, isFrozenType, isIdentifierType, isLateType, isLiteralType, isMapType, isModelType, isOptionalType, isPrimitiveType, isReferenceType, isRefinementType, isUnionType, ExtractIStateTreeNode }; |
@@ -1,1 +0,1 @@ | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("mobx")):"function"==typeof define&&define.amd?define(["exports","mobx"],e):e(t.mobxStateTree={},t.mobx)}(this,function(t,l){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function a(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var i=function(){return(i=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function n(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(a=(o<3?i(a):3<o?i(e,n,a):i(e,n))||a);return 3<o&&a&&Object.defineProperty(e,n,a),a}function u(t){return Y(t).type}function o(t,e){return Y(t).onPatch(e)}function s(t,e){Y(t).applyPatches(at(e))}function p(t,e){return Y(t).applySnapshot(e)}function c(t){return Y(t).root.storedValue}function h(t,e){var n=K(Y(t),e,!1);if(void 0!==n)try{return n.value}catch(t){return}}function f(t,e){var n=Y(t);n.getChildren().forEach(function(t){J(t.storedValue)&&f(t.storedValue,e)}),e(n.storedValue)}function e(t){var e;return{name:(e=J(t)?u(t):t).name,properties:i({},e.properties)}}var d=function(){function t(t,e,n,r,i){this.parent=null,this.subpath="",this.state=U.INITIALIZING,this._environment=void 0,this._initialSnapshot=i,this.type=t,this.parent=e,this.subpath=n;var o=!0;try{this.storedValue=t.createNewInstance(this,{},i),this.state=U.CREATED,o=!1}finally{o&&(this.state=U.DEAD)}}return Object.defineProperty(t.prototype,"path",{get:function(){return this.parent?this.parent.path+"/"+vt(this.subpath):""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this.parent?this.parent.root:nt("This scalar node is not part of a tree")},enumerable:!0,configurable:!0}),t.prototype.setParent=function(t,e){if(void 0===e&&(e=null),this.parent!==t||this.subpath!==e)if(this.parent&&!t)this.die();else{var n=null===e?"":e;this.subpath!==n&&(this.subpath=n),t&&t!==this.parent&&(this.parent=t)}},Object.defineProperty(t.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return ct(this.getSnapshot())},enumerable:!0,configurable:!0}),t.prototype.getSnapshot=function(){return this.type.getSnapshot(this)},Object.defineProperty(t.prototype,"isAlive",{get:function(){return this.state!==U.DEAD},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.type.name+"@"+(this.path||"<root>")+(this.isAlive?"":"[dead]")},t.prototype.die=function(){this.state=U.DEAD},t}(),y=1,v="warn";var b,g,m={onError:function(t){throw t}},S=function(){function r(t,e,n,r,i){if(this.nodeId=++y,this.subpathAtom=l.createAtom("path"),this.subpath="",this.parent=null,this.state=U.INITIALIZING,this.isProtectionEnabled=!0,this.middlewares=null,this._autoUnbox=!0,this._environment=void 0,this._isRunningAction=!1,this._hasSnapshotReaction=!1,this._disposers=null,this._patchSubscribers=null,this._snapshotSubscribers=null,this._observableInstanceCreated=!1,this._cachedInitialSnapshot=null,this._environment=r,this._initialSnapshot=ct(i),this.type=t,this.parent=e,this.subpath=n,this.escapedSubpath=vt(this.subpath),this.identifierAttribute=t.identifierAttribute,e||(this.identifierCache=new $),this._childNodes=t.initializeChildNodes(this,this._initialSnapshot),this.identifier=null,this.identifierAttribute&&this._initialSnapshot){var o=this._initialSnapshot[this.identifierAttribute];if(void 0===o){var a=this._childNodes[this.identifierAttribute];a&&(o=a.value)}"string"!=typeof o&&"number"!=typeof o&&nt("Instance identifier '"+this.identifierAttribute+"' for type '"+this.type.name+"' must be a string or a number"),this.identifier=""+o}e?e.root.identifierCache.addNodeToCache(this):this.identifierCache.addNodeToCache(this)}return r.prototype.applyPatches=function(t){this._observableInstanceCreated||this._createObservableInstance(),this.applyPatches(t)},r.prototype.applySnapshot=function(t){this._observableInstanceCreated||this._createObservableInstance(),this.applySnapshot(t)},r.prototype._createObservableInstance=function(){var t=this.type;this.storedValue=t.createNewInstance(this,this._childNodes,this._initialSnapshot),this.preboot();var e,n,r=!0;this._observableInstanceCreated=!0;try{this._isRunningAction=!0,t.finalizeNewInstance(this,this.storedValue),this._isRunningAction=!1,this.fireHook("afterCreate"),this.state=U.CREATED,r=!1}finally{r&&(this.state=U.DEAD)}e=this,n="snapshot",l.getAtom(e,n).trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this.finalizeCreation(),this._childNodes=tt},Object.defineProperty(r.prototype,"path",{get:function(){return this.subpathAtom.reportObserved(),this.parent?this.parent.path+"/"+this.escapedSubpath:""},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isRoot",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),r.prototype.setParent=function(t,e){if(void 0===e&&(e=null),this.parent!==t||this.subpath!==e)if(this.parent&&!t)this.die();else{var n=null===e?"":e;this.subpath!==n&&(this.subpath=n,this.escapedSubpath=vt(this.subpath),this.subpathAtom.reportChanged()),t&&t!==this.parent&&(t.root.identifierCache.mergeCache(this),this.parent=t,this.subpathAtom.reportChanged(),this.fireHook("afterAttach"))}},r.prototype.fireHook=function(t){var e=this,n=this.storedValue&&"object"==typeof this.storedValue&&this.storedValue[t];"function"==typeof n&&(l._allowStateChangesInsideComputed?l._allowStateChangesInsideComputed(function(){n.apply(e.storedValue)}):n.apply(this.storedValue))},r.prototype.createObservableInstanceIfNeeded=function(){this._observableInstanceCreated||this._createObservableInstance()},Object.defineProperty(r.prototype,"isObservableInstanceCreated",{get:function(){return this._observableInstanceCreated},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"value",{get:function(){if(this.createObservableInstanceIfNeeded(),this.isAlive)return this.type.getValue(this)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"snapshot",{get:function(){if(this.isAlive)return ct(this.getSnapshot())},enumerable:!0,configurable:!0}),r.prototype.getSnapshot=function(){if(this.isAlive)return this._observableInstanceCreated?this._getActualSnapshot():this._getInitialSnapshot()},r.prototype._getActualSnapshot=function(){return this.type.getSnapshot(this)},r.prototype._getInitialSnapshot=function(){if(this.isAlive){if(!this._initialSnapshot)return this._initialSnapshot;if(this._cachedInitialSnapshot)return this._cachedInitialSnapshot;var t=this.type,e=this._childNodes,n=this._initialSnapshot;return this._cachedInitialSnapshot=t.processInitialSnapshot(e,n),this._cachedInitialSnapshot}},r.prototype.isRunningAction=function(){return!!this._isRunningAction||!this.isRoot&&this.parent.isRunningAction()},Object.defineProperty(r.prototype,"isAlive",{get:function(){return this.state!==U.DEAD},enumerable:!0,configurable:!0}),r.prototype.assertAlive=function(){if(!this.isAlive){var t="[mobx-state-tree][error] You are trying to read or write to an object that is no longer part of a state tree. (Object type was '"+this.type.name+"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.";switch(v){case"error":throw new Error(t);case"warn":console.warn(t+' Use setLivelynessChecking("error") to simplify debugging this error.')}}},r.prototype.getChildNode=function(t){this.assertAlive(),this._autoUnbox=!1;try{return this._observableInstanceCreated?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}},r.prototype.getChildren=function(){this.assertAlive(),this._autoUnbox=!1;try{return this._observableInstanceCreated?this.type.getChildren(this):Q(this._childNodes)}finally{this._autoUnbox=!0}},r.prototype.getChildType=function(t){return this.type.getChildType(t)},Object.defineProperty(r.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!0,configurable:!0}),r.prototype.assertWritable=function(){this.assertAlive(),!this.isRunningAction()&&this.isProtected&&nt("Cannot modify '"+this+"', the object is protected and can only be modified by using an action.")},r.prototype.removeChild=function(t){this.type.removeChild(this,t)},r.prototype.unbox=function(t){return t&&t.parent&&t.parent.assertAlive(),t&&t.parent&&t.parent._autoUnbox?t.value:t},r.prototype.toString=function(){var t=this.identifier?"(id: "+this.identifier+")":"";return this.type.name+"@"+(this.path||"<root>")+t+(this.isAlive?"":"[dead]")},r.prototype.finalizeCreation=function(){if(this.state===U.CREATED){if(this.parent){if(this.parent.state!==U.FINALIZED)return;this.fireHook("afterAttach")}this.state=U.FINALIZED;for(var t=0,e=this.getChildren();t<e.length;t++){var n=e[t];n instanceof r&&n.finalizeCreation()}}},r.prototype.detach=function(){this.isAlive||nt("Error while detaching, node is not alive."),this.isRoot||(this.fireHook("beforeDetach"),this._environment=this.root._environment,this.state=U.DETACHING,this.identifierCache=this.root.identifierCache.splitCache(this),this.parent.removeChild(this.subpath),this.parent=null,this.subpath=this.escapedSubpath="",this.subpathAtom.reportChanged(),this.state=U.FINALIZED)},r.prototype.preboot=function(){var n=this;this.applyPatches=E(this.storedValue,"@APPLY_PATCHES",function(t){t.forEach(function(t){var e=mt(t.path);q(n,e.slice(0,-1)).applyPatchLocally(e[e.length-1],t)})}),this.applySnapshot=E(this.storedValue,"@APPLY_SNAPSHOT",function(t){if(t!==n.snapshot)return n.type.applySnapshot(n,t)}),lt(this.storedValue,"$treenode",this),lt(this.storedValue,"toJSON",Z)},r.prototype.die=function(){this.state!==U.DETACHING&&J(this.storedValue)&&(f(this.storedValue,function(t){var e=Y(t);e instanceof r&&e.aboutToDie()}),f(this.storedValue,function(t){var e=Y(t);e instanceof r&&e.finalizeDeath()}))},r.prototype.aboutToDie=function(){this._disposers&&(this._disposers.forEach(function(t){return t()}),this._disposers=null),this.fireHook("beforeDestroy")},r.prototype.finalizeDeath=function(){var t,e,n;this.root.identifierCache.notifyDied(this),e="snapshot",n=(t=this).snapshot,Object.defineProperty(t,e,{enumerable:!0,writable:!1,configurable:!0,value:n}),this._patchSubscribers&&(this._patchSubscribers=null),this._snapshotSubscribers&&(this._snapshotSubscribers=null),this.state=U.DEAD,this.subpath=this.escapedSubpath="",this.parent=null,this.subpathAtom.reportChanged()},r.prototype.onSnapshot=function(t){return this._addSnapshotReaction(),this._snapshotSubscribers||(this._snapshotSubscribers=[]),ht(this._snapshotSubscribers,t)},r.prototype.emitSnapshot=function(e){this._snapshotSubscribers&&this._snapshotSubscribers.forEach(function(t){return t(e)})},r.prototype.onPatch=function(t){return this._patchSubscribers||(this._patchSubscribers=[]),ht(this._patchSubscribers,t)},r.prototype.emitPatch=function(t,e){var n=this._patchSubscribers;if(n&&n.length){var r=function(t){"oldValue"in t||nt("Patches without `oldValue` field cannot be inversed");return[function(t){switch(t.op){case"add":return{op:"add",path:t.path,value:t.value};case"remove":return{op:"remove",path:t.path};case"replace":return{op:"replace",path:t.path,value:t.value}}}(t),function(t){switch(t.op){case"add":return{op:"remove",path:t.path};case"remove":return{op:"add",path:t.path,value:t.oldValue};case"replace":return{op:"replace",path:t.path,value:t.oldValue}}}(t)]}(function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var i=e[r];for(var o in i)t[o]=i[o]}return t}({},t,{path:e.path.substr(this.path.length)+"/"+t.path})),i=r[0],o=r[1];n.forEach(function(t){return t(i,o)})}this.parent&&this.parent.emitPatch(t,e)},r.prototype.addDisposer=function(t){this._disposers?this._disposers.unshift(t):this._disposers=[t]},r.prototype.removeMiddleware=function(e){this.middlewares&&(this.middlewares=this.middlewares.filter(function(t){return t.handler!==e}))},r.prototype.addMiddleWare=function(t,e){var n=this;return void 0===e&&(e=!0),this.middlewares?this.middlewares.push({handler:t,includeHooks:e}):this.middlewares=[{handler:t,includeHooks:e}],function(){n.removeMiddleware(t)}},r.prototype.applyPatchLocally=function(t,e){this.assertWritable(),this._observableInstanceCreated||this._createObservableInstance(),this.type.applyPatchLocally(this,t,e)},r.prototype._addSnapshotReaction=function(){var e=this;if(!this._hasSnapshotReaction){var t=l.reaction(function(){return e.snapshot},function(t){return e.emitSnapshot(t)},m);this.addDisposer(t),this._hasSnapshotReaction=!0}},n([l.action],r.prototype,"_createObservableInstance",null),n([l.computed],r.prototype,"snapshot",null),n([l.action],r.prototype,"detach",null),n([l.action],r.prototype,"die",null),r}();(g=b||(b={}))[g.String=1]="String",g[g.Number=2]="Number",g[g.Boolean=4]="Boolean",g[g.Date=8]="Date",g[g.Literal=16]="Literal",g[g.Array=32]="Array",g[g.Map=64]="Map",g[g.Object=128]="Object",g[g.Frozen=256]="Frozen",g[g.Optional=512]="Optional",g[g.Reference=1024]="Reference",g[g.Identifier=2048]="Identifier",g[g.Late=4096]="Late",g[g.Refinement=8192]="Refinement",g[g.Union=16384]="Union",g[g.Null=32768]="Null",g[g.Undefined=65536]="Undefined",g[g.Integer=131072]="Integer";var w=function(){function t(t){this["!!complexType"]=void 0,this.isType=!0,this.name=t}return t.prototype.create=function(t,e){return void 0===t&&(t=this.getDefaultSnapshot()),this.instantiate(null,"",e,t).value},t.prototype.initializeChildNodes=function(t,e){return tt},t.prototype.createNewInstance=function(t,e,n){return n},t.prototype.finalizeNewInstance=function(t,e){},t.prototype.processInitialSnapshot=function(t,e){return e},t.prototype.isAssignableFrom=function(t){return t===this},t.prototype.validate=function(t,e){return J(t)?u(t)===this||this.isAssignableFrom(u(t))?z():M(e,t):this.isValidSnapshot(t,e)},t.prototype.is=function(t){return 0===this.validate(t,[{path:"",type:this}]).length},t.prototype.reconcile=function(t,e){if(t.snapshot===e)return t;if(J(e)&&Y(e)===t)return t;if(t.type===this&&ut(e)&&!J(e)&&(!t.identifierAttribute||t.identifier===""+e[t.identifierAttribute]))return t.applySnapshot(e),t;var n=t.parent,r=t.subpath;if(t.die(),J(e)&&this.isAssignableFrom(u(e))){var i=Y(e);return i.setParent(n,r),i}return this.instantiate(n,r,t._environment,e)},Object.defineProperty(t.prototype,"Type",{get:function(){return nt("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:!0,configurable:!0}),Object.defineProperty(t.prototype,"SnapshotType",{get:function(){return nt("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:!0,configurable:!0}),Object.defineProperty(t.prototype,"CreationType",{get:function(){return nt("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:!0,configurable:!0}),n([l.action],t.prototype,"create",null),t}(),A=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.getDefaultSnapshot=function(){},t.prototype.applySnapshot=function(t,e){nt("Immutable types do not support applying snapshots")},t.prototype.applyPatchLocally=function(t,e,n){nt("Immutable types do not support applying patches")},t.prototype.getChildren=function(t){return X},t.prototype.getChildNode=function(t,e){return nt("No child '"+e+"' available in type: "+this.name)},t.prototype.getChildType=function(t){return nt("No child '"+t+"' available in type: "+this.name)},t.prototype.reconcile=function(t,e){if(t.type===this&&t.storedValue===e)return t;var n=this.instantiate(t.parent,t.subpath,t._environment,e);return t.die(),n},t.prototype.removeChild=function(t,e){return nt("No child '"+e+"' available in type: "+this.name)},t}(w);function P(t){return"object"==typeof t&&t&&!0===t.isType}var _=new Map;function V(t){return{$MST_UNSERIALIZABLE:!0,type:t}}function I(e,t){l.runInAction(function(){at(t).forEach(function(t){return function(t,e){var n=h(t,e.path||"");if(!n)return nt("Invalid action path: "+(e.path||""));var r=Y(n);if("@APPLY_PATCHES"===e.name)return s.call(null,n,e.args[0]);if("@APPLY_SNAPSHOT"===e.name)return p.call(null,n,e.args[0]);"function"!=typeof n[e.name]&&nt("Action '"+e.name+"' does not exist in '"+r.path+"'");return n[e.name].apply(n,e.args?e.args.map(function(t){return(e=t)&&"object"==typeof e&&"$MST_DATE"in e?new Date(e.$MST_DATE):e;var e}):[])}(e,t)})})}function T(o,a,s){return void 0===s&&(s=!1),D(o,function(n,t){if("action"!==n.type||n.id!==n.rootId)return t(n);var e=Y(n.context),r={name:n.name,path:B(Y(o),e),args:n.args.map(function(t,e){return function(t,e,n,r){if(r instanceof Date)return{$MST_DATE:r.getTime()};if(pt(r))return r;if(J(r))return V("[MSTNode: "+u(r).name+"]");if("function"==typeof r)return V("[function]");if("object"==typeof r&&!st(r)&&!ot(r))return V("[object "+(r&&r.constructor&&r.constructor.name||"Complex Object")+"]");try{return JSON.stringify(r),r}catch(t){return V(""+t)}}(0,n.name,0,t)})};if(s){var i=t(n);return a(r),i}return a(r),t(n)})}var C=1,N=null;function O(){return C++}function j(t,e){var n=Y(t.context),r=n._isRunningAction,i=N;"action"===t.type&&n.assertAlive(),n._isRunningAction=!0,N=t;try{return function(t,e,s){var u=function(t,e,n){var r=n.$mst_middleware||X,i=t;for(;i;)i.middlewares&&(r=r.concat(i.middlewares)),i=i.parent;return r}(t,0,s);if(!u.length)return l.action(s).apply(null,e.args);var p=0,c=null;return function n(t){var e=u[p++];var r=e&&e.handler;function i(t,e){c=e?e(n(t)||c):n(t)}function o(t){c=t}var a=function(){return r(t,i,o),c};return r&&e.includeHooks?a():r&&!e.includeHooks?Nt[t.name]?n(t):a():l.action(s).apply(null,t.args)}(e)}(n,t,e)}finally{N=i,n._isRunningAction=r}}function E(e,n,r){var t=function(){var t=O();return j({type:"action",name:n,id:t,args:ft(arguments),context:e,tree:c(e),rootId:N?N.rootId:t,parentId:N?N.id:0},r)};return t._isMSTAction=!0,t}function D(t,e,n){return void 0===n&&(n=!0),Y(t).addMiddleWare(e,n)}function x(t){return"function"==typeof t?"<function"+(t.name?" "+t.name:"")+">":J(t)?"<"+t+">":"`"+function(t){try{return JSON.stringify(t)}catch(t){return"<Unserializable: "+t+">"}}(t)+"`"}function R(t){var e=t.value,n=t.context[t.context.length-1].type,r=t.context.map(function(t){return t.path}).filter(function(t){return 0<t.length}).join("/"),i=0<r.length?'at path "/'+r+'" ':"",o=J(e)?"value of type "+Y(e).type.name+":":pt(e)?"value":"snapshot",a=n&&J(e)&&n.is(Y(e).snapshot);return""+i+o+" "+x(e)+" is not assignable "+(n?"to type: `"+n.name+"`":"")+(t.message?" ("+t.message+")":"")+(n?Yt(n)||pt(e)?".":", expected an instance of `"+n.name+"` or a snapshot like `"+n.describe()+"` instead."+(a?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function k(t,e,n){return t.concat([{path:e,type:n}])}function z(){return X}function M(t,e,n){return[{context:t,value:e,message:n}]}function L(t){return t.reduce(function(t,e){return t.concat(e)},[])}function F(t,e){var n,r=t.validate(e,[{path:"",type:t}]);0<r.length&&nt("Error while converting "+((n=x(e)).length<280?n:n.substring(0,272)+"......"+n.substring(n.length-8))+" to `"+t.name+"`:\n\n "+r.map(R).join("\n "))}var U,H,$=function(){function e(){this.cache=l.observable.map()}return e.prototype.addNodeToCache=function(t){if(t.identifierAttribute){var e=t.identifier;this.cache.has(e)||this.cache.set(e,l.observable.array([],et));var n=this.cache.get(e);-1!==n.indexOf(t)&&nt("Already registered"),n.push(t)}return this},e.prototype.mergeCache=function(t){var e=this;l.values(t.identifierCache.cache).forEach(function(t){return t.forEach(function(t){e.addNodeToCache(t)})})},e.prototype.notifyDied=function(t){if(t.identifierAttribute){var e=this.cache.get(t.identifier);e&&e.remove(t)}},e.prototype.splitCache=function(t){var n=new e,r=t.path;return l.values(this.cache).forEach(function(t){for(var e=t.length-1;0<=e;e--)0===t[e].path.indexOf(r)&&(n.addNodeToCache(t[e]),t.splice(e,1))}),n},e.prototype.resolve=function(e,t){var n=this.cache.get(""+t);if(!n)return null;var r=n.filter(function(t){return e.isAssignableFrom(t.type)});switch(r.length){case 0:return null;case 1:var i=r[0];if(i){for(var o=[],a=i.parent;a&&!a.isObservableInstanceCreated;)o.unshift(a),a=a.parent;for(var s=0,u=o;s<u.length;s++){u[s].createObservableInstanceIfNeeded()}}return i;default:return nt("Cannot resolve a reference to type '"+e.name+"' with id: '"+t+"' unambigously, there are multiple candidates: "+r.map(function(t){return t.path}).join(", "))}},e}();function W(t,e,n,r,i){var o,a=(o=i)&&o.$treenode||null;if(a){if(a.isRoot)return a.setParent(e,n),a;nt("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 '"+(e?e.path:"")+"/"+n+"', but it lives already at '"+a.path+"'")}return new(t.shouldAttachNode?S:d)(t,e,n,r,i)}function J(t){return!(!t||!t.$treenode)}function Y(t){return J(t)?t.$treenode:nt("Value "+t+" is no MST Node")}function Z(){return Y(this).snapshot}(H=U||(U={}))[H.INITIALIZING=0]="INITIALIZING",H[H.CREATED=1]="CREATED",H[H.FINALIZED=2]="FINALIZED",H[H.DETACHING=3]="DETACHING",H[H.DEAD=4]="DEAD";var G=function(t){return".."};function B(t,e){t.root!==e.root&&nt("Cannot calculate relative path: objects '"+t+"' and '"+e+"' are not part of the same object tree");for(var n=mt(t.path),r=mt(e.path),i=0;i<n.length&&n[i]===r[i];i++);return n.slice(i).map(G).join("/")+gt(r.slice(i))}function K(t,e,n){return void 0===n&&(n=!0),q(t,mt(e),n)}function q(t,e,n){void 0===n&&(n=!0);for(var r=t,i=0;i<e.length;i++){var o=e[i];if(""!==o){if(".."===o){if(r=r.parent)continue}else{if("."===o||""===o)continue;if(r){if(r instanceof d)try{var a=r.value;J(a)&&(r=Y(a))}catch(t){if(!n)return;throw t}if(r instanceof S)if(r.getChildType(o)&&(r=r.getChildNode(o)))continue}}return n?nt("Could not resolve '"+o+"' in path '"+(gt(e.slice(0,i))||"/")+"' while resolving '"+gt(e)+"'"):void 0}r=r.root}return r}function Q(n){if(!n)return X;var t=Object.keys(n);if(!t.length)return X;var r=new Array(t.length);return t.forEach(function(t,e){r[e]=n[t]}),r}var X=Object.freeze([]),tt=Object.freeze({}),et="string"==typeof l.$mobx?{deep:!1}:{deep:!1,proxy:!1};function nt(t){throw void 0===t&&(t="Illegal state"),new Error("[mobx-state-tree] "+t)}function rt(t){return t}Object.freeze(et);var it=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function ot(t){return!(!Array.isArray(t)&&!l.isObservableArray(t))}function at(t){return t?ot(t)?t:[t]:X}function st(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function ut(t){return!(null===t||"object"!=typeof t||t instanceof Date||t instanceof RegExp)}function pt(t){return null==t||("string"==typeof t||"number"==typeof t||"boolean"==typeof t||t instanceof Date)}function ct(t){return t}function lt(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function ht(r,i){return r.push(i),function(){var t,e,n;e=i,-1!==(n=(t=r).indexOf(e))&&t.splice(n,1)}}function ft(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t[n];return e}var dt=function(t,e){};function yt(t){return l=t.name,h=t,f=function(){var s=O(),u=N||nt("Not running an action!"),p=arguments;function c(t,e,n){t.$mst_middleware=f.$mst_middleware,j({name:l,type:e,id:s,args:[n],tree:u.tree,context:u.context,parentId:u.id,rootId:u.rootId},t)}return new Promise(function(e,n){var r,t=function(){r=h.apply(null,arguments),i(void 0)};function i(t){var e;try{c(function(t){e=r.next(t)},"flow_resume",t)}catch(e){return void setImmediate(function(){c(function(t){n(e)},"flow_throw",e)})}a(e)}function o(t){var e;try{c(function(t){e=r.throw(t)},"flow_resume_error",t)}catch(e){return void setImmediate(function(){c(function(t){n(e)},"flow_throw",e)})}a(e)}function a(t){if(!t.done)return t.value&&"function"==typeof t.value.then||nt("Only promises can be yielded to `async`, got: "+t),t.value.then(i,o);setImmediate(function(){c(function(t){e(t)},"flow_return",t.value)})}t.$mst_middleware=f.$mst_middleware,j({name:l,type:"flow_spawn",id:s,args:ft(p),tree:u.tree,context:u.context,parentId:u.id,rootId:u.rootId},t)})};var l,h,f}function vt(t){return!0==("number"==typeof t)?""+t:t.replace(/~/g,"~1").replace(/\//g,"~0")}function bt(t){return t.replace(/~0/g,"/").replace(/~1/g,"~")}function gt(t){return 0===t.length?"":"/"+t.map(vt).join("/")}function mt(t){var e=t.split("/").map(bt);return""===e[0]?e.slice(1):e}dt.ids={};var St,wt,At="Map.put can only be used to store complex values that have an identifier type attribute";(wt=St||(St={}))[wt.UNKNOWN=0]="UNKNOWN",wt[wt.YES=1]="YES",wt[wt.NO=2]="NO";var Pt=function(n){function t(t){return n.call(this,t,l.observable.ref.enhancer)||this}return a(t,n),t.prototype.get=function(t){return n.prototype.get.call(this,""+t)},t.prototype.has=function(t){return n.prototype.has.call(this,""+t)},t.prototype.delete=function(t){return n.prototype.delete.call(this,""+t)},t.prototype.set=function(t,e){return n.prototype.set.call(this,""+t,e)},t.prototype.put=function(t){if(t||nt("Map.put cannot be used to set empty values"),J(t)){var e=Y(t),n=e.identifier;return this.set(n,e.value),e.value}if(ut(t)){n=void 0;var r=Y(this).type;return r.identifierMode===St.NO?nt(At):r.identifierMode===St.YES?(n=""+t[r.mapIdentifierAttribute],this.set(n,t),this.get(n)):nt(At)}return nt("Map.put can only be used to store complex values")},t}(l.ObservableMap),_t=function(r){function t(t,e){var n=r.call(this,t)||this;return n.shouldAttachNode=!0,n.identifierMode=St.UNKNOWN,n.mapIdentifierAttribute=void 0,n.flags=b.Map,n.subType=e,n._determineIdentifierMode(),n}return a(t,r),t.prototype.instantiate=function(t,e,n,r){return this.identifierMode===St.UNKNOWN&&this._determineIdentifierMode(),W(this,t,e,n,r)},t.prototype._determineIdentifierMode=function(){var t=[];if(function t(e,n){if(e instanceof kt)n.push(e);else if(e instanceof Qt){if(!t(e.type,n))return!1}else if(e instanceof Kt){for(var r=0;r<e.types.length;r++)if(!t(e.types[r],n))return!1}else if(e instanceof ne){var i=e.getSubType(!1);if(!i)return!1;t(i,n)}return!0}(this.subType,t)){var e=void 0;t.forEach(function(t){t.identifierAttribute&&(e&&e!==t.identifierAttribute&&nt("The objects in a map should all have the same identifier attribute, expected '"+e+"', but child of type '"+t.name+"' declared attribute '"+t.identifierAttribute+"' as identifier"),e=t.identifierAttribute)}),e?(this.identifierMode=St.YES,this.mapIdentifierAttribute=e):this.identifierMode=St.NO}},t.prototype.initializeChildNodes=function(e,n){void 0===n&&(n={});var r=e.type.subType,i=e._environment,o={};return Object.keys(n).forEach(function(t){o[t]=r.instantiate(e,t,i,n[t])}),o},t.prototype.createNewInstance=function(t,e,n){return new Pt(e)},t.prototype.finalizeNewInstance=function(t,e){l._interceptReads(e,t.unbox),l.intercept(e,this.willChange),l.observe(e,this.didChange)},t.prototype.describe=function(){return"Map<string, "+this.subType.describe()+">"},t.prototype.getChildren=function(t){return l.values(t.storedValue)},t.prototype.getChildNode=function(t,e){var n=t.storedValue.get(""+e);return n||nt("Not a child "+e),n},t.prototype.willChange=function(t){var e=Y(t.object),n=t.name;e.assertWritable();var r=e.type,i=r.subType;switch(t.type){case"update":var o=t.newValue;if(o===t.object.get(n))return null;t.newValue=i.reconcile(e.getChildNode(n),t.newValue),r.processIdentifier(n,t.newValue);break;case"add":t.newValue,t.newValue=i.instantiate(e,n,void 0,t.newValue),r.processIdentifier(n,t.newValue)}return t},t.prototype.processIdentifier=function(t,e){if(this.identifierMode===St.YES&&e instanceof S){var n=e.identifier;n!==t&&nt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '"+n+"', but expected: '"+t+"'")}},t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){var e={};return t.getChildren().forEach(function(t){e[t.subpath]=t.snapshot}),e},t.prototype.processInitialSnapshot=function(e,t){var n={};return Object.keys(e).forEach(function(t){n[t]=e[t].getSnapshot()}),n},t.prototype.didChange=function(t){var e=Y(t.object);switch(t.type){case"update":return void e.emitPatch({op:"replace",path:vt(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},e);case"add":return void e.emitPatch({op:"add",path:vt(t.name),value:t.newValue.snapshot,oldValue:void 0},e);case"delete":var n=t.oldValue.snapshot;return t.oldValue.die(),void e.emitPatch({op:"remove",path:vt(t.name),oldValue:n},e)}},t.prototype.applyPatchLocally=function(t,e,n){var r=t.storedValue;switch(n.op){case"add":case"replace":r.set(e,n.value);break;case"remove":r.delete(e)}},t.prototype.applySnapshot=function(t,e){var n=t.storedValue,r={};for(var i in Array.from(n.keys()).forEach(function(t){r[t]=!1}),e)n.set(i,e[i]),r[""+i]=!0;Object.keys(r).forEach(function(t){!1===r[t]&&n.delete(t)})},t.prototype.getChildType=function(t){return this.subType},t.prototype.isValidSnapshot=function(e,n){var r=this;return st(e)?L(Object.keys(e).map(function(t){return r.subType.validate(e[t],k(n,t,r.subType))})):M(n,e,"Value is not a plain object")},t.prototype.getDefaultSnapshot=function(){return tt},t.prototype.removeChild=function(t,e){t.storedValue.delete(e)},n([l.action],t.prototype,"applySnapshot",null),t}(w);var Vt=function(r){function t(t,e){var n=r.call(this,t)||this;return n.shouldAttachNode=!0,n.flags=b.Array,n.subType=e,n}return a(t,r),t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,r)},t.prototype.initializeChildNodes=function(r,t){void 0===t&&(t=[]);var i=r.type.subType,o=r._environment,a={};return t.forEach(function(t,e){var n=""+e;a[n]=i.instantiate(r,n,o,t)}),a},t.prototype.createNewInstance=function(t,e,n){return l.observable.array(Q(e),et)},t.prototype.finalizeNewInstance=function(t,e){l._getAdministration(e).dehancer=t.unbox,l.intercept(e,this.willChange),l.observe(e,this.didChange)},t.prototype.describe=function(){return this.subType.describe()+"[]"},t.prototype.getChildren=function(t){return t.storedValue.slice()},t.prototype.getChildNode=function(t,e){var n=parseInt(e,10);return n<t.storedValue.length?t.storedValue[n]:nt("Not a child: "+e)},t.prototype.willChange=function(t){var e=Y(t.object);e.assertWritable();var n=e.type.subType,r=e.getChildren(),i=null;switch(t.type){case"update":if(t.newValue===t.object[t.index])return null;if(!(i=It(e,n,[r[t.index]],[t.newValue],[t.index])))return null;t.newValue=i[0];break;case"splice":var o=t.index,a=t.removedCount,s=t.added;if(!(i=It(e,n,r.slice(o,o+a),s,s.map(function(t,e){return o+e}))))return null;t.added=i;for(var u=o+a;u<r.length;u++)r[u].setParent(e,""+(u+s.length-a))}return t},t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){return t.getChildren().map(function(t){return t.snapshot})},t.prototype.processInitialSnapshot=function(e,t){var n=[];return Object.keys(e).forEach(function(t){n.push(e[t].getSnapshot())}),n},t.prototype.didChange=function(t){var e=Y(t.object);switch(t.type){case"update":return void e.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},e);case"splice":for(var n=t.removedCount-1;0<=n;n--)e.emitPatch({op:"remove",path:""+(t.index+n),oldValue:t.removed[n].snapshot},e);for(n=0;n<t.addedCount;n++)e.emitPatch({op:"add",path:""+(t.index+n),value:e.getChildNode(""+(t.index+n)).snapshot,oldValue:void 0},e);return}},t.prototype.applyPatchLocally=function(t,e,n){var r=t.storedValue,i="-"===e?r.length:parseInt(e);switch(n.op){case"replace":r[i]=n.value;break;case"add":r.splice(i,0,n.value);break;case"remove":r.splice(i,1)}},t.prototype.applySnapshot=function(t,e){t.storedValue.replace(e)},t.prototype.getChildType=function(t){return this.subType},t.prototype.isValidSnapshot=function(t,n){var r=this;return ot(t)?L(t.map(function(t,e){return r.subType.validate(t,k(n,""+e,r.subType))})):M(n,t,"Value is not an array")},t.prototype.getDefaultSnapshot=function(){return X},t.prototype.removeChild=function(t,e){t.storedValue.splice(parseInt(e,10),1)},n([l.action],t.prototype,"applySnapshot",null),t}(w);function It(t,e,n,r,i){for(var o,a,s,u=!1,p=void 0,c=!0,l=0;u=l<=r.length-1,o=n[l],a=u?r[l]:void 0,((s=a)instanceof d||s instanceof S)&&(a=a.storedValue),o||u;l++)if(u)if(o)if(Ct(o,a))n[l]=Tt(e,t,""+i[l],a,o);else{p=void 0;for(var h=l;h<n.length;h++)if(Ct(n[h],a)){p=n.splice(h,1)[0];break}n.splice(l,0,Tt(e,t,""+i[l],a,p)),c=!1}else J(a)&&Y(a).parent===t&&nt("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 '"+t.path+"/"+i[l]+"', but it lives already at '"+Y(a).path+"'"),n.splice(l,0,Tt(e,t,""+i[l],a)),c=!1;else o.die(),n.splice(l,1),l--,c=!1;return c?null:n}function Tt(t,e,n,r,i){var o;if(J(r)&&((o=Y(r)).assertAlive(),null!==o.parent&&o.parent===e))return o.setParent(e,n),i&&i!==o&&i.die(),o;return i?((o=t.reconcile(i,r)).setParent(e,n),o):t.instantiate(e,n,e._environment,r)}function Ct(t,e){return J(e)?Y(e)===t:t.snapshot===e||!!(t instanceof S&&null!==t.identifier&&t.identifierAttribute&&st(e)&&t.identifier===""+e[t.identifierAttribute])}var Nt,Ot,jt="preProcessSnapshot",Et="postProcessSnapshot";function Dt(){return Y(this).toString()}(Ot=Nt||(Nt={})).afterCreate="afterCreate",Ot.afterAttach="afterAttach",Ot.beforeDetach="beforeDetach",Ot.beforeDestroy="beforeDestroy";var xt={name:"AnonymousModel",properties:{},initializers:X};function Rt(t){return Object.keys(t).reduce(function(t,e){var n,r,i;if(e in Nt)return nt("Hook '"+e+"' was defined as property. Hooks should be defined as part of the actions");var o=Object.getOwnPropertyDescriptor(t,e);"get"in o&&nt("Getters are not supported as properties. Please use views instead");var a=o.value;if(null==a)nt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");else{if(pt(a))return Object.assign({},t,((n={})[e]=Xt(function(t){switch(typeof t){case"string":return Lt;case"number":return Ft;case"boolean":return Ht;case"object":if(t instanceof Date)return Jt}return nt("Cannot determine primitive type from value "+t)}(a),a),n));if(a instanceof _t)return Object.assign({},t,((r={})[e]=Xt(a,{}),r));if(a instanceof Vt)return Object.assign({},t,((i={})[e]=Xt(a,[]),i));if(P(a))return t;nt("Invalid type definition for property '"+e+"', cannot infer a type from a value like '"+a+"' ("+typeof a+")")}},t)}var kt=function(r){function e(t){var e=r.call(this,t.name||xt.name)||this;e.flags=b.Object,e.shouldAttachNode=!0;var n=t.name||xt.name;return/^\w[\w\d_]*$/.test(n)||nt("Typename should be a valid identifier: "+n),Object.assign(e,xt,t),e.properties=Rt(e.properties),ct(e.properties),e.propertyNames=Object.keys(e.properties),e.identifierAttribute=e._getIdentifierAttribute(),e}return a(e,r),e.prototype._getIdentifierAttribute=function(){var n=void 0;return this.forAllProps(function(t,e){e.flags&b.Identifier&&(n&&nt("Cannot define property '"+t+"' as object identifier, property '"+n+"' is already defined as identifier property"),n=t)}),n},e.prototype.cloneAndEnhance=function(t){return new e({name:t.name||this.name,properties:Object.assign({},this.properties,t.properties),initializers:this.initializers.concat(t.initializers||[]),preProcessor:t.preProcessor||this.preProcessor,postProcessor:t.postProcessor||this.postProcessor})},e.prototype.actions=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateActions(t,e(t)),t}]})},e.prototype.instantiateActions=function(s,u){st(u)||nt("actions initializer should return a plain object containing actions"),Object.keys(u).forEach(function(t){t===jt&&nt("Cannot define action '"+jt+"', it should be defined using 'type.preProcessSnapshot(fn)' instead"),t===Et&&nt("Cannot define action '"+Et+"', it should be defined using 'type.postProcessSnapshot(fn)' instead");var e=u[t],n=s[t];if(t in Nt&&n){var r=e;e=function(){n.apply(null,arguments),r.apply(null,arguments)}}var i=e.$mst_middleware,o=e.bind(u);o.$mst_middleware=i;var a=E(s,t,o);u[t]=a,lt(s,t,a)})},e.prototype.named=function(t){return this.cloneAndEnhance({name:t})},e.prototype.props=function(t){return this.cloneAndEnhance({properties:t})},e.prototype.volatile=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateVolatileState(t,e(t)),t}]})},e.prototype.instantiateVolatileState=function(t,e){st(e)||nt("volatile state initializer should return a plain object containing state"),l.set(t,e)},e.prototype.extend=function(s){var u=this;return this.cloneAndEnhance({initializers:[function(t){var e=s(t),n=e.actions,r=e.views,i=e.state,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}(e,["actions","views","state"]);for(var a in o)nt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '"+a+"'");return i&&u.instantiateVolatileState(t,i),r&&u.instantiateViews(t,r),n&&u.instantiateActions(t,n),t}]})},e.prototype.views=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateViews(t,e(t)),t}]})},e.prototype.instantiateViews=function(i,o){st(o)||nt("views initializer should return a plain object containing views"),Object.keys(o).forEach(function(t){var e=Object.getOwnPropertyDescriptor(o,t),n=e.value;if("get"in e)if(l.isComputedProp(i,t)){var r=l._getAdministration(i,t);r.derivation=e.get,r.scope=i,e.set&&(r.setter=l.action(r.name+"-setter",e.set))}else l.computed(i,t,e,!0);else"function"==typeof n?lt(i,t,n):nt("A view member should either be a function or getter based property")})},e.prototype.preProcessSnapshot=function(e){var n=this.preProcessor;return n?this.cloneAndEnhance({preProcessor:function(t){return n(e(t))}}):this.cloneAndEnhance({preProcessor:e})},e.prototype.postProcessSnapshot=function(e){var n=this.postProcessor;return n?this.cloneAndEnhance({postProcessor:function(t){return e(n(t))}}):this.cloneAndEnhance({postProcessor:e})},e.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,J(r)?r:this.applySnapshotPreProcessor(r))},e.prototype.initializeChildNodes=function(n,r){void 0===r&&(r={});var t=n.type,i={};return t.forAllProps(function(t,e){i[t]=e.instantiate(n,t,n._environment,r[t])}),i},e.prototype.createNewInstance=function(t,e,n){return l.observable.object(e,tt,et)},e.prototype.finalizeNewInstance=function(e,n){lt(n,"toString",Dt),this.forAllProps(function(t){l._interceptReads(n,t,e.unbox)}),this.initializers.reduce(function(t,e){return e(t)},n),l.intercept(n,this.willChange),l.observe(n,this.didChange)},e.prototype.willChange=function(t){var e=Y(t.object);e.assertWritable();var n=e.type.properties[t.name];return n&&(t.newValue,t.newValue=n.reconcile(e.getChildNode(t.name),t.newValue)),t},e.prototype.didChange=function(t){var e=Y(t.object);if(e.type.properties[t.name]){var n=t.oldValue?t.oldValue.snapshot:void 0;e.emitPatch({op:"replace",path:vt(t.name),value:t.newValue.snapshot,oldValue:n},e)}},e.prototype.getChildren=function(n){var r=this,i=[];return this.forAllProps(function(t,e){i.push(r.getChildNode(n,t))}),i},e.prototype.getChildNode=function(t,e){if(!(e in this.properties))return nt("Not a value property: "+e);var n=l._getAdministration(t.storedValue,e).value;return n||nt("Node not available for property "+e)},e.prototype.getValue=function(t){return t.storedValue},e.prototype.getSnapshot=function(n,t){var r=this;void 0===t&&(t=!0);var i={};return this.forAllProps(function(t,e){l.getAtom(n.storedValue,t).reportObserved(),i[t]=r.getChildNode(n,t).snapshot}),t?this.applySnapshotPostProcessor(i):i},e.prototype.processInitialSnapshot=function(e,t){var n={};return Object.keys(e).forEach(function(t){n[t]=e[t].getSnapshot()}),this.applySnapshotPostProcessor(this.applyOptionalValuesToSnapshot(n))},e.prototype.applyPatchLocally=function(t,e,n){"replace"!==n.op&&"add"!==n.op&&nt("object does not support operation "+n.op),t.storedValue[e]=n.value},e.prototype.applySnapshot=function(n,t){var r=this.applySnapshotPreProcessor(t);this.forAllProps(function(t,e){n.storedValue[t]=r[t]})},e.prototype.applySnapshotPreProcessor=function(t){var e=this.preProcessor;return e?e.call(null,t):t},e.prototype.applyOptionalValuesToSnapshot=function(r){return r&&(r=Object.assign({},r),this.forAllProps(function(t,e){if(!(t in r)){var n=zt(e);n&&(r[t]=n.getDefaultValueSnapshot())}})),r},e.prototype.applySnapshotPostProcessor=function(t){var e=this.postProcessor;return e?e.call(null,t):t},e.prototype.getChildType=function(t){return this.properties[t]},e.prototype.isValidSnapshot=function(t,e){var n=this,r=this.applySnapshotPreProcessor(t);return st(r)?L(this.propertyNames.map(function(t){return n.properties[t].validate(r[t],k(e,t,n.properties[t]))})):M(e,r,"Value is not a plain object")},e.prototype.forAllProps=function(e){var n=this;this.propertyNames.forEach(function(t){return e(t,n.properties[t])})},e.prototype.describe=function(){var e=this;return"{ "+this.propertyNames.map(function(t){return t+": "+e.properties[t].describe()}).join("; ")+" }"},e.prototype.getDefaultSnapshot=function(){return tt},e.prototype.removeChild=function(t,e){t.storedValue[e]=void 0},n([l.action],e.prototype,"applySnapshot",null),e}(w);function zt(t){if(t)return t.flags&b.Union&&t.types?t.types.find(zt):t.flags&b.Late&&t.getSubType&&t.getSubType(!1)?zt(t.subType):t.flags&b.Optional?t:void 0}var Mt=function(o){function t(t,e,n,r){void 0===r&&(r=rt);var i=o.call(this,t)||this;return i.shouldAttachNode=!1,i.flags=e,i.checker=n,i.initializer=r,i}return a(t,o),t.prototype.describe=function(){return this.name},t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,r)},t.prototype.createNewInstance=function(t,e,n){return this.initializer(n)},t.prototype.isValidSnapshot=function(t,e){return pt(t)&&this.checker(t)?z():M(e,t,"Value is not a "+("Date"===this.name?"Date or a unix milliseconds timestamp":this.name))},t}(A),Lt=new Mt("string",b.String,function(t){return"string"==typeof t}),Ft=new Mt("number",b.Number,function(t){return"number"==typeof t}),Ut=new Mt("integer",b.Integer,function(t){return it(t)}),Ht=new Mt("boolean",b.Boolean,function(t){return"boolean"==typeof t}),$t=new Mt("null",b.Null,function(t){return null===t}),Wt=new Mt("undefined",b.Undefined,function(t){return void 0===t}),Jt=new Mt("Date",b.Date,function(t){return"number"==typeof t||t instanceof Date},function(t){return t instanceof Date?t:new Date(t)});function Yt(t){return P(t)&&0<(t.flags&(b.String|b.Number|b.Integer|b.Boolean|b.Date))}Jt.getSnapshot=function(t){return t.storedValue.getTime()};var Zt=function(n){function t(t){var e=n.call(this,JSON.stringify(t))||this;return e.shouldAttachNode=!1,e.flags=b.Literal,e.value=t,e}return a(t,n),t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,r)},t.prototype.describe=function(){return JSON.stringify(this.value)},t.prototype.isValidSnapshot=function(t,e){return pt(t)&&t===this.value?z():M(e,t,"Value is not a literal "+JSON.stringify(this.value))},t}(A);function Gt(t){return new Zt(t)}var Bt=function(o){function t(t,e,n,r){var i=o.call(this,t)||this;return i.type=e,i.predicate=n,i.message=r,i}return a(t,o),Object.defineProperty(t.prototype,"flags",{get:function(){return this.type.flags|b.Refinement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.type.shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.describe=function(){return this.name},t.prototype.instantiate=function(t,e,n,r){return this.type.instantiate(t,e,n,r)},t.prototype.isAssignableFrom=function(t){return this.type.isAssignableFrom(t)},t.prototype.isValidSnapshot=function(t,e){var n=this.type.validate(t,e);if(0<n.length)return n;var r=J(t)?Y(t).snapshot:t;return this.predicate(r)?z():M(e,t,this.message(t))},t}(A);var Kt=function(i){function t(t,e,n){var r=i.call(this,t)||this;return r.eager=!0,r.dispatcher=n&&n.dispatcher,n&&!n.eager&&(r.eager=!1),r.types=e,r}return a(t,i),Object.defineProperty(t.prototype,"flags",{get:function(){var e=b.Union;return this.types.forEach(function(t){e|=t.flags}),e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.types.some(function(t){return t.shouldAttachNode})},enumerable:!0,configurable:!0}),t.prototype.isAssignableFrom=function(e){return this.types.some(function(t){return t.isAssignableFrom(e)})},t.prototype.describe=function(){return"("+this.types.map(function(t){return t.describe()}).join(" | ")+")"},t.prototype.instantiate=function(t,e,n,r){var i=this.determineType(r);return i?i.instantiate(t,e,n,r):nt("No matching type for union "+this.describe())},t.prototype.reconcile=function(t,e){var n=this.determineType(e);return n?n.reconcile(t,e):nt("No matching type for union "+this.describe())},t.prototype.determineType=function(e){return this.dispatcher?this.dispatcher(e):this.types.find(function(t){return t.is(e)})},t.prototype.isValidSnapshot=function(t,e){if(this.dispatcher)return this.dispatcher(t).validate(t,e);for(var n=[],r=0,i=0;i<this.types.length;i++){var o=this.types[i].validate(t,e);if(0===o.length){if(this.eager)return z();r++}else n.push(o)}return 1===r?z():M(e,t,"No type is applicable for the union").concat(L(n))},t}(A);function qt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=P(t)?void 0:t,i=P(t)?[t].concat(e):e,o="("+i.map(function(t){return t.name}).join(" | ")+")";return new Kt(o,i,r)}var Qt=function(r){function t(t,e){var n=r.call(this,t.name)||this;return n.type=t,n.defaultValue=e,n}return a(t,r),Object.defineProperty(t.prototype,"flags",{get:function(){return this.type.flags|b.Optional},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.type.shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.describe=function(){return this.type.describe()+"?"},t.prototype.instantiate=function(t,e,n,r){if(void 0!==r)return this.type.instantiate(t,e,n,r);var i=this.getDefaultInstanceOrSnapshot();return this.type.instantiate(t,e,n,i)},t.prototype.reconcile=function(t,e){return this.type.reconcile(t,this.type.is(e)&&void 0!==e?e:this.getDefaultInstanceOrSnapshot())},t.prototype.getDefaultInstanceOrSnapshot=function(){var t="function"==typeof this.defaultValue?this.defaultValue():this.defaultValue;return this.defaultValue,t},t.prototype.getDefaultValueSnapshot=function(){var t=this.getDefaultInstanceOrSnapshot();return J(t)?Y(t).snapshot:t},t.prototype.isValidSnapshot=function(t,e){return void 0===t?z():this.type.validate(t,e)},t.prototype.isAssignableFrom=function(t){return this.type.isAssignableFrom(t)},t}(A);function Xt(t,e){return"function"!=typeof e&&J(e)&&nt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead"),new Qt(t,e)}var te=Xt(Wt,void 0),ee=Xt($t,null);var ne=function(r){function t(t,e){var n=r.call(this,t)||this;return n._subType=null,n.definition=e,n}return a(t,r),Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|b.Late},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.getSubType(!0).shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.getSubType=function(t){if(null===this._subType){var e=void 0;try{e=this.definition()}catch(t){if(!(t instanceof ReferenceError))throw t;e=void 0}if(t&&void 0===e&&nt("Late type seems to be used too early, the definition (still) returns undefined"),e)return this._subType=e}return this._subType},t.prototype.instantiate=function(t,e,n,r){return this.getSubType(!0).instantiate(t,e,n,r)},t.prototype.reconcile=function(t,e){return this.getSubType(!0).reconcile(t,e)},t.prototype.describe=function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"},t.prototype.isValidSnapshot=function(t,e){var n=this.getSubType(!1);return n?n.validate(t,e):z()},t.prototype.isAssignableFrom=function(t){var e=this.getSubType(!1);return!!e&&e.isAssignableFrom(t)},t}(A);var re=function(n){function t(t){var e=n.call(this,t?"frozen("+t.name+")":"frozen")||this;return e.subType=t,e.shouldAttachNode=!1,e.flags=b.Frozen,e}return a(t,n),t.prototype.describe=function(){return"<any immutable value>"},t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,r)},t.prototype.isValidSnapshot=function(t,e){return"function"==typeof t?M(e,t,"Value is not serializable and cannot be frozen"):this.subType?this.subType.validate(t,e):z()},t}(A),ie=new re;var oe=function(){function t(t,e,n){if(this.mode=t,this.value=e,this.targetType=n,"object"===t){if(!J(e))return nt("Can only store references to tree nodes, got: '"+e+"'");if(!Y(e).identifierAttribute)return nt("Can only store references with a defined identifier attribute.")}}return Object.defineProperty(t.prototype,"resolvedValue",{get:function(){var t=this.node,e=this.targetType,n=t.root.identifierCache.resolve(e,this.value);return n?n.value:nt("Failed to resolve reference '"+this.value+"' to type '"+this.targetType.name+"' (from node: "+t.path+")")},enumerable:!0,configurable:!0}),n([l.computed],t.prototype,"resolvedValue",null),t}(),ae=function(n){function t(t){var e=n.call(this,"reference("+t.name+")")||this;return e.targetType=t,e.shouldAttachNode=!1,e.flags=b.Reference,e}return a(t,n),t.prototype.describe=function(){return this.name},t.prototype.isAssignableFrom=function(t){return this.targetType.isAssignableFrom(t)},t.prototype.isValidSnapshot=function(t,e){return"string"==typeof t||"number"==typeof t?z():M(e,t,"Value is not a valid identifier, which is a string or a number")},t}(A),se=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.getValue=function(t){if(t.isAlive){var e=t.storedValue;return"object"===e.mode?e.value:e.resolvedValue}},t.prototype.getSnapshot=function(t){var e=t.storedValue;switch(e.mode){case"identifier":return e.value;case"object":return e.value[Y(e.value).identifierAttribute]}},t.prototype.instantiate=function(t,e,n,r){var i,o=J(r)?"object":"identifier",a=W(this,t,e,n,i=new oe(o,r,this.targetType));return i.node=a},t.prototype.reconcile=function(t,e){if(t.type===this){var n=J(e)?"object":"identifier",r=t.storedValue;if(n===r.mode&&r.value===e)return t}var i=this.instantiate(t.parent,t.subpath,t._environment,e);return t.die(),i},t}(ae),ue=function(r){function t(t,e){var n=r.call(this,t)||this;return n.options=e,n}return a(t,r),t.prototype.getValue=function(t){if(t.isAlive)return this.options.get(t.storedValue,t.parent?t.parent.storedValue:null)},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,J(r)?this.options.set(r,t?t.storedValue:null):r)},t.prototype.reconcile=function(t,e){var n=J(e)?this.options.set(e,t?t.storedValue:null):e;if(t.type===this&&t.storedValue===n)return t;var r=this.instantiate(t.parent,t.subpath,t._environment,n);return t.die(),r},t}(ae);var pe=function(e){function t(){var t=e.call(this,"identifier")||this;return t.shouldAttachNode=!1,t.flags=b.Identifier,t}return a(t,e),t.prototype.instantiate=function(t,e,n,r){return t&&t.type instanceof kt||nt("Identifier types can only be instantiated as direct child of a model type"),W(this,t,e,n,r)},t.prototype.reconcile=function(t,e){return t.storedValue!==e?nt("Tried to change identifier from '"+t.storedValue+"' to '"+e+"'. Changing identifiers is not allowed."):t},t.prototype.describe=function(){return"identifier"},t.prototype.isValidSnapshot=function(t,e){return"string"!=typeof t?M(e,t,"Value is not a valid identifier, expected a string"):z()},t}(A),ce=function(i){function t(){var t=i.call(this)||this;return t.name="identifierNumber",t}return a(t,i),t.prototype.instantiate=function(t,e,n,r){return i.prototype.instantiate.call(this,t,e,n,r)},t.prototype.isValidSnapshot=function(t,e){return"number"==typeof t?z():M(e,t,"Value is not a valid identifierNumber, expected a number")},t.prototype.reconcile=function(t,e){return i.prototype.reconcile.call(this,t,e)},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.describe=function(){return"identifierNumber"},t}(pe),le=new pe,he=new ce;var fe=function(n){function t(t){var e=n.call(this,t.name)||this;return e.options=t,e.flags=b.Reference,e.shouldAttachNode=!1,e}return a(t,n),t.prototype.describe=function(){return this.name},t.prototype.isAssignableFrom=function(t){return t===this},t.prototype.isValidSnapshot=function(t,e){if(this.options.isTargetType(t))return z();var n=this.options.getValidationMessage(t);return n?M(e,t,"Invalid value for type '"+this.name+"': "+n):z()},t.prototype.getValue=function(t){if(t.isAlive)return t.storedValue},t.prototype.getSnapshot=function(t){return this.options.toSnapshot(t.storedValue)},t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,this.options.isTargetType(r)?r:this.options.fromSnapshot(r))},t.prototype.reconcile=function(t,e){var n=!this.options.isTargetType(e);if(t.type===this&&(n?e===t.snapshot:e===t.storedValue))return t;var r=n?this.options.fromSnapshot(e):e,i=this.instantiate(t.parent,t.subpath,t._environment,r);return t.die(),i},t}(A),de={enumeration:function(t,e){var n=qt.apply(void 0,("string"==typeof t?e:t).map(function(t){return Gt(""+t)}));return"string"==typeof t&&(n.name=t),n},model:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():"AnonymousModel",r=t.shift()||{};return new kt({name:n,properties:r})},compose:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():"AnonymousModel";return t.reduce(function(e,n){return e.cloneAndEnhance({name:e.name+"_"+n.name,properties:n.properties,initializers:n.initializers,preProcessor:function(t){return n.applySnapshotPreProcessor(e.applySnapshotPreProcessor(t))},postProcessor:function(t){return n.applySnapshotPostProcessor(e.applySnapshotPostProcessor(t))}})}).named(n)},custom:function(t){return new fe(t)},reference:function(t,e){return e?new ue(t,e):new se(t)},union:qt,optional:Xt,literal:Gt,maybe:function(t){return qt(t,te)},maybeNull:function(t){return qt(t,ee)},refinement:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():P(t[0])?t[0].name:null,r=t[0],i=t[1],o=t[2]?t[2]:function(t){return"Value does not respect the refinement predicate"};return new Bt(n,r,i,o)},string:Lt,boolean:Ht,number:Ft,integer:Ut,Date:Jt,map:function(t){return new _t("map<string, "+t.name+">",t)},array:function(t){return new Vt(t.name+"[]",t)},frozen:function(t){return 0===arguments.length?ie:P(t)?new re(t):Xt(ie,t)},identifier:le,identifierNumber:he,late:function(t,e){var n="string"==typeof t?t:"late("+t.toString()+")";return new ne(n,"string"==typeof t?e:t)},undefined:Wt,null:$t};t.types=de,t.typecheck=F,t.escapeJsonPath=vt,t.unescapeJsonPath=bt,t.joinJsonPath=gt,t.splitJsonPath=mt,t.decorate=function(t,e){var n={handler:t,includeHooks:!0};return e.$mst_middleware&&e.$mst_middleware.push(n),e.$mst_middleware=[n],e},t.addMiddleware=D,t.process=function(t){return dt("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`."),yt(t)},t.isStateTreeNode=J,t.flow=yt,t.applyAction=I,t.onAction=T,t.recordActions=function(t){var e={actions:[],stop:function(){return n()},replay:function(t){I(t,e.actions)}},n=T(t,e.actions.push.bind(e.actions));return e},t.createActionTrackingMiddleware=function(a){return function(e,t,n){switch(e.type){case"action":if(a.filter&&!0!==a.filter(e))return t(e);var r=a.onStart(e);a.onResume(e,r),_.set(e.id,{call:e,context:r,async:!1});try{var i=t(e);return a.onSuspend(e,r),!1===_.get(e.id).async&&(_.delete(e.id),a.onSuccess(e,r,i)),i}catch(t){throw _.delete(e.id),a.onFail(e,r,t),t}case"flow_spawn":return(o=_.get(e.rootId)).async=!0,t(e);case"flow_resume":case"flow_resume_error":var o=_.get(e.rootId);a.onResume(e,o.context);try{return t(e)}finally{a.onSuspend(e,o.context)}case"flow_throw":return o=_.get(e.rootId),_.delete(e.id),a.onFail(e,o.context,e.args[0]),t(e);case"flow_return":return o=_.get(e.rootId),_.delete(e.id),a.onSuccess(e,o.context,e.args[0]),t(e)}}},t.setLivelynessChecking=function(t){v=t},t.getType=u,t.getChildType=function(t,e){return Y(t).getChildType(e)},t.onPatch=o,t.onSnapshot=function(t,e){return Y(t).onSnapshot(e)},t.applyPatch=s,t.recordPatches=function(e){var t=null;function n(){t||(t=o(e,function(t,e){r.rawPatches.push([t,e])}))}var r={rawPatches:[],get patches(){return this.rawPatches.map(function(t){return t[0]})},get inversePatches(){return this.rawPatches.map(function(t){return t[0],t[1]})},stop:function(){t&&t(),t=null},resume:n,replay:function(t){s(t||e,r.patches)},undo:function(t){s(t||e,r.inversePatches.slice().reverse())}};return n(),r},t.protect=function(t){var e=Y(t);e.isRoot||nt("`protect` can only be invoked on root nodes"),e.isProtectionEnabled=!0},t.unprotect=function(t){var e=Y(t);e.isRoot||nt("`unprotect` can only be invoked on root nodes"),e.isProtectionEnabled=!1},t.isProtected=function(t){return Y(t).isProtected},t.applySnapshot=p,t.getSnapshot=function(t,e){void 0===e&&(e=!0);var n=Y(t);return e?n.snapshot:ct(n.type.getSnapshot(n,!1))},t.hasParent=function(t,e){void 0===e&&(e=1);for(var n=Y(t).parent;n;){if(0==--e)return!0;n=n.parent}return!1},t.getParent=function(t,e){void 0===e&&(e=1);for(var n=e,r=Y(t).parent;r;){if(0==--n)return r.storedValue;r=r.parent}return nt("Failed to find the parent of "+Y(t)+" at depth "+e)},t.hasParentOfType=function(t,e){for(var n=Y(t).parent;n;){if(e.is(n.storedValue))return!0;n=n.parent}return!1},t.getParentOfType=function(t,e){for(var n=Y(t).parent;n;){if(e.is(n.storedValue))return n.storedValue;n=n.parent}return nt("Failed to find the parent of "+Y(t)+" of a given type")},t.getRoot=c,t.getPath=function(t){return Y(t).path},t.getPathParts=function(t){return mt(Y(t).path)},t.isRoot=function(t){return Y(t).isRoot},t.resolvePath=function(t,e){var n=K(Y(t),e);return n?n.value:void 0},t.resolveIdentifier=function(t,e,n){var r=Y(e).root.identifierCache.resolve(t,""+n);return r?r.value:void 0},t.getIdentifier=function(t){return Y(t).identifier},t.tryResolve=h,t.getRelativePath=function(t,e){return B(Y(t),Y(e))},t.clone=function(t,e){void 0===e&&(e=!0);var n=Y(t);return n.type.create(n.snapshot,!0===e?n.root._environment:!1===e?void 0:e)},t.detach=function(t){return Y(t).detach(),t},t.destroy=function(t){var e=Y(t);e.isRoot?e.die():e.parent.removeChild(e.subpath)},t.isAlive=function(t){return Y(t).isAlive},t.addDisposer=function(t,e){Y(t).addDisposer(e)},t.getEnv=function(t){var e=Y(t).root._environment;return e||tt},t.walk=f,t.getMembers=function(n){var t=Y(n).type,r=i({},e(t),{actions:[],volatile:[],views:[]});return Object.getOwnPropertyNames(n).forEach(function(t){if(!(t in r.properties)){var e=Object.getOwnPropertyDescriptor(n,t);e.get?l.isComputedProp(n,t)?r.views.push(t):r.volatile.push(t):!0===e.value._isMSTAction?r.actions.push(t):l.isObservableProp(n,t)?r.volatile.push(t):r.views.push(t)}}),r},t.getPropertyMembers=e,t.cast=function(t){return t},t.isType=P,t.isArrayType=function(t){return P(t)&&0<(t.flags&b.Array)},t.isFrozenType=function(t){return P(t)&&0<(t.flags&b.Frozen)},t.isIdentifierType=function(t){return P(t)&&0<(t.flags&b.Identifier)},t.isLateType=function(t){return P(t)&&0<(t.flags&b.Late)},t.isLiteralType=function(t){return P(t)&&0<(t.flags&b.Literal)},t.isMapType=function(t){return P(t)&&0<(t.flags&b.Map)},t.isModelType=function(t){return P(t)&&0<(t.flags&b.Object)},t.isOptionalType=function(t){return P(t)&&0<(t.flags&b.Optional)},t.isPrimitiveType=Yt,t.isReferenceType=function(t){return 0<(t.flags&b.Reference)},t.isRefinementType=function(t){return 0<(t.flags&b.Refinement)},t.isUnionType=function(t){return 0<(t.flags&b.Union)},Object.defineProperty(t,"__esModule",{value:!0})}); | ||
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("mobx")):"function"==typeof define&&define.amd?define(["exports","mobx"],e):e(t.mobxStateTree={},t.mobx)}(this,function(t,l){"use strict";var r=function(t,e){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n])})(t,e)};function a(t,e){function n(){this.constructor=t}r(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}var o=function(){return(o=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)};function n(t,e,n,r){var i,o=arguments.length,a=o<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,n,r);else for(var s=t.length-1;0<=s;s--)(i=t[s])&&(a=(o<3?i(a):3<o?i(e,n,a):i(e,n))||a);return 3<o&&a&&Object.defineProperty(e,n,a),a}function u(t){return Y(t).type}function i(t,e){return Y(t).onPatch(e)}function s(t,e){Y(t).applyPatches(at(e))}function p(t,e){return Y(t).applySnapshot(e)}function c(t){return Y(t).root.storedValue}function h(t,e){var n=K(Y(t),e,!1);if(void 0!==n)try{return n.value}catch(t){return}}function f(t,e){var n=Y(t);n.getChildren().forEach(function(t){J(t.storedValue)&&f(t.storedValue,e)}),e(n.storedValue)}function e(t){var e;return{name:(e=J(t)?u(t):t).name,properties:o({},e.properties)}}var d=function(){function t(t,e,n,r,i){this.parent=null,this.subpath="",this.state=U.INITIALIZING,this._environment=void 0,this._initialSnapshot=i,this.type=t,this.parent=e,this.subpath=n;var o=!0;try{this.storedValue=t.createNewInstance(this,{},i),this.state=U.CREATED,o=!1}finally{o&&(this.state=U.DEAD)}}return Object.defineProperty(t.prototype,"path",{get:function(){return this.parent?this.parent.path+"/"+vt(this.subpath):""},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isRoot",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"root",{get:function(){return this.parent?this.parent.root:nt("This scalar node is not part of a tree")},enumerable:!0,configurable:!0}),t.prototype.setParent=function(t,e){if(void 0===e&&(e=null),this.parent!==t||this.subpath!==e)if(this.parent&&!t)this.die();else{var n=null===e?"":e;this.subpath!==n&&(this.subpath=n),t&&t!==this.parent&&(this.parent=t)}},Object.defineProperty(t.prototype,"value",{get:function(){return this.type.getValue(this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"snapshot",{get:function(){return ct(this.getSnapshot())},enumerable:!0,configurable:!0}),t.prototype.getSnapshot=function(){return this.type.getSnapshot(this)},Object.defineProperty(t.prototype,"isAlive",{get:function(){return this.state!==U.DEAD},enumerable:!0,configurable:!0}),t.prototype.toString=function(){return this.type.name+"@"+(this.path||"<root>")+(this.isAlive?"":"[dead]")},t.prototype.die=function(){this.state=U.DEAD},t}(),y=1,v="warn";var b,g,m={onError:function(t){throw t}},S=function(){function r(t,e,n,r,i){if(this.nodeId=++y,this.subpathAtom=l.createAtom("path"),this.subpath="",this.parent=null,this.state=U.INITIALIZING,this.isProtectionEnabled=!0,this.middlewares=null,this._autoUnbox=!0,this._environment=void 0,this._isRunningAction=!1,this._hasSnapshotReaction=!1,this._disposers=null,this._patchSubscribers=null,this._snapshotSubscribers=null,this._observableInstanceCreated=!1,this._cachedInitialSnapshot=null,this._environment=r,this._initialSnapshot=ct(i),this.type=t,this.parent=e,this.subpath=n,this.escapedSubpath=vt(this.subpath),this.identifierAttribute=t.identifierAttribute,e||(this.identifierCache=new $),this._childNodes=t.initializeChildNodes(this,this._initialSnapshot),this.identifier=null,this.identifierAttribute&&this._initialSnapshot){var o=this._initialSnapshot[this.identifierAttribute];if(void 0===o){var a=this._childNodes[this.identifierAttribute];a&&(o=a.value)}"string"!=typeof o&&"number"!=typeof o&&nt("Instance identifier '"+this.identifierAttribute+"' for type '"+this.type.name+"' must be a string or a number"),this.identifier=""+o}e?e.root.identifierCache.addNodeToCache(this):this.identifierCache.addNodeToCache(this)}return r.prototype.applyPatches=function(t){this._observableInstanceCreated||this._createObservableInstance(),this.applyPatches(t)},r.prototype.applySnapshot=function(t){this._observableInstanceCreated||this._createObservableInstance(),this.applySnapshot(t)},r.prototype._createObservableInstance=function(){var t=this.type;this.storedValue=t.createNewInstance(this,this._childNodes,this._initialSnapshot),this.preboot();var e,n,r=!0;this._observableInstanceCreated=!0;try{this._isRunningAction=!0,t.finalizeNewInstance(this,this.storedValue),this._isRunningAction=!1,this.fireHook("afterCreate"),this.state=U.CREATED,r=!1}finally{r&&(this.state=U.DEAD)}e=this,n="snapshot",l.getAtom(e,n).trackAndCompute(),this.isRoot&&this._addSnapshotReaction(),this.finalizeCreation(),this._childNodes=tt},Object.defineProperty(r.prototype,"path",{get:function(){return this.subpathAtom.reportObserved(),this.parent?this.parent.path+"/"+this.escapedSubpath:""},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"root",{get:function(){var t=this.parent;return t?t.root:this},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"isRoot",{get:function(){return null===this.parent},enumerable:!0,configurable:!0}),r.prototype.setParent=function(t,e){if(void 0===e&&(e=null),this.parent!==t||this.subpath!==e)if(this.parent&&!t)this.die();else{var n=null===e?"":e;this.subpath!==n&&(this.subpath=n,this.escapedSubpath=vt(this.subpath),this.subpathAtom.reportChanged()),t&&t!==this.parent&&(t.root.identifierCache.mergeCache(this),this.parent=t,this.subpathAtom.reportChanged(),this.fireHook("afterAttach"))}},r.prototype.fireHook=function(t){var e=this,n=this.storedValue&&"object"==typeof this.storedValue&&this.storedValue[t];"function"==typeof n&&(l._allowStateChangesInsideComputed?l._allowStateChangesInsideComputed(function(){n.apply(e.storedValue)}):n.apply(this.storedValue))},r.prototype.createObservableInstanceIfNeeded=function(){this._observableInstanceCreated||this._createObservableInstance()},Object.defineProperty(r.prototype,"isObservableInstanceCreated",{get:function(){return this._observableInstanceCreated},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"value",{get:function(){if(this.createObservableInstanceIfNeeded(),this.isAlive)return this.type.getValue(this)},enumerable:!0,configurable:!0}),Object.defineProperty(r.prototype,"snapshot",{get:function(){if(this.isAlive)return ct(this.getSnapshot())},enumerable:!0,configurable:!0}),r.prototype.getSnapshot=function(){if(this.isAlive)return this._observableInstanceCreated?this._getActualSnapshot():this._getInitialSnapshot()},r.prototype._getActualSnapshot=function(){return this.type.getSnapshot(this)},r.prototype._getInitialSnapshot=function(){if(this.isAlive){if(!this._initialSnapshot)return this._initialSnapshot;if(this._cachedInitialSnapshot)return this._cachedInitialSnapshot;var t=this.type,e=this._childNodes,n=this._initialSnapshot;return this._cachedInitialSnapshot=t.processInitialSnapshot(e,n),this._cachedInitialSnapshot}},r.prototype.isRunningAction=function(){return!!this._isRunningAction||!this.isRoot&&this.parent.isRunningAction()},Object.defineProperty(r.prototype,"isAlive",{get:function(){return this.state!==U.DEAD},enumerable:!0,configurable:!0}),r.prototype.assertAlive=function(){if(!this.isAlive){var t="[mobx-state-tree][error] You are trying to read or write to an object that is no longer part of a state tree. (Object type was '"+this.type.name+"'). Either detach nodes first, or don't use objects after removing / replacing them in the tree.";switch(v){case"error":throw new Error(t);case"warn":console.warn(t+' Use setLivelynessChecking("error") to simplify debugging this error.')}}},r.prototype.getChildNode=function(t){this.assertAlive(),this._autoUnbox=!1;try{return this._observableInstanceCreated?this.type.getChildNode(this,t):this._childNodes[t]}finally{this._autoUnbox=!0}},r.prototype.getChildren=function(){this.assertAlive(),this._autoUnbox=!1;try{return this._observableInstanceCreated?this.type.getChildren(this):Q(this._childNodes)}finally{this._autoUnbox=!0}},r.prototype.getChildType=function(t){return this.type.getChildType(t)},Object.defineProperty(r.prototype,"isProtected",{get:function(){return this.root.isProtectionEnabled},enumerable:!0,configurable:!0}),r.prototype.assertWritable=function(){this.assertAlive(),!this.isRunningAction()&&this.isProtected&&nt("Cannot modify '"+this+"', the object is protected and can only be modified by using an action.")},r.prototype.removeChild=function(t){this.type.removeChild(this,t)},r.prototype.unbox=function(t){return t&&t.parent&&t.parent.assertAlive(),t&&t.parent&&t.parent._autoUnbox?t.value:t},r.prototype.toString=function(){var t=this.identifier?"(id: "+this.identifier+")":"";return this.type.name+"@"+(this.path||"<root>")+t+(this.isAlive?"":"[dead]")},r.prototype.finalizeCreation=function(){if(this.state===U.CREATED){if(this.parent){if(this.parent.state!==U.FINALIZED)return;this.fireHook("afterAttach")}this.state=U.FINALIZED;for(var t=0,e=this.getChildren();t<e.length;t++){var n=e[t];n instanceof r&&n.finalizeCreation()}}},r.prototype.detach=function(){this.isAlive||nt("Error while detaching, node is not alive."),this.isRoot||(this.fireHook("beforeDetach"),this._environment=this.root._environment,this.state=U.DETACHING,this.identifierCache=this.root.identifierCache.splitCache(this),this.parent.removeChild(this.subpath),this.parent=null,this.subpath=this.escapedSubpath="",this.subpathAtom.reportChanged(),this.state=U.FINALIZED)},r.prototype.preboot=function(){var n=this;this.applyPatches=E(this.storedValue,"@APPLY_PATCHES",function(t){t.forEach(function(t){var e=mt(t.path);q(n,e.slice(0,-1)).applyPatchLocally(e[e.length-1],t)})}),this.applySnapshot=E(this.storedValue,"@APPLY_SNAPSHOT",function(t){if(t!==n.snapshot)return n.type.applySnapshot(n,t)}),lt(this.storedValue,"$treenode",this),lt(this.storedValue,"toJSON",Z)},r.prototype.die=function(){this.state!==U.DETACHING&&J(this.storedValue)&&(f(this.storedValue,function(t){var e=Y(t);e instanceof r&&e.aboutToDie()}),f(this.storedValue,function(t){var e=Y(t);e instanceof r&&e.finalizeDeath()}))},r.prototype.aboutToDie=function(){this._disposers&&(this._disposers.forEach(function(t){return t()}),this._disposers=null),this.fireHook("beforeDestroy")},r.prototype.finalizeDeath=function(){var t,e,n;this.root.identifierCache.notifyDied(this),e="snapshot",n=(t=this).snapshot,Object.defineProperty(t,e,{enumerable:!0,writable:!1,configurable:!0,value:n}),this._patchSubscribers&&(this._patchSubscribers=null),this._snapshotSubscribers&&(this._snapshotSubscribers=null),this.state=U.DEAD,this.subpath=this.escapedSubpath="",this.parent=null,this.subpathAtom.reportChanged()},r.prototype.onSnapshot=function(t){return this._addSnapshotReaction(),this._snapshotSubscribers||(this._snapshotSubscribers=[]),ht(this._snapshotSubscribers,t)},r.prototype.emitSnapshot=function(e){this._snapshotSubscribers&&this._snapshotSubscribers.forEach(function(t){return t(e)})},r.prototype.onPatch=function(t){return this._patchSubscribers||(this._patchSubscribers=[]),ht(this._patchSubscribers,t)},r.prototype.emitPatch=function(t,e){var n=this._patchSubscribers;if(n&&n.length){var r=function(t){"oldValue"in t||nt("Patches without `oldValue` field cannot be inversed");return[function(t){switch(t.op){case"add":return{op:"add",path:t.path,value:t.value};case"remove":return{op:"remove",path:t.path};case"replace":return{op:"replace",path:t.path,value:t.value}}}(t),function(t){switch(t.op){case"add":return{op:"remove",path:t.path};case"remove":return{op:"add",path:t.path,value:t.oldValue};case"replace":return{op:"replace",path:t.path,value:t.oldValue}}}(t)]}(function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var r=0;r<e.length;r++){var i=e[r];for(var o in i)t[o]=i[o]}return t}({},t,{path:e.path.substr(this.path.length)+"/"+t.path})),i=r[0],o=r[1];n.forEach(function(t){return t(i,o)})}this.parent&&this.parent.emitPatch(t,e)},r.prototype.addDisposer=function(t){this._disposers?this._disposers.unshift(t):this._disposers=[t]},r.prototype.removeMiddleware=function(e){this.middlewares&&(this.middlewares=this.middlewares.filter(function(t){return t.handler!==e}))},r.prototype.addMiddleWare=function(t,e){var n=this;return void 0===e&&(e=!0),this.middlewares?this.middlewares.push({handler:t,includeHooks:e}):this.middlewares=[{handler:t,includeHooks:e}],function(){n.removeMiddleware(t)}},r.prototype.applyPatchLocally=function(t,e){this.assertWritable(),this._observableInstanceCreated||this._createObservableInstance(),this.type.applyPatchLocally(this,t,e)},r.prototype._addSnapshotReaction=function(){var e=this;if(!this._hasSnapshotReaction){var t=l.reaction(function(){return e.snapshot},function(t){return e.emitSnapshot(t)},m);this.addDisposer(t),this._hasSnapshotReaction=!0}},n([l.action],r.prototype,"_createObservableInstance",null),n([l.computed],r.prototype,"snapshot",null),n([l.action],r.prototype,"detach",null),n([l.action],r.prototype,"die",null),r}();(g=b||(b={}))[g.String=1]="String",g[g.Number=2]="Number",g[g.Boolean=4]="Boolean",g[g.Date=8]="Date",g[g.Literal=16]="Literal",g[g.Array=32]="Array",g[g.Map=64]="Map",g[g.Object=128]="Object",g[g.Frozen=256]="Frozen",g[g.Optional=512]="Optional",g[g.Reference=1024]="Reference",g[g.Identifier=2048]="Identifier",g[g.Late=4096]="Late",g[g.Refinement=8192]="Refinement",g[g.Union=16384]="Union",g[g.Null=32768]="Null",g[g.Undefined=65536]="Undefined",g[g.Integer=131072]="Integer";var w=function(){function t(t){this["!!complexType"]=void 0,this.isType=!0,this.name=t}return t.prototype.create=function(t,e){return void 0===t&&(t=this.getDefaultSnapshot()),this.instantiate(null,"",e,t).value},t.prototype.initializeChildNodes=function(t,e){return tt},t.prototype.createNewInstance=function(t,e,n){return n},t.prototype.finalizeNewInstance=function(t,e){},t.prototype.processInitialSnapshot=function(t,e){return e},t.prototype.isAssignableFrom=function(t){return t===this},t.prototype.validate=function(t,e){return J(t)?u(t)===this||this.isAssignableFrom(u(t))?z():M(e,t):this.isValidSnapshot(t,e)},t.prototype.is=function(t){return 0===this.validate(t,[{path:"",type:this}]).length},t.prototype.reconcile=function(t,e){if(t.snapshot===e)return t;if(J(e)&&Y(e)===t)return t;if(t.type===this&&ut(e)&&!J(e)&&(!t.identifierAttribute||t.identifier===""+e[t.identifierAttribute]))return t.applySnapshot(e),t;var n=t.parent,r=t.subpath;if(t.die(),J(e)&&this.isAssignableFrom(u(e))){var i=Y(e);return i.setParent(n,r),i}return this.instantiate(n,r,t._environment,e)},Object.defineProperty(t.prototype,"Type",{get:function(){return nt("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:!0,configurable:!0}),Object.defineProperty(t.prototype,"SnapshotType",{get:function(){return nt("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:!0,configurable:!0}),Object.defineProperty(t.prototype,"CreationType",{get:function(){return nt("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:!0,configurable:!0}),n([l.action],t.prototype,"create",null),t}(),A=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.getDefaultSnapshot=function(){},t.prototype.applySnapshot=function(t,e){nt("Immutable types do not support applying snapshots")},t.prototype.applyPatchLocally=function(t,e,n){nt("Immutable types do not support applying patches")},t.prototype.getChildren=function(t){return X},t.prototype.getChildNode=function(t,e){return nt("No child '"+e+"' available in type: "+this.name)},t.prototype.getChildType=function(t){return nt("No child '"+t+"' available in type: "+this.name)},t.prototype.reconcile=function(t,e){if(t.type===this&&t.storedValue===e)return t;var n=this.instantiate(t.parent,t.subpath,t._environment,e);return t.die(),n},t.prototype.removeChild=function(t,e){return nt("No child '"+e+"' available in type: "+this.name)},t}(w);function P(t){return"object"==typeof t&&t&&!0===t.isType}var _=new Map;function V(t){return{$MST_UNSERIALIZABLE:!0,type:t}}function I(e,t){l.runInAction(function(){at(t).forEach(function(t){return function(t,e){var n=h(t,e.path||"");if(!n)return nt("Invalid action path: "+(e.path||""));var r=Y(n);if("@APPLY_PATCHES"===e.name)return s.call(null,n,e.args[0]);if("@APPLY_SNAPSHOT"===e.name)return p.call(null,n,e.args[0]);"function"!=typeof n[e.name]&&nt("Action '"+e.name+"' does not exist in '"+r.path+"'");return n[e.name].apply(n,e.args?e.args.map(function(t){return(e=t)&&"object"==typeof e&&"$MST_DATE"in e?new Date(e.$MST_DATE):e;var e}):[])}(e,t)})})}function T(o,a,s){return void 0===s&&(s=!1),D(o,function(n,t){if("action"!==n.type||n.id!==n.rootId)return t(n);var e=Y(n.context),r={name:n.name,path:B(Y(o),e),args:n.args.map(function(t,e){return function(t,e,n,r){if(r instanceof Date)return{$MST_DATE:r.getTime()};if(pt(r))return r;if(J(r))return V("[MSTNode: "+u(r).name+"]");if("function"==typeof r)return V("[function]");if("object"==typeof r&&!st(r)&&!ot(r))return V("[object "+(r&&r.constructor&&r.constructor.name||"Complex Object")+"]");try{return JSON.stringify(r),r}catch(t){return V(""+t)}}(0,n.name,0,t)})};if(s){var i=t(n);return a(r),i}return a(r),t(n)})}var C=1,N=null;function O(){return C++}function j(t,e){var n=Y(t.context),r=n._isRunningAction,i=N;"action"===t.type&&n.assertAlive(),n._isRunningAction=!0,N=t;try{return function(t,e,s){var u=function(t,e,n){var r=n.$mst_middleware||X,i=t;for(;i;)i.middlewares&&(r=r.concat(i.middlewares)),i=i.parent;return r}(t,0,s);if(!u.length)return l.action(s).apply(null,e.args);var p=0,c=null;return function n(t){var e=u[p++];var r=e&&e.handler;function i(t,e){c=e?e(n(t)||c):n(t)}function o(t){c=t}var a=function(){return r(t,i,o),c};return r&&e.includeHooks?a():r&&!e.includeHooks?Nt[t.name]?n(t):a():l.action(s).apply(null,t.args)}(e)}(n,t,e)}finally{N=i,n._isRunningAction=r}}function E(e,n,r){var t=function(){var t=O();return j({type:"action",name:n,id:t,args:ft(arguments),context:e,tree:c(e),rootId:N?N.rootId:t,parentId:N?N.id:0},r)};return t._isMSTAction=!0,t}function D(t,e,n){return void 0===n&&(n=!0),Y(t).addMiddleWare(e,n)}function x(t){return"function"==typeof t?"<function"+(t.name?" "+t.name:"")+">":J(t)?"<"+t+">":"`"+function(t){try{return JSON.stringify(t)}catch(t){return"<Unserializable: "+t+">"}}(t)+"`"}function R(t){var e=t.value,n=t.context[t.context.length-1].type,r=t.context.map(function(t){return t.path}).filter(function(t){return 0<t.length}).join("/"),i=0<r.length?'at path "/'+r+'" ':"",o=J(e)?"value of type "+Y(e).type.name+":":pt(e)?"value":"snapshot",a=n&&J(e)&&n.is(Y(e).snapshot);return""+i+o+" "+x(e)+" is not assignable "+(n?"to type: `"+n.name+"`":"")+(t.message?" ("+t.message+")":"")+(n?Yt(n)||pt(e)?".":", expected an instance of `"+n.name+"` or a snapshot like `"+n.describe()+"` instead."+(a?" (Note that a snapshot of the provided value is compatible with the targeted type)":""):".")}function k(t,e,n){return t.concat([{path:e,type:n}])}function z(){return X}function M(t,e,n){return[{context:t,value:e,message:n}]}function L(t){return t.reduce(function(t,e){return t.concat(e)},[])}function F(t,e){var n,r=t.validate(e,[{path:"",type:t}]);0<r.length&&nt("Error while converting "+((n=x(e)).length<280?n:n.substring(0,272)+"......"+n.substring(n.length-8))+" to `"+t.name+"`:\n\n "+r.map(R).join("\n "))}var U,H,$=function(){function e(){this.cache=l.observable.map()}return e.prototype.addNodeToCache=function(t){if(t.identifierAttribute){var e=t.identifier;this.cache.has(e)||this.cache.set(e,l.observable.array([],et));var n=this.cache.get(e);-1!==n.indexOf(t)&&nt("Already registered"),n.push(t)}return this},e.prototype.mergeCache=function(t){var e=this;l.values(t.identifierCache.cache).forEach(function(t){return t.forEach(function(t){e.addNodeToCache(t)})})},e.prototype.notifyDied=function(t){if(t.identifierAttribute){var e=this.cache.get(t.identifier);e&&e.remove(t)}},e.prototype.splitCache=function(t){var n=new e,r=t.path;return l.values(this.cache).forEach(function(t){for(var e=t.length-1;0<=e;e--)0===t[e].path.indexOf(r)&&(n.addNodeToCache(t[e]),t.splice(e,1))}),n},e.prototype.resolve=function(e,t){var n=this.cache.get(""+t);if(!n)return null;var r=n.filter(function(t){return e.isAssignableFrom(t.type)});switch(r.length){case 0:return null;case 1:var i=r[0];if(i){for(var o=[],a=i.parent;a&&!a.isObservableInstanceCreated;)o.unshift(a),a=a.parent;for(var s=0,u=o;s<u.length;s++){u[s].createObservableInstanceIfNeeded()}}return i;default:return nt("Cannot resolve a reference to type '"+e.name+"' with id: '"+t+"' unambigously, there are multiple candidates: "+r.map(function(t){return t.path}).join(", "))}},e}();function W(t,e,n,r,i){var o,a=(o=i)&&o.$treenode||null;if(a){if(a.isRoot)return a.setParent(e,n),a;nt("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 '"+(e?e.path:"")+"/"+n+"', but it lives already at '"+a.path+"'")}return new(t.shouldAttachNode?S:d)(t,e,n,r,i)}function J(t){return!(!t||!t.$treenode)}function Y(t){return J(t)?t.$treenode:nt("Value "+t+" is no MST Node")}function Z(){return Y(this).snapshot}(H=U||(U={}))[H.INITIALIZING=0]="INITIALIZING",H[H.CREATED=1]="CREATED",H[H.FINALIZED=2]="FINALIZED",H[H.DETACHING=3]="DETACHING",H[H.DEAD=4]="DEAD";var G=function(t){return".."};function B(t,e){t.root!==e.root&&nt("Cannot calculate relative path: objects '"+t+"' and '"+e+"' are not part of the same object tree");for(var n=mt(t.path),r=mt(e.path),i=0;i<n.length&&n[i]===r[i];i++);return n.slice(i).map(G).join("/")+gt(r.slice(i))}function K(t,e,n){return void 0===n&&(n=!0),q(t,mt(e),n)}function q(t,e,n){void 0===n&&(n=!0);for(var r=t,i=0;i<e.length;i++){var o=e[i];if(""!==o){if(".."===o){if(r=r.parent)continue}else{if("."===o||""===o)continue;if(r){if(r instanceof d)try{var a=r.value;J(a)&&(r=Y(a))}catch(t){if(!n)return;throw t}if(r instanceof S)if(r.getChildType(o)&&(r=r.getChildNode(o)))continue}}return n?nt("Could not resolve '"+o+"' in path '"+(gt(e.slice(0,i))||"/")+"' while resolving '"+gt(e)+"'"):void 0}r=r.root}return r}function Q(n){if(!n)return X;var t=Object.keys(n);if(!t.length)return X;var r=new Array(t.length);return t.forEach(function(t,e){r[e]=n[t]}),r}var X=Object.freeze([]),tt=Object.freeze({}),et="string"==typeof l.$mobx?{deep:!1}:{deep:!1,proxy:!1};function nt(t){throw void 0===t&&(t="Illegal state"),new Error("[mobx-state-tree] "+t)}function rt(t){return t}Object.freeze(et);var it=Number.isInteger||function(t){return"number"==typeof t&&isFinite(t)&&Math.floor(t)===t};function ot(t){return!(!Array.isArray(t)&&!l.isObservableArray(t))}function at(t){return t?ot(t)?t:[t]:X}function st(t){if(null===t||"object"!=typeof t)return!1;var e=Object.getPrototypeOf(t);return e===Object.prototype||null===e}function ut(t){return!(null===t||"object"!=typeof t||t instanceof Date||t instanceof RegExp)}function pt(t){return null==t||("string"==typeof t||"number"==typeof t||"boolean"==typeof t||t instanceof Date)}function ct(t){return t}function lt(t,e,n){Object.defineProperty(t,e,{enumerable:!1,writable:!1,configurable:!0,value:n})}function ht(r,i){return r.push(i),function(){var t,e,n;e=i,-1!==(n=(t=r).indexOf(e))&&t.splice(n,1)}}function ft(t){for(var e=new Array(t.length),n=0;n<t.length;n++)e[n]=t[n];return e}var dt=function(t,e){};function yt(t){return l=t.name,h=t,f=function(){var s=O(),u=N||nt("Not running an action!"),p=arguments;function c(t,e,n){t.$mst_middleware=f.$mst_middleware,j({name:l,type:e,id:s,args:[n],tree:u.tree,context:u.context,parentId:u.id,rootId:u.rootId},t)}return new Promise(function(e,n){var r,t=function(){r=h.apply(null,arguments),i(void 0)};function i(t){var e;try{c(function(t){e=r.next(t)},"flow_resume",t)}catch(e){return void setImmediate(function(){c(function(t){n(e)},"flow_throw",e)})}a(e)}function o(t){var e;try{c(function(t){e=r.throw(t)},"flow_resume_error",t)}catch(e){return void setImmediate(function(){c(function(t){n(e)},"flow_throw",e)})}a(e)}function a(t){if(!t.done)return t.value&&"function"==typeof t.value.then||nt("Only promises can be yielded to `async`, got: "+t),t.value.then(i,o);setImmediate(function(){c(function(t){e(t)},"flow_return",t.value)})}t.$mst_middleware=f.$mst_middleware,j({name:l,type:"flow_spawn",id:s,args:ft(p),tree:u.tree,context:u.context,parentId:u.id,rootId:u.rootId},t)})};var l,h,f}function vt(t){return!0==("number"==typeof t)?""+t:t.replace(/~/g,"~1").replace(/\//g,"~0")}function bt(t){return t.replace(/~0/g,"/").replace(/~1/g,"~")}function gt(t){return 0===t.length?"":"/"+t.map(vt).join("/")}function mt(t){var e=t.split("/").map(bt);return""===e[0]?e.slice(1):e}dt.ids={};var St,wt,At="Map.put can only be used to store complex values that have an identifier type attribute";(wt=St||(St={}))[wt.UNKNOWN=0]="UNKNOWN",wt[wt.YES=1]="YES",wt[wt.NO=2]="NO";var Pt=function(n){function t(t){return n.call(this,t,l.observable.ref.enhancer)||this}return a(t,n),t.prototype.get=function(t){return n.prototype.get.call(this,""+t)},t.prototype.has=function(t){return n.prototype.has.call(this,""+t)},t.prototype.delete=function(t){return n.prototype.delete.call(this,""+t)},t.prototype.set=function(t,e){return n.prototype.set.call(this,""+t,e)},t.prototype.put=function(t){if(t||nt("Map.put cannot be used to set empty values"),J(t)){var e=Y(t),n=e.identifier;return this.set(n,e.value),e.value}if(ut(t)){n=void 0;var r=Y(this).type;return r.identifierMode===St.NO?nt(At):r.identifierMode===St.YES?(n=""+t[r.mapIdentifierAttribute],this.set(n,t),this.get(n)):nt(At)}return nt("Map.put can only be used to store complex values")},t}(l.ObservableMap),_t=function(r){function t(t,e){var n=r.call(this,t)||this;return n.shouldAttachNode=!0,n.identifierMode=St.UNKNOWN,n.mapIdentifierAttribute=void 0,n.flags=b.Map,n.subType=e,n._determineIdentifierMode(),n}return a(t,r),t.prototype.instantiate=function(t,e,n,r){return this.identifierMode===St.UNKNOWN&&this._determineIdentifierMode(),W(this,t,e,n,r)},t.prototype._determineIdentifierMode=function(){var t=[];if(function t(e,n){if(e instanceof kt)n.push(e);else if(e instanceof Qt){if(!t(e.type,n))return!1}else if(e instanceof Kt){for(var r=0;r<e.types.length;r++)if(!t(e.types[r],n))return!1}else if(e instanceof ne){var i=e.getSubType(!1);if(!i)return!1;t(i,n)}return!0}(this.subType,t)){var e=void 0;t.forEach(function(t){t.identifierAttribute&&(e&&e!==t.identifierAttribute&&nt("The objects in a map should all have the same identifier attribute, expected '"+e+"', but child of type '"+t.name+"' declared attribute '"+t.identifierAttribute+"' as identifier"),e=t.identifierAttribute)}),e?(this.identifierMode=St.YES,this.mapIdentifierAttribute=e):this.identifierMode=St.NO}},t.prototype.initializeChildNodes=function(e,n){void 0===n&&(n={});var r=e.type.subType,i=e._environment,o={};return Object.keys(n).forEach(function(t){o[t]=r.instantiate(e,t,i,n[t])}),o},t.prototype.createNewInstance=function(t,e,n){return new Pt(e)},t.prototype.finalizeNewInstance=function(t,e){l._interceptReads(e,t.unbox),l.intercept(e,this.willChange),l.observe(e,this.didChange)},t.prototype.describe=function(){return"Map<string, "+this.subType.describe()+">"},t.prototype.getChildren=function(t){return l.values(t.storedValue)},t.prototype.getChildNode=function(t,e){var n=t.storedValue.get(""+e);return n||nt("Not a child "+e),n},t.prototype.willChange=function(t){var e=Y(t.object),n=t.name;e.assertWritable();var r=e.type,i=r.subType;switch(t.type){case"update":var o=t.newValue;if(o===t.object.get(n))return null;t.newValue=i.reconcile(e.getChildNode(n),t.newValue),r.processIdentifier(n,t.newValue);break;case"add":t.newValue,t.newValue=i.instantiate(e,n,void 0,t.newValue),r.processIdentifier(n,t.newValue)}return t},t.prototype.processIdentifier=function(t,e){if(this.identifierMode===St.YES&&e instanceof S){var n=e.identifier;n!==t&&nt("A map of objects containing an identifier should always store the object under their own identifier. Trying to store key '"+n+"', but expected: '"+t+"'")}},t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){var e={};return t.getChildren().forEach(function(t){e[t.subpath]=t.snapshot}),e},t.prototype.processInitialSnapshot=function(e,t){var n={};return Object.keys(e).forEach(function(t){n[t]=e[t].getSnapshot()}),n},t.prototype.didChange=function(t){var e=Y(t.object);switch(t.type){case"update":return void e.emitPatch({op:"replace",path:vt(t.name),value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},e);case"add":return void e.emitPatch({op:"add",path:vt(t.name),value:t.newValue.snapshot,oldValue:void 0},e);case"delete":var n=t.oldValue.snapshot;return t.oldValue.die(),void e.emitPatch({op:"remove",path:vt(t.name),oldValue:n},e)}},t.prototype.applyPatchLocally=function(t,e,n){var r=t.storedValue;switch(n.op){case"add":case"replace":r.set(e,n.value);break;case"remove":r.delete(e)}},t.prototype.applySnapshot=function(t,e){var n=t.storedValue,r={};for(var i in Array.from(n.keys()).forEach(function(t){r[t]=!1}),e)n.set(i,e[i]),r[""+i]=!0;Object.keys(r).forEach(function(t){!1===r[t]&&n.delete(t)})},t.prototype.getChildType=function(t){return this.subType},t.prototype.isValidSnapshot=function(e,n){var r=this;return st(e)?L(Object.keys(e).map(function(t){return r.subType.validate(e[t],k(n,t,r.subType))})):M(n,e,"Value is not a plain object")},t.prototype.getDefaultSnapshot=function(){return tt},t.prototype.removeChild=function(t,e){t.storedValue.delete(e)},n([l.action],t.prototype,"applySnapshot",null),t}(w);var Vt=function(r){function t(t,e){var n=r.call(this,t)||this;return n.shouldAttachNode=!0,n.flags=b.Array,n.subType=e,n}return a(t,r),t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,r)},t.prototype.initializeChildNodes=function(r,t){void 0===t&&(t=[]);var i=r.type.subType,o=r._environment,a={};return t.forEach(function(t,e){var n=""+e;a[n]=i.instantiate(r,n,o,t)}),a},t.prototype.createNewInstance=function(t,e,n){return l.observable.array(Q(e),et)},t.prototype.finalizeNewInstance=function(t,e){l._getAdministration(e).dehancer=t.unbox,l.intercept(e,this.willChange),l.observe(e,this.didChange)},t.prototype.describe=function(){return this.subType.describe()+"[]"},t.prototype.getChildren=function(t){return t.storedValue.slice()},t.prototype.getChildNode=function(t,e){var n=parseInt(e,10);return n<t.storedValue.length?t.storedValue[n]:nt("Not a child: "+e)},t.prototype.willChange=function(t){var e=Y(t.object);e.assertWritable();var n=e.type.subType,r=e.getChildren(),i=null;switch(t.type){case"update":if(t.newValue===t.object[t.index])return null;if(!(i=It(e,n,[r[t.index]],[t.newValue],[t.index])))return null;t.newValue=i[0];break;case"splice":var o=t.index,a=t.removedCount,s=t.added;if(!(i=It(e,n,r.slice(o,o+a),s,s.map(function(t,e){return o+e}))))return null;t.added=i;for(var u=o+a;u<r.length;u++)r[u].setParent(e,""+(u+s.length-a))}return t},t.prototype.getValue=function(t){return t.storedValue},t.prototype.getSnapshot=function(t){return t.getChildren().map(function(t){return t.snapshot})},t.prototype.processInitialSnapshot=function(e,t){var n=[];return Object.keys(e).forEach(function(t){n.push(e[t].getSnapshot())}),n},t.prototype.didChange=function(t){var e=Y(t.object);switch(t.type){case"update":return void e.emitPatch({op:"replace",path:""+t.index,value:t.newValue.snapshot,oldValue:t.oldValue?t.oldValue.snapshot:void 0},e);case"splice":for(var n=t.removedCount-1;0<=n;n--)e.emitPatch({op:"remove",path:""+(t.index+n),oldValue:t.removed[n].snapshot},e);for(n=0;n<t.addedCount;n++)e.emitPatch({op:"add",path:""+(t.index+n),value:e.getChildNode(""+(t.index+n)).snapshot,oldValue:void 0},e);return}},t.prototype.applyPatchLocally=function(t,e,n){var r=t.storedValue,i="-"===e?r.length:parseInt(e);switch(n.op){case"replace":r[i]=n.value;break;case"add":r.splice(i,0,n.value);break;case"remove":r.splice(i,1)}},t.prototype.applySnapshot=function(t,e){t.storedValue.replace(e)},t.prototype.getChildType=function(t){return this.subType},t.prototype.isValidSnapshot=function(t,n){var r=this;return ot(t)?L(t.map(function(t,e){return r.subType.validate(t,k(n,""+e,r.subType))})):M(n,t,"Value is not an array")},t.prototype.getDefaultSnapshot=function(){return X},t.prototype.removeChild=function(t,e){t.storedValue.splice(parseInt(e,10),1)},n([l.action],t.prototype,"applySnapshot",null),t}(w);function It(t,e,n,r,i){for(var o,a,s,u=!1,p=void 0,c=!0,l=0;u=l<=r.length-1,o=n[l],a=u?r[l]:void 0,((s=a)instanceof d||s instanceof S)&&(a=a.storedValue),o||u;l++)if(u)if(o)if(Ct(o,a))n[l]=Tt(e,t,""+i[l],a,o);else{p=void 0;for(var h=l;h<n.length;h++)if(Ct(n[h],a)){p=n.splice(h,1)[0];break}n.splice(l,0,Tt(e,t,""+i[l],a,p)),c=!1}else J(a)&&Y(a).parent===t&&nt("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 '"+t.path+"/"+i[l]+"', but it lives already at '"+Y(a).path+"'"),n.splice(l,0,Tt(e,t,""+i[l],a)),c=!1;else o.die(),n.splice(l,1),l--,c=!1;return c?null:n}function Tt(t,e,n,r,i){var o;if(J(r)&&((o=Y(r)).assertAlive(),null!==o.parent&&o.parent===e))return o.setParent(e,n),i&&i!==o&&i.die(),o;return i?((o=t.reconcile(i,r)).setParent(e,n),o):t.instantiate(e,n,e._environment,r)}function Ct(t,e){return J(e)?Y(e)===t:t.snapshot===e||!!(t instanceof S&&null!==t.identifier&&t.identifierAttribute&&st(e)&&t.identifier===""+e[t.identifierAttribute]&&t.type.is(e))}var Nt,Ot,jt="preProcessSnapshot",Et="postProcessSnapshot";function Dt(){return Y(this).toString()}(Ot=Nt||(Nt={})).afterCreate="afterCreate",Ot.afterAttach="afterAttach",Ot.beforeDetach="beforeDetach",Ot.beforeDestroy="beforeDestroy";var xt={name:"AnonymousModel",properties:{},initializers:X};function Rt(t){return Object.keys(t).reduce(function(t,e){var n,r,i;if(e in Nt)return nt("Hook '"+e+"' was defined as property. Hooks should be defined as part of the actions");var o=Object.getOwnPropertyDescriptor(t,e);"get"in o&&nt("Getters are not supported as properties. Please use views instead");var a=o.value;if(null==a)nt("The default value of an attribute cannot be null or undefined as the type cannot be inferred. Did you mean `types.maybe(someType)`?");else{if(pt(a))return Object.assign({},t,((n={})[e]=Xt(function(t){switch(typeof t){case"string":return Lt;case"number":return Ft;case"boolean":return Ht;case"object":if(t instanceof Date)return Jt}return nt("Cannot determine primitive type from value "+t)}(a),a),n));if(a instanceof _t)return Object.assign({},t,((r={})[e]=Xt(a,{}),r));if(a instanceof Vt)return Object.assign({},t,((i={})[e]=Xt(a,[]),i));if(P(a))return t;nt("Invalid type definition for property '"+e+"', cannot infer a type from a value like '"+a+"' ("+typeof a+")")}},t)}var kt=function(r){function e(t){var e=r.call(this,t.name||xt.name)||this;e.flags=b.Object,e.shouldAttachNode=!0;var n=t.name||xt.name;return/^\w[\w\d_]*$/.test(n)||nt("Typename should be a valid identifier: "+n),Object.assign(e,xt,t),e.properties=Rt(e.properties),ct(e.properties),e.propertyNames=Object.keys(e.properties),e.identifierAttribute=e._getIdentifierAttribute(),e}return a(e,r),e.prototype._getIdentifierAttribute=function(){var n=void 0;return this.forAllProps(function(t,e){e.flags&b.Identifier&&(n&&nt("Cannot define property '"+t+"' as object identifier, property '"+n+"' is already defined as identifier property"),n=t)}),n},e.prototype.cloneAndEnhance=function(t){return new e({name:t.name||this.name,properties:Object.assign({},this.properties,t.properties),initializers:this.initializers.concat(t.initializers||[]),preProcessor:t.preProcessor||this.preProcessor,postProcessor:t.postProcessor||this.postProcessor})},e.prototype.actions=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateActions(t,e(t)),t}]})},e.prototype.instantiateActions=function(s,u){st(u)||nt("actions initializer should return a plain object containing actions"),Object.keys(u).forEach(function(t){t===jt&&nt("Cannot define action '"+jt+"', it should be defined using 'type.preProcessSnapshot(fn)' instead"),t===Et&&nt("Cannot define action '"+Et+"', it should be defined using 'type.postProcessSnapshot(fn)' instead");var e=u[t],n=s[t];if(t in Nt&&n){var r=e;e=function(){n.apply(null,arguments),r.apply(null,arguments)}}var i=e.$mst_middleware,o=e.bind(u);o.$mst_middleware=i;var a=E(s,t,o);u[t]=a,lt(s,t,a)})},e.prototype.named=function(t){return this.cloneAndEnhance({name:t})},e.prototype.props=function(t){return this.cloneAndEnhance({properties:t})},e.prototype.volatile=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateVolatileState(t,e(t)),t}]})},e.prototype.instantiateVolatileState=function(t,e){st(e)||nt("volatile state initializer should return a plain object containing state"),l.set(t,e)},e.prototype.extend=function(s){var u=this;return this.cloneAndEnhance({initializers:[function(t){var e=s(t),n=e.actions,r=e.views,i=e.state,o=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&(n[r[i]]=t[r[i]])}return n}(e,["actions","views","state"]);for(var a in o)nt("The `extend` function should return an object with a subset of the fields 'actions', 'views' and 'state'. Found invalid key '"+a+"'");return i&&u.instantiateVolatileState(t,i),r&&u.instantiateViews(t,r),n&&u.instantiateActions(t,n),t}]})},e.prototype.views=function(e){var n=this;return this.cloneAndEnhance({initializers:[function(t){return n.instantiateViews(t,e(t)),t}]})},e.prototype.instantiateViews=function(i,o){st(o)||nt("views initializer should return a plain object containing views"),Object.keys(o).forEach(function(t){var e=Object.getOwnPropertyDescriptor(o,t),n=e.value;if("get"in e)if(l.isComputedProp(i,t)){var r=l._getAdministration(i,t);r.derivation=e.get,r.scope=i,e.set&&(r.setter=l.action(r.name+"-setter",e.set))}else l.computed(i,t,e,!0);else"function"==typeof n?lt(i,t,n):nt("A view member should either be a function or getter based property")})},e.prototype.preProcessSnapshot=function(e){var n=this.preProcessor;return n?this.cloneAndEnhance({preProcessor:function(t){return n(e(t))}}):this.cloneAndEnhance({preProcessor:e})},e.prototype.postProcessSnapshot=function(e){var n=this.postProcessor;return n?this.cloneAndEnhance({postProcessor:function(t){return e(n(t))}}):this.cloneAndEnhance({postProcessor:e})},e.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,J(r)?r:this.applySnapshotPreProcessor(r))},e.prototype.initializeChildNodes=function(n,r){void 0===r&&(r={});var t=n.type,i={};return t.forAllProps(function(t,e){i[t]=e.instantiate(n,t,n._environment,r[t])}),i},e.prototype.createNewInstance=function(t,e,n){return l.observable.object(e,tt,et)},e.prototype.finalizeNewInstance=function(e,n){lt(n,"toString",Dt),this.forAllProps(function(t){l._interceptReads(n,t,e.unbox)}),this.initializers.reduce(function(t,e){return e(t)},n),l.intercept(n,this.willChange),l.observe(n,this.didChange)},e.prototype.willChange=function(t){var e=Y(t.object);e.assertWritable();var n=e.type.properties[t.name];return n&&(t.newValue,t.newValue=n.reconcile(e.getChildNode(t.name),t.newValue)),t},e.prototype.didChange=function(t){var e=Y(t.object);if(e.type.properties[t.name]){var n=t.oldValue?t.oldValue.snapshot:void 0;e.emitPatch({op:"replace",path:vt(t.name),value:t.newValue.snapshot,oldValue:n},e)}},e.prototype.getChildren=function(n){var r=this,i=[];return this.forAllProps(function(t,e){i.push(r.getChildNode(n,t))}),i},e.prototype.getChildNode=function(t,e){if(!(e in this.properties))return nt("Not a value property: "+e);var n=l._getAdministration(t.storedValue,e).value;return n||nt("Node not available for property "+e)},e.prototype.getValue=function(t){return t.storedValue},e.prototype.getSnapshot=function(n,t){var r=this;void 0===t&&(t=!0);var i={};return this.forAllProps(function(t,e){l.getAtom(n.storedValue,t).reportObserved(),i[t]=r.getChildNode(n,t).snapshot}),t?this.applySnapshotPostProcessor(i):i},e.prototype.processInitialSnapshot=function(e,t){var n={};return Object.keys(e).forEach(function(t){n[t]=e[t].getSnapshot()}),this.applySnapshotPostProcessor(this.applyOptionalValuesToSnapshot(n))},e.prototype.applyPatchLocally=function(t,e,n){"replace"!==n.op&&"add"!==n.op&&nt("object does not support operation "+n.op),t.storedValue[e]=n.value},e.prototype.applySnapshot=function(n,t){var r=this.applySnapshotPreProcessor(t);this.forAllProps(function(t,e){n.storedValue[t]=r[t]})},e.prototype.applySnapshotPreProcessor=function(t){var e=this.preProcessor;return e?e.call(null,t):t},e.prototype.applyOptionalValuesToSnapshot=function(r){return r&&(r=Object.assign({},r),this.forAllProps(function(t,e){if(!(t in r)){var n=zt(e);n&&(r[t]=n.getDefaultValueSnapshot())}})),r},e.prototype.applySnapshotPostProcessor=function(t){var e=this.postProcessor;return e?e.call(null,t):t},e.prototype.getChildType=function(t){return this.properties[t]},e.prototype.isValidSnapshot=function(t,e){var n=this,r=this.applySnapshotPreProcessor(t);return st(r)?L(this.propertyNames.map(function(t){return n.properties[t].validate(r[t],k(e,t,n.properties[t]))})):M(e,r,"Value is not a plain object")},e.prototype.forAllProps=function(e){var n=this;this.propertyNames.forEach(function(t){return e(t,n.properties[t])})},e.prototype.describe=function(){var e=this;return"{ "+this.propertyNames.map(function(t){return t+": "+e.properties[t].describe()}).join("; ")+" }"},e.prototype.getDefaultSnapshot=function(){return tt},e.prototype.removeChild=function(t,e){t.storedValue[e]=void 0},n([l.action],e.prototype,"applySnapshot",null),e}(w);function zt(t){if(t)return t.flags&b.Union&&t.types?t.types.find(zt):t.flags&b.Late&&t.getSubType&&t.getSubType(!1)?zt(t.subType):t.flags&b.Optional?t:void 0}var Mt=function(o){function t(t,e,n,r){void 0===r&&(r=rt);var i=o.call(this,t)||this;return i.shouldAttachNode=!1,i.flags=e,i.checker=n,i.initializer=r,i}return a(t,o),t.prototype.describe=function(){return this.name},t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,r)},t.prototype.createNewInstance=function(t,e,n){return this.initializer(n)},t.prototype.isValidSnapshot=function(t,e){return pt(t)&&this.checker(t)?z():M(e,t,"Value is not a "+("Date"===this.name?"Date or a unix milliseconds timestamp":this.name))},t}(A),Lt=new Mt("string",b.String,function(t){return"string"==typeof t}),Ft=new Mt("number",b.Number,function(t){return"number"==typeof t}),Ut=new Mt("integer",b.Integer,function(t){return it(t)}),Ht=new Mt("boolean",b.Boolean,function(t){return"boolean"==typeof t}),$t=new Mt("null",b.Null,function(t){return null===t}),Wt=new Mt("undefined",b.Undefined,function(t){return void 0===t}),Jt=new Mt("Date",b.Date,function(t){return"number"==typeof t||t instanceof Date},function(t){return t instanceof Date?t:new Date(t)});function Yt(t){return P(t)&&0<(t.flags&(b.String|b.Number|b.Integer|b.Boolean|b.Date))}Jt.getSnapshot=function(t){return t.storedValue.getTime()};var Zt=function(n){function t(t){var e=n.call(this,JSON.stringify(t))||this;return e.shouldAttachNode=!1,e.flags=b.Literal,e.value=t,e}return a(t,n),t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,r)},t.prototype.describe=function(){return JSON.stringify(this.value)},t.prototype.isValidSnapshot=function(t,e){return pt(t)&&t===this.value?z():M(e,t,"Value is not a literal "+JSON.stringify(this.value))},t}(A);function Gt(t){return new Zt(t)}var Bt=function(o){function t(t,e,n,r){var i=o.call(this,t)||this;return i.type=e,i.predicate=n,i.message=r,i}return a(t,o),Object.defineProperty(t.prototype,"flags",{get:function(){return this.type.flags|b.Refinement},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.type.shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.describe=function(){return this.name},t.prototype.instantiate=function(t,e,n,r){return this.type.instantiate(t,e,n,r)},t.prototype.isAssignableFrom=function(t){return this.type.isAssignableFrom(t)},t.prototype.isValidSnapshot=function(t,e){var n=this.type.validate(t,e);if(0<n.length)return n;var r=J(t)?Y(t).snapshot:t;return this.predicate(r)?z():M(e,t,this.message(t))},t}(A);var Kt=function(i){function t(t,e,n){var r=i.call(this,t)||this;return r.eager=!0,n=o({eager:!0,dispatcher:void 0},n),r.dispatcher=n.dispatcher,n.eager||(r.eager=!1),r.types=e,r}return a(t,i),Object.defineProperty(t.prototype,"flags",{get:function(){var e=b.Union;return this.types.forEach(function(t){e|=t.flags}),e},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.types.some(function(t){return t.shouldAttachNode})},enumerable:!0,configurable:!0}),t.prototype.isAssignableFrom=function(e){return this.types.some(function(t){return t.isAssignableFrom(e)})},t.prototype.describe=function(){return"("+this.types.map(function(t){return t.describe()}).join(" | ")+")"},t.prototype.instantiate=function(t,e,n,r){var i=this.determineType(r,void 0);return i?i.instantiate(t,e,n,r):nt("No matching type for union "+this.describe())},t.prototype.reconcile=function(t,e){var n=this.determineType(e,t.type);return n?n.reconcile(t,e):nt("No matching type for union "+this.describe())},t.prototype.determineType=function(e,n){return this.dispatcher?this.dispatcher(e):n?n.is(e)?n:this.types.filter(function(t){return t!==n}).find(function(t){return t.is(e)}):this.types.find(function(t){return t.is(e)})},t.prototype.isValidSnapshot=function(t,e){if(this.dispatcher)return this.dispatcher(t).validate(t,e);for(var n=[],r=0,i=0;i<this.types.length;i++){var o=this.types[i].validate(t,e);if(0===o.length){if(this.eager)return z();r++}else n.push(o)}return 1===r?z():M(e,t,"No type is applicable for the union").concat(L(n))},t}(A);function qt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var r=P(t)?void 0:t,i=P(t)?[t].concat(e):e,o="("+i.map(function(t){return t.name}).join(" | ")+")";return new Kt(o,i,r)}var Qt=function(r){function t(t,e){var n=r.call(this,t.name)||this;return n.type=t,n.defaultValue=e,n}return a(t,r),Object.defineProperty(t.prototype,"flags",{get:function(){return this.type.flags|b.Optional},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.type.shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.describe=function(){return this.type.describe()+"?"},t.prototype.instantiate=function(t,e,n,r){if(void 0!==r)return this.type.instantiate(t,e,n,r);var i=this.getDefaultInstanceOrSnapshot();return this.type.instantiate(t,e,n,i)},t.prototype.reconcile=function(t,e){return this.type.reconcile(t,this.type.is(e)&&void 0!==e?e:this.getDefaultInstanceOrSnapshot())},t.prototype.getDefaultInstanceOrSnapshot=function(){var t="function"==typeof this.defaultValue?this.defaultValue():this.defaultValue;return this.defaultValue,t},t.prototype.getDefaultValueSnapshot=function(){var t=this.getDefaultInstanceOrSnapshot();return J(t)?Y(t).snapshot:t},t.prototype.isValidSnapshot=function(t,e){return void 0===t?z():this.type.validate(t,e)},t.prototype.isAssignableFrom=function(t){return this.type.isAssignableFrom(t)},t}(A);function Xt(t,e){return"function"!=typeof e&&J(e)&&nt("default value cannot be an instance, pass a snapshot or a function that creates an instance/snapshot instead"),new Qt(t,e)}var te=Xt(Wt,void 0),ee=Xt($t,null);var ne=function(r){function t(t,e){var n=r.call(this,t)||this;return n._subType=null,n.definition=e,n}return a(t,r),Object.defineProperty(t.prototype,"flags",{get:function(){return(this._subType?this._subType.flags:0)|b.Late},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"shouldAttachNode",{get:function(){return this.getSubType(!0).shouldAttachNode},enumerable:!0,configurable:!0}),t.prototype.getSubType=function(t){if(null===this._subType){var e=void 0;try{e=this.definition()}catch(t){if(!(t instanceof ReferenceError))throw t;e=void 0}if(t&&void 0===e&&nt("Late type seems to be used too early, the definition (still) returns undefined"),e)return this._subType=e}return this._subType},t.prototype.instantiate=function(t,e,n,r){return this.getSubType(!0).instantiate(t,e,n,r)},t.prototype.reconcile=function(t,e){return this.getSubType(!0).reconcile(t,e)},t.prototype.describe=function(){var t=this.getSubType(!1);return t?t.name:"<uknown late type>"},t.prototype.isValidSnapshot=function(t,e){var n=this.getSubType(!1);return n?n.validate(t,e):z()},t.prototype.isAssignableFrom=function(t){var e=this.getSubType(!1);return!!e&&e.isAssignableFrom(t)},t}(A);var re=function(n){function t(t){var e=n.call(this,t?"frozen("+t.name+")":"frozen")||this;return e.subType=t,e.shouldAttachNode=!1,e.flags=b.Frozen,e}return a(t,n),t.prototype.describe=function(){return"<any immutable value>"},t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,r)},t.prototype.isValidSnapshot=function(t,e){return"function"==typeof t?M(e,t,"Value is not serializable and cannot be frozen"):this.subType?this.subType.validate(t,e):z()},t}(A),ie=new re;var oe=function(){function t(t,e,n){if(this.mode=t,this.value=e,this.targetType=n,"object"===t){if(!J(e))return nt("Can only store references to tree nodes, got: '"+e+"'");if(!Y(e).identifierAttribute)return nt("Can only store references with a defined identifier attribute.")}}return Object.defineProperty(t.prototype,"resolvedValue",{get:function(){var t=this.node,e=this.targetType,n=t.root.identifierCache.resolve(e,this.value);return n?n.value:nt("Failed to resolve reference '"+this.value+"' to type '"+this.targetType.name+"' (from node: "+t.path+")")},enumerable:!0,configurable:!0}),n([l.computed],t.prototype,"resolvedValue",null),t}(),ae=function(n){function t(t){var e=n.call(this,"reference("+t.name+")")||this;return e.targetType=t,e.shouldAttachNode=!1,e.flags=b.Reference,e}return a(t,n),t.prototype.describe=function(){return this.name},t.prototype.isAssignableFrom=function(t){return this.targetType.isAssignableFrom(t)},t.prototype.isValidSnapshot=function(t,e){return"string"==typeof t||"number"==typeof t?z():M(e,t,"Value is not a valid identifier, which is a string or a number")},t}(A),se=function(e){function t(t){return e.call(this,t)||this}return a(t,e),t.prototype.getValue=function(t){if(t.isAlive){var e=t.storedValue;return"object"===e.mode?e.value:e.resolvedValue}},t.prototype.getSnapshot=function(t){var e=t.storedValue;switch(e.mode){case"identifier":return e.value;case"object":return e.value[Y(e.value).identifierAttribute]}},t.prototype.instantiate=function(t,e,n,r){var i,o=J(r)?"object":"identifier",a=W(this,t,e,n,i=new oe(o,r,this.targetType));return i.node=a},t.prototype.reconcile=function(t,e){if(t.type===this){var n=J(e)?"object":"identifier",r=t.storedValue;if(n===r.mode&&r.value===e)return t}var i=this.instantiate(t.parent,t.subpath,t._environment,e);return t.die(),i},t}(ae),ue=function(r){function t(t,e){var n=r.call(this,t)||this;return n.options=e,n}return a(t,r),t.prototype.getValue=function(t){if(t.isAlive)return this.options.get(t.storedValue,t.parent?t.parent.storedValue:null)},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,J(r)?this.options.set(r,t?t.storedValue:null):r)},t.prototype.reconcile=function(t,e){var n=J(e)?this.options.set(e,t?t.storedValue:null):e;if(t.type===this&&t.storedValue===n)return t;var r=this.instantiate(t.parent,t.subpath,t._environment,n);return t.die(),r},t}(ae);var pe=function(e){function t(){var t=e.call(this,"identifier")||this;return t.shouldAttachNode=!1,t.flags=b.Identifier,t}return a(t,e),t.prototype.instantiate=function(t,e,n,r){return t&&t.type instanceof kt||nt("Identifier types can only be instantiated as direct child of a model type"),W(this,t,e,n,r)},t.prototype.reconcile=function(t,e){return t.storedValue!==e?nt("Tried to change identifier from '"+t.storedValue+"' to '"+e+"'. Changing identifiers is not allowed."):t},t.prototype.describe=function(){return"identifier"},t.prototype.isValidSnapshot=function(t,e){return"string"!=typeof t?M(e,t,"Value is not a valid identifier, expected a string"):z()},t}(A),ce=function(i){function t(){var t=i.call(this)||this;return t.name="identifierNumber",t}return a(t,i),t.prototype.instantiate=function(t,e,n,r){return i.prototype.instantiate.call(this,t,e,n,r)},t.prototype.isValidSnapshot=function(t,e){return"number"==typeof t?z():M(e,t,"Value is not a valid identifierNumber, expected a number")},t.prototype.reconcile=function(t,e){return i.prototype.reconcile.call(this,t,e)},t.prototype.getSnapshot=function(t){return t.storedValue},t.prototype.describe=function(){return"identifierNumber"},t}(pe),le=new pe,he=new ce;var fe=function(n){function t(t){var e=n.call(this,t.name)||this;return e.options=t,e.flags=b.Reference,e.shouldAttachNode=!1,e}return a(t,n),t.prototype.describe=function(){return this.name},t.prototype.isAssignableFrom=function(t){return t===this},t.prototype.isValidSnapshot=function(t,e){if(this.options.isTargetType(t))return z();var n=this.options.getValidationMessage(t);return n?M(e,t,"Invalid value for type '"+this.name+"': "+n):z()},t.prototype.getValue=function(t){if(t.isAlive)return t.storedValue},t.prototype.getSnapshot=function(t){return this.options.toSnapshot(t.storedValue)},t.prototype.instantiate=function(t,e,n,r){return W(this,t,e,n,this.options.isTargetType(r)?r:this.options.fromSnapshot(r))},t.prototype.reconcile=function(t,e){var n=!this.options.isTargetType(e);if(t.type===this&&(n?e===t.snapshot:e===t.storedValue))return t;var r=n?this.options.fromSnapshot(e):e,i=this.instantiate(t.parent,t.subpath,t._environment,r);return t.die(),i},t}(A),de={enumeration:function(t,e){var n=qt.apply(void 0,("string"==typeof t?e:t).map(function(t){return Gt(""+t)}));return"string"==typeof t&&(n.name=t),n},model:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():"AnonymousModel",r=t.shift()||{};return new kt({name:n,properties:r})},compose:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():"AnonymousModel";return t.reduce(function(e,n){return e.cloneAndEnhance({name:e.name+"_"+n.name,properties:n.properties,initializers:n.initializers,preProcessor:function(t){return n.applySnapshotPreProcessor(e.applySnapshotPreProcessor(t))},postProcessor:function(t){return n.applySnapshotPostProcessor(e.applySnapshotPostProcessor(t))}})}).named(n)},custom:function(t){return new fe(t)},reference:function(t,e){return e?new ue(t,e):new se(t)},union:qt,optional:Xt,literal:Gt,maybe:function(t){return qt(t,te)},maybeNull:function(t){return qt(t,ee)},refinement:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n="string"==typeof t[0]?t.shift():P(t[0])?t[0].name:null,r=t[0],i=t[1],o=t[2]?t[2]:function(t){return"Value does not respect the refinement predicate"};return new Bt(n,r,i,o)},string:Lt,boolean:Ht,number:Ft,integer:Ut,Date:Jt,map:function(t){return new _t("map<string, "+t.name+">",t)},array:function(t){return new Vt(t.name+"[]",t)},frozen:function(t){return 0===arguments.length?ie:P(t)?new re(t):Xt(ie,t)},identifier:le,identifierNumber:he,late:function(t,e){var n="string"==typeof t?t:"late("+t.toString()+")";return new ne(n,"string"==typeof t?e:t)},undefined:Wt,null:$t};t.types=de,t.typecheck=F,t.escapeJsonPath=vt,t.unescapeJsonPath=bt,t.joinJsonPath=gt,t.splitJsonPath=mt,t.decorate=function(t,e){var n={handler:t,includeHooks:!0};return e.$mst_middleware&&e.$mst_middleware.push(n),e.$mst_middleware=[n],e},t.addMiddleware=D,t.process=function(t){return dt("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`."),yt(t)},t.isStateTreeNode=J,t.flow=yt,t.applyAction=I,t.onAction=T,t.recordActions=function(t){var e={actions:[],stop:function(){return n()},replay:function(t){I(t,e.actions)}},n=T(t,e.actions.push.bind(e.actions));return e},t.createActionTrackingMiddleware=function(a){return function(e,t,n){switch(e.type){case"action":if(a.filter&&!0!==a.filter(e))return t(e);var r=a.onStart(e);a.onResume(e,r),_.set(e.id,{call:e,context:r,async:!1});try{var i=t(e);return a.onSuspend(e,r),!1===_.get(e.id).async&&(_.delete(e.id),a.onSuccess(e,r,i)),i}catch(t){throw _.delete(e.id),a.onFail(e,r,t),t}case"flow_spawn":return(o=_.get(e.rootId)).async=!0,t(e);case"flow_resume":case"flow_resume_error":var o=_.get(e.rootId);a.onResume(e,o.context);try{return t(e)}finally{a.onSuspend(e,o.context)}case"flow_throw":return o=_.get(e.rootId),_.delete(e.id),a.onFail(e,o.context,e.args[0]),t(e);case"flow_return":return o=_.get(e.rootId),_.delete(e.id),a.onSuccess(e,o.context,e.args[0]),t(e)}}},t.setLivelynessChecking=function(t){v=t},t.getType=u,t.getChildType=function(t,e){return Y(t).getChildType(e)},t.onPatch=i,t.onSnapshot=function(t,e){return Y(t).onSnapshot(e)},t.applyPatch=s,t.recordPatches=function(e){var t=null;function n(){t||(t=i(e,function(t,e){r.rawPatches.push([t,e])}))}var r={rawPatches:[],get patches(){return this.rawPatches.map(function(t){return t[0]})},get inversePatches(){return this.rawPatches.map(function(t){return t[0],t[1]})},stop:function(){t&&t(),t=null},resume:n,replay:function(t){s(t||e,r.patches)},undo:function(t){s(t||e,r.inversePatches.slice().reverse())}};return n(),r},t.protect=function(t){var e=Y(t);e.isRoot||nt("`protect` can only be invoked on root nodes"),e.isProtectionEnabled=!0},t.unprotect=function(t){var e=Y(t);e.isRoot||nt("`unprotect` can only be invoked on root nodes"),e.isProtectionEnabled=!1},t.isProtected=function(t){return Y(t).isProtected},t.applySnapshot=p,t.getSnapshot=function(t,e){void 0===e&&(e=!0);var n=Y(t);return e?n.snapshot:ct(n.type.getSnapshot(n,!1))},t.hasParent=function(t,e){void 0===e&&(e=1);for(var n=Y(t).parent;n;){if(0==--e)return!0;n=n.parent}return!1},t.getParent=function(t,e){void 0===e&&(e=1);for(var n=e,r=Y(t).parent;r;){if(0==--n)return r.storedValue;r=r.parent}return nt("Failed to find the parent of "+Y(t)+" at depth "+e)},t.hasParentOfType=function(t,e){for(var n=Y(t).parent;n;){if(e.is(n.storedValue))return!0;n=n.parent}return!1},t.getParentOfType=function(t,e){for(var n=Y(t).parent;n;){if(e.is(n.storedValue))return n.storedValue;n=n.parent}return nt("Failed to find the parent of "+Y(t)+" of a given type")},t.getRoot=c,t.getPath=function(t){return Y(t).path},t.getPathParts=function(t){return mt(Y(t).path)},t.isRoot=function(t){return Y(t).isRoot},t.resolvePath=function(t,e){var n=K(Y(t),e);return n?n.value:void 0},t.resolveIdentifier=function(t,e,n){var r=Y(e).root.identifierCache.resolve(t,""+n);return r?r.value:void 0},t.getIdentifier=function(t){return Y(t).identifier},t.tryResolve=h,t.getRelativePath=function(t,e){return B(Y(t),Y(e))},t.clone=function(t,e){void 0===e&&(e=!0);var n=Y(t);return n.type.create(n.snapshot,!0===e?n.root._environment:!1===e?void 0:e)},t.detach=function(t){return Y(t).detach(),t},t.destroy=function(t){var e=Y(t);e.isRoot?e.die():e.parent.removeChild(e.subpath)},t.isAlive=function(t){return Y(t).isAlive},t.addDisposer=function(t,e){Y(t).addDisposer(e)},t.getEnv=function(t){var e=Y(t).root._environment;return e||tt},t.walk=f,t.getMembers=function(n){var t=Y(n).type,r=o({},e(t),{actions:[],volatile:[],views:[]});return Object.getOwnPropertyNames(n).forEach(function(t){if(!(t in r.properties)){var e=Object.getOwnPropertyDescriptor(n,t);e.get?l.isComputedProp(n,t)?r.views.push(t):r.volatile.push(t):!0===e.value._isMSTAction?r.actions.push(t):l.isObservableProp(n,t)?r.volatile.push(t):r.views.push(t)}}),r},t.getPropertyMembers=e,t.cast=function(t){return t},t.isType=P,t.isArrayType=function(t){return P(t)&&0<(t.flags&b.Array)},t.isFrozenType=function(t){return P(t)&&0<(t.flags&b.Frozen)},t.isIdentifierType=function(t){return P(t)&&0<(t.flags&b.Identifier)},t.isLateType=function(t){return P(t)&&0<(t.flags&b.Late)},t.isLiteralType=function(t){return P(t)&&0<(t.flags&b.Literal)},t.isMapType=function(t){return P(t)&&0<(t.flags&b.Map)},t.isModelType=function(t){return P(t)&&0<(t.flags&b.Object)},t.isOptionalType=function(t){return P(t)&&0<(t.flags&b.Optional)},t.isPrimitiveType=Yt,t.isReferenceType=function(t){return 0<(t.flags&b.Reference)},t.isRefinementType=function(t){return 0<(t.flags&b.Refinement)},t.isUnionType=function(t){return 0<(t.flags&b.Union)},Object.defineProperty(t,"__esModule",{value:!0})}); |
import { IObservableArray } from "mobx"; | ||
import { IComplexType, IType, OptionalProperty } from "../../internal"; | ||
export interface IMSTArray<C, S, T> extends IObservableArray<T> { | ||
import { IAnyType, IComplexType, OptionalProperty, ExtractS, ExtractC, ExtractT } from "../../internal"; | ||
export interface IMSTArray<T> extends IObservableArray<T> { | ||
} | ||
export interface IArrayType<C, S, T> extends IComplexType<C[] | undefined, S[], IMSTArray<C, S, T>>, OptionalProperty { | ||
export interface IArrayType<IT extends IAnyType> extends IComplexType<ExtractC<IT>[] | undefined, ExtractS<IT>[], IMSTArray<ExtractT<IT>>>, OptionalProperty { | ||
} | ||
@@ -31,3 +31,3 @@ /** | ||
*/ | ||
export declare function array<C, S, T>(subtype: IType<C, S, T>): IArrayType<C, S, T>; | ||
export declare function array<IT extends IAnyType>(subtype: IT): IArrayType<IT>; | ||
/** | ||
@@ -41,2 +41,2 @@ * Returns if a given value represents an array type. | ||
*/ | ||
export declare function isArrayType<IT extends IArrayType<any, any, any>>(type: IT): type is IT; | ||
export declare function isArrayType<IT extends IArrayType<any>>(type: IT): type is IT; |
import { IInterceptor, IKeyValueMap, IMapDidChange, IMapWillChange, Lambda } from "mobx"; | ||
import { IComplexType, IType, OptionalProperty } from "../../internal"; | ||
export interface IMapType<C, S, T> extends IComplexType<IKeyValueMap<C> | undefined, IKeyValueMap<S>, IMSTMap<C, S, T>>, OptionalProperty { | ||
import { IAnyType, IComplexType, IType, OptionalProperty, ExtractC, ExtractS, ExtractT, ExtractCST } from "../../internal"; | ||
export interface IMapType<IT extends IAnyType> extends IComplexType<IKeyValueMap<ExtractC<IT>> | undefined, IKeyValueMap<ExtractS<IT>>, IMSTMap<IT>>, OptionalProperty { | ||
} | ||
export interface IMSTMap<C, S, T> { | ||
export interface IMSTMap<IT extends IAnyType> { | ||
clear(): void; | ||
delete(key: string): boolean; | ||
forEach(callbackfn: (value: T, key: string, map: IMSTMap<C, S, T>) => void, thisArg?: any): void; | ||
get(key: string): T | undefined; | ||
forEach(callbackfn: (value: ExtractT<IT>, key: string, map: IMSTMap<IT>) => void, thisArg?: any): void; | ||
get(key: string): ExtractT<IT> | undefined; | ||
has(key: string): boolean; | ||
set(key: string, value: C | S | T): this; | ||
set(key: string, value: ExtractCST<IT>): this; | ||
readonly size: number; | ||
put(value: C | S | T): T; | ||
put(value: ExtractCST<IT>): ExtractT<IT>; | ||
keys(): IterableIterator<string>; | ||
values(): IterableIterator<T>; | ||
entries(): IterableIterator<[string, T]>; | ||
[Symbol.iterator](): IterableIterator<[string, T]>; | ||
values(): IterableIterator<ExtractT<IT>>; | ||
entries(): IterableIterator<[string, ExtractT<IT>]>; | ||
[Symbol.iterator](): IterableIterator<[string, ExtractT<IT>]>; | ||
/** Merge another object into this map, returns self. */ | ||
merge(other: IMSTMap<any, any, T> | IKeyValueMap<C | S | T> | any): this; | ||
replace(values: IMSTMap<any, any, T> | IKeyValueMap<T>): this; | ||
merge(other: IMSTMap<IType<any, any, ExtractT<IT>>> | IKeyValueMap<ExtractCST<IT>> | any): this; | ||
replace(values: IMSTMap<IType<any, any, ExtractT<IT>>> | IKeyValueMap<ExtractT<IT>>): this; | ||
/** | ||
@@ -26,3 +26,3 @@ * Returns a plain object that represents this map. | ||
*/ | ||
toPOJO(): IKeyValueMap<T>; | ||
toPOJO(): IKeyValueMap<ExtractT<IT>>; | ||
/** | ||
@@ -32,4 +32,4 @@ * Returns a shallow non observable object clone of this map. | ||
*/ | ||
toJS(): Map<string, T>; | ||
toJSON(): IKeyValueMap<T>; | ||
toJS(): Map<string, ExtractT<IT>>; | ||
toJSON(): IKeyValueMap<ExtractT<IT>>; | ||
toString(): string; | ||
@@ -42,4 +42,4 @@ [Symbol.toStringTag]: "Map"; | ||
*/ | ||
observe(listener: (changes: IMapDidChange<string, T>) => void, fireImmediately?: boolean): Lambda; | ||
intercept(handler: IInterceptor<IMapWillChange<string, T>>): Lambda; | ||
observe(listener: (changes: IMapDidChange<string, ExtractT<IT>>) => void, fireImmediately?: boolean): Lambda; | ||
intercept(handler: IInterceptor<IMapWillChange<string, ExtractT<IT>>>): Lambda; | ||
} | ||
@@ -73,3 +73,3 @@ /** | ||
*/ | ||
export declare function map<C, S, T>(subtype: IType<C, S, T>): IMapType<C, S, T>; | ||
export declare function map<IT extends IAnyType>(subtype: IT): IMapType<IT>; | ||
/** | ||
@@ -83,2 +83,2 @@ * Returns if a given value represents a map type. | ||
*/ | ||
export declare function isMapType<IT extends IMapType<any, any, any>>(type: IT): type is IT; | ||
export declare function isMapType<IT extends IMapType<any>>(type: IT): type is IT; |
@@ -26,2 +26,6 @@ import { ExtractIStateTreeNode, IAnyType, IComplexType, IStateTreeNode, IType, ExtractC, ExtractS, ExtractT } from "../../internal"; | ||
export declare type OptionalProps<T> = Pick<T, OptionalPropNames<T>>; | ||
export interface _NotCustomized { | ||
readonly "!!mstNotCustomized": undefined; | ||
} | ||
export declare type _CustomOrOther<Custom, Other> = Custom extends _NotCustomized ? Other : Custom; | ||
/** | ||
@@ -35,47 +39,51 @@ * Maps property types to the snapshot, including omitted optional attributes | ||
}; | ||
export declare type ModelCreationType2<T extends ModelProperties, CustomC> = _CustomOrOther<CustomC, ModelCreationType<T>>; | ||
export declare type ModelSnapshotType<T extends ModelProperties> = { | ||
[K in keyof T]: ExtractS<T[K]>; | ||
}; | ||
export declare type ModelInstanceType<T extends ModelProperties, O, C, S> = { | ||
[K in keyof T]: ExtractIStateTreeNode<ExtractC<T[K]>, ExtractS<T[K]>, ExtractT<T[K]>>; | ||
} & O & IStateTreeNode<C, S>; | ||
export declare type ModelSnapshotType2<T extends ModelProperties, CustomS> = _CustomOrOther<CustomS, ModelSnapshotType<T>>; | ||
export declare type ModelInstanceTypeProps<P extends ModelProperties> = { | ||
[K in keyof P]: ExtractIStateTreeNode<ExtractC<P[K]>, ExtractS<P[K]>, ExtractT<P[K]>>; | ||
}; | ||
export declare type ModelInstanceType<P extends ModelProperties, O, CustomC, CustomS> = ModelInstanceTypeProps<P> & O & IStateTreeNode<ModelCreationType2<P, CustomC>, ModelSnapshotType2<P, CustomS>>; | ||
export interface ModelActions { | ||
[key: string]: Function; | ||
} | ||
export interface IModelType<PROPS extends ModelProperties, OTHERS, C = ModelCreationType<PROPS>, S = ModelSnapshotType<PROPS>, T = ModelInstanceType<PROPS, OTHERS, C, S>> extends IComplexType<C, S, T> { | ||
export interface IModelType<PROPS extends ModelProperties, OTHERS, CustomC = _NotCustomized, CustomS = _NotCustomized> extends IComplexType<ModelCreationType2<PROPS, CustomC>, ModelSnapshotType2<PROPS, CustomS>, ModelInstanceType<PROPS, OTHERS, CustomC, CustomS>> { | ||
readonly properties: PROPS; | ||
named(newName: string): this; | ||
props<PROPS2 extends ModelPropertiesDeclaration>(props: PROPS2): IModelType<PROPS & ModelPropertiesDeclarationToProperties<PROPS2>, OTHERS>; | ||
views<V extends Object>(fn: (self: ModelInstanceType<PROPS, OTHERS, C, S>) => V): IModelType<PROPS, OTHERS & V>; | ||
actions<A extends ModelActions>(fn: (self: ModelInstanceType<PROPS, OTHERS, C, S>) => A): IModelType<PROPS, OTHERS & A>; | ||
volatile<TP extends object>(fn: (self: ModelInstanceType<PROPS, OTHERS, C, S>) => TP): IModelType<PROPS, OTHERS & TP>; | ||
extend<A extends ModelActions = {}, V extends Object = {}, VS extends Object = {}>(fn: (self: ModelInstanceType<PROPS, OTHERS, C, S>) => { | ||
props<PROPS2 extends ModelPropertiesDeclaration>(props: PROPS2): IModelType<PROPS & ModelPropertiesDeclarationToProperties<PROPS2>, OTHERS, CustomC, CustomS>; | ||
views<V extends Object>(fn: (self: ModelInstanceType<PROPS, OTHERS, CustomC, CustomS>) => V): IModelType<PROPS, OTHERS & V, CustomC, CustomS>; | ||
actions<A extends ModelActions>(fn: (self: ModelInstanceType<PROPS, OTHERS, CustomC, CustomS>) => A): IModelType<PROPS, OTHERS & A, CustomC, CustomS>; | ||
volatile<TP extends object>(fn: (self: ModelInstanceType<PROPS, OTHERS, CustomC, CustomS>) => TP): IModelType<PROPS, OTHERS & TP, CustomC, CustomS>; | ||
extend<A extends ModelActions = {}, V extends Object = {}, VS extends Object = {}>(fn: (self: ModelInstanceType<PROPS, OTHERS, CustomC, CustomS>) => { | ||
actions?: A; | ||
views?: V; | ||
state?: VS; | ||
}): IModelType<PROPS, OTHERS & A & V & VS>; | ||
preProcessSnapshot<NewC = C>(fn: (snapshot: NewC) => C): IModelType<PROPS, OTHERS, NewC, S>; | ||
postProcessSnapshot<NewS = S>(fn: (snapshot: S) => NewS): IModelType<PROPS, OTHERS, C, NewS>; | ||
}): IModelType<PROPS, OTHERS & A & V & VS, CustomC, CustomS>; | ||
preProcessSnapshot<NewC = ModelCreationType2<PROPS, CustomC>>(fn: (snapshot: NewC) => ModelCreationType2<PROPS, CustomC>): IModelType<PROPS, OTHERS, NewC, CustomS>; | ||
postProcessSnapshot<NewS = ModelSnapshotType2<PROPS, CustomS>>(fn: (snapshot: ModelSnapshotType2<PROPS, CustomS>) => NewS): IModelType<PROPS, OTHERS, CustomC, NewS>; | ||
} | ||
export declare type IAnyModelType = IModelType<any, any, any, any, any>; | ||
export declare type ExtractProps<T extends IAnyModelType> = T extends IModelType<infer P, any, any, any, any> ? P : never; | ||
export declare type ExtractOthers<T extends IAnyModelType> = T extends IModelType<any, infer O, any, any, any> ? O : never; | ||
export declare type IAnyModelType = IModelType<any, any, any, any>; | ||
export declare type ExtractProps<T extends IAnyModelType> = T extends IModelType<infer P, any, any, any> ? P : never; | ||
export declare type ExtractOthers<T extends IAnyModelType> = T extends IModelType<any, infer O, any, any> ? O : never; | ||
export declare function model<T extends ModelPropertiesDeclaration = {}>(name: string, properties?: T): IModelType<ModelPropertiesDeclarationToProperties<T>, {}>; | ||
export declare function model<T extends ModelPropertiesDeclaration = {}>(properties?: T): IModelType<ModelPropertiesDeclarationToProperties<T>, {}>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB>(name: string, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>): IModelType<PA & PB, OA & OB, CA & CB, SA & SB, TA & TB>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>): IModelType<PA & PB, OA & OB, CA & CB, SA & SB, TA & TB>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC>(name: string, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>): IModelType<PA & PB & PC, OA & OB & OC, CA & CB & CC, SA & SB & SC, TA & TB & TC>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>): IModelType<PA & PB & PC, OA & OB & OC, CA & CB & CC, SA & SB & SC, TA & TB & TC>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD>(name: string, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>): IModelType<PA & PB & PC & PD, OA & OB & OC & OD, CA & CB & CC & CD, SA & SB & SC & SD, TA & TB & TC & TD>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>): IModelType<PA & PB & PC & PD, OA & OB & OC & OD, CA & CB & CC & CD, SA & SB & SC & SD, TA & TB & TC & TD>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE>(name: string, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>): IModelType<PA & PB & PC & PD & PE, OA & OB & OC & OD & OE, CA & CB & CC & CD & CE, SA & SB & SC & SD & SE, TA & TB & TC & TD & TE>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>): IModelType<PA & PB & PC & PD & PE, OA & OB & OC & OD & OE, CA & CB & CC & CD & CE, SA & SB & SC & SD & SE, TA & TB & TC & TD & TE>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF>(name: string, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>): IModelType<PA & PB & PC & PD & PE & PF, OA & OB & OC & OD & OE & OF, CA & CB & CC & CD & CE & CF, SA & SB & SC & SD & SE & SF, TA & TB & TC & TD & TE & TF>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>): IModelType<PA & PB & PC & PD & PE & PF, OA & OB & OC & OD & OE & OF, CA & CB & CC & CD & CE & CF, SA & SB & SC & SD & SE & SF, TA & TB & TC & TD & TE & TF>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG>(name: string, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>): IModelType<PA & PB & PC & PD & PE & PF & PG, OA & OB & OC & OD & OE & OF & OG, CA & CB & CC & CD & CE & CF & CG, SA & SB & SC & SD & SE & SF & SG, TA & TB & TC & TD & TE & TF & TG>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>): IModelType<PA & PB & PC & PD & PE & PF & PG, OA & OB & OC & OD & OE & OF & OG, CA & CB & CC & CD & CE & CF & CG, SA & SB & SC & SD & SE & SF & SG, TA & TB & TC & TD & TE & TF & TG>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG, PH extends ModelProperties, OH, CH, SH, TH>(name: string, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>, H: IModelType<PH, OH, CH, SH, TH>): IModelType<PA & PB & PC & PD & PE & PF & PG & PH, OA & OB & OC & OD & OE & OF & OG & OH, CA & CB & CC & CD & CE & CF & CG & CH, SA & SB & SC & SD & SE & SF & SG & SH, TA & TB & TC & TD & TE & TF & TG & TH>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG, PH extends ModelProperties, OH, CH, SH, TH>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>, H: IModelType<PH, OH, CH, SH, TH>): IModelType<PA & PB & PC & PD & PE & PF & PG & PH, OA & OB & OC & OD & OE & OF & OG & OH, CA & CB & CC & CD & CE & CF & CG & CH, SA & SB & SC & SD & SE & SF & SG & SH, TA & TB & TC & TD & TE & TF & TG & TH>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG, PH extends ModelProperties, OH, CH, SH, TH, PI extends ModelProperties, OI, CI, SI, TI>(name: string, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>, H: IModelType<PH, OH, CH, SH, TH>, I: IModelType<PI, OI, CI, SI, TI>): IModelType<PA & PB & PC & PD & PE & PF & PG & PH & PI, OA & OB & OC & OD & OE & OF & OG & OH & OI, CA & CB & CC & CD & CE & CF & CG & CH & CI, SA & SB & SC & SD & SE & SF & SG & SH & SI, TA & TB & TC & TD & TE & TF & TG & TH & TI>; | ||
export declare function compose<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG, PH extends ModelProperties, OH, CH, SH, TH, PI extends ModelProperties, OI, CI, SI, TI>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>, H: IModelType<PH, OH, CH, SH, TH>, I: IModelType<PI, OI, CI, SI, TI>): IModelType<PA & PB & PC & PD & PE & PF & PG & PH & PI, OA & OB & OC & OD & OE & OF & OG & OH & OI, CA & CB & CC & CD & CE & CF & CG & CH & CI, SA & SB & SC & SD & SE & SF & SG & SH & SI, TA & TB & TC & TD & TE & TF & TG & TH & TI>; | ||
export declare type _CustomJoin<A, B> = A extends _NotCustomized ? B : A & B; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB>(name: string, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>): IModelType<PA & PB, OA & OB, _CustomJoin<FCA, FCB>, _CustomJoin<FSA, FSB>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>): IModelType<PA & PB, OA & OB, _CustomJoin<FCA, FCB>, _CustomJoin<FSA, FSB>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC>(name: string, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>): IModelType<PA & PB & PC, OA & OB & OC, _CustomJoin<FCA, _CustomJoin<FCB, FCC>>, _CustomJoin<FSA, _CustomJoin<FSB, FSC>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>): IModelType<PA & PB & PC, OA & OB & OC, _CustomJoin<FCA, _CustomJoin<FCB, FCC>>, _CustomJoin<FSA, _CustomJoin<FSB, FSC>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD>(name: string, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>): IModelType<PA & PB & PC & PD, OA & OB & OC & OD, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, FCD>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, FSD>>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>): IModelType<PA & PB & PC & PD, OA & OB & OC & OD, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, FCD>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, FSD>>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE>(name: string, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>): IModelType<PA & PB & PC & PD & PE, OA & OB & OC & OD & OE, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, _CustomJoin<FCD, FCE>>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, _CustomJoin<FSD, FSE>>>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>): IModelType<PA & PB & PC & PD & PE, OA & OB & OC & OD & OE, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, _CustomJoin<FCD, FCE>>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, _CustomJoin<FSD, FSE>>>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF>(name: string, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>): IModelType<PA & PB & PC & PD & PE & PF, OA & OB & OC & OD & OE & OF, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, _CustomJoin<FCD, _CustomJoin<FCE, FCF>>>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, _CustomJoin<FSD, _CustomJoin<FSE, FSF>>>>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>): IModelType<PA & PB & PC & PD & PE & PF, OA & OB & OC & OD & OE & OF, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, _CustomJoin<FCD, _CustomJoin<FCE, FCF>>>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, _CustomJoin<FSD, _CustomJoin<FSE, FSF>>>>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG>(name: string, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>): IModelType<PA & PB & PC & PD & PE & PF & PG, OA & OB & OC & OD & OE & OF & OG, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, _CustomJoin<FCD, _CustomJoin<FCE, _CustomJoin<FCF, FCG>>>>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, _CustomJoin<FSD, _CustomJoin<FSE, _CustomJoin<FSF, FSG>>>>>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>): IModelType<PA & PB & PC & PD & PE & PF & PG, OA & OB & OC & OD & OE & OF & OG, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, _CustomJoin<FCD, _CustomJoin<FCE, _CustomJoin<FCF, FCG>>>>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, _CustomJoin<FSD, _CustomJoin<FSE, _CustomJoin<FSF, FSG>>>>>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH>(name: string, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>): IModelType<PA & PB & PC & PD & PE & PF & PG & PH, OA & OB & OC & OD & OE & OF & OG & OH, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, _CustomJoin<FCD, _CustomJoin<FCE, _CustomJoin<FCF, _CustomJoin<FCG, FCH>>>>>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, _CustomJoin<FSD, _CustomJoin<FSE, _CustomJoin<FSF, _CustomJoin<FSG, FSH>>>>>>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>): IModelType<PA & PB & PC & PD & PE & PF & PG & PH, OA & OB & OC & OD & OE & OF & OG & OH, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, _CustomJoin<FCD, _CustomJoin<FCE, _CustomJoin<FCF, _CustomJoin<FCG, FCH>>>>>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, _CustomJoin<FSD, _CustomJoin<FSE, _CustomJoin<FSF, _CustomJoin<FSG, FSH>>>>>>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH, PI extends ModelProperties, OI, FCI, FSI>(name: string, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>, I: IModelType<PI, OI, FCI, FSI>): IModelType<PA & PB & PC & PD & PE & PF & PG & PH & PI, OA & OB & OC & OD & OE & OF & OG & OH & OI, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, _CustomJoin<FCD, _CustomJoin<FCE, _CustomJoin<FCF, _CustomJoin<FCG, _CustomJoin<FCH, FCI>>>>>>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, _CustomJoin<FSD, _CustomJoin<FSE, _CustomJoin<FSF, _CustomJoin<FSG, _CustomJoin<FSH, FSI>>>>>>>>>; | ||
export declare function compose<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH, PI extends ModelProperties, OI, FCI, FSI>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>, I: IModelType<PI, OI, FCI, FSI>): IModelType<PA & PB & PC & PD & PE & PF & PG & PH & PI, OA & OB & OC & OD & OE & OF & OG & OH & OI, _CustomJoin<FCA, _CustomJoin<FCB, _CustomJoin<FCC, _CustomJoin<FCD, _CustomJoin<FCE, _CustomJoin<FCF, _CustomJoin<FCG, _CustomJoin<FCH, FCI>>>>>>>>, _CustomJoin<FSA, _CustomJoin<FSB, _CustomJoin<FSC, _CustomJoin<FSD, _CustomJoin<FSE, _CustomJoin<FSF, _CustomJoin<FSG, _CustomJoin<FSH, FSI>>>>>>>>>; | ||
/** | ||
@@ -82,0 +90,0 @@ * Returns if a given value represents a model type. |
import { IType, OptionalProperty } from "../../internal"; | ||
export declare function frozen<C>(subType: IType<C, any, any>): IType<C, C, C>; | ||
export declare function frozen<T>(defaultValue: T): IType<T | undefined | null, T, T> & OptionalProperty; | ||
export declare function frozen<T>(): IType<T, T, T>; | ||
export declare function frozen<T = any>(): IType<T, T, T>; | ||
/** | ||
@@ -6,0 +6,0 @@ * Returns if a given value represents a frozen type. |
import { IType, IComplexType, IAnyType, ExtractC, ExtractS, ExtractT, IAnyComplexType, OptionalProperty } from "../../internal"; | ||
export declare type IMaybeTypeBase<IT extends IAnyType, C, O> = IT extends IAnyComplexType ? IComplexType<ExtractC<IT> | C, ExtractS<IT> | O, ExtractT<IT> | O> & OptionalProperty : IT extends IAnyType ? IType<ExtractC<IT> | C, ExtractS<IT> | O, ExtractT<IT> | O> & OptionalProperty : never; | ||
export declare type IMaybeType<IT extends IAnyType> = IMaybeTypeBase<IT, undefined, undefined>; | ||
/** | ||
* Maybe will make a type nullable, and also optional. | ||
* The value `undefined` will be used to represent nullability. | ||
* | ||
* @export | ||
* @alias types.maybe | ||
* @template C | ||
* @template S | ||
* @template T | ||
* @param {IType<C, S, M>} type The type to make nullable | ||
* @returns {(IType<C | undefined, S | undefined, T | undefined>)} | ||
*/ | ||
export declare function maybe<IT extends IAnyType>(type: IT): IMaybeType<IT>; | ||
export declare type IMaybeNullType<IT extends IAnyType> = IMaybeTypeBase<IT, null | undefined, null>; | ||
/** | ||
* Maybe will make a type nullable, and also optional. | ||
* The value `null` will be used to represent no value. | ||
* | ||
* @export | ||
* @alias types.maybeNull | ||
* @template C | ||
* @template S | ||
* @template T | ||
* @param {IType<C, S, M>} type The type to make nullable | ||
* @returns {(IType<C | null | undefined, S | null, T | null>)} | ||
*/ | ||
export declare function maybeNull<IT extends IAnyType>(type: IT): IMaybeNullType<IT>; | ||
export interface IMaybeIComplexType<IT extends IAnyComplexType, C, O> extends IComplexType<ExtractC<IT> | C, ExtractS<IT> | O, ExtractT<IT> | O>, OptionalProperty { | ||
} | ||
export interface IMaybeIType<IT extends IAnyType, C, O> extends IType<ExtractC<IT> | C, ExtractS<IT> | O, ExtractT<IT> | O>, OptionalProperty { | ||
} | ||
export declare function maybe<IT extends IAnyComplexType>(type: IT): IMaybeIComplexType<IT, undefined, undefined>; | ||
export declare function maybe<IT extends IAnyType>(type: IT): IMaybeIType<IT, undefined, undefined>; | ||
export declare function maybeNull<IT extends IAnyComplexType>(type: IT): IMaybeIComplexType<IT, null | undefined, null>; | ||
export declare function maybeNull<IT extends IAnyType>(type: IT): IMaybeIType<IT, null | undefined, null>; |
@@ -1,4 +0,9 @@ | ||
import { IType, IComplexType, OptionalProperty } from "../../internal"; | ||
export declare function optional<C, S, T>(type: IComplexType<C, S, T>, defaultValueOrFunction: C | S | (() => C | S | T)): IComplexType<C | undefined, S, T> & OptionalProperty; | ||
export declare function optional<C, S, T>(type: IType<C, S, T>, defaultValueOrFunction: C | S | (() => C | S | T)): IType<C | undefined, S, T> & OptionalProperty; | ||
import { IType, IAnyType, IComplexType, OptionalProperty, ExtractT, ExtractS, ExtractC, ExtractCST, IAnyComplexType } from "../../internal"; | ||
export declare type OptionalDefaultValueOrFunction<IT extends IAnyType> = ExtractC<IT> | ExtractS<IT> | (() => ExtractCST<IT>); | ||
export interface IOptionalIComplexType<IT extends IAnyComplexType> extends IComplexType<ExtractC<IT> | undefined, ExtractS<IT>, ExtractT<IT>>, OptionalProperty { | ||
} | ||
export interface IOptionalIType<IT extends IAnyType> extends IType<ExtractC<IT> | undefined, ExtractS<IT>, ExtractT<IT>>, OptionalProperty { | ||
} | ||
export declare function optional<IT extends IAnyComplexType>(type: IT, defaultValueOrFunction: OptionalDefaultValueOrFunction<IT>): IOptionalIComplexType<IT>; | ||
export declare function optional<IT extends IAnyType>(type: IT, defaultValueOrFunction: OptionalDefaultValueOrFunction<IT>): IOptionalIType<IT>; | ||
/** | ||
@@ -5,0 +10,0 @@ * Returns if a value represents an optional type. |
@@ -1,2 +0,2 @@ | ||
import { ExtractT, IComplexType, IAnyStateTreeNode, IAnyModelType } from "../../internal"; | ||
import { ExtractT, IComplexType, IAnyStateTreeNode, IAnyComplexType } from "../../internal"; | ||
export interface ReferenceOptions<T> { | ||
@@ -6,3 +6,3 @@ get(identifier: string | number, parent: IAnyStateTreeNode | null): T; | ||
} | ||
export interface IReferenceType<IR extends IAnyModelType> extends IComplexType<string | number | ExtractT<IR>, string | number, ExtractT<IR>> { | ||
export interface IReferenceType<IR extends IAnyComplexType> extends IComplexType<string | number | ExtractT<IR>, string | number, ExtractT<IR>> { | ||
} | ||
@@ -16,3 +16,3 @@ /** | ||
*/ | ||
export declare function reference<IT extends IAnyModelType>(subType: IT, options?: ReferenceOptions<ExtractT<IT>>): IReferenceType<IT>; | ||
export declare function reference<IT extends IAnyComplexType>(subType: IT, options?: ReferenceOptions<ExtractT<IT>>): IReferenceType<IT>; | ||
/** | ||
@@ -19,0 +19,0 @@ * Returns if a given value represents a reference type. |
@@ -1,2 +0,2 @@ | ||
import { IType, IAnyType, IComplexType, IModelType, ModelProperties } from "../../internal"; | ||
import { IType, IAnyType, IComplexType, IModelType, ModelProperties, ModelInstanceType, ModelSnapshotType2, ModelCreationType2, _NotCustomized } from "../../internal"; | ||
export declare type ITypeDispatcher = (snapshot: any) => IAnyType; | ||
@@ -7,18 +7,21 @@ export interface UnionOptions { | ||
} | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>): IModelType<PA | PB, OA | OB, CA | CB, SA | SB, TA | TB>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB>(options: UnionOptions, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>): IModelType<PA | PB, OA | OB, CA | CB, SA | SB, TA | TB>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>): IModelType<PA | PB | PC, OA | OB | OC, CA | CB | CC, SA | SB | SC, TA | TB | TC>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC>(options: UnionOptions, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>): IModelType<PA | PB | PC, OA | OB | OC, CA | CB | CC, SA | SB | SC, TA | TB | TC>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>): IModelType<PA | PB | PC | PD, OA | OB | OC | OD, CA | CB | CC | CD, SA | SB | SC | SD, TA | TB | TC | TD>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD>(options: UnionOptions, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>): IModelType<PA | PB | PC | PD, OA | OB | OC | OD, CA | CB | CC | CD, SA | SB | SC | SD, TA | TB | TC | TD>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>): IModelType<PA | PB | PC | PD | PE, OA | OB | OC | OD | OE, CA | CB | CC | CD | CE, SA | SB | SC | SD | SE, TA | TB | TC | TD | TE>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE>(options: UnionOptions, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>): IModelType<PA | PB | PC | PD | PE, OA | OB | OC | OD | OE, CA | CB | CC | CD | CE, SA | SB | SC | SD | SE, TA | TB | TC | TD | TE>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>): IModelType<PA | PB | PC | PD | PE | PF, OA | OB | OC | OD | OE | OF, CA | CB | CC | CD | CE | CF, SA | SB | SC | SD | SE | SF, TA | TB | TC | TD | TE | TF>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF>(options: UnionOptions, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>): IModelType<PA | PB | PC | PD | PE | PF, OA | OB | OC | OD | OE | OF, CA | CB | CC | CD | CE | CF, SA | SB | SC | SD | SE | SF, TA | TB | TC | TD | TE | TF>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>): IModelType<PA | PB | PC | PD | PE | PF | PG, OA | OB | OC | OD | OE | OF | OG, CA | CB | CC | CD | CE | CF | CG, SA | SB | SC | SD | SE | SF | SG, TA | TB | TC | TD | TE | TF | TG>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG>(options: UnionOptions, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>): IModelType<PA | PB | PC | PD | PE | PF | PG, OA | OB | OC | OD | OE | OF | OG, CA | CB | CC | CD | CE | CF | CG, SA | SB | SC | SD | SE | SF | SG, TA | TB | TC | TD | TE | TF | TG>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG, PH extends ModelProperties, OH, CH, SH, TH>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>, H: IModelType<PH, OH, CH, SH, TH>): IModelType<PA | PB | PC | PD | PE | PF | PG | PH, OA | OB | OC | OD | OE | OF | OG | OH, CA | CB | CC | CD | CE | CF | CG | CH, SA | SB | SC | SD | SE | SF | SG | SH, TA | TB | TC | TD | TE | TF | TG | TH>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG, PH extends ModelProperties, OH, CH, SH, TH>(options: UnionOptions, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>, H: IModelType<PH, OH, CH, SH, TH>): IModelType<PA | PB | PC | PD | PE | PF | PG | PH, OA | OB | OC | OD | OE | OF | OG | OH, CA | CB | CC | CD | CE | CF | CG | CH, SA | SB | SC | SD | SE | SF | SG | SH, TA | TB | TC | TD | TE | TF | TG | TH>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG, PH extends ModelProperties, OH, CH, SH, TH, PI extends ModelProperties, OI, CI, SI, TI>(A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>, H: IModelType<PH, OH, CH, SH, TH>, I: IModelType<PI, OI, CI, SI, TI>): IModelType<PA | PB | PC | PD | PE | PF | PG | PH | PI, OA | OB | OC | OD | OE | OF | OG | OH | OI, CA | CB | CC | CD | CE | CF | CG | CH | CI, SA | SB | SC | SD | SE | SF | SG | SH | SI, TA | TB | TC | TD | TE | TF | TG | TH | TI>; | ||
export declare function union<PA extends ModelProperties, OA, CA, SA, TA, PB extends ModelProperties, OB, CB, SB, TB, PC extends ModelProperties, OC, CC, SC, TC, PD extends ModelProperties, OD, CD, SD, TD, PE extends ModelProperties, OE, CE, SE, TE, PF extends ModelProperties, OF, CF, SF, TF, PG extends ModelProperties, OG, CG, SG, TG, PH extends ModelProperties, OH, CH, SH, TH, PI extends ModelProperties, OI, CI, SI, TI>(options: UnionOptions, A: IModelType<PA, OA, CA, SA, TA>, B: IModelType<PB, OB, CB, SB, TB>, C: IModelType<PC, OC, CC, SC, TC>, D: IModelType<PD, OD, CD, SD, TD>, E: IModelType<PE, OE, CE, SE, TE>, F: IModelType<PF, OF, CF, SF, TF>, G: IModelType<PG, OG, CG, SG, TG>, H: IModelType<PH, OH, CH, SH, TH>, I: IModelType<PI, OI, CI, SI, TI>): IModelType<PA | PB | PC | PD | PE | PF | PG | PH | PI, OA | OB | OC | OD | OE | OF | OG | OH | OI, CA | CB | CC | CD | CE | CF | CG | CH | CI, SA | SB | SC | SD | SE | SF | SG | SH | SI, TA | TB | TC | TD | TE | TF | TG | TH | TI>; | ||
export declare type _CustomCSProcessor<T> = Exclude<T, _NotCustomized> extends never ? _NotCustomized : Exclude<T, _NotCustomized>; | ||
export interface ModelUnion<C, S, T> extends IComplexType<_CustomCSProcessor<C>, _CustomCSProcessor<S>, T> { | ||
} | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH, PI extends ModelProperties, OI, FCI, FSI>(A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>, I: IModelType<PI, OI, FCI, FSI>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH> | ModelCreationType2<PI, FCI>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH> | ModelSnapshotType2<PI, FSI>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH> | ModelInstanceType<PI, OI, FCI, FSI>>; | ||
export declare function union<PA extends ModelProperties, OA, FCA, FSA, PB extends ModelProperties, OB, FCB, FSB, PC extends ModelProperties, OC, FCC, FSC, PD extends ModelProperties, OD, FCD, FSD, PE extends ModelProperties, OE, FCE, FSE, PF extends ModelProperties, OF, FCF, FSF, PG extends ModelProperties, OG, FCG, FSG, PH extends ModelProperties, OH, FCH, FSH, PI extends ModelProperties, OI, FCI, FSI>(options: UnionOptions, A: IModelType<PA, OA, FCA, FSA>, B: IModelType<PB, OB, FCB, FSB>, C: IModelType<PC, OC, FCC, FSC>, D: IModelType<PD, OD, FCD, FSD>, E: IModelType<PE, OE, FCE, FSE>, F: IModelType<PF, OF, FCF, FSF>, G: IModelType<PG, OG, FCG, FSG>, H: IModelType<PH, OH, FCH, FSH>, I: IModelType<PI, OI, FCI, FSI>): ModelUnion<ModelCreationType2<PA, FCA> | ModelCreationType2<PB, FCB> | ModelCreationType2<PC, FCC> | ModelCreationType2<PD, FCD> | ModelCreationType2<PE, FCE> | ModelCreationType2<PF, FCF> | ModelCreationType2<PG, FCG> | ModelCreationType2<PH, FCH> | ModelCreationType2<PI, FCI>, ModelSnapshotType2<PA, FSA> | ModelSnapshotType2<PB, FSB> | ModelSnapshotType2<PC, FSC> | ModelSnapshotType2<PD, FSD> | ModelSnapshotType2<PE, FSE> | ModelSnapshotType2<PF, FSF> | ModelSnapshotType2<PG, FSG> | ModelSnapshotType2<PH, FSH> | ModelSnapshotType2<PI, FSI>, ModelInstanceType<PA, OA, FCA, FSA> | ModelInstanceType<PB, OB, FCB, FSB> | ModelInstanceType<PC, OC, FCC, FSC> | ModelInstanceType<PD, OD, FCD, FSD> | ModelInstanceType<PE, OE, FCE, FSE> | ModelInstanceType<PF, OF, FCF, FSF> | ModelInstanceType<PG, OG, FCG, FSG> | ModelInstanceType<PH, OH, FCH, FSH> | ModelInstanceType<PI, OI, FCI, FSI>>; | ||
export declare function union<CA, SA, TA, CB, SB, TB>(A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>): IComplexType<CA | CB, SA | SB, TA | TB>; | ||
@@ -25,0 +28,0 @@ export declare function union<CA, SA, TA, CB, SB, TB>(options: UnionOptions, A: IComplexType<CA, SA, TA>, B: IComplexType<CB, SB, TB>): IComplexType<CA | CB, SA | SB, TA | TB>; |
{ | ||
"name": "mobx-state-tree", | ||
"version": "3.5.0", | ||
"version": "3.6.0", | ||
"description": "Opinionated, transactional, MobX powered state container", | ||
@@ -10,3 +10,3 @@ "main": "dist/mobx-state-tree.js", | ||
"scripts": { | ||
"build": "tsc && cpr lib dist --delete-first --filter=\\\\.js && yarn rollup", | ||
"build": "shx cp ../../README.md . && tsc && cpr lib dist --delete-first --filter=\\\\.js && yarn rollup", | ||
"rollup": "rollup -c", | ||
@@ -72,3 +72,4 @@ "jest": "jest --testPathPattern=/__tests__/core/", | ||
"state management" | ||
] | ||
], | ||
"gitHead": "5f2da6738b0ef39c3abd5172681761f02f38e790" | ||
} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
659952
38
12308
0
1528