Files
discord-decomp/sources/modules/captcha/SharedCaptchaUtils.tsx
T
2026-07-27 16:20:00 +03:00

91 lines
4.5 KiB
TypeScript

/* Metro module 9486; source: modules/captcha/SharedCaptchaUtils.tsx; dependencies: [7, 6, 15, 17, 18, 162, 9487, 9488, 2] */
function _fun74059(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9672:6, offset: 0x01d7f684, size: 339 bytes, params: 8, frame: 20
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(7) /* metro dependency 7 */;
const env0_1 = importDefault(6) /* metro dependency 6 */;
const env0_2 = importDefault(15) /* metro dependency 15 */;
const env0_3 = importDefault(17) /* metro dependency 17 */;
const env0_4 = importDefault(18) /* metro dependency 18 */;
let value = importDefault(162) /* metro dependency 162 */;
const captchaStoreModule = require(9487) /* metro dependency 9487: CaptchaStore */;
const env0_5 = captchaStoreModule.incrementCaptchaServeVolume;
const env0_6 = captchaStoreModule.flushCaptchaServeVolume;
const env0_7 = captchaStoreModule.isCaptchaStoreVolumeEmpty;
const env0_8 = (require(9488) /* metro dependency 9488: CaptchaConstants */).CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS;
const Error = global.Error;
value = value(Error);
value = _fun74063(value);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/captcha/SharedCaptchaUtils.tsx');
exports.CaptchaError = {CANCEL: 'cancel', ERROR: 'error', EXPIRED: 'expired'};
exports.extractCaptchaPropsFromResponse = function(a0) {
var should_serve_invisible = a0.should_serve_invisible;
return {captchaService: a0.captcha_service, sitekey: a0.captcha_sitekey,
captchaSessionId: a0.captcha_session_id,
options: {rqdata: a0.captcha_rqdata, rqtoken: a0.captcha_rqtoken,
serveInvisible: should_serve_invisible != null && should_serve_invisible, userflow: a0.user_flow}};
};
exports.emitCaptchaDistributionMetric = function(a0) {
if (isCaptchaStoreVolumeEmpty()) {
global.setTimeout(_fun74067, CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS);
}
incrementCaptchaServeVolume(a0);
};
exports.CaptchaCancelError = value;
}
function _isNativeReflectConstruct_74060() { // fn#74060, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9672:324, offset: 0x01d7f7d7, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_74060_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun74063(a0) { // fn#74063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9672:609, offset: 0x01d7f839, size: 42 bytes, params: 2, frame: 14
const closure = CaptchaCancelError;
env0_4(closure, a0);
return env0_0(closure);
}
function emitCaptchaDistributionMetric(a0) { // fn#74066, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9672:1376, offset: 0x01d7f945, size: 57 bytes, params: 2, frame: 14
if (isCaptchaStoreVolumeEmpty()) {
global.setTimeout(function() {
return flushCaptchaServeVolume();
}, CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS);
}
incrementCaptchaServeVolume(a0);
}
function CaptchaCancelError() { // fn#74064, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9672:621, offset: 0x01d7f863, size: 114 bytes, params: 1, frame: 19
const value = environment.__proto__;
env1_1(this, CaptchaCancelError);
const items2 = ['Captcha cancelled'];
const value3 = env1_3(CaptchaCancelError);
return env1_2(this, _isNativeReflectConstruct_74060() ? global.Reflect.construct(value3, items2,
env1_3(this).constructor) : value3.apply(this, items2));
}