/* Metro module 8513; source: modules/user_profile/native/UserProfileCustomStatusBubble.tsx; dependencies: [57, 31, 27, 6816, 1881, 33, 4501, 697, 3829, 5475, 1423, 477, 4573, 6739, 8514, 8518, 4080, 8520, 6789, 1244, 5278, 10504, 2] */ import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */ import AvatarUtils from '../../../utils/AvatarUtils.tsx'; /* Metro dependency 1423 */ import ActionSheetActionCreators from '../../action_sheet/native/ActionSheetActionCreators.tsx'; /* Metro dependency 4080 */ import FastImage from '../../../components_native/common/FastImage.tsx'; /* Metro dependency 5475 */ import AnalyticsLocation from '../../app_analytics/AnalyticsLocation.tsx'; /* Metro dependency 6789 */ 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 EmojiConstantsModule from '../../emojis/EmojiConstants.tsx'; /* Metro dependency 1881 */ import * as UserSettingsModule from '../../user_settings/UserSettings.tsx'; /* Metro dependency 3829 */ import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */ import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */ import * as ConstantsModule from './Constants.tsx'; /* Metro dependency 6816 */ import * as UserProfileAnalyticsContextModule from '../UserProfileAnalyticsContext.tsx'; /* Metro dependency 8514 */ import * as UseScaledTextLineHeightAndroidModule from '../../screen/native/useScaledTextLineHeight.android.tsx'; /* Metro dependency 8518 */ import * as CustomStatusUtilsModule from '../../custom_status/native/CustomStatusUtils.tsx'; /* Metro dependency 8520 */ import * as CirclePlusIconModule from '../../../design/components/Icon/native/redesign/generated/CirclePlusIcon.tsx'; /* Metro dependency 10504 */ function _fun67460(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#67460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:6, offset: 0x01c23929, size: 415 bytes, params: 8, frame: 21 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = ReactModule; const UserProfileThemeTypes = (ConstantsModule).UserProfileThemeTypes; const env0_11 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun67465); const env0_12 = {'textVariant': 'text-md/normal', 'emojiOnlyEmojiSize': 32, 'textMinWidth': 42, 'statusBubblePaddingHorizontal': 12, 'statusBubblePaddingVertical': 7}; object = {}; const PREVIEW = UserProfileThemeTypes.PREVIEW; object[PREVIEW] = {'textVariant': 'text-sm/normal', 'emojiOnlyEmojiSize': 26, 'textMinWidth': 53, 'statusBubblePaddingHorizontal': 10, 'statusBubblePaddingVertical': 6}; const env0_14 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(function() { return {container: {alignItems: 'center'}}; }); value = value.forwardRef(_fun67467); (FileImportTrackerModule).fileFinishedImporting('modules/user_profile/native/UserProfileCustomStatusBubble.tsx'); exports.default = value; function getClampedMaxLines() { // fn#67461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:254, offset: 0x01c23ac8, size: 45 bytes, params: 1, frame: 12 const fontScale = PixelRatio.getFontScale(); const Math = global.Math; return Math.ceil(2 * fontScale); } function EmojiImage({emojiId, size, animated, style}) { // fn#67462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:1594, offset: 0x01c23af5, size: 207 bytes, params: 2, frame: 23 animated = !(animated === undefined) && animated; const AnimateEmoji = (UserSettingsModule).AnimateEmoji; const value2 = AnimateEmoji.useSetting(); const items2 = [{height: size, width: size}, style]; const defaultImport2 = AvatarUtils; const getEmojiURL = defaultImport2.getEmojiURL; const object2 = {id: emojiId}; const Boolean = global.Boolean; object2.animated = Boolean(animated) && value2; object2.size = EMOJI_URL_BASE_SIZE; return ( ); } function TextStatusContent({text, emoji, textVariant, lineClamp, onTextLayout, lineHeight, isPlaceholderText}) { // fn#67463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:1838, offset: 0x01c23bc4, size: 529 bytes, params: 2, frame: 28 var r0; var r6; var isAndroid2; var object; var jsxRuntimeEnv0_9Binding; var items2; isPlaceholderText = !(isPlaceholderText === undefined) && isPlaceholderText; const object2 = {paddingVertical: lineHeight / 10}; if (isPlaceholderText) { isAndroid2 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid(); object = {}; if (isAndroid2) { object.fontFamily = 'ggsans-NormalItalic, NotoSans-NormalItalic'; r0 = object; } else { object.fontStyle = 'italic'; r0 = object; } } else { r0 = isPlaceholderText; } copyDataProperties(object2, r0, undefined); const Text = (TextModule).Text; if (emoji?.id != null) { r6 = ( <> ); } else if (emoji?.name != null) { jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9; items2 = [emoji.name]; items2[1] = ; r6 = ( <> {items2} ); } else { r6 = null; } return ( {r6} {text} ); } function EmojiOnlyStatusContent({emoji, size}) { // fn#67464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:2532, offset: 0x01c23dd5, size: 304 bytes, params: 2, frame: 23 var r8; var defaultImport; var getEmojiURL; var object; const styles = useStyles(); const AnimateEmoji = (UserSettingsModule).AnimateEmoji; if (emoji?.id != null) { defaultImport = importDefault(1423) /* metro dependency 1423: AvatarUtils */; getEmojiURL = defaultImport.getEmojiURL; object = {}; object.id = emoji.id; object.animated = global.Boolean(emoji?.animated) && AnimateEmoji.useSetting(); object.size = EMOJI_URL_BASE_SIZE; r8 = Reflect.apply(getEmojiURL, defaultImport, [object]); } else { r8 = undefined; } return ( {((Component) => )(importDefault(6739) /* metro dependency 6739: Emoji */)} ); } function _fun67465(a0) { // fn#67465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:357, offset: 0x01c23f05, size: 482 bytes, params: 2, frame: 18 const object = {}; object.container = {position: 'relative'}; const object3 = {}; let colors = (importDefault(697) /* metro dependency 697: native */).colors; object3.backgroundColor = a0 ? colors.CUSTOM_STATUS_BUBBLE_BG : colors.BACKGROUND_SURFACE_HIGH; colors = (importDefault(697) /* metro dependency 697: native */).colors; object3.borderColor = a0 ? colors.BORDER_MUTED : colors.BORDER_SUBTLE; object3.borderWidth = 1; object.bubble = object3; const object4 = {'alignSelf': 'flex-start', 'alignItems': 'center', 'justifyContent': 'center'}; object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg; let SHADOW_LOW = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_LOW; copyDataProperties(object4, SHADOW_LOW, undefined); object4['top'] = -14; object.statusBubble = object4; object.statusBubbleMeasureable = {'position': 'absolute', 'top': 0, 'left': 0, 'opacity': 0}; const object5 = {'position': 'absolute', 'top': -30, 'width': 12, 'height': 12}; object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round; SHADOW_LOW = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_LOW; copyDataProperties(object5, SHADOW_LOW, -14); object.smallCircle = object5; const object6 = {'position': 'absolute', 'top': -8, 'left': 12, 'width': 20, 'height': 20}; object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round; SHADOW_LOW = (importDefault(697) /* metro dependency 697: native */).shadows.SHADOW_LOW; copyDataProperties(object6, SHADOW_LOW, -14); object.largeCircle = object6; const object7 = {'position': 'absolute', 'top': -7.5, 'left': 13, 'width': 16, 'height': 16, 'borderWidth': 0}; object7.borderTopLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.round; object7.borderTopRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.round; object.largeCircleInner = object7; object.addStatusIconSpacer = {width: 6}; object.statusBubbleLeftAligned = {alignItems: 'flex-start'}; return object; } function _fun67467({customStatusActivity, themeType, hasCustomProfileTheme, editEnabled, showFullStatus, onPressTruncatedStatus, style, emojiOnlyStyle, previewEmoji, previewText, placeholderText, prompt}, a1) { // fn#67467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:2938, offset: 0x01c240f9, size: 1935 bytes, params: 3, frame: 41 var name; var r9; var r17; var onPress_674692; var renderStatusContent2; var object2; var bubble; var items4; var object3; const PressableOpacity = (PressablesModule).PressableOpacity; const intl = (require(1244) /* metro dependency 1244: indexNative */).intl; var formatToPlainString; var UpF5Qa; var value27; const Text = (TextModule).Text; var object4; var isAndroid2; var object7; const CirclePlusIcon = (CirclePlusIconModule).CirclePlusIcon; var moduleValue4; const r10 = editEnabled !== undefined && editEnabled; const env0_0 = showFullStatus !== undefined && showFullStatus; const styles = useStyles(hasCustomProfileTheme); const styles2 = styles; let r0 = themeType != null ? env0_13[themeType] : undefined; r0 = r0 ?? env0_12; const textVariant = r0.textVariant; const textVariant2 = textVariant; const emojiOnlyEmojiSize = r0.emojiOnlyEmojiSize; const textMinWidth = r0.textMinWidth; const statusBubblePaddingHorizontal = r0.statusBubblePaddingHorizontal; const statusBubblePaddingVertical = r0.statusBubblePaddingVertical; const useUserProfileAnalyticsContext = UserProfileAnalyticsContextModule.useUserProfileAnalyticsContext; const env0_6 = Reflect.apply(useUserProfileAnalyticsContext, UserProfileAnalyticsContextModule, []).trackUserProfileAction; let r27 = previewText === undefined ? customStatusActivity?.state : previewText !== '' ? previewText : customStatusActivity?.state; r0 = r27 != null && r27 !== ''; let r25 = previewEmoji !== undefined ? previewEmoji : customStatusActivity?.emoji; const value7 = r25 != null; const r22 = value7 && !r0; let r19 = !r0 && !value7 && placeholderText !== undefined && placeholderText !== ''; r27 = r19 ? placeholderText : r27; const r13 = r27 != null && r27 !== ''; r0 = !r0 ? value7 : r0; r0 = !r0 ? !r10 && r19 : r0; const r11 = !r0 && r10; var [property, env0_12] = styles2(textVariant2.useState(false), 2); let object = {}; object.minWidth = r13 ? textMinWidth : 0; object.minHeight = r22 ? emojiOnlyEmojiSize + 2 * statusBubblePaddingVertical : 0; object.paddingVertical = r13 || r11 ? statusBubblePaddingVertical : 0; object.paddingHorizontal = statusBubblePaddingHorizontal; const object11 = {top: statusBubblePaddingVertical, bottom: statusBubblePaddingVertical, left: statusBubblePaddingHorizontal, right: statusBubblePaddingHorizontal}; const binding = textVariant2; const value21 = binding.useRef(null); binding.useImperativeHandle(a1, _fun67468); const value22 = (UseScaledTextLineHeightAndroidModule).useScaledTextLineHeight(textVariant); if (r0) { onPress_674692 = onPress_67469; renderStatusContent2 = renderStatusContent; object2 = {}; name = r25?.name; object2.text = [name, r27].filter(function(a0) { return a0 != null; }).join(' '); var viewProps = {style: [style, r22 ? emojiOnlyStyle : undefined]}; bubble = styles.bubble; items4 = [ , ]; bubble = styles.bubble; items4[1] = ; items4[2] = _fun67472(); object3 = {}; bubble = styles.bubble; object3.style = [bubble, styles.statusBubble, object, !r22 && styles.statusBubbleLeftAligned]; object3.ref = value21; bubble = styles.bubble; object = [ , ]; if (r11) { r17 = r19 ? placeholderText : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Vq4UmS); var pressableOpacityProps = {accessibilityRole: 'button', accessibilityLabel: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['zrpF/b']), accessibilityHint: r19 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.ioWOMP, {prompt: placeholderText}) : undefined, onPress: onPress_674692, hitSlop: object11}; var textProps = {variant: r19 ? 'text-md/normal' : 'text-md/medium', color: 'control-secondary-text-default', lineClamp: getClampedMaxLines()}; object4 = {paddingVertical: value22 / 10}; if (r19) { isAndroid2 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid(); object7 = {}; if (isAndroid2) { object7.fontFamily = 'ggsans-NormalItalic, NotoSans-NormalItalic'; r19 = object7; } else { object7.fontStyle = 'italic'; r19 = object7; } } copyDataProperties(object4, r19, undefined); textProps.style = object4; var circlePlusIconProps = {color: (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_SECONDARY_TEXT_DEFAULT, size: 'xs'}; moduleValue4 = require(477) /* metro dependency 477: PlatformUtils */; circlePlusIconProps.style = moduleValue4.isAndroid() ? {marginBottom: 0.1 * -value22} : undefined; r9 = ( {r17} ); } else if (r10) { r9 = ( {renderStatusContent2()} ); } else if (onPressTruncatedStatus == null) { r9 = renderStatusContent2(); } else if (property) { if (r19) { r9 = renderStatusContent2(); } else { formatToPlainString = intl.formatToPlainString; UpF5Qa = (require(1244) /* metro dependency 1244: indexNative */).t.UpF5Qa; name = r25?.name; value27 = ''; r25 = r27 ?? value27; r9 = ( {renderStatusContent2()} ); } } else { r9 = renderStatusContent2(); } object[1] = r9; items4[3] = ( {object} ); return ( {items4} ); } if (r11) { onPress_674692 = onPress_67469; renderStatusContent2 = renderStatusContent; object2 = {}; name = r25?.name; object2.text = [name, r27].filter(function(a0) { return a0 != null; }).join(' '); var viewProps = {style: [style, r22 ? emojiOnlyStyle : undefined]}; bubble = styles.bubble; items4 = [ , ]; bubble = styles.bubble; items4[1] = ; items4[2] = _fun67472(); object3 = {}; bubble = styles.bubble; object3.style = [bubble, styles.statusBubble, object, !r22 && styles.statusBubbleLeftAligned]; object3.ref = value21; bubble = styles.bubble; object = [ , ]; if (r11) { r17 = r19 ? placeholderText : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Vq4UmS); var pressableOpacityProps = {accessibilityRole: 'button', accessibilityLabel: intl.string((require(1244) /* metro dependency 1244: indexNative */).t['zrpF/b']), accessibilityHint: r19 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.ioWOMP, {prompt: placeholderText}) : undefined, onPress: onPress_674692, hitSlop: object11}; var textProps = {variant: r19 ? 'text-md/normal' : 'text-md/medium', color: 'control-secondary-text-default', lineClamp: getClampedMaxLines()}; object4 = {paddingVertical: value22 / 10}; if (r19) { isAndroid2 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid(); object7 = {}; if (isAndroid2) { object7.fontFamily = 'ggsans-NormalItalic, NotoSans-NormalItalic'; r19 = object7; } else { object7.fontStyle = 'italic'; r19 = object7; } } copyDataProperties(object4, r19, undefined); textProps.style = object4; var circlePlusIconProps = {color: (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_SECONDARY_TEXT_DEFAULT, size: 'xs'}; moduleValue4 = require(477) /* metro dependency 477: PlatformUtils */; circlePlusIconProps.style = moduleValue4.isAndroid() ? {marginBottom: 0.1 * -value22} : undefined; r9 = ( {r17} ); } else if (r10) { r9 = ( {renderStatusContent2()} ); } else if (onPressTruncatedStatus == null) { r9 = renderStatusContent2(); } else if (property) { if (r19) { r9 = renderStatusContent2(); } else { formatToPlainString = intl.formatToPlainString; UpF5Qa = (require(1244) /* metro dependency 1244: indexNative */).t.UpF5Qa; name = r25?.name; value27 = ''; r25 = r27 ?? value27; r9 = ( {renderStatusContent2()} ); } } else { r9 = renderStatusContent2(); } object[1] = r9; items4[3] = ( {object} ); return ( {items4} ); } return null; function _fun67468() { // fn#67468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:3859, offset: 0x01c24888, size: 14 bytes, params: 1, frame: 1 return env0_14.current; } function onPress_67469() { // fn#67469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:3972, offset: 0x01c24896, size: 130 bytes, params: 1, frame: 16 trackUserProfileAction({action: 'PRESS_EDIT_CUSTOM_STATUS'}); (ActionSheetActionCreators).hideActionSheet(); const openEditCustomStatusModal = CustomStatusUtilsModule.openEditCustomStatusModal; const USER_PROFILE_CUSTOM_STATUS_BUBBLE = (AnalyticsLocation).USER_PROFILE_CUSTOM_STATUS_BUBBLE; Reflect.apply(openEditCustomStatusModal, CustomStatusUtilsModule, [{analyticsLocations: [USER_PROFILE_CUSTOM_STATUS_BUBBLE], prompt: prompt}]); } function renderStatusContent() { // fn#67470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:4175, offset: 0x01c24918, size: 148 bytes, params: 1, frame: 18 return ( env0_11 ? ( ) : ( JsxRuntimeModule.jsx ? ( ) : undefined ) ); } function _fun67472() { // fn#67472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:4546, offset: 0x01c249ac, size: 199 bytes, params: 1, frame: 17 var environment; var value2; if (onPressTruncatedStatus != null) { if (env0_0) { return undefined; } if (env0_11) { value2 = environment.__proto__; return ( ); } } function onTextLayout({nativeEvent}) { // fn#67473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8698:4733, offset: 0x01c24a73, size: 51 bytes, params: 2, frame: 12 env1_12(nativeEvent.lines.length > getClampedMaxLines()); } } } } global.__d(_fun67460, 8513, [57, 31, 27, 6816, 1881, 33, 4501, 697, 3829, 5475, 1423, 477, 4573, 6739, 8514, 8518, 4080, 8520, 6789, 1244, 5278, 10504, 2]) /* metro module 8513, dependencies: [57, 31, 27, 6816, 1881, 33, 4501, 697, 3829, 5475, 1423, 477, 4573, 6739, 8514, 8518, 4080, 8520, 6789, 1244, 5278, 10504, 2] */;