decord/source/modules/age_assurance/hooks/useAgeVerificationMethods.tsx

190 lines
7.7 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 6733
// Function ID: 6734
2026-07-20 16:05:17 +00:00
// Name: useAgeVerificationMethods
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 32, 19, 5431, 5432, 589, 4997, 5259, 6601, 5011, 5016, 6734, 5441, 1236, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 6733 (useAgeVerificationMethods)
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "_slicedToArray" /* 32 */;
import closure_5 from "noop" /* 19 */;
import closure_6 from "initialize" /* 5431 */;
import set from "set" /* 5432 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
({ VERIFICATION_METHOD_TITLE_MAP: error, VerificationMethod: closure_8 } = set);
2026-07-23 10:11:24 +00:00
let result = set.fileFinishedImporting("modules/age_assurance/hooks/useAgeVerificationMethods.tsx");
2026-07-20 16:05:17 +00:00
export default function useAgeVerificationMethods(onGoogleWalletSelect) {
onGoogleWalletSelect = onGoogleWalletSelect.onGoogleWalletSelect;
2026-07-29 08:29:29 +00:00
let methods;
let initiateAgeVerification;
let first;
let callback;
2026-07-20 16:05:17 +00:00
({ onClose, classificationId } = onGoogleWalletSelect);
2026-07-23 10:11:24 +00:00
let obj = onGoogleWalletSelect(initiateAgeVerification[5]);
2026-07-29 08:29:29 +00:00
let items = [closure_6];
const stateFromStoresObject = obj.useStateFromStoresObject(items, () => ({ methods: closure_6.methods, loading: closure_6.loading }));
methods = stateFromStoresObject.methods;
2026-07-23 10:11:24 +00:00
obj = { onComplete: onClose, entryPoint: onGoogleWalletSelect(initiateAgeVerification[7]).AgeVerificationModalEntryPoint.EXPRESSIVE_GET_STARTED, shouldShowExpressiveModal: true, classificationId };
initiateAgeVerification = onGoogleWalletSelect(initiateAgeVerification[6]).useInitiateAgeVerification(obj).initiateAgeVerification;
2026-07-20 16:05:17 +00:00
const tmp2 = callback(React.useState(false), 2);
2026-07-29 08:29:29 +00:00
first = tmp2[0];
2026-07-23 10:11:24 +00:00
callback = tmp2[1];
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
2026-08-24 06:08:38 +00:00
c0 = false;
2026-07-23 10:11:24 +00:00
let result = onGoogleWalletSelect(initiateAgeVerification[8]).checkGoogleWalletAvailable();
2026-07-20 16:05:17 +00:00
result.then((arg0) => {
2026-07-23 10:11:24 +00:00
if (!c0) {
2026-07-29 08:29:29 +00:00
let result = arg0;
2026-07-23 10:11:24 +00:00
let obj = methods(initiateAgeVerification[9]);
2026-07-29 08:29:29 +00:00
obj = { name: null, tags: null };
obj[0] = onGoogleWalletSelect(initiateAgeVerification[10]).MetricEvents.GOOGLE_WALLET_AVAILABILITY_CHECK;
2026-07-20 16:05:17 +00:00
const _HermesInternal = HermesInternal;
2026-07-29 08:29:29 +00:00
const items = ["available:" + arg0];
obj[1] = items;
2026-07-20 16:05:17 +00:00
obj.increment(obj);
2026-07-29 08:29:29 +00:00
if (arg0) {
result = tmp4(tmp3[11]).isGoogleWalletEnabled("age_verification_methods");
const tmp4Result = tmp4(tmp3[11]);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
closure_1_4(result);
2026-07-29 08:29:29 +00:00
tmp3 = initiateAgeVerification;
tmp4 = onGoogleWalletSelect;
2026-08-24 06:08:38 +00:00
const tmp7 = closure_1_4;
2026-07-20 16:05:17 +00:00
}
});
return () => {
2026-08-24 06:08:38 +00:00
c0 = true;
2026-07-20 16:05:17 +00:00
};
}, []);
const items1 = [methods];
const effect1 = React.useEffect(() => {
if (null == methods) {
const ageVerificationMethods = onGoogleWalletSelect(initiateAgeVerification[12]).getAgeVerificationMethods();
const obj = onGoogleWalletSelect(initiateAgeVerification[12]);
}
}, items1);
const items2 = [methods, first, onGoogleWalletSelect, initiateAgeVerification];
obj = {
ageVerificationMethods: React.useMemo(() => {
let found1;
2026-07-29 08:29:29 +00:00
if (methods != null) {
const found = methods.filter((arg0) => arg0 !== constants.GOOGLE_WALLET);
const mapped = found.map((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
if (null == closure_1_7[arg0]) {
2026-07-20 16:05:17 +00:00
return null;
} else {
2026-07-29 08:29:29 +00:00
let obj = { id: null, title: null, description: null, onClick: null };
obj[0] = arg0;
2026-07-20 16:05:17 +00:00
({ title, description } = tmp);
2026-08-24 06:08:38 +00:00
const intl = closure_1_0(closure_1_2[13]).intl;
2026-07-29 08:29:29 +00:00
obj[1] = intl.string(title);
2026-08-24 06:08:38 +00:00
const intl2 = closure_1_0(closure_1_2[13]).intl;
2026-07-29 08:29:29 +00:00
obj[2] = intl2.string(description);
2026-08-24 06:08:38 +00:00
closure_1 = closure_1_3((arg0) => {
closure_0 = arg0;
c2 = 0;
c1 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (c1 === 2) {
c1 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c1 = 2;
if (0 === v0) {
if (arg0 === 1) {
c1 = 3;
throw arg1;
} else if (arg0 === 2) {
c1 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
const obj5 = callback(closure_2_2[7]);
const result = obj5.trackAgeVerificationModalClicked(callback, callback(closure_2_2[7]).AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, callback(closure_2_2[7]).AgeVerificationModalCta.METHOD_SELECT, callback);
2026-07-29 08:29:29 +00:00
v0 = 1;
c1 = 1;
2026-08-24 06:08:38 +00:00
obj1 = { value: null, done: false };
2026-07-29 08:29:29 +00:00
obj1[0] = v0(callback);
return obj1;
}
} else if (arg0 === 1) {
c1 = 3;
throw arg1;
} else if (arg0 === 2) {
c1 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
c1 = 3;
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp5) {
c1 = tmp;
throw tmp5;
}
}
})();
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
obj[3] = function() {
const self = this;
const apply = closure_1.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
return obj;
}
});
found1 = mapped.filter((arg0) => null != arg0);
}
2026-07-29 08:29:29 +00:00
if (found1 == null) {
2026-07-20 16:05:17 +00:00
found1 = [];
}
if (first) {
if (null != onGoogleWalletSelect) {
2026-08-24 06:08:38 +00:00
if (null != closure_1_7[closure_1_8.GOOGLE_WALLET]) {
2026-07-29 08:29:29 +00:00
let obj = { id: null, title: null, description: null, onClick: null };
obj[0] = tmp3.GOOGLE_WALLET;
2026-07-23 10:11:24 +00:00
let intl = onGoogleWalletSelect(initiateAgeVerification[13]).intl;
2026-07-29 08:29:29 +00:00
obj[1] = intl.string(tmp4.title);
2026-07-23 10:11:24 +00:00
let intl2 = onGoogleWalletSelect(initiateAgeVerification[13]).intl;
2026-07-29 08:29:29 +00:00
obj[2] = intl2.string(tmp4.description);
obj[3] = function onClick(modalSessionId) {
2026-08-24 06:08:38 +00:00
let obj = closure_1_1(closure_1_2[9]);
obj = { name: closure_1_0(closure_1_2[10]).MetricEvents.GOOGLE_WALLET_METHOD_SELECTED };
2026-07-20 16:05:17 +00:00
obj.increment(obj);
2026-08-24 06:08:38 +00:00
const result = closure_1_0(closure_1_2[7]).trackAgeVerificationModalClicked(modalSessionId, closure_1_0(closure_1_2[7]).AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, closure_1_0(closure_1_2[7]).AgeVerificationModalCta.METHOD_SELECT, closure_1_8.GOOGLE_WALLET);
2026-07-29 08:29:29 +00:00
callback();
2026-07-20 16:05:17 +00:00
};
const items = [];
2026-07-29 08:29:29 +00:00
items[HermesBuiltin.arraySpread(found1, 0)] = obj;
2026-07-20 16:05:17 +00:00
return items;
}
}
}
return found1;
}, items2),
loading: stateFromStoresObject.loading
};
return obj;
};