/* Metro module 4826; source: modules/monitoring/MonitoringAgent.tsx; dependencies: [6, 7, 661, 477, 4827, 4828, 27, 4829, 4830, 507, 2] */ import ClassCallCheck from '../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */ import CreateClass from '../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */ import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactNativeModule from '../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */ import * as PlatformUtilsModule from '../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */ import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */ import * as ReleaseChannelUtilsNativeModule from '../../utils/ReleaseChannelUtils.native.tsx'; /* Metro dependency 4827 */ function _fun42085(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#42085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5004:6, offset: 0x0112fce4, size: 248 bytes, params: 8, frame: 20 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const Set = global.Set; let set = new Set(['darwin', 'linux', 'win32', 'ios', 'android']); set = _fun42086(); set = new set(); (FileImportTrackerModule).fileFinishedImporting('modules/monitoring/MonitoringAgent.tsx'); exports.default = set; exports.MetricType = {COUNT: 'count', DISTRIBUTION: 'distribution'}; function _fun42086() { // fn#42086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5004:274, offset: 0x0112fddc, size: 124 bytes, params: 1, frame: 15 return CreateClass(MonitoringAgent, [{key: '_getMetricWithDefaults', value: value_42090}, {key: 'increment', value: value_42092}, {key: 'distribution', value: value_42093}, {key: '_flush', value: value_42094}]); function MonitoringAgent() { // fn#42087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5004:295, offset: 0x0112fe58, size: 212 bytes, params: 1, frame: 17 var environment; const value = environment.__proto__; env1_2(this, MonitoringAgent); this._metrics = []; this._intervalId = global.setInterval(_fun42088, 120000); const {NativeModules, NativeEventEmitter} = ReactNativeModule; const r2 = PlatformUtilsModule.isAndroid() ? (require(4829) /* metro dependency 4829: NativeMetricMonitorModule */).default : NativeModules.MetricMonitor; new NativeEventEmitter().addListener('logMetric', _fun42089); function _fun42088() { // fn#42088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5004:393, offset: 0x0112ff2c, size: 21 bytes, params: 1, frame: 9 env0_0._flush(); } function _fun42089(a0) { // fn#42089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5004:558, offset: 0x0112ff41, size: 28 bytes, params: 2, frame: 13 env0_0.increment(a0, false); } } function value_42090({name, tags}, a1) { // fn#42090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5004:625, offset: 0x0112ff5d, size: 358 bytes, params: 3, frame: 17 var r8; var r5; var platformName; var binding; var ALL; const object = {name: name, type: a1}; object.tags = (require(4830) /* metro dependency 4830: MonitoringAgentUtils */).getGlobalTagsArray(); if (tags != null) { tags.forEach(_fun42091); } if ((require(477) /* metro dependency 477: PlatformUtils */).isWeb()) { r8 = 'web'; } else { platformName = (require(477) /* metro dependency 477: PlatformUtils */).getPlatformName(); binding = env1_5; r8 = binding.has(platformName) ? platformName : null; } if (r8 != null) { object.tags.push('platform:' + r8); } const CurrentReleaseChannel = (ReleaseChannelUtilsNativeModule).CurrentReleaseChannel; if (CurrentReleaseChannel != null) { ALL = (require(4828) /* metro dependency 4828: ReleaseChannels */).ReleaseChannelsSets.ALL; r5 = ALL.has(CurrentReleaseChannel) ? CurrentReleaseChannel : null; } else { r5 = null; } if (r5 != null) { object.tags.push('release_channel:' + r5); } return object; function _fun42091(a0) { // fn#42091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5004:733, offset: 0x011300c3, size: 30 bytes, params: 2, frame: 11 env0_0.tags.push(a0); } } function value_42092(a0) { // fn#42092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5004:1126, offset: 0x011300e1, size: 94 bytes, params: 2, frame: 15 let value = a1; let r1 = value !== undefined ? value : false; const _getMetricWithDefaults = this._getMetricWithDefaults; value = environment.__proto__; const COUNT = env1_6.COUNT; this._metrics.push(Reflect.apply(_getMetricWithDefaults, this, [a0, COUNT])); r1 = !r1 ? this._metrics.length >= 100 : r1; if (r1) { this._flush(); } } function value_42093(a0, a1) { // fn#42093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5004:1284, offset: 0x0113013f, size: 115 bytes, params: 3, frame: 16 let value = a2; let r1 = value !== undefined ? value : false; const object = {}; const _getMetricWithDefaults = this._getMetricWithDefaults; value = environment.__proto__; const DISTRIBUTION = env1_6.DISTRIBUTION; copyDataProperties(object, Reflect.apply(_getMetricWithDefaults, this, [a0, DISTRIBUTION]), _getMetricWithDefaults); object['value'] = a1; this._metrics.push(object); r1 = !r1 ? this._metrics.length >= 100 : r1; if (r1) { this._flush(); } } function value_42094() { // fn#42094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5004:1458, offset: 0x011301b2, size: 183 bytes, params: 1, frame: 17 var environment; var items2; var value; let _metrics = this._metrics; if (_metrics.length > 0) { _metrics = this._metrics; items2 = []; arraySpread(items2, _metrics, 0, items2); value = environment.__proto__; value = (require(507) /* metro dependency 507: HTTPUtils */).HTTP.post({url: Endpoints.METRICS_V2, body: {metrics: items2, client_info: {'built_at': '1782519704961', 'build_number': '5867'}}, retries: 1, rejectWithError: true}); value.catch(_fun42095); } this._metrics = []; function _fun42095() { // fn#42095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5004:1671, offset: 0x01130269, size: 82 bytes, params: 1, frame: 15 var binding; var items2; let _metrics = env0_0._metrics; if (_metrics.length + env0_1.length < 100) { binding = env0_0; _metrics = binding._metrics; items2 = []; arraySpread(items2, env0_1, arraySpread(items2, _metrics, 0, undefined), undefined); binding._metrics = items2; } } } } } global.__d(_fun42085, 4826, [6, 7, 661, 477, 4827, 4828, 27, 4829, 4830, 507, 2]) /* metro module 4826, dependencies: [6, 7, 661, 477, 4827, 4828, 27, 4829, 4830, 507, 2] */;