decord/source/modules/libdiscore/LibdiscoreExperimentManager.tsx

68 lines
2.5 KiB
TypeScript
Raw Normal View History

// Module ID: 17972
// Function ID: 17973
// Name: LibdiscoreExperimentManager
// Dependencies: [1236, 1351, 1983, 558, 1433, 7221, 2]
2026-07-20 16:05:17 +00:00
// Module 17972 (LibdiscoreExperimentManager)
import discord_common_shallowEqualDefault from "discord_common/shallowEqual" /* 558 */;
import js_shim_shim from "js_shim/shim" /* 1351 */;
import ApexExperiment from "ApexExperiment" /* 1433 */;
import libdiscoreExperiments from "libdiscoreExperiments" /* 1983 */;
import ApexExperimentStore from "ApexExperimentStore" /* 1236 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7221 */;
2026-07-23 10:11:24 +00:00
require = fn;
2026-07-20 16:05:17 +00:00
function experimentStoreUpdateHandler() {
if (obj.isLibdiscoreInitialized()) {
2026-07-29 08:29:29 +00:00
if (!tmpResult.isExperimentSyncDisabled()) {
obj2 = {};
const ALL_LIBDISCORE_EXPERIMENTS = tmp(1983).ALL_LIBDISCORE_EXPERIMENTS;
2026-07-29 08:29:29 +00:00
for (const item10018 of ALL_LIBDISCORE_EXPERIMENTS) {
obj2[item10018.id] = item10018.getCurrentConfig();
2026-07-29 08:29:29 +00:00
continue;
2026-07-20 16:05:17 +00:00
}
let tmp7 = null != obj2;
2026-07-29 08:29:29 +00:00
if (tmp7) {
tmp7 = discord_common_shallowEqualDefault(obj2, obj2);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (!tmp7) {
const experimentCacher = js_shim_shim.getExperimentCacher();
2026-07-20 16:05:17 +00:00
const _JSON = JSON;
experimentCacher.flushToCache(JSON.stringify(obj2));
2026-07-20 16:05:17 +00:00
}
}
tmpResult = tmp(1983);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
class LibdiscoreExperimentManager extends tmp2 {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
applyArgumentsResult.actions = {};
map = new Map();
2026-08-24 06:08:38 +00:00
applyArgumentsResult.stores = map.set(closure_3, experimentStoreUpdateHandler);
2026-07-29 08:29:29 +00:00
return applyArgumentsResult;
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const prototype = LibdiscoreExperimentManager.prototype;
prototype["_initialize"] = function _initialize() {
const prop = libdiscoreExperiments.ALL_LIBDISCORE_EXPERIMENTS;
2026-07-29 08:29:29 +00:00
const item = prop.forEach((id) => {
obj2 = { kind: "user", name: id.id, defaultConfig: { treatmentId: -1 }, variations: null };
2026-07-29 08:29:29 +00:00
const treatments = id.getTreatments();
obj2.variations = Object.fromEntries(treatments.map((treatmentId) => {
2026-07-29 08:29:29 +00:00
treatmentId = treatmentId.treatmentId;
const items = [treatmentId, { treatmentId }];
return items;
}));
id.setExperiment(ApexExperiment.createApexExperiment(obj2));
2026-07-29 08:29:29 +00:00
});
};
prototype["_terminate"] = function _terminate() {
};
const libdiscoreExperimentManager = new LibdiscoreExperimentManager();
const size = fn(2);
const result = size.fileFinishedImporting("modules/libdiscore/LibdiscoreExperimentManager.tsx");
2026-07-20 16:05:17 +00:00
2026-07-29 08:29:29 +00:00
export default libdiscoreExperimentManager;