decord/source/modules/experiments/apex/ApexActionCreators.tsx

342 lines
11 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 10722
// Function ID: 10723
2026-07-20 16:05:17 +00:00
// Name: _fetchApexExperimentsMetadata
2026-08-24 06:08:38 +00:00
// Dependencies: [109, 5, 1212, 676, 530, 709, 4371, 1473, 589, 2]
2026-07-20 16:05:17 +00:00
// Exports: fetchApexExperimentsMetadata, fetchInstallationExperiments, fetchUserExperimentAssignments
2026-08-24 06:08:38 +00:00
// Module 10722 (_fetchApexExperimentsMetadata)
import closure_4 from "_objectWithoutProperties" /* 109 */;
import closure_5 from "asyncGeneratorStep" /* 5 */;
import closure_6 from "initialize" /* 1212 */;
import { Endpoints } from "ME" /* 676 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-07-20 16:05:17 +00:00
function _fetchApexExperimentsMetadata() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c5 = 0;
c6 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0, body) {
2026-08-24 06:08:38 +00:00
dependencyMap = tmp3;
c4 = 1;
const HTTP = callback(closure_1_2[4]).HTTP;
obj1 = { url: null, query: null, rejectWithError: true };
obj1[0] = closure_1_7.APEX_EXPERIMENTS_METADATA;
2026-08-04 21:03:28 +00:00
const obj2 = { surface: null };
obj2[0] = callback;
obj1[1] = obj2;
yield HTTP.get(obj1);
if (1 === tmp7) {
c4 = 0;
const obj3 = callback2(709);
obj3.dispatch({ type: "APEX_EXPERIMENTS_METADATA_FETCH_FAILURE" });
2026-08-24 06:08:38 +00:00
c6 = 3;
2026-08-04 21:03:28 +00:00
} else if (arg0 === 1) {
2026-07-29 08:29:29 +00:00
c6 = 3;
2026-08-04 21:03:28 +00:00
throw body;
} else if (arg0 !== 2) {
const experiments = body.body.experiments;
callback = experiments.map((id) => {
const variants = id.variants;
return { id: id.id, name: id.name, title: id.title, revision: id.revision, unitType: id.unit_type, variants: variants.map((id) => ({ id: id.id, label: id.label, type: id.type })) };
});
const obj = callback2(709);
const obj4 = { type: "APEX_EXPERIMENTS_METADATA_FETCH_SUCCESS", experiments: null };
obj4[1] = callback;
obj.dispatch(obj4);
c4 = 0;
2026-07-29 08:29:29 +00:00
}
2026-08-04 21:03:28 +00:00
c4 = 0;
return body;
2026-07-29 08:29:29 +00:00
})();
});
2026-08-24 06:08:38 +00:00
closure_8 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _fetchUserExperimentAssignments() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c5 = 0;
c6 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (fetching === 2) {
fetching = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
fetching = 2;
if (0 === c5) {
if (arg0 === 1) {
fetching = 3;
throw arg1;
} else if (arg0 === 2) {
fetching = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
dependencyMap = tmp3;
2026-07-29 08:29:29 +00:00
let lib = tmp7;
lib = undefined;
if (!fetching.isFetching(callback)) {
if (!obj15.hasLoaded(tmp48)) {
2026-08-24 06:08:38 +00:00
let obj7 = closure_1_1(closure_1_2[5]);
obj1 = { type: "APEX_EXPERIMENTS_FETCH_START", unitId: null };
2026-07-29 08:29:29 +00:00
obj1[1] = tmp48;
obj7.dispatch(obj1);
2026-08-24 06:08:38 +00:00
c4 = 1;
const HTTP = callback(closure_1_2[4]).HTTP;
2026-07-29 08:29:29 +00:00
let obj2 = { url: null, query: null, rejectWithError: false };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_7.APEX_EXPERIMENTS;
2026-07-29 08:29:29 +00:00
const obj3 = { surface: null };
2026-08-24 06:08:38 +00:00
obj3[0] = callback(closure_1_2[6]).Experiment_Surface.APP;
2026-07-29 08:29:29 +00:00
obj2[1] = obj3;
c5 = 2;
fetching = 1;
const obj4 = { value: null, done: false };
obj4[0] = HTTP.get(obj2);
return obj4;
}
}
obj15 = fetching;
}
} else {
if (1 === tmp7) {
c4 = 0;
let obj5 = lib(709);
obj5 = { type: "APEX_EXPERIMENTS_FETCH_FAILURE", unitId: null };
obj5[1] = callback;
obj5.dispatch(obj5);
} else if (arg0 === 1) {
fetching = 3;
throw arg1;
} else if (arg0 !== 2) {
lib = arg1;
if (null != lib) {
if (null != lib.body) {
obj = lib(709);
const obj6 = { type: "APEX_EXPERIMENTS_FETCH_SUCCESS", unitId: null, experiments: null };
obj6[1] = callback;
obj6[2] = lib.body;
obj.dispatch(obj6);
}
c4 = 0;
}
obj2 = lib(709);
obj7 = { type: "APEX_EXPERIMENTS_FETCH_FAILURE", unitId: null };
obj7[1] = callback;
obj2.dispatch(obj7);
}
c4 = 0;
fetching = 3;
const obj8 = { value: null, done: true };
obj8[0] = arg1;
return obj8;
}
fetching = 3;
} catch (tmp37) {
2026-08-24 06:08:38 +00:00
closure_3 = tmp37;
2026-07-29 08:29:29 +00:00
if (tmp4 === c4) {
fetching = tmp2;
throw tmp37;
} else {
c5 = tmp;
}
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_9 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
function _fetchInstallationExperiments() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = callback((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
c5 = 0;
c6 = 0;
c4 = 0;
2026-07-29 08:29:29 +00:00
return (function*(arg0) {
if (c6 === 2) {
c6 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c6 = 2;
if (0 === c5) {
if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 === 2) {
c6 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
let installation = tmp3;
let body = tmp7;
let lib;
body = undefined;
installation = undefined;
2026-08-24 06:08:38 +00:00
closure_3 = undefined;
2026-07-29 08:29:29 +00:00
if (null == lib) {
let obj5 = c6;
2026-08-24 06:08:38 +00:00
if (!c6.isFetching(lib(closure_1_2[7]).INSTALLATION_UNIT_ID)) {
if (!obj5.hasLoaded(lib(closure_1_2[7]).INSTALLATION_UNIT_ID)) {
let obj6 = closure_1_1(closure_1_2[5]);
obj1 = { type: "APEX_EXPERIMENTS_FETCH_START", unitId: null };
obj1[1] = lib(closure_1_2[7]).INSTALLATION_UNIT_ID;
2026-07-29 08:29:29 +00:00
obj6.dispatch(obj1);
let v0 = 1;
2026-08-24 06:08:38 +00:00
const HTTP = lib(closure_1_2[4]).HTTP;
2026-07-29 08:29:29 +00:00
const obj2 = { url: null, query: null, rejectWithError: false };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_7.APEX_EXPERIMENTS;
2026-07-29 08:29:29 +00:00
let obj3 = { surface: null };
2026-08-24 06:08:38 +00:00
obj3[0] = lib(closure_1_2[6]).Experiment_Surface.APP;
2026-07-29 08:29:29 +00:00
obj2[1] = obj3;
c5 = 2;
c6 = 1;
const obj4 = { value: null, done: false };
obj4[0] = HTTP.get(obj2);
return obj4;
}
}
}
}
} else {
if (1 === tmp7) {
v0 = 0;
obj3 = body(installation[5]);
obj5 = { type: "APEX_EXPERIMENTS_FETCH_FAILURE", unitId: null };
obj5[1] = lib(installation[7]).INSTALLATION_UNIT_ID;
obj3.dispatch(obj5);
} else if (arg0 === 1) {
c6 = 3;
throw arg1;
} else if (arg0 !== 2) {
lib = arg1;
body = undefined;
if (lib != null) {
body = lib.body;
}
if (null != body) {
body = lib.body;
installation = body.installation;
closure_3 = v0(body, closure_3);
const Emitter = body(installation[8]).Emitter;
Emitter.batched(() => {
if (installation) {
let obj = body(installation[5]);
obj = { type: "INSTALLATION_ID", installation: null };
obj[1] = installation;
obj.dispatch(obj);
}
obj = { type: "APEX_EXPERIMENTS_FETCH_SUCCESS", unitId: callback(installation[7]).INSTALLATION_UNIT_ID, experiments: closure_3 };
body(installation[5]).dispatch(obj);
});
} else {
obj = body(installation[5]);
obj6 = { type: "APEX_EXPERIMENTS_FETCH_FAILURE", unitId: null };
obj6[1] = lib(installation[7]).INSTALLATION_UNIT_ID;
obj.dispatch(obj6);
}
v0 = 0;
}
v0 = 0;
c6 = 3;
const obj7 = { value: null, done: true };
obj7[0] = arg1;
return obj7;
}
c6 = 3;
} catch (tmp47) {
closure_3 = tmp47;
if (tmp4 === v0) {
c6 = tmp2;
throw tmp47;
} else {
c5 = tmp;
}
}
}
})();
});
2026-08-24 06:08:38 +00:00
closure_10 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let closure_3 = ["installation"];
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/experiments/apex/ApexActionCreators.tsx");
2026-07-20 16:05:17 +00:00
export const fetchApexExperimentsMetadata = function fetchApexExperimentsMetadata(APP) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fetchApexExperimentsMetadata.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
export const fetchUserExperimentAssignments = function fetchUserExperimentAssignments() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fetchUserExperimentAssignments.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};
export const fetchInstallationExperiments = function fetchInstallationExperiments(arg0) {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fetchInstallationExperiments.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
};