/* Metro module 15324; source: modules/launchpad/native/LaunchPadUnreadServers.tsx; dependencies: [31, 27, 1379, 4605, 1878, 661, 33, 4501, 697, 6947, 15325, 566, 1305, 9719, 5475, 10254, 4603, 4601, 9608, 14532, 1357, 1478, 15330, 1244, 8140, 2] */ function _fun117189(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:6, offset: 0x024a78e6, size: 579 bytes, params: 8, frame: 23 var object2; const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = importAll(31) /* metro dependency 31 */; const value2 = require(27) /* metro dependency 27 */; const env0_4 = value2.Pressable; const env0_5 = value2.View; const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */; const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */; const userStore = importDefault(1878) /* metro dependency 1878: UserStore */; const env0_9 = (require(661) /* metro dependency 661: Constants */).ChannelTypes; const value3 = require(33) /* metro dependency 33 */; const env0_10 = value3.jsx; const env0_11 = value3.jsxs; const createStylesModule = require(4501) /* metro dependency 4501: createStyles */; const createStyles = createStylesModule.createStyles; object2 = {}; object2.listWrapper = {marginTop: 8}; object2.list = {'marginBottom': 4, 'flexShrink': 0}; const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW; object2.maskStrokeStyle = {backgroundColor: BACKGROUND_BASE_LOW}; object2.privateChannelWrapper = {'position': 'relative', 'paddingVertical': 2, 'justifyContent': 'center', 'alignItems': 'center'}; object2.privateChannelIcon = {'width': 48, 'height': 48, 'borderRadius': 24, 'overflow': 'hidden'}; object2.badgeWrapper = {'position': 'absolute', 'top': '50%', 'left': '50%', 'marginLeft': 6, 'marginTop': 6}; object2.guildWrapper = {'paddingVertical': 2, 'justifyContent': 'center', 'alignItems': 'center'}; object2.guildHistorySeparatorWrapper = {'flex': 1, 'justifyContent': 'center', 'alignItems': 'center'}; const object3 = {'width': 2, 'height': 32}; object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round; const BACKGROUND_MOD_STRONG = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_STRONG; object3.backgroundColor = BACKGROUND_MOD_STRONG; object2.guildHistorySeparator = object3; const env0_12 = Reflect.apply(createStyles, createStylesModule, [object2]); const env0_13 = value.memo(GuildItemInner); const env0_14 = value.memo(PrivateChannelItemInner); value = value.memo(LaunchPadUnreadServers); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/launchpad/native/LaunchPadUnreadServers.tsx'); exports.default = value; } function HistorySeparator() { // fn#117190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:2345, offset: 0x024a7b29, size: 71 bytes, params: 1, frame: 17 const styles = useStyles(); return ( ); } function renderHistorySection() { // fn#117191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:2480, offset: 0x024a7b70, size: 23 bytes, params: 1, frame: 13 return ; } function GuildItemInner({guildId, selected, onGuildSelect}) { // fn#117192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:937, offset: 0x024a7b87, size: 212 bytes, params: 2, frame: 22 const styles = useStyles(); const binding = env0_3; return ( {((Component) => )(importDefault(15325) /* metro dependency 15325: SimpleGuild */)} ); } function PrivateChannelItemInner({channelId}) { // fn#117195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:1299, offset: 0x024a7c88, size: 669 bytes, params: 2, frame: 26 var r0; var items2; var value10; var value; const styles = useStyles(); const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() { return ChannelStore.getChannel(channelId); }); const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], _fun117197); const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ReadStateStore], _fun117198); const type = channel?.type; const DM = ChannelTypes.DM; let r6 = type !== DM ? channel == null ? channel != null ? ((Component) => )(importDefault(5475) /* metro dependency 5475: FastImage */) : undefined : channel.isGroupDM() ? ((Component) => )(importDefault(9719) /* metro dependency 9719: GroupDMAvatar */) : channel != null ? ((Component) => )(importDefault(5475) /* metro dependency 5475: FastImage */) : undefined : value3 != null ? ((Avatar) => )((require(1305) /* metro dependency 1305: native */).Avatar) : channel == null ? channel != null ? ((Component) => )(importDefault(5475) /* metro dependency 5475: FastImage */) : undefined : channel.isGroupDM() ? ((Component) => )(importDefault(9719) /* metro dependency 9719: GroupDMAvatar */) : channel != null ? ((Component) => )(importDefault(5475) /* metro dependency 5475: FastImage */) : undefined; const binding = env0_3; const useCallback = binding.useCallback; if (channel != null) { var pressableBindingProps = {onPress: Reflect.apply(useCallback, binding, [_fun117199, [value3, channel]]), style: styles.privateChannelWrapper, accessibilityRole: 'button', accessible: true}; items2 = [r6]; value10 = value4 > 0; if (value10) { var viewBindingProps = {style: styles.badgeWrapper}; value = importDefault(9608) /* metro dependency 9608: MaskedBadge */; value = {((Component) => )(value)}; r6 = value; } else { r6 = value10; } items2[1] = r6; value = {items2}; r0 = value; } else { r0 = null; } return r0; } function LaunchPadUnreadServers({selectedGuildId, setSelectedGuild, unreadPrivateChannelIds, unreadGuilds, guildHistory, visible}) { // fn#117200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:2556, offset: 0x024a8040, size: 742 bytes, params: 2, frame: 35 var r0; var moduleValue2; var renderCategoryItem; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var string; const t = (require(1244) /* metro dependency 1244: indexNative */).t; var items3; const AnimatedFastList = (require(8140) /* metro dependency 8140: FastList */).AnimatedFastList; var items2; const env0_3 = unreadGuilds; const styles = useStyles(); const value2 = (require(14532) /* metro dependency 14532: RedesignCategory */).useCategoryStyles(); const value3 = (importDefault(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */)('LaunchPadUnreadServers'); const width = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)().width; const binding = env0_3; const env0_6 = binding.useRef(-1); let useCallback = binding.useCallback; const value4 = Reflect.apply(useCallback, binding, [_fun117201, [setSelectedGuild, selectedGuildId]]); binding.useEffect(function() { return _fun117204; }, []); const value6 = binding.useRef(null); binding.useEffect(_fun117205, [visible]); const value7 = binding.useCallback(_fun117206, [unreadGuilds, unreadPrivateChannelIds, selectedGuildId, value4, guildHistory]); useCallback = binding.useCallback; let length = unreadGuilds.length; const value8 = Reflect.apply(useCallback, binding, [function(a0) { var value = 0; return a0 !== 2 ? value : guildHistory.length > value && (unreadPrivateChannelIds.length > value || unreadGuilds.length > value) ? 10 : value; }, [length, unreadPrivateChannelIds.length, guildHistory.length]]); let r20 = unreadGuilds.length > 0 || unreadPrivateChannelIds.length > 0; if (r20) { var viewBindingProps = {style: styles.listWrapper}; moduleValue2 = require(14532) /* metro dependency 14532: RedesignCategory */; renderCategoryItem = moduleValue2.renderCategoryItem; string = intl.string; r20 = r20 ? Reflect.apply(string, intl, [t.xSY9BH]) : Reflect.apply(string, intl, [t.kCt2zG]); items3 = [Reflect.apply(renderCategoryItem, moduleValue2, [{name: r20, styles: value2, isRefreshEnabled: value3}])]; var animatedFastListProps = {ref: value6, style: styles.list, horizontal: true, renderItem: value7, renderSection: renderHistorySection, sectionSize: value8}; length = unreadPrivateChannelIds.length; items2 = [length]; length = unreadGuilds.length; items2[1] = length; length = guildHistory.length; items2[2] = length; animatedFastListProps.sections = items2; animatedFastListProps.itemSize = 58; animatedFastListProps.headerSize = 19; animatedFastListProps.footerSize = 19; animatedFastListProps.chunkBase = width; animatedFastListProps.showsHorizontalScrollIndicator = false; animatedFastListProps.showsVerticalScrollIndicator = false; animatedFastListProps.stickySectionsVariant = 'disabled'; animatedFastListProps.keyboardShouldPersistTaps = 'always'; items3[1] = ; r0 = {items3}; } else { length = guildHistory.length; if (length > 0) { var viewBindingProps = {style: styles.listWrapper}; moduleValue2 = require(14532) /* metro dependency 14532: RedesignCategory */; renderCategoryItem = moduleValue2.renderCategoryItem; string = intl.string; r20 = r20 ? Reflect.apply(string, intl, [t.xSY9BH]) : Reflect.apply(string, intl, [t.kCt2zG]); items3 = [Reflect.apply(renderCategoryItem, moduleValue2, [{name: r20, styles: value2, isRefreshEnabled: value3}])]; var animatedFastListProps = {ref: value6, style: styles.list, horizontal: true, renderItem: value7, renderSection: renderHistorySection, sectionSize: value8}; length = unreadPrivateChannelIds.length; items2 = [length]; length = unreadGuilds.length; items2[1] = length; length = guildHistory.length; items2[2] = length; animatedFastListProps.sections = items2; animatedFastListProps.itemSize = 58; animatedFastListProps.headerSize = 19; animatedFastListProps.footerSize = 19; animatedFastListProps.chunkBase = width; animatedFastListProps.showsHorizontalScrollIndicator = false; animatedFastListProps.showsVerticalScrollIndicator = false; animatedFastListProps.stickySectionsVariant = 'disabled'; animatedFastListProps.keyboardShouldPersistTaps = 'always'; items3[1] = ; r0 = {items3}; } else { r0 = null; } } return r0; } function _fun117194() { // fn#117194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:1064, offset: 0x024a7c5b, size: 45 bytes, params: 1, frame: 12 let value = environment.__proto__; value = require(6947) /* metro dependency 6947: transitionToGuildNative */; value.transitionToGuild(guildId); } function _fun117197() { // fn#117197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:1451, offset: 0x024a7f25, size: 71 bytes, params: 1, frame: 13 return channel != null && channel.isPrivate() ? UserStore.getUser(channel.getRecipientId()) : undefined; } function _fun117198() { // fn#117198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:1552, offset: 0x024a7f6c, size: 47 bytes, params: 1, frame: 12 return channel != null ? ReadStateStore.getMentionCount(channel.id) : 0; } function _fun117199() { // fn#117199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:1940, offset: 0x024a7f9b, size: 165 bytes, params: 1, frame: 16 var type; var value2; var moduleValue; if (channel != null) { type = channel.type; value2 = environment.__proto__; if (type !== ChannelTypes.DM) { moduleValue = require(4601) /* metro dependency 4601: transitionToChannel */; moduleValue.transitionToChannel(channel.id, {navigationReplace: true}); } else if (env0_2 != null) { (importDefault(4603) /* metro dependency 4603: ChannelActionCreators */).openPrivateChannel({recipientIds: [env0_2.id]}); } else { moduleValue = require(4601) /* metro dependency 4601: transitionToChannel */; moduleValue.transitionToChannel(channel.id, {navigationReplace: true}); } } } function _fun117201(a0) { // fn#117201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:2823, offset: 0x024a8326, size: 191 bytes, params: 2, frame: 16 var environment; var binding; var clearTimeout; var value5; const value = a0; if (env0_6.current >= 0) { clearTimeout = global.clearTimeout; binding = env0_6; clearTimeout(binding.current); binding.current = -1; value5 = environment.__proto__; } else { var value4 = undefined; if ((importDefault(15330) /* metro dependency 15330: isGuildSelectable */)(value)) { setSelectedGuild(value === selectedGuildId ? value4 : value); env0_6.current = global.setTimeout(_fun117202, 400); return value4; } clearTimeout = global.clearTimeout; binding = env0_6; clearTimeout(binding.current); binding.current = -1; } (require(6947) /* metro dependency 6947: transitionToGuildNative */).transitionToGuild(value); } function _fun117203() { // fn#117203, offset: 0x024a840e, size: 11 bytes, params: 1, frame: 1 return _fun117204; } function _fun117205() { // fn#117205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:3117, offset: 0x024a8419, size: 42 bytes, params: 1, frame: 11 var current; if (visible) { current = env0_8.current; if (current != null) { current.scrollToTop(false); } } } function _fun117206(a0, a1) { // fn#117206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:3200, offset: 0x024a8443, size: 159 bytes, params: 3, frame: 17 var r7; var r0; var value; var property; if (a0 === 0) { property = unreadPrivateChannelIds[a1]; value = property != null; if (value) { value = environment.__proto__; value = ((Component) => )(env1_14); r0 = value; } else { r0 = value; } return r0; } if (a0 >= 1) { r7 = a0 === 1 ? unreadGuilds[a1] : guildHistory[a1]; value = r7 != null; if (value) { value = environment.__proto__; value = ((Component) => )(env1_13); r0 = value; } else { r0 = value; } return r0; } return null; } function _fun117202() { // fn#117202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15521:2975, offset: 0x024a83e5, size: 41 bytes, params: 1, frame: 12 const clearTimeout = global.clearTimeout; const binding = env1_6; clearTimeout(binding.current); binding.current = -1; }