523 lines
27 KiB
JavaScript
523 lines
27 KiB
JavaScript
/* Metro module 5323; source: unknown; dependencies: [27, 5324, 5326, 5327, 5329] */
|
|
import * as ReactNativeModule from './module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as Module05324Module from './module-05324.js'; /* Metro dependency 5324 */
|
|
import * as StateModule from './module-05326-State.js'; /* Metro dependency 5326 */
|
|
import * as TouchEventTypeModule from './module-05329-TouchEventType.js'; /* Metro dependency 5329 */
|
|
|
|
function _fun47111(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#47111, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5501:6, offset: 0x011b8f9b, size: 176 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const isStateChangeEvent = function(a0) {
|
|
return a0.oldState != null;
|
|
};
|
|
const onGestureHandlerEvent2 = onGestureHandlerEvent;
|
|
const stopListening2 = stopListening;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const Map = global.Map;
|
|
const map = new Map();
|
|
const env0_6 = [];
|
|
exports.onGestureHandlerEvent = onGestureHandlerEvent2;
|
|
exports.startListening = function() {
|
|
stopListening();
|
|
var onGestureHandlerEventBinding = onGestureHandlerEvent;
|
|
env0_3 = DeviceEventEmitter.addListener('onGestureHandlerEvent', onGestureHandlerEventBinding);
|
|
env0_4 = DeviceEventEmitter.addListener('onGestureHandlerStateChange', onGestureHandlerEventBinding);
|
|
};
|
|
exports.stopListening = stopListening2;
|
|
function onGestureHandlerEvent(a0) { // fn#47113, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5501:209, offset: 0x011b905c, size: 1540 bytes, params: 2, frame: 21
|
|
var r4;
|
|
var object;
|
|
var eventType;
|
|
var handlers;
|
|
var binding;
|
|
var has;
|
|
var set;
|
|
var GestureStateManager;
|
|
var get;
|
|
var value4;
|
|
const TouchEventType = (TouchEventTypeModule).TouchEventType;
|
|
const State = (StateModule).State;
|
|
const value2 = undefined;
|
|
const findHandler = Module05324Module.findHandler;
|
|
let handlerTag = a0.handlerTag;
|
|
const handler = Reflect.apply(findHandler, Module05324Module, [handlerTag]);
|
|
if (handler) {
|
|
if (isStateChangeEvent(a0)) {
|
|
if (a0.oldState !== State.UNDETERMINED) {
|
|
if (a0.oldState === State.BEGAN) {
|
|
if (a0.state !== State.ACTIVE) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else {
|
|
handlers = handler.handlers;
|
|
if (handlers.onStart != null) {
|
|
handler.handlers.onStart(a0);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = a0;
|
|
}
|
|
} else if (a0.oldState !== State.UNDETERMINED) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else if (a0.state !== State.ACTIVE) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else {
|
|
handlers = handler.handlers;
|
|
if (handlers.onStart != null) {
|
|
handler.handlers.onStart(a0);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = a0;
|
|
}
|
|
} else if (a0.state === State.BEGAN) {
|
|
if (handler.handlers.onBegin != null) {
|
|
handler.handlers.onBegin(a0);
|
|
}
|
|
} else if (a0.oldState === State.BEGAN) {
|
|
if (a0.state !== State.ACTIVE) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else {
|
|
handlers = handler.handlers;
|
|
if (handlers.onStart != null) {
|
|
handler.handlers.onStart(a0);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = a0;
|
|
}
|
|
} else if (a0.oldState !== State.UNDETERMINED) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else if (a0.state !== State.ACTIVE) {
|
|
if (a0.oldState === a0.state) {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
} else if (a0.state === State.END) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, true);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, true);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = value2;
|
|
} else {
|
|
r4 = a0.state !== State.FAILED && a0.state !== State.CANCELLED;
|
|
r4 = !r4 ? a0.oldState === a0.state : r4;
|
|
if (!r4) {
|
|
if (a0.oldState === State.ACTIVE) {
|
|
if (handler.handlers.onEnd != null) {
|
|
handler.handlers.onEnd(a0, false);
|
|
}
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onFinalize != null) {
|
|
handler.handlers.onFinalize(a0, false);
|
|
}
|
|
binding = env0_5;
|
|
handlerTag = a0.handlerTag;
|
|
binding.delete(handlerTag);
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
handlerTag = handlers.handlerTag;
|
|
binding[handlerTag] = value2;
|
|
}
|
|
}
|
|
} else {
|
|
handlers = handler.handlers;
|
|
if (handlers.onStart != null) {
|
|
handler.handlers.onStart(a0);
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = a0;
|
|
}
|
|
} else {
|
|
eventType = a0.eventType;
|
|
if (eventType != null) {
|
|
binding = env0_5;
|
|
has = binding.has;
|
|
handlerTag = a0.handlerTag;
|
|
if (!Reflect.apply(has, binding, [handlerTag])) {
|
|
binding = env0_5;
|
|
set = binding.set;
|
|
handlerTag = a0.handlerTag;
|
|
GestureStateManager = (require(5327) /* metro dependency 5327 */).GestureStateManager;
|
|
Reflect.apply(set, binding, [handlerTag, GestureStateManager.create(a0.handlerTag)]);
|
|
}
|
|
binding = env0_5;
|
|
get = binding.get;
|
|
handlerTag = a0.handlerTag;
|
|
value4 = Reflect.apply(get, binding, [handlerTag]);
|
|
eventType = a0.eventType;
|
|
if (TouchEventType.TOUCHES_DOWN === eventType) {
|
|
handlers = handler.handlers;
|
|
if (!(handlers == null || handlers.onTouchesDown == null)) {
|
|
handlers.onTouchesDown(a0, value4);
|
|
}
|
|
} else if (TouchEventType.TOUCHES_MOVE === eventType) {
|
|
handlers = handler.handlers;
|
|
if (!(handlers == null || handlers.onTouchesMove == null)) {
|
|
handlers.onTouchesMove(a0, value4);
|
|
}
|
|
} else if (TouchEventType.TOUCHES_UP === eventType) {
|
|
handlers = handler.handlers;
|
|
if (!(handlers == null || handlers.onTouchesUp == null)) {
|
|
handlers.onTouchesUp(a0, value4);
|
|
}
|
|
} else if (TouchEventType.TOUCHES_CANCELLED === eventType) {
|
|
handlers = handler.handlers;
|
|
if (!(handlers == null || handlers.onTouchesCancelled == null)) {
|
|
handlers.onTouchesCancelled(a0, value4);
|
|
}
|
|
}
|
|
} else {
|
|
handlers = handler.handlers;
|
|
if (handlers.onUpdate != null) {
|
|
handler.handlers.onUpdate(a0);
|
|
}
|
|
handlers = handler.handlers;
|
|
if (handlers.onChange && handler.handlers.changeEventCalculator) {
|
|
handlers = handler.handlers;
|
|
if (handlers.onChange != null) {
|
|
handlers = handler.handlers;
|
|
handlers.onChange(handler.handlers.changeEventCalculator == null ? value2 : handler.handlers.changeEventCalculator(a0,
|
|
|
|
|
|
|
|
|
|
|
|
env0_6[handler.handlers.handlerTag]));
|
|
}
|
|
binding = env0_6;
|
|
handlers = handler.handlers;
|
|
binding[handlers.handlerTag] = a0;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
var moduleValue2 = Module05324Module;
|
|
var oldGestureHandler = moduleValue2.findOldGestureHandler(a0.handlerTag);
|
|
if (oldGestureHandler) {
|
|
object = {nativeEvent: a0};
|
|
if (isStateChangeEvent(a0)) {
|
|
oldGestureHandler.onGestureStateChange(object);
|
|
} else {
|
|
oldGestureHandler.onGestureEvent(object);
|
|
}
|
|
return value2;
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function stopListening() { // fn#47114, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5501:2250, offset: 0x011b9660, size: 61 bytes, params: 1, frame: 10
|
|
if (env0_3) {
|
|
env0_3.remove();
|
|
}
|
|
if (env0_4) {
|
|
env0_4.remove();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun47111, 5323, [27, 5324, 5326, 5327,
|
|
5329]) /* metro module 5323, dependencies: [27, 5324, 5326, 5327, 5329] */;
|