@kubb/core 3.0.0-alpha.16 → 3.0.0-alpha.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (106) hide show
  1. package/README.md +0 -4
  2. package/dist/{chunk-IS3U2E4B.js → chunk-7PAEMBYT.js} +2 -2
  3. package/dist/{chunk-IS3U2E4B.js.map → chunk-7PAEMBYT.js.map} +1 -1
  4. package/dist/{chunk-UEIL3SRH.cjs → chunk-E43AVT66.cjs} +4 -4
  5. package/dist/{chunk-UEIL3SRH.cjs.map → chunk-E43AVT66.cjs.map} +1 -1
  6. package/dist/{chunk-JSL2IBGJ.js → chunk-E6CN2CZC.js} +3 -3
  7. package/dist/{chunk-JSL2IBGJ.js.map → chunk-E6CN2CZC.js.map} +1 -1
  8. package/dist/{chunk-Q7NER2U2.cjs → chunk-EUAXE6GO.cjs} +6 -6
  9. package/dist/{chunk-Q7NER2U2.cjs.map → chunk-EUAXE6GO.cjs.map} +1 -1
  10. package/dist/{chunk-ZEL4DI72.js → chunk-HBQM723K.js} +3 -3
  11. package/dist/{chunk-ZEL4DI72.js.map → chunk-HBQM723K.js.map} +1 -1
  12. package/dist/{chunk-CLBBHMA3.cjs → chunk-JADTPS46.cjs} +8 -8
  13. package/dist/{chunk-CLBBHMA3.cjs.map → chunk-JADTPS46.cjs.map} +1 -1
  14. package/dist/{chunk-HRFBE6CG.cjs → chunk-JQBK4O73.cjs} +10 -10
  15. package/dist/{chunk-HRFBE6CG.cjs.map → chunk-JQBK4O73.cjs.map} +1 -1
  16. package/dist/{chunk-KQAXIDXD.cjs → chunk-PRMNQKHD.cjs} +33 -33
  17. package/dist/{chunk-KQAXIDXD.cjs.map → chunk-PRMNQKHD.cjs.map} +1 -1
  18. package/dist/{chunk-J23TXIBZ.cjs → chunk-SUJDHIMI.cjs} +4 -12
  19. package/dist/chunk-SUJDHIMI.cjs.map +1 -0
  20. package/dist/index.cjs +34 -34
  21. package/dist/index.cjs.map +1 -1
  22. package/dist/index.js +4 -5
  23. package/dist/index.js.map +1 -1
  24. package/dist/logger.cjs +7 -7
  25. package/dist/logger.js +2 -3
  26. package/dist/mocks.cjs +14 -23336
  27. package/dist/mocks.cjs.map +1 -1
  28. package/dist/mocks.js +6 -23297
  29. package/dist/mocks.js.map +1 -1
  30. package/dist/{prompt-FDRFKJA5.cjs → prompt-644XZMFU.cjs} +62 -62
  31. package/dist/{prompt-FDRFKJA5.cjs.map → prompt-644XZMFU.cjs.map} +1 -1
  32. package/dist/{prompt-EWVFJSYF.js → prompt-WQQUN22Z.js} +3 -4
  33. package/dist/prompt-WQQUN22Z.js.map +1 -0
  34. package/dist/transformers.cjs +23 -23
  35. package/dist/transformers.cjs.map +1 -1
  36. package/dist/transformers.js +0 -1
  37. package/dist/transformers.js.map +1 -1
  38. package/dist/utils.cjs +17 -17
  39. package/dist/utils.js +1 -2
  40. package/package.json +6 -9
  41. package/src/BarrelManager.ts +1 -1
  42. package/src/FileManager.ts +1 -1
  43. package/src/PromiseManager.ts +1 -1
  44. package/src/transformers/escape.ts +0 -10
  45. package/src/utils/executeStrategies.ts +2 -2
  46. package/src/utils/parser.ts +2 -2
  47. package/dist/acorn-75VVZH4M.cjs +0 -3015
  48. package/dist/acorn-75VVZH4M.cjs.map +0 -1
  49. package/dist/acorn-BDQRFTH5.js +0 -3009
  50. package/dist/acorn-BDQRFTH5.js.map +0 -1
  51. package/dist/angular-7QLNOURG.js +0 -1537
  52. package/dist/angular-7QLNOURG.js.map +0 -1
  53. package/dist/angular-G25ZDZ3P.cjs +0 -1543
  54. package/dist/angular-G25ZDZ3P.cjs.map +0 -1
  55. package/dist/babel-CZJUWSVJ.cjs +0 -6905
  56. package/dist/babel-CZJUWSVJ.cjs.map +0 -1
  57. package/dist/babel-GWHGORSH.js +0 -6899
  58. package/dist/babel-GWHGORSH.js.map +0 -1
  59. package/dist/chunk-J23TXIBZ.cjs.map +0 -1
  60. package/dist/chunk-OSWGRZMH.js +0 -12927
  61. package/dist/chunk-OSWGRZMH.js.map +0 -1
  62. package/dist/chunk-PXLB77EH.cjs +0 -12933
  63. package/dist/chunk-PXLB77EH.cjs.map +0 -1
  64. package/dist/chunk-PZ5AY32C.js +0 -9
  65. package/dist/chunk-PZ5AY32C.js.map +0 -1
  66. package/dist/estree-4BFMOGHF.js +0 -4367
  67. package/dist/estree-4BFMOGHF.js.map +0 -1
  68. package/dist/estree-TXDUNIHF.cjs +0 -4375
  69. package/dist/estree-TXDUNIHF.cjs.map +0 -1
  70. package/dist/flow-VXQDDICF.js +0 -26262
  71. package/dist/flow-VXQDDICF.js.map +0 -1
  72. package/dist/flow-XCGHVA4N.cjs +0 -26268
  73. package/dist/flow-XCGHVA4N.cjs.map +0 -1
  74. package/dist/glimmer-FBL5UTXI.js +0 -2844
  75. package/dist/glimmer-FBL5UTXI.js.map +0 -1
  76. package/dist/glimmer-SRXJA5DC.cjs +0 -2852
  77. package/dist/glimmer-SRXJA5DC.cjs.map +0 -1
  78. package/dist/graphql-FUGWBNAY.cjs +0 -1250
  79. package/dist/graphql-FUGWBNAY.cjs.map +0 -1
  80. package/dist/graphql-VWUEBAX7.js +0 -1241
  81. package/dist/graphql-VWUEBAX7.js.map +0 -1
  82. package/dist/html-PE4V7PIZ.cjs +0 -2754
  83. package/dist/html-PE4V7PIZ.cjs.map +0 -1
  84. package/dist/html-SRQHPYU4.js +0 -2745
  85. package/dist/html-SRQHPYU4.js.map +0 -1
  86. package/dist/markdown-7H53GZRF.js +0 -3319
  87. package/dist/markdown-7H53GZRF.js.map +0 -1
  88. package/dist/markdown-MR7POCQ6.cjs +0 -3328
  89. package/dist/markdown-MR7POCQ6.cjs.map +0 -1
  90. package/dist/meriyah-GDT4GDJH.cjs +0 -2356
  91. package/dist/meriyah-GDT4GDJH.cjs.map +0 -1
  92. package/dist/meriyah-MBZURH4I.js +0 -2350
  93. package/dist/meriyah-MBZURH4I.js.map +0 -1
  94. package/dist/postcss-4NLPAMPV.cjs +0 -4945
  95. package/dist/postcss-4NLPAMPV.cjs.map +0 -1
  96. package/dist/postcss-TPQQRMEX.js +0 -4936
  97. package/dist/postcss-TPQQRMEX.js.map +0 -1
  98. package/dist/prompt-EWVFJSYF.js.map +0 -1
  99. package/dist/typescript-FX5DO2QH.cjs +0 -19
  100. package/dist/typescript-FX5DO2QH.cjs.map +0 -1
  101. package/dist/typescript-IRGFXOHK.js +0 -4
  102. package/dist/typescript-IRGFXOHK.js.map +0 -1
  103. package/dist/yaml-KXYJMJO6.cjs +0 -4216
  104. package/dist/yaml-KXYJMJO6.cjs.map +0 -1
  105. package/dist/yaml-Q6KMUOXF.js +0 -4207
  106. package/dist/yaml-Q6KMUOXF.js.map +0 -1
@@ -1,1537 +0,0 @@
1
- import './chunk-PZ5AY32C.js';
2
-
3
- // ../../node_modules/.pnpm/prettier@3.3.3/node_modules/prettier/plugins/angular.mjs
4
- var Je = Object.defineProperty;
5
- var ae = (r3) => {
6
- throw TypeError(r3);
7
- };
8
- var oe = (r3, t) => {
9
- for (var e in t) Je(r3, e, { get: t[e], enumerable: true });
10
- };
11
- var Ut = (r3, t, e) => t.has(r3) || ae("Cannot " + e);
12
- var O = (r3, t, e) => (Ut(r3, t, "read from private field"), e ? e.call(r3) : t.get(r3));
13
- var P = (r3, t, e) => t.has(r3) ? ae("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(r3) : t.set(r3, e);
14
- var Y = (r3, t, e, s) => (Ut(r3, t, "write to private field"), t.set(r3, e), e);
15
- var c = (r3, t, e) => (Ut(r3, t, "access private method"), e);
16
- var ne = {};
17
- oe(ne, { parsers: () => ie });
18
- var ie = {};
19
- oe(ie, { __ng_action: () => js, __ng_binding: () => Ys, __ng_directive: () => Js, __ng_interpolation: () => Zs });
20
- var Z = class {
21
- constructor(t, e, s, i) {
22
- this.input = e, this.errLocation = s, this.ctxLocation = i, this.message = `Parser Error: ${t} ${s} [${e}] in ${i}`;
23
- }
24
- };
25
- var b = class {
26
- constructor(t, e) {
27
- this.start = t, this.end = e;
28
- }
29
- toAbsolute(t) {
30
- return new L(t + this.start, t + this.end);
31
- }
32
- };
33
- var m = class {
34
- constructor(t, e) {
35
- this.span = t, this.sourceSpan = e;
36
- }
37
- toString() {
38
- return "AST";
39
- }
40
- };
41
- var J = class extends m {
42
- constructor(t, e, s) {
43
- super(t, e), this.nameSpan = s;
44
- }
45
- };
46
- var $ = class extends m {
47
- visit(t, e = null) {
48
- }
49
- };
50
- var K = class extends m {
51
- visit(t, e = null) {
52
- return t.visitImplicitReceiver(this, e);
53
- }
54
- };
55
- var Lt = class extends K {
56
- visit(t, e = null) {
57
- var s;
58
- return (s = t.visitThisReceiver) == null ? void 0 : s.call(t, this, e);
59
- }
60
- };
61
- var X = class extends m {
62
- constructor(t, e, s) {
63
- super(t, e), this.expressions = s;
64
- }
65
- visit(t, e = null) {
66
- return t.visitChain(this, e);
67
- }
68
- };
69
- var tt = class extends m {
70
- constructor(t, e, s, i, n) {
71
- super(t, e), this.condition = s, this.trueExp = i, this.falseExp = n;
72
- }
73
- visit(t, e = null) {
74
- return t.visitConditional(this, e);
75
- }
76
- };
77
- var M = class extends J {
78
- constructor(t, e, s, i, n) {
79
- super(t, e, s), this.receiver = i, this.name = n;
80
- }
81
- visit(t, e = null) {
82
- return t.visitPropertyRead(this, e);
83
- }
84
- };
85
- var et = class extends J {
86
- constructor(t, e, s, i, n, a) {
87
- super(t, e, s), this.receiver = i, this.name = n, this.value = a;
88
- }
89
- visit(t, e = null) {
90
- return t.visitPropertyWrite(this, e);
91
- }
92
- };
93
- var _ = class extends J {
94
- constructor(t, e, s, i, n) {
95
- super(t, e, s), this.receiver = i, this.name = n;
96
- }
97
- visit(t, e = null) {
98
- return t.visitSafePropertyRead(this, e);
99
- }
100
- };
101
- var st = class extends m {
102
- constructor(t, e, s, i) {
103
- super(t, e), this.receiver = s, this.key = i;
104
- }
105
- visit(t, e = null) {
106
- return t.visitKeyedRead(this, e);
107
- }
108
- };
109
- var U = class extends m {
110
- constructor(t, e, s, i) {
111
- super(t, e), this.receiver = s, this.key = i;
112
- }
113
- visit(t, e = null) {
114
- return t.visitSafeKeyedRead(this, e);
115
- }
116
- };
117
- var rt = class extends m {
118
- constructor(t, e, s, i, n) {
119
- super(t, e), this.receiver = s, this.key = i, this.value = n;
120
- }
121
- visit(t, e = null) {
122
- return t.visitKeyedWrite(this, e);
123
- }
124
- };
125
- var it = class extends J {
126
- constructor(t, e, s, i, n, a) {
127
- super(t, e, a), this.exp = s, this.name = i, this.args = n;
128
- }
129
- visit(t, e = null) {
130
- return t.visitPipe(this, e);
131
- }
132
- };
133
- var E = class extends m {
134
- constructor(t, e, s) {
135
- super(t, e), this.value = s;
136
- }
137
- visit(t, e = null) {
138
- return t.visitLiteralPrimitive(this, e);
139
- }
140
- };
141
- var nt = class extends m {
142
- constructor(t, e, s) {
143
- super(t, e), this.expressions = s;
144
- }
145
- visit(t, e = null) {
146
- return t.visitLiteralArray(this, e);
147
- }
148
- };
149
- var at = class extends m {
150
- constructor(t, e, s, i) {
151
- super(t, e), this.keys = s, this.values = i;
152
- }
153
- visit(t, e = null) {
154
- return t.visitLiteralMap(this, e);
155
- }
156
- };
157
- var ot = class extends m {
158
- constructor(t, e, s, i) {
159
- super(t, e), this.strings = s, this.expressions = i;
160
- }
161
- visit(t, e = null) {
162
- return t.visitInterpolation(this, e);
163
- }
164
- };
165
- var A = class extends m {
166
- constructor(t, e, s, i, n) {
167
- super(t, e), this.operation = s, this.left = i, this.right = n;
168
- }
169
- visit(t, e = null) {
170
- return t.visitBinary(this, e);
171
- }
172
- };
173
- var F = class r extends A {
174
- static createMinus(t, e, s) {
175
- return new r(t, e, "-", s, "-", new E(t, e, 0), s);
176
- }
177
- static createPlus(t, e, s) {
178
- return new r(t, e, "+", s, "-", s, new E(t, e, 0));
179
- }
180
- constructor(t, e, s, i, n, a, o) {
181
- super(t, e, n, a, o), this.operator = s, this.expr = i, this.left = null, this.right = null, this.operation = null;
182
- }
183
- visit(t, e = null) {
184
- return t.visitUnary !== void 0 ? t.visitUnary(this, e) : t.visitBinary(this, e);
185
- }
186
- };
187
- var ct = class extends m {
188
- constructor(t, e, s) {
189
- super(t, e), this.expression = s;
190
- }
191
- visit(t, e = null) {
192
- return t.visitPrefixNot(this, e);
193
- }
194
- };
195
- var ht = class extends m {
196
- constructor(t, e, s) {
197
- super(t, e), this.expression = s;
198
- }
199
- visit(t, e = null) {
200
- return t.visitNonNullAssert(this, e);
201
- }
202
- };
203
- var pt = class extends m {
204
- constructor(t, e, s, i, n) {
205
- super(t, e), this.receiver = s, this.args = i, this.argumentSpan = n;
206
- }
207
- visit(t, e = null) {
208
- return t.visitCall(this, e);
209
- }
210
- };
211
- var D = class extends m {
212
- constructor(t, e, s, i, n) {
213
- super(t, e), this.receiver = s, this.args = i, this.argumentSpan = n;
214
- }
215
- visit(t, e = null) {
216
- return t.visitSafeCall(this, e);
217
- }
218
- };
219
- var L = class {
220
- constructor(t, e) {
221
- this.start = t, this.end = e;
222
- }
223
- };
224
- var R = class extends m {
225
- constructor(t, e, s, i, n) {
226
- super(new b(0, e === null ? 0 : e.length), new L(i, e === null ? i : i + e.length)), this.ast = t, this.source = e, this.location = s, this.errors = n;
227
- }
228
- visit(t, e = null) {
229
- return t.visitASTWithSource ? t.visitASTWithSource(this, e) : this.ast.visit(t, e);
230
- }
231
- toString() {
232
- return `${this.source} in ${this.location}`;
233
- }
234
- };
235
- var W = class {
236
- constructor(t, e, s) {
237
- this.sourceSpan = t, this.key = e, this.value = s;
238
- }
239
- };
240
- var ut = class {
241
- constructor(t, e, s) {
242
- this.sourceSpan = t, this.key = e, this.value = s;
243
- }
244
- };
245
- var Rt = class {
246
- visit(t, e) {
247
- t.visit(this, e);
248
- }
249
- visitUnary(t, e) {
250
- this.visit(t.expr, e);
251
- }
252
- visitBinary(t, e) {
253
- this.visit(t.left, e), this.visit(t.right, e);
254
- }
255
- visitChain(t, e) {
256
- this.visitAll(t.expressions, e);
257
- }
258
- visitConditional(t, e) {
259
- this.visit(t.condition, e), this.visit(t.trueExp, e), this.visit(t.falseExp, e);
260
- }
261
- visitPipe(t, e) {
262
- this.visit(t.exp, e), this.visitAll(t.args, e);
263
- }
264
- visitImplicitReceiver(t, e) {
265
- }
266
- visitThisReceiver(t, e) {
267
- }
268
- visitInterpolation(t, e) {
269
- this.visitAll(t.expressions, e);
270
- }
271
- visitKeyedRead(t, e) {
272
- this.visit(t.receiver, e), this.visit(t.key, e);
273
- }
274
- visitKeyedWrite(t, e) {
275
- this.visit(t.receiver, e), this.visit(t.key, e), this.visit(t.value, e);
276
- }
277
- visitLiteralArray(t, e) {
278
- this.visitAll(t.expressions, e);
279
- }
280
- visitLiteralMap(t, e) {
281
- this.visitAll(t.values, e);
282
- }
283
- visitLiteralPrimitive(t, e) {
284
- }
285
- visitPrefixNot(t, e) {
286
- this.visit(t.expression, e);
287
- }
288
- visitNonNullAssert(t, e) {
289
- this.visit(t.expression, e);
290
- }
291
- visitPropertyRead(t, e) {
292
- this.visit(t.receiver, e);
293
- }
294
- visitPropertyWrite(t, e) {
295
- this.visit(t.receiver, e), this.visit(t.value, e);
296
- }
297
- visitSafePropertyRead(t, e) {
298
- this.visit(t.receiver, e);
299
- }
300
- visitSafeKeyedRead(t, e) {
301
- this.visit(t.receiver, e), this.visit(t.key, e);
302
- }
303
- visitCall(t, e) {
304
- this.visit(t.receiver, e), this.visitAll(t.args, e);
305
- }
306
- visitSafeCall(t, e) {
307
- this.visit(t.receiver, e), this.visitAll(t.args, e);
308
- }
309
- visitAll(t, e) {
310
- for (let s of t) this.visit(s, e);
311
- }
312
- };
313
- var ce;
314
- (function(r3) {
315
- r3[r3.DEFAULT = 0] = "DEFAULT", r3[r3.LITERAL_ATTR = 1] = "LITERAL_ATTR", r3[r3.ANIMATION = 2] = "ANIMATION", r3[r3.TWO_WAY = 3] = "TWO_WAY";
316
- })(ce || (ce = {}));
317
- var he;
318
- (function(r3) {
319
- r3[r3.Regular = 0] = "Regular", r3[r3.Animation = 1] = "Animation", r3[r3.TwoWay = 2] = "TwoWay";
320
- })(he || (he = {}));
321
- var pe;
322
- (function(r3) {
323
- r3[r3.Property = 0] = "Property", r3[r3.Attribute = 1] = "Attribute", r3[r3.Class = 2] = "Class", r3[r3.Style = 3] = "Style", r3[r3.Animation = 4] = "Animation", r3[r3.TwoWay = 5] = "TwoWay";
324
- })(pe || (pe = {}));
325
- function ue(r3) {
326
- return r3 >= 9 && r3 <= 32 || r3 == 160;
327
- }
328
- function B(r3) {
329
- return 48 <= r3 && r3 <= 57;
330
- }
331
- function le(r3) {
332
- return r3 >= 97 && r3 <= 122 || r3 >= 65 && r3 <= 90;
333
- }
334
- function Ft(r3) {
335
- return r3 === 39 || r3 === 34 || r3 === 96;
336
- }
337
- var l;
338
- (function(r3) {
339
- r3[r3.Character = 0] = "Character", r3[r3.Identifier = 1] = "Identifier", r3[r3.PrivateIdentifier = 2] = "PrivateIdentifier", r3[r3.Keyword = 3] = "Keyword", r3[r3.String = 4] = "String", r3[r3.Operator = 5] = "Operator", r3[r3.Number = 6] = "Number", r3[r3.Error = 7] = "Error";
340
- })(l || (l = {}));
341
- var ks = ["var", "let", "as", "null", "undefined", "true", "false", "if", "else", "this"];
342
- var yt = class {
343
- tokenize(t) {
344
- let e = new Gt(t), s = [], i = e.scanToken();
345
- for (; i != null; ) s.push(i), i = e.scanToken();
346
- return s;
347
- }
348
- };
349
- var I = class {
350
- constructor(t, e, s, i, n) {
351
- this.index = t, this.end = e, this.type = s, this.numValue = i, this.strValue = n;
352
- }
353
- isCharacter(t) {
354
- return this.type == l.Character && this.numValue == t;
355
- }
356
- isNumber() {
357
- return this.type == l.Number;
358
- }
359
- isString() {
360
- return this.type == l.String;
361
- }
362
- isOperator(t) {
363
- return this.type == l.Operator && this.strValue == t;
364
- }
365
- isIdentifier() {
366
- return this.type == l.Identifier;
367
- }
368
- isPrivateIdentifier() {
369
- return this.type == l.PrivateIdentifier;
370
- }
371
- isKeyword() {
372
- return this.type == l.Keyword;
373
- }
374
- isKeywordLet() {
375
- return this.type == l.Keyword && this.strValue == "let";
376
- }
377
- isKeywordAs() {
378
- return this.type == l.Keyword && this.strValue == "as";
379
- }
380
- isKeywordNull() {
381
- return this.type == l.Keyword && this.strValue == "null";
382
- }
383
- isKeywordUndefined() {
384
- return this.type == l.Keyword && this.strValue == "undefined";
385
- }
386
- isKeywordTrue() {
387
- return this.type == l.Keyword && this.strValue == "true";
388
- }
389
- isKeywordFalse() {
390
- return this.type == l.Keyword && this.strValue == "false";
391
- }
392
- isKeywordThis() {
393
- return this.type == l.Keyword && this.strValue == "this";
394
- }
395
- isError() {
396
- return this.type == l.Error;
397
- }
398
- toNumber() {
399
- return this.type == l.Number ? this.numValue : -1;
400
- }
401
- toString() {
402
- switch (this.type) {
403
- case l.Character:
404
- case l.Identifier:
405
- case l.Keyword:
406
- case l.Operator:
407
- case l.PrivateIdentifier:
408
- case l.String:
409
- case l.Error:
410
- return this.strValue;
411
- case l.Number:
412
- return this.numValue.toString();
413
- default:
414
- return null;
415
- }
416
- }
417
- };
418
- function ge(r3, t, e) {
419
- return new I(r3, t, l.Character, e, String.fromCharCode(e));
420
- }
421
- function Ns(r3, t, e) {
422
- return new I(r3, t, l.Identifier, 0, e);
423
- }
424
- function Ls(r3, t, e) {
425
- return new I(r3, t, l.PrivateIdentifier, 0, e);
426
- }
427
- function Rs(r3, t, e) {
428
- return new I(r3, t, l.Keyword, 0, e);
429
- }
430
- function Wt(r3, t, e) {
431
- return new I(r3, t, l.Operator, 0, e);
432
- }
433
- function Ps(r3, t, e) {
434
- return new I(r3, t, l.String, 0, e);
435
- }
436
- function bs(r3, t, e) {
437
- return new I(r3, t, l.Number, e, "");
438
- }
439
- function Ks(r3, t, e) {
440
- return new I(r3, t, l.Error, 0, e);
441
- }
442
- var Bt = new I(-1, -1, l.Character, 0, "");
443
- var Gt = class {
444
- constructor(t) {
445
- this.input = t, this.peek = 0, this.index = -1, this.length = t.length, this.advance();
446
- }
447
- advance() {
448
- this.peek = ++this.index >= this.length ? 0 : this.input.charCodeAt(this.index);
449
- }
450
- scanToken() {
451
- let t = this.input, e = this.length, s = this.peek, i = this.index;
452
- for (; s <= 32; ) if (++i >= e) {
453
- s = 0;
454
- break;
455
- } else s = t.charCodeAt(i);
456
- if (this.peek = s, this.index = i, i >= e) return null;
457
- if (me(s)) return this.scanIdentifier();
458
- if (B(s)) return this.scanNumber(i);
459
- let n = i;
460
- switch (s) {
461
- case 46:
462
- return this.advance(), B(this.peek) ? this.scanNumber(n) : ge(n, this.index, 46);
463
- case 40:
464
- case 41:
465
- case 123:
466
- case 125:
467
- case 91:
468
- case 93:
469
- case 44:
470
- case 58:
471
- case 59:
472
- return this.scanCharacter(n, s);
473
- case 39:
474
- case 34:
475
- return this.scanString();
476
- case 35:
477
- return this.scanPrivateIdentifier();
478
- case 43:
479
- case 45:
480
- case 42:
481
- case 47:
482
- case 37:
483
- case 94:
484
- return this.scanOperator(n, String.fromCharCode(s));
485
- case 63:
486
- return this.scanQuestion(n);
487
- case 60:
488
- case 62:
489
- return this.scanComplexOperator(n, String.fromCharCode(s), 61, "=");
490
- case 33:
491
- case 61:
492
- return this.scanComplexOperator(n, String.fromCharCode(s), 61, "=", 61, "=");
493
- case 38:
494
- return this.scanComplexOperator(n, "&", 38, "&");
495
- case 124:
496
- return this.scanComplexOperator(n, "|", 124, "|");
497
- case 160:
498
- for (; ue(this.peek); ) this.advance();
499
- return this.scanToken();
500
- }
501
- return this.advance(), this.error(`Unexpected character [${String.fromCharCode(s)}]`, 0);
502
- }
503
- scanCharacter(t, e) {
504
- return this.advance(), ge(t, this.index, e);
505
- }
506
- scanOperator(t, e) {
507
- return this.advance(), Wt(t, this.index, e);
508
- }
509
- scanComplexOperator(t, e, s, i, n, a) {
510
- this.advance();
511
- let o = e;
512
- return this.peek == s && (this.advance(), o += i), n != null && this.peek == n && (this.advance(), o += a), Wt(t, this.index, o);
513
- }
514
- scanIdentifier() {
515
- let t = this.index;
516
- for (this.advance(); Se(this.peek); ) this.advance();
517
- let e = this.input.substring(t, this.index);
518
- return ks.indexOf(e) > -1 ? Rs(t, this.index, e) : Ns(t, this.index, e);
519
- }
520
- scanPrivateIdentifier() {
521
- let t = this.index;
522
- if (this.advance(), !me(this.peek)) return this.error("Invalid character [#]", -1);
523
- for (; Se(this.peek); ) this.advance();
524
- let e = this.input.substring(t, this.index);
525
- return Ls(t, this.index, e);
526
- }
527
- scanNumber(t) {
528
- let e = this.index === t, s = false;
529
- for (this.advance(); ; ) {
530
- if (!B(this.peek)) if (this.peek === 95) {
531
- if (!B(this.input.charCodeAt(this.index - 1)) || !B(this.input.charCodeAt(this.index + 1))) return this.error("Invalid numeric separator", 0);
532
- s = true;
533
- } else if (this.peek === 46) e = false;
534
- else if (Bs(this.peek)) {
535
- if (this.advance(), Ts(this.peek) && this.advance(), !B(this.peek)) return this.error("Invalid exponent", -1);
536
- e = false;
537
- } else break;
538
- this.advance();
539
- }
540
- let i = this.input.substring(t, this.index);
541
- s && (i = i.replace(/_/g, ""));
542
- let n = e ? _s(i) : parseFloat(i);
543
- return bs(t, this.index, n);
544
- }
545
- scanString() {
546
- let t = this.index, e = this.peek;
547
- this.advance();
548
- let s = "", i = this.index, n = this.input;
549
- for (; this.peek != e; ) if (this.peek == 92) {
550
- s += n.substring(i, this.index);
551
- let o;
552
- if (this.advance(), this.peek == 117) {
553
- let p = n.substring(this.index + 1, this.index + 5);
554
- if (/^[0-9a-f]+$/i.test(p)) o = parseInt(p, 16);
555
- else return this.error(`Invalid unicode escape [\\u${p}]`, 0);
556
- for (let u = 0; u < 5; u++) this.advance();
557
- } else o = Ms(this.peek), this.advance();
558
- s += String.fromCharCode(o), i = this.index;
559
- } else {
560
- if (this.peek == 0) return this.error("Unterminated quote", 0);
561
- this.advance();
562
- }
563
- let a = n.substring(i, this.index);
564
- return this.advance(), Ps(t, this.index, s + a);
565
- }
566
- scanQuestion(t) {
567
- this.advance();
568
- let e = "?";
569
- return (this.peek === 63 || this.peek === 46) && (e += this.peek === 46 ? "." : "?", this.advance()), Wt(t, this.index, e);
570
- }
571
- error(t, e) {
572
- let s = this.index + e;
573
- return Ks(s, this.index, `Lexer Error: ${t} at column ${s} in expression [${this.input}]`);
574
- }
575
- };
576
- function me(r3) {
577
- return 97 <= r3 && r3 <= 122 || 65 <= r3 && r3 <= 90 || r3 == 95 || r3 == 36;
578
- }
579
- function Se(r3) {
580
- return le(r3) || B(r3) || r3 == 95 || r3 == 36;
581
- }
582
- function Bs(r3) {
583
- return r3 == 101 || r3 == 69;
584
- }
585
- function Ts(r3) {
586
- return r3 == 45 || r3 == 43;
587
- }
588
- function Ms(r3) {
589
- switch (r3) {
590
- case 110:
591
- return 10;
592
- case 102:
593
- return 12;
594
- case 114:
595
- return 13;
596
- case 116:
597
- return 9;
598
- case 118:
599
- return 11;
600
- default:
601
- return r3;
602
- }
603
- }
604
- function _s(r3) {
605
- let t = parseInt(r3);
606
- if (isNaN(t)) throw new Error("Invalid integer literal when parsing " + r3);
607
- return t;
608
- }
609
- var Us = [/@/, /^\s*$/, /[<>]/, /^[{}]$/, /&(#|[a-z])/i, /^\/\//];
610
- function Ee(r3, t) {
611
- if (t != null && !(Array.isArray(t) && t.length == 2)) throw new Error(`Expected '${r3}' to be an array, [start, end].`);
612
- if (t != null) {
613
- let e = t[0], s = t[1];
614
- Us.forEach((i) => {
615
- if (i.test(e) || i.test(s)) throw new Error(`['${e}', '${s}'] contains unusable interpolation symbol.`);
616
- });
617
- }
618
- }
619
- var Qt = class r2 {
620
- static fromArray(t) {
621
- return t ? (Ee("interpolation", t), new r2(t[0], t[1])) : Q;
622
- }
623
- constructor(t, e) {
624
- this.start = t, this.end = e;
625
- }
626
- };
627
- var Q = new Qt("{{", "}}");
628
- var zt = class {
629
- constructor(t, e, s) {
630
- this.strings = t, this.expressions = e, this.offsets = s;
631
- }
632
- };
633
- var qt = class {
634
- constructor(t, e, s) {
635
- this.templateBindings = t, this.warnings = e, this.errors = s;
636
- }
637
- };
638
- var mt = class {
639
- constructor(t) {
640
- this._lexer = t, this.errors = [];
641
- }
642
- parseAction(t, e, s, i = Q) {
643
- this._checkNoInterpolation(t, e, i);
644
- let n = this._stripComments(t), a = this._lexer.tokenize(n), o = new z(t, e, s, a, 1, this.errors, 0).parseChain();
645
- return new R(o, t, e, s, this.errors);
646
- }
647
- parseBinding(t, e, s, i = Q) {
648
- let n = this._parseBindingAst(t, e, s, i);
649
- return new R(n, t, e, s, this.errors);
650
- }
651
- checkSimpleExpression(t) {
652
- let e = new Ht();
653
- return t.visit(e), e.errors;
654
- }
655
- parseSimpleBinding(t, e, s, i = Q) {
656
- let n = this._parseBindingAst(t, e, s, i), a = this.checkSimpleExpression(n);
657
- return a.length > 0 && this._reportError(`Host binding expression cannot contain ${a.join(" ")}`, t, e), new R(n, t, e, s, this.errors);
658
- }
659
- _reportError(t, e, s, i) {
660
- this.errors.push(new Z(t, e, s, i));
661
- }
662
- _parseBindingAst(t, e, s, i) {
663
- this._checkNoInterpolation(t, e, i);
664
- let n = this._stripComments(t), a = this._lexer.tokenize(n);
665
- return new z(t, e, s, a, 0, this.errors, 0).parseChain();
666
- }
667
- parseTemplateBindings(t, e, s, i, n) {
668
- let a = this._lexer.tokenize(e);
669
- return new z(e, s, n, a, 0, this.errors, 0).parseTemplateBindings({ source: t, span: new L(i, i + t.length) });
670
- }
671
- parseInterpolation(t, e, s, i, n = Q) {
672
- let { strings: a, expressions: o, offsets: p } = this.splitInterpolation(t, e, i, n);
673
- if (o.length === 0) return null;
674
- let u = [];
675
- for (let f = 0; f < o.length; ++f) {
676
- let S = o[f].text, g = this._stripComments(S), y = this._lexer.tokenize(g), w = new z(t, e, s, y, 0, this.errors, p[f]).parseChain();
677
- u.push(w);
678
- }
679
- return this.createInterpolationAst(a.map((f) => f.text), u, t, e, s);
680
- }
681
- parseInterpolationExpression(t, e, s) {
682
- let i = this._stripComments(t), n = this._lexer.tokenize(i), a = new z(t, e, s, n, 0, this.errors, 0).parseChain(), o = ["", ""];
683
- return this.createInterpolationAst(o, [a], t, e, s);
684
- }
685
- createInterpolationAst(t, e, s, i, n) {
686
- let a = new b(0, s.length), o = new ot(a, a.toAbsolute(n), t, e);
687
- return new R(o, s, i, n, this.errors);
688
- }
689
- splitInterpolation(t, e, s, i = Q) {
690
- let n = [], a = [], o = [], p = s ? Fs(s) : null, u = 0, f = false, S = false, { start: g, end: y } = i;
691
- for (; u < t.length; ) if (f) {
692
- let w = u, H = w + g.length, j = this._getInterpolationEndIndex(t, y, H);
693
- if (j === -1) {
694
- f = false, S = true;
695
- break;
696
- }
697
- let T = j + y.length, Nt = t.substring(H, j);
698
- Nt.trim().length === 0 && this._reportError("Blank expressions are not allowed in interpolated strings", t, `at column ${u} in`, e), a.push({ text: Nt, start: w, end: T });
699
- let Ze = ((p == null ? void 0 : p.get(w)) ?? w) + g.length;
700
- o.push(Ze), u = T, f = false;
701
- } else {
702
- let w = u;
703
- u = t.indexOf(g, u), u === -1 && (u = t.length);
704
- let H = t.substring(w, u);
705
- n.push({ text: H, start: w, end: u }), f = true;
706
- }
707
- if (!f) if (S) {
708
- let w = n[n.length - 1];
709
- w.text += t.substring(u), w.end = t.length;
710
- } else n.push({ text: t.substring(u), start: u, end: t.length });
711
- return new zt(n, a, o);
712
- }
713
- wrapLiteralPrimitive(t, e, s) {
714
- let i = new b(0, t == null ? 0 : t.length);
715
- return new R(new E(i, i.toAbsolute(s), t), t, e, s, this.errors);
716
- }
717
- _stripComments(t) {
718
- let e = this._commentStart(t);
719
- return e != null ? t.substring(0, e) : t;
720
- }
721
- _commentStart(t) {
722
- let e = null;
723
- for (let s = 0; s < t.length - 1; s++) {
724
- let i = t.charCodeAt(s), n = t.charCodeAt(s + 1);
725
- if (i === 47 && n == 47 && e == null) return s;
726
- e === i ? e = null : e == null && Ft(i) && (e = i);
727
- }
728
- return null;
729
- }
730
- _checkNoInterpolation(t, e, { start: s, end: i }) {
731
- let n = -1, a = -1;
732
- for (let o of this._forEachUnquotedChar(t, 0)) if (n === -1) t.startsWith(s) && (n = o);
733
- else if (a = this._getInterpolationEndIndex(t, i, o), a > -1) break;
734
- n > -1 && a > -1 && this._reportError(`Got interpolation (${s}${i}) where expression was expected`, t, `at column ${n} in`, e);
735
- }
736
- _getInterpolationEndIndex(t, e, s) {
737
- for (let i of this._forEachUnquotedChar(t, s)) {
738
- if (t.startsWith(e, i)) return i;
739
- if (t.startsWith("//", i)) return t.indexOf(e, i);
740
- }
741
- return -1;
742
- }
743
- *_forEachUnquotedChar(t, e) {
744
- let s = null, i = 0;
745
- for (let n = e; n < t.length; n++) {
746
- let a = t[n];
747
- Ft(t.charCodeAt(n)) && (s === null || s === a) && i % 2 === 0 ? s = s === null ? a : null : s === null && (yield n), i = a === "\\" ? i + 1 : 0;
748
- }
749
- }
750
- };
751
- var gt;
752
- (function(r3) {
753
- r3[r3.None = 0] = "None", r3[r3.Writable = 1] = "Writable";
754
- })(gt || (gt = {}));
755
- var z = class {
756
- constructor(t, e, s, i, n, a, o) {
757
- this.input = t, this.location = e, this.absoluteOffset = s, this.tokens = i, this.parseFlags = n, this.errors = a, this.offset = o, this.rparensExpected = 0, this.rbracketsExpected = 0, this.rbracesExpected = 0, this.context = gt.None, this.sourceSpanCache = /* @__PURE__ */ new Map(), this.index = 0;
758
- }
759
- peek(t) {
760
- let e = this.index + t;
761
- return e < this.tokens.length ? this.tokens[e] : Bt;
762
- }
763
- get next() {
764
- return this.peek(0);
765
- }
766
- get atEOF() {
767
- return this.index >= this.tokens.length;
768
- }
769
- get inputIndex() {
770
- return this.atEOF ? this.currentEndIndex : this.next.index + this.offset;
771
- }
772
- get currentEndIndex() {
773
- return this.index > 0 ? this.peek(-1).end + this.offset : this.tokens.length === 0 ? this.input.length + this.offset : this.next.index + this.offset;
774
- }
775
- get currentAbsoluteOffset() {
776
- return this.absoluteOffset + this.inputIndex;
777
- }
778
- span(t, e) {
779
- let s = this.currentEndIndex;
780
- if (e !== void 0 && e > this.currentEndIndex && (s = e), t > s) {
781
- let i = s;
782
- s = t, t = i;
783
- }
784
- return new b(t, s);
785
- }
786
- sourceSpan(t, e) {
787
- let s = `${t}@${this.inputIndex}:${e}`;
788
- return this.sourceSpanCache.has(s) || this.sourceSpanCache.set(s, this.span(t, e).toAbsolute(this.absoluteOffset)), this.sourceSpanCache.get(s);
789
- }
790
- advance() {
791
- this.index++;
792
- }
793
- withContext(t, e) {
794
- this.context |= t;
795
- let s = e();
796
- return this.context ^= t, s;
797
- }
798
- consumeOptionalCharacter(t) {
799
- return this.next.isCharacter(t) ? (this.advance(), true) : false;
800
- }
801
- peekKeywordLet() {
802
- return this.next.isKeywordLet();
803
- }
804
- peekKeywordAs() {
805
- return this.next.isKeywordAs();
806
- }
807
- expectCharacter(t) {
808
- this.consumeOptionalCharacter(t) || this.error(`Missing expected ${String.fromCharCode(t)}`);
809
- }
810
- consumeOptionalOperator(t) {
811
- return this.next.isOperator(t) ? (this.advance(), true) : false;
812
- }
813
- expectOperator(t) {
814
- this.consumeOptionalOperator(t) || this.error(`Missing expected operator ${t}`);
815
- }
816
- prettyPrintToken(t) {
817
- return t === Bt ? "end of input" : `token ${t}`;
818
- }
819
- expectIdentifierOrKeyword() {
820
- let t = this.next;
821
- return !t.isIdentifier() && !t.isKeyword() ? (t.isPrivateIdentifier() ? this._reportErrorForPrivateIdentifier(t, "expected identifier or keyword") : this.error(`Unexpected ${this.prettyPrintToken(t)}, expected identifier or keyword`), null) : (this.advance(), t.toString());
822
- }
823
- expectIdentifierOrKeywordOrString() {
824
- let t = this.next;
825
- return !t.isIdentifier() && !t.isKeyword() && !t.isString() ? (t.isPrivateIdentifier() ? this._reportErrorForPrivateIdentifier(t, "expected identifier, keyword or string") : this.error(`Unexpected ${this.prettyPrintToken(t)}, expected identifier, keyword, or string`), "") : (this.advance(), t.toString());
826
- }
827
- parseChain() {
828
- let t = [], e = this.inputIndex;
829
- for (; this.index < this.tokens.length; ) {
830
- let s = this.parsePipe();
831
- if (t.push(s), this.consumeOptionalCharacter(59)) for (this.parseFlags & 1 || this.error("Binding expression cannot contain chained expression"); this.consumeOptionalCharacter(59); ) ;
832
- else if (this.index < this.tokens.length) {
833
- let i = this.index;
834
- if (this.error(`Unexpected token '${this.next}'`), this.index === i) break;
835
- }
836
- }
837
- if (t.length === 0) {
838
- let s = this.offset, i = this.offset + this.input.length;
839
- return new $(this.span(s, i), this.sourceSpan(s, i));
840
- }
841
- return t.length == 1 ? t[0] : new X(this.span(e), this.sourceSpan(e), t);
842
- }
843
- parsePipe() {
844
- let t = this.inputIndex, e = this.parseExpression();
845
- if (this.consumeOptionalOperator("|")) {
846
- this.parseFlags & 1 && this.error("Cannot have a pipe in an action expression");
847
- do {
848
- let s = this.inputIndex, i = this.expectIdentifierOrKeyword(), n, a;
849
- i !== null ? n = this.sourceSpan(s) : (i = "", a = this.next.index !== -1 ? this.next.index : this.input.length + this.offset, n = new b(a, a).toAbsolute(this.absoluteOffset));
850
- let o = [];
851
- for (; this.consumeOptionalCharacter(58); ) o.push(this.parseExpression());
852
- e = new it(this.span(t), this.sourceSpan(t, a), e, i, o, n);
853
- } while (this.consumeOptionalOperator("|"));
854
- }
855
- return e;
856
- }
857
- parseExpression() {
858
- return this.parseConditional();
859
- }
860
- parseConditional() {
861
- let t = this.inputIndex, e = this.parseLogicalOr();
862
- if (this.consumeOptionalOperator("?")) {
863
- let s = this.parsePipe(), i;
864
- if (this.consumeOptionalCharacter(58)) i = this.parsePipe();
865
- else {
866
- let n = this.inputIndex, a = this.input.substring(t, n);
867
- this.error(`Conditional expression ${a} requires all 3 expressions`), i = new $(this.span(t), this.sourceSpan(t));
868
- }
869
- return new tt(this.span(t), this.sourceSpan(t), e, s, i);
870
- } else return e;
871
- }
872
- parseLogicalOr() {
873
- let t = this.inputIndex, e = this.parseLogicalAnd();
874
- for (; this.consumeOptionalOperator("||"); ) {
875
- let s = this.parseLogicalAnd();
876
- e = new A(this.span(t), this.sourceSpan(t), "||", e, s);
877
- }
878
- return e;
879
- }
880
- parseLogicalAnd() {
881
- let t = this.inputIndex, e = this.parseNullishCoalescing();
882
- for (; this.consumeOptionalOperator("&&"); ) {
883
- let s = this.parseNullishCoalescing();
884
- e = new A(this.span(t), this.sourceSpan(t), "&&", e, s);
885
- }
886
- return e;
887
- }
888
- parseNullishCoalescing() {
889
- let t = this.inputIndex, e = this.parseEquality();
890
- for (; this.consumeOptionalOperator("??"); ) {
891
- let s = this.parseEquality();
892
- e = new A(this.span(t), this.sourceSpan(t), "??", e, s);
893
- }
894
- return e;
895
- }
896
- parseEquality() {
897
- let t = this.inputIndex, e = this.parseRelational();
898
- for (; this.next.type == l.Operator; ) {
899
- let s = this.next.strValue;
900
- switch (s) {
901
- case "==":
902
- case "===":
903
- case "!=":
904
- case "!==":
905
- this.advance();
906
- let i = this.parseRelational();
907
- e = new A(this.span(t), this.sourceSpan(t), s, e, i);
908
- continue;
909
- }
910
- break;
911
- }
912
- return e;
913
- }
914
- parseRelational() {
915
- let t = this.inputIndex, e = this.parseAdditive();
916
- for (; this.next.type == l.Operator; ) {
917
- let s = this.next.strValue;
918
- switch (s) {
919
- case "<":
920
- case ">":
921
- case "<=":
922
- case ">=":
923
- this.advance();
924
- let i = this.parseAdditive();
925
- e = new A(this.span(t), this.sourceSpan(t), s, e, i);
926
- continue;
927
- }
928
- break;
929
- }
930
- return e;
931
- }
932
- parseAdditive() {
933
- let t = this.inputIndex, e = this.parseMultiplicative();
934
- for (; this.next.type == l.Operator; ) {
935
- let s = this.next.strValue;
936
- switch (s) {
937
- case "+":
938
- case "-":
939
- this.advance();
940
- let i = this.parseMultiplicative();
941
- e = new A(this.span(t), this.sourceSpan(t), s, e, i);
942
- continue;
943
- }
944
- break;
945
- }
946
- return e;
947
- }
948
- parseMultiplicative() {
949
- let t = this.inputIndex, e = this.parsePrefix();
950
- for (; this.next.type == l.Operator; ) {
951
- let s = this.next.strValue;
952
- switch (s) {
953
- case "*":
954
- case "%":
955
- case "/":
956
- this.advance();
957
- let i = this.parsePrefix();
958
- e = new A(this.span(t), this.sourceSpan(t), s, e, i);
959
- continue;
960
- }
961
- break;
962
- }
963
- return e;
964
- }
965
- parsePrefix() {
966
- if (this.next.type == l.Operator) {
967
- let t = this.inputIndex, e = this.next.strValue, s;
968
- switch (e) {
969
- case "+":
970
- return this.advance(), s = this.parsePrefix(), F.createPlus(this.span(t), this.sourceSpan(t), s);
971
- case "-":
972
- return this.advance(), s = this.parsePrefix(), F.createMinus(this.span(t), this.sourceSpan(t), s);
973
- case "!":
974
- return this.advance(), s = this.parsePrefix(), new ct(this.span(t), this.sourceSpan(t), s);
975
- }
976
- }
977
- return this.parseCallChain();
978
- }
979
- parseCallChain() {
980
- let t = this.inputIndex, e = this.parsePrimary();
981
- for (; ; ) if (this.consumeOptionalCharacter(46)) e = this.parseAccessMember(e, t, false);
982
- else if (this.consumeOptionalOperator("?.")) this.consumeOptionalCharacter(40) ? e = this.parseCall(e, t, true) : e = this.consumeOptionalCharacter(91) ? this.parseKeyedReadOrWrite(e, t, true) : this.parseAccessMember(e, t, true);
983
- else if (this.consumeOptionalCharacter(91)) e = this.parseKeyedReadOrWrite(e, t, false);
984
- else if (this.consumeOptionalCharacter(40)) e = this.parseCall(e, t, false);
985
- else if (this.consumeOptionalOperator("!")) e = new ht(this.span(t), this.sourceSpan(t), e);
986
- else return e;
987
- }
988
- parsePrimary() {
989
- let t = this.inputIndex;
990
- if (this.consumeOptionalCharacter(40)) {
991
- this.rparensExpected++;
992
- let e = this.parsePipe();
993
- return this.rparensExpected--, this.expectCharacter(41), e;
994
- } else {
995
- if (this.next.isKeywordNull()) return this.advance(), new E(this.span(t), this.sourceSpan(t), null);
996
- if (this.next.isKeywordUndefined()) return this.advance(), new E(this.span(t), this.sourceSpan(t), void 0);
997
- if (this.next.isKeywordTrue()) return this.advance(), new E(this.span(t), this.sourceSpan(t), true);
998
- if (this.next.isKeywordFalse()) return this.advance(), new E(this.span(t), this.sourceSpan(t), false);
999
- if (this.next.isKeywordThis()) return this.advance(), new Lt(this.span(t), this.sourceSpan(t));
1000
- if (this.consumeOptionalCharacter(91)) {
1001
- this.rbracketsExpected++;
1002
- let e = this.parseExpressionList(93);
1003
- return this.rbracketsExpected--, this.expectCharacter(93), new nt(this.span(t), this.sourceSpan(t), e);
1004
- } else {
1005
- if (this.next.isCharacter(123)) return this.parseLiteralMap();
1006
- if (this.next.isIdentifier()) return this.parseAccessMember(new K(this.span(t), this.sourceSpan(t)), t, false);
1007
- if (this.next.isNumber()) {
1008
- let e = this.next.toNumber();
1009
- return this.advance(), new E(this.span(t), this.sourceSpan(t), e);
1010
- } else if (this.next.isString()) {
1011
- let e = this.next.toString();
1012
- return this.advance(), new E(this.span(t), this.sourceSpan(t), e);
1013
- } else return this.next.isPrivateIdentifier() ? (this._reportErrorForPrivateIdentifier(this.next, null), new $(this.span(t), this.sourceSpan(t))) : this.index >= this.tokens.length ? (this.error(`Unexpected end of expression: ${this.input}`), new $(this.span(t), this.sourceSpan(t))) : (this.error(`Unexpected token ${this.next}`), new $(this.span(t), this.sourceSpan(t)));
1014
- }
1015
- }
1016
- }
1017
- parseExpressionList(t) {
1018
- let e = [];
1019
- do
1020
- if (!this.next.isCharacter(t)) e.push(this.parsePipe());
1021
- else break;
1022
- while (this.consumeOptionalCharacter(44));
1023
- return e;
1024
- }
1025
- parseLiteralMap() {
1026
- let t = [], e = [], s = this.inputIndex;
1027
- if (this.expectCharacter(123), !this.consumeOptionalCharacter(125)) {
1028
- this.rbracesExpected++;
1029
- do {
1030
- let i = this.inputIndex, n = this.next.isString(), a = this.expectIdentifierOrKeywordOrString(), o = { key: a, quoted: n };
1031
- if (t.push(o), n) this.expectCharacter(58), e.push(this.parsePipe());
1032
- else if (this.consumeOptionalCharacter(58)) e.push(this.parsePipe());
1033
- else {
1034
- o.isShorthandInitialized = true;
1035
- let p = this.span(i), u = this.sourceSpan(i);
1036
- e.push(new M(p, u, u, new K(p, u), a));
1037
- }
1038
- } while (this.consumeOptionalCharacter(44) && !this.next.isCharacter(125));
1039
- this.rbracesExpected--, this.expectCharacter(125);
1040
- }
1041
- return new at(this.span(s), this.sourceSpan(s), t, e);
1042
- }
1043
- parseAccessMember(t, e, s) {
1044
- let i = this.inputIndex, n = this.withContext(gt.Writable, () => {
1045
- let p = this.expectIdentifierOrKeyword() ?? "";
1046
- return p.length === 0 && this.error("Expected identifier for property access", t.span.end), p;
1047
- }), a = this.sourceSpan(i), o;
1048
- if (s) this.consumeOptionalOperator("=") ? (this.error("The '?.' operator cannot be used in the assignment"), o = new $(this.span(e), this.sourceSpan(e))) : o = new _(this.span(e), this.sourceSpan(e), a, t, n);
1049
- else if (this.consumeOptionalOperator("=")) {
1050
- if (!(this.parseFlags & 1)) return this.error("Bindings cannot contain assignments"), new $(this.span(e), this.sourceSpan(e));
1051
- let p = this.parseConditional();
1052
- o = new et(this.span(e), this.sourceSpan(e), a, t, n, p);
1053
- } else o = new M(this.span(e), this.sourceSpan(e), a, t, n);
1054
- return o;
1055
- }
1056
- parseCall(t, e, s) {
1057
- let i = this.inputIndex;
1058
- this.rparensExpected++;
1059
- let n = this.parseCallArguments(), a = this.span(i, this.inputIndex).toAbsolute(this.absoluteOffset);
1060
- this.expectCharacter(41), this.rparensExpected--;
1061
- let o = this.span(e), p = this.sourceSpan(e);
1062
- return s ? new D(o, p, t, n, a) : new pt(o, p, t, n, a);
1063
- }
1064
- parseCallArguments() {
1065
- if (this.next.isCharacter(41)) return [];
1066
- let t = [];
1067
- do
1068
- t.push(this.parsePipe());
1069
- while (this.consumeOptionalCharacter(44));
1070
- return t;
1071
- }
1072
- expectTemplateBindingKey() {
1073
- let t = "", e = false, s = this.currentAbsoluteOffset;
1074
- do
1075
- t += this.expectIdentifierOrKeywordOrString(), e = this.consumeOptionalOperator("-"), e && (t += "-");
1076
- while (e);
1077
- return { source: t, span: new L(s, s + t.length) };
1078
- }
1079
- parseTemplateBindings(t) {
1080
- let e = [];
1081
- for (e.push(...this.parseDirectiveKeywordBindings(t)); this.index < this.tokens.length; ) {
1082
- let s = this.parseLetBinding();
1083
- if (s) e.push(s);
1084
- else {
1085
- let i = this.expectTemplateBindingKey(), n = this.parseAsBinding(i);
1086
- n ? e.push(n) : (i.source = t.source + i.source.charAt(0).toUpperCase() + i.source.substring(1), e.push(...this.parseDirectiveKeywordBindings(i)));
1087
- }
1088
- this.consumeStatementTerminator();
1089
- }
1090
- return new qt(e, [], this.errors);
1091
- }
1092
- parseKeyedReadOrWrite(t, e, s) {
1093
- return this.withContext(gt.Writable, () => {
1094
- this.rbracketsExpected++;
1095
- let i = this.parsePipe();
1096
- if (i instanceof $ && this.error("Key access cannot be empty"), this.rbracketsExpected--, this.expectCharacter(93), this.consumeOptionalOperator("=")) if (s) this.error("The '?.' operator cannot be used in the assignment");
1097
- else {
1098
- let n = this.parseConditional();
1099
- return new rt(this.span(e), this.sourceSpan(e), t, i, n);
1100
- }
1101
- else return s ? new U(this.span(e), this.sourceSpan(e), t, i) : new st(this.span(e), this.sourceSpan(e), t, i);
1102
- return new $(this.span(e), this.sourceSpan(e));
1103
- });
1104
- }
1105
- parseDirectiveKeywordBindings(t) {
1106
- let e = [];
1107
- this.consumeOptionalCharacter(58);
1108
- let s = this.getDirectiveBoundTarget(), i = this.currentAbsoluteOffset, n = this.parseAsBinding(t);
1109
- n || (this.consumeStatementTerminator(), i = this.currentAbsoluteOffset);
1110
- let a = new L(t.span.start, i);
1111
- return e.push(new ut(a, t, s)), n && e.push(n), e;
1112
- }
1113
- getDirectiveBoundTarget() {
1114
- if (this.next === Bt || this.peekKeywordAs() || this.peekKeywordLet()) return null;
1115
- let t = this.parsePipe(), { start: e, end: s } = t.span, i = this.input.substring(e, s);
1116
- return new R(t, i, this.location, this.absoluteOffset + e, this.errors);
1117
- }
1118
- parseAsBinding(t) {
1119
- if (!this.peekKeywordAs()) return null;
1120
- this.advance();
1121
- let e = this.expectTemplateBindingKey();
1122
- this.consumeStatementTerminator();
1123
- let s = new L(t.span.start, this.currentAbsoluteOffset);
1124
- return new W(s, e, t);
1125
- }
1126
- parseLetBinding() {
1127
- if (!this.peekKeywordLet()) return null;
1128
- let t = this.currentAbsoluteOffset;
1129
- this.advance();
1130
- let e = this.expectTemplateBindingKey(), s = null;
1131
- this.consumeOptionalOperator("=") && (s = this.expectTemplateBindingKey()), this.consumeStatementTerminator();
1132
- let i = new L(t, this.currentAbsoluteOffset);
1133
- return new W(i, e, s);
1134
- }
1135
- consumeStatementTerminator() {
1136
- this.consumeOptionalCharacter(59) || this.consumeOptionalCharacter(44);
1137
- }
1138
- error(t, e = null) {
1139
- this.errors.push(new Z(t, this.input, this.locationText(e), this.location)), this.skip();
1140
- }
1141
- locationText(t = null) {
1142
- return t == null && (t = this.index), t < this.tokens.length ? `at column ${this.tokens[t].index + 1} in` : "at the end of the expression";
1143
- }
1144
- _reportErrorForPrivateIdentifier(t, e) {
1145
- let s = `Private identifiers are not supported. Unexpected private identifier: ${t}`;
1146
- e !== null && (s += `, ${e}`), this.error(s);
1147
- }
1148
- skip() {
1149
- let t = this.next;
1150
- for (; this.index < this.tokens.length && !t.isCharacter(59) && !t.isOperator("|") && (this.rparensExpected <= 0 || !t.isCharacter(41)) && (this.rbracesExpected <= 0 || !t.isCharacter(125)) && (this.rbracketsExpected <= 0 || !t.isCharacter(93)) && (!(this.context & gt.Writable) || !t.isOperator("=")); ) this.next.isError() && this.errors.push(new Z(this.next.toString(), this.input, this.locationText(), this.location)), this.advance(), t = this.next;
1151
- }
1152
- };
1153
- var Ht = class extends Rt {
1154
- constructor() {
1155
- super(...arguments), this.errors = [];
1156
- }
1157
- visitPipe() {
1158
- this.errors.push("pipes");
1159
- }
1160
- };
1161
- function Fs(r3) {
1162
- let t = /* @__PURE__ */ new Map(), e = 0, s = 0, i = 0;
1163
- for (; i < r3.length; ) {
1164
- let n = r3[i];
1165
- if (n.type === 9) {
1166
- let [a, o] = n.parts;
1167
- e += o.length, s += a.length;
1168
- } else {
1169
- let a = n.parts.reduce((o, p) => o + p.length, 0);
1170
- s += a, e += a;
1171
- }
1172
- t.set(s, e), i++;
1173
- }
1174
- return t;
1175
- }
1176
- function Ce({ start: r3, end: t }, e) {
1177
- let s = r3, i = t;
1178
- for (; i !== s && /\s/.test(e[i - 1]); ) i--;
1179
- for (; s !== i && /\s/.test(e[s]); ) s++;
1180
- return { start: s, end: i };
1181
- }
1182
- function Ws({ start: r3, end: t }, e) {
1183
- let s = r3, i = t;
1184
- for (; i !== e.length && /\s/.test(e[i]); ) i++;
1185
- for (; s !== 0 && /\s/.test(e[s - 1]); ) s--;
1186
- return { start: s, end: i };
1187
- }
1188
- function Gs(r3, t) {
1189
- return t[r3.start - 1] === "(" && t[r3.end] === ")" ? { start: r3.start - 1, end: r3.end + 1 } : r3;
1190
- }
1191
- function Ae(r3, t, e) {
1192
- let s = 0, i = { start: r3.start, end: r3.end };
1193
- for (; ; ) {
1194
- let n = Ws(i, t), a = Gs(n, t);
1195
- if (n.start === a.start && n.end === a.end) break;
1196
- i.start = a.start, i.end = a.end, s++;
1197
- }
1198
- return { hasParens: (e ? s - 1 : s) !== 0, outerSpan: Ce(e ? { start: i.start + 1, end: i.end - 1 } : i, t), innerSpan: Ce(r3, t) };
1199
- }
1200
- function Oe(r3) {
1201
- return typeof r3 == "string" ? (t) => t === r3 : (t) => r3.test(t);
1202
- }
1203
- function Ie(r3, t, e) {
1204
- let s = Oe(t);
1205
- for (let i = e; i >= 0; i--) {
1206
- let n = r3[i];
1207
- if (s(n)) return i;
1208
- }
1209
- throw new Error(`Cannot find front char ${t} from index ${e} in ${JSON.stringify(r3)}`);
1210
- }
1211
- function ke(r3, t, e) {
1212
- let s = Oe(t);
1213
- for (let i = e; i < r3.length; i++) {
1214
- let n = r3[i];
1215
- if (s(n)) return i;
1216
- }
1217
- throw new Error(`Cannot find character ${t} from index ${e} in ${JSON.stringify(r3)}`);
1218
- }
1219
- function Ne(r3) {
1220
- return r3.slice(0, 1).toLowerCase() + r3.slice(1);
1221
- }
1222
- function Ct(r3) {
1223
- let { start: t, end: e } = r3;
1224
- return { start: t, end: e, range: [t, e] };
1225
- }
1226
- var Vs = (r3) => mt.prototype._commentStart(r3);
1227
- function Qs(r3, t) {
1228
- let e = t ? Vs(r3) : null;
1229
- if (e === null) return { text: r3, comments: [] };
1230
- let s = { type: "CommentLine", value: r3.slice(e + 2), ...Ct({ start: e, end: r3.length }) };
1231
- return { text: r3.slice(0, e), comments: [s] };
1232
- }
1233
- function At(r3, t = true) {
1234
- return (e) => {
1235
- let s = new yt(), i = new mt(s), { text: n, comments: a } = Qs(e, t), o = r3(n, i);
1236
- if (o.errors.length !== 0) {
1237
- let [{ message: p }] = o.errors;
1238
- throw new SyntaxError(p.replace(/^Parser Error: | at column \d+ in [^]*$/g, ""));
1239
- }
1240
- return { result: o, comments: a, text: n };
1241
- };
1242
- }
1243
- var Le = At((r3, t) => t.parseBinding(r3, "", 0));
1244
- var Re = At((r3, t) => t.parseAction(r3, "", 0));
1245
- var Pe = At((r3, t) => t.parseInterpolationExpression(r3, "", 0));
1246
- var be = At((r3, t) => t.parseTemplateBindings("", r3, "", 0, 0), false);
1247
- var Hs = (r3, t, e) => {
1248
- if (!(r3 && t == null)) return Array.isArray(t) || typeof t == "string" ? t[e < 0 ? t.length + e : e] : t.at(e);
1249
- };
1250
- var Tt = Hs;
1251
- var jt = class {
1252
- text;
1253
- constructor(t) {
1254
- this.text = t;
1255
- }
1256
- getCharacterIndex(t, e) {
1257
- return ke(this.text, t, e);
1258
- }
1259
- getCharacterLastIndex(t, e) {
1260
- return Ie(this.text, t, e);
1261
- }
1262
- transformSpan(t, { stripSpaces: e = false, hasParentParens: s = false } = {}) {
1263
- if (!e) return Ct(t);
1264
- let { outerSpan: i, innerSpan: n, hasParens: a } = Ae(t, this.text, s), o = Ct(n);
1265
- return a && (o.extra = { parenthesized: true, parenStart: i.start, parenEnd: i.end }), o;
1266
- }
1267
- createNode(t, { stripSpaces: e = true, hasParentParens: s = false } = {}) {
1268
- let { type: i, start: n, end: a } = t, o = { ...t, ...this.transformSpan({ start: n, end: a }, { stripSpaces: e, hasParentParens: s }) };
1269
- switch (i) {
1270
- case "NumericLiteral":
1271
- case "StringLiteral": {
1272
- let p = this.text.slice(o.start, o.end), { value: u } = o;
1273
- o.extra = { ...o.extra, raw: p, rawValue: u };
1274
- break;
1275
- }
1276
- case "ObjectProperty": {
1277
- let { shorthand: p } = o;
1278
- p && (o.extra = { ...o.extra, shorthand: p });
1279
- break;
1280
- }
1281
- }
1282
- return o;
1283
- }
1284
- };
1285
- var Ke = jt;
1286
- function Zt(r3) {
1287
- var t;
1288
- return !!((t = r3.extra) != null && t.parenthesized);
1289
- }
1290
- function k(r3) {
1291
- return Zt(r3) ? r3.extra.parenStart : r3.start;
1292
- }
1293
- function N(r3) {
1294
- return Zt(r3) ? r3.extra.parenEnd : r3.end;
1295
- }
1296
- function Be(r3) {
1297
- return (r3.type === "OptionalCallExpression" || r3.type === "OptionalMemberExpression") && !Zt(r3);
1298
- }
1299
- function Te(r3, t) {
1300
- let { start: e, end: s } = r3.sourceSpan;
1301
- return e >= s || /^\s+$/.test(t.slice(e, s));
1302
- }
1303
- var kt;
1304
- var St;
1305
- var h;
1306
- var d;
1307
- var Ot;
1308
- var v;
1309
- var Yt;
1310
- var It = class extends Ke {
1311
- constructor(e, s) {
1312
- super(s);
1313
- P(this, h);
1314
- P(this, kt);
1315
- P(this, St);
1316
- Y(this, kt, e), Y(this, St, s);
1317
- }
1318
- get node() {
1319
- return c(this, h, v).call(this, O(this, kt));
1320
- }
1321
- transformNode(e) {
1322
- return c(this, h, Yt).call(this, e);
1323
- }
1324
- };
1325
- kt = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakMap(), h = /* @__PURE__ */ new WeakSet(), d = function(e, { stripSpaces: s = true, hasParentParens: i = false } = {}) {
1326
- return this.createNode(e, { stripSpaces: s, hasParentParens: i });
1327
- }, Ot = function(e, s, { computed: i, optional: n, end: a = N(s), hasParentParens: o = false }) {
1328
- if (Te(e, O(this, St)) || e.sourceSpan.start === s.start) return s;
1329
- let p = c(this, h, v).call(this, e), u = Be(p);
1330
- return c(this, h, d).call(this, { type: n || u ? "OptionalMemberExpression" : "MemberExpression", object: p, property: s, computed: i, ...n ? { optional: true } : u ? { optional: false } : void 0, start: k(p), end: a }, { hasParentParens: o });
1331
- }, v = function(e, s = false) {
1332
- return c(this, h, Yt).call(this, e, s);
1333
- }, Yt = function(e, s = false) {
1334
- if (e instanceof ot) {
1335
- let { expressions: i } = e;
1336
- if (i.length !== 1) throw new Error("Unexpected 'Interpolation'");
1337
- return c(this, h, v).call(this, i[0]);
1338
- }
1339
- if (e instanceof F) return c(this, h, d).call(this, { type: "UnaryExpression", prefix: true, argument: c(this, h, v).call(this, e.expr), operator: e.operator, ...e.sourceSpan }, { hasParentParens: s });
1340
- if (e instanceof A) {
1341
- let { left: i, operation: n, right: a } = e, o = c(this, h, v).call(this, i), p = c(this, h, v).call(this, a), u = k(o), f = N(p), S = { left: o, right: p, start: u, end: f };
1342
- return n === "&&" || n === "||" || n === "??" ? c(this, h, d).call(this, { ...S, type: "LogicalExpression", operator: n }, { hasParentParens: s }) : c(this, h, d).call(this, { ...S, type: "BinaryExpression", operator: n }, { hasParentParens: s });
1343
- }
1344
- if (e instanceof it) {
1345
- let { exp: i, name: n, args: a } = e, o = c(this, h, v).call(this, i), p = k(o), u = N(o), f = this.getCharacterIndex(/\S/, this.getCharacterIndex("|", u) + 1), S = c(this, h, d).call(this, { type: "Identifier", name: n, start: f, end: f + n.length }), g = a.map((y) => c(this, h, v).call(this, y));
1346
- return c(this, h, d).call(this, { type: "NGPipeExpression", left: o, right: S, arguments: g, start: p, end: N(g.length === 0 ? S : Tt(false, g, -1)) }, { hasParentParens: s });
1347
- }
1348
- if (e instanceof X) return c(this, h, d).call(this, { type: "NGChainedExpression", expressions: e.expressions.map((i) => c(this, h, v).call(this, i)), ...e.sourceSpan }, { hasParentParens: s });
1349
- if (e instanceof tt) {
1350
- let { condition: i, trueExp: n, falseExp: a } = e, o = c(this, h, v).call(this, i), p = c(this, h, v).call(this, n), u = c(this, h, v).call(this, a);
1351
- return c(this, h, d).call(this, { type: "ConditionalExpression", test: o, consequent: p, alternate: u, start: k(o), end: N(u) }, { hasParentParens: s });
1352
- }
1353
- if (e instanceof $) return c(this, h, d).call(this, { type: "NGEmptyExpression", ...e.sourceSpan }, { hasParentParens: s });
1354
- if (e instanceof K) return c(this, h, d).call(this, { type: "ThisExpression", ...e.sourceSpan }, { hasParentParens: s });
1355
- if (e instanceof st || e instanceof U) return c(this, h, Ot).call(this, e.receiver, c(this, h, v).call(this, e.key), { computed: true, optional: e instanceof U, end: e.sourceSpan.end, hasParentParens: s });
1356
- if (e instanceof nt) return c(this, h, d).call(this, { type: "ArrayExpression", elements: e.expressions.map((i) => c(this, h, v).call(this, i)), ...e.sourceSpan }, { hasParentParens: s });
1357
- if (e instanceof at) {
1358
- let { keys: i, values: n } = e, a = n.map((p) => c(this, h, v).call(this, p)), o = i.map(({ key: p, quoted: u }, f) => {
1359
- let S = a[f], g = k(S), y = N(S), w = this.getCharacterIndex(/\S/, f === 0 ? e.sourceSpan.start + 1 : this.getCharacterIndex(",", N(a[f - 1])) + 1), H = g === w ? y : this.getCharacterLastIndex(/\S/, this.getCharacterLastIndex(":", g - 1) - 1) + 1, j = { start: w, end: H }, T = u ? c(this, h, d).call(this, { type: "StringLiteral", value: p, ...j }) : c(this, h, d).call(this, { type: "Identifier", name: p, ...j }), Nt = T.end < T.start || w === g;
1360
- return c(this, h, d).call(this, { type: "ObjectProperty", key: T, value: S, shorthand: Nt, computed: false, start: k(T), end: y });
1361
- });
1362
- return c(this, h, d).call(this, { type: "ObjectExpression", properties: o, ...e.sourceSpan }, { hasParentParens: s });
1363
- }
1364
- if (e instanceof E) {
1365
- let { value: i } = e;
1366
- switch (typeof i) {
1367
- case "boolean":
1368
- return c(this, h, d).call(this, { type: "BooleanLiteral", value: i, ...e.sourceSpan }, { hasParentParens: s });
1369
- case "number":
1370
- return c(this, h, d).call(this, { type: "NumericLiteral", value: i, ...e.sourceSpan }, { hasParentParens: s });
1371
- case "object":
1372
- return c(this, h, d).call(this, { type: "NullLiteral", ...e.sourceSpan }, { hasParentParens: s });
1373
- case "string":
1374
- return c(this, h, d).call(this, { type: "StringLiteral", value: i, ...e.sourceSpan }, { hasParentParens: s });
1375
- case "undefined":
1376
- return c(this, h, d).call(this, { type: "Identifier", name: "undefined", ...e.sourceSpan }, { hasParentParens: s });
1377
- default:
1378
- throw new Error(`Unexpected LiteralPrimitive value type ${typeof i}`);
1379
- }
1380
- }
1381
- if (e instanceof pt || e instanceof D) {
1382
- let i = e instanceof D, { receiver: n, args: a } = e, o = a.length === 1 ? [c(this, h, v).call(this, a[0], true)] : a.map((S) => c(this, h, v).call(this, S)), p = c(this, h, v).call(this, n), u = Be(p), f = i || u ? "OptionalCallExpression" : "CallExpression";
1383
- return c(this, h, d).call(this, { type: f, callee: p, arguments: o, optional: f === "OptionalCallExpression" ? i : void 0, start: k(p), end: e.sourceSpan.end }, { hasParentParens: s });
1384
- }
1385
- if (e instanceof ht) {
1386
- let i = c(this, h, v).call(this, e.expression);
1387
- return c(this, h, d).call(this, { type: "TSNonNullExpression", expression: i, start: k(i), end: e.sourceSpan.end }, { hasParentParens: s });
1388
- }
1389
- if (e instanceof ct) {
1390
- let i = c(this, h, v).call(this, e.expression);
1391
- return c(this, h, d).call(this, { type: "UnaryExpression", prefix: true, operator: "!", argument: i, start: e.sourceSpan.start, end: N(i) }, { hasParentParens: s });
1392
- }
1393
- if (e instanceof M || e instanceof _) {
1394
- let { receiver: i, name: n } = e, a = this.getCharacterLastIndex(/\S/, e.sourceSpan.end - 1) + 1, o = c(this, h, d).call(this, { type: "Identifier", name: n, start: a - n.length, end: a }, Te(i, O(this, St)) ? { hasParentParens: s } : {});
1395
- return c(this, h, Ot).call(this, i, o, { computed: false, optional: e instanceof _, hasParentParens: s });
1396
- }
1397
- if (e instanceof rt) {
1398
- let i = c(this, h, v).call(this, e.key), n = c(this, h, v).call(this, e.value), a = c(this, h, Ot).call(this, e.receiver, i, { computed: true, optional: false, end: this.getCharacterIndex("]", N(i)) + 1 });
1399
- return c(this, h, d).call(this, { type: "AssignmentExpression", left: a, operator: "=", right: n, start: k(a), end: N(n) }, { hasParentParens: s });
1400
- }
1401
- if (e instanceof et) {
1402
- let { receiver: i, name: n, value: a } = e, o = c(this, h, v).call(this, a), p = this.getCharacterLastIndex(/\S/, this.getCharacterLastIndex("=", k(o) - 1) - 1) + 1, u = c(this, h, d).call(this, { type: "Identifier", name: n, start: p - n.length, end: p }), f = c(this, h, Ot).call(this, i, u, { computed: false, optional: false });
1403
- return c(this, h, d).call(this, { type: "AssignmentExpression", left: f, operator: "=", right: o, start: k(f), end: N(o) }, { hasParentParens: s });
1404
- }
1405
- throw Object.assign(new Error("Unexpected node"), { node: e });
1406
- };
1407
- function Me(r3, t) {
1408
- return new It(r3, t).node;
1409
- }
1410
- function _e(r3) {
1411
- return r3 instanceof ut;
1412
- }
1413
- function Ue(r3) {
1414
- return r3 instanceof W;
1415
- }
1416
- var wt;
1417
- var q;
1418
- var x;
1419
- var Fe;
1420
- var C;
1421
- var Xt;
1422
- var te;
1423
- var ee;
1424
- var De;
1425
- var We;
1426
- var Ge;
1427
- var Ve;
1428
- var Jt = class extends It {
1429
- constructor(e, s) {
1430
- super(void 0, s);
1431
- P(this, x);
1432
- P(this, wt);
1433
- P(this, q);
1434
- Y(this, wt, e), Y(this, q, s);
1435
- for (let i of e) c(this, x, De).call(this, i);
1436
- }
1437
- get expressions() {
1438
- return c(this, x, Ge).call(this);
1439
- }
1440
- };
1441
- wt = /* @__PURE__ */ new WeakMap(), q = /* @__PURE__ */ new WeakMap(), x = /* @__PURE__ */ new WeakSet(), Fe = function() {
1442
- return O(this, wt)[0].key;
1443
- }, C = function(e, { stripSpaces: s = true } = {}) {
1444
- return this.createNode(e, { stripSpaces: s });
1445
- }, Xt = function(e) {
1446
- return this.transformNode(e);
1447
- }, te = function(e) {
1448
- return Ne(e.slice(O(this, x, Fe).source.length));
1449
- }, ee = function(e) {
1450
- let s = O(this, q);
1451
- if (s[e.start] !== '"' && s[e.start] !== "'") return;
1452
- let i = s[e.start], n = false;
1453
- for (let a = e.start + 1; a < s.length; a++) switch (s[a]) {
1454
- case i:
1455
- if (!n) {
1456
- e.end = a + 1;
1457
- return;
1458
- }
1459
- default:
1460
- n = false;
1461
- break;
1462
- case "\\":
1463
- n = !n;
1464
- break;
1465
- }
1466
- }, De = function(e) {
1467
- c(this, x, ee).call(this, e.key.span), Ue(e) && e.value && c(this, x, ee).call(this, e.value.span);
1468
- }, We = function(e) {
1469
- if (!e.value || e.value.source) return e.value;
1470
- let s = this.getCharacterIndex(/\S/, e.sourceSpan.start);
1471
- return { source: "$implicit", span: { start: s, end: s } };
1472
- }, Ge = function() {
1473
- let e = O(this, wt), [s] = e, i = O(this, q).slice(s.sourceSpan.start, s.sourceSpan.end).trim().length === 0 ? e.slice(1) : e, n = [], a = null;
1474
- for (let [o, p] of i.entries()) {
1475
- if (a && _e(a) && Ue(p) && p.value && p.value.source === a.key.source) {
1476
- let u = c(this, x, C).call(this, { type: "NGMicrosyntaxKey", name: p.key.source, ...p.key.span }), f = (y, w) => ({ ...y, ...this.transformSpan({ start: y.start, end: w }) }), S = (y) => ({ ...f(y, u.end), alias: u }), g = n.pop();
1477
- if (g.type === "NGMicrosyntaxExpression") n.push(S(g));
1478
- else if (g.type === "NGMicrosyntaxKeyedExpression") {
1479
- let y = S(g.expression);
1480
- n.push(f({ ...g, expression: y }, y.end));
1481
- } else throw new Error(`Unexpected type ${g.type}`);
1482
- } else n.push(c(this, x, Ve).call(this, p, o));
1483
- a = p;
1484
- }
1485
- return c(this, x, C).call(this, { type: "NGMicrosyntax", body: n, ...n.length === 0 ? e[0].sourceSpan : { start: n[0].start, end: Tt(false, n, -1).end } });
1486
- }, Ve = function(e, s) {
1487
- if (_e(e)) {
1488
- let { key: i, value: n } = e;
1489
- return n ? s === 0 ? c(this, x, C).call(this, { type: "NGMicrosyntaxExpression", expression: c(this, x, Xt).call(this, n.ast), alias: null, ...n.sourceSpan }) : c(this, x, C).call(this, { type: "NGMicrosyntaxKeyedExpression", key: c(this, x, C).call(this, { type: "NGMicrosyntaxKey", name: c(this, x, te).call(this, i.source), ...i.span }), expression: c(this, x, C).call(this, { type: "NGMicrosyntaxExpression", expression: c(this, x, Xt).call(this, n.ast), alias: null, ...n.sourceSpan }), start: i.span.start, end: n.sourceSpan.end }) : c(this, x, C).call(this, { type: "NGMicrosyntaxKey", name: c(this, x, te).call(this, i.source), ...i.span });
1490
- } else {
1491
- let { key: i, sourceSpan: n } = e;
1492
- if (/^let\s$/.test(O(this, q).slice(n.start, n.start + 4))) {
1493
- let { value: o } = e;
1494
- return c(this, x, C).call(this, { type: "NGMicrosyntaxLet", key: c(this, x, C).call(this, { type: "NGMicrosyntaxKey", name: i.source, ...i.span }), value: o ? c(this, x, C).call(this, { type: "NGMicrosyntaxKey", name: o.source, ...o.span }) : null, start: n.start, end: o ? o.span.end : i.span.end });
1495
- } else {
1496
- let o = c(this, x, We).call(this, e);
1497
- return c(this, x, C).call(this, { type: "NGMicrosyntaxAs", key: c(this, x, C).call(this, { type: "NGMicrosyntaxKey", name: o.source, ...o.span }), alias: c(this, x, C).call(this, { type: "NGMicrosyntaxKey", name: i.source, ...i.span }), start: o.span.start, end: i.span.end });
1498
- }
1499
- }
1500
- };
1501
- function Qe(r3, t) {
1502
- return new Jt(r3, t).expressions;
1503
- }
1504
- function Mt({ result: { ast: r3 }, text: t, comments: e }) {
1505
- return Object.assign(Me(r3, t), { comments: e });
1506
- }
1507
- function ze({ result: { templateBindings: r3 }, text: t }) {
1508
- return Qe(r3, t);
1509
- }
1510
- var qe = (r3) => Mt(Le(r3));
1511
- var He = (r3) => Mt(Pe(r3));
1512
- var se = (r3) => Mt(Re(r3));
1513
- var je = (r3) => ze(be(r3));
1514
- function re(r3) {
1515
- var s, i, n;
1516
- let t = ((s = r3.range) == null ? void 0 : s[0]) ?? r3.start, e = (n = ((i = r3.declaration) == null ? void 0 : i.decorators) ?? r3.decorators) == null ? void 0 : n[0];
1517
- return e ? Math.min(re(e), t) : t;
1518
- }
1519
- function Ye(r3) {
1520
- var t;
1521
- return ((t = r3.range) == null ? void 0 : t[1]) ?? r3.end;
1522
- }
1523
- function _t(r3) {
1524
- return { astFormat: "estree", parse(t) {
1525
- let e = r3(t);
1526
- return { type: "NGRoot", node: r3 === se && e.type !== "NGChainedExpression" ? { ...e, type: "NGChainedExpression", expressions: [e] } : e };
1527
- }, locStart: re, locEnd: Ye };
1528
- }
1529
- var js = _t(se);
1530
- var Ys = _t(qe);
1531
- var Zs = _t(He);
1532
- var Js = _t(je);
1533
- var Ur = ne;
1534
-
1535
- export { Ur as default, ie as parsers };
1536
- //# sourceMappingURL=angular-7QLNOURG.js.map
1537
- //# sourceMappingURL=angular-7QLNOURG.js.map