@angular/animations 4.4.3 → 4.4.7

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 (37) hide show
  1. package/@angular/animations/browser/testing.es5.js +1 -1
  2. package/@angular/animations/browser/testing.es5.js.map +1 -1
  3. package/@angular/animations/browser/testing.js +1 -1
  4. package/@angular/animations/browser/testing.js.map +1 -1
  5. package/@angular/animations/browser.es5.js +159 -448
  6. package/@angular/animations/browser.es5.js.map +1 -1
  7. package/@angular/animations/browser.js +159 -397
  8. package/@angular/animations/browser.js.map +1 -1
  9. package/@angular/animations.es5.js +22 -2
  10. package/@angular/animations.es5.js.map +1 -1
  11. package/@angular/animations.js +22 -2
  12. package/@angular/animations.js.map +1 -1
  13. package/animations.metadata.json +1 -1
  14. package/browser/src/dsl/animation_ast.d.ts +31 -61
  15. package/browser/src/dsl/animation_ast.metadata.json +1 -0
  16. package/browser/src/dsl/animation_ast_builder.d.ts +3 -3
  17. package/browser/src/dsl/animation_dsl_visitor.d.ts +14 -15
  18. package/browser/src/dsl/animation_dsl_visitor.metadata.json +1 -0
  19. package/browser/src/dsl/animation_timeline_builder.d.ts +6 -6
  20. package/browser/src/util.d.ts +5 -1
  21. package/browser/src/util.metadata.json +1 -1
  22. package/browser/testing.d.ts +1 -1
  23. package/browser.d.ts +1 -1
  24. package/bundles/animations-browser-testing.umd.js +2 -2
  25. package/bundles/animations-browser-testing.umd.js.map +1 -1
  26. package/bundles/animations-browser-testing.umd.min.js +1 -1
  27. package/bundles/animations-browser-testing.umd.min.js.map +1 -1
  28. package/bundles/animations-browser.umd.js +160 -449
  29. package/bundles/animations-browser.umd.js.map +1 -1
  30. package/bundles/animations-browser.umd.min.js +10 -10
  31. package/bundles/animations-browser.umd.min.js.map +1 -1
  32. package/bundles/animations.umd.js +23 -3
  33. package/bundles/animations.umd.js.map +1 -1
  34. package/bundles/animations.umd.min.js +3 -3
  35. package/bundles/animations.umd.min.js.map +1 -1
  36. package/package.json +2 -2
  37. package/src/animation_metadata.d.ts +28 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v4.4.3
2
+ * @license Angular v4.4.7
3
3
  * (c) 2010-2017 Google, Inc. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -365,329 +365,34 @@ function dashCaseToCamelCase(input) {
365
365
  function allowPreviousPlayerStylesMerge(duration, delay) {
366
366
  return duration === 0 || delay === 0;
367
367
  }
368
-
369
- /**
370
- * @license
371
- * Copyright Google Inc. All Rights Reserved.
372
- *
373
- * Use of this source code is governed by an MIT-style license that can be
374
- * found in the LICENSE file at https://angular.io/license
375
- */
376
- const EMPTY_ANIMATION_OPTIONS = {};
377
- /**
378
- * @abstract
379
- */
380
- class Ast {
381
- constructor() {
382
- this.options = EMPTY_ANIMATION_OPTIONS;
383
- }
384
- /**
385
- * @abstract
386
- * @param {?} ast
387
- * @param {?} context
388
- * @return {?}
389
- */
390
- visit(ast, context) { }
391
- /**
392
- * @return {?}
393
- */
394
- get params() { return this.options['params'] || null; }
395
- }
396
- class TriggerAst extends Ast {
397
- /**
398
- * @param {?} name
399
- * @param {?} states
400
- * @param {?} transitions
401
- */
402
- constructor(name, states, transitions) {
403
- super();
404
- this.name = name;
405
- this.states = states;
406
- this.transitions = transitions;
407
- this.queryCount = 0;
408
- this.depCount = 0;
409
- }
410
- /**
411
- * @param {?} visitor
412
- * @param {?} context
413
- * @return {?}
414
- */
415
- visit(visitor, context) { return visitor.visitTrigger(this, context); }
416
- }
417
- class StateAst extends Ast {
418
- /**
419
- * @param {?} name
420
- * @param {?} style
421
- */
422
- constructor(name, style$$1) {
423
- super();
424
- this.name = name;
425
- this.style = style$$1;
426
- }
427
- /**
428
- * @param {?} visitor
429
- * @param {?} context
430
- * @return {?}
431
- */
432
- visit(visitor, context) { return visitor.visitState(this, context); }
433
- }
434
- class TransitionAst extends Ast {
435
- /**
436
- * @param {?} matchers
437
- * @param {?} animation
438
- */
439
- constructor(matchers, animation) {
440
- super();
441
- this.matchers = matchers;
442
- this.animation = animation;
443
- this.queryCount = 0;
444
- this.depCount = 0;
445
- }
446
- /**
447
- * @param {?} visitor
448
- * @param {?} context
449
- * @return {?}
450
- */
451
- visit(visitor, context) { return visitor.visitTransition(this, context); }
452
- }
453
- class SequenceAst extends Ast {
454
- /**
455
- * @param {?} steps
456
- */
457
- constructor(steps) {
458
- super();
459
- this.steps = steps;
460
- }
461
- /**
462
- * @param {?} visitor
463
- * @param {?} context
464
- * @return {?}
465
- */
466
- visit(visitor, context) { return visitor.visitSequence(this, context); }
467
- }
468
- class GroupAst extends Ast {
469
- /**
470
- * @param {?} steps
471
- */
472
- constructor(steps) {
473
- super();
474
- this.steps = steps;
475
- }
476
- /**
477
- * @param {?} visitor
478
- * @param {?} context
479
- * @return {?}
480
- */
481
- visit(visitor, context) { return visitor.visitGroup(this, context); }
482
- }
483
- class AnimateAst extends Ast {
484
- /**
485
- * @param {?} timings
486
- * @param {?} style
487
- */
488
- constructor(timings, style$$1) {
489
- super();
490
- this.timings = timings;
491
- this.style = style$$1;
492
- }
493
- /**
494
- * @param {?} visitor
495
- * @param {?} context
496
- * @return {?}
497
- */
498
- visit(visitor, context) { return visitor.visitAnimate(this, context); }
499
- }
500
- class StyleAst extends Ast {
501
- /**
502
- * @param {?} styles
503
- * @param {?} easing
504
- * @param {?} offset
505
- */
506
- constructor(styles, easing, offset) {
507
- super();
508
- this.styles = styles;
509
- this.easing = easing;
510
- this.offset = offset;
511
- this.isEmptyStep = false;
512
- this.containsDynamicStyles = false;
513
- }
514
- /**
515
- * @param {?} visitor
516
- * @param {?} context
517
- * @return {?}
518
- */
519
- visit(visitor, context) { return visitor.visitStyle(this, context); }
520
- }
521
- class KeyframesAst extends Ast {
522
- /**
523
- * @param {?} styles
524
- */
525
- constructor(styles) {
526
- super();
527
- this.styles = styles;
528
- }
529
- /**
530
- * @param {?} visitor
531
- * @param {?} context
532
- * @return {?}
533
- */
534
- visit(visitor, context) { return visitor.visitKeyframes(this, context); }
535
- }
536
- class ReferenceAst extends Ast {
537
- /**
538
- * @param {?} animation
539
- */
540
- constructor(animation) {
541
- super();
542
- this.animation = animation;
543
- }
544
- /**
545
- * @param {?} visitor
546
- * @param {?} context
547
- * @return {?}
548
- */
549
- visit(visitor, context) { return visitor.visitReference(this, context); }
550
- }
551
- class AnimateChildAst extends Ast {
552
- constructor() { super(); }
553
- /**
554
- * @param {?} visitor
555
- * @param {?} context
556
- * @return {?}
557
- */
558
- visit(visitor, context) { return visitor.visitAnimateChild(this, context); }
559
- }
560
- class AnimateRefAst extends Ast {
561
- /**
562
- * @param {?} animation
563
- */
564
- constructor(animation) {
565
- super();
566
- this.animation = animation;
567
- }
568
- /**
569
- * @param {?} visitor
570
- * @param {?} context
571
- * @return {?}
572
- */
573
- visit(visitor, context) { return visitor.visitAnimateRef(this, context); }
574
- }
575
- class QueryAst extends Ast {
576
- /**
577
- * @param {?} selector
578
- * @param {?} limit
579
- * @param {?} optional
580
- * @param {?} includeSelf
581
- * @param {?} animation
582
- */
583
- constructor(selector, limit, optional, includeSelf, animation) {
584
- super();
585
- this.selector = selector;
586
- this.limit = limit;
587
- this.optional = optional;
588
- this.includeSelf = includeSelf;
589
- this.animation = animation;
590
- }
591
- /**
592
- * @param {?} visitor
593
- * @param {?} context
594
- * @return {?}
595
- */
596
- visit(visitor, context) { return visitor.visitQuery(this, context); }
597
- }
598
- class StaggerAst extends Ast {
599
- /**
600
- * @param {?} timings
601
- * @param {?} animation
602
- */
603
- constructor(timings, animation) {
604
- super();
605
- this.timings = timings;
606
- this.animation = animation;
607
- }
608
- /**
609
- * @param {?} visitor
610
- * @param {?} context
611
- * @return {?}
612
- */
613
- visit(visitor, context) { return visitor.visitStagger(this, context); }
614
- }
615
- class TimingAst extends Ast {
616
- /**
617
- * @param {?} duration
618
- * @param {?=} delay
619
- * @param {?=} easing
620
- */
621
- constructor(duration, delay = 0, easing = null) {
622
- super();
623
- this.duration = duration;
624
- this.delay = delay;
625
- this.easing = easing;
626
- }
627
- /**
628
- * @param {?} visitor
629
- * @param {?} context
630
- * @return {?}
631
- */
632
- visit(visitor, context) { return visitor.visitTiming(this, context); }
633
- }
634
- class DynamicTimingAst extends TimingAst {
635
- /**
636
- * @param {?} value
637
- */
638
- constructor(value) {
639
- super(0, 0, '');
640
- this.value = value;
641
- }
642
- /**
643
- * @param {?} visitor
644
- * @param {?} context
645
- * @return {?}
646
- */
647
- visit(visitor, context) { return visitor.visitTiming(this, context); }
648
- }
649
-
650
- /**
651
- * @license
652
- * Copyright Google Inc. All Rights Reserved.
653
- *
654
- * Use of this source code is governed by an MIT-style license that can be
655
- * found in the LICENSE file at https://angular.io/license
656
- */
657
- /**
658
- * @param {?} visitor
659
- * @param {?} node
660
- * @param {?} context
661
- * @return {?}
662
- */
663
- function visitAnimationNode(visitor, node, context) {
368
+ function visitDslNode(visitor, node, context) {
664
369
  switch (node.type) {
665
370
  case 7 /* Trigger */:
666
- return visitor.visitTrigger(/** @type {?} */ (node), context);
371
+ return visitor.visitTrigger(node, context);
667
372
  case 0 /* State */:
668
- return visitor.visitState(/** @type {?} */ (node), context);
373
+ return visitor.visitState(node, context);
669
374
  case 1 /* Transition */:
670
- return visitor.visitTransition(/** @type {?} */ (node), context);
375
+ return visitor.visitTransition(node, context);
671
376
  case 2 /* Sequence */:
672
- return visitor.visitSequence(/** @type {?} */ (node), context);
377
+ return visitor.visitSequence(node, context);
673
378
  case 3 /* Group */:
674
- return visitor.visitGroup(/** @type {?} */ (node), context);
379
+ return visitor.visitGroup(node, context);
675
380
  case 4 /* Animate */:
676
- return visitor.visitAnimate(/** @type {?} */ (node), context);
381
+ return visitor.visitAnimate(node, context);
677
382
  case 5 /* Keyframes */:
678
- return visitor.visitKeyframes(/** @type {?} */ (node), context);
383
+ return visitor.visitKeyframes(node, context);
679
384
  case 6 /* Style */:
680
- return visitor.visitStyle(/** @type {?} */ (node), context);
385
+ return visitor.visitStyle(node, context);
681
386
  case 8 /* Reference */:
682
- return visitor.visitReference(/** @type {?} */ (node), context);
387
+ return visitor.visitReference(node, context);
683
388
  case 9 /* AnimateChild */:
684
- return visitor.visitAnimateChild(/** @type {?} */ (node), context);
389
+ return visitor.visitAnimateChild(node, context);
685
390
  case 10 /* AnimateRef */:
686
- return visitor.visitAnimateRef(/** @type {?} */ (node), context);
391
+ return visitor.visitAnimateRef(node, context);
687
392
  case 11 /* Query */:
688
- return visitor.visitQuery(/** @type {?} */ (node), context);
393
+ return visitor.visitQuery(node, context);
689
394
  case 12 /* Stagger */:
690
- return visitor.visitStagger(/** @type {?} */ (node), context);
395
+ return visitor.visitStagger(node, context);
691
396
  default:
692
397
  throw new Error(`Unable to resolve animation metadata node #${node.type}`);
693
398
  }
@@ -758,20 +463,28 @@ function parseAnimationAlias(alias, errors) {
758
463
  return '* => *';
759
464
  }
760
465
  }
466
+ const TRUE_BOOLEAN_VALUES = new Set();
467
+ TRUE_BOOLEAN_VALUES.add('true');
468
+ TRUE_BOOLEAN_VALUES.add('1');
469
+ const FALSE_BOOLEAN_VALUES = new Set();
470
+ FALSE_BOOLEAN_VALUES.add('false');
471
+ FALSE_BOOLEAN_VALUES.add('0');
761
472
  /**
762
473
  * @param {?} lhs
763
474
  * @param {?} rhs
764
475
  * @return {?}
765
476
  */
766
477
  function makeLambdaFromStates(lhs, rhs) {
478
+ const /** @type {?} */ LHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(lhs) || FALSE_BOOLEAN_VALUES.has(lhs);
479
+ const /** @type {?} */ RHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(rhs) || FALSE_BOOLEAN_VALUES.has(rhs);
767
480
  return (fromState, toState) => {
768
481
  let /** @type {?} */ lhsMatch = lhs == ANY_STATE || lhs == fromState;
769
482
  let /** @type {?} */ rhsMatch = rhs == ANY_STATE || rhs == toState;
770
- if (!lhsMatch && typeof fromState === 'boolean') {
771
- lhsMatch = fromState ? lhs === 'true' : lhs === 'false';
483
+ if (!lhsMatch && LHS_MATCH_BOOLEAN && typeof fromState === 'boolean') {
484
+ lhsMatch = fromState ? TRUE_BOOLEAN_VALUES.has(lhs) : FALSE_BOOLEAN_VALUES.has(lhs);
772
485
  }
773
- if (!rhsMatch && typeof toState === 'boolean') {
774
- rhsMatch = toState ? rhs === 'true' : rhs === 'false';
486
+ if (!rhsMatch && RHS_MATCH_BOOLEAN && typeof toState === 'boolean') {
487
+ rhsMatch = toState ? TRUE_BOOLEAN_VALUES.has(rhs) : FALSE_BOOLEAN_VALUES.has(rhs);
775
488
  }
776
489
  return lhsMatch && rhsMatch;
777
490
  };
@@ -808,7 +521,7 @@ class AnimationAstBuilderVisitor {
808
521
  build(metadata, errors) {
809
522
  const /** @type {?} */ context = new AnimationAstBuilderContext(errors);
810
523
  this._resetContextStyleTimingState(context);
811
- return (visitAnimationNode(this, normalizeAnimationEntry(metadata), context));
524
+ return (visitDslNode(this, normalizeAnimationEntry(metadata), context));
812
525
  }
813
526
  /**
814
527
  * @param {?} context
@@ -851,11 +564,11 @@ class AnimationAstBuilderVisitor {
851
564
  context.errors.push('only state() and transition() definitions can sit inside of a trigger()');
852
565
  }
853
566
  });
854
- const /** @type {?} */ ast = new TriggerAst(metadata.name, states, transitions);
855
- ast.options = normalizeAnimationOptions(metadata.options);
856
- ast.queryCount = queryCount;
857
- ast.depCount = depCount;
858
- return ast;
567
+ return {
568
+ type: 7 /* Trigger */,
569
+ name: metadata.name, states, transitions, queryCount, depCount,
570
+ options: null
571
+ };
859
572
  }
860
573
  /**
861
574
  * @param {?} metadata
@@ -885,11 +598,12 @@ class AnimationAstBuilderVisitor {
885
598
  context.errors.push(`state("${metadata.name}", ...) must define default values for all the following style substitutions: ${missingSubsArr.join(', ')}`);
886
599
  }
887
600
  }
888
- const /** @type {?} */ stateAst = new StateAst(metadata.name, styleAst);
889
- if (astParams) {
890
- stateAst.options = { params: astParams };
891
- }
892
- return stateAst;
601
+ return {
602
+ type: 0 /* State */,
603
+ name: metadata.name,
604
+ style: styleAst,
605
+ options: astParams ? { params: astParams } : null
606
+ };
893
607
  }
894
608
  /**
895
609
  * @param {?} metadata
@@ -899,13 +613,16 @@ class AnimationAstBuilderVisitor {
899
613
  visitTransition(metadata, context) {
900
614
  context.queryCount = 0;
901
615
  context.depCount = 0;
902
- const /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
616
+ const /** @type {?} */ animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);
903
617
  const /** @type {?} */ matchers = parseTransitionExpr(metadata.expr, context.errors);
904
- const /** @type {?} */ ast = new TransitionAst(matchers, entry);
905
- ast.options = normalizeAnimationOptions(metadata.options);
906
- ast.queryCount = context.queryCount;
907
- ast.depCount = context.depCount;
908
- return ast;
618
+ return {
619
+ type: 1 /* Transition */,
620
+ matchers,
621
+ animation,
622
+ queryCount: context.queryCount,
623
+ depCount: context.depCount,
624
+ options: normalizeAnimationOptions(metadata.options)
625
+ };
909
626
  }
910
627
  /**
911
628
  * @param {?} metadata
@@ -913,9 +630,11 @@ class AnimationAstBuilderVisitor {
913
630
  * @return {?}
914
631
  */
915
632
  visitSequence(metadata, context) {
916
- const /** @type {?} */ ast = new SequenceAst(metadata.steps.map(s => visitAnimationNode(this, s, context)));
917
- ast.options = normalizeAnimationOptions(metadata.options);
918
- return ast;
633
+ return {
634
+ type: 2 /* Sequence */,
635
+ steps: metadata.steps.map(s => visitDslNode(this, s, context)),
636
+ options: normalizeAnimationOptions(metadata.options)
637
+ };
919
638
  }
920
639
  /**
921
640
  * @param {?} metadata
@@ -927,14 +646,16 @@ class AnimationAstBuilderVisitor {
927
646
  let /** @type {?} */ furthestTime = 0;
928
647
  const /** @type {?} */ steps = metadata.steps.map(step => {
929
648
  context.currentTime = currentTime;
930
- const /** @type {?} */ innerAst = visitAnimationNode(this, step, context);
649
+ const /** @type {?} */ innerAst = visitDslNode(this, step, context);
931
650
  furthestTime = Math.max(furthestTime, context.currentTime);
932
651
  return innerAst;
933
652
  });
934
653
  context.currentTime = furthestTime;
935
- const /** @type {?} */ ast = new GroupAst(steps);
936
- ast.options = normalizeAnimationOptions(metadata.options);
937
- return ast;
654
+ return {
655
+ type: 3 /* Group */,
656
+ steps,
657
+ options: normalizeAnimationOptions(metadata.options)
658
+ };
938
659
  }
939
660
  /**
940
661
  * @param {?} metadata
@@ -944,10 +665,10 @@ class AnimationAstBuilderVisitor {
944
665
  visitAnimate(metadata, context) {
945
666
  const /** @type {?} */ timingAst = constructTimingAst(metadata.timings, context.errors);
946
667
  context.currentAnimateTimings = timingAst;
947
- let /** @type {?} */ styles;
668
+ let /** @type {?} */ styleAst;
948
669
  let /** @type {?} */ styleMetadata = metadata.styles ? metadata.styles : style({});
949
670
  if (styleMetadata.type == 5 /* Keyframes */) {
950
- styles = this.visitKeyframes(/** @type {?} */ (styleMetadata), context);
671
+ styleAst = this.visitKeyframes(/** @type {?} */ (styleMetadata), context);
951
672
  }
952
673
  else {
953
674
  let /** @type {?} */ styleMetadata = (metadata.styles);
@@ -961,12 +682,17 @@ class AnimationAstBuilderVisitor {
961
682
  styleMetadata = style(newStyleData);
962
683
  }
963
684
  context.currentTime += timingAst.duration + timingAst.delay;
964
- const /** @type {?} */ styleAst = this.visitStyle(styleMetadata, context);
965
- styleAst.isEmptyStep = isEmpty;
966
- styles = styleAst;
685
+ const /** @type {?} */ _styleAst = this.visitStyle(styleMetadata, context);
686
+ _styleAst.isEmptyStep = isEmpty;
687
+ styleAst = _styleAst;
967
688
  }
968
689
  context.currentAnimateTimings = null;
969
- return new AnimateAst(timingAst, styles);
690
+ return {
691
+ type: 4 /* Animate */,
692
+ timings: timingAst,
693
+ style: styleAst,
694
+ options: null
695
+ };
970
696
  }
971
697
  /**
972
698
  * @param {?} metadata
@@ -1024,9 +750,13 @@ class AnimationAstBuilderVisitor {
1024
750
  }
1025
751
  }
1026
752
  });
1027
- const /** @type {?} */ ast = new StyleAst(styles, collectedEasing, metadata.offset);
1028
- ast.containsDynamicStyles = containsDynamicStyles;
1029
- return ast;
753
+ return {
754
+ type: 6 /* Style */,
755
+ styles,
756
+ easing: collectedEasing,
757
+ offset: metadata.offset, containsDynamicStyles,
758
+ options: null
759
+ };
1030
760
  }
1031
761
  /**
1032
762
  * @param {?} ast
@@ -1073,9 +803,10 @@ class AnimationAstBuilderVisitor {
1073
803
  * @return {?}
1074
804
  */
1075
805
  visitKeyframes(metadata, context) {
806
+ const /** @type {?} */ ast = { type: 5 /* Keyframes */, styles: [], options: null };
1076
807
  if (!context.currentAnimateTimings) {
1077
808
  context.errors.push(`keyframes() must be placed inside of a call to animate()`);
1078
- return new KeyframesAst([]);
809
+ return ast;
1079
810
  }
1080
811
  const /** @type {?} */ MAX_KEYFRAME_OFFSET = 1;
1081
812
  let /** @type {?} */ totalKeyframesWithOffsets = 0;
@@ -1122,8 +853,9 @@ class AnimationAstBuilderVisitor {
1122
853
  currentAnimateTimings.duration = durationUpToThisFrame;
1123
854
  this._validateStyleAst(kf, context);
1124
855
  kf.offset = offset;
856
+ ast.styles.push(kf);
1125
857
  });
1126
- return new KeyframesAst(keyframes);
858
+ return ast;
1127
859
  }
1128
860
  /**
1129
861
  * @param {?} metadata
@@ -1131,10 +863,11 @@ class AnimationAstBuilderVisitor {
1131
863
  * @return {?}
1132
864
  */
1133
865
  visitReference(metadata, context) {
1134
- const /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
1135
- const /** @type {?} */ ast = new ReferenceAst(entry);
1136
- ast.options = normalizeAnimationOptions(metadata.options);
1137
- return ast;
866
+ return {
867
+ type: 8 /* Reference */,
868
+ animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),
869
+ options: normalizeAnimationOptions(metadata.options)
870
+ };
1138
871
  }
1139
872
  /**
1140
873
  * @param {?} metadata
@@ -1143,9 +876,10 @@ class AnimationAstBuilderVisitor {
1143
876
  */
1144
877
  visitAnimateChild(metadata, context) {
1145
878
  context.depCount++;
1146
- const /** @type {?} */ ast = new AnimateChildAst();
1147
- ast.options = normalizeAnimationOptions(metadata.options);
1148
- return ast;
879
+ return {
880
+ type: 9 /* AnimateChild */,
881
+ options: normalizeAnimationOptions(metadata.options)
882
+ };
1149
883
  }
1150
884
  /**
1151
885
  * @param {?} metadata
@@ -1153,10 +887,11 @@ class AnimationAstBuilderVisitor {
1153
887
  * @return {?}
1154
888
  */
1155
889
  visitAnimateRef(metadata, context) {
1156
- const /** @type {?} */ animation = this.visitReference(metadata.animation, context);
1157
- const /** @type {?} */ ast = new AnimateRefAst(animation);
1158
- ast.options = normalizeAnimationOptions(metadata.options);
1159
- return ast;
890
+ return {
891
+ type: 10 /* AnimateRef */,
892
+ animation: this.visitReference(metadata.animation, context),
893
+ options: normalizeAnimationOptions(metadata.options)
894
+ };
1160
895
  }
1161
896
  /**
1162
897
  * @param {?} metadata
@@ -1172,13 +907,17 @@ class AnimationAstBuilderVisitor {
1172
907
  context.currentQuerySelector =
1173
908
  parentSelector.length ? (parentSelector + ' ' + selector) : selector;
1174
909
  getOrSetAsInMap(context.collectedStyles, context.currentQuerySelector, {});
1175
- const /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
910
+ const /** @type {?} */ animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);
1176
911
  context.currentQuery = null;
1177
912
  context.currentQuerySelector = parentSelector;
1178
- const /** @type {?} */ ast = new QueryAst(selector, options.limit || 0, !!options.optional, includeSelf, entry);
1179
- ast.originalSelector = metadata.selector;
1180
- ast.options = normalizeAnimationOptions(metadata.options);
1181
- return ast;
913
+ return {
914
+ type: 11 /* Query */,
915
+ selector,
916
+ limit: options.limit || 0,
917
+ optional: !!options.optional, includeSelf, animation,
918
+ originalSelector: metadata.selector,
919
+ options: normalizeAnimationOptions(metadata.options)
920
+ };
1182
921
  }
1183
922
  /**
1184
923
  * @param {?} metadata
@@ -1192,8 +931,11 @@ class AnimationAstBuilderVisitor {
1192
931
  const /** @type {?} */ timings = metadata.timings === 'full' ?
1193
932
  { duration: 0, delay: 0, easing: 'full' } :
1194
933
  resolveTiming(metadata.timings, context.errors, true);
1195
- const /** @type {?} */ animation = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context);
1196
- return new StaggerAst(timings, animation);
934
+ return {
935
+ type: 12 /* Stagger */,
936
+ animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context), timings,
937
+ options: null
938
+ };
1197
939
  }
1198
940
  }
1199
941
  /**
@@ -1279,15 +1021,18 @@ function constructTimingAst(value, errors) {
1279
1021
  }
1280
1022
  else if (typeof value == 'number') {
1281
1023
  const /** @type {?} */ duration = resolveTiming(/** @type {?} */ (value), errors).duration;
1282
- return new TimingAst(/** @type {?} */ (value), 0, '');
1024
+ return makeTimingAst(/** @type {?} */ (duration), 0, '');
1283
1025
  }
1284
1026
  const /** @type {?} */ strValue = (value);
1285
1027
  const /** @type {?} */ isDynamic = strValue.split(/\s+/).some(v => v.charAt(0) == '{' && v.charAt(1) == '{');
1286
1028
  if (isDynamic) {
1287
- return new DynamicTimingAst(strValue);
1029
+ const /** @type {?} */ ast = (makeTimingAst(0, 0, ''));
1030
+ ast.dynamic = true;
1031
+ ast.strValue = strValue;
1032
+ return (ast);
1288
1033
  }
1289
1034
  timings = timings || resolveTiming(strValue, errors);
1290
- return new TimingAst(timings.duration, timings.delay, timings.easing);
1035
+ return makeTimingAst(timings.duration, timings.delay, timings.easing);
1291
1036
  }
1292
1037
  /**
1293
1038
  * @param {?} options
@@ -1305,6 +1050,15 @@ function normalizeAnimationOptions(options) {
1305
1050
  }
1306
1051
  return options;
1307
1052
  }
1053
+ /**
1054
+ * @param {?} duration
1055
+ * @param {?} delay
1056
+ * @param {?} easing
1057
+ * @return {?}
1058
+ */
1059
+ function makeTimingAst(duration, delay, easing) {
1060
+ return { duration, delay, easing };
1061
+ }
1308
1062
 
1309
1063
  /**
1310
1064
  * @license
@@ -1424,7 +1178,7 @@ class AnimationTimelineBuilderVisitor {
1424
1178
  const /** @type {?} */ context = new AnimationTimelineContext(driver, rootElement, subInstructions, errors, []);
1425
1179
  context.options = options;
1426
1180
  context.currentTimeline.setStyles([startingStyles], null, context.errors, options);
1427
- ast.visit(this, context);
1181
+ visitDslNode(this, ast, context);
1428
1182
  // this checks to see if an actual animation happened
1429
1183
  const /** @type {?} */ timelines = context.timelines.filter(timeline => timeline.containsAnimation());
1430
1184
  if (timelines.length && Object.keys(finalStyles).length) {
@@ -1520,7 +1274,7 @@ class AnimationTimelineBuilderVisitor {
1520
1274
  */
1521
1275
  visitReference(ast, context) {
1522
1276
  context.updateOptions(ast.options, true);
1523
- ast.animation.visit(this, context);
1277
+ visitDslNode(this, ast.animation, context);
1524
1278
  context.previousNode = ast;
1525
1279
  }
1526
1280
  /**
@@ -1536,7 +1290,7 @@ class AnimationTimelineBuilderVisitor {
1536
1290
  ctx = context.createSubContext(options);
1537
1291
  ctx.transformIntoNewTimeline();
1538
1292
  if (options.delay != null) {
1539
- if (ctx.previousNode instanceof StyleAst) {
1293
+ if (ctx.previousNode.type == 6 /* Style */) {
1540
1294
  ctx.currentTimeline.snapshotCurrentStyles();
1541
1295
  ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
1542
1296
  }
@@ -1545,7 +1299,7 @@ class AnimationTimelineBuilderVisitor {
1545
1299
  }
1546
1300
  }
1547
1301
  if (ast.steps.length) {
1548
- ast.steps.forEach(s => s.visit(this, ctx));
1302
+ ast.steps.forEach(s => visitDslNode(this, s, ctx));
1549
1303
  // this is here just incase the inner steps only contain or end with a style() call
1550
1304
  ctx.currentTimeline.applyStylesToKeyframe();
1551
1305
  // this means that some animation function within the sequence
@@ -1571,7 +1325,7 @@ class AnimationTimelineBuilderVisitor {
1571
1325
  if (delay) {
1572
1326
  innerContext.delayNextStep(delay);
1573
1327
  }
1574
- s.visit(this, innerContext);
1328
+ visitDslNode(this, s, innerContext);
1575
1329
  furthestTime = Math.max(furthestTime, innerContext.currentTimeline.currentTime);
1576
1330
  innerTimelines.push(innerContext.currentTimeline);
1577
1331
  });
@@ -1587,12 +1341,11 @@ class AnimationTimelineBuilderVisitor {
1587
1341
  * @param {?} context
1588
1342
  * @return {?}
1589
1343
  */
1590
- visitTiming(ast, context) {
1591
- if (ast instanceof DynamicTimingAst) {
1592
- const /** @type {?} */ strValue = context.params ?
1593
- interpolateParams(ast.value, context.params, context.errors) :
1594
- ast.value.toString();
1595
- return resolveTiming(strValue, context.errors);
1344
+ _visitTiming(ast, context) {
1345
+ if (((ast)).dynamic) {
1346
+ const /** @type {?} */ strValue = ((ast)).strValue;
1347
+ const /** @type {?} */ timingValue = context.params ? interpolateParams(strValue, context.params, context.errors) : strValue;
1348
+ return resolveTiming(timingValue, context.errors);
1596
1349
  }
1597
1350
  else {
1598
1351
  return { duration: ast.duration, delay: ast.delay, easing: ast.easing };
@@ -1604,14 +1357,14 @@ class AnimationTimelineBuilderVisitor {
1604
1357
  * @return {?}
1605
1358
  */
1606
1359
  visitAnimate(ast, context) {
1607
- const /** @type {?} */ timings = context.currentAnimateTimings = this.visitTiming(ast.timings, context);
1360
+ const /** @type {?} */ timings = context.currentAnimateTimings = this._visitTiming(ast.timings, context);
1608
1361
  const /** @type {?} */ timeline = context.currentTimeline;
1609
1362
  if (timings.delay) {
1610
1363
  context.incrementTime(timings.delay);
1611
1364
  timeline.snapshotCurrentStyles();
1612
1365
  }
1613
1366
  const /** @type {?} */ style$$1 = ast.style;
1614
- if (style$$1 instanceof KeyframesAst) {
1367
+ if (style$$1.type == 5 /* Keyframes */) {
1615
1368
  this.visitKeyframes(style$$1, context);
1616
1369
  }
1617
1370
  else {
@@ -1681,7 +1434,7 @@ class AnimationTimelineBuilderVisitor {
1681
1434
  const /** @type {?} */ startTime = context.currentTimeline.currentTime;
1682
1435
  const /** @type {?} */ options = ((ast.options || {}));
1683
1436
  const /** @type {?} */ delay = options.delay ? resolveTimingValue(options.delay) : 0;
1684
- if (delay && (context.previousNode instanceof StyleAst ||
1437
+ if (delay && (context.previousNode.type === 6 /* Style */ ||
1685
1438
  (startTime == 0 && context.currentTimeline.getCurrentStyleProperties().length))) {
1686
1439
  context.currentTimeline.snapshotCurrentStyles();
1687
1440
  context.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
@@ -1699,7 +1452,7 @@ class AnimationTimelineBuilderVisitor {
1699
1452
  if (element === context.element) {
1700
1453
  sameElementTimeline = innerContext.currentTimeline;
1701
1454
  }
1702
- ast.animation.visit(this, innerContext);
1455
+ visitDslNode(this, ast.animation, innerContext);
1703
1456
  // this is here just incase the inner steps only contain or end
1704
1457
  // with a style() call (which is here to signal that this is a preparatory
1705
1458
  // call to style an element before it is animated again)
@@ -1742,7 +1495,7 @@ class AnimationTimelineBuilderVisitor {
1742
1495
  timeline.delayNextStep(delay);
1743
1496
  }
1744
1497
  const /** @type {?} */ startingTime = timeline.currentTime;
1745
- ast.animation.visit(this, context);
1498
+ visitDslNode(this, ast.animation, context);
1746
1499
  context.previousNode = ast;
1747
1500
  // time = duration + delay
1748
1501
  // the reason why this computation is so complex is because
@@ -1822,7 +1575,7 @@ class AnimationTimelineContext {
1822
1575
  const /** @type {?} */ oldParams = this.options.params;
1823
1576
  if (oldParams) {
1824
1577
  const /** @type {?} */ params = options['params'] = {};
1825
- Object.keys(this.options.params).forEach(name => { params[name] = oldParams[name]; });
1578
+ Object.keys(oldParams).forEach(name => { params[name] = oldParams[name]; });
1826
1579
  }
1827
1580
  }
1828
1581
  return options;
@@ -1905,7 +1658,11 @@ class AnimationTimelineContext {
1905
1658
  }
1906
1659
  if (selector.length > 0) {
1907
1660
  const /** @type {?} */ multi = limit != 1;
1908
- results.push(...this._driver.query(this.element, selector, multi));
1661
+ let /** @type {?} */ elements = this._driver.query(this.element, selector, multi);
1662
+ if (limit !== 0) {
1663
+ elements = elements.slice(0, limit);
1664
+ }
1665
+ results.push(...elements);
1909
1666
  }
1910
1667
  if (!optional && results.length == 0) {
1911
1668
  errors.push(`\`query("${originalSelector}")\` returned zero elements. (Use \`query("${originalSelector}", { optional: true })\` if you wish to allow this.)`);
@@ -2634,8 +2391,15 @@ class AnimationTrigger {
2634
2391
  */
2635
2392
  function createFallbackTransition(triggerName, states) {
2636
2393
  const /** @type {?} */ matchers = [(fromState, toState) => true];
2637
- const /** @type {?} */ animation = new SequenceAst([]);
2638
- const /** @type {?} */ transition = new TransitionAst(matchers, animation);
2394
+ const /** @type {?} */ animation = { type: 2 /* Sequence */, steps: [], options: null };
2395
+ const /** @type {?} */ transition = {
2396
+ type: 1 /* Transition */,
2397
+ animation,
2398
+ matchers,
2399
+ options: null,
2400
+ queryCount: 0,
2401
+ depCount: 0
2402
+ };
2639
2403
  return new AnimationTransitionFactory(triggerName, transition, states);
2640
2404
  }
2641
2405
  /**
@@ -3675,7 +3439,7 @@ class TransitionAnimationEngine {
3675
3439
  * @return {?}
3676
3440
  */
3677
3441
  reportError(errors) {
3678
- throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${errors.join("\n")}`);
3442
+ throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${errors.join('\n')}`);
3679
3443
  }
3680
3444
  /**
3681
3445
  * @param {?} cleanupFns
@@ -4315,12 +4079,10 @@ function deleteOrUnsetInMap(map, key, value) {
4315
4079
  * @return {?}
4316
4080
  */
4317
4081
  function normalizeTriggerValue(value) {
4318
- switch (typeof value) {
4319
- case 'boolean':
4320
- return value ? '1' : '0';
4321
- default:
4322
- return value != null ? value.toString() : null;
4323
- }
4082
+ // we use `!= null` here because it's the most simple
4083
+ // way to test against a "falsy" value without mixing
4084
+ // in empty strings or a zero value. DO NOT OPTIMIZE.
4085
+ return value != null ? value : null;
4324
4086
  }
4325
4087
  /**
4326
4088
  * @param {?} node