Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
181 lines
5.9 KiB
TypeScript
181 lines
5.9 KiB
TypeScript
// Module ID: 16056
|
|
// Function ID: 16057
|
|
// Name: components/VerifyPhone
|
|
// Dependencies: [5, 32, 19, 16028, 16029, 1074, 21, 16025, 16044, 5042, 7097, 1114, 7131, 16057, 7132, 2]
|
|
// Exports: default
|
|
|
|
// Module 16056 (components/VerifyPhone)
|
|
import RegistrationBailoutButtonDefault from "RegistrationBailoutButton" /* 16057 */;
|
|
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
const require = globalThis.__r;
|
|
|
|
const require = fn;
|
|
let closure_6 = fn(16028).doesRegistrationHaveIdentityType;
|
|
const RegistrationConstants = fn(16029);
|
|
({ authStateToRegisterTransitionStep: closure_7, RegisterTransitionSteps: closure_8, RegistrationTransitionActionTypes: closure_9 } = RegistrationConstants);
|
|
const Links = fn(1074).Links;
|
|
const jsx = fn(21).jsx;
|
|
const size = fn(2);
|
|
const result = size.fileFinishedImporting("modules/auth/native/components/VerifyPhone.tsx");
|
|
|
|
export default function VerifyPhone(phone) {
|
|
phone = phone.phone;
|
|
_require = phone;
|
|
const onPhoneTokenReceived = phone.onPhoneTokenReceived;
|
|
({ onClose: dependencyMap, onBail } = phone);
|
|
_slicedToArray = undefined;
|
|
noop = undefined;
|
|
c6 = undefined;
|
|
({ title, description, sourceState } = phone);
|
|
[obj.loading, _slicedToArray] = noop.useState(false);
|
|
[tmp3, c5] = _slicedToArray(noop.useState(null), 2);
|
|
let tmp2 = _slicedToArray(noop.useState(null), 2);
|
|
[tmp5, c6] = _slicedToArray(noop.useState(false), 2);
|
|
closure_7 = noop.useRef(false);
|
|
const context = noop.useContext(require("Auth").TrackRegistrationContext);
|
|
const tmp4 = _slicedToArray(noop.useState(false), 2);
|
|
onPhoneTokenReceived(16044)(closure_7(sourceState));
|
|
const items = [context];
|
|
const effect = noop.useEffect(() => {
|
|
if (_undefined()) {
|
|
const obj = { step: constants.PHONE_VERIFICATION, actionType: constants2.VIEWED };
|
|
context(obj);
|
|
}
|
|
}, items);
|
|
onPhoneTokenReceived(5042)(() => () => {
|
|
let tmpResult;
|
|
if (dependencyMap != null) {
|
|
tmpResult = tmp(ref.current);
|
|
}
|
|
return tmpResult;
|
|
});
|
|
onBail(function*(arg0) {
|
|
closure_2 = tmp3;
|
|
v0(true);
|
|
v0 = 1;
|
|
if (v3()) {
|
|
context({ step: context.PHONE_VERIFICATION, actionType: callback.SUBMITTED });
|
|
}
|
|
yield onPhoneTokenReceived(7097).verifyPhone(closure_0, closure_0, false);
|
|
if (1 === tmp7) {
|
|
v0 = 0;
|
|
closure_129_1 = closure_3;
|
|
v0(false);
|
|
if (v3()) {
|
|
context({ step: context.PHONE_VERIFICATION, actionType: callback.RESPONSE_ERROR, details: ["code"] });
|
|
}
|
|
const body = closure_129_1.body;
|
|
let message;
|
|
if (body != null) {
|
|
message = body.message;
|
|
}
|
|
if (!message) {
|
|
const intl = closure_0(1114).intl;
|
|
message = intl.format(closure_0(1114).t.aTVNes, { statusPageURL: constants.STATUS });
|
|
}
|
|
_undefined(message);
|
|
v3 = 3;
|
|
} else if (arg0 === 1) {
|
|
v3 = 3;
|
|
throw arg1;
|
|
} else if (arg0 !== 2) {
|
|
const token = arg1.token;
|
|
closure_1_7.current = true;
|
|
onPhoneTokenReceived(token);
|
|
v0 = 0;
|
|
}
|
|
v0 = 0;
|
|
return arg1;
|
|
});
|
|
const items1 = [phone, onPhoneTokenReceived, context];
|
|
const onCodeEntered = noop.useCallback(function() {
|
|
const self = this;
|
|
const apply = closure_0.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
}, items1);
|
|
_require = onBail(function*(arg0, value) {
|
|
if (c3 === 2) {
|
|
c3 = 3;
|
|
throw new TypeError("Generator functions may not be called on executing generators");
|
|
} else if (tmp3 === 3) {
|
|
if (arg0 === 1) {
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
const obj2 = { value, done: true };
|
|
return obj2;
|
|
} else {
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} else {
|
|
try {
|
|
c3 = 2;
|
|
if (0 === c2) {
|
|
if (arg0 === 1) {
|
|
c3 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c3 = 3;
|
|
const obj3 = { value, done: true };
|
|
return obj3;
|
|
} else {
|
|
closure_1 = tmp4;
|
|
_undefined(true);
|
|
c2 = 1;
|
|
c3 = 1;
|
|
const obj4 = { value: onCodeEntered(closure_0), done: false };
|
|
return obj4;
|
|
}
|
|
} else if (arg0 === 1) {
|
|
c3 = 3;
|
|
throw value;
|
|
} else if (arg0 === 2) {
|
|
c3 = 3;
|
|
const obj = { value, done: true };
|
|
return obj;
|
|
} else {
|
|
_undefined(false);
|
|
c3 = 3;
|
|
return { value: "HermesInternal", done: null };
|
|
}
|
|
} catch (tmp12) {
|
|
c3 = tmp;
|
|
throw tmp12;
|
|
}
|
|
}
|
|
});
|
|
const items2 = [onCodeEntered];
|
|
const callback1 = noop.useCallback(function() {
|
|
const self = this;
|
|
const apply = closure_0.apply;
|
|
if (typeof apply === "unknown") {
|
|
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
|
|
} else {
|
|
applyArgumentsResult = apply(self, arguments);
|
|
}
|
|
return applyArgumentsResult;
|
|
}, items2);
|
|
onPhoneTokenReceived(7131)(callback1);
|
|
const items3 = [onBail];
|
|
const memo = noop.useMemo(() => {
|
|
let tmp2 = null;
|
|
if (null != onBail) {
|
|
const obj = { onBail: tmp };
|
|
tmp2 = jsx(RegistrationBailoutButtonDefault, { onBail: tmp });
|
|
}
|
|
return tmp2;
|
|
}, items3);
|
|
let obj = { title, description, error: tmp3, onCodeEntered, codeType: null, footer: null, disabled: null, loading: null, disableKeyboardAvoidingView: true };
|
|
const tmp7 = onPhoneTokenReceived(16044);
|
|
obj.codeType = require("CodeField").CodeType.NUMERIC;
|
|
obj.footer = memo;
|
|
obj.disabled = tmp5;
|
|
return jsx(onPhoneTokenReceived(7132), { title, description, error: tmp3, onCodeEntered, codeType: null, footer: null, disabled: null, loading: null, disableKeyboardAvoidingView: true });
|
|
};
|