This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,106 @@
// Metro module 7626 (f7627).
import { useState, useEffect, useMemo } from "react";
import AgeVerificationStore from "../AgeVerificationStore";
import { VERIFICATION_METHOD_TITLE_MAP, VerificationMethod } from "../AgeVerificationConstants";
import { useStateFromStoresObject } from "../../../_bundle/Module589";
import { useInitiateAgeVerification } from "../AgeVerificationUtils";
import { AgeVerificationModalEntryPoint, AgeVerificationModalVersion, AgeVerificationModalCta, trackAgeVerificationModalClicked } from "../AgeVerificationAnalyticsUtils";
import { checkGoogleWalletAvailable } from "../GoogleWalletActionCreators.native";
import MonitoringAgent from "../../monitoring/MonitoringAgent";
import { MetricEvents } from "../../../_bundle/Module5872";
import { isGoogleWalletEnabled } from "../GoogleWalletExperiment";
import { getAgeVerificationMethods } from "../AgeVerificationURLActionCreators";
import { intl } from "../../../intl/index.native";
export default function useAgeVerificationMethods({ onClose, classificationId, onGoogleWalletSelect }) {
let methods, initiateAgeVerification, state, setState;
methods = void 0;
initiateAgeVerification = void 0;
state = void 0;
setState = void 0;
const stateFromStoresObject = useStateFromStoresObject([AgeVerificationStore], () => ({
methods: AgeVerificationStore.methods,
loading: AgeVerificationStore.loading
}));
methods = stateFromStoresObject.methods;
const loading = stateFromStoresObject.loading;
initiateAgeVerification = useInitiateAgeVerification({
onComplete: onClose,
entryPoint: AgeVerificationModalEntryPoint.EXPRESSIVE_GET_STARTED,
shouldShowExpressiveModal: true,
classificationId
}).initiateAgeVerification;
[state, setState] = useState(false);
useEffect(() => {
let c26011_0 = false;
checkGoogleWalletAvailable().then((result) => {
if (!c26011_0) {
let r9 = result;
MonitoringAgent.increment({
name: MetricEvents.GOOGLE_WALLET_AVAILABILITY_CHECK,
tags: [`available:${result}`]
});
if (result) {
r9 = isGoogleWalletEnabled("age_verification_methods");
}
setState(r9);
}
});
return () => {
c26011_0 = true;
};
}, []);
useEffect(() => {
if (methods == null) {
getAgeVerificationMethods();
}
}, [methods]);
return {
ageVerificationMethods: useMemo(() => {
let r6 = methods == null ? void 0 : methods.filter((method) => method !== VerificationMethod.GOOGLE_WALLET).map((item) => {
const r11 = VERIFICATION_METHOD_TITLE_MAP[item];
if (r11 == null) {
return null;
}
const { title, description } = r11;
const r21 = {
id: item,
title: intl.string(title),
description: intl.string(description),
onClick: null
};
let c29844_1 = async (c31439_0) => {
const EXPRESSIVE_PRIMARY = AgeVerificationModalVersion.EXPRESSIVE_PRIMARY;
const METHOD_SELECT = AgeVerificationModalCta.METHOD_SELECT;
trackAgeVerificationModalClicked(c31439_0, EXPRESSIVE_PRIMARY, METHOD_SELECT, item);
await initiateAgeVerification(item);
};
r21.onClick = function() {
return c29844_1.apply(this, arguments);
};
return r21;
}).filter((item) => item != null);
if (r6 == null) {
r6 = [];
}
if (state && onGoogleWalletSelect != null) {
const r28 = VERIFICATION_METHOD_TITLE_MAP[VerificationMethod.GOOGLE_WALLET];
if (r28 != null) {
return [...r6, {
id: VerificationMethod.GOOGLE_WALLET,
title: intl.string(r28.title),
description: intl.string(r28.description),
onClick: (a0) => {
MonitoringAgent.increment({
name: MetricEvents.GOOGLE_WALLET_METHOD_SELECTED
});
trackAgeVerificationModalClicked(a0, AgeVerificationModalVersion.EXPRESSIVE_PRIMARY, AgeVerificationModalCta.METHOD_SELECT, VerificationMethod.GOOGLE_WALLET);
onGoogleWalletSelect();
}
}];
}
}
return r6;
}, [methods, state, onGoogleWalletSelect, initiateAgeVerification]),
loading
};
};
@@ -0,0 +1,133 @@
// Metro module 6778 (f6779).
import _slicedToArray from "../../../_bundle/_slicedToArray";
import { useState, useRef, useCallback, useEffect } from "react";
import AgeVerificationStore from "../AgeVerificationStore";
import { fetchAgeVerificationMethodsV2 } from "../AgeVerificationMethodsV2";
import Dispatcher from "../../../Dispatcher";
let env4357 = {};
export function useAgeVerificationMethodsV2() {
let c15909_0;
let env15908 = {
$parent: env4357
};
const r13 = _slicedToArray(useState(() => {
let methodsV2 = AgeVerificationStore.methodsV2;
if (methodsV2 == null) {
methodsV2 = [];
}
return methodsV2;
}), 2);
const methods = r13[0];
env15908[0] = r13[1];
const r18 = _slicedToArray(useState(() => AgeVerificationStore.methodsV2 == null), 2);
const loading = r18[0];
env15908[1] = r18[1];
const r23 = _slicedToArray(useState(false), 2);
const error = r23[0];
env15908[2] = r23[1];
env15908[3] = useRef(true);
c15909_0 = void 0;
c15909_0 = async (c29841_0) => {
let c29841_3;
let c29841_4 = 0;
let c31438_0;
L18: {
L10: {
try {
c31438_0 = void 0;
if (!c29841_0 && AgeVerificationStore.methodsV2 != null) {
(0, env15908[0])(AgeVerificationStore.methodsV2);
(0, env15908[1])(false);
(0, env15908[2])(false);
break L10;
}
(0, env15908[1])(true);
(0, env15908[2])(false);
c29841_4 = 2;
c31438_0 = await fetchAgeVerificationMethodsV2();
Dispatcher.dispatch({
type: "AGE_VERIFICATION_METHODS_V2_LOAD_SUCCESS",
methods: c31438_0
});
if (env15908[3].current) {
(0, env15908[0])(c31438_0);
}
c29841_4 = 1;
c29841_4 = 0;
if (!env15908[3].current) {
break L18;
}
(0, env15908[1])(false);
break L18;
} catch ($e) {
const r27 = $e;
let r7 = r27;
c29841_3 = r27;
let r28 = c29841_4;
if (r28 !== 0) {
while (true) {
if (r28 === 1) {
try {
const r122 = c29841_3;
c29841_4 = 0;
if (env15908[3].current) {
(0, env15908[1])(false);
}
throw r122;
} catch (r120) {
r7 = r120;
c29841_3 = r120;
r28 = c29841_4;
if (r28 === 0) {
break;
}
}
} else {
try {
c29841_4 = 1;
if (env15908[3].current) {
(0, env15908[2])(true);
}
c29841_4 = 0;
if (!env15908[3].current) {
break L18;
}
(0, env15908[1])(false);
break L18;
} catch (r100) {
r7 = r100;
c29841_3 = r100;
r28 = c29841_4;
if (r28 === 0) {
break;
}
}
}
}
}
throw r7;
}
}
return void 0;
}
};
const callback = useCallback(function() {
return c15909_0.apply(this, arguments);
}, []);
env15908[4] = callback;
useEffect(() => {
env15908[3].current = true;
(0, env15908[4])(false);
return () => {
env15908[3].current = false;
};
}, [callback]);
return {
loading,
error,
methods,
refetch: useCallback(() => {
(0, env15908[4])(true);
}, [callback])
};
}