92 lines
5.1 KiB
TypeScript
92 lines
5.1 KiB
TypeScript
/* Metro module 3790; source: modules/guild_automod/AutomodPermissionUtils.tsx; dependencies: [1945, 3772, 1391, 566, 2] */
|
|
function _fun28823(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#28823, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3917:6, offset: 0x00f8431e, size: 232 bytes, params: 8, frame: 20
|
|
let env0_0 = require;
|
|
const closure = getAutomodQuarantinedProfileFlags;
|
|
const closure2 = hasAutomodQuarantinedProfile;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
|
|
const GuildMemberFlags = (require(3772) /* metro dependency 3772: GuildMemberConstants */).GuildMemberFlags;
|
|
const AUTOMOD_QUARANTINED_BIO = GuildMemberFlags.AUTOMOD_QUARANTINED_BIO;
|
|
items = [AUTOMOD_QUARANTINED_BIO];
|
|
const AUTOMOD_QUARANTINED_USERNAME_OR_GUILD_NICKNAME = GuildMemberFlags.AUTOMOD_QUARANTINED_USERNAME_OR_GUILD_NICKNAME;
|
|
items[1] = AUTOMOD_QUARANTINED_USERNAME_OR_GUILD_NICKNAME;
|
|
const AUTOMOD_QUARANTINED_SERVER_TAG = GuildMemberFlags.AUTOMOD_QUARANTINED_SERVER_TAG;
|
|
items[2] = AUTOMOD_QUARANTINED_SERVER_TAG;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_automod/AutomodPermissionUtils.tsx');
|
|
exports.AUTOMOD_QUARANTINED_PROFILE_FLAGS = items;
|
|
exports.getAutomodQuarantinedProfileFlags = closure;
|
|
exports.getAutomodQuarantinedGuildMemberFlags = getAutomodQuarantinedGuildMemberFlags;
|
|
exports.getAutomodReason = function(a0) {
|
|
return a0.has(GuildMemberFlags.AUTOMOD_QUARANTINED_USERNAME_OR_GUILD_NICKNAME) ? GuildMemberFlags.AUTOMOD_QUARANTINED_USERNAME_OR_GUILD_NICKNAME : a0.has(GuildMemberFlags.AUTOMOD_QUARANTINED_BIO) ? GuildMemberFlags.AUTOMOD_QUARANTINED_BIO : a0.has(GuildMemberFlags.AUTOMOD_QUARANTINED_SERVER_TAG) ? GuildMemberFlags.AUTOMOD_QUARANTINED_SERVER_TAG : null;
|
|
};
|
|
exports.hasAutomodQuarantinedProfile = closure2;
|
|
exports.useCurrentUserAutomodQuaratinedProfile = function(a0) {
|
|
var env0_0 = a0;
|
|
return require(dependencyMap[3]).useStateFromStores([GuildMemberStore], _fun28831, [a0]);
|
|
};
|
|
}
|
|
|
|
function getAutomodQuarantinedProfileFlags(a0) { // fn#28824, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3917:245, offset: 0x00f84406, size: 103 bytes, params: 2, frame: 14
|
|
var set;
|
|
var Set;
|
|
var value;
|
|
const env0_0 = a0;
|
|
if (a0 == null) {
|
|
set = new global.Set();
|
|
} else {
|
|
Set = global.Set;
|
|
value = env0_4.reduce(_fun28825, []);
|
|
set = new Set();
|
|
}
|
|
return set;
|
|
}
|
|
|
|
function hasAutomodQuarantinedProfile(a0) { // fn#28826, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3917:391, offset: 0x00f844bd, size: 58 bytes, params: 2, frame: 13
|
|
const env0_0 = a0;
|
|
return a0 != null && (a0.flags != null && env0_4.some(_fun28827));
|
|
}
|
|
|
|
function getAutomodQuarantinedGuildMemberFlags(a0) { // fn#28828, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3917:764, offset: 0x00f8453b, size: 60 bytes, params: 2, frame: 11
|
|
return a0 == null ? new global.Set() : getAutomodQuarantinedProfileFlags(a0.flags);
|
|
}
|
|
|
|
function useCurrentUserAutomodQuaratinedProfile(a0) { // fn#28830, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3917:1280, offset: 0x00f845e8, size: 73 bytes, params: 2, frame: 16
|
|
const env0_0 = a0;
|
|
return (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildMemberStore], _fun28831, [a0]);
|
|
}
|
|
|
|
function _fun28825(a0, a1) { // fn#28825, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3917:332, offset: 0x00f8446d, size: 80 bytes, params: 3, frame: 16
|
|
let value = environment.__proto__;
|
|
value = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
if (value.hasFlag(env0_0 ?? 0, a1)) {
|
|
a0.push(a1);
|
|
}
|
|
return a0;
|
|
}
|
|
|
|
function _fun28827(a0) { // fn#28827, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3917:472, offset: 0x00f844f7, size: 68 bytes, params: 2, frame: 14
|
|
let value = environment.__proto__;
|
|
value = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
return value.hasFlag(env0_0.flags ?? 0, a0);
|
|
}
|
|
|
|
function _fun28831() { // fn#28831, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:3917:1370, offset: 0x00f84631, size: 51 bytes, params: 1, frame: 13
|
|
var r0;
|
|
var value3;
|
|
var hasAutomodQuarantinedProfileBinding;
|
|
var value;
|
|
const value2 = env0_0 != null;
|
|
if (value2) {
|
|
value3 = environment.__proto__;
|
|
hasAutomodQuarantinedProfileBinding = hasAutomodQuarantinedProfile;
|
|
value = GuildMemberStore.getSelfMember(env0_0);
|
|
value = hasAutomodQuarantinedProfileBinding(value);
|
|
r0 = value;
|
|
} else {
|
|
r0 = value2;
|
|
}
|
|
return r0;
|
|
}
|
|
|