/* Metro module 8489; source: modules/user_profile/native/UserProfilePreview.tsx; dependencies: [57, 31, 27, 7624, 6816, 33, 4501, 697, 566, 8490, 8494, 8496, 6882, 8497, 8402, 8498, 8403, 8501, 8502, 3868, 8503, 8505, 8507, 8476, 8510, 8511, 8513, 8695, 8762, 8474, 2] */ import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */ import UserProfileSettingsStore from '../UserProfileSettingsStore.tsx'; /* Metro dependency 7624 */ import UseDisplayProfile from '../hooks/useDisplayProfile.tsx'; /* Metro dependency 8490 */ import UseProfileTheme from '../hooks/useProfileTheme.tsx'; /* Metro dependency 8494 */ import UserProfileSharedStyles from './UserProfileSharedStyles.tsx'; /* Metro dependency 8496 */ import UseBadges from '../hooks/useBadges.tsx'; /* Metro dependency 8501 */ import UserProfileBanner from './UserProfileBanner.tsx'; /* Metro dependency 8507 */ import UserProfileAvatar from './UserProfileAvatar.tsx'; /* Metro dependency 8510 */ import UserProfileGradientContainer from './UserProfileGradientContainer.tsx'; /* Metro dependency 8511 */ import UserProfilePrimaryInfo from './UserProfilePrimaryInfo.tsx'; /* Metro dependency 8695 */ 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 NativeModule from '../../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */ import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */ import * as ConstantsModule from './Constants.tsx'; /* Metro dependency 6816 */ import * as UserSettingToActivityModule from '../../custom_status/utils/userSettingToActivity.tsx'; /* Metro dependency 6882 */ import * as ProfileCustomizationUtilsModule from '../../profile_customization/ProfileCustomizationUtils.tsx'; /* Metro dependency 8402 */ import * as RecentAvatarUtilsModule from '../../recent_avatars/RecentAvatarUtils.tsx'; /* Metro dependency 8403 */ import * as ConstantsModule2 from '../../collectibles/profile_effects/constants.tsx'; /* Metro dependency 8476 */ import * as UseUserProfileColorsModule from '../hooks/native/useUserProfileColors.tsx'; /* Metro dependency 8497 */ function _fun67343(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67343, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8674:6, offset: 0x01c1ee98, size: 280 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ConstantsModule; const env0_7 = value.PROFILE_CONTENT_WITHOUT_STATUS_TOP_PADDING; const env0_8 = value.UserProfileThemeTypes; value = require(33) /* metro dependency 33 */; const env0_9 = value.jsx; const env0_10 = value.jsxs; const filterLayer = function(a0) { return a0.responsive !== true; }; const env0_12 = (CreateStylesModule).createStyles(_fun67345); (FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfilePreview.tsx'); exports.default = UserProfilePreview; function _fun67345(a0, a1, a2) { // fn#67345, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8674:312, offset: 0x01c1efc1, size: 242 bytes, params: 4, frame: 17 let value = a2; const object = {}; object.profileContainer = {'position': 'relative', 'width': '100%', maxWidth: value ?? 263}; const object3 = {overflow: 'hidden'}; object3.minHeight = a0 ? undefined : 350; value = 1; object3.borderWidth = a1 ? undefined : value; const colors = (importDefault(697) /* metro dependency 697: native */).colors; object3.borderColor = a1 ? colors.BORDER_MUTED : colors.BACKGROUND_SURFACE_HIGH; object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg; object.profileContentContainer = object3; object.profileInnerContent = {flexGrow: value}; const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12; object.aboutMeCard = {marginTop: PX_12}; object.profileEffect = {zIndex: value}; return object; } function UserProfilePreview({user, accessibilityLabel, displayName, guildId, profileEffectOverride, profileEffectRestartKey, profileFrameOverride, displayNameStylesOverride, style, compact, hideFrame, maxWidth, additionalBadges = []}) { // fn#67346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8674:800, offset: 0x01c1f0b3, size: 2185 bytes, params: 2, frame: 62 var profileFrame; var r1; var moduleValue5; compact = !(compact === undefined) && compact; hideFrame = !(hideFrame === undefined) && hideFrame; const env0_3 = undefined; var env0_4 = undefined; const {pendingAvatar, pendingBanner, pendingAccentColor, pendingThemeColors, pendingAvatarDecoration, pendingProfileEffect, pendingProfileFrame, pendingDisplayNameStyles, pendingGlobalName, pendingPronouns, pendingLegacyUsernameDisabled} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([UserProfileSettingsStore], function() { return UserProfileSettingsStore.getPendingChanges(guildId); }); const value6 = (UseDisplayProfile)(user.id, guildId); const {theme, primaryColor, secondaryColor} = (UseProfileTheme)({user: user, displayProfile: value6, pendingThemeColors: pendingThemeColors}); const value8 = primaryColor != null; const styles = useStyles(compact, value8, maxWidth); const value9 = (UserProfileSharedStyles)(); const value10 = (UserSettingToActivityModule).useCustomStatusActivity(); let r29 = value10 != null && !compact; const {gradientFallbackBackground, avatarBackground, containerBackground} = (UseUserProfileColorsModule).useUserProfileColors({theme: theme, primaryColor: primaryColor, secondaryColor: secondaryColor}); const r16 = profileEffectOverride === undefined ? pendingProfileEffect : profileEffectOverride; const r11 = profileFrameOverride === undefined ? pendingProfileFrame : profileFrameOverride; const r38 = displayNameStylesOverride === undefined ? pendingDisplayNameStyles : displayNameStylesOverride; let getProfilePreviewValue = ProfileCustomizationUtilsModule.getProfilePreviewValue; let object = {pendingValue: r16}; object.userValue = value6?.profileEffect; object.guildValue = value6 == null || value6._guildMemberProfile == null ? undefined : value6._guildMemberProfile.profileEffect; object.guildId = guildId; const value14 = Reflect.apply(getProfilePreviewValue, ProfileCustomizationUtilsModule, [object]); if (hideFrame) { r1 = undefined; } else { moduleValue5 = ProfileCustomizationUtilsModule; getProfilePreviewValue = moduleValue5.getProfilePreviewValue; object = {pendingValue: r11}; profileFrame = value6?.profileFrame; object.userValue = profileFrame; profileFrame = value6 == null || value6._guildMemberProfile == null ? undefined : value6._guildMemberProfile.profileFrame; object.guildValue = profileFrame; object.guildId = guildId; r1 = Reflect.apply(getProfilePreviewValue, moduleValue5, [object]); } const value16 = (importDefault(8498) /* metro dependency 8498: useMaybeFetchProfileFrame */)(r1?.skuId, 'UserProfilePreview'); const pendingAvatarSrc = (RecentAvatarUtilsModule).getPendingAvatarSrc({userId: user.id, image: pendingAvatar}); const value18 = (UseBadges)(value6, pendingLegacyUsernameDisabled); const Set = global.Set; const set = new Set(value18.map(function(a0) { return a0.id; })); object = []; arraySpread(object, additionalBadges.filter(_fun67349), arraySpread(object, value18, 0, undefined), undefined); const binding = env0_4; var [property, env0_4] = env0_3(binding.useState({'width': 0, 'height': 0}), 2); const value25 = binding.useCallback(_fun67350, []); const value26 = binding.useMemo(_fun67351, [value16, property.width]); const ThemeContextProvider = (NativeModule).ThemeContextProvider; const items2 = [styles.profileContainer, value26, style]; const items3 = [ value16 != null && ((Component) => )(importDefault(8503) /* metro dependency 8503: ProfileFrame */), ]; const PFX_MOBILE_ACTION_SHEET_BANNER_HEIGHT = (ConstantsModule2).PFX_MOBILE_ACTION_SHEET_BANNER_HEIGHT; const items4 = [ , ]; const value30 = ((Component) => )(UserProfileAvatar); const items6 = [value9.profileContentWrapper]; items6[1] = value9.profileContent; items6[2] = !r29 && ({paddingTop: PROFILE_CONTENT_WITHOUT_STATUS_TOP_PADDING}); r29 = r29 && ((Component) => )(importDefault(8513) /* metro dependency 8513: UserProfileCustomStatusBubble */); const items7 = [r29]; const PREVIEW = UserProfileThemeTypes.PREVIEW; items7[1] = ( ); items7[2] = !compact && ((Component) => )(importDefault(8762) /* metro dependency 8762: UserProfileAboutMeCard */); items4[1] = ( {value30} {items7} ); items4[2] = value14 != null && ((Component) => )(importDefault(8474) /* metro dependency 8474: ProfileEffect */); items3[1] = ( {items4} ); items3[2] = value16 != null && ((Component) => )(importDefault(8503) /* metro dependency 8503: ProfileFrame */); return ( {items3} ); function _fun67349({id}) { // fn#67349, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8674:2361, offset: 0x01c1f957, size: 30 bytes, params: 2, frame: 11 const binding = env0_2; return !binding.has(id); } function _fun67350(a0) { // fn#67350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8674:2462, offset: 0x01c1f975, size: 99 bytes, params: 2, frame: 15 const binding = env0_4; const object = {}; let Math = global.Math; object.width = Math.floor(a0.nativeEvent.layout.width); Math = global.Math; object.height = Math.floor(a0.nativeEvent.layout.height); binding(object); } function _fun67351() { // fn#67351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8674:2584, offset: 0x01c1f9d8, size: 170 bytes, params: 1, frame: 18 var environment; var value2; var value3; var overflowTop; var overflowBottom; var overflowHorizontal; var layers; var value4; var value5; if (env0_1 != null) { value2 = environment.__proto__; value3 = (importDefault(8502) /* metro dependency 8502: scaleProfileFrame */)(env0_1, env0_3.width); overflowTop = value3.overflowTop; overflowBottom = value3.overflowBottom; overflowHorizontal = value3.overflowHorizontal; layers = env0_1.layers; value4 = layers.some(function(a0) { return a0.type === 'staple' && a0.anchor === 'top'; }); value5 = 0; layers = env0_1.layers; return {marginTop: value4 ? overflowTop : value5, marginBottom: layers.some(_fun67353) ? overflowBottom : value5, marginHorizontal: overflowHorizontal}; } } } } function _fun67353(a0) { // fn#67353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8674:2795, offset: 0x01c1faa7, size: 37 bytes, params: 2, frame: 3 return a0.type === 'staple' && a0.anchor === 'bottom'; } global.__d(_fun67343, 8489, [57, 31, 27, 7624, 6816, 33, 4501, 697, 566, 8490, 8494, 8496, 6882, 8497, 8402, 8498, 8403, 8501, 8502, 3868, 8503, 8505, 8507, 8476, 8510, 8511, 8513, 8695, 8762, 8474, 2]) /* metro module 8489, dependencies: [57, 31, 27, 7624, 6816, 33, 4501, 697, 566, 8490, 8494, 8496, 6882, 8497, 8402, 8498, 8403, 8501, 8502, 3868, 8503, 8505, 8507, 8476, 8510, 8511, 8513, 8695, 8762, 8474, 2] */;