@angular/compiler 15.1.0-next.1 → 15.1.0-next.3
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/esm2020/src/expression_parser/ast.mjs +13 -13
- package/esm2020/src/i18n/big_integer.mjs +7 -7
- package/esm2020/src/i18n/digest.mjs +93 -60
- package/esm2020/src/ml_parser/interpolation_config.mjs +5 -5
- package/esm2020/src/ml_parser/parser.mjs +4 -4
- package/esm2020/src/output/abstract_emitter.mjs +4 -4
- package/esm2020/src/render3/partial/class_metadata.mjs +1 -1
- package/esm2020/src/render3/partial/directive.mjs +1 -1
- package/esm2020/src/render3/partial/factory.mjs +1 -1
- package/esm2020/src/render3/partial/injectable.mjs +1 -1
- package/esm2020/src/render3/partial/injector.mjs +1 -1
- package/esm2020/src/render3/partial/ng_module.mjs +1 -1
- package/esm2020/src/render3/partial/pipe.mjs +1 -1
- package/esm2020/src/render3/view/i18n/context.mjs +1 -2
- package/esm2020/src/render3/view/template.mjs +6 -12
- package/esm2020/src/shadow_css.mjs +3 -2
- package/esm2020/src/version.mjs +1 -1
- package/fesm2015/compiler.mjs +265 -237
- package/fesm2015/compiler.mjs.map +1 -1
- package/fesm2015/testing.mjs +1 -1
- package/fesm2020/compiler.mjs +265 -237
- package/fesm2020/compiler.mjs.map +1 -1
- package/fesm2020/testing.mjs +1 -1
- package/index.d.ts +1 -1
- package/package.json +2 -2
- package/testing/index.d.ts +1 -1
package/fesm2015/compiler.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v15.0.
|
|
2
|
+
* @license Angular v15.1.0-next.3
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -658,135 +658,6 @@ var core = /*#__PURE__*/Object.freeze({
|
|
|
658
658
|
parseSelectorToR3Selector: parseSelectorToR3Selector
|
|
659
659
|
});
|
|
660
660
|
|
|
661
|
-
/**
|
|
662
|
-
* @license
|
|
663
|
-
* Copyright Google LLC All Rights Reserved.
|
|
664
|
-
*
|
|
665
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
666
|
-
* found in the LICENSE file at https://angular.io/license
|
|
667
|
-
*/
|
|
668
|
-
const DASH_CASE_REGEXP = /-+([a-z0-9])/g;
|
|
669
|
-
function dashCaseToCamelCase(input) {
|
|
670
|
-
return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
|
|
671
|
-
}
|
|
672
|
-
function splitAtColon(input, defaultValues) {
|
|
673
|
-
return _splitAt(input, ':', defaultValues);
|
|
674
|
-
}
|
|
675
|
-
function splitAtPeriod(input, defaultValues) {
|
|
676
|
-
return _splitAt(input, '.', defaultValues);
|
|
677
|
-
}
|
|
678
|
-
function _splitAt(input, character, defaultValues) {
|
|
679
|
-
const characterIndex = input.indexOf(character);
|
|
680
|
-
if (characterIndex == -1)
|
|
681
|
-
return defaultValues;
|
|
682
|
-
return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];
|
|
683
|
-
}
|
|
684
|
-
function noUndefined(val) {
|
|
685
|
-
return val === undefined ? null : val;
|
|
686
|
-
}
|
|
687
|
-
function error(msg) {
|
|
688
|
-
throw new Error(`Internal Error: ${msg}`);
|
|
689
|
-
}
|
|
690
|
-
// Escape characters that have a special meaning in Regular Expressions
|
|
691
|
-
function escapeRegExp(s) {
|
|
692
|
-
return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
|
|
693
|
-
}
|
|
694
|
-
function utf8Encode(str) {
|
|
695
|
-
let encoded = [];
|
|
696
|
-
for (let index = 0; index < str.length; index++) {
|
|
697
|
-
let codePoint = str.charCodeAt(index);
|
|
698
|
-
// decode surrogate
|
|
699
|
-
// see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
|
700
|
-
if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > (index + 1)) {
|
|
701
|
-
const low = str.charCodeAt(index + 1);
|
|
702
|
-
if (low >= 0xdc00 && low <= 0xdfff) {
|
|
703
|
-
index++;
|
|
704
|
-
codePoint = ((codePoint - 0xd800) << 10) + low - 0xdc00 + 0x10000;
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
if (codePoint <= 0x7f) {
|
|
708
|
-
encoded.push(codePoint);
|
|
709
|
-
}
|
|
710
|
-
else if (codePoint <= 0x7ff) {
|
|
711
|
-
encoded.push(((codePoint >> 6) & 0x1F) | 0xc0, (codePoint & 0x3f) | 0x80);
|
|
712
|
-
}
|
|
713
|
-
else if (codePoint <= 0xffff) {
|
|
714
|
-
encoded.push((codePoint >> 12) | 0xe0, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
|
|
715
|
-
}
|
|
716
|
-
else if (codePoint <= 0x1fffff) {
|
|
717
|
-
encoded.push(((codePoint >> 18) & 0x07) | 0xf0, ((codePoint >> 12) & 0x3f) | 0x80, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
|
|
718
|
-
}
|
|
719
|
-
}
|
|
720
|
-
return encoded;
|
|
721
|
-
}
|
|
722
|
-
function stringify(token) {
|
|
723
|
-
if (typeof token === 'string') {
|
|
724
|
-
return token;
|
|
725
|
-
}
|
|
726
|
-
if (Array.isArray(token)) {
|
|
727
|
-
return '[' + token.map(stringify).join(', ') + ']';
|
|
728
|
-
}
|
|
729
|
-
if (token == null) {
|
|
730
|
-
return '' + token;
|
|
731
|
-
}
|
|
732
|
-
if (token.overriddenName) {
|
|
733
|
-
return `${token.overriddenName}`;
|
|
734
|
-
}
|
|
735
|
-
if (token.name) {
|
|
736
|
-
return `${token.name}`;
|
|
737
|
-
}
|
|
738
|
-
if (!token.toString) {
|
|
739
|
-
return 'object';
|
|
740
|
-
}
|
|
741
|
-
// WARNING: do not try to `JSON.stringify(token)` here
|
|
742
|
-
// see https://github.com/angular/angular/issues/23440
|
|
743
|
-
const res = token.toString();
|
|
744
|
-
if (res == null) {
|
|
745
|
-
return '' + res;
|
|
746
|
-
}
|
|
747
|
-
const newLineIndex = res.indexOf('\n');
|
|
748
|
-
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
|
|
749
|
-
}
|
|
750
|
-
class Version {
|
|
751
|
-
constructor(full) {
|
|
752
|
-
this.full = full;
|
|
753
|
-
const splits = full.split('.');
|
|
754
|
-
this.major = splits[0];
|
|
755
|
-
this.minor = splits[1];
|
|
756
|
-
this.patch = splits.slice(2).join('.');
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
// Check `global` first, because in Node tests both `global` and `window` may be defined and our
|
|
760
|
-
// `_global` variable should point to the NodeJS `global` in that case. Note: Typeof/Instanceof
|
|
761
|
-
// checks are considered side-effects in Terser. We explicitly mark this as side-effect free:
|
|
762
|
-
// https://github.com/terser/terser/issues/250.
|
|
763
|
-
const _global = ( /* @__PURE__ */(() => (typeof global !== 'undefined' && global) || (typeof window !== 'undefined' && window) ||
|
|
764
|
-
(typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
|
|
765
|
-
self instanceof WorkerGlobalScope && self))());
|
|
766
|
-
function newArray(size, value) {
|
|
767
|
-
const list = [];
|
|
768
|
-
for (let i = 0; i < size; i++) {
|
|
769
|
-
list.push(value);
|
|
770
|
-
}
|
|
771
|
-
return list;
|
|
772
|
-
}
|
|
773
|
-
/**
|
|
774
|
-
* Partitions a given array into 2 arrays, based on a boolean value returned by the condition
|
|
775
|
-
* function.
|
|
776
|
-
*
|
|
777
|
-
* @param arr Input array that should be partitioned
|
|
778
|
-
* @param conditionFn Condition function that is called for each item in a given array and returns a
|
|
779
|
-
* boolean value.
|
|
780
|
-
*/
|
|
781
|
-
function partitionArray(arr, conditionFn) {
|
|
782
|
-
const truthy = [];
|
|
783
|
-
const falsy = [];
|
|
784
|
-
for (const item of arr) {
|
|
785
|
-
(conditionFn(item) ? truthy : falsy).push(item);
|
|
786
|
-
}
|
|
787
|
-
return [truthy, falsy];
|
|
788
|
-
}
|
|
789
|
-
|
|
790
661
|
/**
|
|
791
662
|
* @license
|
|
792
663
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -802,18 +673,18 @@ function partitionArray(arr, conditionFn) {
|
|
|
802
673
|
* to reduce memory pressure of allocation for the digits array.
|
|
803
674
|
*/
|
|
804
675
|
class BigInteger {
|
|
805
|
-
/**
|
|
806
|
-
* Creates a big integer using its individual digits in little endian storage.
|
|
807
|
-
*/
|
|
808
|
-
constructor(digits) {
|
|
809
|
-
this.digits = digits;
|
|
810
|
-
}
|
|
811
676
|
static zero() {
|
|
812
677
|
return new BigInteger([0]);
|
|
813
678
|
}
|
|
814
679
|
static one() {
|
|
815
680
|
return new BigInteger([1]);
|
|
816
681
|
}
|
|
682
|
+
/**
|
|
683
|
+
* Creates a big integer using its individual digits in little endian storage.
|
|
684
|
+
*/
|
|
685
|
+
constructor(digits) {
|
|
686
|
+
this.digits = digits;
|
|
687
|
+
}
|
|
817
688
|
/**
|
|
818
689
|
* Creates a clone of this instance.
|
|
819
690
|
*/
|
|
@@ -974,6 +845,10 @@ class BigIntExponentiation {
|
|
|
974
845
|
* Use of this source code is governed by an MIT-style license that can be
|
|
975
846
|
* found in the LICENSE file at https://angular.io/license
|
|
976
847
|
*/
|
|
848
|
+
/**
|
|
849
|
+
* A lazily created TextEncoder instance for converting strings into UTF-8 bytes
|
|
850
|
+
*/
|
|
851
|
+
let textEncoder;
|
|
977
852
|
/**
|
|
978
853
|
* Return the message id or compute it using the XLIFF1 digest.
|
|
979
854
|
*/
|
|
@@ -1057,10 +932,11 @@ class _SerializerIgnoreIcuExpVisitor extends _SerializerVisitor {
|
|
|
1057
932
|
* DO NOT USE IT IN A SECURITY SENSITIVE CONTEXT.
|
|
1058
933
|
*/
|
|
1059
934
|
function sha1(str) {
|
|
1060
|
-
|
|
935
|
+
textEncoder !== null && textEncoder !== void 0 ? textEncoder : (textEncoder = new TextEncoder());
|
|
936
|
+
const utf8 = [...textEncoder.encode(str)];
|
|
1061
937
|
const words32 = bytesToWords32(utf8, Endian.Big);
|
|
1062
938
|
const len = utf8.length * 8;
|
|
1063
|
-
const w =
|
|
939
|
+
const w = new Uint32Array(80);
|
|
1064
940
|
let a = 0x67452301, b = 0xefcdab89, c = 0x98badcfe, d = 0x10325476, e = 0xc3d2e1f0;
|
|
1065
941
|
words32[len >> 5] |= 0x80 << (24 - len % 32);
|
|
1066
942
|
words32[((len + 64 >> 9) << 4) + 15] = len;
|
|
@@ -1089,7 +965,17 @@ function sha1(str) {
|
|
|
1089
965
|
d = add32(d, h3);
|
|
1090
966
|
e = add32(e, h4);
|
|
1091
967
|
}
|
|
1092
|
-
|
|
968
|
+
// Convert the output parts to a 160-bit hexadecimal string
|
|
969
|
+
return toHexU32(a) + toHexU32(b) + toHexU32(c) + toHexU32(d) + toHexU32(e);
|
|
970
|
+
}
|
|
971
|
+
/**
|
|
972
|
+
* Convert and format a number as a string representing a 32-bit unsigned hexadecimal number.
|
|
973
|
+
* @param value The value to format as a string.
|
|
974
|
+
* @returns A hexadecimal string representing the value.
|
|
975
|
+
*/
|
|
976
|
+
function toHexU32(value) {
|
|
977
|
+
// unsigned right shift of zero ensures an unsigned 32-bit number
|
|
978
|
+
return (value >>> 0).toString(16).padStart(8, '0');
|
|
1093
979
|
}
|
|
1094
980
|
function fk(index, b, c, d) {
|
|
1095
981
|
if (index < 20) {
|
|
@@ -1112,9 +998,11 @@ function fk(index, b, c, d) {
|
|
|
1112
998
|
* https://github.com/google/closure-compiler/blob/master/src/com/google/javascript/jscomp/GoogleJsMessageIdGenerator.java
|
|
1113
999
|
*/
|
|
1114
1000
|
function fingerprint(str) {
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1001
|
+
textEncoder !== null && textEncoder !== void 0 ? textEncoder : (textEncoder = new TextEncoder());
|
|
1002
|
+
const utf8 = textEncoder.encode(str);
|
|
1003
|
+
const view = new DataView(utf8.buffer, utf8.byteOffset, utf8.byteLength);
|
|
1004
|
+
let hi = hash32(view, utf8.length, 0);
|
|
1005
|
+
let lo = hash32(view, utf8.length, 102072);
|
|
1118
1006
|
if (hi == 0 && (lo == 0 || lo == 1)) {
|
|
1119
1007
|
hi = hi ^ 0x130f9bef;
|
|
1120
1008
|
lo = lo ^ -0x6b5f56d8;
|
|
@@ -1131,52 +1019,92 @@ function computeMsgId(msg, meaning = '') {
|
|
|
1131
1019
|
const lo = msgFingerprint[1];
|
|
1132
1020
|
return wordsToDecimalString(hi & 0x7fffffff, lo);
|
|
1133
1021
|
}
|
|
1134
|
-
function hash32(
|
|
1022
|
+
function hash32(view, length, c) {
|
|
1135
1023
|
let a = 0x9e3779b9, b = 0x9e3779b9;
|
|
1136
|
-
let
|
|
1137
|
-
const
|
|
1138
|
-
for (
|
|
1139
|
-
a
|
|
1140
|
-
b
|
|
1141
|
-
c
|
|
1024
|
+
let index = 0;
|
|
1025
|
+
const end = length - 12;
|
|
1026
|
+
for (; index <= end; index += 12) {
|
|
1027
|
+
a += view.getUint32(index, true);
|
|
1028
|
+
b += view.getUint32(index + 4, true);
|
|
1029
|
+
c += view.getUint32(index + 8, true);
|
|
1142
1030
|
const res = mix(a, b, c);
|
|
1143
1031
|
a = res[0], b = res[1], c = res[2];
|
|
1144
1032
|
}
|
|
1145
|
-
|
|
1146
|
-
b = add32(b, wordAt(bytes, i + 4, Endian.Little));
|
|
1033
|
+
const remainder = length - index;
|
|
1147
1034
|
// the first byte of c is reserved for the length
|
|
1148
|
-
c
|
|
1149
|
-
|
|
1035
|
+
c += length;
|
|
1036
|
+
if (remainder >= 4) {
|
|
1037
|
+
a += view.getUint32(index, true);
|
|
1038
|
+
index += 4;
|
|
1039
|
+
if (remainder >= 8) {
|
|
1040
|
+
b += view.getUint32(index, true);
|
|
1041
|
+
index += 4;
|
|
1042
|
+
// Partial 32-bit word for c
|
|
1043
|
+
if (remainder >= 9) {
|
|
1044
|
+
c += view.getUint8(index++) << 8;
|
|
1045
|
+
}
|
|
1046
|
+
if (remainder >= 10) {
|
|
1047
|
+
c += view.getUint8(index++) << 16;
|
|
1048
|
+
}
|
|
1049
|
+
if (remainder === 11) {
|
|
1050
|
+
c += view.getUint8(index++) << 24;
|
|
1051
|
+
}
|
|
1052
|
+
}
|
|
1053
|
+
else {
|
|
1054
|
+
// Partial 32-bit word for b
|
|
1055
|
+
if (remainder >= 5) {
|
|
1056
|
+
b += view.getUint8(index++);
|
|
1057
|
+
}
|
|
1058
|
+
if (remainder >= 6) {
|
|
1059
|
+
b += view.getUint8(index++) << 8;
|
|
1060
|
+
}
|
|
1061
|
+
if (remainder === 7) {
|
|
1062
|
+
b += view.getUint8(index++) << 16;
|
|
1063
|
+
}
|
|
1064
|
+
}
|
|
1065
|
+
}
|
|
1066
|
+
else {
|
|
1067
|
+
// Partial 32-bit word for a
|
|
1068
|
+
if (remainder >= 1) {
|
|
1069
|
+
a += view.getUint8(index++);
|
|
1070
|
+
}
|
|
1071
|
+
if (remainder >= 2) {
|
|
1072
|
+
a += view.getUint8(index++) << 8;
|
|
1073
|
+
}
|
|
1074
|
+
if (remainder === 3) {
|
|
1075
|
+
a += view.getUint8(index++) << 16;
|
|
1076
|
+
}
|
|
1077
|
+
}
|
|
1150
1078
|
return mix(a, b, c)[2];
|
|
1151
1079
|
}
|
|
1152
1080
|
// clang-format off
|
|
1153
1081
|
function mix(a, b, c) {
|
|
1154
|
-
a
|
|
1155
|
-
a
|
|
1082
|
+
a -= b;
|
|
1083
|
+
a -= c;
|
|
1156
1084
|
a ^= c >>> 13;
|
|
1157
|
-
b
|
|
1158
|
-
b
|
|
1085
|
+
b -= c;
|
|
1086
|
+
b -= a;
|
|
1159
1087
|
b ^= a << 8;
|
|
1160
|
-
c
|
|
1161
|
-
c
|
|
1088
|
+
c -= a;
|
|
1089
|
+
c -= b;
|
|
1162
1090
|
c ^= b >>> 13;
|
|
1163
|
-
a
|
|
1164
|
-
a
|
|
1091
|
+
a -= b;
|
|
1092
|
+
a -= c;
|
|
1165
1093
|
a ^= c >>> 12;
|
|
1166
|
-
b
|
|
1167
|
-
b
|
|
1094
|
+
b -= c;
|
|
1095
|
+
b -= a;
|
|
1168
1096
|
b ^= a << 16;
|
|
1169
|
-
c
|
|
1170
|
-
c
|
|
1097
|
+
c -= a;
|
|
1098
|
+
c -= b;
|
|
1171
1099
|
c ^= b >>> 5;
|
|
1172
|
-
a
|
|
1173
|
-
a
|
|
1100
|
+
a -= b;
|
|
1101
|
+
a -= c;
|
|
1174
1102
|
a ^= c >>> 3;
|
|
1175
|
-
b
|
|
1176
|
-
b
|
|
1103
|
+
b -= c;
|
|
1104
|
+
b -= a;
|
|
1177
1105
|
b ^= a << 10;
|
|
1178
|
-
c
|
|
1179
|
-
c
|
|
1106
|
+
c -= a;
|
|
1107
|
+
c -= b;
|
|
1180
1108
|
c ^= b >>> 15;
|
|
1181
1109
|
return [a, b, c];
|
|
1182
1110
|
}
|
|
@@ -1204,11 +1132,6 @@ function add64(a, b) {
|
|
|
1204
1132
|
const h = add32(add32(ah, bh), carry);
|
|
1205
1133
|
return [h, l];
|
|
1206
1134
|
}
|
|
1207
|
-
function sub32(a, b) {
|
|
1208
|
-
const low = (a & 0xffff) - (b & 0xffff);
|
|
1209
|
-
const high = (a >> 16) - (b >> 16) + (low >> 16);
|
|
1210
|
-
return (high << 16) | (low & 0xffff);
|
|
1211
|
-
}
|
|
1212
1135
|
// Rotate a 32b number left `count` position
|
|
1213
1136
|
function rol32(a, count) {
|
|
1214
1137
|
return (a << count) | (a >>> (32 - count));
|
|
@@ -1245,24 +1168,6 @@ function wordAt(bytes, index, endian) {
|
|
|
1245
1168
|
}
|
|
1246
1169
|
return word;
|
|
1247
1170
|
}
|
|
1248
|
-
function words32ToByteString(words32) {
|
|
1249
|
-
return words32.reduce((bytes, word) => bytes.concat(word32ToByteString(word)), []);
|
|
1250
|
-
}
|
|
1251
|
-
function word32ToByteString(word) {
|
|
1252
|
-
let bytes = [];
|
|
1253
|
-
for (let i = 0; i < 4; i++) {
|
|
1254
|
-
bytes.push((word >>> 8 * (3 - i)) & 0xff);
|
|
1255
|
-
}
|
|
1256
|
-
return bytes;
|
|
1257
|
-
}
|
|
1258
|
-
function bytesToHexString(bytes) {
|
|
1259
|
-
let hex = '';
|
|
1260
|
-
for (let i = 0; i < bytes.length; i++) {
|
|
1261
|
-
const b = byteAt(bytes, i);
|
|
1262
|
-
hex += (b >>> 4).toString(16) + (b & 0x0f).toString(16);
|
|
1263
|
-
}
|
|
1264
|
-
return hex.toLowerCase();
|
|
1265
|
-
}
|
|
1266
1171
|
/**
|
|
1267
1172
|
* Create a shared exponentiation pool for base-256 computations. This shared pool provides memoized
|
|
1268
1173
|
* power-of-256 results with memoized power-of-two computations for efficient multiplication.
|
|
@@ -2943,6 +2848,135 @@ Identifiers.trustConstantHtml = { name: 'ɵɵtrustConstantHtml', moduleName: COR
|
|
|
2943
2848
|
Identifiers.trustConstantResourceUrl = { name: 'ɵɵtrustConstantResourceUrl', moduleName: CORE };
|
|
2944
2849
|
Identifiers.validateIframeAttribute = { name: 'ɵɵvalidateIframeAttribute', moduleName: CORE };
|
|
2945
2850
|
|
|
2851
|
+
/**
|
|
2852
|
+
* @license
|
|
2853
|
+
* Copyright Google LLC All Rights Reserved.
|
|
2854
|
+
*
|
|
2855
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
2856
|
+
* found in the LICENSE file at https://angular.io/license
|
|
2857
|
+
*/
|
|
2858
|
+
const DASH_CASE_REGEXP = /-+([a-z0-9])/g;
|
|
2859
|
+
function dashCaseToCamelCase(input) {
|
|
2860
|
+
return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
|
|
2861
|
+
}
|
|
2862
|
+
function splitAtColon(input, defaultValues) {
|
|
2863
|
+
return _splitAt(input, ':', defaultValues);
|
|
2864
|
+
}
|
|
2865
|
+
function splitAtPeriod(input, defaultValues) {
|
|
2866
|
+
return _splitAt(input, '.', defaultValues);
|
|
2867
|
+
}
|
|
2868
|
+
function _splitAt(input, character, defaultValues) {
|
|
2869
|
+
const characterIndex = input.indexOf(character);
|
|
2870
|
+
if (characterIndex == -1)
|
|
2871
|
+
return defaultValues;
|
|
2872
|
+
return [input.slice(0, characterIndex).trim(), input.slice(characterIndex + 1).trim()];
|
|
2873
|
+
}
|
|
2874
|
+
function noUndefined(val) {
|
|
2875
|
+
return val === undefined ? null : val;
|
|
2876
|
+
}
|
|
2877
|
+
function error(msg) {
|
|
2878
|
+
throw new Error(`Internal Error: ${msg}`);
|
|
2879
|
+
}
|
|
2880
|
+
// Escape characters that have a special meaning in Regular Expressions
|
|
2881
|
+
function escapeRegExp(s) {
|
|
2882
|
+
return s.replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
|
|
2883
|
+
}
|
|
2884
|
+
function utf8Encode(str) {
|
|
2885
|
+
let encoded = [];
|
|
2886
|
+
for (let index = 0; index < str.length; index++) {
|
|
2887
|
+
let codePoint = str.charCodeAt(index);
|
|
2888
|
+
// decode surrogate
|
|
2889
|
+
// see https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
|
|
2890
|
+
if (codePoint >= 0xd800 && codePoint <= 0xdbff && str.length > (index + 1)) {
|
|
2891
|
+
const low = str.charCodeAt(index + 1);
|
|
2892
|
+
if (low >= 0xdc00 && low <= 0xdfff) {
|
|
2893
|
+
index++;
|
|
2894
|
+
codePoint = ((codePoint - 0xd800) << 10) + low - 0xdc00 + 0x10000;
|
|
2895
|
+
}
|
|
2896
|
+
}
|
|
2897
|
+
if (codePoint <= 0x7f) {
|
|
2898
|
+
encoded.push(codePoint);
|
|
2899
|
+
}
|
|
2900
|
+
else if (codePoint <= 0x7ff) {
|
|
2901
|
+
encoded.push(((codePoint >> 6) & 0x1F) | 0xc0, (codePoint & 0x3f) | 0x80);
|
|
2902
|
+
}
|
|
2903
|
+
else if (codePoint <= 0xffff) {
|
|
2904
|
+
encoded.push((codePoint >> 12) | 0xe0, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
|
|
2905
|
+
}
|
|
2906
|
+
else if (codePoint <= 0x1fffff) {
|
|
2907
|
+
encoded.push(((codePoint >> 18) & 0x07) | 0xf0, ((codePoint >> 12) & 0x3f) | 0x80, ((codePoint >> 6) & 0x3f) | 0x80, (codePoint & 0x3f) | 0x80);
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
return encoded;
|
|
2911
|
+
}
|
|
2912
|
+
function stringify(token) {
|
|
2913
|
+
if (typeof token === 'string') {
|
|
2914
|
+
return token;
|
|
2915
|
+
}
|
|
2916
|
+
if (Array.isArray(token)) {
|
|
2917
|
+
return '[' + token.map(stringify).join(', ') + ']';
|
|
2918
|
+
}
|
|
2919
|
+
if (token == null) {
|
|
2920
|
+
return '' + token;
|
|
2921
|
+
}
|
|
2922
|
+
if (token.overriddenName) {
|
|
2923
|
+
return `${token.overriddenName}`;
|
|
2924
|
+
}
|
|
2925
|
+
if (token.name) {
|
|
2926
|
+
return `${token.name}`;
|
|
2927
|
+
}
|
|
2928
|
+
if (!token.toString) {
|
|
2929
|
+
return 'object';
|
|
2930
|
+
}
|
|
2931
|
+
// WARNING: do not try to `JSON.stringify(token)` here
|
|
2932
|
+
// see https://github.com/angular/angular/issues/23440
|
|
2933
|
+
const res = token.toString();
|
|
2934
|
+
if (res == null) {
|
|
2935
|
+
return '' + res;
|
|
2936
|
+
}
|
|
2937
|
+
const newLineIndex = res.indexOf('\n');
|
|
2938
|
+
return newLineIndex === -1 ? res : res.substring(0, newLineIndex);
|
|
2939
|
+
}
|
|
2940
|
+
class Version {
|
|
2941
|
+
constructor(full) {
|
|
2942
|
+
this.full = full;
|
|
2943
|
+
const splits = full.split('.');
|
|
2944
|
+
this.major = splits[0];
|
|
2945
|
+
this.minor = splits[1];
|
|
2946
|
+
this.patch = splits.slice(2).join('.');
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
// Check `global` first, because in Node tests both `global` and `window` may be defined and our
|
|
2950
|
+
// `_global` variable should point to the NodeJS `global` in that case. Note: Typeof/Instanceof
|
|
2951
|
+
// checks are considered side-effects in Terser. We explicitly mark this as side-effect free:
|
|
2952
|
+
// https://github.com/terser/terser/issues/250.
|
|
2953
|
+
const _global = ( /* @__PURE__ */(() => (typeof global !== 'undefined' && global) || (typeof window !== 'undefined' && window) ||
|
|
2954
|
+
(typeof self !== 'undefined' && typeof WorkerGlobalScope !== 'undefined' &&
|
|
2955
|
+
self instanceof WorkerGlobalScope && self))());
|
|
2956
|
+
function newArray(size, value) {
|
|
2957
|
+
const list = [];
|
|
2958
|
+
for (let i = 0; i < size; i++) {
|
|
2959
|
+
list.push(value);
|
|
2960
|
+
}
|
|
2961
|
+
return list;
|
|
2962
|
+
}
|
|
2963
|
+
/**
|
|
2964
|
+
* Partitions a given array into 2 arrays, based on a boolean value returned by the condition
|
|
2965
|
+
* function.
|
|
2966
|
+
*
|
|
2967
|
+
* @param arr Input array that should be partitioned
|
|
2968
|
+
* @param conditionFn Condition function that is called for each item in a given array and returns a
|
|
2969
|
+
* boolean value.
|
|
2970
|
+
*/
|
|
2971
|
+
function partitionArray(arr, conditionFn) {
|
|
2972
|
+
const truthy = [];
|
|
2973
|
+
const falsy = [];
|
|
2974
|
+
for (const item of arr) {
|
|
2975
|
+
(conditionFn(item) ? truthy : falsy).push(item);
|
|
2976
|
+
}
|
|
2977
|
+
return [truthy, falsy];
|
|
2978
|
+
}
|
|
2979
|
+
|
|
2946
2980
|
/**
|
|
2947
2981
|
* @license
|
|
2948
2982
|
* Copyright Google LLC All Rights Reserved.
|
|
@@ -3111,13 +3145,13 @@ class _EmittedLine {
|
|
|
3111
3145
|
}
|
|
3112
3146
|
}
|
|
3113
3147
|
class EmitterVisitorContext {
|
|
3148
|
+
static createRoot() {
|
|
3149
|
+
return new EmitterVisitorContext(0);
|
|
3150
|
+
}
|
|
3114
3151
|
constructor(_indent) {
|
|
3115
3152
|
this._indent = _indent;
|
|
3116
3153
|
this._lines = [new _EmittedLine(_indent)];
|
|
3117
3154
|
}
|
|
3118
|
-
static createRoot() {
|
|
3119
|
-
return new EmitterVisitorContext(0);
|
|
3120
|
-
}
|
|
3121
3155
|
/**
|
|
3122
3156
|
* @internal strip this from published d.ts files due to
|
|
3123
3157
|
* https://github.com/microsoft/TypeScript/issues/36216
|
|
@@ -5293,10 +5327,6 @@ function assertInterpolationSymbols(identifier, value) {
|
|
|
5293
5327
|
* found in the LICENSE file at https://angular.io/license
|
|
5294
5328
|
*/
|
|
5295
5329
|
class InterpolationConfig {
|
|
5296
|
-
constructor(start, end) {
|
|
5297
|
-
this.start = start;
|
|
5298
|
-
this.end = end;
|
|
5299
|
-
}
|
|
5300
5330
|
static fromArray(markers) {
|
|
5301
5331
|
if (!markers) {
|
|
5302
5332
|
return DEFAULT_INTERPOLATION_CONFIG;
|
|
@@ -5304,6 +5334,10 @@ class InterpolationConfig {
|
|
|
5304
5334
|
assertInterpolationSymbols('interpolation', markers);
|
|
5305
5335
|
return new InterpolationConfig(markers[0], markers[1]);
|
|
5306
5336
|
}
|
|
5337
|
+
constructor(start, end) {
|
|
5338
|
+
this.start = start;
|
|
5339
|
+
this.end = end;
|
|
5340
|
+
}
|
|
5307
5341
|
}
|
|
5308
5342
|
const DEFAULT_INTERPOLATION_CONFIG = new InterpolationConfig('{{', '}}');
|
|
5309
5343
|
|
|
@@ -6404,6 +6438,18 @@ class Binary extends AST {
|
|
|
6404
6438
|
* after consumers have been given a chance to fully support Unary.
|
|
6405
6439
|
*/
|
|
6406
6440
|
class Unary extends Binary {
|
|
6441
|
+
/**
|
|
6442
|
+
* Creates a unary minus expression "-x", represented as `Binary` using "0 - x".
|
|
6443
|
+
*/
|
|
6444
|
+
static createMinus(span, sourceSpan, expr) {
|
|
6445
|
+
return new Unary(span, sourceSpan, '-', expr, '-', new LiteralPrimitive(span, sourceSpan, 0), expr);
|
|
6446
|
+
}
|
|
6447
|
+
/**
|
|
6448
|
+
* Creates a unary plus expression "+x", represented as `Binary` using "x - 0".
|
|
6449
|
+
*/
|
|
6450
|
+
static createPlus(span, sourceSpan, expr) {
|
|
6451
|
+
return new Unary(span, sourceSpan, '+', expr, '-', expr, new LiteralPrimitive(span, sourceSpan, 0));
|
|
6452
|
+
}
|
|
6407
6453
|
/**
|
|
6408
6454
|
* During the deprecation period this constructor is private, to avoid consumers from creating
|
|
6409
6455
|
* a `Unary` with the fallback properties for `Binary`.
|
|
@@ -6418,18 +6464,6 @@ class Unary extends Binary {
|
|
|
6418
6464
|
this.right = null;
|
|
6419
6465
|
this.operation = null;
|
|
6420
6466
|
}
|
|
6421
|
-
/**
|
|
6422
|
-
* Creates a unary minus expression "-x", represented as `Binary` using "0 - x".
|
|
6423
|
-
*/
|
|
6424
|
-
static createMinus(span, sourceSpan, expr) {
|
|
6425
|
-
return new Unary(span, sourceSpan, '-', expr, '-', new LiteralPrimitive(span, sourceSpan, 0), expr);
|
|
6426
|
-
}
|
|
6427
|
-
/**
|
|
6428
|
-
* Creates a unary plus expression "+x", represented as `Binary` using "x - 0".
|
|
6429
|
-
*/
|
|
6430
|
-
static createPlus(span, sourceSpan, expr) {
|
|
6431
|
-
return new Unary(span, sourceSpan, '+', expr, '-', expr, new LiteralPrimitive(span, sourceSpan, 0));
|
|
6432
|
-
}
|
|
6433
6467
|
visit(visitor, context = null) {
|
|
6434
6468
|
if (visitor.visitUnary !== undefined) {
|
|
6435
6469
|
return visitor.visitUnary(this, context);
|
|
@@ -8290,7 +8324,8 @@ class ShadowCss {
|
|
|
8290
8324
|
this._scopeSelector(rule.selector, scopeSelector, hostSelector, this.strictStyling);
|
|
8291
8325
|
}
|
|
8292
8326
|
else if (rule.selector.startsWith('@media') || rule.selector.startsWith('@supports') ||
|
|
8293
|
-
rule.selector.startsWith('@document') || rule.selector.startsWith('@layer')
|
|
8327
|
+
rule.selector.startsWith('@document') || rule.selector.startsWith('@layer') ||
|
|
8328
|
+
rule.selector.startsWith('@container')) {
|
|
8294
8329
|
content = this._scopeSelectors(rule.content, scopeSelector, hostSelector);
|
|
8295
8330
|
}
|
|
8296
8331
|
else if (rule.selector.startsWith('@font-face') || rule.selector.startsWith('@page')) {
|
|
@@ -14332,13 +14367,13 @@ class CursorError {
|
|
|
14332
14367
|
* found in the LICENSE file at https://angular.io/license
|
|
14333
14368
|
*/
|
|
14334
14369
|
class TreeError extends ParseError {
|
|
14370
|
+
static create(elementName, span, msg) {
|
|
14371
|
+
return new TreeError(elementName, span, msg);
|
|
14372
|
+
}
|
|
14335
14373
|
constructor(elementName, span, msg) {
|
|
14336
14374
|
super(span, msg);
|
|
14337
14375
|
this.elementName = elementName;
|
|
14338
14376
|
}
|
|
14339
|
-
static create(elementName, span, msg) {
|
|
14340
|
-
return new TreeError(elementName, span, msg);
|
|
14341
|
-
}
|
|
14342
14377
|
}
|
|
14343
14378
|
class ParseTreeResult {
|
|
14344
14379
|
constructor(rootNodes, errors) {
|
|
@@ -16477,7 +16512,6 @@ function findTemplateFn(ctx, templateIndex) {
|
|
|
16477
16512
|
function serializePlaceholderValue(value) {
|
|
16478
16513
|
const element = (data, closed) => wrapTag('#', data, closed);
|
|
16479
16514
|
const template = (data, closed) => wrapTag('*', data, closed);
|
|
16480
|
-
const projection = (data, closed) => wrapTag('!', data, closed);
|
|
16481
16515
|
switch (value.type) {
|
|
16482
16516
|
case TagType.ELEMENT:
|
|
16483
16517
|
// close element tag
|
|
@@ -18411,7 +18445,7 @@ class TemplateDefinitionBuilder {
|
|
|
18411
18445
|
if (!references || references.length === 0) {
|
|
18412
18446
|
return TYPED_NULL_EXPR;
|
|
18413
18447
|
}
|
|
18414
|
-
const refsParam =
|
|
18448
|
+
const refsParam = references.flatMap(reference => {
|
|
18415
18449
|
const slot = this.allocateDataSlot();
|
|
18416
18450
|
// Generate the update temporary.
|
|
18417
18451
|
const variableName = this._bindingScope.freshReferenceName();
|
|
@@ -18425,7 +18459,7 @@ class TemplateDefinitionBuilder {
|
|
|
18425
18459
|
return nextContextStmt.concat(refExpr.toConstDecl());
|
|
18426
18460
|
}, true);
|
|
18427
18461
|
return [reference.name, reference.value];
|
|
18428
|
-
})
|
|
18462
|
+
});
|
|
18429
18463
|
return asLiteral(refsParam);
|
|
18430
18464
|
}
|
|
18431
18465
|
prepareListenerParameter(tagName, outputAst, index) {
|
|
@@ -18559,6 +18593,9 @@ function getAttributeNameLiterals(name) {
|
|
|
18559
18593
|
/** The prefix used to get a shared context in BindingScope's map. */
|
|
18560
18594
|
const SHARED_CONTEXT_KEY = '$$shared_ctx$$';
|
|
18561
18595
|
class BindingScope {
|
|
18596
|
+
static createRootScope() {
|
|
18597
|
+
return new BindingScope();
|
|
18598
|
+
}
|
|
18562
18599
|
constructor(bindingLevel = 0, parent = null, globals) {
|
|
18563
18600
|
this.bindingLevel = bindingLevel;
|
|
18564
18601
|
this.parent = parent;
|
|
@@ -18574,9 +18611,6 @@ class BindingScope {
|
|
|
18574
18611
|
}
|
|
18575
18612
|
}
|
|
18576
18613
|
}
|
|
18577
|
-
static createRootScope() {
|
|
18578
|
-
return new BindingScope();
|
|
18579
|
-
}
|
|
18580
18614
|
get(name) {
|
|
18581
18615
|
let current = this;
|
|
18582
18616
|
while (current) {
|
|
@@ -19076,12 +19110,6 @@ function createClosureModeGuard() {
|
|
|
19076
19110
|
.notIdentical(literal('undefined', STRING_TYPE))
|
|
19077
19111
|
.and(variable(NG_I18N_CLOSURE_MODE));
|
|
19078
19112
|
}
|
|
19079
|
-
function flatten(list) {
|
|
19080
|
-
return list.reduce((flat, item) => {
|
|
19081
|
-
const flatItem = Array.isArray(item) ? flatten(item) : item;
|
|
19082
|
-
return flat.concat(flatItem);
|
|
19083
|
-
}, []);
|
|
19084
|
-
}
|
|
19085
19113
|
|
|
19086
19114
|
/**
|
|
19087
19115
|
* @license
|
|
@@ -20292,7 +20320,7 @@ function publishFacade(global) {
|
|
|
20292
20320
|
* Use of this source code is governed by an MIT-style license that can be
|
|
20293
20321
|
* found in the LICENSE file at https://angular.io/license
|
|
20294
20322
|
*/
|
|
20295
|
-
const VERSION = new Version('15.1.0-next.
|
|
20323
|
+
const VERSION = new Version('15.1.0-next.3');
|
|
20296
20324
|
|
|
20297
20325
|
/**
|
|
20298
20326
|
* @license
|
|
@@ -22318,7 +22346,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$6 = '12.0.0';
|
|
|
22318
22346
|
function compileDeclareClassMetadata(metadata) {
|
|
22319
22347
|
const definitionMap = new DefinitionMap();
|
|
22320
22348
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$6));
|
|
22321
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22349
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22322
22350
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22323
22351
|
definitionMap.set('type', metadata.type);
|
|
22324
22352
|
definitionMap.set('decorators', metadata.decorators);
|
|
@@ -22436,7 +22464,7 @@ function createDirectiveDefinitionMap(meta) {
|
|
|
22436
22464
|
var _a;
|
|
22437
22465
|
const definitionMap = new DefinitionMap();
|
|
22438
22466
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$5));
|
|
22439
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22467
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22440
22468
|
// e.g. `type: MyDirective`
|
|
22441
22469
|
definitionMap.set('type', meta.internalType);
|
|
22442
22470
|
if (meta.isStandalone) {
|
|
@@ -22675,7 +22703,7 @@ const MINIMUM_PARTIAL_LINKER_VERSION$4 = '12.0.0';
|
|
|
22675
22703
|
function compileDeclareFactoryFunction(meta) {
|
|
22676
22704
|
const definitionMap = new DefinitionMap();
|
|
22677
22705
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$4));
|
|
22678
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22706
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22679
22707
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22680
22708
|
definitionMap.set('type', meta.internalType);
|
|
22681
22709
|
definitionMap.set('deps', compileDependencies(meta.deps));
|
|
@@ -22717,7 +22745,7 @@ function compileDeclareInjectableFromMetadata(meta) {
|
|
|
22717
22745
|
function createInjectableDefinitionMap(meta) {
|
|
22718
22746
|
const definitionMap = new DefinitionMap();
|
|
22719
22747
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$3));
|
|
22720
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22748
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22721
22749
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22722
22750
|
definitionMap.set('type', meta.internalType);
|
|
22723
22751
|
// Only generate providedIn property if it has a non-null value
|
|
@@ -22775,7 +22803,7 @@ function compileDeclareInjectorFromMetadata(meta) {
|
|
|
22775
22803
|
function createInjectorDefinitionMap(meta) {
|
|
22776
22804
|
const definitionMap = new DefinitionMap();
|
|
22777
22805
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$2));
|
|
22778
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22806
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22779
22807
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22780
22808
|
definitionMap.set('type', meta.internalType);
|
|
22781
22809
|
definitionMap.set('providers', meta.providers);
|
|
@@ -22812,7 +22840,7 @@ function compileDeclareNgModuleFromMetadata(meta) {
|
|
|
22812
22840
|
function createNgModuleDefinitionMap(meta) {
|
|
22813
22841
|
const definitionMap = new DefinitionMap();
|
|
22814
22842
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION$1));
|
|
22815
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22843
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22816
22844
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22817
22845
|
definitionMap.set('type', meta.internalType);
|
|
22818
22846
|
// We only generate the keys in the metadata if the arrays contain values.
|
|
@@ -22870,7 +22898,7 @@ function compileDeclarePipeFromMetadata(meta) {
|
|
|
22870
22898
|
function createPipeDefinitionMap(meta) {
|
|
22871
22899
|
const definitionMap = new DefinitionMap();
|
|
22872
22900
|
definitionMap.set('minVersion', literal(MINIMUM_PARTIAL_LINKER_VERSION));
|
|
22873
|
-
definitionMap.set('version', literal('15.1.0-next.
|
|
22901
|
+
definitionMap.set('version', literal('15.1.0-next.3'));
|
|
22874
22902
|
definitionMap.set('ngImport', importExpr(Identifiers.core));
|
|
22875
22903
|
// e.g. `type: MyPipe`
|
|
22876
22904
|
definitionMap.set('type', meta.internalType);
|