/* Metro module 15934; source: modules/guild_settings/native/GuildSettingsModalChannels.tsx; dependencies: [6, 7, 15, 17, 18, 31, 27, 1379, 1867, 3784, 3793, 1878, 15860, 661, 33, 4501, 6597, 697, 1244, 4002, 673, 7972, 1305, 15935, 3868, 566, 6647, 4805, 5278, 1585, 4578, 6802, 9087, 10083, 15936, 15937, 15858, 11427, 13761, 3789, 6593, 4647, 5277, 15938, 5462, 8148, 1484, 44, 4584, 2] */ import ClassCallCheck from '../../../by-id/module-00006-ClassCallCheck.js'; /* Metro dependency 6 */ import CreateClass from '../../../by-id/module-00007-CreateClass.js'; /* Metro dependency 7 */ import PossibleConstructorReturn from '../../../by-id/module-00015-PossibleConstructorReturn.js'; /* Metro dependency 15 */ import Module00017 from '../../../by-id/module-00017.js'; /* Metro dependency 17 */ import Inherits from '../../../by-id/module-00018-Inherits.js'; /* Metro dependency 18 */ import Module00044 from '../../../by-id/module-00044.js'; /* Metro dependency 44 */ import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */ import ChannelStore from '../../../stores/ChannelStore.tsx'; /* Metro dependency 1379 */ import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */ 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 TextStyles from '../../rebrand/native/TextStyles.tsx'; /* Metro dependency 6597 */ import GuildSettingsModalChannelsActionCreators from '../GuildSettingsModalChannelsActionCreators.tsx'; /* Metro dependency 15858 */ import GuildSettingsModalChannelsStore from '../GuildSettingsModalChannelsStore.tsx'; /* Metro dependency 15860 */ import SortableChannels from '../../../components_native/common/SortableChannels.tsx'; /* Metro dependency 15938 */ 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 JsxRuntimeModule from '../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */ import * as FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ import * as ColorUtilsModule from '../../../external/discord_common/js/shared/utils/ColorUtils.tsx'; /* Metro dependency 673 */ import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */ import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */ import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */ import * as NativeModule2 from '../../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */ import * as SharedModule from '../../../design/shared.tsx'; /* Metro dependency 4002 */ import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as UseChannelNameModule from '../../channel/useChannelName.tsx'; /* Metro dependency 4805 */ import * as HeaderActionButtonNativeModule from '../../../design/components/Navigator/native/HeaderActionButton.native.tsx'; /* Metro dependency 5277 */ import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */ import * as NavScrimAndroidModule from '../../../design/components/Navigator/native/NavScrim.android.tsx'; /* Metro dependency 5462 */ import * as ChannelUtilsModule from '../../../utils/native/ChannelUtils.tsx'; /* Metro dependency 6647 */ import * as NativeModule3 from '../../../design/void/Form/native/index.tsx'; /* Metro dependency 7972 */ import * as ChannelSettingsActionCreatorsModule from '../../../actions/ChannelSettingsActionCreators.tsx'; /* Metro dependency 8148 */ import * as ChannelSortingUtilsModule from '../../../utils/ChannelSortingUtils.tsx'; /* Metro dependency 15936 */ function _fun122895(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#122895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:6, offset: 0x02579a95, size: 996 bytes, params: 8, frame: 33 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const StyleSheet = ReactNativeModule.StyleSheet; const Fonts = ConstantsModule.Fonts; const createLegacyClassComponentStyles = CreateStylesModule.createLegacyClassComponentStyles; object = {}; const object2 = {}; let PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD; const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY; copyDataProperties(object2, TextStyles(PRIMARY_SEMIBOLD, MOBILE_TEXT_HEADING_PRIMARY, 16), undefined); object2['textTransform'] = 'capitalize'; object.headerRight = object2; const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW; object.containerView = {flex: 1, backgroundColor: BACKGROUND_BASE_LOW}; const object4 = {}; const DISPLAY_EXTRABOLD = Fonts.DISPLAY_EXTRABOLD; let TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE; copyDataProperties(object4, TextStyles(DISPLAY_EXTRABOLD, TEXT_SUBTLE, 12, {uppercase: true}), 12); object.categoryText = object4; object.categoryView = {'paddingTop': 36, 'paddingBottom': 8}; object.sortingCategoryView = {paddingTop: 16}; const object7 = {}; PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD; TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE; copyDataProperties(object7, TextStyles(PRIMARY_SEMIBOLD, TEXT_SUBTLE, 14), 12); object.edit = object7; object.row = {marginTop: -StyleSheet.hairlineWidth}; object.formRowStyle = {paddingVertical: 12}; const GREEN_360 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.GREEN_360; object.dropHighlight = {backgroundColor: GREEN_360, opacity: 0.3}; object.floatingActionButtonContainer = {'position': 'absolute', 'bottom': 16, 'right': 0, 'left': 0, 'flexDirection': 'row', 'justifyContent': 'center'}; const env0_23 = Reflect.apply(createLegacyClassComponentStyles, CreateStylesModule, [object]); let PureComponent = ReactModule.PureComponent; const value9 = _fun122909(PureComponent); const ThemeContext = (NativeModule2).ThemeContext; value9.contextType = ThemeContext; PureComponent = ReactModule.PureComponent; _fun122914(PureComponent).contextType = ThemeContext; PureComponent = ReactModule.PureComponent; _fun122917(PureComponent).contextType = ThemeContext; (FileImportTrackerModule).fileFinishedImporting('modules/guild_settings/native/GuildSettingsModalChannels.tsx'); exports.default = GuildSettingsModalChannelsConnected; function _callSuper_122896(a0, a1, a2) { // fn#122896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:387, offset: 0x02579e79, size: 100 bytes, params: 4, frame: 20 var r0; var Reflect; let value = a2; const value3 = Module00017(a1); if (_isNativeReflectConstruct_122897()) { Reflect = global.Reflect; value = Reflect.construct(value3, value || [], Module00017(a0).constructor); r0 = value; } else { value = value3.apply(a0, value); r0 = value; } return PossibleConstructorReturn(a0, r0); } function _isNativeReflectConstruct_122897() { // fn#122897, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:518, offset: 0x02579edd, size: 98 bytes, params: 1, frame: 18 var Boolean; var prototype; var valueOf; var call; var Reflect; var construct; var closure; var value; var error; try { Boolean = global.Boolean; prototype = Boolean.prototype; valueOf = prototype.valueOf; call = valueOf.call; Reflect = global.Reflect; construct = Reflect.construct; Boolean = global.Boolean; closure = function() { }; value = Reflect.apply(construct, Reflect, [Boolean, [], closure]); value = Reflect.apply(call, valueOf, [value]); var result = !value; } catch (error) { } return (_isNativeReflectConstruct_122897_isNativeReflectConstruct = function() { return !!result; })(); } function ChannelItem({style, channelIconStyle, actionIconStyle, channel, sortingEnabled, onPress, sortHandlers}) { // fn#122900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:2482, offset: 0x02579f3f, size: 783 bytes, params: 2, frame: 38 const value3 = (CreateStylesModule).useLegacyClassComponentStyles(env0_23); const useThemeContext = SharedModule.useThemeContext; const theme = Reflect.apply(useThemeContext, SharedModule, []).theme; const value4 = (FluxModule).useStateFromStores([PermissionStore], _fun122901, [channel]); sortHandlers = !value4 ? undefined : sortHandlers; const channelIcon = (ChannelUtilsModule).getChannelIcon(channel); const channelIconComponent = (ChannelUtilsModule).getChannelIconComponent(channel); object = {accessibilityRole: 'button'}; const isThemeDark2 = SharedModule.isThemeDark(theme); const hex2rgb = ColorUtilsModule.hex2rgb; const unsafe_rawColors = (Native).unsafe_rawColors; let r7 = isThemeDark2 ? Reflect.apply(hex2rgb, ColorUtilsModule, [unsafe_rawColors.PRIMARY_700, 0.6]) : Reflect.apply(hex2rgb, ColorUtilsModule, [unsafe_rawColors.PRIMARY_200, 0.6]); object.underlayColor = r7 ?? undefined; object.style = style; copyDataProperties(object, sortHandlers, undefined); r7 = sortingEnabled ? value4 ? null : {opacity: 0.3} : null; const FormRow = (require(7972) /* metro dependency 7972: native */).FormRow; const formRowProps = {leading: channelIconComponent != null ? ((Component) => )(channelIconComponent) : ((Icon) => )((require(7972) /* metro dependency 7972: native */).FormRow.Icon), style: value3.formRowStyle}; formRowProps.label = UseChannelNameModule.computeChannelName(channel, UserStore, RelationshipStore); formRowProps.onPress = sortingEnabled ? undefined : function() { return onPress(channel.id); }; formRowProps.trailing = ( value4 && sortingEnabled ? ((Icon) => )((require(7972) /* metro dependency 7972: native */).FormRow.Icon) : null ); formRowProps.numberOfLines = sortingEnabled ? 1 : undefined; return ( ); function _fun122901() { // fn#122901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:2723, offset: 0x0257a24e, size: 112 bytes, params: 1, frame: 15 return channel.parent_id == null ? PermissionStore.canWithPartialContext(Permissions.MANAGE_CHANNELS, {guildId: channel.guild_id}) : PermissionStore.canWithPartialContext(Permissions.MANAGE_CHANNELS, {channelId: channel.parent_id}); } } function isValidDrop(a0, a1) { // fn#122903, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:4048, offset: 0x0257a2be, size: 110 bytes, params: 3, frame: 16 return a0 != null && (a0.parentId == null ? PermissionStore.can(Permissions.MANAGE_CHANNELS, a1) : PermissionStore.can(Permissions.MANAGE_CHANNELS, ChannelStore.getChannel(a0.parentId))); } function CreateButton({guild}) { // fn#122904, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:16142:4186, offset: 0x0257a32c, size: 332 bytes, params: 2, frame: 24 var r0; var Button; var intl; const value2 = (CreateStylesModule).useLegacyClassComponentStyles(env0_23); const value3 = env0_9.useMemo(function() { return {bottom: 16 + bottom}; }, [(importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom]); const permissionStoreBinding = PermissionStore; const can = permissionStoreBinding.can; const MANAGE_CHANNELS = Permissions.MANAGE_CHANNELS; if (Reflect.apply(can, permissionStoreBinding, [MANAGE_CHANNELS, guild])) { var viewBindingProps = {style: [value2.floatingActionButtonContainer, value3]}; Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; r0 = (