/* Metro module 4301; source: lib/RTCConnection.tsx; dependencies: [5, 6, 7, 15, 17, 18, 4302, 4394, 9276, 9229, 1226, 1379, 1867, 4259, 4294, 10865, 4402, 1878, 661, 1880, 12386, 4291, 4303, 6949, 683, 1216, 3, 12387, 561, 491, 12389, 12391, 10682, 10866, 1458, 477, 3767, 1471, 694, 12392, 1391, 4405, 24, 4608, 12393, 12394, 12395, 10678, 4488, 5252, 12396, 12398, 12399, 12400, 4406, 12401, 12402, 12404, 7137, 12405, 4883, 12406, 12407, 8093, 12409, 4647, 1244, 1225, 4479, 2] */ function _fun36645(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36645, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:6, offset: 0x010904c1, size: 869 bytes, params: 8, frame: 31 var object2; const env0_0 = require; const _arrayLikeToArray_36648 = function(a0, a1) { var r0; var r1; var r2; var value3; var length; var value5; var value = undefined; var value2 = value == null; reducibleJoin2: while (true) { if (value2) { r0 = value2; break reducibleJoin2; } value3 = value > a0.length; r0 = value3; break reducibleJoin2; } reducibleJoin4: while (true) { if (r0) { length = a0.length; r1 = length; break reducibleJoin4; } r1 = value; break reducibleJoin4; } value = (0, global.Array)(r1); var value4 = 0; if (value4 < r1) { r2 = value4; reducibleLoop5: while (true) { value[r2] = a0[r2]; value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1; if (value5 < r1) { r2 = value5; continue reducibleLoop5; } break reducibleLoop5; } } return value; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_4 = importDefault(5) /* metro dependency 5 */; const env0_5 = importDefault(6) /* metro dependency 6 */; const env0_6 = importDefault(7) /* metro dependency 7 */; const env0_7 = importDefault(15) /* metro dependency 15 */; const env0_8 = importDefault(17) /* metro dependency 17 */; const env0_9 = importDefault(18) /* metro dependency 18 */; const deviceFrecencyStore = importDefault(4302) /* metro dependency 4302: DeviceFrecencyStore */; const mediaEngineStatsStore = importDefault(4394) /* metro dependency 4394: MediaEngineStatsStore */; const secureFramesPersistedStore = importDefault(9276) /* metro dependency 9276: SecureFramesPersistedStore */; const audioRouteStoreNative = importDefault(9229) /* metro dependency 9229: AudioRouteStoreNative */; const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */; const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */; const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */; const mediaEngineStore = importDefault(4259) /* metro dependency 4259: MediaEngineStore */; const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */; const rtcDebugStore = importDefault(10865) /* metro dependency 10865: RTCDebugStore */; const rtcRegionStore = importDefault(4402) /* metro dependency 4402: RTCRegionStore */; const userStore = importDefault(1878) /* metro dependency 1878: UserStore */; let value = require(661) /* metro dependency 661: Constants */; const env0_22 = value.AnalyticEvents; const env0_23 = value.ChannelTypes; const env0_24 = value.RTCConnectionStates; const env0_25 = value.RTCConnectionQuality; const env0_26 = value.BoostedGuildTiers; const env0_27 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumTypes; const env0_28 = (require(12386) /* metro dependency 12386: BrowserConstants */).BROWSER_SUPPORTS_UNIFIED_PLAN; value = require(4291) /* metro dependency 4291: Constants */; const env0_29 = value.Features; const env0_30 = value.MediaEngineContextTypes; const env0_31 = value.ConnectionStates; const env0_32 = value.Codecs; const env0_33 = value.MediaTypes; const env0_34 = value.SpeakingFlags; const env0_35 = value.DISABLED_DEVICE_ID; const env0_36 = RegExp('^https', '').test('https:') ? 'wss:' : 'ws:'; object2 = {CONNECTION_CREATE: 0}; object2[0] = 'CONNECTION_CREATE'; object2.CONNECTION_DESTROY = 1; object2[1] = 'CONNECTION_DESTROY'; object2.CONNECT = 2; object2[2] = 'CONNECT'; object2.MLS_FAILURE = 3; object2[3] = 'MLS_FAILURE'; object2.MESSAGE_RECEIVE = 4; object2[4] = 'MESSAGE_RECEIVE'; object2.MESSAGE_SEND = 5; object2[5] = 'MESSAGE_SEND'; object2.SET_ENDPOINT = 6; object2[6] = 'SET_ENDPOINT'; object2.RECONNECT = 7; object2[7] = 'RECONNECT'; object2.SET_STATE = 8; object2[8] = 'SET_STATE'; object2.SET_NEXT_CHANNEL_ID = 9; object2[9] = 'SET_NEXT_CHANNEL_ID'; object2.MLS_INIT = 10; object2[10] = 'MLS_INIT'; object2.SECURE_FRAMES_INIT = 11; object2[11] = 'SECURE_FRAMES_INIT'; const env0_39 = []; value = importDefault(4479) /* metro dependency 4479: TypedEventEmitter */; value = _fun36653(value); (require(2) /* metro dependency 2 */).fileFinishedImporting('lib/RTCConnection.tsx'); exports.default = value; } function _createForOfIteratorHelperLoose_36646(a0, a1) { // fn#36646, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:615, offset: 0x01090826, size: 370 bytes, params: 3, frame: 20 var r6; var r9; var r5; var value3; var regexp; const env0_0 = a0; const Symbol = global.Symbol; let value = typeof Symbol !== 'undefined'; let r1 = value && a0[global.Symbol.iterator]; r1 = !r1 ? a0['@@iterator'] : r1; if (r1) { value = r1.call(a0); return value.next.bind(value); } const Array = global.Array; if (Array.isArray(a0)) { if (r1) { } return _fun36647; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_36648(a0, value); r5 = value; } else { value3 = ({}).toString.call(a0).slice(8, -1); r6 = value3 === 'Object' && a0.constructor; r9 = r6 ? a0.constructor.name : value3; if (r9 === 'Map') { r6 = global.Array.from(a0); } else if (r9 === 'Set') { r6 = global.Array.from(a0); } else if (r9 === 'Arguments') { value = _arrayLikeToArray_36648(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_36648(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun36647; } const TypeError = global.TypeError; throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.'); } function _isNativeReflectConstruct_36649() { // fn#36649, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:1525, offset: 0x01090998, size: 94 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_36649_isNativeReflectConstruct = function() { return !!result; })(); } function getEventHistoryString() { // fn#36652, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:2282, offset: 0x010909f6, size: 133 bytes, params: 1, frame: 18 var r8; var r3; var property; var push; var object2; var t; var value3; const items2 = []; const value2 = (require(4303) /* metro dependency 4303: TimeUtils */).now(); const binding = env0_39; let length = binding.length; let value = 0; if (value < length) { r3 = value; while (true) { property = binding[r3]; push = items2.push; object2 = {}; value = copyDataProperties(object2, property, r8); t = property.t; object2['t'] = value2 - t; Reflect.apply(push, items2, [object2]); value3 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1; length = binding.length; if (!(value3 < length)) { break; } r3 = value3; r8 = value; } } const JSON = global.JSON; return JSON.stringify(items2); } function _fun36653(a0) { // fn#36653, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:2435, offset: 0x01090a7b, size: 2615 bytes, params: 2, frame: 16 const closure = RTCConnection; env0_9(closure, a0); return env0_6(closure, [{key: 'recordEvent', value: value_36672}, {key: 'quality', get: get_36673}, {key: 'endpoint', get: function() { return this._endpoint; }, set: set_36675}, {key: 'connect', value: value_36676}, {key: '_recordMessageEvent', value: function(a0, a1) { this.recordEvent({c: a0, o: a1}); }}, {key: 'destroy', value: value_36678}, {key: 'shouldSendSpeaking', value: value_36679}, {key: 'sendSpeaking', value: value_36680}, {key: 'sendVideo', value: function(a0, a1, a2, a3) { var _socket = this._socket; if (_socket != null) { if (a1 !== 0) { this._sentVideo = true; } if (this._sentVideo) { _socket.video(a0, a1, a2, a3); } } }}, {key: 'getPings', value: function() { return this._pings; }}, {key: 'getAveragePing', value: function() { var r0; var _pings = this._pings; var Math = global.Math; var value = Math.min(this._pings.length, 20); var value2 = 0; value = _pings.slice(value2, value); if (value2 === value.length) { r0 = value2; } else if (this._socket == null) { r0 = value2; } else { value = value.reduce(_fun36684, value2) / value.length; r0 = value; } return r0; }}, {key: 'getLastPing', value: function() { var property = this._pings; property = property[this._pings.length - 1]; return property?.value; }}, {key: 'getOutboundLossRate', value: function() { return this._outboundLossRate; }}, {key: 'getMediaSessionId', value: function() { return this._mediaSessionId; }}, {key: 'getVoiceParticipantType', value: function() { }}, {key: 'getRTCConnectionId', value: function() { return this._rtcConnectionId; }}, {key: 'getMediaEngineConnectionId', value: function() { return this._mediaEngineConnectionId; }}, {key: 'getVoiceVersion', value: function() { return this.voiceVersion; }}, {key: 'getRtcWorkerVersion', value: function() { return this.rtcWorkerVersion; }}, {key: 'getDuration', value: function() { var r1; var value = 0; r1 = this._connectCompletedTime > value ? require(dependencyMap[22]).now() - this._connectCompletedTime : value; return r1 > value ? r1 : value; }}, {key: 'getDurationSeconds', value: function() { return this.getDuration() / 1000; }}, {key: 'getVoiceDurationStats', value: function() { var r1; var _voiceDuration = this._voiceDuration; var value = null; r1 = value == _voiceDuration ? undefined : _voiceDuration.getDurationStats(); return value != r1 ? r1 : value; }}, {key: 'getPacketStats', value: function() { return this._voiceQuality?.getPacketStats(); }}, {key: 'getCreatedTime', value: function() { return this._createdTime; }}, {key: 'getSecureFramesState', value: function() { return this._secureFramesState; }}, {key: 'getSecureFramesRosterMap', value: function() { return this._secureFramesRosterMap; }}, {key: 'getUserIds', value: function() { return this._userIds; }}, {key: 'getIsUserConnected', value: function(a0) { return this._userIds.has(a0); }}, {key: 'getVideoHealthManager', value: function() { return this._videoHealthManager; }}, {key: 'getBandwidthEstimationExperiment', value: function() { return this._bandwidthEstimationExperiment; }}, {key: 'hasActiveRemoteWants', value: function() { var Object = global.Object; return Object.entries(this._remoteVideoSinkWants).some(_fun36705); }}, {key: 'pauseStatsCollectionForUser', value: function(a0, a1) { var value = this.getOrCreateVideoQuality(); if (value != null) { if (a1) { value.addUserToStatsCollectionPausedSet(a0); } else { value.removeUserFromStatsCollectionPausedSet(a0); } } else { this.logger.error('pauseStatsCollectionForUser: Unable to create videoQuality.'); } }}, {key: 'getOutboundStats', value: function() { var r0; var value = this.getOrCreateVideoQuality(); var value2 = null; if (value2 != value) { value = value.getOutboundStats(); r0 = value; } else { r0 = value2; } return r0; }}, {key: 'getInboundStats', value: function(a0) { var r0; var value = this.getOrCreateVideoQuality(); var value2 = null; if (value2 != value) { value = value.getInboundStats(a0); r0 = value; } else { r0 = value2; } return r0; }}, {key: 'setState', value: value_36710}, {key: 'expeditedHeartbeat', value: function(a0) { var r7; var r6; var value = a1; var value2 = a2; r7 = value !== undefined ? value : ''; r6 = !(value2 !== undefined) || value2; var property = this._socket; if (property != null && property.expeditedHeartbeat(a0, r7, r6)) { this._backoff.cancel(); } }}, {key: 'resetBackoff', value: function() { var r5; var value = a0; r5 = value !== undefined ? value : ''; var property = this._socket; if (property != null && property.resetBackoff(r5)) { this._backoff.cancel(); } }}, {key: 'setSelectedParticipant', value: function(a0) { var _localMediaSinkWantsManager = this._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager.setSelectedParticipant(a0); } }}, {key: 'setPipOpen', value: function(a0) { var _localMediaSinkWantsManager = this._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager.setPipOpen(a0); } }}, {key: 'setClipRecordUser', value: function(a0, a1, a2) { var _connection = this._connection; if (!(_connection == null || _connection.setClipRecordUser == null)) { _connection.setClipRecordUser(a0, a1, a2); } }}, {key: 'setNoiseCancellationEnabled', value: function(a0) { var property = this._numNoiseCancellationChanges; this._numNoiseCancellationChanges = typeof property === 'bigint' ? property + 1n : +property + 1; property = this._voiceDuration; if (property != null) { property.setNoiseCancellationEnabled(a0); } }}, {key: 'setSpatialAudioEnabled', value: function(a0) { var _voiceDuration = this._voiceDuration; if (_voiceDuration != null) { _voiceDuration.setSpatialAudioEnabled(a0); } }}, {key: 'setSimulcastDebugOverride', value: value_36718}, {key: 'setVideoSize', value: value_36719}, {key: 'clearJoinVoiceId', value: function() { this.joinVoiceId = null; }}, {key: 'setNextChannelId', value: value_36721}, {key: 'getNextChannelId', value: function() { return this._nextChannelId ?? this._channelId; }}, {key: 'channelId', get: function() { return this._channelId; }}, {key: 'trueServerId', get: function() { var r0; r0 = this.streamServerId ?? this.guildId; r0 = r0 ?? this.channelId; return r0; }}, {key: 'trueChannelId', get: get_36725}, {key: '_cleanupSocket', value: function() { var _socket = this._socket; if (_socket != null) { _socket.close(); _socket.removeAllListeners(); this._socket = null; } }}, {key: '_chooseExperiments', value: value_36727}, {key: '_handleConnecting', value: value_36728}, {key: '_handleConnect', value: function(a0) { var env0_0 = this; var env0_1 = a0; var property = this.token; var env0_2 = property; this.reconnecting = false; if (property == null) { throw new global.Error('RTCConnection._handleConnect(...): Token is missing.'); } this.logger.info('Connected to RTC server.'); this._fetchAsyncResourcesPromise.finally(_fun36730); }}, {key: '_handleDisconnect', value: value_36731}, {key: '_handleResuming', value: function() { var _connection = this._connection; if (_connection != null) { _connection.fastUdpReconnect(); } _connection = this._connection; if (_connection != null) { _connection.clearAllSpeaking(); } }}, {key: '_handleReady', value: value_36743}, {key: '_handleSpeaking', value: value_36764}, {key: 'handleFlags', value: function(a0, a1) { var Flags = require(dependencyMap[41]).RTCConnectionEvent.Flags; this.emit(Flags, a0, a1); }}, {key: 'handlePlatform', value: function(a0, a1) { var Platform = require(dependencyMap[41]).RTCConnectionEvent.Platform; this.emit(Platform, a0, a1, this.channelId); }}, {key: 'handleUsersMerged', value: value_36767}, {key: 'getOrCreateVideoQuality', value: value_36769}, {key: '_handleVideoStreamId', value: value_36771}, {key: '_handleLocalVideoDisabled', value: function(a0, a1) { if (this.userId !== a0) { var value = this.getOrCreateVideoQuality(); if (value == null) { this.logger.error('_handleLocalVideoDisabled: Unable to create videoQuality.'); return undefined; } value.setUserVideoDisabled(a0, a1); } }}, {key: '_handleRemoteStreamsReady', value: function(a0) { var value3 = require(dependencyMap[22]).now() - this._connectStartTime; var defaultImport = importDefault(dependencyMap[24]); var VOICE_CONNECTION_REMOTE_STREAMS_CREATED = AnalyticEvents.VOICE_CONNECTION_REMOTE_STREAMS_CREATED; var object = {}; copyDataProperties(object, this._getAnalyticsProperties(), this); object['number_of_users'] = a0; object['duration_ms'] = value3; defaultImport.track(VOICE_CONNECTION_REMOTE_STREAMS_CREATED, object); }}, {key: '_handleVideo', value: value_36775}, {key: '_handleControlPing', value: function(a0) { if (!MediaEngineStore.supports(Features.NATIVE_PING)) { this._handlePing(a0); } }}, {key: '_handlePing', value: value_36779}, {key: '_handlePingTimeout', value: value_36780}, {key: '_handleOutboundLossRate', value: function(a0) { this._outboundLossRate = a0; this.emit(require(dependencyMap[41]).RTCConnectionEvent.OutboundLossRate, a0); }}, {key: '_getAnalyticsProperties', value: value_36782}, {key: '_handleClientConnect', value: value_36783}, {key: '_handleClientDisconnect', value: value_36785}, {key: '_handleCodecs', value: value_36786}, {key: '_trackVoiceConnectionSuccess', value: value_36787}, {key: '_handleSDP', value: function(a0) { var property = this._connection; if (property == null) { this.logger.warn('Cannot set SDP on connection with protocol:', this.protocol); } else if (this.protocol != null) { property.setSDP(a0); } else { this.logger.warn('Cannot set SDP on connection with protocol:', this.protocol); } }}, {key: '_handleMediaSessionId', value: value_36790}, {key: '_handleMediaSinkWants', value: value_36791}, {key: '_handleCodeVersion', value: function(a0, a1) { this.voiceVersion = a0; this.rtcWorkerVersion = a1; }}, {key: '_handleKeyframeInterval', value: function(a0) { var property = this._connection; if (property == null) { this.logger.warn('Cannot set keyframe interval on connection with protocol:', this.protocol); } else if (this.protocol != null) { property.setKeyframeInterval(a0); } else { this.logger.warn('Cannot set keyframe interval on connection with protocol:', this.protocol); } }}, {key: '_handleBandwidthEstimationExperiment', value: value_36794}, {key: '_trackSecureFrameTransition', value: value_36795}, {key: '_trackRemainingSecureFrameTransitions', value: function() { var env0_0 = this; this._secureFramesTransitionStates.forEach(_fun36798); }}, {key: '_storeSecureFrameNextTransitionData', value: value_36799}, {key: '_storeSecureFrameTransitionData', value: value_36800}, {key: '_handleSecureFramesInit', value: value_36801}, {key: '_handleSecureFramesRosterChange', value: value_36803}, {key: '_handleSecureFramesPrepareTransition', value: value_36805}, {key: '_handleSecureFramesPrepareEpoch', value: value_36807}, {key: '_sendMLSKeyPackage', value: function() { var env0_0 = this; var _connection = this._connection; if (_connection != null) { _connection.getMLSKeyPackage(_fun36809); } }}, {key: '_maybeSendSecureFramesTransitionReady', value: value_36810}, {key: '_handleSecureFramesExecuteTransition', value: value_36811}, {key: '_handleMLSExternalSenderPackage', value: function(a0) { var property = this.logger; property.info('Received MLS external sender package'); property = this._connection; if (property != null) { property.updateMLSExternalSender(a0); } }}, {key: '_handleMLSProposals', value: value_36813}, {key: '_handleMLSPrepareCommitTransition', value: value_36815}, {key: '_handleMLSWelcome', value: value_36817}, {key: 'getMLSPairwiseFingerprint', value: function(a0, a1, a2) { var _connection = this._connection; if (_connection != null) { _connection.getMLSPairwiseFingerprint(a0, a1, a2); } }}, {key: '_flagMLSInvalidCommitWelcome', value: function(a0) { var property = this.logger; property.info('Flagging invalid MLS commit/welcome for transition ID ' + a0); property = this._socket; if (property != null) { property.flagMLSInvalidCommitWelcome(a0); } }}, {key: '_handleMLSFailure', value: value_36821}, {key: '_trackMLSFailures', value: value_36822}, {key: '_alertMLSFailure', value: value_36823}, {key: 'getExtraConnectionOptions', value: function() { return {}; }}, {key: 'shouldReportPeriodicStats', value: value_36825}, {key: 'getInputDeviceName', value: value_36826}, {key: 'getOutputDeviceName', value: value_36827}, {key: 'getVideoDeviceName', value: value_36828}, {key: 'getInputDeviceSampleRate', value: function() { var r1; var property = this._voiceQuality; var value = null; if (value == property) { r1 = undefined; } else { property = property.getAudioDeviceStats().input_device_session_sample_rate; r1 = property; } return value != r1 ? r1 : value; }}]); } function RTCConnection({userId, sessionId, guildId, channelId, context, streamServerId, streamChannelId, parentMediaSessionId, joinVoiceId}) { // fn#36654, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:2447, offset: 0x010914b2, size: 2060 bytes, params: 2, frame: 33 var type; var defaultImport4; var value29; var defaultImport42; var _goLiveQualityManager; const GoLiveQualityManagerEvent = (require(12391) /* metro dependency 12391: GoLiveQualityManager */).GoLiveQualityManagerEvent; var value32; var GUILD_STAGE_VOICE; var defaultImport5; var value33; var defaultImport52; var _localMediaSinkWantsManager; const RTCMediaSinkWantsManagerEvent = (require(12389) /* metro dependency 12389: RTCMediaSinkWantsManager */).RTCMediaSinkWantsManagerEvent; var powerMonitor; var _handlePowerResume; const value = undefined; const r8 = context !== value ? context : MediaEngineContextTypes.DEFAULT; let binding = env1_5; binding(this, RTCConnection); const value5 = env1_8(RTCConnection); const value8 = env1_7(this, _isNativeReflectConstruct_36649() ? global.Reflect.construct(value5, [], env1_8(this).constructor) : value5.apply(this, value)); let Map = global.Map; const value9 = Object.create(Map.prototype, {constructor: {value: Map}}); let map = new Map(); value8._secureFramesRosterMap = map instanceof Object ? map : value9; value8.reconnecting = false; value8._nextFailureId = 0; value8._mlsFailures = []; Map = global.Map; const value11 = Object.create(Map.prototype, {constructor: {value: Map}}); map = new Map(); value8._secureFramesTransitionStates = map instanceof Object ? map : value11; value8._secureFramesMaxConcurrentTransitions = 0; value8._secureFramesTransitionPrepareCount = 0; value8._secureFramesTransitionExecuteCount = 0; value8._numNoiseCancellationChanges = 0; value8.reconnect = reconnect; value8._alertMLSFailureDebouced = (importDefault(6949) /* metro dependency 6949 */)(value8._alertMLSFailure, 100); value8._handleNetworkOnline = _handleNetworkOnline; value8._handleNetworkOffline = _handleNetworkOffline; value8._handleNoRoute = _handleNoRoute; value8._handlePowerResume = _handlePowerResume; value8._handleVoiceQualityPeriodicsStats = _handleVoiceQualityPeriodicsStats; value8.getAudioDeviceStates = getAudioDeviceStates; value8.getVideoDeviceStates = getVideoDeviceStates; value8._trackVoiceConnectionConnecting = _trackVoiceConnectionConnecting; value8.incomingVideoEnabledChanged = incomingVideoEnabledChanged; value8.windowVisibilityChanged = windowVisibilityChanged; value8.context = r8; const recordEvent = value8.recordEvent; const CONNECTION_CREATE = env1_37.CONNECTION_CREATE; Reflect.apply(recordEvent, value8, [{c: CONNECTION_CREATE}]); value8._fetchAsyncResourcesPromise = MediaEngineStore.fetchAsyncResources().catch(_fun36666); value8.userId = userId; value8.sessionId = sessionId; value8.guildId = guildId; value8._channelId = channelId; let Set = global.Set; items = [channelId]; const value13 = Object.create(Set.prototype, {constructor: {value: Set}}); let set = new Set(items); value8.channelIds = set instanceof Object ? set : value13; value8.streamServerId = streamServerId; value8.streamChannelId = streamChannelId; value8.parentMediaSessionId = parentMediaSessionId; value8.joinVoiceId = joinVoiceId; binding = env1_38; const value15 = typeof binding === 'bigint' ? binding : +binding; env1_38 = typeof value15 === 'bigint' ? value15 + 1n : +value15 + 1; value8._connectionSerial = value15; const defaultImport2 = importDefault(3) /* metro dependency 3: Logger */; const value16 = 'RTCConnection(' + value8.trueServerId + ', ' + value8.context + ')'; const value17 = Object.create(defaultImport2.prototype, {constructor: {value: defaultImport2}}); const defaultImport22 = new defaultImport2(value16); value8.logger = defaultImport22 instanceof Object ? defaultImport22 : value17; value8.logger.enableNativeLogger(true); value8._endpoint = null; value8.hostname = null; value8.port = null; value8.token = null; value8.voiceVersion = null; value8.rtcWorkerVersion = null; const AWAITING_ENDPOINT = RTCConnectionStates.AWAITING_ENDPOINT; value8.state = AWAITING_ENDPOINT; const StateHistory = (require(12387) /* metro dependency 12387: RTCConnectionStats */).StateHistory; const state = value8.state; const value20 = Object.create(StateHistory.prototype, {constructor: {value: StateHistory}}); const stateHistory = new StateHistory(state); value8.stateHistory = stateHistory instanceof Object ? stateHistory : value20; value8._socket = null; const defaultImport3 = importDefault(561) /* metro dependency 561: Backoff */; const value22 = Object.create(defaultImport3.prototype, {constructor: {value: defaultImport3}}); const defaultImport32 = new defaultImport3(1000, 10000); value8._backoff = defaultImport32 instanceof Object ? defaultImport32 : value22; value8._destroyed = false; value8._pings = []; value8._pingBadCount = 0; value8._pingTimeouts = []; value8._mediaSessionId = null; value8._voiceQuality = null; value8._voiceQualityPeriodicStatsInterval = null; value8._voiceQualityPeriodicStatsSequenceId = 0; value8._systemResponsiveness = null; value8._noiseCancellationError = 0; value8._voiceDuration = null; value8._videoQuality = null; value8._videoHealthManager = null; value8._sentVideo = false; value8._videoDecoderFallbackSuppressed = false; value8._outboundLossRate = null; value8._createdTime = (require(4303) /* metro dependency 4303: TimeUtils */).now(); value8._connectStartTime = 0; value8._connectCompletedTime = 0; value8._rtcConnectionId = (require(491) /* metro dependency 491 */).v4(); value8._connectCount = 0; value8._hasEverConnected = false; value8._connecting = false; value8._voiceConnectionSuccessTracked = false; value8._hasCodecs = false; value8._mediaEngineConnectDuration = 0; value8._encountered_socket_failure = false; value8._inputDetected = false; value8._selectedExperiments = []; value8._secureFramesState = null; Set = global.Set; items = [userId]; const value25 = Object.create(Set.prototype, {constructor: {value: Set}}); set = new Set(items); value8._userIds = set instanceof Object ? set : value25; value8._secureFramesRosterMap.clear(); value8._mlsFailures = []; value8._nextFailureId = 0; value8._mediaEngineConnectionId = null; value8.reconnecting = false; value8._lastSentSpeakingStatus = 0; value8._lastSentSSRC = value; const supports = MediaEngineStore.supports; const FIRST_FRAME_CALLBACK = Features.FIRST_FRAME_CALLBACK; const r12 = Reflect.apply(supports, MediaEngineStore, [FIRST_FRAME_CALLBACK]) && MediaEngineStore.supports(Features.REMOTE_USER_MULTI_STREAM); const DEFAULT = MediaEngineContextTypes.DEFAULT; if (DEFAULT === r8) { value32 = ChannelStore.getChannel(value8.channelId); type = value32 == null ? value : value32.type; GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE; defaultImport5 = importDefault(12389) /* metro dependency 12389: RTCMediaSinkWantsManager */; value33 = Object.create(defaultImport5.prototype, {constructor: {value: defaultImport5}}); defaultImport52 = new defaultImport5(userId, type === GUILD_STAGE_VOICE, r12); value8._localMediaSinkWantsManager = defaultImport52 instanceof Object ? defaultImport52 : value33; _localMediaSinkWantsManager = value8._localMediaSinkWantsManager; _localMediaSinkWantsManager.on(RTCMediaSinkWantsManagerEvent.Update, _fun36667); _localMediaSinkWantsManager = value8._localMediaSinkWantsManager; _localMediaSinkWantsManager.on(RTCMediaSinkWantsManagerEvent.UserSSRCUpdate, _fun36668); } else if (MediaEngineContextTypes.STREAM === r8) { defaultImport4 = importDefault(12391) /* metro dependency 12391: GoLiveQualityManager */; value29 = Object.create(defaultImport4.prototype, {constructor: {value: defaultImport4}}); defaultImport42 = new defaultImport4(); value8._goLiveQualityManager = defaultImport42 instanceof Object ? defaultImport42 : value29; _goLiveQualityManager = value8._goLiveQualityManager; _goLiveQualityManager.on(GoLiveQualityManagerEvent.RequestedSSRCsUpdate, _fun36669); _goLiveQualityManager = value8._goLiveQualityManager; _goLiveQualityManager.on(GoLiveQualityManagerEvent.RequestedStreamsUpdate, _fun36670); } const DEFAULT_WANTS_FULL = (require(12389) /* metro dependency 12389: RTCMediaSinkWantsManager */).DEFAULT_WANTS_FULL; value8._remoteVideoSinkWants = DEFAULT_WANTS_FULL; const WindowVisibilityVideoManager = (require(10682) /* metro dependency 10682: WindowVisibilityVideoManager */).WindowVisibilityVideoManager; let on = WindowVisibilityVideoManager.on; const WindowVisibilityEvent = (require(10682) /* metro dependency 10682: WindowVisibilityVideoManager */).WindowVisibilityEvent; const IncomingVideoEnabledChanged = WindowVisibilityEvent.IncomingVideoEnabledChanged; var incomingVideoEnabledChanged = value8.incomingVideoEnabledChanged; Reflect.apply(on, WindowVisibilityVideoManager, [IncomingVideoEnabledChanged, incomingVideoEnabledChanged]); on = WindowVisibilityVideoManager.on; const WindowVisibilityChanged = WindowVisibilityEvent.WindowVisibilityChanged; var windowVisibilityChanged = value8.windowVisibilityChanged; Reflect.apply(on, WindowVisibilityVideoManager, [WindowVisibilityChanged, windowVisibilityChanged]); if (RTCDebugStore.shouldRecordNextConnection()) { value8._recordingEnabled = true; (importAll(10866) /* metro dependency 10866: RTCDebugActionCreators */).setShouldRecordNextConnection(false); } else { value8._recordingEnabled = false; } const defaultImport6 = importDefault(1458) /* metro dependency 1458: NetworkUtils */; const addOnlineCallback = defaultImport6.addOnlineCallback; var _handleNetworkOnline = value8._handleNetworkOnline; Reflect.apply(addOnlineCallback, defaultImport6, [_handleNetworkOnline]); const defaultImport7 = defaultImport6; const addOfflineCallback = defaultImport7.addOfflineCallback; var _handleNetworkOffline = value8._handleNetworkOffline; Reflect.apply(addOfflineCallback, defaultImport7, [_handleNetworkOffline]); const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */; if (platformUtilsModule.isDesktop()) { powerMonitor = (importDefault(3767) /* metro dependency 3767: DiscordNative */).powerMonitor; value8.powerMonitorListener = powerMonitor.on('resume', value8._handlePowerResume); } value8._supportedBandwidthEstimationExperiments = []; value8._bandwidthEstimationExperiment = null; MediaEngineStore.getMediaEngine().getSupportedBandwidthEstimationExperiments(_fun36671); return value8; } function value_36672(a0) { // fn#36672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:9639, offset: 0x010924ec, size: 132 bytes, params: 2, frame: 16 let binding = env1_39; const push = binding.push; const object2 = {}; copyDataProperties(object2, a0, undefined); object2['t'] = (require(4303) /* metro dependency 4303: TimeUtils */).now(); object2['n'] = this._connectionSerial; Reflect.apply(push, binding, [object2]); let length = env1_39.length; if (length > 50) { while (true) { binding = env1_39; binding.shift(); length = env1_39.length; if (!(length > 50)) { break; } } } } function get_36673() { // fn#36673, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:9757, offset: 0x01092570, size: 154 bytes, params: 1, frame: 13 const lastPing = this.getLastPing(); const state = this.state; const RTC_CONNECTED = RTCConnectionStates.RTC_CONNECTED; return state !== RTC_CONNECTED || lastPing === undefined ? RTCConnectionQuality.UNKNOWN : lastPing > 500 ? RTCConnectionQuality.BAD : this._outboundLossRate == null ? lastPing > 250 ? RTCConnectionQuality.AVERAGE : this._outboundLossRate == null ? RTCConnectionQuality.FINE : this._outboundLossRate > 5 ? RTCConnectionQuality.AVERAGE : RTCConnectionQuality.FINE : this._outboundLossRate > 10 ? RTCConnectionQuality.BAD : lastPing > 250 ? RTCConnectionQuality.AVERAGE : this._outboundLossRate == null ? RTCConnectionQuality.FINE : this._outboundLossRate > 5 ? RTCConnectionQuality.AVERAGE : RTCConnectionQuality.FINE; } function set_36675(a0) { // fn#36675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:10059, offset: 0x01092615, size: 254 bytes, params: 2, frame: 22 var r8; var r11; var value2; var hostname; var port; const recordEvent = this.recordEvent; const value = environment.__proto__; const SET_ENDPOINT = env1_37.SET_ENDPOINT; Reflect.apply(recordEvent, this, [{c: SET_ENDPOINT, e: a0 != null}]); if (a0 == null) { this._endpoint = null; this.hostname = null; } else { value2 = '' + env1_36 + '//' + a0; r8 = (importDefault(1471) /* metro dependency 1471: URLUtils */).toURLSafe(value2) ?? ({}); hostname = r8.hostname; port = r8.port; r11 = port != null ? global.parseInt(port) : global.NaN; r8 = hostname == null || r11 !== 80 && r11 !== 443; this._endpoint = (r8 ? value2 : '' + env1_36 + '//' + hostname) + '/'; this.hostname = hostname; } } function value_36676(a0, a1) { // fn#36676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:10389, offset: 0x01092713, size: 1973 bytes, params: 3, frame: 22 var moduleValue; var defaultImport2; var context; var defaultImport22; var on; const SocketEvent = (require(12392) /* metro dependency 12392: RTCControlSocket */).SocketEvent; var Connecting; var _handleConnecting; var bind; var Connect; var _handleConnect; var Disconnect; var _handleDisconnect; var Resuming; var _handleResuming; var Ready; var _handleReady; var Speaking; var _handleSpeaking; var Video; var _handleVideo; var Ping; var _handleControlPing; var ClientDisconnect; var _handleClientDisconnect; var ClientConnect; var _handleClientConnect; var Codecs; var _handleCodecs; var MediaSessionId; var _handleMediaSessionId; var MediaSinkWants; var _handleMediaSinkWants; var VoiceBackendVersion; var _handleCodeVersion; var KeyframeInterval; var _handleKeyframeInterval; var Flags; var handleFlags; var Platform; var handlePlatform; var BandwidthEstimationExperiment; var _handleBandwidthEstimationExperiment; var SecureFramesInit; var _handleSecureFramesInit; var SecureFramesPrepareTransition; var _handleSecureFramesPrepareTransition; var SecureFramesPrepareEpoch; var _handleSecureFramesPrepareEpoch; var SecureFramesExecuteTransition; var _handleSecureFramesExecuteTransition; var MLSExternalSenderPackage; var _handleMLSExternalSenderPackage; var MLSProposals; var _handleMLSProposals; var MLSPrepareCommitTransition; var _handleMLSPrepareCommitTransition; var MLSWelcome; var _handleMLSWelcome; var ReceiveMessage; var _recordMessageEvent; var SendMessage; var _connectCount; if (this._destroyed) { throw new global.Error('RTCConnection.connect(...): Attempting to connect on destroyed instance.'); } const recordEvent = this.recordEvent; let value = environment.__proto__; const CONNECT = env1_37.CONNECT; Reflect.apply(recordEvent, this, [{c: CONNECT, e: a0 != null, h: a1 != null}]); this._backoff.cancel(); let endpoint = this.endpoint; const token = this.token; this.endpoint = a0; this.token = a1; if (!(endpoint === this.endpoint && token === a1)) { this._cleanupSocket(); this._mediaSessionId = null; if (endpoint != null) { moduleValue = require(491) /* metro dependency 491 */; this._rtcConnectionId = moduleValue.v4(); (importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'RTC_CONNECTION_UPDATE_ID', connection: this}); } } endpoint = this.endpoint; if (endpoint != null) { if (this._socket != null) { this._cleanupSocket(); } if (this._nextChannelId != null) { this._channelId = this._nextChannelId; this._nextChannelId = undefined; } defaultImport2 = importDefault(12392) /* metro dependency 12392: RTCControlSocket */; endpoint = this.endpoint; context = this.context; defaultImport22 = new defaultImport2(endpoint); this._socket = defaultImport22; on = defaultImport22.on; Connecting = SocketEvent.Connecting; _handleConnecting = this._handleConnecting; bind = _handleConnecting.bind; Reflect.apply(on, defaultImport22, [Connecting, Reflect.apply(bind, _handleConnecting, [this, defaultImport22])]); on = defaultImport22.on; Connect = SocketEvent.Connect; _handleConnect = this._handleConnect; bind = _handleConnect.bind; Reflect.apply(on, defaultImport22, [Connect, Reflect.apply(bind, _handleConnect, [this, defaultImport22])]); on = defaultImport22.on; Disconnect = SocketEvent.Disconnect; _handleDisconnect = this._handleDisconnect; bind = _handleDisconnect.bind; Reflect.apply(on, defaultImport22, [Disconnect, Reflect.apply(bind, _handleDisconnect, [this, defaultImport22])]); on = defaultImport22.on; Resuming = SocketEvent.Resuming; _handleResuming = this._handleResuming; bind = _handleResuming.bind; Reflect.apply(on, defaultImport22, [Resuming, Reflect.apply(bind, _handleResuming, [this, defaultImport22])]); on = defaultImport22.on; Ready = SocketEvent.Ready; _handleReady = this._handleReady; bind = _handleReady.bind; Reflect.apply(on, defaultImport22, [Ready, Reflect.apply(bind, _handleReady, [this, defaultImport22])]); on = defaultImport22.on; Speaking = SocketEvent.Speaking; _handleSpeaking = this._handleSpeaking; bind = _handleSpeaking.bind; Reflect.apply(on, defaultImport22, [Speaking, Reflect.apply(bind, _handleSpeaking, [this, defaultImport22])]); on = defaultImport22.on; Video = SocketEvent.Video; _handleVideo = this._handleVideo; bind = _handleVideo.bind; Reflect.apply(on, defaultImport22, [Video, Reflect.apply(bind, _handleVideo, [this, defaultImport22])]); on = defaultImport22.on; Ping = SocketEvent.Ping; _handleControlPing = this._handleControlPing; bind = _handleControlPing.bind; Reflect.apply(on, defaultImport22, [Ping, Reflect.apply(bind, _handleControlPing, [this])]); on = defaultImport22.on; ClientDisconnect = SocketEvent.ClientDisconnect; _handleClientDisconnect = this._handleClientDisconnect; bind = _handleClientDisconnect.bind; Reflect.apply(on, defaultImport22, [ClientDisconnect, Reflect.apply(bind, _handleClientDisconnect, [this])]); on = defaultImport22.on; ClientConnect = SocketEvent.ClientConnect; _handleClientConnect = this._handleClientConnect; bind = _handleClientConnect.bind; Reflect.apply(on, defaultImport22, [ClientConnect, Reflect.apply(bind, _handleClientConnect, [this])]); on = defaultImport22.on; Codecs = SocketEvent.Codecs; _handleCodecs = this._handleCodecs; bind = _handleCodecs.bind; Reflect.apply(on, defaultImport22, [Codecs, Reflect.apply(bind, _handleCodecs, [this])]); on = defaultImport22.on; MediaSessionId = SocketEvent.MediaSessionId; _handleMediaSessionId = this._handleMediaSessionId; bind = _handleMediaSessionId.bind; Reflect.apply(on, defaultImport22, [MediaSessionId, Reflect.apply(bind, _handleMediaSessionId, [this])]); on = defaultImport22.on; MediaSinkWants = SocketEvent.MediaSinkWants; _handleMediaSinkWants = this._handleMediaSinkWants; bind = _handleMediaSinkWants.bind; Reflect.apply(on, defaultImport22, [MediaSinkWants, Reflect.apply(bind, _handleMediaSinkWants, [this])]); on = defaultImport22.on; VoiceBackendVersion = SocketEvent.VoiceBackendVersion; _handleCodeVersion = this._handleCodeVersion; bind = _handleCodeVersion.bind; Reflect.apply(on, defaultImport22, [VoiceBackendVersion, Reflect.apply(bind, _handleCodeVersion, [this])]); on = defaultImport22.on; KeyframeInterval = SocketEvent.KeyframeInterval; _handleKeyframeInterval = this._handleKeyframeInterval; bind = _handleKeyframeInterval.bind; Reflect.apply(on, defaultImport22, [KeyframeInterval, Reflect.apply(bind, _handleKeyframeInterval, [this])]); on = defaultImport22.on; Flags = SocketEvent.Flags; handleFlags = this.handleFlags; bind = handleFlags.bind; Reflect.apply(on, defaultImport22, [Flags, Reflect.apply(bind, handleFlags, [this])]); on = defaultImport22.on; Platform = SocketEvent.Platform; handlePlatform = this.handlePlatform; bind = handlePlatform.bind; Reflect.apply(on, defaultImport22, [Platform, Reflect.apply(bind, handlePlatform, [this])]); on = defaultImport22.on; BandwidthEstimationExperiment = SocketEvent.BandwidthEstimationExperiment; _handleBandwidthEstimationExperiment = this._handleBandwidthEstimationExperiment; bind = _handleBandwidthEstimationExperiment.bind; Reflect.apply(on, defaultImport22, [BandwidthEstimationExperiment, Reflect.apply(bind, _handleBandwidthEstimationExperiment, [this])]); on = defaultImport22.on; SecureFramesInit = SocketEvent.SecureFramesInit; _handleSecureFramesInit = this._handleSecureFramesInit; bind = _handleSecureFramesInit.bind; Reflect.apply(on, defaultImport22, [SecureFramesInit, Reflect.apply(bind, _handleSecureFramesInit, [this])]); on = defaultImport22.on; SecureFramesPrepareTransition = SocketEvent.SecureFramesPrepareTransition; _handleSecureFramesPrepareTransition = this._handleSecureFramesPrepareTransition; bind = _handleSecureFramesPrepareTransition.bind; Reflect.apply(on, defaultImport22, [SecureFramesPrepareTransition, Reflect.apply(bind, _handleSecureFramesPrepareTransition, [this])]); on = defaultImport22.on; SecureFramesPrepareEpoch = SocketEvent.SecureFramesPrepareEpoch; _handleSecureFramesPrepareEpoch = this._handleSecureFramesPrepareEpoch; bind = _handleSecureFramesPrepareEpoch.bind; Reflect.apply(on, defaultImport22, [SecureFramesPrepareEpoch, Reflect.apply(bind, _handleSecureFramesPrepareEpoch, [this])]); on = defaultImport22.on; SecureFramesExecuteTransition = SocketEvent.SecureFramesExecuteTransition; _handleSecureFramesExecuteTransition = this._handleSecureFramesExecuteTransition; bind = _handleSecureFramesExecuteTransition.bind; Reflect.apply(on, defaultImport22, [SecureFramesExecuteTransition, Reflect.apply(bind, _handleSecureFramesExecuteTransition, [this])]); on = defaultImport22.on; MLSExternalSenderPackage = SocketEvent.MLSExternalSenderPackage; _handleMLSExternalSenderPackage = this._handleMLSExternalSenderPackage; bind = _handleMLSExternalSenderPackage.bind; Reflect.apply(on, defaultImport22, [MLSExternalSenderPackage, Reflect.apply(bind, _handleMLSExternalSenderPackage, [this])]); on = defaultImport22.on; MLSProposals = SocketEvent.MLSProposals; _handleMLSProposals = this._handleMLSProposals; bind = _handleMLSProposals.bind; Reflect.apply(on, defaultImport22, [MLSProposals, Reflect.apply(bind, _handleMLSProposals, [this, defaultImport22])]); on = defaultImport22.on; MLSPrepareCommitTransition = SocketEvent.MLSPrepareCommitTransition; _handleMLSPrepareCommitTransition = this._handleMLSPrepareCommitTransition; bind = _handleMLSPrepareCommitTransition.bind; Reflect.apply(on, defaultImport22, [MLSPrepareCommitTransition, Reflect.apply(bind, _handleMLSPrepareCommitTransition, [this])]); on = defaultImport22.on; MLSWelcome = SocketEvent.MLSWelcome; _handleMLSWelcome = this._handleMLSWelcome; bind = _handleMLSWelcome.bind; Reflect.apply(on, defaultImport22, [MLSWelcome, Reflect.apply(bind, _handleMLSWelcome, [this])]); on = defaultImport22.on; ReceiveMessage = SocketEvent.ReceiveMessage; _recordMessageEvent = this._recordMessageEvent; bind = _recordMessageEvent.bind; Reflect.apply(on, defaultImport22, [ReceiveMessage, Reflect.apply(bind, _recordMessageEvent, [this, env1_37.MESSAGE_RECEIVE])]); on = defaultImport22.on; SendMessage = SocketEvent.SendMessage; _recordMessageEvent = this._recordMessageEvent; bind = _recordMessageEvent.bind; Reflect.apply(on, defaultImport22, [SendMessage, Reflect.apply(bind, _recordMessageEvent, [this, env1_37.MESSAGE_SEND])]); value = require(4303) /* metro dependency 4303: TimeUtils */; this._connectStartTime = value.now(); _connectCount = this._connectCount; this._connectCount = typeof _connectCount === 'bigint' ? _connectCount + 1n : +_connectCount + 1; this._connecting = true; this._voiceConnectionSuccessTracked = false; value = defaultImport22 != null; if (value && this._socket === defaultImport22) { this._trackVoiceConnectionConnecting(); this._encountered_socket_failure = false; defaultImport22.connect(); } } else { this.setState(RTCConnectionStates.AWAITING_ENDPOINT); } } function value_36678() { // fn#36678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:13755, offset: 0x01092eea, size: 566 bytes, params: 1, frame: 18 var powerMonitorListener; this.logger.info('Destroy RTCConnection'); const defaultImport = importDefault(1458) /* metro dependency 1458: NetworkUtils */; defaultImport.removeOnlineCallback(this._handleNetworkOnline); const defaultImport2 = defaultImport; defaultImport2.removeOfflineCallback(this._handleNetworkOffline); const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */; if (platformUtilsModule.isDesktop()) { powerMonitorListener = this.powerMonitorListener; if (powerMonitorListener != null) { powerMonitorListener.call(this); } } const recordEvent = this.recordEvent; const CONNECTION_DESTROY = env1_37.CONNECTION_DESTROY; Reflect.apply(recordEvent, this, [{c: CONNECTION_DESTROY}]); const WindowVisibilityVideoManager = (require(10682) /* metro dependency 10682: WindowVisibilityVideoManager */).WindowVisibilityVideoManager; let off = WindowVisibilityVideoManager.off; const WindowVisibilityEvent = (require(10682) /* metro dependency 10682: WindowVisibilityVideoManager */).WindowVisibilityEvent; const IncomingVideoEnabledChanged = WindowVisibilityEvent.IncomingVideoEnabledChanged; Reflect.apply(off, WindowVisibilityVideoManager, [IncomingVideoEnabledChanged, this.incomingVideoEnabledChanged]); off = WindowVisibilityVideoManager.off; const WindowVisibilityChanged = WindowVisibilityEvent.WindowVisibilityChanged; Reflect.apply(off, WindowVisibilityVideoManager, [WindowVisibilityChanged, this.windowVisibilityChanged]); this._backoff.cancel(); this._cleanupSocket(); let _voiceQuality = this._voiceQuality; if (_voiceQuality != null) { _voiceQuality.stop(); } _voiceQuality = this._voiceQuality; if (_voiceQuality != null) { _voiceQuality.removeAllListeners(); } this._voiceQuality = null; global.clearInterval(this._voiceQualityPeriodicStatsInterval); this._voiceQualityPeriodicStatsInterval = null; this._voiceQualityPeriodicStatsSequenceId = 0; const _systemResponsiveness = this._systemResponsiveness; if (_systemResponsiveness != null) { _systemResponsiveness.stop(); } this._systemResponsiveness = null; this._noiseCancellationError = 0; const _voiceDuration = this._voiceDuration; if (_voiceDuration != null) { _voiceDuration.stop(); } this._voiceDuration = null; const _videoQuality = this._videoQuality; if (_videoQuality != null) { _videoQuality.stop(); } this._videoQuality = null; this._videoHealthManager = null; this._secureFramesState = null; const _localMediaSinkWantsManager = this._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager.reset(); } let _connection = this._connection; if (_connection != null) { _connection = this._connection; this._connection = null; _connection.destroy(); } this.removeAllListeners(); this._destroyed = true; } function value_36679(a0, a1) { // fn#36679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:15147, offset: 0x01093120, size: 231 bytes, params: 3, frame: 21 var r1; var r2; const value = environment.__proto__; const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */; if (platformUtilsModule.isWeb()) { return true; } const flagUtilsModule = require(1391) /* metro dependency 1391: FlagUtils */; let hasFlag = flagUtilsModule.hasFlag; let PRIORITY = SpeakingFlags.PRIORITY; const hasFlag2 = Reflect.apply(hasFlag, flagUtilsModule, [a0, PRIORITY]); const moduleValue3 = flagUtilsModule; hasFlag = moduleValue3.hasFlag; const _lastSentSpeakingStatus = this._lastSentSpeakingStatus; PRIORITY = SpeakingFlags.PRIORITY; let r0 = this._lastSentSSRC !== a1 || hasFlag2 !== Reflect.apply(hasFlag, moduleValue3, [_lastSentSpeakingStatus, PRIORITY]); if (r0) { r1 = this._lastSentSSRC !== undefined || a0 !== SpeakingFlags.NONE; if (r1) { r2 = this._lastSentSSRC === a1 || a0 !== SpeakingFlags.NONE; if (r2) { this._lastSentSpeakingStatus = a0; this._lastSentSSRC = a1; r2 = true; } r1 = r2; } r0 = r1; } return r0; } function value_36680(a0, a1) { // fn#36680, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:15499, offset: 0x01093207, size: 74 bytes, params: 3, frame: 15 var value; const _socket = this._socket; if (_socket != null) { if (this.shouldSendSpeaking(a0, a1)) { value = environment.__proto__; value = MediaEngineStore.getPacketDelay(); _socket.speaking(a0, value, a1); } } } function value_36683() { // fn#36683, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:15837, offset: 0x010932a2, size: 113 bytes, params: 1, frame: 16 var r0; const _pings = this._pings; const slice = _pings.slice; const Math = global.Math; let value = Math.min(this._pings.length, 20); const value2 = 0; value = Reflect.apply(slice, _pings, [value2, value]); if (value2 === value.length) { r0 = value2; } else if (this._socket == null) { r0 = value2; } else { value = value.reduce(function(a0, a1) { return a0 + a1.value; }, value2) / value.length; r0 = value; } return r0; } function value_36704() { // fn#36704, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:17639, offset: 0x010934a1, size: 48 bytes, params: 1, frame: 11 const Object = global.Object; return Object.entries(this._remoteVideoSinkWants).some(_fun36705); } function value_36710(a0) { // fn#36710, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:18349, offset: 0x01093606, size: 221 bytes, params: 2, frame: 22 let value = a1; const r5 = value !== undefined ? value : {}; const recordEvent = this.recordEvent; value = environment.__proto__; const SET_STATE = env1_37.SET_STATE; Reflect.apply(recordEvent, this, [{c: SET_STATE, s: a0}]); const logger = this.logger; logger.info('RTC connection state: ' + this.state + ' => ' + a0); this.state = a0; const stateHistory = this.stateHistory; stateHistory.update(this.state); const emit = this.emit; const RTCConnectionEvent = (require(4405) /* metro dependency 4405: RTCConnectionEvent */).RTCConnectionEvent; const State = RTCConnectionEvent.State; Reflect.apply(emit, this, [State, a0, {hostname: this.hostname, channelId: this.trueChannelId, context: this.context}, r5]); } function value_36718(a0, a1, a2) { // fn#36718, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:19578, offset: 0x0109383b, size: 66 bytes, params: 4, frame: 13 var value; var _localMediaSinkWantsManager; if (a1 === this.context) { value = environment.__proto__; if (a1 === MediaEngineContextTypes.DEFAULT) { _localMediaSinkWantsManager = this._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager.setSimulcastDebugOverride(a0, a2); } } } } function value_36719(a0, a1, a2) { // fn#36719, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:19742, offset: 0x0109387d, size: 160 bytes, params: 4, frame: 18 var r2; var _localMediaSinkWantsManager; let value = a1 == null; if (value) { r2 = value; } else { value = environment.__proto__; value = require(477) /* metro dependency 477: PlatformUtils */; value = value.isAndroid(); r2 = value; } if (!r2) { value = environment.__proto__; value = require(477) /* metro dependency 477: PlatformUtils */; value = value.isIOS(); r2 = value; } if (!r2) { _localMediaSinkWantsManager = this._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager.setVideoSize(a0, a1.width * a1.height); } } const _goLiveQualityManager = this._goLiveQualityManager; if (_goLiveQualityManager != null) { _goLiveQualityManager.setVideoSize(a0, a1, a2); } } function value_36721(a0) { // fn#36721, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:20055, offset: 0x0109392c, size: 153 bytes, params: 2, frame: 21 const recordEvent = this.recordEvent; let value = environment.__proto__; const SET_NEXT_CHANNEL_ID = env1_37.SET_NEXT_CHANNEL_ID; Reflect.apply(recordEvent, this, [{c: SET_NEXT_CHANNEL_ID}]); value = ChannelStore.getChannel(this.channelId); const value2 = undefined; this.logger.info('Updating channel: ' + a0 + '(' + (value == null ? value2 : value.type) + ')'); this._nextChannelId = a0; this.channelIds.add(a0); return value2; } function get_36725() { // fn#36725, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:20576, offset: 0x01093a06, size: 97 bytes, params: 1, frame: 12 var r0; var value; if (this.streamServerId == null) { r0 = this.channelId; } else if (this.streamChannelId != null) { r0 = this.streamChannelId; } else { value = environment.__proto__; value = importDefault(24) /* metro dependency 24 */; value = value(this.streamServerId); value = value.prev(); value = value.toString(); r0 = value; } return r0; } function value_36727() { // fn#36727, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:20887, offset: 0x01093a94, size: 576 bytes, params: 1, frame: 19 var r4; var BrowserTransceiverPaddingRemovalExperiment; var defaultImport2; var mode; var defaultImport3; const items2 = []; if (this._recordingEnabled) { items2.push('connection_log'); } const supports = MediaEngineStore.supports; const FIXED_KEYFRAME_INTERVAL = Features.FIXED_KEYFRAME_INTERVAL; if (Reflect.apply(supports, MediaEngineStore, [FIXED_KEYFRAME_INTERVAL])) { items2.push('fixed_keyframe_interval'); } const {enabled, dontEmitVolumeOnlySpeakingEvents} = (importDefault(4608) /* metro dependency 4608: ProportionalVadIndicatorExperiment */).getConfig({location: '_chooseExperiments'}); if (enabled) { items2.push('should_analyze_user_voice_volume'); } if (dontEmitVolumeOnlySpeakingEvents) { items2.push('dont_emit_volume_only_speaking_events'); } const isWeb2 = (require(477) /* metro dependency 477: PlatformUtils */).isWeb(); if (isWeb2) { BrowserTransceiverPaddingRemovalExperiment = (require(12393) /* metro dependency 12393: BrowserTransceiverPaddingRemovalExperiment */).BrowserTransceiverPaddingRemovalExperiment; r4 = BrowserTransceiverPaddingRemovalExperiment.getConfig({location: 'RTCConnection'}).enabled; } else { r4 = isWeb2; } if (r4) { items2.push('browser_transceiver_padding_removal'); } const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */; if (platformUtilsModule.isIOS()) { defaultImport2 = importDefault(12394) /* metro dependency 12394: VideoStabilizationExperiment */; getConfig = defaultImport2.getConfig; mode = Reflect.apply(getConfig, defaultImport2, [{location: '_chooseExperiments'}]).mode; if (mode === 'standard') { items2.push('ios_video_stabilization_standard'); } else if (mode === 'low_latency') { items2.push('ios_video_stabilization_low_latency'); } defaultImport3 = importDefault(12395) /* metro dependency 12395: BroadcastUploadDisposeFixExperiment */; getConfig = defaultImport3.getConfig; if (Reflect.apply(getConfig, defaultImport3, [{location: '_chooseExperiments'}]).enabled) { items2.push('ios_broadcast_upload_dispose_fix'); } } if (platformUtilsModule.isAndroid() && (require(10678) /* metro dependency 10678: SurfaceDirectRendererExperiment */).isSurfaceDirectRendererExperimentEnabled()) { items2.push((require(10678) /* metro dependency 10678: SurfaceDirectRendererExperiment */).ANDROID_SURFACE_DIRECT_RENDERER_EXPERIMENT); } this._selectedExperiments = items2; } function value_36728() { // fn#36728, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:21909, offset: 0x01093cd4, size: 168 bytes, params: 1, frame: 28 var type; var value; var getChannel; var channelId; var logger; var info; let endpoint = this.endpoint; if (endpoint != null) { value = environment.__proto__; getChannel = ChannelStore.getChannel; channelId = this.channelId; value = Reflect.apply(getChannel, ChannelStore, [channelId]); type = value?.type; logger = this.logger; info = logger.info; endpoint = this.endpoint; value = this.getRTCConnectionId(); channelId = this.channelId; Reflect.apply(info, logger, ['Connecting to RTC server ' + endpoint + ', rtc-connection-id: ' + value + ', channel: ' + channelId + '(' + type + ')']); } const setState = this.setState; value = environment.__proto__; const CONNECTING = RTCConnectionStates.CONNECTING; Reflect.apply(setState, this, [CONNECTING]); } function value_36729(a0) { // fn#36729, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:22206, offset: 0x01093d7c, size: 125 bytes, params: 2, frame: 13 const env0_1 = a0; const token = this.token; this.reconnecting = false; if (token == null) { throw new global.Error('RTCConnection._handleConnect(...): Token is missing.'); } this.logger.info('Connected to RTC server.'); this._fetchAsyncResourcesPromise.finally(_fun36730); } function value_36731(a0, a1, a2, a3) { // fn#36731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:22772, offset: 0x01093ea1, size: 2969 bytes, params: 5, frame: 29 var environment; var r19; var r9; var sampleRateMismatchPercent; var r11; var defaultImport; var track; var VOICE_CONNECTION_SOCKET_FAILURE; var object; var _connection; var _backoff; var value5; var warn; var value7; var _videoQuality; var value8; var cameraDurationStats; var defaultImport2; var VIDEO_CALL_ENDED; var settings; var value20; var value21; var value22; var value23; var _voiceQuality; var _voiceDuration; var _systemResponsiveness; var Math; var modeOptions; var value52; var Promise; var all; var defaultImport3; let value = a1; const value2 = a2; const env0_1 = a3; let logger = this.logger; const info = logger.info; let state = this.state; Reflect.apply(info, logger, ['Disconnected from RTC server, clean: ' + value + ', code: ' + value2 + ', reason: ' + a3 + ', state: ' + state]); let r1 = value || !this._connecting; r1 = !r1 ? this._encountered_socket_failure : r1; if (!r1) { value = environment.__proto__; defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = defaultImport.track; VOICE_CONNECTION_SOCKET_FAILURE = AnalyticEvents.VOICE_CONNECTION_SOCKET_FAILURE; object = {}; copyDataProperties(object, this._getAnalyticsProperties(), value2); object['hostname'] = this.hostname; object['connect_count'] = this._connectCount; object['code'] = value2; object['reason'] = a3; Reflect.apply(track, defaultImport, [VOICE_CONNECTION_SOCKET_FAILURE, object]); this._encountered_socket_failure = true; } value = environment.__proto__; if (RTCConnectionStore.getRemoteDisconnectVoiceChannelId() === this.channelId) { _connection = this._connection; if (_connection != null) { _connection.wasRemoteDisconnected(); } } const value4 = a3 !== 'Force Close'; if (value4) { _backoff = this._backoff; value5 = _backoff.fail(this.reconnect); logger = this.logger; warn = logger.warn; value7 = (value5 / 1000).toFixed(2); Reflect.apply(warn, logger, ['Disconnect was not clean! reason=' + a3 + '. Reconnecting in ' + value7 + ' seconds.']); r19 = value7; } else { r19 = value2; } state = this.state; let DISCONNECTED = RTCConnectionStates.DISCONNECTED; if (state !== DISCONNECTED) { _videoQuality = this._videoQuality; value8 = null; if (value8 != _videoQuality) { if (this.context === MediaEngineContextTypes.DEFAULT) { _videoQuality.stop(); if (this._sentVideo) { _videoQuality.getOutboundStats().forEach(_fun36732); cameraDurationStats = _videoQuality.getCameraDurationStats(); if (value8 != cameraDurationStats && cameraDurationStats.camera_enabled_duration > 0) { defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = defaultImport2.track; VIDEO_CALL_ENDED = AnalyticEvents.VIDEO_CALL_ENDED; object = {}; copyDataProperties(object, cameraDurationStats, r19); object['media_session_id'] = this.getMediaSessionId(); Reflect.apply(track, defaultImport2, [VIDEO_CALL_ENDED, object]); } } _videoQuality.getInboundParticipants().forEach(_fun36733); } } var env0_4 = this.getMediaSessionId(); MediaEngineStore.getMediaEngine().getCodecSurvey().then(_fun36734).catch(_fun36735); this._trackMLSFailures({'recovered': false, 'downgraded': false}); r9 = RTCRegionStore.shouldIncludePreferredRegion() ? RTCRegionStore.getPreferredRegion() : value8; settings = MediaEngineStore.getSettings(); value20 = ChannelStore.getChannel(this.channelId); value21 = MediaEngineStatsStore.getConnectionStats(this.getMediaEngineConnectionId()); value22 = undefined; if (value8 == value21) { sampleRateMismatchPercent = value22; } else { value23 = value21.stats.rtp.outbound.find(function(a0) { return a0.type === 'audio'; }); sampleRateMismatchPercent = value8 == value23 ? value22 : value23.sampleRateMismatchPercent; } object = {}; copyDataProperties(object, this._getAnalyticsProperties(), r19); object['hostname'] = this.hostname; object['port'] = this.port; object['protocol'] = this.protocol; object['reconnect'] = value4; object['reason'] = a3; object['duration'] = this.getDuration(); copyDataProperties(object, RTCConnectionStore.getUserVoiceSettingsStats(this.context), r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getMosStats(); copyDataProperties(object, r11, r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getPacketStats(); copyDataProperties(object, r11, r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getBytesStats(); copyDataProperties(object, r11, r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getBufferStats(); copyDataProperties(object, r11, r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getNetworkStats(); copyDataProperties(object, r11, r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getSystemResourceStats(); copyDataProperties(object, r11, r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getFrameOpStats(); copyDataProperties(object, r11, r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getDurationStats(); copyDataProperties(object, r11, r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getTransportStats(); copyDataProperties(object, r11, r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getE2EEStats(); copyDataProperties(object, r11, r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getAudioDeviceStats(); copyDataProperties(object, r11, r19); _voiceQuality = this._voiceQuality; r11 = value8 == _voiceQuality ? value22 : _voiceQuality.getAudioLevelStats(); copyDataProperties(object, r11, r19); _voiceDuration = this._voiceDuration; r11 = value8 == _voiceDuration ? value22 : _voiceDuration.getDurationStats(); copyDataProperties(object, r11, r19); copyDataProperties(object, DeviceFrecencyStore.getUsageStats(), r19); copyDataProperties(object, this.getAudioDeviceStates(), r19); _systemResponsiveness = this._systemResponsiveness; r11 = value8 == _systemResponsiveness ? value22 : _systemResponsiveness.getPttQueueLatencyStats(); copyDataProperties(object, r11, r19); object['num_noise_cancellation_changes'] = this._numNoiseCancellationChanges; object['media_session_id'] = this.getMediaSessionId(); object['channel_bitrate'] = value8 != value20 ? value20.bitrate : value8; object['cloudflare_best_region'] = r9; object['connect_count'] = this._connectCount; Math = global.Math; object['ping_average'] = Math.round(this.getAveragePing()); object['ping_bad_count'] = this._pingBadCount; object['ping_timeout'] = this._pingTimeouts.length; object['input_detected'] = this._inputDetected; object['no_input_detected_notice'] = MediaEngineStore.getNoInputDetectedNotice(); object['audio_input_mode'] = settings.mode; modeOptions = settings.modeOptions; object['automatic_audio_input_sensitivity_enabled'] = modeOptions.autoThreshold; modeOptions = settings.modeOptions; object['audio_input_sensitivity'] = modeOptions.threshold; object['echo_cancellation_enabled'] = settings.echoCancellation; object['sidechain_compression_enabled'] = settings.sidechainCompression; object['noise_suppression_enabled'] = settings.noiseSuppression; object['noise_cancellation_enabled'] = settings.noiseCancellation; object['noise_canceller_error'] = this._noiseCancellationError; object['automatic_gain_control_enabled'] = settings.automaticGainControl; object['voice_output_volume'] = settings.outputVolume; object['voice_input_volume'] = settings.inputVolume; object['encryption_mode'] = this._encryptionMode; object['channel_count'] = this.channelIds.size; object['device_performance_class'] = (importDefault(5252) /* metro dependency 5252: getMediaPerformanceClassAndroid */)(); r9 = value8 != this._connection ? value8 == this._connection ? value22 : this._connection.getNumFastUdpReconnects() : value8; object['num_fast_udp_reconnects'] = r9; object['parent_media_session_id'] = this.parentMediaSessionId; object['audio_subsystem'] = MediaEngineStore.getMediaEngine().getAudioSubsystem(); object['audio_layer'] = MediaEngineStore.getMediaEngine().getAudioLayer(); object['automatic_audio_subsystem'] = settings.automaticAudioSubsystem; object['participant_type'] = this.getVoiceParticipantType(); object['audio_capture_sample_rate_mismatch_percent'] = sampleRateMismatchPercent; object['krisp_sdk_version'] = MediaEngineStore.getState().krispVersion; object['secure_frames_max_concurrent_transitions'] = this._secureFramesMaxConcurrentTransitions; object['secure_frames_transition_prepare_count'] = this._secureFramesTransitionPrepareCount; object['secure_frames_transition_execute_count'] = this._secureFramesTransitionExecuteCount; modeOptions = settings.modeOptions; object['vad_use_advanced_voice_activity'] = modeOptions.vadUseKrisp; object['soundshare_experimental'] = MediaEngineStore.getExperimentalSoundshare(); object['join_voice_id'] = this.joinVoiceId; object['bypass_system_input_processing'] = settings.bypassSystemInputProcessing; object['system_microphone_mode'] = MediaEngineStore.getSystemMicrophoneMode(); object['output_audio_route_type'] = AudioRouteStoreNative.getCurrentRouteType(); value52 = _fun36737(); Promise = global.Promise; all = Promise.all; object = [value52()]; defaultImport3 = importDefault(12396) /* metro dependency 12396: KrispUtils */; object[1] = defaultImport3.getKrispModel(); object[2] = MediaEngineStore.getKrispEnableStats() ? MediaEngineStore.getMediaEngine().getNoiseCancellationStats() : global.Promise.resolve(value8); Reflect.apply(all, Promise, [object]).then(_fun36741); this._trackRemainingSecureFrameTransitions(); } this._pingTimeouts = []; this._pings = []; this._connectCompletedTime = 0; this._pingBadCount = 0; this._inputDetected = false; this._mediaSessionId = null; _voiceQuality = this._voiceQuality; if (_voiceQuality != null) { _voiceQuality.stop(); } this._voiceQuality = null; global.clearInterval(this._voiceQualityPeriodicStatsInterval); this._voiceQualityPeriodicStatsInterval = null; this._voiceQualityPeriodicStatsSequenceId = 0; this._noiseCancellationError = 0; this._numNoiseCancellationChanges = 0; _voiceDuration = this._voiceDuration; if (_voiceDuration != null) { _voiceDuration.stop(); } this._voiceDuration = null; _videoQuality = this._videoQuality; if (_videoQuality != null) { _videoQuality.stop(); } this._videoQuality = null; this._videoHealthManager = null; const _localMediaSinkWantsManager = this._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager.reset(); } this._secureFramesState = null; const Set = global.Set; const userId = this.userId; object = [userId]; const value58 = Object.create(Set.prototype, {constructor: {value: Set}}); const set = new Set(); this._userIds = set instanceof Object ? set : value58; this._secureFramesRosterMap.clear(); this._secureFramesTransitionStates.clear(); this._secureFramesNextTransitionState = undefined; this._secureFramesMaxConcurrentTransitions = 0; this._secureFramesTransitionPrepareCount = 0; this._secureFramesTransitionExecuteCount = 0; _connection = this._connection; if (_connection != null) { _connection = this._connection; this._connection = null; this._hasCodecs = false; _connection.destroy(this.reconnecting || value4); } const setState = this.setState; DISCONNECTED = RTCConnectionStates.DISCONNECTED; Reflect.apply(setState, this, [DISCONNECTED, {willReconnect: value4}]); } function value_36743(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36743, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:30743, offset: 0x01094fe9, size: 1753 bytes, params: 8, frame: 30 var object2; let value = dependencyMap; const env0_2 = require; const setState = this.setState; const RTC_CONNECTING = RTCConnectionStates.RTC_CONNECTING; Reflect.apply(setState, this, [RTC_CONNECTING]); this.port = importDefault; const value3 = null; this._chooseExperiments(value3 != value ? value : []); value = undefined; const ProcessBoostExperiment = require(dependencyMap[51]).ProcessBoostExperiment; const {processPriority, threadPriorityConfiguration} = ProcessBoostExperiment.getConfig({location: 'media_engine_connect'}); if (exports.length === 0) { exports.push({'type': null, 'rid': '100', 'ssrc': null, 'rtxSsrc': null, 'quality': 100, 'active': false, type: MediaTypes.VIDEO, ssrc: module + 1, rtxSsrc: module + 2}); } const mediaEngine = MediaEngineStore.getMediaEngine(); const persistentCodesEnabled = SecureFramesPersistedStore.getPersistentCodesEnabled(); const staticAuthSessionId = AuthenticationStore.getStaticAuthSessionId(); const r15 = value3 != staticAuthSessionId ? staticAuthSessionId : value; const moduleValue = require(dependencyMap[22]); const value8 = moduleValue.now(); const connect = mediaEngine.connect; let context = this.context; const userId = this.userId; object2 = {ssrc: module, address: require, port: importDefault, modes: importAll}; object2.experiments = this._selectedExperiments; object2.streamParameters = exports; object2.qosEnabled = MediaEngineStore.getQoS(); object2.signingKeyId = persistentCodesEnabled ? r15 : value; object2.processPriority = processPriority; object2.threadPriorityConfiguration = threadPriorityConfiguration; const getExtraConnectionOptions = this.getExtraConnectionOptions; copyDataProperties(object2, Reflect.apply(getExtraConnectionOptions, this, []), undefined); const value9 = Reflect.apply(connect, mediaEngine, [context, userId, object2]); const moduleValue2 = require(dependencyMap[22]); this._mediaEngineConnectDuration = moduleValue2.now() - value8; let r3 = require(dependencyMap[35]).isWeb() && !BROWSER_SUPPORTS_UNIFIED_PLAN; if (r3) { importDefault(dependencyMap[25]).captureMessage('Browser does not support Unified Plan'); } const setUseElectronVideo = value9.setUseElectronVideo; let supports = mediaEngine.supports; const ELECTRON_VIDEO = Features.ELECTRON_VIDEO; Reflect.apply(setUseElectronVideo, value9, [Reflect.apply(supports, mediaEngine, [ELECTRON_VIDEO])]); r3 = value3 != this.guildId ? GuildStore.getGuild(this.guildId) : value3; const premiumTier = value3 == r3 ? value : r3.premiumTier; let TIER_1 = BoostedGuildTiers.TIER_1; const result = premiumTier === TIER_1; const currentUser = UserStore.getCurrentUser(); const premiumType = value3 == currentUser ? value : currentUser.premiumType; TIER_1 = PremiumTypes.TIER_1; r3 = premiumType === TIER_1 || premiumType === PremiumTypes.TIER_2; value9.setCalcMaxBitrateFunc(_fun36744); supports = MediaEngineStore.supports; const IMAGE_QUALITY_MEASUREMENT = Features.IMAGE_QUALITY_MEASUREMENT; if (Reflect.apply(supports, MediaEngineStore, [IMAGE_QUALITY_MEASUREMENT])) { value9.setVideoQualityMeasurement('imageQualityWebrtcPsnrDb:5000,imageQualityVmaf_v061:5000,hwdec'); } const setVideoEncoderExperiments = value9.setVideoEncoderExperiments; const getVideoEncoderExperiments = MediaEngineStore.getVideoEncoderExperiments; context = this.context; const getVoiceParticipantType = this.getVoiceParticipantType; Reflect.apply(setVideoEncoderExperiments, value9, [Reflect.apply(getVideoEncoderExperiments, MediaEngineStore, [context, Reflect.apply(getVoiceParticipantType, this, [])])]); let on = value9.on; const BaseConnectionEvent = require(dependencyMap[54]).BaseConnectionEvent; const Speaking = BaseConnectionEvent.Speaking; Reflect.apply(on, value9, [Speaking, _fun36745]); on = value9.on; const NativeMuteChanged = BaseConnectionEvent.NativeMuteChanged; Reflect.apply(on, value9, [NativeMuteChanged, _fun36746]); on = value9.on; const Video = BaseConnectionEvent.Video; Reflect.apply(on, value9, [Video, _fun36747]); on = value9.on; const FirstFrame = BaseConnectionEvent.FirstFrame; Reflect.apply(on, value9, [FirstFrame, _fun36749]); on = value9.on; const Silence = BaseConnectionEvent.Silence; Reflect.apply(on, value9, [Silence, _fun36750]); on = value9.on; const Connected = BaseConnectionEvent.Connected; Reflect.apply(on, value9, [Connected, _fun36751]); on = value9.on; const VideoEncoderFallback = BaseConnectionEvent.VideoEncoderFallback; Reflect.apply(on, value9, [VideoEncoderFallback, _fun36754]); on = value9.on; const VideoDecoderFallback = BaseConnectionEvent.VideoDecoderFallback; Reflect.apply(on, value9, [VideoDecoderFallback, _fun36757]); on = value9.on; const Error = BaseConnectionEvent.Error; Reflect.apply(on, value9, [Error, _fun36760]); on = value9.on; const ConnectionStateChange = BaseConnectionEvent.ConnectionStateChange; Reflect.apply(on, value9, [ConnectionStateChange, _fun36761]); on = value9.on; const SecureFramesUpdate = BaseConnectionEvent.SecureFramesUpdate; Reflect.apply(on, value9, [SecureFramesUpdate, _fun36762]); on = value9.on; const Ping = BaseConnectionEvent.Ping; const _handlePing = this._handlePing; Reflect.apply(on, value9, [Ping, _handlePing.bind(this)]); on = value9.on; const PingTimeout = BaseConnectionEvent.PingTimeout; const _handlePingTimeout = this._handlePingTimeout; Reflect.apply(on, value9, [PingTimeout, _handlePingTimeout.bind(this)]); on = value9.on; const OutboundLossRate = BaseConnectionEvent.OutboundLossRate; const _handleOutboundLossRate = this._handleOutboundLossRate; Reflect.apply(on, value9, [OutboundLossRate, _handleOutboundLossRate.bind(this)]); on = value9.on; const LocalVideoDisabled = BaseConnectionEvent.LocalVideoDisabled; const _handleLocalVideoDisabled = this._handleLocalVideoDisabled; Reflect.apply(on, value9, [LocalVideoDisabled, _handleLocalVideoDisabled.bind(this)]); on = value9.on; const Stats = BaseConnectionEvent.Stats; const defaultImport2 = importDefault(dependencyMap[60]); Reflect.apply(on, value9, [Stats, defaultImport2.create()]); on = value9.on; const RemoteStreamsReady = BaseConnectionEvent.RemoteStreamsReady; const _handleRemoteStreamsReady = this._handleRemoteStreamsReady; Reflect.apply(on, value9, [RemoteStreamsReady, _handleRemoteStreamsReady.bind(this)]); on = value9.on; const UsersMerged = BaseConnectionEvent.UsersMerged; const handleUsersMerged = this.handleUsersMerged; Reflect.apply(on, value9, [UsersMerged, handleUsersMerged.bind(this)]); on = value9.on; const NoiseCancellationError = BaseConnectionEvent.NoiseCancellationError; Reflect.apply(on, value9, [NoiseCancellationError, _fun36763]); on = value9.on; const MLSFailure = BaseConnectionEvent.MLSFailure; const _handleMLSFailure = this._handleMLSFailure; Reflect.apply(on, value9, [MLSFailure, _handleMLSFailure.bind(this)]); value9.setRemoteVideoSinkWants(this._remoteVideoSinkWants); this._connection = value9; this._hasCodecs = false; this._mediaEngineConnectionId = value9.mediaEngineConnectionId; return value; } function value_36764(a0, a1, a2, a3) { // fn#36764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:38437, offset: 0x010963af, size: 94 bytes, params: 5, frame: 16 var _localMediaSinkWantsManager; const _connection = this._connection; let value = _connection != null; if (value && this.userId !== a1) { value = environment.__proto__; if (a3 !== SpeakingFlags.NONE) { _connection.createUser(a1, a2); } _localMediaSinkWantsManager = this._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager.setAudioSSRC(a1, a2); } } } function value_36767(a0) { // fn#36767, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:38838, offset: 0x0109648c, size: 80 bytes, params: 2, frame: 17 var environment; const emit = this.emit; const value = environment.__proto__; const RTCConnectionEvent = (require(4405) /* metro dependency 4405: RTCConnectionEvent */).RTCConnectionEvent; const UsersMerged = RTCConnectionEvent.UsersMerged; Reflect.apply(emit, this, [UsersMerged, a0.map(function(a0) { return a0.id; }), this.context]); } function value_36769() { // fn#36769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:38971, offset: 0x010964dc, size: 352 bytes, params: 1, frame: 24 var environment; var _videoQuality; var value; var VideoQuality; var value2; var videoQuality; const VideoHealthManager = (require(12407) /* metro dependency 12407: VideoHealthManager */).VideoHealthManager; var defaultConfig; var value4; var videoHealthManager; let _connection = this._connection; if (_connection != null) { _videoQuality = this._videoQuality; if (_videoQuality == null) { value = environment.__proto__; VideoQuality = (require(12406) /* metro dependency 12406: VideoQuality */).VideoQuality; _connection = this._connection; value2 = Object.create(VideoQuality.prototype, {constructor: {value: VideoQuality}}); videoQuality = new VideoQuality(_connection); this._videoQuality = videoQuality instanceof Object ? videoQuality : value2; _videoQuality = this._videoQuality; _videoQuality.updateCallUserIdsCount(this._userIds.size); _videoQuality = this._videoQuality; _videoQuality.start(); defaultConfig = VideoHealthManager.defaultConfig; if (defaultConfig.featureEnabled) { value4 = Object.create(VideoHealthManager.prototype, {constructor: {value: VideoHealthManager}}); videoHealthManager = new VideoHealthManager(defaultConfig.windowLength, defaultConfig.allowedPoorFpsRatio, defaultConfig.fpsThreshold, defaultConfig.backoffTimeSec); this._videoHealthManager = videoHealthManager instanceof Object ? videoHealthManager : value4; if (this._localMediaSinkWantsManager != null) { this._localMediaSinkWantsManager.videoHealthManager = this._videoHealthManager; } _videoQuality = this._videoQuality; _videoQuality.on((require(12406) /* metro dependency 12406: VideoQuality */).VideoQualityEvent.FpsUpdate, _fun36770); } } } return this._videoQuality; } function value_36771({userId, streamId, videoSsrc, videoStreamParameters}) { // fn#36771, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:39801, offset: 0x0109668a, size: 410 bytes, params: 2, frame: 25 var environment; var r5; var _videoHealthManager; var _goLiveQualityManager; const emit = this.emit; let value = environment.__proto__; value = undefined; const RTCConnectionEvent = (require(4405) /* metro dependency 4405: RTCConnectionEvent */).RTCConnectionEvent; const Video = RTCConnectionEvent.Video; Reflect.apply(emit, this, [Video, this.guildId, this.channelId, userId, streamId, this.streamServerId]); if (streamId != null && this.getOrCreateVideoQuality() == null) { this.logger.error('_handleVideoStreamId: Unable to create videoQuality.'); } let _videoQuality = this._videoQuality; if (_videoQuality != null && this.userId === userId) { videoStreamParameters.forEach(_fun36772); } const userId3 = this.userId; if (userId3 !== userId) { r5 = videoSsrc === 0 && streamId === null; if (r5) { _videoQuality = this._videoQuality; r5 = !(_videoQuality == null ? value : _videoQuality.getInboundParticipants().includes(userId)); } if (!r5) { _videoQuality = this._videoQuality; if (_videoQuality != null) { _videoQuality.setInboundUser(userId, videoSsrc); } _videoHealthManager = this._videoHealthManager; if (_videoHealthManager != null) { _videoHealthManager.createUser(userId); } } } if (this._connection != null) { if (this.userId !== userId) { if (this._localMediaSinkWantsManager != null) { this._localMediaSinkWantsManager.setStreamId(userId, streamId); } else { _goLiveQualityManager = this._goLiveQualityManager; if (_goLiveQualityManager != null) { _goLiveQualityManager = this._goLiveQualityManager; if (_goLiveQualityManager.getUserID() === userId) { _goLiveQualityManager = this._goLiveQualityManager; if (_goLiveQualityManager != null) { _goLiveQualityManager.setStreamId(streamId); } } } } } } return value; } function value_36775(a0, a1, a2, a3, a4) { // fn#36775, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:41264, offset: 0x01096943, size: 427 bytes, params: 6, frame: 27 var environment; var r10; var r16; var _localMediaSinkWantsManager; var items; var value; var value2; var done; var value3; var ssrc; var quality; var push; var active; var value4; var value5; var _goLiveQualityManager; var value6; const env0_1 = a1; const env0_2 = a3; if (this._connection != null) { if (this.userId !== a1) { _localMediaSinkWantsManager = this._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager = this._localMediaSinkWantsManager; _localMediaSinkWantsManager.setAudioSSRC(a1, a2); value = a4.map(function(a0) { return {type: MediaTypes.VIDEO, rid: a0.rid, ssrc: a0.ssrc, rtxSsrc: a0.rtxSsrc, quality: a0.quality, active: importAll > 0}; }); if (value.length === 0) { push = value.push; value6 = environment.__proto__; Reflect.apply(push, value, [{type: MediaTypes.VIDEO, rid: '100', ssrc: a3, rtxSsrc: a3 + 1, quality: 100, active: a3 > 0}]); } _localMediaSinkWantsManager = this._localMediaSinkWantsManager; _localMediaSinkWantsManager.setVideoSSRCs(a1, value); } else { items = []; value = environment.__proto__; value = _createForOfIteratorHelperLoose_36646(a4); value2 = value(); done = value2.done; if (!done) { r10 = value2; while (true) { value3 = r10.value; ssrc = value3.ssrc; if (ssrc != null) { quality = value3.quality; if (quality == null) { break; } push = items.push; ssrc = value3.ssrc; quality = value3.quality; active = value3.active; value4 = active == null; if (value4) { r16 = value4; continue; } r16 = active; continue; Reflect.apply(push, items, [{ssrc: ssrc, quality: quality, active: r16}]); break; } value5 = value(); done = value5.done; if (done) { break; } r10 = value5; continue; } } _goLiveQualityManager = this._goLiveQualityManager; if (_goLiveQualityManager != null) { _goLiveQualityManager.setUserID(a1); } _goLiveQualityManager = this._goLiveQualityManager; if (_goLiveQualityManager != null) { _goLiveQualityManager.updateAudioAndVideoStreamInfo(a2, items); } } if (a4 != null) { a4.forEach(_fun36777); } } } } function value_36779(a0) { // fn#36779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:42295, offset: 0x01096be4, size: 195 bytes, params: 2, frame: 18 var _pings; var push; var Date; var now; var length; var shift; var _pingBadCount; var emit; var value; var RTCConnectionEvent; var Ping; var quality; reducibleJoin6: while (true) { if (a0 === undefined) { break reducibleJoin6; } _pings = this._pings; push = _pings.push; Date = global.Date; now = Date.now; Reflect.apply(push, _pings, [{time: Reflect.apply(now, Date, []), value: a0}]); _pings = this._pings; length = _pings.length; if (length >= 200) { reducibleLoop2: while (true) { _pings = this._pings; shift = _pings.shift; Reflect.apply(shift, _pings, []); _pings = this._pings; length = _pings.length; if (length >= 200) { continue reducibleLoop2; } break reducibleLoop2; } } reducibleJoin5: while (true) { if (a0 > 500) { _pingBadCount = this._pingBadCount; this._pingBadCount = typeof _pingBadCount === 'bigint' ? _pingBadCount + 1n : +_pingBadCount + 1; break reducibleJoin5; } break reducibleJoin5; } emit = this.emit; value = environment.__proto__; RTCConnectionEvent = (require(4405) /* metro dependency 4405: RTCConnectionEvent */).RTCConnectionEvent; Ping = RTCConnectionEvent.Ping; _pings = this._pings; quality = this.quality; Reflect.apply(emit, this, [Ping, _pings, quality]); break reducibleJoin6; } } function value_36780(a0, a1) { // fn#36780, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:42548, offset: 0x01096ca7, size: 151 bytes, params: 3, frame: 16 var r0; var property; let _pingTimeouts = this._pingTimeouts; _pingTimeouts.push(a0); const length = this._pingTimeouts.length; const value = length >= 3; if (value) { _pingTimeouts = this._pingTimeouts; property = _pingTimeouts[length - 1]; _pingTimeouts = this._pingTimeouts; r0 = property === _pingTimeouts[length - 2] + 1; } else { r0 = value; } if (r0) { _pingTimeouts = this._pingTimeouts; property = _pingTimeouts[length - 2]; _pingTimeouts = this._pingTimeouts; r0 = property === _pingTimeouts[length - 3] + 1; } if (r0) { this._handlePing(a1); } } function value_36782() { // fn#36782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:42927, offset: 0x01096d7d, size: 114 bytes, params: 1, frame: 12 const value = environment.__proto__; const type = ChannelStore.getChannel(this.channelId)?.type; const object2 = {}; object2.guild_id = this.guildId; object2.channel_id = this.channelId; object2.channel_type = type; object2.rtc_connection_id = this.getRTCConnectionId(); object2.context = this.context; object2.voice_backend_version = this.voiceVersion; object2.rtc_worker_backend_version = this.rtcWorkerVersion; return object2; } function value_36783(a0) { // fn#36783, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:43258, offset: 0x01096def, size: 139 bytes, params: 2, frame: 15 a0.forEach(_fun36784); const emit = this.emit; const RTCConnectionEvent = (require(4405) /* metro dependency 4405: RTCConnectionEvent */).RTCConnectionEvent; const ClientConnect = RTCConnectionEvent.ClientConnect; Reflect.apply(emit, this, [ClientConnect, a0]); const _videoQuality = this._videoQuality; if (_videoQuality != null) { _videoQuality.updateCallUserIdsCount(this._userIds.size); } const _localMediaSinkWantsManager = this._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager.updateCallUserIds(this._userIds); } } function value_36785(a0) { // fn#36785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:43618, offset: 0x01096eb2, size: 622 bytes, params: 2, frame: 23 var num_frames; var context; var value; var inboundStats; var value4; var defaultImport; var track; var VIDEO_STREAM_ENDED; var object2; var getRegion; var hostname; var _videoHealthManager; let _videoQuality = this._videoQuality; if (_videoQuality != null) { context = this.context; value = environment.__proto__; if (context === MediaEngineContextTypes.DEFAULT) { inboundStats = _videoQuality.getInboundStats(a0); num_frames = inboundStats?.num_frames; value4 = 0; if (inboundStats != null) { if ((num_frames ?? value4) > value4) { defaultImport = importDefault(dependencyMap[24]); track = defaultImport.track; VIDEO_STREAM_ENDED = AnalyticEvents.VIDEO_STREAM_ENDED; object2 = {}; copyDataProperties(object2, this._getAnalyticsProperties(), dependencyMap); object2['app_hardware_acceleration_enabled'] = importDefault(dependencyMap[48]).getAppHardwareAccelerationEnabled(); object2['media_session_id'] = this.getMediaSessionId(); object2['sender_user_id'] = a0; object2['reason'] = 'User disconnected'; object2['participant_type'] = 'receiver'; getRegion = RTCRegionStore.getRegion; hostname = this.hostname; object2['guild_region'] = Reflect.apply(getRegion, RTCRegionStore, [hostname]); hostname = this.hostname; object2['hostname'] = hostname; object2['hardware_enabled'] = MediaEngineStore.getHardwareEncoding(); copyDataProperties(object2, inboundStats, RTCRegionStore); copyDataProperties(object2, _videoQuality.getNetworkStats(), RTCRegionStore); copyDataProperties(object2, _videoQuality.getCodecUsageStats('receiver', a0), RTCRegionStore); Reflect.apply(track, defaultImport, [VIDEO_STREAM_ENDED, object2]); _videoQuality.destroyUser(a0); _videoHealthManager = this._videoHealthManager; if (_videoHealthManager != null) { _videoHealthManager.deleteUser(a0); } } } } } const _connection = this._connection; if (_connection != null) { _connection.destroyUser(a0); } let _localMediaSinkWantsManager = this._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager.destroyUser(a0); } this._userIds.delete(a0); const emit = this.emit; value = environment.__proto__; const RTCConnectionEvent = require(dependencyMap[41]).RTCConnectionEvent; const ClientDisconnect = RTCConnectionEvent.ClientDisconnect; Reflect.apply(emit, this, [ClientDisconnect, a0]); _localMediaSinkWantsManager = this._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager.updateCallUserIds(this._userIds); } _videoQuality = this._videoQuality; if (_videoQuality != null) { _videoQuality.updateCallUserIdsCount(this._userIds.size); } if (this._userIds.size === 1) { value = require(dependencyMap[22]); this._secureFramesLastBecameAloneTime = value.now(); } } function value_36786(a0, a1) { // fn#36786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:44751, offset: 0x01097120, size: 153 bytes, params: 3, frame: 19 var logger; const value = a0; const value2 = a1; const _connection = this._connection; if (_connection == null) { logger = this.logger; logger.warn('Cannot set codecs on connection with protocol:', this.protocol); } else if (this.protocol != null) { _connection.setCodecs(value == null ? Codecs.OPUS : value !== '' ? value : Codecs.OPUS, value2 == null ? Codecs.H264 : value2 !== '' ? value2 : Codecs.H264, this.context); this._hasCodecs = true; this._trackVoiceConnectionSuccess(_connection); } else { logger = this.logger; logger.warn('Cannot set codecs on connection with protocol:', this.protocol); } } function value_36787(a0) { // fn#36787, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:45076, offset: 0x010971b9, size: 859 bytes, params: 2, frame: 27 var environment; var r14; var r13; var state; var value; var shouldIncludePreferredRegion2; var value2; var _connectCount; var settings; var value5; var value6; var defaultImport; var track; var VOICE_CONNECTION_SUCCESS; var object2; var protocol; var value7; var stateHistory; var value18; var defaultImport2; var VOICE_CONNECTION_TTC_COLLECTED; var transportInfo; var onConnectCallbackAt; var onVideoCodecsCallbackAt; var onEncryptionModesCallbackAt; const closure = function(a0, a1) { var value = null; return value == a0 || value == a1 ? value : a0 - a1; }; if (!this._voiceConnectionSuccessTracked) { state = this.state; value = environment.__proto__; if (state === RTCConnectionStates.RTC_CONNECTED) { if (this._hasCodecs) { this._voiceConnectionSuccessTracked = true; shouldIncludePreferredRegion2 = RTCRegionStore.shouldIncludePreferredRegion(); value2 = null; r14 = shouldIncludePreferredRegion2 ? RTCRegionStore.getPreferredRegion() : value2; _connectCount = this._connectCount; settings = MediaEngineStore.getSettings(); value5 = this._getAnalyticsProperties(); value6 = undefined; defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = defaultImport.track; VOICE_CONNECTION_SUCCESS = AnalyticEvents.VOICE_CONNECTION_SUCCESS; object2 = {}; copyDataProperties(object2, value5, undefined); object2['hostname'] = this.hostname; object2['port'] = this.port; protocol = this.protocol; object2['protocol'] = protocol; object2['cloudflare_best_region'] = r14; value7 = (require(4303) /* metro dependency 4303: TimeUtils */).now(); r13 = _connectCount === 1 ? this._createdTime : this._connectStartTime; object2['connect_time'] = value7 - r13; _connectCount = this._connectCount; object2['connect_count'] = _connectCount; object2['audio_subsystem'] = MediaEngineStore.getMediaEngine().getAudioSubsystem(); object2['audio_layer'] = MediaEngineStore.getMediaEngine().getAudioLayer(); object2['automatic_audio_subsystem'] = settings.automaticAudioSubsystem; object2['media_session_id'] = this.getMediaSessionId(); object2['participant_type'] = this.getVoiceParticipantType(); object2['join_voice_id'] = this.joinVoiceId; r13 = MediaEngineStore.getMediaEngine().getVideoInputDeviceId() !== DISABLED_DEVICE_ID && a0.context === MediaEngineContextTypes.DEFAULT; object2['is_camera_enabled'] = r13; stateHistory = this.stateHistory; copyDataProperties(object2, stateHistory.getVoiceConnectionSuccessStats(), protocol); Reflect.apply(track, defaultImport, [VOICE_CONNECTION_SUCCESS, object2]); value18 = global.performance.now(); defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = defaultImport2.track; VOICE_CONNECTION_TTC_COLLECTED = AnalyticEvents.VOICE_CONNECTION_TTC_COLLECTED; object2 = {}; object2.rtc_connection_id = value5.rtc_connection_id; object2.time_1_creation_to_connect = this._connectStartTime - this._createdTime; object2.time_2_media_engine_connect = this._mediaEngineConnectDuration; transportInfo = a0.transportInfo; object2.time_3_media_engine_create_native_connection = value2 == transportInfo ? value6 : transportInfo.createConnectionTime; transportInfo = a0.transportInfo; object2.time_4_media_engine_connect_to_socket = value2 == transportInfo ? value6 : transportInfo.connectTime; onConnectCallbackAt = a0.onConnectCallbackAt; transportInfo = a0.transportInfo; object2.time_5_scheduling_connected_callback = closure(onConnectCallbackAt, value2 == transportInfo ? value6 : transportInfo.connectCallbackScheduledMs); onConnectCallbackAt = a0.onConnectCallbackAt; object2.time_6_state_connected_to_end_measure = closure(value18, onConnectCallbackAt); _connectCount = this._connectCount; object2.connect_count = _connectCount; onConnectCallbackAt = a0.onConnectCallbackAt; object2.rtc_connecting_native_connect = closure(onConnectCallbackAt, a0.beginInitializeAt); onVideoCodecsCallbackAt = a0.onVideoCodecsCallbackAt; onConnectCallbackAt = a0.onConnectCallbackAt; object2.rtc_connecting_native_codecs = closure(onVideoCodecsCallbackAt, onConnectCallbackAt); onEncryptionModesCallbackAt = a0.onEncryptionModesCallbackAt; onVideoCodecsCallbackAt = a0.onVideoCodecsCallbackAt; object2.rtc_connecting_native_crypto_modes = closure(onEncryptionModesCallbackAt, onVideoCodecsCallbackAt); Reflect.apply(track, defaultImport2, [VOICE_CONNECTION_TTC_COLLECTED, object2]); } } } } function value_36790(a0) { // fn#36790, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:47284, offset: 0x01097580, size: 259 bytes, params: 2, frame: 21 this._mediaSessionId = a0; const logger = this.logger; logger.info('Setting media-session-id: ' + a0 + ' for rtc-connection-id: ' + this.getRTCConnectionId()); value = environment.__proto__; const rawThermalState = (importDefault(8093) /* metro dependency 8093: ThermalUtilsNative */).getRawThermalState(); const defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */; const track = defaultImport2.track; const MEDIA_SESSION_JOINED = AnalyticEvents.MEDIA_SESSION_JOINED; let object2 = {}; copyDataProperties(object2, this._getAnalyticsProperties(), undefined); object2['media_session_id'] = this.getMediaSessionId(); object2['parent_media_session_id'] = this.parentMediaSessionId; object2['raw_thermal_state'] = rawThermalState; Reflect.apply(track, defaultImport2, [MEDIA_SESSION_JOINED, object2]); value = importDefault(694) /* metro dependency 694: Dispatcher */; const dispatch = value.dispatch; object2 = {type: 'MEDIA_SESSION_JOINED'}; object2.mediaSessionId = this.getMediaSessionId(); object2.context = this.context; Reflect.apply(dispatch, value, [object2]); } function value_36791(a0) { // fn#36791, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:47792, offset: 0x01097683, size: 181 bytes, params: 2, frame: 16 const _connection = this._connection; const logger = this.logger; const info = logger.info; const JSON = global.JSON; Reflect.apply(info, logger, ['Remote media sink wants: ' + JSON.stringify(a0)]); this._remoteVideoSinkWants = a0; value = environment.__proto__; value = importDefault(694) /* metro dependency 694: Dispatcher */; const dispatch = value.dispatch; const userId = this.userId; Reflect.apply(dispatch, value, [{type: 'RTC_CONNECTION_REMOTE_VIDEO_SINK_WANTS', context: this.context, wants: a0, channelId: this.channelId, guildId: this.guildId, userId: userId}]); if (_connection != null) { _connection.setRemoteVideoSinkWants(a0); } } function value_36794(a0) { // fn#36794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:48485, offset: 0x0109779d, size: 96 bytes, params: 2, frame: 15 var _connection; this._bandwidthEstimationExperiment = a0; let value = environment.__proto__; value = importDefault(12409) /* metro dependency 12409: BandwidthEstimationExperiment */; value = value.getMediaEngineExperiments(a0); if (value !== null && value.length !== 0) { _connection = this._connection; if (_connection != null) { _connection.setBandwidthEstimationExperiments(value); } } } function value_36795(a0) { // fn#36795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:48717, offset: 0x010977fd, size: 870 bytes, params: 2, frame: 23 var environment; var size; var value2; var defaultImport; var track; var SECURE_FRAMES_TRANSITION; var object2; var initReceivedTime; var initFinishedTime; var firstProposalsFinishedTime; var firstProposalsReceivedTime; var lastProposalsFinishedTime; var lastProposalsReceivedTime; var welcomeReceivedTime; var welcomeFinishedTime; var commitReceivedTime; var commitFinishedTime; var prepareReceivedTime; var prepareFinishedTime; var executeReceivedTime; var executeFinishedTime; const closure = function(a0, a1) { return a0 != null && a1 != null ? a0 - a1 : undefined; }; let _secureFramesTransitionStates = this._secureFramesTransitionStates; let value = _secureFramesTransitionStates.get(a0); if (value != null) { _secureFramesTransitionStates = this._secureFramesTransitionStates; size = _secureFramesTransitionStates.size; _secureFramesTransitionStates = this._secureFramesTransitionStates; _secureFramesTransitionStates.delete(a0); value2 = environment.__proto__; defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = defaultImport.track; SECURE_FRAMES_TRANSITION = AnalyticEvents.SECURE_FRAMES_TRANSITION; object2 = {}; copyDataProperties(object2, this._getAnalyticsProperties(), undefined); object2['media_session_id'] = this.getMediaSessionId(); object2['parent_media_session_id'] = this.parentMediaSessionId; object2['sender_user_id'] = this.userId; object2['transition_id'] = a0; object2['protocol_version'] = value.protocolVersion; initReceivedTime = value.initReceivedTime; object2['start_to_init_duration'] = closure(initReceivedTime, this._connectStartTime); initFinishedTime = value.initFinishedTime; initReceivedTime = value.initReceivedTime; object2['init_duration'] = closure(initFinishedTime, initReceivedTime); firstProposalsFinishedTime = value.firstProposalsFinishedTime; firstProposalsReceivedTime = value.firstProposalsReceivedTime; object2['first_proposals_duration'] = closure(firstProposalsFinishedTime, firstProposalsReceivedTime); lastProposalsFinishedTime = value.lastProposalsFinishedTime; lastProposalsReceivedTime = value.lastProposalsReceivedTime; object2['last_proposals_duration'] = closure(lastProposalsFinishedTime, lastProposalsReceivedTime); lastProposalsReceivedTime = value.lastProposalsReceivedTime; firstProposalsReceivedTime = value.firstProposalsReceivedTime; object2['duration_between_proposals'] = closure(lastProposalsReceivedTime, firstProposalsReceivedTime); object2['total_proposals_size'] = value.totalProposalsSize; object2['total_commit_welcome_size'] = value.totalCommitWelcomeSize; welcomeReceivedTime = value.welcomeReceivedTime; initFinishedTime = value.initFinishedTime; object2['welcome_wait_duration'] = closure(welcomeReceivedTime, initFinishedTime); welcomeFinishedTime = value.welcomeFinishedTime; welcomeReceivedTime = value.welcomeReceivedTime; object2['welcome_duration'] = closure(welcomeFinishedTime, welcomeReceivedTime); object2['welcome_size'] = value.welcomeSize; object2['welcome_error'] = value.welcomeError; commitReceivedTime = value.commitReceivedTime; lastProposalsFinishedTime = value.lastProposalsFinishedTime; object2['commit_wait_duration'] = closure(commitReceivedTime, lastProposalsFinishedTime); commitFinishedTime = value.commitFinishedTime; commitReceivedTime = value.commitReceivedTime; object2['commit_duration'] = closure(commitFinishedTime, commitReceivedTime); object2['commit_size'] = value.commitSize; object2['commit_error'] = value.commitError; prepareReceivedTime = value.prepareReceivedTime; object2['prepare_wait_duration'] = closure(prepareReceivedTime, this._secureFramesLastBecameAloneTime); prepareFinishedTime = value.prepareFinishedTime; prepareReceivedTime = value.prepareReceivedTime; object2['prepare_duration'] = closure(prepareFinishedTime, prepareReceivedTime); executeReceivedTime = value.executeReceivedTime; object2['execute_wait_duration'] = closure(executeReceivedTime, value.readyTime); executeFinishedTime = value.executeFinishedTime; executeReceivedTime = value.executeReceivedTime; object2['execute_duration'] = closure(executeFinishedTime, executeReceivedTime); object2['execute_error'] = value.executeError; object2['incomplete'] = value.incomplete; object2['active_transition_count'] = size; object2['time_since_creation'] = (require(4303) /* metro dependency 4303: TimeUtils */).now() - value.creationTime; object2['users_added_count'] = value.usersAdded; object2['users_removed_count'] = value.usersRemoved; object2['roster_size_after'] = value.rosterSizeAfter; executeFinishedTime = value.executeFinishedTime; initReceivedTime = value.initReceivedTime; value = closure(executeFinishedTime, initReceivedTime); object2['init_to_finish_duration'] = value; Reflect.apply(track, defaultImport, [SECURE_FRAMES_TRANSITION, object2]); if (a0 === 0) { this._trackRemainingSecureFrameTransitions(); } } } function value_36797() { // fn#36797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:51002, offset: 0x01097b83, size: 34 bytes, params: 1, frame: 11 this._secureFramesTransitionStates.forEach(_fun36798); } function value_36799(a0) { // fn#36799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:51171, offset: 0x01097bc9, size: 95 bytes, params: 2, frame: 14 var r4; var object2; var value; if (this._secureFramesNextTransitionState == null) { object2 = {}; value = environment.__proto__; value = require(4303) /* metro dependency 4303: TimeUtils */; object2.creationTime = value.now(); this._secureFramesNextTransitionState = object2; r4 = require; } object2 = {}; copyDataProperties(object2, this._secureFramesNextTransitionState, r4); copyDataProperties(object2, a0, r4); this._secureFramesNextTransitionState = object2; return object2; } function value_36800(a0, a1) { // fn#36800, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:51439, offset: 0x01097c28, size: 134 bytes, params: 3, frame: 15 var r5; let _secureFramesTransitionStates = this._secureFramesTransitionStates; let value = _secureFramesTransitionStates.get(a0); if (value != null) { r5 = value; } else { value = this._storeSecureFrameNextTransitionData({}); this._secureFramesNextTransitionState = undefined; r5 = value; } _secureFramesTransitionStates = this._secureFramesTransitionStates; const set = _secureFramesTransitionStates.set; const object2 = {}; copyDataProperties(object2, a1, copyDataProperties(object2, r5, r5)); Reflect.apply(set, _secureFramesTransitionStates, [a0, object2]); const Math = global.Math; this._secureFramesMaxConcurrentTransitions = Math.max(this._secureFramesMaxConcurrentTransitions, this._secureFramesTransitionStates.size); } function value_36801(a0) { // fn#36801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:51833, offset: 0x01097cae, size: 306 bytes, params: 2, frame: 20 var _connection; var _storeSecureFrameNextTransitionData; const env0_1 = a0; const value2 = (require(4303) /* metro dependency 4303: TimeUtils */).now(); const recordEvent = this.recordEvent; let object2 = {}; const SECURE_FRAMES_INIT = env1_37.SECURE_FRAMES_INIT; object2.c = SECURE_FRAMES_INIT; object2.v = a0; Reflect.apply(recordEvent, this, [object2]); if (a0 > 0) { this.logger.info('DAVE protocol init with protocol version: ' + a0); this._mlsInitReceivedTime = value2; _connection = this._connection; if (_connection != null) { _connection.prepareSecureFramesEpoch('1', a0, this.trueChannelId); } this._sendMLSKeyPackage(); _storeSecureFrameNextTransitionData = this._storeSecureFrameNextTransitionData; object2 = {initReceivedTime: value2}; object2.initFinishedTime = (require(4303) /* metro dependency 4303: TimeUtils */).now(); object2.protocolVersion = a0; Reflect.apply(_storeSecureFrameNextTransitionData, this, [object2]); this.recordEvent({c: env1_37.MLS_INIT}); } else { _connection = this._connection; if (_connection != null) { _connection.prepareSecureFramesTransition(0, a0, _fun36802); } } } function value_36803(a0, a1) { // fn#36803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:52683, offset: 0x01097e94, size: 166 bytes, params: 3, frame: 15 var environment; const env0_2 = 0; const env0_3 = 0; const Object = global.Object; Object.entries(a0).forEach(_fun36804); this._storeSecureFrameTransitionData(a1, {usersAdded: env0_2, usersRemoved: env0_3, rosterSizeAfter: this._secureFramesRosterMap.size}); const emit = this.emit; value = environment.__proto__; const RTCConnectionEvent = (require(4405) /* metro dependency 4405: RTCConnectionEvent */).RTCConnectionEvent; const RosterMapUpdate = RTCConnectionEvent.RosterMapUpdate; Reflect.apply(emit, this, [RosterMapUpdate, []]); } function value_36805(a0, a1) { // fn#36805, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:53106, offset: 0x01097fdf, size: 188 bytes, params: 3, frame: 19 var environment; const env0_1 = a0; const env0_2 = a1; this.logger.info('Preparing DAVE protocol transition: ' + a0 + ', protocol version: ' + a1); const _secureFramesTransitionPrepareCount = this._secureFramesTransitionPrepareCount; this._secureFramesTransitionPrepareCount = typeof _secureFramesTransitionPrepareCount === 'bigint' ? _secureFramesTransitionPrepareCount + 1n : +_secureFramesTransitionPrepareCount + 1; const value = environment.__proto__; const env0_3 = (require(4303) /* metro dependency 4303: TimeUtils */).now(); if (a1 === 0) { this._trackMLSFailures({'recovered': true, 'downgraded': true}); } const _connection = this._connection; if (_connection != null) { _connection.prepareSecureFramesTransition(a0, a1, _fun36806); } } function value_36807(a0, a1) { // fn#36807, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:53620, offset: 0x010980fa, size: 189 bytes, params: 3, frame: 18 var moduleValue; this.logger.info('Preparing DAVE protocol epoch: ' + a0 + ', protocol version: ' + a1); let value = a0.toString(); const _connection = this._connection; if (_connection != null) { _connection.prepareSecureFramesEpoch(value, a1, this.trueChannelId); } if (value === '1') { value = environment.__proto__; moduleValue = require(4303) /* metro dependency 4303: TimeUtils */; this._mlsInitReceivedTime = moduleValue.now(); this._sendMLSKeyPackage(); this.recordEvent({c: env1_37.MLS_INIT}); } } function value_36808() { // fn#36808, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:53964, offset: 0x010981b7, size: 41 bytes, params: 1, frame: 11 const _connection = this._connection; if (_connection != null) { _connection.getMLSKeyPackage(_fun36809); } } function value_36810(a0) { // fn#36810, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:54205, offset: 0x0109821e, size: 135 bytes, params: 2, frame: 16 var _socket; var _storeSecureFrameTransitionData; var object2; var value; if (a0 !== 0) { this.logger.info('Sending DAVE protocol ready for transition ID ' + a0); _socket = this._socket; if (_socket != null) { _socket.secureFramesReadyForTransition(a0); } _storeSecureFrameTransitionData = this._storeSecureFrameTransitionData; object2 = {}; value = environment.__proto__; value = require(4303) /* metro dependency 4303: TimeUtils */; object2.readyTime = value.now(); Reflect.apply(_storeSecureFrameTransitionData, this, [a0, object2]); } } function value_36811(a0) { // fn#36811, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:54483, offset: 0x010982a5, size: 247 bytes, params: 2, frame: 20 var r5; var _connection; var value4; var error; var value5; var defaultImport; this.logger.info('Executing DAVE protocol transition: ' + a0); const _secureFramesTransitionExecuteCount = this._secureFramesTransitionExecuteCount; this._secureFramesTransitionExecuteCount = typeof _secureFramesTransitionExecuteCount === 'bigint' ? _secureFramesTransitionExecuteCount + 1n : +_secureFramesTransitionExecuteCount + 1; const value = environment.__proto__; const value2 = (require(4303) /* metro dependency 4303: TimeUtils */).now(); const value3 = false; try { _connection = this._connection; value4 = _connection == null; if (value4) { r5 = value3; } else { _connection.executeSecureFramesTransition(a0); r5 = value3; } } catch (error) { value5 = true; defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */; defaultImport.captureException(error); r5 = value5; } const _storeSecureFrameTransitionData = this._storeSecureFrameTransitionData; const object2 = {executeReceivedTime: value2}; object2.executeFinishedTime = (require(4303) /* metro dependency 4303: TimeUtils */).now(); object2.executeError = r5; Reflect.apply(_storeSecureFrameTransitionData, this, [a0, object2]); this._trackSecureFrameTransition(a0); } function value_36813(a0, a1) { // fn#36813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:55107, offset: 0x010983d4, size: 115 bytes, params: 3, frame: 16 var environment; const env0_1 = a0; const env0_2 = a1; const value = environment.__proto__; const env0_3 = (require(4303) /* metro dependency 4303: TimeUtils */).now(); this.logger.info('Received MLS proposals'); const _connection = this._connection; if (_connection != null) { _connection.processMLSProposals(a1, _fun36814); } } function value_36815(a0, a1) { // fn#36815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:55774, offset: 0x01098520, size: 134 bytes, params: 3, frame: 18 var environment; const env0_1 = a0; const env0_2 = a1; this.logger.info('Received MLS commit for transition ID ' + a0); const value = environment.__proto__; const env0_3 = (require(4303) /* metro dependency 4303: TimeUtils */).now(); const _connection = this._connection; if (_connection != null) { _connection.prepareMLSCommitTransition(a0, a1, _fun36816); } } function value_36817(a0, a1) { // fn#36817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:56515, offset: 0x010986c5, size: 134 bytes, params: 3, frame: 18 var environment; const env0_1 = a0; const env0_2 = a1; this.logger.info('Received MLS welcome for transition ID ' + a0); const value = environment.__proto__; const env0_3 = (require(4303) /* metro dependency 4303: TimeUtils */).now(); const _connection = this._connection; if (_connection != null) { _connection.processMLSWelcome(a0, a1, _fun36818); } } function value_36821(a0, a1) { // fn#36821, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:57498, offset: 0x010988b6, size: 381 bytes, params: 3, frame: 22 var object2; var defaultImport; var show; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const value2 = undefined; const value3 = (require(4303) /* metro dependency 4303: TimeUtils */).now(); const _nextFailureId = this._nextFailureId; const value4 = typeof _nextFailureId === 'bigint' ? _nextFailureId : +_nextFailureId; this._nextFailureId = typeof value4 === 'bigint' ? value4 + 1n : +value4 + 1; const recordEvent = this.recordEvent; const MLS_FAILURE = env1_37.MLS_FAILURE; Reflect.apply(recordEvent, this, [{c: MLS_FAILURE, i: value4}]); const _mlsFailures = this._mlsFailures; const push = _mlsFailures.push; object2 = {id: value4, source: a0, reason: a1}; const value5 = 1; object2.count = value5; object2.countDuringReset = this._mlsSessionResetStartTime != null ? value5 : 0; object2.firstOccurrence = value3; object2.timeSinceInit = this._mlsInitReceivedTime != null ? value3 - this._mlsInitReceivedTime : value2; object2.eventLog = getEventHistoryString(); Reflect.apply(push, _mlsFailures, [object2]); if (a0.includes('GetPersistedKeyPair')) { defaultImport = importDefault(4647) /* metro dependency 4647: AlertActionCreators */; show = defaultImport.show; object2 = {}; object2.title = intl.string(t.fJUioH); object2.body = intl.string(t.CQLWvo); Reflect.apply(show, defaultImport, [object2]); } else { this._alertMLSFailureDebouced(a0, a1); } return value2; } function value_36822({recovered, downgraded}) { // fn#36822, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:58059, offset: 0x01098a33, size: 444 bytes, params: 2, frame: 48 var r21; var r3; var value5; var value8; var id; var source; var reason; var count; var countDuringReset; var firstOccurrence; var timeSinceInit; var eventLog; var defaultImport; var track; var MLS_FAILURES; var object2; var _getAnalyticsProperties; var parentMediaSessionId; var _createdTime; var _connectionSerial; var value9; const value3 = (require(4303) /* metro dependency 4303: TimeUtils */).now(); const mediaSessionId = this.getMediaSessionId(); let _mlsSessionResetStartTime = this._mlsSessionResetStartTime; reducibleJoin2: while (true) { if (_mlsSessionResetStartTime != null) { _mlsSessionResetStartTime = this._mlsSessionResetStartTime; value5 = value3 - _mlsSessionResetStartTime; r21 = value5; break reducibleJoin2; } r21 = undefined; break reducibleJoin2; } const value6 = _createForOfIteratorHelperLoose_36646(this._mlsFailures); const value7 = value6(); let done = value7.done; if (!done) { r3 = value7; reducibleLoop3: while (true) { value8 = r3.value; id = value8.id; source = value8.source; reason = value8.reason; count = value8.count; countDuringReset = value8.countDuringReset; firstOccurrence = value8.firstOccurrence; timeSinceInit = value8.timeSinceInit; eventLog = value8.eventLog; defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = defaultImport.track; MLS_FAILURES = AnalyticEvents.MLS_FAILURES; object2 = {}; _getAnalyticsProperties = this._getAnalyticsProperties; copyDataProperties(object2, Reflect.apply(_getAnalyticsProperties, this, []), _getAnalyticsProperties); object2['media_session_id'] = mediaSessionId; parentMediaSessionId = this.parentMediaSessionId; object2['parent_media_session_id'] = parentMediaSessionId; object2['failure_id'] = id; _createdTime = this._createdTime; object2['failure_time'] = firstOccurrence - _createdTime; object2['failure_source'] = source; object2['failure_reason'] = reason; object2['failure_count'] = count; object2['failure_was_recovered'] = recovered; object2['failure_cleared_by_downgrade'] = downgraded; object2['time_since_first_occurrence'] = value3 - firstOccurrence; object2['time_since_last_reset'] = r21; object2['failure_count_during_reset'] = countDuringReset; object2['time_since_init'] = timeSinceInit; object2['event_history'] = eventLog; _connectionSerial = this._connectionSerial; object2['connection_serial'] = _connectionSerial; Reflect.apply(track, defaultImport, [MLS_FAILURES, object2]); value9 = value6(); done = value9.done; if (done) { break reducibleLoop3; } r3 = value9; continue reducibleLoop3; } } this._mlsFailures = []; } function value_36823(a0, a1) { // fn#36823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:58924, offset: 0x01098bef, size: 167 bytes, params: 3, frame: 16 const value = environment.__proto__; const currentUser = UserStore.getCurrentUser(); let r1 = currentUser != null && currentUser.isStaff(); r1 = !r1 ? currentUser != null && currentUser.isStaffPersonal() : r1; if (r1) { (importDefault(4647) /* metro dependency 4647: AlertActionCreators */).show({title: 'MLS Error in ' + a0, body: 'Error: ' + a1 + '! Please upload your logs in A/V settings and ask everyone in the call to do the same, and ping us in #av-e2ee in Core Tech!'}); } } function value_36825({length}) { // fn#36825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:59305, offset: 0x01098c96, size: 93 bytes, params: 2, frame: 13 var r0; var value3; if (length > 10) { return false; } let value = this.getMediaSessionId(); const value2 = value != null; if (value2) { value3 = environment.__proto__; value = (importDefault(1225) /* metro dependency 1225 */).v3(value); value = value % 100 <= 5; r0 = value; } else { r0 = value2; } return r0; } function value_36826() { // fn#36826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:59444, offset: 0x01098cf3, size: 49 bytes, params: 1, frame: 10 let value = environment.__proto__; value = MediaEngineStore.getInputDeviceId(); const getInputDevices = MediaEngineStore.getInputDevices; return Reflect.apply(getInputDevices, MediaEngineStore, [])[value]?.name; } function value_36827() { // fn#36827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:59573, offset: 0x01098d24, size: 49 bytes, params: 1, frame: 10 let value = environment.__proto__; value = MediaEngineStore.getOutputDeviceId(); const getOutputDevices = MediaEngineStore.getOutputDevices; return Reflect.apply(getOutputDevices, MediaEngineStore, [])[value]?.name; } function value_36828() { // fn#36828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:59703, offset: 0x01098d55, size: 49 bytes, params: 1, frame: 10 let value = environment.__proto__; value = MediaEngineStore.getVideoDeviceId(); const getVideoDevices = MediaEngineStore.getVideoDevices; return Reflect.apply(getVideoDevices, MediaEngineStore, [])[value]?.name; } function reconnect() { // fn#36655, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:3085, owner: RTCConnection.reconnect, offset: 0x01091cbe, size: 226 bytes, params: 1, frame: 14 var _connectCount; let binding = env0_0; const recordEvent = binding.recordEvent; const RECONNECT = env2_37.RECONNECT; Reflect.apply(recordEvent, binding, [{c: RECONNECT}]); const _socket = env0_0._socket; if (_socket != null) { if (env0_0._hasEverConnected) { env0_0._connectStartTime = (require(4303) /* metro dependency 4303: TimeUtils */).now(); } if (!env0_0._connecting) { env0_0._trackVoiceConnectionConnecting(); env0_0._connecting = true; env0_0._encountered_socket_failure = false; env0_0._voiceConnectionSuccessTracked = false; } binding = env0_0; _connectCount = binding._connectCount; binding._connectCount = typeof _connectCount === 'bigint' ? _connectCount + 1n : +_connectCount + 1; env0_0.reconnecting = true; _socket.close(); _socket.connect(); } } function _handleNetworkOnline() { // fn#36656, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:3488, owner: RTCConnection._handleNetworkOnline, offset: 0x01091da0, size: 35 bytes, params: 1, frame: 13 env0_0.expeditedHeartbeat(5000, 'network detected online.'); } function _handleNetworkOffline() { // fn#36657, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:3571, owner: RTCConnection._handleNetworkOffline, offset: 0x01091dc3, size: 38 bytes, params: 1, frame: 15 env0_0.expeditedHeartbeat(15000, 'network detected offline.', false); } function _handleNoRoute() { // fn#36658, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:3652, owner: RTCConnection._handleNoRoute, offset: 0x01091de9, size: 35 bytes, params: 1, frame: 9 const _socket = env0_0._socket; if (_socket != null) { _socket.noRoute(); } } function _handlePowerResume() { // fn#36659, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:3718, owner: RTCConnection._handlePowerResume, offset: 0x01091e0c, size: 35 bytes, params: 1, frame: 13 env0_0.expeditedHeartbeat(5000, 'power monitor resumed'); } function _handleVoiceQualityPeriodicsStats() { // fn#36660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:3810, owner: RTCConnection._handleVoiceQualityPeriodicsStats, offset: 0x01091e2f, size: 616 bytes, params: 1, frame: 45 var r35; var r2; var getPeriodicStats; var value2; var binding; var shouldReportPeriodicStats; var value3; var value4; var value5; var done; var value6; var defaultImport; var track; var VOICE_QUALITY_PERIODIC_STATS; var object2; var _getAnalyticsProperties; var getMediaSessionId; var userId; var hostname; var silent; var normal; var merged; var expanded; var accelerated; var preemptiveExpanded; var cng; var accelerateRate; var expandRate; var preemptiveExpandRate; var speechExpandRate; var durationMs; var _voiceQualityPeriodicStatsSequenceId; var getInputDeviceName; var getOutputDeviceName; var Math; var round; var getAveragePing; var _pingBadCount; var parentMediaSessionId; var value7; let _voiceQuality = env0_0._voiceQuality; reducibleJoin5: while (true) { if (_voiceQuality == null) { break reducibleJoin5; } _voiceQuality = env0_0._voiceQuality; getPeriodicStats = _voiceQuality.getPeriodicStats; value2 = Reflect.apply(getPeriodicStats, _voiceQuality, []); binding = env0_0; shouldReportPeriodicStats = binding.shouldReportPeriodicStats; reducibleJoin4: while (true) { if (!Reflect.apply(shouldReportPeriodicStats, binding, [value2])) { break reducibleJoin4; } value3 = environment.__proto__.__proto__; value4 = _createForOfIteratorHelperLoose_36646(value2); value5 = value4(); done = value5.done; if (done) { break reducibleJoin4; } r2 = value5; reducibleLoop3: while (true) { value6 = r2.value; defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = defaultImport.track; VOICE_QUALITY_PERIODIC_STATS = AnalyticEvents.VOICE_QUALITY_PERIODIC_STATS; object2 = {}; binding = env0_0; _getAnalyticsProperties = binding._getAnalyticsProperties; copyDataProperties(object2, Reflect.apply(_getAnalyticsProperties, binding, []), r35); binding = env0_0; getMediaSessionId = binding.getMediaSessionId; object2['media_session_id'] = Reflect.apply(getMediaSessionId, binding, []); userId = value6.userId; object2['sender_user_id'] = userId; hostname = env0_0.hostname; object2['hostname'] = hostname; silent = value6.silent; object2['frame_op_silent'] = silent; normal = value6.normal; object2['frame_op_normal'] = normal; merged = value6.merged; object2['frame_op_merged'] = merged; expanded = value6.expanded; object2['frame_op_expanded'] = expanded; accelerated = value6.accelerated; object2['frame_op_accelerated'] = accelerated; preemptiveExpanded = value6.preemptiveExpanded; object2['frame_op_preemptive_expanded'] = preemptiveExpanded; cng = value6.cng; object2['frame_op_cng'] = cng; accelerateRate = value6.accelerateRate; object2['accelerate_rate'] = accelerateRate; expandRate = value6.expandRate; object2['expand_rate'] = expandRate; preemptiveExpandRate = value6.preemptiveExpandRate; object2['preemptive_expand_rate'] = preemptiveExpandRate; speechExpandRate = value6.speechExpandRate; object2['speech_expand_rate'] = speechExpandRate; durationMs = value6.durationMs; object2['duration_ms'] = durationMs; _voiceQualityPeriodicStatsSequenceId = env0_0._voiceQualityPeriodicStatsSequenceId; object2['sequence_id'] = _voiceQualityPeriodicStatsSequenceId; binding = env0_0; getInputDeviceName = binding.getInputDeviceName; object2['input_device'] = Reflect.apply(getInputDeviceName, binding, []); binding = env0_0; getOutputDeviceName = binding.getOutputDeviceName; object2['output_device'] = Reflect.apply(getOutputDeviceName, binding, []); Math = global.Math; round = Math.round; binding = env0_0; getAveragePing = binding.getAveragePing; object2['ping_average'] = Reflect.apply(round, Math, [Reflect.apply(getAveragePing, binding, [])]); _pingBadCount = env0_0._pingBadCount; object2['ping_bad_count'] = _pingBadCount; parentMediaSessionId = env0_0.parentMediaSessionId; object2['parent_media_session_id'] = parentMediaSessionId; Reflect.apply(track, defaultImport, [VOICE_QUALITY_PERIODIC_STATS, object2]); value7 = value4(); done = value7.done; if (done) { break reducibleJoin4; } r2 = value7; r35 = binding; continue reducibleLoop3; } } binding = env0_0; _voiceQualityPeriodicStatsSequenceId = binding._voiceQualityPeriodicStatsSequenceId; binding._voiceQualityPeriodicStatsSequenceId = typeof _voiceQualityPeriodicStatsSequenceId === 'bigint' ? _voiceQualityPeriodicStatsSequenceId + 1n : +_voiceQualityPeriodicStatsSequenceId + 1; break reducibleJoin5; } } function getAudioDeviceStates() { // fn#36661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:4844, owner: RTCConnection.getAudioDeviceStates, offset: 0x01092097, size: 132 bytes, params: 1, frame: 15 const object2 = {}; object2.input_device = env0_0.getInputDeviceName(); let Object = global.Object; let keys = Object.keys; const getInputDevices = MediaEngineStore.getInputDevices; object2.input_device_count = Reflect.apply(keys, Object, [Reflect.apply(getInputDevices, MediaEngineStore, [])]).length; object2.output_device = env0_0.getOutputDeviceName(); Object = global.Object; keys = Object.keys; const getOutputDevices = MediaEngineStore.getOutputDevices; object2.output_device_count = Reflect.apply(keys, Object, [Reflect.apply(getOutputDevices, MediaEngineStore, [])]).length; return object2; } function getVideoDeviceStates() { // fn#36662, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:5069, owner: RTCConnection.getVideoDeviceStates, offset: 0x0109211b, size: 77 bytes, params: 1, frame: 13 const object2 = {}; object2.camera_device = env0_0.getVideoDeviceName(); const Object = global.Object; const keys = Object.keys; const getVideoDevices = MediaEngineStore.getVideoDevices; object2.camera_device_count = Reflect.apply(keys, Object, [Reflect.apply(getVideoDevices, MediaEngineStore, [])]).length; return object2; } function _trackVoiceConnectionConnecting() { // fn#36663, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:5208, owner: RTCConnection._trackVoiceConnectionConnecting, offset: 0x01092168, size: 350 bytes, params: 1, frame: 19 const value = environment.__proto__.__proto__; const channel = ChannelStore.getChannel(env0_0.channelId); const value4 = undefined; const type = channel == null ? value4 : channel.type; const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; const track = defaultImport.track; const VOICE_CONNECTION_CONNECTING = AnalyticEvents.VOICE_CONNECTION_CONNECTING; const object2 = {}; let binding = env0_0; const getAudioDeviceStates = binding.getAudioDeviceStates; copyDataProperties(object2, Reflect.apply(getAudioDeviceStates, binding, []), binding); binding = env0_0; const getVideoDeviceStates = binding.getVideoDeviceStates; copyDataProperties(object2, Reflect.apply(getVideoDeviceStates, binding, []), binding); object2['guild_id'] = env0_0.guildId; object2['channel_id'] = env0_0.channelId; object2['rtc_connection_id'] = env0_0.getRTCConnectionId(); object2['hostname'] = env0_0.hostname; object2['connect_count'] = env0_0._connectCount; object2['context'] = env0_0.context; object2['channel_type'] = type; object2['participant_type'] = env0_0.getVoiceParticipantType(); object2['is_muted'] = MediaEngineStore.isMute(); object2['join_voice_id'] = env0_0.joinVoiceId; object2['connection_serial'] = env0_0._connectionSerial; Reflect.apply(track, defaultImport, [VOICE_CONNECTION_CONNECTING, object2]); return value4; } function RTCConnectionIncomingVideoEnabledChanged(a0) { // fn#36664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:5701, owner: RTCConnection.incomingVideoEnabledChanged, offset: 0x010922c6, size: 66 bytes, params: 2, frame: 13 const _goLiveQualityManager = env0_0._goLiveQualityManager; if (_goLiveQualityManager != null) { _goLiveQualityManager.onIncomingVideoEnabled(a0); } const _videoQuality = env0_0._videoQuality; if (_videoQuality != null) { _videoQuality.setOcclusionIncomingVideoEnabled(a0); } } function windowVisibilityChanged(a0) { // fn#36665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:5868, owner: RTCConnection.windowVisibilityChanged, offset: 0x01092308, size: 42 bytes, params: 2, frame: 11 const _videoQuality = env0_0._videoQuality; if (_videoQuality != null) { _videoQuality.setWindowOcclusionState(!a0); } } function _fun36666(a0) { // fn#36666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:6048, offset: 0x01092332, size: 41 bytes, params: 2, frame: 12 const value = environment.__proto__.__proto__; (importDefault(1216) /* metro dependency 1216: SentryUtilsNative */).captureException(a0); } function _fun36667(a0) { // fn#36667, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:7874, offset: 0x0109235b, size: 168 bytes, params: 2, frame: 15 var logger; var _connection; const state = env0_0.state; const RTC_CONNECTED = RTCConnectionStates.RTC_CONNECTED; if (state === RTC_CONNECTED && env0_0._socket != null) { logger = env0_0.logger; logger.info('Media sink wants: ' + global.JSON.stringify(a0)); env0_0._socket.mediaSinkWants(a0); _connection = env0_0._connection; if (_connection != null) { _connection.setLocalVideoSinkWants(a0); } } } function _fun36668(a0, a1, a2) { // fn#36668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:8159, offset: 0x01092403, size: 45 bytes, params: 4, frame: 15 const _connection = env0_0._connection; if (_connection != null) { _connection.createUser(a0, a1, a2); } } function _fun36670(a0) { // fn#36670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:8517, offset: 0x01092430, size: 168 bytes, params: 2, frame: 15 var logger; var _connection; const state = env0_0.state; const RTC_CONNECTED = RTCConnectionStates.RTC_CONNECTED; if (state === RTC_CONNECTED && env0_0._socket != null) { logger = env0_0.logger; logger.info('Go Live Media sink wants: ' + global.JSON.stringify(a0)); env0_0._socket.mediaSinkWants(a0); _connection = env0_0._connection; if (_connection != null) { _connection.setLocalVideoSinkWants(a0); } } } function _fun36671(a0) { // fn#36671, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:9517, offset: 0x010924d8, size: 20 bytes, params: 2, frame: 2 env0_0._supportedBandwidthEstimationExperiments = a0; } function _fun36705(a0) { // fn#36705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:17706, offset: 0x010934d1, size: 153 bytes, params: 2, frame: 16 var r0; var r2; var r3; var r1; var item3; var value3; var value4; const iterator = a0[Symbol.iterator](); const iterator2 = iterator.next; let item2 = Reflect.apply(iterator2, iterator, []); let item = item2.value; item2 = item2.done ? undefined : iterator; let value = undefined; const value2 = item2 === value; const r5 = value2 ? value : item; if (value2) { r0 = item2; r2 = value; r3 = value2; } else { item3 = Reflect.apply(iterator2, item2, []); item = item3.value; item3 = item3.done ? undefined : item2; value3 = item3 === value; if (value3) { r0 = item3; r2 = value; r3 = value3; } else { r0 = item3; r2 = item; r3 = value3; } } if (!r3) { r0.return(); } const Number = global.Number; if (Number.isInteger(r5)) { r0 = r2 !== 0; } else { value4 = r5 !== 'any'; if (value4) { if (r5 !== 'pixelCounts') { r1 = value; } else { value = global.Object.values(r2); value = value.some(function(a0) { return a0 !== 0; }); r1 = value; } r0 = r1; } else { r0 = value4; } } return r0; } function _fun36730() { // fn#36730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:22426, offset: 0x01093df9, size: 168 bytes, params: 1, frame: 16 const binding = env0_1; const identify = binding.identify; const object2 = {}; const binding2 = env0_0; object2.serverId = binding2.trueServerId; object2.channelId = binding2.trueChannelId; const userId = binding2.userId; object2.userId = userId; object2.sessionId = binding2.sessionId; object2.token = token; object2.maxDaveProtocolVersion = MediaEngineStore.getSupportedSecureFramesProtocolVersion(); const supports = MediaEngineStore.supports; const VIDEO = Features.VIDEO; object2.video = Reflect.apply(supports, MediaEngineStore, [VIDEO]); object2.streamParameters = MediaEngineStore.getVideoStreamParameters(binding2.context); Reflect.apply(identify, binding, [object2]); const setState = binding2.setState; const AUTHENTICATING = RTCConnectionStates.AUTHENTICATING; Reflect.apply(setState, binding2, [AUTHENTICATING]); } function _fun36732(a0) { // fn#36732, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:23650, offset: 0x01094a3a, size: 356 bytes, params: 2, frame: 24 var defaultImport; var track; var VIDEO_STREAM_ENDED; var object2; var binding; var userId; var getRegion; var hostname; var _videoQualityBinding; var getCodecUsageStats; const num_frames = a0.num_frames; let value = 0; if ((num_frames ?? value) > value) { value = environment.__proto__.__proto__; defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = defaultImport.track; VIDEO_STREAM_ENDED = AnalyticEvents.VIDEO_STREAM_ENDED; object2 = {}; binding = env0_0; copyDataProperties(object2, binding._getAnalyticsProperties(), undefined); object2['app_hardware_acceleration_enabled'] = (importDefault(4488) /* metro dependency 4488: CrossPlatformNativeUtilsNative */).getAppHardwareAccelerationEnabled(); object2['media_session_id'] = binding.getMediaSessionId(); userId = binding.userId; object2['sender_user_id'] = userId; object2['reason'] = importAll; object2['participant_type'] = 'sender'; getRegion = RTCRegionStore.getRegion; hostname = binding.hostname; object2['guild_region'] = Reflect.apply(getRegion, RTCRegionStore, [hostname]); hostname = binding.hostname; object2['hostname'] = hostname; value = MediaEngineStore.getHardwareEncoding(); object2['hardware_enabled'] = value; copyDataProperties(object2, a0, RTCRegionStore); _videoQualityBinding = _videoQuality; copyDataProperties(object2, _videoQualityBinding.getNetworkStats(), RTCRegionStore); _videoQualityBinding = _videoQuality; getCodecUsageStats = _videoQualityBinding.getCodecUsageStats; userId = binding.userId; copyDataProperties(object2, Reflect.apply(getCodecUsageStats, _videoQualityBinding, ['sender', userId]), RTCRegionStore); value = (importDefault(5252) /* metro dependency 5252: getMediaPerformanceClassAndroid */)(); object2['device_performance_class'] = value; Reflect.apply(track, defaultImport, [VIDEO_STREAM_ENDED, object2]); } } function _fun36733(a0) { // fn#36733, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:24356, offset: 0x01094b9e, size: 343 bytes, params: 2, frame: 23 var value5; var defaultImport; var track; var VIDEO_STREAM_ENDED; var object2; var binding; var getRegion; var hostname; const inboundStats = _videoQuality.getInboundStats(a0); const value3 = undefined; const num_frames = inboundStats == null ? value3 : inboundStats.num_frames; const value4 = 0; if ((num_frames ?? value4) > value4) { value5 = environment.__proto__.__proto__; defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = defaultImport.track; VIDEO_STREAM_ENDED = AnalyticEvents.VIDEO_STREAM_ENDED; object2 = {}; binding = env0_0; copyDataProperties(object2, binding._getAnalyticsProperties(), undefined); object2['app_hardware_acceleration_enabled'] = (importDefault(4488) /* metro dependency 4488: CrossPlatformNativeUtilsNative */).getAppHardwareAccelerationEnabled(); object2['media_session_id'] = binding.getMediaSessionId(); object2['sender_user_id'] = a0; object2['reason'] = importAll; object2['participant_type'] = 'receiver'; getRegion = RTCRegionStore.getRegion; hostname = binding.hostname; object2['guild_region'] = Reflect.apply(getRegion, RTCRegionStore, [hostname]); hostname = binding.hostname; object2['hostname'] = hostname; object2['hardware_enabled'] = MediaEngineStore.getHardwareEncoding(); copyDataProperties(object2, inboundStats, RTCRegionStore); _videoQualityBinding = _videoQuality; copyDataProperties(object2, _videoQualityBinding.getNetworkStats(), RTCRegionStore); _videoQualityBinding = _videoQuality; copyDataProperties(object2, _videoQualityBinding.getCodecUsageStats('receiver', a0), RTCRegionStore); Reflect.apply(track, defaultImport, [VIDEO_STREAM_ENDED, object2]); } return value3; } function _fun36734(a0) { // fn#36734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:24930, offset: 0x01094cf5, size: 186 bytes, params: 2, frame: 18 const JSON = global.JSON; const value = JSON.parse(a0); if (value == null) { throw new global.Error('codec survey is not available'); } if (value.available_video_encoders == null) { throw new global.Error('codec survey is not available'); } if (value.available_video_decoders == null) { throw new global.Error('codec survey is not available'); } const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; const track = defaultImport.track; const VOICE_CODEC_DETECTED = AnalyticEvents.VOICE_CODEC_DETECTED; const object2 = {}; copyDataProperties(object2, value, undefined); object2['rtc_connection_id'] = env0_0.getRTCConnectionId(); object2['media_session_id'] = env0_4; Reflect.apply(track, defaultImport, [VOICE_CODEC_DETECTED, object2]); } function _fun36735(a0) { // fn#36735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:25201, offset: 0x01094daf, size: 30 bytes, params: 2, frame: 11 env0_0.logger.warn(a0); } function _fun36737() { // fn#36737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:28685, offset: 0x01094ddf, size: 32 bytes, params: 1, frame: 12 const env0_0 = env2_4(_fun36739); return _fun36740; } function _fun36741(a0) { // fn#36741, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:29037, offset: 0x01094e57, size: 351 bytes, params: 2, frame: 21 var r1; var r2; var r42; var batteryUsageRounded; var item3; var value3; var item4; var value4; var error; const iterator = a0[Symbol.iterator](); const iterator2 = iterator.next; const value = undefined; let item2 = Reflect.apply(iterator2, iterator, []); let item = item2.value; item2 = item2.done ? undefined : iterator; const value2 = item2 === value; let r4 = value2 ? value : item; try { batteryUsageRounded = r4.batteryUsageRounded; } catch (error) { if (!value2) { try { item2.return(); } catch { } } throw error; } if (value2) { r1 = item2; r2 = value2; r4 = value; } else { item3 = Reflect.apply(iterator2, item2, []); item = item3.value; item3 = item3.done ? undefined : item2; value3 = item3 === value; if (value3) { r1 = item3; r2 = value3; r4 = value; } else { r1 = item3; r2 = value3; r4 = item; } } if (r2) { r42 = value; } else { item4 = Reflect.apply(iterator2, r1, []); item = item4.value; item4 = item4.done ? undefined : r1; value4 = item4 === value; if (value4) { r1 = item4; r2 = value4; r42 = value; } else { r1 = item4; r2 = value4; r42 = item; } } if (!r2) { r1.return(); } const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; const track = defaultImport.track; const VOICE_DISCONNECT = AnalyticEvents.VOICE_DISCONNECT; const object2 = {}; copyDataProperties(object2, env0_5, environment); object2['battery_usage'] = batteryUsageRounded; object2['krisp_nc_model'] = r4; object2['duration_low_noise_detected_ms'] = r42 == null ? value : r42.lowNoiseMs; object2['duration_medium_noise_detected_ms'] = r42 == null ? value : r42.mediumNoiseMs; object2['duration_high_noise_detected_ms'] = r42 == null ? value : r42.highNoiseMs; object2['duration_noise_cancellation_voice_detected_ms'] = r42 == null ? value : r42.talkTimeMs; Reflect.apply(track, defaultImport, [VOICE_DISCONNECT, object2]); return value; } function _fun36744({height, framerate, videoCodec}) { // fn#36744, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:31861, offset: 0x010956c2, size: 227 bytes, params: 2, frame: 18 var r0; var ServerLadderExperiment; var value3; const AV1StreamBitrateReductionExperiment = (require(12400) /* metro dependency 12400: AV1BitrateTuningExperiment */).AV1StreamBitrateReductionExperiment; const r4 = height > 0 && height <= 720; value = framerate <= 30; if (result) { if (env0_6) { value3 = null; r0 = videoCodec !== 'AV1' ? value3 : height !== 0 ? r4 && value ? AV1StreamBitrateReductionExperiment.getConfig({location: 'RTCConnection'}).bitrate : value3 : framerate < 10 || r4 && value ? AV1StreamBitrateReductionExperiment.getConfig({location: 'RTCConnection'}).bitrate : value3; } else if (r4) { if (value) { value3 = null; r0 = videoCodec !== 'AV1' ? value3 : height !== 0 ? r4 && value ? AV1StreamBitrateReductionExperiment.getConfig({location: 'RTCConnection'}).bitrate : value3 : framerate < 10 || r4 && value ? AV1StreamBitrateReductionExperiment.getConfig({location: 'RTCConnection'}).bitrate : value3; } else { value = environment.__proto__.__proto__; ServerLadderExperiment = (require(12399) /* metro dependency 12399: ServerLadderExperiment */).ServerLadderExperiment; r0 = ServerLadderExperiment.getConfig({location: 'RTCConnection'}).bitrate; } } else { value3 = null; r0 = videoCodec !== 'AV1' ? value3 : height !== 0 ? r4 && value ? AV1StreamBitrateReductionExperiment.getConfig({location: 'RTCConnection'}).bitrate : value3 : framerate < 10 || r4 && value ? AV1StreamBitrateReductionExperiment.getConfig({location: 'RTCConnection'}).bitrate : value3; } } else { value3 = null; r0 = videoCodec !== 'AV1' ? value3 : height !== 0 ? r4 && value ? AV1StreamBitrateReductionExperiment.getConfig({location: 'RTCConnection'}).bitrate : value3 : framerate < 10 || r4 && value ? AV1StreamBitrateReductionExperiment.getConfig({location: 'RTCConnection'}).bitrate : value3; } return r0; } function _fun36745(a0, a1, a2) { // fn#36745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:32442, offset: 0x010957a5, size: 99 bytes, params: 4, frame: 17 const userId = env0_0.userId; if (userId === a0) { env0_0.sendSpeaking(a1, a2); } const binding = env0_0; const emit = binding.emit; const RTCConnectionEvent = (require(4405) /* metro dependency 4405: RTCConnectionEvent */).RTCConnectionEvent; const Speaking = RTCConnectionEvent.Speaking; Reflect.apply(emit, binding, [Speaking, a0, a1]); } function _fun36746(a0) { // fn#36746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:32602, offset: 0x01095808, size: 69 bytes, params: 2, frame: 11 const context = env0_0.context; const value = environment.__proto__.__proto__; const DEFAULT = MediaEngineContextTypes.DEFAULT; if (context === DEFAULT) { (importDefault(12401) /* metro dependency 12401: NativeMuteManagerNative */).nativeMuteChanged(a0); } } function _fun36747(a0, a1, a2, a3, a4, a5) { // fn#36747, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:32707, offset: 0x0109584d, size: 194 bytes, params: 7, frame: 25 const value = a2; const value2 = a3; const value3 = a4; const env0_0 = a0; let binding = env0_0; const value5 = 0; binding._handleVideoStreamId({userId: a0, streamId: a1, audioSsrc: value, videoSsrc: value2 ?? value5, rtxSsrc: value3, videoStreamParameters: a5}); const userId = env0_0.userId; if (userId === a0) { binding = env0_0; binding.sendVideo(value ?? value5, value2 ?? value5, value3 ?? value5, a5); if (a5 != null) { a5.forEach(_fun36748); } } } function _fun36749(a0, a1, a2) { // fn#36749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:33147, offset: 0x0109597e, size: 217 bytes, params: 4, frame: 23 var binding; var emit; var value2; const RTCConnectionEvent = (require(4405) /* metro dependency 4405: RTCConnectionEvent */).RTCConnectionEvent; if (env0_0._localMediaSinkWantsManager != null) { binding = env0_0; binding._localMediaSinkWantsManager.setFirstFrameReceived(a1); emit = binding.emit; value2 = environment.__proto__.__proto__; Reflect.apply(emit, binding, [RTCConnectionEvent.Video, binding.guildId, binding.channelId, a0, a2, binding.streamServerId]); } if (env0_0._goLiveQualityManager != null) { binding = env0_0; emit = binding.emit; value = environment.__proto__.__proto__; Reflect.apply(emit, binding, [RTCConnectionEvent.Video, binding.guildId, binding.channelId, a0, a2, binding.streamServerId]); } } function _fun36750(a0) { // fn#36750, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:33534, offset: 0x01095a57, size: 32 bytes, params: 2, frame: 3 const binding = env0_0; binding._inputDetected = binding._inputDetected || !a0; } function _fun36751(a0, a1) { // fn#36751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:33631, offset: 0x01095a77, size: 817 bytes, params: 3, frame: 25 var environment; var value2; var defaultImport; var binding3; var prototype; var value3; var defaultImport5; var _voiceQuality; var start; var defaultImport2; var binding4; var value6; var defaultImport22; var defaultImport3; var value9; var defaultImport32; var defaultImport4; var userId; var binding5; var value12; var defaultImport42; var _voiceDuration; var selfMute; var binding7; var binding8; var once; const SocketEvent = (require(12392) /* metro dependency 12392: RTCControlSocket */).SocketEvent; var SDP; var _handleSDP; var selectProtocol; var _selectedExperiments; var binding9; var rTCConnectionId; let binding = env0_0; let logger = binding.logger; let info = logger.info; Reflect.apply(info, logger, ['RTC connected to media server: ' + require + ':' + importDefault]); if (env0_1 === binding._socket) { binding = env0_0; value2 = environment.__proto__.__proto__; defaultImport = importDefault(12402) /* metro dependency 12402: VoiceQuality */; binding3 = env0_4; prototype = defaultImport.prototype; value3 = Object.create(prototype, {constructor: {value: defaultImport}}); defaultImport5 = new defaultImport(); binding._voiceQuality = defaultImport5 instanceof Object ? defaultImport5 : value3; _voiceQuality = binding._voiceQuality; _voiceQuality.start(); _voiceQuality = binding._voiceQuality; _voiceQuality.on((require(12402) /* metro dependency 12402: VoiceQuality */).VoiceQualityEvent.InputDeviceSampleRateChanged, _fun36752); binding._voiceQualityPeriodicStatsSequenceId = 0; binding._voiceQualityPeriodicStatsInterval = global.setInterval(binding._handleVoiceQualityPeriodicsStats, 300000); defaultImport2 = importDefault(12404) /* metro dependency 12404: SystemResponsiveness */; binding4 = env0_4; prototype = defaultImport2.prototype; value6 = Object.create(prototype, {constructor: {value: defaultImport2}}); defaultImport22 = new defaultImport2(); binding._systemResponsiveness = defaultImport22 instanceof Object ? defaultImport22 : value6; binding._systemResponsiveness.start(); defaultImport3 = importDefault(7137) /* metro dependency 7137: SystemResources */; prototype = defaultImport3.prototype; value9 = Object.create(prototype, {constructor: {value: defaultImport3}}); defaultImport32 = new defaultImport3(); binding._systemResources = defaultImport32 instanceof Object ? defaultImport32 : value9; binding._systemResources.setLastBattery(); binding._noiseCancellationError = 0; defaultImport4 = importDefault(12405) /* metro dependency 12405: VoiceDuration */; userId = binding.userId; binding5 = env0_4; prototype = defaultImport4.prototype; value12 = Object.create(prototype, {constructor: {value: defaultImport4}}); defaultImport42 = new defaultImport4(); binding._voiceDuration = defaultImport42 instanceof Object ? defaultImport42 : value12; _voiceDuration = binding._voiceDuration; start = _voiceDuration.start; selfMute = env0_4.getSelfMute(); binding7 = env0_4; Reflect.apply(start, _voiceDuration, [selfMute, binding7.getSelfDeaf()]); binding.protocol = a0; if (a0 === 'udp') { binding = env0_0; logger = binding.logger; info = logger.info; _selectedExperiments = binding._selectedExperiments; Reflect.apply(info, logger, ['Sending UDP info to RTC server.', a1, _selectedExperiments]); binding9 = env0_1; binding9.once(SocketEvent.Encryption, _fun36753); selectProtocol = binding9.selectProtocol; rTCConnectionId = binding.getRTCConnectionId(); _selectedExperiments = binding._selectedExperiments; Reflect.apply(selectProtocol, binding9, [a0, rTCConnectionId, a1, _selectedExperiments]); env0_0._backoff.succeed(); return undefined; } if (a0 === 'webrtc') { binding = env0_0; binding.logger.info('Sending local SDP to RTC server.'); binding8 = env0_1; once = binding8.once; SDP = SocketEvent.SDP; _handleSDP = binding._handleSDP; Reflect.apply(once, binding8, [SDP, _handleSDP.bind(binding)]); binding8.selectProtocol(a0, binding.getRTCConnectionId(), a1); env0_0._backoff.succeed(); return undefined; } logger = env0_0.logger; logger.error('Unable to determine protocol.'); } else { env0_0.logger.warn('Socket mismatch, disconnecting'); } } function _fun36754(a0) { // fn#36754, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:35092, offset: 0x01095e1c, size: 123 bytes, params: 2, frame: 15 let value = a0.filter(function(a0) { return a0.type === 'video'; }); value = value.map(function(a0) { return a0.name; }); value = value.join(','); env0_0.logger.info('The originally selected video encoder is not working, fallback to the other available encoders: ' + value); env0_1.updateSession({codecs: a0}); } function _fun36757(a0) { // fn#36757, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:35370, offset: 0x01095ea9, size: 229 bytes, params: 2, frame: 16 var environment; var binding; let value = environment.__proto__.__proto__; const channel = ChannelStore.getChannel(env0_0.channelId); const value4 = undefined; const type = channel == null ? value4 : channel.type; const GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE; if (type === GUILD_STAGE_VOICE) { if (!env0_0._videoDecoderFallbackSuppressed) { binding = env0_0; binding.logger.info('Suppressing video decoder fallback: stage channel'); binding._videoDecoderFallbackSuppressed = true; } } else { value = a0.filter(function(a0) { return a0.type === 'video'; }); value = value.map(_fun36759); value = value.join(','); env0_0.logger.info('The originally selected video decoder is not working, fallback to the other available decoders: ' + value); env0_1.updateSession({codecs: a0}); } return value4; } function _fun36760(a0) { // fn#36760, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:35873, offset: 0x01095f8e, size: 272 bytes, params: 2, frame: 18 var r6; var value2; var track; var VOICE_CONNECTION_FAILURE; var object2; var value; let binding = env0_1; if (binding === env0_0._socket) { value2 = environment.__proto__.__proto__; r6 = RTCRegionStore.shouldIncludePreferredRegion() ? RTCRegionStore.getPreferredRegion() : null; binding = env0_0; binding.logger.error('Error occurred while connecting to RTC server: ' + a0); value = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = value.track; VOICE_CONNECTION_FAILURE = AnalyticEvents.VOICE_CONNECTION_FAILURE; object2 = {}; copyDataProperties(object2, binding._getAnalyticsProperties(), undefined); object2['hostname'] = binding.hostname; object2['port'] = binding.port; object2['protocol'] = binding.protocol; object2['error'] = a0; object2['cloudflare_best_region'] = r6; object2['connect_count'] = binding._connectCount; object2['join_voice_id'] = binding.joinVoiceId; Reflect.apply(track, value, [VOICE_CONNECTION_FAILURE, object2]); } } function _fun36761(a0) { // fn#36761, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:36337, offset: 0x0109609e, size: 699 bytes, params: 2, frame: 19 var value2; var _backoff; var stateHistory; var _localMediaSinkWantsManager; var _goLiveQualityManager; let binding = env0_0; const logger = binding.logger; const info = logger.info; let state = binding.state; Reflect.apply(info, logger, ['RTC media connection state change: ' + state + ' => ' + a0]); if (env0_1 === binding._socket) { state = env0_0.state; value2 = environment.__proto__.__proto__; if (ConnectionStates.DISCONNECTED === a0) { binding = env0_0; binding.setState(RTCConnectionStates.RTC_DISCONNECTED); } else if (ConnectionStates.CONNECTING === a0) { binding = env0_0; binding.setState(RTCConnectionStates.RTC_CONNECTING); } else if (ConnectionStates.CONNECTED === a0) { binding = env0_0; binding.setState(RTCConnectionStates.RTC_CONNECTED); } else if (ConnectionStates.NO_ROUTE === a0) { binding = env0_0; binding.setState(RTCConnectionStates.NO_ROUTE); } else if (ConnectionStates.ICE_CHECKING === a0) { binding = env0_0; binding.setState(RTCConnectionStates.ICE_CHECKING); } else if (ConnectionStates.DTLS_CONNECTING === a0) { binding = env0_0; binding.setState(RTCConnectionStates.DTLS_CONNECTING); } if (state !== RTCConnectionStates.RTC_CONNECTING) { if (env0_0.state === RTCConnectionStates.NO_ROUTE) { _backoff = env0_0._backoff; if (_backoff.fails === 0) { env0_0._handleNoRoute(); } binding = env0_0; _backoff = binding._backoff; _backoff.fail(binding.reconnect); } } else if (env0_0.state === RTCConnectionStates.RTC_DISCONNECTED) { env0_0.reconnect(); } else if (env0_0.state === RTCConnectionStates.NO_ROUTE) { _backoff = env0_0._backoff; if (_backoff.fails === 0) { env0_0._handleNoRoute(); } binding = env0_0; _backoff = binding._backoff; _backoff.fail(binding.reconnect); } if (env0_0.state === RTCConnectionStates.RTC_CONNECTED) { _localMediaSinkWantsManager = env0_0._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null) { _localMediaSinkWantsManager.setConnection(env0_4); } _goLiveQualityManager = env0_0._goLiveQualityManager; if (_goLiveQualityManager != null) { _goLiveQualityManager.update(); } binding = env0_0; binding._connectCompletedTime = (require(4303) /* metro dependency 4303: TimeUtils */).now(); binding._hasEverConnected = true; binding._connecting = false; binding._encountered_socket_failure = false; binding._trackVoiceConnectionSuccess(env0_4); } else if (state === RTCConnectionStates.RTC_CONNECTED) { binding = env0_0; stateHistory = binding.stateHistory; stateHistory.reset(binding.state); } } } function _fun36762(a0) { // fn#36762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:37407, offset: 0x01096359, size: 66 bytes, params: 2, frame: 13 const binding = env0_0; binding._secureFramesState = a0; const emit = binding.emit; const RTCConnectionEvent = (require(4405) /* metro dependency 4405: RTCConnectionEvent */).RTCConnectionEvent; const SecureFramesUpdate = RTCConnectionEvent.SecureFramesUpdate; Reflect.apply(emit, binding, [SecureFramesUpdate]); } function _fun36763(a0) { // fn#36763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:38139, offset: 0x0109639b, size: 20 bytes, params: 2, frame: 2 env0_0._noiseCancellationError = a0; } function _fun36770(a0, a1, a2) { // fn#36770, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:39588, offset: 0x0109663c, size: 78 bytes, params: 4, frame: 16 var _videoHealthManager; const _localMediaSinkWantsManager = env0_0._localMediaSinkWantsManager; if (_localMediaSinkWantsManager != null && _localMediaSinkWantsManager.shouldReceiveFromUser(a0)) { _videoHealthManager = env0_0._videoHealthManager; if (_videoHealthManager != null) { _videoHealthManager.updateFps(a0, a1, a2); } } } function _fun36772(a0) { // fn#36772, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:40153, offset: 0x01096824, size: 81 bytes, params: 2, frame: 14 var _videoQuality; const ssrc = a0.ssrc; let value = 0; const r2 = ssrc ?? value; value = r2 > value; if (value && a0.active === true) { _videoQuality = env0_0._videoQuality; if (_videoQuality != null) { _videoQuality.setOutboundSsrc(r2); } } } function _fun36777(a0) { // fn#36777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:42010, offset: 0x01096b44, size: 108 bytes, params: 2, frame: 23 var binding; var emit; var value2; if (a0.quality === 100) { binding = env0_0; emit = binding.emit; value2 = environment.__proto__.__proto__; Reflect.apply(emit, binding, [(require(4405) /* metro dependency 4405: RTCConnectionEvent */).RTCConnectionEvent.VideoSourceQualityChanged, binding.guildId, binding.channelId, require, a0.maxResolution, a0.maxFrameRate, binding.context]); } } function _fun36784(a0) { // fn#36784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:43289, offset: 0x01096e7a, size: 56 bytes, params: 2, frame: 13 const binding = env0_0; binding._userIds.add(a0); const _connection = binding._connection; if (_connection != null) { _connection.createUser(a0, 0); } } function _fun36798(a0, a1) { // fn#36798, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:51057, offset: 0x01097ba5, size: 36 bytes, params: 3, frame: 11 a0.incomplete = true; env0_0._trackSecureFrameTransition(a1); } function _fun36802() { // fn#36802, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:52340, offset: 0x01097de0, size: 180 bytes, params: 1, frame: 18 var r2; var value2; var binding; var _connection; var value3; var error; var value4; var defaultImport; let value = false; try { value2 = environment; binding = env0_0; _connection = binding._connection; value3 = _connection == null; if (value3) { r2 = value; } else { _connection.executeSecureFramesTransition(0); r2 = value; } } catch (error) { value = true; value4 = environment.__proto__.__proto__; defaultImport = importDefault(1216) /* metro dependency 1216: SentryUtilsNative */; defaultImport.captureException(error); r2 = value; } binding = env0_0; const _storeSecureFrameTransitionData = binding._storeSecureFrameTransitionData; const object2 = {initReceivedTime: env0_2}; value = environment.__proto__.__proto__; object2.initFinishedTime = (require(4303) /* metro dependency 4303: TimeUtils */).now(); object2.protocolVersion = env0_1; object2.executeError = r2; Reflect.apply(_storeSecureFrameTransitionData, binding, [0, object2]); binding._trackSecureFrameTransition(0); } function _fun36804(a0) { // fn#36804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:52741, offset: 0x01097f3a, size: 165 bytes, params: 2, frame: 17 var r1; var r2; var r5; var item3; var value3; const iterator = a0[Symbol.iterator](); const iterator2 = iterator.next; let item2 = Reflect.apply(iterator2, iterator, []); let item = item2.value; item2 = item2.done ? undefined : iterator; const value = undefined; const value2 = item2 === value; const r3 = value2 ? value : item; if (value2) { r1 = item2; r2 = value2; r5 = value; } else { item3 = Reflect.apply(iterator2, item2, []); item = item3.value; item3 = item3.done ? undefined : item2; value3 = item3 === value; if (value3) { r1 = item3; r2 = value3; r5 = value; } else { r1 = item3; r2 = value3; r5 = item; } } if (!r2) { r1.return(); } let binding = env0_1; binding.push(r3); if (r5 == null) { binding = env0_3; env0_3 = typeof binding === 'bigint' ? binding + 1n : +binding + 1; env0_0._secureFramesRosterMap.delete(r3); } else if (r5.byteLength === 0) { binding = env0_3; env0_3 = typeof binding === 'bigint' ? binding + 1n : +binding + 1; env0_0._secureFramesRosterMap.delete(r3); } else { binding = env0_2; env0_2 = typeof binding === 'bigint' ? binding + 1n : +binding + 1; env0_0._secureFramesRosterMap.set(r3, r5); } return value; } function _fun36806() { // fn#36806, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:53401, offset: 0x0109809b, size: 95 bytes, params: 1, frame: 16 const binding = env0_0; const _maybeSendSecureFramesTransitionReady = binding._maybeSendSecureFramesTransitionReady; const binding2 = env0_1; Reflect.apply(_maybeSendSecureFramesTransitionReady, binding, [binding2]); const _storeSecureFrameTransitionData = binding._storeSecureFrameTransitionData; const object2 = {}; object2.protocolVersion = require; object2.prepareReceivedTime = env0_3; const value = environment.__proto__.__proto__; object2.prepareFinishedTime = (require(4303) /* metro dependency 4303: TimeUtils */).now(); Reflect.apply(_storeSecureFrameTransitionData, binding, [binding2, object2]); } function _fun36809(a0) { // fn#36809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:54029, offset: 0x010981e0, size: 62 bytes, params: 2, frame: 12 const binding = env0_0; binding.logger.info('Got MLS key package, sending to RTC server'); const _socket = binding._socket; if (_socket != null) { _socket.sendMLSKeyPackage(a0); } } function _fun36814(a0) { // fn#36814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:55241, offset: 0x01098447, size: 217 bytes, params: 2, frame: 18 let value = environment.__proto__.__proto__; value = require(4303) /* metro dependency 4303: TimeUtils */; value = value.now(); const binding = env0_0; binding.logger.info('Sending MLS commit welcome message'); env0_1.sendMLSCommitWelcome(a0); const r2 = binding._secureFramesNextTransitionState ?? env0_0._storeSecureFrameNextTransitionData({firstProposalsReceivedTime: env0_3, firstProposalsFinishedTime: value}); r2.lastProposalsReceivedTime = env0_3; r2.lastProposalsFinishedTime = value; const totalProposalsSize = r2.totalProposalsSize; value = 0; r2.totalProposalsSize = (totalProposalsSize ?? value) + require.byteLength; r2.totalCommitWelcomeSize = (r2.totalCommitWelcomeSize ?? value) + a0.byteLength; } function _fun36816(a0, a1, a2) { // fn#36816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:55941, offset: 0x010985a6, size: 287 bytes, params: 4, frame: 18 var logger; var warn; var binding2; var value2; var _handleSecureFramesRosterChange; var binding3; let binding = env0_0; if (a0) { binding._trackMLSFailures({'recovered': true, 'downgraded': false}); binding._mlsSessionResetStartTime = undefined; _handleSecureFramesRosterChange = binding._handleSecureFramesRosterChange; binding3 = env0_1; Reflect.apply(_handleSecureFramesRosterChange, binding, [a2, binding3]); binding._maybeSendSecureFramesTransitionReady(binding3); } else { logger = binding.logger; warn = logger.warn; binding2 = env0_1; Reflect.apply(warn, logger, ['Failed to process MLS commit for transition ID ' + binding2]); value2 = environment.__proto__.__proto__; binding._mlsSessionResetStartTime = (require(4303) /* metro dependency 4303: TimeUtils */).now(); binding._flagMLSInvalidCommitWelcome(binding2); binding._handleSecureFramesInit(a1); } binding = env0_0; const _storeSecureFrameTransitionData = binding._storeSecureFrameTransitionData; const binding4 = env0_1; const object2 = {protocolVersion: a1, commitReceivedTime: env0_3}; object2.commitFinishedTime = (require(4303) /* metro dependency 4303: TimeUtils */).now(); object2.commitSize = require.byteLength; object2.commitError = !a0; Reflect.apply(_storeSecureFrameTransitionData, binding, [binding4, object2]); } function _fun36818(a0, a1, a2) { // fn#36818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:56674, offset: 0x0109874b, size: 246 bytes, params: 4, frame: 18 var value2; var _handleSecureFramesRosterChange; var binding2; let binding = env0_0; if (a0) { binding._trackMLSFailures({'recovered': true, 'downgraded': false}); binding._mlsSessionResetStartTime = undefined; _handleSecureFramesRosterChange = binding._handleSecureFramesRosterChange; binding2 = env0_1; Reflect.apply(_handleSecureFramesRosterChange, binding, [a2, binding2]); binding._maybeSendSecureFramesTransitionReady(binding2); } else { value2 = environment.__proto__.__proto__; binding._mlsSessionResetStartTime = (require(4303) /* metro dependency 4303: TimeUtils */).now(); binding._flagMLSInvalidCommitWelcome(env0_1); binding._sendMLSKeyPackage(); } binding = env0_0; const _storeSecureFrameTransitionData = binding._storeSecureFrameTransitionData; const binding3 = env0_1; const object2 = {protocolVersion: a1, welcomeReceivedTime: env0_3}; object2.welcomeFinishedTime = (require(4303) /* metro dependency 4303: TimeUtils */).now(); object2.welcomeSize = require.byteLength; object2.welcomeError = !a0; Reflect.apply(_storeSecureFrameTransitionData, binding, [binding3, object2]); } function* _fun36739() { // fn#36739, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:28705, offset: 0x01094e08, size: 79 bytes, params: 1, frame: 12 if (false) { return undefined; } value = environment.__proto__.__proto__; yield env2_2._systemResources?.getBatteryLevelStats(); value = undefined; if (false) { return value; } return value ?? ({batteryUsageRounded: null}); } function _fun36748(a0) { // fn#36748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:32932, offset: 0x0109590f, size: 111 bytes, params: 2, frame: 23 var value; var binding; var emit; if (a0.quality === 100) { value = environment.__proto__; binding = env1_0; emit = binding.emit; value = environment.__proto__.__proto__.__proto__; Reflect.apply(emit, binding, [(require(4405) /* metro dependency 4405: RTCConnectionEvent */).RTCConnectionEvent.VideoSourceQualityChanged, binding.guildId, binding.channelId, env0_0, a0.maxResolution, a0.maxFrameRate, binding.context]); } } function _fun36752(a0) { // fn#36752, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:33871, offset: 0x01095da8, size: 57 bytes, params: 2, frame: 13 const value = environment.__proto__.__proto__.__proto__; (importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'AUDIO_INPUT_DEVICE_SAMPLE_RATE_CHANGED', sampleRate: a0}); } function _fun36753(a0, a1) { // fn#36753, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4473:34541, offset: 0x01095de1, size: 59 bytes, params: 3, frame: 14 if (env1_4 === env1_0._connection) { env1_4.setEncryption(a0, a1); env1_0._encryptionMode = a0; } }