Files
discord-decomp/sources/components_native/CreateChannelModal.tsx
T
2026-07-28 01:06:53 +03:00

883 lines
49 KiB
TypeScript

/* Metro module 9083; source: components_native/CreateChannelModal.tsx; dependencies: [57, 31, 27, 1383, 1422, 1379, 1867, 3784, 3793, 1878, 661, 8120, 33, 4501, 697, 6691, 6698, 6711, 6707, 6704, 6697, 6689, 6696, 6708, 6706, 6703, 1244, 4573, 6766, 1948, 3874, 6238, 7989, 7972, 1305, 5463, 566, 44, 4805, 4807, 9084, 1484, 9085, 4863, 5282, 9087, 5277, 9088, 22, 4800, 4572, 7682, 6985, 6231, 9091, 6808, 6705, 9095, 480, 9108, 6518, 5280, 2] */
import Module00044 from '../by-id/module-00044.js'; /* Metro dependency 44 */
import Module00057 from '../by-id/module-00057.js'; /* Metro dependency 57 */
import Native from '../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import ChannelStore from '../stores/ChannelStore.tsx'; /* Metro dependency 1379 */
import GuildStore from '../stores/GuildStore.tsx'; /* Metro dependency 1867 */
import UserStore from '../stores/UserStore.tsx'; /* Metro dependency 1878 */
import PermissionStore from '../stores/PermissionStore.tsx'; /* Metro dependency 3784 */
import RelationshipStore from '../stores/RelationshipStore.tsx'; /* Metro dependency 3793 */
import UseChannelName from '../modules/channel/useChannelName.tsx'; /* Metro dependency 4805 */
import UseSafeAreaInsetsKeyboardAwareNative from '../modules/safe_area/useSafeAreaInsetsKeyboardAware.native.tsx'; /* Metro dependency 5463 */
import UseInitialValue from '../hooks/useInitialValue.tsx'; /* Metro dependency 6518 */
import UseCreateChannelSubmit from '../modules/channel/useCreateChannelSubmit.tsx'; /* Metro dependency 9085 */
import AddModerators from '../modules/stage_channels/native/create_channel/AddModerators.tsx'; /* Metro dependency 9108 */
import * as FileImportTrackerModule from '../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as AnalyticsUtilsModule from '../external/discord_common/js/packages/analytics-utils/AnalyticsUtils.tsx'; /* Metro dependency 480 */
import * as IndexNativeModule from '../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as GuildRecordModule from '../records/GuildRecord.tsx'; /* Metro dependency 1422 */
import * as UseNavigationNativeModule from '../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as UseA11yRolesNativeModule from '../external/discord_common/js/packages/design/hooks/useA11yRolesNative.tsx'; /* Metro dependency 3874 */
import * as StackNativeModule from '../design/components/Stack/native/Stack.native.tsx'; /* Metro dependency 4572 */
import * as ChannelUtilsModule from '../utils/ChannelUtils.tsx'; /* Metro dependency 4800 */
import * as StageChannelPermissionUtilsModule from '../modules/stage_channels/StageChannelPermissionUtils.tsx'; /* Metro dependency 4807 */
import * as HeaderActionButtonNativeModule from '../design/components/Navigator/native/HeaderActionButton.native.tsx'; /* Metro dependency 5277 */
import * as NavigatorNativeModule from '../design/components/Navigator/native/Navigator.native.tsx'; /* Metro dependency 5280 */
import * as NavigatorHeaderNativeModule from '../design/components/Navigator/native/NavigatorHeader.native.tsx'; /* Metro dependency 5282 */
import * as TableRowGroupNativeModule from '../design/components/TableRow/native/TableRowGroup.native.tsx'; /* Metro dependency 6231 */
import * as TableRowNativeModule from '../design/components/TableRow/native/TableRow.native.tsx'; /* Metro dependency 6238 */
import * as TextLockIconModule from '../design/components/Icon/native/redesign/generated/TextLockIcon.tsx'; /* Metro dependency 6689 */
import * as TextIconModule from '../design/components/Icon/native/redesign/generated/TextIcon.tsx'; /* Metro dependency 6691 */
import * as ForumLockIconModule from '../design/components/Icon/native/redesign/generated/ForumLockIcon.tsx'; /* Metro dependency 6696 */
import * as ImageIconModule from '../design/components/Icon/native/redesign/generated/ImageIcon.tsx'; /* Metro dependency 6697 */
import * as ForumIconModule from '../design/components/Icon/native/redesign/generated/ForumIcon.tsx'; /* Metro dependency 6698 */
import * as AnnouncementsLockIconModule from '../design/components/Icon/native/redesign/generated/AnnouncementsLockIcon.tsx'; /* Metro dependency 6703 */
import * as AnnouncementsIconModule from '../design/components/Icon/native/redesign/generated/AnnouncementsIcon.tsx'; /* Metro dependency 6704 */
import * as StageLockIconModule from '../design/components/Icon/native/redesign/generated/StageLockIcon.tsx'; /* Metro dependency 6706 */
import * as StageIconModule from '../design/components/Icon/native/redesign/generated/StageIcon.tsx'; /* Metro dependency 6707 */
import * as VoiceLockIconModule from '../design/components/Icon/native/redesign/generated/VoiceLockIcon.tsx'; /* Metro dependency 6708 */
import * as VoiceNormalIconModule from '../design/components/Icon/native/redesign/generated/VoiceNormalIcon.tsx'; /* Metro dependency 6711 */
import * as TextFieldNativeModule from '../design/components/TextField/native/TextField.native.tsx'; /* Metro dependency 6985 */
import * as InputNativeModule from '../design/components/Input/native/Input.native.tsx'; /* Metro dependency 7682 */
import * as FormRadioNativeModule from '../design/components/Forms/native/FormRadio.native.tsx'; /* Metro dependency 7989 */
import * as ChannelPermissionsConstantsModule from '../modules/channel_permissions/ChannelPermissionsConstants.tsx'; /* Metro dependency 8120 */
import * as MediaChannelExperimentUtilsModule from '../modules/media_channel/MediaChannelExperimentUtils.tsx'; /* Metro dependency 9084 */
import * as AddMembersActionSheetModule from '../modules/channel_permissions/native/action_sheets/AddMembersActionSheet.tsx'; /* Metro dependency 9095 */
function _fun70971(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#70971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:6, offset: 0x01d0f497, size: 1058 bytes, params: 8, frame: 25
const env0_0 = require;
const CreateChannel2 = CreateChannel;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = ReactNativeModule;
const env0_5 = value.ScrollView;
const env0_6 = value.View;
value = require(1383) /* metro dependency 1383: ChannelRecord */;
const env0_7 = value.CREATEABLE_NON_VOCAL_CHANNEL_NAME_TYPES;
const env0_8 = value.isGuildVocalChannelType;
value = require(661) /* metro dependency 661: Constants */;
const ChannelTypes = value.ChannelTypes;
const env0_16 = value.GuildFeatures;
const env0_17 = value.Permissions;
const env0_18 = value.AnalyticEvents;
const env0_19 = value.HelpdeskArticles;
value = require(33) /* metro dependency 33 */;
const env0_21 = value.jsx;
const env0_22 = value.Fragment;
const env0_23 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const BACKGROUND_BASE_LOW = (Native).colors.BACKGROUND_BASE_LOW;
const env0_24 = Reflect.apply(createStyles, value, [{addMembersContainer: {backgroundColor: BACKGROUND_BASE_LOW,
flex: 1}, errorMessage: {marginBottom: 0}, flexRow: {'flexDirection': 'row', 'alignItems': 'center'},
horizontalContainer: {'flex': 1, 'flexDirection': 'row'}}]);
object = {};
let GUILD_TEXT = ChannelTypes.GUILD_TEXT;
const TextIcon = (TextIconModule).TextIcon;
object[GUILD_TEXT] = {IconComponent: TextIcon};
let GUILD_FORUM = ChannelTypes.GUILD_FORUM;
const ForumIcon = (ForumIconModule).ForumIcon;
object[GUILD_FORUM] = {IconComponent: ForumIcon};
let GUILD_VOICE = ChannelTypes.GUILD_VOICE;
const VoiceNormalIcon = (VoiceNormalIconModule).VoiceNormalIcon;
object[GUILD_VOICE] = {IconComponent: VoiceNormalIcon};
let GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
const StageIcon = (StageIconModule).StageIcon;
object[GUILD_STAGE_VOICE] = {IconComponent: StageIcon};
let GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
const AnnouncementsIcon = (AnnouncementsIconModule).AnnouncementsIcon;
object[GUILD_ANNOUNCEMENT] = {IconComponent: AnnouncementsIcon};
let GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
const ImageIcon = (ImageIconModule).ImageIcon;
object[GUILD_MEDIA] = {IconComponent: ImageIcon};
object = {};
GUILD_TEXT = ChannelTypes.GUILD_TEXT;
const TextLockIcon = (TextLockIconModule).TextLockIcon;
object[GUILD_TEXT] = {IconComponent: TextLockIcon};
GUILD_FORUM = ChannelTypes.GUILD_FORUM;
const ForumLockIcon = (ForumLockIconModule).ForumLockIcon;
object[GUILD_FORUM] = {IconComponent: ForumLockIcon};
GUILD_VOICE = ChannelTypes.GUILD_VOICE;
const VoiceLockIcon = (VoiceLockIconModule).VoiceLockIcon;
object[GUILD_VOICE] = {IconComponent: VoiceLockIcon};
GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
const StageLockIcon = (StageLockIconModule).StageLockIcon;
object[GUILD_STAGE_VOICE] = {IconComponent: StageLockIcon};
GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
const AnnouncementsLockIcon = (AnnouncementsLockIconModule).AnnouncementsLockIcon;
object[GUILD_ANNOUNCEMENT] = {IconComponent: AnnouncementsLockIcon};
GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
object[GUILD_MEDIA] = {IconComponent: ImageIcon};
object = {CREATE_CHANNEL: 'CREATE_CHANNEL', ADD_MEMBERS: 'ADD_MEMBERS', ADD_MODERATORS: 'ADD_MODERATORS'};
(FileImportTrackerModule).fileFinishedImporting('components_native/CreateChannelModal.tsx');
exports.default = CreateChannelModal;
exports.CreateChannel = CreateChannel2;
function ChannelTypeRow({selected, channelType, isPrivate, isBeta, onPress}) { // fn#70972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:1388, offset: 0x01d0f8b9, size: 1482 bytes, params: 2, frame: 34
var r0;
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
var jsxRuntimeEnv0_22Binding;
var items2;
var TextWithIOSLinkWorkaround;
var format;
var property;
var defaultImport;
const styles = useStyles();
const useRadioA11yNative = UseA11yRolesNativeModule.useRadioA11yNative;
let object = {selected: selected};
const {accessibilityRole, accessibilityState} = Reflect.apply(useRadioA11yNative, UseA11yRolesNativeModule,
[object]);
const IconComponent = (isPrivate ? env0_26 : env0_25)[channelType].IconComponent;
const GUILD_TEXT = ChannelTypes.GUILD_TEXT;
if (GUILD_TEXT === channelType) {
object = {};
object.label = intl.string(t.pnuRXC);
object.description = intl.string(t.oG6WsM);
r0 = object;
} else if (ChannelTypes.GUILD_VOICE === channelType) {
object = {};
object.label = intl.string(t.Sx55Oh);
object.description = intl.string(t.pqfkoF);
r0 = object;
} else if (ChannelTypes.GUILD_FORUM === channelType) {
object = {};
object.label = intl.string(t.eAVID5);
object.description = intl.string(t.iZ5pgg);
r0 = object;
} else if (ChannelTypes.GUILD_ANNOUNCEMENT === channelType) {
object = {};
object.label = intl.string(t.qr9dEP);
object.description = intl.string(t.gBkfzu);
r0 = object;
} else if (ChannelTypes.GUILD_STAGE_VOICE === channelType) {
object = {};
object.label = intl.string(t.pNWst0);
object.description = intl.string(t.VPAwgo);
r0 = object;
} else if (ChannelTypes.GUILD_MEDIA !== channelType) {
r0 = undefined;
} else {
object = {};
object.label = intl.string(t['6x6fVg']);
jsxRuntimeEnv0_22Binding = jsxRuntimeEnv0_22;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items2 = [
<Text variant="text-xs/normal" color="text-muted">
{intl.string(t.JyCrwS)}
</Text>,
];
TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
format = intl.format;
property = t['2Sapx1'];
defaultImport = importDefault(1948) /* metro dependency 1948: HelpdeskUtils */;
items2[1] = (
<TextWithIOSLinkWorkaround variant="text-xs/normal">
{Reflect.apply(format, intl, [property,
{hcArticleUrl: defaultImport.getCreatorSupportArticleURL(HelpdeskArticles.MEDIA_CHANNEL)}])}
</TextWithIOSLinkWorkaround>
);
object.description = (
<>
{items2}
</>
);
r0 = object;
}
const label = r0.label;
const description = r0.description;
const TableRow = (TableRowNativeModule).TableRow;
const tableRowProps = {onPress: function() {
if (!selected) {
onPress(channelType);
}
}, accessibilityRole: accessibilityRole, accessibilityState: accessibilityState,
icon: <View style={styles.flexRow}><IconComponent /></View>};
const FormRadio = (FormRadioNativeModule).FormRadio;
tableRowProps.trailing = <FormRadio selected={selected} />;
tableRowProps.label = (
isBeta !== true
? label
: (
<View style={styles.horizontalContainer}>
{((FormLabel) => <FormLabel text={label} />)((require(7972) /* metro dependency 7972: native */).FormLabel)}
{((BetaTag) => <BetaTag size={(require(1305) /* metro dependency 1305: native */).BetaSizes.SMALL} />)((require(1305) /* metro dependency 1305: native */).BetaTag)}
</View>
)
);
tableRowProps.subLabel = description;
return <TableRow {...tableRowProps} />;
}
function CreateChannel({categoryId, channelType, cloneChannelId, createMode, guildId, onChannelCreated}) { // fn#70974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:3051, offset: 0x01d0fea3, size: 3073 bytes, params: 2, frame: 49
var r14;
var r28;
var r17;
var r22;
var r9;
var GUILD_TEXT;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
var t;
var format;
var s2ZzZZ;
var moduleValue6;
var jsxRuntimeEnv0_22Binding;
const TableRowGroup = (TableRowGroupNativeModule).TableRowGroup;
var object;
var object2;
var items2;
var object4;
var GUILD_VOICE;
var object8;
var object9;
var GUILD_MEDIA;
var object10;
var GUILD_ANNOUNCEMENT;
var object11;
var GUILD_STAGE_VOICE;
var items3;
var jsxRuntimeEnv0_22Binding2;
var object12;
var isGuildVocalChannelType2;
var TableSwitchRow;
var items4;
var moduleValue7;
const guildId2 = guildId;
const onChannelCreated2 = onChannelCreated;
const onPress_709762 = onPress_70976;
const styles = useStyles();
const insets = (UseSafeAreaInsetsKeyboardAwareNative)().insets;
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
return GuildStore.getGuild(guildId);
});
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun70978);
const r32 = guild != null && guild.features.has(GuildFeatures.COMMUNITY);
let permissionStoreBinding = PermissionStore;
let can = permissionStoreBinding.can;
const VIEW_CHANNEL = Permissions.VIEW_CHANNEL;
const value7 = Reflect.apply(can, permissionStoreBinding, [VIEW_CHANNEL, guild]);
permissionStoreBinding = PermissionStore;
can = permissionStoreBinding.can;
const CONNECT = Permissions.CONNECT;
const value8 = Reflect.apply(can, permissionStoreBinding, [CONNECT, guild]);
(Module00044)(UserStore.getCurrentUser() != null,
'CreateChannel: user cannot be undefined');
const value10 = (UseChannelName)(value3);
let binding = onChannelCreated2;
let useState = binding.useState;
const value13 = guildId2(Reflect.apply(useState, binding, [value10 ?? '']), 2);
const property = value13[0];
const env0_9 = value13[1];
binding = onChannelCreated2;
useState = binding.useState;
const value15 = guildId2(Reflect.apply(useState, binding, [channelType ?? ChannelTypes.GUILD_TEXT]), 2);
const property2 = value15[0];
const env0_11 = value15[1];
const value16 = (StageChannelPermissionUtilsModule).useCanCreateStageChannelByGuild(guildId);
const value17 = (MediaChannelExperimentUtilsModule).useGuildEligibleForMediaChannels(guild);
const value18 = (UseNavigationNativeModule).useNavigation();
const value20 = guildId2((UseCreateChannelSubmit)(onChannelCreated),
3);
const property3 = value20[0];
const property4 = value20[1];
const property5 = value20[2];
const [property6, env0_16] = guildId2(onChannelCreated2.useState(false), 2);
onChannelCreated2.useEffect(function() {
var defaultImport = importDefault(dependencyMap[43]);
var OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
defaultImport.trackWithMetadata(OPEN_MODAL, {type: 'Create Channel'});
}, []);
onChannelCreated2.useEffect(_fun70980, [value18, property2, value3, value7, value8, property6, property, property3,
guildId, property5, categoryId, createMode, onChannelCreated]);
const object13 = {};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object13.padding = PX_16;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object13.paddingBottom = PX_16 + insets.bottom;
const Stack = (StackNativeModule).Stack;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
const Input = (InputNativeModule).Input;
const object14 = {};
let GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
object14.label = property2 === GUILD_CATEGORY ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.OCAkGP) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.PVbHDl);
object14.errorMessage = property4.name?.[0];
let GUILD_FORUM = ChannelTypes.GUILD_FORUM;
if (property2 === GUILD_FORUM) {
r14 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.qBvLY4);
} else if (value3 != null) {
format = intl.format;
s2ZzZZ = (require(1244) /* metro dependency 1244: indexNative */).t.s2ZzZZ;
moduleValue6 = require(4805) /* metro dependency 4805: useChannelName */;
r14 = Reflect.apply(format, intl, [s2ZzZZ, {name: moduleValue6.computeChannelName(value3, UserStore,
RelationshipStore, true)}]);
} else {
r14 = undefined;
}
object14.description = r14;
const TextField = (TextFieldNativeModule).TextField;
GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
const input = (
<Input {...object14}>
<TextField
autoFocus
enableAndroidSanitizedInputWorkaround
value={property}
onChange={onChange_70983}
placeholder={property2 === GUILD_CATEGORY ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.eTVbtx) : property2 === ChannelTypes.GUILD_FORUM ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t['5z1Xat']) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['bw/b8E'])}
/>
</Input>
);
if (value3 == null) {
jsxRuntimeEnv0_22Binding = jsxRuntimeEnv0_22;
GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
if (property2 === GUILD_CATEGORY) {
r17 = null;
} else {
var tableRowGroupProps = {title: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7ZcXG2']),
hasIcons: true};
object2 = {};
GUILD_TEXT = ChannelTypes.GUILD_TEXT;
object2.channelType = GUILD_TEXT;
GUILD_TEXT = ChannelTypes.GUILD_TEXT;
object2.selected = property2 === GUILD_TEXT;
object2.isPrivate = property6;
object2.onPress = onPress_709762;
items2 = [
<ChannelTypeRow {...object2} />,
];
object4 = {};
GUILD_VOICE = ChannelTypes.GUILD_VOICE;
object4.channelType = GUILD_VOICE;
GUILD_VOICE = ChannelTypes.GUILD_VOICE;
object4.selected = property2 === GUILD_VOICE;
object4.isPrivate = property6;
object4.onPress = onPress_709762;
items2[1] = <ChannelTypeRow {...object4} />;
object8 = {};
GUILD_FORUM = ChannelTypes.GUILD_FORUM;
object8.channelType = GUILD_FORUM;
GUILD_FORUM = ChannelTypes.GUILD_FORUM;
object8.selected = property2 === GUILD_FORUM;
object8.isPrivate = property6;
object8.onPress = onPress_709762;
items2[2] = <ChannelTypeRow {...object8} />;
if (value17) {
object9 = {};
GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
object9.channelType = GUILD_MEDIA;
GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
object9.selected = property2 === GUILD_MEDIA;
object9.isPrivate = property6;
object9.isBeta = true;
object9.onPress = onPress_709762;
r28 = <ChannelTypeRow {...object9} />;
} else {
r28 = null;
}
items2[3] = r28;
if (r32) {
if (createMode === (require(9085) /* metro dependency 9085: useCreateChannelSubmit */).CreateChannelMode.PREMIUM_CHANNEL) {
r28 = null;
} else {
object10 = {};
GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
object10.channelType = GUILD_ANNOUNCEMENT;
GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
object10.selected = property2 === GUILD_ANNOUNCEMENT;
object10.isPrivate = property6;
object10.onPress = onPress_709762;
r28 = <ChannelTypeRow {...object10} />;
}
} else {
r28 = null;
}
items2[4] = r28;
if (value16) {
if (property6) {
r28 = null;
} else {
object11 = {};
GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
object11.channelType = GUILD_STAGE_VOICE;
GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
object11.selected = property2 === GUILD_STAGE_VOICE;
object11.isPrivate = property6;
object11.onPress = onPress_709762;
r28 = <ChannelTypeRow {...object11} />;
}
} else {
r28 = null;
}
items2[5] = r28;
r17 = (
<TableRowGroup {...tableRowGroupProps}>
{items2}
</TableRowGroup>
);
}
items3 = [r17];
items3[1] = ((Component) => <Component guildId={guildId} channelType={property2} />)(importDefault(9091) /* metro dependency 9091: CreateChannelTypeDescription */);
GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
if (property2 === GUILD_STAGE_VOICE) {
r17 = null;
} else if (createMode === (require(9085) /* metro dependency 9085: useCreateChannelSubmit */).CreateChannelMode.PREMIUM_CHANNEL) {
r17 = null;
} else {
jsxRuntimeEnv0_22Binding2 = jsxRuntimeEnv0_22;
object12 = {};
GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
if (property2 === GUILD_CATEGORY) {
r28 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.RQUk61);
} else {
isGuildVocalChannelType2 = isGuildVocalChannelType(property2);
string = intl.string;
t = (require(1244) /* metro dependency 1244: indexNative */).t;
r28 = isGuildVocalChannelType2 ? Reflect.apply(string, intl, [t.cLjvKg]) : Reflect.apply(string, intl,
[t.hfbjIH]);
}
object12.description = r28;
object12.hasIcons = true;
TableSwitchRow = (require(6808) /* metro dependency 6808: TableSwitchRowNative */).TableSwitchRow;
GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
items4 = [
<TableRowGroup {...object12}>
<TableSwitchRow
label={property2 === GUILD_CATEGORY ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lEPAZ5) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.aUI70g)}
icon={((LockIcon) => <LockIcon />)((require(6705) /* metro dependency 6705: LockIcon */).LockIcon)}
value={property6}
onValueChange={onValueChange_70984}
/>
</TableRowGroup>,
];
if (property6) {
moduleValue7 = require(9088) /* metro dependency 9088: ChannelPermissionsUtils */;
r22 = (
moduleValue7.canCreatePrivateChannel(property2, value7, value8)
? null
: (
<View style={styles.errorMessage}>
{((HelpMessage) => <HelpMessage messageType={(require(1305) /* metro dependency 1305: native */).HelpMessageTypes.ERROR}>{(require(9088) /* metro dependency 9088: ChannelPermissionsUtils */).getPrivateChannelHintText(property2)}</HelpMessage>)((require(1305) /* metro dependency 1305: native */).HelpMessage)}
</View>
)
);
} else {
r22 = null;
}
items4[1] = r22;
r17 = (
<>
{items4}
</>
);
}
items3[2] = r17;
r9 = (
<>
{items3}
</>
);
} else {
r9 = null;
}
return (
<ScrollView keyboardShouldPersistTaps="always" contentContainerStyle={object13}>
<Stack spacing={PX_16}>
{input}
{r9}
{
property4.message != null
? (
<View style={styles.errorMessage}>
{((HelpMessage) => <HelpMessage messageType={(require(1305) /* metro dependency 1305: native */).HelpMessageTypes.ERROR}>{property4.message}</HelpMessage>)((require(1305) /* metro dependency 1305: native */).HelpMessage)}
</View>
)
: null
}
</Stack>
</ScrollView>
);
function updateName(a0, a1) { // fn#70975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:3835, owner: CreateChannel.updateName, offset: 0x01d10aa4, size: 78 bytes, params: 3, frame: 14
var r1;
let value = a0;
const binding = env0_9;
if (CREATEABLE_NON_VOCAL_CHANNEL_NAME_TYPES.has(a1)) {
value = (require(4800) /* metro dependency 4800: ChannelUtils */).sanitizeGuildTextChannelName(value);
r1 = value;
} else {
r1 = value;
}
binding(r1);
}
function CreateChannelOnPress(a0) { // fn#70976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:3915, owner: CreateChannel.onPress, offset: 0x01d10af2, size: 33 bytes, params: 2, frame: 13
env0_11(a0);
updateName(env0_8, a0);
}
function _fun70978() { // fn#70978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:3285, offset: 0x01d10b2e, size: 39 bytes, params: 1, frame: 12
const cloneChannelIdBinding = cloneChannelId;
const value2 = null;
return value2 != cloneChannelIdBinding ? ChannelStore.getChannel(cloneChannelId) : value2;
}
function _fun70980() { // fn#70980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:4074, offset: 0x01d10b92, size: 122 bytes, params: 1, frame: 20
const binding = env0_12;
const setOptions = binding.setOptions;
const object = {};
object.headerLeft = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).getHeaderCloseButton((importDefault(9087) /* metro dependency 9087: CreateChannelModalActionCreators */).close);
object.headerRight = headerRight_70981;
object.headerTitle = getSceneTitle(env0_10, env0_5);
Reflect.apply(setOptions, binding, [object]);
function headerRight_70981() { // fn#70981, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:4162, offset: 0x01d10c0c, size: 319 bytes, params: 1, frame: 24
var environment;
var r6;
var r7;
var r0;
var HeaderActionButton;
var object;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var value5;
var moduleValue;
const value = environment.__proto__;
let binding = env1_13;
if (binding) {
const HeaderSubmittingIndicator = (require(5282) /* metro dependency 5282: NavigatorHeaderNative */).HeaderSubmittingIndicator;
r0 = <HeaderSubmittingIndicator />;
} else {
HeaderActionButton = (require(5277) /* metro dependency 5277: HeaderActionButtonNative */).HeaderActionButton;
object = {};
r6 = env1_15 || env1_10 === ChannelTypes.GUILD_STAGE_VOICE ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.PDTjLN) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.CumH4u);
object.text = r6;
value5 = env1_8 === '';
if (value5) {
r6 = value5;
} else {
binding = env1_15;
if (binding) {
moduleValue = require(9088) /* metro dependency 9088: ChannelPermissionsUtils */;
r7 = !moduleValue.canCreatePrivateChannel(env1_10, env1_6, env1_7);
} else {
r7 = binding;
}
r6 = r7;
}
object.disabled = r6;
object.onPress = onPress_70982;
r0 = <HeaderActionButton {...object} />;
}
return r0;
function headerRight_70981OnPress() { // fn#70982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:4424, owner: headerRight_70981.onPress, offset: 0x01d10d4b, size: 322 bytes, params: 1, frame: 16
var r0;
var value2;
var defaultImport;
var binding;
var value5;
var push;
var value6;
const object = {};
if (env2_5 != null) {
value2 = environment.__proto__.__proto__.__proto__;
defaultImport = importDefault(22) /* metro dependency 22 */;
r0 = defaultImport.values(env2_5.permissionOverwrites);
} else {
r0 = [];
}
object.overwrites = r0;
const value4 = undefined;
object.bitrate = env2_5 == null ? value4 : env2_5.bitrate;
const userLimit = env2_5 == null ? value4 : env2_5.userLimit;
object.userLimit = userLimit;
object.createMode = createMode;
object.guildId = guildId;
object.name = env2_8;
object.channelType = env2_10;
object.categoryId = categoryId;
object.onChannelCreated = onChannelCreated;
if (env2_15) {
binding = env2_12;
push = binding.push;
value6 = environment.__proto__.__proto__.__proto__;
Reflect.apply(push, binding, [env3_27.ADD_MEMBERS, {guildId: guildId, channelType: env2_10, name: env2_8,
categoryId: categoryId, onChannelCreated: onChannelCreated}]);
} else {
binding = env2_10;
value5 = environment.__proto__.__proto__.__proto__;
if (binding === ChannelTypes.GUILD_STAGE_VOICE) {
binding = env2_12;
binding.push(env3_27.ADD_MODERATORS, object);
} else {
env2_14(object);
}
}
return value4;
}
}
}
function CreateChannelOnChange(a0) { // fn#70983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:5505, owner: CreateChannel.onChange, offset: 0x01d10e8d, size: 34 bytes, params: 2, frame: 13
if (env0_8 !== a0) {
updateName(a0, env0_10);
}
}
function CreateChannelOnValueChange(a0) { // fn#70984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:7161, owner: CreateChannel.onValueChange, offset: 0x01d10eaf, size: 19 bytes, params: 2, frame: 11
env0_16(a0);
}
}
function AddMembers(a0) { // fn#70985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:7558, offset: 0x01d10ec2, size: 671 bytes, params: 2, frame: 29
const env0_0 = a0;
const styles = useStyles();
let binding = env0_4;
const env0_1 = binding.useRef(a0);
const value2 = (UseNavigationNativeModule).useNavigation();
const guild = GuildStore.getGuild(a0.guildId);
const defaultImport = Module00044;
const value4 = null;
defaultImport(value4 != guild, 'Guild must not be null');
const currentUser = UserStore.getCurrentUser();
const currentUser2 = currentUser;
defaultImport(value4 != currentUser, 'AddMembers: user cannot be undefined');
const permissionStoreBinding = PermissionStore;
const can = permissionStoreBinding.can;
const ADMINISTRATOR = Permissions.ADMINISTRATOR;
const value6 = Reflect.apply(can, permissionStoreBinding, [ADMINISTRATOR, guild]);
var env0_4 = value6;
const isGuildOwner2 = isGuildOwner(guild, currentUser);
const [property, property2] = currentUser2(env0_4.useState({}), 2);
const value10 = currentUser2((UseCreateChannelSubmit)(a0.onChannelCreated),
3);
const property3 = value10[0];
const property4 = value10[1];
const property5 = value10[2];
env0_4.useEffect(_fun70986);
binding = env0_4;
const useCallback = binding.useCallback;
env0_4.useLayoutEffect(_fun70989, [value2, property, property3, Reflect.apply(useCallback, binding, [_fun70987,
[value6, isGuildOwner2, value2, property5, property, currentUser.id]])]);
const r6 = (
value4 != property4.message
? (
property4.message === ''
? value4
: (
<View style={styles.errorMessage}>
{((HelpMessage) => <HelpMessage messageType={(require(1305) /* metro dependency 1305: native */).HelpMessageTypes.ERROR}>{property4.message}</HelpMessage>)((require(1305) /* metro dependency 1305: native */).HelpMessage)}
</View>
)
)
: value4
);
const AddMembersBody = (AddMembersActionSheetModule).AddMembersBody;
return (
<View style={styles.addMembersContainer}>
{r6}
<AddMembersBody
channel={value4}
guild={guild}
pendingAdditions={property}
setPendingAdditions={property2}
/>
</View>
);
function _fun70986() { // fn#70986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:7935, offset: 0x00e655cf, size: 21 bytes, params: 1, frame: 2
env0_1.current = env0_0;
}
function _fun70987() { // fn#70987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:7976, offset: 0x01d11161, size: 317 bytes, params: 1, frame: 26
var push;
var moduleValue2;
var ADD_MODERATORS;
var object;
const {guildId, channelType, name, categoryId, onChannelCreated, flags} = env0_1.current;
const items2 = [];
const value3 = ChannelUtilsModule.permissionOverwritesForRoles(guildId, channelType, items2, true);
const Object = global.Object;
Object.values(env0_6).forEach(_fun70988);
let binding = env0_4;
if (!(binding || env0_5)) {
push = value3.push;
moduleValue2 = ChannelUtilsModule;
Reflect.apply(push, value3, [moduleValue2.permissionOverwriteForUser(Module00057.id, channelType)]);
}
const object2 = {overwrites: value3, guildId: guildId, channelType: channelType, name: name, categoryId: categoryId,
flags: flags};
const GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
if (channelType === GUILD_STAGE_VOICE) {
binding = env0_2;
push = binding.push;
ADD_MODERATORS = env1_27.ADD_MODERATORS;
object = {};
copyDataProperties(object, object2, items2);
object['guildId'] = guildId;
object['onChannelCreated'] = onChannelCreated;
Reflect.apply(push, binding, [ADD_MODERATORS, object]);
} else {
env0_8(object2);
}
function _fun70988({row}) { // fn#70988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:8157, offset: 0x01d1129e, 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__.__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, channelType)]);
} 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, channelType)]);
}
}
}
}
function _fun70989() { // fn#70989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:8609, offset: 0x01d11374, size: 291 bytes, params: 1, frame: 18
var value3;
var value4;
const channelType = env0_1.current.channelType;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const t = (IndexNativeModule).t;
const env0_0 = Reflect.apply(string, intl, [t['5Wxrcd']]);
const Object = global.Object;
if (Object.keys(env0_6).length > 0) {
if (channelType === ChannelTypes.GUILD_STAGE_VOICE) {
value4 = intl.string(t.PDTjLN);
} else {
value3 = intl.string(t.CumH4u);
}
}
env0_2.setOptions({headerRight: env0_7 ? _fun70990 : _fun70991});
function _fun70990() { // fn#70990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:8848, offset: 0x01d11497, size: 45 bytes, params: 1, frame: 13
const HeaderSubmittingIndicator = (NavigatorHeaderNativeModule).HeaderSubmittingIndicator;
return <HeaderSubmittingIndicator />;
}
function _fun70991() { // fn#70991, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:8893, offset: 0x01d114c4, size: 67 bytes, params: 1, frame: 14
const HeaderActionButton = (HeaderActionButtonNativeModule).HeaderActionButton;
return <HeaderActionButton text={env0_0} onPress={env1_9} />;
}
}
}
function getSceneTitle(a0, a1) { // fn#70992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:9262, offset: 0x01d11507, size: 376 bytes, params: 3, frame: 14
const intl = (IndexNativeModule).intl;
const t = (IndexNativeModule).t;
if (a1 != null) {
return intl.string(t.dEaPc4);
}
if (a0 === null) {
return intl.string(t['fUYU+j']);
}
const GUILD_TEXT = ChannelTypes.GUILD_TEXT;
if (GUILD_TEXT === a0) {
return intl.string(t['fUYU+j']);
}
const GUILD_VOICE = ChannelTypes.GUILD_VOICE;
if (GUILD_VOICE === a0) {
return intl.string(t['fUYU+j']);
}
const GUILD_STAGE_VOICE = ChannelTypes.GUILD_STAGE_VOICE;
if (GUILD_STAGE_VOICE === a0) {
return intl.string(t['fUYU+j']);
}
const GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
if (GUILD_ANNOUNCEMENT === a0) {
return intl.string(t['fUYU+j']);
}
const GUILD_FORUM = ChannelTypes.GUILD_FORUM;
if (GUILD_FORUM === a0) {
return intl.string(t['fUYU+j']);
}
const GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
if (GUILD_MEDIA === a0) {
return intl.string(t['fUYU+j']);
}
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
if (GUILD_CATEGORY === a0) {
return intl.string(t['ISN+NM']);
}
const Error = global.Error;
const value = 'Unsupported channelType: ' + a0;
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
const error = new Error();
throw error instanceof Object ? error : value2;
}
function CreateChannelModal(a0) { // fn#70993, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:9890, offset: 0x01d1167f, size: 104 bytes, params: 2, frame: 16
const env0_0 = a0;
const {screens, initialStack} = (UseInitialValue)(_fun70994);
const Navigator = (NavigatorNativeModule).Navigator;
return <Navigator screens={screens} initialRouteStack={initialStack} />;
function _fun70994() { // fn#70994, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:9937, offset: 0x01d116e7, size: 385 bytes, params: 1, frame: 24
const object = {};
let CREATE_CHANNEL = env1_27.CREATE_CHANNEL;
object.name = CREATE_CHANNEL;
const object2 = {};
copyDataProperties(object2, env0_0, undefined);
object.params = object2;
const items2 = [object];
const object3 = {};
CREATE_CHANNEL = env1_27.CREATE_CHANNEL;
const object4 = {};
const ImpressionNames = (AnalyticsUtilsModule).ImpressionNames;
const CHANNEL_ADD_INFO = ImpressionNames.CHANNEL_ADD_INFO;
object4.impressionName = CHANNEL_ADD_INFO;
const ImpressionGroups = (AnalyticsUtilsModule).ImpressionGroups;
let CHANNEL_ADD_FLOW = ImpressionGroups.CHANNEL_ADD_FLOW;
object4.impressionProperties = {impression_group: CHANNEL_ADD_FLOW};
object4.render = render_70995;
object3[CREATE_CHANNEL] = object4;
const ADD_MEMBERS = env1_27.ADD_MEMBERS;
const intl = (IndexNativeModule).intl;
const string = intl.string;
const t = (IndexNativeModule).t;
const CHANNEL_ADD_MEMBERS = ImpressionNames.CHANNEL_ADD_MEMBERS;
CHANNEL_ADD_FLOW = ImpressionGroups.CHANNEL_ADD_FLOW;
object3[ADD_MEMBERS] = {headerTitle: Reflect.apply(string, intl, [t.dMJ3Y6]), impressionName: CHANNEL_ADD_MEMBERS,
impressionProperties: {impression_group: CHANNEL_ADD_FLOW}, render: render_70996};
const ADD_MODERATORS = env1_27.ADD_MODERATORS;
object3[ADD_MODERATORS] = {headerTitle: intl.string(t.n3bcy8), render: render_70997};
return {screens: object3, initialStack: items2};
function render_70995(a0) { // fn#70995, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:10171, offset: 0x01d11868, size: 33 bytes, params: 2, frame: 13
return <CreateChannel {...a0} />;
}
function render_70996(a0) { // fn#70996, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:10418, offset: 0x01d11889, size: 33 bytes, params: 2, frame: 13
return <AddMembers {...a0} />;
}
function render_70997(a0) { // fn#70997, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9268:10522, offset: 0x01d118aa, size: 49 bytes, params: 2, frame: 14
const value = environment.__proto__.__proto__;
return ((Component) => <Component {...a0} />)(AddModerators);
}
}
}
}
global.__d(_fun70971, 9083, [57, 31, 27, 1383, 1422, 1379, 1867, 3784, 3793, 1878, 661, 8120, 33, 4501, 697, 6691,
6698, 6711, 6707, 6704, 6697, 6689, 6696, 6708, 6706, 6703, 1244, 4573, 6766, 1948, 3874, 6238, 7989, 7972,
1305, 5463, 566, 44, 4805, 4807, 9084, 1484, 9085, 4863, 5282, 9087, 5277, 9088, 22, 4800, 4572, 7682, 6985,
6231, 9091, 6808, 6705, 9095, 480, 9108, 6518, 5280,
2]) /* metro module 9083, dependencies: [57, 31, 27, 1383, 1422, 1379, 1867, 3784, 3793, 1878, 661, 8120, 33, 4501, 697, 6691, 6698, 6711, 6707, 6704, 6697, 6689, 6696, 6708, 6706, 6703, 1244, 4573, 6766, 1948, 3874, 6238, 7989, 7972, 1305, 5463, 566, 44, 4805, 4807, 9084, 1484, 9085, 4863, 5282, 9087, 5277, 9088, 22, 4800, 4572, 7682, 6985, 6231, 9091, 6808, 6705, 9095, 480, 9108, 6518, 5280, 2] */;