Files
discord-decomp/sources/modules/channel_permissions/ChannelPermissionsUtils.tsx
T
2026-07-27 16:20:00 +03:00

599 lines
26 KiB
TypeScript

/* Metro module 9088; source: modules/channel_permissions/ChannelPermissionsUtils.tsx; dependencies: [1383, 1422, 1939, 1945, 1878, 8120, 661, 1940, 1244, 483, 21, 3995, 1360, 3789, 9089, 1909, 4800, 2] */
function _fun71018(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#71018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:6, offset: 0x01d12556, size: 675 bytes, params: 8, frame: 26
let env0_0 = require;
const isAdmin = function(a0) {
return hasPermission(a0, Permissions.ADMINISTRATOR);
};
const closure = getRoleRowData;
const closure2 = sortRoles;
const closure3 = getNoRolesRow;
const closure4 = function(a0, a1, a2, a3, a4) {
var env0_0 = a2;
var env0_1 = a3;
var env0_2 = a4;
return a1.filter(_fun71025);
};
const closure5 = function(a0, a1, a2, a3, a4) {
var env0_0 = a2;
var env0_1 = a3;
var env0_2 = a4;
return a1.filter(_fun71027);
};
const isDefaultMember = function(a0, a1) {
return isGuildOwner(a1, a0);
};
const sortMembers = function(a0, a1) {
var r0;
var value;
var property = a0.rowType;
if (property !== a1.rowType) {
r0 = a0.rowType - a1.rowType;
} else {
property = a0.name;
value = property.toLocaleLowerCase();
property = a1.name;
value = value.localeCompare(property.toLocaleLowerCase());
r0 = value;
}
return r0;
};
const closure6 = getExistingMembers;
const closure7 = flipEveryonePermission;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = (require(1383) /* metro dependency 1383: ChannelRecord */).isGuildVocalChannelType;
const env0_5 = (require(1422) /* metro dependency 1422: GuildRecord */).isGuildOwner;
let value = require(1939) /* metro dependency 1939: GuildRoleRecord */;
const env0_6 = value.hasPermission;
const env0_7 = value.isEveryoneRole;
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const env0_10 = (require(8120) /* metro dependency 8120: ChannelPermissionsConstants */).RowType;
value = require(661) /* metro dependency 661: Constants */;
const env0_11 = value.Permissions;
const env0_12 = value.ChannelTypes;
const env0_13 = value.DEFAULT_ROLE_COLOR_HEX;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/channel_permissions/ChannelPermissionsUtils.tsx');
exports.getRoleRowData = closure;
exports.sortRoles = closure2;
exports.getNoRolesRow = closure3;
exports.isEveryoneRoleId = isEveryoneRoleId;
exports.getRolesRows = function(a0, a1, a2, a3) {
var value = a4;
var env0_0 = a2;
var env0_1 = a3;
var env0_2 = value !== undefined ? value : _fun71037;
value = a1.filter(_fun71038);
value = value.sort(sortRoles);
return value.map(_fun71039);
};
exports.getRolesRowsWithPermissionDisabled = function(a0, a1, a2, a3) {
var value = a4;
var env0_0 = a2;
var env0_1 = a3;
var env0_2 = value !== undefined ? value : _fun71041;
value = a1.filter(_fun71042);
value = value.sort(sortRoles);
return value.map(_fun71043);
};
exports.getExistingRoles = closure4;
exports.getAllExistingRolesWithPermission = closure5;
exports.getExistingRolesRows = getExistingRolesRows;
exports.getExistingRolesRowWithPermissionDisabled = getExistingRolesRowWithPermissionDisabled;
exports.getMembersRows = getMembersRows;
exports.getExistingMembers = closure6;
exports.getExistingMembersRows = function(a0, a1, a2, a3, a4) {
var env0_0 = a2;
return getExistingMembers(a0, a1, a2, a3, a4).map(_fun71053).sort(sortMembers);
};
exports.getRowTypeLabel = getRowTypeLabel;
exports.getRemoveTooltipHint = getRemoveTooltipHint;
exports.flipEveryonePermission = closure7;
exports.toggleChannelEveryonePermission = toggleChannelEveryonePermission;
exports.grantUserChannelAccess = grantUserChannelAccess;
exports.isPrivateGuildChannel = isPrivateGuildChannel;
exports.isPrivateTextChannel = isPrivateTextChannel;
exports.canCreatePrivateChannel = function(a0, a1, a2) {
var r1;
var r0;
var value = a1;
if (a0 === ChannelTypes.GUILD_TEXT) {
r0 = value;
} else if (a0 === ChannelTypes.GUILD_ANNOUNCEMENT) {
r0 = value;
} else {
r1 = !isGuildVocalChannelType(a0) && a0 !== ChannelTypes.GUILD_CATEGORY;
r1 = !r1 ? value && a2 : r1;
r0 = r1;
}
return r0;
};
exports.getPrivateChannelHintText = getPrivateChannelHintText;
exports.extractPermissionOverwrites = function(a0, a1) {
var env0_0 = a1;
var Object = global.Object;
Object.values(a0).forEach(_fun71063);
return [];
};
}
function getRoleRowData(a0) { // fn#71020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:357, offset: 0x01d12817, size: 162 bytes, params: 2, frame: 18
const value = a1;
const r3 = value !== undefined ? value : false;
const r6 = isAdmin(a0) ? RowType.ADMINISTRATOR : RowType.ROLE;
const object2 = {rowType: r6};
object2.colorString = a0.colorString ?? DEFAULT_ROLE_COLOR_HEX;
object2.name = a0.name;
object2.id = a0.id;
object2.disabled = isAdmin(a0) || r3;
object2.key = '' + r6 + ':' + a0.id;
object2.tags = a0.tags;
return object2;
}
function sortRoles(a0, a1) { // fn#71021, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:601, offset: 0x01d128b9, size: 89 bytes, params: 3, frame: 17
var r0;
var value;
const isAdmin2 = isAdmin(a0);
const value2 = 1;
const r1 = isAdmin2 ? 0 : value2;
const r2 = isAdmin(a1) ? 0 : value2;
if (r1 !== r2) {
r0 = r1 - r2;
} else {
value = require(1940) /* metro dependency 1940: GuildRoleUtils */;
value = value.compareGuildRoles(a0, a1);
r0 = value;
}
return r0;
}
function getNoRolesRow() { // fn#71022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:711, offset: 0x01d12912, size: 126 bytes, params: 1, frame: 15
var r0;
var intl;
const value = a0;
if (value !== undefined) {
r0 = value;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['gnsna/']);
}
const EMPTY_STATE = RowType.EMPTY_STATE;
return [{rowType: EMPTY_STATE, colorString: DEFAULT_ROLE_COLOR_HEX, name: r0, disabled: true, id: 'EMPTY_STATE'}];
}
function canAddPermissionInChannel(a0, a1, a2, a3) { // fn#71023, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:860, offset: 0x01d12990, size: 135 bytes, params: 5, frame: 18
var r2;
var value;
const currentUser = UserStore.getCurrentUser();
if (currentUser == null) {
return false;
}
if (a0 == null) {
return currentUser.id !== a1;
}
const r3 = a3?.[a1] == null ? a0.permissionOverwrites[a1] : a3[a1];
const value4 = r3 == null;
if (value4) {
r2 = value4;
} else {
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = !value.has(r3.allow, a2);
r2 = value;
}
return r2;
}
function getExistingRoles(a0, a1, a2, a3, a4) { // fn#71024, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1087, offset: 0x01d12a17, size: 45 bytes, params: 6, frame: 11
const env0_0 = a2;
const env0_1 = a3;
const env0_2 = a4;
return a1.filter(_fun71025);
}
function getAllExistingRolesWithPermission(a0, a1, a2, a3, a4) { // fn#71026, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1204, offset: 0x01d12a8d, size: 45 bytes, params: 6, frame: 11
const env0_0 = a2;
const env0_1 = a3;
const env0_2 = a4;
return a1.filter(_fun71027);
}
function getDisplayName_71028(a0, {id}) { // fn#71028, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1456, offset: 0x01d12b6b, size: 76 bytes, params: 3, frame: 15
var r0;
var value;
const nick = GuildMemberStore.getNick(id, a0.id);
if (nick != null) {
r0 = nick;
} else {
value = importDefault(3995) /* metro dependency 3995: UserUtils */;
value = value.getName(a0);
r0 = value;
}
return r0;
}
function getMemberRowData(a0, a1) { // fn#71030, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1595, offset: 0x01d12bce, size: 212 bytes, params: 3, frame: 19
const r5 = isGuildOwner(a1, a0) ? RowType.OWNER : RowType.MEMBER;
const object2 = {rowType: r5};
object2.name = getDisplayName_71028(a0, a1);
object2.username = (importDefault(3995) /* metro dependency 3995: UserUtils */).getUserTag(a0);
object2.id = a0.id;
object2.avatarURL = a0.getAvatarURL(a1.id, 24);
object2.bot = a0.bot;
object2.verifiedBot = a0.isVerifiedBot();
object2.disabled = isDefaultMember(a0, a1);
object2.key = '' + r5 + ':' + a0.id;
return object2;
}
function getExistingMembers(a0, a1, a2, a3, a4) { // fn#71032, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2050, offset: 0x01d12cf5, size: 113 bytes, params: 6, frame: 14
const env0_0 = a1;
const env0_1 = a2;
const env0_2 = a3;
const env0_3 = a4;
const map = a0.map;
const getUser = UserStore.getUser;
const value2 = Reflect.apply(map, a0, [getUser]);
return value2.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish).filter(_fun71033);
}
function flipEveryonePermission(a0, a1, a2) { // fn#71034, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2217, offset: 0x01d12da2, size: 210 bytes, params: 4, frame: 19
var r1;
var value;
const property = a0.permissionOverwrites[a0.guild_id];
if (property != null) {
r1 = property;
} else {
value = importAll(3789) /* metro dependency 3789: PermissionUtils */;
value = value.makeEveryoneOverwrite(a0.guild_id);
r1 = value;
}
const object2 = {};
copyDataProperties(object2, r1, undefined);
const bigFlagUtilsModule = importAll(483) /* metro dependency 483: BigFlagUtils */;
object2.deny = bigFlagUtilsModule.remove(object2.deny, a1);
const moduleValue2 = bigFlagUtilsModule;
object2.allow = moduleValue2.remove(object2.allow, a1);
if (!a2) {
value = bigFlagUtilsModule;
object2.deny = value.add(object2.deny, a1);
}
return object2;
}
function isEveryoneRoleId(a0, a1) { // fn#71035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2672, offset: 0x01d12e74, size: 48 bytes, params: 3, frame: 11
let value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.castGuildIdAsEveryoneGuildRoleId(a0);
return value === a1;
}
function getRolesRows(a0, a1, a2, a3) { // fn#71036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2775, offset: 0x01d12ea4, size: 93 bytes, params: 5, frame: 12
let value = a4;
const env0_0 = a2;
const env0_1 = a3;
const env0_2 = value !== undefined ? value : function() {
return true;
};
value = Reflect.apply(a1.filter(_fun71038).sort, value, [sortRoles]);
return value.map(function(a0) {
return getRoleRowData(a0);
});
}
function getRolesRowsWithPermissionDisabled(a0, a1, a2, a3) { // fn#71040, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2986, offset: 0x01d12f58, size: 93 bytes, params: 5, frame: 12
let value = a4;
const env0_0 = a2;
const env0_1 = a3;
const env0_2 = value !== undefined ? value : function() {
return true;
};
value = Reflect.apply(a1.filter(_fun71042).sort, value, [sortRoles]);
return value.map(function(a0) {
return getRoleRowData(a0, hasPermission(a0, importAll));
});
}
function getExistingRolesRows(a0, a1, a2, a3, a4) { // fn#71044, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:3318, offset: 0x01d12fda, size: 140 bytes, params: 6, frame: 20
var r0;
var getNoRolesRowBinding;
var intl;
const existingRoles = getExistingRoles(0, a1, a2, a3, a4);
const value4 = existingRoles.sort(sortRoles).map(function(a0) {
return getRoleRowData(a0);
});
if (value4.length !== 0) {
r0 = value4;
} else {
getNoRolesRowBinding = getNoRolesRow;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = getNoRolesRowBinding(intl.string((require(1244) /* metro dependency 1244: indexNative */).t.nZfHsf));
}
return r0;
}
function getExistingRolesRowWithPermissionDisabled(a0, a1, a2, a3, a4) { // fn#71046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:3559, offset: 0x01d13066, size: 147 bytes, params: 6, frame: 21
var r0;
var getNoRolesRowBinding;
var intl;
const env0_0 = a3;
const allExistingRolesWithPermission = getAllExistingRolesWithPermission(0, a1, a2, a3, a4);
const value4 = allExistingRolesWithPermission.sort(sortRoles).map(function(a0) {
return getRoleRowData(a0, hasPermission(a0, importAll));
});
if (value4.length !== 0) {
r0 = value4;
} else {
getNoRolesRowBinding = getNoRolesRow;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = getNoRolesRowBinding(intl.string((require(1244) /* metro dependency 1244: indexNative */).t.nZfHsf));
}
return r0;
}
function getMembersRows(a0, a1, a2, a3) { // fn#71048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:3818, offset: 0x01d1311e, size: 156 bytes, params: 5, frame: 16
const value = a4;
const env0_0 = a1;
const env0_1 = a2;
const env0_2 = a3;
const env0_3 = value !== undefined ? value : function() {
return true;
};
const map = a0.map;
const getUser = UserStore.getUser;
const value2 = Reflect.apply(map, a0, [getUser]);
const value5 = value2.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish).filter(_fun71050).map(function(a0) {
return getMemberRowData(a0, importDefault);
});
return value5.sort(sortMembers);
}
function getExistingMembersRows(a0, a1, a2, a3, a4) { // fn#71052, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:4149, offset: 0x01d1324f, size: 71 bytes, params: 6, frame: 21
const env0_0 = a2;
const value3 = getExistingMembers(a0, a1, a2, a3, a4).map(function(a0) {
return getMemberRowData(a0, importDefault);
});
return value3.sort(sortMembers);
}
function getRowTypeLabel(a0, a1) { // fn#71054, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:4298, offset: 0x01d132b1, size: 498 bytes, params: 3, frame: 16
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const ROLE = RowType.ROLE;
if (ROLE === a0) {
return intl.string(t.ZxoFOG);
}
const OWNER = RowType.OWNER;
if (OWNER === a0) {
return intl.string(t.NWhYJg);
}
const ADMINISTRATOR = RowType.ADMINISTRATOR;
if (ADMINISTRATOR === a0) {
return intl.string(t['dwlcc+']);
}
const MEMBER = RowType.MEMBER;
if (MEMBER === a0) {
return a1 ? intl.string(t.UAJxZi) : null;
}
const USER = RowType.USER;
if (USER === a0) {
return intl.string(t.KD6OJJ);
}
const GUILD = RowType.GUILD;
if (GUILD === a0) {
return intl.string(t['5qyruI']);
}
const EMPTY_STATE = RowType.EMPTY_STATE;
if (EMPTY_STATE === a0) {
return null;
}
}
function getRemoveTooltipHint(a0) { // fn#71055, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:4762, offset: 0x01d134a3, size: 318 bytes, params: 2, frame: 15
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const ROLE = RowType.ROLE;
if (ROLE === a0) {
return intl.string(t['Gzc/a8']);
}
const OWNER = RowType.OWNER;
if (OWNER === a0) {
return intl.string(t.icuNBM);
}
const ADMINISTRATOR = RowType.ADMINISTRATOR;
if (ADMINISTRATOR === a0) {
return intl.string(t.eTmN5a);
}
const MEMBER = RowType.MEMBER;
if (MEMBER === a0) {
return intl.string(t['Gzc/a8']);
}
RowType.EMPTY_STATE;
return null;
}
function toggleChannelEveryonePermission(a0, a1, a2) { // fn#71056, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:5174, offset: 0x01d135e1, size: 80 bytes, params: 4, frame: 18
const value2 = flipEveryonePermission(a0, a1, a2);
const value = require(9089) /* metro dependency 9089: ChannelSettingsPermissionsActionCreators */;
value.updatePermission(a0, value2.id, value2.allow, value2.deny);
}
function grantUserChannelAccess(a0, a1) { // fn#71057, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:5333, offset: 0x01d13631, size: 296 bytes, params: 3, frame: 22
var permissionOverwrites;
var id;
var property;
var allow;
var deny;
var add;
var value3;
var updatePermission;
var object2;
var NONE;
var savePermissionUpdates;
var value;
const currentUser = UserStore.getCurrentUser();
if (currentUser != null) {
permissionOverwrites = a0.permissionOverwrites;
id = currentUser.id;
property = permissionOverwrites[id];
if (property == null) {
object2 = {};
id = currentUser.id;
object2.id = id;
object2.type = (require(1909) /* metro dependency 1909: Server */).PermissionOverwriteType.MEMBER;
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
add = value.add;
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
object2.allow = Reflect.apply(add, value, [NONE, a1]);
NONE = (importAll(3789) /* metro dependency 3789: PermissionUtils */).NONE;
object2.deny = NONE;
value = require(9089) /* metro dependency 9089: ChannelSettingsPermissionsActionCreators */;
savePermissionUpdates = value.savePermissionUpdates;
id = a0.id;
return Reflect.apply(savePermissionUpdates, value, [id, [object2], true]);
}
allow = property.allow;
deny = property.deny;
value3 = (importAll(483) /* metro dependency 483: BigFlagUtils */).add(allow, a1);
value = require(9089) /* metro dependency 9089: ChannelSettingsPermissionsActionCreators */;
updatePermission = value.updatePermission;
id = property.id;
return Reflect.apply(updatePermission, value, [a0, id, value3, deny]);
}
}
function isPrivateGuildChannel(a0, a1) { // fn#71058, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:5737, offset: 0x01d13759, size: 119 bytes, params: 3, frame: 16
var r0;
if (a0 == null) {
return false;
}
const property = a0.permissionOverwrites[a0.guild_id];
let value = undefined;
const r2 = (a1 == null ? value : a1[a0.guild_id]) == null ? property : a1[a0.guild_id];
const value2 = r2 != null;
if (value2) {
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
value = value.has(r2.deny, a0.accessPermissions);
r0 = value;
} else {
r0 = value2;
}
return r0;
}
function isPrivateTextChannel(a0) { // fn#71059, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:5971, offset: 0x01d137d0, size: 106 bytes, params: 2, frame: 15
var moduleValue;
const property = a0.permissionOverwrites[a0.guild_id];
let r0 = property != null && a0.type === ChannelTypes.GUILD_TEXT;
if (r0) {
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
r0 = moduleValue.has(property.deny, Permissions.VIEW_CHANNEL);
}
return r0;
}
function getPrivateChannelHintText(a0) { // fn#71061, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:6302, offset: 0x01d1389b, size: 264 bytes, params: 2, frame: 16
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const GUILD_TEXT = ChannelTypes.GUILD_TEXT;
if (GUILD_TEXT === a0) {
return intl.format(t.ZDtA0T, {});
}
const GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
if (GUILD_ANNOUNCEMENT === a0) {
return intl.format(t.ZDtA0T, {});
}
const GUILD_VOICE = ChannelTypes.GUILD_VOICE;
if (GUILD_VOICE === a0) {
return intl.format(t.iZAMty, {});
}
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
if (GUILD_CATEGORY === a0) {
return intl.format(t.PhnARV, {});
}
return null;
}
function extractPermissionOverwrites(a0, a1) { // fn#71062, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:6631, offset: 0x01d139a3, size: 57 bytes, params: 3, frame: 13
const env0_0 = a1;
const Object = global.Object;
Object.values(a0).forEach(_fun71063);
return [];
}
function _fun71025(a0) { // fn#71025, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1141, offset: 0x01d12a44, size: 73 bytes, params: 2, frame: 20
const value = environment.__proto__;
return isAdmin(a0) || !canAddPermissionInChannel(importDefault, a0.id, importAll, env0_2) && !isEveryoneRole(a0);
}
function _fun71027(a0) { // fn#71027, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:1275, offset: 0x01d12aba, size: 177 bytes, params: 2, frame: 21
var has;
var moduleValue;
var combine;
var permissions;
var property;
let value = environment.__proto__;
const isAdminBinding = isAdmin;
const value2 = undefined;
let r0 = isAdminBinding(a0) || !canAddPermissionInChannel(importDefault, a0.id, importAll,
env0_2) && !isEveryoneRole(a0);
if (!r0) {
value = importAll(483) /* metro dependency 483: BigFlagUtils */;
has = value.has;
moduleValue = importAll(483) /* metro dependency 483: BigFlagUtils */;
combine = moduleValue.combine;
permissions = a0.permissions;
property = importDefault.permissionOverwrites[a0.id];
value = Reflect.apply(has, value, [Reflect.apply(combine, moduleValue, [permissions,
property == null ? value2 : property.allow]), importAll]);
r0 = value;
}
return r0;
}
function _fun71033(a0) { // fn#71033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2151, offset: 0x01d12d66, size: 60 bytes, params: 2, frame: 20
const value = environment.__proto__;
const canAddPermissionInChannel2 = canAddPermissionInChannel(require, a0.id, importAll, env0_3);
return canAddPermissionInChannel2 ? isDefaultMember(a0, importDefault) : !canAddPermissionInChannel2;
}
function _fun71038(a0) { // fn#71038, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:2832, offset: 0x01d12f01, size: 87 bytes, params: 2, frame: 18
const value = environment.__proto__;
return !isAdmin(a0) && canAddPermissionInChannel(importDefault, a0.id,
importAll) && !isEveryoneRole(a0) && env0_2(a0.name);
}
function _fun71050(a0) { // fn#71050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:3922, offset: 0x01d131ba, size: 122 bytes, params: 2, frame: 19
var r1;
const value = environment.__proto__;
let r0 = !isGuildOwner(importDefault, a0) && canAddPermissionInChannel(require, a0.id, importAll);
if (r0) {
r1 = env0_3(getDisplayName_71028(a0, importDefault)) || env0_3(a0.username);
r1 = !r1 ? env0_3(a0.discriminator) : r1;
r0 = r1;
}
return r0;
}
function _fun71063({row}) { // fn#71063, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9273:6715, offset: 0x01d139dc, size: 214 bytes, params: 2, frame: 17
var rowType;
var binding;
var push;
let value = row.id != null;
if (value && row.id !== '') {
rowType = row.rowType;
value = environment.__proto__;
if (rowType === RowType.ROLE) {
binding = env0_1;
push = binding.push;
value = require(4800) /* metro dependency 4800: ChannelUtils */;
Reflect.apply(push, binding, [value.permissionOverwriteForRole(row.id, require)]);
} else if (row.rowType === RowType.MEMBER) {
binding = env0_1;
push = binding.push;
value = require(4800) /* metro dependency 4800: ChannelUtils */;
Reflect.apply(push, binding, [value.permissionOverwriteForUser(row.id, require)]);
}
}
}