{"ast":null,"code":"'use strict';\n\nimport _classCallCheck from \"@babel/runtime/helpers/classCallCheck\";\nimport _createClass from \"@babel/runtime/helpers/createClass\";\nimport Platform from \"../../../exports/Platform\";\nimport RCTDeviceEventEmitter from \"./RCTDeviceEventEmitter\";\nimport invariant from 'fbjs/lib/invariant';\nvar NativeEventEmitter = function () {\n  function NativeEventEmitter(nativeModule) {\n    _classCallCheck(this, NativeEventEmitter);\n    if (Platform.OS === 'ios') {\n      invariant(nativeModule != null, '`new NativeEventEmitter()` requires a non-null argument.');\n      this._nativeModule = nativeModule;\n    }\n  }\n  return _createClass(NativeEventEmitter, [{\n    key: \"addListener\",\n    value: function addListener(eventType, listener, context) {\n      var _this = this;\n      var _this$_nativeModule;\n      (_this$_nativeModule = this._nativeModule) == null ? void 0 : _this$_nativeModule.addListener(eventType);\n      var subscription = RCTDeviceEventEmitter.addListener(eventType, listener, context);\n      return {\n        remove: function remove() {\n          if (subscription != null) {\n            var _this$_nativeModule2;\n            (_this$_nativeModule2 = _this._nativeModule) == null ? void 0 : _this$_nativeModule2.removeListeners(1);\n            subscription.remove();\n            subscription = null;\n          }\n        }\n      };\n    }\n  }, {\n    key: \"removeListener\",\n    value: function removeListener(eventType, listener) {\n      var _this$_nativeModule3;\n      (_this$_nativeModule3 = this._nativeModule) == null ? void 0 : _this$_nativeModule3.removeListeners(1);\n      RCTDeviceEventEmitter.removeListener(eventType, listener);\n    }\n  }, {\n    key: \"emit\",\n    value: function emit(eventType) {\n      for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n        args[_key - 1] = arguments[_key];\n      }\n      RCTDeviceEventEmitter.emit.apply(RCTDeviceEventEmitter, [eventType].concat(args));\n    }\n  }, {\n    key: \"removeAllListeners\",\n    value: function removeAllListeners(eventType) {\n      var _this$_nativeModule4;\n      invariant(eventType != null, '`NativeEventEmitter.removeAllListener()` requires a non-null argument.');\n      (_this$_nativeModule4 = this._nativeModule) == null ? void 0 : _this$_nativeModule4.removeListeners(this.listenerCount(eventType));\n      RCTDeviceEventEmitter.removeAllListeners(eventType);\n    }\n  }, {\n    key: \"listenerCount\",\n    value: function listenerCount(eventType) {\n      return RCTDeviceEventEmitter.listenerCount(eventType);\n    }\n  }]);\n}();\nexport { NativeEventEmitter as default };","map":{"version":3,"names":["_classCallCheck","_createClass","Platform","RCTDeviceEventEmitter","invariant","NativeEventEmitter","nativeModule","OS","_nativeModule","key","value","addListener","eventType","listener","context","_this","_this$_nativeModule","subscription","remove","_this$_nativeModule2","removeListeners","removeListener","_this$_nativeModule3","emit","_len","arguments","length","args","Array","_key","apply","concat","removeAllListeners","_this$_nativeModule4","listenerCount","default"],"sources":["/Users/pmouli/Documents/GitHub.nosync/boots-strapper/mobile/node_modules/react-native-web/dist/vendor/react-native/EventEmitter/NativeEventEmitter.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\n'use strict';\n\nimport Platform from '../../../exports/Platform';\nimport RCTDeviceEventEmitter from './RCTDeviceEventEmitter';\nimport invariant from 'fbjs/lib/invariant';\n/**\n * `NativeEventEmitter` is intended for use by Native Modules to emit events to\n * JavaScript listeners. If a `NativeModule` is supplied to the constructor, it\n * will be notified (via `addListener` and `removeListeners`) when the listener\n * count changes to manage \"native memory\".\n *\n * Currently, all native events are fired via a global `RCTDeviceEventEmitter`.\n * This means event names must be globally unique, and it means that call sites\n * can theoretically listen to `RCTDeviceEventEmitter` (although discouraged).\n */\nexport default class NativeEventEmitter {\n  constructor(nativeModule) {\n    if (Platform.OS === 'ios') {\n      invariant(nativeModule != null, '`new NativeEventEmitter()` requires a non-null argument.');\n      this._nativeModule = nativeModule;\n    }\n  }\n  addListener(eventType, listener, context) {\n    var _this$_nativeModule;\n    (_this$_nativeModule = this._nativeModule) == null ? void 0 : _this$_nativeModule.addListener(eventType);\n    var subscription = RCTDeviceEventEmitter.addListener(eventType, listener, context);\n    return {\n      remove: () => {\n        if (subscription != null) {\n          var _this$_nativeModule2;\n          (_this$_nativeModule2 = this._nativeModule) == null ? void 0 : _this$_nativeModule2.removeListeners(1);\n          // $FlowFixMe[incompatible-use]\n          subscription.remove();\n          subscription = null;\n        }\n      }\n    };\n  }\n\n  /**\n   * @deprecated Use `remove` on the EventSubscription from `addListener`.\n   */\n  removeListener(eventType, listener) {\n    var _this$_nativeModule3;\n    (_this$_nativeModule3 = this._nativeModule) == null ? void 0 : _this$_nativeModule3.removeListeners(1);\n    // NOTE: This will report a deprecation notice via `console.error`.\n    // $FlowFixMe[prop-missing] - `removeListener` exists but is deprecated.\n    RCTDeviceEventEmitter.removeListener(eventType, listener);\n  }\n  emit(eventType) {\n    for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n      args[_key - 1] = arguments[_key];\n    }\n    // Generally, `RCTDeviceEventEmitter` is directly invoked. But this is\n    // included for completeness.\n    RCTDeviceEventEmitter.emit(eventType, ...args);\n  }\n  removeAllListeners(eventType) {\n    var _this$_nativeModule4;\n    invariant(eventType != null, '`NativeEventEmitter.removeAllListener()` requires a non-null argument.');\n    (_this$_nativeModule4 = this._nativeModule) == null ? void 0 : _this$_nativeModule4.removeListeners(this.listenerCount(eventType));\n    RCTDeviceEventEmitter.removeAllListeners(eventType);\n  }\n  listenerCount(eventType) {\n    return RCTDeviceEventEmitter.listenerCount(eventType);\n  }\n}"],"mappings":"AAUA,YAAY;;AAAC,OAAAA,eAAA;AAAA,OAAAC,YAAA;AAEb,OAAOC,QAAQ;AACf,OAAOC,qBAAqB;AAC5B,OAAOC,SAAS,MAAM,oBAAoB;AAAC,IAWtBC,kBAAkB;EACrC,SAAAA,mBAAYC,YAAY,EAAE;IAAAN,eAAA,OAAAK,kBAAA;IACxB,IAAIH,QAAQ,CAACK,EAAE,KAAK,KAAK,EAAE;MACzBH,SAAS,CAACE,YAAY,IAAI,IAA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