This repository has been archived by the owner on Aug 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 18
/
MessageSearch.js.map
1 lines (1 loc) · 38.2 KB
/
MessageSearch.js.map
1
{"version":3,"file":"MessageSearch.js","sources":["../src/smart-components/MessageSearch/dux/actionTypes.ts","../src/smart-components/MessageSearch/dux/reducers.ts","../src/smart-components/MessageSearch/dux/initialState.ts","../src/smart-components/MessageSearch/hooks/useSetChannel.ts","../src/smart-components/MessageSearch/hooks/useGetSearchedMessages.ts","../src/smart-components/MessageSearch/hooks/useScrollCallback.ts","../src/ui/MessageSearchItem/getCreatedAt.ts","../src/ui/MessageSearchItem/index.tsx","../src/ui/MessageSearchFileItem/utils.ts","../src/ui/MessageSearchFileItem/index.tsx","../src/smart-components/MessageSearch/index.tsx"],"sourcesContent":["export const GET_SEARCHED_MESSAGES = 'GET_SEARCHED_MESSAGES';\nexport const GET_NEXT_SEARCHED_MESSAGES = 'GET_NEXT_SEARCHED_MESSAGES';\nexport const START_MESSAGE_SEARCH = 'START_MESSAGE_SEARCH';\nexport const START_GETTING_SEARCHED_MESSAGES = 'START_GETTING_SEARCHED_MESSAGES';\nexport const SET_QUERY_INVALID = 'SET_QUERY_INVALID';\n\nexport const SET_CURRENT_CHANNEL = 'SET_CURRENT_CHANNEL';\nexport const CHANNEL_INVALID = 'CHANNEL_INVALID';\n","import { State as initialStateInterface } from './initialState';\nimport * as actionTypes from './actionTypes';\n\ninterface ActionInterface {\n type: string;\n /* eslint-disable @typescript-eslint/no-explicit-any */\n payload?: any;\n}\n\nexport default function reducer(\n state: initialStateInterface,\n action: ActionInterface,\n): initialStateInterface {\n switch (action.type) {\n case actionTypes.SET_CURRENT_CHANNEL: {\n const currentChannel = action.payload;\n return {\n ...state,\n currentChannel,\n initialized: true,\n };\n }\n case actionTypes.CHANNEL_INVALID: {\n return {\n ...state,\n currentChannel: null,\n initialized: false,\n };\n }\n case actionTypes.GET_SEARCHED_MESSAGES: {\n const { messages, createdQuery } = action.payload;\n if (\n createdQuery\n && createdQuery.channelUrl === state.currentMessageSearchQuery.channelUrl\n && createdQuery.key === state.currentMessageSearchQuery.key\n ) {\n return {\n ...state,\n loading: false,\n isInvalid: false,\n allMessages: [...messages],\n hasMoreResult: state.currentMessageSearchQuery.hasNext,\n };\n }\n return { ...state };\n }\n case actionTypes.SET_QUERY_INVALID: {\n return {\n ...state,\n isInvalid: true,\n }\n }\n case actionTypes.START_MESSAGE_SEARCH: {\n return {\n ...state,\n isInvalid: false,\n loading: false,\n }\n }\n case actionTypes.START_GETTING_SEARCHED_MESSAGES: {\n const currentMessageSearchQuery = action.payload;\n return {\n ...state,\n loading: true,\n currentMessageSearchQuery,\n };\n }\n case actionTypes.GET_NEXT_SEARCHED_MESSAGES: {\n const messages = action.payload;\n return {\n ...state,\n allMessages: [...state.allMessages, ...messages],\n hasMoreResult: state.currentMessageSearchQuery.hasNext,\n };\n }\n default: {\n return state;\n }\n }\n}\n","import SendbirdUIKit from '../../../index';\nexport interface State {\n allMessages: Array<SendbirdUIKit.ClientFileMessage | SendbirdUIKit.ClientUserMessage>;\n loading: boolean;\n isInvalid: boolean;\n initialized: boolean;\n currentChannel: SendbirdUIKit.GroupChannelType;\n currentMessageSearchQuery: SendbirdUIKit.ClientMessageSearchQuery;\n hasMoreResult: boolean;\n}\n\nconst initialState: State = {\n allMessages: [],\n loading: false,\n isInvalid: false,\n initialized: false,\n currentChannel: null,\n currentMessageSearchQuery: null,\n hasMoreResult: false,\n};\n\nexport default initialState;\n","import { useEffect } from 'react';\nimport * as messageActionTypes from '../dux/actionTypes';\n\ninterface MainProps {\n channelUrl: string;\n sdkInit: boolean;\n}\ninterface ToolProps {\n sdk: SendbirdUIKit.Sdk;\n logger: SendbirdUIKit.Logger;\n messageSearchDispathcer: ({ type: string, payload: any }) => void;\n}\n\nfunction useSetChannel(\n { channelUrl, sdkInit }: MainProps,\n { sdk, logger, messageSearchDispathcer }: ToolProps,\n): void {\n useEffect(() => {\n if (channelUrl && sdkInit && sdk && (sdk.OpenChannel || sdk.GroupChannel)) {\n sdk.GroupChannel.getChannel(channelUrl, (groupChannel, error) => {\n if (!error) {\n logger.info('MessageSearch | useSetChannel group channel', groupChannel);\n messageSearchDispathcer({\n type: messageActionTypes.SET_CURRENT_CHANNEL,\n payload: groupChannel,\n });\n } else {\n messageSearchDispathcer({\n type: messageActionTypes.CHANNEL_INVALID,\n payload: null,\n });\n }\n });\n }\n }, [channelUrl, sdkInit]);\n}\n\nexport default useSetChannel;\n","import { useEffect } from 'react';\nimport * as messageActionTypes from '../dux/actionTypes';\nimport SendbirdUIKit from '../../../index';\nimport SendBird from 'sendbird';\n\ninterface MainProps {\n currentChannel: SendbirdUIKit.GroupChannelType;\n channelUrl: string;\n searchString?: string;\n messageSearchQuery?: SendbirdUIKit.MessageSearchQueryType;\n onResultLoaded?: (\n messages?: Array<SendBird.UserMessage | SendBird.FileMessage | SendBird.AdminMessage>,\n error?: SendbirdUIKit.SendbirdError,\n ) => void;\n retryCount: number;\n}\ninterface ToolProps {\n sdk: SendbirdUIKit.Sdk;\n logger: SendbirdUIKit.Logger;\n messageSearchDispathcer: ({ type: string, payload: any }) => void;\n}\n\nfunction useGetSearchedMessages(\n { currentChannel, channelUrl, searchString, messageSearchQuery, onResultLoaded, retryCount }: MainProps,\n { sdk, logger, messageSearchDispathcer }: ToolProps,\n): void {\n useEffect(() => {\n messageSearchDispathcer({\n type: messageActionTypes.START_MESSAGE_SEARCH,\n payload: null,\n });\n if (sdk && channelUrl && sdk.createMessageSearchQuery && currentChannel) {\n if (searchString) {\n const inputSearchMessageQueryObject = {\n ...messageSearchQuery,\n channelUrl,\n messageTimestampFrom: currentChannel.invitedAt,\n };\n const createdQuery = sdk.createMessageSearchQuery(searchString, inputSearchMessageQueryObject);\n createdQuery.next((messages, error) => {\n if (!error) {\n logger.info('MessageSearch | useGetSearchedMessages: succeeded getting messages', messages);\n messageSearchDispathcer({\n type: messageActionTypes.GET_SEARCHED_MESSAGES,\n payload: {\n messages,\n createdQuery,\n },\n });\n if (onResultLoaded && typeof onResultLoaded === 'function') {\n onResultLoaded(messages, null);\n }\n } else {\n logger.warning('MessageSearch | useGetSearchedMessages: getting failed', error);\n messageSearchDispathcer({\n type: messageActionTypes.SET_QUERY_INVALID,\n payload: null,\n });\n if (onResultLoaded && typeof onResultLoaded === 'function') {\n onResultLoaded(null, error);\n }\n }\n });\n messageSearchDispathcer({\n type: messageActionTypes.START_GETTING_SEARCHED_MESSAGES,\n payload: createdQuery,\n });\n } else {\n logger.info('MessageSearch | useGetSeasrchedMessages: search string is empty');\n }\n }\n }, [channelUrl, messageSearchQuery, searchString, currentChannel, retryCount]);\n}\n\nexport default useGetSearchedMessages;\n","import { useCallback } from 'react';\nimport * as messageActionTypes from '../dux/actionTypes';\nimport SendbirdUIKit from '../../../index';\n\ninterface MainProps {\n currentMessageSearchQuery: SendBird.MessageSearchQuery;\n hasMoreResult: boolean;\n onResultLoaded?: (\n messages?: Array<SendBird.UserMessage | SendBird.FileMessage | SendBird.AdminMessage>,\n error?: SendbirdUIKit.SendbirdError,\n ) => void;\n}\ninterface ToolProps {\n logger: SendbirdUIKit.Logger;\n messageSearchDispathcer: ({ type: string, payload: any }) => void;\n}\ntype CallbackReturn = (\n callback: (\n messages: Array<SendBird.UserMessage | SendBird.FileMessage | SendBird.AdminMessage>,\n /* eslint-disable @typescript-eslint/no-explicit-any*/\n error: any,\n ) => void\n) => void;\n\nfunction useScrollCallback(\n { currentMessageSearchQuery, hasMoreResult, onResultLoaded }: MainProps,\n { logger, messageSearchDispathcer }: ToolProps,\n): CallbackReturn {\n return useCallback((cb) => {\n if (!hasMoreResult) {\n logger.warning('MessageSearch | useScrollCallback: no more searched results', hasMoreResult);\n }\n if (currentMessageSearchQuery && currentMessageSearchQuery.hasNext) {\n currentMessageSearchQuery.next((messages, error) => {\n if (!error) {\n logger.info('MessageSearch | useScrollCallback: succeeded getting searched messages', messages);\n messageSearchDispathcer({\n type: messageActionTypes.GET_NEXT_SEARCHED_MESSAGES,\n payload: messages,\n });\n cb(messages, null);\n if (onResultLoaded && typeof onResultLoaded === 'function') {\n onResultLoaded(messages, null);\n }\n } else {\n logger.warning('MessageSearch | useScrollCallback: failed getting searched messages', error);\n cb(null, error);\n if (onResultLoaded && typeof onResultLoaded === 'function') {\n onResultLoaded(null, error);\n }\n }\n });\n } else {\n logger.warning('MessageSearch | useScrollCallback: no currentMessageSearchQuery');\n }\n }, [currentMessageSearchQuery, hasMoreResult]);\n}\n\nexport default useScrollCallback;\n","import format from 'date-fns/format';\nimport isToday from 'date-fns/isToday';\nimport isYesterday from 'date-fns/isYesterday';\n\n// getCreatedAt\nexport default (createdAt: number): string => {\n if (!createdAt) {\n return '';\n }\n if (isToday(createdAt)) {\n return format(createdAt, 'p');\n }\n if (isYesterday(createdAt)) {\n return 'Yesterday';\n }\n return format(createdAt, 'MMM dd');\n};\n","import React, { useContext } from 'react';\nimport './index.scss';\nimport getCreatedAt from './getCreatedAt';\n\nimport Avatar from '../Avatar';\nimport Label, { LabelTypography, LabelColors } from '../Label';\nimport { LocalizationContext } from '../../lib/LocalizationContext';\n\ninterface Props {\n className?: string | Array<string>;\n message: SendbirdUIKit.ClientUserMessage;\n selected?: boolean;\n onClick?: (message: SendbirdUIKit.ClientMessage) => void;\n}\n\nexport default function MessageSearchItem({\n className,\n message,\n selected,\n onClick,\n}: Props): JSX.Element {\n const { createdAt } = message;\n const messageText = message.message;\n const sender = message.sender || message._sender;\n const { profileUrl, nickname } = sender;\n const { stringSet } = useContext(LocalizationContext);\n\n return (\n <div\n className={[\n ...(Array.isArray(className) ? className : [className]),\n 'sendbird-message-search-item',\n selected ? 'sendbird-message-search-item--selected' : '',\n ].join(' ')}\n onClick={(e) => {\n e.stopPropagation();\n onClick(message);\n }}\n >\n <div className=\"sendbird-message-search-item__left\">\n <Avatar\n className=\"sendbird-message-search-item__left__sender-avatar\"\n src={profileUrl}\n alt=\"profile image\"\n width=\"56px\"\n height=\"56px\"\n />\n </div>\n <div className=\"sendbird-message-search-item__right\">\n <Label\n className=\"sendbird-message-search-item__right__sender-name\"\n type={LabelTypography.SUBTITLE_2}\n color={LabelColors.ONBACKGROUND_1}\n >\n {nickname || stringSet.NO_NAME}\n </Label>\n <Label\n className=\"sendbird-message-search-item__right__message-text\"\n type={LabelTypography.BODY_2}\n color={LabelColors.ONBACKGROUND_3}\n >\n {messageText}\n </Label>\n <Label\n className=\"sendbird-message-search-item__right__message-created-at\"\n type={LabelTypography.CAPTION_3}\n color={LabelColors.ONBACKGROUND_2}\n >\n {getCreatedAt(createdAt)}\n </Label>\n </div>\n <div className=\"sendbird-message-search-item__right-footer\" />\n </div>\n );\n}\n","import format from 'date-fns/format';\nimport isToday from 'date-fns/isToday';\nimport isYesterday from 'date-fns/isYesterday';\nimport { IconTypes } from '../Icon';\n\nexport function getCreatedAt(createdAt: number): string {\n if (!createdAt) {\n return '';\n }\n if (isToday(createdAt)) {\n return format(createdAt, 'p');\n }\n if (isYesterday(createdAt)) {\n return 'Yesterday';\n }\n return format(createdAt, 'MMM dd');\n}\n\nexport function getIconOfFileType(message: SendbirdUIKit.ClientFileMessage): string {\n const { url } = message;\n const fileMessageUrl = url;\n const fileExtension = (fileMessageUrl.match(/\\.([^.]*?)(?=\\?|#|$)/))[1];\n\n if (/(jpg|jpeg|png)$/i.test(fileExtension)) {\n return IconTypes.PHOTO;\n } else if (/mp4$/i.test(fileExtension)) {\n return IconTypes.PLAY;\n } else if (/mp3/i.test(fileExtension)) {\n return IconTypes.FILE_AUDIO;\n } else if (/gif/i.test(fileExtension)) {\n return IconTypes.GIF;\n } else {\n return IconTypes.FILE_DOCUMENT;\n }\n}\n\nexport function truncate(fullText: string, textLimit: number): string {\n if (fullText.length <= textLimit) return fullText;\n const separator = '...';\n const sepLen = separator.length;\n const charsToShow = textLimit - sepLen;\n const frontChars = Math.ceil(charsToShow / 2);\n const backChars = Math.floor(charsToShow / 2);\n return fullText.substr(0, frontChars) + separator + fullText.substr(fullText.length - backChars);\n}\n","import React, { ReactElement, useContext } from 'react';\nimport './index.scss';\n\nimport Avatar from '../Avatar';\nimport Icon, { IconColors } from '../Icon';\nimport Label, { LabelTypography, LabelColors } from '../Label';\nimport { LocalizationContext } from '../../lib/LocalizationContext';\nimport { getCreatedAt, getIconOfFileType, truncate } from './utils';\n\ninterface Props {\n className?: string | Array<string>;\n message: SendbirdUIKit.ClientFileMessage;\n selected?: boolean;\n onClick?: (message: SendbirdUIKit.ClientFileMessage) => void;\n}\n\nexport default function MessageSearchFileItem(props: Props): ReactElement {\n const {\n className,\n message,\n selected,\n onClick,\n } = props;\n const { createdAt, url, name } = message;\n const fileMessageUrl = url;\n const sender = message.sender || message._sender;\n const { profileUrl, nickname } = sender;\n const { stringSet } = useContext(LocalizationContext);\n\n return (\n <div\n className={[\n ...(Array.isArray(className) ? className : [className]),\n 'sendbird-message-search-file-item',\n selected ? 'sendbird-message-search-file-item--selected' : '',\n ].join(' ')}\n onClick={(e) => {\n e.stopPropagation();\n onClick(message);\n }}\n >\n <div className=\"sendbird-message-search-file-item__left\">\n <Avatar\n className=\"sendbird-message-search-file-item__left__sender-avatar\"\n src={profileUrl}\n alt=\"profile image\"\n width=\"56px\"\n height=\"56px\"\n />\n </div>\n <div className=\"sendbird-message-search-file-item__right\">\n <Label\n className=\"sendbird-message-search-file-item__right__sender-name\"\n type={LabelTypography.SUBTITLE_2}\n color={LabelColors.ONBACKGROUND_1}\n >\n {nickname || stringSet.NO_NAME}\n </Label>\n <div className=\"sendbird-message-search-file-item__right__content\">\n <div className=\"sendbird-message-search-file-item__right__content__type-icon\">\n <Icon\n type={getIconOfFileType(message)}\n fillColor={IconColors.PRIMARY}\n width=\"18px\"\n height=\"18px\"\n />\n </div>\n <Label\n className=\"sendbird-message-search-file-item__right__content__url\"\n type={LabelTypography.BODY_2}\n color={LabelColors.ONBACKGROUND_1}\n >\n {truncate(name || fileMessageUrl, 28)}\n </Label>\n </div>\n </div>\n <Label\n className=\"sendbird-message-search-file-item__message-created-at\"\n type={LabelTypography.CAPTION_3}\n color={LabelColors.ONBACKGROUND_2}\n >\n {getCreatedAt(createdAt)}\n </Label>\n <div className=\"sendbird-message-search-file-item__right-footer\" />\n </div>\n );\n}\n","import React, { useReducer, useRef, useContext, useState } from 'react';\nimport './index.scss';\n\nimport widthSendbirdContext from '../../lib/SendbirdSdkContext';\nimport messageSearchReducer from './dux/reducers';\nimport messageSearchInitialState from './dux/initialState';\n\nimport useSetChannel from './hooks/useSetChannel';\nimport useGetSearchMessages from './hooks/useGetSearchedMessages';\nimport useScrollCallback from './hooks/useScrollCallback';\n\nimport MessageSearchItem from '../../ui/MessageSearchItem';\nimport PlaceHolder, { PlaceHolderTypes } from '../../ui/PlaceHolder';\nimport { LocalizationContext } from '../../lib/LocalizationContext';\nimport MessageSearchFileItem from '../../ui/MessageSearchFileItem';\n\nimport SendbirdUIKit from '../../index';\n\nconst COMPONENT_CLASS_NAME = 'sendbird-message-search';\n\ninterface Props extends SendbirdUIKit.MessageSearchProps {\n // sendbird internal props\n stores: {\n sdkStore?: SendbirdUIKit.SdkStore,\n userStore?: SendbirdUIKit.UserStore,\n };\n config: {\n userId: string,\n isOnline: boolean,\n logger?: SendbirdUIKit.Logger,\n theme?: string,\n /* eslint-disable @typescript-eslint/no-explicit-any*/\n pubSub: any,\n disableUserProfile?: boolean,\n renderUserProfile?(): JSX.Element,\n imageCompression?: {\n compressionRate?: number,\n resizingWidth?: number | string,\n resizingHeight?: number | string,\n },\n };\n}\n\nfunction MessageSearch(props: Props): JSX.Element {\n const {\n // sendbird internal props\n stores,\n config,\n // message search props\n channelUrl,\n searchString,\n messageSearchQuery,\n renderSearchItem,\n onResultLoaded,\n onResultClick,\n } = props;\n\n // hook variables\n const { stringSet } = useContext(LocalizationContext);\n const [retryCount, setRetryCount] = useState(0); // this is a trigger flag for activating useGetSearchMessages\n const [selectedMessageId, setSelectedMessageId] = useState(0);\n const [messageSearchStore, messageSearchDispathcer] = useReducer(messageSearchReducer, messageSearchInitialState);\n const {\n allMessages,\n loading,\n isInvalid,\n currentChannel,\n currentMessageSearchQuery,\n hasMoreResult,\n } = messageSearchStore;\n\n const getChannelName = () => {\n if (currentChannel && currentChannel.name && currentChannel.name !== 'Group Channel') {\n return currentChannel.name;\n }\n if (currentChannel && (currentChannel.name === 'Group Channel' || !currentChannel.name)) {\n return currentChannel.members.map((member) => member.nickname || stringSet.NO_NAME).join(', ');\n }\n return stringSet.NO_TITLE;\n };\n\n // const\n const {\n sdkStore,\n } = stores;\n const {\n logger,\n } = config;\n const { sdk } = sdkStore;\n const sdkInit = sdkStore.initialized;\n const scrollRef = useRef(null);\n const handleOnScroll = (e) => {\n const scrollElement = e.target;\n const {\n scrollTop,\n scrollHeight,\n clientHeight,\n } = scrollElement;\n\n if (!hasMoreResult) {\n return;\n }\n if (scrollTop + clientHeight >= scrollHeight) {\n onScroll(() => {\n // after load more searched messages\n });\n }\n };\n\n useSetChannel(\n { channelUrl, sdkInit },\n { sdk, logger, messageSearchDispathcer },\n );\n\n useGetSearchMessages(\n { currentChannel, channelUrl, searchString, messageSearchQuery, onResultLoaded, retryCount },\n { sdk, logger, messageSearchDispathcer },\n );\n\n const onScroll = useScrollCallback(\n { currentMessageSearchQuery, hasMoreResult, onResultLoaded },\n { logger, messageSearchDispathcer },\n );\n\n const handleRetryToConnect = () => {\n setRetryCount(retryCount + 1);\n };\n\n if (isInvalid && searchString) {\n return (\n <div className={COMPONENT_CLASS_NAME}>\n <PlaceHolder\n type={PlaceHolderTypes.WRONG}\n retryToConnect={handleRetryToConnect}\n />\n </div>\n );\n }\n\n if (loading && searchString) {\n return (\n <div className={COMPONENT_CLASS_NAME}>\n <PlaceHolder type={PlaceHolderTypes.SEARCHING} />\n </div>\n );\n }\n\n if (!searchString) {\n return (\n <div className={COMPONENT_CLASS_NAME}>\n <PlaceHolder\n type={PlaceHolderTypes.SEARCH_IN}\n searchInString={getChannelName()}\n />\n </div>\n );\n }\n\n return (\n <div\n className={COMPONENT_CLASS_NAME}\n onScroll={handleOnScroll}\n ref={scrollRef}\n >\n {\n (allMessages.length > 0)\n ? (\n allMessages.map((message) => {\n if (renderSearchItem) {\n return renderSearchItem({ message, onResultClick });\n }\n if (message.messageType === 'file') {\n return (\n <MessageSearchFileItem\n className={`${COMPONENT_CLASS_NAME}__message-search-item`}\n message={message}\n key={message.messageId}\n selected={(selectedMessageId === message.messageId)}\n onClick={() => {\n onResultClick(message);\n setSelectedMessageId(message.messageId);\n }}\n />\n );\n }\n return (\n <MessageSearchItem\n className={`${COMPONENT_CLASS_NAME}__message-search-item`}\n message={message}\n key={message.messageId}\n selected={(selectedMessageId === message.messageId)}\n onClick={() => {\n onResultClick(message);\n setSelectedMessageId(message.messageId);\n }}\n />\n );\n })\n )\n : (\n <PlaceHolder type={PlaceHolderTypes.NO_RESULTS} />\n )\n }\n </div>\n );\n}\n\nexport default widthSendbirdContext(MessageSearch);\n"],"names":["GET_SEARCHED_MESSAGES","GET_NEXT_SEARCHED_MESSAGES","START_MESSAGE_SEARCH","START_GETTING_SEARCHED_MESSAGES","SET_QUERY_INVALID","SET_CURRENT_CHANNEL","CHANNEL_INVALID","reducer","state","action","type","actionTypes","currentChannel","payload","initialized","_a","messages","createdQuery","channelUrl","currentMessageSearchQuery","key","loading","isInvalid","allMessages","hasMoreResult","hasNext","initialState","useSetChannel","_b","sdkInit","sdk","logger","messageSearchDispathcer","useEffect","OpenChannel","GroupChannel","getChannel","groupChannel","error","info","messageActionTypes","useGetSearchedMessages","searchString","messageSearchQuery","onResultLoaded","retryCount","createMessageSearchQuery","inputSearchMessageQueryObject","messageTimestampFrom","invitedAt","createdQuery_1","next","warning","useScrollCallback","useCallback","cb","createdAt","isToday","format","isYesterday","MessageSearchItem","className","message","selected","onClick","messageText","sender","_sender","profileUrl","nickname","stringSet","useContext","LocalizationContext","React","__spreadArray","Array","isArray","join","e","stopPropagation","LabelTypography","SUBTITLE_2","LabelColors","ONBACKGROUND_1","NO_NAME","BODY_2","ONBACKGROUND_3","CAPTION_3","ONBACKGROUND_2","getCreatedAt","getIconOfFileType","url","fileMessageUrl","fileExtension","match","test","IconTypes","PHOTO","PLAY","FILE_AUDIO","GIF","FILE_DOCUMENT","truncate","fullText","textLimit","length","separator","sepLen","charsToShow","frontChars","Math","ceil","backChars","floor","substr","MessageSearchFileItem","props","name","IconColors","PRIMARY","COMPONENT_CLASS_NAME","MessageSearch","stores","config","renderSearchItem","onResultClick","useState","setRetryCount","selectedMessageId","setSelectedMessageId","_c","useReducer","messageSearchReducer","messageSearchInitialState","messageSearchStore","getChannelName","members","map","member","NO_TITLE","sdkStore","scrollRef","useRef","handleOnScroll","scrollElement","target","scrollTop","scrollHeight","clientHeight","onScroll","useGetSearchMessages","handleRetryToConnect","PlaceHolderTypes","WRONG","SEARCHING","SEARCH_IN","messageType","messageId","NO_RESULTS","widthSendbirdContext"],"mappings":";;;;;;;AAAO,IAAMA,qBAAqB,GAAG,uBAA9B;AACA,IAAMC,0BAA0B,GAAG,4BAAnC;AACA,IAAMC,oBAAoB,GAAG,sBAA7B;AACA,IAAMC,+BAA+B,GAAG,iCAAxC;AACA,IAAMC,iBAAiB,GAAG,mBAA1B;AAEA,IAAMC,mBAAmB,GAAG,qBAA5B;AACA,IAAMC,eAAe,GAAG,iBAAxB;;SCEiBC,QACtBC,OACAC;AAEA,UAAQA,MAAM,CAACC,IAAf;AACE,SAAKC,mBAAL;AAAsC;AACpC,YAAMC,cAAc,GAAGH,MAAM,CAACI,OAA9B;AACA,qCACKL;AACHI,UAAAA,cAAc;AACdE,UAAAA,WAAW,EAAE;UAHf;AAKD;;AACD,SAAKH,eAAL;AAAkC;AAChC,qCACKH;AACHI,UAAAA,cAAc,EAAE;AAChBE,UAAAA,WAAW,EAAE;UAHf;AAKD;;AACD,SAAKH,qBAAL;AAAwC;AAChC,YAAAI,KAA6BN,MAAM,CAACI,OAApC;AAAA,YAAEG,QAAQ,cAAV;AAAA,YAAYC,YAAY,kBAAxB;;AACN,YACEA,YAAY,IAC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