2026-09-28 16:18:32 +00:00
|
|
|
// Module ID: 17069
|
|
|
|
|
// Function ID: 17070
|
2026-09-18 19:45:33 +00:00
|
|
|
// Name: CaptchaUtils
|
2026-09-28 16:18:32 +00:00
|
|
|
// Dependencies: [19, 17, 2112, 1182, 1074, 21, 1241, 5179, 5184, 504, 1255, 1325, 17070, 5177, 5039, 17071, 1981, 2]
|
2026-09-26 17:57:22 +00:00
|
|
|
// Exports: InlineHcaptcha
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-09-28 16:18:32 +00:00
|
|
|
// Module 17069 (CaptchaUtils)
|
2026-10-01 14:13:23 +00:00
|
|
|
import Fragment from "Fragment" /* 21 */;
|
2026-09-26 17:57:22 +00:00
|
|
|
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1241 */;
|
|
|
|
|
import V8APIError from "V8APIError" /* 1325 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import ModalActionCreatorsDefault from "ModalActionCreators" /* 5039 */;
|
|
|
|
|
import SharedCaptchaUtils from "SharedCaptchaUtils" /* 5177 */;
|
|
|
|
|
import MonitoringAgentDefault from "MonitoringAgent" /* 5179 */;
|
|
|
|
|
import MetricEvents from "MetricEvents" /* 5184 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import _modDef17070 from "module_17070" /* 17070 */;
|
|
|
|
|
import react_mod from "react" /* 19 */;
|
|
|
|
|
import react_native from "react-native" /* 17 */;
|
2026-09-28 16:18:32 +00:00
|
|
|
import LocaleStore from "LocaleStore" /* 2112 */;
|
2026-09-26 17:57:22 +00:00
|
|
|
import ThemeStore from "ThemeStore" /* 1182 */;
|
2026-10-01 14:13:23 +00:00
|
|
|
import Constants from "Constants" /* 1074 */;
|
|
|
|
|
import size from "module_2" /* 2 */;
|
2026-09-18 19:45:33 +00:00
|
|
|
|
2026-10-01 14:13:23 +00:00
|
|
|
let NativeEventEmitter;
|
|
|
|
|
let NativeModules;
|
|
|
|
|
let c9;
|
|
|
|
|
let closure_4;
|
|
|
|
|
let metroImportAll;
|
|
|
|
|
let metroImportDefault;
|
|
|
|
|
let react = react_mod;
|
|
|
|
|
({ Keyboard: closure_4, NativeModules, NativeEventEmitter } = react_native);
|
|
|
|
|
({ CaptchaEvent: metroImportDefault, RECAPTCHA_SITE_KEY: metroImportAll, AnalyticEvents: c9 } = Constants);
|
|
|
|
|
const jsx = Fragment.jsx;
|
2026-09-18 19:45:33 +00:00
|
|
|
const CaptchaManager = NativeModules.CaptchaManager;
|
|
|
|
|
const nativeEventEmitter = new NativeEventEmitter(CaptchaManager);
|
2026-10-01 14:13:23 +00:00
|
|
|
let obj = {
|
2026-09-18 19:45:33 +00:00
|
|
|
showCaptcha() {
|
|
|
|
|
let RECAPTCHA = arg0;
|
|
|
|
|
if (arg0 === undefined) {
|
|
|
|
|
RECAPTCHA = V8APIError.CaptchaTypes.RECAPTCHA;
|
|
|
|
|
}
|
|
|
|
|
const self = this;
|
2026-10-01 14:13:23 +00:00
|
|
|
React3.dismiss();
|
|
|
|
|
const obj = AnalyticsUtilsDefault;
|
|
|
|
|
obj.track(constants.OPEN_MODAL, { type: "CAPTCHA" });
|
2026-09-18 19:45:33 +00:00
|
|
|
if (RECAPTCHA === V8APIError.CaptchaTypes.HCAPTCHA) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let showHcaptchaResult;
|
2026-09-18 19:45:33 +00:00
|
|
|
if (null != arg1) {
|
2026-10-01 14:13:23 +00:00
|
|
|
showHcaptchaResult = self.showHcaptcha(arg1, arg2);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
return showHcaptchaResult;
|
|
|
|
|
}
|
|
|
|
|
showHcaptchaResult = self.showRecaptcha();
|
|
|
|
|
},
|
|
|
|
|
closeCaptcha() {
|
|
|
|
|
CaptchaManager.closeCaptcha();
|
|
|
|
|
},
|
|
|
|
|
showHcaptcha(arg0, rqdata) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let paths;
|
|
|
|
|
let closure_0 = arg0;
|
|
|
|
|
const promise = new Promise((sitekey, arg1) => {
|
|
|
|
|
let closure_1;
|
|
|
|
|
let items;
|
2026-09-18 19:45:33 +00:00
|
|
|
rqdata = arg1;
|
2026-09-26 17:57:22 +00:00
|
|
|
let obj = sitekey(paths[10]);
|
2026-10-01 14:13:23 +00:00
|
|
|
const v4Result = obj.v4();
|
|
|
|
|
const captcha_flow_key = v4Result;
|
|
|
|
|
let HCAPTCHA = sitekey(paths[11]).CaptchaTypes.HCAPTCHA;
|
2026-09-26 17:57:22 +00:00
|
|
|
let obj2 = rqdata(paths[6]);
|
2026-09-18 19:45:33 +00:00
|
|
|
let obj3 = { captcha_event_name: "initial-load", captcha_service: HCAPTCHA, sitekey, captcha_flow_key: v4Result };
|
2026-10-01 14:13:23 +00:00
|
|
|
obj2.track(constants.CAPTCHA_EVENT, obj3);
|
|
|
|
|
const tmp3 = rqdata(paths[7]);
|
|
|
|
|
let obj4 = { name: sitekey(paths[8]).MetricEvents.CAPTCHA_EVENT, tags: items };
|
|
|
|
|
let increment = tmp3.increment;
|
|
|
|
|
items = ["event_name:" + "initial-load", "captcha_service:" + HCAPTCHA];
|
|
|
|
|
increment(obj4);
|
|
|
|
|
let obj5 = rqdata(paths[14]);
|
|
|
|
|
let obj6 = {
|
2026-09-18 19:45:33 +00:00
|
|
|
siteKey: sitekey,
|
|
|
|
|
onMessage(nativeEvent) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let items;
|
|
|
|
|
let items1;
|
2026-09-18 19:45:33 +00:00
|
|
|
let data1;
|
|
|
|
|
if (nativeEvent != null) {
|
|
|
|
|
data1 = nativeEvent.nativeEvent.data;
|
|
|
|
|
}
|
|
|
|
|
if (null != data1) {
|
|
|
|
|
const data = nativeEvent.nativeEvent.data;
|
|
|
|
|
if (data !== SharedCaptchaUtils.CaptchaError.CANCEL) {
|
2026-10-01 14:13:23 +00:00
|
|
|
if (data !== SharedCaptchaUtils.CaptchaError.ERROR) {
|
|
|
|
|
if (data !== SharedCaptchaUtils.CaptchaError.EXPIRED) {
|
|
|
|
|
const HCAPTCHA2 = tmp18(1325).CaptchaTypes.HCAPTCHA;
|
|
|
|
|
const obj2 = { captcha_event_name: "verify", captcha_service: HCAPTCHA2, sitekey, captcha_flow_key };
|
|
|
|
|
const obj6 = AnalyticsUtilsDefault;
|
|
|
|
|
obj6.track(constants.CAPTCHA_EVENT, obj2);
|
|
|
|
|
const obj3 = { name: MetricEvents.MetricEvents.CAPTCHA_EVENT, tags: items };
|
|
|
|
|
const increment2 = MonitoringAgentDefault.increment;
|
|
|
|
|
MonitoringAgentDefault;
|
2026-09-18 19:45:33 +00:00
|
|
|
const _HermesInternal3 = HermesInternal;
|
2026-10-01 14:13:23 +00:00
|
|
|
items = ["event_name:" + "verify", ];
|
2026-09-18 19:45:33 +00:00
|
|
|
const _HermesInternal4 = HermesInternal;
|
|
|
|
|
items[1] = "captcha_service:" + HCAPTCHA2;
|
2026-10-01 14:13:23 +00:00
|
|
|
increment2(obj3);
|
2026-09-18 19:45:33 +00:00
|
|
|
sitekey(data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const HCAPTCHA = tmp18(1325).CaptchaTypes.HCAPTCHA;
|
|
|
|
|
const obj5 = { captcha_event_name: data, captcha_service: HCAPTCHA, sitekey, captcha_flow_key };
|
|
|
|
|
const obj = AnalyticsUtilsDefault;
|
|
|
|
|
obj.track(constants.CAPTCHA_EVENT, obj5);
|
|
|
|
|
const obj7 = { name: MetricEvents.MetricEvents.CAPTCHA_EVENT, tags: items1 };
|
|
|
|
|
const increment = MonitoringAgentDefault.increment;
|
|
|
|
|
MonitoringAgentDefault;
|
2026-09-18 19:45:33 +00:00
|
|
|
const _HermesInternal = HermesInternal;
|
2026-10-01 14:13:23 +00:00
|
|
|
items1 = ["event_name:" + data, ];
|
2026-09-18 19:45:33 +00:00
|
|
|
const _HermesInternal2 = HermesInternal;
|
|
|
|
|
items1[1] = "captcha_service:" + HCAPTCHA;
|
2026-10-01 14:13:23 +00:00
|
|
|
increment(obj7);
|
|
|
|
|
const obj8 = { reason: data };
|
|
|
|
|
const obj4 = AnalyticsUtilsDefault;
|
|
|
|
|
obj4.track(constants.CAPTCHA_FAILED, obj8);
|
2026-09-18 19:45:33 +00:00
|
|
|
closure_1(data);
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const arr2 = ModalActionCreatorsDefault;
|
|
|
|
|
arr2.pop();
|
2026-09-18 19:45:33 +00:00
|
|
|
},
|
|
|
|
|
rqdata
|
2026-10-01 14:13:23 +00:00
|
|
|
};
|
|
|
|
|
obj5.pushLazy(sitekey(paths[16])(paths[15], paths.paths), obj6, "hcaptcha");
|
2026-09-18 19:45:33 +00:00
|
|
|
});
|
2026-10-01 14:13:23 +00:00
|
|
|
return promise;
|
2026-09-18 19:45:33 +00:00
|
|
|
},
|
|
|
|
|
showRecaptcha() {
|
2026-10-01 14:13:23 +00:00
|
|
|
let constants2;
|
|
|
|
|
let theme;
|
2026-09-18 19:45:33 +00:00
|
|
|
const self = this;
|
2026-10-01 14:13:23 +00:00
|
|
|
const promise = new Promise((arg0, arg1) => {
|
|
|
|
|
let items;
|
|
|
|
|
let closure_0 = arg0;
|
|
|
|
|
let closure_1 = arg1;
|
|
|
|
|
let obj = self(dependencyMap[10]);
|
|
|
|
|
const v4Result = obj.v4();
|
|
|
|
|
const captcha_flow_key = v4Result;
|
|
|
|
|
const HCAPTCHA = self(dependencyMap[11]).CaptchaTypes.HCAPTCHA;
|
|
|
|
|
let obj2 = AnalyticsUtilsDefault;
|
2026-09-18 19:45:33 +00:00
|
|
|
let obj3 = { captcha_event_name: "initial-load", captcha_service: HCAPTCHA, sitekey, captcha_flow_key: v4Result };
|
2026-10-01 14:13:23 +00:00
|
|
|
obj2.track(constants2.CAPTCHA_EVENT, obj3);
|
|
|
|
|
let tmp3 = MonitoringAgentDefault;
|
|
|
|
|
let obj4 = { name: self(dependencyMap[8]).MetricEvents.CAPTCHA_EVENT, tags: items };
|
|
|
|
|
let increment = tmp3.increment;
|
|
|
|
|
items = ["event_name:" + "initial-load", "captcha_service:" + HCAPTCHA];
|
|
|
|
|
increment(obj4);
|
2026-09-18 19:45:33 +00:00
|
|
|
CaptchaManager.showCaptcha(sitekey, theme.theme, "https://cdn.discordapp.com/recaptcha/ios.html");
|
|
|
|
|
nativeEventEmitter.addListener(constants.SOLVED, (arg0) => {
|
2026-10-01 14:13:23 +00:00
|
|
|
let items;
|
2026-09-18 19:45:33 +00:00
|
|
|
self.closeCaptcha();
|
|
|
|
|
const RECAPTCHA = V8APIError.CaptchaTypes.RECAPTCHA;
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = AnalyticsUtilsDefault;
|
|
|
|
|
const obj2 = { captcha_event_name: "verify", captcha_service: RECAPTCHA, sitekey: metroImportAll, captcha_flow_key };
|
|
|
|
|
obj.track(constants.CAPTCHA_EVENT, obj2);
|
|
|
|
|
const tmp3 = MonitoringAgentDefault;
|
|
|
|
|
const increment = tmp3.increment;
|
|
|
|
|
const obj3 = { name: MetricEvents.MetricEvents.CAPTCHA_EVENT, tags: items };
|
|
|
|
|
items = ["event_name:" + "verify", "captcha_service:" + RECAPTCHA];
|
|
|
|
|
increment(obj3);
|
2026-09-18 19:45:33 +00:00
|
|
|
closure_0(arg0);
|
|
|
|
|
});
|
|
|
|
|
nativeEventEmitter.addListener(constants.EXPIRED, () => {
|
2026-10-01 14:13:23 +00:00
|
|
|
let items;
|
2026-09-18 19:45:33 +00:00
|
|
|
self.closeCaptcha();
|
|
|
|
|
const EXPIRED = SharedCaptchaUtils.CaptchaError.EXPIRED;
|
|
|
|
|
const RECAPTCHA = V8APIError.CaptchaTypes.RECAPTCHA;
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = AnalyticsUtilsDefault;
|
|
|
|
|
const obj2 = { captcha_event_name: EXPIRED, captcha_service: RECAPTCHA, sitekey: metroImportAll, captcha_flow_key };
|
|
|
|
|
obj.track(constants.CAPTCHA_EVENT, obj2);
|
|
|
|
|
const tmp3 = MonitoringAgentDefault;
|
|
|
|
|
const increment = tmp3.increment;
|
|
|
|
|
const obj3 = { name: MetricEvents.MetricEvents.CAPTCHA_EVENT, tags: items };
|
|
|
|
|
items = ["event_name:" + EXPIRED, "captcha_service:" + RECAPTCHA];
|
|
|
|
|
increment(obj3);
|
|
|
|
|
const obj4 = AnalyticsUtilsDefault;
|
|
|
|
|
obj4.track(constants.CAPTCHA_FAILED, { reason: "expired" });
|
2026-09-18 19:45:33 +00:00
|
|
|
closure_1(SharedCaptchaUtils.CaptchaError.EXPIRED);
|
|
|
|
|
});
|
|
|
|
|
});
|
2026-10-01 14:13:23 +00:00
|
|
|
return promise;
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
};
|
2026-10-01 14:13:23 +00:00
|
|
|
const result = size.fileFinishedImporting("utils/native/CaptchaUtils.tsx");
|
|
|
|
|
|
|
|
|
|
export default obj;
|
2026-09-26 17:57:22 +00:00
|
|
|
export const InlineHcaptcha = function InlineHcaptcha(siteKey) {
|
2026-10-01 14:13:23 +00:00
|
|
|
let captcha_flow_key;
|
|
|
|
|
let locale;
|
2026-09-18 19:45:33 +00:00
|
|
|
siteKey = siteKey.siteKey;
|
|
|
|
|
({ onVerify: importDefault, onError: dependencyMap } = siteKey);
|
|
|
|
|
const merged = Object.assign(siteKey, Object.assign({ siteKey: 0, onVerify: 0, onError: 0 }));
|
|
|
|
|
let obj = siteKey(504);
|
2026-10-01 14:13:23 +00:00
|
|
|
let items = [LocaleStore];
|
|
|
|
|
const stateFromStores = obj.useStateFromStores(items, () => locale.locale);
|
|
|
|
|
let obj2 = siteKey(1255);
|
|
|
|
|
const v4Result = obj2.v4();
|
|
|
|
|
react = v4Result;
|
2026-09-18 19:45:33 +00:00
|
|
|
let items1 = [v4Result, siteKey];
|
2026-10-01 14:13:23 +00:00
|
|
|
const effect = react.useEffect(() => {
|
|
|
|
|
let items;
|
2026-09-18 19:45:33 +00:00
|
|
|
const HCAPTCHA = V8APIError.CaptchaTypes.HCAPTCHA;
|
2026-10-01 14:13:23 +00:00
|
|
|
const obj = AnalyticsUtilsDefault;
|
2026-09-18 19:45:33 +00:00
|
|
|
const obj2 = { captcha_event_name: "initial-load", captcha_service: HCAPTCHA, sitekey: siteKey, captcha_flow_key };
|
2026-10-01 14:13:23 +00:00
|
|
|
obj.track(constants.CAPTCHA_EVENT, obj2);
|
|
|
|
|
const tmp2 = MonitoringAgentDefault;
|
|
|
|
|
const increment = tmp2.increment;
|
|
|
|
|
const obj3 = { name: MetricEvents.MetricEvents.CAPTCHA_EVENT, tags: items };
|
|
|
|
|
items = ["event_name:" + "initial-load", "captcha_service:" + HCAPTCHA];
|
|
|
|
|
increment(obj3);
|
2026-09-18 19:45:33 +00:00
|
|
|
}, items1);
|
2026-10-01 14:13:23 +00:00
|
|
|
_modDef17070;
|
2026-09-18 19:45:33 +00:00
|
|
|
const merged1 = Object.assign(merged);
|
2026-10-01 14:13:23 +00:00
|
|
|
return <tmp5 siteKey={siteKey} onMessage={function onMessage(nativeEvent) {
|
|
|
|
|
let items;
|
|
|
|
|
let items1;
|
|
|
|
|
if (null != nativeEvent.nativeEvent.data) {
|
|
|
|
|
const data = nativeEvent.nativeEvent.data;
|
|
|
|
|
if (data !== SharedCaptchaUtils.CaptchaError.CANCEL) {
|
|
|
|
|
if (data !== SharedCaptchaUtils.CaptchaError.ERROR) {
|
|
|
|
|
if (data !== SharedCaptchaUtils.CaptchaError.EXPIRED) {
|
|
|
|
|
const HCAPTCHA2 = tmp11(1325).CaptchaTypes.HCAPTCHA;
|
|
|
|
|
const obj2 = { captcha_event_name: "verify", captcha_service: HCAPTCHA2, sitekey: siteKey, captcha_flow_key };
|
|
|
|
|
const obj6 = AnalyticsUtilsDefault;
|
|
|
|
|
obj6.track(constants.CAPTCHA_EVENT, obj2);
|
|
|
|
|
const obj3 = { name: MetricEvents.MetricEvents.CAPTCHA_EVENT, tags: items };
|
|
|
|
|
const increment2 = MonitoringAgentDefault.increment;
|
|
|
|
|
MonitoringAgentDefault;
|
|
|
|
|
const _HermesInternal3 = HermesInternal;
|
|
|
|
|
items = ["event_name:" + "verify", ];
|
|
|
|
|
const _HermesInternal4 = HermesInternal;
|
|
|
|
|
items[1] = "captcha_service:" + HCAPTCHA2;
|
|
|
|
|
increment2(obj3);
|
|
|
|
|
importDefault(data);
|
2026-09-18 19:45:33 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2026-10-01 14:13:23 +00:00
|
|
|
const HCAPTCHA = tmp11(1325).CaptchaTypes.HCAPTCHA;
|
|
|
|
|
const obj5 = { captcha_event_name: data, captcha_service: HCAPTCHA, sitekey: siteKey, captcha_flow_key };
|
|
|
|
|
const obj = AnalyticsUtilsDefault;
|
|
|
|
|
obj.track(constants.CAPTCHA_EVENT, obj5);
|
|
|
|
|
const obj7 = { name: MetricEvents.MetricEvents.CAPTCHA_EVENT, tags: items1 };
|
|
|
|
|
const increment = MonitoringAgentDefault.increment;
|
|
|
|
|
MonitoringAgentDefault;
|
|
|
|
|
const _HermesInternal = HermesInternal;
|
|
|
|
|
items1 = ["event_name:" + data, ];
|
|
|
|
|
const _HermesInternal2 = HermesInternal;
|
|
|
|
|
items1[1] = "captcha_service:" + HCAPTCHA;
|
|
|
|
|
increment(obj7);
|
|
|
|
|
const obj8 = { reason: data };
|
|
|
|
|
const obj4 = AnalyticsUtilsDefault;
|
|
|
|
|
obj4.track(constants.CAPTCHA_FAILED, obj8);
|
|
|
|
|
if (dependencyMap != null) {
|
|
|
|
|
dependencyMap(data);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}} languageCode={stateFromStores} />;
|
2026-09-26 17:57:22 +00:00
|
|
|
};
|