// Module ID: 16813 // Function ID: 16814 // Name: UnreadBars // Dependencies: [19, 17, 5081, 1085, 21, 5092, 5906, 587, 4967, 4827, 5057, 5058, 1200, 1126, 558, 576, 504, 12137, 2] // Module 16813 (UnreadBars) import get_initialized from "get initialized" /* 504 */; import nativeDefault from "native" /* 587 */; import Constants from "Constants" /* 1085 */; import intl2 from "intl" /* 1126 */; import native from "native" /* 1200 */; import native2 from "native" /* 4827 */; import HapticUtils from "HapticUtils" /* 5057 */; import haptics_HapticFeedbackTypesDefault from "haptics/HapticFeedbackTypes" /* 5058 */; import TransitionGroup2 from "TransitionGroup" /* 12137 */; import react from "react" /* 19 */; import react_native from "react-native" /* 17 */; import AccessibilityStore from "AccessibilityStore" /* 5081 */; import Fragment from "Fragment" /* 21 */; import createStyles from "createStyles" /* 5092 */; import TextStyles from "TextStyles" /* 5906 */; import ColorUtils_mod from "ColorUtils" /* 4967 */; import ReactCompilerGating from "ReactCompilerGating" /* 558 */; import size from "module_2" /* 2 */; let ColorUtils; let c9; let closure_4; let hasOwnProperty; let metroImportAll; let metroRequire; let obj2; let obj3; let obj4; ({ View: closure_4, Animated: hasOwnProperty, TouchableWithoutFeedback: metroRequire } = react_native); const Fonts = Constants.Fonts; ({ jsx: metroImportAll, jsxs: c9 } = Fragment); const BEFORE = "BEFORE"; const AFTER = "AFTER"; let obj = { unreadText: obj2, unread: obj3, mention: obj4 }; obj2 = {}; const createLegacyClassComponentStyles = createStyles.createLegacyClassComponentStyles; const DISPLAY_SEMIBOLD = Fonts.DISPLAY_SEMIBOLD; let merged = Object.assign(TextStyles(DISPLAY_SEMIBOLD, nativeDefault.unsafe_rawColors.WHITE, 12, { uppercase: true })); obj3 = { margin: 8, height: 24, justifyContent: "center", alignItems: "center", borderRadius: nativeDefault.radii.md, backgroundColor: ColorUtils.hexWithOpacity(nativeDefault.unsafe_rawColors.PRIMARY_400, 0.9) }; ColorUtils = ColorUtils_mod; obj4 = { backgroundColor: ColorUtils.hexWithOpacity(nativeDefault.unsafe_rawColors.RED_400, 0.9) }; ColorUtils = ColorUtils_mod; const authStore2 = createLegacyClassComponentStyles(obj); const PureComponent = react.PureComponent; class UnreadBar extends PureComponent { constructor() { const applyArgumentsResult = HermesBuiltin.applyArguments(this, new.target); require = applyArgumentsResult; applyArgumentsResult.state = { active: false }; const value = new RN.Value(0); applyArgumentsResult.animation = value; applyArgumentsResult.handlePress = function handlePress() { let item; let onPress; ({ item, onPress } = require.props); const obj = HapticUtils; const result = obj.triggerHapticFeedback(haptics_HapticFeedbackTypesDefault.IMPACT_LIGHT); require.hide(); onPress(item); }; applyArgumentsResult.handlePressIn = function handlePressIn() { require.setState({ active: true }); }; applyArgumentsResult.handlePressOut = function handlePressOut() { require.setState({ active: false }); }; return applyArgumentsResult; } componentWillEnter(arg0) { this.show(arg0); } componentWillLeave(arg0) { this.hide(arg0); } show(arg0) { const springResult = hasOwnProperty.spring(this.animation, { toValue: 1, friction: 15, tension: 250, useNativeDriver: true }); springResult.start(arg0); } hide(arg0) { const springResult = hasOwnProperty.spring(this.animation, { toValue: 0, friction: 15, tension: 250, useNativeDriver: true }); springResult.start(arg0); } getAnimatedStyle() { let bottom; let contentInset; let items; let num2; let num3; let tmp2; const self = this; const props = this.props; ({ bottom, contentInset } = props); let num = contentInset.left; const useReducedMotion = props.useReducedMotion; const active = this.state.active; if (num == null) { num = 0; } const rect = { position: "absolute", left: num, right: num2 }; num2 = contentInset.right; if (num2 == null) { num2 = 0; } let str = "top"; if (bottom) { str = "bottom"; } if (bottom) { let num4 = contentInset.bottom; if (num4 == null) { num4 = 0; } num3 = num4; } else { num3 = contentInset.top; if (num3 == null) { num3 = 0; } } rect[str] = num3; const obj = { opacity: self.animation }; const merged = Object.assign(rect); if (useReducedMotion) { tmp2 = obj; } else { const animation = self.animation; let num5 = -72; const interpolate = animation.interpolate; const obj2 = { inputRange: [0, 1], outputRange: items }; if (bottom) { num5 = 72; } items = [num5, ]; let num6 = 0; if (active) { num6 = 1; } items[1] = num6; const items1 = [{ translateY: interpolate(obj2) }]; obj.transform = items1; tmp2 = obj; const obj3 = { translateY: interpolate(obj2) }; } return tmp2; } render() { let LegacyText; let View; let mention; let obj2; let obj3; let obj4; let section; let stringResult; let tmp4; const tmp = closure_12(this.context); const props = this.props; ({ mention, section } = props.item); const compact = props.compact; const obj = { accessibilityRole: "button", onPress: this.handlePress, onPressIn: this.handlePressIn, onPressOut: this.handlePressOut, testID: "unread-bar-touchable-" + mention + "-" + section, children: metroImportAll(View, obj2) }; View = hasOwnProperty.View; const items = [tmp.unread, ]; let mention1; obj2 = { style: this.getAnimatedStyle(), nativeID: "unread-bar-animated-view-" + mention + "-" + section, children: metroImportAll(tmp4, obj3) }; const tmp3 = metroRequire; tmp4 = React3; if (mention) { mention1 = tmp.mention; } items[1] = mention1; obj3 = { style: items, nativeID: "unread-bar-view-" + mention + "-" + section, children: metroImportAll(LegacyText, obj4) }; obj4 = { style: tmp.unreadText, maxFontSizeMultiplier: 1.5, children: stringResult }; LegacyText = native.LegacyText; const intl = intl2.intl; const string = intl.string; const t = intl2.t; if (compact) { stringResult = string(t.y2b7CA); } else if (mention) { stringResult = string(t["8zH0LJ"]); } else { stringResult = string(t.FCRiT3); } return metroImportAll(tmp3, obj); } } const prototype = UnreadBar.prototype; UnreadBar.defaultProps = { bottom: false }; UnreadBar.contextType = native2.ThemeContext; const tmp8 = ReactCompilerGating.isReactCompilerEnabled() ? (function UnreadBars(scrollToLocation) { let afterItem; let beforeItem; let compact; let contentInset; let tmp10; let tmp5; let tmp6; let tmp7; let useReducedMotion; let obj = scrollToLocation(576); const cResult = obj.c(21); scrollToLocation = scrollToLocation.scrollToLocation; ({ beforeItem, afterItem, compact, contentInset } = scrollToLocation); if (cResult[0] !== contentInset) { let rect = contentInset; if (undefined === contentInset) { rect = { top: 0, left: 0, right: 0, bottom: 0 }; } cResult[0] = contentInset; cResult[1] = rect; tmp5 = rect; } else { tmp5 = cResult[1]; } if (cResult[2] === Symbol.for("react.memo_cache_sentinel")) { const items = [AccessibilityStore]; class T { constructor() { return useReducedMotion.useReducedMotion; } } cResult[2] = items; cResult[3] = T; tmp7 = T; tmp6 = items; } else { tmp6 = cResult[2]; tmp7 = cResult[3]; } const tmpResult = scrollToLocation(504); const stateFromStores = tmpResult.useStateFromStores(tmp6, tmp7); if (cResult[4] !== scrollToLocation) { function handlePress(section) { const obj = { section: section.section, item: section.row, animated: true }; scrollToLocation(obj); } cResult[4] = scrollToLocation; class T { constructor() { return useReducedMotion.useReducedMotion; } } cResult[5] = handlePress; tmp10 = handlePress; } else { tmp10 = cResult[5]; } if (cResult[6] === beforeItem) { if (cResult[7] === (undefined !== compact && compact)) { if (cResult[8] === tmp5) { if (cResult[9] === tmp10) { let tmp11; if (cResult[10] === stateFromStores) { tmp11 = cResult[11]; } if (cResult[12] === afterItem) { if (cResult[13] === (undefined !== compact && compact)) { if (cResult[14] === tmp5) { if (cResult[15] === tmp10) { let tmp16; if (cResult[16] === stateFromStores) { tmp16 = cResult[17]; } if (cResult[18] === tmp11) { let tmp18; if (cResult[19] === tmp16) { tmp18 = cResult[20]; } return tmp18; } class T { constructor() { return useReducedMotion.useReducedMotion; } } tmp20[0] = react.Fragment; const items1 = [tmp11, tmp16]; tmp20[1] = items1; const tmp22 = closure_9(scrollToLocation(12137).TransitionGroup, tmp20); cResult[18] = tmp11; cResult[19] = tmp16; cResult[20] = tmp22; tmp18 = tmp22; } } } } class T { constructor() { return useReducedMotion.useReducedMotion; } } cResult[12] = afterItem; cResult[13] = undefined !== compact && compact; cResult[14] = tmp5; cResult[15] = tmp10; cResult[16] = stateFromStores; cResult[17] = null; tmp16 = tmp17; } } } } let tmp12 = null; if (null != beforeItem) { const obj2 = { compact: null, item: beforeItem, onPress: tmp10, contentInset: tmp5, useReducedMotion: stateFromStores }; class T { constructor() { return useReducedMotion.useReducedMotion; } } tmp12 = closure_8(UnreadBar, obj2, BEFORE); } cResult[6] = beforeItem; cResult[7] = undefined !== compact && compact; cResult[8] = tmp5; cResult[9] = tmp10; cResult[10] = stateFromStores; cResult[11] = tmp12; tmp11 = tmp12; }) : (function UnreadBars(contentInset) { let afterItem; let beforeItem; let compact; let items1; let useReducedMotion; ({ scrollToLocation: require, beforeItem, afterItem, compact } = contentInset); if (compact === undefined) { compact = false; } contentInset = contentInset.contentInset; if (contentInset === undefined) { contentInset = { top: 0, left: 0, right: 0, bottom: 0 }; } function handlePress(section) { const obj = { section: section.section, item: section.row, animated: true }; require(obj); } const items = [AccessibilityStore]; const obj2 = get_initialized; const stateFromStores = obj2.useStateFromStores(items, () => useReducedMotion.useReducedMotion); let obj = { component: react.Fragment, children: items1 }; let tmp3 = null; const TransitionGroup = TransitionGroup2.TransitionGroup; const tmp2 = closure_9; if (null != beforeItem) { const obj3 = { compact, item: beforeItem, onPress: handlePress, contentInset, useReducedMotion: stateFromStores }; tmp3 = closure_8(UnreadBar, obj3, BEFORE); } items1 = [tmp3, ]; let tmp7 = null; if (null != afterItem) { const obj4 = { compact, item: afterItem, onPress: handlePress, contentInset, bottom: true, useReducedMotion: stateFromStores }; tmp7 = closure_8(UnreadBar, obj4, AFTER); } items1[1] = tmp7; return tmp2(TransitionGroup, obj); }); let result = size.fileFinishedImporting("components_native/common/UnreadBars.tsx"); export default tmp8;