// Metro module 10829 (f10830).
import { memo, useEffect } from "react";
import { ScrollView, View, StyleSheet } from "react-native";
import ChannelStore from "../../stores/ChannelStore";
import GuildStore from "../../stores/GuildStore";
import RTCConnectionStore from "../../stores/RTCConnectionStore";
import RTCDebugStore from "../../stores/RTCDebugStore";
import StreamRTCConnectionStore from "../../stores/StreamRTCConnectionStore";
import UserStore from "../../stores/UserStore";
import { MediaEngineContextTypes } from "../../_bundle/Module4250";
import { createStyles } from "../../design/components/Styles/native/createStyles";
import { hexWithOpacity } from "../../utils/ColorUtils";
import Module712 from "../../_bundle/Module712";
import { LegacyText } from "../../design/void/native";
import { useStateFromStoresObject, useStateFromStores } from "../../_bundle/Module589";
import useChannelName from "../../modules/channel/useChannelName";
import RTCConnectionUtils from "../../utils/RTCConnectionUtils";
import { open, close } from "../../actions/RTCDebugActionCreators";
import Dispatcher from "../../Dispatcher";
import { SafeAreaPaddingView } from "../common/SafeAreaView";
import { Button } from "../../design/components/Button/native/Button.native";
import { intl, t } from "../../intl/index.native";
let asString, useStyles, Section, ObjectKV, Component2, Component3, RTCDebugGeneral, c7276_25, RTCDebugContext;
const Text = function Text(props) {
return ;
};
Section = function Section(props) {
const { title, children } = props;
return <>
{title}
:
{children}
>;
};
ObjectKV = function ObjectKV({ obj }) {
const styles = useStyles();
return Object.entries(obj).map((item) => {
const [key, r30] = item;
const obj = Array.isArray(r30) ? typeof r30.at(-1)?.value === "number" ? r30.at(-1).value : r30 : r30;
return obj != null && typeof obj === "object" ? :
{key}
{": "}
{"" + obj}
;
});
};
RTCDebugGeneral = function RTCDebugGeneral() {
let guildId, channelId;
const stateFromStoresObject = useStateFromStoresObject([RTCConnectionStore], () => ({
guildId: RTCConnectionStore.getGuildId(),
channelId: RTCConnectionStore.getChannelId()
}), []);
guildId = stateFromStoresObject.guildId;
channelId = stateFromStoresObject.channelId;
const stateFromStores = useStateFromStores([GuildStore], () => GuildStore.getGuild(guildId), [guildId]);
return
ChannelStore.getChannel(channelId), [channelId]))
}
}} />
;
};
RTCDebugContext = function RTCDebugContext({ context }) {
const stateFromStores = useStateFromStores([RTCDebugStore], () => RTCDebugStore.getAllStats(context), [context]);
return stateFromStores == null ? null : stateFromStores.length !== 0 ? stateFromStores.map((stateFromStore) => {
const Component = c7276_25[context];
const r22 = Component != null ? : null;
let inbound;
const r27 = [r22, ,
{stateFromStore.rtp.outbound.map((item, index) => )}
, ,];
inbound = stateFromStore.rtp.inbound;
const r44 = Object.keys(inbound);
r27[3] = r44.length !== 0 ? : null;
return ;
}) : null;
};
asString = (a0) => {};
useStyles = createStyles({
container: {
...StyleSheet.absoluteFillObject,
backgroundColor: hexWithOpacity(Module712.unsafe_rawColors.BLACK, 0.7)
},
scroller: {
flex: 1,
margin: 8
},
indent: {
marginLeft: 16
},
row: {
flexDirection: "row"
},
text: {
color: Module712.unsafe_rawColors.WHITE,
fontSize: 14
},
buttonClose: {
flexGrow: 0,
margin: 8
}
});
Component2 = memo(({ data }) => {
const { type, ...rest } = data;
return ;
});
Component3 = memo(({ userId, data }) => {
const stateFromStores = useStateFromStores([UserStore], () => UserStore.getUser(userId), [userId]);
const r21 = `${userId}`;
return
{data.map((item, index) => )}
;
});
const r80 = {};
r80[MediaEngineContextTypes.DEFAULT] = function DefaultContextInfo() {
return ({
mediaSessionId: RTCConnectionStore.getMediaSessionId(),
state: RTCConnectionStore.getState(),
hostname: RTCConnectionUtils.getShortHostname(RTCConnectionStore.getHostname()),
quality: RTCConnectionStore.getQuality(),
averagePing: RTCConnectionStore.getAveragePing(),
lastPing: RTCConnectionStore.getLastPing(),
outboundLossRate: RTCConnectionStore.getOutboundLossRate(),
duration: RTCConnectionStore.getDuration()
}), [])} />;
};
r80[MediaEngineContextTypes.STREAM] = function StreamContextInfo() {
const r7 = StreamRTCConnectionStore.getAllActiveStreamKeys()[0];
let c18293_0 = r7;
return ({
mediaSessionId: StreamRTCConnectionStore.getMediaSessionId(c18293_0),
hostname: RTCConnectionUtils.getShortHostname(StreamRTCConnectionStore.getHostname(c18293_0)),
quality: StreamRTCConnectionStore.getQuality(c18293_0)
}), [r7])} />;
};
c7276_25 = r80;
export default function RTCDebugOverlay(props) {
const { onClose, style } = props;
const styles2 = useStyles();
useEffect(() => {
open();
return () => Dispatcher.wait(close);
}, []);
return
{Object.values(MediaEngineContextTypes).map((item) => )}
;
};