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,16 @@
// Metro module 15994 (f15995).
import roundToNearestPixel from "../../utils/roundToNearestPixel";
export function getDrawerSpec(a0, a1) {
const maxHeight = a0 - a1;
return {
minHeight: roundToNearestPixel(0.65 * maxHeight),
maxHeight
};
}
getDrawerSpec.__closure = {
roundToNearestPixel
};
getDrawerSpec.__workletHash = 3647675988513;
getDrawerSpec.__initData = {
code: "function getDrawerSpec_VoicePanelControlUtilsTsx1(height,top){const{roundToNearestPixel}=this.__closure;const maxHeight=height-top;return{minHeight:roundToNearestPixel(maxHeight*0.65),maxHeight:maxHeight};}"
};
@@ -0,0 +1,190 @@
// Metro module 15883 (f15884).
import { useContext, useMemo, useCallback } from "react";
import { Pressable } from "react-native";
import ChannelRTCStore from "../../../../calls/ChannelRTCStore";
import EventBannerStore from "../../../../guild_scheduled_events/EventBannerStore";
import { isGuildScheduledEventActive } from "../../../../guild_scheduled_events/GuildScheduledEventStore";
import ChannelStore from "../../../../../stores/ChannelStore";
import { GuildScheduledEventEntityTypes } from "../../../../guild_scheduled_events/GuildScheduledEventsConstants";
import useTheme from "../../../../../hooks/useTheme";
import VoicePanelStateContext from "../../VoicePanelStateContext";
import useIsConnectedToVoiceChannel from "../../hooks/useIsConnectedToVoiceChannel";
import { useImminentUpcomingGuildEvents } from "../../../../guild_scheduled_events/useGuildScheduledEvents";
import { useStateFromStores } from "../../../../../_bundle/defaultAreStatesEqual";
import { useManageResourcePermissions } from "../../../../permissions/useManageResourcePermissions";
import { getNextRecurrenceIdInEvent, getEventTimeData } from "../../../../guild_scheduled_events/utils/ScheduleUtils";
import useGuildScheduledEventUserCount from "../../../../guild_scheduled_events/useGuildScheduledEventUserCount";
import ActionSheetActionCreators from "../../../../action_sheet/native/ActionSheetActionCreators";
import { openStartGuildEventModal } from "../../../../guild_scheduled_events/native/GuildScheduledEventModalActionCreators";
import { dismissEventBanner } from "../../../../guild_scheduled_events/GuildScheduledEventsNoticesActionCreators";
import { getGuildScheduledEventHeaderProps } from "../../../../guild_scheduled_events/native/GuildScheduledEventHeaderUtils";
import { RowButton } from "../../../../../design/components/TableRow/native/RowButton.native";
import { CalendarIcon } from "../../../../../design/components/Icon/native/redesign/generated/CalendarIcon";
import { intl, t } from "../../../../../intl/index.native";
import { XSmallIcon } from "../../../../../design/components/Icon/native/redesign/generated/XSmallIcon";
import { useInviteMembersCallback } from "../../hooks/useInviteMembersCallback";
import { GroupPlusIcon } from "../../../../../design/components/Icon/native/redesign/generated/GroupPlusIcon";
import useChannelFloatingCTAContent from "../../../../video_calls/native/useChannelFloatingCTAContent";
import { useGetDismissibleContent } from "../../../../dismissible_content/useGetDismissibleContent";
import useStateFromSharedValue from "../../../../reanimated/native/useStateFromSharedValue";
import { UNSAFE_markDismissibleContentAsDismissed } from "../../../../dismissible_content/DismissibleContentUnsafeUtils";
import { CircleErrorIcon } from "../../../../../design/components/Icon/native/redesign/generated/CircleErrorIcon";
import { DismissibleContent } from "../../../../../_bundle/Module1358";
import { showSoundboardSoundPickerActionSheet } from "../../../../soundboard/native/SoundboardActionCreators";
import { SoundboardIcon } from "../../../../../design/components/Icon/native/redesign/generated/SoundboardIcon";
import { getDeviceSpecificString } from "../../../../intl/overrides/getDeviceSpecificString";
let c11371_12, getBadConnectionCTAProps, handleSoundboardMobileFloatingCtaClose, CloseSoundboardMobileFloatingCtaIcon, getDismissableCTAProps;
const useFloatingCTAProps = function useFloatingCTAProps(a0) {
let imminentUpcomingGuildEvents, stateFromStores, c22557_2;
const stateFromSharedValue = useStateFromSharedValue(useContext(VoicePanelStateContext).showFloatingCTA);
let c22556_0 = stateFromSharedValue;
const setShowFloatingCTA = useContext(VoicePanelStateContext).setShowFloatingCTA;
let r37 = useMemo(() => c22556_0 === c11371_12.BAD_CONNECTION ? getBadConnectionCTAProps(() => setShowFloatingCTA(null)) : null, [setShowFloatingCTA, stateFromSharedValue]);
imminentUpcomingGuildEvents = void 0;
stateFromStores = void 0;
c22557_2 = void 0;
const theme = useTheme();
const isConnectedToVoiceChannel = useIsConnectedToVoiceChannel(useContext(VoicePanelStateContext).channelId);
imminentUpcomingGuildEvents = useImminentUpcomingGuildEvents(a0?.id);
stateFromStores = useStateFromStores([EventBannerStore], () => {
let r6 = imminentUpcomingGuildEvents.find((imminentUpcomingGuildEvent) => !EventBannerStore.isEventDismissed(imminentUpcomingGuildEvent.id));
if (r6 == null) {
r6 = null;
}
return r6;
}, [imminentUpcomingGuildEvents]);
const r63 = (0, useManageResourcePermissions(a0).canManageGuildEvent)(stateFromStores);
const r64 = stateFromStores != null && isGuildScheduledEventActive(stateFromStores);
let r69 = getNextRecurrenceIdInEvent(stateFromStores);
if (r69 == null) {
r69 = void 0;
}
c22557_2 = r69;
const guildScheduledEventUserCount = useGuildScheduledEventUserCount(stateFromStores?.guild_id, stateFromStores?.id, r69);
const callback = useCallback(() => {
if (stateFromStores != null) {
ActionSheetActionCreators.hideActionSheet();
openStartGuildEventModal(stateFromStores, c22557_2);
}
}, [stateFromStores, r69]);
const callback2 = useCallback(() => {
if (stateFromStores != null) {
dismissEventBanner(stateFromStores.id);
}
}, [stateFromStores]);
let r84 = void 0;
if (isConnectedToVoiceChannel) {
const r85 = stateFromStores != null;
r84 = void 0;
if (r85) {
r84 = void 0;
if (r63) {
r84 = void 0;
if (!r64) {
const { scheduled_start_time, name, entity_type } = stateFromStores;
const STAGE_INSTANCE = GuildScheduledEventEntityTypes.STAGE_INSTANCE;
r84 = {
onPress: callback,
icon: <RowButton.Icon IconComponent={CalendarIcon} variant="translucent" />,
label: name,
subLabel: `${getGuildScheduledEventHeaderProps({
eventTimeData: getEventTimeData(scheduled_start_time),
isStage: entity_type === STAGE_INSTANCE,
theme,
event: stateFromStores
}).text} • ${intl.formatToPlainString(t.NywdIj, {
count: guildScheduledEventUserCount
})}`,
trailing: <Pressable accessibilityRole="button" accessibilityLabel={intl.string(t.cpT0Cq)} onPress={callback2}>
<XSmallIcon color="interactive-icon-default" />
</Pressable>
};
}
}
}
}
let c22558_0 = a0;
const isConnectedToVoiceChannel2 = useIsConnectedToVoiceChannel(useContext(VoicePanelStateContext).channelId);
const stateFromStores3 = useStateFromStores([ChannelRTCStore], () => c22558_0?.id != null && ChannelRTCStore.getParticipants(c22558_0.id).length === 1);
const inviteMembersCallback = useInviteMembersCallback(a0?.id);
const r164 = a0 != null ? isConnectedToVoiceChannel2 ? stateFromStores3 ? {
label: intl.string(t.N4nebq),
subLabel: intl.string(t.o2XPr2),
icon: <RowButton.Icon IconComponent={GroupPlusIcon} variant="translucent" />,
onPress: inviteMembersCallback
} : void 0 : void 0 : void 0;
if (r37 == null) {
r37 = r84;
}
if (r37 == null) {
r37 = r164;
}
return r37;
};
getBadConnectionCTAProps = function getBadConnectionCTAProps(c22559_0) {
return {
label: intl.string(t.uv1tVh),
subLabel: intl.string(t["gQ14+g"]),
icon: <RowButton.Icon IconComponent={CircleErrorIcon} variant="translucent" />,
onPress: () => c22559_0 == null ? void 0 : c22559_0(),
trailing: <Pressable accessibilityRole="button" accessibilityLabel={intl.string(t.cpT0Cq)} hitSlop={4} onPress={() => {
UNSAFE_markDismissibleContentAsDismissed(DismissibleContent.VOICE_PANEL_BAD_CONNECTION_CTA);
if (c22559_0 != null) {
c22559_0();
}
}}>
<XSmallIcon color="interactive-icon-default" />
</Pressable>
};
};
handleSoundboardMobileFloatingCtaClose = function handleSoundboardMobileFloatingCtaClose() {
UNSAFE_markDismissibleContentAsDismissed(DismissibleContent.SOUNDBOARD_MOBILE_FLOATING_CTA);
};
CloseSoundboardMobileFloatingCtaIcon = function CloseSoundboardMobileFloatingCtaIcon() {
return <Pressable accessibilityRole="button" accessibilityLabel={intl.string(t.cpT0Cq)} onPress={handleSoundboardMobileFloatingCtaClose}>
<XSmallIcon color="interactive-icon-default" />
</Pressable>;
};
getDismissableCTAProps = function getDismissableCTAProps({ dismissableContent: dismissableContent2, channel }) {
if (DismissibleContent.VOICE_PANEL_BAD_CONNECTION_CTA === dismissableContent2) {
return getBadConnectionCTAProps();
}
if (DismissibleContent.SOUNDBOARD_MOBILE_FLOATING_CTA === dismissableContent2) {
return {
icon: <SoundboardIcon color="interactive-icon-default" />,
onPress: () => {
if (channel != null) {
showSoundboardSoundPickerActionSheet({
channel,
analyticsSource: "SOUNDBOARD_MOBILE_FLOATING_CTA"
});
}
UNSAFE_markDismissibleContentAsDismissed(DismissibleContent.SOUNDBOARD_MOBILE_FLOATING_CTA);
},
label: getDeviceSpecificString({
quest: t.XLlWUe
}, t.IJgkPX),
trailing: <CloseSoundboardMobileFloatingCtaIcon />
};
}
DismissibleContent.DONUT_MOBILE_NUX;
return null;
};
c11371_12 = {
BAD_CONNECTION: "BAD_CONNECTION"
};
export const FLOATING_CTA_HIDE_TIMEOUT = 5000;
export { c11371_12 as OverrideFloatingCTA };
export function useShouldShowFloatingCTA(a0) {
const [dismissableContent] = useGetDismissibleContent(useChannelFloatingCTAContent(a0));
const stateFromStores2 = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(a0));
const memo = useMemo(() => getDismissableCTAProps({
dismissableContent,
channel: stateFromStores2
}), [dismissableContent, stateFromStores2]);
const floatingCTAProps = useFloatingCTAProps(stateFromStores2);
return memo != null || floatingCTAProps != null;
}
export { useFloatingCTAProps };
export { getBadConnectionCTAProps };
export { getDismissableCTAProps };
@@ -0,0 +1,170 @@
// Metro module 11276 (f11277).
import { createContext } from "react";
import * as _PlatformUtils from "../../../../../utils/PlatformUtils";
import * as _ReanimatedRexport from "../../../../reanimated/ReanimatedRexport";
import { useAnimatedRef, useAnimatedScrollHandler, useAnimatedProps } from "../../../../reanimated/ReanimatedRexport";
let __initData, __initData2, __initData3, __initData4, __initData5;
const isAndroid = _PlatformUtils.isAndroid();
const context = createContext(() => ({}));
__initData = {
code: "function onBeginDrag_createUseAnimatedScrollLockTsx1(_,context){const{isDragScrolling}=this.__closure;context.momentumEndCount=0;isDragScrolling.set(true);}"
};
__initData2 = {
code: "function onEndDrag_createUseAnimatedScrollLockTsx2(event){const{isDragScrolling,scrollLocked}=this.__closure;var _event$velocity$y,_event$velocity;isDragScrolling.set(false);if(Math.abs((_event$velocity$y=(_event$velocity=event.velocity)===null||_event$velocity===void 0?void 0:_event$velocity.y)!==null&&_event$velocity$y!==void 0?_event$velocity$y:0)===0){scrollLocked.set(false);}}"
};
__initData3 = {
code: "function onMomentumEnd_createUseAnimatedScrollLockTsx3(event,context){const{IS_ANDROID,scrollLocked}=this.__closure;if(IS_ANDROID){var _context$momentumEndC;let count=(_context$momentumEndC=context===null||context===void 0?void 0:context.momentumEndCount)!==null&&_context$momentumEndC!==void 0?_context$momentumEndC:0;count+=1;if(count===3){scrollLocked.set(false);}else if(context!=null){context.momentumEndCount=count;}}else{scrollLocked.set(false);}}"
};
__initData4 = {
code: "function onScroll_createUseAnimatedScrollLockTsx4(event){const{isDragScrolling,IS_ANDROID,scrollTo,scrollerRef,ScrollOffsetValue,scrollLocked,onScrollHandler,runOnJS,onScrollHandlerWorkletized}=this.__closure;var _onScrollHandlerWorkl;const newScrollPosition=event.contentOffset.y;if(isDragScrolling.get()!==true){let scrollPosition=newScrollPosition;if(IS_ANDROID&&scrollPosition<0){scrollPosition=0;scrollTo(scrollerRef,0,0,false);}ScrollOffsetValue.set(scrollPosition);}else{const isUp=newScrollPosition<ScrollOffsetValue.get();if(scrollLocked.get()||isUp&&newScrollPosition<=0){if(!scrollLocked.get()){scrollLocked.set(true);}scrollTo(scrollerRef,0,0,false);ScrollOffsetValue.set(0);}else{ScrollOffsetValue.set(newScrollPosition);}}const{width:width,height:height}=event.layoutMeasurement;const{width:contentWidth,height:contentHeight}=event.contentSize;onScrollHandler!=null&&runOnJS(onScrollHandler)({width:width,height:height,offset:newScrollPosition,contentWidth:contentWidth,contentHeight:contentHeight});(_onScrollHandlerWorkl=onScrollHandlerWorkletized)===null||_onScrollHandlerWorkl===void 0||_onScrollHandlerWorkl({width:width,height:height,offset:newScrollPosition,contentWidth:contentWidth,contentHeight:contentHeight});}"
};
__initData5 = {
code: "function createUseAnimatedScrollLockTsx5(){const{scrollLocked}=this.__closure;return{showsVerticalScrollIndicator:!scrollLocked.get()};}"
};
export { context as ControlsGestureScrollLock };
export function createUseAnimatedScrollLock(gestureRef, scrollLocked, ScrollOffsetValue, isDragScrolling) {
return function(r2 = {}) {
const { onScrollHandler, onScrollHandlerWorkletized } = r2;
const animatedRef = useAnimatedRef();
const w = function w(a0, a1) {
a1.momentumEndCount = 0;
isDragScrolling.set(true);
};
w.__closure = {
isDragScrolling
};
w.__workletHash = 16433590303176;
w.__initData = __initData;
const H = function H(a0) {
isDragScrolling.set(false);
const r8 = Math;
let r14 = a0.velocity?.y;
if (r14 == null) {
r14 = 0;
}
if (r8.abs(r14) === 0) {
scrollLocked.set(false);
}
};
H.__closure = {
isDragScrolling,
scrollLocked
};
H.__workletHash = 1594981610850;
H.__initData = __initData2;
const D = function D(a0, a1) {
if (isAndroid) {
let r11 = a1?.momentumEndCount;
if (r11 == null) {
r11 = 0;
}
const momentumEndCount = r11 + 1;
if (momentumEndCount === 3) {
scrollLocked.set(false);
} else if (a1 != null) {
a1.momentumEndCount = momentumEndCount;
}
} else {
scrollLocked.set(false);
}
};
D.__closure = {
IS_ANDROID: isAndroid,
scrollLocked
};
D.__workletHash = 17525906195822;
D.__initData = __initData3;
const k = function k(a0) {
let offset;
L13: {
offset = a0.contentOffset.y;
if (isDragScrolling.get() !== true) {
let r41 = isAndroid;
if (isAndroid) {
r41 = offset < 0;
}
let r43 = offset;
if (r41) {
_ReanimatedRexport.scrollTo(animatedRef, 0, 0, false);
r43 = 0;
}
ScrollOffsetValue.set(r43);
} else {
L5: {
const r2 = offset < ScrollOffsetValue.get();
if (!scrollLocked.get()) {
if (r2 && offset <= 0) {
break L5;
}
ScrollOffsetValue.set(offset);
break L13;
}
}
if (!scrollLocked.get()) {
scrollLocked.set(true);
}
_ReanimatedRexport.scrollTo(animatedRef, 0, 0, false);
ScrollOffsetValue.set(0);
}
}
const layoutMeasurement = a0.layoutMeasurement;
const { width, height } = layoutMeasurement;
const contentSize = a0.contentSize;
const { width: width2, height: height2 } = contentSize;
if (onScrollHandler != null) {
_ReanimatedRexport.runOnJS(onScrollHandler)({
width,
height,
offset,
contentWidth: width2,
contentHeight: height2
});
}
if (onScrollHandlerWorkletized != null) {
onScrollHandlerWorkletized({
width,
height,
offset,
contentWidth: width2,
contentHeight: height2
});
}
};
k.__closure = {
isDragScrolling,
IS_ANDROID: isAndroid,
scrollTo: _ReanimatedRexport.scrollTo,
scrollerRef: animatedRef,
ScrollOffsetValue,
scrollLocked,
onScrollHandler,
runOnJS: _ReanimatedRexport.runOnJS,
onScrollHandlerWorkletized
};
k.__workletHash = 13271628494164;
k.__initData = __initData4;
const r44 = {
onScroll: useAnimatedScrollHandler({
onBeginDrag: w,
onEndDrag: H,
onMomentumEnd: D,
onScroll: k
}),
animatedProps: null,
scrollerRef: null,
gestureRef: null
};
const L = () => ({
showsVerticalScrollIndicator: !scrollLocked.get()
});
L.__closure = {
scrollLocked
};
L.__workletHash = 3670657775473;
L.__initData = __initData5;
r44.animatedProps = useAnimatedProps(L);
r44.scrollerRef = animatedRef;
r44.gestureRef = gestureRef;
return r44;
};
}