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MAAK,QAAkB4mB,IACrB9e,OAAOoE,OAAOpE,OAAOoE,OAAO,CAAC,EAAGsL,GAAU,CAAE2D,YAAarT,OAAOoE,OAAOpE,OAAOoE,OAAO,CAAC,EAAGsL,aAAyC,EAASA,EAAQ2D,aAAc,CAAEoM,UAAU,C,iFC9KjL,MAAMC,EAAcphB,IACfA,EAAK+K,MAAsB,SAAd/K,EAAK+K,KAKjBsW,EAAmB1iB,IACpBA,EAAUoM,MAA2B,cAAnBpM,EAAUoM,KAK3BuW,EAAgBthB,GACJ,cAAdA,EAAK+K,KAKHwW,EAAqB5iB,GACJ,mBAAnBA,EAAUoM,KAKRyW,EAAwBxhB,GACZ,sBAAdA,EAAK+K,KAWH0W,EAAmBzhB,GACrB,SAAUA,KAAUA,EAAKpJ,KAAK8qB,Q","sources":["file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/Converter.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallClientState.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/Logger.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallIdHistory.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallContext.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/RemoteVideoStreamSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/StreamUtils.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/ParticipantSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/PPTLiveSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/TranscriptionSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/UserFacingDiagnosticsSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/RaiseHandSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/OptimalVideoCountSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/ReactionSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/SpotlightSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/IncomingCallSubscriber.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/IncomingCallDeclarative.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/TeamsIncomingCallDeclarative.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallDeclarative.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/VideoStreamRendererViewDeclarative.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js","file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.22.0_kdreznvoqpxsq65rzwgw6zo7je/node_modules/@azure/communication-react/dist/dist-esm/calling-stateful-client/src/TypeGuards.js"],"sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n/**\n * ProxyDeviceManager proxies DeviceManager and subscribes to all events that affect device manager state. State updates\n * are set on the provided context. Also any queries for state are proxied and stored in state as well. Only one device\n * manager should exist for a given CallClient so if CallClient.getDeviceManager is called multiple times, either a\n * cached ProxyDeviceManager should be returned or the existing ProxyDeviceManager should be destructed via destructor()\n * and a new ProxyDeviceManager created.\n */\nclass ProxyDeviceManager {\n constructor(deviceManager, context) {\n this.setDeviceManager = () => {\n // isSpeakerSelectionAvailable, selectedMicrophone, and selectedSpeaker are properties on DeviceManager. Since they\n // are not functions we can't proxy them so we'll update whenever we think they may need updating such as at\n // construction time or when certain events happen.\n this._context.setDeviceManagerIsSpeakerSelectionAvailable(this._deviceManager.isSpeakerSelectionAvailable);\n this._context.setDeviceManagerSelectedMicrophone(this._deviceManager.selectedMicrophone);\n this._context.setDeviceManagerSelectedSpeaker(this._deviceManager.selectedSpeaker);\n };\n this.subscribe = () => {\n this._deviceManager.on('videoDevicesUpdated', this.videoDevicesUpdated);\n this._deviceManager.on('audioDevicesUpdated', this.audioDevicesUpdated);\n this._deviceManager.on('selectedMicrophoneChanged', this.selectedMicrophoneChanged);\n this._deviceManager.on('selectedSpeakerChanged', this.selectedSpeakerChanged);\n // Subscribe to browser camera permissions changes\n if (navigator.permissions) {\n try {\n navigator.permissions.query({\n name: 'camera'\n }).then((cameraPermissions) => {\n cameraPermissions.addEventListener('change', this.permissionsApiStateChangeHandler);\n });\n }\n catch (e) {\n console.info('Could not subscribe to Permissions API Camera changed events, API is not supported by browser', e);\n }\n // Subscribe to browser microphone permissions changes\n try {\n navigator.permissions.query({\n name: 'microphone'\n }).then((micPermissions) => {\n micPermissions.addEventListener('change', this.permissionsApiStateChangeHandler);\n });\n }\n catch (e) {\n console.info('Could not subscribe to Permissions API Microphone changed events, API is not supported by browser', e);\n }\n }\n };\n /**\n * This is used to unsubscribe DeclarativeDeviceManager from the DeviceManager events.\n */\n this.unsubscribe = () => {\n this._deviceManager.off('videoDevicesUpdated', this.videoDevicesUpdated);\n this._deviceManager.off('audioDevicesUpdated', this.audioDevicesUpdated);\n this._deviceManager.off('selectedMicrophoneChanged', this.selectedMicrophoneChanged);\n this._deviceManager.off('selectedSpeakerChanged', this.selectedSpeakerChanged);\n if (navigator.permissions) {\n // Unsubscribe from browser camera permissions changes\n try {\n navigator.permissions.query({\n name: 'camera'\n }).then((cameraPermissions) => {\n cameraPermissions.removeEventListener('change', this.permissionsApiStateChangeHandler);\n });\n }\n catch (e) {\n console.info('Could not Unsubscribe to Permissions API Camera changed events, API is not supported by browser', e);\n }\n // Unsubscribe from browser microphone permissions changes\n try {\n navigator.permissions.query({\n name: 'microphone'\n }).then((micPermissions) => {\n micPermissions.removeEventListener('change', this.permissionsApiStateChangeHandler);\n });\n }\n catch (e) {\n console.info('Could not Unsubscribe to Permissions API Camera changed events, API is not supported by browser', e);\n }\n }\n };\n this.permissionsApiStateChangeHandler = () => __awaiter(this, void 0, void 0, function* () {\n yield this.updateDevicePermissionState();\n });\n /**\n * Used to set a camera inside the proxy device manager.\n *\n * @param videoDeviceInfo VideoDeviceInfo\n */\n this.selectCamera = (videoDeviceInfo) => {\n this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);\n };\n this.videoDevicesUpdated = () => __awaiter(this, void 0, void 0, function* () {\n // Device Manager always has a camera with '' name if there are no real camera devices available.\n // We don't want to show that in the UI.\n const realCameras = (yield this._deviceManager.getCameras()).filter(c => !!c.name);\n this._context.setDeviceManagerCameras(dedupeById(realCameras));\n });\n this.audioDevicesUpdated = () => __awaiter(this, void 0, void 0, function* () {\n this._context.setDeviceManagerMicrophones(dedupeById(yield this._deviceManager.getMicrophones()));\n if (this._deviceManager.isSpeakerSelectionAvailable) {\n this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));\n }\n });\n this.selectedMicrophoneChanged = () => {\n this._context.setDeviceManagerSelectedMicrophone(this._deviceManager.selectedMicrophone);\n };\n this.selectedSpeakerChanged = () => {\n this._context.setDeviceManagerSelectedSpeaker(this._deviceManager.selectedSpeaker);\n };\n this.updateDevicePermissionState = (sdkDeviceAccessState) => __awaiter(this, void 0, void 0, function* () {\n let hasCameraPermission = !!(sdkDeviceAccessState === null || sdkDeviceAccessState === void 0 ? void 0 : sdkDeviceAccessState.video);\n let hasMicPermission = !!(sdkDeviceAccessState === null || sdkDeviceAccessState === void 0 ? void 0 : sdkDeviceAccessState.audio);\n // Supplement the SDK values with values from the Permissions API to get a better understanding of the device\n // permission state. The SDK only uses the getUserMedia API to determine the device permission state. However,\n // this returns false if the camera is in use by another application. The Permissions API can provide more\n // information about the device permission state, but is not supported yet in Firefox or Android WebView.\n // Note: It also has the limitation where it cannot detect if the device is blocked by the Operating System\n // permissions.\n if (navigator.permissions) {\n try {\n const [cameraPermissions, micPermissions] = yield Promise.all([navigator.permissions.query({\n name: 'camera'\n }), navigator.permissions.query({\n name: 'microphone'\n })]);\n hasCameraPermission = cameraPermissions.state === 'granted';\n hasMicPermission = micPermissions.state === 'granted';\n }\n catch (e) {\n console.info('Permissions API is not supported by browser', e);\n }\n }\n this._context.setDeviceManagerDeviceAccess({\n video: hasCameraPermission,\n audio: hasMicPermission\n });\n this.setDeviceManager();\n });\n this._deviceManager = deviceManager;\n this._context = context;\n this.setDeviceManager();\n this.subscribe();\n }\n get(target, prop) {\n switch (prop) {\n case 'getCameras':\n {\n return this._context.withAsyncErrorTeedToState(() => {\n return target.getCameras().then((cameras) => {\n // Device Manager always has a camera with '' name if there are no real camera devices available.\n // We don't want to show that in the UI.\n const realCameras = cameras.filter(c => !!c.name);\n this._context.setDeviceManagerCameras(dedupeById(realCameras));\n return realCameras;\n });\n }, 'DeviceManager.getCameras');\n }\n case 'getMicrophones':\n {\n return this._context.withAsyncErrorTeedToState(() => {\n return target.getMicrophones().then((microphones) => {\n this._context.setDeviceManagerMicrophones(dedupeById(microphones));\n return microphones;\n });\n }, 'DeviceManager.getMicrophones');\n }\n case 'getSpeakers':\n {\n return this._context.withAsyncErrorTeedToState(() => {\n return target.getSpeakers().then((speakers) => {\n this._context.setDeviceManagerSpeakers(dedupeById(speakers));\n return speakers;\n });\n }, 'DeviceManager.getSpeakers');\n }\n case 'selectMicrophone':\n {\n return this._context.withAsyncErrorTeedToState((...args) => {\n return target.selectMicrophone(...args).then(() => {\n this._context.setDeviceManagerSelectedMicrophone(target.selectedMicrophone);\n });\n }, 'DeviceManager.selectMicrophone');\n }\n case 'selectSpeaker':\n {\n return this._context.withAsyncErrorTeedToState((...args) => {\n return target.selectSpeaker(...args).then(() => {\n this._context.setDeviceManagerSelectedSpeaker(target.selectedSpeaker);\n });\n }, 'DeviceManager.selectSpeaker');\n }\n case 'askDevicePermission':\n {\n return this._context.withAsyncErrorTeedToState((...args) => {\n return target.askDevicePermission(...args).then((deviceAccess) => __awaiter(this, void 0, void 0, function* () {\n yield this.updateDevicePermissionState(deviceAccess);\n return deviceAccess;\n }));\n }, 'DeviceManager.askDevicePermission');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n// TODO: Remove this when SDK no longer returns duplicate audio and video devices\n/** Helper function to dedupe duplicate audio and video devices obtained from SDK */\nconst dedupeById = (devices) => {\n const ids = new Set();\n const uniqueDevices = [];\n devices.forEach((device) => {\n if (!ids.has(device.id)) {\n uniqueDevices.push(device);\n ids.add(device.id);\n }\n });\n return uniqueDevices;\n};\n/**\n * Creates a declarative DeviceManager by proxying DeviceManager with ProxyDeviceManager. The declarative DeviceManager\n * will put state updates in the given context.\n *\n * @param deviceManager - DeviceManager from SDK\n * @param context - CallContext from StatefulCallClient\n *\n * @private\n */\nexport const deviceManagerDeclaratify = (deviceManager, context, internalContext) => {\n const proxyDeviceManager = new ProxyDeviceManager(deviceManager, context);\n Object.defineProperty(deviceManager, 'unsubscribe', {\n configurable: false,\n value: () => proxyDeviceManager.unsubscribe()\n });\n Object.defineProperty(deviceManager, 'selectCamera', {\n configurable: false,\n value: (videoDeviceInfo) => proxyDeviceManager.selectCamera(videoDeviceInfo)\n });\n Object.defineProperty(deviceManager, 'getUnparentedVideoStreams', {\n configurable: false,\n value: () => internalContext.getUnparentedRenderInfos()\n });\n return new Proxy(deviceManager, proxyDeviceManager);\n};\n//# sourceMappingURL=DeviceManagerDeclarative.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\nimport { _isTeamsIncomingCall } from './TypeGuards';\nimport { _isACSCall } from './TypeGuards';\nimport { _isTeamsCall } from './TypeGuards';\nimport { Features } from '@azure/communication-calling';\n/**\n * @private\n */\nexport function convertSdkLocalStreamToDeclarativeLocalStream(stream) {\n const localVideoStreamEffectsAPI = stream.feature(Features.VideoEffects);\n return {\n source: stream.source,\n mediaStreamType: stream.mediaStreamType,\n view: undefined,\n videoEffects: convertFromSDKToDeclarativeVideoStreamVideoEffects(localVideoStreamEffectsAPI.activeEffects)\n };\n}\n/**\n * @private\n */\nexport function convertSdkRemoteStreamToDeclarativeRemoteStream(stream) {\n return {\n id: stream.id,\n mediaStreamType: stream.mediaStreamType,\n isAvailable: stream.isAvailable,\n isReceiving: stream.isReceiving,\n view: undefined,\n streamSize: stream.size\n };\n}\n/**\n * @private\n */\nexport function convertSdkParticipantToDeclarativeParticipant(participant) {\n const declarativeVideoStreams = {};\n for (const videoStream of participant.videoStreams) {\n declarativeVideoStreams[videoStream.id] = convertSdkRemoteStreamToDeclarativeRemoteStream(videoStream);\n }\n return {\n identifier: participant.identifier,\n displayName: participant.displayName,\n state: participant.state,\n callEndReason: participant.callEndReason,\n videoStreams: declarativeVideoStreams,\n isMuted: participant.isMuted,\n isSpeaking: participant.isSpeaking,\n raisedHand: undefined,\n role: participant.role,\n spotlight: undefined\n };\n}\n/**\n * @private\n *\n * Note at the time of writing only one LocalVideoStream is supported by the SDK.\n */\nexport function convertSdkCallToDeclarativeCall(call) {\n const declarativeRemoteParticipants = {};\n call.remoteParticipants.forEach((participant) => {\n declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] = convertSdkParticipantToDeclarativeParticipant(participant);\n });\n let hideAttendeeNames = false;\n if (call.feature(Features.Capabilities).capabilities && call.feature(Features.Capabilities).capabilities.viewAttendeeNames) {\n const viewAttendeeNames = call.feature(Features.Capabilities).capabilities.viewAttendeeNames;\n if (!viewAttendeeNames.isPresent && viewAttendeeNames.reason === 'MeetingRestricted') {\n hideAttendeeNames = true;\n }\n }\n let callInfo;\n if ('info' in call) {\n callInfo = call.info;\n }\n return {\n id: call.id,\n kind: _isACSCall(call) ? 'Call' : 'TeamsCall',\n callerInfo: call.callerInfo,\n state: call.state,\n callEndReason: call.callEndReason,\n diagnostics: {\n network: {\n latest: {}\n },\n media: {\n latest: {}\n }\n },\n direction: call.direction,\n isMuted: call.isMuted,\n isScreenSharingOn: call.isScreenSharingOn,\n localVideoStreams: call.localVideoStreams.map(convertSdkLocalStreamToDeclarativeLocalStream),\n remoteParticipants: declarativeRemoteParticipants,\n remoteParticipantsEnded: {},\n recording: {\n isRecordingActive: false\n },\n pptLive: {\n isActive: false\n },\n raiseHand: {\n raisedHands: []\n },\n localParticipantReaction: undefined,\n transcription: {\n isTranscriptionActive: false\n },\n screenShareRemoteParticipant: undefined,\n startTime: new Date(),\n endTime: undefined,\n role: call.role,\n captionsFeature: {\n captions: [],\n supportedSpokenLanguages: [],\n supportedCaptionLanguages: [],\n currentCaptionLanguage: '',\n currentSpokenLanguage: '',\n isCaptionsFeatureActive: false,\n startCaptionsInProgress: false,\n captionsKind: _isTeamsCall(call) ? 'TeamsCaptions' : 'Captions'\n },\n transfer: {\n acceptedTransfers: {}\n },\n optimalVideoCount: {\n maxRemoteVideoStreams: call.feature(Features.OptimalVideoCount).optimalVideoCount\n },\n hideAttendeeNames,\n info: callInfo,\n meetingConference: {\n conferencePhones: []\n }\n };\n}\n/**\n * @private\n */\nexport function convertSdkIncomingCallToDeclarativeIncomingCall(call) {\n if (_isTeamsIncomingCall(call)) {\n const newInfo = Object.assign(Object.assign({}, call.info), { kind: call.kind });\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n }\n else {\n const newInfo = Object.assign(Object.assign({}, call.info), { kind: call.kind });\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n }\n const newInfo = Object.assign(Object.assign({}, call.info), { kind: call.kind });\n return {\n id: call.id,\n info: newInfo,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n}\n/**\n * @private\n */\nexport function convertFromSDKToDeclarativeVideoStreamRendererView(view) {\n return {\n scalingMode: view.scalingMode,\n isMirrored: view.isMirrored,\n target: view.target\n };\n}\n/**\n * @private\n */\nexport function convertFromTeamsSDKToCaptionInfoState(caption) {\n return Object.assign({}, caption);\n}\n/**\n * @private\n */\nexport function convertFromSDKToCaptionInfoState(caption) {\n return Object.assign({ captionText: caption.spokenText }, caption);\n}\n/** @private */\nexport function convertFromSDKToDeclarativeVideoStreamVideoEffects(videoEffects) {\n return {\n activeEffects: videoEffects\n };\n}\n/**\n * @private\n */\nexport function convertFromSDKToRaisedHandState(raisedHand) {\n return {\n raisedHandOrderPosition: raisedHand.order\n };\n}\n/** @private */\nexport function convertConferencePhoneInfo(meetingConferencePhoneInfo) {\n if (!meetingConferencePhoneInfo) {\n return [];\n }\n return meetingConferencePhoneInfo.phoneNumbers.flatMap(phoneNumber => {\n var _a, _b, _c, _d;\n const common = {\n conferenceId: meetingConferencePhoneInfo.phoneConferenceId,\n country: phoneNumber.countryName,\n city: phoneNumber.cityName,\n phoneNumber: '',\n isTollFree: false\n };\n const toll = Object.assign({}, common);\n toll.phoneNumber = (_b = (_a = phoneNumber.tollPhoneNumber) === null || _a === void 0 ? void 0 : _a.phoneNumber) !== null && _b !== void 0 ? _b : '';\n toll.isTollFree = false;\n const tollFree = Object.assign({}, common);\n tollFree.phoneNumber = (_d = (_c = phoneNumber.tollFreePhoneNumber) === null || _c === void 0 ? void 0 : _c.phoneNumber) !== null && _d !== void 0 ? _d : '';\n tollFree.isTollFree = true;\n return [toll, tollFree].filter(phoneInfo => phoneInfo.phoneNumber);\n });\n}\n//# sourceMappingURL=Converter.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * Error thrown from failed stateful API methods.\n *\n * @public\n */\nexport class CallError extends Error {\n constructor(target, innerError, timestamp) {\n super();\n this.target = target;\n this.innerError = innerError;\n // Testing note: It is easier to mock Date::now() than the Date() constructor.\n this.timestamp = timestamp !== null && timestamp !== void 0 ? timestamp : new Date(Date.now());\n this.name = 'CallError';\n this.message = `${this.target}: ${this.innerError.message}`;\n }\n}\n//# sourceMappingURL=CallClientState.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { createClientLogger } from '@azure/logger';\n/**\n * @private\n */\nexport const callingStatefulLogger = createClientLogger('communication-react:calling-stateful');\n/**\n * @private\n */\nexport var EventNames;\n(function (EventNames) {\n // Info\n EventNames[\"VIEW_RENDER_SUCCEED\"] = \"VIEW_RENDER_SUCCEED\";\n EventNames[\"START_DISPOSE_STREAM\"] = \"START_DISPOSE_STREAM\";\n EventNames[\"START_STREAM_RENDERING\"] = \"START_STREAM_RENDERING\";\n EventNames[\"DISPOSING_RENDERER\"] = \"DISPOSING_RENDERER\";\n EventNames[\"CREATING_VIEW\"] = \"CREATING_VIEW\";\n // Warning\n EventNames[\"CREATE_STREAM_INVALID_PARAMS\"] = \"CREATE_STREAM_INVALID_PARAMS\";\n EventNames[\"DISPOSE_STREAM_INVALID_PARAMS\"] = \"DISPOSE_STREAM_INVALID_PARAMS\";\n EventNames[\"STREAM_ALREADY_RENDERED\"] = \"STREAM_ALREADY_RENDERED\";\n EventNames[\"STREAM_ALREADY_DISPOSED\"] = \"STREAM_ALREADY_DISPOSED\";\n EventNames[\"STREAM_STOPPING\"] = \"STREAM_STOPPING\";\n EventNames[\"CREATED_STREAM_STOPPING\"] = \"CREATED_STREAM_STOPPING\";\n EventNames[\"STREAM_RENDERING\"] = \"STREAM_RENDERING\";\n // Error\n EventNames[\"STREAM_NOT_FOUND\"] = \"STREAM_NOT_FOUND\";\n EventNames[\"RENDER_INFO_NOT_FOUND\"] = \"RENDER_INFO_NOT_FOUND\";\n EventNames[\"DISPOSE_INFO_NOT_FOUND\"] = \"DISPOSE_INFO_NOT_FOUND\";\n EventNames[\"RENDERER_NOT_FOUND\"] = \"RENDERER_NOT_FOUND\";\n EventNames[\"CREATE_STREAM_FAIL\"] = \"CREATE_STREAM_FAIL\";\n})(EventNames || (EventNames = {}));\n//# sourceMappingURL=Logger.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n * Call Id will change during the call for at least 1 time\n * This is to avoid async bug that call id has been changed during an async-await function\n * but the function still uses stale call id to access state\n */\nexport class CallIdHistory {\n constructor() {\n this._callIdHistory = new Map();\n }\n updateCallIdHistory(newCallId, oldCallId) {\n // callId for a call can fluctuate between some set of values.\n // But if a newCallId already exists, and maps to different call, we're in trouble.\n // This can only happen if a callId is reused across two distinct calls.\n const existing = this._callIdHistory.get(newCallId);\n if (existing !== undefined && this.latestCallId(newCallId) !== oldCallId) {\n console.trace(`${newCallId} alredy exists and maps to ${existing}, which is not the same as ${oldCallId}`);\n }\n // The latest callId never maps to another callId.\n this._callIdHistory.delete(newCallId);\n this._callIdHistory.set(oldCallId, newCallId);\n }\n latestCallId(callId) {\n let latest = callId;\n /* eslint no-constant-condition: [\"error\", { \"checkLoops\": false }] */\n while (true) {\n const newer = this._callIdHistory.get(latest);\n if (newer === undefined) {\n break;\n }\n latest = newer;\n }\n return latest;\n }\n}\n//# sourceMappingURL=CallIdHistory.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { convertConferencePhoneInfo } from './Converter';\nimport { createClientLogger, getLogLevel } from '@azure/logger';\nimport { EventEmitter } from 'events';\nimport { enableMapSet, enablePatches, produce } from 'immer';\nimport { _safeJSONStringify, toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\nimport { CallError } from './CallClientState';\nimport { callingStatefulLogger } from './Logger';\nimport { CallIdHistory } from './CallIdHistory';\nimport { convertFromTeamsSDKToCaptionInfoState } from './Converter';\nimport { convertFromSDKToCaptionInfoState } from './Converter';\nimport { convertFromSDKToRaisedHandState } from './Converter';\nenableMapSet();\n// Needed to generate state diff for verbose logging.\nenablePatches();\n// TODO: How can we make this configurable?\n/**\n * @private\n */\nexport const MAX_CALL_HISTORY_LENGTH = 10;\n/**\n * @private\n */\nexport const REACTION_ANIMATION_TIME_MS = 4133;\n/**\n * @private\n */\nexport class CallContext {\n constructor(userId, maxListeners = 50) {\n this._callIdHistory = new CallIdHistory();\n this._timeOutId = {};\n /**\n * Tees direct errors to state.\n * @remarks\n * This is typically used for errors that are caught and intended to be shown to the user.\n *\n * @param error The raw error to report.\n * @param target The error target to tee error to.\n *\n * @private\n */\n this.teeErrorToState = (error, target) => {\n const callError = toCallError(target, error);\n this.setLatestError(target, callError);\n };\n this._logger = createClientLogger('communication-react:calling-context');\n this._state = {\n calls: {},\n callsEnded: {},\n incomingCalls: {},\n incomingCallsEnded: {},\n deviceManager: {\n isSpeakerSelectionAvailable: false,\n cameras: [],\n microphones: [],\n speakers: [],\n unparentedViews: []\n },\n callAgent: undefined,\n userId: userId,\n environmentInfo: undefined,\n latestErrors: {}\n };\n this._emitter = new EventEmitter();\n this._emitter.setMaxListeners(maxListeners);\n this._atomicId = 0;\n }\n getState() {\n return this._state;\n }\n modifyState(modifier) {\n const priorState = this._state;\n this._state = produce(this._state, modifier, (patches) => {\n if (getLogLevel() === 'verbose') {\n // Log to `info` because AzureLogger.verbose() doesn't show up in console.\n this._logger.info(`State change: ${_safeJSONStringify(patches)}`);\n }\n });\n if (this._state !== priorState) {\n this._emitter.emit('stateChanged', this._state);\n }\n }\n onStateChange(handler) {\n this._emitter.on('stateChanged', handler);\n }\n offStateChange(handler) {\n this._emitter.off('stateChanged', handler);\n }\n // Disposing of the CallAgentDeclarative will not clear the state. If we create a new CallAgentDeclarative, we should\n // make sure the state is clean because any left over state (if previous CallAgentDeclarative was disposed) may be\n // invalid.\n clearCallRelatedState() {\n this.modifyState((draft) => {\n draft.calls = {};\n draft.incomingCalls = {};\n draft.callsEnded = {};\n draft.incomingCallsEnded = {};\n });\n }\n setCallAgent(callAgent) {\n this.modifyState((draft) => {\n draft.callAgent = callAgent;\n });\n }\n setCall(call) {\n this.modifyState((draft) => {\n const latestCallId = this._callIdHistory.latestCallId(call.id);\n const existingCall = draft.calls[latestCallId];\n if (existingCall) {\n existingCall.callerInfo = call.callerInfo;\n existingCall.state = call.state;\n existingCall.callEndReason = call.callEndReason;\n existingCall.direction = call.direction;\n existingCall.isMuted = call.isMuted;\n existingCall.isScreenSharingOn = call.isScreenSharingOn;\n existingCall.localVideoStreams = call.localVideoStreams;\n existingCall.remoteParticipants = call.remoteParticipants;\n existingCall.transcription.isTranscriptionActive = call.transcription.isTranscriptionActive;\n existingCall.optimalVideoCount.maxRemoteVideoStreams = call.optimalVideoCount.maxRemoteVideoStreams;\n existingCall.recording.isRecordingActive = call.recording.isRecordingActive;\n existingCall.raiseHand.raisedHands = call.raiseHand.raisedHands;\n existingCall.pptLive.isActive = call.pptLive.isActive;\n existingCall.raiseHand.localParticipantRaisedHand = call.raiseHand.localParticipantRaisedHand;\n existingCall.role = call.role;\n // We don't update the startTime and endTime if we are updating an existing active call\n existingCall.captionsFeature.currentSpokenLanguage = call.captionsFeature.currentSpokenLanguage;\n existingCall.captionsFeature.currentCaptionLanguage = call.captionsFeature.currentCaptionLanguage;\n existingCall.info = call.info;\n existingCall.meetingConference = call.meetingConference;\n }\n else {\n draft.calls[latestCallId] = call;\n }\n });\n /**\n * Remove the incoming call that matches the call if there is one\n */\n if (this._state.incomingCalls[call.id]) {\n this.removeIncomingCall(call.id);\n }\n }\n removeCall(callId) {\n this.modifyState((draft) => {\n delete draft.calls[this._callIdHistory.latestCallId(callId)];\n });\n }\n setCallEnded(callId, callEndReason) {\n const latestCallId = this._callIdHistory.latestCallId(callId);\n this.modifyState((draft) => {\n const call = draft.calls[latestCallId];\n if (call) {\n call.endTime = new Date();\n call.callEndReason = callEndReason;\n delete draft.calls[latestCallId];\n // Performance note: This loop should run only once because the number of entries\n // is never allowed to exceed MAX_CALL_HISTORY_LENGTH. A loop is used for correctness.\n while (Object.keys(draft.callsEnded).length >= MAX_CALL_HISTORY_LENGTH) {\n const oldestCall = findOldestCallEnded(draft.callsEnded);\n if (oldestCall) {\n delete draft.callsEnded[oldestCall];\n }\n }\n draft.callsEnded[latestCallId] = call;\n }\n });\n }\n setCallState(callId, state) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.state = state;\n }\n });\n }\n setCallId(newCallId, oldCallId) {\n this._callIdHistory.updateCallIdHistory(newCallId, oldCallId);\n this.modifyState((draft) => {\n const call = draft.calls[oldCallId];\n if (call) {\n call.id = newCallId;\n delete draft.calls[oldCallId];\n draft.calls[newCallId] = call;\n }\n });\n }\n setEnvironmentInfo(envInfo) {\n this.modifyState((draft) => {\n draft.environmentInfo = envInfo;\n });\n }\n setCallIsScreenSharingOn(callId, isScreenSharingOn) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.isScreenSharingOn = isScreenSharingOn;\n }\n });\n }\n setCallRemoteParticipants(callId, addRemoteParticipant, removeRemoteParticipant) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n removeRemoteParticipant.forEach((id) => {\n delete call.remoteParticipants[id];\n });\n addRemoteParticipant.forEach((participant) => {\n call.remoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] = participant;\n });\n }\n });\n }\n setCallRemoteParticipantsEnded(callId, addRemoteParticipant, removeRemoteParticipant) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n removeRemoteParticipant.forEach((id) => {\n delete call.remoteParticipantsEnded[id];\n });\n addRemoteParticipant.forEach((participant) => {\n call.remoteParticipantsEnded[toFlatCommunicationIdentifier(participant.identifier)] = participant;\n });\n }\n });\n }\n setCallLocalVideoStream(callId, streamsAdded, streamsRemoved) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n for (const removedStream of streamsRemoved) {\n const index = call.localVideoStreams.findIndex(i => i.mediaStreamType === removedStream.mediaStreamType);\n if (index > -1) {\n call.localVideoStreams.splice(index, 1);\n }\n }\n for (const addedStream of streamsAdded) {\n const index = call.localVideoStreams.findIndex(i => i.mediaStreamType === addedStream.mediaStreamType);\n if (index > -1) {\n call.localVideoStreams[index] = addedStream;\n }\n else {\n call.localVideoStreams.push(addedStream);\n }\n }\n }\n });\n }\n setCallLocalVideoStreamVideoEffects(callId, videoEffects) {\n this.modifyState((draft) => {\n var _a;\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const stream = (_a = call.localVideoStreams) === null || _a === void 0 ? void 0 : _a.find(i => i.mediaStreamType === 'Video');\n if (stream) {\n stream.videoEffects = videoEffects;\n }\n }\n });\n }\n setCallIsMicrophoneMuted(callId, isMicrophoneMuted) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.isMuted = isMicrophoneMuted;\n }\n });\n }\n setRole(callId, role) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.role = role;\n }\n });\n }\n setCallDominantSpeakers(callId, dominantSpeakers) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.dominantSpeakers = dominantSpeakers;\n }\n });\n }\n setCallRecordingActive(callId, isRecordingActive) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.recording.isRecordingActive = isRecordingActive;\n }\n });\n }\n setCallPPTLiveActive(callId, isActive) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.pptLive.isActive = isActive;\n }\n });\n }\n setCallParticipantPPTLive(callId, participantKey, target) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call && participantKey) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.contentSharingStream = target;\n call.contentSharingRemoteParticipant = participantKey;\n }\n }\n });\n }\n setCallRaisedHands(callId, raisedHands) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.raiseHand.raisedHands = raisedHands.map(raisedHand => {\n return convertFromSDKToRaisedHandState(raisedHand);\n });\n const raisedHand = raisedHands.find(raisedHand => toFlatCommunicationIdentifier(raisedHand.identifier) === toFlatCommunicationIdentifier(this._state.userId));\n if (raisedHand) {\n call.raiseHand.localParticipantRaisedHand = convertFromSDKToRaisedHandState(raisedHand);\n }\n else {\n call.raiseHand.localParticipantRaisedHand = undefined;\n }\n }\n });\n }\n setParticipantIsRaisedHand(callId, participantKey, raisedHand) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.raisedHand = raisedHand ? convertFromSDKToRaisedHandState(raisedHand) : raisedHand;\n }\n }\n });\n }\n setReceivedReactionFromParticipant(callId, participantKey, reactionMessage) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (!call) {\n return;\n }\n clearTimeout(this._timeOutId[participantKey]);\n const participant = call.remoteParticipants[participantKey];\n const newReactionState = reactionMessage ? {\n reactionMessage: reactionMessage,\n receivedOn: new Date()\n } : undefined;\n if (participantKey === toFlatCommunicationIdentifier(this._state.userId)) {\n call.localParticipantReaction = newReactionState;\n }\n else if (!participant) {\n // Warn if we can't find the participant in the call but we are trying to set their reaction state to a new reaction.\n if (reactionMessage !== null) {\n console.warn(`Participant ${participantKey} not found in call ${callId}. Cannot set reaction state.`);\n }\n }\n else {\n participant.reactionState = newReactionState;\n }\n if (reactionMessage) {\n this._timeOutId[participantKey] = setTimeout(() => {\n clearParticipantReactionState(this, callId, participantKey);\n }, REACTION_ANIMATION_TIME_MS);\n }\n });\n }\n setCallTranscriptionActive(callId, isTranscriptionActive) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.transcription.isTranscriptionActive = isTranscriptionActive;\n }\n });\n }\n setCapabilities(callId, capabilities, capabilitiesChangeInfo) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.capabilitiesFeature = {\n capabilities,\n latestCapabilitiesChangeInfo: capabilitiesChangeInfo\n };\n }\n });\n }\n setHideAttendeeNames(callId, capabilitiesChangeInfo) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (capabilitiesChangeInfo.oldValue.viewAttendeeNames !== capabilitiesChangeInfo.newValue.viewAttendeeNames) {\n const viewAttendeeNames = capabilitiesChangeInfo.newValue.viewAttendeeNames;\n if (call && viewAttendeeNames && !viewAttendeeNames.isPresent && viewAttendeeNames.reason === 'MeetingRestricted') {\n call.hideAttendeeNames = true;\n }\n else if (call) {\n call.hideAttendeeNames = false;\n }\n }\n });\n }\n setSpotlight(callId, spotlightedParticipants, maxParticipantsToSpotlight) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.spotlight = Object.assign(Object.assign({}, call.spotlight), { spotlightedParticipants,\n maxParticipantsToSpotlight });\n }\n });\n }\n setTeamsMeetingConference(callId, teamsMeetingConferenceDetails) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.meetingConference = {\n conferencePhones: convertConferencePhoneInfo(teamsMeetingConferenceDetails)\n };\n }\n });\n }\n setParticipantSpotlighted(callId, spotlightedParticipant) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[toFlatCommunicationIdentifier(spotlightedParticipant.identifier)];\n if (participant) {\n participant.spotlight = {\n spotlightedOrderPosition: spotlightedParticipant.order\n };\n }\n else if (call.spotlight && toFlatCommunicationIdentifier(draft.userId) === toFlatCommunicationIdentifier(spotlightedParticipant.identifier)) {\n call.spotlight.localParticipantSpotlight = {\n spotlightedOrderPosition: spotlightedParticipant.order\n };\n }\n }\n });\n }\n setParticipantNotSpotlighted(callId, spotlightedParticipant) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[toFlatCommunicationIdentifier(spotlightedParticipant.identifier)];\n if (participant) {\n participant.spotlight = undefined;\n }\n else if (call.spotlight && toFlatCommunicationIdentifier(draft.userId) === toFlatCommunicationIdentifier(spotlightedParticipant.identifier)) {\n call.spotlight.localParticipantSpotlight = undefined;\n }\n }\n });\n }\n setCallScreenShareParticipant(callId, participantKey) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.screenShareRemoteParticipant = participantKey;\n }\n });\n }\n setLocalVideoStreamRendererView(callId, localVideoMediaStreamType, view) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const localVideoStream = call.localVideoStreams.find(localVideoStream => localVideoStream.mediaStreamType === localVideoMediaStreamType);\n if (localVideoStream) {\n localVideoStream.view = view;\n }\n }\n });\n }\n setParticipantState(callId, participantKey, state) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.state = state;\n }\n }\n });\n }\n setParticipantIsMuted(callId, participantKey, muted) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.isMuted = muted;\n }\n }\n });\n }\n setOptimalVideoCount(callId, optimalVideoCount) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.optimalVideoCount.maxRemoteVideoStreams = optimalVideoCount;\n }\n });\n }\n setParticipantRole(callId, participantKey, role) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.role = role;\n }\n }\n });\n }\n setParticipantDisplayName(callId, participantKey, displayName) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.displayName = displayName;\n }\n }\n });\n }\n setParticipantIsSpeaking(callId, participantKey, isSpeaking) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n participant.isSpeaking = isSpeaking;\n }\n }\n });\n }\n setParticipantVideoStream(callId, participantKey, stream) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n // Set is called by subscriber will not modify any rendered stream so if there is existing stream only\n // modify the values that subscriber has access to.\n const existingStream = participant.videoStreams[stream.id];\n if (existingStream) {\n existingStream.isAvailable = stream.isAvailable;\n existingStream.isReceiving = stream.isReceiving;\n existingStream.mediaStreamType = stream.mediaStreamType;\n }\n else {\n participant.videoStreams[stream.id] = stream;\n }\n }\n }\n });\n }\n setRemoteVideoStreamIsAvailable(callId, participantKey, streamId, isAvailable) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.isAvailable = isAvailable;\n }\n }\n }\n });\n }\n setRemoteVideoStreamIsReceiving(callId, participantKey, streamId, isReceiving) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.isReceiving = isReceiving;\n }\n }\n }\n });\n }\n setRemoteVideoStreamSize(callId, participantKey, streamId, size) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.streamSize = size;\n }\n }\n }\n });\n }\n setRemoteVideoStreams(callId, participantKey, addRemoteVideoStream, removeRemoteVideoStream) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n for (const id of removeRemoteVideoStream) {\n delete participant.videoStreams[id];\n }\n for (const newStream of addRemoteVideoStream) {\n // This should only be called by the subscriber and some properties are add by other components so if the\n // stream already exists, only update the values that subscriber knows about.\n const stream = participant.videoStreams[newStream.id];\n if (stream) {\n stream.mediaStreamType = newStream.mediaStreamType;\n stream.isAvailable = newStream.isAvailable;\n stream.isReceiving = newStream.isReceiving;\n }\n else {\n participant.videoStreams[newStream.id] = newStream;\n }\n }\n }\n }\n });\n }\n setRemoteVideoStreamRendererView(callId, participantKey, streamId, view) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream) {\n stream.view = view;\n }\n }\n }\n });\n }\n setRemoteVideoStreamViewScalingMode(callId, participantKey, streamId, scalingMode) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const participant = call.remoteParticipants[participantKey];\n if (participant) {\n const stream = participant.videoStreams[streamId];\n if (stream && stream.view) {\n stream.view.scalingMode = scalingMode;\n }\n }\n }\n });\n }\n setIncomingCall(call) {\n this.modifyState((draft) => {\n const existingCall = draft.incomingCalls[call.id];\n if (existingCall) {\n existingCall.callerInfo = call.callerInfo;\n }\n else {\n draft.incomingCalls[call.id] = call;\n }\n });\n }\n removeIncomingCall(callId) {\n this.modifyState((draft) => {\n delete draft.incomingCalls[callId];\n });\n }\n setIncomingCallEnded(callId, callEndReason) {\n this.modifyState((draft) => {\n const call = draft.incomingCalls[callId];\n if (call) {\n call.endTime = new Date();\n call.callEndReason = callEndReason;\n delete draft.incomingCalls[callId];\n // Performance note: This loop should run only once because the number of entries\n // is never allowed to exceed MAX_CALL_HISTORY_LENGTH. A loop is used for correctness.\n while (Object.keys(draft.incomingCallsEnded).length >= MAX_CALL_HISTORY_LENGTH) {\n const oldestCall = findOldestCallEnded(draft.incomingCallsEnded);\n if (oldestCall) {\n delete draft.incomingCallsEnded[oldestCall];\n }\n }\n draft.incomingCallsEnded[callId] = call;\n }\n });\n }\n setDeviceManagerIsSpeakerSelectionAvailable(isSpeakerSelectionAvailable) {\n this.modifyState((draft) => {\n draft.deviceManager.isSpeakerSelectionAvailable = isSpeakerSelectionAvailable;\n });\n }\n setDeviceManagerSelectedMicrophone(selectedMicrophone) {\n this.modifyState((draft) => {\n draft.deviceManager.selectedMicrophone = selectedMicrophone;\n });\n }\n setDeviceManagerSelectedSpeaker(selectedSpeaker) {\n this.modifyState((draft) => {\n draft.deviceManager.selectedSpeaker = selectedSpeaker;\n });\n }\n setDeviceManagerSelectedCamera(selectedCamera) {\n this.modifyState((draft) => {\n draft.deviceManager.selectedCamera = selectedCamera;\n });\n }\n setDeviceManagerCameras(cameras) {\n this.modifyState((draft) => {\n /**\n * SDK initializes cameras with one dummy camera with value { id: 'camera:id', name: '', deviceType: 'USBCamera' } immediately after\n * camera permissions are granted. So selectedCamera will have this value before the actual cameras are obtained. Therefore we should reset\n * selectedCamera to the first camera when there are cameras AND when current selectedCamera does not exist in the new array of cameras *\n */\n if (cameras.length > 0 && !cameras.some(camera => { var _a; return camera.id === ((_a = draft.deviceManager.selectedCamera) === null || _a === void 0 ? void 0 : _a.id); })) {\n draft.deviceManager.selectedCamera = cameras[0];\n }\n draft.deviceManager.cameras = cameras;\n });\n }\n setDeviceManagerMicrophones(microphones) {\n this.modifyState((draft) => {\n draft.deviceManager.microphones = microphones;\n });\n }\n setDeviceManagerSpeakers(speakers) {\n this.modifyState((draft) => {\n draft.deviceManager.speakers = speakers;\n });\n }\n setDeviceManagerDeviceAccess(deviceAccess) {\n this.modifyState((draft) => {\n draft.deviceManager.deviceAccess = deviceAccess;\n });\n }\n setDeviceManagerUnparentedView(localVideoStream, view) {\n this.modifyState((draft) => {\n draft.deviceManager.unparentedViews.push({\n source: localVideoStream.source,\n mediaStreamType: localVideoStream.mediaStreamType,\n view: view\n });\n });\n }\n deleteDeviceManagerUnparentedView(localVideoStream) {\n this.modifyState((draft) => {\n const foundIndex = draft.deviceManager.unparentedViews.findIndex(stream => stream.mediaStreamType === localVideoStream.mediaStreamType);\n if (foundIndex !== -1) {\n draft.deviceManager.unparentedViews.splice(foundIndex, 1);\n }\n });\n }\n setDeviceManagerUnparentedViewVideoEffects(localVideoStream, videoEffects) {\n this.modifyState((draft) => {\n const view = draft.deviceManager.unparentedViews.find(stream => stream.mediaStreamType === localVideoStream.mediaStreamType);\n if (view) {\n view.videoEffects = videoEffects;\n }\n });\n }\n getAndIncrementAtomicId() {\n const id = this._atomicId;\n this._atomicId++;\n return id;\n }\n processNewCaption(captions, newCaption) {\n var _a;\n // time stamp when new caption comes in\n newCaption.timestamp = new Date();\n // if this is the first caption, push it in\n if (captions.length === 0) {\n captions.push(newCaption);\n }\n // if the last caption is final, then push the new one in\n else if (((_a = captions[captions.length - 1]) === null || _a === void 0 ? void 0 : _a.resultType) === 'Final') {\n captions.push(newCaption);\n }\n // if the last caption is Partial, then check if the speaker is the same as the new caption, if so, update the last caption\n else {\n const lastCaption = captions[captions.length - 1];\n if (lastCaption && lastCaption.speaker.identifier && newCaption.speaker.identifier && toFlatCommunicationIdentifier(lastCaption.speaker.identifier) === toFlatCommunicationIdentifier(newCaption.speaker.identifier)) {\n captions[captions.length - 1] = newCaption;\n }\n // if different speaker, ignore the interjector until the current speaker finishes\n // edge case: if we dont receive the final caption from the current speaker for 5 secs, we turn the current speaker caption to final and push in the new interjector\n else if (lastCaption) {\n if (Date.now() - lastCaption.timestamp.getTime() > 5000) {\n lastCaption.resultType = 'Final';\n captions.push(newCaption);\n }\n }\n }\n // If the array length exceeds 50, remove the oldest caption\n if (captions.length > 50) {\n captions.shift();\n }\n }\n addTeamsCaption(callId, caption) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n const currentCaptionLanguage = call.captionsFeature.currentCaptionLanguage;\n if (caption.captionLanguage.toUpperCase() === currentCaptionLanguage.toUpperCase() || currentCaptionLanguage === '' || currentCaptionLanguage === undefined) {\n this.processNewCaption(call.captionsFeature.captions, convertFromTeamsSDKToCaptionInfoState(caption));\n }\n }\n });\n }\n addCaption(callId, caption) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n this.processNewCaption(call.captionsFeature.captions, convertFromSDKToCaptionInfoState(caption));\n }\n });\n }\n setCaptionsKind(callId, kind) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.captionsKind = kind;\n }\n });\n }\n clearCaptions(callId) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.captions = [];\n }\n });\n }\n setIsCaptionActive(callId, isCaptionsActive) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.isCaptionsFeatureActive = isCaptionsActive;\n }\n });\n }\n setStartCaptionsInProgress(callId, startCaptionsInProgress) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.startCaptionsInProgress = startCaptionsInProgress;\n }\n });\n }\n setSelectedSpokenLanguage(callId, spokenLanguage) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.currentSpokenLanguage = spokenLanguage;\n }\n });\n }\n setSelectedCaptionLanguage(callId, captionLanguage) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.currentCaptionLanguage = captionLanguage;\n }\n });\n }\n setAvailableCaptionLanguages(callId, captionLanguages) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.supportedCaptionLanguages = captionLanguages;\n }\n });\n }\n setAvailableSpokenLanguages(callId, spokenLanguages) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.captionsFeature.supportedSpokenLanguages = spokenLanguages;\n }\n });\n }\n setAcceptedTransfer(callId, acceptedTransfer) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.transfer.acceptedTransfers[acceptedTransfer.callId] = acceptedTransfer;\n }\n });\n }\n /**\n * Tees any errors encountered in an async function to the state.\n *\n * @param action Async function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n withAsyncErrorTeedToState(action, target) {\n return (...args) => __awaiter(this, void 0, void 0, function* () {\n try {\n return yield action(...args);\n }\n catch (error) {\n const callError = toCallError(target, error);\n this.setLatestError(target, callError);\n throw callError;\n }\n });\n }\n /**\n * Tees any errors encountered in an function to the state.\n *\n * @param action Function to execute.\n * @param target The error target to tee error to.\n * @returns Result of calling `f`. Also re-raises any exceptions thrown from `f`.\n * @throws CallError. Exceptions thrown from `f` are tagged with the failed `target.\n */\n withErrorTeedToState(action, target) {\n return (...args) => {\n try {\n callingStatefulLogger.info(`Calling stateful client target function called: ${target}`);\n return action(...args);\n }\n catch (error) {\n const callError = toCallError(target, error);\n this.setLatestError(target, callError);\n throw callError;\n }\n };\n }\n setLatestError(target, error) {\n this.modifyState((draft) => {\n draft.latestErrors[target] = error;\n });\n }\n}\nconst toCallError = (target, error) => {\n if (error instanceof Error) {\n return new CallError(target, error);\n }\n return new CallError(target, new Error(error));\n};\nconst findOldestCallEnded = (calls) => {\n var _a, _b, _c, _d;\n const callEntries = Object.entries(calls);\n const firstCallEntry = callEntries[0];\n if (!firstCallEntry) {\n return undefined; // no calls exist\n }\n let [oldestCallId, oldestCall] = firstCallEntry;\n if (oldestCall.endTime === undefined) {\n return oldestCallId;\n }\n for (const [callId, call] of callEntries.slice(1)) {\n if (call.endTime === undefined) {\n return callId;\n }\n if (((_b = (_a = call.endTime) === null || _a === void 0 ? void 0 : _a.getTime()) !== null && _b !== void 0 ? _b : 0) < ((_d = (_c = oldestCall.endTime) === null || _c === void 0 ? void 0 : _c.getTime()) !== null && _d !== void 0 ? _d : 0)) {\n [oldestCallId, oldestCall] = [callId, call];\n }\n }\n return oldestCallId;\n};\nfunction clearParticipantReactionState(callContext, callId, participantKey) {\n callContext.setReceivedReactionFromParticipant(callId, participantKey, null);\n}\n//# sourceMappingURL=CallContext.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport class TeamsCaptionsSubscriber {\n constructor(callIdRef, context, captions) {\n this.subscribe = () => {\n this._captions.on('CaptionsActiveChanged', this.isCaptionsActiveChanged);\n this._captions.on('CaptionsReceived', this.onCaptionsReceived);\n this._captions.on('CaptionLanguageChanged', this.isCaptionLanguageChanged);\n this._captions.on('SpokenLanguageChanged', this.isSpokenLanguageChanged);\n };\n this.unsubscribe = () => {\n this._captions.off('CaptionsActiveChanged', this.isCaptionsActiveChanged);\n this._captions.off('CaptionsReceived', this.onCaptionsReceived);\n this._captions.off('CaptionLanguageChanged', this.isCaptionLanguageChanged);\n this._captions.off('SpokenLanguageChanged', this.isSpokenLanguageChanged);\n };\n this.onCaptionsReceived = (caption) => {\n this._context.addTeamsCaption(this._callIdRef.callId, caption);\n };\n this.isCaptionsActiveChanged = () => {\n this._context.setIsCaptionActive(this._callIdRef.callId, this._captions.isCaptionsFeatureActive);\n };\n this.isCaptionLanguageChanged = () => {\n this._context.setSelectedCaptionLanguage(this._callIdRef.callId, this._captions.activeCaptionLanguage);\n };\n this.isSpokenLanguageChanged = () => {\n this._context.setSelectedSpokenLanguage(this._callIdRef.callId, this._captions.activeSpokenLanguage);\n };\n this._callIdRef = callIdRef;\n this._context = context;\n this._captions = captions;\n if (this._captions.isCaptionsFeatureActive) {\n this._context.setIsCaptionActive(this._callIdRef.callId, this._captions.isCaptionsFeatureActive);\n }\n this._context.setAvailableSpokenLanguages(this._callIdRef.callId, this._captions.supportedSpokenLanguages);\n if ('supportedCaptionLanguages' in this._captions) {\n this._context.setAvailableCaptionLanguages(this._callIdRef.callId, this._captions.supportedCaptionLanguages);\n }\n this._context.setSelectedSpokenLanguage(this._callIdRef.callId, this._captions.activeSpokenLanguage);\n this._context.setSelectedCaptionLanguage(this._callIdRef.callId, this._captions.activeCaptionLanguage);\n this.subscribe();\n }\n}\n/**\n * @private\n */\nexport class CaptionsSubscriber {\n constructor(callIdRef, context, captions) {\n this.subscribe = () => {\n this._captions.on('CaptionsActiveChanged', this.isCaptionsActiveChanged);\n this._captions.on('SpokenLanguageChanged', this.isSpokenLanguageChanged);\n this._captions.on('CaptionsReceived', this.onCaptionsReceived);\n };\n this.unsubscribe = () => {\n this._captions.off('CaptionsActiveChanged', this.isCaptionsActiveChanged);\n this._captions.off('SpokenLanguageChanged', this.isSpokenLanguageChanged);\n this._captions.off('CaptionsReceived', this.onCaptionsReceived);\n };\n this.onCaptionsReceived = (caption) => {\n this._context.addCaption(this._callIdRef.callId, caption);\n };\n this.isCaptionsActiveChanged = () => {\n this._context.setIsCaptionActive(this._callIdRef.callId, this._captions.isCaptionsFeatureActive);\n };\n this.isSpokenLanguageChanged = () => {\n this._context.setSelectedSpokenLanguage(this._callIdRef.callId, this._captions.activeSpokenLanguage);\n };\n this._callIdRef = callIdRef;\n this._context = context;\n this._captions = captions;\n if (this._captions.isCaptionsFeatureActive) {\n this._context.setIsCaptionActive(this._callIdRef.callId, this._captions.isCaptionsFeatureActive);\n }\n this._context.setAvailableSpokenLanguages(this._callIdRef.callId, this._captions.supportedSpokenLanguages);\n this._context.setSelectedSpokenLanguage(this._callIdRef.callId, this._captions.activeSpokenLanguage);\n this.subscribe();\n }\n}\n/**\n * @private\n */\nexport class CaptionsFeatureSubscriber {\n constructor(callIdRef, context, captions) {\n this.subscribe = () => {\n this._captions.on('CaptionsKindChanged', this.isCaptionsKindChanged);\n };\n this.unsubscribe = () => {\n var _a, _b;\n this._captions.off('CaptionsKindChanged', this.isCaptionsKindChanged);\n (_a = this._TeamsCaptionsSubscriber) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n (_b = this._CaptionsSubscriber) === null || _b === void 0 ? void 0 : _b.unsubscribe();\n };\n this.isCaptionsKindChanged = () => {\n var _a;\n this._context.setCaptionsKind(this._callIdRef.callId, this._captions.captions.kind);\n // ACS call can turn into teams call but teams call will never turn into ACS call so we only need to handle the case when captions kind is TeamsCaptions\n if (this._captions.captions.kind === 'TeamsCaptions') {\n (_a = this._CaptionsSubscriber) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n this._TeamsCaptionsSubscriber = new TeamsCaptionsSubscriber(this._callIdRef, this._context, this._captions.captions);\n }\n };\n this._callIdRef = callIdRef;\n this._context = context;\n this._captions = captions;\n this._context.setCaptionsKind(this._callIdRef.callId, this._captions.captions.kind);\n if (this._captions.captions.kind === 'TeamsCaptions') {\n this._TeamsCaptionsSubscriber = new TeamsCaptionsSubscriber(this._callIdRef, this._context, this._captions.captions);\n }\n else {\n this._CaptionsSubscriber = new CaptionsSubscriber(this._callIdRef, this._context, this._captions.captions);\n }\n this.subscribe();\n }\n}\n//# sourceMappingURL=CaptionsSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { convertFromSDKToDeclarativeVideoStreamVideoEffects } from './Converter';\n/**\n * Subscribes to a LocalVideoStream's video effects events and updates the call context appropriately.\n * @private\n */\nexport class LocalVideoStreamVideoEffectsSubscriber {\n constructor(args) {\n this.subscribe = () => {\n this._localVideoStreamEffectsAPI.on('effectsStarted', this.effectsStarted);\n this._localVideoStreamEffectsAPI.on('effectsStopped', this.effectsStopped);\n this._localVideoStreamEffectsAPI.on('effectsError', this.effectsError);\n };\n this.unsubscribe = () => {\n this._localVideoStreamEffectsAPI.off('effectsStarted', this.effectsStarted);\n this._localVideoStreamEffectsAPI.off('effectsStopped', this.effectsStopped);\n this._localVideoStreamEffectsAPI.off('effectsError', this.effectsError);\n };\n this.effectsStarted = () => {\n this.updateStatefulVideoEffects();\n };\n this.effectsStopped = () => {\n this.updateStatefulVideoEffects();\n };\n this.effectsError = (error) => {\n // When there is an error the effects have stopped. Ensure state is updated to reflect if effects are active or not.\n this.updateStatefulVideoEffects();\n this._context.teeErrorToState(new Error(error.message), 'VideoEffectsFeature.startEffects');\n };\n this.updateStatefulVideoEffects = () => {\n const statefulVideoEffects = convertFromSDKToDeclarativeVideoStreamVideoEffects(this._localVideoStreamEffectsAPI.activeEffects);\n if (this._parent === 'unparented') {\n this._context.setDeviceManagerUnparentedViewVideoEffects(this._localVideoStream, statefulVideoEffects);\n }\n else {\n this._context.setCallLocalVideoStreamVideoEffects(this._parent.callId, statefulVideoEffects);\n }\n };\n this._parent = args.parent;\n this._context = args.context;\n this._localVideoStream = args.localVideoStream;\n this._localVideoStreamEffectsAPI = args.localVideoStreamEffectsAPI;\n this.subscribe();\n }\n}\n//# sourceMappingURL=LocalVideoStreamVideoEffectsSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport class RemoteVideoStreamSubscriber {\n constructor(callIdRef, participantKey, remoteVideoStream, context) {\n this.subscribe = () => {\n this._remoteVideoStream.on('isAvailableChanged', this.isAvailableChanged);\n this._remoteVideoStream.on('isReceivingChanged', this.isReceivingChanged);\n this._remoteVideoStream.on('sizeChanged', this.isSizeChanged);\n this.checkAndUpdateScreenShareState();\n };\n this.unsubscribe = () => {\n this._remoteVideoStream.off('isAvailableChanged', this.isAvailableChanged);\n this._remoteVideoStream.off('isReceivingChanged', this.isReceivingChanged);\n this._remoteVideoStream.off('sizeChanged', this.isSizeChanged);\n };\n this.includesActiveScreenShareStream = (streams) => {\n for (const stream of Object.values(streams)) {\n if (stream.mediaStreamType === 'ScreenSharing' && stream.isAvailable) {\n return true;\n }\n }\n return false;\n };\n /**\n * Update the state with the active screen share stream. If there is an existing stream will overwrite it if this one\n * is active (newer stream takes priority). If there is an existing stream and this one is set to unavailable, and the\n * existing stream is different participant, then don't set the active screen share stream to undefined, else set it\n * to undefined.\n */\n this.checkAndUpdateScreenShareState = () => {\n var _a, _b, _c;\n if (this._remoteVideoStream.mediaStreamType !== 'ScreenSharing') {\n return;\n }\n if (this._remoteVideoStream.isAvailable) {\n this._context.setCallScreenShareParticipant(this._callIdRef.callId, this._participantKey);\n return;\n }\n const existingScreenShare = (_a = this._context.getState().calls[this._callIdRef.callId]) === null || _a === void 0 ? void 0 : _a.screenShareRemoteParticipant;\n // If somehow we end up with an event where a RemoteParticipant's ScreenShare stream is set to\n // unavailable but there exists already another different participant actively sharing, and they are still\n // sharing then this event shouldn't set the screenShareRemoteParticipant to undefined.\n if (!existingScreenShare || existingScreenShare === this._participantKey) {\n this._context.setCallScreenShareParticipant(this._callIdRef.callId, undefined);\n return;\n }\n const streams = (_c = (_b = this._context.getState().calls[this._callIdRef.callId]) === null || _b === void 0 ? void 0 : _b.remoteParticipants[existingScreenShare]) === null || _c === void 0 ? void 0 : _c.videoStreams;\n if (!streams) {\n this._context.setCallScreenShareParticipant(this._callIdRef.callId, undefined);\n return;\n }\n // If the existing ScreenShare that is not owned by the current RemoteParticipant is still active, don't\n // overwrite it with undefined. So only overwrite if it is not active.\n if (!this.includesActiveScreenShareStream(streams)) {\n this._context.setCallScreenShareParticipant(this._callIdRef.callId, undefined);\n return;\n }\n };\n this.isAvailableChanged = () => {\n this._context.setRemoteVideoStreamIsAvailable(this._callIdRef.callId, this._participantKey, this._remoteVideoStream.id, this._remoteVideoStream.isAvailable);\n this.checkAndUpdateScreenShareState();\n };\n this.isReceivingChanged = () => {\n this._context.setRemoteVideoStreamIsReceiving(this._callIdRef.callId, this._participantKey, this._remoteVideoStream.id, this._remoteVideoStream.isReceiving);\n };\n this.isSizeChanged = () => {\n var _a, _b, _c, _d, _e, _f, _g;\n if (((_a = this._remoteVideoStream) === null || _a === void 0 ? void 0 : _a.size.width) === 0 && ((_b = this._remoteVideoStream) === null || _b === void 0 ? void 0 : _b.size.height) === 0) {\n return;\n }\n const streamSize = (_e = (_d = (_c = this._context.getState().calls[this._callIdRef.callId]) === null || _c === void 0 ? void 0 : _c.remoteParticipants[this._participantKey]) === null || _d === void 0 ? void 0 : _d.videoStreams[this._remoteVideoStream.id]) === null || _e === void 0 ? void 0 : _e.streamSize;\n const existingAspectRatio = streamSize ? streamSize.width / streamSize.height : undefined;\n const newAspectRatio = ((_f = this._remoteVideoStream) === null || _f === void 0 ? void 0 : _f.size.width) / ((_g = this._remoteVideoStream) === null || _g === void 0 ? void 0 : _g.size.height);\n if (!streamSize || existingAspectRatio !== newAspectRatio) {\n this._context.setRemoteVideoStreamSize(this._callIdRef.callId, this._participantKey, this._remoteVideoStream.id, this._remoteVideoStream.size);\n }\n };\n this._callIdRef = callIdRef;\n this._participantKey = participantKey;\n this._remoteVideoStream = remoteVideoStream;\n this._context = context;\n this.subscribe();\n }\n}\n//# sourceMappingURL=RemoteVideoStreamSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { _logEvent } from \"../../acs-ui-common/src\";\nimport { callingStatefulLogger, EventNames } from './Logger';\n/**\n * helper function to manage logging for stream disposals\n *\n * @param eventName Name of event that occured when managing streams\n * @param streamLogInfo Data about the stream in the event\n * @returns\n */\nfunction _logDisposeStreamEvent(eventName, streamLogInfo) {\n switch (eventName) {\n case EventNames.DISPOSE_STREAM_INVALID_PARAMS:\n _logEvent(callingStatefulLogger, {\n name: EventNames.DISPOSE_STREAM_INVALID_PARAMS,\n level: 'warning',\n message: 'Dispose View invalid combination of parameters.',\n data: {\n streamType: streamLogInfo.streamType\n }\n });\n return;\n case EventNames.START_DISPOSE_STREAM:\n _logEvent(callingStatefulLogger, {\n name: EventNames.START_DISPOSE_STREAM,\n level: 'info',\n message: 'Start disposing stream.',\n data: streamLogInfo\n });\n return;\n case EventNames.DISPOSE_INFO_NOT_FOUND:\n _logEvent(callingStatefulLogger, {\n name: EventNames.DISPOSE_INFO_NOT_FOUND,\n level: 'error',\n message: 'Cannot find render info when disposing stream.',\n data: streamLogInfo\n });\n return;\n case EventNames.STREAM_STOPPING:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_STOPPING,\n level: 'info',\n message: 'Stream is currently marked as stopping, will continue if is local preview',\n data: streamLogInfo\n });\n return;\n case EventNames.DISPOSING_RENDERER:\n _logEvent(callingStatefulLogger, {\n name: EventNames.DISPOSING_RENDERER,\n level: 'info',\n message: 'Disposing view renderer.',\n data: streamLogInfo\n });\n return;\n case EventNames.RENDERER_NOT_FOUND:\n _logEvent(callingStatefulLogger, {\n name: EventNames.RENDERER_NOT_FOUND,\n level: 'error',\n message: 'Cannot find renderer when disposing stream.',\n data: streamLogInfo\n });\n return;\n case EventNames.STREAM_ALREADY_DISPOSED:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_ALREADY_DISPOSED,\n level: 'info',\n message: 'Stream is already disposed.',\n data: streamLogInfo\n });\n return;\n default:\n return;\n }\n}\n/**\n * helper function to manage logging for local stream creations\n *\n * @param eventName Name of the event to occured when creating a local stream\n * @param streamLogInfo Data about the stream in the event\n * @param error that is thrown by caller\n * @returns\n */\nfunction _logCreateStreamEvent(eventName, streamLogInfo, error) {\n switch (eventName) {\n case EventNames.CREATE_STREAM_INVALID_PARAMS:\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATE_STREAM_INVALID_PARAMS,\n level: 'warning',\n message: 'Create View invalid combination of parameters.',\n data: {\n streamType: streamLogInfo.streamType\n }\n });\n return;\n case EventNames.START_STREAM_RENDERING:\n _logEvent(callingStatefulLogger, {\n name: EventNames.START_STREAM_RENDERING,\n level: 'info',\n message: 'Start creating view for local video.',\n data: streamLogInfo\n });\n return;\n case EventNames.STREAM_NOT_FOUND:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_NOT_FOUND,\n level: 'error',\n message: 'Stream not found in state.',\n data: {\n callId: streamLogInfo.callId\n }\n });\n return;\n case EventNames.STREAM_ALREADY_RENDERED:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_ALREADY_RENDERED,\n level: 'warning',\n message: 'Stream is already rendered.',\n data: streamLogInfo\n });\n return;\n case EventNames.STREAM_RENDERING:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_RENDERING,\n level: 'warning',\n message: 'Stream is rendering.',\n data: streamLogInfo\n });\n return;\n case EventNames.STREAM_STOPPING:\n _logEvent(callingStatefulLogger, {\n name: EventNames.STREAM_STOPPING,\n level: 'warning',\n message: 'Stream was marked as stopping by dispose view. Resetting state to \"Rendering\".',\n data: streamLogInfo\n });\n return;\n case EventNames.CREATE_STREAM_FAIL:\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATE_STREAM_FAIL,\n level: 'error',\n message: 'Failed to create view.',\n data: {\n error: error,\n streamType: streamLogInfo.streamType,\n callId: streamLogInfo.callId\n }\n });\n return;\n case EventNames.RENDER_INFO_NOT_FOUND:\n _logEvent(callingStatefulLogger, {\n name: EventNames.RENDER_INFO_NOT_FOUND,\n level: 'error',\n message: 'Cannot find render info after create the view. ',\n data: streamLogInfo\n });\n return;\n case EventNames.CREATED_STREAM_STOPPING:\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATED_STREAM_STOPPING,\n level: 'warning',\n message: 'Render info status is stopping, dispose renderer.',\n data: streamLogInfo\n });\n return;\n case EventNames.VIEW_RENDER_SUCCEED:\n _logEvent(callingStatefulLogger, {\n name: EventNames.VIEW_RENDER_SUCCEED,\n level: 'info',\n message: `Successfully render the view.`,\n data: streamLogInfo\n });\n return;\n case EventNames.CREATING_VIEW:\n _logEvent(callingStatefulLogger, {\n name: EventNames.CREATING_VIEW,\n level: 'info',\n message: 'Start creating view for remote video.',\n data: streamLogInfo\n });\n return;\n default:\n return;\n }\n}\n/**\n * helper function to fire streamUtils logging events\n *\n * @param eventName Name of event from streamUtils\n * @param streamLogInfo informaiton about the event and who called it\n * @param error if any errors present will be added to message in logging\n */\nexport function _logStreamEvent(eventName, streamLogInfo, error) {\n if (streamLogInfo.streamEventType === 'disposeViewLocal' || streamLogInfo.streamEventType === 'disposeViewRemote' || streamLogInfo.streamEventType === 'disposeViewUnparented') {\n _logDisposeStreamEvent(eventName, streamLogInfo);\n }\n else if (streamLogInfo.streamEventType === 'createViewLocal' || streamLogInfo.streamEventType === 'createViewRemote') {\n _logCreateStreamEvent(eventName, streamLogInfo, error);\n }\n}\n//# sourceMappingURL=StreamUtilsLogging.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { LocalVideoStream, VideoStreamRenderer } from '@azure/communication-calling';\nimport { convertSdkLocalStreamToDeclarativeLocalStream, convertSdkRemoteStreamToDeclarativeRemoteStream, convertFromSDKToDeclarativeVideoStreamRendererView } from './Converter';\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\nimport { EventNames } from './Logger';\nimport { _logStreamEvent } from './StreamUtilsLogging';\nfunction createViewVideo(context, internalContext, callId, stream, participantId, options) {\n return __awaiter(this, void 0, void 0, function* () {\n // we can only have 3 types of createView\n let streamEventType;\n // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.\n if (participantId) {\n streamEventType = 'createViewRemote';\n }\n else if (callId) {\n streamEventType = 'createViewLocal';\n }\n else {\n // TODO update for when unparented view.\n throw new Error('unparented createView not implemented yet here');\n streamEventType = 'createViewUnparented';\n }\n const streamType = stream === null || stream === void 0 ? void 0 : stream.mediaStreamType;\n const localStreamKey = stream.mediaStreamType;\n const remoteStreamId = stream.id;\n // we want to check to see if there is a participantId this will tell us whether its a local stream or a remote one.\n const participantKey = streamEventType === 'createViewRemote' && participantId ? typeof participantId === 'string' ? participantId : toFlatCommunicationIdentifier(participantId) : undefined;\n const streamLogInfo = {\n callId,\n participantKey,\n streamId: remoteStreamId !== null && remoteStreamId !== void 0 ? remoteStreamId : localStreamKey,\n streamType,\n streamEventType\n };\n // make different logging announcement based on whether or not we are starting a local or remote\n _logStreamEvent(EventNames.CREATING_VIEW, streamLogInfo);\n // if we have a participant Id and a stream get the remote info, else get the local render info from state.\n const renderInfo = streamEventType === 'createViewRemote' && participantKey ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, remoteStreamId) : internalContext.getLocalRenderInfo(callId, localStreamKey);\n if (!renderInfo) {\n _logStreamEvent(EventNames.STREAM_NOT_FOUND, streamLogInfo);\n return;\n }\n if (renderInfo.status === 'Rendered') {\n _logStreamEvent(EventNames.STREAM_ALREADY_RENDERED, streamLogInfo);\n return;\n }\n if (renderInfo.status === 'Rendering') {\n // Do not log to console here as this is a very common situation due to UI rerenders while\n // the video rendering is in progress.\n _logStreamEvent(EventNames.STREAM_RENDERING, streamLogInfo);\n return;\n }\n // \"Stopping\" only happens if the stream was in \"rendering\" but `disposeView` was called.\n // Now that `createView` has been re-called, we can flip the state back to \"rendering\".\n if (renderInfo.status === 'Stopping') {\n if (streamEventType === 'createViewRemote' && participantKey) {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setRemoteRenderInfo(callId, participantKey, remoteStreamId, renderInfo.stream, 'Rendering', renderInfo.renderer);\n }\n else if (streamEventType === 'createViewLocal') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setLocalRenderInfo(callId, localStreamKey, renderInfo.stream, 'Rendering', renderInfo.renderer);\n }\n return;\n }\n const renderer = new VideoStreamRenderer(renderInfo.stream);\n streamEventType === 'createViewRemote' && participantKey ? internalContext.setRemoteRenderInfo(callId, participantKey, remoteStreamId, renderInfo.stream, 'Rendering', undefined) : internalContext.setLocalRenderInfo(callId, localStreamKey, renderInfo.stream, 'Rendering', renderer);\n let view;\n try {\n view = yield renderer.createView(options);\n }\n catch (e) {\n if (streamEventType === 'createViewRemote' && participantKey) {\n _logStreamEvent(EventNames.CREATE_STREAM_FAIL, streamLogInfo);\n internalContext.setRemoteRenderInfo(callId, participantKey, remoteStreamId, renderInfo.stream, 'NotRendered', undefined);\n }\n else if (streamEventType === 'createViewLocal') {\n _logStreamEvent(EventNames.CREATE_STREAM_FAIL, streamLogInfo, e);\n internalContext.setLocalRenderInfo(callId, localStreamKey, renderInfo.stream, 'NotRendered', undefined);\n }\n throw e;\n }\n // Since render could take some time, we need to check if the stream is still valid and if we received a signal to\n // stop rendering.\n const refreshedRenderInfo = streamEventType === 'createViewRemote' && participantKey ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, remoteStreamId) : internalContext.getLocalRenderInfo(callId, localStreamKey);\n if (!refreshedRenderInfo) {\n // RenderInfo was removed. This should not happen unless stream was removed from the call so dispose the renderer\n // and clean up the state.\n _logStreamEvent(EventNames.RENDER_INFO_NOT_FOUND, streamLogInfo);\n renderer.dispose();\n streamEventType === 'createViewRemote' && participantKey ? context.setRemoteVideoStreamRendererView(callId, participantKey, remoteStreamId, undefined) : context.setLocalVideoStreamRendererView(callId, localStreamKey, undefined);\n return;\n }\n if (refreshedRenderInfo.status === 'Stopping') {\n // Stop render was called on this stream after we had started rendering. We will dispose this view and do not\n // put the view into the state.\n streamEventType === 'createViewRemote';\n _logStreamEvent(EventNames.CREATED_STREAM_STOPPING, streamLogInfo);\n renderer.dispose();\n if (streamEventType === 'createViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(callId, participantKey, remoteStreamId, refreshedRenderInfo.stream, 'NotRendered', undefined);\n context.setRemoteVideoStreamRendererView(callId, participantKey, remoteStreamId, undefined);\n }\n else if (streamEventType === 'createViewLocal') {\n internalContext.setLocalRenderInfo(callId, localStreamKey, refreshedRenderInfo.stream, 'NotRendered', undefined);\n context.setLocalVideoStreamRendererView(callId, localStreamKey, undefined);\n }\n return;\n }\n // Else the stream still exists and status is not telling us to stop rendering. Complete the render process by\n // updating the state.\n if (streamEventType === 'createViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(callId, participantKey, remoteStreamId, refreshedRenderInfo.stream, 'Rendered', renderer);\n context.setRemoteVideoStreamRendererView(callId, participantKey, remoteStreamId, convertFromSDKToDeclarativeVideoStreamRendererView(view));\n _logStreamEvent(EventNames.VIEW_RENDER_SUCCEED, streamLogInfo);\n }\n else if (streamEventType === 'createViewLocal') {\n internalContext.setLocalRenderInfo(callId, localStreamKey, refreshedRenderInfo.stream, 'Rendered', renderer);\n context.setLocalVideoStreamRendererView(callId, localStreamKey, convertFromSDKToDeclarativeVideoStreamRendererView(view));\n _logStreamEvent(EventNames.VIEW_RENDER_SUCCEED, streamLogInfo);\n }\n return {\n renderer,\n view\n };\n });\n}\nfunction createViewUnparentedVideo(context, internalContext, stream, options) {\n return __awaiter(this, void 0, void 0, function* () {\n const renderInfo = internalContext.getUnparentedRenderInfo(stream);\n if (renderInfo && renderInfo.status === 'Rendered') {\n console.warn('Unparented LocalVideoStream is already rendered');\n return;\n }\n if (renderInfo && renderInfo.status === 'Rendering') {\n // Do not log to console here as this is a very common situation due to UI rerenders while\n // the video rendering is in progress.\n return;\n }\n if (renderInfo && renderInfo.status === 'Stopping') {\n console.warn('Unparented LocalVideoStream is in the middle of stopping');\n return;\n }\n const localVideoStream = new LocalVideoStream(stream.source);\n const renderer = new VideoStreamRenderer(localVideoStream);\n internalContext.setUnparentedRenderInfo(stream, localVideoStream, 'Rendering', undefined);\n let view;\n try {\n view = yield renderer.createView(options);\n }\n catch (e) {\n // Special case for unparented views. Since they are not tied to anything and created by us based on the calls to\n // this function we'll delete it to clean up the data since keeping it around doesn't help us and if developer wants\n // to create a new view they can check that the view is not rendered and call this function again.\n internalContext.deleteUnparentedRenderInfo(stream);\n throw e;\n }\n // Since render could take some time, we need to check if the stream is still valid and if we received a signal to\n // stop rendering.\n const refreshedRenderInfo = internalContext.getUnparentedRenderInfo(stream);\n if (!refreshedRenderInfo) {\n // Unparented stream's RenderInfo was deleted. Currently this shouldn't happen but if it does we'll just dispose the\n // renderer and clean up state. If developer wanted the stream they could call this function again and that should\n // generate new working state via this function.\n renderer.dispose();\n context.deleteDeviceManagerUnparentedView(stream);\n return;\n }\n if (refreshedRenderInfo.status === 'Stopping') {\n // Stop render was called on this stream after we had started rendering. We will dispose this view and do not\n // put the view into the state. Special case for unparented views, delete them from state when stopped to free up\n // the memory since we were the ones generating this and not tied to any Call state.\n internalContext.deleteUnparentedRenderInfo(stream);\n context.deleteDeviceManagerUnparentedView(stream);\n return;\n }\n // Else the stream still exists and status is not telling us to stop rendering. Complete the render process by\n // updating the state.\n internalContext.setUnparentedRenderInfo(stream, localVideoStream, 'Rendered', renderer);\n internalContext.subscribeToUnparentedViewVideoEffects(localVideoStream, context);\n context.setDeviceManagerUnparentedView(stream, convertFromSDKToDeclarativeVideoStreamRendererView(view));\n return {\n renderer,\n view\n };\n });\n}\nfunction disposeViewVideo(context, internalContext, callId, stream, participantId) {\n // we can only have 3 types of createView\n let streamEventType;\n // we will reuse these for local as well but we need to make sure the remote stream is passed in like before.\n if (participantId) {\n streamEventType = 'disposeViewRemote';\n }\n else if (callId) {\n streamEventType = 'disposeViewLocal';\n }\n else {\n // TODO update for when unparented view.\n streamEventType = 'disposeViewUnparented';\n }\n const streamType = stream.mediaStreamType;\n const localStreamKey = stream.mediaStreamType;\n const remoteStreamId = stream.id;\n // we want to check to see if there is a participantId this will tell us whether its a local stream or a remote one.\n const participantKey = streamEventType === 'disposeViewRemote' && participantId ? typeof participantId === 'string' ? participantId : toFlatCommunicationIdentifier(participantId) : undefined;\n const streamLogInfo = {\n callId,\n participantKey,\n streamId: remoteStreamId !== null && remoteStreamId !== void 0 ? remoteStreamId : localStreamKey,\n streamType\n };\n _logStreamEvent(EventNames.START_DISPOSE_STREAM, streamLogInfo);\n if (streamEventType === 'disposeViewRemote' && participantKey) {\n context.setRemoteVideoStreamRendererView(callId, participantKey, remoteStreamId, undefined);\n }\n const renderInfo = streamEventType === 'disposeViewRemote' && participantKey ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, remoteStreamId) : internalContext.getLocalRenderInfo(callId, localStreamKey);\n if (!renderInfo) {\n _logStreamEvent(EventNames.DISPOSE_INFO_NOT_FOUND, streamLogInfo);\n return;\n }\n // Nothing to dispose of or clean up -- we can safely exit early here.\n if (renderInfo.status === 'NotRendered') {\n _logStreamEvent(EventNames.STREAM_ALREADY_DISPOSED, streamLogInfo);\n return;\n }\n // Status is already marked as \"stopping\" so we can exit early here. This is because stopping only occurs\n // when the stream is being created in createView but hasn't been completed being created yet. The createView\n // method will see the \"stopping\" status and perform the cleanup\n if (renderInfo.status === 'Stopping') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n return;\n }\n // If the stream is in the middle of being rendered (i.e. has state \"Rendering\"), we need the status as\n // \"stopping\" without performing any cleanup. This will tell the `createView` method that it should stop\n // rendering and clean up the state once the view has finished being created.\n if (renderInfo.status === 'Rendering') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n streamEventType === 'disposeViewRemote' && participantKey ? internalContext.setRemoteRenderInfo(callId, participantKey, remoteStreamId, renderInfo.stream, 'Stopping', undefined) : internalContext.setLocalRenderInfo(callId, localStreamKey, renderInfo.stream, 'Stopping', renderInfo.renderer);\n return;\n }\n if (renderInfo.renderer) {\n _logStreamEvent(EventNames.DISPOSING_RENDERER, streamLogInfo);\n renderInfo.renderer.dispose();\n // Else the state must be in the \"Rendered\" state, so we can dispose the renderer and clean up the state.\n if (streamEventType === 'disposeViewRemote' && participantKey) {\n internalContext.setRemoteRenderInfo(callId, participantKey, remoteStreamId, renderInfo.stream, 'NotRendered', undefined);\n }\n else if (streamEventType === 'disposeViewLocal') {\n internalContext.setLocalRenderInfo(callId, localStreamKey, renderInfo.stream, 'NotRendered', undefined);\n context.setLocalVideoStreamRendererView(callId, localStreamKey, undefined);\n }\n }\n else {\n _logStreamEvent(EventNames.RENDERER_NOT_FOUND, streamLogInfo);\n }\n}\nfunction disposeViewUnparentedVideo(context, internalContext, stream) {\n const streamType = stream.mediaStreamType;\n const streamLogInfo = {\n streamType,\n streamEventType: 'disposeViewUnparented'\n };\n _logStreamEvent(EventNames.START_DISPOSE_STREAM, streamLogInfo);\n context.deleteDeviceManagerUnparentedView(stream);\n const renderInfo = internalContext.getUnparentedRenderInfo(stream);\n if (!renderInfo) {\n _logStreamEvent(EventNames.DISPOSE_INFO_NOT_FOUND, streamLogInfo);\n return;\n }\n if (renderInfo.status === 'Rendering') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setUnparentedRenderInfo(stream, renderInfo.stream, 'Stopping', undefined);\n }\n else {\n internalContext.deleteUnparentedRenderInfo(stream);\n }\n if (renderInfo.renderer) {\n _logStreamEvent(EventNames.DISPOSING_RENDERER, streamLogInfo);\n renderInfo.renderer.dispose();\n }\n else {\n _logStreamEvent(EventNames.RENDERER_NOT_FOUND, streamLogInfo);\n }\n}\n/**\n * @private\n */\nexport function createView(context, internalContext, callId, participantId, stream, options) {\n const streamType = stream.mediaStreamType;\n if (callId) {\n return createViewVideo(context, internalContext, callId, stream, participantId, options);\n }\n else if (!('id' in stream) && !callId) {\n // Render LocalVideoStream that is not part of a Call\n // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).\n // We do not have a startLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.\n return context.withAsyncErrorTeedToState(() => __awaiter(this, void 0, void 0, function* () { return yield createViewUnparentedVideo(context, internalContext, stream, options); }), 'Call.startVideo')();\n }\n else {\n _logStreamEvent(EventNames.CREATE_STREAM_INVALID_PARAMS, {\n streamType\n });\n return Promise.resolve(undefined);\n }\n}\n/**\n * @private\n */\nexport function disposeView(context, internalContext, callId, participantId, stream) {\n const streamType = stream.mediaStreamType;\n if (callId) {\n disposeViewVideo(context, internalContext, callId, stream, participantId);\n }\n else if (!('id' in stream) && !callId) {\n // Stop rendering LocalVideoStream that is not part of a Call\n // Because it is not part of the call we don't tee errors to state naturally (e.g. via a Call Client function such as startVideo).\n // We do not have a stopLocalPreviewVideo function, so as a workaround we ensure any errors are propagated here.\n context.withErrorTeedToState(() => disposeViewUnparentedVideo(context, internalContext, stream), 'Call.stopVideo')();\n }\n else {\n _logStreamEvent(EventNames.DISPOSE_STREAM_INVALID_PARAMS, {\n streamType\n });\n return;\n }\n}\n/**\n * @private\n * Only stops videos that are tied to a Call.\n */\nexport function disposeAllViewsFromCall(context, internalContext, callId) {\n const remoteStreams = internalContext.getRemoteRenderInfoForCall(callId);\n if (remoteStreams) {\n for (const [participantKey, participantStreams] of remoteStreams.entries()) {\n for (const [_, remoteStreamAndRenderer] of participantStreams.entries()) {\n // We don't want to accept SDK stream as parameter but we also don't cache the declarative stream so we have to\n // convert the SDK stream to declarative stream which is not pretty so this could use some further refactoring.\n disposeView(context, internalContext, callId, participantKey, convertSdkRemoteStreamToDeclarativeRemoteStream(remoteStreamAndRenderer.stream));\n }\n }\n }\n const localStreams = internalContext.getLocalRenderInfosForCall(callId);\n if (localStreams) {\n for (const localStreamAndRenderer of localStreams.values()) {\n if (localStreamAndRenderer && localStreamAndRenderer.renderer) {\n // We don't want to accept SDK stream as parameter but we also don't cache the declarative stream so we have to\n // convert the SDK stream to declarative stream which is not pretty so this could use some further refactoring.\n disposeView(context, internalContext, callId, undefined, convertSdkLocalStreamToDeclarativeLocalStream(localStreamAndRenderer.stream));\n }\n }\n }\n}\n/**\n * @private\n */\nexport function disposeAllViews(context, internalContext) {\n const callIds = internalContext.getCallIds();\n for (const callId of callIds) {\n disposeAllViewsFromCall(context, internalContext, callId);\n }\n}\n//# sourceMappingURL=StreamUtils.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\nimport { convertSdkRemoteStreamToDeclarativeRemoteStream } from './Converter';\nimport { RemoteVideoStreamSubscriber } from './RemoteVideoStreamSubscriber';\nimport { disposeView } from './StreamUtils';\n/**\n * Keeps track of the listeners assigned to a particular participant because when we get an event from SDK, it doesn't\n * tell us which participant it is for. If we keep track of this then we know which participant in the state that needs\n * an update and also which property of that participant. Also we can use this when unregistering to a participant.\n */\nexport class ParticipantSubscriber {\n constructor(callIdRef, participant, context, internalContext) {\n this.subscribe = () => {\n this._participant.on('stateChanged', this.stateChanged);\n this._participant.on('isMutedChanged', this.isMutedChanged);\n this._participant.on('displayNameChanged', this.displayNameChanged);\n this._participant.on('isSpeakingChanged', this.isSpeakingChanged);\n this._participant.on('videoStreamsUpdated', this.videoStreamsUpdated);\n this._participant.on('roleChanged', this.roleChanged);\n if (this._participant.videoStreams.length > 0) {\n for (const stream of this._participant.videoStreams) {\n this._internalContext.setRemoteRenderInfo(this._callIdRef.callId, this._participantKey, stream.id, stream, 'NotRendered', undefined);\n this.addRemoteVideoStreamSubscriber(stream);\n }\n this._context.setRemoteVideoStreams(this._callIdRef.callId, this._participantKey, this._participant.videoStreams.map(convertSdkRemoteStreamToDeclarativeRemoteStream), []);\n }\n };\n this.unsubscribe = () => {\n this._participant.off('stateChanged', this.stateChanged);\n this._participant.off('isMutedChanged', this.isMutedChanged);\n this._participant.off('displayNameChanged', this.displayNameChanged);\n this._participant.off('isSpeakingChanged', this.isSpeakingChanged);\n this._participant.off('videoStreamsUpdated', this.videoStreamsUpdated);\n this._participant.off('roleChanged', this.roleChanged);\n // If unsubscribing it means the participant left the call. If they have any rendering streams we should stop them\n // as it doesn't make sense to render for an ended participant.\n if (this._participant.videoStreams.length > 0) {\n for (const stream of this._participant.videoStreams) {\n disposeView(this._context, this._internalContext, this._callIdRef.callId, this._participantKey, convertSdkRemoteStreamToDeclarativeRemoteStream(stream));\n this._internalContext.deleteRemoteRenderInfo(this._callIdRef.callId, this._participantKey, stream.id);\n }\n }\n };\n this.addRemoteVideoStreamSubscriber = (remoteVideoStream) => {\n var _a;\n (_a = this._remoteVideoStreamSubscribers.get(remoteVideoStream.id)) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n this._remoteVideoStreamSubscribers.set(remoteVideoStream.id, new RemoteVideoStreamSubscriber(this._callIdRef, this._participantKey, remoteVideoStream, this._context));\n };\n this.stateChanged = () => {\n this._context.setParticipantState(this._callIdRef.callId, this._participantKey, this._participant.state);\n };\n this.isMutedChanged = () => {\n this._context.setParticipantIsMuted(this._callIdRef.callId, this._participantKey, this._participant.isMuted);\n };\n this.roleChanged = () => {\n this._context.setParticipantRole(this._callIdRef.callId, this._participantKey, this._participant.role);\n };\n this.displayNameChanged = () => {\n this._context.setParticipantDisplayName(this._callIdRef.callId, this._participantKey, this._participant.displayName || '');\n };\n this.isSpeakingChanged = () => {\n this._context.setParticipantIsSpeaking(this._callIdRef.callId, this._participantKey, this._participant.isSpeaking);\n };\n this.videoStreamsUpdated = (event) => {\n var _a;\n for (const stream of event.removed) {\n (_a = this._remoteVideoStreamSubscribers.get(stream.id)) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n disposeView(this._context, this._internalContext, this._callIdRef.callId, this._participantKey, convertSdkRemoteStreamToDeclarativeRemoteStream(stream));\n this._internalContext.deleteRemoteRenderInfo(this._callIdRef.callId, this._participantKey, stream.id);\n }\n for (const stream of event.added) {\n this._internalContext.setRemoteRenderInfo(this._callIdRef.callId, this._participantKey, stream.id, stream, 'NotRendered', undefined);\n this.addRemoteVideoStreamSubscriber(stream);\n }\n this._context.setRemoteVideoStreams(this._callIdRef.callId, this._participantKey, event.added.map(convertSdkRemoteStreamToDeclarativeRemoteStream), event.removed.map((stream) => stream.id));\n };\n this._callIdRef = callIdRef;\n this._participant = participant;\n this._context = context;\n this._internalContext = internalContext;\n this._participantKey = toFlatCommunicationIdentifier(this._participant.identifier);\n this._remoteVideoStreamSubscribers = new Map();\n this.subscribe();\n }\n}\n//# sourceMappingURL=ParticipantSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport class RecordingSubscriber {\n constructor(callIdRef, context, recording) {\n this.subscribe = () => {\n this._recording.on('isRecordingActiveChanged', this.isAvailableChanged);\n };\n this.unsubscribe = () => {\n this._recording.off('isRecordingActiveChanged', this.isAvailableChanged);\n };\n this.isAvailableChanged = () => {\n this._context.setCallRecordingActive(this._callIdRef.callId, this._recording.isRecordingActive);\n };\n this._callIdRef = callIdRef;\n this._context = context;\n this._recording = recording;\n // If recording as already started when we joined the call, make sure it is reflected in state as there may not\n // be an event for it.\n if (this._recording.isRecordingActive) {\n this._context.setCallRecordingActive(this._callIdRef.callId, this._recording.isRecordingActive);\n }\n this.subscribe();\n }\n}\n//# sourceMappingURL=RecordingSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { Features } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\n/**\n * @private\n */\nexport class PPTLiveSubscriber {\n constructor(callIdRef, context, call) {\n this.subscribe = () => {\n this._pptLive.on('isActiveChanged', this.isAvailableChanged);\n };\n this.unsubscribe = () => {\n this._pptLive.off('isActiveChanged', this.isAvailableChanged);\n };\n this.isAvailableChanged = () => {\n this._context.setCallPPTLiveActive(this._callIdRef.callId, this._pptLive.isActive);\n this.checkAndUpdatePPTLiveParticipant();\n };\n this.checkAndUpdatePPTLiveParticipant = () => __awaiter(this, void 0, void 0, function* () {\n if (!this._pptLive.activePresenterId) {\n return;\n }\n if (this._pptLive.isActive) {\n // TODO: need to refactor if Web Calling SDK has this logic ready\n if (this._call.isScreenSharingOn) {\n yield this._call.stopScreenSharing();\n }\n this._context.setCallParticipantPPTLive(this._callIdRef.callId, toFlatCommunicationIdentifier(this._pptLive.activePresenterId), this._pptLive.target);\n }\n else {\n this._context.setCallParticipantPPTLive(this._callIdRef.callId, toFlatCommunicationIdentifier(this._pptLive.activePresenterId), undefined);\n }\n });\n this._callIdRef = callIdRef;\n this._context = context;\n this._pptLive = call.feature(Features.PPTLive);\n this._call = call;\n this.subscribe();\n }\n}\n//# sourceMappingURL=PPTLiveSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport class TranscriptionSubscriber {\n constructor(callIdRef, context, transcription) {\n this.subscribe = () => {\n this._transcription.on('isTranscriptionActiveChanged', this.isTranscriptionActiveChanged);\n };\n this.unsubscribe = () => {\n this._transcription.off('isTranscriptionActiveChanged', this.isTranscriptionActiveChanged);\n };\n this.isTranscriptionActiveChanged = () => {\n this._context.setCallTranscriptionActive(this._callIdRef.callId, this._transcription.isTranscriptionActive);\n };\n this._callIdRef = callIdRef;\n this._context = context;\n this._transcription = transcription;\n // If transcription as already started when we joined the call, make sure it is reflected in state as there may not\n // be an event for it.\n if (this._transcription.isTranscriptionActive) {\n this._context.setCallTranscriptionActive(this._callIdRef.callId, this._transcription.isTranscriptionActive);\n }\n this.subscribe();\n }\n}\n//# sourceMappingURL=TranscriptionSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport class UserFacingDiagnosticsSubscriber {\n constructor(callIdRef, context, diagnostics) {\n this.unsubscribe = () => {\n this._diagnostics.network.off('diagnosticChanged', this.networkDiagnosticsChanged.bind(this));\n this._diagnostics.media.off('diagnosticChanged', this.mediaDiagnosticsChanged.bind(this));\n };\n this._callIdRef = callIdRef;\n this._context = context;\n this._diagnostics = diagnostics;\n this.setInitialDiagnostics();\n this.subscribe();\n }\n setInitialDiagnostics() {\n const network = this._diagnostics.network.getLatest();\n const media = this._diagnostics.media.getLatest();\n if (Object.entries(network).length === 0 && Object.entries(media).length === 0) {\n return;\n }\n this._context.modifyState(state => {\n const call = state.calls[this._callIdRef.callId];\n if (call === undefined) {\n return;\n }\n call.diagnostics = {\n network: {\n latest: network\n },\n media: {\n latest: media\n }\n };\n });\n }\n subscribe() {\n this._diagnostics.network.on('diagnosticChanged', this.networkDiagnosticsChanged.bind(this));\n this._diagnostics.media.on('diagnosticChanged', this.mediaDiagnosticsChanged.bind(this));\n }\n networkDiagnosticsChanged(args) {\n this._context.modifyState(state => {\n var _a;\n const call = state.calls[this._callIdRef.callId];\n if (call === undefined) {\n return;\n }\n const network = (_a = call.diagnostics) === null || _a === void 0 ? void 0 : _a.network.latest;\n if (network) {\n network[args.diagnostic] = latestFromEvent(args);\n }\n });\n }\n mediaDiagnosticsChanged(args) {\n this._context.modifyState(state => {\n var _a;\n const call = state.calls[this._callIdRef.callId];\n if (call === undefined) {\n return;\n }\n const media = (_a = call.diagnostics) === null || _a === void 0 ? void 0 : _a.media.latest;\n if (media) {\n media[args.diagnostic] = latestFromEvent(args);\n }\n });\n }\n}\nconst latestFromEvent = (args) => ({\n value: args.value,\n valueType: args.valueType\n});\n//# sourceMappingURL=UserFacingDiagnosticsSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\n/**\n * @private\n */\nexport class RaiseHandSubscriber {\n constructor(callIdRef, context, raiseHand) {\n this.subscribe = () => {\n this._raiseHand.on('raisedHandEvent', this.raisedHand);\n this._raiseHand.on('loweredHandEvent', this.loweredHand);\n };\n this.unsubscribe = () => {\n this._raiseHand.off('raisedHandEvent', this.raisedHand);\n this._raiseHand.off('loweredHandEvent', this.loweredHand);\n };\n this.raisedHand = () => {\n this._context.setCallRaisedHands(this._callIdRef.callId, this._raiseHand.getRaisedHands());\n for (const raisedHand of this._raiseHand.getRaisedHands()) {\n this._context.setParticipantIsRaisedHand(this._callIdRef.callId, toFlatCommunicationIdentifier(raisedHand.identifier), raisedHand);\n }\n };\n this.loweredHand = (event) => {\n this.raisedHand();\n this._context.setParticipantIsRaisedHand(this._callIdRef.callId, toFlatCommunicationIdentifier(event.identifier), undefined);\n };\n this._callIdRef = callIdRef;\n this._context = context;\n this._raiseHand = raiseHand;\n this.subscribe();\n }\n}\n//# sourceMappingURL=RaiseHandSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * Subscribes to a Optimal Video Count Feature events and updates the call context appropriately.\n * @private\n */\nexport class OptimalVideoCountSubscriber {\n constructor(args) {\n this.subscribe = () => {\n this._localOptimalVideoCountFeature.on('optimalVideoCountChanged', this.optimalVideoCountChanged);\n };\n this.unsubscribe = () => {\n this._localOptimalVideoCountFeature.off('optimalVideoCountChanged', this.optimalVideoCountChanged);\n };\n this.optimalVideoCountChanged = () => {\n this.updateOptimalVideoCountState({\n maxRemoteVideoStreams: this._localOptimalVideoCountFeature.optimalVideoCount\n });\n };\n this.updateOptimalVideoCountState = (newOptimalVideoCountState) => {\n this._context.setOptimalVideoCount(this._callIdRef.callId, newOptimalVideoCountState.maxRemoteVideoStreams);\n };\n this._callIdRef = args.callIdRef;\n this._context = args.context;\n this._localOptimalVideoCountFeature = args.localOptimalVideoCountFeature;\n this.subscribe();\n }\n}\n// Exporting empty object for stable\nexport default {};\n//# sourceMappingURL=OptimalVideoCountSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport class CapabilitiesSubscriber {\n constructor(callIdRef, context, capabilities) {\n this.subscribe = () => {\n this._capabilitiesFeature.on('capabilitiesChanged', this.capabilitiesChanged);\n };\n this.unsubscribe = () => {\n this._capabilitiesFeature.off('capabilitiesChanged', this.capabilitiesChanged);\n };\n this.capabilitiesChanged = (data) => {\n this._context.setCapabilities(this._callIdRef.callId, this._capabilitiesFeature.capabilities, data);\n if (data.oldValue.viewAttendeeNames !== data.newValue.viewAttendeeNames) {\n this._context.setHideAttendeeNames(this._callIdRef.callId, data);\n }\n };\n this._callIdRef = callIdRef;\n this._context = context;\n this._capabilitiesFeature = capabilities;\n this.subscribe();\n }\n}\n//# sourceMappingURL=CapabilitiesSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport class ReactionSubscriber {\n constructor(callIdRef, context, reaction) {\n this.subscribe = () => {\n this._reaction.on('reaction', this.onReactionEvent);\n };\n this.unsubscribe = () => {\n this._reaction.off('reaction', this.onReactionEvent);\n };\n this.onReactionEvent = (event) => {\n this._context.setReceivedReactionFromParticipant(this._callIdRef.callId, event.identifier, event.reactionMessage);\n };\n this._callIdRef = callIdRef;\n this._context = context;\n this._reaction = reaction;\n this.subscribe();\n }\n}\n//# sourceMappingURL=ReactionSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @private\n */\nexport class SpotlightSubscriber {\n constructor(callIdRef, context, spotlight) {\n this.subscribe = () => {\n this._spotlightFeature.on('spotlightChanged', this.spotlightChanged);\n };\n this.unsubscribe = () => {\n this._spotlightFeature.off('spotlightChanged', this.spotlightChanged);\n };\n this.spotlightChanged = (args) => {\n this._context.setSpotlight(this._callIdRef.callId, this._spotlightFeature.getSpotlightedParticipants(), this._spotlightFeature.maxParticipantsToSpotlight);\n for (const addedParticipant of args.added) {\n this._context.setParticipantSpotlighted(this._callIdRef.callId, addedParticipant);\n }\n for (const removedParticipant of args.removed) {\n this._context.setParticipantNotSpotlighted(this._callIdRef.callId, removedParticipant);\n }\n };\n this._callIdRef = callIdRef;\n this._context = context;\n this._spotlightFeature = spotlight;\n this.subscribe();\n }\n}\n//# sourceMappingURL=SpotlightSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { Features } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\nimport { CaptionsFeatureSubscriber } from './CaptionsSubscriber';\nimport { convertSdkLocalStreamToDeclarativeLocalStream, convertSdkParticipantToDeclarativeParticipant } from './Converter';\nimport { LocalVideoStreamVideoEffectsSubscriber } from './LocalVideoStreamVideoEffectsSubscriber';\nimport { ParticipantSubscriber } from './ParticipantSubscriber';\nimport { RecordingSubscriber } from './RecordingSubscriber';\nimport { PPTLiveSubscriber } from './PPTLiveSubscriber';\nimport { disposeView } from './StreamUtils';\nimport { TranscriptionSubscriber } from './TranscriptionSubscriber';\nimport { UserFacingDiagnosticsSubscriber } from './UserFacingDiagnosticsSubscriber';\nimport { RaiseHandSubscriber } from './RaiseHandSubscriber';\nimport { OptimalVideoCountSubscriber } from './OptimalVideoCountSubscriber';\nimport { CapabilitiesSubscriber } from './CapabilitiesSubscriber';\nimport { ReactionSubscriber } from './ReactionSubscriber';\nimport { SpotlightSubscriber } from './SpotlightSubscriber';\nimport { _isTeamsMeeting } from './TypeGuards';\n/**\n * Keeps track of the listeners assigned to a particular call because when we get an event from SDK, it doesn't tell us\n * which call it is for. If we keep track of this then we know which call in the state that needs an update and also\n * which property of that call. Also we can use this when unregistering to a call.\n */\nexport class CallSubscriber {\n constructor(call, context, internalContext) {\n this._safeSubscribeInitCaptionSubscriber = () => {\n this._safeSubscribe(this.initCaptionSubscriber);\n };\n this._safeSubscribeInitTeamsMeetingConference = () => {\n this._safeSubscribe(this.initTeamsMeetingConference);\n };\n this.subscribe = () => {\n this._call.on('stateChanged', this.stateChanged);\n this._call.on('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n this._call.on('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n this._call.on('idChanged', this.idChanged);\n this._call.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.on('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.on('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.on('isMutedChanged', this.isMuteChanged);\n this._call.on('roleChanged', this.callRoleChangedHandler);\n this._call.feature(Features.DominantSpeakers).on('dominantSpeakersChanged', this.dominantSpeakersChanged);\n this._call.on('mutedByOthers', this.mutedByOthersHandler);\n for (const localVideoStream of this._call.localVideoStreams) {\n this._internalContext.setLocalRenderInfo(this._callIdRef.callId, localVideoStream.mediaStreamType, localVideoStream, 'NotRendered', undefined);\n }\n if (this._call.remoteParticipants.length > 0) {\n this._call.remoteParticipants.forEach((participant) => {\n this.addParticipantListener(participant);\n });\n this._context.setCallRemoteParticipants(this._callIdRef.callId, this._call.remoteParticipants.map(convertSdkParticipantToDeclarativeParticipant), []);\n }\n };\n this.unsubscribe = () => {\n var _a, _b, _c;\n this._call.off('stateChanged', this.stateChanged);\n this._call.off('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n this._call.off('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n this._call.off('idChanged', this.idChanged);\n this._call.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.off('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.off('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.off('isMutedChanged', this.isMuteChanged);\n this._call.off('roleChanged', this.callRoleChangedHandler);\n this._call.off('mutedByOthers', this.mutedByOthersHandler);\n this._participantSubscribers.forEach((participantSubscriber) => {\n participantSubscriber.unsubscribe();\n });\n this._participantSubscribers.clear();\n // If we are unsubscribing that means we no longer want to display any video for this call (callEnded or callAgent\n // disposed) and we should not be updating it any more. So if video is rendering we stop rendering.\n for (const localVideoStream of this._call.localVideoStreams) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n disposeView(this._context, this._internalContext, this._callIdRef.callId, undefined, convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream));\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n this._diagnosticsSubscriber.unsubscribe();\n this._recordingSubscriber.unsubscribe();\n this._transcriptionSubscriber.unsubscribe();\n this._optimalVideoCountSubscriber.unsubscribe();\n this._pptLiveSubscriber.unsubscribe();\n (_a = this._CaptionsFeatureSubscriber) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n (_b = this._raiseHandSubscriber) === null || _b === void 0 ? void 0 : _b.unsubscribe();\n this._capabilitiesSubscriber.unsubscribe();\n (_c = this._reactionSubscriber) === null || _c === void 0 ? void 0 : _c.unsubscribe();\n this._spotlightSubscriber.unsubscribe();\n };\n this.stateChanged = () => {\n this._context.setCallState(this._callIdRef.callId, this._call.state);\n };\n this.initCaptionSubscriber = () => {\n // subscribe to captions here so that we don't call captions when call is not initialized\n if (this._call.state === 'Connected' && !this._CaptionsFeatureSubscriber) {\n this._CaptionsFeatureSubscriber = new CaptionsFeatureSubscriber(this._callIdRef, this._context, this._call.feature(Features.Captions));\n this._call.off('stateChanged', this._safeSubscribeInitCaptionSubscriber);\n }\n };\n this.initTeamsMeetingConference = () => {\n if (this._call.state === 'Connected' && _isTeamsMeeting(this._call)) {\n this._call.feature(Features.TeamsMeetingAudioConferencing).getTeamsMeetingAudioConferencingDetails().then(teamsMeetingConferenceDetails => {\n this._context.setTeamsMeetingConference(this._callIdRef.callId, teamsMeetingConferenceDetails);\n });\n this._call.off('stateChanged', this._safeSubscribeInitTeamsMeetingConference);\n }\n };\n this.idChanged = () => {\n this._internalContext.setCallId(this._call.id, this._callIdRef.callId);\n this._context.setCallId(this._call.id, this._callIdRef.callId);\n this._callIdRef.callId = this._call.id;\n };\n this.isScreenSharingOnChanged = () => {\n this._context.setCallIsScreenSharingOn(this._callIdRef.callId, this._call.isScreenSharingOn);\n };\n this.isMuteChanged = () => {\n this._context.setCallIsMicrophoneMuted(this._callIdRef.callId, this._call.isMuted);\n };\n this.callRoleChangedHandler = () => {\n this._context.setRole(this._callIdRef.callId, this._call.role);\n };\n // TODO: Tee to notification state once available\n this.mutedByOthersHandler = () => {\n this._context.teeErrorToState({\n name: 'mutedByOthers',\n message: 'Muted by another participant'\n }, 'Call.mutedByOthers');\n };\n this.remoteParticipantsUpdated = (event) => {\n event.added.forEach((participant) => {\n this.addParticipantListener(participant);\n });\n event.removed.forEach((participant) => {\n this.removeParticipantListener(participant);\n });\n // Remove any added participants from remoteParticipantsEnded if they are there and add any removed participants to\n // remoteParticipantsEnded.\n this._context.setCallRemoteParticipantsEnded(this._callIdRef.callId, event.removed.map(convertSdkParticipantToDeclarativeParticipant), event.added.map((participant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n }));\n // Add added participants to remoteParticipants and remove removed participants from remoteParticipants.\n this._context.setCallRemoteParticipants(this._callIdRef.callId, event.added.map(convertSdkParticipantToDeclarativeParticipant), event.removed.map((participant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n }));\n };\n this.localVideoStreamsUpdated = (event) => {\n var _a, _b;\n for (const localVideoStream of event.added) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n // IMPORTANT: The internalContext should be set before context. This is done to ensure that the internal context\n // has the required data when component re-renders due to external state changes.\n this._internalContext.setLocalRenderInfo(this._callIdRef.callId, mediaStreamType, localVideoStream, 'NotRendered', undefined);\n // Subscribe to video effect changes\n (_a = this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n this._localVideoStreamVideoEffectsSubscribers.set(mediaStreamType, new LocalVideoStreamVideoEffectsSubscriber({\n parent: this._callIdRef,\n context: this._context,\n localVideoStream: localVideoStream,\n localVideoStreamEffectsAPI: localVideoStream.feature(Features.VideoEffects)\n }));\n }\n for (const localVideoStream of event.removed) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n (_b = this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)) === null || _b === void 0 ? void 0 : _b.unsubscribe();\n disposeView(this._context, this._internalContext, this._callIdRef.callId, undefined, convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream));\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n this._context.setCallLocalVideoStream(this._callIdRef.callId, event.added.map(convertSdkLocalStreamToDeclarativeLocalStream), event.removed.map(convertSdkLocalStreamToDeclarativeLocalStream));\n };\n this.dominantSpeakersChanged = () => {\n const dominantSpeakers = this._call.feature(Features.DominantSpeakers).dominantSpeakers;\n this._context.setCallDominantSpeakers(this._callIdRef.callId, dominantSpeakers);\n };\n this._call = call;\n this._callIdRef = {\n callId: call.id\n };\n this._context = context;\n this._internalContext = internalContext;\n this._diagnosticsSubscriber = new UserFacingDiagnosticsSubscriber(this._callIdRef, this._context, this._call.feature(Features.UserFacingDiagnostics));\n this._participantSubscribers = new Map();\n this._recordingSubscriber = new RecordingSubscriber(this._callIdRef, this._context, this._call.feature(Features.Recording));\n this._pptLiveSubscriber = new PPTLiveSubscriber(this._callIdRef, this._context, this._call);\n this._transcriptionSubscriber = new TranscriptionSubscriber(this._callIdRef, this._context, this._call.feature(Features.Transcription));\n this._raiseHandSubscriber = new RaiseHandSubscriber(this._callIdRef, this._context, this._call.feature(Features.RaiseHand));\n this._reactionSubscriber = new ReactionSubscriber(this._callIdRef, this._context, this._call.feature(Features.Reaction));\n this._optimalVideoCountSubscriber = new OptimalVideoCountSubscriber({\n callIdRef: this._callIdRef,\n context: this._context,\n localOptimalVideoCountFeature: this._call.feature(Features.OptimalVideoCount)\n });\n this._localVideoStreamVideoEffectsSubscribers = new Map();\n this._capabilitiesSubscriber = new CapabilitiesSubscriber(this._callIdRef, this._context, this._call.feature(Features.Capabilities));\n this._spotlightSubscriber = new SpotlightSubscriber(this._callIdRef, this._context, this._call.feature(Features.Spotlight));\n this.subscribe();\n }\n // This is a helper function to safely call subscriber functions. This is needed in order to prevent events\n // with the same event type from failing to fire due to a subscriber throwing an error upon subscription.\n // Wrap your listeners with this helper function if your listener can fail due to initialization or fail\n // during a function call. This will prevent other events using the same event type from failing to fire.\n _safeSubscribe(subscriber) {\n try {\n subscriber();\n }\n catch (e) {\n this._context.teeErrorToState(e, 'Call.on');\n }\n }\n addParticipantListener(participant) {\n var _a;\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n (_a = this._participantSubscribers.get(participantKey)) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n this._participantSubscribers.set(participantKey, new ParticipantSubscriber(this._callIdRef, participant, this._context, this._internalContext));\n }\n removeParticipantListener(participant) {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n const participantSubscriber = this._participantSubscribers.get(participantKey);\n if (participantSubscriber) {\n participantSubscriber.unsubscribe();\n this._participantSubscribers.delete(participantKey);\n }\n }\n}\n//# sourceMappingURL=CallSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * Keeps track of the listeners assigned to a particular incoming call because when we get an event from SDK, it doesn't\n * tell us which incoming call it is for. If we keep track of this then we know which incoming call in the state that\n * needs an update and also which property of that incoming call. Also we can use this when unregistering to a incoming\n * call.\n */\nexport class IncomingCallSubscriber {\n constructor(incomingCall, \n // setIncomingCallEnded callback is used so parent can clean up IncomingCallSubscriber.\n setIncomingCallEnded) {\n this.subscribe = () => {\n this._incomingCall.on('callEnded', this.callEnded);\n };\n this.unsubscribe = () => {\n this._incomingCall.off('callEnded', this.callEnded);\n };\n this.callEnded = (event) => {\n this._setIncomingCallEnded(this._incomingCall.id, event.callEndReason);\n };\n this._incomingCall = incomingCall;\n this._setIncomingCallEnded = setIncomingCallEnded;\n this.subscribe();\n }\n}\n//# sourceMappingURL=IncomingCallSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n/**\n * @private\n */\nexport class ProxyIncomingCall {\n constructor(context) {\n this._context = context;\n }\n get(target, prop) {\n switch (prop) {\n case 'accept':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.accept(...args);\n });\n }, 'IncomingCall.accept');\n }\n case 'reject':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.reject(...args);\n });\n }, 'IncomingCall.reject');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n/**\n * Creates a declarative Incoming Call by proxying IncomingCall using ProxyIncomingCall.\n * @param incomingCall - IncomingCall from SDK\n * @returns proxied IncomingCall\n */\nexport const incomingCallDeclaratify = (incomingCall, context) => {\n const proxyIncomingCall = new ProxyIncomingCall(context);\n return new Proxy(incomingCall, proxyIncomingCall);\n};\n//# sourceMappingURL=IncomingCallDeclarative.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n/**\n * @private\n */\nexport class ProxyTeamsIncomingCall {\n constructor(context) {\n this._context = context;\n }\n get(target, prop) {\n switch (prop) {\n case 'accept':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.accept(...args);\n });\n }, 'IncomingCall.accept');\n }\n case 'reject':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.reject(...args);\n });\n }, 'IncomingCall.reject');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n/**\n * Creates a declarative TeamsIncomingCall by proxying TeamsIncomingCall using ProxyIncomingCall.\n * @param incomingCall - TeamsIncomingCall from SDK\n * @returns proxied TeamsIncomingCall\n */\nexport const teamsIncomingCallDeclaratify = (incomingCall, context) => {\n const proxyIncomingCall = new ProxyTeamsIncomingCall(context);\n return new Proxy(incomingCall, proxyIncomingCall);\n};\n//# sourceMappingURL=TeamsIncomingCallDeclarative.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { CallSubscriber } from './CallSubscriber';\nimport { convertSdkCallToDeclarativeCall, convertSdkIncomingCallToDeclarativeIncomingCall } from './Converter';\nimport { IncomingCallSubscriber } from './IncomingCallSubscriber';\nimport { disposeAllViews, disposeAllViewsFromCall } from './StreamUtils';\nimport { _isTeamsIncomingCall } from './TypeGuards';\nimport { incomingCallDeclaratify } from './IncomingCallDeclarative';\nimport { teamsIncomingCallDeclaratify } from './TeamsIncomingCallDeclarative';\n/**\n * ProxyCallAgent proxies CallAgent and saves any returned state in the given context. It will subscribe to all state\n * updates in the CallAgent and in the contained Calls and RemoteParticipants. When dispose is called it will\n * unsubscribe from all state updates.\n */\nexport class ProxyCallAgentCommon {\n constructor(context, internalContext) {\n // Unsubscribe is called when CallAgent is disposed. This should mean no more updating of existing call but we don't\n // remove any existing state.\n this.unregisterSubscriber = () => {\n for (const [_, callSubscriber] of this._callSubscribers.entries()) {\n callSubscriber.unsubscribe();\n }\n this._callSubscribers.clear();\n for (const [_, incomingCallSubscriber] of this._incomingCallSubscribers.entries()) {\n incomingCallSubscriber.unsubscribe();\n }\n this._incomingCallSubscribers.clear();\n this._incomingCalls.clear();\n for (const [_, declarativeCall] of this._declarativeCalls.entries()) {\n declarativeCall.unsubscribe();\n }\n this._declarativeCalls.clear();\n };\n this.callsUpdated = (event) => {\n const addedStatefulCall = [];\n for (const call of event.added) {\n const statefulCall = this.addCall(call);\n addedStatefulCall.push(statefulCall);\n }\n const removedStatefulCall = [];\n for (const call of event.removed) {\n disposeAllViewsFromCall(this._context, this._internalContext, call.id);\n const callSubscriber = this._callSubscribers.get(call);\n if (callSubscriber) {\n callSubscriber.unsubscribe();\n this._callSubscribers.delete(call);\n }\n this._context.setCallEnded(call.id, call.callEndReason);\n const declarativeCall = this._declarativeCalls.get(call);\n if (declarativeCall) {\n declarativeCall.unsubscribe();\n removedStatefulCall.push(declarativeCall);\n this._declarativeCalls.delete(call);\n }\n else {\n removedStatefulCall.push(this.callDeclaratify(call, this._context));\n }\n }\n for (const externalCallsUpdatedListener of this._externalCallsUpdatedListeners) {\n externalCallsUpdatedListener({\n added: addedStatefulCall,\n removed: removedStatefulCall\n });\n }\n };\n this.setIncomingCallEnded = (incomingCallId, callEndReason) => {\n const incomingCallSubscriber = this._incomingCallSubscribers.get(incomingCallId);\n if (incomingCallSubscriber) {\n incomingCallSubscriber.unsubscribe();\n this._incomingCallSubscribers.delete(incomingCallId);\n }\n this._incomingCalls.delete(incomingCallId);\n this._context.setIncomingCallEnded(incomingCallId, callEndReason);\n };\n this.incomingCall = ({ incomingCall }) => {\n // Make sure to not subscribe to the incoming call if we are already subscribed to it.\n if (!this._incomingCallSubscribers.has(incomingCall.id)) {\n this._incomingCallSubscribers.set(incomingCall.id, new IncomingCallSubscriber(incomingCall, this.setIncomingCallEnded));\n }\n if (_isTeamsIncomingCall(incomingCall)) {\n this._incomingCalls.set(incomingCall.id, teamsIncomingCallDeclaratify(incomingCall, this._context));\n }\n else {\n this._incomingCalls.set(incomingCall.id, incomingCallDeclaratify(incomingCall, this._context));\n }\n this._context.setIncomingCall(convertSdkIncomingCallToDeclarativeIncomingCall(incomingCall));\n };\n this.addCall = (call) => {\n var _a;\n (_a = this._callSubscribers.get(call)) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n // For API extentions we need to have the call in the state when we are subscribing as we may want to update the\n // state during the subscription process in the subscriber so we add the call to state before subscribing.\n this._context.setCall(convertSdkCallToDeclarativeCall(call));\n this._callSubscribers.set(call, new CallSubscriber(call, this._context, this._internalContext));\n return this.getOrCreateDeclarativeCall(call);\n };\n this.getOrCreateDeclarativeCall = (call) => {\n const declarativeCall = this._declarativeCalls.get(call);\n if (declarativeCall) {\n return declarativeCall;\n }\n const newDeclarativeCall = this.callDeclaratify(call, this._context);\n this._declarativeCalls.set(call, newDeclarativeCall);\n return newDeclarativeCall;\n };\n this._context = context;\n this._internalContext = internalContext;\n this._callSubscribers = new Map();\n this._incomingCallSubscribers = new Map();\n this._incomingCalls = new Map();\n this._declarativeCalls = new Map();\n this._externalCallsUpdatedListeners = new Set();\n }\n // We can't directly override get function because it is proxied,\n // Add a getCommon function and call it in child class\n getCommon(target, prop) {\n switch (prop) {\n case 'startCall':\n {\n return this._context.withErrorTeedToState((...args) => {\n const call = this.startCall(target, args);\n this.addCall(call);\n return this.getOrCreateDeclarativeCall(call);\n }, 'CallAgent.startCall');\n }\n case 'join':\n {\n return this._context.withErrorTeedToState((...args) => {\n const call = this.joinCall(target, args);\n this.addCall(call);\n return this.getOrCreateDeclarativeCall(call);\n }, 'CallAgent.join');\n }\n case 'calls':\n {\n return Array.from(this._declarativeCalls.values());\n }\n case 'on':\n {\n return (...args) => {\n // typescript is not smart enough to handle multiple overloads and pull the correct type here so force casting args\n const event = args[0];\n const isCallsUpdated = event === 'callsUpdated';\n if (isCallsUpdated) {\n const listener = args[1];\n this._externalCallsUpdatedListeners.add(listener);\n }\n else {\n this.agentSubscribe(target, args);\n }\n };\n }\n case 'off':\n {\n return (...args) => {\n // typescript is not smart enough to handle multiple overloads and pull the correct type here so force casting args\n const event = args[0];\n const isCallsUpdated = event === 'callsUpdated';\n if (isCallsUpdated) {\n const listener = args[1];\n this._externalCallsUpdatedListeners.delete(listener);\n }\n else {\n this.agentUnsubscribe(target, args);\n }\n };\n }\n case 'dispose':\n {\n // Wrapping CallAgent.dispose in a callback type (): Promise to accomodate the change of CallAgent.dispose\n // in calling beta version 1.8.0-beta.1 from callback type (): Promise to (): void\n const callAgentDisposeAsyncCallbackWrapper = () => __awaiter(this, void 0, void 0, function* () {\n yield target.dispose();\n return Promise.resolve();\n });\n return () => {\n return callAgentDisposeAsyncCallbackWrapper().then(() => {\n this.unsubscribe();\n });\n };\n }\n /**\n * This attribute is a special case and doesn't exist on the CallAgent interface.\n * We need this to be able to return a declarative incoming call object using the call agent.\n * In a standard headless SDK usage, the right way to get an incoming call is to use the `incomingCall` event.\n * However, using the declarative layer, the ideal usage would be to:\n * 1. subscribe to the `onStateChange` event\n * 2. Get the incoming call from the new state and it's ID\n * 3. Use `callAgent.incomingCalls` and filter an incoming call ID to get a declarative incoming call object\n */\n case 'incomingCalls':\n {\n return Array.from(this._incomingCalls.values());\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n/**\n * @private\n */\nexport const clearCallRelatedState = (context, internalContext) => {\n // Make sure there are no existing call data if creating a new CallAgentDeclarative (if creating a new\n // CallAgentDeclarative after disposing of the hold one will mean context have old call state). TODO: should we stop\n // rendering when the previous callAgent is disposed?\n disposeAllViews(context, internalContext);\n context.clearCallRelatedState();\n internalContext.clearCallRelatedState();\n};\n//# sourceMappingURL=CallAgentDeclarativeCommon.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { Features } from '@azure/communication-calling';\n/**\n * @private\n */\nexport class ProxyCallCommon {\n constructor(context) {\n this._context = context;\n }\n unsubscribe() {\n /** No subscriptions yet. But there will be one for transfer feature soon. */\n }\n getContext() {\n return this._context;\n }\n get(target, prop) {\n switch (prop) {\n case 'mute':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.mute(...args);\n });\n }, 'Call.mute');\n }\n case 'unmute':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.unmute(...args);\n });\n }, 'Call.unmute');\n }\n case 'startVideo':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.startVideo(...args);\n });\n }, 'Call.startVideo');\n }\n case 'stopVideo':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.stopVideo(...args);\n });\n }, 'Call.stopVideo');\n }\n case 'startScreenSharing':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.startScreenSharing(...args);\n });\n }, 'Call.startScreenSharing');\n }\n case 'stopScreenSharing':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.stopScreenSharing(...args);\n });\n }, 'Call.stopScreenSharing');\n }\n case 'hold':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.hold(...args);\n });\n }, 'Call.hold');\n }\n case 'resume':\n {\n return this._context.withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.resume(...args);\n });\n }, 'Call.resume');\n }\n case 'feature':\n {\n // these are mini version of Proxy object - if it grows too big, a real Proxy object should be used.\n return this._context.withErrorTeedToState((...args) => {\n if (args[0] === Features.Captions) {\n const captionsFeature = target.feature(Features.Captions);\n let proxyFeature;\n if (captionsFeature.captions.kind === 'Captions') {\n proxyFeature = new ProxyCaptions(this._context, target);\n return {\n captions: new Proxy(captionsFeature.captions, proxyFeature),\n on: (...args) => {\n const isCaptionsKindChanged = args[0] === 'CaptionsKindChanged';\n if (isCaptionsKindChanged) {\n const listener = args[1];\n const newListener = () => {\n listener();\n };\n return captionsFeature.on('CaptionsKindChanged', newListener);\n }\n },\n off: (...args) => {\n const isCaptionsKindChanged = args[0] === 'CaptionsKindChanged';\n if (isCaptionsKindChanged) {\n return captionsFeature.off('CaptionsKindChanged', args[1]);\n }\n }\n };\n }\n proxyFeature = new ProxyTeamsCaptions(this._context, target);\n return {\n captions: new Proxy(captionsFeature.captions, proxyFeature)\n };\n }\n if (args[0] === Features.Transfer) {\n const transferFeature = target.feature(Features.Transfer);\n const proxyFeature = new ProxyTransferCallFeature(this._context, target);\n return new Proxy(transferFeature, proxyFeature);\n }\n if (args[0] === Features.Spotlight) {\n const spotlightFeature = target.feature(Features.Spotlight);\n const proxyFeature = new ProxySpotlightCallFeature(this._context);\n return new Proxy(spotlightFeature, proxyFeature);\n }\n return target.feature(...args);\n }, 'Call.feature');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n/**\n * @private\n */\nclass ProxyTeamsCaptions {\n constructor(context, call) {\n this._context = context;\n this._call = call;\n }\n get(target, prop) {\n switch (prop) {\n case 'startCaptions':\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n this._context.setStartCaptionsInProgress(this._call.id, true);\n try {\n const ret = yield target.startCaptions(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, (_b = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.spokenLanguage) !== null && _b !== void 0 ? _b : 'en-us');\n return ret;\n }\n catch (e) {\n this._context.setStartCaptionsInProgress(this._call.id, false);\n throw e;\n }\n }), 'Call.feature');\n break;\n case 'stopCaptions':\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const ret = yield target.stopCaptions(...args);\n this._context.setIsCaptionActive(this._call.id, false);\n this._context.setStartCaptionsInProgress(this._call.id, false);\n this._context.clearCaptions(this._call.id);\n return ret;\n }), 'Call.feature');\n case 'setSpokenLanguage':\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const ret = yield target.setSpokenLanguage(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, args[0]);\n return ret;\n }), 'Call.feature');\n case 'setCaptionLanguage':\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const ret = yield target.setCaptionLanguage(...args);\n this._context.setSelectedCaptionLanguage(this._call.id, args[0]);\n return ret;\n }), 'Call.feature');\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n/**\n * @private\n */\nclass ProxyCaptions {\n constructor(context, call) {\n this._context = context;\n this._call = call;\n }\n get(target, prop) {\n switch (prop) {\n case 'startCaptions':\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n var _a, _b;\n this._context.setStartCaptionsInProgress(this._call.id, true);\n try {\n const ret = yield target.startCaptions(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, (_b = (_a = args[0]) === null || _a === void 0 ? void 0 : _a.spokenLanguage) !== null && _b !== void 0 ? _b : 'en-us');\n return ret;\n }\n catch (e) {\n this._context.setStartCaptionsInProgress(this._call.id, false);\n throw e;\n }\n }), 'Call.feature');\n break;\n case 'stopCaptions':\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const ret = yield target.stopCaptions(...args);\n this._context.setIsCaptionActive(this._call.id, false);\n this._context.setStartCaptionsInProgress(this._call.id, false);\n this._context.clearCaptions(this._call.id);\n return ret;\n }), 'Call.feature');\n case 'setSpokenLanguage':\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const ret = yield target.setSpokenLanguage(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, args[0]);\n return ret;\n }), 'Call.feature');\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n/**\n * @private\n */\nclass ProxySpotlightCallFeature {\n constructor(context) {\n this._context = context;\n }\n get(target, prop) {\n switch (prop) {\n case 'startSpotlight':\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const ret = yield target.startSpotlight(...args);\n return ret;\n }), 'Call.feature');\n break;\n case 'stopSpotlight':\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n const ret = yield target.stopSpotlight(...args);\n return ret;\n }), 'Call.feature');\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n/**\n * @private\n */\nclass ProxyTransferCallFeature {\n constructor(context, call) {\n this._context = context;\n this._call = call;\n }\n get(target, prop) {\n switch (prop) {\n case 'on':\n return (...args) => {\n const isTransferAccepted = args[0] === 'transferAccepted';\n if (isTransferAccepted) {\n const listener = args[1];\n const newListener = (args) => {\n this._context.setAcceptedTransfer(this._call.id, {\n callId: args.targetCall.id,\n timestamp: new Date()\n });\n listener(args);\n };\n return target.on('transferAccepted', newListener);\n }\n };\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n//# sourceMappingURL=CallDeclarativeCommon.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { ProxyCallCommon } from './CallDeclarativeCommon';\nclass ProxyCall extends ProxyCallCommon {\n get(target, prop) {\n switch (prop) {\n case 'addParticipant':\n {\n return this.getContext().withAsyncErrorTeedToState(function (...args) {\n return __awaiter(this, void 0, void 0, function* () {\n return yield target.addParticipant(...args);\n });\n }, 'Call.addParticipant');\n }\n default:\n return super.get(target, prop);\n }\n }\n}\n/**\n * Creates a declarative Call by proxying Call with ProxyCall.\n * This should only be used with CallAgentDeclarative as CallAgentDeclarative will add that\n * call to the context properly (need to have the Call in context to update it - CallAgentDeclarative will add Call to\n * context)\n *\n * @param call - Call from SDK\n * @param context - CallContext from StatefulCallClient\n */\nexport const callDeclaratify = (call, context) => {\n const proxyCall = new ProxyCall(context);\n Object.defineProperty(call, 'unsubscribe', {\n configurable: false,\n value: () => proxyCall.unsubscribe()\n });\n return new Proxy(call, proxyCall);\n};\n//# sourceMappingURL=CallDeclarative.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { clearCallRelatedState, ProxyCallAgentCommon } from './CallAgentDeclarativeCommon';\nimport { callDeclaratify } from './CallDeclarative';\nimport { _isACSCall, _isACSCallAgent } from './TypeGuards';\n/**\n * ProxyCallAgent proxies CallAgent and saves any returned state in the given context. It will subscribe to all state\n * updates in the CallAgent and in the contained Calls and RemoteParticipants. When dispose is called it will\n * unsubscribe from all state updates.\n */\nclass ProxyCallAgent extends ProxyCallAgentCommon {\n constructor(callAgent, context, internalContext) {\n super(context, internalContext);\n this.subscribe = () => {\n this._callAgent.on('callsUpdated', this.callsUpdated);\n this._callAgent.on('incomingCall', this.incomingCall);\n // There could be scenario that when ProxyCallAgent is created that the given CallAgent already has Calls. In this\n // case we need to make sure to subscribe to those already existing Calls.\n for (const call of this._callAgent.calls) {\n this.addCall(call);\n }\n };\n this.unsubscribe = () => {\n this._callAgent.off('callsUpdated', this.callsUpdated);\n this._callAgent.off('incomingCall', this.incomingCall);\n this.unregisterSubscriber();\n };\n this._callAgent = callAgent;\n this.subscribe();\n }\n callDeclaratify(call, context) {\n if (_isACSCall(call)) {\n return callDeclaratify(call, context);\n }\n throw new Error('Not reachable code, DeclarativeCallAgent.callDeclaratify must be called with an ACS call.');\n }\n startCall(agent, args) {\n if (_isACSCallAgent(agent)) {\n return agent.startCall(...args);\n }\n throw Error('Unreachable code, DeclarativeCallAgent.startCall must be called with an ACS callAgent.');\n }\n joinCall(agent, args) {\n if (_isACSCallAgent(agent)) {\n return agent.join(...args);\n }\n throw Error('Unreachable code, DeclarativeCallAgent.joinCall must be called with an ACS callAgent.');\n }\n agentSubscribe(agent, args) {\n if (_isACSCallAgent(agent)) {\n return agent.on(...args);\n }\n throw Error('Unreachable code, DeclarativeCallAgent.agentSubscribe must be called with an ACS callAgent.');\n }\n agentUnsubscribe(agent, args) {\n if (_isACSCallAgent(agent)) {\n return agent.off(...args);\n }\n throw Error('Unreachable code, DeclarativeCallAgent.agentUnsubscribe must be called with an ACS callAgent.');\n }\n get(target, prop) {\n return super.getCommon(target, prop);\n }\n}\n/**\n * Creates a declarative CallAgent by proxying CallAgent with ProxyCallAgent which will track state updates by updating\n * the given context.\n *\n * @param callAgent - CallAgent from SDK\n * @param context - CallContext from StatefulCallClient\n * @param internalContext- InternalCallContext from StatefulCallClient\n */\nexport const callAgentDeclaratify = (callAgent, context, internalContext) => {\n clearCallRelatedState(context, internalContext);\n return new Proxy(callAgent, new ProxyCallAgent(callAgent, context, internalContext));\n};\n//# sourceMappingURL=CallAgentDeclarative.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { CallIdHistory } from './CallIdHistory';\nimport { LocalVideoStreamVideoEffectsSubscriber } from './LocalVideoStreamVideoEffectsSubscriber';\nimport { Features } from '@azure/communication-calling';\n/**\n * Contains internal data used between different Declarative components to share data.\n */\nexport class InternalCallContext {\n constructor() {\n // >\n this._remoteRenderInfos = new Map();\n // >.\n this._localRenderInfos = new Map();\n // Used for keeping track of rendered LocalVideoStreams that are not part of a Call.\n this._unparentedRenderInfos = new Map();\n this._callIdHistory = new CallIdHistory();\n // Used for keeping track of video effects subscribers that are not part of a Call.\n // The key is the stream ID. We assume each stream ID\n this._unparentedViewVideoEffectsSubscriber = new Map();\n }\n setCallId(newCallId, oldCallId) {\n this._callIdHistory.updateCallIdHistory(newCallId, oldCallId);\n const remoteRenderInfos = this._remoteRenderInfos.get(oldCallId);\n if (remoteRenderInfos) {\n this._remoteRenderInfos.delete(oldCallId);\n this._remoteRenderInfos.set(newCallId, remoteRenderInfos);\n }\n const localRenderInfos = this._localRenderInfos.get(oldCallId);\n if (localRenderInfos) {\n this._localRenderInfos.delete(oldCallId);\n this._localRenderInfos.set(newCallId, localRenderInfos);\n }\n }\n getCallIds() {\n return this._remoteRenderInfos.keys();\n }\n getRemoteRenderInfoForCall(callId) {\n return this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n }\n getRemoteRenderInfoForParticipant(callId, participantKey, streamId) {\n const callRenderInfos = this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!callRenderInfos) {\n return undefined;\n }\n const participantRenderInfos = callRenderInfos.get(participantKey);\n if (!participantRenderInfos) {\n return undefined;\n }\n return participantRenderInfos.get(streamId);\n }\n setRemoteRenderInfo(callId, participantKey, streamId, stream, status, renderer) {\n let callRenderInfos = this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!callRenderInfos) {\n callRenderInfos = new Map();\n this._remoteRenderInfos.set(this._callIdHistory.latestCallId(callId), callRenderInfos);\n }\n let participantRenderInfos = callRenderInfos.get(participantKey);\n if (!participantRenderInfos) {\n participantRenderInfos = new Map();\n callRenderInfos.set(participantKey, participantRenderInfos);\n }\n participantRenderInfos.set(streamId, {\n stream,\n status,\n renderer\n });\n }\n deleteRemoteRenderInfo(callId, participantKey, streamId) {\n const callRenderInfos = this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!callRenderInfos) {\n return;\n }\n const participantRenderInfos = callRenderInfos.get(participantKey);\n if (!participantRenderInfos) {\n return;\n }\n participantRenderInfos.delete(streamId);\n }\n setLocalRenderInfo(callId, streamKey, stream, status, renderer) {\n let localRenderInfosForCall = this._localRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!localRenderInfosForCall) {\n localRenderInfosForCall = new Map();\n this._localRenderInfos.set(this._callIdHistory.latestCallId(callId), localRenderInfosForCall);\n }\n localRenderInfosForCall.set(streamKey, {\n stream,\n status,\n renderer\n });\n }\n getLocalRenderInfosForCall(callId) {\n return this._localRenderInfos.get(this._callIdHistory.latestCallId(callId));\n }\n getLocalRenderInfo(callId, streamKey) {\n const localRenderInfosForCall = this._localRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!localRenderInfosForCall) {\n return undefined;\n }\n return localRenderInfosForCall.get(streamKey);\n }\n deleteLocalRenderInfo(callId, streamKey) {\n const localRenderInfoForCall = this._localRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!localRenderInfoForCall) {\n return;\n }\n localRenderInfoForCall.delete(streamKey);\n }\n getUnparentedRenderInfo(localVideoStream) {\n return this._unparentedRenderInfos.get(localVideoStream.mediaStreamType);\n }\n getUnparentedRenderInfos() {\n return [...this._unparentedRenderInfos].map(([, renderInfo]) => renderInfo.stream);\n }\n setUnparentedRenderInfo(statefulStream, stream, status, renderer) {\n this._unparentedRenderInfos.set(statefulStream.mediaStreamType, {\n stream,\n status,\n renderer\n });\n }\n deleteUnparentedRenderInfo(localVideoStream) {\n var _a;\n (_a = this._unparentedViewVideoEffectsSubscriber.get(localVideoStream.mediaStreamType)) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n this._unparentedRenderInfos.delete(localVideoStream.mediaStreamType);\n }\n subscribeToUnparentedViewVideoEffects(localVideoStream, callContext) {\n var _a;\n {\n // Ensure we aren't setting multiple subscriptions\n (_a = this._unparentedViewVideoEffectsSubscriber.get(localVideoStream.mediaStreamType)) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n this._unparentedViewVideoEffectsSubscriber.set(localVideoStream.mediaStreamType, new LocalVideoStreamVideoEffectsSubscriber({\n parent: 'unparented',\n context: callContext,\n localVideoStream: localVideoStream,\n localVideoStreamEffectsAPI: localVideoStream.feature(Features.VideoEffects)\n }));\n }\n }\n // UnparentedRenderInfos are not cleared as they are not part of the Call state.\n clearCallRelatedState() {\n this._remoteRenderInfos.clear();\n this._localRenderInfos.clear();\n }\n}\n//# sourceMappingURL=InternalCallContext.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ProxyCallCommon } from './CallDeclarativeCommon';\nclass ProxyTeamsCall extends ProxyCallCommon {\n get(target, prop) {\n switch (prop) {\n default:\n return super.get(target, prop);\n }\n return super.get(target, prop);\n }\n}\n/**\n * Creates a declarative Call by proxying Call with ProxyCall.\n * This should only be used with CallAgentDeclarative as CallAgentDeclarative will add that\n * call to the context properly (need to have the Call in context to update it - CallAgentDeclarative will add Call to\n * context)\n *\n * @param call - TeamsCall from SDK\n * @param context - CallContext from StatefulCallClient\n */\nexport const teamsCallDeclaratify = (call, context) => {\n const proxyCall = new ProxyTeamsCall(context);\n proxyCall.unsubscribe();\n Object.defineProperty(call, 'unsubscribe', {\n configurable: false,\n value: () => proxyCall.unsubscribe()\n });\n return new Proxy(call, proxyCall);\n};\n//# sourceMappingURL=TeamsCallDeclarative.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { clearCallRelatedState, ProxyCallAgentCommon } from './CallAgentDeclarativeCommon';\nimport { _isTeamsCall, _isTeamsCallAgent } from './TypeGuards';\nimport { teamsCallDeclaratify } from './TeamsCallDeclarative';\n/**\n * ProxyTeamsCallAgent proxies TeamsCallAgent and saves any returned state in the given context. It will subscribe to all state\n * updates in the TeamsCallAgent and in the contained TeamsCalls and RemoteParticipants. When dispose is called it will\n * unsubscribe from all state updates.\n */\nclass ProxyTeamsCallAgent extends ProxyCallAgentCommon {\n constructor(callAgent, context, internalContext) {\n super(context, internalContext);\n this.subscribe = () => {\n this._callAgent.on('callsUpdated', this.callsUpdated);\n this._callAgent.on('incomingCall', this.incomingCall);\n // There could be scenario that when ProxyTeamsCallAgent is created that the given CallAgent already has TeamsCalls. In this\n // case we need to make sure to subscribe to those already existing Calls.\n for (const call of this._callAgent.calls) {\n this.addCall(call);\n }\n };\n this.unsubscribe = () => {\n this._callAgent.off('callsUpdated', this.callsUpdated);\n this._callAgent.off('incomingCall', this.incomingCall);\n this.unregisterSubscriber();\n };\n this._callAgent = callAgent;\n this.subscribe();\n }\n callDeclaratify(call, context) {\n if (_isTeamsCall(call)) {\n return teamsCallDeclaratify(call, context);\n }\n throw new Error('Not reachable code, DeclarativeTeamsCallAgent.callDeclaratify must be called with an TeamsCall.');\n }\n startCall(agent, args) {\n if (_isTeamsCallAgent(agent)) {\n return agent.startCall(...args);\n }\n throw new Error('Not reachable code, DeclarativeTeamsCallAgent.startCall must be called with an TeamsCallAgent.');\n }\n joinCall(agent, args) {\n if (_isTeamsCallAgent(agent)) {\n return agent.join(...args);\n }\n throw new Error('Not reachable code, DeclarativeTeamsCallAgent.joinCall must be called with an TeamsCallAgent.');\n }\n agentSubscribe(agent, args) {\n if (_isTeamsCallAgent(agent)) {\n agent.on(...args);\n return;\n }\n throw new Error('Not reachable code, DeclarativeTeamsCallAgent.agentSubscribe must be called with an TeamsCallAgent.');\n }\n agentUnsubscribe(agent, args) {\n if (_isTeamsCallAgent(agent)) {\n agent.off(...args);\n return;\n }\n throw new Error('Not reachable code, DeclarativeTeamsCallAgent.agentUnsubscribe must be called with an TeamsCallAgent.');\n }\n get(target, prop) {\n return super.getCommon(target, prop);\n }\n}\n/**\n * Creates a declarative CallAgent by proxying TeamsCallAgent with ProxyTeamsCallAgent which will track state updates by updating\n * the given context.\n *\n * @param callAgent - TeamsCallAgent from SDK\n * @param context - CallContext from StatefulCallClient\n * @param internalContext- InternalCallContext from StatefulCallClient\n */\nexport const teamsCallAgentDeclaratify = (callAgent, context, internalContext) => {\n clearCallRelatedState(context, internalContext);\n return new Proxy(callAgent, new ProxyTeamsCallAgent(callAgent, context, internalContext));\n};\n//# sourceMappingURL=TeamsCallAgentDeclarative.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n/**\n * @private\n */\nexport class ProxyVideoStreamRendererView {\n constructor(context, callId, participantId, _streamId) {\n this._context = context;\n this._callId = callId;\n this._participantId = participantId;\n this._streamId = _streamId;\n }\n get(target, prop) {\n switch (prop) {\n case 'updateScalingMode':\n {\n return (...args) => __awaiter(this, void 0, void 0, function* () {\n yield target.updateScalingMode(...args);\n this._context.setRemoteVideoStreamViewScalingMode(this._callId, this._participantId, this._streamId, args[0]);\n });\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n/**\n * Creates a declarative VideoStreamRendererView that is backed by a VideoStreamRendererView from the SDK.\n * Calling methods on this declarative object triggers state updates in the stateful client.\n */\nexport const videoStreamRendererViewDeclaratify = (view, context, callId, participantId, streamId) => {\n const proxyVideoStreamRendererView = new ProxyVideoStreamRendererView(context, callId, participantId, streamId);\n return new Proxy(view, proxyVideoStreamRendererView);\n};\n//# sourceMappingURL=VideoStreamRendererViewDeclarative.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nimport { deviceManagerDeclaratify } from './DeviceManagerDeclarative';\nimport { CallClient, Features } from '@azure/communication-calling';\nimport { CallContext } from './CallContext';\nimport { callAgentDeclaratify } from './CallAgentDeclarative';\nimport { InternalCallContext } from './InternalCallContext';\nimport { createView, disposeView } from './StreamUtils';\nimport { getIdentifierKind } from '@azure/communication-common';\nimport { toFlatCommunicationIdentifier, _getApplicationId } from \"../../acs-ui-common/src\";\nimport { callingStatefulLogger } from './Logger';\nimport { teamsCallAgentDeclaratify } from './TeamsCallAgentDeclarative';\nimport { videoStreamRendererViewDeclaratify } from './VideoStreamRendererViewDeclarative';\n/**\n * ProxyCallClient proxies CallClient {@link @azure/communication-calling#CallClient} and subscribes to all events that\n * affect state. ProxyCallClient keeps its own copy of the call state and when state is updated, ProxyCallClient emits\n * the event 'stateChanged'.\n */\nclass ProxyCallClient {\n constructor(context, internalContext) {\n this._context = context;\n this._internalContext = internalContext;\n }\n get(target, prop) {\n switch (prop) {\n case 'createCallAgent':\n {\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous\n // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative\n // callAgent if the createCallAgent succeeds.\n const callAgent = yield target.createCallAgent(...args);\n this._callAgent = callAgentDeclaratify(callAgent, this._context, this._internalContext);\n this._context.setCallAgent({\n displayName: this._callAgent.displayName\n });\n return this._callAgent;\n }), 'CallClient.createCallAgent');\n }\n case 'createTeamsCallAgent':\n {\n return this._context.withAsyncErrorTeedToState((...args) => __awaiter(this, void 0, void 0, function* () {\n // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous\n // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative\n // callAgent if the createCallAgent succeeds.\n const callAgent = yield target.createTeamsCallAgent(...args);\n this._callAgent = teamsCallAgentDeclaratify(callAgent, this._context, this._internalContext);\n this._context.setCallAgent({\n displayName: undefined\n });\n return this._callAgent;\n }), 'CallClient.createTeamsCallAgent');\n }\n case 'getDeviceManager':\n {\n return this._context.withAsyncErrorTeedToState(() => __awaiter(this, void 0, void 0, function* () {\n // As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of\n // DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll\n // throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.\n const deviceManager = yield target.getDeviceManager();\n if (this._sdkDeviceManager) {\n if (this._sdkDeviceManager === deviceManager) {\n return this._deviceManager;\n }\n else {\n throw new Error('Multiple DeviceManager not supported. This means a incompatible version of communication-calling is ' + 'used OR calling declarative was not properly updated to communication-calling version.');\n }\n }\n else {\n this._sdkDeviceManager = deviceManager;\n }\n this._deviceManager = deviceManagerDeclaratify(deviceManager, this._context, this._internalContext);\n return this._deviceManager;\n }), 'CallClient.getDeviceManager');\n }\n case 'feature':\n {\n return this._context.withErrorTeedToState((...args) => {\n if (args[0] === Features.DebugInfo) {\n const feature = target.feature(Features.DebugInfo);\n /**\n * add to this object if we want to proxy anything else off the DebugInfo feature object.\n */\n return Object.assign(Object.assign({}, feature), { getEnvironmentInfo: () => __awaiter(this, void 0, void 0, function* () {\n const environmentInfo = yield feature.getEnvironmentInfo();\n this._context.setEnvironmentInfo(environmentInfo);\n return environmentInfo;\n }) });\n }\n return Reflect.get(target, prop);\n }, 'CallClient.feature');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n/**\n * Creates a StatefulCallClient {@link StatefulCallClient} by proxying CallClient\n * {@link @azure/communication-calling#CallClient} with ProxyCallClient {@link ProxyCallClient} which then allows access\n * to state in a declarative way.\n *\n * It is important to use the {@link @azure/communication-calling#DeviceManager} and\n * {@link @azure/communication-calling#CallAgent} and {@link @azure/communication-calling#Call} (and etc.) that are\n * obtained from the StatefulCallClient in order for their state changes to be proxied properly.\n *\n * @param args - {@link StatefulCallClientArgs}\n * @param options - {@link StatefulCallClientOptions}\n *\n * @public\n */\nexport const createStatefulCallClient = (args, options) => {\n return _createStatefulCallClientInner(args, options);\n};\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createStatefulCallClientInner = (args, options, telemetryImplementationHint = 'StatefulComponents') => {\n callingStatefulLogger.info(`Creating calling stateful client using library version: ${_getApplicationId(telemetryImplementationHint)}`);\n return createStatefulCallClientWithDeps(new CallClient(withTelemetryTag(telemetryImplementationHint, options === null || options === void 0 ? void 0 : options.callClientOptions)), new CallContext(getIdentifierKind(args.userId), options === null || options === void 0 ? void 0 : options.maxStateChangeListeners), new InternalCallContext());\n};\n/**\n * Package-internal version of createStatefulCallClient that allows dependency injection.\n *\n * This function should not be exported from the package.\n */\nexport const createStatefulCallClientWithDeps = (callClient, context, internalContext) => {\n Object.defineProperty(callClient, 'getState', {\n configurable: false,\n value: () => context.getState()\n });\n Object.defineProperty(callClient, 'onStateChange', {\n configurable: false,\n value: (handler) => context.onStateChange(handler)\n });\n Object.defineProperty(callClient, 'offStateChange', {\n configurable: false,\n value: (handler) => context.offStateChange(handler)\n });\n Object.defineProperty(callClient, 'createView', {\n configurable: false,\n value: (callId, participantId, stream, options) => __awaiter(void 0, void 0, void 0, function* () {\n const participantIdKind = participantId ? getIdentifierKind(participantId) : undefined;\n const result = yield createView(context, internalContext, callId, participantIdKind, stream, options);\n // We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.\n if ('id' in stream && callId && participantId && result) {\n const participantKey = toFlatCommunicationIdentifier(participantId);\n result.view = videoStreamRendererViewDeclaratify(result.view, context, callId, participantKey, stream.id);\n }\n return result;\n })\n });\n Object.defineProperty(callClient, 'disposeView', {\n configurable: false,\n value: (callId, participantId, stream) => {\n const participantIdKind = participantId ? getIdentifierKind(participantId) : undefined;\n disposeView(context, internalContext, callId, participantIdKind, stream);\n }\n });\n const newStatefulCallClient = new Proxy(callClient, new ProxyCallClient(context, internalContext));\n // Populate initial state\n newStatefulCallClient.feature(Features.DebugInfo).getEnvironmentInfo();\n return newStatefulCallClient;\n};\nconst withTelemetryTag = (telemetryImplementationHint, options) => {\n var _a, _b;\n const tags = (_b = (_a = options === null || options === void 0 ? void 0 : options.diagnostics) === null || _a === void 0 ? void 0 : _a.tags) !== null && _b !== void 0 ? _b : [];\n tags.push(_getApplicationId(telemetryImplementationHint));\n return Object.assign(Object.assign({}, options), { diagnostics: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.diagnostics), { tags }) });\n};\n//# sourceMappingURL=StatefulCallClient.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @internal\n */\nexport const _isACSCall = (call) => {\n return !call.kind || call.kind === 'Call';\n};\n/**\n * @internal\n */\nexport const _isACSCallAgent = (callAgent) => {\n return !callAgent.kind || callAgent.kind === 'CallAgent';\n};\n/**\n * @internal\n */\nexport const _isTeamsCall = (call) => {\n return call.kind === 'TeamsCall';\n};\n/**\n * @internal\n */\nexport const _isTeamsCallAgent = (callAgent) => {\n return callAgent.kind === 'TeamsCallAgent';\n};\n/**\n * @internal\n */\nexport const _isTeamsIncomingCall = (call) => {\n return call.kind === 'TeamsIncomingCall';\n};\n/**\n * @internal\n */\nexport const _isACSIncomingCall = (call) => {\n return call.kind === 'IncomingCall';\n};\n/**\n * @internal\n */\nexport const _isTeamsMeeting = (call) => {\n return 'info' in call && !!call.info.threadId;\n};\n//# sourceMappingURL=TypeGuards.js.map"],"names":["__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","value","step","next","e","rejected","result","done","then","apply","ProxyDeviceManager","constructor","deviceManager","context","this","setDeviceManager","_context","setDeviceManagerIsSpeakerSelectionAvailable","_deviceManager","isSpeakerSelectionAvailable","setDeviceManagerSelectedMicrophone","selectedMicrophone","setDeviceManagerSelectedSpeaker","selectedSpeaker","subscribe","on","videoDevicesUpdated","audioDevicesUpdated","selectedMicrophoneChanged","selectedSpeakerChanged","navigator","permissions","query","name","cameraPermissions","addEventListener","permissionsApiStateChangeHandler","console","info","micPermissions","unsubscribe","off","removeEventListener","updateDevicePermissionState","selectCamera","videoDeviceInfo","setDeviceManagerSelectedCamera","realCameras","getCameras","filter","c","setDeviceManagerCameras","dedupeById","setDeviceManagerMicrophones","getMicrophones","setDeviceManagerSpeakers","getSpeakers","sdkDeviceAccessState","hasCameraPermission","video","hasMicPermission","audio","all","state","setDeviceManagerDeviceAccess","get","target","prop","withAsyncErrorTeedToState","cameras","microphones","speakers","args","selectMicrophone","selectSpeaker","askDevicePermission","deviceAccess","Reflect","devices","ids","Set","uniqueDevices","forEach","device","has","id","push","add","convertSdkLocalStreamToDeclarativeLocalStream","stream","localVideoStreamEffectsAPI","feature","Features","source","mediaStreamType","view","undefined","videoEffects","convertFromSDKToDeclarativeVideoStreamVideoEffects","activeEffects","convertSdkRemoteStreamToDeclarativeRemoteStream","isAvailable","isReceiving","streamSize","size","convertSdkParticipantToDeclarativeParticipant","participant","declarativeVideoStreams","videoStream","videoStreams","identifier","displayName","callEndReason","isMuted","isSpeaking","raisedHand","role","spotlight","convertFromSDKToDeclarativeVideoStreamRendererView","scalingMode","isMirrored","convertFromSDKToRaisedHandState","raisedHandOrderPosition","order","CallError","Error","innerError","timestamp","super","Date","now","message","callingStatefulLogger","createClientLogger","EventNames","CallIdHistory","_callIdHistory","Map","updateCallIdHistory","newCallId","oldCallId","existing","latestCallId","trace","delete","set","callId","latest","newer","CallContext","userId","maxListeners","_timeOutId","teeErrorToState","error","callError","toCallError","setLatestError","_logger","_state","calls","callsEnded","incomingCalls","incomingCallsEnded","unparentedViews","callAgent","environmentInfo","latestErrors","_emitter","EventEmitter","setMaxListeners","_atomicId","getState","modifyState","modifier","priorState","patches","getLogLevel","emit","onStateChange","handler","offStateChange","clearCallRelatedState","draft","setCallAgent","setCall","call","existingCall","callerInfo","direction","isScreenSharingOn","localVideoStreams","remoteParticipants","transcription","isTranscriptionActive","optimalVideoCount","maxRemoteVideoStreams","recording","isRecordingActive","raiseHand","raisedHands","pptLive","isActive","localParticipantRaisedHand","captionsFeature","currentSpokenLanguage","currentCaptionLanguage","meetingConference","removeIncomingCall","removeCall","setCallEnded","endTime","Object","keys","length","oldestCall","findOldestCallEnded","setCallState","setCallId","setEnvironmentInfo","envInfo","setCallIsScreenSharingOn","setCallRemoteParticipants","addRemoteParticipant","removeRemoteParticipant","setCallRemoteParticipantsEnded","remoteParticipantsEnded","setCallLocalVideoStream","streamsAdded","streamsRemoved","removedStream","index","findIndex","i","splice","addedStream","setCallLocalVideoStreamVideoEffects","_a","find","setCallIsMicrophoneMuted","isMicrophoneMuted","setRole","setCallDominantSpeakers","dominantSpeakers","setCallRecordingActive","setCallPPTLiveActive","setCallParticipantPPTLive","participantKey","contentSharingStream","contentSharingRemoteParticipant","setCallRaisedHands","map","setParticipantIsRaisedHand","setReceivedReactionFromParticipant","reactionMessage","clearTimeout","newReactionState","receivedOn","localParticipantReaction","reactionState","warn","setTimeout","callContext","clearParticipantReactionState","setCallTranscriptionActive","setCapabilities","capabilities","capabilitiesChangeInfo","capabilitiesFeature","latestCapabilitiesChangeInfo","setHideAttendeeNames","oldValue","viewAttendeeNames","newValue","isPresent","reason","hideAttendeeNames","setSpotlight","spotlightedParticipants","maxParticipantsToSpotlight","assign","setTeamsMeetingConference","teamsMeetingConferenceDetails","meetingConferencePhoneInfo","conferencePhones","phoneNumbers","flatMap","phoneNumber","_b","_c","_d","common","conferenceId","phoneConferenceId","country","countryName","city","cityName","isTollFree","toll","tollPhoneNumber","tollFree","tollFreePhoneNumber","phoneInfo","setParticipantSpotlighted","spotlightedParticipant","spotlightedOrderPosition","localParticipantSpotlight","setParticipantNotSpotlighted","setCallScreenShareParticipant","screenShareRemoteParticipant","setLocalVideoStreamRendererView","localVideoMediaStreamType","localVideoStream","setParticipantState","setParticipantIsMuted","muted","setOptimalVideoCount","setParticipantRole","setParticipantDisplayName","setParticipantIsSpeaking","setParticipantVideoStream","existingStream","setRemoteVideoStreamIsAvailable","streamId","setRemoteVideoStreamIsReceiving","setRemoteVideoStreamSize","setRemoteVideoStreams","addRemoteVideoStream","removeRemoteVideoStream","newStream","setRemoteVideoStreamRendererView","setRemoteVideoStreamViewScalingMode","setIncomingCall","setIncomingCallEnded","selectedCamera","some","camera","setDeviceManagerUnparentedView","deleteDeviceManagerUnparentedView","foundIndex","setDeviceManagerUnparentedViewVideoEffects","getAndIncrementAtomicId","processNewCaption","captions","newCaption","resultType","lastCaption","speaker","getTime","shift","addTeamsCaption","caption","captionLanguage","toUpperCase","convertFromTeamsSDKToCaptionInfoState","addCaption","captionText","spokenText","convertFromSDKToCaptionInfoState","setCaptionsKind","kind","captionsKind","clearCaptions","setIsCaptionActive","isCaptionsActive","isCaptionsFeatureActive","setStartCaptionsInProgress","startCaptionsInProgress","setSelectedSpokenLanguage","spokenLanguage","setSelectedCaptionLanguage","setAvailableCaptionLanguages","captionLanguages","supportedCaptionLanguages","setAvailableSpokenLanguages","spokenLanguages","supportedSpokenLanguages","setAcceptedTransfer","acceptedTransfer","transfer","acceptedTransfers","action","withErrorTeedToState","callEntries","entries","firstCallEntry","oldestCallId","slice","TeamsCaptionsSubscriber","callIdRef","_captions","isCaptionsActiveChanged","onCaptionsReceived","isCaptionLanguageChanged","isSpokenLanguageChanged","_callIdRef","activeCaptionLanguage","activeSpokenLanguage","CaptionsSubscriber","CaptionsFeatureSubscriber","isCaptionsKindChanged","_TeamsCaptionsSubscriber","_CaptionsSubscriber","LocalVideoStreamVideoEffectsSubscriber","_localVideoStreamEffectsAPI","effectsStarted","effectsStopped","effectsError","updateStatefulVideoEffects","statefulVideoEffects","_parent","_localVideoStream","parent","RemoteVideoStreamSubscriber","remoteVideoStream","_remoteVideoStream","isAvailableChanged","isReceivingChanged","isSizeChanged","checkAndUpdateScreenShareState","includesActiveScreenShareStream","streams","values","_participantKey","existingScreenShare","_e","_f","_g","width","height","existingAspectRatio","newAspectRatio","_logStreamEvent","eventName","streamLogInfo","streamEventType","DISPOSE_STREAM_INVALID_PARAMS","level","data","streamType","START_DISPOSE_STREAM","DISPOSE_INFO_NOT_FOUND","STREAM_STOPPING","DISPOSING_RENDERER","RENDERER_NOT_FOUND","STREAM_ALREADY_DISPOSED","_logDisposeStreamEvent","CREATE_STREAM_INVALID_PARAMS","START_STREAM_RENDERING","STREAM_NOT_FOUND","STREAM_ALREADY_RENDERED","STREAM_RENDERING","CREATE_STREAM_FAIL","RENDER_INFO_NOT_FOUND","CREATED_STREAM_STOPPING","VIEW_RENDER_SUCCEED","CREATING_VIEW","_logCreateStreamEvent","createView","internalContext","participantId","options","localStreamKey","remoteStreamId","renderInfo","getRemoteRenderInfoForParticipant","getLocalRenderInfo","status","setRemoteRenderInfo","renderer","setLocalRenderInfo","VideoStreamRenderer","refreshedRenderInfo","dispose","createViewVideo","getUnparentedRenderInfo","LocalVideoStream","setUnparentedRenderInfo","deleteUnparentedRenderInfo","subscribeToUnparentedViewVideoEffects","createViewUnparentedVideo","disposeView","disposeViewVideo","disposeViewUnparentedVideo","disposeAllViewsFromCall","remoteStreams","getRemoteRenderInfoForCall","participantStreams","_","remoteStreamAndRenderer","localStreams","getLocalRenderInfosForCall","localStreamAndRenderer","ParticipantSubscriber","_participant","stateChanged","isMutedChanged","displayNameChanged","isSpeakingChanged","videoStreamsUpdated","roleChanged","_internalContext","addRemoteVideoStreamSubscriber","deleteRemoteRenderInfo","_remoteVideoStreamSubscribers","event","removed","added","RecordingSubscriber","_recording","PPTLiveSubscriber","_pptLive","checkAndUpdatePPTLiveParticipant","activePresenterId","_call","stopScreenSharing","TranscriptionSubscriber","_transcription","isTranscriptionActiveChanged","UserFacingDiagnosticsSubscriber","diagnostics","_diagnostics","network","networkDiagnosticsChanged","bind","media","mediaDiagnosticsChanged","setInitialDiagnostics","getLatest","diagnostic","latestFromEvent","valueType","RaiseHandSubscriber","_raiseHand","loweredHand","getRaisedHands","OptimalVideoCountSubscriber","_localOptimalVideoCountFeature","optimalVideoCountChanged","updateOptimalVideoCountState","newOptimalVideoCountState","localOptimalVideoCountFeature","CapabilitiesSubscriber","_capabilitiesFeature","capabilitiesChanged","ReactionSubscriber","reaction","_reaction","onReactionEvent","SpotlightSubscriber","_spotlightFeature","spotlightChanged","getSpotlightedParticipants","addedParticipant","removedParticipant","CallSubscriber","_safeSubscribeInitCaptionSubscriber","_safeSubscribe","initCaptionSubscriber","_safeSubscribeInitTeamsMeetingConference","initTeamsMeetingConference","idChanged","isScreenSharingOnChanged","remoteParticipantsUpdated","localVideoStreamsUpdated","isMuteChanged","callRoleChangedHandler","dominantSpeakersChanged","mutedByOthersHandler","addParticipantListener","_participantSubscribers","participantSubscriber","clear","deleteLocalRenderInfo","_diagnosticsSubscriber","_recordingSubscriber","_transcriptionSubscriber","_optimalVideoCountSubscriber","_pptLiveSubscriber","_CaptionsFeatureSubscriber","_raiseHandSubscriber","_capabilitiesSubscriber","_reactionSubscriber","_spotlightSubscriber","getTeamsMeetingAudioConferencingDetails","removeParticipantListener","_localVideoStreamVideoEffectsSubscribers","subscriber","IncomingCallSubscriber","incomingCall","_incomingCall","callEnded","_setIncomingCallEnded","ProxyIncomingCall","accept","ProxyTeamsIncomingCall","ProxyCallAgentCommon","unregisterSubscriber","callSubscriber","_callSubscribers","incomingCallSubscriber","_incomingCallSubscribers","_incomingCalls","declarativeCall","_declarativeCalls","callsUpdated","addedStatefulCall","statefulCall","addCall","removedStatefulCall","callDeclaratify","externalCallsUpdatedListener","_externalCallsUpdatedListeners","incomingCallId","proxyIncomingCall","Proxy","teamsIncomingCallDeclaratify","incomingCallDeclaratify","newInfo","startTime","convertSdkIncomingCallToDeclarativeIncomingCall","declarativeRemoteParticipants","callInfo","convertSdkCallToDeclarativeCall","getOrCreateDeclarativeCall","newDeclarativeCall","getCommon","startCall","joinCall","Array","from","listener","agentSubscribe","agentUnsubscribe","callAgentDisposeAsyncCallbackWrapper","callIds","getCallIds","disposeAllViews","ProxyCallCommon","getContext","mute","unmute","startVideo","stopVideo","startScreenSharing","hold","resume","proxyFeature","ProxyCaptions","newListener","ProxyTeamsCaptions","transferFeature","ProxyTransferCallFeature","spotlightFeature","ProxySpotlightCallFeature","ret","startCaptions","stopCaptions","setSpokenLanguage","setCaptionLanguage","startSpotlight","stopSpotlight","targetCall","ProxyCall","addParticipant","ProxyCallAgent","_callAgent","proxyCall","defineProperty","configurable","agent","join","InternalCallContext","_remoteRenderInfos","_localRenderInfos","_unparentedRenderInfos","_unparentedViewVideoEffectsSubscriber","remoteRenderInfos","localRenderInfos","callRenderInfos","participantRenderInfos","streamKey","localRenderInfosForCall","localRenderInfoForCall","getUnparentedRenderInfos","statefulStream","ProxyTeamsCall","ProxyTeamsCallAgent","teamsCallDeclaratify","ProxyVideoStreamRendererView","_streamId","_callId","_participantId","updateScalingMode","ProxyCallClient","createCallAgent","callAgentDeclaratify","createTeamsCallAgent","teamsCallAgentDeclaratify","getDeviceManager","_sdkDeviceManager","proxyDeviceManager","deviceManagerDeclaratify","getEnvironmentInfo","_createStatefulCallClientInner","telemetryImplementationHint","createStatefulCallClientWithDeps","CallClient","withTelemetryTag","callClientOptions","maxStateChangeListeners","callClient","participantIdKind","proxyVideoStreamRendererView","videoStreamRendererViewDeclaratify","newStatefulCallClient","tags","_isACSCall","_isACSCallAgent","_isTeamsCall","_isTeamsCallAgent","_isTeamsIncomingCall","_isTeamsMeeting","threadId"],"sourceRoot":""}