decord/source/modules/experiments/ExperimentManager.tsx

83 lines
3 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 4300
// Function ID: 4301
2026-07-20 16:05:17 +00:00
// Name: trackExposureToExperiment
2026-08-24 06:08:38 +00:00
// Dependencies: [4292, 4293, 709, 2]
2026-07-20 16:05:17 +00:00
// Exports: overrideBucket, registerGuildExperiment, registerUserExperiment, trackExposureToExperiment
2026-08-24 06:08:38 +00:00
// Module 4300 (trackExposureToExperiment)
import dispatcherDefault from "dispatcher" /* 709 */;
import closure_2 from "getHash" /* 4292 */;
import { registerExperiment } from "getHash" /* 4292 */;
import ExperimentBuckets from "ExperimentBuckets" /* 4293 */;
2026-07-23 10:11:24 +00:00
2026-07-29 08:29:29 +00:00
({ ExperimentTypes: c4, ExposureTypes } = ExperimentBuckets);
2026-07-23 10:11:24 +00:00
let obj = { LEGACY: "legacy", APEX: "apex" };
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/experiments/ExperimentManager.tsx");
2026-07-20 16:05:17 +00:00
export const trackExposureToExperiment = function trackExposureToExperiment(id, descriptor, location) {
2026-08-24 06:08:38 +00:00
obj = { experimentId: id, descriptor, location: null, location_stack: null, fingerprint: null, excluded: null, exposureType: null };
2026-07-20 16:05:17 +00:00
let _location;
2026-07-29 08:29:29 +00:00
if (location != null) {
2026-07-20 16:05:17 +00:00
_location = location.location;
}
2026-07-29 08:29:29 +00:00
obj[2] = _location;
2026-07-20 16:05:17 +00:00
let analyticsLocations;
2026-07-29 08:29:29 +00:00
if (location != null) {
2026-07-20 16:05:17 +00:00
analyticsLocations = location.analyticsLocations;
}
2026-07-29 08:29:29 +00:00
obj[3] = analyticsLocations;
2026-07-20 16:05:17 +00:00
let fingerprint;
2026-07-29 08:29:29 +00:00
if (location != null) {
2026-07-20 16:05:17 +00:00
fingerprint = location.fingerprint;
}
2026-07-29 08:29:29 +00:00
obj[4] = fingerprint;
2026-07-20 16:05:17 +00:00
let excluded;
2026-07-29 08:29:29 +00:00
if (location != null) {
2026-07-20 16:05:17 +00:00
excluded = location.excluded;
}
2026-07-29 08:29:29 +00:00
obj[5] = excluded;
2026-07-20 16:05:17 +00:00
let exposureType;
2026-07-29 08:29:29 +00:00
if (location != null) {
2026-07-20 16:05:17 +00:00
exposureType = location.exposureType;
}
2026-07-29 08:29:29 +00:00
obj[6] = exposureType;
2026-08-24 06:08:38 +00:00
closure_2.trackExposure(obj);
2026-07-20 16:05:17 +00:00
};
export const registerUserExperiment = function registerUserExperiment(id) {
id = id.id;
registerExperiment({ experimentId: id, experimentType: constants.USER, title: id.title, description: id.description, buckets: id.buckets, commonTriggerPoint: id.commonTriggerPoint });
return { id };
};
export const registerGuildExperiment = function registerGuildExperiment(id) {
id = id.id;
registerExperiment({ experimentId: id, experimentType: constants.GUILD, title: id.title, description: id.description, buckets: id.buckets, commonTriggerPoint: id.commonTriggerPoint });
return { id };
};
export const ExperimentSystem = obj;
2026-07-29 08:29:29 +00:00
export const overrideBucket = function overrideBucket(system, closure_0, id) {
2026-07-20 16:05:17 +00:00
if (obj.LEGACY === system) {
2026-07-29 08:29:29 +00:00
obj = { type: "EXPERIMENT_OVERRIDE_BUCKET", experimentId: null, experimentBucket: null };
obj[1] = closure_0;
let tmp10 = null;
2026-07-20 16:05:17 +00:00
if (null != id) {
2026-07-29 08:29:29 +00:00
tmp10 = id;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = tmp10;
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch(obj);
const obj5 = dispatcherDefault;
2026-07-29 08:29:29 +00:00
} else if (tmp.APEX === system) {
2026-07-20 16:05:17 +00:00
if (null == id) {
2026-07-29 08:29:29 +00:00
obj = { type: "APEX_EXPERIMENT_OVERRIDE_DELETE", experimentName: null };
obj[1] = closure_0;
2026-08-24 06:08:38 +00:00
dispatcherDefault.dispatch(obj);
const obj3 = dispatcherDefault;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
obj = dispatcherDefault;
obj1 = { type: "APEX_EXPERIMENT_OVERRIDE_CREATE", experimentName: null, variantId: null };
2026-07-29 08:29:29 +00:00
obj1[1] = closure_0;
obj1[2] = id;
2026-07-20 16:05:17 +00:00
obj.dispatch(obj1);
}
}
};