/* Metro module 9008; source: modules/verification/native/ChangeEmailUtils.tsx; dependencies: [5, 8955, 7620, 9009, 676, 2] */ function _fun70086(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#70086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9193:6, offset: 0x01cee036, size: 190 bytes, params: 8, frame: 18 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(5) /* metro dependency 5 */; const changeEmailStoreModule = require(8955) /* metro dependency 8955: ChangeEmailStore */; const env0_4 = changeEmailStoreModule.setChangeEmailError; const env0_5 = changeEmailStoreModule.ChangeEmailFields; (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/verification/native/ChangeEmailUtils.tsx'); exports.saveEmail = function() { return _saveEmail.apply(this, arguments); }; exports.finishChangeEmailFlow = function(a0, a1) { var CHANGE_EMAIL_COMPLETE = require(dependencyMap[4]).VerificationModalScenes.CHANGE_EMAIL_COMPLETE; a0.replace(CHANGE_EMAIL_COMPLETE, {email: a1}); }; exports.finishVerifyEmailFlow = finishVerifyEmailFlow; } function _saveEmail() { // fn#70087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9193:162, offset: 0x01cee0f4, size: 50 bytes, params: 1, frame: 14 return env0_3(_fun70089).apply(this, arguments); } function finishVerifyEmailFlow(a0, a1) { // fn#70092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9193:1239, offset: 0x01cee39c, size: 137 bytes, params: 3, frame: 16 const getState = a0.getState; const length = Reflect.apply(getState, a0, []).routes.length; const VerificationModalScenes = (require(676) /* metro dependency 676: ConstantsIOS */).VerificationModalScenes; const RESEND_EMAIL = VerificationModalScenes.RESEND_EMAIL; const value2 = a1(RESEND_EMAIL); if (value2 !== -1) { a0.pop(length - value2); } else { a0.replace(VerificationModalScenes.RESEND_EMAIL); } } function* _fun70089(a0, a1, a2) { // fn#70089, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9193:205, offset: 0x01cee131, size: 556 bytes, params: 4, frame: 22 var length; var value8; var value9; if (false) { return undefined; } value = environment.__proto__.__proto__; let binding = env2_1; const value3 = undefined; const value4 = binding(env2_2[2]); yield value4.saveAccountChanges(a0, {close: false}); const value5 = undefined; if (true) { if (value5.ok) { return value5; } var body = value5.body; var username = body == null ? value3 : body.username; if (username != null) { env2_0(env2_2[3]).showInvalidUsernameToast(); } body = value5.body; if ((body == null ? value3 : body.email) != null) { binding = env2_4; binding(env2_5.EMAIL, value5.body.email[0]); length = a1.getState().routes.length; binding = env2_0; value9 = a2(binding(env2_2[4]).VerificationModalScenes.ENTER_EMAIL); if (value9 !== -1) { a1.pop(length - value9 - 1); } else { a1.replace(env2_0(env2_2[4]).VerificationModalScenes.ENTER_EMAIL); } return null; } body = value5.body; if ((body == null ? value3 : body.email_token) != null) { binding = env2_4; binding(env2_5.EMAIL_TOKEN, value5.body.email_token[0]); length = a1.getState().routes.length; binding = env2_0; value8 = a2(binding(env2_2[4]).VerificationModalScenes.CONFIRM_EMAIL_CHANGE_CODE); if (value8 !== -1) { a1.pop(length - value8 - 1); } else { a1.replace(env2_0(env2_2[4]).VerificationModalScenes.CONFIRM_EMAIL_CHANGE_CODE); } } } return value5; }