mage-engine 3.17.9 → 3.17.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/mage.js +1979 -78
  2. package/package.json +1 -1
package/dist/mage.js CHANGED
@@ -1,4 +1,4 @@
1
- import {render}from'inferno';function ownKeys$1(object, enumerableOnly) {
1
+ function ownKeys$1(object, enumerableOnly) {
2
2
  var keys = Object.keys(object);
3
3
 
4
4
  if (Object.getOwnPropertySymbols) {
@@ -473,8 +473,8 @@ function matchesState(parentStateId, childStateId, delimiter) {
473
473
  var parentStateValue = toStateValue(parentStateId, delimiter);
474
474
  var childStateValue = toStateValue(childStateId, delimiter);
475
475
 
476
- if (isString$3(childStateValue)) {
477
- if (isString$3(parentStateValue)) {
476
+ if (isString$4(childStateValue)) {
477
+ if (isString$4(parentStateValue)) {
478
478
  return childStateValue === parentStateValue;
479
479
  } // Parent more specific than child
480
480
 
@@ -482,7 +482,7 @@ function matchesState(parentStateId, childStateId, delimiter) {
482
482
  return false;
483
483
  }
484
484
 
485
- if (isString$3(parentStateValue)) {
485
+ if (isString$4(parentStateValue)) {
486
486
  return parentStateValue in childStateValue;
487
487
  }
488
488
 
@@ -497,7 +497,7 @@ function matchesState(parentStateId, childStateId, delimiter) {
497
497
 
498
498
  function getEventType(event) {
499
499
  try {
500
- return isString$3(event) || typeof event === 'number' ? "" + event : event.type;
500
+ return isString$4(event) || typeof event === 'number' ? "" + event : event.type;
501
501
  } catch (e) {
502
502
  throw new Error('Events must be strings or objects with a string event.type property.');
503
503
  }
@@ -505,7 +505,7 @@ function getEventType(event) {
505
505
 
506
506
  function toStatePath(stateId, delimiter) {
507
507
  try {
508
- if (isArray$3(stateId)) {
508
+ if (isArray$4(stateId)) {
509
509
  return stateId;
510
510
  }
511
511
 
@@ -524,7 +524,7 @@ function toStateValue(stateValue, delimiter) {
524
524
  return stateValue.value;
525
525
  }
526
526
 
527
- if (isArray$3(stateValue)) {
527
+ if (isArray$4(stateValue)) {
528
528
  return pathToStateValue(stateValue);
529
529
  }
530
530
 
@@ -668,7 +668,7 @@ function toStatePaths(stateValue) {
668
668
  return [[]];
669
669
  }
670
670
 
671
- if (isString$3(stateValue)) {
671
+ if (isString$4(stateValue)) {
672
672
  return [[stateValue]];
673
673
  }
674
674
 
@@ -693,7 +693,7 @@ function flatten$1(array) {
693
693
  }
694
694
 
695
695
  function toArrayStrict(value) {
696
- if (isArray$3(value)) {
696
+ if (isArray$4(value)) {
697
697
  return value;
698
698
  }
699
699
 
@@ -711,7 +711,7 @@ function toArray(value) {
711
711
  function mapContext(mapper, context, _event) {
712
712
  var e_5, _a;
713
713
 
714
- if (isFunction$3(mapper)) {
714
+ if (isFunction$4(mapper)) {
715
715
  return mapper(context, _event.data);
716
716
  }
717
717
 
@@ -722,7 +722,7 @@ function mapContext(mapper, context, _event) {
722
722
  var key = _c.value;
723
723
  var subMapper = mapper[key];
724
724
 
725
- if (isFunction$3(subMapper)) {
725
+ if (isFunction$4(subMapper)) {
726
726
  result[key] = subMapper(context, _event.data);
727
727
  } else {
728
728
  result[key] = subMapper;
@@ -753,7 +753,7 @@ function isPromiseLike(value) {
753
753
  } // Check if shape matches the Promise/A+ specification for a "thenable".
754
754
 
755
755
 
756
- if (value !== null && (isFunction$3(value) || typeof value === 'object') && isFunction$3(value.then)) {
756
+ if (value !== null && (isFunction$4(value) || typeof value === 'object') && isFunction$4(value.then)) {
757
757
  return true;
758
758
  }
759
759
 
@@ -798,7 +798,7 @@ function updateHistoryStates(hist, stateValue) {
798
798
  return undefined;
799
799
  }
800
800
 
801
- var subStateValue = (isString$3(stateValue) ? undefined : stateValue[key]) || (subHist ? subHist.current : undefined);
801
+ var subStateValue = (isString$4(stateValue) ? undefined : stateValue[key]) || (subHist ? subHist.current : undefined);
802
802
 
803
803
  if (!subStateValue) {
804
804
  return undefined;
@@ -831,14 +831,14 @@ function updateContext(context, _event, assignActions, state) {
831
831
  };
832
832
  var partialUpdate = {};
833
833
 
834
- if (isFunction$3(assignment)) {
834
+ if (isFunction$4(assignment)) {
835
835
  partialUpdate = assignment(acc, _event.data, meta);
836
836
  } else {
837
837
  try {
838
838
  for (var _b = __values(keys(assignment)), _c = _b.next(); !_c.done; _c = _b.next()) {
839
839
  var key = _c.value;
840
840
  var propAssignment = assignment[key];
841
- partialUpdate[key] = isFunction$3(propAssignment) ? propAssignment(acc, _event.data, meta) : propAssignment;
841
+ partialUpdate[key] = isFunction$4(propAssignment) ? propAssignment(acc, _event.data, meta) : propAssignment;
842
842
  }
843
843
  } catch (e_7_1) {
844
844
  e_7 = {
@@ -861,16 +861,16 @@ function updateContext(context, _event, assignActions, state) {
861
861
 
862
862
  var warn = function () {};
863
863
 
864
- function isArray$3(value) {
864
+ function isArray$4(value) {
865
865
  return Array.isArray(value);
866
866
  } // tslint:disable-next-line:ban-types
867
867
 
868
868
 
869
- function isFunction$3(value) {
869
+ function isFunction$4(value) {
870
870
  return typeof value === 'function';
871
871
  }
872
872
 
873
- function isString$3(value) {
873
+ function isString$4(value) {
874
874
  return typeof value === 'string';
875
875
  } // export function memoizedGetter<T, TP extends { prototype: object }>(
876
876
  // o: TP,
@@ -890,7 +890,7 @@ function toGuard(condition, guardMap) {
890
890
  return undefined;
891
891
  }
892
892
 
893
- if (isString$3(condition)) {
893
+ if (isString$4(condition)) {
894
894
  return {
895
895
  type: DEFAULT_GUARD_TYPE,
896
896
  name: condition,
@@ -898,7 +898,7 @@ function toGuard(condition, guardMap) {
898
898
  };
899
899
  }
900
900
 
901
- if (isFunction$3(condition)) {
901
+ if (isFunction$4(condition)) {
902
902
  return {
903
903
  type: DEFAULT_GUARD_TYPE,
904
904
  name: condition.name,
@@ -911,7 +911,7 @@ function toGuard(condition, guardMap) {
911
911
 
912
912
  function isObservable(value) {
913
913
  try {
914
- return 'subscribe' in value && isFunction$3(value.subscribe);
914
+ return 'subscribe' in value && isFunction$4(value.subscribe);
915
915
  } catch (e) {
916
916
  return false;
917
917
  }
@@ -933,7 +933,7 @@ function isMachine(value) {
933
933
 
934
934
  function toEventObject(event, payload // id?: TEvent['type']
935
935
  ) {
936
- if (isString$3(event) || typeof event === 'number') {
936
+ if (isString$4(event) || typeof event === 'number') {
937
937
  return __assign({
938
938
  type: event
939
939
  }, payload);
@@ -943,7 +943,7 @@ function toEventObject(event, payload // id?: TEvent['type']
943
943
  }
944
944
 
945
945
  function toSCXMLEvent(event, scxmlEvent) {
946
- if (!isString$3(event) && '$$type' in event && event.$$type === 'scxml') {
946
+ if (!isString$4(event) && '$$type' in event && event.$$type === 'scxml') {
947
947
  return event;
948
948
  }
949
949
 
@@ -1037,10 +1037,10 @@ function getActionFunction(actionType, actionFunctionMap) {
1037
1037
  function toActionObject(action, actionFunctionMap) {
1038
1038
  var actionObject;
1039
1039
 
1040
- if (isString$3(action) || typeof action === 'number') {
1040
+ if (isString$4(action) || typeof action === 'number') {
1041
1041
  var exec = getActionFunction(action, actionFunctionMap);
1042
1042
 
1043
- if (isFunction$3(exec)) {
1043
+ if (isFunction$4(exec)) {
1044
1044
  actionObject = {
1045
1045
  type: action,
1046
1046
  exec: exec
@@ -1053,7 +1053,7 @@ function toActionObject(action, actionFunctionMap) {
1053
1053
  exec: undefined
1054
1054
  };
1055
1055
  }
1056
- } else if (isFunction$3(action)) {
1056
+ } else if (isFunction$4(action)) {
1057
1057
  actionObject = {
1058
1058
  // Convert action to string if unnamed
1059
1059
  type: action.name || action.toString(),
@@ -1062,7 +1062,7 @@ function toActionObject(action, actionFunctionMap) {
1062
1062
  } else {
1063
1063
  var exec = getActionFunction(action.type, actionFunctionMap);
1064
1064
 
1065
- if (isFunction$3(exec)) {
1065
+ if (isFunction$4(exec)) {
1066
1066
  actionObject = __assign(__assign({}, action), {
1067
1067
  exec: exec
1068
1068
  });
@@ -1093,7 +1093,7 @@ var toActionObjects = function (action, actionFunctionMap) {
1093
1093
  return [];
1094
1094
  }
1095
1095
 
1096
- var actions = isArray$3(action) ? action : [action];
1096
+ var actions = isArray$4(action) ? action : [action];
1097
1097
  return actions.map(function (subAction) {
1098
1098
  return toActionObject(subAction, actionFunctionMap);
1099
1099
  });
@@ -1102,7 +1102,7 @@ var toActionObjects = function (action, actionFunctionMap) {
1102
1102
  function toActivityDefinition(action) {
1103
1103
  var actionObject = toActionObject(action);
1104
1104
  return __assign(__assign({
1105
- id: isString$3(action) ? action : actionObject.id
1105
+ id: isString$4(action) ? action : actionObject.id
1106
1106
  }, actionObject), {
1107
1107
  type: actionObject.type
1108
1108
  });
@@ -1116,7 +1116,7 @@ function toActivityDefinition(action) {
1116
1116
 
1117
1117
 
1118
1118
  function raise(event) {
1119
- if (!isString$3(event)) {
1119
+ if (!isString$4(event)) {
1120
1120
  return send(event, {
1121
1121
  to: SpecialTargets.Internal
1122
1122
  });
@@ -1150,9 +1150,9 @@ function send(event, options) {
1150
1150
  return {
1151
1151
  to: options ? options.to : undefined,
1152
1152
  type: send$1,
1153
- event: isFunction$3(event) ? event : toEventObject(event),
1153
+ event: isFunction$4(event) ? event : toEventObject(event),
1154
1154
  delay: options ? options.delay : undefined,
1155
- id: options && options.id !== undefined ? options.id : isFunction$3(event) ? event.name : getEventType(event)
1155
+ id: options && options.id !== undefined ? options.id : isFunction$4(event) ? event.name : getEventType(event)
1156
1156
  };
1157
1157
  }
1158
1158
 
@@ -1161,17 +1161,17 @@ function resolveSend(action, ctx, _event, delaysMap) {
1161
1161
  _event: _event
1162
1162
  }; // TODO: helper function for resolving Expr
1163
1163
 
1164
- var resolvedEvent = toSCXMLEvent(isFunction$3(action.event) ? action.event(ctx, _event.data, meta) : action.event);
1164
+ var resolvedEvent = toSCXMLEvent(isFunction$4(action.event) ? action.event(ctx, _event.data, meta) : action.event);
1165
1165
  var resolvedDelay;
1166
1166
 
1167
- if (isString$3(action.delay)) {
1167
+ if (isString$4(action.delay)) {
1168
1168
  var configDelay = delaysMap && delaysMap[action.delay];
1169
- resolvedDelay = isFunction$3(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;
1169
+ resolvedDelay = isFunction$4(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;
1170
1170
  } else {
1171
- resolvedDelay = isFunction$3(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;
1171
+ resolvedDelay = isFunction$4(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;
1172
1172
  }
1173
1173
 
1174
- var resolvedTarget = isFunction$3(action.to) ? action.to(ctx, _event.data, meta) : action.to;
1174
+ var resolvedTarget = isFunction$4(action.to) ? action.to(ctx, _event.data, meta) : action.to;
1175
1175
  return __assign(__assign({}, action), {
1176
1176
  to: resolvedTarget,
1177
1177
  _event: resolvedEvent,
@@ -1182,7 +1182,7 @@ function resolveSend(action, ctx, _event, delaysMap) {
1182
1182
 
1183
1183
  var resolveLog = function (action, ctx, _event) {
1184
1184
  return __assign(__assign({}, action), {
1185
- value: isString$3(action.expr) ? action.expr : action.expr(ctx, _event.data, {
1185
+ value: isString$4(action.expr) ? action.expr : action.expr(ctx, _event.data, {
1186
1186
  _event: _event
1187
1187
  })
1188
1188
  });
@@ -1557,7 +1557,7 @@ function isInFinalState(configuration, stateNode) {
1557
1557
  return false;
1558
1558
  }
1559
1559
 
1560
- if (isString$3(a) || isString$3(b)) {
1560
+ if (isString$4(a) || isString$4(b)) {
1561
1561
  return a === b;
1562
1562
  }
1563
1563
 
@@ -1569,7 +1569,7 @@ function isInFinalState(configuration, stateNode) {
1569
1569
  }
1570
1570
 
1571
1571
  function isState(state) {
1572
- if (isString$3(state)) {
1572
+ if (isString$4(state)) {
1573
1573
  return false;
1574
1574
  }
1575
1575
 
@@ -1743,7 +1743,7 @@ function () {
1743
1743
  delimiter = '.';
1744
1744
  }
1745
1745
 
1746
- if (isString$3(stateValue)) {
1746
+ if (isString$4(stateValue)) {
1747
1747
  return [stateValue];
1748
1748
  }
1749
1749
 
@@ -1835,7 +1835,7 @@ var createDefaultOptions = function () {
1835
1835
 
1836
1836
  var validateArrayifiedTransitions = function (stateNode, event, transitions) {
1837
1837
  var hasNonLastUnguardedTarget = transitions.slice(0, -1).some(function (transition) {
1838
- return !('cond' in transition) && !('in' in transition) && (isString$3(transition.target) || isMachine(transition.target));
1838
+ return !('cond' in transition) && !('in' in transition) && (isString$4(transition.target) || isMachine(transition.target));
1839
1839
  });
1840
1840
  var eventText = event === NULL_EVENT ? 'the transient event' : "event '" + event + "'";
1841
1841
  warn(!hasNonLastUnguardedTarget, "One or more transitions for " + eventText + " on state '" + stateNode.id + "' are unreachable. " + "Make sure that the default transition is the last one defined.");
@@ -2123,7 +2123,7 @@ function () {
2123
2123
  }
2124
2124
 
2125
2125
  var mutateEntryExit = function (delay, i) {
2126
- var delayRef = isFunction$3(delay) ? _this.id + ":delay[" + i + "]" : delay;
2126
+ var delayRef = isFunction$4(delay) ? _this.id + ":delay[" + i + "]" : delay;
2127
2127
  var eventType = after(delayRef, _this.id);
2128
2128
 
2129
2129
  _this.onEntry.push(send(eventType, {
@@ -2135,14 +2135,14 @@ function () {
2135
2135
  return eventType;
2136
2136
  };
2137
2137
 
2138
- var delayedTransitions = isArray$3(afterConfig) ? afterConfig.map(function (transition, i) {
2138
+ var delayedTransitions = isArray$4(afterConfig) ? afterConfig.map(function (transition, i) {
2139
2139
  var eventType = mutateEntryExit(transition.delay, i);
2140
2140
  return __assign(__assign({}, transition), {
2141
2141
  event: eventType
2142
2142
  });
2143
2143
  }) : flatten$1(keys(afterConfig).map(function (delay, i) {
2144
2144
  var configTransition = afterConfig[delay];
2145
- var resolvedTransition = isString$3(configTransition) ? {
2145
+ var resolvedTransition = isString$4(configTransition) ? {
2146
2146
  target: configTransition
2147
2147
  } : configTransition;
2148
2148
  var resolvedDelay = !isNaN(+delay) ? +delay : delay;
@@ -2179,7 +2179,7 @@ function () {
2179
2179
 
2180
2180
  var stateValue = state instanceof State ? state.value : toStateValue(state, this.delimiter);
2181
2181
 
2182
- if (isString$3(stateValue)) {
2182
+ if (isString$4(stateValue)) {
2183
2183
  var initialStateValue = this.getStateNode(stateValue).initial;
2184
2184
  return initialStateValue !== undefined ? this.getStateNodes((_a = {}, _a[stateValue] = initialStateValue, _a)) : [this.states[stateValue]];
2185
2185
  }
@@ -2316,7 +2316,7 @@ function () {
2316
2316
 
2317
2317
  StateNode.prototype._transition = function (stateValue, state, _event) {
2318
2318
  // leaf node
2319
- if (isString$3(stateValue)) {
2319
+ if (isString$4(stateValue)) {
2320
2320
  return this.transitionLeafNode(stateValue, state, _event);
2321
2321
  } // hierarchical node
2322
2322
 
@@ -2345,7 +2345,7 @@ function () {
2345
2345
  var cond = candidate.cond,
2346
2346
  stateIn = candidate.in;
2347
2347
  var resolvedContext = state.context;
2348
- var isInState = stateIn ? isString$3(stateIn) && isStateId(stateIn) ? // Check if in state by ID
2348
+ var isInState = stateIn ? isString$4(stateIn) && isStateId(stateIn) ? // Check if in state by ID
2349
2349
  state.matches(toStateValue(this.getStateNodeById(stateIn).path, this.delimiter)) : // Check if in state by relative grandparent
2350
2350
  matchesState(toStateValue(stateIn, this.delimiter), path$1(this.path.slice(0, -2))(state.value)) : true;
2351
2351
  var guardPassed = false;
@@ -2594,7 +2594,7 @@ function () {
2594
2594
  if (state instanceof State) {
2595
2595
  currentState = context === undefined ? state : this.resolveState(State.from(state, context));
2596
2596
  } else {
2597
- var resolvedStateValue = isString$3(state) ? this.resolve(pathToStateValue(this.getResolvedPath(state))) : this.resolve(state);
2597
+ var resolvedStateValue = isString$4(state) ? this.resolve(pathToStateValue(this.getResolvedPath(state))) : this.resolve(state);
2598
2598
  var resolvedContext = context ? context : this.machine.context;
2599
2599
  currentState = this.resolveState(State.from(resolvedStateValue, resolvedContext));
2600
2600
  }
@@ -2700,7 +2700,7 @@ function () {
2700
2700
 
2701
2701
  if (!IS_PRODUCTION) {
2702
2702
  // warn after resolving as we can create better contextual message here
2703
- warn(!isString$3(actionObject.delay) || typeof sendAction.delay === 'number', // tslint:disable-next-line:max-line-length
2703
+ warn(!isString$4(actionObject.delay) || typeof sendAction.delay === 'number', // tslint:disable-next-line:max-line-length
2704
2704
  "No delay reference for delay expression '" + actionObject.delay + "' was found on machine '" + _this.machine.id + "'");
2705
2705
  }
2706
2706
 
@@ -2893,7 +2893,7 @@ function () {
2893
2893
  });
2894
2894
 
2895
2895
  case 'compound':
2896
- if (isString$3(stateValue)) {
2896
+ if (isString$4(stateValue)) {
2897
2897
  var subStateNode = this.getStateNode(stateValue);
2898
2898
 
2899
2899
  if (subStateNode.type === 'parallel' || subStateNode.type === 'compound') {
@@ -3003,7 +3003,7 @@ function () {
3003
3003
  if (this.type === 'history') {
3004
3004
  var historyConfig = this.config;
3005
3005
 
3006
- if (isString$3(historyConfig.target)) {
3006
+ if (isString$4(historyConfig.target)) {
3007
3007
  target = isStateId(historyConfig.target) ? pathToStateValue(this.machine.getStateNodeById(historyConfig.target).path.slice(this.path.length - 1)) : historyConfig.target;
3008
3008
  } else {
3009
3009
  target = historyConfig.target;
@@ -3101,7 +3101,7 @@ function () {
3101
3101
  return stateNode.historyValue();
3102
3102
  }
3103
3103
 
3104
- var subStateValue = isString$3(relativeStateValue) ? undefined : relativeStateValue[key];
3104
+ var subStateValue = isString$4(relativeStateValue) ? undefined : relativeStateValue[key];
3105
3105
  return stateNode.historyValue(subStateValue || stateNode.initialStateValue);
3106
3106
  }, function (stateNode) {
3107
3107
  return !stateNode.history;
@@ -3134,7 +3134,7 @@ function () {
3134
3134
 
3135
3135
  var subHistoryValue = nestedPath(parent.path, 'states')(historyValue).current;
3136
3136
 
3137
- if (isString$3(subHistoryValue)) {
3137
+ if (isString$4(subHistoryValue)) {
3138
3138
  return [parent.getStateNode(subHistoryValue)];
3139
3139
  }
3140
3140
 
@@ -3242,7 +3242,7 @@ function () {
3242
3242
  }
3243
3243
 
3244
3244
  return _target.map(function (target) {
3245
- if (!isString$3(target)) {
3245
+ if (!isString$4(target)) {
3246
3246
  return target;
3247
3247
  }
3248
3248
 
@@ -3274,7 +3274,7 @@ function () {
3274
3274
 
3275
3275
  var normalizedTarget = normalizeTarget(transitionConfig.target);
3276
3276
  var internal = 'internal' in transitionConfig ? transitionConfig.internal : normalizedTarget ? normalizedTarget.some(function (_target) {
3277
- return isString$3(_target) && _target[0] === _this.delimiter;
3277
+ return isString$4(_target) && _target[0] === _this.delimiter;
3278
3278
  }) : true;
3279
3279
  var guards = this.machine.options.guards;
3280
3280
  var target = this.resolveTarget(normalizedTarget);
@@ -3549,7 +3549,7 @@ function () {
3549
3549
  */
3550
3550
 
3551
3551
  this.send = function (event, payload) {
3552
- if (isArray$3(event)) {
3552
+ if (isArray$4(event)) {
3553
3553
  _this.batch(event);
3554
3554
 
3555
3555
  return _this.state;
@@ -4009,7 +4009,7 @@ function () {
4009
4009
 
4010
4010
 
4011
4011
  this.children.forEach(function (child) {
4012
- if (isFunction$3(child.stop)) {
4012
+ if (isFunction$4(child.stop)) {
4013
4013
  child.stop();
4014
4014
  }
4015
4015
  });
@@ -4176,7 +4176,7 @@ function () {
4176
4176
  var context = state.context,
4177
4177
  _event = state._event;
4178
4178
  var actionOrExec = getActionFunction(action.type, actionFunctionMap) || action.exec;
4179
- var exec = isFunction$3(actionOrExec) ? actionOrExec : actionOrExec ? actionOrExec.exec : action.exec;
4179
+ var exec = isFunction$4(actionOrExec) ? actionOrExec : actionOrExec ? actionOrExec.exec : action.exec;
4180
4180
 
4181
4181
  if (exec) {
4182
4182
  try {
@@ -4241,11 +4241,11 @@ function () {
4241
4241
  return;
4242
4242
  }
4243
4243
 
4244
- var source = isFunction$3(serviceCreator) ? serviceCreator(context, _event.data) : serviceCreator;
4244
+ var source = isFunction$4(serviceCreator) ? serviceCreator(context, _event.data) : serviceCreator;
4245
4245
 
4246
4246
  if (isPromiseLike(source)) {
4247
4247
  this.state.children[id] = this.spawnPromise(Promise.resolve(source), id);
4248
- } else if (isFunction$3(source)) {
4248
+ } else if (isFunction$4(source)) {
4249
4249
  this.state.children[id] = this.spawnCallback(source, id);
4250
4250
  } else if (isObservable(source)) {
4251
4251
  this.state.children[id] = this.spawnObservable(source, id);
@@ -4296,7 +4296,7 @@ function () {
4296
4296
  this.forwardTo.delete(childId);
4297
4297
  delete this.state.children[childId];
4298
4298
 
4299
- if (isFunction$3(child.stop)) {
4299
+ if (isFunction$4(child.stop)) {
4300
4300
  child.stop();
4301
4301
  }
4302
4302
  };
@@ -4304,7 +4304,7 @@ function () {
4304
4304
  Interpreter.prototype.spawn = function (entity, name, options) {
4305
4305
  if (isPromiseLike(entity)) {
4306
4306
  return this.spawnPromise(Promise.resolve(entity), name);
4307
- } else if (isFunction$3(entity)) {
4307
+ } else if (isFunction$4(entity)) {
4308
4308
  return this.spawnCallback(entity, name);
4309
4309
  } else if (isActor(entity)) {
4310
4310
  return this.spawnActor(entity);
@@ -4490,7 +4490,7 @@ function () {
4490
4490
  stop: function () {
4491
4491
  canceled = true;
4492
4492
 
4493
- if (isFunction$3(callbackStop)) {
4493
+ if (isFunction$4(callbackStop)) {
4494
4494
  callbackStop();
4495
4495
  }
4496
4496
  },
@@ -56722,7 +56722,7 @@ if (typeof self !== 'undefined') {
56722
56722
  root = Function('return this')();
56723
56723
  }
56724
56724
 
56725
- var result$1 = symbolObservablePonyfill(root);/**
56725
+ var result$2 = symbolObservablePonyfill(root);/**
56726
56726
  * These are private action types reserved by Redux.
56727
56727
  * For any unknown actions, you must return the current state.
56728
56728
  * If the current state is undefined, you must return the initial state.
@@ -57010,7 +57010,7 @@ function createStore$1(reducer, preloadedState, enhancer) {
57010
57010
  unsubscribe: unsubscribe
57011
57011
  };
57012
57012
  }
57013
- }, _ref[result$1] = function () {
57013
+ }, _ref[result$2] = function () {
57014
57014
  return this;
57015
57015
  }, _ref;
57016
57016
  } // When a store is created, an "INIT" action is dispatched so that every
@@ -57026,7 +57026,7 @@ function createStore$1(reducer, preloadedState, enhancer) {
57026
57026
  subscribe: subscribe,
57027
57027
  getState: getState,
57028
57028
  replaceReducer: replaceReducer
57029
- }, _ref2[result$1] = observable, _ref2;
57029
+ }, _ref2[result$2] = observable, _ref2;
57030
57030
  }
57031
57031
 
57032
57032
  function getUndefinedStateErrorMessage(key, action) {
@@ -57318,7 +57318,7 @@ function applyMiddleware() {
57318
57318
 
57319
57319
  var thunk = createThunkMiddleware();
57320
57320
  thunk.withExtraArgument = createThunkMiddleware;var name = "mage-engine";
57321
- var version = "3.17.9";
57321
+ var version = "3.17.11";
57322
57322
  var description = "A WebGL Javascript Game Engine, built on top of THREE.js and many other libraries.";
57323
57323
  var main = "dist/mage.js";
57324
57324
  var author$1 = {
@@ -60206,7 +60206,7 @@ var prepareModel = function prepareModel(model) {
60206
60206
 
60207
60207
  var rotation = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getRotation();
60208
60208
  var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 250;
60209
- var easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Between.Easing.Linear;
60209
+ var easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Between.Easing.Linear.None;
60210
60210
 
60211
60211
  var _this$getRotation2 = this.getRotation(),
60212
60212
  x = _this$getRotation2.x,
@@ -60230,7 +60230,7 @@ var prepareModel = function prepareModel(model) {
60230
60230
 
60231
60231
  var position = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.getPosition();
60232
60232
  var time = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 250;
60233
- var easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Between.Easing.Linear;
60233
+ var easing = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : Between.Easing.Linear.None;
60234
60234
 
60235
60235
  var _this$getPosition3 = this.getPosition(),
60236
60236
  x = _this$getPosition3.x,
@@ -73087,7 +73087,7 @@ function __extends(d, b) {
73087
73087
  function __() { this.constructor = d; }
73088
73088
  d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
73089
73089
  }/** PURE_IMPORTS_START PURE_IMPORTS_END */
73090
- function isFunction$2(x) {
73090
+ function isFunction$3(x) {
73091
73091
  return typeof x === 'function';
73092
73092
  }/** PURE_IMPORTS_START PURE_IMPORTS_END */
73093
73093
  var _enable_super_gross_mode_that_will_cause_bad_things = false;
@@ -73120,7 +73120,7 @@ var empty = {
73120
73120
  },
73121
73121
  complete: function () { }
73122
73122
  };/** PURE_IMPORTS_START PURE_IMPORTS_END */
73123
- var isArray$2 = /*@__PURE__*/ (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();/** PURE_IMPORTS_START PURE_IMPORTS_END */
73123
+ var isArray$3 = /*@__PURE__*/ (function () { return Array.isArray || (function (x) { return x && typeof x.length === 'number'; }); })();/** PURE_IMPORTS_START PURE_IMPORTS_END */
73124
73124
  function isObject(x) {
73125
73125
  return x !== null && typeof x === 'object';
73126
73126
  }/** PURE_IMPORTS_START PURE_IMPORTS_END */
@@ -73164,7 +73164,7 @@ var Subscription$1 = /*@__PURE__*/ (function () {
73164
73164
  parent_1.remove(this);
73165
73165
  }
73166
73166
  }
73167
- if (isFunction$2(_unsubscribe)) {
73167
+ if (isFunction$3(_unsubscribe)) {
73168
73168
  try {
73169
73169
  _unsubscribe.call(this);
73170
73170
  }
@@ -73172,7 +73172,7 @@ var Subscription$1 = /*@__PURE__*/ (function () {
73172
73172
  errors = e instanceof UnsubscriptionError ? flattenUnsubscriptionErrors(e.errors) : [e];
73173
73173
  }
73174
73174
  }
73175
- if (isArray$2(_subscriptions)) {
73175
+ if (isArray$3(_subscriptions)) {
73176
73176
  var index = -1;
73177
73177
  var len = _subscriptions.length;
73178
73178
  while (++index < len) {
@@ -73366,7 +73366,7 @@ var SafeSubscriber = /*@__PURE__*/ (function (_super) {
73366
73366
  _this._parentSubscriber = _parentSubscriber;
73367
73367
  var next;
73368
73368
  var context = _this;
73369
- if (isFunction$2(observerOrNext)) {
73369
+ if (isFunction$3(observerOrNext)) {
73370
73370
  next = observerOrNext;
73371
73371
  }
73372
73372
  else if (observerOrNext) {
@@ -73375,7 +73375,7 @@ var SafeSubscriber = /*@__PURE__*/ (function (_super) {
73375
73375
  complete = observerOrNext.complete;
73376
73376
  if (observerOrNext !== empty) {
73377
73377
  context = Object.create(observerOrNext);
73378
- if (isFunction$2(context.unsubscribe)) {
73378
+ if (isFunction$3(context.unsubscribe)) {
73379
73379
  _this.add(context.unsubscribe.bind(context));
73380
73380
  }
73381
73381
  context.unsubscribe = _this.unsubscribe.bind(_this);
@@ -76853,7 +76853,7 @@ var OutlineEffect = /*#__PURE__*/function () {
76853
76853
 
76854
76854
  return PostProcessing;
76855
76855
  }();
76856
- var PostProcessing$1 = new PostProcessing();function p$1(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n);}}function d(t,e,i){return e&&u(t.prototype,e),i&&u(t,i),t}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e);}function v(t){return (v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){return (y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t,e){return !e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var g=function(t,e){return Math.random()*(e-t)+t},C=function(t,e){return e?g(t,t+e):t},S=function(e,i){return i?new Color$1(g(e.r,i.r),g(e.g,i.g),g(e.b,i.b)):e?e.clone():new Color$1},z=function(t,i){return i?new Vector3$1(g(t.x,i.x),g(t.y,i.y),g(t.z,i.z)):t?t.clone():new Vector3$1},w=function(t,e,i){return t.clone().lerp(e,i)},_=function(t,e,i){return t*(1-i)+e*i},A=function(t){return (t.generate?t.generate():t)||0},b=Object.freeze({__proto__:null,getRandomBetween:g,getRandomWithSpread:C,getRandomColorBetween:S,getRandomVectorBetween:z,lerpColors:w,lerp:_,randomizerOrValue:A}),P=function(){function t(e){p$1(this,t),this.system=e,this.reset();}return d(t,[{key:"reset",value:function(){var t=this.system.options.particles;this.age=0,this.finished=!1,this.gravity=t.gravity,this.velocity=x(t.velocity),t.velocityBonus&&this.velocity.add(t.velocityBonus),this.acceleration=x(t.acceleration,!0),this.position=x(t.offset||new Vector3$1),this.ttl=C(t.ttl||1,t.ttlExtra)||1,this.alpha=this.startAlpha=this.endAlpha=null,this.startAlphaChangeAt=(t.startAlphaChangeAt||0)/this.ttl,t.fade&&(void 0!==t.alpha?this.alpha=A(t.alpha):(this.startAlpha=A(t.startAlpha),this.endAlpha=A(t.endAlpha))),this.colorize=Boolean(t.colorize),this.color=this.startColor=this.endColor=null,this.startColorChangeAt=(t.startColorChangeAt||0)/this.ttl,this.colorize&&(t.color?this.color=T(t.color):(this.startColor=T(t.startColor),this.endColor=T(t.endColor))),this.size=this.startSize=this.endSize=null,this.startSizeChangeAt=(t.startSizeChangeAt||0)/this.ttl,t.scaling&&(void 0!==t.size?this.size=A(t.size):(this.startSize=A(t.startSize),this.endSize=A(t.endSize))),this.rotation=this.rotationSpeed=null,t.rotating&&(this.rotation=A(t.rotation||0),this.rotationSpeed=A(t.rotationSpeed||0)),this.startWorldPosition=null,this.onUpdate=t.onUpdate,t.onSpawn&&t.onSpawn(this);}},{key:"update",value:function(t,e){if(!this.finished){0===this.age?(this.system.options.particles.worldPosition&&(this.startWorldPosition=this.system.getWorldPosition()),null===this.alpha&&null===this.startAlpha||this.system.setAlpha(t,this.alpha||this.startAlpha),null===this.color&&null===this.startColor||this.system.setColor(t,this.color||this.startColor),null===this.size&&null===this.startSize||this.system.setSize(t,this.size||this.startSize),null!==this.rotation&&this.system.setRotation(t,this.rotation)):(this.startColor&&this.age>=this.startColorChangeAt&&this.system.setColor(t,w(this.startColor,this.endColor,this.startColorChangeAt?(this.age-this.startColorChangeAt)/(1-this.startColorChangeAt):this.age)),null!=this.startAlpha&&this.age>=this.startAlphaChangeAt&&this.system.setAlpha(t,_(this.startAlpha,this.endAlpha,this.startAlphaChangeAt?(this.age-this.startAlphaChangeAt)/(1-this.startAlphaChangeAt):this.age)),null!=this.startSize&&this.age>=this.startSizeChangeAt&&this.system.setSize(t,_(this.startSize,this.endSize,this.startSizeChangeAt?(this.age-this.startSizeChangeAt)/(1-this.startSizeChangeAt):this.age))),this.gravity&&this.velocity&&(this.velocity.y+=this.gravity*e),this.rotationSpeed&&(this.rotation+=this.rotationSpeed*e,this.system.setRotation(t,this.rotation)),this.velocity&&(this.position.x+=this.velocity.x*e,this.position.y+=this.velocity.y*e,this.position.z+=this.velocity.z*e);var i=this.position;if(this.startWorldPosition){var n=this.system.getWorldPosition();n.sub(this.startWorldPosition),i=i.clone().sub(n);}this.system.setPosition(t,i),this.acceleration&&this.velocity&&(this.velocity.x+=this.acceleration.x*e,this.velocity.y+=this.acceleration.y*e,this.velocity.z+=this.acceleration.z*e),this.age+=e/this.ttl,this.onUpdate&&this.onUpdate(this),this.age>1&&(this.age=1,this.finished=!0);}}},{key:"worldPosition",get:function(){return this.system.getWorldPosition().add(this.position)}}]),t}();function x(t,i){return t?t.generate?t.generate():t.clone():i?null:new Vector3$1}function T(e,i){return e?e.generate?e.generate():e.clone():i?null:new Color$1(1,1,1)}var R=function(){function e(r){p$1(this,e),this.options=r;var o={globalColor:{value:new Color$1(r.color||16777215)},rendererScale:{value:1}},s="";r.perspective&&(s+="#define PERSPECTIVE\n"),r.map&&(s+="#define TEXTURE\n",o.texture={value:r.map}),r.perParticleColor&&(s+="#define COLORING\n"),r.perParticleRotation&&(s+="#define ROTATION\n"),r.constSize&&(s+="#define CONST_SIZE\n",o.constSize={value:r.constSize}),r.alphaTest&&(s+="#define ALPHA_TEST\n"),s+="\n",this.material=new ShaderMaterial({uniforms:o,vertexShader:s+"\n// attributes we get from geometry\nattribute float alpha;\n\n// per-particle size\n#ifdef CONST_SIZE\n uniform float constSize;\n#else\n attribute float size;\n#endif\n\n// per-particle rotation\n#ifdef ROTATION\n attribute float rotation;\n#endif\n\n// system scale when using perspective mode\n#ifdef PERSPECTIVE\n uniform float rendererScale;\n#endif\n\n// output params for fragment shader\nvarying float vAlpha;\n\n// set per-particle color\n#ifdef COLORING\n varying vec3 vColor;\n#endif\n\n// get per-particle rotation\n#ifdef ROTATION\n varying float vRotation;\n#endif\n\n// vertex shader main\nvoid main() \n{\n // alpha and color\n vAlpha = alpha;\n\n // set color\n #ifdef COLORING\n vColor = color;\n #endif\n\n // set const size\n #ifdef CONST_SIZE\n float size = constSize;\n #endif\n\n // set position\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n\n // apply rotation\n #ifdef ROTATION\n vRotation = rotation;\n #endif\n \n // set size - either perspective or constant\n #ifdef PERSPECTIVE\n gl_PointSize = size * (rendererScale / length(mvPosition.xyz));\n #else\n gl_PointSize = size;\n #endif\n}\n",fragmentShader:s+"\n// material uniforms\nuniform vec3 globalColor;\n\n// params we get from vertex shader\nvarying float vAlpha;\n\n// per-particle color from vertex shader\n#ifdef COLORING\n varying vec3 vColor;\n#endif\n\n// per-particle rotation from vertex shader\n#ifdef ROTATION\n varying float vRotation;\n#endif\n\n// diffuse texture\n#ifdef TEXTURE\n uniform sampler2D texture;\n#endif\n\n// fragment shader main\nvoid main() \n{\n // set default color if don't have per-particle colors\n #ifndef COLORING\n vec3 vColor = vec3(1,1,1);\n #endif\n\n // texture\n #ifdef TEXTURE\n\n // use rotation (rotate texture)\n #ifdef ROTATION\n float mid = 0.5;\n vec2 rotated = vec2(cos(vRotation) * (gl_PointCoord.x - mid) + sin(vRotation) * (gl_PointCoord.y - mid) + mid,\n cos(vRotation) * (gl_PointCoord.y - mid) - sin(vRotation) * (gl_PointCoord.x - mid) + mid);\n vec4 texture = texture2D(texture, rotated);\n // no rotation\n #else\n vec2 coords = vec2((gl_PointCoord.x - 0.5) + 0.5, (gl_PointCoord.y - 0.5) + 0.5);\n vec4 texture = texture2D(texture, coords);\n #endif\n\n // get color with texture\n gl_FragColor = vec4( globalColor * vColor, vAlpha ) * texture;\n \n // no texture (colors only)\n #else\n gl_FragColor = vec4( globalColor * vColor, vAlpha );\n #endif\n\n // check if need to discard pixel\n #ifdef ALPHA_TEST\n if (gl_FragColor.a < 0.00001) { discard; }\n #endif\n}\n",transparent:Boolean(r.transparent),blending:r.blending,vertexColors:VertexColors,depthWrite:Boolean(r.depthWrite),depthTest:Boolean(r.depthTest)});}return d(e,[{key:"dispose",value:function(){this.material.dispose();}},{key:"setBaseScale",value:function(t){this.options.perspective&&(this.material.uniforms.rendererScale.value=t);}}]),e}(),O=function(t){return null!=t},E=function(){function i(e){p$1(this,i),e.particles=e.particles||{worldPosition:!0},e.system=e.system||{},this.options=e,this.hasStarted=!1;var n=e.particles;if("number"==typeof e.particles.size&&(console.warn("Note: replaced 'size' with 'globalSize' property since its more efficient and provided size value was constant anyway."),e.particles.globalSize=e.particles.size,delete e.particles.size),e.particles.color instanceof Color$1&&(console.warn("Note: replaced 'color' with 'globalColor' property since its more efficient and you provided color value was constant anyway."),e.particles.globalColor=e.particles.color,delete e.particles.color),e.particles.fade=O(n.startAlpha)||O(n.alpha),e.particles.rotating=O(n.rotationSpeed)||O(n.rotation),e.particles.colorize=O(n.color)||O(n.startColor),e.particles.scaling=O(n.size)||O(n.startSize),O(n.startAlpha)&&!O(n.endAlpha))throw new Error("When providing 'startAlpha' you must also provide 'endAlpha'!");if(O(n.startAlpha)&&O(n.alpha))throw new Error("When providing 'alpha' you can't also provide 'startAlpha'!");if(O(n.startColor)&&!O(n.endColor))throw new Error("When providing 'startColor' you must also provide 'endColor'!");if(O(n.startColor)&&O(n.color))throw new Error("When providing 'color' you can't also provide 'startColor'!");if(O(n.startSize)&&!O(n.endSize))throw new Error("When providing 'startSize' you must also provide 'endSize'!");if(O(n.startSize)&&O(n.size))throw new Error("When providing 'size' you can't also provide 'startSize'!");this.particleCount=e.system.particlesCount||10,this.blending=e.particles.blending||"opaque",this.threeBlend={opaque:NoBlending,additive:AdditiveBlending,multiply:MultiplyBlending,blend:NormalBlending}[this.blending],this.create(),e.autostart&&this.start();}return d(i,[{key:"create",value:function(){this._emitters=[];var t=this.options,e=t.system,i=t.particles;t.container;if(e.emitters)if(e.emitters instanceof Array)for(var n=0;n<e.emitters.length;++n)this.addEmitter(e.emitters[n]);else this.addEmitter(e.emitters);var r="opaque"!==this.blending;this.particlesGeometry=new BufferGeometry;var o=void 0===e.perspective||Boolean(e.perspective),s=new R({size:i.size||10,color:i.globalColor||16777215,blending:this.threeBlend,perspective:o,transparent:r,map:i.texture,perParticleColor:Boolean(i.colorize),alphaTest:"blend"===this.blending&&O(i.texture),constSize:O(i.globalSize)?i.globalSize:null,depthWrite:!O(e.depthWrite)||e.depthWrite,depthTest:!O(e.depthTest)||e.depthTest,perParticleRotation:i.rotating});this.material=s,this.speed=e.speed||1,this.reset(),this._aliveParticles=[],this._deadParticles=[];for(var a=new Float32Array(3*this.particleCount),p=i.colorize?new Float32Array(3*this.particleCount):null,u=i.fade?new Float32Array(1*this.particleCount):null,d=i.scaling?new Float32Array(1*this.particleCount):null,f=i.rotating?new Float32Array(1*this.particleCount):null,v=0;v<this.particleCount;v++){var y=3*v;a[y]=a[y+1]=a[y+2]=0,p&&(p[y]=p[y+1]=p[y+2]=1),u&&(u[v]=1),d&&(d[v]=1),f&&(f[v]=0),this._deadParticles.push(new P(this));}this.particlesGeometry.setAttribute("position",new BufferAttribute(a,3)),u&&this.particlesGeometry.setAttribute("alpha",new BufferAttribute(u,1)),p&&this.particlesGeometry.setAttribute("color",new BufferAttribute(p,3)),d&&this.particlesGeometry.setAttribute("size",new BufferAttribute(d,1)),f&&this.particlesGeometry.setAttribute("rotation",new BufferAttribute(f,1)),this.particlesGeometry.setDrawRange(0,0),this.material.setBaseScale(e.scale||400);var m=new Points(this.particlesGeometry,this.material.material);m.sortParticles=r,this.particleSystem=m,this._positionDirty=!0,this._colorsDirty=Boolean(p),this._alphaDirty=Boolean(u),this._rotateDirty=Boolean(f);}},{key:"start",value:function(){var t=this.options.container;t?(this.addTo(t),this.hasStarted=!0):console.log("no container for particle system, aborting.");}},{key:"stop",value:function(){this.ttl=0;}},{key:"addEmitter",value:function(t){this._emitters.push(t);}},{key:"dispose",value:function(){this.particlesGeometry.dispose(),this.material.dispose();}},{key:"reset",value:function(){this.ttl=this.options.system.ttl,this.age=0,this._timeToUpdateBS=0;}},{key:"getWorldPosition",value:function(){var t=new Vector3$1;return this.particleSystem.getWorldPosition(t),t}},{key:"addTo",value:function(t){t.add(this.particleSystem);}},{key:"setColor",value:function(t,e){t*=3;var i=this.particlesGeometry.attributes.color.array;i[t]=e.r,i[t+1]=e.g,i[t+2]=e.b,this._colorsDirty=!0;}},{key:"setPosition",value:function(t,e){t*=3;var i=this.particlesGeometry.attributes.position.array;i[t]=e.x,i[t+1]=e.y,i[t+2]=e.z,this._positionDirty=!0;}},{key:"setAlpha",value:function(t,e){this.particlesGeometry.attributes.alpha.array[t]=e,this._alphaDirty=!0;}},{key:"setRotation",value:function(t,e){this.particlesGeometry.attributes.rotation.array[t]=e,this._rotateDirty=!0;}},{key:"setSize",value:function(t,e){this.particlesGeometry.attributes.size.array[t]=e,this._sizeDirty=!0;}},{key:"removeAndDisposeIfFinished",value:function(){return !!this.finished&&(this.removeSelf(),this.dispose(),!0)}},{key:"update",value:function(t){if(this.hasStarted){if(void 0===t){var e=(new Date).getTime()/1e3;t=e-this._lastTime||0,this._lastTime=e;}if(0!==t){void 0!==this.ttl&&this.ttl>0&&(this.ttl-=t),t*=this.speed,this.dt=t,this.age+=t;var i=this._aliveParticles.length;if(!this.ttlExpired)for(var n=0;n<this._emitters.length;++n){var r=this._emitters[n].update(t,this);r&&this.spawnParticles(r);}for(n=this._aliveParticles.length-1;n>=0;--n){var o=this._aliveParticles[n];o.update(n,t),o.finished&&(this._aliveParticles.splice(n,1),this._deadParticles.push(o));}i!==this._aliveParticles.length&&this.particlesGeometry.setDrawRange(0,this._aliveParticles.length),this.particlesGeometry.attributes.position.needsUpdate=this._positionDirty,this._needBoundingSphereUpdate=this._needBoundingSphereUpdate||this._positionDirty,this._positionDirty=!1,this._colorsDirty&&(this.particlesGeometry.attributes.color.needsUpdate=!0,this._colorsDirty=!1),this._alphaDirty&&(this.particlesGeometry.attributes.alpha.needsUpdate=!0,this._alphaDirty=!1),this._sizeDirty&&(this.particlesGeometry.attributes.size.needsUpdate=!0,this._sizeDirty=!1),this._rotateDirty&&(this.particlesGeometry.attributes.rotation.needsUpdate=!0,this._rotateDirty=!1),this._needBoundingSphereUpdate&&(this._timeToUpdateBS-=t,this._timeToUpdateBS<=0&&(this._timeToUpdateBS=.2,this.particlesGeometry.computeBoundingSphere())),this.finished||this.options.system.onUpdate&&this.options.system.onUpdate(this);}}}},{key:"spawnParticles",value:function(t){for(var e=0;e<t;++e){if(0===this._deadParticles.length)return;var i=this._deadParticles.pop();i.reset(),this._aliveParticles.push(i);}}},{key:"removeSelf",value:function(){this.particleSystem.parent&&this.particleSystem.parent.remove(this.particleSystem);}},{key:"finished",get:function(){return this.ttlExpired&&0===this.particlesCount}},{key:"ttlExpired",get:function(){return void 0!==this.ttl&&this.ttl<=0}},{key:"particlesCount",get:function(){return this._aliveParticles.length}},{key:"maxParticlesCount",get:function(){return this._aliveParticles.length+this._deadParticles.length}}]),i}(),k=function(){function t(e){p$1(this,t),this.options=e,e.interval=e.interval||1,this.age=0,this.timeToSpawn=Math.random()*A(e.interval);}return d(t,[{key:"update",value:function(t,e){var i=0;if(0===this.age&&this.options.onSpawnBurst&&(i+=A(this.options.onSpawnBurst)),this.age+=t,!this.options.onInterval)return i;(this.timeToSpawn-=t,this.timeToSpawn<=0&&(this.timeToSpawn=A(this.options.interval),i+=A(this.options.onInterval)),this.options.detoretingMinTtl&&e.ttl<this.options.detoretingMinTtl)&&(i*=e.ttl/this.options.detoretingMinTtl);return i}}]),t}(),B=function(){function t(){p$1(this,t);}return d(t,[{key:"generate",value:function(){throw new Error("Not implemented.")}}]),t}(),D=function(t){function i(t,n){var r;return p$1(this,i),(r=m(this,v(i).call(this))).min=t||new Vector3$1(-1,-1,-1),r.max=n||new Vector3$1(1,1,1),r}return f(i,B),d(i,[{key:"generate",value:function(){return z(this.min,this.max)}}]),i}();function G(){return 2*Math.random()-1}var U=function(t){function i(t,e,n,r,o){var s;return p$1(this,i),(s=m(this,v(i).call(this))).maxRadius=t||1,s.minRadius=e||0,s.scaler=n,s.minVector=r,s.maxVector=o,s}return f(i,B),d(i,[{key:"generate",value:function(){var t=new Vector3$1(G(),G(),G());return (this.minVector||this.maxVector)&&t.clamp(this.minVector||new Vector3$1(-1,-1,-1),this.maxVector||new Vector3$1(1,1,1)),t.normalize().multiplyScalar(g(this.minRadius,this.maxRadius)),this.scaler&&t.multiply(this.scaler),t}}]),i}(),W=function(e){function i(e,n){var r;return p$1(this,i),(r=m(this,v(i).call(this))).min=e||new Color$1(0,0,0),r.max=n||new Color$1(1,1,1),r}return f(i,B),d(i,[{key:"generate",value:function(){return S(this.min,this.max)}}]),i}(),I=function(t){function e(t,i){var n;return p$1(this,e),(n=m(this,v(e).call(this))).min=t,n.max=i,n}return f(e,B),d(e,[{key:"generate",value:function(){return g(this.min,this.max)}}]),e}(),N=Object.freeze({__proto__:null,Randomizer:B,BoxRandomizer:D,SphereRandomizer:U,ColorsRandomizer:W,MinMaxRandomizer:I});
76856
+ var PostProcessing$1 = new PostProcessing();function p$2(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function u(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n);}}function d(t,e,i){return e&&u(t.prototype,e),i&&u(t,i),t}function f(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&y(t,e);}function v(t){return (v=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function y(t,e){return (y=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function m(t,e){return !e||"object"!=typeof e&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}var g=function(t,e){return Math.random()*(e-t)+t},C=function(t,e){return e?g(t,t+e):t},S=function(e,i){return i?new Color$1(g(e.r,i.r),g(e.g,i.g),g(e.b,i.b)):e?e.clone():new Color$1},z=function(t,i){return i?new Vector3$1(g(t.x,i.x),g(t.y,i.y),g(t.z,i.z)):t?t.clone():new Vector3$1},w=function(t,e,i){return t.clone().lerp(e,i)},_=function(t,e,i){return t*(1-i)+e*i},A=function(t){return (t.generate?t.generate():t)||0},b=Object.freeze({__proto__:null,getRandomBetween:g,getRandomWithSpread:C,getRandomColorBetween:S,getRandomVectorBetween:z,lerpColors:w,lerp:_,randomizerOrValue:A}),P=function(){function t(e){p$2(this,t),this.system=e,this.reset();}return d(t,[{key:"reset",value:function(){var t=this.system.options.particles;this.age=0,this.finished=!1,this.gravity=t.gravity,this.velocity=x(t.velocity),t.velocityBonus&&this.velocity.add(t.velocityBonus),this.acceleration=x(t.acceleration,!0),this.position=x(t.offset||new Vector3$1),this.ttl=C(t.ttl||1,t.ttlExtra)||1,this.alpha=this.startAlpha=this.endAlpha=null,this.startAlphaChangeAt=(t.startAlphaChangeAt||0)/this.ttl,t.fade&&(void 0!==t.alpha?this.alpha=A(t.alpha):(this.startAlpha=A(t.startAlpha),this.endAlpha=A(t.endAlpha))),this.colorize=Boolean(t.colorize),this.color=this.startColor=this.endColor=null,this.startColorChangeAt=(t.startColorChangeAt||0)/this.ttl,this.colorize&&(t.color?this.color=T(t.color):(this.startColor=T(t.startColor),this.endColor=T(t.endColor))),this.size=this.startSize=this.endSize=null,this.startSizeChangeAt=(t.startSizeChangeAt||0)/this.ttl,t.scaling&&(void 0!==t.size?this.size=A(t.size):(this.startSize=A(t.startSize),this.endSize=A(t.endSize))),this.rotation=this.rotationSpeed=null,t.rotating&&(this.rotation=A(t.rotation||0),this.rotationSpeed=A(t.rotationSpeed||0)),this.startWorldPosition=null,this.onUpdate=t.onUpdate,t.onSpawn&&t.onSpawn(this);}},{key:"update",value:function(t,e){if(!this.finished){0===this.age?(this.system.options.particles.worldPosition&&(this.startWorldPosition=this.system.getWorldPosition()),null===this.alpha&&null===this.startAlpha||this.system.setAlpha(t,this.alpha||this.startAlpha),null===this.color&&null===this.startColor||this.system.setColor(t,this.color||this.startColor),null===this.size&&null===this.startSize||this.system.setSize(t,this.size||this.startSize),null!==this.rotation&&this.system.setRotation(t,this.rotation)):(this.startColor&&this.age>=this.startColorChangeAt&&this.system.setColor(t,w(this.startColor,this.endColor,this.startColorChangeAt?(this.age-this.startColorChangeAt)/(1-this.startColorChangeAt):this.age)),null!=this.startAlpha&&this.age>=this.startAlphaChangeAt&&this.system.setAlpha(t,_(this.startAlpha,this.endAlpha,this.startAlphaChangeAt?(this.age-this.startAlphaChangeAt)/(1-this.startAlphaChangeAt):this.age)),null!=this.startSize&&this.age>=this.startSizeChangeAt&&this.system.setSize(t,_(this.startSize,this.endSize,this.startSizeChangeAt?(this.age-this.startSizeChangeAt)/(1-this.startSizeChangeAt):this.age))),this.gravity&&this.velocity&&(this.velocity.y+=this.gravity*e),this.rotationSpeed&&(this.rotation+=this.rotationSpeed*e,this.system.setRotation(t,this.rotation)),this.velocity&&(this.position.x+=this.velocity.x*e,this.position.y+=this.velocity.y*e,this.position.z+=this.velocity.z*e);var i=this.position;if(this.startWorldPosition){var n=this.system.getWorldPosition();n.sub(this.startWorldPosition),i=i.clone().sub(n);}this.system.setPosition(t,i),this.acceleration&&this.velocity&&(this.velocity.x+=this.acceleration.x*e,this.velocity.y+=this.acceleration.y*e,this.velocity.z+=this.acceleration.z*e),this.age+=e/this.ttl,this.onUpdate&&this.onUpdate(this),this.age>1&&(this.age=1,this.finished=!0);}}},{key:"worldPosition",get:function(){return this.system.getWorldPosition().add(this.position)}}]),t}();function x(t,i){return t?t.generate?t.generate():t.clone():i?null:new Vector3$1}function T(e,i){return e?e.generate?e.generate():e.clone():i?null:new Color$1(1,1,1)}var R=function(){function e(r){p$2(this,e),this.options=r;var o={globalColor:{value:new Color$1(r.color||16777215)},rendererScale:{value:1}},s="";r.perspective&&(s+="#define PERSPECTIVE\n"),r.map&&(s+="#define TEXTURE\n",o.texture={value:r.map}),r.perParticleColor&&(s+="#define COLORING\n"),r.perParticleRotation&&(s+="#define ROTATION\n"),r.constSize&&(s+="#define CONST_SIZE\n",o.constSize={value:r.constSize}),r.alphaTest&&(s+="#define ALPHA_TEST\n"),s+="\n",this.material=new ShaderMaterial({uniforms:o,vertexShader:s+"\n// attributes we get from geometry\nattribute float alpha;\n\n// per-particle size\n#ifdef CONST_SIZE\n uniform float constSize;\n#else\n attribute float size;\n#endif\n\n// per-particle rotation\n#ifdef ROTATION\n attribute float rotation;\n#endif\n\n// system scale when using perspective mode\n#ifdef PERSPECTIVE\n uniform float rendererScale;\n#endif\n\n// output params for fragment shader\nvarying float vAlpha;\n\n// set per-particle color\n#ifdef COLORING\n varying vec3 vColor;\n#endif\n\n// get per-particle rotation\n#ifdef ROTATION\n varying float vRotation;\n#endif\n\n// vertex shader main\nvoid main() \n{\n // alpha and color\n vAlpha = alpha;\n\n // set color\n #ifdef COLORING\n vColor = color;\n #endif\n\n // set const size\n #ifdef CONST_SIZE\n float size = constSize;\n #endif\n\n // set position\n vec4 mvPosition = modelViewMatrix * vec4( position, 1.0 );\n gl_Position = projectionMatrix * mvPosition;\n\n // apply rotation\n #ifdef ROTATION\n vRotation = rotation;\n #endif\n \n // set size - either perspective or constant\n #ifdef PERSPECTIVE\n gl_PointSize = size * (rendererScale / length(mvPosition.xyz));\n #else\n gl_PointSize = size;\n #endif\n}\n",fragmentShader:s+"\n// material uniforms\nuniform vec3 globalColor;\n\n// params we get from vertex shader\nvarying float vAlpha;\n\n// per-particle color from vertex shader\n#ifdef COLORING\n varying vec3 vColor;\n#endif\n\n// per-particle rotation from vertex shader\n#ifdef ROTATION\n varying float vRotation;\n#endif\n\n// diffuse texture\n#ifdef TEXTURE\n uniform sampler2D texture;\n#endif\n\n// fragment shader main\nvoid main() \n{\n // set default color if don't have per-particle colors\n #ifndef COLORING\n vec3 vColor = vec3(1,1,1);\n #endif\n\n // texture\n #ifdef TEXTURE\n\n // use rotation (rotate texture)\n #ifdef ROTATION\n float mid = 0.5;\n vec2 rotated = vec2(cos(vRotation) * (gl_PointCoord.x - mid) + sin(vRotation) * (gl_PointCoord.y - mid) + mid,\n cos(vRotation) * (gl_PointCoord.y - mid) - sin(vRotation) * (gl_PointCoord.x - mid) + mid);\n vec4 texture = texture2D(texture, rotated);\n // no rotation\n #else\n vec2 coords = vec2((gl_PointCoord.x - 0.5) + 0.5, (gl_PointCoord.y - 0.5) + 0.5);\n vec4 texture = texture2D(texture, coords);\n #endif\n\n // get color with texture\n gl_FragColor = vec4( globalColor * vColor, vAlpha ) * texture;\n \n // no texture (colors only)\n #else\n gl_FragColor = vec4( globalColor * vColor, vAlpha );\n #endif\n\n // check if need to discard pixel\n #ifdef ALPHA_TEST\n if (gl_FragColor.a < 0.00001) { discard; }\n #endif\n}\n",transparent:Boolean(r.transparent),blending:r.blending,vertexColors:VertexColors,depthWrite:Boolean(r.depthWrite),depthTest:Boolean(r.depthTest)});}return d(e,[{key:"dispose",value:function(){this.material.dispose();}},{key:"setBaseScale",value:function(t){this.options.perspective&&(this.material.uniforms.rendererScale.value=t);}}]),e}(),O=function(t){return null!=t},E=function(){function i(e){p$2(this,i),e.particles=e.particles||{worldPosition:!0},e.system=e.system||{},this.options=e,this.hasStarted=!1;var n=e.particles;if("number"==typeof e.particles.size&&(console.warn("Note: replaced 'size' with 'globalSize' property since its more efficient and provided size value was constant anyway."),e.particles.globalSize=e.particles.size,delete e.particles.size),e.particles.color instanceof Color$1&&(console.warn("Note: replaced 'color' with 'globalColor' property since its more efficient and you provided color value was constant anyway."),e.particles.globalColor=e.particles.color,delete e.particles.color),e.particles.fade=O(n.startAlpha)||O(n.alpha),e.particles.rotating=O(n.rotationSpeed)||O(n.rotation),e.particles.colorize=O(n.color)||O(n.startColor),e.particles.scaling=O(n.size)||O(n.startSize),O(n.startAlpha)&&!O(n.endAlpha))throw new Error("When providing 'startAlpha' you must also provide 'endAlpha'!");if(O(n.startAlpha)&&O(n.alpha))throw new Error("When providing 'alpha' you can't also provide 'startAlpha'!");if(O(n.startColor)&&!O(n.endColor))throw new Error("When providing 'startColor' you must also provide 'endColor'!");if(O(n.startColor)&&O(n.color))throw new Error("When providing 'color' you can't also provide 'startColor'!");if(O(n.startSize)&&!O(n.endSize))throw new Error("When providing 'startSize' you must also provide 'endSize'!");if(O(n.startSize)&&O(n.size))throw new Error("When providing 'size' you can't also provide 'startSize'!");this.particleCount=e.system.particlesCount||10,this.blending=e.particles.blending||"opaque",this.threeBlend={opaque:NoBlending,additive:AdditiveBlending,multiply:MultiplyBlending,blend:NormalBlending}[this.blending],this.create(),e.autostart&&this.start();}return d(i,[{key:"create",value:function(){this._emitters=[];var t=this.options,e=t.system,i=t.particles;t.container;if(e.emitters)if(e.emitters instanceof Array)for(var n=0;n<e.emitters.length;++n)this.addEmitter(e.emitters[n]);else this.addEmitter(e.emitters);var r="opaque"!==this.blending;this.particlesGeometry=new BufferGeometry;var o=void 0===e.perspective||Boolean(e.perspective),s=new R({size:i.size||10,color:i.globalColor||16777215,blending:this.threeBlend,perspective:o,transparent:r,map:i.texture,perParticleColor:Boolean(i.colorize),alphaTest:"blend"===this.blending&&O(i.texture),constSize:O(i.globalSize)?i.globalSize:null,depthWrite:!O(e.depthWrite)||e.depthWrite,depthTest:!O(e.depthTest)||e.depthTest,perParticleRotation:i.rotating});this.material=s,this.speed=e.speed||1,this.reset(),this._aliveParticles=[],this._deadParticles=[];for(var a=new Float32Array(3*this.particleCount),p=i.colorize?new Float32Array(3*this.particleCount):null,u=i.fade?new Float32Array(1*this.particleCount):null,d=i.scaling?new Float32Array(1*this.particleCount):null,f=i.rotating?new Float32Array(1*this.particleCount):null,v=0;v<this.particleCount;v++){var y=3*v;a[y]=a[y+1]=a[y+2]=0,p&&(p[y]=p[y+1]=p[y+2]=1),u&&(u[v]=1),d&&(d[v]=1),f&&(f[v]=0),this._deadParticles.push(new P(this));}this.particlesGeometry.setAttribute("position",new BufferAttribute(a,3)),u&&this.particlesGeometry.setAttribute("alpha",new BufferAttribute(u,1)),p&&this.particlesGeometry.setAttribute("color",new BufferAttribute(p,3)),d&&this.particlesGeometry.setAttribute("size",new BufferAttribute(d,1)),f&&this.particlesGeometry.setAttribute("rotation",new BufferAttribute(f,1)),this.particlesGeometry.setDrawRange(0,0),this.material.setBaseScale(e.scale||400);var m=new Points(this.particlesGeometry,this.material.material);m.sortParticles=r,this.particleSystem=m,this._positionDirty=!0,this._colorsDirty=Boolean(p),this._alphaDirty=Boolean(u),this._rotateDirty=Boolean(f);}},{key:"start",value:function(){var t=this.options.container;t?(this.addTo(t),this.hasStarted=!0):console.log("no container for particle system, aborting.");}},{key:"stop",value:function(){this.ttl=0;}},{key:"addEmitter",value:function(t){this._emitters.push(t);}},{key:"dispose",value:function(){this.particlesGeometry.dispose(),this.material.dispose();}},{key:"reset",value:function(){this.ttl=this.options.system.ttl,this.age=0,this._timeToUpdateBS=0;}},{key:"getWorldPosition",value:function(){var t=new Vector3$1;return this.particleSystem.getWorldPosition(t),t}},{key:"addTo",value:function(t){t.add(this.particleSystem);}},{key:"setColor",value:function(t,e){t*=3;var i=this.particlesGeometry.attributes.color.array;i[t]=e.r,i[t+1]=e.g,i[t+2]=e.b,this._colorsDirty=!0;}},{key:"setPosition",value:function(t,e){t*=3;var i=this.particlesGeometry.attributes.position.array;i[t]=e.x,i[t+1]=e.y,i[t+2]=e.z,this._positionDirty=!0;}},{key:"setAlpha",value:function(t,e){this.particlesGeometry.attributes.alpha.array[t]=e,this._alphaDirty=!0;}},{key:"setRotation",value:function(t,e){this.particlesGeometry.attributes.rotation.array[t]=e,this._rotateDirty=!0;}},{key:"setSize",value:function(t,e){this.particlesGeometry.attributes.size.array[t]=e,this._sizeDirty=!0;}},{key:"removeAndDisposeIfFinished",value:function(){return !!this.finished&&(this.removeSelf(),this.dispose(),!0)}},{key:"update",value:function(t){if(this.hasStarted){if(void 0===t){var e=(new Date).getTime()/1e3;t=e-this._lastTime||0,this._lastTime=e;}if(0!==t){void 0!==this.ttl&&this.ttl>0&&(this.ttl-=t),t*=this.speed,this.dt=t,this.age+=t;var i=this._aliveParticles.length;if(!this.ttlExpired)for(var n=0;n<this._emitters.length;++n){var r=this._emitters[n].update(t,this);r&&this.spawnParticles(r);}for(n=this._aliveParticles.length-1;n>=0;--n){var o=this._aliveParticles[n];o.update(n,t),o.finished&&(this._aliveParticles.splice(n,1),this._deadParticles.push(o));}i!==this._aliveParticles.length&&this.particlesGeometry.setDrawRange(0,this._aliveParticles.length),this.particlesGeometry.attributes.position.needsUpdate=this._positionDirty,this._needBoundingSphereUpdate=this._needBoundingSphereUpdate||this._positionDirty,this._positionDirty=!1,this._colorsDirty&&(this.particlesGeometry.attributes.color.needsUpdate=!0,this._colorsDirty=!1),this._alphaDirty&&(this.particlesGeometry.attributes.alpha.needsUpdate=!0,this._alphaDirty=!1),this._sizeDirty&&(this.particlesGeometry.attributes.size.needsUpdate=!0,this._sizeDirty=!1),this._rotateDirty&&(this.particlesGeometry.attributes.rotation.needsUpdate=!0,this._rotateDirty=!1),this._needBoundingSphereUpdate&&(this._timeToUpdateBS-=t,this._timeToUpdateBS<=0&&(this._timeToUpdateBS=.2,this.particlesGeometry.computeBoundingSphere())),this.finished||this.options.system.onUpdate&&this.options.system.onUpdate(this);}}}},{key:"spawnParticles",value:function(t){for(var e=0;e<t;++e){if(0===this._deadParticles.length)return;var i=this._deadParticles.pop();i.reset(),this._aliveParticles.push(i);}}},{key:"removeSelf",value:function(){this.particleSystem.parent&&this.particleSystem.parent.remove(this.particleSystem);}},{key:"finished",get:function(){return this.ttlExpired&&0===this.particlesCount}},{key:"ttlExpired",get:function(){return void 0!==this.ttl&&this.ttl<=0}},{key:"particlesCount",get:function(){return this._aliveParticles.length}},{key:"maxParticlesCount",get:function(){return this._aliveParticles.length+this._deadParticles.length}}]),i}(),k=function(){function t(e){p$2(this,t),this.options=e,e.interval=e.interval||1,this.age=0,this.timeToSpawn=Math.random()*A(e.interval);}return d(t,[{key:"update",value:function(t,e){var i=0;if(0===this.age&&this.options.onSpawnBurst&&(i+=A(this.options.onSpawnBurst)),this.age+=t,!this.options.onInterval)return i;(this.timeToSpawn-=t,this.timeToSpawn<=0&&(this.timeToSpawn=A(this.options.interval),i+=A(this.options.onInterval)),this.options.detoretingMinTtl&&e.ttl<this.options.detoretingMinTtl)&&(i*=e.ttl/this.options.detoretingMinTtl);return i}}]),t}(),B=function(){function t(){p$2(this,t);}return d(t,[{key:"generate",value:function(){throw new Error("Not implemented.")}}]),t}(),D=function(t){function i(t,n){var r;return p$2(this,i),(r=m(this,v(i).call(this))).min=t||new Vector3$1(-1,-1,-1),r.max=n||new Vector3$1(1,1,1),r}return f(i,B),d(i,[{key:"generate",value:function(){return z(this.min,this.max)}}]),i}();function G(){return 2*Math.random()-1}var U=function(t){function i(t,e,n,r,o){var s;return p$2(this,i),(s=m(this,v(i).call(this))).maxRadius=t||1,s.minRadius=e||0,s.scaler=n,s.minVector=r,s.maxVector=o,s}return f(i,B),d(i,[{key:"generate",value:function(){var t=new Vector3$1(G(),G(),G());return (this.minVector||this.maxVector)&&t.clamp(this.minVector||new Vector3$1(-1,-1,-1),this.maxVector||new Vector3$1(1,1,1)),t.normalize().multiplyScalar(g(this.minRadius,this.maxRadius)),this.scaler&&t.multiply(this.scaler),t}}]),i}(),W=function(e){function i(e,n){var r;return p$2(this,i),(r=m(this,v(i).call(this))).min=e||new Color$1(0,0,0),r.max=n||new Color$1(1,1,1),r}return f(i,B),d(i,[{key:"generate",value:function(){return S(this.min,this.max)}}]),i}(),I=function(t){function e(t,i){var n;return p$2(this,e),(n=m(this,v(e).call(this))).min=t,n.max=i,n}return f(e,B),d(e,[{key:"generate",value:function(){return g(this.min,this.max)}}]),e}(),N=Object.freeze({__proto__:null,Randomizer:B,BoxRandomizer:D,SphereRandomizer:U,ColorsRandomizer:W,MinMaxRandomizer:I});
76857
76857
  var index$1=/*#__PURE__*/Object.freeze({__proto__:null,Emitter:k,Particle:P,ParticlesSystem:E,Randomizers:N,Utils:b});var PARTICLE_EMITTER_TYPES = {
76858
76858
  SINGLE: 'SINGLE',
76859
76859
  GROUP: 'GROUP'
@@ -81517,7 +81517,1908 @@ var parseQuery = function parseQuery() {
81517
81517
  }).reduce(function (acc, param) {
81518
81518
  return _objectSpread2$1(_objectSpread2$1({}, acc), param);
81519
81519
  }, {}) : EMPTY_QUERY;
81520
- };var isArray$1 = Array.isArray;
81520
+ };var isArray$2 = Array.isArray;
81521
+ function isStringOrNumber$2(o) {
81522
+ var type = typeof o;
81523
+ return type === 'string' || type === 'number';
81524
+ }
81525
+ function isNullOrUndef$3(o) {
81526
+ return o === void 0 || o === null;
81527
+ }
81528
+ function isInvalid$2(o) {
81529
+ return o === null || o === false || o === true || o === void 0;
81530
+ }
81531
+ function isFunction$2(o) {
81532
+ return typeof o === 'function';
81533
+ }
81534
+ function isString$3(o) {
81535
+ return typeof o === 'string';
81536
+ }
81537
+ function isNumber$2(o) {
81538
+ return typeof o === 'number';
81539
+ }
81540
+ function isNull$2(o) {
81541
+ return o === null;
81542
+ }
81543
+ function combineFrom$3(first, second) {
81544
+ var out = {};
81545
+ if (first) {
81546
+ for (var key in first) {
81547
+ out[key] = first[key];
81548
+ }
81549
+ }
81550
+ if (second) {
81551
+ for (var key$1 in second) {
81552
+ out[key$1] = second[key$1];
81553
+ }
81554
+ }
81555
+ return out;
81556
+ }
81557
+ // object.event should always be function, otherwise its badly created object.
81558
+ function isLinkEventObject$1(o) {
81559
+ return !isNull$2(o) && typeof o === 'object';
81560
+ }
81561
+
81562
+ // We need EMPTY_OBJ defined in one place.
81563
+ // Its used for comparison so we cant inline it into shared
81564
+ var EMPTY_OBJ$2 = {};
81565
+ function normalizeEventName$1(name) {
81566
+ return name.substr(2).toLowerCase();
81567
+ }
81568
+ function appendChild$1(parentDOM, dom) {
81569
+ parentDOM.appendChild(dom);
81570
+ }
81571
+ function insertOrAppend$1(parentDOM, newNode, nextNode) {
81572
+ if (isNull$2(nextNode)) {
81573
+ appendChild$1(parentDOM, newNode);
81574
+ }
81575
+ else {
81576
+ parentDOM.insertBefore(newNode, nextNode);
81577
+ }
81578
+ }
81579
+ function documentCreateElement$1(tag, isSVG) {
81580
+ if (isSVG) {
81581
+ return document.createElementNS('http://www.w3.org/2000/svg', tag);
81582
+ }
81583
+ return document.createElement(tag);
81584
+ }
81585
+ function replaceChild$1(parentDOM, newDom, lastDom) {
81586
+ parentDOM.replaceChild(newDom, lastDom);
81587
+ }
81588
+ function removeChild$1(parentDOM, childNode) {
81589
+ parentDOM.removeChild(childNode);
81590
+ }
81591
+ function callAll$1(arrayFn) {
81592
+ var listener;
81593
+ while ((listener = arrayFn.shift()) !== undefined) {
81594
+ listener();
81595
+ }
81596
+ }
81597
+ function findChildVNode$1(vNode, startEdge, flags) {
81598
+ var children = vNode.children;
81599
+ if (flags & 4 /* ComponentClass */) {
81600
+ return children.$LI;
81601
+ }
81602
+ if (flags & 8192 /* Fragment */) {
81603
+ return vNode.childFlags === 2 /* HasVNodeChildren */ ? children : children[startEdge ? 0 : children.length - 1];
81604
+ }
81605
+ return children;
81606
+ }
81607
+ function findDOMfromVNode$1(vNode, startEdge) {
81608
+ var flags;
81609
+ while (vNode) {
81610
+ flags = vNode.flags;
81611
+ if (flags & 2033 /* DOMRef */) {
81612
+ return vNode.dom;
81613
+ }
81614
+ vNode = findChildVNode$1(vNode, startEdge, flags);
81615
+ }
81616
+ return null;
81617
+ }
81618
+ function removeVNodeDOM$1(vNode, parentDOM) {
81619
+ do {
81620
+ var flags = vNode.flags;
81621
+ if (flags & 2033 /* DOMRef */) {
81622
+ removeChild$1(parentDOM, vNode.dom);
81623
+ return;
81624
+ }
81625
+ var children = vNode.children;
81626
+ if (flags & 4 /* ComponentClass */) {
81627
+ vNode = children.$LI;
81628
+ }
81629
+ if (flags & 8 /* ComponentFunction */) {
81630
+ vNode = children;
81631
+ }
81632
+ if (flags & 8192 /* Fragment */) {
81633
+ if (vNode.childFlags === 2 /* HasVNodeChildren */) {
81634
+ vNode = children;
81635
+ }
81636
+ else {
81637
+ for (var i = 0, len = children.length; i < len; ++i) {
81638
+ removeVNodeDOM$1(children[i], parentDOM);
81639
+ }
81640
+ return;
81641
+ }
81642
+ }
81643
+ } while (vNode);
81644
+ }
81645
+ function moveVNodeDOM$1(vNode, parentDOM, nextNode) {
81646
+ do {
81647
+ var flags = vNode.flags;
81648
+ if (flags & 2033 /* DOMRef */) {
81649
+ insertOrAppend$1(parentDOM, vNode.dom, nextNode);
81650
+ return;
81651
+ }
81652
+ var children = vNode.children;
81653
+ if (flags & 4 /* ComponentClass */) {
81654
+ vNode = children.$LI;
81655
+ }
81656
+ if (flags & 8 /* ComponentFunction */) {
81657
+ vNode = children;
81658
+ }
81659
+ if (flags & 8192 /* Fragment */) {
81660
+ if (vNode.childFlags === 2 /* HasVNodeChildren */) {
81661
+ vNode = children;
81662
+ }
81663
+ else {
81664
+ for (var i = 0, len = children.length; i < len; ++i) {
81665
+ moveVNodeDOM$1(children[i], parentDOM, nextNode);
81666
+ }
81667
+ return;
81668
+ }
81669
+ }
81670
+ } while (vNode);
81671
+ }
81672
+ function createDerivedState$1(instance, nextProps, state) {
81673
+ if (instance.constructor.getDerivedStateFromProps) {
81674
+ return combineFrom$3(state, instance.constructor.getDerivedStateFromProps(nextProps, state));
81675
+ }
81676
+ return state;
81677
+ }
81678
+ var options$1 = {
81679
+ componentComparator: null,
81680
+ createVNode: null,
81681
+ renderComplete: null
81682
+ };
81683
+ function setTextContent$1(dom, children) {
81684
+ dom.textContent = children;
81685
+ }
81686
+ // Calling this function assumes, nextValue is linkEvent
81687
+ function isLastValueSameLinkEvent$1(lastValue, nextValue) {
81688
+ return (isLinkEventObject$1(lastValue) &&
81689
+ lastValue.event === nextValue.event &&
81690
+ lastValue.data === nextValue.data);
81691
+ }
81692
+ function safeCall1$1(method, arg1) {
81693
+ return !!isFunction$2(method) && (method(arg1), true);
81694
+ }
81695
+
81696
+ var keyPrefix$2 = '$';
81697
+ function V$2(childFlags, children, className, flags, key, props, ref, type) {
81698
+ this.childFlags = childFlags;
81699
+ this.children = children;
81700
+ this.className = className;
81701
+ this.dom = null;
81702
+ this.flags = flags;
81703
+ this.key = key === void 0 ? null : key;
81704
+ this.props = props === void 0 ? null : props;
81705
+ this.ref = ref === void 0 ? null : ref;
81706
+ this.type = type;
81707
+ }
81708
+ function createVNode$2(flags, type, className, children, childFlags, props, key, ref) {
81709
+ var childFlag = childFlags === void 0 ? 1 /* HasInvalidChildren */ : childFlags;
81710
+ var vNode = new V$2(childFlag, children, className, flags, key, props, ref, type);
81711
+ if (childFlag === 0 /* UnknownChildren */) {
81712
+ normalizeChildren$2(vNode, vNode.children);
81713
+ }
81714
+ return vNode;
81715
+ }
81716
+ function createTextVNode$2(text, key) {
81717
+ return new V$2(1 /* HasInvalidChildren */, isNullOrUndef$3(text) || text === true || text === false ? '' : text, null, 16 /* Text */, key, null, null, null);
81718
+ }
81719
+ function createFragment$2(children, childFlags, key) {
81720
+ var fragment = createVNode$2(8192 /* Fragment */, 8192 /* Fragment */, null, children, childFlags, null, key, null);
81721
+ switch (fragment.childFlags) {
81722
+ case 1 /* HasInvalidChildren */:
81723
+ fragment.children = createVoidVNode$2();
81724
+ fragment.childFlags = 2 /* HasVNodeChildren */;
81725
+ break;
81726
+ case 16 /* HasTextChildren */:
81727
+ fragment.children = [createTextVNode$2(children)];
81728
+ fragment.childFlags = 4 /* HasNonKeyedChildren */;
81729
+ break;
81730
+ }
81731
+ return fragment;
81732
+ }
81733
+ /*
81734
+ * Fragment is different than normal vNode,
81735
+ * because when it needs to be cloned we need to clone its children too
81736
+ * But not normalize, because otherwise those possibly get KEY and re-mount
81737
+ */
81738
+ function cloneFragment$2(vNodeToClone) {
81739
+ var clonedChildren;
81740
+ var oldChildren = vNodeToClone.children;
81741
+ var childFlags = vNodeToClone.childFlags;
81742
+ if (childFlags === 2 /* HasVNodeChildren */) {
81743
+ clonedChildren = directClone$2(oldChildren);
81744
+ }
81745
+ else if (childFlags & 12 /* MultipleChildren */) {
81746
+ clonedChildren = [];
81747
+ for (var i = 0, len = oldChildren.length; i < len; ++i) {
81748
+ clonedChildren.push(directClone$2(oldChildren[i]));
81749
+ }
81750
+ }
81751
+ return createFragment$2(clonedChildren, childFlags, vNodeToClone.key);
81752
+ }
81753
+ function directClone$2(vNodeToClone) {
81754
+ var flags = vNodeToClone.flags & -16385 /* ClearInUse */;
81755
+ var props = vNodeToClone.props;
81756
+ if (flags & 14 /* Component */) {
81757
+ if (!isNull$2(props)) {
81758
+ var propsToClone = props;
81759
+ props = {};
81760
+ for (var key in propsToClone) {
81761
+ props[key] = propsToClone[key];
81762
+ }
81763
+ }
81764
+ }
81765
+ if ((flags & 8192 /* Fragment */) === 0) {
81766
+ return new V$2(vNodeToClone.childFlags, vNodeToClone.children, vNodeToClone.className, flags, vNodeToClone.key, props, vNodeToClone.ref, vNodeToClone.type);
81767
+ }
81768
+ return cloneFragment$2(vNodeToClone);
81769
+ }
81770
+ function createVoidVNode$2() {
81771
+ return createTextVNode$2('', null);
81772
+ }
81773
+ function _normalizeVNodes$2(nodes, result, index, currentKey) {
81774
+ for (var len = nodes.length; index < len; index++) {
81775
+ var n = nodes[index];
81776
+ if (!isInvalid$2(n)) {
81777
+ var newKey = currentKey + keyPrefix$2 + index;
81778
+ if (isArray$2(n)) {
81779
+ _normalizeVNodes$2(n, result, 0, newKey);
81780
+ }
81781
+ else {
81782
+ if (isStringOrNumber$2(n)) {
81783
+ n = createTextVNode$2(n, newKey);
81784
+ }
81785
+ else {
81786
+ var oldKey = n.key;
81787
+ var isPrefixedKey = isString$3(oldKey) && oldKey[0] === keyPrefix$2;
81788
+ if (n.flags & 81920 /* InUseOrNormalized */ || isPrefixedKey) {
81789
+ n = directClone$2(n);
81790
+ }
81791
+ n.flags |= 65536 /* Normalized */;
81792
+ if (!isPrefixedKey) {
81793
+ if (isNull$2(oldKey)) {
81794
+ n.key = newKey;
81795
+ }
81796
+ else {
81797
+ n.key = currentKey + oldKey;
81798
+ }
81799
+ }
81800
+ else if (oldKey.substring(0, currentKey.length) !== currentKey) {
81801
+ n.key = currentKey + oldKey;
81802
+ }
81803
+ }
81804
+ result.push(n);
81805
+ }
81806
+ }
81807
+ }
81808
+ }
81809
+ function normalizeChildren$2(vNode, children) {
81810
+ var newChildren;
81811
+ var newChildFlags = 1 /* HasInvalidChildren */;
81812
+ // Don't change children to match strict equal (===) true in patching
81813
+ if (isInvalid$2(children)) {
81814
+ newChildren = children;
81815
+ }
81816
+ else if (isStringOrNumber$2(children)) {
81817
+ newChildFlags = 16 /* HasTextChildren */;
81818
+ newChildren = children;
81819
+ }
81820
+ else if (isArray$2(children)) {
81821
+ var len = children.length;
81822
+ for (var i = 0; i < len; ++i) {
81823
+ var n = children[i];
81824
+ if (isInvalid$2(n) || isArray$2(n)) {
81825
+ newChildren = newChildren || children.slice(0, i);
81826
+ _normalizeVNodes$2(children, newChildren, i, '');
81827
+ break;
81828
+ }
81829
+ else if (isStringOrNumber$2(n)) {
81830
+ newChildren = newChildren || children.slice(0, i);
81831
+ newChildren.push(createTextVNode$2(n, keyPrefix$2 + i));
81832
+ }
81833
+ else {
81834
+ var key = n.key;
81835
+ var needsCloning = (n.flags & 81920 /* InUseOrNormalized */) > 0;
81836
+ var isNullKey = isNull$2(key);
81837
+ var isPrefixed = isString$3(key) && key[0] === keyPrefix$2;
81838
+ if (needsCloning || isNullKey || isPrefixed) {
81839
+ newChildren = newChildren || children.slice(0, i);
81840
+ if (needsCloning || isPrefixed) {
81841
+ n = directClone$2(n);
81842
+ }
81843
+ if (isNullKey || isPrefixed) {
81844
+ n.key = keyPrefix$2 + i;
81845
+ }
81846
+ newChildren.push(n);
81847
+ }
81848
+ else if (newChildren) {
81849
+ newChildren.push(n);
81850
+ }
81851
+ n.flags |= 65536 /* Normalized */;
81852
+ }
81853
+ }
81854
+ newChildren = newChildren || children;
81855
+ if (newChildren.length === 0) {
81856
+ newChildFlags = 1 /* HasInvalidChildren */;
81857
+ }
81858
+ else {
81859
+ newChildFlags = 8 /* HasKeyedChildren */;
81860
+ }
81861
+ }
81862
+ else {
81863
+ newChildren = children;
81864
+ newChildren.flags |= 65536 /* Normalized */;
81865
+ if (children.flags & 81920 /* InUseOrNormalized */) {
81866
+ newChildren = directClone$2(children);
81867
+ }
81868
+ newChildFlags = 2 /* HasVNodeChildren */;
81869
+ }
81870
+ vNode.children = newChildren;
81871
+ vNode.childFlags = newChildFlags;
81872
+ return vNode;
81873
+ }
81874
+ function normalizeRoot$1(input) {
81875
+ if (isInvalid$2(input) || isStringOrNumber$2(input)) {
81876
+ return createTextVNode$2(input, null);
81877
+ }
81878
+ if (isArray$2(input)) {
81879
+ return createFragment$2(input, 0 /* UnknownChildren */, null);
81880
+ }
81881
+ return input.flags & 16384 /* InUse */ ? directClone$2(input) : input;
81882
+ }
81883
+
81884
+ var xlinkNS$1 = 'http://www.w3.org/1999/xlink';
81885
+ var xmlNS$1 = 'http://www.w3.org/XML/1998/namespace';
81886
+ var namespaces$1 = {
81887
+ 'xlink:actuate': xlinkNS$1,
81888
+ 'xlink:arcrole': xlinkNS$1,
81889
+ 'xlink:href': xlinkNS$1,
81890
+ 'xlink:role': xlinkNS$1,
81891
+ 'xlink:show': xlinkNS$1,
81892
+ 'xlink:title': xlinkNS$1,
81893
+ 'xlink:type': xlinkNS$1,
81894
+ 'xml:base': xmlNS$1,
81895
+ 'xml:lang': xmlNS$1,
81896
+ 'xml:space': xmlNS$1
81897
+ };
81898
+
81899
+ function getDelegatedEventObject$1(v) {
81900
+ return {
81901
+ onClick: v,
81902
+ onDblClick: v,
81903
+ onFocusIn: v,
81904
+ onFocusOut: v,
81905
+ onKeyDown: v,
81906
+ onKeyPress: v,
81907
+ onKeyUp: v,
81908
+ onMouseDown: v,
81909
+ onMouseMove: v,
81910
+ onMouseUp: v,
81911
+ onTouchEnd: v,
81912
+ onTouchMove: v,
81913
+ onTouchStart: v
81914
+ };
81915
+ }
81916
+ var attachedEventCounts$1 = getDelegatedEventObject$1(0);
81917
+ var attachedEvents$1 = getDelegatedEventObject$1(null);
81918
+ var syntheticEvents$1 = getDelegatedEventObject$1(true);
81919
+ function updateOrAddSyntheticEvent$1(name, dom) {
81920
+ var eventsObject = dom.$EV;
81921
+ if (!eventsObject) {
81922
+ eventsObject = dom.$EV = getDelegatedEventObject$1(null);
81923
+ }
81924
+ if (!eventsObject[name]) {
81925
+ if (++attachedEventCounts$1[name] === 1) {
81926
+ attachedEvents$1[name] = attachEventToDocument$1(name);
81927
+ }
81928
+ }
81929
+ return eventsObject;
81930
+ }
81931
+ function unmountSyntheticEvent$1(name, dom) {
81932
+ var eventsObject = dom.$EV;
81933
+ if (eventsObject && eventsObject[name]) {
81934
+ if (--attachedEventCounts$1[name] === 0) {
81935
+ document.removeEventListener(normalizeEventName$1(name), attachedEvents$1[name]);
81936
+ attachedEvents$1[name] = null;
81937
+ }
81938
+ eventsObject[name] = null;
81939
+ }
81940
+ }
81941
+ function handleSyntheticEvent$1(name, lastEvent, nextEvent, dom) {
81942
+ if (isFunction$2(nextEvent)) {
81943
+ updateOrAddSyntheticEvent$1(name, dom)[name] = nextEvent;
81944
+ }
81945
+ else if (isLinkEventObject$1(nextEvent)) {
81946
+ if (isLastValueSameLinkEvent$1(lastEvent, nextEvent)) {
81947
+ return;
81948
+ }
81949
+ updateOrAddSyntheticEvent$1(name, dom)[name] = nextEvent;
81950
+ }
81951
+ else {
81952
+ unmountSyntheticEvent$1(name, dom);
81953
+ }
81954
+ }
81955
+ // When browsers fully support event.composedPath we could loop it through instead of using parentNode property
81956
+ function getTargetNode$1(event) {
81957
+ return isFunction$2(event.composedPath) ? event.composedPath()[0] : event.target;
81958
+ }
81959
+ function dispatchEvents$1(event, isClick, name, eventData) {
81960
+ var dom = getTargetNode$1(event);
81961
+ do {
81962
+ // Html Nodes can be nested fe: span inside button in that scenario browser does not handle disabled attribute on parent,
81963
+ // because the event listener is on document.body
81964
+ // Don't process clicks on disabled elements
81965
+ if (isClick && dom.disabled) {
81966
+ return;
81967
+ }
81968
+ var eventsObject = dom.$EV;
81969
+ if (eventsObject) {
81970
+ var currentEvent = eventsObject[name];
81971
+ if (currentEvent) {
81972
+ // linkEvent object
81973
+ eventData.dom = dom;
81974
+ currentEvent.event ? currentEvent.event(currentEvent.data, event) : currentEvent(event);
81975
+ if (event.cancelBubble) {
81976
+ return;
81977
+ }
81978
+ }
81979
+ }
81980
+ dom = dom.parentNode;
81981
+ } while (!isNull$2(dom));
81982
+ }
81983
+ function stopPropagation$1() {
81984
+ this.cancelBubble = true;
81985
+ if (!this.immediatePropagationStopped) {
81986
+ this.stopImmediatePropagation();
81987
+ }
81988
+ }
81989
+ function isDefaultPrevented$1() {
81990
+ return this.defaultPrevented;
81991
+ }
81992
+ function isPropagationStopped$1() {
81993
+ return this.cancelBubble;
81994
+ }
81995
+ function extendEventProperties$1(event) {
81996
+ // Event data needs to be object to save reference to currentTarget getter
81997
+ var eventData = {
81998
+ dom: document
81999
+ };
82000
+ event.isDefaultPrevented = isDefaultPrevented$1;
82001
+ event.isPropagationStopped = isPropagationStopped$1;
82002
+ event.stopPropagation = stopPropagation$1;
82003
+ Object.defineProperty(event, 'currentTarget', {
82004
+ configurable: true,
82005
+ get: function get() {
82006
+ return eventData.dom;
82007
+ }
82008
+ });
82009
+ return eventData;
82010
+ }
82011
+ function rootClickEvent$1(name) {
82012
+ return function (event) {
82013
+ if (event.button !== 0) {
82014
+ // Firefox incorrectly triggers click event for mid/right mouse buttons.
82015
+ // This bug has been active for 17 years.
82016
+ // https://bugzilla.mozilla.org/show_bug.cgi?id=184051
82017
+ event.stopPropagation();
82018
+ return;
82019
+ }
82020
+ dispatchEvents$1(event, true, name, extendEventProperties$1(event));
82021
+ };
82022
+ }
82023
+ function rootEvent$1(name) {
82024
+ return function (event) {
82025
+ dispatchEvents$1(event, false, name, extendEventProperties$1(event));
82026
+ };
82027
+ }
82028
+ function attachEventToDocument$1(name) {
82029
+ var attachedEvent = name === 'onClick' || name === 'onDblClick' ? rootClickEvent$1(name) : rootEvent$1(name);
82030
+ document.addEventListener(normalizeEventName$1(name), attachedEvent);
82031
+ return attachedEvent;
82032
+ }
82033
+
82034
+ function isSameInnerHTML$1(dom, innerHTML) {
82035
+ var tempdom = document.createElement('i');
82036
+ tempdom.innerHTML = innerHTML;
82037
+ return tempdom.innerHTML === dom.innerHTML;
82038
+ }
82039
+
82040
+ function triggerEventListener$2(props, methodName, e) {
82041
+ if (props[methodName]) {
82042
+ var listener = props[methodName];
82043
+ if (listener.event) {
82044
+ listener.event(listener.data, e);
82045
+ }
82046
+ else {
82047
+ listener(e);
82048
+ }
82049
+ }
82050
+ else {
82051
+ var nativeListenerName = methodName.toLowerCase();
82052
+ if (props[nativeListenerName]) {
82053
+ props[nativeListenerName](e);
82054
+ }
82055
+ }
82056
+ }
82057
+ function createWrappedFunction$2(methodName, applyValue) {
82058
+ var fnMethod = function (e) {
82059
+ var vNode = this.$V;
82060
+ // If vNode is gone by the time event fires, no-op
82061
+ if (!vNode) {
82062
+ return;
82063
+ }
82064
+ var props = vNode.props || EMPTY_OBJ$2;
82065
+ var dom = vNode.dom;
82066
+ if (isString$3(methodName)) {
82067
+ triggerEventListener$2(props, methodName, e);
82068
+ }
82069
+ else {
82070
+ for (var i = 0; i < methodName.length; ++i) {
82071
+ triggerEventListener$2(props, methodName[i], e);
82072
+ }
82073
+ }
82074
+ if (isFunction$2(applyValue)) {
82075
+ var newVNode = this.$V;
82076
+ var newProps = newVNode.props || EMPTY_OBJ$2;
82077
+ applyValue(newProps, dom, false, newVNode);
82078
+ }
82079
+ };
82080
+ Object.defineProperty(fnMethod, 'wrapped', {
82081
+ configurable: false,
82082
+ enumerable: false,
82083
+ value: true,
82084
+ writable: false
82085
+ });
82086
+ return fnMethod;
82087
+ }
82088
+
82089
+ function attachEvent$1(dom, eventName, handler) {
82090
+ var previousKey = "$" + eventName;
82091
+ var previousArgs = dom[previousKey];
82092
+ if (previousArgs) {
82093
+ if (previousArgs[1].wrapped) {
82094
+ return;
82095
+ }
82096
+ dom.removeEventListener(previousArgs[0], previousArgs[1]);
82097
+ dom[previousKey] = null;
82098
+ }
82099
+ if (isFunction$2(handler)) {
82100
+ dom.addEventListener(eventName, handler);
82101
+ dom[previousKey] = [eventName, handler];
82102
+ }
82103
+ }
82104
+
82105
+ function isCheckedType$2(type) {
82106
+ return type === 'checkbox' || type === 'radio';
82107
+ }
82108
+ var onTextInputChange$1 = createWrappedFunction$2('onInput', applyValueInput$2);
82109
+ var wrappedOnChange$2 = createWrappedFunction$2(['onClick', 'onChange'], applyValueInput$2);
82110
+ /* tslint:disable-next-line:no-empty */
82111
+ function emptywrapper$1(event) {
82112
+ event.stopPropagation();
82113
+ }
82114
+ emptywrapper$1.wrapped = true;
82115
+ function inputEvents$1(dom, nextPropsOrEmpty) {
82116
+ if (isCheckedType$2(nextPropsOrEmpty.type)) {
82117
+ attachEvent$1(dom, 'change', wrappedOnChange$2);
82118
+ attachEvent$1(dom, 'click', emptywrapper$1);
82119
+ }
82120
+ else {
82121
+ attachEvent$1(dom, 'input', onTextInputChange$1);
82122
+ }
82123
+ }
82124
+ function applyValueInput$2(nextPropsOrEmpty, dom) {
82125
+ var type = nextPropsOrEmpty.type;
82126
+ var value = nextPropsOrEmpty.value;
82127
+ var checked = nextPropsOrEmpty.checked;
82128
+ var multiple = nextPropsOrEmpty.multiple;
82129
+ var defaultValue = nextPropsOrEmpty.defaultValue;
82130
+ var hasValue = !isNullOrUndef$3(value);
82131
+ if (type && type !== dom.type) {
82132
+ dom.setAttribute('type', type);
82133
+ }
82134
+ if (!isNullOrUndef$3(multiple) && multiple !== dom.multiple) {
82135
+ dom.multiple = multiple;
82136
+ }
82137
+ if (!isNullOrUndef$3(defaultValue) && !hasValue) {
82138
+ dom.defaultValue = defaultValue + '';
82139
+ }
82140
+ if (isCheckedType$2(type)) {
82141
+ if (hasValue) {
82142
+ dom.value = value;
82143
+ }
82144
+ if (!isNullOrUndef$3(checked)) {
82145
+ dom.checked = checked;
82146
+ }
82147
+ }
82148
+ else {
82149
+ if (hasValue && dom.value !== value) {
82150
+ dom.defaultValue = value;
82151
+ dom.value = value;
82152
+ }
82153
+ else if (!isNullOrUndef$3(checked)) {
82154
+ dom.checked = checked;
82155
+ }
82156
+ }
82157
+ }
82158
+
82159
+ function updateChildOptions$2(vNode, value) {
82160
+ if (vNode.type === 'option') {
82161
+ updateChildOption$2(vNode, value);
82162
+ }
82163
+ else {
82164
+ var children = vNode.children;
82165
+ var flags = vNode.flags;
82166
+ if (flags & 4 /* ComponentClass */) {
82167
+ updateChildOptions$2(children.$LI, value);
82168
+ }
82169
+ else if (flags & 8 /* ComponentFunction */) {
82170
+ updateChildOptions$2(children, value);
82171
+ }
82172
+ else if (vNode.childFlags === 2 /* HasVNodeChildren */) {
82173
+ updateChildOptions$2(children, value);
82174
+ }
82175
+ else if (vNode.childFlags & 12 /* MultipleChildren */) {
82176
+ for (var i = 0, len = children.length; i < len; ++i) {
82177
+ updateChildOptions$2(children[i], value);
82178
+ }
82179
+ }
82180
+ }
82181
+ }
82182
+ function updateChildOption$2(vNode, value) {
82183
+ var props = vNode.props || EMPTY_OBJ$2;
82184
+ var dom = vNode.dom;
82185
+ // we do this as multiple may have changed
82186
+ dom.value = props.value;
82187
+ if (props.value === value || (isArray$2(value) && value.indexOf(props.value) !== -1)) {
82188
+ dom.selected = true;
82189
+ }
82190
+ else if (!isNullOrUndef$3(value) || !isNullOrUndef$3(props.selected)) {
82191
+ dom.selected = props.selected || false;
82192
+ }
82193
+ }
82194
+ var onSelectChange$1 = createWrappedFunction$2('onChange', applyValueSelect$2);
82195
+ function selectEvents$1(dom) {
82196
+ attachEvent$1(dom, 'change', onSelectChange$1);
82197
+ }
82198
+ function applyValueSelect$2(nextPropsOrEmpty, dom, mounting, vNode) {
82199
+ var multiplePropInBoolean = Boolean(nextPropsOrEmpty.multiple);
82200
+ if (!isNullOrUndef$3(nextPropsOrEmpty.multiple) && multiplePropInBoolean !== dom.multiple) {
82201
+ dom.multiple = multiplePropInBoolean;
82202
+ }
82203
+ var index = nextPropsOrEmpty.selectedIndex;
82204
+ if (index === -1) {
82205
+ dom.selectedIndex = -1;
82206
+ }
82207
+ var childFlags = vNode.childFlags;
82208
+ if (childFlags !== 1 /* HasInvalidChildren */) {
82209
+ var value = nextPropsOrEmpty.value;
82210
+ if (isNumber$2(index) && index > -1 && dom.options[index]) {
82211
+ value = dom.options[index].value;
82212
+ }
82213
+ if (mounting && isNullOrUndef$3(value)) {
82214
+ value = nextPropsOrEmpty.defaultValue;
82215
+ }
82216
+ updateChildOptions$2(vNode, value);
82217
+ }
82218
+ }
82219
+
82220
+ var onTextareaInputChange$1 = createWrappedFunction$2('onInput', applyValueTextArea$2);
82221
+ var wrappedOnChange$1$1 = createWrappedFunction$2('onChange');
82222
+ function textAreaEvents$1(dom, nextPropsOrEmpty) {
82223
+ attachEvent$1(dom, 'input', onTextareaInputChange$1);
82224
+ if (nextPropsOrEmpty.onChange) {
82225
+ attachEvent$1(dom, 'change', wrappedOnChange$1$1);
82226
+ }
82227
+ }
82228
+ function applyValueTextArea$2(nextPropsOrEmpty, dom, mounting) {
82229
+ var value = nextPropsOrEmpty.value;
82230
+ var domValue = dom.value;
82231
+ if (isNullOrUndef$3(value)) {
82232
+ if (mounting) {
82233
+ var defaultValue = nextPropsOrEmpty.defaultValue;
82234
+ if (!isNullOrUndef$3(defaultValue) && defaultValue !== domValue) {
82235
+ dom.defaultValue = defaultValue;
82236
+ dom.value = defaultValue;
82237
+ }
82238
+ }
82239
+ }
82240
+ else if (domValue !== value) {
82241
+ /* There is value so keep it controlled */
82242
+ dom.defaultValue = value;
82243
+ dom.value = value;
82244
+ }
82245
+ }
82246
+
82247
+ /**
82248
+ * There is currently no support for switching same input between controlled and nonControlled
82249
+ * If that ever becomes a real issue, then re design controlled elements
82250
+ * Currently user must choose either controlled or non-controlled and stick with that
82251
+ */
82252
+ function processElement$1(flags, vNode, dom, nextPropsOrEmpty, mounting, isControlled) {
82253
+ if (flags & 64 /* InputElement */) {
82254
+ applyValueInput$2(nextPropsOrEmpty, dom);
82255
+ }
82256
+ else if (flags & 256 /* SelectElement */) {
82257
+ applyValueSelect$2(nextPropsOrEmpty, dom, mounting, vNode);
82258
+ }
82259
+ else if (flags & 128 /* TextareaElement */) {
82260
+ applyValueTextArea$2(nextPropsOrEmpty, dom, mounting);
82261
+ }
82262
+ if (isControlled) {
82263
+ dom.$V = vNode;
82264
+ }
82265
+ }
82266
+ function addFormElementEventHandlers$1(flags, dom, nextPropsOrEmpty) {
82267
+ if (flags & 64 /* InputElement */) {
82268
+ inputEvents$1(dom, nextPropsOrEmpty);
82269
+ }
82270
+ else if (flags & 256 /* SelectElement */) {
82271
+ selectEvents$1(dom);
82272
+ }
82273
+ else if (flags & 128 /* TextareaElement */) {
82274
+ textAreaEvents$1(dom, nextPropsOrEmpty);
82275
+ }
82276
+ }
82277
+ function isControlledFormElement$1(nextPropsOrEmpty) {
82278
+ return nextPropsOrEmpty.type && isCheckedType$2(nextPropsOrEmpty.type) ? !isNullOrUndef$3(nextPropsOrEmpty.checked) : !isNullOrUndef$3(nextPropsOrEmpty.value);
82279
+ }
82280
+ function unmountRef$1(ref) {
82281
+ if (ref) {
82282
+ if (!safeCall1$1(ref, null) && ref.current) {
82283
+ ref.current = null;
82284
+ }
82285
+ }
82286
+ }
82287
+ function mountRef$1(ref, value, lifecycle) {
82288
+ if (ref && (isFunction$2(ref) || ref.current !== void 0)) {
82289
+ lifecycle.push(function () {
82290
+ if (!safeCall1$1(ref, value) && ref.current !== void 0) {
82291
+ ref.current = value;
82292
+ }
82293
+ });
82294
+ }
82295
+ }
82296
+
82297
+ function remove$1(vNode, parentDOM) {
82298
+ unmount$2(vNode);
82299
+ removeVNodeDOM$1(vNode, parentDOM);
82300
+ }
82301
+ function unmount$2(vNode) {
82302
+ var flags = vNode.flags;
82303
+ var children = vNode.children;
82304
+ var ref;
82305
+ if (flags & 481 /* Element */) {
82306
+ ref = vNode.ref;
82307
+ var props = vNode.props;
82308
+ unmountRef$1(ref);
82309
+ var childFlags = vNode.childFlags;
82310
+ if (!isNull$2(props)) {
82311
+ var keys = Object.keys(props);
82312
+ for (var i = 0, len = keys.length; i < len; i++) {
82313
+ var key = keys[i];
82314
+ if (syntheticEvents$1[key]) {
82315
+ unmountSyntheticEvent$1(key, vNode.dom);
82316
+ }
82317
+ }
82318
+ }
82319
+ if (childFlags & 12 /* MultipleChildren */) {
82320
+ unmountAllChildren$1(children);
82321
+ }
82322
+ else if (childFlags === 2 /* HasVNodeChildren */) {
82323
+ unmount$2(children);
82324
+ }
82325
+ }
82326
+ else if (children) {
82327
+ if (flags & 4 /* ComponentClass */) {
82328
+ if (isFunction$2(children.componentWillUnmount)) {
82329
+ children.componentWillUnmount();
82330
+ }
82331
+ unmountRef$1(vNode.ref);
82332
+ children.$UN = true;
82333
+ unmount$2(children.$LI);
82334
+ }
82335
+ else if (flags & 8 /* ComponentFunction */) {
82336
+ ref = vNode.ref;
82337
+ if (!isNullOrUndef$3(ref) && isFunction$2(ref.onComponentWillUnmount)) {
82338
+ ref.onComponentWillUnmount(findDOMfromVNode$1(vNode, true), vNode.props || EMPTY_OBJ$2);
82339
+ }
82340
+ unmount$2(children);
82341
+ }
82342
+ else if (flags & 1024 /* Portal */) {
82343
+ remove$1(children, vNode.ref);
82344
+ }
82345
+ else if (flags & 8192 /* Fragment */) {
82346
+ if (vNode.childFlags & 12 /* MultipleChildren */) {
82347
+ unmountAllChildren$1(children);
82348
+ }
82349
+ }
82350
+ }
82351
+ }
82352
+ function unmountAllChildren$1(children) {
82353
+ for (var i = 0, len = children.length; i < len; ++i) {
82354
+ unmount$2(children[i]);
82355
+ }
82356
+ }
82357
+ function clearDOM$1(dom) {
82358
+ // Optimization for clearing dom
82359
+ dom.textContent = '';
82360
+ }
82361
+ function removeAllChildren$1(dom, vNode, children) {
82362
+ unmountAllChildren$1(children);
82363
+ if (vNode.flags & 8192 /* Fragment */) {
82364
+ removeVNodeDOM$1(vNode, dom);
82365
+ }
82366
+ else {
82367
+ clearDOM$1(dom);
82368
+ }
82369
+ }
82370
+
82371
+ function wrapLinkEvent$1(nextValue) {
82372
+ // This variable makes sure there is no "this" context in callback
82373
+ var ev = nextValue.event;
82374
+ return function (e) {
82375
+ ev(nextValue.data, e);
82376
+ };
82377
+ }
82378
+ function patchEvent$1(name, lastValue, nextValue, dom) {
82379
+ if (isLinkEventObject$1(nextValue)) {
82380
+ if (isLastValueSameLinkEvent$1(lastValue, nextValue)) {
82381
+ return;
82382
+ }
82383
+ nextValue = wrapLinkEvent$1(nextValue);
82384
+ }
82385
+ attachEvent$1(dom, normalizeEventName$1(name), nextValue);
82386
+ }
82387
+ // We are assuming here that we come from patchProp routine
82388
+ // -nextAttrValue cannot be null or undefined
82389
+ function patchStyle$1(lastAttrValue, nextAttrValue, dom) {
82390
+ if (isNullOrUndef$3(nextAttrValue)) {
82391
+ dom.removeAttribute('style');
82392
+ return;
82393
+ }
82394
+ var domStyle = dom.style;
82395
+ var style;
82396
+ var value;
82397
+ if (isString$3(nextAttrValue)) {
82398
+ domStyle.cssText = nextAttrValue;
82399
+ return;
82400
+ }
82401
+ if (!isNullOrUndef$3(lastAttrValue) && !isString$3(lastAttrValue)) {
82402
+ for (style in nextAttrValue) {
82403
+ // do not add a hasOwnProperty check here, it affects performance
82404
+ value = nextAttrValue[style];
82405
+ if (value !== lastAttrValue[style]) {
82406
+ domStyle.setProperty(style, value);
82407
+ }
82408
+ }
82409
+ for (style in lastAttrValue) {
82410
+ if (isNullOrUndef$3(nextAttrValue[style])) {
82411
+ domStyle.removeProperty(style);
82412
+ }
82413
+ }
82414
+ }
82415
+ else {
82416
+ for (style in nextAttrValue) {
82417
+ value = nextAttrValue[style];
82418
+ domStyle.setProperty(style, value);
82419
+ }
82420
+ }
82421
+ }
82422
+ function patchDangerInnerHTML$1(lastValue, nextValue, lastVNode, dom) {
82423
+ var lastHtml = (lastValue && lastValue.__html) || '';
82424
+ var nextHtml = (nextValue && nextValue.__html) || '';
82425
+ if (lastHtml !== nextHtml) {
82426
+ if (!isNullOrUndef$3(nextHtml) && !isSameInnerHTML$1(dom, nextHtml)) {
82427
+ if (!isNull$2(lastVNode)) {
82428
+ if (lastVNode.childFlags & 12 /* MultipleChildren */) {
82429
+ unmountAllChildren$1(lastVNode.children);
82430
+ }
82431
+ else if (lastVNode.childFlags === 2 /* HasVNodeChildren */) {
82432
+ unmount$2(lastVNode.children);
82433
+ }
82434
+ lastVNode.children = null;
82435
+ lastVNode.childFlags = 1 /* HasInvalidChildren */;
82436
+ }
82437
+ dom.innerHTML = nextHtml;
82438
+ }
82439
+ }
82440
+ }
82441
+ function patchProp$1(prop, lastValue, nextValue, dom, isSVG, hasControlledValue, lastVNode) {
82442
+ switch (prop) {
82443
+ case 'children':
82444
+ case 'childrenType':
82445
+ case 'className':
82446
+ case 'defaultValue':
82447
+ case 'key':
82448
+ case 'multiple':
82449
+ case 'ref':
82450
+ case 'selectedIndex':
82451
+ break;
82452
+ case 'autoFocus':
82453
+ dom.autofocus = !!nextValue;
82454
+ break;
82455
+ case 'allowfullscreen':
82456
+ case 'autoplay':
82457
+ case 'capture':
82458
+ case 'checked':
82459
+ case 'controls':
82460
+ case 'default':
82461
+ case 'disabled':
82462
+ case 'hidden':
82463
+ case 'indeterminate':
82464
+ case 'loop':
82465
+ case 'muted':
82466
+ case 'novalidate':
82467
+ case 'open':
82468
+ case 'readOnly':
82469
+ case 'required':
82470
+ case 'reversed':
82471
+ case 'scoped':
82472
+ case 'seamless':
82473
+ case 'selected':
82474
+ dom[prop] = !!nextValue;
82475
+ break;
82476
+ case 'defaultChecked':
82477
+ case 'value':
82478
+ case 'volume':
82479
+ if (hasControlledValue && prop === 'value') {
82480
+ break;
82481
+ }
82482
+ var value = isNullOrUndef$3(nextValue) ? '' : nextValue;
82483
+ if (dom[prop] !== value) {
82484
+ dom[prop] = value;
82485
+ }
82486
+ break;
82487
+ case 'style':
82488
+ patchStyle$1(lastValue, nextValue, dom);
82489
+ break;
82490
+ case 'dangerouslySetInnerHTML':
82491
+ patchDangerInnerHTML$1(lastValue, nextValue, lastVNode, dom);
82492
+ break;
82493
+ default:
82494
+ if (syntheticEvents$1[prop]) {
82495
+ handleSyntheticEvent$1(prop, lastValue, nextValue, dom);
82496
+ }
82497
+ else if (prop.charCodeAt(0) === 111 && prop.charCodeAt(1) === 110) {
82498
+ patchEvent$1(prop, lastValue, nextValue, dom);
82499
+ }
82500
+ else if (isNullOrUndef$3(nextValue)) {
82501
+ dom.removeAttribute(prop);
82502
+ }
82503
+ else if (isSVG && namespaces$1[prop]) {
82504
+ // We optimize for isSVG being false
82505
+ // If we end up in this path we can read property again
82506
+ dom.setAttributeNS(namespaces$1[prop], prop, nextValue);
82507
+ }
82508
+ else {
82509
+ dom.setAttribute(prop, nextValue);
82510
+ }
82511
+ break;
82512
+ }
82513
+ }
82514
+ function mountProps$1(vNode, flags, props, dom, isSVG) {
82515
+ var hasControlledValue = false;
82516
+ var isFormElement = (flags & 448 /* FormElement */) > 0;
82517
+ if (isFormElement) {
82518
+ hasControlledValue = isControlledFormElement$1(props);
82519
+ if (hasControlledValue) {
82520
+ addFormElementEventHandlers$1(flags, dom, props);
82521
+ }
82522
+ }
82523
+ for (var prop in props) {
82524
+ // do not add a hasOwnProperty check here, it affects performance
82525
+ patchProp$1(prop, null, props[prop], dom, isSVG, hasControlledValue, null);
82526
+ }
82527
+ if (isFormElement) {
82528
+ processElement$1(flags, vNode, dom, props, true, hasControlledValue);
82529
+ }
82530
+ }
82531
+
82532
+ function renderNewInput$1(instance, props, context) {
82533
+ var nextInput = normalizeRoot$1(instance.render(props, instance.state, context));
82534
+ var childContext = context;
82535
+ if (isFunction$2(instance.getChildContext)) {
82536
+ childContext = combineFrom$3(context, instance.getChildContext());
82537
+ }
82538
+ instance.$CX = childContext;
82539
+ return nextInput;
82540
+ }
82541
+ function createClassComponentInstance$1(vNode, Component, props, context, isSVG, lifecycle) {
82542
+ var instance = new Component(props, context);
82543
+ var usesNewAPI = (instance.$N = Boolean(Component.getDerivedStateFromProps || instance.getSnapshotBeforeUpdate));
82544
+ instance.$SVG = isSVG;
82545
+ instance.$L = lifecycle;
82546
+ vNode.children = instance;
82547
+ instance.$BS = false;
82548
+ instance.context = context;
82549
+ if (instance.props === EMPTY_OBJ$2) {
82550
+ instance.props = props;
82551
+ }
82552
+ if (!usesNewAPI) {
82553
+ if (isFunction$2(instance.componentWillMount)) {
82554
+ instance.$BR = true;
82555
+ instance.componentWillMount();
82556
+ var pending = instance.$PS;
82557
+ if (!isNull$2(pending)) {
82558
+ var state = instance.state;
82559
+ if (isNull$2(state)) {
82560
+ instance.state = pending;
82561
+ }
82562
+ else {
82563
+ for (var key in pending) {
82564
+ state[key] = pending[key];
82565
+ }
82566
+ }
82567
+ instance.$PS = null;
82568
+ }
82569
+ instance.$BR = false;
82570
+ }
82571
+ }
82572
+ else {
82573
+ instance.state = createDerivedState$1(instance, props, instance.state);
82574
+ }
82575
+ instance.$LI = renderNewInput$1(instance, props, context);
82576
+ return instance;
82577
+ }
82578
+
82579
+ function mount$2(vNode, parentDOM, context, isSVG, nextNode, lifecycle) {
82580
+ var flags = (vNode.flags |= 16384 /* InUse */);
82581
+ if (flags & 481 /* Element */) {
82582
+ mountElement$1(vNode, parentDOM, context, isSVG, nextNode, lifecycle);
82583
+ }
82584
+ else if (flags & 4 /* ComponentClass */) {
82585
+ mountClassComponent$1(vNode, parentDOM, context, isSVG, nextNode, lifecycle);
82586
+ }
82587
+ else if (flags & 8 /* ComponentFunction */) {
82588
+ mountFunctionalComponent$1(vNode, parentDOM, context, isSVG, nextNode, lifecycle);
82589
+ mountFunctionalComponentCallbacks$1(vNode, lifecycle);
82590
+ }
82591
+ else if (flags & 512 /* Void */ || flags & 16 /* Text */) {
82592
+ mountText$1(vNode, parentDOM, nextNode);
82593
+ }
82594
+ else if (flags & 8192 /* Fragment */) {
82595
+ mountFragment$1(vNode, context, parentDOM, isSVG, nextNode, lifecycle);
82596
+ }
82597
+ else if (flags & 1024 /* Portal */) {
82598
+ mountPortal$1(vNode, context, parentDOM, nextNode, lifecycle);
82599
+ }
82600
+ }
82601
+ function mountPortal$1(vNode, context, parentDOM, nextNode, lifecycle) {
82602
+ mount$2(vNode.children, vNode.ref, context, false, null, lifecycle);
82603
+ var placeHolderVNode = createVoidVNode$2();
82604
+ mountText$1(placeHolderVNode, parentDOM, nextNode);
82605
+ vNode.dom = placeHolderVNode.dom;
82606
+ }
82607
+ function mountFragment$1(vNode, context, parentDOM, isSVG, nextNode, lifecycle) {
82608
+ var children = vNode.children;
82609
+ var childFlags = vNode.childFlags;
82610
+ // When fragment is optimized for multiple children, check if there is no children and change flag to invalid
82611
+ // This is the only normalization always done, to keep optimization flags API same for fragments and regular elements
82612
+ if (childFlags & 12 /* MultipleChildren */ && children.length === 0) {
82613
+ childFlags = vNode.childFlags = 2 /* HasVNodeChildren */;
82614
+ children = vNode.children = createVoidVNode$2();
82615
+ }
82616
+ if (childFlags === 2 /* HasVNodeChildren */) {
82617
+ mount$2(children, parentDOM, nextNode, isSVG, nextNode, lifecycle);
82618
+ }
82619
+ else {
82620
+ mountArrayChildren$1(children, parentDOM, context, isSVG, nextNode, lifecycle);
82621
+ }
82622
+ }
82623
+ function mountText$1(vNode, parentDOM, nextNode) {
82624
+ var dom = (vNode.dom = document.createTextNode(vNode.children));
82625
+ if (!isNull$2(parentDOM)) {
82626
+ insertOrAppend$1(parentDOM, dom, nextNode);
82627
+ }
82628
+ }
82629
+ function mountElement$1(vNode, parentDOM, context, isSVG, nextNode, lifecycle) {
82630
+ var flags = vNode.flags;
82631
+ var props = vNode.props;
82632
+ var className = vNode.className;
82633
+ var children = vNode.children;
82634
+ var childFlags = vNode.childFlags;
82635
+ var dom = (vNode.dom = documentCreateElement$1(vNode.type, (isSVG = isSVG || (flags & 32 /* SvgElement */) > 0)));
82636
+ if (!isNullOrUndef$3(className) && className !== '') {
82637
+ if (isSVG) {
82638
+ dom.setAttribute('class', className);
82639
+ }
82640
+ else {
82641
+ dom.className = className;
82642
+ }
82643
+ }
82644
+ if (childFlags === 16 /* HasTextChildren */) {
82645
+ setTextContent$1(dom, children);
82646
+ }
82647
+ else if (childFlags !== 1 /* HasInvalidChildren */) {
82648
+ var childrenIsSVG = isSVG && vNode.type !== 'foreignObject';
82649
+ if (childFlags === 2 /* HasVNodeChildren */) {
82650
+ if (children.flags & 16384 /* InUse */) {
82651
+ vNode.children = children = directClone$2(children);
82652
+ }
82653
+ mount$2(children, dom, context, childrenIsSVG, null, lifecycle);
82654
+ }
82655
+ else if (childFlags === 8 /* HasKeyedChildren */ || childFlags === 4 /* HasNonKeyedChildren */) {
82656
+ mountArrayChildren$1(children, dom, context, childrenIsSVG, null, lifecycle);
82657
+ }
82658
+ }
82659
+ if (!isNull$2(parentDOM)) {
82660
+ insertOrAppend$1(parentDOM, dom, nextNode);
82661
+ }
82662
+ if (!isNull$2(props)) {
82663
+ mountProps$1(vNode, flags, props, dom, isSVG);
82664
+ }
82665
+ mountRef$1(vNode.ref, dom, lifecycle);
82666
+ }
82667
+ function mountArrayChildren$1(children, dom, context, isSVG, nextNode, lifecycle) {
82668
+ for (var i = 0; i < children.length; ++i) {
82669
+ var child = children[i];
82670
+ if (child.flags & 16384 /* InUse */) {
82671
+ children[i] = child = directClone$2(child);
82672
+ }
82673
+ mount$2(child, dom, context, isSVG, nextNode, lifecycle);
82674
+ }
82675
+ }
82676
+ function mountClassComponent$1(vNode, parentDOM, context, isSVG, nextNode, lifecycle) {
82677
+ var instance = createClassComponentInstance$1(vNode, vNode.type, vNode.props || EMPTY_OBJ$2, context, isSVG, lifecycle);
82678
+ mount$2(instance.$LI, parentDOM, instance.$CX, isSVG, nextNode, lifecycle);
82679
+ mountClassComponentCallbacks$1(vNode.ref, instance, lifecycle);
82680
+ }
82681
+ function renderFunctionalComponent$1(vNode, context) {
82682
+ return vNode.flags & 32768 /* ForwardRef */ ? vNode.type.render(vNode.props || EMPTY_OBJ$2, vNode.ref, context) : vNode.type(vNode.props || EMPTY_OBJ$2, context);
82683
+ }
82684
+ function mountFunctionalComponent$1(vNode, parentDOM, context, isSVG, nextNode, lifecycle) {
82685
+ mount$2((vNode.children = normalizeRoot$1(renderFunctionalComponent$1(vNode, context))), parentDOM, context, isSVG, nextNode, lifecycle);
82686
+ }
82687
+ function createClassMountCallback$1(instance) {
82688
+ return function () {
82689
+ instance.componentDidMount();
82690
+ };
82691
+ }
82692
+ function mountClassComponentCallbacks$1(ref, instance, lifecycle) {
82693
+ mountRef$1(ref, instance, lifecycle);
82694
+ if (isFunction$2(instance.componentDidMount)) {
82695
+ lifecycle.push(createClassMountCallback$1(instance));
82696
+ }
82697
+ }
82698
+ function createOnMountCallback$1(ref, vNode) {
82699
+ return function () {
82700
+ ref.onComponentDidMount(findDOMfromVNode$1(vNode, true), vNode.props || EMPTY_OBJ$2);
82701
+ };
82702
+ }
82703
+ function mountFunctionalComponentCallbacks$1(vNode, lifecycle) {
82704
+ var ref = vNode.ref;
82705
+ if (!isNullOrUndef$3(ref)) {
82706
+ safeCall1$1(ref.onComponentWillMount, vNode.props || EMPTY_OBJ$2);
82707
+ if (isFunction$2(ref.onComponentDidMount)) {
82708
+ lifecycle.push(createOnMountCallback$1(ref, vNode));
82709
+ }
82710
+ }
82711
+ }
82712
+
82713
+ function replaceWithNewNode$1(lastVNode, nextVNode, parentDOM, context, isSVG, lifecycle) {
82714
+ unmount$2(lastVNode);
82715
+ if ((nextVNode.flags & lastVNode.flags & 2033 /* DOMRef */) !== 0) {
82716
+ mount$2(nextVNode, null, context, isSVG, null, lifecycle);
82717
+ // Single DOM operation, when we have dom references available
82718
+ replaceChild$1(parentDOM, nextVNode.dom, lastVNode.dom);
82719
+ }
82720
+ else {
82721
+ mount$2(nextVNode, parentDOM, context, isSVG, findDOMfromVNode$1(lastVNode, true), lifecycle);
82722
+ removeVNodeDOM$1(lastVNode, parentDOM);
82723
+ }
82724
+ }
82725
+ function patch$1(lastVNode, nextVNode, parentDOM, context, isSVG, nextNode, lifecycle) {
82726
+ var nextFlags = (nextVNode.flags |= 16384 /* InUse */);
82727
+ if (lastVNode.flags !== nextFlags || lastVNode.type !== nextVNode.type || lastVNode.key !== nextVNode.key || nextFlags & 2048 /* ReCreate */) {
82728
+ if (lastVNode.flags & 16384 /* InUse */) {
82729
+ replaceWithNewNode$1(lastVNode, nextVNode, parentDOM, context, isSVG, lifecycle);
82730
+ }
82731
+ else {
82732
+ // Last vNode is not in use, it has crashed at application level. Just mount nextVNode and ignore last one
82733
+ mount$2(nextVNode, parentDOM, context, isSVG, nextNode, lifecycle);
82734
+ }
82735
+ }
82736
+ else if (nextFlags & 481 /* Element */) {
82737
+ patchElement$1(lastVNode, nextVNode, context, isSVG, nextFlags, lifecycle);
82738
+ }
82739
+ else if (nextFlags & 4 /* ComponentClass */) {
82740
+ patchClassComponent$1(lastVNode, nextVNode, parentDOM, context, isSVG, nextNode, lifecycle);
82741
+ }
82742
+ else if (nextFlags & 8 /* ComponentFunction */) {
82743
+ patchFunctionalComponent$1(lastVNode, nextVNode, parentDOM, context, isSVG, nextNode, lifecycle);
82744
+ }
82745
+ else if (nextFlags & 16 /* Text */) {
82746
+ patchText$1(lastVNode, nextVNode);
82747
+ }
82748
+ else if (nextFlags & 512 /* Void */) {
82749
+ nextVNode.dom = lastVNode.dom;
82750
+ }
82751
+ else if (nextFlags & 8192 /* Fragment */) {
82752
+ patchFragment$1(lastVNode, nextVNode, parentDOM, context, isSVG, lifecycle);
82753
+ }
82754
+ else {
82755
+ patchPortal$1(lastVNode, nextVNode, context, lifecycle);
82756
+ }
82757
+ }
82758
+ function patchSingleTextChild$1(lastChildren, nextChildren, parentDOM) {
82759
+ if (lastChildren !== nextChildren) {
82760
+ if (lastChildren !== '') {
82761
+ parentDOM.firstChild.nodeValue = nextChildren;
82762
+ }
82763
+ else {
82764
+ setTextContent$1(parentDOM, nextChildren);
82765
+ }
82766
+ }
82767
+ }
82768
+ function patchContentEditableChildren$1(dom, nextChildren) {
82769
+ if (dom.textContent !== nextChildren) {
82770
+ dom.textContent = nextChildren;
82771
+ }
82772
+ }
82773
+ function patchFragment$1(lastVNode, nextVNode, parentDOM, context, isSVG, lifecycle) {
82774
+ var lastChildren = lastVNode.children;
82775
+ var nextChildren = nextVNode.children;
82776
+ var lastChildFlags = lastVNode.childFlags;
82777
+ var nextChildFlags = nextVNode.childFlags;
82778
+ var nextNode = null;
82779
+ // When fragment is optimized for multiple children, check if there is no children and change flag to invalid
82780
+ // This is the only normalization always done, to keep optimization flags API same for fragments and regular elements
82781
+ if (nextChildFlags & 12 /* MultipleChildren */ && nextChildren.length === 0) {
82782
+ nextChildFlags = nextVNode.childFlags = 2 /* HasVNodeChildren */;
82783
+ nextChildren = nextVNode.children = createVoidVNode$2();
82784
+ }
82785
+ var nextIsSingle = (nextChildFlags & 2 /* HasVNodeChildren */) !== 0;
82786
+ if (lastChildFlags & 12 /* MultipleChildren */) {
82787
+ var lastLen = lastChildren.length;
82788
+ // We need to know Fragment's edge node when
82789
+ if (
82790
+ // It uses keyed algorithm
82791
+ (lastChildFlags & 8 /* HasKeyedChildren */ && nextChildFlags & 8 /* HasKeyedChildren */) ||
82792
+ // It transforms from many to single
82793
+ nextIsSingle ||
82794
+ // It will append more nodes
82795
+ (!nextIsSingle && nextChildren.length > lastLen)) {
82796
+ // When fragment has multiple children there is always at least one vNode
82797
+ nextNode = findDOMfromVNode$1(lastChildren[lastLen - 1], false).nextSibling;
82798
+ }
82799
+ }
82800
+ patchChildren$1(lastChildFlags, nextChildFlags, lastChildren, nextChildren, parentDOM, context, isSVG, nextNode, lastVNode, lifecycle);
82801
+ }
82802
+ function patchPortal$1(lastVNode, nextVNode, context, lifecycle) {
82803
+ var lastContainer = lastVNode.ref;
82804
+ var nextContainer = nextVNode.ref;
82805
+ var nextChildren = nextVNode.children;
82806
+ patchChildren$1(lastVNode.childFlags, nextVNode.childFlags, lastVNode.children, nextChildren, lastContainer, context, false, null, lastVNode, lifecycle);
82807
+ nextVNode.dom = lastVNode.dom;
82808
+ if (lastContainer !== nextContainer && !isInvalid$2(nextChildren)) {
82809
+ var node = nextChildren.dom;
82810
+ removeChild$1(lastContainer, node);
82811
+ appendChild$1(nextContainer, node);
82812
+ }
82813
+ }
82814
+ function patchElement$1(lastVNode, nextVNode, context, isSVG, nextFlags, lifecycle) {
82815
+ var dom = (nextVNode.dom = lastVNode.dom);
82816
+ var lastProps = lastVNode.props;
82817
+ var nextProps = nextVNode.props;
82818
+ var isFormElement = false;
82819
+ var hasControlledValue = false;
82820
+ var nextPropsOrEmpty;
82821
+ isSVG = isSVG || (nextFlags & 32 /* SvgElement */) > 0;
82822
+ // inlined patchProps -- starts --
82823
+ if (lastProps !== nextProps) {
82824
+ var lastPropsOrEmpty = lastProps || EMPTY_OBJ$2;
82825
+ nextPropsOrEmpty = nextProps || EMPTY_OBJ$2;
82826
+ if (nextPropsOrEmpty !== EMPTY_OBJ$2) {
82827
+ isFormElement = (nextFlags & 448 /* FormElement */) > 0;
82828
+ if (isFormElement) {
82829
+ hasControlledValue = isControlledFormElement$1(nextPropsOrEmpty);
82830
+ }
82831
+ for (var prop in nextPropsOrEmpty) {
82832
+ var lastValue = lastPropsOrEmpty[prop];
82833
+ var nextValue = nextPropsOrEmpty[prop];
82834
+ if (lastValue !== nextValue) {
82835
+ patchProp$1(prop, lastValue, nextValue, dom, isSVG, hasControlledValue, lastVNode);
82836
+ }
82837
+ }
82838
+ }
82839
+ if (lastPropsOrEmpty !== EMPTY_OBJ$2) {
82840
+ for (var prop$1 in lastPropsOrEmpty) {
82841
+ if (isNullOrUndef$3(nextPropsOrEmpty[prop$1]) && !isNullOrUndef$3(lastPropsOrEmpty[prop$1])) {
82842
+ patchProp$1(prop$1, lastPropsOrEmpty[prop$1], null, dom, isSVG, hasControlledValue, lastVNode);
82843
+ }
82844
+ }
82845
+ }
82846
+ }
82847
+ var nextChildren = nextVNode.children;
82848
+ var nextClassName = nextVNode.className;
82849
+ // inlined patchProps -- ends --
82850
+ if (lastVNode.className !== nextClassName) {
82851
+ if (isNullOrUndef$3(nextClassName)) {
82852
+ dom.removeAttribute('class');
82853
+ }
82854
+ else if (isSVG) {
82855
+ dom.setAttribute('class', nextClassName);
82856
+ }
82857
+ else {
82858
+ dom.className = nextClassName;
82859
+ }
82860
+ }
82861
+ if (nextFlags & 4096 /* ContentEditable */) {
82862
+ patchContentEditableChildren$1(dom, nextChildren);
82863
+ }
82864
+ else {
82865
+ patchChildren$1(lastVNode.childFlags, nextVNode.childFlags, lastVNode.children, nextChildren, dom, context, isSVG && nextVNode.type !== 'foreignObject', null, lastVNode, lifecycle);
82866
+ }
82867
+ if (isFormElement) {
82868
+ processElement$1(nextFlags, nextVNode, dom, nextPropsOrEmpty, false, hasControlledValue);
82869
+ }
82870
+ var nextRef = nextVNode.ref;
82871
+ var lastRef = lastVNode.ref;
82872
+ if (lastRef !== nextRef) {
82873
+ unmountRef$1(lastRef);
82874
+ mountRef$1(nextRef, dom, lifecycle);
82875
+ }
82876
+ }
82877
+ function replaceOneVNodeWithMultipleVNodes$1(lastChildren, nextChildren, parentDOM, context, isSVG, lifecycle) {
82878
+ unmount$2(lastChildren);
82879
+ mountArrayChildren$1(nextChildren, parentDOM, context, isSVG, findDOMfromVNode$1(lastChildren, true), lifecycle);
82880
+ removeVNodeDOM$1(lastChildren, parentDOM);
82881
+ }
82882
+ function patchChildren$1(lastChildFlags, nextChildFlags, lastChildren, nextChildren, parentDOM, context, isSVG, nextNode, parentVNode, lifecycle) {
82883
+ switch (lastChildFlags) {
82884
+ case 2 /* HasVNodeChildren */:
82885
+ switch (nextChildFlags) {
82886
+ case 2 /* HasVNodeChildren */:
82887
+ patch$1(lastChildren, nextChildren, parentDOM, context, isSVG, nextNode, lifecycle);
82888
+ break;
82889
+ case 1 /* HasInvalidChildren */:
82890
+ remove$1(lastChildren, parentDOM);
82891
+ break;
82892
+ case 16 /* HasTextChildren */:
82893
+ unmount$2(lastChildren);
82894
+ setTextContent$1(parentDOM, nextChildren);
82895
+ break;
82896
+ default:
82897
+ replaceOneVNodeWithMultipleVNodes$1(lastChildren, nextChildren, parentDOM, context, isSVG, lifecycle);
82898
+ break;
82899
+ }
82900
+ break;
82901
+ case 1 /* HasInvalidChildren */:
82902
+ switch (nextChildFlags) {
82903
+ case 2 /* HasVNodeChildren */:
82904
+ mount$2(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle);
82905
+ break;
82906
+ case 1 /* HasInvalidChildren */:
82907
+ break;
82908
+ case 16 /* HasTextChildren */:
82909
+ setTextContent$1(parentDOM, nextChildren);
82910
+ break;
82911
+ default:
82912
+ mountArrayChildren$1(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle);
82913
+ break;
82914
+ }
82915
+ break;
82916
+ case 16 /* HasTextChildren */:
82917
+ switch (nextChildFlags) {
82918
+ case 16 /* HasTextChildren */:
82919
+ patchSingleTextChild$1(lastChildren, nextChildren, parentDOM);
82920
+ break;
82921
+ case 2 /* HasVNodeChildren */:
82922
+ clearDOM$1(parentDOM);
82923
+ mount$2(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle);
82924
+ break;
82925
+ case 1 /* HasInvalidChildren */:
82926
+ clearDOM$1(parentDOM);
82927
+ break;
82928
+ default:
82929
+ clearDOM$1(parentDOM);
82930
+ mountArrayChildren$1(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle);
82931
+ break;
82932
+ }
82933
+ break;
82934
+ default:
82935
+ switch (nextChildFlags) {
82936
+ case 16 /* HasTextChildren */:
82937
+ unmountAllChildren$1(lastChildren);
82938
+ setTextContent$1(parentDOM, nextChildren);
82939
+ break;
82940
+ case 2 /* HasVNodeChildren */:
82941
+ removeAllChildren$1(parentDOM, parentVNode, lastChildren);
82942
+ mount$2(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle);
82943
+ break;
82944
+ case 1 /* HasInvalidChildren */:
82945
+ removeAllChildren$1(parentDOM, parentVNode, lastChildren);
82946
+ break;
82947
+ default:
82948
+ var lastLength = lastChildren.length | 0;
82949
+ var nextLength = nextChildren.length | 0;
82950
+ // Fast path's for both algorithms
82951
+ if (lastLength === 0) {
82952
+ if (nextLength > 0) {
82953
+ mountArrayChildren$1(nextChildren, parentDOM, context, isSVG, nextNode, lifecycle);
82954
+ }
82955
+ }
82956
+ else if (nextLength === 0) {
82957
+ removeAllChildren$1(parentDOM, parentVNode, lastChildren);
82958
+ }
82959
+ else if (nextChildFlags === 8 /* HasKeyedChildren */ && lastChildFlags === 8 /* HasKeyedChildren */) {
82960
+ patchKeyedChildren$1(lastChildren, nextChildren, parentDOM, context, isSVG, lastLength, nextLength, nextNode, parentVNode, lifecycle);
82961
+ }
82962
+ else {
82963
+ patchNonKeyedChildren$1(lastChildren, nextChildren, parentDOM, context, isSVG, lastLength, nextLength, nextNode, lifecycle);
82964
+ }
82965
+ break;
82966
+ }
82967
+ break;
82968
+ }
82969
+ }
82970
+ function createDidUpdate$1(instance, lastProps, lastState, snapshot, lifecycle) {
82971
+ lifecycle.push(function () {
82972
+ instance.componentDidUpdate(lastProps, lastState, snapshot);
82973
+ });
82974
+ }
82975
+ function updateClassComponent$1(instance, nextState, nextProps, parentDOM, context, isSVG, force, nextNode, lifecycle) {
82976
+ var lastState = instance.state;
82977
+ var lastProps = instance.props;
82978
+ var usesNewAPI = Boolean(instance.$N);
82979
+ var hasSCU = isFunction$2(instance.shouldComponentUpdate);
82980
+ if (usesNewAPI) {
82981
+ nextState = createDerivedState$1(instance, nextProps, nextState !== lastState ? combineFrom$3(lastState, nextState) : nextState);
82982
+ }
82983
+ if (force || !hasSCU || (hasSCU && instance.shouldComponentUpdate(nextProps, nextState, context))) {
82984
+ if (!usesNewAPI && isFunction$2(instance.componentWillUpdate)) {
82985
+ instance.componentWillUpdate(nextProps, nextState, context);
82986
+ }
82987
+ instance.props = nextProps;
82988
+ instance.state = nextState;
82989
+ instance.context = context;
82990
+ var snapshot = null;
82991
+ var nextInput = renderNewInput$1(instance, nextProps, context);
82992
+ if (usesNewAPI && isFunction$2(instance.getSnapshotBeforeUpdate)) {
82993
+ snapshot = instance.getSnapshotBeforeUpdate(lastProps, lastState);
82994
+ }
82995
+ patch$1(instance.$LI, nextInput, parentDOM, instance.$CX, isSVG, nextNode, lifecycle);
82996
+ // Dont update Last input, until patch has been succesfully executed
82997
+ instance.$LI = nextInput;
82998
+ if (isFunction$2(instance.componentDidUpdate)) {
82999
+ createDidUpdate$1(instance, lastProps, lastState, snapshot, lifecycle);
83000
+ }
83001
+ }
83002
+ else {
83003
+ instance.props = nextProps;
83004
+ instance.state = nextState;
83005
+ instance.context = context;
83006
+ }
83007
+ }
83008
+ function patchClassComponent$1(lastVNode, nextVNode, parentDOM, context, isSVG, nextNode, lifecycle) {
83009
+ var instance = (nextVNode.children = lastVNode.children);
83010
+ // If Component has crashed, ignore it to stay functional
83011
+ if (isNull$2(instance)) {
83012
+ return;
83013
+ }
83014
+ instance.$L = lifecycle;
83015
+ var nextProps = nextVNode.props || EMPTY_OBJ$2;
83016
+ var nextRef = nextVNode.ref;
83017
+ var lastRef = lastVNode.ref;
83018
+ var nextState = instance.state;
83019
+ if (!instance.$N) {
83020
+ if (isFunction$2(instance.componentWillReceiveProps)) {
83021
+ instance.$BR = true;
83022
+ instance.componentWillReceiveProps(nextProps, context);
83023
+ // If instance component was removed during its own update do nothing.
83024
+ if (instance.$UN) {
83025
+ return;
83026
+ }
83027
+ instance.$BR = false;
83028
+ }
83029
+ if (!isNull$2(instance.$PS)) {
83030
+ nextState = combineFrom$3(nextState, instance.$PS);
83031
+ instance.$PS = null;
83032
+ }
83033
+ }
83034
+ updateClassComponent$1(instance, nextState, nextProps, parentDOM, context, isSVG, false, nextNode, lifecycle);
83035
+ if (lastRef !== nextRef) {
83036
+ unmountRef$1(lastRef);
83037
+ mountRef$1(nextRef, instance, lifecycle);
83038
+ }
83039
+ }
83040
+ function patchFunctionalComponent$1(lastVNode, nextVNode, parentDOM, context, isSVG, nextNode, lifecycle) {
83041
+ var shouldUpdate = true;
83042
+ var nextProps = nextVNode.props || EMPTY_OBJ$2;
83043
+ var nextRef = nextVNode.ref;
83044
+ var lastProps = lastVNode.props;
83045
+ var nextHooksDefined = !isNullOrUndef$3(nextRef);
83046
+ var lastInput = lastVNode.children;
83047
+ if (nextHooksDefined && isFunction$2(nextRef.onComponentShouldUpdate)) {
83048
+ shouldUpdate = nextRef.onComponentShouldUpdate(lastProps, nextProps);
83049
+ }
83050
+ if (shouldUpdate !== false) {
83051
+ if (nextHooksDefined && isFunction$2(nextRef.onComponentWillUpdate)) {
83052
+ nextRef.onComponentWillUpdate(lastProps, nextProps);
83053
+ }
83054
+ var type = nextVNode.type;
83055
+ var nextInput = normalizeRoot$1(nextVNode.flags & 32768 /* ForwardRef */ ? type.render(nextProps, nextRef, context) : type(nextProps, context));
83056
+ patch$1(lastInput, nextInput, parentDOM, context, isSVG, nextNode, lifecycle);
83057
+ nextVNode.children = nextInput;
83058
+ if (nextHooksDefined && isFunction$2(nextRef.onComponentDidUpdate)) {
83059
+ nextRef.onComponentDidUpdate(lastProps, nextProps);
83060
+ }
83061
+ }
83062
+ else {
83063
+ nextVNode.children = lastInput;
83064
+ }
83065
+ }
83066
+ function patchText$1(lastVNode, nextVNode) {
83067
+ var nextText = nextVNode.children;
83068
+ var dom = (nextVNode.dom = lastVNode.dom);
83069
+ if (nextText !== lastVNode.children) {
83070
+ dom.nodeValue = nextText;
83071
+ }
83072
+ }
83073
+ function patchNonKeyedChildren$1(lastChildren, nextChildren, dom, context, isSVG, lastChildrenLength, nextChildrenLength, nextNode, lifecycle) {
83074
+ var commonLength = lastChildrenLength > nextChildrenLength ? nextChildrenLength : lastChildrenLength;
83075
+ var i = 0;
83076
+ var nextChild;
83077
+ var lastChild;
83078
+ for (; i < commonLength; ++i) {
83079
+ nextChild = nextChildren[i];
83080
+ lastChild = lastChildren[i];
83081
+ if (nextChild.flags & 16384 /* InUse */) {
83082
+ nextChild = nextChildren[i] = directClone$2(nextChild);
83083
+ }
83084
+ patch$1(lastChild, nextChild, dom, context, isSVG, nextNode, lifecycle);
83085
+ lastChildren[i] = nextChild;
83086
+ }
83087
+ if (lastChildrenLength < nextChildrenLength) {
83088
+ for (i = commonLength; i < nextChildrenLength; ++i) {
83089
+ nextChild = nextChildren[i];
83090
+ if (nextChild.flags & 16384 /* InUse */) {
83091
+ nextChild = nextChildren[i] = directClone$2(nextChild);
83092
+ }
83093
+ mount$2(nextChild, dom, context, isSVG, nextNode, lifecycle);
83094
+ }
83095
+ }
83096
+ else if (lastChildrenLength > nextChildrenLength) {
83097
+ for (i = commonLength; i < lastChildrenLength; ++i) {
83098
+ remove$1(lastChildren[i], dom);
83099
+ }
83100
+ }
83101
+ }
83102
+ function patchKeyedChildren$1(a, b, dom, context, isSVG, aLength, bLength, outerEdge, parentVNode, lifecycle) {
83103
+ var aEnd = aLength - 1;
83104
+ var bEnd = bLength - 1;
83105
+ var j = 0;
83106
+ var aNode = a[j];
83107
+ var bNode = b[j];
83108
+ var nextPos;
83109
+ var nextNode;
83110
+ // Step 1
83111
+ // tslint:disable-next-line
83112
+ outer: {
83113
+ // Sync nodes with the same key at the beginning.
83114
+ while (aNode.key === bNode.key) {
83115
+ if (bNode.flags & 16384 /* InUse */) {
83116
+ b[j] = bNode = directClone$2(bNode);
83117
+ }
83118
+ patch$1(aNode, bNode, dom, context, isSVG, outerEdge, lifecycle);
83119
+ a[j] = bNode;
83120
+ ++j;
83121
+ if (j > aEnd || j > bEnd) {
83122
+ break outer;
83123
+ }
83124
+ aNode = a[j];
83125
+ bNode = b[j];
83126
+ }
83127
+ aNode = a[aEnd];
83128
+ bNode = b[bEnd];
83129
+ // Sync nodes with the same key at the end.
83130
+ while (aNode.key === bNode.key) {
83131
+ if (bNode.flags & 16384 /* InUse */) {
83132
+ b[bEnd] = bNode = directClone$2(bNode);
83133
+ }
83134
+ patch$1(aNode, bNode, dom, context, isSVG, outerEdge, lifecycle);
83135
+ a[aEnd] = bNode;
83136
+ aEnd--;
83137
+ bEnd--;
83138
+ if (j > aEnd || j > bEnd) {
83139
+ break outer;
83140
+ }
83141
+ aNode = a[aEnd];
83142
+ bNode = b[bEnd];
83143
+ }
83144
+ }
83145
+ if (j > aEnd) {
83146
+ if (j <= bEnd) {
83147
+ nextPos = bEnd + 1;
83148
+ nextNode = nextPos < bLength ? findDOMfromVNode$1(b[nextPos], true) : outerEdge;
83149
+ while (j <= bEnd) {
83150
+ bNode = b[j];
83151
+ if (bNode.flags & 16384 /* InUse */) {
83152
+ b[j] = bNode = directClone$2(bNode);
83153
+ }
83154
+ ++j;
83155
+ mount$2(bNode, dom, context, isSVG, nextNode, lifecycle);
83156
+ }
83157
+ }
83158
+ }
83159
+ else if (j > bEnd) {
83160
+ while (j <= aEnd) {
83161
+ remove$1(a[j++], dom);
83162
+ }
83163
+ }
83164
+ else {
83165
+ patchKeyedChildrenComplex$1(a, b, context, aLength, bLength, aEnd, bEnd, j, dom, isSVG, outerEdge, parentVNode, lifecycle);
83166
+ }
83167
+ }
83168
+ function patchKeyedChildrenComplex$1(a, b, context, aLength, bLength, aEnd, bEnd, j, dom, isSVG, outerEdge, parentVNode, lifecycle) {
83169
+ var aNode;
83170
+ var bNode;
83171
+ var nextPos;
83172
+ var i = 0;
83173
+ var aStart = j;
83174
+ var bStart = j;
83175
+ var aLeft = aEnd - j + 1;
83176
+ var bLeft = bEnd - j + 1;
83177
+ var sources = new Int32Array(bLeft + 1);
83178
+ // Keep track if its possible to remove whole DOM using textContent = '';
83179
+ var canRemoveWholeContent = aLeft === aLength;
83180
+ var moved = false;
83181
+ var pos = 0;
83182
+ var patched = 0;
83183
+ // When sizes are small, just loop them through
83184
+ if (bLength < 4 || (aLeft | bLeft) < 32) {
83185
+ for (i = aStart; i <= aEnd; ++i) {
83186
+ aNode = a[i];
83187
+ if (patched < bLeft) {
83188
+ for (j = bStart; j <= bEnd; j++) {
83189
+ bNode = b[j];
83190
+ if (aNode.key === bNode.key) {
83191
+ sources[j - bStart] = i + 1;
83192
+ if (canRemoveWholeContent) {
83193
+ canRemoveWholeContent = false;
83194
+ while (aStart < i) {
83195
+ remove$1(a[aStart++], dom);
83196
+ }
83197
+ }
83198
+ if (pos > j) {
83199
+ moved = true;
83200
+ }
83201
+ else {
83202
+ pos = j;
83203
+ }
83204
+ if (bNode.flags & 16384 /* InUse */) {
83205
+ b[j] = bNode = directClone$2(bNode);
83206
+ }
83207
+ patch$1(aNode, bNode, dom, context, isSVG, outerEdge, lifecycle);
83208
+ ++patched;
83209
+ break;
83210
+ }
83211
+ }
83212
+ if (!canRemoveWholeContent && j > bEnd) {
83213
+ remove$1(aNode, dom);
83214
+ }
83215
+ }
83216
+ else if (!canRemoveWholeContent) {
83217
+ remove$1(aNode, dom);
83218
+ }
83219
+ }
83220
+ }
83221
+ else {
83222
+ var keyIndex = {};
83223
+ // Map keys by their index
83224
+ for (i = bStart; i <= bEnd; ++i) {
83225
+ keyIndex[b[i].key] = i;
83226
+ }
83227
+ // Try to patch same keys
83228
+ for (i = aStart; i <= aEnd; ++i) {
83229
+ aNode = a[i];
83230
+ if (patched < bLeft) {
83231
+ j = keyIndex[aNode.key];
83232
+ if (j !== void 0) {
83233
+ if (canRemoveWholeContent) {
83234
+ canRemoveWholeContent = false;
83235
+ while (i > aStart) {
83236
+ remove$1(a[aStart++], dom);
83237
+ }
83238
+ }
83239
+ sources[j - bStart] = i + 1;
83240
+ if (pos > j) {
83241
+ moved = true;
83242
+ }
83243
+ else {
83244
+ pos = j;
83245
+ }
83246
+ bNode = b[j];
83247
+ if (bNode.flags & 16384 /* InUse */) {
83248
+ b[j] = bNode = directClone$2(bNode);
83249
+ }
83250
+ patch$1(aNode, bNode, dom, context, isSVG, outerEdge, lifecycle);
83251
+ ++patched;
83252
+ }
83253
+ else if (!canRemoveWholeContent) {
83254
+ remove$1(aNode, dom);
83255
+ }
83256
+ }
83257
+ else if (!canRemoveWholeContent) {
83258
+ remove$1(aNode, dom);
83259
+ }
83260
+ }
83261
+ }
83262
+ // fast-path: if nothing patched remove all old and add all new
83263
+ if (canRemoveWholeContent) {
83264
+ removeAllChildren$1(dom, parentVNode, a);
83265
+ mountArrayChildren$1(b, dom, context, isSVG, outerEdge, lifecycle);
83266
+ }
83267
+ else if (moved) {
83268
+ var seq = lis_algorithm$1(sources);
83269
+ j = seq.length - 1;
83270
+ for (i = bLeft - 1; i >= 0; i--) {
83271
+ if (sources[i] === 0) {
83272
+ pos = i + bStart;
83273
+ bNode = b[pos];
83274
+ if (bNode.flags & 16384 /* InUse */) {
83275
+ b[pos] = bNode = directClone$2(bNode);
83276
+ }
83277
+ nextPos = pos + 1;
83278
+ mount$2(bNode, dom, context, isSVG, nextPos < bLength ? findDOMfromVNode$1(b[nextPos], true) : outerEdge, lifecycle);
83279
+ }
83280
+ else if (j < 0 || i !== seq[j]) {
83281
+ pos = i + bStart;
83282
+ bNode = b[pos];
83283
+ nextPos = pos + 1;
83284
+ moveVNodeDOM$1(bNode, dom, nextPos < bLength ? findDOMfromVNode$1(b[nextPos], true) : outerEdge);
83285
+ }
83286
+ else {
83287
+ j--;
83288
+ }
83289
+ }
83290
+ }
83291
+ else if (patched !== bLeft) {
83292
+ // when patched count doesn't match b length we need to insert those new ones
83293
+ // loop backwards so we can use insertBefore
83294
+ for (i = bLeft - 1; i >= 0; i--) {
83295
+ if (sources[i] === 0) {
83296
+ pos = i + bStart;
83297
+ bNode = b[pos];
83298
+ if (bNode.flags & 16384 /* InUse */) {
83299
+ b[pos] = bNode = directClone$2(bNode);
83300
+ }
83301
+ nextPos = pos + 1;
83302
+ mount$2(bNode, dom, context, isSVG, nextPos < bLength ? findDOMfromVNode$1(b[nextPos], true) : outerEdge, lifecycle);
83303
+ }
83304
+ }
83305
+ }
83306
+ }
83307
+ var result$1;
83308
+ var p$1;
83309
+ var maxLen$1 = 0;
83310
+ // https://en.wikipedia.org/wiki/Longest_increasing_subsequence
83311
+ function lis_algorithm$1(arr) {
83312
+ var arrI = 0;
83313
+ var i = 0;
83314
+ var j = 0;
83315
+ var k = 0;
83316
+ var u = 0;
83317
+ var v = 0;
83318
+ var c = 0;
83319
+ var len = arr.length;
83320
+ if (len > maxLen$1) {
83321
+ maxLen$1 = len;
83322
+ result$1 = new Int32Array(len);
83323
+ p$1 = new Int32Array(len);
83324
+ }
83325
+ for (; i < len; ++i) {
83326
+ arrI = arr[i];
83327
+ if (arrI !== 0) {
83328
+ j = result$1[k];
83329
+ if (arr[j] < arrI) {
83330
+ p$1[i] = j;
83331
+ result$1[++k] = i;
83332
+ continue;
83333
+ }
83334
+ u = 0;
83335
+ v = k;
83336
+ while (u < v) {
83337
+ c = (u + v) >> 1;
83338
+ if (arr[result$1[c]] < arrI) {
83339
+ u = c + 1;
83340
+ }
83341
+ else {
83342
+ v = c;
83343
+ }
83344
+ }
83345
+ if (arrI < arr[result$1[u]]) {
83346
+ if (u > 0) {
83347
+ p$1[i] = result$1[u - 1];
83348
+ }
83349
+ result$1[u] = i;
83350
+ }
83351
+ }
83352
+ }
83353
+ u = k + 1;
83354
+ var seq = new Int32Array(u);
83355
+ v = result$1[u - 1];
83356
+ while (u-- > 0) {
83357
+ seq[u] = v;
83358
+ v = p$1[v];
83359
+ result$1[u] = 0;
83360
+ }
83361
+ return seq;
83362
+ }
83363
+
83364
+ var hasDocumentAvailable$2 = typeof document !== 'undefined';
83365
+ if (hasDocumentAvailable$2) {
83366
+ /*
83367
+ * Defining $EV and $V properties on Node.prototype
83368
+ * fixes v8 "wrong map" de-optimization
83369
+ */
83370
+ if (window.Node) {
83371
+ Node.prototype.$EV = null;
83372
+ Node.prototype.$V = null;
83373
+ }
83374
+ }
83375
+ function __render(input, parentDOM, callback, context) {
83376
+ var lifecycle = [];
83377
+ var rootInput = parentDOM.$V;
83378
+ if (isNullOrUndef$3(rootInput)) {
83379
+ if (!isNullOrUndef$3(input)) {
83380
+ if (input.flags & 16384 /* InUse */) {
83381
+ input = directClone$2(input);
83382
+ }
83383
+ mount$2(input, parentDOM, context, false, null, lifecycle);
83384
+ parentDOM.$V = input;
83385
+ rootInput = input;
83386
+ }
83387
+ }
83388
+ else {
83389
+ if (isNullOrUndef$3(input)) {
83390
+ remove$1(rootInput, parentDOM);
83391
+ parentDOM.$V = null;
83392
+ }
83393
+ else {
83394
+ if (input.flags & 16384 /* InUse */) {
83395
+ input = directClone$2(input);
83396
+ }
83397
+ patch$1(rootInput, input, parentDOM, context, false, null, lifecycle);
83398
+ rootInput = parentDOM.$V = input;
83399
+ }
83400
+ }
83401
+ if (lifecycle.length > 0) {
83402
+ callAll$1(lifecycle);
83403
+ }
83404
+ if (isFunction$2(callback)) {
83405
+ callback();
83406
+ }
83407
+ if (isFunction$2(options$1.renderComplete)) {
83408
+ options$1.renderComplete(rootInput, parentDOM);
83409
+ }
83410
+ }
83411
+ function render(input, parentDOM, callback, context) {
83412
+ if ( callback === void 0 ) callback = null;
83413
+ if ( context === void 0 ) context = EMPTY_OBJ$2;
83414
+
83415
+ __render(input, parentDOM, callback, context);
83416
+ }
83417
+ typeof Promise !== 'undefined'
83418
+ ? Promise.resolve().then.bind(Promise.resolve())
83419
+ : function (a) {
83420
+ window.setTimeout(a, 0);
83421
+ };var isArray$1 = Array.isArray;
81521
83422
  function isStringOrNumber$1(o) {
81522
83423
  var type = typeof o;
81523
83424
  return type === 'string' || type === 'number';