/* Metro module 12115; source: modules/voice_calls/native/CallStateHooks.tsx; dependencies: [4606, 1226, 4258, 4294, 661, 4299, 566, 9325, 2] */ import AuthenticationStore from '../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */ import CallStore from '../../../stores/CallStore.tsx'; /* Metro dependency 4258 */ import RTCConnectionStore from '../../../stores/RTCConnectionStore.tsx'; /* Metro dependency 4294 */ import ChannelRTCStore from '../../calls/ChannelRTCStore.tsx'; /* Metro dependency 4606 */ import UseVoiceStateForRemoteSession from '../../game_console/hooks/useVoiceStateForRemoteSession.tsx'; /* Metro dependency 9325 */ 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 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ import * as CallConstantsModule from '../../calls/CallConstants.tsx'; /* Metro dependency 4299 */ function _fun93007(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#93007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12301:6, offset: 0x020a2a7e, size: 318 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); copyDataProperties({}, {initialized: false, callId: undefined}, undefined); (FileImportTrackerModule).fileFinishedImporting('modules/voice_calls/native/CallStateHooks.tsx'); exports.default = _default_93008; exports.CallStates = {DISCONNECTED: 'disconneted', DISCONNECTING: 'disconnecting', CONNECTING: 'connecting', RINGING: 'ringing', CONNECTED: 'connected'}; function _default_93008() { // fn#93008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12301:433, offset: 0x020a2bbc, size: 452 bytes, params: 1, frame: 28 const value = a0; const value2 = a1; const value3 = a2; const r10 = value !== undefined ? value : EMPTY_STRING_SNOWFLAKE_ID; const r6 = value2 !== undefined ? value2 : false; const r7 = value3 !== undefined ? value3 : false; const value5 = (FluxModule).useStateFromStoresArray([CallStore], _fun93009, [r10, AuthenticationStore.getId()]); const value7 = ChannelRTCStore.getParticipants(r10).filter(_fun93011); const value8 = (UseVoiceStateForRemoteSession)(); const useStateFromStores = FluxModule.useStateFromStores; const rtcConnectionStoreBinding = RTCConnectionStore; const getRTCConnectionId = rtcConnectionStoreBinding.getRTCConnectionId; const value10 = FluxModule.useStateFromStores([rtcConnectionStoreBinding], _fun93012, [Reflect.apply(useStateFromStores, FluxModule, [[rtcConnectionStoreBinding], getRTCConnectionId, []]), value8, r10]); const binding = env0_10; let initialized = binding.initialized; binding.initialized = initialized || r7; const CONNECTING = env0_11.CONNECTING; initialized = env0_10.initialized; return {state: r6 ? env0_11.DISCONNECTING : initialized && value10 === RTCConnectionStates.DISCONNECTED ? env0_11.DISCONNECTED : value5.length > 0 && value7.length === value5.length ? env0_11.RINGING : value10 !== RTCConnectionStates.RTC_CONNECTED ? CONNECTING : env0_11.CONNECTED, initialized: initialized}; function _fun93009() { // fn#93009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12301:506, offset: 0x020a2d80, size: 94 bytes, params: 1, frame: 13 var environment; const value = environment.__proto__; const call = CallStore.getCall(env0_0); const r0 = call != null ? call.ringing.filter(_fun93010) : []; const binding = env1_10; binding.initialized = binding.initialized || r0.length > 0; return r0; function _fun93010(a0) { // fn#93010, offset: 0x020a2dde, size: 16 bytes, params: 2, frame: 2 return a0 !== env1_1; } } function _fun93011(a0) { // fn#93011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12301:661, offset: 0x020a2dee, size: 51 bytes, params: 2, frame: 3 const type = a0.type; const value = environment.__proto__; const ACTIVITY = ParticipantTypes.ACTIVITY; return type !== ACTIVITY && a0.user.id !== env0_1; } function _fun93012() { // fn#93012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12301:805, offset: 0x020a2e21, size: 191 bytes, params: 1, frame: 13 var value; if (env0_2?.channelId === env0_0) { value = environment.__proto__; env1_10.initialized = true; return RTCConnectionStates.RTC_CONNECTED; } if (!(env0_3 != null && env1_10.callId === env0_3)) { env1_10.initialized = false; } const binding = env1_10; binding.callId = env0_3; value = RTCConnectionStore.getState(); binding.initialized = binding.initialized || value !== RTCConnectionStates.DISCONNECTED && value !== RTCConnectionStates.RTC_DISCONNECTED; return value; } } } global.__d(_fun93007, 12115, [4606, 1226, 4258, 4294, 661, 4299, 566, 9325, 2]) /* metro module 12115, dependencies: [4606, 1226, 4258, 4294, 661, 4299, 566, 9325, 2] */;