2026-08-25 06:04:03 +00:00
// Module ID: 4454
// Function ID: 4455
2026-07-29 08:29:29 +00:00
// Name: createRTCConnection
2026-08-25 06:04:03 +00:00
// Dependencies: [4397, 1218, 4455, 676, 4444, 3, 4456, 4478, 709, 13294, 4264, 4458, 5236, 13295, 589, 13297, 698, 2009, 2]
2026-07-20 16:05:17 +00:00
2026-08-25 06:04:03 +00:00
// Module 4454 (createRTCConnection)
2026-08-24 06:08:38 +00:00
import timestampDefault from "timestamp" /* 3 */ ;
import initializeDefault from "initialize" /* 589 */ ;
import dispatcherDefault from "dispatcher" /* 709 */ ;
2026-08-25 06:04:03 +00:00
import sleep from "sleep" /* 4458 */ ;
import updateVoiceStatesDefault from "updateVoiceStates" /* 13294 */ ;
import useIsSpatialAudioAvailable from "useIsSpatialAudioAvailable" /* 13295 */ ;
import trackVideoToggle from "trackVideoToggle" /* 13297 */ ;
import closure_5 from "set" /* 4397 */ ;
2026-08-24 06:08:38 +00:00
import closure_6 from "fetchFingerprint" /* 1218 */ ;
2026-08-25 06:04:03 +00:00
import closure_7 from "getVoiceStatesForGuild" /* 4455 */ ;
2026-08-24 06:08:38 +00:00
import ME from "ME" /* 676 */ ;
2026-08-25 06:04:03 +00:00
import { MediaEngineContextTypes } from "DesktopSources" /* 4444 */ ;
2026-08-24 06:08:38 +00:00
import promise from "expandEventProperties" /* 698 */ ;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1 ;
2026-08-25 06:04:03 +00:00
function createRTCConnection ( arg0 , arg1 , arg2 ) {
2026-07-29 08:29:29 +00:00
if ( null == closure_4 ) {
2026-07-20 16:05:17 +00:00
const _Error = Error ;
2026-08-24 06:08:38 +00:00
error = new Error ( "Creating RTCConnection without session." ) ;
2026-07-20 16:05:17 +00:00
throw error ;
} else {
const id = store . getId ( ) ;
2026-08-25 06:04:03 +00:00
let obj = { userId : null , sessionId : null , guildId : null , channelId : null , joinVoiceId : null , createdTime : null } ;
2026-07-29 08:29:29 +00:00
obj [ 0 ] = id ;
obj [ 1 ] = closure_4 ;
obj [ 2 ] = arg0 ;
obj [ 3 ] = arg1 ;
obj [ 4 ] = c23 ;
2026-08-25 06:04:03 +00:00
obj [ 5 ] = arg2 ;
_default = new _default ( 4456 ) . default ( obj ) ;
_default . on ( _default ( 4478 ) . RTCConnectionEvent . State , ( arg0 , arg1 , arg2 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
2026-07-29 08:29:29 +00:00
const callback = arg1 ;
2026-08-24 06:08:38 +00:00
dependencyMap = arg2 ;
2026-07-29 08:29:29 +00:00
callback ( 709 ) . wait ( ( ) = > {
let obj = callback ( table [ 8 ] ) ;
2026-07-23 10:11:24 +00:00
obj = { type : "RTC_CONNECTION_STATE" , state : closure_0 } ;
2026-07-29 08:29:29 +00:00
const merged = Object . assign ( callback ) ;
const merged1 = Object . assign ( table ) ;
2026-07-20 16:05:17 +00:00
return obj . dispatch ( obj ) ;
} ) ;
} ) ;
2026-08-25 06:04:03 +00:00
_default . on ( _default ( 4478 ) . RTCConnectionEvent . Video , ( arg0 , arg1 , arg2 , arg3 , arg4 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
closure_2 = arg2 ;
closure_3 = arg3 ;
closure_4 = arg4 ;
closure_1_1 ( closure_1_2 [ 8 ] ) . wait ( ( ) = > {
let obj = closure_2_1 ( closure_2_2 [ 8 ] ) ;
obj = { type : "RTC_CONNECTION_VIDEO" , guildId : mediaEngineConnectionId , channelId : closure_1 , userId : closure_2 , streamId : closure_3 , rtcServerId : closure_4 , context : closure_2_11.DEFAULT , mediaEngineConnectionId : mediaEngineConnectionId.getMediaEngineConnectionId ( ) } ;
2026-07-20 16:05:17 +00:00
return obj . dispatch ( obj ) ;
} ) ;
} ) ;
2026-08-25 06:04:03 +00:00
_default . on ( _default ( 4478 ) . RTCConnectionEvent . Ping , ( arg0 , arg1 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
2026-07-29 08:29:29 +00:00
const callback = arg1 ;
callback ( 709 ) . wait ( ( ) = > {
2026-08-24 06:08:38 +00:00
let obj = callback ( closure_1_2 [ 8 ] ) ;
2026-07-29 08:29:29 +00:00
obj = { type : "RTC_CONNECTION_PING" , pings : closure_0 , quality : callback } ;
2026-07-20 16:05:17 +00:00
return obj . dispatch ( obj ) ;
} ) ;
} ) ;
2026-08-25 06:04:03 +00:00
_default . on ( _default ( 4478 ) . RTCConnectionEvent . OutboundLossRate , ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
2026-07-29 08:29:29 +00:00
callback ( 709 ) . wait ( ( ) = > {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1 ( closure_1_2 [ 8 ] ) ;
2026-07-23 10:11:24 +00:00
obj = { type : "RTC_CONNECTION_LOSS_RATE" , lossRate : closure_0 } ;
2026-07-20 16:05:17 +00:00
return obj . dispatch ( obj ) ;
} ) ;
} ) ;
2026-08-25 06:04:03 +00:00
_default . on ( _default ( 4478 ) . RTCConnectionEvent . Speaking , ( userId , speaking ) = > {
2026-07-29 08:29:29 +00:00
if ( closure_17 != null ) {
closure_17 . setSpeaking ( userId , speaking ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
2026-08-25 06:04:03 +00:00
_default . on ( _default ( 4478 ) . RTCConnectionEvent . Flags , ( arg0 , arg1 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1 = arg1 ;
closure_1_1 ( closure_1_2 [ 8 ] ) . wait ( ( ) = > {
let obj = closure_2_1 ( closure_2_2 [ 8 ] ) ;
2026-07-23 10:11:24 +00:00
obj = { type : "RTC_CONNECTION_FLAGS" , flags : closure_1 , userId : closure_0 , guildId : closure_0.guildId , channelId : closure_0.channelId , context : closure_0.context } ;
2026-07-20 16:05:17 +00:00
obj . dispatch ( obj ) ;
} ) ;
} ) ;
2026-08-25 06:04:03 +00:00
_default . on ( _default ( 4478 ) . RTCConnectionEvent . UsersMerged , ( userIds , context ) = > {
2026-07-29 08:29:29 +00:00
let obj = callback ( 709 ) ;
2026-07-20 16:05:17 +00:00
obj = { type : "RTC_CONNECTION_USERS_MERGED" , userIds , context } ;
obj . dispatch ( obj ) ;
} ) ;
2026-08-25 06:04:03 +00:00
_default . on ( _default ( 4478 ) . RTCConnectionEvent . ClientConnect , ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1_1 ( closure_1_2 [ 8 ] ) . wait ( ( ) = > {
let obj = closure_2_1 ( closure_2_2 [ 8 ] ) ;
2026-07-23 10:11:24 +00:00
obj = { type : "RTC_CONNECTION_CLIENT_CONNECT" , userIds : closure_0 , guildId : closure_0.guildId , channelId : closure_0.channelId , context : closure_0.context } ;
2026-07-20 16:05:17 +00:00
obj . dispatch ( obj ) ;
} ) ;
} ) ;
2026-08-25 06:04:03 +00:00
_default . on ( _default ( 4478 ) . RTCConnectionEvent . ClientDisconnect , ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
closure_1_1 ( closure_1_2 [ 8 ] ) . wait ( ( ) = > {
let obj = closure_2_1 ( closure_2_2 [ 8 ] ) ;
2026-07-23 10:11:24 +00:00
obj = { type : "RTC_CONNECTION_CLIENT_DISCONNECT" , userId : closure_0 , guildId : closure_0.guildId , channelId : closure_0.channelId , context : closure_0.context } ;
2026-07-20 16:05:17 +00:00
obj . dispatch ( obj ) ;
} ) ;
} ) ;
2026-08-25 06:04:03 +00:00
_default . on ( _default ( 4478 ) . RTCConnectionEvent . Platform , ( arg0 , arg1 , arg2 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
2026-07-29 08:29:29 +00:00
const callback = arg1 ;
2026-08-24 06:08:38 +00:00
dependencyMap = arg2 ;
2026-07-29 08:29:29 +00:00
callback ( 709 ) . wait ( ( ) = > {
let obj = callback ( table [ 8 ] ) ;
obj = { type : "RTC_CONNECTION_PLATFORM" , platform : callback , userId : closure_0 , channelId : table } ;
2026-07-20 16:05:17 +00:00
obj . dispatch ( obj ) ;
} ) ;
} ) ;
2026-08-25 06:04:03 +00:00
_default . on ( _default ( 4478 ) . RTCConnectionEvent . SecureFramesUpdate , ( ) = > {
2026-07-29 08:29:29 +00:00
callback ( 709 ) . wait ( ( ) = > {
callback ( table [ 8 ] ) . dispatch ( { type : "RTC_CONNECTION_SECURE_FRAMES_UPDATE" } ) ;
2026-07-20 16:05:17 +00:00
} ) ;
} ) ;
2026-08-25 06:04:03 +00:00
_default . on ( _default ( 4478 ) . RTCConnectionEvent . RosterMapUpdate , ( arg0 ) = > {
2026-08-24 06:08:38 +00:00
closure_0 = arg0 ;
2026-07-29 08:29:29 +00:00
callback ( 709 ) . wait ( ( ) = > {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1 ( closure_1_2 [ 8 ] ) ;
2026-07-23 10:11:24 +00:00
obj = { type : "RTC_CONNECTION_ROSTER_MAP_UPDATE" , userIds : closure_0 } ;
2026-07-20 16:05:17 +00:00
obj . dispatch ( obj ) ;
} ) ;
} ) ;
2026-08-25 06:04:03 +00:00
let tmp32 = updateVoiceStatesDefault ;
tmp32 = new tmp32 ( store . getId ( ) , arg1 ) ;
closure_17 = tmp32 ;
2026-08-24 06:08:38 +00:00
c15 = null ;
c18 = false ;
c19 = false ;
2026-07-20 16:05:17 +00:00
return _default ;
}
}
function destroyRTCConnection ( arg0 ) {
let flag = arg0 ;
if ( arg0 === undefined ) {
flag = true ;
}
if ( null == redux ) {
return false ;
} else {
2026-07-29 08:29:29 +00:00
let obj = { duration : null , mediaSessionId : null , rtcConnectionId : null , wasEverMultiParticipant : null , wasEverRtcConnected : null , voiceStateAnalytics : null , channelId : null } ;
obj [ 0 ] = redux . getDuration ( ) ;
let mediaSessionId = redux . getMediaSessionId ( ) ;
if ( mediaSessionId == null ) {
mediaSessionId = null ;
}
obj [ 1 ] = mediaSessionId ;
obj [ 2 ] = redux . getRTCConnectionId ( ) ;
obj [ 3 ] = c18 ;
obj [ 4 ] = c19 ;
obj [ 5 ] = c17 ;
obj [ 6 ] = redux . channelId ;
2026-08-24 06:08:38 +00:00
obj = dispatcherDefault ;
2026-07-29 08:29:29 +00:00
obj = { type : "MEDIA_ENGINE_CONNECTION_STATS_HISTORY_RESET" , mediaEngineConnectionId : null } ;
obj [ 1 ] = redux . getMediaEngineConnectionId ( ) ;
2026-07-20 16:05:17 +00:00
obj . dispatch ( obj ) ;
redux . destroy ( ) ;
2026-07-23 10:11:24 +00:00
redux = null ;
2026-07-29 08:29:29 +00:00
c17 = null ;
2026-08-24 06:08:38 +00:00
c22 = false ;
2026-07-20 16:05:17 +00:00
if ( flag ) {
2026-08-24 06:08:38 +00:00
c20 = null ;
2026-07-20 16:05:17 +00:00
}
}
}
function handleClearRemoteDisconnectVoiceChannelId() {
2026-08-24 06:08:38 +00:00
c14 = null ;
2026-07-20 16:05:17 +00:00
}
function handleChannelDelete ( arg0 ) {
if ( null != redux ) {
if ( redux . channelId === tmp . id ) {
destroyRTCConnection ( ) ;
}
}
return false ;
}
function handleRtcAction() {
return true ;
}
2026-08-24 06:08:38 +00:00
( { RTCConnectionStates : closure_8 , AppStates : c9 , RTCConnectionQuality : c10 } = ME ) ;
let closure_12 = new timestampDefault ( "RTCConnectionStore" ) ;
2026-07-29 08:29:29 +00:00
let closure_13 = [ ] ;
let c14 = null ;
let c15 = null ;
let c16 = null ;
let c17 = null ;
let c18 = false ;
let c19 = false ;
2026-07-23 10:11:24 +00:00
let c20 = null ;
let c21 = null ;
2026-07-29 08:29:29 +00:00
let c22 = false ;
let c23 = null ;
let c24 = null ;
2026-08-24 06:08:38 +00:00
const Store = initializeDefault . Store ;
2026-07-29 08:29:29 +00:00
class RTCConnectionStore extends Store {
}
const prototype = RTCConnectionStore . prototype ;
prototype [ "initialize" ] = function initialize() {
2026-08-24 06:08:38 +00:00
this . waitFor ( closure_6 , closure_5 , closure_7 ) ;
const result = trackVideoToggle . setVideoToggleAnalyticsParams ( this . getRTCConnectionId , this . getMediaSessionId ) ;
2026-07-29 08:29:29 +00:00
} ;
prototype [ "getRTCConnection" ] = function getRTCConnection() {
return closure_3 ;
} ;
prototype [ "getState" ] = function getState() {
if ( null != redux ) {
let DISCONNECTED = redux . state ;
} else {
DISCONNECTED = constants . DISCONNECTED ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return DISCONNECTED ;
} ;
prototype [ "isConnected" ] = function isConnected() {
return this . getState ( ) === constants . RTC_CONNECTED ;
} ;
prototype [ "isDisconnected" ] = function isDisconnected() {
return this . getState ( ) === constants . DISCONNECTED ;
} ;
prototype [ "getRemoteDisconnectVoiceChannelId" ] = function getRemoteDisconnectVoiceChannelId() {
return c14 ;
} ;
prototype [ "getLastSessionVoiceChannelId" ] = function getLastSessionVoiceChannelId() {
return c16 ;
} ;
prototype [ "setLastSessionVoiceChannelId" ] = function setLastSessionVoiceChannelId ( arg0 ) {
2026-08-24 06:08:38 +00:00
closure_16 = arg0 ;
2026-07-29 08:29:29 +00:00
} ;
prototype [ "getGuildId" ] = function getGuildId() {
let guildId ;
if ( redux != null ) {
guildId = redux . guildId ;
}
return guildId ;
} ;
prototype [ "getChannelId" ] = function getChannelId() {
let channelId ;
if ( redux != null ) {
channelId = redux . channelId ;
}
return channelId ;
} ;
prototype [ "getHostname" ] = function getHostname() {
let str = "" ;
if ( null != redux ) {
str = redux . hostname ;
}
return str ;
} ;
prototype [ "getQuality" ] = function getQuality() {
if ( null != redux ) {
let UNKNOWN = redux . quality ;
} else {
UNKNOWN = constants3 . UNKNOWN ;
}
return UNKNOWN ;
} ;
prototype [ "getPings" ] = function getPings() {
if ( null != redux ) {
let pings = redux . getPings ( ) ;
} else {
pings = closure_13 ;
}
return pings ;
} ;
prototype [ "getAveragePing" ] = function getAveragePing() {
let num = 0 ;
if ( null != closure_3 ) {
let averagePing ;
if ( closure_3 != null ) {
averagePing = obj . getAveragePing ( ) ;
}
num = averagePing ;
obj = closure_3 ;
}
return num ;
} ;
prototype [ "getLastPing" ] = function getLastPing() {
let lastPing ;
if ( closure_3 != null ) {
lastPing = closure_3 . getLastPing ( ) ;
}
return lastPing ;
} ;
prototype [ "getOutboundLossRate" ] = function getOutboundLossRate() {
let outboundLossRate ;
if ( closure_3 != null ) {
outboundLossRate = closure_3 . getOutboundLossRate ( ) ;
}
return outboundLossRate ;
} ;
prototype [ "getMediaSessionId" ] = function getMediaSessionId() {
let mediaSessionId ;
if ( closure_3 != null ) {
mediaSessionId = closure_3 . getMediaSessionId ( ) ;
}
return mediaSessionId ;
} ;
prototype [ "getRTCConnectionId" ] = function getRTCConnectionId() {
let rTCConnectionId ;
if ( closure_3 != null ) {
rTCConnectionId = closure_3 . getRTCConnectionId ( ) ;
}
return rTCConnectionId ;
} ;
prototype [ "getDuration" ] = function getDuration() {
let duration ;
if ( closure_3 != null ) {
duration = closure_3 . getDuration ( ) ;
}
if ( duration == null ) {
let duration1 ;
if ( _null != null ) {
duration1 = _null . duration ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
duration = duration1 ;
}
return duration ;
} ;
prototype [ "getLastRTCConnectionState" ] = function getLastRTCConnectionState() {
return c15 ;
} ;
prototype [ "getPacketStats" ] = function getPacketStats() {
let packetStats ;
if ( closure_3 != null ) {
packetStats = closure_3 . getPacketStats ( ) ;
}
return packetStats ;
} ;
prototype [ "getVoiceStateStats" ] = function getVoiceStateStats() {
let stats ;
if ( c17 != null ) {
stats = c17 . getStats ( ) ;
}
return stats ;
} ;
prototype [ "getUserVoiceSettingsStats" ] = function getUserVoiceSettingsStats ( arg0 ) {
let userVoiceSettingsStats ;
if ( c17 != null ) {
userVoiceSettingsStats = c17 . getUserVoiceSettingsStats ( arg0 ) ;
}
return userVoiceSettingsStats ;
} ;
prototype [ "getWasEverMultiParticipant" ] = function getWasEverMultiParticipant() {
return c18 ;
} ;
prototype [ "getWasEverRtcConnected" ] = function getWasEverRtcConnected() {
return c19 ;
} ;
prototype [ "getUserIds" ] = function getUserIds() {
let userIds ;
if ( closure_3 != null ) {
userIds = closure_3 . getUserIds ( ) ;
}
return userIds ;
} ;
prototype [ "getJoinVoiceId" ] = function getJoinVoiceId() {
return c23 ;
} ;
prototype [ "isUserConnected" ] = function isUserConnected ( arg0 ) {
let isUserConnected ;
if ( closure_3 != null ) {
isUserConnected = closure_3 . getIsUserConnected ( arg0 ) ;
}
return isUserConnected ;
} ;
prototype [ "getSecureFramesState" ] = function getSecureFramesState() {
let secureFramesState ;
if ( closure_3 != null ) {
secureFramesState = closure_3 . getSecureFramesState ( ) ;
}
return secureFramesState ;
} ;
prototype [ "getSecureFramesRosterMapEntry" ] = function getSecureFramesRosterMapEntry ( arg0 ) {
let secureFramesRosterMap ;
if ( closure_3 != null ) {
secureFramesRosterMap = closure_3 . getSecureFramesRosterMap ( ) ;
}
let value ;
if ( secureFramesRosterMap != null ) {
value = secureFramesRosterMap . get ( arg0 ) ;
}
return value ;
} ;
prototype [ "getLastNonZeroRemoteVideoSinkWantsTime" ] = function getLastNonZeroRemoteVideoSinkWantsTime() {
return c21 ;
} ;
prototype [ "getWasMoved" ] = function getWasMoved() {
return c22 ;
} ;
RTCConnectionStore . displayName = "RTCConnectionStore" ;
2026-08-24 06:08:38 +00:00
const rTCConnectionStore = new RTCConnectionStore ( dispatcherDefault , {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN : function handleConnectionOpen ( sessionId ) {
sessionId = sessionId . sessionId ;
2026-08-24 06:08:38 +00:00
c14 = null ;
c16 = null ;
2026-07-20 16:05:17 +00:00
destroyRTCConnection ( false ) ;
2026-07-29 08:29:29 +00:00
if ( null != _null2 ) {
const timeout = _null2 . timeout ;
timeout . stop ( ) ;
_null2 = null ;
}
2026-07-20 16:05:17 +00:00
return false ;
} ,
CONNECTION_CLOSED : function handleConnectionClosed() {
2026-08-24 06:08:38 +00:00
c4 = null ;
c14 = null ;
c16 = null ;
2026-07-20 16:05:17 +00:00
destroyRTCConnection ( false ) ;
2026-07-29 08:29:29 +00:00
if ( null != _null2 ) {
const timeout = _null2 . timeout ;
timeout . stop ( ) ;
_null2 = null ;
}
2026-07-20 16:05:17 +00:00
} ,
LOGOUT : function handleLogout() {
2026-08-24 06:08:38 +00:00
c20 = null ;
2026-07-20 16:05:17 +00:00
return false ;
} ,
RTC_CONNECTION_STATE : function handleRTCConnectionState ( state ) {
if ( state . state === constants . RTC_CONNECTED ) {
2026-08-24 06:08:38 +00:00
c19 = true ;
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-08-24 06:08:38 +00:00
closure_20 = sleep . now ( ) ;
const obj = sleep ;
2026-07-20 16:05:17 +00:00
}
}
return true ;
} ,
RTC_CONNECTION_PING : function handleRtcConnectionPing() {
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-08-24 06:08:38 +00:00
closure_20 = sleep . now ( ) ;
const obj = sleep ;
2026-07-20 16:05:17 +00:00
}
return true ;
} ,
RTC_CONNECTION_LOSS_RATE : handleRtcAction ,
RTC_CONNECTION_UPDATE_ID : function handleRtcConnectionUpdateId ( connection ) {
2026-07-29 08:29:29 +00:00
return connection . connection === closure_3 ;
2026-07-20 16:05:17 +00:00
} ,
RTC_CONNECTION_SECURE_FRAMES_UPDATE : handleRtcAction ,
RTC_CONNECTION_CLIENT_CONNECT : handleRtcAction ,
RTC_CONNECTION_CLIENT_DISCONNECT : handleRtcAction ,
RTC_CONNECTION_REMOTE_VIDEO_SINK_WANTS : function handleRtcConnectionRemoteVideoSinkWants ( context ) {
let tmp2 = context . context === MediaEngineContextTypes . DEFAULT ;
if ( tmp2 ) {
const _Object = Object ;
const entries = Object . entries ( tmp ) ;
2026-07-29 08:29:29 +00:00
const someResult = entries . some ( ( arg0 ) = > {
2026-07-20 16:05:17 +00:00
[ tmp , tmp2 ] = arg0 ;
let tmp3 = "any" !== tmp ;
if ( tmp3 ) {
tmp3 = 0 !== tmp2 ;
}
return tmp3 ;
} ) ;
2026-07-29 08:29:29 +00:00
if ( someResult ) {
2026-07-20 16:05:17 +00:00
const _performance = performance ;
2026-08-24 06:08:38 +00:00
closure_21 = performance . now ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = someResult ;
2026-07-20 16:05:17 +00:00
}
return tmp2 ;
} ,
VIDEO_SIZE_UPDATE : function handleVideoSizeUpdate ( arg0 ) {
2026-07-29 08:29:29 +00:00
if ( closure_3 != null ) {
closure_3 . setVideoSize ( tmp , tmp2 , tmp3 ) ;
2026-07-20 16:05:17 +00:00
}
} ,
2026-08-25 06:04:03 +00:00
VOICE_STATE_UPDATES : function handleVoiceStateUpdates ( arg0 ) {
( { voiceStates , receivedAt : require } = arg0 ) ;
2026-07-20 16:05:17 +00:00
return voiceStates . reduce ( ( arg0 , userId ) = > {
2026-08-25 06:04:03 +00:00
if ( closure_1_17 != null ) {
2026-07-20 16:05:17 +00:00
obj . updateVoiceStates ( userId . userId , userId . channelId ) ;
}
2026-07-29 08:29:29 +00:00
let tmp2 = closure_18 ;
if ( ! closure_18 ) {
let num ;
2026-08-25 06:04:03 +00:00
if ( closure_1_17 != null ) {
2026-07-29 08:29:29 +00:00
num = obj2 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num == null ) {
num = 0 ;
2026-07-20 16:05:17 +00:00
}
tmp2 = num > 1 ;
2026-08-25 06:04:03 +00:00
obj2 = closure_1_17 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = tmp2 ;
2026-08-25 06:04:03 +00:00
if ( closure_1_6 . getId ( ) !== userId . userId ) {
2026-07-20 16:05:17 +00:00
return arg0 ;
} else {
2026-08-25 06:04:03 +00:00
let tmp4 = null != _null ;
2026-07-29 08:29:29 +00:00
if ( tmp4 ) {
2026-08-25 06:04:03 +00:00
tmp4 = userId . channelId === _null . channelId ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp4 ) {
2026-08-25 06:04:03 +00:00
if ( null != _null ) {
const timeout = _null . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-08-25 06:04:03 +00:00
_null = null ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-08-25 06:04:03 +00:00
if ( userId . sessionId === closure_1_4 ) {
2026-07-20 16:05:17 +00:00
if ( null == userId . guildId ) {
2026-08-25 06:04:03 +00:00
if ( ! tmp26 ) {
closure_1_26 ( ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != userId . channelId ) {
2026-07-29 08:29:29 +00:00
let channelId = null ;
2026-08-24 06:08:38 +00:00
c16 = null ;
2026-08-25 06:04:03 +00:00
closure_3 = closure_1_25 ( userId . guildId , userId . channelId , closure_0 ) ;
2026-07-29 08:29:29 +00:00
let num9 ;
2026-08-25 06:04:03 +00:00
if ( closure_1_17 != null ) {
2026-07-29 08:29:29 +00:00
num9 = obj7 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num9 == null ) {
num9 = 0 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = num9 > 1 ;
2026-08-25 06:04:03 +00:00
obj7 = closure_1_17 ;
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
tmp26 = userId . guildId !== closure_3 . guildId && null == userId . channelId ;
2026-07-20 16:05:17 +00:00
}
if ( null == userId . channelId ) {
2026-08-25 06:04:03 +00:00
closure_1_26 ( ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
closure_3 . setNextChannelId ( userId . channelId ) ;
2026-08-24 06:08:38 +00:00
c22 = true ;
c23 = null ;
2026-07-29 08:29:29 +00:00
closure_3 . clearJoinVoiceId ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if ( userId . guildId === closure_3 . guildId ) {
2026-08-25 06:04:03 +00:00
if ( ! tmp19 ) {
2026-07-29 08:29:29 +00:00
channelId = closure_3 . channelId ;
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
closure_1_26 ( ) ;
const obj6 = closure_1_5 ;
tmp19 = null != closure_1_5 . getAwaitingRemoteSessionInfo ( ) && null != closure_1_5 . getRemoteSessionId ( ) ;
2026-07-20 16:05:17 +00:00
}
} else {
2026-08-25 06:04:03 +00:00
if ( userId . sessionId === closure_1_4 ) {
2026-07-20 16:05:17 +00:00
if ( null != userId . channelId ) {
2026-07-29 08:29:29 +00:00
if ( ! tmp4 ) {
2026-08-25 06:04:03 +00:00
if ( null != closure_1_20 ) {
if ( obj3 . now ( ) - closure_1_20 >= 300000 ) {
closure_1_1 ( tmp11 [ 8 ] ) . wait ( ( ) = > callback ( table [ 12 ] ) . default . disconnect ( ) ) ;
2026-07-20 16:05:17 +00:00
return arg0 ;
}
2026-08-25 06:04:03 +00:00
obj3 = closure_1_0 ( closure_1_2 [ 11 ] ) ;
tmp11 = closure_1_2 ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
channelId = null ;
c16 = null ;
2026-08-25 06:04:03 +00:00
closure_3 = closure_1_25 ( userId . guildId , userId . channelId , closure_0 ) ;
2026-07-29 08:29:29 +00:00
let num5 ;
2026-08-25 06:04:03 +00:00
if ( closure_1_17 != null ) {
2026-07-29 08:29:29 +00:00
num5 = obj5 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num5 == null ) {
num5 = 0 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = num5 > 1 ;
2026-08-25 06:04:03 +00:00
obj5 = closure_1_17 ;
2026-07-20 16:05:17 +00:00
}
}
return arg0 ;
}
return true ;
}
2026-08-25 06:04:03 +00:00
obj = closure_1_17 ;
2026-07-20 16:05:17 +00:00
} , false ) ;
} ,
VOICE_CHANNEL_SELECT : function handleVoiceChannelSelect ( channelId ) {
let tmp = null == redux ;
if ( ! tmp ) {
let tmp2 = null != channelId . channelId ;
if ( tmp2 ) {
tmp2 = redux . channelId === channelId . channelId ;
}
tmp = tmp2 ;
}
if ( ! tmp ) {
destroyRTCConnection ( ) ;
}
const joinVoiceId = channelId . joinVoiceId ;
2026-07-29 08:29:29 +00:00
const _require = channelId ;
2026-08-24 06:08:38 +00:00
if ( null != _null2 ) {
let timeout = _null2 . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-08-24 06:08:38 +00:00
_null2 = null ;
2026-07-29 08:29:29 +00:00
}
if ( null != channelId . channelId ) {
2026-08-25 06:04:03 +00:00
timeout = new _require ( 4264 ) . Timeout ( ) ;
2026-07-29 08:29:29 +00:00
timeout . start ( 30000 , ( ) = > {
2026-08-24 06:08:38 +00:00
closure_1_12 . warn ( "No VOICE_STATE_UPDATE received within 30000ms of VOICE_CHANNEL_SELECT" , { joinVoiceId : channelId.joinVoiceId , channelId : channelId.channelId , guildId : channelId.guildId } ) ;
c24 = null ;
2026-07-29 08:29:29 +00:00
} ) ;
2026-08-24 06:08:38 +00:00
const obj = { joinVoiceId : null , channelId : null , guildId : null , timeout : null } ;
2026-07-29 08:29:29 +00:00
( { joinVoiceId : obj2 [ 0 ] , channelId : obj2 [ 1 ] , guildId : obj2 [ 2 ] } = channelId ) ;
obj [ 3 ] = timeout ;
2026-08-24 06:08:38 +00:00
_null2 = obj ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
} ,
AUDIO_SET_NOISE_CANCELLATION : function handleAudioSetNoiseCancellation ( enabled ) {
2026-07-29 08:29:29 +00:00
if ( closure_3 != null ) {
const result = closure_3 . setNoiseCancellationEnabled ( enabled . enabled ) ;
2026-07-20 16:05:17 +00:00
}
} ,
AUDIO_SET_AUDIO_MIXER_SETTINGS : function handleAudioSetAudioMixerSettings ( context ) {
if ( context . context !== MediaEngineContextTypes . DEFAULT ) {
return false ;
2026-07-22 07:54:56 +00:00
} else {
2026-07-29 08:29:29 +00:00
let flag = context . settings . enabled ;
if ( flag == null ) {
flag = false ;
2026-07-22 07:54:56 +00:00
}
2026-07-29 08:29:29 +00:00
if ( flag ) {
2026-08-24 06:08:38 +00:00
flag = useIsSpatialAudioAvailable . isSpatialAudioAvailable ( "RTCConnectionStore" ) ;
const obj = useIsSpatialAudioAvailable ;
2026-07-29 08:29:29 +00:00
}
if ( closure_3 != null ) {
const result = closure_3 . setSpatialAudioEnabled ( flag ) ;
2026-07-22 07:54:56 +00:00
}
2026-07-20 16:05:17 +00:00
}
} ,
VOICE_SERVER_UPDATE : function handleVoiceServerUpdate ( guildId ) {
let tmp = null != redux ;
if ( tmp ) {
2026-07-29 08:29:29 +00:00
let tmp3 = null == guildId . guildId ;
if ( ! tmp3 ) {
tmp3 = guildId . guildId === redux . guildId ;
}
if ( tmp3 ) {
let tmp5 = null == guildId . channelId ;
if ( ! tmp5 ) {
tmp5 = guildId . channelId === redux . getNextChannelId ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp5 ) {
2026-07-20 16:05:17 +00:00
redux . connect ( guildId . endpoint , guildId . token ) ;
}
2026-07-29 08:29:29 +00:00
tmp3 = tmp5 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = tmp3 ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
} ,
CLEAR_REMOTE_DISCONNECT_VOICE_CHANNEL_ID : handleClearRemoteDisconnectVoiceChannelId ,
REMOTE_SESSION_CONNECT : handleClearRemoteDisconnectVoiceChannelId ,
CLEAR_LAST_SESSION_VOICE_CHANNEL_ID : function handleClearLastSessionVoiceChannelId() {
2026-08-24 06:08:38 +00:00
c16 = null ;
2026-07-20 16:05:17 +00:00
} ,
GUILD_DELETE : function handleGuildDelete ( arg0 ) {
if ( null != redux ) {
if ( redux . guildId === tmp . id ) {
destroyRTCConnection ( ) ;
}
}
return false ;
} ,
CHANNEL_DELETE : handleChannelDelete ,
THREAD_DELETE : handleChannelDelete ,
CALL_DELETE : function handleCallDelete ( arg0 ) {
if ( null != redux ) {
if ( redux . channelId === tmp ) {
destroyRTCConnection ( ) ;
}
}
return false ;
} ,
APP_STATE_UPDATE : function handleFocus ( state ) {
let tmp = state . state === constants2 . ACTIVE ;
if ( tmp ) {
tmp = null != redux ;
}
if ( tmp ) {
redux . resetBackoff ( "App state is active" ) ;
}
return false ;
} ,
RTC_DEBUG_SET_SIMULCAST_OVERRIDE : function handleSimulcastDebugOverrideChanged ( arg0 ) {
2026-07-29 08:29:29 +00:00
if ( closure_3 != null ) {
const result = closure_3 . setSimulcastDebugOverride ( tmp , tmp2 , tmp3 ) ;
2026-07-20 16:05:17 +00:00
}
}
} ) ;
2026-07-23 10:11:24 +00:00
let obj = {
2026-07-20 16:05:17 +00:00
CONNECTION_OPEN : function handleConnectionOpen ( sessionId ) {
sessionId = sessionId . sessionId ;
2026-08-24 06:08:38 +00:00
c14 = null ;
c16 = null ;
2026-07-20 16:05:17 +00:00
destroyRTCConnection ( false ) ;
2026-07-29 08:29:29 +00:00
if ( null != _null2 ) {
const timeout = _null2 . timeout ;
timeout . stop ( ) ;
_null2 = null ;
}
2026-07-20 16:05:17 +00:00
return false ;
} ,
CONNECTION_CLOSED : function handleConnectionClosed() {
2026-08-24 06:08:38 +00:00
c4 = null ;
c14 = null ;
c16 = null ;
2026-07-20 16:05:17 +00:00
destroyRTCConnection ( false ) ;
2026-07-29 08:29:29 +00:00
if ( null != _null2 ) {
const timeout = _null2 . timeout ;
timeout . stop ( ) ;
_null2 = null ;
}
2026-07-20 16:05:17 +00:00
} ,
LOGOUT : function handleLogout() {
2026-08-24 06:08:38 +00:00
c20 = null ;
2026-07-20 16:05:17 +00:00
return false ;
} ,
RTC_CONNECTION_STATE : function handleRTCConnectionState ( state ) {
if ( state . state === constants . RTC_CONNECTED ) {
2026-08-24 06:08:38 +00:00
c19 = true ;
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-08-24 06:08:38 +00:00
closure_20 = sleep . now ( ) ;
const obj = sleep ;
2026-07-20 16:05:17 +00:00
}
}
return true ;
} ,
RTC_CONNECTION_PING : function handleRtcConnectionPing() {
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-08-24 06:08:38 +00:00
closure_20 = sleep . now ( ) ;
const obj = sleep ;
2026-07-20 16:05:17 +00:00
}
return true ;
} ,
RTC_CONNECTION_LOSS_RATE : handleRtcAction ,
RTC_CONNECTION_UPDATE_ID : function handleRtcConnectionUpdateId ( connection ) {
2026-07-29 08:29:29 +00:00
return connection . connection === closure_3 ;
2026-07-20 16:05:17 +00:00
} ,
RTC_CONNECTION_SECURE_FRAMES_UPDATE : handleRtcAction ,
RTC_CONNECTION_CLIENT_CONNECT : handleRtcAction ,
RTC_CONNECTION_CLIENT_DISCONNECT : handleRtcAction ,
RTC_CONNECTION_REMOTE_VIDEO_SINK_WANTS : function handleRtcConnectionRemoteVideoSinkWants ( context ) {
let tmp2 = context . context === MediaEngineContextTypes . DEFAULT ;
if ( tmp2 ) {
const _Object = Object ;
const entries = Object . entries ( tmp ) ;
2026-07-29 08:29:29 +00:00
const someResult = entries . some ( ( arg0 ) = > {
2026-07-20 16:05:17 +00:00
[ tmp , tmp2 ] = arg0 ;
let tmp3 = "any" !== tmp ;
if ( tmp3 ) {
tmp3 = 0 !== tmp2 ;
}
return tmp3 ;
} ) ;
2026-07-29 08:29:29 +00:00
if ( someResult ) {
2026-07-20 16:05:17 +00:00
const _performance = performance ;
2026-08-24 06:08:38 +00:00
closure_21 = performance . now ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp2 = someResult ;
2026-07-20 16:05:17 +00:00
}
return tmp2 ;
} ,
VIDEO_SIZE_UPDATE : function handleVideoSizeUpdate ( arg0 ) {
2026-07-29 08:29:29 +00:00
if ( closure_3 != null ) {
closure_3 . setVideoSize ( tmp , tmp2 , tmp3 ) ;
2026-07-20 16:05:17 +00:00
}
} ,
2026-08-25 06:04:03 +00:00
VOICE_STATE_UPDATES : function handleVoiceStateUpdates ( arg0 ) {
( { voiceStates , receivedAt : require } = arg0 ) ;
2026-07-20 16:05:17 +00:00
return voiceStates . reduce ( ( arg0 , userId ) = > {
2026-08-25 06:04:03 +00:00
if ( closure_1_17 != null ) {
2026-07-20 16:05:17 +00:00
obj . updateVoiceStates ( userId . userId , userId . channelId ) ;
}
2026-07-29 08:29:29 +00:00
let tmp2 = closure_18 ;
if ( ! closure_18 ) {
let num ;
2026-08-25 06:04:03 +00:00
if ( closure_1_17 != null ) {
2026-07-29 08:29:29 +00:00
num = obj2 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num == null ) {
num = 0 ;
2026-07-20 16:05:17 +00:00
}
tmp2 = num > 1 ;
2026-08-25 06:04:03 +00:00
obj2 = closure_1_17 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = tmp2 ;
2026-08-25 06:04:03 +00:00
if ( closure_1_6 . getId ( ) !== userId . userId ) {
2026-07-20 16:05:17 +00:00
return arg0 ;
} else {
2026-08-25 06:04:03 +00:00
let tmp4 = null != _null ;
2026-07-29 08:29:29 +00:00
if ( tmp4 ) {
2026-08-25 06:04:03 +00:00
tmp4 = userId . channelId === _null . channelId ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp4 ) {
2026-08-25 06:04:03 +00:00
if ( null != _null ) {
const timeout = _null . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-08-25 06:04:03 +00:00
_null = null ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( null != closure_3 ) {
2026-08-25 06:04:03 +00:00
if ( userId . sessionId === closure_1_4 ) {
2026-07-20 16:05:17 +00:00
if ( null == userId . guildId ) {
2026-08-25 06:04:03 +00:00
if ( ! tmp26 ) {
closure_1_26 ( ) ;
2026-07-20 16:05:17 +00:00
}
if ( null != userId . channelId ) {
2026-07-29 08:29:29 +00:00
let channelId = null ;
2026-08-24 06:08:38 +00:00
c16 = null ;
2026-08-25 06:04:03 +00:00
closure_3 = closure_1_25 ( userId . guildId , userId . channelId , closure_0 ) ;
2026-07-29 08:29:29 +00:00
let num9 ;
2026-08-25 06:04:03 +00:00
if ( closure_1_17 != null ) {
2026-07-29 08:29:29 +00:00
num9 = obj7 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num9 == null ) {
num9 = 0 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = num9 > 1 ;
2026-08-25 06:04:03 +00:00
obj7 = closure_1_17 ;
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
tmp26 = userId . guildId !== closure_3 . guildId && null == userId . channelId ;
2026-07-20 16:05:17 +00:00
}
if ( null == userId . channelId ) {
2026-08-25 06:04:03 +00:00
closure_1_26 ( ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
closure_3 . setNextChannelId ( userId . channelId ) ;
2026-08-24 06:08:38 +00:00
c22 = true ;
c23 = null ;
2026-07-29 08:29:29 +00:00
closure_3 . clearJoinVoiceId ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
} else if ( userId . guildId === closure_3 . guildId ) {
2026-08-25 06:04:03 +00:00
if ( ! tmp19 ) {
2026-07-29 08:29:29 +00:00
channelId = closure_3 . channelId ;
2026-07-20 16:05:17 +00:00
}
2026-08-25 06:04:03 +00:00
closure_1_26 ( ) ;
const obj6 = closure_1_5 ;
tmp19 = null != closure_1_5 . getAwaitingRemoteSessionInfo ( ) && null != closure_1_5 . getRemoteSessionId ( ) ;
2026-07-20 16:05:17 +00:00
}
} else {
2026-08-25 06:04:03 +00:00
if ( userId . sessionId === closure_1_4 ) {
2026-07-20 16:05:17 +00:00
if ( null != userId . channelId ) {
2026-07-29 08:29:29 +00:00
if ( ! tmp4 ) {
2026-08-25 06:04:03 +00:00
if ( null != closure_1_20 ) {
if ( obj3 . now ( ) - closure_1_20 >= 300000 ) {
closure_1_1 ( tmp11 [ 8 ] ) . wait ( ( ) = > callback ( table [ 12 ] ) . default . disconnect ( ) ) ;
2026-07-20 16:05:17 +00:00
return arg0 ;
}
2026-08-25 06:04:03 +00:00
obj3 = closure_1_0 ( closure_1_2 [ 11 ] ) ;
tmp11 = closure_1_2 ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
channelId = null ;
c16 = null ;
2026-08-25 06:04:03 +00:00
closure_3 = closure_1_25 ( userId . guildId , userId . channelId , closure_0 ) ;
2026-07-29 08:29:29 +00:00
let num5 ;
2026-08-25 06:04:03 +00:00
if ( closure_1_17 != null ) {
2026-07-29 08:29:29 +00:00
num5 = obj5 . getStats ( ) . max_voice_state_count ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( num5 == null ) {
num5 = 0 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_18 = num5 > 1 ;
2026-08-25 06:04:03 +00:00
obj5 = closure_1_17 ;
2026-07-20 16:05:17 +00:00
}
}
return arg0 ;
}
return true ;
}
2026-08-25 06:04:03 +00:00
obj = closure_1_17 ;
2026-07-20 16:05:17 +00:00
} , false ) ;
} ,
VOICE_CHANNEL_SELECT : function handleVoiceChannelSelect ( channelId ) {
let tmp = null == redux ;
if ( ! tmp ) {
let tmp2 = null != channelId . channelId ;
if ( tmp2 ) {
tmp2 = redux . channelId === channelId . channelId ;
}
tmp = tmp2 ;
}
if ( ! tmp ) {
destroyRTCConnection ( ) ;
}
const joinVoiceId = channelId . joinVoiceId ;
2026-07-29 08:29:29 +00:00
const _require = channelId ;
2026-08-24 06:08:38 +00:00
if ( null != _null2 ) {
let timeout = _null2 . timeout ;
2026-07-29 08:29:29 +00:00
timeout . stop ( ) ;
2026-08-24 06:08:38 +00:00
_null2 = null ;
2026-07-29 08:29:29 +00:00
}
if ( null != channelId . channelId ) {
2026-08-25 06:04:03 +00:00
timeout = new _require ( 4264 ) . Timeout ( ) ;
2026-07-29 08:29:29 +00:00
timeout . start ( 30000 , ( ) = > {
2026-08-24 06:08:38 +00:00
closure_1_12 . warn ( "No VOICE_STATE_UPDATE received within 30000ms of VOICE_CHANNEL_SELECT" , { joinVoiceId : channelId.joinVoiceId , channelId : channelId.channelId , guildId : channelId.guildId } ) ;
c24 = null ;
2026-07-29 08:29:29 +00:00
} ) ;
2026-08-24 06:08:38 +00:00
const obj = { joinVoiceId : null , channelId : null , guildId : null , timeout : null } ;
2026-07-29 08:29:29 +00:00
( { joinVoiceId : obj2 [ 0 ] , channelId : obj2 [ 1 ] , guildId : obj2 [ 2 ] } = channelId ) ;
obj [ 3 ] = timeout ;
2026-08-24 06:08:38 +00:00
_null2 = obj ;
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
} ,
AUDIO_SET_NOISE_CANCELLATION : function handleAudioSetNoiseCancellation ( enabled ) {
2026-07-29 08:29:29 +00:00
if ( closure_3 != null ) {
const result = closure_3 . setNoiseCancellationEnabled ( enabled . enabled ) ;
2026-07-20 16:05:17 +00:00
}
} ,
AUDIO_SET_AUDIO_MIXER_SETTINGS : function handleAudioSetAudioMixerSettings ( context ) {
if ( context . context !== MediaEngineContextTypes . DEFAULT ) {
return false ;
2026-07-22 07:54:56 +00:00
} else {
2026-07-29 08:29:29 +00:00
let flag = context . settings . enabled ;
if ( flag == null ) {
flag = false ;
}
if ( flag ) {
2026-08-24 06:08:38 +00:00
flag = useIsSpatialAudioAvailable . isSpatialAudioAvailable ( "RTCConnectionStore" ) ;
const obj = useIsSpatialAudioAvailable ;
2026-07-22 07:54:56 +00:00
}
2026-07-29 08:29:29 +00:00
if ( closure_3 != null ) {
const result = closure_3 . setSpatialAudioEnabled ( flag ) ;
2026-07-22 07:54:56 +00:00
}
2026-07-20 16:05:17 +00:00
}
} ,
VOICE_SERVER_UPDATE : function handleVoiceServerUpdate ( guildId ) {
let tmp = null != redux ;
if ( tmp ) {
2026-07-29 08:29:29 +00:00
let tmp3 = null == guildId . guildId ;
if ( ! tmp3 ) {
tmp3 = guildId . guildId === redux . guildId ;
}
if ( tmp3 ) {
let tmp5 = null == guildId . channelId ;
if ( ! tmp5 ) {
tmp5 = guildId . channelId === redux . getNextChannelId ( ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if ( tmp5 ) {
2026-07-20 16:05:17 +00:00
redux . connect ( guildId . endpoint , guildId . token ) ;
}
2026-07-29 08:29:29 +00:00
tmp3 = tmp5 ;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = tmp3 ;
2026-07-20 16:05:17 +00:00
}
return tmp ;
} ,
CLEAR_REMOTE_DISCONNECT_VOICE_CHANNEL_ID : handleClearRemoteDisconnectVoiceChannelId ,
REMOTE_SESSION_CONNECT : handleClearRemoteDisconnectVoiceChannelId ,
CLEAR_LAST_SESSION_VOICE_CHANNEL_ID : function handleClearLastSessionVoiceChannelId() {
2026-08-24 06:08:38 +00:00
c16 = null ;
2026-07-20 16:05:17 +00:00
} ,
GUILD_DELETE : function handleGuildDelete ( arg0 ) {
if ( null != redux ) {
if ( redux . guildId === tmp . id ) {
destroyRTCConnection ( ) ;
}
}
return false ;
} ,
CHANNEL_DELETE : handleChannelDelete ,
THREAD_DELETE : handleChannelDelete ,
CALL_DELETE : function handleCallDelete ( arg0 ) {
if ( null != redux ) {
if ( redux . channelId === tmp ) {
destroyRTCConnection ( ) ;
}
}
return false ;
} ,
APP_STATE_UPDATE : function handleFocus ( state ) {
let tmp = state . state === constants2 . ACTIVE ;
if ( tmp ) {
tmp = null != redux ;
}
if ( tmp ) {
redux . resetBackoff ( "App state is active" ) ;
}
return false ;
} ,
RTC_DEBUG_SET_SIMULCAST_OVERRIDE : function handleSimulcastDebugOverrideChanged ( arg0 ) {
2026-07-29 08:29:29 +00:00
if ( closure_3 != null ) {
const result = closure_3 . setSimulcastDebugOverride ( tmp , tmp2 , tmp3 ) ;
2026-07-20 16:05:17 +00:00
}
}
} ;
2026-08-24 06:08:38 +00:00
let tmp3 = new timestampDefault ( "RTCConnectionStore" ) ;
2026-07-29 08:29:29 +00:00
require ( "expandEventProperties" ) . then ( ( addExtraAnalyticsDecorator ) = > {
const result = addExtraAnalyticsDecorator . addExtraAnalyticsDecorator ( ( arg0 ) = > {
arg0 . client_rtc_state = state . getState ( ) ;
} ) ;
} ) ;
2026-08-24 06:08:38 +00:00
let result = require ( "set" ) . fileFinishedImporting ( "stores/RTCConnectionStore.tsx" ) ;
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default rTCConnectionStore ;