2026-07-24 07:16:23 +00:00
// Module ID: 15734
// Function ID: 121283
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-23 10:11:24 +00:00
// Dependencies: [57, 31, 4143, 1194, 4177, 4202, 4148, 566, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-24 07:16:23 +00:00
// Module 15734 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray" ;
import result from "result" ;
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_5 from "_isNativeReflectConstruct" ;
import closure_6 from "_isNativeReflectConstruct" ;
import closure_7 from "_isNativeReflectConstruct" ;
import { ParticipantTypes } from "ParticipantTypes" ;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1 ;
function _createForOfIteratorHelperLoose ( iterable ) {
let closure_0 = iterable ;
iterable = "undefined" !== typeof Symbol ;
if ( iterable ) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol ;
2026-07-23 10:11:24 +00:00
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! iterable ) {
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( iterable ) {
const iter = iterable . call ( iterable ) ;
2026-07-20 16:05:17 +00:00
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
2026-07-23 10:11:24 +00:00
let tmp = iterable ;
if ( ! Array . isArray ( iterable ) ) {
2026-07-20 16:05:17 +00:00
let tmp2 ;
2026-07-23 10:11:24 +00:00
if ( iterable ) {
if ( "string" === typeof iterable ) {
tmp2 = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
const toString = { } . toString ;
2026-07-23 10:11:24 +00:00
const substr = toString . call ( iterable ) . slice ( 8 , - 1 ) ;
2026-07-20 16:05:17 +00:00
let name = substr ;
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
name = iterable . constructor . name ;
2026-07-20 16:05:17 +00:00
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
2026-07-23 10:11:24 +00:00
arr = Array . from ( iterable ) ;
const callResult = toString . call ( iterable ) ;
tmp3 = "Object" === substr && iterable . constructor ;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2 ;
if ( ! tmp2 ) {
const _TypeError = TypeError ;
const typeError = new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
throw typeError ;
}
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0 ;
2026-07-20 16:05:17 +00:00
return ( ) = > {
2026-07-23 10:11:24 +00:00
if ( closure_1 >= length . length ) {
2026-07-20 16:05:17 +00:00
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
2026-07-23 10:11:24 +00:00
obj . value = length [ + closure_1 ] ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ;
}
}
function _arrayLikeToArray ( arg0 , arg1 ) {
let length ;
if ( tmp ) {
length = arg0 . length ;
}
const ArrayResult = Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
ArrayResult [ num ] = arg0 [ num ] ;
}
return ArrayResult ;
}
function useSelectedParticipant ( channelId ) {
2026-07-23 10:11:24 +00:00
let result ;
2026-07-20 16:05:17 +00:00
let tmp3 ;
channelId = channelId . channelId ;
const focusedParticipantStreamId = channelId . focusedParticipantStreamId ;
const items = [ closure_5 ] ;
2026-07-23 10:11:24 +00:00
const stateFromStores = channelId ( focusedParticipantStreamId [ 7 ] ) . useStateFromStores ( items , ( ) = > outer1_5 . getId ( ) ) ;
let obj = channelId ( focusedParticipantStreamId [ 7 ] ) ;
[ tmp3 , result ] = stateFromStores ( React . useState ( 0 ) , 2 ) ;
let tmp2 = stateFromStores ( React . useState ( 0 ) , 2 ) ;
const items1 = [ stateFromStoresObject ] ;
2026-07-20 16:05:17 +00:00
const items2 = [ channelId , focusedParticipantStreamId , stateFromStores , tmp3 ] ;
2026-07-23 10:11:24 +00:00
stateFromStoresObject = channelId ( focusedParticipantStreamId [ 7 ] ) . useStateFromStoresObject ( items1 , ( ) = > {
2026-07-20 16:05:17 +00:00
let tmp16 ;
let tmp17 ;
let tmp18 ;
if ( null != channelId ) {
if ( null == focusedParticipantStreamId ) {
const _Date = Date ;
const timestamp = Date . now ( ) ;
const participants = stateFromStoresObject . getParticipants ( channelId ) ;
let flag = false ;
if ( 3 >= participants . length ) {
2026-07-23 10:11:24 +00:00
const tmp2 = outer1_9 ( participants ) ;
2026-07-20 16:05:17 +00:00
const iter = tmp2 ( ) ;
let iter2 = iter ;
flag = true ;
if ( ! iter . done ) {
while ( true ) {
let value = iter2 . value ;
2026-07-23 10:11:24 +00:00
let tmp3 = outer1_8 ;
if ( value . type === outer1_8 . ACTIVITY ) {
2026-07-20 16:05:17 +00:00
let iter3 = tmp2 ( ) ;
iter2 = iter3 ;
flag = true ;
if ( iter3 . done ) {
break ;
}
} else {
let user = value . user ;
let id ;
if ( null != user ) {
id = user . id ;
}
let tmp5 = user ;
flag = false ;
if ( id !== tmp49 ) {
break ;
}
}
break ;
}
}
}
2026-07-23 10:11:24 +00:00
const tmp7 = outer1_9 ( participants ) ;
2026-07-20 16:05:17 +00:00
const iter4 = tmp7 ( ) ;
let iter5 = iter4 ;
let tmp15 ;
if ( ! iter4 . done ) {
while ( true ) {
value = iter5 . value ;
let tmp19 = tmp14 ;
if ( ! flag ) {
2026-07-23 10:11:24 +00:00
let tmp20 = outer1_8 ;
2026-07-20 16:05:17 +00:00
tmp19 = tmp14 ;
2026-07-23 10:11:24 +00:00
if ( value . type === outer1_8 . USER ) {
2026-07-20 16:05:17 +00:00
let user2 = value . user ;
let id1 ;
if ( null != user2 ) {
id1 = user2 . id ;
}
let tmp22 = stateFromStores ;
tmp19 = user2 ;
let tmp23 = tmp8 ;
let tmp24 = tmp9 ;
let tmp25 = tmp10 ;
let tmp26 = tmp11 ;
let tmp27 = tmp12 ;
let tmp28 = tmp13 ;
2026-07-23 10:11:24 +00:00
tmp14 = user2 ;
2026-07-20 16:05:17 +00:00
}
let iter6 = tmp7 ( ) ;
2026-07-23 10:11:24 +00:00
tmp8 = tmp23 ;
tmp9 = tmp24 ;
tmp10 = tmp25 ;
tmp11 = tmp26 ;
tmp12 = tmp27 ;
tmp13 = tmp28 ;
2026-07-20 16:05:17 +00:00
iter5 = iter6 ;
tmp15 = tmp25 ;
tmp16 = tmp26 ;
tmp17 = tmp27 ;
tmp18 = tmp28 ;
if ( iter6 . done ) {
break ;
}
}
let type = value . type ;
2026-07-23 10:11:24 +00:00
let tmp29 = outer1_8 ;
if ( outer1_8 . USER === type ) {
2026-07-20 16:05:17 +00:00
let tmp32 = ( value . speaking || timestamp - value . lastSpoke < 1000 ) && null == tmp10 ;
if ( tmp32 ) {
tmp10 = value ;
}
let voiceState = value . voiceState ;
let selfVideo ;
if ( null != voiceState ) {
selfVideo = voiceState . selfVideo ;
}
let tmp34 = null != selfVideo && selfVideo ;
if ( tmp34 ) {
let tmp35 = null == tmp11 || tmp11 . lastSpoke < value . lastSpoke ;
tmp34 = tmp35 ;
}
if ( tmp34 ) {
tmp11 = value ;
}
let tmp36 = null == tmp13 || tmp13 . lastSpoke < value . lastSpoke ;
tmp23 = selfVideo ;
tmp24 = voiceState ;
tmp25 = tmp10 ;
tmp26 = tmp11 ;
tmp27 = tmp12 ;
tmp28 = tmp13 ;
tmp14 = tmp19 ;
if ( tmp36 ) {
tmp23 = selfVideo ;
tmp24 = voiceState ;
tmp25 = tmp10 ;
tmp26 = tmp11 ;
tmp27 = tmp12 ;
tmp28 = value ;
tmp14 = tmp19 ;
}
} else {
2026-07-23 10:11:24 +00:00
let tmp30 = outer1_8 ;
2026-07-20 16:05:17 +00:00
tmp23 = tmp8 ;
tmp24 = tmp9 ;
tmp25 = tmp10 ;
tmp26 = tmp11 ;
tmp27 = tmp12 ;
tmp28 = tmp13 ;
tmp14 = tmp19 ;
2026-07-23 10:11:24 +00:00
if ( outer1_8 . STREAM === type ) {
2026-07-20 16:05:17 +00:00
let tmp31 = null == tmp12 && null != value . streamId ;
tmp23 = tmp8 ;
tmp24 = tmp9 ;
tmp25 = tmp10 ;
tmp26 = tmp11 ;
tmp27 = tmp12 ;
tmp28 = tmp13 ;
tmp14 = tmp19 ;
if ( tmp31 ) {
tmp23 = tmp8 ;
tmp24 = tmp9 ;
tmp25 = tmp10 ;
tmp26 = tmp11 ;
tmp27 = value ;
tmp28 = tmp13 ;
tmp14 = tmp19 ;
}
}
}
}
}
const obj = { selectedParticipantSpeaking : null != tmp15 } ;
let id2 ;
if ( null != tmp15 ) {
const user3 = tmp15 . user ;
if ( null != user3 ) {
id2 = user3 . id ;
}
}
if ( null == id2 ) {
let id3 ;
if ( null != tmp16 ) {
const user4 = tmp16 . user ;
if ( null != user4 ) {
id3 = user4 . id ;
}
}
id2 = id3 ;
}
if ( null == id2 ) {
let id4 ;
if ( null != tmp18 ) {
const user5 = tmp18 . user ;
if ( null != user5 ) {
id4 = user5 . id ;
}
}
id2 = id4 ;
}
obj . selectedParticipantUserId = id2 ;
if ( null != tmp15 ) {
let streamId = tmp15 . streamId ;
let tmp43 ;
if ( null != streamId ) {
tmp43 = streamId ;
}
let tmp42 = tmp43 ;
} else {
streamId = undefined ;
if ( null != tmp17 ) {
streamId = tmp17 . streamId ;
}
if ( null == streamId ) {
let streamId1 ;
if ( null != tmp16 ) {
streamId1 = tmp16 . streamId ;
}
streamId = streamId1 ;
}
if ( null != streamId ) {
tmp42 = streamId ;
}
}
obj . selectedStreamId = tmp42 ;
return obj ;
}
}
return { selectedParticipantSpeaking : false , selectedParticipantUserId : undefined , selectedStreamId : undefined } ;
} , items2 ) ;
const items3 = [ stateFromStoresObject . selectedParticipantSpeaking ] ;
const effect = React . useEffect ( ( ) = > {
if ( stateFromStoresObject . selectedParticipantSpeaking ) {
const _setTimeout = setTimeout ;
const timeout = setTimeout ( ( ) = > {
2026-07-23 10:11:24 +00:00
outer1_3 ( ( arg0 ) = > arg0 + 1 ) ;
2026-07-20 16:05:17 +00:00
} , 3000 ) ;
return ( ) = > {
clearTimeout ( closure_0 ) ;
} ;
}
} , items3 ) ;
return stateFromStoresObject ;
}
2026-07-23 10:11:24 +00:00
const result = require ( "_isNativeReflectConstruct" ) . fileFinishedImporting ( "modules/external_pip/useExternalPipParticipant.android.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default function useExternalPipParticipant() {
let focusedParticipantType ;
let focusedParticipantUserId ;
let selectedParticipantSpeaking ;
let selectedParticipantUserId ;
let selectedStreamId ;
2026-07-23 10:11:24 +00:00
let obj = require ( 566 ) /* initialize */ ;
let items = [ closure_7 ] ;
const stateFromStores = obj . useStateFromStores ( items , ( ) = > outer1_7 . getChannelId ( ) ) ;
2026-07-20 16:05:17 +00:00
let tmp2 ;
if ( null != stateFromStores ) {
tmp2 = stateFromStores ;
}
obj = { channelId : tmp2 } ;
2026-07-23 10:11:24 +00:00
const tmp3 = ( function useFocusedParticipant ( channelId ) {
2026-07-20 16:05:17 +00:00
channelId = channelId . channelId ;
2026-07-23 10:11:24 +00:00
let closure_1 = outer1_3 . useRef ( undefined ) ;
let _slicedToArray = outer1_3 . useRef ( undefined ) ;
const items = [ outer1_4 ] ;
return outer1_0 ( outer1_1 [ 7 ] ) . useStateFromStoresObject ( items , ( ) = > {
2026-07-20 16:05:17 +00:00
let selectedParticipantId = null ;
if ( null != channelId ) {
2026-07-23 10:11:24 +00:00
selectedParticipantId = outer2_4 . getSelectedParticipantId ( channelId ) ;
2026-07-20 16:05:17 +00:00
}
let tmp4 = null ;
if ( null != selectedParticipantId ) {
tmp4 = null ;
if ( null != channelId ) {
2026-07-23 10:11:24 +00:00
const participant = outer2_4 . getParticipant ( channelId , selectedParticipantId ) ;
2026-07-20 16:05:17 +00:00
tmp4 = null ;
if ( null != participant ) {
tmp4 = participant ;
}
}
}
if ( undefined === ref . current ) {
let id ;
if ( null != tmp4 ) {
id = tmp4 . id ;
}
ref . current = id ;
let type ;
if ( null != tmp4 ) {
type = tmp4 . type ;
}
ref2 . current = type ;
const tmp11 = ref2 ;
const tmp9 = ref ;
}
let id1 ;
if ( null != tmp4 ) {
id1 = tmp4 . id ;
}
if ( ref . current !== id1 ) {
let obj = { focusedParticipantStreamId : undefined , focusedParticipantUserId : undefined , focusedParticipantType : ref2.current } ;
} else {
obj = { } ;
let type1 ;
if ( null != tmp4 ) {
type1 = tmp4 . type ;
}
let tmp16 ;
2026-07-23 10:11:24 +00:00
if ( type1 !== outer2_8 . ACTIVITY ) {
2026-07-20 16:05:17 +00:00
let streamId ;
if ( null != tmp4 ) {
streamId = tmp4 . streamId ;
}
if ( null != streamId ) {
tmp16 = streamId ;
}
}
obj . focusedParticipantStreamId = tmp16 ;
let type2 ;
if ( null != tmp4 ) {
type2 = tmp4 . type ;
}
let tmp20 ;
2026-07-23 10:11:24 +00:00
if ( type2 !== outer2_8 . ACTIVITY ) {
2026-07-20 16:05:17 +00:00
let id2 ;
if ( null != tmp4 ) {
const user = tmp4 . user ;
if ( null != user ) {
id2 = user . id ;
}
}
if ( null != id2 ) {
tmp20 = id2 ;
}
}
obj . focusedParticipantUserId = tmp20 ;
let type3 ;
if ( null != tmp4 ) {
type3 = tmp4 . type ;
}
let tmp23 ;
if ( null != type3 ) {
tmp23 = type3 ;
}
obj . focusedParticipantType = tmp23 ;
}
return obj ;
} ) ;
2026-07-23 10:11:24 +00:00
} ) ( obj ) ;
2026-07-20 16:05:17 +00:00
const focusedParticipantStreamId = tmp3 . focusedParticipantStreamId ;
obj = { channelId : tmp2 , focusedParticipantStreamId } ;
( { focusedParticipantUserId , focusedParticipantType } = tmp3 ) ;
( { selectedStreamId , selectedParticipantUserId , selectedParticipantSpeaking } = useSelectedParticipant ( obj ) ) ;
if ( null != focusedParticipantStreamId ) {
selectedStreamId = focusedParticipantStreamId ;
}
let tmp5 ;
if ( null != selectedStreamId ) {
tmp5 = selectedStreamId ;
}
if ( null != focusedParticipantStreamId ) {
selectedParticipantUserId = focusedParticipantUserId ;
}
const obj1 = { selectedParticipantStreamId : tmp5 } ;
2026-07-23 10:11:24 +00:00
( function useSetHasActiveVideoOutputSink ( selectedParticipantStreamId ) {
2026-07-20 16:05:17 +00:00
selectedParticipantStreamId = selectedParticipantStreamId . selectedParticipantStreamId ;
const items = [ selectedParticipantStreamId ] ;
2026-07-23 10:11:24 +00:00
const effect = outer1_3 . useEffect ( ( ) = > {
2026-07-20 16:05:17 +00:00
if ( null != closure_0 ) {
2026-07-23 10:11:24 +00:00
const useExternalPipParticipant = "useExternalPipParticipant" ;
let mediaEngine = outer2_6 . getMediaEngine ( ) ;
mediaEngine . eachConnection ( ( setHasActiveVideoOutputSink ) = > setHasActiveVideoOutputSink . setHasActiveVideoOutputSink ( closure_0 , true , useExternalPipParticipant ) ) ;
2026-07-20 16:05:17 +00:00
return ( ) = > {
2026-07-23 10:11:24 +00:00
const mediaEngine = outer3_6 . getMediaEngine ( ) ;
mediaEngine . eachConnection ( ( setHasActiveVideoOutputSink ) = > setHasActiveVideoOutputSink . setHasActiveVideoOutputSink ( outer1_0 , false , outer1_1 ) ) ;
2026-07-20 16:05:17 +00:00
} ;
}
} , items ) ;
2026-07-23 10:11:24 +00:00
} ) ( obj1 ) ;
2026-07-20 16:05:17 +00:00
const obj2 = { channelId : tmp2 , selectedParticipantStreamId : tmp5 , selectedParticipantUserId , selectedParticipantSpeaking , focusedParticipantType } ;
return obj2 ;
} ;