/* Metro module 4612; source: hooks/useIsSpeaking.tsx; dependencies: [4613, 1934, 4607, 4297, 566, 2] */ import SelectedChannelStore from '../stores/SelectedChannelStore.tsx'; /* Metro dependency 1934 */ import VoiceStateStore from '../stores/VoiceStateStore.tsx'; /* Metro dependency 4297 */ import SpeakingStore from '../stores/SpeakingStore.tsx'; /* Metro dependency 4607 */ import SoundboardStore from '../modules/soundboard/SoundboardStore.tsx'; /* Metro dependency 4613 */ import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as FluxModule from '../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ function _fun39574(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#39574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4790:6, offset: 0x010e5b07, size: 180 bytes, params: 8, frame: 19 const env0_0 = require; const _checkIsSpeaking = function(a0, a1, a2) { var value = a0; var value2 = a1; var value3 = a2; var r0 = value || value2; r0 = !r0 ? value3 : r0; return r0; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('hooks/useIsSpeaking.tsx'); exports.default = useIsSpeaking; exports.getIsSpeaking = getIsSpeaking; function useIsSpeaking({userId, checkSoundSharing, checkSoundboardSounds, checkIsMuted, context}) { // fn#39576, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4790:251, offset: 0x010e5bd2, size: 308 bytes, params: 2, frame: 21 if (checkSoundSharing !== undefined) { } if (checkSoundboardSounds !== undefined) { } checkIsMuted = !(checkIsMuted === undefined) && checkIsMuted; let useStateFromStores = FluxModule.useStateFromStores; const value6 = Reflect.apply(useStateFromStores, FluxModule, [[VoiceStateStore, SelectedChannelStore], _fun39577]); const env0_4 = checkIsMuted && (value6?.mute || value6?.selfMute); useStateFromStores = FluxModule.useStateFromStores; const speakingStoreBinding = SpeakingStore; const value7 = Reflect.apply(useStateFromStores, FluxModule, [[speakingStoreBinding], _fun39578]); const value8 = FluxModule.useStateFromStores([speakingStoreBinding], function() { return SpeakingStore.isSoundSharing(userId) && checkSoundSharing; }); const _checkIsSpeakingBinding = _checkIsSpeaking; useStateFromStores = FluxModule.useStateFromStores; return _checkIsSpeakingBinding(value7, Reflect.apply(useStateFromStores, FluxModule, [[SoundboardStore], function() { return SoundboardStore.isUserPlayingSounds(userId) && checkSoundboardSounds; }]), value8); function _fun39577() { // fn#39577, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4790:404, offset: 0x010e5d06, size: 51 bytes, params: 1, frame: 14 const value = environment.__proto__; const voiceChannelId = SelectedChannelStore.getVoiceChannelId(); const value3 = null; return value3 != voiceChannelId ? VoiceStateStore.getVoiceStateForChannel(voiceChannelId, userId) : value3; } function _fun39578() { // fn#39578, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4790:585, offset: 0x010e5d39, size: 42 bytes, params: 1, frame: 14 const value = environment.__proto__; const speakingStoreBinding = SpeakingStore; return speakingStoreBinding.isSpeaking(userId, context) && !env0_4; } } function getIsSpeaking({userId, checkSoundSharing, checkSoundboardSounds, checkIsMuted, context}) { // fn#39581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:4790:788, offset: 0x010e5da7, size: 364 bytes, params: 2, frame: 25 var r2; var r3; var r9; var r10; var r6; var item3; var item4; var item5; let value = a1; checkSoundSharing = !(checkSoundSharing === undefined) && checkSoundSharing; checkSoundboardSounds = checkSoundboardSounds === undefined || checkSoundboardSounds; checkIsMuted = !(checkIsMuted === undefined) && checkIsMuted; const iterator = (value !== undefined ? value : [VoiceStateStore, SelectedChannelStore, SpeakingStore, SoundboardStore])[Symbol.iterator](); const iterator2 = iterator.next; let item2 = Reflect.apply(iterator2, iterator, []); let item = item2.value; item2 = item2.done ? undefined : iterator; const r12 = item2 === undefined ? undefined : item; if (value) { r3 = item2; r9 = undefined; r10 = value; } else { item3 = Reflect.apply(iterator2, item2, []); item = item3.value; item3 = item3.done ? undefined : item2; value = item3 === undefined; if (value) { r3 = item3; r9 = undefined; r10 = value; } else { r3 = item3; r9 = item; r10 = value; } } if (r10) { r2 = undefined; } else { item4 = Reflect.apply(iterator2, r3, []); item = item4.value; item4 = item4.done ? undefined : r3; value = item4 === undefined; if (value) { r2 = undefined; r3 = item4; r10 = value; } else { r2 = item; r3 = item4; r10 = value; } } if (r10) { r6 = undefined; } else { item5 = Reflect.apply(iterator2, r3, []); item = item5.value; item5 = item5.done ? undefined : r3; value = item5 === undefined; if (value) { r3 = item5; r6 = undefined; r10 = value; } else { r3 = item5; r6 = item; r10 = value; } } if (!r10) { r3.return(); } value = r9.getVoiceChannelId(); if (value != null) { value = r12.getVoiceStateForChannel(value, userId); r10 = value; } else { r10 = null; } r3 = r2.isSpeaking(userId, context) && !(checkIsMuted && (r10?.mute || r10?.selfMute)); r2 = r2.isSoundSharing(userId) && checkSoundSharing; return _checkIsSpeaking(r3, r6.isUserPlayingSounds(userId) && checkSoundboardSounds, r2); } } global.__d(_fun39574, 4612, [4613, 1934, 4607, 4297, 566, 2]) /* metro module 4612, dependencies: [4613, 1934, 4607, 4297, 566, 2] */;