229 lines
14 KiB
TypeScript
229 lines
14 KiB
TypeScript
/* Metro module 11445; source: modules/guild_antiraid/native/GuildIncidentActionsActionSheet.tsx; dependencies: [31, 10906, 11446, 8276, 661, 33, 4501, 6805, 6758, 1244, 6807, 632, 8275, 4080, 1305, 6238, 6231, 6808, 9149, 8129, 6261, 4578, 11447, 683, 11448, 2] */
|
|
function _fun87602(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:6, offset: 0x01fc5006, size: 354 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const guildIncidentsStore = importDefault(10906) /* metro dependency 10906: GuildIncidentsStore */;
|
|
let value = require(11446) /* metro dependency 11446: GuildIncidentsActionSheetStore */;
|
|
const env0_5 = value.resetGuildIncidentsActionSheetStore;
|
|
const env0_6 = value.setInitialTime;
|
|
const env0_7 = value.setPauseDms;
|
|
const env0_8 = value.setPauseInvites;
|
|
const env0_9 = value.setTime;
|
|
const env0_10 = value.useGuildIncidentsActionSheetStore;
|
|
const env0_11 = (require(8276) /* metro dependency 8276: GuildAntiRaidConstants */).getTimeframes;
|
|
value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_12 = value.AnalyticEvents;
|
|
const env0_13 = value.GuildFeatures;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_14 = value.jsx;
|
|
const env0_15 = value.jsxs;
|
|
const env0_16 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({beta: {marginLeft: -12}});
|
|
const closure = GuildIncidentActionsActionSheet;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_antiraid/native/GuildIncidentActionsActionSheet.tsx');
|
|
exports.default = closure;
|
|
}
|
|
|
|
function DurationSelectionActionSheet({onClose}) { // fn#87603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:446, offset: 0x01fc5168, size: 225 bytes, params: 2, frame: 23
|
|
const timeframes = getTimeframes();
|
|
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
|
|
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const bottomSheetTitleHeader = <BottomSheetTitleHeader title={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.vKYZzc)} />;
|
|
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
|
|
const Group = ActionSheetRow.Group;
|
|
return (
|
|
<ActionSheet>
|
|
{bottomSheetTitleHeader}
|
|
<Group hasIcons={false}>
|
|
{timeframes.map(_fun87604)}
|
|
</Group>
|
|
</ActionSheet>
|
|
);
|
|
}
|
|
|
|
function GuildIncidentActionsActionSheet({guild, analyticsData}) { // fn#87606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:776, offset: 0x01fc52c0, size: 1608 bytes, params: 2, frame: 39
|
|
var object2;
|
|
const styles = useStyles();
|
|
const value3 = useGuildIncidentsActionSheetStore();
|
|
const time = value3.time;
|
|
const pauseInvites = value3.pauseInvites;
|
|
const env0_3 = pauseInvites;
|
|
const pauseDms = value3.pauseDms;
|
|
const hasTimeChanges = value3.hasTimeChanges;
|
|
const guildIncident = (require(632) /* metro dependency 632: useStateFromStores */).useStateFromStores([GuildIncidentsStore],
|
|
function() {
|
|
return GuildIncidentsStore.getGuildIncident(guild.id);
|
|
});
|
|
const hasInvitesDisabled2 = (require(8275) /* metro dependency 8275: GuildAntiRaidUtils */).hasInvitesDisabled(guildIncident);
|
|
const hasDMsDisabled2 = (require(8275) /* metro dependency 8275: GuildAntiRaidUtils */).hasDMsDisabled(guildIncident);
|
|
const value4 = (require(8275) /* metro dependency 8275: GuildAntiRaidUtils */).initialLockdownDurationHours(guildIncident);
|
|
let r12 = guild == null ? undefined : guild.features.has(GuildFeatures.INVITES_DISABLED);
|
|
const binding = env0_3;
|
|
binding.useEffect(_fun87608, [hasDMsDisabled2, hasInvitesDisabled2]);
|
|
binding.useEffect(_fun87609, [value4]);
|
|
const value6 = binding.useMemo(_fun87610, [time]);
|
|
const closure = function() {
|
|
importDefault(dependencyMap[13]).hideActionSheet('GuildIncidentActionsActionSheet');
|
|
resetGuildIncidentsActionSheetStore();
|
|
};
|
|
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
|
|
object2 = {startExpanded: true};
|
|
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const oCYAc7 = (require(1244) /* metro dependency 1244: indexNative */).t.oCYAc7;
|
|
const BetaTag = (require(1305) /* metro dependency 1305: native */).BetaTag;
|
|
const BetaSizes = (require(1305) /* metro dependency 1305: native */).BetaSizes;
|
|
const SMALL = BetaSizes.SMALL;
|
|
object2.header = <BottomSheetTitleHeader title={Reflect.apply(string, intl,
|
|
[oCYAc7])} leading={<BetaTag size={SMALL} style={styles.beta} />} />;
|
|
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const TableRow2 = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
|
|
const TrailingText = TableRow2.TrailingText;
|
|
const items2 = [<TableRow trailing={<TrailingText text={value6 ?? ''} />} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.vKYZzc)} arrow onPress={onPress_87614} start end accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.vKYZzc)} accessibilityHint={value6} />];
|
|
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
|
|
const TableSwitchRow = (require(6808) /* metro dependency 6808: TableSwitchRowNative */).TableSwitchRow;
|
|
string = intl.string;
|
|
const Uwsjn6 = (require(1244) /* metro dependency 1244: indexNative */).t.Uwsjn6;
|
|
const tableSwitchRow = <TableSwitchRow label={Reflect.apply(string, intl,
|
|
[Uwsjn6])} subLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.qPJkZh)} value={pauseInvites || r12} onValueChange={function() {
|
|
setPauseInvites(!pauseInvites);
|
|
}} disabled={r12} />;
|
|
if (r12) {
|
|
r12 = <TableRow icon={((Icon) => <Icon source={importDefault(9149) /* metro dependency 9149 */} IconComponent={(require(8129) /* metro dependency 8129: WarningIcon */).WarningIcon} variant="secondary" />)((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['9GPbsV'])} />;
|
|
}
|
|
items2[1] = <TableRowGroup hasIcons>{tableSwitchRow}{r12}</TableRowGroup>;
|
|
const tableSwitchRowProps = {label: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['wrDmA/'])};
|
|
string = intl.string;
|
|
const UQbJW7 = (require(1244) /* metro dependency 1244: indexNative */).t.UQbJW7;
|
|
tableSwitchRowProps.subLabel = Reflect.apply(string, intl, [UQbJW7]);
|
|
tableSwitchRowProps.value = pauseDms;
|
|
tableSwitchRowProps.onValueChange = function() {
|
|
setPauseDms(!pauseDms);
|
|
};
|
|
tableSwitchRowProps.start = true;
|
|
tableSwitchRowProps.end = true;
|
|
items2[2] = <TableSwitchRow {...tableSwitchRowProps} />;
|
|
const ButtonGroup = (require(6261) /* metro dependency 6261: ButtonGroupNative */).ButtonGroup;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const buttonProps = {onPress: onPress_87617,
|
|
text: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['R3BPH+']), variant: 'primary',
|
|
size: 'md'};
|
|
let r15 = pauseInvites !== hasInvitesDisabled2 || pauseDms !== hasDMsDisabled2;
|
|
r15 = !r15 ? hasTimeChanges : r15;
|
|
buttonProps.disabled = !r15;
|
|
items2[3] = <ButtonGroup><Button {...buttonProps} /><Button onPress={closure} text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC'])} variant="secondary" size="md" /></ButtonGroup>;
|
|
return (
|
|
<ActionSheet {...object2}>
|
|
{items2}
|
|
</ActionSheet>
|
|
);
|
|
}
|
|
|
|
function _fun87604(a0) { // fn#87604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:653, offset: 0x01fc5249, size: 80 bytes, params: 2, frame: 17
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const value = environment.__proto__;
|
|
const ActionSheetRow = (require(6807) /* metro dependency 6807: ActionSheetRowNative */).ActionSheetRow;
|
|
return (
|
|
<ActionSheetRow
|
|
label={a0.label}
|
|
onPress={onPress_87605}
|
|
key={a0.value}
|
|
/>
|
|
);
|
|
}
|
|
|
|
function _fun87608() { // fn#87608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:1116, offset: 0x01fc5928, size: 36 bytes, params: 1, frame: 13
|
|
setPauseInvites(env0_5);
|
|
setPauseDms(env0_6);
|
|
}
|
|
|
|
function _fun87609() { // fn#87609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:1153, offset: 0x01fc594c, size: 48 bytes, params: 1, frame: 11
|
|
const getState = useGuildIncidentsActionSheetStore.getState;
|
|
if (!Reflect.apply(getState, useGuildIncidentsActionSheetStore, []).hasTimeChanges) {
|
|
setInitialTime(env0_7);
|
|
}
|
|
}
|
|
|
|
function _fun87610() { // fn#87610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:1216, offset: 0x01fc597c, size: 49 bytes, params: 1, frame: 12
|
|
var environment;
|
|
let value = environment.__proto__;
|
|
const getTimeframesBinding = getTimeframes;
|
|
value = undefined;
|
|
const value3 = getTimeframesBinding().find(function({value}) {
|
|
return value === time;
|
|
});
|
|
return value3 == null ? value : value3.label;
|
|
}
|
|
|
|
function onDurationSelectorClose() { // fn#87612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:1317, owner: GuildIncidentActionsActionSheet.onDurationSelectorClose, offset: 0x01fc59c2, size: 90 bytes, params: 1, frame: 18
|
|
const actionSheetActionCreatorsModule = require(4080) /* metro dependency 4080: ActionSheetActionCreators */;
|
|
const showActionSheet = actionSheetActionCreatorsModule.showActionSheet;
|
|
const object2 = {};
|
|
object2.content = <GuildIncidentActionsActionSheet guild={guild} analyticsData={analyticsData} />;
|
|
object2.key = 'GuildIncidentActionsActionSheet';
|
|
Reflect.apply(showActionSheet, actionSheetActionCreatorsModule, [object2]);
|
|
}
|
|
|
|
function GuildIncidentActionsActionSheetOnPress_87614() { // fn#87614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:1902, owner: GuildIncidentActionsActionSheet.onPress, offset: 0x01fc5a50, size: 82 bytes, params: 1, frame: 17
|
|
const actionSheetActionCreatorsModule = require(4080) /* metro dependency 4080: ActionSheetActionCreators */;
|
|
const showActionSheet = actionSheetActionCreatorsModule.showActionSheet;
|
|
const object2 = {};
|
|
object2.content = <DurationSelectionActionSheet onClose={onDurationSelectorClose} />;
|
|
object2.key = 'DurationSelectionActionSheet';
|
|
Reflect.apply(showActionSheet, actionSheetActionCreatorsModule, [object2]);
|
|
}
|
|
|
|
function GuildIncidentActionsActionSheetOnPress_87617() { // fn#87617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:2770, owner: GuildIncidentActionsActionSheet.onPress, offset: 0x01fc5ad6, size: 355 bytes, params: 1, frame: 27
|
|
var moduleValue4;
|
|
var showActionSheet;
|
|
const value = environment.__proto__;
|
|
const guildAntiRaidActionCreatorsModule = require(11447) /* metro dependency 11447: GuildAntiRaidActionCreators */;
|
|
const setGuildIncidentActions = guildAntiRaidActionCreatorsModule.setGuildIncidentActions;
|
|
const guildBinding = guild;
|
|
const id = guildBinding.id;
|
|
const pauseInvitesBinding = pauseInvites;
|
|
const pauseDmsBinding = pauseDms;
|
|
const timeBinding = time;
|
|
Reflect.apply(setGuildIncidentActions, guildAntiRaidActionCreatorsModule, [id, pauseInvitesBinding, pauseDmsBinding,
|
|
timeBinding]);
|
|
onPress_87613();
|
|
const {source, alertType, messageId} = analyticsData;
|
|
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
const track = defaultImport.track;
|
|
const GUILD_RAID_INTERVENTION_STATE_CHANGE = AnalyticEvents.GUILD_RAID_INTERVENTION_STATE_CHANGE;
|
|
let object2 = {};
|
|
object2.guild_id = guildBinding.id;
|
|
object2.source = source;
|
|
object2.raid_alert_id = messageId;
|
|
object2.raid_alert_type = alertType;
|
|
object2.intervention_type_enabled = (require(8275) /* metro dependency 8275: GuildAntiRaidUtils */).getEnabledInterventions(pauseInvitesBinding,
|
|
pauseDmsBinding);
|
|
object2.intervention_type_disabled = (require(8275) /* metro dependency 8275: GuildAntiRaidUtils */).getDisabledInterventions(pauseInvitesBinding,
|
|
pauseDmsBinding);
|
|
object2.duration = 60 * timeBinding;
|
|
Reflect.apply(track, defaultImport, [GUILD_RAID_INTERVENTION_STATE_CHANGE, object2]);
|
|
let r1 = !env0_5 && !env0_6;
|
|
r1 = !r1 ? pauseInvites : r1;
|
|
r1 = !r1 ? pauseDms : r1;
|
|
if (!r1) {
|
|
moduleValue4 = require(4080) /* metro dependency 4080: ActionSheetActionCreators */;
|
|
showActionSheet = moduleValue4.showActionSheet;
|
|
object2 = {};
|
|
object2.content = ((Component) => <Component guildId={guild.id} />)(importDefault(11448) /* metro dependency 11448: GuildRaidLockdownFeedbackActionSheet */);
|
|
object2.key = 'GuildRaidLockdownFeedbackActionSheet';
|
|
Reflect.apply(showActionSheet, moduleValue4, [object2]);
|
|
}
|
|
}
|
|
|
|
function onPress_87605() { // fn#87605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11631:705, offset: 0x01fc5299, size: 39 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__.__proto__;
|
|
setTime(env0_0.value);
|
|
value = environment.__proto__;
|
|
onClose();
|
|
}
|
|
|