decord/source/modules/spoiler_channels/native/ChannelSpoiler.tsx

170 lines
7.1 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 11889
// Function ID: 11890
2026-07-20 16:05:17 +00:00
// Name: ChannelSpoiler
2026-08-24 06:08:38 +00:00
// Dependencies: [32, 19, 17, 4778, 1391, 1910, 11487, 21, 4668, 712, 589, 4989, 11488, 8703, 6815, 4234, 6870, 4739, 1236, 4738, 6844, 5438, 11888, 5259, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 11889 (ChannelSpoiler)
import ThemesDefault from "Themes" /* 712 */;
import computeChannelNameDefault from "computeChannelName" /* 4989 */;
import GatedContentDefault from "GatedContent" /* 11888 */;
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import closure_6 from "getParticipants" /* 4778 */;
import closure_7 from "ensureGuildLoaded" /* 1391 */;
import closure_8 from "createGuildRecordFromRust" /* 1910 */;
import { VoicePanelControlsModes } from "VoicePanelControlsModes" /* 11487 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
createCacheKey = { subtitle: { textAlign: "center", lineHeight: 22 }, subtitleContainer: { alignItems: "center" }, divider: null, subtitleMeasure: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { height: 1, width: "100%", backgroundColor: ThemesDefault.colors.BORDER_SUBTLE, marginVertical: 16 };
2026-07-29 08:29:29 +00:00
createCacheKey[2] = createCacheKey;
createCacheKey[3] = { position: "absolute", opacity: 0, left: 0, right: 0 };
2026-08-24 06:08:38 +00:00
let closure_12 = createCacheKey.createStyles(createCacheKey);
const result = require("set").fileFinishedImporting("modules/spoiler_channels/native/ChannelSpoiler.tsx");
2026-07-20 16:05:17 +00:00
export default function ChannelSpoiler(channelId) {
2026-07-23 10:11:24 +00:00
const _require = channelId;
2026-07-29 08:29:29 +00:00
let obj = _require(589);
2026-08-24 06:08:38 +00:00
const items = [closure_8];
const stateFromStores = obj.useStateFromStores(items, () => closure_1_8.getGuild(channelId.guildId));
obj1 = _require(589);
const items1 = [closure_7];
const stateFromStores1 = obj1.useStateFromStores(items1, () => closure_1_7.getChannel(channelId.channelId));
const tmp4 = callback3();
2026-07-29 08:29:29 +00:00
let obj3 = React;
const tmp5 = setControlsMode(React.useState(false), 2);
2026-08-24 06:08:38 +00:00
importDefault = tmp5[1];
2026-07-20 16:05:17 +00:00
let isVocalResult;
2026-07-29 08:29:29 +00:00
if (stateFromStores1 != null) {
2026-07-20 16:05:17 +00:00
isVocalResult = stateFromStores1.isVocal();
}
2026-08-24 06:08:38 +00:00
dependencyMap = isVocalResult;
setControlsMode = obj3.useContext(tmp6(11488)).setControlsMode;
2026-07-20 16:05:17 +00:00
const items2 = [, , , ];
({ guildId: arr3[0], channelId: arr3[1] } = channelId);
items2[2] = setControlsMode;
items2[3] = isVocalResult;
2026-07-29 08:29:29 +00:00
const callback = obj3.useCallback(() => {
2026-07-23 10:11:24 +00:00
if (closure_2) {
2026-08-24 06:08:38 +00:00
if (closure_1_6.getChatOpen(channelId.channelId)) {
2026-07-29 08:29:29 +00:00
callback(isVocalResult[13]).updateChatOpen(tmp2.channelId, false);
let obj = { mode: null };
2026-08-24 06:08:38 +00:00
obj[0] = closure_1_9.FLOATING_DEFAULT;
2026-07-20 16:05:17 +00:00
setControlsMode(obj);
}
2026-07-29 08:29:29 +00:00
tmp2 = channelId;
2026-07-20 16:05:17 +00:00
}
obj = callback(isVocalResult[14]);
2026-07-23 10:11:24 +00:00
obj.nsfwReturnToSafety(channelId.guildId);
2026-07-20 16:05:17 +00:00
}, items2);
const items3 = [channelId.channelId];
2026-07-29 08:29:29 +00:00
const callback1 = obj3.useCallback((nativeEvent) => {
2026-07-20 16:05:17 +00:00
callback(nativeEvent.nativeEvent.lines.length > 3);
}, []);
let channelIconComponent = null;
2026-07-29 08:29:29 +00:00
const callback2 = obj3.useCallback(() => {
2026-07-23 10:11:24 +00:00
let obj = channelId(isVocalResult[15]);
2026-07-20 16:05:17 +00:00
const rootNavigationRef = obj.getRootNavigationRef();
2026-07-29 08:29:29 +00:00
if (rootNavigationRef != null) {
obj = { channelId: null, expandTopic: true };
obj[0] = channelId.channelId;
2026-07-20 16:05:17 +00:00
rootNavigationRef.navigate("sidebar", obj);
}
}, items3);
if (null != stateFromStores1) {
2026-08-24 06:08:38 +00:00
channelIconComponent = tmp(6870).getChannelIconComponent(stateFromStores1);
const tmpResult = tmp(6870);
2026-07-20 16:05:17 +00:00
}
if (null != channelIconComponent) {
2026-07-29 08:29:29 +00:00
obj = { style: null, children: null };
obj[0] = { flexDirection: "row", alignItems: "center", gap: 4, flexShrink: 1 };
2026-07-23 10:11:24 +00:00
const items4 = [callback(channelIconComponent, { size: "lg", color: "mobile-text-heading-primary" }), ];
2026-07-29 08:29:29 +00:00
obj = { variant: "heading-xxl/bold", color: "mobile-text-heading-primary", lineClamp: 1, style: null, children: null };
obj[3] = { flexShrink: 1 };
obj[4] = tmp7;
2026-08-24 06:08:38 +00:00
items4[1] = callback(tmp(4739).Text, obj);
2026-07-29 08:29:29 +00:00
obj[1] = items4;
2026-07-23 10:11:24 +00:00
let stringResult = callback2(View, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const intl = tmp(1236).intl;
stringResult = intl.string(tmp(1236).t["q38/ae"]);
2026-07-20 16:05:17 +00:00
}
let topic;
2026-07-29 08:29:29 +00:00
if (stateFromStores1 != null) {
2026-07-20 16:05:17 +00:00
topic = stateFromStores1.topic;
}
2026-07-29 08:29:29 +00:00
let tmp23Result = null;
2026-07-20 16:05:17 +00:00
if (null != topic) {
2026-07-29 08:29:29 +00:00
tmp23Result = null;
2026-07-20 16:05:17 +00:00
if ("" !== str.trim()) {
2026-07-29 08:29:29 +00:00
obj1 = { spacing: 4, style: null, children: null };
obj1[1] = tmp4.subtitleContainer;
const obj2 = { style: null, pointerEvents: "none", children: null };
obj2[0] = tmp4.subtitleMeasure;
obj3 = { variant: "text-md/medium", maxFontSizeMultiplier: 2, onTextLayout: null, children: null };
obj3[2] = callback1;
2026-08-24 06:08:38 +00:00
let tmp6Result = tmp6(6844);
2026-07-29 08:29:29 +00:00
const obj4 = { channelId: null };
obj4[0] = stateFromStores1.id;
obj3[3] = tmp6Result.parseTopic(stateFromStores1.topic, true, obj4);
2026-08-24 06:08:38 +00:00
obj2[2] = callback(tmp(4739).Text, obj3);
2026-07-29 08:29:29 +00:00
const items5 = [callback(View, obj2), , , ];
const obj5 = { color: "text-muted", variant: "text-md/medium", style: null, maxFontSizeMultiplier: 2, lineClamp: 3, children: null };
obj5[2] = tmp4.subtitle;
2026-08-24 06:08:38 +00:00
tmp6Result = tmp6(6844);
2026-07-29 08:29:29 +00:00
const obj6 = { channelId: null };
obj6[0] = stateFromStores1.id;
obj5[5] = tmp6Result.parseTopic(stateFromStores1.topic, true, obj6);
2026-08-24 06:08:38 +00:00
items5[1] = callback(tmp(4739).Text, obj5);
2026-07-29 08:29:29 +00:00
let tmp24Result = null;
if (tmp5[0]) {
const obj7 = { onPress: null, accessibilityRole: "button", children: null };
obj7[0] = callback2;
const obj8 = { variant: "text-sm/medium", color: "text-brand", style: null, children: null };
obj8[2] = { textDecorationLine: "underline" };
const intl2 = tmp(1236).intl;
obj8[3] = intl2.string(tmp(1236).t["/QvRak"]);
2026-08-24 06:08:38 +00:00
obj7[2] = tmp24(tmp(4739).Text, obj8);
tmp24Result = tmp24(tmp(5438).PressableHighlight, obj7);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items5[2] = tmp24Result;
const obj9 = { style: null };
obj9[0] = tmp4.divider;
items5[3] = callback(View, obj9);
obj1[2] = items5;
2026-08-24 06:08:38 +00:00
tmp23Result = callback2(tmp(4738).Stack, obj1);
2026-07-29 08:29:29 +00:00
const tmp23 = callback2;
const tmp25 = View;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
str = stateFromStores1.topic;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj10 = { modalType: null, onAgree: null, onDisagree: null, title: null, subtitle: null, description: null, agreement: null, disagreement: null, guildId: null, channelId: null };
const tmp20 = callback;
2026-08-24 06:08:38 +00:00
tmp7 = computeChannelNameDefault(stateFromStores1);
obj10[0] = _require(5259).NsfwSpaceWarningModalType.SPOILER_CHANNEL;
2026-07-29 08:29:29 +00:00
obj10[1] = function onAgree() {
2026-07-23 10:11:24 +00:00
callback(isVocalResult[14]).spoilerAgree(channelId.channelId);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj10[2] = callback;
obj10[3] = stringResult;
obj10[4] = tmp23Result;
const intl3 = tmp(1236).intl;
obj10[5] = intl3.string(_require(1236).t["08bm2Z"]);
const intl4 = tmp(1236).intl;
obj10[6] = intl4.string(_require(1236).t.KmRwcW);
const intl5 = tmp(1236).intl;
obj10[7] = intl5.string(_require(1236).t["/g10LC"]);
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (stateFromStores != null) {
2026-07-20 16:05:17 +00:00
id = stateFromStores.id;
}
2026-07-29 08:29:29 +00:00
obj10[8] = id;
obj10[9] = channelId.channelId;
2026-08-24 06:08:38 +00:00
return tmp20(GatedContentDefault, obj10);
2026-07-20 16:05:17 +00:00
};