This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,34 @@
// Metro module 15555 (f15556).
import { useCallback, useEffect } from "react";
import { SEARCH_TEXT_INPUT_DEBOUNCE_TIME } from "../SearchPlatformConstants";
import { getGuildIdFromSearchContext } from "../../SearchUtils";
import SearchPlatformActionCreators from "../SearchPlatformActionCreators";
import { debounce } from "../../../../_bundle/Module12";
import SearchPlatformUtils from "../SearchPlatformUtils";
export function useAutoSearchGuildChannelTab(a0, a1) {
const searchContext = a0;
const callback = useCallback((a0) => {
const guildIdFromSearchContext = getGuildIdFromSearchContext(searchContext);
if (guildIdFromSearchContext != null) {
SearchPlatformActionCreators.searchGuildChannelTab({
searchContext,
searchQueryString: a0,
guildId: guildIdFromSearchContext
});
}
}, [a0]);
useEffect(() => {
if (!a1) {
callback("");
}
}, [a1, callback]);
useEffect(() => {
if (a1) {
return void 0;
}
return SearchPlatformUtils.subscribeTextInputValue(searchContext, debounce(callback, SEARCH_TEXT_INPUT_DEBOUNCE_TIME), true);
}, [a0, a1, callback]);
useEffect(() => () => {
SearchPlatformActionCreators.cleanupGuildChannelTab(searchContext);
}, [a0]);
}
@@ -0,0 +1,36 @@
// Metro module 15556 (f15557).
import { useEffect } from "react";
import SearchQueryStore from "../stores/SearchQueryStore";
import { SEARCH_TEXT_INPUT_DEBOUNCE_TIME } from "../SearchPlatformConstants";
import { SearchTypes } from "../../../../Constants";
import { debounce } from "../../../../_bundle/Module12";
import { getGuildIdFromSearchContext } from "../../SearchUtils";
import SearchPlatformActionCreators from "../SearchPlatformActionCreators";
import SearchPlatformUtils from "../SearchPlatformUtils";
export function useAutoSearchMembersTab(a0, a1) {
const searchContext = a0;
useEffect(() => {
if (a1) {
return void 0;
}
return SearchPlatformUtils.subscribeTextInputValue(searchContext, debounce((a0) => {
if (!SearchQueryStore.isAutocompleteVisible(searchContext)) {
const guildIdFromSearchContext = getGuildIdFromSearchContext(searchContext);
if (guildIdFromSearchContext != null) {
const channelIds = SearchQueryStore.getChannelIds(searchContext);
const channelId = channelIds.size !== 0 ? channelIds.size === 1 ? Array.from(channelIds)[0] : null : null;
SearchPlatformActionCreators.searchGuildMemberTab({
searchContext,
searchQueryString: a0,
guildId: guildIdFromSearchContext,
channelId,
threadId: searchContext.type === SearchTypes.THREAD ? channelId : null
});
}
}
}, SEARCH_TEXT_INPUT_DEBOUNCE_TIME));
}, [a1, a0]);
useEffect(() => () => {
SearchPlatformActionCreators.cleanupGuildMemberTab(searchContext);
}, [a0]);
}
@@ -0,0 +1,30 @@
// Metro module 15557 (f15558).
import { useEffect } from "react";
import SearchQueryStore from "../stores/SearchQueryStore";
import { SEARCH_TEXT_INPUT_DEBOUNCE_TIME } from "../SearchPlatformConstants";
import { fetchUserAffinitiesV2 } from "../../../user_affinities/UserAffinitiesActionCreators";
import SearchPlatformActionCreators from "../SearchPlatformActionCreators";
import { debounce } from "../../../../_bundle/Module12";
import SearchPlatformUtils from "../SearchPlatformUtils";
export function useAutoSearchPeopleTab(a0, a1) {
let c22182_0 = a0;
useEffect(() => {
if (!a1) {
fetchUserAffinitiesV2();
SearchPlatformActionCreators.searchPeopleTab(c22182_0, "");
}
}, [a1, a0]);
useEffect(() => {
if (a1) {
return void 0;
}
return SearchPlatformUtils.subscribeTextInputValue(c22182_0, debounce((a0) => {
if (!SearchQueryStore.isAutocompleteVisible(c22182_0)) {
SearchPlatformActionCreators.searchPeopleTab(c22182_0, a0);
}
}, SEARCH_TEXT_INPUT_DEBOUNCE_TIME));
}, [a0, a1]);
useEffect(() => () => {
SearchPlatformActionCreators.cleanupPeopleTab(c22182_0);
}, [a0]);
}
@@ -0,0 +1,47 @@
// Metro module 15558 (f15559).
import { useRef, useEffect } from "react";
import { SearchTabs } from "../../SearchConstants";
import Tracking from "../tracking/Tracking";
export function useAutoTrackSearchTabCountsViewedAnalytics({ searchContext, visibleTabCounts, visibleTabs }) {
const ref = useRef(visibleTabs);
useEffect(() => {
ref.current = visibleTabs;
}, [visibleTabs]);
useEffect(() => {
if (visibleTabCounts != null) {
const searchResultTotalCount = Object.keys(visibleTabCounts).reduce((acc, item) => {
let r4 = visibleTabCounts == null ? null : ref.current.includes(item) ? visibleTabCounts[item] : null;
if (r4 == null) {
r4 = 0;
}
return acc + r4;
}, 0);
if (searchResultTotalCount > 0) {
const MEMBERS = SearchTabs.MEMBERS;
const numMemberTabReturnedResults = visibleTabCounts == null ? null : ref.current.includes(MEMBERS) ? visibleTabCounts[MEMBERS] : null;
const GUILD_CHANNELS = SearchTabs.GUILD_CHANNELS;
const numChannelTabReturnedResults = visibleTabCounts == null ? null : ref.current.includes(GUILD_CHANNELS) ? visibleTabCounts[GUILD_CHANNELS] : null;
const PEOPLE = SearchTabs.PEOPLE;
const numPeopleTabReturnedResults = visibleTabCounts == null ? null : ref.current.includes(PEOPLE) ? visibleTabCounts[PEOPLE] : null;
const MESSAGES = SearchTabs.MESSAGES;
const numMessageTabReturnedResults = visibleTabCounts == null ? null : ref.current.includes(MESSAGES) ? visibleTabCounts[MESSAGES] : null;
const MEDIA = SearchTabs.MEDIA;
const numMediaTabReturnedResults = visibleTabCounts == null ? null : ref.current.includes(MEDIA) ? visibleTabCounts[MEDIA] : null;
const FILES = SearchTabs.FILES;
const numFileTabReturnedResults = visibleTabCounts == null ? null : ref.current.includes(FILES) ? visibleTabCounts[FILES] : null;
const LINKS = SearchTabs.LINKS;
Tracking.trackSearchResultReturned({
searchContext,
searchResultTotalCount,
numMemberTabReturnedResults,
numChannelTabReturnedResults,
numPeopleTabReturnedResults,
numMessageTabReturnedResults,
numMediaTabReturnedResults,
numFileTabReturnedResults,
numLinkTabReturnedResults: visibleTabCounts == null ? null : ref.current.includes(LINKS) ? visibleTabCounts[LINKS] : null
});
}
}
}, [searchContext, visibleTabCounts]);
}
@@ -0,0 +1,11 @@
// Metro module 15536 (f15537).
import { useMemo } from "react";
import { FILES_OR_LINKS_GAP_WIDTH, FILES_OR_LINKS_NUM_COLUMNS, FILE_OR_LINK_IMAGE_RATIO, SEARCH_LIST_HORIZONTAL_PADDING } from "../../SearchConstants";
export function useFileOrLinkImageDimensions(a0) {
const width = (a0 - 2 * SEARCH_LIST_HORIZONTAL_PADDING - (FILES_OR_LINKS_NUM_COLUMNS - 1) * FILES_OR_LINKS_GAP_WIDTH) / FILES_OR_LINKS_NUM_COLUMNS - 2;
const height = width * FILE_OR_LINK_IMAGE_RATIO;
return useMemo(() => ({
width,
height
}), [height, width]);
}
@@ -0,0 +1,428 @@
// Metro module 15480 (f15481).
import { useCallback, useContext } from "react";
import ChannelStore from "../../../../stores/ChannelStore";
import SearchQueryStore from "../stores/SearchQueryStore";
import { SearchHistoryItemTypes, SearchMediaTypes, SearchQueryTagTypes } from "../../SearchConstants";
import { SearchNavigatorScreens } from "../components/navigator/SearchNavigatorConstants";
import { SearchFilterAddLocations } from "../tracking/TrackingConstants";
import { SearchTypes, ME, Routes } from "../../../../Constants";
import { StaticChannelRoute } from "../../../channel/ChannelConstants";
import SearchPlatformUtils, { delayUntilNavigationComplete, performKeyboardAwareNavigation } from "../SearchPlatformUtils";
import SearchPlatformActionCreators from "../SearchPlatformActionCreators";
import URLUtils from "../../../../utils/URLUtils";
import { presentFailedToast } from "../../../toast/native/ToastUtils";
import { intl, t } from "../../../../intl/index.native";
import { handleClick } from "../../../../utils/MaskedLinkUtils";
import Linking from "../../../../lib/native/Linking";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { SwipeForMemberListContext } from "../../../main_tabs_v2/native/channel/SwipeForMemberListWrapper";
import MessagePreviewActionCreators from "../../../../actions/native/MessagePreviewActionCreators";
import { openMediaModal } from "../../../media_viewer/native/components/openMediaModal";
import ChannelActionCreators from "../../../../actions/ChannelActionCreators";
import { transitionToChannel } from "../../../routing/transitionToChannel";
import "../../../../_bundle/asyncRequire";
import { maybeOpenAgeGateForVoiceChannel } from "../../../age_gate/AgeGateUtils";
import { maybeOpenSpoilerGateForVoiceChannel } from "../../../spoiler_channels/maybeOpenSpoilerGateForVoiceChannel.native";
import { getChannelRoleSubscriptionStatus } from "../../../guild_role_subscriptions/useChannelRoleSubscriptionStatus";
import { shouldShowMembershipVerificationGate } from "../../../guild_member_verification/hooks/useShowMemberVerificationGate";
import { transitionTo } from "../../../routing/router_utils";
import Tracking from "../tracking/Tracking";
function $mk96657($env) {
return () => {
const r1 = $env;
const r2 = $env.$parent;
return (0, r2[1])(r2[2][10]).addSearchHistoryItem(r1[0], r1[1]);
};
}
function $mk96658($env) {
return () => {
const r5 = $env;
const r1 = $env.$parent;
(0, r1[0])(r1[2][19]).ComponentDispatch.dispatch(r1[13].HIDE_CHANNEL_DETAILS, {
channelId: r5[0].id,
screenIndex: r5[1].screenIndex
});
};
}
function $mk118936($env) {
return () => (0, handleVoiceOrStageChannelConnectPress)($env[0]);
}
let env11014 = {};
export async function handleVoiceOrStageChannelConnectPress(c28040_0) {
let c30882_0 = c28040_0;
if (c28040_0.isGuildStageVoice()) {
(0, (await import("../../../stage_channels/StageChannelModalActionCreators")).connectAndOpen)(c30882_0);
} else {
(0, (await import("../../../../utils/native/PrivateChannelCallUtils")).openGuildVoiceModal)(c30882_0, "Channel List");
}
}
export function useOnPressSearchLink(a0) {
let c22057_0 = a0;
return useCallback((a0, c28041_0) => {
let c28041_1;
let env28042;
const r3 = env11014;
const tags = SearchQueryStore.getTags(c22057_0);
const r18 = {
type: SearchHistoryItemTypes.TEXT,
text: SearchQueryStore.getTextInputValue(c22057_0),
tags
};
const r19 = env28042 = {
$parent: r3
};
env28042[0] = c22057_0;
env28042[1] = r18;
const type = c22057_0.type;
if (!(SearchTypes.DMS !== type && SearchTypes.GUILD !== type)) {
delayUntilNavigationComplete($mk96657(r19));
}
const r38 = URLUtils.safeParseWithQuery(a0);
if (r38 != null && (r38.protocol != null && r38.hostname != null)) {
const href = URLUtils.format(r38);
c28041_1 = href;
handleClick({
href,
onConfirm: () => Linking.openURL(c28041_1),
trusted: () => c28041_0
});
} else {
presentFailedToast(intl.string(t.XiqzAp));
}
}, [a0]);
}
export function useOnPressMessageItem({ searchContext }) {
const navigation = useNavigation();
const context = useContext(SwipeForMemberListContext);
return useCallback((a0, a1) => {
const r3 = env11014;
const channel = ChannelStore.getChannel(a0);
if (channel != null) {
let env28044;
const tags = SearchQueryStore.getTags(searchContext);
const r16 = {
type: SearchHistoryItemTypes.TEXT,
text: SearchQueryStore.getTextInputValue(searchContext),
tags
};
const r17 = env28044 = {
$parent: r3
};
env28044[0] = searchContext;
env28044[1] = r16;
const type = searchContext.type;
if (!(SearchTypes.DMS !== type && SearchTypes.GUILD !== type)) {
delayUntilNavigationComplete($mk96657(r17));
}
MessagePreviewActionCreators.fetchMessages(a0, a1);
performKeyboardAwareNavigation(() => {
let env30883;
const r5 = env30883 = {
$parent: env11014
};
env30883[0] = channel;
env30883[1] = context;
let guildId = channel.getGuildId();
if (guildId == null) {
guildId = ME;
}
const r6 = {
channelId: channel.id,
guildId,
searchContext
};
if (context != null) {
navigation.navigate("sidebar", {
screen: SearchNavigatorScreens.SEARCH_CHAT_PREVIEW,
params: {
...r6,
onBeforeJumpToMessage: $mk96658(r5)
}
});
} else {
navigation.navigate(SearchNavigatorScreens.SEARCH_CHAT_PREVIEW, r6);
}
});
}
}, [navigation, searchContext, context]);
}
export function useOnPressMediaItem({ searchContext: searchContext2, allMediaResults, onEndReached, onEndReachedThreshold }) {
const navigation2 = useNavigation();
const context2 = useContext(SwipeForMemberListContext);
return useCallback((a0, a1) => {
let channel2, c28045_2, initialIndex, c28045_4;
let env28046;
const r4 = env11014;
const tags = SearchQueryStore.getTags(searchContext2);
const r14 = {
type: SearchHistoryItemTypes.TEXT,
text: SearchQueryStore.getTextInputValue(searchContext2),
tags
};
const r15 = env28046 = {
$parent: r4
};
env28046[0] = searchContext2;
env28046[1] = r14;
const type = searchContext2.type;
if (!(SearchTypes.DMS !== type && SearchTypes.GUILD !== type)) {
delayUntilNavigationComplete($mk96657(r15));
}
const type2 = a0.type;
if (SearchMediaTypes.AUDIO === type2) {
channel2 = ChannelStore.getChannel(a0.channelId);
if (channel2 == null) {
return void 0;
}
MessagePreviewActionCreators.fetchMessages(a0.channelId, a0.messageId);
performKeyboardAwareNavigation(() => {
let env30884;
const r5 = env30884 = {
$parent: env11014
};
env30884[0] = channel2;
env30884[1] = context2;
let guildId = channel2.getGuildId();
if (guildId == null) {
guildId = ME;
}
const r6 = {
channelId: channel2.id,
guildId,
searchContext: searchContext2
};
if (context2 != null) {
navigation2.navigate("sidebar", {
screen: SearchNavigatorScreens.SEARCH_CHAT_PREVIEW,
params: {
...r6,
onBeforeJumpToMessage: $mk96658(r5)
}
});
} else {
navigation2.navigate(SearchNavigatorScreens.SEARCH_CHAT_PREVIEW, r6);
}
});
return void 0;
}
if (!(SearchMediaTypes.ATTACHMENT !== type2 && (SearchMediaTypes.EMBED !== type2 && SearchMediaTypes.COMPONENT !== type2))) {
c28045_2 = 0;
initialIndex = 0;
const initialSources = [];
c28045_4 = initialSources;
allMediaResults.forEach((allMediaResult) => {
if (!(allMediaResult.type !== SearchMediaTypes.ATTACHMENT && allMediaResult.type !== SearchMediaTypes.EMBED && allMediaResult.type !== SearchMediaTypes.COMPONENT)) {
c28045_4.push(allMediaResult.sources);
const messageId = allMediaResult.messageId;
if (messageId === a0.messageId && allMediaResult.mediaIndex === a0.mediaIndex) {
initialIndex = c28045_2;
}
c28045_2 = c28045_2 + 1;
}
});
openMediaModal({
initialSources,
initialIndex,
onEndReached,
onEndReachedThreshold,
analyticsSource: "Search",
originViewOrOriginLayout: a1
});
}
}, [searchContext2, navigation2, context2, allMediaResults, onEndReached, onEndReachedThreshold]);
}
export function useOnPressGroupDMItem({ searchContext: searchContext3 }) {
const navigation3 = useNavigation();
return useCallback((a0) => {
let env28048;
const r3 = env11014;
const r6 = {
type: SearchHistoryItemTypes.GROUP_DM,
channelId: a0
};
const r10 = env28048 = {
$parent: r3
};
env28048[0] = searchContext3;
env28048[1] = r6;
const type = searchContext3.type;
if (!(SearchTypes.DMS !== type && SearchTypes.GUILD !== type)) {
delayUntilNavigationComplete($mk96657(r10));
}
const parent = navigation3.getParent();
if (parent != null) {
parent.goBack();
}
ChannelActionCreators.preload(ME, a0);
performKeyboardAwareNavigation(() => {
transitionToChannel(a0);
});
}, [navigation3, searchContext3]);
}
export function useOnPressDMItem({ searchContext: searchContext4 }) {
const navigation4 = useNavigation();
return useCallback((a0, a1) => {
let env28050;
const r4 = env11014;
const r7 = {
type: SearchHistoryItemTypes.DM,
userId: a0
};
const r11 = env28050 = {
$parent: r4
};
env28050[0] = searchContext4;
env28050[1] = r7;
const type = searchContext4.type;
if (!(SearchTypes.DMS !== type && SearchTypes.GUILD !== type)) {
delayUntilNavigationComplete($mk96657(r11));
}
const parent = navigation4.getParent();
if (parent != null) {
parent.goBack();
}
ChannelActionCreators.preload(ME, a1);
performKeyboardAwareNavigation(() => {
transitionToChannel(a1);
});
return a1;
}, [navigation4, searchContext4]);
}
export function useOnPressGuildTextChannel({ searchContext: searchContext5 }) {
return useCallback((a0) => {
const r4 = env11014;
const channel3 = ChannelStore.getChannel(a0);
if (channel3 == null) {
return null;
}
let env28052;
const r7 = {
type: SearchHistoryItemTypes.GUILD_TEXT_CHANNEL,
channelId: channel3.id
};
const r15 = env28052 = {
$parent: r4
};
env28052[0] = searchContext5;
env28052[1] = r7;
const type = searchContext5.type;
if (!(SearchTypes.DMS !== type && SearchTypes.GUILD !== type)) {
delayUntilNavigationComplete($mk96657(r15));
}
ChannelActionCreators.preload(channel3.guild_id, channel3.id);
performKeyboardAwareNavigation(() => transitionToChannel(channel3.id));
}, [searchContext5]);
}
export function useOnPressGuildVoiceChannel({ searchContext: searchContext6 }) {
let callback;
callback = void 0;
const navigation5 = useNavigation();
let c22064_0 = async (c31764_0) => {
let r12, r84, r87;
let c31764_1;
L22: {
L21: {
L16: {
let env32072;
const r14 = env32072 = {
$parent: env11014
};
c31764_1 = r14;
env32072[0] = c31764_0;
env32072[1] = void 0;
if (maybeOpenAgeGateForVoiceChannel(c31764_0.id)) {
break L22;
}
if (maybeOpenSpoilerGateForVoiceChannel(c31764_0.id)) {
break L22;
}
const needSubscriptionToAccess = getChannelRoleSubscriptionStatus(c31764_0.id).needSubscriptionToAccess;
const guildId = c31764_0.getGuildId();
env32072[1] = guildId;
if (guildId != null && shouldShowMembershipVerificationGate(guildId)) {
r12 = (0, (await import("../../../guild_member_verification/MemberVerificationModalActionCreators")).openMemberVerificationModal)(env32072[1], $mk118936(c31764_1));
break L16;
}
if (needSubscriptionToAccess) {
r84 = transitionTo(Routes.CHANNEL(c31764_0.guild_id, StaticChannelRoute.ROLE_SUBSCRIPTIONS));
} else {
handleVoiceOrStageChannelConnectPress(c31764_0);
r84 = void 0;
}
r87 = r84;
break L21;
}
return r12;
}
return r87;
}
};
callback = useCallback(function() {
return c22064_0.apply(this, arguments);
}, []);
return useCallback((a0) => {
const r3 = env11014;
const channel4 = ChannelStore.getChannel(a0);
if (channel4 == null) {
return null;
}
let env28054;
const r7 = {
type: SearchHistoryItemTypes.GUILD_VOICE_CHANNEL,
channelId: channel4.id
};
const r14 = env28054 = {
$parent: r3
};
env28054[0] = searchContext6;
env28054[1] = r7;
const type = searchContext6.type;
if (!(SearchTypes.DMS !== type && SearchTypes.GUILD !== type)) {
delayUntilNavigationComplete($mk96657(r14));
}
const parent = navigation5.getParent();
if (parent != null) {
parent.goBack();
}
performKeyboardAwareNavigation(() => callback(channel4));
}, [navigation5, callback, searchContext6]);
}
export function useOnPressSearchHistoryText({ searchContext: searchContext7 }) {
return useCallback((a0, a1) => {
let env28056;
let c28055_0 = a0;
const r3 = env11014;
const r8 = {
type: SearchHistoryItemTypes.TEXT,
text: a0,
tags: a1
};
const r12 = env28056 = {
$parent: r3
};
env28056[0] = searchContext7;
env28056[1] = r8;
const type = searchContext7.type;
if (!(SearchTypes.DMS !== type && SearchTypes.GUILD !== type)) {
delayUntilNavigationComplete($mk96657(r12));
}
SearchPlatformActionCreators.updateSearchQuery(searchContext7, (a0) => {
if (a1 != null) {
a0.setTags(a1);
}
a0.setTextInputValue(c28055_0);
});
SearchPlatformUtils.fetchInitialMessages(searchContext7);
if (a1 != null) {
a1.forEach((item) => {
if (item.type === SearchQueryTagTypes.COMPLETE) {
Tracking.trackSearchFilterAdd({
searchContext: searchContext7,
searchTokenType: item.searchTokenType,
location: SearchFilterAddLocations.SEARCH_HISTORY
});
}
});
}
}, [searchContext7]);
}
@@ -0,0 +1,59 @@
// Metro module 15484 (f15485).
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import { FADE_LAYOUT_ANIMATION_DURATION } from "../../SearchConstants";
import useWindowDimensions_native from "../../../screen/useWindowDimensions.native";
import { useStateFromStores } from "../../../../_bundle/Module589";
import * as _ReanimatedRexport from "../../../reanimated/ReanimatedRexport";
import { useAnimatedStyle } from "../../../reanimated/ReanimatedRexport";
import * as _timing from "../../../../design/animation/reanimated/timing/timing";
import * as _native from "../../../../design/void/native";
const __initData = {
code: "function usePlaceholderStylesTsx1(){const{useReducedMotion,visible,withRepeat,withSequence,withTiming,STANDARD_EASING,FADE_LAYOUT_ANIMATION_DURATION}=this.__closure;if(useReducedMotion){return{opacity:visible?1:0};}if(visible){return{opacity:withRepeat(withSequence(withTiming(0.5,{duration:0}),withTiming(1,{duration:1300,easing:STANDARD_EASING}),withTiming(0.5,{duration:1300,easing:STANDARD_EASING})),-1)};}return{opacity:withTiming(0,{duration:FADE_LAYOUT_ANIMATION_DURATION})};}"
};
export function useFullscreenPlaceholderCount({ placeholderHeight, numColumns }) {
return Math.ceil(useWindowDimensions_native({
ignoreKeyboard: true
}).height / placeholderHeight) * numColumns;
}
export function usePlaceholderAnimatedStyle(a0) {
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const A = function A() {
let r21;
const r4 = {
opacity: null
};
if (stateFromStores) {
r4.opacity = a0 ? 1 : 0;
r21 = r4;
} else if (a0) {
r4.opacity = _ReanimatedRexport.withRepeat(_ReanimatedRexport.withSequence(_timing.withTiming(0.5, {
duration: 0
}), _timing.withTiming(1, {
duration: 1300,
easing: _native.STANDARD_EASING
}), _timing.withTiming(0.5, {
duration: 1300,
easing: _native.STANDARD_EASING
})), -1);
r21 = r4;
} else {
r4.opacity = _timing.withTiming(0, {
duration: FADE_LAYOUT_ANIMATION_DURATION
});
r21 = r4;
}
return r21;
};
A.__closure = {
useReducedMotion: stateFromStores,
visible: a0,
withRepeat: _ReanimatedRexport.withRepeat,
withSequence: _ReanimatedRexport.withSequence,
withTiming: _timing.withTiming,
STANDARD_EASING: _native.STANDARD_EASING,
FADE_LAYOUT_ANIMATION_DURATION
};
A.__workletHash = 9750536800906;
A.__initData = __initData;
return useAnimatedStyle(A);
}
@@ -0,0 +1,76 @@
// Metro module 10100 (f10101).
import { useMemo } from "react";
import ChannelStore from "../../../../stores/ChannelStore";
import { SearchTypes } from "../../../../Constants";
import Module38 from "../../../../_bundle/Module38";
import { useStateFromStores } from "../../../../_bundle/defaultAreStatesEqual";
export function useGuildSearchContext(a0) {
const guildId = a0;
return useMemo(() => ({
type: SearchTypes.GUILD,
guildId
}), [a0]);
}
export function useGuildChannelSearchContext(a0, a1) {
const guildId2 = a0;
const channelId = a1;
return useMemo(() => ({
type: SearchTypes.GUILD_CHANNEL,
guildId: guildId2,
channelId
}), [a0, a1]);
}
export function getChannelDetailsSearchContext(a0, a1, a2) {
let r9;
if (a2) {
Module38(a1 != null, "[useChannelDetailsSearchContext] Thread must have a guild id");
r9 = {
type: SearchTypes.THREAD,
guildId: a1,
channelId: a0
};
} else {
r9 = a1 == null ? {
type: SearchTypes.CHANNEL,
channelId: a0
} : {
type: SearchTypes.GUILD_CHANNEL,
guildId: a1,
channelId: a0
};
}
return r9;
}
export function useChannelDetailsSearchContext(a0, a1) {
const channelId2 = a0;
const guildId3 = a1;
const stateFromStores = useStateFromStores([ChannelStore], () => {
const channel = ChannelStore.getChannel(channelId2);
let r8 = channel == null ? void 0 : channel.isThread();
if (r8 == null) {
r8 = false;
}
return r8;
});
return useMemo(() => {
let r10;
if (stateFromStores) {
Module38(guildId3 != null, "[useChannelDetailsSearchContext] Thread must have a guild id");
r10 = {
type: SearchTypes.THREAD,
guildId: guildId3,
channelId: channelId2
};
} else {
r10 = guildId3 == null ? {
type: SearchTypes.CHANNEL,
channelId: channelId2
} : {
type: SearchTypes.GUILD_CHANNEL,
guildId: guildId3,
channelId: channelId2
};
}
return r10;
}, [a0, a1, stateFromStores]);
}
@@ -0,0 +1,5 @@
// Metro module 15693 (f15694).
import useSafeAreaInsets_native from "../../../safe_area/useSafeAreaInsets.native";
export default function useSearchLayoutInsetTop() {
return useSafeAreaInsets_native().top + 8;
};
@@ -0,0 +1,5 @@
// Metro module 15483 (f15484).
import { MEDIA_ITEM_GAP_WIDTH, MEDIA_NUM_COLUMNS, SEARCH_LIST_HORIZONTAL_PADDING } from "../../SearchConstants";
export default function useSearchMediaSize(a0) {
return Math.floor((a0 - 2 * SEARCH_LIST_HORIZONTAL_PADDING - MEDIA_ITEM_GAP_WIDTH * (MEDIA_NUM_COLUMNS - 1)) / MEDIA_NUM_COLUMNS);
};
@@ -0,0 +1,17 @@
// Metro module 15508 (f15509).
import { useMemo } from "react";
import SnowflakeUtils from "../../../../utils/SnowflakeUtils";
import { getRelativeTimestamp } from "../../../notification_center/NotificationCenterUtils";
export function useSearchMessageTimestamp(a0, a1) {
return useMemo(() => {
let id = a0.id;
if (id == null) {
id = a1.id;
}
const r12 = SnowflakeUtils.extractTimestamp(id);
return {
timestamp: getRelativeTimestamp(r12, true),
timestampAccessibilityLabel: getRelativeTimestamp(r12, false)
};
}, [a0, a1]);
}
@@ -0,0 +1,60 @@
// Metro module 15521 (f15522).
import { useRef, useCallback } from "react";
import SearchMessageStore from "../../SearchMessageStore";
import SearchQueryStore from "../stores/SearchQueryStore";
import { SEARCH_MESSAGE_TAB_SENTINEL } from "../../SearchConstants";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { getSearchTabFetchId } from "../../SearchUtils";
import { intl, t } from "../../../../intl/index.native";
import ToastActionCreators from "../../../toast/native/ToastActionCreators";
import Module8346 from "../../../../_bundle/Module8346";
export function useMessageSearchErrorScreen({ searchContext, tab, hasListItems }) {
let content, ref;
content = void 0;
ref = void 0;
const stateFromStores = useStateFromStores([SearchQueryStore, SearchMessageStore], () => SearchMessageStore.getError(getSearchTabFetchId(searchContext, tab, SearchQueryStore.getSearchResultsQuery(searchContext))));
let r19 = stateFromStores == null ? void 0 : stateFromStores.getAnyErrorMessage();
if (r19 == null) {
r19 = intl.string(t.uvDZBZ);
}
content = r19;
ref = useRef(null);
return {
hasError: stateFromStores != null,
errorText: content,
isErrorFullscreen: stateFromStores != null && !hasListItems,
isErrorToast: stateFromStores != null && hasListItems,
showErrorToast: useCallback(() => {
if (stateFromStores !== ref.current) {
ToastActionCreators.open({
key: "SEARCH_ERROR_TOAST",
icon: Module8346,
content
});
ref.current = stateFromStores;
}
}, [stateFromStores, content])
};
}
export function useMessageTabCountsErrorText({ searchContext: searchContext2 }) {
return useStateFromStores([SearchQueryStore, SearchMessageStore], () => {
const searchTabFetchId = getSearchTabFetchId(searchContext2, SEARCH_MESSAGE_TAB_SENTINEL, SearchQueryStore.getSearchResultsQuery(searchContext2));
if (SearchMessageStore.getIsInitialFetchComplete(searchTabFetchId)) {
if (SearchMessageStore.getTotalCount(searchTabFetchId) != null) {
return null;
}
const error = SearchMessageStore.getError(searchTabFetchId);
const r2 = error == null;
let r23 = null;
if (!r2) {
let r25 = error.getAnyErrorMessage();
if (r25 == null) {
r25 = intl.string(t.uvDZBZ);
}
r23 = r25;
}
return r23;
}
return null;
});
}