/* Metro module 13071; source: modules/voice_overlay/native/MobileVoiceOverlayLifecycleManager.android.tsx; dependencies: [15, 17, 18, 6, 7, 1379, 1935, 1867, 4259, 3784, 4294, 3793, 4607, 1878, 4297, 10815, 661, 13072, 13073, 13074, 13075, 8160, 12107, 13076, 13077, 8146, 1244, 13078, 10822, 4020, 7145, 4805, 6526, 683, 4863, 63, 4561, 2] */ function _fun99852(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#99852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:6, offset: 0x021d74b7, size: 1284 bytes, params: 8, frame: 25 const env0_0 = require; const _arrayLikeToArray_99858 = 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_3 = importDefault(15) /* metro dependency 15 */; const env0_4 = importDefault(17) /* metro dependency 17 */; const env0_5 = importDefault(18) /* metro dependency 18 */; const env0_6 = importDefault(6) /* metro dependency 6 */; const env0_7 = importDefault(7) /* metro dependency 7 */; const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */; const env0_9 = (require(1935) /* metro dependency 1935: GuildChannelStore */).GUILD_VOCAL_CHANNELS_KEY; const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */; let value = importDefault(4259) /* metro dependency 4259: MediaEngineStore */; const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */; const rtcConnectionStore = importDefault(4294) /* metro dependency 4294: RTCConnectionStore */; const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */; const speakingStore = importDefault(4607) /* metro dependency 4607: SpeakingStore */; const userStore = importDefault(1878) /* metro dependency 1878: UserStore */; const voiceStateStore = importDefault(4297) /* metro dependency 4297: VoiceStateStore */; const mobileVoiceOverlayStore = importDefault(10815) /* metro dependency 10815: MobileVoiceOverlayStore */; const constantsModule = require(661) /* metro dependency 661: Constants */; const env0_19 = constantsModule.AnalyticEvents; const env0_20 = constantsModule.Permissions; require(13072) /* metro dependency 13072 */; require(13073) /* metro dependency 13073 */; require(13074) /* metro dependency 13074 */; require(13075) /* metro dependency 13075 */; require(8160) /* metro dependency 8160 */; require(12107) /* metro dependency 12107 */; require(13076) /* metro dependency 13076 */; require(13077) /* metro dependency 13077 */; require(8146) /* metro dependency 8146 */; object = [voiceStateStore, rtcConnectionStore, value]; object = {DISABLED: 0}; object[0] = 'DISABLED'; object.NOT_SHOWING = 1; object[1] = 'NOT_SHOWING'; object.WAITING_FOR_SERVICE = 2; object[2] = 'WAITING_FOR_SERVICE'; object.SHOWING = 3; object[3] = 'SHOWING'; object = {}; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; let string = intl.string; const t = (require(1244) /* metro dependency 1244: indexNative */).t; const CVxXDM = t.CVxXDM; object.useSpeaker = Reflect.apply(string, intl, [CVxXDM]); object.mute = intl.string(t.w4m945); object.disconnectFromVoice = intl.string(t['/lEZpt']); string = intl.string; const JYzIWe = t.JYzIWe; object.getInvite = Reflect.apply(string, intl, [JYzIWe]); object.switchChannels = intl.string(t.zJvWqU); object.openDiscord = intl.string(t['G/Ez6p']); string = intl.string; const OhctG7 = t.OhctG7; object.inviteLinkCopied = Reflect.apply(string, intl, [OhctG7]); object.channelSelect = intl.string(t.r2ptsz); object.closeWindow = intl.string(t.gaifwY); object.searchChannels = intl.string(t.wM7uRI); object.noResults = intl.string(t.wk3qsA); value = _fun99859(); value = new value(); const env0_25 = _fun99889(); value = importDefault(4561) /* metro dependency 4561: LifecycleManager */; value = _fun99893(value); value = new value(); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_overlay/native/MobileVoiceOverlayLifecycleManager.android.tsx'); exports.default = value; } function _isNativeReflectConstruct_99853() { // fn#99853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:339, offset: 0x021d79bb, size: 98 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_99853_isNativeReflectConstruct = function() { return !!result; })(); } function _createForOfIteratorHelperLoose_99856(a0, a1) { // fn#99856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:532, offset: 0x021d7a1d, size: 372 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 _fun99857; } value = undefined; if (a0) { if (typeof a0 === 'string') { value = _arrayLikeToArray_99858(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_99858(a0, value); r6 = value; } else { regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', ''); if (regexp.test(r9)) { value = _arrayLikeToArray_99858(a0, value); r6 = value; } else { r6 = value; } } r5 = r6; } } else { r5 = value; } if (r5) { if (r5) { } return _fun99857; } 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 _fun99859() { // fn#99859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:2330, offset: 0x021d7b91, size: 84 bytes, params: 1, frame: 15 return env0_7(MobileVoiceOverlayManager, [{key: 'initialize', value: value_99887}, {key: 'terminate', value: function() { MobileVoiceOverlayStore.removeChangeListener(this.handleMobileVoiceOverlayStoreUpdate); this.unsubscribeFromVoiceStateStoreUpdates(); this.unsubscribeFromNativeEvents(); }}]); } function _fun99889() { // fn#99889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:8343, offset: 0x021d89e5, size: 88 bytes, params: 1, frame: 15 return env0_7(NativeCallableInterface, [{key: 'onLayoutTrashed', value: function() { this.manager.handleLayoutTrashed(); }}, {key: 'onChannelQueryUpdate', value: function(a0) { this.manager.handleChannelQueryUpdate(a0); }}]); } function _fun99893(a0) { // fn#99893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:8623, offset: 0x021d8a93, size: 97 bytes, params: 2, frame: 16 const closure = MobileVoiceOverlayLifecycleManager; env0_5(closure, a0); return env0_7(closure, [{key: '_initialize', value: value_99895}, {key: '_terminate', value: value_99896}]); } function MobileVoiceOverlayManager() { // fn#99860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:2351, offset: 0x021d7be5, size: 314 bytes, params: 1, frame: 15 env1_6(this, MobileVoiceOverlayManager); this.currentVoiceChannelId = null; this.trashedVoiceChannelId = null; const DISABLED = env1_22.DISABLED; this.overlayState = DISABLED; this.channelSelectorResults = []; this.layoutTrashedSubscription = null; this.channelQueryUpdateSubscription = null; this.isBatchedBridgeInitialized = false; this.handleMobileVoiceOverlayStoreUpdate = handleMobileVoiceOverlayStoreUpdate; this.handleOverlayEnable = handleOverlayEnable; this.subscribeToVoiceStateStoreUpdates = subscribeToVoiceStateStoreUpdates; this.unsubscribeFromVoiceStateStoreUpdates = unsubscribeFromVoiceStateStoreUpdates; this.isSubscribedToVoiceStateStoreUpdates = isSubscribedToVoiceStateStoreUpdates; this.subscribeToNativeEvents = subscribeToNativeEvents; this.unsubscribeFromNativeEvents = unsubscribeFromNativeEvents; this.handleOverlayUIStoreUpdate = handleOverlayUIStoreUpdate; this.updateOverlayUI = updateOverlayUI; this.getVoiceConnectedGuildAndChannel = getVoiceConnectedGuildAndChannel; this.refreshChannelSelectorResults = refreshChannelSelectorResults; this.showOverlay = showOverlay; this.hideOverlay = hideOverlay; this.isOverlayShowing = isOverlayShowing; this.getOverlayUser = getOverlayUser; this.handleLayoutTrashed = handleLayoutTrashed; this.handleChannelQueryUpdate = handleChannelQueryUpdate; } function value_99887() { // fn#99887, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:7871, offset: 0x021d8905, size: 173 bytes, params: 1, frame: 16 var defaultImport; var registerCallableModule; var binding; var value2; var binding2; if (!((require(4020) /* metro dependency 4020: FabricUtils */).isFabric() || this.isBatchedBridgeInitialized)) { defaultImport = importDefault(63) /* metro dependency 63 */; registerCallableModule = defaultImport.registerCallableModule; binding = env1_25; value2 = Object.create(binding.prototype, {constructor: {value: binding}}); binding2 = new binding(this); Reflect.apply(registerCallableModule, defaultImport, ['MobileVoiceOverlayManager', binding2 instanceof Object ? binding2 : value2]); this.isBatchedBridgeInitialized = true; } const getEnabled = MobileVoiceOverlayStore.getEnabled; if (Reflect.apply(getEnabled, MobileVoiceOverlayStore, [])) { this.handleOverlayEnable(); } MobileVoiceOverlayStore.addChangeListener(this.handleMobileVoiceOverlayStoreUpdate); } function NativeCallableInterface(a0) { // fn#99890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:8364, offset: 0x021d8a3d, size: 36 bytes, params: 2, frame: 13 env1_6(this, NativeCallableInterface); this.manager = a0; } function MobileVoiceOverlayLifecycleManager() { // fn#99894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:8635, offset: 0x021d8af4, size: 113 bytes, params: 1, frame: 20 const value = environment.__proto__; env1_6(this, MobileVoiceOverlayLifecycleManager); const value3 = env1_4(MobileVoiceOverlayLifecycleManager); return env1_3(this, _isNativeReflectConstruct_99853() ? global.Reflect.construct(value3, arguments, env1_4(this).constructor) : value3.apply(this, arguments)); } function value_99895() { // fn#99895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:9024, offset: 0x021d8b65, size: 21 bytes, params: 1, frame: 9 env1_24.initialize(); } function value_99896() { // fn#99896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:9076, offset: 0x021d8b7a, size: 21 bytes, params: 1, frame: 9 env1_24.terminate(); } function handleMobileVoiceOverlayStoreUpdate() { // fn#99861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:2699, owner: MobileVoiceOverlayManager.handleMobileVoiceOverlayStoreUpdate, offset: 0x021d7d1f, size: 147 bytes, params: 1, frame: 14 var isOverlayShowing2; const value = environment.__proto__.__proto__; const enabled = MobileVoiceOverlayStore.getEnabled(); const binding = env0_0; if (enabled) { binding.handleOverlayEnable(); } else { binding.unsubscribeFromVoiceStateStoreUpdates(); binding.unsubscribeFromNativeEvents(); isOverlayShowing2 = binding.isOverlayShowing(); binding.overlayState = env2_22.DISABLED; if (isOverlayShowing2) { if ((importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */) != null) { (importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */).hideOverlay(); } } } } function handleOverlayEnable() { // fn#99862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:2964, owner: MobileVoiceOverlayManager.handleOverlayEnable, offset: 0x021d7db2, size: 110 bytes, params: 1, frame: 14 var environment; let value = environment.__proto__.__proto__; if ((importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */) != null) { value = importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */; value = value.enableOverlay(); value = value.then(_fun99864); value.catch(function() { handleEnableFail(); }); } } function subscribeToVoiceStateStoreUpdates() { // fn#99866, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:3304, owner: MobileVoiceOverlayManager.subscribeToVoiceStateStoreUpdates, offset: 0x021d7ea6, size: 50 bytes, params: 1, frame: 11 var environment; const binding = env0_0; if (!binding.isSubscribedToVoiceStateStoreUpdates()) { value = environment.__proto__.__proto__; env2_21.forEach(_fun99867); } } function unsubscribeFromVoiceStateStoreUpdates() { // fn#99868, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:3469, owner: MobileVoiceOverlayManager.unsubscribeFromVoiceStateStoreUpdates, offset: 0x021d7ef7, size: 50 bytes, params: 1, frame: 11 var environment; const binding = env0_0; if (binding.isSubscribedToVoiceStateStoreUpdates()) { value = environment.__proto__.__proto__; env2_21.forEach(_fun99869); } } function isSubscribedToVoiceStateStoreUpdates() { // fn#99870, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:3636, owner: MobileVoiceOverlayManager.isSubscribedToVoiceStateStoreUpdates, offset: 0x021d7f48, size: 35 bytes, params: 1, frame: 11 var environment; const value = environment.__proto__.__proto__; return env2_21.find(_fun99871) != null; } function subscribeToNativeEvents() { // fn#99872, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:3744, owner: MobileVoiceOverlayManager.subscribeToNativeEvents, offset: 0x021d7f8d, size: 126 bytes, params: 1, frame: 16 var binding; let value = environment.__proto__.__proto__; const fabricUtilsModule = require(4020) /* metro dependency 4020: FabricUtils */; if (fabricUtilsModule.isFabric()) { binding = env0_0; value = importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */; binding.layoutTrashedSubscription = value.onLayoutTrashed(binding.handleLayoutTrashed); value = importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */; binding.channelQueryUpdateSubscription = value.onChannelQueryUpdate(binding.handleChannelQueryUpdate); } } function unsubscribeFromNativeEvents() { // fn#99873, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:3986, owner: MobileVoiceOverlayManager.unsubscribeFromNativeEvents, offset: 0x021d800b, size: 93 bytes, params: 1, frame: 13 var layoutTrashedSubscription; var channelQueryUpdateSubscription; let value = environment.__proto__.__proto__; value = require(4020) /* metro dependency 4020: FabricUtils */; if (value.isFabric()) { layoutTrashedSubscription = env0_0.layoutTrashedSubscription; if (layoutTrashedSubscription != null) { layoutTrashedSubscription.remove(); } channelQueryUpdateSubscription = env0_0.channelQueryUpdateSubscription; if (channelQueryUpdateSubscription != null) { channelQueryUpdateSubscription.remove(); } } } function handleOverlayUIStoreUpdate() { // fn#99874, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:4167, owner: MobileVoiceOverlayManager.handleOverlayUIStoreUpdate, offset: 0x021d8068, size: 297 bytes, params: 1, frame: 14 var r0; var value3; const overlayState = env0_0.overlayState; const DISABLED = env2_22.DISABLED; if (overlayState !== DISABLED) { var binding = env0_0; var getVoiceConnectedGuildAndChannel = binding.getVoiceConnectedGuildAndChannel; var currentVoiceChannelId = Reflect.apply(getVoiceConnectedGuildAndChannel, binding, []).currentVoiceChannelId; if (currentVoiceChannelId !== binding.currentVoiceChannelId) { binding = env0_0; binding.currentVoiceChannelId = currentVoiceChannelId; binding.trashedVoiceChannelId = null; } if (currentVoiceChannelId == null) { binding = env0_0; if (binding.isOverlayShowing()) { env0_0.hideOverlay(); } return undefined; } if (currentVoiceChannelId !== env0_0.trashedVoiceChannelId) { if (env0_0.overlayState !== env2_22.WAITING_FOR_SERVICE) { if (env0_0.overlayState === env2_22.NOT_SHOWING) { value3 = undefined; (importDefault(7145) /* metro dependency 7145: ForegroundServiceManagerAndroid */).isForegroundServiceRunning(_fun99875); env0_0.overlayState = env2_22.WAITING_FOR_SERVICE; r0 = value3; } else { if (env0_0.overlayState === env2_22.SHOWING) { env0_0.updateOverlayUI(); } r0 = undefined; } return r0; } return undefined; } binding = env0_0; if (binding.isOverlayShowing()) { env0_0.hideOverlay(); } } } function updateOverlayUI() { // fn#99876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:4777, owner: MobileVoiceOverlayManager.updateOverlayUI, offset: 0x021d81c1, size: 738 bytes, params: 1, frame: 29 var id; var r3; var r14; var r13; var userId; var name; var r11; var value5; var binding; var getVoiceConnectedGuildAndChannel; var value6; var currentGuildId; var currentVoiceChannelId; var getChannel; var value7; var getOverlayUser; var value8; var getVoiceStatesForChannel; var value9; var Object; var keys; var value10; var speaking; var value11; var value12; var done; var value13; var value14; var value15; var items2; var userId2; var push; var length; var value16; var property; var value17; var value18; var overlayState; var SHOWING; var refreshChannelSelectorResults; var defaultImport; var setData; var object2; var moduleValue; var computeChannelName; var getGuild; var value19; var value20; var length2; var isSelfDeaf; var isSelfMute; var getQuality; var can; var CREATE_INSTANT_INVITE; var channelSelectorResults; const currentUser = UserStore.getCurrentUser(); const value3 = null; const value4 = undefined; reducibleJoin2: while (true) { if (value3 == currentUser) { id = value4; break reducibleJoin2; } id = currentUser.id; break reducibleJoin2; } reducibleJoin29: while (true) { if (value3 == id) { break reducibleJoin29; } value5 = environment; binding = env0_0; getVoiceConnectedGuildAndChannel = binding.getVoiceConnectedGuildAndChannel; value6 = Reflect.apply(getVoiceConnectedGuildAndChannel, binding, []); currentGuildId = value6.currentGuildId; currentVoiceChannelId = value6.currentVoiceChannelId; getChannel = ChannelStore.getChannel; value7 = Reflect.apply(getChannel, ChannelStore, [currentVoiceChannelId]); if (value3 == currentVoiceChannelId) { break reducibleJoin29; } if (value3 == value7) { break reducibleJoin29; } binding = env0_0; getOverlayUser = binding.getOverlayUser; value8 = Reflect.apply(getOverlayUser, binding, [id]); if (value3 == value8) { break reducibleJoin29; } getVoiceStatesForChannel = VoiceStateStore.getVoiceStatesForChannel; value9 = Reflect.apply(getVoiceStatesForChannel, VoiceStateStore, [currentVoiceChannelId]); Object = global.Object; keys = Object.keys; value10 = Reflect.apply(keys, Object, [value9]); speaking = value8.speaking; reducibleJoin11: while (true) { if (speaking) { r14 = value8; break reducibleJoin11; } value11 = _createForOfIteratorHelperLoose_99856(value10); value12 = value11(); done = value12.done; if (done) { r14 = value3; break reducibleJoin11; } r3 = value12; reducibleLoop8: while (true) { value13 = r3.value; binding = env0_0; getOverlayUser = binding.getOverlayUser; value14 = Reflect.apply(getOverlayUser, binding, [value13]); if (value3 != value14) { speaking = value14.speaking; reducibleJoin10: while (true) { if (speaking) { r14 = value14; break reducibleJoin11; } break reducibleJoin10; } } value15 = value11(); done = value15.done; if (done) { r14 = value3; break reducibleJoin11; } r3 = value15; continue reducibleLoop8; } } if (value3 == r14) { r14 = value8; } items2 = [r14]; userId = r14.userId; userId2 = value8.userId; reducibleJoin14: while (true) { if (userId === userId2) { break reducibleJoin14; } push = items2.push; Reflect.apply(push, items2, [value8]); break reducibleJoin14; } length = value10.length; value16 = 0; if (value16 < length) { r13 = value16; reducibleLoop15: while (true) { property = value10[r13]; if (property !== id) { reducibleJoin18: while (true) { if (value3 == r14) { userId = value4; break reducibleJoin18; } userId = r14.userId; break reducibleJoin18; } reducibleJoin21: while (true) { if (property === userId) { break reducibleJoin21; } binding = env0_0; getOverlayUser = binding.getOverlayUser; value17 = Reflect.apply(getOverlayUser, binding, [property]); if (value3 == value17) { break reducibleJoin21; } push = items2.push; Reflect.apply(push, items2, [value17]); length = items2.length; if (length >= 3) { break reducibleLoop15; } break reducibleJoin21; } } value18 = typeof r13 === 'bigint' ? r13 + 1n : +r13 + 1; length = value10.length; if (value18 < length) { r13 = value18; continue reducibleLoop15; } break reducibleLoop15; } } overlayState = env0_0.overlayState; SHOWING = env2_22.SHOWING; reducibleJoin24: while (true) { if (overlayState === SHOWING) { break reducibleJoin24; } binding = env0_0; refreshChannelSelectorResults = binding.refreshChannelSelectorResults; Reflect.apply(refreshChannelSelectorResults, binding, ['']); break reducibleJoin24; } env0_0.currentVoiceChannelId = currentVoiceChannelId; if (value3 == (importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */)) { break reducibleJoin29; } defaultImport = importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */; setData = defaultImport.setData; object2 = {users: items2}; moduleValue = require(4805) /* metro dependency 4805: useChannelName */; computeChannelName = moduleValue.computeChannelName; object2.channelName = Reflect.apply(computeChannelName, moduleValue, [value7, UserStore, RelationshipStore]); getGuild = GuildStore.getGuild; value19 = Reflect.apply(getGuild, GuildStore, [currentGuildId]); reducibleJoin27: while (true) { if (value3 == value19) { name = value4; break reducibleJoin27; } name = value19.name; break reducibleJoin27; } value20 = ''; r11 = value3 != name ? name : value20; object2.guildName = r11; object2.guildId = currentGuildId; object2.channelId = currentVoiceChannelId; length = value10.length; length2 = items2.length; object2.extraUsers = length - length2; isSelfDeaf = MediaEngineStore.isSelfDeaf; object2.deafened = Reflect.apply(isSelfDeaf, MediaEngineStore, []); isSelfMute = MediaEngineStore.isSelfMute; object2.muted = Reflect.apply(isSelfMute, MediaEngineStore, []); getQuality = RTCConnectionStore.getQuality; object2.connectionQuality = Reflect.apply(getQuality, RTCConnectionStore, []); can = PermissionStore.can; CREATE_INSTANT_INVITE = Permissions.CREATE_INSTANT_INVITE; object2.canGenerateInvite = Reflect.apply(can, PermissionStore, [CREATE_INSTANT_INVITE, value7]); channelSelectorResults = env0_0.channelSelectorResults; object2.channelSelectorResults = channelSelectorResults; Reflect.apply(setData, defaultImport, [object2]); break reducibleJoin29; } return value4; } function getVoiceConnectedGuildAndChannel() { // fn#99877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:5983, owner: MobileVoiceOverlayManager.getVoiceConnectedGuildAndChannel, offset: 0x021d84a3, size: 71 bytes, params: 1, frame: 13 const object2 = {}; let value = environment.__proto__.__proto__; const guildId = RTCConnectionStore.getGuildId(); const value3 = null; object2.currentGuildId = value3 != guildId ? guildId : value3; value = RTCConnectionStore.getChannelId(); object2.currentVoiceChannelId = value3 != value ? value : value3; return object2; } function refreshChannelSelectorResults(a0) { // fn#99878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:6143, owner: MobileVoiceOverlayManager.refreshChannelSelectorResults, offset: 0x021d84ea, size: 158 bytes, params: 2, frame: 17 var environment; const currentGuildId = a0.length !== 0 ? null : env0_0.getVoiceConnectedGuildAndChannel().currentGuildId; const binding = env0_0; value = environment.__proto__.__proto__; const defaultImport = importDefault(6526) /* metro dependency 6526: AutocompleteUtils */; binding.channelSelectorResults = defaultImport.queryChannels({query: a0, guildId: currentGuildId, limit: 15, fuzzy: true, filter: filter_99879, type: GUILD_VOCAL_CHANNELS_KEY, allowEmptyQueries: true}).map(_fun99880); } function showOverlay() { // fn#99881, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:6715, owner: MobileVoiceOverlayManager.showOverlay, offset: 0x021d8685, size: 261 bytes, params: 1, frame: 24 let binding = env0_0; const voiceConnectedGuildAndChannel = binding.getVoiceConnectedGuildAndChannel(); const currentGuildId = voiceConnectedGuildAndChannel.currentGuildId; const channel = ChannelStore.getChannel(voiceConnectedGuildAndChannel.currentVoiceChannelId); const rTCConnectionId = RTCConnectionStore.getRTCConnectionId(); const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; const track = defaultImport.track; const MOBILE_OVERLAY_OPENED = AnalyticEvents.MOBILE_OVERLAY_OPENED; const object2 = {type: 'voice', rtc_connection_id: rTCConnectionId}; const appAnalyticsUtilsModule = require(4863) /* metro dependency 4863: AppAnalyticsUtils */; copyDataProperties(object2, appAnalyticsUtilsModule.collectChannelAnalyticsMetadata(channel), channel); const moduleValue2 = appAnalyticsUtilsModule; copyDataProperties(object2, moduleValue2.collectGuildAnalyticsMetadata(currentGuildId), channel); Reflect.apply(track, defaultImport, [MOBILE_OVERLAY_OPENED, object2]); if ((importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */) != null) { (importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */).showOverlay(env2_23); } binding = env0_0; binding.updateOverlayUI(); const SHOWING = env2_22.SHOWING; binding.overlayState = SHOWING; } function hideOverlay() { // fn#99882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:7132, owner: MobileVoiceOverlayManager.hideOverlay, offset: 0x021d878a, size: 173 bytes, params: 1, frame: 21 const rTCConnectionId = RTCConnectionStore.getRTCConnectionId(); const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; let track = defaultImport.track; let MOBILE_OVERLAY_CLOSED = AnalyticEvents.MOBILE_OVERLAY_CLOSED; Reflect.apply(track, defaultImport, [MOBILE_OVERLAY_CLOSED, {type: 'voice', rtc_connection_id: rTCConnectionId}]); const defaultImport2 = defaultImport; track = defaultImport2.track; MOBILE_OVERLAY_CLOSED = AnalyticEvents.MOBILE_OVERLAY_CLOSED; Reflect.apply(track, defaultImport2, [MOBILE_OVERLAY_CLOSED, {}]); if ((importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */) != null) { (importDefault(13078) /* metro dependency 13078: NativeMobileVoiceOverlayModule */).hideOverlay(); } const binding = env0_0; const NOT_SHOWING = env2_22.NOT_SHOWING; binding.overlayState = NOT_SHOWING; } function isOverlayShowing() { // fn#99883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:7378, owner: MobileVoiceOverlayManager.isOverlayShowing, offset: 0x021d8837, size: 59 bytes, params: 1, frame: 4 const overlayState = env0_0.overlayState; const SHOWING = env2_22.SHOWING; return overlayState === SHOWING || env0_0.overlayState === env2_22.WAITING_FOR_SERVICE; } function getOverlayUser(a0) { // fn#99884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:7475, owner: MobileVoiceOverlayManager.getOverlayUser, offset: 0x021d8872, size: 79 bytes, params: 2, frame: 13 const value = environment.__proto__.__proto__; const user = UserStore.getUser(a0); if (user == null) { return null; } return {userId: a0, avatar: user.avatar, speaking: SpeakingStore.isSpeaking(a0), discriminator: user.discriminator}; } function handleLayoutTrashed() { // fn#99885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:7643, owner: MobileVoiceOverlayManager.handleLayoutTrashed, offset: 0x021d88c1, size: 33 bytes, params: 1, frame: 9 const binding = env0_0; binding.trashedVoiceChannelId = binding.currentVoiceChannelId; binding.handleOverlayUIStoreUpdate(); } function handleChannelQueryUpdate(a0) { // fn#99886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:7767, owner: MobileVoiceOverlayManager.handleChannelQueryUpdate, offset: 0x021d88e2, size: 35 bytes, params: 2, frame: 11 const binding = env0_0; binding.refreshChannelSelectorResults(a0); binding.handleOverlayUIStoreUpdate(); } function handleEnableFail() { // fn#99863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:2990, owner: MobileVoiceOverlayManager.handleOverlayEnable.handleEnableFail, offset: 0x021d7e20, size: 63 bytes, params: 1, frame: 13 (importDefault(10822) /* metro dependency 10822: MobileVoiceOverlayActionCreators */).setEnabled(false); const binding = env1_0; const DISABLED = env3_22.DISABLED; binding.overlayState = DISABLED; } function _fun99864(a0) { // fn#99864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:3096, offset: 0x021d7e5f, size: 71 bytes, params: 2, frame: 9 var value; var binding; if (a0) { value = environment.__proto__; binding = env1_0; binding.subscribeToVoiceStateStoreUpdates(); binding.subscribeToNativeEvents(); value = environment.__proto__.__proto__.__proto__; binding.overlayState = env3_22.NOT_SHOWING; } else { handleEnableFail(); } } function _fun99867(a0) { // fn#99867, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:3365, offset: 0x021d7ed8, size: 31 bytes, params: 2, frame: 11 a0.addChangeListener(env1_0.handleOverlayUIStoreUpdate); } function _fun99869(a0) { // fn#99869, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:3530, offset: 0x021d7f29, size: 31 bytes, params: 2, frame: 11 a0.removeChangeListener(env1_0.handleOverlayUIStoreUpdate); } function _fun99871({_changeCallbacks}) { // fn#99871, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:3654, offset: 0x021d7f6b, size: 34 bytes, params: 2, frame: 11 return _changeCallbacks.has(env1_0.handleOverlayUIStoreUpdate); } function _fun99875(a0) { // fn#99875, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:4538, offset: 0x021d8191, size: 48 bytes, params: 2, frame: 9 const binding = env1_0; if (a0) { binding.showOverlay(); } else { value = environment.__proto__.__proto__.__proto__; binding.overlayState = env3_22.NOT_SHOWING; } } function refreshChannelSelectorResultsFilter(a0) { // fn#99879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:6321, owner: MobileVoiceOverlayManager.refreshChannelSelectorResults.filter, offset: 0x021d8588, size: 43 bytes, params: 2, frame: 10 const id = a0.id; const value = environment.__proto__; return id !== env1_0.currentVoiceChannelId && !a0.isGuildStageVoice(); } function _fun99880({record}) { // fn#99880, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13261:6417, offset: 0x021d85b3, size: 210 bytes, params: 2, frame: 20 const object2 = {}; object2.channelId = record.id; object2.guildId = record.guild_id; const value = environment.__proto__.__proto__.__proto__; object2.channelName = (require(4805) /* metro dependency 4805: useChannelName */).computeChannelName(record, UserStore, RelationshipStore); const name = GuildStore.getGuild(record.guild_id)?.name; const value4 = ''; object2.guildName = name ?? value4; const channel = ChannelStore.getChannel(record.parent_id); object2.categoryName = channel != null ? (require(4805) /* metro dependency 4805: useChannelName */).computeChannelName(channel, UserStore, RelationshipStore) : value4; return object2; }