511 lines
38 KiB
TypeScript
511 lines
38 KiB
TypeScript
/* Metro module 15316; source: modules/launchpad/native/useLaunchPadGesture.tsx; dependencies: [31, 11324, 4007, 1585, 5321, 477, 14283, 11282, 4017, 4081, 2] */
|
|
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
|
|
import UpdateSharedValueIfChangedNative from '../../reanimated/utils/updateSharedValueIfChanged.native.tsx'; /* Metro dependency 11282 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as PlatformUtilsModule from '../../../utils/PlatformUtils.tsx'; /* Metro dependency 477 */
|
|
import * as NavigationRouteUtilsNativeModule from '../../main_tabs_v2/helpers/NavigationRouteUtils.native.tsx'; /* Metro dependency 4007 */
|
|
import * as HapticUtilsNativeModule from '../../haptics/HapticUtils.native.tsx'; /* Metro dependency 4081 */
|
|
import * as Module05321Module from '../../../by-id/module-05321.js'; /* Metro dependency 5321 */
|
|
import * as LaunchPadConstantsModule from './LaunchPadConstants.tsx'; /* Metro dependency 11324 */
|
|
import * as UseWindowDimensionsSharedValueNativeModule from '../../screen/useWindowDimensionsSharedValue.native.tsx'; /* Metro dependency 14283 */
|
|
|
|
function _fun117082(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#117082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15513:6, offset: 0x024a2c40, size: 309 bytes, params: 8, frame: 18
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
object = {code: 'function useLaunchPadGestureTsx1(){const{updateSharedValueIfChanged,gestureState,updaters}=this.__closure;updateSharedValueIfChanged(gestureState,{active:false,initialLaunchPadPosition:0,initialPullTabPosition:0,initialTouchX:0,initialTouchY:0,positionOffsetX:0,positionOffsetY:0,startTime:-1});updaters.setLaunchPadPullTabScale(1.0);}'};
|
|
object = {code: 'function useLaunchPadGestureTsx2(){const{gestureState,updaters,updateSharedValueIfChanged}=this.__closure;const{initialLaunchPadPosition:initialLaunchPadPosition,active:active}=gestureState.get();if(active){if(initialLaunchPadPosition===1){updaters.setLaunchPadPosition(1);}else{updaters.setLaunchPadPosition(0);}}updateSharedValueIfChanged(gestureState,{active:false,initialLaunchPadPosition:0,initialPullTabPosition:0,initialTouchX:0,initialTouchY:0,positionOffsetX:0,positionOffsetY:0,startTime:-1});}'};
|
|
object = {code: 'function useLaunchPadGestureTsx3({velocityX:velocityX,velocityY:velocityY,translationX:translationX,translationY:translationY}){const{gestureState,launchPadType,LaunchPadTypes,LAUNCH_PAD_END_TRANSLATION_THRESHOLD,LAUNCH_PAD_END_VELOCITY_THRESHOLD,updaters,launchPadSharedState}=this.__closure;const{requiresPop:requiresPop,startShown:startShown}=gestureState.get();if(requiresPop){if(!startShown){const isPullTabTapComplete=launchPadType===LaunchPadTypes.PULL_TAB&&Math.abs(translationX)<=LAUNCH_PAD_END_TRANSLATION_THRESHOLD&&Math.abs(translationY)<=LAUNCH_PAD_END_TRANSLATION_THRESHOLD&&Math.abs(velocityX)<=LAUNCH_PAD_END_VELOCITY_THRESHOLD&&Math.abs(velocityY)<=LAUNCH_PAD_END_VELOCITY_THRESHOLD;if(isPullTabTapComplete){updaters.setLaunchPadPosition(1);}else{updaters.setLaunchPadPosition(0);}}else{updaters.setLaunchPadPosition(1);}}else if(Math.abs(velocityX)<LAUNCH_PAD_END_VELOCITY_THRESHOLD){if(launchPadSharedState.get()>=0.5){updaters.setLaunchPadPosition(1);}else{updaters.setLaunchPadPosition(0);}}else if(velocityX>0){updaters.setLaunchPadPosition(0);}else{updaters.setLaunchPadPosition(1);}}'};
|
|
object = {code: 'function useLaunchPadGestureTsx4({translationX:translationX,translationY:translationY,absoluteX:absoluteX}){const{gestureState,getWindowDimensionsWorklet,POP_RESISTANCE,launchPadType,LaunchPadTypes,PIP_POP_DISTANCE,updaters,updateSharedValueIfChanged,runOnJS,triggerHapticFeedback,HapticFeedbackTypes}=this.__closure;if(!gestureState.get().active)return;const{initialTouchX:initialTouchX,requiresPop:requiresPop}=gestureState.get();const{width:windowWidth}=getWindowDimensionsWorklet();const newXOffset=absoluteX-initialTouchX;const distance=Math.max(newXOffset*-1,0);const resistance=distance*POP_RESISTANCE;const positionOffsetX=absoluteX-gestureState.get().initialTouchX;const launchPadPosition=1-(gestureState.get().initialTouchX+translationX-(launchPadType!==LaunchPadTypes.PULL_TAB?40:0))/windowWidth;if(requiresPop&&distance<=PIP_POP_DISTANCE){if(launchPadType!==LaunchPadTypes.PULL_TAB){const a=(distance-resistance)/windowWidth;updaters.setLaunchPadPosition(a);}else{updaters.setLaunchPadPullTabTranslation(translationY);}updateSharedValueIfChanged(gestureState,{positionOffsetX:positionOffsetX});}else{if(requiresPop){updateSharedValueIfChanged(gestureState,{requiresPop:false,positionOffsetX:positionOffsetX});runOnJS(triggerHapticFeedback)(HapticFeedbackTypes.IMPACT_MEDIUM);}else{updateSharedValueIfChanged(gestureState,{positionOffsetX:positionOffsetX});}updaters.setLaunchPadPosition(launchPadPosition);}}'};
|
|
object = {code: 'function useLaunchPadGestureTsx5(event,manager){const{gestureState,State,getWindowDimensionsWorklet,launchPadType,LaunchPadTypes,LAUNCH_PAD_EDGE_GESTURE_AFFORDANCE,LAUNCH_PAD_PULL_TAB_WIDTH,LAUNCH_PAD_PULL_TAB_HIT_SLOP,launchPadPullTabState,LAUNCH_PAD_PULL_TAB_HEIGHT,updaters,LAUNCH_PAD_PULL_TAB_SCALE_FACTOR,launchPadSharedState,MANUAL_ACTIVATION_THRESHOLD}=this.__closure;const{active:active,initialLaunchPadPosition:initialLaunchPadPosition,initialTouchX:initialTouchX,initialTouchY:initialTouchY}=gestureState.get();if(event.state!==State.BEGAN||active)return;const currentTouch=event.changedTouches[0];const{x:x,y:y}=currentTouch;const{width:windowWidth}=getWindowDimensionsWorklet();if(currentTouch==null||launchPadType===LaunchPadTypes.GESTURE_EDGE&&initialLaunchPadPosition===0&&initialTouchX<windowWidth-LAUNCH_PAD_EDGE_GESTURE_AFFORDANCE||launchPadType===LaunchPadTypes.DISABLED){manager.fail();return;}if(launchPadType===LaunchPadTypes.PULL_TAB&&initialLaunchPadPosition===0){const inPullTabX=x>windowWidth-LAUNCH_PAD_PULL_TAB_WIDTH-LAUNCH_PAD_PULL_TAB_HIT_SLOP&&x<windowWidth;const inPullTabY=y>launchPadPullTabState.get().position-LAUNCH_PAD_PULL_TAB_HIT_SLOP&&y<launchPadPullTabState.get().position+LAUNCH_PAD_PULL_TAB_HEIGHT+LAUNCH_PAD_PULL_TAB_HIT_SLOP;if(inPullTabX&&inPullTabY){gestureState.set({...gestureState.get(),initialPullTabPosition:launchPadPullTabState.get().position,active:true});updaters.setLaunchPadPullTabScale(LAUNCH_PAD_PULL_TAB_SCALE_FACTOR);updaters.setLaunchPadShown(true);manager.activate();return;}}if(launchPadType!==LaunchPadTypes.PULL_TAB||launchPadType===LaunchPadTypes.PULL_TAB&&initialLaunchPadPosition>0){const horizontalDistance=x-initialTouchX;const verticalDistance=Math.abs(y-initialTouchY);const hasMovedCorrectDirection=launchPadSharedState.get()>0&&horizontalDistance>0||launchPadSharedState.get()<=0&&horizontalDistance<0;if(hasMovedCorrectDirection&&Math.abs(horizontalDistance)>verticalDistance){if(Math.abs(horizontalDistance)<MANUAL_ACTIVATION_THRESHOLD){return;}gestureState.set({...gestureState.get(),active:true});updaters.setLaunchPadShown(true);manager.activate();return;}}manager.fail();}'};
|
|
object = {code: 'function useLaunchPadGestureTsx6(event){const{gestureState,launchPadSharedState}=this.__closure;const{x:x,y:y}=event.changedTouches[0];gestureState.set({active:false,initialLaunchPadPosition:launchPadSharedState.get(),initialPullTabPosition:0,initialTouchX:x,initialTouchY:y,positionOffsetX:0,positionOffsetY:0,startTime:Date.now(),requiresPop:launchPadSharedState.get()===0,startShown:!(launchPadSharedState.get()===0)});}'};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/launchpad/native/useLaunchPadGesture.tsx');
|
|
exports.default = useLaunchPadGesture;
|
|
function useLaunchPadGesture({launchPadType, launchPadSharedState, launchPadPullTabState, gestureState, updaters}) { // fn#117083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15513:6492, offset: 0x024a2d75, size: 200 bytes, params: 2, frame: 22
|
|
const gestureState2 = gestureState;
|
|
const value2 = (NavigationRouteUtilsNativeModule).useIsModalOpen();
|
|
const value3 = (UseSafeAreaInsetsNative)();
|
|
const binding = gestureState2;
|
|
const value = binding.useRef(undefined);
|
|
const useMemo = binding.useMemo;
|
|
return {gesture: Reflect.apply(useMemo, binding, [_fun117084, [gestureState, value3, value2, launchPadPullTabState,
|
|
launchPadSharedState, launchPadType, updaters]]), gestureRef: value};
|
|
function _fun117084() { // fn#117084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15513:6701, offset: 0x024a2e3d, size: 975 bytes, params: 1, frame: 26
|
|
var environment;
|
|
var value;
|
|
let launchPadTypeBinding = launchPadType;
|
|
let value2 = environment.__proto__;
|
|
const GESTURE_FULL = LaunchPadTypes.GESTURE_FULL;
|
|
const value3 = 0;
|
|
const r6 = launchPadTypeBinding !== GESTURE_FULL ? value3 : -1 * LAUNCH_PAD_EDGE_GESTURE_AFFORDANCE;
|
|
const Gesture = (Module05321Module).Gesture;
|
|
const value5 = Gesture.Pan();
|
|
const enabled = value5.enabled;
|
|
let binding = LaunchPadConstantsModule.LAUNCH_PAD_END_TRANSLATION_THRESHOLD;
|
|
const value11 = Reflect.apply(enabled, value5,
|
|
[!binding && launchPadType !== LaunchPadTypes.DISABLED]).withRef(LaunchPadConstantsModule.LAUNCH_PAD_PULL_TAB_HEIGHT).minDistance(value3).maxPointers(1);
|
|
const manualActivation = value11.manualActivation;
|
|
const value12 = Reflect.apply(manualActivation, value11, [PlatformUtilsModule.isAndroid()]);
|
|
const hitSlop = value12.hitSlop;
|
|
binding = LaunchPadConstantsModule.LAUNCH_PAD_END_VELOCITY_THRESHOLD;
|
|
const value13 = Reflect.apply(hitSlop, value12, [{top: -1 * binding.top, left: value3, bottom: -1 * binding.bottom,
|
|
right: r6}]);
|
|
const onTouchesDown = value13.onTouchesDown;
|
|
let closure = y_117085;
|
|
const gestureStateBinding = gestureState;
|
|
const launchPadSharedStateBinding = launchPadSharedState;
|
|
closure.__closure = {gestureState: gestureStateBinding, launchPadSharedState: launchPadSharedStateBinding};
|
|
closure.__workletHash = 14359599806316;
|
|
closure.__initData = env1_17;
|
|
const value14 = Reflect.apply(onTouchesDown, value13, [closure]);
|
|
const onTouchesMove = value14.onTouchesMove;
|
|
closure = X_117086;
|
|
object = {gestureState: gestureStateBinding};
|
|
const State = (Module05321Module).State;
|
|
object.State = State;
|
|
const getWindowDimensionsWorklet = (UseWindowDimensionsSharedValueNativeModule).getWindowDimensionsWorklet;
|
|
object.getWindowDimensionsWorklet = getWindowDimensionsWorklet;
|
|
launchPadTypeBinding = launchPadType;
|
|
object.launchPadType = launchPadTypeBinding;
|
|
object.LaunchPadTypes = LaunchPadTypes;
|
|
object.LAUNCH_PAD_EDGE_GESTURE_AFFORDANCE = LAUNCH_PAD_EDGE_GESTURE_AFFORDANCE;
|
|
object.LAUNCH_PAD_PULL_TAB_WIDTH = LAUNCH_PAD_PULL_TAB_WIDTH;
|
|
object.LAUNCH_PAD_PULL_TAB_HIT_SLOP = LAUNCH_PAD_PULL_TAB_HIT_SLOP;
|
|
object.launchPadPullTabState = launchPadPullTabState;
|
|
object.LAUNCH_PAD_PULL_TAB_HEIGHT = LAUNCH_PAD_PULL_TAB_HEIGHT;
|
|
const updatersBinding = updaters;
|
|
object.updaters = updatersBinding;
|
|
object.LAUNCH_PAD_PULL_TAB_SCALE_FACTOR = LAUNCH_PAD_PULL_TAB_SCALE_FACTOR;
|
|
object.launchPadSharedState = launchPadSharedStateBinding;
|
|
object.MANUAL_ACTIVATION_THRESHOLD = 3;
|
|
closure.__closure = object;
|
|
closure.__workletHash = 5887887666279;
|
|
closure.__initData = env1_16;
|
|
const onChange = Reflect.apply(onTouchesMove, value14, [closure]).onChange;
|
|
closure = I_117087;
|
|
object = {gestureState: gestureStateBinding};
|
|
object.getWindowDimensionsWorklet = getWindowDimensionsWorklet;
|
|
object.POP_RESISTANCE = 0.5;
|
|
object.launchPadType = launchPadTypeBinding;
|
|
object.LaunchPadTypes = LaunchPadTypes;
|
|
object.PIP_POP_DISTANCE = 70;
|
|
object.updaters = updatersBinding;
|
|
object.updateSharedValueIfChanged = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
|
|
object.runOnJS = (require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS;
|
|
object.triggerHapticFeedback = (require(4081) /* metro dependency 4081: HapticUtilsNative */).triggerHapticFeedback;
|
|
const HapticFeedbackTypes = (require(4081) /* metro dependency 4081: HapticUtilsNative */).HapticFeedbackTypes;
|
|
object.HapticFeedbackTypes = HapticFeedbackTypes;
|
|
closure.__closure = object;
|
|
closure.__workletHash = 8073380735713;
|
|
closure.__initData = env1_15;
|
|
value = Reflect.apply(onChange, value, [closure]);
|
|
const onEnd = value.onEnd;
|
|
closure = v_117088;
|
|
closure.__closure = {gestureState: gestureStateBinding, launchPadType: launchPadTypeBinding,
|
|
LaunchPadTypes: LaunchPadTypes, LAUNCH_PAD_END_TRANSLATION_THRESHOLD: LAUNCH_PAD_END_TRANSLATION_THRESHOLD,
|
|
LAUNCH_PAD_END_VELOCITY_THRESHOLD: LAUNCH_PAD_END_VELOCITY_THRESHOLD, updaters: updatersBinding,
|
|
launchPadSharedState: launchPadSharedStateBinding};
|
|
closure.__workletHash = 13108163303108;
|
|
closure.__initData = env1_14;
|
|
value = Reflect.apply(onEnd, value, [closure]);
|
|
const onTouchesCancelled = value.onTouchesCancelled;
|
|
closure = function() {
|
|
var value2 = gestureState.get();
|
|
if (value2.active) {
|
|
if (value2.initialLaunchPadPosition === 1) {
|
|
updaters.setLaunchPadPosition(1);
|
|
} else {
|
|
updaters.setLaunchPadPosition(0);
|
|
}
|
|
}
|
|
importDefault(dependencyMap[7])(gestureState, {'active': false, 'initialLaunchPadPosition': 0,
|
|
'initialPullTabPosition': 0, 'initialTouchX': 0, 'initialTouchY': 0, 'positionOffsetX': 0,
|
|
'positionOffsetY': 0,
|
|
'startTime': -1});
|
|
};
|
|
closure.__closure = {gestureState: gestureStateBinding, updaters: updatersBinding,
|
|
updateSharedValueIfChanged: importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */};
|
|
closure.__workletHash = 11677880944102;
|
|
closure.__initData = env1_13;
|
|
value = Reflect.apply(onTouchesCancelled, value, [closure]);
|
|
const onFinalize = value.onFinalize;
|
|
closure = t_117090;
|
|
closure.__closure = {updateSharedValueIfChanged: importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */,
|
|
gestureState: gestureStateBinding, updaters: updatersBinding};
|
|
closure.__workletHash = 14463491499289;
|
|
closure.__initData = env1_12;
|
|
return Reflect.apply(onFinalize, value, [closure]);
|
|
function y_117085({changedTouches}) { // fn#117085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15513:6961, offset: 0x024a320c, size: 152 bytes, params: 2, frame: 16
|
|
const {x, y} = changedTouches[0];
|
|
const gestureStateBinding = gestureState;
|
|
const set = gestureStateBinding.set;
|
|
const object = {'active': false, 'initialLaunchPadPosition': null, 'initialPullTabPosition': 0,
|
|
'initialTouchX': null, 'initialTouchY': null, 'positionOffsetX': 0, 'positionOffsetY': 0};
|
|
const launchPadSharedStateBinding = launchPadSharedState;
|
|
let get = launchPadSharedStateBinding.get;
|
|
object.initialLaunchPadPosition = Reflect.apply(get, launchPadSharedStateBinding, []);
|
|
object.initialTouchX = x;
|
|
object.initialTouchY = y;
|
|
const Date = global.Date;
|
|
object.startTime = Date.now();
|
|
get = launchPadSharedStateBinding.get;
|
|
object.requiresPop = Reflect.apply(get, launchPadSharedStateBinding, []) === 0;
|
|
get = launchPadSharedStateBinding.get;
|
|
object.startShown = !(Reflect.apply(get, launchPadSharedStateBinding, []) === 0);
|
|
Reflect.apply(set, gestureStateBinding, [object]);
|
|
}
|
|
|
|
function X_117086(a0, a1) { // fn#117086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15513:7346, offset: 0x024a32a4, size: 717 bytes, params: 3, frame: 23
|
|
var r9;
|
|
var r13;
|
|
var changedTouches;
|
|
var property;
|
|
var x;
|
|
var y;
|
|
var moduleValue;
|
|
var getWindowDimensionsWorklet;
|
|
var width;
|
|
var launchPadTypeBinding;
|
|
var GESTURE_EDGE;
|
|
var DISABLED;
|
|
var PULL_TAB;
|
|
var launchPadPullTabStateBinding;
|
|
var position;
|
|
var value4;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
var Math;
|
|
var abs;
|
|
var value9;
|
|
var launchPadSharedStateBinding;
|
|
var fail;
|
|
var set;
|
|
var object;
|
|
var updatersBinding;
|
|
const {active, initialLaunchPadPosition, initialTouchX, initialTouchY} = gestureState.get();
|
|
const state = a0.state;
|
|
const State = require(dependencyMap[4]).State;
|
|
const BEGAN = State.BEGAN;
|
|
if (state === BEGAN) {
|
|
reducibleJoin28: while (true) {
|
|
if (active) {
|
|
break reducibleJoin28;
|
|
}
|
|
changedTouches = a0.changedTouches;
|
|
property = changedTouches[0];
|
|
x = property.x;
|
|
y = property.y;
|
|
moduleValue = require(dependencyMap[6]);
|
|
getWindowDimensionsWorklet = moduleValue.getWindowDimensionsWorklet;
|
|
width = Reflect.apply(getWindowDimensionsWorklet, moduleValue, []).width;
|
|
if (property != null) {
|
|
launchPadTypeBinding = launchPadType;
|
|
GESTURE_EDGE = LaunchPadTypes.GESTURE_EDGE;
|
|
reducibleJoin27: while (true) {
|
|
reducibleJoin6: while (true) {
|
|
if (launchPadTypeBinding !== GESTURE_EDGE) {
|
|
break reducibleJoin6;
|
|
}
|
|
if (initialLaunchPadPosition !== 0) {
|
|
break reducibleJoin6;
|
|
}
|
|
if (initialTouchX < width - LAUNCH_PAD_EDGE_GESTURE_AFFORDANCE) {
|
|
break reducibleJoin27;
|
|
}
|
|
break reducibleJoin6;
|
|
}
|
|
launchPadTypeBinding = launchPadType;
|
|
DISABLED = LaunchPadTypes.DISABLED;
|
|
if (launchPadTypeBinding === DISABLED) {
|
|
break reducibleJoin27;
|
|
}
|
|
launchPadTypeBinding = launchPadType;
|
|
PULL_TAB = LaunchPadTypes.PULL_TAB;
|
|
if (launchPadTypeBinding !== PULL_TAB) {
|
|
r13 = dependencyMap;
|
|
} else {
|
|
reducibleJoin14: while (true) {
|
|
if (initialLaunchPadPosition !== 0) {
|
|
r13 = dependencyMap;
|
|
break reducibleJoin14;
|
|
}
|
|
launchPadPullTabStateBinding = launchPadPullTabState;
|
|
get = launchPadPullTabStateBinding.get;
|
|
position = Reflect.apply(get, launchPadPullTabStateBinding, []).position;
|
|
value4 = y > position - LAUNCH_PAD_PULL_TAB_HIT_SLOP;
|
|
reducibleJoin11: while (true) {
|
|
if (value4) {
|
|
launchPadPullTabStateBinding = launchPadPullTabState;
|
|
get = launchPadPullTabStateBinding.get;
|
|
position = Reflect.apply(get, launchPadPullTabStateBinding, []).position;
|
|
value5 = position + LAUNCH_PAD_PULL_TAB_HEIGHT;
|
|
value6 = y < value5 + LAUNCH_PAD_PULL_TAB_HIT_SLOP;
|
|
r9 = value6;
|
|
break reducibleJoin11;
|
|
}
|
|
r9 = value4;
|
|
break reducibleJoin11;
|
|
}
|
|
value7 = width - LAUNCH_PAD_PULL_TAB_WIDTH;
|
|
if (x > value7 - LAUNCH_PAD_PULL_TAB_HIT_SLOP) {
|
|
if (x < width) {
|
|
if (r9) {
|
|
gestureStateBinding = gestureState;
|
|
set = gestureStateBinding.set;
|
|
object = {};
|
|
get = gestureStateBinding.get;
|
|
copyDataProperties(object, Reflect.apply(get, gestureStateBinding, []), value7);
|
|
launchPadPullTabStateBinding = launchPadPullTabState;
|
|
get = launchPadPullTabStateBinding.get;
|
|
object['initialPullTabPosition'] = Reflect.apply(get,
|
|
launchPadPullTabStateBinding,
|
|
[]).position;
|
|
object['active'] = true;
|
|
Reflect.apply(set, gestureStateBinding, [object]);
|
|
updatersBinding = updaters;
|
|
updatersBinding.setLaunchPadPullTabScale(LAUNCH_PAD_PULL_TAB_SCALE_FACTOR);
|
|
updatersBinding.setLaunchPadShown(true);
|
|
a1.activate();
|
|
return undefined;
|
|
}
|
|
r13 = value7;
|
|
break reducibleJoin14;
|
|
}
|
|
r13 = value7;
|
|
break reducibleJoin14;
|
|
}
|
|
r13 = value7;
|
|
break reducibleJoin14;
|
|
}
|
|
}
|
|
launchPadTypeBinding = launchPadType;
|
|
PULL_TAB = LaunchPadTypes.PULL_TAB;
|
|
if (launchPadTypeBinding === PULL_TAB) {
|
|
launchPadTypeBinding = launchPadType;
|
|
PULL_TAB = LaunchPadTypes.PULL_TAB;
|
|
reducibleJoin17: while (true) {
|
|
reducibleJoin28: while (true) {
|
|
if (launchPadTypeBinding !== PULL_TAB) {
|
|
a1.fail();
|
|
break reducibleJoin28;
|
|
}
|
|
if (initialLaunchPadPosition > 0) {
|
|
break reducibleJoin17;
|
|
}
|
|
fail = a1.fail;
|
|
Reflect.apply(fail, a1, []);
|
|
break reducibleJoin28;
|
|
}
|
|
return undefined;
|
|
}
|
|
}
|
|
value8 = x - initialTouchX;
|
|
Math = global.Math;
|
|
abs = Math.abs;
|
|
value9 = Reflect.apply(abs, Math, [y - initialTouchY]);
|
|
launchPadSharedStateBinding = launchPadSharedState;
|
|
get = launchPadSharedStateBinding.get;
|
|
if (Reflect.apply(get, launchPadSharedStateBinding, []) > 0) {
|
|
reducibleJoin19: while (true) {
|
|
if (value8 > 0) {
|
|
Math = global.Math;
|
|
abs = Math.abs;
|
|
if (Reflect.apply(abs, Math, [value8]) > value9) {
|
|
Math = global.Math;
|
|
if (Math.abs(value8) < 3) {
|
|
return undefined;
|
|
}
|
|
gestureStateBinding = gestureState;
|
|
set = gestureStateBinding.set;
|
|
object = {};
|
|
copyDataProperties(object, gestureStateBinding.get(), r13);
|
|
object['active'] = true;
|
|
Reflect.apply(set, gestureStateBinding, [object]);
|
|
updatersBinding = updaters;
|
|
updatersBinding.setLaunchPadShown(true);
|
|
a1.activate();
|
|
return undefined;
|
|
}
|
|
fail = a1.fail;
|
|
Reflect.apply(fail, a1, []);
|
|
break reducibleJoin28;
|
|
}
|
|
break reducibleJoin19;
|
|
}
|
|
}
|
|
launchPadSharedStateBinding = launchPadSharedState;
|
|
get = launchPadSharedStateBinding.get;
|
|
if (Reflect.apply(get, launchPadSharedStateBinding, []) <= 0) {
|
|
reducibleJoin22: while (true) {
|
|
if (value8 < 0) {
|
|
Math = global.Math;
|
|
abs = Math.abs;
|
|
if (Reflect.apply(abs, Math, [value8]) > value9) {
|
|
Math = global.Math;
|
|
if (Math.abs(value8) < 3) {
|
|
return undefined;
|
|
}
|
|
gestureStateBinding = gestureState;
|
|
set = gestureStateBinding.set;
|
|
object = {};
|
|
copyDataProperties(object, gestureStateBinding.get(), r13);
|
|
object['active'] = true;
|
|
Reflect.apply(set, gestureStateBinding, [object]);
|
|
updatersBinding = updaters;
|
|
updatersBinding.setLaunchPadShown(true);
|
|
a1.activate();
|
|
return undefined;
|
|
}
|
|
break reducibleJoin22;
|
|
}
|
|
break reducibleJoin22;
|
|
}
|
|
}
|
|
fail = a1.fail;
|
|
Reflect.apply(fail, a1, []);
|
|
break reducibleJoin28;
|
|
}
|
|
}
|
|
fail = a1.fail;
|
|
Reflect.apply(fail, a1, []);
|
|
break reducibleJoin28;
|
|
}
|
|
}
|
|
}
|
|
|
|
function I_117087({translationX, translationY, absoluteX}) { // fn#117087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15513:8579, offset: 0x024a3571, size: 498 bytes, params: 2, frame: 23
|
|
var value2;
|
|
var initialTouchX;
|
|
var requiresPop;
|
|
var value3;
|
|
var moduleValue;
|
|
var width;
|
|
var Math;
|
|
var value4;
|
|
var value5;
|
|
var value6;
|
|
var value9;
|
|
var defaultImport;
|
|
const triggerHapticFeedback = (HapticUtilsNativeModule).triggerHapticFeedback;
|
|
const HapticFeedbackTypes = (HapticUtilsNativeModule).HapticFeedbackTypes;
|
|
let get = gestureState.get;
|
|
if (Reflect.apply(get, gestureStateBinding, []).active) {
|
|
gestureStateBinding = gestureState;
|
|
value2 = gestureStateBinding.get();
|
|
initialTouchX = value2.initialTouchX;
|
|
requiresPop = value2.requiresPop;
|
|
value3 = environment.__proto__.__proto__;
|
|
moduleValue = require(14283) /* metro dependency 14283: useWindowDimensionsSharedValueNative */;
|
|
width = moduleValue.getWindowDimensionsWorklet().width;
|
|
Math = global.Math;
|
|
value4 = 0;
|
|
value5 = Math.max(-1 * (absoluteX - initialTouchX), value4);
|
|
get = gestureStateBinding.get;
|
|
initialTouchX = Reflect.apply(get, gestureStateBinding, []).initialTouchX;
|
|
value6 = absoluteX - initialTouchX;
|
|
get = gestureStateBinding.get;
|
|
initialTouchX = Reflect.apply(get, gestureStateBinding, []).initialTouchX;
|
|
value9 = (initialTouchX + translationX - (launchPadType === LaunchPadTypes.PULL_TAB ? value4 : 40)) / width;
|
|
if (requiresPop) {
|
|
if (value5 <= 70) {
|
|
if (launchPadType !== LaunchPadTypes.PULL_TAB) {
|
|
updaters.setLaunchPadPosition((value5 - 0.5 * value5) / width);
|
|
} else {
|
|
updaters.setLaunchPadPullTabTranslation(translationY);
|
|
}
|
|
(importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */)(gestureState,
|
|
{positionOffsetX: value6});
|
|
} else {
|
|
defaultImport = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
|
|
gestureStateBinding = gestureState;
|
|
if (requiresPop) {
|
|
defaultImport(gestureStateBinding, {requiresPop: false, positionOffsetX: value6});
|
|
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(triggerHapticFeedback)(HapticFeedbackTypes.IMPACT_MEDIUM);
|
|
} else {
|
|
defaultImport(gestureStateBinding, {positionOffsetX: value6});
|
|
}
|
|
updaters.setLaunchPadPosition(1 - value9);
|
|
}
|
|
} else {
|
|
defaultImport = importDefault(11282) /* metro dependency 11282: updateSharedValueIfChangedNative */;
|
|
gestureStateBinding = gestureState;
|
|
if (requiresPop) {
|
|
defaultImport(gestureStateBinding, {requiresPop: false, positionOffsetX: value6});
|
|
(require(4017) /* metro dependency 4017: ReanimatedRexport */).runOnJS(triggerHapticFeedback)(HapticFeedbackTypes.IMPACT_MEDIUM);
|
|
} else {
|
|
defaultImport(gestureStateBinding, {positionOffsetX: value6});
|
|
}
|
|
updaters.setLaunchPadPosition(1 - value9);
|
|
}
|
|
}
|
|
}
|
|
|
|
function v_117088({velocityX, velocityY, translationX, translationY}) { // fn#117088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15513:9567, offset: 0x024a3763, size: 382 bytes, params: 2, frame: 18
|
|
var value3;
|
|
var value4;
|
|
var launchPadTypeBinding;
|
|
var value6;
|
|
const value2 = gestureState.get();
|
|
if (value2.requiresPop) {
|
|
if (value2.startShown) {
|
|
updaters.setLaunchPadPosition(1);
|
|
} else {
|
|
launchPadTypeBinding = launchPadType;
|
|
value6 = environment.__proto__.__proto__;
|
|
if (launchPadTypeBinding !== LaunchPadTypes.PULL_TAB) {
|
|
updaters.setLaunchPadPosition(0);
|
|
} else if (global.Math.abs(translationX) <= LAUNCH_PAD_END_TRANSLATION_THRESHOLD) {
|
|
if (global.Math.abs(translationY) <= LAUNCH_PAD_END_TRANSLATION_THRESHOLD) {
|
|
if (global.Math.abs(velocityX) <= LAUNCH_PAD_END_VELOCITY_THRESHOLD) {
|
|
if (global.Math.abs(velocityY) <= LAUNCH_PAD_END_VELOCITY_THRESHOLD) {
|
|
updaters.setLaunchPadPosition(1);
|
|
} else {
|
|
updaters.setLaunchPadPosition(0);
|
|
}
|
|
} else {
|
|
updaters.setLaunchPadPosition(0);
|
|
}
|
|
} else {
|
|
updaters.setLaunchPadPosition(0);
|
|
}
|
|
} else {
|
|
updaters.setLaunchPadPosition(0);
|
|
}
|
|
}
|
|
} else {
|
|
value3 = global.Math.abs(velocityX);
|
|
value4 = environment.__proto__.__proto__;
|
|
if (value3 < LAUNCH_PAD_END_VELOCITY_THRESHOLD) {
|
|
if (launchPadSharedState.get() >= 0.5) {
|
|
updaters.setLaunchPadPosition(1);
|
|
} else {
|
|
updaters.setLaunchPadPosition(0);
|
|
}
|
|
} else if (velocityX > 0) {
|
|
updaters.setLaunchPadPosition(0);
|
|
} else {
|
|
updaters.setLaunchPadPosition(1);
|
|
}
|
|
}
|
|
}
|
|
|
|
function t_117090() { // fn#117090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15513:10611, offset: 0x024a395c, size: 72 bytes, params: 1, frame: 14
|
|
const value = environment.__proto__.__proto__;
|
|
(UpdateSharedValueIfChangedNative)(gestureState,
|
|
{'active': false, 'initialLaunchPadPosition': 0, 'initialPullTabPosition': 0, 'initialTouchX': 0,
|
|
'initialTouchY': 0, 'positionOffsetX': 0, 'positionOffsetY': 0, 'startTime': -1});
|
|
updaters.setLaunchPadPullTabScale(1);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun117082, 15316, [31, 11324, 4007, 1585, 5321, 477, 14283, 11282, 4017, 4081,
|
|
2]) /* metro module 15316, dependencies: [31, 11324, 4007, 1585, 5321, 477, 14283, 11282, 4017, 4081, 2] */;
|