/* Metro module 4294; source: stores/RTCConnectionStore.tsx; dependencies: [6, 7, 15, 17, 18, 4295, 1226, 4300, 661, 4291, 3, 4301, 4405, 694, 12410, 4041, 12411, 566, 683, 1962, 2] */ import Dispatcher from '../Dispatcher.tsx'; /* Metro dependency 694 */ import VoiceStateAnalytics from '../lib/VoiceStateAnalytics.tsx'; /* Metro dependency 12410 */ import * as RTCConnectionModule from '../lib/RTCConnection.tsx'; /* Metro dependency 4301 */ import * as RTCConnectionEventModule from '../lib/RTCConnectionEvent.tsx'; /* Metro dependency 4405 */ function _fun36392(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#36392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:6, offset: 0x0108b354, size: 766 bytes, params: 8, frame: 23 const env0_0 = require; const closure = function() { env0_19 = null; }; const CHANNEL_DELETE_364222 = CHANNEL_DELETE_36422; const closure3 = function() { return true; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(dependencyMap[0]); const env0_4 = importDefault(dependencyMap[1]); const env0_5 = importDefault(dependencyMap[2]); const env0_6 = importDefault(dependencyMap[3]); const env0_7 = importDefault(dependencyMap[4]); const env0_8 = importDefault(dependencyMap[5]); const env0_9 = importDefault(dependencyMap[6]); const env0_10 = importDefault(dependencyMap[7]); let value = require(dependencyMap[8]); const env0_11 = value.RTCConnectionStates; const env0_12 = value.AppStates; const env0_13 = value.RTCConnectionQuality; const env0_14 = require(dependencyMap[9]).MediaEngineContextTypes; value = importDefault(dependencyMap[10]); value = new value('RTCConnectionStore'); const env0_18 = []; const Store = importDefault(dependencyMap[17]).Store; _fun36424(Store).displayName = 'RTCConnectionStore'; value = new value(importDefault(dependencyMap[13]), {CONNECTION_OPEN: function(a0) { env0_16 = a0.sessionId; env0_19 = null; env0_21 = null; destroyRTCConnection(); clearPendingVoiceChannelSelect(); return false; }, CONNECTION_CLOSED: function() { env0_16 = null; env0_19 = null; env0_21 = null; destroyRTCConnection(); clearPendingVoiceChannelSelect(); }, RTC_CONNECTION_STATE: function({state}) { if (state === RTCConnectionStates.RTC_CONNECTED) { env0_24 = true; } return true; }, RTC_CONNECTION_PING: closure3, RTC_CONNECTION_LOSS_RATE: closure3, RTC_CONNECTION_UPDATE_ID: RTC_CONNECTION_UPDATE_ID, RTC_CONNECTION_SECURE_FRAMES_UPDATE: closure3, RTC_CONNECTION_CLIENT_CONNECT: closure3, RTC_CONNECTION_CLIENT_DISCONNECT: closure3, RTC_CONNECTION_REMOTE_VIDEO_SINK_WANTS: RTC_CONNECTION_REMOTE_VIDEO_SINK_WANTS, VIDEO_SIZE_UPDATE: VIDEO_SIZE_UPDATE, VOICE_STATE_UPDATES: function({voiceStates}) { return voiceStates.reduce(_fun36466, false); }, VOICE_CHANNEL_SELECT: VOICE_CHANNEL_SELECT_36467, AUDIO_SET_NOISE_CANCELLATION: AUDIO_SET_NOISE_CANCELLATION_36470, AUDIO_SET_AUDIO_MIXER_SETTINGS: AUDIO_SET_AUDIO_MIXER_SETTINGS_36471, VOICE_SERVER_UPDATE: VOICE_SERVER_UPDATE, CLEAR_REMOTE_DISCONNECT_VOICE_CHANNEL_ID: closure, REMOTE_SESSION_CONNECT: closure, CLEAR_LAST_SESSION_VOICE_CHANNEL_ID: function() { env0_21 = null; }, GUILD_DELETE: GUILD_DELETE_36474, CHANNEL_DELETE: CHANNEL_DELETE_364222, THREAD_DELETE: CHANNEL_DELETE_364222, CALL_DELETE: CALL_DELETE_36475, APP_STATE_UPDATE: APP_STATE_UPDATE_36476, RTC_DEBUG_SET_SIMULCAST_OVERRIDE: RTC_DEBUG_SET_SIMULCAST_OVERRIDE}); require(dependencyMap[19])(dependencyMap[18], dependencyMap.paths).then(function({addExtraAnalyticsDecorator}) { addExtraAnalyticsDecorator(_fun36479); }); require(dependencyMap[20]).fileFinishedImporting('stores/RTCConnectionStore.tsx'); exports.default = value; function _isNativeReflectConstruct_36393() { // fn#36393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:285, offset: 0x0108b652, 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_36393_isNativeReflectConstruct = function() { return !!result; })(); } function createRTCConnection(a0, a1) { // fn#36396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:593, offset: 0x0108b6b0, size: 692 bytes, params: 3, frame: 21 if (env0_16 == null) { throw new global.Error('Creating RTCConnection without session.'); } const value4 = new (RTCConnectionModule).default({userId: authenticationStore.getId(), sessionId: env0_16, guildId: a0, channelId: a1, joinVoiceId: env0_27}); let on = value4.on; const RTCConnectionEvent = (RTCConnectionEventModule).RTCConnectionEvent; const State = RTCConnectionEvent.State; Reflect.apply(on, value4, [State, _fun36397]); on = value4.on; const Video = RTCConnectionEvent.Video; Reflect.apply(on, value4, [Video, _fun36399]); on = value4.on; const Ping = RTCConnectionEvent.Ping; Reflect.apply(on, value4, [Ping, _fun36401]); on = value4.on; const OutboundLossRate = RTCConnectionEvent.OutboundLossRate; Reflect.apply(on, value4, [OutboundLossRate, _fun36403]); on = value4.on; const Speaking = RTCConnectionEvent.Speaking; Reflect.apply(on, value4, [Speaking, _fun36405]); on = value4.on; const Flags = RTCConnectionEvent.Flags; Reflect.apply(on, value4, [Flags, _fun36406]); on = value4.on; const UsersMerged = RTCConnectionEvent.UsersMerged; Reflect.apply(on, value4, [UsersMerged, _fun36408]); on = value4.on; const ClientConnect = RTCConnectionEvent.ClientConnect; Reflect.apply(on, value4, [ClientConnect, _fun36409]); on = value4.on; const ClientDisconnect = RTCConnectionEvent.ClientDisconnect; Reflect.apply(on, value4, [ClientDisconnect, _fun36411]); on = value4.on; const Platform = RTCConnectionEvent.Platform; Reflect.apply(on, value4, [Platform, _fun36413]); on = value4.on; const SecureFramesUpdate = RTCConnectionEvent.SecureFramesUpdate; Reflect.apply(on, value4, [SecureFramesUpdate, _fun36415]); on = value4.on; const RosterMapUpdate = RTCConnectionEvent.RosterMapUpdate; Reflect.apply(on, value4, [RosterMapUpdate, _fun36417]); const value8 = new (VoiceStateAnalytics)(authenticationStore.getId(), a1); return value4; function _fun36397(a0, a1, a2) { // fn#36397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:846, offset: 0x0108b964, size: 66 bytes, params: 4, frame: 12 var environment; const env0_0 = a0; const env0_1 = a1; const env0_2 = a2; const value = environment.__proto__; (Dispatcher).wait(_fun36398); function _fun36398() { // fn#36398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:871, offset: 0x0108b9a6, size: 80 bytes, params: 1, frame: 14 let value = environment.__proto__.__proto__; value = importDefault(694) /* metro dependency 694: Dispatcher */; const dispatch = value.dispatch; const object = {type: 'RTC_CONNECTION_STATE'}; const binding = env0_0; object.state = binding; copyDataProperties(object, importDefault, copyDataProperties(object, require, binding)); return Reflect.apply(dispatch, value, [object]); } } function _fun36399(a0, a1, a2, a3, a4) { // fn#36399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:987, offset: 0x0108b9f6, size: 80 bytes, params: 6, frame: 12 var environment; const env0_0 = a0; const env0_1 = a1; const env0_2 = a2; const env0_3 = a3; const env0_4 = a4; const value = environment.__proto__; (Dispatcher).wait(_fun36400); function _fun36400() { // fn#36400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:1016, offset: 0x0108ba46, size: 128 bytes, params: 1, frame: 14 const defaultImport = Dispatcher; const dispatch = defaultImport.dispatch; const object = {type: 'RTC_CONNECTION_VIDEO'}; object.guildId = env0_0; object.channelId = require; object.userId = importDefault; object.streamId = importAll; object.rtcServerId = env0_4; const DEFAULT = MediaEngineContextTypes.DEFAULT; object.context = DEFAULT; object.mediaEngineConnectionId = env1_0.getMediaEngineConnectionId(); return Reflect.apply(dispatch, defaultImport, [object]); } } function _fun36401(a0, a1) { // fn#36401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:1242, offset: 0x0108bac6, size: 59 bytes, params: 3, frame: 12 var environment; const env0_0 = a0; const env0_1 = a1; const value = environment.__proto__; (Dispatcher).wait(_fun36402); function _fun36402() { // fn#36402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:1265, offset: 0x0108bb01, size: 68 bytes, params: 1, frame: 13 const value = environment.__proto__.__proto__; return (Dispatcher).dispatch({type: 'RTC_CONNECTION_PING', pings: env0_0, quality: require}); } } function _fun36403(a0) { // fn#36403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:1391, offset: 0x0108bb45, size: 52 bytes, params: 2, frame: 12 var environment; const env0_0 = a0; const value = environment.__proto__; (Dispatcher).wait(_fun36404); function _fun36404() { // fn#36404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:1410, offset: 0x0108bb79, size: 61 bytes, params: 1, frame: 12 const value = environment.__proto__.__proto__; return (Dispatcher).dispatch({type: 'RTC_CONNECTION_LOSS_RATE', lossRate: env0_0}); } } function _fun36405(a0, a1) { // fn#36405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:1526, offset: 0x0108bbb6, size: 37 bytes, params: 3, frame: 13 const binding = env1_22; if (binding != null) { binding.setSpeaking(a0, a1); } } function _fun36406(a0, a1) { // fn#36406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:1615, offset: 0x0108bbdb, size: 59 bytes, params: 3, frame: 12 var environment; const env0_0 = a0; const env0_1 = a1; const value = environment.__proto__; (Dispatcher).wait(_fun36407); function _fun36407() { // fn#36407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:1638, offset: 0x0108bc16, size: 108 bytes, params: 1, frame: 14 const value = environment.__proto__.__proto__; (Dispatcher).dispatch({type: 'RTC_CONNECTION_FLAGS', flags: require, userId: env0_0, guildId: env1_0.guildId, channelId: env1_0.channelId, context: env1_0.context}); } } function _fun36408(a0, a1) { // fn#36408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:1819, offset: 0x0108bc82, size: 64 bytes, params: 3, frame: 13 const value = environment.__proto__; (Dispatcher).dispatch({type: 'RTC_CONNECTION_USERS_MERGED', userIds: a0, context: a1}); } function _fun36409(a0) { // fn#36409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:1954, offset: 0x0108bcc2, size: 52 bytes, params: 2, frame: 12 var environment; const env0_0 = a0; const value = environment.__proto__; (Dispatcher).wait(_fun36410); function _fun36410() { // fn#36410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:1973, offset: 0x0108bcf6, size: 101 bytes, params: 1, frame: 14 const value = environment.__proto__.__proto__; (Dispatcher).dispatch({type: 'RTC_CONNECTION_CLIENT_CONNECT', userIds: env0_0, guildId: env1_0.guildId, channelId: env1_0.channelId, context: env1_0.context}); } } function _fun36411(a0) { // fn#36411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:2161, offset: 0x0108bd5b, size: 52 bytes, params: 2, frame: 12 var environment; const env0_0 = a0; const value = environment.__proto__; (Dispatcher).wait(_fun36412); function _fun36412() { // fn#36412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:2180, offset: 0x0108bd8f, size: 100 bytes, params: 1, frame: 14 const value = environment.__proto__.__proto__; (Dispatcher).dispatch({type: 'RTC_CONNECTION_CLIENT_DISCONNECT', userId: env0_0, guildId: env1_0.guildId, channelId: env1_0.channelId, context: env1_0.context}); } } function _fun36413(a0, a1, a2) { // fn#36413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:2362, offset: 0x0108bdf3, size: 66 bytes, params: 4, frame: 12 var environment; const env0_0 = a0; const env0_1 = a1; const env0_2 = a2; const value = environment.__proto__; (Dispatcher).wait(_fun36414); function _fun36414() { // fn#36414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:2387, offset: 0x0108be35, size: 75 bytes, params: 1, frame: 14 const value = environment.__proto__.__proto__; (Dispatcher).dispatch({type: 'RTC_CONNECTION_PLATFORM', platform: require, userId: env0_0, channelId: importDefault}); } } function _fun36415() { // fn#36415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:2535, offset: 0x0108be80, size: 45 bytes, params: 1, frame: 12 var environment; const value = environment.__proto__; (Dispatcher).wait(_fun36416); function _fun36416() { // fn#36416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:2555, offset: 0x0108bead, size: 47 bytes, params: 1, frame: 13 const value = environment.__proto__.__proto__; (Dispatcher).dispatch({type: 'RTC_CONNECTION_SECURE_FRAMES_UPDATE'}); } } function _fun36417(a0) { // fn#36417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:2680, offset: 0x0108bedc, size: 52 bytes, params: 2, frame: 12 var environment; const env0_0 = a0; const value = environment.__proto__; (Dispatcher).wait(_fun36418); function _fun36418() { // fn#36418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:2699, offset: 0x0108bf10, size: 61 bytes, params: 1, frame: 13 const value = environment.__proto__.__proto__; (Dispatcher).dispatch({type: 'RTC_CONNECTION_ROSTER_MAP_UPDATE', userIds: env0_0}); } } } function destroyRTCConnection() { // fn#36419, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:2829, offset: 0x0108bf4d, size: 231 bytes, params: 1, frame: 16 const value2 = null; if (value2 == env0_15) { return false; } let object = {}; object.duration = env0_15.getDuration(); const mediaSessionId = env0_15.getMediaSessionId(); object.mediaSessionId = value2 != mediaSessionId ? mediaSessionId : value2; object.rtcConnectionId = env0_15.getRTCConnectionId(); object.wasEverMultiParticipant = env0_23; object.wasEverRtcConnected = env0_24; object.voiceStateAnalytics = env0_22; object.channelId = env0_15.channelId; const defaultImport = Dispatcher; const dispatch = defaultImport.dispatch; object = {type: 'MEDIA_ENGINE_CONNECTION_STATS_HISTORY_RESET'}; object.mediaEngineConnectionId = env0_15.getMediaEngineConnectionId(); Reflect.apply(dispatch, defaultImport, [object]); env0_15.destroy(); } function clearPendingVoiceChannelSelect() { // fn#36420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:3259, offset: 0x0108c034, size: 41 bytes, params: 1, frame: 11 if (env0_28 != null) { env0_28.timeout.stop(); } } function CHANNEL_DELETE_36422({channel}) { // fn#36422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:3396, offset: 0x0108c06a, size: 55 bytes, params: 2, frame: 11 if (env0_15 == null) { return false; } if (env0_15.channelId !== channel.id) { return false; } destroyRTCConnection(); } function _fun36424(a0) { // fn#36424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:3543, offset: 0x0108c0a1, size: 799 bytes, params: 2, frame: 16 const RTCConnectionStore2 = RTCConnectionStore; env0_7(RTCConnectionStore2, a0); return env0_4(RTCConnectionStore2, [{key: 'initialize', value: value_36426}, {key: 'getRTCConnection', value: value_36427}, {key: 'getState', value: value_36428}, {key: 'isConnected', value: function() { return this.getState() === RTCConnectionStates.RTC_CONNECTED; }}, {key: 'isDisconnected', value: function() { return this.getState() === RTCConnectionStates.DISCONNECTED; }}, {key: 'getRemoteDisconnectVoiceChannelId', value: value_36431}, {key: 'getLastSessionVoiceChannelId', value: value_36432}, {key: 'setLastSessionVoiceChannelId', value: function(a0) { env1_21 = a0; }}, {key: 'getGuildId', value: value_36434}, {key: 'getChannelId', value: value_36435}, {key: 'getHostname', value: value_36436}, {key: 'getQuality', value: value_36437}, {key: 'getPings', value: value_36438}, {key: 'getAveragePing', value: value_36439}, {key: 'getLastPing', value: value_36440}, {key: 'getOutboundLossRate', value: value_36441}, {key: 'getMediaSessionId', value: value_36442}, {key: 'getRTCConnectionId', value: value_36443}, {key: 'getDuration', value: value_36444}, {key: 'getLastRTCConnectionState', value: value_36445}, {key: 'getPacketStats', value: value_36446}, {key: 'getVoiceStateStats', value: value_36447}, {key: 'getUserVoiceSettingsStats', value: value_36448}, {key: 'getWasEverMultiParticipant', value: value_36449}, {key: 'getWasEverRtcConnected', value: value_36450}, {key: 'getUserIds', value: value_36451}, {key: 'getJoinVoiceId', value: value_36452}, {key: 'isUserConnected', value: value_36453}, {key: 'getSecureFramesState', value: value_36454}, {key: 'getSecureFramesRosterMapEntry', value: value_36455}, {key: 'getLastNonZeroRemoteVideoSinkWantsTime', value: value_36456}, {key: 'getWasMoved', value: value_36457}]); function RTCConnectionStore() { // fn#36425, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:3555, offset: 0x0108281d, size: 113 bytes, params: 1, frame: 20 const value = environment.__proto__; env1_3(this, RTCConnectionStore); const value3 = env1_6(RTCConnectionStore); return env1_5(this, _isNativeReflectConstruct_36393() ? global.Reflect.construct(value3, arguments, env1_6(this).constructor) : value3.apply(this, arguments)); } function value_36426() { // fn#36426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:3863, offset: 0x0108c3c0, size: 79 bytes, params: 1, frame: 16 const waitFor = this.waitFor; let value = environment.__proto__; Reflect.apply(waitFor, this, [authenticationStore, gameConsoleStore, sortedVoiceStateStore]); value = require(12411) /* metro dependency 12411: trackVideoToggle */; const setVideoToggleAnalyticsParams = value.setVideoToggleAnalyticsParams; const getRTCConnectionId = this.getRTCConnectionId; const getMediaSessionId = this.getMediaSessionId; Reflect.apply(setVideoToggleAnalyticsParams, value, [getRTCConnectionId, getMediaSessionId]); } function value_36427() { // fn#36427, offset: 0x00df0e8b, size: 9 bytes, params: 1, frame: 1 return env1_15; } function value_36428() { // fn#36428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:4057, offset: 0x0108c40f, size: 36 bytes, params: 1, frame: 3 return env1_15 != null ? env1_15.state : RTCConnectionStates.DISCONNECTED; } function value_36431() { // fn#36431, offset: 0x00d406a2, size: 9 bytes, params: 1, frame: 1 return env1_19; } function value_36432() { // fn#36432, offset: 0x00f854d6, size: 9 bytes, params: 1, frame: 1 return env1_21; } function value_36434() { // fn#36434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:4485, offset: 0x0108c481, size: 25 bytes, params: 1, frame: 3 const value = environment.__proto__; return env1_15?.guildId; } function value_36435() { // fn#36435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:4566, offset: 0x0108c49a, size: 25 bytes, params: 1, frame: 3 const value = environment.__proto__; return env1_15?.channelId; } function value_36436() { // fn#36436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:4648, offset: 0x0108c4b3, size: 32 bytes, params: 1, frame: 3 return env1_15 != null ? env1_15.hostname : ''; } function value_36437() { // fn#36437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:4714, offset: 0x0108c4d3, size: 37 bytes, params: 1, frame: 3 return env1_15 != null ? env1_15.quality : RTCConnectionQuality.UNKNOWN; } function value_36438() { // fn#36438, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:4784, offset: 0x0108c4f8, size: 35 bytes, params: 1, frame: 10 const value = environment.__proto__; return env1_15 != null ? env1_15.getPings() : env1_18; } function value_36439() { // fn#36439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:4855, offset: 0x0108c51b, size: 46 bytes, params: 1, frame: 11 const value = environment.__proto__; return env1_15 != null ? env1_15?.getAveragePing() : 0; } function value_36440() { // fn#36440, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:4954, offset: 0x0108c549, size: 30 bytes, params: 1, frame: 10 const value = environment.__proto__; return env1_15?.getLastPing(); } function value_36441() { // fn#36441, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:5048, offset: 0x0108c567, size: 30 bytes, params: 1, frame: 10 const value = environment.__proto__; return env1_15?.getOutboundLossRate(); } function value_36442() { // fn#36442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:5148, offset: 0x0108c585, size: 30 bytes, params: 1, frame: 10 const value = environment.__proto__; return env1_15?.getMediaSessionId(); } function value_36443() { // fn#36443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:5247, offset: 0x0108c5a3, size: 30 bytes, params: 1, frame: 10 const value = environment.__proto__; return env1_15?.getRTCConnectionId(); } function value_36444() { // fn#36444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:5340, offset: 0x0108c5c1, size: 55 bytes, params: 1, frame: 13 const binding = env1_15; const value2 = undefined; let r0 = binding == null ? value2 : binding.getDuration(); r0 = r0 ?? (env1_20 == null ? value2 : env1_20.duration); return r0; } function value_36445() { // fn#36445, offset: 0x00e4253a, size: 9 bytes, params: 1, frame: 1 return env1_20; } function value_36446() { // fn#36446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:5536, offset: 0x0108c5f8, size: 30 bytes, params: 1, frame: 10 const value = environment.__proto__; return env1_15?.getPacketStats(); } function value_36447() { // fn#36447, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:5632, offset: 0x0108c616, size: 30 bytes, params: 1, frame: 10 const value = environment.__proto__; return env1_22?.getStats(); } function value_36448(a0) { // fn#36448, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:5729, offset: 0x0108c634, size: 34 bytes, params: 2, frame: 12 const value = environment.__proto__; return env1_22?.getUserVoiceSettingsStats(a0); } function value_36449() { // fn#36449, offset: 0x00df3ac4, size: 9 bytes, params: 1, frame: 1 return env1_23; } function value_36450() { // fn#36450, offset: 0x00df3acd, size: 9 bytes, params: 1, frame: 1 return env1_24; } function value_36451() { // fn#36451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:5950, offset: 0x0108c656, size: 30 bytes, params: 1, frame: 10 const value = environment.__proto__; return env1_15?.getUserIds(); } function value_36452() { // fn#36452, offset: 0x00df3b32, size: 9 bytes, params: 1, frame: 1 return env1_27; } function value_36453(a0) { // fn#36453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:6089, offset: 0x0108c674, size: 34 bytes, params: 2, frame: 12 const value = environment.__proto__; return env1_15?.getIsUserConnected(a0); } function value_36454() { // fn#36454, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:6193, offset: 0x0108c696, size: 30 bytes, params: 1, frame: 10 const value = environment.__proto__; return env1_15?.getSecureFramesState(); } function value_36455(a0) { // fn#36455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:6306, offset: 0x0108c6b4, size: 52 bytes, params: 2, frame: 13 let value = environment.__proto__; const binding = env1_15; value = undefined; const r3 = binding == null ? value : binding.getSecureFramesRosterMap(); return r3 == null ? value : r3.get(a0); } function value_36456() { // fn#36456, offset: 0x00df3ad6, size: 9 bytes, params: 1, frame: 1 return env1_25; } function value_36457() { // fn#36457, offset: 0x00df3adf, size: 9 bytes, params: 1, frame: 1 return env1_26; } } function RTC_CONNECTION_UPDATE_ID({connection}) { // fn#36461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:7083, offset: 0x0108c760, size: 22 bytes, params: 2, frame: 2 return connection === env0_15; } function RTC_CONNECTION_REMOTE_VIDEO_SINK_WANTS({context, wants}) { // fn#36462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:7334, offset: 0x0108c776, size: 106 bytes, params: 2, frame: 14 var r1; var r0; var value4; const DEFAULT = MediaEngineContextTypes.DEFAULT; let value2 = context === DEFAULT; if (value2) { value4 = global.Object.entries(wants).some(function(a0) { var r0; var r2; var r3; var item3; var value3; var iterator = a0[Symbol.iterator](); var iterator2 = iterator.next; var item2 = Reflect.apply(iterator2, iterator, []); var item = item2.value; item2 = item2.done ? undefined : iterator; var value = undefined; var value2 = item2 === value; var r1 = 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(); } return r1 !== 'any' && r2 !== 0; }); if (value4) { env0_25 = global.performance.now(); r1 = undefined; } else { r1 = !!value4; } r0 = r1; } else { r0 = value2; } return r0; } function VIDEO_SIZE_UPDATE({streamId, dimensions, zoom}) { // fn#36464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:7528, offset: 0x0108c832, size: 51 bytes, params: 2, frame: 15 const binding = env0_15; if (binding != null) { binding.setVideoSize(streamId, dimensions, zoom); } } function VOICE_STATE_UPDATES_36465({voiceStates}) { // fn#36465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:7655, offset: 0x0108c865, size: 32 bytes, params: 2, frame: 13 return voiceStates.reduce(_fun36466, false); function _fun36466(a0, a1) { // fn#36466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:7722, offset: 0x0108c885, size: 673 bytes, params: 3, frame: 17 var r4; var channelId; var createRTCConnectionBinding; var guildId; var gameConsoleStoreBinding; var value14; let binding = env1_22; if (binding != null) { binding.updateVoiceStates(a1.userId, a1.channelId); } binding = env1_23; if (binding) { r4 = binding; } else { binding = env1_22; r4 = ((binding == null ? undefined : binding.getStats().max_voice_state_count) ?? 0) > 1; } const id = authenticationStore.getId(); const userId = a1.userId; if (id !== userId) { return a0; } if (env1_28 != null && a1.channelId === env1_28.channelId) { clearPendingVoiceChannelSelect(); } if (rTCConnectionBinding != null) { if (a1.sessionId === env1_16) { guildId = a1.guildId; if (guildId == null) { guildId = a1.guildId; if (guildId != null) { guildId = a1.guildId; if (!(guildId !== rTCConnectionBinding.guildId && a1.channelId == null)) { destroyRTCConnection(); } channelId = a1.channelId; if (channelId != null) { createRTCConnectionBinding = createRTCConnection; guildId = a1.guildId; channelId = a1.channelId; value14 = undefined; rTCConnectionBinding = createRTCConnectionBinding(guildId, channelId); binding = env1_22; env1_23 = ((binding == null ? value14 : binding.getStats().max_voice_state_count) ?? 0) > 1; } } else { channelId = a1.channelId; if (channelId === rTCConnectionBinding.channelId) { if (a1.channelId == null) { destroyRTCConnection(); } else { binding = rTCConnectionBinding; binding.setNextChannelId(a1.channelId); binding = rTCConnectionBinding; binding.clearJoinVoiceId(); } } else { guildId = a1.guildId; if (!(guildId !== rTCConnectionBinding.guildId && a1.channelId == null)) { destroyRTCConnection(); } channelId = a1.channelId; if (channelId != null) { createRTCConnectionBinding = createRTCConnection; guildId = a1.guildId; channelId = a1.channelId; value14 = undefined; rTCConnectionBinding = createRTCConnectionBinding(guildId, channelId); binding = env1_22; env1_23 = ((binding == null ? value14 : binding.getStats().max_voice_state_count) ?? 0) > 1; } } } } else { guildId = a1.guildId; if (guildId === rTCConnectionBinding.guildId) { if (a1.channelId == null) { destroyRTCConnection(); } else { binding = rTCConnectionBinding; binding.setNextChannelId(a1.channelId); binding = rTCConnectionBinding; binding.clearJoinVoiceId(); } } else { guildId = a1.guildId; if (guildId != null) { guildId = a1.guildId; if (!(guildId !== rTCConnectionBinding.guildId && a1.channelId == null)) { destroyRTCConnection(); } channelId = a1.channelId; if (channelId != null) { createRTCConnectionBinding = createRTCConnection; guildId = a1.guildId; channelId = a1.channelId; value14 = undefined; rTCConnectionBinding = createRTCConnectionBinding(guildId, channelId); binding = env1_22; env1_23 = ((binding == null ? value14 : binding.getStats().max_voice_state_count) ?? 0) > 1; } } else { channelId = a1.channelId; if (channelId === rTCConnectionBinding.channelId) { if (a1.channelId == null) { destroyRTCConnection(); } else { binding = rTCConnectionBinding; binding.setNextChannelId(a1.channelId); binding = rTCConnectionBinding; binding.clearJoinVoiceId(); } } else { guildId = a1.guildId; if (!(guildId !== rTCConnectionBinding.guildId && a1.channelId == null)) { destroyRTCConnection(); } channelId = a1.channelId; if (channelId != null) { createRTCConnectionBinding = createRTCConnection; guildId = a1.guildId; channelId = a1.channelId; value14 = undefined; rTCConnectionBinding = createRTCConnectionBinding(guildId, channelId); binding = env1_22; env1_23 = ((binding == null ? value14 : binding.getStats().max_voice_state_count) ?? 0) > 1; } } } } } } else if (a1.guildId === rTCConnectionBinding.guildId) { gameConsoleStoreBinding = gameConsoleStore; if (!(gameConsoleStoreBinding.getAwaitingRemoteSessionInfo() != null && gameConsoleStore.getRemoteSessionId() != null)) { channelId = rTCConnectionBinding.channelId; } destroyRTCConnection(); } } else { if (a1.sessionId !== env1_16) { return a0; } channelId = a1.channelId; if (channelId == null) { return a0; } createRTCConnectionBinding = createRTCConnection; guildId = a1.guildId; channelId = a1.channelId; var value8 = undefined; rTCConnectionBinding = createRTCConnectionBinding(guildId, channelId); binding = env1_22; env1_23 = ((binding == null ? value8 : binding.getStats().max_voice_state_count) ?? 0) > 1; } return true; } } function VOICE_CHANNEL_SELECT_36467(a0) { // fn#36467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:8803, offset: 0x0108cb26, size: 91 bytes, params: 2, frame: 14 if (!(env0_15 == null || a0.channelId != null && env0_15.channelId === a0.channelId)) { destroyRTCConnection(); } env0_27 = a0.joinVoiceId; setPendingVoiceChannelSelect(a0); function setPendingVoiceChannelSelect(a0) { // fn#36468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:8934, owner: VOICE_CHANNEL_SELECT_36467.setPendingVoiceChannelSelect, offset: 0x0108cb81, size: 143 bytes, params: 2, frame: 16 var timeout; var object; const env0_0 = a0; clearPendingVoiceChannelSelect(); if (a0.channelId != null) { timeout = new (require(4041) /* metro dependency 4041: Timers */).Timeout(); timeout.start(30000, _fun36469); object = {}; object.joinVoiceId = a0.joinVoiceId; object.channelId = a0.channelId; object.guildId = a0.guildId; object.timeout = timeout; } function _fun36469() { // fn#36469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:9071, offset: 0x0108cc10, size: 72 bytes, params: 1, frame: 15 const binding = env2_17; const warn = binding.warn; const binding2 = env0_0; Reflect.apply(warn, binding, ['No VOICE_STATE_UPDATE received within 30000ms of VOICE_CHANNEL_SELECT', {joinVoiceId: binding2.joinVoiceId, channelId: binding2.channelId, guildId: binding2.guildId}]); } } } function AUDIO_SET_NOISE_CANCELLATION_36470(a0) { // fn#36470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:9349, offset: 0x0108cc58, size: 36 bytes, params: 2, frame: 11 const binding = env0_15; if (binding != null) { binding.setNoiseCancellationEnabled(a0.enabled); } } function AUDIO_SET_AUDIO_MIXER_SETTINGS_36471(a0) { // fn#36471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:9485, offset: 0x0108cc7c, size: 65 bytes, params: 2, frame: 12 const context = a0.context; const DEFAULT = MediaEngineContextTypes.DEFAULT; if (context !== DEFAULT) { return false; } const binding = env0_15; if (binding != null) { binding.setSpatialAudioEnabled(a0.settings.enabled); } } function VOICE_SERVER_UPDATE(a0) { // fn#36472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:9649, offset: 0x0108ccbd, size: 130 bytes, params: 2, frame: 17 var r1; var r2; var r0; var channelId; var value5; var binding; const value2 = env0_15 != null; if (value2) { r1 = a0.guildId == null || a0.guildId === env0_15.guildId; if (r1) { channelId = a0.channelId; value5 = channelId == null; if (value5) { r2 = value5; } else { channelId = a0.channelId; binding = env0_15; r2 = channelId === binding.getNextChannelId(); } if (r2) { binding = env0_15; binding.connect(a0.endpoint, a0.token); r2 = undefined; } r1 = r2; } r0 = r1; } else { r0 = value2; } return r0; } function GUILD_DELETE_36474({guild}) { // fn#36474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:10093, offset: 0x0108cd4c, size: 55 bytes, params: 2, frame: 11 if (env0_15 == null) { return false; } if (env0_15.guildId !== guild.id) { return false; } destroyRTCConnection(); } function CALL_DELETE_36475({channelId}) { // fn#36475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:10274, offset: 0x0108cd83, size: 50 bytes, params: 2, frame: 11 if (env0_15 == null) { return false; } if (env0_15.channelId !== channelId) { return false; } destroyRTCConnection(); } function APP_STATE_UPDATE_36476({state}) { // fn#36476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:10393, offset: 0x0108cdb5, size: 66 bytes, params: 2, frame: 12 const ACTIVE = AppStates.ACTIVE; if (state === ACTIVE && env0_15 != null) { env0_15.resetBackoff('App state is active'); } return false; } function RTC_DEBUG_SET_SIMULCAST_OVERRIDE({userId, context, quality}) { // fn#36477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:10528, offset: 0x0108cdf7, size: 49 bytes, params: 2, frame: 15 const binding = env0_15; if (binding != null) { binding.setSimulcastDebugOverride(userId, context, quality); } } function _fun36478({addExtraAnalyticsDecorator}) { // fn#36478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:10692, offset: 0x0108ce28, size: 25 bytes, params: 2, frame: 11 addExtraAnalyticsDecorator(_fun36479); function _fun36479(a0) { // fn#36479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4466:10730, offset: 0x0108ce41, size: 32 bytes, params: 2, frame: 9 const value = environment.__proto__; a0.client_rtc_state = env1_29.getState(); } } } global.__d(_fun36392, 4294, [6, 7, 15, 17, 18, 4295, 1226, 4300, 661, 4291, 3, 4301, 4405, 694, 12410, 4041, 12411, 566, 683, 1962, 2]) /* metro module 4294, dependencies: [6, 7, 15, 17, 18, 4295, 1226, 4300, 661, 4291, 3, 4301, 4405, 694, 12410, 4041, 12411, 566, 683, 1962, 2] */;