@player-ui/async-node-plugin 0.16.0--canary.812.32412 → 0.16.0--canary.866.36538
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.
|
@@ -118,6 +118,7 @@ function _inherits(subClass, superClass) {
|
|
|
118
118
|
if (superClass) _set_prototype_of(subClass, superClass);
|
|
119
119
|
}
|
|
120
120
|
function _instanceof(left, right) {
|
|
121
|
+
"@swc/helpers - instanceof";
|
|
121
122
|
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
122
123
|
return !!right[Symbol.hasInstance](left);
|
|
123
124
|
} else {
|
|
@@ -201,12 +202,22 @@ function _object_spread_props(target, source) {
|
|
|
201
202
|
}
|
|
202
203
|
function _object_without_properties(source, excluded) {
|
|
203
204
|
if (source == null) return {};
|
|
204
|
-
var target =
|
|
205
|
-
|
|
205
|
+
var target = {}, sourceKeys, key, i;
|
|
206
|
+
if (typeof Reflect !== "undefined" && Reflect.ownKeys) {
|
|
207
|
+
sourceKeys = Reflect.ownKeys(Object(source));
|
|
208
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
209
|
+
key = sourceKeys[i];
|
|
210
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
211
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
212
|
+
target[key] = source[key];
|
|
213
|
+
}
|
|
214
|
+
return target;
|
|
215
|
+
}
|
|
216
|
+
target = _object_without_properties_loose(source, excluded);
|
|
206
217
|
if (Object.getOwnPropertySymbols) {
|
|
207
|
-
|
|
208
|
-
for(i = 0; i <
|
|
209
|
-
key =
|
|
218
|
+
sourceKeys = Object.getOwnPropertySymbols(source);
|
|
219
|
+
for(i = 0; i < sourceKeys.length; i++){
|
|
220
|
+
key = sourceKeys[i];
|
|
210
221
|
if (excluded.indexOf(key) >= 0) continue;
|
|
211
222
|
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
212
223
|
target[key] = source[key];
|
|
@@ -216,12 +227,11 @@ function _object_without_properties(source, excluded) {
|
|
|
216
227
|
}
|
|
217
228
|
function _object_without_properties_loose(source, excluded) {
|
|
218
229
|
if (source == null) return {};
|
|
219
|
-
var target = {};
|
|
220
|
-
var sourceKeys = Object.keys(source);
|
|
221
|
-
var key, i;
|
|
230
|
+
var target = {}, sourceKeys = Object.getOwnPropertyNames(source), key, i;
|
|
222
231
|
for(i = 0; i < sourceKeys.length; i++){
|
|
223
232
|
key = sourceKeys[i];
|
|
224
233
|
if (excluded.indexOf(key) >= 0) continue;
|
|
234
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
225
235
|
target[key] = source[key];
|
|
226
236
|
}
|
|
227
237
|
return target;
|
|
@@ -303,9 +313,17 @@ function _ts_generator(thisArg, body) {
|
|
|
303
313
|
},
|
|
304
314
|
trys: [],
|
|
305
315
|
ops: []
|
|
306
|
-
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
307
|
-
return
|
|
308
|
-
|
|
316
|
+
}, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype), d = Object.defineProperty;
|
|
317
|
+
return d(g, "next", {
|
|
318
|
+
value: verb(0)
|
|
319
|
+
}), d(g, "throw", {
|
|
320
|
+
value: verb(1)
|
|
321
|
+
}), d(g, "return", {
|
|
322
|
+
value: verb(2)
|
|
323
|
+
}), typeof Symbol === "function" && d(g, Symbol.iterator, {
|
|
324
|
+
value: function() {
|
|
325
|
+
return this;
|
|
326
|
+
}
|
|
309
327
|
}), g;
|
|
310
328
|
function verb(n) {
|
|
311
329
|
return function(v) {
|
|
@@ -432,7 +450,7 @@ var AsyncNodePlugin = function() {
|
|
|
432
450
|
};
|
|
433
451
|
var createObjectMatcher = function createObjectMatcher(partialObj) {
|
|
434
452
|
var pairs = traverseObj(partialObj);
|
|
435
|
-
var matchFunction = function(searchObj) {
|
|
453
|
+
var matchFunction = function matchFunction(searchObj) {
|
|
436
454
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
437
455
|
try {
|
|
438
456
|
for(var _iterator = Array.from(pairs)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
@@ -462,7 +480,7 @@ var AsyncNodePlugin = function() {
|
|
|
462
480
|
return matchFunction;
|
|
463
481
|
};
|
|
464
482
|
var createBasicMatcher = function createBasicMatcher(seed) {
|
|
465
|
-
var matcher = function(match) {
|
|
483
|
+
var matcher = function matcher(match) {
|
|
466
484
|
return seed === match;
|
|
467
485
|
};
|
|
468
486
|
matcher.count = 1;
|
|
@@ -530,21 +548,21 @@ var AsyncNodePlugin = function() {
|
|
|
530
548
|
return middleware;
|
|
531
549
|
}
|
|
532
550
|
return {
|
|
533
|
-
get: function(binding, options) {
|
|
551
|
+
get: function get(binding, options) {
|
|
534
552
|
var resolvedOptions = options !== null && options !== void 0 ? options : defaultOptions;
|
|
535
553
|
if (middleware.get) {
|
|
536
554
|
return middleware.get(binding, resolvedOptions, next);
|
|
537
555
|
}
|
|
538
556
|
return next === null || next === void 0 ? void 0 : next.get(binding, resolvedOptions);
|
|
539
557
|
},
|
|
540
|
-
set: function(transaction, options) {
|
|
558
|
+
set: function set(transaction, options) {
|
|
541
559
|
var resolvedOptions = options !== null && options !== void 0 ? options : defaultOptions;
|
|
542
560
|
if (middleware.set) {
|
|
543
561
|
return middleware.set(transaction, resolvedOptions, next);
|
|
544
562
|
}
|
|
545
563
|
return next === null || next === void 0 ? void 0 : next.set(transaction, resolvedOptions);
|
|
546
564
|
},
|
|
547
|
-
delete: function(binding, options) {
|
|
565
|
+
delete: function _delete(binding, options) {
|
|
548
566
|
var resolvedOptions = options !== null && options !== void 0 ? options : defaultOptions;
|
|
549
567
|
if (middleware.delete) {
|
|
550
568
|
return middleware.delete(binding, resolvedOptions, next);
|
|
@@ -568,15 +586,15 @@ var AsyncNodePlugin = function() {
|
|
|
568
586
|
return model;
|
|
569
587
|
}
|
|
570
588
|
return {
|
|
571
|
-
get: function(binding, options) {
|
|
589
|
+
get: function get(binding, options) {
|
|
572
590
|
var _createModelWithOptions;
|
|
573
591
|
return (_createModelWithOptions = createModelWithOptions(options)) === null || _createModelWithOptions === void 0 ? void 0 : _createModelWithOptions.get(binding, options);
|
|
574
592
|
},
|
|
575
|
-
set: function(transaction, options) {
|
|
593
|
+
set: function set(transaction, options) {
|
|
576
594
|
var _createModelWithOptions;
|
|
577
595
|
return (_createModelWithOptions = createModelWithOptions(options)) === null || _createModelWithOptions === void 0 ? void 0 : _createModelWithOptions.set(transaction, options);
|
|
578
596
|
},
|
|
579
|
-
delete: function(binding, options) {
|
|
597
|
+
delete: function _delete(binding, options) {
|
|
580
598
|
var _createModelWithOptions;
|
|
581
599
|
return (_createModelWithOptions = createModelWithOptions(options)) === null || _createModelWithOptions === void 0 ? void 0 : _createModelWithOptions.delete(binding, options);
|
|
582
600
|
}
|
|
@@ -650,13 +668,13 @@ var AsyncNodePlugin = function() {
|
|
|
650
668
|
return ch0 === OCURL_CODE && ch1 === OCURL_CODE;
|
|
651
669
|
};
|
|
652
670
|
var parseExpression = function parseExpression(expr, options) {
|
|
653
|
-
var
|
|
654
|
-
var strictMode = (
|
|
671
|
+
var _ref;
|
|
672
|
+
var strictMode = (_ref = options === null || options === void 0 ? void 0 : options.strict) !== null && _ref !== void 0 ? _ref : true;
|
|
655
673
|
var charAtFunc = expr.charAt;
|
|
656
674
|
var charCodeAtFunc = expr.charCodeAt;
|
|
657
675
|
var length = expr.length;
|
|
658
676
|
var index = 0;
|
|
659
|
-
var getLocation = function(startChar) {
|
|
677
|
+
var getLocation = function getLocation(startChar) {
|
|
660
678
|
return {
|
|
661
679
|
start: {
|
|
662
680
|
character: startChar
|
|
@@ -1423,17 +1441,17 @@ var AsyncNodePlugin = function() {
|
|
|
1423
1441
|
return _object_spread_props(_object_spread({}, resolverOptions), {
|
|
1424
1442
|
data: {
|
|
1425
1443
|
model: resolverOptions.model,
|
|
1426
|
-
formatValue: function(ref, value) {
|
|
1444
|
+
formatValue: function formatValue(ref, value) {
|
|
1427
1445
|
if (resolverOptions.formatValue) {
|
|
1428
1446
|
return resolverOptions.formatValue(ref, value);
|
|
1429
1447
|
}
|
|
1430
1448
|
return value;
|
|
1431
1449
|
},
|
|
1432
|
-
format: function(bindingLike, value) {
|
|
1450
|
+
format: function format(bindingLike, value) {
|
|
1433
1451
|
return resolverOptions.format ? resolverOptions.format(isBinding(bindingLike) ? bindingLike : resolverOptions.parseBinding(bindingLike), value) : value;
|
|
1434
1452
|
}
|
|
1435
1453
|
},
|
|
1436
|
-
evaluate: function(exp) {
|
|
1454
|
+
evaluate: function evaluate(exp) {
|
|
1437
1455
|
return resolverOptions.evaluator.evaluate(exp, resolverOptions);
|
|
1438
1456
|
}
|
|
1439
1457
|
});
|
|
@@ -1495,33 +1513,439 @@ var AsyncNodePlugin = function() {
|
|
|
1495
1513
|
});
|
|
1496
1514
|
return batchTxn;
|
|
1497
1515
|
};
|
|
1516
|
+
var pointerToBinding = function pointerToBinding(pointer) {
|
|
1517
|
+
if (!pointer || pointer === "/") return "";
|
|
1518
|
+
var absolute = pointer.startsWith("/");
|
|
1519
|
+
var raw = absolute ? pointer.slice(1) : pointer;
|
|
1520
|
+
var segments = raw.split("/").map(decodeSegment);
|
|
1521
|
+
var out = "";
|
|
1522
|
+
for(var i = 0; i < segments.length; i++){
|
|
1523
|
+
var seg = segments[i];
|
|
1524
|
+
if (NUMERIC_SEGMENT.test(seg)) {
|
|
1525
|
+
out += "[".concat(seg, "]");
|
|
1526
|
+
} else {
|
|
1527
|
+
out += i === 0 ? seg : ".".concat(seg);
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
return out;
|
|
1531
|
+
};
|
|
1532
|
+
var bindingToSegments = function bindingToSegments(binding) {
|
|
1533
|
+
if (!binding) return [];
|
|
1534
|
+
var segments = [];
|
|
1535
|
+
var parts = binding.split(".");
|
|
1536
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1537
|
+
try {
|
|
1538
|
+
for(var _iterator = parts[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1539
|
+
var part = _step.value;
|
|
1540
|
+
var match = part.match(/^([^[]+)((?:\[\d+\])*)$/);
|
|
1541
|
+
if (!match) {
|
|
1542
|
+
segments.push(part);
|
|
1543
|
+
continue;
|
|
1544
|
+
}
|
|
1545
|
+
var _match = _sliced_to_array(match, 3), name = _match[1], arrays = _match[2];
|
|
1546
|
+
if (name) segments.push(name);
|
|
1547
|
+
if (arrays) {
|
|
1548
|
+
var _segments;
|
|
1549
|
+
var _arrays_match;
|
|
1550
|
+
var arrayMatches = (_arrays_match = arrays.match(/\[\d+\]/g)) !== null && _arrays_match !== void 0 ? _arrays_match : [];
|
|
1551
|
+
(_segments = segments).push.apply(_segments, _to_consumable_array(arrayMatches));
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
} catch (err) {
|
|
1555
|
+
_didIteratorError = true;
|
|
1556
|
+
_iteratorError = err;
|
|
1557
|
+
} finally{
|
|
1558
|
+
try {
|
|
1559
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1560
|
+
_iterator.return();
|
|
1561
|
+
}
|
|
1562
|
+
} finally{
|
|
1563
|
+
if (_didIteratorError) {
|
|
1564
|
+
throw _iteratorError;
|
|
1565
|
+
}
|
|
1566
|
+
}
|
|
1567
|
+
}
|
|
1568
|
+
return segments;
|
|
1569
|
+
};
|
|
1570
|
+
var interpolatePointers = function interpolatePointers(input) {
|
|
1571
|
+
return input.replace(/\$\{([^}]+)\}/g, function(_, pointer) {
|
|
1572
|
+
return "{{".concat(pointerToBinding(pointer), "}}");
|
|
1573
|
+
});
|
|
1574
|
+
};
|
|
1575
|
+
var translateFunctionCall = function translateFunctionCall(call, logger) {
|
|
1576
|
+
if (call.call === "formatString") {
|
|
1577
|
+
var _call_args;
|
|
1578
|
+
var value = (_call_args = call.args) === null || _call_args === void 0 ? void 0 : _call_args.value;
|
|
1579
|
+
if (typeof value === "string") return interpolatePointers(value);
|
|
1580
|
+
logger === null || logger === void 0 ? void 0 : logger.warn("[a2ui] formatString received non-string 'value' arg; emitting expression form");
|
|
1581
|
+
}
|
|
1582
|
+
var argList = renderArgList(call.args);
|
|
1583
|
+
if (call.call === "formatString") {
|
|
1584
|
+
return "@[formatString(".concat(argList, ")]@");
|
|
1585
|
+
}
|
|
1586
|
+
return "@[".concat(call.call, "(").concat(argList, ")]@");
|
|
1587
|
+
};
|
|
1588
|
+
var renderArgList = function renderArgList(args) {
|
|
1589
|
+
if (!args) return "";
|
|
1590
|
+
return Object.values(args).map(renderArg).join(", ");
|
|
1591
|
+
};
|
|
1592
|
+
var newBuilder = function newBuilder() {
|
|
1593
|
+
return {
|
|
1594
|
+
schema: {
|
|
1595
|
+
ROOT: {}
|
|
1596
|
+
},
|
|
1597
|
+
knownTypes: /* @__PURE__ */ new Set([
|
|
1598
|
+
"ROOT"
|
|
1599
|
+
])
|
|
1600
|
+
};
|
|
1601
|
+
};
|
|
1602
|
+
var findBoundPath = function findBoundPath(component, logger) {
|
|
1603
|
+
var lookupProp = INPUT_BINDING_PROPS[component.component];
|
|
1604
|
+
if (lookupProp) {
|
|
1605
|
+
var prop = component[lookupProp];
|
|
1606
|
+
if (isPathRef(prop)) return prop.path;
|
|
1607
|
+
}
|
|
1608
|
+
var pathRefs = collectPathRefs(component);
|
|
1609
|
+
if (pathRefs.length === 1) return pathRefs[0];
|
|
1610
|
+
if (pathRefs.length > 1) {
|
|
1611
|
+
logger === null || logger === void 0 ? void 0 : logger.warn("[a2ui] Component '".concat(component.id, "' (").concat(component.component, ") has checks but multiple {path} refs; skipping schema synthesis for this component"));
|
|
1612
|
+
} else {
|
|
1613
|
+
logger === null || logger === void 0 ? void 0 : logger.warn("[a2ui] Component '".concat(component.id, "' (").concat(component.component, ") has checks but no bound path could be determined; skipping"));
|
|
1614
|
+
}
|
|
1615
|
+
return void 0;
|
|
1616
|
+
};
|
|
1617
|
+
var collectPathRefs = function collectPathRefs(component) {
|
|
1618
|
+
var found = [];
|
|
1619
|
+
var walk = function walk1(v) {
|
|
1620
|
+
if (!v || (typeof v === "undefined" ? "undefined" : _type_of(v)) !== "object") return;
|
|
1621
|
+
if (Array.isArray(v)) {
|
|
1622
|
+
v.forEach(walk);
|
|
1623
|
+
return;
|
|
1624
|
+
}
|
|
1625
|
+
if (isPathRef(v)) {
|
|
1626
|
+
found.push(v.path);
|
|
1627
|
+
return;
|
|
1628
|
+
}
|
|
1629
|
+
Object.values(v).forEach(walk);
|
|
1630
|
+
};
|
|
1631
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1632
|
+
try {
|
|
1633
|
+
for(var _iterator = Object.entries(component)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1634
|
+
var _step_value = _sliced_to_array(_step.value, 2), k = _step_value[0], v = _step_value[1];
|
|
1635
|
+
if (k === "id" || k === "component" || k === "checks" || k === "action") {
|
|
1636
|
+
continue;
|
|
1637
|
+
}
|
|
1638
|
+
walk(v);
|
|
1639
|
+
}
|
|
1640
|
+
} catch (err) {
|
|
1641
|
+
_didIteratorError = true;
|
|
1642
|
+
_iteratorError = err;
|
|
1643
|
+
} finally{
|
|
1644
|
+
try {
|
|
1645
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1646
|
+
_iterator.return();
|
|
1647
|
+
}
|
|
1648
|
+
} finally{
|
|
1649
|
+
if (_didIteratorError) {
|
|
1650
|
+
throw _iteratorError;
|
|
1651
|
+
}
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
return found;
|
|
1655
|
+
};
|
|
1656
|
+
var translateCheck = function translateCheck(check, logger) {
|
|
1657
|
+
var _check_args;
|
|
1658
|
+
var type = CHECK_TO_VALIDATOR[check.call];
|
|
1659
|
+
if (!type) {
|
|
1660
|
+
logger === null || logger === void 0 ? void 0 : logger.warn("[a2ui] Unknown validation check '".concat(check.call, "'; dropping"));
|
|
1661
|
+
return void 0;
|
|
1662
|
+
}
|
|
1663
|
+
var ref = {
|
|
1664
|
+
type: type,
|
|
1665
|
+
severity: "error"
|
|
1666
|
+
};
|
|
1667
|
+
if (check.message) ref.message = check.message;
|
|
1668
|
+
if (check.call === "regex" && ((_check_args = check.args) === null || _check_args === void 0 ? void 0 : _check_args.pattern)) {
|
|
1669
|
+
ref.regex = unwrapLiteral(check.args.pattern);
|
|
1670
|
+
}
|
|
1671
|
+
if (check.call === "length") {
|
|
1672
|
+
var _check_args1, _check_args2;
|
|
1673
|
+
if (((_check_args1 = check.args) === null || _check_args1 === void 0 ? void 0 : _check_args1.min) !== void 0) ref.min = unwrapLiteral(check.args.min);
|
|
1674
|
+
if (((_check_args2 = check.args) === null || _check_args2 === void 0 ? void 0 : _check_args2.max) !== void 0) ref.max = unwrapLiteral(check.args.max);
|
|
1675
|
+
}
|
|
1676
|
+
return ref;
|
|
1677
|
+
};
|
|
1678
|
+
var unwrapLiteral = function unwrapLiteral(value) {
|
|
1679
|
+
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean" || value === null) {
|
|
1680
|
+
return value;
|
|
1681
|
+
}
|
|
1682
|
+
return value;
|
|
1683
|
+
};
|
|
1684
|
+
var installAtPath = function installAtPath(builder, binding, leafType, validations, logger) {
|
|
1685
|
+
var segments = bindingToSegments(binding).filter(function(s) {
|
|
1686
|
+
return !s.startsWith("[");
|
|
1687
|
+
});
|
|
1688
|
+
if (segments.length === 0) {
|
|
1689
|
+
logger === null || logger === void 0 ? void 0 : logger.warn("[a2ui] Cannot install schema validation at empty path; skipping");
|
|
1690
|
+
return;
|
|
1691
|
+
}
|
|
1692
|
+
var currentNode = builder.schema.ROOT;
|
|
1693
|
+
var ownerPath = [];
|
|
1694
|
+
for(var i = 0; i < segments.length - 1; i++){
|
|
1695
|
+
var seg = segments[i];
|
|
1696
|
+
ownerPath.push(seg);
|
|
1697
|
+
var typeName = "".concat(TYPE_PREFIX).concat(ownerPath.join("_"));
|
|
1698
|
+
var existing = currentNode[seg];
|
|
1699
|
+
if (!existing) {
|
|
1700
|
+
currentNode[seg] = {
|
|
1701
|
+
type: typeName
|
|
1702
|
+
};
|
|
1703
|
+
} else if (existing.type !== typeName) {}
|
|
1704
|
+
var ref = currentNode[seg].type;
|
|
1705
|
+
if (!builder.schema[ref]) {
|
|
1706
|
+
builder.schema[ref] = {};
|
|
1707
|
+
builder.knownTypes.add(ref);
|
|
1708
|
+
}
|
|
1709
|
+
currentNode = builder.schema[ref];
|
|
1710
|
+
}
|
|
1711
|
+
var leafSeg = segments[segments.length - 1];
|
|
1712
|
+
var existingLeaf = currentNode[leafSeg];
|
|
1713
|
+
if (existingLeaf) {
|
|
1714
|
+
var _existingLeaf_validation;
|
|
1715
|
+
var merged = _object_spread_props(_object_spread({}, existingLeaf), {
|
|
1716
|
+
type: pickLeafType(existingLeaf.type, leafType),
|
|
1717
|
+
validation: _to_consumable_array((_existingLeaf_validation = existingLeaf.validation) !== null && _existingLeaf_validation !== void 0 ? _existingLeaf_validation : []).concat(_to_consumable_array(validations))
|
|
1718
|
+
});
|
|
1719
|
+
currentNode[leafSeg] = merged;
|
|
1720
|
+
} else {
|
|
1721
|
+
currentNode[leafSeg] = {
|
|
1722
|
+
type: leafType,
|
|
1723
|
+
validation: validations
|
|
1724
|
+
};
|
|
1725
|
+
}
|
|
1726
|
+
};
|
|
1727
|
+
var pickLeafType = function pickLeafType(existing, incoming) {
|
|
1728
|
+
if (incoming !== "string") return incoming;
|
|
1729
|
+
return existing;
|
|
1730
|
+
};
|
|
1731
|
+
var defaultLeafType = function defaultLeafType(component, checks) {
|
|
1732
|
+
if (component.component === "CheckBox") return "boolean";
|
|
1733
|
+
if (checks.some(function(c) {
|
|
1734
|
+
return c.call === "numeric";
|
|
1735
|
+
})) return "number";
|
|
1736
|
+
return "string";
|
|
1737
|
+
};
|
|
1738
|
+
var synthesizeSchema = function synthesizeSchema(components, logger) {
|
|
1739
|
+
var builder = newBuilder();
|
|
1740
|
+
var found = false;
|
|
1741
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1742
|
+
try {
|
|
1743
|
+
for(var _iterator = components[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1744
|
+
var component = _step.value;
|
|
1745
|
+
if (!component.checks || component.checks.length === 0) continue;
|
|
1746
|
+
var pointer = findBoundPath(component, logger);
|
|
1747
|
+
if (!pointer) continue;
|
|
1748
|
+
var binding = pointerToBinding(pointer);
|
|
1749
|
+
if (!binding) continue;
|
|
1750
|
+
var validations = component.checks.map(function(c) {
|
|
1751
|
+
return translateCheck(c, logger);
|
|
1752
|
+
}).filter(function(v) {
|
|
1753
|
+
return v !== void 0;
|
|
1754
|
+
});
|
|
1755
|
+
if (validations.length === 0) continue;
|
|
1756
|
+
installAtPath(builder, binding, defaultLeafType(component, component.checks), validations, logger);
|
|
1757
|
+
found = true;
|
|
1758
|
+
}
|
|
1759
|
+
} catch (err) {
|
|
1760
|
+
_didIteratorError = true;
|
|
1761
|
+
_iteratorError = err;
|
|
1762
|
+
} finally{
|
|
1763
|
+
try {
|
|
1764
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1765
|
+
_iterator.return();
|
|
1766
|
+
}
|
|
1767
|
+
} finally{
|
|
1768
|
+
if (_didIteratorError) {
|
|
1769
|
+
throw _iteratorError;
|
|
1770
|
+
}
|
|
1771
|
+
}
|
|
1772
|
+
}
|
|
1773
|
+
return found ? builder.schema : void 0;
|
|
1774
|
+
};
|
|
1775
|
+
var resolveAndInline = function resolveAndInline(id, ctx, templateScope) {
|
|
1776
|
+
var component = ctx.byId.get(id);
|
|
1777
|
+
if (!component) {
|
|
1778
|
+
throw new Error("[a2ui] Component reference '".concat(id, "' could not be resolved in the snapshot."));
|
|
1779
|
+
}
|
|
1780
|
+
return inlineComponent(component, ctx, templateScope);
|
|
1781
|
+
};
|
|
1782
|
+
var wrapInlined = function wrapInlined(asset) {
|
|
1783
|
+
return {
|
|
1784
|
+
asset: asset
|
|
1785
|
+
};
|
|
1786
|
+
};
|
|
1787
|
+
var scopedBinding = function scopedBinding(pointer, scope) {
|
|
1788
|
+
if (!pointer || pointer === "/") return scope !== null && scope !== void 0 ? scope : "";
|
|
1789
|
+
if (pointer.startsWith("/")) return pointerToBinding(pointer);
|
|
1790
|
+
if (!scope) return pointerToBinding(pointer);
|
|
1791
|
+
var relative = pointerToBinding(pointer);
|
|
1792
|
+
return relative ? "".concat(scope, "._index_.").concat(relative) : "".concat(scope, "._index_");
|
|
1793
|
+
};
|
|
1794
|
+
var scopedPointer = function scopedPointer(pointer, scope) {
|
|
1795
|
+
if (pointer.startsWith("/")) return pointer;
|
|
1796
|
+
return "/".concat(scope, "/_index_/").concat(pointer);
|
|
1797
|
+
};
|
|
1798
|
+
var translateAction = function translateAction(action, ctx) {
|
|
1799
|
+
if ("event" in action) {
|
|
1800
|
+
var _action_event = action.event, name = _action_event.name, context = _action_event.context;
|
|
1801
|
+
ctx.eventNames.add(name);
|
|
1802
|
+
var result = {
|
|
1803
|
+
value: name
|
|
1804
|
+
};
|
|
1805
|
+
if (context && Object.keys(context).length > 0) {
|
|
1806
|
+
result.exp = buildContextWriteExpressions(context);
|
|
1807
|
+
}
|
|
1808
|
+
return result;
|
|
1809
|
+
}
|
|
1810
|
+
return {
|
|
1811
|
+
exp: translateFunctionCall(action.functionCall, ctx.logger)
|
|
1812
|
+
};
|
|
1813
|
+
};
|
|
1814
|
+
var buildContextWriteExpressions = function buildContextWriteExpressions(context) {
|
|
1815
|
+
return Object.entries(context).map(function(param) {
|
|
1816
|
+
var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
|
|
1817
|
+
var lhs = "{{".concat(A2UI_EVENT_CONTEXT_NAMESPACE, ".").concat(key, "}}");
|
|
1818
|
+
return "".concat(lhs, " = ").concat(renderRhs(value));
|
|
1819
|
+
});
|
|
1820
|
+
};
|
|
1821
|
+
var buildNavigation = function buildNavigation(surfaceId, eventNames) {
|
|
1822
|
+
var view = {
|
|
1823
|
+
state_type: "VIEW",
|
|
1824
|
+
ref: surfaceId,
|
|
1825
|
+
transitions: {
|
|
1826
|
+
"*": "END_Done"
|
|
1827
|
+
}
|
|
1828
|
+
};
|
|
1829
|
+
var endStates = {
|
|
1830
|
+
END_Done: {
|
|
1831
|
+
state_type: "END",
|
|
1832
|
+
outcome: "done"
|
|
1833
|
+
}
|
|
1834
|
+
};
|
|
1835
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1836
|
+
try {
|
|
1837
|
+
for(var _iterator = eventNames[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1838
|
+
var name = _step.value;
|
|
1839
|
+
var endName = "END_".concat(name);
|
|
1840
|
+
view.transitions[name] = endName;
|
|
1841
|
+
endStates[endName] = {
|
|
1842
|
+
state_type: "END",
|
|
1843
|
+
outcome: name
|
|
1844
|
+
};
|
|
1845
|
+
}
|
|
1846
|
+
} catch (err) {
|
|
1847
|
+
_didIteratorError = true;
|
|
1848
|
+
_iteratorError = err;
|
|
1849
|
+
} finally{
|
|
1850
|
+
try {
|
|
1851
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1852
|
+
_iterator.return();
|
|
1853
|
+
}
|
|
1854
|
+
} finally{
|
|
1855
|
+
if (_didIteratorError) {
|
|
1856
|
+
throw _iteratorError;
|
|
1857
|
+
}
|
|
1858
|
+
}
|
|
1859
|
+
}
|
|
1860
|
+
var flow = _object_spread({
|
|
1861
|
+
startState: "VIEW_1",
|
|
1862
|
+
VIEW_1: view
|
|
1863
|
+
}, endStates);
|
|
1864
|
+
return {
|
|
1865
|
+
BEGIN: "FLOW_1",
|
|
1866
|
+
FLOW_1: flow
|
|
1867
|
+
};
|
|
1868
|
+
};
|
|
1869
|
+
var adaptA2UIToFlow = function adaptA2UIToFlow(snapshot, logger) {
|
|
1870
|
+
var _snapshot_data;
|
|
1871
|
+
if (!snapshot || !Array.isArray(snapshot.components)) {
|
|
1872
|
+
throw new Error("[a2ui] snapshot.components must be an array");
|
|
1873
|
+
}
|
|
1874
|
+
var byId = /* @__PURE__ */ new Map();
|
|
1875
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1876
|
+
try {
|
|
1877
|
+
for(var _iterator = snapshot.components[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
1878
|
+
var component = _step.value;
|
|
1879
|
+
if (!(component === null || component === void 0 ? void 0 : component.id)) {
|
|
1880
|
+
throw new Error("[a2ui] every component must have an id");
|
|
1881
|
+
}
|
|
1882
|
+
byId.set(component.id, component);
|
|
1883
|
+
}
|
|
1884
|
+
} catch (err) {
|
|
1885
|
+
_didIteratorError = true;
|
|
1886
|
+
_iteratorError = err;
|
|
1887
|
+
} finally{
|
|
1888
|
+
try {
|
|
1889
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
1890
|
+
_iterator.return();
|
|
1891
|
+
}
|
|
1892
|
+
} finally{
|
|
1893
|
+
if (_didIteratorError) {
|
|
1894
|
+
throw _iteratorError;
|
|
1895
|
+
}
|
|
1896
|
+
}
|
|
1897
|
+
}
|
|
1898
|
+
var root = byId.get("root");
|
|
1899
|
+
if (!root) {
|
|
1900
|
+
throw new Error("[a2ui] snapshot must contain a component with id 'root'");
|
|
1901
|
+
}
|
|
1902
|
+
var ctx = {
|
|
1903
|
+
byId: byId,
|
|
1904
|
+
inProgress: /* @__PURE__ */ new Set(),
|
|
1905
|
+
eventNames: /* @__PURE__ */ new Set(),
|
|
1906
|
+
logger: logger
|
|
1907
|
+
};
|
|
1908
|
+
var rootAsset = inlineComponent(root, ctx);
|
|
1909
|
+
rootAsset.id = snapshot.surfaceId;
|
|
1910
|
+
var schema = synthesizeSchema(snapshot.components, logger);
|
|
1911
|
+
var flow = {
|
|
1912
|
+
id: snapshot.surfaceId,
|
|
1913
|
+
views: [
|
|
1914
|
+
rootAsset
|
|
1915
|
+
],
|
|
1916
|
+
data: (_snapshot_data = snapshot.data) !== null && _snapshot_data !== void 0 ? _snapshot_data : {},
|
|
1917
|
+
navigation: buildNavigation(snapshot.surfaceId, ctx.eventNames)
|
|
1918
|
+
};
|
|
1919
|
+
if (schema) flow.schema = schema;
|
|
1920
|
+
return flow;
|
|
1921
|
+
};
|
|
1498
1922
|
var __create = Object.create;
|
|
1499
1923
|
var __defProp = Object.defineProperty;
|
|
1500
1924
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
1501
1925
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
1502
1926
|
var __getProtoOf = Object.getPrototypeOf;
|
|
1503
1927
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1504
|
-
var __commonJS = function(cb, mod) {
|
|
1928
|
+
var __commonJS = function __commonJS(cb, mod) {
|
|
1505
1929
|
return function __require() {
|
|
1506
1930
|
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = {
|
|
1507
1931
|
exports: {}
|
|
1508
1932
|
}).exports, mod), mod.exports;
|
|
1509
1933
|
};
|
|
1510
1934
|
};
|
|
1511
|
-
var __export = function(target, all) {
|
|
1935
|
+
var __export = function __export(target, all) {
|
|
1512
1936
|
for(var name in all)__defProp(target, name, {
|
|
1513
1937
|
get: all[name],
|
|
1514
1938
|
enumerable: true
|
|
1515
1939
|
});
|
|
1516
1940
|
};
|
|
1517
|
-
var __copyProps = function(to, from, except, desc) {
|
|
1941
|
+
var __copyProps = function __copyProps(to, from, except, desc) {
|
|
1518
1942
|
if (from && (typeof from === "undefined" ? "undefined" : _type_of(from)) === "object" || typeof from === "function") {
|
|
1519
1943
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
1520
1944
|
try {
|
|
1521
1945
|
var _loop = function() {
|
|
1522
1946
|
var key = _step.value;
|
|
1523
1947
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
1524
|
-
get: function() {
|
|
1948
|
+
get: function get() {
|
|
1525
1949
|
return from[key];
|
|
1526
1950
|
},
|
|
1527
1951
|
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
@@ -1545,7 +1969,7 @@ var AsyncNodePlugin = function() {
|
|
|
1545
1969
|
}
|
|
1546
1970
|
return to;
|
|
1547
1971
|
};
|
|
1548
|
-
var __toESM = function(mod, isNodeMode, target) {
|
|
1972
|
+
var __toESM = function __toESM(mod, isNodeMode, target) {
|
|
1549
1973
|
return target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(// If the importer is in node compatibility mode or this is not an ESM
|
|
1550
1974
|
// file that has been converted to a CommonJS file using a Babel-
|
|
1551
1975
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
@@ -1555,7 +1979,7 @@ var AsyncNodePlugin = function() {
|
|
|
1555
1979
|
enumerable: true
|
|
1556
1980
|
}) : target, mod);
|
|
1557
1981
|
};
|
|
1558
|
-
var __toCommonJS = function(mod) {
|
|
1982
|
+
var __toCommonJS = function __toCommonJS(mod) {
|
|
1559
1983
|
return __copyProps(__defProp({}, "__esModule", {
|
|
1560
1984
|
value: true
|
|
1561
1985
|
}), mod);
|
|
@@ -1657,7 +2081,7 @@ var AsyncNodePlugin = function() {
|
|
|
1657
2081
|
function toError(err) {
|
|
1658
2082
|
try {
|
|
1659
2083
|
return _instanceof(err, Error) ? err : new Error("Value that is not an instance of Error was thrown: ".concat(err));
|
|
1660
|
-
} catch (
|
|
2084
|
+
} catch (unused) {
|
|
1661
2085
|
return new Error("Failed to stringify non-instance of Error that was thrown.This is possibly due to the fact that toString() method of the valuedoesn't return a primitive value.");
|
|
1662
2086
|
}
|
|
1663
2087
|
}
|
|
@@ -1714,7 +2138,7 @@ var AsyncNodePlugin = function() {
|
|
|
1714
2138
|
}
|
|
1715
2139
|
return out;
|
|
1716
2140
|
}
|
|
1717
|
-
function
|
|
2141
|
+
function isObject2(o) {
|
|
1718
2142
|
return o != null && (typeof o === "undefined" ? "undefined" : _type_of(o)) === "object";
|
|
1719
2143
|
}
|
|
1720
2144
|
function addLast2(array, val) {
|
|
@@ -1787,7 +2211,7 @@ var AsyncNodePlugin = function() {
|
|
|
1787
2211
|
if (idx === path.length - 1) {
|
|
1788
2212
|
newValue = val;
|
|
1789
2213
|
} else {
|
|
1790
|
-
var nestedObj =
|
|
2214
|
+
var nestedObj = isObject2(obj) && isObject2(obj[key]) ? obj[key] : typeof path[idx + 1] === "number" ? [] : {};
|
|
1791
2215
|
newValue = doSetIn(nestedObj, path, val, idx + 1);
|
|
1792
2216
|
}
|
|
1793
2217
|
return set2(obj, key, newValue);
|
|
@@ -1917,7 +2341,7 @@ var AsyncNodePlugin = function() {
|
|
|
1917
2341
|
var key = keys[j];
|
|
1918
2342
|
if (fAddDefaults && out[key] !== void 0) continue;
|
|
1919
2343
|
var nextVal = obj[key];
|
|
1920
|
-
if (fDeep &&
|
|
2344
|
+
if (fDeep && isObject2(out[key]) && isObject2(nextVal)) {
|
|
1921
2345
|
nextVal = doMerge(fAddDefaults, fDeep, out[key], nextVal);
|
|
1922
2346
|
}
|
|
1923
2347
|
if (nextVal === void 0 || nextVal === out[key]) continue;
|
|
@@ -1958,7 +2382,7 @@ var AsyncNodePlugin = function() {
|
|
|
1958
2382
|
var require_p_defer = __commonJS({
|
|
1959
2383
|
"../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/p-defer@3.0.0/node_modules/p-defer/index.js": function(exports, module) {
|
|
1960
2384
|
"use strict";
|
|
1961
|
-
var pDefer = function() {
|
|
2385
|
+
var pDefer = function pDefer() {
|
|
1962
2386
|
var deferred2 = {};
|
|
1963
2387
|
deferred2.promise = new Promise(function(resolve, reject) {
|
|
1964
2388
|
deferred2.resolve = resolve;
|
|
@@ -2067,19 +2491,19 @@ var AsyncNodePlugin = function() {
|
|
|
2067
2491
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/index.ts
|
|
2068
2492
|
var src_exports = {};
|
|
2069
2493
|
__export(src_exports, {
|
|
2070
|
-
AsyncNodePlugin: function() {
|
|
2494
|
+
AsyncNodePlugin: function AsyncNodePlugin1() {
|
|
2071
2495
|
return AsyncNodePlugin;
|
|
2072
2496
|
},
|
|
2073
|
-
AsyncNodePluginPlugin: function() {
|
|
2497
|
+
AsyncNodePluginPlugin: function AsyncNodePluginPlugin1() {
|
|
2074
2498
|
return AsyncNodePluginPlugin;
|
|
2075
2499
|
},
|
|
2076
|
-
AsyncNodePluginSymbol: function() {
|
|
2500
|
+
AsyncNodePluginSymbol: function AsyncNodePluginSymbol1() {
|
|
2077
2501
|
return AsyncNodePluginSymbol;
|
|
2078
2502
|
},
|
|
2079
|
-
asyncTransform: function() {
|
|
2503
|
+
asyncTransform: function asyncTransform1() {
|
|
2080
2504
|
return asyncTransform;
|
|
2081
2505
|
},
|
|
2082
|
-
createAsyncTransform: function() {
|
|
2506
|
+
createAsyncTransform: function createAsyncTransform1() {
|
|
2083
2507
|
return createAsyncTransform;
|
|
2084
2508
|
}
|
|
2085
2509
|
});
|
|
@@ -2604,7 +3028,7 @@ var AsyncNodePlugin = function() {
|
|
|
2604
3028
|
}
|
|
2605
3029
|
return pairs;
|
|
2606
3030
|
}
|
|
2607
|
-
var createSortedArray = function() {
|
|
3031
|
+
var createSortedArray = function createSortedArray() {
|
|
2608
3032
|
return new import_sorted_array.default([], function(c) {
|
|
2609
3033
|
return c.matcher.count;
|
|
2610
3034
|
});
|
|
@@ -2700,38 +3124,38 @@ var AsyncNodePlugin = function() {
|
|
|
2700
3124
|
}();
|
|
2701
3125
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/node_modules/.aspect_rules_js/@player-ui+player@0.0.0/node_modules/@player-ui/player/dist/index.mjs
|
|
2702
3126
|
var __defProp2 = Object.defineProperty;
|
|
2703
|
-
var __export2 = function(target, all) {
|
|
3127
|
+
var __export2 = function __export2(target, all) {
|
|
2704
3128
|
for(var name in all)__defProp2(target, name, {
|
|
2705
3129
|
get: all[name],
|
|
2706
3130
|
enumerable: true
|
|
2707
3131
|
});
|
|
2708
3132
|
};
|
|
2709
|
-
var toValue = function(value) {
|
|
3133
|
+
var toValue = function toValue(value) {
|
|
2710
3134
|
return {
|
|
2711
3135
|
name: "Value",
|
|
2712
3136
|
value: value
|
|
2713
3137
|
};
|
|
2714
3138
|
};
|
|
2715
|
-
var toExpression = function(value) {
|
|
3139
|
+
var toExpression = function toExpression(value) {
|
|
2716
3140
|
return {
|
|
2717
3141
|
name: "Expression",
|
|
2718
3142
|
value: value
|
|
2719
3143
|
};
|
|
2720
3144
|
};
|
|
2721
|
-
var toPath = function(path) {
|
|
3145
|
+
var toPath = function toPath(path) {
|
|
2722
3146
|
return {
|
|
2723
3147
|
name: "PathNode",
|
|
2724
3148
|
path: path
|
|
2725
3149
|
};
|
|
2726
3150
|
};
|
|
2727
|
-
var toQuery = function(key, value) {
|
|
3151
|
+
var toQuery = function toQuery(key, value) {
|
|
2728
3152
|
return {
|
|
2729
3153
|
name: "Query",
|
|
2730
3154
|
key: key,
|
|
2731
3155
|
value: value
|
|
2732
3156
|
};
|
|
2733
3157
|
};
|
|
2734
|
-
var toConcatenatedNode = function(values) {
|
|
3158
|
+
var toConcatenatedNode = function toConcatenatedNode(values) {
|
|
2735
3159
|
if (values.length === 1) {
|
|
2736
3160
|
return values[0];
|
|
2737
3161
|
}
|
|
@@ -2749,7 +3173,7 @@ var AsyncNodePlugin = function() {
|
|
|
2749
3173
|
var SINGLE_QUOTE = "'";
|
|
2750
3174
|
var DOUBLE_QUOTE = '"';
|
|
2751
3175
|
var BACK_TICK = "`";
|
|
2752
|
-
var isIdentifierChar = function(char) {
|
|
3176
|
+
var isIdentifierChar = function isIdentifierChar(char) {
|
|
2753
3177
|
if (!char) {
|
|
2754
3178
|
return false;
|
|
2755
3179
|
}
|
|
@@ -2769,10 +3193,10 @@ var AsyncNodePlugin = function() {
|
|
|
2769
3193
|
charCode === 125;
|
|
2770
3194
|
return !matches;
|
|
2771
3195
|
};
|
|
2772
|
-
var parse = function(path) {
|
|
3196
|
+
var parse = function parse(path) {
|
|
2773
3197
|
var index = 1;
|
|
2774
3198
|
var ch = path.charAt(0);
|
|
2775
|
-
var next = function(expected) {
|
|
3199
|
+
var next = function next(expected) {
|
|
2776
3200
|
if (expected && ch !== expected) {
|
|
2777
3201
|
throw new Error("Expected char: ".concat(expected, " but got: ").concat(ch));
|
|
2778
3202
|
}
|
|
@@ -2780,12 +3204,12 @@ var AsyncNodePlugin = function() {
|
|
|
2780
3204
|
index += 1;
|
|
2781
3205
|
return ch;
|
|
2782
3206
|
};
|
|
2783
|
-
var whitespace = function() {
|
|
3207
|
+
var whitespace = function whitespace() {
|
|
2784
3208
|
while(ch === " "){
|
|
2785
3209
|
next();
|
|
2786
3210
|
}
|
|
2787
3211
|
};
|
|
2788
|
-
var identifier = function() {
|
|
3212
|
+
var identifier = function identifier() {
|
|
2789
3213
|
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2790
3214
|
if (!isIdentifierChar(ch)) {
|
|
2791
3215
|
return;
|
|
@@ -2811,7 +3235,7 @@ var AsyncNodePlugin = function() {
|
|
|
2811
3235
|
return toValue(value);
|
|
2812
3236
|
}
|
|
2813
3237
|
};
|
|
2814
|
-
var expression = function() {
|
|
3238
|
+
var expression = function expression() {
|
|
2815
3239
|
if (ch === BACK_TICK) {
|
|
2816
3240
|
next(BACK_TICK);
|
|
2817
3241
|
var exp = ch;
|
|
@@ -2827,7 +3251,7 @@ var AsyncNodePlugin = function() {
|
|
|
2827
3251
|
}
|
|
2828
3252
|
}
|
|
2829
3253
|
};
|
|
2830
|
-
var regex = function(match) {
|
|
3254
|
+
var regex = function regex(match) {
|
|
2831
3255
|
if (!(ch === null || ch === void 0 ? void 0 : ch.match(match))) {
|
|
2832
3256
|
return;
|
|
2833
3257
|
}
|
|
@@ -2842,7 +3266,7 @@ var AsyncNodePlugin = function() {
|
|
|
2842
3266
|
return toValue(value);
|
|
2843
3267
|
}
|
|
2844
3268
|
};
|
|
2845
|
-
var nestedPath = function() {
|
|
3269
|
+
var nestedPath = function nestedPath() {
|
|
2846
3270
|
if (ch === OPEN_CURL) {
|
|
2847
3271
|
next(OPEN_CURL);
|
|
2848
3272
|
next(OPEN_CURL);
|
|
@@ -2852,12 +3276,12 @@ var AsyncNodePlugin = function() {
|
|
|
2852
3276
|
return modelRef;
|
|
2853
3277
|
}
|
|
2854
3278
|
};
|
|
2855
|
-
var simpleSegment = function() {
|
|
3279
|
+
var simpleSegment = function simpleSegment() {
|
|
2856
3280
|
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2857
|
-
var
|
|
3281
|
+
var _ref, _nestedPath;
|
|
2858
3282
|
return (_ref = (_nestedPath = nestedPath()) !== null && _nestedPath !== void 0 ? _nestedPath : expression()) !== null && _ref !== void 0 ? _ref : identifier(allowBoolValue);
|
|
2859
3283
|
};
|
|
2860
|
-
var segment = function() {
|
|
3284
|
+
var segment = function segment() {
|
|
2861
3285
|
var segments = [];
|
|
2862
3286
|
var nextSegment = simpleSegment();
|
|
2863
3287
|
while(nextSegment !== void 0){
|
|
@@ -2869,7 +3293,7 @@ var AsyncNodePlugin = function() {
|
|
|
2869
3293
|
}
|
|
2870
3294
|
return toConcatenatedNode(segments);
|
|
2871
3295
|
};
|
|
2872
|
-
var optionallyQuotedSegment = function() {
|
|
3296
|
+
var optionallyQuotedSegment = function optionallyQuotedSegment() {
|
|
2873
3297
|
var allowBoolValue = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
|
|
2874
3298
|
whitespace();
|
|
2875
3299
|
if (ch === SINGLE_QUOTE || ch === DOUBLE_QUOTE) {
|
|
@@ -2881,7 +3305,7 @@ var AsyncNodePlugin = function() {
|
|
|
2881
3305
|
}
|
|
2882
3306
|
return simpleSegment(allowBoolValue);
|
|
2883
3307
|
};
|
|
2884
|
-
var equals = function() {
|
|
3308
|
+
var equals = function equals() {
|
|
2885
3309
|
if (ch !== EQUALS) {
|
|
2886
3310
|
return false;
|
|
2887
3311
|
}
|
|
@@ -2890,7 +3314,7 @@ var AsyncNodePlugin = function() {
|
|
|
2890
3314
|
}
|
|
2891
3315
|
return true;
|
|
2892
3316
|
};
|
|
2893
|
-
var parseBracket = function() {
|
|
3317
|
+
var parseBracket = function parseBracket() {
|
|
2894
3318
|
if (ch === OPEN_BRACKET) {
|
|
2895
3319
|
next(OPEN_BRACKET);
|
|
2896
3320
|
whitespace();
|
|
@@ -2912,7 +3336,7 @@ var AsyncNodePlugin = function() {
|
|
|
2912
3336
|
return value;
|
|
2913
3337
|
}
|
|
2914
3338
|
};
|
|
2915
|
-
var parseSegmentAndBrackets = function() {
|
|
3339
|
+
var parseSegmentAndBrackets = function parseSegmentAndBrackets() {
|
|
2916
3340
|
var parsed = [];
|
|
2917
3341
|
var firstSegment = segment();
|
|
2918
3342
|
if (firstSegment) {
|
|
@@ -2929,7 +3353,7 @@ var AsyncNodePlugin = function() {
|
|
|
2929
3353
|
}
|
|
2930
3354
|
return parsed;
|
|
2931
3355
|
};
|
|
2932
|
-
var parsePath = function() {
|
|
3356
|
+
var parsePath = function parsePath() {
|
|
2933
3357
|
var parts = [];
|
|
2934
3358
|
var nextSegment = parseSegmentAndBrackets();
|
|
2935
3359
|
while(nextSegment !== void 0){
|
|
@@ -3040,6 +3464,7 @@ var AsyncNodePlugin = function() {
|
|
|
3040
3464
|
return _BindingInstance;
|
|
3041
3465
|
}();
|
|
3042
3466
|
function resolveBindingAST(bindingPathNode, options, hooks) {
|
|
3467
|
+
var _context_updates;
|
|
3043
3468
|
var context = {
|
|
3044
3469
|
updates: {},
|
|
3045
3470
|
path: []
|
|
@@ -3079,8 +3504,8 @@ var AsyncNodePlugin = function() {
|
|
|
3079
3504
|
}
|
|
3080
3505
|
}
|
|
3081
3506
|
function resolveNode(_node) {
|
|
3082
|
-
var
|
|
3083
|
-
var resolvedNode = (
|
|
3507
|
+
var _ref;
|
|
3508
|
+
var resolvedNode = (_ref = hooks === null || hooks === void 0 ? void 0 : hooks.beforeResolveNode.call(_node, _object_spread({}, context, options))) !== null && _ref !== void 0 ? _ref : _node;
|
|
3084
3509
|
switch(resolvedNode.name){
|
|
3085
3510
|
case "Expression":
|
|
3086
3511
|
case "PathNode":
|
|
@@ -3116,7 +3541,6 @@ var AsyncNodePlugin = function() {
|
|
|
3116
3541
|
}
|
|
3117
3542
|
}
|
|
3118
3543
|
bindingPathNode.path.forEach(resolveNode);
|
|
3119
|
-
var _context_updates;
|
|
3120
3544
|
return {
|
|
3121
3545
|
path: context.path,
|
|
3122
3546
|
updates: Object.keys((_context_updates = context.updates) !== null && _context_updates !== void 0 ? _context_updates : {}).length > 0 ? context.updates : void 0
|
|
@@ -3125,13 +3549,13 @@ var AsyncNodePlugin = function() {
|
|
|
3125
3549
|
var BINDING_BRACKETS_REGEX = /[\s()*=`{}'"[\]]/;
|
|
3126
3550
|
var LAZY_BINDING_REGEX = /^[^.]+(\..+)*$/;
|
|
3127
3551
|
var DEFAULT_OPTIONS = {
|
|
3128
|
-
get: function() {
|
|
3552
|
+
get: function get() {
|
|
3129
3553
|
throw new Error("Not Implemented");
|
|
3130
3554
|
},
|
|
3131
|
-
set: function() {
|
|
3555
|
+
set: function set() {
|
|
3132
3556
|
throw new Error("Not Implemented");
|
|
3133
3557
|
},
|
|
3134
|
-
evaluate: function() {
|
|
3558
|
+
evaluate: function evaluate() {
|
|
3135
3559
|
throw new Error("Not Implemented");
|
|
3136
3560
|
}
|
|
3137
3561
|
};
|
|
@@ -3154,18 +3578,18 @@ var AsyncNodePlugin = function() {
|
|
|
3154
3578
|
* representation of that path.
|
|
3155
3579
|
*/ key: "normalizePath",
|
|
3156
3580
|
value: function normalizePath(path, resolveOptions) {
|
|
3581
|
+
var _this_parseCache_path;
|
|
3157
3582
|
if (!BINDING_BRACKETS_REGEX.test(path) && LAZY_BINDING_REGEX.test(path) && this.hooks.skipOptimization.call(path) !== true) {
|
|
3158
3583
|
return {
|
|
3159
3584
|
path: path.split("."),
|
|
3160
3585
|
updates: void 0
|
|
3161
3586
|
};
|
|
3162
3587
|
}
|
|
3163
|
-
var _this_parseCache_path;
|
|
3164
3588
|
var ast = (_this_parseCache_path = this.parseCache[path]) !== null && _this_parseCache_path !== void 0 ? _this_parseCache_path : parse(path);
|
|
3165
3589
|
this.parseCache[path] = ast;
|
|
3166
3590
|
if ((typeof ast === "undefined" ? "undefined" : _type_of(ast)) !== "object" || !(ast === null || ast === void 0 ? void 0 : ast.status)) {
|
|
3167
|
-
var
|
|
3168
|
-
throw new TypeError('Cannot normalize path "'.concat(path, '": ').concat((
|
|
3591
|
+
var _ref;
|
|
3592
|
+
throw new TypeError('Cannot normalize path "'.concat(path, '": ').concat((_ref = ast === null || ast === void 0 ? void 0 : ast.error) !== null && _ref !== void 0 ? _ref : "Unknown Error."));
|
|
3169
3593
|
}
|
|
3170
3594
|
try {
|
|
3171
3595
|
return resolveBindingAST(ast.path, resolveOptions, this.hooks);
|
|
@@ -3198,14 +3622,14 @@ var AsyncNodePlugin = function() {
|
|
|
3198
3622
|
var updates = {};
|
|
3199
3623
|
var joined = Array.isArray(rawBinding) ? rawBinding.join(".") : String(rawBinding);
|
|
3200
3624
|
var normalizeConfig = {
|
|
3201
|
-
getValue: function(path) {
|
|
3625
|
+
getValue: function getValue(path) {
|
|
3202
3626
|
var normalized2 = _this.normalizePath(path.join("."), normalizeConfig);
|
|
3203
3627
|
return options.get(_this.getBindingForNormalizedResult(normalized2));
|
|
3204
3628
|
},
|
|
3205
|
-
evaluate: function(exp) {
|
|
3629
|
+
evaluate: function evaluate(exp) {
|
|
3206
3630
|
return options.evaluate(exp);
|
|
3207
3631
|
},
|
|
3208
|
-
convertToPath: function(path) {
|
|
3632
|
+
convertToPath: function convertToPath(path) {
|
|
3209
3633
|
if (path === void 0) {
|
|
3210
3634
|
throw new Error("Attempted to convert undefined value to binding path");
|
|
3211
3635
|
}
|
|
@@ -3270,9 +3694,9 @@ var AsyncNodePlugin = function() {
|
|
|
3270
3694
|
/** Grab all of the bindings that this depended on */ key: "getDependencies",
|
|
3271
3695
|
value: function getDependencies(name) {
|
|
3272
3696
|
if (name !== void 0) {
|
|
3697
|
+
var _ref;
|
|
3273
3698
|
var _this_namedDependencySets_name, _this_namedDependencySets;
|
|
3274
|
-
|
|
3275
|
-
return (_this_namedDependencySets_name_readDeps = (_this_namedDependencySets = this.namedDependencySets) === null || _this_namedDependencySets === void 0 ? void 0 : (_this_namedDependencySets_name = _this_namedDependencySets[name]) === null || _this_namedDependencySets_name === void 0 ? void 0 : _this_namedDependencySets_name.readDeps) !== null && _this_namedDependencySets_name_readDeps !== void 0 ? _this_namedDependencySets_name_readDeps : /* @__PURE__ */ new Set();
|
|
3699
|
+
return (_ref = (_this_namedDependencySets = this.namedDependencySets) === null || _this_namedDependencySets === void 0 ? void 0 : (_this_namedDependencySets_name = _this_namedDependencySets[name]) === null || _this_namedDependencySets_name === void 0 ? void 0 : _this_namedDependencySets_name.readDeps) !== null && _ref !== void 0 ? _ref : /* @__PURE__ */ new Set();
|
|
3276
3700
|
}
|
|
3277
3701
|
return this.readDeps;
|
|
3278
3702
|
}
|
|
@@ -3294,9 +3718,9 @@ var AsyncNodePlugin = function() {
|
|
|
3294
3718
|
/** Grab all of the bindings this wrote to */ key: "getModified",
|
|
3295
3719
|
value: function getModified(name) {
|
|
3296
3720
|
if (name !== void 0) {
|
|
3721
|
+
var _ref;
|
|
3297
3722
|
var _this_namedDependencySets_name, _this_namedDependencySets;
|
|
3298
|
-
|
|
3299
|
-
return (_this_namedDependencySets_name_writeDeps = (_this_namedDependencySets = this.namedDependencySets) === null || _this_namedDependencySets === void 0 ? void 0 : (_this_namedDependencySets_name = _this_namedDependencySets[name]) === null || _this_namedDependencySets_name === void 0 ? void 0 : _this_namedDependencySets_name.writeDeps) !== null && _this_namedDependencySets_name_writeDeps !== void 0 ? _this_namedDependencySets_name_writeDeps : /* @__PURE__ */ new Set();
|
|
3723
|
+
return (_ref = (_this_namedDependencySets = this.namedDependencySets) === null || _this_namedDependencySets === void 0 ? void 0 : (_this_namedDependencySets_name = _this_namedDependencySets[name]) === null || _this_namedDependencySets_name === void 0 ? void 0 : _this_namedDependencySets_name.writeDeps) !== null && _ref !== void 0 ? _ref : /* @__PURE__ */ new Set();
|
|
3300
3724
|
}
|
|
3301
3725
|
return this.writeDeps;
|
|
3302
3726
|
}
|
|
@@ -3618,19 +4042,19 @@ var AsyncNodePlugin = function() {
|
|
|
3618
4042
|
var thisStr = "this";
|
|
3619
4043
|
var evaluator_functions_exports = {};
|
|
3620
4044
|
__export2(evaluator_functions_exports, {
|
|
3621
|
-
conditional: function() {
|
|
4045
|
+
conditional: function conditional1() {
|
|
3622
4046
|
return conditional;
|
|
3623
4047
|
},
|
|
3624
|
-
deleteDataVal: function() {
|
|
4048
|
+
deleteDataVal: function deleteDataVal1() {
|
|
3625
4049
|
return deleteDataVal;
|
|
3626
4050
|
},
|
|
3627
|
-
getDataVal: function() {
|
|
4051
|
+
getDataVal: function getDataVal1() {
|
|
3628
4052
|
return getDataVal;
|
|
3629
4053
|
},
|
|
3630
|
-
setDataVal: function() {
|
|
4054
|
+
setDataVal: function setDataVal1() {
|
|
3631
4055
|
return setDataVal;
|
|
3632
4056
|
},
|
|
3633
|
-
waitFor: function() {
|
|
4057
|
+
waitFor: function waitFor1() {
|
|
3634
4058
|
return waitFor;
|
|
3635
4059
|
}
|
|
3636
4060
|
});
|
|
@@ -3642,7 +4066,7 @@ var AsyncNodePlugin = function() {
|
|
|
3642
4066
|
};
|
|
3643
4067
|
return promise;
|
|
3644
4068
|
}
|
|
3645
|
-
var setDataVal = function(_context, binding, value) {
|
|
4069
|
+
var setDataVal = function setDataVal(_context, binding, value) {
|
|
3646
4070
|
_context.model.set([
|
|
3647
4071
|
[
|
|
3648
4072
|
binding,
|
|
@@ -3650,13 +4074,13 @@ var AsyncNodePlugin = function() {
|
|
|
3650
4074
|
]
|
|
3651
4075
|
]);
|
|
3652
4076
|
};
|
|
3653
|
-
var getDataVal = function(_context, binding) {
|
|
4077
|
+
var getDataVal = function getDataVal(_context, binding) {
|
|
3654
4078
|
return _context.model.get(binding);
|
|
3655
4079
|
};
|
|
3656
|
-
var deleteDataVal = function(_context, binding) {
|
|
4080
|
+
var deleteDataVal = function deleteDataVal(_context, binding) {
|
|
3657
4081
|
return _context.model.delete(binding);
|
|
3658
4082
|
};
|
|
3659
|
-
var conditional = function(ctx, condition, ifTrue, ifFalse) {
|
|
4083
|
+
var conditional = function conditional(ctx, condition, ifTrue, ifFalse) {
|
|
3660
4084
|
var testResult = ctx.evaluate(condition);
|
|
3661
4085
|
if (isAwaitable(testResult)) {
|
|
3662
4086
|
return testResult.awaitableThen(function(resolvedTest) {
|
|
@@ -3678,14 +4102,14 @@ var AsyncNodePlugin = function() {
|
|
|
3678
4102
|
return null;
|
|
3679
4103
|
};
|
|
3680
4104
|
conditional.resolveParams = false;
|
|
3681
|
-
var waitFor = function(ctx, promise) {
|
|
4105
|
+
var waitFor = function waitFor(ctx, promise) {
|
|
3682
4106
|
return makeAwaitable(promise);
|
|
3683
4107
|
};
|
|
3684
|
-
var andandOperator = function(ctx, a, b, async) {
|
|
4108
|
+
var andandOperator = function andandOperator(ctx, a, b, async) {
|
|
3685
4109
|
return LogicalOperators.and(ctx, a, b, async);
|
|
3686
4110
|
};
|
|
3687
4111
|
andandOperator.resolveParams = false;
|
|
3688
|
-
var ororOperator = function(ctx, a, b, async) {
|
|
4112
|
+
var ororOperator = function ororOperator(ctx, a, b, async) {
|
|
3689
4113
|
return LogicalOperators.or(ctx, a, b, async);
|
|
3690
4114
|
};
|
|
3691
4115
|
ororOperator.resolveParams = false;
|
|
@@ -3811,7 +4235,7 @@ var AsyncNodePlugin = function() {
|
|
|
3811
4235
|
}
|
|
3812
4236
|
};
|
|
3813
4237
|
var LogicalOperators = {
|
|
3814
|
-
and: function(ctx, leftNode, rightNode, async) {
|
|
4238
|
+
and: function and(ctx, leftNode, rightNode, async) {
|
|
3815
4239
|
var leftResult = ctx.evaluate(leftNode);
|
|
3816
4240
|
if (async && isAwaitable(leftResult)) {
|
|
3817
4241
|
return leftResult.awaitableThen(function(awaitedLeft) {
|
|
@@ -3822,7 +4246,7 @@ var AsyncNodePlugin = function() {
|
|
|
3822
4246
|
}
|
|
3823
4247
|
return leftResult && ctx.evaluate(rightNode);
|
|
3824
4248
|
},
|
|
3825
|
-
or: function(ctx, leftNode, rightNode, async) {
|
|
4249
|
+
or: function or(ctx, leftNode, rightNode, async) {
|
|
3826
4250
|
var leftResult = ctx.evaluate(leftNode);
|
|
3827
4251
|
if (async && isAwaitable(leftResult)) {
|
|
3828
4252
|
return leftResult.awaitableThen(function(awaitedLeft) {
|
|
@@ -3860,10 +4284,10 @@ var AsyncNodePlugin = function() {
|
|
|
3860
4284
|
]))
|
|
3861
4285
|
};
|
|
3862
4286
|
this.defaultHookOptions = _object_spread_props(_object_spread({}, defaultOptions), {
|
|
3863
|
-
evaluate: function(expr) {
|
|
4287
|
+
evaluate: function evaluate(expr) {
|
|
3864
4288
|
return _this.evaluate(expr, _this.defaultHookOptions);
|
|
3865
4289
|
},
|
|
3866
|
-
resolveNode: function(node) {
|
|
4290
|
+
resolveNode: function resolveNode(node) {
|
|
3867
4291
|
return _this._execAST(node, _this.defaultHookOptions);
|
|
3868
4292
|
}
|
|
3869
4293
|
});
|
|
@@ -3883,12 +4307,12 @@ var AsyncNodePlugin = function() {
|
|
|
3883
4307
|
key: "evaluate",
|
|
3884
4308
|
value: function evaluate(expr, options) {
|
|
3885
4309
|
var _this = this;
|
|
4310
|
+
var _this_hooks_beforeEvaluate_call;
|
|
3886
4311
|
var resolvedOpts = this.hooks.resolveOptions.call(_object_spread_props(_object_spread({}, this.defaultHookOptions, options), {
|
|
3887
|
-
resolveNode: function(node) {
|
|
4312
|
+
resolveNode: function resolveNode(node) {
|
|
3888
4313
|
return _this._execAST(node, resolvedOpts);
|
|
3889
4314
|
}
|
|
3890
4315
|
}));
|
|
3891
|
-
var _this_hooks_beforeEvaluate_call;
|
|
3892
4316
|
var expression = (_this_hooks_beforeEvaluate_call = this.hooks.beforeEvaluate.call(expr, resolvedOpts)) !== null && _this_hooks_beforeEvaluate_call !== void 0 ? _this_hooks_beforeEvaluate_call : expr;
|
|
3893
4317
|
while(isObjectExpression(expression)){
|
|
3894
4318
|
expression = expression.value;
|
|
@@ -4012,11 +4436,11 @@ var AsyncNodePlugin = function() {
|
|
|
4012
4436
|
key: "_resolveNode",
|
|
4013
4437
|
value: function _resolveNode(_currentValue, node, options) {
|
|
4014
4438
|
var _this = this;
|
|
4015
|
-
var resolveNode = options.resolveNode, model = options.model;
|
|
4016
4439
|
var _options_async;
|
|
4440
|
+
var resolveNode = options.resolveNode, model = options.model;
|
|
4017
4441
|
var isAsync = (_options_async = options.async) !== null && _options_async !== void 0 ? _options_async : false;
|
|
4018
4442
|
var expressionContext = _object_spread_props(_object_spread({}, options), {
|
|
4019
|
-
evaluate: function(expr) {
|
|
4443
|
+
evaluate: function evaluate(expr) {
|
|
4020
4444
|
return _this.evaluate(expr, options);
|
|
4021
4445
|
}
|
|
4022
4446
|
});
|
|
@@ -4350,7 +4774,7 @@ var AsyncNodePlugin = function() {
|
|
|
4350
4774
|
]);
|
|
4351
4775
|
return ProxyLogger;
|
|
4352
4776
|
}();
|
|
4353
|
-
var identify = function(val) {
|
|
4777
|
+
var identify = function identify(val) {
|
|
4354
4778
|
return val;
|
|
4355
4779
|
};
|
|
4356
4780
|
var SchemaController = /*#__PURE__*/ function() {
|
|
@@ -4438,6 +4862,7 @@ var AsyncNodePlugin = function() {
|
|
|
4438
4862
|
{
|
|
4439
4863
|
key: "getApparentType",
|
|
4440
4864
|
value: function getApparentType(binding) {
|
|
4865
|
+
var _schemaType_validation, _baseType_validation;
|
|
4441
4866
|
var schemaType = this.getType(binding);
|
|
4442
4867
|
if (schemaType === void 0) {
|
|
4443
4868
|
return void 0;
|
|
@@ -4446,7 +4871,6 @@ var AsyncNodePlugin = function() {
|
|
|
4446
4871
|
if (baseType === void 0) {
|
|
4447
4872
|
return schemaType;
|
|
4448
4873
|
}
|
|
4449
|
-
var _schemaType_validation, _baseType_validation;
|
|
4450
4874
|
return _object_spread_props(_object_spread({}, baseType, schemaType), {
|
|
4451
4875
|
validation: _to_consumable_array((_schemaType_validation = schemaType.validation) !== null && _schemaType_validation !== void 0 ? _schemaType_validation : []).concat(_to_consumable_array((_baseType_validation = baseType.validation) !== null && _baseType_validation !== void 0 ? _baseType_validation : []))
|
|
4452
4876
|
});
|
|
@@ -4595,10 +5019,10 @@ var AsyncNodePlugin = function() {
|
|
|
4595
5019
|
{
|
|
4596
5020
|
key: "get",
|
|
4597
5021
|
value: function get(binding, options, next) {
|
|
5022
|
+
var _ref;
|
|
4598
5023
|
var _this_shouldIncludeInvalid, _this;
|
|
4599
5024
|
var val = next === null || next === void 0 ? void 0 : next.get(binding, options);
|
|
4600
|
-
|
|
4601
|
-
if ((_this_shouldIncludeInvalid1 = (_this_shouldIncludeInvalid = (_this = this).shouldIncludeInvalid) === null || _this_shouldIncludeInvalid === void 0 ? void 0 : _this_shouldIncludeInvalid.call(_this, options)) !== null && _this_shouldIncludeInvalid1 !== void 0 ? _this_shouldIncludeInvalid1 : (options === null || options === void 0 ? void 0 : options.includeInvalid) === true) {
|
|
5025
|
+
if ((_ref = (_this_shouldIncludeInvalid = (_this = this).shouldIncludeInvalid) === null || _this_shouldIncludeInvalid === void 0 ? void 0 : _this_shouldIncludeInvalid.call(_this, options)) !== null && _ref !== void 0 ? _ref : (options === null || options === void 0 ? void 0 : options.includeInvalid) === true) {
|
|
4602
5026
|
this.shadowModelPaths.forEach(function(shadowValue, shadowBinding) {
|
|
4603
5027
|
if (shadowBinding === binding) {
|
|
4604
5028
|
val = shadowValue;
|
|
@@ -4696,11 +5120,12 @@ var AsyncNodePlugin = function() {
|
|
|
4696
5120
|
templateDepth: 0
|
|
4697
5121
|
};
|
|
4698
5122
|
var _this = this;
|
|
5123
|
+
var _this_hooks_onCreateASTNode_call;
|
|
4699
5124
|
var parsedNode = this.hooks.parseNode.call(obj, type, options);
|
|
4700
5125
|
if (parsedNode || parsedNode === null) {
|
|
4701
5126
|
return parsedNode;
|
|
4702
5127
|
}
|
|
4703
|
-
var parseLocalObject = function(currentValue, objToParse) {
|
|
5128
|
+
var parseLocalObject = function parseLocalObject1(currentValue, objToParse) {
|
|
4704
5129
|
var path = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
|
|
4705
5130
|
if ((typeof objToParse === "undefined" ? "undefined" : _type_of(objToParse)) !== "object" || objToParse === null) {
|
|
4706
5131
|
return {
|
|
@@ -4770,30 +5195,29 @@ var AsyncNodePlugin = function() {
|
|
|
4770
5195
|
child.value.parent = parent;
|
|
4771
5196
|
});
|
|
4772
5197
|
}
|
|
4773
|
-
var _this_hooks_onCreateASTNode_call;
|
|
4774
5198
|
return (_this_hooks_onCreateASTNode_call = this.hooks.onCreateASTNode.call(baseAst, obj)) !== null && _this_hooks_onCreateASTNode_call !== void 0 ? _this_hooks_onCreateASTNode_call : null;
|
|
4775
5199
|
}
|
|
4776
5200
|
}
|
|
4777
5201
|
]);
|
|
4778
5202
|
return Parser;
|
|
4779
5203
|
}();
|
|
4780
|
-
var withContext = function(model) {
|
|
5204
|
+
var withContext = function withContext(model) {
|
|
4781
5205
|
return {
|
|
4782
|
-
get: function(binding, options) {
|
|
5206
|
+
get: function get(binding, options) {
|
|
4783
5207
|
return model.get(binding, _object_spread({
|
|
4784
5208
|
context: {
|
|
4785
5209
|
model: model
|
|
4786
5210
|
}
|
|
4787
5211
|
}, options));
|
|
4788
5212
|
},
|
|
4789
|
-
set: function(transaction, options) {
|
|
5213
|
+
set: function set(transaction, options) {
|
|
4790
5214
|
return model.set(transaction, _object_spread({
|
|
4791
5215
|
context: {
|
|
4792
5216
|
model: model
|
|
4793
5217
|
}
|
|
4794
5218
|
}, options));
|
|
4795
5219
|
},
|
|
4796
|
-
delete: function(binding, options) {
|
|
5220
|
+
delete: function _delete(binding, options) {
|
|
4797
5221
|
return model.delete(binding, _object_spread({
|
|
4798
5222
|
context: {
|
|
4799
5223
|
model: model
|
|
@@ -4832,16 +5256,16 @@ var AsyncNodePlugin = function() {
|
|
|
4832
5256
|
{
|
|
4833
5257
|
key: "update",
|
|
4834
5258
|
value: function update(dataChanges, nodeChanges) {
|
|
5259
|
+
var _ref;
|
|
4835
5260
|
this.hooks.beforeUpdate.call(dataChanges);
|
|
4836
5261
|
var resolveCache = /* @__PURE__ */ new Map();
|
|
4837
5262
|
this.idCache.clear();
|
|
4838
5263
|
var prevASTMap = new Map(this.ASTMap);
|
|
4839
5264
|
this.ASTMap.clear();
|
|
4840
5265
|
var realNodeChanges = /* @__PURE__ */ new Set();
|
|
4841
|
-
var _nodeChanges_values;
|
|
4842
5266
|
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4843
5267
|
try {
|
|
4844
|
-
for(var _iterator = ((
|
|
5268
|
+
for(var _iterator = ((_ref = nodeChanges === null || nodeChanges === void 0 ? void 0 : nodeChanges.values()) !== null && _ref !== void 0 ? _ref : [])[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4845
5269
|
var node = _step.value;
|
|
4846
5270
|
var current = node;
|
|
4847
5271
|
while(current){
|
|
@@ -4924,6 +5348,7 @@ var AsyncNodePlugin = function() {
|
|
|
4924
5348
|
key: "computeTree",
|
|
4925
5349
|
value: function computeTree(node, rawParent, dataChanges, cacheUpdate, options, partiallyResolvedParent, prevASTMap, nodeChanges) {
|
|
4926
5350
|
var _this = this;
|
|
5351
|
+
var _this_hooks_beforeResolve_call;
|
|
4927
5352
|
var dependencyModel = new DependencyModel(options.data.model);
|
|
4928
5353
|
dependencyModel.trackSubset("core");
|
|
4929
5354
|
var depModelWithParser = withContext(withParser(dependencyModel, this.options.parseBinding));
|
|
@@ -4931,7 +5356,7 @@ var AsyncNodePlugin = function() {
|
|
|
4931
5356
|
data: _object_spread_props(_object_spread({}, options.data), {
|
|
4932
5357
|
model: depModelWithParser
|
|
4933
5358
|
}),
|
|
4934
|
-
evaluate: function(exp) {
|
|
5359
|
+
evaluate: function evaluate(exp) {
|
|
4935
5360
|
return _this.options.evaluator.evaluate(exp, {
|
|
4936
5361
|
model: depModelWithParser
|
|
4937
5362
|
});
|
|
@@ -4947,14 +5372,14 @@ var AsyncNodePlugin = function() {
|
|
|
4947
5372
|
var update2 = _object_spread_props(_object_spread({}, previousResult), {
|
|
4948
5373
|
updated: false
|
|
4949
5374
|
});
|
|
4950
|
-
var repopulateASTMapFromCache = function(resolvedNode, AST, ASTParent) {
|
|
5375
|
+
var repopulateASTMapFromCache = function repopulateASTMapFromCache1(resolvedNode, AST, ASTParent) {
|
|
4951
5376
|
var resolvedASTLocal = resolvedNode.node;
|
|
4952
5377
|
_this.ASTMap.set(resolvedASTLocal, AST);
|
|
4953
5378
|
var resolvedUpdate = _object_spread_props(_object_spread({}, resolvedNode), {
|
|
4954
5379
|
updated: false
|
|
4955
5380
|
});
|
|
4956
5381
|
cacheUpdate.set(AST, resolvedUpdate);
|
|
4957
|
-
var handleChildNode = function(childNode) {
|
|
5382
|
+
var handleChildNode = function handleChildNode(childNode) {
|
|
4958
5383
|
var _prevASTMap_get;
|
|
4959
5384
|
var originalChildNode = (_prevASTMap_get = prevASTMap.get(childNode)) !== null && _prevASTMap_get !== void 0 ? _prevASTMap_get : childNode;
|
|
4960
5385
|
var previousChildResult = _this.getPreviousResult(originalChildNode);
|
|
@@ -4979,7 +5404,6 @@ var AsyncNodePlugin = function() {
|
|
|
4979
5404
|
var clonedNode = _object_spread_props(_object_spread({}, this.cloneNode(node)), {
|
|
4980
5405
|
parent: partiallyResolvedParent
|
|
4981
5406
|
});
|
|
4982
|
-
var _this_hooks_beforeResolve_call;
|
|
4983
5407
|
var resolvedAST = (_this_hooks_beforeResolve_call = this.hooks.beforeResolve.call(clonedNode, resolveOptions)) !== null && _this_hooks_beforeResolve_call !== void 0 ? _this_hooks_beforeResolve_call : {
|
|
4984
5408
|
type: "empty"
|
|
4985
5409
|
};
|
|
@@ -5039,7 +5463,7 @@ var AsyncNodePlugin = function() {
|
|
|
5039
5463
|
resolved = previousResult === null || previousResult === void 0 ? void 0 : previousResult.value;
|
|
5040
5464
|
}
|
|
5041
5465
|
resolved = this.hooks.afterResolve.call(resolved, resolvedAST, _object_spread_props(_object_spread({}, resolveOptions), {
|
|
5042
|
-
getDependencies: function(scope) {
|
|
5466
|
+
getDependencies: function getDependencies(scope) {
|
|
5043
5467
|
return dependencyModel.getDependencies(scope);
|
|
5044
5468
|
}
|
|
5045
5469
|
}));
|
|
@@ -5477,7 +5901,7 @@ var AsyncNodePlugin = function() {
|
|
|
5477
5901
|
]);
|
|
5478
5902
|
return TemplatePlugin;
|
|
5479
5903
|
}();
|
|
5480
|
-
var createPatternMatcher = function(start, end) {
|
|
5904
|
+
var createPatternMatcher = function createPatternMatcher(start, end) {
|
|
5481
5905
|
return function(testStr) {
|
|
5482
5906
|
var startLocation = testStr.indexOf(start);
|
|
5483
5907
|
if (startLocation === -1) {
|
|
@@ -5517,18 +5941,18 @@ var AsyncNodePlugin = function() {
|
|
|
5517
5941
|
});
|
|
5518
5942
|
return newNode;
|
|
5519
5943
|
}
|
|
5520
|
-
var findBasePath = function(node, resolver) {
|
|
5944
|
+
var findBasePath = function findBasePath1(node, resolver) {
|
|
5521
5945
|
var parentNode = node.parent;
|
|
5522
5946
|
if (!parentNode) {
|
|
5523
5947
|
return [];
|
|
5524
5948
|
}
|
|
5525
5949
|
if ("children" in parentNode) {
|
|
5950
|
+
var _ref;
|
|
5526
5951
|
var _parentNode_children_find, _parentNode_children;
|
|
5527
5952
|
var original = resolver.getSourceNode(node);
|
|
5528
|
-
|
|
5529
|
-
return (_parentNode_children_find_path = (_parentNode_children = parentNode.children) === null || _parentNode_children === void 0 ? void 0 : (_parentNode_children_find = _parentNode_children.find(function(child) {
|
|
5953
|
+
return (_ref = (_parentNode_children = parentNode.children) === null || _parentNode_children === void 0 ? void 0 : (_parentNode_children_find = _parentNode_children.find(function(child) {
|
|
5530
5954
|
return child.value === original;
|
|
5531
|
-
})) === null || _parentNode_children_find === void 0 ? void 0 : _parentNode_children_find.path) !== null &&
|
|
5955
|
+
})) === null || _parentNode_children_find === void 0 ? void 0 : _parentNode_children_find.path) !== null && _ref !== void 0 ? _ref : [];
|
|
5532
5956
|
}
|
|
5533
5957
|
if (parentNode.type !== "multi-node") {
|
|
5534
5958
|
return [];
|
|
@@ -5553,9 +5977,9 @@ var AsyncNodePlugin = function() {
|
|
|
5553
5977
|
var _node_parent, _node_parent_parent, _node_parent1, _node_parent_parent1, _node_parent2, _node_parent_parent_value;
|
|
5554
5978
|
var propsToSkip;
|
|
5555
5979
|
if (node.type === "asset" || node.type === "view") {
|
|
5980
|
+
var _ref;
|
|
5556
5981
|
var _node_plugins_stringResolver, _node_plugins, _node_value;
|
|
5557
|
-
|
|
5558
|
-
propsToSkip = new Set((_node_plugins_stringResolver_propertiesToSkip = (_node_plugins = node.plugins) === null || _node_plugins === void 0 ? void 0 : (_node_plugins_stringResolver = _node_plugins.stringResolver) === null || _node_plugins_stringResolver === void 0 ? void 0 : _node_plugins_stringResolver.propertiesToSkip) !== null && _node_plugins_stringResolver_propertiesToSkip !== void 0 ? _node_plugins_stringResolver_propertiesToSkip : [
|
|
5982
|
+
propsToSkip = new Set((_ref = (_node_plugins = node.plugins) === null || _node_plugins === void 0 ? void 0 : (_node_plugins_stringResolver = _node_plugins.stringResolver) === null || _node_plugins_stringResolver === void 0 ? void 0 : _node_plugins_stringResolver.propertiesToSkip) !== null && _ref !== void 0 ? _ref : [
|
|
5559
5983
|
"exp"
|
|
5560
5984
|
]);
|
|
5561
5985
|
if ((_node_value = node.value) === null || _node_value === void 0 ? void 0 : _node_value.id) {
|
|
@@ -5976,11 +6400,11 @@ var AsyncNodePlugin = function() {
|
|
|
5976
6400
|
this.stateStore.clear();
|
|
5977
6401
|
view.hooks.resolver.tap("asset-transform", function(resolver) {
|
|
5978
6402
|
var lastUpdatedNode;
|
|
5979
|
-
var updateState = function(node) {
|
|
6403
|
+
var updateState = function updateState(node) {
|
|
5980
6404
|
lastUpdatedNode = node;
|
|
5981
6405
|
view.update(/* @__PURE__ */ new Set());
|
|
5982
6406
|
};
|
|
5983
|
-
var getStore = function(node, stepKey) {
|
|
6407
|
+
var getStore = function getStore(node, stepKey) {
|
|
5984
6408
|
var store;
|
|
5985
6409
|
var countKey = stepKey === _this.resolveSymbol ? _this.resolveCountSymbol : _this.beforeResolveCountSymbol;
|
|
5986
6410
|
var storedState = _this.stateStore.get(node);
|
|
@@ -5994,10 +6418,10 @@ var AsyncNodePlugin = function() {
|
|
|
5994
6418
|
_this.stateStore.set(node, store);
|
|
5995
6419
|
}
|
|
5996
6420
|
return {
|
|
5997
|
-
useSharedState: function(key) {
|
|
6421
|
+
useSharedState: function useSharedState(key) {
|
|
5998
6422
|
return store.useSharedState(key);
|
|
5999
6423
|
},
|
|
6000
|
-
useLocalState: function(initialState) {
|
|
6424
|
+
useLocalState: function useLocalState(initialState) {
|
|
6001
6425
|
return store.getLocalStateFunction(stepKey, countKey)(initialState);
|
|
6002
6426
|
}
|
|
6003
6427
|
};
|
|
@@ -6359,7 +6783,7 @@ var AsyncNodePlugin = function() {
|
|
|
6359
6783
|
return options;
|
|
6360
6784
|
}
|
|
6361
6785
|
tracked.delete(node);
|
|
6362
|
-
var track = function(binding) {
|
|
6786
|
+
var track = function track(binding) {
|
|
6363
6787
|
var _this_options_callbacks_onAdd, _this_options_callbacks;
|
|
6364
6788
|
var parsed = isBinding(binding) ? binding : _this.options.parseBinding(binding);
|
|
6365
6789
|
if (tracked.has(node)) {
|
|
@@ -6385,7 +6809,7 @@ var AsyncNodePlugin = function() {
|
|
|
6385
6809
|
};
|
|
6386
6810
|
return _object_spread_props(_object_spread({}, options), {
|
|
6387
6811
|
validation: _object_spread_props(_object_spread({}, options.validation), {
|
|
6388
|
-
get: function(binding, getOptions) {
|
|
6812
|
+
get: function get(binding, getOptions) {
|
|
6389
6813
|
var _options_validation__getValidationForBinding, _options_validation;
|
|
6390
6814
|
if (getOptions === null || getOptions === void 0 ? void 0 : getOptions.track) {
|
|
6391
6815
|
track(binding);
|
|
@@ -6397,14 +6821,14 @@ var AsyncNodePlugin = function() {
|
|
|
6397
6821
|
return firstFieldEOW;
|
|
6398
6822
|
},
|
|
6399
6823
|
getValidationsForBinding: function getValidationsForBinding(binding, getOptions) {
|
|
6824
|
+
var _ref;
|
|
6400
6825
|
var _options_validation__getValidationForBinding, _options_validation;
|
|
6401
6826
|
if (getOptions === null || getOptions === void 0 ? void 0 : getOptions.track) {
|
|
6402
6827
|
track(binding);
|
|
6403
6828
|
}
|
|
6404
|
-
|
|
6405
|
-
return (_options_validation__getValidationForBinding_getAll = (_options_validation = options.validation) === null || _options_validation === void 0 ? void 0 : (_options_validation__getValidationForBinding = _options_validation._getValidationForBinding(binding)) === null || _options_validation__getValidationForBinding === void 0 ? void 0 : _options_validation__getValidationForBinding.getAll(getOptions)) !== null && _options_validation__getValidationForBinding_getAll !== void 0 ? _options_validation__getValidationForBinding_getAll : [];
|
|
6829
|
+
return (_ref = (_options_validation = options.validation) === null || _options_validation === void 0 ? void 0 : (_options_validation__getValidationForBinding = _options_validation._getValidationForBinding(binding)) === null || _options_validation__getValidationForBinding === void 0 ? void 0 : _options_validation__getValidationForBinding.getAll(getOptions)) !== null && _ref !== void 0 ? _ref : [];
|
|
6406
6830
|
},
|
|
6407
|
-
getChildren: function(type) {
|
|
6831
|
+
getChildren: function getChildren(type) {
|
|
6408
6832
|
var _lastComputedBindingTree_get;
|
|
6409
6833
|
var validations = new Array();
|
|
6410
6834
|
(_lastComputedBindingTree_get = lastComputedBindingTree.get(node)) === null || _lastComputedBindingTree_get === void 0 ? void 0 : _lastComputedBindingTree_get.forEach(function(binding) {
|
|
@@ -6416,7 +6840,7 @@ var AsyncNodePlugin = function() {
|
|
|
6416
6840
|
});
|
|
6417
6841
|
return validations;
|
|
6418
6842
|
},
|
|
6419
|
-
getValidationsForSection: function() {
|
|
6843
|
+
getValidationsForSection: function getValidationsForSection() {
|
|
6420
6844
|
var _lastSectionBindingTree_get;
|
|
6421
6845
|
var validations = new Array();
|
|
6422
6846
|
(_lastSectionBindingTree_get = lastSectionBindingTree.get(node)) === null || _lastSectionBindingTree_get === void 0 ? void 0 : _lastSectionBindingTree_get.forEach(function(binding) {
|
|
@@ -6428,7 +6852,7 @@ var AsyncNodePlugin = function() {
|
|
|
6428
6852
|
});
|
|
6429
6853
|
return validations;
|
|
6430
6854
|
},
|
|
6431
|
-
register: function(registerOptions) {
|
|
6855
|
+
register: function register(registerOptions) {
|
|
6432
6856
|
if ((registerOptions === null || registerOptions === void 0 ? void 0 : registerOptions.type) === "section") {
|
|
6433
6857
|
if (!sections.has(node)) {
|
|
6434
6858
|
sections.set(node, /* @__PURE__ */ new Set());
|
|
@@ -6573,10 +6997,10 @@ var AsyncNodePlugin = function() {
|
|
|
6573
6997
|
value: function runApplicableValidations(runner, canDismiss, phase) {
|
|
6574
6998
|
var _this = this;
|
|
6575
6999
|
this.applicableValidations = this.applicableValidations.map(function(originalValue) {
|
|
7000
|
+
var _originalValue_value_blocking, _response_message, _obj_value_displayTarget;
|
|
6576
7001
|
if (originalValue.state === "dismissed") {
|
|
6577
7002
|
return originalValue;
|
|
6578
7003
|
}
|
|
6579
|
-
var _originalValue_value_blocking;
|
|
6580
7004
|
var blocking = (_originalValue_value_blocking = originalValue.value.blocking) !== null && _originalValue_value_blocking !== void 0 ? _originalValue_value_blocking : originalValue.value.severity === "warning" && "once" || true;
|
|
6581
7005
|
var obj = (0, import_timm9.setIn)(originalValue, [
|
|
6582
7006
|
"value",
|
|
@@ -6598,7 +7022,6 @@ var AsyncNodePlugin = function() {
|
|
|
6598
7022
|
}
|
|
6599
7023
|
}
|
|
6600
7024
|
var response = runner(obj.value);
|
|
6601
|
-
var _response_message, _obj_value_displayTarget;
|
|
6602
7025
|
var newState = {
|
|
6603
7026
|
type: obj.type,
|
|
6604
7027
|
value: obj.value,
|
|
@@ -6683,14 +7106,14 @@ var AsyncNodePlugin = function() {
|
|
|
6683
7106
|
var _this = this;
|
|
6684
7107
|
return [
|
|
6685
7108
|
{
|
|
6686
|
-
set: function(transaction, options, next) {
|
|
6687
|
-
var
|
|
6688
|
-
return (
|
|
7109
|
+
set: function set(transaction, options, next) {
|
|
7110
|
+
var _ref;
|
|
7111
|
+
return (_ref = next === null || next === void 0 ? void 0 : next.set(transaction, options)) !== null && _ref !== void 0 ? _ref : [];
|
|
6689
7112
|
},
|
|
6690
|
-
get: function(binding, options, next) {
|
|
7113
|
+
get: function get(binding, options, next) {
|
|
6691
7114
|
return next === null || next === void 0 ? void 0 : next.get(binding, options);
|
|
6692
7115
|
},
|
|
6693
|
-
delete: function(binding, options, next) {
|
|
7116
|
+
delete: function _delete(binding, options, next) {
|
|
6694
7117
|
_this.validations = removeBindingAndChildrenFromMap(_this.validations, binding);
|
|
6695
7118
|
return next === null || next === void 0 ? void 0 : next.delete(binding, options);
|
|
6696
7119
|
}
|
|
@@ -6753,11 +7176,11 @@ var AsyncNodePlugin = function() {
|
|
|
6753
7176
|
{
|
|
6754
7177
|
source: VIEW_VALIDATION_PROVIDER_NAME,
|
|
6755
7178
|
provider: {
|
|
6756
|
-
getValidationsForBinding: function(binding) {
|
|
7179
|
+
getValidationsForBinding: function getValidationsForBinding(binding) {
|
|
6757
7180
|
var _this_viewValidationProvider_getValidationsForBinding, _this_viewValidationProvider;
|
|
6758
7181
|
return (_this_viewValidationProvider = _this.viewValidationProvider) === null || _this_viewValidationProvider === void 0 ? void 0 : (_this_viewValidationProvider_getValidationsForBinding = _this_viewValidationProvider.getValidationsForBinding) === null || _this_viewValidationProvider_getValidationsForBinding === void 0 ? void 0 : _this_viewValidationProvider_getValidationsForBinding.call(_this_viewValidationProvider, binding);
|
|
6759
7182
|
},
|
|
6760
|
-
getValidationsForView: function() {
|
|
7183
|
+
getValidationsForView: function getValidationsForView() {
|
|
6761
7184
|
var _this_viewValidationProvider_getValidationsForView, _this_viewValidationProvider;
|
|
6762
7185
|
return (_this_viewValidationProvider = _this.viewValidationProvider) === null || _this_viewValidationProvider === void 0 ? void 0 : (_this_viewValidationProvider_getValidationsForView = _this_viewValidationProvider.getValidationsForView) === null || _this_viewValidationProvider_getValidationsForView === void 0 ? void 0 : _this_viewValidationProvider_getValidationsForView.call(_this_viewValidationProvider);
|
|
6763
7186
|
}
|
|
@@ -6784,7 +7207,7 @@ var AsyncNodePlugin = function() {
|
|
|
6784
7207
|
}
|
|
6785
7208
|
var bindingTrackerPlugin = new ValidationBindingTrackerViewPlugin(_object_spread_props(_object_spread({}, this.options), {
|
|
6786
7209
|
callbacks: {
|
|
6787
|
-
onAdd: function(binding) {
|
|
7210
|
+
onAdd: function onAdd(binding) {
|
|
6788
7211
|
if (!_this.options || _this.getValidationForBinding(binding) !== void 0) {
|
|
6789
7212
|
return;
|
|
6790
7213
|
}
|
|
@@ -6828,11 +7251,11 @@ var AsyncNodePlugin = function() {
|
|
|
6828
7251
|
var _this_options;
|
|
6829
7252
|
var possibleValidations = this.getValidationProviders().reduce(function(vals, provider) {
|
|
6830
7253
|
var _vals;
|
|
7254
|
+
var _ref;
|
|
6831
7255
|
var _provider_provider_getValidationsForBinding, _provider_provider_getValidationsForBinding1, _provider_provider;
|
|
6832
|
-
|
|
6833
|
-
(_vals = vals).push.apply(_vals, _to_consumable_array((_provider_provider_getValidationsForBinding_map = (_provider_provider_getValidationsForBinding1 = (_provider_provider = provider.provider).getValidationsForBinding) === null || _provider_provider_getValidationsForBinding1 === void 0 ? void 0 : (_provider_provider_getValidationsForBinding = _provider_provider_getValidationsForBinding1.call(_provider_provider, binding)) === null || _provider_provider_getValidationsForBinding === void 0 ? void 0 : _provider_provider_getValidationsForBinding.map(function(valObj) {
|
|
7256
|
+
(_vals = vals).push.apply(_vals, _to_consumable_array((_ref = (_provider_provider_getValidationsForBinding1 = (_provider_provider = provider.provider).getValidationsForBinding) === null || _provider_provider_getValidationsForBinding1 === void 0 ? void 0 : (_provider_provider_getValidationsForBinding = _provider_provider_getValidationsForBinding1.call(_provider_provider, binding)) === null || _provider_provider_getValidationsForBinding === void 0 ? void 0 : _provider_provider_getValidationsForBinding.map(function(valObj) {
|
|
6834
7257
|
return _object_spread_props(_object_spread({}, valObj), _define_property({}, VALIDATION_PROVIDER_NAME_SYMBOL, provider.source));
|
|
6835
|
-
})) !== null &&
|
|
7258
|
+
})) !== null && _ref !== void 0 ? _ref : []));
|
|
6836
7259
|
return vals;
|
|
6837
7260
|
}, []);
|
|
6838
7261
|
if (possibleValidations.length === 0) {
|
|
@@ -6873,10 +7296,10 @@ var AsyncNodePlugin = function() {
|
|
|
6873
7296
|
key: "validationRunner",
|
|
6874
7297
|
value: function validationRunner(validationObj, binding) {
|
|
6875
7298
|
var context = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.options;
|
|
7299
|
+
var _validationObj_handler;
|
|
6876
7300
|
if (!context) {
|
|
6877
7301
|
throw new Error("No context provided to validation runner");
|
|
6878
7302
|
}
|
|
6879
|
-
var _validationObj_handler;
|
|
6880
7303
|
var handler = (_validationObj_handler = validationObj.handler) !== null && _validationObj_handler !== void 0 ? _validationObj_handler : this.getValidator(validationObj.type);
|
|
6881
7304
|
var weakBindings = /* @__PURE__ */ new Set();
|
|
6882
7305
|
var model = {
|
|
@@ -6890,7 +7313,7 @@ var AsyncNodePlugin = function() {
|
|
|
6890
7313
|
delete: context.model.delete
|
|
6891
7314
|
};
|
|
6892
7315
|
var result = handler === null || handler === void 0 ? void 0 : handler(_object_spread_props(_object_spread({}, context), {
|
|
6893
|
-
evaluate: function(exp) {
|
|
7316
|
+
evaluate: function evaluate(exp) {
|
|
6894
7317
|
var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {
|
|
6895
7318
|
model: model
|
|
6896
7319
|
};
|
|
@@ -6928,7 +7351,7 @@ var AsyncNodePlugin = function() {
|
|
|
6928
7351
|
var _this = this;
|
|
6929
7352
|
var isNavigationTrigger = trigger === "navigation";
|
|
6930
7353
|
var lastActiveBindings = this.activeBindings;
|
|
6931
|
-
var updateValidations = function(dismissValidations) {
|
|
7354
|
+
var updateValidations = function updateValidations(dismissValidations) {
|
|
6932
7355
|
_this.getBindings().forEach(function(binding) {
|
|
6933
7356
|
var _this_validations_get;
|
|
6934
7357
|
(_this_validations_get = _this.validations.get(binding)) === null || _this_validations_get === void 0 ? void 0 : _this_validations_get.update(trigger, dismissValidations, function(obj) {
|
|
@@ -6973,9 +7396,9 @@ var AsyncNodePlugin = function() {
|
|
|
6973
7396
|
{
|
|
6974
7397
|
key: "getBindings",
|
|
6975
7398
|
value: function getBindings() {
|
|
7399
|
+
var _ref;
|
|
6976
7400
|
var _this_tracker;
|
|
6977
|
-
|
|
6978
|
-
return (_this_tracker_getBindings = (_this_tracker = this.tracker) === null || _this_tracker === void 0 ? void 0 : _this_tracker.getBindings()) !== null && _this_tracker_getBindings !== void 0 ? _this_tracker_getBindings : /* @__PURE__ */ new Set();
|
|
7401
|
+
return (_ref = (_this_tracker = this.tracker) === null || _this_tracker === void 0 ? void 0 : _this_tracker.getBindings()) !== null && _ref !== void 0 ? _ref : /* @__PURE__ */ new Set();
|
|
6979
7402
|
}
|
|
6980
7403
|
},
|
|
6981
7404
|
{
|
|
@@ -7024,10 +7447,10 @@ var AsyncNodePlugin = function() {
|
|
|
7024
7447
|
value: function forView(parser) {
|
|
7025
7448
|
var _this = this;
|
|
7026
7449
|
return {
|
|
7027
|
-
_getValidationForBinding: function(binding) {
|
|
7450
|
+
_getValidationForBinding: function _getValidationForBinding(binding) {
|
|
7028
7451
|
return _this.getValidationForBinding(isBinding(binding) ? binding : parser(binding));
|
|
7029
7452
|
},
|
|
7030
|
-
getAll: function() {
|
|
7453
|
+
getAll: function getAll() {
|
|
7031
7454
|
var bindings = _this.getBindings();
|
|
7032
7455
|
if (bindings.size === 0) {
|
|
7033
7456
|
return void 0;
|
|
@@ -7054,13 +7477,13 @@ var AsyncNodePlugin = function() {
|
|
|
7054
7477
|
getValidationsForSection: function getValidationsForSection() {
|
|
7055
7478
|
throw new Error("Error rollup should be provided by the view plugin");
|
|
7056
7479
|
},
|
|
7057
|
-
track: function() {
|
|
7480
|
+
track: function track() {
|
|
7058
7481
|
throw new Error("Tracking should be provided by the view plugin");
|
|
7059
7482
|
},
|
|
7060
|
-
register: function() {
|
|
7483
|
+
register: function register() {
|
|
7061
7484
|
throw new Error("Section functionality should be provided by the view plugin");
|
|
7062
7485
|
},
|
|
7063
|
-
type: function(binding) {
|
|
7486
|
+
type: function type(binding) {
|
|
7064
7487
|
return _this.schema.getType(isBinding(binding) ? binding : parser(binding));
|
|
7065
7488
|
}
|
|
7066
7489
|
};
|
|
@@ -7069,9 +7492,9 @@ var AsyncNodePlugin = function() {
|
|
|
7069
7492
|
]);
|
|
7070
7493
|
return ValidationController;
|
|
7071
7494
|
}();
|
|
7072
|
-
var mergeSets = function(setA, setB) {
|
|
7073
|
-
var
|
|
7074
|
-
return /* @__PURE__ */ new Set(_to_consumable_array((
|
|
7495
|
+
var mergeSets = function mergeSets(setA, setB) {
|
|
7496
|
+
var _ref, _ref1;
|
|
7497
|
+
return /* @__PURE__ */ new Set(_to_consumable_array((_ref = setA === null || setA === void 0 ? void 0 : setA.values()) !== null && _ref !== void 0 ? _ref : []).concat(_to_consumable_array((_ref1 = setB === null || setB === void 0 ? void 0 : setB.values()) !== null && _ref1 !== void 0 ? _ref1 : [])));
|
|
7075
7498
|
};
|
|
7076
7499
|
var ViewController = /*#__PURE__*/ function() {
|
|
7077
7500
|
function ViewController(initialViews, options) {
|
|
@@ -7098,7 +7521,7 @@ var AsyncNodePlugin = function() {
|
|
|
7098
7521
|
}
|
|
7099
7522
|
});
|
|
7100
7523
|
});
|
|
7101
|
-
var update = function(updates) {
|
|
7524
|
+
var update = function update(updates) {
|
|
7102
7525
|
var silent = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
7103
7526
|
if (_this1.currentView) {
|
|
7104
7527
|
if (_this1.optimizeUpdates) {
|
|
@@ -7109,10 +7532,10 @@ var AsyncNodePlugin = function() {
|
|
|
7109
7532
|
}
|
|
7110
7533
|
};
|
|
7111
7534
|
options.model.hooks.onUpdate.tap("viewController", function(updates, updateOptions) {
|
|
7112
|
-
var
|
|
7535
|
+
var _ref;
|
|
7113
7536
|
update(new Set(updates.map(function(t2) {
|
|
7114
7537
|
return t2.binding;
|
|
7115
|
-
})), (
|
|
7538
|
+
})), (_ref = updateOptions === null || updateOptions === void 0 ? void 0 : updateOptions.silent) !== null && _ref !== void 0 ? _ref : false);
|
|
7116
7539
|
});
|
|
7117
7540
|
options.model.hooks.onDelete.tap("viewController", function(binding) {
|
|
7118
7541
|
var parentBinding = binding.parent();
|
|
@@ -7147,8 +7570,8 @@ var AsyncNodePlugin = function() {
|
|
|
7147
7570
|
if (!this.pendingUpdate.scheduled && !silent) {
|
|
7148
7571
|
this.pendingUpdate.scheduled = true;
|
|
7149
7572
|
(0, import_queue_microtask2.default)(function() {
|
|
7150
|
-
var _this_currentView;
|
|
7151
7573
|
var _this_pendingUpdate;
|
|
7574
|
+
var _this_currentView;
|
|
7152
7575
|
var _ref = (_this_pendingUpdate = _this.pendingUpdate) !== null && _this_pendingUpdate !== void 0 ? _this_pendingUpdate : {}, changedBindings = _ref.changedBindings, changedNodes = _ref.changedNodes;
|
|
7153
7576
|
_this.pendingUpdate = void 0;
|
|
7154
7577
|
(_this_currentView = _this.currentView) === null || _this_currentView === void 0 ? void 0 : _this_currentView.update(changedBindings, changedNodes);
|
|
@@ -7473,10 +7896,10 @@ var AsyncNodePlugin = function() {
|
|
|
7473
7896
|
{
|
|
7474
7897
|
key: "getConstants",
|
|
7475
7898
|
value: function getConstants(key, namespace, fallback) {
|
|
7899
|
+
var _ref, _ref1;
|
|
7476
7900
|
var _this_tempStore_get, _this_store_get;
|
|
7477
7901
|
var path = new BindingInstance(key);
|
|
7478
|
-
|
|
7479
|
-
return (_ref = (_this_tempStore_get_get = (_this_tempStore_get = this.tempStore.get(namespace)) === null || _this_tempStore_get === void 0 ? void 0 : _this_tempStore_get.get(path)) !== null && _this_tempStore_get_get !== void 0 ? _this_tempStore_get_get : (_this_store_get = this.store.get(namespace)) === null || _this_store_get === void 0 ? void 0 : _this_store_get.get(path)) !== null && _ref !== void 0 ? _ref : fallback;
|
|
7902
|
+
return (_ref = (_ref1 = (_this_tempStore_get = this.tempStore.get(namespace)) === null || _this_tempStore_get === void 0 ? void 0 : _this_tempStore_get.get(path)) !== null && _ref1 !== void 0 ? _ref1 : (_this_store_get = this.store.get(namespace)) === null || _this_store_get === void 0 ? void 0 : _this_store_get.get(path)) !== null && _ref !== void 0 ? _ref : fallback;
|
|
7480
7903
|
}
|
|
7481
7904
|
},
|
|
7482
7905
|
{
|
|
@@ -7517,7 +7940,7 @@ var AsyncNodePlugin = function() {
|
|
|
7517
7940
|
value: function apply(player) {
|
|
7518
7941
|
var _this = this;
|
|
7519
7942
|
var expressionEvaluator;
|
|
7520
|
-
var handleEval = function(exp) {
|
|
7943
|
+
var handleEval = function handleEval(exp) {
|
|
7521
7944
|
if (exp) {
|
|
7522
7945
|
if ((typeof exp === "undefined" ? "undefined" : _type_of(exp)) === "object" && "exp" in exp) {
|
|
7523
7946
|
expressionEvaluator === null || expressionEvaluator === void 0 ? void 0 : expressionEvaluator.evaluate(exp.exp);
|
|
@@ -7538,7 +7961,7 @@ var AsyncNodePlugin = function() {
|
|
|
7538
7961
|
return handleEval(exp);
|
|
7539
7962
|
});
|
|
7540
7963
|
flow.hooks.resolveTransitionNode.intercept({
|
|
7541
|
-
call: function(nextState) {
|
|
7964
|
+
call: function call(nextState) {
|
|
7542
7965
|
if (nextState === null || nextState === void 0 ? void 0 : nextState.onStart) {
|
|
7543
7966
|
handleEval(nextState.onStart);
|
|
7544
7967
|
}
|
|
@@ -7551,13 +7974,13 @@ var AsyncNodePlugin = function() {
|
|
|
7551
7974
|
]);
|
|
7552
7975
|
return FlowExpPlugin;
|
|
7553
7976
|
}();
|
|
7554
|
-
var createFormatFunction = function(schema) {
|
|
7555
|
-
var handler = function(ctx, value, formatName) {
|
|
7977
|
+
var createFormatFunction = function createFormatFunction(schema) {
|
|
7978
|
+
var handler = function handler(ctx, value, formatName) {
|
|
7979
|
+
var _ref;
|
|
7556
7980
|
var _schema_getFormatterForType;
|
|
7557
|
-
|
|
7558
|
-
return (_schema_getFormatterForType_format = (_schema_getFormatterForType = schema.getFormatterForType({
|
|
7981
|
+
return (_ref = (_schema_getFormatterForType = schema.getFormatterForType({
|
|
7559
7982
|
type: formatName
|
|
7560
|
-
})) === null || _schema_getFormatterForType === void 0 ? void 0 : _schema_getFormatterForType.format(value)) !== null &&
|
|
7983
|
+
})) === null || _schema_getFormatterForType === void 0 ? void 0 : _schema_getFormatterForType.format(value)) !== null && _ref !== void 0 ? _ref : value;
|
|
7561
7984
|
};
|
|
7562
7985
|
return handler;
|
|
7563
7986
|
};
|
|
@@ -7609,8 +8032,234 @@ var AsyncNodePlugin = function() {
|
|
|
7609
8032
|
ref: Symbol("not-started"),
|
|
7610
8033
|
status: "not-started"
|
|
7611
8034
|
};
|
|
7612
|
-
var
|
|
7613
|
-
var
|
|
8035
|
+
var A2UI_EVENT_CONTEXT_NAMESPACE = "agent.event.context";
|
|
8036
|
+
var NUMERIC_SEGMENT = /^(0|[1-9]\d*)$/;
|
|
8037
|
+
var decodeSegment = function decodeSegment(segment) {
|
|
8038
|
+
return segment.replace(/~1/g, "/").replace(/~0/g, "~");
|
|
8039
|
+
};
|
|
8040
|
+
var isObject = function isObject(v) {
|
|
8041
|
+
return (typeof v === "undefined" ? "undefined" : _type_of(v)) === "object" && v !== null && !Array.isArray(v);
|
|
8042
|
+
};
|
|
8043
|
+
var isPathRef = function isPathRef(v) {
|
|
8044
|
+
return isObject(v) && typeof v.path === "string" && Object.keys(v).length === 1;
|
|
8045
|
+
};
|
|
8046
|
+
var isFunctionCall = function isFunctionCall(v) {
|
|
8047
|
+
return isObject(v) && typeof v.call === "string";
|
|
8048
|
+
};
|
|
8049
|
+
function renderArg(value) {
|
|
8050
|
+
if (value === null) return "null";
|
|
8051
|
+
if (value === void 0) return "null";
|
|
8052
|
+
if (typeof value === "boolean") return String(value);
|
|
8053
|
+
if (typeof value === "number") return String(value);
|
|
8054
|
+
if (typeof value === "string") return JSON.stringify(value);
|
|
8055
|
+
if (Array.isArray(value)) {
|
|
8056
|
+
return "[".concat(value.map(renderArg).join(", "), "]");
|
|
8057
|
+
}
|
|
8058
|
+
if (isPathRef(value)) {
|
|
8059
|
+
return "{{".concat(pointerToBinding(value.path), "}}");
|
|
8060
|
+
}
|
|
8061
|
+
if (isFunctionCall(value)) {
|
|
8062
|
+
var inner = translateFunctionCall(value);
|
|
8063
|
+
return inner.replace(/^@\[/, "").replace(/\]@$/, "");
|
|
8064
|
+
}
|
|
8065
|
+
return JSON.stringify(value);
|
|
8066
|
+
}
|
|
8067
|
+
var INPUT_BINDING_PROPS = {
|
|
8068
|
+
TextField: "text",
|
|
8069
|
+
CheckBox: "checked",
|
|
8070
|
+
DateTimeInput: "value",
|
|
8071
|
+
ChoicePicker: "value",
|
|
8072
|
+
Slider: "value"
|
|
8073
|
+
};
|
|
8074
|
+
var CHECK_TO_VALIDATOR = {
|
|
8075
|
+
required: "required",
|
|
8076
|
+
regex: "regex",
|
|
8077
|
+
email: "email",
|
|
8078
|
+
length: "length",
|
|
8079
|
+
numeric: "numeric"
|
|
8080
|
+
};
|
|
8081
|
+
var TYPE_PREFIX = "T_";
|
|
8082
|
+
var STRUCTURAL_KEYS = /* @__PURE__ */ new Set([
|
|
8083
|
+
"id",
|
|
8084
|
+
"component",
|
|
8085
|
+
"child",
|
|
8086
|
+
"children",
|
|
8087
|
+
"checks",
|
|
8088
|
+
"action"
|
|
8089
|
+
]);
|
|
8090
|
+
function inlineComponent(component, ctx, templateScope) {
|
|
8091
|
+
if (ctx.inProgress.has(component.id)) {
|
|
8092
|
+
throw new Error("[a2ui] Component cycle detected at id '".concat(component.id, "'. A2UI requires the component graph to be a tree."));
|
|
8093
|
+
}
|
|
8094
|
+
ctx.inProgress.add(component.id);
|
|
8095
|
+
var asset = {
|
|
8096
|
+
id: component.id,
|
|
8097
|
+
type: component.component
|
|
8098
|
+
};
|
|
8099
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
8100
|
+
try {
|
|
8101
|
+
for(var _iterator = Object.entries(component)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
8102
|
+
var _step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], value = _step_value[1];
|
|
8103
|
+
if (STRUCTURAL_KEYS.has(key)) continue;
|
|
8104
|
+
asset[key] = translatePropValue(value, templateScope, ctx, key);
|
|
8105
|
+
}
|
|
8106
|
+
} catch (err) {
|
|
8107
|
+
_didIteratorError = true;
|
|
8108
|
+
_iteratorError = err;
|
|
8109
|
+
} finally{
|
|
8110
|
+
try {
|
|
8111
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
8112
|
+
_iterator.return();
|
|
8113
|
+
}
|
|
8114
|
+
} finally{
|
|
8115
|
+
if (_didIteratorError) {
|
|
8116
|
+
throw _iteratorError;
|
|
8117
|
+
}
|
|
8118
|
+
}
|
|
8119
|
+
}
|
|
8120
|
+
if (typeof component.child === "string") {
|
|
8121
|
+
var childId = component.child;
|
|
8122
|
+
asset.child = wrapInlined(resolveAndInline(childId, ctx, templateScope));
|
|
8123
|
+
}
|
|
8124
|
+
if (component.children) {
|
|
8125
|
+
if (Array.isArray(component.children)) {
|
|
8126
|
+
asset.children = component.children.map(function(id) {
|
|
8127
|
+
return wrapInlined(resolveAndInline(id, ctx, templateScope));
|
|
8128
|
+
});
|
|
8129
|
+
} else {
|
|
8130
|
+
var _component_children = component.children, path = _component_children.path, componentId = _component_children.componentId;
|
|
8131
|
+
var data = scopedBinding(path, templateScope);
|
|
8132
|
+
var templateComponent = ctx.byId.get(componentId);
|
|
8133
|
+
if (!templateComponent) {
|
|
8134
|
+
throw new Error("[a2ui] Templated children reference unknown componentId '".concat(componentId, "' on component '").concat(component.id, "'."));
|
|
8135
|
+
}
|
|
8136
|
+
var templated = inlineComponent(_object_spread_props(_object_spread({}, templateComponent), {
|
|
8137
|
+
id: "".concat(templateComponent.id, "-_index_")
|
|
8138
|
+
}), ctx, data);
|
|
8139
|
+
asset.template = [
|
|
8140
|
+
{
|
|
8141
|
+
data: data,
|
|
8142
|
+
output: "children",
|
|
8143
|
+
value: {
|
|
8144
|
+
asset: templated
|
|
8145
|
+
}
|
|
8146
|
+
}
|
|
8147
|
+
];
|
|
8148
|
+
}
|
|
8149
|
+
}
|
|
8150
|
+
if (component.action) {
|
|
8151
|
+
Object.assign(asset, translateAction(component.action, ctx));
|
|
8152
|
+
}
|
|
8153
|
+
ctx.inProgress.delete(component.id);
|
|
8154
|
+
return asset;
|
|
8155
|
+
}
|
|
8156
|
+
var CHILD_KEY_RE = /(?:^|[a-z])Child$|^child$/;
|
|
8157
|
+
var CHILDREN_KEY_RE = /(?:^|[a-z])Children$|^children$/;
|
|
8158
|
+
function translatePropValue(value, templateScope, ctx, parentKey) {
|
|
8159
|
+
if (value === null || value === void 0) return value;
|
|
8160
|
+
if (parentKey && CHILD_KEY_RE.test(parentKey) && typeof value === "string") {
|
|
8161
|
+
return wrapInlined(resolveAndInline(value, ctx, templateScope));
|
|
8162
|
+
}
|
|
8163
|
+
if (parentKey && CHILDREN_KEY_RE.test(parentKey)) {
|
|
8164
|
+
if (Array.isArray(value) && value.every(function(v) {
|
|
8165
|
+
return typeof v === "string";
|
|
8166
|
+
})) {
|
|
8167
|
+
return value.map(function(id) {
|
|
8168
|
+
return wrapInlined(resolveAndInline(id, ctx, templateScope));
|
|
8169
|
+
});
|
|
8170
|
+
}
|
|
8171
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object" && value !== null && !Array.isArray(value) && "componentId" in value) {
|
|
8172
|
+
var _ctx_logger;
|
|
8173
|
+
(_ctx_logger = ctx.logger) === null || _ctx_logger === void 0 ? void 0 : _ctx_logger.warn("[a2ui] Templated children are only supported at top-level 'children'; '".concat(parentKey, "' will be left unresolved."));
|
|
8174
|
+
}
|
|
8175
|
+
}
|
|
8176
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) !== "object") return value;
|
|
8177
|
+
if (Array.isArray(value)) {
|
|
8178
|
+
return value.map(function(v) {
|
|
8179
|
+
return translatePropValue(v, templateScope, ctx, void 0);
|
|
8180
|
+
});
|
|
8181
|
+
}
|
|
8182
|
+
if (isPathRef(value)) {
|
|
8183
|
+
return scopedBinding(value.path, templateScope);
|
|
8184
|
+
}
|
|
8185
|
+
if (isFunctionCall(value)) {
|
|
8186
|
+
if (templateScope) {
|
|
8187
|
+
return translateFunctionCall(rewritePathsInCall(value, templateScope), ctx.logger);
|
|
8188
|
+
}
|
|
8189
|
+
return translateFunctionCall(value, ctx.logger);
|
|
8190
|
+
}
|
|
8191
|
+
var out = {};
|
|
8192
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
8193
|
+
try {
|
|
8194
|
+
for(var _iterator = Object.entries(value)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
8195
|
+
var _step_value = _sliced_to_array(_step.value, 2), k = _step_value[0], v = _step_value[1];
|
|
8196
|
+
out[k] = translatePropValue(v, templateScope, ctx, k);
|
|
8197
|
+
}
|
|
8198
|
+
} catch (err) {
|
|
8199
|
+
_didIteratorError = true;
|
|
8200
|
+
_iteratorError = err;
|
|
8201
|
+
} finally{
|
|
8202
|
+
try {
|
|
8203
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
8204
|
+
_iterator.return();
|
|
8205
|
+
}
|
|
8206
|
+
} finally{
|
|
8207
|
+
if (_didIteratorError) {
|
|
8208
|
+
throw _iteratorError;
|
|
8209
|
+
}
|
|
8210
|
+
}
|
|
8211
|
+
}
|
|
8212
|
+
return out;
|
|
8213
|
+
}
|
|
8214
|
+
function rewritePathsInCall(value, scope) {
|
|
8215
|
+
if (!value || (typeof value === "undefined" ? "undefined" : _type_of(value)) !== "object") return value;
|
|
8216
|
+
if (Array.isArray(value)) {
|
|
8217
|
+
return value.map(function(v) {
|
|
8218
|
+
return rewritePathsInCall(v, scope);
|
|
8219
|
+
});
|
|
8220
|
+
}
|
|
8221
|
+
if (isPathRef(value)) {
|
|
8222
|
+
return {
|
|
8223
|
+
path: scopedPointer(value.path, scope)
|
|
8224
|
+
};
|
|
8225
|
+
}
|
|
8226
|
+
if (isFunctionCall(value)) {
|
|
8227
|
+
return _object_spread_props(_object_spread({}, value), {
|
|
8228
|
+
args: value.args ? Object.fromEntries(Object.entries(value.args).map(function(param) {
|
|
8229
|
+
var _param = _sliced_to_array(param, 2), k = _param[0], v = _param[1];
|
|
8230
|
+
return [
|
|
8231
|
+
k,
|
|
8232
|
+
rewritePathsInCall(v, scope)
|
|
8233
|
+
];
|
|
8234
|
+
})) : value.args
|
|
8235
|
+
});
|
|
8236
|
+
}
|
|
8237
|
+
return Object.fromEntries(Object.entries(value).map(function(param) {
|
|
8238
|
+
var _param = _sliced_to_array(param, 2), k = _param[0], v = _param[1];
|
|
8239
|
+
return [
|
|
8240
|
+
k,
|
|
8241
|
+
rewritePathsInCall(v, scope)
|
|
8242
|
+
];
|
|
8243
|
+
}));
|
|
8244
|
+
}
|
|
8245
|
+
function renderRhs(value) {
|
|
8246
|
+
if (value === null || value === void 0) return "null";
|
|
8247
|
+
if (typeof value === "boolean") return String(value);
|
|
8248
|
+
if (typeof value === "number") return String(value);
|
|
8249
|
+
if (typeof value === "string") return JSON.stringify(value);
|
|
8250
|
+
if (Array.isArray(value)) {
|
|
8251
|
+
return "[".concat(value.map(renderRhs).join(", "), "]");
|
|
8252
|
+
}
|
|
8253
|
+
if (isPathRef(value)) {
|
|
8254
|
+
return "{{".concat(pointerToBinding(value.path), "}}");
|
|
8255
|
+
}
|
|
8256
|
+
if (isFunctionCall(value)) {
|
|
8257
|
+
return translateFunctionCall(value).replace(/^@\[/, "").replace(/\]@$/, "");
|
|
8258
|
+
}
|
|
8259
|
+
return JSON.stringify(value);
|
|
8260
|
+
}
|
|
8261
|
+
var PLAYER_VERSION = true ? "0.16.0--canary.866.36538" : "unknown";
|
|
8262
|
+
var COMMIT = true ? "0186f1bd04fda238cbc62b8d293c8048ab26efc2" : "unknown";
|
|
7614
8263
|
var _Player = /*#__PURE__*/ function() {
|
|
7615
8264
|
function _Player2(config) {
|
|
7616
8265
|
var _this = this;
|
|
@@ -7725,13 +8374,13 @@ var AsyncNodePlugin = function() {
|
|
|
7725
8374
|
var expressionEvaluator;
|
|
7726
8375
|
var dataController;
|
|
7727
8376
|
var pathResolver = new BindingParser({
|
|
7728
|
-
get: function(binding) {
|
|
8377
|
+
get: function get(binding) {
|
|
7729
8378
|
return dataController.get(binding);
|
|
7730
8379
|
},
|
|
7731
|
-
set: function(transaction) {
|
|
8380
|
+
set: function set(transaction) {
|
|
7732
8381
|
return dataController.set(transaction);
|
|
7733
8382
|
},
|
|
7734
|
-
evaluate: function(expression) {
|
|
8383
|
+
evaluate: function evaluate(expression) {
|
|
7735
8384
|
return expressionEvaluator.evaluate(expression);
|
|
7736
8385
|
}
|
|
7737
8386
|
});
|
|
@@ -7875,23 +8524,23 @@ var AsyncNodePlugin = function() {
|
|
|
7875
8524
|
transition: flowController.transition,
|
|
7876
8525
|
model: dataController,
|
|
7877
8526
|
utils: {
|
|
7878
|
-
findPlugin: function(pluginSymbol) {
|
|
8527
|
+
findPlugin: function findPlugin(pluginSymbol) {
|
|
7879
8528
|
return _this.findPlugin(pluginSymbol);
|
|
7880
8529
|
}
|
|
7881
8530
|
},
|
|
7882
8531
|
logger: this.logger,
|
|
7883
8532
|
flowController: flowController,
|
|
7884
8533
|
schema: schema,
|
|
7885
|
-
format: function(binding, value) {
|
|
8534
|
+
format: function format(binding, value) {
|
|
7886
8535
|
var formatter = schema.getFormatter(binding);
|
|
7887
8536
|
return (formatter === null || formatter === void 0 ? void 0 : formatter.format) ? formatter.format(value) : value;
|
|
7888
8537
|
},
|
|
7889
|
-
formatValue: function(ref, value) {
|
|
8538
|
+
formatValue: function formatValue(ref, value) {
|
|
7890
8539
|
var formatter = schema.getFormatterForType(ref);
|
|
7891
8540
|
return (formatter === null || formatter === void 0 ? void 0 : formatter.format) ? formatter.format(value) : value;
|
|
7892
8541
|
},
|
|
7893
8542
|
validation: _object_spread_props(_object_spread({}, validationController.forView(parseBinding)), {
|
|
7894
|
-
type: function(b) {
|
|
8543
|
+
type: function type(b) {
|
|
7895
8544
|
return schema.getType(parseBinding(b));
|
|
7896
8545
|
}
|
|
7897
8546
|
}),
|
|
@@ -7903,7 +8552,7 @@ var AsyncNodePlugin = function() {
|
|
|
7903
8552
|
});
|
|
7904
8553
|
this.hooks.viewController.call(viewController);
|
|
7905
8554
|
return {
|
|
7906
|
-
start: function() {
|
|
8555
|
+
start: function start() {
|
|
7907
8556
|
flowController.start().then(function(endState) {
|
|
7908
8557
|
var flowResult = {
|
|
7909
8558
|
endState: resolveStrings(endState, false),
|
|
@@ -7938,15 +8587,16 @@ var AsyncNodePlugin = function() {
|
|
|
7938
8587
|
},
|
|
7939
8588
|
{
|
|
7940
8589
|
key: "start",
|
|
7941
|
-
value: function start(payload) {
|
|
8590
|
+
value: function start(payload, options) {
|
|
7942
8591
|
return _async_to_generator(function() {
|
|
7943
|
-
var _this,
|
|
8592
|
+
var _this, _ref, flow, ref, maybeUpdateState, _this_setupFlow, state, start, endProps, _tmp, error, errorState;
|
|
7944
8593
|
return _ts_generator(this, function(_state) {
|
|
7945
8594
|
switch(_state.label){
|
|
7946
8595
|
case 0:
|
|
7947
8596
|
_this = this;
|
|
7948
|
-
|
|
7949
|
-
|
|
8597
|
+
flow = (options === null || options === void 0 ? void 0 : options.format) === "a2ui" ? adaptA2UIToFlow(payload, this.logger) : payload;
|
|
8598
|
+
ref = Symbol((_ref = flow === null || flow === void 0 ? void 0 : flow.id) !== null && _ref !== void 0 ? _ref : "payload");
|
|
8599
|
+
maybeUpdateState = function maybeUpdateState(newState) {
|
|
7950
8600
|
if (_this.state.ref !== ref) {
|
|
7951
8601
|
_this.logger.warn("Received update for a flow that's not the current one");
|
|
7952
8602
|
return newState;
|
|
@@ -7966,7 +8616,7 @@ var AsyncNodePlugin = function() {
|
|
|
7966
8616
|
,
|
|
7967
8617
|
4
|
|
7968
8618
|
]);
|
|
7969
|
-
_this_setupFlow = this.setupFlow(
|
|
8619
|
+
_this_setupFlow = this.setupFlow(flow), state = _this_setupFlow.state, start = _this_setupFlow.start;
|
|
7970
8620
|
this.setState(_object_spread({
|
|
7971
8621
|
ref: ref
|
|
7972
8622
|
}, state));
|
|
@@ -8001,7 +8651,7 @@ var AsyncNodePlugin = function() {
|
|
|
8001
8651
|
errorState = {
|
|
8002
8652
|
status: "error",
|
|
8003
8653
|
ref: ref,
|
|
8004
|
-
flow:
|
|
8654
|
+
flow: flow,
|
|
8005
8655
|
error: error
|
|
8006
8656
|
};
|
|
8007
8657
|
maybeUpdateState(errorState);
|
|
@@ -8025,7 +8675,7 @@ var AsyncNodePlugin = function() {
|
|
|
8025
8675
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/index.ts
|
|
8026
8676
|
var import_queue_microtask3 = __toESM(require_queue_microtask());
|
|
8027
8677
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/transform.ts
|
|
8028
|
-
var asyncTransform = function(assetId, wrapperAssetType, asset, flatten2) {
|
|
8678
|
+
var asyncTransform = function asyncTransform(assetId, wrapperAssetType, asset, flatten2) {
|
|
8029
8679
|
var path = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : [
|
|
8030
8680
|
"values"
|
|
8031
8681
|
];
|
|
@@ -8047,7 +8697,7 @@ var AsyncNodePlugin = function() {
|
|
|
8047
8697
|
return wrapperAsset;
|
|
8048
8698
|
};
|
|
8049
8699
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/extractNodeFromPath.ts
|
|
8050
|
-
var getMatchValue = function(pathA, pathB) {
|
|
8700
|
+
var getMatchValue = function getMatchValue(pathA, pathB) {
|
|
8051
8701
|
if (pathA.length > pathB.length) {
|
|
8052
8702
|
return 0;
|
|
8053
8703
|
}
|
|
@@ -8061,7 +8711,7 @@ var AsyncNodePlugin = function() {
|
|
|
8061
8711
|
}
|
|
8062
8712
|
return matchCount;
|
|
8063
8713
|
};
|
|
8064
|
-
var extractNodeFromPath = function(node, path) {
|
|
8714
|
+
var extractNodeFromPath = function extractNodeFromPath1(node, path) {
|
|
8065
8715
|
if (path === void 0 || path.length === 0) {
|
|
8066
8716
|
return node;
|
|
8067
8717
|
}
|
|
@@ -8103,7 +8753,7 @@ var AsyncNodePlugin = function() {
|
|
|
8103
8753
|
return extractNodeFromPath(bestMatch.value, path.slice(matchResult));
|
|
8104
8754
|
};
|
|
8105
8755
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/traverseAndReplace.ts
|
|
8106
|
-
var traverseAndReplace = function(node, replaceFn) {
|
|
8756
|
+
var traverseAndReplace = function traverseAndReplace(node, replaceFn) {
|
|
8107
8757
|
if (node.type === NodeType.MultiNode) {
|
|
8108
8758
|
var index = 0;
|
|
8109
8759
|
while(index < node.values.length){
|
|
@@ -8125,7 +8775,7 @@ var AsyncNodePlugin = function() {
|
|
|
8125
8775
|
return replaceFn(node);
|
|
8126
8776
|
};
|
|
8127
8777
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/unwrapAsset.ts
|
|
8128
|
-
var unwrapAsset = function(node) {
|
|
8778
|
+
var unwrapAsset = function unwrapAsset(node) {
|
|
8129
8779
|
var _node_children;
|
|
8130
8780
|
if (node.type !== NodeType.Value) {
|
|
8131
8781
|
return node;
|
|
@@ -8139,7 +8789,7 @@ var AsyncNodePlugin = function() {
|
|
|
8139
8789
|
return child.value;
|
|
8140
8790
|
};
|
|
8141
8791
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/utils/requiresAssetWrapper.ts
|
|
8142
|
-
var requiresAssetWrapper = function(node) {
|
|
8792
|
+
var requiresAssetWrapper = function requiresAssetWrapper(node) {
|
|
8143
8793
|
if (node.type === NodeType.Asset) {
|
|
8144
8794
|
return true;
|
|
8145
8795
|
}
|
|
@@ -8149,26 +8799,26 @@ var AsyncNodePlugin = function() {
|
|
|
8149
8799
|
return node.value.type === NodeType.Asset;
|
|
8150
8800
|
};
|
|
8151
8801
|
// ../../../../../../../../../../../execroot/_main/bazel-out/k8-fastbuild/bin/plugins/async-node/core/src/createAsyncTransform.ts
|
|
8152
|
-
var defaultGetNodeId = function(node) {
|
|
8802
|
+
var defaultGetNodeId = function defaultGetNodeId(node) {
|
|
8153
8803
|
return "async-".concat(node.value.id);
|
|
8154
8804
|
};
|
|
8155
|
-
var createAsyncTransform = function(options) {
|
|
8805
|
+
var createAsyncTransform = function createAsyncTransform(options) {
|
|
8156
8806
|
var transformAssetType = options.transformAssetType, wrapperAssetType = options.wrapperAssetType, getNestedAsset = options.getNestedAsset, _options_getAsyncNodeId = options.getAsyncNodeId, getAsyncNodeId = _options_getAsyncNodeId === void 0 ? defaultGetNodeId : _options_getAsyncNodeId, _options_path = options.path, path = _options_path === void 0 ? [
|
|
8157
8807
|
"values"
|
|
8158
8808
|
] : _options_path, tmp = options.flatten, flatten2 = tmp === void 0 ? true : tmp, _options_asyncNodePosition = options.asyncNodePosition, asyncNodePosition = _options_asyncNodePosition === void 0 ? "append" : _options_asyncNodePosition;
|
|
8159
|
-
var replaceNode = function(node) {
|
|
8809
|
+
var replaceNode = function replaceNode(node) {
|
|
8810
|
+
var _extractNodeFromPath;
|
|
8160
8811
|
var unwrapped = unwrapAsset(node);
|
|
8161
8812
|
if (unwrapped.type !== NodeType.Asset || unwrapped.value.type !== transformAssetType) {
|
|
8162
8813
|
return node;
|
|
8163
8814
|
}
|
|
8164
8815
|
var transformed = asyncTransform2(unwrapped);
|
|
8165
|
-
var _extractNodeFromPath;
|
|
8166
8816
|
return (_extractNodeFromPath = extractNodeFromPath(transformed, path)) !== null && _extractNodeFromPath !== void 0 ? _extractNodeFromPath : node;
|
|
8167
8817
|
};
|
|
8168
|
-
var replacer = function(node) {
|
|
8818
|
+
var replacer = function replacer(node) {
|
|
8169
8819
|
return traverseAndReplace(node, replaceNode);
|
|
8170
8820
|
};
|
|
8171
|
-
var asyncTransform2 = function(node) {
|
|
8821
|
+
var asyncTransform2 = function asyncTransform2(node) {
|
|
8172
8822
|
var _Builder;
|
|
8173
8823
|
var id = getAsyncNodeId(node);
|
|
8174
8824
|
var asset = getNestedAsset === null || getNestedAsset === void 0 ? void 0 : getNestedAsset(node);
|
|
@@ -8311,8 +8961,8 @@ var AsyncNodePlugin = function() {
|
|
|
8311
8961
|
value: function handleAsyncUpdate(node, context, newNode) {
|
|
8312
8962
|
var nodeResolveCache = context.nodeResolveCache, viewController = context.viewController, originalNodeCache = context.originalNodeCache;
|
|
8313
8963
|
if (nodeResolveCache.get(node.id) !== newNode) {
|
|
8314
|
-
nodeResolveCache.set(node.id, newNode ? newNode : node);
|
|
8315
8964
|
var _originalNodeCache_get;
|
|
8965
|
+
nodeResolveCache.set(node.id, newNode ? newNode : node);
|
|
8316
8966
|
var originalNode = (_originalNodeCache_get = originalNodeCache.get(node.id)) !== null && _originalNodeCache_get !== void 0 ? _originalNodeCache_get : /* @__PURE__ */ new Set([
|
|
8317
8967
|
node
|
|
8318
8968
|
]);
|