/* Metro module 14221; source: modules/mfa/native/screens/BackupScreen.tsx; dependencies: [5, 57, 31, 33, 14219, 4573, 1244, 8973, 14214, 14220, 14217, 2] */
function _fun107537(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#107537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14418:6, offset: 0x022ffef2, size: 215 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importDefault(57) /* metro dependency 57 */;
const env0_5 = importAll(31) /* metro dependency 31 */;
const value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsxs;
const env0_7 = value.jsx;
const env0_8 = value.Fragment;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/mfa/native/screens/BackupScreen.tsx');
exports.default = BackupScreen;
}
function isValidClipboardCode_107538(a0) { // fn#107538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14418:166, offset: 0x022fffc9, size: 80 bytes, params: 2, frame: 15
const length = a0.length;
const BACKUP_CODE_MIN_LENGTH = (require(14219) /* metro dependency 14219: MFA */).BACKUP_CODE_MIN_LENGTH;
return length >= BACKUP_CODE_MIN_LENGTH && a0.length <= (require(14219) /* metro dependency 14219: MFA */).BACKUP_CODE_MAX_LENGTH;
}
function getFormattedExplainer(a0) { // fn#107539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14418:289, offset: 0x02300019, size: 328 bytes, params: 2, frame: 21
var object;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var items2;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
if (a0 > 0) {
object = {variant: 'text-md/normal', children: [intl.string(t.RRtlLg), intl.format(t.tsWkAE, {countdown: a0})]};
} else {
string = intl.string;
items2 = [Reflect.apply(string, intl, [t.RRtlLg])];
string = intl.string;
items2[1] = Reflect.apply(string, intl, [t.v3a6Pd]);
object = {variant: 'text-md/normal', children: items2};
}
return ;
}
function BackupScreen({mfaChallenge, finish}) { // fn#107540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14418:680, offset: 0x02300161, size: 852 bytes, params: 2, frame: 37
var object2;
const value2 = (importDefault(8973) /* metro dependency 8973: useWideAuthView */)();
const binding = env0_5;
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [false]);
const binding2 = env0_4;
const value4 = binding2(value3, 2);
const property = value4[0];
const env0_1 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, ['']), 2);
const property2 = value5[0];
const env0_3 = value5[1];
useState = binding.useState;
const value6 = binding2(Reflect.apply(useState, binding, [undefined]), 2);
const property3 = value6[0];
var env0_4 = value6[1];
useState = binding.useState;
const value7 = binding2(Reflect.apply(useState, binding, [false]), 2);
const property4 = value7[0];
var env0_5 = value7[1];
useState = binding.useState;
const value8 = binding2(Reflect.apply(useState, binding, [10]), 2);
const property5 = value8[0];
const env0_7 = value8[1];
binding.useEffect(_fun107541, [property5]);
const env0_8 = binding.useCallback(_fun107545(), [finish]);
const MfaOptionScreen = importDefault(14214) /* metro dependency 14214: MfaOptionScreen */;
object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const B2T1HD = (require(1244) /* metro dependency 1244: indexNative */).t.B2T1HD;
object2.headerText = Reflect.apply(string, intl, [B2T1HD]);
object2.subtitle = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.c5J7O0);
const jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
const formattedExplainer = getFormattedExplainer(property5);
const ClipboardCopyInput = importDefault(14220) /* metro dependency 14220: ClipboardCopyInput */;
const clipboardCopyInputProps = {label: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['C/ZAw/']),
placeholder: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.fZSi1D),
isValidClipboardCode: isValidClipboardCode_107538};
const BACKUP_CODE_MAX_LENGTH = (require(14219) /* metro dependency 14219: MFA */).BACKUP_CODE_MAX_LENGTH;
clipboardCopyInputProps.maxLength = BACKUP_CODE_MAX_LENGTH;
clipboardCopyInputProps.onChangeCode = onChangeCode;
clipboardCopyInputProps.error = property3;
clipboardCopyInputProps.isDisabled = property || property4;
clipboardCopyInputProps.autoFocus = !value2;
object2.input = <>{formattedExplainer}>;
const defaultImport3 = importDefault(14217) /* metro dependency 14217: button */;
const defaultImport3Props = {variant: 'primary',
text: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.geKm7t),
loading: property || property4, onPress: onPress_107550};
let r9 = property || property4;
r9 = !r9 ? property2.length < (require(14219) /* metro dependency 14219: MFA */).BACKUP_CODE_MIN_LENGTH : r9;
r9 = !r9 ? property5 > 0 : r9;
defaultImport3Props.disabled = r9;
object2.submit = ((Component) => )(defaultImport3);
object2.screenProps = {mfaChallenge: mfaChallenge, finish: finish};
object2.mfaMethod = 'backup';
return ;
}
function _fun107541() { // fn#107541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14418:962, offset: 0x023004b5, size: 61 bytes, params: 1, frame: 14
if (env0_6 <= 0) {
return undefined;
}
const env0_0 = global.setTimeout(_fun107542, 1000);
return _fun107544;
}
function _fun107545() { // fn#107545, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14418:1075, offset: 0x0230050b, size: 36 bytes, params: 1, frame: 12
const env0_0 = env1_3(_fun107547);
return _fun107548;
}
function onChangeCode(a0) { // fn#107549, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14418:1685, owner: BackupScreen.onChangeCode, offset: 0x023005e8, size: 28 bytes, params: 2, frame: 12
env0_3(a0);
env0_4(undefined);
}
function BackupScreenOnPress() { // fn#107550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14418:1856, owner: BackupScreen.onPress, offset: 0x02300604, size: 20 bytes, params: 1, frame: 11
return env0_8(env0_2);
}
function _fun107542() { // fn#107542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14418:997, offset: 0x023004f2, size: 25 bytes, params: 1, frame: 11
env1_7(function(a0) {
return a0 - 1;
});
}
function* _fun107547(a0) { // fn#107547, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14418:1095, offset: 0x0230053a, size: 174 bytes, params: 2, frame: 19
var message;
var r3;
var object2;
var moduleValue;
var value4;
var value5;
var binding;
var error;
var body;
let value = undefined;
if (true) {
value = undefined;
env2_4(value);
importDefault(true);
reducibleJoin3: while (true) {
reduciblePort20: while (true) {
exceptionLanding14: while (true) {
try {
} catch (error) {
break exceptionLanding14;
}
break reducibleJoin3;
}
binding = env2_4;
reducibleJoin17: while (true) {
if (error == null) {
message = value;
break reducibleJoin17;
}
body = error.body;
if (body == null) {
message = value;
break reducibleJoin17;
}
message = body.message;
break reducibleJoin17;
}
reducibleJoin19: while (true) {
if (message != null) {
r3 = message;
break reducibleJoin19;
}
message = error.message;
r3 = message;
break reducibleJoin19;
}
binding(r3);
break reduciblePort20;
}
importDefault(false);
return value;
}
try {
object2 = {};
} catch (error) {
break exceptionLanding14;
}
try {
object2.mfaType = 'backup';
} catch (error) {
break exceptionLanding14;
}
try {
object2.data = a0;
} catch (error) {
break exceptionLanding14;
}
try {
moduleValue = require(object2);
} catch (error) {
break exceptionLanding14;
}
yield moduleValue;
try {
value4 = undefined;
value5 = false;
} catch (error) {
break exceptionLanding14;
}
if (value5) {
return value4;
}
try {
binding = env2_5;
} catch (error) {
break exceptionLanding14;
}
try {
binding(true);
} catch (error) {
break exceptionLanding14;
}
importDefault(false);
}
return value;
}