{"version":3,"file":"animations.es5.js","sources":["../../../../packages/animations/public_api.ts","../../../../packages/animations/src/animations.ts","../../../../packages/animations/src/players/animation_group_player.ts","../../../../packages/animations/src/private_export.ts","../../../../packages/animations/src/players/animation_player.ts","../../../../packages/animations/src/util.ts","../../../../packages/animations/src/animation_metadata.ts","../../../../packages/animations/src/animation_builder.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all public APIs of the animation package.\n */\nexport {AnimationBuilder,AnimationFactory,AnimationEvent,AUTO_STYLE,AnimateChildOptions,AnimateTimings,AnimationAnimateChildMetadata,AnimationAnimateMetadata,AnimationAnimateRefMetadata,AnimationGroupMetadata,AnimationKeyframesSequenceMetadata,AnimationMetadata,AnimationMetadataType,AnimationOptions,AnimationQueryMetadata,AnimationQueryOptions,AnimationReferenceMetadata,AnimationSequenceMetadata,AnimationStaggerMetadata,AnimationStateMetadata,AnimationStyleMetadata,AnimationTransitionMetadata,AnimationTriggerMetadata,animate,animateChild,animation,group,keyframes,query,sequence,stagger,state,style,transition,trigger,useAnimation,ɵStyleData,AnimationPlayer,NoopAnimationPlayer,ɵAnimationGroupPlayer,ɵPRE_STYLE} from './src/animations';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n/**\n * @module\n * @description\n * Entry point for all animation APIs of the animation package.\n */\nexport {AnimationBuilder, AnimationFactory} from './animation_builder';\nexport {AnimationEvent} from './animation_event';\nexport {AUTO_STYLE, AnimateChildOptions, AnimateTimings, AnimationAnimateChildMetadata, AnimationAnimateMetadata, AnimationAnimateRefMetadata, AnimationGroupMetadata, AnimationKeyframesSequenceMetadata, AnimationMetadata, AnimationMetadataType, AnimationOptions, AnimationQueryMetadata, AnimationQueryOptions, AnimationReferenceMetadata, AnimationSequenceMetadata, AnimationStaggerMetadata, AnimationStateMetadata, AnimationStyleMetadata, AnimationTransitionMetadata, AnimationTriggerMetadata, animate, animateChild, animation, group, keyframes, query, sequence, stagger, state, style, transition, trigger, useAnimation, ɵStyleData} from './animation_metadata';\nexport {AnimationPlayer, NoopAnimationPlayer} from './players/animation_player';\n\nexport {ɵAnimationGroupPlayer,ɵPRE_STYLE} from './private_export';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\n\nimport {scheduleMicroTask} from '../util';\nimport {AnimationPlayer} from './animation_player';\nexport class AnimationGroupPlayer implements AnimationPlayer {\nprivate _onDoneFns: Function[] = [];\nprivate _onStartFns: Function[] = [];\nprivate _finished = false;\nprivate _started = false;\nprivate _destroyed = false;\nprivate _onDestroyFns: Function[] = [];\npublic parentPlayer: AnimationPlayer|null = null;\npublic totalTime: number = 0;\n/**\n * @param {?} _players\n */\nconstructor(private _players: AnimationPlayer[]) {\n let doneCount = 0;\n let destroyCount = 0;\n let startCount = 0;\n const total = this._players.length;\n\n if (total == 0) {\n scheduleMicroTask(() => this._onFinish());\n } else {\n this._players.forEach(player => {\n player.parentPlayer = this;\n player.onDone(() => {\n if (++doneCount >= total) {\n this._onFinish();\n }\n });\n player.onDestroy(() => {\n if (++destroyCount >= total) {\n this._onDestroy();\n }\n });\n player.onStart(() => {\n if (++startCount >= total) {\n this._onStart();\n }\n });\n });\n }\n\n this.totalTime = this._players.reduce((time, player) => Math.max(time, player.totalTime), 0);\n }\n/**\n * @return {?}\n */\nprivate _onFinish() {\n if (!this._finished) {\n this._finished = true;\n this._onDoneFns.forEach(fn => fn());\n this._onDoneFns = [];\n }\n }\n/**\n * @return {?}\n */\ninit(): void { this._players.forEach(player => player.init()); }\n/**\n * @param {?} fn\n * @return {?}\n */\nonStart(fn: () => void): void { this._onStartFns.push(fn); }\n/**\n * @return {?}\n */\nprivate _onStart() {\n if (!this.hasStarted()) {\n this._onStartFns.forEach(fn => fn());\n this._onStartFns = [];\n this._started = true;\n }\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nonDone(fn: () => void): void { this._onDoneFns.push(fn); }\n/**\n * @param {?} fn\n * @return {?}\n */\nonDestroy(fn: () => void): void { this._onDestroyFns.push(fn); }\n/**\n * @return {?}\n */\nhasStarted() { return this._started; }\n/**\n * @return {?}\n */\nplay() {\n if (!this.parentPlayer) {\n this.init();\n }\n this._onStart();\n this._players.forEach(player => player.play());\n }\n/**\n * @return {?}\n */\npause(): void { this._players.forEach(player => player.pause()); }\n/**\n * @return {?}\n */\nrestart(): void { this._players.forEach(player => player.restart()); }\n/**\n * @return {?}\n */\nfinish(): void {\n this._onFinish();\n this._players.forEach(player => player.finish());\n }\n/**\n * @return {?}\n */\ndestroy(): void { this._onDestroy(); }\n/**\n * @return {?}\n */\nprivate _onDestroy() {\n if (!this._destroyed) {\n this._destroyed = true;\n this._onFinish();\n this._players.forEach(player => player.destroy());\n this._onDestroyFns.forEach(fn => fn());\n this._onDestroyFns = [];\n }\n }\n/**\n * @return {?}\n */\nreset(): void {\n this._players.forEach(player => player.reset());\n this._destroyed = false;\n this._finished = false;\n this._started = false;\n }\n/**\n * @param {?} p\n * @return {?}\n */\nsetPosition(p: number): void {\n const /** @type {?} */ timeAtPosition = p * this.totalTime;\n this._players.forEach(player => {\n const /** @type {?} */ position = player.totalTime ? Math.min(1, timeAtPosition / player.totalTime) : 1;\n player.setPosition(position);\n });\n }\n/**\n * @return {?}\n */\ngetPosition(): number {\n let /** @type {?} */ min = 0;\n this._players.forEach(player => {\n const /** @type {?} */ p = player.getPosition();\n min = Math.min(p, min);\n });\n return min;\n }\n/**\n * @return {?}\n */\nget players(): AnimationPlayer[] { return this._players; }\n/**\n * @return {?}\n */\nbeforeDestroy(): void {\n this.players.forEach(player => {\n if (player.beforeDestroy) {\n player.beforeDestroy();\n }\n });\n }\n}\n\nfunction AnimationGroupPlayer_tsickle_Closure_declarations() {\n/** @type {?} */\nAnimationGroupPlayer.prototype._onDoneFns;\n/** @type {?} */\nAnimationGroupPlayer.prototype._onStartFns;\n/** @type {?} */\nAnimationGroupPlayer.prototype._finished;\n/** @type {?} */\nAnimationGroupPlayer.prototype._started;\n/** @type {?} */\nAnimationGroupPlayer.prototype._destroyed;\n/** @type {?} */\nAnimationGroupPlayer.prototype._onDestroyFns;\n/** @type {?} */\nAnimationGroupPlayer.prototype.parentPlayer;\n/** @type {?} */\nAnimationGroupPlayer.prototype.totalTime;\n/** @type {?} */\nAnimationGroupPlayer.prototype._players;\n}\n\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nexport {AnimationGroupPlayer as ɵAnimationGroupPlayer} from './players/animation_group_player';\nexport const /** @type {?} */ ɵPRE_STYLE = '!';\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n\nimport {scheduleMicroTask} from '../util';\n\n/**\n * AnimationPlayer controls an animation sequence that was produced from a programmatic animation.\n * (see {@link AnimationBuilder AnimationBuilder} for more information on how to create programmatic\n * animations.)\n *\n * @experimental Animation support is experimental.\n */\nexport interface AnimationPlayer {\n onDone(fn: () => void): void;\n onStart(fn: () => void): void;\n onDestroy(fn: () => void): void;\n init(): void;\n hasStarted(): boolean;\n play(): void;\n pause(): void;\n restart(): void;\n finish(): void;\n destroy(): void;\n reset(): void;\n setPosition(p: any /** TODO #9100 */): void;\n getPosition(): number;\n parentPlayer: AnimationPlayer|null;\n readonly totalTime: number;\n beforeDestroy?: () => any;\n}\n/**\n * \\@experimental Animation support is experimental.\n */\nexport class NoopAnimationPlayer implements AnimationPlayer {\nprivate _onDoneFns: Function[] = [];\nprivate _onStartFns: Function[] = [];\nprivate _onDestroyFns: Function[] = [];\nprivate _started = false;\nprivate _destroyed = false;\nprivate _finished = false;\npublic parentPlayer: AnimationPlayer|null = null;\npublic totalTime = 0;\nconstructor() {}\n/**\n * @return {?}\n */\nprivate _onFinish() {\n if (!this._finished) {\n this._finished = true;\n this._onDoneFns.forEach(fn => fn());\n this._onDoneFns = [];\n }\n }\n/**\n * @param {?} fn\n * @return {?}\n */\nonStart(fn: () => void): void { this._onStartFns.push(fn); }\n/**\n * @param {?} fn\n * @return {?}\n */\nonDone(fn: () => void): void { this._onDoneFns.push(fn); }\n/**\n * @param {?} fn\n * @return {?}\n */\nonDestroy(fn: () => void): void { this._onDestroyFns.push(fn); }\n/**\n * @return {?}\n */\nhasStarted(): boolean { return this._started; }\n/**\n * @return {?}\n */\ninit(): void {}\n/**\n * @return {?}\n */\nplay(): void {\n if (!this.hasStarted()) {\n this.triggerMicrotask();\n this._onStart();\n }\n this._started = true;\n }\n/**\n * @return {?}\n */\ntriggerMicrotask() { scheduleMicroTask(() => this._onFinish()); }\n/**\n * @return {?}\n */\nprivate _onStart() {\n this._onStartFns.forEach(fn => fn());\n this._onStartFns = [];\n }\n/**\n * @return {?}\n */\npause(): void {}\n/**\n * @return {?}\n */\nrestart(): void {}\n/**\n * @return {?}\n */\nfinish(): void { this._onFinish(); }\n/**\n * @return {?}\n */\ndestroy(): void {\n if (!this._destroyed) {\n this._destroyed = true;\n if (!this.hasStarted()) {\n this._onStart();\n }\n this.finish();\n this._onDestroyFns.forEach(fn => fn());\n this._onDestroyFns = [];\n }\n }\n/**\n * @return {?}\n */\nreset(): void {}\n/**\n * @param {?} p\n * @return {?}\n */\nsetPosition(p: number): void {}\n/**\n * @return {?}\n */\ngetPosition(): number { return 0; }\n}\n\nfunction NoopAnimationPlayer_tsickle_Closure_declarations() {\n/** @type {?} */\nNoopAnimationPlayer.prototype._onDoneFns;\n/** @type {?} */\nNoopAnimationPlayer.prototype._onStartFns;\n/** @type {?} */\nNoopAnimationPlayer.prototype._onDestroyFns;\n/** @type {?} */\nNoopAnimationPlayer.prototype._started;\n/** @type {?} */\nNoopAnimationPlayer.prototype._destroyed;\n/** @type {?} */\nNoopAnimationPlayer.prototype._finished;\n/** @type {?} */\nNoopAnimationPlayer.prototype.parentPlayer;\n/** @type {?} */\nNoopAnimationPlayer.prototype.totalTime;\n}\n\n","\n/**\n * @license \n * Copyright Google Inc. All Rights Reserved.\n * \n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n * @param {?} cb\n * @return {?}\n */\nexport function scheduleMicroTask(cb: () => any) {\n Promise.resolve(null).then(cb);\n}\n","/**\n * @license\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\nexport interface ɵStyleData { [key: string]: string|number; }\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are created internally\n * within the Angular animation DSL.\n *\n * @experimental Animation support is experimental.\n */\nexport declare type AnimateTimings = {\n duration: number,\n delay: number,\n easing: string | null\n};\n\n/**\n * `AnimationOptions` represents options that can be passed into most animation DSL methods.\n * When options are provided, the delay value of an animation can be changed and animation input\n * parameters can be passed in to change styling and timing data when an animation is started.\n *\n * The following animation DSL functions are able to accept animation option data:\n *\n * - {@link transition transition()}\n * - {@link sequence sequence()}\n * - {@link group group()}\n * - {@link query query()}\n * - {@link animation animation()}\n * - {@link useAnimation useAnimation()}\n * - {@link animateChild animateChild()}\n *\n * Programmatic animations built using {@link AnimationBuilder the AnimationBuilder service} also\n * make use of AnimationOptions.\n *\n * @experimental Animation support is experimental.\n */\nexport declare interface AnimationOptions {\n delay?: number|string;\n params?: {[name: string]: any};\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are created internally\n * within the Angular animation DSL when {@link animateChild animateChild()} is used.\n *\n * @experimental Animation support is experimental.\n */\nexport declare interface AnimateChildOptions extends AnimationOptions { duration?: number|string; }\n\n/**\n * Metadata representing the entry of animations. Usages of this enum are created\n * each time an animation DSL function is used.\n *\n * @experimental Animation support is experimental.\n */\nexport const enum AnimationMetadataType {\n State = 0,\n Transition = 1,\n Sequence = 2,\n Group = 3,\n Animate = 4,\n Keyframes = 5,\n Style = 6,\n Trigger = 7,\n Reference = 8,\n AnimateChild = 9,\n AnimateRef = 10,\n Query = 11,\n Stagger = 12\n}\n/**\n * \\@experimental Animation support is experimental.\n */\nexport const AUTO_STYLE = '*';\n\n/**\n * @experimental Animation support is experimental.\n */\nexport interface AnimationMetadata { type: AnimationMetadataType; }\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link trigger trigger animation function} is called.\n *\n * @experimental Animation support is experimental.\n */\nexport interface AnimationTriggerMetadata extends AnimationMetadata {\n name: string;\n definitions: AnimationMetadata[];\n options: {params?: {[name: string]: any}}|null;\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link state state animation function} is called.\n *\n * @experimental Animation support is experimental.\n */\nexport interface AnimationStateMetadata extends AnimationMetadata {\n name: string;\n styles: AnimationStyleMetadata;\n options?: {params: {[name: string]: any}};\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link transition transition animation function} is called.\n *\n * @experimental Animation support is experimental.\n */\nexport interface AnimationTransitionMetadata extends AnimationMetadata {\n expr: string;\n animation: AnimationMetadata|AnimationMetadata[];\n options: AnimationOptions|null;\n}\n\n/**\n * @experimental Animation support is experimental.\n */\nexport interface AnimationReferenceMetadata extends AnimationMetadata {\n animation: AnimationMetadata|AnimationMetadata[];\n options: AnimationOptions|null;\n}\n\n/**\n * @experimental Animation support is experimental.\n */\nexport interface AnimationQueryMetadata extends AnimationMetadata {\n selector: string;\n animation: AnimationMetadata|AnimationMetadata[];\n options: AnimationQueryOptions|null;\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link keyframes keyframes animation function} is called.\n *\n * @experimental Animation support is experimental.\n */\nexport interface AnimationKeyframesSequenceMetadata extends AnimationMetadata {\n steps: AnimationStyleMetadata[];\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link style style animation function} is called.\n *\n * @experimental Animation support is experimental.\n */\nexport interface AnimationStyleMetadata extends AnimationMetadata {\n styles: '*'|{[key: string]: string | number}|Array<{[key: string]: string | number}|'*'>;\n offset: number|null;\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link animate animate animation function} is called.\n *\n * @experimental Animation support is experimental.\n */\nexport interface AnimationAnimateMetadata extends AnimationMetadata {\n timings: string|number|AnimateTimings;\n styles: AnimationStyleMetadata|AnimationKeyframesSequenceMetadata|null;\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link animateChild animateChild animation function} is called.\n *\n * @experimental Animation support is experimental.\n */\nexport interface AnimationAnimateChildMetadata extends AnimationMetadata {\n options: AnimationOptions|null;\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link useAnimation useAnimation animation function} is called.\n *\n * @experimental Animation support is experimental.\n */\nexport interface AnimationAnimateRefMetadata extends AnimationMetadata {\n animation: AnimationReferenceMetadata;\n options: AnimationOptions|null;\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link sequence sequence animation function} is called.\n *\n * @experimental Animation support is experimental.\n */\nexport interface AnimationSequenceMetadata extends AnimationMetadata {\n steps: AnimationMetadata[];\n options: AnimationOptions|null;\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link group group animation function} is called.\n *\n * @experimental Animation support is experimental.\n */\nexport interface AnimationGroupMetadata extends AnimationMetadata {\n steps: AnimationMetadata[];\n options: AnimationOptions|null;\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link query query animation function} is called.\n *\n * @experimental Animation support is experimental.\n */\nexport declare interface AnimationQueryOptions extends AnimationOptions {\n optional?: boolean;\n /**\n * Used to limit the total amount of results from the start of the query list.\n *\n * If a negative value is provided then the queried results will be limited from the\n * end of the query list towards the beginning (e.g. if `limit: -3` is used then the\n * final 3 (or less) queried results will be used for the animation).\n */\n limit?: number;\n}\n\n/**\n * Metadata representing the entry of animations. Instances of this interface are provided via the\n * animation DSL when the {@link stagger stagger animation function} is called.\n *\n* @experimental Animation support is experimental.\n*/\nexport interface AnimationStaggerMetadata extends AnimationMetadata {\n timings: string|number;\n animation: AnimationMetadata|AnimationMetadata[];\n}\n/**\n * `trigger` is an animation-specific function that is designed to be used inside of Angular's\n * animation DSL language. If this information is new, please navigate to the\n * {\\@link Component#animations component animations metadata page} to gain a better\n * understanding of how animations in Angular are used.\n * \n * `trigger` Creates an animation trigger which will a list of {\\@link state state} and\n * {\\@link transition transition} entries that will be evaluated when the expression\n * bound to the trigger changes.\n * \n * Triggers are registered within the component annotation data under the\n * {\\@link Component#animations animations section}. An animation trigger can be placed on an element\n * within a template by referencing the name of the trigger followed by the expression value that\n * the\n * trigger is bound to (in the form of `[\\@triggerName]=\"expression\"`.\n * \n * Animation trigger bindings strigify values and then match the previous and current values against\n * any linked transitions. If a boolean value is provided into the trigger binding then it will both\n * be represented as `1` or `true` and `0` or `false` for a true and false boolean values\n * respectively.\n * \n * ### Usage\n * \n * `trigger` will create an animation trigger reference based on the provided `name` value. The\n * provided `animation` value is expected to be an array consisting of {\\@link state state} and\n * {\\@link transition transition} declarations.\n * \n * ```typescript\n * \\@Component({ \n * selector: 'my-component',\n * templateUrl: 'my-component-tpl.html',\n * animations: [\n * trigger(\"myAnimationTrigger\", [\n * state(...),\n * state(...),\n * transition(...),\n * transition(...)\n * ])\n * ]\n * })\n * class MyComponent {\n * myStatusExp = \"something\";\n * }\n * ```\n * \n * The template associated with this component will make use of the `myAnimationTrigger` animation\n * trigger by binding to an element within its template code.\n * \n * ```html\n * \n *