import { DeviceManagerState , StatefulCallClient } from '@internal/calling-stateful-client' ; import { CallState as CallStatus } from '@azure/communication-calling' ; internal export const _isInCall = ( callStatus ? ) : boolean => ! ! callStatus && ! [ 'None' , 'Disconnected' , 'Connecting' ] . includes ( callStatus ) ; internal export const _isInLobbyOrConnecting = ( callStatus ) : boolean => ! ! callStatus && [ 'Connecting' , 'Ringing' , 'InLobby' ] . includes ( callStatus ) ; internal export const _isPreviewOn = ( deviceManager ) : boolean => { return deviceManager . unparentedViews . length > 0 && deviceManager . unparentedViews [ 0 ] . view !== undefined ; } ; private export const disposeAllLocalPreviewViews = async ( callClient ) : Promise < void > => { const unparentedViews = callClient . getState ( ) . deviceManager . unparentedViews ; for ( const view of unparentedViews ) { await callClient . disposeView ( undefined , undefined , view ) ; } } ;