decord/source/modules/captcha/SharedCaptchaUtils.tsx

45 lines
1.7 KiB
TypeScript
Raw Normal View History

2026-08-15 05:55:55 +00:00
// Module ID: 10478
// Function ID: 10479
2026-07-29 08:29:29 +00:00
// Name: prototype
2026-08-15 05:55:55 +00:00
// Dependencies: [10479, 10480, 2]
2026-07-20 16:05:17 +00:00
// Exports: emitCaptchaDistributionMetric, extractCaptchaPropsFromResponse
2026-08-15 05:55:55 +00:00
// Module 10478 (prototype)
2026-07-23 10:11:24 +00:00
import useCaptchaStore from "useCaptchaStore";
2026-07-29 08:29:29 +00:00
import { CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS as closure_3 } from "CAPTCHA_SERVE_VOLUME_DISTRIBUTION_AGGREGATION_WINDOW_MS";
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
let c0;
let closure_1;
let obj1;
({ incrementCaptchaServeVolume: c0, flushCaptchaServeVolume: closure_1, isCaptchaStoreVolumeEmpty: obj1 } = useCaptchaStore);
const prototype = function CaptchaCancelError() {
tmp = new tmp("Captcha cancelled", new.target);
// ThrowIfThisInitialized (0x7c)
return tmp;
}.prototype;
class prototype extends Error {
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const result = require("set").fileFinishedImporting("modules/captcha/SharedCaptchaUtils.tsx");
2026-07-20 16:05:17 +00:00
export const CaptchaError = { CANCEL: "cancel", ERROR: "error", EXPIRED: "expired" };
export const extractCaptchaPropsFromResponse = function extractCaptchaPropsFromResponse(body) {
2026-07-29 08:29:29 +00:00
let obj = { captchaService: body.captcha_service, sitekey: body.captcha_sitekey, captchaSessionId: body.captcha_session_id, options: null };
obj = { rqdata: body.captcha_rqdata, rqtoken: body.captcha_rqtoken, serveInvisible: null, userflow: null };
let flag = body.should_serve_invisible;
if (flag == null) {
flag = false;
}
obj[2] = flag;
obj[3] = body.user_flow;
obj[3] = obj;
2026-07-20 16:05:17 +00:00
return obj;
};
export const emitCaptchaDistributionMetric = function emitCaptchaDistributionMetric(closure_7) {
2026-07-29 08:29:29 +00:00
if (callback2()) {
2026-07-20 16:05:17 +00:00
const _setTimeout = setTimeout;
2026-07-29 08:29:29 +00:00
const timerId = setTimeout(() => callback(), closure_3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
callback(closure_7);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
export const CaptchaCancelError = prototype;