decord/beta/source/modules/captcha/CaptchaStore.tsx
github-actions e7a050048e chore: update source for beta 347.7
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-21 19:31:18 +00:00

65 lines
2.3 KiB
TypeScript

// Module ID: 5085
// Function ID: 5086
// Name: CaptchaStore
// Dependencies: [32, 562, 1252, 5086, 5091, 2]
// Exports: flushCaptchaServeVolume, incrementCaptchaServeVolume, isCaptchaStoreVolumeEmpty
// Module 5085 (CaptchaStore)
import ReactBatchUpdates from "ReactBatchUpdates" /* 1252 */;
import MonitoringAgentDefault from "MonitoringAgent" /* 5086 */;
import MetricEvents from "MetricEvents" /* 5091 */;
import _slicedToArray from "module_32" /* 32 */;
const require = globalThis.__r;
require = fn;
const module_562 = fn(562);
let obj3 = module_562.create(() => ({ captchaServeVolume: {} }));
const size = fn(2);
const result = size.fileFinishedImporting("modules/captcha/CaptchaStore.tsx");
export const useCaptchaStore = obj3;
export const isCaptchaStoreVolumeEmpty = function isCaptchaStoreVolumeEmpty() {
return 0 === Object.keys(obj3.getState().captchaServeVolume).length;
};
export const incrementCaptchaServeVolume = function incrementCaptchaServeVolume(arg0) {
_require = arg0;
require("ReactBatchUpdates").batchUpdates(() => {
obj3.setState((arg0) => {
let sum = arg0;
if (null == closure_1_0) {
return sum;
} else {
const obj = { captchaServeVolume: null };
const obj2 = {};
const merged = Object.assign(sum.captchaServeVolume);
if (tmp3) {
sum = sum.captchaServeVolume[tmp2] + 1;
obj2[tmp2] = sum;
obj.captchaServeVolume = obj2;
} else {
obj2[tmp2] = 1;
obj.captchaServeVolume = obj2;
}
tmp3 = tmp2 in sum.captchaServeVolume;
}
});
});
};
export const flushCaptchaServeVolume = function flushCaptchaServeVolume() {
const entries = Object.entries(obj3.getState().captchaServeVolume);
while (tmp2 !== undefined) {
let tmp5 = _slicedToArray(tmp3, 2);
[tmp6, tmp7] = tmp5;
let obj = MonitoringAgentDefault;
let obj2 = { name: null, tags: null };
obj2.name = MetricEvents.MetricEvents.CAPTCHA_SERVE_VOLUME_DISTRIBUTION;
let _HermesInternal = HermesInternal;
let items = ["user_flow:" + tmp6];
obj2.tags = items;
let distributionResult = obj.distribution(obj2, tmp7, true);
continue;
}
obj3 = ReactBatchUpdates;
obj3.batchUpdates(() => state.setState({ captchaServeVolume: {} }));
};