You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1 line
14 KiB

{"ast":null,"code":"'use strict';\n\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport _get from \"@babel/runtime/helpers/get\";\nimport _inherits from \"@babel/runtime/helpers/inherits\";\nimport _possibleConstructorReturn from \"@babel/runtime/helpers/possibleConstructorReturn\";\nimport _getPrototypeOf from \"@babel/runtime/helpers/getPrototypeOf\";\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nimport AnimatedValue from \"../nodes/AnimatedValue\";\nimport AnimatedValueXY from \"../nodes/AnimatedValueXY\";\nimport AnimatedInterpolation from \"../nodes/AnimatedInterpolation\";\nimport Animation from \"./Animation\";\nimport { shouldUseNativeDriver } from \"../NativeAnimatedHelper\";\nimport Easing from \"../../../../exports/Easing\";\nvar _easeInOut;\nfunction easeInOut() {\n if (!_easeInOut) {\n _easeInOut = Easing.inOut(Easing.ease);\n }\n return _easeInOut;\n}\nvar TimingAnimation = function (_Animation) {\n _inherits(TimingAnimation, _Animation);\n var _super = _createSuper(TimingAnimation);\n function TimingAnimation(config) {\n var _this;\n _classCallCheck(this, TimingAnimation);\n var _config$easing, _config$duration, _config$delay, _config$iterations, _config$isInteraction;\n _this = _super.call(this);\n _this._toValue = config.toValue;\n _this._easing = (_config$easing = config.easing) !== null && _config$easing !== void 0 ? _config$easing : easeInOut();\n _this._duration = (_config$duration = config.duration) !== null && _config$duration !== void 0 ? _config$duration : 500;\n _this._delay = (_config$delay = config.delay) !== null && _config$delay !== void 0 ? _config$delay : 0;\n _this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;\n _this._useNativeDriver = shouldUseNativeDriver(config);\n _this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !_this._useNativeDriver;\n return _this;\n }\n _createClass(TimingAnimation, [{\n key: \"__getNativeAnimationConfig\",\n value: function __getNativeAnimationConfig() {\n var frameDuration = 1000.0 / 60.0;\n var frames = [];\n var numFrames = Math.round(this._duration / frameDuration);\n for (var frame = 0; frame < numFrames; frame++) {\n frames.push(this._easing(frame / numFrames));\n }\n frames.push(this._easing(1));\n return {\n type: 'frames',\n frames: frames,\n toValue: this._toValue,\n iterations: this.__iterations\n };\n }\n }, {\n key: \"start\",\n value: function start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {\n var _this2 = this;\n this.__active = true;\n this._fromValue = fromValue;\n this._onUpdate = onUpdate;\n this.__onEnd = onEnd;\n var start = function start() {\n if (_this2._duration === 0 && !_this2._useNativeDriver) {\n _this2._onUpdate(_this2._toValue);\n _this2.__debouncedOnEnd({\n finished: true\n });\n } else {\n _this2._startTime = Date.now();\n if (_this2._useNativeDriver) {\n _this2.__startNativeAnimation(animatedValue);\n } else {\n _this2._animationFrame = requestAnimationFrame(_this2.onUpdate.bind(_this2));\n }\n }\n };\n if (this._delay) {\n this._timeout = setTimeout(start, this._delay);\n } else {\n start();\n }\n }\n }, {\n key: \"onUpdate\",\n value: function onUpdate() {\n var now = Date.now();\n if (now >= this._startTime + this._duration) {\n if (this._duration === 0) {\n this._onUpdate(this._toValue);\n } else {\n this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue));\n }\n this.__debouncedOnEnd({\n finished: true\n });\n return;\n }\n this._onUpdate(this._fromValue + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue));\n if (this.__active) {\n this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n }\n }\n }, {\n key: \"stop\",\n value: function stop() {\n _get(_getPrototypeOf(TimingAnimation.prototype), \"stop\", this).call(this);\n this.__active = false;\n clearTimeout(this._timeout);\n global.cancelAnimationFrame(this._animationFrame);\n this.__debouncedOnEnd({\n finished: false\n });\n }\n }]);\n return TimingAnimation;\n}(Animation);\nexport default TimingAnimation;","map":{"version":3,"names":["AnimatedValue","AnimatedValueXY","AnimatedInterpolation","Animation","shouldUseNativeDriver","Easing","_easeInOut","easeInOut","inOut","ease","TimingAnimation","config","_config$easing","_config$duration","_config$delay","_config$iterations","_config$isInteraction","_toValue","toValue","_easing","easing","_duration","duration","_delay","delay","__iterations","iterations","_useNativeDriver","__isInteraction","isInteraction","frameDuration","frames","numFrames","Math","round","frame","push","type","fromValue","onUpdate","onEnd","previousAnimation","animatedValue","__active","_fromValue","_onUpdate","__onEnd","start","__debouncedOnEnd","finished","_startTime","Date","now","__startNativeAnimation","_animationFrame","requestAnimationFrame","bind","_timeout","setTimeout","clearTimeout","global","cancelAnimationFrame"],"sources":["/Users/thomaschazot/Documents/But2A/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/vendor/react-native/Animated/animations/TimingAnimation.js"],"sourcesContent":["/**\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n * @format\n */\n'use strict';\n\nimport AnimatedValue from '../nodes/AnimatedValue';\nimport AnimatedValueXY from '../nodes/AnimatedValueXY';\nimport AnimatedInterpolation from '../nodes/AnimatedInterpolation';\nimport Animation from './Animation';\nimport { shouldUseNativeDriver } from '../NativeAnimatedHelper';\nimport Easing from '../../../../exports/Easing';\n\nvar _easeInOut;\n\nfunction easeInOut() {\n if (!_easeInOut) {\n _easeInOut = Easing.inOut(Easing.ease);\n }\n\n return _easeInOut;\n}\n\nclass TimingAnimation extends Animation {\n constructor(config) {\n var _config$easing, _config$duration, _config$delay, _config$iterations, _config$isInteraction;\n\n super();\n this._toValue = config.toValue;\n this._easing = (_config$easing = config.easing) !== null && _config$easing !== void 0 ? _config$easing : easeInOut();\n this._duration = (_config$duration = config.duration) !== null && _config$duration !== void 0 ? _config$duration : 500;\n this._delay = (_config$delay = config.delay) !== null && _config$delay !== void 0 ? _config$delay : 0;\n this.__iterations = (_config$iterations = config.iterations) !== null && _config$iterations !== void 0 ? _config$iterations : 1;\n this._useNativeDriver = shouldUseNativeDriver(config);\n this.__isInteraction = (_config$isInteraction = config.isInteraction) !== null && _config$isInteraction !== void 0 ? _config$isInteraction : !this._useNativeDriver;\n }\n\n __getNativeAnimationConfig() {\n var frameDuration = 1000.0 / 60.0;\n var frames = [];\n var numFrames = Math.round(this._duration / frameDuration);\n\n for (var frame = 0; frame < numFrames; frame++) {\n frames.push(this._easing(frame / numFrames));\n }\n\n frames.push(this._easing(1));\n return {\n type: 'frames',\n frames,\n toValue: this._toValue,\n iterations: this.__iterations\n };\n }\n\n start(fromValue, onUpdate, onEnd, previousAnimation, animatedValue) {\n this.__active = true;\n this._fromValue = fromValue;\n this._onUpdate = onUpdate;\n this.__onEnd = onEnd;\n\n var start = () => {\n // Animations that sometimes have 0 duration and sometimes do not\n // still need to use the native driver when duration is 0 so as to\n // not cause intermixed JS and native animations.\n if (this._duration === 0 && !this._useNativeDriver) {\n this._onUpdate(this._toValue);\n\n this.__debouncedOnEnd({\n finished: true\n });\n } else {\n this._startTime = Date.now();\n\n if (this._useNativeDriver) {\n this.__startNativeAnimation(animatedValue);\n } else {\n this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n }\n }\n };\n\n if (this._delay) {\n this._timeout = setTimeout(start, this._delay);\n } else {\n start();\n }\n }\n\n onUpdate() {\n var now = Date.now();\n\n if (now >= this._startTime + this._duration) {\n if (this._duration === 0) {\n this._onUpdate(this._toValue);\n } else {\n this._onUpdate(this._fromValue + this._easing(1) * (this._toValue - this._fromValue));\n }\n\n this.__debouncedOnEnd({\n finished: true\n });\n\n return;\n }\n\n this._onUpdate(this._fromValue + this._easing((now - this._startTime) / this._duration) * (this._toValue - this._fromValue));\n\n if (this.__active) {\n this._animationFrame = requestAnimationFrame(this.onUpdate.bind(this));\n }\n }\n\n stop() {\n super.stop();\n this.__active = false;\n clearTimeout(this._timeout);\n global.cancelAnimationFrame(this._animationFrame);\n\n this.__debouncedOnEnd({\n finished: false\n });\n }\n\n}\n\nexport default TimingAnimation;"],"mappings":"AASA,YAAY;;AAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAEb,OAAOA,aAAa;AACpB,OAAOC,eAAe;AACtB,OAAOC,qBAAqB;AAC5B,OAAOC,SAAS;AAChB,SAASC,qBAAqB;AAC9B,OAAOC,MAAM;AAEb,IAAIC,UAAU;AAEd,SAASC,SAAS,GAAG;EACnB,IAAI,CAACD,UAAU,EAAE;IACfA,UAAU,GAAGD,MAAM,CAACG,KAAK,CAACH,MAAM,CAACI,IAAI,CAAC;EACxC;EAEA,OAAOH,UAAU;AACnB;AAAC,IAEKI,eAAe;EAAA;EAAA;EACnB,yBAAYC,MAAM,EAAE;IAAA;IAAA;IAClB,IAAIC,cAAc,EAAEC,gBAAgB,EAAEC,aAAa,EAAEC,kBAAkB,EAAEC,qBAAqB;IAE9F;IACA,MAAKC,QAAQ,GAAGN,MAAM,CAACO,OAAO;IAC9B,MAAKC,OAAO,GAAG,CAACP,cAAc,GAAGD,MAAM,CAACS,MAAM,MAAM,IAAI,IAAIR,cAAc,KAAK,KAAK,CAAC,GAAGA,cAAc,GAAGL,SAAS,EAAE;IACpH,MAAKc,SAAS,GAAG,CAACR,gBAAgB,GAAGF,MAAM,CAACW,QAAQ,MAAM,IAAI,IAAIT,gBAAgB,KAAK,KAAK,CAAC,GAAGA,gBAAgB,GAAG,GAAG;IACtH,MAAKU,MAAM,GAAG,CAACT,aAAa,GAAGH,MA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