@azure/communication-react 1.24.0-alpha-202502040016 → 1.24.0-alpha-202502050016

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/dist/communication-react.d.ts +13 -3
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-AkTSmAsd.js → ChatMessageComponentAsRichTextEditBox-CeWY0AY6.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-AkTSmAsd.js.map → ChatMessageComponentAsRichTextEditBox-CeWY0AY6.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-B3Xe7mdR.js → RichTextSendBoxWrapper-ClpG1pEU.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-B3Xe7mdR.js.map → RichTextSendBoxWrapper-ClpG1pEU.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-CNpitKVB.js → index-k4-DEMHk.js} +171 -97
  7. package/dist/dist-cjs/communication-react/index-k4-DEMHk.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +1 -12
  12. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  13. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +7 -0
  14. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
  15. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js +35 -22
  16. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js.map +1 -1
  17. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +5 -1
  18. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  19. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +6 -2
  20. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +30 -9
  21. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  22. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +2 -0
  23. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  24. package/dist/dist-esm/react-components/src/components/NotificationStack.d.ts +5 -1
  25. package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/RaiseHandButton.js +2 -2
  27. package/dist/dist-esm/react-components/src/components/RaiseHandButton.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/components/ReactionButton.js +2 -2
  29. package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +1 -1
  30. package/dist/dist-esm/react-components/src/components/utils.js +2 -0
  31. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  32. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +5 -0
  33. package/dist/dist-esm/react-components/src/theming/icons.d.ts +1 -0
  34. package/dist/dist-esm/react-components/src/theming/icons.js +2 -0
  35. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +1 -0
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +26 -28
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js +8 -2
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js.map +1 -1
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +25 -1
  45. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +1 -1
  47. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +5 -6
  48. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  49. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +17 -6
  50. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  51. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +3 -1
  52. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  53. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -0
  54. package/package.json +2 -2
  55. package/dist/dist-cjs/communication-react/index-CNpitKVB.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/utils/Utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAuC,cAAc,EAAuB,MAAM,wBAAwB,CAAC;AAClH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,sDAA6C;AAGvG,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AActE,MAAM,oCAAoC,GAAG,IAAI,CAAC;AAClD,MAAM,wBAAwB,GAAG,MAAM,CAAC;AACxC,MAAM,2BAA2B,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,wBAAwB,CAAC,CAAC;AAC3E,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,0BAA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,CAAC;IAED,oIAAoI;IACpI,4FAA4F;IAC5F,IACE,kBAAkB;QAClB,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,eAAe,KAAK,SAAS;QACnE,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,mBAAmB,KAAK,SAAS;QACvE,IAAI,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,WAAW,GAAG,uCAAuC,EACtF,CAAC;QACD,6JAA6J;QAC7J,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,eAAe,GAAG,KAAK,CAAC;QAC9D,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACpE,CAAC;IAED,kEAAkE;IAClE,MAAM,OAAO,GAAG,cAAc,CAC5B,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,eAAe,EACrD,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,mBAAmB,CAC1D,CAAC;IAEF,+DAA+D;IAC/D,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO;YACL,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;SAChC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallAdapterState, CallCompositePage, END_CALL_PAGES, StartCallIdentifier } from '../adapter/CallAdapter';\nimport { _isInCall, _isPreviewOn, _isInLobbyOrConnecting } from '@internal/calling-component-bindings';\nimport { CallControlOptions } from '../types/CallControlOptions';\nimport { CallState, RemoteParticipantState } from '@internal/calling-stateful-client';\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { AdapterStateModifier, CallAdapterLocator } from '../adapter/AzureCommunicationCallAdapter';\n\nimport { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings';\n\nimport { VideoBackgroundEffect } from '../adapter/CallAdapter';\nimport { EnvironmentInfo, VideoDeviceInfo } from '@azure/communication-calling';\n\nimport { VideoEffectProcessor } from '@azure/communication-calling';\nimport { CompositeLocale } from '../../localization';\nimport { CallCompositeIcons } from '../../common/icons';\n\nimport { ActiveNotification } from '@internal/react-components';\n\nconst ACCESS_DENIED_TEAMS_MEETING_SUB_CODE = 5854;\nconst REMOTE_PSTN_USER_HUNG_UP = 560000;\nconst REMOVED_FROM_CALL_SUB_CODES = [5000, 5300, REMOTE_PSTN_USER_HUNG_UP];\nconst CALL_REJECTED_CODE = 603;\nconst INVALID_MEETING_IDENTIFIER = 5751;\n/** @private */\nexport const ROOM_NOT_FOUND_SUB_CODE = 5732;\n/** @private */\nexport const ROOM_NOT_VALID_SUB_CODE = 5829;\n/** @private */\nexport const NOT_INVITED_TO_ROOM_SUB_CODE = 5828;\n/** @private */\nexport const INVITE_TO_ROOM_REMOVED_SUB_CODE = 5317;\n/** @private */\nexport const CALL_TIMEOUT_SUB_CODE = 10004;\n/** @private */\nexport const CALL_TIMEOUT_CODE = 487;\n/** @private */\nexport const BOT_TIMEOUT_CODE = 486;\n/** @private */\nexport const BOT_TIMEOUT_SUB_CODE = 10321;\n\n/**\n * @private\n */\nexport const isCameraOn = (state: CallAdapterState): boolean => {\n if (state.call) {\n const stream = state.call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');\n return !!stream;\n } else {\n if (state.devices.selectedCamera) {\n const previewOn = _isPreviewOn(state.devices);\n return previewOn;\n }\n }\n return false;\n};\n\n/**\n * Reduce the set of call controls visible on mobile.\n * For example do not show screenshare button.\n *\n * @private\n */\nexport const reduceCallControlsForMobile = (\n callControlOptions: CallControlOptions | boolean | undefined\n): CallControlOptions | false => {\n if (callControlOptions === false) {\n return false;\n }\n\n // Ensure call controls a valid object.\n const reduceCallControlOptions = callControlOptions === true ? {} : callControlOptions || {};\n\n // Set to compressed mode when composite is optimized for mobile\n reduceCallControlOptions.displayType = 'compact';\n\n // Do not show screen share button when composite is optimized for mobile unless the developer\n // has explicitly opted in.\n if (reduceCallControlOptions.screenShareButton !== true) {\n reduceCallControlOptions.screenShareButton = false;\n }\n\n return reduceCallControlOptions;\n};\n\nenum CallEndReasons {\n LEFT_CALL,\n ACCESS_DENIED,\n REMOVED_FROM_CALL,\n BAD_REQUEST\n}\n\nconst getCallEndReason = (call: CallState): CallEndReasons => {\n const remoteParticipantsEndedArray = Array.from(Object.values(call.remoteParticipantsEnded));\n /**\n * Handle the special case in a PSTN call where removing the last user kicks the caller out of the call.\n * The code and subcode is the same as when a user is removed from a teams interop call.\n * Hence, we look at the last remote participant removed to determine if the last participant removed was a phone number.\n * If yes, the caller was kicked out of the call, but we need to show them that they left the call.\n * Note: This check will only work for 1:1 PSTN Calls. The subcode is different for 1:N PSTN calls, and we do not need to handle that case.\n */\n if (\n remoteParticipantsEndedArray[0] &&\n isPhoneNumberIdentifier(remoteParticipantsEndedArray[0].identifier) &&\n call.callEndReason?.subCode !== REMOTE_PSTN_USER_HUNG_UP\n ) {\n return CallEndReasons.LEFT_CALL;\n }\n\n if (call.callEndReason?.subCode && call.callEndReason.subCode === ACCESS_DENIED_TEAMS_MEETING_SUB_CODE) {\n return CallEndReasons.ACCESS_DENIED;\n }\n\n if (call.callEndReason?.subCode && REMOVED_FROM_CALL_SUB_CODES.includes(call.callEndReason.subCode)) {\n return CallEndReasons.REMOVED_FROM_CALL;\n }\n\n // If the call end reason code is 400, the call is ended due to a bad request. Keep this line at the bottom right before returning normal left call to catch the scenarios not including the ones above.\n if (call.callEndReason?.code === 400) {\n return CallEndReasons.BAD_REQUEST;\n }\n\n if (call.callEndReason) {\n // No error codes match, assume the user simply left the call regularly\n return CallEndReasons.LEFT_CALL;\n }\n\n throw new Error('No matching call end reason');\n};\n\n/**\n * Helper function for determine strings and icons for end call page\n * @private\n */\nexport const getEndedCallPageProps = (\n locale: CompositeLocale,\n endedCall?: CallState\n): { title: string; moreDetails?: string; disableStartCallButton: boolean; iconName: keyof CallCompositeIcons } => {\n let title = locale.strings.call.leftCallTitle;\n let moreDetails = locale.strings.call.leftCallMoreDetails;\n let disableStartCallButton = false;\n let iconName: keyof CallCompositeIcons = 'NoticePageLeftCall';\n switch (endedCall?.callEndReason?.subCode) {\n case ROOM_NOT_FOUND_SUB_CODE:\n if (locale.strings.call.roomNotFoundTitle) {\n title = locale.strings.call.roomNotFoundTitle;\n moreDetails = locale.strings.call.roomNotFoundDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageRoomNotFound';\n }\n break;\n case ROOM_NOT_VALID_SUB_CODE:\n if (locale.strings.call.roomNotValidTitle) {\n title = locale.strings.call.roomNotValidTitle;\n moreDetails = locale.strings.call.roomNotValidDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageRoomNotValid';\n }\n break;\n case NOT_INVITED_TO_ROOM_SUB_CODE:\n if (locale.strings.call.notInvitedToRoomTitle) {\n title = locale.strings.call.notInvitedToRoomTitle;\n moreDetails = locale.strings.call.notInvitedToRoomDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageNotInvitedToRoom';\n }\n break;\n case INVITE_TO_ROOM_REMOVED_SUB_CODE:\n if (locale.strings.call.inviteToRoomRemovedTitle) {\n title = locale.strings.call.inviteToRoomRemovedTitle;\n moreDetails = locale.strings.call.inviteToRoomRemovedDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageInviteToRoomRemoved';\n }\n break;\n case CALL_TIMEOUT_SUB_CODE:\n if (endedCall?.callEndReason?.code === CALL_TIMEOUT_CODE && locale.strings.call.callTimeoutTitle) {\n title = locale.strings.call.callTimeoutTitle;\n moreDetails = locale.strings.call.callTimeoutDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallTimeout';\n }\n break;\n case BOT_TIMEOUT_SUB_CODE:\n if (endedCall?.callEndReason?.code === BOT_TIMEOUT_CODE && locale.strings.call.callTimeoutBotTitle) {\n title = locale.strings.call.callTimeoutBotTitle;\n moreDetails = locale.strings.call.callTimeoutBotDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallTimeout';\n }\n break;\n }\n switch (endedCall?.callEndReason?.code) {\n case CALL_REJECTED_CODE:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n moreDetails = locale.strings.call.callRejectedMoreDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallRejected';\n }\n break;\n }\n switch (endedCall?.callEndReason?.subCode) {\n case 10037:\n if (locale.strings.call.participantCouldNotBeReachedTitle) {\n title = locale.strings.call.participantCouldNotBeReachedTitle;\n moreDetails = locale.strings.call.participantCouldNotBeReachedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10124:\n if (locale.strings.call.permissionToReachTargetParticipantNotAllowedTitle) {\n title = locale.strings.call.permissionToReachTargetParticipantNotAllowedTitle;\n moreDetails = locale.strings.call.permissionToReachTargetParticipantNotAllowedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10119:\n if (locale.strings.call.unableToResolveTenantTitle) {\n title = locale.strings.call.unableToResolveTenantTitle;\n moreDetails = locale.strings.call.unableToResolveTenantMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10044:\n if (locale.strings.call.participantIdIsMalformedTitle) {\n title = locale.strings.call.participantIdIsMalformedTitle;\n moreDetails = locale.strings.call.participantIdIsMalformedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n }\n switch (endedCall?.callEndReason?.subCode) {\n case INVALID_MEETING_IDENTIFIER:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n moreDetails = locale.strings.call.invalidMeetingIdentifier;\n disableStartCallButton = true;\n }\n break;\n }\n // keep this at the bottom to catch the scenarios not including the ones above.\n switch (endedCall?.callEndReason?.code) {\n case 400:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n disableStartCallButton = true;\n }\n break;\n }\n return { title, moreDetails, disableStartCallButton, iconName };\n};\n\n/**\n * type definition for conditional-compilation\n */\ntype GetCallCompositePageFunction = ((\n call: CallState | undefined,\n previousCall: CallState | undefined\n) => CallCompositePage) &\n ((\n call: CallState | undefined,\n previousCall: CallState | undefined,\n transferCall?: CallState,\n originCall?: CallState,\n /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserInfo?: {\n environmentInfo?: EnvironmentInfo;\n unsupportedBrowserVersionOptedIn?: boolean;\n }\n ) => CallCompositePage);\n/**\n * Get the current call composite page based on the current call composite state\n *\n * @param Call - The current call state\n * @param previousCall - The state of the most recent previous call that has ended.\n *\n * @remarks - The previousCall state is needed to determine if the call has ended.\n * When the call ends a new call object is created, and so we must lookback at the\n * previous call state to understand how the call has ended. If there is no previous\n * call we know that this is a fresh call and can display the configuration page.\n *\n * @private\n */\nexport const getCallCompositePage: GetCallCompositePageFunction = (\n call,\n previousCall?,\n transferCall?: CallState,\n originCall?: CallState,\n unsupportedBrowserInfo?: {\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo?: EnvironmentInfo;\n unsupportedBrowserVersionOptedIn?: boolean;\n }\n): CallCompositePage => {\n /* @conditional-compile-remove(unsupported-browser) */\n if (\n isUnsupportedEnvironment(\n unsupportedBrowserInfo?.environmentInfo,\n unsupportedBrowserInfo?.unsupportedBrowserVersionOptedIn\n )\n ) {\n return 'unsupportedEnvironment';\n }\n\n if (transferCall !== undefined) {\n return 'transferring';\n }\n\n if (call) {\n // Must check for ongoing call *before* looking at any previous calls.\n // If the composite completes one call and joins another, the previous calls\n // will be populated, but not relevant for determining the page.\n\n // `_isInLobbyOrConnecting` needs to be checked first because `_isInCall` also returns true when call is in lobby.\n if (_isInLobbyOrConnecting(call?.state)) {\n return 'lobby';\n // `LocalHold` needs to be checked before `isInCall` since it is also a state that's considered in call.\n } else if (call?.state === 'LocalHold') {\n return 'hold';\n } else if (call?.state === 'Disconnecting') {\n return 'leaving';\n } else if (_isInCall(call?.state)) {\n return 'call';\n } else {\n // When the call object has been constructed after clicking , but before 'connecting' has been\n // set on the call object, we continue to show the configuration screen.\n // The call object does not correctly reflect local device state until `call.state` moves to `connecting`.\n // Moving to the 'lobby' page too soon leads to components that depend on the `call` object to show incorrect\n // transitional state.\n return 'configuration';\n }\n }\n\n // /* @conditional-compile-remove(breakout-rooms) */\n if (previousCall?.breakoutRooms?.breakoutRoomOriginCallId && originCall) {\n return 'call';\n }\n\n if (previousCall) {\n const reason = getCallEndReason(previousCall);\n switch (reason) {\n case CallEndReasons.ACCESS_DENIED:\n return 'accessDeniedTeamsMeeting';\n case CallEndReasons.REMOVED_FROM_CALL:\n return 'removedFromCall';\n case CallEndReasons.BAD_REQUEST:\n return 'badRequest';\n case CallEndReasons.LEFT_CALL:\n if (previousCall.diagnostics.network.latest.noNetwork) {\n return 'joinCallFailedDueToNoNetwork';\n }\n return 'leftCall';\n }\n }\n\n // No call state - show starting page (configuration)\n return 'configuration';\n};\n\n/** @private */\nexport const IsCallEndedPage = (\n /**\n * Explicitly listing the pages of this function intentionally.\n * This protects against adding a new composite page that should be marked as an callEndedPage.\n * EndCallPages are used to trigger onCallEnded events so this could easily be missed.\n * When you add a new composite page this will throw a compiler error. If this new page is an\n * EndCallPage ensure you update the END_CALL_PAGES. Afterwards update the `page` parameter\n * type below to allow your new page, i.e. add `| <your new page>\n */\n page: CallCompositePage\n): boolean => END_CALL_PAGES.includes(page);\n\n/**\n * Creates a new call control options object and sets the correct values for disabling\n * the buttons provided in the `disabledControls` array.\n * Returns a new object without changing the original object.\n * @param callControlOptions options for the call control component that need to be modified.\n * @param disabledControls An array of controls to disable.\n * @returns a copy of callControlOptions with disabledControls disabled\n * @private\n */\nexport const disableCallControls = (\n callControlOptions: CallControlOptions | boolean | undefined,\n disabledControls: (keyof CallControlOptions)[]\n): CallControlOptions | boolean | undefined => {\n if (callControlOptions === false) {\n return false;\n }\n // Ensure we clone the prop if it is an object to ensure we do not mutate the original prop.\n let newOptions: CallControlOptions | boolean | undefined =\n (callControlOptions instanceof Object ? ({ ...callControlOptions } as CallControlOptions) : callControlOptions) ??\n ({} as Partial<CallControlOptions>);\n if (newOptions === true || newOptions === undefined) {\n newOptions = disabledControls.reduce((acc, key) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error TODO: fix noImplicitAny error here\n // Not solveable at this time due to typescript limitations. The typing is too complex for typescript to\n // understand. Will need to revisit when either typescript or the calling component bindings are updated.\n acc[key] = { disabled: true };\n return acc;\n }, {} as Partial<CallControlOptions>);\n } else {\n disabledControls.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error refer to above comment\n if (newOptions[key] !== false) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error refer to above comment\n newOptions[key] = { disabled: true };\n }\n });\n }\n return newOptions;\n};\n\n/**\n * Check if a disabled object is provided for a button and returns if the button is disabled.\n * A button is only disabled if is explicitly set to disabled.\n *\n * @param option\n * @returns whether a button is disabled\n * @private\n */\nexport const isDisabled = (option: boolean | { disabled: boolean } | undefined): boolean => {\n if (option === undefined || typeof option === 'boolean') {\n return false;\n }\n\n return option.disabled;\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * @returns Permissions state for the camera.\n */\nconst queryCameraPermissionFromPermissionsAPI = async (): Promise<PermissionState | 'unsupported'> => {\n try {\n return (await navigator.permissions.query({ name: 'camera' as PermissionName })).state;\n } catch (e) {\n console.info('permissions API is not supported by browser', e);\n return 'unsupported';\n }\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * @returns Permissions state for the microphone.\n */\nconst queryMicrophonePermissionFromPermissionsAPI = async (): Promise<PermissionState | 'unsupported'> => {\n try {\n return (await navigator.permissions.query({ name: 'microphone' as PermissionName })).state;\n } catch (e) {\n console.info('permissions API is not supported by browser', e);\n return 'unsupported';\n }\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n *\n * This function uses permission API to determine if device permission state is granted, prompt or denied\n * @returns whether device permission state is granted, prompt or denied\n * If permission API is not supported on this browser, permission state is set to unsupported.\n * @private\n */\nexport const getDevicePermissionState = async (\n setVideoState: (state: PermissionState | 'unsupported') => void,\n setAudioState: (state: PermissionState | 'unsupported') => void\n): Promise<void> => {\n const [cameraResult, microphoneResult] = await Promise.all([\n queryCameraPermissionFromPermissionsAPI(),\n queryMicrophonePermissionFromPermissionsAPI()\n ]);\n setVideoState(cameraResult);\n setAudioState(microphoneResult);\n};\n/* @conditional-compile-remove(unsupported-browser) */\nconst isUnsupportedEnvironment = (\n environmentInfo?: EnvironmentInfo,\n unsupportedBrowserVersionOptedIn?: boolean\n): boolean => {\n return !!(\n environmentInfo?.isSupportedBrowser === false ||\n (environmentInfo?.isSupportedBrowserVersion === false && !unsupportedBrowserVersionOptedIn) ||\n environmentInfo?.isSupportedPlatform === false\n );\n};\n\n/**\n * Check if we are using safari browser\n * @private\n */\nexport const _isSafari = (environmentInfo: undefined | EnvironmentInfo): boolean => {\n return environmentInfo?.environment.browser.toLowerCase() === 'safari';\n};\n\n/**\n * @private\n * This is the util function to create a participant modifier for remote participantList\n * It memoize previous original participant items and only update the changed participant\n * It takes in one modifier function to generate one single participant object, it returns undefined if the object keeps unmodified\n */\nexport const createParticipantModifier = (\n createModifiedParticipant: (id: string, participant: RemoteParticipantState) => RemoteParticipantState | undefined\n): AdapterStateModifier => {\n let previousParticipantState:\n | {\n [keys: string]: RemoteParticipantState;\n }\n | undefined = undefined;\n let modifiedParticipants: {\n [keys: string]: RemoteParticipantState;\n } = {};\n const memoizedParticipants: {\n [id: string]: { originalRef: RemoteParticipantState; newParticipant: RemoteParticipantState };\n } = {};\n\n return (state: CallAdapterState) => {\n // if root state is the same, we don't need to update the participants\n if (state.call?.remoteParticipants !== previousParticipantState) {\n modifiedParticipants = {};\n const originalParticipants = Object.entries(state.call?.remoteParticipants || {});\n for (const [key, originalParticipant] of originalParticipants) {\n const modifiedParticipant = createModifiedParticipant(key, originalParticipant);\n if (modifiedParticipant === undefined) {\n modifiedParticipants[key] = originalParticipant;\n continue;\n }\n // Generate the new item if original cached item has been changed\n if (memoizedParticipants[key]?.originalRef !== originalParticipant) {\n memoizedParticipants[key] = {\n newParticipant: modifiedParticipant,\n originalRef: originalParticipant\n };\n }\n\n // the modified participant is always coming from the memoized cache, whether is was refreshed\n // from the previous closure or not\n const memoizedParticipant = memoizedParticipants[key];\n if (!memoizedParticipant) {\n throw new Error('Participant modifier encountered an unhandled exception.');\n }\n\n modifiedParticipants[key] = memoizedParticipant.newParticipant;\n }\n\n previousParticipantState = state.call?.remoteParticipants;\n }\n return {\n ...state,\n call: state.call\n ? {\n ...state.call,\n remoteParticipants: modifiedParticipants\n }\n : undefined\n };\n };\n};\n\n/** @private */\nexport const getBackgroundEffectFromSelectedEffect = (\n selectedEffect: VideoBackgroundEffect | undefined,\n VideoBackgroundEffectsDependency: VideoBackgroundEffectsDependency\n): VideoEffectProcessor | undefined =>\n selectedEffect?.effectName === 'blur'\n ? VideoBackgroundEffectsDependency.createBackgroundBlurEffect()\n : selectedEffect?.effectName === 'replacement'\n ? VideoBackgroundEffectsDependency.createBackgroundReplacementEffect({\n backgroundImageUrl: selectedEffect.backgroundImageUrl\n })\n : undefined;\n\n/**\n * @remarks this logic should mimic the onToggleCamera in the common call handlers.\n * @private\n */\nexport const getSelectedCameraFromAdapterState = (state: CallAdapterState): VideoDeviceInfo | undefined =>\n state.devices.selectedCamera || state.devices.cameras[0];\n\n/**\n * Helper to determine if the adapter has a locator or targetCallees\n * @param locatorOrTargetCallees\n * @returns boolean to determine if the adapter has a locator or targetCallees, true is locator, false is targetCallees\n * @private\n */\nexport const getLocatorOrTargetCallees = (\n locatorOrTargetCallees: CallAdapterLocator | StartCallIdentifier[]\n): locatorOrTargetCallees is StartCallIdentifier[] => {\n return !!Array.isArray(locatorOrTargetCallees);\n};\n\n/**\n * @private\n */\nexport type ComplianceState = 'on' | 'off' | 'stopped';\n\n/**\n * Return different conditions based on the current and previous state of recording and transcribing\n *\n * @param callRecordState - The current call record state: on, off, stopped\n * @param callTranscribeState - The current call transcribe state: on, off, stopped\n *\n * @remarks - The stopped state means: previously on but currently off\n *\n * @private\n */\nexport const computeVariant = (\n callRecordState: ComplianceState,\n callTranscribeState: ComplianceState\n): ComplianceNotificationVariant => {\n if (callRecordState === 'on' && callTranscribeState === 'on') {\n return 'recordingAndTranscriptionStarted';\n } else if (callRecordState === 'on' && callTranscribeState === 'off') {\n return 'recordingStarted';\n } else if (callRecordState === 'off' && callTranscribeState === 'on') {\n return 'transcriptionStarted';\n } else if (callRecordState === 'on' && callTranscribeState === 'stopped') {\n return 'transcriptionStoppedStillRecording';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'on') {\n return 'recordingStoppedStillTranscribing';\n } else if (callRecordState === 'off' && callTranscribeState === 'stopped') {\n return 'transcriptionStopped';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'off') {\n return 'recordingStopped';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'stopped') {\n return 'recordingAndTranscriptionStopped';\n } else {\n return 'noState';\n }\n};\n\n/**\n * @private\n */\nexport type ComplianceNotificationVariant =\n | 'noState'\n | 'recordingStarted'\n | 'transcriptionStarted'\n | 'recordingStopped'\n | 'transcriptionStopped'\n | 'recordingAndTranscriptionStarted'\n | 'recordingAndTranscriptionStopped'\n | 'recordingStoppedStillTranscribing'\n | 'transcriptionStoppedStillRecording';\n\n/**\n * @private\n */\nexport type CachedComplianceNotificationProps = {\n latestBooleanState: {\n callTranscribeState?: boolean;\n callRecordState?: boolean;\n };\n latestStringState: {\n callTranscribeState: ComplianceState;\n callRecordState: ComplianceState;\n };\n // Timestamp for the last time cached state was updated.\n // Represented as milliseconds since epoch (i.e., the value returned by Date.now()).\n lastUpdated: number;\n};\n\n/**\n * @private\n */\nexport function determineStates(previous: ComplianceState, current: boolean | undefined): ComplianceState {\n // if current state is on, then return on\n if (current) {\n return 'on';\n }\n // if current state is off\n else {\n // if previous state is on and current state is off, return stopped (on -> off)\n if (previous === 'on') {\n return 'stopped';\n }\n // otherwise remain previous state unchanged\n else {\n return previous;\n }\n }\n}\n\n// The debounce time for the stopped state to be shown after both states are stopped.\n// This is to prevent stopped messages from being lost by transitioning to \"Off\" too\n// quickly if the states are toggled in quick succession.\n// This also prevents React strict mode from transitioning to \"Off\" too quickly.\nconst ComplianceNotificationOffDebounceTimeMs = 2000;\n\n/**\n * Compute compliance notification based on latest compliance state and cached props.\n * @private\n */\nexport function computeComplianceNotification(\n complianceProps: {\n callTranscribeState: boolean;\n callRecordState: boolean;\n },\n cachedProps: React.MutableRefObject<CachedComplianceNotificationProps>\n): ActiveNotification | undefined {\n // Only update cached props and variant if there is _some_ change in the latest props.\n // This ensures that state machine is only updated if there is an actual change in the props.\n const shouldUpdateCached =\n complianceProps.callRecordState !== cachedProps.current.latestBooleanState.callRecordState ||\n complianceProps.callTranscribeState !== cachedProps.current.latestBooleanState.callTranscribeState;\n\n // The following three operations must be performed in this exact order:\n\n // [1]: Update cached state to transition the state machine.\n if (shouldUpdateCached) {\n cachedProps.current = {\n latestBooleanState: complianceProps,\n latestStringState: {\n callRecordState: determineStates(\n cachedProps.current.latestStringState.callRecordState,\n complianceProps.callRecordState\n ),\n callTranscribeState: determineStates(\n cachedProps.current.latestStringState.callTranscribeState,\n complianceProps.callTranscribeState\n )\n },\n lastUpdated: Date.now()\n };\n }\n\n // [2]: If the callRecordState and callTranscribeState are both stopped for a predetermined amount of time, mark both states as off.\n // NOTE: this can be removed once lastStoppedRecording in the calling stateful client is GA.\n if (\n shouldUpdateCached &&\n cachedProps.current.latestStringState.callRecordState === 'stopped' &&\n cachedProps.current.latestStringState.callTranscribeState === 'stopped' &&\n Date.now() - cachedProps.current.lastUpdated > ComplianceNotificationOffDebounceTimeMs\n ) {\n // When both states are stopped, after displaying message \"RECORDING_AND_TRANSCRIPTION_STOPPED\", change both states to off (going back to the default state).\n cachedProps.current.latestStringState.callRecordState = 'off';\n cachedProps.current.latestStringState.callTranscribeState = 'off';\n }\n\n // [3]: Compute the variant, using the transitioned state machine.\n const variant = computeVariant(\n cachedProps.current.latestStringState.callRecordState,\n cachedProps.current.latestStringState.callTranscribeState\n );\n\n // If the variant is not 'noState', then show the notification.\n if (variant !== 'noState') {\n return {\n type: variant,\n timestamp: new Date(Date.now())\n };\n } else {\n return undefined;\n }\n}\n"]}
1
+ {"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/utils/Utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAuC,cAAc,EAAuB,MAAM,wBAAwB,CAAC;AAClH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,sDAA6C;AAGvG,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AActE,MAAM,oCAAoC,GAAG,IAAI,CAAC;AAClD,MAAM,wBAAwB,GAAG,MAAM,CAAC;AACxC,MAAM,2BAA2B,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,wBAAwB,CAAC,CAAC;AAC3E,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,0BAA0B,GAAG,IAAI,CAAC;AACxC,eAAe;AACf,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAC5C,eAAe;AACf,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAC5C,eAAe;AACf,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AACjD,eAAe;AACf,MAAM,CAAC,MAAM,+BAA+B,GAAG,IAAI,CAAC;AACpD,eAAe;AACf,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAC3C,eAAe;AACf,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AACrC,eAAe;AACf,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,eAAe;AACf,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,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AO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO;YACL,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;SAChC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallAdapterState, CallCompositePage, END_CALL_PAGES, StartCallIdentifier } from '../adapter/CallAdapter';\nimport { _isInCall, _isPreviewOn, _isInLobbyOrConnecting } from '@internal/calling-component-bindings';\nimport { CallControlOptions } from '../types/CallControlOptions';\nimport { CallState, RemoteParticipantState } from '@internal/calling-stateful-client';\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { AdapterStateModifier, CallAdapterLocator } from '../adapter/AzureCommunicationCallAdapter';\n\nimport { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings';\n\nimport { VideoBackgroundEffect } from '../adapter/CallAdapter';\nimport { EnvironmentInfo, VideoDeviceInfo } from '@azure/communication-calling';\n\nimport { VideoEffectProcessor } from '@azure/communication-calling';\nimport { CompositeLocale } from '../../localization';\nimport { CallCompositeIcons } from '../../common/icons';\n\nimport { ActiveNotification } from '@internal/react-components';\n\nconst ACCESS_DENIED_TEAMS_MEETING_SUB_CODE = 5854;\nconst REMOTE_PSTN_USER_HUNG_UP = 560000;\nconst REMOVED_FROM_CALL_SUB_CODES = [5000, 5300, REMOTE_PSTN_USER_HUNG_UP];\nconst CALL_REJECTED_CODE = 603;\nconst INVALID_MEETING_IDENTIFIER = 5751;\n/** @private */\nexport const ROOM_NOT_FOUND_SUB_CODE = 5732;\n/** @private */\nexport const ROOM_NOT_VALID_SUB_CODE = 5829;\n/** @private */\nexport const NOT_INVITED_TO_ROOM_SUB_CODE = 5828;\n/** @private */\nexport const INVITE_TO_ROOM_REMOVED_SUB_CODE = 5317;\n/** @private */\nexport const CALL_TIMEOUT_SUB_CODE = 10004;\n/** @private */\nexport const CALL_TIMEOUT_CODE = 487;\n/** @private */\nexport const BOT_TIMEOUT_CODE = 486;\n/** @private */\nexport const BOT_TIMEOUT_SUB_CODE = 10321;\n\n/**\n * @private\n */\nexport const isCameraOn = (state: CallAdapterState): boolean => {\n if (state.call) {\n const stream = state.call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');\n return !!stream;\n } else {\n if (state.devices.selectedCamera) {\n const previewOn = _isPreviewOn(state.devices);\n return previewOn;\n }\n }\n return false;\n};\n\n/**\n * Reduce the set of call controls visible on mobile.\n * For example do not show screenshare button.\n *\n * @private\n */\nexport const reduceCallControlsForMobile = (\n callControlOptions: CallControlOptions | boolean | undefined\n): CallControlOptions | false => {\n if (callControlOptions === false) {\n return false;\n }\n\n // Ensure call controls a valid object.\n const reduceCallControlOptions = callControlOptions === true ? {} : callControlOptions || {};\n\n // Set to compressed mode when composite is optimized for mobile\n reduceCallControlOptions.displayType = 'compact';\n\n // Do not show screen share button when composite is optimized for mobile unless the developer\n // has explicitly opted in.\n if (reduceCallControlOptions.screenShareButton !== true) {\n reduceCallControlOptions.screenShareButton = false;\n }\n\n return reduceCallControlOptions;\n};\n\nenum CallEndReasons {\n LEFT_CALL,\n ACCESS_DENIED,\n REMOVED_FROM_CALL,\n BAD_REQUEST\n}\n\nconst getCallEndReason = (call: CallState): CallEndReasons => {\n const remoteParticipantsEndedArray = Array.from(Object.values(call.remoteParticipantsEnded));\n /**\n * Handle the special case in a PSTN call where removing the last user kicks the caller out of the call.\n * The code and subcode is the same as when a user is removed from a teams interop call.\n * Hence, we look at the last remote participant removed to determine if the last participant removed was a phone number.\n * If yes, the caller was kicked out of the call, but we need to show them that they left the call.\n * Note: This check will only work for 1:1 PSTN Calls. The subcode is different for 1:N PSTN calls, and we do not need to handle that case.\n */\n if (\n remoteParticipantsEndedArray[0] &&\n isPhoneNumberIdentifier(remoteParticipantsEndedArray[0].identifier) &&\n call.callEndReason?.subCode !== REMOTE_PSTN_USER_HUNG_UP\n ) {\n return CallEndReasons.LEFT_CALL;\n }\n\n if (call.callEndReason?.subCode && call.callEndReason.subCode === ACCESS_DENIED_TEAMS_MEETING_SUB_CODE) {\n return CallEndReasons.ACCESS_DENIED;\n }\n\n if (call.callEndReason?.subCode && REMOVED_FROM_CALL_SUB_CODES.includes(call.callEndReason.subCode)) {\n return CallEndReasons.REMOVED_FROM_CALL;\n }\n\n // If the call end reason code is 400, the call is ended due to a bad request. Keep this line at the bottom right before returning normal left call to catch the scenarios not including the ones above.\n if (call.callEndReason?.code === 400) {\n return CallEndReasons.BAD_REQUEST;\n }\n\n if (call.callEndReason) {\n // No error codes match, assume the user simply left the call regularly\n return CallEndReasons.LEFT_CALL;\n }\n\n throw new Error('No matching call end reason');\n};\n\n/**\n * Helper function for determine strings and icons for end call page\n * @private\n */\nexport const getEndedCallPageProps = (\n locale: CompositeLocale,\n endedCall?: CallState\n): { title: string; moreDetails?: string; disableStartCallButton: boolean; iconName: keyof CallCompositeIcons } => {\n let title = locale.strings.call.leftCallTitle;\n let moreDetails = locale.strings.call.leftCallMoreDetails;\n let disableStartCallButton = false;\n let iconName: keyof CallCompositeIcons = 'NoticePageLeftCall';\n switch (endedCall?.callEndReason?.subCode) {\n case ROOM_NOT_FOUND_SUB_CODE:\n if (locale.strings.call.roomNotFoundTitle) {\n title = locale.strings.call.roomNotFoundTitle;\n moreDetails = locale.strings.call.roomNotFoundDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageRoomNotFound';\n }\n break;\n case ROOM_NOT_VALID_SUB_CODE:\n if (locale.strings.call.roomNotValidTitle) {\n title = locale.strings.call.roomNotValidTitle;\n moreDetails = locale.strings.call.roomNotValidDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageRoomNotValid';\n }\n break;\n case NOT_INVITED_TO_ROOM_SUB_CODE:\n if (locale.strings.call.notInvitedToRoomTitle) {\n title = locale.strings.call.notInvitedToRoomTitle;\n moreDetails = locale.strings.call.notInvitedToRoomDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageNotInvitedToRoom';\n }\n break;\n case INVITE_TO_ROOM_REMOVED_SUB_CODE:\n if (locale.strings.call.inviteToRoomRemovedTitle) {\n title = locale.strings.call.inviteToRoomRemovedTitle;\n moreDetails = locale.strings.call.inviteToRoomRemovedDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageInviteToRoomRemoved';\n }\n break;\n case CALL_TIMEOUT_SUB_CODE:\n if (endedCall?.callEndReason?.code === CALL_TIMEOUT_CODE && locale.strings.call.callTimeoutTitle) {\n title = locale.strings.call.callTimeoutTitle;\n moreDetails = locale.strings.call.callTimeoutDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallTimeout';\n }\n break;\n case BOT_TIMEOUT_SUB_CODE:\n if (endedCall?.callEndReason?.code === BOT_TIMEOUT_CODE && locale.strings.call.callTimeoutBotTitle) {\n title = locale.strings.call.callTimeoutBotTitle;\n moreDetails = locale.strings.call.callTimeoutBotDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallTimeout';\n }\n break;\n }\n switch (endedCall?.callEndReason?.code) {\n case CALL_REJECTED_CODE:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n moreDetails = locale.strings.call.callRejectedMoreDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallRejected';\n }\n break;\n }\n switch (endedCall?.callEndReason?.subCode) {\n case 10037:\n if (locale.strings.call.participantCouldNotBeReachedTitle) {\n title = locale.strings.call.participantCouldNotBeReachedTitle;\n moreDetails = locale.strings.call.participantCouldNotBeReachedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10124:\n if (locale.strings.call.permissionToReachTargetParticipantNotAllowedTitle) {\n title = locale.strings.call.permissionToReachTargetParticipantNotAllowedTitle;\n moreDetails = locale.strings.call.permissionToReachTargetParticipantNotAllowedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10119:\n if (locale.strings.call.unableToResolveTenantTitle) {\n title = locale.strings.call.unableToResolveTenantTitle;\n moreDetails = locale.strings.call.unableToResolveTenantMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10044:\n if (locale.strings.call.participantIdIsMalformedTitle) {\n title = locale.strings.call.participantIdIsMalformedTitle;\n moreDetails = locale.strings.call.participantIdIsMalformedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n }\n switch (endedCall?.callEndReason?.subCode) {\n case INVALID_MEETING_IDENTIFIER:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n moreDetails = locale.strings.call.invalidMeetingIdentifier;\n disableStartCallButton = true;\n }\n break;\n }\n // keep this at the bottom to catch the scenarios not including the ones above.\n switch (endedCall?.callEndReason?.code) {\n case 400:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n disableStartCallButton = true;\n }\n break;\n }\n return { title, moreDetails, disableStartCallButton, iconName };\n};\n\n/**\n * type definition for conditional-compilation\n */\ntype GetCallCompositePageFunction = ((\n call: CallState | undefined,\n previousCall: CallState | undefined\n) => CallCompositePage) &\n ((\n call: CallState | undefined,\n previousCall: CallState | undefined,\n transferCall?: CallState,\n isReturningFromBreakoutRoom?: boolean,\n /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserInfo?: {\n environmentInfo?: EnvironmentInfo;\n unsupportedBrowserVersionOptedIn?: boolean;\n }\n ) => CallCompositePage);\n/**\n * Get the current call composite page based on the current call composite state\n *\n * @param Call - The current call state\n * @param previousCall - The state of the most recent previous call that has ended.\n *\n * @remarks - The previousCall state is needed to determine if the call has ended.\n * When the call ends a new call object is created, and so we must lookback at the\n * previous call state to understand how the call has ended. If there is no previous\n * call we know that this is a fresh call and can display the configuration page.\n *\n * @private\n */\nexport const getCallCompositePage: GetCallCompositePageFunction = (\n call,\n previousCall?,\n transferCall?: CallState,\n isReturningFromBreakoutRoom?: boolean,\n unsupportedBrowserInfo?: {\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo?: EnvironmentInfo;\n unsupportedBrowserVersionOptedIn?: boolean;\n }\n): CallCompositePage => {\n /* @conditional-compile-remove(unsupported-browser) */\n if (\n isUnsupportedEnvironment(\n unsupportedBrowserInfo?.environmentInfo,\n unsupportedBrowserInfo?.unsupportedBrowserVersionOptedIn\n )\n ) {\n return 'unsupportedEnvironment';\n }\n\n if (transferCall !== undefined) {\n return 'transferring';\n }\n\n /* @conditional-compile-remove(breakout-rooms) */\n if (isReturningFromBreakoutRoom) {\n return 'returningFromBreakoutRoom';\n }\n\n if (call) {\n // Must check for ongoing call *before* looking at any previous calls.\n // If the composite completes one call and joins another, the previous calls\n // will be populated, but not relevant for determining the page.\n\n // `_isInLobbyOrConnecting` needs to be checked first because `_isInCall` also returns true when call is in lobby.\n if (_isInLobbyOrConnecting(call?.state)) {\n return 'lobby';\n // `LocalHold` needs to be checked before `isInCall` since it is also a state that's considered in call.\n } else if (call?.state === 'LocalHold') {\n return 'hold';\n } else if (call?.state === 'Disconnecting') {\n return 'leaving';\n } else if (_isInCall(call?.state)) {\n return 'call';\n } else {\n // When the call object has been constructed after clicking , but before 'connecting' has been\n // set on the call object, we continue to show the configuration screen.\n // The call object does not correctly reflect local device state until `call.state` moves to `connecting`.\n // Moving to the 'lobby' page too soon leads to components that depend on the `call` object to show incorrect\n // transitional state.\n return 'configuration';\n }\n }\n\n if (previousCall) {\n const reason = getCallEndReason(previousCall);\n switch (reason) {\n case CallEndReasons.ACCESS_DENIED:\n return 'accessDeniedTeamsMeeting';\n case CallEndReasons.REMOVED_FROM_CALL:\n return 'removedFromCall';\n case CallEndReasons.BAD_REQUEST:\n return 'badRequest';\n case CallEndReasons.LEFT_CALL:\n if (previousCall.diagnostics.network.latest.noNetwork) {\n return 'joinCallFailedDueToNoNetwork';\n }\n return 'leftCall';\n }\n }\n\n // No call state - show starting page (configuration)\n return 'configuration';\n};\n\n/** @private */\nexport const IsCallEndedPage = (\n /**\n * Explicitly listing the pages of this function intentionally.\n * This protects against adding a new composite page that should be marked as an callEndedPage.\n * EndCallPages are used to trigger onCallEnded events so this could easily be missed.\n * When you add a new composite page this will throw a compiler error. If this new page is an\n * EndCallPage ensure you update the END_CALL_PAGES. Afterwards update the `page` parameter\n * type below to allow your new page, i.e. add `| <your new page>\n */\n page: CallCompositePage\n): boolean => END_CALL_PAGES.includes(page);\n\n/**\n * Creates a new call control options object and sets the correct values for disabling\n * the buttons provided in the `disabledControls` array.\n * Returns a new object without changing the original object.\n * @param callControlOptions options for the call control component that need to be modified.\n * @param disabledControls An array of controls to disable.\n * @returns a copy of callControlOptions with disabledControls disabled\n * @private\n */\nexport const disableCallControls = (\n callControlOptions: CallControlOptions | boolean | undefined,\n disabledControls: (keyof CallControlOptions)[]\n): CallControlOptions | boolean | undefined => {\n if (callControlOptions === false) {\n return false;\n }\n // Ensure we clone the prop if it is an object to ensure we do not mutate the original prop.\n let newOptions: CallControlOptions | boolean | undefined =\n (callControlOptions instanceof Object ? ({ ...callControlOptions } as CallControlOptions) : callControlOptions) ??\n ({} as Partial<CallControlOptions>);\n if (newOptions === true || newOptions === undefined) {\n newOptions = disabledControls.reduce((acc, key) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error TODO: fix noImplicitAny error here\n // Not solveable at this time due to typescript limitations. The typing is too complex for typescript to\n // understand. Will need to revisit when either typescript or the calling component bindings are updated.\n acc[key] = { disabled: true };\n return acc;\n }, {} as Partial<CallControlOptions>);\n } else {\n disabledControls.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error refer to above comment\n if (newOptions[key] !== false) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error refer to above comment\n newOptions[key] = { disabled: true };\n }\n });\n }\n return newOptions;\n};\n\n/**\n * Check if a disabled object is provided for a button and returns if the button is disabled.\n * A button is only disabled if is explicitly set to disabled.\n *\n * @param option\n * @returns whether a button is disabled\n * @private\n */\nexport const isDisabled = (option: boolean | { disabled: boolean } | undefined): boolean => {\n if (option === undefined || typeof option === 'boolean') {\n return false;\n }\n\n return option.disabled;\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * @returns Permissions state for the camera.\n */\nconst queryCameraPermissionFromPermissionsAPI = async (): Promise<PermissionState | 'unsupported'> => {\n try {\n return (await navigator.permissions.query({ name: 'camera' as PermissionName })).state;\n } catch (e) {\n console.info('permissions API is not supported by browser', e);\n return 'unsupported';\n }\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * @returns Permissions state for the microphone.\n */\nconst queryMicrophonePermissionFromPermissionsAPI = async (): Promise<PermissionState | 'unsupported'> => {\n try {\n return (await navigator.permissions.query({ name: 'microphone' as PermissionName })).state;\n } catch (e) {\n console.info('permissions API is not supported by browser', e);\n return 'unsupported';\n }\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n *\n * This function uses permission API to determine if device permission state is granted, prompt or denied\n * @returns whether device permission state is granted, prompt or denied\n * If permission API is not supported on this browser, permission state is set to unsupported.\n * @private\n */\nexport const getDevicePermissionState = async (\n setVideoState: (state: PermissionState | 'unsupported') => void,\n setAudioState: (state: PermissionState | 'unsupported') => void\n): Promise<void> => {\n const [cameraResult, microphoneResult] = await Promise.all([\n queryCameraPermissionFromPermissionsAPI(),\n queryMicrophonePermissionFromPermissionsAPI()\n ]);\n setVideoState(cameraResult);\n setAudioState(microphoneResult);\n};\n/* @conditional-compile-remove(unsupported-browser) */\nconst isUnsupportedEnvironment = (\n environmentInfo?: EnvironmentInfo,\n unsupportedBrowserVersionOptedIn?: boolean\n): boolean => {\n return !!(\n environmentInfo?.isSupportedBrowser === false ||\n (environmentInfo?.isSupportedBrowserVersion === false && !unsupportedBrowserVersionOptedIn) ||\n environmentInfo?.isSupportedPlatform === false\n );\n};\n\n/**\n * Check if we are using safari browser\n * @private\n */\nexport const _isSafari = (environmentInfo: undefined | EnvironmentInfo): boolean => {\n return environmentInfo?.environment.browser.toLowerCase() === 'safari';\n};\n\n/**\n * @private\n * This is the util function to create a participant modifier for remote participantList\n * It memoize previous original participant items and only update the changed participant\n * It takes in one modifier function to generate one single participant object, it returns undefined if the object keeps unmodified\n */\nexport const createParticipantModifier = (\n createModifiedParticipant: (id: string, participant: RemoteParticipantState) => RemoteParticipantState | undefined\n): AdapterStateModifier => {\n let previousParticipantState:\n | {\n [keys: string]: RemoteParticipantState;\n }\n | undefined = undefined;\n let modifiedParticipants: {\n [keys: string]: RemoteParticipantState;\n } = {};\n const memoizedParticipants: {\n [id: string]: { originalRef: RemoteParticipantState; newParticipant: RemoteParticipantState };\n } = {};\n\n return (state: CallAdapterState) => {\n // if root state is the same, we don't need to update the participants\n if (state.call?.remoteParticipants !== previousParticipantState) {\n modifiedParticipants = {};\n const originalParticipants = Object.entries(state.call?.remoteParticipants || {});\n for (const [key, originalParticipant] of originalParticipants) {\n const modifiedParticipant = createModifiedParticipant(key, originalParticipant);\n if (modifiedParticipant === undefined) {\n modifiedParticipants[key] = originalParticipant;\n continue;\n }\n // Generate the new item if original cached item has been changed\n if (memoizedParticipants[key]?.originalRef !== originalParticipant) {\n memoizedParticipants[key] = {\n newParticipant: modifiedParticipant,\n originalRef: originalParticipant\n };\n }\n\n // the modified participant is always coming from the memoized cache, whether is was refreshed\n // from the previous closure or not\n const memoizedParticipant = memoizedParticipants[key];\n if (!memoizedParticipant) {\n throw new Error('Participant modifier encountered an unhandled exception.');\n }\n\n modifiedParticipants[key] = memoizedParticipant.newParticipant;\n }\n\n previousParticipantState = state.call?.remoteParticipants;\n }\n return {\n ...state,\n call: state.call\n ? {\n ...state.call,\n remoteParticipants: modifiedParticipants\n }\n : undefined\n };\n };\n};\n\n/** @private */\nexport const getBackgroundEffectFromSelectedEffect = (\n selectedEffect: VideoBackgroundEffect | undefined,\n VideoBackgroundEffectsDependency: VideoBackgroundEffectsDependency\n): VideoEffectProcessor | undefined =>\n selectedEffect?.effectName === 'blur'\n ? VideoBackgroundEffectsDependency.createBackgroundBlurEffect()\n : selectedEffect?.effectName === 'replacement'\n ? VideoBackgroundEffectsDependency.createBackgroundReplacementEffect({\n backgroundImageUrl: selectedEffect.backgroundImageUrl\n })\n : undefined;\n\n/**\n * @remarks this logic should mimic the onToggleCamera in the common call handlers.\n * @private\n */\nexport const getSelectedCameraFromAdapterState = (state: CallAdapterState): VideoDeviceInfo | undefined =>\n state.devices.selectedCamera || state.devices.cameras[0];\n\n/**\n * Helper to determine if the adapter has a locator or targetCallees\n * @param locatorOrTargetCallees\n * @returns boolean to determine if the adapter has a locator or targetCallees, true is locator, false is targetCallees\n * @private\n */\nexport const getLocatorOrTargetCallees = (\n locatorOrTargetCallees: CallAdapterLocator | StartCallIdentifier[]\n): locatorOrTargetCallees is StartCallIdentifier[] => {\n return !!Array.isArray(locatorOrTargetCallees);\n};\n\n/**\n * @private\n */\nexport type ComplianceState = 'on' | 'off' | 'stopped';\n\n/**\n * Return different conditions based on the current and previous state of recording and transcribing\n *\n * @param callRecordState - The current call record state: on, off, stopped\n * @param callTranscribeState - The current call transcribe state: on, off, stopped\n *\n * @remarks - The stopped state means: previously on but currently off\n *\n * @private\n */\nexport const computeVariant = (\n callRecordState: ComplianceState,\n callTranscribeState: ComplianceState\n): ComplianceNotificationVariant => {\n if (callRecordState === 'on' && callTranscribeState === 'on') {\n return 'recordingAndTranscriptionStarted';\n } else if (callRecordState === 'on' && callTranscribeState === 'off') {\n return 'recordingStarted';\n } else if (callRecordState === 'off' && callTranscribeState === 'on') {\n return 'transcriptionStarted';\n } else if (callRecordState === 'on' && callTranscribeState === 'stopped') {\n return 'transcriptionStoppedStillRecording';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'on') {\n return 'recordingStoppedStillTranscribing';\n } else if (callRecordState === 'off' && callTranscribeState === 'stopped') {\n return 'transcriptionStopped';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'off') {\n return 'recordingStopped';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'stopped') {\n return 'recordingAndTranscriptionStopped';\n } else {\n return 'noState';\n }\n};\n\n/**\n * @private\n */\nexport type ComplianceNotificationVariant =\n | 'noState'\n | 'recordingStarted'\n | 'transcriptionStarted'\n | 'recordingStopped'\n | 'transcriptionStopped'\n | 'recordingAndTranscriptionStarted'\n | 'recordingAndTranscriptionStopped'\n | 'recordingStoppedStillTranscribing'\n | 'transcriptionStoppedStillRecording';\n\n/**\n * @private\n */\nexport type CachedComplianceNotificationProps = {\n latestBooleanState: {\n callTranscribeState?: boolean;\n callRecordState?: boolean;\n };\n latestStringState: {\n callTranscribeState: ComplianceState;\n callRecordState: ComplianceState;\n };\n // Timestamp for the last time cached state was updated.\n // Represented as milliseconds since epoch (i.e., the value returned by Date.now()).\n lastUpdated: number;\n};\n\n/**\n * @private\n */\nexport function determineStates(previous: ComplianceState, current: boolean | undefined): ComplianceState {\n // if current state is on, then return on\n if (current) {\n return 'on';\n }\n // if current state is off\n else {\n // if previous state is on and current state is off, return stopped (on -> off)\n if (previous === 'on') {\n return 'stopped';\n }\n // otherwise remain previous state unchanged\n else {\n return previous;\n }\n }\n}\n\n// The debounce time for the stopped state to be shown after both states are stopped.\n// This is to prevent stopped messages from being lost by transitioning to \"Off\" too\n// quickly if the states are toggled in quick succession.\n// This also prevents React strict mode from transitioning to \"Off\" too quickly.\nconst ComplianceNotificationOffDebounceTimeMs = 2000;\n\n/**\n * Compute compliance notification based on latest compliance state and cached props.\n * @private\n */\nexport function computeComplianceNotification(\n complianceProps: {\n callTranscribeState: boolean;\n callRecordState: boolean;\n },\n cachedProps: React.MutableRefObject<CachedComplianceNotificationProps>\n): ActiveNotification | undefined {\n // Only update cached props and variant if there is _some_ change in the latest props.\n // This ensures that state machine is only updated if there is an actual change in the props.\n const shouldUpdateCached =\n complianceProps.callRecordState !== cachedProps.current.latestBooleanState.callRecordState ||\n complianceProps.callTranscribeState !== cachedProps.current.latestBooleanState.callTranscribeState;\n\n // The following three operations must be performed in this exact order:\n\n // [1]: Update cached state to transition the state machine.\n if (shouldUpdateCached) {\n cachedProps.current = {\n latestBooleanState: complianceProps,\n latestStringState: {\n callRecordState: determineStates(\n cachedProps.current.latestStringState.callRecordState,\n complianceProps.callRecordState\n ),\n callTranscribeState: determineStates(\n cachedProps.current.latestStringState.callTranscribeState,\n complianceProps.callTranscribeState\n )\n },\n lastUpdated: Date.now()\n };\n }\n\n // [2]: If the callRecordState and callTranscribeState are both stopped for a predetermined amount of time, mark both states as off.\n // NOTE: this can be removed once lastStoppedRecording in the calling stateful client is GA.\n if (\n shouldUpdateCached &&\n cachedProps.current.latestStringState.callRecordState === 'stopped' &&\n cachedProps.current.latestStringState.callTranscribeState === 'stopped' &&\n Date.now() - cachedProps.current.lastUpdated > ComplianceNotificationOffDebounceTimeMs\n ) {\n // When both states are stopped, after displaying message \"RECORDING_AND_TRANSCRIPTION_STOPPED\", change both states to off (going back to the default state).\n cachedProps.current.latestStringState.callRecordState = 'off';\n cachedProps.current.latestStringState.callTranscribeState = 'off';\n }\n\n // [3]: Compute the variant, using the transitioned state machine.\n const variant = computeVariant(\n cachedProps.current.latestStringState.callRecordState,\n cachedProps.current.latestStringState.callTranscribeState\n );\n\n // If the variant is not 'noState', then show the notification.\n if (variant !== 'noState') {\n return {\n type: variant,\n timestamp: new Date(Date.now())\n };\n } else {\n return undefined;\n }\n}\n"]}
@@ -81,23 +81,34 @@ export class AzureCommunicationCallWithChatAdapter {
81
81
  this.callAdapter.onStateChange(onCallStateChange);
82
82
  /* @conditional-compile-remove(breakout-rooms) */
83
83
  this.callAdapter.on('breakoutRoomsUpdated', (eventData) => __awaiter(this, void 0, void 0, function* () {
84
+ var _a, _b;
84
85
  if (eventData.type === 'join') {
85
86
  yield this.breakoutRoomJoined(eventData.data);
86
87
  }
87
88
  else if (eventData.type === 'assignedBreakoutRooms') {
88
89
  if (!eventData.data || eventData.data.state === 'closed') {
89
- yield this.returnFromBreakoutRoom();
90
+ if (this.originCallChatAdapter &&
91
+ ((_a = this.originCallChatAdapter) === null || _a === void 0 ? void 0 : _a.getState().thread.threadId) !== ((_b = this.chatAdapter) === null || _b === void 0 ? void 0 : _b.getState().thread.threadId)) {
92
+ this.updateChatAdapter(this.originCallChatAdapter);
93
+ }
90
94
  }
91
95
  }
92
96
  }));
93
97
  /* @conditional-compile-remove(breakout-rooms) */
94
98
  this.callAdapter.on('callEnded', () => {
95
99
  var _a, _b, _c;
96
- const originCallId = (_b = (_a = this.context.getState().call) === null || _a === void 0 ? void 0 : _a.breakoutRooms) === null || _b === void 0 ? void 0 : _b.breakoutRoomOriginCallId;
97
- // If the call ended is a breakout room call, return to the origin call chat adapter
98
- if (originCallId && this.originCallChatAdapter) {
99
- (_c = this.breakoutRoomChatAdapter) === null || _c === void 0 ? void 0 : _c.dispose();
100
- this.updateChatAdapter(this.originCallChatAdapter);
100
+ // If the call ended is a breakout room call with breakout room settings then update the chat adapter to the
101
+ // origin call
102
+ if ((_b = (_a = this.context.getState().call) === null || _a === void 0 ? void 0 : _a.breakoutRooms) === null || _b === void 0 ? void 0 : _b.breakoutRoomSettings) {
103
+ // Unsubscribe from chat adapter state changes
104
+ (_c = this.chatAdapter) === null || _c === void 0 ? void 0 : _c.offStateChange(this.onChatStateChange);
105
+ // Unassign chat adapter
106
+ this.chatAdapter = undefined;
107
+ // Set chat state to undefined to prevent showing chat thread of origin call
108
+ this.context.unsetChatState();
109
+ if (this.originCallChatAdapter) {
110
+ this.updateChatAdapter(this.originCallChatAdapter);
111
+ }
101
112
  }
102
113
  });
103
114
  this.onCallStateChange = onCallStateChange;