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

224 lines
7.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 6722
// Function ID: 6723
2026-07-20 16:05:17 +00:00
// Name: GoogleWalletVerificationScreen
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 32, 19, 17, 21, 1500, 4997, 6601, 5011, 5016, 1236, 2854, 5445, 5450, 4738, 4739, 6723, 4750, 5259, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 6722 (GoogleWalletVerificationScreen)
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "_slicedToArray" /* 32 */;
import closure_5 from "noop" /* 19 */;
import { ActivityIndicator } from "get ActivityIndicator" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
2026-07-20 16:05:17 +00:00
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
({ jsx: error, jsxs: closure_8 } = jsxProd);
2026-07-23 10:11:24 +00:00
let closure_9 = { NOT_AVAILABLE: "not_available", FAILED: "credential_error" };
2026-08-24 06:08:38 +00:00
let result = require("set").fileFinishedImporting("modules/age_assurance/native/GoogleWalletVerificationScreen.tsx");
2026-07-20 16:05:17 +00:00
export default function GoogleWalletVerificationScreen(modalSessionId) {
2026-07-23 10:11:24 +00:00
modalSessionId = modalSessionId.modalSessionId;
2026-07-29 08:29:29 +00:00
let navigation;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
2026-07-29 08:29:29 +00:00
let callback;
let callback1;
let React;
2026-08-15 05:55:55 +00:00
let obj = modalSessionId(1500);
2026-07-29 08:29:29 +00:00
navigation = obj.useNavigation();
[tmp5, c2] = callback1(React.useState({ type: "loading" }), 2);
2026-08-24 06:08:38 +00:00
obj1 = modalSessionId(4997);
2026-07-20 16:05:17 +00:00
const watchAgeVerificationStatusChange = obj1.useWatchAgeVerificationStatusChange(modalSessionId.onClose);
2026-07-29 08:29:29 +00:00
let items = [navigation];
callback = React.useCallback(() => {
2026-07-20 16:05:17 +00:00
navigation.goBack();
}, items);
const items1 = [callback];
2026-07-29 08:29:29 +00:00
callback1 = React.useCallback(callback(function*() {
2026-08-24 06:08:38 +00:00
closure_1 = tmp3;
2026-08-04 21:03:28 +00:00
let v0 = 1;
2026-08-24 06:08:38 +00:00
yield closure_1_0(closure_1_2[7]).requestGoogleWalletVerification();
2026-08-04 21:03:28 +00:00
if (1 === tmp7) {
v0 = 0;
let code;
if (lib != null) {
code = lib.code;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
if ("CANCELLED" === code) {
2026-08-24 06:08:38 +00:00
let obj11 = closure_1_1(closure_1_2[8]);
2026-08-04 21:03:28 +00:00
const obj2 = { name: null, tags: null };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_0(closure_1_2[9]).MetricEvents.GOOGLE_WALLET_VERIFICATION_FAILED;
2026-08-04 21:03:28 +00:00
obj2[1] = ["reason:user_cancelled"];
obj11.increment(obj2);
v0();
2026-08-24 06:08:38 +00:00
c5 = 3;
2026-08-04 21:03:28 +00:00
const obj3 = { value: null, done: true };
obj3[0] = undefined;
return obj3;
} else {
let reason;
if (lib != null) {
const body = lib.body;
if (body != null) {
reason = body.reason;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
}
if ("unsupported_issuing_country" === reason) {
2026-08-24 06:08:38 +00:00
let obj7 = closure_1_1(closure_1_2[8]);
2026-08-04 21:03:28 +00:00
let obj4 = { name: null, tags: null };
2026-08-24 06:08:38 +00:00
obj4[0] = closure_1_0(closure_1_2[9]).MetricEvents.GOOGLE_WALLET_VERIFICATION_FAILED;
2026-08-04 21:03:28 +00:00
obj4[1] = ["reason:unsupported_issuing_country"];
obj7.increment(obj4);
const obj5 = { type: "error", message: null };
2026-08-24 06:08:38 +00:00
const intl = closure_1_0(closure_1_2[10]).intl;
obj5[1] = intl.string(closure_1_1(closure_1_2[11]).Pf5xUq);
2026-08-04 21:03:28 +00:00
lib(obj5);
c5 = 3;
const obj6 = { value: null, done: true };
obj6[0] = undefined;
return obj6;
2026-07-29 08:29:29 +00:00
} else {
2026-08-04 21:03:28 +00:00
v0 = (function getFailureReason(closure_2) {
let status;
if (closure_2 != null) {
status = closure_2.status;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
let str = "rate_limited";
if (429 !== status) {
let code;
if (closure_2 != null) {
code = closure_2.code;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
let str3 = "unknown";
if (null != code) {
str3 = "unknown";
if (closure_2.code in closure_9) {
str3 = tmp3[closure_2.code];
}
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
str = str3;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
return str;
})(lib);
obj7 = { name: null, tags: null };
2026-08-24 06:08:38 +00:00
obj7[0] = closure_1_0(closure_1_2[9]).MetricEvents.GOOGLE_WALLET_VERIFICATION_FAILED;
2026-08-04 21:03:28 +00:00
const _HermesInternal = HermesInternal;
const items = ["reason:" + v0];
obj7[1] = items;
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_2[8]).increment(obj7);
2026-08-04 21:03:28 +00:00
const obj8 = { type: "error", message: null };
2026-08-24 06:08:38 +00:00
const intl2 = closure_1_0(closure_1_2[10]).intl;
obj8[1] = intl2.string(closure_1_1(closure_1_2[11])["+pwfOA"]);
2026-08-04 21:03:28 +00:00
lib(obj8);
2026-07-29 08:29:29 +00:00
c5 = 3;
2026-08-24 06:08:38 +00:00
const obj19 = closure_1_1(closure_1_2[8]);
2026-07-29 08:29:29 +00:00
}
}
2026-08-04 21:03:28 +00:00
} else if (2 === tmp7) {
if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 0;
c5 = 3;
const obj9 = { value: null, done: true };
obj9[0] = arg1;
return obj9;
} else {
const request_json = arg1.request_json;
2026-08-24 06:08:38 +00:00
obj4 = closure_1_0(closure_1_2[7]);
c4 = 3;
2026-08-04 21:03:28 +00:00
c5 = 1;
const obj10 = { value: null, done: false };
obj10[0] = obj4.getGoogleWalletCredential(request_json);
return obj10;
}
} else if (3 === tmp7) {
if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 0;
c5 = 3;
obj11 = { value: null, done: true };
obj11[0] = arg1;
return obj11;
} else {
closure_1 = arg1;
2026-08-24 06:08:38 +00:00
obj1 = closure_1_0(closure_1_2[7]);
2026-08-04 21:03:28 +00:00
c4 = 4;
c5 = 1;
const obj12 = { value: null, done: false };
obj12[0] = obj1.verifyGoogleWalletCredential(closure_1);
return obj12;
}
} else if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 !== 2) {
v0 = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
v0 = 0;
return arg1;
2026-07-20 16:05:17 +00:00
}), items1);
2026-07-23 10:11:24 +00:00
React = React.useRef(false);
2026-07-20 16:05:17 +00:00
const items2 = [navigation, callback1];
const effect = React.useEffect(() => {
2026-08-24 06:08:38 +00:00
closure_0 = navigation.addListener("transitionEnd", (data) => {
2026-07-29 08:29:29 +00:00
let current = ref.current;
2026-07-20 16:05:17 +00:00
if (!current) {
current = true === data.data.closing;
}
if (!current) {
2026-07-29 08:29:29 +00:00
ref.current = true;
callback2();
2026-07-20 16:05:17 +00:00
}
});
2026-07-23 10:11:24 +00:00
navigation = setTimeout(() => {
2026-07-29 08:29:29 +00:00
if (!ref.current) {
tmp.current = true;
callback2();
2026-07-20 16:05:17 +00:00
}
}, 1000);
return () => {
callback();
clearTimeout(closure_1);
};
}, items2);
2026-07-29 08:29:29 +00:00
if ("loading" === tmp5.type) {
obj = { children: null };
obj = { children: null };
obj1 = { align: "center", justify: "center", spacing: 16, children: null };
const items3 = [callback(ActivityIndicator, { size: "large" }), ];
let obj2 = { variant: "text-md/medium", color: "text-strong", children: null };
let intl = tmp(1236).intl;
2026-08-24 06:08:38 +00:00
obj2[2] = intl.string(navigation(2854).MlFuBI);
items3[1] = callback(tmp(4739).Text, obj2);
2026-07-29 08:29:29 +00:00
obj1[3] = items3;
2026-08-24 06:08:38 +00:00
obj[0] = callback2(tmp(4738).Stack, obj1);
obj[0] = callback(tmp(5450).ModalContent, obj);
let tmp14 = callback(tmp(5445).ModalScreen, obj);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let obj3 = { children: null };
let obj4 = { children: null };
let obj5 = { align: "center", justify: "center", spacing: 16, children: null };
let obj6 = { variant: "text-md/medium", color: "text-strong", children: null };
obj6[2] = tmp5.message;
2026-08-24 06:08:38 +00:00
const items4 = [callback(tmp(4739).Text, obj6), ];
2026-07-29 08:29:29 +00:00
let obj7 = { children: null };
let obj8 = { variant: "primary", size: "lg", text: null, onPress: null };
let intl2 = tmp(1236).intl;
2026-08-24 06:08:38 +00:00
obj8[2] = intl2.string(navigation(2854).fEUKEv);
2026-07-29 08:29:29 +00:00
obj8[3] = function onPress() {
const result = modalSessionId(_undefined[18]).trackAgeVerificationModalClicked(modalSessionId, modalSessionId(_undefined[18]).AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, modalSessionId(_undefined[18]).AgeVerificationModalCta.METHOD_SELECT);
2026-07-20 16:05:17 +00:00
callback();
};
2026-08-24 06:08:38 +00:00
obj7[0] = callback(tmp(4750).Button, obj8);
items4[1] = callback(tmp(6723).ButtonGroup, obj7);
2026-07-29 08:29:29 +00:00
obj5[3] = items4;
2026-08-24 06:08:38 +00:00
obj4[0] = callback2(tmp(4738).Stack, obj5);
obj3[0] = callback(tmp(5450).ModalContent, obj4);
tmp14 = callback(tmp(5445).ModalScreen, obj3);
2026-07-20 16:05:17 +00:00
}
return tmp14;
};