Files
discord-decomp/sources/modules/voice_panel/native/VoicePanelUI.tsx
T
2026-07-27 16:20:00 +03:00

1812 lines
107 KiB
TypeScript

/* Metro module 15445; source: modules/voice_panel/native/VoicePanelUI.tsx; dependencies: [57, 31, 27, 4606, 9559, 7710, 11795, 11793, 4299, 11796, 33, 3, 4577, 4501, 697, 4017, 1581, 11794, 1585, 5321, 7739, 11282, 15446, 4081, 15439, 3860, 11799, 10734, 15444, 15432, 11624, 10684, 4827, 8141, 12991, 6771, 6789, 690, 15447, 6517, 15448, 15449, 8088, 15450, 15452, 15483, 15511, 15513, 15562, 2] */
function _fun118171(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#118171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:6, offset: 0x024ce88a, size: 1558 bytes, params: 8, frame: 29
var object2;
const env0_0 = require;
const NOOP_118172 = function() {
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(57) /* metro dependency 57 */;
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const StyleSheet = value2.StyleSheet;
const env0_6 = value2.Pressable;
const ScrollView = value2.ScrollView;
const channelRTCStore = importDefault(4606) /* metro dependency 4606: ChannelRTCStore */;
const appFreezeStore = importDefault(9559) /* metro dependency 9559: AppFreezeStore */;
const voicePanelStore = importDefault(7710) /* metro dependency 7710: VoicePanelStore */;
const voicePanelConstantsModule = require(11795) /* metro dependency 11795: VoicePanelConstants */;
const env0_10 = voicePanelConstantsModule.BORDER_RADIUS_PHYSICS;
const DEFAULT_BORDER_RADIUS = voicePanelConstantsModule.DEFAULT_BORDER_RADIUS;
const env0_12 = voicePanelConstantsModule.DEFAULT_BORDER_RADIUS_PIP;
const DRAWER_SPRING_PHYSICS = voicePanelConstantsModule.DRAWER_SPRING_PHYSICS;
const env0_13 = voicePanelConstantsModule.IS_IOS;
const MODE_CHANGE_PHYSICS = voicePanelConstantsModule.MODE_CHANGE_PHYSICS;
const env0_14 = voicePanelConstantsModule.VOICE_PANEL_CHUNK_DIVISOR;
const env0_15 = voicePanelConstantsModule.VoicePanelModes;
const LAYOUT_PHYSICS = voicePanelConstantsModule.LAYOUT_PHYSICS;
const env0_17 = voicePanelConstantsModule.DRAWER_SPRING_PHYSICS_GESTURE_ACTIVE;
const env0_18 = (require(11793) /* metro dependency 11793: VoicePanelControlsConstants */).VoicePanelControlsModes;
const env0_19 = (require(4299) /* metro dependency 4299: CallConstants */).isActivityParticipant;
const env0_20 = (require(11796) /* metro dependency 11796: MorphablePanelConstants */).POP_RESISTANCE;
const value4 = require(33) /* metro dependency 33 */;
const env0_21 = value4.jsx;
const env0_22 = value4.jsxs;
const value7 = new (importDefault(3) /* metro dependency 3: Logger */)('VoicePanelUI');
object2 = {code: "function layoutTransition_VoicePanelUITsx1(values){const{withSpring,LAYOUT_PHYSICS}=this.__closure;return{animations:{originX:withSpring(values.targetOriginX,LAYOUT_PHYSICS,'animate-always'),originY:withSpring(values.targetOriginY,LAYOUT_PHYSICS,'animate-always'),width:withSpring(values.targetWidth,LAYOUT_PHYSICS,'animate-always'),height:withSpring(values.targetHeight,LAYOUT_PHYSICS,'animate-always')},initialValues:{originX:values.currentOriginX,originY:values.currentOriginY,width:values.currentWidth,height:values.currentHeight}};}"};
const env0_25 = _fun118188();
object2 = {};
copyDataProperties(object2, LAYOUT_PHYSICS, undefined);
object2['damping'] = 0;
object2 = {code: "function scrollViewLayoutTransition_VoicePanelUITsx2(values){const{withSpring,LAYOUT_PHYSICS,EMBEDDED_ACTIVITY_ORIENTATION_UPDATE_SAFE_LAYOUT_PHYSICS}=this.__closure;return{animations:{originX:withSpring(values.targetOriginX,LAYOUT_PHYSICS,'animate-always'),originY:withSpring(values.targetOriginY,LAYOUT_PHYSICS,'animate-always'),width:withSpring(values.targetWidth,EMBEDDED_ACTIVITY_ORIENTATION_UPDATE_SAFE_LAYOUT_PHYSICS,'animate-always'),height:withSpring(values.targetHeight,EMBEDDED_ACTIVITY_ORIENTATION_UPDATE_SAFE_LAYOUT_PHYSICS,'animate-always')},initialValues:{originX:values.currentOriginX,originY:values.currentOriginY,width:values.currentWidth,height:values.currentHeight}};}"};
const env0_28 = _fun118190();
object2 = {};
copyDataProperties(object2, DRAWER_SPRING_PHYSICS, undefined);
object2['mass'] = 0.3;
object2['damping'] = 100;
object2['stiffness'] = 100;
object2 = {};
copyDataProperties(object2, MODE_CHANGE_PHYSICS, undefined);
object2['mass'] = 2;
const env0_30 = {code: 'function computeViewableChunksFromScrollPosition_VoicePanelUITsx3(scrollPosition,windowHeight,contentHeight,extraChunks=1){const{VOICE_PANEL_CHUNK_DIVISOR}=this.__closure;const chunkSize=Math.ceil(windowHeight/VOICE_PANEL_CHUNK_DIVISOR);let start=Math.max(Math.floor(scrollPosition/chunkSize)-extraChunks,0);const end=Math.min(start+VOICE_PANEL_CHUNK_DIVISOR+extraChunks*2,Math.ceil(contentHeight/chunkSize));start=Math.max(end-VOICE_PANEL_CHUNK_DIVISOR-extraChunks*2,0);return{start:start,end:end};}'};
const env0_31 = _fun118192();
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const object6 = {};
const object8 = {};
copyDataProperties(object8, StyleSheet.absoluteFillObject, undefined);
object8['overflow'] = 'hidden';
object6.accessibilityView = object8;
const object9 = {};
copyDataProperties(object9, StyleSheet.absoluteFillObject, undefined);
object9['alignItems'] = 'flex-start';
object9['zIndex'] = 1;
object6.wrapper = object9;
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
object6.maskDefaultBackground = {backgroundColor: BACKGROUND_BASE_LOWER};
const object10 = {};
copyDataProperties(object10, StyleSheet.absoluteFillObject, undefined);
object10['borderTopLeftRadius'] = DEFAULT_BORDER_RADIUS;
object10['borderTopRightRadius'] = DEFAULT_BORDER_RADIUS;
object6.scrollView = object10;
object6.scrollViewContent = {'flexGrow': 1, 'flexShrink': 0};
const MOBILE_BACKGROUND_SCRIM_OPAQUE = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_BACKGROUND_SCRIM_OPAQUE;
object6.shade = {backgroundColor: MOBILE_BACKGROUND_SCRIM_OPAQUE, zIndex: 0};
object6.shadePressable = {flexGrow: 1};
const env0_32 = Reflect.apply(createStyles, createStylesModule, [object6]);
const env0_33 = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).createAnimatedComponent(ScrollView);
const env0_34 = (require(1581) /* metro dependency 1581: MetaQuestUtilsAndroid */).isMetaQuest();
const env0_35 = {code: 'function VoicePanelUITsx4(){const{gestureState,connected,mode}=this.__closure;return{gestureActive:gestureState.get().active,connected:connected.get(),mode:mode.get()};}'};
const env0_36 = {code: 'function VoicePanelUITsx5(props,previous){const{cheapWorkletShallowEqual,VoicePanelModes,runOnJS,setPanelFullscreen,setPanelOpen,setPanelPIP}=this.__closure;if(cheapWorkletShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;const{gestureActive:gestureActive,connected:connected,mode:mode}=props;if(!connected||gestureActive||mode!==VoicePanelModes.PANEL){runOnJS(setPanelFullscreen)(false);}else{runOnJS(setPanelFullscreen)(true);}if(mode===VoicePanelModes.PANEL){runOnJS(setPanelOpen)(true);}else{runOnJS(setPanelOpen)(false);}if(mode===VoicePanelModes.PIP){runOnJS(setPanelPIP)(true);}else{runOnJS(setPanelPIP)(false);}}'};
const env0_37 = {code: 'function VoicePanelUITsx6(){const{mode,VoicePanelModes,focused}=this.__closure;var _focused$get;return mode.get()===VoicePanelModes.PANEL?(_focused$get=focused.get())===null||_focused$get===void 0?void 0:_focused$get.id:undefined;}'};
const env0_38 = {code: 'function VoicePanelUITsx7(manualId,previousManualId){const{runOnJS,handleFocusChange}=this.__closure;if(manualId!==previousManualId){runOnJS(handleFocusChange)(manualId);}}'};
const env0_39 = {code: 'function VoicePanelUITsx8(){const{connected,mode,VoicePanelModes,controlsSpecs,VoicePanelControlsModes,runOnJS,showControls,hideControls}=this.__closure;if(!connected.get())return;if(mode.get()===VoicePanelModes.PIP){}else if(controlsSpecs.get().mode===VoicePanelControlsModes.HIDDEN){runOnJS(showControls)({debounce:true});}else{runOnJS(hideControls)({debounce:true});}}'};
const env0_40 = {code: 'function VoicePanelUITsx9(){const{updateSharedValueIfChanged,gestureState}=this.__closure;updateSharedValueIfChanged(gestureState,{cancel:false,active:false});}'};
const env0_41 = {code: 'function VoicePanelUITsx10(event){const{gestureState,mode,VoicePanelModes,calculatePIPPositionFromVelocity,windowDimensions,safeArea,updateSharedValueIfChanged,wrapperDimensions,wrapperOffset,connected,runOnJS,setMode,lockScrolling,MIN_DISMISS_MOVE_PERCENTAGE,dismissPanel}=this.__closure;if(gestureState.get().cancel)return;const{velocityX:velocityX,velocityY:velocityY,absoluteX:absoluteX,absoluteY:absoluteY}=event;if(mode.get()===VoicePanelModes.PIP){const{pipX:pipX,pipY:pipY}=calculatePIPPositionFromVelocity({velocityX:velocityX,velocityY:velocityY,absoluteX:absoluteX,absoluteY:absoluteY,windowDimensions:windowDimensions.get(),safeArea:safeArea.get()});updateSharedValueIfChanged(wrapperDimensions,{pipX:pipX,pipY:pipY});updateSharedValueIfChanged(wrapperOffset,{gestureActive:false});}else if(mode.get()===VoicePanelModes.PANEL){if(velocityY>0){if(connected.get()){if(!gestureState.get().requiresPop){runOnJS(setMode)(VoicePanelModes.PIP);updateSharedValueIfChanged(wrapperOffset,{gestureActive:false,x:0,y:0});}else{updateSharedValueIfChanged(wrapperOffset,{gestureActive:false,x:0,y:0});lockScrolling.set(false);}}else{const panelHeight=wrapperDimensions.get().drawerHeight-wrapperDimensions.get().drawerY;const dismissThreshold=panelHeight*MIN_DISMISS_MOVE_PERCENTAGE;if(wrapperOffset.get().y>dismissThreshold){updateSharedValueIfChanged(wrapperOffset,{gestureActive:false});runOnJS(dismissPanel)();return;}else{updateSharedValueIfChanged(wrapperOffset,{gestureActive:false,x:0,y:0});lockScrolling.set(false);}}}else{updateSharedValueIfChanged(wrapperOffset,{gestureActive:false,x:0,y:0});lockScrolling.set(false);}}}'};
const env0_42 = {code: "function VoicePanelUITsx11(_e){const{lockScrolling,updateSharedValueIfChanged,gestureState,wrapperOffset}=this.__closure;lockScrolling.set(false);updateSharedValueIfChanged(gestureState,{cancel:false,active:false});updateSharedValueIfChanged(wrapperOffset,{gestureActive:false});console.log('onTouchesCancelled');}"};
const env0_43 = {code: 'function VoicePanelUITsx12(event){const{gestureState,mode,VoicePanelModes,connected,lockScrolling,scrollPosition,POP_RESISTANCE,PIP_POP_HEIGHT,runOnJS,triggerHapticFeedback,HapticFeedbackTypes,updateSharedValueIfChanged,wrapperOffset}=this.__closure;if(gestureState.get().cancel)return;if(mode.get()!==VoicePanelModes.PIP){const minYOffset=0;let newYOffset=(gestureState.get().absoluteYStart-event.absoluteY)*-1;if(connected.get()&&!gestureState.get().requiresPop&&newYOffset<=minYOffset){gestureState.set({...gestureState.get(),requiresPop:true});}if(lockScrolling.get()&&newYOffset<minYOffset){lockScrolling.set(false);}else if(!lockScrolling.get()&&scrollPosition.get()<=0){lockScrolling.set(true);}if(gestureState.get().requiresPop){const distance=Math.max(newYOffset,0);const resistance=distance*POP_RESISTANCE;if(distance<=PIP_POP_HEIGHT){newYOffset=distance-resistance;}else{gestureState.set({...gestureState.get(),requiresPop:false});runOnJS(triggerHapticFeedback)(HapticFeedbackTypes.IMPACT_MEDIUM);}}updateSharedValueIfChanged(wrapperOffset,{y:newYOffset,x:0});}else{updateSharedValueIfChanged(wrapperOffset,{x:(gestureState.get().absoluteXStart-event.absoluteX)*-1,y:(gestureState.get().absoluteYStart-event.absoluteY)*-1});}}'};
const env0_44 = {code: 'function VoicePanelUITsx13(event,manager){const{State,gestureState,mode,VoicePanelModes,scrollPosition,isQuest,MIN_GESTURE_MOVE,focused,runOnJS,triggerIOSHaptic,updateSharedValueIfChanged,wrapperOffset,lockScrolling}=this.__closure;if(event.state!==State.BEGAN||gestureState.get().active||gestureState.get().cancel)return;const{absoluteY:absoluteY,absoluteX:absoluteX}=event.changedTouches[0];const yDiff=gestureState.get().absoluteYStart-absoluteY;const xDiff=gestureState.get().absoluteXStart-absoluteX;const absoluteMovement=Math.max(Math.abs(yDiff),Math.abs(xDiff));const isNotPullDownGesture=Math.abs(xDiff)>=Math.abs(yDiff)||yDiff>0;let startGesture=false;if(mode.get()===VoicePanelModes.PANEL){var _focused$get;const scrollPos=Math.floor(scrollPosition.get());if(yDiff<0&&scrollPos<=0){if(isQuest){startGesture=absoluteMovement>MIN_GESTURE_MOVE;}else{startGesture=true;}}else if(((_focused$get=focused.get())===null||_focused$get===void 0?void 0:_focused$get.id)!=null&&isNotPullDownGesture){manager.fail();}}else if(mode.get()===VoicePanelModes.PIP&&absoluteMovement>MIN_GESTURE_MOVE){startGesture=true;runOnJS(triggerIOSHaptic)();}if(startGesture){updateSharedValueIfChanged(wrapperOffset,{gestureActive:true});gestureState.set({absoluteXStart:absoluteX,absoluteYStart:absoluteY+scrollPosition.get(),cancel:false,active:true,requiresPop:gestureState.get().requiresPop});lockScrolling.set(true);manager.activate();}else{updateSharedValueIfChanged(gestureState,{absoluteYStart:absoluteY,absoluteXStart:absoluteX});}}'};
const env0_45 = {code: 'function VoicePanelUITsx14(event){const{gestureState,updateSharedValueIfChanged,wrapperOffset,connected,mode,VoicePanelModes}=this.__closure;if(gestureState.get().cancel)return;updateSharedValueIfChanged(wrapperOffset,{x:0,y:0});gestureState.set({absoluteXStart:event.absoluteX,absoluteYStart:event.absoluteY,active:false,cancel:false,requiresPop:connected.get()&&mode.get()===VoicePanelModes.PANEL});}'};
const env0_46 = {code: 'function VoicePanelUITsx15(event,manager){const{IS_IOS,windowDimensions,safeArea,gestureState,isFocusedVideoZoomed,mode,VoicePanelModes,controlsSpecs,VoicePanelControlsModes}=this.__closure;const touch=event.allTouches[0];if(IS_IOS&&touch!=null&&touch.absoluteY>windowDimensions.get().height-safeArea.get().bottom){gestureState.set({...gestureState.get(),cancel:true});manager.activate();return;}if(isFocusedVideoZoomed.get()||mode.get()===VoicePanelModes.PANEL&&controlsSpecs.get().mode===VoicePanelControlsModes.DRAWER){gestureState.set({...gestureState.get(),cancel:true});manager.fail();}}'};
const env0_47 = {code: 'function onBeginDrag_VoicePanelUITsx16(event){const{scrollPosition,dragScrolling}=this.__closure;scrollPosition.set(event.contentOffset.y);dragScrolling.set(true);}'};
const env0_48 = {code: 'function onEndDrag_VoicePanelUITsx17(){const{dragScrolling}=this.__closure;dragScrolling.set(false);}'};
const env0_49 = {code: 'function onMomentumEnd_VoicePanelUITsx18(){const{dragScrolling}=this.__closure;dragScrolling.set(false);}'};
const env0_50 = {code: 'function onScroll_VoicePanelUITsx19(event){const{lockScrolling,isSnappingBack,scrollPosition,scrollTo,scrollerRef,computeViewableChunksFromScrollPosition,windowDimensions,scrollableRegionSize,updateSharedValueIfChanged,viewableChunks}=this.__closure;if(lockScrolling.get()){if(isSnappingBack.get()){return;}if(scrollPosition.get()<0){scrollPosition.set(0);}const targetScrollPosition=scrollPosition.get();if(Math.abs(event.contentOffset.y-targetScrollPosition)<0.1){return;}isSnappingBack.set(true);scrollTo(scrollerRef,0,targetScrollPosition,false);isSnappingBack.set(false);}else{let newViewableChunks;if(scrollPosition.get()!==event.contentOffset.y){newViewableChunks=computeViewableChunksFromScrollPosition(scrollPosition.get(),windowDimensions.get().height,scrollableRegionSize.get());}scrollPosition.set(event.contentOffset.y);newViewableChunks!=null&&updateSharedValueIfChanged(viewableChunks,newViewableChunks);}}'};
const env0_51 = {code: 'function VoicePanelUITsx20(){const{mode}=this.__closure;return mode.get();}'};
const env0_52 = {code: 'function VoicePanelUITsx21(mode,previous){const{VoicePanelModes,lockScrolling}=this.__closure;if(previous==null||mode===previous)return;if(mode===VoicePanelModes.PANEL&&previous===VoicePanelModes.PIP){lockScrolling.set(false);}else if(mode===VoicePanelModes.PIP){lockScrolling.set(true);}}'};
const env0_53 = {code: "function VoicePanelUITsx22(){const{mode,VoicePanelModes,focused,lockScrolling,calculateVoicePanelHeaderSpecs,safeArea,edgeGutter}=this.__closure;const isPIPMode=mode.get()===VoicePanelModes.PIP;const disableScroll=isPIPMode||focused.get()!=null;return{pointerEvents:isPIPMode?'none':'auto',scrollEnabled:!disableScroll,showsVerticalScrollIndicator:lockScrolling.get()?false:!disableScroll,scrollIndicatorInsets:{top:calculateVoicePanelHeaderSpecs(safeArea.get(),edgeGutter).height-safeArea.get().top,bottom:safeArea.get().bottom}};}"};
const env0_54 = {code: 'function VoicePanelUITsx23(){const{mode,VoicePanelModes,connected,gestureState,wrapperDimensions,wrapperOffset,windowDimensions}=this.__closure;switch(mode.get()){case VoicePanelModes.PIP:case VoicePanelModes.DISMISSED:return 0;default:{if(connected.get()&&gestureState.get().active&&gestureState.get().requiresPop){return 1;}const drawerTop=wrapperDimensions.get().drawerY+(wrapperOffset.get().gestureActive?wrapperOffset.get().y:0);const screenSize=windowDimensions.get().height;const percentage=(screenSize-drawerTop)/screenSize;return Math.min(Math.max(percentage,0),1);}}}'};
const env0_55 = {code: 'function computeBorderRadii_VoicePanelUITsx24({mode:mode,connected:connected}){const{VoicePanelModes,DEFAULT_BORDER_RADIUS_PIP,DEFAULT_BORDER_RADIUS}=this.__closure;if(mode===VoicePanelModes.PIP){return DEFAULT_BORDER_RADIUS_PIP;}return!connected?DEFAULT_BORDER_RADIUS:0;}'};
const env0_56 = _fun118194();
const env0_57 = {code: 'function VoicePanelUITsx25(){const{controlsSpecs}=this.__closure;return controlsSpecs.get().height;}'};
const env0_58 = {code: 'function VoicePanelUITsx26(){const{mode,connected,windowDimensions,safeArea,focused,pipState,controlsHeight,preJoinContentSize,globalStatusIndicatorHeight}=this.__closure;return{modeToSet:mode.get(),connected:connected.get(),windowWidth:windowDimensions.get().width,windowHeight:windowDimensions.get().height,safeArea:safeArea.get(),focused:focused.get(),pipState:pipState,controlsHeight:controlsHeight.get(),preJoinContentSize:preJoinContentSize.get(),globalStatusIndicatorHeight:globalStatusIndicatorHeight};}'};
const env0_59 = {code: 'function VoicePanelUITsx27(props,previous){const{cheapWorkletShallowEqual,VoicePanelModes,wrapperDimensions,updateSharedValueIfChanged,wrapperOffset,getMaxPanelWidth,getPanelX,roundToNearestPixel,windowDimensions}=this.__closure;if(cheapWorkletShallowEqual(props,previous!==null&&previous!==void 0?previous:undefined))return;const{modeToSet:modeToSet,connected:connected,windowWidth:windowWidth,windowHeight:windowHeight,safeArea:safeArea,pipState:pipState,controlsHeight:controlsHeight,preJoinContentSize:preJoinContentSize,globalStatusIndicatorHeight:globalStatusIndicatorHeight}=props;if(modeToSet===VoicePanelModes.PIP&&pipState.id==null){return;}const animated=previous!=null?windowHeight===previous.windowHeight&&windowWidth===previous.windowWidth&&safeArea.top===previous.safeArea.top&&safeArea.bottom===previous.safeArea.bottom&&safeArea.left===previous.safeArea.left&&safeArea.right===previous.safeArea.right:true;let{drawerX:drawerX,drawerY:drawerY}=wrapperDimensions.get();const availableHeight=windowHeight-globalStatusIndicatorHeight;if(modeToSet===VoicePanelModes.PANEL){if(connected){drawerX=0;drawerY=0;updateSharedValueIfChanged(wrapperDimensions,{drawerWidth:windowWidth,drawerHeight:availableHeight,drawerX:drawerX,drawerY:drawerY,animated:animated,mode:modeToSet});updateSharedValueIfChanged(wrapperOffset,{gestureActive:false});}else{const drawerWidth=getMaxPanelWidth({windowWidth:windowWidth,connected:connected,safeAreaLeft:safeArea.left,safeAreaRight:safeArea.right});drawerX=getPanelX(windowWidth,drawerWidth);drawerY=roundToNearestPixel(Math.max(availableHeight-preJoinContentSize-controlsHeight-safeArea.bottom,availableHeight-0.8*availableHeight));updateSharedValueIfChanged(wrapperDimensions,{drawerWidth:drawerWidth,drawerHeight:availableHeight,drawerX:drawerX,drawerY:drawerY,animated:animated,mode:modeToSet});}}else if(modeToSet===VoicePanelModes.DISMISSED){if(connected){updateSharedValueIfChanged(wrapperDimensions,{mode:modeToSet});}else{updateSharedValueIfChanged(wrapperDimensions,{drawerY:windowDimensions.get().height+60,mode:modeToSet});}}}'};
const env0_60 = {code: "function VoicePanelUITsx28(){const{useReducedMotion,wrapperDimensions,wrapperOffset,connected,mode,VoicePanelModes,runOnJS,updateSourceTrackingView,withSpring,DRAWER_SPRING_PHYSICS_GESTURE_ACTIVE,DRAWER_SIZE_PHYSICS}=this.__closure;const animateXY=!useReducedMotion.get()&&wrapperDimensions.get().animated||wrapperOffset.get().gestureActive;let{gestureActive:gestureActive}=wrapperOffset.get();let{drawerY:y,drawerX:x}=wrapperDimensions.get();gestureActive=gestureActive&&!connected.get();if(gestureActive){y+=Math.max(wrapperOffset.get().y,0);x+=wrapperOffset.get().x;}const updateSourceTrackingViewHelper=function(finished){if(finished&&mode.get()!==VoicePanelModes.DISMISSED){runOnJS(updateSourceTrackingView)();}};return{transform:[{translateX:withSpring(x,wrapperOffset.get().gestureActive?DRAWER_SPRING_PHYSICS_GESTURE_ACTIVE:DRAWER_SIZE_PHYSICS,animateXY?'animate-always':'animate-never',updateSourceTrackingViewHelper)},{translateY:withSpring(y,wrapperOffset.get().gestureActive?DRAWER_SPRING_PHYSICS_GESTURE_ACTIVE:DRAWER_SIZE_PHYSICS,animateXY?'animate-always':'animate-never',updateSourceTrackingViewHelper)}]};}"};
const env0_61 = {code: 'function VoicePanelUITsx29(finished){const{mode,VoicePanelModes,runOnJS,updateSourceTrackingView}=this.__closure;if(finished&&mode.get()!==VoicePanelModes.DISMISSED){runOnJS(updateSourceTrackingView)();}}'};
const env0_62 = {code: "function VoicePanelUITsx30(){const{computeBorderRadii,mode,connected,wrapperDimensions,withSpring,BORDER_RADIUS_PHYSICS,VoicePanelModes,styles}=this.__closure;const borderRadius=computeBorderRadii({mode:mode.get(),connected:connected.get()});return{width:wrapperDimensions.get().drawerWidth,height:wrapperDimensions.get().drawerHeight,borderRadius:withSpring(borderRadius,BORDER_RADIUS_PHYSICS),pointerEvents:mode.get()===VoicePanelModes.PANEL?'auto':'none',backgroundColor:connected.get()?'transparent':styles.maskDefaultBackground.backgroundColor};}"};
const env0_63 = {code: 'function VoicePanelUITsx31(){const{windowDimensions}=this.__closure;return windowDimensions.get();}'};
const env0_64 = {code: "function VoicePanelUITsx32(value){const{runOnJS,log}=this.__closure;runOnJS(log)('Window dimensions changed:',JSON.stringify(value));}"};
const env0_65 = {code: 'function VoicePanelUITsx33(){const{wrapperDimensions}=this.__closure;return wrapperDimensions.get();}'};
const env0_66 = {code: "function VoicePanelUITsx34(value){const{runOnJS,log}=this.__closure;runOnJS(log)('Wrapper dimensions changed:',JSON.stringify(value));}"};
const env0_67 = {'mass': 0.6, 'damping': 30, 'stiffness': 400, 'overshootClamping': true};
const env0_68 = {code: "function VoicePanelUITsx35(){const{withSpring,opacity,DrawerShadeOpacityPhysics,accessibilityPreferencesSharedValue}=this.__closure;return{opacity:withSpring(opacity.get(),DrawerShadeOpacityPhysics),display:accessibilityPreferencesSharedValue.get().screenReaderEnabled&&opacity.get()===0?'none':'flex',pointerEvents:opacity.get()===0?'none':'auto'};}"};
const env0_69 = value.memo(_fun118196);
value = value.memo(VoicePanelUI);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/voice_panel/native/VoicePanelUI.tsx');
exports.default = value;
exports.REDUCED_MOTION_OPACITY_PHYSICS = object2;
}
function log_118173(a0) { // fn#118173, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:635, offset: 0x024ceea0, size: 49 bytes, params: 2, frame: 15
const value = copyRestArgs(0, undefined);
const binding = env0_23;
const log = binding.log;
const items2 = [];
arraySpread(items2, value, 0, undefined);
apply(log, items2, binding, undefined);
}
function AnimatedWrapper({wrapperOffset, children}) { // fn#118174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:21054, offset: 0x024ceed1, size: 176 bytes, params: 2, frame: 24
const {wrapperRootStyles, wrapperTransformStyles,
wrapperSurfaceStyles} = AnimatedWrapperUseWrapperStyles(wrapperOffset);
return ((Component) => <Component style={wrapperRootStyles} pointerEvents="box-none">{((Component) => <Component style={wrapperTransformStyles} pointerEvents="box-none">{((Component) => <Component style={wrapperSurfaceStyles} layout={env0_25}>{children}</Component>)(importDefault(8141) /* metro dependency 8141: ReanimatedNativeView */)}</Component>)(importDefault(8141) /* metro dependency 8141: ReanimatedNativeView */)}</Component>)(importDefault(8141) /* metro dependency 8141: ReanimatedNativeView */);
}
function _fun118188() { // fn#118188, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:1221, offset: 0x024cfc05, size: 88 bytes, params: 1, frame: 14
const closure = layoutTransition;
const object2 = {};
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.LAYOUT_PHYSICS = LAYOUT_PHYSICS;
closure.__closure = object2;
closure.__workletHash = 16454235842679;
closure.__initData = env0_24;
return closure;
}
function _fun118190() { // fn#118190, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:2547, offset: 0x024cfd34, size: 99 bytes, params: 1, frame: 14
const closure = scrollViewLayoutTransition;
const object2 = {};
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.LAYOUT_PHYSICS = LAYOUT_PHYSICS;
object2.EMBEDDED_ACTIVITY_ORIENTATION_UPDATE_SAFE_LAYOUT_PHYSICS = env0_26;
closure.__closure = object2;
closure.__workletHash = 11745134918460;
closure.__initData = env0_27;
return closure;
}
function _fun118192() { // fn#118192, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:3834, offset: 0x024cfe72, size: 57 bytes, params: 1, frame: 4
const closure = computeViewableChunksFromScrollPosition;
closure.__closure = {VOICE_PANEL_CHUNK_DIVISOR: VOICE_PANEL_CHUNK_DIVISOR};
closure.__workletHash = 3008066799757;
closure.__initData = env0_30;
return closure;
}
function _fun118194() { // fn#118194, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:15583, offset: 0x024cff68, size: 75 bytes, params: 1, frame: 4
const closure = function({mode, connected}) {
return mode === VoicePanelModes.PIP ? DEFAULT_BORDER_RADIUS_PIP : connected ? 0 : DEFAULT_BORDER_RADIUS;
};
closure.__closure = {VoicePanelModes: VoicePanelModes, DEFAULT_BORDER_RADIUS_PIP: DEFAULT_BORDER_RADIUS_PIP,
DEFAULT_BORDER_RADIUS: DEFAULT_BORDER_RADIUS};
closure.__workletHash = 4574399878042;
closure.__initData = env0_55;
return closure;
}
function _fun118196({opacity, onPress}) { // fn#118196, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:26407, offset: 0x024cffe3, size: 279 bytes, params: 2, frame: 22
const styles = useStyles();
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = o_118197;
const object2 = {};
object2.withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.opacity = opacity;
object2.DrawerShadeOpacityPhysics = env0_67;
object2.accessibilityPreferencesSharedValue = (require(12991) /* metro dependency 12991: AccessibilityPreferencesSharedValue */).accessibilityPreferencesSharedValue;
closure.__closure = object2;
closure.__workletHash = 7030735056874;
closure.__initData = env0_68;
const value2 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<View
style={[StyleSheet.absoluteFill, styles.shade, value2]}
importantForAccessibility="no"
accessibilityElementsHidden
>
<Pressable style={styles.shadePressable} onPress={onPress} />
</View>
);
}
function VoicePanelUI() { // fn#118198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:27091, offset: 0x024d01a4, size: 1224 bytes, params: 1, frame: 46
var object4;
var r0;
var AnalyticsLocationProvider;
const LayerScope = (require(6517) /* metro dependency 6517: LayerScopeNative */).LayerScope;
var items3;
var VoicePanelAccessibilityView;
var items4;
var object2;
var items5;
var GestureDetector;
var object3;
var ReanimatedNativeView;
var GestureDetector2;
var value;
const styles = useStyles();
const defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
const VOICE_PANEL = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).VOICE_PANEL;
const analyticsLocations = defaultImport(VOICE_PANEL).analyticsLocations;
let binding = env0_4;
const {scrollPosition, dragScrolling, channelId,
dismissPanel} = binding.useContext(importDefault(11794) /* metro dependency 11794: VoicePanelStateContext */);
const [property, env0_1] = env0_3(env0_4.useState(false), 2);
const env0_2 = env0_4.useRef(-1);
const value5 = env0_4.useCallback(_fun118199, [channelId]);
env0_4.useLayoutEffect(function() {
return _fun118203;
}, []);
object4 = {scrollPosition: scrollPosition, dragScrolling: dragScrolling, setPanelFullscreen: value5};
object4.setPanelOpen = env0_4.useCallback(_fun118229, [channelId]);
object4.setPanelPIP = env0_4.useCallback(_fun118230, [channelId]);
const {gesture, gestureState, handleScroll, onContentSizeChange, scrollViewProps, scrollerRef, scrollNativeGesture,
viewableChunks, wrapperOffset, opacity} = usePanelGesture(object4);
env0_4.useEffect(_fun118231, [(importDefault(15447) /* metro dependency 15447: useControlsLock */)()]);
env0_4.useEffect(_fun118232, []);
if (property) {
AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
object4 = {value: analyticsLocations};
items3 = [((Component) => <Component />)(importDefault(15448) /* metro dependency 15448: VoicePanelSystemUIManager */)];
binding = env0_69;
items3[1] = ((Component) => <Component opacity={opacity} onPress={dismissPanel} />)(binding);
VoicePanelAccessibilityView = importDefault(15449) /* metro dependency 15449: VoicePanelAccessibilityView */;
var defaultImport3Props = {style: styles.accessibilityView, nativeID: 'voice-panel-ui-' + channelId,
accessibilityViewIsModal: true, layout: env0_25,
onAccessibilityEscape: importDefault(8088) /* metro dependency 8088: closeVoicePanels */};
items4 = [((Component) => <Component />)(importDefault(15450) /* metro dependency 15450: VoicePanelDismissableContent */)];
object2 = {wrapperOffset: wrapperOffset};
items5 = [<LayerScope zIndex={2}>{((Component) => <Component wrapperOffset={wrapperOffset} gestureState={gestureState} layout={env0_25} />)(importDefault(15452) /* metro dependency 15452: VoicePanelHeader */)}</LayerScope>];
GestureDetector = (require(5321) /* metro dependency 5321 */).GestureDetector;
object3 = {gesture: gesture};
ReanimatedNativeView = importDefault(8141) /* metro dependency 8141: ReanimatedNativeView */;
var defaultImport6Props = {style: StyleSheet.absoluteFill, layout: env0_25, collapsable: false};
GestureDetector2 = (require(5321) /* metro dependency 5321 */).GestureDetector;
binding = env0_33;
items5[1] = <GestureDetector {...object3}><ReanimatedNativeView {...defaultImport6Props}><GestureDetector2 gesture={scrollNativeGesture}>{((Component) => <Component layout={env0_28} ref={scrollerRef} onScroll={handleScroll} onMomentumScrollEnd={NOOP_118172} animatedProps={scrollViewProps} style={styles.scrollView} onContentSizeChange={onContentSizeChange} contentContainerStyle={styles.scrollViewContent} scrollEventThrottle={8.333333333333334}>{((Component) => <Component viewableChunks={viewableChunks} />)(importDefault(15483) /* metro dependency 15483: VoicePanelCardView */)}{((Component) => <Component />)(importDefault(15511) /* metro dependency 15511: VoicePanelPreJoinContent */)}</Component>)(binding)}</GestureDetector2></ReanimatedNativeView></GestureDetector>;
items4[1] = <AnimatedWrapper {...object2}>{items5}</AnimatedWrapper>;
items4[2] = ((Component) => <Component gestureState={gestureState} />)(importDefault(15513) /* metro dependency 15513: VoicePanelControls */);
value = importDefault(15562) /* metro dependency 15562: VoicePanelPIP */;
items4[3] = ((Component) => <Component />)(value);
items3[2] = <VoicePanelAccessibilityView {...defaultImport3Props}>{items4}</VoicePanelAccessibilityView>;
value = <AnalyticsLocationProvider {...object4}><LayerScope>{items3}</LayerScope></AnalyticsLocationProvider>;
r0 = value;
} else {
r0 = null;
}
return r0;
}
function AnimatedWrapperUseWrapperStyles(a0) { // fn#118175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:21115, owner: AnimatedWrapper.useWrapperStyles, offset: 0x024cef81, size: 1210 bytes, params: 2, frame: 34
var object2;
var moduleValue7;
var closure3;
var log_118173Binding;
var moduleValue8;
var closure4;
const env0_0 = a0;
const useGlobalStatusIndicatorStateModule = require(10734) /* metro dependency 10734: useGlobalStatusIndicatorState */;
const useGlobalStatusIndicatorState = useGlobalStatusIndicatorStateModule.useGlobalStatusIndicatorState;
const height = Reflect.apply(useGlobalStatusIndicatorState, useGlobalStatusIndicatorStateModule, []).height;
const styles = useStyles();
const {wrapperDimensions, connected, controlsSpecs, focused, mode, preJoinContentSize, safeArea, windowDimensions,
useReducedMotion} = env1_4.useContext(importDefault(11794) /* metro dependency 11794: VoicePanelStateContext */);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useDerivedValue = reanimatedRexportModule.useDerivedValue;
let closure = function() {
return controlsSpecs.get().height;
};
closure.__closure = {controlsSpecs: controlsSpecs};
closure.__workletHash = 6243014585347;
closure.__initData = env1_57;
const value3 = Reflect.apply(useDerivedValue, reanimatedRexportModule, [closure]);
const value4 = (require(15444) /* metro dependency 15444: VoicePanelPIPStateContext */).usePIPState();
const moduleValue4 = reanimatedRexportModule;
let useAnimatedReaction = moduleValue4.useAnimatedReaction;
closure = useWrapperStylesL;
closure.__closure = {mode: mode, connected: connected, windowDimensions: windowDimensions, safeArea: safeArea,
focused: focused, pipState: value4, controlsHeight: value3, preJoinContentSize: preJoinContentSize,
globalStatusIndicatorHeight: height};
closure.__workletHash = 4592460925374;
closure.__initData = env1_58;
const closure2 = useWrapperStylesS;
object2 = {};
object2.cheapWorkletShallowEqual = (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletShallowEqual;
object2.VoicePanelModes = VoicePanelModes;
object2.wrapperDimensions = wrapperDimensions;
object2.updateSharedValueIfChanged = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
object2.wrapperOffset = a0;
const getMaxPanelWidth = (require(15432) /* metro dependency 15432: PanelSizeUtils */).getMaxPanelWidth;
object2.getMaxPanelWidth = getMaxPanelWidth;
const getPanelX = (require(15432) /* metro dependency 15432: PanelSizeUtils */).getPanelX;
object2.getPanelX = getPanelX;
object2.roundToNearestPixel = importDefault(11624) /* metro dependency 11624: roundToNearestPixel */;
object2.windowDimensions = windowDimensions;
closure2.__closure = object2;
closure2.__workletHash = 3683279660781;
closure2.__initData = env1_59;
Reflect.apply(useAnimatedReaction, moduleValue4, [closure, closure2]);
const moduleValue5 = reanimatedRexportModule;
let useAnimatedStyle = moduleValue5.useAnimatedStyle;
closure = useWrapperStylesC;
object2 = {useReducedMotion: useReducedMotion, wrapperDimensions: wrapperDimensions, wrapperOffset: a0,
connected: connected, mode: mode};
object2.VoicePanelModes = VoicePanelModes;
const runOnJS = reanimatedRexportModule.runOnJS;
object2.runOnJS = runOnJS;
object2.updateSourceTrackingView = (importDefault(10684) /* metro dependency 10684: ExternalPipAndroid */).updateSourceTrackingView;
const withSpring = (require(4577) /* metro dependency 4577: spring */).withSpring;
object2.withSpring = withSpring;
object2.DRAWER_SPRING_PHYSICS_GESTURE_ACTIVE = DRAWER_SPRING_PHYSICS_GESTURE_ACTIVE;
object2.DRAWER_SIZE_PHYSICS = env1_29;
closure.__closure = object2;
closure.__workletHash = 16361132737159;
closure.__initData = env1_60;
const value5 = Reflect.apply(useAnimatedStyle, moduleValue5, [closure]);
const moduleValue6 = reanimatedRexportModule;
useAnimatedStyle = moduleValue6.useAnimatedStyle;
closure = useWrapperStylesM;
closure.__closure = {computeBorderRadii: env1_56, mode: mode, connected: connected,
wrapperDimensions: wrapperDimensions, withSpring: withSpring, BORDER_RADIUS_PHYSICS: BORDER_RADIUS_PHYSICS,
VoicePanelModes: VoicePanelModes, styles: styles};
closure.__workletHash = 1768699814221;
closure.__initData = env1_62;
const value6 = Reflect.apply(useAnimatedStyle, moduleValue6, [closure]);
if (!(require(4827) /* metro dependency 4827: ReleaseChannelUtilsNative */).isStable) {
moduleValue7 = reanimatedRexportModule;
useAnimatedReaction = moduleValue7.useAnimatedReaction;
closure = function() {
return windowDimensions.get();
};
closure.__closure = {windowDimensions: windowDimensions};
closure.__workletHash = 14100798624471;
closure.__initData = env1_63;
closure3 = useWrapperStylesY;
log_118173Binding = log_118173;
closure3.__closure = {runOnJS: runOnJS, log: log_118173Binding};
closure3.__workletHash = 13929796154212;
closure3.__initData = env1_64;
Reflect.apply(useAnimatedReaction, moduleValue7, [closure, closure3]);
moduleValue8 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
useAnimatedReaction = moduleValue8.useAnimatedReaction;
closure = useWrapperStylesH;
closure.__closure = {wrapperDimensions: wrapperDimensions};
closure.__workletHash = 14295147321429;
closure.__initData = env1_65;
closure4 = useWrapperStylesT;
closure4.__closure = {runOnJS: runOnJS, log: log_118173Binding};
closure4.__workletHash = 1850762619613;
closure4.__initData = env1_66;
Reflect.apply(useAnimatedReaction, moduleValue8, [closure, closure4]);
}
return env1_4.useMemo(_fun118187, [styles.wrapper, value6, value5]);
}
function layoutTransition({targetOriginX, targetOriginY, targetWidth, targetHeight, currentOriginX, currentOriginY, currentWidth, currentHeight}) { // fn#118189, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:1253, offset: 0x024cfc5d, size: 215 bytes, params: 2, frame: 22
const object = {};
const value = environment.__proto__;
object.originX = (require(4577) /* metro dependency 4577: spring */).withSpring(targetOriginX, LAYOUT_PHYSICS,
'animate-always');
object.originY = (require(4577) /* metro dependency 4577: spring */).withSpring(targetOriginY, LAYOUT_PHYSICS,
'animate-always');
object.width = (require(4577) /* metro dependency 4577: spring */).withSpring(targetWidth, LAYOUT_PHYSICS,
'animate-always');
object.height = (require(4577) /* metro dependency 4577: spring */).withSpring(targetHeight, LAYOUT_PHYSICS,
'animate-always');
return {animations: object, initialValues: {originX: currentOriginX, originY: currentOriginY, width: currentWidth,
height: currentHeight}};
}
function scrollViewLayoutTransition({targetOriginX, targetOriginY, targetWidth, targetHeight, currentOriginX, currentOriginY, currentWidth, currentHeight}) { // fn#118191, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:2589, offset: 0x024cfd97, size: 219 bytes, params: 2, frame: 23
const object = {};
const value = environment.__proto__;
const springModule = require(4577) /* metro dependency 4577: spring */;
let withSpring = springModule.withSpring;
object.originX = Reflect.apply(withSpring, springModule, [targetOriginX, LAYOUT_PHYSICS, 'animate-always']);
object.originY = springModule.withSpring(targetOriginY, LAYOUT_PHYSICS, 'animate-always');
const moduleValue3 = springModule;
withSpring = moduleValue3.withSpring;
const binding = env1_26;
object.width = Reflect.apply(withSpring, moduleValue3, [targetWidth, binding, 'animate-always']);
object.height = springModule.withSpring(targetHeight, binding, 'animate-always');
return {animations: object, initialValues: {originX: currentOriginX, originY: currentOriginY, width: currentWidth,
height: currentHeight}};
}
function computeViewableChunksFromScrollPosition(a0, a1, a2) { // fn#118193, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:3889, offset: 0x024cfeab, size: 189 bytes, params: 4, frame: 21
let value = a3;
const r7 = value !== undefined ? value : 1;
let Math = global.Math;
const ceil = Math.ceil;
value = environment.__proto__;
value = Reflect.apply(ceil, Math, [a1 / VOICE_PANEL_CHUNK_DIVISOR]);
Math = global.Math;
const max = Math.max;
const Math2 = global.Math;
const value3 = Reflect.apply(max, Math, [Math2.floor(a0 / value) - r7, 0]);
Math = global.Math;
const min = Math.min;
const value5 = value3 + VOICE_PANEL_CHUNK_DIVISOR + 2 * r7;
const Math3 = global.Math;
value = Reflect.apply(min, Math, [value5, Math3.ceil(a2 / value)]);
Math = global.Math;
return {start: Math.max(value - VOICE_PANEL_CHUNK_DIVISOR - 2 * r7, 0), end: value};
}
function o_118197() { // fn#118197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:26483, offset: 0x024d00fa, size: 170 bytes, params: 1, frame: 19
const object2 = {};
let value = environment.__proto__;
const springModule = require(4577) /* metro dependency 4577: spring */;
const withSpring = springModule.withSpring;
const opacityBinding = opacity;
let get = opacityBinding.get;
object2.opacity = Reflect.apply(withSpring, springModule, [Reflect.apply(get, opacityBinding, []), env1_67]);
const accessibilityPreferencesSharedValue = (require(12991) /* metro dependency 12991: AccessibilityPreferencesSharedValue */).accessibilityPreferencesSharedValue;
get = accessibilityPreferencesSharedValue.get;
const screenReaderEnabled = Reflect.apply(get, accessibilityPreferencesSharedValue, []).screenReaderEnabled;
value = 'flex';
object2.display = screenReaderEnabled ? opacity.get() !== 0 ? value : 'none' : value;
object2.pointerEvents = opacity.get() !== 0 ? 'auto' : 'none';
return object2;
}
function _fun118199(a0) { // fn#118199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:27342, offset: 0x024d066c, size: 79 bytes, params: 2, frame: 13
var environment;
const env0_0 = a0;
const clearTimeout = global.clearTimeout;
clearTimeout(env0_2.current);
const value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun118200);
}
function _fun118202() { // fn#118202, offset: 0x024d07c6, size: 11 bytes, params: 1, frame: 1
return _fun118203;
}
function usePanelGesture({scrollPosition, dragScrolling, setPanelFullscreen, setPanelOpen, setPanelPIP}) { // fn#118204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:27754, owner: VoicePanelUI.usePanelGesture, offset: 0x024d07ee, size: 1776 bytes, params: 2, frame: 51
var object2;
var environment;
const value = environment.__proto__;
let binding = env1_4;
const {channelId, connected, controlsSpecs, dismissPanel, dismissToPIPGestureRef, focused, hideControls,
isFocusedVideoZoomed, mode, safeArea, setMode, showControls, windowDimensions, wrapperDimensions,
wrapperOffset} = binding.useContext(importDefault(11794) /* metro dependency 11794: VoicePanelStateContext */);
const value3 = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
const value4 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
const value5 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const value6 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const value7 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue({start: 0,
end: VOICE_PANEL_CHUNK_DIVISOR});
const [property, env0_26] = env1_3(env1_4.useState(true), 2);
binding = env1_4;
let closure = function() {
var Gesture = require(dependencyMap[19]).Gesture;
return Gesture.Native();
};
const value10 = binding.useMemo(closure, []);
const value11 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useAnimatedRef();
const value12 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue({'absoluteXStart': 0,
'absoluteYStart': 0, 'cancel': false, 'active': false, 'requiresPop': false});
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
let useAnimatedReaction = reanimatedRexportModule.useAnimatedReaction;
closure = usePanelGestureF;
closure.__closure = {gestureState: value12, connected: connected, mode: mode};
closure.__workletHash = 5596084348360;
closure.__initData = env1_35;
const closure2 = usePanelGestureH;
object2 = {};
object2.cheapWorkletShallowEqual = (require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */).cheapWorkletShallowEqual;
object2.VoicePanelModes = VoicePanelModes;
const runOnJS = reanimatedRexportModule.runOnJS;
object2.runOnJS = runOnJS;
object2.setPanelFullscreen = setPanelFullscreen;
object2.setPanelOpen = setPanelOpen;
object2.setPanelPIP = setPanelPIP;
closure2.__closure = object2;
closure2.__workletHash = 10989484188294;
closure2.__initData = env1_36;
Reflect.apply(useAnimatedReaction, reanimatedRexportModule, [closure, closure2]);
const value13 = env1_4.useCallback(_fun118208, [channelId]);
const moduleValue8 = reanimatedRexportModule;
useAnimatedReaction = moduleValue8.useAnimatedReaction;
closure = usePanelGestureMe;
closure.__closure = {mode: mode, VoicePanelModes: VoicePanelModes, focused: focused};
closure.__workletHash = 6595654888031;
closure.__initData = env1_37;
const closure3 = we;
closure3.__closure = {runOnJS: runOnJS, handleFocusChange: value13};
closure3.__workletHash = 15236018210415;
closure3.__initData = env1_38;
Reflect.apply(useAnimatedReaction, moduleValue8, [closure, closure3]);
const value14 = env1_4.useMemo(_fun118211, [value3, connected, controlsSpecs, dismissPanel, dismissToPIPGestureRef,
focused, property, hideControls, value12, isFocusedVideoZoomed, value5, mode, safeArea, scrollPosition, value10,
setMode, showControls, windowDimensions, wrapperDimensions, wrapperOffset]);
const moduleValue9 = reanimatedRexportModule;
const useAnimatedScrollHandler = moduleValue9.useAnimatedScrollHandler;
object2 = {};
closure = function(a0) {
scrollPosition.set(a0.contentOffset.y);
dragScrolling.set(true);
};
closure.__closure = {scrollPosition: scrollPosition, dragScrolling: dragScrolling};
closure.__workletHash = 57033362164;
closure.__initData = env1_47;
object2.onBeginDrag = closure;
closure = function() {
dragScrolling.set(false);
};
closure.__closure = {dragScrolling: dragScrolling};
closure.__workletHash = 14366146937201;
closure.__initData = env1_48;
object2.onEndDrag = closure;
closure = function() {
dragScrolling.set(false);
};
closure.__closure = {dragScrolling: dragScrolling};
closure.__workletHash = 12919609750790;
closure.__initData = env1_49;
object2.onMomentumEnd = closure;
closure = onScroll_118223;
const object3 = {lockScrolling: value5, isSnappingBack: value6, scrollPosition: scrollPosition};
object3.scrollTo = reanimatedRexportModule.scrollTo;
object3.scrollerRef = value11;
object3.computeViewableChunksFromScrollPosition = env1_31;
object3.windowDimensions = windowDimensions;
object3.scrollableRegionSize = value4;
object3.updateSharedValueIfChanged = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
object3.viewableChunks = value7;
closure.__closure = object3;
closure.__workletHash = 13292683579177;
closure.__initData = env1_50;
object2.onScroll = closure;
const value15 = Reflect.apply(useAnimatedScrollHandler, moduleValue9, [object2]);
const moduleValue10 = reanimatedRexportModule;
useAnimatedReaction = moduleValue10.useAnimatedReaction;
closure = function() {
return mode.get();
};
closure.__closure = {mode: mode};
closure.__workletHash = 9335671323831;
closure.__initData = env1_51;
const closure4 = usePanelGestureDe;
closure4.__closure = {VoicePanelModes: VoicePanelModes, lockScrolling: value5};
closure4.__workletHash = 15902278985136;
closure4.__initData = env1_52;
Reflect.apply(useAnimatedReaction, moduleValue10, [closure, closure4]);
const useTokenModule = require(3860) /* metro dependency 3860: useToken */;
const useToken = useTokenModule.useToken;
const VOICE_PANEL_GUTTER = (importDefault(697) /* metro dependency 697: native */).modules.mobile.VOICE_PANEL_GUTTER;
const value16 = Reflect.apply(useToken, useTokenModule, [VOICE_PANEL_GUTTER]);
const moduleValue12 = reanimatedRexportModule;
const useAnimatedProps = moduleValue12.useAnimatedProps;
closure = usePanelGestureMe_118226;
object2 = {mode: mode};
object2.VoicePanelModes = VoicePanelModes;
object2.focused = focused;
object2.lockScrolling = value5;
object2.calculateVoicePanelHeaderSpecs = importDefault(11799) /* metro dependency 11799: calculateVoicePanelHeaderSpecs */;
object2.safeArea = safeArea;
object2.edgeGutter = value16;
closure.__closure = object2;
closure.__workletHash = 15030832737033;
closure.__initData = env1_53;
const value17 = Reflect.apply(useAnimatedProps, moduleValue12, [closure]);
const value18 = env1_4.useCallback(_fun118227, [value4]);
const moduleValue13 = reanimatedRexportModule;
const useDerivedValue = moduleValue13.useDerivedValue;
closure = Te;
closure.__closure = {mode: mode, VoicePanelModes: VoicePanelModes, connected: connected, gestureState: value12,
wrapperDimensions: wrapperDimensions, wrapperOffset: wrapperOffset, windowDimensions: windowDimensions};
closure.__workletHash = 7328947258749;
closure.__initData = env1_54;
return {gesture: value14, scrollerRef: value11, scrollNativeGesture: value10, viewableChunks: value7,
handleScroll: value15, scrollViewProps: value17, onContentSizeChange: value18, wrapperOffset: wrapperOffset,
scrollableRegionSize: value4, gestureState: value12, opacity: Reflect.apply(useDerivedValue, moduleValue13,
[closure])};
}
function _fun118229(a0) { // fn#118229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:37448, offset: 0x024d267f, size: 43 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = VoicePanelStore.getState();
value.setChannelPanelOpen(channelId, a0);
}
function _fun118230(a0) { // fn#118230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:37524, offset: 0x024d26aa, size: 43 bytes, params: 2, frame: 13
let value = environment.__proto__;
value = VoicePanelStore.getState();
value.setChannelPanelPIP(channelId, a0);
}
function _fun118231() { // fn#118231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:37792, offset: 0x024d26d5, size: 21 bytes, params: 1, frame: 9
env0_3.lock();
}
function useWrapperStylesL() { // fn#118177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:21575, owner: AnimatedWrapper.useWrapperStyles.l, offset: 0x024cf452, size: 175 bytes, params: 1, frame: 11
const object2 = {};
const modeBinding = mode;
let get = modeBinding.get;
object2.modeToSet = Reflect.apply(get, modeBinding, []);
object2.connected = connected.get();
const windowDimensionsBinding = windowDimensions;
get = windowDimensionsBinding.get;
object2.windowWidth = Reflect.apply(get, windowDimensionsBinding, []).width;
get = windowDimensionsBinding.get;
object2.windowHeight = Reflect.apply(get, windowDimensionsBinding, []).height;
object2.safeArea = safeArea.get();
object2.focused = focused.get();
object2.pipState = env0_13;
object2.controlsHeight = env0_12.get();
object2.preJoinContentSize = preJoinContentSize.get();
object2.globalStatusIndicatorHeight = height;
return object2;
}
function useWrapperStylesS(a0, a1) { // fn#118178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:22000, owner: AnimatedWrapper.useWrapperStyles.s, offset: 0x024cf501, size: 735 bytes, params: 3, frame: 27
var r1;
var r9;
var modeToSet;
var connected;
var windowWidth;
var windowHeight;
var safeArea;
var pipState;
var controlsHeight;
var preJoinContentSize;
var globalStatusIndicatorHeight;
var value4;
var wrapperDimensionsBinding;
var value10;
var value11;
var defaultImport;
var windowDimensionsBinding;
var maxPanelWidth;
var panelX;
var defaultImport2;
var Math;
const value = a1;
const value3 = undefined;
const cheapWorkletShallowEqualModule = require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */;
if (!cheapWorkletShallowEqualModule.cheapWorkletShallowEqual(a0, value ?? value3)) {
modeToSet = a0.modeToSet;
connected = a0.connected;
windowWidth = a0.windowWidth;
windowHeight = a0.windowHeight;
safeArea = a0.safeArea;
pipState = a0.pipState;
controlsHeight = a0.controlsHeight;
preJoinContentSize = a0.preJoinContentSize;
globalStatusIndicatorHeight = a0.globalStatusIndicatorHeight;
if (modeToSet !== VoicePanelModes.PIP) {
value4 = value == null;
if (value4) {
r9 = value4;
} else {
r1 = windowHeight === value.windowHeight && windowWidth === value.windowWidth;
r1 = r1 && safeArea.top === value.safeArea.top;
r1 = r1 && safeArea.bottom === value.safeArea.bottom;
r1 = r1 && safeArea.left === value.safeArea.left;
r1 = r1 && safeArea.right === value.safeArea.right;
r9 = r1;
}
value10 = wrapperDimensions.get();
value10.drawerX;
value10.drawerY;
value11 = windowHeight - globalStatusIndicatorHeight;
if (modeToSet === VoicePanelModes.PANEL) {
if (connected) {
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperDimensions,
{drawerWidth: windowWidth, drawerHeight: value11, drawerX: 0, drawerY: 0, animated: r9,
mode: modeToSet});
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env0_0,
{gestureActive: false});
} else {
maxPanelWidth = (require(15432) /* metro dependency 15432: PanelSizeUtils */).getMaxPanelWidth({windowWidth: windowWidth,
connected: connected, safeAreaLeft: safeArea.left, safeAreaRight: safeArea.right});
panelX = (require(15432) /* metro dependency 15432: PanelSizeUtils */).getPanelX(windowWidth,
maxPanelWidth);
defaultImport2 = importDefault(11624) /* metro dependency 11624: roundToNearestPixel */;
Math = global.Math;
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperDimensions,
{drawerWidth: maxPanelWidth, drawerHeight: value11, drawerX: panelX,
drawerY: defaultImport2(Math.max(value11 - preJoinContentSize - controlsHeight - safeArea.bottom,
value11 - 0.8 * value11)), animated: r9, mode: modeToSet});
}
} else if (modeToSet === VoicePanelModes.DISMISSED) {
defaultImport = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
wrapperDimensionsBinding = wrapperDimensions;
if (connected) {
defaultImport(wrapperDimensionsBinding, {mode: modeToSet});
} else {
windowDimensionsBinding = windowDimensions;
defaultImport(wrapperDimensionsBinding, {drawerY: windowDimensionsBinding.get().height + 60,
mode: modeToSet});
}
}
} else if (pipState.id != null) {
value4 = value == null;
if (value4) {
r9 = value4;
} else {
r1 = windowHeight === value.windowHeight && windowWidth === value.windowWidth;
r1 = r1 && safeArea.top === value.safeArea.top;
r1 = r1 && safeArea.bottom === value.safeArea.bottom;
r1 = r1 && safeArea.left === value.safeArea.left;
r1 = r1 && safeArea.right === value.safeArea.right;
r9 = r1;
}
value10 = wrapperDimensions.get();
value10.drawerX;
value10.drawerY;
value11 = windowHeight - globalStatusIndicatorHeight;
if (modeToSet === VoicePanelModes.PANEL) {
if (connected) {
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperDimensions,
{drawerWidth: windowWidth, drawerHeight: value11, drawerX: 0, drawerY: 0, animated: r9,
mode: modeToSet});
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env0_0,
{gestureActive: false});
} else {
maxPanelWidth = (require(15432) /* metro dependency 15432: PanelSizeUtils */).getMaxPanelWidth({windowWidth: windowWidth,
connected: connected, safeAreaLeft: safeArea.left, safeAreaRight: safeArea.right});
panelX = (require(15432) /* metro dependency 15432: PanelSizeUtils */).getPanelX(windowWidth,
maxPanelWidth);
defaultImport2 = importDefault(11624) /* metro dependency 11624: roundToNearestPixel */;
Math = global.Math;
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperDimensions,
{drawerWidth: maxPanelWidth, drawerHeight: value11, drawerX: panelX,
drawerY: defaultImport2(Math.max(value11 - preJoinContentSize - controlsHeight - safeArea.bottom,
value11 - 0.8 * value11)), animated: r9, mode: modeToSet});
}
} else if (modeToSet === VoicePanelModes.DISMISSED) {
defaultImport = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
wrapperDimensionsBinding = wrapperDimensions;
if (connected) {
defaultImport(wrapperDimensionsBinding, {mode: modeToSet});
} else {
windowDimensionsBinding = windowDimensions;
defaultImport(wrapperDimensionsBinding, {drawerY: windowDimensionsBinding.get().height + 60,
mode: modeToSet});
}
}
}
}
return value3;
}
function useWrapperStylesC() { // fn#118179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:23342, owner: AnimatedWrapper.useWrapperStyles.C, offset: 0x024cf7e0, size: 424 bytes, params: 1, frame: 27
var r8;
var r14;
var Math;
var max;
var value6;
var value7;
let get = useReducedMotion.get;
let r9 = !Reflect.apply(get, useReducedMotion, []) && wrapperDimensions.get().animated;
r9 = !r9 ? env0_0.get().gestureActive : r9;
let binding = env0_0;
get = binding.get;
const gestureActive = Reflect.apply(get, binding, []).gestureActive;
const {drawerY, drawerX} = wrapperDimensions.get();
if (gestureActive && !connected.get()) {
Math = global.Math;
max = Math.max;
binding = env0_0;
get = binding.get;
value6 = drawerY + Reflect.apply(max, Math, [Reflect.apply(get, binding, []).y, 0]);
get = binding.get;
value7 = drawerX + Reflect.apply(get, binding, []).x;
r8 = value6;
r14 = value7;
} else {
r8 = drawerY;
r14 = drawerX;
}
const value8 = _fun118180();
const springModule = require(4577) /* metro dependency 4577: spring */;
let withSpring = springModule.withSpring;
binding = env0_0;
get = binding.get;
const r4 = Reflect.apply(get, binding, []).gestureActive ? DRAWER_SPRING_PHYSICS_GESTURE_ACTIVE : env2_29;
const value10 = 'animate-never';
const items2 = [{translateX: Reflect.apply(withSpring, springModule, [r14, r4, r9 ? 'animate-always' : value10,
value8])}];
const moduleValue2 = springModule;
withSpring = moduleValue2.withSpring;
binding = env0_0;
get = binding.get;
items2[1] = {translateY: Reflect.apply(withSpring, moduleValue2, [r8, Reflect.apply(get, binding,
[]).gestureActive ? DRAWER_SPRING_PHYSICS_GESTURE_ACTIVE : env2_29, r9 ? 'animate-always' : value10, value8])};
return {transform: items2};
}
function useWrapperStylesM() { // fn#118182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:24485, owner: AnimatedWrapper.useWrapperStyles.M, offset: 0x024cfa71, size: 214 bytes, params: 1, frame: 18
const value = environment.__proto__.__proto__;
const binding = env2_56;
let object2 = {};
const modeBinding = mode;
let get = modeBinding.get;
object2.mode = Reflect.apply(get, modeBinding, []);
object2.connected = connected.get();
const value3 = binding(object2);
object2 = {};
const wrapperDimensionsBinding = wrapperDimensions;
get = wrapperDimensionsBinding.get;
object2.width = Reflect.apply(get, wrapperDimensionsBinding, []).drawerWidth;
get = wrapperDimensionsBinding.get;
object2.height = Reflect.apply(get, wrapperDimensionsBinding, []).drawerHeight;
object2.borderRadius = (require(4577) /* metro dependency 4577: spring */).withSpring(value3, BORDER_RADIUS_PHYSICS);
const value4 = modeBinding.get();
const PANEL = VoicePanelModes.PANEL;
object2.pointerEvents = value4 !== PANEL ? 'none' : 'auto';
object2.backgroundColor = connected.get() ? 'transparent' : styles.maskDefaultBackground.backgroundColor;
return object2;
}
function useWrapperStylesY(a0) { // fn#118184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:25127, owner: AnimatedWrapper.useWrapperStyles.y, offset: 0x024cfb47, size: 75 bytes, params: 2, frame: 14
let value = environment.__proto__.__proto__;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = reanimatedRexportModule.runOnJS(log_118173);
const JSON = global.JSON;
value('Window dimensions changed:', JSON.stringify(a0));
}
function useWrapperStylesT(a0) { // fn#118186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:25437, owner: AnimatedWrapper.useWrapperStyles.T, offset: 0x024cfb92, size: 75 bytes, params: 2, frame: 14
let value = environment.__proto__.__proto__;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = reanimatedRexportModule.runOnJS(log_118173);
const JSON = global.JSON;
value('Wrapper dimensions changed:', JSON.stringify(a0));
}
function _fun118187() { // fn#118187, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:25629, offset: 0x024cfbdd, size: 40 bytes, params: 1, frame: 3
return {wrapperRootStyles: styles.wrapper, wrapperTransformStyles: env0_14, wrapperSurfaceStyles: env0_15};
}
function _fun118200() { // fn#118200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:27393, offset: 0x024d06bb, size: 160 bytes, params: 1, frame: 15
var environment;
var value2;
var state;
var setChannelPanelFullscreen;
var value4;
var channelIdBinding;
var binding;
var value;
if (env0_0) {
value = environment.__proto__;
env1_2.current = global.setTimeout(_fun118201, 1000);
} else {
value2 = environment.__proto__.__proto__;
state = VoicePanelStore.getState();
setChannelPanelFullscreen = state.setChannelPanelFullscreen;
value4 = environment.__proto__;
channelIdBinding = channelId;
binding = env0_0;
Reflect.apply(setChannelPanelFullscreen, state, [channelIdBinding, binding]);
AppFreezeStore.getState().requestFreezeLock({lockEnabled: binding,
key: 'voice-panel-freeze-' + channelIdBinding});
}
}
function _fun118203() { // fn#118203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:27713, offset: 0x024d07d1, size: 29 bytes, params: 1, frame: 11
global.clearTimeout(env1_2.current);
}
function usePanelGestureF() { // fn#118206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:28556, owner: VoicePanelUI.usePanelGesture.f, offset: 0x024d0f09, size: 66 bytes, params: 1, frame: 11
const object2 = {};
const binding = env0_29;
const get = binding.get;
object2.gestureActive = Reflect.apply(get, binding, []).active;
object2.connected = connected.get();
object2.mode = mode.get();
return object2;
}
function usePanelGestureH(a0, a1) { // fn#118207, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:28724, owner: VoicePanelUI.usePanelGesture.h, offset: 0x024d0f4b, size: 400 bytes, params: 3, frame: 17
var gestureActive;
var connected;
var mode;
let value = a1;
const value3 = undefined;
const cheapWorkletShallowEqualModule = require(7739) /* metro dependency 7739: cheapWorkletShallowEqual */;
if (!cheapWorkletShallowEqualModule.cheapWorkletShallowEqual(a0, value ?? value3)) {
gestureActive = a0.gestureActive;
connected = a0.connected;
mode = a0.mode;
if (connected) {
if (gestureActive) {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(setPanelFullscreen);
value(false);
} else if (mode !== VoicePanelModes.PANEL) {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(setPanelFullscreen);
value(false);
} else {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(setPanelFullscreen);
value(true);
}
} else {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(setPanelFullscreen);
value(false);
}
if (mode === VoicePanelModes.PANEL) {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(setPanelOpen);
value(true);
} else {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(setPanelOpen);
value(false);
}
if (mode === VoicePanelModes.PIP) {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(setPanelPIP);
value(true);
} else {
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value = value.runOnJS(setPanelPIP);
value(false);
}
}
return value3;
}
function _fun118208(a0) { // fn#118208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:29272, offset: 0x024d10db, size: 68 bytes, params: 2, frame: 15
var r0;
var isActivityParticipantBinding;
let value = a0 != null;
if (value) {
value = environment.__proto__.__proto__;
isActivityParticipantBinding = isActivityParticipant;
value = ChannelRTCStore.getParticipant(channelId, a0);
value = isActivityParticipantBinding(value);
r0 = value;
} else {
r0 = value;
}
env0_26(!r0);
}
function usePanelGestureMe() { // fn#118209, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:29364, owner: VoicePanelUI.usePanelGesture.me, offset: 0x024d111f, size: 69 bytes, params: 1, frame: 12
var r0;
var value;
const value2 = mode.get();
const PANEL = VoicePanelModes.PANEL;
const value4 = undefined;
if (value2 !== PANEL) {
r0 = value4;
} else {
value = focused.get();
r0 = value == null ? value4 : value.id;
}
return r0;
}
function we(a0, a1) { // fn#118210, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:29542, owner: VoicePanelUI.usePanelGesture.we, offset: 0x024d1164, size: 61 bytes, params: 3, frame: 13
var value;
if (a0 !== a1) {
value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
value.runOnJS(env0_30)(a0);
}
}
function _fun118211() { // fn#118211, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:29735, offset: 0x024d11a1, size: 1376 bytes, params: 1, frame: 34
var object2;
const Gesture = (require(5321) /* metro dependency 5321 */).Gesture;
const Race = Gesture.Race;
const Gesture2 = (require(5321) /* metro dependency 5321 */).Gesture;
const value2 = Gesture2.Tap();
const hitSlop = value2.hitSlop;
let binding = env0_20;
const value4 = Reflect.apply(hitSlop, value2, [{left: -1 * binding.left, right: -1 * binding.right}]);
const enabled = value4.enabled;
const binding2 = env0_25;
const value6 = Reflect.apply(enabled, value4, [binding2]).maxDistance(30);
const onStart = value6.onStart;
let closure = h_118212;
object2 = {};
const connectedBinding = connected;
object2.connected = connectedBinding;
const modeBinding = mode;
object2.mode = modeBinding;
object2.VoicePanelModes = VoicePanelModes;
const controlsSpecsBinding = controlsSpecs;
object2.controlsSpecs = controlsSpecsBinding;
object2.VoicePanelControlsModes = VoicePanelControlsModes;
const runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.runOnJS = runOnJS;
object2.showControls = showControls;
object2.hideControls = hideControls;
closure.__closure = object2;
closure.__workletHash = 15350003421175;
closure.__initData = env2_39;
const value7 = Reflect.apply(onStart, value6, [closure]);
const Gesture3 = (require(5321) /* metro dependency 5321 */).Gesture;
const value12 = Gesture3.Pan().enabled(binding2).manualActivation(true).maxPointers(1).hitSlop({left: -1 * binding.left,
right: -1 * binding.right});
const value14 = value12.withRef(dismissToPIPGestureRef).shouldCancelWhenOutside(false).simultaneousWithExternalGesture(env0_27);
const onTouchesDown = value14.onTouchesDown;
closure = S_118213;
const windowDimensionsBinding = windowDimensions;
const safeAreaBinding = safeArea;
binding = env0_29;
closure.__closure = {IS_IOS: IS_IOS, windowDimensions: windowDimensionsBinding, safeArea: safeAreaBinding,
gestureState: binding, isFocusedVideoZoomed: isFocusedVideoZoomed, mode: modeBinding,
VoicePanelModes: VoicePanelModes, controlsSpecs: controlsSpecsBinding,
VoicePanelControlsModes: VoicePanelControlsModes};
closure.__workletHash = 13538548264193;
closure.__initData = env2_46;
const value15 = Reflect.apply(onTouchesDown, value14, [closure]);
const onBegin = value15.onBegin;
closure = u_118214;
object2 = {gestureState: binding};
object2.updateSharedValueIfChanged = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
const wrapperOffsetBinding = wrapperOffset;
object2.wrapperOffset = wrapperOffsetBinding;
object2.connected = connectedBinding;
object2.mode = modeBinding;
object2.VoicePanelModes = VoicePanelModes;
closure.__closure = object2;
closure.__workletHash = 11622638269935;
closure.__initData = env2_45;
const value16 = Reflect.apply(onBegin, value15, [closure]);
const onTouchesMove = value16.onTouchesMove;
closure = c_118215;
object2 = {};
const State = (require(5321) /* metro dependency 5321 */).State;
object2.State = State;
object2.gestureState = binding;
object2.mode = modeBinding;
object2.VoicePanelModes = VoicePanelModes;
const scrollPositionBinding = scrollPosition;
object2.scrollPosition = scrollPositionBinding;
object2.isQuest = env2_34;
object2.MIN_GESTURE_MOVE = 10;
object2.focused = focused;
object2.runOnJS = runOnJS;
object2.triggerIOSHaptic = importDefault(15446) /* metro dependency 15446: triggerIOSHaptic */;
object2.updateSharedValueIfChanged = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
object2.wrapperOffset = wrapperOffsetBinding;
const binding3 = env0_22;
object2.lockScrolling = binding3;
closure.__closure = object2;
closure.__workletHash = 262321069191;
closure.__initData = env2_44;
const value17 = Reflect.apply(onTouchesMove, value16, [closure]);
const onChange = value17.onChange;
closure = l_118216;
object2 = {gestureState: binding, mode: modeBinding};
object2.VoicePanelModes = VoicePanelModes;
object2.connected = connectedBinding;
object2.lockScrolling = binding3;
object2.scrollPosition = scrollPositionBinding;
object2.POP_RESISTANCE = POP_RESISTANCE;
object2.PIP_POP_HEIGHT = 180;
object2.runOnJS = runOnJS;
object2.triggerHapticFeedback = (require(4081) /* metro dependency 4081: HapticUtilsNative */).triggerHapticFeedback;
const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes;
object2.HapticFeedbackTypes = HapticFeedbackTypes;
object2.updateSharedValueIfChanged = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
object2.wrapperOffset = wrapperOffsetBinding;
closure.__closure = object2;
closure.__workletHash = 2084376677229;
closure.__initData = env2_43;
const value18 = Reflect.apply(onChange, value17, [closure]);
const onTouchesCancelled = value18.onTouchesCancelled;
closure = s_118217;
closure.__closure = {lockScrolling: binding3,
updateSharedValueIfChanged: importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */,
gestureState: binding, wrapperOffset: wrapperOffsetBinding};
closure.__workletHash = 8529626440714;
closure.__initData = env2_42;
const value19 = Reflect.apply(onTouchesCancelled, value18, [closure]);
const onEnd = value19.onEnd;
closure = n_118218;
object2 = {gestureState: binding, mode: modeBinding};
object2.VoicePanelModes = VoicePanelModes;
object2.calculatePIPPositionFromVelocity = (require(15439) /* metro dependency 15439: VoicePanelPIPUtils */).calculatePIPPositionFromVelocity;
object2.windowDimensions = windowDimensionsBinding;
object2.safeArea = safeAreaBinding;
object2.updateSharedValueIfChanged = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
object2.wrapperDimensions = wrapperDimensions;
object2.wrapperOffset = wrapperOffsetBinding;
object2.connected = connectedBinding;
object2.runOnJS = runOnJS;
object2.setMode = setMode;
object2.lockScrolling = binding3;
object2.MIN_DISMISS_MOVE_PERCENTAGE = 0.2;
object2.dismissPanel = dismissPanel;
closure.__closure = object2;
closure.__workletHash = 10532794222556;
closure.__initData = env2_41;
const value20 = Reflect.apply(onEnd, value19, [closure]);
const onFinalize = value20.onFinalize;
closure = t_118219;
closure.__closure = {updateSharedValueIfChanged: importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */,
gestureState: binding};
closure.__workletHash = 141147937726;
closure.__initData = env2_40;
return Reflect.apply(Race, Gesture, [value7, Reflect.apply(onFinalize, value20, [closure])]);
}
function usePanelGestureOnScroll(a0) { // fn#118223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:35235, owner: VoicePanelUI.usePanelGesture.onScroll, offset: 0x024d229e, size: 389 bytes, params: 2, frame: 20
var r4;
var scrollPositionBinding;
var contentOffset;
var y;
var value4;
var value5;
var windowDimensionsBinding;
var height;
var binding2;
var set;
var value7;
var value9;
var Math;
var value11;
let binding = env0_22;
let get = binding.get;
if (Reflect.apply(get, binding, [])) {
binding = env0_23;
if (binding.get()) {
return undefined;
}
if (scrollPosition.get() < 0) {
scrollPosition.set(0);
}
value9 = scrollPosition.get();
Math = global.Math;
if (Math.abs(a0.contentOffset.y - value9) < 0.1) {
return undefined;
}
binding = env0_23;
binding.set(true);
value11 = environment.__proto__.__proto__;
(require(4017) /* metro dependency 4017: ReanimatedRexport */).scrollTo(env0_28, 0, value9, false);
binding.set(false);
} else {
var value2 = scrollPosition.get();
contentOffset = a0.contentOffset;
y = contentOffset.y;
if (value2 === y) {
r4 = undefined;
} else {
value4 = environment.__proto__.__proto__;
binding = env2_31;
value5 = scrollPosition.get();
windowDimensionsBinding = windowDimensions;
get = windowDimensionsBinding.get;
height = Reflect.apply(get, windowDimensionsBinding, []).height;
binding2 = env0_21;
get = binding2.get;
r4 = binding(value5, height, Reflect.apply(get, binding2, []));
}
scrollPositionBinding = scrollPosition;
set = scrollPositionBinding.set;
contentOffset = a0.contentOffset;
y = contentOffset.y;
Reflect.apply(set, scrollPositionBinding, [y]);
if (r4 != null) {
value7 = environment.__proto__.__proto__;
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env0_24, r4);
}
}
}
function usePanelGestureDe(a0, a1) { // fn#118225, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:35952, owner: VoicePanelUI.usePanelGesture.De, offset: 0x024d2423, size: 111 bytes, params: 3, frame: 12
let value = a1 != null;
if (value && a0 !== a1) {
value = environment.__proto__.__proto__;
if (a0 !== VoicePanelModes.PANEL) {
if (a0 === VoicePanelModes.PIP) {
env0_22.set(true);
}
} else if (a1 === VoicePanelModes.PIP) {
env0_22.set(false);
} else if (a0 === VoicePanelModes.PIP) {
env0_22.set(true);
}
}
}
function usePanelGestureMe_118226() { // fn#118226, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:36248, owner: VoicePanelUI.usePanelGesture.Me, offset: 0x024d2492, size: 210 bytes, params: 1, frame: 16
const modeBinding = mode;
let get = modeBinding.get;
const value2 = Reflect.apply(get, modeBinding, []);
const PIP = VoicePanelModes.PIP;
const value4 = value2 === PIP;
const r1 = value4 || focused.get() != null;
const object3 = {};
object3.pointerEvents = value4 ? 'none' : 'auto';
const value9 = !r1;
object3.scrollEnabled = value9;
object3.showsVerticalScrollIndicator = !env0_22.get() && value9;
const object4 = {};
const defaultImport = importDefault(11799) /* metro dependency 11799: calculateVoicePanelHeaderSpecs */;
const safeAreaBinding = safeArea;
const height = defaultImport(safeAreaBinding.get(), env0_31).height;
get = safeAreaBinding.get;
object4.top = height - Reflect.apply(get, safeAreaBinding, []).top;
get = safeAreaBinding.get;
object4.bottom = Reflect.apply(get, safeAreaBinding, []).bottom;
object3.scrollIndicatorInsets = object4;
return object3;
}
function _fun118227(a0, a1) { // fn#118227, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:36688, offset: 0x024d2564, size: 24 bytes, params: 3, frame: 11
env0_21.set(a1);
}
function Te() { // fn#118228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:36745, owner: VoicePanelUI.usePanelGesture.Te, offset: 0x024d257c, size: 259 bytes, params: 1, frame: 16
var binding;
var wrapperDimensionsBinding;
var drawerY;
var wrapperOffsetBinding;
var gestureActive;
var value4;
var value5;
var windowDimensionsBinding;
var height;
var Math;
const modeBinding = mode;
let get = modeBinding.get;
const value2 = Reflect.apply(get, modeBinding, []);
const PIP = VoicePanelModes.PIP;
if (PIP === value2) {
return 0;
}
const DISMISSED = VoicePanelModes.DISMISSED;
if (DISMISSED === value2) {
return 0;
}
const connectedBinding = connected;
get = connectedBinding.get;
if (Reflect.apply(get, connectedBinding, [])) {
binding = env0_29;
get = binding.get;
if (Reflect.apply(get, binding, []).active) {
binding = env0_29;
get = binding.get;
if (Reflect.apply(get, binding, []).requiresPop) {
return 1;
}
wrapperDimensionsBinding = wrapperDimensions;
get = wrapperDimensionsBinding.get;
drawerY = Reflect.apply(get, wrapperDimensionsBinding, []).drawerY;
wrapperOffsetBinding = wrapperOffset;
get = wrapperOffsetBinding.get;
gestureActive = Reflect.apply(get, wrapperOffsetBinding, []).gestureActive;
value4 = 0;
value5 = drawerY + (gestureActive ? wrapperOffset.get().y : value4);
windowDimensionsBinding = windowDimensions;
get = windowDimensionsBinding.get;
height = Reflect.apply(get, windowDimensionsBinding, []).height;
Math = global.Math;
return Math.min(global.Math.max((height - value5) / height, value4), 1);
}
}
wrapperDimensionsBinding = wrapperDimensions;
get = wrapperDimensionsBinding.get;
drawerY = Reflect.apply(get, wrapperDimensionsBinding, []).drawerY;
wrapperOffsetBinding = wrapperOffset;
get = wrapperOffsetBinding.get;
gestureActive = Reflect.apply(get, wrapperOffsetBinding, []).gestureActive;
value4 = 0;
value5 = drawerY + (gestureActive ? wrapperOffset.get().y : value4);
windowDimensionsBinding = windowDimensions;
get = windowDimensionsBinding.get;
height = Reflect.apply(get, windowDimensionsBinding, []).height;
Math = global.Math;
const min = Math.min;
const Math2 = global.Math;
return Reflect.apply(min, Math, [Math2.max((height - value5) / height, value4), 1]);
}
function _fun118180() { // fn#118180, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:23530, offset: 0x024cf988, size: 126 bytes, params: 1, frame: 15
const closure = VoicePanelUITsx29;
const object2 = {};
object2.mode = mode;
object2.VoicePanelModes = VoicePanelModes;
object2.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
object2.updateSourceTrackingView = (importDefault(10684) /* metro dependency 10684: ExternalPipAndroid */).updateSourceTrackingView;
closure.__closure = object2;
closure.__workletHash = 10394717541764;
closure.__initData = env3_61;
return closure;
}
function _fun118201() { // fn#118201, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:27422, offset: 0x024d075b, size: 107 bytes, params: 1, frame: 15
const value = environment.__proto__.__proto__.__proto__;
const state = VoicePanelStore.getState();
const setChannelPanelFullscreen = state.setChannelPanelFullscreen;
const channelIdBinding = channelId;
const binding = env1_0;
Reflect.apply(setChannelPanelFullscreen, state, [channelIdBinding, binding]);
AppFreezeStore.getState().requestFreezeLock({lockEnabled: binding, key: 'voice-panel-freeze-' + channelIdBinding});
}
function h_118212() { // fn#118212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:29875, offset: 0x024d1701, size: 193 bytes, params: 1, frame: 14
var value2;
var value3;
var controlsSpecsBinding;
var moduleValue;
var moduleValue2;
const value = environment.__proto__;
const connectedBinding = connected;
const get = connectedBinding.get;
if (Reflect.apply(get, connectedBinding, [])) {
value2 = mode.get();
value3 = environment.__proto__.__proto__.__proto__;
if (value2 !== VoicePanelModes.PIP) {
controlsSpecsBinding = controlsSpecs;
if (controlsSpecsBinding.get().mode === VoicePanelControlsModes.HIDDEN) {
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue2.runOnJS(showControls)({debounce: true});
} else {
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.runOnJS(hideControls)({debounce: true});
}
}
}
}
function S_118213({allTouches}, a1) { // fn#118213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:30413, offset: 0x024d17c2, size: 291 bytes, params: 3, frame: 17
var r7;
var r4;
var r3;
var absoluteY;
var value2;
var windowDimensionsBinding;
var get;
var height;
var safeAreaBinding;
var value3;
var value4;
var value6;
var controlsSpecsBinding;
var binding;
var set;
var object2;
const property = allTouches[0];
const value = environment.__proto__.__proto__.__proto__;
if (IS_IOS) {
if (property == null) {
value3 = environment.__proto__;
value4 = isFocusedVideoZoomed.get();
if (value4) {
r3 = value4;
} else {
value6 = mode.get() === VoicePanelModes.PANEL;
if (value6) {
controlsSpecsBinding = controlsSpecs;
r4 = controlsSpecsBinding.get().mode === VoicePanelControlsModes.DRAWER;
r7 = controlsSpecsBinding;
} else {
r4 = value6;
}
r3 = r4;
}
if (r3) {
binding = env1_29;
set = binding.set;
object2 = {};
copyDataProperties(object2, binding.get(), r7);
object2['cancel'] = true;
Reflect.apply(set, binding, [object2]);
a1.fail();
}
return undefined;
}
absoluteY = property.absoluteY;
value2 = environment.__proto__;
windowDimensionsBinding = windowDimensions;
get = windowDimensionsBinding.get;
height = Reflect.apply(get, windowDimensionsBinding, []).height;
safeAreaBinding = safeArea;
get = safeAreaBinding.get;
if (absoluteY > height - Reflect.apply(get, safeAreaBinding, []).bottom) {
binding = env1_29;
set = binding.set;
object2 = {};
copyDataProperties(object2, binding.get(), r7);
object2['cancel'] = true;
Reflect.apply(set, binding, [object2]);
a1.activate();
return undefined;
}
value3 = environment.__proto__;
}
value4 = isFocusedVideoZoomed.get();
if (value4) {
r3 = value4;
} else {
value6 = mode.get() === VoicePanelModes.PANEL;
if (value6) {
controlsSpecsBinding = controlsSpecs;
r4 = controlsSpecsBinding.get().mode === VoicePanelControlsModes.DRAWER;
r7 = controlsSpecsBinding;
} else {
r4 = value6;
}
r3 = r4;
}
if (r3) {
binding = env1_29;
set = binding.set;
object2 = {};
copyDataProperties(object2, binding.get(), r7);
object2['cancel'] = true;
Reflect.apply(set, binding, [object2]);
a1.fail();
}
}
function u_118214(a0) { // fn#118214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:30882, offset: 0x024d18e5, size: 178 bytes, params: 2, frame: 16
var r3;
var value2;
var set;
var object2;
var value3;
let value = environment.__proto__;
let binding = env1_29;
const get = binding.get;
if (!Reflect.apply(get, binding, []).cancel) {
value2 = environment.__proto__.__proto__.__proto__;
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperOffset, {'x': 0,
'y': 0});
binding = env1_29;
set = binding.set;
object2 = {};
object2.absoluteXStart = a0.absoluteX;
object2.absoluteYStart = a0.absoluteY;
object2.active = false;
object2.cancel = false;
value3 = connected.get();
if (value3) {
value = mode.get();
value = value === VoicePanelModes.PANEL;
r3 = value;
} else {
r3 = value3;
}
object2.requiresPop = r3;
Reflect.apply(set, binding, [object2]);
}
}
function c_118215(a0, a1) { // fn#118215, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:31245, offset: 0x024d1997, size: 681 bytes, params: 3, frame: 26
var r5;
var r6;
var r3;
var value3;
var binding;
var get;
var property;
var absoluteY;
var absoluteX;
var value4;
var value5;
var Math;
var max;
var abs;
var value6;
var Math3;
var value7;
var value8;
var moduleValue;
var floor;
var scrollPositionBinding;
var value18;
var value20;
var object2;
var set;
const state = a0.state;
let value = environment.__proto__.__proto__.__proto__;
const value2 = undefined;
const State = (require(5321) /* metro dependency 5321 */).State;
const BEGAN = State.BEGAN;
if (state === BEGAN) {
value3 = environment.__proto__;
binding = env1_29;
get = binding.get;
if (!Reflect.apply(get, binding, []).active) {
binding = env1_29;
get = binding.get;
if (!Reflect.apply(get, binding, []).cancel) {
property = a0.changedTouches[0];
absoluteY = property.absoluteY;
absoluteX = property.absoluteX;
binding = env1_29;
get = binding.get;
value4 = Reflect.apply(get, binding, []).absoluteYStart - absoluteY;
get = binding.get;
value5 = Reflect.apply(get, binding, []).absoluteXStart - absoluteX;
Math = global.Math;
max = Math.max;
value6 = global.Math.abs(value4);
Math3 = global.Math;
abs = Math3.abs;
value7 = Reflect.apply(max, Math, [value6, Reflect.apply(abs, Math3, [value5])]);
Math = global.Math;
value8 = Math.abs(value5);
Math = global.Math;
abs = Math.abs;
r5 = value8 >= Reflect.apply(abs, Math, [value4]) || value4 > 0;
if (mode.get() === VoicePanelModes.PANEL) {
Math = global.Math;
floor = Math.floor;
scrollPositionBinding = scrollPosition;
if (value4 < 0) {
if (Reflect.apply(floor, Math, [scrollPositionBinding.get()]) <= 0) {
binding = env3_34;
r3 = binding ? value7 > 10 : !binding;
} else {
value18 = focused.get();
r6 = (value18 == null ? value2 : value18.id) != null && r5;
value20 = false;
if (r6) {
a1.fail();
r3 = value20;
} else {
r3 = value20;
}
}
} else {
value18 = focused.get();
r6 = (value18 == null ? value2 : value18.id) != null && r5;
value20 = false;
if (r6) {
a1.fail();
r3 = value20;
} else {
r3 = value20;
}
}
} else if (mode.get() === VoicePanelModes.PIP && value7 > 10) {
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.runOnJS(importDefault(15446) /* metro dependency 15446: triggerIOSHaptic */)();
r3 = true;
} else {
r3 = false;
}
value = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
if (r3) {
value(wrapperOffset, {gestureActive: true});
binding = env1_29;
set = binding.set;
object2 = {absoluteXStart: absoluteX};
scrollPositionBinding = scrollPosition;
get = scrollPositionBinding.get;
object2.absoluteYStart = absoluteY + Reflect.apply(get, scrollPositionBinding, []);
object2.cancel = false;
object2.active = true;
get = binding.get;
object2.requiresPop = Reflect.apply(get, binding, []).requiresPop;
Reflect.apply(set, binding, [object2]);
binding = env1_22;
binding.set(true);
a1.activate();
} else {
value(env1_29, {absoluteYStart: absoluteY, absoluteXStart: absoluteX});
}
}
}
}
return value2;
}
function l_118216(a0) { // fn#118216, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:32226, offset: 0x024d1c40, size: 648 bytes, params: 2, frame: 21
var r3;
var r4;
var value2;
var value3;
var defaultImport;
var wrapperOffsetBinding;
var object2;
var value4;
var value5;
var set;
var value12;
var moduleValue;
let binding = env1_29;
let get = binding.get;
if (!Reflect.apply(get, binding, []).cancel) {
value2 = mode.get();
value3 = environment.__proto__.__proto__.__proto__;
if (value2 !== VoicePanelModes.PIP) {
binding = env1_29;
get = binding.get;
value4 = -1 * (Reflect.apply(get, binding, []).absoluteYStart - a0.absoluteY);
value5 = connected.get();
if (value5) {
binding = env1_29;
r3 = !binding.get().requiresPop;
} else {
r3 = value5;
}
r3 = r3 && value4 <= 0;
if (r3) {
binding = env1_29;
set = binding.set;
object2 = {};
copyDataProperties(object2, binding.get(), undefined);
object2['requiresPop'] = true;
Reflect.apply(set, binding, [object2]);
}
binding = env1_22;
get = binding.get;
if (Reflect.apply(get, binding, [])) {
if (value4 < 0) {
env1_22.set(false);
} else if (!env1_22.get() && scrollPosition.get() <= 0) {
env1_22.set(true);
}
} else if (!env1_22.get() && scrollPosition.get() <= 0) {
env1_22.set(true);
}
binding = env1_29;
get = binding.get;
if (Reflect.apply(get, binding, []).requiresPop) {
value12 = global.Math.max(value4, 0);
if (value12 <= 180) {
r4 = value12 - value12 * POP_RESISTANCE;
} else {
binding = env1_29;
set = binding.set;
object2 = {};
copyDataProperties(object2, binding.get(), undefined);
object2['requiresPop'] = false;
Reflect.apply(set, binding, [object2]);
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.runOnJS((require(4081) /* metro dependency 4081: HapticUtilsNative */).triggerHapticFeedback)((require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes.IMPACT_MEDIUM);
r4 = value4;
}
} else {
r4 = value4;
}
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperOffset, {y: r4,
x: 0});
} else {
defaultImport = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
wrapperOffsetBinding = wrapperOffset;
object2 = {};
binding = env1_29;
get = binding.get;
object2.x = -1 * (Reflect.apply(get, binding, []).absoluteXStart - a0.absoluteX);
get = binding.get;
object2.y = -1 * (Reflect.apply(get, binding, []).absoluteYStart - a0.absoluteY);
defaultImport(wrapperOffsetBinding, object2);
}
}
}
function s_118217() { // fn#118217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:33162, offset: 0x024d1ec8, size: 92 bytes, params: 1, frame: 18
env1_22.set(false);
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env1_29, {'cancel': false,
'active': false});
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperOffset,
{gestureActive: false});
}
function n_118218(a0) { // fn#118218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:33406, offset: 0x024d1f24, size: 789 bytes, params: 2, frame: 21
var velocityX;
var velocityY;
var absoluteX;
var absoluteY;
var value2;
var value3;
var wrapperOffsetBinding;
var connectedBinding;
var wrapperDimensionsBinding;
var drawerHeight;
var value5;
var object2;
var moduleValue;
var moduleValue2;
var moduleValue3;
var calculatePIPPositionFromVelocity;
var value7;
let binding = env1_29;
let get = binding.get;
if (!Reflect.apply(get, binding, []).cancel) {
velocityX = a0.velocityX;
velocityY = a0.velocityY;
absoluteX = a0.absoluteX;
absoluteY = a0.absoluteY;
value2 = mode.get();
value3 = environment.__proto__.__proto__.__proto__;
if (value2 === VoicePanelModes.PIP) {
moduleValue3 = require(15439) /* metro dependency 15439: VoicePanelPIPUtils */;
calculatePIPPositionFromVelocity = moduleValue3.calculatePIPPositionFromVelocity;
object2 = {velocityX: velocityX, velocityY: velocityY, absoluteX: absoluteX, absoluteY: absoluteY};
object2.windowDimensions = windowDimensions.get();
object2.safeArea = safeArea.get();
value7 = Reflect.apply(calculatePIPPositionFromVelocity, moduleValue3, [object2]);
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperDimensions,
{pipX: value7.pipX, pipY: value7.pipY});
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperOffset,
{gestureActive: false});
} else if (mode.get() === VoicePanelModes.PANEL) {
if (velocityY > 0) {
connectedBinding = connected;
get = connectedBinding.get;
if (Reflect.apply(get, connectedBinding, [])) {
binding = env1_29;
if (binding.get().requiresPop) {
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperOffset,
{'gestureActive': false, 'x': 0, 'y': 0});
env1_22.set(false);
} else {
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue2.runOnJS(setMode)(VoicePanelModes.PIP);
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperOffset,
{'gestureActive': false, 'x': 0, 'y': 0});
}
} else {
wrapperDimensionsBinding = wrapperDimensions;
get = wrapperDimensionsBinding.get;
drawerHeight = Reflect.apply(get, wrapperDimensionsBinding, []).drawerHeight;
get = wrapperDimensionsBinding.get;
value5 = drawerHeight - Reflect.apply(get, wrapperDimensionsBinding, []).drawerY;
wrapperOffsetBinding = wrapperOffset;
get = wrapperOffsetBinding.get;
if (Reflect.apply(get, wrapperOffsetBinding, []).y > 0.2 * value5) {
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperOffset,
{gestureActive: false});
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.runOnJS(dismissPanel)();
} else {
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperOffset,
{'gestureActive': false, 'x': 0, 'y': 0});
env1_22.set(false);
}
}
} else {
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(wrapperOffset,
{'gestureActive': false, 'x': 0, 'y': 0});
env1_22.set(false);
}
}
}
}
function t_118219() { // fn#118219, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:34551, offset: 0x024d2239, size: 50 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__.__proto__;
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(env1_29, {'cancel': false,
'active': false});
}
function VoicePanelUITsx29(a0) { // fn#118181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15642:23565, offset: 0x024cfa06, size: 107 bytes, params: 2, frame: 14
var r0;
var value2;
var moduleValue;
let value = a0;
if (value) {
value = environment.__proto__.__proto__;
value = mode.get();
value2 = environment.__proto__.__proto__.__proto__.__proto__;
value = value !== VoicePanelModes.DISMISSED;
r0 = value;
} else {
r0 = value;
}
if (r0) {
value = environment.__proto__.__proto__.__proto__.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
moduleValue.runOnJS((importDefault(10684) /* metro dependency 10684: ExternalPipAndroid */).updateSourceTrackingView)();
}
}