2026-07-27 11:26:19 +00:00
// Module ID: 11390
// Function ID: 88497
2026-07-20 16:05:17 +00:00
// Name: _createForOfIteratorHelperLoose
2026-07-27 11:26:19 +00:00
// Dependencies: [5847, 10041, 9033, 11391, 653, 10042, 8055, 1360, 6687, 477, 1820, 4075, 1443, 9700, 689, 3804, 10040, 11398, 10049, 22, 620, 2]
2026-07-20 16:05:17 +00:00
// Exports: delayUntilNavigationComplete, getFiles, getLinks, getMedia, getMediaGridItemStyles, getUrlIcon, performKeyboardAwareNavigation, toSearchBarTag
2026-07-27 11:26:19 +00:00
// Module 11390 (_createForOfIteratorHelperLoose)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct" ;
import closure_4 from "_isNativeReflectConstruct" ;
import SearchAutocompleteSelectAnalyticsActions from "SearchAutocompleteSelectAnalyticsActions" ;
import SEARCH_TEXT_INPUT_DEBOUNCE_TIME from "SEARCH_TEXT_INPUT_DEBOUNCE_TIME" ;
import ME from "ME" ;
import importDefaultResult from "apply" ;
import importDefaultResult1 from "apply" ;
2026-07-20 16:05:17 +00:00
let SEARCH_TEXT_INPUT_DEBOUNCE_TIME ;
2026-07-23 10:11:24 +00:00
let closure_10 ;
let closure_11 ;
let closure_12 ;
let closure_13 ;
let closure_14 ;
let closure_15 ;
let closure_16 ;
let closure_5 ;
let closure_6 ;
let closure_7 ;
let closure_8 ;
let closure_9 ;
let require = arg1 ;
function _createForOfIteratorHelperLoose ( iterable ) {
let closure_0 = iterable ;
iterable = "undefined" !== typeof Symbol ;
if ( iterable ) {
2026-07-20 16:05:17 +00:00
const _Symbol = Symbol ;
2026-07-23 10:11:24 +00:00
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( ! iterable ) {
iterable = iterable [ Symbol . iterator ] ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
if ( iterable ) {
const iter = iterable . call ( iterable ) ;
2026-07-20 16:05:17 +00:00
const next = iter . next ;
return next . bind ( iter ) ;
} else {
const _Array = Array ;
2026-07-23 10:11:24 +00:00
let tmp = iterable ;
if ( ! Array . isArray ( iterable ) ) {
2026-07-20 16:05:17 +00:00
let tmp2 ;
2026-07-23 10:11:24 +00:00
if ( iterable ) {
if ( "string" === typeof iterable ) {
tmp2 = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
const toString = { } . toString ;
2026-07-23 10:11:24 +00:00
const substr = toString . call ( iterable ) . slice ( 8 , - 1 ) ;
2026-07-20 16:05:17 +00:00
let name = substr ;
if ( tmp3 ) {
2026-07-23 10:11:24 +00:00
name = iterable . constructor . name ;
2026-07-20 16:05:17 +00:00
}
if ( "Map" !== name ) {
if ( "Set" !== name ) {
if ( "Arguments" === name ) {
2026-07-23 10:11:24 +00:00
let arr = _arrayLikeToArray ( iterable , undefined ) ;
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
let obj = /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/ ;
2026-07-20 16:05:17 +00:00
}
}
tmp2 = arr ;
}
const _Array2 = Array ;
2026-07-23 10:11:24 +00:00
arr = Array . from ( iterable ) ;
const callResult = toString . call ( iterable ) ;
tmp3 = "Object" === substr && iterable . constructor ;
2026-07-20 16:05:17 +00:00
}
}
tmp = tmp2 ;
if ( ! tmp2 ) {
const _TypeError = TypeError ;
const typeError = new TypeError ( "Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method." ) ;
throw typeError ;
}
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
closure_0 = tmp ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let c1 = 0 ;
2026-07-20 16:05:17 +00:00
return ( ) = > {
2026-07-23 10:11:24 +00:00
if ( closure_1 >= length . length ) {
2026-07-20 16:05:17 +00:00
let obj = { done : true } ;
} else {
obj = { done : false } ;
closure_1 = tmp3 + 1 ;
2026-07-23 10:11:24 +00:00
obj . value = length [ + closure_1 ] ;
2026-07-20 16:05:17 +00:00
}
return obj ;
} ;
}
}
function _arrayLikeToArray ( arg0 , arg1 ) {
let length ;
if ( tmp ) {
length = arg0 . length ;
}
const ArrayResult = Array ( length ) ;
for ( let num = 0 ; num < length ; num = num + 1 ) {
ArrayResult [ num ] = arg0 [ num ] ;
}
return ArrayResult ;
}
function performKeyboardAwareNavigation ( arg0 ) {
2026-07-23 10:11:24 +00:00
const _require = arg0 ;
2026-07-20 16:05:17 +00:00
if ( obj . getKeyboardIsOpen ( ) ) {
if ( obj2 . isIOS ( ) ) {
2026-07-23 10:11:24 +00:00
const result = _require ( 1820 ) . dismissGlobalKeyboard ( ) ;
2026-07-20 16:05:17 +00:00
const _setTimeout = setTimeout ;
2026-07-23 10:11:24 +00:00
const timerId = setTimeout ( ( ) = > callback ( ) , 100 ) ;
const obj3 = _require ( 1820 ) ;
2026-07-20 16:05:17 +00:00
}
}
arg0 ( ) ;
}
function delayUntilNavigationComplete ( arg0 ) {
2026-07-23 10:11:24 +00:00
let closure_0 = arg0 ;
const timerId = setTimeout ( ( ) = > callback ( ) , 200 ) ;
2026-07-20 16:05:17 +00:00
}
function getUrlIcon ( target ) {
let Icon ;
let REGEX ;
if ( null == target ) {
2026-07-25 08:10:48 +00:00
return require ( 4075 ) /* LinkIcon */ . LinkIcon ;
2026-07-20 16:05:17 +00:00
} else {
if ( null == obj . safeParseWithQuery ( target ) ) {
2026-07-25 08:10:48 +00:00
return require ( 4075 ) /* LinkIcon */ . LinkIcon ;
2026-07-20 16:05:17 +00:00
} else {
if ( obj2 . isDiscordUrl ( target ) ) {
2026-07-25 08:10:48 +00:00
return require ( 9700 ) /* ClydeIcon */ . ClydeIcon ;
2026-07-20 16:05:17 +00:00
} else {
let num = 0 ;
if ( 0 < closure_13 . length ) {
( { REGEX , Icon } = closure_13 [ num ] ) ;
while ( null == REGEX . exec ( target ) ) {
num = num + 1 ;
let tmp3 = closure_13 ;
}
return Icon ;
}
2026-07-25 08:10:48 +00:00
return require ( 4075 ) /* LinkIcon */ . LinkIcon ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj2 = importDefault ( 1443 ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj = importDefault ( 1443 ) ;
2026-07-20 16:05:17 +00:00
}
}
function getGridItemBorderStyles ( numItems ) {
let itemIndex ;
let numColumns ;
( { itemIndex , numColumns } = numItems ) ;
const rounded = Math . ceil ( numItems . numItems / numColumns ) ;
if ( 0 === itemIndex ) {
2026-07-23 10:11:24 +00:00
let obj = { borderTopLeftRadius : importDefault ( 689 ) . radii . lg } ;
2026-07-20 16:05:17 +00:00
let tmp4 = obj ;
} else if ( itemIndex === numColumns - 1 ) {
2026-07-23 10:11:24 +00:00
obj = { borderTopRightRadius : importDefault ( 689 ) . radii . lg } ;
2026-07-20 16:05:17 +00:00
tmp4 = obj ;
} else {
if ( itemIndex % numColumns == 0 ) {
if ( tmp2 === tmp3 ) {
2026-07-23 10:11:24 +00:00
const obj1 = { borderBottomLeftRadius : importDefault ( 689 ) . radii . lg } ;
2026-07-20 16:05:17 +00:00
tmp4 = obj1 ;
}
}
if ( itemIndex === rounded * numColumns - 1 ) {
2026-07-23 10:11:24 +00:00
obj = { borderBottomRightRadius : importDefault ( 689 ) . radii . lg } ;
2026-07-20 16:05:17 +00:00
tmp4 = obj ;
}
}
return tmp4 ;
}
function getMediaGridItemStyles ( spacing ) {
let itemIndex ;
let numColumns ;
( { itemIndex , numColumns } = spacing ) ;
let obj = { } ;
obj = { itemIndex , numItems : spacing.numItems , numColumns } ;
const merged = Object . assign ( getGridItemBorderStyles ( obj ) ) ;
const merged1 = Object . assign ( getGridItemSpacingStyles ( { itemIndex , spacing : spacing.spacing , numColumns } ) ) ;
return obj ;
}
function getGridItemSpacingStyles ( numColumns ) {
numColumns = numColumns . numColumns ;
const result = numColumns . spacing * ( numColumns - 1 ) / numColumns ;
const result1 = numColumns . itemIndex % numColumns ;
if ( 0 === result1 ) {
let obj = { marginEnd : result } ;
return obj ;
} else if ( numColumns - 1 === result1 ) {
obj = { marginStart : result } ;
return obj ;
} else {
obj = { marginHorizontal : result / 2 } ;
return obj ;
}
}
function toSearchBarTag ( id ) {
return { id : id.text , text : id.text } ;
}
function _getLimit ( arg0 ) {
return Math . min ( arg0 , closure_6 ) ;
}
function getInitialFetchLimit ( tab ) {
2026-07-23 10:11:24 +00:00
return _getLimit ( dependencyMap [ tab ] ) ;
2026-07-20 16:05:17 +00:00
}
function getNextFetchLimit ( arg0 ) {
2026-07-23 10:11:24 +00:00
return _getLimit ( 2 * dependencyMap [ arg0 ] ) ;
2026-07-20 16:05:17 +00:00
}
function onInitialFetchMessagesSuccess ( arg0 ) {
let searchContext ;
let tabEntries ;
( { tabEntries , searchContext } = arg0 ) ;
if ( tabEntries . every ( ( arg0 ) = > {
let tmp ;
[ , tmp ] = arg0 ;
let tmp2 = 0 === tmp . total_results ;
if ( ! tmp2 ) {
tmp2 = null == tmp . total_results ;
}
return tmp2 ;
} ) ) {
2026-07-25 08:10:48 +00:00
let obj = importDefault ( 10040 ) ;
2026-07-20 16:05:17 +00:00
obj = { searchContext } ;
const result = obj . trackSearchEmptyMessageResult ( obj ) ;
}
}
function onFetchMessagesStart ( searchQueryString ) {
2026-07-23 10:11:24 +00:00
searchQueryString = searchQueryString . searchQueryString ;
2026-07-27 11:26:19 +00:00
importDefault ( 11398 ) . updateSearchQuery ( searchQueryString . searchContext , ( setSearchResultsQuery ) = > setSearchResultsQuery . setSearchResultsQuery ( searchQueryString ) ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
function fetchInitialMessages ( closure_0 ) {
const _require = closure_0 ;
const queryString = store2 . getQueryString ( closure_0 ) ;
2026-07-20 16:05:17 +00:00
if ( isInitialSearchQueryResult ) {
2026-07-23 10:11:24 +00:00
const type = closure_0 . type ;
2026-07-20 16:05:17 +00:00
if ( constants3 . GUILD_CHANNEL !== type ) {
if ( constants3 . CHANNEL !== type ) {
let tmp6 = closure_8 ;
}
}
tmp6 = closure_5 ;
} else {
2026-07-25 08:10:48 +00:00
let obj = _require ( 10042 ) ;
2026-07-23 10:11:24 +00:00
const searchTabFetchId = obj . getSearchTabFetchId ( closure_0 , tmp3 [ 0 ] , queryString ) ;
2026-07-20 16:05:17 +00:00
if ( ! store . getIsFetching ( searchTabFetchId ) ) {
2026-07-25 08:10:48 +00:00
let obj1 = queryString ( 10049 ) ;
2026-07-20 16:05:17 +00:00
const result = obj1 . clearAllSearchMesssages ( ) ;
2026-07-23 10:11:24 +00:00
obj = { searchContext : closure_0 } ;
2026-07-25 08:10:48 +00:00
queryString ( 10040 ) . trackSearchStarted ( obj ) ;
const obj3 = queryString ( 10040 ) ;
2026-07-20 16:05:17 +00:00
obj = {
2026-07-23 10:11:24 +00:00
searchContext : closure_0 ,
2026-07-20 16:05:17 +00:00
searchTabs : tmp3 ,
searchQueryString : queryString ,
getId ( closure_1 ) {
2026-07-23 10:11:24 +00:00
return callback ( outer1_2 [ 5 ] ) . getSearchTabFetchId ( callback , closure_1 , queryString ) ;
2026-07-20 16:05:17 +00:00
} ,
getLimit : getInitialFetchLimit ,
onFetchStart : onFetchMessagesStart ,
onFetchSuccess : onInitialFetchMessagesSuccess
} ;
obj1 = { } ;
const cursor = store . getCursor ( searchTabFetchId ) ;
let tmp21 = null ;
if ( null != cursor ) {
tmp21 = cursor ;
}
obj1 . cursor = tmp21 ;
obj . pagination = obj1 ;
2026-07-25 08:10:48 +00:00
const obj5 = queryString ( 10049 ) ;
obj . trackExactTotalHits = _require ( 3804 ) . SearchResultExactCountEnabled . getSetting ( ) ;
2026-07-20 16:05:17 +00:00
obj . searchMode = constants2 . NEWEST ;
const tabMessages = obj5 . fetchTabMessages ( obj ) ;
2026-07-25 08:10:48 +00:00
const SearchResultExactCountEnabled = _require ( 3804 ) . SearchResultExactCountEnabled ;
2026-07-20 16:05:17 +00:00
}
}
}
function syncAutocomplete ( searchContext ) {
const queryString = store2 . getQueryString ( searchContext , true ) ;
2026-07-25 08:10:48 +00:00
let obj = require ( 10042 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
const tokenizeQueryResult = obj . tokenizeQuery ( queryString ) ;
2026-07-25 08:10:48 +00:00
const selectionScope = require ( 10042 ) /* _createForOfIteratorHelperLoose */ . getSelectionScope ( tokenizeQueryResult , queryString . length - 1 , queryString . length - 1 ) ;
const obj2 = require ( 10042 ) /* _createForOfIteratorHelperLoose */ ;
2026-07-20 16:05:17 +00:00
obj = { searchContext , tokens : tokenizeQueryResult , cursorScope : selectionScope , queryString } ;
2026-07-25 08:10:48 +00:00
const result = importDefault ( 10049 ) . updateAutocompleteQuery ( obj ) ;
2026-07-20 16:05:17 +00:00
}
function subscribeSearchQueryState ( searchContext , arg1 , arg2 , arg3 ) {
let tmp = arg3 ;
2026-07-23 10:11:24 +00:00
let closure_0 = searchContext ;
let closure_1 = arg1 ;
let closure_2 = arg2 ;
2026-07-20 16:05:17 +00:00
function callback() {
2026-07-23 10:11:24 +00:00
const tmp = callback ( callback . getManager ( closure_0 ) ) ;
if ( null == _isNativeReflectConstruct ) {
_isNativeReflectConstruct = tmp ;
dependencyMap ( tmp , _isNativeReflectConstruct ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
let _isNativeReflectConstruct = arg1 ( callback . getManager ( searchContext ) ) ;
2026-07-20 16:05:17 +00:00
if ( arg3 ) {
2026-07-23 10:11:24 +00:00
tmp = null != _isNativeReflectConstruct ;
2026-07-20 16:05:17 +00:00
}
if ( tmp ) {
2026-07-23 10:11:24 +00:00
arg2 ( _isNativeReflectConstruct , undefined ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
callback . addChangeListener ( callback ) ;
2026-07-20 16:05:17 +00:00
return ( ) = > callback . removeChangeListener ( callback ) ;
}
2026-07-23 10:11:24 +00:00
( { CHANNEL_SEARCH_INITIAL_MESSAGE_TABS : closure_5 , MAX_SEARCH_RESULTS_LIMIT : closure_6 , MESSAGE_SEARCH_RESULT_TABS : closure_7 , SEARCH_INITIAL_MESSAGE_TABS : closure_8 , SEARCH_TABS_TO_SEARCH_QUERY_LIMITS : closure_9 , SearchFileTypes : closure_10 , SearchLinkTypes : closure_11 , SearchMediaTypes : closure_12 } = SearchAutocompleteSelectAnalyticsActions ) ;
( { PLATFORM_REGEX_ICON_PAIRS : closure_13 , SEARCH_TEXT_INPUT_DEBOUNCE_TIME } = SEARCH_TEXT_INPUT_DEBOUNCE_TIME ) ;
( { MessageFlags : closure_14 , SearchModes : closure_15 , SearchTypes : closure_16 } = ME ) ;
let obj = {
performKeyboardAwareNavigation ,
delayUntilNavigationComplete ,
getUrlIcon ,
getGridItemBorderStyles ,
getMediaGridItemStyles ,
getGridItemSpacingStyles ,
toSearchBarTag ,
fetchInitialMessages ,
fetchInitialMessagesDebounced : require ( "apply" ) . debounce ( fetchInitialMessages , SEARCH_TEXT_INPUT_DEBOUNCE_TIME ) ,
fetchNextMessages ( searchContext , tab , onFetchSuccess ) {
const _require = searchContext ;
const queryString = store2 . getQueryString ( searchContext ) ;
2026-07-25 08:10:48 +00:00
let obj = _require ( 10042 ) ;
2026-07-23 10:11:24 +00:00
const searchTabFetchId = obj . getSearchTabFetchId ( searchContext , tab , queryString ) ;
const tmp3 = getInitialFetchLimit ( tab ) ;
2026-07-25 08:10:48 +00:00
const searchTabFetchId1 = _require ( 10042 ) . getSearchTabFetchId ( searchContext , tab , queryString ) ;
2026-07-23 10:11:24 +00:00
if ( ! store . getIsInitialFetchComplete ( searchTabFetchId1 ) ) {
const isFetching = store . getIsFetching ( searchTabFetchId ) ;
let flag = false ;
flag = ! store . getIsInitialFetchComplete ( searchTabFetchId ) ;
if ( ! flag ) {
flag = isFetching ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
let tabMessages = ! flag ;
if ( tabMessages ) {
obj = { searchContext } ;
const items = [ tab ] ;
obj . searchTabs = items ;
obj . searchQueryString = queryString ;
obj . getLimit = getNextFetchLimit ;
obj . getId = function getId ( closure_1 ) {
return searchContext ( outer1_2 [ 5 ] ) . getSearchTabFetchId ( searchContext , closure_1 , queryString ) ;
} ;
obj . onFetchStart = onFetchMessagesStart ;
obj . onFetchSuccess = onFetchSuccess ;
obj = { } ;
const cursor = store . getCursor ( searchTabFetchId ) ;
let tmp27 = null ;
if ( null != cursor ) {
tmp27 = cursor ;
}
obj . cursor = tmp27 ;
obj . pagination = obj ;
2026-07-25 08:10:48 +00:00
const obj3 = queryString ( 10049 ) ;
obj . trackExactTotalHits = _require ( 3804 ) . SearchResultExactCountEnabled . getSetting ( ) ;
2026-07-23 10:11:24 +00:00
obj . searchMode = constants2 . NEWEST ;
tabMessages = obj3 . fetchTabMessages ( obj ) ;
2026-07-25 08:10:48 +00:00
const SearchResultExactCountEnabled2 = _require ( 3804 ) . SearchResultExactCountEnabled ;
2026-07-23 10:11:24 +00:00
}
return tabMessages ;
} else {
let cursor1 = store . getCursor ( searchTabFetchId1 ) ;
const totalCount = store . getTotalCount ( searchTabFetchId1 ) ;
let messages = store . getMessages ( searchTabFetchId1 ) ;
if ( SearchResultExactCountEnabled . getSetting ( ) ) {
cursor1 = null != cursor1 && null != totalCount && null != messages ;
if ( cursor1 ) {
messages = messages . length ;
cursor1 = messages < totalCount ;
}
let tmp13 = cursor1 ;
} else if ( null == totalCount ) {
tmp13 = null != cursor1 ;
2026-07-20 16:05:17 +00:00
}
2026-07-25 08:10:48 +00:00
SearchResultExactCountEnabled = _require ( 3804 ) . SearchResultExactCountEnabled ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
} ,
syncAutocomplete
2026-07-20 16:05:17 +00:00
} ;
2026-07-23 10:11:24 +00:00
obj . syncAutocompleteDebounced = require ( "apply" ) . debounce ( syncAutocomplete , SEARCH_TEXT_INPUT_DEBOUNCE_TIME ) ;
2026-07-20 16:05:17 +00:00
obj . navigateToSearchWithPrefetch = function navigateToSearchWithPrefetch ( closure_8 , closure_9 ) {
2026-07-25 08:10:48 +00:00
let obj = importDefault ( 10049 ) ;
2026-07-20 16:05:17 +00:00
const result = obj . initializeAutocomplete ( closure_9 ) ;
2026-07-27 11:26:19 +00:00
const result1 = importDefault ( 11398 ) . initializeSearchQuery ( closure_9 ) ;
2026-07-20 16:05:17 +00:00
fetchInitialMessages ( closure_9 ) ;
obj = { searchContext : closure_9 } ;
closure_8 . navigate ( "search" , obj ) ;
} ;
obj . subscribeSearchQueryState = subscribeSearchQueryState ;
2026-07-23 10:11:24 +00:00
obj . subscribeTextInputValue = function subscribeTextInputValue ( closure_0 , debounceResult , arg2 ) {
closure_0 = debounceResult ;
return subscribeSearchQueryState ( closure_0 , ( getTextInputValue ) = > ( { textInputValue : getTextInputValue.getTextInputValue ( ) , textInputChangedFromInput : getTextInputValue.getTextValueChangedFromInput ( ) } ) , ( textInputValue , textInputValue2 ) = > {
2026-07-20 16:05:17 +00:00
textInputValue = undefined ;
if ( null != textInputValue2 ) {
textInputValue = textInputValue2 . textInputValue ;
}
2026-07-23 10:11:24 +00:00
closure_0 ( textInputValue . textInputValue , textInputValue , textInputValue . textInputChangedFromInput ) ;
2026-07-20 16:05:17 +00:00
} , arg2 ) ;
} ;
2026-07-23 10:11:24 +00:00
let result = require ( "SearchAutocompleteSelectAnalyticsActions" ) . fileFinishedImporting ( "modules/search/native/SearchPlatformUtils.tsx" ) ;
2026-07-20 16:05:17 +00:00
export default obj ;
2026-07-23 10:11:24 +00:00
export const getMedia = function getMedia ( items , items1 ) {
2026-07-20 16:05:17 +00:00
let tmp ;
2026-07-25 08:10:48 +00:00
const guildIdFromSearchContext = require ( 10042 ) /* _createForOfIteratorHelperLoose */ . getGuildIdFromSearchContext ( items ) ;
2026-07-20 16:05:17 +00:00
if ( null != guildIdFromSearchContext ) {
tmp = guildIdFromSearchContext ;
}
2026-07-23 10:11:24 +00:00
require = tmp ;
items = [ ] ;
let item = items1 . forEach ( ( getContentMessage ) = > {
2026-07-20 16:05:17 +00:00
let done ;
2026-07-23 10:11:24 +00:00
let items = 0 ;
2026-07-20 16:05:17 +00:00
const contentMessage = getContentMessage . getContentMessage ( ) ;
const attachments = contentMessage . attachments ;
if ( null != attachments ) {
const item = attachments . forEach ( ( attachment , index ) = > {
2026-07-23 10:11:24 +00:00
let obj = getContentMessage ( outer2_2 [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
if ( ! obj . isThumbnailAttachment ( attachment ) ) {
if ( obj2 . isValidImageAttachment ( attachment ) ) {
2026-07-23 10:11:24 +00:00
const obj4 = getContentMessage ( outer2_2 [ 6 ] ) ;
const result = obj4 . extractMediaFromAttachment ( attachment , getContentMessage , index , getContentMessage ) ;
2026-07-20 16:05:17 +00:00
if ( null != result ) {
2026-07-23 10:11:24 +00:00
obj = { type : outer2_12 . ATTACHMENT , attachment } ;
( { id : obj5.messageId , channel_id : obj5.channelId , author : obj5.author } = getContentMessage ) ;
2026-07-20 16:05:17 +00:00
obj . mediaIndex = arr ;
obj . sources = result ;
2026-07-23 10:11:24 +00:00
arr = arr . push ( obj ) ;
2026-07-20 16:05:17 +00:00
arr = arr + 1 ;
}
} else {
2026-07-23 10:11:24 +00:00
const obj3 = getContentMessage ( outer2_2 [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
obj2 = getContentMessage ( outer2_2 [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
}
const embeds = contentMessage . embeds ;
if ( null != embeds ) {
const item1 = embeds . forEach ( ( embed , mediaIndex ) = > {
2026-07-23 10:11:24 +00:00
let obj = getContentMessage ( outer2_2 [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
if ( obj . isValidImageEmbed ( embed ) ) {
2026-07-23 10:11:24 +00:00
const obj3 = getContentMessage ( outer2_2 [ 6 ] ) ;
const result = obj3 . extractMediaFromEmbed ( embed , getContentMessage , contentMessage , mediaIndex , getContentMessage ) ;
2026-07-20 16:05:17 +00:00
if ( null != result ) {
2026-07-23 10:11:24 +00:00
obj = { type : outer2_12 . EMBED , embed } ;
( { id : obj4.messageId , channel_id : obj4.channelId , author : obj4.author } = getContentMessage ) ;
2026-07-20 16:05:17 +00:00
obj . mediaIndex = arr ;
obj . sources = result ;
2026-07-23 10:11:24 +00:00
arr = arr . push ( obj ) ;
2026-07-20 16:05:17 +00:00
arr = arr + 1 ;
}
} else {
2026-07-23 10:11:24 +00:00
const obj2 = getContentMessage ( outer2_2 [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
}
2026-07-23 10:11:24 +00:00
let obj = tmp ( outer1_2 [ 6 ] ) ;
const tmp4 = outer1_17 ( obj . extractMediaFromMessageComponents ( getContentMessage , contentMessage , getContentMessage ) ) ;
2026-07-20 16:05:17 +00:00
let iter = tmp4 ( ) ;
if ( ! iter . done ) {
do {
let value = iter . value ;
2026-07-23 10:11:24 +00:00
let tmp5 = items ;
2026-07-20 16:05:17 +00:00
obj = { } ;
2026-07-23 10:11:24 +00:00
let tmp6 = outer1_12 ;
obj . type = outer1_12 . COMPONENT ;
2026-07-20 16:05:17 +00:00
obj . messageId = getContentMessage . id ;
obj . channelId = getContentMessage . channel_id ;
obj . author = getContentMessage . author ;
2026-07-23 10:11:24 +00:00
let tmp7 = items ;
obj . mediaIndex = items ;
2026-07-20 16:05:17 +00:00
obj . sources = value . sources ;
obj . unfurledMediaItem = value . unfurledMediaItem ;
2026-07-23 10:11:24 +00:00
let arr = items . push ( obj ) ;
let tmp9 = items ;
items = items + 1 ;
2026-07-20 16:05:17 +00:00
let iter2 = tmp4 ( ) ;
iter = iter2 ;
done = iter2 . done ;
} while ( ! done ) ;
}
2026-07-23 10:11:24 +00:00
if ( obj3 . hasFlag ( contentMessage . flags , outer1_14 . IS_VOICE_MESSAGE ) ) {
obj = { type : outer1_12 . AUDIO } ;
2026-07-20 16:05:17 +00:00
( { id : obj4.messageId , channel_id : obj4.channelId , author : obj4.author } = getContentMessage ) ;
2026-07-23 10:11:24 +00:00
obj . mediaIndex = items ;
items . push ( obj ) ;
items = items + 1 ;
2026-07-20 16:05:17 +00:00
}
} ) ;
return items ;
} ;
export const getFiles = function getFiles ( id ) {
2026-07-23 10:11:24 +00:00
let closure_0 = id ;
2026-07-20 16:05:17 +00:00
const items = [ ] ;
const contentMessage = id . getContentMessage ( ) ;
const attachments = contentMessage . attachments ;
if ( null != attachments ) {
const item = attachments . forEach ( ( attachment , fileIndex ) = > {
2026-07-23 10:11:24 +00:00
let obj = id ( contentMessage [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
if ( ! obj . isValidImageAttachment ( attachment ) ) {
if ( ! obj2 . isValidVideoAttachment ( attachment ) ) {
const push = items . push ;
obj = { } ;
2026-07-23 10:11:24 +00:00
if ( obj3 . hasFlag ( contentMessage . flags , outer1_14 . IS_VOICE_MESSAGE ) ) {
2026-07-20 16:05:17 +00:00
obj . type = tmp8 . AUDIO ;
2026-07-23 10:11:24 +00:00
( { id : obj4.messageId , channel_id : obj4.channelId , author : obj4.author } = id ) ;
2026-07-20 16:05:17 +00:00
obj . fileIndex = fileIndex ;
obj . attachment = attachment ;
push ( obj ) ;
} else {
obj . type = tmp8 . ATTACHMENT ;
2026-07-23 10:11:24 +00:00
( { id : obj4.messageId , channel_id : obj4.channelId , author : obj4.author } = id ) ;
2026-07-20 16:05:17 +00:00
obj . fileIndex = fileIndex ;
obj . attachment = attachment ;
push ( obj ) ;
}
2026-07-23 10:11:24 +00:00
obj3 = id ( contentMessage [ 7 ] ) ;
2026-07-20 16:05:17 +00:00
}
}
2026-07-23 10:11:24 +00:00
obj = { type : outer1_10 . MEDIA_ATTACHMENT , messageId : id.id , channelId : id.channel_id , author : id.author , fileIndex , attachment } ;
2026-07-20 16:05:17 +00:00
items . push ( obj ) ;
} ) ;
}
return items ;
} ;
export const getLinks = function getLinks ( items , getContentMessage ) {
2026-07-23 10:11:24 +00:00
const _require = getContentMessage ;
2026-07-20 16:05:17 +00:00
let tmp ;
2026-07-23 10:11:24 +00:00
let obj = _require ( items [ 5 ] ) ;
2026-07-20 16:05:17 +00:00
const guildIdFromSearchContext = obj . getGuildIdFromSearchContext ( items ) ;
if ( null != guildIdFromSearchContext ) {
tmp = guildIdFromSearchContext ;
}
const importDefault = tmp ;
items = [ ] ;
const contentMessage = getContentMessage . getContentMessage ( ) ;
2026-07-23 10:11:24 +00:00
let c4 = 0 ;
2026-07-20 16:05:17 +00:00
const embeds = contentMessage . embeds ;
if ( null != embeds ) {
const item = embeds . forEach ( ( embed , mediaIndex ) = > {
2026-07-23 10:11:24 +00:00
let obj = getContentMessage ( items [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
if ( obj . isValidImageEmbed ( embed ) ) {
2026-07-23 10:11:24 +00:00
const obj3 = getContentMessage ( items [ 6 ] ) ;
const result = obj3 . extractMediaFromEmbed ( embed , getContentMessage , contentMessage , mediaIndex , closure_1 ) ;
2026-07-20 16:05:17 +00:00
if ( null != result ) {
2026-07-23 10:11:24 +00:00
obj = { type : outer1_11 . EMBED } ;
( { id : obj4.messageId , channel_id : obj4.channelId , author : obj4.author } = getContentMessage ) ;
2026-07-20 16:05:17 +00:00
obj . linkIndex = closure_4 ;
obj . sources = result ;
obj . embed = embed ;
items . push ( obj ) ;
closure_4 = closure_4 + 1 ;
}
} else {
2026-07-23 10:11:24 +00:00
const obj2 = getContentMessage ( items [ 6 ] ) ;
2026-07-20 16:05:17 +00:00
}
} ) ;
}
if ( 0 === items . length ) {
obj = { type : constants . TEXT } ;
( { id : obj2.messageId , channel_id : obj2.channelId , author : obj2.author } = getContentMessage ) ;
obj . linkIndex = 0 ;
items . push ( obj ) ;
}
return items ;
} ;
export { performKeyboardAwareNavigation } ;
export { delayUntilNavigationComplete } ;
export { getUrlIcon } ;
export { getGridItemBorderStyles } ;
export { getMediaGridItemStyles } ;
export { getGridItemSpacingStyles } ;
export { toSearchBarTag } ;