2026-09-26 17:57:22 +00:00
|
|
|
// Module ID: 14783
|
|
|
|
|
// Function ID: 14784
|
2026-09-21 13:40:21 +00:00
|
|
|
// Name: getCurrentEmbeddedChannel
|
2026-09-26 17:57:22 +00:00
|
|
|
// Dependencies: [9345, 2041, 4692, 9346, 14779, 2]
|
2026-09-21 13:40:21 +00:00
|
|
|
// Exports: default
|
|
|
|
|
|
2026-09-26 17:57:22 +00:00
|
|
|
// Module 14783 (getCurrentEmbeddedChannel)
|
|
|
|
|
import getCurrentEmbeddedActivityChannelDefault from "getCurrentEmbeddedActivityChannel" /* 14779 */;
|
|
|
|
|
import FramesStore from "FramesStore" /* 9345 */;
|
|
|
|
|
import ChannelStore from "ChannelStore" /* 2041 */;
|
2026-09-21 13:40:21 +00:00
|
|
|
|
2026-09-26 17:57:22 +00:00
|
|
|
const TransportTypes = fn(4692).TransportTypes;
|
|
|
|
|
const EmbeddedSurfaceType = fn(9346).EmbeddedSurfaceType;
|
2026-09-21 13:40:21 +00:00
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/rpc/helpers/getCurrentEmbeddedChannel.tsx");
|
|
|
|
|
|
|
|
|
|
export default function getCurrentEmbeddedChannel(source) {
|
|
|
|
|
if (source.source.type === TransportTypes.POST_MESSAGE) {
|
|
|
|
|
const frameByIframeId = FramesStore.getFrameByIframeId(source.source.iframeId);
|
|
|
|
|
let surface;
|
|
|
|
|
if (frameByIframeId != null) {
|
|
|
|
|
surface = frameByIframeId.surface;
|
|
|
|
|
}
|
|
|
|
|
if (null != surface) {
|
|
|
|
|
const type = surface.type;
|
|
|
|
|
if (EmbeddedSurfaceType.MAIN !== type) {
|
|
|
|
|
return ChannelStore.getChannel(surface.channelId);
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return getCurrentEmbeddedActivityChannelDefault();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
};
|