Files
discord-decomp/sources/utils/ModerationUtils.tsx
T
2026-07-27 16:20:00 +03:00

258 lines
12 KiB
TypeScript

/* Metro module 13360; source: utils/ModerationUtils.tsx; dependencies: [661, 3831, 696, 13361, 1244, 1314, 2] */
function _fun101730(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#101730, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:6, offset: 0x0221d0ba, size: 249 bytes, params: 8, frame: 19
const env0_0 = require;
const closure = mapColorToHighlightColor;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_2 = constantsModule.VerificationLevels;
const env0_3 = constantsModule.VerificationCriteria;
const env0_4 = constantsModule.GuildExplicitContentFilterTypes;
const env0_5 = (require(3831) /* metro dependency 3831: DMSafetyConstants */).ExplicitContentFilterTypes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/ModerationUtils.tsx');
exports.mapColorToHighlightColor = closure;
exports.mapOptionToHighlightedRowOptions = function(a0) {
return a0.map(_fun101733);
};
exports.generateVerificationLevelOptions = generateVerificationLevelOptions;
exports.generateContentFilterHighlightedOptions = generateContentFilterHighlightedOptions;
exports.generateContentFilterOptions = generateContentFilterOptions;
exports.generateDmSpamOptions = generateDmSpamOptions;
exports.generateExplicitImageOptions = generateExplicitImageOptions;
}
function mapColorToHighlightColor(a0) { // fn#101731, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:227, offset: 0x0221d1b3, size: 408 bytes, params: 2, frame: 15
const HighlightColors = (require(13361) /* metro dependency 13361: HighlightedSettingsTypes */).HighlightColors;
const shimsNativeModule = require(696) /* metro dependency 696: shimsNative */;
if (shimsNativeModule.unsafe_getRawColor('PRIMARY_400') === a0) {
return HighlightColors.ACCENT;
}
const moduleValue2 = shimsNativeModule;
if (moduleValue2.unsafe_getRawColor('GREEN_360') === a0) {
return HighlightColors.GREEN;
}
const moduleValue3 = shimsNativeModule;
if (moduleValue3.unsafe_getRawColor('YELLOW_360') === a0) {
return HighlightColors.YELLOW;
}
const moduleValue4 = shimsNativeModule;
if (moduleValue4.unsafe_getRawColor('ORANGE_345') === a0) {
return HighlightColors.ORANGE;
}
const moduleValue5 = shimsNativeModule;
if (moduleValue5.unsafe_getRawColor('RED_400') === a0) {
return HighlightColors.RED;
}
return HighlightColors.NONE;
}
function mapOptionToHighlightedRowOptions(a0) { // fn#101732, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:878, offset: 0x0221d34b, size: 24 bytes, params: 2, frame: 11
return a0.map(function(a0) {
var object = {title: a0.name, description: a0.desc};
object.highlightColor = mapColorToHighlightColor(a0.color);
object.value = a0.value;
object.disabled = a0.disabled;
return object;
});
}
function generateVerificationLevelOptions() { // fn#101734, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:1097, offset: 0x0221d3a7, size: 915 bytes, params: 1, frame: 21
let value = a0;
const value2 = a1;
const value3 = undefined;
const r0 = value !== value3 ? value : false;
const r4 = value2 !== value3 ? value2 : false;
let object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const PEzffq = t.PEzffq;
object2.name = Reflect.apply(string, intl, [PEzffq]);
string = intl.string;
let r2 = r0 ? Reflect.apply(string, intl, [t.j9WtHx]) : Reflect.apply(string, intl, [t.nDQy0p]);
object2.desc = r2;
const NONE = VerificationLevels.NONE;
object2.value = NONE;
object2.disabled = r0;
const items2 = [object2];
object2 = {};
string = intl.string;
const SsCK8I = t.SsCK8I;
object2.name = Reflect.apply(string, intl, [SsCK8I]);
object2.desc = intl.string(t['8GCOX6']);
const LOW = VerificationLevels.LOW;
object2.value = LOW;
object2.color = r4 ? value3 : (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('GREEN_360');
items2[1] = object2;
object2 = {};
string = intl.string;
const WwNoR4 = t.WwNoR4;
object2.name = Reflect.apply(string, intl, [WwNoR4]);
let formatToPlainString = intl.formatToPlainString;
const VS14ga = t.VS14ga;
const ACCOUNT_AGE = VerificationCriteria.ACCOUNT_AGE;
object2.desc = Reflect.apply(formatToPlainString, intl, [VS14ga, {min: ACCOUNT_AGE}]);
const MEDIUM = VerificationLevels.MEDIUM;
object2.value = MEDIUM;
object2.color = r4 ? value3 : (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('YELLOW_360');
items2[2] = object2;
object2 = {};
string = intl.string;
const I2jMUF = t.I2jMUF;
object2.name = Reflect.apply(string, intl, [I2jMUF]);
formatToPlainString = intl.formatToPlainString;
const property = t['r+b3I4'];
const MEMBER_AGE = VerificationCriteria.MEMBER_AGE;
object2.desc = Reflect.apply(formatToPlainString, intl, [property, {min: MEMBER_AGE}]);
const HIGH = VerificationLevels.HIGH;
object2.value = HIGH;
object2.color = r4 ? value3 : (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('ORANGE_345');
items2[3] = object2;
object2 = {};
object2.name = intl.string(t.cJY8w9);
string = intl.string;
const PWaKme = t.PWaKme;
object2.desc = Reflect.apply(string, intl, [PWaKme]);
const VERY_HIGH = VerificationLevels.VERY_HIGH;
object2.value = VERY_HIGH;
if (r4) {
r2 = value3;
} else {
value = require(696) /* metro dependency 696: shimsNative */;
value = value.unsafe_getRawColor('RED_400');
r2 = value;
}
object2.color = r2;
items2[4] = object2;
return items2;
}
function generateContentFilterHighlightedOptions() { // fn#101735, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:2054, offset: 0x0221d73a, size: 543 bytes, params: 1, frame: 20
const value = a0;
const r3 = value !== undefined ? value : false;
let object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.name = Reflect.apply(string, intl, [t.iHuPE6]);
object2.desc = intl.string(t['Z+yUWF']);
const ALL_MEMBERS = GuildExplicitContentFilterTypes.ALL_MEMBERS;
object2.value = ALL_MEMBERS;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('RED_400');
const items2 = [object2];
object2 = {};
object2.name = intl.string(t.ynfFaI);
string = intl.string;
object2.desc = r3 ? Reflect.apply(string, intl, [t.j9WtHx]) : Reflect.apply(string, intl, [t['3fRIN4']]);
const MEMBERS_WITHOUT_ROLES = GuildExplicitContentFilterTypes.MEMBERS_WITHOUT_ROLES;
object2.value = MEMBERS_WITHOUT_ROLES;
object2.disabled = r3;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('YELLOW_360');
items2[1] = object2;
object2 = {};
string = intl.string;
const VbSyAx = t.VbSyAx;
object2.name = Reflect.apply(string, intl, [VbSyAx]);
string = intl.string;
object2.desc = r3 ? Reflect.apply(string, intl, [t.j9WtHx]) : Reflect.apply(string, intl, [t.M6GNsJ]);
const DISABLED = GuildExplicitContentFilterTypes.DISABLED;
object2.value = DISABLED;
object2.disabled = r3;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('PRIMARY_400');
items2[2] = object2;
return items2;
}
function generateContentFilterOptions() { // fn#101736, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:2727, offset: 0x0221d959, size: 446 bytes, params: 1, frame: 19
const value = a0;
const r2 = value !== undefined ? value : false;
let object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.name = Reflect.apply(string, intl, [t.iHuPE6]);
object2.desc = intl.string(t['Z+yUWF']);
const ALL_MEMBERS = GuildExplicitContentFilterTypes.ALL_MEMBERS;
object2.value = ALL_MEMBERS;
const items2 = [object2];
string = intl.string;
const MEMBERS_WITHOUT_ROLES = GuildExplicitContentFilterTypes.MEMBERS_WITHOUT_ROLES;
items2[1] = {name: intl.string(t.ynfFaI), desc: r2 ? Reflect.apply(string, intl, [t.j9WtHx]) : Reflect.apply(string,
intl, [t['3fRIN4']]), value: MEMBERS_WITHOUT_ROLES, disabled: r2};
object2 = {};
string = intl.string;
const VbSyAx = t.VbSyAx;
object2.name = Reflect.apply(string, intl, [VbSyAx]);
string = intl.string;
object2.desc = r2 ? Reflect.apply(string, intl, [t.j9WtHx]) : Reflect.apply(string, intl, [t.M6GNsJ]);
const DISABLED = GuildExplicitContentFilterTypes.DISABLED;
object2.value = DISABLED;
object2.disabled = r2;
items2[2] = object2;
return items2;
}
function generateDmSpamOptions() { // fn#101737, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:3243, offset: 0x0221db17, size: 421 bytes, params: 1, frame: 18
let object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.name = Reflect.apply(string, intl, [t['4IaoCI']]);
string = intl.string;
const TgipjE = t.TgipjE;
object2.desc = Reflect.apply(string, intl, [TgipjE]);
const DmSpamFilterV2 = (require(1314) /* metro dependency 1314: preloaded_user_settings */).DmSpamFilterV2;
const FRIENDS_AND_NON_FRIENDS = DmSpamFilterV2.FRIENDS_AND_NON_FRIENDS;
object2.value = FRIENDS_AND_NON_FRIENDS;
const items2 = [object2];
object2 = {};
object2.name = intl.string(t['6NnX6F']);
object2.desc = intl.string(t['+dw1qu']);
const NON_FRIENDS = DmSpamFilterV2.NON_FRIENDS;
object2.value = NON_FRIENDS;
items2[1] = object2;
object2 = {};
object2.name = intl.string(t['1tiAFz']);
string = intl.string;
const LKTyeA = t.LKTyeA;
object2.desc = Reflect.apply(string, intl, [LKTyeA]);
const DISABLED = DmSpamFilterV2.DISABLED;
object2.value = DISABLED;
items2[2] = object2;
return items2;
}
function generateExplicitImageOptions() { // fn#101738, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13550:3724, offset: 0x0221dcbc, size: 466 bytes, params: 1, frame: 19
let object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const PhNlhz = t.PhNlhz;
object2.name = Reflect.apply(string, intl, [PhNlhz]);
object2.desc = intl.string(t['Fw+Lvp']);
const FRIENDS_AND_NON_FRIENDS = ExplicitContentFilterTypes.FRIENDS_AND_NON_FRIENDS;
object2.value = FRIENDS_AND_NON_FRIENDS;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('GREEN_360');
const items2 = [object2];
object2 = {};
object2.name = intl.string(t['8ioJ4S']);
object2.desc = intl.string(t.z4l4Cr);
const NON_FRIENDS = ExplicitContentFilterTypes.NON_FRIENDS;
object2.value = NON_FRIENDS;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('YELLOW_360');
items2[1] = object2;
object2 = {};
string = intl.string;
const FLfuhL = t.FLfuhL;
object2.name = Reflect.apply(string, intl, [FLfuhL]);
string = intl.string;
const MoZlaD = t.MoZlaD;
object2.desc = Reflect.apply(string, intl, [MoZlaD]);
const DISABLED = ExplicitContentFilterTypes.DISABLED;
object2.value = DISABLED;
object2.color = (require(696) /* metro dependency 696: shimsNative */).unsafe_getRawColor('RED_400');
items2[2] = object2;
return items2;
}