decord/source/modules/age_gate/AgeGateActionCreators.tsx
github-actions a36fe4ec9c chore: update source for alpha 347.0
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-14 20:04:03 +00:00

42 lines
2.3 KiB
TypeScript

// Module ID: 16057
// Function ID: 16058
// Name: AgeGateActionCreators
// Dependencies: [1098, 1074, 16056, 1240, 1270, 573, 2]
// Exports: logoutUnderageNewUser, preventUnderageRegistration, submitDateOfBirth
// Module 16057 (AgeGateActionCreators)
import DispatcherDefault from "Dispatcher" /* 573 */;
import AgeGateConstants from "AgeGateConstants" /* 1098 */;
import AnalyticsUtilsDefault from "AnalyticsUtils" /* 1240 */;
import trackAgeGateSubmittedDefault from "trackAgeGateSubmitted" /* 16056 */;
import Constants from "Constants" /* 1074 */;
import size from "module_2" /* 2 */;
const require = globalThis.__r;
const AgeGateAnalyticAction = AgeGateConstants.AgeGateAnalyticAction;
({ AnalyticEvents: closure_4, Endpoints: hasOwnProperty } = Constants);
const result = size.fileFinishedImporting("modules/age_gate/AgeGateActionCreators.tsx");
export const submitDateOfBirth = function submitDateOfBirth(format, source) {
_require = source;
trackAgeGateSubmittedDefault(format, source);
AnalyticsUtilsDefault.track(constants.AGE_GATE_ACTION, { source, action: AgeGateAnalyticAction.AGE_GATE_SUBMITTED });
const HTTP = require("HTTPUtils").HTTP;
const request = { url: constants2.ME, oldFormErrors: true, body: null, rejectWithError: false };
const obj2 = { source, action: AgeGateAnalyticAction.AGE_GATE_SUBMITTED };
request.body = { date_of_birth: format.format("YYYY-MM-DD") };
const obj3 = { date_of_birth: format.format("YYYY-MM-DD") };
return HTTP.patch(request).then((user) => {
DispatcherDefault.dispatch({ type: "CURRENT_USER_UPDATE", user: user.body });
AnalyticsUtilsDefault.track(constants.AGE_GATE_ACTION, { source, action: AgeGateAnalyticAction.AGE_GATE_SUCCESS });
});
};
export const preventUnderageRegistration = function preventUnderageRegistration(REGISTER) {
DispatcherDefault.dispatch({ type: "AGE_GATE_PREVENT_UNDERAGE_REGISTRATION" });
AnalyticsUtilsDefault.track(constants.AGE_GATE_ACTION, { source: REGISTER, action: AgeGateAnalyticAction.AGE_GATE_PREVENT_UNDERAGE_REGISTRATION });
};
export const logoutUnderageNewUser = function logoutUnderageNewUser(source) {
DispatcherDefault.dispatch({ type: "AGE_GATE_LOGOUT_UNDERAGE_NEW_USER" });
AnalyticsUtilsDefault.track(constants.AGE_GATE_ACTION, { source, action: AgeGateAnalyticAction.AGE_GATE_LOGOUT_UNDERAGE_NEW_USER });
};