{"ast":null,"code":"'use strict';\n\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport NativeAnimatedHelper from \"../NativeAnimatedHelper\";\nvar NativeAnimatedAPI = NativeAnimatedHelper.API;\nimport invariant from 'fbjs/lib/invariant';\nvar _uniqueId = 1;\nvar AnimatedNode = function () {\n function AnimatedNode() {\n _classCallCheck(this, AnimatedNode);\n this._listeners = {};\n }\n _createClass(AnimatedNode, [{\n key: \"__attach\",\n value: function __attach() {}\n }, {\n key: \"__detach\",\n value: function __detach() {\n if (this.__isNative && this.__nativeTag != null) {\n NativeAnimatedHelper.API.dropAnimatedNode(this.__nativeTag);\n this.__nativeTag = undefined;\n }\n }\n }, {\n key: \"__getValue\",\n value: function __getValue() {}\n }, {\n key: \"__getAnimatedValue\",\n value: function __getAnimatedValue() {\n return this.__getValue();\n }\n }, {\n key: \"__addChild\",\n value: function __addChild(child) {}\n }, {\n key: \"__removeChild\",\n value: function __removeChild(child) {}\n }, {\n key: \"__getChildren\",\n value: function __getChildren() {\n return [];\n }\n }, {\n key: \"__makeNative\",\n value: function __makeNative() {\n if (!this.__isNative) {\n throw new Error('This node cannot be made a \"native\" animated node');\n }\n if (this.hasListeners()) {\n this._startListeningToNativeValueUpdates();\n }\n }\n }, {\n key: \"addListener\",\n value: function addListener(callback) {\n var id = String(_uniqueId++);\n this._listeners[id] = callback;\n if (this.__isNative) {\n this._startListeningToNativeValueUpdates();\n }\n return id;\n }\n }, {\n key: \"removeListener\",\n value: function removeListener(id) {\n delete this._listeners[id];\n if (this.__isNative && !this.hasListeners()) {\n this._stopListeningForNativeValueUpdates();\n }\n }\n }, {\n key: \"removeAllListeners\",\n value: function removeAllListeners() {\n this._listeners = {};\n if (this.__isNative) {\n this._stopListeningForNativeValueUpdates();\n }\n }\n }, {\n key: \"hasListeners\",\n value: function hasListeners() {\n return !!Object.keys(this._listeners).length;\n }\n }, {\n key: \"_startListeningToNativeValueUpdates\",\n value: function _startListeningToNativeValueUpdates() {\n var _this = this;\n if (this.__nativeAnimatedValueListener && !this.__shouldUpdateListenersForNewNativeTag) {\n return;\n }\n if (this.__shouldUpdateListenersForNewNativeTag) {\n this.__shouldUpdateListenersForNewNativeTag = false;\n this._stopListeningForNativeValueUpdates();\n }\n NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag());\n this.__nativeAnimatedValueListener = NativeAnimatedHelper.nativeEventEmitter.addListener('onAnimatedValueUpdate', function (data) {\n if (data.tag !== _this.__getNativeTag()) {\n return;\n }\n _this._onAnimatedValueUpdateReceived(data.value);\n });\n }\n }, {\n key: \"_onAnimatedValueUpdateReceived\",\n value: function _onAnimatedValueUpdateReceived(value) {\n this.__callListeners(value);\n }\n }, {\n key: \"__callListeners\",\n value: function __callListeners(value) {\n for (var _key in this._listeners) {\n this._listeners[_key]({\n value: value\n });\n }\n }\n }, {\n key: \"_stopListeningForNativeValueUpdates\",\n value: function _stopListeningForNativeValueUpdates() {\n if (!this.__nativeAnimatedValueListener) {\n return;\n }\n this.__nativeAnimatedValueListener.remove();\n this.__nativeAnimatedValueListener = null;\n NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag());\n }\n }, {\n key: \"__getNativeTag\",\n value: function __getNativeTag() {\n var _this$__nativeTag;\n NativeAnimatedHelper.assertNativeAnimatedModule();\n invariant(this.__isNative, 'Attempt to get native tag from node not marked as \"native\"');\n var nativeTag = (_this$__nativeTag = this.__nativeTag) !== null && _this$__nativeTag !== void 0 ? _this$__nativeTag : NativeAnimatedHelper.generateNewNodeTag();\n if (this.__nativeTag == null) {\n this.__nativeTag = nativeTag;\n NativeAnimatedHelper.API.createAnimatedNode(nativeTag, this.__getNativeConfig());\n this.__shouldUpdateListenersForNewNativeTag = true;\n }\n return nativeTag;\n }\n }, {\n key: \"__getNativeConfig\",\n value: function __getNativeConfig() {\n throw new Error('This JS animated node type cannot be used as native animated node');\n }\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n return this.__getValue();\n }\n }]);\n return AnimatedNode;\n}();\nexport default AnimatedNode;","map":{"version":3,"names":["NativeAnimatedHelper","NativeAnimatedAPI","API","invariant","_uniqueId","AnimatedNode","_listeners","__isNative","__nativeTag","dropAnimatedNode","undefined","__getValue","child","Error","hasListeners","_startListeningToNativeValueUpdates","callback","id","String","_stopListeningForNativeValueUpdates","Object","keys","length","__nativeAnimatedValueListener","__shouldUpdateListenersForNewNativeTag","startListeningToAnimatedNodeValue","__getNativeTag","nativeEventEmitter","addListener","data","tag","_onAnimatedValueUpdateReceived","value","__callListeners","_key","remove","stopListeningToAnimatedNodeValue","_this$__nativeTag","assertNativeAnimatedModule","nativeTag","generateNewNodeTag","createAnimatedNode","__getNativeConfig"],"sources":["/Users/thomaschazot/Documents/But2A/LaSuperMeteo/iut-expo-starter/node_modules/react-native-web/dist/vendor/react-native/Animated/nodes/AnimatedNode.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 NativeAnimatedHelper from '../NativeAnimatedHelper';\nvar NativeAnimatedAPI = NativeAnimatedHelper.API;\nimport invariant from 'fbjs/lib/invariant';\nvar _uniqueId = 1; // Note(vjeux): this would be better as an interface but flow doesn't\n// support them yet\n\nclass AnimatedNode {\n __attach() {}\n\n __detach() {\n if (this.__isNative && this.__nativeTag != null) {\n NativeAnimatedHelper.API.dropAnimatedNode(this.__nativeTag);\n this.__nativeTag = undefined;\n }\n }\n\n __getValue() {}\n\n __getAnimatedValue() {\n return this.__getValue();\n }\n\n __addChild(child) {}\n\n __removeChild(child) {}\n\n __getChildren() {\n return [];\n }\n /* Methods and props used by native Animated impl */\n\n\n constructor() {\n this._listeners = {};\n }\n\n __makeNative() {\n if (!this.__isNative) {\n throw new Error('This node cannot be made a \"native\" animated node');\n }\n\n if (this.hasListeners()) {\n this._startListeningToNativeValueUpdates();\n }\n }\n /**\n * Adds an asynchronous listener to the value so you can observe updates from\n * animations. This is useful because there is no way to\n * synchronously read the value because it might be driven natively.\n *\n * See https://reactnative.dev/docs/animatedvalue.html#addlistener\n */\n\n\n addListener(callback) {\n var id = String(_uniqueId++);\n this._listeners[id] = callback;\n\n if (this.__isNative) {\n this._startListeningToNativeValueUpdates();\n }\n\n return id;\n }\n /**\n * Unregister a listener. The `id` param shall match the identifier\n * previously returned by `addListener()`.\n *\n * See https://reactnative.dev/docs/animatedvalue.html#removelistener\n */\n\n\n removeListener(id) {\n delete this._listeners[id];\n\n if (this.__isNative && !this.hasListeners()) {\n this._stopListeningForNativeValueUpdates();\n }\n }\n /**\n * Remove all registered listeners.\n *\n * See https://reactnative.dev/docs/animatedvalue.html#removealllisteners\n */\n\n\n removeAllListeners() {\n this._listeners = {};\n\n if (this.__isNative) {\n this._stopListeningForNativeValueUpdates();\n }\n }\n\n hasListeners() {\n return !!Object.keys(this._listeners).length;\n }\n\n _startListeningToNativeValueUpdates() {\n if (this.__nativeAnimatedValueListener && !this.__shouldUpdateListenersForNewNativeTag) {\n return;\n }\n\n if (this.__shouldUpdateListenersForNewNativeTag) {\n this.__shouldUpdateListenersForNewNativeTag = false;\n\n this._stopListeningForNativeValueUpdates();\n }\n\n NativeAnimatedAPI.startListeningToAnimatedNodeValue(this.__getNativeTag());\n this.__nativeAnimatedValueListener = NativeAnimatedHelper.nativeEventEmitter.addListener('onAnimatedValueUpdate', data => {\n if (data.tag !== this.__getNativeTag()) {\n return;\n }\n\n this._onAnimatedValueUpdateReceived(data.value);\n });\n }\n\n _onAnimatedValueUpdateReceived(value) {\n this.__callListeners(value);\n }\n\n __callListeners(value) {\n for (var _key in this._listeners) {\n this._listeners[_key]({\n value\n });\n }\n }\n\n _stopListeningForNativeValueUpdates() {\n if (!this.__nativeAnimatedValueListener) {\n return;\n }\n\n this.__nativeAnimatedValueListener.remove();\n\n this.__nativeAnimatedValueListener = null;\n NativeAnimatedAPI.stopListeningToAnimatedNodeValue(this.__getNativeTag());\n }\n\n __getNativeTag() {\n var _this$__nativeTag;\n\n NativeAnimatedHelper.assertNativeAnimatedModule();\n invariant(this.__isNative, 'Attempt to get native tag from node not marked as \"native\"');\n var nativeTag = (_this$__nativeTag = this.__nativeTag) !== null && _this$__nativeTag !== void 0 ? _this$__nativeTag : NativeAnimatedHelper.generateNewNodeTag();\n\n if (this.__nativeTag == null) {\n this.__nativeTag = nativeTag;\n NativeAnimatedHelper.API.createAnimatedNode(nativeTag, this.__getNativeConfig());\n this.__shouldUpdateListenersForNewNativeTag = true;\n }\n\n return nativeTag;\n }\n\n __getNativeConfig() {\n throw new Error('This JS animated node type cannot be used as native animated node');\n }\n\n toJSON() {\n return this.__getValue();\n }\n\n}\n\nexport default AnimatedNode;"],"mappings":"AASA,YAAY;;AAAC;AAAA;AAEb,OAAOA,oBAAoB;AAC3B,IAAIC,iBAAiB,GAAGD,oBAAoB,CAACE,GAAG;AAChD,OAAOC,SAAS,MAAM,oBAAoB;AAC1C,IAAIC,SAAS,GAAG,CAAC;AAAC,IAGZC,YAAY;EA0BhB,wBAAc;IAAA;IACZ,IAAI,CAACC,UAAU,GAAG,CAAC,CAAC;EACtB;EAAC;IAAA;IAAA,OA3BD,oBAAW,CAAC;EAAC;IAAA;IAAA,OAEb,oBAAW;MACT,IAAI,IAAI,CAACC,UAAU,IAAI,IAAI,CAACC,WAAW,IAAI,IAAI,EAAE;QAC/CR,oBAAoB,CAACE,GAAG,CAACO,gBAAgB,CAAC,IAAI,CAACD,WAAW,CAAC;QAC3D,IAAI,CAACA,WAAW,GAAGE,SAAS;MAC9B;IACF;EAAC;IAAA;IAAA,OAED,sBAAa,CAAC;EAAC;IAAA;IAAA,OAEf,8BAAqB;MACnB,OAAO,IAAI,CAACC,UAAU,EAAE;IAC1B;EAAC;IAAA;IAAA,OAED,oBAAWC,KAAK,EAAE,CAAC;EAAC;IAAA;IAAA,OAEpB,uBAAcA,KAAK,EAAE,CAAC;EAA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