decord/source/modules/user_profile/native/BotUserProfileOverflowMenu.tsx

312 lines
12 KiB
TypeScript
Raw Normal View History

2026-08-12 06:57:52 +00:00
// Module ID: 12330
// Function ID: 12331
2026-07-20 16:05:17 +00:00
// Name: BotUserProfileOverflowMenu
2026-08-12 06:57:52 +00:00
// Dependencies: [19, 1391, 3998, 1979, 1922, 676, 10410, 21, 589, 12331, 8833, 5767, 5787, 8828, 1236, 9289, 4312, 10412, 2007, 503, 7825, 10411, 12332, 12332, 500, 12037, 698, 5795, 4189, 4061, 7630, 8382, 11580, 4034, 12333, 8643, 7792, 8649, 712, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-12 06:57:52 +00:00
// Module 12330 (BotUserProfileOverflowMenu)
2026-07-29 08:29:29 +00:00
import encodeProperties from "encodeProperties";
import ensureGuildLoaded from "ensureGuildLoaded";
2026-08-11 06:20:06 +00:00
import markAllUserIdListsStale from "markAllUserIdListsStale";
2026-07-29 08:29:29 +00:00
import handleConnectionOpen from "handleConnectionOpen";
import mergeGuildAvatar from "mergeGuildAvatar";
2026-07-23 10:11:24 +00:00
import ME from "ME";
import IGNORE_CONFIRMATION_ACTION_SHEET_KEY from "IGNORE_CONFIRMATION_ACTION_SHEET_KEY";
2026-07-29 08:29:29 +00:00
import { jsx } from "BlockedInformationTable";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c10;
let c9;
2026-07-23 10:11:24 +00:00
let closure_12;
2026-07-29 08:29:29 +00:00
let map1;
let metroImportAll;
let unpackModuleId;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-29 08:29:29 +00:00
({ AnalyticEvents: metroImportAll, ApplicationFlags: c9, ChannelTypesSets: c10, RelationshipTypes: unpackModuleId } = ME);
({ BLOCK_CONFIRMATION_ACTION_SHEET_KEY: closure_12, IGNORE_CONFIRMATION_ACTION_SHEET_KEY: map1 } = IGNORE_CONFIRMATION_ACTION_SHEET_KEY);
2026-08-11 06:20:06 +00:00
let result = require("markAllUserIdListsStale").fileFinishedImporting("modules/user_profile/native/BotUserProfileOverflowMenu.tsx");
2026-07-20 16:05:17 +00:00
export default function BotUserProfileOverflowMenu(application) {
let isIgnored;
let relationshipType;
application = application.application;
const user = application.user;
const channel = application.channel;
2026-07-29 08:29:29 +00:00
let stateFromStores;
let context;
let trackUserProfileAction;
let analyticsLocations;
let newestAnalyticsLocation;
let currentUser;
2026-07-20 16:05:17 +00:00
let constants;
let id;
let guildId;
let closure_12;
let installAppPropsFromProfileApplication;
2026-07-23 10:11:24 +00:00
let obj = application(channel[8]);
const items = [trackUserProfileAction];
2026-07-20 16:05:17 +00:00
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => ({ relationshipType: trackUserProfileAction.getRelationshipType(user.id), isIgnored: trackUserProfileAction.isIgnored(user.id) }));
({ relationshipType, isIgnored } = stateFromStoresObject);
2026-07-23 10:11:24 +00:00
let obj1 = application(channel[8]);
const items1 = [analyticsLocations, context];
2026-07-29 08:29:29 +00:00
stateFromStores = obj1.useStateFromStores(items1, () => context.getChannel(analyticsLocations.getChannelId()));
2026-07-23 10:11:24 +00:00
let obj2 = application(channel[9]);
let result = obj2.isIarUserReportingEnabled("User Profile Options - Mobile");
let obj3 = application(channel[10]);
2026-07-20 16:05:17 +00:00
const userProfileAnalyticsContext = obj3.useUserProfileAnalyticsContext();
2026-07-23 10:11:24 +00:00
context = userProfileAnalyticsContext.context;
trackUserProfileAction = userProfileAnalyticsContext.trackUserProfileAction;
2026-07-29 08:29:29 +00:00
const tmp7Result = user(channel[11])(user(channel[12]).USER_PROFILE_OVERFLOW_MENU);
analyticsLocations = tmp7Result.analyticsLocations;
newestAnalyticsLocation = tmp7Result.newestAnalyticsLocation;
currentUser = newestAnalyticsLocation.getCurrentUser();
2026-07-20 16:05:17 +00:00
const items2 = [user.id, , , ];
id = undefined;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
id = channel.id;
}
items2[1] = id;
items2[2] = context;
items2[3] = analyticsLocations;
2026-07-29 08:29:29 +00:00
constants = stateFromStores.useCallback((showGuildProfile) => {
2026-07-20 16:05:17 +00:00
const obj = {};
const merged = Object.assign(context);
2026-07-29 08:29:29 +00:00
obj.showGuildProfile = showGuildProfile;
obj.userId = user.id;
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
id = channel.id;
}
2026-07-29 08:29:29 +00:00
obj.channelId = id;
obj.sourceAnalyticsLocations = analyticsLocations;
obj.ignoreBlockedSpeedBump = true;
2026-07-20 16:05:17 +00:00
user(channel[13])(obj);
}, items2);
id = user.id;
guildId = undefined;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
guildId = channel.getGuildId();
}
2026-07-29 08:29:29 +00:00
const items3 = [];
2026-07-20 16:05:17 +00:00
if (isIgnored) {
2026-07-29 08:29:29 +00:00
if (!tmp12) {
obj = { label: null, action: null };
let intl = tmp(tmp2[14]).intl;
obj[0] = intl.string(tmp(tmp2[14]).t["8wXU9B"]);
obj[1] = function action() {
2026-07-20 16:05:17 +00:00
trackUserProfileAction({ action: "UNIGNORE", analyticsLocations });
let id;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
id = channel.id;
}
user(channel[15]).unignoreUser(id, newestAnalyticsLocation, id);
callback();
};
2026-07-29 08:29:29 +00:00
items3.push(obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp12) {
obj = { label: null, action: null };
const intl3 = tmp(tmp2[14]).intl;
obj[0] = intl3.string(tmp(tmp2[14]).t.XyHpKH);
obj[1] = function action() {
2026-07-20 16:05:17 +00:00
let obj = { action: "UNBLOCK", analyticsLocations };
trackUserProfileAction(obj);
obj = { location: newestAnalyticsLocation };
user(channel[15]).unblockUser(id, obj);
const obj2 = user(channel[15]);
2026-07-29 08:29:29 +00:00
const tmp2 = id;
2026-07-23 10:11:24 +00:00
id = undefined;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
id = channel.id;
}
2026-07-29 08:29:29 +00:00
const result = user(channel[20]).showUnblockSuccessToast(tmp2, id);
2026-07-20 16:05:17 +00:00
callback();
};
2026-07-29 08:29:29 +00:00
items3.push(obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp12) {
obj1 = { label: null, variant: "destructive", action: null };
const intl4 = tmp(tmp2[14]).intl;
obj1[0] = intl4.string(tmp(tmp2[14]).t.l4Emac);
obj1[2] = function action() {
2026-07-20 16:05:17 +00:00
let obj = { action: "BLOCK", analyticsLocations };
trackUserProfileAction(obj);
const obj2 = user(channel[16]);
2026-07-29 08:29:29 +00:00
const tmp2 = channel;
const tmp3 = application;
obj = { userId: id, channelId: null, onSuccess: null, impressionName: null };
2026-07-23 10:11:24 +00:00
id = undefined;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
id = channel.id;
}
2026-07-29 08:29:29 +00:00
obj[1] = id;
obj[2] = function onSuccess() {
callback();
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[3] = tmp3(tmp2[19]).ImpressionNames.BLOCK_USER_CONFIRMATION;
2026-07-20 16:05:17 +00:00
obj2.openLazy(application(channel[18])(channel[21], channel.paths), closure_12, obj, "stack");
};
2026-07-29 08:29:29 +00:00
items3.push(obj1);
2026-07-20 16:05:17 +00:00
if (result) {
2026-07-29 08:29:29 +00:00
obj2 = { label: null, variant: "destructive", action: null };
const intl6 = tmp(tmp2[14]).intl;
obj2[0] = intl6.string(tmp(tmp2[14]).t.jhJzez);
obj2[2] = function action() {
2026-07-20 16:05:17 +00:00
let obj = { action: "REPORT", analyticsLocations };
trackUserProfileAction(obj);
2026-07-29 08:29:29 +00:00
let tmp3;
2026-07-20 16:05:17 +00:00
if ("@me" !== guildId) {
2026-07-29 08:29:29 +00:00
if (null !== tmp2) {
tmp3 = tmp2;
2026-07-20 16:05:17 +00:00
}
}
const obj2 = user(channel[16]);
2026-07-29 08:29:29 +00:00
obj = { user, entrypoint: "UserProfileOverflowMenu", contextualGuildId: tmp3, contextualChannelId: null };
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (channel != null) {
2026-07-20 16:05:17 +00:00
id = channel.id;
}
2026-07-29 08:29:29 +00:00
obj[3] = id;
2026-07-20 16:05:17 +00:00
obj2.openLazy(application(channel[18])(channel[22], channel.paths), application(channel[23]).BOT_REPORT_CHOOSER_KEY, obj, "replaceAll");
};
2026-07-29 08:29:29 +00:00
items3.push(obj2);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(tmp2[24]);
if (tmpResult.isAndroid()) {
obj3 = { label: null, variant: "destructive", action: null };
const intl5 = tmp(tmp2[14]).intl;
obj3[0] = intl5.string(tmp(tmp2[14]).t.TbHyMG);
obj3[2] = function action() {
2026-07-20 16:05:17 +00:00
let obj = { action: "REPORT", analyticsLocations };
trackUserProfileAction(obj);
application(channel[25]).alertUserReported();
const obj2 = application(channel[25]);
obj = { reported_user_id: id };
user(channel[26]).track(closure_8.TNS_USER_REPORT_SUBMITTED, obj);
};
2026-07-29 08:29:29 +00:00
items3.push(obj3);
2026-07-20 16:05:17 +00:00
}
}
}
2026-07-29 08:29:29 +00:00
const items4 = [];
const obj4 = { label: null, action: null };
const intl7 = tmp(tmp2[14]).intl;
obj4[0] = intl7.string(tmp(tmp2[14]).t.y5MwJy);
obj4[1] = function action() {
2026-07-20 16:05:17 +00:00
trackUserProfileAction({ action: "COPY_USERNAME", analyticsLocations });
const obj = { action: "COPY_USERNAME", analyticsLocations };
const obj2 = application(channel[27]);
2026-07-23 10:11:24 +00:00
obj2.copy(user(channel[28]).getUserTag(user, { decoration: "never", identifiable: "always" }));
2026-07-20 16:05:17 +00:00
const obj3 = user(channel[28]);
const result = application(channel[29]).presentUsernameCopied();
callback();
};
2026-07-29 08:29:29 +00:00
items4.push(obj4);
2026-07-20 16:05:17 +00:00
if (null != application) {
2026-07-29 08:29:29 +00:00
tmpResult = tmp(tmp2[30]);
closure_12 = tmpResult.hasApplicationFlag(application, constants.EMBEDDED);
installAppPropsFromProfileApplication = tmp(tmp2[31]).getInstallAppPropsFromProfileApplication(application);
let obj5 = { label: null, action: null };
const intl10 = tmp(tmp2[14]).intl;
obj5[0] = intl10.string(tmp(tmp2[14]).t.WqhZss);
obj5[1] = function action() {
2026-07-20 16:05:17 +00:00
let obj = { action: "COPY_APP_LINK", analyticsLocations };
trackUserProfileAction(obj);
const obj2 = application(channel[32]);
if (closure_12) {
2026-07-29 08:29:29 +00:00
obj = { applicationId: null, referrerId: null };
obj[0] = application.id;
2026-07-20 16:05:17 +00:00
let id;
2026-07-29 08:29:29 +00:00
if (closure_8 != null) {
2026-07-20 16:05:17 +00:00
id = closure_8.id;
}
2026-07-29 08:29:29 +00:00
obj[1] = id;
2026-07-20 16:05:17 +00:00
let activityLaunchURL = obj2.getActivityLaunchURL(obj);
} else {
2026-07-29 08:29:29 +00:00
obj = { id: null };
obj[0] = application.id;
2026-07-20 16:05:17 +00:00
const merged = Object.assign(closure_13);
activityLaunchURL = obj2.getApplicationInstallURL(obj);
}
application(channel[27]).copy(activityLaunchURL);
const obj5 = application(channel[27]);
application(channel[29]).presentLinkCopied();
};
2026-07-29 08:29:29 +00:00
items4.push(obj5);
const tmpResult1 = tmp(tmp2[31]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const DeveloperMode = tmp(tmp2[33]).DeveloperMode;
2026-07-20 16:05:17 +00:00
if (DeveloperMode.getSetting()) {
2026-07-29 08:29:29 +00:00
const obj6 = { label: null, action: null };
const intl8 = tmp(tmp2[14]).intl;
obj6[0] = intl8.string(tmp(tmp2[14]).t["/AXYnE"]);
obj6[1] = function action() {
2026-07-20 16:05:17 +00:00
trackUserProfileAction({ action: "COPY_USER_ID", analyticsLocations });
application(channel[27]).copy(id);
const obj = { action: "COPY_USER_ID", analyticsLocations };
const obj2 = application(channel[27]);
application(channel[29]).presentIdCopied();
callback();
};
2026-07-29 08:29:29 +00:00
items4.push(obj6);
2026-07-20 16:05:17 +00:00
}
let hasItem = null != channel && null != stateFromStores;
if (hasItem) {
const TEXTUAL = id.TEXTUAL;
hasItem = TEXTUAL.has(stateFromStores.type);
}
if (hasItem) {
2026-07-29 08:29:29 +00:00
const obj7 = { label: null, action: null };
const intl9 = tmp(tmp2[14]).intl;
obj7[0] = intl9.string(tmp(tmp2[14]).t.PHjkRE);
obj7[1] = function action() {
2026-07-20 16:05:17 +00:00
return user(channel[34])({ userId: id, selectedChannel: stateFromStores, showUserProfile: closure_9, analyticsLocations });
};
2026-07-29 08:29:29 +00:00
items4.push(obj7);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (0 !== items4.length) {
const obj8 = { value: null, children: null };
obj8[0] = analyticsLocations;
const obj9 = { items: null, children: null };
const items5 = [items4, items3];
obj9[0] = items5;
obj9[1] = function children(ref) {
const merged = Object.assign(ref, Object.create(null));
let obj = { ref: ref.ref };
2026-07-20 16:05:17 +00:00
const merged1 = Object.assign(merged);
2026-07-29 08:29:29 +00:00
obj.size = "sm";
obj.variant = "secondary-overlay";
2026-07-20 16:05:17 +00:00
const intl = application(channel[14]).intl;
2026-07-29 08:29:29 +00:00
obj.accessibilityLabel = intl.string(application(channel[14]).t["+zofAD"]);
obj = { size: "sm", color: null };
obj[1] = user(channel[38]).colors.WHITE;
obj.icon = callback2(application(channel[37]).MoreHorizontalIcon, obj);
return callback2(application(channel[36]).IconButton, obj);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj8[1] = jsx(tmp(tmp2[35]).ContextMenu, { items: null, children: null });
let tmp24 = jsx(tmp(tmp2[11]).AnalyticsLocationProvider, { value: null, children: null });
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmp24 = null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp24;
2026-07-20 16:05:17 +00:00
}
if (relationshipType !== guildId.BLOCKED) {
2026-07-29 08:29:29 +00:00
const obj10 = { label: null, action: null };
const intl2 = tmp(tmp2[14]).intl;
obj10[0] = intl2.string(tmp(tmp2[14]).t.ytCpKs);
obj10[1] = function action() {
2026-07-20 16:05:17 +00:00
let obj = { action: "IGNORE", analyticsLocations };
trackUserProfileAction(obj);
const obj2 = user(channel[16]);
obj = {
userId: id,
onSuccess() {
2026-07-29 08:29:29 +00:00
callback();
2026-07-20 16:05:17 +00:00
},
impressionName: application(channel[19]).ImpressionNames.IGNORE_USER_CONFIRMATION
};
obj2.openLazy(application(channel[18])(channel[17], channel.paths), closure_13, obj, "stack");
};
2026-07-29 08:29:29 +00:00
items3.push(obj10);
2026-07-20 16:05:17 +00:00
}
};