Files
discord-decomp/sources/modules/guild_automod/native/ModerateUserActionSheet.tsx
T
2026-07-28 01:06:53 +03:00

225 lines
15 KiB
TypeScript

/* Metro module 11450; source: modules/guild_automod/native/ModerateUserActionSheet.tsx; dependencies: [31, 1945, 1867, 3784, 1878, 661, 33, 4501, 566, 10289, 8037, 4617, 4080, 6807, 1244, 7002, 5080, 10296, 1962, 11449, 3773, 10317, 10299, 4054, 10321, 9409, 10323, 6275, 6758, 11451, 6231, 2] */
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import GuildMemberStore from '../../../stores/GuildMemberStore.tsx'; /* Metro dependency 1945 */
import PermissionStore from '../../../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */
import NicknameUtils from '../../../utils/NicknameUtils.tsx'; /* Metro dependency 4617 */
import ModalActionCreators from '../../../actions/ModalActionCreators.tsx'; /* Metro dependency 5080 */
import ShowKickConfirmModal from '../../guild_moderation/native/showKickConfirmModal.tsx'; /* Metro dependency 10321 */
import ShowBanConfirmModal from '../../guild_moderation/native/showBanConfirmModal.tsx'; /* Metro dependency 10323 */
import ShowModerateUserActionSheet from './showModerateUserActionSheet.tsx'; /* Metro dependency 11449 */
import MemberRolesList from '../../../components_native/MemberRolesList.tsx'; /* Metro dependency 11451 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as TableRowGroupNativeModule from '../../../design/components/TableRow/native/TableRowGroup.native.tsx'; /* Metro dependency 6231 */
import * as BottomSheetNativeModule from '../../../design/components/Sheet/native/BottomSheet.native.tsx'; /* Metro dependency 6275 */
import * as BottomSheetTitleHeaderNativeModule from '../../../design/components/Sheet/native/BottomSheetTitleHeader.native.tsx'; /* Metro dependency 6758 */
import * as GuildDisableCommunicationActionCreatorsNativeModule from '../../guild_communication_disabled/GuildDisableCommunicationActionCreators.native.tsx'; /* Metro dependency 10299 */
function _fun87660(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87660, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:6, offset: 0x01fc6bfc, size: 310 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactModule;
const env0_11 = (CreateStylesModule).createStyles({container: {'padding': 16,
'gap': 16}, memberRoles: {justifyContent: 'flex-start'}});
value = value.memo(_fun87661);
(FileImportTrackerModule).fileFinishedImporting('modules/guild_automod/native/ModerateUserActionSheet.tsx');
exports.default = value;
function _fun87661({user, guild}) { // fn#87661, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:308, offset: 0x01fc6d32, size: 1415 bytes, params: 2, frame: 33
var r8;
var r7;
var push;
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
var t;
var isMemberCommunicationDisabled2;
const styles = useStyles();
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore], function() {
return GuildMemberStore.getMember(guild?.id, user.id);
}, [user, guild]);
const r12 = value2 != null ? value2.roles : [];
const {canKickUser, canBanUser, canChangeNick, canManageRoles,
canModerateMembers} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([PermissionStore,
UserStore, GuildStore], _fun87663, [user, guild]);
if (guild == null) {
return null;
}
if (value2 == null) {
return null;
}
const name = (NicknameUtils).getName(guild.id, undefined, user);
items2 = [];
const value5 = value2 != null;
if (value5) {
r8 = canKickUser || canBanUser;
r8 = !r8 ? canChangeNick : r8;
r8 = !r8 ? canManageRoles : r8;
r7 = r8;
} else {
r7 = value5;
}
r7 = r7 && !user.isNonUserBot();
if (r7) {
items2.push(<ActionSheetRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.HxrBOZ)} icon={((Icon) => <Icon IconComponent={(require(7002) /* metro dependency 7002: SettingsIcon */).SettingsIcon} />)((require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow.Icon)} onPress={onPress_87664} />);
}
if (value2 != null) {
if (canModerateMembers) {
isMemberCommunicationDisabled2 = (require(3773) /* metro dependency 3773: CommunicationDisabledUtils */).isMemberCommunicationDisabled(value2);
push = items2.push;
string = intl.string;
t = (require(1244) /* metro dependency 1244: indexNative */).t;
Reflect.apply(push, items2, [<ActionSheetRow label={isMemberCommunicationDisabled2 ? Reflect.apply(string,
intl,
[t.qXtNtS]) : Reflect.apply(string, intl,
[t.xpsADY])} icon={((Icon) => <Icon IconComponent={(require(10317) /* metro dependency 10317: ClockWarningIcon */).ClockWarningIcon} />)((require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow.Icon)} onPress={onPress_87667} />]);
}
}
if (value2 != null && canKickUser) {
items2.push(<ActionSheetRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['3glT6Z'])} icon={((Icon) => <Icon IconComponent={(require(4054) /* metro dependency 4054: UserMinusIcon */).UserMinusIcon} />)((require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow.Icon)} variant="danger" onPress={onPress_87668} />);
}
if (value2 != null && canBanUser) {
items2.push(<ActionSheetRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5MBJ5M'])} icon={((Icon) => <Icon IconComponent={(require(9409) /* metro dependency 9409: HammerIcon */).HammerIcon} />)((require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow.Icon)} variant="danger" onPress={onPress_87670} />);
}
const BottomSheet = (BottomSheetNativeModule).BottomSheet;
const object2 = {};
const BottomSheetTitleHeader = (BottomSheetTitleHeaderNativeModule).BottomSheetTitleHeader;
object2.header = (
<BottomSheetTitleHeader
title={intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['792QKT'],
{nick: name})}
/>
);
object2.bodyStyles = styles.container;
let value = MemberRolesList;
value = ((Component) => <Component style={[styles.memberRoles]} guild={guild} userRoles={r12} />)(value);
const TableRowGroup = (TableRowGroupNativeModule).TableRowGroup;
return (
<BottomSheet {...object2}>
{value}
<TableRowGroup hasIcons>
{items2.map(_fun87672)}
</TableRowGroup>
</BottomSheet>
);
function _fun87663() { // fn#87663, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:494, offset: 0x01fc72f2, size: 334 bytes, params: 1, frame: 19
var r1;
var value3;
var moduleValue;
var value5;
var moduleValue2;
var value12;
var moduleValue3;
const object = {};
const value2 = guild != null;
if (value2) {
value3 = environment.__proto__;
moduleValue = require(10289) /* metro dependency 10289: GuildMemberUtils */;
r1 = moduleValue.canKickMember(user, guild);
} else {
r1 = value2;
}
object.canKickUser = r1;
const value4 = guild != null;
if (value4) {
value5 = environment.__proto__;
moduleValue2 = require(10289) /* metro dependency 10289: GuildMemberUtils */;
r1 = moduleValue2.canBanMember(user, guild);
} else {
r1 = value4;
}
object.canBanUser = r1;
object.canChangeNick = guild != null && PermissionStore.canManageUser(Permissions.MANAGE_NICKNAMES, user, guild);
object.canManageRoles = guild != null && PermissionStore.can(Permissions.MANAGE_ROLES, guild);
const value11 = guild != null;
if (value11) {
value12 = environment.__proto__;
moduleValue3 = require(8037) /* metro dependency 8037: useCanToggleCommunicationDisableOnUser */;
r1 = moduleValue3.canToggleCommunicationDisableOnUser(guild.id, user.id, [UserStore, GuildStore,
PermissionStore]);
} else {
r1 = value11;
}
object.canModerateMembers = r1;
return object;
}
function onPress_87664() { // fn#87664, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:1210, offset: 0x01fc7440, size: 138 bytes, params: 1, frame: 17
hideActionSheet();
const defaultImport = importDefault(dependencyMap[16]);
defaultImport.pushLazy(require(dependencyMap[18])(dependencyMap[17], dependencyMap.paths), {userId: user.id,
guildId: guild.id, onClose: onClose_87665, onRemove: onRemove_87666});
function onPress_87664OnClose() { // fn#87665, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:1296, owner: onPress_87664.onClose, offset: 0x01fc74ca, size: 75 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__;
(ModalActionCreators).pop();
(ShowModerateUserActionSheet)({guild: guild, user: user});
}
function onPress_87664OnRemove() { // fn#87666, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:1355, owner: onPress_87664.onRemove, offset: 0x01fc7515, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__.__proto__;
(ModalActionCreators).pop();
}
}
function onPress_87667() { // fn#87667, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:1652, offset: 0x01fc753a, size: 117 bytes, params: 1, frame: 15
var openDisableCommunication;
var openEnableCommunication;
hideActionSheet();
let binding = env0_4;
if (binding) {
openEnableCommunication = GuildDisableCommunicationActionCreatorsNativeModule.openEnableCommunication;
binding = env0_2;
Reflect.apply(openEnableCommunication, GuildDisableCommunicationActionCreatorsNativeModule,
[{guildId: binding.guildId, userId: binding.userId}]);
} else {
openDisableCommunication = GuildDisableCommunicationActionCreatorsNativeModule.openDisableCommunication;
binding = env0_2;
Reflect.apply(openDisableCommunication, GuildDisableCommunicationActionCreatorsNativeModule,
[{guildId: binding.guildId, userId: binding.userId}]);
}
}
function onPress_87668() { // fn#87668, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:2011, offset: 0x01fc75af, size: 77 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
(ShowKickConfirmModal)({guildId: guild.id, userId: user.id,
cancelButtonCallback: cancelButtonCallback});
function onPress_87668CancelButtonCallback() { // fn#87669, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:2073, owner: onPress_87668.cancelButtonCallback, offset: 0x01fc75fc, size: 53 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__;
return (ShowModerateUserActionSheet)({guild: guild, user: user});
}
}
function onPress_87670() { // fn#87670, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:2304, offset: 0x01fc7631, size: 77 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
(ShowBanConfirmModal)({guildId: guild.id, userId: user.id,
cancelButtonCallback: cancelButtonCallback});
function onPress_87670CancelButtonCallback() { // fn#87671, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:2366, owner: onPress_87670.cancelButtonCallback, offset: 0x01fc75fc, size: 53 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__;
return (ShowModerateUserActionSheet)({guild: guild, user: user});
}
}
function _fun87672(a0, a1) { // fn#87672, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11636:2687, offset: 0x01fc767e, size: 64 bytes, params: 3, frame: 16
const value = environment.__proto__;
const Fragment = env1_3.Fragment;
return <Fragment {...{children: a0}} key={'action_' + a1} />;
}
}
}
global.__d(_fun87660, 11450, [31, 1945, 1867, 3784, 1878, 661, 33, 4501, 566, 10289, 8037, 4617, 4080, 6807, 1244,
7002, 5080, 10296, 1962, 11449, 3773, 10317, 10299, 4054, 10321, 9409, 10323, 6275, 6758, 11451, 6231,
2]) /* metro module 11450, dependencies: [31, 1945, 1867, 3784, 1878, 661, 33, 4501, 566, 10289, 8037, 4617, 4080, 6807, 1244, 7002, 5080, 10296, 1962, 11449, 3773, 10317, 10299, 4054, 10321, 9409, 10323, 6275, 6758, 11451, 6231, 2] */;