decord/alpha/source/modules/video_backgrounds/LastUsedVideoBackgroundOption.tsx

183 lines
5.3 KiB
TypeScript
Raw Normal View History

2026-10-09 10:00:15 +00:00
// Module ID: 5257
// Function ID: 5258
// Name: LastUsedVideoBackgroundOption
2026-10-09 10:00:15 +00:00
// Dependencies: [19, 1207, 1244, 1390, 5258, 4728, 558, 576, 504, 2]
2026-10-03 08:58:59 +00:00
// Exports: getLastUsedVideoBackgroundOption
2026-07-20 16:05:17 +00:00
2026-10-09 10:00:15 +00:00
// Module 5257 (LastUsedVideoBackgroundOption)
2026-10-03 08:58:59 +00:00
import get_initialized from "get initialized" /* 504 */;
import react2 from "react" /* 576 */;
2026-10-09 10:00:15 +00:00
import PremiumUtilsDefault from "PremiumUtils" /* 4728 */;
import VideoBackgroundUtils from "VideoBackgroundUtils" /* 5258 */;
2026-10-03 08:58:59 +00:00
import react from "react" /* 19 */;
2026-10-08 09:57:35 +00:00
import UnsyncedUserSettingsStore from "UnsyncedUserSettingsStore" /* 1207 */;
2026-10-09 10:00:15 +00:00
import UserSettingsProtoStore from "UserSettingsProtoStore" /* 1244 */;
import UserStore from "UserStore" /* 1390 */;
2026-10-03 08:58:59 +00:00
import ReactCompilerGating from "ReactCompilerGating" /* 558 */;
import size from "module_2" /* 2 */;
2026-07-23 10:11:24 +00:00
2026-10-08 09:57:35 +00:00
let tmp2 = ReactCompilerGating.isReactCompilerEnabled() ? (function useLastUsedVideoBackgroundOption() {
2026-10-03 08:58:59 +00:00
let currentUser;
let settings;
let tmp12;
let tmp13;
let tmp4;
let tmp5;
let tmp8;
let tmp9;
let videoBackground;
const obj = react2;
const cResult = obj.c(12);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [UnsyncedUserSettingsStore];
const fn = function u() {
return videoBackground.videoBackground;
};
cResult[0] = items;
cResult[1] = fn;
tmp4 = items;
tmp5 = fn;
} else {
[tmp4, tmp5] = cResult;
}
const tmpResult = get_initialized;
const stateFromStores = tmpResult.useStateFromStores(tmp4, tmp5);
if (cResult[2] === Symbol.for("react.memo_cache_sentinel")) {
const items1 = [UserSettingsProtoStore];
const fn2 = function v() {
return settings.settings;
};
cResult[2] = items1;
cResult[3] = fn2;
tmp9 = fn2;
tmp8 = items1;
} else {
tmp8 = cResult[2];
tmp9 = cResult[3];
}
const tmpResult5 = get_initialized;
const stateFromStores1 = tmpResult5.useStateFromStores(tmp8, tmp9);
if (cResult[4] === Symbol.for("react.memo_cache_sentinel")) {
const items2 = [UserStore];
2026-10-08 09:57:35 +00:00
class S {
constructor() {
return currentUser.getCurrentUser();
}
}
2026-10-03 08:58:59 +00:00
cResult[4] = items2;
2026-10-08 09:57:35 +00:00
cResult[5] = S;
tmp13 = S;
2026-10-03 08:58:59 +00:00
tmp12 = items2;
} else {
tmp12 = cResult[4];
tmp13 = cResult[5];
}
const tmpResult6 = get_initialized;
const stateFromStores2 = tmpResult6.useStateFromStores(tmp12, tmp13);
let tmp16 = null;
if (null != stateFromStores2) {
2026-10-08 09:57:35 +00:00
let tmp20;
2026-10-03 08:58:59 +00:00
if (cResult[6] === stateFromStores) {
let tmp17;
if (cResult[7] === stateFromStores2) {
tmp17 = cResult[8];
}
tmp16 = tmp17;
}
const tmpResult7 = VideoBackgroundUtils;
if (!tmpResult7.isCustomBackgroundOption(stateFromStores)) {
2026-10-08 09:57:35 +00:00
let tmp21;
2026-10-03 08:58:59 +00:00
if (typeof stateFromStores !== "number") {
2026-10-08 09:57:35 +00:00
tmp21 = stateFromStores;
2026-10-03 08:58:59 +00:00
} else {
2026-10-08 09:57:35 +00:00
tmp21 = null;
2026-10-03 08:58:59 +00:00
VideoBackgroundUtils;
}
2026-10-08 09:57:35 +00:00
tmp20 = tmp21;
2026-07-20 16:05:17 +00:00
} else {
2026-10-03 08:58:59 +00:00
PremiumUtilsDefault;
2026-10-08 09:57:35 +00:00
tmp20 = null;
class S {
constructor() {
return currentUser.getCurrentUser();
}
}
}
class S {
constructor() {
return currentUser.getCurrentUser();
}
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
cResult[6] = stateFromStores;
cResult[7] = stateFromStores2;
2026-10-08 09:57:35 +00:00
cResult[8] = tmp20;
tmp17 = tmp20;
2026-07-20 16:05:17 +00:00
}
2026-10-03 08:58:59 +00:00
return tmp16;
2026-10-08 09:57:35 +00:00
}) : (function useLastUsedVideoBackgroundOption() {
2026-10-03 08:58:59 +00:00
let currentUser;
let settings;
let stateFromStores;
let videoBackground;
let obj = stateFromStores(504);
2026-10-03 08:58:59 +00:00
const items = [UnsyncedUserSettingsStore];
stateFromStores = obj.useStateFromStores(items, () => videoBackground.videoBackground);
const obj2 = stateFromStores(504);
const items1 = [UserSettingsProtoStore];
2026-10-03 08:58:59 +00:00
const stateFromStores1 = obj2.useStateFromStores(items1, () => settings.settings);
const items2 = [UserStore];
2026-10-03 08:58:59 +00:00
const obj3 = stateFromStores(504);
const stateFromStores2 = obj3.useStateFromStores(items2, () => currentUser.getCurrentUser());
const voiceAndVideo = stateFromStores1.voiceAndVideo;
2026-07-29 08:29:29 +00:00
let prop;
if (voiceAndVideo != null) {
2026-07-20 16:05:17 +00:00
prop = voiceAndVideo.videoBackgroundFilterDesktop;
}
const items3 = [prop, stateFromStores2, stateFromStores];
2026-10-03 08:58:59 +00:00
return react.useMemo(() => {
2026-07-29 08:29:29 +00:00
let tmp2 = null;
if (null != stateFromStores2) {
2026-10-03 08:58:59 +00:00
let tmp7;
const obj = VideoBackgroundUtils;
const tmp4 = require;
if (!obj.isCustomBackgroundOption(stateFromStores)) {
2026-10-03 08:58:59 +00:00
let tmp8;
if (typeof stateFromStores !== "number") {
tmp8 = tmp3;
2026-07-29 08:29:29 +00:00
} else {
tmp8 = null;
2026-10-09 10:00:15 +00:00
tmp4(5258);
2026-07-29 08:29:29 +00:00
}
2026-10-03 08:58:59 +00:00
tmp7 = tmp8;
2026-07-29 08:29:29 +00:00
} else {
tmp7 = null;
2026-10-03 08:58:59 +00:00
PremiumUtilsDefault;
2026-07-29 08:29:29 +00:00
}
tmp2 = tmp7;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp2;
}, items3);
2026-10-03 08:58:59 +00:00
});
const result = size.fileFinishedImporting("modules/video_backgrounds/LastUsedVideoBackgroundOption.tsx");
export const getLastUsedVideoBackgroundOption = function getLastUsedVideoBackgroundOption(currentUser) {
let tmp5;
const videoBackground = UnsyncedUserSettingsStore.videoBackground;
const obj = VideoBackgroundUtils;
if (!obj.isCustomBackgroundOption(videoBackground)) {
let tmp6;
if (typeof videoBackground !== "number") {
tmp6 = videoBackground;
} else {
tmp6 = null;
VideoBackgroundUtils;
}
tmp5 = tmp6;
} else {
tmp5 = null;
PremiumUtilsDefault;
}
return tmp5;
2026-07-20 16:05:17 +00:00
};
2026-10-03 08:58:59 +00:00
export const useLastUsedVideoBackgroundOption = tmp2;