From 03c0f726c469872b0a3b0b7adad472d79f82fffc Mon Sep 17 00:00:00 2001 From: Mesmo Date: Wed, 2 Jan 2019 16:13:06 +0000 Subject: [PATCH] Prep v7.2.7 release --- docs/lib/state.js | 2 +- examples/node/events.js | 2 +- lib/node/runtime/core.js | 1 - lib/web/state.js | 2 +- package.json | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/docs/lib/state.js b/docs/lib/state.js index 00a52c4..c23d4e0 100644 --- a/docs/lib/state.js +++ b/docs/lib/state.js @@ -1 +1 @@ -var state=function(t){var n={};function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}return e.m=t,e.c=n,e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:i})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var i=Object.create(null);if(e.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var r in t)e.d(i,r,function(n){return t[n]}.bind(null,r));return i},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=10)}([function(t,n,e){"use strict";n.__esModule=!0;var i=e(11);n.assert=i.assert;var r=e(12);n.log=r.log;var o=e(13);n.random=o.random;var a=e(14);n.tree=a.tree},function(t,n,e){"use strict";n.__esModule=!0;var i=e(7);!function(t){t[t.external=0]="external",t[t.internal=1]="internal",t[t.local=2]="local"}(n.TransitionKind||(n.TransitionKind={})),function(t){t.map=[i.ExternalTransitionActivation,i.InternalTransitionActivation,i.LocalTransitionActivation]}(n.TransitionKind||(n.TransitionKind={}))},function(t,n,e){"use strict";n.__esModule=!0;var i=e(5);n.PseudoStateKind=i.PseudoStateKind;var r=e(3);n.State=r.State;var o=e(6);n.Region=o.Region;var a=e(8);n.PseudoState=a.PseudoState;var s=e(4);n.Transition=s.Transition;var u=e(1);n.TransitionKind=u.TransitionKind;var c=e(7);n.ExternalTransitionActivation=c.ExternalTransitionActivation,n.LocalTransitionActivation=c.LocalTransitionActivation,n.InternalTransitionActivation=c.InternalTransitionActivation},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(6),o=e(4),a=e(1),s=function(){function t(n,e){void 0===e&&(e=void 0);var r=this;this.name=n,this.outgoing=[],this.children=[],this.onEnter=[],this.onLeave=[],this.deferrableTrigger=[],this.parent=e instanceof t?e.getDefaultRegion():e,this.parent?(i.assert.ok(!this.parent.children.filter(function(n){return n instanceof t&&n.name===r.name}).length,function(){return"State names must be unique within a region"}),this.qualifiedName=this.parent+"."+n,this.parent.children.unshift(this)):this.qualifiedName=n,i.log.info(function(){return"Created state "+r},i.log.Create)}return t.prototype.getDefaultRegion=function(){return this.defaultRegion||(this.defaultRegion=new r.Region(this.name,this))},t.prototype.isSimple=function(){return 0===this.children.length},t.prototype.isComposite=function(){return this.children.length>=1},t.prototype.isOrthogonal=function(){return this.children.length>=2},t.prototype.isFinal=function(){return 0===this.outgoing.length},t.prototype.entry=function(t){return this.onEnter.unshift(t),this},t.prototype.exit=function(t){return this.onLeave.unshift(t),this},t.prototype.on=function(t){return new o.Transition(this,void 0,a.TransitionKind.internal,t)},t.prototype.when=function(t){return new o.Transition(this,void 0,a.TransitionKind.internal,void 0,t)},t.prototype.external=function(t){return this.to(t)},t.prototype.to=function(t){return void 0===t&&(t=void 0),new o.Transition(this,t)},t.prototype.internal=function(){return this.to()},t.prototype.local=function(t){return new o.Transition(this,t,a.TransitionKind.local)},t.prototype.defer=function(t){return this.deferrableTrigger.unshift(t),this},t.prototype.getTransition=function(t){for(var n,e=this,r=this.outgoing.length;r--;)this.outgoing[r].evaluate(t)&&(i.assert.ok(!n,function(){return"Multiple transitions found at "+e+" for "+t}),n=this.outgoing[r]);return n},t.prototype.doEnter=function(t){for(var n=this.onEnter.length;n--;)this.onEnter[n](t)},t.prototype.doLeave=function(t){for(var n=this.onLeave.length;n--;)this.onLeave[n](t)},t.prototype.toString=function(){return this.qualifiedName},t}();n.State=s},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(1),o=function(){function t(t,n,e,o,a){void 0===n&&(n=void 0),void 0===e&&(e=n?r.TransitionKind.external:r.TransitionKind.internal),void 0===o&&(o=void 0),void 0===a&&(a=function(){return!0});var s=this;this.userGuard=function(){return!0},this.actions=[],this.source=t,this.target=n||t,this.activation=new r.TransitionKind.map[e](this.source,this.target),this.typeGuard=o?function(t){return t.constructor===o}:function(){return!0},this.userGuard=a,t.outgoing.unshift(this),i.log.info(function(){return"Created "+s},i.log.Create)}return t.prototype.on=function(t){return this.typeGuard=function(n){return n.constructor===t},this},t.prototype.when=function(t){return this.userGuard=t,this},t.prototype.to=function(t,n){var e=this;return void 0===n&&(n=r.TransitionKind.external),this.target=t,this.activation=new r.TransitionKind.map[n](this.source,this.target),i.log.info(function(){return"- converted to "+e},i.log.Create),this},t.prototype.do=function(t){return this.actions.unshift(t),this},t.prototype.evaluate=function(t){return this.typeGuard(t)&&this.userGuard(t)},t.prototype.doActions=function(t){for(var n=this.actions.length;n--;)this.actions[n](t)},t.prototype.if=function(t){return this.when(t)},t.prototype.local=function(t){return void 0===t&&(t=void 0),(this.target=t||this.target)&&(this.activation=new r.TransitionKind.map[r.TransitionKind.local](this.source,this.target)),this},t.prototype.effect=function(t){return this.do(t)},t.prototype.toString=function(){return this.activation+" transition from "+this.source+" to "+this.target},t}();n.Transition=o},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.Initial="initial",t.ShallowHistory="shallow history",t.DeepHistory="deep history",t.Junction="junction",t.Choice="choice"}(n.PseudoStateKind||(n.PseudoStateKind={}))},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=function(){function t(t,n){var e=this;this.name=t,this.parent=n,this.children=[],this.qualifiedName=n+"."+t,this.parent.children.unshift(this),i.log.info(function(){return"Created region "+e},i.log.Create)}return t.prototype.toString=function(){return this.qualifiedName},t}();n.Region=r},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(8),o=e(3),a=function(){function t(t,n){var e=i.tree.ancestors(t,function(t){return t.parent}),o=i.tree.ancestors(n,function(t){return t.parent}),a=i.tree.lca(e,o)+1,s=o.length-(n instanceof r.PseudoState&&n.isHistory()?1:0);this.toExit=e[a],this.toEnter=o.slice(a,s).reverse()}return t.prototype.toString=function(){return"external"},t}();n.ExternalTransitionActivation=a;var s=function(){function t(t,n){this.target=n}return t.prototype.toString=function(){return"local"},t}();n.LocalTransitionActivation=s;var u=function(){function t(t,n){if(!(t instanceof o.State))throw new Error("Source of local transition must be a State.");this.source=t}return t.prototype.toString=function(){return"internal"},t}();n.InternalTransitionActivation=u},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(5),o=e(3),a=e(4),s=e(1),u=function(){function t(t,n,e){void 0===e&&(e=r.PseudoStateKind.Initial);var a=this;this.name=t,this.kind=e,this.outgoing=[],this.parent=n instanceof o.State?n.getDefaultRegion():n,this.qualifiedName=this.parent+"."+this.name,(this.kind===r.PseudoStateKind.Initial||this.isHistory())&&(i.assert.ok(!this.parent.starting,function(){return"Only one initial pseudo state is allowed in region "+a.parent}),this.parent.starting=this),this.parent.children.unshift(this),i.log.info(function(){return"Created "+a.kind+" pseudo state "+a},i.log.Create)}return t.prototype.isHistory=function(){return this.kind===r.PseudoStateKind.DeepHistory||this.kind===r.PseudoStateKind.ShallowHistory},t.prototype.on=function(t){return new a.Transition(this,void 0,s.TransitionKind.internal,t)},t.prototype.when=function(t){return new a.Transition(this,void 0,s.TransitionKind.internal,void 0,t)},t.prototype.to=function(t){return new a.Transition(this,t)},t.prototype.external=function(t){return this.to(t)},t.prototype.else=function(t){var n=this;return i.assert.ok(this.kind===r.PseudoStateKind.Choice||this.kind===r.PseudoStateKind.Junction,function(){return"Else transitions are only valid at Choice and Junction pseudo states"}),i.assert.ok(!this.elseTransition,function(){return"Only 1 else transition allowed at "+n}),this.elseTransition=new a.Transition(this,t,s.TransitionKind.external,void 0,function(){return!1})},t.prototype.getTransition=function(t){var n=this.kind===r.PseudoStateKind.Choice?this.getChoiceTransition(t):this.getOtherTransition(t);if(!n)throw new Error("No outgoing transition found at "+this);return n},t.prototype.getChoiceTransition=function(t){for(var n=[],e=this.outgoing.length;e--;)this.outgoing[e].evaluate(t)&&n.push(this.outgoing[e]);return n[i.random.get(n.length)]||this.elseTransition},t.prototype.getOtherTransition=function(t){for(var n,e=this.outgoing.length;e--;)this.outgoing[e].evaluate(t)&&(n=this.outgoing[e]);return n||this.elseTransition},t.prototype.toString=function(){return this.qualifiedName},t}();n.PseudoState=u},function(t,n,e){"use strict";n.__esModule=!0;var i=e(15);n.Instance=i.Instance;var r=e(16);n.evaluate=r.evaluate},function(t,n,e){"use strict";n.__esModule=!0;var i=e(2);n.PseudoStateKind=i.PseudoStateKind,n.State=i.State,n.Region=i.Region,n.PseudoState=i.PseudoState,n.Transition=i.Transition,n.TransitionKind=i.TransitionKind;var r=e(9);n.Instance=r.Instance;var o=e(0);n.log=o.log,n.random=o.random},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.ok=function(t,n){if(!t)throw new Error(n())}}(n.assert||(n.assert={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.Create=1,t.Entry=2,t.Exit=4,t.Evaluate=8,t.Transition=16,t.Transaction=32,t.User=64,t.All=t.Create|t.Entry|t.Exit|t.Evaluate|t.Transition|t.Transaction|t.User;var n=[];t.add=function(e,i){return void 0===i&&(i=t.All),n.push({callback:e,category:i})-1},t.remove=function(t){n[t]=void 0},t.info=function(t,e){for(var i,r=n.length;r--;){var o=n[r];o&&o.category&e&&o.callback(i||(i=t()))}}}(n.log||(n.log={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.get=function(t){return Math.floor(Math.random()*t)},t.set=function(n){var e=t.get;return t.get=n,e}}(n.random||(n.random={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.ancestors=function(t,n){for(var e=[];t;)e.unshift(t),t=n(t);return e},t.lca=function(t,n){for(var e=Math.min(t.length,n.length),i=0;i=1},t.prototype.isOrthogonal=function(){return this.children.length>=2},t.prototype.isFinal=function(){return 0===this.outgoing.length},t.prototype.entry=function(t){return this.onEnter.unshift(t),this},t.prototype.exit=function(t){return this.onLeave.unshift(t),this},t.prototype.on=function(t){return new o.Transition(this,void 0,a.TransitionKind.internal,t)},t.prototype.when=function(t){return new o.Transition(this,void 0,a.TransitionKind.internal,void 0,t)},t.prototype.external=function(t){return this.to(t)},t.prototype.to=function(t){return void 0===t&&(t=void 0),new o.Transition(this,t)},t.prototype.internal=function(){return this.to()},t.prototype.local=function(t){return new o.Transition(this,t,a.TransitionKind.local)},t.prototype.defer=function(t){return this.deferrableTrigger.unshift(t),this},t.prototype.getTransition=function(t){for(var n,e=this,r=this.outgoing.length;r--;)this.outgoing[r].evaluate(t)&&(i.assert.ok(!n,function(){return"Multiple transitions found at "+e+" for "+t}),n=this.outgoing[r]);return n},t.prototype.doEnter=function(t){for(var n=this.onEnter.length;n--;)this.onEnter[n](t)},t.prototype.doLeave=function(t){for(var n=this.onLeave.length;n--;)this.onLeave[n](t)},t.prototype.toString=function(){return this.qualifiedName},t}();n.State=s},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(1),o=function(){function t(t,n,e,o,a){void 0===n&&(n=void 0),void 0===e&&(e=n?r.TransitionKind.external:r.TransitionKind.internal),void 0===o&&(o=void 0),void 0===a&&(a=function(){return!0});var s=this;this.userGuard=function(){return!0},this.actions=[],this.source=t,this.target=n||t,this.activation=new r.TransitionKind.map[e](this.source,this.target),this.typeGuard=o?function(t){return t.constructor===o}:function(){return!0},this.userGuard=a,t.outgoing.unshift(this),i.log.info(function(){return"Created "+s},i.log.Create)}return t.prototype.on=function(t){return this.typeGuard=function(n){return n.constructor===t},this},t.prototype.when=function(t){return this.userGuard=t,this},t.prototype.to=function(t,n){var e=this;return void 0===n&&(n=r.TransitionKind.external),this.target=t,this.activation=new r.TransitionKind.map[n](this.source,this.target),i.log.info(function(){return"- converted to "+e},i.log.Create),this},t.prototype.do=function(t){return this.actions.unshift(t),this},t.prototype.evaluate=function(t){return this.typeGuard(t)&&this.userGuard(t)},t.prototype.doActions=function(t){for(var n=this.actions.length;n--;)this.actions[n](t)},t.prototype.if=function(t){return this.when(t)},t.prototype.local=function(t){return void 0===t&&(t=void 0),(this.target=t||this.target)&&(this.activation=new r.TransitionKind.map[r.TransitionKind.local](this.source,this.target)),this},t.prototype.effect=function(t){return this.do(t)},t.prototype.toString=function(){return this.activation+" transition from "+this.source+" to "+this.target},t}();n.Transition=o},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.Initial="initial",t.ShallowHistory="shallow history",t.DeepHistory="deep history",t.Junction="junction",t.Choice="choice"}(n.PseudoStateKind||(n.PseudoStateKind={}))},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=function(){function t(t,n){var e=this;this.name=t,this.parent=n,this.children=[],this.qualifiedName=n+"."+t,this.parent.children.unshift(this),i.log.info(function(){return"Created region "+e},i.log.Create)}return t.prototype.toString=function(){return this.qualifiedName},t}();n.Region=r},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(8),o=e(3),a=function(){function t(t,n){var e=i.tree.ancestors(t,function(t){return t.parent}),o=i.tree.ancestors(n,function(t){return t.parent}),a=i.tree.lca(e,o)+1,s=o.length-(n instanceof r.PseudoState&&n.isHistory()?1:0);this.toExit=e[a],this.toEnter=o.slice(a,s).reverse()}return t.prototype.toString=function(){return"external"},t}();n.ExternalTransitionActivation=a;var s=function(){function t(t,n){this.target=n}return t.prototype.toString=function(){return"local"},t}();n.LocalTransitionActivation=s;var u=function(){function t(t,n){if(!(t instanceof o.State))throw new Error("Source of local transition must be a State.");this.source=t}return t.prototype.toString=function(){return"internal"},t}();n.InternalTransitionActivation=u},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(5),o=e(3),a=e(4),s=e(1),u=function(){function t(t,n,e){void 0===e&&(e=r.PseudoStateKind.Initial);var a=this;this.name=t,this.kind=e,this.outgoing=[],this.parent=n instanceof o.State?n.getDefaultRegion():n,this.qualifiedName=this.parent+"."+this.name,(this.kind===r.PseudoStateKind.Initial||this.isHistory())&&(i.assert.ok(!this.parent.starting,function(){return"Only one initial pseudo state is allowed in region "+a.parent}),this.parent.starting=this),this.parent.children.unshift(this),i.log.info(function(){return"Created "+a.kind+" pseudo state "+a},i.log.Create)}return t.prototype.isHistory=function(){return this.kind===r.PseudoStateKind.DeepHistory||this.kind===r.PseudoStateKind.ShallowHistory},t.prototype.on=function(t){return new a.Transition(this,void 0,s.TransitionKind.internal,t)},t.prototype.when=function(t){return new a.Transition(this,void 0,s.TransitionKind.internal,void 0,t)},t.prototype.to=function(t){return new a.Transition(this,t)},t.prototype.external=function(t){return this.to(t)},t.prototype.else=function(t){var n=this;return i.assert.ok(this.kind===r.PseudoStateKind.Choice||this.kind===r.PseudoStateKind.Junction,function(){return"Else transitions are only valid at Choice and Junction pseudo states"}),i.assert.ok(!this.elseTransition,function(){return"Only 1 else transition allowed at "+n}),this.elseTransition=new a.Transition(this,t,s.TransitionKind.external,void 0,function(){return!1})},t.prototype.getTransition=function(t){var n=this.kind===r.PseudoStateKind.Choice?this.getChoiceTransition(t):this.getOtherTransition(t);if(!n)throw new Error("No outgoing transition found at "+this);return n},t.prototype.getChoiceTransition=function(t){for(var n=[],e=this.outgoing.length;e--;)this.outgoing[e].evaluate(t)&&n.push(this.outgoing[e]);return n[i.random.get(n.length)]||this.elseTransition},t.prototype.getOtherTransition=function(t){for(var n,e=this.outgoing.length;e--;)this.outgoing[e].evaluate(t)&&(n=this.outgoing[e]);return n||this.elseTransition},t.prototype.toString=function(){return this.qualifiedName},t}();n.PseudoState=u},function(t,n,e){"use strict";n.__esModule=!0;var i=e(15);n.Instance=i.Instance;var r=e(16);n.evaluate=r.evaluate},function(t,n,e){"use strict";n.__esModule=!0;var i=e(2);n.PseudoStateKind=i.PseudoStateKind,n.State=i.State,n.Region=i.Region,n.PseudoState=i.PseudoState,n.Transition=i.Transition,n.TransitionKind=i.TransitionKind;var r=e(9);n.Instance=r.Instance;var o=e(0);n.log=o.log,n.random=o.random},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.ok=function(t,n){if(!t)throw new Error(n())}}(n.assert||(n.assert={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.Create=1,t.Entry=2,t.Exit=4,t.Evaluate=8,t.Transition=16,t.Transaction=32,t.User=64,t.All=t.Create|t.Entry|t.Exit|t.Evaluate|t.Transition|t.Transaction|t.User;var n=[];t.add=function(e,i){return void 0===i&&(i=t.All),n.push({callback:e,category:i})-1},t.remove=function(t){n[t]=void 0},t.info=function(t,e){for(var i,r=n.length;r--;){var o=n[r];o&&o.category&e&&o.callback(i||(i=t()))}}}(n.log||(n.log={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.get=function(t){return Math.floor(Math.random()*t)},t.set=function(n){var e=t.get;return t.get=n,e}}(n.random||(n.random={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.ancestors=function(t,n){for(var e=[];t;)e.unshift(t),t=n(t);return e},t.lca=function(t,n){for(var e=Math.min(t.length,n.length),i=0;i=1},t.prototype.isOrthogonal=function(){return this.children.length>=2},t.prototype.isFinal=function(){return 0===this.outgoing.length},t.prototype.entry=function(t){return this.onEnter.unshift(t),this},t.prototype.exit=function(t){return this.onLeave.unshift(t),this},t.prototype.on=function(t){return new o.Transition(this,void 0,a.TransitionKind.internal,t)},t.prototype.when=function(t){return new o.Transition(this,void 0,a.TransitionKind.internal,void 0,t)},t.prototype.external=function(t){return this.to(t)},t.prototype.to=function(t){return void 0===t&&(t=void 0),new o.Transition(this,t)},t.prototype.internal=function(){return this.to()},t.prototype.local=function(t){return new o.Transition(this,t,a.TransitionKind.local)},t.prototype.defer=function(t){return this.deferrableTrigger.unshift(t),this},t.prototype.getTransition=function(t){for(var n,e=this,r=this.outgoing.length;r--;)this.outgoing[r].evaluate(t)&&(i.assert.ok(!n,function(){return"Multiple transitions found at "+e+" for "+t}),n=this.outgoing[r]);return n},t.prototype.doEnter=function(t){for(var n=this.onEnter.length;n--;)this.onEnter[n](t)},t.prototype.doLeave=function(t){for(var n=this.onLeave.length;n--;)this.onLeave[n](t)},t.prototype.toString=function(){return this.qualifiedName},t}();n.State=s},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(1),o=function(){function t(t,n,e,o,a){void 0===n&&(n=void 0),void 0===e&&(e=n?r.TransitionKind.external:r.TransitionKind.internal),void 0===o&&(o=void 0),void 0===a&&(a=function(){return!0});var s=this;this.userGuard=function(){return!0},this.actions=[],this.source=t,this.target=n||t,this.activation=new r.TransitionKind.map[e](this.source,this.target),this.typeGuard=o?function(t){return t.constructor===o}:function(){return!0},this.userGuard=a,t.outgoing.unshift(this),i.log.info(function(){return"Created "+s},i.log.Create)}return t.prototype.on=function(t){return this.typeGuard=function(n){return n.constructor===t},this},t.prototype.when=function(t){return this.userGuard=t,this},t.prototype.to=function(t,n){var e=this;return void 0===n&&(n=r.TransitionKind.external),this.target=t,this.activation=new r.TransitionKind.map[n](this.source,this.target),i.log.info(function(){return"- converted to "+e},i.log.Create),this},t.prototype.do=function(t){return this.actions.unshift(t),this},t.prototype.evaluate=function(t){return this.typeGuard(t)&&this.userGuard(t)},t.prototype.doActions=function(t){for(var n=this.actions.length;n--;)this.actions[n](t)},t.prototype.if=function(t){return this.when(t)},t.prototype.local=function(t){return void 0===t&&(t=void 0),(this.target=t||this.target)&&(this.activation=new r.TransitionKind.map[r.TransitionKind.local](this.source,this.target)),this},t.prototype.effect=function(t){return this.do(t)},t.prototype.toString=function(){return this.activation+" transition from "+this.source+" to "+this.target},t}();n.Transition=o},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.Initial="initial",t.ShallowHistory="shallow history",t.DeepHistory="deep history",t.Junction="junction",t.Choice="choice"}(n.PseudoStateKind||(n.PseudoStateKind={}))},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=function(){function t(t,n){var e=this;this.name=t,this.parent=n,this.children=[],this.qualifiedName=n+"."+t,this.parent.children.unshift(this),i.log.info(function(){return"Created region "+e},i.log.Create)}return t.prototype.toString=function(){return this.qualifiedName},t}();n.Region=r},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(8),o=e(3),a=function(){function t(t,n){var e=i.tree.ancestors(t,function(t){return t.parent}),o=i.tree.ancestors(n,function(t){return t.parent}),a=i.tree.lca(e,o)+1,s=o.length-(n instanceof r.PseudoState&&n.isHistory()?1:0);this.toExit=e[a],this.toEnter=o.slice(a,s).reverse()}return t.prototype.toString=function(){return"external"},t}();n.ExternalTransitionActivation=a;var s=function(){function t(t,n){this.target=n}return t.prototype.toString=function(){return"local"},t}();n.LocalTransitionActivation=s;var u=function(){function t(t,n){if(!(t instanceof o.State))throw new Error("Source of local transition must be a State.");this.source=t}return t.prototype.toString=function(){return"internal"},t}();n.InternalTransitionActivation=u},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(5),o=e(3),a=e(4),s=e(1),u=function(){function t(t,n,e){void 0===e&&(e=r.PseudoStateKind.Initial);var a=this;this.name=t,this.kind=e,this.outgoing=[],this.parent=n instanceof o.State?n.getDefaultRegion():n,this.qualifiedName=this.parent+"."+this.name,(this.kind===r.PseudoStateKind.Initial||this.isHistory())&&(i.assert.ok(!this.parent.starting,function(){return"Only one initial pseudo state is allowed in region "+a.parent}),this.parent.starting=this),this.parent.children.unshift(this),i.log.info(function(){return"Created "+a.kind+" pseudo state "+a},i.log.Create)}return t.prototype.isHistory=function(){return this.kind===r.PseudoStateKind.DeepHistory||this.kind===r.PseudoStateKind.ShallowHistory},t.prototype.on=function(t){return new a.Transition(this,void 0,s.TransitionKind.internal,t)},t.prototype.when=function(t){return new a.Transition(this,void 0,s.TransitionKind.internal,void 0,t)},t.prototype.to=function(t){return new a.Transition(this,t)},t.prototype.external=function(t){return this.to(t)},t.prototype.else=function(t){var n=this;return i.assert.ok(this.kind===r.PseudoStateKind.Choice||this.kind===r.PseudoStateKind.Junction,function(){return"Else transitions are only valid at Choice and Junction pseudo states"}),i.assert.ok(!this.elseTransition,function(){return"Only 1 else transition allowed at "+n}),this.elseTransition=new a.Transition(this,t,s.TransitionKind.external,void 0,function(){return!1})},t.prototype.getTransition=function(t){var n=this.kind===r.PseudoStateKind.Choice?this.getChoiceTransition(t):this.getOtherTransition(t);if(!n)throw new Error("No outgoing transition found at "+this);return n},t.prototype.getChoiceTransition=function(t){for(var n=[],e=this.outgoing.length;e--;)this.outgoing[e].evaluate(t)&&n.push(this.outgoing[e]);return n[i.random.get(n.length)]||this.elseTransition},t.prototype.getOtherTransition=function(t){for(var n,e=this.outgoing.length;e--;)this.outgoing[e].evaluate(t)&&(n=this.outgoing[e]);return n||this.elseTransition},t.prototype.toString=function(){return this.qualifiedName},t}();n.PseudoState=u},function(t,n,e){"use strict";n.__esModule=!0;var i=e(15);n.Instance=i.Instance;var r=e(16);n.evaluate=r.evaluate},function(t,n,e){"use strict";n.__esModule=!0;var i=e(2);n.PseudoStateKind=i.PseudoStateKind,n.State=i.State,n.Region=i.Region,n.PseudoState=i.PseudoState,n.Transition=i.Transition,n.TransitionKind=i.TransitionKind;var r=e(9);n.Instance=r.Instance;var o=e(0);n.log=o.log,n.random=o.random},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.ok=function(t,n){if(!t)throw new Error(n())}}(n.assert||(n.assert={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.Create=1,t.Entry=2,t.Exit=4,t.Evaluate=8,t.Transition=16,t.Transaction=32,t.User=64,t.All=t.Create|t.Entry|t.Exit|t.Evaluate|t.Transition|t.Transaction|t.User;var n=[];t.add=function(e,i){return void 0===i&&(i=t.All),n.push({callback:e,category:i})-1},t.remove=function(t){n[t]=void 0},t.info=function(t,e){for(var i,r=n.length;r--;){var o=n[r];o&&o.category&e&&o.callback(i||(i=t()))}}}(n.log||(n.log={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.get=function(t){return Math.floor(Math.random()*t)},t.set=function(n){var e=t.get;return t.get=n,e}}(n.random||(n.random={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.ancestors=function(t,n){for(var e=[];t;)e.unshift(t),t=n(t);return e},t.lca=function(t,n){for(var e=Math.min(t.length,n.length),i=0;i=1},t.prototype.isOrthogonal=function(){return this.children.length>=2},t.prototype.isFinal=function(){return 0===this.outgoing.length},t.prototype.entry=function(t){return this.onEnter.unshift(t),this},t.prototype.exit=function(t){return this.onLeave.unshift(t),this},t.prototype.on=function(t){return new o.Transition(this,void 0,a.TransitionKind.internal,t)},t.prototype.when=function(t){return new o.Transition(this,void 0,a.TransitionKind.internal,void 0,t)},t.prototype.external=function(t){return this.to(t)},t.prototype.to=function(t){return void 0===t&&(t=void 0),new o.Transition(this,t)},t.prototype.internal=function(){return this.to()},t.prototype.local=function(t){return new o.Transition(this,t,a.TransitionKind.local)},t.prototype.defer=function(t){return this.deferrableTrigger.unshift(t),this},t.prototype.getTransition=function(t){for(var n,e=this,r=this.outgoing.length;r--;)this.outgoing[r].evaluate(t)&&(i.assert.ok(!n,function(){return"Multiple transitions found at "+e+" for "+t}),n=this.outgoing[r]);return n},t.prototype.doEnter=function(t){for(var n=this.onEnter.length;n--;)this.onEnter[n](t)},t.prototype.doLeave=function(t){for(var n=this.onLeave.length;n--;)this.onLeave[n](t)},t.prototype.toString=function(){return this.qualifiedName},t}();n.State=s},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(1),o=function(){function t(t,n,e,o,a){void 0===n&&(n=void 0),void 0===e&&(e=n?r.TransitionKind.external:r.TransitionKind.internal),void 0===o&&(o=void 0),void 0===a&&(a=function(){return!0});var s=this;this.userGuard=function(){return!0},this.actions=[],this.source=t,this.target=n||t,this.activation=new r.TransitionKind.map[e](this.source,this.target),this.typeGuard=o?function(t){return t.constructor===o}:function(){return!0},this.userGuard=a,t.outgoing.unshift(this),i.log.info(function(){return"Created "+s},i.log.Create)}return t.prototype.on=function(t){return this.typeGuard=function(n){return n.constructor===t},this},t.prototype.when=function(t){return this.userGuard=t,this},t.prototype.to=function(t,n){var e=this;return void 0===n&&(n=r.TransitionKind.external),this.target=t,this.activation=new r.TransitionKind.map[n](this.source,this.target),i.log.info(function(){return"- converted to "+e},i.log.Create),this},t.prototype.do=function(t){return this.actions.unshift(t),this},t.prototype.evaluate=function(t){return this.typeGuard(t)&&this.userGuard(t)},t.prototype.doActions=function(t){for(var n=this.actions.length;n--;)this.actions[n](t)},t.prototype.if=function(t){return this.when(t)},t.prototype.local=function(t){return void 0===t&&(t=void 0),(this.target=t||this.target)&&(this.activation=new r.TransitionKind.map[r.TransitionKind.local](this.source,this.target)),this},t.prototype.effect=function(t){return this.do(t)},t.prototype.toString=function(){return this.activation+" transition from "+this.source+" to "+this.target},t}();n.Transition=o},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.Initial="initial",t.ShallowHistory="shallow history",t.DeepHistory="deep history",t.Junction="junction",t.Choice="choice"}(n.PseudoStateKind||(n.PseudoStateKind={}))},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=function(){function t(t,n){var e=this;this.name=t,this.parent=n,this.children=[],this.qualifiedName=n+"."+t,this.parent.children.unshift(this),i.log.info(function(){return"Created region "+e},i.log.Create)}return t.prototype.toString=function(){return this.qualifiedName},t}();n.Region=r},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(8),o=e(3),a=function(){function t(t,n){var e=i.tree.ancestors(t,function(t){return t.parent}),o=i.tree.ancestors(n,function(t){return t.parent}),a=i.tree.lca(e,o)+1,s=o.length-(n instanceof r.PseudoState&&n.isHistory()?1:0);this.toExit=e[a],this.toEnter=o.slice(a,s).reverse()}return t.prototype.toString=function(){return"external"},t}();n.ExternalTransitionActivation=a;var s=function(){function t(t,n){this.target=n}return t.prototype.toString=function(){return"local"},t}();n.LocalTransitionActivation=s;var u=function(){function t(t,n){if(!(t instanceof o.State))throw new Error("Source of local transition must be a State.");this.source=t}return t.prototype.toString=function(){return"internal"},t}();n.InternalTransitionActivation=u},function(t,n,e){"use strict";n.__esModule=!0;var i=e(0),r=e(5),o=e(3),a=e(4),s=e(1),u=function(){function t(t,n,e){void 0===e&&(e=r.PseudoStateKind.Initial);var a=this;this.name=t,this.kind=e,this.outgoing=[],this.parent=n instanceof o.State?n.getDefaultRegion():n,this.qualifiedName=this.parent+"."+this.name,(this.kind===r.PseudoStateKind.Initial||this.isHistory())&&(i.assert.ok(!this.parent.starting,function(){return"Only one initial pseudo state is allowed in region "+a.parent}),this.parent.starting=this),this.parent.children.unshift(this),i.log.info(function(){return"Created "+a.kind+" pseudo state "+a},i.log.Create)}return t.prototype.isHistory=function(){return this.kind===r.PseudoStateKind.DeepHistory||this.kind===r.PseudoStateKind.ShallowHistory},t.prototype.on=function(t){return new a.Transition(this,void 0,s.TransitionKind.internal,t)},t.prototype.when=function(t){return new a.Transition(this,void 0,s.TransitionKind.internal,void 0,t)},t.prototype.to=function(t){return new a.Transition(this,t)},t.prototype.external=function(t){return this.to(t)},t.prototype.else=function(t){var n=this;return i.assert.ok(this.kind===r.PseudoStateKind.Choice||this.kind===r.PseudoStateKind.Junction,function(){return"Else transitions are only valid at Choice and Junction pseudo states"}),i.assert.ok(!this.elseTransition,function(){return"Only 1 else transition allowed at "+n}),this.elseTransition=new a.Transition(this,t,s.TransitionKind.external,void 0,function(){return!1})},t.prototype.getTransition=function(t){var n=this.kind===r.PseudoStateKind.Choice?this.getChoiceTransition(t):this.getOtherTransition(t);if(!n)throw new Error("No outgoing transition found at "+this);return n},t.prototype.getChoiceTransition=function(t){for(var n=[],e=this.outgoing.length;e--;)this.outgoing[e].evaluate(t)&&n.push(this.outgoing[e]);return n[i.random.get(n.length)]||this.elseTransition},t.prototype.getOtherTransition=function(t){for(var n,e=this.outgoing.length;e--;)this.outgoing[e].evaluate(t)&&(n=this.outgoing[e]);return n||this.elseTransition},t.prototype.toString=function(){return this.qualifiedName},t}();n.PseudoState=u},function(t,n,e){"use strict";n.__esModule=!0;var i=e(15);n.Instance=i.Instance;var r=e(16);n.evaluate=r.evaluate},function(t,n,e){"use strict";n.__esModule=!0;var i=e(2);n.PseudoStateKind=i.PseudoStateKind,n.State=i.State,n.Region=i.Region,n.PseudoState=i.PseudoState,n.Transition=i.Transition,n.TransitionKind=i.TransitionKind;var r=e(9);n.Instance=r.Instance;var o=e(0);n.log=o.log,n.random=o.random},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.ok=function(t,n){if(!t)throw new Error(n())}}(n.assert||(n.assert={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.Create=1,t.Entry=2,t.Exit=4,t.Evaluate=8,t.Transition=16,t.Transaction=32,t.User=64,t.All=t.Create|t.Entry|t.Exit|t.Evaluate|t.Transition|t.Transaction|t.User;var n=[];t.add=function(e,i){return void 0===i&&(i=t.All),n.push({callback:e,category:i})-1},t.remove=function(t){n[t]=void 0},t.info=function(t,e){for(var i,r=n.length;r--;){var o=n[r];o&&o.category&e&&o.callback(i||(i=t()))}}}(n.log||(n.log={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.get=function(t){return Math.floor(Math.random()*t)},t.set=function(n){var e=t.get;return t.get=n,e}}(n.random||(n.random={}))},function(t,n,e){"use strict";n.__esModule=!0,function(t){t.ancestors=function(t,n){for(var e=[];t;)e.unshift(t),t=n(t);return e},t.lca=function(t,n){for(var e=Math.min(t.length,n.length),i=0;i