/* Metro module 4609; source: stores/VideoStreamStore.tsx; dependencies: [6, 7, 15, 17, 18, 661, 4291, 566, 694, 2] */ function _fun39522(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:6, offset: 0x010e4191, size: 393 bytes, params: 8, frame: 19 const makeTimeoutKey = function(a0, a1) { return '' + a0 + ':' + a1; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_0 = importDefault(6) /* metro dependency 6 */; const env0_1 = importDefault(7) /* metro dependency 7 */; const env0_2 = importDefault(15) /* metro dependency 15 */; const env0_3 = importDefault(17) /* metro dependency 17 */; const env0_4 = importDefault(18) /* metro dependency 18 */; const env0_5 = (require(661) /* metro dependency 661: Constants */).NULL_STRING_GUILD_ID; const env0_6 = (require(4291) /* metro dependency 4291: Constants */).MediaEngineContextTypes; const env0_9 = {}; const env0_10 = {}; const Store = (importDefault(566) /* metro dependency 566: flux */).Store; let value = _fun39528(Store); value.displayName = 'VideoStreamStore'; value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function({user, sessionId}) { env0_7 = user.id; env0_8 = sessionId; }, OVERLAY_INITIALIZE: function({user, sessionId}) { env0_7 = user.id; env0_8 = sessionId; }, RTC_CONNECTION_VIDEO: RTC_CONNECTION_VIDEO_39536, VOICE_STATE_UPDATES: function({voiceStates}) { return voiceStates.reduce(_fun39538, false); }, VIDEO_STREAM_READY_TIMEOUT: VIDEO_STREAM_READY_TIMEOUT, CLEAR_VIDEO_STREAM_READY_TIMEOUT: CLEAR_VIDEO_STREAM_READY_TIMEOUT}); (require(2) /* metro dependency 2 */).fileFinishedImporting('stores/VideoStreamStore.tsx'); exports.default = value; } function _isNativeReflectConstruct_39523() { // fn#39523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:213, offset: 0x010e431a, 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_39523_isNativeReflectConstruct = function() { return !!result; })(); } function clearUser_39527(a0, a1) { // fn#39527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:481, offset: 0x010e4378, size: 173 bytes, params: 3, frame: 22 var r1; var r7; var r11; var value5; var length; var value6; var property2; var value7; var value8; var binding; var makeTimeoutKeyBinding; var value9; const value = a1; const value2 = a2; const r9 = value2 !== undefined ? value2 : null; let property = env0_9[a0]; if (property != null) { r1 = value ?? NULL_STRING_GUILD_ID; property = property[r1]; if (property != null) { value5 = global.Object.values(MediaEngineContextTypes); length = value5.length; value6 = 0; if (value6 < length) { r7 = value6; while (true) { property2 = value5[r7]; value7 = r9 !== property2; if (value7) { value8 = r9 != null; r1 = value8; } else { r1 = value7; } if (r1) { continue; } delete property[property2]; binding = env0_10; makeTimeoutKeyBinding = makeTimeoutKey; if (r9 == null) { r11 = property2; continue; } r11 = r9; continue; delete binding[makeTimeoutKeyBinding(r11, a0)]; value9 = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1; length = value5.length; if (value9 < length) { r7 = value9; continue; } break; } } env0_9[a0][value ?? NULL_STRING_GUILD_ID] = property; } } } function _fun39528(a0) { // fn#39528, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:724, offset: 0x010e4425, size: 141 bytes, params: 2, frame: 16 const closure = VideoStreamStore; env0_4(closure, a0); return env0_1(closure, [{key: 'getStreamId', value: value_39530}, {key: 'getUserStreamData', value: value_39531}, {key: 'getTimedoutVideos', value: value_39532}, {key: 'getTimedoutVideo', value: value_39533}]); } function RTC_CONNECTION_VIDEO_39536({userId, guildId, streamId, context}) { // fn#39536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:1664, offset: 0x010e459c, size: 169 bytes, params: 2, frame: 19 var r6; var r2; var property; var object2; if (streamId != null) { if (!(userId in env0_9)) { env0_9[userId] = {}; } property = env0_9[userId]; property = property[guildId ?? NULL_STRING_GUILD_ID]; r6 = property ?? ({}); property = env0_9[userId]; r2 = guildId ?? NULL_STRING_GUILD_ID; object2 = {}; copyDataProperties(object2, r6, undefined); object2[context] = {streamId: streamId}; property[r2] = object2; delete env0_10[makeTimeoutKey(context, userId)]; } else { clearUser_39527(userId, guildId, context); } } function VOICE_STATE_UPDATES_39537({voiceStates}) { // fn#39537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:1948, offset: 0x010e4645, size: 32 bytes, params: 2, frame: 13 return voiceStates.reduce(_fun39538, false); } function VIDEO_STREAM_READY_TIMEOUT({videoStreamId, userId, streamKey, mediaContext}) { // fn#39539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:2248, offset: 0x010e46e6, size: 72 bytes, params: 2, frame: 17 env0_10[makeTimeoutKey(mediaContext, userId)] = {videoStreamId: videoStreamId, userId: userId, streamKey: streamKey, mediaContext: mediaContext}; } function CLEAR_VIDEO_STREAM_READY_TIMEOUT({mediaContext, userId}) { // fn#39540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:2453, offset: 0x010e472e, size: 57 bytes, params: 2, frame: 14 const timeoutKey = makeTimeoutKey(mediaContext, userId); if (env0_10[timeoutKey] == null) { return false; } delete env0_10[timeoutKey]; } function value_39530(a0, a1) { // fn#39530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:1035, offset: 0x010e44b2, size: 92 bytes, params: 3, frame: 8 const value = a1; const value2 = a2; const value3 = undefined; const r4 = value2 !== value3 ? value2 : MediaEngineContextTypes.DEFAULT; const property = env1_9[a0]; return property == null || property[value ?? NULL_STRING_GUILD_ID] == null || property[value ?? NULL_STRING_GUILD_ID][r4] == null ? value3 : property[value ?? NULL_STRING_GUILD_ID][r4].streamId; } function value_39531(a0, a1) { // fn#39531, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:1182, offset: 0x010e450e, size: 77 bytes, params: 3, frame: 8 const value = a1; const value2 = a2; const value3 = undefined; const r2 = value2 !== value3 ? value2 : MediaEngineContextTypes.DEFAULT; const property = env1_9[a0]; return property == null || property[value ?? NULL_STRING_GUILD_ID] == null ? value3 : property[value ?? NULL_STRING_GUILD_ID][r2]; } function value_39533(a0, a1) { // fn#39533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:1359, offset: 0x010e455b, size: 31 bytes, params: 3, frame: 14 return env1_10[makeTimeoutKey(a0, a1)]; } function _fun39538(a0, {userId, sessionId, channelId, guildId}) { // fn#39538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4787:2015, offset: 0x010e4665, size: 129 bytes, params: 3, frame: 21 var value; if (channelId != null) { if (channelId != null) { return a0; } value = environment.__proto__; if (env1_9[userId]?.[guildId ?? NULL_STRING_GUILD_ID] == null) { return a0; } clearUser_39527(userId, guildId); } else { if (userId === env1_7) { if (sessionId !== env1_8) { return a0; } env1_9 = {}; env1_10 = {}; return true; } if (channelId != null) { return a0; } if (env1_9[userId]?.[guildId ?? NULL_STRING_GUILD_ID] == null) { return a0; } clearUser_39527(userId, guildId); } return true; }