decord/source/modules/design/PlaygroundAccessExperiment.tsx
github-actions da5b5e5efe chore: update source for alpha 346.6
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4821.js (118.4 MB)
2026-09-12 13:45:10 +00:00

67 lines
2.4 KiB
TypeScript

// Module ID: 11120
// Function ID: 11121
// Name: PlaygroundAccessExperiment
// Dependencies: [1371, 1433, 504, 2]
// Exports: getHasPlaygroundAccess, getPlaygroundAccessExperiment, useHasPlaygroundAccess, usePlaygroundAccessExperiment
// Module 11120 (PlaygroundAccessExperiment)
import initialize from "initialize" /* 504 */;
import UserStore from "UserStore" /* 1371 */;
require = fn;
const ApexExperiment = fn(1433);
const obj2 = { name: "2026-02-mana-playground-access", kind: "user", defaultConfig: { enabled: false }, variations: null };
const obj3 = { 1: null };
obj3[1] = { enabled: true };
obj2.variations = obj3;
const apexExperiment = ApexExperiment.createApexExperiment(obj2);
const size = fn(2);
const result = size.fileFinishedImporting("modules/design/PlaygroundAccessExperiment.tsx");
export default apexExperiment;
export const usePlaygroundAccessExperiment = function usePlaygroundAccessExperiment(design_systems_settings) {
return apexExperiment.useConfig({ location: design_systems_settings }).enabled;
};
export const getPlaygroundAccessExperiment = function getPlaygroundAccessExperiment(location) {
return apexExperiment.getConfig({ location }).enabled;
};
export const useHasPlaygroundAccess = function useHasPlaygroundAccess(location) {
const items = [UserStore];
const stateFromStores = initialize.useStateFromStores(items, () => currentUser.getCurrentUser());
let isStaffResult;
if (stateFromStores != null) {
isStaffResult = stateFromStores.isStaff();
}
let enabled = true === isStaffResult;
if (!enabled) {
let isStaffPersonalResult;
if (stateFromStores != null) {
isStaffPersonalResult = stateFromStores.isStaffPersonal();
}
enabled = true === isStaffPersonalResult;
}
if (!enabled) {
enabled = apexExperiment.useConfig(obj2).enabled;
}
return enabled;
};
export const getHasPlaygroundAccess = function getHasPlaygroundAccess(quickswitcher_action) {
const currentUser = UserStore.getCurrentUser();
let isStaffResult;
if (currentUser != null) {
isStaffResult = currentUser.isStaff();
}
let enabled = true === isStaffResult;
if (!enabled) {
let isStaffPersonalResult;
if (currentUser != null) {
isStaffPersonalResult = currentUser.isStaffPersonal();
}
enabled = true === isStaffPersonalResult;
}
if (!enabled) {
const obj = { location: quickswitcher_action };
enabled = apexExperiment.getConfig(obj).enabled;
}
return enabled;
};