@digipair/skill-web-chatbot 0.103.2 → 0.105.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.cjs2.js +113 -57
- package/index.esm2.js +113 -57
- package/package.json +1 -1
package/index.cjs2.js
CHANGED
|
@@ -37752,14 +37752,14 @@ function indent(str, spaces) {
|
|
|
37752
37752
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
37753
37753
|
// match is required
|
|
37754
37754
|
if (!match) {
|
|
37755
|
-
return
|
|
37755
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
|
|
37756
37756
|
v: nextMatch1
|
|
37757
37757
|
};
|
|
37758
37758
|
}
|
|
37759
37759
|
var token = match.token, offset = match.offset;
|
|
37760
37760
|
i1 += offset;
|
|
37761
37761
|
if (token === " ") {
|
|
37762
|
-
return
|
|
37762
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
|
|
37763
37763
|
}
|
|
37764
37764
|
tokens1 = _to_consumable_array$c(tokens1).concat([
|
|
37765
37765
|
token
|
|
@@ -37778,7 +37778,7 @@ function indent(str, spaces) {
|
|
|
37778
37778
|
if (contextKeys.some(function(el) {
|
|
37779
37779
|
return el.startsWith(name);
|
|
37780
37780
|
})) {
|
|
37781
|
-
return
|
|
37781
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
|
|
37782
37782
|
}
|
|
37783
37783
|
if (dateTimeIdentifiers.some(function(el) {
|
|
37784
37784
|
return el === name;
|
|
@@ -37797,9 +37797,9 @@ function indent(str, spaces) {
|
|
|
37797
37797
|
if (dateTimeIdentifiers.some(function(el) {
|
|
37798
37798
|
return el.startsWith(name);
|
|
37799
37799
|
})) {
|
|
37800
|
-
return
|
|
37800
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, "continue";
|
|
37801
37801
|
}
|
|
37802
|
-
return
|
|
37802
|
+
return i = i1, tokens = tokens1, nextMatch = nextMatch1, {
|
|
37803
37803
|
v: nextMatch1
|
|
37804
37804
|
};
|
|
37805
37805
|
};
|
|
@@ -38663,7 +38663,7 @@ var parser = LRParser.deserialize({
|
|
|
38663
38663
|
2
|
|
38664
38664
|
],
|
|
38665
38665
|
repeatNodeCount: 14,
|
|
38666
|
-
tokenData: ".
|
|
38666
|
+
tokenData: ".V~RvXY#iYZ$^Z[#i]^$^pq#iqr$crs$nwx&bxy&gyz&lz{&q{|'O|}'T}!O'Y!O!P'g!P!Q(q!Q![*l![!]+T!]!^+Y!^!_+_!_!`$i!`!a+n!b!c+x!}#O+}#P#Q,S#Q#R&y#S#T,X#o#p-{#q#r.Q$f$g#i#BY#BZ#i$IS$I_#i$I|$I}$^$I}$JO$^$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~#nY#r~XY#iZ[#ipq#i$f$g#i#BY#BZ#i$IS$I_#i$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~$cO#s~~$fP!_!`$i~$nOr~~$qWOY$nZr$nrs%Zs#O$n#O#P%`#P;'S$n;'S;=`&[<%lO$n~%`O$j~~%cRO;'S$n;'S;=`%l;=`O$n~%oXOY$nZr$nrs%Zs#O$n#O#P%`#P;'S$n;'S;=`&[;=`<%l$n<%lO$n~&_P;=`<%l$n~&gO#{~~&lOv~~&qOx~~&vP^~z{&y~'OO_~~'TO[~~'YO$O~R'_PZP!`!a'bQ'gO$_Q~'lQ#z~!O!P'r!Q!['w~'wO#}~~'|R$i~!Q!['w!g!h(V#X#Y(V~(YR{|(c}!O(c!Q![(i~(fP!Q![(i~(nP$i~!Q![(i~(vQ]~z{(|!P!Q*T~)PTOz(|z{)`{;'S(|;'S;=`)}<%lO(|~)cVOz(|z{)`{!P(|!P!Q)x!Q;'S(|;'S;=`)}<%lO(|~)}OQ~~*QP;=`<%l(|~*YSP~OY*TZ;'S*T;'S;=`*f<%lO*T~*iP;=`<%l*T~*qS$i~!O!P*}!Q![*l!g!h(V#X#Y(V~+QP!Q!['w~+YO$]~~+_O$s~R+fP!]QsP!_!`+iP+nOsPR+uP!YQsP!_!`+i~+}O$l~~,SO!i~~,XO!g~~,[WOY,XZ#O,X#O#P,t#P#S,X#S#T-p#T;'S,X;'S;=`-u<%lO,X~,wRO;'S,X;'S;=`-Q;=`O,X~-TXOY,XZ#O,X#O#P,t#P#S,X#S#T-p#T;'S,X;'S;=`-u;=`<%l,X<%lO,X~-uO$Z~~-xP;=`<%l,X~.QO#S~~.VO#R~",
|
|
38667
38667
|
tokenizers: [
|
|
38668
38668
|
propertyIdentifiers,
|
|
38669
38669
|
identifiers,
|
|
@@ -39179,6 +39179,9 @@ function parseParameterNames(fn) {
|
|
|
39179
39179
|
function notImplemented(thing) {
|
|
39180
39180
|
return new Error("not implemented: ".concat(thing));
|
|
39181
39181
|
}
|
|
39182
|
+
function isNotImplemented(err) {
|
|
39183
|
+
return /^not implemented/.test(err.message);
|
|
39184
|
+
}
|
|
39182
39185
|
/**
|
|
39183
39186
|
* Returns a name from context or undefined if it does not exist.
|
|
39184
39187
|
*
|
|
@@ -39299,6 +39302,9 @@ var builtins = {
|
|
|
39299
39302
|
d = from;
|
|
39300
39303
|
}
|
|
39301
39304
|
if (year) {
|
|
39305
|
+
if (!isNumber(month) || !isNumber(day)) {
|
|
39306
|
+
return null;
|
|
39307
|
+
}
|
|
39302
39308
|
d = date().setZone("utc").set({
|
|
39303
39309
|
year: year,
|
|
39304
39310
|
month: month,
|
|
@@ -39353,7 +39359,7 @@ var builtins = {
|
|
|
39353
39359
|
from = hour;
|
|
39354
39360
|
hour = null;
|
|
39355
39361
|
}
|
|
39356
|
-
if (isString(from)) {
|
|
39362
|
+
if (isString(from) && from) {
|
|
39357
39363
|
t = date(null, from);
|
|
39358
39364
|
}
|
|
39359
39365
|
if (isDateTime(from)) {
|
|
@@ -39364,6 +39370,9 @@ var builtins = {
|
|
|
39364
39370
|
});
|
|
39365
39371
|
}
|
|
39366
39372
|
if (isNumber(hour)) {
|
|
39373
|
+
if (!isNumber(minute) || !isNumber(second)) {
|
|
39374
|
+
return null;
|
|
39375
|
+
}
|
|
39367
39376
|
// TODO: support offset = days and time duration
|
|
39368
39377
|
t = date().set({
|
|
39369
39378
|
hour: hour,
|
|
@@ -39473,7 +39482,8 @@ var builtins = {
|
|
|
39473
39482
|
"string"
|
|
39474
39483
|
]),
|
|
39475
39484
|
"replace": fn$1(function(input, pattern, replacement, flags) {
|
|
39476
|
-
|
|
39485
|
+
var regexp = createRegexp(pattern, flags || "", "g");
|
|
39486
|
+
return regexp && input.replace(regexp, replacement.replace(/\$0/g, "$$&"));
|
|
39477
39487
|
}, [
|
|
39478
39488
|
"string",
|
|
39479
39489
|
"string",
|
|
@@ -39486,9 +39496,9 @@ var builtins = {
|
|
|
39486
39496
|
"string",
|
|
39487
39497
|
"string"
|
|
39488
39498
|
]),
|
|
39489
|
-
// eslint-disable-next-line
|
|
39490
39499
|
"matches": fn$1(function(input, pattern, flags) {
|
|
39491
|
-
|
|
39500
|
+
var regexp = createRegexp(pattern, flags || "", "");
|
|
39501
|
+
return regexp && regexp.test(input);
|
|
39492
39502
|
}, [
|
|
39493
39503
|
"string",
|
|
39494
39504
|
"string",
|
|
@@ -39507,7 +39517,8 @@ var builtins = {
|
|
|
39507
39517
|
"string"
|
|
39508
39518
|
]),
|
|
39509
39519
|
"split": fn$1(function(string, delimiter) {
|
|
39510
|
-
|
|
39520
|
+
var regexp = createRegexp(delimiter, "", "");
|
|
39521
|
+
return regexp && string.split(regexp);
|
|
39511
39522
|
}, [
|
|
39512
39523
|
"string",
|
|
39513
39524
|
"string"
|
|
@@ -40423,6 +40434,35 @@ function mode(array) {
|
|
|
40423
40434
|
function ifValid(o) {
|
|
40424
40435
|
return o.isValid ? o : null;
|
|
40425
40436
|
}
|
|
40437
|
+
/**
|
|
40438
|
+
* Concatenates flags for a regular expression.
|
|
40439
|
+
*
|
|
40440
|
+
* Ensures that default flags are included without duplication, even if
|
|
40441
|
+
* user-specified flags overlap with the defaults.
|
|
40442
|
+
*/ function buildFlags(flags, defaultFlags) {
|
|
40443
|
+
var unsupportedFlags = flags.replace(/[smix]/g, "");
|
|
40444
|
+
if (unsupportedFlags) {
|
|
40445
|
+
throw new Error("illegal flags: " + unsupportedFlags);
|
|
40446
|
+
}
|
|
40447
|
+
// we don't implement the <x> flag
|
|
40448
|
+
if (/x/.test(flags)) {
|
|
40449
|
+
throw notImplemented("matches <x> flag");
|
|
40450
|
+
}
|
|
40451
|
+
return flags + defaultFlags;
|
|
40452
|
+
}
|
|
40453
|
+
/**
|
|
40454
|
+
* Creates a regular expression from a given pattern
|
|
40455
|
+
*/ function createRegexp(pattern, flags) {
|
|
40456
|
+
var defaultFlags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
|
|
40457
|
+
try {
|
|
40458
|
+
return new RegExp(pattern, "u" + buildFlags(flags, defaultFlags));
|
|
40459
|
+
} catch (_err) {
|
|
40460
|
+
if (isNotImplemented(_err)) {
|
|
40461
|
+
throw _err;
|
|
40462
|
+
}
|
|
40463
|
+
}
|
|
40464
|
+
return null;
|
|
40465
|
+
}
|
|
40426
40466
|
function parseExpression(expression) {
|
|
40427
40467
|
var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, dialect = arguments.length > 2 ? arguments[2] : void 0;
|
|
40428
40468
|
return parser.configure({
|
|
@@ -40877,27 +40917,59 @@ function evalNode(node, input, args) {
|
|
|
40877
40917
|
};
|
|
40878
40918
|
case "Type":
|
|
40879
40919
|
return args[0];
|
|
40920
|
+
// (x in [ [1,2], [3,4] ]), (y in x)
|
|
40880
40921
|
case "InExpressions":
|
|
40881
40922
|
return function(context) {
|
|
40882
|
-
|
|
40883
|
-
|
|
40884
|
-
|
|
40885
|
-
|
|
40886
|
-
|
|
40887
|
-
|
|
40888
|
-
|
|
40889
|
-
|
|
40890
|
-
|
|
40891
|
-
|
|
40892
|
-
|
|
40893
|
-
ctx = [
|
|
40894
|
-
ctx
|
|
40895
|
-
];
|
|
40923
|
+
// we build up evaluation contexts from left to right,
|
|
40924
|
+
// ending up with the cartesian product over all available contexts
|
|
40925
|
+
//
|
|
40926
|
+
// previous context is provided to later context providers
|
|
40927
|
+
// producing <null> as a context during evaluation causes the
|
|
40928
|
+
// whole result to turn <null>
|
|
40929
|
+
var isValidContexts = function(contexts) {
|
|
40930
|
+
if (contexts === null || contexts.some(function(arr) {
|
|
40931
|
+
return getType(arr) === "nil";
|
|
40932
|
+
})) {
|
|
40933
|
+
return false;
|
|
40896
40934
|
}
|
|
40897
|
-
return
|
|
40898
|
-
|
|
40899
|
-
|
|
40900
|
-
|
|
40935
|
+
return true;
|
|
40936
|
+
};
|
|
40937
|
+
var join = function(aContexts, bContextProducer) {
|
|
40938
|
+
var _instance;
|
|
40939
|
+
return (_instance = []).concat.apply(_instance, _to_consumable_array$b(aContexts.map(function(aContext) {
|
|
40940
|
+
var bContexts = bContextProducer(Object.assign(Object.assign({}, context), aContext));
|
|
40941
|
+
if (!isValidContexts(bContexts)) {
|
|
40942
|
+
return null;
|
|
40943
|
+
}
|
|
40944
|
+
return bContexts.map(function(bContext) {
|
|
40945
|
+
return Object.assign(Object.assign({}, aContext), bContext);
|
|
40946
|
+
});
|
|
40947
|
+
})));
|
|
40948
|
+
};
|
|
40949
|
+
var cartesian = function(aContexts, bContextProducer) {
|
|
40950
|
+
for(var _len = arguments.length, otherContextProducers = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
40951
|
+
otherContextProducers[_key - 2] = arguments[_key];
|
|
40952
|
+
}
|
|
40953
|
+
if (!isValidContexts(aContexts)) {
|
|
40954
|
+
return null;
|
|
40955
|
+
}
|
|
40956
|
+
if (!bContextProducer) {
|
|
40957
|
+
return aContexts;
|
|
40958
|
+
}
|
|
40959
|
+
return cartesian.apply(void 0, [
|
|
40960
|
+
join(aContexts, bContextProducer)
|
|
40961
|
+
].concat(_to_consumable_array$b(otherContextProducers)));
|
|
40962
|
+
};
|
|
40963
|
+
var cartesianProduct = function(contextProducers) {
|
|
40964
|
+
var _contextProducers = _to_array$1(contextProducers), aContextProducer = _contextProducers[0], otherContextProducers = _contextProducers.slice(1);
|
|
40965
|
+
var aContexts = aContextProducer(context);
|
|
40966
|
+
return cartesian.apply(void 0, [
|
|
40967
|
+
aContexts
|
|
40968
|
+
].concat(_to_consumable_array$b(otherContextProducers)));
|
|
40969
|
+
};
|
|
40970
|
+
var product = cartesianProduct(args);
|
|
40971
|
+
return product && product.map(function(p) {
|
|
40972
|
+
return Object.assign(Object.assign({}, context), p);
|
|
40901
40973
|
});
|
|
40902
40974
|
};
|
|
40903
40975
|
// Name kw<"in"> Expr
|
|
@@ -41527,31 +41599,6 @@ function createDateTimeRange(start, end, startIncluded, endIncluded) {
|
|
|
41527
41599
|
includes: includes
|
|
41528
41600
|
});
|
|
41529
41601
|
}
|
|
41530
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41531
|
-
function cartesianProduct(arrays) {
|
|
41532
|
-
var _instance;
|
|
41533
|
-
if (arrays.some(function(arr) {
|
|
41534
|
-
return getType(arr) === "nil";
|
|
41535
|
-
})) {
|
|
41536
|
-
return null;
|
|
41537
|
-
}
|
|
41538
|
-
var f = function(a, b) {
|
|
41539
|
-
return (_instance = []).concat.apply(_instance, _to_consumable_array$b(a.map(function(d) {
|
|
41540
|
-
return b.map(function(e) {
|
|
41541
|
-
return [].concat(d, e);
|
|
41542
|
-
});
|
|
41543
|
-
})));
|
|
41544
|
-
};
|
|
41545
|
-
var cartesian = function(a, b) {
|
|
41546
|
-
for(var _len = arguments.length, c = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
41547
|
-
c[_key - 2] = arguments[_key];
|
|
41548
|
-
}
|
|
41549
|
-
return b ? cartesian.apply(void 0, [
|
|
41550
|
-
f(a, b)
|
|
41551
|
-
].concat(_to_consumable_array$b(c))) : a || [];
|
|
41552
|
-
};
|
|
41553
|
-
return cartesian.apply(void 0, _to_consumable_array$b(arrays));
|
|
41554
|
-
}
|
|
41555
41602
|
function coalecenseTypes(a, b) {
|
|
41556
41603
|
if (!b) {
|
|
41557
41604
|
return a.type;
|
|
@@ -41613,15 +41660,24 @@ function parseString(str) {
|
|
|
41613
41660
|
if (str.endsWith('"')) {
|
|
41614
41661
|
str = str.slice(0, -1);
|
|
41615
41662
|
}
|
|
41616
|
-
return str.replace(/(\\")|(\\\\)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
|
|
41663
|
+
return str.replace(/(\\")|(\\\\)|(\\n)|(\\r)|(\\t)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
|
|
41617
41664
|
for(var _len = arguments.length, groups = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
41618
41665
|
groups[_key - 1] = arguments[_key];
|
|
41619
41666
|
}
|
|
41620
|
-
var _groups = _sliced_to_array$2(groups,
|
|
41667
|
+
var _groups = _sliced_to_array$2(groups, 7), quotes = _groups[0], backslash = _groups[1], newline = _groups[2], carriageReturn = _groups[3], tab = _groups[4], codePoint = _groups[5], charCodes = _groups[6];
|
|
41621
41668
|
if (quotes) {
|
|
41622
41669
|
return '"';
|
|
41623
41670
|
}
|
|
41624
|
-
if (
|
|
41671
|
+
if (newline) {
|
|
41672
|
+
return "\n";
|
|
41673
|
+
}
|
|
41674
|
+
if (carriageReturn) {
|
|
41675
|
+
return "\r";
|
|
41676
|
+
}
|
|
41677
|
+
if (tab) {
|
|
41678
|
+
return " ";
|
|
41679
|
+
}
|
|
41680
|
+
if (backslash) {
|
|
41625
41681
|
return "\\";
|
|
41626
41682
|
}
|
|
41627
41683
|
var escapePattern = /\\u([a-fA-F0-9]+)/ig;
|
package/index.esm2.js
CHANGED
|
@@ -37732,14 +37732,14 @@ function indent(str, spaces) {
|
|
|
37732
37732
|
var match = parseIdentifier(input, i1, namePart) || namePart && parseAdditionalSymbol(input, i1) || maybeSpace && parseSpaces(input, i1);
|
|
37733
37733
|
// match is required
|
|
37734
37734
|
if (!match) {
|
|
37735
|
-
return nextMatch = nextMatch1,
|
|
37735
|
+
return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
|
|
37736
37736
|
v: nextMatch1
|
|
37737
37737
|
};
|
|
37738
37738
|
}
|
|
37739
37739
|
var token = match.token, offset = match.offset;
|
|
37740
37740
|
i1 += offset;
|
|
37741
37741
|
if (token === " ") {
|
|
37742
|
-
return nextMatch = nextMatch1,
|
|
37742
|
+
return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
|
|
37743
37743
|
}
|
|
37744
37744
|
tokens1 = _to_consumable_array$c(tokens1).concat([
|
|
37745
37745
|
token
|
|
@@ -37758,7 +37758,7 @@ function indent(str, spaces) {
|
|
|
37758
37758
|
if (contextKeys.some(function(el) {
|
|
37759
37759
|
return el.startsWith(name);
|
|
37760
37760
|
})) {
|
|
37761
|
-
return nextMatch = nextMatch1,
|
|
37761
|
+
return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
|
|
37762
37762
|
}
|
|
37763
37763
|
if (dateTimeIdentifiers.some(function(el) {
|
|
37764
37764
|
return el === name;
|
|
@@ -37777,9 +37777,9 @@ function indent(str, spaces) {
|
|
|
37777
37777
|
if (dateTimeIdentifiers.some(function(el) {
|
|
37778
37778
|
return el.startsWith(name);
|
|
37779
37779
|
})) {
|
|
37780
|
-
return nextMatch = nextMatch1,
|
|
37780
|
+
return nextMatch = nextMatch1, i = i1, tokens = tokens1, "continue";
|
|
37781
37781
|
}
|
|
37782
|
-
return nextMatch = nextMatch1,
|
|
37782
|
+
return nextMatch = nextMatch1, i = i1, tokens = tokens1, {
|
|
37783
37783
|
v: nextMatch1
|
|
37784
37784
|
};
|
|
37785
37785
|
};
|
|
@@ -38643,7 +38643,7 @@ var parser = LRParser.deserialize({
|
|
|
38643
38643
|
2
|
|
38644
38644
|
],
|
|
38645
38645
|
repeatNodeCount: 14,
|
|
38646
|
-
tokenData: ".
|
|
38646
|
+
tokenData: ".V~RvXY#iYZ$^Z[#i]^$^pq#iqr$crs$nwx&bxy&gyz&lz{&q{|'O|}'T}!O'Y!O!P'g!P!Q(q!Q![*l![!]+T!]!^+Y!^!_+_!_!`$i!`!a+n!b!c+x!}#O+}#P#Q,S#Q#R&y#S#T,X#o#p-{#q#r.Q$f$g#i#BY#BZ#i$IS$I_#i$I|$I}$^$I}$JO$^$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~#nY#r~XY#iZ[#ipq#i$f$g#i#BY#BZ#i$IS$I_#i$JT$JU#i$KV$KW#i&FU&FV#i?HT?HU#i~$cO#s~~$fP!_!`$i~$nOr~~$qWOY$nZr$nrs%Zs#O$n#O#P%`#P;'S$n;'S;=`&[<%lO$n~%`O$j~~%cRO;'S$n;'S;=`%l;=`O$n~%oXOY$nZr$nrs%Zs#O$n#O#P%`#P;'S$n;'S;=`&[;=`<%l$n<%lO$n~&_P;=`<%l$n~&gO#{~~&lOv~~&qOx~~&vP^~z{&y~'OO_~~'TO[~~'YO$O~R'_PZP!`!a'bQ'gO$_Q~'lQ#z~!O!P'r!Q!['w~'wO#}~~'|R$i~!Q!['w!g!h(V#X#Y(V~(YR{|(c}!O(c!Q![(i~(fP!Q![(i~(nP$i~!Q![(i~(vQ]~z{(|!P!Q*T~)PTOz(|z{)`{;'S(|;'S;=`)}<%lO(|~)cVOz(|z{)`{!P(|!P!Q)x!Q;'S(|;'S;=`)}<%lO(|~)}OQ~~*QP;=`<%l(|~*YSP~OY*TZ;'S*T;'S;=`*f<%lO*T~*iP;=`<%l*T~*qS$i~!O!P*}!Q![*l!g!h(V#X#Y(V~+QP!Q!['w~+YO$]~~+_O$s~R+fP!]QsP!_!`+iP+nOsPR+uP!YQsP!_!`+i~+}O$l~~,SO!i~~,XO!g~~,[WOY,XZ#O,X#O#P,t#P#S,X#S#T-p#T;'S,X;'S;=`-u<%lO,X~,wRO;'S,X;'S;=`-Q;=`O,X~-TXOY,XZ#O,X#O#P,t#P#S,X#S#T-p#T;'S,X;'S;=`-u;=`<%l,X<%lO,X~-uO$Z~~-xP;=`<%l,X~.QO#S~~.VO#R~",
|
|
38647
38647
|
tokenizers: [
|
|
38648
38648
|
propertyIdentifiers,
|
|
38649
38649
|
identifiers,
|
|
@@ -39159,6 +39159,9 @@ function parseParameterNames(fn) {
|
|
|
39159
39159
|
function notImplemented(thing) {
|
|
39160
39160
|
return new Error("not implemented: ".concat(thing));
|
|
39161
39161
|
}
|
|
39162
|
+
function isNotImplemented(err) {
|
|
39163
|
+
return /^not implemented/.test(err.message);
|
|
39164
|
+
}
|
|
39162
39165
|
/**
|
|
39163
39166
|
* Returns a name from context or undefined if it does not exist.
|
|
39164
39167
|
*
|
|
@@ -39279,6 +39282,9 @@ var builtins = {
|
|
|
39279
39282
|
d = from;
|
|
39280
39283
|
}
|
|
39281
39284
|
if (year) {
|
|
39285
|
+
if (!isNumber(month) || !isNumber(day)) {
|
|
39286
|
+
return null;
|
|
39287
|
+
}
|
|
39282
39288
|
d = date().setZone("utc").set({
|
|
39283
39289
|
year: year,
|
|
39284
39290
|
month: month,
|
|
@@ -39333,7 +39339,7 @@ var builtins = {
|
|
|
39333
39339
|
from = hour;
|
|
39334
39340
|
hour = null;
|
|
39335
39341
|
}
|
|
39336
|
-
if (isString(from)) {
|
|
39342
|
+
if (isString(from) && from) {
|
|
39337
39343
|
t = date(null, from);
|
|
39338
39344
|
}
|
|
39339
39345
|
if (isDateTime(from)) {
|
|
@@ -39344,6 +39350,9 @@ var builtins = {
|
|
|
39344
39350
|
});
|
|
39345
39351
|
}
|
|
39346
39352
|
if (isNumber(hour)) {
|
|
39353
|
+
if (!isNumber(minute) || !isNumber(second)) {
|
|
39354
|
+
return null;
|
|
39355
|
+
}
|
|
39347
39356
|
// TODO: support offset = days and time duration
|
|
39348
39357
|
t = date().set({
|
|
39349
39358
|
hour: hour,
|
|
@@ -39453,7 +39462,8 @@ var builtins = {
|
|
|
39453
39462
|
"string"
|
|
39454
39463
|
]),
|
|
39455
39464
|
"replace": fn$1(function(input, pattern, replacement, flags) {
|
|
39456
|
-
|
|
39465
|
+
var regexp = createRegexp(pattern, flags || "", "g");
|
|
39466
|
+
return regexp && input.replace(regexp, replacement.replace(/\$0/g, "$$&"));
|
|
39457
39467
|
}, [
|
|
39458
39468
|
"string",
|
|
39459
39469
|
"string",
|
|
@@ -39466,9 +39476,9 @@ var builtins = {
|
|
|
39466
39476
|
"string",
|
|
39467
39477
|
"string"
|
|
39468
39478
|
]),
|
|
39469
|
-
// eslint-disable-next-line
|
|
39470
39479
|
"matches": fn$1(function(input, pattern, flags) {
|
|
39471
|
-
|
|
39480
|
+
var regexp = createRegexp(pattern, flags || "", "");
|
|
39481
|
+
return regexp && regexp.test(input);
|
|
39472
39482
|
}, [
|
|
39473
39483
|
"string",
|
|
39474
39484
|
"string",
|
|
@@ -39487,7 +39497,8 @@ var builtins = {
|
|
|
39487
39497
|
"string"
|
|
39488
39498
|
]),
|
|
39489
39499
|
"split": fn$1(function(string, delimiter) {
|
|
39490
|
-
|
|
39500
|
+
var regexp = createRegexp(delimiter, "", "");
|
|
39501
|
+
return regexp && string.split(regexp);
|
|
39491
39502
|
}, [
|
|
39492
39503
|
"string",
|
|
39493
39504
|
"string"
|
|
@@ -40403,6 +40414,35 @@ function mode(array) {
|
|
|
40403
40414
|
function ifValid(o) {
|
|
40404
40415
|
return o.isValid ? o : null;
|
|
40405
40416
|
}
|
|
40417
|
+
/**
|
|
40418
|
+
* Concatenates flags for a regular expression.
|
|
40419
|
+
*
|
|
40420
|
+
* Ensures that default flags are included without duplication, even if
|
|
40421
|
+
* user-specified flags overlap with the defaults.
|
|
40422
|
+
*/ function buildFlags(flags, defaultFlags) {
|
|
40423
|
+
var unsupportedFlags = flags.replace(/[smix]/g, "");
|
|
40424
|
+
if (unsupportedFlags) {
|
|
40425
|
+
throw new Error("illegal flags: " + unsupportedFlags);
|
|
40426
|
+
}
|
|
40427
|
+
// we don't implement the <x> flag
|
|
40428
|
+
if (/x/.test(flags)) {
|
|
40429
|
+
throw notImplemented("matches <x> flag");
|
|
40430
|
+
}
|
|
40431
|
+
return flags + defaultFlags;
|
|
40432
|
+
}
|
|
40433
|
+
/**
|
|
40434
|
+
* Creates a regular expression from a given pattern
|
|
40435
|
+
*/ function createRegexp(pattern, flags) {
|
|
40436
|
+
var defaultFlags = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
|
|
40437
|
+
try {
|
|
40438
|
+
return new RegExp(pattern, "u" + buildFlags(flags, defaultFlags));
|
|
40439
|
+
} catch (_err) {
|
|
40440
|
+
if (isNotImplemented(_err)) {
|
|
40441
|
+
throw _err;
|
|
40442
|
+
}
|
|
40443
|
+
}
|
|
40444
|
+
return null;
|
|
40445
|
+
}
|
|
40406
40446
|
function parseExpression(expression) {
|
|
40407
40447
|
var context = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, dialect = arguments.length > 2 ? arguments[2] : void 0;
|
|
40408
40448
|
return parser.configure({
|
|
@@ -40857,27 +40897,59 @@ function evalNode(node, input, args) {
|
|
|
40857
40897
|
};
|
|
40858
40898
|
case "Type":
|
|
40859
40899
|
return args[0];
|
|
40900
|
+
// (x in [ [1,2], [3,4] ]), (y in x)
|
|
40860
40901
|
case "InExpressions":
|
|
40861
40902
|
return function(context) {
|
|
40862
|
-
|
|
40863
|
-
|
|
40864
|
-
|
|
40865
|
-
|
|
40866
|
-
|
|
40867
|
-
|
|
40868
|
-
|
|
40869
|
-
|
|
40870
|
-
|
|
40871
|
-
|
|
40872
|
-
|
|
40873
|
-
ctx = [
|
|
40874
|
-
ctx
|
|
40875
|
-
];
|
|
40903
|
+
// we build up evaluation contexts from left to right,
|
|
40904
|
+
// ending up with the cartesian product over all available contexts
|
|
40905
|
+
//
|
|
40906
|
+
// previous context is provided to later context providers
|
|
40907
|
+
// producing <null> as a context during evaluation causes the
|
|
40908
|
+
// whole result to turn <null>
|
|
40909
|
+
var isValidContexts = function(contexts) {
|
|
40910
|
+
if (contexts === null || contexts.some(function(arr) {
|
|
40911
|
+
return getType(arr) === "nil";
|
|
40912
|
+
})) {
|
|
40913
|
+
return false;
|
|
40876
40914
|
}
|
|
40877
|
-
return
|
|
40878
|
-
|
|
40879
|
-
|
|
40880
|
-
|
|
40915
|
+
return true;
|
|
40916
|
+
};
|
|
40917
|
+
var join = function(aContexts, bContextProducer) {
|
|
40918
|
+
var _instance;
|
|
40919
|
+
return (_instance = []).concat.apply(_instance, _to_consumable_array$b(aContexts.map(function(aContext) {
|
|
40920
|
+
var bContexts = bContextProducer(Object.assign(Object.assign({}, context), aContext));
|
|
40921
|
+
if (!isValidContexts(bContexts)) {
|
|
40922
|
+
return null;
|
|
40923
|
+
}
|
|
40924
|
+
return bContexts.map(function(bContext) {
|
|
40925
|
+
return Object.assign(Object.assign({}, aContext), bContext);
|
|
40926
|
+
});
|
|
40927
|
+
})));
|
|
40928
|
+
};
|
|
40929
|
+
var cartesian = function(aContexts, bContextProducer) {
|
|
40930
|
+
for(var _len = arguments.length, otherContextProducers = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
40931
|
+
otherContextProducers[_key - 2] = arguments[_key];
|
|
40932
|
+
}
|
|
40933
|
+
if (!isValidContexts(aContexts)) {
|
|
40934
|
+
return null;
|
|
40935
|
+
}
|
|
40936
|
+
if (!bContextProducer) {
|
|
40937
|
+
return aContexts;
|
|
40938
|
+
}
|
|
40939
|
+
return cartesian.apply(void 0, [
|
|
40940
|
+
join(aContexts, bContextProducer)
|
|
40941
|
+
].concat(_to_consumable_array$b(otherContextProducers)));
|
|
40942
|
+
};
|
|
40943
|
+
var cartesianProduct = function(contextProducers) {
|
|
40944
|
+
var _contextProducers = _to_array$1(contextProducers), aContextProducer = _contextProducers[0], otherContextProducers = _contextProducers.slice(1);
|
|
40945
|
+
var aContexts = aContextProducer(context);
|
|
40946
|
+
return cartesian.apply(void 0, [
|
|
40947
|
+
aContexts
|
|
40948
|
+
].concat(_to_consumable_array$b(otherContextProducers)));
|
|
40949
|
+
};
|
|
40950
|
+
var product = cartesianProduct(args);
|
|
40951
|
+
return product && product.map(function(p) {
|
|
40952
|
+
return Object.assign(Object.assign({}, context), p);
|
|
40881
40953
|
});
|
|
40882
40954
|
};
|
|
40883
40955
|
// Name kw<"in"> Expr
|
|
@@ -41507,31 +41579,6 @@ function createDateTimeRange(start, end, startIncluded, endIncluded) {
|
|
|
41507
41579
|
includes: includes
|
|
41508
41580
|
});
|
|
41509
41581
|
}
|
|
41510
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41511
|
-
function cartesianProduct(arrays) {
|
|
41512
|
-
var _instance;
|
|
41513
|
-
if (arrays.some(function(arr) {
|
|
41514
|
-
return getType(arr) === "nil";
|
|
41515
|
-
})) {
|
|
41516
|
-
return null;
|
|
41517
|
-
}
|
|
41518
|
-
var f = function(a, b) {
|
|
41519
|
-
return (_instance = []).concat.apply(_instance, _to_consumable_array$b(a.map(function(d) {
|
|
41520
|
-
return b.map(function(e) {
|
|
41521
|
-
return [].concat(d, e);
|
|
41522
|
-
});
|
|
41523
|
-
})));
|
|
41524
|
-
};
|
|
41525
|
-
var cartesian = function(a, b) {
|
|
41526
|
-
for(var _len = arguments.length, c = new Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++){
|
|
41527
|
-
c[_key - 2] = arguments[_key];
|
|
41528
|
-
}
|
|
41529
|
-
return b ? cartesian.apply(void 0, [
|
|
41530
|
-
f(a, b)
|
|
41531
|
-
].concat(_to_consumable_array$b(c))) : a || [];
|
|
41532
|
-
};
|
|
41533
|
-
return cartesian.apply(void 0, _to_consumable_array$b(arrays));
|
|
41534
|
-
}
|
|
41535
41582
|
function coalecenseTypes(a, b) {
|
|
41536
41583
|
if (!b) {
|
|
41537
41584
|
return a.type;
|
|
@@ -41593,15 +41640,24 @@ function parseString(str) {
|
|
|
41593
41640
|
if (str.endsWith('"')) {
|
|
41594
41641
|
str = str.slice(0, -1);
|
|
41595
41642
|
}
|
|
41596
|
-
return str.replace(/(\\")|(\\\\)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
|
|
41643
|
+
return str.replace(/(\\")|(\\\\)|(\\n)|(\\r)|(\\t)|(\\u[a-fA-F0-9]{5,6})|((?:\\u[a-fA-F0-9]{1,4})+)/ig, function(substring) {
|
|
41597
41644
|
for(var _len = arguments.length, groups = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
41598
41645
|
groups[_key - 1] = arguments[_key];
|
|
41599
41646
|
}
|
|
41600
|
-
var _groups = _sliced_to_array$2(groups,
|
|
41647
|
+
var _groups = _sliced_to_array$2(groups, 7), quotes = _groups[0], backslash = _groups[1], newline = _groups[2], carriageReturn = _groups[3], tab = _groups[4], codePoint = _groups[5], charCodes = _groups[6];
|
|
41601
41648
|
if (quotes) {
|
|
41602
41649
|
return '"';
|
|
41603
41650
|
}
|
|
41604
|
-
if (
|
|
41651
|
+
if (newline) {
|
|
41652
|
+
return "\n";
|
|
41653
|
+
}
|
|
41654
|
+
if (carriageReturn) {
|
|
41655
|
+
return "\r";
|
|
41656
|
+
}
|
|
41657
|
+
if (tab) {
|
|
41658
|
+
return " ";
|
|
41659
|
+
}
|
|
41660
|
+
if (backslash) {
|
|
41605
41661
|
return "\\";
|
|
41606
41662
|
}
|
|
41607
41663
|
var escapePattern = /\\u([a-fA-F0-9]+)/ig;
|