/* Metro module 15859; source: modules/guild_settings/native/GuildSettingsModalLanding.tsx; dependencies: [31, 1935, 1867, 3784, 1878, 15860, 9113, 661, 33, 4863, 4501, 6238, 1244, 4068, 15861, 8931, 3789, 15863, 13467, 7950, 10976, 10315, 9097, 15865, 4056, 6231, 13142, 6699, 9409, 3860, 697, 1484, 566, 9112, 15866, 6850, 6858, 3856, 7972, 4572, 15211, 1423, 15867, 5462, 2] */
function _fun122020(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#122020, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:6, offset: 0x0255776e, size: 432 bytes, params: 8, frame: 20
const env0_0 = require;
const trackPaneViewed = function(a0, a1) {
var defaultImport = importDefault(dependencyMap[9]);
var SETTINGS_PANE_VIEWED = AnalyticEvents.SETTINGS_PANE_VIEWED;
defaultImport.trackWithMetadata(SETTINGS_PANE_VIEWED, {settings_type: 'guild', origin_pane: a1,
destination_pane: a0});
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importAll(31) /* metro dependency 31 */;
const guildChannelStore = importDefault(1935) /* metro dependency 1935: GuildChannelStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const guildSettingsModalChannelsStore = importDefault(15860) /* metro dependency 15860: GuildSettingsModalChannelsStore */;
const guildSettingsStore = importDefault(9113) /* metro dependency 9113: GuildSettingsStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_11 = value.GuildFeatures;
const env0_12 = value.GuildSettingsSections;
const env0_13 = value.ChannelTypes;
const env0_14 = value.AnalyticEvents;
value = require(33) /* metro dependency 33 */;
const env0_15 = value.jsx;
const env0_16 = value.jsxs;
const env0_17 = value.Fragment;
const pushRow = function(a0, a1) {
a1.push(a0);
};
const env0_19 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({container: {flex: 1},
containerContent: {paddingTop: 16}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_settings/native/GuildSettingsModalLanding.tsx');
exports.default = GuildSettingsModalLanding;
}
function SettingsSection({guild, isGuildAdmin, canManageGuild, canManageGuildExpressions, canManageChannels, canViewAuditLog, canManageWebhooks, canUnlinkChannelLobbies, canConfigureOfficialMessages, categories, pushScreen}) { // fn#122022, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:543, offset: 0x0255796a, size: 2077 bytes, params: 2, frame: 38
var pushRowBinding;
var object11;
var object13;
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
let object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object.label = Reflect.apply(string, intl, [t['/dp6yY']]);
object.arrow = true;
const TableRow2 = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
let Icon = TableRow2.Icon;
const CircleInformationIcon = (require(4068) /* metro dependency 4068: CircleInformationIcon */).CircleInformationIcon;
object.icon = ;
object.onPress = function() {
return pushScreen(GuildSettingsSections.OVERVIEW);
};
object = [];
const currentUser = UserStore.getCurrentUser();
if (canManageGuild) {
pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() {
return pushScreen(GuildSettingsSections.MODERATION);
}} key="moderation" />, object);
}
if (canViewAuditLog) {
pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() {
return pushScreen(GuildSettingsSections.AUDIT_LOG);
}} key="auditlogs" />, object);
}
if (canManageChannels || currentUser != null && (importAll(3789) /* metro dependency 3789: PermissionUtils */).canManageACategory(currentUser,
guild, categories)) {
pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() {
GuildSettingsModalChannelsStore.initGuild(guild.id);
pushScreen(GuildSettingsSections.CHANNELS);
}} key="channels" />, object);
}
let r12 = canManageGuild || canManageWebhooks;
r12 = !r12 ? canUnlinkChannelLobbies : r12;
if (r12) {
pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() {
return pushScreen(GuildSettingsSections.INTEGRATIONS);
}} key="integrations" />, object);
}
if (canManageGuildExpressions) {
pushRowBinding = pushRow;
var tableRowProps = {label: intl.string(t.sMOuuS), arrow: true};
Icon = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon;
tableRowProps.icon = ;
tableRowProps.onPress = function() {
return pushScreen(GuildSettingsSections.EMOJI);
};
pushRowBinding(, object);
pushRowBinding = pushRow;
var tableRowProps2 = {label: intl.string(t.R5nQkS), arrow: true};
Icon = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon;
tableRowProps2.icon = ;
tableRowProps2.onPress = onPress_122029;
pushRowBinding(, object);
}
if (canConfigureOfficialMessages) {
pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() {
return pushScreen(GuildSettingsSections.OFFICIAL_MESSAGES);
}} key="official-messages" />, object);
}
if (canManageGuild) {
pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() {
return pushScreen(GuildSettingsSections.SECURITY);
}} key="security" />, object);
}
if (isGuildAdmin && (require(15865) /* metro dependency 15865: GuildSettingsVanityURLUtils */).canSeeVanityUrlSettings(guild)) {
pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() {
return pushScreen(GuildSettingsSections.VANITY_URL);
}} key="vanity" />, object);
}
if (object.length === 0) {
return null;
} else {
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
return (
{object}
);
}
}
function CommunitySection({guild, pushScreen}) { // fn#122033, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:3062, offset: 0x025582c3, size: 427 bytes, params: 2, frame: 30
var tableRow;
const features = guild.features;
const has = features.has;
let COMMUNITY = GuildFeatures.COMMUNITY;
const value2 = Reflect.apply(has, features, [COMMUNITY]);
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
const object3 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object3.title = Reflect.apply(string, intl, [t['1g9A/f']]);
object3.hasIcons = true;
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
const object4 = {};
string = intl.string;
if (value2) {
object4.label = Reflect.apply(string, intl, [t.nRtNqn]);
object4.arrow = true;
object4.icon = ((Icon) => )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon);
object4.onPress = function() {
var pushScreenBinding = pushScreen;
var COMMUNITY = GuildSettingsSections.COMMUNITY;
return pushScreenBinding(COMMUNITY, {});
};
tableRow = ;
} else {
object4.label = Reflect.apply(string, intl, [t.ElKTeb]);
object4.arrow = true;
object4.icon = ((Icon) => )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon);
object4.onPress = onPress_122035;
tableRow = ;
}
return (
{tableRow}
);
}
function UserManagementSection({canManageGuild, canManageRoles, canManageBans, pushScreen}) { // fn#122036, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:3654, offset: 0x025584ae, size: 862 bytes, params: 2, frame: 29
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
let object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['9Oq93m']);
object.arrow = true;
const TableRow2 = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
const Icon = TableRow2.Icon;
const GroupIcon = (require(6699) /* metro dependency 6699: GroupIcon */).GroupIcon;
object.icon = ;
object.onPress = function() {
return pushScreen(GuildSettingsSections.MEMBERS);
};
object = [];
if (canManageRoles) {
pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() {
return pushScreen(GuildSettingsSections.ROLES);
}} key="roles" />, object);
}
if (canManageGuild) {
pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() {
return pushScreen(GuildSettingsSections.INSTANT_INVITES);
}} key="invites" />, object);
}
if (canManageBans) {
pushRow( )((require(6238) /* metro dependency 6238: TableRowNative */).TableRow.Icon)} onPress={function() {
return pushScreen(GuildSettingsSections.BANS);
}} key="bans" />, object);
}
if (object.length === 0) {
return null;
} else {
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
return (
{object}
);
}
}
function GuildSettingsModalLandingInner({guild, contentContainerStyle, updateErrors}) { // fn#122041, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:4651, offset: 0x02558880, size: 998 bytes, params: 2, frame: 41
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const TABLE_ROW_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.TABLE_ROW_PADDING;
const value2 = Reflect.apply(useToken, useTokenModule, [TABLE_ROW_PADDING]);
const styles = useStyles();
let value3 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
let value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildChannelStore], function() {
var property = GuildChannelStore.getChannels;
var guildBinding = guild;
var value3 = undefined;
var value4 = Reflect.apply(property, GuildChannelStore, [guildBinding == null ? value3 : guild.id]);
return value4 == null ? value3 : value4[ChannelTypes.GUILD_CATEGORY];
});
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([PermissionStore],
function() {
return PermissionStore.getGuildPermissionProps(guild);
});
env0_4.useEffect(function() {
trackPaneViewed(GuildSettingsSections.LANDING);
}, []);
const value6 = env0_4.useCallback(_fun122045, [value3]);
const isGuildAdmin = value5.isGuildAdmin;
const canManageGuild = value5.canManageGuild;
const canManageRoles = value5.canManageRoles;
const canManageBans = value5.canManageBans;
const canManageGuildExpressions = value5.canManageGuildExpressions;
const canManageChannels = value5.canManageChannels;
const canViewAuditLog = value5.canViewAuditLog;
const canManageWebhooks = value5.canManageWebhooks;
const useChannelsAllowedToUnlinkModule = require(15866) /* metro dependency 15866: useChannelsAllowedToUnlink */;
const useChannelsAllowedToUnlink = useChannelsAllowedToUnlinkModule.useChannelsAllowedToUnlink;
const value7 = Reflect.apply(useChannelsAllowedToUnlink, useChannelsAllowedToUnlinkModule, [guild.id]).length > 0;
const value8 = (require(6850) /* metro dependency 6850: GuildRoleSubscriptionSettingUtils */).useCanManageGuildRoleSubscriptions(guild);
const r21 = canManageGuild && (require(6858) /* metro dependency 6858: GuildOfficialMessageUtils */).isGuildOfficialMessagesEnabled(guild,
'GuildSettingsModalLanding');
env0_4.useLayoutEffect(_fun122046, [updateErrors.message]);
const jsxRuntimeEnv0_17Binding = jsxRuntimeEnv0_17;
const Form = (require(7972) /* metro dependency 7972: native */).Form;
const items3 = [styles.containerContent, contentContainerStyle];
const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
const object = {paddingHorizontal: value2};
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
const items2 = [((Component) => )(importDefault(15211) /* metro dependency 15211: IconLabelBlock */)];
items2[1] = ;
items2[2] = canManageGuild && ;
items2[3] = value8 && ((Component) => )(importDefault(15867) /* metro dependency 15867: GuildSettingsRoleSubscriptionsSection */);
items2[4] = ;
const form = ;
const NavScrim = (require(5462) /* metro dependency 5462: NavScrimAndroid */).NavScrim;
return (
<>
{form}
>
);
}
function GuildSettingsModalLanding({guildId, contentContainerStyle}) { // fn#122050, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:6633, offset: 0x02558e30, size: 167 bytes, params: 2, frame: 21
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
return GuildStore.getGuild(guildId);
});
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStoresObject = fluxModule.useStateFromStoresObject;
return guild == null ? null : ;
}
function SettingsSectionOnPress_122029() { // fn#122029, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:2262, owner: SettingsSection.onPress, offset: 0x0255824f, size: 29 bytes, params: 1, frame: 11
const pushScreenBinding = pushScreen;
const STICKERS = GuildSettingsSections.STICKERS;
return pushScreenBinding(STICKERS);
}
function CommunitySectionOnPress_122035() { // fn#122035, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:3604, owner: CommunitySection.onPress, offset: 0x0255848e, size: 32 bytes, params: 1, frame: 13
const pushScreenBinding = pushScreen;
const COMMUNITY_INTRO = GuildSettingsSections.COMMUNITY_INTRO;
return pushScreenBinding(COMMUNITY_INTRO, {});
}
function _fun122045(a0) { // fn#122045, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:5117, offset: 0x02558ce1, size: 111 bytes, params: 2, frame: 18
const value = copyRestArgs(0, undefined);
const property = value[0];
(importDefault(9112) /* metro dependency 9112: GuildSettingsActionCreators */).setSection(property);
const binding = env0_2;
const push = binding.push;
const items2 = [];
arraySpread(items2, value, 0, 0);
apply(push, items2, binding, 0);
const trackPaneViewedBinding = trackPaneViewed;
const LANDING = GuildSettingsSections.LANDING;
trackPaneViewedBinding(property, LANDING);
}
function _fun122046() { // fn#122046, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:5580, offset: 0x02558d50, size: 67 bytes, params: 1, frame: 12
var value2;
var moduleValue;
if (updateErrors.message != null) {
value2 = environment.__proto__;
moduleValue = require(3856) /* metro dependency 3856: ToastUtils */;
moduleValue.presentError(updateErrors.message);
}
}
function onUpload(a0) { // fn#122047, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:5871, owner: GuildSettingsModalLandingInner.onUpload, offset: 0x02558d93, size: 54 bytes, params: 2, frame: 14
let value = environment.__proto__;
value = importDefault(9112) /* metro dependency 9112: GuildSettingsActionCreators */;
value.updateIcon(guild.id, a0);
}
function GuildSettingsModalLandingInnerMakeURL(a0) { // fn#122048, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16067:5949, owner: GuildSettingsModalLandingInner.makeURL, offset: 0x02558dc9, size: 83 bytes, params: 2, frame: 14
var r0;
var value2;
let value = a0;
if (value) {
value2 = environment.__proto__;
value = (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGuildIconURL({id: guild.id,
icon: value,
canAnimate: true, size: 64});
r0 = value;
} else {
r0 = value;
}
return r0;
}