// Metro module 11006 (f11007). import { useRef, useState, useCallback } from "react"; import { View } from "react-native"; import ChannelStore from "../../../../stores/ChannelStore"; import { AnalyticEvents } from "../../../../Constants"; import { MessageSendLocation } from "../../../messages/MessageConstants"; import { createStyles } from "../../../../design/components/Styles/native/createStyles"; import Module712 from "../../../../_bundle/Module712"; import MessageActionCreators from "../../../../actions/MessageActionCreators"; import MessageParser from "../../../messages/MessageParser"; import AnalyticsUtils from "../../../../utils/AnalyticsUtils"; import AnalyticsLocation from "../../../app_analytics/AnalyticsLocation"; import useSafeAreaInsetsKeyboardAware_native from "../../../safe_area/useSafeAreaInsetsKeyboardAware.native"; import { useStateFromStores } from "../../../../_bundle/Module589"; import { TextArea } from "../../../../design/components/TextInput/native/TextArea.native"; import { intl, t } from "../../../../intl/index.native"; import { getGiftIntentCustomMessagePlaceholder } from "./GiftIntentMessagePlaceholder"; import GIFPicker from "../../../gif_picker/native/GIFPicker"; import { Button } from "../../../../design/components/Button/native/Button.native"; import ModalActionCreators from "../../../../actions/ModalActionCreators"; import useInitialValue from "../../../../hooks/useInitialValue"; import { getHeaderCloseButton } from "../../../../design/components/Navigator/native/NavigatorHeader.native"; import { Navigator } from "../../../../design/components/Navigator/native/Navigator.native"; let useStyles, GiftIntentGifModalBody, c7415_15; let _sendGiftIntentGif = function _sendGiftIntentGif() { const r8 = async (c26903_0) => { let c26903_2; c26903_2 = void 0; let c30330_0 = c26903_0.channel; let c30330_1 = c26903_0.giftIntentType; let c30330_2 = c26903_0.text; let c30330_3 = c26903_0.gif; await void 0; let c30330_4 = c30330_2.trim().length > 0; if (c30330_4) { await MessageActionCreators.sendMessage(c30330_0.id, MessageParser.parse(c30330_0, c30330_2), true, { location: MessageSendLocation.GIFTING }); } await MessageActionCreators.sendMessage(c30330_0.id, MessageParser.parse(c30330_0, c30330_3.url), true, { location: MessageSendLocation.GIFTING }); AnalyticsUtils.track(AnalyticEvents.GIFT_INTENT_MESSAGE_SENT, { gift_intent_type: c30330_1, is_custom_message: c30330_4, location_stack: [AnalyticsLocation.PREMIUM_GIFT_INTENT_CARD] }); }; _sendGiftIntentGif = r8; return r8.apply(this, arguments); }; GiftIntentGifModalBody = function GiftIntentGifModalBody(props) { let ref, state, setState; const { channelId, giftIntentType, onClose } = props; ref = void 0; state = void 0; setState = void 0; const styles = useStyles(); const insets = useSafeAreaInsetsKeyboardAware_native().insets; const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId)); ref = useRef(null); [state, setState] = useState(null); const ref2 = useRef(null); const callback2 = useCallback((c26904_0) => { setState((prevState) => { const src = prevState?.src; return src !== c26904_0.src ? c26904_0 : null; }); }, []); const callback3 = useCallback(() => { if (stateFromStores != null && state != null && state.url.length !== 0) { const current = ref.current; let text = current == null ? void 0 : current.getText(); if (text == null) { text = ""; } (function sendGiftIntentGif() { return _sendGiftIntentGif.apply(this, arguments); })({ channel: stateFromStores, giftIntentType, text, gif: state }); onClose(); } }, [stateFromStores, giftIntentType, state, onClose]); const r74 = [