Files
discord-decomp/sources/modules/reactions/native/MessageReactionsContent.tsx
T
2026-07-27 16:20:00 +03:00

703 lines
41 KiB
TypeScript

/* Metro module 9839; source: modules/reactions/native/MessageReactionsContent.tsx; dependencies: [57, 31, 27, 4502, 1379, 1945, 7150, 3784, 661, 33, 4017, 4573, 4501, 697, 566, 3795, 644, 7152, 7151, 6518, 22, 6771, 4617, 3995, 6746, 1305, 1423, 9210, 477, 5312, 8743, 7331, 9840, 1244, 9841, 4000, 3829, 6739, 9842, 4504, 1478, 4071, 4080, 9843, 1962, 6818, 6796, 9844, 4081, 4082, 1585, 8754, 6275, 6277, 587, 6860, 7172, 7213, 9845, 8140, 2] */
function _fun77084(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#77084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:6, offset: 0x01df0335, size: 1211 bytes, params: 8, frame: 26
var object2;
const env0_0 = require;
const closure = useReactors;
const closure2 = useReactorsOnScrollNative;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_4 = importDefault(57) /* metro dependency 57 */;
const env0_5 = importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_6 = value.ActivityIndicator;
value.Platform;
const env0_7 = value.Pressable;
const env0_8 = value.View;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */;
const messageReactionsStore = importDefault(7150) /* metro dependency 7150: MessageReactionsStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
value = require(661) /* metro dependency 661: Constants */;
const env0_14 = value.DEFAULT_NUM_REACTION_USERS;
const env0_15 = value.Permissions;
value = require(33) /* metro dependency 33 */;
const env0_16 = value.jsx;
const env0_17 = value.jsxs;
value = importDefault(4017) /* metro dependency 4017: ReanimatedRexport */;
const createAnimatedComponent = value.createAnimatedComponent;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const env0_18 = Reflect.apply(createAnimatedComponent, value, [Text]);
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
object2.container = {flex: 1};
const object4 = {padding: 32};
object4.borderTopLeftRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object4.borderTopRightRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object2.containerEmpty = object4;
const MOBILE_ACTIONSHEET_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_ACTIONSHEET_BACKGROUND;
object2.listRow = {height: 48, backgroundColor: MOBILE_ACTIONSHEET_BACKGROUND};
const object6 = {'flexDirection': 'row', 'alignItems': 'center', 'borderRadius': null, 'padding': 8, 'marginTop': 8};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object2.tabContainer = object6;
const INTERACTIVE_BACKGROUND_SELECTED = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_BACKGROUND_SELECTED;
object2.tabContainerSelected = {backgroundColor: INTERACTIVE_BACKGROUND_SELECTED};
object2.tab = {'padding': 0, 'marginHorizontal': 8, 'marginBottom': 8};
object2.tabSelected = {borderBottomColor: 'transparent'};
const object7 = {};
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object2.tabActive = object7;
object2.reactionTab = {'display': 'flex', 'flexDirection': 'column'};
object2.removeButtonContainer = {'display': 'flex', 'flexDirection': 'row', 'justifyContent': 'space-between',
'alignItems': 'center'};
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.emojiOptionsButton = {'flexDirection': 'row', 'alignItems': 'center', 'marginRight': null, 'gap': 2,
marginRight: PX_16};
const object9 = {'backgroundColor': null, 'borderRadius': null, 'height': 32, 'overflow': 'hidden', 'minWidth': 42,
'marginRight': 20, 'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'paddingHorizontal': 12};
const BACKGROUND_FEEDBACK_CRITICAL = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_FEEDBACK_CRITICAL;
object9.backgroundColor = BACKGROUND_FEEDBACK_CRITICAL;
object9.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xxl;
object2.removeAllButton = object9;
let INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
object2.reactionCountText = {color: INTERACTIVE_TEXT_DEFAULT};
const INTERACTIVE_TEXT_ACTIVE = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_ACTIVE;
object2.reactionCountTextSelected = {color: INTERACTIVE_TEXT_ACTIVE};
object2.emoji = {marginRight: 8};
INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
object2.emojiText = {'lineHeight': 24, 'fontSize': 20, 'textAlign': 'center', color: INTERACTIVE_TEXT_DEFAULT};
object2.emojiImage = {'resizeMode': 'contain', 'width': 24, 'height': 24};
object2.emojiTextIdentifier = {padding: 16};
object2.avatar = {marginRight: 10};
object2.buttonRow = {'flexDirection': 'row', 'justifyContent': 'flex-end', 'alignItems': 'center'};
object2.loadingSpinner = {'height': 48, 'padding': 6};
const env0_19 = Reflect.apply(createStyles, value, [object2]);
object2 = {code: 'function MessageReactionsContentTsx1(){const{useReducedMotion,buttonWidth,withTiming}=this.__closure;return{maxWidth:useReducedMotion?buttonWidth.get():withTiming(buttonWidth.get(),{duration:200})};}'};
object2 = {code: "function MessageReactionsContentTsx2(){const{useReducedMotion,textOpacity,withTiming}=this.__closure;return{opacity:useReducedMotion?textOpacity.get():withTiming(textOpacity.get(),{duration:125}),color:'white',fontSize:14,marginLeft:8,textAlignVertical:'center'};}"};
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
const env0_25 = Storage.get('MessageReactionsContent_SwipableBounced', false);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/reactions/native/MessageReactionsContent.tsx');
exports.useReactors = closure;
exports.useReactorsOnScrollNative = closure2;
exports.MessageReactionsEmpty = MessageReactionsEmpty;
exports.MessageReactionsContent = MessageReactionsContent;
}
function useReactors({channelId, messageId, reaction, reactionType}) { // fn#77085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:1931, offset: 0x01df07f0, size: 284 bytes, params: 2, frame: 24
var object2;
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([MessageReactionsStore],
_fun77086, [channelId, messageId, reaction.emoji, reactionType], importDefault(644) /* metro dependency 644 */);
object2 = {reactors: value3};
const ReactionTypes = (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes;
const VOTE = ReactionTypes.VOTE;
object2.reactorsHasMore = (reactionType === VOTE ? reaction.count_details?.vote ?? 0 : reactionType === ReactionTypes.BURST ? reaction.burst_count : reaction.count) > value3.length;
return object2;
}
function useReactorsOnScrollNative({channelId, messageId, reactionSelected, reactors, reactorsHasMore, reactionType}) { // fn#77087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:2368, offset: 0x01df096d, size: 302 bytes, params: 2, frame: 21
const env0_5Binding = env0_5.useRef(false);
const value3 = env0_5Binding.useCallback(_fun77088, [channelId, messageId, reactionSelected, reactorsHasMore,
reactors.length > 0 ? reactors[reactors.length - 1].id : null, reactionType]);
const env0_8 = env0_5Binding.useRef(value3);
env0_5Binding.useEffect(_fun77090, [value3]);
const env0_9 = (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun77091);
return (importDefault(6518) /* metro dependency 6518: useInitialValue */)(function() {
return _fun77094;
});
}
function useRenderFooter(a0, a1) { // fn#77095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:2951, offset: 0x01df0c09, size: 73 bytes, params: 3, frame: 16
const env0_0 = a0;
const env0_1 = a1;
const styles = useStyles();
return env0_5.useCallback(_fun77096, [a0, a1, styles]);
}
function useRenderItem(a0, a1, a2, a3, a4) { // fn#77097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:3091, offset: 0x01df0c9a, size: 144 bytes, params: 6, frame: 21
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
const env0_4 = a4;
const styles = useStyles();
return styles.useCallback(_fun77098, [a0, a2, a4, a1, a3, styles,
(importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations]);
}
function useRenderQuickActions(a0, a1, a2, a3) { // fn#77101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:4147, offset: 0x01df10e4, size: 95 bytes, params: 5, frame: 18
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
const styles = useStyles();
return env0_5.useCallback(_fun77102, [a3, a0, a1, a2, styles]);
}
function ReactionTab({reaction, selected}) { // fn#77104, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:4697, offset: 0x01df1318, size: 703 bytes, params: 2, frame: 29
var r9;
var r3;
var r13;
var object2;
var moduleValue2;
var defaultImport;
var getEmojiURL;
const styles = useStyles();
const value3 = reaction.burst_count > 0;
const value5 = (require(9841) /* metro dependency 9841: useEmojiColorPalette */).useEmojiColorPalette(reaction.burst_colors ?? []);
const r14 = value5?.accentColor != null ? {color: value5.accentColor} : null;
if (value5 != null) {
moduleValue2 = require(4000) /* metro dependency 4000: ColorUtils */;
r9 = {backgroundColor: moduleValue2.hexOpacityToRgba(value5.backgroundColor, value5.opacity)};
} else {
r9 = null;
}
const emoji = reaction.emoji;
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const AnimateEmoji = (require(3829) /* metro dependency 3829: UserSettings */).AnimateEmoji;
if (emoji.id != null) {
defaultImport = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
getEmojiURL = defaultImport.getEmojiURL;
object2 = {};
object2.id = emoji.id;
r3 = emoji.animated && !useReducedMotion;
r3 = r3 && AnimateEmoji.useSetting();
object2.animated = r3;
object2.size = 48;
r13 = Reflect.apply(getEmojiURL, defaultImport, [object2]);
} else {
r13 = undefined;
}
const viewProps = {style: [styles.tabContainer, selected ? styles.tabContainerSelected : null,
selected && value3 ? r9 : null], accessible: true, accessibilityLabel: emoji.name,
accessibilityState: {selected: selected}};
const value9 = ((Component) => <Component src={r13} name={emoji.name} textEmojiStyle={[styles.emoji,
styles.emojiText]} fastImageStyle={[styles.emoji,
styles.emojiImage]} />)(importDefault(6739) /* metro dependency 6739: Emoji */);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View {...viewProps} key={emoji.id ?? emoji.name}>
{value9}
<Text
variant="text-md/bold"
style={[styles.reactionCountText, selected ? styles.reactionCountTextSelected : null,
value3 ? r14 : null]}
>
{reaction.burst_count > 0 ? reaction.burst_count : reaction.count}
</Text>
</View>
);
}
function RemoveAllButton({reactions, reactionSelectedIndex, channelId, messageId}) { // fn#77106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:6147, offset: 0x01df15d7, size: 776 bytes, params: 2, frame: 28
var object2;
var r0;
var View;
var items3;
var intl;
const styles = useStyles();
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
const value3 = (importDefault(9842) /* metro dependency 9842: useCanRemoveAllReactions */)(Reflect.apply(useStateFromStores,
fluxModule, [[ChannelStore], function() {
return ChannelStore.getChannel(channelId);
}, [channelId]]));
const useReducedMotion = AccessibilityStore.useReducedMotion;
const env0_4 = useReducedMotion;
let binding = env0_5;
var [env0_5, env0_6] = env0_4(binding.useState(true), 2);
const value6 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(64);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
let closure = RemoveAllButtonR;
object2 = {useReducedMotion: useReducedMotion, buttonWidth: value6};
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
closure.__closure = object2;
closure.__workletHash = 16499689496895;
closure.__initData = env0_20;
const value7 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const value8 = reanimatedRexportModule.useSharedValue(0);
const moduleValue5 = reanimatedRexportModule;
useAnimatedStyle = moduleValue5.useAnimatedStyle;
closure = RemoveAllButtonT;
object2 = {useReducedMotion: useReducedMotion, textOpacity: value8};
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
closure.__closure = object2;
closure.__workletHash = 8698187840986;
closure.__initData = env0_21;
const value9 = Reflect.apply(useAnimatedStyle, moduleValue5, [closure]);
env0_5.useEffect(_fun77111, [reactionSelectedIndex, env0_5.useCallback(_fun77110, [value6, value8])]);
if (value3) {
object2 = {onPress: onPress_77112};
View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
var viewProps = {style: [styles.removeAllButton, value7]};
items3 = [((TrashIcon) => <TrashIcon color={(importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.WHITE} size="sm" />)((require(4071) /* metro dependency 4071: TrashIcon */).TrashIcon)];
binding = env0_18;
var bindingProps = {'style': null, 'variant': 'text-sm/semibold', 'color': 'white', style: value9};
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
items3[1] = ((Component) => <Component {...bindingProps}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['zx/e4P'])}</Component>)(binding);
r0 = <Pressable {...object2}><View {...viewProps}>{items3}</View></Pressable>;
} else {
r0 = null;
}
return r0;
}
function EmojiOptionsButton({reactions, reactionSelectedIndex, channelId, messageId}) { // fn#77113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:7494, offset: 0x01df1a81, size: 389 bytes, params: 2, frame: 25
const styles = useStyles();
const value4 = env0_5.useCallback(_fun77115, [channelId, messageId, reactions[reactionSelectedIndex],
(importDefault(9842) /* metro dependency 9842: useCanRemoveAllReactions */)((require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore],
function() {
return ChannelStore.getChannel(channelId);
}, [channelId]))]);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const text = <Text variant="text-xs/semibold" color="text-subtle">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.pCaYID)}</Text>;
const ChevronSmallRightIcon = (require(6818) /* metro dependency 6818: ChevronSmallRightIcon */).ChevronSmallRightIcon;
const ICON_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.ICON_SUBTLE;
return (
<Pressable onPress={value4} style={styles.emojiOptionsButton}>
{text}
<ChevronSmallRightIcon color={ICON_SUBTLE} size="xs" />
</Pressable>
);
}
function ReactionTabs(a0) { // fn#77116, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:8111, offset: 0x01df1c86, size: 469 bytes, params: 2, frame: 29
const styles = useStyles();
const reactions = a0.reactions;
const reactionSelectedIndex = a0.reactionSelectedIndex;
const env0_1 = a0.setReactionSelectedIndex;
const defaultImport = importDefault(6796) /* metro dependency 6796: TidaWebformExperiment */;
const useExperiment = defaultImport.useExperiment;
const tidaWebformEnabled = Reflect.apply(useExperiment, defaultImport, [{location: 'ReactionTabs'},
{autoTrackExposure: false}]).tidaWebformEnabled;
const TabBar = importDefault(9844) /* metro dependency 9844: TabBar */;
const defaultImport2Props2 = {tabs: reactions.map(_fun77117), tabStyle: styles.tab,
tabStyleActive: styles.tabActive, tabStyleSelected: styles.tabSelected, tabIndexSelected: reactionSelectedIndex,
onSelect: function(a0) {
require(dependencyMap[48]).triggerHapticFeedback(importDefault(dependencyMap[49]).IMPACT_LIGHT);
setReactionSelectedIndex(a0);
}};
const MAX_REACTIONS = (require(3795) /* metro dependency 3795: ReactionUtils */).MAX_REACTIONS;
defaultImport2Props2.initialNumTabsToRender = MAX_REACTIONS;
const items2 = [<TabBar {...defaultImport2Props2} />];
items2[1] = ((Component) => <Component outer />)(importDefault(7331) /* metro dependency 7331: FormDivider */);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const reactionUtilsModule = require(3795) /* metro dependency 3795: ReactionUtils */;
const getReactionEmojiName = reactionUtilsModule.getReactionEmojiName;
items2[2] = <View style={styles.removeButtonContainer}><Text style={styles.emojiTextIdentifier} variant="eyebrow" color="text-default">{Reflect.apply(getReactionEmojiName,
reactionUtilsModule,
[reactions[reactionSelectedIndex].emoji])}</Text>{((Component) => <Component {...a0} />)(tidaWebformEnabled ? EmojiOptionsButton : RemoveAllButton)}</View>;
return (
<View style={styles.reactionTab}>
{items2}
</View>
);
}
function MessageReactionsEmpty() { // fn#77119, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:9204, offset: 0x01df1f1a, size: 307 bytes, params: 1, frame: 25
const styles = useStyles();
const value2 = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
const value3 = (require(8754) /* metro dependency 8754: NoResults */).useNoResultsSource();
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
const bottom = value2.bottom;
const BottomSheetView = (require(6277) /* metro dependency 6277 */).BottomSheetView;
const RefreshEmptyState = (require(1305) /* metro dependency 1305: native */).RefreshEmptyState;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const HmPOrp = (require(1244) /* metro dependency 1244: indexNative */).t.HmPOrp;
return (
<BottomSheet scrollable startHeight={338 + bottom}>
<BottomSheetView style={styles.containerEmpty}>
<RefreshEmptyState
source={value3}
title={Reflect.apply(string, intl, [HmPOrp])}
body={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['pTJ5J/'])}
/>
</BottomSheetView>
</BottomSheet>
);
}
function MessageReactionsContent({channelId, messageId, emoji, reactions, isSelectedBurst, disableManage, disableTabs}) { // fn#77120, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:9569, offset: 0x01df204d, size: 1041 bytes, params: 2, frame: 36
var object2;
disableManage = !(disableManage === undefined) && disableManage;
disableTabs = !(disableTabs === undefined) && disableTabs;
var value;
const styles = useStyles();
const {reactionSelected, reactionSelectedIndex,
setReactionSelectedIndex} = useReactionSelected({reactions: reactions, emoji: emoji,
isSelectedBurst: isSelectedBurst});
const r21 = reactionSelected.me_vote != null ? (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes.VOTE : reactionSelected.burst_count > 0 ? (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes.BURST : (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes.NORMAL;
const {reactors, reactorsHasMore} = useReactors({channelId: channelId, messageId: messageId,
reaction: reactionSelected, reactionType: r21});
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
const value6 = (require(6860) /* metro dependency 6860: ThreadHooks */).useIsActiveChannelOrUnarchivableThread(Reflect.apply(useStateFromStores,
fluxModule, [[ChannelStore], function() {
return ChannelStore.getChannel(channelId);
}, [channelId]]));
const value7 = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
const r0 = ((a0) => {
var env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun77126, [a0]);
})(channelId) && !disableManage && value6;
const r8 = reactionSelected.emoji.id ?? reactionSelected.emoji.name;
object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.gHp0C4);
object2.footerSize = 48;
object2.insetBottom = value7.bottom;
object2.onScroll = useReactorsOnScrollNative({channelId: channelId, messageId: messageId,
reactionSelected: reactionSelected, reactors: reactors, reactorsHasMore: reactorsHasMore, reactionType: r21});
object2.renderFooter = useRenderFooter(reactors, reactorsHasMore);
object2.renderItem = useRenderItem(reactors, messageId, channelId, reactionSelected, r0);
object2.renderQuickActions = useRenderQuickActions(channelId, messageId, reactionSelected, reactors);
object2.itemSize = 48;
object2.sections = [reactors.length];
object2.style = styles.container;
const value10 = env0_5.useCallback(function() {
env1_25 = true;
var Storage = require(dependencyMap[54]).Storage;
Storage.set('MessageReactionsContent_SwipableBounced', true);
}, []);
let r4 = (require(477) /* metro dependency 477: PlatformUtils */).isIOS() && r0;
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
const BACKDROP_OPACITY = (require(7172) /* metro dependency 7172: BurstReactionEffectUtils */).BACKDROP_OPACITY;
const ReactionTypes = (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes;
const BURST = ReactionTypes.BURST;
const r7 = r21 !== BURST ? null : ((Component) => <Component emoji={reactionSelected.emoji} reactionType={r21} messageId={messageId} channelId={channelId} />)(importDefault(7213) /* metro dependency 7213: BurstReactionAnimationPreview */);
const r5 = disableTabs === true ? null : <ReactionTabs reactions={reactions} reactionSelectedIndex={reactionSelectedIndex} setReactionSelectedIndex={setReactionSelectedIndex} messageId={messageId} channelId={channelId} />;
if (r4) {
r4 = ((Component) => <Component inActionSheet bounceFirstRowOnMount={!env0_25} onBounceSwipable={value10} {...object2} key={r8} />)(importDefault(9845) /* metro dependency 9845: SwipeableFastList */);
} else {
value = importDefault(8140) /* metro dependency 8140: FastList */;
value = ((Component) => <Component inActionSheet {...object2} key={r8} />)(value);
r4 = value;
}
return (
<BottomSheet
scrollable
backdropOpacity={BACKDROP_OPACITY}
backdropChildren={r7}
header={r5}
>
{r4}
</BottomSheet>
);
}
function _fun77086() { // fn#77086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:2048, offset: 0x01df090c, size: 97 bytes, params: 1, frame: 19
var r0;
let value = environment.__proto__;
value = MessageReactionsStore.getReactions(channelId, messageId, reaction.emoji, DEFAULT_NUM_REACTION_USERS,
reactionType);
const Array = global.Array;
const from = Array.from;
if (value == null) {
r0 = undefined;
} else {
value = value.values();
r0 = value;
}
r0 = r0 ?? [];
return Reflect.apply(from, Array, [r0]);
}
function _fun77088(a0, a1) { // fn#77088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:2564, offset: 0x01df0a9b, size: 190 bytes, params: 3, frame: 14
var environment;
var value2;
var moduleValue;
if (a0 / a1 > 0.75 && reactorsHasMore && !env0_5.current) {
env0_5.current = true;
value2 = environment.__proto__;
moduleValue = importAll(7151) /* metro dependency 7151: ReactionActionCreators */;
moduleValue.getReactors({channelId: channelId, messageId: messageId, emoji: reactionSelected.emoji,
limit: DEFAULT_NUM_REACTION_USERS, after: id, type: reactionType}).then(_fun77089);
}
}
function _fun77091() { // fn#77091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:2807, offset: 0x01df0b81, size: 51 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
return (importDefault(22) /* metro dependency 22 */).debounce(_fun77092, 16);
}
function _fun77093() { // fn#77093, offset: 0x01df0bce, size: 11 bytes, params: 1, frame: 1
return _fun77094;
}
function _fun77096() { // fn#77096, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:3013, offset: 0x01df0c52, size: 72 bytes, params: 1, frame: 14
return require ? <ActivityIndicator style={styles.loadingSpinner} size="large" /> : env0_0.length !== 0 ? null : <ActivityIndicator style={styles.loadingSpinner} size="large" />;
}
function _fun77098(a0, a1) { // fn#77098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:3189, offset: 0x01df0d2a, size: 714 bytes, params: 3, frame: 34
var r12;
var r5;
var value;
const binding = env0_0;
const property = binding[a1];
const id = property.id;
const value2 = binding.length - 1;
const channel = ChannelStore.getChannel(importDefault);
const value5 = null;
const r1 = value5 != channel ? channel.getGuildId() : value5;
const value7 = undefined;
const nickname = (importDefault(4617) /* metro dependency 4617: NicknameUtils */).getNickname(r1, importDefault,
property);
const r16 = value5 != nickname ? nickname : (importDefault(3995) /* metro dependency 3995: UserUtils */).getGlobalName(property);
const r21 = value5 != r1 ? GuildMemberStore.getMember(r1, id) : value5;
const env0_2 = importAll.burst_count > 0 ? (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes.BURST : (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes.NORMAL;
const stylesBinding = styles;
const listRow = stylesBinding.listRow;
const FormRow = importDefault(6746) /* metro dependency 6746: FormRow */;
const object = {};
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
const avatarProps = {style: stylesBinding.avatar};
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
const SMALL = AvatarSizes.SMALL;
avatarProps.size = SMALL;
avatarProps.source = value5 == r1 || value5 == (value5 == r21 ? value7 : r21.avatar) ? property.getAvatarSource(r1) : (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getGuildMemberAvatarSource(r21,
property);
object.leading = <Avatar {...avatarProps} />;
object.label = ((Component) => <Component user={property} nick={r16} />)(importDefault(9210) /* metro dependency 9210: DiscordTag */);
if (env0_4) {
value = require(477) /* metro dependency 477: PlatformUtils */;
r12 = value.isAndroid() ? <Pressable onPress={onPress_77099}>{((XSmallIcon) => <XSmallIcon />)((require(5312) /* metro dependency 5312: XSmallIcon */).XSmallIcon)}</Pressable> : value5;
} else {
r12 = value5;
}
object.trailing = r12;
object.onLongPress = onLongPress_77100;
const items2 = [<FormRow {...object} />];
if (a1 === value2) {
r5 = value5;
} else {
value = importDefault(7331) /* metro dependency 7331: FormDivider */;
value = ((Component) => <Component />)(value);
r5 = value;
}
items2[1] = r5;
return (
<View style={listRow}>
{items2}
</View>
);
}
function _fun77102(a0, a1) { // fn#77102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:4219, offset: 0x01df1143, size: 311 bytes, params: 3, frame: 23
const env0_0 = importAll[a1];
const env0_1 = importDefault.burst_count > 0 ? (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes.BURST : (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes.NORMAL;
const SlideoutButton = importDefault(9840) /* metro dependency 9840: SlideoutButton */;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const N86XcP = (require(1244) /* metro dependency 1244: indexNative */).t.N86XcP;
const XSmallIcon = (require(5312) /* metro dependency 5312: XSmallIcon */).XSmallIcon;
const RED_400 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.RED_400;
return (
<View style={styles.buttonRow}>
<SlideoutButton
title={Reflect.apply(string, intl, [N86XcP])}
IconComponent={XSmallIcon}
color={RED_400}
onPress={onPress_77103}
height={48}
/>
</View>
);
}
function RemoveAllButtonR() { // fn#77108, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:6425, owner: RemoveAllButton.R, offset: 0x01df18df, size: 92 bytes, params: 1, frame: 16
var r1;
var value2;
var moduleValue;
var withTiming;
var value;
if (useReducedMotion) {
r1 = env0_7.get();
} else {
value2 = environment.__proto__;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
value = env0_7.get();
value = Reflect.apply(withTiming, moduleValue, [value, {duration: 200}]);
r1 = value;
}
return {maxWidth: r1};
}
function RemoveAllButtonT() { // fn#77109, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:6695, owner: RemoveAllButton.T, offset: 0x01df193b, size: 105 bytes, params: 1, frame: 16
var r1;
var value2;
var moduleValue;
var withTiming;
var value;
if (useReducedMotion) {
r1 = env0_8.get();
} else {
value2 = environment.__proto__;
moduleValue = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue.withTiming;
value = env0_8.get();
value = Reflect.apply(withTiming, moduleValue, [value, {duration: 125}]);
r1 = value;
}
return {'opacity': null, 'color': 'white', 'fontSize': 14, 'marginLeft': 8, 'textAlignVertical': 'center',
opacity: r1};
}
function _fun77110() { // fn#77110, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:6990, offset: 0x01df19a4, size: 51 bytes, params: 1, frame: 13
env0_6(true);
env0_7.set(32);
env0_8.set(0);
}
function RemoveAllButtonOnPress() { // fn#77112, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:7082, owner: RemoveAllButton.onPress, offset: 0x01df19d7, size: 170 bytes, params: 1, frame: 18
var value2;
var moduleValue;
var binding;
var set;
var value3;
var moduleValue2;
if (env0_5) {
env0_6(false);
binding = env0_7;
set = binding.set;
value3 = environment.__proto__;
moduleValue2 = require(1478) /* metro dependency 1478: useWindowDimensionsNative */;
Reflect.apply(set, binding, [moduleValue2.getWindowDimensions().width]);
binding = env0_8;
binding.set(1);
} else {
value2 = environment.__proto__;
moduleValue = importAll(7151) /* metro dependency 7151: ReactionActionCreators */;
moduleValue.removeEmojiReactions(channelId, messageId, reactions[reactionSelectedIndex].emoji);
env0_9();
}
}
function _fun77115() { // fn#77115, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:7669, offset: 0x01df1c06, size: 128 bytes, params: 1, frame: 18
let value = environment.__proto__;
const defaultImport = importDefault(dependencyMap[42]);
const openLazy = defaultImport.openLazy;
value = require(dependencyMap[44]);
value = value(dependencyMap[43], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'ReactionEmojiOptionsActionSheet', {channelId: channelId,
messageId: messageId, reaction: env0_3, canRemoveReactions: env0_2}, 'replaceTopSheet']);
}
function _fun77117(a0, a1) { // fn#77117, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:8354, offset: 0x01df1e5b, size: 116 bytes, params: 3, frame: 18
let value = environment.__proto__;
value = environment;
const reactionSelectedIndexBinding = reactionSelectedIndex;
value = value + (a0.emoji.id ?? '') + ':' + a0.emoji.name;
return (
<ReactionTab
reaction={a0}
selected={a1 === reactionSelectedIndexBinding}
key={value}
/>
);
}
function useReactionSelected({reactions, emoji, isSelectedBurst}) { // fn#77121, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:9687, owner: MessageReactionsContent.useReactionSelected, offset: 0x01df245e, size: 144 bytes, params: 2, frame: 16
var environment;
if (isSelectedBurst !== undefined) {
}
let value = environment.__proto__;
value = env1_4(env1_5.useState(_fun77122), 2);
const property = value[0];
const property2 = value[1];
const Math = global.Math;
value = Math.min(property, reactions.length - 1);
return {reactionSelected: reactions[value], reactionSelectedIndex: value, setReactionSelectedIndex: property2};
}
function MessageReactionsContentUseCanManageMessages(a0) { // fn#77125, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:10539, owner: MessageReactionsContent.useCanManageMessages, offset: 0x01df2591, size: 75 bytes, params: 2, frame: 16
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun77126, [a0]);
}
function _fun77089() { // fn#77089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:2701, offset: 0x01df0b59, size: 19 bytes, params: 1, frame: 2
env1_5.current = false;
}
function _fun77092(a0, a1) { // fn#77092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:2830, offset: 0x01df0bb4, size: 26 bytes, params: 3, frame: 13
return env1_8.current(a0, a1);
}
function _fun77094({nativeEvent}) { // fn#77094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:2880, offset: 0x01df0bd9, size: 48 bytes, params: 2, frame: 13
return env1_9(nativeEvent.contentOffset.y, nativeEvent.contentSize.height);
}
function onPress_77099() { // fn#77099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:3783, offset: 0x01df0ff4, size: 158 bytes, params: 1, frame: 17
let value = environment.__proto__.__proto__;
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
const removeReaction = value.removeReaction;
const object2 = {};
object2.channelId = importDefault;
object2.messageId = require;
object2.emoji = importAll.emoji;
const ReactionLocations = (require(7151) /* metro dependency 7151: ReactionActionCreators */).ReactionLocations;
const MESSAGE = ReactionLocations.MESSAGE;
object2.location = MESSAGE;
object2.userId = env0_0.id;
const binding = env0_2;
const ReactionTypes = (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes;
const BURST = ReactionTypes.BURST;
object2.options = {burst: binding === BURST};
return Reflect.apply(removeReaction, value, [object2]);
}
function onLongPress_77100() { // fn#77100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:4011, offset: 0x01df1092, size: 82 bytes, params: 1, frame: 14
const value = environment.__proto__.__proto__;
(importDefault(8743) /* metro dependency 8743: showUserProfileActionSheet */)({userId: id, channelId: importDefault,
messageId: require, localUser: env0_0, sourceAnalyticsLocations: analyticsLocations});
}
function onPress_77103() { // fn#77103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:4494, offset: 0x01df127a, size: 158 bytes, params: 1, frame: 17
let value = environment.__proto__.__proto__;
value = require(7151) /* metro dependency 7151: ReactionActionCreators */;
const removeReaction = value.removeReaction;
const object2 = {};
object2.channelId = env1_0;
object2.messageId = require;
object2.emoji = importDefault.emoji;
const ReactionLocations = (require(7151) /* metro dependency 7151: ReactionActionCreators */).ReactionLocations;
const MESSAGE = ReactionLocations.MESSAGE;
object2.location = MESSAGE;
object2.userId = env0_0.id;
const binding = env0_1;
const ReactionTypes = (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes;
const BURST = ReactionTypes.BURST;
object2.options = {burst: binding === BURST};
return Reflect.apply(removeReaction, value, [object2]);
}
function _fun77122() { // fn#77122, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:9778, offset: 0x01df24ee, size: 55 bytes, params: 1, frame: 11
if (emoji == null) {
return 0;
}
const index = reactions.findIndex(_fun77123);
const value2 = 0;
return index >= value2 ? index : value2;
}
function _fun77126() { // fn#77126, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:10612, offset: 0x01df25dc, size: 44 bytes, params: 1, frame: 14
const canWithPartialContext = PermissionStore.canWithPartialContext;
const MANAGE_MESSAGES = Permissions.MANAGE_MESSAGES;
return Reflect.apply(canWithPartialContext, PermissionStore, [MANAGE_MESSAGES, {channelId: env0_0}]);
}
function _fun77123({emoji, burst_count}) { // fn#77123, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10025:9822, offset: 0x01df2525, size: 108 bytes, params: 2, frame: 15
let value = environment.__proto__.__proto__.__proto__;
value = Reflect.apply((require(3795) /* metro dependency 3795: ReactionUtils */).emojiEquals, value, [emoji, emoji]);
const value4 = (burst_count ?? 0) > 0;
return isSelectedBurst ? value4 && value : !value4 && value;
}