/* Metro module 8971; source: modules/auth/native/components/Login.tsx; dependencies: [5, 57, 31, 27, 8972, 1226, 661, 33, 4501, 5278, 4573, 4496, 1244, 477, 4671, 8973, 1484, 566, 1487, 5076, 8975, 4497, 8976, 8977, 8978, 4131, 8979, 8983, 8984, 8986, 8987, 8980, 4578, 8988, 1305, 1581, 8990, 8992, 7981, 8998, 8999, 9001, 4572, 9005, 8970, 2] */
import Module00005 from '../../../../by-id/module-00005.js'; /* Metro dependency 5 */
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
import AuthenticationStore from '../../../../stores/AuthenticationStore.tsx'; /* Metro dependency 1226 */
import AlertActionCreators from '../../../../actions/native/AlertActionCreators.tsx'; /* Metro dependency 4496 */
import PhoneStore from '../../../phone/PhoneStore.tsx'; /* Metro dependency 8972 */
import UseWideAuthView from '../useWideAuthView.tsx'; /* Metro dependency 8973 */
import UseLoginReset from '../useLoginReset.tsx'; /* Metro dependency 8983 */
import UseWithPostLoginRouting from './utils/useWithPostLoginRouting.tsx'; /* Metro dependency 8984 */
import PasskeyButtonUpdateExperiment from '../PasskeyButtonUpdateExperiment.tsx'; /* Metro dependency 8987 */
import PhoneOrEmailInput from '../../../phone/native/PhoneOrEmailInput.tsx'; /* Metro dependency 8992 */
import AuthFormView from './AuthFormView.tsx'; /* Metro dependency 9001 */
import * as FileImportTrackerModule from '../../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
import * as PlatformUtilsModule from '../../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
import * as FluxModule from '../../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as UseNavigationNativeModule from '../../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as moduleValue3 from '../../../../by-id/module-01487.js'; /* Metro dependency 1487 */
import * as MetaQuestUtilsAndroidModule from '../../../device/MetaQuestUtils.android.tsx'; /* Metro dependency 1581 */
import * as TextModule from '../../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
import * as PressablesModule from '../../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
import * as TextInputNativeModule from '../../../../design/components/TextInput/native/TextInput.native.tsx'; /* Metro dependency 7981 */
function _fun69920(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69920, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9156:6, offset: 0x01ce8672, size: 319 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_12 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(function(a0) {
return {password: {marginTop: 24}, button: {'width': '100%', 'marginTop': 16}, hint: {marginTop: 4},
link: {'alignSelf': 'flex-start', 'paddingVertical': 4}, separator: {'paddingHorizontal': 16,
'paddingVertical': 4}, content: {marginTop: 32, marginBottom: a0 ? 12 : 0}};
});
const LinkButton_699242 = LinkButton_69924;
(FileImportTrackerModule).fileFinishedImporting('modules/auth/native/components/Login.tsx');
exports.default = Login;
exports.LinkButton = LinkButton_699242;
function handlePressPasswordManagerHint() { // fn#69921, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9156:752, offset: 0x01ce87b1, size: 261 bytes, params: 1, frame: 18
const defaultImport = AlertActionCreators;
const show = defaultImport.show;
const object = {};
const intl = (IndexNativeModule).intl;
const string = intl.string;
const t = (IndexNativeModule).t;
object.title = Reflect.apply(string, intl, [t.lzsy7t]);
object.body = intl.string(t['TYqh/t']);
object.confirmText = intl.string(t['9x0iKe']);
object.cancelText = intl.string(t['ETE/oC']);
object.onConfirm = onConfirm_69922;
Reflect.apply(show, defaultImport, [object]);
function handlePressPasswordManagerHintOnConfirm() { // fn#69922, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9156:1012, owner: handlePressPasswordManagerHint.onConfirm, offset: 0x01ce88b6, size: 72 bytes, params: 1, frame: 12
const value = environment.__proto__;
if (PlatformUtilsModule.isAndroid()) {
(importDefault(4671) /* metro dependency 4671: NativeDeviceSettingsModule */).openAccessibilitySettings();
}
}
}
function LinkButton_69924({onPress, text, containerStyle, textStyle, variant, textColor}) { // fn#69924, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9156:475, offset: 0x01ce8973, size: 189 bytes, params: 2, frame: 22
variant = variant === undefined ? 'text-xs/medium' : variant;
textColor = textColor === undefined ? 'text-link' : textColor;
const PressableOpacity = (PressablesModule).PressableOpacity;
const items2 = [containerStyle];
const Text = (TextModule).Text;
return (
{text}
);
}
function Login({isMultiAccount}) { // fn#69925, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9156:1172, offset: 0x01ce8a30, size: 2897 bytes, params: 2, frame: 41
var button;
var r8;
var r5;
var Button;
var LINK;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var moduleValue6;
isMultiAccount = !(isMultiAccount === undefined) && isMultiAccount;
let env0_4 = undefined;
let env0_5 = undefined;
var value;
const styles = useStyles((UseWideAuthView)());
const value3 = (UseNavigationNativeModule).useNavigation();
const useStateFromStores = FluxModule.useStateFromStores;
let object = [PhoneStore];
const countryCode = Reflect.apply(useStateFromStores, FluxModule, [object, function() {
return PhoneStore.getCountryCode();
}]);
const value4 = countryCode.code.split(' ');
let binding = env0_4;
const property = binding(value4, 1)[0];
const binding2 = env0_5;
const value7 = binding2.useRef(null);
let useState = binding2.useState;
const value9 = binding(Reflect.apply(useState, binding2, [false]), 2);
const property2 = value9[0];
const env0_3 = value9[1];
useState = binding2.useState;
const value10 = binding(Reflect.apply(useState, binding2, [false]), 2);
const property3 = value10[0];
env0_4 = value10[1];
useState = binding2.useState;
const value11 = binding(Reflect.apply(useState, binding2, [{}]), 2);
const property4 = value11[0];
env0_5 = value11[1];
useState = binding2.useState;
const value12 = binding(Reflect.apply(useState, binding2, ['']), 2);
const property5 = value12[0];
const env0_7 = value12[1];
useState = binding2.useState;
const value13 = binding(Reflect.apply(useState, binding2, ['']), 2);
const env0_8 = value13[0];
const property6 = value13[1];
useState = binding2.useState;
const value14 = binding(Reflect.apply(useState, binding2, [false]), 2);
const property7 = value14[0];
const env0_10 = value14[1];
const env0_11 = binding2.useRef(undefined);
binding2.useEffect(function() {
return _fun69928;
}, []);
let useCallback = binding2.useCallback;
const value15 = Reflect.apply(useCallback, binding2, [_fun69929, []]);
const useFocusEffect = moduleValue3.useFocusEffect;
useCallback = binding2.useCallback;
Reflect.apply(useFocusEffect, moduleValue3, [Reflect.apply(useCallback, binding2, [_fun69931, []])]);
useCallback = binding2.useCallback;
binding = env0_3;
const env0_13 = Reflect.apply(useCallback, binding2, [binding(_fun69933), [value15, property5]]);
const value18 = binding2.useCallback(_fun69934(), [value15, isMultiAccount]);
const value20 = binding2.useCallback(binding(_fun69939), [value15, property7]);
(UseLoginReset)();
(UseWithPostLoginRouting)(value3, value18);
const r28 = (importDefault(8986) /* metro dependency 8986: getError */)('login',
property4) ?? (importDefault(8986) /* metro dependency 8986: getError */)('email', property4);
const value23 = (importDefault(8986) /* metro dependency 8986: getError */)('password', property4);
const {newButton,
canDisable} = (PasskeyButtonUpdateExperiment).useConfig({location: 'Login'});
const r10 = canDisable && (property3 || property7);
if ((require(8980) /* metro dependency 8980: MFAUtils */).hasWebAuthn) {
if (newButton) {
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
button = (