import { _isInCall , _isPreviewOn } from '@internal/calling-component-bindings' ; import { LocalVideoStreamState } from '@internal/calling-stateful-client' ; import * as reselect from 'reselect' ; import { getDeviceManager , getLocalVideoStreams } from './baseSelectors' ; import { callStatusSelector } from './callStatusSelector' ; private export const lobbySelector = reselect . createSelector ( [ callStatusSelector , getDeviceManager , getLocalVideoStreams ] , ( callStatus , deviceManager , localVideoStreams ) => { let localVideoStream ; if ( _isInCall ( callStatus . callStatus ) ) { localVideoStream = localVideoStreams ?. find ( ( i ) => i . mediaStreamType === 'Video' ) ; } else if ( _isPreviewOn ( deviceManager ) ) { localVideoStream = deviceManager . unparentedViews [ 0 ] ; } return { localParticipantVideoStream : { isAvailable : ! ! localVideoStream , isMirrored : localVideoStream ?. view ?. isMirrored , renderElement : localVideoStream ?. view ?. target } } ; } ) ;