// Metro module 15111 (f15112). import { memo } from "react"; import { View } from "react-native"; import AccessibilityStore from "../../a11y/AccessibilityStore"; import { AvatarSizes, Avatar, Icon, LiveTag, AVATAR_SIZE_MAP } from "../../../design/void/native"; import { scaleTextLineHeight } from "../../screen/native/useScaledTextLineHeight.android"; import { createStyles } from "../../../design/components/Styles/native/createStyles"; import Module712 from "../../../_bundle/Module712"; import { makeSizeStyle } from "../../main_tabs_v2/native/shared_components/guild_channels/layouts/ChannelListLayout"; import { useStateFromStores } from "../../../_bundle/Module589"; import * as _ReanimatedRexport from "../../reanimated/ReanimatedRexport"; import ReanimatedRexport, { useAnimatedStyle } from "../../reanimated/ReanimatedRexport"; import * as _timing from "../../../design/animation/reanimated/timing/timing"; import AvatarUtils from "../../../utils/AvatarUtils"; import VoiceUserNameItem from "./VoiceUserNameItem"; import { MicrophoneDenyIcon } from "../../../design/components/Icon/native/redesign/generated/MicrophoneDenyIcon"; import { MicrophoneSlashIcon } from "../../../design/components/Icon/native/redesign/generated/MicrophoneSlashIcon"; import { HeadphonesDenyIcon } from "../../../design/components/Icon/native/redesign/generated/HeadphonesDenyIcon"; import { HeadphonesSlashIcon } from "../../../design/components/Icon/native/redesign/generated/HeadphonesSlashIcon"; import { VideoIcon } from "../../../design/components/Icon/native/redesign/generated/VideoIcon"; import Module6614 from "../../../_bundle/Module6614"; import getConsoleIcon, { getConsoleIconForVoicePlatform } from "../../game_console/native/getConsoleIcon"; const variant = "text-sm/medium"; const color = "redesign-channel-name-muted-text"; const XSMALL_20 = AvatarSizes.XSMALL_20; const useStyles = createStyles({ voiceState: { flex: 1, flexDirection: "row", alignItems: "center", paddingVertical: 5 }, disabled: { opacity: 0.5 }, voiceStateCollapsed: { marginTop: 4, marginRight: 8, width: 32, height: 32, borderRadius: Module712.radii.lg, borderWidth: 4, borderColor: Module712.colors.BACKGROUND_BASE_LOW, alignItems: "center", overflow: "hidden" }, voiceStateIcon: { marginLeft: 6, ...makeSizeStyle(14) }, legacyVoiceStateIcon: { tintColor: Module712.colors.REDESIGN_CHANNEL_NAME_MUTED_TEXT, marginLeft: 6 } }); const __initData = { code: "function VoiceUserItemTsx1(){const{ringing,shouldAnimate,PULSE_ENDING_OPACITY,withRepeat,withSequence,withDelay,INNER_PULSE_DELAY,withTiming,PULSE_DURATION,Easing,PULSE_STARTING_OPACITY,FADE_DURATION}=this.__closure;if(!ringing){return{opacity:1.0};}else if(!shouldAnimate){return{opacity:PULSE_ENDING_OPACITY};}return{opacity:withRepeat(withSequence(withDelay(INNER_PULSE_DELAY,withTiming(PULSE_ENDING_OPACITY,{duration:PULSE_DURATION,easing:Easing.bezier(0.4,0.0,1,1)})),withDelay(PULSE_DURATION,withTiming(PULSE_STARTING_OPACITY,{duration:FADE_DURATION}))),-1)};}" }; const r63 = memo(function VoiceUserItem(props) { let r154; let member, user, guildId, ringing, stateFromStores; const getSource = function getSource() { return member != null && member.avatar != null ? AvatarUtils.getGuildMemberAvatarSource(member, user) : user.getAvatarSource(guildId); }; member = props.member; user = props.user; guildId = props.guildId; const { collapsed, stream, serverMute, serverDeaf, mute, deaf, localMute, video, disabled } = props; let platform2 = props.platform; const { isInEmbeddedActivity, voicePlatform } = props; ringing = props.ringing; const styles = useStyles(); stateFromStores = useStateFromStores([AccessibilityStore], () => !AccessibilityStore.useReducedMotion); const c = function c() { return ringing ? stateFromStores ? { opacity: _ReanimatedRexport.withRepeat(_ReanimatedRexport.withSequence(_ReanimatedRexport.withDelay(100, _timing.withTiming(0.4, { duration: 250, easing: _ReanimatedRexport.Easing.bezier(0.4, 0, 1, 1) })), _ReanimatedRexport.withDelay(250, _timing.withTiming(0.1, { duration: 500 }))), -1) } : { opacity: 0.4 } : { opacity: 1 }; }; c.__closure = { ringing, shouldAnimate: stateFromStores, PULSE_ENDING_OPACITY: 0.4, withRepeat: _ReanimatedRexport.withRepeat, withSequence: _ReanimatedRexport.withSequence, withDelay: _ReanimatedRexport.withDelay, INNER_PULSE_DELAY: 100, withTiming: _timing.withTiming, PULSE_DURATION: 250, Easing: _ReanimatedRexport.Easing, PULSE_STARTING_OPACITY: 0.1, FADE_DURATION: 500 }; c.__workletHash = 9430639809025; c.__initData = __initData; const animatedStyle = useAnimatedStyle(c); if (collapsed) { r154 = ; } else { const style = [styles.voiceState, disabled && styles.disabled, animatedStyle]; const r75 = [, , disabled ? null : serverMute ? : localMute ? : mute ? : null, disabled ? null : serverDeaf ? : deaf ? : null, video ? disabled ? null : : null, isInEmbeddedActivity ? : null, , ,]; if (platform2 == null) { platform2 = ""; } let source = getConsoleIcon(platform2); if (source == null) { source = getConsoleIconForVoicePlatform(voicePlatform); } r75[6] = source != null ? : null; r75[7] = stream ? : null; r154 = {r75}; } return r154; }); export default r63; export function getVoiceUserHeight(a0) { return Math.max(scaleTextLineHeight(variant, a0), AVATAR_SIZE_MAP[XSMALL_20]) + 10; }