// Module ID: 12716 // Function ID: 12717 // Name: UserProfileMutuals // Dependencies: [19, 17, 8932, 5882, 21, 4380, 8935, 12160, 12476, 4347, 12166, 2009, 8930, 6066, 4949, 12509, 1297, 4376, 12167, 12176, 5885, 12161, 2] // Exports: default // Module 12716 (UserProfileMutuals) import noopAll from "noop" /* 19 */; import { View } from "get ActivityIndicator" /* 17 */; import { UserProfileSections } from "USER_PROFILE_TOOLTIP_DELAY" /* 8932 */; import { DIVIDER_DOT } from "ARBITRARY_LARGE_OFFSET" /* 5882 */; import jsxProd from "jsxProd" /* 21 */; import createCacheKey from "createCacheKey" /* 4380 */; const require = arg1; noopAll; ({ jsx: closure_6, jsxs: error } = jsxProd); let c8 = "text-sm/medium"; let c9 = "text-default"; let closure_10 = createCacheKey.createStyles({ container: { flexDirection: "row", columnGap: 4, flexWrap: "wrap" }, section: { flexDirection: "row", alignItems: "center", columnGap: 6 } }); const result = require("set").fileFinishedImporting("modules/user_profile/native/UserProfileMutuals.tsx"); export default function UserProfileMutuals(user) { user = user.user; const guildId = user.guildId; dependencyMap = undefined; c3 = undefined; const tmp = callback2(); let obj = user(8935); const userProfileAnalyticsContext = obj.useUserProfileAnalyticsContext(); ({ context: c2, trackUserProfileAction: c3 } = userProfileAnalyticsContext); ({ mutualFriends, mutualGuilds } = guildId(12160)(user)); if (guildId(12476)(user)) { let tmp7 = null != mutualFriends; if (tmp7) { tmp7 = mutualFriends.length > 0; } let tmp8 = null != mutualGuilds; if (tmp8) { tmp8 = mutualGuilds.length > 0; } if (!tmp7) { if (!tmp8) { return null; } } obj = { style: null, children: null }; obj[0] = tmp.container; let tmp9Result = null; if (tmp7) { const substr = mutualFriends.slice(0, 3); const mapped = substr.map((user) => user.user); obj = { style: null, accessibilityRole: "button", onPress: null, children: null }; obj[0] = tmp.section; obj[2] = function onPress() { const MUTUAL_FRIENDS = closure_1_4.MUTUAL_FRIENDS; _undefined2({ action: "PRESS_SECTION", section: MUTUAL_FRIENDS }); let obj = guildId(_undefined[9]); obj = { user, section: MUTUAL_FRIENDS, guildId, onPressMutualFriend(userId) { callback({ action: "PRESS_MUTUAL_FRIEND" }); const obj = {}; const merged = Object.assign(closure_2); obj.userId = userId; closure_1_1(closure_1_2[12])(obj); }, onPressMutualGuild(arg0) { callback({ action: "PRESS_MUTUAL_GUILD" }); closure_1_0(closure_1_2[13]).transitionToGuild(arg0); const obj = closure_1_0(closure_1_2[13]); closure_1_1(closure_1_2[9]).hideActionSheet(); const obj2 = closure_1_1(closure_1_2[9]); closure_1_1(closure_1_2[9]).hideActionSheet(); } }; obj.openLazy(user(_undefined[11])(_undefined[10], _undefined.paths), "UserProfileMutualsActionSheet", obj, "stack"); }; obj1 = { size: null, totalCount: null, names: null, children: null }; obj1[0] = tmp2(1297).AvatarSizes.SIZE_16; obj1[1] = mapped.length; obj1[2] = mapped.map((username) => username.username); obj1[3] = mapped.map((id) => callback(user(_undefined[16]).Avatar, { user: id, size: user(_undefined[16]).AvatarSizes.SIZE_16, guildId: "r" }, id.id)); const items = [callback(tmp2(12509).AvatarPile, obj1), ]; let obj2 = { variant: null, color: null, children: null }; obj2[0] = c8; obj2[1] = c9; obj2[2] = tmp5(12167)(mutualFriends.length); items[1] = callback(tmp2(4376).Text, obj2); obj[3] = items; tmp9Result = tmp9(tmp2(4949).PressableOpacity, obj); } const items1 = [tmp9Result, , ]; let tmp15 = tmp7; if (tmp7) { tmp15 = tmp8; } if (tmp15) { const obj3 = { variant: null, color: null, accessibilityElementsHidden: true, importantForAccessibility: "no-hide-descendants", children: null }; obj3[0] = c8; obj3[1] = c9; obj3[4] = DIVIDER_DOT; tmp15 = callback(tmp2(4376).Text, obj3); } items1[1] = tmp15; tmp9Result = null; if (tmp8) { const substr1 = mutualGuilds.slice(0, 3); const mapped1 = substr1.map((guild) => guild.guild); const obj4 = { style: null, accessibilityRole: "button", onPress: null, children: null }; obj4[0] = tmp.section; obj4[2] = function onPress() { const MUTUAL_GUILDS = closure_1_4.MUTUAL_GUILDS; _undefined2({ action: "PRESS_SECTION", section: MUTUAL_GUILDS }); let obj = guildId(_undefined[9]); obj = { user, section: MUTUAL_GUILDS, guildId, onPressMutualFriend(userId) { callback({ action: "PRESS_MUTUAL_FRIEND" }); const obj = {}; const merged = Object.assign(closure_2); obj.userId = userId; closure_1_1(closure_1_2[12])(obj); }, onPressMutualGuild(arg0) { callback({ action: "PRESS_MUTUAL_GUILD" }); closure_1_0(closure_1_2[13]).transitionToGuild(arg0); const obj = closure_1_0(closure_1_2[13]); closure_1_1(closure_1_2[9]).hideActionSheet(); const obj2 = closure_1_1(closure_1_2[9]); closure_1_1(closure_1_2[9]).hideActionSheet(); } }; obj.openLazy(user(_undefined[11])(_undefined[10], _undefined.paths), "UserProfileMutualsActionSheet", obj, "stack"); }; let tmp21 = !tmp7; if (!tmp7) { const obj5 = { size: null, totalCount: null, names: null, children: null }; obj5[0] = tmp2(5885).GuildIconSizes.XXSMALL; obj5[1] = mapped1.length; obj5[2] = mapped1.map((name) => name.name); obj5[3] = mapped1.map((guild) => { const obj = { guild, size: user(_undefined[20]).GuildIconSizes.XXSMALL }; return callback(guildId(_undefined[20]), obj, guild.id); }); tmp21 = callback(tmp2(12176).GuildIconPile, obj5); } const items2 = [tmp21, ]; const obj6 = { variant: null, color: null, children: null }; obj6[0] = c8; obj6[1] = c9; obj6[2] = tmp5(12161)(mutualGuilds.length); items2[1] = callback(tmp2(4376).Text, obj6); obj4[3] = items2; tmp9Result = tmp9(tmp2(4949).PressableOpacity, obj4); } items1[2] = tmp9Result; obj[1] = items1; return closure_7(c3, obj); } else { return null; } const tmp6 = guildId(12160)(user); };