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

92 lines
5.1 KiB
TypeScript

/* Metro module 6665; source: modules/guild_member_verification/MemberVerificationUtils.tsx; dependencies: [6666, 661, 3972, 1360, 2] */
import * as FileImportTrackerModule from '../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ConstantsModule from '../../Constants.tsx'; /* Metro dependency 661 */
import * as MemberVerificationTypesModule from './MemberVerificationTypes.tsx'; /* Metro dependency 3972 */
import * as MemberVerificationConstantsModule from './MemberVerificationConstants.tsx'; /* Metro dependency 6666 */
function _fun52616(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#52616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:6, offset: 0x0133334d, size: 195 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(FileImportTrackerModule).fileFinishedImporting('modules/guild_member_verification/MemberVerificationUtils.tsx');
exports.isValidFormResponse = isValidFormResponse;
exports.removeInternalFields = function(a0) {
return a0.filter(_fun52619);
};
exports.isAutomaticApprovalFormField = isAutomaticApprovalFormField;
exports.isManualApprovalFormField = isManualApprovalFormField;
exports.guildHasVerificationGate = guildHasVerificationGate;
function isValidFormResponse({required, response, field_type}) { // fn#52617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:314, offset: 0x01333410, size: 315 bytes, params: 2, frame: 15
var r0;
var value;
const VerificationFormFieldTypes = (MemberVerificationTypesModule).VerificationFormFieldTypes;
if (required) {
if (response == null) {
return false;
}
if (VerificationFormFieldTypes.TERMS === field_type) {
return global.Boolean(response);
}
if (VerificationFormFieldTypes.VERIFICATION === field_type) {
return global.Boolean(response);
}
if (VerificationFormFieldTypes.TEXT_INPUT === field_type) {
value = typeof response === 'string';
if (value) {
value = response.trim();
value = value !== '';
r0 = value;
} else {
r0 = value;
}
return r0;
}
if (VerificationFormFieldTypes.PARAGRAPH === field_type) {
value = typeof response === 'string';
if (value) {
value = response.trim();
value = value !== '';
r0 = value;
} else {
r0 = value;
}
return r0;
}
if (VerificationFormFieldTypes.MULTIPLE_CHOICE === field_type) {
return typeof response === 'number';
}
value = require(1360) /* metro dependency 1360: GlobalUtils */;
return value.assertNever(field_type);
}
return true;
}
function removeInternalFields(a0) { // fn#52618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:810, offset: 0x0133354b, size: 22 bytes, params: 2, frame: 11
return a0.filter(function({field_type}) {
return field_type !== require(dependencyMap[2]).VerificationFormFieldTypes.VERIFICATION;
});
function _fun52619({field_type}) { // fn#52619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:860, offset: 0x01333561, size: 52 bytes, params: 2, frame: 12
const VerificationFormFieldTypes = (MemberVerificationTypesModule).VerificationFormFieldTypes;
const VERIFICATION = VerificationFormFieldTypes.VERIFICATION;
return field_type !== VERIFICATION;
}
}
function isAutomaticApprovalFormField(a0) { // fn#52620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:964, offset: 0x01333595, size: 39 bytes, params: 2, frame: 13
return AUTOMATIC_APPROVAL_FORM_FIELDS.has(a0?.field_type);
}
function isManualApprovalFormField(a0) { // fn#52621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:1076, offset: 0x013335bc, size: 39 bytes, params: 2, frame: 13
return MANUAL_APPROVAL_FORM_FIELDS.has(a0?.field_type);
}
function guildHasVerificationGate(a0) { // fn#52622, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6843:1184, offset: 0x013335e3, size: 43 bytes, params: 2, frame: 12
return a0 != null && a0.features.has(GuildFeatures.MEMBER_VERIFICATION_GATE_ENABLED);
}
}
global.__d(_fun52616, 6665, [6666, 661, 3972, 1360,
2]) /* metro module 6665, dependencies: [6666, 661, 3972, 1360, 2] */;