// Module ID: 14033 // Function ID: 14034 // Name: getCurrentEmbeddedChannel // Dependencies: [8499, 2045, 4739, 8501, 14029, 2] // Exports: default // Module 14033 (getCurrentEmbeddedChannel) import Constants from "Constants" /* 4739 */; import EmbeddedSurfaceType from "EmbeddedSurfaceType" /* 8501 */; import getCurrentEmbeddedActivityChannelDefault from "getCurrentEmbeddedActivityChannel" /* 14029 */; import FramesStore from "FramesStore" /* 8499 */; import ChannelStore from "ChannelStore" /* 2045 */; import size from "module_2" /* 2 */; const TransportTypes = Constants.TransportTypes; 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.EmbeddedSurfaceType.MAIN !== type) { return ChannelStore.getChannel(surface.channelId); } } else { return getCurrentEmbeddedActivityChannelDefault(); } } };