/* Metro module 11525; source: modules/chat_input/native/ChatInput.tsx; dependencies: [5, 57, 31, 27, 7168, 11526, 10738, 7074, 11527, 4645, 7075, 3784, 4644, 7729, 11529, 661, 1483, 1881, 1580, 33, 4501, 697, 477, 3860, 673, 4589, 1357, 3963, 11530, 11531, 566, 6860, 6771, 7149, 11533, 4017, 4022, 8448, 11535, 11536, 11433, 11537, 5225, 1239, 1584, 4660, 7879, 4650, 491, 4081, 683, 1583, 4863, 7860, 11575, 11732, 11095, 4015, 1847, 11733, 8530, 8812, 11752, 11110, 7875, 11755, 11756, 3815, 11773, 11774, 4573, 11775, 11776, 11782, 11783, 11784, 11788, 11790, 11804, 11809, 11812, 11850, 11854, 11871, 11002, 11884, 11886, 11887, 11711, 11888, 2] */ function _fun88219(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:6, offset: 0x01fdaa88, size: 702 bytes, params: 8, frame: 20 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_4 = importDefault(5) /* metro dependency 5 */; const env0_5 = importDefault(57) /* metro dependency 57 */; let value = importAll(31) /* metro dependency 31 */; const env0_7 = (require(27) /* metro dependency 27 */).View; const applicationCommandStore = importDefault(7168) /* metro dependency 7168: ApplicationCommandStore */; const diceRollStore = importDefault(11526) /* metro dependency 11526: DiceRollStore */; const nativeMenuStore = importDefault(10738) /* metro dependency 10738: NativeMenuStore */; const pendingReplyStore = importDefault(7074) /* metro dependency 7074: PendingReplyStore */; const env0_12 = (require(11527) /* metro dependency 11527: VoiceMessagesUIStore */).useVoiceMessagesUIStore; const draftStore = importDefault(4645) /* metro dependency 4645: DraftStore */; const env0_14 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType; const editMessageStore = importDefault(7075) /* metro dependency 7075: EditMessageStore */; const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */; const uploadAttachmentStore = importDefault(4644) /* metro dependency 4644: UploadAttachmentStore */; const useChatBottomManagerUIStoreModule = require(7729) /* metro dependency 7729: useChatBottomManagerUIStore */; const env0_18 = useChatBottomManagerUIStoreModule.updateShowingAutoComplete; const env0_19 = useChatBottomManagerUIStoreModule.useChatIsAtBottom; const env0_20 = useChatBottomManagerUIStoreModule.useChatShowingAutoComplete; const chatInputConstantsModule = require(11529) /* metro dependency 11529: ChatInputConstants */; const env0_21 = chatInputConstantsModule.CHAT_INPUT_HORIZONTAL_PADDING; const env0_22 = chatInputConstantsModule.CHAT_INPUT_HORIZONTAL_PADDING_PARENT; const env0_23 = chatInputConstantsModule.ChatInputActionType; const constantsModule = require(661) /* metro dependency 661: Constants */; const env0_24 = constantsModule.AnalyticEvents; const env0_25 = constantsModule.ChannelTypesSets; const env0_26 = constantsModule.ChatInputComponentViewedTypes; const env0_27 = constantsModule.ComponentActions; const env0_28 = constantsModule.MAX_UPLOAD_COUNT; const env0_29 = constantsModule.Permissions; const env0_30 = (require(1483) /* metro dependency 1483: AppLauncherNativeConstants */).AppLauncherRouteName; const env0_31 = (require(1881) /* metro dependency 1881: EmojiConstants */).EmojiInteractionPoint; const env0_32 = (require(1580) /* metro dependency 1580: MediaKeyboardConstants */).MediaKeyboardTarget; const value5 = require(33) /* metro dependency 33 */; const env0_33 = value5.jsx; const env0_34 = value5.jsxs; const env0_35 = value5.Fragment; const env0_36 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun88221); object = {code: 'function ChatInputTsx1(){const{placeholderFieldHeight,textFieldHeight}=this.__closure;return{minHeight:placeholderFieldHeight>0?Math.max(textFieldHeight.get(),placeholderFieldHeight):textFieldHeight.get()};}'}; const value7 = value.forwardRef(_fun88222); value7.displayName = 'ChatInput'; value = value.memo(value7); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/chat_input/native/ChatInput.tsx'); exports.default = value; } function ChatInputScrimGradient({gradientHeight, inline, scrimBase}) { // fn#88220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:3339, offset: 0x01fdad46, size: 412 bytes, params: 2, frame: 22 inline = !(inline === undefined) && inline; const useTokenModule = require(3860) /* metro dependency 3860: useToken */; const useToken = useTokenModule.useToken; const CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT; const r11 = gradientHeight ?? Reflect.apply(useToken, useTokenModule, [CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT]); const r9 = (require(673) /* metro dependency 673: ColorUtils */).hex2rgb(scrimBase, 1) ?? scrimBase; const r12 = (require(673) /* metro dependency 673: ColorUtils */).hex2rgb(scrimBase, 0) ?? 'transparent'; const value6 = -r11; return ( {((Component) => )(importDefault(4589) /* metro dependency 4589 */)} ); } function _fun88221(a0, a1, a2) { // fn#88221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:787, offset: 0x01fdaee2, size: 1220 bytes, params: 4, frame: 22 let value = a0; const object4 = {}; const object5 = {position: 'relative'}; const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8; object5.paddingVertical = PX_8; object5.paddingHorizontal = CHAT_INPUT_HORIZONTAL_PADDING - CHAT_INPUT_HORIZONTAL_PADDING_PARENT; object5.backgroundColor = value ?? (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW; object5.borderTopWidth = 1; let BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE; object5.borderColor = BORDER_SUBTLE; object4.container = object5; object4.containerInner = {'flexDirection': 'row', 'alignItems': 'flex-end'}; const object6 = {}; copyDataProperties(object6, a1 ? {'alignSelf': 'stretch', 'marginLeft': 0, 'marginTop': 0} : {'flex': 1, 'marginLeft': 6}, undefined); object4.inputDefault = object6; const PX_4 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? (importDefault(697) /* metro dependency 697: native */).space.PX_4 : 6; object4.customPlaceholder = {'position': 'absolute', 'left': null, 'right': 0, left: PX_4}; const object8 = {'flexDirection': 'row', 'alignItems': 'stretch', 'borderRadius': null, 'paddingHorizontal': null, 'marginHorizontal': null, 'overflow': 'hidden', 'flex': 1}; const CHAT_INPUT_BORDER_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_BORDER_RADIUS; object8.borderRadius = CHAT_INPUT_BORDER_RADIUS; let CHAT_INPUT_PILL_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_PILL_PADDING; object8.paddingHorizontal = CHAT_INPUT_PILL_PADDING; const CHAT_INPUT_PILL_MARGIN_HORIZONTAL = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_PILL_MARGIN_HORIZONTAL; object8.marginHorizontal = CHAT_INPUT_PILL_MARGIN_HORIZONTAL; let CHAT_INPUT_PILL_BORDER_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_PILL_BORDER_WIDTH; object8.borderWidth = CHAT_INPUT_PILL_BORDER_WIDTH; const INPUT_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INPUT_BORDER_DEFAULT; object8.borderColor = INPUT_BORDER_DEFAULT; object8.backgroundColor = value != null ? (importDefault(697) /* metro dependency 697: native */).colors.CARD_SECONDARY_BG : (importDefault(697) /* metro dependency 697: native */).colors.CHAT_INPUT_BACKGROUND; object4.input = object8; CHAT_INPUT_PILL_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_PILL_PADDING; object4.rightAccessory = {'flexDirection': 'column', 'justifyContent': 'flex-end', 'alignItems': 'center', paddingVertical: CHAT_INPUT_PILL_PADDING}; CHAT_INPUT_PILL_BORDER_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_PILL_BORDER_WIDTH; object4.refreshButtonAlignment = {marginBottom: CHAT_INPUT_PILL_BORDER_WIDTH}; object4.accessories = {'position': 'absolute', 'bottom': '100%', 'left': 0, 'right': 0}; const object9 = {'borderTopWidth': 0, 'borderColor': 'transparent', 'borderRadius': null, 'backgroundColor': 'transparent', 'paddingHorizontal': null, 'paddingVertical': 0, 'overflow': 'visible'}; object9.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.none; let CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING; object9.paddingHorizontal = CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING; object4.floatingContainer = object9; const object12 = {}; const MOBILE_FLOATINGBAR_BACKGROUND = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATINGBAR_BACKGROUND; object12.backgroundColor = MOBILE_FLOATINGBAR_BACKGROUND; const CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH; object12.borderWidth = CHAT_INPUT_FLOATING_ACCESSORY_BORDER_WIDTH; const MOBILE_FLOATING_ACCESSORY_BORDER = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_FLOATING_ACCESSORY_BORDER; object12.borderColor = MOBILE_FLOATING_ACCESSORY_BORDER; const CHAT_INPUT_FLOATING_BORDER_RADIUS = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_BORDER_RADIUS; object12.borderRadius = CHAT_INPUT_FLOATING_BORDER_RADIUS; object12.flexDirection = 'column'; object12.overflow = 'hidden'; object4.floatingInputBox = object12; BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE; object4.floatingInputBoxPressed = {borderColor: BORDER_SUBTLE}; object4.floatingInputBoxTyping = {'shadowOpacity': 0, 'elevation': 0}; const object14 = {'flexDirection': 'row', 'alignItems': 'flex-end'}; const CHAT_INPUT_FLOATING_CONTENT_PADDING_HORIZONTAL = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_CONTENT_PADDING_HORIZONTAL; object14.paddingHorizontal = CHAT_INPUT_FLOATING_CONTENT_PADDING_HORIZONTAL; const CHAT_INPUT_FLOATING_CONTENT_PADDING_VERTICAL = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_CONTENT_PADDING_VERTICAL; object14.paddingVertical = CHAT_INPUT_FLOATING_CONTENT_PADDING_VERTICAL; const CHAT_INPUT_FLOATING_CONTENT_GAP = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_CONTENT_GAP; object14.gap = CHAT_INPUT_FLOATING_CONTENT_GAP; object4.floatingMainContents = object14; value = require(477) /* metro dependency 477: PlatformUtils */; value = value.isAndroid(); object4.inputFlat = {'flex': 1, 'justifyContent': 'center', marginHorizontal: value ? -5 : -6}; CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING; object4.floatingTypingWrapper = {backgroundColor: 'transparent', paddingRight: CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING}; object4.floatingScrimOverlap = {marginTop: -a2 / 2}; object4.overflowVisible = {overflow: 'visible'}; return object4; } function _fun88222({channel, isResourceChannel, screenIndex, setNoExtractUI, secondaryTextFieldRef, threadCreationCallback, onJumpToPresent}, a1) { // fn#88222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:4093, offset: 0x01fdb3a6, size: 5607 bytes, params: 3, frame: 78 var r37; var r29; var moduleValue16; var ChatInputActions; var object; var DMMessageStickerGreeting; var object2; var items10; var items11; var items15; var object3; var items17; var items18; var ChatInputRightActions; let env0_5 = undefined; let env0_6 = undefined; const {enabled, chatInputFloating} = (require(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */).useMobileVisualRefreshConfig({location: 'ChatInput'}); const clientThemesUtilsModule = require(3963) /* metro dependency 3963: ClientThemesUtils */; const useGradientValue = clientThemesUtilsModule.useGradientValue; const GradientPercentage = clientThemesUtilsModule.GradientPercentage; const END = GradientPercentage.END; const value4 = Reflect.apply(useGradientValue, clientThemesUtilsModule, [END]); const useTokenModule = require(3860) /* metro dependency 3860: useToken */; let useToken = useTokenModule.useToken; const CHAT_INPUT_ACTION_BUTTON_SIZE = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_ACTION_BUTTON_SIZE; const value5 = Reflect.apply(useToken, useTokenModule, [CHAT_INPUT_ACTION_BUTTON_SIZE]); const moduleValue4 = useTokenModule; useToken = moduleValue4.useToken; const CHAT_INPUT_SEND_BUTTON_HEIGHT = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_SEND_BUTTON_HEIGHT; const value7 = (Reflect.apply(useToken, moduleValue4, [CHAT_INPUT_SEND_BUTTON_HEIGHT]) - value5) / 2; const moduleValue5 = useTokenModule; useToken = moduleValue5.useToken; const CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT; const value8 = Reflect.apply(useToken, moduleValue5, [CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT]); const styles = useStyles(value4, chatInputFloating, value8); const moduleValue6 = useTokenModule; useToken = moduleValue6.useToken; const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER; const r49 = value4 ?? Reflect.apply(useToken, moduleValue6, [BACKGROUND_BASE_LOWER]); const moduleValue7 = useTokenModule; useToken = moduleValue7.useToken; const CHAT_INPUT_FLOATING_TYPING_GRADIENT_HEIGHT_REDUCED = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_TYPING_GRADIENT_HEIGHT_REDUCED; const value11 = Reflect.apply(useToken, moduleValue7, [CHAT_INPUT_FLOATING_TYPING_GRADIENT_HEIGHT_REDUCED]); const moduleValue8 = useTokenModule; useToken = moduleValue8.useToken; const CHAT_INPUT_FLOATING_INLINE_FULL_GRADIENT_HEIGHT = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_INLINE_FULL_GRADIENT_HEIGHT; const value12 = Reflect.apply(useToken, moduleValue8, [CHAT_INPUT_FLOATING_INLINE_FULL_GRADIENT_HEIGHT]); const moduleValue9 = useTokenModule; useToken = moduleValue9.useToken; const CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT_AT_BOTTOM = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT_AT_BOTTOM; const value13 = Reflect.apply(useToken, moduleValue9, [CHAT_INPUT_FLOATING_SCRIM_GRADIENT_HEIGHT_AT_BOTTOM]); const moduleValue10 = useTokenModule; useToken = moduleValue10.useToken; const CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING; const value14 = Reflect.apply(useToken, moduleValue10, [CHAT_INPUT_CONTAINER_HORIZONTAL_PADDING]); let binding = env0_6; let useMemo = binding.useMemo; const value15 = Reflect.apply(useMemo, binding, [_fun88223, [value14]]); binding.useRef(chatInputFloating).current = chatInputFloating; let useState = binding.useState; const value18 = env0_5(Reflect.apply(useState, binding, [false]), 2); const property = value18[0]; env0_5 = value18[1]; const r14 = chatInputFloating ? importDefault(11530) /* metro dependency 11530: FloatingChatInputContainer */ : View; const value20 = threadCreationCallback != null; env0_6 = value20; const r19 = channel.isPrivate() && !value20; const value22 = DiceRollStore(function({channelId}) { return channelId === channel.id; }); let r32 = chatInputFloating && (channel.rateLimitPerUser > 0 || (require(11531) /* metro dependency 11531: useTypingUsersIds */).useTypingUserIds(channel.id, 1).length > 0) && !useChatShowingAutoComplete(screenIndex); const value28 = useChatIsAtBottom(screenIndex); const r47 = value28 ? value13 : value8; const r50 = value28 ? value11 : value12; const value29 = (require(566) /* metro dependency 566: flux */).useStateFromStores([EditMessageStore], _fun88225); const value30 = (require(566) /* metro dependency 566: flux */).useStateFromStores([PendingReplyStore], _fun88226); const value31 = (require(566) /* metro dependency 566: flux */).useStateFromStores([UploadAttachmentStore], _fun88227); binding = env0_6; useMemo = binding.useMemo; let r45 = value29 ?? Reflect.apply(useMemo, binding, [_fun88228, [channel.id, value20]]); const {canMentionEveryone, canUpload, canSendVoiceMessage, editable, canCreateThreads} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([PermissionStore], _fun88229, [channel, value20]); const analyticsLocations = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations; let r17 = value20 || value29 != null; if (!r17) { moduleValue16 = require(6860) /* metro dependency 6860: ThreadHooks */; r17 = !moduleValue16.getIsActiveChannelOrUnarchivableThread(channel); } const value36 = value30 != null; const r66 = (require(6860) /* metro dependency 6860: ThreadHooks */).useCanStartThread(channel) && !ChannelTypesSets.GUILD_THREADS_ONLY.has(channel.type) && !value20; const r35 = (require(7149) /* metro dependency 7149: PollsUtils */).useCanPostPollsInChannel(channel) && !value20; const moduleValue19 = useTokenModule; useToken = moduleValue19.useToken; const CHAT_INPUT_PILL_BORDER_WIDTH = (importDefault(697) /* metro dependency 697: native */).modules.mobile.CHAT_INPUT_PILL_BORDER_WIDTH; const value42 = Reflect.apply(useToken, moduleValue19, [CHAT_INPUT_PILL_BORDER_WIDTH]); let r56 = enabled ? value5 - 2 * value42 : (require(11533) /* metro dependency 11533: useChatInputMaxHeight */).getChatInputMinHeight(); const value45 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(chatInputFloating ? value5 : r56); env0_6.useEffect(_fun88230, [chatInputFloating, value5, r56, value45]); const value46 = (importDefault(4022) /* metro dependency 4022: useKeyboardType */)(); const value47 = useVoiceMessagesUIStore(function(a0) { return a0.startTimeMillis != null; }); const value48 = !value20; let r62 = value20 ? value48 : (require(8448) /* metro dependency 8448: ActivitiesInTextUtils */).getIsAppLauncherEnabled(channel); const activeCommand = (require(566) /* metro dependency 566: flux */).useStateFromStores([ApplicationCommandStore], function() { return ApplicationCommandStore.getActiveCommand(channel.id); }); const defaultImport2 = importDefault(11535) /* metro dependency 11535: useTextareaPlaceholderAndLabels */; const value50 = !editable; const {placeholder, accessibilityLabel} = defaultImport2({channel: channel, isReadonly: value50, isCreatingThread: value20}); const value52 = (importDefault(11536) /* metro dependency 11536: useAnniversaryPlaceholder */)(editable ? value20 ? null : channel : null); const value53 = (require(11433) /* metro dependency 11433: GiftIntentExpressionPickerState */).useGiftIntentExpressionPickerActive(channel.id); const r60 = (require(11433) /* metro dependency 11433: GiftIntentExpressionPickerState */).useGiftIntentExpressionPickerPlaceholder(channel.id) ?? value52; const value55 = !value53; const r39 = value53 ? value55 : undefined; binding = env0_6; useState = binding.useState; const value57 = env0_5(Reflect.apply(useState, binding, [r45.length > 0]), 2); const property2 = value57[0]; const env0_14 = value57[1]; binding.useEffect(_fun88233, [r45]); const r54 = r60 != null && !property2; binding = env0_6; const [property3, env0_15] = env0_5(binding.useState(0), 2); let closure = _fun88234; const value62 = binding.useCallback(closure, []); const r57 = enabled ? 5 : 8; r56 = chatInputFloating ? value5 : r56; let r42 = r54 && property3 > 0 ? global.Math.max(r56, property3 + 2 * r57) : 0; const r63 = r42 > 0 ? (r42 - property3) / 2 : r57; const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */; const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle; closure = it_88235; closure.__closure = {placeholderFieldHeight: r42, textFieldHeight: value45}; closure.__workletHash = 14640048327678; closure.__initData = env0_37; const value67 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]); const value68 = (importDefault(11537) /* metro dependency 11537: useChatInputRefs */)({chatInputProps: {analyticsLocations: analyticsLocations, canUpload: canUpload, channel: channel, defaultValue: r45, hasAttachmentsToUpload: value31, pendingEdit: value29, pendingReply: value30, screenIndex: screenIndex, secondaryTextFieldRef: secondaryTextFieldRef, threadCreationCallback: threadCreationCallback}, chatInputTextFieldHeight: value45, ref: a1}); binding = env0_6; binding.useEffect(_fun88236, [value68]); binding.useEffect(_fun88237, [value68, channel, value29, value30]); binding.useEffect(function() { var closure = _fun88239; var env0_0 = closure; var ComponentDispatch = require(dependencyMap[43]).ComponentDispatch; ComponentDispatch.subscribe(ComponentActions.TEXTAREA_FOCUS, closure); return _fun88240; }, [value68]); const value69 = binding.useMemo(_fun88241, [value68]); const value70 = binding.useCallback(_fun88271, [value20, value68]); const value71 = binding.useCallback(function() { return true; }, []); const value72 = binding.useCallback(_fun88273, [editable, value53, value68]); const value73 = ((Component) => )(importDefault(11755) /* metro dependency 11755: ChatInputImageCarousel */); if (editable) { ChatInputActions = importDefault(11756) /* metro dependency 11756: ChatInputActions */; var defaultImport6Props = {ref: value68.chatInputActions, channel: channel, onPressAction: value69.handlePressAction, canStartThreads: r66, isAppLauncherEnabled: r62, keyboardType: value46}; r62 = canUpload && activeCommand == null; r62 = !r62 ? r35 : r62; defaultImport6Props.shouldPhotosButtonBeDisabled = !r62; defaultImport6Props.canUpload = canUpload; r62 = value20 ? value48 : (require(3815) /* metro dependency 3815: BillingPlatformUtils */).isPremiumGiftingSupported(); defaultImport6Props.shouldShowGiftButton = r62; defaultImport6Props.canPostPolls = r35; defaultImport6Props.onPollsPress = value69.handlePollsPress; defaultImport6Props.onAttachPress = value69.handleAttachPress; r42 = ; } else { r42 = null; } const View2 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View; const items2 = [styles.inputDefault, value67]; const ChatInputNativeComponent = importDefault(11773) /* metro dependency 11773: ChatInputNativeComponent */; const PORTAL_KEYBOARD_PLACEHOLDER_INSTANCE = (require(11774) /* metro dependency 11774: PortalKeyboardPlaceholder */).PORTAL_KEYBOARD_PLACEHOLDER_INSTANCE; const handleFocus = value69.handleFocus; const handleBlur = value69.handleBlur; const handleChangeContentSize = value69.handleChangeContentSize; const handleMaxHeightChanged = value69.handleMaxHeightChanged; const handleSelectionOrTextChange = value69.handleSelectionOrTextChange; const handleTextFlushed = value69.handleTextFlushed; const handlePasteImage = value69.handlePasteImage; const handlePasteCommand = value69.handlePasteCommand; const handleTapAction = value69.handleTapAction; const handlePressSend = value69.handlePressSend; const value76 = ''; r62 = r60 == null ? placeholder : value76; const chatInputNative = value68.chatInputNative; const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes; const MEDIA = KeyboardTypes.MEDIA; const view = {r54 ? ((Text) => {r60})((require(4573) /* metro dependency 4573: Text */).Text) : null}{((Component) => )(importDefault(11775) /* metro dependency 11775: ChatInputCover */)}; const r28 = editable || value20 ? ((Component) => )(importDefault(11776) /* metro dependency 11776: ChatInputSendButton */) : null; const items5 = [(importDefault(11782) /* metro dependency 11782: getChatInputPositionStyle */)({isCreatingThread: value20})]; items5[1] = chatInputFloating && styles.overflowVisible; items5[2] = chatInputFloating && value48 && styles.floatingScrimOverlap; const items6 = [chatInputFloating && !r32 && ]; let r12 = chatInputFloating && r32; if (r12) { object = {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0}; object.backgroundColor = (require(673) /* metro dependency 673: ColorUtils */).hex2rgb(r49, 1) ?? r49; r12 = ; } items6[1] = r12; const ChatInputAccessibilityDivider = (require(11783) /* metro dependency 11783: ChatInputAccessibilityDivider */).ChatInputAccessibilityDivider; items6[2] = ; if (r19) { DMMessageStickerGreeting = importDefault(11784) /* metro dependency 11784: DMMessageStickerGreeting */; object2 = {channel: channel}; r45 = value76 !== r45 || value76 !== value68.chatInput.current?.getText(); object2.hasInputText = r45; r12 = ; } else { r12 = null; } items6[3] = r12; const items7 = [chatInputFloating && r32 && ]; items7[1] = value20 ? null : ((Component) => )(importDefault(11788) /* metro dependency 11788: TypingIndicator */); const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */; items7[2] = platformUtilsModule.isIOS() ? ((Component) => )(importDefault(11790) /* metro dependency 11790: JumpToPresentButton */) : null; items6[4] = {items7}; items6[5] = isResourceChannel ? ((Component) => )(importDefault(11804) /* metro dependency 11804: ResourceChannelButtons */) : null; const MemberActionsChatInputBannerGuardedOuter = (require(11809) /* metro dependency 11809: MemberActionChatInputBanner */).MemberActionsChatInputBannerGuardedOuter; items6[6] = ; const DoubleTapToReactChatInputBanner = (require(11812) /* metro dependency 11812: DoubleTapToReactChatInputBanner */).DoubleTapToReactChatInputBanner; items6[7] = ; items6[8] = value22 ? ((Component) => )(importDefault(11850) /* metro dependency 11850: DiceRollBar */) : null; const EXPRESSION = KeyboardTypes.EXPRESSION; items6[9] = value46 === EXPRESSION ? null : ((Component) => )(importDefault(11854) /* metro dependency 11854: AutocompleteWrapper */); const value96 = !chatInputFloating; items6[10] = chatInputFloating ? value96 : ((Component) => )(importDefault(11871) /* metro dependency 11871: ChatInputNotificationNudge */); items6[11] = chatInputFloating ? value96 : ((Component) => )(importDefault(11002) /* metro dependency 11002: ChatInputContextBar */); items6[12] = ((Component) => )(importDefault(11884) /* metro dependency 11884: ChatInputAppCommandManager */); const items9 = [styles.container]; items9[1] = chatInputFloating && styles.floatingContainer; const handleLayoutOfInputContainer = value69.handleLayoutOfInputContainer; const jsxRuntimeEnv0_35Binding = jsxRuntimeEnv0_35; const object4 = {}; if (chatInputFloating) { items15 = [value73]; items15[1] = ((Component) => )(importDefault(11871) /* metro dependency 11871: ChatInputNotificationNudge */); object3 = {}; r32 = r32 && styles.floatingInputBoxTyping; object3.style = [styles.floatingInputBox, property && styles.floatingInputBoxPressed, r32]; object3.onStartShouldSetResponder = value71; object3.onResponderRelease = value72; object3.collapsable = false; object3.accessibilityElementsHidden = value47; object3.importantForAccessibility = value47 ? 'no-hide-descendants' : undefined; items17 = [((Component) => )(importDefault(11002) /* metro dependency 11002: ChatInputContextBar */)]; var viewBinding10Props = {style: styles.floatingMainContents}; items18 = [r42 != null ? {r42} : null]; items18[1] = {view}{((Component) => )(importDefault(11886) /* metro dependency 11886: ChatInputCharCounter */)}; if (editable) { var viewBinding13Props = {style: {paddingBottom: value7}}; ChatInputRightActions = importDefault(11887) /* metro dependency 11887: ChatInputRightActions */; var defaultImport25Props = {ref: value68.chatInputRightActions, channel: channel, keyboardType: value46, showKeyboardIcon: r39}; r37 = value20 ? value48 : (require(3815) /* metro dependency 3815: BillingPlatformUtils */).isPremiumGiftingSupported(); r37 = r37 && value55; defaultImport25Props.shouldShowGiftButton = r37; defaultImport25Props.onPressAction = value69.handlePressAction; defaultImport25Props.onPressExpression = value69.handlePressExpression; r29 = ; } else { r29 = null; } items18[2] = r29; items18[3] = r28; items17[1] = {items18}; items15[2] = {items17}; object4.children = items15; } else { items10 = [value73]; var viewBinding4Props = {style: styles.containerInner, collapsable: false, accessibilityElementsHidden: value47, importantForAccessibility: value47 ? 'no-hide-descendants' : undefined}; r45 = enabled ? {r42} : r42; items11 = [r45]; items11[1] = {view}{editable ? ((Component) => )(importDefault(11711) /* metro dependency 11711: ChatInputExpressionButton */) : null}{((Component) => )(importDefault(11886) /* metro dependency 11886: ChatInputCharCounter */)}; r45 = enabled ? {r28} : r28; items11[2] = r45; items10[1] = {items11}; object4.children = items10; } items6[13] = ((Component) => {((Fragment) => )(jsxRuntimeEnv0_35Binding)})(r14); const view2 = {items6}; return value20 ? view2 : ((Component) => {view2})(importDefault(11888) /* metro dependency 11888: ChatInputGuardWrapper */); } function _fun88223() { // fn#88223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5125, offset: 0x01fdc98d, size: 23 bytes, params: 1, frame: 3 return {paddingLeft: 2 * env0_3}; } function _fun88225() { // fn#88225, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5481, offset: 0x01fdc9be, size: 41 bytes, params: 1, frame: 12 return env0_6 ? null : EditMessageStore.getEditingTextValue(channel.id); } function _fun88226() { // fn#88226, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5559, offset: 0x01fdc9e7, size: 41 bytes, params: 1, frame: 12 return env0_6 ? undefined : PendingReplyStore.getPendingReply(channel.id); } function _fun88227() { // fn#88227, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5635, offset: 0x01fdca10, size: 74 bytes, params: 1, frame: 13 if (env0_6) { return false; } const getUploads = UploadAttachmentStore.getUploads; const id = channel.id; const ChannelMessage = DraftType.ChannelMessage; const value = Reflect.apply(getUploads, UploadAttachmentStore, [id, ChannelMessage]); return value != null && value.length > 0; } function _fun88228() { // fn#88228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5741, offset: 0x01fdca5a, size: 58 bytes, params: 1, frame: 15 return DraftStore.getDraft(channel.id, env0_6 ? DraftType.FirstThreadMessage : DraftType.ChannelMessage); } function _fun88229() { // fn#88229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:5875, offset: 0x01fdca94, size: 346 bytes, params: 1, frame: 21 let value = environment.__proto__; let can = PermissionStore.can; const ATTACH_FILES = Permissions.ATTACH_FILES; let channelBinding = channel; const value3 = Reflect.apply(can, PermissionStore, [ATTACH_FILES, channelBinding]); can = PermissionStore.can; const MENTION_EVERYONE = Permissions.MENTION_EVERYONE; const value4 = Reflect.apply(can, PermissionStore, [MENTION_EVERYONE, channelBinding]); can = PermissionStore.can; const SEND_MESSAGES = Permissions.SEND_MESSAGES; const value5 = Reflect.apply(can, PermissionStore, [SEND_MESSAGES, channelBinding]); can = PermissionStore.can; const SEND_VOICE_MESSAGES = Permissions.SEND_VOICE_MESSAGES; const value6 = Reflect.apply(can, PermissionStore, [SEND_VOICE_MESSAGES, channelBinding]); can = PermissionStore.can; const CREATE_PUBLIC_THREADS = Permissions.CREATE_PUBLIC_THREADS; const r1 = Reflect.apply(can, PermissionStore, [CREATE_PUBLIC_THREADS, channelBinding]) || PermissionStore.can(Permissions.CREATE_PRIVATE_THREADS, channel); can = PermissionStore.can; const SEND_MESSAGES_IN_THREADS = Permissions.SEND_MESSAGES_IN_THREADS; channelBinding = channel; const value9 = Reflect.apply(can, PermissionStore, [SEND_MESSAGES_IN_THREADS, channelBinding]); const isPrivate2 = channelBinding.isPrivate(); value = require(6860) /* metro dependency 6860: ThreadHooks */; value = value.computeIsReadOnlyThread(channelBinding); let r2 = env0_6 ? value9 : isPrivate2 || value5; r2 = r2 ? value : !r2; return {canMentionEveryone: (isPrivate2 || value4 && !r2) && !env0_6, canUpload: (isPrivate2 || value3) && !r2 && !env0_6, canSendVoiceMessage: (isPrivate2 || value6) && !r2 && !env0_6, editable: !r2, canCreateThreads: r1}; } function _fun88230() { // fn#88230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:6831, offset: 0x01fdcbee, size: 38 bytes, params: 1, frame: 13 const binding = env0_12; binding.set(chatInputFloating ? env0_2 : env0_11); } function _fun88233() { // fn#88233, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:7376, offset: 0x01fdcc45, size: 31 bytes, params: 1, frame: 11 env0_14(env0_9.length > 0); } function _fun88234({nativeEvent}) { // fn#88234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:7493, offset: 0x01fdcc64, size: 36 bytes, params: 2, frame: 11 env0_15(nativeEvent.layout.height); } function it_88235() { // fn#88235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:7648, offset: 0x01fdcc88, size: 73 bytes, params: 1, frame: 16 return {minHeight: env0_16 > 0 ? global.Math.max(env0_12.get(), env0_16) : env0_12.get()}; } function _fun88236() { // fn#88236, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8072, offset: 0x01fdccd1, size: 53 bytes, params: 1, frame: 11 env0_17.chatInput.current.setText(env0_17.props.current.defaultValue); } function _fun88237() { // fn#88237, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8166, offset: 0x01fdcd06, size: 286 bytes, params: 1, frame: 15 var value6; let current = env0_17.propsPrev.current; const pendingEdit = current.pendingEdit; let r2 = current.pendingReply == null && env0_8 != null; r2 = !r2 ? pendingEdit == null && env0_7 != null : r2; if (r2) { current = env0_17.chatInput.current; if (current != null) { current.focus(); } } const id = env0_17.propsPrev.current.channel.id; if (id === channel.id) { if (pendingEdit !== env0_7) { current = env0_17.chatInput.current; if (current != null) { current.setText(env0_7 ?? ''); } } } else { value6 = environment.__proto__; if (id !== (require(5225) /* metro dependency 5225: FakePlaceholderPrivateChannel */).FAKE_PLACEHOLDER_PRIVATE_CHANNEL_ID) { current = env0_17.chatInput.current; if (current != null) { current.setText(env0_17.props.current.defaultValue); } } else if (pendingEdit !== env0_7) { current = env0_17.chatInput.current; if (current != null) { current.setText(env0_7 ?? ''); } } } } function _fun88238() { // fn#88238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8598, offset: 0x01fdce24, size: 75 bytes, params: 1, frame: 15 const closure = handleOpenKeyboard; let ComponentDispatch = (require(1239) /* metro dependency 1239: ComponentDispatchUtils */).ComponentDispatch; const subscribe = ComponentDispatch.subscribe; let TEXTAREA_FOCUS = ComponentActions.TEXTAREA_FOCUS; Reflect.apply(subscribe, ComponentDispatch, [TEXTAREA_FOCUS, closure]); return function() { var ComponentDispatch = require(dependencyMap[43]).ComponentDispatch; var TEXTAREA_FOCUS = ComponentActions.TEXTAREA_FOCUS; ComponentDispatch.unsubscribe(TEXTAREA_FOCUS, handleOpenKeyboard); }; } function _fun88241() { // fn#88241, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8966, offset: 0x01fdcf09, size: 259 bytes, params: 1, frame: 13 const object2 = {handleBlur: handleBlur_88242, handleFocus: handleFocus, handleChangeContentSize: handleChangeContentSize, handleLayoutOfInputContainer: handleLayoutOfInputContainer, handleLayout: handleLayout_88246, handleMaxHeightChanged: handleMaxHeightChanged, handleChangeAutoCompleteVisibility: handleChangeAutoCompleteVisibility, handlePasteCommand: handlePasteCommand}; const env0_0 = env1_4(_fun88251); object2.handlePasteImage = handlePasteImage; object2.handlePressAction = handlePressAction; object2.handlePollsPress = handlePollsPress; object2.handleAttachPress = handleAttachPress; object2.handlePressExpression = handlePressExpression; object2.handlePressSend = handlePressSend; object2.handleSelectionOrTextChange = handleSelectionOrTextChange; object2.handleTapAction = handleTapAction; object2.handleTextOrFocusChange = handleTextOrFocusChange; object2.handleTextFlushed = handleTextFlushed; object2.handleToggleKeyboard = handleToggleKeyboard; return object2; } function _fun88271({nativeEvent}) { // fn#88271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:16615, offset: 0x01fde3f8, size: 81 bytes, params: 2, frame: 13 const {height, width} = nativeEvent.layout; if (height !== 0 && width !== 0) { if (!env0_6) { env0_17.chatInput.current.updateChatInputContainerHeightDebounced(height); } } } function _fun88273() { // fn#88273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:16814, offset: 0x01fde449, size: 58 bytes, params: 1, frame: 9 var binding; var current; if (editable) { binding = env0_13; current = env0_17.chatInput.current; if (binding) { current.focus(); } else { current.openSystemKeyboard(); } } } function handleOpenKeyboard(a0) { // fn#88239, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8626, offset: 0x01fdce6f, size: 92 bytes, params: 2, frame: 14 const value = undefined; const channelId = a0 == null ? value : a0.channelId; let current = env1_17.props.current; if (channelId === (current == null ? value : current.channel.id)) { current = env1_17.chatInput.current; if (current != null) { current.openSystemKeyboard(); } } return value; } function handleBlur_88242({nativeEvent}) { // fn#88242, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:8989, offset: 0x01fdd00c, size: 305 bytes, params: 2, frame: 17 var setData; var object2; const text = nativeEvent.text; let value = environment.__proto__.__proto__; (require(1584) /* metro dependency 1584: ChatInputFocused */).setIsAnyChatInputFocused(false); value = environment.__proto__; env1_18.handleTextOrFocusChange(text, false); let state = env1_17.state; let current = state.current; current.focused = false; env1_5(false); current = env1_17.chatInputCover.current; if (current != null) { current.focused(false); } current = env1_17.chatInputAppCommandManager.current; if (current != null) { current.updateState(); } current = env1_17.chatInputAutocomplete.current; if (current != null) { setData = current.setData; object2 = {focused: false, text: text}; state = env1_17.state; object2.selectionStart = state.current.selectionStart; state = env1_17.state; object2.selectionEnd = state.current.selectionEnd; Reflect.apply(setData, current, [object2]); } current = env1_17.chatInputSendButton.current; if (current != null) { current.setHasText(text.trim().length > 0); } } function handleFocus({nativeEvent}) { // fn#88243, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:9502, offset: 0x01fdd13d, size: 297 bytes, params: 2, frame: 17 const start = nativeEvent.start; const end = nativeEvent.end; let value = environment.__proto__.__proto__; (require(1584) /* metro dependency 1584: ChatInputFocused */).setIsAnyChatInputFocused(true); value = environment.__proto__; let current = env1_17.state.current; current.focused = true; env1_5(true); env1_17.state.current.selectionStart = start; env1_17.state.current.selectionEnd = end; const binding = env1_18; binding.handleTextOrFocusChange(env1_17.state.current.text, true); current = env1_17.chatInputAppCommandManager.current; if (current != null) { current.updateState(); } current = env1_17.chatInputCover.current; if (current != null) { current.focused(true); } current = env1_17.chatInputAutocomplete.current; if (current != null) { current.setData({focused: true, text: env1_17.state.current.text, selectionStart: start, selectionEnd: end}); } } function handleChangeContentSize({nativeEvent}) { // fn#88244, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10006, offset: 0x01fdd266, size: 105 bytes, params: 2, frame: 14 const height = nativeEvent.height; let value = environment.__proto__; env1_17.state.current.textFieldContentSize = height; const textFieldHeight = env1_17.state.current.textFieldHeight; const set = textFieldHeight.set; value = environment.__proto__.__proto__; value = require(11533) /* metro dependency 11533: useChatInputMaxHeight */; const getChatInputHeightAnimationTiming = value.getChatInputHeightAnimationTiming; Reflect.apply(set, textFieldHeight, [Reflect.apply(getChatInputHeightAnimationTiming, value, [height])]); } function handleLayoutOfInputContainer({nativeEvent}) { // fn#88245, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10189, offset: 0x01fdd2cf, size: 59 bytes, params: 2, frame: 11 const current = env1_17.chatInputAutocomplete.current; if (current != null) { current.setChatInputHeight(nativeEvent.layout.height); } } function handleLayout_88246({nativeEvent}) { // fn#88246, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10311, offset: 0x01fdd30a, size: 100 bytes, params: 2, frame: 13 const {height, width} = nativeEvent.layout; let value = height !== 0; if (value && width !== 0) { value = environment.__proto__; if (env1_17.props.current.threadCreationCallback == null) { env1_17.chatInput.current.updateChatInputContainerHeightDebounced(height); } } } function handleMaxHeightChanged() { // fn#88247, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10518, offset: 0x01fdd36e, size: 99 bytes, params: 1, frame: 14 var textFieldHeight; var set; let value = environment.__proto__; const textFieldContentSize = env1_17.state.current.textFieldContentSize; if (textFieldContentSize !== 0) { textFieldHeight = env1_17.state.current.textFieldHeight; set = textFieldHeight.set; value = environment.__proto__.__proto__; value = require(11533) /* metro dependency 11533: useChatInputMaxHeight */; Reflect.apply(set, textFieldHeight, [value.getChatInputHeightAnimationTiming(textFieldContentSize)]); } } function handleChangeAutoCompleteVisibility(a0) { // fn#88248, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10694, offset: 0x01fdd3d1, size: 43 bytes, params: 2, frame: 13 updateShowingAutoComplete(env1_17.props.current.screenIndex, a0); } function handlePasteCommand({nativeEvent}) { // fn#88249, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10752, offset: 0x01fdd3fc, size: 122 bytes, params: 2, frame: 16 var r1; var r2; var value2; var applicationCommandManager; const data = nativeEvent.data; let current = env1_17.state.current; if (current.focused) { current = env1_17.chatInputAppCommandManager.current; value2 = current == null; if (value2) { r1 = value2; r2 = current; } else { applicationCommandManager = current.getApplicationCommandManager(); r1 = applicationCommandManager == null; r2 = applicationCommandManager; } if (!r1) { r2.setPastedCommand(data, env1_17.props.current.channel); } } } async function _fun88251({nativeEvent}) { // fn#88251, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:10977, offset: 0x01fdd48a, size: 344 bytes, params: 2, frame: 23 var value4; var binding; var value5; var value6; var binding2; var value8; var addFile; var object3; var object4; if (true) { var url = nativeEvent.url; var width = nativeEvent.width; var height = nativeEvent.height; var type = nativeEvent.type; await undefined; if (false) { return undefined; } value = environment.__proto__.__proto__; if (UploadAttachmentStore.state.current.focused) { if (UploadAttachmentStore.props.current.canUpload) { value4 = environment.__proto__.__proto__.__proto__; binding = env3_0; value5 = binding(env3_3[45]); await value5.getImageDimensionsIfMissing(url, width, height); value6 = undefined; if (false) { return value6; } binding = env3_1; binding2 = env3_3; value8 = binding(binding2[46]); addFile = value8.addFile; object3 = {}; object3.channelId = UploadAttachmentStore.props.current.channel.id; object4 = {uri: url, originalUri: url}; width = value6.width; object4.width = width; height = value6.height; object4.height = height; object4.mimeType = type; binding = env3_0; object4.platform = binding(binding2[47]).UploadPlatform.REACT_NATIVE; object4.id = binding(binding2[48]).v4(); object3.file = object4; object3.draftType = env3_14.ChannelMessage; Reflect.apply(addFile, value8, [object3]); return undefined; } } } } function handlePressAction(a0, a1, a2) { // fn#88253, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:11429, offset: 0x01fdd5e2, size: 1440 bytes, params: 4, frame: 21 var environment; const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes; var handleSelectThread; var value3; var props; var current; var channel; var moduleValue; var moduleValue2; var moduleValue4; var handleSelectGift; var value4; var handleViewAllDialog; var object3; var value5; var value6; var moduleValue5; var moduleValue6; var defaultImport2; var track; var CHAT_INPUT_COMPONENT_VIEWED; var value7; var moduleValue8; var value8; var binding; var handleToggleKeyboard; const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes; var object4; var getAppDMApplication; var value9; var MEDIA; let value = a2; const PHOTOS = ChatInputActionType.PHOTOS; if (PHOTOS === a1) { value = require(4081) /* metro dependency 4081: HapticUtilsNative */; value.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT); value = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = value.track; CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED; object3 = {}; object3.type = ChatInputComponentViewedTypes.ADD_BUTTON; value9 = environment.__proto__; props = env1_17.props; current = props.current; channel = current.channel; object3.channel_id = channel.id; props = env1_17.props; current = props.current; channel = current.channel; object3.guild_id = channel.guild_id; Reflect.apply(track, value, [CHAT_INPUT_COMPONENT_VIEWED, object3]); current = env1_4.current; if (current) { value = require(4022) /* metro dependency 4022: useKeyboardType */; value = value.getKeyboardType(); if (value === KeyboardTypes.APP_LAUNCHER) { env1_18.handleToggleKeyboard({type: KeyboardTypes.APP_LAUNCHER}); } else { value = require(4022) /* metro dependency 4022: useKeyboardType */; value = value.getKeyboardType(); MEDIA = KeyboardTypes.MEDIA; if (value === MEDIA) { current = env1_17.chatInputActions.current; if (current != null) { current.focusPhotosButton(); } } binding = env1_18; handleToggleKeyboard = binding.handleToggleKeyboard; MEDIA = KeyboardTypes.MEDIA; Reflect.apply(handleToggleKeyboard, binding, [{type: MEDIA, context: {target: MediaKeyboardTarget.CHAT}}]); } } else { value = require(4022) /* metro dependency 4022: useKeyboardType */; value = value.getKeyboardType(); MEDIA = KeyboardTypes.MEDIA; if (value === MEDIA) { current = env1_17.chatInputActions.current; if (current != null) { current.focusPhotosButton(); } } binding = env1_18; handleToggleKeyboard = binding.handleToggleKeyboard; MEDIA = KeyboardTypes.MEDIA; Reflect.apply(handleToggleKeyboard, binding, [{type: MEDIA, context: {target: MediaKeyboardTarget.CHAT}}]); } } else if (ChatInputActionType.APPS === a1) { value6 = undefined; moduleValue5 = require(4081) /* metro dependency 4081: HapticUtilsNative */; moduleValue5.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT); moduleValue6 = require(4863) /* metro dependency 4863: AppAnalyticsUtils */; moduleValue6.trackWithMetadata(AnalyticEvents.APP_LAUNCHER_ENTRYPOINT_BUTTON_CLICKED); defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */; track = defaultImport2.track; CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED; object3 = {}; object3.type = ChatInputComponentViewedTypes.APPS_BUTTON; value7 = environment.__proto__; props = env1_17.props; current = props.current; channel = current.channel; object3.channel_id = channel.id; props = env1_17.props; current = props.current; channel = current.channel; object3.guild_id = channel.guild_id; Reflect.apply(track, defaultImport2, [CHAT_INPUT_COMPONENT_VIEWED, object3]); (importAll(7860) /* metro dependency 7860: EmbeddedActivitiesActionCreators */).dismissNewActivityIndicator(); moduleValue8 = require(11575) /* metro dependency 11575: AppLauncherKeyboard */; value8 = null; moduleValue8.setAppLauncherA11yFocusReturnRef(value8 != value ? value : value8); binding = env1_18; handleToggleKeyboard = binding.handleToggleKeyboard; object3 = {}; object3.type = KeyboardTypes.APP_LAUNCHER; object4 = {}; object4.initialRouteName = AppLauncherRouteName.HOME; value = require(11732) /* metro dependency 11732: getAppDMApplication */; getAppDMApplication = value.getAppDMApplication; props = env1_17.props; current = props.current; channel = current.channel; value = Reflect.apply(getAppDMApplication, value, [channel]); object4.initialSearchQuery = value8 == value ? value6 : value.name; object3.context = object4; Reflect.apply(handleToggleKeyboard, binding, [object3]); } else if (ChatInputActionType.ALL_PHOTOS === a1) { value = require(4081) /* metro dependency 4081: HapticUtilsNative */; value.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT); value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */; handleViewAllDialog = value.handleViewAllDialog; value5 = environment.__proto__; Reflect.apply(handleViewAllDialog, value, [{channel: env1_17.props.current.channel, uploadLimit: MAX_UPLOAD_COUNT, onDismissKeyboard: onDismissKeyboard_88254, onRestoreKeyboard: onRestoreKeyboard_88255, onSelectFiles: onSelectFiles_88256, draftType: DraftType.ChannelMessage}]); } else if (ChatInputActionType.NITRO_GIFT === a1) { (importDefault(1847) /* metro dependency 1847: KeyboardStateDebugging */).markPotentialBadState(); moduleValue = require(4081) /* metro dependency 4081: HapticUtilsNative */; moduleValue.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT); moduleValue2 = require(477) /* metro dependency 477: PlatformUtils */; if (moduleValue2.isAndroid()) { (require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard(); } moduleValue4 = require(11095) /* metro dependency 11095: MediaKeyboardUtils */; handleSelectGift = moduleValue4.handleSelectGift; value4 = environment.__proto__; Reflect.apply(handleSelectGift, moduleValue4, [env1_17.props.current.analyticsLocations, env1_17.chatInput, value]); } else if (ChatInputActionType.THREAD === a1) { value = require(4081) /* metro dependency 4081: HapticUtilsNative */; value.triggerHapticFeedback(HapticFeedbackTypes.IMPACT_LIGHT); value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */; handleSelectThread = value.handleSelectThread; value3 = environment.__proto__; Reflect.apply(handleSelectThread, value, [env1_17.props.current.channel, env1_17.chatInput]); } } function handlePollsPress() { // fn#88257, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:13555, offset: 0x01fddc44, size: 255 bytes, params: 1, frame: 18 const hapticUtilsNativeModule = require(4081) /* metro dependency 4081: HapticUtilsNative */; const triggerHapticFeedback = hapticUtilsNativeModule.triggerHapticFeedback; const HapticFeedbackTypes = hapticUtilsNativeModule.HapticFeedbackTypes; const IMPACT_LIGHT = HapticFeedbackTypes.IMPACT_LIGHT; Reflect.apply(triggerHapticFeedback, hapticUtilsNativeModule, [IMPACT_LIGHT]); const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */; const track = defaultImport.track; const CHAT_INPUT_COMPONENT_VIEWED = AnalyticEvents.CHAT_INPUT_COMPONENT_VIEWED; const POLLS = ChatInputComponentViewedTypes.POLLS; Reflect.apply(track, defaultImport, [CHAT_INPUT_COMPONENT_VIEWED, {type: POLLS, channel_id: env1_17.props.current.channel.id, guild_id: env1_17.props.current.channel.guild_id}]); (require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard(); (require(11733) /* metro dependency 11733: PollCreationModalActionCreators */).openCreatePollModal({channel: env1_17.props.current.channel, onCancel: onCancel_88258}); } function handleAttachPress() { // fn#88259, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:13963, offset: 0x01fddd43, size: 157 bytes, params: 1, frame: 16 const hapticUtilsNativeModule = require(4081) /* metro dependency 4081: HapticUtilsNative */; const triggerHapticFeedback = hapticUtilsNativeModule.triggerHapticFeedback; const HapticFeedbackTypes = hapticUtilsNativeModule.HapticFeedbackTypes; const IMPACT_LIGHT = HapticFeedbackTypes.IMPACT_LIGHT; Reflect.apply(triggerHapticFeedback, hapticUtilsNativeModule, [IMPACT_LIGHT]); (require(11095) /* metro dependency 11095: MediaKeyboardUtils */).handleAttachFile({channel: env1_17.props.current.channel, uploadLimit: MAX_UPLOAD_COUNT, onDismissKeyboard: onDismissKeyboard_88260, onRestoreKeyboard: onRestoreKeyboard_88261, onSelectFiles: onSelectFiles_88262}); } function handlePressExpression(a0) { // fn#88263, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:14391, offset: 0x01fdde3e, size: 103 bytes, params: 2, frame: 15 const emojiActionCreatorsModule = require(8530) /* metro dependency 8530: EmojiActionCreators */; const initiateEmojiInteraction = emojiActionCreatorsModule.initiateEmojiInteraction; const ChatInputExpressionPressed = EmojiInteractionPoint.ChatInputExpressionPressed; Reflect.apply(initiateEmojiInteraction, emojiActionCreatorsModule, [ChatInputExpressionPressed]); const binding = env1_18; const handleToggleKeyboard = binding.handleToggleKeyboard; const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes; const EXPRESSION = KeyboardTypes.EXPRESSION; Reflect.apply(handleToggleKeyboard, binding, [{type: EXPRESSION, context: a0}]); } function handlePressSend() { // fn#88264, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:14552, offset: 0x01fddea5, size: 32 bytes, params: 1, frame: 9 env1_17.chatInput.current.handleSend(); } function handleSelectionOrTextChange({nativeEvent}) { // fn#88265, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:14620, offset: 0x01fddec5, size: 406 bytes, params: 2, frame: 20 const start = nativeEvent.start; const end = nativeEvent.end; const text = nativeEvent.text; const editId = nativeEvent.editId; let value = environment.__proto__; let current = env1_17.state.current; const editId2 = current.editId; env1_17.state.current.editId = editId; env1_17.state.current.selectionStart = start; env1_17.state.current.selectionEnd = end; const binding = env1_18; binding.handleTextOrFocusChange(text, env1_17.state.current.focused); current = env1_17.chatInputAppCommandManager.current; if (current != null) { current.updateState(); } current = env1_17.chatInputAutocomplete.current; if (current != null) { current.setData({focused: env1_17.state.current.focused, text: text, selectionStart: start, selectionEnd: end}); } current = env1_17.chatInputSendButton.current; if (current != null) { current.setHasText(text.trim().length > 0); } if (editId2 !== editId) { current = env1_17.chatInput.current; current.handleTextChanged(text); current = env1_17.chatInputCharCounter.current; if (current != null) { current.onMessageLengthChanged(text.length); } value = environment.__proto__.__proto__; value = require(8812) /* metro dependency 8812: ContextMenuStateNative */; value.hideContextMenu(); } } function handleTapAction({nativeEvent}) { // fn#88266, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:15302, offset: 0x01fde05b, size: 183 bytes, params: 2, frame: 18 var environment; var value; var chatInput; var current; var value2; var value3; var moduleValue; var openCommandAttachmentPreview; var applicationCommandManager; var channelId; var optionName; const tapAction = nativeEvent.tapAction; if (tapAction.action === 'tapAttachment') { value = environment.__proto__; chatInput = env1_17.chatInput; current = chatInput.current; current.blur(); value2 = environment.__proto__.__proto__; value3 = undefined; moduleValue = require(11752) /* metro dependency 11752: ApplicationCommandUtils */; openCommandAttachmentPreview = moduleValue.openCommandAttachmentPreview; chatInput = env1_17.chatInput; current = chatInput.current; applicationCommandManager = current.getApplicationCommandManager(); channelId = tapAction.channelId; optionName = tapAction.optionName; current = env1_17.state.current; Reflect.apply(openCommandAttachmentPreview, moduleValue, [applicationCommandManager, channelId, optionName, current.focused ? _fun88267 : value3]); } } function handleTextOrFocusChange(a0, a1) { // fn#88268, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:15611, offset: 0x01fde130, size: 449 bytes, params: 3, frame: 16 var current; var value2; var defaultImport2; const binding = env1_14; let length = a0.length; binding(length > 0); length = a0.length; if (length > 0) { if (a1) { value2 = environment.__proto__.__proto__; if (NativeMenuStore.isOpen()) { (importDefault(11110) /* metro dependency 11110: NativeMenuActionCreators */).hideNativeMenu(); } current = env1_17.chatInputActions.current; if (current != null) { current.onDismissActions(a1); } current = env1_17.chatInputRightActions.current; if (current != null) { current.onDismissActions(a1); } } else { length = a0.length; current = env1_17.state.current; if (length > current.textPrev.length) { value2 = environment.__proto__.__proto__; if (NativeMenuStore.isOpen()) { (importDefault(11110) /* metro dependency 11110: NativeMenuActionCreators */).hideNativeMenu(); } current = env1_17.chatInputActions.current; if (current != null) { current.onDismissActions(a1); } current = env1_17.chatInputRightActions.current; if (current != null) { current.onDismissActions(a1); } } else if (a0.length === 0) { current = env1_17.chatInputActions.current; if (current != null) { current.onShowActions(a1); } current = env1_17.chatInputRightActions.current; if (current != null) { current.onShowActions(a1); } } } } else if (a0.length === 0) { current = env1_17.chatInputActions.current; if (current != null) { current.onShowActions(a1); } current = env1_17.chatInputRightActions.current; if (current != null) { current.onShowActions(a1); } } const maxMessageLength = (require(7875) /* metro dependency 7875: useMessageMaxLength */).getMaxMessageLength(); if (env1_17.state.current.textPrev.length <= maxMessageLength && a0.length > maxMessageLength) { defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */; defaultImport2.track(AnalyticEvents.MESSAGE_LENGTH_LIMIT_REACHED, {}); } env1_17.state.current.textPrev = env1_17.state.current.text; env1_17.state.current.text = a0; } function handleTextFlushed({nativeEvent}) { // fn#88269, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:16247, offset: 0x01fde2f1, size: 65 bytes, params: 2, frame: 12 const text = nativeEvent.text; const requestId = nativeEvent.requestId; let value = environment.__proto__; value = env1_17.chatInputTextFlushedResponses.current.get(requestId); if (value != null) { value(text); } } function handleToggleKeyboard(a0) { // fn#88270, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:16378, offset: 0x01fde332, size: 198 bytes, params: 2, frame: 14 let value = environment.__proto__.__proto__; if (NativeMenuStore.isOpen()) { (importDefault(11110) /* metro dependency 11110: NativeMenuActionCreators */).hideNativeMenu(); } let type = a0.type; const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes; const SYSTEM = KeyboardTypes.SYSTEM; if (type === SYSTEM) { value = environment.__proto__; env1_17.chatInput.current.openSystemKeyboard(); } else { type = a0.type; value = require(4022) /* metro dependency 4022: useKeyboardType */; if (type === value.getKeyboardType()) { value = environment.__proto__; env1_17.chatInput.current.openSystemKeyboard(); } else { value = environment.__proto__; env1_17.chatInput.current.openCustomKeyboard(a0); } } } function handlePressActionOnDismissKeyboard() { // fn#88254, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:12859, owner: handlePressAction.onDismissKeyboard, offset: 0x01fddb82, size: 37 bytes, params: 1, frame: 11 const value = environment.__proto__.__proto__.__proto__; return (require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard(); } function handlePressActionOnRestoreKeyboard() { // fn#88255, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:12908, owner: handlePressAction.onRestoreKeyboard, offset: 0x01fddba7, size: 63 bytes, params: 1, frame: 14 const binding = env2_18; const handleToggleKeyboard = binding.handleToggleKeyboard; const KeyboardTypes = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes; const SYSTEM = KeyboardTypes.SYSTEM; return Reflect.apply(handleToggleKeyboard, binding, [{type: SYSTEM}]); } function handlePressActionOnSelectFiles(a0) { // fn#88256, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:12988, owner: handlePressAction.onSelectFiles, offset: 0x01fddbe6, size: 94 bytes, params: 2, frame: 17 let value = environment.__proto__.__proto__.__proto__; value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */; const addImagesFromPicker = value.addImagesFromPicker; const id = env2_17.props.current.channel.id; const UploadOrigin = (require(4650) /* metro dependency 4650: Upload */).UploadOrigin; const IMAGE_PICKER = UploadOrigin.IMAGE_PICKER; Reflect.apply(addImagesFromPicker, value, [id, a0, IMAGE_PICKER]); } function handleAttachPressOnSelectFiles(a0) { // fn#88262, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:14263, owner: handleAttachPress.onSelectFiles, offset: 0x01fddde0, size: 94 bytes, params: 2, frame: 17 let value = environment.__proto__.__proto__.__proto__; value = require(11095) /* metro dependency 11095: MediaKeyboardUtils */; const addImagesFromPicker = value.addImagesFromPicker; const id = env2_17.props.current.channel.id; const UploadOrigin = (require(4650) /* metro dependency 4650: Upload */).UploadOrigin; const FILE_ATTACHMENT = UploadOrigin.FILE_ATTACHMENT; Reflect.apply(addImagesFromPicker, value, [id, a0, FILE_ATTACHMENT]); } function _fun88267() { // fn#88267, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11711:15531, offset: 0x01fde112, size: 30 bytes, params: 1, frame: 9 return env2_17.chatInput.current.openSystemKeyboard(); }