@tbela99/css-parser 1.4.11 → 1.6.0

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 (80) hide show
  1. package/CHANGELOG.md +39 -0
  2. package/README.md +18 -11
  3. package/dist/index-umd-web.js +6558 -5310
  4. package/dist/index.cjs +6576 -5313
  5. package/dist/index.d.ts +805 -279
  6. package/dist/lib/ast/clone.js +13 -8
  7. package/dist/lib/ast/expand.js +65 -15
  8. package/dist/lib/ast/features/calc.js +19 -56
  9. package/dist/lib/ast/features/if.js +28 -4
  10. package/dist/lib/ast/features/inlinecssvariables.js +6 -5
  11. package/dist/lib/ast/features/prefix.js +52 -73
  12. package/dist/lib/ast/features/shorthand.js +11 -6
  13. package/dist/lib/ast/features/transform.js +6 -3
  14. package/dist/lib/ast/find.js +7 -5
  15. package/dist/lib/ast/math/expression.js +190 -32
  16. package/dist/lib/ast/minify.js +117 -49
  17. package/dist/lib/ast/node.js +52 -0
  18. package/dist/lib/ast/transform/compute.js +63 -4
  19. package/dist/lib/ast/transform/minify.js +6 -6
  20. package/dist/lib/ast/transform/perspective.js +1 -1
  21. package/dist/lib/ast/transform/rotate.js +1 -1
  22. package/dist/lib/ast/transform/scale.js +1 -1
  23. package/dist/lib/ast/transform/skew.js +1 -1
  24. package/dist/lib/ast/transform/translate.js +1 -1
  25. package/dist/lib/ast/transform/utils.js +46 -18
  26. package/dist/lib/ast/types.js +1 -1
  27. package/dist/lib/ast/walk.js +55 -11
  28. package/dist/lib/fs/resolve.js +68 -27
  29. package/dist/lib/parser/declaration/list.js +22 -7
  30. package/dist/lib/parser/declaration/map.js +40 -13
  31. package/dist/lib/parser/declaration/set.js +3 -1
  32. package/dist/lib/parser/linesmap.js +2 -12
  33. package/dist/lib/parser/parse.js +843 -912
  34. package/dist/lib/parser/source.js +16 -2
  35. package/dist/lib/parser/tokenize.js +1489 -725
  36. package/dist/lib/parser/utils/at-rule-container.js +29 -196
  37. package/dist/lib/parser/utils/at-rule-generic.js +6 -7
  38. package/dist/lib/parser/utils/at-rule-import.js +17 -13
  39. package/dist/lib/parser/utils/at-rule-media.js +36 -19
  40. package/dist/lib/parser/utils/at-rule-support.js +19 -9
  41. package/dist/lib/parser/utils/at-rule-when-else.js +11 -38
  42. package/dist/lib/parser/utils/at-rule.js +0 -18
  43. package/dist/lib/parser/utils/declaration.js +30 -95
  44. package/dist/lib/parser/utils/hash.js +4 -4
  45. package/dist/lib/parser/utils/selector.js +164 -141
  46. package/dist/lib/parser/utils/text.js +4 -2
  47. package/dist/lib/renderer/render.js +230 -125
  48. package/dist/lib/renderer/sourcemap/lib/codec.js +78 -0
  49. package/dist/lib/renderer/sourcemap/sourcemap.js +187 -34
  50. package/dist/lib/syntax/color/a98rgb.js +14 -4
  51. package/dist/lib/syntax/color/cmyk.js +10 -18
  52. package/dist/lib/syntax/color/color-mix.js +21 -34
  53. package/dist/lib/syntax/color/color.js +32 -49
  54. package/dist/lib/syntax/color/hsl.js +15 -15
  55. package/dist/lib/syntax/color/hwb.js +18 -17
  56. package/dist/lib/syntax/color/lab.js +17 -17
  57. package/dist/lib/syntax/color/lch.js +13 -13
  58. package/dist/lib/syntax/color/oklab.js +10 -11
  59. package/dist/lib/syntax/color/oklch.js +15 -18
  60. package/dist/lib/syntax/color/p3.js +18 -12
  61. package/dist/lib/syntax/color/prophotorgb.js +26 -28
  62. package/dist/lib/syntax/color/rec2020.js +8 -4
  63. package/dist/lib/syntax/color/relative-color.js +26 -10
  64. package/dist/lib/syntax/color/srgb.js +5 -4
  65. package/dist/lib/syntax/color/utils/distance.js +1 -1
  66. package/dist/lib/syntax/color/xyz.js +2 -2
  67. package/dist/lib/syntax/color/xyzd50.js +2 -2
  68. package/dist/lib/syntax/constants.js +12 -2
  69. package/dist/lib/syntax/syntax.js +45 -258
  70. package/dist/lib/validation/config.json.js +3 -0
  71. package/dist/lib/validation/match.js +110 -27
  72. package/dist/node.js +55 -33
  73. package/dist/types.d.ts +5 -1
  74. package/dist/types.js +4 -0
  75. package/dist/utils/sync.d.ts +16 -0
  76. package/dist/utils/sync.js +73 -0
  77. package/dist/web.js +37 -30
  78. package/package.json +1 -1
  79. package/dist/lib/renderer/sourcemap/lib/encode.js +0 -37
  80. package/llms.txt +0 -73
@@ -6,7 +6,11 @@ import { FeatureWalkMode } from './type.js';
6
6
  import { STATE } from '../../syntax/constants.js';
7
7
 
8
8
  class TransformCssFeature {
9
- accept = new Set([EnumToken.RuleNodeType, EnumToken.KeyFramesRuleNodeType]);
9
+ accept = new Set([
10
+ EnumToken.RuleNodeType,
11
+ EnumToken.AtRuleNodeType,
12
+ EnumToken.KeyframesRuleNodeType,
13
+ ]);
10
14
  get ordering() {
11
15
  return 3;
12
16
  }
@@ -21,7 +25,7 @@ class TransformCssFeature {
21
25
  }
22
26
  }
23
27
  run(ast) {
24
- if (!("chi" in ast)) {
28
+ if (ast.chi == null) {
25
29
  return null;
26
30
  }
27
31
  let i = 0;
@@ -43,7 +47,6 @@ class TransformCssFeature {
43
47
  ? minifyTransformFunctions(child)
44
48
  : child);
45
49
  }
46
- // consumeWhitespace(children);
47
50
  let { matrix, cumulative, minified } = compute(children) ?? {
48
51
  matrix: null,
49
52
  cumulative: null,
@@ -3,7 +3,7 @@ import { walk, walkValues } from './walk.js';
3
3
  import { TOKENS } from '../syntax/constants.js';
4
4
 
5
5
  /**
6
- * Search the ast sub-tree and return the first match
6
+ * Search the ast subtree and return the first match
7
7
  *
8
8
  * ```ts
9
9
  * // find the first ast declaration node which name is 'aspect-ratio'
@@ -42,6 +42,11 @@ function find(ast, matcher) {
42
42
  return null;
43
43
  }
44
44
  /**
45
+ *
46
+ * @param ast
47
+ * @param matcher
48
+ * @returns
49
+ *
45
50
  * Search the ast sub-tree by checking each node's value token and return the first match
46
51
  *
47
52
  ```ts
@@ -67,10 +72,6 @@ button {
67
72
  console.log({node, value});
68
73
 
69
74
  ```
70
- *
71
- * @param ast
72
- * @param matcher
73
- * @returns
74
75
  */
75
76
  function findByValue(ast, matcher) {
76
77
  let source;
@@ -87,6 +88,7 @@ function findByValue(ast, matcher) {
87
88
  }
88
89
  for (const { value, parent, root: rootNode, parents } of walkValues(source, node)) {
89
90
  if (matcher(value, node)) {
91
+ // @ts-ignore
90
92
  return { node, value: { node: value, parent, root: rootNode, parents } };
91
93
  }
92
94
  }
@@ -1,4 +1,4 @@
1
- import { mathFuncs, LOC } from '../../syntax/constants.js';
1
+ import { mathFuncs, LOCEND, LOCSTA, LOCSRCID } from '../../syntax/constants.js';
2
2
  import { EnumToken } from '../types.js';
3
3
  import { rem, compute } from './math.js';
4
4
 
@@ -28,7 +28,9 @@ function evaluate(tokens) {
28
28
  if (acc.length > 0) {
29
29
  acc.push({ typ: EnumToken.CommaTokenType });
30
30
  }
31
- acc.push(...t);
31
+ for (const token of t) {
32
+ acc.push(token);
33
+ }
32
34
  return acc;
33
35
  });
34
36
  const result = evaluateFunc(tokens[0]);
@@ -58,7 +60,9 @@ function evaluate(tokens) {
58
60
  // @ts-ignore
59
61
  val: Math[nodes[0].val.toUpperCase()],
60
62
  typ: EnumToken.NumberTokenType,
61
- [LOC]: nodes[0][LOC],
63
+ [LOCSRCID]: nodes[0][LOCSRCID],
64
+ [LOCSTA]: nodes[0][LOCSTA],
65
+ [LOCEND]: nodes[0][LOCEND],
62
66
  },
63
67
  ];
64
68
  }
@@ -78,11 +82,19 @@ function evaluate(tokens) {
78
82
  token = {
79
83
  typ: EnumToken.ListToken,
80
84
  chi: [nodes[i], nodes[i + 1]],
81
- [LOC]: { ...nodes[i][LOC], end: nodes[i + 1][LOC].end },
85
+ [LOCSRCID]: nodes[i][LOCSRCID],
86
+ [LOCSTA]: nodes[i][LOCSTA],
87
+ [LOCEND]: nodes[i + 1][LOCEND],
82
88
  };
83
89
  }
84
90
  else {
85
- token = doEvaluate(nodes[i + 1], { typ: EnumToken.NumberTokenType, val: -1, [LOC]: nodes[i + 1][LOC] }, EnumToken.Mul);
91
+ token = doEvaluate(nodes[i + 1], {
92
+ typ: EnumToken.NumberTokenType,
93
+ val: -1,
94
+ [LOCSRCID]: nodes[i + 1][LOCSRCID],
95
+ [LOCSTA]: nodes[i + 1][LOCSTA],
96
+ [LOCEND]: nodes[i + 1][LOCEND],
97
+ }, EnumToken.Mul);
86
98
  }
87
99
  i++;
88
100
  }
@@ -97,16 +109,28 @@ function evaluate(tokens) {
97
109
  const token = curr[1].reduce((acc, curr) => doEvaluate(acc, curr, EnumToken.Add));
98
110
  if (token.typ != EnumToken.BinaryExpressionTokenType) {
99
111
  if ("val" in token && +token.val < 0) {
100
- acc.push({ typ: EnumToken.Sub, [LOC]: token[LOC] }, {
112
+ acc.push({
113
+ typ: EnumToken.Sub,
114
+ [LOCSRCID]: token[LOCSRCID],
115
+ [LOCSTA]: token[LOCSTA],
116
+ [LOCEND]: token[LOCEND],
117
+ }, {
101
118
  ...token,
102
119
  val: -token.val,
103
- [LOC]: token[LOC],
120
+ [LOCSRCID]: token[LOCSRCID],
121
+ [LOCSTA]: token[LOCSTA],
122
+ [LOCEND]: token[LOCEND],
104
123
  });
105
124
  return acc;
106
125
  }
107
126
  }
108
127
  if (acc.length > 0 && curr[0] != EnumToken.ListToken) {
109
- acc.push({ typ: EnumToken.Add, [LOC]: token[LOC] });
128
+ acc.push({
129
+ typ: EnumToken.Add,
130
+ [LOCSRCID]: token[LOCSRCID],
131
+ [LOCSTA]: token[LOCSTA],
132
+ [LOCEND]: token[LOCEND],
133
+ });
110
134
  }
111
135
  acc.push(token);
112
136
  return acc;
@@ -124,7 +148,9 @@ function doEvaluate(l, r, op) {
124
148
  op,
125
149
  l,
126
150
  r,
127
- [LOC]: { ...l[LOC], end: (r?.[LOC] ?? l[LOC])?.end },
151
+ [LOCSRCID]: l[LOCSRCID],
152
+ [LOCSTA]: l[LOCSTA],
153
+ [LOCEND]: r?.[LOCEND] ?? l[LOCEND],
128
154
  };
129
155
  if (!isScalarToken(l) || !isScalarToken(r) || (l.typ == r.typ && "unit" in l && "unit" in r && l.unit != r.unit)) {
130
156
  return defaultReturn;
@@ -162,15 +188,39 @@ function doEvaluate(l, r, op) {
162
188
  if (typeof v1 == "number" && l.typ == EnumToken.PercentageTokenType) {
163
189
  v1 = {
164
190
  typ: EnumToken.FractionTokenType,
165
- l: { typ: EnumToken.NumberTokenType, val: v1, [LOC]: l[LOC] },
166
- r: { typ: EnumToken.NumberTokenType, val: 100, [LOC]: r[LOC] },
191
+ l: {
192
+ typ: EnumToken.NumberTokenType,
193
+ val: v1,
194
+ [LOCSRCID]: l[LOCSRCID],
195
+ [LOCSTA]: l[LOCSTA],
196
+ [LOCEND]: l[LOCEND],
197
+ },
198
+ r: {
199
+ typ: EnumToken.NumberTokenType,
200
+ val: 100,
201
+ [LOCSRCID]: r[LOCSRCID],
202
+ [LOCSTA]: r[LOCSTA],
203
+ [LOCEND]: r[LOCEND],
204
+ },
167
205
  };
168
206
  }
169
207
  else if (typeof v2 == "number" && r.typ == EnumToken.PercentageTokenType) {
170
208
  v2 = {
171
209
  typ: EnumToken.FractionTokenType,
172
- l: { typ: EnumToken.NumberTokenType, val: v2, [LOC]: l[LOC] },
173
- r: { typ: EnumToken.NumberTokenType, val: 100, [LOC]: r[LOC] },
210
+ l: {
211
+ typ: EnumToken.NumberTokenType,
212
+ val: v2,
213
+ [LOCSRCID]: l[LOCSRCID],
214
+ [LOCSTA]: l[LOCSTA],
215
+ [LOCEND]: l[LOCEND],
216
+ },
217
+ r: {
218
+ typ: EnumToken.NumberTokenType,
219
+ val: 100,
220
+ [LOCSRCID]: r[LOCSRCID],
221
+ [LOCSTA]: r[LOCSTA],
222
+ [LOCEND]: r[LOCEND],
223
+ },
174
224
  };
175
225
  }
176
226
  }
@@ -181,7 +231,9 @@ function doEvaluate(l, r, op) {
181
231
  ...(l.typ === EnumToken.NumberTokenType || l.typ === EnumToken.IdenTokenType ? r : l),
182
232
  typ,
183
233
  val /* : typeof val == 'number' ? minifyNumber(val) : val */,
184
- [LOC]: { ...l[LOC], end: (r?.[LOC] ?? l?.[LOC])?.end },
234
+ [LOCSRCID]: l[LOCSRCID],
235
+ [LOCSTA]: l[LOCSTA],
236
+ [LOCEND]: r?.[LOCEND] ?? l[LOCEND],
185
237
  };
186
238
  if (token.typ == EnumToken.IdenTokenType) {
187
239
  // @ts-ignore
@@ -210,25 +262,64 @@ function evaluateFunc(token) {
210
262
  case "sign":
211
263
  case "sqrt":
212
264
  case "exp": {
265
+ if (token.val == "tan" || token.val == "atan") {
266
+ for (let i = 0; i < values.length; i++) {
267
+ if (values[i].typ == EnumToken.NumberTokenType) {
268
+ values[i] = Object.assign(values[i], { typ: EnumToken.AngleTokenType, unit: "rad" });
269
+ }
270
+ else if (values[i].typ == EnumToken.AngleTokenType && values[i].unit != "rad") {
271
+ switch (values[i].unit) {
272
+ case "deg":
273
+ Object.assign(values[i], {
274
+ unit: "rad",
275
+ val: values[i].val * (Math.PI / 180),
276
+ });
277
+ break;
278
+ case "grad":
279
+ Object.assign(values[i], {
280
+ unit: "rad",
281
+ val: values[i].val * (Math.PI / 200),
282
+ });
283
+ break;
284
+ case "turn":
285
+ Object.assign(values[i], {
286
+ unit: "rad",
287
+ val: values[i].val * (2 * Math.PI),
288
+ });
289
+ break;
290
+ }
291
+ }
292
+ }
293
+ }
213
294
  const value = evaluate(values);
214
295
  // @ts-ignore
215
- let val = value[0].typ == EnumToken.NumberTokenType
296
+ let val = value[0].typ == EnumToken.NumberTokenType || value[0].typ == EnumToken.AngleTokenType
216
297
  ? +value[0].val
217
298
  : // @ts-expect-error
218
299
  value[0].l.val / value[0].r.val;
219
300
  return [
220
- {
221
- typ: EnumToken.NumberTokenType,
222
- val: Math[token.val](val),
223
- [LOC]: value[0][LOC],
224
- },
301
+ token.val == "tan" || token.val == "atan"
302
+ ? {
303
+ typ: EnumToken.AngleTokenType,
304
+ val: Math[token.val](val),
305
+ unit: "rad",
306
+ [LOCSRCID]: value[0][LOCSRCID],
307
+ [LOCSTA]: value[0][LOCSTA],
308
+ [LOCEND]: value[0][LOCEND],
309
+ }
310
+ : {
311
+ typ: EnumToken.NumberTokenType,
312
+ val: Math[token.val](val),
313
+ [LOCSRCID]: value[0][LOCSRCID],
314
+ [LOCSTA]: value[0][LOCSTA],
315
+ [LOCEND]: value[0][LOCEND],
316
+ },
225
317
  ];
226
318
  }
227
319
  case "hypot": {
228
320
  const chi = values.filter((t) => ![EnumToken.WhitespaceTokenType, EnumToken.CommentTokenType, EnumToken.CommaTokenType].includes(t.typ));
229
321
  let all = [];
230
322
  let ref = chi[0];
231
- let value = 0;
232
323
  for (let i = 0; i < chi.length; i++) {
233
324
  // @ts-ignore
234
325
  const val = getValue(chi[i]);
@@ -236,13 +327,14 @@ function evaluateFunc(token) {
236
327
  return null;
237
328
  }
238
329
  all.push(val);
239
- value += val * val;
240
330
  }
241
331
  return [
242
332
  {
243
333
  ...ref,
244
- val: +Math.sqrt(value).toFixed(rem(...all)),
245
- [LOC]: token[LOC],
334
+ val: Math.hypot(...all),
335
+ [LOCSRCID]: token[LOCSRCID],
336
+ [LOCSTA]: token[LOCSTA],
337
+ [LOCEND]: token[LOCEND],
246
338
  },
247
339
  ];
248
340
  }
@@ -251,6 +343,35 @@ function evaluateFunc(token) {
251
343
  case "rem":
252
344
  case "mod": {
253
345
  const chi = values.filter((t) => ![EnumToken.WhitespaceTokenType, EnumToken.CommentTokenType].includes(t.typ));
346
+ if (token.val == "atan2") {
347
+ for (let i = 0; i < chi.length; i++) {
348
+ if (chi[i].typ == EnumToken.NumberTokenType) {
349
+ chi[i] = Object.assign(chi[i], { typ: EnumToken.AngleTokenType, unit: "rad" });
350
+ }
351
+ else if (chi[i].typ == EnumToken.AngleTokenType && chi[i].unit != "rad") {
352
+ switch (chi[i].unit) {
353
+ case "deg":
354
+ Object.assign(chi[i], {
355
+ unit: "rad",
356
+ val: chi[i].val * (Math.PI / 180),
357
+ });
358
+ break;
359
+ case "grad":
360
+ Object.assign(chi[i], {
361
+ unit: "rad",
362
+ val: chi[i].val * (Math.PI / 200),
363
+ });
364
+ break;
365
+ case "turn":
366
+ Object.assign(chi[i], {
367
+ unit: "rad",
368
+ val: chi[i].val * (2 * Math.PI),
369
+ });
370
+ break;
371
+ }
372
+ }
373
+ }
374
+ }
254
375
  // https://developer.mozilla.org/en-US/docs/Web/CSS/mod
255
376
  const v1 = evaluate([chi[0]]);
256
377
  const v2 = evaluate([chi[2]]);
@@ -271,7 +392,9 @@ function evaluateFunc(token) {
271
392
  {
272
393
  ...v1[0],
273
394
  val: Math.pow(val1, val2),
274
- [LOC]: token[LOC],
395
+ [LOCSRCID]: token[LOCSRCID],
396
+ [LOCSTA]: token[LOCSTA],
397
+ [LOCEND]: token[LOCEND],
275
398
  },
276
399
  ];
277
400
  }
@@ -280,8 +403,12 @@ function evaluateFunc(token) {
280
403
  {
281
404
  ...{},
282
405
  ...v1[0],
406
+ typ: EnumToken.AngleTokenType,
407
+ unit: "rad",
283
408
  val: Math.atan2(val1, val2),
284
- [LOC]: token[LOC],
409
+ [LOCSRCID]: token[LOCSRCID],
410
+ [LOCSTA]: token[LOCSTA],
411
+ [LOCEND]: token[LOCEND],
285
412
  },
286
413
  ];
287
414
  }
@@ -289,7 +416,9 @@ function evaluateFunc(token) {
289
416
  {
290
417
  ...v1[0],
291
418
  val: val2 == 0 ? val1 : val1 - Math.floor(val1 / val2) * val2,
292
- [LOC]: token[LOC],
419
+ [LOCSRCID]: token[LOCSRCID],
420
+ [LOCSTA]: token[LOCSTA],
421
+ [LOCEND]: token[LOCEND],
293
422
  },
294
423
  ];
295
424
  }
@@ -326,7 +455,9 @@ function evaluateFunc(token) {
326
455
  {
327
456
  ...values[0],
328
457
  val: Math.log(val1) / Math.log(val2),
329
- [LOC]: token[LOC],
458
+ [LOCSRCID]: token[LOCSRCID],
459
+ [LOCSTA]: token[LOCSTA],
460
+ [LOCEND]: token[LOCEND],
330
461
  },
331
462
  ];
332
463
  }
@@ -362,7 +493,15 @@ function evaluateFunc(token) {
362
493
  : Math.ceil(val / val2) * val2;
363
494
  }
364
495
  // @ts-ignore
365
- return [{ ...values[0], val, [LOC]: token[LOC] }];
496
+ return [
497
+ {
498
+ ...values[0],
499
+ val,
500
+ [LOCSRCID]: token[LOCSRCID],
501
+ [LOCSTA]: token[LOCSTA],
502
+ [LOCEND]: token[LOCEND],
503
+ },
504
+ ];
366
505
  }
367
506
  }
368
507
  }
@@ -380,7 +519,18 @@ function inlineExpression(token) {
380
519
  result.push(token);
381
520
  }
382
521
  else {
383
- result.push(...inlineExpression(token.l), { typ: token.op, [LOC]: token[LOC] }, ...inlineExpression(token.r));
522
+ for (const child of inlineExpression(token.l)) {
523
+ result.push(child);
524
+ }
525
+ result.push({
526
+ typ: token.op,
527
+ [LOCSRCID]: token[LOCSRCID],
528
+ [LOCSTA]: token[LOCSTA],
529
+ [LOCEND]: token[LOCEND],
530
+ });
531
+ for (const child of inlineExpression(token.r)) {
532
+ result.push(child);
533
+ }
384
534
  }
385
535
  }
386
536
  else {
@@ -443,7 +593,13 @@ function factorToken(token) {
443
593
  token.val == "calc")) {
444
594
  if ((token.typ == EnumToken.MathFunctionTokenType || token.typ == EnumToken.FunctionTokenType) &&
445
595
  token.val == "calc") {
446
- token = { ...token, typ: EnumToken.ParensTokenType, [LOC]: token[LOC] };
596
+ token = {
597
+ ...token,
598
+ typ: EnumToken.ParensTokenType,
599
+ [LOCSRCID]: token[LOCSRCID],
600
+ [LOCSTA]: token[LOCSTA],
601
+ [LOCEND]: token[LOCEND],
602
+ };
447
603
  // @ts-ignore
448
604
  delete token.val;
449
605
  }
@@ -481,7 +637,9 @@ function factor(tokens, ops) {
481
637
  : getArithmeticOperation(tokens[i].val),
482
638
  l: factorToken(tokens[i - 1]),
483
639
  r: factorToken(tokens[i + 1]),
484
- [LOC]: { ...tokens[i - 1][LOC], end: tokens[i + 1][LOC]?.end },
640
+ [LOCSRCID]: tokens[i - 1][LOCSRCID],
641
+ [LOCSTA]: tokens[i - 1][LOCSTA],
642
+ [LOCEND]: tokens[i + 1][LOCEND],
485
643
  });
486
644
  i--;
487
645
  }