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AAgBrH,EAAO/B,GAC1G,CACA,OAAO7D,CACX,MAEJqL,OAAOyV,eAAekC,EAAY,cAAe,CAC7CjC,cAAc,EACdphB,MAAO,CAAC6F,EAAQ2Q,EAAevQ,KAC3B,MAAMqd,EAAoB9M,GAAgB,SAAkBA,QAAiBjR,EAC7EqS,EAAYhX,EAAS2V,EAAiB1Q,EAAQyd,EAAmBrd,EAAO,IAGzE,IAAIyY,MAAM2E,EAAY,IAAIb,GAAgB5hB,EAAS2V,KAExD2M,GAAoBzM,IACtB,IAAIhK,EAAIqF,EACR,MAAM2R,EAA4I,QAApI3R,EAAsF,QAAhFrF,EAAKgK,aAAyC,EAASA,EAAQiD,mBAAgC,IAAPjN,OAAgB,EAASA,EAAGgX,YAAyB,IAAP3R,EAAgBA,EAAK,GAE/K,OADA2R,EAAKtf,MAAK,WACHuH,OAAOiF,OAAOjF,OAAOiF,OAAO,CAAC,EAAG8F,GAAU,CAAEiD,YAAahO,OAAOiF,OAAOjF,OAAOiF,OAAO,CAAC,EAAG8F,aAAyC,EAASA,EAAQiD,aAAc,CAAE+J,UAAU,C,+DCzIjL,MAAMC,EAActZ,IAChB,EAKEuZ,EAAmB3a,IACrB,EAKE4a,EAAgBxZ,IAClB,EAKEyZ,EAAqB7a,IACvB,C","sources":["file:////home/runner/work/platform/platform/common/temp/node_modules/.pnpm/@azure+communication-react@1.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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.10.0_6x3ev4d3227te4dl7uene6lmqi/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 };\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 };\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 this._context.setDeviceManagerSpeakers(dedupeById(yield this._deviceManager.getSpeakers()));\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._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) => {\n this._context.setDeviceManagerDeviceAccess(deviceAccess);\n this.setDeviceManager();\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 /* @conditional-compile-remove(video-background-effects) */\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.\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.\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\n/* @conditional-compile-remove(video-background-effects) */ /* @conditional-compile-remove(optimal-video-count) */\nimport { Features } from '@azure/communication-calling';\n/**\n * @private\n */\nexport function convertSdkLocalStreamToDeclarativeLocalStream(stream) {\n /* @conditional-compile-remove(video-background-effects) */\n const localVideoStreamEffectsAPI = stream.feature(Features.VideoEffects);\n return {\n source: stream.source,\n mediaStreamType: stream.mediaStreamType,\n view: undefined,\n /* @conditional-compile-remove(video-background-effects) */\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 view: undefined,\n /* @conditional-compile-remove(pinned-participants) */\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 /* @conditional-compile-remove(raise-hand) */\n raisedHand: 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 return {\n id: call.id,\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 /* @conditional-compile-remove(raise-hand) */\n raiseHand: {\n raisedHands: []\n },\n transcription: {\n isTranscriptionActive: false\n },\n screenShareRemoteParticipant: undefined,\n startTime: new Date(),\n endTime: undefined,\n /* @conditional-compile-remove(close-captions) */\n captionsFeature: {\n captions: [],\n supportedSpokenLanguages: [],\n supportedCaptionLanguages: [],\n currentCaptionLanguage: '',\n currentSpokenLanguage: '',\n isCaptionsFeatureActive: false,\n startCaptionsInProgress: false\n },\n /* @conditional-compile-remove(optimal-video-count) */\n optimalVideoCount: {\n maxRemoteVideoStreams: call.feature(Features.OptimalVideoCount).optimalVideoCount\n }\n };\n}\n/**\n * @private\n */\nexport function convertSdkIncomingCallToDeclarativeIncomingCall(call) {\n return {\n id: call.id,\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/* @conditional-compile-remove(close-captions) */\n/**\n * @private\n */\nexport function convertFromSDKToCaptionInfoState(caption) {\n return Object.assign({}, caption);\n}\n/* @conditional-compile-remove(video-background-effects) */\n/** @private */\nexport function convertFromSDKToDeclarativeVideoStreamVideoEffects(videoEffects) {\n return {\n activeEffects: videoEffects\n };\n}\n/* @conditional-compile-remove(raise-hand) */\n/**\n * @private\n */\nexport function convertFromSDKToRaisedHandState(raisedHand) {\n return {\n raisedHandOrderPosition: raisedHand.order\n };\n}\n//# sourceMappingURL=Converter.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 { 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';\n/* @conditional-compile-remove(close-captions) */\nimport { convertFromSDKToCaptionInfoState } from './Converter';\n/* @conditional-compile-remove(raise-hand) */\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 class CallContext {\n constructor(userId, maxListeners = 50) {\n this._callIdHistory = new CallIdHistory();\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 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 /* @conditional-compile-remove(optimal-video-count) */\n existingCall.optimalVideoCount.maxRemoteVideoStreams = call.optimalVideoCount.maxRemoteVideoStreams;\n existingCall.recording.isRecordingActive = call.recording.isRecordingActive;\n /* @conditional-compile-remove(raise-hand) */\n existingCall.raiseHand.raisedHands = call.raiseHand.raisedHands;\n /* @conditional-compile-remove(raise-hand) */\n existingCall.raiseHand.localParticipantRaisedHand = call.raiseHand.localParticipantRaisedHand;\n // We don't update the startTime and endTime if we are updating an existing active call\n /* @conditional-compile-remove(close-captions) */\n existingCall.captionsFeature.currentSpokenLanguage = call.captionsFeature.currentSpokenLanguage;\n /* @conditional-compile-remove(close-captions) */\n existingCall.captionsFeature.currentCaptionLanguage = call.captionsFeature.currentCaptionLanguage;\n }\n else {\n draft.calls[latestCallId] = call;\n }\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 delete draft.callsEnded[findOldestCallEnded(draft.callsEnded)];\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 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, streams) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n call.localVideoStreams = streams;\n }\n });\n }\n /* @conditional-compile-remove(video-background-effects) */\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 /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(capabilities) */\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 /* @conditional-compile-remove(raise-hand) */\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 /* @conditional-compile-remove(raise-hand) */\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 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 /* @conditional-compile-remove(capabilities) */\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 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, view) {\n this.modifyState((draft) => {\n const call = draft.calls[this._callIdHistory.latestCallId(callId)];\n if (call) {\n if (call.localVideoStreams.length > 0) {\n call.localVideoStreams[0].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 /* @conditional-compile-remove(optimal-video-count) */\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 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.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 /* @conditional-compile-remove(pinned-participants) */\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 }\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 delete draft.incomingCallsEnded[findOldestCallEnded(draft.incomingCallsEnded)];\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.source.id === localVideoStream.source.id && stream.mediaStreamType === localVideoStream.mediaStreamType);\n if (foundIndex !== -1) {\n draft.deviceManager.unparentedViews.splice(foundIndex, 1);\n }\n });\n }\n /* @conditional-compile-remove(video-background-effects) */\n setDeviceManagerUnparentedViewVideoEffects(localVideoStream, videoEffects) {\n this.modifyState((draft) => {\n const foundIndex = draft.deviceManager.unparentedViews.findIndex(stream => stream.source.id === localVideoStream.source.id && stream.mediaStreamType === localVideoStream.mediaStreamType);\n if (foundIndex !== -1) {\n draft.deviceManager.unparentedViews[foundIndex].videoEffects = videoEffects;\n }\n });\n }\n getAndIncrementAtomicId() {\n const id = this._atomicId;\n this._atomicId++;\n return id;\n }\n /* @conditional-compile-remove(close-captions) */\n processNewCaption(captions, newCaption) {\n // going through current captions to find the last caption said by the same speaker, remove that caption if it's partial and replace with the new caption\n for (let index = captions.length - 1; index >= 0; index--) {\n const currentCaption = captions[index];\n if (currentCaption && currentCaption.resultType !== 'Final' && currentCaption.speaker.identifier && newCaption.speaker.identifier && toFlatCommunicationIdentifier(currentCaption.speaker.identifier) === toFlatCommunicationIdentifier(newCaption.speaker.identifier)) {\n captions.splice(index, 1);\n break;\n }\n }\n captions.push(newCaption);\n // If the array length exceeds 50, remove the oldest caption\n if (captions.length > 50) {\n captions.shift();\n }\n }\n /* @conditional-compile-remove(close-captions) */\n addCaption(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, convertFromSDKToCaptionInfoState(caption));\n }\n }\n });\n }\n /* @conditional-compile-remove(close-captions) */\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 /* @conditional-compile-remove(close-captions) */\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 /* @conditional-compile-remove(close-captions) */\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 /* @conditional-compile-remove(close-captions) */\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 /* @conditional-compile-remove(close-captions) */\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 /* @conditional-compile-remove(close-captions) */\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 /* @conditional-compile-remove(close-captions) */\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 /**\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 let [oldestCallId, oldestCall] = callEntries[0];\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};\n//# sourceMappingURL=CallContext.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* @conditional-compile-remove(close-captions) */\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('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.addCaption(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//# sourceMappingURL=CaptionsSubscriber.js.map","// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/* @conditional-compile-remove(video-background-effects) */\nimport { convertFromSDKToDeclarativeVideoStreamVideoEffects } from './Converter';\n/* @conditional-compile-remove(video-background-effects) */\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 /* @conditional-compile-remove(pinned-participants) */\n this._remoteVideoStream.on('sizeChanged', this.isSizeChanged);\n this.checkAndUpdateScreenShareState();\n };\n this.unsubscribe = () => {\n this._remoteVideoStream.off('isAvailableChanged', this.isAvailableChanged);\n /* @conditional-compile-remove(pinned-participants) */\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 /* @conditional-compile-remove(pinned-participants) */\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 streamId = 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,\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, streamId) : internalContext.getLocalRenderInfo(callId);\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, streamId, renderInfo.stream, 'Rendering', renderInfo.renderer);\n }\n else if (streamEventType === 'createViewLocal') {\n _logStreamEvent(EventNames.STREAM_STOPPING, streamLogInfo);\n internalContext.setLocalRenderInfo(callId, renderInfo.stream, 'Rendering', renderInfo.renderer);\n }\n return;\n }\n const renderer = new VideoStreamRenderer(renderInfo.stream);\n streamEventType === 'createViewRemote' && participantKey ? internalContext.setRemoteRenderInfo(callId, participantKey, streamId, renderInfo.stream, 'Rendering', undefined) : internalContext.setLocalRenderInfo(callId, 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, streamId, renderInfo.stream, 'NotRendered', undefined);\n }\n else if (streamEventType === 'createViewLocal') {\n _logStreamEvent(EventNames.CREATE_STREAM_FAIL, streamLogInfo, e);\n internalContext.setLocalRenderInfo(callId, 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, streamId) : internalContext.getLocalRenderInfo(callId);\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, streamId, undefined) : context.setLocalVideoStreamRendererView(callId, 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, streamId, refreshedRenderInfo.stream, 'NotRendered', undefined);\n context.setRemoteVideoStreamRendererView(callId, participantKey, streamId, undefined);\n }\n else if (streamEventType === 'createViewLocal') {\n internalContext.setLocalRenderInfo(callId, refreshedRenderInfo.stream, 'NotRendered', undefined);\n context.setLocalVideoStreamRendererView(callId, 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, streamId, refreshedRenderInfo.stream, 'Rendered', renderer);\n context.setRemoteVideoStreamRendererView(callId, participantKey, streamId, convertFromSDKToDeclarativeVideoStreamRendererView(view));\n _logStreamEvent(EventNames.VIEW_RENDER_SUCCEED, streamLogInfo);\n }\n else if (streamEventType === 'createViewLocal') {\n internalContext.setLocalRenderInfo(callId, refreshedRenderInfo.stream, 'Rendered', renderer);\n context.setLocalVideoStreamRendererView(callId, 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 streamId = 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,\n streamType\n };\n _logStreamEvent(EventNames.START_DISPOSE_STREAM, streamLogInfo);\n if (streamEventType === 'disposeViewRemote' && participantKey) {\n context.setRemoteVideoStreamRendererView(callId, participantKey, streamId, undefined);\n }\n const renderInfo = streamEventType === 'disposeViewRemote' && participantKey ? internalContext.getRemoteRenderInfoForParticipant(callId, participantKey, streamId) : internalContext.getLocalRenderInfo(callId);\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, streamId, renderInfo.stream, 'Stopping', undefined) : internalContext.setLocalRenderInfo(callId, 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, streamId, renderInfo.stream, 'NotRendered', undefined);\n }\n else if (streamEventType === 'disposeViewLocal') {\n internalContext.setLocalRenderInfo(callId, renderInfo.stream, 'NotRendered', undefined);\n context.setLocalVideoStreamRendererView(callId, 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 callStreams = internalContext.getRemoteRenderInfoForCall(callId);\n if (callStreams) {\n for (const [participantKey, participantStreams] of callStreams.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 localStreamAndRenderer = internalContext.getLocalRenderInfo(callId);\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 * @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 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 // 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.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.\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.\n/* @conditional-compile-remove(raise-hand) */\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\n/* @conditional-compile-remove(raise-hand) */\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/* @conditional-compile-remove(optimal-video-count) */\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/* @conditional-compile-remove(capabilities) */\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 };\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.\nimport { Features } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from \"../../acs-ui-common/src\";\n/* @conditional-compile-remove(close-captions) */\nimport { CaptionsSubscriber } from './CaptionsSubscriber';\nimport { convertSdkLocalStreamToDeclarativeLocalStream, convertSdkParticipantToDeclarativeParticipant } from './Converter';\n/* @conditional-compile-remove(video-background-effects) */\nimport { LocalVideoStreamVideoEffectsSubscriber } from './LocalVideoStreamVideoEffectsSubscriber';\nimport { ParticipantSubscriber } from './ParticipantSubscriber';\nimport { RecordingSubscriber } from './RecordingSubscriber';\nimport { disposeView } from './StreamUtils';\nimport { TranscriptionSubscriber } from './TranscriptionSubscriber';\nimport { UserFacingDiagnosticsSubscriber } from './UserFacingDiagnosticsSubscriber';\n/* @conditional-compile-remove(raise-hand) */\nimport { RaiseHandSubscriber } from './RaiseHandSubscriber';\n/* @conditional-compile-remove(optimal-video-count) */\nimport { OptimalVideoCountSubscriber } from './OptimalVideoCountSubscriber';\n/* @conditional-compile-remove(capabilities) */\nimport { CapabilitiesSubscriber } from './CapabilitiesSubscriber';\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.subscribe = () => {\n this._call.on('stateChanged', this.stateChanged);\n /* @conditional-compile-remove(close-captions) */\n this._call.on('stateChanged', this.initCaptionSubscriber);\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 /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(capabilities) */\n this._call.on('roleChanged', this.callRoleChangedHandler);\n this._call.feature(Features.DominantSpeakers).on('dominantSpeakersChanged', this.dominantSpeakersChanged);\n // At time of writing only one LocalVideoStream is supported by SDK.\n if (this._call.localVideoStreams.length > 0) {\n this._internalContext.setLocalRenderInfo(this._callIdRef.callId, this._call.localVideoStreams[0], '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;\n this._call.off('stateChanged', this.stateChanged);\n /* @conditional-compile-remove(close-captions) */\n this._call.off('stateChanged', this.initCaptionSubscriber);\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 /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(capabilities) */\n this._call.off('roleChanged', this.callRoleChangedHandler);\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 if (this._call.localVideoStreams && this._call.localVideoStreams[0]) {\n disposeView(this._context, this._internalContext, this._callIdRef.callId, undefined, convertSdkLocalStreamToDeclarativeLocalStream(this._call.localVideoStreams[0]));\n }\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId);\n this._diagnosticsSubscriber.unsubscribe();\n this._recordingSubscriber.unsubscribe();\n this._transcriptionSubscriber.unsubscribe();\n /* @conditional-compile-remove(optimal-video-count) */\n this._optimalVideoCountSubscriber.unsubscribe();\n /* @conditional-compile-remove(close-captions) */\n (_a = this._captionsSubscriber) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n /* @conditional-compile-remove(raise-hand) */\n (_b = this._raiseHandSubscriber) === null || _b === void 0 ? void 0 : _b.unsubscribe();\n /* @conditional-compile-remove(capabilities) */\n this._capabilitiesSubscriber.unsubscribe();\n };\n this.stateChanged = () => {\n this._context.setCallState(this._callIdRef.callId, this._call.state);\n };\n /* @conditional-compile-remove(close-captions) */\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._captionsSubscriber) {\n if (this._call.feature(Features.Captions).captions.kind === 'TeamsCaptions') {\n this._captionsSubscriber = new CaptionsSubscriber(this._callIdRef, this._context, this._call.feature(Features.Captions).captions);\n this._call.off('stateChanged', this.initCaptionSubscriber);\n }\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 /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(capabilities) */\n this.callRoleChangedHandler = () => {\n this._context.setRole(this._callIdRef.callId, this._call.role);\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 // Exclude screenshare streams from added local video streams\n const addedLocalVideoStreamsExcludingScreenShare = event.added.filter(localVideoStream => localVideoStream.mediaStreamType !== 'ScreenSharing');\n // At time of writing only one LocalVideoStream is supported by SDK.\n if (addedLocalVideoStreamsExcludingScreenShare.length > 0) {\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, addedLocalVideoStreamsExcludingScreenShare[0], 'NotRendered', undefined);\n const currentLocalVideoStreams = this._call.localVideoStreams;\n const localVideoStreams = addedLocalVideoStreamsExcludingScreenShare.concat(currentLocalVideoStreams).map(stream => convertSdkLocalStreamToDeclarativeLocalStream(stream));\n this._context.setCallLocalVideoStream(this._callIdRef.callId, localVideoStreams);\n /* @conditional-compile-remove(video-background-effects) */\n {\n // Subscribe to video effect changes\n const localVideoStreamKey = event.added[0].source.id;\n (_a = this._localVideoStreamVideoEffectsSubscribers.get(localVideoStreamKey)) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n this._localVideoStreamVideoEffectsSubscribers.set(localVideoStreamKey, new LocalVideoStreamVideoEffectsSubscriber({\n parent: this._callIdRef,\n context: this._context,\n localVideoStream: this._call.localVideoStreams[0],\n localVideoStreamEffectsAPI: this._call.localVideoStreams[0].feature(Features.VideoEffects)\n }));\n }\n }\n if (event.removed.length > 0) {\n /* @conditional-compile-remove(video-background-effects) */\n {\n const localVideoStreamKey = event.removed[0].source.id;\n (_b = this._localVideoStreamVideoEffectsSubscribers.get(localVideoStreamKey)) === null || _b === void 0 ? void 0 : _b.unsubscribe();\n }\n disposeView(this._context, this._internalContext, this._callIdRef.callId, undefined, convertSdkLocalStreamToDeclarativeLocalStream(event.removed[0]));\n /**\n * This check is to make sure that we are not deleting the local render info for the local video stream if there is one.\n *\n * TODO: we need to make sure the we are supporting the local screenshare stream that is now being tracked. This is a stop gap solution.\n */\n if (event.removed[0].mediaStreamType === 'ScreenSharing') {\n return;\n }\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId);\n this._context.setCallLocalVideoStream(this._callIdRef.callId, []);\n }\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._transcriptionSubscriber = new TranscriptionSubscriber(this._callIdRef, this._context, this._call.feature(Features.Transcription));\n /* @conditional-compile-remove(raise-hand) */\n this._raiseHandSubscriber = new RaiseHandSubscriber(this._callIdRef, this._context, this._call.feature(Features.RaiseHand));\n /* @conditional-compile-remove(optimal-video-count) */\n this._optimalVideoCountSubscriber = new OptimalVideoCountSubscriber({\n callIdRef: this._callIdRef,\n context: this._context,\n localOptimalVideoCountFeature: this._call.feature(Features.OptimalVideoCount)\n });\n /* @conditional-compile-remove(video-background-effects) */\n this._localVideoStreamVideoEffectsSubscribers = new Map();\n /* @conditional-compile-remove(capabilities) */\n this._capabilitiesSubscriber = new CapabilitiesSubscriber(this._callIdRef, this._context, this._call.feature(Features.Capabilities));\n this.subscribe();\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.\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.\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};\nimport { CallSubscriber } from './CallSubscriber';\nimport { convertSdkCallToDeclarativeCall, convertSdkIncomingCallToDeclarativeIncomingCall } from './Converter';\nimport { incomingCallDeclaratify } from './IncomingCallDeclarative';\nimport { IncomingCallSubscriber } from './IncomingCallSubscriber';\nimport { disposeAllViews, disposeAllViewsFromCall } from './StreamUtils';\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._declarativeIncomingCalls.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._declarativeIncomingCalls.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 this._declarativeIncomingCalls.set(incomingCall.id, incomingCallDeclaratify(incomingCall, this._context));\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._declarativeIncomingCalls = 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._declarativeIncomingCalls.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};\n/* @conditional-compile-remove(close-captions) */ /* @conditional-compile-remove(call-transfer) */\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 /* @conditional-compile-remove(close-captions) */\n if (args[0] === Features.Captions) {\n const captionsFeature = target.feature(Features.Captions).captions;\n const proxyFeature = new ProxyTeamsCaptions(this._context, target);\n return {\n captions: new Proxy(captionsFeature, proxyFeature)\n };\n }\n return target.feature(...args);\n }, 'Call.feature');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n/* @conditional-compile-remove(close-captions) */\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 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 }), '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//# 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';\n/* @conditional-compile-remove(video-background-effects) */\nimport { LocalVideoStreamVideoEffectsSubscriber } from './LocalVideoStreamVideoEffectsSubscriber';\n/* @conditional-compile-remove(video-background-effects) */\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 // The key is the stream ID. We assume each stream ID to only have one owning render info\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 /* @conditional-compile-remove(video-background-effects) */\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, stream, status, renderer) {\n this._localRenderInfos.set(this._callIdHistory.latestCallId(callId), {\n stream,\n status,\n renderer\n });\n }\n getLocalRenderInfo(callId) {\n return this._localRenderInfos.get(this._callIdHistory.latestCallId(callId));\n }\n deleteLocalRenderInfo(callId) {\n this._localRenderInfos.delete(this._callIdHistory.latestCallId(callId));\n }\n getUnparentedRenderInfo(localVideoStream) {\n return this._unparentedRenderInfos.get(localVideoStream.source.id);\n }\n getUnparentedRenderInfos() {\n return [...this._unparentedRenderInfos].map(([, renderInfo]) => renderInfo.stream);\n }\n setUnparentedRenderInfo(statefulStream, stream, status, renderer) {\n this._unparentedRenderInfos.set(statefulStream.source.id, {\n stream,\n status,\n renderer\n });\n }\n deleteUnparentedRenderInfo(localVideoStream) {\n var _a;\n /* @conditional-compile-remove(video-background-effects) */\n (_a = this._unparentedViewVideoEffectsSubscriber.get(localVideoStream.source.id)) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n this._unparentedRenderInfos.delete(localVideoStream.source.id);\n }\n subscribeToUnparentedViewVideoEffects(localVideoStream, callContext) {\n var _a;\n /* @conditional-compile-remove(video-background-effects) */\n {\n // Ensure we aren't setting multiple subscriptions\n (_a = this._unparentedViewVideoEffectsSubscriber.get(localVideoStream.source.id)) === null || _a === void 0 ? void 0 : _a.unsubscribe();\n this._unparentedViewVideoEffectsSubscriber.set(localVideoStream.source.id, 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.\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 } 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 { 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 Reflect.get(target, prop);\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 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 callingStatefulLogger.info(`Creating calling stateful client using library version: ${_getApplicationId()}`);\n return createStatefulCallClientWithDeps(new CallClient(withTelemetryTag(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 return new Proxy(callClient, new ProxyCallClient(context, internalContext));\n};\nconst withTelemetryTag = (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());\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 true;\n};\n/**\n * @internal\n */\nexport const _isACSCallAgent = (callAgent) => {\n return true;\n};\n/**\n * @internal\n */\nexport const _isTeamsCall = (call) => {\n return false;\n};\n/**\n * @internal\n */\nexport const _isTeamsCallAgent = (callAgent) => {\n return false;\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","unsubscribe","off","selectCamera","videoDeviceInfo","setDeviceManagerSelectedCamera","realCameras","getCameras","filter","c","name","setDeviceManagerCameras","dedupeById","setDeviceManagerMicrophones","getMicrophones","setDeviceManagerSpeakers","getSpeakers","get","target","prop","withAsyncErrorTeedToState","cameras","microphones","speakers","args","selectMicrophone","selectSpeaker","askDevicePermission","deviceAccess","setDeviceManagerDeviceAccess","Reflect","devices","ids","Set","uniqueDevices","forEach","device","has","id","push","add","CallError","Error","innerError","timestamp","super","Date","now","message","callingStatefulLogger","createClientLogger","EventNames","CallIdHistory","_callIdHistory","Map","updateCallIdHistory","newCallId","oldCallId","existing","undefined","latestCallId","console","trace","delete","set","callId","latest","newer","convertSdkLocalStreamToDeclarativeLocalStream","stream","localVideoStreamEffectsAPI","feature","Features","source","mediaStreamType","view","videoEffects","convertFromSDKToDeclarativeVideoStreamVideoEffects","activeEffects","convertSdkRemoteStreamToDeclarativeRemoteStream","isAvailable","streamSize","size","convertSdkParticipantToDeclarativeParticipant","participant","declarativeVideoStreams","videoStream","videoStreams","identifier","displayName","state","callEndReason","isMuted","isSpeaking","raisedHand","convertFromSDKToDeclarativeVideoStreamRendererView","scalingMode","isMirrored","convertFromSDKToRaisedHandState","raisedHandOrderPosition","order","CallContext","userId","maxListeners","teeErrorToState","error","callError","toCallError","setLatestError","_logger","_state","calls","callsEnded","incomingCalls","incomingCallsEnded","unparentedViews","callAgent","latestErrors","_emitter","setMaxListeners","_atomicId","getState","modifyState","modifier","priorState","patches","getLogLevel","info","emit","onStateChange","handler","offStateChange","clearCallRelatedState","draft","setCallAgent","setCall","call","existingCall","callerInfo","direction","isScreenSharingOn","localVideoStreams","remoteParticipants","transcription","isTranscriptionActive","optimalVideoCount","maxRemoteVideoStreams","recording","isRecordingActive","raiseHand","raisedHands","localParticipantRaisedHand","captionsFeature","currentSpokenLanguage","currentCaptionLanguage","removeCall","setCallEnded","endTime","Object","keys","length","findOldestCallEnded","setCallState","setCallId","setCallIsScreenSharingOn","setCallRemoteParticipants","addRemoteParticipant","removeRemoteParticipant","setCallRemoteParticipantsEnded","remoteParticipantsEnded","setCallLocalVideoStream","streams","setCallLocalVideoStreamVideoEffects","_a","find","i","setCallIsMicrophoneMuted","isMicrophoneMuted","setRole","role","setCallDominantSpeakers","dominantSpeakers","setCallRecordingActive","setCallRaisedHands","map","setParticipantIsRaisedHand","participantKey","setCallTranscriptionActive","setCapabilities","capabilities","capabilitiesChangeInfo","capabilitiesFeature","latestCapabilitiesChangeInfo","setCallScreenShareParticipant","screenShareRemoteParticipant","setLocalVideoStreamRendererView","setParticipantState","setParticipantIsMuted","muted","setOptimalVideoCount","setParticipantDisplayName","setParticipantIsSpeaking","setParticipantVideoStream","existingStream","setRemoteVideoStreamIsAvailable","streamId","setRemoteVideoStreamSize","setRemoteVideoStreams","addRemoteVideoStream","removeRemoteVideoStream","newStream","setRemoteVideoStreamRendererView","setRemoteVideoStreamViewScalingMode","setIncomingCall","removeIncomingCall","setIncomingCallEnded","selectedCamera","some","camera","setDeviceManagerUnparentedView","localVideoStream","deleteDeviceManagerUnparentedView","foundIndex","findIndex","splice","setDeviceManagerUnparentedViewVideoEffects","getAndIncrementAtomicId","processNewCaption","captions","newCaption","index","currentCaption","resultType","speaker","shift","addCaption","caption","captionLanguage","toUpperCase","assign","convertFromSDKToCaptionInfoState","clearCaptions","setIsCaptionActive","isCaptionsActive","isCaptionsFeatureActive","setStartCaptionsInProgress","startCaptionsInProgress","setSelectedSpokenLanguage","spokenLanguage","setSelectedCaptionLanguage","setAvailableCaptionLanguages","captionLanguages","supportedCaptionLanguages","setAvailableSpokenLanguages","spokenLanguages","supportedSpokenLanguages","action","withErrorTeedToState","_b","_c","_d","callEntries","entries","oldestCallId","oldestCall","slice","getTime","CaptionsSubscriber","callIdRef","_captions","isCaptionsActiveChanged","onCaptionsReceived","isCaptionLanguageChanged","isSpokenLanguageChanged","_callIdRef","activeCaptionLanguage","activeSpokenLanguage","LocalVideoStreamVideoEffectsSubscriber","_localVideoStreamEffectsAPI","effectsStarted","effectsStopped","effectsError","updateStatefulVideoEffects","statefulVideoEffects","_parent","_localVideoStream","parent","RemoteVideoStreamSubscriber","remoteVideoStream","_remoteVideoStream","isAvailableChanged","isSizeChanged","checkAndUpdateScreenShareState","includesActiveScreenShareStream","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","renderInfo","getRemoteRenderInfoForParticipant","getLocalRenderInfo","status","setRemoteRenderInfo","renderer","setLocalRenderInfo","VideoStreamRenderer","refreshedRenderInfo","dispose","createViewVideo","getUnparentedRenderInfo","warn","LocalVideoStream","setUnparentedRenderInfo","deleteUnparentedRenderInfo","subscribeToUnparentedViewVideoEffects","createViewUnparentedVideo","disposeView","disposeViewVideo","disposeViewUnparentedVideo","disposeAllViewsFromCall","callStreams","getRemoteRenderInfoForCall","participantStreams","_","remoteStreamAndRenderer","localStreamAndRenderer","ParticipantSubscriber","_participant","stateChanged","isMutedChanged","displayNameChanged","isSpeakingChanged","videoStreamsUpdated","_internalContext","addRemoteVideoStreamSubscriber","deleteRemoteRenderInfo","_remoteVideoStreamSubscribers","event","removed","added","RecordingSubscriber","_recording","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","CallSubscriber","_call","initCaptionSubscriber","idChanged","isScreenSharingOnChanged","remoteParticipantsUpdated","localVideoStreamsUpdated","isMuteChanged","callRoleChangedHandler","dominantSpeakersChanged","addParticipantListener","_participantSubscribers","participantSubscriber","clear","deleteLocalRenderInfo","_diagnosticsSubscriber","_recordingSubscriber","_transcriptionSubscriber","_optimalVideoCountSubscriber","_captionsSubscriber","_raiseHandSubscriber","_capabilitiesSubscriber","kind","removeParticipantListener","addedLocalVideoStreamsExcludingScreenShare","currentLocalVideoStreams","concat","localVideoStreamKey","_localVideoStreamVideoEffectsSubscribers","ProxyIncomingCall","accept","IncomingCallSubscriber","incomingCall","_incomingCall","callEnded","_setIncomingCallEnded","ProxyCallAgentCommon","unregisterSubscriber","callSubscriber","_callSubscribers","incomingCallSubscriber","_incomingCallSubscribers","_declarativeIncomingCalls","declarativeCall","_declarativeCalls","callsUpdated","addedStatefulCall","statefulCall","addCall","removedStatefulCall","callDeclaratify","externalCallsUpdatedListener","_externalCallsUpdatedListeners","incomingCallId","proxyIncomingCall","Proxy","incomingCallDeclaratify","startTime","declarativeRemoteParticipants","convertSdkCallToDeclarativeCall","getOrCreateDeclarativeCall","newDeclarativeCall","getCommon","startCall","joinCall","Array","from","listener","agentSubscribe","agentUnsubscribe","callAgentDisposeAsyncCallbackWrapper","callIds","getCallIds","disposeAllViews","ProxyCallCommon","getContext","mute","unmute","startVideo","stopVideo","startScreenSharing","stopScreenSharing","hold","resume","proxyFeature","ProxyTeamsCaptions","ret","startCaptions","stopCaptions","setSpokenLanguage","setCaptionLanguage","ProxyCall","addParticipant","ProxyCallAgent","_callAgent","proxyCall","defineProperty","configurable","agent","join","InternalCallContext","_remoteRenderInfos","_localRenderInfos","_unparentedRenderInfos","_unparentedViewVideoEffectsSubscriber","remoteRenderInfos","localRenderInfos","callRenderInfos","participantRenderInfos","getUnparentedRenderInfos","statefulStream","callContext","ProxyVideoStreamRendererView","_streamId","_callId","_participantId","updateScalingMode","ProxyCallClient","createCallAgent","callAgentDeclaratify","getDeviceManager","_sdkDeviceManager","proxyDeviceManager","deviceManagerDeclaratify","createStatefulCallClient","createStatefulCallClientWithDeps","CallClient","withTelemetryTag","callClientOptions","maxStateChangeListeners","callClient","participantIdKind","proxyVideoStreamRendererView","videoStreamRendererViewDeclaratify","tags","_isACSCall","_isACSCallAgent","_isTeamsCall","_isTeamsCallAgent"],"sourceRoot":""}