decord/beta/source/modules/guild_onboarding/DefaultChannelUtils.tsx
github-actions e7a050048e chore: update source for beta 347.7
Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4943.js (118.4 MB)
2026-09-21 19:31:18 +00:00

92 lines
3.3 KiB
TypeScript

// Module ID: 7349
// Function ID: 7350
// Name: DefaultChannelUtils
// Dependencies: [2101, 2045, 1078, 1090, 558, 568, 4404, 504, 2]
// Exports: canChannelBeDefault
// Module 7349 (DefaultChannelUtils)
import BigFlagUtilsAll from "BigFlagUtils" /* 1090 */;
import PermissionUtilsAll from "PermissionUtils" /* 4404 */;
import GatedChannelStore from "GatedChannelStore" /* 2101 */;
import ChannelStore from "ChannelStore" /* 2045 */;
const require = globalThis.__r;
const require = fn;
const Constants = fn(1078);
({ ChannelTypesSets: hasOwnProperty, Permissions: metroRequire } = Constants);
const ReactCompilerGating = fn(558);
const size = fn(2);
const result = size.fileFinishedImporting("modules/guild_onboarding/DefaultChannelUtils.tsx");
export const useCanChannelBeDefault = ReactCompilerGating.isReactCompilerEnabled() ? ((arg0, arg1) => {
_require = arg0;
closure_1 = arg1;
const cResult = require("c").c(4);
if (cResult[0] === Symbol.for("react.memo_cache_sentinel")) {
const items = [GatedChannelStore, ChannelStore];
cResult[0] = items;
let first = items;
} else {
first = cResult[0];
}
if (cResult[1] === arg1) {
if (cResult[2] === arg0) {
let tmp7 = cResult[3];
}
return require("initialize").useStateFromStores(first, tmp7);
}
const fn = function u() {
const channel = ChannelStore.getChannel(closure_1);
if (null != channel) {
const GUILD_VOCAL = constants.GUILD_VOCAL;
if (GUILD_VOCAL.has(channel.type)) {
let VIEW_CHANNEL = BigFlagUtilsAll.combine(constants2.VIEW_CHANNEL, constants2.CONNECT);
}
let isChannelGatedResult = GatedChannelStore.isChannelGated(closure_0, closure_1);
if (!isChannelGatedResult) {
isChannelGatedResult = PermissionUtilsAll.canEveryoneRole(VIEW_CHANNEL, channel);
}
return isChannelGatedResult;
}
VIEW_CHANNEL = constants2.VIEW_CHANNEL;
};
cResult[1] = arg1;
cResult[2] = arg0;
cResult[3] = fn;
tmp7 = fn;
}) : ((arg0, arg1) => {
_require = arg0;
closure_1 = arg1;
const items = [GatedChannelStore, ChannelStore];
return require("initialize").useStateFromStores(items, () => {
const channel = ChannelStore.getChannel(closure_1);
if (null != channel) {
const GUILD_VOCAL = constants.GUILD_VOCAL;
if (GUILD_VOCAL.has(channel.type)) {
let VIEW_CHANNEL = BigFlagUtilsAll.combine(constants2.VIEW_CHANNEL, constants2.CONNECT);
}
let isChannelGatedResult = GatedChannelStore.isChannelGated(closure_0, closure_1);
if (!isChannelGatedResult) {
isChannelGatedResult = PermissionUtilsAll.canEveryoneRole(VIEW_CHANNEL, channel);
}
return isChannelGatedResult;
}
VIEW_CHANNEL = constants2.VIEW_CHANNEL;
});
});
export const canChannelBeDefault = function canChannelBeDefault(guild_id, id) {
const channel = ChannelStore.getChannel(id);
if (null != channel) {
const GUILD_VOCAL = constants.GUILD_VOCAL;
if (GUILD_VOCAL.has(channel.type)) {
let VIEW_CHANNEL = BigFlagUtilsAll.combine(constants2.VIEW_CHANNEL, constants2.CONNECT);
}
let isChannelGatedResult = GatedChannelStore.isChannelGated(guild_id, id);
if (!isChannelGatedResult) {
isChannelGatedResult = PermissionUtilsAll.canEveryoneRole(VIEW_CHANNEL, ChannelStore.getChannel(id));
}
return isChannelGatedResult;
}
VIEW_CHANNEL = constants2.VIEW_CHANNEL;
};