decord/source/components_native/TouchableStreamPreview.tsx

156 lines
6.7 KiB
TypeScript
Raw Normal View History

2026-08-13 17:34:28 +00:00
// Module ID: 10913
// Function ID: 10914
2026-07-20 16:05:17 +00:00
// Name: StreamPreviewContainer
2026-08-13 17:34:28 +00:00
// Dependencies: [19, 17, 4359, 4364, 1218, 1391, 1910, 3989, 4361, 676, 21, 4342, 4191, 712, 4527, 589, 1236, 5170, 4524, 4549, 4538, 4408, 4771, 10914, 4338, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-13 17:34:28 +00:00
// Module 10913 (StreamPreviewContainer)
2026-07-29 08:29:29 +00:00
import transitionToStream from "transitionToStream";
2026-08-13 07:00:46 +00:00
import get_ActivityIndicator from "module_5170";
2026-07-29 08:29:29 +00:00
import set from "set";
import reset from "reset";
import fetchFingerprint from "fetchFingerprint";
import ensureGuildLoaded from "ensureGuildLoaded";
import createGuildRecordFromRust from "createGuildRecordFromRust";
import getUncachedChannelPermissions from "getUncachedChannelPermissions";
import updateVoiceState from "updateVoiceState";
2026-07-23 10:11:24 +00:00
import { Permissions } from "ME";
2026-07-29 08:29:29 +00:00
import { jsx } from "isStreamKey";
import createCacheKey from "createCacheKey";
import hexToRgba from "hexToRgba";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let StyleSheet;
let c4;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function StreamPreviewContainer(disableTransition) {
disableTransition = disableTransition.disableTransition;
const onPress = disableTransition.onPress;
const stream = disableTransition.stream;
const channel = disableTransition.channel;
2026-07-29 08:29:29 +00:00
const tmp = createCacheKey();
2026-07-23 10:11:24 +00:00
let obj = disableTransition(stream[14]);
let obj1 = disableTransition(stream[15]);
2026-07-29 08:29:29 +00:00
const items = [set];
const stateFromStores = obj1.useStateFromStores(items, () => null != remoteSessionId.getRemoteSessionId());
2026-07-23 10:11:24 +00:00
let obj2 = disableTransition(stream[15]);
2026-07-29 08:29:29 +00:00
const items1 = [getUncachedChannelPermissions];
2026-07-23 10:11:24 +00:00
const stateFromStores1 = obj2.useStateFromStores(items1, () => !outer1_10.can(outer1_12.CONNECT, channel));
2026-07-29 08:29:29 +00:00
const isChannelFullResult = obj.isChannelFull(channel, updateVoiceState, createGuildRecordFromRust);
const items2 = [updateVoiceState];
let stateFromStores2 = disableTransition(stream[15]).useStateFromStores(items2, () => outer1_11.isInChannel(channel.id));
const obj4 = disableTransition(stream[15]);
const items3 = [reset, fetchFingerprint];
2026-07-20 16:05:17 +00:00
const items4 = [channel.id, stream.ownerId];
2026-07-23 10:11:24 +00:00
const stateFromStores3 = disableTransition(stream[15]).useStateFromStores(items3, () => {
let isSelfStreamHiddenResult = stream.ownerId === outer1_7.getId();
2026-07-20 16:05:17 +00:00
if (isSelfStreamHiddenResult) {
2026-07-23 10:11:24 +00:00
isSelfStreamHiddenResult = outer1_6.isSelfStreamHidden(channel.id);
2026-07-20 16:05:17 +00:00
}
return isSelfStreamHiddenResult;
}, items4);
2026-07-23 10:11:24 +00:00
const intl = disableTransition(stream[16]).intl;
let stringResult = intl.string(disableTransition(stream[16]).t["7Xq/nV"]);
2026-07-20 16:05:17 +00:00
if (stateFromStores) {
2026-07-29 08:29:29 +00:00
const intl4 = tmp2(tmp3[16]).intl;
let stringResult1 = intl4.string(tmp2(tmp3[16]).t.gcnYT2);
2026-07-20 16:05:17 +00:00
let flag = true;
} else {
if (!stateFromStores2) {
2026-07-29 08:29:29 +00:00
stateFromStores2 = stateFromStores3;
2026-07-20 16:05:17 +00:00
}
flag = false;
2026-07-29 08:29:29 +00:00
stringResult1 = stringResult;
if (!stateFromStores2) {
2026-07-20 16:05:17 +00:00
if (isChannelFullResult) {
2026-07-29 08:29:29 +00:00
const intl3 = tmp2(tmp3[16]).intl;
stringResult = intl3.string(tmp2(tmp3[16]).t.rZfiNq);
2026-07-20 16:05:17 +00:00
let flag2 = true;
} else {
flag2 = false;
if (stateFromStores1) {
2026-07-29 08:29:29 +00:00
const intl2 = tmp2(tmp3[16]).intl;
stringResult = intl2.string(tmp2(tmp3[16]).t.TVBCKZ);
2026-07-20 16:05:17 +00:00
flag2 = true;
}
}
flag = flag2;
2026-07-29 08:29:29 +00:00
stringResult1 = stringResult;
2026-07-20 16:05:17 +00:00
}
}
const items5 = [stream, disableTransition, onPress];
2026-07-23 10:11:24 +00:00
const callback = channel.useCallback(() => {
2026-07-20 16:05:17 +00:00
const voiceChannel = onPress(stream[17]).selectVoiceChannel(stream.channelId);
const obj = onPress(stream[17]);
2026-07-29 08:29:29 +00:00
const tmp5 = disableTransition;
2026-07-20 16:05:17 +00:00
disableTransition(stream[18]).watchStream(stream);
if (disableTransition) {
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(tmp2[20]);
const result = tmpResult.rebuildRTCActiveChannels();
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp(tmp2[19])(tmp3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmpResult = tmp(tmp2[20]);
2026-07-20 16:05:17 +00:00
const obj2 = disableTransition(stream[18]);
2026-07-29 08:29:29 +00:00
const participant = tmpResult.selectParticipant(tmp3.channelId, tmp5(stream[21]).encodeStreamKey(tmp3));
if (onPress != null) {
2026-07-20 16:05:17 +00:00
onPress();
}
}, items5);
2026-07-23 10:11:24 +00:00
onPress(stream[22])(() => {
2026-07-20 16:05:17 +00:00
if (channel.isGuildStageVoice()) {
2026-07-29 08:29:29 +00:00
disableTransition(stream[18]).watchStream(stream, { noFocus: true });
const obj = disableTransition(stream[18]);
2026-07-20 16:05:17 +00:00
}
});
2026-07-29 08:29:29 +00:00
obj = { stream, ctaText: stringResult1, style: items6, onPress: callback, disabled: flag, children: null };
items6 = [tmp.touchable, disableTransition.style];
obj = { style: tmp.ctaWrapper, children: null };
obj1 = { style: tmp.ctaBackground, children: null };
2026-07-23 10:11:24 +00:00
const obj5 = disableTransition(stream[15]);
obj2 = { style: tmp.ctaText, variant: "text-md/semibold", color: "text-overlay-light", children: stringResult1 };
2026-07-29 08:29:29 +00:00
obj1[1] = jsx(disableTransition(stream[24]).Text, { style: tmp.ctaText, variant: "text-md/semibold", color: "text-overlay-light", children: stringResult1 });
obj[1] = <closure_4 style={tmp.ctaBackground}>{null}</closure_4>;
obj[5] = <closure_4 style={tmp.ctaWrapper}>{null}</closure_4>;
return jsx(onPress(stream[23]), { style: tmp.ctaWrapper, children: null });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
({ View: c4, StyleSheet } = get_ActivityIndicator);
createCacheKey = { touchable: { borderRadius: 5, overflow: "hidden" }, ctaWrapper: null, ctaBackground: null, ctaText: null };
createCacheKey = {};
let merged = Object.assign(StyleSheet.absoluteFillObject);
createCacheKey.alignItems = "center";
createCacheKey.justifyContent = "center";
createCacheKey.backgroundColor = hexToRgba.hexWithOpacity(require("Themes").unsafe_rawColors.PRIMARY_700, 0.7);
createCacheKey[1] = createCacheKey;
createCacheKey[2] = { height: 40, paddingHorizontal: 16, borderRadius: 20, backgroundColor: require("Themes").unsafe_rawColors.PRIMARY_500, justifyContent: "center", alignItems: "center" };
createCacheKey[3] = { lineHeight: 20 };
createCacheKey = createCacheKey.createStyles(createCacheKey);
let obj1 = { height: 40, paddingHorizontal: 16, borderRadius: 20, backgroundColor: require("Themes").unsafe_rawColors.PRIMARY_500, justifyContent: "center", alignItems: "center" };
let result = require("set").fileFinishedImporting("components_native/TouchableStreamPreview.tsx");
2026-07-20 16:05:17 +00:00
export default function VoiceChannelSettingsStreamPreview(arg0) {
2026-07-23 10:11:24 +00:00
const _require = arg0;
2026-07-29 08:29:29 +00:00
let obj = _require(589);
const items = [reset];
2026-07-23 10:11:24 +00:00
const stateFromStores = obj.useStateFromStores(items, () => outer1_6.getStreamForUser(closure_0.userId, closure_0.guildId));
2026-07-29 08:29:29 +00:00
const items1 = [ensureGuildLoaded];
const stateFromStores1 = _require(589).useStateFromStores(items1, () => {
2026-07-20 16:05:17 +00:00
let channel = null;
if (null != stateFromStores) {
2026-07-29 08:29:29 +00:00
channel = outer1_8.getChannel(tmp.channelId);
2026-07-20 16:05:17 +00:00
}
return channel;
});
let tmp3 = null;
if (null != stateFromStores) {
tmp3 = null;
if (null != stateFromStores1) {
obj = {};
const merged = Object.assign(arg0);
2026-07-29 08:29:29 +00:00
obj.stream = stateFromStores;
obj.channel = stateFromStores1;
2026-07-23 10:11:24 +00:00
tmp3 = <StreamPreviewContainer />;
2026-07-20 16:05:17 +00:00
}
}
return tmp3;
};