decord/source/modules/voice_panel/VoicePanelStore.tsx
2026-08-05 07:35:12 +00:00

210 lines
6.7 KiB
TypeScript

// Module ID: 4465
// Function ID: 4466
// Name: withEqualityFn
// Dependencies: [1372, 700, 4466, 705, 2]
// Module 4465 (withEqualityFn)
import ensureGuildLoaded from "ensureGuildLoaded";
import identity from "identity";
const require = arg1;
const withEqualityFn = identity.createWithEqualityFn((arg0, arg1) => {
let closure_0 = arg0;
let closure_1 = arg1;
let obj = { channels: null, isActivityFocused: false, isVoicePanelFullscreen: null, isAnyVoicePanelOpen: null, voicePanelsFullscreen: null, voicePanelsOpened: null, voicePanelsPIP: null, openChannel: null, closeChannel: null, isMounted: null, setIsActivityFocused: null, setChannelPanelFullscreen: null, setChannelPanelOpen: null, isChannelOpen: null, setChannelPanelPIP: null };
obj[0] = new Set();
obj[2] = function isVoicePanelFullscreen() {
return dependencyMap().voicePanelsFullscreen.size > 0;
};
obj[3] = function isAnyVoicePanelOpen() {
return dependencyMap().voicePanelsOpened.size > 0;
};
let set = new Set();
obj[4] = new Set();
let set1 = new Set();
obj[5] = new Set();
let set2 = new Set();
obj[6] = new Set();
obj[7] = function openChannel(arg0) {
const callback = arg0;
let result = callback(4466).isStageVoicePanelEnabled("voice_panel_store");
if (!result) {
const channel = outer1_2.getChannel(arg0);
let isGuildStageVoiceResult;
if (channel != null) {
isGuildStageVoiceResult = channel.isGuildStageVoice();
}
result = true !== isGuildStageVoiceResult;
}
if (result) {
const channels = dependencyMap().channels;
if (!channels.has(arg0)) {
callback(705).batchUpdates(() => {
callback((channels) => {
const obj = {};
const merged = Object.assign(channels);
const items = [closure_0, ...Array.from(channels.channels)];
obj.channels = new Set(items);
const items1 = [closure_0, ...Array.from(channels.voicePanelsOpened)];
const set = new Set(items);
obj.voicePanelsOpened = new Set(items1);
return obj;
});
});
const tmpResult = callback(705);
}
}
};
obj[8] = function closeChannel(channelId) {
const callback = channelId;
callback(705).batchUpdates(() => {
channelId((arg0) => {
let channels;
let voicePanelsFullscreen;
let voicePanelsOpened;
({ channels, voicePanelsFullscreen, voicePanelsOpened } = arg0);
if (!channels.has(closure_0)) {
if (!voicePanelsFullscreen.has(tmp)) {
let tmp2 = arg0;
}
return tmp2;
}
let tmp3 = channels;
if (channels.has(closure_0)) {
const _Set = Set;
const set = new Set(channels);
set.delete(tmp);
tmp3 = set;
}
let tmp10 = voicePanelsFullscreen;
if (voicePanelsFullscreen.has(closure_0)) {
const _Set2 = Set;
const set1 = new Set(voicePanelsFullscreen);
set1.delete(tmp);
tmp10 = set1;
}
let tmp17 = voicePanelsOpened;
if (voicePanelsOpened.has(closure_0)) {
const _Set3 = Set;
const set2 = new Set(voicePanelsOpened);
set2.delete(tmp);
tmp17 = set2;
}
const obj = {};
const merged = Object.assign(arg0);
obj.channels = tmp3;
obj.voicePanelsFullscreen = tmp10;
obj.voicePanelsOpened = tmp17;
tmp2 = obj;
});
});
};
obj[9] = function isMounted(arg0) {
const channels = dependencyMap().channels;
return channels.has(arg0);
};
obj[10] = function setIsActivityFocused(arg0) {
const callback = arg0;
callback(705).batchUpdates(() => {
callback((isActivityFocused) => {
let tmp2 = isActivityFocused;
if (isActivityFocused.isActivityFocused !== closure_0) {
const obj = {};
const merged = Object.assign(isActivityFocused);
obj.isActivityFocused = tmp;
tmp2 = obj;
}
return tmp2;
});
});
};
obj[11] = function setChannelPanelFullscreen(closure_0, closure_02) {
const callback = closure_0;
const dependencyMap = closure_02;
callback(705).batchUpdates(() => {
callback((voicePanelsFullscreen) => {
const set = new Set(voicePanelsFullscreen.voicePanelsFullscreen);
const hasItem = set.has(closure_0);
if (closure_1) {
if (hasItem) {
return voicePanelsFullscreen;
} else {
set.add(tmp);
}
} else if (hasItem) {
set.delete(tmp);
} else {
return voicePanelsFullscreen;
}
const obj = {};
const merged = Object.assign(voicePanelsFullscreen);
obj.voicePanelsFullscreen = set;
return obj;
});
});
};
obj[12] = function setChannelPanelOpen(scrollPosition, arg1) {
const callback = scrollPosition;
const dependencyMap = arg1;
callback(705).batchUpdates(() => {
scrollPosition((channels) => {
channels = channels.channels;
if (channels.has(closure_0)) {
const _Set = Set;
const set = new Set(channels.voicePanelsOpened);
const hasItem = set.has(tmp);
if (closure_1) {
if (hasItem) {
return channels;
} else {
set.add(tmp);
}
} else if (hasItem) {
set.delete(tmp);
} else {
return channels;
}
const obj = {};
const merged = Object.assign(channels);
obj.voicePanelsOpened = set;
return obj;
} else {
return channels;
}
});
});
};
obj[13] = function isChannelOpen(closure_0) {
const voicePanelsOpened = dependencyMap().voicePanelsOpened;
return voicePanelsOpened.has(closure_0);
};
obj[14] = function setChannelPanelPIP(scrollPosition, arg1) {
const callback = scrollPosition;
const dependencyMap = arg1;
callback(705).batchUpdates(() => {
scrollPosition((voicePanelsPIP) => {
const set = new Set(voicePanelsPIP.voicePanelsPIP);
const hasItem = set.has(closure_0);
if (closure_1) {
if (hasItem) {
return voicePanelsPIP;
} else {
set.add(tmp);
}
} else if (hasItem) {
set.delete(tmp);
} else {
return voicePanelsPIP;
}
const obj = {};
const merged = Object.assign(voicePanelsPIP);
obj.voicePanelsPIP = set;
return obj;
});
});
};
return obj;
});
let result = require("useIsStageVoicePanelEnabled").fileFinishedImporting("modules/voice_panel/VoicePanelStore.tsx");
export default withEqualityFn;