@stream-io/video-react-native-sdk 1.43.0 → 1.45.0
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.
- package/CHANGELOG.md +44 -1
- package/dist/commonjs/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/Lobby.js +4 -9
- package/dist/commonjs/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/commonjs/components/Call/Lobby/LobbyCameraPreview.js +93 -0
- package/dist/commonjs/components/Call/Lobby/LobbyCameraPreview.js.map +1 -0
- package/dist/commonjs/components/Call/Lobby/index.js +11 -0
- package/dist/commonjs/components/Call/Lobby/index.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +4 -15
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/index.js +10 -4
- package/dist/commonjs/components/Participant/ParticipantView/VideoRenderer/index.js.map +1 -1
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js +9 -5
- package/dist/commonjs/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -1
- package/dist/commonjs/hooks/useLoopbackRecording.js +10 -127
- package/dist/commonjs/hooks/useLoopbackRecording.js.map +1 -1
- package/dist/commonjs/modules/call-manager/CallManager.js +37 -54
- package/dist/commonjs/modules/call-manager/CallManager.js.map +1 -1
- package/dist/commonjs/utils/StreamVideoRN/index.js +2 -0
- package/dist/commonjs/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/commonjs/utils/internal/callingx/callingx.js +28 -39
- package/dist/commonjs/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/commonjs/utils/internal/registerMediaEngine.js +41 -0
- package/dist/commonjs/utils/internal/registerMediaEngine.js.map +1 -0
- package/dist/commonjs/utils/internal/registerSDKGlobals.js +93 -35
- package/dist/commonjs/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/commonjs/utils/push/android.js +13 -175
- package/dist/commonjs/utils/push/android.js.map +1 -1
- package/dist/commonjs/utils/push/internal/android.js +186 -0
- package/dist/commonjs/utils/push/internal/android.js.map +1 -0
- package/dist/commonjs/utils/push/libs/firebaseMessaging/index.js +8 -9
- package/dist/commonjs/utils/push/libs/firebaseMessaging/index.js.map +1 -1
- package/dist/commonjs/utils/push/libs/firebaseMessaging/lib.js +1 -1
- package/dist/commonjs/utils/push/libs/firebaseMessaging/lib.js.map +1 -1
- package/dist/commonjs/utils/push/setupAndroidPushEvents.js +25 -0
- package/dist/commonjs/utils/push/setupAndroidPushEvents.js.map +1 -0
- package/dist/commonjs/utils/push/setupCallingExpEvents.js +6 -2
- package/dist/commonjs/utils/push/setupCallingExpEvents.js.map +1 -1
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/commonjs/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/commonjs/utils/push/utils.js.map +1 -1
- package/dist/commonjs/version.js +1 -1
- package/dist/module/components/Call/CallControls/internal/ReactionsPicker.js.map +1 -1
- package/dist/module/components/Call/Lobby/Lobby.js +4 -9
- package/dist/module/components/Call/Lobby/Lobby.js.map +1 -1
- package/dist/module/components/Call/Lobby/LobbyCameraPreview.js +87 -0
- package/dist/module/components/Call/Lobby/LobbyCameraPreview.js.map +1 -0
- package/dist/module/components/Call/Lobby/index.js +1 -0
- package/dist/module/components/Call/Lobby/index.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js +6 -17
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.js.map +1 -1
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/index.js +11 -5
- package/dist/module/components/Participant/ParticipantView/VideoRenderer/index.js.map +1 -1
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js +9 -5
- package/dist/module/hooks/push/useCallingExpWithCallingStateEffect.js.map +1 -1
- package/dist/module/hooks/useLoopbackRecording.js +10 -127
- package/dist/module/hooks/useLoopbackRecording.js.map +1 -1
- package/dist/module/modules/call-manager/CallManager.js +36 -53
- package/dist/module/modules/call-manager/CallManager.js.map +1 -1
- package/dist/module/utils/StreamVideoRN/index.js +2 -0
- package/dist/module/utils/StreamVideoRN/index.js.map +1 -1
- package/dist/module/utils/internal/callingx/callingx.js +27 -40
- package/dist/module/utils/internal/callingx/callingx.js.map +1 -1
- package/dist/module/utils/internal/registerMediaEngine.js +37 -0
- package/dist/module/utils/internal/registerMediaEngine.js.map +1 -0
- package/dist/module/utils/internal/registerSDKGlobals.js +95 -37
- package/dist/module/utils/internal/registerSDKGlobals.js.map +1 -1
- package/dist/module/utils/push/android.js +16 -178
- package/dist/module/utils/push/android.js.map +1 -1
- package/dist/module/utils/push/internal/android.js +182 -0
- package/dist/module/utils/push/internal/android.js.map +1 -0
- package/dist/module/utils/push/libs/firebaseMessaging/index.js +8 -8
- package/dist/module/utils/push/libs/firebaseMessaging/index.js.map +1 -1
- package/dist/module/utils/push/libs/firebaseMessaging/lib.js +1 -1
- package/dist/module/utils/push/libs/firebaseMessaging/lib.js.map +1 -1
- package/dist/module/utils/push/setupAndroidPushEvents.js +21 -0
- package/dist/module/utils/push/setupAndroidPushEvents.js.map +1 -0
- package/dist/module/utils/push/setupCallingExpEvents.js +6 -2
- package/dist/module/utils/push/setupCallingExpEvents.js.map +1 -1
- package/dist/module/utils/push/setupIosVoipPushEvents.js +6 -7
- package/dist/module/utils/push/setupIosVoipPushEvents.js.map +1 -1
- package/dist/module/utils/push/utils.js.map +1 -1
- package/dist/module/version.js +1 -1
- package/dist/typescript/components/Call/Lobby/Lobby.d.ts.map +1 -1
- package/dist/typescript/components/Call/Lobby/LobbyCameraPreview.d.ts +28 -0
- package/dist/typescript/components/Call/Lobby/LobbyCameraPreview.d.ts.map +1 -0
- package/dist/typescript/components/Call/Lobby/index.d.ts +1 -0
- package/dist/typescript/components/Call/Lobby/index.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.d.ts +11 -6
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.d.ts.map +1 -1
- package/dist/typescript/components/Participant/ParticipantView/VideoRenderer/index.d.ts.map +1 -1
- package/dist/typescript/hooks/push/useCallingExpWithCallingStateEffect.d.ts.map +1 -1
- package/dist/typescript/hooks/useLoopbackRecording.d.ts +12 -69
- package/dist/typescript/hooks/useLoopbackRecording.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/CallManager.d.ts +28 -6
- package/dist/typescript/modules/call-manager/CallManager.d.ts.map +1 -1
- package/dist/typescript/modules/call-manager/types.d.ts +0 -1
- package/dist/typescript/modules/call-manager/types.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/index.d.ts.map +1 -1
- package/dist/typescript/utils/StreamVideoRN/types.d.ts +3 -0
- package/dist/typescript/utils/StreamVideoRN/types.d.ts.map +1 -1
- package/dist/typescript/utils/internal/callingx/callingx.d.ts +2 -0
- package/dist/typescript/utils/internal/callingx/callingx.d.ts.map +1 -1
- package/dist/typescript/utils/internal/registerMediaEngine.d.ts +15 -0
- package/dist/typescript/utils/internal/registerMediaEngine.d.ts.map +1 -0
- package/dist/typescript/utils/internal/registerSDKGlobals.d.ts.map +1 -1
- package/dist/typescript/utils/push/android.d.ts +3 -4
- package/dist/typescript/utils/push/android.d.ts.map +1 -1
- package/dist/typescript/utils/push/internal/android.d.ts +8 -0
- package/dist/typescript/utils/push/internal/android.d.ts.map +1 -0
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts +6 -5
- package/dist/typescript/utils/push/libs/firebaseMessaging/index.d.ts.map +1 -1
- package/dist/typescript/utils/push/libs/firebaseMessaging/lib.d.ts +2 -2
- package/dist/typescript/utils/push/libs/firebaseMessaging/lib.d.ts.map +1 -1
- package/dist/typescript/utils/push/setupAndroidPushEvents.d.ts +3 -0
- package/dist/typescript/utils/push/setupAndroidPushEvents.d.ts.map +1 -0
- package/dist/typescript/utils/push/setupCallingExpEvents.d.ts.map +1 -1
- package/dist/typescript/utils/push/setupIosVoipPushEvents.d.ts.map +1 -1
- package/dist/typescript/utils/push/utils.d.ts +2 -2
- package/dist/typescript/utils/push/utils.d.ts.map +1 -1
- package/dist/typescript/version.d.ts +1 -1
- package/ios/StreamInCallManager.m +4 -0
- package/ios/StreamInCallManager.swift +42 -10
- package/ios/TracksRecorder/RecorderVideoSink.swift +92 -5
- package/package.json +8 -8
- package/src/components/Call/CallControls/internal/ReactionsPicker.tsx +2 -2
- package/src/components/Call/Lobby/Lobby.tsx +4 -11
- package/src/components/Call/Lobby/LobbyCameraPreview.tsx +99 -0
- package/src/components/Call/Lobby/index.ts +1 -0
- package/src/components/Participant/ParticipantView/VideoRenderer/TrackSubscriber.tsx +56 -75
- package/src/components/Participant/ParticipantView/VideoRenderer/index.tsx +18 -7
- package/src/hooks/push/useCallingExpWithCallingStateEffect.ts +12 -5
- package/src/hooks/useLoopbackRecording.ts +36 -248
- package/src/modules/call-manager/CallManager.ts +40 -71
- package/src/modules/call-manager/native-module.d.ts +13 -0
- package/src/modules/call-manager/types.ts +0 -1
- package/src/utils/StreamVideoRN/index.ts +2 -0
- package/src/utils/StreamVideoRN/types.ts +3 -0
- package/src/utils/internal/callingx/callingx.ts +37 -46
- package/src/utils/internal/registerMediaEngine.ts +42 -0
- package/src/utils/internal/registerSDKGlobals.ts +115 -42
- package/src/utils/push/android.ts +20 -253
- package/src/utils/push/internal/android.ts +252 -0
- package/src/utils/push/libs/firebaseMessaging/index.ts +14 -22
- package/src/utils/push/libs/firebaseMessaging/lib.ts +3 -3
- package/src/utils/push/setupAndroidPushEvents.ts +25 -0
- package/src/utils/push/setupCallingExpEvents.ts +6 -3
- package/src/utils/push/setupIosVoipPushEvents.ts +8 -7
- package/src/utils/push/utils.ts +2 -4
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_reactNative","require","_callingx","_videoClient","CallingxModule","getCallingxLibIfAvailable","
|
|
1
|
+
{"version":3,"names":["_reactNative","require","_callingx","_videoClient","CallingxModule","getCallingxLibIfAvailable","getCallDisplayName","callMembers","participants","currentUserId","names","length","flatMap","member","user","id","name","participant","userId","find","sort","join","getCallDisplayNameFromCall","call","state","custom","display_name","members","registerOutgoingCall","isSetup","isOwnTracksLoopbackAllowed","isOutcomingCall","ringing","isCreatedByMe","logger","videoLoggerSystem","getLogger","debug","cid","callDisplayName","startCall","createdBy","settings","video","enabled","error","joinCallingxCall","activeCalls","isIncomingCall","startCallInCallingx","isOngoingCallsEnabled","activeCallsToLeave","filter","c","callingState","CallingState","LEFT","activeCall","leave","reason","catch","e","displayIncomingCall","answerIncomingCall","endCallingxCall","isCallTracked","endCallWithReason","wireAudioEngineSubscription","Platform","OS","unwireAudioEngineSubscription"],"sourceRoot":"../../../../../src","sources":["utils/internal/callingx/callingx.ts"],"mappings":";;;;;;;;;;;AAIA,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,SAAA,GAAAD,OAAA;AAMA,IAAAE,YAAA,GAAAF,OAAA;AAZA;AACA;AACA;AACA;;AAWA,MAAMG,cAAc,GAAG,IAAAC,mCAAyB,EAAC,CAAC;;AAElD;AACA;AACA;AACO,SAASC,kBAAkBA,CAChCC,WAAyC,EACzCC,YAAkD,EAClDC,aAAiC,EACzB;EACR,IAAI,CAACF,WAAW,IAAI,CAACC,YAAY,IAAI,CAACC,aAAa,EAAE;IACnD,OAAO,MAAM;EACf;EAEA,IAAIC,KAAe,GAAG,EAAE;EAExB,IAAIH,WAAW,CAACI,MAAM,GAAG,CAAC,EAAE;IAC1B;IACAD,KAAK,GAAGH,WAAW,CAACK,OAAO,CAAEC,MAAM,IACjCA,MAAM,CAACC,IAAI,CAACC,EAAE,KAAKN,aAAa,IAAII,MAAM,CAACC,IAAI,CAACE,IAAI,GAChD,CAACH,MAAM,CAACC,IAAI,CAACE,IAAI,CAAC,GAClB,EACN,CAAC;EAC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A,EAAG;EAC9C,IAAI,CAAClE,cAAc,IAAI,CAACA,cAAc,CAACyB,OAAO,IAAIuC,qBAAQ,CAACC,EAAE,KAAK,KAAK,EAAE;IACvE;EACF;EACA,MAAMnC,MAAM,GAAGC,8BAAiB,CAACC,SAAS,CAAC,UAAU,CAAC;EAEtD,IAAI;IACFF,MAAM,CAACG,KAAK,CAAC,0DAA0D,CAAC;IACxEjC,cAAc,CAACkE,6BAA6B,CAAC,CAAC;EAChD,CAAC,CAAC,OAAOzB,KAAK,EAAE;IACdX,MAAM,CAACW,KAAK,CACV,qEAAqE,EACrEA,KACF,CAAC;EACH;AACF","ignoreList":[]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.registerCallMediaEngine = registerCallMediaEngine;
|
|
7
|
+
var _videoClient = require("@stream-io/video-client");
|
|
8
|
+
var _reactNativeWebrtc = require("@stream-io/react-native-webrtc");
|
|
9
|
+
var _callManager = require("../../modules/call-manager");
|
|
10
|
+
const logger = _videoClient.videoLoggerSystem.getLogger('CallMediaEngine');
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Registers the React Native {@link CallMediaEngine} provider.
|
|
14
|
+
*
|
|
15
|
+
* Once registered, every `Call.ensureMediaFactory()` builds the call's native
|
|
16
|
+
* `PeerConnectionFactory` (with the call's audio configuration) and sets it as
|
|
17
|
+
* the single live factory. The WebRTC globals (`getUserMedia`/`getDisplayMedia`/
|
|
18
|
+
* `new RTCPeerConnection`) then resolve to it, so the call's tracks and peer
|
|
19
|
+
* connections are created with — and torn down with — that one native factory,
|
|
20
|
+
* which is what lets the call own its AudioDeviceModule. The engine itself only
|
|
21
|
+
* manages the factory lifecycle (`dispose` at leave).
|
|
22
|
+
*
|
|
23
|
+
* @internal
|
|
24
|
+
*/
|
|
25
|
+
function registerCallMediaEngine() {
|
|
26
|
+
(0, _videoClient.setCallMediaEngineProvider)(async () => {
|
|
27
|
+
const config = _callManager.callManager.getStoredConfig();
|
|
28
|
+
const bypassVoiceProcessing = config?.audioRole === 'listener';
|
|
29
|
+
const factory = await _reactNativeWebrtc.CallFactory.create({
|
|
30
|
+
bypassVoiceProcessing
|
|
31
|
+
});
|
|
32
|
+
logger.debug(`Created per-call factory (bypassVoiceProcessing=${bypassVoiceProcessing})`);
|
|
33
|
+
return {
|
|
34
|
+
dispose: async () => {
|
|
35
|
+
logger.debug('Disposing per-call factory');
|
|
36
|
+
return await factory.dispose();
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=registerMediaEngine.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["_videoClient","require","_reactNativeWebrtc","_callManager","logger","videoLoggerSystem","getLogger","registerCallMediaEngine","setCallMediaEngineProvider","config","callManager","getStoredConfig","bypassVoiceProcessing","audioRole","factory","CallFactory","create","debug","dispose"],"sourceRoot":"../../../../src","sources":["utils/internal/registerMediaEngine.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,kBAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AAEA,MAAMG,MAAM,GAAGC,8BAAiB,CAACC,SAAS,CAAC,iBAAiB,CAAC;;AAE7D;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uBAAuBA,CAAA,EAAG;EACxC,IAAAC,uCAA0B,EAAC,YAAsC;IAC/D,MAAMC,MAAM,GAAGC,wBAAW,CAACC,eAAe,CAAC,CAAC;IAC5C,MAAMC,qBAAqB,GAAGH,MAAM,EAAEI,SAAS,KAAK,UAAU;IAC9D,MAAMC,OAAO,GAAG,MAAMC,8BAAW,CAACC,MAAM,CAAC;MACvCJ;IACF,CAAC,CAAC;IACFR,MAAM,CAACa,KAAK,CACV,mDAAmDL,qBAAqB,GAC1E,CAAC;IAED,OAAO;MACLM,OAAO,EAAE,MAAAA,CAAA,KAAY;QACnBd,MAAM,CAACa,KAAK,CAAC,4BAA4B,CAAC;QAC1C,OAAO,MAAMH,OAAO,CAACI,OAAO,CAAC,CAAC;MAChC;IACF,CAAC;EACH,CAAC,CAAC;AACJ","ignoreList":[]}
|
|
@@ -4,14 +4,29 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.registerSDKGlobals = registerSDKGlobals;
|
|
7
|
+
var _videoClient = require("@stream-io/video-client");
|
|
7
8
|
var _reactNative = require("react-native");
|
|
8
9
|
var _reactNativeWebrtc = require("@stream-io/react-native-webrtc");
|
|
9
10
|
var _callingx = require("../push/libs/callingx");
|
|
10
11
|
var _callingx2 = require("./callingx/callingx");
|
|
12
|
+
var _registerMediaEngine = require("./registerMediaEngine");
|
|
13
|
+
var _callManager = require("../../modules/call-manager");
|
|
11
14
|
const StreamInCallManagerNativeModule = _reactNative.NativeModules.StreamInCallManager;
|
|
12
15
|
const StreamVideoReactNativeModule = _reactNative.NativeModules.StreamVideoReactNative;
|
|
13
16
|
const CallingxModule = (0, _callingx.getCallingxLibIfAvailable)();
|
|
14
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Runs a fire-and-forget native call, logging instead of throwing on a bridge
|
|
20
|
+
* error so it can't crash the caller (e.g. the join/leave flow).
|
|
21
|
+
*/
|
|
22
|
+
const safeNativeCall = (label, fn) => {
|
|
23
|
+
try {
|
|
24
|
+
fn();
|
|
25
|
+
} catch (error) {
|
|
26
|
+
_videoClient.videoLoggerSystem.getLogger('CallManager').warn(`${label} failed`, error);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
15
30
|
/**
|
|
16
31
|
* Checks if StreamInCallManager should be bypassed because CallKit is handling
|
|
17
32
|
* the audio session via CallingX.
|
|
@@ -42,71 +57,113 @@ const shouldBypassForCallKit = ({
|
|
|
42
57
|
* run it in "telecom-managed" mode where it only keeps proximity/keep-screen-on/mute.
|
|
43
58
|
*/
|
|
44
59
|
const isAndroidTelecomManaged = ({
|
|
45
|
-
|
|
60
|
+
cid
|
|
46
61
|
}) => {
|
|
47
|
-
if (_reactNative.Platform.OS !== 'android') {
|
|
62
|
+
if (_reactNative.Platform.OS !== 'android' || !CallingxModule) {
|
|
48
63
|
return false;
|
|
49
64
|
}
|
|
50
|
-
if (!CallingxModule) {
|
|
65
|
+
if (!CallingxModule.isSetup || !CallingxModule.isTelecomBacked) {
|
|
51
66
|
return false;
|
|
52
67
|
}
|
|
53
|
-
|
|
68
|
+
// Trust Telecom's actual per-call registration. A call that never registered
|
|
69
|
+
// (e.g. Telecom registration failed) is not managed, so start() falls through
|
|
70
|
+
// to the classic path — this is where audio recovery happens.
|
|
71
|
+
return CallingxModule.isCallTracked(cid);
|
|
54
72
|
};
|
|
55
73
|
const streamRNVideoSDKGlobals = {
|
|
56
74
|
callingX: {
|
|
57
75
|
joinCall: _callingx2.joinCallingxCall,
|
|
58
76
|
endCall: _callingx2.endCallingxCall,
|
|
59
|
-
registerOutgoingCall: _callingx2.registerOutgoingCall
|
|
77
|
+
registerOutgoingCall: _callingx2.registerOutgoingCall,
|
|
78
|
+
wireAudioEngineSubscription: _callingx2.wireAudioEngineSubscription,
|
|
79
|
+
unwireAudioEngineSubscription: _callingx2.unwireAudioEngineSubscription
|
|
60
80
|
},
|
|
61
81
|
callManager: {
|
|
62
82
|
setup: ({
|
|
63
83
|
defaultDevice,
|
|
64
|
-
isRingingTypeCall
|
|
84
|
+
isRingingTypeCall,
|
|
85
|
+
cid
|
|
65
86
|
}) => {
|
|
66
|
-
|
|
87
|
+
const isTelecomManaged = isAndroidTelecomManaged({
|
|
88
|
+
cid
|
|
89
|
+
});
|
|
90
|
+
const isCallKitManaged = shouldBypassForCallKit({
|
|
67
91
|
isRingingTypeCall
|
|
68
|
-
})
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
return;
|
|
92
|
+
});
|
|
93
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
94
|
+
StreamInCallManagerNativeModule.setTelecomManagedMode(isTelecomManaged);
|
|
72
95
|
}
|
|
73
|
-
if (
|
|
74
|
-
|
|
75
|
-
})) {
|
|
76
|
-
// Telecom owns routing; forward the sticky preference to callingx and run the
|
|
77
|
-
// in-call manager in telecom-managed mode (proximity/keep-screen-on only).
|
|
78
|
-
CallingxModule?.setDefaultAudioDeviceEndpointType(defaultDevice);
|
|
79
|
-
StreamInCallManagerNativeModule.setTelecomManagedMode(true);
|
|
80
|
-
StreamInCallManagerNativeModule.setup();
|
|
81
|
-
return;
|
|
96
|
+
if (isTelecomManaged || isCallKitManaged) {
|
|
97
|
+
safeNativeCall('setup defaultAudioDevice (callingx)', () => CallingxModule?.setDefaultAudioDeviceEndpointType(defaultDevice));
|
|
82
98
|
}
|
|
83
|
-
if (
|
|
84
|
-
StreamInCallManagerNativeModule.
|
|
99
|
+
if (!isTelecomManaged) {
|
|
100
|
+
safeNativeCall('setup defaultAudioDevice', () => StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(defaultDevice));
|
|
85
101
|
}
|
|
86
|
-
StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(defaultDevice);
|
|
87
|
-
StreamInCallManagerNativeModule.setup();
|
|
88
102
|
},
|
|
89
103
|
start: ({
|
|
90
|
-
isRingingTypeCall
|
|
104
|
+
isRingingTypeCall,
|
|
105
|
+
cid
|
|
91
106
|
}) => {
|
|
107
|
+
// Apply the audio config a consumer recorded via `callManager.start(config)` at this single
|
|
108
|
+
// join-time start, before the native audio manager is activated.
|
|
109
|
+
const config = _callManager.callManager.getStoredConfig();
|
|
110
|
+
const deviceOverride = config?.audioRole === 'communicator' ? config.deviceEndpointType : undefined;
|
|
92
111
|
if (shouldBypassForCallKit({
|
|
93
112
|
isRingingTypeCall
|
|
94
113
|
})) {
|
|
114
|
+
// CallKit owns activation. Only forward an explicit endpoint override; the
|
|
115
|
+
// SpeakerManager-derived default was already forwarded via `setup`.
|
|
116
|
+
if (deviceOverride) {
|
|
117
|
+
safeNativeCall('start defaultAudioDevice (callingx)', () => CallingxModule?.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
118
|
+
safeNativeCall('start defaultAudioDevice', () => StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
119
|
+
}
|
|
95
120
|
return;
|
|
96
121
|
}
|
|
97
|
-
|
|
98
|
-
|
|
122
|
+
const isTelecomManaged = isAndroidTelecomManaged({
|
|
123
|
+
cid
|
|
124
|
+
});
|
|
125
|
+
if (_reactNative.Platform.OS === 'android') {
|
|
126
|
+
StreamInCallManagerNativeModule.setTelecomManagedMode(isTelecomManaged);
|
|
127
|
+
}
|
|
128
|
+
if (config?.audioRole) {
|
|
129
|
+
StreamInCallManagerNativeModule.setAudioRole(config.audioRole);
|
|
130
|
+
}
|
|
131
|
+
if (deviceOverride) {
|
|
132
|
+
// Override the SpeakerManager-derived default device (set via `setup`).
|
|
133
|
+
if (isTelecomManaged) {
|
|
134
|
+
safeNativeCall('start defaultAudioDevice (callingx)', () => CallingxModule?.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
135
|
+
} else {
|
|
136
|
+
safeNativeCall('start defaultAudioDevice', () => StreamInCallManagerNativeModule.setDefaultAudioDeviceEndpointType(deviceOverride));
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
const stereoOutput = config?.audioRole === 'listener';
|
|
140
|
+
StreamInCallManagerNativeModule.setEnableStereoAudioOutput(stereoOutput);
|
|
99
141
|
StreamInCallManagerNativeModule.start();
|
|
100
142
|
},
|
|
101
143
|
stop: ({
|
|
102
|
-
isRingingTypeCall
|
|
144
|
+
isRingingTypeCall,
|
|
145
|
+
shouldStopCallManager
|
|
103
146
|
}) => {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
147
|
+
// Clear the stored audio config so it doesn't carry into the next call.
|
|
148
|
+
_callManager.callManager.stop();
|
|
149
|
+
|
|
150
|
+
// We want to interact with ADM only when it was instantiated. This guards a case when
|
|
151
|
+
// leave is invoked for ringing call - in this case PC Factory and ADM are not yet created.
|
|
152
|
+
if (shouldStopCallManager) {
|
|
153
|
+
// Teardown of setMutedRecordingPrepared. Done here (before the CallKit gate)
|
|
154
|
+
// so it runs on both paths and while the call factory is still alive: leave()
|
|
155
|
+
// calls stop() before disposing the engine, so the ADM resolves to the call's
|
|
156
|
+
// factory rather than a default.
|
|
157
|
+
if (_reactNative.Platform.OS === 'ios') {
|
|
158
|
+
StreamInCallManagerNativeModule.setRecordingAlwaysPreparedMode(false);
|
|
159
|
+
}
|
|
160
|
+
if (shouldBypassForCallKit({
|
|
161
|
+
isRingingTypeCall
|
|
162
|
+
})) {
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
StreamInCallManagerNativeModule.stop();
|
|
108
166
|
}
|
|
109
|
-
StreamInCallManagerNativeModule.stop();
|
|
110
167
|
},
|
|
111
168
|
// iOS-only. Keep the AVAudioEngine mic-input (voice-processing) chain
|
|
112
169
|
// prepared while muted so the engine stays full-duplex and remote audio
|
|
@@ -120,9 +177,9 @@ const streamRNVideoSDKGlobals = {
|
|
|
120
177
|
if (enabled) {
|
|
121
178
|
// Mute via the voice-processing unit (it's the default, fail safe config here) so the input chain
|
|
122
179
|
// stays built while muted, rather than tearing the engine down.
|
|
123
|
-
|
|
180
|
+
StreamInCallManagerNativeModule.setMuteMode(_reactNativeWebrtc.AudioEngineMuteMode.VoiceProcessing);
|
|
124
181
|
}
|
|
125
|
-
|
|
182
|
+
StreamInCallManagerNativeModule.setRecordingAlwaysPreparedMode(enabled);
|
|
126
183
|
}
|
|
127
184
|
},
|
|
128
185
|
permissions: {
|
|
@@ -157,5 +214,6 @@ function registerSDKGlobals() {
|
|
|
157
214
|
if (!globalThis.streamRNVideoSDK) {
|
|
158
215
|
globalThis.streamRNVideoSDK = streamRNVideoSDKGlobals;
|
|
159
216
|
}
|
|
217
|
+
(0, _registerMediaEngine.registerCallMediaEngine)();
|
|
160
218
|
}
|
|
161
219
|
//# sourceMappingURL=registerSDKGlobals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["_videoClient","require","_reactNative","_reactNativeWebrtc","_callingx","_callingx2","_registerMediaEngine","_callManager","StreamInCallManagerNativeModule","NativeModules","StreamInCallManager","StreamVideoReactNativeModule","StreamVideoReactNative","CallingxModule","getCallingxLibIfAvailable","safeNativeCall","label","fn","error","videoLoggerSystem","getLogger","warn","shouldBypassForCallKit","isRingingTypeCall","Platform","OS","bypass","isSetup","isOngoingCallsEnabled","isAndroidTelecomManaged","cid","isTelecomBacked","isCallTracked","streamRNVideoSDKGlobals","callingX","joinCall","joinCallingxCall","endCall","endCallingxCall","registerOutgoingCall","wireAudioEngineSubscription","unwireAudioEngineSubscription","callManager","setup","defaultDevice","isTelecomManaged","isCallKitManaged","setTelecomManagedMode","setDefaultAudioDeviceEndpointType","start","config","publicCallManager","getStoredConfig","deviceOverride","audioRole","deviceEndpointType","undefined","setAudioRole","stereoOutput","setEnableStereoAudioOutput","stop","shouldStopCallManager","setRecordingAlwaysPreparedMode","setMutedRecordingPrepared","enabled","setMuteMode","AudioEngineMuteMode","VoiceProcessing","permissions","check","permission","nativeAndroidPermission","PermissionsAndroid","PERMISSIONS","CAMERA","RECORD_AUDIO","Boolean","checkPermission","nativeEvents","speechActivity","subscribe","cb","subscription","audioDeviceModuleEvents","addSpeechActivityListener","data","isSoundDetected","event","remove","registerSDKGlobals","globalThis","streamRNVideoSDK","registerCallMediaEngine"],"sourceRoot":"../../../../src","sources":["utils/internal/registerSDKGlobals.ts"],"mappings":";;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,YAAA,GAAAD,OAAA;AACA,IAAAE,kBAAA,GAAAF,OAAA;AAIA,IAAAG,SAAA,GAAAH,OAA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8,7 @@ exports.initAndroidPushToken = initAndroidPushToken;
|
|
|
8
8
|
var _videoClient = require("@stream-io/video-client");
|
|
9
9
|
var _reactNative = require("react-native");
|
|
10
10
|
var _libs = require("./libs");
|
|
11
|
-
var _constants = require("./internal/constants");
|
|
12
|
-
var _utils = require("./internal/utils");
|
|
13
11
|
var _pushLogoutCallback = require("../internal/pushLogoutCallback");
|
|
14
|
-
var _StreamVideoRN = require("../StreamVideoRN");
|
|
15
|
-
var _callingx = require("./libs/callingx");
|
|
16
12
|
let lastFirebaseToken = {
|
|
17
13
|
token: '',
|
|
18
14
|
userId: ''
|
|
@@ -54,181 +50,23 @@ async function initAndroidPushToken(client, pushConfig, setUnsubscribeListener)
|
|
|
54
50
|
logger.debug(`sending firebase token: ${token} for userId: ${userId}`);
|
|
55
51
|
await client.addDevice(token, 'firebase', push_provider_name);
|
|
56
52
|
};
|
|
57
|
-
const messaging =
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
await setDeviceToken(token);
|
|
64
|
-
}
|
|
53
|
+
const messaging = (0, _libs.getFirebaseMessagingLib)();
|
|
54
|
+
logger.debug(`setting firebase token listeners`);
|
|
55
|
+
const unsubscribe = messaging().onTokenRefresh(refreshedToken => setDeviceToken(refreshedToken));
|
|
56
|
+
setUnsubscribeListener(unsubscribe);
|
|
57
|
+
const token = await messaging().getToken();
|
|
58
|
+
await setDeviceToken(token);
|
|
65
59
|
}
|
|
66
|
-
|
|
60
|
+
let firebaseDataHandlerDeprecationLogged = false;
|
|
67
61
|
/**
|
|
68
|
-
*
|
|
69
|
-
*
|
|
62
|
+
* @deprecated Ring notifications are now handled by the SDK internally. This method is a no-op;
|
|
63
|
+
* you can safely remove `firebaseDataHandler(...)` wiring from your Firebase messaging handlers.
|
|
70
64
|
*/
|
|
71
|
-
|
|
72
65
|
const firebaseDataHandler = async data => {
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
call_display_name: '',
|
|
78
|
-
created_by_display_name: 'tommaso',
|
|
79
|
-
created_by_id: 'tommaso-03dcddb7-e9e2-42ec-b2f3-5043aac666ee',
|
|
80
|
-
receiver_id: 'martin-21824f17-319b-401b-a61b-fcab646f0d3f',
|
|
81
|
-
sender: 'stream.video',
|
|
82
|
-
type: 'call.live_started',
|
|
83
|
-
version: 'v2'
|
|
84
|
-
},
|
|
85
|
-
// other stuff
|
|
86
|
-
}
|
|
87
|
-
*/
|
|
88
|
-
if (_reactNative.Platform.OS !== 'android') return;
|
|
89
|
-
const logger = _videoClient.videoLoggerSystem.getLogger('firebaseDataHandler');
|
|
90
|
-
const pushConfig = _StreamVideoRN.StreamVideoRN.getConfig().push;
|
|
91
|
-
if (!pushConfig || !data || data.sender !== 'stream.video') {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
if (data.type === 'call.ring') {
|
|
95
|
-
const call_cid = data.call_cid;
|
|
96
|
-
const callingx = (0, _callingx.getCallingxLib)();
|
|
97
|
-
const client = await pushConfig.createStreamVideoClient();
|
|
98
|
-
if (!client) {
|
|
99
|
-
logger.debug(`video client not found, skipping the call.ring notification`);
|
|
100
|
-
await callingx.stopService();
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
const asForegroundService = (0, _utils.canListenToWS)();
|
|
104
|
-
if (asForegroundService) {
|
|
105
|
-
// Listen to call events from WS with headless task, bound to call service.
|
|
106
|
-
// By this moment the call service is already running, so we can acquire the background task.
|
|
107
|
-
const backgroundTaskOwner = `push:${call_cid}`;
|
|
108
|
-
await callingx.acquireBackgroundTask(backgroundTaskOwner).catch(e => {
|
|
109
|
-
logger.error(`Failed to acquire background task for callCid: ${call_cid} error: ${e}`);
|
|
110
|
-
});
|
|
111
|
-
const finishBackgroundTask = () => {
|
|
112
|
-
callingx.log(`Finishing background task for callCid: ${call_cid}`, 'debug');
|
|
113
|
-
callingx.releaseBackgroundTask(backgroundTaskOwner);
|
|
114
|
-
};
|
|
115
|
-
(async () => {
|
|
116
|
-
try {
|
|
117
|
-
const _client = await pushConfig.createStreamVideoClient();
|
|
118
|
-
if (!_client) {
|
|
119
|
-
logger.debug(`Closing fg service as there is no client to create from push config`);
|
|
120
|
-
finishBackgroundTask();
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
const callFromPush = await _client.onRingingCall(call_cid);
|
|
124
|
-
const {
|
|
125
|
-
mustEndCall,
|
|
126
|
-
endCallReason
|
|
127
|
-
} = (0, _utils.shouldCallBeClosed)(callFromPush, data);
|
|
128
|
-
if (mustEndCall) {
|
|
129
|
-
logger.debug(`Closing fg service callCid: ${call_cid} endCallReason: ${endCallReason}`);
|
|
130
|
-
callingx.log(`Ending call with callCid: ${call_cid} endCallReason: ${endCallReason}`, 'debug');
|
|
131
|
-
callingx.endCallWithReason(call_cid, endCallReason);
|
|
132
|
-
callFromPush.leave({
|
|
133
|
-
reject: false
|
|
134
|
-
}).catch(error => {
|
|
135
|
-
logger.error(`Failed to leave already-ended ringing call ${call_cid}: ${error}`);
|
|
136
|
-
});
|
|
137
|
-
finishBackgroundTask();
|
|
138
|
-
return;
|
|
139
|
-
}
|
|
140
|
-
const unsubscribeFunctions = [];
|
|
141
|
-
// check if service needs to be closed if accept/decline event was done on another device
|
|
142
|
-
const unsubscribe = callFromPush.on('all', event => {
|
|
143
|
-
const _canListenToWS = (0, _utils.canListenToWS)();
|
|
144
|
-
if (!_canListenToWS) {
|
|
145
|
-
logger.debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS}`, {
|
|
146
|
-
event
|
|
147
|
-
});
|
|
148
|
-
unsubscribeFunctions.forEach(fn => fn());
|
|
149
|
-
finishBackgroundTask();
|
|
150
|
-
return;
|
|
151
|
-
}
|
|
152
|
-
const {
|
|
153
|
-
mustEndCall: mustEndCallFromEvent,
|
|
154
|
-
endCallReason: endCallReasonFromEvent
|
|
155
|
-
} = (0, _utils.shouldCallBeClosed)(callFromPush, data);
|
|
156
|
-
if (mustEndCallFromEvent) {
|
|
157
|
-
logger.debug(`Closing fg service from event callCid: ${call_cid} canListenToWS: ${_canListenToWS} shouldCallBeClosed`, {
|
|
158
|
-
event
|
|
159
|
-
});
|
|
160
|
-
unsubscribeFunctions.forEach(fn => fn());
|
|
161
|
-
callingx.endCallWithReason(call_cid, endCallReasonFromEvent);
|
|
162
|
-
finishBackgroundTask();
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
|
|
166
|
-
// check if service needs to be closed if call was left
|
|
167
|
-
const stateSubscription = callFromPush.state.callingState$.subscribe(callingState => {
|
|
168
|
-
if (callingState === _videoClient.CallingState.IDLE || callingState === _videoClient.CallingState.LEFT) {
|
|
169
|
-
logger.debug(`Closing fg service from callingState callCid: ${call_cid} callingState: ${callingState}`);
|
|
170
|
-
unsubscribeFunctions.forEach(fn => fn());
|
|
171
|
-
callingx.log(`Ending call with callCid: ${call_cid} callingState: ${callingState}`, 'debug');
|
|
172
|
-
finishBackgroundTask();
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
const endCallSubscription = callingx.addEventListener('endCall', async ({
|
|
176
|
-
callId
|
|
177
|
-
}) => {
|
|
178
|
-
unsubscribeFunctions.forEach(fn => fn());
|
|
179
|
-
try {
|
|
180
|
-
await callFromPush.leave({
|
|
181
|
-
reject: callFromPush.state.callingState === _videoClient.CallingState.RINGING,
|
|
182
|
-
reason: 'decline'
|
|
183
|
-
});
|
|
184
|
-
} catch (error) {
|
|
185
|
-
logger.error(`Failed to leave call with callCid: ${call_cid} error: ${error}`);
|
|
186
|
-
} finally {
|
|
187
|
-
callingx.log(`Ending call with callCid: ${call_cid} callId: ${callId}`, 'debug');
|
|
188
|
-
finishBackgroundTask();
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
//stop background task when app comes to foreground
|
|
193
|
-
const appStateSubscription = _reactNative.AppState.addEventListener('change', nextAppState => {
|
|
194
|
-
const _canListenToWS = (0, _utils.canListenToWS)();
|
|
195
|
-
callingx.log(`AppState changed to: ${nextAppState} for callCid: ${call_cid} canListenToWS: ${_canListenToWS}`, 'debug');
|
|
196
|
-
if (!_canListenToWS) {
|
|
197
|
-
unsubscribeFunctions.forEach(fn => fn());
|
|
198
|
-
finishBackgroundTask();
|
|
199
|
-
return;
|
|
200
|
-
}
|
|
201
|
-
});
|
|
202
|
-
unsubscribeFunctions.push(unsubscribe);
|
|
203
|
-
unsubscribeFunctions.push(() => stateSubscription.unsubscribe());
|
|
204
|
-
unsubscribeFunctions.push(() => endCallSubscription.remove());
|
|
205
|
-
unsubscribeFunctions.push(() => appStateSubscription.remove());
|
|
206
|
-
_constants.pushUnsubscriptionCallbacks.get(call_cid)?.forEach(cb => cb());
|
|
207
|
-
_constants.pushUnsubscriptionCallbacks.set(call_cid, unsubscribeFunctions);
|
|
208
|
-
} catch (error) {
|
|
209
|
-
callingx.log(`Failed to start background task with callCid: ${call_cid} error: ${error}`, 'error');
|
|
210
|
-
finishBackgroundTask();
|
|
211
|
-
}
|
|
212
|
-
})();
|
|
213
|
-
}
|
|
214
|
-
if (asForegroundService) {
|
|
215
|
-
// no need to check if call has be closed as that will be handled by the fg service
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
const callFromPush = await client.onRingingCall(call_cid);
|
|
219
|
-
const {
|
|
220
|
-
mustEndCall,
|
|
221
|
-
endCallReason
|
|
222
|
-
} = (0, _utils.shouldCallBeClosed)(callFromPush, data);
|
|
223
|
-
if (mustEndCall) {
|
|
224
|
-
logger.debug(`Removing incoming call notification immediately with callCid: ${call_cid} as it should be closed`);
|
|
225
|
-
callingx.endCallWithReason(call_cid, endCallReason);
|
|
226
|
-
callFromPush.leave({
|
|
227
|
-
reject: false
|
|
228
|
-
}).catch(error => {
|
|
229
|
-
logger.error(`Failed to leave already-ended ringing call ${call_cid}: ${error}`);
|
|
230
|
-
});
|
|
231
|
-
}
|
|
66
|
+
void data;
|
|
67
|
+
if (!firebaseDataHandlerDeprecationLogged) {
|
|
68
|
+
firebaseDataHandlerDeprecationLogged = true;
|
|
69
|
+
console.warn('[@stream-io/video-react-native-sdk] `firebaseDataHandler` is deprecated. Ring notifications are now handled by the SDK internally — you can remove calls to it from your Firebase messaging handlers.');
|
|
232
70
|
}
|
|
233
71
|
};
|
|
234
72
|
exports.firebaseDataHandler = firebaseDataHandler;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["_videoClient","require","_reactNative","_libs","
|
|
1
|
+
{"version":3,"names":["_videoClient","require","_reactNative","_libs","_pushLogoutCallback","lastFirebaseToken","token","userId","initAndroidPushToken","client","pushConfig","setUnsubscribeListener","Platform","OS","android","pushProviderName","logger","videoLoggerSystem","getLogger","setDeviceToken","streamClient","_user","id","anonymous","debug","setPushLogoutCallback","removeDevice","err","warn","push_provider_name","addDevice","messaging","getFirebaseMessagingLib","unsubscribe","onTokenRefresh","refreshedToken","getToken","firebaseDataHandlerDeprecationLogged","firebaseDataHandler","data","console","exports"],"sourceRoot":"../../../../src","sources":["utils/push/android.ts"],"mappings":";;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAEA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAIA,IAAII,iBAAiB,GAAG;EAAEC,KAAK,EAAE,EAAE;EAAEC,MAAM,EAAE;AAAG,CAAC;;AAEjD;AACO,eAAeC,oBAAoBA,CACxCC,MAAyB,EACzBC,UAAsB,EACtBC,sBAAyD,EACzD;EACA,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,IAAI,CAACH,UAAU,CAACI,OAAO,EAAEC,gBAAgB,EAAE;IACtE;EACF;EACA,MAAMC,MAAM,GAAGC,8BAAiB,CAACC,SAAS,CAAC,sBAAsB,CAAC;EAClE,MAAMC,cAAc,GAAG,MAAOb,KAAa,IAAK;IAC9C,MAAMC,MAAM,GAAGE,MAAM,CAACW,YAAY,CAACC,KAAK,EAA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