Files
discord-decomp/sources/by-id/module-01765-useAnimatedScrollHandler.js
2026-07-28 01:06:53 +03:00

156 lines
9.2 KiB
JavaScript

/* Metro module 1765; source: unknown; dependencies: [1755, 1757] */
import * as UseHandlerModule from './module-01755-useHandler.js'; /* Metro dependency 1755 */
import * as moduleValue2 from './module-01757-useEvent.js'; /* Metro dependency 1757 */
function _fun19478(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#19478, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1892:6, offset: 0x00eab3e7, size: 82 bytes, params: 8, frame: 16
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object = {code: "function pnpm_useAnimatedScrollHandlerTs1(event){const{scrollHandlers,context}=this.__closure;const{onScroll:onScroll,onBeginDrag:onBeginDrag,onEndDrag:onEndDrag,onMomentumBegin:onMomentumBegin,onMomentumEnd:onMomentumEnd}=scrollHandlers;if(onScroll&&event.eventName.endsWith('onScroll')){onScroll(event,context);}else if(onBeginDrag&&event.eventName.endsWith('onScrollBeginDrag')){onBeginDrag(event,context);}else if(onEndDrag&&event.eventName.endsWith('onScrollEndDrag')){onEndDrag(event,context);}else if(onMomentumBegin&&event.eventName.endsWith('onMomentumScrollBegin')){onMomentumBegin(event,context);}else if(onMomentumEnd&&event.eventName.endsWith('onMomentumScrollEnd')){onMomentumEnd(event,context);}}"};
exports.useAnimatedScrollHandler = useAnimatedScrollHandler;
function useAnimatedScrollHandler(a0, a1) { // fn#19479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1892:846, offset: 0x00eab439, size: 281 bytes, params: 3, frame: 20
const value = a0;
const r2 = typeof value !== 'function' ? value : {onScroll: value};
const {context, doDependenciesDiffer} = (UseHandlerModule).useHandler(r2, a1);
const items2 = ['onScroll'];
if (r2.onBeginDrag !== undefined) {
items2.push('onScrollBeginDrag');
}
if (r2.onEndDrag !== undefined) {
items2.push('onScrollEndDrag');
}
if (r2.onMomentumBegin !== undefined) {
items2.push('onMomentumScrollBegin');
}
if (r2.onMomentumEnd !== undefined) {
items2.push('onMomentumScrollEnd');
}
const useEvent = moduleValue2.useEvent;
const pnpm_useAnimatedScrollHandlerTs12 = pnpm_useAnimatedScrollHandlerTs1;
pnpm_useAnimatedScrollHandlerTs12.__closure = {scrollHandlers: r2, context: context};
pnpm_useAnimatedScrollHandlerTs12.__workletHash = 480432859268;
pnpm_useAnimatedScrollHandlerTs12.__initData = env0_2;
return Reflect.apply(useEvent, moduleValue2, [pnpm_useAnimatedScrollHandlerTs12, items2, doDependenciesDiffer]);
function pnpm_useAnimatedScrollHandlerTs1(a0) { // fn#19480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:1892:1251, owner: useAnimatedScrollHandler.pnpm_useAnimatedScrollHandlerTs1, offset: 0x00eab552, size: 272 bytes, params: 2, frame: 20
var eventName;
const onScroll = env0_0.onScroll;
const onBeginDrag = env0_0.onBeginDrag;
const onEndDrag = env0_0.onEndDrag;
const onMomentumBegin = env0_0.onMomentumBegin;
const onMomentumEnd = env0_0.onMomentumEnd;
if (onScroll) {
eventName = a0.eventName;
if (eventName.endsWith('onScroll')) {
onScroll(a0, context);
} else if (onBeginDrag) {
eventName = a0.eventName;
if (eventName.endsWith('onScrollBeginDrag')) {
onBeginDrag(a0, context);
} else if (onEndDrag) {
eventName = a0.eventName;
if (eventName.endsWith('onScrollEndDrag')) {
onEndDrag(a0, context);
} else if (onMomentumBegin) {
eventName = a0.eventName;
if (eventName.endsWith('onMomentumScrollBegin')) {
onMomentumBegin(a0, context);
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumBegin) {
eventName = a0.eventName;
if (eventName.endsWith('onMomentumScrollBegin')) {
onMomentumBegin(a0, context);
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onEndDrag) {
eventName = a0.eventName;
if (eventName.endsWith('onScrollEndDrag')) {
onEndDrag(a0, context);
} else if (onMomentumBegin) {
eventName = a0.eventName;
if (eventName.endsWith('onMomentumScrollBegin')) {
onMomentumBegin(a0, context);
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumBegin) {
eventName = a0.eventName;
if (eventName.endsWith('onMomentumScrollBegin')) {
onMomentumBegin(a0, context);
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onBeginDrag) {
eventName = a0.eventName;
if (eventName.endsWith('onScrollBeginDrag')) {
onBeginDrag(a0, context);
} else if (onEndDrag) {
eventName = a0.eventName;
if (eventName.endsWith('onScrollEndDrag')) {
onEndDrag(a0, context);
} else if (onMomentumBegin) {
eventName = a0.eventName;
if (eventName.endsWith('onMomentumScrollBegin')) {
onMomentumBegin(a0, context);
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumBegin) {
eventName = a0.eventName;
if (eventName.endsWith('onMomentumScrollBegin')) {
onMomentumBegin(a0, context);
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onEndDrag) {
eventName = a0.eventName;
if (eventName.endsWith('onScrollEndDrag')) {
onEndDrag(a0, context);
} else if (onMomentumBegin) {
eventName = a0.eventName;
if (eventName.endsWith('onMomentumScrollBegin')) {
onMomentumBegin(a0, context);
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumBegin) {
eventName = a0.eventName;
if (eventName.endsWith('onMomentumScrollBegin')) {
onMomentumBegin(a0, context);
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
} else if (onMomentumEnd && a0.eventName.endsWith('onMomentumScrollEnd')) {
onMomentumEnd(a0, context);
}
}
}
}
global.__d(_fun19478, 1765, [1755, 1757]) /* metro module 1765, dependencies: [1755, 1757] */;