{"version":3,"sources":["webpack:///./node_modules/@ionic/core/dist/esm/legacy/index-d9adb105.js"],"names":[],"mappings":";;;;;;;;;;AAAA;AAAA;AAAA;AACA;AACA,gBAAgB;AAChB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oBAAoB,sBAAsB;AAC1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+BAA+B,eAAe;AAC9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qDAAqD,qCAAqC;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,4DAA4D,iCAAiC,EAAE;AAC/F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,6BAA6B;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yDAAyD,6BAA6B;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA,qCAAqC,sDAAsD;AAC3F;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA,wBAAwB;AACxB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,wBAAwB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,wBAAwB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uDAAuD,wBAAwB;AAC/E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,wBAAwB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,wBAAwB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,wBAAwB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,eAAe;AAClD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,oBAAoB;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mCAAmC,qBAAqB;AACxD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,qBAAqB;AAC5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,wBAAwB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,wBAAwB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,wBAAwB;AACvE;AACA;AACA;AACA;AACA,2DAA2D,0BAA0B;AACrF;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,6BAA6B;AAC9F;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,gBAAgB;AACzF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,wBAAwB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6DAA6D,6BAA6B;AAC1F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,wBAAwB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+DAA+D,8BAA8B;AAC7F;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+CAA+C,wBAAwB;AACvE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,2EAA2E,gCAAgC;AAC3G;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iFAAiF,mCAAmC;AACpH;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oEAAoE,gBAAgB;AACpF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yEAAyE,+BAA+B;AACxG;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,+EAA+E,kCAAkC;AACjH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sEAAsE,gBAAgB;AACtF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAiD,uBAAuB;AACxE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mDAAmD,wBAAwB;AAC3E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6BAA6B,UAAU;AACvC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0DAA0D,gBAAgB;AAC1E;AACA;AACA;AACA;AACA;AACA;AACA,iEAAiE,gBAAgB;AACjF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uCAAuC,sBAAsB;AAC7D;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,oDAAoD,yBAAyB;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA;AACA;AACkB","file":"2.js","sourcesContent":["var transitionEnd = function (el, callback) {\n var unRegTrans;\n var opts = { passive: true };\n var unregister = function () {\n if (unRegTrans) {\n unRegTrans();\n }\n };\n var onTransitionEnd = function (ev) {\n if (el === ev.target) {\n unregister();\n callback(ev);\n }\n };\n if (el) {\n el.addEventListener('webkitTransitionEnd', onTransitionEnd, opts);\n el.addEventListener('transitionend', onTransitionEnd, opts);\n unRegTrans = function () {\n el.removeEventListener('webkitTransitionEnd', onTransitionEnd, opts);\n el.removeEventListener('transitionend', onTransitionEnd, opts);\n };\n }\n return unregister;\n};\nvar CSS_VALUE_REGEX = /(^-?\\d*\\.?\\d*)(.*)/;\nvar DURATION_MIN = 32;\nvar TRANSITION_END_FALLBACK_PADDING_MS = 400;\nvar TRANSFORM_PROPS = {\n 'translateX': 1,\n 'translateY': 1,\n 'translateZ': 1,\n 'scale': 1,\n 'scaleX': 1,\n 'scaleY': 1,\n 'scaleZ': 1,\n 'rotate': 1,\n 'rotateX': 1,\n 'rotateY': 1,\n 'rotateZ': 1,\n 'skewX': 1,\n 'skewY': 1,\n 'perspective': 1\n};\nvar win = typeof window !== 'undefined' ? window : {};\nvar raf = win.requestAnimationFrame\n ? win.requestAnimationFrame.bind(win)\n : function (f) { return f(Date.now()); };\nvar Animator = /** @class */ (function () {\n function Animator() {\n this._hasDur = false;\n this._hasTweenEffect = false;\n this._isAsync = false;\n this._isReverse = false;\n this._destroyed = false;\n this.hasChildren = false;\n this.isPlaying = false;\n this.hasCompleted = false;\n }\n Animator.prototype.addElement = function (el) {\n if (el != null) {\n if (el.length > 0) {\n for (var i = 0; i < el.length; i++) {\n this._addEl(el[i]);\n }\n }\n else {\n this._addEl(el);\n }\n }\n return this;\n };\n /**\n * NO DOM\n */\n Animator.prototype._addEl = function (el) {\n if (el.nodeType === 1) {\n (this._elements = this._elements || []).push(el);\n }\n };\n /**\n * Add a child animation to this animation.\n */\n Animator.prototype.add = function (childAnimation) {\n childAnimation.parent = this;\n this.hasChildren = true;\n (this._childAnimations = this._childAnimations || []).push(childAnimation);\n return this;\n };\n /**\n * Get the duration of this animation. If this animation does\n * not have a duration, then it'll get the duration from its parent.\n */\n Animator.prototype.getDuration = function (opts) {\n if (opts && opts.duration !== undefined) {\n return opts.duration;\n }\n else if (this._duration !== undefined) {\n return this._duration;\n }\n else if (this.parent) {\n return this.parent.getDuration();\n }\n return 0;\n };\n /**\n * Returns if the animation is a root one.\n */\n Animator.prototype.isRoot = function () {\n return !this.parent;\n };\n /**\n * Set the duration for this animation.\n */\n Animator.prototype.duration = function (milliseconds) {\n this._duration = milliseconds;\n return this;\n };\n /**\n * Get the easing of this animation. If this animation does\n * not have an easing, then it'll get the easing from its parent.\n */\n Animator.prototype.getEasing = function () {\n if (this._isReverse && this._reversedEasingName !== undefined) {\n return this._reversedEasingName;\n }\n return this._easingName !== undefined ? this._easingName : (this.parent && this.parent.getEasing()) || null;\n };\n /**\n * Set the easing for this animation.\n */\n Animator.prototype.easing = function (name) {\n this._easingName = name;\n return this;\n };\n /**\n * Set the easing for this reversed animation.\n */\n Animator.prototype.easingReverse = function (name) {\n this._reversedEasingName = name;\n return this;\n };\n /**\n * Add the \"from\" value for a specific property.\n */\n Animator.prototype.from = function (prop, val) {\n this._addProp('from', prop, val);\n return this;\n };\n /**\n * Add the \"to\" value for a specific property.\n */\n Animator.prototype.to = function (prop, val, clearProperyAfterTransition) {\n if (clearProperyAfterTransition === void 0) { clearProperyAfterTransition = false; }\n var fx = this._addProp('to', prop, val);\n if (clearProperyAfterTransition) {\n // if this effect is a transform then clear the transform effect\n // otherwise just clear the actual property\n this.afterClearStyles(fx.trans ? ['transform', '-webkit-transform'] : [prop]);\n }\n return this;\n };\n /**\n * Shortcut to add both the \"from\" and \"to\" for the same property.\n */\n Animator.prototype.fromTo = function (prop, fromVal, toVal, clearProperyAfterTransition) {\n return this.from(prop, fromVal).to(prop, toVal, clearProperyAfterTransition);\n };\n /**\n * NO DOM\n */\n Animator.prototype._getProp = function (name) {\n if (this._fxProperties) {\n return this._fxProperties.find(function (prop) { return prop.effectName === name; });\n }\n return undefined;\n };\n Animator.prototype._addProp = function (state, prop, val) {\n var fxProp = this._getProp(prop);\n if (!fxProp) {\n // first time we've see this EffectProperty\n var shouldTrans = (TRANSFORM_PROPS[prop] === 1);\n fxProp = {\n effectName: prop,\n trans: shouldTrans,\n // add the will-change property for transforms or opacity\n wc: (shouldTrans ? 'transform' : prop)\n };\n (this._fxProperties = this._fxProperties || []).push(fxProp);\n }\n // add from/to EffectState to the EffectProperty\n var fxState = {\n val: val,\n num: 0,\n effectUnit: '',\n };\n fxProp[state] = fxState;\n if (typeof val === 'string' && val.indexOf(' ') < 0) {\n var r = val.match(CSS_VALUE_REGEX);\n if (r) {\n var num = parseFloat(r[1]);\n if (!isNaN(num)) {\n fxState.num = num;\n }\n fxState.effectUnit = (r[0] !== r[2] ? r[2] : '');\n }\n }\n else if (typeof val === 'number') {\n fxState.num = val;\n }\n return fxProp;\n };\n /**\n * Add CSS class to this animation's elements\n * before the animation begins.\n */\n Animator.prototype.beforeAddClass = function (className) {\n (this._beforeAddClasses = this._beforeAddClasses || []).push(className);\n return this;\n };\n /**\n * Remove CSS class from this animation's elements\n * before the animation begins.\n */\n Animator.prototype.beforeRemoveClass = function (className) {\n (this._beforeRemoveClasses = this._beforeRemoveClasses || []).push(className);\n return this;\n };\n /**\n * Set CSS inline styles to this animation's elements\n * before the animation begins.\n */\n Animator.prototype.beforeStyles = function (styles) {\n this._beforeStyles = styles;\n return this;\n };\n /**\n * Clear CSS inline styles from this animation's elements\n * before the animation begins.\n */\n Animator.prototype.beforeClearStyles = function (propertyNames) {\n this._beforeStyles = this._beforeStyles || {};\n for (var _i = 0, propertyNames_1 = propertyNames; _i < propertyNames_1.length; _i++) {\n var prop = propertyNames_1[_i];\n this._beforeStyles[prop] = '';\n }\n return this;\n };\n /**\n * Add a function which contains DOM reads, which will run\n * before the animation begins.\n */\n Animator.prototype.beforeAddRead = function (domReadFn) {\n (this._readCallbacks = this._readCallbacks || []).push(domReadFn);\n return this;\n };\n /**\n * Add a function which contains DOM writes, which will run\n * before the animation begins.\n */\n Animator.prototype.beforeAddWrite = function (domWriteFn) {\n (this._writeCallbacks = this._writeCallbacks || []).push(domWriteFn);\n return this;\n };\n /**\n * Add CSS class to this animation's elements\n * after the animation finishes.\n */\n Animator.prototype.afterAddClass = function (className) {\n (this._afterAddClasses = this._afterAddClasses || []).push(className);\n return this;\n };\n /**\n * Remove CSS class from this animation's elements\n * after the animation finishes.\n */\n Animator.prototype.afterRemoveClass = function (className) {\n (this._afterRemoveClasses = this._afterRemoveClasses || []).push(className);\n return this;\n };\n /**\n * Set CSS inline styles to this animation's elements\n * after the animation finishes.\n */\n Animator.prototype.afterStyles = function (styles) {\n this._afterStyles = styles;\n return this;\n };\n /**\n * Clear CSS inline styles from this animation's elements\n * after the animation finishes.\n */\n Animator.prototype.afterClearStyles = function (propertyNames) {\n this._afterStyles = this._afterStyles || {};\n for (var _i = 0, propertyNames_2 = propertyNames; _i < propertyNames_2.length; _i++) {\n var prop = propertyNames_2[_i];\n this._afterStyles[prop] = '';\n }\n return this;\n };\n /**\n * Play the animation.\n */\n Animator.prototype.play = function (opts) {\n var _this = this;\n // If the animation was already invalidated (it did finish), do nothing\n if (this._destroyed) {\n return;\n }\n // this is the top level animation and is in full control\n // of when the async play() should actually kick off\n // if there is no duration then it'll set the TO property immediately\n // if there is a duration, then it'll stage all animations at the\n // FROM property and transition duration, wait a few frames, then\n // kick off the animation by setting the TO property for each animation\n this._isAsync = this._hasDuration(opts);\n // ensure all past transition end events have been cleared\n this._clearAsync();\n // recursively kicks off the correct progress step for each child animation\n // ******** DOM WRITE ****************\n this._playInit(opts);\n // doubling up RAFs since this animation was probably triggered\n // from an input event, and just having one RAF would have this code\n // run within the same frame as the triggering input event, and the\n // input event probably already did way too much work for one frame\n raf(function () {\n raf(function () {\n _this._playDomInspect(opts);\n });\n });\n };\n Animator.prototype.playAsync = function (opts) {\n var _this = this;\n return new Promise(function (resolve) {\n _this.onFinish(resolve, { oneTimeCallback: true, clearExistingCallbacks: true });\n _this.play(opts);\n return _this;\n });\n };\n Animator.prototype.playSync = function () {\n // If the animation was already invalidated (it did finish), do nothing\n if (!this._destroyed) {\n var opts = { duration: 0 };\n this._isAsync = false;\n this._clearAsync();\n this._playInit(opts);\n this._playDomInspect(opts);\n }\n };\n /**\n * DOM WRITE\n * RECURSION\n */\n Animator.prototype._playInit = function (opts) {\n // always default that an animation does not tween\n // a tween requires that an Animation class has an element\n // and that it has at least one FROM/TO effect\n // and that the FROM/TO effect can tween numeric values\n this._hasTweenEffect = false;\n this.isPlaying = true;\n this.hasCompleted = false;\n this._hasDur = (this.getDuration(opts) > DURATION_MIN);\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {\n var child = children_1[_i];\n // ******** DOM WRITE ****************\n child._playInit(opts);\n }\n }\n if (this._hasDur) {\n // if there is a duration then we want to start at step 0\n // ******** DOM WRITE ****************\n this._progress(0);\n // add the will-change properties\n // ******** DOM WRITE ****************\n this._willChange(true);\n }\n };\n /**\n * DOM WRITE\n * NO RECURSION\n * ROOT ANIMATION\n */\n Animator.prototype._playDomInspect = function (opts) {\n var _this = this;\n // fire off all the \"before\" function that have DOM READS in them\n // elements will be in the DOM, however visibily hidden\n // so we can read their dimensions if need be\n // ******** DOM READ ****************\n // ******** DOM WRITE ****************\n this._beforeAnimation();\n // for the root animation only\n // set the async TRANSITION END event\n // and run onFinishes when the transition ends\n var dur = this.getDuration(opts);\n if (this._isAsync) {\n this._asyncEnd(dur, true);\n }\n // ******** DOM WRITE ****************\n this._playProgress(opts);\n if (this._isAsync && !this._destroyed) {\n // this animation has a duration so we need another RAF\n // for the CSS TRANSITION properties to kick in\n raf(function () {\n _this._playToStep(1);\n });\n }\n };\n /**\n * DOM WRITE\n * RECURSION\n */\n Animator.prototype._playProgress = function (opts) {\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_2 = children; _i < children_2.length; _i++) {\n var child = children_2[_i];\n // ******** DOM WRITE ****************\n child._playProgress(opts);\n }\n }\n if (this._hasDur) {\n // set the CSS TRANSITION duration/easing\n // ******** DOM WRITE ****************\n this._setTrans(this.getDuration(opts), false);\n }\n else {\n // this animation does not have a duration, so it should not animate\n // just go straight to the TO properties and call it done\n // ******** DOM WRITE ****************\n this._progress(1);\n // since there was no animation, immediately run the after\n // ******** DOM WRITE ****************\n this._setAfterStyles();\n // this animation has no duration, so it has finished\n // other animations could still be running\n this._didFinish(true);\n }\n };\n /**\n * DOM WRITE\n * RECURSION\n */\n Animator.prototype._playToStep = function (stepValue) {\n if (!this._destroyed) {\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_3 = children; _i < children_3.length; _i++) {\n var child = children_3[_i];\n // ******** DOM WRITE ****************\n child._playToStep(stepValue);\n }\n }\n if (this._hasDur) {\n // browser had some time to render everything in place\n // and the transition duration/easing is set\n // now set the TO properties which will trigger the transition to begin\n // ******** DOM WRITE ****************\n this._progress(stepValue);\n }\n }\n };\n /**\n * DOM WRITE\n * NO RECURSION\n * ROOT ANIMATION\n */\n Animator.prototype._asyncEnd = function (dur, shouldComplete) {\n var self = this;\n var onTransitionEnd = function () {\n // congrats! a successful transition completed!\n // ensure transition end events and timeouts have been cleared\n self._clearAsync();\n // ******** DOM WRITE ****************\n self._playEnd();\n // transition finished\n self._didFinishAll(shouldComplete, true, false);\n };\n var onTransitionFallback = function () {\n // oh noz! the transition end event didn't fire in time!\n // instead the fallback timer when first\n // if all goes well this fallback should never fire\n // clear the other async end events from firing\n self._timerId = undefined;\n self._clearAsync();\n // set the after styles\n // ******** DOM WRITE ****************\n self._playEnd(shouldComplete ? 1 : 0);\n // transition finished\n self._didFinishAll(shouldComplete, true, false);\n };\n // set the TRANSITION END event on one of the transition elements\n self._unregisterTrnsEnd = transitionEnd(self._transEl(), onTransitionEnd);\n // set a fallback timeout if the transition end event never fires, or is too slow\n // transition end fallback: (animation duration + XXms)\n self._timerId = setTimeout(onTransitionFallback, (dur + TRANSITION_END_FALLBACK_PADDING_MS));\n };\n /**\n * DOM WRITE\n * RECURSION\n */\n Animator.prototype._playEnd = function (stepValue) {\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_4 = children; _i < children_4.length; _i++) {\n var child = children_4[_i];\n // ******** DOM WRITE ****************\n child._playEnd(stepValue);\n }\n }\n if (this._hasDur) {\n if (stepValue !== undefined) {\n // too late to have a smooth animation, just finish it\n // ******** DOM WRITE ****************\n this._setTrans(0, true);\n // ensure the ending progress step gets rendered\n // ******** DOM WRITE ****************\n this._progress(stepValue);\n }\n // set the after styles\n // ******** DOM WRITE ****************\n this._setAfterStyles();\n // remove the will-change properties\n // ******** DOM WRITE ****************\n this._willChange(false);\n }\n };\n /**\n * NO DOM\n * RECURSION\n */\n Animator.prototype._hasDuration = function (opts) {\n if (this.getDuration(opts) > DURATION_MIN) {\n return true;\n }\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_5 = children; _i < children_5.length; _i++) {\n var child = children_5[_i];\n if (child._hasDuration(opts)) {\n return true;\n }\n }\n }\n return false;\n };\n /**\n * NO DOM\n * RECURSION\n */\n Animator.prototype._hasDomReads = function () {\n if (this._readCallbacks && this._readCallbacks.length > 0) {\n return true;\n }\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_6 = children; _i < children_6.length; _i++) {\n var child = children_6[_i];\n if (child._hasDomReads()) {\n return true;\n }\n }\n }\n return false;\n };\n /**\n * Immediately stop at the end of the animation.\n */\n Animator.prototype.stop = function (stepValue) {\n if (stepValue === void 0) { stepValue = 1; }\n // ensure all past transition end events have been cleared\n this._clearAsync();\n this._hasDur = true;\n this._playEnd(stepValue);\n };\n /**\n * NO DOM\n * NO RECURSION\n */\n Animator.prototype._clearAsync = function () {\n if (this._unregisterTrnsEnd) {\n this._unregisterTrnsEnd();\n }\n if (this._timerId) {\n clearTimeout(this._timerId);\n }\n this._timerId = this._unregisterTrnsEnd = undefined;\n };\n /**\n * DOM WRITE\n * NO RECURSION\n */\n Animator.prototype._progress = function (stepValue) {\n // bread 'n butter\n var val;\n var elements = this._elements;\n var effects = this._fxProperties;\n if (!elements || elements.length === 0 || !effects || this._destroyed) {\n return;\n }\n // flip the number if we're going in reverse\n if (this._isReverse) {\n stepValue = 1 - stepValue;\n }\n var i = 0;\n var j = 0;\n var finalTransform = '';\n var fx;\n for (i = 0; i < effects.length; i++) {\n fx = effects[i];\n if (fx.from && fx.to) {\n var fromNum = fx.from.num;\n var toNum = fx.to.num;\n var tweenEffect = (fromNum !== toNum);\n if (tweenEffect) {\n this._hasTweenEffect = true;\n }\n if (stepValue === 0) {\n // FROM\n val = fx.from.val;\n }\n else if (stepValue === 1) {\n // TO\n val = fx.to.val;\n }\n else if (tweenEffect) {\n // EVERYTHING IN BETWEEN\n var valNum = (((toNum - fromNum) * stepValue) + fromNum);\n var unit = fx.to.effectUnit;\n val = valNum + unit;\n }\n if (val !== null) {\n var prop = fx.effectName;\n if (fx.trans) {\n finalTransform += prop + '(' + val + ') ';\n }\n else {\n for (j = 0; j < elements.length; j++) {\n // ******** DOM WRITE ****************\n elements[j].style.setProperty(prop, val);\n }\n }\n }\n }\n }\n // place all transforms on the same property\n if (finalTransform.length > 0) {\n if (!this._isReverse && stepValue !== 1 || this._isReverse && stepValue !== 0) {\n finalTransform += 'translateZ(0px)';\n }\n for (i = 0; i < elements.length; i++) {\n // ******** DOM WRITE ****************\n elements[i].style.setProperty('transform', finalTransform);\n elements[i].style.setProperty('-webkit-transform', finalTransform);\n }\n }\n };\n /**\n * DOM WRITE\n * NO RECURSION\n */\n Animator.prototype._setTrans = function (dur, forcedLinearEasing) {\n // Transition is not enabled if there are not effects\n var elements = this._elements;\n if (!elements || elements.length === 0 || !this._fxProperties) {\n return;\n }\n // set the TRANSITION properties inline on the element\n var easing = (forcedLinearEasing ? 'linear' : this.getEasing());\n var durString = dur + 'ms';\n for (var _i = 0, elements_1 = elements; _i < elements_1.length; _i++) {\n var style = elements_1[_i].style;\n if (dur > 0) {\n // ******** DOM WRITE ****************\n style.transitionDuration = durString;\n // each animation can have a different easing\n if (easing !== null) {\n // ******** DOM WRITE ****************\n style.transitionTimingFunction = easing;\n }\n }\n else {\n style.transitionDuration = '0';\n }\n }\n };\n /**\n * DOM READ\n * DOM WRITE\n * RECURSION\n */\n Animator.prototype._beforeAnimation = function () {\n // fire off all the \"before\" function that have DOM READS in them\n // elements will be in the DOM, however visibily hidden\n // so we can read their dimensions if need be\n // ******** DOM READ ****************\n this._fireBeforeReadFunc();\n // ******** DOM READS ABOVE / DOM WRITES BELOW ****************\n // fire off all the \"before\" function that have DOM WRITES in them\n // ******** DOM WRITE ****************\n this._fireBeforeWriteFunc();\n // stage all of the before css classes and inline styles\n // ******** DOM WRITE ****************\n this._setBeforeStyles();\n };\n /**\n * DOM WRITE\n * RECURSION\n */\n Animator.prototype._setBeforeStyles = function () {\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_7 = children; _i < children_7.length; _i++) {\n var child = children_7[_i];\n child._setBeforeStyles();\n }\n }\n var elements = this._elements;\n // before the animations have started\n // only set before styles if animation is not reversed\n if (!elements || elements.length === 0 || this._isReverse) {\n return;\n }\n var addClasses = this._beforeAddClasses;\n var removeClasses = this._beforeRemoveClasses;\n for (var _a = 0, elements_2 = elements; _a < elements_2.length; _a++) {\n var el = elements_2[_a];\n var elementClassList = el.classList;\n // css classes to add before the animation\n if (addClasses) {\n for (var _b = 0, addClasses_1 = addClasses; _b < addClasses_1.length; _b++) {\n var c = addClasses_1[_b];\n // ******** DOM WRITE ****************\n elementClassList.add(c);\n }\n }\n // css classes to remove before the animation\n if (removeClasses) {\n for (var _c = 0, removeClasses_1 = removeClasses; _c < removeClasses_1.length; _c++) {\n var c = removeClasses_1[_c];\n // ******** DOM WRITE ****************\n elementClassList.remove(c);\n }\n }\n // inline styles to add before the animation\n if (this._beforeStyles) {\n for (var _d = 0, _e = Object.entries(this._beforeStyles); _d < _e.length; _d++) {\n var _f = _e[_d], key = _f[0], value = _f[1];\n // ******** DOM WRITE ****************\n el.style.setProperty(key, value);\n }\n }\n }\n };\n /**\n * DOM READ\n * RECURSION\n */\n Animator.prototype._fireBeforeReadFunc = function () {\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_8 = children; _i < children_8.length; _i++) {\n var child = children_8[_i];\n // ******** DOM READ ****************\n child._fireBeforeReadFunc();\n }\n }\n var readFunctions = this._readCallbacks;\n if (readFunctions) {\n for (var _a = 0, readFunctions_1 = readFunctions; _a < readFunctions_1.length; _a++) {\n var callback = readFunctions_1[_a];\n // ******** DOM READ ****************\n callback();\n }\n }\n };\n /**\n * DOM WRITE\n * RECURSION\n */\n Animator.prototype._fireBeforeWriteFunc = function () {\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_9 = children; _i < children_9.length; _i++) {\n var child = children_9[_i];\n // ******** DOM WRITE ****************\n child._fireBeforeWriteFunc();\n }\n }\n var writeFunctions = this._writeCallbacks;\n if (writeFunctions) {\n for (var _a = 0, writeFunctions_1 = writeFunctions; _a < writeFunctions_1.length; _a++) {\n var callback = writeFunctions_1[_a];\n // ******** DOM WRITE ****************\n callback();\n }\n }\n };\n /**\n * DOM WRITE\n */\n Animator.prototype._setAfterStyles = function () {\n var elements = this._elements;\n if (!elements) {\n return;\n }\n for (var _i = 0, elements_3 = elements; _i < elements_3.length; _i++) {\n var el = elements_3[_i];\n var elementClassList = el.classList;\n // remove the transition duration/easing\n // ******** DOM WRITE ****************\n el.style.transitionDuration = el.style.transitionTimingFunction = '';\n if (this._isReverse) {\n // finished in reverse direction\n // css classes that were added before the animation should be removed\n var beforeAddClasses = this._beforeAddClasses;\n if (beforeAddClasses) {\n for (var _a = 0, beforeAddClasses_1 = beforeAddClasses; _a < beforeAddClasses_1.length; _a++) {\n var c = beforeAddClasses_1[_a];\n elementClassList.remove(c);\n }\n }\n // css classes that were removed before the animation should be added\n var beforeRemoveClasses = this._beforeRemoveClasses;\n if (beforeRemoveClasses) {\n for (var _b = 0, beforeRemoveClasses_1 = beforeRemoveClasses; _b < beforeRemoveClasses_1.length; _b++) {\n var c = beforeRemoveClasses_1[_b];\n elementClassList.add(c);\n }\n }\n // inline styles that were added before the animation should be removed\n var beforeStyles = this._beforeStyles;\n if (beforeStyles) {\n for (var _c = 0, _d = Object.keys(beforeStyles); _c < _d.length; _c++) {\n var propName = _d[_c];\n // ******** DOM WRITE ****************\n el.style.removeProperty(propName);\n }\n }\n }\n else {\n // finished in forward direction\n // css classes to add after the animation\n var afterAddClasses = this._afterAddClasses;\n if (afterAddClasses) {\n for (var _e = 0, afterAddClasses_1 = afterAddClasses; _e < afterAddClasses_1.length; _e++) {\n var c = afterAddClasses_1[_e];\n // ******** DOM WRITE ****************\n elementClassList.add(c);\n }\n }\n // css classes to remove after the animation\n var afterRemoveClasses = this._afterRemoveClasses;\n if (afterRemoveClasses) {\n for (var _f = 0, afterRemoveClasses_1 = afterRemoveClasses; _f < afterRemoveClasses_1.length; _f++) {\n var c = afterRemoveClasses_1[_f];\n // ******** DOM WRITE ****************\n elementClassList.remove(c);\n }\n }\n // inline styles to add after the animation\n var afterStyles = this._afterStyles;\n if (afterStyles) {\n for (var _g = 0, _h = Object.entries(afterStyles); _g < _h.length; _g++) {\n var _j = _h[_g], key = _j[0], value = _j[1];\n el.style.setProperty(key, value);\n }\n }\n }\n }\n };\n /**\n * DOM WRITE\n * NO RECURSION\n */\n Animator.prototype._willChange = function (addWillChange) {\n var wc;\n var effects = this._fxProperties;\n var willChange;\n if (addWillChange && effects) {\n wc = [];\n for (var _i = 0, effects_1 = effects; _i < effects_1.length; _i++) {\n var effect = effects_1[_i];\n var propWC = effect.wc;\n if (propWC === 'webkitTransform') {\n wc.push('transform', '-webkit-transform');\n }\n else if (propWC !== undefined) {\n wc.push(propWC);\n }\n }\n willChange = wc.join(',');\n }\n else {\n willChange = '';\n }\n var elements = this._elements;\n if (elements) {\n for (var _a = 0, elements_4 = elements; _a < elements_4.length; _a++) {\n var el = elements_4[_a];\n // ******** DOM WRITE ****************\n el.style.setProperty('will-change', willChange);\n }\n }\n };\n /**\n * Start the animation with a user controlled progress.\n */\n Animator.prototype.progressStart = function () {\n // ensure all past transition end events have been cleared\n this._clearAsync();\n // ******** DOM READ/WRITE ****************\n this._beforeAnimation();\n // ******** DOM WRITE ****************\n this._progressStart();\n };\n /**\n * DOM WRITE\n * RECURSION\n */\n Animator.prototype._progressStart = function () {\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_10 = children; _i < children_10.length; _i++) {\n var child = children_10[_i];\n // ******** DOM WRITE ****************\n child._progressStart();\n }\n }\n // force no duration, linear easing\n // ******** DOM WRITE ****************\n this._setTrans(0, true);\n // ******** DOM WRITE ****************\n this._willChange(true);\n };\n /**\n * Set the progress step for this animation.\n * progressStep() is not debounced, so it should not be called faster than 60FPS.\n */\n Animator.prototype.progressStep = function (stepValue) {\n // only update if the last update was more than 16ms ago\n stepValue = Math.min(1, Math.max(0, stepValue));\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_11 = children; _i < children_11.length; _i++) {\n var child = children_11[_i];\n // ******** DOM WRITE ****************\n child.progressStep(stepValue);\n }\n }\n // ******** DOM WRITE ****************\n this._progress(stepValue);\n };\n /**\n * End the progress animation.\n */\n Animator.prototype.progressEnd = function (shouldComplete, currentStepValue, dur) {\n var _this = this;\n if (dur === void 0) { dur = -1; }\n if (this._isReverse) {\n // if the animation is going in reverse then\n // flip the step value: 0 becomes 1, 1 becomes 0\n currentStepValue = 1 - currentStepValue;\n }\n var stepValue = shouldComplete ? 1 : 0;\n var diff = Math.abs(currentStepValue - stepValue);\n if (dur < 0) {\n dur = this._duration || 0;\n }\n else if (diff < 0.05) {\n dur = 0;\n }\n this._isAsync = (dur > 30);\n this._progressEnd(shouldComplete, stepValue, dur, this._isAsync);\n if (this._isAsync) {\n // for the root animation only\n // set the async TRANSITION END event\n // and run onFinishes when the transition ends\n // ******** DOM WRITE ****************\n this._asyncEnd(dur, shouldComplete);\n // this animation has a duration so we need another RAF\n // for the CSS TRANSITION properties to kick in\n if (!this._destroyed) {\n raf(function () {\n _this._playToStep(stepValue);\n });\n }\n }\n };\n /**\n * DOM WRITE\n * RECURSION\n */\n Animator.prototype._progressEnd = function (shouldComplete, stepValue, dur, isAsync) {\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_12 = children; _i < children_12.length; _i++) {\n var child = children_12[_i];\n // ******** DOM WRITE ****************\n child._progressEnd(shouldComplete, stepValue, dur, isAsync);\n }\n }\n if (!isAsync) {\n // stop immediately\n // set all the animations to their final position\n // ******** DOM WRITE ****************\n this._progress(stepValue);\n this._willChange(false);\n this._setAfterStyles();\n this._didFinish(shouldComplete);\n }\n else {\n // animate it back to it's ending position\n this.isPlaying = true;\n this.hasCompleted = false;\n this._hasDur = true;\n // ******** DOM WRITE ****************\n this._willChange(true);\n this._setTrans(dur, false);\n }\n };\n /**\n * Add a callback to fire when the animation has finished.\n */\n Animator.prototype.onFinish = function (callback, opts) {\n if (opts && opts.clearExistingCallbacks) {\n this._onFinishCallbacks = this._onFinishOneTimeCallbacks = undefined;\n }\n if (opts && opts.oneTimeCallback) {\n this._onFinishOneTimeCallbacks = this._onFinishOneTimeCallbacks || [];\n this._onFinishOneTimeCallbacks.push(callback);\n }\n else {\n this._onFinishCallbacks = this._onFinishCallbacks || [];\n this._onFinishCallbacks.push(callback);\n }\n return this;\n };\n /**\n * NO DOM\n * RECURSION\n */\n Animator.prototype._didFinishAll = function (hasCompleted, finishAsyncAnimations, finishNoDurationAnimations) {\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_13 = children; _i < children_13.length; _i++) {\n var child = children_13[_i];\n child._didFinishAll(hasCompleted, finishAsyncAnimations, finishNoDurationAnimations);\n }\n }\n if (finishAsyncAnimations && this._isAsync || finishNoDurationAnimations && !this._isAsync) {\n this._didFinish(hasCompleted);\n }\n };\n /**\n * NO RECURSION\n */\n Animator.prototype._didFinish = function (hasCompleted) {\n this.isPlaying = false;\n this.hasCompleted = hasCompleted;\n if (this._onFinishCallbacks) {\n // run all finish callbacks\n for (var _i = 0, _a = this._onFinishCallbacks; _i < _a.length; _i++) {\n var callback = _a[_i];\n callback(this);\n }\n }\n if (this._onFinishOneTimeCallbacks) {\n // run all \"onetime\" finish callbacks\n for (var _b = 0, _c = this._onFinishOneTimeCallbacks; _b < _c.length; _b++) {\n var callback = _c[_b];\n callback(this);\n }\n this._onFinishOneTimeCallbacks.length = 0;\n }\n };\n /**\n * Reverse the animation.\n */\n Animator.prototype.reverse = function (shouldReverse) {\n if (shouldReverse === void 0) { shouldReverse = true; }\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_14 = children; _i < children_14.length; _i++) {\n var child = children_14[_i];\n child.reverse(shouldReverse);\n }\n }\n this._isReverse = !!shouldReverse;\n return this;\n };\n /**\n * Recursively destroy this animation and all child animations.\n */\n Animator.prototype.destroy = function () {\n this._didFinish(false);\n this._destroyed = true;\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_15 = children; _i < children_15.length; _i++) {\n var child = children_15[_i];\n child.destroy();\n }\n }\n this._clearAsync();\n if (this._elements) {\n this._elements.length = 0;\n }\n if (this._readCallbacks) {\n this._readCallbacks.length = 0;\n }\n if (this._writeCallbacks) {\n this._writeCallbacks.length = 0;\n }\n this.parent = undefined;\n if (this._childAnimations) {\n this._childAnimations.length = 0;\n }\n if (this._onFinishCallbacks) {\n this._onFinishCallbacks.length = 0;\n }\n if (this._onFinishOneTimeCallbacks) {\n this._onFinishOneTimeCallbacks.length = 0;\n }\n };\n /**\n * NO DOM\n */\n Animator.prototype._transEl = function () {\n // get the lowest level element that has an Animator\n var children = this._childAnimations;\n if (children) {\n for (var _i = 0, children_16 = children; _i < children_16.length; _i++) {\n var child = children_16[_i];\n var targetEl = child._transEl();\n if (targetEl) {\n return targetEl;\n }\n }\n }\n return (this._hasTweenEffect &&\n this._hasDur &&\n this._elements !== undefined &&\n this._elements.length > 0 ?\n this._elements[0] : null);\n };\n return Animator;\n}());\nvar create = function (animationBuilder, baseEl, opts) {\n if (animationBuilder) {\n return animationBuilder(Animator, baseEl, opts);\n }\n return Promise.resolve(new Animator());\n};\nexport { create };\n"],"sourceRoot":""}