decord/source/modules/launchpad/native/shared/TextChannel.tsx

202 lines
7.7 KiB
TypeScript
Raw Normal View History

2026-08-05 07:35:12 +00:00
// Module ID: 15910
// Function ID: 15911
// Dependencies: [19, 17, 5176, 1946, 1372, 1301, 4451, 21, 4255, 15902, 712, 15319, 5783, 589, 4445, 8186, 14428, 5838, 4671, 15911, 4696, 11330, 9676, 3933, 15913, 8120, 15211, 15903, 4797, 15914, 15915, 15906, 15909, 2]
2026-07-20 16:05:17 +00:00
2026-08-05 07:35:12 +00:00
// Module 15910
2026-07-29 08:29:29 +00:00
import importAllResult from "usePressUnderlayColor";
import { View } from "isChannelSpoilerGated";
import rebuild from "rebuild";
import _getSystemLocale from "_getSystemLocale";
import ensureGuildLoaded from "ensureGuildLoaded";
2026-07-23 10:11:24 +00:00
import { getThemedRippleConfig } from "semanticColor";
import { UnreadSetting } from "ReadStateTypes";
2026-07-29 08:29:29 +00:00
import jsxProd from "useEmbeddedApps";
import createCacheKey from "createCacheKey";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c10;
let unpackModuleId;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
let c3 = importAllResult;
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
let closure_12 = createCacheKey.createStyles(() => {
let obj = { pressable: null, selectedBorder: null, rowSelected: null };
2026-08-05 07:35:12 +00:00
obj = { flex: 1, borderRadius: importDefault(15902)().container.borderRadius, marginBottom: 1 };
2026-07-29 08:29:29 +00:00
obj[0] = obj;
obj = { position: "absolute", top: 0, bottom: 0, left: 0, right: 0, borderWidth: 1, borderColor: importDefault(712).colors.BORDER_MUTED, borderRadius: importDefault(712).radii.md };
obj[1] = obj;
obj[2] = { borderRadius: importDefault(712).radii.md, backgroundColor: importDefault(712).colors.BACKGROUND_MOD_MUTED };
2026-07-20 16:05:17 +00:00
return obj;
});
2026-07-29 08:29:29 +00:00
const memoResult = importAllResult.memo(function TextChannel(subtitle) {
2026-07-20 16:05:17 +00:00
let isMentionLowImportance;
let isSubscriptionGated;
let mentionCount;
let needSubscriptionToAccess;
let newChannel;
let optInEnabled;
let resolvedUnreadSetting;
let selected;
let showGuildBadgeIcon;
let unread;
2026-07-29 08:29:29 +00:00
const channel = subtitle.channel;
let flag = subtitle.muted;
2026-07-20 16:05:17 +00:00
if (flag === undefined) {
flag = false;
}
2026-07-29 08:29:29 +00:00
let flag2 = subtitle.navigationReplace;
2026-07-20 16:05:17 +00:00
if (flag2 === undefined) {
flag2 = false;
}
2026-07-29 08:29:29 +00:00
({ selected, showGuildBadgeIcon } = subtitle);
2026-07-20 16:05:17 +00:00
if (selected === undefined) {
selected = false;
}
2026-07-23 10:11:24 +00:00
let arr4;
2026-07-20 16:05:17 +00:00
let dependencyMap;
const isForumLikeChannelResult = channel.isForumLikeChannel();
2026-08-05 07:35:12 +00:00
let obj = channel(15319);
2026-07-20 16:05:17 +00:00
const channelUnreadBadgeState = obj.useChannelUnreadBadgeState(channel, flag);
({ newChannel, unread, resolvedUnreadSetting, mentionCount } = channelUnreadBadgeState);
({ optInEnabled, isMentionLowImportance } = channelUnreadBadgeState);
2026-07-29 08:29:29 +00:00
const tmp5 = callback2(flag, unread);
2026-08-05 07:35:12 +00:00
let obj1 = channel(5783);
2026-07-29 08:29:29 +00:00
let obj2 = channel(589);
const items = [rebuild];
2026-07-23 10:11:24 +00:00
const stateFromStores = obj2.useStateFromStores(items, () => outer1_5.getNewThreadCount(channel.guild_id, channel.id));
2026-07-29 08:29:29 +00:00
let obj3 = channel(589);
const items1 = [ensureGuildLoaded];
2026-07-23 10:11:24 +00:00
const stateFromStores1 = obj3.useStateFromStores(items1, () => outer1_7.getChannel(channel.parent_id));
2026-08-05 07:35:12 +00:00
const tmp9 = arr4(4445)(stateFromStores1);
let tmp2Result = tmp2(8186);
2026-07-29 08:29:29 +00:00
const unreadThreadsCountForParent = tmp2Result.useUnreadThreadsCountForParent(channel.guild_id, channel.id);
let tmp12 = unread;
2026-08-05 07:35:12 +00:00
let tmp8Result = tmp8(14428);
2026-07-20 16:05:17 +00:00
if (unread) {
2026-07-29 08:29:29 +00:00
tmp12 = !flag;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const tmp8ResultResult = tmp8Result(channel, { unread: tmp12 });
2026-08-05 07:35:12 +00:00
tmp2Result = tmp2(5838);
2026-07-29 08:29:29 +00:00
const isChannelSpoilerGated = tmp2Result.useIsChannelSpoilerGated(channel);
2026-08-05 07:35:12 +00:00
const fontScale = channel(4671).useFontScale();
const tmp2Result1 = channel(4671);
2026-07-29 08:29:29 +00:00
const items2 = [_getSystemLocale];
const stateFromStores2 = channel(589).useStateFromStores(items2, () => locale.locale);
2026-08-05 07:35:12 +00:00
const tmp17 = arr4(15911)();
2026-07-29 08:29:29 +00:00
const tmp2Result2 = channel(589);
2026-08-05 07:35:12 +00:00
({ isSubscriptionGated, needSubscriptionToAccess } = arr4(4696)(channel.id));
arr4 = tmp8(11330)(channel);
2026-07-29 08:29:29 +00:00
if (null != tmp8ResultResult) {
2026-07-20 16:05:17 +00:00
if (!isChannelSpoilerGated) {
2026-07-29 08:29:29 +00:00
obj = { channel: null, message: null, color: "text-muted", muted: null, layout: null };
obj[0] = channel;
obj[1] = tmp8ResultResult;
obj[3] = flag;
2026-08-05 07:35:12 +00:00
obj[4] = tmp2(3933).ChannelListLayoutTypes.COMPACT;
let result = callback(tmp2(9676).ChannelRowPreview, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
dependencyMap = tmp22;
2026-07-20 16:05:17 +00:00
const items3 = [arr4.length > 0, arr4];
2026-08-05 07:35:12 +00:00
const isActivitiesInTextEnabled = tmp2(8120).useIsActivitiesInTextEnabled(channel.id);
2026-07-20 16:05:17 +00:00
const memo = importAllResult.useMemo(() => {
let tmp = null;
2026-07-23 10:11:24 +00:00
if (_undefined) {
2026-07-29 08:29:29 +00:00
const obj = { embeddedApps: null };
obj[0] = arr4;
2026-07-23 10:11:24 +00:00
tmp = outer1_10(arr4(_undefined[26]), obj);
2026-07-20 16:05:17 +00:00
}
return tmp;
}, items3);
2026-08-05 07:35:12 +00:00
tmp8Result = tmp8(15903);
2026-07-29 08:29:29 +00:00
const items4 = [tmp5.pressable, ];
2026-07-20 16:05:17 +00:00
let rowSelected;
if (selected) {
2026-07-29 08:29:29 +00:00
rowSelected = tmp5.rowSelected;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { style: null, underlayColor: null, androidRippleConfig: null };
2026-07-20 16:05:17 +00:00
items4[1] = rowSelected;
2026-07-29 08:29:29 +00:00
obj[0] = items4;
obj[1] = tmp17;
obj1 = { color: null };
obj1[0] = tmp17;
obj[2] = getThemedRippleConfig(obj1);
const tmp26 = closure_11;
2026-08-05 07:35:12 +00:00
const tmp2Result3 = tmp2(8120);
const merged = Object.assign(tmp2(15914).useTextChannelPressEvents(channel, flag2));
const tmp2Result4 = tmp2(15914);
2026-07-29 08:29:29 +00:00
obj2 = { channel: null, unread: null, mentionCount: null };
obj2[0] = channel;
obj2[1] = unread;
obj2[2] = mentionCount;
2026-08-05 07:35:12 +00:00
const merged1 = Object.assign(tmp2(15915).getChannelAccessibilityProps(obj2));
2026-07-20 16:05:17 +00:00
if (selected) {
2026-07-29 08:29:29 +00:00
obj3 = { style: null, pointerEvents: "none" };
obj3[0] = tmp5.selectedBorder;
selected = callback(View, obj3);
2026-07-20 16:05:17 +00:00
}
const items5 = [selected, ];
2026-07-29 08:29:29 +00:00
const obj4 = { channel: null, channelCategoryName: null, subtitle: null, hasActiveThreads: null, unreadBadge: null, mentionBadge: null, unread: null, resolvedUnreadSetting: null, mentionCount: null, muted: null, channelName: null, fontScale: null, isSubscriptionGated: null, needSubscriptionToAccess: null, showGuildBadgeIcon: null, end: null };
obj4[0] = channel;
obj4[1] = tmp9;
obj4[2] = result;
obj4[3] = obj1.useHasActiveThreads(channel).hasActiveThreads;
2026-08-05 07:35:12 +00:00
const tmp2Result5 = tmp2(15915);
2026-07-29 08:29:29 +00:00
const obj5 = { unread: null, resolvedUnreadSetting: null, muted: null };
obj5[0] = unread;
obj5[1] = resolvedUnreadSetting;
obj5[2] = flag;
2026-08-05 07:35:12 +00:00
obj4[4] = callback(tmp8(15906), obj5);
const tmp8Result1 = tmp8(15915);
2026-07-20 16:05:17 +00:00
if (newChannel) {
newChannel = optInEnabled;
}
2026-07-29 08:29:29 +00:00
const obj6 = { newChannel: null, mentionCount: null, isMentionLowImportance: null, postsWithUnreadsCount: null, newPostCount: null, locale: null };
obj6[0] = newChannel;
obj6[1] = mentionCount;
obj6[2] = isMentionLowImportance;
let tmp38;
2026-07-20 16:05:17 +00:00
if (isForumLikeChannelResult) {
if (unreadThreadsCountForParent > 0) {
if (!flag) {
if (resolvedUnreadSetting === UnreadSetting.ALL_MESSAGES) {
2026-07-29 08:29:29 +00:00
tmp38 = unreadThreadsCountForParent;
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-07-29 08:29:29 +00:00
obj6[3] = tmp38;
let tmp40;
2026-07-20 16:05:17 +00:00
if (isForumLikeChannelResult) {
if (unreadThreadsCountForParent > 0) {
if (!flag) {
2026-07-29 08:29:29 +00:00
tmp40 = stateFromStores;
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
obj6[4] = tmp40;
obj6[5] = stateFromStores2;
2026-08-05 07:35:12 +00:00
obj4[5] = tmp8(15909)(obj6);
2026-07-29 08:29:29 +00:00
obj4[6] = unread;
obj4[7] = resolvedUnreadSetting;
obj4[8] = mentionCount;
obj4[9] = flag;
2026-08-05 07:35:12 +00:00
obj4[10] = tmp8(4445)(channel);
2026-07-29 08:29:29 +00:00
obj4[11] = fontScale;
obj4[12] = isSubscriptionGated;
obj4[13] = needSubscriptionToAccess;
obj4[14] = showGuildBadgeIcon;
let tmp41 = null;
2026-07-20 16:05:17 +00:00
if (isActivitiesInTextEnabled) {
2026-07-29 08:29:29 +00:00
tmp41 = memo;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj4[15] = tmp41;
items5[1] = tmp8Result1(obj4);
obj.children = items5;
2026-08-05 07:35:12 +00:00
return tmp8Result(tmp26(tmp2(4797).PressableHighlight, obj));
2026-07-20 16:05:17 +00:00
}
2026-08-05 07:35:12 +00:00
const tmp18 = arr4(4696)(channel.id);
result = channel(15913).renderChannelSubtitle({ subtitle: subtitle.subtitle, muted: flag, channelId: channel.id, guildId: channel.guild_id });
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
let result = require("rebuild").fileFinishedImporting("modules/launchpad/native/shared/TextChannel.tsx");
2026-07-20 16:05:17 +00:00
export default memoResult;