decord/beta/source/modules/holidays/HolidayEventsManager.tsx

87 lines
3.2 KiB
TypeScript
Raw Normal View History

2026-10-02 13:37:24 +00:00
// Module ID: 17149
// Function ID: 17150
// Name: HolidayEventsManager
2026-10-02 13:37:24 +00:00
// Dependencies: [1247, 9336, 9337, 6540, 17150, 17154, 17155, 17156, 9338, 2]
2026-10-02 13:37:24 +00:00
// Module 17149 (HolidayEventsManager)
import Constants from "Constants" /* 9337 */;
import HolidayEventsConfigDefault from "HolidayEventsConfig" /* 17150 */;
import HolidayEventsUtilsDefault from "HolidayEventsUtils" /* 17154 */;
import SoundpackActions from "SoundpackActions" /* 17155 */;
import react_native from "react-native" /* 17156 */;
import ApexExperimentStore from "ApexExperimentStore" /* 1247 */;
import SoundpackStore from "SoundpackStore" /* 9336 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6540 */;
2026-10-01 14:13:23 +00:00
import size from "module_2" /* 2 */;
2026-10-01 14:13:23 +00:00
let map;
let tmp;
2026-10-02 13:37:24 +00:00
const getSoundsForPackDefault = tmp(9338);
2026-10-01 14:13:23 +00:00
const Soundpacks = Constants.Soundpacks;
class HolidayEventsManager extends AutomaticLifecycleManager {
constructor() {
2026-10-01 14:13:23 +00:00
const applyArgumentsResult = HermesBuiltin.applyArguments(this, new.target);
require = applyArgumentsResult;
map = new Map();
2026-10-01 14:13:23 +00:00
applyArgumentsResult.stores = map.set(ApexExperimentStore, () => require.handleExperimentUpdated());
applyArgumentsResult.actions = { NOTIFICATIONS_SET_DISABLED_SOUNDS: applyArgumentsResult.updateRingtone };
applyArgumentsResult.handleExperimentUpdated = function handleExperimentUpdated() {
2026-10-01 14:13:23 +00:00
const tmp = !HolidayEventsConfigDefault.isDesktopOnly;
if (tmp) {
require.updateSoundpack();
require.updateRingtone();
}
};
return applyArgumentsResult;
}
2026-10-01 14:13:23 +00:00
updateSoundpack() {
let name;
const soundpack = SoundpackStore.getSoundpack();
const lastSoundpackExperimentId = SoundpackStore.getLastSoundpackExperimentId();
const experiment = HolidayEventsConfigDefault.experiment;
if (experiment != null) {
name = experiment.definition.name;
}
2026-10-01 14:13:23 +00:00
const tmp3Result = HolidayEventsUtilsDefault;
let isEligibleResult = tmp3Result.isEligible();
if (isEligibleResult) {
2026-10-01 14:13:23 +00:00
if (isEligibleResult) {
2026-10-02 13:37:24 +00:00
isEligibleResult = null != tmp3(17150).soundpack;
2026-10-01 14:13:23 +00:00
}
if (isEligibleResult) {
isEligibleResult = name !== lastSoundpackExperimentId;
}
if (isEligibleResult) {
2026-10-02 13:37:24 +00:00
isEligibleResult = soundpack !== tmp3(17150).soundpack;
2026-10-01 14:13:23 +00:00
}
if (isEligibleResult) {
const obj3 = SoundpackActions;
obj3.setSoundpack(HolidayEventsConfigDefault.soundpack, name);
}
} else {
const obj2 = SoundpackActions;
obj2.setSoundpack(Soundpacks.CLASSIC, null);
}
}
2026-10-01 14:13:23 +00:00
updateRingtone() {
const obj = HolidayEventsUtilsDefault;
if (obj.isEligible()) {
const tmpResult = getSoundsForPackDefault;
const tmpResultResult = tmpResult(SoundpackStore.getSoundpack());
if (null != tmpResultResult.call_ringing) {
const obj3 = react_native;
obj3.setIncomingRingtone("call_ringing", `${tmp7.call_ringing}.mp3`);
}
} else {
const obj2 = react_native;
obj2.setIncomingRingtone("call_ringing", "call_ringing.mp3");
}
}
2026-10-01 14:13:23 +00:00
}
const prototype = HolidayEventsManager.prototype;
const holidayEventsManager = new HolidayEventsManager();
const result = size.fileFinishedImporting("modules/holidays/HolidayEventsManager.tsx");
export default holidayEventsManager;