decord/source/modules/client_themes/SavedCustomThemeStore.tsx

160 lines
4.5 KiB
TypeScript
Raw Normal View History

2026-07-25 08:10:48 +00:00
// Module ID: 4065
2026-07-27 11:26:19 +00:00
// Function ID: 33862
2026-07-20 16:05:17 +00:00
// Name: _isNativeReflectConstruct
2026-07-23 10:11:24 +00:00
// Dependencies: [6, 7, 15, 17, 18, 1281, 1184, 566, 686, 2]
2026-07-25 08:10:48 +00:00
// Module 4065 (_isNativeReflectConstruct)
2026-07-23 10:11:24 +00:00
import isNonEmptyString from "isNonEmptyString";
import initialize from "initialize";
import _possibleConstructorReturn from "_possibleConstructorReturn";
import _getPrototypeOf from "_getPrototypeOf";
import _inherits from "_inherits";
import SystemThemeState from "SystemThemeState";
2026-07-20 16:05:17 +00:00
let PROTO_THEME_MAP_WEB_REFRESH;
2026-07-23 10:11:24 +00:00
let closure_7;
2026-07-20 16:05:17 +00:00
function _isNativeReflectConstruct() {
let closure_0 = !valueOf.call(Reflect.construct(Boolean, [], () => {
}));
function _isNativeReflectConstruct() {
return closure_0;
}
const result = _isNativeReflectConstruct();
}
function validateSavedTheme(colors) {
let tmp3 = tmp2;
if (colors.colors.length > 0) {
tmp3 = "number" === typeof colors.gradient_angle;
}
let tmp5 = tmp3;
if (tmp3) {
tmp5 = "number" === typeof colors.base_mix;
}
let tmp6 = tmp5;
if (tmp5) {
tmp6 = null != tmp;
}
return tmp6;
}
2026-07-23 10:11:24 +00:00
({ PROTO_THEME_MAP_WEB_REFRESH, PROTO_THEME_MAP_MOBILE: closure_7 } = SystemThemeState);
2026-07-20 16:05:17 +00:00
let obj = { NOT_FETCHED: 0, [0]: "NOT_FETCHED", IS_FETCHING: 1, [1]: "IS_FETCHING", HAS_FETCHED: 2, [2]: "HAS_FETCHED", ERROR: 3, [3]: "ERROR" };
let closure_9 = [];
const NOT_FETCHED = obj.NOT_FETCHED;
2026-07-23 10:11:24 +00:00
let tmp3 = ((PersistedStore) => {
2026-07-20 16:05:17 +00:00
class SavedCustomThemeStore {
constructor() {
self = this;
2026-07-23 10:11:24 +00:00
tmp = outer1_2(this, SavedCustomThemeStore);
obj = outer1_5(SavedCustomThemeStore);
tmp2 = outer1_4;
if (outer1_11()) {
2026-07-20 16:05:17 +00:00
tmp6 = globalThis;
_Reflect = Reflect;
2026-07-23 10:11:24 +00:00
tmp7 = outer1_5;
2026-07-20 16:05:17 +00:00
tmp8 = arguments;
2026-07-23 10:11:24 +00:00
constructResult = Reflect.construct(obj, arguments, outer1_5(self).constructor);
2026-07-20 16:05:17 +00:00
} else {
tmp3 = arguments;
tmp4 = arguments;
constructResult = obj(...arguments);
}
return tmp2(self, constructResult);
}
}
callback2(SavedCustomThemeStore, PersistedStore);
let obj = {
key: "initialize",
value(savedCustomThemes) {
if (null != savedCustomThemes) {
2026-07-23 10:11:24 +00:00
const outer1_9 = savedCustomThemes.savedCustomThemes;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
const outer1_10 = outer1_8.NOT_FETCHED;
2026-07-20 16:05:17 +00:00
}
};
const items = [obj, , , , , , , ];
obj = {
key: "getState",
value() {
2026-07-23 10:11:24 +00:00
return { savedCustomThemes: null != outer1_9 ? outer1_9 : [] };
2026-07-20 16:05:17 +00:00
}
};
items[1] = obj;
obj = {
key: "getSavedCustomTheme",
value() {
let length;
2026-07-23 10:11:24 +00:00
if (null != outer1_9) {
length = outer1_9.length;
2026-07-20 16:05:17 +00:00
}
let first = null;
if (length > 0) {
first = null;
2026-07-23 10:11:24 +00:00
if (outer1_9[0].colors.length > 0) {
first = outer1_9[0];
2026-07-20 16:05:17 +00:00
}
}
return first;
}
};
items[2] = obj;
items[3] = {
key: "getFetchState",
value() {
2026-07-23 10:11:24 +00:00
return outer1_10;
2026-07-20 16:05:17 +00:00
}
};
items[4] = {
key: "hasSavedCustomThemes",
value() {
let length;
2026-07-23 10:11:24 +00:00
if (null != outer1_9) {
length = outer1_9.length;
2026-07-20 16:05:17 +00:00
}
return length > 0;
}
};
items[5] = {
key: "isFetching",
value() {
2026-07-23 10:11:24 +00:00
return outer1_10 === outer1_8.IS_FETCHING;
2026-07-20 16:05:17 +00:00
}
};
items[6] = {
key: "hasFetched",
value() {
2026-07-23 10:11:24 +00:00
return outer1_10 === outer1_8.HAS_FETCHED;
2026-07-20 16:05:17 +00:00
}
};
items[7] = {
key: "hasError",
value() {
2026-07-23 10:11:24 +00:00
return outer1_10 === outer1_8.ERROR;
2026-07-20 16:05:17 +00:00
}
};
return callback(SavedCustomThemeStore, items);
2026-07-23 10:11:24 +00:00
})(require("initialize").PersistedStore);
2026-07-20 16:05:17 +00:00
tmp3.displayName = "SavedCustomThemeStore";
tmp3.persistKey = "SavedCustomThemeStore";
obj = {
SAVED_CUSTOM_THEMES_FETCH_START: function handleCustomThemesFetchStart() {
2026-07-23 10:11:24 +00:00
const IS_FETCHING = obj.IS_FETCHING;
2026-07-20 16:05:17 +00:00
},
SAVED_CUSTOM_THEMES_FETCH_SUCCESS: function handleCustomThemesFetchSuccess(themes) {
themes = themes.themes;
2026-07-23 10:11:24 +00:00
const HAS_FETCHED = obj.HAS_FETCHED;
2026-07-20 16:05:17 +00:00
const found = themes.filter(validateSavedTheme);
2026-07-23 10:11:24 +00:00
let closure_9 = found.map((colors) => ({ colors: colors.colors, gradient_angle: colors.gradient_angle, base_mix: colors.base_mix, base_theme: outer1_7[colors.base_theme] }));
2026-07-20 16:05:17 +00:00
},
SAVED_CUSTOM_THEMES_FETCH_FAILURE: function handleCustomThemesFetchFailure(error) {
2026-07-23 10:11:24 +00:00
const ERROR = obj.ERROR;
obj = importDefault(1184);
2026-07-20 16:05:17 +00:00
obj.captureException(error.error, { tags: { app_context: "SavedCustomThemeStore" } });
}
};
2026-07-23 10:11:24 +00:00
tmp3 = new tmp3(require("dispatcher"), obj);
let result = require("_possibleConstructorReturn").fileFinishedImporting("modules/client_themes/SavedCustomThemeStore.tsx");
2026-07-20 16:05:17 +00:00
export default tmp3;
export const FetchState = obj;