decord/source/modules/summaries/native/SummaryActionSheet.tsx

200 lines
9 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10878
// Function ID: 10879
2026-07-20 16:05:17 +00:00
// Name: SummaryActionSheet
2026-08-24 06:08:38 +00:00
// Dependencies: [19, 17, 1391, 4999, 10590, 676, 21, 4346, 10878, 2008, 4668, 712, 7272, 10849, 4096, 1236, 4984, 9104, 7550, 7562, 4233, 11, 1222, 6988, 6840, 10879, 4739, 10881, 10882, 10885, 8213, 2]
2026-07-20 16:05:17 +00:00
// Exports: default, openSummaryDividerActionSheet
2026-08-24 06:08:38 +00:00
// Module 10878 (SummaryActionSheet)
import ThemesDefault from "Themes" /* 712 */;
import asyncRequireImpl from "asyncRequireImpl" /* 2008 */;
import ACTION_SHEET_HEIGHT_HALFDefault from "ACTION_SHEET_HEIGHT_HALF" /* 4346 */;
import closure_3 from "noop" /* 19 */;
import { View } from "get ActivityIndicator" /* 17 */;
import closure_5 from "ensureGuildLoaded" /* 1391 */;
import closure_6 from "reinjectEphemerals" /* 4999 */;
import closure_7 from "handleQuickSwitcherUpdate" /* 10590 */;
import ME from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
import createCacheKey from "createCacheKey" /* 4668 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
({ AnalyticsSections: closure_8, MessageFlags: c9 } = ME);
2026-07-29 08:29:29 +00:00
({ jsx: c10, jsxs: unpackModuleId } = jsxProd);
createCacheKey = { summaryContainer: { padding: 16, margin: 16, marginBottom: 24, justifyContent: "center", alignItems: "center" }, summaryContent: { textAlign: "center" }, summaryIconContainer: null, summaryIcon: null, summaryTopic: null, divider: null, actionsContainer: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { marginBottom: 8, borderRadius: ThemesDefault.radii.round, border: 1, overflow: "hidden", alignItems: "center", justifyContent: "center", backgroundColor: ThemesDefault.colors.BACKGROUND_BRAND };
2026-07-29 08:29:29 +00:00
createCacheKey[2] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[3] = { margin: 8, width: 20, height: 20, tintColor: ThemesDefault.colors.WHITE };
2026-07-29 08:29:29 +00:00
createCacheKey[4] = { marginBottom: 4 };
2026-08-24 06:08:38 +00:00
const obj1 = { margin: 8, width: 20, height: 20, tintColor: ThemesDefault.colors.WHITE };
createCacheKey[5] = { height: 1, backgroundColor: ThemesDefault.colors.BORDER_SUBTLE };
2026-07-29 08:29:29 +00:00
createCacheKey[6] = { flexDirection: "row", justifyContent: "space-evenly", marginBottom: 16 };
2026-08-24 06:08:38 +00:00
let closure_12 = createCacheKey.createStyles(createCacheKey);
let obj2 = { height: 1, backgroundColor: ThemesDefault.colors.BORDER_SUBTLE };
let result = require("set").fileFinishedImporting("modules/summaries/native/SummaryActionSheet.tsx");
2026-07-20 16:05:17 +00:00
export default function SummaryActionSheet(summary) {
summary = summary.summary;
2026-07-29 08:29:29 +00:00
let channel;
let message;
2026-08-24 06:08:38 +00:00
const tmp = callback3();
2026-07-29 08:29:29 +00:00
let obj = React;
2026-07-23 10:11:24 +00:00
channel = channel.getChannel(summary.channelId);
message = message.getMessage(summary.channelId, summary.startId);
2026-07-20 16:05:17 +00:00
let hasFlagResult = null != message;
if (hasFlagResult) {
hasFlagResult = message.hasFlag(constants.HAS_THREAD);
}
let canStartPublicThread = null != channel && null != message;
if (canStartPublicThread) {
canStartPublicThread = !message.hasFlag(constants.HAS_THREAD);
}
if (canStartPublicThread) {
2026-07-29 08:29:29 +00:00
let obj2 = summary(message[12]);
canStartPublicThread = obj2.computeCanStartPublicThread(channel, message);
2026-07-20 16:05:17 +00:00
}
let guild_id;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
guild_id = channel.guild_id;
}
const items = [guild_id];
const items1 = [summary, channel];
2026-07-29 08:29:29 +00:00
const callback = obj.useCallback(() => {
2026-07-20 16:05:17 +00:00
let obj = channel(message[7]);
obj.hideActionSheet();
let guild_id;
2026-07-29 08:29:29 +00:00
if (channel != null) {
guild_id = tmp4.guild_id;
2026-07-20 16:05:17 +00:00
}
if (null != guild_id) {
let guild_id1;
2026-07-29 08:29:29 +00:00
const tmpResult = channel(tmp2[7]);
if (tmp4 != null) {
guild_id1 = tmp4.guild_id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { guildId: null };
obj[0] = guild_id1;
tmpResult.openLazy(summary(tmp2[9])(tmp2[13], tmp2.paths), "GuildHighlightsNotifications", obj);
const tmp7 = summary(tmp2[9])(tmp2[13], tmp2.paths);
2026-07-20 16:05:17 +00:00
}
}, items);
const items2 = [summary, channel, message];
2026-07-29 08:29:29 +00:00
const callback1 = obj.useCallback(() => {
2026-07-20 16:05:17 +00:00
let obj = channel(message[7]);
obj.hideActionSheet();
if (null != channel) {
2026-07-29 08:29:29 +00:00
const intl2 = summary(tmp[15]).intl;
obj = { topic: null, url: null };
obj[0] = summary.topic;
const obj4 = summary(tmp[16]);
obj[1] = obj4.getChannelPermalink(tmp3.guild_id, tmp3.id, summary.startId, summary.id);
const formatToPlainStringResult = intl2.formatToPlainString(summary(tmp[15]).t.I3yTDn, obj);
obj = { message: null, subject: null };
obj[0] = formatToPlainStringResult;
obj[1] = summary.topic;
2026-08-24 06:08:38 +00:00
summary(tmp[17]).showShareActionSheet(obj, closure_1_8.SUMMARY_ACTION_SHEET);
2026-07-29 08:29:29 +00:00
const obj5 = summary(tmp[17]);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const intl = summary(tmp[15]).intl;
summary(tmp[14]).presentFailedToast(intl.string(summary(tmp[15]).t.gvkcQl));
const obj2 = summary(tmp[14]);
2026-07-20 16:05:17 +00:00
}
}, items1);
const items3 = [channel, message];
2026-07-29 08:29:29 +00:00
const callback2 = obj.useCallback(() => {
2026-07-20 16:05:17 +00:00
let obj = channel(message[7]);
obj.hideActionSheet();
if (null != channel) {
if (null != message) {
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(tmp2[18]);
2026-08-24 06:08:38 +00:00
const result = tmpResult.openThreadCreationForMobile(tmp4, summary.startId, closure_1_8.SUMMARY_ACTION_SHEET);
2026-07-29 08:29:29 +00:00
tmpResult = tmp(tmp2[19]);
obj = { name: null };
obj[0] = summary.topic;
tmpResult.changeThreadSettings(tmp4.id, obj);
const obj6 = summary(tmp2[20]);
const tmp11 = summary;
if (!obj6.navigateToCreateThread(tmp4.guild_id, tmpResult1.castMessageIdAsChannelId(tmp5.id))) {
const tmp11Result = tmp11(tmp2[22]);
tmp11Result.transitionToGuild(tmp4.guild_id, tmp(tmp2[21]).castMessageIdAsChannelId(tmp5.id));
const tmpResult2 = tmp(tmp2[21]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmpResult1 = tmp(tmp2[21]);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
const intl = summary(tmp2[15]).intl;
2026-07-23 10:11:24 +00:00
summary(message[14]).presentError(intl.string(summary(message[15]).t["/+DWeQ"]));
2026-07-20 16:05:17 +00:00
}, items2);
2026-08-24 06:08:38 +00:00
callback3 = obj.useCallback(() => {
2026-07-20 16:05:17 +00:00
channel(message[7]).hideActionSheet();
2026-07-29 08:29:29 +00:00
let tmp5 = null != channel;
if (tmp5) {
tmp5 = null != message;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp5) {
const obj2 = summary(tmp2[22]);
obj2.transitionToGuild(channel.guild_id, channel(tmp2[21]).castMessageIdAsChannelId(message.id));
const tmpResult = channel(tmp2[21]);
2026-07-20 16:05:17 +00:00
}
}, items3);
2026-07-29 08:29:29 +00:00
obj = { ref: React.useRef(null), children: null };
obj = { style: tmp.summaryContainer, children: null };
2026-08-24 06:08:38 +00:00
const ref = React.useRef(null);
2026-07-29 08:29:29 +00:00
obj2 = { style: tmp.summaryIcon, size: "custom" };
2026-08-24 06:08:38 +00:00
const items4 = [callback(View, { style: tmp.summaryIconContainer, children: callback(summary(message[25]).TopicsIcon, obj2) }), , ];
2026-07-20 16:05:17 +00:00
const items5 = [, ];
({ summaryContent: arr6[0], summaryTopic: arr6[1] } = tmp);
2026-07-29 08:29:29 +00:00
items4[1] = callback(summary(message[26]).Text, { style: items5, variant: "heading-md/extrabold", color: "mobile-text-heading-primary", children: summary.topic });
2026-07-20 16:05:17 +00:00
const items6 = [tmp.summaryContent];
2026-07-29 08:29:29 +00:00
items4[2] = callback(summary(message[26]).Text, { style: items6, variant: "heading-md/medium", color: "text-default", children: summary.summShort });
obj[1] = items4;
const items7 = [callback2(View, obj), callback(View, { style: tmp.divider }), ];
let obj6 = { style: tmp.actionsContainer, children: null };
const obj7 = { label: null, iconSource: null, onPress: null };
2026-07-23 10:11:24 +00:00
let intl = summary(message[15]).intl;
2026-07-29 08:29:29 +00:00
obj7[0] = intl.string(summary(message[15]).t["NY/nlb"]);
obj7[1] = channel(message[28]);
obj7[2] = callback1;
const items8 = [callback(summary(message[27]).SummaryActionSheetButton, obj7), , , ];
2026-07-20 16:05:17 +00:00
if (canStartPublicThread) {
2026-07-29 08:29:29 +00:00
const obj8 = { label: null, iconSource: null, onPress: null };
let intl2 = tmp16(tmp17[15]).intl;
obj8[0] = intl2.string(tmp16(tmp17[15]).t.rBIGBL);
obj8[1] = tmp20(tmp17[29]);
obj8[2] = callback2;
canStartPublicThread = tmp15(tmp16(tmp17[27]).SummaryActionSheetButton, obj8);
2026-07-20 16:05:17 +00:00
}
items8[1] = canStartPublicThread;
if (hasFlagResult) {
2026-07-29 08:29:29 +00:00
const obj9 = { label: null, iconSource: null, onPress: null };
const intl3 = tmp16(tmp17[15]).intl;
obj9[0] = intl3.string(tmp16(tmp17[15]).t["39d0Wj"]);
obj9[1] = tmp20(tmp17[29]);
obj9[2] = callback3;
hasFlagResult = tmp15(tmp16(tmp17[27]).SummaryActionSheetButton, obj9);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj10 = { bottom: true, children: null };
2026-07-20 16:05:17 +00:00
items8[2] = hasFlagResult;
2026-07-29 08:29:29 +00:00
const obj11 = { label: null, iconSource: null, onPress: null };
const intl4 = tmp16(tmp17[15]).intl;
obj11[0] = intl4.string(summary(message[15]).t.QLkZ39);
obj11[1] = channel(message[30]);
obj11[2] = callback;
2026-07-23 10:11:24 +00:00
items8[3] = callback(summary(message[27]).SummaryActionSheetButton, obj11);
2026-07-29 08:29:29 +00:00
obj6[1] = items8;
items7[2] = callback2(View, obj6);
obj10[1] = items7;
obj[1] = callback2(summary(message[24]).SafeAreaPaddingView, obj10);
2026-07-23 10:11:24 +00:00
return callback(summary(message[23]).BottomSheet, obj);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const openSummaryDividerActionSheet = function openSummaryDividerActionSheet(channelId, summaryId) {
2026-08-24 06:08:38 +00:00
const findSummaryResult = closure_7.findSummary(channelId, summaryId);
2026-07-20 16:05:17 +00:00
if (null != findSummaryResult) {
2026-08-24 06:08:38 +00:00
let obj = ACTION_SHEET_HEIGHT_HALFDefault;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
obj = { summary: null };
obj[0] = findSummaryResult;
2026-08-24 06:08:38 +00:00
obj.openLazy(asyncRequireImpl(10878, dependencyMap.paths), "SummaryDivider" + summaryId, obj);
const tmp5 = asyncRequireImpl(10878, dependencyMap.paths);
2026-07-20 16:05:17 +00:00
}
};