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

267 lines
9.3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 5433
// Function ID: 5434
2026-07-20 16:05:17 +00:00
// Name: openIncodeAgeVerificationModal
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 1922, 5432, 5434, 4844, 5435, 21, 4845, 5265, 5436, 2008, 6584, 6586, 6587, 1625, 4663, 6588, 1940, 500, 6589, 6590, 4997, 4075, 709, 6591, 6592, 6724, 6725, 4093, 2]
2026-07-20 16:05:17 +00:00
2026-08-24 06:08:38 +00:00
// Module 5433 (openIncodeAgeVerificationModal)
import _modDef4093 from "module_4093" /* 4093 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "mergeGuildAvatar" /* 1922 */;
import set from "set" /* 5432 */;
import { AGE_VERIFICATION_INCODE_PATH as closure_9 } from "AGE_VERIFICATION_INCODE_PATH" /* 5434 */;
import { NativePermissionTypes } from "NativePermissionStatus" /* 4844 */;
import { SafetyToastType } from "SafetyToastType" /* 5435 */;
import { jsx } from "jsxProd" /* 21 */;
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
({ 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-08-04 21:03:28 +00:00
const 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*() {
2026-08-24 06:08:38 +00:00
closure_1 = tmp3;
closure_0 = tmp3;
dependencyMap = 1;
yield closure_1_1(4845).requestPermission(closure_1_10.CAMERA, { showAuthorizationError: true });
2026-08-04 21:03:28 +00:00
if (1 === tmp7) {
dependencyMap = 0;
2026-08-24 06:08:38 +00:00
closure_1_1(6584).showFailedToast(closure_1_11.TIGGER_PAWTECT_ERROR);
closure_1_0();
c4 = 3;
const obj5 = closure_1_1(6584);
2026-08-04 21:03:28 +00:00
} else if (2 === tmp7) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
2026-08-04 21:03:28 +00:00
c4 = 3;
2026-07-29 08:29:29 +00:00
throw arg1;
} else if (arg0 === 2) {
2026-08-04 21:03:28 +00:00
dependencyMap = 0;
c4 = 3;
const obj2 = { value: null, done: true };
obj2[0] = arg1;
return obj2;
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj1 = closure_1_1(5265);
2026-08-04 21:03:28 +00:00
const v0 = 3;
c4 = 1;
const obj3 = { value: null, done: false };
obj3[0] = obj1.pushLazy(v0(function*() {
2026-08-24 06:08:38 +00:00
closure_0 = tmp2;
yield closure_1_0(paths[10])(paths[9], paths.paths);
2026-08-04 21:03:28 +00:00
closure_0 = arg1.default;
2026-08-24 06:08:38 +00:00
return () => closure_2_12(closure_0, { webviewUrl: c2, onClose: closure_0, onComplete: c1 });
}), {}, closure_1_5);
2026-08-04 21:03:28 +00:00
return obj3;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
c4 = 3;
throw arg1;
} else if (arg0 !== 2) {
dependencyMap = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
dependencyMap = 0;
return arg1;
2026-07-20 16:05:17 +00:00
})();
flag = true;
}
return flag;
}
2026-08-24 06:08:38 +00:00
({ AGE_VERIFICATION_MODAL_KEY: c5, AGE_VERIFICATION_GET_STARTED_MODAL_KEY: closure_6, AGE_VERIFICATION_QUEST_UNSUPPORTED_ALERT_KEY: error, VerificationVendorName: closure_8 } = set);
let result = set.fileFinishedImporting("modules/age_assurance/AgeVerificationActionCreators.native.tsx");
2026-07-23 10:11:24 +00:00
export default {
2026-07-20 16:05:17 +00:00
showAgeVerification(onClose) {
let fn = onClose.onClose;
if (fn === undefined) {
2026-08-24 06:08:38 +00:00
fn = function n(arg0) {
2026-07-20 16:05:17 +00:00
};
}
2026-08-24 06:08:38 +00:00
({ shouldShowExpressiveModal, externalWindow, webviewUrl } = onClose);
({ method, verificationVendorName } = onClose);
2026-07-29 08:29:29 +00:00
let merged = Object.assign(onClose, Object.create(null));
2026-08-24 06:08:38 +00:00
let obj = fn(merged[14]);
2026-07-29 08:29:29 +00:00
if (obj.isMetaQuest()) {
2026-08-24 06:08:38 +00:00
let tmp2Result = tmp2(tmp3[15]);
tmp2Result.openAlert(closure_7, jsx(webviewUrl(tmp3[16]), {}), fn);
return true;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
if (method === tmp2(tmp3[17]).AgeAssuranceMethod.NEW_METHOD) {
if (null != webviewUrl) {
if ("" !== webviewUrl) {
tmp2Result = tmp2(tmp3[18]);
if (tmp2Result.isAndroid()) {
if (externalWindow == null) {
externalWindow = null;
}
const result = tmp2(tmp3[12]).openAgeVerificationCustomTab(webviewUrl, externalWindow);
const tmp2Result1 = tmp2(tmp3[12]);
result.then((arg0) => {
if (!arg0) {
webviewUrl(merged[11]).showFailedToast(closure_1_11.TIGGER_PAWTECT_ERROR);
fn();
const obj = webviewUrl(merged[11]);
}
}).catch(() => {
webviewUrl(merged[11]).showFailedToast(closure_1_11.TIGGER_PAWTECT_ERROR);
fn();
});
return true;
} else {
if (tmp2Result2.isIOS()) {
const result1 = tmp2(tmp3[13]).openAgeVerificationAuthSession(webviewUrl);
const tmp2Result3 = tmp2(tmp3[13]);
result1.then((arg0) => {
if (!arg0) {
webviewUrl(merged[11]).showFailedToast(closure_1_11.TIGGER_PAWTECT_ERROR);
fn();
const obj = webviewUrl(merged[11]);
}
}).catch(() => {
webviewUrl(merged[11]).showFailedToast(closure_1_11.TIGGER_PAWTECT_ERROR);
fn();
});
return true;
}
tmp2Result2 = tmp2(tmp3[18]);
}
}
}
}
if (verificationVendorName === constants.INCODE) {
if (tmp2Result4.isAgeVerificationIncodeEnabled(merged.entryPoint)) {
2026-07-29 08:29:29 +00:00
obj = { onClose: null, onComplete: null };
obj[0] = fn;
obj[1] = merged.onComplete;
2026-08-24 06:08:38 +00:00
let flag = openIncodeAgeVerificationModal(obj);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
return flag;
2026-07-20 16:05:17 +00:00
}
flag = null != webviewUrl;
if (flag) {
2026-07-29 08:29:29 +00:00
webviewUrl(tmp3[8]).pushLazy(callback(function*() {
2026-08-24 06:08:38 +00:00
closure_0 = tmp2;
yield closure_1_0(paths[10])(paths[20], paths.paths);
2026-08-04 21:03:28 +00:00
closure_0 = arg1.default;
return () => {
2026-08-24 06:08:38 +00:00
merged = Object.assign(c2);
return closure_2_12(closure_0, { webviewUrl: c1, onClose: closure_0 });
2026-08-04 21:03:28 +00:00
};
2026-07-20 16:05:17 +00:00
}), {}, closure_5);
flag = true;
2026-08-24 06:08:38 +00:00
const obj5 = webviewUrl(tmp3[8]);
2026-07-20 16:05:17 +00:00
}
}
},
showAgeVerificationGetStartedModal(entryPoint) {
entryPoint = entryPoint.entryPoint;
const onClose = entryPoint.onClose;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-23 10:11:24 +00:00
let prop;
2026-07-20 16:05:17 +00:00
let currentUser;
2026-08-15 05:55:55 +00:00
let obj = entryPoint(1625);
2026-07-20 16:05:17 +00:00
if (obj.isMetaQuest()) {
2026-08-24 06:08:38 +00:00
let tmpResult = tmp(4663);
tmpResult.openAlert(closure_7, jsx(onClose(6588), {}), onClose);
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
tmpResult = tmp(4997);
2026-07-20 16:05:17 +00:00
let isAgeVerifiedResult = tmpResult.isAgeVerified();
if (isAgeVerifiedResult) {
2026-08-24 06:08:38 +00:00
isAgeVerifiedResult = tmp(4075).hasAgeGatedFeatures();
const tmpResult1 = tmp(4075);
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() {
2026-08-24 06:08:38 +00:00
let obj = onClose(_undefined[23]);
2026-07-29 08:29:29 +00:00
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)) {
2026-08-24 06:08:38 +00:00
onClose(5265).pushLazy(prop(function*() {
closure_0 = tmp2;
yield closure_1_0(paths[10])(paths[25], paths.paths);
2026-08-04 21:03:28 +00:00
closure_0 = arg1.default;
2026-08-24 06:08:38 +00:00
return () => closure_2_12(closure_0, {
2026-08-04 21:03:28 +00:00
entryPoint: closure_0,
onClose() {
let tmp;
if (callback != null) {
tmp = callback();
2026-07-24 07:16:23 +00:00
}
2026-08-04 21:03:28 +00:00
return tmp;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
});
2026-07-29 08:29:29 +00:00
}), {}, closure_6);
2026-08-24 06:08:38 +00:00
const obj8 = onClose(5265);
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
currentUser = tmp(6724).isAgeVerificationExpressiveModalEverywhereEnabled(entryPoint);
const tmpResult4 = tmp(6724);
onClose(5265).pushLazy(prop(function*() {
closure_0 = tmp2;
yield closure_1_0(paths[10])(paths[27], paths.paths);
2026-08-04 21:03:28 +00:00
closure_0 = arg1.default;
2026-08-24 06:08:38 +00:00
return () => closure_2_12(closure_0, { entryPoint: closure_0, isRetry: c2, useEmbeddedMethods: closure_1_4 });
2026-07-29 08:29:29 +00:00
}), {}, closure_6);
2026-08-24 06:08:38 +00:00
const obj7 = onClose(5265);
2026-07-24 07:16:23 +00:00
}
2026-08-24 06:08:38 +00:00
tmpResult3 = tmp(6591);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
tmpResult2 = tmp(6589);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
},
showManualReviewPendingModal() {
2026-07-20 16:05:17 +00:00
},
openUrl(arg0) {
2026-08-24 06:08:38 +00:00
_modDef4093.openURL(arg0);
2026-07-20 16:05:17 +00:00
}
};