// Metro module 10848 (f10849). import * as Module19 from "react"; import { useContext, useCallback, useMemo } from "react"; import { StyleSheet, View } from "react-native"; import ApplicationStreamingStore from "../../../../stores/ApplicationStreamingStore"; import UserStore from "../../../../stores/UserStore"; import { resetFocus, toggleFocus } from "../ChannelCallStore"; import { ParticipantTypes, VoicePlatforms, isStreamParticipant } from "../../../calls/CallConstants"; import { createStyles } from "../../../../design/components/Styles/native/createStyles"; import { hexOpacityToRgba } from "../../../../utils/ColorUtils"; import Module712 from "../../../../_bundle/Module712"; import useAnalyticsLocations from "../../../app_analytics/useAnalyticsLocations"; import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native"; import { useStateFromStoresObject, useStateFromStores } from "../../../../_bundle/Module589"; import ChannelRTCActionCreators from "../../../../actions/ChannelRTCActionCreators"; import showUserProfileActionSheet from "../../../user_profile/native/showUserProfileActionSheet"; import StreamTile from "./StreamTile"; import ScreenshareParticipant from "./ScreenshareParticipant"; import UserTile from "./UserTile"; import ActivityTile from "./ActivityTile"; import TouchableStreamPreview from "../../../../components_native/TouchableStreamPreview"; import Module10854 from "../../../../_bundle/Module10854"; import Module10855 from "../../../../_bundle/Module10855"; import Module9033 from "../../../../_bundle/Module9033"; import Module9054 from "../../../../_bundle/Module9054"; import Module10856 from "../../../../_bundle/Module10856"; import * as _native from "../../../../design/void/native"; import { Icon, LiveTag } from "../../../../design/void/native"; import { RevealContext } from "./RevealProvider"; import ReanimatedRexport, { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport"; import * as _timing from "../../../../design/animation/reanimated/timing/timing"; import ParticipantTitle from "./ParticipantTitle"; let useStyles, ParticipantIcon, __initData, TileOverlay; const StreamPreviewTile = function StreamPreviewTile(props) { const { participant: participant2, style } = props; return resetFocus()} /> ; }; ParticipantIcon = function ParticipantIcon(props) { let source; const participant2 = props.participant; const styles = useStyles(); if (participant2.type === ParticipantTypes.STREAM) { source = Module10854; } else { const type = participant2.type; const USER = ParticipantTypes.USER; source = void 0; if (type === USER) { const voicePlatform = participant2.voicePlatform; source = VoicePlatforms.MOBILE === voicePlatform ? Module10855 : VoicePlatforms.XBOX === voicePlatform ? Module9033 : VoicePlatforms.PLAYSTATION === voicePlatform ? Module9054 : VoicePlatforms.QUEST === voicePlatform ? Module10856 : void 0; } } return source != null ? : null; }; TileOverlay = function TileOverlay(props) { const participant2 = props.participant; let isActiveStream = props.isActiveStream; const { channel: channel2, hasLeftSafeArea, hasRightSafeArea: hasRightSafeArea2, hasBottomSafeArea: hasBottomSafeArea2, hasTopSafeArea } = props; const styles = useStyles(); const safeAreaInsets_native = useSafeAreaInsets_native(); const { bottom: bottom2, left, top, right: right2 } = safeAreaInsets_native; const reveal = useContext(RevealContext).reveal; const T = function T() { return { opacity: _timing.withTiming(reveal ? 1 : 0, { easing: _native.STANDARD_EASING, duration: 250 }) }; }; T.__closure = { withTiming: _timing.withTiming, reveal, STANDARD_EASING: _native.STANDARD_EASING }; T.__workletHash = 15640123774063; T.__initData = __initData; const animatedStyle = useAnimatedStyle(T); const r45 = { bottom: hasBottomSafeArea2 ? bottom2 : 0, right: hasRightSafeArea2 ? right2 : 0, left: hasLeftSafeArea ? left : 0, top: hasTopSafeArea ? top : 0 }; if (isActiveStream) { isActiveStream = ; } return {isActiveStream} ; }; useStyles = createStyles({ liveContainer: { position: "absolute", top: 8, right: 8 }, titleIcon: { marginRight: 6 }, usernameContainer: { flexDirection: "row", alignItems: "center", alignSelf: "flex-start", backgroundColor: hexOpacityToRgba(Module712.unsafe_rawColors.PRIMARY_700, 0.5), borderRadius: Module712.radii.sm, paddingHorizontal: 8, paddingVertical: 4 }, usernamePosition: { overflow: "hidden", position: "absolute", bottom: 8, left: 8, right: 40, borderRadius: Module712.radii.sm }, streamPreview: { flex: 1, width: "100%", backgroundColor: Module712.unsafe_rawColors.PRIMARY_600 }, screenshareContainer: { flex: 1, alignItems: "center", justifyContent: "center", overflow: "hidden", width: "100%", backgroundColor: Module712.colors.BLACK }, stageStreamContainer: { backgroundColor: Module712.colors.BLACK } }); const r83 = Module19.memo(function({ participant, avatarSize, channel, hasTopSafeArea, hasLeftSafeArea, hasRightSafeArea, hasBottomSafeArea, shrinkStreamEmptyState, contentStyle, hasNotch = false, resizeMode }) { const styles = useStyles(); const analyticsLocations = useAnalyticsLocations().analyticsLocations; const safeAreaInsets_native = useSafeAreaInsets_native(); const { bottom, right } = safeAreaInsets_native; const stateFromStoresObject = useStateFromStoresObject([ApplicationStreamingStore], () => ({ stream: isStreamParticipant(participant) ? ApplicationStreamingStore.getStreamForUser(participant.user.id, participant.stream.guildId) : null, activeStream: isStreamParticipant(participant) ? ApplicationStreamingStore.getActiveStreamForUser(participant.user.id, participant.stream.guildId) : null })); const { stream, activeStream } = stateFromStoresObject; const callback = useCallback(() => { resetFocus(); ChannelRTCActionCreators.selectParticipant(channel.id, participant.id); }, [channel.id, participant.id]); const callback2 = useCallback((a0) => { showUserProfileActionSheet({ userId: a0.user.id, channelId: channel.id, isVoiceContext: true, sourceAnalyticsLocations: analyticsLocations }); }, [channel.id, analyticsLocations]); const memo = useMemo(() => ({ bottom: hasBottomSafeArea ? 8 + bottom : 8, right: hasRightSafeArea ? 8 + right : 8 }), [hasBottomSafeArea, hasRightSafeArea, bottom, right]); const stateFromStores = useStateFromStores([UserStore], () => UserStore.getCurrentUser()); const type = participant.type; return <> {ParticipantTypes.HIDDEN_STREAM === type ? : ParticipantTypes.STREAM === type ? activeStream != null ? activeStream.ownerId !== stateFromStores?.id ? : : stream != null ? : null : ParticipantTypes.USER === type ? : ParticipantTypes.ACTIVITY === type ? : null} {participant.type !== ParticipantTypes.ACTIVITY ? : null} ; }); __initData = { code: "function CallTileTsx1(){const{withTiming,reveal,STANDARD_EASING}=this.__closure;return{opacity:withTiming(reveal?1:0,{easing:STANDARD_EASING,duration:250})};}" }; export default r83; export { StreamPreviewTile }; export { TileOverlay };