@player-ui/stage-revert-data-plugin 0.14.0-next.0 → 0.14.0-next.2

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.
@@ -45,6 +45,10 @@ function _async_to_generator(fn) {
45
45
  });
46
46
  };
47
47
  }
48
+ function _call_super(_this, derived, args) {
49
+ derived = _get_prototype_of(derived);
50
+ return _possible_constructor_return(_this, _is_native_reflect_construct() ? Reflect.construct(derived, args || [], _get_prototype_of(_this).constructor) : derived.apply(_this, args));
51
+ }
48
52
  function _class_call_check(instance, Constructor) {
49
53
  if (!(instance instanceof Constructor)) {
50
54
  throw new TypeError("Cannot call a class as a function");
@@ -283,31 +287,15 @@ function _wrap_native_super(Class) {
283
287
  return _wrap_native_super(Class);
284
288
  }
285
289
  function _is_native_reflect_construct() {
286
- if (typeof Reflect === "undefined" || !Reflect.construct) return false;
287
- if (Reflect.construct.sham) return false;
288
- if (typeof Proxy === "function") return true;
289
290
  try {
290
- Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
291
- return true;
292
- } catch (e) {
293
- return false;
294
- }
295
- }
296
- function _create_super(Derived) {
297
- var hasNativeReflectConstruct = _is_native_reflect_construct();
298
- return function _createSuperInternal() {
299
- var Super = _get_prototype_of(Derived), result;
300
- if (hasNativeReflectConstruct) {
301
- var NewTarget = _get_prototype_of(this).constructor;
302
- result = Reflect.construct(Super, arguments, NewTarget);
303
- } else {
304
- result = Super.apply(this, arguments);
305
- }
306
- return _possible_constructor_return(this, result);
307
- };
291
+ var result = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
292
+ } catch (_) {}
293
+ return (_is_native_reflect_construct = function() {
294
+ return !!result;
295
+ })();
308
296
  }
309
297
  function _ts_generator(thisArg, body) {
310
- var f, y, t, g, _ = {
298
+ var f, y, t, _ = {
311
299
  label: 0,
312
300
  sent: function() {
313
301
  if (t[0] & 1) throw t[1];
@@ -315,12 +303,8 @@ function _ts_generator(thisArg, body) {
315
303
  },
316
304
  trys: [],
317
305
  ops: []
318
- };
319
- return g = {
320
- next: verb(0),
321
- "throw": verb(1),
322
- "return": verb(2)
323
- }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
306
+ }, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
307
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
324
308
  return this;
325
309
  }), g;
326
310
  function verb(n) {
@@ -333,7 +317,7 @@ function _ts_generator(thisArg, body) {
333
317
  }
334
318
  function step(op) {
335
319
  if (f) throw new TypeError("Generator is already executing.");
336
- while(_)try {
320
+ while(g && (g = 0, op[0] && (_ = 0)), _)try {
337
321
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
338
322
  if (y = 0, t) op = [
339
323
  op[0] & 2,
@@ -505,7 +489,7 @@ var StageRevertDataPlugin = function() {
505
489
  };
506
490
  var findInArray = function findInArray(array, key, value) {
507
491
  return array.findIndex(function(obj) {
508
- if (obj && typeof obj === "object") {
492
+ if (obj && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object") {
509
493
  return obj[key] == value;
510
494
  }
511
495
  return false;
@@ -599,7 +583,7 @@ var StageRevertDataPlugin = function() {
599
583
  };
600
584
  };
601
585
  var isExpressionNode = function isExpressionNode(x) {
602
- return typeof x === "object" && x !== null && !Array.isArray(x) && x.__id === ExpNodeOpaqueIdentifier;
586
+ return (typeof x === "undefined" ? "undefined" : _type_of(x)) === "object" && x !== null && !Array.isArray(x) && x.__id === ExpNodeOpaqueIdentifier;
603
587
  };
604
588
  var throwError = function throwError(message, index) {
605
589
  var err = new Error("".concat(message, " at character ").concat(index));
@@ -1187,7 +1171,7 @@ var StageRevertDataPlugin = function() {
1187
1171
  var isPromiseLike = function isPromiseLike(value) {
1188
1172
  var // Check for standard Promise constructor name
1189
1173
  _value_constructor;
1190
- return value != null && typeof value === "object" && typeof value.then === "function" && // Additional safeguards against false positives
1174
+ return value != null && (typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && typeof value.then === "function" && // Additional safeguards against false positives
1191
1175
  (_instanceof(value, Promise) || ((_value_constructor = value.constructor) === null || _value_constructor === void 0 ? void 0 : _value_constructor.name) === "Promise" || // Verify it has other Promise-like methods to reduce false positives
1192
1176
  typeof value.catch === "function" && typeof value.finally === "function");
1193
1177
  };
@@ -1202,7 +1186,7 @@ var StageRevertDataPlugin = function() {
1202
1186
  if (isExpressionNode(expr)) {
1203
1187
  return false;
1204
1188
  }
1205
- return typeof expr === "object" && expr !== null && !Array.isArray(expr) && "value" in expr;
1189
+ return (typeof expr === "undefined" ? "undefined" : _type_of(expr)) === "object" && expr !== null && !Array.isArray(expr) && "value" in expr;
1206
1190
  };
1207
1191
  var makePromiseAwareBinaryOp = function makePromiseAwareBinaryOp(operation) {
1208
1192
  return function(a, b, async) {
@@ -1419,7 +1403,7 @@ var StageRevertDataPlugin = function() {
1419
1403
  if (!node) {
1420
1404
  return;
1421
1405
  }
1422
- if ("value" in node && typeof node.value === "object" && typeof ((_node_value = node.value) === null || _node_value === void 0 ? void 0 : _node_value.id) === "string") {
1406
+ if ("value" in node && _type_of(node.value) === "object" && typeof ((_node_value = node.value) === null || _node_value === void 0 ? void 0 : _node_value.id) === "string") {
1423
1407
  return node.value.id;
1424
1408
  }
1425
1409
  };
@@ -1531,7 +1515,7 @@ var StageRevertDataPlugin = function() {
1531
1515
  });
1532
1516
  };
1533
1517
  var __copyProps = function(to, from, except, desc) {
1534
- if (from && typeof from === "object" || typeof from === "function") {
1518
+ if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
1535
1519
  var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
1536
1520
  try {
1537
1521
  var _loop = function() {
@@ -1586,15 +1570,16 @@ var StageRevertDataPlugin = function() {
1586
1570
  exports.toError = exports.NestedError = void 0;
1587
1571
  var NestedError4 = /*#__PURE__*/ function(Error1) {
1588
1572
  _inherits(_NestedError, Error1);
1589
- var _super = _create_super(_NestedError);
1590
1573
  function _NestedError(message) {
1591
1574
  for(var _len = arguments.length, innerErrors = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
1592
1575
  innerErrors[_key - 1] = arguments[_key];
1593
1576
  }
1594
1577
  _class_call_check(this, _NestedError);
1595
1578
  var _this;
1596
- _this = _super.call(this, message);
1597
- var thisErrorReport = _NestedError.getErrorReport(_assert_this_initialized(_this));
1579
+ _this = _call_super(this, _NestedError, [
1580
+ message
1581
+ ]);
1582
+ var thisErrorReport = _NestedError.getErrorReport(_this);
1598
1583
  if (innerErrors.length === 1) {
1599
1584
  var innerError = toError(innerErrors[0]);
1600
1585
  _this.innerErrors = [
@@ -1730,7 +1715,7 @@ var StageRevertDataPlugin = function() {
1730
1715
  return out;
1731
1716
  }
1732
1717
  function isObject(o) {
1733
- return o != null && typeof o === "object";
1718
+ return o != null && (typeof o === "undefined" ? "undefined" : _type_of(o)) === "object";
1734
1719
  }
1735
1720
  function addLast2(array, val) {
1736
1721
  if (Array.isArray(val)) return array.concat(val);
@@ -2073,7 +2058,7 @@ var StageRevertDataPlugin = function() {
2073
2058
  else return 0;
2074
2059
  }
2075
2060
  }();
2076
- if (typeof module === "object") module.exports = SortedArray2;
2061
+ if ((typeof module === "undefined" ? "undefined" : _type_of(module)) === "object") module.exports = SortedArray2;
2077
2062
  if (typeof define === "function" && define.amd) define(function() {
2078
2063
  return SortedArray2;
2079
2064
  });
@@ -2270,10 +2255,9 @@ var StageRevertDataPlugin = function() {
2270
2255
  }();
2271
2256
  var SyncHook = /*#__PURE__*/ function(Hook) {
2272
2257
  _inherits(SyncHook, Hook);
2273
- var _super = _create_super(SyncHook);
2274
2258
  function SyncHook() {
2275
2259
  _class_call_check(this, SyncHook);
2276
- return _super.apply(this, arguments);
2260
+ return _call_super(this, SyncHook, arguments);
2277
2261
  }
2278
2262
  _create_class(SyncHook, [
2279
2263
  {
@@ -2306,10 +2290,9 @@ var StageRevertDataPlugin = function() {
2306
2290
  }(Hook);
2307
2291
  var SyncBailHook = /*#__PURE__*/ function(Hook) {
2308
2292
  _inherits(SyncBailHook, Hook);
2309
- var _super = _create_super(SyncBailHook);
2310
2293
  function SyncBailHook() {
2311
2294
  _class_call_check(this, SyncBailHook);
2312
- return _super.apply(this, arguments);
2295
+ return _call_super(this, SyncBailHook, arguments);
2313
2296
  }
2314
2297
  _create_class(SyncBailHook, [
2315
2298
  {
@@ -2341,10 +2324,9 @@ var StageRevertDataPlugin = function() {
2341
2324
  }(Hook);
2342
2325
  var SyncWaterfallHook = /*#__PURE__*/ function(Hook) {
2343
2326
  _inherits(SyncWaterfallHook, Hook);
2344
- var _super = _create_super(SyncWaterfallHook);
2345
2327
  function SyncWaterfallHook() {
2346
2328
  _class_call_check(this, SyncWaterfallHook);
2347
- return _super.apply(this, arguments);
2329
+ return _call_super(this, SyncWaterfallHook, arguments);
2348
2330
  }
2349
2331
  _create_class(SyncWaterfallHook, [
2350
2332
  {
@@ -2406,7 +2388,7 @@ var StageRevertDataPlugin = function() {
2406
2388
  for(var _iterator = foo[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
2407
2389
  len = _step.value;
2408
2390
  tmp = len;
2409
- if (tmp && typeof tmp === "object") {
2391
+ if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
2410
2392
  tmp = find(bar, tmp);
2411
2393
  if (!tmp) return false;
2412
2394
  }
@@ -2437,7 +2419,7 @@ var StageRevertDataPlugin = function() {
2437
2419
  for(var _iterator1 = foo[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
2438
2420
  len = _step1.value;
2439
2421
  tmp = len[0];
2440
- if (tmp && typeof tmp === "object") {
2422
+ if (tmp && (typeof tmp === "undefined" ? "undefined" : _type_of(tmp)) === "object") {
2441
2423
  tmp = find(bar, tmp);
2442
2424
  if (!tmp) return false;
2443
2425
  }
@@ -2476,7 +2458,7 @@ var StageRevertDataPlugin = function() {
2476
2458
  }
2477
2459
  return len === -1;
2478
2460
  }
2479
- if (!ctor || typeof foo === "object") {
2461
+ if (!ctor || (typeof foo === "undefined" ? "undefined" : _type_of(foo)) === "object") {
2480
2462
  len = 0;
2481
2463
  for(ctor in foo){
2482
2464
  if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
@@ -2509,7 +2491,7 @@ var StageRevertDataPlugin = function() {
2509
2491
  var nestedPath = _to_consumable_array(path).concat([
2510
2492
  key
2511
2493
  ]);
2512
- if (typeof val === "object") {
2494
+ if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
2513
2495
  traverseObj(val, nestedPath, pairs);
2514
2496
  } else {
2515
2497
  pairs.set(nestedPath, val);
@@ -2550,7 +2532,7 @@ var StageRevertDataPlugin = function() {
2550
2532
  {
2551
2533
  /** Add match -> value mapping to the registry */ key: "set",
2552
2534
  value: function set(match, value) {
2553
- var matcher = typeof match === "object" ? createMatcher(match) : createBasicMatcher(match);
2535
+ var matcher = (typeof match === "undefined" ? "undefined" : _type_of(match)) === "object" ? createMatcher(match) : createBasicMatcher(match);
2554
2536
  this.store.insert({
2555
2537
  key: match,
2556
2538
  value: value,
@@ -3090,7 +3072,7 @@ var StageRevertDataPlugin = function() {
3090
3072
  var _this_parseCache_path;
3091
3073
  var ast = (_this_parseCache_path = this.parseCache[path]) !== null && _this_parseCache_path !== void 0 ? _this_parseCache_path : parse(path);
3092
3074
  this.parseCache[path] = ast;
3093
- if (typeof ast !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
3075
+ if ((typeof ast === "undefined" ? "undefined" : _type_of(ast)) !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
3094
3076
  var _ast_error;
3095
3077
  throw new TypeError('Cannot normalize path "'.concat(path, '": ').concat((_ast_error = ast === null || ast === void 0 ? void 0 : ast.error) !== null && _ast_error !== void 0 ? _ast_error : "Unknown Error."));
3096
3078
  }
@@ -3290,14 +3272,13 @@ var StageRevertDataPlugin = function() {
3290
3272
  }();
3291
3273
  var DependencyModel = /*#__PURE__*/ function(DependencyTracker) {
3292
3274
  _inherits(DependencyModel, DependencyTracker);
3293
- var _super = _create_super(DependencyModel);
3294
3275
  function DependencyModel(rootModel) {
3295
3276
  _class_call_check(this, DependencyModel);
3296
3277
  var _this;
3297
- _this = _super.call(this);
3278
+ _this = _call_super(this, DependencyModel);
3298
3279
  _this.rootModel = rootModel;
3299
- _this.set = _this.set.bind(_assert_this_initialized(_this));
3300
- _this.get = _this.get.bind(_assert_this_initialized(_this));
3280
+ _this.set = _this.set.bind(_this);
3281
+ _this.get = _this.get.bind(_this);
3301
3282
  return _this;
3302
3283
  }
3303
3284
  _create_class(DependencyModel, [
@@ -3841,23 +3822,20 @@ var StageRevertDataPlugin = function() {
3841
3822
  * @experimental These Player APIs are in active development and may change. Use with caution
3842
3823
  */ key: "evaluateAsync",
3843
3824
  value: function evaluateAsync(expr, options) {
3825
+ var _this = this;
3844
3826
  if (Array.isArray(expr)) {
3845
- var _this = this;
3846
- return collateAwaitable(expr.map(function() {
3847
- var _ref = _async_to_generator(function(exp) {
3827
+ return collateAwaitable(expr.map(function(exp) {
3828
+ return _async_to_generator(function() {
3848
3829
  return _ts_generator(this, function(_state) {
3849
3830
  return [
3850
3831
  2,
3851
- _this.evaluate(exp, _object_spread_props(_object_spread({}, options), {
3832
+ this.evaluate(exp, _object_spread_props(_object_spread({}, options), {
3852
3833
  async: true
3853
3834
  }))
3854
3835
  ];
3855
3836
  });
3856
- });
3857
- return function(exp) {
3858
- return _ref.apply(this, arguments);
3859
- };
3860
- }())).awaitableThen(function(values) {
3837
+ }).call(_this);
3838
+ })).awaitableThen(function(values) {
3861
3839
  return values.pop();
3862
3840
  });
3863
3841
  } else {
@@ -4620,7 +4598,7 @@ var StageRevertDataPlugin = function() {
4620
4598
  }
4621
4599
  var parseLocalObject = function(currentValue, objToParse) {
4622
4600
  var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
4623
- if (typeof objToParse !== "object" || objToParse === null) {
4601
+ if ((typeof objToParse === "undefined" ? "undefined" : _type_of(objToParse)) !== "object" || objToParse === null) {
4624
4602
  return {
4625
4603
  value: objToParse,
4626
4604
  children: []
@@ -4657,7 +4635,7 @@ var StageRevertDataPlugin = function() {
4657
4635
  if (newChildren) {
4658
4636
  var _children2;
4659
4637
  (_children2 = children2).push.apply(_children2, _to_consumable_array(newChildren));
4660
- } else if (localValue && typeof localValue === "object") {
4638
+ } else if (localValue && (typeof localValue === "undefined" ? "undefined" : _type_of(localValue)) === "object") {
4661
4639
  var _children21;
4662
4640
  var result = parseLocalObject(accumulation.value, localValue, _to_consumable_array(path).concat([
4663
4641
  localKey
@@ -4815,7 +4793,7 @@ var StageRevertDataPlugin = function() {
4815
4793
  Object.keys(clonedNode).forEach(function(key) {
4816
4794
  if (key === "parent") return;
4817
4795
  var value = clonedNode[key];
4818
- if (typeof value === "object" && value !== null) {
4796
+ if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null) {
4819
4797
  clonedNode[key] = Array.isArray(value) ? _to_consumable_array(value) : _object_spread({}, value);
4820
4798
  }
4821
4799
  });
@@ -5167,7 +5145,7 @@ var StageRevertDataPlugin = function() {
5167
5145
  for(var _iterator = templateSubstitutions[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
5168
5146
  var _step_value = _step.value, expression = _step_value.expression, value = _step_value.value;
5169
5147
  var flags = "g";
5170
- if (typeof expression === "object") {
5148
+ if ((typeof expression === "undefined" ? "undefined" : _type_of(expression)) === "object") {
5171
5149
  flags = "".concat(expression.flags).concat(expression.global ? "" : "g");
5172
5150
  }
5173
5151
  templateStr = templateStr.replace(new RegExp(expression, flags), value);
@@ -5316,7 +5294,7 @@ var StageRevertDataPlugin = function() {
5316
5294
  var bindingResolveLookup = createPatternMatcher("{{", "}}");
5317
5295
  var expressionResolveLookup = createPatternMatcher("@[", "]@");
5318
5296
  function resolveAllRefs(node, resolveOptions, propertiesToSkip) {
5319
- if (node === null || node === void 0 || typeof node !== "object" && typeof node !== "string") {
5297
+ if (node === null || node === void 0 || (typeof node === "undefined" ? "undefined" : _type_of(node)) !== "object" && typeof node !== "string") {
5320
5298
  return node;
5321
5299
  }
5322
5300
  if (typeof node === "string") {
@@ -5329,7 +5307,7 @@ var StageRevertDataPlugin = function() {
5329
5307
  }
5330
5308
  var val = node[key];
5331
5309
  var newVal = val;
5332
- if (typeof val === "object") {
5310
+ if ((typeof val === "undefined" ? "undefined" : _type_of(val)) === "object") {
5333
5311
  newVal = resolveAllRefs(val, resolveOptions, propertiesToSkip);
5334
5312
  } else if (typeof val === "string") {
5335
5313
  newVal = resolveString(val, resolveOptions);
@@ -5670,7 +5648,7 @@ var StageRevertDataPlugin = function() {
5670
5648
  key: "applyParser",
5671
5649
  value: function applyParser(parser) {
5672
5650
  parser.hooks.parseNode.tap("asset", function(obj, nodeType, options, childOptions) {
5673
- if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && typeof obj === "object") {
5651
+ if ((childOptions === null || childOptions === void 0 ? void 0 : childOptions.key) === "asset" && (typeof obj === "undefined" ? "undefined" : _type_of(obj)) === "object") {
5674
5652
  var assetAST = parser.parseObject(obj, "asset", options);
5675
5653
  if (!assetAST) {
5676
5654
  return [];
@@ -5870,6 +5848,7 @@ var StageRevertDataPlugin = function() {
5870
5848
  }();
5871
5849
  var FlowInstance = /*#__PURE__*/ function() {
5872
5850
  function FlowInstance(id, flow, options) {
5851
+ var _this = this;
5873
5852
  _class_call_check(this, FlowInstance);
5874
5853
  this.isTransitioning = false;
5875
5854
  this.hooks = {
@@ -5886,60 +5865,55 @@ var StageRevertDataPlugin = function() {
5886
5865
  this.flow = flow;
5887
5866
  this.log = options === null || options === void 0 ? void 0 : options.logger;
5888
5867
  this.history = [];
5889
- var _this = this;
5890
- this.hooks.transition.tap("startPromise", function() {
5891
- var _ref = _async_to_generator(function(_oldState, nextState) {
5868
+ this.hooks.transition.tap("startPromise", function(_oldState, nextState) {
5869
+ return _async_to_generator(function() {
5892
5870
  var newState;
5893
5871
  return _ts_generator(this, function(_state) {
5894
5872
  newState = nextState.value;
5895
- if (_this.flowPromise && newState.state_type === "END") {
5896
- _this.flowPromise.resolve(newState);
5873
+ if (this.flowPromise && newState.state_type === "END") {
5874
+ this.flowPromise.resolve(newState);
5897
5875
  }
5898
5876
  return [
5899
5877
  2
5900
5878
  ];
5901
5879
  });
5902
- });
5903
- return function(_oldState, nextState) {
5904
- return _ref.apply(this, arguments);
5905
- };
5906
- }());
5880
+ }).call(_this);
5881
+ });
5907
5882
  }
5908
5883
  _create_class(FlowInstance, [
5909
5884
  {
5910
5885
  key: "start",
5911
5886
  value: /** Start the state machine */ function start() {
5912
- var _this = this;
5913
5887
  return _async_to_generator(function() {
5914
5888
  var _this_log, initialState;
5915
5889
  return _ts_generator(this, function(_state) {
5916
- if (_this.flowPromise) {
5890
+ if (this.flowPromise) {
5917
5891
  ;
5918
- (_this_log = _this.log) === null || _this_log === void 0 ? void 0 : _this_log.warn("Already called start for flow");
5892
+ (_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.warn("Already called start for flow");
5919
5893
  return [
5920
5894
  2,
5921
- _this.flowPromise.promise
5895
+ this.flowPromise.promise
5922
5896
  ];
5923
5897
  }
5924
- _this.flow = _this.hooks.beforeStart.call(_this.flow) || _this.flow;
5925
- if (_this.flow.onStart) {
5926
- _this.hooks.onStart.call(_this.flow.onStart);
5898
+ this.flow = this.hooks.beforeStart.call(this.flow) || this.flow;
5899
+ if (this.flow.onStart) {
5900
+ this.hooks.onStart.call(this.flow.onStart);
5927
5901
  }
5928
- initialState = _this.flow.startState;
5902
+ initialState = this.flow.startState;
5929
5903
  if (!initialState) {
5930
5904
  return [
5931
5905
  2,
5932
5906
  Promise.reject(new Error("No 'startState' defined for flow"))
5933
5907
  ];
5934
5908
  }
5935
- _this.flowPromise = (0, import_p_defer2.default)();
5936
- _this.pushHistory(initialState);
5909
+ this.flowPromise = (0, import_p_defer2.default)();
5910
+ this.pushHistory(initialState);
5937
5911
  return [
5938
5912
  2,
5939
- _this.flowPromise.promise
5913
+ this.flowPromise.promise
5940
5914
  ];
5941
5915
  });
5942
- })();
5916
+ }).call(this);
5943
5917
  }
5944
5918
  },
5945
5919
  {
@@ -5991,7 +5965,7 @@ var StageRevertDataPlugin = function() {
5991
5965
  throw new Error("No flow definition for: ".concat(stateName, " was found."));
5992
5966
  }
5993
5967
  var nextState = this.flow[stateName];
5994
- if (!this.flow[stateName] || typeof nextState !== "object" || !("state_type" in nextState)) {
5968
+ if (!this.flow[stateName] || (typeof nextState === "undefined" ? "undefined" : _type_of(nextState)) !== "object" || !("state_type" in nextState)) {
5995
5969
  var _this_log;
5996
5970
  (_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.error("Flow doesn't contain any states named: ".concat(stateName));
5997
5971
  return;
@@ -6051,30 +6025,30 @@ var StageRevertDataPlugin = function() {
6051
6025
  {
6052
6026
  key: "run",
6053
6027
  value: function run(startState) {
6054
- var _this = this;
6055
6028
  return _async_to_generator(function() {
6056
- var _this_log, startFlow, flow, end, firstItem;
6029
+ var _this, _this_log, startFlow, flow, end, firstItem;
6057
6030
  return _ts_generator(this, function(_state) {
6058
6031
  switch(_state.label){
6059
6032
  case 0:
6060
- if (!Object.prototype.hasOwnProperty.call(_this.navigation, startState)) {
6033
+ _this = this;
6034
+ if (!Object.prototype.hasOwnProperty.call(this.navigation, startState)) {
6061
6035
  return [
6062
6036
  2,
6063
6037
  Promise.reject(new Error("No flow defined for: ".concat(startState)))
6064
6038
  ];
6065
6039
  }
6066
- startFlow = _this.navigation[startState];
6067
- if (startFlow === null || typeof startFlow !== "object") {
6040
+ startFlow = this.navigation[startState];
6041
+ if (startFlow === null || (typeof startFlow === "undefined" ? "undefined" : _type_of(startFlow)) !== "object") {
6068
6042
  return [
6069
6043
  2,
6070
6044
  Promise.reject(new Error("Flow: ".concat(startState, " needs to be an object")))
6071
6045
  ];
6072
6046
  }
6073
- (_this_log = _this.log) === null || _this_log === void 0 ? void 0 : _this_log.debug("Starting flow: ".concat(startState));
6047
+ (_this_log = this.log) === null || _this_log === void 0 ? void 0 : _this_log.debug("Starting flow: ".concat(startState));
6074
6048
  flow = new FlowInstance(startState, startFlow, {
6075
- logger: _this.log
6049
+ logger: this.log
6076
6050
  });
6077
- _this.addNewFlow(flow);
6051
+ this.addNewFlow(flow);
6078
6052
  flow.hooks.afterTransition.tap("flow-controller", function(flowInstance) {
6079
6053
  var _flowInstance_currentState;
6080
6054
  if (((_flowInstance_currentState = flowInstance.currentState) === null || _flowInstance_currentState === void 0 ? void 0 : _flowInstance_currentState.value.state_type) === "FLOW") {
@@ -6094,10 +6068,10 @@ var StageRevertDataPlugin = function() {
6094
6068
  ];
6095
6069
  case 1:
6096
6070
  end = _state.sent();
6097
- _this.navStack.pop();
6098
- if (_this.navStack.length > 0) {
6071
+ this.navStack.pop();
6072
+ if (this.navStack.length > 0) {
6099
6073
  firstItem = 0;
6100
- _this.current = _this.navStack[firstItem];
6074
+ this.current = this.navStack[firstItem];
6101
6075
  }
6102
6076
  return [
6103
6077
  2,
@@ -6105,16 +6079,15 @@ var StageRevertDataPlugin = function() {
6105
6079
  ];
6106
6080
  }
6107
6081
  });
6108
- })();
6082
+ }).call(this);
6109
6083
  }
6110
6084
  },
6111
6085
  {
6112
6086
  key: "start",
6113
6087
  value: function start() {
6114
- var _this = this;
6115
6088
  return _async_to_generator(function() {
6116
6089
  return _ts_generator(this, function(_state) {
6117
- if (!_this.navigation.BEGIN) {
6090
+ if (!this.navigation.BEGIN) {
6118
6091
  return [
6119
6092
  2,
6120
6093
  Promise.reject(new Error("Must supply a BEGIN state"))
@@ -6122,10 +6095,10 @@ var StageRevertDataPlugin = function() {
6122
6095
  }
6123
6096
  return [
6124
6097
  2,
6125
- _this.run(_this.navigation.BEGIN)
6098
+ this.run(this.navigation.BEGIN)
6126
6099
  ];
6127
6100
  });
6128
- })();
6101
+ }).call(this);
6129
6102
  }
6130
6103
  }
6131
6104
  ]);
@@ -7232,7 +7205,7 @@ var StageRevertDataPlugin = function() {
7232
7205
  var parentBinding = resolved.parent();
7233
7206
  var property = resolved.key();
7234
7207
  var parentValue = this.get(parentBinding);
7235
- var existedBeforeDelete = typeof parentValue === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
7208
+ var existedBeforeDelete = (typeof parentValue === "undefined" ? "undefined" : _type_of(parentValue)) === "object" && parentValue !== null && Object.prototype.hasOwnProperty.call(parentValue, property);
7236
7209
  this.getModel().delete(resolved, options);
7237
7210
  if (existedBeforeDelete && !this.get(resolved)) {
7238
7211
  this.trash.add(resolved);
@@ -7333,7 +7306,7 @@ var StageRevertDataPlugin = function() {
7333
7306
  var expressionEvaluator;
7334
7307
  var handleEval = function(exp) {
7335
7308
  if (exp) {
7336
- if (typeof exp === "object" && "exp" in exp) {
7309
+ if ((typeof exp === "undefined" ? "undefined" : _type_of(exp)) === "object" && "exp" in exp) {
7337
7310
  expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp.exp);
7338
7311
  } else {
7339
7312
  expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp);
@@ -7594,7 +7567,7 @@ var StageRevertDataPlugin = function() {
7594
7567
  flow.hooks.beforeTransition.tap("player", function(state, transitionVal) {
7595
7568
  var computedTransitionVal = state.transitions[transitionVal] ? transitionVal : "*";
7596
7569
  if (state.onEnd && state.transitions[computedTransitionVal]) {
7597
- if (typeof state.onEnd === "object" && "exp" in state.onEnd) {
7570
+ if (_type_of(state.onEnd) === "object" && "exp" in state.onEnd) {
7598
7571
  expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd.exp);
7599
7572
  } else {
7600
7573
  expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(state.onEnd);
@@ -7753,12 +7726,12 @@ var StageRevertDataPlugin = function() {
7753
7726
  {
7754
7727
  key: "start",
7755
7728
  value: function start(payload) {
7756
- var _this = this;
7757
7729
  return _async_to_generator(function() {
7758
- var _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
7730
+ var _this, _payload_id, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
7759
7731
  return _ts_generator(this, function(_state) {
7760
7732
  switch(_state.label){
7761
7733
  case 0:
7734
+ _this = this;
7762
7735
  ref = Symbol((_payload_id = payload === null || payload === void 0 ? void 0 : payload.id) !== null && _payload_id !== void 0 ? _payload_id : "payload");
7763
7736
  maybeUpdateState = function(newState) {
7764
7737
  if (_this.state.ref !== ref) {
@@ -7768,7 +7741,7 @@ var StageRevertDataPlugin = function() {
7768
7741
  _this.setState(newState);
7769
7742
  return newState;
7770
7743
  };
7771
- _this.setState({
7744
+ this.setState({
7772
7745
  status: "not-started",
7773
7746
  ref: ref
7774
7747
  });
@@ -7780,8 +7753,8 @@ var StageRevertDataPlugin = function() {
7780
7753
  ,
7781
7754
  4
7782
7755
  ]);
7783
- _this_setupFlow = _this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
7784
- _this.setState(_object_spread({
7756
+ _this_setupFlow = this.setupFlow(payload), state = _this_setupFlow.state, start = _this_setupFlow.start;
7757
+ this.setState(_object_spread({
7785
7758
  ref: ref
7786
7759
  }, state));
7787
7760
  start();
@@ -7826,7 +7799,7 @@ var StageRevertDataPlugin = function() {
7826
7799
  ];
7827
7800
  }
7828
7801
  });
7829
- })();
7802
+ }).call(this);
7830
7803
  }
7831
7804
  }
7832
7805
  ]);