decord/source/modules/age_assurance/AgeVerificationActionCreators.native.tsx

475 lines
16 KiB
TypeScript
Raw Normal View History

2026-07-29 08:29:29 +00:00
// Module ID: 6747
// Function ID: 6748
2026-07-20 16:05:17 +00:00
// Name: openIncodeAgeVerificationModal
2026-07-29 08:29:29 +00:00
// Dependencies: [5, 1874, 6748, 6750, 4402, 6716, 21, 4732, 4395, 6751, 1959, 6721, 1577, 4530, 6767, 6768, 6769, 4405, 3868, 709, 6770, 6771, 7617, 7618, 3886, 2]
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
// Module 6747 (openIncodeAgeVerificationModal)
2026-07-23 10:11:24 +00:00
import SafetyToastType from "SafetyToastType";
2026-07-29 08:29:29 +00:00
import mergeGuildAvatar from "mergeGuildAvatar";
2026-07-23 10:11:24 +00:00
import set from "set";
2026-07-29 08:29:29 +00:00
import { AGE_VERIFICATION_INCODE_PATH as closure_9 } from "AGE_VERIFICATION_INCODE_PATH";
2026-07-23 10:11:24 +00:00
import { NativePermissionTypes } from "NativePermissionStatus";
import { SafetyToastType } from "SafetyToastType";
2026-07-29 08:29:29 +00:00
import { jsx } from "MethodsScreen";
2026-07-23 10:11:24 +00:00
import set from "set";
2026-07-29 08:29:29 +00:00
let c5;
2026-07-23 10:11:24 +00:00
let closure_6;
2026-07-29 08:29:29 +00:00
let error;
let metroImportAll;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function openIncodeAgeVerificationModal(arg0) {
2026-07-23 10:11:24 +00:00
let importDefault;
let require;
({ onClose: require, onComplete: importDefault } = arg0);
2026-07-29 08:29:29 +00:00
let combined;
2026-07-20 16:05:17 +00:00
let WEBAPP_ENDPOINT;
2026-07-29 08:29:29 +00:00
if (GLOBAL_ENV != null) {
2026-07-20 16:05:17 +00:00
WEBAPP_ENDPOINT = GLOBAL_ENV.WEBAPP_ENDPOINT;
}
2026-07-29 08:29:29 +00:00
combined = null;
2026-07-20 16:05:17 +00:00
if (null != WEBAPP_ENDPOINT) {
combined = null;
if ("" !== WEBAPP_ENDPOINT) {
const _URL = URL;
const _HermesInternal2 = HermesInternal;
let str3 = "https:";
const uRL = new URL("https:" + WEBAPP_ENDPOINT);
const hostname = uRL.hostname;
if ("localhost" !== hostname) {
if ("127.0.0.1" !== hostname) {
2026-07-23 10:11:24 +00:00
let obj = /^(10\.|192\.168\.|172\.(1[6-9]|2\d|3[01])\.)/;
2026-07-20 16:05:17 +00:00
}
const _HermesInternal = HermesInternal;
combined = "" + str3 + WEBAPP_ENDPOINT + closure_9;
}
str3 = "http:";
}
}
let flag = null != combined;
if (flag) {
2026-07-29 08:29:29 +00:00
callback(function*() {
if (c4 === 2) {
c4 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
c4 = 2;
if (0 === v0) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let closure_1 = tmp3;
let closure_0 = tmp3;
let dependencyMap = 1;
v0 = 2;
c4 = 1;
let obj1 = { value: null, done: false };
obj1[0] = outer1_1(4732).requestPermission(outer1_10.CAMERA, { showAuthorizationError: true });
return obj1;
}
} else {
if (1 === tmp7) {
dependencyMap = 0;
outer1_1(6721).showFailedToast(outer1_11.TIGGER_PAWTECT_ERROR);
outer1_0();
c4 = 3;
const obj5 = outer1_1(6721);
} else if (2 === tmp7) {
if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 === 2) {
dependencyMap = 0;
c4 = 3;
let obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
obj1 = outer1_1(4395);
v0 = 3;
c4 = 1;
const obj3 = { value: null, done: false };
obj3[0] = obj1.pushLazy(v0(function*() {
if (paths === 2) {
paths = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
paths = 2;
if (0 === c1) {
if (arg0 === 1) {
paths = 3;
throw arg1;
} else if (arg0 === 2) {
paths = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let closure_0 = tmp2;
closure_0 = undefined;
c1 = 1;
paths = 1;
const obj1 = { value: null, done: false };
obj1[0] = outer1_0(paths[10])(paths[9], paths.paths);
return obj1;
}
} else if (arg0 === 1) {
paths = 3;
throw arg1;
} else if (arg0 === 2) {
paths = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
closure_0 = arg1.default;
paths = 3;
obj = { value: null, done: true };
obj[0] = () => outer2_12(closure_0, { webviewUrl: c2, onClose: closure_0, onComplete: c1 });
return obj;
}
} catch (tmp9) {
paths = tmp;
throw tmp9;
}
}
}), {}, outer1_5);
return obj3;
}
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 !== 2) {
dependencyMap = 0;
}
dependencyMap = 0;
c4 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
} catch (tmp24) {
if (tmp4 === dependencyMap) {
c4 = tmp2;
throw tmp24;
} else {
v0 = tmp;
}
}
}
2026-07-20 16:05:17 +00:00
})();
flag = true;
}
return flag;
}
2026-07-29 08:29:29 +00:00
({ AGE_VERIFICATION_MODAL_KEY: c5, AGE_VERIFICATION_GET_STARTED_MODAL_KEY: closure_6, AGE_VERIFICATION_QUEST_UNSUPPORTED_ALERT_KEY: error, VerificationVendorName: metroImportAll } = set);
2026-07-23 10:11:24 +00:00
const result = set.fileFinishedImporting("modules/age_assurance/AgeVerificationActionCreators.native.tsx");
export default {
2026-07-20 16:05:17 +00:00
showAgeVerification(onClose) {
let shouldShowExpressiveModal;
let webviewUrl;
let fn = onClose.onClose;
if (fn === undefined) {
2026-07-29 08:29:29 +00:00
fn = function o(arg0) {
2026-07-20 16:05:17 +00:00
};
}
({ shouldShowExpressiveModal, webviewUrl } = onClose);
2026-07-29 08:29:29 +00:00
let merged = Object.assign(onClose, Object.create(null));
let obj = fn(merged[12]);
if (obj.isMetaQuest()) {
let tmp2Result = tmp2(tmp3[13]);
tmp2Result.openAlert(closure_7, jsx(webviewUrl(tmp3[14]), {}), fn);
2026-07-20 16:05:17 +00:00
let flag = true;
} else {
if (onClose.verificationVendorName === constants.INCODE) {
2026-07-29 08:29:29 +00:00
tmp2Result = tmp2(tmp3[15]);
if (tmp2Result.isAgeVerificationIncodeEnabled(merged.entryPoint)) {
obj = { onClose: null, onComplete: null };
obj[0] = fn;
obj[1] = merged.onComplete;
2026-07-20 16:05:17 +00:00
flag = openIncodeAgeVerificationModal(obj);
}
}
flag = null != webviewUrl;
if (flag) {
2026-07-29 08:29:29 +00:00
webviewUrl(tmp3[8]).pushLazy(callback(function*() {
if (paths === 2) {
paths = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
paths = 2;
if (0 === c1) {
if (arg0 === 1) {
paths = 3;
throw arg1;
} else if (arg0 === 2) {
paths = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let closure_0 = tmp2;
closure_0 = undefined;
c1 = 1;
paths = 1;
const obj1 = { value: null, done: false };
obj1[0] = outer1_0(paths[10])(paths[16], paths.paths);
return obj1;
}
} else if (arg0 === 1) {
paths = 3;
throw arg1;
} else if (arg0 === 2) {
paths = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
closure_0 = arg1.default;
paths = 3;
obj = { value: null, done: true };
obj[0] = () => {
const merged = Object.assign(c2);
return outer2_12(closure_0, { webviewUrl: c1, onClose: closure_0 });
};
return obj;
}
} catch (tmp9) {
paths = tmp;
throw tmp9;
}
}
2026-07-20 16:05:17 +00:00
}), {}, closure_5);
flag = true;
2026-07-29 08:29:29 +00:00
const obj3 = webviewUrl(tmp3[8]);
2026-07-20 16:05:17 +00:00
}
}
return flag;
},
showAgeVerificationGetStartedModal(entryPoint) {
entryPoint = entryPoint.entryPoint;
const onClose = entryPoint.onClose;
let dependencyMap;
2026-07-23 10:11:24 +00:00
let prop;
2026-07-20 16:05:17 +00:00
let currentUser;
2026-07-29 08:29:29 +00:00
let obj = entryPoint(1577);
2026-07-20 16:05:17 +00:00
if (obj.isMetaQuest()) {
2026-07-29 08:29:29 +00:00
let tmpResult = tmp(4530);
tmpResult.openAlert(closure_7, jsx(onClose(6767), {}), onClose);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
tmpResult = tmp(4405);
2026-07-20 16:05:17 +00:00
let isAgeVerifiedResult = tmpResult.isAgeVerified();
if (isAgeVerifiedResult) {
2026-07-29 08:29:29 +00:00
isAgeVerifiedResult = tmp(3868).hasAgeGatedFeatures();
const tmpResult1 = tmp(3868);
2026-07-20 16:05:17 +00:00
}
dependencyMap = isAgeVerifiedResult;
2026-07-29 08:29:29 +00:00
if (tmpResult2.isAgeVerificationIncodeEnabled(entryPoint)) {
2026-07-20 16:05:17 +00:00
currentUser = currentUser.getCurrentUser();
2026-07-23 10:11:24 +00:00
prop = undefined;
2026-07-29 08:29:29 +00:00
if (currentUser != null) {
2026-07-20 16:05:17 +00:00
prop = currentUser.ageVerificationStatus;
}
2026-07-29 08:29:29 +00:00
function handleClose() {
let obj = onClose(_undefined[19]);
obj = { type: "CLOSE_AGE_VERIFICATION_MODAL", status: prop };
obj.dispatch(obj);
if (onClose != null) {
onClose();
}
}
onClose(709).dispatch({ type: "INITIATE_AGE_VERIFICATION" });
obj = { onClose: null, onComplete: null };
obj[0] = handleClose;
obj[1] = function onComplete() {
2026-07-20 16:05:17 +00:00
};
if (!openIncodeAgeVerificationModal(obj)) {
2026-07-29 08:29:29 +00:00
obj = { type: "CLOSE_AGE_VERIFICATION_MODAL", status: null };
obj[1] = prop;
onClose(709).dispatch(obj);
if (onClose != null) {
onClose();
}
const tmp16Result = onClose(709);
2026-07-20 16:05:17 +00:00
}
} else {
2026-07-29 08:29:29 +00:00
if (tmpResult3.isExpressiveModalV2Enabled(entryPoint)) {
onClose(4395).pushLazy(prop(function*() {
if (paths === 2) {
paths = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
paths = 2;
if (0 === c1) {
if (arg0 === 1) {
paths = 3;
throw arg1;
} else if (arg0 === 2) {
paths = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let closure_0 = tmp2;
closure_0 = undefined;
c1 = 1;
paths = 1;
const obj1 = { value: null, done: false };
obj1[0] = outer1_0(paths[10])(paths[21], paths.paths);
return obj1;
2026-07-24 07:16:23 +00:00
}
2026-07-29 08:29:29 +00:00
} else if (arg0 === 1) {
paths = 3;
throw arg1;
} else if (arg0 === 2) {
paths = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
closure_0 = arg1.default;
paths = 3;
obj = { value: null, done: true };
obj[0] = () => outer2_12(closure_0, {
entryPoint: closure_0,
onClose() {
let tmp;
if (callback != null) {
tmp = callback();
}
return tmp;
}
});
return obj;
2026-07-24 07:16:23 +00:00
}
2026-07-29 08:29:29 +00:00
} catch (tmp9) {
paths = tmp;
throw tmp9;
}
}
}), {}, closure_6);
const obj8 = onClose(4395);
} else {
currentUser = tmp(7617).isAgeVerificationExpressiveModalEverywhereEnabled(entryPoint);
const tmpResult4 = tmp(7617);
onClose(4395).pushLazy(prop(function*() {
if (paths === 2) {
paths = 3;
HermesBuiltin.throwTypeError();
} else if (tmp4 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
return { value: "HermesInternal", done: null };
}
} else {
try {
paths = 2;
if (0 === c1) {
if (arg0 === 1) {
paths = 3;
throw arg1;
} else if (arg0 === 2) {
paths = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let closure_0 = tmp2;
closure_0 = undefined;
c1 = 1;
paths = 1;
const obj1 = { value: null, done: false };
obj1[0] = outer1_0(paths[10])(paths[23], paths.paths);
return obj1;
}
} else if (arg0 === 1) {
paths = 3;
throw arg1;
} else if (arg0 === 2) {
paths = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
} else {
closure_0 = arg1.default;
paths = 3;
obj = { value: null, done: true };
obj[0] = () => outer2_12(closure_0, { entryPoint: closure_0, isRetry: c2, useEmbeddedMethods: outer1_4 });
return obj;
}
} catch (tmp9) {
paths = tmp;
throw tmp9;
}
}
}), {}, closure_6);
const obj7 = onClose(4395);
2026-07-24 07:16:23 +00:00
}
2026-07-29 08:29:29 +00:00
tmpResult3 = tmp(6770);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmpResult2 = tmp(6768);
2026-07-20 16:05:17 +00:00
}
},
openUrl(arg0) {
2026-07-29 08:29:29 +00:00
importDefault(3886).openURL(arg0);
2026-07-20 16:05:17 +00:00
}
};