477 lines
24 KiB
TypeScript
477 lines
24 KiB
TypeScript
/* Metro module 11333; source: components_native/chat/getMessageJumpData.tsx; dependencies: [57, 31, 1480, 1878, 477, 1851, 4044, 21, 2] */
|
|
function _fun86553(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11519:6, offset: 0x01f97718, size: 182 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
const subscribeToKeyboardUIStore = importDefault(1480) /* metro dependency 1480: subscribeToKeyboardUIStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('components_native/chat/getMessageJumpData.tsx');
|
|
exports.default = getMessageJumpData;
|
|
exports.useMessageJumpAndroidKeyboardHeight = useMessageJumpAndroidKeyboardHeight;
|
|
}
|
|
|
|
function getMessageJumpData(a0, a1, a2) { // fn#86554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11519:225, offset: 0x01f977ce, size: 588 bytes, params: 4, frame: 27
|
|
var r16;
|
|
var r4;
|
|
var id;
|
|
var r12;
|
|
var r11;
|
|
var r5;
|
|
var r7;
|
|
var r8;
|
|
var r9;
|
|
var jumpSequenceId2;
|
|
var jumpSequenceId3;
|
|
var value7;
|
|
var focusSequenceId;
|
|
var focusSequenceId2;
|
|
var value8;
|
|
var isAtBottom;
|
|
var hasPreviousMessages;
|
|
var loadingMore;
|
|
var author;
|
|
var id2;
|
|
var interaction;
|
|
var user;
|
|
var id3;
|
|
var defaultImport;
|
|
var compare;
|
|
var id4;
|
|
var value10;
|
|
var jumpedToPresent;
|
|
var isAndroid;
|
|
var androidKeyboardHeight;
|
|
var androidKeyboardHeight2;
|
|
var replyingMessageId;
|
|
var channelId;
|
|
var first;
|
|
var jumpType;
|
|
const messages = a0.messages;
|
|
let value = messages.last();
|
|
const messages2 = a2.messages;
|
|
const value2 = messages2.last();
|
|
const currentUser = UserStore.getCurrentUser();
|
|
const value5 = undefined;
|
|
const JumpTypes = (require(4044) /* metro dependency 4044: Client */).JumpTypes;
|
|
const ANIMATED = JumpTypes.ANIMATED;
|
|
const jumpSequenceId = messages.jumpSequenceId;
|
|
const focusTargetId = messages.focusTargetId;
|
|
const value6 = messages.initialScrollSequenceId !== messages2.initialScrollSequenceId;
|
|
reducibleJoin2: while (true) {
|
|
if (value6) {
|
|
r16 = value6;
|
|
break reducibleJoin2;
|
|
}
|
|
jumpSequenceId2 = messages2.jumpSequenceId;
|
|
jumpSequenceId3 = messages.jumpSequenceId;
|
|
value7 = jumpSequenceId2 !== jumpSequenceId3;
|
|
r16 = value7;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (value6) {
|
|
r4 = value6;
|
|
break reducibleJoin4;
|
|
}
|
|
focusSequenceId = messages2.focusSequenceId;
|
|
focusSequenceId2 = messages.focusSequenceId;
|
|
value8 = focusSequenceId !== focusSequenceId2;
|
|
r4 = value8;
|
|
break reducibleJoin4;
|
|
}
|
|
let jumpTargetId = messages.jumpTargetId;
|
|
const value9 = null;
|
|
reducibleJoin34: while (true) {
|
|
reducibleJoin27: while (true) {
|
|
if (value9 == jumpTargetId) {
|
|
if (!a1.isAtBottom) {
|
|
hasPreviousMessages = a1.hasPreviousMessages;
|
|
if (hasPreviousMessages) {
|
|
if (!messages2.loadingMore) {
|
|
if (value9 != value) {
|
|
if (value9 != currentUser) {
|
|
author = value.author;
|
|
id = author.id;
|
|
id2 = currentUser.id;
|
|
if (id !== id2) {
|
|
interaction = value.interaction;
|
|
reducibleJoin14: while (true) {
|
|
if (value9 == interaction) {
|
|
id = value5;
|
|
break reducibleJoin14;
|
|
}
|
|
user = interaction.user;
|
|
id = user.id;
|
|
break reducibleJoin14;
|
|
}
|
|
id3 = currentUser.id;
|
|
if (id !== id3) {
|
|
if (!messages.loadingMore) {
|
|
jumpedToPresent = messages.jumpedToPresent;
|
|
if (jumpedToPresent) {
|
|
if (r16) {
|
|
if (value9 != value) {
|
|
id = value.id;
|
|
value = false;
|
|
r5 = value;
|
|
r7 = ANIMATED;
|
|
r8 = value9;
|
|
r9 = id;
|
|
break reducibleJoin34;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
value = require(477) /* metro dependency 477: PlatformUtils */;
|
|
value = value.isAndroid();
|
|
reducibleJoin25: while (true) {
|
|
if (value) {
|
|
androidKeyboardHeight = a2.androidKeyboardHeight;
|
|
androidKeyboardHeight2 = a0.androidKeyboardHeight;
|
|
value = androidKeyboardHeight < androidKeyboardHeight2;
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
if (r12) {
|
|
replyingMessageId = a0.replyingMessageId;
|
|
value = value9 != replyingMessageId;
|
|
r12 = value;
|
|
break reducibleJoin27;
|
|
}
|
|
break reducibleJoin27;
|
|
}
|
|
}
|
|
if (value9 != value2) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
compare = defaultImport.compare;
|
|
id = value2.id;
|
|
id4 = value.id;
|
|
value10 = Reflect.apply(compare, defaultImport, [id, id4]);
|
|
if (!(value10 < 0)) {
|
|
if (!messages.loadingMore) {
|
|
jumpedToPresent = messages.jumpedToPresent;
|
|
if (jumpedToPresent) {
|
|
if (r16) {
|
|
if (value9 != value) {
|
|
id = value.id;
|
|
value = false;
|
|
r5 = value;
|
|
r7 = ANIMATED;
|
|
r8 = value9;
|
|
r9 = id;
|
|
break reducibleJoin34;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
value = require(477) /* metro dependency 477: PlatformUtils */;
|
|
value = value.isAndroid();
|
|
reducibleJoin25: while (true) {
|
|
if (value) {
|
|
androidKeyboardHeight = a2.androidKeyboardHeight;
|
|
androidKeyboardHeight2 = a0.androidKeyboardHeight;
|
|
value = androidKeyboardHeight < androidKeyboardHeight2;
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
if (r12) {
|
|
replyingMessageId = a0.replyingMessageId;
|
|
value = value9 != replyingMessageId;
|
|
r12 = value;
|
|
break reducibleJoin27;
|
|
}
|
|
break reducibleJoin27;
|
|
}
|
|
}
|
|
id = value.id;
|
|
value = false;
|
|
r5 = value;
|
|
r7 = ANIMATED;
|
|
r8 = value9;
|
|
r9 = id;
|
|
break reducibleJoin34;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (!messages.loadingMore) {
|
|
jumpedToPresent = messages.jumpedToPresent;
|
|
if (jumpedToPresent) {
|
|
if (r16) {
|
|
if (value9 != value) {
|
|
id = value.id;
|
|
value = false;
|
|
r5 = value;
|
|
r7 = ANIMATED;
|
|
r8 = value9;
|
|
r9 = id;
|
|
break reducibleJoin34;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
value = require(477) /* metro dependency 477: PlatformUtils */;
|
|
value = value.isAndroid();
|
|
reducibleJoin25: while (true) {
|
|
if (value) {
|
|
androidKeyboardHeight = a2.androidKeyboardHeight;
|
|
androidKeyboardHeight2 = a0.androidKeyboardHeight;
|
|
value = androidKeyboardHeight < androidKeyboardHeight2;
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
if (r12) {
|
|
replyingMessageId = a0.replyingMessageId;
|
|
value = value9 != replyingMessageId;
|
|
r12 = value;
|
|
break reducibleJoin27;
|
|
}
|
|
break reducibleJoin27;
|
|
}
|
|
if (r16) {
|
|
channelId = messages.channelId;
|
|
jumpTargetId = messages.jumpTargetId;
|
|
first = messages.first;
|
|
value = Reflect.apply(first, messages, []);
|
|
reducibleJoin33: while (true) {
|
|
reducibleJoin31: while (true) {
|
|
if (channelId !== jumpTargetId) {
|
|
break reducibleJoin31;
|
|
}
|
|
if (value9 != value) {
|
|
id = value.id;
|
|
r11 = id;
|
|
break reducibleJoin33;
|
|
}
|
|
break reducibleJoin31;
|
|
}
|
|
jumpTargetId = messages.jumpTargetId;
|
|
r11 = jumpTargetId;
|
|
break reducibleJoin33;
|
|
}
|
|
jumpType = messages.jumpType;
|
|
value = false;
|
|
r5 = value;
|
|
r7 = jumpType;
|
|
r8 = r11;
|
|
r9 = r11;
|
|
break reducibleJoin34;
|
|
}
|
|
isAtBottom = a1.isAtBottom;
|
|
if (!isAtBottom) {
|
|
hasPreviousMessages = a1.hasPreviousMessages;
|
|
if (hasPreviousMessages) {
|
|
if (!messages2.loadingMore) {
|
|
if (value9 != value) {
|
|
if (value9 != currentUser) {
|
|
author = value.author;
|
|
id = author.id;
|
|
id2 = currentUser.id;
|
|
if (id !== id2) {
|
|
interaction = value.interaction;
|
|
reducibleJoin14: while (true) {
|
|
if (value9 == interaction) {
|
|
id = value5;
|
|
break reducibleJoin14;
|
|
}
|
|
user = interaction.user;
|
|
id = user.id;
|
|
break reducibleJoin14;
|
|
}
|
|
id3 = currentUser.id;
|
|
if (id !== id3) {
|
|
if (!messages.loadingMore) {
|
|
jumpedToPresent = messages.jumpedToPresent;
|
|
if (jumpedToPresent) {
|
|
if (r16) {
|
|
if (value9 != value) {
|
|
id = value.id;
|
|
value = false;
|
|
r5 = value;
|
|
r7 = ANIMATED;
|
|
r8 = value9;
|
|
r9 = id;
|
|
break reducibleJoin34;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
value = require(477) /* metro dependency 477: PlatformUtils */;
|
|
value = value.isAndroid();
|
|
reducibleJoin25: while (true) {
|
|
if (value) {
|
|
androidKeyboardHeight = a2.androidKeyboardHeight;
|
|
androidKeyboardHeight2 = a0.androidKeyboardHeight;
|
|
value = androidKeyboardHeight < androidKeyboardHeight2;
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
if (r12) {
|
|
replyingMessageId = a0.replyingMessageId;
|
|
value = value9 != replyingMessageId;
|
|
r12 = value;
|
|
break reducibleJoin27;
|
|
}
|
|
break reducibleJoin27;
|
|
}
|
|
}
|
|
if (value9 != value2) {
|
|
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
compare = defaultImport.compare;
|
|
id = value2.id;
|
|
id4 = value.id;
|
|
value10 = Reflect.apply(compare, defaultImport, [id, id4]);
|
|
if (!(value10 < 0)) {
|
|
if (!messages.loadingMore) {
|
|
jumpedToPresent = messages.jumpedToPresent;
|
|
if (jumpedToPresent) {
|
|
if (r16) {
|
|
if (value9 != value) {
|
|
id = value.id;
|
|
value = false;
|
|
r5 = value;
|
|
r7 = ANIMATED;
|
|
r8 = value9;
|
|
r9 = id;
|
|
break reducibleJoin34;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
value = require(477) /* metro dependency 477: PlatformUtils */;
|
|
value = value.isAndroid();
|
|
reducibleJoin25: while (true) {
|
|
if (value) {
|
|
androidKeyboardHeight = a2.androidKeyboardHeight;
|
|
androidKeyboardHeight2 = a0.androidKeyboardHeight;
|
|
value = androidKeyboardHeight < androidKeyboardHeight2;
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
if (r12) {
|
|
replyingMessageId = a0.replyingMessageId;
|
|
value = value9 != replyingMessageId;
|
|
r12 = value;
|
|
break reducibleJoin27;
|
|
}
|
|
break reducibleJoin27;
|
|
}
|
|
}
|
|
id = value.id;
|
|
value = false;
|
|
r5 = value;
|
|
r7 = ANIMATED;
|
|
r8 = value9;
|
|
r9 = id;
|
|
break reducibleJoin34;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
loadingMore = messages.loadingMore;
|
|
if (!loadingMore) {
|
|
jumpedToPresent = messages.jumpedToPresent;
|
|
if (jumpedToPresent) {
|
|
if (r16) {
|
|
if (value9 != value) {
|
|
id = value.id;
|
|
value = false;
|
|
r5 = value;
|
|
r7 = ANIMATED;
|
|
r8 = value9;
|
|
r9 = id;
|
|
break reducibleJoin34;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
value = require(477) /* metro dependency 477: PlatformUtils */;
|
|
isAndroid = value.isAndroid;
|
|
value = Reflect.apply(isAndroid, value, []);
|
|
reducibleJoin25: while (true) {
|
|
if (value) {
|
|
androidKeyboardHeight = a2.androidKeyboardHeight;
|
|
androidKeyboardHeight2 = a0.androidKeyboardHeight;
|
|
value = androidKeyboardHeight < androidKeyboardHeight2;
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
r12 = value;
|
|
break reducibleJoin25;
|
|
}
|
|
if (r12) {
|
|
replyingMessageId = a0.replyingMessageId;
|
|
value = value9 != replyingMessageId;
|
|
r12 = value;
|
|
break reducibleJoin27;
|
|
}
|
|
break reducibleJoin27;
|
|
}
|
|
value = false;
|
|
if (r12) {
|
|
replyingMessageId = a0.replyingMessageId;
|
|
value = true;
|
|
r5 = value;
|
|
r7 = ANIMATED;
|
|
r8 = value9;
|
|
r9 = replyingMessageId;
|
|
break reducibleJoin34;
|
|
}
|
|
r5 = value;
|
|
r7 = ANIMATED;
|
|
r8 = value9;
|
|
r9 = value9;
|
|
break reducibleJoin34;
|
|
}
|
|
return {scrollToMessageId: r9, jumpTargetId: r8, jumpType: r7, jumpSequenceId: jumpSequenceId,
|
|
minimizeScrolling: r5, focusTargetId: r4 ? focusTargetId : value9, shouldInitialScroll: value6};
|
|
}
|
|
|
|
function useMessageJumpAndroidKeyboardHeight() { // fn#86555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11519:1238, offset: 0x01f97a1a, size: 144 bytes, params: 1, frame: 19
|
|
const binding = env0_4;
|
|
const useState = binding.useState;
|
|
const isAndroid2 = (require(477) /* metro dependency 477: PlatformUtils */).isAndroid();
|
|
const value2 = 0;
|
|
const value5 = env0_3(Reflect.apply(useState, binding,
|
|
[isAndroid2 ? (require(1851) /* metro dependency 1851: useSystemKeyboardHeightNative */).getSystemKeyboardHeight() : value2]),
|
|
2);
|
|
const property = value5[value2];
|
|
const env0_0 = value5[1];
|
|
env0_4.useEffect(function() {
|
|
return subscribeToKeyboardUIStore(_fun86557);
|
|
}, []);
|
|
return property;
|
|
}
|
|
|
|
function _fun86556() { // fn#86556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11519:1402, offset: 0x01f97aaa, size: 25 bytes, params: 1, frame: 11
|
|
return subscribeToKeyboardUIStore(_fun86557);
|
|
}
|
|
|
|
function _fun86557(a0) { // fn#86557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11519:1409, offset: 0x01f97ac3, size: 61 bytes, params: 2, frame: 11
|
|
let __proto__ = environment.__proto__.__proto__;
|
|
if (Reflect.apply((require(477) /* metro dependency 477: PlatformUtils */).isAndroid, __proto__, [])) {
|
|
__proto__ = environment.__proto__;
|
|
env1_0(a0.keyboardHeight);
|
|
}
|
|
}
|
|
|