decord/source/modules/captcha/native/CaptchaModal.tsx
github-actions 777dc50a28 chore: update source for alpha 346.3
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4790.js (118.4 MB)
2026-09-10 19:12:31 +00:00

140 lines
5.1 KiB
TypeScript

// Module ID: 17380
// Function ID: 17381
// Name: CaptchaModal
// Dependencies: [19, 17, 16028, 16029, 21, 4605, 6994, 1484, 17381, 7202, 5023, 5742, 4601, 1114, 5025, 11349, 17382, 16036, 2]
// Exports: default
// Module 17380 (CaptchaModal)
import util from "util" /* 1114 */;
import Link from "Link" /* 1484 */;
import Text_Text from "Text/Text" /* 4601 */;
import Stack_Stack from "Stack/Stack" /* 5023 */;
import components_Button_Button from "components/Button/Button" /* 5025 */;
import native from "native" /* 5742 */;
import Sheet_BottomSheet from "Sheet/BottomSheet" /* 7202 */;
import SharedCaptchaUtils from "SharedCaptchaUtils" /* 11349 */;
import RegistrationUtils from "RegistrationUtils" /* 16036 */;
import CaptchaUtilsDefault from "CaptchaUtils" /* 17382 */;
import noop from "module_19" /* 19 */;
require = fn;
get_ActivityIndicator = fn(17);
({ Keyboard: closure_4, View: hasOwnProperty } = get_ActivityIndicator);
let closure_6 = fn(16028).doesRegistrationHaveIdentityType;
const RegistrationConstants = fn(16029);
({ RegisterTransitionSteps: closure_7, RegistrationTransitionActionTypes: closure_8 } = RegistrationConstants);
const jsxProd = fn(21);
({ jsx: closure_9, jsxs: c10 } = jsxProd);
const createStyles = fn(4605);
let closure_11 = createStyles.createStyles((arg0) => {
let num = 8;
if (arg0) {
num = 32;
}
return { contentContainer: { alignItems: "center", paddingVertical: 8, paddingHorizontal: num }, description: { paddingBottom: 12, paddingTop: 4 } };
});
const size = fn(2);
let result = size.fileFinishedImporting("modules/captcha/native/CaptchaModal.tsx");
export default function CaptchaModal(arg0) {
({ onCaptchaVerify: require, onReject } = arg0);
({ close: dependencyMap, sitekey: noop, captchaService: closure_4, headerText, bodyText, rqdata: closure_5, rqtoken: closure_6, userflow: closure_7 } = arg0);
const tmp2 = closure_11(onReject(6994)());
const navigation = Link.useNavigation();
const items = [navigation];
const memo = noop.useMemo(() => {
const state = navigation.getState();
let name;
if (state != null) {
const first = state.routes[0];
if (first != null) {
name = first.name;
}
}
let str = "Guild Join Captcha";
if ("auth" === name) {
str = "Guild Join Captcha";
if (closure_6()) {
str = "User Registration Captcha";
}
}
return str;
}, items);
closure_9 = onReject(17381)({ onReject, analyticsType: memo });
const effect = noop.useEffect(() => {
closure_1_4.dismiss();
}, []);
let obj2 = { style: tmp2.contentContainer, spacing: 12, children: null };
const items1 = [closure_9(native.DisguiseSpotIllustration, { scale: 0.5 }), , ];
if (headerText == null) {
const intl = tmp3(1114).intl;
headerText = intl.string(tmp3(1114).t.FpoiHe);
}
const items2 = [closure_9(Text_Text.Text, { variant: "heading-xl/bold", accessibilityRole: "header", children: headerText }), ];
let obj3 = { variant: "text-md/medium", color: "text-subtle", style: tmp2.description, children: null };
if (bodyText == null) {
const intl2 = tmp3(1114).intl;
bodyText = intl2.string(tmp3(1114).t["/CidxO"]);
}
let obj4 = { startHeight: 900, startExpanded: true, children: null };
let obj5 = { children: null };
obj3.children = bodyText;
items2[1] = closure_9(Text_Text.Text, obj3);
obj5.children = items2;
items1[1] = closure_10(closure_5, obj5);
const obj6 = {
grow: true,
onPress() {
closure_9();
dependencyMap();
const result = SharedCaptchaUtils.emitCaptchaDistributionMetric(constants);
const showCaptchaResult = CaptchaUtilsDefault.showCaptcha(closure_1_4, noop, closure_1_5);
CaptchaUtilsDefault.showCaptcha(closure_1_4, noop, closure_1_5).then((result) => {
state = state.getState();
let name;
if (state != null) {
const first = state.routes[0];
if (first != null) {
name = first.name;
}
}
let tmp4 = "auth" === name;
if (tmp4) {
tmp4 = closure_2_6();
}
if (tmp4) {
const obj3 = { step: constants.CAPTCHA, actionType: navigation.SUBMITTED };
RegistrationUtils.trackRegTransition(obj3);
}
closure_1_0(result, closure_1_6);
const state1 = state.getState();
let name1;
if (state1 != null) {
const first1 = state1.routes[0];
if (first1 != null) {
name1 = first1.name;
}
}
let tmp15 = "auth" === name1;
if (tmp15) {
tmp15 = closure_2_6();
}
if (tmp15) {
const obj5 = { step: constants.CAPTCHA, actionType: navigation.SUCCESS };
RegistrationUtils.trackRegTransition(obj5);
}
}).catch((error) => {
if (onReject != null) {
tmp(error);
}
});
},
text: null
};
const intl3 = tmp3(1114).intl;
obj6.text = intl3.string(util.t["cY+Oob"]);
items1[2] = closure_9(components_Button_Button.Button, obj6);
obj2.children = items1;
obj4.children = closure_10(Stack_Stack.Stack, obj2);
return closure_9(Sheet_BottomSheet.BottomSheet, obj4);
};