// Metro module 16713 (f16714). import { useRef, useState, useCallback, useEffect } from "react"; import { useSafetyFlowTask } from "../../SafetyFlowsTaskContext"; import { useOnTaskComplete } from "../SafetyFlowsUtils"; import { TaskInputType } from "../../types"; import ToastActionCreators from "../../../toast/native/ToastActionCreators"; import { intl } from "../../../../intl/index.native"; import SafetyFlows_messages from "../../SafetyFlows.messages"; import SafetyFlowTaskScreen from "../SafetyFlowTaskScreen"; import { Stack } from "../../../../design/components/Stack/native/Stack.native"; import Module712 from "../../../../_bundle/Module712"; import { Text } from "../../../../design/components/Text/native/Text"; import { TextInput } from "../../../../design/components/TextInput/native/TextInput.native"; import ResendVerificationCodeButton from "./ResendVerificationCodeButton"; export default () => { const task = useSafetyFlowTask().task; const onTaskComplete = useOnTaskComplete(); const ref = useRef(""); const [state, onChange] = useState(""); const [submitting, setState] = useState(false); const [state2, setState2] = useState(false); const callback = useCallback(async () => { let c28502_3 = 0; L14: { L13: { try { const current = ref.current; if (current == null) { break L14; } if (current !== "") { c28502_3 = 1; setState(true); setState2(true); await onTaskComplete({ verification_code: current, type: TaskInputType.VerificationCode }); (0, setState)(false); c28502_3 = 0; break L13; } break L14; } catch ($e) { let r7 = $e; if (c28502_3 !== 0) { while (true) { try { c28502_3 = 0; (0, setState)(false); (0, setState2)(false); ToastActionCreators.open({ key: "SAFETY_FLOWS_VERIFY_EMAIL_ERROR", content: intl.string(SafetyFlows_messages.PfbG6H) }); break L13; } catch ($e) { r7 = $e; if (c28502_3 === 0) { break; } } } } throw r7; } } return void 0; } }, [onTaskComplete]); useEffect(() => { ref.current = state; }, [state]); useEffect(() => { if (!(state.length !== 6 || state2)) { callback(); } }, [state, state2, callback]); const props = { title: intl.string(SafetyFlows_messages["Qm6K/s"]), action: intl.string(SafetyFlows_messages.wq2RDq), onAction: callback, submitting, children: null }; const r95 = [ {intl.string(SafetyFlows_messages.aveKoG)} , ]; props.children = {r95}; return ; };