@angular/animations 13.2.0-rc.1 → 13.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/animations.d.ts +10 -2
  2. package/browser/browser.d.ts +8 -71
  3. package/browser/testing/testing.d.ts +1 -1
  4. package/esm2020/browser/src/dsl/animation.mjs +4 -5
  5. package/esm2020/browser/src/dsl/animation_ast_builder.mjs +13 -14
  6. package/esm2020/browser/src/dsl/animation_timeline_builder.mjs +3 -2
  7. package/esm2020/browser/src/dsl/animation_transition_expr.mjs +4 -3
  8. package/esm2020/browser/src/dsl/animation_transition_factory.mjs +1 -1
  9. package/esm2020/browser/src/dsl/animation_transition_instruction.mjs +1 -1
  10. package/esm2020/browser/src/dsl/animation_trigger.mjs +1 -1
  11. package/esm2020/browser/src/dsl/style_normalization/animation_style_normalizer.mjs +1 -1
  12. package/esm2020/browser/src/dsl/style_normalization/web_animations_style_normalizer.mjs +3 -2
  13. package/esm2020/browser/src/error_helpers.mjs +135 -0
  14. package/esm2020/browser/src/errors.mjs +9 -0
  15. package/esm2020/browser/src/private_export.mjs +2 -4
  16. package/esm2020/browser/src/render/animation_driver.mjs +3 -3
  17. package/esm2020/browser/src/render/animation_engine_next.mjs +3 -2
  18. package/esm2020/browser/src/render/shared.mjs +3 -3
  19. package/esm2020/browser/src/render/timeline_animation_engine.mjs +6 -5
  20. package/esm2020/browser/src/render/transition_animation_engine.mjs +8 -8
  21. package/esm2020/browser/src/render/web_animations/web_animations_driver.mjs +3 -21
  22. package/esm2020/browser/src/util.mjs +9 -8
  23. package/esm2020/src/animation_metadata.mjs +10 -2
  24. package/esm2020/src/version.mjs +1 -1
  25. package/fesm2015/animations.mjs +10 -2
  26. package/fesm2015/animations.mjs.map +1 -1
  27. package/fesm2015/browser/testing.mjs +1 -1
  28. package/fesm2015/browser.mjs +179 -502
  29. package/fesm2015/browser.mjs.map +1 -1
  30. package/fesm2020/animations.mjs +10 -2
  31. package/fesm2020/animations.mjs.map +1 -1
  32. package/fesm2020/browser/testing.mjs +1 -1
  33. package/fesm2020/browser.mjs +179 -501
  34. package/fesm2020/browser.mjs.map +1 -1
  35. package/package.json +2 -2
  36. package/esm2020/browser/src/render/css_keyframes/css_keyframes_driver.mjs +0 -121
  37. package/esm2020/browser/src/render/css_keyframes/css_keyframes_player.mjs +0 -133
  38. package/esm2020/browser/src/render/css_keyframes/direct_style_player.mjs +0 -51
  39. package/esm2020/browser/src/render/css_keyframes/element_animation_style_handler.mjs +0 -137
@@ -1,12 +1,146 @@
1
1
  /**
2
- * @license Angular v13.2.0-rc.1
2
+ * @license Angular v13.2.3
3
3
  * (c) 2010-2022 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
6
6
 
7
7
  import { ɵAnimationGroupPlayer, NoopAnimationPlayer, AUTO_STYLE, ɵPRE_STYLE, sequence, style } from '@angular/animations';
8
8
  import * as i0 from '@angular/core';
9
- import { Injectable } from '@angular/core';
9
+ import { ɵRuntimeError, Injectable } from '@angular/core';
10
+
11
+ /**
12
+ * @license
13
+ * Copyright Google LLC All Rights Reserved.
14
+ *
15
+ * Use of this source code is governed by an MIT-style license that can be
16
+ * found in the LICENSE file at https://angular.io/license
17
+ */
18
+ const NG_DEV_MODE = typeof ngDevMode === 'undefined' || !!ngDevMode;
19
+ const LINE_START = '\n - ';
20
+ function invalidTimingValue(exp) {
21
+ return new ɵRuntimeError(3000 /* INVALID_TIMING_VALUE */, NG_DEV_MODE && `The provided timing value "${exp}" is invalid.`);
22
+ }
23
+ function negativeStepValue() {
24
+ return new ɵRuntimeError(3100 /* NEGATIVE_STEP_VALUE */, NG_DEV_MODE && 'Duration values below 0 are not allowed for this animation step.');
25
+ }
26
+ function negativeDelayValue() {
27
+ return new ɵRuntimeError(3101 /* NEGATIVE_DELAY_VALUE */, NG_DEV_MODE && 'Delay values below 0 are not allowed for this animation step.');
28
+ }
29
+ function invalidStyleParams(varName) {
30
+ return new ɵRuntimeError(3001 /* INVALID_STYLE_PARAMS */, NG_DEV_MODE &&
31
+ `Unable to resolve the local animation param ${varName} in the given list of values`);
32
+ }
33
+ function invalidParamValue(varName) {
34
+ return new ɵRuntimeError(3003 /* INVALID_PARAM_VALUE */, NG_DEV_MODE && `Please provide a value for the animation param ${varName}`);
35
+ }
36
+ function invalidNodeType(nodeType) {
37
+ return new ɵRuntimeError(3004 /* INVALID_NODE_TYPE */, NG_DEV_MODE && `Unable to resolve animation metadata node #${nodeType}`);
38
+ }
39
+ function invalidCssUnitValue(userProvidedProperty, value) {
40
+ return new ɵRuntimeError(3005 /* INVALID_CSS_UNIT_VALUE */, NG_DEV_MODE && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`);
41
+ }
42
+ function invalidTrigger() {
43
+ return new ɵRuntimeError(3006 /* INVALID_TRIGGER */, NG_DEV_MODE &&
44
+ 'animation triggers cannot be prefixed with an `@` sign (e.g. trigger(\'@foo\', [...]))');
45
+ }
46
+ function invalidDefinition() {
47
+ return new ɵRuntimeError(3007 /* INVALID_DEFINITION */, NG_DEV_MODE && 'only state() and transition() definitions can sit inside of a trigger()');
48
+ }
49
+ function invalidState(metadataName, missingSubs) {
50
+ return new ɵRuntimeError(3008 /* INVALID_STATE */, NG_DEV_MODE &&
51
+ `state("${metadataName}", ...) must define default values for all the following style substitutions: ${missingSubs.join(', ')}`);
52
+ }
53
+ function invalidStyleValue(value) {
54
+ return new ɵRuntimeError(3002 /* INVALID_STYLE_VALUE */, NG_DEV_MODE && `The provided style string value ${value} is not allowed.`);
55
+ }
56
+ function invalidProperty(prop) {
57
+ return new ɵRuntimeError(3009 /* INVALID_PROPERTY */, NG_DEV_MODE &&
58
+ `The provided animation property "${prop}" is not a supported CSS property for animations`);
59
+ }
60
+ function invalidParallelAnimation(prop, firstStart, firstEnd, secondStart, secondEnd) {
61
+ return new ɵRuntimeError(3010 /* INVALID_PARALLEL_ANIMATION */, NG_DEV_MODE &&
62
+ `The CSS property "${prop}" that exists between the times of "${firstStart}ms" and "${firstEnd}ms" is also being animated in a parallel animation between the times of "${secondStart}ms" and "${secondEnd}ms"`);
63
+ }
64
+ function invalidKeyframes() {
65
+ return new ɵRuntimeError(3011 /* INVALID_KEYFRAMES */, NG_DEV_MODE && `keyframes() must be placed inside of a call to animate()`);
66
+ }
67
+ function invalidOffset() {
68
+ return new ɵRuntimeError(3012 /* INVALID_OFFSET */, NG_DEV_MODE && `Please ensure that all keyframe offsets are between 0 and 1`);
69
+ }
70
+ function keyframeOffsetsOutOfOrder() {
71
+ return new ɵRuntimeError(3200 /* KEYFRAME_OFFSETS_OUT_OF_ORDER */, NG_DEV_MODE && `Please ensure that all keyframe offsets are in order`);
72
+ }
73
+ function keyframesMissingOffsets() {
74
+ return new ɵRuntimeError(3202 /* KEYFRAMES_MISSING_OFFSETS */, NG_DEV_MODE && `Not all style() steps within the declared keyframes() contain offsets`);
75
+ }
76
+ function invalidStagger() {
77
+ return new ɵRuntimeError(3013 /* INVALID_STAGGER */, NG_DEV_MODE && `stagger() can only be used inside of query()`);
78
+ }
79
+ function invalidQuery(selector) {
80
+ return new ɵRuntimeError(3014 /* INVALID_QUERY */, NG_DEV_MODE &&
81
+ `\`query("${selector}")\` returned zero elements. (Use \`query("${selector}", { optional: true })\` if you wish to allow this.)`);
82
+ }
83
+ function invalidExpression(expr) {
84
+ return new ɵRuntimeError(3015 /* INVALID_EXPRESSION */, NG_DEV_MODE && `The provided transition expression "${expr}" is not supported`);
85
+ }
86
+ function invalidTransitionAlias(alias) {
87
+ return new ɵRuntimeError(3016 /* INVALID_TRANSITION_ALIAS */, NG_DEV_MODE && `The transition alias value "${alias}" is not supported`);
88
+ }
89
+ function validationFailed(errors) {
90
+ return new ɵRuntimeError(3500 /* VALIDATION_FAILED */, NG_DEV_MODE && `animation validation failed:\n${errors.map(err => err.message).join('\n')}`);
91
+ }
92
+ function buildingFailed(errors) {
93
+ return new ɵRuntimeError(3501 /* BUILDING_FAILED */, NG_DEV_MODE && `animation building failed:\n${errors.map(err => err.message).join('\n')}`);
94
+ }
95
+ function triggerBuildFailed(name, errors) {
96
+ return new ɵRuntimeError(3404 /* TRIGGER_BUILD_FAILED */, NG_DEV_MODE &&
97
+ `The animation trigger "${name}" has failed to build due to the following errors:\n - ${errors.map(err => err.message).join('\n - ')}`);
98
+ }
99
+ function animationFailed(errors) {
100
+ return new ɵRuntimeError(3502 /* ANIMATION_FAILED */, NG_DEV_MODE &&
101
+ `Unable to animate due to the following errors:${LINE_START}${errors.map(err => err.message).join(LINE_START)}`);
102
+ }
103
+ function registerFailed(errors) {
104
+ return new ɵRuntimeError(3503 /* REGISTRATION_FAILED */, NG_DEV_MODE &&
105
+ `Unable to build the animation due to the following errors: ${errors.map(err => err.message).join('\n')}`);
106
+ }
107
+ function missingOrDestroyedAnimation() {
108
+ return new ɵRuntimeError(3300 /* MISSING_OR_DESTROYED_ANIMATION */, NG_DEV_MODE && 'The requested animation doesn\'t exist or has already been destroyed');
109
+ }
110
+ function createAnimationFailed(errors) {
111
+ return new ɵRuntimeError(3504 /* CREATE_ANIMATION_FAILED */, NG_DEV_MODE &&
112
+ `Unable to create the animation due to the following errors:${errors.map(err => err.message).join('\n')}`);
113
+ }
114
+ function missingPlayer(id) {
115
+ return new ɵRuntimeError(3301 /* MISSING_PLAYER */, NG_DEV_MODE && `Unable to find the timeline player referenced by ${id}`);
116
+ }
117
+ function missingTrigger(phase, name) {
118
+ return new ɵRuntimeError(3302 /* MISSING_TRIGGER */, NG_DEV_MODE &&
119
+ `Unable to listen on the animation trigger event "${phase}" because the animation trigger "${name}" doesn\'t exist!`);
120
+ }
121
+ function missingEvent(name) {
122
+ return new ɵRuntimeError(3303 /* MISSING_EVENT */, NG_DEV_MODE &&
123
+ `Unable to listen on the animation trigger "${name}" because the provided event is undefined!`);
124
+ }
125
+ function unsupportedTriggerEvent(phase, name) {
126
+ return new ɵRuntimeError(3400 /* UNSUPPORTED_TRIGGER_EVENT */, NG_DEV_MODE &&
127
+ `The provided animation trigger event "${phase}" for the animation trigger "${name}" is not supported!`);
128
+ }
129
+ function unregisteredTrigger(name) {
130
+ return new ɵRuntimeError(3401 /* UNREGISTERED_TRIGGER */, NG_DEV_MODE && `The provided animation trigger "${name}" has not been registered!`);
131
+ }
132
+ function triggerTransitionsFailed(errors) {
133
+ return new ɵRuntimeError(3402 /* TRIGGER_TRANSITIONS_FAILED */, NG_DEV_MODE &&
134
+ `Unable to process animations due to the following failed trigger transitions\n ${errors.map(err => err.message).join('\n')}`);
135
+ }
136
+ function triggerParsingFailed(name, errors) {
137
+ return new ɵRuntimeError(3403 /* TRIGGER_PARSING_FAILED */, NG_DEV_MODE &&
138
+ `Animation parsing for the ${name} trigger have failed:${LINE_START}${errors.map(err => err.message).join(LINE_START)}`);
139
+ }
140
+ function transitionFailed(name, errors) {
141
+ return new ɵRuntimeError(3505 /* TRANSITION_FAILED */, NG_DEV_MODE &&
142
+ `@${name} has failed due to:\n ${errors.map(err => err.message).join('\n- ')}`);
143
+ }
10
144
 
11
145
  /**
12
146
  * @license
@@ -72,8 +206,7 @@ function normalizeKeyframes(driver, normalizer, element, keyframes, preStyles =
72
206
  previousOffset = offset;
73
207
  });
74
208
  if (errors.length) {
75
- const LINE_START = '\n - ';
76
- throw new Error(`Unable to animate due to the following errors:${LINE_START}${errors.join(LINE_START)}`);
209
+ throw animationFailed(errors);
77
210
  }
78
211
  return normalizedKeyframes;
79
212
  }
@@ -225,9 +358,9 @@ class NoopAnimationDriver {
225
358
  return new NoopAnimationPlayer(duration, delay);
226
359
  }
227
360
  }
228
- NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
229
- NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: NoopAnimationDriver });
230
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.0-rc.1", ngImport: i0, type: NoopAnimationDriver, decorators: [{
361
+ NoopAnimationDriver.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NoopAnimationDriver, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
362
+ NoopAnimationDriver.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NoopAnimationDriver });
363
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.3", ngImport: i0, type: NoopAnimationDriver, decorators: [{
231
364
  type: Injectable
232
365
  }] });
233
366
  /**
@@ -244,7 +377,7 @@ AnimationDriver.NOOP = ( /* @__PURE__ */new NoopAnimationDriver());
244
377
  * Use of this source code is governed by an MIT-style license that can be
245
378
  * found in the LICENSE file at https://angular.io/license
246
379
  */
247
- const ONE_SECOND$1 = 1000;
380
+ const ONE_SECOND = 1000;
248
381
  const SUBSTITUTION_EXPR_START = '{{';
249
382
  const SUBSTITUTION_EXPR_END = '}}';
250
383
  const ENTER_CLASSNAME = 'ng-enter';
@@ -264,7 +397,7 @@ function resolveTimingValue(value) {
264
397
  function _convertTimeValueToMS(value, unit) {
265
398
  switch (unit) {
266
399
  case 's':
267
- return value * ONE_SECOND$1;
400
+ return value * ONE_SECOND;
268
401
  default: // ms or something else
269
402
  return value;
270
403
  }
@@ -282,7 +415,7 @@ function parseTimeExpression(exp, errors, allowNegativeValues) {
282
415
  if (typeof exp === 'string') {
283
416
  const matches = exp.match(regex);
284
417
  if (matches === null) {
285
- errors.push(`The provided timing value "${exp}" is invalid.`);
418
+ errors.push(invalidTimingValue(exp));
286
419
  return { duration: 0, delay: 0, easing: '' };
287
420
  }
288
421
  duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
@@ -302,15 +435,15 @@ function parseTimeExpression(exp, errors, allowNegativeValues) {
302
435
  let containsErrors = false;
303
436
  let startIndex = errors.length;
304
437
  if (duration < 0) {
305
- errors.push(`Duration values below 0 are not allowed for this animation step.`);
438
+ errors.push(negativeStepValue());
306
439
  containsErrors = true;
307
440
  }
308
441
  if (delay < 0) {
309
- errors.push(`Delay values below 0 are not allowed for this animation step.`);
442
+ errors.push(negativeDelayValue());
310
443
  containsErrors = true;
311
444
  }
312
445
  if (containsErrors) {
313
- errors.splice(startIndex, 0, `The provided timing value "${exp}" is invalid.`);
446
+ errors.splice(startIndex, 0, invalidTimingValue(exp));
314
447
  }
315
448
  }
316
449
  return { duration, delay, easing };
@@ -416,7 +549,7 @@ function validateStyleParams(value, options, errors) {
416
549
  if (matches.length) {
417
550
  matches.forEach(varName => {
418
551
  if (!params.hasOwnProperty(varName)) {
419
- errors.push(`Unable to resolve the local animation param ${varName} in the given list of values`);
552
+ errors.push(invalidStyleParams(varName));
420
553
  }
421
554
  });
422
555
  }
@@ -439,7 +572,7 @@ function interpolateParams(value, params, errors) {
439
572
  let localVal = params[varName];
440
573
  // this means that the value was never overridden by the data passed in by the user
441
574
  if (!params.hasOwnProperty(varName)) {
442
- errors.push(`Please provide a value for the animation param ${varName}`);
575
+ errors.push(invalidParamValue(varName));
443
576
  localVal = '';
444
577
  }
445
578
  return localVal.toString();
@@ -518,7 +651,7 @@ function visitDslNode(visitor, node, context) {
518
651
  case 12 /* Stagger */:
519
652
  return visitor.visitStagger(node, context);
520
653
  default:
521
- throw new Error(`Unable to resolve animation metadata node #${node.type}`);
654
+ throw invalidNodeType(node.type);
522
655
  }
523
656
  }
524
657
  function computeStyle(element, prop) {
@@ -554,7 +687,7 @@ function parseInnerTransitionStr(eventStr, expressions, errors) {
554
687
  }
555
688
  const match = eventStr.match(/^(\*|[-\w]+)\s*(<?[=-]>)\s*(\*|[-\w]+)$/);
556
689
  if (match == null || match.length < 4) {
557
- errors.push(`The provided transition expression "${eventStr}" is not supported`);
690
+ errors.push(invalidExpression(eventStr));
558
691
  return expressions;
559
692
  }
560
693
  const fromState = match[1];
@@ -577,7 +710,7 @@ function parseAnimationAlias(alias, errors) {
577
710
  case ':decrement':
578
711
  return (fromState, toState) => parseFloat(toState) < parseFloat(fromState);
579
712
  default:
580
- errors.push(`The transition alias value "${alias}" is not supported`);
713
+ errors.push(invalidTransitionAlias(alias));
581
714
  return '* => *';
582
715
  }
583
716
  }
@@ -673,7 +806,7 @@ class AnimationAstBuilderVisitor {
673
806
  const states = [];
674
807
  const transitions = [];
675
808
  if (metadata.name.charAt(0) == '@') {
676
- context.errors.push('animation triggers cannot be prefixed with an `@` sign (e.g. trigger(\'@foo\', [...]))');
809
+ context.errors.push(invalidTrigger());
677
810
  }
678
811
  metadata.definitions.forEach(def => {
679
812
  this._resetContextStyleTimingState(context);
@@ -693,7 +826,7 @@ class AnimationAstBuilderVisitor {
693
826
  transitions.push(transition);
694
827
  }
695
828
  else {
696
- context.errors.push('only state() and transition() definitions can sit inside of a trigger()');
829
+ context.errors.push(invalidDefinition());
697
830
  }
698
831
  });
699
832
  return {
@@ -726,8 +859,7 @@ class AnimationAstBuilderVisitor {
726
859
  });
727
860
  if (missingSubs.size) {
728
861
  const missingSubsArr = iteratorToArray(missingSubs.values());
729
- context.errors.push(`state("${metadata
730
- .name}", ...) must define default values for all the following style substitutions: ${missingSubsArr.join(', ')}`);
862
+ context.errors.push(invalidState(metadata.name, missingSubsArr));
731
863
  }
732
864
  }
733
865
  return {
@@ -820,7 +952,7 @@ class AnimationAstBuilderVisitor {
820
952
  styles.push(styleTuple);
821
953
  }
822
954
  else {
823
- context.errors.push(`The provided style string value ${styleTuple} is not allowed.`);
955
+ context.errors.push(invalidStyleValue(styleTuple));
824
956
  }
825
957
  }
826
958
  else {
@@ -873,7 +1005,7 @@ class AnimationAstBuilderVisitor {
873
1005
  return;
874
1006
  Object.keys(tuple).forEach(prop => {
875
1007
  if (!this._driver.validateStyleProperty(prop)) {
876
- context.errors.push(`The provided animation property "${prop}" is not a supported CSS property for animations`);
1008
+ context.errors.push(invalidProperty(prop));
877
1009
  return;
878
1010
  }
879
1011
  const collectedStyles = context.collectedStyles[context.currentQuerySelector];
@@ -882,8 +1014,7 @@ class AnimationAstBuilderVisitor {
882
1014
  if (collectedEntry) {
883
1015
  if (startTime != endTime && startTime >= collectedEntry.startTime &&
884
1016
  endTime <= collectedEntry.endTime) {
885
- context.errors.push(`The CSS property "${prop}" that exists between the times of "${collectedEntry.startTime}ms" and "${collectedEntry
886
- .endTime}ms" is also being animated in a parallel animation between the times of "${startTime}ms" and "${endTime}ms"`);
1017
+ context.errors.push(invalidParallelAnimation(prop, collectedEntry.startTime, collectedEntry.endTime, startTime, endTime));
887
1018
  updateCollectedStyle = false;
888
1019
  }
889
1020
  // we always choose the smaller start time value since we
@@ -903,7 +1034,7 @@ class AnimationAstBuilderVisitor {
903
1034
  visitKeyframes(metadata, context) {
904
1035
  const ast = { type: 5 /* Keyframes */, styles: [], options: null };
905
1036
  if (!context.currentAnimateTimings) {
906
- context.errors.push(`keyframes() must be placed inside of a call to animate()`);
1037
+ context.errors.push(invalidKeyframes());
907
1038
  return ast;
908
1039
  }
909
1040
  const MAX_KEYFRAME_OFFSET = 1;
@@ -927,15 +1058,15 @@ class AnimationAstBuilderVisitor {
927
1058
  return style;
928
1059
  });
929
1060
  if (keyframesOutOfRange) {
930
- context.errors.push(`Please ensure that all keyframe offsets are between 0 and 1`);
1061
+ context.errors.push(invalidOffset());
931
1062
  }
932
1063
  if (offsetsOutOfOrder) {
933
- context.errors.push(`Please ensure that all keyframe offsets are in order`);
1064
+ context.errors.push(keyframeOffsetsOutOfOrder());
934
1065
  }
935
1066
  const length = metadata.steps.length;
936
1067
  let generatedOffset = 0;
937
1068
  if (totalKeyframesWithOffsets > 0 && totalKeyframesWithOffsets < length) {
938
- context.errors.push(`Not all style() steps within the declared keyframes() contain offsets`);
1069
+ context.errors.push(keyframesMissingOffsets());
939
1070
  }
940
1071
  else if (totalKeyframesWithOffsets == 0) {
941
1072
  generatedOffset = MAX_KEYFRAME_OFFSET / (length - 1);
@@ -1001,7 +1132,7 @@ class AnimationAstBuilderVisitor {
1001
1132
  }
1002
1133
  visitStagger(metadata, context) {
1003
1134
  if (!context.currentQuery) {
1004
- context.errors.push(`stagger() can only be used inside of query()`);
1135
+ context.errors.push(invalidStagger());
1005
1136
  }
1006
1137
  const timings = metadata.timings === 'full' ?
1007
1138
  { duration: 0, delay: 0, easing: 'full' } :
@@ -1624,7 +1755,7 @@ class AnimationTimelineContext {
1624
1755
  results.push(...elements);
1625
1756
  }
1626
1757
  if (!optional && results.length == 0) {
1627
- errors.push(`\`query("${originalSelector}")\` returned zero elements. (Use \`query("${originalSelector}", { optional: true })\` if you wish to allow this.)`);
1758
+ errors.push(invalidQuery(originalSelector));
1628
1759
  }
1629
1760
  return results;
1630
1761
  }
@@ -1912,8 +2043,7 @@ class Animation {
1912
2043
  const errors = [];
1913
2044
  const ast = buildAnimationAst(_driver, input, errors);
1914
2045
  if (errors.length) {
1915
- const errorMessage = `animation validation failed:\n${errors.join('\n')}`;
1916
- throw new Error(errorMessage);
2046
+ throw validationFailed(errors);
1917
2047
  }
1918
2048
  this._animationAst = ast;
1919
2049
  }
@@ -1926,8 +2056,7 @@ class Animation {
1926
2056
  subInstructions = subInstructions || new ElementInstructionMap();
1927
2057
  const result = buildAnimationTimelines(this._driver, element, this._animationAst, ENTER_CLASSNAME, LEAVE_CLASSNAME, start, dest, options, subInstructions, errors);
1928
2058
  if (errors.length) {
1929
- const errorMessage = `animation building failed:\n${errors.join('\n')}`;
1930
- throw new Error(errorMessage);
2059
+ throw buildingFailed(errors);
1931
2060
  }
1932
2061
  return result;
1933
2062
  }
@@ -1978,7 +2107,7 @@ class WebAnimationsStyleNormalizer extends AnimationStyleNormalizer {
1978
2107
  else {
1979
2108
  const valAndSuffixMatch = value.match(/^[+-]?[\d\.]+([a-z]*)$/);
1980
2109
  if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {
1981
- errors.push(`Please provide a CSS unit value for ${userProvidedProperty}:${value}`);
2110
+ errors.push(invalidCssUnitValue(userProvidedProperty, value));
1982
2111
  }
1983
2112
  }
1984
2113
  }
@@ -2177,7 +2306,7 @@ class TimelineAnimationEngine {
2177
2306
  const errors = [];
2178
2307
  const ast = buildAnimationAst(this._driver, metadata, errors);
2179
2308
  if (errors.length) {
2180
- throw new Error(`Unable to build the animation due to the following errors: ${errors.join('\n')}`);
2309
+ throw registerFailed(errors);
2181
2310
  }
2182
2311
  else {
2183
2312
  this._animations[id] = ast;
@@ -2201,11 +2330,11 @@ class TimelineAnimationEngine {
2201
2330
  });
2202
2331
  }
2203
2332
  else {
2204
- errors.push('The requested animation doesn\'t exist or has already been destroyed');
2333
+ errors.push(missingOrDestroyedAnimation());
2205
2334
  instructions = [];
2206
2335
  }
2207
2336
  if (errors.length) {
2208
- throw new Error(`Unable to create the animation due to the following errors: ${errors.join('\n')}`);
2337
+ throw createAnimationFailed(errors);
2209
2338
  }
2210
2339
  autoStylesMap.forEach((styles, element) => {
2211
2340
  Object.keys(styles).forEach(prop => {
@@ -2234,7 +2363,7 @@ class TimelineAnimationEngine {
2234
2363
  _getPlayer(id) {
2235
2364
  const player = this._playersById[id];
2236
2365
  if (!player) {
2237
- throw new Error(`Unable to find the timeline player referenced by ${id}`);
2366
+ throw missingPlayer(id);
2238
2367
  }
2239
2368
  return player;
2240
2369
  }
@@ -2362,13 +2491,13 @@ class AnimationTransitionNamespace {
2362
2491
  }
2363
2492
  listen(element, name, phase, callback) {
2364
2493
  if (!this._triggers.hasOwnProperty(name)) {
2365
- throw new Error(`Unable to listen on the animation trigger event "${phase}" because the animation trigger "${name}" doesn\'t exist!`);
2494
+ throw missingTrigger(phase, name);
2366
2495
  }
2367
2496
  if (phase == null || phase.length == 0) {
2368
- throw new Error(`Unable to listen on the animation trigger "${name}" because the provided event is undefined!`);
2497
+ throw missingEvent(name);
2369
2498
  }
2370
2499
  if (!isTriggerEventValid(phase)) {
2371
- throw new Error(`The provided animation trigger event "${phase}" for the animation trigger "${name}" is not supported!`);
2500
+ throw unsupportedTriggerEvent(phase, name);
2372
2501
  }
2373
2502
  const listeners = getOrSetAsInMap(this._elementListeners, element, []);
2374
2503
  const data = { name, phase, callback };
@@ -2407,7 +2536,7 @@ class AnimationTransitionNamespace {
2407
2536
  _getTrigger(name) {
2408
2537
  const trigger = this._triggers[name];
2409
2538
  if (!trigger) {
2410
- throw new Error(`The provided animation trigger "${name}" has not been registered!`);
2539
+ throw unregisteredTrigger(name);
2411
2540
  }
2412
2541
  return trigger;
2413
2542
  }
@@ -3047,7 +3176,7 @@ class TransitionAnimationEngine {
3047
3176
  }
3048
3177
  }
3049
3178
  reportError(errors) {
3050
- throw new Error(`Unable to process animations due to the following failed trigger transitions\n ${errors.join('\n')}`);
3179
+ throw triggerTransitionsFailed(errors);
3051
3180
  }
3052
3181
  _flushAnimations(cleanupFns, microtaskId) {
3053
3182
  const subTimelines = new ElementInstructionMap();
@@ -3209,8 +3338,7 @@ class TransitionAnimationEngine {
3209
3338
  if (erroneousTransitions.length) {
3210
3339
  const errors = [];
3211
3340
  erroneousTransitions.forEach(instruction => {
3212
- errors.push(`@${instruction.triggerName} has failed due to:\n`);
3213
- instruction.errors.forEach(error => errors.push(`- ${error}\n`));
3341
+ errors.push(transitionFailed(instruction.triggerName, instruction.errors));
3214
3342
  });
3215
3343
  allPlayers.forEach(player => player.destroy());
3216
3344
  this.reportError(errors);
@@ -3825,7 +3953,7 @@ class AnimationEngine {
3825
3953
  const errors = [];
3826
3954
  const ast = buildAnimationAst(this._driver, metadata, errors);
3827
3955
  if (errors.length) {
3828
- throw new Error(`The animation trigger "${name}" has failed to build due to the following errors:\n - ${errors.join('\n - ')}`);
3956
+ throw triggerBuildFailed(name, errors);
3829
3957
  }
3830
3958
  trigger = buildTrigger(name, ast, this._normalizer);
3831
3959
  this._triggerCache[cacheKey] = trigger;
@@ -3983,439 +4111,6 @@ function isNonAnimatableStyle(prop) {
3983
4111
  return prop === 'display' || prop === 'position';
3984
4112
  }
3985
4113
 
3986
- /**
3987
- * @license
3988
- * Copyright Google LLC All Rights Reserved.
3989
- *
3990
- * Use of this source code is governed by an MIT-style license that can be
3991
- * found in the LICENSE file at https://angular.io/license
3992
- */
3993
- const ELAPSED_TIME_MAX_DECIMAL_PLACES = 3;
3994
- const ANIMATION_PROP = 'animation';
3995
- const ANIMATIONEND_EVENT = 'animationend';
3996
- const ONE_SECOND = 1000;
3997
- class ElementAnimationStyleHandler {
3998
- constructor(_element, _name, _duration, _delay, _easing, _fillMode, _onDoneFn) {
3999
- this._element = _element;
4000
- this._name = _name;
4001
- this._duration = _duration;
4002
- this._delay = _delay;
4003
- this._easing = _easing;
4004
- this._fillMode = _fillMode;
4005
- this._onDoneFn = _onDoneFn;
4006
- this._finished = false;
4007
- this._destroyed = false;
4008
- this._startTime = 0;
4009
- this._position = 0;
4010
- this._eventFn = (e) => this._handleCallback(e);
4011
- }
4012
- apply() {
4013
- applyKeyframeAnimation(this._element, `${this._duration}ms ${this._easing} ${this._delay}ms 1 normal ${this._fillMode} ${this._name}`);
4014
- addRemoveAnimationEvent(this._element, this._eventFn, false);
4015
- this._startTime = Date.now();
4016
- }
4017
- pause() {
4018
- playPauseAnimation(this._element, this._name, 'paused');
4019
- }
4020
- resume() {
4021
- playPauseAnimation(this._element, this._name, 'running');
4022
- }
4023
- setPosition(position) {
4024
- const index = findIndexForAnimation(this._element, this._name);
4025
- this._position = position * this._duration;
4026
- setAnimationStyle(this._element, 'Delay', `-${this._position}ms`, index);
4027
- }
4028
- getPosition() {
4029
- return this._position;
4030
- }
4031
- _handleCallback(event) {
4032
- const timestamp = event._ngTestManualTimestamp || Date.now();
4033
- const elapsedTime = parseFloat(event.elapsedTime.toFixed(ELAPSED_TIME_MAX_DECIMAL_PLACES)) * ONE_SECOND;
4034
- if (event.animationName == this._name &&
4035
- Math.max(timestamp - this._startTime, 0) >= this._delay && elapsedTime >= this._duration) {
4036
- this.finish();
4037
- }
4038
- }
4039
- finish() {
4040
- if (this._finished)
4041
- return;
4042
- this._finished = true;
4043
- this._onDoneFn();
4044
- addRemoveAnimationEvent(this._element, this._eventFn, true);
4045
- }
4046
- destroy() {
4047
- if (this._destroyed)
4048
- return;
4049
- this._destroyed = true;
4050
- this.finish();
4051
- removeKeyframeAnimation(this._element, this._name);
4052
- }
4053
- }
4054
- function playPauseAnimation(element, name, status) {
4055
- const index = findIndexForAnimation(element, name);
4056
- setAnimationStyle(element, 'PlayState', status, index);
4057
- }
4058
- function applyKeyframeAnimation(element, value) {
4059
- const anim = getAnimationStyle(element, '').trim();
4060
- let index = 0;
4061
- if (anim.length) {
4062
- index = countChars(anim, ',') + 1;
4063
- value = `${anim}, ${value}`;
4064
- }
4065
- setAnimationStyle(element, '', value);
4066
- return index;
4067
- }
4068
- function removeKeyframeAnimation(element, name) {
4069
- const anim = getAnimationStyle(element, '');
4070
- const tokens = anim.split(',');
4071
- const index = findMatchingTokenIndex(tokens, name);
4072
- if (index >= 0) {
4073
- tokens.splice(index, 1);
4074
- const newValue = tokens.join(',');
4075
- setAnimationStyle(element, '', newValue);
4076
- }
4077
- }
4078
- function findIndexForAnimation(element, value) {
4079
- const anim = getAnimationStyle(element, '');
4080
- if (anim.indexOf(',') > 0) {
4081
- const tokens = anim.split(',');
4082
- return findMatchingTokenIndex(tokens, value);
4083
- }
4084
- return findMatchingTokenIndex([anim], value);
4085
- }
4086
- function findMatchingTokenIndex(tokens, searchToken) {
4087
- for (let i = 0; i < tokens.length; i++) {
4088
- if (tokens[i].indexOf(searchToken) >= 0) {
4089
- return i;
4090
- }
4091
- }
4092
- return -1;
4093
- }
4094
- function addRemoveAnimationEvent(element, fn, doRemove) {
4095
- doRemove ? element.removeEventListener(ANIMATIONEND_EVENT, fn) :
4096
- element.addEventListener(ANIMATIONEND_EVENT, fn);
4097
- }
4098
- function setAnimationStyle(element, name, value, index) {
4099
- const prop = ANIMATION_PROP + name;
4100
- if (index != null) {
4101
- const oldValue = element.style[prop];
4102
- if (oldValue.length) {
4103
- const tokens = oldValue.split(',');
4104
- tokens[index] = value;
4105
- value = tokens.join(',');
4106
- }
4107
- }
4108
- element.style[prop] = value;
4109
- }
4110
- function getAnimationStyle(element, name) {
4111
- return element.style[ANIMATION_PROP + name] || '';
4112
- }
4113
- function countChars(value, char) {
4114
- let count = 0;
4115
- for (let i = 0; i < value.length; i++) {
4116
- const c = value.charAt(i);
4117
- if (c === char)
4118
- count++;
4119
- }
4120
- return count;
4121
- }
4122
-
4123
- const DEFAULT_FILL_MODE = 'forwards';
4124
- const DEFAULT_EASING = 'linear';
4125
- class CssKeyframesPlayer {
4126
- constructor(element, keyframes, animationName, _duration, _delay, easing, _finalStyles, _specialStyles) {
4127
- this.element = element;
4128
- this.keyframes = keyframes;
4129
- this.animationName = animationName;
4130
- this._duration = _duration;
4131
- this._delay = _delay;
4132
- this._finalStyles = _finalStyles;
4133
- this._specialStyles = _specialStyles;
4134
- this._onDoneFns = [];
4135
- this._onStartFns = [];
4136
- this._onDestroyFns = [];
4137
- this.currentSnapshot = {};
4138
- this._state = 0;
4139
- this.easing = easing || DEFAULT_EASING;
4140
- this.totalTime = _duration + _delay;
4141
- this._buildStyler();
4142
- }
4143
- onStart(fn) {
4144
- this._onStartFns.push(fn);
4145
- }
4146
- onDone(fn) {
4147
- this._onDoneFns.push(fn);
4148
- }
4149
- onDestroy(fn) {
4150
- this._onDestroyFns.push(fn);
4151
- }
4152
- destroy() {
4153
- this.init();
4154
- if (this._state >= 4 /* DESTROYED */)
4155
- return;
4156
- this._state = 4 /* DESTROYED */;
4157
- this._styler.destroy();
4158
- this._flushStartFns();
4159
- this._flushDoneFns();
4160
- if (this._specialStyles) {
4161
- this._specialStyles.destroy();
4162
- }
4163
- this._onDestroyFns.forEach(fn => fn());
4164
- this._onDestroyFns = [];
4165
- }
4166
- _flushDoneFns() {
4167
- this._onDoneFns.forEach(fn => fn());
4168
- this._onDoneFns = [];
4169
- }
4170
- _flushStartFns() {
4171
- this._onStartFns.forEach(fn => fn());
4172
- this._onStartFns = [];
4173
- }
4174
- finish() {
4175
- this.init();
4176
- if (this._state >= 3 /* FINISHED */)
4177
- return;
4178
- this._state = 3 /* FINISHED */;
4179
- this._styler.finish();
4180
- this._flushStartFns();
4181
- if (this._specialStyles) {
4182
- this._specialStyles.finish();
4183
- }
4184
- this._flushDoneFns();
4185
- }
4186
- setPosition(value) {
4187
- this._styler.setPosition(value);
4188
- }
4189
- getPosition() {
4190
- return this._styler.getPosition();
4191
- }
4192
- hasStarted() {
4193
- return this._state >= 2 /* STARTED */;
4194
- }
4195
- init() {
4196
- if (this._state >= 1 /* INITIALIZED */)
4197
- return;
4198
- this._state = 1 /* INITIALIZED */;
4199
- const elm = this.element;
4200
- this._styler.apply();
4201
- if (this._delay) {
4202
- this._styler.pause();
4203
- }
4204
- }
4205
- play() {
4206
- this.init();
4207
- if (!this.hasStarted()) {
4208
- this._flushStartFns();
4209
- this._state = 2 /* STARTED */;
4210
- if (this._specialStyles) {
4211
- this._specialStyles.start();
4212
- }
4213
- }
4214
- this._styler.resume();
4215
- }
4216
- pause() {
4217
- this.init();
4218
- this._styler.pause();
4219
- }
4220
- restart() {
4221
- this.reset();
4222
- this.play();
4223
- }
4224
- reset() {
4225
- this._state = 0 /* RESET */;
4226
- this._styler.destroy();
4227
- this._buildStyler();
4228
- this._styler.apply();
4229
- }
4230
- _buildStyler() {
4231
- this._styler = new ElementAnimationStyleHandler(this.element, this.animationName, this._duration, this._delay, this.easing, DEFAULT_FILL_MODE, () => this.finish());
4232
- }
4233
- /** @internal */
4234
- triggerCallback(phaseName) {
4235
- const methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns;
4236
- methods.forEach(fn => fn());
4237
- methods.length = 0;
4238
- }
4239
- beforeDestroy() {
4240
- this.init();
4241
- const styles = {};
4242
- if (this.hasStarted()) {
4243
- const finished = this._state >= 3 /* FINISHED */;
4244
- Object.keys(this._finalStyles).forEach(prop => {
4245
- if (prop != 'offset') {
4246
- styles[prop] = finished ? this._finalStyles[prop] : computeStyle(this.element, prop);
4247
- }
4248
- });
4249
- }
4250
- this.currentSnapshot = styles;
4251
- }
4252
- }
4253
-
4254
- /**
4255
- * @license
4256
- * Copyright Google LLC All Rights Reserved.
4257
- *
4258
- * Use of this source code is governed by an MIT-style license that can be
4259
- * found in the LICENSE file at https://angular.io/license
4260
- */
4261
- class DirectStylePlayer extends NoopAnimationPlayer {
4262
- constructor(element, styles) {
4263
- super();
4264
- this.element = element;
4265
- this._startingStyles = {};
4266
- this.__initialized = false;
4267
- this._styles = hypenatePropsObject(styles);
4268
- }
4269
- init() {
4270
- if (this.__initialized || !this._startingStyles)
4271
- return;
4272
- this.__initialized = true;
4273
- Object.keys(this._styles).forEach(prop => {
4274
- this._startingStyles[prop] = this.element.style[prop];
4275
- });
4276
- super.init();
4277
- }
4278
- play() {
4279
- if (!this._startingStyles)
4280
- return;
4281
- this.init();
4282
- Object.keys(this._styles)
4283
- .forEach(prop => this.element.style.setProperty(prop, this._styles[prop]));
4284
- super.play();
4285
- }
4286
- destroy() {
4287
- if (!this._startingStyles)
4288
- return;
4289
- Object.keys(this._startingStyles).forEach(prop => {
4290
- const value = this._startingStyles[prop];
4291
- if (value) {
4292
- this.element.style.setProperty(prop, value);
4293
- }
4294
- else {
4295
- this.element.style.removeProperty(prop);
4296
- }
4297
- });
4298
- this._startingStyles = null;
4299
- super.destroy();
4300
- }
4301
- }
4302
-
4303
- const KEYFRAMES_NAME_PREFIX = 'gen_css_kf_';
4304
- const TAB_SPACE = ' ';
4305
- class CssKeyframesDriver {
4306
- constructor() {
4307
- this._count = 0;
4308
- }
4309
- validateStyleProperty(prop) {
4310
- return validateStyleProperty(prop);
4311
- }
4312
- matchesElement(_element, _selector) {
4313
- // This method is deprecated and no longer in use so we return false.
4314
- return false;
4315
- }
4316
- containsElement(elm1, elm2) {
4317
- return containsElement(elm1, elm2);
4318
- }
4319
- query(element, selector, multi) {
4320
- return invokeQuery(element, selector, multi);
4321
- }
4322
- computeStyle(element, prop, defaultValue) {
4323
- return window.getComputedStyle(element)[prop];
4324
- }
4325
- buildKeyframeElement(element, name, keyframes) {
4326
- keyframes = keyframes.map(kf => hypenatePropsObject(kf));
4327
- let keyframeStr = `@keyframes ${name} {\n`;
4328
- let tab = '';
4329
- keyframes.forEach(kf => {
4330
- tab = TAB_SPACE;
4331
- const offset = parseFloat(kf['offset']);
4332
- keyframeStr += `${tab}${offset * 100}% {\n`;
4333
- tab += TAB_SPACE;
4334
- Object.keys(kf).forEach(prop => {
4335
- const value = kf[prop];
4336
- switch (prop) {
4337
- case 'offset':
4338
- return;
4339
- case 'easing':
4340
- if (value) {
4341
- keyframeStr += `${tab}animation-timing-function: ${value};\n`;
4342
- }
4343
- return;
4344
- default:
4345
- keyframeStr += `${tab}${prop}: ${value};\n`;
4346
- return;
4347
- }
4348
- });
4349
- keyframeStr += `${tab}}\n`;
4350
- });
4351
- keyframeStr += `}\n`;
4352
- const kfElm = document.createElement('style');
4353
- kfElm.textContent = keyframeStr;
4354
- return kfElm;
4355
- }
4356
- animate(element, keyframes, duration, delay, easing, previousPlayers = [], scrubberAccessRequested) {
4357
- if ((typeof ngDevMode === 'undefined' || ngDevMode) && scrubberAccessRequested) {
4358
- notifyFaultyScrubber();
4359
- }
4360
- const previousCssKeyframePlayers = previousPlayers.filter(player => player instanceof CssKeyframesPlayer);
4361
- const previousStyles = {};
4362
- if (allowPreviousPlayerStylesMerge(duration, delay)) {
4363
- previousCssKeyframePlayers.forEach(player => {
4364
- let styles = player.currentSnapshot;
4365
- Object.keys(styles).forEach(prop => previousStyles[prop] = styles[prop]);
4366
- });
4367
- }
4368
- keyframes = balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles);
4369
- const finalStyles = flattenKeyframesIntoStyles(keyframes);
4370
- // if there is no animation then there is no point in applying
4371
- // styles and waiting for an event to get fired. This causes lag.
4372
- // It's better to just directly apply the styles to the element
4373
- // via the direct styling animation player.
4374
- if (duration == 0) {
4375
- return new DirectStylePlayer(element, finalStyles);
4376
- }
4377
- const animationName = `${KEYFRAMES_NAME_PREFIX}${this._count++}`;
4378
- const kfElm = this.buildKeyframeElement(element, animationName, keyframes);
4379
- const nodeToAppendKfElm = findNodeToAppendKeyframeElement(element);
4380
- nodeToAppendKfElm.appendChild(kfElm);
4381
- const specialStyles = packageNonAnimatableStyles(element, keyframes);
4382
- const player = new CssKeyframesPlayer(element, keyframes, animationName, duration, delay, easing, finalStyles, specialStyles);
4383
- player.onDestroy(() => removeElement(kfElm));
4384
- return player;
4385
- }
4386
- }
4387
- function findNodeToAppendKeyframeElement(element) {
4388
- const rootNode = element.getRootNode?.();
4389
- if (typeof ShadowRoot !== 'undefined' && rootNode instanceof ShadowRoot) {
4390
- return rootNode;
4391
- }
4392
- return document.head;
4393
- }
4394
- function flattenKeyframesIntoStyles(keyframes) {
4395
- let flatKeyframes = {};
4396
- if (keyframes) {
4397
- const kfs = Array.isArray(keyframes) ? keyframes : [keyframes];
4398
- kfs.forEach(kf => {
4399
- Object.keys(kf).forEach(prop => {
4400
- if (prop == 'offset' || prop == 'easing')
4401
- return;
4402
- flatKeyframes[prop] = kf[prop];
4403
- });
4404
- });
4405
- }
4406
- return flatKeyframes;
4407
- }
4408
- function removeElement(node) {
4409
- node.parentNode.removeChild(node);
4410
- }
4411
- let warningIssued = false;
4412
- function notifyFaultyScrubber() {
4413
- if (warningIssued)
4414
- return;
4415
- console.warn('@angular/animations: please load the web-animations.js polyfill to allow programmatic access...\n', ' visit https://bit.ly/IWukam to learn more about using the web-animation-js polyfill.');
4416
- warningIssued = true;
4417
- }
4418
-
4419
4114
  class WebAnimationsPlayer {
4420
4115
  constructor(element, keyframes, options, _specialStyles) {
4421
4116
  this.element = element;
@@ -4571,10 +4266,6 @@ class WebAnimationsPlayer {
4571
4266
  }
4572
4267
 
4573
4268
  class WebAnimationsDriver {
4574
- constructor() {
4575
- this._isNativeImpl = /\{\s*\[native\s+code\]\s*\}/.test(getElementAnimateFn().toString());
4576
- this._cssKeyframesDriver = new CssKeyframesDriver();
4577
- }
4578
4269
  validateStyleProperty(prop) {
4579
4270
  return validateStyleProperty(prop);
4580
4271
  }
@@ -4591,14 +4282,7 @@ class WebAnimationsDriver {
4591
4282
  computeStyle(element, prop, defaultValue) {
4592
4283
  return window.getComputedStyle(element)[prop];
4593
4284
  }
4594
- overrideWebAnimationsSupport(supported) {
4595
- this._isNativeImpl = supported;
4596
- }
4597
- animate(element, keyframes, duration, delay, easing, previousPlayers = [], scrubberAccessRequested) {
4598
- const useKeyframes = !scrubberAccessRequested && !this._isNativeImpl;
4599
- if (useKeyframes) {
4600
- return this._cssKeyframesDriver.animate(element, keyframes, duration, delay, easing, previousPlayers);
4601
- }
4285
+ animate(element, keyframes, duration, delay, easing, previousPlayers = []) {
4602
4286
  const fill = delay == 0 ? 'both' : 'forwards';
4603
4287
  const playerOptions = { duration, delay, fill };
4604
4288
  // we check for this to avoid having a null|undefined value be present
@@ -4620,12 +4304,6 @@ class WebAnimationsDriver {
4620
4304
  return new WebAnimationsPlayer(element, keyframes, playerOptions, specialStyles);
4621
4305
  }
4622
4306
  }
4623
- function supportsWebAnimations() {
4624
- return typeof getElementAnimateFn() === 'function';
4625
- }
4626
- function getElementAnimateFn() {
4627
- return (isBrowser() && Element.prototype['animate']) || {};
4628
- }
4629
4307
 
4630
4308
  /**
4631
4309
  * @license
@@ -4663,5 +4341,5 @@ function getElementAnimateFn() {
4663
4341
  * Generated bundle index. Do not edit.
4664
4342
  */
4665
4343
 
4666
- export { AnimationDriver, Animation as ɵAnimation, AnimationEngine as ɵAnimationEngine, AnimationStyleNormalizer as ɵAnimationStyleNormalizer, CssKeyframesDriver as ɵCssKeyframesDriver, CssKeyframesPlayer as ɵCssKeyframesPlayer, NoopAnimationDriver as ɵNoopAnimationDriver, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer, WebAnimationsDriver as ɵWebAnimationsDriver, WebAnimationsPlayer as ɵWebAnimationsPlayer, WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer, allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, containsElement as ɵcontainsElement, invokeQuery as ɵinvokeQuery, supportsWebAnimations as ɵsupportsWebAnimations, validateStyleProperty as ɵvalidateStyleProperty };
4344
+ export { AnimationDriver, Animation as ɵAnimation, AnimationEngine as ɵAnimationEngine, AnimationStyleNormalizer as ɵAnimationStyleNormalizer, NoopAnimationDriver as ɵNoopAnimationDriver, NoopAnimationStyleNormalizer as ɵNoopAnimationStyleNormalizer, WebAnimationsDriver as ɵWebAnimationsDriver, WebAnimationsPlayer as ɵWebAnimationsPlayer, WebAnimationsStyleNormalizer as ɵWebAnimationsStyleNormalizer, allowPreviousPlayerStylesMerge as ɵallowPreviousPlayerStylesMerge, containsElement as ɵcontainsElement, invokeQuery as ɵinvokeQuery, validateStyleProperty as ɵvalidateStyleProperty };
4667
4345
  //# sourceMappingURL=browser.mjs.map