decord/source/modules/age_assurance/ExpressiveModalV2Experiment.tsx

41 lines
1.7 KiB
TypeScript
Raw Normal View History

// Module ID: 8457
// Function ID: 8458
// Name: ExpressiveModalV2Experiment
// Dependencies: [8458, 1433, 8446, 504, 2]
2026-07-24 07:16:23 +00:00
// Exports: isExpressiveModalV2Enabled, useIsExpressiveModalV2Enabled
// Module 8457 (ExpressiveModalV2Experiment)
import initialize from "initialize" /* 504 */;
import SafetyHubUtils from "SafetyHubUtils" /* 8446 */;
import SafetyHubStore from "SafetyHubStore" /* 8458 */;
2026-07-24 07:16:23 +00:00
require = fn;
const ApexExperiment = fn(1433);
let obj2 = { kind: "user", name: "2026-07-expressive-modal-v2", defaultConfig: { enabled: false }, variations: null };
const obj3 = { 1: null, 2: { enabled: true } };
obj3[2] = { enabled: true };
obj2.variations = obj3;
let closure_3 = ApexExperiment.createApexExperiment(obj2);
const size = fn(2);
const result = size.fileFinishedImporting("modules/age_assurance/ExpressiveModalV2Experiment.tsx");
2026-07-24 07:16:23 +00:00
2026-09-03 10:05:34 +00:00
export const useIsExpressiveModalV2Enabled = function useIsExpressiveModalV2Enabled(AUTOMATED_UNDERAGE_APPEALS) {
const isSuspendedUser = SafetyHubUtils.useIsSuspendedUser();
const items = [SafetyHubStore];
2026-09-01 10:26:29 +00:00
const stateFromStores = initialize.useStateFromStores(items, () => isExpressiveModalV2Enabled.getIsExpressiveModalV2Enabled());
let enabled = closure_3.useConfig({ location: AUTOMATED_UNDERAGE_APPEALS }).enabled;
2026-09-01 10:26:29 +00:00
if (isSuspendedUser) {
enabled = stateFromStores;
}
return enabled;
2026-07-24 07:16:23 +00:00
};
2026-09-03 10:05:34 +00:00
export const isExpressiveModalV2Enabled = function isExpressiveModalV2Enabled(AUTOMATED_UNDERAGE_APPEALS) {
2026-09-01 10:26:29 +00:00
if (obj.isCurrentUserSuspended()) {
let enabled = SafetyHubStore.getIsExpressiveModalV2Enabled();
2026-09-01 10:26:29 +00:00
} else {
const obj2 = { location: AUTOMATED_UNDERAGE_APPEALS };
enabled = closure_3.getConfig(obj2).enabled;
2026-09-01 10:26:29 +00:00
}
return enabled;
2026-07-24 07:16:23 +00:00
};