decord/source/modules/guild_settings/native/GuildSettingsModalChannels.tsx

775 lines
32 KiB
TypeScript
Raw Normal View History

2026-08-27 16:17:25 +00:00
// Module ID: 15646
// Function ID: 15647
2026-07-29 08:29:29 +00:00
// Name: ChannelItem
2026-08-27 16:17:25 +00:00
// Dependencies: [19, 17, 1391, 1910, 4089, 4098, 1922, 15644, 676, 21, 4445, 5413, 712, 1913, 4172, 1236, 1363, 688, 8295, 1297, 15647, 589, 4933, 4639, 5020, 1629, 4880, 5938, 9627, 9302, 6189, 4094, 15648, 15649, 5891, 8677, 15650, 15645, 11291, 14841, 10225, 5409, 4809, 1500, 38, 4887, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-27 16:17:25 +00:00
// Module 15646 (ChannelItem)
2026-08-24 06:08:38 +00:00
import initialize from "initialize" /* 589 */;
import ThemesDefault from "Themes" /* 712 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
import Button from "Button" /* 1297 */;
import useNavigation from "useNavigation" /* 1500 */;
2026-08-26 06:04:24 +00:00
import applyOverwritesAll from "applyOverwrites" /* 4094 */;
2026-08-27 16:17:25 +00:00
import getFontScale from "getFontScale" /* 4887 */;
import PressableBase from "PressableBase" /* 5020 */;
import init from "init" /* 8677 */;
2026-08-24 06:08:38 +00:00
import importAllResult from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
import closure_7 from "ensureGuildLoaded" /* 1391 */;
import closure_8 from "createGuildRecordFromRust" /* 1910 */;
2026-08-26 06:04:24 +00:00
import closure_9 from "getUncachedChannelPermissions" /* 4089 */;
import closure_10 from "markAllUserIdListsStale" /* 4098 */;
2026-08-24 06:08:38 +00:00
import closure_11 from "mergeGuildAvatar" /* 1922 */;
2026-08-27 16:17:25 +00:00
import closure_12 from "sortCategoryList" /* 15644 */;
2026-08-24 06:08:38 +00:00
import ME from "ME" /* 676 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-27 16:17:25 +00:00
import createCacheKey from "createCacheKey" /* 4445 */;
import importDefaultResult from "createTextStyle" /* 5413 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-08-07 06:50:47 +00:00
function ChannelItem(isFavoritesGuild) {
({ channelIconStyle, channel } = isFavoritesGuild);
isFavoritesGuild = isFavoritesGuild.isFavoritesGuild;
({ sortingEnabled, onPress: importAll, sortHandlers } = isFavoritesGuild);
({ style, actionIconStyle } = isFavoritesGuild);
2026-08-27 16:17:25 +00:00
let obj = channel(4445);
2026-08-24 06:08:38 +00:00
const legacyClassComponentStyles = obj.useLegacyClassComponentStyles(closure_18);
obj1 = channel(1363);
2026-07-29 08:29:29 +00:00
let obj2 = channel(589);
2026-08-24 06:08:38 +00:00
const items = [closure_9];
2026-08-07 06:50:47 +00:00
const items1 = [channel, isFavoritesGuild];
2026-07-20 16:05:17 +00:00
const stateFromStores = obj2.useStateFromStores(items, () => {
2026-08-07 06:50:47 +00:00
if (isFavoritesGuild) {
return isFavoritesGuild;
2026-07-20 16:05:17 +00:00
} else {
2026-08-07 06:50:47 +00:00
let guild_id = channel;
if (null == channel.parent_id) {
let obj = { guildId: null };
guild_id = guild_id.guild_id;
obj[0] = guild_id;
2026-08-24 06:08:38 +00:00
let result = closure_1_9.canWithPartialContext(closure_1_14.MANAGE_CHANNELS, obj);
2026-08-07 06:50:47 +00:00
} else {
obj = { channelId: null };
obj[0] = guild_id.parent_id;
2026-08-24 06:08:38 +00:00
result = closure_1_9.canWithPartialContext(closure_1_14.MANAGE_CHANNELS, obj);
2026-08-07 06:50:47 +00:00
}
2026-07-20 16:05:17 +00:00
}
}, items1);
2026-08-27 16:17:25 +00:00
let tmpResult = tmp(4933);
2026-07-29 08:29:29 +00:00
const channelIcon = tmpResult.getChannelIcon(channel);
2026-08-27 16:17:25 +00:00
tmpResult = tmp(4933);
2026-07-29 08:29:29 +00:00
const channelIconComponent = tmpResult.getChannelIconComponent(channel);
const tmp8 = closure_6;
2026-08-11 06:20:06 +00:00
const tmpResult1 = channel(1363);
const isThemeDarkResult = channel(1363).isThemeDark(obj1.useThemeContext().theme);
2026-07-29 08:29:29 +00:00
const hex2rgb = channel(688).hex2rgb;
2026-08-07 06:50:47 +00:00
const unsafe_rawColors = isFavoritesGuild(712).unsafe_rawColors;
2026-07-20 16:05:17 +00:00
if (isThemeDarkResult) {
let hex2rgbResult = hex2rgb(unsafe_rawColors.PRIMARY_700, 0.6);
2026-07-29 08:29:29 +00:00
let tmp13 = tmp11;
2026-07-20 16:05:17 +00:00
} else {
hex2rgbResult = hex2rgb(unsafe_rawColors.PRIMARY_200, 0.6);
2026-07-29 08:29:29 +00:00
tmp13 = tmp11;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { accessibilityRole: "button", underlayColor: hex2rgbResult, style };
2026-07-20 16:05:17 +00:00
const merged = Object.assign(sortHandlers);
2026-07-29 08:29:29 +00:00
obj = null;
2026-07-20 16:05:17 +00:00
if (sortingEnabled) {
2026-07-29 08:29:29 +00:00
obj = null;
2026-07-20 16:05:17 +00:00
if (!stateFromStores) {
2026-07-29 08:29:29 +00:00
obj = { opacity: 0.3 };
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj1 = { style: obj, children: null };
2026-07-20 16:05:17 +00:00
if (null != channelIconComponent) {
2026-07-29 08:29:29 +00:00
obj2 = { style: null, size: "sm" };
obj2[0] = channelIconStyle;
let tmp7Result = tmp7(channelIconComponent, obj2);
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
const obj3 = { size: null, source: null, style: null };
obj3[0] = tmp(1297).Icon.Sizes.SMALL_20;
obj3[1] = channelIcon;
obj3[2] = channelIconStyle;
2026-08-27 16:17:25 +00:00
tmp7Result = tmp7(tmp(8295).FormRow.Icon, obj3);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
const obj4 = { leading: tmp7Result, style: legacyClassComponentStyles.formRowStyle, label: null, onPress: null, trailing: null, numberOfLines: null };
const tmp15 = closure_5;
const tmpResult2 = channel(688);
2026-08-27 16:17:25 +00:00
obj4[2] = channel(4639).computeChannelName(channel, closure_11, closure_10);
2026-07-20 16:05:17 +00:00
let fn;
if (!sortingEnabled) {
fn = () => callback(channel.id);
}
2026-07-29 08:29:29 +00:00
obj4[3] = fn;
tmp7Result = null;
2026-07-20 16:05:17 +00:00
if (stateFromStores) {
2026-07-29 08:29:29 +00:00
tmp7Result = null;
2026-07-20 16:05:17 +00:00
if (sortingEnabled) {
2026-07-29 08:29:29 +00:00
const obj5 = { source: null, style: null };
2026-08-27 16:17:25 +00:00
obj5[0] = tmp13(15647);
2026-07-29 08:29:29 +00:00
obj5[1] = actionIconStyle;
2026-08-27 16:17:25 +00:00
tmp7Result = tmp7(tmp(8295).FormRow.Icon, obj5);
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj4[4] = tmp7Result;
let num3;
2026-07-20 16:05:17 +00:00
if (sortingEnabled) {
2026-07-29 08:29:29 +00:00
num3 = 1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj4[5] = num3;
2026-08-27 16:17:25 +00:00
obj1[1] = closure_16(channel(8295).FormRow, obj4);
2026-07-29 08:29:29 +00:00
obj.children = closure_16(tmp15, obj1);
return closure_16(tmp8, obj);
2026-07-20 16:05:17 +00:00
}
function CreateButton(guild) {
guild = guild.guild;
2026-07-29 08:29:29 +00:00
let bottom;
2026-08-27 16:17:25 +00:00
let obj = guild(4445);
2026-08-24 06:08:38 +00:00
const legacyClassComponentStyles = obj.useLegacyClassComponentStyles(closure_18);
2026-08-15 05:55:55 +00:00
bottom = bottom(1629)().bottom;
2026-07-23 10:11:24 +00:00
let items = [bottom];
2026-07-20 16:05:17 +00:00
const memo = importAllResult.useMemo(() => ({ bottom: 16 + bottom }), items);
2026-07-29 08:29:29 +00:00
let tmp5 = null;
2026-08-24 06:08:38 +00:00
if (closure_9.can(constants.MANAGE_CHANNELS, guild)) {
2026-07-29 08:29:29 +00:00
obj = { style: null, children: null };
2026-07-20 16:05:17 +00:00
const items1 = [legacyClassComponentStyles.floatingActionButtonContainer, memo];
2026-07-29 08:29:29 +00:00
obj[0] = items1;
obj = { text: null, onPress: null, icon: null };
let intl = tmp(1236).intl;
obj[0] = intl.string(tmp(1236).t.CumH4u);
obj[1] = function onPress() {
2026-08-24 06:08:38 +00:00
let obj = guild(closure_1_3[27]);
2026-07-29 08:29:29 +00:00
obj = { key: "GuildSettingsChannelsCreate", header: null, options: null, hasIcons: false };
obj = { title: null };
2026-08-24 06:08:38 +00:00
const intl = guild(closure_1_3[15]).intl;
obj[0] = intl.string(guild(closure_1_3[15]).t.CumH4u);
2026-07-29 08:29:29 +00:00
obj[1] = obj;
2026-08-24 06:08:38 +00:00
obj1 = { label: null, onPress: null };
const intl2 = guild(closure_1_3[15]).intl;
obj1[0] = intl2.string(guild(closure_1_3[15]).t.vHCZwr);
2026-07-29 08:29:29 +00:00
obj1[1] = function onPress() {
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_3[28]).open(closure_1_13.GUILD_CATEGORY, user.id, null, null);
2026-07-20 16:05:17 +00:00
};
const items = [obj1, ];
2026-07-29 08:29:29 +00:00
const obj2 = { label: null, onPress: null };
2026-08-24 06:08:38 +00:00
const intl3 = guild(closure_1_3[15]).intl;
obj2[0] = intl3.string(guild(closure_1_3[15]).t.GK18KJ);
2026-07-29 08:29:29 +00:00
obj2[1] = function onPress() {
2026-08-24 06:08:38 +00:00
closure_1_1(closure_1_3[28]).open(null, user.id, null, null);
2026-07-20 16:05:17 +00:00
};
items[1] = obj2;
2026-07-29 08:29:29 +00:00
obj[2] = items;
2026-07-20 16:05:17 +00:00
const result = obj.showSimpleActionSheet(obj);
};
2026-08-27 16:17:25 +00:00
obj[2] = callback(tmp(9302).PlusSmallIcon, { color: "white" });
obj[1] = callback(tmp(4880).Button, obj);
2026-07-29 08:29:29 +00:00
tmp5 = callback(closure_5, obj);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp5;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let c4 = importAllResult;
({ View: c5, TouchableHighlight: closure_6, StyleSheet } = get_ActivityIndicator);
({ ChannelTypes: map1, Permissions: closure_14, Fonts, NULL_STRING_CHANNEL_ID: closure_15 } = ME);
({ jsx: closure_16, jsxs: closure_17 } = jsxProd);
createCacheKey = { headerRight: null, containerView: null, categoryText: null, categoryView: null, sortingCategoryView: null, edit: null, row: null, formRowStyle: null, dropHighlight: null, floatingActionButtonContainer: null };
createCacheKey = {};
2026-08-24 06:08:38 +00:00
let merged = Object.assign(importDefaultResult(Fonts.PRIMARY_SEMIBOLD, ThemesDefault.colors.MOBILE_TEXT_HEADING_PRIMARY, 16));
2026-07-29 08:29:29 +00:00
createCacheKey.textTransform = "capitalize";
createCacheKey[0] = createCacheKey;
2026-08-24 06:08:38 +00:00
createCacheKey[1] = { flex: 1, backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOW };
let obj1 = { flex: 1, backgroundColor: ThemesDefault.colors.BACKGROUND_BASE_LOW };
2026-07-23 10:11:24 +00:00
let obj2 = {};
2026-08-24 06:08:38 +00:00
const merged1 = Object.assign(importDefaultResult(Fonts.DISPLAY_EXTRABOLD, ThemesDefault.colors.TEXT_SUBTLE, 12, { uppercase: true }));
2026-07-29 08:29:29 +00:00
createCacheKey[2] = obj2;
createCacheKey[3] = { paddingTop: 36, paddingBottom: 8 };
createCacheKey[4] = { paddingTop: 16 };
2026-08-24 06:08:38 +00:00
const importDefaultResult1 = importDefaultResult;
2026-07-29 08:29:29 +00:00
let obj3 = {};
2026-08-24 06:08:38 +00:00
const merged2 = Object.assign(importDefaultResult(Fonts.PRIMARY_SEMIBOLD, ThemesDefault.colors.TEXT_SUBTLE, 14));
2026-07-29 08:29:29 +00:00
createCacheKey[5] = obj3;
createCacheKey[6] = { marginTop: -StyleSheet.hairlineWidth };
createCacheKey[7] = { paddingVertical: 12 };
2026-08-24 06:08:38 +00:00
const importDefaultResult2 = importDefaultResult;
createCacheKey[8] = { backgroundColor: ThemesDefault.unsafe_rawColors.GREEN_360, opacity: 0.3 };
2026-07-29 08:29:29 +00:00
createCacheKey[9] = { position: "absolute", bottom: 16, right: 0, left: 0, flexDirection: "row", justifyContent: "center" };
2026-08-24 06:08:38 +00:00
let closure_18 = createCacheKey.createLegacyClassComponentStyles(createCacheKey);
2026-07-29 08:29:29 +00:00
const PureComponent = importAllResult.PureComponent;
class Category extends PureComponent {
}
Category.prototype["render"] = function render() {
const self = this;
2026-08-24 06:08:38 +00:00
let tmp = callback2(this.context);
2026-07-29 08:29:29 +00:00
const props = this.props;
const category = props.category;
const onPress = props.onPress;
const sortingEnabled = props.sortingEnabled;
let sortHandlers = null;
({ editStyle, actionIconStyle } = props);
if (sortingEnabled) {
sortHandlers = self.props.sortHandlers;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = { accessibilityRole: "button", accessibilityActions: null, onAccessibilityAction: null, underlayColor: null };
obj = { name: "activate", label: null };
const intl = category(1236).intl;
obj[1] = intl.string(category(1236).t.bt75uw);
const items = [obj];
obj[1] = items;
obj[2] = function onAccessibilityAction(nativeEvent) {
let tmp;
if ("activate" === nativeEvent.nativeEvent.actionName) {
let tmp2Result;
if (onPress != null) {
tmp2Result = tmp2(category.id);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
tmp = tmp2Result;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
return tmp;
};
2026-08-11 06:20:06 +00:00
let obj2 = category(1363);
2026-07-29 08:29:29 +00:00
const isThemeDarkResult = obj2.isThemeDark(self.context.theme);
const tmp4 = closure_6;
const hex2rgb = category(688).hex2rgb;
const unsafe_rawColors = onPress(712).unsafe_rawColors;
if (isThemeDarkResult) {
let hex2rgbResult = hex2rgb(unsafe_rawColors.PRIMARY_700, 0.6);
let tmp11 = tmp9;
} else {
hex2rgbResult = hex2rgb(unsafe_rawColors.PRIMARY_200, 0.6);
tmp11 = tmp9;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = hex2rgbResult;
const merged = Object.assign(sortHandlers);
obj = { title: category.name, numberOfLines: 1, textStyle: tmp.categoryText, viewStyle: null, icon: null };
const items1 = [tmp.categoryView, ];
let sortingCategoryView = null;
if (sortingEnabled) {
sortingCategoryView = tmp.sortingCategoryView;
}
items1[1] = sortingCategoryView;
obj[3] = items1;
if (null != onPress) {
2026-08-24 06:08:38 +00:00
obj1 = { style: null, onPress: null };
2026-07-29 08:29:29 +00:00
obj1[0] = editStyle;
obj1[1] = function onPress() {
return onPress(category.id);
};
let tmp3Result = tmp3(SectionEditAction, obj1);
} else {
tmp3Result = null;
if (null != sortHandlers) {
obj2 = { source: null, style: null };
2026-08-27 16:17:25 +00:00
obj2[0] = tmp11(15647);
2026-07-29 08:29:29 +00:00
obj2[1] = actionIconStyle;
tmp3Result = tmp3(tmp5(1297).Icon, obj2);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
const tmp13 = closure_5;
const tmp8 = category(688);
obj[4] = tmp3Result;
2026-08-27 16:17:25 +00:00
obj.children = closure_16(tmp13, { children: closure_16(category(8295).FormTitle, obj) });
2026-07-29 08:29:29 +00:00
return closure_16(tmp4, obj);
};
Category.contextType = require("ManaContext").ThemeContext;
const PureComponent2 = importAllResult.PureComponent;
class SectionEditAction extends PureComponent2 {
}
SectionEditAction.prototype["render"] = function render() {
({ style, onPress } = this.props);
let obj = { accessibilityRole: "button", onPress, children: null };
obj = { style, children: null };
2026-08-24 06:08:38 +00:00
const intl = getSystemLocale.intl;
obj[1] = intl.string(getSystemLocale.t.bt75uw);
obj[2] = callback(Button.LegacyText, obj);
return callback(PressableBase.PressableOpacity, obj);
2026-07-29 08:29:29 +00:00
};
SectionEditAction.contextType = require("ManaContext").ThemeContext;
const PureComponent3 = importAllResult.PureComponent;
class GuildSettingsModalChannels extends PureComponent3 {
constructor() {
applyArgumentsResult = HermesBuiltin.applyArguments(new.target, new.target);
closure_0 = applyArgumentsResult;
applyArgumentsResult.state = { hovering: null };
applyArgumentsResult.renderActiveDivider = function renderActiveDivider(arg0, id, id) {
const props = applyArgumentsResult.props;
2026-08-07 06:50:47 +00:00
({ order, channelList, guild } = props);
2026-07-29 08:29:29 +00:00
if (null != props.sortingType) {
if (null != order) {
if (null != channelList) {
2026-08-24 06:08:38 +00:00
const localChannel = closure_1_12.getLocalChannel(id);
2026-07-29 08:29:29 +00:00
let localChannel1 = null;
if (null != id) {
2026-08-24 06:08:38 +00:00
localChannel1 = closure_1_12.getLocalChannel(id);
2026-07-29 08:29:29 +00:00
}
let num = -1;
if (null != id) {
num = order.indexOf(id);
}
const index = order.indexOf(id);
2026-08-24 06:08:38 +00:00
let obj = applyArgumentsResult(closure_1_3[32]);
2026-07-29 08:29:29 +00:00
const dropData = obj.getDropData(localChannel1, num, localChannel, index, channelList);
2026-08-07 06:50:47 +00:00
let tmp12 = null != dropData;
if (tmp12) {
2026-08-24 06:08:38 +00:00
const isFavoritesGuildIdResult = applyArgumentsResult(closure_1_3[13]).isFavoritesGuildId(guild.id);
2026-08-07 06:50:47 +00:00
if (isFavoritesGuildIdResult) {
tmp12 = isFavoritesGuildIdResult;
} else if (null == dropData.parentId) {
2026-08-24 06:08:38 +00:00
let canResult = closure_1_9.can(closure_1_14.MANAGE_CHANNELS, guild);
2026-08-07 06:50:47 +00:00
} else {
2026-08-24 06:08:38 +00:00
canResult = closure_1_9.can(closure_1_14.MANAGE_CHANNELS, closure_1_7.getChannel(dropData.parentId));
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
const tmp4Result = applyArgumentsResult(closure_1_3[13]);
2026-08-07 06:50:47 +00:00
}
let tmp21 = null;
if (tmp12) {
obj = { style: null };
const items = [tmp.dropHighlight, ];
obj = { height: null };
obj[0] = arg0;
items[1] = obj;
obj[0] = items;
2026-08-24 06:08:38 +00:00
tmp21 = closure_1_16(closure_1_5, obj);
2026-07-20 16:05:17 +00:00
}
2026-08-07 06:50:47 +00:00
return tmp21;
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
}
return null;
};
applyArgumentsResult.renderSectionHeader = function renderSectionHeader(section) {
const id = section.section.category.id;
const props = applyArgumentsResult.props;
const sortingType = props.sortingType;
let localChannel = null;
if ("null" !== id) {
2026-08-24 06:08:38 +00:00
localChannel = closure_1_12.getLocalChannel(id);
2026-07-29 08:29:29 +00:00
}
if (null != localChannel) {
let obj = { category: null, sortingEnabled: null, editStyle: null, onPress: null };
obj[0] = localChannel;
let hasItem = null != sortingType;
if (hasItem) {
2026-08-24 06:08:38 +00:00
hasItem = sortingType.has(closure_1_13.GUILD_CATEGORY);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = hasItem;
obj[2] = tmp2.edit;
let handleChannelPress;
if (null == sortingType) {
handleChannelPress = applyArgumentsResult.handleChannelPress;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[3] = handleChannelPress;
2026-08-24 06:08:38 +00:00
let tmp5Result = closure_1_16(closure_1_19, obj);
const tmp8 = closure_1_16;
const tmp9 = closure_1_19;
2026-07-29 08:29:29 +00:00
} else {
obj = null;
if (null == sortingType) {
obj = null;
if (props.channels.null.length > 0) {
obj = { marginTop: 36 };
}
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj = { style: null };
obj[0] = obj;
2026-08-24 06:08:38 +00:00
tmp5Result = closure_1_16(closure_1_5, obj);
const tmp5 = closure_1_16;
const tmp6 = closure_1_5;
2026-07-29 08:29:29 +00:00
}
return tmp5Result;
};
applyArgumentsResult.renderItem = function renderItem(item) {
item = item.item;
const channel = item.channel;
if (null != channel) {
2026-08-07 06:50:47 +00:00
const obj = { channel: null, isFavoritesGuild: null, sortingEnabled: null, onPress: null, style: null };
2026-07-29 08:29:29 +00:00
obj[0] = channel;
2026-08-24 06:08:38 +00:00
obj[1] = applyArgumentsResult(closure_1_3[13]).isFavoritesGuildId(tmp.props.guild.id);
2026-08-07 06:50:47 +00:00
obj[2] = null != item.sortingType;
obj[3] = tmp.handleChannelPress;
obj[4] = tmp2.row;
2026-08-24 06:08:38 +00:00
let tmp5 = closure_1_16(closure_1_20, obj);
const obj2 = applyArgumentsResult(closure_1_3[13]);
2026-07-29 08:29:29 +00:00
} else {
2026-08-24 06:08:38 +00:00
tmp5 = closure_1_16(closure_1_5, {});
2026-07-29 08:29:29 +00:00
}
return tmp5;
};
applyArgumentsResult.handleHoverChange = function handleHoverChange(hovering) {
applyArgumentsResult.setState({ hovering });
};
applyArgumentsResult.handleSortStart = function handleSortStart() {
const items = [];
2026-08-24 06:08:38 +00:00
if (closure_1_9.can(closure_1_14.MANAGE_CHANNELS, applyArgumentsResult.props.guild)) {
2026-07-29 08:29:29 +00:00
let obj = { label: null, icon: null, onPress: null };
2026-08-24 06:08:38 +00:00
const intl = applyArgumentsResult(closure_1_3[15]).intl;
obj[0] = intl.string(applyArgumentsResult(closure_1_3[15]).t.ffgJrs);
obj[1] = closure_1_1(closure_1_3[36]);
2026-07-29 08:29:29 +00:00
obj[2] = function onPress() {
2026-08-27 16:17:25 +00:00
callback(15645).startReordering(constants.GUILD_CATEGORY);
2026-07-20 16:05:17 +00:00
};
items.push(obj);
2026-07-29 08:29:29 +00:00
}
obj = { label: null, icon: null, onPress: null };
2026-08-24 06:08:38 +00:00
const intl2 = applyArgumentsResult(closure_1_3[15]).intl;
obj[0] = intl2.string(applyArgumentsResult(closure_1_3[15]).t.nIfr0Y);
obj[1] = closure_1_1(closure_1_3[38]);
2026-07-29 08:29:29 +00:00
obj[2] = function onPress() {
2026-08-27 16:17:25 +00:00
callback(15645).startReordering(constants.GUILD_TEXT, constants.GUILD_ANNOUNCEMENT, constants.GUILD_FORUM, constants.GUILD_MEDIA);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
items.push(obj);
obj = { label: null, icon: null, onPress: null };
2026-08-24 06:08:38 +00:00
const intl3 = applyArgumentsResult(closure_1_3[15]).intl;
obj[0] = intl3.string(applyArgumentsResult(closure_1_3[15]).t.CYnO4s);
obj[1] = closure_1_1(closure_1_3[39]);
2026-07-29 08:29:29 +00:00
obj[2] = function onPress() {
2026-08-27 16:17:25 +00:00
callback(15645).startReordering(constants.GUILD_VOICE, constants.GUILD_STAGE_VOICE);
2026-07-29 08:29:29 +00:00
};
items.push(obj);
2026-08-24 06:08:38 +00:00
obj1 = { key: "GuildSettingsChannelsSort", header: null, options: null, hasIcons: true };
2026-07-29 08:29:29 +00:00
const obj2 = { title: null };
2026-08-24 06:08:38 +00:00
const intl4 = applyArgumentsResult(closure_1_3[15]).intl;
obj2[0] = intl4.string(applyArgumentsResult(closure_1_3[15]).t["0dOFq+"]);
2026-07-29 08:29:29 +00:00
obj1[1] = obj2;
obj1[2] = items;
2026-08-24 06:08:38 +00:00
const result = applyArgumentsResult(closure_1_3[27]).showSimpleActionSheet(obj1);
2026-07-29 08:29:29 +00:00
};
applyArgumentsResult.handleDrop = function handleDrop(arg0) {
const props = guild.props;
({ order, channels, guild } = props);
2026-08-24 06:08:38 +00:00
let obj = closure_1_12;
const localChannel = closure_1_12.getLocalChannel(order[arg0.from]);
const localChannel1 = closure_1_12.getLocalChannel(order[arg0.to]);
const dropData = applyArgumentsResult(closure_1_3[32]).getDropData(localChannel, arg0.from, localChannel1, arg0.to, props.channelList);
2026-07-29 08:29:29 +00:00
if (null != dropData) {
if (localChannel1 !== localChannel) {
if (null != localChannel) {
if (null != localChannel1) {
2026-08-07 06:50:47 +00:00
let tmp14 = null != dropData;
if (tmp14) {
let tmp3Result = tmp3(tmp4[13]);
const isFavoritesGuildIdResult = tmp3Result.isFavoritesGuildId(guild.id);
if (isFavoritesGuildIdResult) {
tmp14 = isFavoritesGuildIdResult;
} else if (null == dropData.parentId) {
2026-08-24 06:08:38 +00:00
let canResult = closure_1_9.can(closure_1_14.MANAGE_CHANNELS, guild);
2026-08-07 06:50:47 +00:00
} else {
2026-08-24 06:08:38 +00:00
canResult = closure_1_9.can(closure_1_14.MANAGE_CHANNELS, closure_1_7.getChannel(dropData.parentId));
2026-08-07 06:50:47 +00:00
}
}
if (tmp14) {
const referenceId = dropData.referenceId;
tmp3Result = tmp3(tmp4[32]);
let localChannel2 = null;
if (null != referenceId) {
localChannel2 = obj.getLocalChannel(referenceId);
}
const dnDUpdates = tmp3Result.getDnDUpdates(localChannel, localChannel2, dropData.parentId, channels);
if (tmp3Result1.isFavoritesGuildId(guild.id)) {
2026-08-24 06:08:38 +00:00
closure_1_1(tmp4[37]).localChannelUpdate(dnDUpdates);
const obj13 = closure_1_1(tmp4[37]);
2026-08-07 06:50:47 +00:00
const result = tmp3(tmp4[40]).updateFavoriteChannels(dnDUpdates);
} else {
2026-07-20 16:05:17 +00:00
const found = dnDUpdates.filter((id) => {
2026-08-24 06:08:38 +00:00
const channel = closure_1_7.getChannel(id.id);
2026-07-20 16:05:17 +00:00
if (null == channel) {
return false;
} else {
2026-08-24 06:08:38 +00:00
const channel1 = closure_1_7.getChannel(channel.parent_id);
if (channel.type !== closure_1_13.GUILD_CATEGORY) {
2026-07-20 16:05:17 +00:00
if (null != channel1) {
2026-08-24 06:08:38 +00:00
let canResult = closure_1_9.can(closure_1_14.MANAGE_CHANNELS, channel1);
2026-07-20 16:05:17 +00:00
}
return canResult;
}
2026-08-24 06:08:38 +00:00
canResult = closure_1_9.can(closure_1_14.MANAGE_CHANNELS, guild);
2026-07-20 16:05:17 +00:00
}
});
if (localChannel.parent_id !== dropData.parentId) {
const found1 = found.find((id) => {
if (id.id !== localChannel.id) {
return false;
} else {
2026-08-24 06:08:38 +00:00
const channel = closure_1_7.getChannel(id.parent_id);
2026-07-20 16:05:17 +00:00
if (null != channel) {
2026-08-24 06:08:38 +00:00
if (closure_1_9.can(closure_1_14.MANAGE_ROLES, tmp)) {
2026-07-29 08:29:29 +00:00
if (obj.can(tmp2.MANAGE_ROLES, channel)) {
2026-08-24 06:08:38 +00:00
const areChannelsLockedResult = closure_1_2(found[31]).areChannelsLocked(tmp, channel);
const obj2 = closure_1_2(found[31]);
let areChannelsLockedResult1 = closure_1_2(found[31]).areChannelsLocked(tmp, closure_1_7.getChannel(tmp.parent_id));
2026-07-29 08:29:29 +00:00
let tmp7 = null == tmp.parent_id && !areChannelsLockedResult;
if (!tmp7) {
2026-07-20 16:05:17 +00:00
if (areChannelsLockedResult1) {
areChannelsLockedResult1 = !areChannelsLockedResult;
}
2026-07-29 08:29:29 +00:00
tmp7 = areChannelsLockedResult1;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (tmp7) {
2026-08-24 06:08:38 +00:00
closure_2 = id;
2026-07-23 10:11:24 +00:00
}
2026-07-20 16:05:17 +00:00
return true;
}
}
2026-08-24 06:08:38 +00:00
obj = closure_1_9;
tmp2 = closure_1_14;
2026-07-20 16:05:17 +00:00
}
return true;
}
});
}
if (null != parent_id) {
2026-08-24 06:08:38 +00:00
let channel = closure_1_7.getChannel(parent_id.parent_id);
2026-07-29 08:29:29 +00:00
obj = { title: null, body: null, confirmText: null, cancelText: null, onConfirm: null, onCancel: null };
2026-08-07 06:50:47 +00:00
const intl = tmp3(tmp4[15]).intl;
obj[0] = intl.string(tmp3(tmp4[15]).t.YWMtRe);
const intl2 = tmp3(tmp4[15]).intl;
2026-07-29 08:29:29 +00:00
obj = { channelName: null, categoryName: null };
2026-08-07 06:50:47 +00:00
const tmp3Result3 = tmp3(tmp4[23]);
2026-08-24 06:08:38 +00:00
obj[0] = tmp3Result3.computeChannelName(localChannel, closure_1_11, closure_1_10, true);
2026-07-20 16:05:17 +00:00
let str = "";
if (null != channel) {
2026-08-07 06:50:47 +00:00
str = tmp3(tmp4[23]).computeChannelName(channel, tmp29, tmp30);
const tmp3Result4 = tmp3(tmp4[23]);
2026-07-29 08:29:29 +00:00
}
obj[1] = str;
function saveUpdates() {
2026-08-07 06:50:47 +00:00
localChannel(found[37]).localChannelUpdate(found);
const obj = localChannel(found[37]);
localChannel(found[41]).batchChannelUpdate(localChannel.guild_id, found);
2026-07-20 16:05:17 +00:00
}
2026-08-07 06:50:47 +00:00
obj[1] = intl2.format(tmp3(tmp4[15]).t["iKW+jY"], obj);
const intl3 = tmp3(tmp4[15]).intl;
obj[2] = intl3.string(tmp3(tmp4[15]).t.eW8Gy4);
const intl4 = tmp3(tmp4[15]).intl;
obj[3] = intl4.string(tmp3(tmp4[15]).t.s4uM3b);
2026-07-29 08:29:29 +00:00
obj[4] = function onConfirm() {
2026-07-20 16:05:17 +00:00
closure_2.lock_permissions = true;
2026-08-07 06:50:47 +00:00
localChannel(found[37]).localChannelUpdate(found);
const obj = localChannel(found[37]);
localChannel(found[41]).batchChannelUpdate(localChannel.guild_id, found);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
obj[5] = saveUpdates;
2026-08-24 06:08:38 +00:00
closure_1_1(tmp4[42]).show(obj);
const obj8 = closure_1_1(tmp4[42]);
tmp29 = closure_1_11;
tmp30 = closure_1_10;
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
closure_1_1(tmp4[37]).localChannelUpdate(found);
const obj6 = closure_1_1(tmp4[37]);
closure_1_1(tmp4[41]).batchChannelUpdate(localChannel.guild_id, found);
const obj7 = closure_1_1(tmp4[41]);
2026-07-20 16:05:17 +00:00
}
}
2026-08-07 06:50:47 +00:00
tmp3Result1 = tmp3(tmp4[13]);
2026-07-20 16:05:17 +00:00
}
}
}
}
}
2026-07-29 08:29:29 +00:00
};
return applyArgumentsResult;
}
}
const prototype = GuildSettingsModalChannels.prototype;
prototype["componentDidMount"] = function componentDidMount() {
this.updateNavigation();
};
prototype["componentDidUpdate"] = function componentDidUpdate(arg0) {
this.updateNavigation(arg0);
};
prototype["updateNavigation"] = function updateNavigation(sortingType) {
const self = this;
2026-08-24 06:08:38 +00:00
const _require = callback2(this.context);
2026-07-29 08:29:29 +00:00
const props = this.props;
({ sortingType, navigation, guild, channels } = props);
let tmp = null != sortingType;
({ order, user } = props);
if (tmp) {
tmp = sortingType === sortingType.sortingType;
}
if (tmp) {
tmp = order === sortingType.order;
}
if (tmp) {
tmp = guild === sortingType.guild;
}
if (tmp) {
tmp = channels === sortingType.channels;
}
if (!tmp) {
let fn;
if (null != sortingType) {
fn = () => null;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let obj = { headerLeft: null, headerRight: null, headerTitle: null };
obj[0] = fn;
if (null != sortingType) {
let fn2 = () => {
const obj = { textStyle: lib.headerRight, text: null, onPress: null };
2026-08-24 06:08:38 +00:00
const intl = lib(closure_1_3[15]).intl;
obj[1] = intl.string(lib(closure_1_3[15]).t.i4jeWR);
2026-08-07 06:50:47 +00:00
obj[2] = self.props.onDone;
2026-08-24 06:08:38 +00:00
return closure_1_16(lib(closure_1_3[30]).HeaderActionButton, obj);
2026-07-20 16:05:17 +00:00
};
2026-07-29 08:29:29 +00:00
} else {
if (obj2.canManageACategory(user, guild, channels._categories)) {
fn2 = () => {
const obj = { textStyle: lib.headerRight, text: null, onPress: null };
2026-08-24 06:08:38 +00:00
const intl = lib(closure_1_3[15]).intl;
obj[1] = intl.string(lib(closure_1_3[15]).t["0dOFq+"]);
2026-07-29 08:29:29 +00:00
obj[2] = self.handleSortStart;
2026-08-24 06:08:38 +00:00
return closure_1_16(lib(closure_1_3[30]).HeaderActionButton, obj);
2026-07-29 08:29:29 +00:00
};
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
obj2 = applyOverwritesAll;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[1] = fn2;
let stringResult;
if (null != sortingType) {
let intl = _require(1236).intl;
stringResult = intl.string(_require(1236).t.OGiMXJ);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = stringResult;
navigation.setOptions(obj);
}
};
prototype["render"] = function render() {
const self = this;
const props = this.props;
({ channels, order, sortingType } = props);
const hovering = this.state.hovering;
2026-08-24 06:08:38 +00:00
c4 = undefined;
2026-07-29 08:29:29 +00:00
const items = [];
if (null != channels) {
c4 = -1;
const _categories = channels._categories;
let item = _categories.forEach((channel) => {
channel = channel.channel;
let obj;
2026-08-07 06:50:47 +00:00
if ("null" !== channel.id) {
obj = channels(items[13]);
2026-07-29 08:29:29 +00:00
}
2026-08-07 06:50:47 +00:00
closure_4 = closure_4 + 1;
obj = { data: [], category: channel, key: channel.id, index: closure_4 };
let arr = obj[channel.id];
const item = arr.forEach((channel) => {
channel = channel.channel;
2026-08-24 06:08:38 +00:00
obj = closure_1_1;
2026-08-07 06:50:47 +00:00
if (tmp) {
closure_4 = closure_4 + 1;
const data = obj.data;
obj = { key: null, channel: null, sortingType: null, isHovered: null, index: null };
obj[0] = channel.id;
obj[1] = channel;
obj[2] = obj;
2026-08-24 06:08:38 +00:00
obj[3] = closure_1_2 === channel.id;
2026-08-07 06:50:47 +00:00
obj[4] = closure_4;
data.push(obj);
}
});
arr = items.push(obj);
2026-07-29 08:29:29 +00:00
});
}
2026-08-24 06:08:38 +00:00
let obj = { style: callback2(this.context).containerView, children: null };
2026-07-29 08:29:29 +00:00
obj = { sections: items, sortingEnabled: null != sortingType, renderSectionHeader: self.renderSectionHeader, renderItem: self.renderItem, onRowMoved: self.handleDrop, order: null, onHoverChange: null, renderActiveDivider: null, contentContainerStyle: null, fontScale: null };
const items1 = [closure_15];
2026-08-24 06:08:38 +00:00
const tmp = callback2(this.context);
2026-07-29 08:29:29 +00:00
const tmp3 = closure_17;
const tmp4 = closure_5;
const tmp6 = items;
HermesBuiltin.arraySpread(order, 1);
obj[5] = items1;
({ handleHoverChange: obj2[6], renderActiveDivider: obj2[7] } = self);
obj[8] = self.props.contentContainerStyle;
obj[9] = self.props.fontScale;
2026-08-07 06:50:47 +00:00
const items2 = [callback(sortingType(items[33]), obj), , ];
2026-07-29 08:29:29 +00:00
let tmp5Result = null == sortingType;
if (tmp5Result) {
obj = { guild: null };
obj[0] = props.guild;
tmp5Result = tmp5(CreateButton, obj);
}
items2[1] = tmp5Result;
2026-08-07 06:50:47 +00:00
items2[2] = callback(channels(tmp6[34]).NavScrim, {});
2026-07-29 08:29:29 +00:00
obj[1] = items2;
return tmp3(tmp4, obj);
};
prototype["handleChannelPress"] = function handleChannelPress(arg0) {
2026-08-24 06:08:38 +00:00
init.open(arg0);
2026-07-29 08:29:29 +00:00
};
GuildSettingsModalChannels.contextType = require("ManaContext").ThemeContext;
2026-08-24 06:08:38 +00:00
let obj4 = { backgroundColor: ThemesDefault.unsafe_rawColors.GREEN_360, opacity: 0.3 };
let result = require("set").fileFinishedImporting("modules/guild_settings/native/GuildSettingsModalChannels.tsx");
2026-07-20 16:05:17 +00:00
2026-08-07 06:50:47 +00:00
export default function GuildSettingsModalChannelsConnected(onDone) {
({ guildId: require, contentContainerStyle } = onDone);
2026-07-29 08:29:29 +00:00
let stateFromStores5;
2026-08-24 06:08:38 +00:00
dependencyMap = undefined;
let obj = useNavigation;
2026-07-20 16:05:17 +00:00
const navigation = obj.useNavigation();
2026-08-24 06:08:38 +00:00
let items = [closure_8];
const stateFromStores = initialize.useStateFromStores(items, () => closure_1_8.getGuild(closure_0));
const obj2 = initialize;
const items1 = [closure_12];
const stateFromStores1 = initialize.useStateFromStores(items1, () => closure_12.channels);
const obj3 = initialize;
const items2 = [closure_11];
const stateFromStores2 = initialize.useStateFromStores(items2, () => {
2026-07-29 08:29:29 +00:00
currentUser = currentUser.getCurrentUser();
2026-08-24 06:08:38 +00:00
contentContainerStyle(bottom[44])(null != currentUser, "GuildSettingsModalChannelsConnected: currentUser cannot be undefined");
2026-07-20 16:05:17 +00:00
return currentUser;
});
2026-08-24 06:08:38 +00:00
const obj4 = initialize;
const items3 = [closure_12];
const stateFromStores3 = initialize.useStateFromStores(items3, () => closure_12.channelList);
const obj5 = initialize;
const items4 = [closure_12];
const stateFromStores4 = initialize.useStateFromStores(items4, () => closure_12.order);
const obj6 = initialize;
const items5 = [closure_12];
stateFromStores5 = initialize.useStateFromStores(items5, () => closure_12.sortingType);
2026-08-15 05:55:55 +00:00
const tmp8 = contentContainerStyle(1629)();
2026-07-29 08:29:29 +00:00
dependencyMap = tmp8;
2026-07-20 16:05:17 +00:00
const items6 = [contentContainerStyle, tmp8.bottom, stateFromStores5];
const memo = importAllResult.useMemo(() => {
if (null == stateFromStores5) {
const items = [contentContainerStyle, ];
2026-07-29 08:29:29 +00:00
const obj = { paddingBottom: null };
2026-08-24 06:08:38 +00:00
obj[0] = bottom.bottom + 32 + 44;
2026-07-20 16:05:17 +00:00
items[1] = obj;
let tmp = items;
} else {
tmp = contentContainerStyle;
}
return tmp;
}, items6);
2026-08-24 06:08:38 +00:00
getFontScale;
2026-07-20 16:05:17 +00:00
let tmp12 = null;
if (null != stateFromStores4) {
tmp12 = null;
if (null != stateFromStores3) {
tmp12 = null;
if (null != stateFromStores1) {
tmp12 = null;
if (null != stateFromStores) {
tmp12 = null;
if (null != stateFromStores2) {
2026-08-07 06:50:47 +00:00
obj = { navigation: null, guild: null, channels: null, user: null, channelList: null, order: null, sortingType: null, contentContainerStyle: null, fontScale: null, onDone: null };
2026-07-29 08:29:29 +00:00
obj[0] = navigation;
obj[1] = stateFromStores;
obj[2] = stateFromStores1;
obj[3] = stateFromStores2;
obj[4] = stateFromStores3;
obj[5] = stateFromStores4;
obj[6] = stateFromStores5;
obj[7] = memo;
obj[8] = tmp11;
2026-08-07 06:50:47 +00:00
obj[9] = onDone.onDone;
2026-07-29 08:29:29 +00:00
tmp12 = callback(GuildSettingsModalChannels, obj);
2026-07-20 16:05:17 +00:00
}
}
}
}
}
return tmp12;
};