Initial commit

This commit is contained in:
janisslsm committed 2026-07-27 16:20:00 +03:00
commit af3b49f756
16065 files changed
+2938410

No files matched your search

+54
View File
@@ -0,0 +1,54 @@
/* Metro module 11011; source: modules/forums/FormError.tsx; dependencies: [1244, 7246, 2] */
function _fun84360(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11197:6, offset: 0x01f47007, size: 259 bytes, params: 8, frame: 18
var object2;
const env0_0 = require;
const formSubmitError = function(a0, a1) {
var value = a1;
var value2 = null;
return {type: a0, message: value2 != value ? value : value2};
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
object2 = {EmptyContent: 0};
object2[0] = 'EmptyContent';
object2.AutomodViolation = 1;
object2[1] = 'AutomodViolation';
object2.EmptyTags = 2;
object2[2] = 'EmptyTags';
object2.ApiValidation = 3;
object2[3] = 'ApiValidation';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/FormError.tsx');
exports.FormSubmitErrorType = object2;
exports.makeEmptyTitleError = function() {
return makeEmptyContentError(require(dependencyMap[0]).intl.string(require(dependencyMap[0]).t['71wuR0']));
};
exports.makeEmptyMessageError = function() {
return makeEmptyContentError(require(dependencyMap[0]).intl.string(require(dependencyMap[0]).t['w/BT3G']));
};
exports.makeAutomodViolationError = makeAutomodViolationError;
exports.makeApiNameValidationError = makeApiNameValidationError;
exports.makeEmptyTagsError = makeEmptyTagsError;
exports.renderError = renderError;
}
function makeApiNameValidationError() { // fn#84366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11197:963, offset: 0x01f47225, size: 81 bytes, params: 1, frame: 17
const formSubmitErrorBinding = formSubmitError;
const ApiValidation = env0_2.ApiValidation;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return formSubmitErrorBinding(ApiValidation,
intl.string((require(1244) /* metro dependency 1244: indexNative */).t['71wuR0']));
}
function makeEmptyTagsError() { // fn#84367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11197:1104, offset: 0x01f47276, size: 83 bytes, params: 1, frame: 17
const formSubmitErrorBinding = formSubmitError;
const EmptyTags = env0_2.EmptyTags;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return formSubmitErrorBinding(EmptyTags,
intl.string((require(1244) /* metro dependency 1244: indexNative */).t.xPfNQi));
}
function renderError(a0, a1) { // fn#84368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11197:1223, offset: 0x01f472c9, size: 155 bytes, params: 3, frame: 14
const value = null;
return value == a0 ? value : a0.type !== env0_2.EmptyContent || value == a1.content ? a0.type !== env0_2.EmptyTags || value == a1.tags ? value != a0.message ? a0.message : value : a1.tags.length > 0 ? value : value != a0.message ? a0.message : value : a1.content.trim().length > 0 ? value : a0.type !== env0_2.EmptyTags || value == a1.tags ? value != a0.message ? a0.message : value : a1.tags.length > 0 ? value : value != a0.message ? a0.message : value;
}
@@ -0,0 +1,860 @@
/* Metro module 9621; source: modules/forums/ForumActionCreators.tsx; dependencies: [5, 661, 4647, 1244, 694, 507, 7153, 9622, 9623, 9624, 7155, 2] */
function _fun75437(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75437, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:6, offset: 0x01dad607, size: 319 bytes, params: 8, frame: 19
var object2;
const env0_0 = require;
const withErrorHandling = function() {
return _withErrorHandling.apply(this, arguments);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_4 = constantsModule.AbortCodes;
const env0_5 = constantsModule.Endpoints;
object2 = {resort: resort_75442, createForumTag: createForumTag, updateForumTag: updateForumTag,
deleteForumTag: deleteForumTag, updateForumPostTags: updateForumPostTags,
hideAdminOnboarding: hideAdminOnboarding, markPostAsSeen: markPostAsSeen, markPostAsUnseen: markPostAsUnseen,
flushSeenItems: flushSeenItems, searchForumPosts: searchForumPosts,
updateForumSearchQuery: updateForumSearchQuery, clearForumSearch: clearForumSearch};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumActionCreators.tsx');
exports.default = object2;
}
function _withErrorHandling() { // fn#75439, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:222, offset: 0x01dad746, size: 50 bytes, params: 1, frame: 14
return env0_3(_fun75441).apply(this, arguments);
}
function resort_75442(a0) { // fn#75442, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:676, offset: 0x01dad8ec, size: 54 bytes, params: 2, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'RESORT_THREADS', channelId: a0});
}
function createForumTag(a0, a1) { // fn#75443, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:756, offset: 0x01dad922, size: 139 bytes, params: 3, frame: 16
const value2 = undefined;
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const post = HTTP.post;
const object2 = {};
object2.url = Endpoints.FORUM_TAGS(a1);
object2.body = {name: a0.name, emoji_id: a0.emojiId, emoji_name: a0.emojiId != null ? value2 : a0.emojiName,
moderated: a0.moderated};
object2.rejectWithError = false;
return Reflect.apply(post, HTTP, [object2]);
}
function updateForumTag(a0, a1) { // fn#75444, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:929, offset: 0x01dad9ad, size: 270 bytes, params: 3, frame: 21
const value2 = undefined;
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const put = HTTP.put;
const FORUM_TAG = Endpoints.FORUM_TAG;
const env0_0 = Reflect.apply(put, HTTP, [{url: Reflect.apply(FORUM_TAG, Endpoints, [a1, a0.id]),
body: {name: a0.name, emoji_id: a0.emojiId, emoji_name: a0.emojiId == null ? a0.emojiName : value2,
moderated: a0.moderated}, rejectWithError: false}]);
const withErrorHandlingBinding = withErrorHandling;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const T8sBLJ = t.T8sBLJ;
withErrorHandlingBinding(_fun75445, Reflect.apply(string, intl, [T8sBLJ]), intl.string(t.imcb5u));
return value2;
}
function deleteForumTag(a0, a1) { // fn#75446, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:1228, offset: 0x01dadabb, size: 194 bytes, params: 3, frame: 22
const HTTP = (require(507) /* metro dependency 507: HTTPUtils */).HTTP;
const del = HTTP.del;
const object2 = {};
object2.url = Endpoints.FORUM_TAG(a0, a1);
object2.rejectWithError = false;
const env0_0 = Reflect.apply(del, HTTP, [object2]);
const withErrorHandlingBinding = withErrorHandling;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
withErrorHandlingBinding(_fun75447, Reflect.apply(string, intl, [t['0ZkNDU']]), intl.string(t.imcb5u));
}
function updateForumPostTags(a0, a1) { // fn#75448, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:1441, offset: 0x01dadb7d, size: 43 bytes, params: 3, frame: 11
const env0_0 = a0;
const env0_1 = a1;
return env0_3(_fun75450)();
}
function hideAdminOnboarding(a0, a1) { // fn#75451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:1599, offset: 0x01dadc4d, size: 64 bytes, params: 3, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'ADMIN_ONBOARDING_GUIDE_HIDE',
channelId: a0, hide: a1});
}
function markPostAsSeen(a0, a1, a2) { // fn#75452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:1699, offset: 0x01dadc8d, size: 72 bytes, params: 4, frame: 16
const value = require(9622) /* metro dependency 9622: AnalyticsFeedItemSeenActionCreators */;
value.markAnalyticsFeedItemSeen((require(9623) /* metro dependency 9623: ForumChannelSeenManager */).getForumPostSeenManagerId(a0),
a1, a2);
}
function markPostAsUnseen(a0, a1, a2) { // fn#75453, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:1798, offset: 0x01dadcd5, size: 72 bytes, params: 4, frame: 16
const value = require(9622) /* metro dependency 9622: AnalyticsFeedItemSeenActionCreators */;
value.markAnalyticsFeedItemUnseen((require(9623) /* metro dependency 9623: ForumChannelSeenManager */).getForumPostSeenManagerId(a0),
a1, a2);
}
function flushSeenItems(a0) { // fn#75454, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:1901, offset: 0x01dadd1d, size: 107 bytes, params: 2, frame: 16
let value = a1;
const r4 = value !== undefined ? value : (require(9624) /* metro dependency 9624: AnalyticsFeedItemSeenManager */).ForceFlushType.IMMEDIATE_WITH_COOLDOWN;
value = require(9622) /* metro dependency 9622: AnalyticsFeedItemSeenActionCreators */;
const flushAnalyticsFeedItems = value.flushAnalyticsFeedItems;
const forumChannelSeenManagerModule = require(9623) /* metro dependency 9623: ForumChannelSeenManager */;
const getForumPostSeenManagerId = forumChannelSeenManagerModule.getForumPostSeenManagerId;
Reflect.apply(flushAnalyticsFeedItems, value, [Reflect.apply(getForumPostSeenManagerId,
forumChannelSeenManagerModule, [a0]), r4]);
}
function searchForumPosts(a0, a1, a2, a3, a4) { // fn#75455, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:2058, offset: 0x01dadd88, size: 64 bytes, params: 6, frame: 11
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
const env0_4 = a4;
return env0_3(_fun75457)();
}
function updateForumSearchQuery(a0, a1) { // fn#75458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:2419, offset: 0x01dadef9, size: 64 bytes, params: 3, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'FORUM_SEARCH_QUERY_UPDATED',
channelId: a0, query: a1});
}
function clearForumSearch(a0) { // fn#75459, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:2522, offset: 0x01dadf39, size: 56 bytes, params: 2, frame: 13
(importDefault(694) /* metro dependency 694: Dispatcher */).dispatch({type: 'FORUM_SEARCH_CLEAR', channelId: a0});
}
function* _fun75441(a0, a1, a2) { // fn#75441, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:281, offset: 0x01dad783, size: 361 bytes, params: 4, frame: 22
var code;
var r3;
var value3;
var value4;
var value5;
var error;
var body;
var value6;
var NON_MODERATED_TAG_REQUIRED;
var INVALID_FORM_BODY;
var value7;
var errors;
var emoji;
var binding;
var binding2;
var value8;
var show;
var object2;
var intl;
var string;
var t;
var T8sBLJ;
var aHt1Bd;
var value9;
if (false) {
return undefined;
}
value = undefined;
try {
value3 = a0();
} catch (error) {
body = error.body;
if (body == null) {
code = value;
value6 = environment.__proto__.__proto__;
if (code === env2_4.NON_MODERATED_TAG_REQUIRED) {
binding = env2_1;
value9 = binding(env2_2[2]);
value9.show({title: a1, body: a2});
return value;
}
body = error.body;
if (body == null) {
if (value !== env2_4.INVALID_FORM_BODY) {
return value;
}
body = error.body;
value7 = body != null;
if (value7) {
errors = body.errors;
emoji = errors.emoji;
if (emoji) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
if (value7) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
code = body.code;
if (code !== env2_4.INVALID_FORM_BODY) {
return value;
}
body = error.body;
value7 = body != null;
if (value7) {
errors = body.errors;
emoji = errors.emoji;
if (emoji) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
if (value7) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
code = body.code;
value6 = environment.__proto__.__proto__;
NON_MODERATED_TAG_REQUIRED = env2_4.NON_MODERATED_TAG_REQUIRED;
if (code === NON_MODERATED_TAG_REQUIRED) {
binding = env2_1;
value9 = binding(env2_2[2]);
value9.show({title: a1, body: a2});
return value;
}
body = error.body;
if (body == null) {
if (value !== env2_4.INVALID_FORM_BODY) {
return value;
}
body = error.body;
value7 = body != null;
if (value7) {
errors = body.errors;
emoji = errors.emoji;
if (emoji) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
if (value7) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
code = body.code;
INVALID_FORM_BODY = env2_4.INVALID_FORM_BODY;
if (code !== INVALID_FORM_BODY) {
return value;
}
body = error.body;
value7 = body != null;
if (value7) {
errors = body.errors;
emoji = errors.emoji;
if (emoji) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
r3 = value7;
if (r3) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
yield value3;
try {
value4 = undefined;
value5 = false;
} catch (error) {
body = error.body;
if (body == null) {
code = value;
value6 = environment.__proto__.__proto__;
if (code === env2_4.NON_MODERATED_TAG_REQUIRED) {
binding = env2_1;
value9 = binding(env2_2[2]);
value9.show({title: a1, body: a2});
return value;
}
body = error.body;
if (body == null) {
if (value !== env2_4.INVALID_FORM_BODY) {
return value;
}
body = error.body;
value7 = body != null;
if (value7) {
errors = body.errors;
emoji = errors.emoji;
if (emoji) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
if (value7) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
code = body.code;
if (code !== env2_4.INVALID_FORM_BODY) {
return value;
}
body = error.body;
value7 = body != null;
if (value7) {
errors = body.errors;
emoji = errors.emoji;
if (emoji) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
if (value7) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
code = body.code;
value6 = environment.__proto__.__proto__;
NON_MODERATED_TAG_REQUIRED = env2_4.NON_MODERATED_TAG_REQUIRED;
if (code === NON_MODERATED_TAG_REQUIRED) {
binding = env2_1;
value9 = binding(env2_2[2]);
value9.show({title: a1, body: a2});
return value;
}
body = error.body;
if (body == null) {
if (value !== env2_4.INVALID_FORM_BODY) {
return value;
}
body = error.body;
value7 = body != null;
if (value7) {
errors = body.errors;
emoji = errors.emoji;
if (emoji) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
if (value7) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
code = body.code;
INVALID_FORM_BODY = env2_4.INVALID_FORM_BODY;
if (code !== INVALID_FORM_BODY) {
return value;
}
body = error.body;
value7 = body != null;
if (value7) {
errors = body.errors;
emoji = errors.emoji;
if (emoji) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
r3 = value7;
if (r3) {
binding = env2_1;
binding2 = env2_2;
value8 = binding(binding2[2]);
show = value8.show;
object2 = {};
binding = env2_0;
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
T8sBLJ = t.T8sBLJ;
object2.title = Reflect.apply(string, intl, [T8sBLJ]);
intl = binding(binding2[3]).intl;
string = intl.string;
t = binding(binding2[3]).t;
aHt1Bd = t.aHt1Bd;
object2.body = Reflect.apply(string, intl, [aHt1Bd]);
Reflect.apply(show, value8, [object2]);
return value;
}
return value;
}
return value5 ? value4 : value4;
}
function* _fun75450() { // fn#75450, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:1451, offset: 0x01dadbb3, size: 154 bytes, params: 1, frame: 17
if (false) {
return undefined;
}
value = environment.__proto__.__proto__;
const value3 = env2_1(env2_2[6]);
yield value3.unarchiveThreadIfNecessary(require);
if (false) {
return undefined;
}
const HTTP = env2_0(env2_2[5]).HTTP;
const patch = HTTP.patch;
const object2 = {};
object2.url = env2_5.CHANNEL(require);
object2.body = {applied_tags: importDefault};
object2.rejectWithError = false;
return Reflect.apply(patch, HTTP, [object2]);
}
function* _fun75457() { // fn#75457, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9807:2074, offset: 0x01daddd3, size: 294 bytes, params: 1, frame: 24
var object2;
var binding2;
var property;
var value5;
var searchThreads;
var value6;
var value7;
var value8;
var binding3;
var value9;
var trackForumSearched;
var length;
var value10;
var error;
if (true) {
value = environment.__proto__.__proto__;
var binding = env2_1;
var value3 = binding(env2_2[4]);
var dispatch = value3.dispatch;
Reflect.apply(dispatch, value3, [{type: 'FORUM_SEARCH_START', channelId: importDefault}]);
reducibleJoin3: while (true) {
reduciblePort44: while (true) {
exceptionLanding43: while (true) {
try {
binding = env2_1;
} catch (error) {
break exceptionLanding43;
}
break reducibleJoin3;
}
binding = env2_1;
value = binding(env2_2[4]);
dispatch = value.dispatch;
Reflect.apply(dispatch, value, [{type: 'FORUM_SEARCH_FAILURE', channelId: importDefault}]);
break reduciblePort44;
}
return undefined;
}
try {
binding2 = env2_2;
} catch (error) {
break exceptionLanding43;
}
try {
property = binding2[6];
} catch (error) {
break exceptionLanding43;
}
try {
value5 = binding(property);
} catch (error) {
break exceptionLanding43;
}
try {
searchThreads = value5.searchThreads;
} catch (error) {
break exceptionLanding43;
}
try {
} catch (error) {
break exceptionLanding43;
}
try {
} catch (error) {
break exceptionLanding43;
}
try {
} catch (error) {
break exceptionLanding43;
}
try {
binding = env1_3;
} catch (error) {
break exceptionLanding43;
}
try {
} catch (error) {
break exceptionLanding43;
}
try {
value6 = Reflect.apply(searchThreads, value5, [require, importDefault, dependencyMap, binding, AbortCodes]);
} catch (error) {
break exceptionLanding43;
}
yield value6;
try {
value7 = undefined;
value8 = false;
} catch (error) {
break exceptionLanding43;
}
if (value8) {
return value7;
}
try {
binding = env2_0;
} catch (error) {
break exceptionLanding43;
}
try {
binding3 = env2_2;
} catch (error) {
break exceptionLanding43;
}
try {
property = binding3[10];
} catch (error) {
break exceptionLanding43;
}
try {
value9 = binding(property);
} catch (error) {
break exceptionLanding43;
}
try {
trackForumSearched = value9.trackForumSearched;
} catch (error) {
break exceptionLanding43;
}
try {
object2 = {};
} catch (error) {
break exceptionLanding43;
}
try {
} catch (error) {
break exceptionLanding43;
}
try {
object2.guildId = require;
} catch (error) {
break exceptionLanding43;
}
try {
} catch (error) {
break exceptionLanding43;
}
try {
object2.channelId = importDefault;
} catch (error) {
break exceptionLanding43;
}
try {
length = value7.length;
} catch (error) {
break exceptionLanding43;
}
try {
object2.numSearchResults = length;
} catch (error) {
break exceptionLanding43;
}
try {
Reflect.apply(trackForumSearched, value9, [object2]);
} catch (error) {
break exceptionLanding43;
}
try {
binding = env2_1;
} catch (error) {
break exceptionLanding43;
}
try {
property = binding3[4];
} catch (error) {
break exceptionLanding43;
}
try {
value10 = binding(property);
} catch (error) {
break exceptionLanding43;
}
try {
dispatch = value10.dispatch;
} catch (error) {
break exceptionLanding43;
}
try {
object2 = {};
} catch (error) {
break exceptionLanding43;
}
try {
object2.type = 'FORUM_SEARCH_SUCCESS';
} catch (error) {
break exceptionLanding43;
}
try {
object2.channelId = importDefault;
} catch (error) {
break exceptionLanding43;
}
try {
object2.threadIds = value7;
} catch (error) {
break exceptionLanding43;
}
try {
Reflect.apply(dispatch, value10, [object2]);
} catch (error) {
break exceptionLanding43;
}
}
}
@@ -0,0 +1,561 @@
/* Metro module 6897; source: modules/forums/ForumActivePostStore.tsx; dependencies: [6, 7, 15, 17, 18, 4790, 6898, 1226, 1379, 4605, 1934, 1388, 1390, 22, 6899, 21, 1421, 566, 694, 2] */
function _fun54785(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54785, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:6, offset: 0x0136debd, size: 758 bytes, params: 8, frame: 22
let env0_0 = require;
const _arrayLikeToArray_54791 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const getLastMessageId = function(a0) {
var value = a0;
return ReadStateStore.lastMessageId(value) ?? value;
};
const getSortFunction = function(a0) {
var env0_0 = a0;
return _fun54794;
};
const closure = function() {
var value2 = SelectedChannelStore.getChannelId();
if (value2 != null) {
var value3 = ChannelStore.getChannel(value2);
if (value3 == null) {
resetState();
return false;
}
if (value3.isForumLikeChannel()) {
rebuildState({refreshThreadIds: true});
return undefined;
}
}
resetState();
return false;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
const activeThreadsStore = importDefault(4790) /* metro dependency 4790: ActiveThreadsStore */;
const threadMessageStore = importDefault(6898) /* metro dependency 6898: ThreadMessageStore */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
items = [];
let Set = global.Set;
let set = new Set();
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
const env0_19 = ThreadSortOrder.LATEST_ACTIVITY;
const ThreadSearchTagSetting = (require(1390) /* metro dependency 1390: ThreadSearchTagSetting */).ThreadSearchTagSetting;
const env0_20 = ThreadSearchTagSetting.MATCH_SOME;
const env0_22 = [];
const env0_24 = [];
const env0_25 = (importDefault(22) /* metro dependency 22 */).chain(items);
const env0_26 = (importDefault(22) /* metro dependency 22 */).chain(items);
Set = global.Set;
set = new Set();
Set = global.Set;
set = new Set();
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun54804(Store).displayName = 'ForumActivePostStore';
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: closure,
OVERLAY_INITIALIZE: closure, GUILD_CREATE: closure, CHANNEL_SELECT: closure,
CHANNEL_DELETE: CHANNEL_DELETE_54813, THREAD_LIST_SYNC: THREAD_LIST_SYNC_54814,
THREAD_CREATE: THREAD_CREATE_54815, THREAD_UPDATE: THREAD_UPDATE_54816, THREAD_DELETE: THREAD_DELETE_54817,
RESORT_THREADS: RESORT_THREADS_54818, CHANNEL_ACK: CHANNEL_ACK_54819});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumActivePostStore.tsx');
exports.default = set;
exports.computeThreadIdsSnapshot = computeThreadIdsSnapshot;
}
function _isNativeReflectConstruct_54786() { // fn#54786, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:211, offset: 0x0136e1b3, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_54786_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_54789(a0, a1) { // fn#54789, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:404, offset: 0x0136e211, size: 370 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun54790;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_54791(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_54791(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_54791(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun54790;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function getSortFunction(a0) { // fn#54793, offset: 0x0136e3a3, size: 16 bytes, params: 2, frame: 2
const env0_0 = a0;
return _fun54794;
}
function resetState() { // fn#54795, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:1843, offset: 0x0136e491, size: 226 bytes, params: 1, frame: 16
env0_22 = [];
const Set = global.Set;
const set = new Set();
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
env0_19 = ThreadSortOrder.LATEST_ACTIVITY;
const ThreadSearchTagSetting = (require(1390) /* metro dependency 1390: ThreadSearchTagSetting */).ThreadSearchTagSetting;
env0_20 = ThreadSearchTagSetting.MATCH_SOME;
env0_24 = [];
env0_25 = (importDefault(22) /* metro dependency 22 */).chain(env0_15);
env0_26 = (importDefault(22) /* metro dependency 22 */).chain(env0_15);
env0_28.clear();
env0_27.clear();
}
function rebuildState(a0) { // fn#54797, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:2229, offset: 0x0136e5cd, size: 622 bytes, params: 2, frame: 24
var r4;
var r3;
var r0;
var size;
var binding;
var Array;
var from;
var Set;
var items2;
var value7;
var set;
var value11;
var sort;
var getSortFunctionBinding;
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
var value14;
var value16;
const channel = ChannelStore.getChannel(env0_17);
const value3 = null;
if (value3 != channel) {
r4 = value3 != a0 && a0.refreshThreadIds;
env0_24 = r4 ? global.Object.values(ActiveThreadsStore.getThreadsForParent(channel.guild_id,
channel.id)).map(function(a0) {
return a0.id;
}) : env0_24;
size = env0_27.size;
if (size !== 0) {
binding = env0_24;
env0_24 = binding.filter(_fun54799);
binding = env0_27;
binding.clear();
}
size = env0_28.size;
if (size !== 0) {
Array = global.Array;
from = Array.from;
Set = global.Set;
binding = env0_24;
items2 = [];
arraySpread(items2, env0_28, arraySpread(items2, binding, 0, undefined), undefined);
value7 = Object.create(Set.prototype, {constructor: {value: Set}});
set = new Set();
env0_24 = Reflect.apply(from, Array, [set instanceof Object ? set : value7]);
binding = env0_28;
binding.clear();
}
r3 = value3 != a0 && a0.refreshThreadIds;
r3 = !r3 ? value3 != a0 && a0.sortThreadIds : r3;
if (r3) {
value11 = (importDefault(22) /* metro dependency 22 */).chain(env0_24);
sort = value11.sort;
getSortFunctionBinding = getSortFunction;
env0_26 = Reflect.apply(sort, value11, [getSortFunctionBinding(ThreadSortOrder.LATEST_ACTIVITY)]);
env0_25 = (importDefault(22) /* metro dependency 22 */).chain(env0_24).sort(getSortFunctionBinding(ThreadSortOrder.CREATION_DATE));
}
r4 = LATEST_ACTIVITY === ThreadSortOrder.LATEST_ACTIVITY ? env0_26 : env0_25;
value14 = r4.value();
size = env0_18.size;
r4 = size === 0 ? value14 : value14.filter(getFilterFunction(env0_18, MATCH_SOME));
value16 = r4.find(_fun54803);
r0 = value3 == value16 ? value3 : value16;
}
}
function _fun54804(a0) { // fn#54804, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:3288, offset: 0x0136e971, size: 216 bytes, params: 2, frame: 16
const closure = ForumActivePostStore;
env0_7(closure, a0);
return env0_4(closure, [{key: 'initialize', value: function() {
this.waitFor(ActiveThreadsStore, AuthenticationStore, ChannelStore, ReadStateStore, SelectedChannelStore,
ThreadMessageStore);
}}, {key: 'getNewThreadCount', value: value_54807}, {key: 'getCanAckThreads', value: value_54808},
{key: 'getThreadIds', value: value_54809}, {key: 'getCurrentThreadIds', value: value_54810},
{key: 'getAndDeleteMostRecentUserCreatedThreadId', value: value_54811}, {key: 'getFirstNoReplyThreadId',
value: value_54812}]);
}
function CHANNEL_DELETE_54813({channel}) { // fn#54813, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:4422, offset: 0x0136eb26, size: 53 bytes, params: 2, frame: 10
if (channel.parent_id == null) {
return false;
}
if (channel.parent_id !== env0_17) {
return false;
}
resetState();
}
function THREAD_LIST_SYNC_54814({guildId}) { // fn#54814, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:4542, offset: 0x0136eb5b, size: 90 bytes, params: 2, frame: 15
var r1;
var r0;
var channel;
var value4;
var value5;
const value2 = env0_17 != null;
if (value2) {
channel = ChannelStore.getChannel(env0_17);
value4 = undefined;
value5 = guildId === (channel == null ? value4 : channel.guild_id);
if (value5) {
rebuildState({refreshThreadIds: true});
r1 = value4;
} else {
r1 = value5;
}
r0 = r1;
} else {
r0 = value2;
}
return r0;
}
function THREAD_CREATE_54815({channel, isNewlyCreated}) { // fn#54815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:4716, offset: 0x0136ebb5, size: 120 bytes, params: 2, frame: 14
var r1;
var id;
var binding;
var value2;
let r0 = channel.parent_id != null && channel.parent_id === env0_17;
if (r0) {
if (isNewlyCreated) {
if (channel.ownerId !== AuthenticationStore.getId()) {
binding = env0_21;
value2 = typeof binding === 'bigint' ? binding : +binding;
env0_21 = typeof value2 === 'bigint' ? value2 + 1n : +value2 + 1;
} else {
id = channel.id;
}
r1 = undefined;
} else {
r1 = !!isNewlyCreated;
}
r0 = r1;
}
return r0;
}
function THREAD_UPDATE_54816({channel}) { // fn#54816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:4878, offset: 0x0136ec2d, size: 198 bytes, params: 2, frame: 16
if (channel.parent_id != null) {
if (channel.parent_id !== env0_17) {
return false;
}
var moduleValue = require(6899) /* metro dependency 6899: ForumUtils */;
var isForumPostPinned = moduleValue.isForumPostPinned;
var id = channel.id;
var isForumPostPinned2 = Reflect.apply(isForumPostPinned, moduleValue, [id]);
var binding = env0_28;
var has = binding.has;
id = channel.id;
var value2 = Reflect.apply(has, binding, [id]);
if (isForumPostPinned2) {
if (value2) {
if (isForumPostPinned2) {
return false;
}
if (value2) {
env0_28.delete(channel.id);
rebuildState({sortThreadIds: true});
return undefined;
}
return false;
}
binding = env0_28;
binding.add(channel.id);
rebuildState({sortThreadIds: true});
return undefined;
}
if (isForumPostPinned2) {
return false;
}
if (value2) {
env0_28.delete(channel.id);
rebuildState({sortThreadIds: true});
return undefined;
}
}
return false;
}
function THREAD_DELETE_54817({channel}) { // fn#54817, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:5161, offset: 0x0136ecf3, size: 82 bytes, params: 2, frame: 12
if (channel.parent_id == null) {
return false;
}
if (channel.parent_id !== env0_17) {
return false;
}
const binding = env0_27;
binding.add(channel.id);
rebuildState({sortThreadIds: true});
}
function RESORT_THREADS_54818({channelId}) { // fn#54818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:5310, offset: 0x0136ed45, size: 51 bytes, params: 2, frame: 11
if (channelId == null) {
return false;
}
if (channelId !== env0_17) {
return false;
}
rebuildState({refreshThreadIds: true});
}
function CHANNEL_ACK_54819({channelId}) { // fn#54819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:5430, offset: 0x0136ed78, size: 39 bytes, params: 2, frame: 3
if (channelId == null) {
return false;
}
if (channelId !== env0_17) {
return false;
}
}
function computeThreadIdsSnapshot(a0) { // fn#54820, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:5622, offset: 0x0136ed9f, size: 121 bytes, params: 2, frame: 16
var r0;
var Object;
var value4;
const channel = ChannelStore.getChannel(a0);
if (channel == null) {
r0 = [];
} else {
Object = global.Object;
value4 = Object.values(ActiveThreadsStore.getThreadsForParent(channel.guild_id, channel.id)).map(function(a0) {
return a0.id;
});
r0 = value4.sort(getSortFunction(LATEST_ACTIVITY));
}
return r0;
}
function _fun54794(a0, a1) { // fn#54794, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:1628, offset: 0x0136e3b3, size: 222 bytes, params: 3, frame: 19
var r2;
var r1;
var r0;
var compare;
var defaultImport;
var getLastMessageIdBinding;
let value = environment.__proto__;
if ((require(6899) /* metro dependency 6899: ForumUtils */).isForumPostPinned(a0)) {
r0 = -1;
} else {
if ((require(6899) /* metro dependency 6899: ForumUtils */).isForumPostPinned(a1)) {
r1 = 1;
} else {
if (env0_0 === (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder.LATEST_ACTIVITY) {
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
compare = defaultImport.compare;
getLastMessageIdBinding = getLastMessageId;
value = getLastMessageIdBinding(a1);
value = Reflect.apply(compare, defaultImport, [value, getLastMessageIdBinding(a0)]);
r2 = value;
} else {
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.compare(a1, a0);
r2 = value;
}
r1 = r2;
}
r0 = r1;
}
return r0;
}
function _fun54799(a0) { // fn#54799, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:2428, offset: 0x0136e83b, size: 25 bytes, params: 2, frame: 11
const binding = env1_27;
return !binding.has(a0);
}
function getFilterFunction(a0, a1) { // fn#54800, owner: rebuildState.getFilterFunction, offset: 0x0136e854, size: 23 bytes, params: 3, frame: 2
const env0_0 = a0;
const env0_1 = a1;
return _fun54801;
}
function _fun54803(a0) { // fn#54803, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:3190, offset: 0x0136e94b, size: 38 bytes, params: 2, frame: 11
let value = environment.__proto__;
value = ThreadMessageStore.getCount(a0);
return value === null || value === 0;
}
function value_54809(a0, a1, a2, a3) { // fn#54809, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:3788, offset: 0x0136ea78, size: 159 bytes, params: 5, frame: 20
const binding = env1_17;
const value2 = (require(1421) /* metro dependency 1421: SetUtils */).areSetsEqual(a2, env1_18);
const value3 = !value2;
const value4 = a3 !== MATCH_SOME;
env1_17 = a0;
env1_18 = a2;
env1_19 = a1;
env1_20 = a3;
if (a0 !== binding) {
rebuildState({refreshThreadIds: true});
} else if (a1 !== LATEST_ACTIVITY) {
rebuildState({sortThreadIds: true});
} else if (value2 ? value4 : value3) {
rebuildState();
}
return env1_22;
}
function value_54811() { // fn#54811, offset: 0x0136eb17, size: 15 bytes, params: 1, frame: 3
return env1_16;
}
function _fun54801(a0) { // fn#54801, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7075:2872, offset: 0x0136e86b, size: 202 bytes, params: 2, frame: 16
var environment;
var value6;
var includes;
var value7;
let value = environment.__proto__.__proto__;
const appliedTags = ChannelStore.getChannel(a0)?.appliedTags;
if (appliedTags != null) {
if (appliedTags.length === 0) {
return false;
}
var ThreadSearchTagSetting = (require(1390) /* metro dependency 1390: ThreadSearchTagSetting */).ThreadSearchTagSetting;
var MATCH_SOME = ThreadSearchTagSetting.MATCH_SOME;
if (require === MATCH_SOME) {
return appliedTags.some(_fun54802);
}
var _createForOfIteratorHelperLoose_54789Binding = _createForOfIteratorHelperLoose_54789;
var binding = env0_0;
value = _createForOfIteratorHelperLoose_54789Binding(binding.values());
var value5 = value();
var done = value5.done;
if (done) {
return true;
}
var r1 = value5;
loopExit6: while (true) {
value6 = r1.value;
includes = appliedTags.includes;
if (Reflect.apply(includes, appliedTags, [value6])) {
value7 = value();
done = value7.done;
if (done) {
return true;
}
r1 = value7;
continue;
}
break loopExit6;
}
}
return false;
}
@@ -0,0 +1,135 @@
/* Metro module 11547; source: modules/forums/ForumChannelStore.tsx; dependencies: [7, 6, 1379, 1389, 1388, 1390, 690, 44, 7160, 629, 566, 2] */
function _fun88510(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11733:6, offset: 0x01fe62e4, size: 340 bytes, params: 8, frame: 20
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importDefault(7) /* metro dependency 7 */;
const env0_3 = importDefault(6) /* metro dependency 6 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const Set = global.Set;
const set = new Set();
object2 = {};
const ForumLayout = (require(1389) /* metro dependency 1389: ForumLayout */).ForumLayout;
const LIST = ForumLayout.LIST;
object2.layoutType = LIST;
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
const CREATION_DATE = ThreadSortOrder.CREATION_DATE;
object2.sortOrder = CREATION_DATE;
object2.tagFilter = set;
const ThreadSearchTagSetting = (require(1390) /* metro dependency 1390: ThreadSearchTagSetting */).ThreadSearchTagSetting;
const MATCH_SOME = ThreadSearchTagSetting.MATCH_SOME;
object2.tagSetting = MATCH_SOME;
const env0_7 = value(ForumChannelStoreState);
const env0_8 = (require(629) /* metro dependency 629 */).create(_fun88520);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumChannelStore.tsx');
exports.useForumChannelStore = useForumChannelStore;
exports.useForumChannelStoreApi = useForumChannelStoreApi;
}
function ForumChannelStoreState(a0, a1) { // fn#88511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11733:294, offset: 0x01fe6438, size: 149 bytes, params: 3, frame: 14
env0_3(this, ForumChannelStoreState);
this.set = a0;
this.get = a1;
this.channelStates = {};
this.setChannelState = setChannelState;
this.getChannelState = getChannelState;
this.toggleTagFilter = toggleTagFilter;
this.setTagFilter = setTagFilter;
this.setSortOrder = setSortOrder;
this.setLayoutType = setLayoutType;
this.setTagSetting = setTagSetting;
}
function useForumChannelStore(a0) { // fn#88521, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11733:1524, offset: 0x01fe6798, size: 97 bytes, params: 2, frame: 17
const env0_0 = a0;
const value2 = env0_8();
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
return Reflect.apply(useStateFromStores, fluxModule, [[ChannelStore],
_fun88522]) == null ? env0_6 : value2.getChannelState(a0);
}
function setChannelState(a0, a1) { // fn#88512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11733:427, owner: ForumChannelStoreState.setChannelState, offset: 0x01fe64cd, size: 122 bytes, params: 3, frame: 14
var environment;
const binding = env0_0;
let value = binding.get();
const channelState = binding.getChannelState(a0);
const object3 = {};
copyDataProperties(object3, value.channelStates, channelState);
const object4 = {};
copyDataProperties(object4, a1, copyDataProperties(object4, channelState, channelState));
object3[a0] = object4;
value = environment.__proto__;
(require(690) /* metro dependency 690: ReactBatchUpdatesNative */).batchUpdates(_fun88513);
}
function getChannelState(a0) { // fn#88514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11733:596, owner: ForumChannelStoreState.getChannelState, offset: 0x01fe6568, size: 167 bytes, params: 2, frame: 16
var r0;
var value;
var channel;
var object2;
if (a0 == null) {
value = environment.__proto__;
return env1_6;
}
const binding = env0_0;
const get = binding.get;
const property = Reflect.apply(get, binding, []).channelStates[a0];
if (property != null) {
r0 = property;
} else {
value = environment.__proto__;
channel = ChannelStore.getChannel(a0);
(importDefault(44) /* metro dependency 44 */)(channel != null,
'[Forum Channel Store] The channel should not be missing.');
object2 = {};
object2.layoutType = channel.getDefaultLayout();
object2.sortOrder = channel.getDefaultSortOrder();
object2.tagFilter = env1_5;
object2.tagSetting = channel.getDefaultTagSetting();
r0 = object2;
}
return r0;
}
function toggleTagFilter(a0, a1) { // fn#88515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11733:913, owner: ForumChannelStoreState.toggleTagFilter, offset: 0x01fe660f, size: 113 bytes, params: 3, frame: 15
const channelState = env0_0.getChannelState(a0);
const Set = global.Set;
const set = new Set(channelState.tagFilter);
if (set.has(a1)) {
set.delete(a1);
} else {
set.add(a1);
}
env0_0.setTagFilter(a0, set);
}
function setTagFilter(a0, a1) { // fn#88516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11733:1046, owner: ForumChannelStoreState.setTagFilter, offset: 0x01fe6680, size: 70 bytes, params: 3, frame: 14
env0_0.setChannelState(a0, {tagFilter: a1});
const value = environment.__proto__;
(importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */).setFilterTagIds(a1);
}
function ForumChannelStoreStateSetSortOrder(a0, a1) { // fn#88517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11733:1138, owner: ForumChannelStoreState.setSortOrder, offset: 0x01fe66c6, size: 70 bytes, params: 3, frame: 14
env0_0.setChannelState(a0, {sortOrder: a1});
const value = environment.__proto__;
(importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */).setSortOrder(a1);
}
function setLayoutType(a0, a1) { // fn#88518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11733:1228, owner: ForumChannelStoreState.setLayoutType, offset: 0x01fe670c, size: 70 bytes, params: 3, frame: 14
env0_0.setChannelState(a0, {layoutType: a1});
const value = environment.__proto__;
(importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */).setLayout(a1);
}
function ForumChannelStoreStateSetTagSetting(a0, a1) { // fn#88519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11733:1316, owner: ForumChannelStoreState.setTagSetting, offset: 0x01fe6752, size: 70 bytes, params: 3, frame: 14
env0_0.setChannelState(a0, {tagSetting: a1});
const value = environment.__proto__;
(importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */).setTagSetting(a1);
}
function _fun88513() { // fn#88513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11733:540, offset: 0x01fe6547, size: 33 bytes, params: 1, frame: 12
return env1_0.set({channelStates: env0_0});
}
@@ -0,0 +1,9 @@
/* Metro module 6895; source: modules/forums/ForumChannelTypes.tsx; dependencies: [2] */
function _fun54745(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54745, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7073:6, offset: 0x0136d387, size: 92 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumChannelTypes.tsx');
exports.ReservedTagIds = {'HARASSMENT': '1000', 'SPAM': '1001', 'BAN_EVASION': '1002', 'SERVER_RULES': '1003',
'MULTIPLE_REPORTS': '1004', 'RESOLVED': '1005'};
}
+19
View File
@@ -0,0 +1,19 @@
/* Metro module 6900; source: modules/forums/ForumConstants.tsx; dependencies: [2] */
function _fun54883(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54883, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7078:6, offset: 0x013703bd, size: 241 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const object = {DURATION_AGO: 0};
object[0] = 'DURATION_AGO';
object.POSTED_DURATION_AGO = 1;
object[1] = 'POSTED_DURATION_AGO';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumConstants.tsx');
exports.FORUM_GUIDELINES_ACTION_SHEET = 'forum-guidelines-action-sheet';
exports.MAX_FORUM_TAGS = 20;
exports.MAX_FORUM_POST_TAGS = 5;
exports.MAX_FORUM_TEMPLATE_LENGTH = 256;
exports.ForumOnboardingCTAs = {PERMISSIONS: 'Permissions', GUIDELINES: 'Guidelines',
RECOMMENDED_TAGS: 'Recommended Tags', TAGS: 'Tags', DEFAULT_REACTION: 'Default Reaction',
CREATE_POST: 'Create Post'};
exports.ForumTimestampFormats = object;
}
@@ -0,0 +1,96 @@
/* Metro module 11024; source: modules/forums/ForumGuidelinesManager.tsx; dependencies: [6, 7, 15, 17, 18, 587, 4860, 2] */
function _fun84426(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84426, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11210:6, offset: 0x01f49fc8, size: 226 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
let value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
value = _fun84430(value);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumGuidelinesManager.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_84427() { // fn#84427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11210:148, offset: 0x01f4a0aa, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_84427_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun84430(a0) { // fn#84430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11210:380, offset: 0x01f4a10c, size: 147 bytes, params: 2, frame: 16
const closure = ForumGuidelinesManager;
env0_6(closure, a0);
return env0_3(closure, [{key: '_initialize', value: value_84432}, {key: '_terminate', value: function() {
var Storage = require(dependencyMap[5]).Storage;
Storage.set('formGuidelinesStorageKey', this.seenForumGuidelines);
}}, {key: 'markAsSeen', value: function(a0) {
this.seenForumGuidelines.add(a0);
require(dependencyMap[5]).Storage.set('formGuidelinesStorageKey', this.seenForumGuidelines);
}}, {key: 'hasSeen', value: function(a0) {
return this.seenForumGuidelines.has(a0);
}}]);
}
function ForumGuidelinesManager(a0) { // fn#84431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11210:392, offset: 0x01f4a19f, size: 160 bytes, params: 2, frame: 19
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_2;
binding(this, ForumGuidelinesManager);
const items2 = [];
arraySpread(items2, value, 0, items2);
value = env1_5(ForumGuidelinesManager);
binding = env1_4;
if (_isNativeReflectConstruct_84427()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items2, env1_5(this).constructor);
r0 = value;
} else {
value = value.apply(this, items2);
r0 = value;
}
value = binding(this, r0);
const Set = global.Set;
const value4 = Object.create(Set.prototype, {constructor: {value: Set}});
const set = new Set();
value.seenForumGuidelines = set instanceof Object ? set : value4;
return value;
}
function value_84432() { // fn#84432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11210:762, offset: 0x01f4a23f, size: 95 bytes, params: 1, frame: 12
let value = environment.__proto__;
const Storage = (require(587) /* metro dependency 587: Storage */).Storage;
value = Storage.get('formGuidelinesStorageKey');
if (value != null) {
this.seenForumGuidelines = new global.Set(value);
}
}
+983
View File
@@ -0,0 +1,983 @@
/* Metro module 9619; source: modules/forums/ForumHooks.tsx; dependencies: [5, 31, 6540, 5071, 4790, 6898, 1379, 6269, 1867, 3784, 4605, 1878, 6897, 6865, 9620, 7156, 6900, 661, 1386, 1243, 566, 6899, 694, 22, 1360, 4594, 21, 7169, 1388, 8190, 4634, 8349, 9587, 9621, 5097, 2] */
function _fun75346(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75346, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:6, offset: 0x01dab348, size: 846 bytes, params: 8, frame: 23
let env0_0 = require;
const closure = useDefaultReactionEmoji;
const closure2 = function(a0) {
var env0_0 = a0;
return require(dependencyMap[20]).useStateFromStores([PermissionStore], _fun75353);
};
const closure3 = function({channelId}) {
return require(dependencyMap[20]).useStateFromStoresObject([ForumSearchStore], _fun75355);
};
const closure4 = function(a0, a1) {
var env0_0 = a0;
var env0_1 = a1;
return require(dependencyMap[20]).useStateFromStores([ActiveJoinedThreadsStore, ReadStateStore, ChannelStore],
_fun75357);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importAll(31) /* metro dependency 31 */;
const emojiStore = importDefault(6540) /* metro dependency 6540: EmojiStore */;
const activeJoinedThreadsStore = importDefault(5071) /* metro dependency 5071: ActiveJoinedThreadsStore */;
const activeThreadsStore = importDefault(4790) /* metro dependency 4790: ActiveThreadsStore */;
const threadMessageStore = importDefault(6898) /* metro dependency 6898: ThreadMessageStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildMemberRequesterStore = importDefault(6269) /* metro dependency 6269: GuildMemberRequesterStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const forumActivePostStore = importDefault(6897) /* metro dependency 6897: ForumActivePostStore */;
const forumPostMessagesStore = importDefault(6865) /* metro dependency 6865: ForumPostMessagesStore */;
const forumPostUnreadCountStore = importDefault(9620) /* metro dependency 9620: ForumPostUnreadCountStore */;
const forumSearchStore = importDefault(7156) /* metro dependency 7156: ForumSearchStore */;
const env0_19 = (require(6900) /* metro dependency 6900: ForumConstants */).ForumTimestampFormats;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_20 = constantsModule.AnalyticsObjectTypes;
const env0_21 = constantsModule.AnalyticsObjects;
const env0_22 = constantsModule.EMPTY_STRING_SNOWFLAKE_ID;
const env0_23 = constantsModule.Permissions;
const env0_24 = (require(1386) /* metro dependency 1386: ChannelConstants */).ChannelFlags;
const env0_25 = (require(1243) /* metro dependency 1243: ThreadConstants */).MAX_THREAD_UNREAD_MESSAGE_COUNT;
const env0_26 = {'isNew': false, 'hasUnreads': false};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumHooks.tsx');
exports.useLoadForumUnreadCounts = useLoadForumUnreadCounts;
exports.useExistingPin = function(a0) {
var env0_0 = a0;
return require(dependencyMap[20]).useStateFromStores([ActiveThreadsStore, ChannelStore], _fun75364);
};
exports.useFacepileUsers = useFacepileUsers;
exports.useLastActiveTimestamp = useLastActiveTimestamp;
exports.useMostUsedReaction = useMostUsedReaction;
exports.useDefaultReactionEmoji = closure;
exports.useSomeForumPostReactions = useSomeForumPostReactions;
exports.useMaxPossibleForumPostReactions = useMaxPossibleForumPostReactions;
exports.useMessageCount = useMessageCount;
exports.useForumPostMessageAuthor = useForumPostMessageAuthor;
exports.useForumPostAuthor = useForumPostAuthor;
exports.getForumPostAuthor = getForumPostAuthor;
exports.useForumPostFirstMessageMarkup = useForumPostFirstMessageMarkup;
exports.useCanManageChannel = function(a0) {
var env0_0 = a0;
return require(dependencyMap[20]).useStateFromStores([PermissionStore], _fun75397);
};
exports.useForumPostReadStates = function(a0) {
var env0_0 = a0;
return require(dependencyMap[20]).useStateFromStoresObject([GuildStore, ReadStateStore], _fun75399);
};
exports.useChannelTemplate = useChannelTemplate;
exports.useForumThreadsForChannelList = useForumThreadsForChannelList;
exports.useCanSearchForumPosts = closure2;
exports.useCanViewArchivedPosts = function(a0) {
var env0_0 = a0;
return require(dependencyMap[20]).useStateFromStores([PermissionStore], _fun75405);
};
exports.useForumSearchQuery = function({channelId}) {
return require(dependencyMap[20]).useStateFromStores([ForumSearchStore], _fun75407);
};
exports.useForumSearchState = closure3;
exports.useHasForumSearchQuery = function(a0) {
var env0_0 = a0;
return require(dependencyMap[20]).useStateFromStores([ForumSearchStore], _fun75409);
};
exports.useAutomaticForumSearch = useAutomaticForumSearch;
exports.useUnreadThreadsCountForParent = closure4;
exports.useForumActiveThreadIds = useForumActiveThreadIds;
}
function sortForumPostReactionsByPopularityDesc(a0) { // fn#75347, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:481, offset: 0x01dab696, size: 81 bytes, params: 2, frame: 15
return (importDefault(22) /* metro dependency 22 */).orderBy(a0, [function(a0) {
return a0.count + a0.burst_count;
}, function(a0) {
return a0.burst_count;
}], ['desc', 'desc']);
}
function useDefaultReactionEmoji(a0) { // fn#75350, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:620, offset: 0x01dab706, size: 193 bytes, params: 2, frame: 17
const value = null;
const defaultReactionEmoji = value == a0 ? undefined : a0.defaultReactionEmoji;
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmojiStore], _fun75351);
return value == defaultReactionEmoji ? value : value == defaultReactionEmoji.emojiId ? value != defaultReactionEmoji.emojiName ? {id: defaultReactionEmoji.emojiId,
name: defaultReactionEmoji.emojiName,
animated: false} : value : value != value4 ? {id: defaultReactionEmoji.emojiId, name: value4.name,
animated: value4.animated} : value != defaultReactionEmoji.emojiName ? {id: defaultReactionEmoji.emojiId,
name: defaultReactionEmoji.emojiName, animated: false} : value;
}
function useCanSearchForumPosts(a0) { // fn#75352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:1007, offset: 0x01dab80a, size: 66 bytes, params: 2, frame: 14
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun75353);
}
function useForumSearchState({channelId}) { // fn#75354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:1120, offset: 0x01dab872, size: 72 bytes, params: 2, frame: 14
return (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ForumSearchStore], function() {
var object = {};
var channelIdBinding = channelId;
object.isSearchLoading = ForumSearchStore.getSearchLoading(channelIdBinding);
object.searchQuery = ForumSearchStore.getSearchQuery(channelIdBinding);
object.searchResults = ForumSearchStore.getSearchResults(channelIdBinding);
return object;
});
}
function useUnreadThreadsCountForParent(a0, a1) { // fn#75356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:1326, offset: 0x01dab906, size: 89 bytes, params: 3, frame: 15
const env0_0 = a0;
const env0_1 = a1;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ActiveJoinedThreadsStore, ReadStateStore,
ChannelStore], _fun75357);
}
function useLoadForumUnreadCounts(a0, a1, a2, a3) { // fn#75358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:1880, offset: 0x01daba7f, size: 151 bytes, params: 5, frame: 20
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const env0_3 = a3;
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ActiveThreadsStore], _fun75359);
value2.useEffect(_fun75360, [a0.id, a0.guild_id, value2, a2, a1, a3]);
}
function useExistingPin(a0) { // fn#75363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:2389, offset: 0x01dabc62, size: 74 bytes, params: 2, frame: 15
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ActiveThreadsStore, ChannelStore],
_fun75364);
}
function useFacepileUsers(a0, a1) { // fn#75366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:2673, offset: 0x01dabd5e, size: 106 bytes, params: 3, frame: 17
const env0_0 = a0;
const env0_1 = a1;
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([UserStore], _fun75367);
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(_fun75369);
return value2;
}
function useLastActiveTimestamp(a0, a1) { // fn#75371, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:2914, offset: 0x01dabe56, size: 205 bytes, params: 3, frame: 19
let value = a2;
const env0_0 = a0;
const env0_1 = a1;
const r1 = value !== undefined ? value : ForumTimestampFormats.DURATION_AGO;
const binding = undefined;
const value2 = binding.useMemo(_fun75372, [a0.id]);
value = require(7169) /* metro dependency 7169: ThreadUtils */;
value = value.useLastMessageTimestamp(a0);
return binding.useMemo(_fun75374, [value, a1, value2, binding.useMemo(_fun75373, [a1, r1])]);
}
function useMostUsedReaction(a0) { // fn#75375, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:3301, offset: 0x01dac00b, size: 61 bytes, params: 2, frame: 15
const env0_0 = a0;
return env0_4.useMemo(_fun75376, [a0?.reactions]);
}
function useSomeForumPostReactions({message, parentChannel, count, sorted}) { // fn#75377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:3585, offset: 0x01dac08d, size: 255 bytes, params: 2, frame: 21
var object2;
let value = undefined;
count = count === value ? 1 : count;
sorted = sorted === value || sorted;
const value5 = useDefaultReactionEmoji(parentChannel);
const value6 = env0_4.useMemo(_fun75378, [message == null ? value : message.reactions, sorted]);
let r6 = value5 == null ? [] : [{'emoji': null, 'me': false, 'count': 0, 'burst_count': 0, 'me_burst': false,
emoji: value5}];
r6 = value6.length > 0 ? value6 : r6;
object2 = {};
object2.reactions = r6.slice(0, count);
value = importDefault(22) /* metro dependency 22 */;
const sum = value.sum;
const value7 = r6.slice(count, r6.length);
object2.additionalNonUniqueReactionCount = Reflect.apply(sum, value, [value7.map(function(a0) {
return a0.count + a0.burst_count;
})]);
return object2;
}
function useMaxPossibleForumPostReactions({containerWidth, reactionEmojiWidth, digitWidth, message, parentChannel}) { // fn#75380, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:4115, offset: 0x01dac1ca, size: 334 bytes, params: 2, frame: 25
var r1;
var r3;
var r7;
var r0;
var r2;
var property;
var burst_count;
var count;
var Math;
var ceil;
var Math2;
var log10;
var value5;
var value6;
var value7;
const value3 = useDefaultReactionEmoji(parentChannel);
let value = env0_4.useMemo(function() {
var r0;
var sortForumPostReactionsByPopularityDescBinding = sortForumPostReactionsByPopularityDesc;
r0 = message?.reactions;
r0 = r0 ?? [];
return sortForumPostReactionsByPopularityDescBinding(r0);
}, [message?.reactions]);
let r5 = value3 == null ? [] : [{'emoji': null, 'me': false, 'count': 0, 'burst_count': 0, 'me_burst': false,
emoji: value3}];
let length = value.length;
r5 = length > 0 ? value : r5;
length = r5.length;
if (0 < length) {
r1 = 0;
r3 = 0;
r7 = 0;
while (true) {
property = r5[r1];
burst_count = property.burst_count;
if (burst_count > 0) {
burst_count = property.burst_count;
r0 = burst_count;
} else {
count = property.count;
r0 = count;
}
Math = global.Math;
ceil = Math.ceil;
Math2 = global.Math;
log10 = Math2.log10;
value = reactionEmojiWidth + digitWidth * Reflect.apply(ceil, Math, [Reflect.apply(log10, Math2,
[r0 + 1])]);
if (r3 + value < containerWidth) {
value = r3 + value;
value5 = r7 + 1;
value6 = typeof r1 === 'bigint' ? r1 + 1n : +r1 + 1;
length = r5.length;
if (value6 < length) {
r1 = value6;
r3 = value;
r7 = value5;
continue;
}
r2 = value5;
break;
}
r2 = r7;
break;
}
} else {
r2 = 0;
}
value = r5.length - r2;
if (value > 0) {
value7 = r2 - 1;
value += 1;
r1 = value;
r3 = value7;
} else {
r1 = value;
r3 = r2;
}
return {reactions: r5.slice(0, r3), additionalReactionCount: r1};
}
function useMessageCount(a0) { // fn#75382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:4762, offset: 0x01dac34c, size: 238 bytes, params: 2, frame: 21
const env0_0 = a0;
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ThreadMessageStore], _fun75383);
const messageCountText = (require(8190) /* metro dependency 8190: MessageCountUtils */).getMessageCountText(value2,
a0.id);
const env0_2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ReadStateStore], _fun75384);
return {messageCount: value2, isMaxMessageCount: value2 != null && '' + value2 !== messageCountText,
messageCountText: messageCountText,
unreadCount: (require(566) /* metro dependency 566: flux */).useStateFromStores([ForumPostUnreadCountStore],
_fun75385)};
}
function useForumPostMessageAuthor(a0, a1) { // fn#75386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:5290, offset: 0x01dac524, size: 283 bytes, params: 3, frame: 22
const value = null;
const value2 = undefined;
const id = value == a0 || value == a0.author ? value2 : a0.author.id;
const guildId = a1.getGuildId();
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getUser(id);
});
const value5 = (require(4634) /* metro dependency 4634: useMessageAuthor */).useNullableMessageAuthor(a0);
env0_4.useEffect(_fun75388, [guildId, id]);
const nick = value == value5 ? value2 : value5.nick;
const colorString = value == value5 ? value2 : value5.colorString;
const colorStrings = value == value5 ? value2 : value5.colorStrings;
return {authorName: value != nick ? nick : value == user ? value2 : user.username,
authorColor: value != colorString ? colorString : value,
authorColors: value != colorStrings ? colorStrings : value, user: user};
}
function useForumPostAuthor(a0) { // fn#75389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:5787, offset: 0x01dac694, size: 210 bytes, params: 2, frame: 20
const env0_0 = a0;
const value2 = undefined;
const user = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], _fun75390);
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ForumPostMessagesStore],
_fun75391);
const value4 = (require(4634) /* metro dependency 4634: useMessageAuthor */).useNullableUserAuthor((value3 == null ? value2 : value3.author) ?? user,
a0);
env0_4.useEffect(_fun75392, [a0.guild_id, a0.ownerId]);
return {user: user, author: value4};
}
function getForumPostAuthor(a0) { // fn#75393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:6213, offset: 0x01dac7f1, size: 133 bytes, params: 2, frame: 18
const user = UserStore.getUser(a0.ownerId);
const message = ForumPostMessagesStore.getMessage(a0.id);
const value4 = undefined;
const firstMessage = message == null ? value4 : message.firstMessage;
const object2 = {user: user};
object2.author = (require(4634) /* metro dependency 4634: useMessageAuthor */).getUserAuthor((firstMessage == null ? value4 : firstMessage.author) ?? user,
a0);
return object2;
}
function useForumPostFirstMessageMarkup({firstMessage, formatInline, noStyleAndInteraction, hasUnreads}) { // fn#75394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:6448, offset: 0x01dac876, size: 220 bytes, params: 2, frame: 20
var object2;
formatInline = formatInline === undefined || formatInline;
noStyleAndInteraction = noStyleAndInteraction === undefined || noStyleAndInteraction;
hasUnreads = hasUnreads === undefined || hasUnreads;
const value2 = env0_4.useMemo(_fun75395, [firstMessage, formatInline, noStyleAndInteraction,
hasUnreads ? 'text-default' : 'text-muted']);
const hasSpoilerEmbeds = value2.hasSpoilerEmbeds;
object2 = {hasSpoilerEmbeds: hasSpoilerEmbeds};
object2.content = value2.content;
object2.firstMedia = (require(9587) /* metro dependency 9587: ForumPostMediaUtils */).useFindFirstMediaProperties(firstMessage,
hasSpoilerEmbeds);
object2.firstMediaIsEmbed = (require(9587) /* metro dependency 9587: ForumPostMediaUtils */).useFirstMediaIsEmbed(firstMessage,
hasSpoilerEmbeds);
return object2;
}
function useCanManageChannel(a0) { // fn#75396, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:7027, offset: 0x01dac9e2, size: 66 bytes, params: 2, frame: 14
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun75397);
}
function useForumPostReadStates(a0) { // fn#75398, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:7158, offset: 0x01daca4a, size: 75 bytes, params: 2, frame: 15
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([GuildStore, ReadStateStore],
_fun75399);
}
function useChannelTemplate(a0) { // fn#75400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:7378, offset: 0x01dacb01, size: 44 bytes, params: 2, frame: 14
const env0_0 = a0;
return env0_4.useMemo(_fun75401, [a0]);
}
function useForumThreadsForChannelList(a0) { // fn#75402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:7517, offset: 0x01dacb6e, size: 102 bytes, params: 2, frame: 14
const env0_0 = a0;
const value = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ActiveJoinedThreadsStore],
_fun75403);
return {activeJoinedThreads: value.activeJoinedThreads, activeUnjoinedThreads: value.activeUnjoinedThreads,
newThreadCounts: value.newThreadCounts};
}
function useCanViewArchivedPosts(a0) { // fn#75404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:7983, offset: 0x01dacc22, size: 66 bytes, params: 2, frame: 14
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun75405);
}
function useForumSearchQuery({channelId}) { // fn#75406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:8120, offset: 0x01dacc64, size: 71 bytes, params: 2, frame: 14
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ForumSearchStore], _fun75407);
}
function useHasForumSearchQuery(a0) { // fn#75408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:8311, offset: 0x01daccd3, size: 66 bytes, params: 2, frame: 14
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ForumSearchStore], _fun75409);
}
function useAutomaticForumSearch(a0, a1, a2) { // fn#75410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:8445, offset: 0x01dacd36, size: 242 bytes, params: 4, frame: 22
const value = a3;
const env0_0 = a0;
const env0_1 = a1;
const env0_2 = a2;
const r9 = value !== undefined ? value : false;
const value2 = useForumSearchState({channelId: a0.id});
const isSearchLoading = value2.isSearchLoading;
const env0_4 = isSearchLoading;
const searchQuery = value2.searchQuery;
const value3 = useCanSearchForumPosts(a0);
const binding = env0_4;
let useRef = binding.useRef;
const env0_7 = Reflect.apply(useRef, binding, [null]);
useRef = binding.useRef;
const Set = global.Set;
const env0_8 = Reflect.apply(useRef, binding, [new Set()]);
binding.useEffect(_fun75411, [value3, a0.guild_id, a0.id, r9, isSearchLoading, searchQuery, a1, a2]);
}
function useForumActiveThreadIds({channel, sortOrder, tagFilter, tagSetting, shouldAutomaticallyAck}) { // fn#75415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:9140, offset: 0x01dacfca, size: 222 bytes, params: 2, frame: 23
const env0_4 = shouldAutomaticallyAck;
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([ForumActivePostStore],
function() {
return ForumActivePostStore.getThreadIds(channel.id, sortOrder, tagFilter, tagSetting);
});
env0_4.useEffect(_fun75418, [channel,
(require(566) /* metro dependency 566: flux */).useStateFromStores([ForumActivePostStore], _fun75417,
[shouldAutomaticallyAck, useUnreadThreadsCountForParent(channel.guild_id, channel.id)])]);
return value2;
}
function _fun75351() { // fn#75351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:735, offset: 0x01dab7c7, size: 67 bytes, params: 1, frame: 12
const defaultReactionEmojiBinding = defaultReactionEmoji;
const value2 = null;
return value2 != (value2 == defaultReactionEmojiBinding ? undefined : defaultReactionEmoji.emojiId) ? EmojiStore.getUsableCustomEmojiById(defaultReactionEmoji.emojiId) : value2;
}
function _fun75353() { // fn#75353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:1082, offset: 0x01dab84c, size: 38 bytes, params: 1, frame: 13
const can = PermissionStore.can;
const READ_MESSAGE_HISTORY = Permissions.READ_MESSAGE_HISTORY;
return Reflect.apply(can, PermissionStore, [READ_MESSAGE_HISTORY, env0_0]);
}
function _fun75357() { // fn#75357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:1415, offset: 0x01dab95f, size: 288 bytes, params: 1, frame: 25
var r1;
var r4;
var r13;
var r0;
var r12;
var getActiveJoinedUnreadThreadsForParent;
var binding;
var value4;
var activeUnjoinedUnreadThreadsForParent;
var value6;
var value7;
var properties;
var properties2;
var properties3;
var propertyName;
var propertyName2;
var property;
var lastMessageId;
var channel;
var id;
var value8;
var value9;
var value10;
var value11;
var properties4;
var properties5;
var propertyName3;
var value12;
var value13;
var value14;
var value15;
const channel2 = ChannelStore.getChannel(require);
if (channel2 != null) {
if (channel2.isForumLikeChannel()) {
getActiveJoinedUnreadThreadsForParent = ActiveJoinedThreadsStore.getActiveJoinedUnreadThreadsForParent;
binding = env0_0;
value4 = Reflect.apply(getActiveJoinedUnreadThreadsForParent, ActiveJoinedThreadsStore, [binding, require]);
activeUnjoinedUnreadThreadsForParent = ActiveJoinedThreadsStore.getActiveUnjoinedUnreadThreadsForParent(binding,
require);
value6 = ReadStateStore.ackMessageId(require);
if (value6 == null) {
return 0;
}
value7 = 0;
properties = Object.keys(value4);
properties2 = 0;
properties3 = properties.length;
if (properties === undefined) {
r0 = value7;
} else {
r1 = value7;
r4 = properties2;
while (true) {
propertyName = properties[r4];
propertyName2 = r4 + 1;
if (propertyName === undefined) {
r0 = r1;
break;
}
property = value4[propertyName];
lastMessageId = ReadStateStore.lastMessageId;
channel = property.channel;
id = channel.id;
value8 = Reflect.apply(lastMessageId, ReadStateStore, [id]);
value9 = value8 != null;
if (!value9) {
r13 = value9;
continue;
}
value10 = value8 > value6;
r13 = value10;
if (!r13) {
r4 = propertyName2;
continue;
}
value11 = typeof r1 === 'bigint' ? r1 + 1n : +r1 + 1;
r1 = value11;
r4 = propertyName2;
}
}
properties = Object.keys(activeUnjoinedUnreadThreadsForParent);
properties4 = 0;
properties5 = properties.length;
if (properties !== undefined) {
r1 = r0;
r4 = properties4;
while (true) {
propertyName = properties[r4];
propertyName3 = r4 + 1;
if (propertyName === undefined) {
r0 = r1;
break;
}
property = activeUnjoinedUnreadThreadsForParent[propertyName];
lastMessageId = ReadStateStore.lastMessageId;
id = property.id;
value12 = Reflect.apply(lastMessageId, ReadStateStore, [id]);
value13 = value12 != null;
if (!value13) {
r12 = value13;
continue;
}
value14 = value12 > value6;
r12 = value14;
if (!r12) {
r4 = propertyName3;
continue;
}
value15 = typeof r1 === 'bigint' ? r1 + 1n : +r1 + 1;
r1 = value15;
r4 = propertyName3;
}
}
return r0;
}
}
return 0;
}
function _fun75359() { // fn#75359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:1962, offset: 0x01dabb16, size: 32 bytes, params: 1, frame: 11
return ActiveThreadsStore.hasLoaded(env0_0.guild_id);
}
function _fun75360() { // fn#75360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:2005, offset: 0x01dabb36, size: 211 bytes, params: 1, frame: 21
var environment;
var value2;
var getThreadIds;
var binding;
var value7;
var defaultImport;
var dispatch;
if (env0_4) {
value2 = environment.__proto__;
getThreadIds = ForumActivePostStore.getThreadIds;
binding = env0_0;
value7 = ForumPostUnreadCountStore.getThreadIdsMissingCounts(binding.guild_id, Reflect.apply(getThreadIds,
ForumActivePostStore, [binding.id, require, importDefault, importAll])).filter(function(a0) {
return require(dependencyMap[21]).canDisplayPostUnreadMessageCount(a0, [ReadStateStore]);
}).slice(0, 180).map(_fun75362);
if (value7.length > 0) {
defaultImport = importDefault(694) /* metro dependency 694: Dispatcher */;
dispatch = defaultImport.dispatch;
binding = env0_0;
Reflect.apply(dispatch, defaultImport, [{type: 'REQUEST_FORUM_UNREADS', guildId: binding.guild_id,
channelId: binding.id, threads: value7}]);
}
}
}
function _fun75364() { // fn#75364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:2458, offset: 0x01dabcac, size: 118 bytes, params: 1, frame: 16
const defaultImport = importDefault(22) /* metro dependency 22 */;
const getThreadsForParent = ActiveThreadsStore.getThreadsForParent;
const binding = env0_0;
return ChannelStore.getChannel(defaultImport(Reflect.apply(getThreadsForParent, ActiveThreadsStore,
[binding.guild_id, binding.parent_id])).keys().filter(_fun75365).head());
}
function _fun75367() { // fn#75367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:2748, offset: 0x01dabdc8, size: 69 bytes, params: 1, frame: 13
const value = require.map(function(a0) {
return UserStore.getUser(a0);
});
return value.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
}
function _fun75369() { // fn#75369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:2827, offset: 0x01dabe0d, size: 30 bytes, params: 1, frame: 11
env0_2.forEach(_fun75370);
}
function _fun75372() { // fn#75372, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:2985, offset: 0x01dabf23, size: 50 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
return value.extractTimestamp(env0_0.id);
}
function _fun75373() { // fn#75373, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:3082, offset: 0x01dabf55, size: 50 bytes, params: 1, frame: 13
const value = environment.__proto__;
return (require(6899) /* metro dependency 6899: ForumUtils */).getForumTimestampFormatter(require, env0_2);
}
function _fun75374() { // fn#75374, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:3153, offset: 0x01dabf87, size: 132 bytes, params: 1, frame: 16
var r0;
var moduleValue;
var moduleValue2;
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
const CREATION_DATE = ThreadSortOrder.CREATION_DATE;
if (require === CREATION_DATE) {
moduleValue2 = require(7169) /* metro dependency 7169: ThreadUtils */;
r0 = moduleValue2.getTimestampString(env0_3, env0_5);
} else {
moduleValue = require(7169) /* metro dependency 7169: ThreadUtils */;
r0 = moduleValue.getTimestampString(env0_4, env0_5);
}
return r0;
}
function _fun75376() { // fn#75376, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:3351, offset: 0x01dac048, size: 69 bytes, params: 1, frame: 13
const value2 = undefined;
const r2 = (env0_0 == null ? value2 : env0_0.reactions) ?? [];
if (r2.length !== 0) {
value = environment.__proto__;
return sortForumPostReactionsByPopularityDesc(r2)[0];
}
return value2;
}
function _fun75378() { // fn#75378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:3717, offset: 0x01dac18c, size: 62 bytes, params: 1, frame: 13
var r0;
var value;
const r2 = message?.reactions ?? [];
if (sorted) {
value = environment.__proto__;
value = sortForumPostReactionsByPopularityDesc(r2);
r0 = value;
} else {
r0 = r2;
}
return r0;
}
function _fun75383() { // fn#75383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:4829, offset: 0x01dac43a, size: 46 bytes, params: 1, frame: 11
const value = environment.__proto__;
return ThreadMessageStore.getCount(env0_0.id) ?? 0;
}
function _fun75384() { // fn#75384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:4955, offset: 0x01dac468, size: 63 bytes, params: 1, frame: 14
const forumUtilsModule = require(6899) /* metro dependency 6899: ForumUtils */;
return forumUtilsModule.canDisplayPostUnreadMessageCount(env0_0.id, [ReadStateStore]);
}
function _fun75385() { // fn#75385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:5048, offset: 0x01dac4a7, size: 125 bytes, params: 1, frame: 15
var value2;
var value3;
var value;
if (env0_2) {
value2 = environment.__proto__;
value3 = ForumPostUnreadCountStore.getCount(env0_0.id);
if (value3 == null) {
return '1+';
}
if (value3 > 0) {
value = global.Math.min(value3, env0_1);
return value >= MAX_THREAD_UNREAD_MESSAGE_COUNT ? '' + MAX_THREAD_UNREAD_MESSAGE_COUNT + '+' : value;
}
return '1+';
}
return null;
}
function _fun75388() { // fn#75388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:5514, offset: 0x01dac65a, size: 58 bytes, params: 1, frame: 13
var value4;
if (id != null && env0_1 != null) {
value4 = environment.__proto__;
GuildMemberRequesterStore.requestMember(env0_1, id);
}
}
function _fun75390() { // fn#75390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:5859, offset: 0x01dac766, size: 33 bytes, params: 1, frame: 11
return UserStore.getUser(env0_0.ownerId);
}
function _fun75391() { // fn#75391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:5921, offset: 0x01dac787, size: 49 bytes, params: 1, frame: 11
const value = environment.__proto__;
return ForumPostMessagesStore.getMessage(env0_0.id)?.firstMessage;
}
function _fun75392() { // fn#75392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:6087, offset: 0x01dac7b8, size: 57 bytes, params: 1, frame: 13
var value2;
var requestMember;
var binding;
if (env0_0.ownerId != null) {
value2 = environment.__proto__;
requestMember = GuildMemberRequesterStore.requestMember;
binding = env0_0;
Reflect.apply(requestMember, GuildMemberRequesterStore, [binding.guild_id, binding.ownerId]);
}
}
function _fun75395() { // fn#75395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:6616, offset: 0x01dac952, size: 144 bytes, params: 1, frame: 16
return firstMessage?.content == null ? {'hasSpoilerEmbeds': false,
'content': null} : firstMessage.content !== '' ? (importDefault(8349) /* metro dependency 8349: renderMessageMarkup */)(firstMessage,
{'formatInline': null, 'noStyleAndInteraction': null, 'allowHeading': true, 'allowList': true,
'allowGameMentions': true, formatInline: formatInline, noStyleAndInteraction: noStyleAndInteraction,
textColor: env0_3}) : {'hasSpoilerEmbeds': false, 'content': null};
}
function _fun75397() { // fn#75397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:7099, offset: 0x01daca24, size: 38 bytes, params: 1, frame: 13
const can = PermissionStore.can;
const MANAGE_CHANNELS = Permissions.MANAGE_CHANNELS;
return Reflect.apply(can, PermissionStore, [MANAGE_CHANNELS, env0_0]);
}
function _fun75399() { // fn#75399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:7241, offset: 0x01daca95, size: 108 bytes, params: 1, frame: 17
var r0;
var moduleValue;
const value = environment.__proto__;
const guild = GuildStore.getGuild(env0_0.getGuildId() ?? EMPTY_STRING_SNOWFLAKE_ID);
if (guild == null) {
r0 = env1_26;
} else {
moduleValue = require(6899) /* metro dependency 6899: ForumUtils */;
r0 = moduleValue.getForumPostReadStates(env0_0, guild, [ReadStateStore]);
}
return r0;
}
function _fun75401() { // fn#75401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:7427, offset: 0x01dacb2d, size: 65 bytes, params: 1, frame: 12
return env0_0 == null || env0_0.template == null ? '' : env0_0.template.trim();
}
function _fun75403() { // fn#75403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:7604, offset: 0x01dacbd4, size: 78 bytes, params: 1, frame: 13
const object2 = {};
const getActiveJoinedThreadsForGuild = ActiveJoinedThreadsStore.getActiveJoinedThreadsForGuild;
const binding = env0_0;
object2.activeJoinedThreads = Reflect.apply(getActiveJoinedThreadsForGuild, ActiveJoinedThreadsStore, [binding]);
object2.activeUnjoinedThreads = ActiveJoinedThreadsStore.getActiveUnjoinedThreadsForGuild(binding);
object2.newThreadCounts = ActiveJoinedThreadsStore.getNewThreadCountsForGuild(binding);
return object2;
}
function _fun75407() { // fn#75407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:8204, offset: 0x01daccab, size: 40 bytes, params: 1, frame: 12
const channelIdBinding = channelId;
const value2 = null;
return value2 == channelIdBinding ? value2 : ForumSearchStore.getSearchQuery(channelId);
}
function _fun75409() { // fn#75409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:8386, offset: 0x01dacd15, size: 33 bytes, params: 1, frame: 11
const value = environment.__proto__;
return ForumSearchStore.getSearchQuery(env0_0) != null;
}
function _fun75411() { // fn#75411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:8648, offset: 0x01dace28, size: 280 bytes, params: 1, frame: 16
var environment;
var current;
var value2;
var defaultImport;
var setTimeout;
var value3;
var defaultImport2;
var value;
if (searchQuery != null) {
if (searchQuery == null) {
return undefined;
}
if (searchQuery.length === 0) {
return undefined;
}
if (env0_3) {
return undefined;
}
if (env0_6) {
current = env0_7.current;
if (current !== searchQuery) {
if (isSearchLoading) {
return undefined;
}
setTimeout = global.setTimeout;
value = environment.__proto__;
value = env1_3(_fun75413);
var env0_0 = setTimeout(value, 350);
return _fun75414;
}
current = env0_8.current;
if (current === require) {
return undefined;
}
if (isSearchLoading) {
return undefined;
}
setTimeout = global.setTimeout;
value = environment.__proto__;
value = env1_3(_fun75413);
var env0_0 = setTimeout(value, 350);
return _fun75414;
}
value2 = environment.__proto__;
defaultImport = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
defaultImport.clearForumSearch(env0_0.id);
} else {
current = env0_7.current;
if (current != null) {
value3 = environment.__proto__;
defaultImport2 = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
defaultImport2.clearForumSearch(env0_0.id);
env0_7.current = null;
return undefined;
}
if (searchQuery == null) {
return undefined;
}
if (searchQuery.length === 0) {
return undefined;
}
if (env0_3) {
return undefined;
}
if (env0_6) {
current = env0_7.current;
if (current !== searchQuery) {
if (isSearchLoading) {
return undefined;
}
setTimeout = global.setTimeout;
value = environment.__proto__;
value = env1_3(_fun75413);
var env0_0 = setTimeout(value, 350);
return _fun75414;
}
current = env0_8.current;
if (current === require) {
return undefined;
}
if (isSearchLoading) {
return undefined;
}
setTimeout = global.setTimeout;
value = environment.__proto__;
value = env1_3(_fun75413);
var env0_0 = setTimeout(value, 350);
return _fun75414;
}
defaultImport = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
defaultImport.clearForumSearch(env0_0.id);
}
}
function _fun75417() { // fn#75417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:9410, offset: 0x01dad0d6, size: 47 bytes, params: 1, frame: 11
var r1;
var r0;
var value;
const shouldAutomaticallyAckBinding = shouldAutomaticallyAck;
if (shouldAutomaticallyAckBinding) {
value = env0_5 > 0;
if (value) {
r1 = value;
} else {
value = environment.__proto__;
value = ForumActivePostStore.getCanAckThreads();
r1 = value;
}
r0 = r1;
} else {
r0 = shouldAutomaticallyAckBinding;
}
return r0;
}
function _fun75418() { // fn#75418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:9473, offset: 0x01dad105, size: 87 bytes, params: 1, frame: 15
var value2;
var moduleValue;
if (env0_6) {
value2 = environment.__proto__;
moduleValue = require(5097) /* metro dependency 5097: ReadStateActionCreators */;
moduleValue.ackChannel(channel, {object: AnalyticsObjects.ACK_FORUM_ACTIVE_THREADS,
objectType: AnalyticsObjectTypes.ACK_AUTOMATIC});
}
}
function _fun75362(a0) { // fn#75362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:2173, offset: 0x01dabc3f, size: 35 bytes, params: 2, frame: 12
const object2 = {threadId: a0};
object2.ackMessageId = ReadStateStore.getTrackedAckMessageId(a0);
return object2;
}
function _fun75365(a0) { // fn#75365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:2541, offset: 0x01dabd22, size: 60 bytes, params: 2, frame: 12
const value = environment.__proto__.__proto__;
return ChannelStore.getChannel(a0)?.hasFlag(ChannelFlags.PINNED) === true;
}
function _fun75370({id}) { // fn#75370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:2843, offset: 0x01dabe2b, size: 43 bytes, params: 2, frame: 13
GuildMemberRequesterStore.requestMember(env1_0.guild_id, id);
}
function* _fun75413() { // fn#75413, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9805:8836, offset: 0x01dacf4b, size: 127 bytes, params: 1, frame: 20
var binding;
var binding2;
var property;
var value4;
var searchForumPosts;
var guild_id;
var id;
var value5;
var error;
if (true) {
value = environment.__proto__.__proto__;
ActiveThreadsStore.current = EmojiStore;
ThreadMessageStore.current = importDefault;
try {
binding = env3_1;
} catch (error) {
return undefined;
}
try {
binding2 = env3_2;
} catch (error) {
return undefined;
}
try {
property = binding2[33];
} catch (error) {
return undefined;
}
try {
value4 = binding(property);
} catch (error) {
return undefined;
}
try {
searchForumPosts = value4.searchForumPosts;
} catch (error) {
return undefined;
}
try {
} catch (error) {
return undefined;
}
try {
guild_id = require.guild_id;
} catch (error) {
return undefined;
}
try {
id = require.id;
} catch (error) {
return undefined;
}
try {
} catch (error) {
return undefined;
}
try {
} catch (error) {
return undefined;
}
try {
} catch (error) {
return undefined;
}
try {
value = Reflect.apply(searchForumPosts, value4, [guild_id, id, EmojiStore, importDefault, dependencyMap]);
} catch (error) {
return undefined;
}
yield value;
try {
value = undefined;
value5 = false;
} catch (error) {
return undefined;
}
if (value5) {
return value;
}
}
}
+89
View File
@@ -0,0 +1,89 @@
/* Metro module 15714; source: modules/forums/ForumManager.tsx; dependencies: [6, 7, 15, 17, 18, 1379, 1386, 6896, 4860, 2] */
function _fun120593(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#120593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15922:6, offset: 0x025309c3, size: 264 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const env0_8 = (require(1386) /* metro dependency 1386: ChannelConstants */).isStaticChannelRoute;
let value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
value = _fun120597(value);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumManager.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_120594() { // fn#120594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15922:189, offset: 0x02530acb, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_120594_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun120597(a0) { // fn#120597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15922:392, offset: 0x02530b2d, size: 74 bytes, params: 2, frame: 15
const closure = ForumManager;
env0_6(closure, a0);
return env0_3(closure, [{key: 'handleChannelPreload', value: value_120599}]);
}
function ForumManager(a0) { // fn#120598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15922:404, offset: 0x02530b77, size: 147 bytes, params: 2, frame: 19
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_2;
binding(this, ForumManager);
const items = [];
arraySpread(items, value, 0, items);
value = env1_5(ForumManager);
binding = env1_4;
if (_isNativeReflectConstruct_120594()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items, env1_5(this).constructor);
r0 = value;
} else {
value = value.apply(this, items);
r0 = value;
}
value = binding(this, r0);
value.actions = {CHANNEL_PRELOAD: value.handleChannelPreload};
return value;
}
function value_120599({channelId}) { // fn#120599, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15922:754, offset: 0x02530c0a, size: 94 bytes, params: 2, frame: 13
var channel;
const value = environment.__proto__;
if (!isStaticChannelRoute(channelId)) {
channel = ChannelStore.getChannel(channelId);
if (channel != null && channel.isForumLikeChannel()) {
(require(6896) /* metro dependency 6896: ForumPostDataLoader */).preloadForumThreads(channel);
}
}
}
@@ -0,0 +1,80 @@
/* Metro module 12061; source: modules/forums/ForumPlatformHooks.native.tsx; dependencies: [31, 4008, 4007, 9623, 2] */
function _fun92694(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92694, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12247:6, offset: 0x020951bd, size: 128 bytes, params: 8, frame: 18
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
object2 = {useForumChannelSeenManager: useForumChannelSeenManager};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumPlatformHooks.native.tsx');
exports.default = object2;
}
function useForumChannelSeenManager({guildId, channelId}) { // fn#92695, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12247:140, offset: 0x0209523d, size: 135 bytes, params: 2, frame: 17
const binding = env0_3;
const value = binding.useRef(null);
const value2 = binding.useCallback(_fun92696, [channelId]);
binding.useEffect(_fun92697);
binding.useLayoutEffect(_fun92699, [channelId, guildId, value2]);
return value.current;
}
function _fun92696() { // fn#92696, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12247:239, offset: 0x020952c4, size: 153 bytes, params: 1, frame: 14
var r3;
var currentRoute;
var current;
let value = environment.__proto__;
const rootNavigationRef = (require(4008) /* metro dependency 4008: RootNavigationRefNative */).getRootNavigationRef();
if (rootNavigationRef != null) {
if (rootNavigationRef.isReady()) {
currentRoute = rootNavigationRef.getCurrentRoute();
value = require(4007) /* metro dependency 4007: NavigationRouteUtilsNative */;
value = value.coerceChannelRoute(currentRoute);
r3 = value != null && value.params.channelId === channelId;
current = env0_2.current;
if (current != null) {
current.handleReactNavigationFocus(r3);
}
}
}
}
function _fun92697() { // fn#92697, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12247:481, offset: 0x0209535d, size: 94 bytes, params: 1, frame: 14
var environment;
let value = environment.__proto__;
value = require(4008) /* metro dependency 4008: RootNavigationRefNative */;
value = value.getRootNavigationRef();
if (value != null) {
if (value.isReady()) {
value.addListener('state', env0_3);
return _fun92698;
}
}
}
function _fun92699() { // fn#92699, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12247:635, offset: 0x020953dd, size: 113 bytes, params: 1, frame: 14
const binding = env0_2;
const defaultImport = importDefault(9623) /* metro dependency 9623: ForumChannelSeenManager */;
const object2 = {};
object2.guildId = guildId;
object2.channelId = channelId;
const value3 = Object.create(defaultImport.prototype, {constructor: {value: defaultImport}});
const defaultImport2 = new defaultImport(object2);
binding.current = defaultImport2 instanceof Object ? defaultImport2 : value3;
binding.current.initialize();
env0_3();
return _fun92700;
}
function _fun92698() { // fn#92698, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12247:579, offset: 0x020953bb, size: 34 bytes, params: 1, frame: 13
env0_0.removeListener('state', env1_3);
}
function _fun92700() { // fn#92700, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12247:715, offset: 0x0209544e, size: 42 bytes, params: 1, frame: 11
const current = env1_2.current;
if (current != null) {
current.terminate();
}
env1_2.current = null;
}
@@ -0,0 +1,11 @@
/* Metro module 8121; source: modules/forums/ForumPlatformUtils.native.tsx; dependencies: [1244, 2] */
function _fun65084(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#65084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8306:6, offset: 0x01bc21b0, size: 101 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumPlatformUtils.native.tsx');
exports.default = {getForumChannelPermissionText: function() {
return require(dependencyMap[0]).intl.string(require(dependencyMap[0]).t.LG9VAi);
}};
}
@@ -0,0 +1,715 @@
/* Metro module 6896; source: modules/forums/ForumPostDataLoader.tsx; dependencies: [5, 6, 7, 1379, 6897, 6865, 6901, 661, 22, 21, 566, 507, 694, 2] */
function _fun54746(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54746, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:6, offset: 0x0136d3e3, size: 370 bytes, params: 8, frame: 19
const env0_0 = require;
const _shouldRequestFirstMessage = function(a0, a1) {
return !a0 && a1 == null;
};
const loadForumPostData = function() {
return _loadForumPostData.apply(this, arguments);
};
const loadForumPostDataForChannelId = function() {
return _loadForumPostDataForChannelId.apply(this, arguments);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(5) /* metro dependency 5 */;
const env0_4 = importDefault(6) /* metro dependency 6 */;
const env0_5 = importDefault(7) /* metro dependency 7 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const env0_7 = (require(6897) /* metro dependency 6897: ForumActivePostStore */).computeThreadIdsSnapshot;
const forumPostMessagesStore = importDefault(6865) /* metro dependency 6865: ForumPostMessagesStore */;
const forumPostRecentMessageStore = importDefault(6901) /* metro dependency 6901: ForumPostRecentMessageStore */;
const env0_10 = (require(661) /* metro dependency 661: Constants */).Endpoints;
const env0_11 = _fun54758();
let value = _fun54764();
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumPostDataLoader.tsx');
exports.useFirstForumPostMessage = useFirstForumPostMessage;
exports.useMostRecentForumMessage = useMostRecentForumMessage;
exports.preloadForumThreads = preloadForumThreads;
}
function loadMultipleForumPostData(a0, a1) { // fn#54748, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:1456, offset: 0x0136d569, size: 89 bytes, params: 3, frame: 14
const env0_0 = a0;
const env0_1 = false;
a1.forEach(_fun54749);
if (env0_1 && env0_13 == null) {
env0_13 = global.setTimeout(loadForumPostData, 0);
}
}
function _loadForumPostData() { // fn#54751, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:1748, offset: 0x0136d616, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun54753).apply(this, arguments);
}
function _loadForumPostDataForChannelId() { // fn#54755, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:2030, offset: 0x0136d6bf, size: 48 bytes, params: 1, frame: 14
return env0_3(_fun54757).apply(this, arguments);
}
function _fun54758() { // fn#54758, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:215, offset: 0x0136d87c, size: 124 bytes, params: 1, frame: 15
return env0_5(DefaultDict, [{key: 'get', value: function(a0) {
if (!this._set.hasOwnProperty(a0)) {
this._set[a0] = this._defaultValueFunc();
}
return this._set[a0];
}}, {key: 'delete', value: function(a0) {
delete this._set[a0];
}}, {key: 'hasNext', value: value_54762}, {key: 'next', value: value_54763}]);
}
function _fun54764() { // fn#54764, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:639, offset: 0x0136d9d8, size: 220 bytes, params: 1, frame: 15
return env0_5(RequestQueue, [{key: 'request', value: function(a0, a1) {
this.requested.get(a0).add(a1);
}}, {key: 'hasRequested', value: function(a0, a1) {
return this.requested.get(a0).has(a1);
}}, {key: 'finishRequesting', value: value_54769}, {key: 'getRequested', value: function(a0) {
return this.requested.get(a0);
}}, {key: 'getNextBatch', value: function(a0, a1) {
var Array = global.Array;
return Array.from(this.requested.get(a0)).slice(0, a1);
}}, {key: 'hasNext', value: function() {
return this.requested.hasNext();
}}, {key: 'next', value: function() {
return this.requested.next();
}}, {key: 'compact', value: function(a0) {
var property = this.requested;
property = property.get(a0).size;
if (property === 0) {
this.requested.delete(a0);
}
}}]);
}
function useFirstForumPostMessage(a0) { // fn#54776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:2598, offset: 0x0136dc34, size: 238 bytes, params: 2, frame: 22
const value = a1;
const env0_0 = a0;
const r1 = value !== undefined ? value : {};
let enabled = r1.enabled;
enabled = enabled === undefined || enabled;
let allowArchived = r1.allowArchived;
allowArchived = !(allowArchived === undefined) && allowArchived;
const {loaded,
firstMessage} = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ForumPostMessagesStore],
_fun54777);
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun54778);
if (enabled && channel != null && _shouldRequestFirstMessage(loaded, firstMessage)) {
if (allowArchived) {
loadMultipleForumPostData(channel, [a0.id]);
} else {
preloadForumPostDataFrom(channel, a0.id);
}
}
return {loaded: loaded, firstMessage: enabled ? firstMessage : null};
}
function useMostRecentForumMessage(a0, a1) { // fn#54782, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:3198, offset: 0x0136de13, size: 88 bytes, params: 3, frame: 14
const env0_0 = a1;
const value = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ForumPostRecentMessageStore],
function() {
return ForumPostRecentMessageStore.getMessageState(require.id);
});
return {loaded: value.loaded, mostRecentMessage: value.message};
}
function preloadForumThreads(a0) { // fn#54784, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:3389, offset: 0x0136de8b, size: 50 bytes, params: 2, frame: 16
const loadMultipleForumPostDataBinding = loadMultipleForumPostData;
const threadIdsSnapshot = computeThreadIdsSnapshot(a0.id);
loadMultipleForumPostDataBinding(a0, threadIdsSnapshot.slice(0, 10));
}
function _fun54749(a0) { // fn#54749, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:1516, offset: 0x0136d5c2, size: 84 bytes, params: 2, frame: 15
var binding;
const message = ForumPostMessagesStore.getMessage(a0);
if (_shouldRequestFirstMessage(message.loaded, message.firstMessage)) {
binding = env1_12;
binding.request(env0_0.id, a0);
}
}
function* _fun54753() { // fn#54753, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:1807, offset: 0x0136d64f, size: 112 bytes, params: 1, frame: 14
var binding;
var hasNext;
var hasNext2;
var binding2;
var next;
var value3;
var value4;
var value5;
var value6;
var hasNext3;
var error;
if (true) {
value = environment.__proto__.__proto__;
try {
binding = env2_12;
} catch (error) {
env2_13 = null;
throw error;
}
try {
hasNext = binding.hasNext;
} catch (error) {
env2_13 = null;
throw error;
}
try {
hasNext2 = Reflect.apply(hasNext, binding, []);
} catch (error) {
env2_13 = null;
throw error;
}
if (hasNext2) {
while (true) {
try {
binding = env2_18;
} catch (error) {
env2_13 = null;
throw error;
}
try {
binding2 = env2_12;
} catch (error) {
env2_13 = null;
throw error;
}
try {
next = binding2.next;
} catch (error) {
env2_13 = null;
throw error;
}
try {
value3 = Reflect.apply(next, binding2, []);
} catch (error) {
env2_13 = null;
throw error;
}
try {
value4 = binding(value3);
} catch (error) {
env2_13 = null;
throw error;
}
yield value4;
try {
value5 = undefined;
value6 = false;
} catch (error) {
env2_13 = null;
throw error;
}
if (value6) {
env2_13 = null;
return value5;
}
try {
binding = env2_12;
} catch (error) {
env2_13 = null;
throw error;
}
try {
hasNext = binding.hasNext;
} catch (error) {
env2_13 = null;
throw error;
}
try {
hasNext3 = Reflect.apply(hasNext, binding, []);
} catch (error) {
env2_13 = null;
throw error;
}
if (hasNext3) {
continue;
}
break;
}
}
}
}
function* _fun54757(a0) { // fn#54757, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:2113, offset: 0x0136d6f8, size: 388 bytes, params: 2, frame: 21
var guild_id;
var value;
var value2;
var value3;
var binding;
var getNextBatch;
var value4;
var length;
var value5;
var getChannel;
var value6;
var value7;
var value8;
var binding2;
var property;
var value9;
var HTTP;
var post;
var object3;
var FORUM_POSTS;
var value10;
var object4;
var value11;
var value12;
var value13;
var body;
var threads;
var binding3;
var value14;
var dispatch;
var finishRequesting;
var error;
exceptionLanding59: while (true) {
value = undefined;
value2 = false;
if (value2) {
return value;
}
value = undefined;
value3 = environment.__proto__.__proto__;
binding = env2_12;
getNextBatch = binding.getNextBatch;
value4 = Reflect.apply(getNextBatch, binding, [a0, 10]);
reducibleJoin4: while (true) {
reduciblePort58: while (true) {
exceptionLanding57: while (true) {
try {
try {
length = value4.length;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
break reducibleJoin4;
}
break reduciblePort58;
}
binding = env2_12;
finishRequesting = binding.finishRequesting;
Reflect.apply(finishRequesting, binding, [a0, value4]);
return value;
}
try {
try {
value5 = length === 0;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
if (value5) {
binding = env2_12;
binding.finishRequesting(a0, value4);
return value;
}
try {
try {
binding = env2_6;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
getChannel = binding.getChannel;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
value6 = Reflect.apply(getChannel, binding, [a0]);
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
value7 = value6 == null;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
reducibleJoin14: while (true) {
if (value7) {
guild_id = value;
break reducibleJoin14;
}
try {
try {
guild_id = value6.guild_id;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
break reducibleJoin14;
}
try {
try {
value8 = guild_id == null;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
if (value8) {
binding = env2_12;
binding.finishRequesting(a0, value4);
return value;
}
try {
try {
binding = env2_0;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
binding2 = env2_2;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
property = binding2[11];
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
value9 = binding(property);
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
HTTP = value9.HTTP;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
post = HTTP.post;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
object3 = {};
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
binding = env2_10;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
FORUM_POSTS = binding.FORUM_POSTS;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
value10 = Reflect.apply(FORUM_POSTS, binding, [a0]);
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
object3.url = value10;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
object4 = {};
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
object4.thread_ids = value4;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
object3.body = object4;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
object3.rejectWithError = true;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
value11 = Reflect.apply(post, HTTP, [object3]);
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
yield value11;
try {
try {
value12 = undefined;
value13 = false;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
if (value13) {
binding = env2_12;
binding.finishRequesting(a0, value4);
return value12;
}
try {
try {
body = value12.body;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
threads = body.threads;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
binding = env2_1;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
binding3 = env2_2;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
property = binding3[12];
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
value14 = binding(property);
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
dispatch = value14.dispatch;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
object3 = {};
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
object3.type = 'LOAD_FORUM_POSTS';
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
object3.guildId = guild_id;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
object3.threads = threads;
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
try {
try {
Reflect.apply(dispatch, value14, [object3]);
} catch (error) {
break exceptionLanding57;
}
} catch (error) {
break exceptionLanding59;
}
binding = env2_12;
finishRequesting = binding.finishRequesting;
Reflect.apply(finishRequesting, binding, [a0, value4]);
return value;
}
env2_12.finishRequesting(a0, value4);
throw error;
}
function DefaultDict(a0) { // fn#54759, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:236, offset: 0x0136d8f8, size: 44 bytes, params: 2, frame: 13
env1_4(this, DefaultDict);
this._set = {};
this._defaultValueFunc = a0;
}
function value_54762() { // fn#54762, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:516, offset: 0x0136d972, size: 50 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = importDefault(22) /* metro dependency 22 */;
return !value.isEmpty(this._set);
}
function value_54763() { // fn#54763, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:581, offset: 0x0136d9a4, size: 52 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = Reflect.apply((importDefault(21) /* metro dependency 21: SnowflakeUtils */).keys, value, [this._set]);
return value[0];
}
function RequestQueue() { // fn#54765, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:660, offset: 0x0136dab4, size: 64 bytes, params: 1, frame: 14
var environment;
let value = environment.__proto__;
env1_4(this, RequestQueue);
this.requested = new env1_11(function() {
var Set = global.Set;
var value = Object.create(Set.prototype, {constructor: {value: Set}});
var value2 = new Set();
return value2 instanceof Object ? value2 : value;
});
}
function value_54769(a0, a1) { // fn#54769, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:918, offset: 0x0136db40, size: 68 bytes, params: 3, frame: 13
const env0_0 = this.requested.get(a0);
a1.forEach(_fun54770);
env1_12.compact(a0);
}
function _fun54777() { // fn#54777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:2717, offset: 0x0136dd22, size: 32 bytes, params: 1, frame: 11
return ForumPostMessagesStore.getMessage(env0_0.id);
}
function _fun54778() { // fn#54778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:2805, offset: 0x0136dd42, size: 32 bytes, params: 1, frame: 11
return ChannelStore.getChannel(env0_0.parent_id);
}
function preloadForumPostDataFrom(a0, a1) { // fn#54779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:2928, owner: useFirstForumPostMessage.preloadForumPostDataFrom, offset: 0x0136dd62, size: 122 bytes, params: 3, frame: 17
const env0_0 = a0;
const env0_1 = a1;
const binding = env1_12;
if (!binding.hasRequested(a0.id, a1)) {
var threadIdsSnapshot = computeThreadIdsSnapshot(a0.id);
var index = threadIdsSnapshot.findIndex(function(a0) {
return a0 === require;
});
loadMultipleForumPostData(a0, threadIdsSnapshot.slice(index, index + 5).filter(_fun54781));
}
}
function _fun54781(a0) { // fn#54781, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7074:3065, offset: 0x0136ddec, size: 39 bytes, params: 2, frame: 13
const binding = env2_12;
return !binding.hasRequested(env0_0.id, a0);
}
@@ -0,0 +1,457 @@
/* Metro module 9587; source: modules/forums/ForumPostMediaUtils.tsx; dependencies: [31, 6898, 1379, 4814, 1878, 661, 4631, 3829, 1391, 1471, 1360, 4627, 1909, 4630, 21, 2] */
function _fun75075(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75075, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:6, offset: 0x01da1bc0, size: 463 bytes, params: 8, frame: 25
const env0_0 = require;
const closure = isValidImageAttachment_75076;
const closure2 = isValidVideoAttachment_75077;
const closure3 = isMediaAttachment;
const closure4 = getForumPostMedia;
const closure5 = useForumPostComponentsMedia;
const closure6 = function(a0, a1) {
var r6;
var value2 = useForumPostMedia(a0);
var items = [];
arraySpread(items, useForumPostComponentsMedia(a0), arraySpread(items, useForumPostEmbeds(a0, a1),
arraySpread(items, value2, 0, r6), useForumPostEmbeds), useForumPostEmbeds);
return items;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const threadMessageStore = importDefault(6898) /* metro dependency 6898: ThreadMessageStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_8 = constantsModule.MessageAttachmentFlags;
const env0_9 = constantsModule.MessageEmbedMediaFlags;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumPostMediaUtils.tsx');
exports.getEmbedColor = function(a0, a1) {
var color;
if (a0 != null) {
if (a0.embeds[0] != null) {
color = a0.embeds[0].color;
return color == null ? a1 ? undefined : color : color.toLowerCase() === '#ffffff' || a1 ? undefined : color;
}
}
};
exports.isValidImageAttachment = closure;
exports.isValidVideoAttachment = closure2;
exports.isMediaAttachment = closure3;
exports.ForumPostMediaTypes = {EMBED: 'embed', ATTACHMENT: 'attachment', COMPONENT: 'component'};
exports.getForumPostMedia = closure4;
exports.useForumPostComponentsMedia = closure5;
exports.useForumPostMediaThumbnail = useForumPostMediaThumbnail;
exports.useForumPostMediaProperties = closure6;
exports.useFindFirstMediaProperties = useFindFirstMediaProperties;
exports.useFirstMediaIsEmbed = useFirstMediaIsEmbed;
exports.shouldShowAddMediaToOriginalPostModal = shouldShowAddMediaToOriginalPostModal;
exports.messageContainsGifOrVideo = function(a0) {
return a0.reduce(_fun75099, {'containsVideo': false, 'containsGif': false});
};
}
function isValidImageAttachment_75076(a0) { // fn#75076, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:210, offset: 0x01da1d8f, size: 99 bytes, params: 2, frame: 15
if (a0 == null) {
return false;
}
const filename = a0.filename;
const height = a0.height;
const width = a0.width;
let value = require(4631) /* metro dependency 4631: MediaFormatTesters */;
value = value.isImageFile(filename);
let r0 = value && height != null && height > 0;
r0 = r0 && width != null && width > 0;
return r0;
}
function isValidVideoAttachment_75077(a0) { // fn#75077, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:361, offset: 0x01da1df2, size: 79 bytes, params: 2, frame: 15
var r1;
var r0;
let value = a0 != null;
if (value) {
value = a0 != null;
if (value) {
value = require(4631) /* metro dependency 4631: MediaFormatTesters */;
value = value.isVideoFile(a0.filename);
r1 = value;
} else {
r1 = value;
}
r1 = r1 && a0.proxy_url != null;
r0 = r1;
} else {
r0 = value;
}
return r0;
}
function isMediaAttachment(a0) { // fn#75078, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:474, offset: 0x01da1e41, size: 31 bytes, params: 2, frame: 13
return isValidImageAttachment_75076(a0) || isValidVideoAttachment_75077(a0);
}
function getForumPostMedia(a0) { // fn#75079, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:662, offset: 0x01da1e60, size: 251 bytes, params: 2, frame: 15
var r3;
const value = a1;
const value2 = undefined;
if (value !== value2 ? value : (require(3829) /* metro dependency 3829: UserSettings */).InlineAttachmentMedia.getSetting()) {
r3 = (a0 == null || a0.messageSnapshots[0] == null ? value2 : a0.messageSnapshots[0].moderatorReport) != null ? a0 == null || a0.messageSnapshots[0] == null ? value2 : a0.messageSnapshots[0].message.attachments : a0 == null ? value2 : a0.attachments;
return a0 == null || r3 == null ? [] : r3.filter(isMediaAttachment).map(_fun75080).filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
}
return [];
}
function useForumPostMedia(a0) { // fn#75081, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:1632, offset: 0x01da20ef, size: 56 bytes, params: 2, frame: 13
const getForumPostMediaBinding = getForumPostMedia;
const InlineAttachmentMedia = (require(3829) /* metro dependency 3829: UserSettings */).InlineAttachmentMedia;
return getForumPostMediaBinding(a0, InlineAttachmentMedia.useSetting());
}
function useForumPostEmbeds(a0, a1) { // fn#75082, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:1733, offset: 0x01da2127, size: 236 bytes, params: 3, frame: 19
var r0;
var value5;
const env0_0 = a1;
const value2 = undefined;
const InlineEmbedMedia = (require(3829) /* metro dependency 3829: UserSettings */).InlineEmbedMedia;
const value3 = InlineEmbedMedia.useSetting();
const RenderEmbeds = (require(3829) /* metro dependency 3829: UserSettings */).RenderEmbeds;
const value4 = RenderEmbeds.useSetting();
if (a0 == null) {
return [];
}
const property = a0.messageSnapshots[0];
const r4 = (property == null ? value2 : property.moderatorReport) != null ? a0.messageSnapshots[0] == null ? value2 : a0.messageSnapshots[0].message.embeds : a0.embeds;
if (value3) {
if (value4) {
if (r4 != null) {
value5 = r4.map(_fun75083);
r0 = value5.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
} else {
r0 = [];
}
} else {
r0 = [];
}
} else {
r0 = [];
}
return r0;
}
function useForumPostComponentsMedia(a0) { // fn#75084, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:2484, offset: 0x01da233f, size: 186 bytes, params: 2, frame: 17
var r0;
var Array;
var from;
var value;
const InlineEmbedMedia = (require(3829) /* metro dependency 3829: UserSettings */).InlineEmbedMedia;
const value2 = InlineEmbedMedia.useSetting();
if (a0 == null) {
return [];
}
const components = a0.components;
if (value2) {
if (components != null) {
Array = global.Array;
from = Array.from;
value = require(4627) /* metro dependency 4627: InteractionComponentUtils */;
value = value.flattenComponents(components);
value = Reflect.apply(from, Array, [value.values()]);
value = value.flatMap(_fun75085);
value = value.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
r0 = value;
} else {
r0 = [];
}
} else {
r0 = [];
}
return r0;
}
function unfurledMediaToForumPostMediaAttachment(a0, a1) { // fn#75087, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:3029, offset: 0x01da24ba, size: 254 bytes, params: 3, frame: 21
var r7;
var r0;
var object2;
var height;
var value5;
var width;
var contentScanMetadata;
var value;
const value2 = undefined;
const unfurledMediaItemType = (require(4630) /* metro dependency 4630: MediaTypes */).getUnfurledMediaItemType(a0);
const value4 = null;
if (unfurledMediaItemType === 'INVALID') {
r0 = value4;
} else {
object2 = {};
object2.type = env0_10.COMPONENT;
object2.src = a0.proxyUrl;
height = a0.height;
value5 = 0;
r7 = value4 != height ? height : value5;
object2.height = r7;
width = a0.width;
r7 = value4 != width ? width : value5;
object2.width = r7;
object2.spoiler = a1;
contentScanMetadata = a0.contentScanMetadata;
object2.contentScanVersion = value4 == contentScanMetadata ? value2 : contentScanMetadata.version;
object2.flags = value5;
value = require(1391) /* metro dependency 1391: FlagUtils */;
object2.srcIsAnimated = value.hasFlag(a0.flags,
(require(4630) /* metro dependency 4630: MediaTypes */).UnfurledMediaItemFlags.IS_ANIMATED);
object2.isVideo = unfurledMediaItemType === 'VIDEO';
object2.mediaIndex = value5;
object2.srcUnfurledMediaItem = a0;
r0 = object2;
}
return r0;
}
function useForumPostMediaThumbnail(a0, a1) { // fn#75090, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:4122, offset: 0x01da264f, size: 80 bytes, params: 3, frame: 16
const value = a2;
const env0_0 = a1;
return env0_3.useMemo(_fun75091, [a1, useForumPostMediaProperties(a0, value !== undefined ? value : false)]);
}
function useFindFirstMediaProperties(a0, a1) { // fn#75093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:4434, offset: 0x01da26ff, size: 77 bytes, params: 3, frame: 15
const value2 = useForumPostMedia(a0);
const value3 = useForumPostEmbeds(a0, a1);
const value = useForumPostComponentsMedia(a0);
const property = value2[0];
const value4 = null;
let r1 = value4 != property ? property : value3[0];
r1 = value4 == r1 ? value[0] : r1;
return value4 != r1 ? r1 : value4;
}
function useFirstMediaIsEmbed(a0, a1) { // fn#75094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:4655, offset: 0x01da274c, size: 75 bytes, params: 3, frame: 15
return useForumPostMedia(a0)[0] == null && useForumPostComponentsMedia(a0)[0] == null && useForumPostEmbeds(a0,
a1)[0] != null;
}
function shouldShowAddMediaToOriginalPostModal(a0, a1) { // fn#75095, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:4859, offset: 0x01da2797, size: 280 bytes, params: 3, frame: 21
var r1;
var r0;
var ownerId;
var currentUser;
const channel = ChannelStore.getChannel(a1);
if (channel == null) {
return false;
}
const getMessage = MessageStore.getMessage;
const id = channel.id;
const value3 = undefined;
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
const value4 = Reflect.apply(getMessage, MessageStore, [id, defaultImport.castChannelIdAsMessageId(channel.id)]);
const value5 = value4 != null;
if (value5) {
r1 = a0.length > 0 && a0.find(function(a0) {
return a0.isImage || a0.isVideo;
}) != null;
r1 = r1 && channel.isForumPost();
if (r1) {
ownerId = channel.ownerId;
currentUser = UserStore.getCurrentUser();
r1 = ownerId === (currentUser == null ? value3 : currentUser.id);
}
r1 = r1 && ThreadMessageStore.getCount(channel.id) === 0;
r1 = r1 && (value4.attachments.length === 0 || value4.attachments.find(_fun75097) == null);
r0 = r1;
} else {
r0 = value5;
}
return r0;
}
function messageContainsGifOrVideo(a0) { // fn#75098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:5327, offset: 0x01da28e2, size: 36 bytes, params: 2, frame: 13
return a0.reduce(_fun75099, {'containsVideo': false, 'containsGif': false});
}
function _fun75080(a0, a1) { // fn#75080, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:999, offset: 0x01da1f5b, size: 404 bytes, params: 3, frame: 27
var r4;
var moduleValue2;
var hasFlag;
var value3;
var object2;
var moduleValue3;
const proxy_url = a0.proxy_url;
const url = a0.url;
const description = a0.description;
const spoiler = a0.spoiler;
let flags = a0.flags;
const width = a0.width;
const height = a0.height;
const filename = a0.filename;
const content_scan_version = a0.content_scan_version;
if (width == null) {
return null;
}
if (height == null) {
return null;
}
const isVideoFile2 = (require(4631) /* metro dependency 4631: MediaFormatTesters */).isVideoFile(filename);
const value2 = a0.flags != null;
if (value2) {
moduleValue2 = require(1391) /* metro dependency 1391: FlagUtils */;
r4 = moduleValue2.hasFlag(a0.flags, MessageAttachmentFlags.IS_THUMBNAIL);
} else {
r4 = value2;
}
let r13 = proxy_url ?? url;
if (isVideoFile2) {
value3 = (importDefault(1471) /* metro dependency 1471: URLUtils */).toURLSafe(proxy_url);
if (value3 == null) {
return null;
}
value3.searchParams.append('format', 'webp');
r13 = value3.toString();
object2 = {};
object2.type = env1_10.ATTACHMENT;
object2.src = r13;
object2.width = width;
object2.height = height;
object2.spoiler = spoiler != null && spoiler;
object2.flags = flags;
object2.contentScanVersion = content_scan_version;
object2.alt = description;
object2.isVideo = isVideoFile2;
object2.isThumbnail = r4;
object2.attachmentId = a0.id;
object2.mediaIndex = a1;
moduleValue3 = require(1391) /* metro dependency 1391: FlagUtils */;
hasFlag = moduleValue3.hasFlag;
flags = a0.flags;
object2.srcIsAnimated = Reflect.apply(hasFlag, moduleValue3, [flags ?? 0, MessageAttachmentFlags.IS_ANIMATED]);
} else {
object2 = {};
object2.type = env1_10.ATTACHMENT;
object2.src = r13;
object2.width = width;
object2.height = height;
object2.spoiler = spoiler != null && spoiler;
object2.flags = flags;
object2.contentScanVersion = content_scan_version;
object2.alt = description;
object2.isVideo = isVideoFile2;
object2.isThumbnail = r4;
object2.attachmentId = a0.id;
object2.mediaIndex = a1;
moduleValue3 = require(1391) /* metro dependency 1391: FlagUtils */;
hasFlag = moduleValue3.hasFlag;
flags = a0.flags;
object2.srcIsAnimated = Reflect.apply(hasFlag, moduleValue3, [flags ?? 0, MessageAttachmentFlags.IS_ANIMATED]);
}
return object2;
}
function _fun75083(a0, a1) { // fn#75083, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:2034, offset: 0x01da2213, size: 300 bytes, params: 3, frame: 21
var r3;
var height;
var proxyURL;
var width;
var flags;
var object2;
var moduleValue;
let r0 = a0.image ?? a0.thumbnail;
let value = r0 == null;
r0 = value && a0.images != null ? a0.images[0] : r0;
if (r0 != null) {
var url = r0.url;
if (url != null) {
height = r0.height;
proxyURL = r0.proxyURL;
url = r0.url;
width = r0.width;
flags = r0.flags;
value = proxyURL != null;
if (value) {
value = environment.__proto__;
value = require(4631) /* metro dependency 4631: MediaFormatTesters */;
value = value.isVideoUrl(proxyURL);
r3 = value;
} else {
r3 = value;
}
object2 = {};
value = environment.__proto__;
object2.type = env1_10.EMBED;
object2.src = proxyURL == null || proxyURL === '' ? url : proxyURL;
object2.height = height;
object2.width = width;
object2.spoiler = require;
object2.flags = a0.flags;
object2.contentScanVersion = a0.contentScanVersion;
object2.isVideo = r3;
object2.mediaIndex = a1;
moduleValue = require(1391) /* metro dependency 1391: FlagUtils */;
object2.srcIsAnimated = moduleValue.hasFlag(flags ?? 0, MessageEmbedMediaFlags.IS_ANIMATED);
return object2;
}
}
}
function _fun75085(a0) { // fn#75085, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:2685, offset: 0x01da23f9, size: 149 bytes, params: 2, frame: 16
var environment;
var unfurledMediaToForumPostMediaAttachmentBinding;
var media;
var spoiler;
const type = a0.type;
const value = environment.__proto__;
const ComponentType = (require(1909) /* metro dependency 1909: Server */).ComponentType;
const THUMBNAIL = ComponentType.THUMBNAIL;
if (THUMBNAIL === type) {
unfurledMediaToForumPostMediaAttachmentBinding = unfurledMediaToForumPostMediaAttachment;
media = a0.media;
spoiler = a0.spoiler;
return unfurledMediaToForumPostMediaAttachmentBinding(media, spoiler != null && spoiler);
}
const MEDIA_GALLERY = ComponentType.MEDIA_GALLERY;
if (MEDIA_GALLERY === type) {
return a0.items.map(_fun75086);
}
return null;
}
function _fun75091() { // fn#75091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:4225, offset: 0x01da269f, size: 85 bytes, params: 1, frame: 13
var value2;
if (require == null) {
return [];
}
const isMediaChannel2 = require.isMediaChannel();
const binding = env0_1;
if (isMediaChannel2) {
value2 = binding.find(function(a0) {
return a0.isThumbnail;
});
return value2 != null ? [value2] : env0_1;
}
return binding;
}
function _fun75097(a0) { // fn#75097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:5238, offset: 0x01da28c3, size: 31 bytes, params: 2, frame: 13
const value = environment.__proto__;
return isValidImageAttachment_75076(a0) || isValidVideoAttachment_75077(a0);
}
function _fun75099({containsVideo, containsGif}, a1) { // fn#75099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:5382, offset: 0x01da2906, size: 86 bytes, params: 3, frame: 14
var r1;
var value;
const object2 = {};
object2.containsVideo = containsVideo || a1.isVideo;
if (containsGif) {
r1 = containsGif;
} else {
value = environment.__proto__;
value = require(4631) /* metro dependency 4631: MediaFormatTesters */;
value = value.isAnimatedImageUrl(a1.src);
r1 = value;
}
object2.containsGif = r1;
return object2;
}
function _fun75086({media, spoiler}) { // fn#75086, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9773:2889, offset: 0x01da248e, size: 44 bytes, params: 2, frame: 14
const value = environment.__proto__.__proto__;
return unfurledMediaToForumPostMediaAttachment(media, spoiler != null && spoiler);
}
@@ -0,0 +1,515 @@
/* Metro module 6865; source: modules/forums/ForumPostMessagesStore.tsx; dependencies: [6, 7, 15, 17, 18, 6866, 1878, 21, 4625, 566, 694, 2] */
function _fun54204(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:6, offset: 0x0135f1f6, size: 456 bytes, params: 8, frame: 21
const env0_0 = require;
const _arrayLikeToArray_54210 = function(a0, a1) {
var r0;
var r1;
var r2;
var value3;
var length;
var value5;
var value = undefined;
var value2 = value == null;
reducibleJoin2: while (true) {
if (value2) {
r0 = value2;
break reducibleJoin2;
}
value3 = value > a0.length;
r0 = value3;
break reducibleJoin2;
}
reducibleJoin4: while (true) {
if (r0) {
length = a0.length;
r1 = length;
break reducibleJoin4;
}
r1 = value;
break reducibleJoin4;
}
value = (0, global.Array)(r1);
var value4 = 0;
if (value4 < r1) {
r2 = value4;
reducibleLoop5: while (true) {
value[r2] = a0[r2];
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value5 < r1) {
r2 = value5;
continue reducibleLoop5;
}
break reducibleLoop5;
}
}
return value;
};
const closure = LOAD_THREADS_SUCCESS;
const closure2 = MESSAGE_REACTION_ADD_54213;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
const guildSubscriptionsStore = importDefault(6866) /* metro dependency 6866: GuildSubscriptionsStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
let env0_10 = {};
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
let value = _fun54214(Store);
value.displayName = 'ForumPostMessagesStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
env0_10 = {};
}, MESSAGE_CREATE: MESSAGE_CREATE_54220, MESSAGE_UPDATE: MESSAGE_UPDATE_54221, MESSAGE_DELETE: MESSAGE_DELETE_54222,
THREAD_CREATE: THREAD_CREATE_54223, MESSAGE_REACTION_ADD: closure2, MESSAGE_REACTION_REMOVE: closure2,
MESSAGE_REACTION_REMOVE_ALL: MESSAGE_REACTION_REMOVE_ALL_54224,
MESSAGE_REACTION_REMOVE_EMOJI: MESSAGE_REACTION_REMOVE_EMOJI_54225,
MESSAGE_REACTION_ADD_MANY: MESSAGE_REACTION_ADD_MANY_54226, LOAD_FORUM_POSTS: function({threads}) {
var propertyName;
for (propertyName in threads) {
storeFirstMessage(propertyName, threads[propertyName].first_message);
}
}, LOAD_THREADS_SUCCESS: closure, LOAD_ARCHIVED_THREADS_SUCCESS: closure,
LOAD_MESSAGES_SUCCESS: LOAD_MESSAGES_SUCCESS_54228});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumPostMessagesStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_54205() { // fn#54205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:170, offset: 0x0135f3be, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_54205_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _createForOfIteratorHelperLoose_54208(a0, a1) { // fn#54208, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:363, offset: 0x0135f41c, size: 370 bytes, params: 3, frame: 20
var r6;
var r9;
var r5;
var value3;
var regexp;
const env0_0 = a0;
const Symbol = global.Symbol;
let value = typeof Symbol !== 'undefined';
let r1 = value && a0[global.Symbol.iterator];
r1 = !r1 ? a0['@@iterator'] : r1;
if (r1) {
value = r1.call(a0);
return value.next.bind(value);
}
const Array = global.Array;
if (Array.isArray(a0)) {
if (r1) {
}
return _fun54209;
}
value = undefined;
if (a0) {
if (typeof a0 === 'string') {
value = _arrayLikeToArray_54210(a0, value);
r5 = value;
} else {
value3 = ({}).toString.call(a0).slice(8, -1);
r6 = value3 === 'Object' && a0.constructor;
r9 = r6 ? a0.constructor.name : value3;
if (r9 === 'Map') {
r6 = global.Array.from(a0);
} else if (r9 === 'Set') {
r6 = global.Array.from(a0);
} else if (r9 === 'Arguments') {
value = _arrayLikeToArray_54210(a0, value);
r6 = value;
} else {
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
if (regexp.test(r9)) {
value = _arrayLikeToArray_54210(a0, value);
r6 = value;
} else {
r6 = value;
}
}
r5 = r6;
}
} else {
r5 = value;
}
if (r5) {
if (r5) {
}
return _fun54209;
}
const TypeError = global.TypeError;
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
}
function LOAD_ARCHIVED_THREADS_SUCCESS_54211({threads, firstMessages}) { // fn#54211, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:1282, offset: 0x0135f58e, size: 159 bytes, params: 2, frame: 17
var r3;
var r2;
var value4;
var binding;
var id;
var value5;
var value8;
var storeFirstMessageBinding;
var channel_id;
var value9;
if (firstMessages == null) {
return false;
}
const value2 = _createForOfIteratorHelperLoose_54208(threads);
const value3 = value2();
let done = value3.done;
if (!done) {
r3 = value3;
reducibleLoop2: while (true) {
value4 = r3.value;
binding = env0_10;
id = value4.id;
binding[id] = {'loaded': true, 'firstMessage': null};
value5 = value2();
done = value5.done;
if (done) {
break reducibleLoop2;
}
r3 = value5;
continue reducibleLoop2;
}
}
const value6 = _createForOfIteratorHelperLoose_54208(firstMessages);
const value7 = value6();
done = value7.done;
if (!done) {
r2 = value7;
reducibleLoop4: while (true) {
value8 = r2.value;
storeFirstMessageBinding = storeFirstMessage;
channel_id = value8.channel_id;
storeFirstMessageBinding(channel_id, value8);
value9 = value6();
done = value9.done;
if (done) {
break reducibleLoop4;
}
r2 = value9;
continue reducibleLoop4;
}
}
}
function storeFirstMessage(a0, a1) { // fn#54212, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:1592, offset: 0x0135f62d, size: 80 bytes, params: 3, frame: 13
var r0;
let value = null;
if (value == a1) {
r0 = value;
} else {
value = require(4625) /* metro dependency 4625: MessageRecordUtils */;
value = value.createMessageRecord(a1);
r0 = value;
}
env0_10[a0] = {loaded: true, firstMessage: r0};
}
function MESSAGE_REACTION_ADD_54213(a0) { // fn#54213, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:1707, offset: 0x0135f67d, size: 239 bytes, params: 2, frame: 23
var binding;
var object2;
const type = a0.type;
const channelId = a0.channelId;
const messageId = a0.messageId;
const userId = a0.userId;
const emoji = a0.emoji;
const optimistic = a0.optimistic;
const reactionType = a0.reactionType;
const property = env0_10[channelId];
if (property == null) {
return false;
}
if (property.firstMessage == null) {
return false;
}
if (messageId !== property.firstMessage.id) {
return false;
}
const currentUser = UserStore.getCurrentUser();
const r5 = currentUser != null && currentUser.id === userId;
if (optimistic) {
if (r5) {
binding = env0_10;
object2 = {};
copyDataProperties(object2, property, undefined);
binding[channelId] = object2;
env0_10[channelId].firstMessage = type === 'MESSAGE_REACTION_ADD' ? property.firstMessage.addReaction(emoji,
r5,
a0.colors, reactionType) : property.firstMessage.removeReaction(emoji, r5, reactionType);
return undefined;
}
return false;
}
binding = env0_10;
object2 = {};
copyDataProperties(object2, property, undefined);
binding[channelId] = object2;
env0_10[channelId].firstMessage = type === 'MESSAGE_REACTION_ADD' ? property.firstMessage.addReaction(emoji, r5,
a0.colors, reactionType) : property.firstMessage.removeReaction(emoji, r5, reactionType);
}
function _fun54214(a0) { // fn#54214, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:2117, offset: 0x0135f76c, size: 114 bytes, params: 2, frame: 16
const closure = ForumPostMessagesStore;
env0_7(closure, a0);
return env0_4(closure, [{key: 'initialize', value: function() {
this.waitFor(GuildSubscriptionsStore, UserStore);
}}, {key: 'isLoading', value: value_54217}, {key: 'getMessage', value: value_54218}]);
}
function MESSAGE_CREATE_54220(a0) { // fn#54220, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:2818, offset: 0x0135f861, size: 110 bytes, params: 2, frame: 17
var r1;
var r0;
var message;
var id;
var value2;
var defaultImport;
var castChannelIdAsMessageId;
var channel_id;
var value3;
var storeFirstMessageBinding;
const isPushNotification = a0.isPushNotification;
if (isPushNotification) {
r0 = !isPushNotification;
} else {
message = a0.message;
id = message.id;
value2 = undefined;
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
castChannelIdAsMessageId = defaultImport.castChannelIdAsMessageId;
message = a0.message;
channel_id = message.channel_id;
value3 = id === Reflect.apply(castChannelIdAsMessageId, defaultImport, [channel_id]);
if (value3) {
storeFirstMessageBinding = storeFirstMessage;
message = a0.message;
channel_id = message.channel_id;
message = a0.message;
storeFirstMessageBinding(channel_id, message);
r1 = value2;
} else {
r1 = value3;
}
r0 = r1;
}
return r0;
}
function MESSAGE_UPDATE_54221(a0) { // fn#54221, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:3023, offset: 0x0135f8cf, size: 226 bytes, params: 2, frame: 20
var r1;
var r0;
var firstMessage;
var value4;
var defaultImport2;
var value5;
var object2;
var updateMessageRecord;
let message = a0.message;
if (message.id !== a0.message.channel_id) {
return false;
}
var value;
let binding = env0_10;
const value2 = undefined;
const defaultImport = importDefault(dependencyMap[7]);
let castMessageIdAsChannelId = defaultImport.castMessageIdAsChannelId;
const property = binding[Reflect.apply(castMessageIdAsChannelId, defaultImport, [a0.message.id])];
const value3 = property != null;
if (value3) {
firstMessage = property.firstMessage;
value4 = firstMessage != null;
if (value4) {
binding = env0_10;
defaultImport2 = importDefault(dependencyMap[7]);
castMessageIdAsChannelId = defaultImport2.castMessageIdAsChannelId;
message = a0.message;
value5 = Reflect.apply(castMessageIdAsChannelId, defaultImport2, [message.id]);
object2 = {};
copyDataProperties(object2, property, dependencyMap);
value = require(dependencyMap[8]);
updateMessageRecord = value.updateMessageRecord;
firstMessage = property.firstMessage;
message = a0.message;
value = Reflect.apply(updateMessageRecord, value, [firstMessage, message]);
object2['firstMessage'] = value;
binding[value5] = object2;
r1 = value2;
} else {
r1 = value4;
}
r0 = r1;
} else {
r0 = value3;
}
return r0;
}
function MESSAGE_DELETE_54222(a0) { // fn#54222, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:3346, offset: 0x0135f9b1, size: 86 bytes, params: 2, frame: 15
const id = a0.id;
const defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
if (id !== defaultImport.castChannelIdAsMessageId(a0.channelId)) {
return false;
}
env0_10[a0.channelId] = {'loaded': true, 'firstMessage': null};
}
function THREAD_CREATE_54223(a0) { // fn#54223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:3503, offset: 0x0135fa07, size: 106 bytes, params: 2, frame: 14
var r1;
var r0;
var isSubscribedToThreads2;
const value2 = env0_10[a0.channel.id] == null;
if (value2) {
isSubscribedToThreads2 = GuildSubscriptionsStore.isSubscribedToThreads(a0.channel.guild_id);
if (isSubscribedToThreads2) {
env0_10[a0.channel.id] = {'loaded': true, 'firstMessage': null};
r1 = undefined;
} else {
r1 = !!isSubscribedToThreads2;
}
r0 = r1;
} else {
r0 = value2;
}
return r0;
}
function MESSAGE_REACTION_REMOVE_ALL_54224({channelId, messageId}) { // fn#54224, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:3769, offset: 0x0135fa71, size: 125 bytes, params: 2, frame: 18
var r1;
var value4;
var binding;
var object2;
var value;
const property = env0_10[channelId];
let r0 = property != null && property.firstMessage != null;
if (r0) {
value4 = messageId === property.firstMessage.id;
if (value4) {
binding = env0_10;
object2 = {};
copyDataProperties(object2, property, undefined);
value = property.firstMessage.set('reactions', []);
object2['firstMessage'] = value;
binding[channelId] = object2;
value = undefined;
r1 = value;
} else {
r1 = value4;
}
r0 = r1;
}
return r0;
}
function MESSAGE_REACTION_REMOVE_EMOJI_54225({channelId, messageId, emoji}) { // fn#54225, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:4001, offset: 0x0135faee, size: 123 bytes, params: 2, frame: 17
var r1;
var value4;
var binding;
var object2;
var value;
const property = env0_10[channelId];
let r0 = property != null && property.firstMessage != null;
if (r0) {
value4 = messageId === property.firstMessage.id;
if (value4) {
binding = env0_10;
object2 = {};
copyDataProperties(object2, property, emoji);
value = property.firstMessage.removeReactionsForEmoji(emoji);
object2['firstMessage'] = value;
binding[channelId] = object2;
value = undefined;
r1 = value;
} else {
r1 = value4;
}
r0 = r1;
}
return r0;
}
function MESSAGE_REACTION_ADD_MANY_54226({channelId, messageId, reactions}) { // fn#54226, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:4246, offset: 0x0135fb69, size: 147 bytes, params: 2, frame: 19
const property = env0_10[channelId];
if (property == null) {
return false;
}
let firstMessage = property.firstMessage;
if (firstMessage == null) {
return false;
}
if (messageId !== property.firstMessage.id) {
return false;
}
const currentUser = UserStore.getCurrentUser();
firstMessage = property.firstMessage;
const addReactionBatch = firstMessage.addReactionBatch;
const value3 = currentUser == null;
const value5 = Reflect.apply(addReactionBatch, firstMessage, [reactions, value3 ? undefined : currentUser.id]);
const binding = env0_10;
const object2 = {};
copyDataProperties(object2, property, value3);
object2['firstMessage'] = value5;
binding[channelId] = object2;
}
function LOAD_MESSAGES_SUCCESS_54228({channelId, messages}) { // fn#54228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:4755, offset: 0x0135fc39, size: 149 bytes, params: 2, frame: 15
var r0;
var id;
var binding;
var object2;
const property = messages[messages.length - 1];
let value = property != null;
if (value) {
id = property.id;
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = id === value.castChannelIdAsMessageId(channelId);
r0 = value;
} else {
r0 = value;
}
if (r0) {
binding = env0_10;
object2 = {loaded: true};
object2.firstMessage = (require(4625) /* metro dependency 4625: MessageRecordUtils */).createMessageRecord(property);
binding[channelId] = object2;
}
}
function value_54217(a0) { // fn#54217, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:2511, offset: 0x0135f7fc, size: 39 bytes, params: 2, frame: 3
const value = environment.__proto__;
return env1_10[a0]?.loaded !== true;
}
function value_54218(a0) { // fn#54218, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7043:2599, offset: 0x0135f823, size: 49 bytes, params: 2, frame: 4
if (!(a0 in env1_10)) {
env1_10[a0] = {'loaded': false, 'firstMessage': null};
}
return env1_10[a0];
}
@@ -0,0 +1,240 @@
/* Metro module 6901; source: modules/forums/ForumPostRecentMessageStore.tsx; dependencies: [6, 7, 15, 17, 18, 1379, 1878, 21, 4625, 1360, 566, 694, 2] */
function _fun54884(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54884, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:6, offset: 0x013704ae, size: 400 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = LOAD_ARCHIVED_THREADS_SUCCESS_54892;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
let env0_10 = {};
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
let value = _fun54895(Store);
value.displayName = 'ForumPostRecentMessageStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
env0_10 = {};
}, MESSAGE_CREATE: MESSAGE_CREATE_54900, MESSAGE_UPDATE: MESSAGE_UPDATE_54901, MESSAGE_DELETE: MESSAGE_DELETE_54902,
LOAD_FORUM_POSTS: function({threads}) {
var propertyName;
for (propertyName in threads) {
set_54889(propertyName, threads[propertyName].most_recent_message);
}
}, LOAD_ARCHIVED_THREADS_SUCCESS: closure, LOAD_THREADS_SUCCESS: closure});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumPostRecentMessageStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_54885() { // fn#54885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:168, offset: 0x0137063e, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_54885_isNativeReflectConstruct = function() {
return !!result;
})();
}
function isValidMessage(a0) { // fn#54888, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:370, offset: 0x0137069c, size: 158 bytes, params: 2, frame: 17
var id;
var binding;
var property;
var compare;
var value;
const value2 = undefined;
const channel = ChannelStore.getChannel(a0 == null ? value2 : a0.channel_id);
if (channel != null) {
if (channel.isForumPost()) {
binding = env0_10;
id = channel.id;
property = binding[id];
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
compare = value.compare;
id = a0 == null ? value2 : a0.id;
value = Reflect.apply(compare, value, [id,
property == null || property.message == null ? value2 : property.message.id]);
return value > -1;
}
}
return false;
}
function set_54889(a0, a1) { // fn#54889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:587, offset: 0x0137073a, size: 77 bytes, params: 3, frame: 13
var r1;
let value = null;
if (value == a1) {
r1 = value;
} else {
value = require(4625) /* metro dependency 4625: MessageRecordUtils */;
value = value.createMessageRecord(a1);
r1 = value;
}
env0_10[a0] = {loaded: true, message: r1};
return true;
}
function getMessageState(a0) { // fn#54890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:692, offset: 0x01370787, size: 16 bytes, params: 2, frame: 2
return env0_10[a0];
}
function getMessage(a0) { // fn#54891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:732, offset: 0x01370797, size: 33 bytes, params: 2, frame: 11
const getMessageStateBinding = getMessageState;
const value = undefined;
const messageStateBinding = getMessageStateBinding(a0);
return messageStateBinding == null ? value : messageStateBinding.message;
}
function LOAD_ARCHIVED_THREADS_SUCCESS_54892({threads, mostRecentMessages}) { // fn#54892, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:814, offset: 0x013707b8, size: 98 bytes, params: 2, frame: 14
threads.forEach(function(a0) {
set_54889(a0.id, null);
return true;
});
if (mostRecentMessages != null) {
mostRecentMessages.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish).forEach(function(a0) {
set_54889(a0.channel_id, a0);
});
}
}
function _fun54895(a0) { // fn#54895, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:995, offset: 0x01370850, size: 91 bytes, params: 2, frame: 16
const closure = ForumPostRecentMessageStore;
env0_7(closure, a0);
return env0_4(closure, [{key: 'initialize', value: function() {
this.waitFor(ChannelStore, UserStore);
}}, {key: 'getMessageState', value: value_54898}]);
}
function MESSAGE_CREATE_54900(a0) { // fn#54900, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:1640, offset: 0x013708dc, size: 159 bytes, params: 2, frame: 18
var r1;
var r0;
var isValidMessageBinding;
var message;
var value2;
var isValidMessage2;
var channel_id;
var defaultImport;
var castMessageIdAsChannelId;
var set_54889Binding;
const isPushNotification = a0.isPushNotification;
if (isPushNotification) {
r0 = !isPushNotification;
} else {
isValidMessageBinding = isValidMessage;
message = a0.message;
value2 = undefined;
isValidMessage2 = isValidMessageBinding(message);
if (isValidMessage2) {
message = a0.message;
channel_id = message.channel_id;
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
castMessageIdAsChannelId = defaultImport.castMessageIdAsChannelId;
message = a0.message;
if (channel_id === Reflect.apply(castMessageIdAsChannelId, defaultImport, [message.id])) {
set_54889(a0.message.channel_id, null);
r1 = value2;
} else {
set_54889Binding = set_54889;
message = a0.message;
channel_id = message.channel_id;
message = a0.message;
set_54889Binding(channel_id, message);
r1 = value2;
}
} else {
r1 = !!isValidMessage2;
}
r0 = r1;
}
return r0;
}
function MESSAGE_UPDATE_54901(a0) { // fn#54901, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:1891, offset: 0x0137097b, size: 180 bytes, params: 2, frame: 21
var r1;
var r0;
var channel_id;
var value4;
var messageState;
var message2;
var binding;
var object2;
var value;
const isValidMessageBinding = isValidMessage;
let message = a0.message;
const value2 = undefined;
const isValidMessage2 = isValidMessageBinding(message);
if (isValidMessage2) {
message = a0.message;
channel_id = message.channel_id;
message = a0.message;
value4 = channel_id !== message.id;
if (value4) {
message = a0.message;
channel_id = message.channel_id;
message = a0.message;
messageState = getMessageState(channel_id);
message2 = getMessage(channel_id);
if (messageState != null && message2 != null) {
binding = env0_10;
object2 = {};
copyDataProperties(object2, messageState, undefined);
value = require(4625) /* metro dependency 4625: MessageRecordUtils */;
value = value.updateMessageRecord(message2, message);
object2['message'] = value;
binding[channel_id] = object2;
r1 = value2;
} else {
r1 = value2;
}
} else {
r1 = value4;
}
r0 = r1;
} else {
r0 = !!isValidMessage2;
}
return r0;
}
function MESSAGE_DELETE_54902({channelId, id}) { // fn#54902, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:2196, offset: 0x01370a2f, size: 60 bytes, params: 2, frame: 14
var r0;
const id = getMessage(channelId)?.id;
const value4 = id === id;
if (value4) {
delete env0_10[channelId];
r0 = true;
} else {
r0 = value4;
}
return r0;
}
function value_54898(a0) { // fn#54898, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7079:1420, offset: 0x013708ab, size: 49 bytes, params: 2, frame: 4
if (!(a0 in env1_10)) {
env1_10[a0] = {'loaded': false, 'message': null};
}
return env1_10[a0];
}
@@ -0,0 +1,159 @@
/* Metro module 9620; source: modules/forums/ForumPostUnreadCountStore.tsx; dependencies: [6, 7, 15, 17, 18, 4790, 1379, 4605, 44, 566, 694, 2] */
function _fun75419(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75419, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:6, offset: 0x01dad15c, size: 419 bytes, params: 8, frame: 19
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const activeThreadsStore = importDefault(4790) /* metro dependency 4790: ActiveThreadsStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
let env0_10 = {};
let Set = global.Set;
let set = new Set();
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
_fun75423(Store).displayName = 'ForumPostUnreadCountStore';
set = new set(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
env0_10 = {};
var Set = global.Set;
var value3 = new Set();
}, THREAD_CREATE: THREAD_CREATE_75430, MESSAGE_CREATE: MESSAGE_CREATE_75431, FORUM_UNREADS: function({threads}) {
threads.forEach(_fun75433);
}, MESSAGE_ACK: MESSAGE_ACK_75434, REQUEST_FORUM_UNREADS: function({threads}) {
threads.forEach(_fun75436);
}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumPostUnreadCountStore.tsx');
exports.default = set;
}
function _isNativeReflectConstruct_75420() { // fn#75420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:178, offset: 0x01dad2ff, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_75420_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun75423(a0) { // fn#75423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:396, offset: 0x01dad361, size: 124 bytes, params: 2, frame: 16
const closure = ForumPostUnreadCountStore;
env0_6(closure, a0);
return env0_3(closure, [{key: 'initialize', value: function() {
this.waitFor(ActiveThreadsStore, ChannelStore, ReadStateStore);
}}, {key: 'getCount', value: value_75426}, {key: 'getThreadIdsMissingCounts', value: value_75427}]);
}
function THREAD_CREATE_75430({channel, isNewlyCreated}) { // fn#75430, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:1167, offset: 0x01dad480, size: 77 bytes, params: 2, frame: 14
var r1;
var r0;
var hasLoaded2;
if (isNewlyCreated) {
hasLoaded2 = ActiveThreadsStore.hasLoaded(channel.guild_id);
if (hasLoaded2) {
env0_10[channel.id] = 0;
r1 = undefined;
} else {
r1 = !!hasLoaded2;
}
r0 = r1;
} else {
r0 = !!isNewlyCreated;
}
return r0;
}
function MESSAGE_CREATE_75431({channelId, optimistic, isPushNotification}) { // fn#75431, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:1297, offset: 0x01dad4cd, size: 71 bytes, params: 2, frame: 6
var r1;
var value2;
var binding;
var property;
let value = !optimistic;
let r0 = optimistic ? value : !isPushNotification;
if (r0) {
value2 = channelId in env0_10;
if (value2) {
binding = env0_10;
property = binding[channelId];
value = typeof property === 'bigint' ? property : +property;
binding[channelId] = typeof value === 'bigint' ? value + 1n : +value + 1;
value = undefined;
r1 = value;
} else {
r1 = value2;
}
r0 = r1;
}
return r0;
}
function FORUM_UNREADS({threads}) { // fn#75432, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:1426, offset: 0x01dad514, size: 32 bytes, params: 2, frame: 11
threads.forEach(_fun75433);
}
function MESSAGE_ACK_75434({channelId}) { // fn#75434, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:1537, offset: 0x01dad55c, size: 111 bytes, params: 2, frame: 16
if (channelId in env0_10) {
env0_10[channelId] = ReadStateStore.getUnreadCount(channelId);
return undefined;
}
const channel = ChannelStore.getChannel(ChannelStore.getChannel(channelId)?.parent_id);
if (channel != null) {
if (channel.isForumLikeChannel()) {
env0_10[channelId] = ReadStateStore.getUnreadCount(channelId);
return undefined;
}
}
return false;
}
function REQUEST_FORUM_UNREADS_75435({threads}) { // fn#75435, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:1750, offset: 0x01dad5cb, size: 32 bytes, params: 2, frame: 11
threads.forEach(_fun75436);
}
function value_75427(a0, a1) { // fn#75427, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:871, offset: 0x01dad3dd, size: 79 bytes, params: 3, frame: 15
var environment;
const value = environment.__proto__;
(importDefault(44) /* metro dependency 44 */)(ActiveThreadsStore.hasLoaded(a0),
'must wait for THREAD_LIST_SYNC before calling this');
return a1.filter(_fun75428);
}
function _fun75433(a0) { // fn#75433, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:1478, offset: 0x01dad534, size: 40 bytes, params: 2, frame: 3
var value;
if (a0.count != null) {
value = environment.__proto__;
env1_10[a0.threadId] = a0.count;
}
}
function _fun75436({threadId}) { // fn#75436, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:1809, offset: 0x01dad5eb, size: 28 bytes, params: 2, frame: 11
return env1_11.add(threadId);
}
function _fun75428(a0) { // fn#75428, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9806:979, offset: 0x01dad42c, size: 39 bytes, params: 2, frame: 12
const value = environment.__proto__.__proto__;
return !(a0 in env2_10) && !env2_11.has(a0);
}
+189
View File
@@ -0,0 +1,189 @@
/* Metro module 7156; source: modules/forums/ForumSearchStore.tsx; dependencies: [6, 7, 15, 17, 18, 1379, 566, 694, 2] */
function _fun57383(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:6, offset: 0x013e4dcb, size: 379 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(6) /* metro dependency 6 */;
const env0_1 = importDefault(7) /* metro dependency 7 */;
const env0_2 = importDefault(15) /* metro dependency 15 */;
const env0_3 = importDefault(17) /* metro dependency 17 */;
const env0_4 = importDefault(18) /* metro dependency 18 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
let env0_6 = {};
const Store = (importDefault(566) /* metro dependency 566: flux */).Store;
let value = _fun57389(Store);
value.displayName = 'ForumSearchStore';
value = new value(importDefault(694) /* metro dependency 694: Dispatcher */, {CONNECTION_OPEN: function() {
env0_6 = {};
}, THREAD_DELETE: THREAD_DELETE_57397, CHANNEL_DELETE: CHANNEL_DELETE_57399,
FORUM_SEARCH_QUERY_UPDATED: FORUM_SEARCH_QUERY_UPDATED, FORUM_SEARCH_START: FORUM_SEARCH_START,
FORUM_SEARCH_SUCCESS: FORUM_SEARCH_SUCCESS, FORUM_SEARCH_FAILURE: FORUM_SEARCH_FAILURE,
FORUM_SEARCH_CLEAR: FORUM_SEARCH_CLEAR});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumSearchStore.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_57384() { // fn#57384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:158, offset: 0x013e4f46, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_57384_isNativeReflectConstruct = function() {
return !!result;
})();
}
function isForumLikeChannel(a0) { // fn#57387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:360, offset: 0x013e4fa4, size: 47 bytes, params: 2, frame: 11
const channel = ChannelStore.getChannel(a0);
return !(channel == null || !channel.isForumLikeChannel());
}
function getOrCreateSearchState_57388(a0) { // fn#57388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:455, offset: 0x013e4fd3, size: 44 bytes, params: 2, frame: 4
const r0 = env0_6[a0] ?? ({'query': null, 'loading': false, 'results': null});
env0_6[a0] = r0;
return r0;
}
function _fun57389(a0) { // fn#57389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:574, offset: 0x013e4fff, size: 164 bytes, params: 2, frame: 16
const closure = ForumSearchStore;
env0_4(closure, a0);
return env0_1(closure, [{key: 'initialize', value: function() {
this.waitFor(ChannelStore);
}}, {key: 'getSearchQuery', value: value_57392}, {key: 'getSearchLoading', value: value_57393},
{key: 'getSearchResults', value: value_57394}, {key: 'getHasSearchResults', value: value_57395}]);
}
function THREAD_DELETE_57397({channel}) { // fn#57397, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:1443, offset: 0x013e5149, size: 112 bytes, params: 2, frame: 17
const parent_id = channel.parent_id;
if (parent_id == null) {
return false;
}
const property = env0_6[parent_id];
if (property == null) {
return false;
}
const binding = env0_6;
const object2 = {};
copyDataProperties(object2, property, undefined);
object2['results'] = property.results?.filter(function(a0) {
return channel.id !== a0;
});
binding[parent_id] = object2;
}
function CHANNEL_DELETE_57399({channel}) { // fn#57399, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:1642, offset: 0x013e51ce, size: 26 bytes, params: 2, frame: 2
return delete env0_6[channel.id];
}
function FORUM_SEARCH_QUERY_UPDATED({channelId, query}) { // fn#57400, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:1734, offset: 0x013e51e8, size: 72 bytes, params: 2, frame: 15
var orCreateSearchState_57388;
var binding;
var object2;
if (isForumLikeChannel(channelId)) {
orCreateSearchState_57388 = getOrCreateSearchState_57388(channelId);
binding = env0_6;
object2 = {};
copyDataProperties(object2, orCreateSearchState_57388, query);
object2['query'] = query;
binding[channelId] = object2;
return undefined;
}
return false;
}
function FORUM_SEARCH_START({channelId}) { // fn#57401, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:1903, offset: 0x013e5230, size: 68 bytes, params: 2, frame: 15
var orCreateSearchState_57388;
var binding;
var object2;
if (isForumLikeChannel(channelId)) {
orCreateSearchState_57388 = getOrCreateSearchState_57388(channelId);
binding = env0_6;
object2 = {};
copyDataProperties(object2, orCreateSearchState_57388, undefined);
object2['loading'] = true;
binding[channelId] = object2;
return undefined;
}
return false;
}
function FORUM_SEARCH_SUCCESS({channelId, threadIds}) { // fn#57402, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:2062, offset: 0x013e5274, size: 83 bytes, params: 2, frame: 16
var orCreateSearchState_57388;
var binding;
var object2;
if (isForumLikeChannel(channelId)) {
orCreateSearchState_57388 = getOrCreateSearchState_57388(channelId);
binding = env0_6;
object2 = {};
copyDataProperties(object2, orCreateSearchState_57388, undefined);
object2['loading'] = false;
object2['results'] = threadIds;
binding[channelId] = object2;
return undefined;
}
return false;
}
function FORUM_SEARCH_FAILURE({channelId}) { // fn#57403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:2245, offset: 0x013e52c7, size: 81 bytes, params: 2, frame: 15
var orCreateSearchState_57388;
var binding;
var object2;
if (isForumLikeChannel(channelId)) {
orCreateSearchState_57388 = getOrCreateSearchState_57388(channelId);
binding = env0_6;
object2 = {};
copyDataProperties(object2, orCreateSearchState_57388, undefined);
object2['loading'] = false;
object2['results'] = [];
binding[channelId] = object2;
return undefined;
}
return false;
}
function FORUM_SEARCH_CLEAR({channelId}) { // fn#57404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:2415, offset: 0x013e5318, size: 41 bytes, params: 2, frame: 12
const isForumLikeChannel2 = isForumLikeChannel(channelId);
return isForumLikeChannel2 ? delete env0_6[channelId] : !!isForumLikeChannel2;
}
function value_57392(a0) { // fn#57392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:941, offset: 0x013e50a3, size: 33 bytes, params: 2, frame: 3
const value = environment.__proto__;
return env1_6[a0]?.query;
}
function value_57393(a0) { // fn#57393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:1026, offset: 0x013e50c4, size: 43 bytes, params: 2, frame: 4
const value = environment.__proto__;
const loading = env1_6[a0]?.loading;
return loading != null && loading;
}
function value_57394(a0) { // fn#57394, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:1128, offset: 0x013e50ef, size: 33 bytes, params: 2, frame: 3
const value = environment.__proto__;
return env1_6[a0]?.results;
}
function value_57395(a0) { // fn#57395, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7334:1218, offset: 0x013e5110, size: 57 bytes, params: 2, frame: 4
const value = environment.__proto__;
const property = env1_6[a0];
return property?.results != null && property.results.length > 0;
}
+158
View File
@@ -0,0 +1,158 @@
/* Metro module 6863; source: modules/forums/ForumTagHooks.tsx; dependencies: [31, 1379, 3784, 482, 566, 1360, 6864, 2] */
function _fun54170(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54170, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:6, offset: 0x0135e653, size: 237 bytes, params: 8, frame: 22
let env0_0 = require;
const closure = function(a0) {
var r5;
r5 = a0?.parent_id;
var env0_0 = r5;
return require(dependencyMap[4]).useStateFromStoresObject([ChannelStore], _fun54172, [r5]);
};
const closure2 = useAppliedTags;
const closure3 = useVisibleForumTags;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const env0_5 = (require(482) /* metro dependency 482: Constants */).Permissions;
const env0_6 = [];
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumTagHooks.tsx');
exports.useAvailableTags = closure;
exports.useAppliedTags = closure2;
exports.useSomeAppliedTags = useSomeAppliedTags;
exports.useVisibleForumTags = closure3;
exports.useVisibleAppliedForumTags = useVisibleAppliedForumTags;
}
function useAvailableTags(a0) { // fn#54171, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:148, offset: 0x0135e740, size: 91 bytes, params: 2, frame: 17
return (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([ChannelStore], _fun54172,
[a0?.parent_id]);
}
function useAppliedTags(a0) { // fn#54174, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:392, offset: 0x0135e7fe, size: 61 bytes, params: 2, frame: 15
const env0_0 = a0;
return env0_2.useMemo(_fun54175, [useAvailableTags(a0), a0]);
}
function useVisibleForumTags(a0) { // fn#54177, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:684, offset: 0x0135e8f1, size: 115 bytes, params: 2, frame: 17
const env0_0 = a0;
return env0_2.useMemo(_fun54179,
[(require(566) /* metro dependency 566: flux */).useStateFromStores([PermissionStore], _fun54178),
a0?.availableTags]);
}
function useSomeAppliedTags(a0) { // fn#54181, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:1105, offset: 0x0135e9e9, size: 75 bytes, params: 2, frame: 15
const value = a1;
return env0_2.useMemo(_fun54182, [useAppliedTags(a0), value !== undefined ? value : 1]);
}
function useVisibleAppliedForumTags(a0, a1) { // fn#54183, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:1304, offset: 0x0135ea7a, size: 129 bytes, params: 3, frame: 21
const env0_0 = a0;
const env0_1 = a1;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
const value2 = useVisibleForumTags(Reflect.apply(useStateFromStores, fluxModule, [[ChannelStore], _fun54184, [a0]]));
return value2.useMemo(_fun54185, [a1, value2, a0]);
}
function _fun54172() { // fn#54172, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:255, offset: 0x0135e79b, size: 72 bytes, params: 1, frame: 13
var environment;
const value = environment.__proto__;
return (ChannelStore.getChannel(parent_id)?.availableTags ?? []).reduce(function(a0, a1) {
var object = {};
copyDataProperties(object, a0, a1);
object[a1.id] = a1;
return object;
}, {});
}
function _fun54175() { // fn#54175, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:463, offset: 0x0135e83b, size: 182 bytes, params: 1, frame: 17
var environment;
var r3;
var r0;
var appliedTags;
var value3;
var binding;
var value;
const value2 = undefined;
if (env0_0 == null) {
r3 = value2;
} else {
appliedTags = env0_0.appliedTags;
if (appliedTags == null) {
r3 = value2;
} else {
value3 = appliedTags.map(_fun54176);
r3 = value3 == null ? value2 : value3.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
}
}
r3 = r3 ?? env1_6;
if (env0_0 == null) {
r0 = r3;
} else {
binding = env0_0;
if (binding.isModeratorReportChannel()) {
value = environment.__proto__;
value = require(6864) /* metro dependency 6864: ReportToModUtils */;
value = value.sortedModeratorReportTags(r3);
r0 = value;
} else {
r0 = r3;
}
}
return r0;
}
function _fun54178() { // fn#54178, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:754, offset: 0x0135e964, size: 38 bytes, params: 1, frame: 13
const can = PermissionStore.can;
const MANAGE_THREADS = Permissions.MANAGE_THREADS;
return Reflect.apply(can, PermissionStore, [MANAGE_THREADS, env0_0]);
}
function _fun54179() { // fn#54179, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:804, offset: 0x0135e98a, size: 81 bytes, params: 1, frame: 14
const r2 = env0_0?.availableTags ?? [];
const items2 = [];
arraySpread(items2, r2, 0, items2);
return env0_1 ? items2 : items2.filter(function(a0) {
return !a0.moderated;
});
}
function _fun54182() { // fn#54182, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:1182, offset: 0x0135ea34, size: 70 bytes, params: 1, frame: 15
const binding = env0_1;
const slice = binding.slice;
const binding2 = env0_0;
const Math = global.Math;
return [Reflect.apply(slice, binding, [0, binding2]), Math.max(0, env0_1.length - binding2)];
}
function _fun54184() { // fn#54184, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:1403, offset: 0x0135eafb, size: 47 bytes, params: 1, frame: 13
return ChannelStore.getChannel(env0_0?.parent_id);
}
function _fun54185() { // fn#54185, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:1473, offset: 0x0135eb2a, size: 95 bytes, params: 1, frame: 13
var environment;
var r0;
var binding;
var value;
const value2 = require.filter(_fun54186);
if (env0_0 == null) {
r0 = value2;
} else {
binding = env0_0;
if (binding.isModeratorReportChannel()) {
value = environment.__proto__;
value = require(6864) /* metro dependency 6864: ReportToModUtils */;
value = value.sortedModeratorReportTags(value2);
r0 = value;
} else {
r0 = value2;
}
}
return r0;
}
function _fun54186(a0) { // fn#54186, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7041:1494, offset: 0x0135eb89, size: 22 bytes, params: 2, frame: 11
return env1_2.includes(a0);
}
+140
View File
@@ -0,0 +1,140 @@
/* Metro module 6899; source: modules/forums/ForumUtils.tsx; dependencies: [1379, 1867, 4605, 6900, 1386, 1244, 1388, 2] */
function _fun54876(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#54876, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7077:6, offset: 0x0136fff4, size: 245 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = getForumPostReadStates;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const readStateStore = importDefault(4605) /* metro dependency 4605: ReadStateStore */;
const env0_5 = (require(6900) /* metro dependency 6900: ForumConstants */).ForumTimestampFormats;
const env0_6 = (require(1386) /* metro dependency 1386: ChannelConstants */).ChannelFlags;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/ForumUtils.tsx');
exports.getForumPostReadStates = closure;
exports.getForumPostReadStatesById = getForumPostReadStatesById;
exports.getForumTimestampFormatter = function(a0, a1) {
if (a1 === ForumTimestampFormats.POSTED_DURATION_AGO) {
var CREATION_DATE = require(dependencyMap[6]).ThreadSortOrder.CREATION_DATE;
if (a0 === CREATION_DATE) {
return getCreationDefaultFormatter;
}
}
};
exports.canDisplayPostUnreadMessageCount = function(a0, a1) {
var iterator = a1[Symbol.iterator]();
var item2 = iterator.next();
var item = item2.value;
item2 = item2.done ? undefined : iterator;
var value = undefined;
var value2 = item2 === value;
var r3 = value2 ? value : item;
if (!value2) {
item2.return();
}
return r3.hasTrackedUnread(a0) && r3.hasOpenedThread(a0) && r3.getTrackedAckMessageId(a0) != null;
};
exports.isForumPostPinned = isForumPostPinned;
}
function getForumPostReadStates(a0, a1) { // fn#54877, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7077:181, offset: 0x013700e9, size: 150 bytes, params: 3, frame: 18
let value = a2;
const value2 = undefined;
const iterator = (value !== value2 ? value : [ReadStateStore])[Symbol.iterator]();
let item2 = iterator.next();
const item = item2.value;
item2 = item2.done ? undefined : iterator;
value = item2 === value2;
const r4 = value ? value2 : item;
if (!value) {
item2.return();
}
const object2 = {};
object2.isNew = !a0.isArchivedThread() && r4.isNewForumThread(a0.id, a0.parent_id, a1);
object2.hasUnreads = !a0.isArchivedThread() && r4.isForumPostUnread(a0.id);
return object2;
}
function getCreationDefaultFormatter() { // fn#54878, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7077:394, offset: 0x0137017f, size: 152 bytes, params: 1, frame: 15
const object2 = {};
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object2.minutes = t.nFt9ck;
object2.hours = t.jzCewe;
const U4I0sw = t.U4I0sw;
object2.days = U4I0sw;
object2.month = (require(1244) /* metro dependency 1244: indexNative */).intl.string(t['nBNJ/L']);
return object2;
}
function getForumPostReadStatesById(a0) { // fn#54879, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7077:659, offset: 0x01370217, size: 204 bytes, params: 2, frame: 19
var r1;
var r0;
var r3;
var r7;
var item3;
var item4;
let value = a1;
const value2 = undefined;
const iterator = (value !== value2 ? value : [ChannelStore, GuildStore, ReadStateStore])[Symbol.iterator]();
const iterator2 = iterator.next;
let item2 = Reflect.apply(iterator2, iterator, []);
let item = item2.value;
item2 = item2.done ? undefined : iterator;
const r2 = item2 === value2 ? value2 : item;
if (value) {
r0 = item2;
r1 = value;
r3 = value2;
} else {
item3 = Reflect.apply(iterator2, item2, []);
item = item3.value;
item3 = item3.done ? undefined : item2;
value = item3 === value2;
if (value) {
r0 = item3;
r1 = value;
r3 = value2;
} else {
r0 = item3;
r1 = value;
r3 = item;
}
}
if (r1) {
r7 = value2;
} else {
item4 = Reflect.apply(iterator2, r0, []);
item = item4.value;
item4 = item4.done ? undefined : r0;
value = item4 === value2;
if (value) {
r0 = item4;
r1 = value;
r7 = value2;
} else {
r0 = item4;
r1 = value;
r7 = item;
}
}
if (!r1) {
r0.return();
}
value = r2.getChannel(a0);
const value3 = null;
if (value3 == value) {
return value3;
}
const guild = r3.getGuild(value.guild_id);
if (value3 == guild) {
r1 = value3;
} else {
value = getForumPostReadStates(value, guild, [r7]);
r1 = value;
}
return r1;
}
function isForumPostPinned(a0) { // fn#54882, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7077:1226, offset: 0x01370381, size: 60 bytes, params: 2, frame: 12
return ChannelStore.getChannel(a0)?.hasFlag(ChannelFlags.PINNED) === true;
}
@@ -0,0 +1,641 @@
/* Metro module 11544; source: modules/forums/native/AddMediaToOriginalForumPostActionSheet.tsx; dependencies: [57, 5, 31, 27, 1379, 4645, 1867, 4814, 661, 33, 4501, 697, 7224, 4697, 4655, 4080, 7881, 7879, 21, 4651, 7880, 7153, 507, 11545, 7067, 4821, 4496, 1244, 566, 6771, 7155, 4660, 6275, 11546, 4573, 4579, 2] */
function _fun88474(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:6, offset: 0x01fe49cf, size: 596 bytes, params: 8, frame: 24
var object4;
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 = importDefault(5) /* metro dependency 5 */;
const env0_5 = importAll(31) /* metro dependency 31 */;
const env0_6 = (require(27) /* metro dependency 27 */).View;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const env0_8 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
let value = require(661) /* metro dependency 661: Constants */;
const env0_11 = value.AbortCodes;
const env0_12 = value.Endpoints;
value = require(33) /* metro dependency 33 */;
const env0_13 = value.jsx;
const env0_14 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object4 = {container: {'paddingHorizontal': 16, 'paddingTop': 24}};
const object5 = {borderWidth: 1};
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object5.borderColor = BORDER_SUBTLE;
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
object5.marginBottom = 32;
const BLACK = (importDefault(697) /* metro dependency 697: native */).colors.BLACK;
object5.shadowColor = BLACK;
object5.shadowOffset = {'width': 0, 'height': 1};
object5.shadowOpacity = 0.25;
object5.shadowRadius = 4;
object5.elevation = 4;
object4.post = object5;
object4.postContent = {'marginBottom': 0, 'padding': 8};
object4.title = {'textAlign': 'center', 'marginBottom': 8};
object4.description = {'textAlign': 'center', 'marginBottom': 32};
const object6 = {};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object4.button = object6;
object4.buttonMargin = {marginBottom: 10};
const env0_15 = Reflect.apply(createStyles, value, [object4]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/AddMediaToOriginalForumPostActionSheet.tsx');
exports.default = AddMediaToOriginalForumPostActionSheet;
}
function _upload2() { // fn#88475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:755, offset: 0x01fe4c23, size: 50 bytes, params: 1, frame: 14
return env0_4(_fun88477).apply(this, arguments);
}
function AddMediaToOriginalForumPostActionSheet({threadId, attachments, sendMessage}) { // fn#88483, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:2476, offset: 0x01fe521a, size: 1262 bytes, params: 2, frame: 33
const styles = useStyles();
const binding = env0_5;
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [false]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const property = value4[0];
var env0_3 = value4[1];
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(threadId);
}, [threadId]);
const value8 = binding.useCallback(_fun88487, [value5,
(require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], _fun88485, [value5]),
(require(566) /* metro dependency 566: flux */).useStateFromStores([MessageStore], _fun88486, [threadId]),
threadId, attachments,
(importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)().analyticsLocations]);
const value9 = binding.useCallback(_fun88489, [sendMessage]);
useState = binding.useState;
const value10 = binding2(Reflect.apply(useState, binding, [null]), 2);
const property2 = value10[0];
const env0_8 = value10[1];
binding.useEffect(_fun88490, [attachments]);
const item = attachments[0]?.item;
const r13 = item != null && property2 != null ? {src: property2, width: item.width, height: item.height,
spoiler: attachments[0].spoiler, alt: attachments[0].description} : undefined;
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
const ForumPostListDisabled = (require(11546) /* metro dependency 11546: ForumPost */).ForumPostListDisabled;
const items4 = [<View pointerEvents="none" style={styles.post}><ForumPostListDisabled threadId={threadId} localDeviceMedia={r13} style={styles.postContent} /></View>];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
items4[1] = <Text style={styles.title} accessibilityRole="header" variant="heading-xl/extrabold" color="mobile-text-heading-primary">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+SZF6S'])}</Text>;
items4[2] = <Text style={styles.description} variant="text-md/medium" color="text-default">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['0Ycgw5'])}</Text>;
const BaseTextButton = (require(4579) /* metro dependency 4579: BaseTextButtonNative */).BaseTextButton;
items4[3] = <View style={styles.buttonMargin}><BaseTextButton grow variant="primary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.d611xH)} pillStyle={styles.button} onPress={value8} loading={property} disabled={property} /></View>;
items4[4] = <View style={styles.buttonMargin}><BaseTextButton grow variant="secondary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8rKVHL'])} pillStyle={styles.button} onPress={value9} disabled={property} /></View>;
items4[5] = <BaseTextButton grow variant="secondary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC'])} pillStyle={styles.button} onPress={onPress_88492} disabled={property} />;
return (
<BottomSheet startExpanded>
<View style={styles.container}>
{items4}
</View>
</BottomSheet>
);
}
async function _fun88477(a0) { // fn#88477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:794, offset: 0x01fe4c69, size: 1060 bytes, params: 2, frame: 33
var environment;
var r14;
var r13;
var value;
var value2;
var threadId;
var attachments;
var setIsUploading;
var guild;
var analyticsLocations;
var value3;
var binding;
var binding2;
var value4;
var prototype;
var value5;
var value6;
var value7;
var on;
var binding3;
var getMessages;
var value8;
var get;
var value9;
var castChannelIdAsMessageId;
var value10;
var object;
var attachments2;
var uploadFiles;
var value11;
var value12;
var value13;
var value14;
var map;
var closure;
var value15;
var value16;
var items2;
var binding4;
var property;
var value17;
var unarchiveThreadIfNecessary;
var value18;
var value19;
var value20;
var binding5;
var value21;
var HTTP;
var patch;
var object4;
var MESSAGE;
var binding6;
var value22;
var value23;
var value24;
var object5;
var value25;
var value26;
var value27;
var error;
var binding7;
var value28;
var hideActionSheet;
var value29;
var value30;
var value31;
var value32;
var code;
var EXPLICIT_CONTENT;
var binding8;
var value33;
var show;
var intl;
var string;
var t;
var B3vFdU;
var getAnyErrorMessage;
var message;
var binding9;
var value34;
var sendExplicitMediaClydeError;
var TrackMediaRedactionContext;
var EXPLICIT_MEDIA_ADD_MEDIA_TO_FORUM_POST_BLOCKED;
exceptionLanding76: while (true) {
exceptionLanding74: while (true) {
value = undefined;
value2 = false;
if (value2) {
return value;
}
threadId = a0.threadId;
var env0_0 = threadId;
attachments = a0.attachments;
setIsUploading = a0.setIsUploading;
var env0_1 = setIsUploading;
guild = a0.guild;
var env0_2 = guild;
analyticsLocations = a0.analyticsLocations;
var env0_3 = analyticsLocations;
var env0_4 = undefined;
await undefined;
value = undefined;
value3 = false;
if (value3) {
return value;
}
value = environment.__proto__.__proto__;
binding = env2_1;
binding2 = env2_2;
value4 = binding(binding2[12]);
prototype = value4.prototype;
value5 = Object.create(prototype, {constructor: {value: value4}});
value6 = new value4();
value7 = value6 instanceof Object ? value6 : value5;
env0_4 = value7;
on = value7.on;
Reflect.apply(on, value7, ['start', function() {
setIsUploading(true);
}]);
on = value7.on;
Reflect.apply(on, value7, ['progress', _fun88479]);
on = value7.on;
Reflect.apply(on, value7, ['error', _fun88480]);
on = value7.on;
Reflect.apply(on, value7, ['complete', _fun88481]);
binding3 = env2_10;
getMessages = binding3.getMessages;
value8 = Reflect.apply(getMessages, binding3, [threadId]);
get = value8.get;
value9 = binding(binding2[18]);
castChannelIdAsMessageId = value9.castChannelIdAsMessageId;
value10 = Reflect.apply(get, value8, [Reflect.apply(castChannelIdAsMessageId, value9, [threadId])]);
if (value10 != null) {
attachments2 = value10.attachments;
r14 = attachments2;
} else {
r14 = [];
}
try {
uploadFiles = value7.uploadFiles;
} catch (error) {
break exceptionLanding76;
}
try {
value11 = Reflect.apply(uploadFiles, value7, [attachments]);
} catch (error) {
break exceptionLanding76;
}
await value11;
try {
value12 = undefined;
value13 = false;
} catch (error) {
break exceptionLanding76;
}
if (value13) {
return value12;
}
try {
object = [];
} catch (error) {
break exceptionLanding76;
}
try {
value14 = arraySpread(object, r14, 0, 18);
} catch (error) {
break exceptionLanding76;
}
try {
map = value12.map;
} catch (error) {
break exceptionLanding76;
}
try {
closure = _fun88482;
} catch (error) {
break exceptionLanding76;
}
try {
value15 = Reflect.apply(map, value12, [closure]);
} catch (error) {
break exceptionLanding76;
}
try {
value16 = value15 != null;
} catch (error) {
break exceptionLanding76;
}
if (value16) {
r13 = value15;
} else {
try {
items2 = [];
} catch (error) {
break exceptionLanding76;
}
r13 = items2;
}
try {
arraySpread(object, r13, value14, 18);
} catch (error) {
break exceptionLanding76;
}
try {
binding = env2_1;
} catch (error) {
break exceptionLanding74;
}
try {
binding4 = env2_2;
} catch (error) {
break exceptionLanding74;
}
try {
property = binding4[21];
} catch (error) {
break exceptionLanding74;
}
try {
value17 = binding(property);
} catch (error) {
break exceptionLanding74;
}
try {
unarchiveThreadIfNecessary = value17.unarchiveThreadIfNecessary;
} catch (error) {
break exceptionLanding74;
}
try {
value18 = Reflect.apply(unarchiveThreadIfNecessary, value17, [threadId]);
} catch (error) {
break exceptionLanding74;
}
await value18;
try {
value19 = undefined;
value20 = false;
} catch (error) {
break exceptionLanding74;
}
if (value20) {
return value19;
}
reducibleJoin40: while (true) {
reduciblePort72: while (true) {
exceptionLanding67: while (true) {
try {
binding = env2_0;
} catch (error) {
break exceptionLanding67;
}
break reducibleJoin40;
}
setIsUploading(false);
binding = env2_1;
binding7 = env2_2;
value28 = binding(binding7[15]);
hideActionSheet = value28.hideActionSheet;
Reflect.apply(hideActionSheet, value28, []);
value29 = binding(binding7[23]);
prototype = value29.prototype;
value30 = Object.create(prototype, {constructor: {value: value29}});
value31 = new value29();
value32 = value31 instanceof Object ? value31 : value30;
code = value32.code;
EXPLICIT_CONTENT = env2_11.EXPLICIT_CONTENT;
if (code === EXPLICIT_CONTENT) {
binding = env2_1;
binding9 = env2_2;
value34 = binding(binding9[24]);
sendExplicitMediaClydeError = value34.sendExplicitMediaClydeError;
attachments = value32.attachments;
binding = env2_0;
TrackMediaRedactionContext = binding(binding9[25]).TrackMediaRedactionContext;
EXPLICIT_MEDIA_ADD_MEDIA_TO_FORUM_POST_BLOCKED = TrackMediaRedactionContext.EXPLICIT_MEDIA_ADD_MEDIA_TO_FORUM_POST_BLOCKED;
Reflect.apply(sendExplicitMediaClydeError, value34, [threadId, attachments,
EXPLICIT_MEDIA_ADD_MEDIA_TO_FORUM_POST_BLOCKED]);
} else {
binding = env2_1;
binding8 = env2_2;
value33 = binding(binding8[26]);
show = value33.show;
object = {};
binding = env2_0;
intl = binding(binding8[27]).intl;
string = intl.string;
t = binding(binding8[27]).t;
B3vFdU = t.B3vFdU;
object.title = Reflect.apply(string, intl, [B3vFdU]);
getAnyErrorMessage = value32.getAnyErrorMessage;
value = Reflect.apply(getAnyErrorMessage, value32, []);
reducibleJoin70: while (true) {
if (value != null) {
r14 = value;
break reducibleJoin70;
}
message = value32.message;
r14 = message;
break reducibleJoin70;
}
object.body = r14;
Reflect.apply(show, value33, [object]);
}
break reduciblePort72;
}
return undefined;
}
try {
binding5 = env2_2;
} catch (error) {
break exceptionLanding67;
}
try {
property = binding5[22];
} catch (error) {
break exceptionLanding67;
}
try {
value21 = binding(property);
} catch (error) {
break exceptionLanding67;
}
try {
HTTP = value21.HTTP;
} catch (error) {
break exceptionLanding67;
}
try {
patch = HTTP.patch;
} catch (error) {
break exceptionLanding67;
}
try {
object4 = {};
} catch (error) {
break exceptionLanding67;
}
try {
binding = env2_12;
} catch (error) {
break exceptionLanding67;
}
try {
MESSAGE = binding.MESSAGE;
} catch (error) {
break exceptionLanding67;
}
try {
binding6 = env2_1;
} catch (error) {
break exceptionLanding67;
}
try {
property = binding5[18];
} catch (error) {
break exceptionLanding67;
}
try {
value22 = binding6(property);
} catch (error) {
break exceptionLanding67;
}
try {
castChannelIdAsMessageId = value22.castChannelIdAsMessageId;
} catch (error) {
break exceptionLanding67;
}
try {
value23 = Reflect.apply(castChannelIdAsMessageId, value22, [threadId]);
} catch (error) {
break exceptionLanding67;
}
try {
value24 = Reflect.apply(MESSAGE, binding, [threadId, value23]);
} catch (error) {
break exceptionLanding67;
}
try {
object4.url = value24;
} catch (error) {
break exceptionLanding67;
}
try {
object5 = {};
} catch (error) {
break exceptionLanding67;
}
try {
object5.attachments = object;
} catch (error) {
break exceptionLanding67;
}
try {
object4.body = object5;
} catch (error) {
break exceptionLanding67;
}
try {
object4.rejectWithError = true;
} catch (error) {
break exceptionLanding67;
}
try {
value25 = Reflect.apply(patch, HTTP, [object4]);
} catch (error) {
break exceptionLanding67;
}
await value25;
try {
value26 = undefined;
value27 = false;
} catch (error) {
break exceptionLanding67;
}
return value27 ? value26 : undefined;
}
setIsUploading(false);
binding = env2_1;
value = binding(env2_2[15]);
hideActionSheet = value.hideActionSheet;
Reflect.apply(hideActionSheet, value, []);
return undefined;
}
setIsUploading(false);
binding = env2_1;
const binding10 = env2_2;
binding(binding10[15]).hideActionSheet();
env2_0(binding10[20]).handleUploadMessageAttachmentsErrors({file: error.file, guildId: guild.id,
analyticsLocations: analyticsLocations, code: error.code, reason: error.reason});
}
function _fun88485() { // fn#88485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:2714, offset: 0x01fe5708, size: 52 bytes, params: 1, frame: 13
const value = environment.__proto__;
return GuildStore.getGuild(env0_4?.getGuildId());
}
function _fun88486() { // fn#88486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:2801, offset: 0x01fe573c, size: 61 bytes, params: 1, frame: 15
let value = environment.__proto__;
const getMessage = MessageStore.getMessage;
const threadIdBinding = threadId;
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
return Reflect.apply(getMessage, MessageStore, [threadIdBinding, value.castChannelIdAsMessageId(threadIdBinding)]);
}
function _fun88487() { // fn#88487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:2913, offset: 0x01fe5779, size: 175 bytes, params: 1, frame: 14
var environment;
var value2;
var value;
if (env0_4 == null) {
value = environment.__proto__;
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
value.hideActionSheet();
} else if (env0_6 == null) {
value = environment.__proto__;
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
value.hideActionSheet();
} else if (env0_5 != null) {
value2 = environment.__proto__;
(require(7155) /* metro dependency 7155: Tracking */).trackForumAddMediaToOriginalPostClicked({added: true});
(function() {
return _upload2.apply(this, arguments);
})({threadId: threadId, attachments: attachments, setIsUploading: env0_3, guild: env0_5,
analyticsLocations: analyticsLocations});
} else {
value = environment.__proto__;
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
value.hideActionSheet();
}
}
function _fun88489() { // fn#88489, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:3200, offset: 0x01fe5846, size: 84 bytes, params: 1, frame: 15
const value = environment.__proto__;
(require(7155) /* metro dependency 7155: Tracking */).trackForumAddMediaToOriginalPostClicked({added: false});
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
sendMessage();
}
function _fun88490() { // fn#88490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:3359, offset: 0x01fe589a, size: 86 bytes, params: 1, frame: 13
var environment;
var value2;
var moduleValue;
if (attachments[0] != null) {
value2 = environment.__proto__;
moduleValue = require(4660) /* metro dependency 4660: UploadUtils */;
moduleValue.getFileInfo(attachments[0]).then(_fun88491);
}
}
function AddMediaToOriginalForumPostActionSheetOnPress() { // fn#88492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:4612, owner: AddMediaToOriginalForumPostActionSheet.onPress, offset: 0x01fe5908, size: 37 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
}
function _fun88479(a0) { // fn#88479, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:943, offset: 0x01fe508d, size: 212 bytes, params: 2, frame: 19
var binding3;
let value = environment.__proto__.__proto__.__proto__;
let binding = env3_0;
const binding2 = env3_2;
const kestrelConfig = binding(binding2[13]).getKestrelConfig({location: 'native.AddMediaToOriginalForumPostActionSheet'});
const value4 = binding(binding2[13]);
const getEffectiveKestrelLimit = value4.getEffectiveKestrelLimit;
const value5 = binding(binding2[14]);
const value7 = Reflect.apply(getEffectiveKestrelLimit, value4, [kestrelConfig, value5.maxFileSize(guild.id)]);
if (a0.currentSize > value7) {
binding = env0_4;
binding.cancel();
setIsUploading(false);
binding = env3_1;
binding3 = env3_2;
value = binding(binding3[15]);
value.hideActionSheet();
value = binding(binding3[16]);
value({file: a0, maxSize: value7, analyticsLocations: analyticsLocations});
}
}
function _fun88480() { // fn#88480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:1235, offset: 0x01fe5161, size: 51 bytes, params: 1, frame: 12
setIsUploading(false);
const value = environment.__proto__.__proto__.__proto__;
env3_1(env3_2[15]).hideActionSheet();
}
function _fun88481() { // fn#88481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:1293, offset: 0x01fe5194, size: 89 bytes, params: 1, frame: 16
setIsUploading(false);
const binding = env3_1;
const binding2 = env3_2;
const value3 = binding(binding2[17]);
const clearAll = value3.clearAll;
const threadIdBinding = threadId;
const ChannelMessage = env3_8.ChannelMessage;
Reflect.apply(clearAll, value3, [threadIdBinding, ChannelMessage]);
binding(binding2[15]).hideActionSheet();
}
function _fun88482(a0, a1) { // fn#88482, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:1528, offset: 0x01fe51ed, size: 45 bytes, params: 3, frame: 13
const value = environment.__proto__.__proto__.__proto__;
return env3_0(env3_2[19]).getAttachmentPayload(a0, a1);
}
function _fun88491({uri}) { // fn#88491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11730:3409, offset: 0x01fe58f0, size: 24 bytes, params: 2, frame: 11
return env1_8(uri);
}
@@ -0,0 +1,111 @@
/* Metro module 11089; source: modules/forums/native/AppliedForumTag.tsx; dependencies: [31, 27, 6540, 1881, 33, 4501, 697, 566, 11090, 1244, 6739, 1423, 4573, 2] */
function _fun84905(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84905, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11275:6, offset: 0x01f5b9bf, size: 405 bytes, params: 8, frame: 25
const env0_0 = require;
const closure = AppliedForumTag;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const emojiStore = importDefault(6540) /* metro dependency 6540: EmojiStore */;
const env0_5 = (require(1881) /* metro dependency 1881: EmojiConstants */).EMOJI_URL_BASE_SIZE;
let value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const object = {'height': 24, 'paddingHorizontal': 8, 'borderRadius': 20, 'backgroundColor': null, 'borderWidth': 1,
'borderColor': null, 'marginRight': 4, 'flexShrink': 1};
const BACKGROUND_MOD_NORMAL = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_NORMAL;
object.backgroundColor = BACKGROUND_MOD_NORMAL;
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object.borderColor = BORDER_SUBTLE;
const env0_8 = Reflect.apply(createStyles, value, [{pill: object, disableEndMargin: {marginRight: 0},
emoji: {'height': 12, 'width': 12, 'marginRight': 4, 'flexShrink': 0}, textEmoji: {'fontSize': 10,
'marginRight': 4}, tagName: {flexShrink: 1}, container: {'display': 'flex', 'flexDirection': 'row',
'alignItems': 'center'}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/AppliedForumTag.tsx');
exports.AppliedForumTagPill = AppliedForumTagPill;
exports.AppliedForumTag = closure;
}
function AppliedForumTag({tag, hasUnreads, containerStyle}) { // fn#84906, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11275:615, offset: 0x01f5bb54, size: 204 bytes, params: 2, frame: 18
const env0_1 = useStyles();
const env0_2 = tag.name;
const env0_3 = tag.emojiId;
const env0_4 = tag.emojiName;
const env0_5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmojiStore], _fun84907);
const env0_6 = hasUnreads ? 'text-default' : 'text-muted';
return ((Component) => <Component tagId={tag.id}>{children_84908}</Component>)(importDefault(11090) /* metro dependency 11090: ForumTagContextMenu */);
}
function AppliedForumTagPill({tag, hasUnreads, containerStyle, disableEndMargin}) { // fn#84909, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11275:1413, offset: 0x01f5be1c, size: 106 bytes, params: 2, frame: 18
const styles = useStyles();
return (
<AppliedForumTag
tag={tag}
hasUnreads={hasUnreads}
containerStyle={[styles.pill, containerStyle, disableEndMargin ? styles.disableEndMargin : {}]}
/>
);
}
function _fun84907() { // fn#84907, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11275:758, offset: 0x01f5bc20, size: 40 bytes, params: 1, frame: 12
const emojiIdBinding = emojiId;
const value2 = null;
return value2 != emojiIdBinding ? EmojiStore.getUsableCustomEmojiById(emojiId) : value2;
}
function AppliedForumTagChildren(a0) { // fn#84908, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11275:877, owner: AppliedForumTag.children, offset: 0x01f5bc48, size: 468 bytes, params: 2, frame: 27
var r10;
var object;
var defaultImport;
var getEmojiURL;
var binding;
const ref = a0.ref;
let value = Object.create(null);
value.ref = 0;
const value2 = copyDataProperties({}, a0, value, undefined);
const viewProps = {style: [styles.container, containerStyle], accessible: true};
const value5 = undefined;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
viewProps.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.tXXD6v,
{tagName: name});
viewProps.ref = ref;
copyDataProperties(viewProps, value2, value);
let r6 = emojiName != null || emojiId != null;
if (r6) {
value = importDefault(6739) /* metro dependency 6739: Emoji */;
object = {};
stylesBinding = styles;
object.textEmojiStyle = stylesBinding.textEmoji;
object.fastImageStyle = stylesBinding.emoji;
if (env0_5 != null) {
defaultImport = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
getEmojiURL = defaultImport.getEmojiURL;
binding = env0_5;
r10 = Reflect.apply(getEmojiURL, defaultImport, [{id: binding.id, animated: binding.animated,
size: EMOJI_URL_BASE_SIZE}]);
} else {
r10 = value5;
}
object.src = r10;
object.name = emojiName ?? '';
value = ((Component) => <Component {...object} />)(value);
r6 = value;
}
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View {...viewProps}>
{r6}
<Text
lineClamp={1}
style={styles.tagName}
variant="text-xs/semibold"
color={env0_6}
>
{name}
</Text>
</View>
);
}
@@ -0,0 +1,121 @@
/* Metro module 11162; source: modules/forums/native/AvailableForumTag.tsx; dependencies: [31, 6540, 661, 1881, 33, 4501, 697, 6597, 566, 11090, 8554, 6739, 1423, 1305, 2] */
function _fun85233(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85233, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11348:6, offset: 0x01f6835d, size: 474 bytes, params: 8, frame: 24
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const emojiStore = importDefault(6540) /* metro dependency 6540: EmojiStore */;
const Fonts = (require(661) /* metro dependency 661: Constants */).Fonts;
const env0_5 = (require(1881) /* metro dependency 1881: EmojiConstants */).EMOJI_URL_BASE_SIZE;
let value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object3 = {};
const object4 = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'paddingHorizontal': 12,
'borderRadius': 20, 'backgroundColor': null, 'margin': 6, 'borderWidth': 2, 'borderColor': null,
'overflow': 'hidden', 'height': 32};
let BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
object4.backgroundColor = BACKGROUND_BASE_LOWEST;
BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
object4.borderColor = BACKGROUND_BASE_LOWEST;
object3.pill = object4;
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object3.pillSelected = {borderColor: BACKGROUND_BRAND, borderWidth: 1};
object3.pillDisabled = {opacity: 0.6};
object3.emoji = {'height': 18, 'width': 18, 'marginRight': 4, 'display': 'flex', 'alignItems': 'center',
'justifyContent': 'center'};
object3.imageEmoji = {'height': 16, 'width': 16};
object3.textEmoji = {'fontSize': 14, 'lineHeight': 20};
const textStyles = importDefault(6597) /* metro dependency 6597: TextStyles */;
const PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD;
const MOBILE_TEXT_HEADING_PRIMARY = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_TEXT_HEADING_PRIMARY;
object3.tagName = textStyles(PRIMARY_SEMIBOLD, MOBILE_TEXT_HEADING_PRIMARY, 14);
const env0_8 = Reflect.apply(createStyles, value, [object3]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/AvailableForumTag.tsx');
exports.default = AvailableForumTag;
}
function AvailableForumTag({tag, onPress, disabled, selected}) { // fn#85234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11348:908, offset: 0x01f68537, size: 246 bytes, params: 2, frame: 21
const env0_3 = selected;
const styles = useStyles();
const env0_5 = tag.name;
const env0_6 = tag.emojiId;
const env0_7 = tag.emojiName;
const env0_8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmojiStore], _fun85235);
const AvailableForumTagHandlePress = function() {
if (!disabled) {
onPress(tag);
}
};
const env0_10 = env0_3.useMemo(function() {
var items = [];
items.push(styles.pill);
if (selected) {
items.push(styles.pillSelected);
}
if (disabled) {
items.push(styles.pillDisabled);
}
return items;
}, [disabled, selected, styles]);
return ((Component) => <Component tagId={tag.id}>{children_85238}</Component>)(importDefault(11090) /* metro dependency 11090: ForumTagContextMenu */);
}
function _fun85235() { // fn#85235, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11348:1055, offset: 0x01f6862d, size: 40 bytes, params: 1, frame: 12
const emojiIdBinding = emojiId;
const value2 = null;
return value2 != emojiIdBinding ? EmojiStore.getUsableCustomEmojiById(emojiId) : value2;
}
function AvailableForumTagChildren(a0) { // fn#85238, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11348:1282, owner: AvailableForumTag.children, offset: 0x01f686c5, size: 423 bytes, params: 2, frame: 27
var r10;
var object;
var stylesBinding;
var defaultImport;
var getEmojiURL;
var binding;
const ref = a0.ref;
let value = Object.create(null);
value.ref = 0;
const value2 = copyDataProperties({}, a0, value, undefined);
const value4 = undefined;
const PressableScale = (require(8554) /* metro dependency 8554: native */).PressableScale;
const pressableScaleProps2 = {style: env0_10, accessibilityRole: 'button', accessibilityState: {selected: selected},
disabled: disabled, ref: ref, ...value2};
pressableScaleProps2['onPress'] = AvailableForumTagHandlePress;
let r6 = env0_8 != null || emojiName != null;
if (r6) {
value = importDefault(6739) /* metro dependency 6739: Emoji */;
object = {};
stylesBinding = styles;
object.style = stylesBinding.emoji;
object.textEmojiStyle = stylesBinding.textEmoji;
object.fastImageStyle = stylesBinding.imageEmoji;
if (env0_8 != null) {
defaultImport = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
getEmojiURL = defaultImport.getEmojiURL;
binding = env0_8;
r10 = Reflect.apply(getEmojiURL, defaultImport, [{id: binding.id, animated: binding.animated,
size: EMOJI_URL_BASE_SIZE}]);
} else {
r10 = value4;
}
object.src = r10;
object.name = emojiName ?? '';
value = ((Component) => <Component {...object} />)(value);
r6 = value;
}
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
return (
<PressableScale {...pressableScaleProps2}>
{r6}
<LegacyText style={styles.tagName}>
{name}
</LegacyText>
</PressableScale>
);
}
@@ -0,0 +1,284 @@
/* Metro module 15215; source: modules/forums/native/ChannelSettingsEditForumTag.tsx; dependencies: [57, 31, 27, 6540, 1379, 1881, 33, 4501, 697, 1484, 566, 4573, 1244, 9621, 5277, 4572, 6231, 6238, 5278, 8529, 6739, 1423, 7950, 1305, 6988, 6808, 4496, 2] */
function _fun116407(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#116407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:6, offset: 0x02487c22, size: 457 bytes, params: 8, frame: 23
var object2;
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 env0_5 = (require(27) /* metro dependency 27 */).View;
const emojiStore = importDefault(6540) /* metro dependency 6540: EmojiStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
let value = require(1881) /* metro dependency 1881: EmojiConstants */;
const env0_8 = value.EMOJI_URL_BASE_SIZE;
const env0_9 = value.EmojiIntention;
value = require(33) /* metro dependency 33 */;
const env0_10 = value.jsx;
const env0_11 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
object2.container = {'display': 'flex', 'flex': 1, backgroundColor: BACKGROUND_BASE_LOWER};
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.sections = {paddingHorizontal: 12, paddingTop: PX_16};
object2.hint = {marginTop: 8};
object2.emojiIconWrapper = {'display': 'flex', 'alignItems': 'center', 'justifyContent': 'center', 'height': 24,
'width': 24};
object2.imageEmoji = {'height': 20, 'width': 20};
object2.textEmoji = {'fontSize': 20, 'lineHeight': 26};
object2.nameInput = {'width': '100%', 'flexGrow': 1};
object2.saveButton = {flex: 0};
const env0_12 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ChannelSettingsEditForumTag.tsx');
exports.default = ChannelSettingsEditForumTag;
}
function ChannelSettingsEditForumTag({channelId, tag}) { // fn#116408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:747, offset: 0x02487deb, size: 1886 bytes, params: 2, frame: 46
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
var r1;
var r2;
var r31;
var r26;
var defaultImport;
const styles = useStyles();
const value4 = tag == null;
const value5 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
const env0_4 = value5;
let binding = env0_4;
let useState = binding.useState;
const value7 = env0_3(Reflect.apply(useState, binding, [tag != null ? {id: tag.emojiId,
name: tag.emojiName} : null]), 2);
const property = value7[0];
const env0_6 = value7[1];
binding = env0_4;
useState = binding.useState;
const name = tag?.name;
const value8 = '';
const value10 = env0_3(Reflect.apply(useState, binding, [name ?? value8]), 2);
const property2 = value10[0];
const env0_8 = value10[1];
binding = env0_4;
useState = binding.useState;
const value12 = env0_3(Reflect.apply(useState, binding, [tag?.moderated]), 2);
const property3 = value12[0];
const env0_10 = value12[1];
const env0_11 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(channelId);
});
const value13 = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmojiStore], _fun116410);
binding = env0_4;
const env0_12 = binding.useRef({emoji: property, tagName: property2, moderated: property3});
binding.useEffect(_fun116411, [property, property2, property3]);
const value14 = value8 === property2;
const value15 = tag != null;
if (value15) {
r1 = tag.name !== property2 || tag.emojiId !== property?.id;
r1 = !r1 ? tag.emojiName !== property?.name : r1;
r1 = !r1 ? tag.moderated !== property3 : r1;
r2 = r1;
} else {
r2 = value15;
}
const r6 = value4 || value14 ? !value14 : r2;
binding = env0_4;
binding.useLayoutEffect(_fun116412, [value5, value4]);
env0_4.useEffect(_fun116415, [r6, value5, binding.useCallback(_fun116414, [value4, value5, channelId, tag?.id]),
styles.saveButton]);
const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
const TableRow = (require(6238) /* metro dependency 6238: TableRowNative */).TableRow;
const object = {};
if (property == null) {
const ReactionIcon = (require(7950) /* metro dependency 7950: ReactionIcon */).ReactionIcon;
r26 = <ReactionIcon />;
} else if (property.name != null) {
defaultImport = importDefault(6739) /* metro dependency 6739: Emoji */;
var defaultImportProps = {textEmojiStyle: styles.textEmoji, fastImageStyle: styles.imageEmoji};
r31 = value13 != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getEmojiURL({id: value13.id,
animated: value13.animated, size: EMOJI_URL_BASE_SIZE}) : undefined;
defaultImportProps.src = r31;
r31 = property?.name ?? value8;
defaultImportProps.name = r31;
r26 = ((Component) => <Component {...defaultImportProps} />)(defaultImport);
} else if (property.id == null) {
const ReactionIcon2 = (require(7950) /* metro dependency 7950: ReactionIcon */).ReactionIcon;
r26 = <ReactionIcon2 />;
} else {
defaultImport = importDefault(6739) /* metro dependency 6739: Emoji */;
var defaultImportProps = {textEmojiStyle: styles.textEmoji, fastImageStyle: styles.imageEmoji};
r31 = value13 != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getEmojiURL({id: value13.id,
animated: value13.animated, size: EMOJI_URL_BASE_SIZE}) : undefined;
defaultImportProps.src = r31;
r31 = property?.name ?? value8;
defaultImportProps.name = r31;
r26 = ((Component) => <Component {...defaultImportProps} />)(defaultImport);
}
object.icon = <PressableOpacity style={styles.emojiIconWrapper} accessibilityRole="button" onPress={function() {
require(dependencyMap[19]).openEmojiPickerActionSheet({onPressEmoji: handlePressEmoji,
pickerIntention: EmojiIntention.COMMUNITY_CONTENT, channel: channel});
}}>{r26}</PressableOpacity>;
const TextInput = (require(1305) /* metro dependency 1305: native */).TextInput;
const textInputProps = {'maxLength': 20, 'style': null, 'value': null, 'autoCorrect': false,
'autoCapitalize': 'none', 'returnKeyType': 'done', style: styles.nameInput, value: property2,
onChangeText: onChangeText};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
textInputProps.placeholder = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.aMSq0a);
object.label = <TextInput {...textInputProps} />;
object.trailing = property != null ? <PressableOpacity accessibilityRole="button" onPress={onPress_116420}>{((CircleXIcon) => <CircleXIcon size="xs" />)((require(6988) /* metro dependency 6988: CircleXIcon */).CircleXIcon)}</PressableOpacity> : value8 === property2 ? null : <PressableOpacity accessibilityRole="button" onPress={onPress_116420}>{((CircleXIcon) => <CircleXIcon size="xs" />)((require(6988) /* metro dependency 6988: CircleXIcon */).CircleXIcon)}</PressableOpacity>;
const tableRowGroup = <TableRowGroup hasIcons><TableRow {...object} /></TableRowGroup>;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const items2 = [<View>{tableRowGroup}<View style={styles.hint}><Text variant="text-sm/medium" color="text-muted">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['3v8kZH'])}</Text></View></View>];
const TableSwitchRow = (require(6808) /* metro dependency 6808: TableSwitchRowNative */).TableSwitchRow;
items2[1] = <TableRowGroup hasIcons={false}><TableSwitchRow label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['rMH+rt'])} value={property3 != null && property3} onValueChange={onValueChange_116421} /></TableRowGroup>;
items2[2] = value4 ? null : <TableRowGroup hasIcons={false}><TableRow variant="danger" label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.huYSMr)} onPress={onPress_116422} /></TableRowGroup>;
return (
<View style={styles.container}>
<Stack spacing={24} style={styles.sections}>
{items2}
</Stack>
</View>
);
}
function _fun116410() { // fn#116410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:1167, offset: 0x02488549, size: 65 bytes, params: 1, frame: 12
const value2 = null;
return value2 != (value2 == env0_5 ? undefined : env0_5.id) ? EmojiStore.getUsableCustomEmojiById(env0_5.id) : value2;
}
function _fun116411() { // fn#116411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:1296, offset: 0x0248858a, size: 46 bytes, params: 1, frame: 4
env0_12.current = {emoji: env0_5, tagName: env0_7, moderated: env0_9};
}
function _fun116412() { // fn#116412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:1514, offset: 0x024885b8, size: 38 bytes, params: 1, frame: 12
const binding = env0_4;
binding.setOptions({headerTitle: headerTitle_116413});
}
function _fun116414() { // fn#116414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:1792, offset: 0x0248866a, size: 253 bytes, params: 1, frame: 20
var id;
var resultBinding;
var value2;
var value3;
var defaultImport;
var updateForumTag;
var object2;
const {tagName, emoji, moderated} = env0_12.current;
if (tagName !== '') {
resultBinding = result;
value2 = environment.__proto__;
value3 = undefined;
defaultImport = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
if (resultBinding) {
defaultImport.createForumTag({name: tagName, emojiId: emoji == null ? value3 : emoji.id,
emojiName: emoji == null ? value3 : emoji.name, moderated: moderated}, channelId);
} else {
updateForumTag = defaultImport.updateForumTag;
object2 = {};
id = tag == null ? value3 : tag.id;
object2.id = id;
object2.name = tagName;
id = emoji == null ? value3 : emoji.id;
object2.emojiId = id;
object2.emojiName = emoji == null ? value3 : emoji.name;
object2.moderated = moderated;
Reflect.apply(updateForumTag, defaultImport, [object2, channelId]);
}
env0_4.pop();
}
}
function _fun116415() { // fn#116415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:2152, offset: 0x02488767, size: 59 bytes, params: 1, frame: 12
const binding = env0_13;
const binding2 = env0_4;
const setOptions = binding2.setOptions;
const object2 = {};
if (binding) {
object2.headerRight = headerRight_116416;
Reflect.apply(setOptions, binding2, [object2]);
} else {
object2.headerRight = undefined;
Reflect.apply(setOptions, binding2, [object2]);
}
}
function handlePressEmoji(a0) { // fn#116417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:2381, owner: ChannelSettingsEditForumTag.handlePressEmoji, offset: 0x0248881b, size: 96 bytes, params: 2, frame: 14
let id = a0.id;
const r4 = id != null || a0.surrogates == null ? a0.name : a0.surrogates !== '' ? a0.surrogates : a0.name;
const binding = env0_6;
id = a0.id;
const value = undefined;
binding({id: a0.id, name: id != null ? value : r4});
return value;
}
function ChannelSettingsEditForumTagOnPress_116420() { // fn#116420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:3446, owner: ChannelSettingsEditForumTag.onPress, offset: 0x024888c6, size: 31 bytes, params: 1, frame: 12
env0_6(null);
env0_8('');
}
function ChannelSettingsEditForumTagOnValueChange() { // fn#116421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:3823, owner: ChannelSettingsEditForumTag.onValueChange, offset: 0x024888e5, size: 82 bytes, params: 1, frame: 13
var tagBinding;
var value2;
if (env0_9) {
tagBinding = tag;
value2 = undefined;
if ((tagBinding == null ? value2 : tag.moderated) == null) {
env0_10(value2);
} else {
env0_10(false);
}
} else {
env0_10(true);
}
}
function ChannelSettingsEditForumTagOnPress_116422() { // fn#116422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:4038, owner: ChannelSettingsEditForumTag.onPress, offset: 0x02488937, size: 257 bytes, params: 1, frame: 18
const defaultImport = importDefault(4496) /* metro dependency 4496: AlertActionCreators */;
const show = defaultImport.show;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
Reflect.apply(show, defaultImport, [{title: Reflect.apply(string, intl, [t.huYSMr]), body: intl.string(t.bkAFCf),
cancelText: intl.string(t.gm1Vej), confirmText: intl.string(t.p89ACt), onConfirm: onConfirm_116423}]);
}
function headerTitle_116413() { // fn#116413, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:1545, offset: 0x024885de, size: 140 bytes, params: 1, frame: 19
const value = environment.__proto__.__proto__;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const resultBinding = result;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
return (
<Text
variant="redesign/heading-18/bold"
color="mobile-text-heading-primary"
accessibilityRole="header"
>
{resultBinding ? Reflect.apply(string, intl, [t['/jubeD']]) : Reflect.apply(string, intl, [t.zeVg5d])}
</Text>
);
}
function headerRight_116416() { // fn#116416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:2185, offset: 0x024887a2, size: 121 bytes, params: 1, frame: 18
const HeaderActionButton = (require(5277) /* metro dependency 5277: HeaderActionButtonNative */).HeaderActionButton;
const headerActionButtonProps = {style: styles.saveButton, onPress: env1_14};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
headerActionButtonProps.text = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['R3BPH+']);
return <HeaderActionButton {...headerActionButtonProps} />;
}
function onPressOnConfirm_116423() { // fn#116423, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15412:4262, owner: ChannelSettingsEditForumTag.onPress.onConfirm, offset: 0x02488a38, size: 78 bytes, params: 1, frame: 14
var value2;
var defaultImport;
if (!result) {
value2 = environment.__proto__.__proto__;
defaultImport = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
defaultImport.deleteForumTag(channelId, tag.id);
env1_4.pop();
}
}
@@ -0,0 +1,736 @@
/* Metro module 12056; source: modules/forums/native/ForumChannel.tsx; dependencies: [31, 27, 3785, 4790, 1379, 4645, 4798, 11547, 661, 1309, 482, 33, 4501, 697, 6597, 477, 7701, 4573, 1244, 9619, 566, 12057, 14, 4080, 12059, 1962, 1357, 4578, 11689, 5278, 8708, 12060, 10078, 9623, 12061, 4805, 12062, 11546, 12063, 8416, 7155, 7704, 3857, 7548, 6860, 6771, 6789, 6664, 11319, 9621, 7165, 11007, 11024, 4081, 4082, 11022, 8919, 5463, 11317, 8561, 12066, 11809, 2] */
function _fun92602(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:6, offset: 0x020912a8, size: 1242 bytes, params: 8, frame: 30
var object2;
const env0_0 = require;
const onForumViewableItemsChanged = function({changed}) {
changed.forEach(_fun92614);
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = undefined;
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const lurkingStore = importDefault(3785) /* metro dependency 3785: LurkingStore */;
const activeThreadsStore = importDefault(4790) /* metro dependency 4790: ActiveThreadsStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const draftStore = importDefault(4645) /* metro dependency 4645: DraftStore */;
const guildVerificationStore = importDefault(4798) /* metro dependency 4798: GuildVerificationStore */;
const env0_10 = (require(11547) /* metro dependency 11547: ForumChannelStore */).useForumChannelStore;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_11 = constantsModule.AnalyticsObjects;
const env0_12 = constantsModule.AnalyticsPages;
const env0_13 = constantsModule.AnalyticsSections;
const env0_14 = (require(1309) /* metro dependency 1309: FormConstants */).ANDROID_FOREGROUND_RIPPLE;
const Fonts = (require(482) /* metro dependency 482: Constants */).Fonts;
const value3 = require(33) /* metro dependency 33 */;
const env0_15 = value3.jsx;
const env0_16 = value3.jsxs;
const env0_17 = value3.Fragment;
const Set = global.Set;
const set = new Set(['archived_section', 'search_section', 'missing_permission_search',
'missing_permission_archived_threads', 'loading_section']);
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object2 = {};
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
object2.background = {flex: 1, backgroundColor: BACKGROUND_BASE_LOWER};
object2.headerRow = {'display': 'flex', 'flexDirection': 'row', 'justifyContent': 'space-between',
'paddingHorizontal': 12, 'paddingVertical': 8};
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object2.headerDivider = {'backgroundColor': null, 'width': '100%', 'height': 1, backgroundColor: BORDER_SUBTLE};
object2.container = {'flex': 1, 'alignSelf': 'stretch', 'alignItems': 'center', 'position': 'relative'};
object2.noHeight = {height: 0};
object2.list = {'flex': 1, 'paddingTop': 8, 'paddingHorizontal': 12, 'alignSelf': 'stretch', 'marginBottom': 0};
object2.section = {'alignItems': 'flex-start', 'justifyContent': 'flex-end'};
const object3 = {'marginTop': 12, 'paddingStart': 4};
const value7 = 14;
let defaultImport = importDefault(dependencyMap[value7]);
const PRIMARY_BOLD = Fonts.PRIMARY_BOLD;
let TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
copyDataProperties(object3, defaultImport(PRIMARY_BOLD, TEXT_MUTED, 12, {'marginBottom': 12, 'uppercase': true}),
12);
object2.divider = object3;
const object4 = {'backgroundColor': null, 'alignItems': 'center', 'justifyContent': 'center', 'height': 48};
let BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
object4.backgroundColor = BACKGROUND_BASE_LOWEST;
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
object2.missingPermissionContainer = object4;
const object9 = {};
const defaultImport2 = importDefault(dependencyMap[value7]);
const PRIMARY_NORMAL = Fonts.PRIMARY_NORMAL;
TEXT_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED;
copyDataProperties(object9, defaultImport2(PRIMARY_NORMAL, TEXT_MUTED, 12), 12);
object2.missingPermissionText = object9;
const object10 = {overflow: 'hidden'};
object10.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xl;
object2.optionsContainer = object10;
BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
object2.optionsPill = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'paddingHorizontal': 8,
'height': 32, backgroundColor: BACKGROUND_BASE_LOWEST};
const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
object2.sortOptionsIcon = {color: INTERACTIVE_TEXT_DEFAULT, marginLeft: 4};
object2.sortOptionsText = {marginHorizontal: 4};
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object2.countContainer = {'backgroundColor': null, 'borderRadius': 20, 'marginRight': 4, 'minWidth': 20,
'height': 20, 'display': 'flex', 'alignItems': 'center', 'justifyContent': 'center',
backgroundColor: BACKGROUND_BRAND};
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
object2.countText = {lineHeight: platformUtilsModule.isAndroid() ? value7 : value};
const env0_25 = Reflect.apply(createStyles, createStylesModule, [object2]);
const env0_26 = {'waitForInteraction': false, 'viewAreaCoveragePercentThreshold': 50, 'minimumViewTime': 100};
const onCreatePostWithoutPermission = function() {
var defaultImport = importDefault(dependencyMap[42]);
var object = {key: 'FORUM_NO_POST_PERMISSION_HELP'};
object.content = require(dependencyMap[18]).intl.string(require(dependencyMap[18]).t.iyzwnD);
object.icon = importDefault(dependencyMap[43]);
defaultImport.open(object);
};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumChannel.tsx');
exports.default = ForumChannel;
return value;
}
function ArchivedSection() { // fn#92603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:2076, offset: 0x02091782, size: 193 bytes, params: 1, frame: 21
const styles = useStyles();
const items2 = [styles.section,
(require(7701) /* metro dependency 7701: ClientThemesOverrides */).useClientThemesOverride()];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return (
<View style={items2}>
<Text
style={styles.divider}
variant="text-xs/bold"
color="text-muted"
>
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['3+LO1w'])}
</Text>
</View>
);
}
function SearchSection({numPosts, searchQuery}) { // fn#92604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:2322, offset: 0x02091843, size: 260 bytes, params: 2, frame: 24
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const styles = useStyles();
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View style={styles.section}>
<Text
style={styles.divider}
variant="text-xs/bold"
color="text-muted"
>
{numPosts === 0 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.DbgHxi) : intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['tBz/8b'],
{numPosts: numPosts, query: searchQuery})}
</Text>
</View>
);
}
function ArchivedMissingReadHistoryPermission({channelName}) { // fn#92605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:2631, offset: 0x02091947, size: 176 bytes, params: 2, frame: 22
const styles = useStyles();
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const format = intl.format;
const TycmzM = (require(1244) /* metro dependency 1244: indexNative */).t.TycmzM;
return (
<View style={styles.missingPermissionContainer}>
<Text
style={styles.missingPermissionText}
variant="text-xs/normal"
color="text-muted"
>
{Reflect.apply(format, intl, [TycmzM, {channelName: channelName}])}
</Text>
</View>
);
}
function SearchMissingReadHistoryPermission({channelName}) { // fn#92606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:2920, offset: 0x020919f7, size: 176 bytes, params: 2, frame: 22
const styles = useStyles();
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const format = intl.format;
const OWZJdS = (require(1244) /* metro dependency 1244: indexNative */).t.OWZJdS;
return (
<View style={styles.section}>
<Text
style={styles.missingPermissionText}
variant="text-xs/normal"
color="text-muted"
>
{Reflect.apply(format, intl, [OWZJdS, {channelName: channelName}])}
</Text>
</View>
);
}
function SortAndViewOptions({channel}) { // fn#92607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:3188, offset: 0x02091aa7, size: 720 bytes, params: 2, frame: 31
var r0;
var PressableOpacity;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var items2;
var Text;
var Button;
const styles = useStyles();
const id = channel.id;
const binding = env0_3;
const useCallback = binding.useCallback;
let object = [id];
const value2 = Reflect.apply(useCallback, binding, [_fun92608, object]);
const isMediaChannel2 = channel.isMediaChannel();
if ((importDefault(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */)('SortAndViewOptions')) {
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
string = intl.string;
r0 = <Button variant="secondary" text={isMediaChannel2 ? Reflect.apply(string, intl,
[t.JxU0wr]) : Reflect.apply(string, intl,
[t.xyYt8A])} onPress={value2} size="sm" icon={((ArrowsUpDownIcon) => <ArrowsUpDownIcon size="xxs" />)((require(11689) /* metro dependency 11689: ArrowsUpDownIcon */).ArrowsUpDownIcon)} />;
} else {
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
object = {accessibilityRole: 'button'};
string = intl.string;
object.accessibilityLabel = isMediaChannel2 ? Reflect.apply(string, intl, [t['kQN/bi']]) : Reflect.apply(string,
intl, [t.Iqetyr]);
object.androidRippleConfig = ANDROID_FOREGROUND_RIPPLE;
object.activeOpacity = 0.8;
object.style = styles.optionsContainer;
object.onPress = value2;
var viewBindingProps = {style: styles.optionsPill};
items2 = [((ArrowsUpDownIcon) => <ArrowsUpDownIcon size="xs" style={styles.sortOptionsIcon} />)((require(11689) /* metro dependency 11689: ArrowsUpDownIcon */).ArrowsUpDownIcon)];
Text = (require(4573) /* metro dependency 4573: Text */).Text;
string = intl.string;
items2[1] = <Text variant="text-sm/medium" color="interactive-text-default" style={styles.sortOptionsText}>{isMediaChannel2 ? Reflect.apply(string,
intl, [t.JxU0wr]) : Reflect.apply(string, intl, [t.xyYt8A])}</Text>;
items2[2] = ((ChevronSmallDownIcon) => <ChevronSmallDownIcon size="xs" />)((require(8708) /* metro dependency 8708: ChevronSmallDownIcon */).ChevronSmallDownIcon);
r0 = <PressableOpacity {...object}><View {...viewBindingProps}>{items2}</View></PressableOpacity>;
}
return r0;
}
function TagFilter({channel}) { // fn#92610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:4260, offset: 0x02091e25, size: 660 bytes, params: 2, frame: 31
var r0;
var PressableOpacity;
var object;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
var items2;
const styles = useStyles();
const tagFilter = useForumChannelStore(channel.id).tagFilter;
const closure = onPress_92611;
if ((importDefault(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */)('TagFilter')) {
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
r0 = <Button variant="secondary" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['112vVE'])} onPress={closure} size="sm" icon={((TagIcon) => <TagIcon size="xxs" />)((require(10078) /* metro dependency 10078: TagIcon */).TagIcon)} />;
} else {
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
var pressableOpacityProps = {'accessibilityRole': 'button', 'accessibilityLabel': null, 'activeOpacity': 0.8,
accessibilityLabel: intl.string(t.TdqRTh), style: styles.optionsContainer, onPress: closure};
var viewBindingProps = {style: styles.optionsPill};
items2 = [tagFilter.size > 0 && <View style={styles.countContainer}><Text variant="text-xs/bold" color="always-white" style={styles.countText}>{tagFilter.size}</Text></View>];
items2[1] = <Text variant="text-sm/medium" color="interactive-text-default" style={styles.sortOptionsText}>{intl.string(t['112vVE'])}</Text>;
items2[2] = ((ChevronSmallDownIcon) => <ChevronSmallDownIcon size="xs" />)((require(8708) /* metro dependency 8708: ChevronSmallDownIcon */).ChevronSmallDownIcon);
r0 = <PressableOpacity {...pressableOpacityProps}><View {...viewBindingProps}>{items2}</View></PressableOpacity>;
}
return r0;
}
function getForumItemType(a0) { // fn#92612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:5267, offset: 0x02092116, size: 32 bytes, params: 2, frame: 11
const value = a0;
return env0_23.has(value) ? value : 'thread';
}
function onForumViewableItemsChanged({changed}) { // fn#92613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:5323, offset: 0x02092136, size: 32 bytes, params: 2, frame: 11
changed.forEach(_fun92614);
}
function ForumChannelContent({channel, searchQuery, insets}) { // fn#92615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:5592, offset: 0x020921f9, size: 988 bytes, params: 2, frame: 38
const styles = useStyles();
const value3 = env0_3.useRef(null);
const {sortOrder, tagFilter, tagSetting} = useForumChannelStore(channel.id);
(importDefault(12061) /* metro dependency 12061: ForumPlatformHooksNative */).useForumChannelSeenManager({guildId: channel.guild_id,
channelId: channel.id});
env0_3.useEffect(_fun92616, [channel.id]);
const value5 = useForumData(channel, sortOrder, tagFilter, tagSetting);
const activeThreadIds = value5.activeThreadIds;
var env0_3 = activeThreadIds;
const archivedThreadIds = value5.archivedThreadIds;
const canLoadMore = value5.canLoadMore;
const loadMore = value5.loadMore;
const archivedThreadsLoading = value5.archivedThreadsLoading;
const activeThreadsLoading = value5.activeThreadsLoading;
const isSearchLoading = value5.isSearchLoading;
const isEmpty = value5.isEmpty;
const searchResults = value5.searchResults;
const value6 = (importDefault(4805) /* metro dependency 4805: useChannelName */)(channel);
const value7 = (require(9619) /* metro dependency 9619: ForumHooks */).useCanViewArchivedPosts(channel);
const value8 = (require(9619) /* metro dependency 9619: ForumHooks */).useCanSearchForumPosts(channel);
const value9 = (require(7701) /* metro dependency 7701: ClientThemesOverrides */).useClientThemesOverride();
const value10 = env0_3.useCallback(_fun92620, [archivedThreadsLoading, canLoadMore, value7, loadMore,
searchResults]);
const env0_14 = env0_3.useCallback(_fun92621, [976, archivedThreadsLoading, canLoadMore, value7, loadMore,
searchResults]);
const value11 = env0_3.useMemo(_fun92622, [searchResults, value7, value8, activeThreadIds, activeThreadsLoading,
archivedThreadIds, archivedThreadsLoading, isSearchLoading]);
const value12 = env0_3.useCallback(_fun92623, [searchResults?.length, searchQuery, value6]);
if (isEmpty) {
return ((Component) => <Component topViewHeight={92} channelName={value6 ?? ''} tagFilter={tagFilter} />)(importDefault(12063) /* metro dependency 12063: ForumChannelEmptyState */);
}
const items2 = [styles.list, value9];
const FlashList = (require(8416) /* metro dependency 8416: flashList */).FlashList;
const object = {};
const PX_8 = activeThreadIds.length === 0 ? 0 : (importDefault(697) /* metro dependency 697: native */).space.PX_8;
object.paddingTop = PX_8;
const bottom = insets.bottom;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.paddingBottom = bottom + PX_16;
const view = <View style={items2}><FlashList ref={value3} contentContainerStyle={object} estimatedItemSize={122} getItemType={getForumItemType} keyExtractor={forumKeyExtractor} renderItem={value12} data={value11} onScroll={onScroll_92624} onEndReached={value10} onViewableItemsChanged={onForumViewableItemsChanged} viewabilityConfig={env0_26} /></View>;
const jsxRuntimeEnv0_17Binding = jsxRuntimeEnv0_17;
let value = importDefault(7704) /* metro dependency 7704: ThemedGradient */;
value = ((Component) => <Component absolute mix />)(value);
return (
<>
{value}
{view}
</>
);
}
function forumKeyExtractor(a0, a1) { // fn#92625, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:545, offset: 0x02092bd3, size: 51 bytes, params: 3, frame: 16
const value = a0;
return value !== env0_22 ? value : '' + env0_22 + '-' + a1;
}
function ForumChannel({channel}) { // fn#92627, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:8762, offset: 0x02092c7f, size: 1174 bytes, params: 2, frame: 33
const styles = useStyles();
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildVerificationStore],
function() {
return GuildVerificationStore.canChatInGuild(channel.guild_id);
});
const value4 = (require(6860) /* metro dependency 6860: ThreadHooks */).useCanStartThread(channel);
const r13 = channel.topic != null && channel.topic.length !== 0;
const defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */;
const FORUM_CHANNEL = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).FORUM_CHANNEL;
const analyticsLocations = defaultImport(FORUM_CHANNEL).analyticsLocations;
const forumHooksModule = require(9619) /* metro dependency 9619: ForumHooks */;
const useForumSearchState = forumHooksModule.useForumSearchState;
const searchQuery = Reflect.apply(useForumSearchState, forumHooksModule, [{channelId: channel.id}]).searchQuery;
const env0_3 = searchQuery;
const value8 = (require(6664) /* metro dependency 6664: useShowMemberVerificationGate */).useShowMemberVerificationGate(channel.guild_id);
const value9 = (require(566) /* metro dependency 566: flux */).useStateFromStores([DraftStore], function() {
return DraftStore.getThreadSettings(channel.id);
}, [channel.id]);
const value10 = (importDefault(11319) /* metro dependency 11319: useShowChannelOptInNotice */)(channel);
env0_3.useEffect(function() {
return _fun92631;
}, [channel.id]);
const value12 = env0_3.useCallback(_fun92633, [channel, value8, r13, env0_3.useCallback(_fun92632, [channel,
analyticsLocations, searchQuery, value9])]);
const r12 = value3 ? !value4 && !value8 : !value3;
const insets = (importDefault(5463) /* metro dependency 5463: useSafeAreaInsetsKeyboardAwareNative */)({includeKeyboardHeight: true}).insets;
const value16 = (require(7701) /* metro dependency 7701: ClientThemesOverrides */).useClientThemesOverride(styles.noHeight);
const items2 = [value10 ? ((OptInChannelBanner) => <OptInChannelBanner channel={channel} topBorder />)((require(11317) /* metro dependency 11317: ChatBanner */).OptInChannelBanner) : null];
items2[1] = <View style={styles.headerRow}><SortAndViewOptions channel={channel} />{channel.availableTags.length > 0 && <TagFilter channel={channel} />}</View>;
items2[2] = <View style={[styles.headerDivider, value16]} />;
items2[3] = <View style={styles.container}><ForumChannelContent channel={channel} insets={insets} searchQuery={searchQuery} /></View>;
const FloatingActionButton = (require(8561) /* metro dependency 8561: FloatingActionButtonNative */).FloatingActionButton;
const object = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const TyAuoT = (require(1244) /* metro dependency 1244: indexNative */).t.TyAuoT;
object.accessibilityLabel = Reflect.apply(string, intl, [TyAuoT]);
object.icon = importDefault(12066) /* metro dependency 12066 */;
object.disabled = r12;
const bottom = insets.bottom;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object.positionBottom = bottom + PX_16;
object.onPress = value12;
object.onPressDisabled = onCreatePostWithoutPermission;
object.accessibilityHint = r12 ? intl.string((require(1244) /* metro dependency 1244: indexNative */).t.iyzwnD) : undefined;
items2[4] = <FloatingActionButton {...object} />;
items2[5] = channel.guild_id != null ? ((MemberActionChatInputBannerGuarded) => <MemberActionChatInputBannerGuarded channel={channel} />)((require(11809) /* metro dependency 11809: MemberActionChatInputBanner */).MemberActionChatInputBannerGuarded) : null;
return (
<View style={styles.background}>
{items2}
</View>
);
}
function _fun92608() { // fn#92608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:3263, offset: 0x02091d77, size: 129 bytes, params: 1, frame: 19
const idBinding = id;
const value = 'ForumDisplaySettingsActionSheet-' + idBinding;
const defaultImport = importDefault(dependencyMap[23]);
defaultImport.openLazy(require(dependencyMap[25])(dependencyMap[24], dependencyMap.paths), value,
{channelId: idBinding, onClose: onClose_92609});
}
function TagFilterOnPress() { // fn#92611, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:4334, owner: TagFilter.onPress, offset: 0x020920b9, size: 93 bytes, params: 1, frame: 16
let value = environment.__proto__;
const defaultImport = importDefault(dependencyMap[23]);
const openLazy = defaultImport.openLazy;
value = require(dependencyMap[25]);
value = value(dependencyMap[31], dependencyMap.paths);
Reflect.apply(openLazy, defaultImport, [value, 'ForumTagFilterActionSheet', {channel: channel}]);
}
function _fun92614(a0) { // fn#92614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:5382, offset: 0x02092156, size: 163 bytes, params: 2, frame: 18
var parent_id;
var isViewable;
var markForumPostItemAsUnseen;
var Date;
var markForumPostItemAsSeen;
const item = a0.item;
let value = environment.__proto__;
const binding = env1_23;
if (!binding.has(item)) {
parent_id = ChannelStore.getChannel(item)?.parent_id;
if (parent_id != null) {
isViewable = a0.isViewable;
value = require(9623) /* metro dependency 9623: ForumChannelSeenManager */;
if (isViewable) {
markForumPostItemAsSeen = value.markForumPostItemAsSeen;
Date = global.Date;
Reflect.apply(markForumPostItemAsSeen, value, [parent_id, item, Date.now()]);
} else {
markForumPostItemAsUnseen = value.markForumPostItemAsUnseen;
Date = global.Date;
Reflect.apply(markForumPostItemAsUnseen, value, [parent_id, item, Date.now()]);
}
}
}
}
function _fun92616() { // fn#92616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:5824, offset: 0x020925d5, size: 43 bytes, params: 1, frame: 11
const current = env0_2.current;
if (current != null) {
current.scrollToOffset({'offset': 0, 'animated': false});
}
}
function useForumData(a0, a1, a2, a3) { // fn#92617, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:5913, owner: ForumChannelContent.useForumData, offset: 0x02092600, size: 482 bytes, params: 5, frame: 30
var r11;
const env0_0 = a0;
const value2 = (require(9619) /* metro dependency 9619: ForumHooks */).useForumActiveThreadIds({channel: a0,
sortOrder: a1, tagFilter: a2, tagSetting: a3, shouldAutomaticallyAck: true});
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ActiveThreadsStore,
LurkingStore], _fun92618);
const {searchResults,
isSearchLoading} = (require(9619) /* metro dependency 9619: ForumHooks */).useForumSearchState({channelId: a0.id});
(require(9619) /* metro dependency 9619: ForumHooks */).useAutomaticForumSearch(a0, a2, a3);
const value5 = (require(9619) /* metro dependency 9619: ForumHooks */).useCanViewArchivedPosts(a0);
const {threadIds, canLoadMore, loadMore,
loading} = (require(12057) /* metro dependency 12057: ThreadBrowserHooks */).useArchivedThreads(a0, a1, a2, a3);
(require(9619) /* metro dependency 9619: ForumHooks */).useLoadForumUnreadCounts(a0, a1, a2, a3);
let r2 = searchResults == null && value5;
if (r2) {
r11 = value3 || loading;
r11 = !r11 ? isSearchLoading : r11;
r2 = !r11;
}
r2 = r2 && value2.length === 0 && threadIds.length === 0;
env1_3.useEffect(_fun92619, [value2.length, threadIds.length, value3]);
return {activeThreadIds: value2, archivedThreadIds: threadIds, canLoadMore: canLoadMore, loadMore: loadMore,
activeThreadsLoading: value3, archivedThreadsLoading: loading, isSearchLoading: isSearchLoading, isEmpty: r2,
searchResults: searchResults};
}
function _fun92620() { // fn#92620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:7115, offset: 0x02092866, size: 54 bytes, params: 1, frame: 10
if (searchResults == null && env0_12 && !archivedThreadsLoading && canLoadMore) {
loadMore();
}
}
function _fun92621({nativeEvent}) { // fn#92621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:7175, offset: 0x0209289c, size: 117 bytes, params: 2, frame: 13
const y = nativeEvent.contentOffset.y;
const height = nativeEvent.contentSize.height;
const height2 = nativeEvent.layoutMeasurement.height;
let r1 = searchResults == null && env0_12 && !archivedThreadsLoading;
r1 = r1 && canLoadMore && y + height2 > height - 976;
if (r1) {
loadMore();
}
}
function _fun92622() { // fn#92622, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:7333, offset: 0x02092911, size: 320 bytes, params: 1, frame: 17
var r2;
var push;
var activeThreadIdsBinding;
var items2;
var value2;
var value3;
var archivedThreadIdsBinding;
var value4;
var length;
var value5;
var value6;
var items3;
var value7;
var binding;
var items4;
const items5 = [];
let value = environment;
let searchResultsBinding = searchResults;
if (searchResultsBinding != null) {
push = items5.push;
value7 = environment.__proto__;
Reflect.apply(push, items5, [env1_19]);
binding = env0_13;
push = items5.push;
if (binding) {
searchResultsBinding = searchResults;
items4 = [];
arraySpread(items4, searchResultsBinding, 0, undefined);
apply(push, items4, items5, undefined);
} else {
Reflect.apply(push, items5, [env1_20]);
}
} else {
reducibleJoin11: while (true) {
if (activeThreadsLoading) {
break reducibleJoin11;
}
push = items5.push;
activeThreadIdsBinding = activeThreadIds;
items2 = [];
value2 = arraySpread(items2, activeThreadIdsBinding, 0, undefined);
apply(push, items2, items5, value2);
if (env0_12) {
value4 = archivedThreadIds != null;
reducibleJoin6: while (true) {
if (value4) {
length = archivedThreadIds.length;
value5 = length > 0;
r2 = value5;
break reducibleJoin6;
}
r2 = value4;
break reducibleJoin6;
}
if (r2) {
push = items5.push;
value6 = environment.__proto__;
Reflect.apply(push, items5, [env1_18]);
push = items5.push;
archivedThreadIdsBinding = archivedThreadIds;
items3 = [];
arraySpread(items3, archivedThreadIdsBinding, 0, value2);
apply(push, items3, items5, value2);
break reducibleJoin11;
}
break reducibleJoin11;
}
push = items5.push;
value3 = environment.__proto__;
Reflect.apply(push, items5, [env1_18]);
push = items5.push;
Reflect.apply(push, items5, [env1_21]);
break reducibleJoin11;
}
}
const activeThreadsLoadingBinding = activeThreadsLoading;
const value8 = 0;
if (activeThreadsLoadingBinding) {
r2 = value8;
reducibleLoop14: while (true) {
push = items5.push;
value = environment.__proto__;
Reflect.apply(push, items5, [env1_22]);
value = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value < 20) {
r2 = value;
continue reducibleLoop14;
}
break reducibleLoop14;
}
} else if (archivedThreadsLoading) {
r2 = value8;
reducibleLoop14: while (true) {
push = items5.push;
value = environment.__proto__;
Reflect.apply(push, items5, [env1_22]);
value = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value < 20) {
r2 = value;
continue reducibleLoop14;
}
break reducibleLoop14;
}
} else if (isSearchLoading) {
r2 = value8;
reducibleLoop14: while (true) {
push = items5.push;
value = environment.__proto__;
Reflect.apply(push, items5, [env1_22]);
value = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
if (value < 20) {
r2 = value;
continue reducibleLoop14;
}
break reducibleLoop14;
}
}
return items5;
}
function _fun92623({item}) { // fn#92623, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:7569, offset: 0x02092a51, size: 309 bytes, params: 2, frame: 20
var r0;
let value = environment.__proto__;
if (item === env1_18) {
r0 = <ArchivedSection />;
} else if (item === env1_19) {
r0 = <SearchSection numPosts={searchResults?.length ?? 0} searchQuery={searchQuery ?? ''} />;
} else if (item === env1_22) {
value = importDefault(12062) /* metro dependency 12062: ForumPostPlaceholder */;
value = ((Component) => <Component />)(value);
r0 = value;
} else if (item === env1_21) {
r0 = <ArchivedMissingReadHistoryPermission channelName={env0_11} />;
} else if (item === env1_20) {
r0 = <SearchMissingReadHistoryPermission channelName={env0_11} />;
} else {
value = importDefault(11546) /* metro dependency 11546: ForumPost */;
value = ((Component) => <Component threadId={item} />)(value);
r0 = value;
}
return r0;
}
function ForumChannelContentOnScroll(a0) { // fn#92624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:8296, owner: ForumChannelContent.onScroll, offset: 0x02092b86, size: 77 bytes, params: 2, frame: 15
let value = environment.__proto__;
value = require(7155) /* metro dependency 7155: Tracking */;
const trackForumScrolled = value.trackForumScrolled;
const channelBinding = channel;
Reflect.apply(trackForumScrolled, value, [{guildId: channelBinding.guild_id, channelId: channelBinding.id}]);
env0_14(a0);
}
function _fun92630() { // fn#92630, offset: 0x02093155, size: 11 bytes, params: 1, frame: 1
return _fun92631;
}
function _fun92632(a0) { // fn#92632, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:9302, offset: 0x020931a3, size: 329 bytes, params: 2, frame: 19
var length;
var r2;
var value5;
var defaultImport2;
let value = environment.__proto__;
const value2 = undefined;
const defaultImport = importDefault(7165) /* metro dependency 7165: DraftActionCreators */;
defaultImport.changeThreadSettings(channel.id, {isPrivate: false});
let name = env0_5 == null ? value2 : env0_5.name;
const value4 = name != null;
if (value4) {
if (env0_5 == null) {
length = value2;
} else {
name = env0_5.name;
if (name == null) {
length = value2;
} else {
value5 = name.trim();
length = value5 == null ? value2 : value5.length;
}
}
r2 = length !== 0;
} else {
r2 = value4;
}
if (!r2) {
defaultImport2 = defaultImport;
defaultImport2.changeThreadSettings(channel.id,
{name: searchQuery != null && searchQuery.trim().length > 0 ? searchQuery.trim() : value2});
}
value = require(11007) /* metro dependency 11007: ForumComposerModalActionCreators */;
const openCreateForumPostModal = value.openCreateForumPostModal;
channelBinding = channel;
Reflect.apply(openCreateForumPostModal, value, [{guildId: channelBinding.guild_id,
parentChannelId: channelBinding.id, analyticsLocationObject: a0, analyticsLocations: analyticsLocations}]);
return value2;
}
function _fun92633() { // fn#92633, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:9705, offset: 0x020932ec, size: 128 bytes, params: 1, frame: 18
var environment;
const closure = startCreateForumPostFlow;
let value = environment.__proto__;
const trackingModule = require(7155) /* metro dependency 7155: Tracking */;
const trackForumCreateNewPostClick = trackingModule.trackForumCreateNewPostClick;
const channelBinding = channel;
Reflect.apply(trackForumCreateNewPostClick, trackingModule, [{guildId: channelBinding.guild_id,
channelId: channelBinding.id}]);
if (env0_4) {
value = require(8919) /* metro dependency 8919: MemberVerificationModalActionCreators */;
value.openMemberVerificationModal(channel.guild_id, closure);
} else {
closure();
}
}
function onClose_92609() { // fn#92609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:3371, offset: 0x02091df8, size: 45 bytes, params: 1, frame: 12
const value = environment.__proto__.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet(env0_0);
}
function _fun92618() { // fn#92618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:6096, offset: 0x020927e2, size: 61 bytes, params: 1, frame: 13
const value = environment.__proto__.__proto__;
const hasLoaded = ActiveThreadsStore.hasLoaded;
const binding = env0_0;
return !Reflect.apply(hasLoaded, ActiveThreadsStore,
[binding.guild_id]) && !LurkingStore.isLurking(binding.guild_id);
}
function _fun92619() { // fn#92619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:6556, offset: 0x0209281f, size: 71 bytes, params: 1, frame: 15
let value = environment.__proto__.__proto__;
value = importDefault(14) /* metro dependency 14: TTITracker */;
value.recordRender(env0_1.length + threadIds.length, !env0_2);
}
function _fun92631() { // fn#92631, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:9221, offset: 0x02093160, size: 67 bytes, params: 1, frame: 12
var value2;
var defaultImport;
if (channel.id != null) {
value2 = environment.__proto__.__proto__;
defaultImport = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
defaultImport.clearForumSearch(channel.id);
}
}
function startCreateForumPostFlow() { // fn#92634, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:9710, offset: 0x0209336c, size: 232 bytes, params: 1, frame: 16
var environment;
var value2;
var defaultImport;
var value3;
var moduleValue2;
if (env1_1) {
value2 = environment.__proto__.__proto__;
defaultImport = importDefault(11024) /* metro dependency 11024: ForumGuidelinesManager */;
if (defaultImport.hasSeen(channel.id)) {
value3 = environment.__proto__.__proto__;
moduleValue2 = require(4081) /* metro dependency 4081: HapticUtilsNative */;
moduleValue2.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
env1_6({page: AnalyticsPages.GUILD_CHANNEL, section: AnalyticsSections.FORUM_CHANNEL_FOOTER,
object: AnalyticsObjects.BUTTON_CTA});
} else {
(require(11022) /* metro dependency 11022: ForumGuidelinesActionSheet */).openForumGuidelinesActionSheet({channel: channel,
onPress: onPress_92635});
}
} else {
value3 = environment.__proto__.__proto__;
moduleValue2 = require(4081) /* metro dependency 4081: HapticUtilsNative */;
moduleValue2.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
env1_6({page: AnalyticsPages.GUILD_CHANNEL, section: AnalyticsSections.FORUM_CHANNEL_FOOTER,
object: AnalyticsObjects.BUTTON_CTA});
}
}
function startCreateForumPostFlowOnPress() { // fn#92635, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12242:9967, owner: startCreateForumPostFlow.onPress, offset: 0x02093454, size: 66 bytes, params: 1, frame: 12
const binding = env2_6;
const GUILD_CHANNEL = AnalyticsPages.GUILD_CHANNEL;
const FORUM_CHANNEL_GUIDELINES = AnalyticsSections.FORUM_CHANNEL_GUIDELINES;
const BUTTON_CTA = AnalyticsObjects.BUTTON_CTA;
return binding({page: GUILD_CHANNEL, section: FORUM_CHANNEL_GUIDELINES, object: BUTTON_CTA});
}
@@ -0,0 +1,48 @@
/* Metro module 12063; source: modules/forums/native/ForumChannelEmptyState.tsx; dependencies: [31, 27, 33, 4501, 4002, 1585, 12064, 12065, 4573, 1244, 2] */
function _fun92706(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92706, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12249:6, offset: 0x02095865, size: 290 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const value2 = require(27) /* metro dependency 27 */;
const env0_3 = value2.View;
const env0_4 = value2.Image;
const value3 = require(33) /* metro dependency 33 */;
const env0_5 = value3.jsx;
const env0_6 = value3.jsxs;
const env0_7 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({container: {'flex': 1,
'alignSelf': 'stretch', 'justifyContent': 'center', 'alignItems': 'center'}, image: {'width': 120,
'height': 80}, title: {'textAlign': 'center', 'marginTop': 16, 'marginHorizontal': 20},
subtext: {'textAlign': 'center', 'marginTop': 4, 'marginHorizontal': 20}});
value = value.memo(_fun92707);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumChannelEmptyState.tsx');
exports.default = value;
}
function _fun92707({topViewHeight, channelName, tagFilter}) { // fn#92707, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12249:430, offset: 0x02095987, size: 603 bytes, params: 2, frame: 30
topViewHeight = topViewHeight === undefined ? 0 : topViewHeight;
const styles = useStyles();
const sharedModule = require(4002) /* metro dependency 4002: shared */;
const useThemeContext = sharedModule.useThemeContext;
const theme = Reflect.apply(useThemeContext, sharedModule, []).theme;
const {bottom, top} = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
const value3 = tagFilter.size > 0;
const items3 = [styles.container];
items3[1] = {marginBottom: bottom + top + topViewHeight};
const items2 = [<Image source={sharedModule.isThemeLight(theme) ? importDefault(12064) /* metro dependency 12064 */ : importDefault(12065) /* metro dependency 12065 */} style={styles.image} />];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
items2[1] = <Text style={styles.title} accessibilityRole="header" variant="heading-lg/semibold" color="mobile-text-heading-primary">{value3 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.lvPci0,
{numTags: tagFilter.size}) : intl.string((require(1244) /* metro dependency 1244: indexNative */).t.PwTMG0)}</Text>;
const formatToPlainString = intl.formatToPlainString;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
items2[2] = <Text style={styles.subtext} variant="text-sm/medium" color="text-default">{value3 ? Reflect.apply(formatToPlainString,
intl, [t.AAeye1, {numTags: tagFilter.size}]) : Reflect.apply(formatToPlainString, intl, [t.YtsXFD,
{channelName: channelName}])}</Text>;
return (
<View style={items3}>
{items2}
</View>
);
}
@@ -0,0 +1,135 @@
/* Metro module 9698; source: modules/forums/native/ForumChannelSearch.tsx; dependencies: [31, 27, 7156, 33, 4501, 1485, 9699, 9603, 4578, 1244, 9621, 566, 6984, 7155, 2] */
function _fun76223(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76223, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9884:6, offset: 0x01dc715c, size: 274 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const forumSearchStore = importDefault(7156) /* metro dependency 7156: ForumSearchStore */;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
const env0_7 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({inputContainer: {'flexGrow': 1,
'marginLeft': 8}, cancelButtonContainer: {paddingLeft: 8}});
const value3 = value.memo(_fun76224);
value = value.memo(_fun76228);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumChannelSearch.tsx');
exports.ForumChannelCloseSearchButton = value3;
exports.ForumChannelSearchInput = value;
}
function _fun76224({channelId}) { // fn#76224, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9884:260, offset: 0x01dc726e, size: 288 bytes, params: 2, frame: 22
var r0;
var Button;
var intl;
const styles = useStyles();
const value2 = (require(1485) /* metro dependency 1485 */).useNavigation();
const value3 = (require(1485) /* metro dependency 1485 */).useRoute();
const value4 = (require(9699) /* metro dependency 9699: useCanSearchForumPostsByChannelId */).useCanSearchForumPostsByChannelId(channelId);
env0_3.useEffect(function() {
return _fun76226;
}, [value2, value3]);
if (value4) {
var viewBindingProps = {style: styles.cancelButtonContainer};
Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r0 = <View {...viewBindingProps}><Button variant="tertiary" size="sm" text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['ETE/oC'])} onPress={onPress_76227} /></View>;
} else {
r0 = null;
}
return r0;
}
function _fun76228({channelId, guildId, placeholder}) { // fn#76228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9884:720, offset: 0x01dc741c, size: 338 bytes, params: 2, frame: 25
var r9;
var r0;
var SearchField;
var object;
var intl;
const styles = useStyles();
const value2 = (require(9699) /* metro dependency 9699: useCanSearchForumPostsByChannelId */).useCanSearchForumPostsByChannelId(channelId);
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ForumSearchStore], _fun76229,
[channelId]);
if (value2) {
if (value3 != null) {
var viewBindingProps = {style: styles.inputContainer};
SearchField = (require(6984) /* metro dependency 6984: SearchFieldNative */).SearchField;
object = {size: 'sm', defaultValue: value3, onChange: onChange_76230};
if (placeholder != null) {
r9 = placeholder;
} else {
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
r9 = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Iy2gnS);
}
object.placeholder = r9;
object.autoFocus = value3.length === 0;
object.onClear = onClear;
object.grow = false;
r0 = <View {...viewBindingProps}><SearchField {...object} /></View>;
} else {
r0 = null;
}
} else {
r0 = null;
}
return r0;
}
function _fun76225() { // fn#76225, offset: 0x01dc738e, size: 11 bytes, params: 1, frame: 1
return _fun76226;
}
function onPress_76227() { // fn#76227, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9884:643, offset: 0x01dc73e2, size: 58 bytes, params: 1, frame: 14
var value2;
var defaultImport;
if (channelId != null) {
value2 = environment.__proto__;
defaultImport = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
defaultImport.updateForumSearchQuery(channelId, null);
}
}
function _fun76229() { // fn#76229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9884:860, offset: 0x01dc756e, size: 40 bytes, params: 1, frame: 12
const channelIdBinding = channelId;
const value2 = null;
return value2 != channelIdBinding ? ForumSearchStore.getSearchQuery(channelId) : value2;
}
function onChange_76230(a0) { // fn#76230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9884:1016, offset: 0x01dc7596, size: 61 bytes, params: 2, frame: 13
var value2;
var defaultImport;
if (channelId != null) {
value2 = environment.__proto__;
defaultImport = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
defaultImport.updateForumSearchQuery(channelId, a0);
}
}
function onClear() { // fn#76231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9884:1158, offset: 0x01dc75d3, size: 138 bytes, params: 1, frame: 15
var value4;
var value5;
var defaultImport;
if (guildId != null && channelId != null) {
value4 = environment.__proto__;
(require(7155) /* metro dependency 7155: Tracking */).trackForumSearchCleared({guildId: guildId,
channelId: channelId});
}
if (channelId != null) {
value5 = environment.__proto__;
defaultImport = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
defaultImport.updateForumSearchQuery(channelId, '');
}
}
function _fun76226() { // fn#76226, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9884:412, offset: 0x01dc7399, size: 73 bytes, params: 1, frame: 15
var binding;
var setOptions;
var value2;
var moduleValue;
if (env1_1 != null) {
binding = env1_1;
setOptions = binding.setOptions;
value2 = environment.__proto__.__proto__;
moduleValue = require(9603) /* metro dependency 9603: HeaderShared */;
Reflect.apply(setOptions, binding, [moduleValue.getDefaultChannelStackHeaderProps(binding, env1_2)]);
}
}
@@ -0,0 +1,213 @@
/* Metro module 12059; source: modules/forums/native/ForumDisplaySettingsActionSheet.tsx; dependencies: [57, 31, 1379, 11547, 33, 1244, 1388, 1389, 1390, 566, 4594, 7155, 6805, 6758, 9067, 6277, 4572, 697, 7988, 7987, 2] */
function _fun92675(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92675, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12245:6, offset: 0x02094114, size: 215 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 channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
let value = require(11547) /* metro dependency 11547: ForumChannelStore */;
const env0_6 = value.useForumChannelStoreApi;
const env0_7 = value.useForumChannelStore;
value = require(33) /* metro dependency 33 */;
const env0_8 = value.jsx;
const env0_9 = value.jsxs;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumDisplaySettingsActionSheet.tsx');
exports.default = ForumDisplaySettingsActionSheet;
}
function ForumDisplaySettingsActionSheet({channelId}) { // fn#92676, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12245:318, offset: 0x020941eb, size: 1763 bytes, params: 2, frame: 40
var object16;
var r11;
var object9;
var object3;
const ForumLayout = (require(1389) /* metro dependency 1389: ForumLayout */).ForumLayout;
var items3;
var object4;
var object12;
var object5;
const ThreadSearchTagSetting = (require(1390) /* metro dependency 1390: ThreadSearchTagSetting */).ThreadSearchTagSetting;
var items4;
var object6;
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(channelId);
});
const value2 = useForumChannelStore(channelId);
const sortOrder = value2.sortOrder;
const layoutType = value2.layoutType;
const env0_3 = layoutType;
const tagSetting = value2.tagSetting;
const binding = useForumChannelStoreApi();
let useState = binding.useState;
const value3 = Reflect.apply(useState, binding, [sortOrder]);
const binding2 = env0_3;
const value4 = binding2(value3, 2);
const env0_5 = value4[0];
const env0_6 = value4[1];
useState = binding.useState;
const value5 = binding2(Reflect.apply(useState, binding, [layoutType]), 2);
const env0_7 = value5[0];
const env0_8 = value5[1];
useState = binding.useState;
const value6 = binding2(Reflect.apply(useState, binding, [tagSetting]), 2);
const env0_9 = value6[0];
const env0_10 = value6[1];
const value8 = binding.useRef(null);
const value9 = binding.useRef(null);
const value10 = binding.useRef(null);
(require(4594) /* metro dependency 4594: useMountEffect */).useUnmountEffect(_fun92678);
const value11 = binding.useCallback(_fun92679, [channel]);
if (channel == null) {
return null;
}
const r14 = channel.availableTags != null && channel.availableTags.length > 0;
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
object16 = {scrollable: true};
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
const object8 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
object8.title = Reflect.apply(string, intl, [t.xyYt8A]);
const ActionSheetHeaderPressableText = (require(9067) /* metro dependency 9067: ActionSheetHeaderPressableTextNative */).ActionSheetHeaderPressableText;
object8.leading = <ActionSheetHeaderPressableText onPress={value11} label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.yBZMsQ)} />;
object16.header = <BottomSheetTitleHeader {...object8} />;
const BottomSheetScrollView = (require(6277) /* metro dependency 6277 */).BottomSheetScrollView;
const Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
const TableRadioGroup = (require(7988) /* metro dependency 7988: TableRadioGroupNative */).TableRadioGroup;
const tableRadioGroupProps2 = {groupRef: value8, hasIcons: false, defaultValue: sortOrder, onChange: onChange_92680,
title: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.f8wNDl),
accessibilityLabel: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.f8wNDl)};
const object15 = {};
object15.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t.jOPmcI);
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
const LATEST_ACTIVITY = ThreadSortOrder.LATEST_ACTIVITY;
object15.value = LATEST_ACTIVITY;
const items5 = [object15];
string = intl.string;
const UIltXd = (require(1244) /* metro dependency 1244: indexNative */).t.UIltXd;
const CREATION_DATE = ThreadSortOrder.CREATION_DATE;
items5[1] = {label: Reflect.apply(string, intl, [UIltXd]), value: CREATION_DATE};
const items2 = [<TableRadioGroup {...tableRadioGroupProps2}>{items5.map(_fun92681)}</TableRadioGroup>];
if (channel.isForumChannel()) {
var tableRadioGroupProps = {groupRef: value9, hasIcons: false, defaultValue: layoutType,
onChange: onChange_92682,
title: intl.string(t.mFMDSq), accessibilityLabel: intl.string(t.h850Ss)};
object3 = {};
object3.label = intl.string(t['NJFr+g']);
object3.value = ForumLayout.LIST;
items3 = [object3];
object4 = {};
object4.label = intl.string(t.wKeggb);
object4.value = ForumLayout.GRID;
items3[1] = object4;
r11 = <TableRadioGroup {...tableRadioGroupProps}>{items3.map(_fun92683)}</TableRadioGroup>;
} else {
r11 = null;
}
items2[1] = r11;
if (r14) {
var tableRadioGroupProps = {groupRef: value10, hasIcons: false, defaultValue: tagSetting,
onChange: onChange_92684,
title: intl.string(t.Paxaug), accessibilityLabel: intl.string(t.f8wNDl)};
object5 = {};
object5.label = intl.string(t.rQ0ctQ);
object5.value = ThreadSearchTagSetting.MATCH_SOME;
items4 = [object5];
object6 = {};
object6.label = intl.string(t.FCXUu0);
object6.value = ThreadSearchTagSetting.MATCH_ALL;
items4[1] = object6;
r11 = <TableRadioGroup {...tableRadioGroupProps}>{items4.map(_fun92685)}</TableRadioGroup>;
} else {
r11 = null;
}
items2[2] = r11;
return (
<ActionSheet {...object16}>
<BottomSheetScrollView>
<Stack direction="vertical" spacing={PX_16}>
{items2}
</Stack>
</BottomSheetScrollView>
</ActionSheet>
);
}
function _fun92678() { // fn#92678, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12245:686, offset: 0x020948ce, size: 268 bytes, params: 1, frame: 15
var value2;
var moduleValue;
var trackForumSortOrderUpdated;
var value3;
var moduleValue2;
var trackForumLayoutUpdated;
var binding;
var state;
var setLayoutType;
var channelIdBinding;
let channelBinding = channel;
if (channelBinding != null) {
if (sortOrder !== env0_5) {
value2 = environment.__proto__;
moduleValue = require(7155) /* metro dependency 7155: Tracking */;
trackForumSortOrderUpdated = moduleValue.trackForumSortOrderUpdated;
channelBinding = channel;
Reflect.apply(trackForumSortOrderUpdated, moduleValue, [{guildId: channelBinding.guild_id,
channelId: channelBinding.id, sortOrder: env0_5}]);
}
if (layoutType !== env0_7) {
value3 = environment.__proto__;
moduleValue2 = require(7155) /* metro dependency 7155: Tracking */;
trackForumLayoutUpdated = moduleValue2.trackForumLayoutUpdated;
channelBinding = channel;
Reflect.apply(trackForumLayoutUpdated, moduleValue2, [{guildId: channelBinding.guild_id,
channelId: channelBinding.id, forumLayout: env0_7}]);
}
binding = env0_4;
state = binding.getState();
setLayoutType = state.setLayoutType;
channelIdBinding = channelId;
Reflect.apply(setLayoutType, state, [channelIdBinding, env0_7]);
binding.getState().setSortOrder(channelIdBinding, env0_5);
binding.getState().setTagSetting(channelIdBinding, env0_9);
}
}
function _fun92679() { // fn#92679, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12245:1004, offset: 0x020949da, size: 131 bytes, params: 1, frame: 14
var current;
var setValue;
let channelBinding = channel;
if (channelBinding != null) {
current = env0_11.current;
if (current != null) {
setValue = current.setValue;
channelBinding = channel;
Reflect.apply(setValue, current, [channelBinding.getDefaultSortOrder()]);
}
current = env0_12.current;
if (current != null) {
setValue = current.setValue;
channelBinding = channel;
Reflect.apply(setValue, current, [channelBinding.getDefaultLayout()]);
}
current = env0_13.current;
if (current != null) {
setValue = current.setValue;
channelBinding = channel;
Reflect.apply(setValue, current, [channelBinding.getDefaultTagSetting()]);
}
}
}
function _fun92681({label, value}) { // fn#92681, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12245:2037, offset: 0x02094a5d, size: 67 bytes, params: 2, frame: 16
const TableRadioRow = (require(7987) /* metro dependency 7987: TableRadioRowNative */).TableRadioRow;
return (
<TableRadioRow
label={label}
value={value}
key={value}
/>
);
}
@@ -0,0 +1,63 @@
/* Metro module 8005; source: modules/forums/native/ForumExplicitMediaAlert.tsx; dependencies: [31, 27, 33, 4501, 697, 4596, 4573, 1244, 4578, 6766, 8006, 2] */
function _fun63594(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#63594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8183:6, offset: 0x01b86def, size: 337 bytes, params: 8, frame: 22
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
let value = require(33) /* metro dependency 33 */;
const env0_4 = value.jsx;
const env0_5 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.container = {padding: PX_16, alignItems: 'stretch'};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.title = {marginBottom: PX_16};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.body = {marginTop: PX_16};
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.buttonContainer = {marginVertical: PX_16};
object2.text = {textAlign: 'center'};
const env0_6 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumExplicitMediaAlert.tsx');
exports.default = ForumExplicitMediaAlert;
}
function ForumExplicitMediaAlert({channelId, messageId, onClose}) { // fn#63595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8183:484, offset: 0x01b86f40, size: 584 bytes, params: 2, frame: 28
const styles = useStyles();
const Alert = importDefault(4596) /* metro dependency 4596: Alert */;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const items3 = [styles.title];
items3[1] = styles.text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const B3vFdU = (require(1244) /* metro dependency 1244: indexNative */).t.B3vFdU;
const items2 = [<Text accessibilityRole="header" variant="heading-md/extrabold" color="text-default" style={items3}>{Reflect.apply(string,
intl, [B3vFdU])}</Text>];
items2[1] = <Text style={[styles.body,
styles.text]} maxFontSizeMultiplier={1} variant="text-md/normal">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.i4AbAS)}</Text>;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
string = intl.string;
const WAI6xu = (require(1244) /* metro dependency 1244: indexNative */).t.WAI6xu;
items2[2] = <View style={styles.buttonContainer}><Button variant="primary" size="md" text={Reflect.apply(string,
intl, [WAI6xu])} onPress={onClose} /></View>;
const TextWithIOSLinkWorkaround = (require(6766) /* metro dependency 6766: TextWithIOSLinkWorkaround */).TextWithIOSLinkWorkaround;
items2[3] = <TextWithIOSLinkWorkaround style={styles.text} variant="text-sm/medium" color="text-muted">{intl.format((require(1244) /* metro dependency 1244: indexNative */).t['APQGZ+'],
{handleFalsePositiveHook: function() {
onClose();
require(dependencyMap[10]).handleSenderFalsePositiveFlow(channelId, messageId);
}})}</TextWithIOSLinkWorkaround>;
return (
<Alert
noDefaultButtons
style={styles.container}
onClose={onClose}
>
{items2}
</Alert>
);
}
@@ -0,0 +1,182 @@
/* Metro module 11022; source: modules/forums/native/ForumGuidelinesActionSheet.tsx; dependencies: [57, 31, 27, 6900, 33, 4501, 697, 9619, 1585, 11023, 477, 11024, 4080, 6618, 4579, 1244, 3975, 4246, 8148, 6275, 6277, 5278, 4573, 9646, 8124, 6686, 6622, 11022, 1962, 2] */
function _fun84414(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11208:6, offset: 0x01f494ac, size: 571 bytes, params: 8, frame: 24
var object2;
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 env0_5 = (require(27) /* metro dependency 27 */).View;
const env0_6 = (require(6900) /* metro dependency 6900: ForumConstants */).FORUM_GUIDELINES_ACTION_SHEET;
let value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
const env0_9 = value.Fragment;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
object2.scrollContainer = {paddingHorizontal: 16};
object2.header = {'alignItems': 'center', 'paddingTop': 20, 'paddingBottom': 24};
object2.headerTitle = {marginTop: 8};
const object3 = {padding: 16};
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object3.backgroundColor = BACKGROUND_SURFACE_HIGH;
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object2.guidelinesContainer = object3;
object2.footer = {paddingBottom: 16};
object2.buttonWrapper = {marginHorizontal: 16};
const object5 = {};
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object2.buttonPill = object5;
const object6 = {'marginTop': 16, 'position': 'absolute', 'left': 16, 'right': 16, 'shadowColor': null,
'shadowOffset': null, 'shadowOpacity': 0.25, 'shadowRadius': 4};
const BLACK = (importDefault(697) /* metro dependency 697: native */).colors.BLACK;
object6.shadowColor = BLACK;
object6.shadowOffset = {'width': 0, 'height': 1};
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object2.floatingButtonContainer = object6;
object2.editButton = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'position': 'absolute',
'top': 12, 'right': 0};
object2.editText = {marginRight: 4};
const TEXT_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_BRAND;
object2.editIcon = {color: TEXT_BRAND};
const env0_10 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumGuidelinesActionSheet.tsx');
exports.default = ForumGuidelinesActionSheet;
exports.openForumGuidelinesActionSheet = function(a0) {
var r7;
var defaultImport = importDefault(dependencyMap[12]);
var value2 = require(dependencyMap[28])(dependencyMap[27], dependencyMap.paths);
var object = {};
copyDataProperties(object, a0, r7);
defaultImport.openLazy(value2, FORUM_GUIDELINES_ACTION_SHEET, object);
};
}
function ForumGuidelinesActionSheet({channel, onPress, onClose}) { // fn#84415, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11208:1057, offset: 0x01f496e7, size: 1549 bytes, params: 2, frame: 41
var r14;
const BaseTextButton = (require(4579) /* metro dependency 4579: BaseTextButtonNative */).BaseTextButton;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var PressableOpacity;
var object;
var bt75uw;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
var object16;
const styles = useStyles();
const value3 = (require(9619) /* metro dependency 9619: ForumHooks */).useCanManageChannel(channel);
const bottom = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)().bottom;
let binding = env0_4;
var [property, env0_4] = env0_3(binding.useState(), 2);
const value7 = (importDefault(11023) /* metro dependency 11023: useActionSheetStartHeight */)();
const value8 = binding.useMemo(_fun84416, [bottom, property]);
let r5 = value8 ?? 0;
const value9 = value7 < r5;
const r21 = value9 ? undefined : value8;
binding = env0_4;
const value10 = binding.useCallback(_fun84417, [property]);
binding.useEffect(_fun84418, [channel.id]);
const closure = function() {
if (onPress != null) {
onPress();
}
importDefault(dependencyMap[12]).hideActionSheet(FORUM_GUIDELINES_ACTION_SHEET);
};
const r20 = !value9 && ((SafeAreaPaddingView) => <SafeAreaPaddingView bottom style={styles.footer}><BaseTextButton grow text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['NX+WJN'])} onPress={closure} style={styles.buttonWrapper} pillStyle={styles.buttonPill} /></SafeAreaPaddingView>)((require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView);
binding = env0_4;
const value13 = binding.useMemo(_fun84420, [bottom, value9]);
const moduleValue2 = require(3975) /* metro dependency 3975 */;
const useLocation = moduleValue2.useLocation;
const pathname = Reflect.apply(useLocation, moduleValue2, []).pathname;
const env0_7 = binding.useRef(true);
binding.useEffect(_fun84421, [pathname, channel.id]);
const value14 = binding.useCallback(_fun84422, [channel.id]);
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
const BottomSheetScrollView = (require(6277) /* metro dependency 6277 */).BottomSheetScrollView;
const object2 = {bottom: bottom};
const object3 = {paddingBottom: value13};
if (value3) {
PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
object = {};
string = intl.string;
bt75uw = t.bt75uw;
object.accessibilityLabel = Reflect.apply(string, intl, [bt75uw]);
object.accessibilityRole = 'button';
object.style = styles.editButton;
object.onPress = value14;
string = intl.string;
bt75uw = t.bt75uw;
r14 = <PressableOpacity {...object}><Text style={styles.editText} variant="text-sm/medium" color="text-brand">{Reflect.apply(string,
intl,
[bt75uw])}</Text>{((PencilIcon) => <PencilIcon color={styles.editIcon.color} size="xs" />)((require(9646) /* metro dependency 9646: PencilIcon */).PencilIcon)}</PressableOpacity>;
} else {
r14 = value3;
}
const items2 = [r14];
const StageSparkle = importDefault(8124) /* metro dependency 8124: StageSparkle */;
const BookCheckIcon = (require(6686) /* metro dependency 6686: BookCheckIcon */).BookCheckIcon;
items2[1] = <StageSparkle IconComponent={BookCheckIcon} />;
items2[2] = <Text style={styles.headerTitle} variant="heading-xl/extrabold" color="mobile-text-heading-primary">{intl.string((require(1244) /* metro dependency 1244: indexNative */).t['4d4T4l'])}</Text>;
const view = <View style={styles.header}>{items2}</View>;
const defaultImport2 = importDefault(6622) /* metro dependency 6622: MarkupUtils */;
const bottomSheet = <BottomSheet scrollable contentHeight={r21} footer={r20} onDismiss={onClose}><BottomSheetScrollView style={styles.scrollContainer} scrollIndicatorInsets={object2} contentContainerStyle={object3} onContentSizeChange={value10}>{view}<View style={styles.guidelinesContainer}><Text variant="text-md/medium" color="text-default">{defaultImport2.parseForumPostGuidelines(channel.topic,
true, {'channelId': null, 'allowHeading': true, 'allowList': true, 'allowLinks': true,
channelId: channel.id})}</Text></View></BottomSheetScrollView></BottomSheet>;
if (value9) {
r5 = <BaseTextButton grow style={[styles.floatingButtonContainer,
{bottom: bottom + 16}]} pillStyle={styles.buttonPill} text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['NX+WJN'])} onPress={closure} />;
} else {
r5 = value9;
}
return (
<>
{bottomSheet}
{r5}
</>
);
}
function _fun84416() { // fn#84416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11208:1251, offset: 0x01f49cf4, size: 87 bytes, params: 1, frame: 14
return env0_3 != null ? 72 + ((require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? bottom : 0) + env0_3 + bottom : undefined;
}
function _fun84417(a0, a1) { // fn#84417, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11208:1360, offset: 0x01f49d4b, size: 29 bytes, params: 3, frame: 11
if (a1 !== env0_3) {
env0_4(a1);
}
}
function _fun84418() { // fn#84418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11208:1400, offset: 0x01f49d68, size: 50 bytes, params: 1, frame: 12
let value = environment.__proto__;
value = importDefault(11024) /* metro dependency 11024: ForumGuidelinesManager */;
value.markAsSeen(channel.id);
}
function _fun84420() { // fn#84420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11208:1741, offset: 0x01f49ddb, size: 32 bytes, params: 1, frame: 3
return env0_5 ? bottom + 40 + 32 : 0;
}
function _fun84421() { // fn#84421, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11208:1827, offset: 0x01f49dfb, size: 130 bytes, params: 1, frame: 14
const linkUtilsModule = require(4246) /* metro dependency 4246: LinkUtils */;
const value3 = linkUtilsModule.tryParseChannelPath(pathname);
if (env0_7.current) {
env0_7.current = false;
} else if (value3 == null) {
env0_7.current = false;
} else if (value3.channelId === channel.id) {
env0_7.current = false;
} else {
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet(FORUM_GUIDELINES_ACTION_SHEET);
}
}
function _fun84422() { // fn#84422, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11208:1983, offset: 0x01f49e7d, size: 77 bytes, params: 1, frame: 14
let value = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet(FORUM_GUIDELINES_ACTION_SHEET);
value = importDefault(8148) /* metro dependency 8148: ChannelSettingsActionCreators */;
value.open(channel.id);
}
@@ -0,0 +1,50 @@
/* Metro module 11464; source: modules/forums/native/ForumOriginalPoster.tsx; dependencies: [31, 27, 33, 4501, 697, 6235, 4573, 1244, 2] */
function _fun87777(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11650:6, offset: 0x01fcae12, size: 304 bytes, params: 8, frame: 22
var object3;
const env0_0 = require;
const closure = ForumOriginalPoster;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_2 = (require(27) /* metro dependency 27 */).View;
let value = require(33) /* metro dependency 33 */;
const env0_3 = value.jsx;
const env0_4 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object3 = {container: {'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'center'}};
const object4 = {'borderRadius': null, 'marginEnd': 8, 'paddingHorizontal': 4};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object3.opIcon = object4;
const DARK_BRAND_260_LIGHT_BRAND_200 = (require(6235) /* metro dependency 6235: LegacyTokens */).DARK_BRAND_260_LIGHT_BRAND_200;
object3.opIconBackground = {backgroundColor: DARK_BRAND_260_LIGHT_BRAND_200};
const env0_5 = Reflect.apply(createStyles, value, [object3]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumOriginalPoster.tsx');
exports.default = closure;
exports.getForumOriginalPoster = getForumOriginalPoster;
}
function ForumOriginalPoster() { // fn#87778, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11650:393, offset: 0x01fcaf42, size: 288 bytes, params: 1, frame: 27
const styles = useStyles();
const items2 = [styles.opIcon];
items2[1] = styles.opIconBackground;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return (
<View style={styles.container}>
<View style={items2}>
<Text variant="text-xs/semibold" color="text-brand">
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.fyE8sH)}
</Text>
</View>
<Text variant="text-md/semibold" color="mobile-text-heading-primary">
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.uN6Emt)}
</Text>
</View>
);
}
function getForumOriginalPoster() { // fn#87779, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11650:902, offset: 0x01fcb062, size: 23 bytes, params: 1, frame: 13
return <ForumOriginalPoster />;
}
+137
View File
@@ -0,0 +1,137 @@
/* Metro module 11546; source: modules/forums/native/ForumPost.tsx; dependencies: [31, 1379, 3793, 11547, 33, 11548, 11552, 11563, 566, 44, 6896, 9619, 11567, 11568, 9587, 1389, 2] */
function _fun88499(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11732:6, offset: 0x01fe5b34, size: 256 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
const env0_5 = (require(11547) /* metro dependency 11547: ForumChannelStore */).useForumChannelStore;
const value2 = require(33) /* metro dependency 33 */;
const env0_6 = value2.jsx;
const env0_7 = value2.Fragment;
const env0_8 = value2.jsxs;
value = value.memo(_fun88505);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumPost.tsx');
exports.default = value;
exports.ForumPostListDisabled = ForumPostListDisabled;
}
function ForumPostGrid({firstMessage, hasUnreads, isNew, media, parentChannel, thread}) { // fn#88500, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11732:197, offset: 0x01fe5c34, size: 212 bytes, params: 2, frame: 26
return (
<>
{((Component) => <Component thread={thread} hasUnreads={hasUnreads} isNew={isNew} />)(importDefault(11548) /* metro dependency 11548: ForumPostGridHeader */)}
{((Component) => <Component thread={thread} hasUnreads={hasUnreads} media={media} />)(importDefault(11552) /* metro dependency 11552: ForumPostGridBody */)}
{((Component) => <Component thread={thread} firstMessage={firstMessage} hasUnreads={hasUnreads} parentChannel={parentChannel} />)(importDefault(11563) /* metro dependency 11563: ForumPostGridFooter */)}
</>
);
}
function ConnectedForumPost({threadId, style}) { // fn#88501, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11732:608, offset: 0x01fe5d08, size: 863 bytes, params: 2, frame: 32
var r1;
var r0;
const ForumPostPressableContainer = (require(11567) /* metro dependency 11567: ForumPostContainer */).ForumPostPressableContainer;
var value;
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(threadId);
});
(importDefault(44) /* metro dependency 44 */)(channel != null,
'[Forum Post] The thread should not be null here. A store must have missed an update.');
const layoutType = useForumChannelStore(channel.parent_id).layoutType;
const channel2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(parent_id);
});
const {firstMessage,
loaded} = (require(6896) /* metro dependency 6896: ForumPostDataLoader */).useFirstForumPostMessage(channel);
const {isNew, hasUnreads} = (require(9619) /* metro dependency 9619: ForumHooks */).useForumPostReadStates(channel);
const {content,
hasSpoilerEmbeds} = (require(9619) /* metro dependency 9619: ForumHooks */).useForumPostFirstMessageMarkup({firstMessage: firstMessage,
hasUnreads: hasUnreads});
const value6 = (require(9587) /* metro dependency 9587: ForumPostMediaUtils */).useForumPostMediaThumbnail(firstMessage,
channel2, hasSpoilerEmbeds);
const value7 = (require(9587) /* metro dependency 9587: ForumPostMediaUtils */).useFirstMediaIsEmbed(firstMessage,
hasSpoilerEmbeds);
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStoresObject([RelationshipStore],
_fun88504);
const isBlocked = value8.isBlocked;
if (loaded) {
if (isBlocked) {
var forumPostPressableContainerProps = {style: style, threadId: channel.id};
value = importDefault(11568) /* metro dependency 11568: ForumPostList */;
value = <ForumPostPressableContainer {...forumPostPressableContainerProps}>{((Component) => <Component thread={channel} parentChannel={channel2} firstMessage={firstMessage} messageContent={null} media={null} hasUnreads={hasUnreads} isNew={isNew} firstMessageLoaded isLocalDeviceMedia={false} senderModifier={isBlocked ? 'blocked' : 'ignored'} />)(value)}</ForumPostPressableContainer>;
r1 = value;
} else if (value8.isIgnored) {
var forumPostPressableContainerProps = {style: style, threadId: channel.id};
value = importDefault(11568) /* metro dependency 11568: ForumPostList */;
value = <ForumPostPressableContainer {...forumPostPressableContainerProps}>{((Component) => <Component thread={channel} parentChannel={channel2} firstMessage={firstMessage} messageContent={null} media={null} hasUnreads={hasUnreads} isNew={isNew} firstMessageLoaded isLocalDeviceMedia={false} senderModifier={isBlocked ? 'blocked' : 'ignored'} />)(value)}</ForumPostPressableContainer>;
r1 = value;
} else if (layoutType !== (require(1389) /* metro dependency 1389: ForumLayout */).ForumLayout.GRID) {
var forumPostPressableContainerProps = {style: style, threadId: channel.id};
value = importDefault(11568) /* metro dependency 11568: ForumPostList */;
value = <ForumPostPressableContainer {...forumPostPressableContainerProps}>{((Component) => <Component thread={channel} parentChannel={channel2} firstMessage={firstMessage} messageContent={content} media={value6[0]} isEmbed={value7} hasUnreads={hasUnreads} isNew={isNew} firstMessageLoaded={loaded} isLocalDeviceMedia={false} />)(value)}</ForumPostPressableContainer>;
r1 = value;
} else if (value6.length > 0) {
r1 = <ForumPostPressableContainer style={style} threadId={channel.id}><ForumPostGrid thread={channel} media={value6} parentChannel={channel2} firstMessage={firstMessage} hasUnreads={hasUnreads} isNew={isNew} /></ForumPostPressableContainer>;
} else {
var forumPostPressableContainerProps = {style: style, threadId: channel.id};
value = importDefault(11568) /* metro dependency 11568: ForumPostList */;
value = <ForumPostPressableContainer {...forumPostPressableContainerProps}>{((Component) => <Component thread={channel} parentChannel={channel2} firstMessage={firstMessage} messageContent={content} media={value6[0]} isEmbed={value7} hasUnreads={hasUnreads} isNew={isNew} firstMessageLoaded={loaded} isLocalDeviceMedia={false} />)(value)}</ForumPostPressableContainer>;
r1 = value;
}
r0 = r1;
} else {
r0 = null;
}
return r0;
}
function _fun88505(a0) { // fn#88505, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11732:483, offset: 0x01fe60d6, size: 101 bytes, params: 2, frame: 17
const env0_0 = a0;
const channel = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], _fun88506);
const value2 = null;
return value2 == channel ? value2 : <ConnectedForumPost {...a0} />;
}
function ForumPostListDisabled({style, localDeviceMedia, threadId}) { // fn#88507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11732:2214, offset: 0x01fe615b, size: 361 bytes, params: 2, frame: 25
var r0;
var ForumPostDisabledContainer;
var value;
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
let object = [ChannelStore];
const channel = Reflect.apply(useStateFromStores, fluxModule, [object, function() {
return ChannelStore.getChannel(threadId);
}]);
(importDefault(44) /* metro dependency 44 */)(channel != null,
'[Forum Post] The thread should not be null here. A store must have missed an update.');
const channel2 = fluxModule.useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(channel.parent_id);
});
const {firstMessage,
loaded} = (require(6896) /* metro dependency 6896: ForumPostDataLoader */).useFirstForumPostMessage(channel);
const forumHooksModule = require(9619) /* metro dependency 9619: ForumHooks */;
const useForumPostFirstMessageMarkup = forumHooksModule.useForumPostFirstMessageMarkup;
if (loaded) {
ForumPostDisabledContainer = (require(11567) /* metro dependency 11567: ForumPostContainer */).ForumPostDisabledContainer;
object = {style: style};
value = importDefault(11568) /* metro dependency 11568: ForumPostList */;
value = <ForumPostDisabledContainer {...object}>{((Component) => <Component thread={channel} parentChannel={channel2} firstMessage={firstMessage} messageContent={Reflect.apply(useForumPostFirstMessageMarkup,
forumHooksModule, [{firstMessage: firstMessage,
hasUnreads: false}]).content} media={localDeviceMedia} hasUnreads isNew={false} firstMessageLoaded={loaded} isLocalDeviceMedia />)(value)}</ForumPostDisabledContainer>;
r0 = value;
} else {
r0 = null;
}
return r0;
}
function _fun88504() { // fn#88504, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11732:1271, offset: 0x01fe6081, size: 85 bytes, params: 1, frame: 15
return {isBlocked: firstMessage != null && RelationshipStore.isBlockedForMessage(firstMessage),
isIgnored: firstMessage != null && RelationshipStore.isIgnoredForMessage(firstMessage)};
}
function _fun88506() { // fn#88506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11732:540, offset: 0x01fe613b, size: 32 bytes, params: 1, frame: 11
return ChannelStore.getChannel(env0_0.threadId);
}
@@ -0,0 +1,152 @@
/* Metro module 11312; source: modules/forums/native/ForumPostActionBar.tsx; dependencies: [57, 31, 27, 3785, 3786, 1379, 661, 33, 4501, 697, 566, 6896, 1478, 9835, 7701, 11313, 5278, 1244, 4064, 4573, 9216, 4056, 2] */
function _fun86305(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86305, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11498:6, offset: 0x01f8fae6, size: 507 bytes, params: 8, frame: 24
var object2;
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 env0_5 = (require(27) /* metro dependency 27 */).View;
const lurkingStore = importDefault(3785) /* metro dependency 3785: LurkingStore */;
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const env0_9 = (require(661) /* metro dependency 661: Constants */).AnalyticsSections;
let value = require(33) /* metro dependency 33 */;
const env0_10 = value.jsx;
const env0_11 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {};
const BACKGROUND_BASE_LOWER = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWER;
object2.actionBarContainer = {'overflow': 'hidden', 'paddingHorizontal': 12, 'paddingVertical': 8,
'display': 'flex', 'flexDirection': 'row', 'justifyContent': 'space-between', 'alignItems': 'center',
'backgroundColor': null, 'marginBottom': -1, backgroundColor: BACKGROUND_BASE_LOWER};
object2.actionRow = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'flex': 1};
object2.reactionRow = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'flex': 1};
const object4 = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'paddingHorizontal': 8,
'height': 28, 'marginRight': 4, 'borderRadius': null, 'borderWidth': 1};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
let CONTROL_SECONDARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_SECONDARY_BACKGROUND_DEFAULT;
object4.backgroundColor = CONTROL_SECONDARY_BACKGROUND_DEFAULT;
CONTROL_SECONDARY_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CONTROL_SECONDARY_BACKGROUND_DEFAULT;
object4.borderColor = CONTROL_SECONDARY_BACKGROUND_DEFAULT;
object2.actionButton = object4;
object2.actionButtonsContainer = {justifyContent: 'flex-end'};
object2.lastActionButton = {marginRight: 0};
object2.buttonText = {marginLeft: 8};
const env0_12 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumPostActionBar.tsx');
exports.default = _default_86306;
}
function _default_86306({channel}) { // fn#86306, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11498:1034, offset: 0x01f8fce1, size: 1206 bytes, params: 2, frame: 38
var r10;
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
var object;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
var string;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var items4;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
var items5;
const styles = useStyles();
const channel2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(channel.parent_id);
});
const forumPostDataLoaderModule = require(6896) /* metro dependency 6896: ForumPostDataLoader */;
const useFirstForumPostMessage = forumPostDataLoaderModule.useFirstForumPostMessage;
const firstMessage = Reflect.apply(useFirstForumPostMessage, forumPostDataLoaderModule, [channel]).firstMessage;
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([JoinedThreadsStore], function() {
return JoinedThreadsStore.hasJoined(channel.id);
});
const env0_2 = channel.getGuildId();
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([LurkingStore], _fun86309);
const width = (importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)().width;
const env0_3 = width;
const binding = env0_4;
var [property, env0_4] = env0_3(binding.useState(0), 2);
const value6 = binding.useCallback(_fun86310, [width]);
const closure = onPress_86311;
const items2 = [styles.actionBarContainer,
(require(7701) /* metro dependency 7701: ClientThemesOverrides */).useGradientTop()];
const r5 = firstMessage != null && <View style={styles.reactionRow}>{((ForumPostActionBarReactions) => <ForumPostActionBarReactions thread={channel} parentChannel={channel2} firstMessage={firstMessage} containerWidth={property} />)((require(11313) /* metro dependency 11313: ForumPostReactions */).ForumPostActionBarReactions)}</View>;
const items3 = [styles.actionRow];
items3[1] = styles.actionButtonsContainer;
if (value3) {
r10 = !value3;
} else {
object = {accessible: true};
string = intl.string;
if (value2) {
object.accessibilityLabel = Reflect.apply(string, intl, [t.G3ooHD]);
object.style = styles.actionButton;
object.onPress = closure;
items5 = [((CheckmarkLargeIcon) => <CheckmarkLargeIcon size="xs" color="text-brand" />)((require(4064) /* metro dependency 4064: CheckmarkLargeIcon */).CheckmarkLargeIcon)];
string = intl.string;
items5[1] = <Text style={[styles.buttonText]} variant="text-sm/semibold" color="text-brand">{Reflect.apply(string,
intl, [t['OtF+lC']])}</Text>;
object.children = items5;
} else {
object.accessibilityLabel = Reflect.apply(string, intl, [t['DjZ+6E']]);
object.style = styles.actionButton;
object.onPress = closure;
items4 = [((BellIcon) => <BellIcon size="xs" />)((require(9216) /* metro dependency 9216: BellIcon */).BellIcon)];
string = intl.string;
items4[1] = <Text style={styles.buttonText} variant="text-sm/semibold" color="interactive-text-default">{Reflect.apply(string,
intl, [t['0rQinA']])}</Text>;
object.children = items4;
}
r10 = <PressableOpacity {...object} />;
}
string = intl.string;
const WqhZss = (require(1244) /* metro dependency 1244: indexNative */).t.WqhZss;
const items8 = [styles.actionButton];
items8[1] = styles.lastActionButton;
const LinkIcon = (require(4056) /* metro dependency 4056: LinkIcon */).LinkIcon;
return (
<View style={items2}>
{r5}
<View style={items3} onLayout={value6}>
{r10}
<PressableOpacity
accessible
accessibilityLabel={Reflect.apply(string, intl, [WqhZss])}
style={items8}
onPress={onPress_86312}
>
<LinkIcon size="xs" />
</PressableOpacity>
</View>
</View>
);
}
function _fun86309() { // fn#86309, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11498:1290, offset: 0x01f901d7, size: 40 bytes, params: 1, frame: 12
return env0_2 != null && LurkingStore.isLurking(env0_2);
}
function _fun86310({nativeEvent}) { // fn#86310, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11498:1395, offset: 0x01f901ff, size: 51 bytes, params: 2, frame: 11
env0_4(width - nativeEvent.layout.width - 40);
}
function _default_86306OnPress() { // fn#86311, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11498:1454, owner: _default_86306.onPress, offset: 0x01f90232, size: 50 bytes, params: 1, frame: 14
let value = environment.__proto__;
value = require(9835) /* metro dependency 9835: MessagesUtils */;
value.handleToggleFollowForumPost(channel, env0_1);
}
function _default_86306OnPress_86312() { // fn#86312, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11498:2627, owner: _default_86306.onPress, offset: 0x01f90264, size: 91 bytes, params: 1, frame: 16
var value3;
var moduleValue;
const guildId = channel.getGuildId();
if (guildId != null) {
value3 = environment.__proto__;
moduleValue = require(9835) /* metro dependency 9835: MessagesUtils */;
moduleValue.handleCopyLinkForumPost(guildId, channel.id, {section: AnalyticsSections.CHANNEL_HEADER});
}
}
@@ -0,0 +1,104 @@
/* Metro module 12062; source: modules/forums/native/ForumPostPlaceholder.tsx; dependencies: [57, 31, 4502, 33, 4501, 697, 566, 4017, 4504, 6239, 2] */
function _fun92701(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92701, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12248:6, offset: 0x02095478, size: 290 bytes, params: 8, frame: 24
const env0_0 = require;
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 accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const object3 = {};
const PX_64 = (importDefault(697) /* metro dependency 697: native */).space.PX_64;
object3.height = 2 * PX_64;
const PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
object3.marginBottom = PX_12;
const env0_7 = Reflect.apply(createStyles, createStylesModule, [{postPlaceholder: object3}]);
object = {code: 'function ForumPostPlaceholderTsx1(){const{reducedMotion,ROW_OPACITY_END,withDelay,INITIAL_DELAY_MS,withRepeat,withSequence,withTiming,timingConfig}=this.__closure;if(reducedMotion){return{opacity:ROW_OPACITY_END};}return{opacity:withDelay(INITIAL_DELAY_MS,withRepeat(withSequence(withTiming(ROW_OPACITY_END,timingConfig),withTiming(1,timingConfig)),-1,true))};}'};
value = value.memo(_fun92702);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumPostPlaceholder.tsx');
exports.default = value;
}
function _fun92702() { // fn#92702, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12248:635, offset: 0x0209559a, size: 397 bytes, params: 1, frame: 21
var object2;
const styles = useStyles();
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.useReducedMotion;
});
const timingConfig = env0_3(env0_4.useState(_fun92704), 1)[0].timingConfig;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = __92705;
object2 = {reducedMotion: useReducedMotion, ROW_OPACITY_END: 0.55};
object2.withDelay = reanimatedRexportModule.withDelay;
object2.INITIAL_DELAY_MS = 1000;
object2.withRepeat = reanimatedRexportModule.withRepeat;
object2.withSequence = reanimatedRexportModule.withSequence;
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
object2.timingConfig = timingConfig;
closure.__closure = object2;
closure.__workletHash = 9488742940898;
closure.__initData = env0_8;
const value4 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const Card = (require(6239) /* metro dependency 6239: CardNative */).Card;
return (
<View style={value4} pointerEvents="none">
<Card variant="secondary" style={styles.postPlaceholder} />
</View>
);
}
function _fun92704() { // fn#92704, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12248:731, offset: 0x02095727, size: 121 bytes, params: 1, frame: 16
const object = {};
const Math = global.Math;
object.duration = 1000 + 500 * Math.random();
value = environment.__proto__;
const Easing = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing;
const inOut = Easing.inOut;
const Easing2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).Easing;
object.easing = Reflect.apply(inOut, Easing, [Easing2.sin]);
return {timingConfig: object};
}
function __92705() { // fn#92705, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12248:891, offset: 0x020957a0, size: 197 bytes, params: 1, frame: 25
var value2;
var moduleValue;
var withDelay;
var moduleValue2;
var withRepeat;
var moduleValue3;
var withSequence;
var moduleValue4;
var withTiming;
var timingConfigBinding;
var moduleValue5;
var value;
const object2 = {};
if (useReducedMotion) {
object2.opacity = 0.55;
} else {
value2 = environment.__proto__;
moduleValue = require(4017) /* metro dependency 4017: ReanimatedRexport */;
withDelay = moduleValue.withDelay;
moduleValue2 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
withRepeat = moduleValue2.withRepeat;
moduleValue3 = require(4017) /* metro dependency 4017: ReanimatedRexport */;
withSequence = moduleValue3.withSequence;
moduleValue4 = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue4.withTiming;
timingConfigBinding = timingConfig;
value = Reflect.apply(withTiming, moduleValue4, [0.55, timingConfigBinding]);
moduleValue5 = require(4504) /* metro dependency 4504: timing */;
withTiming = moduleValue5.withTiming;
value = Reflect.apply(withSequence, moduleValue3, [value, Reflect.apply(withTiming, moduleValue5, [1,
timingConfigBinding])]);
value = Reflect.apply(withRepeat, moduleValue2, [value, -1, true]);
object2.opacity = Reflect.apply(withDelay, moduleValue, [1000, value]);
}
return object2;
}
@@ -0,0 +1,118 @@
/* Metro module 11161; source: modules/forums/native/ForumPostTagsActionSheet.tsx; dependencies: [57, 31, 27, 6900, 33, 4501, 1244, 6863, 6805, 6758, 11162, 4578, 9621, 4080, 2] */
function _fun85226(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85226, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11347:6, offset: 0x01f67e15, size: 287 bytes, params: 8, frame: 20
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 env0_5 = (require(27) /* metro dependency 27 */).View;
const env0_6 = (require(6900) /* metro dependency 6900: ForumConstants */).MAX_FORUM_POST_TAGS;
const value = require(33) /* metro dependency 33 */;
const env0_7 = value.jsx;
const env0_8 = value.jsxs;
const env0_9 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({tagsContainer: {'display': 'flex',
'flexDirection': 'row', 'flexWrap': 'wrap'}, saveButton: {'marginTop': 8, 'marginHorizontal': 16,
'marginBottom': 16}, subtitle: {marginTop: 4}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumPostTagsActionSheet.tsx');
exports.default = ForumPostTagsActionSheet;
}
function ForumPostTagsActionSheet({thread, parentChannel, canManageThread, onSave, title, tags, onClose}) { // fn#85227, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11347:460, offset: 0x01f67f34, size: 646 bytes, params: 2, frame: 26
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
if (canManageThread !== undefined) {
}
const r9 = title !== undefined ? title : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['436ZFw']);
const styles = useStyles();
const value2 = (require(6863) /* metro dependency 6863: ForumTagHooks */).useAppliedTags(thread);
const binding = undefined;
const useState = binding.useState;
const Set = global.Set;
const r1 = tags ?? value2;
const value3 = Object.create(Set.prototype, {constructor: {value: Set}});
const set = new Set(r1);
const value6 = onClose(Reflect.apply(useState, binding, [set instanceof Object ? set : value3]), 2);
const property = value6[0];
const env0_5 = value6[1];
const env0_6 = property.size >= MAX_FORUM_POST_TAGS;
const value7 = (require(6863) /* metro dependency 6863: ForumTagHooks */).useVisibleForumTags(parentChannel);
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
const object2 = {onDismiss: onDismiss_85229};
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
object2.header = <BottomSheetTitleHeader title={r9} subtitle={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['+HS9+m'])} subtitleStyle={styles.subtitle} />;
const view = <View style={styles.tagsContainer}>{value7.map(_fun85230)}</View>;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
return (
<ActionSheet {...object2}>
{view}
<View style={styles.saveButton}>
<Button
text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['R3BPH+'])}
onPress={onPress_85231}
/>
</View>
</ActionSheet>
);
}
function toggleTag(a0) { // fn#85228, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11347:769, owner: ForumPostTagsActionSheet.toggleTag, offset: 0x01f681ba, size: 105 bytes, params: 2, frame: 13
if (a0 != null) {
var Set = global.Set;
var set = new Set(env0_4);
if (set.has(a0)) {
set.delete(a0);
env0_5(set);
return undefined;
}
if (env0_6) {
return undefined;
}
set.add(a0);
env0_5(set);
}
}
function ForumPostTagsActionSheetOnDismiss() { // fn#85229, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11347:899, owner: ForumPostTagsActionSheet.onDismiss, offset: 0x01f68223, size: 30 bytes, params: 1, frame: 11
return onClose?.();
}
function _fun85230(a0) { // fn#85230, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11347:1101, offset: 0x01f68241, size: 109 bytes, params: 2, frame: 20
const value2 = env0_4.has(a0);
const AvailableForumTag = importDefault(11162) /* metro dependency 11162: AvailableForumTag */;
const canManageThreadBinding = canManageThread;
return (
<AvailableForumTag
tag={a0}
disabled={canManageThreadBinding ? env0_6 && !value2 : !canManageThreadBinding}
onPress={toggleTag}
selected={value2}
key={a0.id}
/>
);
}
function ForumPostTagsActionSheetOnPress() { // fn#85231, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11347:1311, owner: ForumPostTagsActionSheet.onPress, offset: 0x01f682ae, size: 175 bytes, params: 1, frame: 15
var environment;
var value4;
var defaultImport;
var binding;
var items2;
const Array = global.Array;
const value3 = Array.from(env0_4).map(function(a0) {
return a0.id;
});
let onSaveBinding = onSave;
if (onSaveBinding != null) {
onSaveBinding = onSave;
binding = env0_4;
items2 = [];
arraySpread(items2, binding, 0, value3);
onSaveBinding(items2);
} else if (thread != null) {
value4 = environment.__proto__;
defaultImport = importDefault(9621) /* metro dependency 9621: ForumActionCreators */;
defaultImport.updateForumPostTags(thread.id, value3);
}
const value = environment.__proto__;
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
}
@@ -0,0 +1,39 @@
/* Metro module 11090; source: modules/forums/native/ForumTagContextMenu.tsx; dependencies: [33, 3829, 1244, 8772, 6797, 3856, 8811, 2] */
function _fun84910(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84910, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11276:6, offset: 0x01f5be86, size: 116 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumTagContextMenu.tsx');
exports.default = ForumTagContextMenu;
}
function ForumTagContextMenu({tagId, children}) { // fn#84911, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11276:199, offset: 0x01f5befa, size: 209 bytes, params: 2, frame: 20
const DeveloperMode = (require(3829) /* metro dependency 3829: UserSettings */).DeveloperMode;
const value2 = DeveloperMode.useSetting();
const object2 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
object2.label = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['8VG6IY']);
const IdIcon = (require(8772) /* metro dependency 8772: IdIcon */).IdIcon;
object2.IconComponent = IdIcon;
object2.action = action_84912;
const items2 = [object2];
const ContextMenu = (require(8811) /* metro dependency 8811: ContextMenuNative */).ContextMenu;
return (
<ContextMenu
triggerOnLongPress
items={items2}
enabled={value2}
>
{children}
</ContextMenu>
);
}
function ForumTagContextMenuAction() { // fn#84912, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11276:378, owner: ForumTagContextMenu.action, offset: 0x01f5bfcb, size: 67 bytes, params: 1, frame: 14
let value = environment.__proto__;
value = require(6797) /* metro dependency 6797: ClipboardUtilsNative */;
value.copy(tagId);
(require(3856) /* metro dependency 3856: ToastUtils */).presentIdCopied();
}
@@ -0,0 +1,164 @@
/* Metro module 12060; source: modules/forums/native/ForumTagFilterActionSheet.tsx; dependencies: [57, 31, 6540, 11547, 661, 33, 4501, 7155, 4594, 6805, 6758, 1244, 9067, 6277, 6231, 8950, 566, 6739, 1423, 2] */
function _fun92686(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#92686, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12246:6, offset: 0x02094ac6, size: 344 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 emojiStore = importDefault(6540) /* metro dependency 6540: EmojiStore */;
let value = require(11547) /* metro dependency 11547: ForumChannelStore */;
const env0_6 = value.useForumChannelStore;
const env0_7 = value.useForumChannelStoreApi;
value = require(661) /* metro dependency 661: Constants */;
const env0_8 = value.AnalyticsObjects;
const env0_9 = value.AnalyticsPages;
const env0_10 = value.AnalyticsSections;
const env0_11 = (require(33) /* metro dependency 33 */).jsx;
const env0_12 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({emoji: {'height': 18,
'width': 18, 'marginRight': 4, 'display': 'flex', 'alignItems': 'center', 'justifyContent': 'center'},
imageEmoji: {'height': 18, 'width': 18}, textEmoji: {'fontSize': 14, 'lineHeight': 20}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/ForumTagFilterActionSheet.tsx');
exports.default = ForumPostTagsActionSheet_92689;
}
function EmojiIcon({emojiId, emojiName}) { // fn#92687, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12246:471, offset: 0x02094c1e, size: 237 bytes, params: 2, frame: 22
var r6;
var value;
const styles = useStyles();
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([EmojiStore], _fun92688);
const Emoji = importDefault(6739) /* metro dependency 6739: Emoji */;
if (value3 != null) {
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
value = value.getEmojiURL({id: value3.id, animated: value3.animated, size: 18});
r6 = value;
} else {
r6 = undefined;
}
return (
<Emoji
style={styles.emoji}
textEmojiStyle={styles.textEmoji}
fastImageStyle={styles.imageEmoji}
src={r6}
name={emojiName ?? ''}
/>
);
}
function ForumPostTagsActionSheet_92689({channel}) { // fn#92689, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12246:892, offset: 0x02094d33, size: 580 bytes, params: 2, frame: 28
const tagFilter = useForumChannelStore(channel.id).tagFilter;
const env0_1 = useForumChannelStoreApi();
const binding = env0_4;
const useState = binding.useState;
const Set = global.Set;
const value2 = Object.create(Set.prototype, {constructor: {value: Set}});
const set = new Set(tagFilter);
const value5 = env0_3(Reflect.apply(useState, binding, [set instanceof Object ? set : value2]), 2);
const property = value5[0];
var env0_3 = value5[1];
(require(4594) /* metro dependency 4594: useMountEffect */).useUnmountEffect(_fun92690);
const ActionSheet = (require(6805) /* metro dependency 6805: ActionSheetNative */).ActionSheet;
const object3 = {scrollable: true};
const BottomSheetTitleHeader = (require(6758) /* metro dependency 6758: BottomSheetTitleHeaderNative */).BottomSheetTitleHeader;
const object5 = {};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
let string = intl.string;
const TdqRTh = (require(1244) /* metro dependency 1244: indexNative */).t.TdqRTh;
object5.title = Reflect.apply(string, intl, [TdqRTh]);
object5.subtitle = property.size > 0 ? intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['/FzHJK'],
{count: property.size}) : ' ';
const ActionSheetHeaderPressableText = (require(9067) /* metro dependency 9067: ActionSheetHeaderPressableTextNative */).ActionSheetHeaderPressableText;
const object6 = {onPress: onPress_92691};
string = intl.string;
const VkKicb = (require(1244) /* metro dependency 1244: indexNative */).t.VkKicb;
object6.label = Reflect.apply(string, intl, [VkKicb]);
object5.leading = <ActionSheetHeaderPressableText {...object6} />;
object3.header = <BottomSheetTitleHeader {...object5} />;
const BottomSheetScrollView = (require(6277) /* metro dependency 6277 */).BottomSheetScrollView;
const TableRowGroup = (require(6231) /* metro dependency 6231: TableRowGroupNative */).TableRowGroup;
return (
<ActionSheet {...object3}>
<BottomSheetScrollView>
<TableRowGroup hasIcons>
{channel.availableTags.map(_fun92692)}
</TableRowGroup>
</BottomSheetScrollView>
</ActionSheet>
);
}
function _fun92688() { // fn#92688, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12246:560, offset: 0x02094d0b, size: 40 bytes, params: 1, frame: 12
const emojiIdBinding = emojiId;
const value2 = null;
return value2 != emojiIdBinding ? EmojiStore.getUsableCustomEmojiById(emojiId) : value2;
}
function _fun92690() { // fn#92690, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12246:1050, offset: 0x02094f77, size: 46 bytes, params: 1, frame: 13
const state = env0_1.getState();
state.setTagFilter(channel.id, env0_2);
}
function ForumPostTagsActionSheet_92689OnPress() { // fn#92691, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12246:1369, owner: ForumPostTagsActionSheet_92689.onPress, offset: 0x02094fa5, size: 44 bytes, params: 1, frame: 11
const binding = env0_3;
const Set = global.Set;
binding(new Set());
}
function _fun92692(a0) { // fn#92692, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12246:1556, offset: 0x02094fd1, size: 213 bytes, params: 2, frame: 22
const env0_0 = a0;
const TableCheckboxRow = (require(8950) /* metro dependency 8950: TableCheckboxRowNative */).TableCheckboxRow;
const tableCheckboxRowProps = {icon: <EmojiIcon emojiId={a0.emojiId} emojiName={a0.emojiName} />, label: a0.name};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
tableCheckboxRowProps.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t.tXXD6v,
{tagName: a0.name});
const binding = env0_2;
tableCheckboxRowProps.checked = binding.has(a0.id);
tableCheckboxRowProps.onPress = onPress_92693;
return <TableCheckboxRow {...tableCheckboxRowProps} key={a0.id} />;
}
function onPress_92693() { // fn#92693, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:12246:1778, offset: 0x020950a6, size: 279 bytes, params: 1, frame: 19
var Set;
var binding2;
var set;
var has;
var id;
var value4;
var moduleValue;
var trackForumTagFilterClicked;
var object2;
var channelBinding;
const binding = env0_0;
if (binding != null) {
Set = global.Set;
value = environment.__proto__;
binding2 = env1_2;
set = new Set();
has = set.has;
id = binding.id;
if (Reflect.apply(has, set, [id])) {
set.delete(binding.id);
} else {
set.add(binding.id);
}
value4 = environment.__proto__.__proto__;
moduleValue = require(7155) /* metro dependency 7155: Tracking */;
trackForumTagFilterClicked = moduleValue.trackForumTagFilterClicked;
object2 = {};
channelBinding = channel;
object2.guildId = channelBinding.guild_id;
id = channelBinding.id;
object2.channelId = id;
id = binding.id;
object2.tagId = id;
object2.filterTagIds = global.Array.from(set);
has = set.has;
id = binding.id;
object2.added = !Reflect.apply(has, set, [id]);
object2.location = {page: AnalyticsPages.GUILD_CHANNEL, section: AnalyticsSections.FORUM_CHANNEL_HEADER,
object: AnalyticsObjects.CHANNEL_TAG};
Reflect.apply(trackForumTagFilterClicked, moduleValue, [object2]);
env1_3(set);
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,60 @@
/* Metro module 11021; source: modules/forums/native/composer/ForumComposerHeader.tsx; dependencies: [31, 27, 33, 4501, 697, 4805, 5278, 1244, 5312, 6698, 4573, 6686, 2] */
function _fun84410(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84410, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11207:6, offset: 0x01f49033, size: 211 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const env0_3 = value.StyleSheet;
const env0_4 = value.View;
value = require(33) /* metro dependency 33 */;
const env0_5 = value.jsx;
const env0_6 = value.jsxs;
const env0_7 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(_fun84411);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/composer/ForumComposerHeader.tsx');
exports.default = ForumComposerHeader;
}
function _fun84411(a0) { // fn#84411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11207:189, offset: 0x01f49106, size: 205 bytes, params: 2, frame: 17
const object2 = {};
object2.headerBar = {'height': null, 'flexDirection': 'row', 'alignItems': 'center', height: a0};
object2.headerBarContent = {'flexDirection': 'row', 'alignItems': 'center', 'flex': 1};
let PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.headerBarText = {marginHorizontal: PX_16};
const object3 = {};
copyDataProperties(object3, StyleSheet.absoluteFillObject, PX_16);
object3['height'] = StyleSheet.hairlineWidth;
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object3['backgroundColor'] = BORDER_SUBTLE;
object3['top'] = undefined;
object2.headerBarSeparator = object3;
PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
object2.button = {paddingHorizontal: PX_16};
return object2;
}
function ForumComposerHeader({height, title, channel, submitting, onClose, onGuidelinesPress}) { // fn#84412, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11207:555, offset: 0x01f491d3, size: 729 bytes, params: 2, frame: 34
const styles = useStyles(height);
const value3 = (importDefault(4805) /* metro dependency 4805: useChannelName */)(channel);
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const cpT0Cq = (require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq;
const XSmallIcon = (require(5312) /* metro dependency 5312: XSmallIcon */).XSmallIcon;
const items2 = [<PressableOpacity style={styles.button} accessibilityRole="button" accessibilityLabel={Reflect.apply(string,
intl, [cpT0Cq])} disabled={submitting} onPress={function() {
return onClose(false);
}}><XSmallIcon /></PressableOpacity>];
const ForumIcon = (require(6698) /* metro dependency 6698: ForumIcon */).ForumIcon;
const forumIcon = <ForumIcon size="sm" />;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items2[1] = <View style={styles.headerBarContent}>{forumIcon}<View style={styles.headerBarText}><Text lineClamp={1} ellipsizeMode="tail" variant="text-md/semibold" color="mobile-text-heading-primary">{title !== '' ? title : intl.string((require(1244) /* metro dependency 1244: indexNative */).t['7EjFCk'])}</Text><Text variant="text-xs/medium" color="text-default">{value3}</Text></View></View>;
items2[2] = (channel == null ? undefined : channel.topic.length) > 0 ? <PressableOpacity accessibilityRole="button" accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.yR6HwZ)} style={styles.button} onPress={onGuidelinesPress}>{((BookCheckIcon) => <BookCheckIcon />)((require(6686) /* metro dependency 6686: BookCheckIcon */).BookCheckIcon)}</PressableOpacity> : null;
items2[3] = <View style={styles.headerBarSeparator} />;
return (
<View style={styles.headerBar}>
{items2}
</View>
);
}
@@ -0,0 +1,234 @@
/* Metro module 11008; source: modules/forums/native/composer/ForumComposerModal.tsx; dependencies: [31, 27, 10738, 1379, 4645, 4644, 6865, 33, 4501, 697, 1848, 4496, 1244, 7165, 7879, 6771, 566, 9725, 11007, 1482, 1583, 21, 7155, 5286, 11009, 2] */
function _fun84274(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11194:6, offset: 0x01f431ba, size: 338 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const nativeMenuStore = importDefault(10738) /* metro dependency 10738: NativeMenuStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const draftStore = importDefault(4645) /* metro dependency 4645: DraftStore */;
const env0_8 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const uploadAttachmentStore = importDefault(4644) /* metro dependency 4644: UploadAttachmentStore */;
const forumPostMessagesStore = importDefault(6865) /* metro dependency 6865: ForumPostMessagesStore */;
const env0_11 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
const env0_12 = Reflect.apply(createStyles, createStylesModule, [{container: {flex: 1,
backgroundColor: BACKGROUND_BASE_LOW}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/composer/ForumComposerModal.tsx');
exports.default = ForumComposerModal;
}
function clearDraft_84275(a0) { // fn#84275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11194:310, offset: 0x01f4330c, size: 109 bytes, params: 2, frame: 18
const defaultImport = importDefault(7165) /* metro dependency 7165: DraftActionCreators */;
let clearDraft = defaultImport.clearDraft;
const ThreadSettings = DraftType.ThreadSettings;
Reflect.apply(clearDraft, defaultImport, [a0, ThreadSettings]);
let value = defaultImport;
clearDraft = value.clearDraft;
let ChannelMessage = DraftType.ChannelMessage;
Reflect.apply(clearDraft, value, [a0, ChannelMessage]);
value = importDefault(7879) /* metro dependency 7879: UploadAttachmentActionCreators */;
const clearAll = value.clearAll;
ChannelMessage = DraftType.ChannelMessage;
Reflect.apply(clearAll, value, [a0, ChannelMessage]);
}
function ForumComposerModal({parentChannelId, threadId, messageId, isEdit, analyticsLocations}) { // fn#84276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11194:531, offset: 0x01f43379, size: 556 bytes, params: 2, frame: 29
var r0;
let value = undefined;
isEdit = !(isEdit === value) && isEdit;
const styles = useStyles();
analyticsLocations = (importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */)(analyticsLocations).analyticsLocations;
const value4 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(parentChannelId);
}, [parentChannelId]);
const value5 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore], function() {
return ChannelStore.getChannel(threadId);
}, [threadId]);
const value6 = (importDefault(9725) /* metro dependency 9725: useGetThreadDraftSettings */)(parentChannelId);
const value7 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ForumPostMessagesStore],
function() {
var threadIdBinding = threadId;
var value2 = null;
return value2 != threadIdBinding && value2 != messageId ? ForumPostMessagesStore.getMessage(threadId).firstMessage : value2;
});
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([NativeMenuStore], function() {
return NativeMenuStore.isOpen();
});
const closure = onClose_84281;
(require(5286) /* metro dependency 5286: useNavigatorBackPressHandlerNative */).useNavigatorBackPressHandler(function() {
onClose_84281(false);
return true;
});
if (value4 == null) {
r0 = null;
} else if (value4.isForumLikeChannel()) {
if (isEdit) {
if (isEdit) {
if (value7 == null) {
r0 = null;
} else {
const AnalyticsLocationProvider = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
value = <AnalyticsLocationProvider value={analyticsLocations}><View style={styles.container} importantForAccessibility={value8 ? 'no-hide-descendants' : value}>{((Component) => <Component parentChannel={value4} thread={value5} message={value7} threadSettingsDraft={value6} onClose={closure} isEdit={isEdit} />)(importDefault(11009) /* metro dependency 11009: ForumComposer */)}</View></AnalyticsLocationProvider>;
r0 = value;
}
} else {
const AnalyticsLocationProvider2 = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
value = <AnalyticsLocationProvider2 value={analyticsLocations}><View style={styles.container} importantForAccessibility={value8 ? 'no-hide-descendants' : value}>{((Component) => <Component parentChannel={value4} thread={value5} message={value7} threadSettingsDraft={value6} onClose={closure} isEdit={isEdit} />)(importDefault(11009) /* metro dependency 11009: ForumComposer */)}</View></AnalyticsLocationProvider2>;
r0 = value;
}
} else if (value6 == null) {
r0 = null;
} else if (isEdit) {
if (value7 == null) {
r0 = null;
} else {
const AnalyticsLocationProvider3 = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
value = <AnalyticsLocationProvider3 value={analyticsLocations}><View style={styles.container} importantForAccessibility={value8 ? 'no-hide-descendants' : value}>{((Component) => <Component parentChannel={value4} thread={value5} message={value7} threadSettingsDraft={value6} onClose={closure} isEdit={isEdit} />)(importDefault(11009) /* metro dependency 11009: ForumComposer */)}</View></AnalyticsLocationProvider3>;
r0 = value;
}
} else {
const AnalyticsLocationProvider4 = (require(6771) /* metro dependency 6771: useAnalyticsLocations */).AnalyticsLocationProvider;
value = <AnalyticsLocationProvider4 value={analyticsLocations}><View style={styles.container} importantForAccessibility={value8 ? 'no-hide-descendants' : value}>{((Component) => <Component parentChannel={value4} thread={value5} message={value7} threadSettingsDraft={value6} onClose={closure} isEdit={isEdit} />)(importDefault(11009) /* metro dependency 11009: ForumComposer */)}</View></AnalyticsLocationProvider4>;
r0 = value;
}
} else {
r0 = null;
}
return r0;
}
function ForumComposerModalOnClose(a0) { // fn#84281, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11194:971, owner: ForumComposerModal.onClose, offset: 0x01f435f5, size: 704 bytes, params: 2, frame: 25
var environment;
var r9;
var value2;
var value3;
var moduleValue;
var setKeyboardType;
var object2;
var getDraft;
var parentChannelIdBinding;
var ChannelMessage;
var value4;
var threadSettings;
var getThreadDraftWithParentMessageId;
var defaultImport;
var getUploads;
var onConfirm;
var onCancel;
var show;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
var value;
if (env0_4 != null) {
value2 = environment.__proto__;
if (a0) {
(require(11007) /* metro dependency 11007: ForumComposerModalActionCreators */).closeCreateForumPostModal();
clearDraft_84275(parentChannelId);
} else {
value3 = undefined;
moduleValue = require(1482) /* metro dependency 1482: KeyboardUIStoreNative */;
setKeyboardType = moduleValue.setKeyboardType;
object2 = {};
object2.type = (require(1583) /* metro dependency 1583: KeyboardTypes */).KeyboardTypes.SYSTEM;
Reflect.apply(setKeyboardType, moduleValue, [object2]);
getDraft = DraftStore.getDraft;
parentChannelIdBinding = parentChannelId;
ChannelMessage = DraftType.ChannelMessage;
value4 = Reflect.apply(getDraft, DraftStore, [parentChannelIdBinding, ChannelMessage]);
threadSettings = DraftStore.getThreadSettings(parentChannelIdBinding);
if (threadSettings != null) {
r9 = threadSettings;
} else {
getThreadDraftWithParentMessageId = DraftStore.getThreadDraftWithParentMessageId;
defaultImport = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
r9 = Reflect.apply(getThreadDraftWithParentMessageId, DraftStore,
[defaultImport.castChannelIdAsMessageId(parentChannelId)]);
}
getUploads = UploadAttachmentStore.getUploads;
parentChannelIdBinding = parentChannelId;
ChannelMessage = DraftType.ChannelMessage;
if (isEdit) {
(require(11007) /* metro dependency 11007: ForumComposerModalActionCreators */).closeCreateForumPostModal();
clearDraft_84275(parentChannelId);
} else if (value4.length > 0) {
object2 = {onConfirm: onConfirm_84282, onCancel: function() {
require(dependencyMap[18]).closeCreateForumPostModal();
clearDraft_84275(parentChannelId);
}};
onConfirm = object2.onConfirm;
onCancel = object2.onCancel;
value = importAll(1848) /* metro dependency 1848: KeyboardManagerUtils */;
value.dismissGlobalKeyboard();
value = importDefault(4496) /* metro dependency 4496: AlertActionCreators */;
show = value.show;
object2 = {};
object2.title = intl.string(t.Fz1512);
object2.body = intl.string(t.YBgepz);
object2.confirmText = intl.string(t.Rnli6C);
object2.cancelText = intl.string(t['3NnH6V']);
object2.onConfirm = onConfirm;
object2.onCancel = onCancel;
object2.hideActionSheet = true;
object2.isDismissable = true;
Reflect.apply(show, value, [object2]);
} else if (Reflect.apply(getUploads, UploadAttachmentStore, [parentChannelIdBinding,
ChannelMessage]).length > 0) {
object2 = {onConfirm: onConfirm_84282, onCancel: onCancel_84283};
onConfirm = object2.onConfirm;
onCancel = object2.onCancel;
value = importAll(1848) /* metro dependency 1848: KeyboardManagerUtils */;
value.dismissGlobalKeyboard();
value = importDefault(4496) /* metro dependency 4496: AlertActionCreators */;
show = value.show;
object2 = {};
object2.title = intl.string(t.Fz1512);
object2.body = intl.string(t.YBgepz);
object2.confirmText = intl.string(t.Rnli6C);
object2.cancelText = intl.string(t['3NnH6V']);
object2.onConfirm = onConfirm;
object2.onCancel = onCancel;
object2.hideActionSheet = true;
object2.isDismissable = true;
Reflect.apply(show, value, [object2]);
} else if (((r9 == null ? value3 : r9.name) ?? '').length > 0) {
object2 = {onConfirm: onConfirm_84282, onCancel: onCancel_84283};
onConfirm = object2.onConfirm;
onCancel = object2.onCancel;
value = importAll(1848) /* metro dependency 1848: KeyboardManagerUtils */;
value.dismissGlobalKeyboard();
value = importDefault(4496) /* metro dependency 4496: AlertActionCreators */;
show = value.show;
object2 = {};
object2.title = intl.string(t.Fz1512);
object2.body = intl.string(t.YBgepz);
object2.confirmText = intl.string(t.Rnli6C);
object2.cancelText = intl.string(t['3NnH6V']);
object2.onConfirm = onConfirm;
object2.onCancel = onCancel;
object2.hideActionSheet = true;
object2.isDismissable = true;
Reflect.apply(show, value, [object2]);
} else {
(require(11007) /* metro dependency 11007: ForumComposerModalActionCreators */).closeCreateForumPostModal();
clearDraft_84275(parentChannelId);
}
}
}
}
function onCloseOnConfirm() { // fn#84282, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11194:1728, owner: ForumComposerModal.onClose.onConfirm, offset: 0x01f438b5, size: 91 bytes, params: 1, frame: 16
const value = environment.__proto__.__proto__;
(require(7155) /* metro dependency 7155: Tracking */).maybeTrackForumNewPostDraftCreated({guildId: env1_4.guild_id,
channelId: env1_4.id});
(require(11007) /* metro dependency 11007: ForumComposerModalActionCreators */).closeCreateForumPostModal();
}
function onCloseOnCancel() { // fn#84283, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11194:1861, owner: ForumComposerModal.onClose.onCancel, offset: 0x01f43910, size: 53 bytes, params: 1, frame: 12
(require(11007) /* metro dependency 11007: ForumComposerModalActionCreators */).closeCreateForumPostModal();
clearDraft_84275(parentChannelId);
}
@@ -0,0 +1,31 @@
/* Metro module 11007; source: modules/forums/native/composer/ForumComposerModalActionCreators.tsx; dependencies: [7155, 5080, 11008, 1962, 2] */
function _fun84271(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84271, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11193:6, offset: 0x01f43015, size: 116 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/composer/ForumComposerModalActionCreators.tsx');
exports.openCreateForumPostModal = openCreateForumPostModal;
exports.closeCreateForumPostModal = closeCreateForumPostModal;
}
function openCreateForumPostModal(a0) { // fn#84272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11193:246, offset: 0x01f43089, size: 217 bytes, params: 2, frame: 18
require(dependencyMap[0]).trackMobileForumComposerOpened({guildId: a0.guildId, channelId: a0.parentChannelId,
location: a0.analyticsLocationObject});
if (!(a0.isEdit != null && a0.isEdit)) {
require(dependencyMap[0]).trackForumCreateNewPostStarted({guildId: a0.guildId, channelId: a0.parentChannelId});
}
const defaultImport = importDefault(dependencyMap[1]);
const pushLazy = defaultImport.pushLazy;
let value = require(dependencyMap[3]);
value = value(dependencyMap[2], dependencyMap.paths);
Reflect.apply(pushLazy, defaultImport, [value, a0, 'create-forum-post']);
}
function closeCreateForumPostModal() { // fn#84273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11193:560, offset: 0x01f43162, size: 88 bytes, params: 1, frame: 12
const value = a0;
if (!(value !== undefined ? value : false)) {
(require(7155) /* metro dependency 7155: Tracking */).trackMobileForumComposerDismissed();
}
(importDefault(5080) /* metro dependency 5080: ModalActionCreators */).popWithKey('create-forum-post');
}
@@ -0,0 +1,78 @@
/* Metro module 11015; source: modules/forums/native/composer/hooks/ExpressionPickerHandlers.tsx; dependencies: [31, 2] */
function _fun84385(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84385, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11201:6, offset: 0x01f47d2a, size: 119 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importAll(31) /* metro dependency 31 */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/composer/hooks/ExpressionPickerHandlers.tsx');
exports.usePressEmojiHandler = usePressEmojiHandler;
exports.usePressGIFHandler = usePressGIFHandler;
}
function usePressEmojiHandler({selection, draftContent, handleTextChange, focusTextInput, setSelection}) { // fn#84386, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11201:228, offset: 0x01f47da1, size: 144 bytes, params: 2, frame: 18
const binding = selection;
const env0_5 = binding.useRef({selection: selection, draftContent: draftContent, handleTextChange: handleTextChange,
focusTextInput: focusTextInput, setSelection: setSelection});
binding.useEffect(_fun84387);
return binding.useCallback(_fun84388, []);
}
function usePressGIFHandler({selection, draftContent, handleTextChange, focusTextInput, setSelection}) { // fn#84389, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11201:994, offset: 0x01f47f89, size: 120 bytes, params: 2, frame: 18
return selection.useCallback(_fun84390, [draftContent, focusTextInput, handleTextChange, selection.end,
selection.start, setSelection]);
}
function _fun84387() { // fn#84387, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11201:455, offset: 0x01f47e31, size: 64 bytes, params: 1, frame: 4
env0_5.current = {selection: selection, draftContent: draftContent, handleTextChange: handleTextChange,
focusTextInput: focusTextInput, setSelection: setSelection};
}
function _fun84388(a0) { // fn#84388, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11201:568, offset: 0x01f47e71, size: 280 bytes, params: 2, frame: 21
var r9;
var length;
var surrogates;
const {selection, draftContent, handleTextChange, focusTextInput, setSelection} = env0_5.current;
const value = draftContent.substring(0, selection.start);
const value2 = draftContent.substring(selection.end ?? selection.start);
selection.start;
if (a0.id != null) {
r9 = a0.uniqueName == null ? a0.name : a0.uniqueName !== '' ? a0.uniqueName : a0.name;
handleTextChange(value + (':' + r9 + ': ') + value2);
length = (value + (':' + r9 + ': ')).length;
} else {
surrogates = a0.surrogates;
if (surrogates != null) {
surrogates = a0.surrogates;
handleTextChange(value + surrogates + value2);
surrogates = a0.surrogates;
length = (value + surrogates).length;
} else {
r9 = a0.uniqueName == null ? a0.name : a0.uniqueName !== '' ? a0.uniqueName : a0.name;
handleTextChange(value + (':' + r9 + ': ') + value2);
length = (value + (':' + r9 + ': ')).length;
}
}
setSelection({start: length, end: length});
focusTextInput();
}
function _fun84390({url}) { // fn#84390, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11201:1125, offset: 0x01f48001, size: 217 bytes, params: 2, frame: 18
var length;
const draftContentBinding = draftContent;
const substring = draftContentBinding.substring;
const selectionBinding = selection;
const value2 = Reflect.apply(substring, draftContentBinding, [0, selectionBinding.start]);
const value3 = draftContentBinding.substring(selectionBinding.end ?? selection.start);
selection.start;
const value4 = value2.endsWith(' ');
const handleTextChangeBinding = handleTextChange;
if (value4) {
handleTextChangeBinding(value2 + url + value3);
length = (value2 + url).length;
} else {
handleTextChangeBinding(value2 + (' ' + url) + value3);
length = (value2 + (' ' + url)).length;
}
setSelection({start: length, end: length});
focusTextInput();
}
@@ -0,0 +1,105 @@
/* Metro module 11019; source: modules/forums/native/composer/hooks/useBackspaceHandler.tsx; dependencies: [31, 2] */
function _fun84403(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84403, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11205:6, offset: 0x01f48998, size: 124 bytes, params: 8, frame: 17
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importAll(31) /* metro dependency 31 */;
const env0_1 = RegExp('((\\ud83c[\\udde6-\\uddff]){2}|([#*0-9]\\u20e3)|(\\u00a9|\\u00ae|[\\u2000-\\u3300]|[\\ud83c-\\ud83e][\\ud000-\\udfff])((\\ud83c[\\udffb-\\udfff])?(\\ud83e[\\uddb0-\\uddb3])?(\\ufe0f?\\u200d([\\u2000-\\u3300]|[\\ud83c-\\ud83e][\\ud000-\\udfff])\\ufe0f?)?)*)',
'g');
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/composer/hooks/useBackspaceHandler.tsx');
exports.useBackspaceHandler = useBackspaceHandler;
}
function useBackspaceHandler({selection, draftContent, handleTextChange}) { // fn#84404, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11205:457, offset: 0x01f48a14, size: 78 bytes, params: 2, frame: 16
return selection.useCallback(_fun84405, [selection, draftContent, handleTextChange]);
}
function _fun84405() { // fn#84405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11205:557, offset: 0x01f48a62, size: 265 bytes, params: 1, frame: 21
var r3;
var r7;
var r0;
var value2;
var handleTextChangeBinding;
var draftContentBinding;
var substring;
var value3;
var binding;
var test;
var value4;
var value5;
let value = environment;
const {start, end} = selection;
reducibleJoin12: while (true) {
if (start === 0) {
break reducibleJoin12;
}
value2 = 1;
if (end == null) {
r3 = value2;
} else {
if (start !== end) {
handleTextChangeBinding = handleTextChange;
draftContentBinding = draftContent;
substring = draftContentBinding.substring;
value = Reflect.apply(substring, draftContentBinding, [0, start]);
substring = draftContentBinding.substring;
value += Reflect.apply(substring, draftContentBinding, [end]);
handleTextChangeBinding(value);
break reducibleJoin12;
}
r3 = value2;
}
reducibleLoop4: while (true) {
if (start >= r3) {
value3 = environment.__proto__;
binding = env1_1;
test = binding.test;
substring = draftContent.substring;
reducibleJoin6: while (true) {
if (Reflect.apply(test, binding, [Reflect.apply(substring, draftContentBinding, [start - r3,
start])])) {
if (start >= r3 + value2) {
binding = env1_1;
test = binding.test;
draftContentBinding = draftContent;
substring = draftContentBinding.substring;
if (Reflect.apply(test, binding, [Reflect.apply(substring, draftContentBinding,
[start - r3 - value2,
start])])) {
value5 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
r7 = value5;
if (r7 <= 8) {
r3 = r7;
continue reducibleLoop4;
}
r0 = value2;
break reducibleLoop4;
}
r0 = r3;
break reducibleLoop4;
}
r0 = r3;
break reducibleLoop4;
}
break reducibleJoin6;
}
}
value4 = typeof r3 === 'bigint' ? r3 + 1n : +r3 + 1;
r7 = value4;
if (r7 <= 8) {
r3 = r7;
continue reducibleLoop4;
}
r0 = value2;
break reducibleLoop4;
}
handleTextChangeBinding = handleTextChange;
draftContentBinding = draftContent;
substring = draftContentBinding.substring;
value = Reflect.apply(substring, draftContentBinding, [0, start - r0]);
substring = draftContentBinding.substring;
value += Reflect.apply(substring, draftContentBinding, [start]);
handleTextChangeBinding(value);
break reducibleJoin12;
}
}
@@ -0,0 +1,59 @@
/* Metro module 11014; source: modules/forums/native/composer/hooks/useFocusHandlers.tsx; dependencies: [57, 31, 2] */
function _fun84381(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84381, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11200:6, offset: 0x01f47b4f, size: 165 bytes, params: 8, frame: 18
var object2;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_0 = importDefault(57) /* metro dependency 57 */;
const env0_1 = importAll(31) /* metro dependency 31 */;
object2 = {TITLE: 0};
object2[0] = 'TITLE';
object2.CONTENT = 1;
object2[1] = 'CONTENT';
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/composer/hooks/useFocusHandlers.tsx');
exports.PostComposerInputs = object2;
exports.useFocusHandlers = useFocusHandlers;
}
function useFocusHandlers({titleInput, contentInput}) { // fn#84382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11200:323, offset: 0x01f47bf4, size: 122 bytes, params: 2, frame: 14
const binding = contentInput;
const useState = binding.useState;
const TITLE = env0_2.TITLE;
const value = titleInput(Reflect.apply(useState, binding, [TITLE]), 2);
return {setFocusedInput: value[1], focusLastInput: focusLastInput, blurLastInput: blurLastInput,
focusedInput: value[0]};
}
function focusLastInput() { // fn#84383, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11200:465, owner: useFocusHandlers.focusLastInput, offset: 0x01f47c6e, size: 94 bytes, params: 1, frame: 11
var current;
const binding = env0_2;
const TITLE = env1_2.TITLE;
if (TITLE === binding) {
current = titleInput.current;
if (current != null) {
current.focus();
}
} else if (env1_2.CONTENT === binding) {
current = contentInput.current;
if (current != null) {
current.focus();
}
}
}
function blurLastInput() { // fn#84384, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11200:600, owner: useFocusHandlers.blurLastInput, offset: 0x01f47ccc, size: 94 bytes, params: 1, frame: 11
var current;
const binding = env0_2;
const TITLE = env1_2.TITLE;
if (TITLE === binding) {
current = titleInput.current;
if (current != null) {
current.blur();
}
} else if (env1_2.CONTENT === binding) {
current = contentInput.current;
if (current != null) {
current.blur();
}
}
}
@@ -0,0 +1,37 @@
/* Metro module 11016; source: modules/forums/native/composer/hooks/usePressHorizontalAutocompleteItemHandler.tsx; dependencies: [31, 661, 11017, 2] */
function _fun84391(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84391, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11202:6, offset: 0x01f480da, size: 209 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importAll(31) /* metro dependency 31 */;
const AutoCompleteResultTypes = (require(661) /* metro dependency 661: Constants */).AutoCompleteResultTypes;
const Set = global.Set;
const USER = AutoCompleteResultTypes.USER;
const ROLE = AutoCompleteResultTypes.ROLE;
const CHANNEL = AutoCompleteResultTypes.CHANNEL;
const EMOJI = AutoCompleteResultTypes.EMOJI;
const set = new Set([USER, ROLE, CHANNEL, EMOJI]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/composer/hooks/usePressHorizontalAutocompleteItemHandler.tsx');
exports.usePressHorizontalAutocompleteItemHandler = usePressHorizontalAutocompleteItemHandler;
}
function usePressHorizontalAutocompleteItemHandler({draftContent, handleTextChange, setSelection, channel}) { // fn#84392, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11202:345, offset: 0x01f481ab, size: 91 bytes, params: 2, frame: 17
return setSelection.useCallback(_fun84393, [draftContent, handleTextChange, setSelection, channel]);
}
function _fun84393(a0, a1, {length}) { // fn#84393, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11202:480, offset: 0x01f48206, size: 246 bytes, params: 4, frame: 20
let value = environment.__proto__;
value = (require(11017) /* metro dependency 11017: AutocompleteUtils */).getAutocompleteResultText(a0, channel,
env1_3);
const draftContentBinding = draftContent;
const value3 = draftContentBinding.substring(0, a1);
const items = [];
arraySpread(items, value3, 0, undefined);
const value6 = items.reverse().join('').search(RegExp('\\s|\\r|\\n', ''));
let length = value3.length;
const value8 = value3.substring(0, length - value6);
handleTextChange(value8 + value + ' ' + draftContentBinding.substring(a1 + length + 1));
length = (value8 + value).length;
setSelection({start: length, end: length});
}
@@ -0,0 +1,166 @@
/* Metro module 11087; source: modules/forums/native/composer/horizontal_autocomplete/HorizontalAutocomplete.tsx; dependencies: [31, 27, 1938, 1867, 3793, 1878, 661, 33, 4501, 6597, 697, 4017, 4594, 4504, 1305, 4573, 3995, 566, 6794, 6795, 8366, 6647, 4805, 5475, 2] */
function _fun84889(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11273:6, offset: 0x01f5ae43, size: 613 bytes, params: 8, frame: 28
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
let value = require(27) /* metro dependency 27 */;
const StyleSheet = value.StyleSheet;
const env0_3 = value.TouchableOpacity;
const env0_4 = value.View;
const guildRoleStore = importDefault(1938) /* metro dependency 1938: GuildRoleStore */;
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
value = require(661) /* metro dependency 661: Constants */;
const env0_9 = value.ChannelTypes;
const Fonts = value.Fonts;
value = require(33) /* metro dependency 33 */;
const env0_10 = value.jsx;
const env0_11 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {emoji: {'width': 32, 'height': 32}};
object2.emojiImage = {resizeMode: 'contain'};
object2.emojiText = {'lineHeight': 32, 'fontSize': 27, 'textAlign': 'center'};
object2.emojiName = {marginLeft: 8};
const object3 = {};
const textStyles = importDefault(6597) /* metro dependency 6597: TextStyles */;
const PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD;
const TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_DEFAULT;
copyDataProperties(object3, textStyles(PRIMARY_SEMIBOLD, TEXT_DEFAULT, 14), undefined);
object2.nickname = object3;
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object2.status = {backgroundColor: BACKGROUND_BASE_LOW};
const object5 = {'paddingHorizontal': 8, 'flex': 1, 'flexDirection': 'row', 'height': 56, 'alignItems': 'center'};
object5.borderRightWidth = StyleSheet.hairlineWidth;
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object5.borderRightColor = BORDER_SUBTLE;
object2.horizontalAutocompleteOption = object5;
object2.roleIcon = {marginRight: 4};
object2.channelName = {marginLeft: 8};
const env0_12 = Reflect.apply(createStyles, value, [object2]);
object2 = {code: 'function HorizontalAutocompleteTsx1(){const{opacity}=this.__closure;return{opacity:opacity.get()};}'};
object2 = {User: User, Role: Role, Channel: Channel, Emoji: Emoji_84898};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/composer/horizontal_autocomplete/HorizontalAutocomplete.tsx');
exports.default = object2;
}
function HorizontalAutocompleteOption({children, onPress}) { // fn#84890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11273:918, offset: 0x01f5b0a8, size: 236 bytes, params: 2, frame: 22
const styles = useStyles();
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(0);
(importDefault(4594) /* metro dependency 4594: useMountEffect */)(_fun84891);
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = HorizontalAutocompleteOptionC;
closure.__closure = {opacity: value2};
closure.__workletHash = 14159604656069;
closure.__initData = env0_13;
const value3 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<TouchableOpacity onPress={onPress}>
<View style={[styles.horizontalAutocompleteOption, value3]}>
{children}
</View>
</TouchableOpacity>
);
}
function User({user, nick, status, guildId, onPress}) { // fn#84893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11273:1317, offset: 0x01f5b1cd, size: 417 bytes, params: 2, frame: 26
const styles = useStyles();
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
const avatarProps = {status: status, statusStyle: styles.status, user: user};
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
const SMALL = AvatarSizes.SMALL;
avatarProps.size = SMALL;
avatarProps.guildId = guildId;
avatarProps.animate = true;
const avatar = <Avatar {...avatarProps} />;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
const text = <Text style={[styles.nickname]} variant="text-sm/semibold">{nick ?? (importDefault(3995) /* metro dependency 3995: UserUtils */).getName(user)}</Text>;
let value = importDefault(3995) /* metro dependency 3995: UserUtils */;
value = value.getUserTag(user, {decoration: 'never'});
return (
<HorizontalAutocompleteOption onPress={onPress}>
{avatar}
<View style={{'marginLeft': 8, 'height': 56, 'flex': 1, 'flexDirection': 'column',
'justifyContent': 'center'}}>
{text}
<Text variant="text-xs/medium" color="text-muted">
{'@'}
{value}
</Text>
</View>
</HorizontalAutocompleteOption>
);
}
function Role({onPress, guildId, name, id, colorString}) { // fn#84894, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11273:1895, offset: 0x01f5b36e, size: 417 bytes, params: 2, frame: 29
const styles = useStyles();
const role = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildRoleStore], function() {
return GuildRoleStore.getRole(guildId, id);
});
const r16 = role != null ? (require(6794) /* metro dependency 6794: RoleIconUtils */).getRoleIconData(role,
30) : null;
const r6 = r16 != null ? <View style={styles.roleIcon}>{((Component) => <Component name={name} source={r16.customIconSrc != null ? {uri: r16.customIconSrc} : undefined} unicodeEmoji={r16.unicodeEmoji} size={24} />)(importDefault(6795) /* metro dependency 6795: RoleIcon */)}</View> : null;
const LegacyText = (require(1305) /* metro dependency 1305: native */).LegacyText;
return (
<HorizontalAutocompleteOption onPress={onPress}>
{r6}
<LegacyText style={[styles.nickname, colorString != null ? {color: colorString} : undefined]}>
{'@' + name}
</LegacyText>
</HorizontalAutocompleteOption>
);
}
function Channel({channel, onPress}) { // fn#84896, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11273:2388, offset: 0x01f5b52f, size: 329 bytes, params: 2, frame: 22
const styles = useStyles();
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
return GuildStore.getGuild(channel.getGuildId());
}, [channel]);
const type = channel.type;
const GUILD_CATEGORY = ChannelTypes.GUILD_CATEGORY;
const r7 = type === GUILD_CATEGORY ? importDefault(8366) /* metro dependency 8366 */ : (require(6647) /* metro dependency 6647: ChannelUtils */).getChannelIconWithGuild(channel,
value2);
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const icon = <Icon source={r7} />;
const useChannelNameModule = require(4805) /* metro dependency 4805: useChannelName */;
const channelName = useChannelNameModule.computeChannelName(channel, UserStore, RelationshipStore);
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<HorizontalAutocompleteOption onPress={onPress}>
{icon}
<Text style={styles.channelName} variant="text-sm/semibold">
{channelName}
</Text>
</HorizontalAutocompleteOption>
);
}
function Emoji_84898({name, url, surrogates, onPress}) { // fn#84898, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11273:2800, offset: 0x01f5b69d, size: 335 bytes, params: 2, frame: 21
const styles = useStyles();
const view = <View>{url !== '' ? ((Component) => <Component style={[styles.emoji,
styles.emojiImage]} source={{uri: url}} />)(importDefault(5475) /* metro dependency 5475: FastImage */) : ((LegacyText) => <LegacyText style={[styles.emoji,
styles.emojiText]} allowFontScaling={false}>{surrogates}</LegacyText>)((require(1305) /* metro dependency 1305: native */).LegacyText)}</View>;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<HorizontalAutocompleteOption onPress={onPress}>
{view}
<Text style={styles.emojiName} variant="text-sm/semibold">
{':' + name + ':'}
</Text>
</HorizontalAutocompleteOption>
);
}
function _fun84891() { // fn#84891, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11273:1029, offset: 0x01f5b194, size: 57 bytes, params: 1, frame: 14
const binding = env0_0;
const set = binding.set;
let value = environment.__proto__;
value = require(4504) /* metro dependency 4504: timing */;
Reflect.apply(set, binding, [value.withTiming(1)]);
}
@@ -0,0 +1,95 @@
/* Metro module 11083; source: modules/forums/native/composer/horizontal_autocomplete/HorizontalAutocompleteWrapper.tsx; dependencies: [31, 27, 661, 33, 11084, 11087, 4017, 4504, 2] */
function _fun84840(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84840, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11269:6, offset: 0x01f597ba, size: 202 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).FlatList;
const env0_5 = (require(661) /* metro dependency 661: Constants */).AutoCompleteResultTypes;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
object = {code: 'function HorizontalAutocompleteWrapperTsx1(){const{withTiming,toValue}=this.__closure;return{opacity:withTiming(toValue)};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/composer/horizontal_autocomplete/HorizontalAutocompleteWrapper.tsx');
exports.default = HorizontalAutocompleteWrapper;
}
function HorizontalAutocompleteWrapper({style, channel, onPressAutocompleteItem, text, selection}) { // fn#84841, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11269:443, offset: 0x01f59884, size: 414 bytes, params: 2, frame: 24
const {results, autocompleteSelectionStart,
query} = (require(11084) /* metro dependency 11084: useHorizontalAutocompleteResults */).useHorizontalAutocompleteResults({channel: channel,
text: text, selection: selection});
const binding = query;
const value4 = binding.useCallback(_fun84843, [channel.guild_id, binding.useCallback(function(a0, a1) {
a0.stopPropagation();
onPressAutocompleteItem(a1, autocompleteSelectionStart ?? 0, query ?? '');
}, [onPressAutocompleteItem, autocompleteSelectionStart, query])]);
const r12 = results.length > 0 ? 1 : 0;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = HorizontalAutocompleteWrapper_;
closure.__closure = {withTiming: (require(4504) /* metro dependency 4504: timing */).withTiming, toValue: r12};
closure.__workletHash = 7895652904738;
closure.__initData = env0_7;
const value7 = Reflect.apply(useAnimatedStyle, reanimatedRexportModule, [closure]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
return (
<View style={[style, value7]}>
<FlatList
keyboardShouldPersistTaps="always"
horizontal
keyExtractor={function(a0, a1) {
return (0, global.String)(a1);
}}
data={results}
renderItem={value4}
/>
</View>
);
}
function _fun84843({item}) { // fn#84843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11269:785, offset: 0x01f59a6a, size: 402 bytes, params: 2, frame: 18
const type = item.type;
const USER = AutoCompleteResultTypes.USER;
if (USER === type) {
const User = (importDefault(11087) /* metro dependency 11087: HorizontalAutocomplete */).User;
return (
<User
{...item}
{...{['guildId']: channel.guild_id}}
{...{['onPress']: onPress_84844}}
/>
);
}
const ROLE = AutoCompleteResultTypes.ROLE;
if (ROLE === type) {
const Role = (importDefault(11087) /* metro dependency 11087: HorizontalAutocomplete */).Role;
return (
<Role
{...item}
{...{['guildId']: channel.guild_id}}
{...{['onPress']: onPress_84845}}
/>
);
}
const CHANNEL = AutoCompleteResultTypes.CHANNEL;
if (CHANNEL === type) {
const Channel = (importDefault(11087) /* metro dependency 11087: HorizontalAutocomplete */).Channel;
return <Channel {...item} {...{['onPress']: onPress_84846}} />;
}
const EMOJI = AutoCompleteResultTypes.EMOJI;
if (EMOJI === type) {
const Emoji = (importDefault(11087) /* metro dependency 11087: HorizontalAutocomplete */).Emoji;
return <Emoji {...item} {...{['onPress']: onPress_84847}} />;
}
return null;
}
function HorizontalAutocompleteWrapper_() { // fn#84848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11269:1186, owner: HorizontalAutocompleteWrapper._, offset: 0x01f59c17, size: 50 bytes, params: 1, frame: 12
const object2 = {};
const value = environment.__proto__;
object2.opacity = (require(4504) /* metro dependency 4504: timing */).withTiming(env0_5);
return object2;
}
function onPress_84844(a0) { // fn#84844, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11269:880, offset: 0x01f59bfc, size: 27 bytes, params: 2, frame: 13
return env1_4(a0, item);
}
@@ -0,0 +1,239 @@
/* Metro module 11084; source: modules/forums/native/composer/horizontal_autocomplete/hooks/useHorizontalAutocompleteResults.tsx; dependencies: [57, 31, 661, 11085, 676, 566, 2] */
function _fun84850(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#84850, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:6, offset: 0x01f59c5d, size: 165 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(57) /* metro dependency 57 */;
const env0_3 = importAll(31) /* metro dependency 31 */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_4 = constantsModule.AutoCompleteResultTypes;
const env0_5 = constantsModule.ChannelTypes;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/composer/horizontal_autocomplete/hooks/useHorizontalAutocompleteResults.tsx');
exports.useHorizontalAutocompleteResults = useHorizontalAutocompleteResults;
}
function useHorizontalAutocompleteResults({channel, selection, text}) { // fn#84851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:337, offset: 0x01f59d02, size: 454 bytes, params: 2, frame: 23
const env0_2 = text;
const binding = env0_3;
let useState = binding.useState;
const value2 = Reflect.apply(useState, binding, [[]]);
const binding2 = env0_2;
let value = binding2(value2, 2);
const property = value[0];
const env0_4 = value[1];
let useMemo = binding.useMemo;
value = Reflect.apply(useMemo, binding, [_fun84852, [channel]]);
useState = binding.useState;
const value3 = binding2(Reflect.apply(useState, binding, [{text: text, selectionStart: selection.start,
selectionEnd: selection.end}]), 2);
const property2 = value3[0];
const text2 = property2.text;
const selectionStart = property2.selectionStart;
const selectionEnd = property2.selectionEnd;
const env0_9 = value3[1];
binding.useEffect(function() {
var env0_0 = global.setTimeout(_fun84854, 16);
return _fun84855;
}, [text, selection]);
const {autocompleteType, query, queryOptions, autocompleteSelectionStart} = binding.useMemo(_fun84856,
[selectionStart, selectionEnd, text2, value]);
const value5 = binding.useCallback(_fun84858, [autocompleteType, query, queryOptions, value]);
binding.useEffect(_fun84859, [autocompleteType, value5, value]);
binding.useEffect(_fun84862, [value5]);
useMemo = binding.useMemo;
return {results: Reflect.apply(useMemo, binding, [_fun84863, [property]]),
autocompleteSelectionStart: autocompleteSelectionStart, query: query};
}
function _fun84852() { // fn#84852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:468, offset: 0x01f59ec8, size: 49 bytes, params: 1, frame: 14
const value = environment.__proto__;
return (require(11085) /* metro dependency 11085: AutocompleteOptions */).getAutocompleteOptions(channel, false,
false);
}
function _fun84853() { // fn#84853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:664, offset: 0x01f59ef9, size: 41 bytes, params: 1, frame: 14
const env0_0 = global.setTimeout(_fun84854, 16);
return _fun84855;
}
function _fun84856() { // fn#84856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:806, offset: 0x01f59f54, size: 367 bytes, params: 1, frame: 27
var environment;
var r0;
var r5;
var r12;
var r1;
var r3;
var r4;
var length;
var value2;
var value3;
var WHITESPACE_RE;
var test;
var value4;
var slice;
var value5;
var value6;
var toLowerCase;
var value7;
var Object;
var keys;
var value8;
var find;
var value9;
var value10;
var GUILD_FORUM;
var GUILD_MEDIA;
var GUILD_TEXT;
var GUILD_ANNOUNCEMENT;
const selectionStartBinding = selectionStart;
var env0_2;
let textBinding = text;
if (textBinding != null) {
textBinding = text;
length = textBinding.trim().length;
value2 = undefined;
value3 = environment.__proto__;
reducibleJoin9: while (true) {
if (length !== 0) {
r0 = value2;
r5 = value2;
r12 = selectionStartBinding;
reducibleLoop2: while (true) {
WHITESPACE_RE = (require(676) /* metro dependency 676: ConstantsIOS */).WHITESPACE_RE;
test = WHITESPACE_RE.test;
value4 = Reflect.apply(test, WHITESPACE_RE, [text[r12 - 1]]);
if (r12 !== 0) {
reducibleJoin4: while (true) {
if (value4) {
break reducibleJoin4;
}
value10 = typeof r12 === 'bigint' ? r12 - 1n : +r12 - 1;
env0_2 = value10;
if (value10 >= 0) {
r12 = value10;
continue reducibleLoop2;
}
r1 = value10;
r3 = r5;
r4 = r0;
break reducibleLoop2;
}
}
textBinding = text;
slice = textBinding.slice;
reducibleJoin6: while (true) {
if (selectionEnd == null) {
r1 = r12;
break reducibleJoin6;
}
r1 = selectionEnd;
break reducibleJoin6;
}
value5 = Reflect.apply(slice, textBinding, [r12, r1]);
var env0_0 = value5[0];
slice = value5.slice;
value6 = Reflect.apply(slice, value5, [1]);
toLowerCase = value6.toLowerCase;
value7 = Reflect.apply(toLowerCase, value6, []);
var env0_1 = value7;
Object = global.Object;
keys = Object.keys;
value8 = Reflect.apply(keys, Object, [env0_5]);
find = value8.find;
value9 = Reflect.apply(find, value8, [_fun84857]);
if (value9 != null) {
r1 = r12;
r3 = value9;
r4 = value7;
break reducibleLoop2;
}
r0 = value7;
r5 = value9;
value10 = typeof r12 === 'bigint' ? r12 - 1n : +r12 - 1;
env0_2 = value10;
if (value10 >= 0) {
r12 = value10;
continue reducibleLoop2;
}
r1 = value10;
r3 = r5;
r4 = r0;
break reducibleLoop2;
}
GUILD_FORUM = ChannelTypes.GUILD_FORUM;
GUILD_MEDIA = ChannelTypes.GUILD_MEDIA;
GUILD_TEXT = ChannelTypes.GUILD_TEXT;
GUILD_ANNOUNCEMENT = ChannelTypes.GUILD_ANNOUNCEMENT;
return {query: r4, autocompleteType: r3, autocompleteSelectionStart: r1,
queryOptions: {includeEmojiPremiumUpsell: false, channelTypes: [GUILD_FORUM, GUILD_MEDIA,
GUILD_TEXT,
GUILD_ANNOUNCEMENT]}};
}
break reducibleJoin9;
}
}
return {'query': null, 'autocompleteType': null, 'autocompleteSelectionStart': null};
}
function _fun84858(a0) { // fn#84858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:1463, offset: 0x01f5a107, size: 89 bytes, params: 2, frame: 16
var binding;
var property;
if (autocompleteType == null) {
env0_4([]);
} else if (query != null) {
binding = env0_5;
property = binding[autocompleteType];
binding = env0_4;
binding(property.queryResults(query, queryOptions, a0));
} else {
env0_4([]);
}
}
function _fun84859() { // fn#84859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:1568, offset: 0x01f5a160, size: 151 bytes, params: 1, frame: 15
var environment;
var value;
const autocompleteTypeBinding = autocompleteType;
const value2 = null;
const r4 = value2 != autocompleteTypeBinding ? value2 == env0_5 ? undefined : env0_5[autocompleteType].stores : value2;
if (value2 != r4) {
value = environment.__proto__;
new (require(566) /* metro dependency 566: flux */).BatchedStoreListener(r4,
_fun84860).attach('useHorizontalAutocompleteResults');
return _fun84861;
}
}
function _fun84862() { // fn#84862, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:1778, offset: 0x01f5a209, size: 18 bytes, params: 1, frame: 11
env0_13(true);
}
function _fun84863() { // fn#84863, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:1816, offset: 0x01f5a21b, size: 28 bytes, params: 1, frame: 11
return env0_3.filter(_fun84864);
}
function _fun84854() { // fn#84854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:687, offset: 0x01f59f22, size: 50 bytes, params: 1, frame: 12
const binding = env1_9;
const selectionBinding = selection;
binding({text: text, selectionStart: selectionBinding.start, selectionEnd: selectionBinding.end});
}
function _fun84857(a0) { // fn#84857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:1081, offset: 0x01f5a0c3, size: 68 bytes, params: 2, frame: 16
const value = environment.__proto__;
const property = env1_5[a0];
return env0_0 !== undefined && env0_1 !== undefined && property.matches(env0_0, env0_1, selectionStart);
}
function _fun84860() { // fn#84860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:1674, offset: 0x01f5a1f7, size: 18 bytes, params: 1, frame: 11
return env1_13(false);
}
function _fun84864({type}) { // fn#84864, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11270:1830, offset: 0x01f5a237, size: 78 bytes, params: 2, frame: 4
const value = environment.__proto__.__proto__;
const USER = AutoCompleteResultTypes.USER;
let r0 = type === USER || type === AutoCompleteResultTypes.ROLE;
r0 = !r0 ? type === AutoCompleteResultTypes.CHANNEL : r0;
r0 = !r0 ? type === AutoCompleteResultTypes.EMOJI : r0;
return r0;
}
@@ -0,0 +1,27 @@
/* Metro module 9699; source: modules/forums/native/hooks/useCanSearchForumPostsByChannelId.tsx; dependencies: [1379, 3784, 661, 566, 2] */
function _fun76232(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76232, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9885:6, offset: 0x01dc765d, size: 152 bytes, params: 8, frame: 19
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const env0_4 = (require(661) /* metro dependency 661: Constants */).Permissions;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/hooks/useCanSearchForumPostsByChannelId.tsx');
exports.useCanSearchForumPostsByChannelId = function(a0) {
var env0_0 = a0;
return require(dependencyMap[3]).useStateFromStores([ChannelStore, PermissionStore], _fun76234);
};
}
function useCanSearchForumPostsByChannelId(a0) { // fn#76233, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9885:273, offset: 0x01dc76f5, size: 74 bytes, params: 2, frame: 15
const env0_0 = a0;
return (require(566) /* metro dependency 566: flux */).useStateFromStores([ChannelStore, PermissionStore],
_fun76234);
}
function _fun76234() { // fn#76234, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9885:360, offset: 0x01dc773f, size: 61 bytes, params: 1, frame: 14
const value = environment.__proto__;
const channel = ChannelStore.getChannel(env0_0);
return channel != null && PermissionStore.can(Permissions.READ_MESSAGE_HISTORY, channel);
}
@@ -0,0 +1,23 @@
/* Metro module 9722; source: modules/forums/native/hooks/useIsForumChannelSearchActive.tsx; dependencies: [7156, 9699, 566, 2] */
function _fun76377(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#76377, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9908:6, offset: 0x01dcd3e6, size: 114 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const forumSearchStore = importDefault(7156) /* metro dependency 7156: ForumSearchStore */;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/hooks/useIsForumChannelSearchActive.tsx');
exports.useIsForumChannelSearchActive = useIsForumChannelSearchActive;
}
function useIsForumChannelSearchActive(a0) { // fn#76378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9908:233, offset: 0x01dcd458, size: 107 bytes, params: 2, frame: 18
const env0_0 = a0;
const value2 = (require(9699) /* metro dependency 9699: useCanSearchForumPostsByChannelId */).useCanSearchForumPostsByChannelId(a0);
const fluxModule = require(566) /* metro dependency 566: flux */;
const useStateFromStores = fluxModule.useStateFromStores;
return value2 && Reflect.apply(useStateFromStores, fluxModule, [[ForumSearchStore], _fun76379, [a0]]) != null;
}
function _fun76379() { // fn#76379, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9908:360, offset: 0x01dcd4c3, size: 40 bytes, params: 1, frame: 12
const value2 = null;
return value2 != env0_0 ? ForumSearchStore.getSearchQuery(env0_0) : value2;
}
@@ -0,0 +1,256 @@
/* Metro module 11252; source: modules/forums/native/posts/AnimatedCounter.tsx; dependencies: [57, 31, 27, 33, 4501, 44, 4017, 4508, 4577, 4573, 4581, 11253, 2] */
function _fun86002(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86002, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:6, offset: 0x01f83a51, size: 459 bytes, params: 8, frame: 23
var object2;
const env0_0 = require;
const getItemKey = function(a0) {
return '' + a0;
};
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 env0_5 = value2.StyleSheet;
const env0_6 = value2.View;
const value3 = require(33) /* metro dependency 33 */;
const env0_7 = value3.jsx;
const env0_8 = value3.jsxs;
const env0_9 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({container: {'flex': 0,
'flexGrow': 0, 'flexShrink': 0, 'justifyContent': 'flex-start', 'alignItems': 'flex-start',
'overflow': 'hidden'}, hidden: {opacity: 0}});
object2 = {ABOVE: -1};
object2[-1] = 'ABOVE';
object2.NEUTRAL = 0;
object2[0] = 'NEUTRAL';
object2.BELOW = 1;
object2[1] = 'BELOW';
const ABOVE = object2.ABOVE;
const items2 = [ABOVE];
const NEUTRAL = object2.NEUTRAL;
items2[1] = NEUTRAL;
const BELOW = object2.BELOW;
items2[2] = BELOW;
const env0_12 = value.createContext(undefined);
object2 = {code: "function AnimatedCounterTsx1(){const{withSpring,interpolate,animationState,ANIMATION_INPUT,animationOutput,springConfig,state,TransitionStates,runOnJS,cleanUp}=this.__closure;return{transform:[{translateY:withSpring(interpolate(animationState.get(),ANIMATION_INPUT,animationOutput),springConfig,'respect-motion-settings',function(finished){if(finished&&state===TransitionStates.YEETED){runOnJS(cleanUp)();}})}]};}"};
object2 = {code: 'function AnimatedCounterTsx2(finished){const{state,TransitionStates,runOnJS,cleanUp}=this.__closure;if(finished&&state===TransitionStates.YEETED){runOnJS(cleanUp)();}}'};
value = value.memo(_fun86018);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/AnimatedCounter.tsx');
exports.default = value;
}
function getStartPosition({current, previous}) { // fn#86003, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:496, offset: 0x01f83c1c, size: 67 bytes, params: 2, frame: 3
return current > previous ? env0_10.BELOW : current < previous ? env0_10.ABOVE : env0_10.NEUTRAL;
}
function AnimatedCount({count, formatter, state, cleanUp, height, springConfig, textColor, textVariant, textStyle}) { // fn#86004, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:1195, offset: 0x01f83c5f, size: 605 bytes, params: 2, frame: 33
var object2;
const value2 = env0_4.useContext(env0_12);
var env0_4 = value2;
(importDefault(44) /* metro dependency 44 */)(value2 != null, '[AnimatedCount] Context should not be nullish.');
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useSharedValue = reanimatedRexportModule.useSharedValue;
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
const MOUNTED = TransitionStates.MOUNTED;
const value4 = Reflect.apply(useSharedValue, reanimatedRexportModule,
[state === MOUNTED ? env0_10.NEUTRAL : getStartPosition(value2)]);
const value5 = env0_4.useMemo(_fun86005, [height]);
const moduleValue2 = reanimatedRexportModule;
const useAnimatedStyle = moduleValue2.useAnimatedStyle;
const closure = AnimatedCountY;
object2 = {withSpring: (require(4577) /* metro dependency 4577: spring */).withSpring,
interpolate: reanimatedRexportModule.interpolate, animationState: value4, ANIMATION_INPUT: env0_11,
animationOutput: value5, springConfig: springConfig, state: state};
object2.TransitionStates = TransitionStates;
object2.runOnJS = reanimatedRexportModule.runOnJS;
object2.cleanUp = cleanUp;
closure.__closure = object2;
closure.__workletHash = 13513457118386;
closure.__initData = env0_13;
const value6 = Reflect.apply(useAnimatedStyle, moduleValue2, [closure]);
env0_4.useEffect(_fun86009, [value4, value2, state]);
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items2 = [StyleSheet.absoluteFill, value6];
items2[2] = {height: height};
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View style={items2}>
<Text
variant={textVariant}
color={textColor}
style={textStyle}
>
{formatter(count)}
</Text>
</View>
);
}
function AnimatedCounterTransitionGroup({count, formatter, textColor, textVariant, textStyle, springConfig}) { // fn#86011, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:2594, offset: 0x01f84101, size: 538 bytes, params: 2, frame: 31
const env0_3 = textVariant;
const env0_4 = textStyle;
const styles = useStyles();
let binding = env0_4;
let useState = binding.useState;
const value3 = env0_3(Reflect.apply(useState, binding, []), 2);
const property = value3[0];
const env0_7 = value3[1];
binding = env0_4;
useState = binding.useState;
const value5 = env0_3(Reflect.apply(useState, binding, [[count]]), 2);
const property2 = value5[0];
const env0_8 = value5[1];
const env0_9 = env0_4.useRef(property2);
const value6 = env0_4.useRef(count);
env0_4.useEffect(_fun86012, [count]);
const value7 = useAnimationContext(property2, value6);
const value8 = env0_4.useCallback(_fun86015, []);
const value9 = env0_4.useCallback(_fun86016, [formatter, property, springConfig, textColor, textStyle, textVariant]);
const Provider = env0_12.Provider;
const TransitionGroup = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionGroup;
const provider = <Provider value={value7}><TransitionGroup items={property2} renderItem={value9} getItemKey={getItemKey} /></Provider>;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View style={styles.container}>
{provider}
<View style={styles.hidden} onLayout={value8}>
<Text
variant={textVariant}
color={textColor}
style={textStyle}
>
{formatter(count)}
</Text>
</View>
</View>
);
}
function BasicCounter({count, textStyle, textColor, textVariant, formatter}) { // fn#86017, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:3511, offset: 0x01f84449, size: 97 bytes, params: 2, frame: 18
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<Text
variant={textVariant}
color={textColor}
style={textStyle}
>
{formatter(count)}
</Text>
);
}
function _fun86018({count, springConfig, textStyle, animate, textColor, textVariant, formatter = require(dependencyMap[11]).defaultFormatter}) { // fn#86018, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:3673, offset: 0x01f844aa, size: 196 bytes, params: 2, frame: 21
animate = animate === undefined || animate;
textColor = textColor === undefined ? 'text-default' : textColor;
textVariant = textVariant === undefined ? 'text-sm/normal' : textVariant;
return animate ? <AnimatedCounterTransitionGroup count={count} formatter={formatter} springConfig={springConfig} textColor={textColor} textVariant={textVariant} textStyle={textStyle} /> : <BasicCounter count={count} formatter={formatter} textColor={textColor} textVariant={textVariant} textStyle={textStyle} />;
}
function _fun86005() { // fn#86005, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:1521, offset: 0x01f83ebc, size: 28 bytes, params: 1, frame: 11
return env1_11.map(_fun86006);
}
function AnimatedCountY() { // fn#86007, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:1700, owner: AnimatedCount.y, offset: 0x01f83f36, size: 226 bytes, params: 1, frame: 26
const springModule = require(4577) /* metro dependency 4577: spring */;
const withSpring = springModule.withSpring;
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const value4 = reanimatedRexportModule.interpolate(env0_5.get(), env1_11, env0_6);
const springConfigBinding = springConfig;
const closure = yT;
const object = {};
object.state = state;
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
object.TransitionStates = TransitionStates;
object.runOnJS = reanimatedRexportModule.runOnJS;
object.cleanUp = cleanUp;
closure.__closure = object;
closure.__workletHash = 10933954976568;
closure.__initData = env1_14;
return {transform: [{translateY: Reflect.apply(withSpring, springModule, [value4, springConfigBinding,
'respect-motion-settings', closure])}]};
}
function _fun86009() { // fn#86009, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:2345, offset: 0x01f84083, size: 99 bytes, params: 1, frame: 16
var r1;
var value;
const binding = env0_5;
const set = binding.set;
const stateBinding = state;
const TransitionStates = (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates;
const YEETED = TransitionStates.YEETED;
if (stateBinding === YEETED) {
value = getStartPosition(env0_4);
value = -1 * value;
r1 = value;
} else {
r1 = env1_10.NEUTRAL;
}
Reflect.apply(set, binding, [r1]);
}
function _fun86012() { // fn#86012, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:2840, offset: 0x01f8431b, size: 67 bytes, params: 1, frame: 13
const binding = env0_10;
const binding2 = env0_9;
binding.current = binding2.current[0];
const countBinding = count;
binding2.current = [countBinding];
env0_8([countBinding]);
}
function useAnimationContext(a0, a1) { // fn#86013, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:2902, owner: AnimatedCounterTransitionGroup.useAnimationContext, offset: 0x01f8435e, size: 55 bytes, params: 3, frame: 15
const env0_0 = a0;
const env0_1 = a1;
return env1_4.useMemo(_fun86014, [a0, a1]);
}
function _fun86016(a0, a1, a2, a3) { // fn#86016, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:3083, offset: 0x01f843b8, size: 145 bytes, params: 5, frame: 17
return (
<AnimatedCount
formatter={formatter}
springConfig={springConfig ?? (require(4581) /* metro dependency 4581: springPresets */).springStandard}
count={a1}
state={a2}
cleanUp={a3}
height={env0_6}
textColor={textColor}
textVariant={textVariant}
textStyle={textStyle}
key={a0}
/>
);
}
function _fun86006(a0) { // fn#86006, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:1532, offset: 0x01f83ed8, size: 94 bytes, params: 2, frame: 7
const value = environment.__proto__;
const heightBinding = height;
const value2 = 0;
return heightBinding != null ? env2_10.ABOVE === a0 ? -1 * height : env2_10.BELOW === a0 ? height : env2_10.NEUTRAL !== a0 ? undefined : value2 : value2;
}
function yT(a0) { // fn#86008, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:1818, owner: AnimatedCount.y.t, offset: 0x01f84018, size: 107 bytes, params: 2, frame: 13
var r0;
var stateBinding;
var runOnJS;
var value2;
let value = a0;
if (value) {
value = environment.__proto__;
stateBinding = state;
value = environment.__proto__.__proto__;
value = stateBinding === (require(4508) /* metro dependency 4508: TransitionGroup */).TransitionStates.YEETED;
r0 = value;
} else {
r0 = value;
}
if (r0) {
value = environment.__proto__.__proto__;
value = require(4017) /* metro dependency 4017: ReanimatedRexport */;
runOnJS = value.runOnJS;
value2 = environment.__proto__;
Reflect.apply(runOnJS, value, [cleanUp])();
}
}
function _fun86014() { // fn#86014, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11438:2954, offset: 0x01f84395, size: 35 bytes, params: 1, frame: 4
return {current: env0_0[0], previous: require.current};
}
@@ -0,0 +1,10 @@
/* Metro module 11253; source: modules/forums/native/posts/AnimatedCounterUtils.tsx; dependencies: [2] */
function _fun86019(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86019, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11439:6, offset: 0x01f8456e, size: 87 bytes, params: 8, frame: 15
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/AnimatedCounterUtils.tsx');
exports.defaultFormatter = function(a0) {
return '' + a0;
};
}
@@ -0,0 +1,94 @@
/* Metro module 11559; source: modules/forums/native/posts/ForumPostAppliedTags.tsx; dependencies: [31, 27, 33, 4501, 697, 11089, 2] */
function _fun88580(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11745:6, offset: 0x01fe998b, size: 333 bytes, params: 8, frame: 22
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_2 = (require(27) /* metro dependency 27 */).View;
let value = require(33) /* metro dependency 33 */;
const env0_3 = value.jsx;
const env0_4 = value.jsxs;
const env0_5 = value.Fragment;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {pillTagsContainer: {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center'}};
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object2.tag = {backgroundColor: BACKGROUND_SURFACE_HIGH};
object2.tagsContainer = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center'};
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
object2.dot = {'backgroundColor': null, 'height': 4, 'width': 4, 'borderRadius': 10, 'marginHorizontal': 8,
backgroundColor: BORDER_SUBTLE};
const env0_6 = Reflect.apply(createStyles, value, [object2]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/ForumPostAppliedTags.tsx');
exports.ForumPostAppliedTagPills = ForumPostAppliedTagPills;
exports.ForumPostAppliedTags = ForumPostAppliedTags;
}
function ForumPostAppliedTagPills({appliedTags, hasUnreads, additionalTagsCount, containerStyle}) { // fn#88581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11745:608, offset: 0x01fe9ad8, size: 237 bytes, params: 2, frame: 24
additionalTagsCount = additionalTagsCount === undefined ? 0 : additionalTagsCount;
const styles = useStyles();
return (
<View style={[containerStyle, styles.pillTagsContainer]}>
{appliedTags.map(_fun88582)}
{additionalTagsCount > 0 && ((AppliedForumTagPill) => <AppliedForumTagPill tag={{id: '-1',
name: '+' + additionalTagsCount}} containerStyle={styles.tag} hasUnreads={hasUnreads} />)((require(11089) /* metro dependency 11089: AppliedForumTag */).AppliedForumTagPill)}
</View>
);
}
function ForumPostAppliedTags({appliedTags, hasUnreads, additionalTagsCount, containerStyle}) { // fn#88583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11745:991, offset: 0x01fe9c19, size: 288 bytes, params: 2, frame: 27
var r5;
var jsxRuntimeEnv0_5Binding;
var items3;
additionalTagsCount = additionalTagsCount === undefined ? 0 : additionalTagsCount;
const styles = useStyles();
const items2 = [containerStyle];
items2[1] = styles.tagsContainer;
const value2 = appliedTags.map(_fun88584);
const value3 = additionalTagsCount > 0;
if (value3) {
jsxRuntimeEnv0_5Binding = jsxRuntimeEnv0_5;
items3 = [<View style={styles.dot} />];
items3[1] = ((AppliedForumTag) => <AppliedForumTag tag={{id: '-1',
name: '+' + additionalTagsCount}} hasUnreads={hasUnreads} />)((require(11089) /* metro dependency 11089: AppliedForumTag */).AppliedForumTag);
r5 = <>{items3}</>;
} else {
r5 = value3;
}
return (
<View style={items2}>
{value2}
{r5}
</View>
);
}
function _fun88582(a0) { // fn#88582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11745:782, offset: 0x01fe9bc5, size: 84 bytes, params: 2, frame: 17
const AppliedForumTagPill = (require(11089) /* metro dependency 11089: AppliedForumTag */).AppliedForumTagPill;
return (
<AppliedForumTagPill
tag={a0}
containerStyle={styles.tag}
hasUnreads={hasUnreads}
key={a0.id}
/>
);
}
function _fun88584(a0, a1) { // fn#88584, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11745:1157, offset: 0x01fe9d39, size: 158 bytes, params: 3, frame: 21
const value = environment.__proto__;
const jsxRuntimeEnv1_5Binding = jsxRuntimeEnv1_5;
const AppliedForumTag = (require(11089) /* metro dependency 11089: AppliedForumTag */).AppliedForumTag;
return (
<>
<AppliedForumTag
tag={a0}
hasUnreads={hasUnreads}
key={a0.id}
/>
{a1 !== appliedTags.length - 1 && <View style={styles.dot} />}
</>
);
}
@@ -0,0 +1,71 @@
/* Metro module 11567; source: modules/forums/native/posts/ForumPostContainer.tsx; dependencies: [31, 27, 33, 4501, 697, 8142, 4017, 11231, 1357, 6239, 2] */
function _fun88605(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11753:6, offset: 0x01feb11d, size: 361 bytes, params: 8, frame: 23
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const env0_5 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const object = {marginBottom: 12};
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object.backgroundColor = BACKGROUND_BASE_LOW;
object.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.md;
object.overflow = 'hidden';
const env0_6 = Reflect.apply(createStyles, createStylesModule, [{childContainer: {'position': 'relative',
'minHeight': 110, 'padding': 12}, card: {marginBottom: 12}, disabledContainer: object}]);
const createContext = value.createContext;
const reanimatedHelperTypesModule = require(8142) /* metro dependency 8142: ReanimatedHelperTypes */;
const env0_7 = Reflect.apply(createContext, value, [reanimatedHelperTypesModule.createFakeSharedValue(false)]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/ForumPostContainer.tsx');
exports.useForumPostContainerPressedIn = useForumPostContainerPressedIn;
exports.ForumPostPressableContainer = ForumPostPressableContainer;
exports.ForumPostDisabledContainer = ForumPostDisabledContainer;
}
function useForumPostContainerPressedIn() { // fn#88606, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11753:552, offset: 0x01feb286, size: 24 bytes, params: 1, frame: 11
return env0_3.useContext(env0_7);
}
function ForumPostPressableContainer({threadId, children, style}) { // fn#88607, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11753:648, offset: 0x01feb29e, size: 346 bytes, params: 2, frame: 26
const styles = useStyles();
const value2 = (require(4017) /* metro dependency 4017: ReanimatedRexport */).useSharedValue(false);
const {onPressIn, onPressOut} = env0_3.useMemo(function() {
return {onPressIn: _fun88609, onPressOut: _fun88610};
}, [value2]);
const {onTapPost,
onLongTapPost} = (importDefault(11231) /* metro dependency 11231: useNativeForumPostHandlers */)({threadId: threadId});
const r13 = (importDefault(1357) /* metro dependency 1357: MobileVisualRefreshExperiment */)('ForumPostContainer') ? 'surface-high' : 'secondary';
const Card = (require(6239) /* metro dependency 6239: CardNative */).Card;
const view = <View style={styles.card}><Card style={[styles.childContainer,
style]} variant={r13} accessibilityRole="button" onPress={onTapPost} onPressIn={onPressIn} onPressOut={onPressOut} onLongPress={onLongTapPost} unstable_pressDelay={130}>{children}</Card></View>;
const Provider = env0_7.Provider;
return (
<Provider value={value2}>
{view}
</Provider>
);
}
function ForumPostDisabledContainer({children, style}) { // fn#88611, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11753:1246, offset: 0x01feb440, size: 79 bytes, params: 2, frame: 17
const styles = useStyles();
return (
<View style={[styles.disabledContainer, style]} pointerEvents="none">
{children}
</View>
);
}
function _fun88608() { // fn#88608, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11753:770, offset: 0x01feb3f8, size: 30 bytes, params: 1, frame: 3
return {onPressIn: onPressIn_88609, onPressOut: onPressOut_88610};
}
function onPressIn_88609() { // fn#88609, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11753:786, offset: 0x01feb416, size: 21 bytes, params: 1, frame: 11
return env1_0.set(true);
}
function onPressOut_88610() { // fn#88610, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11753:811, offset: 0x01feb42b, size: 21 bytes, params: 1, frame: 11
return env1_0.set(false);
}
@@ -0,0 +1,294 @@
/* Metro module 11555; source: modules/forums/native/posts/ForumPostMedia.tsx; dependencies: [57, 31, 27, 1310, 1309, 33, 4501, 697, 5475, 4564, 11556, 4821, 11557, 477, 4840, 5278, 5263, 5074, 11558, 4002, 3829, 11231, 1477, 2] */
function _fun88553(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88553, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11741:6, offset: 0x01fe7e21, size: 576 bytes, params: 8, frame: 24
var object3;
const env0_0 = require;
const closure = ForumPostMediaSpoiler;
const closure2 = useSharedMediaProps;
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 */;
let value = require(27) /* metro dependency 27 */;
const env0_5 = value.View;
const env0_6 = value.StyleSheet;
const env0_7 = value.ImageBackground;
const PixelRatio = value.PixelRatio;
const themeStore = importDefault(1310) /* metro dependency 1310: ThemeStore */;
const env0_9 = (require(1309) /* metro dependency 1309: FormConstants */).ANDROID_FOREGROUND_RIPPLE;
value = require(33) /* metro dependency 33 */;
const env0_10 = value.jsx;
const env0_11 = value.Fragment;
const env0_12 = value.jsxs;
let Math = global.Math;
let min = Math.min;
let get = PixelRatio.get;
const env0_13 = Reflect.apply(min, Math, [Reflect.apply(get, PixelRatio, []), 4]);
Math = global.Math;
min = Math.min;
get = PixelRatio.get;
const env0_14 = Reflect.apply(min, Math, [Reflect.apply(get, PixelRatio, []), 4]);
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object3 = {mediaContainer: {'position': 'relative', 'overflow': 'hidden'}};
const object4 = {};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
object3.thumbnailBorder = object4;
object3.thumbnail = {'height': 80, 'width': 80};
object3.spoilerIconContainer = {'position': 'absolute', 'top': 0, 'left': 0, 'right': 0, 'bottom': 0,
'justifyContent': 'center'};
const PRIMARY_300 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.PRIMARY_300;
object3.spoilerIcon = {color: PRIMARY_300, alignSelf: 'center'};
object3.gridMediaContainer = {'borderRadius': 2, 'overflow': 'hidden'};
const env0_15 = Reflect.apply(createStyles, value, [object3]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/ForumPostMedia.tsx');
exports.ForumPostMediaSpoiler = closure;
exports.useSharedMediaProps = closure2;
exports.ForumPostMediaThumbnail = ForumPostMediaThumbnail;
exports.ForumPostGridMedia = ForumPostGridMedia;
}
function ForumPostMediaAndroid({shouldSpoiler, blurTheme, source, androidStyle}) { // fn#88554, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11741:702, offset: 0x01fe8061, size: 108 bytes, params: 2, frame: 17
return (
<ImageBackground
style={androidStyle}
source={source}
blurRadius={shouldSpoiler ? 10 : 0}
resizeMode="cover"
>
<ForumPostMediaSpoiler shouldSpoiler={shouldSpoiler} blurTheme={blurTheme} />
</ImageBackground>
);
}
function ForumPostMediaIOS({shouldSpoiler, blurTheme, source, iosStyle}) { // fn#88555, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11741:920, offset: 0x01fe80cd, size: 139 bytes, params: 2, frame: 21
return (
<>
{((Component) => <Component style={iosStyle} source={source} resizeMode="cover" />)(importDefault(5475) /* metro dependency 5475: FastImage */)}
<ForumPostMediaSpoiler shouldSpoiler={shouldSpoiler} blurTheme={blurTheme} />
</>
);
}
function ForumPostMediaSpoiler({shouldSpoiler, blurTheme}) { // fn#88556, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11741:1127, offset: 0x01fe8158, size: 199 bytes, params: 2, frame: 23
var r0;
var jsxRuntimeEnv0_11Binding;
var items2;
var value;
const styles = useStyles();
if (shouldSpoiler) {
jsxRuntimeEnv0_11Binding = jsxRuntimeEnv0_11;
items2 = [((Component) => <Component blurTheme={blurTheme} style={StyleSheet.absoluteFill} />)(importDefault(4564) /* metro dependency 4564: VisualEffectView */)];
var viewBindingProps = {style: styles.spoilerIconContainer};
value = importDefault(11556) /* metro dependency 11556: SpoilerIcon */;
items2[1] = <View {...viewBindingProps}>{((Component) => <Component style={styles.spoilerIcon} height={30} width={30} />)(value)}</View>;
value = <>{items2}</>;
r0 = value;
} else {
r0 = null;
}
return r0;
}
function ForumPostMedia(a0) { // fn#88557, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11741:1375, offset: 0x01fe821f, size: 596 bytes, params: 2, frame: 24
var r0;
var AGE_VERIFICATION_OBSCURABLE_REASONS;
const env0_0 = a0;
const styles = useStyles();
const value2 = env0_4.useRef(null);
const value3 = (require(4821) /* metro dependency 4821: ExplicitMediaRedactionUtils */).useShouldAgeVerifyForReason(a0.obscureReason);
const r8 = a0.isMediaPost ? ((Component) => <Component {...a0} />)(importDefault(11557) /* metro dependency 11557: MediaPostGridThumbnail */) : (require(477) /* metro dependency 477: PlatformUtils */).isAndroid() ? <ForumPostMediaAndroid {...a0} /> : <ForumPostMediaIOS {...a0} />;
if (a0.obscureReason == null) {
r0 = a0.onPress != null ? <View style={[styles.mediaContainer,
a0.containerStyle]} ref={value2}>{((PressableOpacity) => <PressableOpacity androidRippleConfig={ANDROID_FOREGROUND_RIPPLE} activeOpacity={0.8} onPress={onPress_88559}>{r8}</PressableOpacity>)((require(5278) /* metro dependency 5278: Pressables */).PressableOpacity)}</View> : <View style={[styles.mediaContainer,
a0.containerStyle]} ref={value2}>{r8}</View>;
} else {
AGE_VERIFICATION_OBSCURABLE_REASONS = (require(4840) /* metro dependency 4840: ObscureMediaModels */).AGE_VERIFICATION_OBSCURABLE_REASONS;
r0 = AGE_VERIFICATION_OBSCURABLE_REASONS.has(a0.obscureReason) && value3 ? <View style={[styles.mediaContainer,
a0.containerStyle]} ref={value2}>{((PressableOpacity) => <PressableOpacity androidRippleConfig={ANDROID_FOREGROUND_RIPPLE} activeOpacity={0} onPress={function() {
var defaultImport = importDefault(dependencyMap[16]);
var object = {};
object.entryPoint = require(dependencyMap[17]).AgeVerificationModalEntryPoint.FORUM_POST_MEDIA_PREVIEW;
defaultImport.showAgeVerificationGetStartedModal(object);
}}>{r8}</PressableOpacity>)((require(5278) /* metro dependency 5278: Pressables */).PressableOpacity)}</View> : a0.onPress != null ? <View style={[styles.mediaContainer,
a0.containerStyle]} ref={value2}>{((PressableOpacity) => <PressableOpacity androidRippleConfig={ANDROID_FOREGROUND_RIPPLE} activeOpacity={0.8} onPress={onPress_88559}>{r8}</PressableOpacity>)((require(5278) /* metro dependency 5278: Pressables */).PressableOpacity)}</View> : <View style={[styles.mediaContainer,
a0.containerStyle]} ref={value2}>{r8}</View>;
}
return r0;
}
function useSharedMediaProps({channel, media}) { // fn#88560, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11741:2258, offset: 0x01fe84e7, size: 199 bytes, params: 2, frame: 18
var object2;
const messageAttachmentUtilsModule = require(11558) /* metro dependency 11558: MessageAttachmentUtils */;
const useShouldObscure = messageAttachmentUtilsModule.useShouldObscure;
const value3 = env0_3(Reflect.apply(useShouldObscure, messageAttachmentUtilsModule, [{media: media,
channel: channel}]), 2);
object2 = {shouldObscure: value3[0], obscureReason: value3[1]};
const sharedModule = require(4002) /* metro dependency 4002: shared */;
object2.blurTheme = sharedModule.isThemeDark(ThemeStore.theme) ? 'dark' : 'light';
const GifAutoPlay = (require(3829) /* metro dependency 3829: UserSettings */).GifAutoPlay;
object2.format = GifAutoPlay.useSetting() ? null : 'png';
return object2;
}
function ForumPostMediaThumbnail({channel, isLocalDeviceMedia, firstMessageId, media, isEmbed, embedLeftBorderColor, containerStyle}) { // fn#88561, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11741:2718, offset: 0x01fe85ae, size: 413 bytes, params: 2, frame: 27
const styles = useStyles();
const value2 = env0_4.useCallback(function(a0) {
onTapMedia({messageId: firstMessageId, mediaItems: [media], containerRef: a0});
}, [firstMessageId, media,
(importDefault(11231) /* metro dependency 11231: useNativeForumPostHandlers */)({threadId: channel.id}).onTapMedia]);
const {shouldObscure, obscureReason, blurTheme, format} = useSharedMediaProps({channel: channel, media: media});
var env0_4 = format;
const value4 = env0_4.useMemo(_fun88563, [format, isLocalDeviceMedia, media.height, media.src, media.width,
media.srcIsAnimated]);
return (
<ForumPostMedia
iosStyle={styles.thumbnail}
androidStyle={styles.thumbnail}
containerStyle={[styles.thumbnailBorder, isEmbed && ({borderLeftWidth: 2,
borderLeftColor: embedLeftBorderColor}), containerStyle]}
obscureReason={obscureReason}
shouldSpoiler={shouldObscure != null && shouldObscure}
blurTheme={blurTheme}
source={value4}
onPress={value2}
isMediaPost={channel.isMediaPost()}
/>
);
}
function ForumPostGridMedia({channel, media, targetWidth, targetHeight}) { // fn#88564, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11741:3629, offset: 0x01fe8842, size: 298 bytes, params: 2, frame: 25
const styles = useStyles();
const {shouldObscure, obscureReason, blurTheme, format} = useSharedMediaProps({channel: channel, media: media});
const isMediaPost2 = channel.isMediaPost();
const binding = isMediaPost2;
const useMemo = binding.useMemo;
return (
<ForumPostMedia
containerStyle={styles.gridMediaContainer}
iosStyle={{height: targetHeight, width: targetWidth}}
androidStyle={{height: targetHeight, width: targetWidth}}
shouldSpoiler={shouldObscure != null && shouldObscure}
obscureReason={obscureReason}
blurTheme={blurTheme}
source={Reflect.apply(useMemo, binding, [_fun88565, [media.src, media.width, media.height, targetWidth,
targetHeight, format, isMediaPost2]])}
isPortrait={media.height >= media.width}
isMediaPost={isMediaPost2}
/>
);
}
function ForumPostMediaOnPress_88559() { // fn#88559, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11741:2137, owner: ForumPostMedia.onPress, offset: 0x01fe84bc, size: 43 bytes, params: 1, frame: 12
return env0_0.onPress?.(env0_1);
}
function _fun88563() { // fn#88563, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11741:3105, offset: 0x01fe877e, size: 196 bytes, params: 1, frame: 20
var value2;
var moduleValue;
var getSrcWithWidthAndHeight;
var object3;
var mediaBinding;
var Math;
var ceil;
var binding;
const isLocalDeviceMediaBinding = isLocalDeviceMedia;
const object4 = {};
if (isLocalDeviceMediaBinding) {
object4.uri = media.src;
} else {
value2 = environment.__proto__;
moduleValue = require(1477) /* metro dependency 1477: ImageUtils */;
getSrcWithWidthAndHeight = moduleValue.getSrcWithWidthAndHeight;
object3 = {};
mediaBinding = media;
object3.src = mediaBinding.src;
object3.sourceWidth = mediaBinding.width;
object3.sourceHeight = mediaBinding.height;
Math = global.Math;
ceil = Math.ceil;
binding = env1_13;
object3.targetWidth = Reflect.apply(ceil, Math, [80 * binding]);
Math = global.Math;
object3.targetHeight = Math.ceil(80 * binding);
object3.format = format;
object3.animated = mediaBinding.srcIsAnimated;
object4.uri = Reflect.apply(getSrcWithWidthAndHeight, moduleValue, [object3]);
}
return object4;
}
function _fun88565() { // fn#88565, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11741:3852, offset: 0x01fe896c, size: 380 bytes, params: 1, frame: 21
var object4;
var getSrcWithWidthAndHeight;
var mediaBinding;
var width;
var height;
var Math;
var ceil;
var targetWidthBinding;
var binding;
var min;
var value3;
var value4;
var value5;
var value6;
var value7;
var moduleValue2;
var object5;
if (env0_4) {
Math = global.Math;
min = Math.min;
targetWidthBinding = targetWidth;
value3 = environment.__proto__;
binding = env1_14;
value4 = targetWidthBinding * binding;
mediaBinding = media;
width = mediaBinding.width;
value5 = value4 / width;
value6 = targetHeight * binding;
height = mediaBinding.height;
value7 = Reflect.apply(min, Math, [1, value5, value6 / height]);
object4 = {};
moduleValue2 = require(1477) /* metro dependency 1477: ImageUtils */;
getSrcWithWidthAndHeight = moduleValue2.getSrcWithWidthAndHeight;
object5 = {};
object5.src = mediaBinding.src;
width = mediaBinding.width;
object5.sourceWidth = width;
height = mediaBinding.height;
object5.sourceHeight = height;
Math = global.Math;
ceil = Math.ceil;
width = mediaBinding.width;
object5.targetWidth = Reflect.apply(ceil, Math, [width * value7]);
Math = global.Math;
ceil = Math.ceil;
height = mediaBinding.height;
object5.targetHeight = Reflect.apply(ceil, Math, [height * value7]);
object5.format = format;
object4.uri = Reflect.apply(getSrcWithWidthAndHeight, moduleValue2, [object5]);
} else {
object4 = {};
var moduleValue = require(1477) /* metro dependency 1477: ImageUtils */;
getSrcWithWidthAndHeight = moduleValue.getSrcWithWidthAndHeight;
var object6 = {};
mediaBinding = media;
object6.src = mediaBinding.src;
object6.sourceWidth = mediaBinding.width;
object6.sourceHeight = mediaBinding.height;
Math = global.Math;
ceil = Math.ceil;
targetWidthBinding = targetWidth;
binding = env1_14;
object6.targetWidth = Reflect.apply(ceil, Math, [targetWidthBinding * binding]);
Math = global.Math;
object6.targetHeight = Math.ceil(targetHeight * binding);
object6.format = format;
object4.uri = Reflect.apply(getSrcWithWidthAndHeight, moduleValue, [object6]);
}
return object4;
}
@@ -0,0 +1,148 @@
/* Metro module 11570; source: modules/forums/native/posts/ForumPostMessageContent.tsx; dependencies: [57, 31, 27, 33, 4501, 11571, 4584, 8518, 4573, 2] */
function _fun88616(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88616, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11756:6, offset: 0x01febb0d, size: 212 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 env0_5 = (require(27) /* metro dependency 27 */).View;
const env0_6 = (require(33) /* metro dependency 33 */).jsx;
const env0_7 = (require(4501) /* metro dependency 4501: createStyles */).createStyles(function(a0, a1) {
return {text: {alignSelf: 'flex-start'}, container: {'flexWrap': 'wrap', 'flexDirection': 'row',
'alignSelf': 'flex-start', 'rowGap': null, 'maxHeight': null, 'overflow': 'hidden', rowGap: a1,
maxHeight: a0}};
});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/ForumPostMessageContent.tsx');
exports.default = ForumPostMessageContent;
}
function ForumPostMessageContent({messageContent, message, isMessageDeleted, hasUnreads, messageLoaded, lineClamp, rowGap, senderModifier}) { // fn#88618, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11756:421, offset: 0x01febc1a, size: 557 bytes, params: 2, frame: 25
var r0;
var Text;
lineClamp = lineClamp === undefined ? 2 : lineClamp;
rowGap = rowGap === undefined ? 3 : rowGap;
var value;
const value2 = (importDefault(11571) /* metro dependency 11571: useNativeForumPostContent */)({message: message,
messageLoaded: messageLoaded, messageContent: messageContent, isMessageDeleted: isMessageDeleted,
senderModifier: senderModifier});
const content = value2.content;
const style = value2.style;
const env0_3 = style;
const variant = value2.variant;
const env0_4 = variant;
let binding = env0_4;
const [property, env0_6] = env0_3(binding.useState(), 2);
const styles = useStyles(property != null ? property * lineClamp : lineClamp * (require(8518) /* metro dependency 8518: useScaledTextLineHeightAndroid */).scaleTextLineHeight(variant,
(require(4584) /* metro dependency 4584: useFontScale */).useFontScale()), rowGap);
binding = env0_4;
if (binding.useMemo(_fun88619, [content])) {
r0 = <View style={styles.container}>{binding.useMemo(_fun88621, [content, variant, hasUnreads, style, styles,
lineClamp, property, binding.useCallback(_fun88620, [property])])}</View>;
} else {
Text = (require(4573) /* metro dependency 4573: Text */).Text;
value = 'text-muted';
value = <Text variant={variant} color={hasUnreads ? 'text-default' : value} lineClamp={lineClamp} ellipsizeMode="tail" style={[style,
styles.text]}>{content}</Text>;
r0 = value;
}
return r0;
}
function _fun88619() { // fn#88619, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11756:838, offset: 0x01febe47, size: 86 bytes, params: 1, frame: 13
return typeof content !== 'string' && content != null && (global.Array.isArray(content) || env1_4.isValidElement(content));
}
function _fun88620(a0) { // fn#88620, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11756:934, offset: 0x01febe9d, size: 71 bytes, params: 2, frame: 12
var lines;
var height;
if (env0_5 == null) {
lines = a0.nativeEvent.lines;
if (lines != null) {
if (lines.length > 0) {
height = lines[0].height;
if (height > 0) {
env0_6(height);
}
}
}
}
}
function _fun88621() { // fn#88621, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11756:1050, offset: 0x01febee4, size: 58 bytes, params: 1, frame: 12
const Array = global.Array;
const isArray2 = Array.isArray(content);
contentBinding = content;
return isArray2 ? contentBinding.map(_fun88622) : contentBinding;
}
function _fun88622(a0, a1) { // fn#88622, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11756:1078, offset: 0x01febf1e, size: 355 bytes, params: 3, frame: 19
var r0;
var object2;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
var value4;
let value = typeof a0;
if (value === 'string') {
value = environment.__proto__.__proto__;
value = undefined;
object2 = {};
value4 = environment.__proto__;
object2.variant = variant;
r0 = hasUnreads ? 'text-default' : 'text-muted';
object2.color = r0;
object2.style = [style, styles.text];
object2.lineClamp = lineClamp;
object2.ellipsizeMode = 'tail';
r0 = env1_5 == null ? env1_8 : value;
object2.onTextLayout = r0;
return (
<Text {...object2} key={'text-' + a1}>
{global.String(a0)}
</Text>
);
}
if (value === 'number') {
value = environment.__proto__.__proto__;
value = undefined;
object2 = {};
value4 = environment.__proto__;
object2.variant = variant;
r0 = hasUnreads ? 'text-default' : 'text-muted';
object2.color = r0;
object2.style = [style, styles.text];
object2.lineClamp = lineClamp;
object2.ellipsizeMode = 'tail';
r0 = env1_5 == null ? env1_8 : value;
object2.onTextLayout = r0;
return (
<Text {...object2} key={'text-' + a1}>
{global.String(a0)}
</Text>
);
}
if (value === 'boolean') {
value = environment.__proto__.__proto__;
value = undefined;
object2 = {};
value4 = environment.__proto__;
object2.variant = variant;
r0 = hasUnreads ? 'text-default' : 'text-muted';
object2.color = r0;
object2.style = [style, styles.text];
object2.lineClamp = lineClamp;
object2.ellipsizeMode = 'tail';
r0 = env1_5 == null ? env1_8 : value;
object2.onTextLayout = r0;
return (
<Text {...object2} key={'text-' + a1}>
{global.String(a0)}
</Text>
);
}
value = environment.__proto__.__proto__;
const binding = env2_4;
const r4 = binding.isValidElement(a0) && a0.key != null ? 'element-' + a0.key + '-' + a1 : 'element-' + a1;
const Fragment = env2_4.Fragment;
return <Fragment {...{children: a0}} key={r4} />;
}
@@ -0,0 +1,69 @@
/* Metro module 11564; source: modules/forums/native/posts/ForumPostMessageCount.tsx; dependencies: [31, 27, 33, 4501, 697, 477, 9619, 1244, 6682, 4573, 11252, 2] */
function _fun88593(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11750:6, offset: 0x01fea443, size: 368 bytes, params: 8, frame: 26
var object4;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const value = 0;
importAll(dependencyMap[value]);
const env0_3 = (require(27) /* metro dependency 27 */).View;
const value2 = 2;
const value3 = require(dependencyMap[value2]);
const env0_4 = value3.jsx;
const env0_5 = value3.jsxs;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object4 = {};
const object5 = {};
const ICON_MUTED = (importDefault(697) /* metro dependency 697: native */).colors.ICON_MUTED;
object5.tintColor = ICON_MUTED;
object5.marginEnd = 4;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
object5.marginTop = platformUtilsModule.isAndroid() ? value2 : value;
object4.iconRead = object5;
const object6 = {};
const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT;
object6.tintColor = INTERACTIVE_TEXT_DEFAULT;
object6.marginEnd = 4;
const value6 = platformUtilsModule;
object6.marginTop = value6.isAndroid() ? value2 : value;
object4.iconUnread = object6;
object4.messageUnreadCount = {marginStart: 4};
object4.container = {'flexDirection': 'row', 'alignItems': 'center'};
const env0_6 = Reflect.apply(createStyles, createStylesModule, [object4]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/ForumPostMessageCount.tsx');
exports.default = ForumPostMessageCount;
}
function ForumPostMessageCount({thread, hasUnreads, containerStyle}) { // fn#88594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11750:559, offset: 0x01fea5b3, size: 576 bytes, params: 2, frame: 29
var r5;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
var value;
const styles = useStyles();
const {messageCountText, isMaxMessageCount, messageCount,
unreadCount} = (require(9619) /* metro dependency 9619: ForumHooks */).useMessageCount(thread);
const r12 = hasUnreads ? 'text-default' : 'text-muted';
const viewBindingProps = {style: [styles.container, containerStyle]};
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
viewBindingProps.accessibilityLabel = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['8M0DrB'],
{count: messageCountText});
const ChatIcon = (require(6682) /* metro dependency 6682: ChatIcon */).ChatIcon;
const items2 = [<ChatIcon size="xs" style={hasUnreads ? styles.iconUnread : styles.iconRead} color={hasUnreads ? 'interactive-text-default' : 'icon-muted'} />];
items2[1] = isMaxMessageCount ? <Text variant="text-sm/semibold" color={r12}>{messageCountText}</Text> : ((Component) => <Component count={messageCount} textVariant="text-sm/semibold" textColor={r12} animate={false} />)(importDefault(11252) /* metro dependency 11252: AnimatedCounter */);
const value10 = unreadCount != null;
if (value10) {
var textProps = {'variant': 'text-sm/semibold', 'color': 'text-brand', style: styles.messageUnreadCount};
value = intl.format((require(1244) /* metro dependency 1244: indexNative */).t.z3PEth, {count: unreadCount});
value = <Text {...textProps}>{'('}{value}{')'}</Text>;
r5 = value;
} else {
r5 = value10;
}
items2[2] = r5;
return (
<View {...viewBindingProps}>
{items2}
</View>
);
}
@@ -0,0 +1,28 @@
/* Metro module 11561; source: modules/forums/native/posts/ForumPostNewTag.tsx; dependencies: [31, 33, 4501, 697, 1305, 2] */
function _fun88587(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88587, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11747:6, offset: 0x01fe9f5a, size: 200 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_2 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
const BRAND_260 = (importDefault(697) /* metro dependency 697: native */).unsafe_rawColors.BRAND_260;
const env0_3 = Reflect.apply(createStyles, createStylesModule, [{container: {paddingVertical: 1,
backgroundColor: BRAND_260}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/ForumPostNewTag.tsx');
exports.default = ForumPostNewTag;
}
function ForumPostNewTag({containerStyle}) { // fn#88588, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11747:316, offset: 0x01fea022, size: 97 bytes, params: 2, frame: 16
const styles = useStyles();
const NewTag = (require(1305) /* metro dependency 1305: native */).NewTag;
return (
<NewTag
containerStyle={[containerStyle, styles.container]}
variant="text-xs/bold"
color="button-outline-brand-border-active"
/>
);
}
@@ -0,0 +1,36 @@
/* Metro module 11549; source: modules/forums/native/posts/ForumPostPinIcon.tsx; dependencies: [31, 27, 33, 4501, 697, 1305, 11550, 2] */
function _fun88526(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11735:6, offset: 0x01fe6aa1, size: 302 bytes, params: 8, frame: 22
var object3;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const env0_4 = (require(33) /* metro dependency 33 */).jsx;
const createStylesModule = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = createStylesModule.createStyles;
object3 = {};
const object4 = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'center',
'borderRadius': null, 'width': 23, 'height': 23, 'marginEnd': 4};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
object4.backgroundColor = BACKGROUND_BRAND;
object3.pin = object4;
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
object3.pinIcon = {'height': 14, 'width': 14, tintColor: WHITE};
const env0_5 = Reflect.apply(createStyles, createStylesModule, [object3]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/ForumPostPinIcon.tsx');
exports.default = ForumPostPinIcon;
}
function ForumPostPinIcon({containerStyle}) { // fn#88527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11735:508, offset: 0x01fe6bcf, size: 129 bytes, params: 2, frame: 19
const styles = useStyles();
const items2 = [styles.pin, containerStyle];
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
return (
<View style={items2}>
<Icon source={importDefault(11550) /* metro dependency 11550 */} style={styles.pinIcon} />
</View>
);
}
@@ -0,0 +1,32 @@
/* Metro module 11560; source: modules/forums/native/posts/ForumPostTimestamp.tsx; dependencies: [31, 11547, 33, 4501, 9619, 4573, 2] */
function _fun88585(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88585, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11746:6, offset: 0x01fe9dd7, size: 199 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_2 = (require(11547) /* metro dependency 11547: ForumChannelStore */).useForumChannelStore;
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
const env0_4 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({text: {'lineHeight': 18,
'height': 18}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/ForumPostTimestamp.tsx');
exports.default = ForumPostTimestamp;
}
function ForumPostTimestamp({textStyle, thread, hasUnreads, format}) { // fn#88586, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11746:300, offset: 0x01fe9e9e, size: 188 bytes, params: 2, frame: 21
const styles = useStyles();
const value2 = (require(9619) /* metro dependency 9619: ForumHooks */).useLastActiveTimestamp(thread,
useForumChannelStore(thread.parent_id).sortOrder, format);
const r5 = hasUnreads ? 'text-default' : 'text-muted';
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<Text
lineClamp={1}
variant="text-xs/normal"
color={r5}
style={[textStyle, styles.text]}
>
{value2}
</Text>
);
}
@@ -0,0 +1,30 @@
/* Metro module 11562; source: modules/forums/native/posts/ForumPostTitle.tsx; dependencies: [31, 33, 4501, 4573, 2] */
function _fun88589(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11748:6, offset: 0x01fea083, size: 172 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_2 = (require(33) /* metro dependency 33 */).jsx;
const env0_3 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({title: {marginBottom: 6}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/ForumPostTitle.tsx');
exports.default = ForumPostTitle;
}
function ForumPostTitle({title, lineClamp, ellipsizeMode, hasUnreads, onTextLayout}) { // fn#88590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11748:257, offset: 0x01fea12f, size: 139 bytes, params: 2, frame: 20
const styles = useStyles();
const r9 = hasUnreads ? 'mobile-text-heading-primary' : 'text-muted';
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<Text
variant="text-md/semibold"
color={r9}
lineClamp={lineClamp}
ellipsizeMode={ellipsizeMode}
style={styles.title}
onTextLayout={onTextLayout}
>
{title}
</Text>
);
}
@@ -0,0 +1,92 @@
/* Metro module 11565; source: modules/forums/native/posts/ForumPostTypingUsers.tsx; dependencies: [31, 27, 33, 4501, 697, 9619, 11566, 11567, 4017, 1305, 4573, 2] */
function _fun88595(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88595, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11751:6, offset: 0x01fea7f3, size: 458 bytes, params: 8, frame: 23
var object2;
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
let value = require(33) /* metro dependency 33 */;
const env0_4 = value.jsx;
const env0_5 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object2 = {container: {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'flex': 1}};
object2.lastTypingUser = {marginEnd: 0};
const object5 = {'marginEnd': -8, 'borderWidth': 2};
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
object2.typingUser = object5;
const object6 = {'backgroundColor': null, 'paddingVertical': null, 'paddingLeft': 4, 'borderRadius': null,
'marginStart': -8, 'borderWidth': 4, 'marginEnd': 8, 'marginTop': -1, 'marginBottom': -1};
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
object6.backgroundColor = BACKGROUND_BASE_LOWEST;
const PX_4 = (importDefault(697) /* metro dependency 697: native */).space.PX_4;
object6.paddingVertical = PX_4;
object6.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
object2.dots = object6;
object2.typingText = {flexShrink: 1};
const CARD_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CARD_BACKGROUND_DEFAULT;
object2.borderColor = {color: CARD_BACKGROUND_DEFAULT};
const CARD_PRIMARY_PRESSED_BG = (importDefault(697) /* metro dependency 697: native */).colors.CARD_PRIMARY_PRESSED_BG;
object2.borderColorPressed = {color: CARD_PRIMARY_PRESSED_BG};
const env0_6 = Reflect.apply(createStyles, value, [object2]);
object2 = {code: 'function ForumPostTypingUsersTsx1(){const{forumPostPressedIn,borderColorPressed,borderColor}=this.__closure;return{borderColor:forumPostPressedIn.value?borderColorPressed:borderColor};}'};
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/ForumPostTypingUsers.tsx');
exports.default = ForumPostTypingUsers;
}
function ForumPostTypingUsers({thread, typingUserIds, hasUnreads}) { // fn#88596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11751:1003, offset: 0x01fea9bd, size: 546 bytes, params: 2, frame: 26
var r0;
var items2;
const styles = useStyles();
const value2 = (require(9619) /* metro dependency 9619: ForumHooks */).useFacepileUsers(thread, typingUserIds);
const defaultImport = importDefault(11566) /* metro dependency 11566: useTypingText */;
const object2 = {};
object2.channelId = thread.id;
object2.guildId = thread.getGuildId();
object2.typingUserIds = typingUserIds;
const value3 = defaultImport(object2);
const color = styles.borderColor.color;
const color2 = styles.borderColorPressed.color;
const value4 = (require(11567) /* metro dependency 11567: ForumPostContainer */).useForumPostContainerPressedIn();
const reanimatedRexportModule = require(4017) /* metro dependency 4017: ReanimatedRexport */;
const useAnimatedStyle = reanimatedRexportModule.useAnimatedStyle;
const closure = ForumPostTypingUsers_;
closure.__closure = {forumPostPressedIn: value4, borderColorPressed: color2, borderColor: color};
closure.__workletHash = 6320844933544;
closure.__initData = env0_7;
if (thread.getGuildId() == null) {
r0 = null;
} else if (value2.length === 0) {
r0 = null;
} else {
var viewBindingProps = {style: styles.container};
items2 = [value2.map(_fun88598)];
items2[1] = ((View) => <View style={[styles.dots, Reflect.apply(useAnimatedStyle, reanimatedRexportModule,
[closure])]}>{((Ellipsis) => <Ellipsis />)((require(1305) /* metro dependency 1305: native */).Ellipsis)}</View>)((importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View);
items2[2] = ((Text) => <Text variant="text-sm/semibold" color={hasUnreads ? 'text-default' : 'text-muted'} style={styles.typingText} lineClamp={1}>{value3}</Text>)((require(4573) /* metro dependency 4573: Text */).Text);
r0 = <View {...viewBindingProps}>{items2}</View>;
}
return r0;
}
function ForumPostTypingUsers_() { // fn#88597, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11751:1310, owner: ForumPostTypingUsers._, offset: 0x01feabdf, size: 34 bytes, params: 1, frame: 4
return {borderColor: env0_4.value ? color : color};
}
function _fun88598(a0, a1) { // fn#88598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11751:1583, offset: 0x01feac01, size: 212 bytes, params: 3, frame: 23
const View = (importDefault(4017) /* metro dependency 4017: ReanimatedRexport */).View;
const items2 = [styles.typingUser, env0_5];
items2[2] = a1 === env0_1.length - 1 && styles.lastTypingUser;
const Avatar = (require(1305) /* metro dependency 1305: native */).Avatar;
const avatarProps = {source: a0.getAvatarSource(env0_6)};
const AvatarSizes = (require(1305) /* metro dependency 1305: native */).AvatarSizes;
const SIZE_16 = AvatarSizes.SIZE_16;
avatarProps.size = SIZE_16;
return (
<View style={items2} key={a0.id}>
<Avatar {...avatarProps} />
</View>
);
}
@@ -0,0 +1,90 @@
/* Metro module 11551; source: modules/forums/native/posts/ForumPostUsername.tsx; dependencies: [31, 27, 4502, 11547, 33, 4501, 9619, 1389, 11335, 11552, 566, 8206, 1305, 4573, 2] */
function _fun88529(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11737:6, offset: 0x01fe6c96, size: 317 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
const env0_5 = (require(11547) /* metro dependency 11547: ForumChannelStore */).useForumChannelStore;
const value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({authorContainer: {'flexDirection': 'row',
'alignItems': 'center', 'justifyContent': 'center', 'marginEnd': 8}, roleDotContainer: {'alignItems': 'center',
'justifyContent': 'center', 'marginEnd': 2, 'marginBottom': 4}, authorName: {'overflow': 'hidden',
'flexWrap': 'nowrap'}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/ForumPostUsername.tsx');
exports.ForumPostAuthor = ForumPostAuthor;
exports.ForumPostMessageAuthor = ForumPostMessageAuthor;
}
function ForumPostUsername({thread, authorId, authorName, authorColor, authorColors, containerStyle, roleDotStyle, textStyle, suffix, hasUnreads}) { // fn#88530, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11737:446, offset: 0x01fe6dd3, size: 697 bytes, params: 2, frame: 34
var object3;
var items3;
const styles = useStyles();
let object4 = {thread: thread};
const layoutType = useForumChannelStore(object4.thread.parent_id).layoutType;
const ForumLayout = (require(1389) /* metro dependency 1389: ForumLayout */).ForumLayout;
const GRID = ForumLayout.GRID;
let r7 = layoutType !== GRID ? 158 : 72;
const value5 = (importDefault(11335) /* metro dependency 11335: useChatWidth */)();
const GRID_HORIZONTAL_PADDING = (require(11552) /* metro dependency 11552: ForumPostGridBody */).GRID_HORIZONTAL_PADDING;
const value6 = value5 - GRID_HORIZONTAL_PADDING - r7;
const roleStyle = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
function() {
return AccessibilityStore.roleStyle;
});
const r14 = roleStyle !== 'username' ? {} : authorColor != null ? {color: authorColor} : {};
const r17 = hasUnreads ? {} : {opacity: 0.8};
const value7 = (require(8206) /* metro dependency 8206: EnhancedRoleColorUtils */).useProcessColorStringsArray(authorColors);
const enhancedRoleColorUtilsModule = require(8206) /* metro dependency 8206: EnhancedRoleColorUtils */;
const useIsRoleStyleAndRoleColorsEligibleForERC = enhancedRoleColorUtilsModule.useIsRoleStyleAndRoleColorsEligibleForERC;
const guild_id = thread.guild_id;
let r0 = authorId ?? undefined;
if (authorName == null) {
r0 = null;
} else {
object4 = {};
object3 = {maxWidth: value6};
copyDataProperties(object3, styles.authorContainer, roleStyle);
object4.style = [object3, r17, containerStyle];
object4.accessibilityRole = 'button';
r7 = roleStyle === 'dot' && authorColor != null;
r7 = r7 && <View style={[styles.roleDotContainer,
roleDotStyle]}>{((RoleDot) => <RoleDot size="small" color={authorColor} colors={authorColors} />)((require(1305) /* metro dependency 1305: native */).RoleDot)}</View>;
items3 = [r7];
items3[1] = ((Text) => <Text variant="text-sm/semibold" color="mobile-text-heading-primary" gradientColors={Reflect.apply(useIsRoleStyleAndRoleColorsEligibleForERC,
enhancedRoleColorUtilsModule, [guild_id, r0, roleStyle,
value7]) ? value7 : undefined} lineClamp={1} style={[r14, textStyle,
styles.authorName]}>{authorName}{suffix}</Text>)((require(4573) /* metro dependency 4573: Text */).Text);
r0 = <View {...object4}>{items3}</View>;
}
return r0;
}
function ForumPostAuthor({thread, hasUnreads, suffix, containerStyle, roleDotStyle, textStyle}) { // fn#88532, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11737:1517, offset: 0x01fe708c, size: 246 bytes, params: 2, frame: 25
const {user, author} = (require(9619) /* metro dependency 9619: ForumHooks */).useForumPostAuthor(thread);
return user == null ? null : <ForumPostUsername thread={thread} authorId={user?.id} authorName={author?.nick ?? user?.username} authorColor={author?.colorString} authorColors={author?.colorStrings} suffix={suffix} containerStyle={containerStyle} roleDotStyle={roleDotStyle} textStyle={textStyle} hasUnreads={hasUnreads} />;
}
function ForumPostMessageAuthor({thread, message, hasUnreads, suffix, containerStyle, roleDotStyle, textStyle}) { // fn#88533, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11737:2018, offset: 0x01fe7182, size: 188 bytes, params: 2, frame: 24
const {authorName, authorColor, authorColors,
user} = (require(9619) /* metro dependency 9619: ForumHooks */).useForumPostMessageAuthor(message, thread);
return (
<ForumPostUsername
thread={thread}
authorId={user?.id}
authorName={authorName}
authorColor={authorColor}
authorColors={authorColors}
suffix={suffix}
containerStyle={containerStyle}
roleDotStyle={roleDotStyle}
textStyle={textStyle}
hasUnreads={hasUnreads}
/>
);
}
@@ -0,0 +1,250 @@
/* Metro module 11552; source: modules/forums/native/posts/grid/ForumPostGridBody.tsx; dependencies: [57, 31, 27, 33, 4501, 697, 1305, 11553, 11554, 11158, 4573, 1478, 1360, 11555, 6863, 9587, 11559, 2] */
function _fun88534(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88534, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:6, offset: 0x01fe723e, size: 683 bytes, params: 8, frame: 24
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 env0_5 = (require(27) /* metro dependency 27 */).View;
let value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object = {};
const object3 = {'height': 20, 'width': 33, 'backgroundColor': 'black', 'borderRadius': null, 'resizeMode': 'cover'};
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
object.gifIcon = object3;
const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
object.container = {'position': 'relative', 'backgroundColor': null, 'height': 225,
backgroundColor: BACKGROUND_BASE_LOW};
object.wideAspectRatioContainer = {height: 192};
object.mediaIconContainer = {paddingLeft: 6};
object.headerLeftContainer = {'flexDirection': 'row', 'position': 'absolute', 'top': 4, 'left': 4};
object.footerLeftContainer = {'flexDirection': 'row', 'position': 'absolute', 'bottom': 4, 'left': 4,
'alignItems': 'center', 'justifyContent': 'flex-start'};
object.footerRightContainer = {'position': 'absolute', 'bottom': 4, 'right': 4, 'alignItems': 'center',
'justifyContent': 'flex-start'};
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
object.extraMediaCountContainer = {'flexDirection': 'row', 'alignItems': 'center', 'backgroundColor': null,
'height': 24, 'paddingHorizontal': 8, 'borderRadius': 20, backgroundColor: BACKGROUND_SURFACE_HIGH};
object.extraMediaCount = {marginLeft: 2};
const object4 = {'height': 225, 'flexDirection': 'row', 'borderRadius': null, 'overflow': 'hidden'};
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
object.grid = object4;
object.wideAspectRatioGrid = {height: 192};
object.column = {'flex': 1, 'flexDirection': 'column'};
object.columnSpacer = {'flex': 0, 'width': 2, 'height': '100%'};
object.rowSpacer = {'flex': 0, 'height': 2, 'width': '100%'};
const TEXT_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.TEXT_SUBTLE;
object.icon = {color: TEXT_SUBTLE};
const env0_8 = Reflect.apply(createStyles, value, [object]);
object = [[0, 3], [1, 2]];
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/grid/ForumPostGridBody.tsx');
exports.default = ForumPostGridBody;
exports.GRID_HORIZONTAL_PADDING = 48;
}
function GIFIcon() { // fn#88535, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:1244, offset: 0x01fe74e9, size: 119 bytes, params: 1, frame: 18
const styles = useStyles();
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
const Sizes = Icon2.Sizes;
const CUSTOM = Sizes.CUSTOM;
return (
<Icon
size={CUSTOM}
source={importDefault(11553) /* metro dependency 11553 */}
disableColor
style={styles.gifIcon}
/>
);
}
function PlayIcon_88536() { // fn#88536, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:1376, offset: 0x01fe7560, size: 101 bytes, params: 1, frame: 17
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
const Sizes = Icon2.Sizes;
const SMALL_20 = Sizes.SMALL_20;
return (
<Icon
size={SMALL_20}
source={importDefault(11554) /* metro dependency 11554 */}
disableColor
/>
);
}
function ExtraMediaIcon({extraMediaCount}) { // fn#88537, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:1485, offset: 0x01fe75c5, size: 248 bytes, params: 2, frame: 24
const styles = useStyles();
const Icon = (require(1305) /* metro dependency 1305: native */).Icon;
const iconProps = {source: importDefault(11158) /* metro dependency 11158 */, color: styles.icon.color};
const Icon2 = (require(1305) /* metro dependency 1305: native */).Icon;
const Sizes = Icon2.Sizes;
const REFRESH_SMALL_16 = Sizes.REFRESH_SMALL_16;
iconProps.size = REFRESH_SMALL_16;
const icon = <Icon {...iconProps} />;
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<View style={styles.extraMediaCountContainer}>
{icon}
<Text
style={styles.extraMediaCount}
lineClamp={1}
variant="text-xs/normal"
color="text-default"
>
{'+' + extraMediaCount}
</Text>
</View>
);
}
function MediaGridColumn({column, thread}) { // fn#88538, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:1829, offset: 0x01fe76bd, size: 123 bytes, params: 2, frame: 18
const styles = useStyles();
return (
<View style={styles.column}>
{column.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish).map(_fun88539)}
</View>
);
}
function ForumPostGridBody({thread, hasUnreads, media}) { // fn#88540, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:2255, offset: 0x01fe780b, size: 653 bytes, params: 2, frame: 31
var items4;
const styles = useStyles();
const value3 = env0_3((require(6863) /* metro dependency 6863: ForumTagHooks */).useSomeAppliedTags(thread, 2), 2);
const property = value3[0];
const property2 = value3[1];
const value4 = property.length > 0;
const Math = global.Math;
const value5 = Math.max(0, media.length - 4);
const isMediaPost2 = thread.isMediaPost();
const value6 = useMediaGridLayout(media, isMediaPost2);
const {containsVideo, containsGif} = env0_4.useMemo(_fun88549, [media]);
const items2 = [styles.container];
items2[1] = isMediaPost2 && styles.wideAspectRatioContainer;
const items3 = [<View style={[styles.grid,
isMediaPost2 && styles.wideAspectRatioGrid]}>{value6.map(_fun88550)}</View>];
items3[1] = value4 && <View style={styles.footerLeftContainer}>{((ForumPostAppliedTagPills) => <ForumPostAppliedTagPills appliedTags={property} additionalTagsCount={property2} hasUnreads={hasUnreads} />)((require(11559) /* metro dependency 11559: ForumPostAppliedTags */).ForumPostAppliedTagPills)}</View>;
let r6 = containsGif || containsVideo;
if (r6) {
var viewBinding4Props = {style: styles.headerLeftContainer};
items4 = [containsGif && <View style={styles.mediaIconContainer}><GIFIcon /></View>];
items4[1] = containsVideo && <View style={styles.mediaIconContainer}><PlayIcon_88536 /></View>;
r6 = <View {...viewBinding4Props}>{items4}</View>;
}
items3[2] = r6;
items3[3] = value5 !== 0 && <View style={styles.footerRightContainer}><ExtraMediaIcon extraMediaCount={value5} /></View>;
return (
<View style={items2}>
{items3}
</View>
);
}
function _fun88539(a0, a1) { // fn#88539, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:1962, offset: 0x01fe7738, size: 211 bytes, params: 3, frame: 22
const Fragment = env1_4.Fragment;
const r1 = a1 > 0 && <View style={styles.rowSpacer} />;
const ForumPostGridMedia = (require(11555) /* metro dependency 11555: ForumPostMedia */).ForumPostGridMedia;
const threadBinding = thread;
return (
<Fragment key={'' + threadBinding.id + '-' + a1}>
{r1}
<ForumPostGridMedia
channel={threadBinding}
media={a0.media}
targetWidth={a0.targetWidth}
targetHeight={a0.targetHeight}
/>
</Fragment>
);
}
function useMediaGridLayout(a0, a1) { // fn#88541, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:2441, owner: ForumPostGridBody.useMediaGridLayout, offset: 0x01fe7a98, size: 128 bytes, params: 3, frame: 17
const env0_0 = a0;
const env0_1 = a1;
return env1_4.useMemo(_fun88546,
[(importDefault(1478) /* metro dependency 1478: useWindowDimensionsNative */)().width, env1_4.useMemo(_fun88542,
[a0]), a1]);
}
function _fun88549() { // fn#88549, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:2927, offset: 0x01fe7ccf, size: 45 bytes, params: 1, frame: 11
let value = environment.__proto__;
value = require(9587) /* metro dependency 9587: ForumPostMediaUtils */;
return value.messageContainsGifOrVideo(media);
}
function _fun88550(a0, a1) { // fn#88550, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:3142, offset: 0x01fe7cfc, size: 157 bytes, params: 3, frame: 21
const Fragment = env1_4.Fragment;
return (
<Fragment key={'' + a0 + '-' + a1}>
{a1 > 0 && <View style={styles.columnSpacer} />}
<MediaGridColumn column={a0} thread={thread} />
</Fragment>
);
}
function _fun88542() { // fn#88542, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:2510, offset: 0x01fe7b18, size: 92 bytes, params: 1, frame: 14
const Math = global.Math;
let value = Math.min(env0_0.length, 2);
value = env2_9.slice(0, value);
value = value.map(function(a0) {
return a0.map(_fun88544).filter(require(dependencyMap[12]).isNotNullish);
});
return value.filter(function(a0) {
return a0.length > 0;
});
}
function _fun88546() { // fn#88546, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:2668, offset: 0x01fe7bc5, size: 45 bytes, params: 1, frame: 12
const env0_0 = require ? 192 : 225;
return env0_3.map(_fun88547);
}
function _fun88543(a0) { // fn#88543, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:2567, offset: 0x01fe7b74, size: 65 bytes, params: 2, frame: 13
const value = a0.map(_fun88544);
return value.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
}
function _fun88547(a0) { // fn#88547, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:2703, offset: 0x01fe7bf2, size: 90 bytes, params: 2, frame: 14
let length = a0.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish).length;
length = env1_3.length;
return a0.map(_fun88548);
}
function _fun88544(a0) { // fn#88544, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:2577, offset: 0x01fe7bb5, size: 16 bytes, params: 2, frame: 2
return env2_0[a0];
}
function _fun88548(a0) { // fn#88548, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11738:2777, offset: 0x01fe7c4c, size: 131 bytes, params: 2, frame: 7
var r1;
var binding;
let value = environment.__proto__.__proto__;
const value2 = width - 48;
let lengthBinding = length;
const value5 = value2 / lengthBinding - 2 * (lengthBinding - 1) / lengthBinding;
const object2 = {media: a0, targetWidth: value5};
if (require) {
lengthBinding = length;
if (lengthBinding < 2) {
r1 = value5 / 1.7777777777777777;
} else {
value = environment.__proto__;
binding = env1_0;
lengthBinding = length;
value = binding / lengthBinding;
value -= 2 * (lengthBinding - 1) / lengthBinding;
r1 = value;
}
} else {
value = environment.__proto__;
binding = env1_0;
lengthBinding = length;
value = binding / lengthBinding;
value -= 2 * (lengthBinding - 1) / lengthBinding;
r1 = value;
}
object2.targetHeight = r1;
return object2;
}
@@ -0,0 +1,36 @@
/* Metro module 11563; source: modules/forums/native/posts/grid/ForumPostGridFooter.tsx; dependencies: [31, 27, 661, 33, 4501, 697, 11531, 11564, 11565, 11313, 2] */
function _fun88591(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11749:6, offset: 0x01fea1ba, size: 295 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const env0_4 = (require(661) /* metro dependency 661: Constants */).AnalyticsObjects;
let value = require(33) /* metro dependency 33 */;
const env0_5 = value.jsx;
const env0_6 = value.Fragment;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
const env0_8 = Reflect.apply(createStyles, value, [{footer: {'display': 'flex', 'alignItems': 'center',
'flexDirection': 'row', 'justifyContent': 'flex-start', 'marginTop': 12}, dot: {'height': 4, 'width': 4,
'borderRadius': 2, 'backgroundColor': null, 'marginHorizontal': 8, backgroundColor: BORDER_SUBTLE}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/grid/ForumPostGridFooter.tsx');
exports.default = ForumPostGridFooter;
}
function ForumPostGridFooter({thread, firstMessage, hasUnreads, parentChannel}) { // fn#88592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11749:520, offset: 0x01fea2e1, size: 354 bytes, params: 2, frame: 29
const styles = useStyles();
const value2 = (require(11531) /* metro dependency 11531: useTypingUsersIds */).useTypingUserIds(thread.id);
const value3 = value2.length > 0;
const items2 = [((Component) => <Component thread={thread} hasUnreads={hasUnreads} />)(importDefault(11564) /* metro dependency 11564: ForumPostMessageCount */)];
items2[1] = value3 && <><View style={styles.dot} />{((Component) => <Component thread={thread} typingUserIds={value2} hasUnreads={hasUnreads} />)(importDefault(11565) /* metro dependency 11565: ForumPostTypingUsers */)}</>;
items2[2] = firstMessage != null && ((MostCommonForumPostReaction) => <MostCommonForumPostReaction thread={thread} firstMessage={firstMessage} parentChannel={parentChannel} locationAnalyticsObject={AnalyticsObjects.FORUM_GRID_ITEM_FOOTER} />)((require(11313) /* metro dependency 11313: ForumPostReactions */).MostCommonForumPostReaction);
return (
<View style={styles.footer}>
{items2}
</View>
);
}
@@ -0,0 +1,41 @@
/* Metro module 11548; source: modules/forums/native/posts/grid/ForumPostGridHeader.tsx; dependencies: [31, 27, 6900, 1386, 33, 4501, 11549, 11551, 11560, 11561, 11562, 2] */
function _fun88524(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88524, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11734:6, offset: 0x01fe67f9, size: 303 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const env0_4 = (require(6900) /* metro dependency 6900: ForumConstants */).ForumTimestampFormats;
const env0_5 = (require(1386) /* metro dependency 1386: ChannelConstants */).ChannelFlags;
const value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
const env0_8 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({pinIcon: {marginEnd: 8},
container: {'display': 'flex', 'flexDirection': 'column', 'marginBottom': 4}, details: {'flexDirection': 'row',
'alignItems': 'center', 'marginBottom': 4}, timestampText: {flex: 1}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/grid/ForumPostGridHeader.tsx');
exports.default = ForumPostGridHeader;
}
function ForumPostGridHeader({thread, hasUnreads, isNew}) { // fn#88525, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11734:503, offset: 0x01fe6928, size: 377 bytes, params: 2, frame: 25
const styles = useStyles();
const hasFlag = thread.hasFlag;
const PINNED = ChannelFlags.PINNED;
const items2 = [Reflect.apply(hasFlag, thread,
[PINNED]) && ((Component) => <Component containerStyle={styles.pinIcon} />)(importDefault(11549) /* metro dependency 11549: ForumPostPinIcon */)];
const ForumPostAuthor = (require(11551) /* metro dependency 11551: ForumPostUsername */).ForumPostAuthor;
items2[1] = <ForumPostAuthor thread={thread} hasUnreads={hasUnreads} />;
const ForumPostTimestamp = importDefault(11560) /* metro dependency 11560: ForumPostTimestamp */;
const POSTED_DURATION_AGO = ForumTimestampFormats.POSTED_DURATION_AGO;
items2[2] = <ForumPostTimestamp thread={thread} hasUnreads={hasUnreads} format={POSTED_DURATION_AGO} textStyle={styles.timestampText} />;
items2[3] = isNew && ((Component) => <Component />)(importDefault(11561) /* metro dependency 11561: ForumPostNewTag */);
return (
<View style={styles.container}>
<View style={styles.details}>
{items2}
</View>
{((Component) => <Component title={thread.name} hasUnreads={hasUnreads} />)(importDefault(11562) /* metro dependency 11562: ForumPostTitle */)}
</View>
);
}
@@ -0,0 +1,62 @@
/* Metro module 11571; source: modules/forums/native/posts/hooks/useNativeForumPostContent.tsx; dependencies: [661, 4501, 1244, 5216, 4643, 2] */
function _fun88623(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88623, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11757:6, offset: 0x01fec081, size: 168 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(661) /* metro dependency 661: Constants */).MessageFlags;
const env0_4 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({italics: {fontStyle: 'italic'}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/hooks/useNativeForumPostContent.tsx');
exports.default = useNativeForumPostContent;
}
function useNativeForumPostContent({message, messageContent, messageLoaded, isMessageDeleted, senderModifier}) { // fn#88624, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11757:281, offset: 0x01fec129, size: 1062 bytes, params: 2, frame: 22
var r0;
var moduleValue;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
const styles = useStyles();
if (isMessageDeleted) {
return {content: intl.string(t.U8Rr2l), style: styles.italics, variant: 'text-sm/normal'};
}
if (message != null) {
if ((importDefault(5216) /* metro dependency 5216: isSystemMessage */)(message)) {
return {content: messageContent, style: styles.italics, variant: 'text-sm/normal'};
}
}
const r5 = message != null && message.blocked;
let r8 = message != null && message.ignored;
const value6 = senderModifier === 'blocked';
if (r5) {
return {content: r5 || value6 ? intl.string(t.Lkp2fB) : intl.string(t.yWK7ZM), style: styles.italics,
variant: 'text-sm/normal'};
}
if (value6) {
return {content: r5 || value6 ? intl.string(t.Lkp2fB) : intl.string(t.yWK7ZM), style: styles.italics,
variant: 'text-sm/normal'};
}
if (r8) {
return {content: r5 || value6 ? intl.string(t.Lkp2fB) : intl.string(t.yWK7ZM), style: styles.italics,
variant: 'text-sm/normal'};
}
if (senderModifier === 'ignored') {
return {content: r5 || value6 ? intl.string(t.Lkp2fB) : intl.string(t.yWK7ZM), style: styles.italics,
variant: 'text-sm/normal'};
}
let r9 = message?.content == null || message?.content === '';
r9 = !r9 ? messageContent == null : r9;
r9 = !r9 ? messageContent === '' : r9;
r9 = !r9 ? global.Array.isArray(messageContent) && messageContent.length === 0 : r9;
if (messageLoaded) {
if (message == null) {
r0 = intl.string(t.mE3KJN);
} else {
moduleValue = require(4643) /* metro dependency 4643: StickersUtils */;
r0 = moduleValue.getMessageStickers(message).length > 0 ? intl.string(t['7K5Lma']) : message.interaction == null ? message.hasFlag(MessageFlags.IS_VOICE_MESSAGE) ? intl.string(t['6bhHrc']) : message.hasFlag(MessageFlags.IS_COMPONENTS_V2) ? intl.string(t.Xxm5i3) : message.embeds.length > 0 || message.attachments.length > 0 ? intl.string(t.JAKsM8) : null : message.content === '' ? intl.string(t['2v7kfl']) : message.hasFlag(MessageFlags.IS_VOICE_MESSAGE) ? intl.string(t['6bhHrc']) : message.hasFlag(MessageFlags.IS_COMPONENTS_V2) ? intl.string(t.Xxm5i3) : message.embeds.length > 0 || message.attachments.length > 0 ? intl.string(t.JAKsM8) : null;
}
r8 = r0;
} else {
r8 = null;
}
return {'content': null, 'style': null, 'variant': 'text-sm/medium', content: r9 ? r8 : messageContent};
}
@@ -0,0 +1,235 @@
/* Metro module 11231; source: modules/forums/native/posts/hooks/useNativeForumPostHandlers.tsx; dependencies: [31, 3849, 1379, 3793, 1878, 6865, 6901, 661, 1243, 7152, 44, 4805, 6647, 1471, 9587, 9598, 9544, 477, 4081, 4082, 7155, 4601, 4015, 11232, 9837, 9835, 2] */
function _fun85851(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85851, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11417:6, offset: 0x01f7eae4, size: 291 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const actionSheetStore = importDefault(3849) /* metro dependency 3849: ActionSheetStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const forumPostMessagesStore = importDefault(6865) /* metro dependency 6865: ForumPostMessagesStore */;
const forumPostRecentMessageStore = importDefault(6901) /* metro dependency 6901: ForumPostRecentMessageStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_10 = constantsModule.AnalyticsObjectTypes;
const env0_11 = constantsModule.AnalyticsPages;
const env0_12 = constantsModule.AnalyticsSections;
const env0_13 = constantsModule.EMPTY_STRING_SNOWFLAKE_ID;
const env0_14 = (require(1243) /* metro dependency 1243: ThreadConstants */).OpenThreadAnalyticsLocations;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/hooks/useNativeForumPostHandlers.tsx');
exports.default = useNativeForumPostHandlers;
}
function useNativeForumPostHandlers({threadId, reactionType}) { // fn#85852, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11417:317, offset: 0x01f7ec07, size: 343 bytes, params: 2, frame: 22
const r11 = reactionType !== undefined ? reactionType : (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes.NORMAL;
const binding = env0_3;
let useCallback = binding.useCallback;
const value = Reflect.apply(useCallback, binding, [_fun85853, [threadId]]);
const value2 = binding.useCallback(_fun85855, [threadId]);
const value3 = binding.useCallback(_fun85856, [value2, threadId]);
const value4 = binding.useCallback(_fun85857, [threadId]);
const value5 = binding.useCallback(_fun85858, [threadId]);
const value6 = binding.useCallback(_fun85859, [threadId]);
const value7 = binding.useCallback(_fun85860, [threadId]);
useCallback = binding.useCallback;
return {onTapMedia: value, onTapPost: value2, onLongTapPost: value4, onTapReaction: value5,
onLongTapReaction: value6, onTapReactionCount: value7, onTapAddReaction: Reflect.apply(useCallback, binding,
[_fun85861, [threadId, r11]]), onTapMostRecentMessage: value3};
}
function _fun85853({messageId, mediaItems, containerRef, initialIndex}) { // fn#85853, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11417:432, offset: 0x01f7ed5e, size: 258 bytes, params: 2, frame: 24
var environment;
initialIndex = initialIndex === undefined ? 0 : initialIndex;
const value = environment.__proto__;
const channel = ChannelStore.getChannel(threadId);
(importDefault(44) /* metro dependency 44 */)(channel != null, '[Forum Post Handlers] Thread cannot be null.');
(require(9544) /* metro dependency 9544: openMediaModal */).openMediaModal({initialIndex: initialIndex,
initialSources: mediaItems.map(_fun85854), channelId: channel.id,
contextName: (require(4805) /* metro dependency 4805: useChannelName */).computeChannelName(channel, UserStore,
RelationshipStore, false),
contextIcon: (require(6647) /* metro dependency 6647: ChannelUtils */).getChannelIcon(channel),
originViewOrOriginLayout: containerRef.current});
}
function _fun85855() { // fn#85855, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11417:1608, offset: 0x01f7f0b6, size: 328 bytes, params: 1, frame: 21
var moduleValue2;
const platformUtilsModule = require(477) /* metro dependency 477: PlatformUtils */;
if (platformUtilsModule.isAndroid()) {
moduleValue2 = require(4081) /* metro dependency 4081: HapticUtilsNative */;
moduleValue2.triggerHapticFeedback((importDefault(4082) /* metro dependency 4082: HapticFeedbackTypes */).IMPACT_LIGHT);
}
const getChannel = ChannelStore.getChannel;
const threadIdBinding = threadId;
const value3 = Reflect.apply(getChannel, ChannelStore, [threadIdBinding]);
(importDefault(44) /* metro dependency 44 */)(value3 != null, '[Forum Post Handlers] Thread cannot be null.');
const channel = ChannelStore.getChannel(value3.parent_id);
(importDefault(44) /* metro dependency 44 */)(channel != null,
'[Forum Post Handlers] Parent channel cannot be null.');
const trackingModule = require(7155) /* metro dependency 7155: Tracking */;
const trackForumPostClicked = trackingModule.trackForumPostClicked;
const GUILD_CHANNEL = AnalyticsPages.GUILD_CHANNEL;
const FORUM_CHANNEL_POST = AnalyticsSections.FORUM_CHANNEL_POST;
Reflect.apply(trackForumPostClicked, trackingModule, [{guildId: channel.guild_id, channelId: channel.id,
postId: threadIdBinding, location: {page: GUILD_CHANNEL, section: FORUM_CHANNEL_POST}}]);
const transitionToChannelModule = require(4601) /* metro dependency 4601: transitionToChannel */;
const transitionToThread = transitionToChannelModule.transitionToThread;
const FORUM = OpenThreadAnalyticsLocations.FORUM;
Reflect.apply(transitionToThread, transitionToChannelModule, [value3, {source: FORUM, navigationReplace: false}]);
}
function _fun85856() { // fn#85856, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11417:2112, offset: 0x01f7f1fe, size: 302 bytes, params: 1, frame: 23
var moduleValue;
var trackForumPostClicked;
var id;
var moduleValue2;
var transitionToThreadMessage;
const getChannel = ChannelStore.getChannel;
const threadIdBinding = threadId;
const value3 = Reflect.apply(getChannel, ChannelStore, [threadIdBinding]);
(importDefault(44) /* metro dependency 44 */)(value3 != null, '[Forum Post Handlers] Thread cannot be null.');
const channel = ChannelStore.getChannel(value3.parent_id);
(importDefault(44) /* metro dependency 44 */)(channel != null,
'[Forum Post Handlers] Parent channel cannot be null.');
const messageState = ForumPostRecentMessageStore.getMessageState(threadIdBinding);
const message = messageState.message;
if (messageState.loaded) {
if (message != null) {
moduleValue = require(7155) /* metro dependency 7155: Tracking */;
trackForumPostClicked = moduleValue.trackForumPostClicked;
id = channel.id;
Reflect.apply(trackForumPostClicked, moduleValue, [{guildId: channel.guild_id, channelId: id,
postId: threadId,
location: {page: AnalyticsPages.GUILD_CHANNEL, section: AnalyticsSections.FORUM_CHANNEL_POST}}]);
moduleValue2 = require(4601) /* metro dependency 4601: transitionToChannel */;
transitionToThreadMessage = moduleValue2.transitionToThreadMessage;
id = message.id;
Reflect.apply(transitionToThreadMessage, moduleValue2, [value3, id,
{source: OpenThreadAnalyticsLocations.FORUM,
navigationReplace: false}]);
} else {
env0_2();
}
} else {
env0_2();
}
}
function _fun85857() { // fn#85857, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11417:2617, offset: 0x01f7f32c, size: 239 bytes, params: 1, frame: 20
const channel = ChannelStore.getChannel(threadId);
(importDefault(44) /* metro dependency 44 */)(channel != null, '[Forum Post Handlers] Thread cannot be null.');
const channel2 = ChannelStore.getChannel(channel.parent_id);
(importDefault(44) /* metro dependency 44 */)(channel2 != null,
'[Forum Post Handlers] Parent channel cannot be null.');
(importDefault(44) /* metro dependency 44 */)(channel2.isForumLikeChannel(), 'Forum parents must be forum channels');
const getContent = ActionSheetStore.getContent;
const value5 = Reflect.apply(getContent, ActionSheetStore, []) != null;
const getUser = UserStore.getUser;
if (!(value5 || Reflect.apply(getUser, UserStore, [channel.ownerId]) == null)) {
(require(4015) /* metro dependency 4015: ChatInputUtils */).dismissKeyboard();
(importDefault(11232) /* metro dependency 11232: showLongPressForumPostActionSheet */)(channel, channel2);
}
}
function _fun85858({reaction, disableReactionCreates, disableReactionUpdates, locationAnalyticsObject, reactionLocation}) { // fn#85858, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11417:3015, offset: 0x01f7f41b, size: 311 bytes, params: 2, frame: 29
var r8;
let value = environment.__proto__;
const getChannel = ChannelStore.getChannel;
const threadIdBinding = threadId;
const value3 = Reflect.apply(getChannel, ChannelStore, [threadIdBinding]);
(importDefault(44) /* metro dependency 44 */)(value3 != null, '[Forum Post Handlers] Thread cannot be null.');
const getMessage = ForumPostMessagesStore.getMessage;
const firstMessage = Reflect.apply(getMessage, ForumPostMessagesStore, [threadIdBinding]).firstMessage;
(importDefault(44) /* metro dependency 44 */)(firstMessage != null, '[Forum Post Handlers] Message cannot be null.');
if (disableReactionCreates) {
if (disableReactionUpdates) {
(require(9837) /* metro dependency 9837: ReactionUtils */).handleViewReactions({messageId: firstMessage.id,
channelId: threadId, reactions: firstMessage.reactions, location: {object: locationAnalyticsObject,
objectType: AnalyticsObjectTypes.CANT_ADD_OR_REMOVE}});
} else {
r8 = reaction != null && reaction.burst_count > 0;
value = require(9835) /* metro dependency 9835: MessagesUtils */;
value.handleAddOrRemoveReaction(firstMessage.id, value3, reaction, r8, reactionLocation);
}
} else {
r8 = reaction != null && reaction.burst_count > 0;
value = require(9835) /* metro dependency 9835: MessagesUtils */;
value.handleAddOrRemoveReaction(firstMessage.id, value3, reaction, r8, reactionLocation);
}
}
function _fun85859({emoji}) { // fn#85859, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11417:3566, offset: 0x01f7f552, size: 140 bytes, params: 2, frame: 17
const value = environment.__proto__;
const getMessage = ForumPostMessagesStore.getMessage;
const threadIdBinding = threadId;
const firstMessage = Reflect.apply(getMessage, ForumPostMessagesStore, [threadIdBinding]).firstMessage;
(importDefault(44) /* metro dependency 44 */)(firstMessage != null, '[Forum Post Handlers] Message cannot be null.');
(require(9837) /* metro dependency 9837: ReactionUtils */).handleViewReactions({messageId: firstMessage.id,
channelId: threadIdBinding, emoji: emoji, reactions: firstMessage.reactions});
}
function _fun85860() { // fn#85860, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11417:3790, offset: 0x01f7f5de, size: 126 bytes, params: 1, frame: 17
const value = environment.__proto__;
const getMessage = ForumPostMessagesStore.getMessage;
const threadIdBinding = threadId;
const firstMessage = Reflect.apply(getMessage, ForumPostMessagesStore, [threadIdBinding]).firstMessage;
(importDefault(44) /* metro dependency 44 */)(firstMessage != null, '[Forum Post Handlers] Message cannot be null.');
(require(9837) /* metro dependency 9837: ReactionUtils */).handleViewReactions({messageId: firstMessage.id,
channelId: threadIdBinding, reactions: firstMessage.reactions});
}
function _fun85861() { // fn#85861, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11417:4001, offset: 0x01f7f65c, size: 186 bytes, params: 1, frame: 23
let value = environment.__proto__;
const getChannel = ChannelStore.getChannel;
const threadIdBinding = threadId;
const value3 = Reflect.apply(getChannel, ChannelStore, [threadIdBinding]);
(importDefault(44) /* metro dependency 44 */)(value3 != null, '[Forum Post Handlers] Thread cannot be null.');
const getMessage = ForumPostMessagesStore.getMessage;
const firstMessage = Reflect.apply(getMessage, ForumPostMessagesStore, [threadIdBinding]).firstMessage;
(importDefault(44) /* metro dependency 44 */)(firstMessage != null, '[Forum Post Handlers] Message cannot be null.');
value = require(9835) /* metro dependency 9835: MessagesUtils */;
const handleAddOrRemoveReaction = value.handleAddOrRemoveReaction;
const id = firstMessage.id;
const binding = env0_1;
const ReactionTypes = (require(7152) /* metro dependency 7152: MessageReactionsTypes */).ReactionTypes;
const BURST = ReactionTypes.BURST;
Reflect.apply(handleAddOrRemoveReaction, value, [id, value3, null, binding === BURST]);
}
function _fun85854(a0) { // fn#85854, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11417:664, offset: 0x01f7ee60, size: 598 bytes, params: 2, frame: 22
var r7;
var r0;
var r2;
const ForumPostMediaTypes = (require(9587) /* metro dependency 9587: ForumPostMediaUtils */).ForumPostMediaTypes;
var value13;
const src = a0.src;
const srcIsAnimated = a0.srcIsAnimated;
const value2 = (importDefault(1471) /* metro dependency 1471: URLUtils */).toURLSafe(src);
const value3 = value2 != null;
if (srcIsAnimated) {
r0 = value3 && (value2.pathname.toLowerCase().endsWith('.webp') || value2.pathname.toLowerCase().endsWith('.avif'));
if (r0) {
r7 = a0.type === ForumPostMediaTypes.ATTACHMENT && (require(9598) /* metro dependency 9598: SignedAttachmentLinkUtils */).isAttachmentUrl(value2);
r7 = !r7 ? a0.type === ForumPostMediaTypes.EMBED && (require(9598) /* metro dependency 9598: SignedAttachmentLinkUtils */).isExternalProxiedAttachmentUrl(value2) : r7;
r0 = r7;
}
if (r0) {
value2.searchParams.set('animated', 'true');
value13 = value2.pathname.toLowerCase();
if (value13.endsWith('.avif')) {
value2.searchParams.set('format', 'webp');
}
r2 = value2.toString();
} else {
r2 = src;
}
} else if (value3 && value2.pathname.toLowerCase().endsWith('.avif')) {
value2.searchParams.set('format', 'webp');
r2 = value2.toString();
} else {
r2 = src;
}
return {uri: r2, guildId: env0_1.guild_id, messageId: messageId ?? EMPTY_STRING_SNOWFLAKE_ID, channelId: env0_1.id,
mediaIndex: a0.mediaIndex, width: a0.width, height: a0.height, accessoryType: a0.type,
attachmentId: a0.attachmentId};
}
@@ -0,0 +1,49 @@
/* Metro module 11568; source: modules/forums/native/posts/list/ForumPostList.tsx; dependencies: [57, 31, 27, 1386, 33, 4501, 6863, 11549, 11559, 11569, 11572, 2] */
function _fun88612(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88612, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11754:6, offset: 0x01feb48f, size: 280 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 */;
importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
const env0_5 = (require(1386) /* metro dependency 1386: ChannelConstants */).ChannelFlags;
const value = require(33) /* metro dependency 33 */;
const env0_6 = value.jsx;
const env0_7 = value.jsxs;
const env0_8 = value.Fragment;
const env0_9 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({header: {'display': 'flex',
'flexDirection': 'row', 'alignItems': 'center', 'marginBottom': 8}, content: {'flex': 1, 'marginBottom': 12}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/list/ForumPostList.tsx');
exports.default = ForumPostList;
}
function ForumPostList({messageContent, firstMessage, firstMessageLoaded, hasUnreads, isNew, media, isEmbed, isLocalDeviceMedia, parentChannel, thread, senderModifier}) { // fn#88613, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11754:427, offset: 0x01feb5a7, size: 519 bytes, params: 2, frame: 39
var r23;
var items2;
const styles = useStyles();
const value3 = env0_3((require(6863) /* metro dependency 6863: ForumTagHooks */).useSomeAppliedTags(thread, 2), 2);
const property = value3[0];
const property2 = value3[1];
const hasFlag = thread.hasFlag;
const PINNED = ChannelFlags.PINNED;
const hasFlag2 = Reflect.apply(hasFlag, thread, [PINNED]);
const jsxRuntimeEnv0_8Binding = jsxRuntimeEnv0_8;
let r6 = hasFlag2 || property.length !== 0;
if (r6) {
var viewBinding2Props = {style: styles.header};
r23 = hasFlag2 && ((Component) => <Component />)(importDefault(11549) /* metro dependency 11549: ForumPostPinIcon */);
items2 = [r23];
r23 = property.length !== 0 && ((ForumPostAppliedTagPills) => <ForumPostAppliedTagPills appliedTags={property} additionalTagsCount={property2} hasUnreads={hasUnreads} />)((require(11559) /* metro dependency 11559: ForumPostAppliedTags */).ForumPostAppliedTagPills);
items2[1] = r23;
r6 = <View {...viewBinding2Props}>{items2}</View>;
}
let value = importDefault(11569) /* metro dependency 11569: ForumPostListBody */;
value = <View style={styles.content}>{r6}{((Component) => <Component thread={thread} firstMessage={firstMessage} hasUnreads={hasUnreads} isNew={isNew} messageContent={messageContent} media={media} isEmbed={isEmbed} isLocalDeviceMedia={isLocalDeviceMedia} firstMessageLoaded={firstMessageLoaded} senderModifier={senderModifier} />)(value)}</View>;
return (
<>
{value}
{((Component) => <Component thread={thread} firstMessage={firstMessage} hasUnreads={hasUnreads} parentChannel={parentChannel} />)(importDefault(11572) /* metro dependency 11572: ForumPostListFooter */)}
</>
);
}
@@ -0,0 +1,42 @@
/* Metro module 11569; source: modules/forums/native/posts/list/ForumPostListBody.tsx; dependencies: [31, 27, 6900, 33, 4501, 11561, 11551, 11560, 11562, 11570, 11555, 2] */
function _fun88614(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88614, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11755:6, offset: 0x01feb7ae, size: 296 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const env0_4 = (require(6900) /* metro dependency 6900: ForumConstants */).ForumTimestampFormats;
const value = require(33) /* metro dependency 33 */;
const env0_5 = value.jsx;
const env0_6 = value.jsxs;
const env0_7 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({body: {'display': 'flex',
'flexDirection': 'row', 'alignItems': 'flex-start'}, contentContainer: {flex: 1},
thumbnailContainer: {marginLeft: 12}, details: {'flexDirection': 'row', 'alignItems': 'center',
'marginBottom': 6}, newTagContainer: {marginEnd: 8}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/list/ForumPostListBody.tsx');
exports.default = ForumPostListBody;
}
function ForumPostListBody({containerStyle, thread, firstMessage, hasUnreads, isNew, firstMessageLoaded, messageContent, media, isEmbed, isLocalDeviceMedia, senderModifier}) { // fn#88615, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11755:525, offset: 0x01feb8d6, size: 567 bytes, params: 2, frame: 33
const styles = useStyles();
const items3 = [styles.body, containerStyle];
const items2 = [isNew && ((Component) => <Component containerStyle={styles.newTagContainer} />)(importDefault(11561) /* metro dependency 11561: ForumPostNewTag */)];
const ForumPostAuthor = (require(11551) /* metro dependency 11551: ForumPostUsername */).ForumPostAuthor;
items2[1] = <ForumPostAuthor thread={thread} hasUnreads={hasUnreads} />;
const ForumPostTimestamp = importDefault(11560) /* metro dependency 11560: ForumPostTimestamp */;
const POSTED_DURATION_AGO = ForumTimestampFormats.POSTED_DURATION_AGO;
items2[2] = <ForumPostTimestamp thread={thread} hasUnreads={hasUnreads} format={POSTED_DURATION_AGO} />;
return (
<View style={items3}>
<View style={styles.contentContainer}>
<View style={styles.details}>
{items2}
</View>
{((Component) => <Component title={thread.name} lineClamp={2} ellipsizeMode="tail" hasUnreads={hasUnreads} />)(importDefault(11562) /* metro dependency 11562: ForumPostTitle */)}
{((Component) => <Component messageContent={messageContent} message={firstMessage} isMessageDeleted={false} messageLoaded={firstMessageLoaded} hasUnreads={hasUnreads} senderModifier={senderModifier} />)(importDefault(11570) /* metro dependency 11570: ForumPostMessageContent */)}
</View>
{firstMessage == null ? media == null ? null : ((ForumPostMediaThumbnail) => <ForumPostMediaThumbnail channel={thread} media={media} isEmbed={isEmbed} isLocalDeviceMedia={isLocalDeviceMedia} firstMessageId={firstMessage?.id} containerStyle={styles.thumbnailContainer} />)((require(11555) /* metro dependency 11555: ForumPostMedia */).ForumPostMediaThumbnail) : firstMessage.blocked || media == null ? null : ((ForumPostMediaThumbnail) => <ForumPostMediaThumbnail channel={thread} media={media} isEmbed={isEmbed} isLocalDeviceMedia={isLocalDeviceMedia} firstMessageId={firstMessage?.id} containerStyle={styles.thumbnailContainer} />)((require(11555) /* metro dependency 11555: ForumPostMedia */).ForumPostMediaThumbnail)}
</View>
);
}
@@ -0,0 +1,36 @@
/* Metro module 11572; source: modules/forums/native/posts/list/ForumPostListFooter.tsx; dependencies: [31, 27, 661, 33, 4501, 697, 11531, 11564, 11565, 11313, 2] */
function _fun88625(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#88625, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11758:6, offset: 0x01fec54f, size: 295 bytes, params: 8, frame: 21
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const env0_4 = (require(661) /* metro dependency 661: Constants */).AnalyticsObjects;
let value = require(33) /* metro dependency 33 */;
const env0_5 = value.jsx;
const env0_6 = value.Fragment;
const env0_7 = value.jsxs;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
const env0_8 = Reflect.apply(createStyles, value, [{footer: {'display': 'flex', 'alignItems': 'center',
'flexDirection': 'row', 'justifyContent': 'flex-start'}, dot: {'height': 4, 'width': 4, 'borderRadius': 2,
'backgroundColor': null, 'marginHorizontal': 8, backgroundColor: BORDER_SUBTLE}}]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/list/ForumPostListFooter.tsx');
exports.default = ForumPostListFooter;
}
function ForumPostListFooter({thread, firstMessage, hasUnreads, parentChannel}) { // fn#88626, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11758:507, offset: 0x01fec676, size: 354 bytes, params: 2, frame: 29
const styles = useStyles();
const value2 = (require(11531) /* metro dependency 11531: useTypingUsersIds */).useTypingUserIds(thread.id);
const value3 = value2.length > 0;
const items2 = [((Component) => <Component thread={thread} hasUnreads={hasUnreads} />)(importDefault(11564) /* metro dependency 11564: ForumPostMessageCount */)];
items2[1] = value3 && <><View style={styles.dot} />{((Component) => <Component thread={thread} typingUserIds={value2} hasUnreads={hasUnreads} />)(importDefault(11565) /* metro dependency 11565: ForumPostTypingUsers */)}</>;
items2[2] = firstMessage != null && ((MostCommonForumPostReaction) => <MostCommonForumPostReaction thread={thread} firstMessage={firstMessage} parentChannel={parentChannel} locationAnalyticsObject={AnalyticsObjects.FORUM_LIST_ITEM_FOOTER} />)((require(11313) /* metro dependency 11313: ForumPostReactions */).MostCommonForumPostReaction);
return (
<View style={styles.footer}>
{items2}
</View>
);
}
@@ -0,0 +1,179 @@
/* Metro module 11230; source: modules/forums/native/posts/reactions/ForumPostReactionButton.tsx; dependencies: [31, 27, 33, 4501, 697, 11231, 5278, 1244, 4573, 7152, 9837, 9830, 3829, 9841, 673, 1423, 3795, 6739, 11252, 2] */
function _fun85843(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#85843, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11416:6, offset: 0x01f7e17d, size: 474 bytes, params: 8, frame: 24
var object4;
const env0_0 = require;
const closure = BurstReactionButton;
const closure2 = ReactionButton;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importAll(31) /* metro dependency 31 */;
const env0_4 = (require(27) /* metro dependency 27 */).View;
let value = require(33) /* metro dependency 33 */;
const env0_5 = value.jsxs;
const env0_6 = value.jsx;
value = require(4501) /* metro dependency 4501: createStyles */;
const createStyles = value.createStyles;
object4 = {};
const object5 = {'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center', 'justifyContent': 'center',
'paddingHorizontal': 8, 'borderRadius': null, 'borderWidth': 1, 'borderColor': null, 'backgroundColor': null,
'minWidth': 32, 'minHeight': 26, 'maxHeight': 26};
object5.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
const REACTION_BORDER_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BORDER_DEFAULT;
object5.borderColor = REACTION_BORDER_DEFAULT;
const REACTION_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BACKGROUND_DEFAULT;
object5.backgroundColor = REACTION_BACKGROUND_DEFAULT;
object4.container = object5;
const object6 = {};
const REACTION_BORDER_REACTED_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BORDER_REACTED_DEFAULT;
object6.borderColor = REACTION_BORDER_REACTED_DEFAULT;
const REACTION_BACKGROUND_REACTED_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.REACTION_BACKGROUND_REACTED_DEFAULT;
object6.backgroundColor = REACTION_BACKGROUND_REACTED_DEFAULT;
object4.selected = object6;
object4.textEmoji = {fontSize: 12};
object4.imageEmoji = {'height': 16, 'width': 16};
object4.countContainer = {paddingStart: 4};
const env0_7 = Reflect.apply(createStyles, value, [object4]);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/reactions/ForumPostReactionButton.tsx');
exports.DEFAULT_EMOJI_SIZE = 14;
exports.AdditionalReactionCount = AdditionalReactionCount;
exports.AddReactionButton = AddReactionButton;
exports.ForumPostReactionButton = ForumPostReactionButton;
exports.BurstReactionButton = closure;
exports.ReactionButton = closure2;
}
function BurstReactionButton({colors, emoji, onPress, onLongPress, containerStyle, count, emojiSize, selected, animate, animateCount, accessible}) { // fn#85844, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11416:702, offset: 0x01f7e357, size: 353 bytes, params: 2, frame: 32
var r12;
var moduleValue2;
const value3 = (require(9841) /* metro dependency 9841: useEmojiColorPalette */).useEmojiColorPalette(colors);
const value4 = '';
if (value3 != null) {
moduleValue2 = require(673) /* metro dependency 673: ColorUtils */;
r12 = moduleValue2.hex2rgb(value3?.backgroundColor, value3?.opacity ?? 0.15) ?? value4;
} else {
r12 = value4;
}
return (
<ReactionButton
containerStyle={[containerStyle, {backgroundColor: r12, borderColor: value3?.backgroundColor,
borderWidth: selected ? 1 : 0}]}
textStyle={{color: value3?.accentColor}}
selected={false}
emoji={emoji}
count={count}
animate={animate}
onPress={onPress}
onLongPress={onLongPress}
emojiSize={emojiSize}
animateCount={animateCount}
accessible={accessible}
/>
);
}
function ReactionButton({emoji, onPress, onLongPress, textStyle, containerStyle, count, emojiSize, selected, animate, animateCount, accessible, disabled}) { // fn#85845, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11416:1304, offset: 0x01f7e4b8, size: 471 bytes, params: 2, frame: 34
disabled = !(disabled === undefined) && disabled;
const styles = useStyles();
const r11 = emoji.id != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getEmojiURL({id: emoji.id,
animated: animate && emoji.animated, size: emojiSize}) : undefined;
const selectedBinding = selected ? styles.selected : undefined;
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
return (
<PressableOpacity
style={[styles.container, containerStyle, selectedBinding]}
accessible={accessible}
accessibilityLabel={(require(3795) /* metro dependency 3795: ReactionUtils */).getAccessibleEmojiDisplayName(selectedBinding,
count, emoji, false)}
onPress={onPress}
onLongPress={onLongPress}
disabled={disabled}
>
{((Component) => <Component textEmojiStyle={styles.textEmoji} fastImageStyle={styles.imageEmoji} src={r11} name={emoji.name} />)(importDefault(6739) /* metro dependency 6739: Emoji */)}
{count != null && count > 0 && <View style={styles.countContainer}>{((Component) => <Component textStyle={textStyle} count={count} animate={animateCount} />)(importDefault(11252) /* metro dependency 11252: AnimatedCounter */)}</View>}
</PressableOpacity>
);
}
function AdditionalReactionCount({count, threadId, containerStyle}) { // fn#85846, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11416:2111, offset: 0x01f7e68f, size: 254 bytes, params: 2, frame: 23
const styles = useStyles();
const onTapReactionCount = (importDefault(11231) /* metro dependency 11231: useNativeForumPostHandlers */)({threadId: threadId}).onTapReactionCount;
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const string = intl.string;
const N8hbZB = (require(1244) /* metro dependency 1244: indexNative */).t.N8hbZB;
const items2 = [styles.container, containerStyle];
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
return (
<PressableOpacity
accessible
accessibilityLabel={Reflect.apply(string, intl, [N8hbZB])}
style={items2}
onPress={onTapReactionCount}
>
<Text variant="heading-sm/medium" color="interactive-text-default">
{'+'}
{count}
</Text>
</PressableOpacity>
);
}
function AddReactionButton({threadId, containerStyle, reactionType = require(dependencyMap[9]).ReactionTypes.NORMAL}) { // fn#85847, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11416:2502, offset: 0x01f7e78d, size: 280 bytes, params: 2, frame: 21
const styles = useStyles();
const onTapAddReaction = (importDefault(11231) /* metro dependency 11231: useNativeForumPostHandlers */)({threadId: threadId,
reactionType: reactionType}).onTapAddReaction;
const ADD_REACTION_ICON_COMPONENTS = (require(9837) /* metro dependency 9837: ReactionUtils */).ADD_REACTION_ICON_COMPONENTS;
const property = ADD_REACTION_ICON_COMPONENTS[reactionType];
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
const items2 = [styles.container, containerStyle];
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
return (
<PressableOpacity
style={items2}
accessible
accessibilityLabel={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.lfIHs4)}
onPress={onTapAddReaction}
>
{((Component) => <Component size="xs" />)(property)}
</PressableOpacity>
);
}
function ForumPostReactionButton({thread, reaction, animateCount, containerStyle, textStyle, locationAnalyticsObject, emojiSize}) { // fn#85848, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11416:2906, offset: 0x01f7e8a5, size: 501 bytes, params: 2, frame: 27
var r0;
emojiSize = emojiSize === undefined ? 14 : emojiSize;
const {disableReactionCreates,
disableReactionUpdates} = (importDefault(9830) /* metro dependency 9830: useReactionPermissions */)(thread);
const env0_3 = disableReactionUpdates;
const {onTapReaction,
onLongTapReaction} = (importDefault(11231) /* metro dependency 11231: useNativeForumPostHandlers */)({threadId: thread.id});
const AnimateEmoji = (require(3829) /* metro dependency 3829: UserSettings */).AnimateEmoji;
const value4 = AnimateEmoji.useSetting();
const binding = env0_3;
const value5 = binding.useCallback(function() {
onTapReaction({reaction: reaction, disableReactionCreates: disableReactionCreates,
disableReactionUpdates: disableReactionUpdates, locationAnalyticsObject: locationAnalyticsObject});
}, [disableReactionCreates, disableReactionUpdates, locationAnalyticsObject, onTapReaction, reaction]);
const value6 = binding.useCallback(function() {
onLongTapReaction(reaction);
}, [onLongTapReaction, reaction]);
let r13 = disableReactionCreates ? !disableReactionUpdates : !disableReactionCreates;
if (reaction.burst_count > 0) {
var burstReactionButtonBindingProps = {accessible: r13, emoji: reaction.emoji, selected: reaction.me_burst};
r13 = reaction.burst_colors ?? [];
burstReactionButtonBindingProps.colors = r13;
burstReactionButtonBindingProps.count = reaction.burst_count;
burstReactionButtonBindingProps.onPress = value5;
burstReactionButtonBindingProps.onLongPress = value6;
burstReactionButtonBindingProps.containerStyle = containerStyle;
burstReactionButtonBindingProps.textStyle = textStyle;
burstReactionButtonBindingProps.emojiSize = emojiSize;
burstReactionButtonBindingProps.animate = value4;
burstReactionButtonBindingProps.animateCount = animateCount;
r0 = <BurstReactionButton {...burstReactionButtonBindingProps} />;
} else {
r0 = <ReactionButton accessible={r13} emoji={reaction.emoji} selected={reaction.me} count={reaction.count} onPress={value5} onLongPress={value6} containerStyle={containerStyle} textStyle={textStyle} emojiSize={emojiSize} animate={value4} animateCount={animateCount} />;
}
return r0;
}
@@ -0,0 +1,149 @@
/* Metro module 11313; source: modules/forums/native/posts/reactions/ForumPostReactions.tsx; dependencies: [31, 27, 33, 4501, 9830, 9619, 11230, 2] */
function _fun86313(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#86313, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11499:6, offset: 0x01f902bf, size: 284 bytes, params: 8, frame: 20
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
importAll(31) /* metro dependency 31 */;
const env0_3 = (require(27) /* metro dependency 27 */).View;
const value = require(33) /* metro dependency 33 */;
const env0_4 = value.jsx;
const env0_5 = value.jsxs;
const env0_6 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({reactionButtonContainer: {marginEnd: 8},
actionBarReaction: {marginEnd: 4}, container: {flexDirection: 'row'},
mostCommonContainer: {marginLeft: 'auto'}});
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/native/posts/reactions/ForumPostReactions.tsx');
exports.MaxForumPostReactions = MaxForumPostReactions;
exports.ForumPostActionBarReactions = ForumPostActionBarReactions;
exports.MostCommonForumPostReaction = MostCommonForumPostReaction;
}
function MaxForumPostReactions({thread, parentChannel, firstMessage, containerWidth, containerStyle, reactionContainerStyle}) { // fn#86314, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11499:432, offset: 0x01f903db, size: 399 bytes, params: 2, frame: 25
var r0;
var items2;
const styles = useStyles();
const disableReactionCreates = (importDefault(9830) /* metro dependency 9830: useReactionPermissions */)(thread).disableReactionCreates;
const {reactions,
additionalReactionCount} = (require(9619) /* metro dependency 9619: ForumHooks */).useMaxPossibleForumPostReactions({'containerWidth': null,
'reactionEmojiWidth': 46, 'digitWidth': 7.5, containerWidth: containerWidth - (disableReactionCreates ? 0 : 28),
message: firstMessage, parentChannel: parentChannel});
if (reactions.length !== 0) {
var viewBindingProps = {style: [styles.container, containerStyle]};
items2 = [reactions.map(_fun86315)];
items2[1] = additionalReactionCount > 0 && ((AdditionalReactionCount) => <AdditionalReactionCount count={additionalReactionCount} containerStyle={reactionContainerStyle} threadId={thread.id} />)((require(11230) /* metro dependency 11230: ForumPostReactionButton */).AdditionalReactionCount);
items2[2] = !disableReactionCreates && ((AddReactionButton) => <AddReactionButton containerStyle={reactionContainerStyle} threadId={thread.id} />)((require(11230) /* metro dependency 11230: ForumPostReactionButton */).AddReactionButton);
r0 = <View {...viewBindingProps}>{items2}</View>;
} else if (disableReactionCreates) {
r0 = null;
} else {
var viewBindingProps = {style: [styles.container, containerStyle]};
items2 = [reactions.map(_fun86315)];
items2[1] = additionalReactionCount > 0 && ((AdditionalReactionCount) => <AdditionalReactionCount count={additionalReactionCount} containerStyle={reactionContainerStyle} threadId={thread.id} />)((require(11230) /* metro dependency 11230: ForumPostReactionButton */).AdditionalReactionCount);
items2[2] = !disableReactionCreates && ((AddReactionButton) => <AddReactionButton containerStyle={reactionContainerStyle} threadId={thread.id} />)((require(11230) /* metro dependency 11230: ForumPostReactionButton */).AddReactionButton);
r0 = <View {...viewBindingProps}>{items2}</View>;
}
return r0;
}
function ForumPostActionBarReactions({thread, parentChannel, firstMessage, containerStyle, reactionContainerStyle}) { // fn#86316, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11499:1217, offset: 0x01f905ee, size: 415 bytes, params: 2, frame: 26
var r0;
var items2;
const styles = useStyles();
const disableReactionCreates = (importDefault(9830) /* metro dependency 9830: useReactionPermissions */)(thread).disableReactionCreates;
const {reactions,
additionalNonUniqueReactionCount} = (require(9619) /* metro dependency 9619: ForumHooks */).useSomeForumPostReactions({message: firstMessage,
parentChannel: parentChannel, sorted: false, count: disableReactionCreates ? 3 : 2});
if (reactions.length !== 0) {
var viewBindingProps = {style: [styles.container, containerStyle]};
items2 = [reactions.map(_fun86317)];
items2[1] = additionalNonUniqueReactionCount > 0 && ((AdditionalReactionCount) => <AdditionalReactionCount count={additionalNonUniqueReactionCount} containerStyle={[styles.actionBarReaction,
reactionContainerStyle]} threadId={thread.id} />)((require(11230) /* metro dependency 11230: ForumPostReactionButton */).AdditionalReactionCount);
items2[2] = !disableReactionCreates && ((AddReactionButton) => <AddReactionButton containerStyle={[styles.actionBarReaction,
reactionContainerStyle]} threadId={thread.id} />)((require(11230) /* metro dependency 11230: ForumPostReactionButton */).AddReactionButton);
r0 = <View {...viewBindingProps}>{items2}</View>;
} else if (disableReactionCreates) {
r0 = null;
} else {
var viewBindingProps = {style: [styles.container, containerStyle]};
items2 = [reactions.map(_fun86317)];
items2[1] = additionalNonUniqueReactionCount > 0 && ((AdditionalReactionCount) => <AdditionalReactionCount count={additionalNonUniqueReactionCount} containerStyle={[styles.actionBarReaction,
reactionContainerStyle]} threadId={thread.id} />)((require(11230) /* metro dependency 11230: ForumPostReactionButton */).AdditionalReactionCount);
items2[2] = !disableReactionCreates && ((AddReactionButton) => <AddReactionButton containerStyle={[styles.actionBarReaction,
reactionContainerStyle]} threadId={thread.id} />)((require(11230) /* metro dependency 11230: ForumPostReactionButton */).AddReactionButton);
r0 = <View {...viewBindingProps}>{items2}</View>;
}
return r0;
}
function MostCommonForumPostReaction({thread, parentChannel, firstMessage, locationAnalyticsObject}) { // fn#86318, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11499:1988, offset: 0x01f90811, size: 234 bytes, params: 2, frame: 21
const styles = useStyles();
const {disableReactionCreates,
disableReactionUpdates} = (importDefault(9830) /* metro dependency 9830: useReactionPermissions */)(thread);
const forumHooksModule = require(9619) /* metro dependency 9619: ForumHooks */;
const useSomeForumPostReactions = forumHooksModule.useSomeForumPostReactions;
const property = Reflect.apply(useSomeForumPostReactions, forumHooksModule, [{parentChannel: parentChannel,
message: firstMessage}]).reactions[0];
if (property == null) {
return null;
}
if (disableReactionUpdates) {
return null;
}
if (disableReactionCreates) {
if (property.me || property.me_burst) {
const ForumPostReactionButton = (require(11230) /* metro dependency 11230: ForumPostReactionButton */).ForumPostReactionButton;
return (
<ForumPostReactionButton
containerStyle={styles.mostCommonContainer}
thread={thread}
reaction={property}
locationAnalyticsObject={locationAnalyticsObject}
animateCount={false}
/>
);
} else {
return null;
}
} else {
const ForumPostReactionButton2 = (require(11230) /* metro dependency 11230: ForumPostReactionButton */).ForumPostReactionButton;
return (
<ForumPostReactionButton2
containerStyle={styles.mostCommonContainer}
thread={thread}
reaction={property}
locationAnalyticsObject={locationAnalyticsObject}
animateCount={false}
/>
);
}
}
function _fun86315(a0) { // fn#86315, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11499:862, offset: 0x01f9056a, size: 132 bytes, params: 2, frame: 18
const ForumPostReactionButton = (require(11230) /* metro dependency 11230: ForumPostReactionButton */).ForumPostReactionButton;
return (
<ForumPostReactionButton
containerStyle={[styles.reactionButtonContainer, reactionContainerStyle]}
thread={thread}
reaction={a0}
animateCount={false}
key={a0.emoji.id ?? a0.emoji.name}
/>
);
}
function _fun86317(a0) { // fn#86317, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11499:1595, offset: 0x01f9078d, size: 132 bytes, params: 2, frame: 18
const ForumPostReactionButton = (require(11230) /* metro dependency 11230: ForumPostReactionButton */).ForumPostReactionButton;
return (
<ForumPostReactionButton
containerStyle={[styles.actionBarReaction, reactionContainerStyle]}
thread={thread}
reaction={a0}
animateCount={false}
key={a0.emoji.id ?? a0.emoji.name}
/>
);
}
@@ -0,0 +1,35 @@
/* Metro module 8004; source: modules/forums/openForumExplicitMediaWarning.native.tsx; dependencies: [33, 4496, 8005, 1962, 2] */
function _fun63589(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#63589, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8182:6, offset: 0x01b86ca0, size: 121 bytes, params: 8, frame: 18
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = (require(33) /* metro dependency 33 */).jsx;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/openForumExplicitMediaWarning.native.tsx');
exports.default = openForumExplicitMediaWarning;
}
function openForumExplicitMediaWarning(a0, a1) { // fn#63590, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8182:209, offset: 0x01b86d19, size: 66 bytes, params: 3, frame: 13
const env0_0 = a0;
const env0_1 = a1;
const value = importDefault(4496) /* metro dependency 4496: AlertActionCreators */;
value.openLazy({importer: importer_63591});
}
function openForumExplicitMediaWarningImporter() { // fn#63591, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8182:280, owner: openForumExplicitMediaWarning.importer, offset: 0x01b86d5b, size: 62 bytes, params: 1, frame: 13
var environment;
let value = environment.__proto__;
value = require(dependencyMap[3]);
value = value(dependencyMap[2], dependencyMap.paths);
return value.then(function({default: env0_0}) {
return _fun63593;
});
}
function _fun63592({default: env0_0}) { // fn#63592, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8182:312, offset: 0x01b86d99, size: 21 bytes, params: 2, frame: 2
return _fun63593;
}
function _fun63593(a0) { // fn#63593, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8182:327, offset: 0x01b86dae, size: 65 bytes, params: 2, frame: 15
return ((Component) => <Component {...a0} {...{['channelId']: env2_0}} {...{['messageId']: require}} />)(env0_0);
}
@@ -0,0 +1,118 @@
/* Metro module 7160; source: modules/forums/tracking/ForumChannelAnalyticsManager.tsx; dependencies: [7, 6, 1379, 2] */
function _fun57466(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57466, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7338:6, offset: 0x013e6739, size: 161 bytes, params: 8, frame: 18
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importDefault(7) /* metro dependency 7 */;
const env0_0 = importDefault(6) /* metro dependency 6 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
value = value(function() {
this(this, ForumChannelAnalyticsManager);
this.setFilterTagIds = _fun57468;
this.setSortOrder = _fun57469;
this.setLayout = _fun57470;
this.setTagSetting = _fun57471;
this.getFilterTagIdsAnalytics = _fun57472;
this.getSortOrderAnalytics = _fun57473;
this.getLayoutAnalytics = _fun57474;
this.getTagSettingAnalytics = _fun57475;
});
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/tracking/ForumChannelAnalyticsManager.tsx');
exports.default = value;
}
function ForumChannelAnalyticsManager() { // fn#57467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7338:135, offset: 0x013e67da, size: 118 bytes, params: 1, frame: 14
this(this, ForumChannelAnalyticsManager);
this.setFilterTagIds = setFilterTagIds;
this.setSortOrder = setSortOrder;
this.setLayout = setLayout_57470;
this.setTagSetting = setTagSetting;
this.getFilterTagIdsAnalytics = getFilterTagIdsAnalytics;
this.getSortOrderAnalytics = getSortOrderAnalytics;
this.getLayoutAnalytics = getLayoutAnalytics;
this.getTagSettingAnalytics = getTagSettingAnalytics;
}
function setFilterTagIds(a0) { // fn#57468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7338:233, owner: ForumChannelAnalyticsManager.setFilterTagIds, offset: 0x013e6850, size: 20 bytes, params: 2, frame: 2
env0_0.filterTagIds = a0;
}
function ForumChannelAnalyticsManagerSetSortOrder(a0) { // fn#57469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7338:276, owner: ForumChannelAnalyticsManager.setSortOrder, offset: 0x013e6864, size: 20 bytes, params: 2, frame: 2
env0_0.sortOrder = a0;
}
function ForumChannelAnalyticsManagerSetLayout(a0) { // fn#57470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7338:313, owner: ForumChannelAnalyticsManager.setLayout, offset: 0x013e6878, size: 20 bytes, params: 2, frame: 2
env0_0.layout = a0;
}
function ForumChannelAnalyticsManagerSetTagSetting(a0) { // fn#57471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7338:351, owner: ForumChannelAnalyticsManager.setTagSetting, offset: 0x013e688c, size: 20 bytes, params: 2, frame: 2
env0_0.tagSetting = a0;
}
function getFilterTagIdsAnalytics() { // fn#57472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7338:404, owner: ForumChannelAnalyticsManager.getFilterTagIdsAnalytics, offset: 0x013e68a0, size: 55 bytes, params: 1, frame: 12
return env0_0.filterTagIds != null ? global.Array.from(env0_0.filterTagIds) : [];
}
function getSortOrderAnalytics(a0) { // fn#57473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7338:492, owner: ForumChannelAnalyticsManager.getSortOrderAnalytics, offset: 0x013e68d7, size: 63 bytes, params: 2, frame: 13
var r1;
var r0;
var value;
const sortOrder = env0_0.sortOrder;
if (sortOrder != null) {
r0 = sortOrder;
} else {
value = environment.__proto__;
value = ChannelStore.getChannel(a0);
if (value == null) {
r1 = undefined;
} else {
value = value.getDefaultSortOrder();
r1 = value;
}
r0 = r1;
}
return r0;
}
function getLayoutAnalytics(a0) { // fn#57474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7338:620, owner: ForumChannelAnalyticsManager.getLayoutAnalytics, offset: 0x013e6916, size: 63 bytes, params: 2, frame: 13
var r1;
var r0;
var value;
const layout = env0_0.layout;
if (layout != null) {
r0 = layout;
} else {
value = environment.__proto__;
value = ChannelStore.getChannel(a0);
if (value == null) {
r1 = undefined;
} else {
value = value.getDefaultLayout();
r1 = value;
}
r0 = r1;
}
return r0;
}
function getTagSettingAnalytics(a0) { // fn#57475, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7338:746, owner: ForumChannelAnalyticsManager.getTagSettingAnalytics, offset: 0x013e6955, size: 63 bytes, params: 2, frame: 13
var r1;
var r0;
var value;
const tagSetting = env0_0.tagSetting;
if (tagSetting != null) {
r0 = tagSetting;
} else {
value = environment.__proto__;
value = ChannelStore.getChannel(a0);
if (value == null) {
r1 = undefined;
} else {
value = value.getDefaultTagSetting();
r1 = value;
}
r0 = r1;
}
return r0;
}
@@ -0,0 +1,139 @@
/* Metro module 9623; source: modules/forums/tracking/ForumChannelSeenManager.tsx; dependencies: [7, 6, 15, 17, 18, 9624, 9622, 7155, 7157, 2] */
function _fun75464(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#75464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9809:6, offset: 0x01dae0bb, size: 255 bytes, params: 8, frame: 20
const env0_0 = require;
const closure = function(a0) {
var FORUM_CHANNEL = require(dependencyMap[5]).AnalyticsFeedTypes.FORUM_CHANNEL;
return '' + FORUM_CHANNEL + '_' + a0;
};
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(7) /* metro dependency 7 */;
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(15) /* metro dependency 15 */;
const env0_5 = importDefault(17) /* metro dependency 17 */;
const env0_6 = importDefault(18) /* metro dependency 18 */;
const AnalyticsFeedItemSeenManager = (require(9624) /* metro dependency 9624: AnalyticsFeedItemSeenManager */).AnalyticsFeedItemSeenManager;
const value = _fun75469(AnalyticsFeedItemSeenManager);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/tracking/ForumChannelSeenManager.tsx');
exports.default = value;
exports.getForumPostSeenManagerId = closure;
exports.markForumPostItemAsSeen = markForumPostItemAsSeen;
exports.markForumPostItemAsUnseen = markForumPostItemAsUnseen;
}
function _isNativeReflectConstruct_75465() { // fn#75465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9809:148, offset: 0x01dae1ba, size: 98 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_75465_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun75469(a0) { // fn#75469, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9809:442, offset: 0x01dae262, size: 42 bytes, params: 2, frame: 14
const closure = ForumChannelSeenManager;
env0_6(closure, a0);
return env0_2(closure);
}
function markForumPostItemAsSeen(a0, a1, a2) { // fn#75473, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9809:1685, offset: 0x01dae490, size: 58 bytes, params: 4, frame: 16
const analyticsFeedItemSeenActionCreatorsModule = require(9622) /* metro dependency 9622: AnalyticsFeedItemSeenActionCreators */;
analyticsFeedItemSeenActionCreatorsModule.markAnalyticsFeedItemSeen(getForumPostSeenManagerId(a0), a1, a2);
}
function markForumPostItemAsUnseen(a0, a1, a2) { // fn#75474, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9809:1823, offset: 0x01dae4ca, size: 58 bytes, params: 4, frame: 16
const analyticsFeedItemSeenActionCreatorsModule = require(9622) /* metro dependency 9622: AnalyticsFeedItemSeenActionCreators */;
analyticsFeedItemSeenActionCreatorsModule.markAnalyticsFeedItemUnseen(getForumPostSeenManagerId(a0), a1, a2);
}
function ForumChannelSeenManager({guildId, channelId, windowId, isPaused}) { // fn#75470, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9809:454, offset: 0x01dae28c, size: 230 bytes, params: 2, frame: 23
var environment;
const value = environment.__proto__;
env1_3(this, ForumChannelSeenManager);
const object2 = {windowId: windowId, isPaused: isPaused};
object2.id = getForumPostSeenManagerId(channelId);
const items2 = [object2];
const value3 = env1_5(ForumChannelSeenManager);
const value6 = env1_4(this, _isNativeReflectConstruct_75465() ? global.Reflect.construct(value3, items2,
env1_5(this).constructor) : value3.apply(this, items2));
value6.createFlushSeenItemsFunction = createFlushSeenItemsFunction;
value6.guildId = guildId;
value6.channelId = channelId;
value6.sessionId = (require(7157) /* metro dependency 7157: TrackingUtils */).getForumChannelSessionId(channelId);
return value6;
}
function createFlushSeenItemsFunction(a0) { // fn#75471, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9809:832, owner: ForumChannelSeenManager.createFlushSeenItemsFunction, offset: 0x01dae372, size: 78 bytes, params: 2, frame: 6
const binding = env0_0;
const trackedFeedItems = binding.trackedFeedItems;
const channelId = binding.channelId;
const object2 = {};
object2.guildId = binding.guildId;
object2.channelId = channelId;
object2.sessionId = binding.sessionId;
object2.trackedFeedItems = trackedFeedItems;
object2.isForcedFlush = a0 != null;
return _fun75472;
}
function _fun75472() { // fn#75472, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9809:978, offset: 0x01dae3c0, size: 208 bytes, params: 1, frame: 21
var r2;
var property;
var property2;
var seenTimeDestructive;
var value3;
const {guildId, channelId, sessionId, trackedFeedItems, isForcedFlush} = env0_0;
const items3 = [];
const items2 = [];
const Object = global.Object;
let value = Object.keys(trackedFeedItems);
let length = value.length;
const value2 = 0;
if (value2 < length) {
r2 = value2;
while (true) {
property = value[r2];
property2 = trackedFeedItems[property];
seenTimeDestructive = property2.computeSeenTimeDestructive(isForcedFlush);
if (seenTimeDestructive > value2) {
items3.push(property);
items2.push(seenTimeDestructive);
}
value3 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
length = value.length;
if (value3 < length) {
r2 = value3;
continue;
}
break;
}
}
if (value2 !== items3.length) {
value = environment.__proto__.__proto__.__proto__;
value = require(7155) /* metro dependency 7155: Tracking */;
value.trackForumChannelSeenBatch({guildId: guildId, channelId: channelId, sessionId: sessionId, postIds: items3,
additionalTimes: items2});
}
}
@@ -0,0 +1,137 @@
/* Metro module 7161; source: modules/forums/tracking/ForumPostAnalyticsManager.tsx; dependencies: [6, 7, 15, 17, 18, 4790, 1226, 1379, 21, 6899, 4860, 2] */
function _fun57476(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57476, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7339:6, offset: 0x013e6994, size: 274 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_3 = importDefault(6) /* metro dependency 6 */;
const env0_4 = importDefault(7) /* metro dependency 7 */;
const env0_5 = importDefault(15) /* metro dependency 15 */;
const env0_6 = importDefault(17) /* metro dependency 17 */;
const env0_7 = importDefault(18) /* metro dependency 18 */;
const activeThreadsStore = importDefault(4790) /* metro dependency 4790: ActiveThreadsStore */;
const authenticationStore = importDefault(1226) /* metro dependency 1226: AuthenticationStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
let value = importDefault(4860) /* metro dependency 4860: AutomaticLifecycleManager */;
value = _fun57480(value);
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/tracking/ForumPostAnalyticsManager.tsx');
exports.default = value;
}
function _isNativeReflectConstruct_57477() { // fn#57477, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7339:178, offset: 0x013e6aa6, size: 94 bytes, params: 1, frame: 18
var Boolean;
var prototype;
var valueOf;
var call;
var Reflect;
var construct;
var closure;
var value;
var error;
try {
Boolean = global.Boolean;
prototype = Boolean.prototype;
valueOf = prototype.valueOf;
call = valueOf.call;
Reflect = global.Reflect;
construct = Reflect.construct;
Boolean = global.Boolean;
closure = function() {
};
value = Reflect.apply(construct, Reflect, [Boolean, [], closure]);
value = Reflect.apply(call, valueOf, [value]);
var result = !value;
} catch (error) {
}
return (_isNativeReflectConstruct_57477_isNativeReflectConstruct = function() {
return !!result;
})();
}
function _fun57480(a0) { // fn#57480, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7339:381, offset: 0x013e6b04, size: 68 bytes, params: 2, frame: 15
const closure = ForumPostAnalyticsManager;
env0_7(closure, a0);
return env0_4(closure, [{key: 'handleThreadCreate', value: value_57488}]);
}
function ForumPostAnalyticsManager(a0) { // fn#57481, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7339:393, offset: 0x013e6b48, size: 201 bytes, params: 2, frame: 20
var r0;
var Reflect;
let value = copyRestArgs(0, undefined);
let binding = env1_3;
binding(this, ForumPostAnalyticsManager);
const items = [];
arraySpread(items, value, 0, items);
value = env1_6(ForumPostAnalyticsManager);
binding = env1_5;
if (_isNativeReflectConstruct_57477()) {
Reflect = global.Reflect;
value = Reflect.construct(value, items, env1_6(this).constructor);
r0 = value;
} else {
value = value.apply(this, items);
r0 = value;
}
value = binding(this, r0);
value.readStateSnapshots = {};
value.actions = {CHANNEL_SELECT: CHANNEL_SELECT_57482, THREAD_CREATE: THREAD_CREATE_57483};
value.handleChannelSelect = handleChannelSelect_57484;
value.processForumChannel = processForumChannel;
value.getReadStateSnapshotAnalytics = getReadStateSnapshotAnalytics;
return value;
}
function value_57488({channel}) { // fn#57488, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7339:1282, offset: 0x013e6d38, size: 85 bytes, params: 2, frame: 12
var ownerId;
var value;
var readStateSnapshots;
var id;
if (channel.isForumPost()) {
ownerId = channel.ownerId;
value = environment.__proto__;
value = AuthenticationStore.getId();
readStateSnapshots = this.readStateSnapshots;
id = channel.id;
value = !(ownerId === value);
readStateSnapshots[id] = {isNew: value, hasUnreads: value};
}
}
function ForumPostAnalyticsManagerHandleChannelSelect({channelId}) { // fn#57484, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7339:796, owner: ForumPostAnalyticsManager.handleChannelSelect, offset: 0x013e6c3f, size: 87 bytes, params: 2, frame: 13
var value;
var binding;
if (channelId != null) {
value = environment.__proto__.__proto__;
value = ChannelStore.getChannel(channelId);
if (value != null && value.isForumLikeChannel()) {
binding = env0_0;
binding.readStateSnapshots = {};
binding.processForumChannel(value.guild_id, channelId);
}
}
}
function processForumChannel(a0, a1) { // fn#57485, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7339:967, owner: ForumPostAnalyticsManager.processForumChannel, offset: 0x013e6c96, size: 76 bytes, params: 3, frame: 14
var environment;
let value = environment.__proto__.__proto__;
const threadsForParent = ActiveThreadsStore.getThreadsForParent(a0, a1);
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
value = value.keys(threadsForParent);
value.forEach(_fun57486);
}
function getReadStateSnapshotAnalytics(a0) { // fn#57487, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7339:1154, owner: ForumPostAnalyticsManager.getReadStateSnapshotAnalytics, offset: 0x013e6d22, size: 22 bytes, params: 2, frame: 2
return env0_0.readStateSnapshots[a0];
}
function _fun57486(a0) { // fn#57486, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7339:1033, offset: 0x013e6ce2, size: 64 bytes, params: 2, frame: 12
var value2;
let value = environment.__proto__.__proto__.__proto__;
value = require(6899) /* metro dependency 6899: ForumUtils */;
value = value.getForumPostReadStatesById(a0);
if (value != null) {
value2 = environment.__proto__;
env1_0.readStateSnapshots[a0] = value;
}
}
@@ -0,0 +1,36 @@
/* Metro module 7159; source: modules/forums/tracking/ForumSessionAnalyticsManager.tsx; dependencies: [6, 7, 491, 2] */
function _fun57461(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57461, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7337:6, offset: 0x013e65d7, size: 161 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const env0_2 = importDefault(6) /* metro dependency 6 */;
const env0_3 = importDefault(7) /* metro dependency 7 */;
let value = _fun57463();
value = new value();
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/tracking/ForumSessionAnalyticsManager.tsx');
exports.default = value;
}
function createSessionData(a0) { // fn#57462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7337:116, offset: 0x013e6678, size: 51 bytes, params: 2, frame: 12
const object2 = {channelId: a0};
object2.sessionId = (require(491) /* metro dependency 491 */).v4();
return object2;
}
function _fun57463() { // fn#57463, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7337:199, offset: 0x013e66ab, size: 55 bytes, params: 1, frame: 14
return env0_3(ForumSessionAnalyticsManager, [{key: 'getForumChannelSessionId', value: value_57465}]);
}
function value_57465(a0) { // fn#57465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7337:338, offset: 0x013e66e2, size: 87 bytes, params: 2, frame: 12
var value;
if (this.session == null) {
value = environment.__proto__;
this.session = createSessionData(a0);
}
if (this.session.channelId !== a0) {
value = environment.__proto__;
this.session = createSessionData(a0);
}
return this.session.sessionId;
}
@@ -0,0 +1,411 @@
/* Metro module 7155; source: modules/forums/tracking/Tracking.tsx; dependencies: [1379, 4645, 6865, 7156, 661, 4863, 7157, 683, 7162, 477, 7163, 2] */
function _fun57354(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:6, offset: 0x013e3d48, size: 504 bytes, params: 8, frame: 19
let env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const draftStore = importDefault(4645) /* metro dependency 4645: DraftStore */;
let env0_5 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const forumPostMessagesStore = importDefault(6865) /* metro dependency 6865: ForumPostMessagesStore */;
const forumSearchStore = importDefault(7156) /* metro dependency 7156: ForumSearchStore */;
const constantsModule = require(661) /* metro dependency 661: Constants */;
const env0_8 = constantsModule.AnalyticEvents;
const env0_9 = constantsModule.AnalyticsSections;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/tracking/Tracking.tsx');
exports.trackForumChannelSeenBatch = trackForumChannelSeenBatch;
exports.trackForumSearched = trackForumSearched;
exports.trackForumSearchCleared = trackForumSearchCleared;
exports.trackForumTagFilterClicked = trackForumTagFilterClicked;
exports.trackForumCreateNewPostClick = trackForumCreateNewPostClick;
exports.trackForumCreateNewPostKeybindUsed = trackForumCreateNewPostKeybindUsed;
exports.maybeTrackForumNewPostDraftCreated = maybeTrackForumNewPostDraftCreated;
exports.trackForumNewPostCleared = trackForumNewPostCleared;
exports.trackForumPostCreated = function(a0) {
var env0_0 = a0.guildId;
var env0_1 = a0.channelId;
var postId = a0.postId;
var env0_2 = postId;
var env0_3 = a0.applicationId;
var env0_4 = a0.voiceChatEnabled;
var closure = _fun57364;
var env0_5 = closure;
if (ForumPostMessagesStore.isLoading(postId)) {
ForumPostMessagesStore.addConditionalChangeListener(_fun57365);
} else {
closure();
}
};
exports.trackForumScrolled = trackForumScrolled;
exports.trackForumMorePostsLoaded = trackForumMorePostsLoaded;
exports.trackForumPostClicked = trackForumPostClicked;
exports.trackForumSortOrderUpdated = trackForumSortOrderUpdated;
exports.trackForumLayoutUpdated = trackForumLayoutUpdated;
exports.trackForumPostLinkCopied = function({postId, location}) {
var defaultImport = importDefault(dependencyMap[5]);
var FORUM_POST_LINK_COPIED = AnalyticEvents.FORUM_POST_LINK_COPIED;
defaultImport.trackWithMetadata(FORUM_POST_LINK_COPIED, {forum_post_id: postId, location: location});
};
exports.trackForumOnboardingClicked = function({onboardingCTA}) {
var defaultImport = importDefault(dependencyMap[5]);
var FORUM_CHANNEL_ONBOARDING_CLICKED = AnalyticEvents.FORUM_CHANNEL_ONBOARDING_CLICKED;
defaultImport.trackWithMetadata(FORUM_CHANNEL_ONBOARDING_CLICKED, {onboarding_cta_type: onboardingCTA});
};
exports.trackForumUpsellModalClicked = function({forumDemoId}) {
var defaultImport = importDefault(dependencyMap[5]);
var FORUM_UPSELL_MODAL_CLICKED = AnalyticEvents.FORUM_UPSELL_MODAL_CLICKED;
defaultImport.trackWithMetadata(FORUM_UPSELL_MODAL_CLICKED, {forum_demo_id: forumDemoId});
};
exports.trackForumAddMediaToOriginalPostClicked = function({added}) {
var defaultImport = importDefault(dependencyMap[5]);
var FORUM_ADD_MEDIA_TO_ORIGINAL_POST_CLICKED = AnalyticEvents.FORUM_ADD_MEDIA_TO_ORIGINAL_POST_CLICKED;
defaultImport.trackWithMetadata(FORUM_ADD_MEDIA_TO_ORIGINAL_POST_CLICKED, {added: added});
};
exports.trackForumChannelMediaUploaderClicked = function({isMobile}) {
var defaultImport = importDefault(dependencyMap[5]);
var FORUM_CHANNEL_MEDIA_UPLOADER_CLICKED = AnalyticEvents.FORUM_CHANNEL_MEDIA_UPLOADER_CLICKED;
defaultImport.trackWithMetadata(FORUM_CHANNEL_MEDIA_UPLOADER_CLICKED, {is_mobile: isMobile});
};
exports.trackForumEnableAutomodClicked = function() {
importDefault(dependencyMap[5]).trackWithMetadata(AnalyticEvents.FORUM_CHANNEL_ENABLE_AUTOMOD_CLICKED);
};
exports.trackForumPreviewPostClicked = function() {
importDefault(dependencyMap[5]).trackWithMetadata(AnalyticEvents.FORUM_CHANNEL_ENABLE_PREVIEW_CLICKED);
};
exports.trackForumPostSidebarViewed = trackForumPostSidebarViewed;
exports.trackMobileForumComposerOpened = function({guildId, channelId, location}) {
var defaultImport = importDefault(dependencyMap[7]);
var OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
defaultImport.track(OPEN_MODAL, {type: 'Create Forum Post', guild_id: guildId, channel_id: channelId,
location: location});
};
exports.trackMobileForumComposerDismissed = function() {
var defaultImport = importDefault(dependencyMap[7]);
var MODAL_DISMISSED = AnalyticEvents.MODAL_DISMISSED;
defaultImport.track(MODAL_DISMISSED, {type: 'Create Forum Post'});
};
exports.trackForumUpsellModalViewed = function() {
var defaultImport = importDefault(dependencyMap[5]);
var OPEN_MODAL = AnalyticEvents.OPEN_MODAL;
defaultImport.trackWithMetadata(OPEN_MODAL, {type: 'Forum Channel Upsell Modal',
location: {section: AnalyticsSections.CHANNEL_WELCOME_CTA}});
};
exports.trackForumCreateNewPostStarted = trackForumCreateNewPostStarted;
}
function trackForumChannelSeenBatch({guildId, channelId, sessionId, postIds, additionalTimes}) { // fn#57355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:307, offset: 0x013e3f40, size: 167 bytes, params: 2, frame: 23
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_SEEN_BATCH = AnalyticEvents.FORUM_CHANNEL_SEEN_BATCH;
const object2 = {};
const trackingUtilsModule = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, trackingUtilsModule.collectForumAnalyticsMetadata({channelId: channelId,
sessionId: sessionId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
object2['post_ids'] = postIds;
object2['additional_seen_time_millis'] = additionalTimes;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_SEEN_BATCH, object2]);
}
function trackForumSearched({guildId, channelId, numSearchResults}) { // fn#57356, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:619, offset: 0x013e3fe7, size: 139 bytes, params: 2, frame: 21
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_SEARCHED = AnalyticEvents.FORUM_CHANNEL_SEARCHED;
const object2 = {};
const trackingUtilsModule = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, trackingUtilsModule.collectForumAnalyticsMetadata({channelId: channelId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
object2['num_search_results'] = numSearchResults;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_SEARCHED, object2]);
}
function trackForumSearchCleared({guildId, channelId}) { // fn#57357, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:873, offset: 0x013e4072, size: 122 bytes, params: 2, frame: 20
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_SEARCH_CLEARED = AnalyticEvents.FORUM_CHANNEL_SEARCH_CLEARED;
const object2 = {};
const trackingUtilsModule = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, trackingUtilsModule.collectForumAnalyticsMetadata({channelId: channelId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_SEARCH_CLEARED, object2]);
}
function trackForumTagFilterClicked({guildId, channelId, tagId, filterTagIds, added, location}) { // fn#57358, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:1101, offset: 0x013e40ec, size: 185 bytes, params: 2, frame: 24
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_TAG_FILTER_CLICKED = AnalyticEvents.FORUM_CHANNEL_TAG_FILTER_CLICKED;
const object2 = {};
const trackingUtilsModule = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, trackingUtilsModule.collectForumAnalyticsMetadata({channelId: channelId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
object2['tag_id'] = tagId;
object2['filter_tag_ids'] = filterTagIds;
object2['added'] = added;
object2['location'] = location;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_TAG_FILTER_CLICKED, object2]);
}
function trackForumCreateNewPostClick({guildId, channelId}) { // fn#57359, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:1425, offset: 0x013e41a5, size: 122 bytes, params: 2, frame: 20
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_CREATE_NEW_POST_CLICKED = AnalyticEvents.FORUM_CHANNEL_CREATE_NEW_POST_CLICKED;
const object2 = {};
const trackingUtilsModule = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, trackingUtilsModule.collectForumAnalyticsMetadata({channelId: channelId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_CREATE_NEW_POST_CLICKED, object2]);
}
function trackForumCreateNewPostKeybindUsed({guildId, channelId}) { // fn#57360, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:1675, offset: 0x013e421f, size: 122 bytes, params: 2, frame: 20
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_CREATE_NEW_POST_KEYBIND_USED = AnalyticEvents.FORUM_CHANNEL_CREATE_NEW_POST_KEYBIND_USED;
const object2 = {};
const trackingUtilsModule = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, trackingUtilsModule.collectForumAnalyticsMetadata({channelId: channelId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_CREATE_NEW_POST_KEYBIND_USED, object2]);
}
function maybeTrackForumNewPostDraftCreated({guildId, channelId}) { // fn#57361, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:1936, offset: 0x013e4299, size: 466 bytes, params: 2, frame: 23
var r2;
var r0;
var r1;
var name;
var length;
var threadSettings;
var template;
var value4;
var value6;
var value13;
var value14;
var defaultImport;
var trackWithMetadata;
var FORUM_CHANNEL_NEW_POST_DRAFT_CREATED;
var object2;
var value;
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
threadSettings = DraftStore.getThreadSettings(channelId);
template = channel.template;
value4 = undefined;
r2 = template == null ? value4 : template.trim();
value6 = DraftStore.getDraft(channelId, DraftType.FirstThreadMessage);
r0 = value6 == null || value6.length === 0;
r0 = !r0 ? (value6 == null ? value4 : value6.trim()) === r2 : r0;
r2 = (threadSettings == null ? value4 : threadSettings.appliedTags) == null || (threadSettings == null || threadSettings.appliedTags == null ? value4 : threadSettings.appliedTags.size) === 0;
name = threadSettings == null ? value4 : threadSettings.name;
value13 = name == null;
if (value13) {
r1 = value13;
} else {
if (threadSettings == null) {
length = value4;
} else {
name = threadSettings.name;
if (name == null) {
length = value4;
} else {
value14 = name.trim();
length = value14 == null ? value4 : value14.length;
}
}
r1 = length === 0;
}
r0 = r0 && r2;
r0 = r0 && r1;
if (!r0) {
defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
trackWithMetadata = defaultImport.trackWithMetadata;
FORUM_CHANNEL_NEW_POST_DRAFT_CREATED = AnalyticEvents.FORUM_CHANNEL_NEW_POST_DRAFT_CREATED;
object2 = {};
value = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, value.collectForumAnalyticsMetadata({channelId: channelId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
value = require(7157) /* metro dependency 7157: TrackingUtils */;
value = value.getForumPostDraftAppliedTagIds(channelId);
object2['applied_tag_ids'] = value;
value = require(7157) /* metro dependency 7157: TrackingUtils */;
value = value.getForumPostDraftNumAttachments(channelId);
object2['num_attachments'] = value;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_NEW_POST_DRAFT_CREATED, object2]);
}
}
}
function trackForumNewPostCleared({guildId, channelId}) { // fn#57362, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:2702, offset: 0x013e446b, size: 122 bytes, params: 2, frame: 20
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_NEW_POST_DRAFT_CLEARED = AnalyticEvents.FORUM_CHANNEL_NEW_POST_DRAFT_CLEARED;
const object2 = {};
const trackingUtilsModule = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, trackingUtilsModule.collectForumAnalyticsMetadata({channelId: channelId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_NEW_POST_DRAFT_CLEARED, object2]);
}
function trackForumPostCreated({guildId, channelId, postId, applicationId, voiceChatEnabled}) { // fn#57363, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:2934, offset: 0x013e44e5, size: 114 bytes, params: 2, frame: 14
if (ForumPostMessagesStore.isLoading(postId)) {
ForumPostMessagesStore.addConditionalChangeListener(_fun57365);
} else {
_trackForumPostCreated();
}
}
function trackForumScrolled({guildId, channelId}) { // fn#57366, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:3396, offset: 0x013e461f, size: 122 bytes, params: 2, frame: 20
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_SCROLLED = AnalyticEvents.FORUM_CHANNEL_SCROLLED;
const object2 = {};
const trackingUtilsModule = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, trackingUtilsModule.collectForumAnalyticsMetadata({channelId: channelId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_SCROLLED, object2]);
}
function trackForumMorePostsLoaded({guildId, channelId, numArchivedThreads, hasMoreThreads, filterTagIds, sortOrder}) { // fn#57367, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:3612, offset: 0x013e4699, size: 290 bytes, params: 2, frame: 27
const defaultImport = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
const track = defaultImport.track;
const FORUM_CHANNEL_MORE_POSTS_LOADED = AnalyticEvents.FORUM_CHANNEL_MORE_POSTS_LOADED;
const object2 = {};
const appAnalyticsUtilsModule = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
copyDataProperties(object2, appAnalyticsUtilsModule.collectGuildAnalyticsMetadata(guildId), undefined);
const moduleValue2 = appAnalyticsUtilsModule;
const collectChannelAnalyticsMetadata = moduleValue2.collectChannelAnalyticsMetadata;
const getChannel = ChannelStore.getChannel;
copyDataProperties(object2, Reflect.apply(collectChannelAnalyticsMetadata, moduleValue2, [Reflect.apply(getChannel,
ChannelStore, [channelId])]), undefined);
let value = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, value.collectForumAnalyticsMetadata({channelId: channelId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
object2['num_archived_threads'] = numArchivedThreads;
value = require(7157) /* metro dependency 7157: TrackingUtils */;
value = value.getNumActiveThreads(guildId, channelId);
object2['num_active_threads'] = value;
object2['has_more_threads'] = hasMoreThreads;
object2['filter_tag_ids'] = filterTagIds;
object2['sort_order'] = sortOrder;
Reflect.apply(track, defaultImport, [FORUM_CHANNEL_MORE_POSTS_LOADED, object2]);
}
function trackForumPostClicked({guildId, channelId, postId, location}) { // fn#57368, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:4121, offset: 0x013e47bb, size: 174 bytes, params: 2, frame: 22
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_POST_CLICKED = AnalyticEvents.FORUM_CHANNEL_POST_CLICKED;
const object2 = {};
const trackingUtilsModule = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, trackingUtilsModule.collectForumPostAnalyticsMetadata({channelId: postId}), postId);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
object2['is_search_result'] = ForumSearchStore.getSearchResults(channelId) != null;
object2['location'] = location;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_POST_CLICKED, object2]);
}
function trackForumSortOrderUpdated({guildId, channelId, sortOrder}) { // fn#57369, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:4425, offset: 0x013e4869, size: 179 bytes, params: 2, frame: 24
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_POSTS_SORTED = AnalyticEvents.FORUM_CHANNEL_POSTS_SORTED;
const object2 = {};
let value = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, value.collectForumAnalyticsMetadata({channelId: channelId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
value = require(7157) /* metro dependency 7157: TrackingUtils */;
value = value.convertSortOrderToReadableString(sortOrder);
object2['sort_type'] = value;
object2['sort_order'] = sortOrder;
object2['forum_channel_sort_order'] = sortOrder;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_POSTS_SORTED, object2]);
}
function trackForumLayoutUpdated({guildId, channelId, forumLayout}) { // fn#57370, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:4757, offset: 0x013e491c, size: 139 bytes, params: 2, frame: 21
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_LAYOUT_UPDATED = AnalyticEvents.FORUM_CHANNEL_LAYOUT_UPDATED;
const object2 = {};
const trackingUtilsModule = require(7157) /* metro dependency 7157: TrackingUtils */;
copyDataProperties(object2, trackingUtilsModule.collectForumAnalyticsMetadata({channelId: channelId}), undefined);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
object2['forum_channel_layout'] = forumLayout;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_LAYOUT_UPDATED, object2]);
}
function trackForumPostSidebarViewed(a0) { // fn#57378, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:6168, offset: 0x013e4b61, size: 256 bytes, params: 2, frame: 22
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const CHANNEL_OPENED = AnalyticEvents.CHANNEL_OPENED;
const object2 = {};
let value = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
copyDataProperties(object2, value.collectGuildAnalyticsMetadata(a0.guild_id), value);
const appAnalyticsUtilsModule = require(4863) /* metro dependency 4863: AppAnalyticsUtils */;
copyDataProperties(object2, appAnalyticsUtilsModule.collectChannelAnalyticsMetadata(a0), value);
value = require(7162) /* metro dependency 7162: ThreadAnalyticsUtils */;
copyDataProperties(object2, value.collectThreadMetadata(a0, true), value);
const moduleValue2 = appAnalyticsUtilsModule;
const getChannelOpenedMetadata = moduleValue2.getChannelOpenedMetadata;
copyDataProperties(object2, Reflect.apply(getChannelOpenedMetadata, moduleValue2, [a0.id]), value);
object2['channel_view'] = 'Split View';
value = require(477) /* metro dependency 477: PlatformUtils */;
value = value.getPlatform();
object2['platform'] = value;
Reflect.apply(trackWithMetadata, defaultImport, [CHANNEL_OPENED, object2]);
(importDefault(7163) /* metro dependency 7163: trackChannelOpenedClickstream */)({channelId: a0.id});
}
function trackForumCreateNewPostStarted({guildId, channelId}) { // fn#57382, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:7081, offset: 0x013e4d49, size: 130 bytes, params: 2, frame: 20
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const THREAD_CREATION_STARTED = AnalyticEvents.THREAD_CREATION_STARTED;
const object2 = {};
const threadAnalyticsUtilsModule = require(7162) /* metro dependency 7162: ThreadAnalyticsUtils */;
const collectThreadMetadata = threadAnalyticsUtilsModule.collectThreadMetadata;
const getChannel = ChannelStore.getChannel;
copyDataProperties(object2, Reflect.apply(collectThreadMetadata, threadAnalyticsUtilsModule,
[Reflect.apply(getChannel, ChannelStore, [channelId])]), ChannelStore);
object2['channel_id'] = channelId;
object2['guild_id'] = guildId;
Reflect.apply(trackWithMetadata, defaultImport, [THREAD_CREATION_STARTED, object2]);
}
function _trackForumPostCreated() { // fn#57364, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:3034, owner: trackForumPostCreated._trackForumPostCreated, offset: 0x013e4557, size: 152 bytes, params: 1, frame: 19
let value = environment.__proto__;
const defaultImport = importDefault(4863) /* metro dependency 4863: AppAnalyticsUtils */;
const trackWithMetadata = defaultImport.trackWithMetadata;
const FORUM_CHANNEL_POST_CREATED = AnalyticEvents.FORUM_CHANNEL_POST_CREATED;
const object2 = {};
value = require(7157) /* metro dependency 7157: TrackingUtils */;
const collectForumPostAnalyticsMetadata = value.collectForumPostAnalyticsMetadata;
const postIdBinding = postId;
copyDataProperties(object2, Reflect.apply(collectForumPostAnalyticsMetadata, value, [{channelId: postIdBinding}]),
postIdBinding);
object2['guild_id'] = guildId;
object2['channel_id'] = channelId;
object2['application_id'] = applicationId;
object2['voice_chat_enabled'] = voiceChatEnabled;
Reflect.apply(trackWithMetadata, defaultImport, [FORUM_CHANNEL_POST_CREATED, object2]);
}
function _fun57365() { // fn#57365, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7333:3295, offset: 0x013e45ef, size: 48 bytes, params: 1, frame: 12
var r0;
const value = environment.__proto__;
const isLoading2 = ForumPostMessagesStore.isLoading(postId);
if (isLoading2) {
r0 = !!isLoading2;
} else {
_trackForumPostCreated();
r0 = false;
}
return r0;
}
@@ -0,0 +1,298 @@
/* Metro module 7157; source: modules/forums/tracking/TrackingUtils.tsx; dependencies: [4790, 3786, 7158, 6898, 1379, 4645, 3784, 4644, 6865, 661, 1386, 1243, 7159, 1388, 7160, 21, 7161, 2] */
function _fun57405(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#57405, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:6, offset: 0x013e5341, size: 456 bytes, params: 8, frame: 22
const env0_0 = require;
const closure = getForumChannelSessionId;
const closure2 = getForumPostAttachmentMimetypes;
const closure3 = collectForumAnalyticsMetadata;
let Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
const activeThreadsStore = importDefault(4790) /* metro dependency 4790: ActiveThreadsStore */;
const joinedThreadsStore = importDefault(3786) /* metro dependency 3786: JoinedThreadsStore */;
const threadMembersStore = importDefault(7158) /* metro dependency 7158: ThreadMembersStore */;
const threadMessageStore = importDefault(6898) /* metro dependency 6898: ThreadMessageStore */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const draftStore = importDefault(4645) /* metro dependency 4645: DraftStore */;
const env0_9 = (require(4645) /* metro dependency 4645: DraftStore */).DraftType;
const permissionStore = importDefault(3784) /* metro dependency 3784: PermissionStore */;
const uploadAttachmentStore = importDefault(4644) /* metro dependency 4644: UploadAttachmentStore */;
const forumPostMessagesStore = importDefault(6865) /* metro dependency 6865: ForumPostMessagesStore */;
const env0_13 = (require(661) /* metro dependency 661: Constants */).Permissions;
const env0_14 = (require(1386) /* metro dependency 1386: ChannelConstants */).ChannelFlags;
const env0_15 = (require(1243) /* metro dependency 1243: ThreadConstants */).ThreadSortOrderReadableForAnalytics;
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/forums/tracking/TrackingUtils.tsx');
exports.getForumChannelSessionId = closure;
exports.convertSortOrderToReadableString = convertSortOrderToReadableString;
exports.getForumPostDraftNumAttachments = function(a0) {
return UploadAttachmentStore.getUploads(a0, DraftType.FirstThreadMessage).length;
};
exports.getForumPostDraftAppliedTagIds = getForumPostDraftAppliedTagIds;
exports.getNumActiveThreads = function(a0, a1) {
var Object = global.Object;
return Object.keys(ActiveThreadsStore.getThreadsForParent(a0, a1)).length;
};
exports.getForumPostAttachmentMimetypes = closure2;
exports.collectForumAnalyticsMetadata = closure3;
exports.collectForumPostAnalyticsMetadata = collectForumPostAnalyticsMetadata;
}
function getForumChannelSessionId(a0) { // fn#57406, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:299, offset: 0x013e5509, size: 41 bytes, params: 2, frame: 11
return (importDefault(7159) /* metro dependency 7159: ForumSessionAnalyticsManager */).getForumChannelSessionId(a0);
}
function getForumPostFirstMessage(a0) { // fn#57407, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:380, offset: 0x013e5532, size: 43 bytes, params: 2, frame: 11
const message = ForumPostMessagesStore.getMessage(a0);
return message.loaded ? message.firstMessage : null;
}
function getForumPostUniqueReactionCount(a0) { // fn#57408, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:483, offset: 0x013e555d, size: 41 bytes, params: 2, frame: 11
const forumPostFirstMessage = getForumPostFirstMessage(a0);
return forumPostFirstMessage == null ? 0 : forumPostFirstMessage.reactions.length;
}
function getForumPostReactionCount(a0) { // fn#57409, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:597, offset: 0x013e5586, size: 57 bytes, params: 2, frame: 14
var r0;
let value = getForumPostFirstMessage(a0);
const value2 = 0;
if (value == null) {
r0 = value2;
} else {
value = value.reactions.reduce(function(a0, a1) {
return a0 + a1.count;
}, value2);
r0 = value;
}
return r0;
}
function getForumPostAppliedTagIds(a0) { // fn#57411, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:727, offset: 0x013e55bf, size: 173 bytes, params: 2, frame: 16
const channel = ChannelStore.getChannel(a0);
if (channel == null) {
return [];
}
let value = ChannelStore.getChannel(channel.parent_id);
const value3 = undefined;
const availableTags = value == null ? value3 : value.availableTags;
if (value == null) {
return [];
}
if (availableTags == null) {
return [];
}
const Set = global.Set;
value = availableTags.map(function(a0) {
return a0.id;
});
const set = new Set();
const appliedTags = channel.appliedTags;
let r0 = appliedTags == null ? value3 : appliedTags.filter(_fun57413);
r0 = r0 ?? [];
return r0;
}
function getForumPostAttachmentMimetypes(a0) { // fn#57414, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:1014, offset: 0x013e566c, size: 54 bytes, params: 2, frame: 11
var r0;
let value = getForumPostFirstMessage(a0);
if (value == null) {
r0 = [];
} else {
value = value.attachments.map(function({content_type}) {
return content_type ?? 'unknown';
});
r0 = value;
}
return r0;
}
function collectForumAnalyticsMetadata({channelId, sessionId}) { // fn#57416, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:1186, offset: 0x013e56bd, size: 492 bytes, params: 2, frame: 21
var r6;
var r0;
var object2;
var defaultReactionEmoji;
var value6;
var availableTags;
var defaultImport2;
var getSortOrderAnalytics;
var id;
var getLayoutAnalytics;
var getTagSettingAnalytics;
var value;
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
if (channel.isForumLikeChannel()) {
object2 = {};
object2.forum_channel_has_guidelines = channel.topic != null && channel.topic.trim().length > 0;
defaultReactionEmoji = channel.defaultReactionEmoji;
value6 = undefined;
object2.forum_channel_default_emoji_reaction_id = defaultReactionEmoji == null ? value6 : defaultReactionEmoji.emojiId;
defaultReactionEmoji = channel.defaultReactionEmoji;
object2.forum_channel_default_emoji_reaction_name = defaultReactionEmoji == null ? value6 : defaultReactionEmoji.emojiName;
availableTags = channel.availableTags;
r6 = availableTags == null ? value6 : availableTags.map(function(a0) {
return a0.id;
});
r6 = r6 ?? [];
object2.forum_channel_available_tag_ids = r6;
object2.forum_channel_tag_required = channel.hasFlag(ChannelFlags.REQUIRE_TAG);
object2.forum_channel_can_create_post = PermissionStore.can(Permissions.SEND_MESSAGES, channel);
object2.forum_channel_filter_tag_ids = (importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */).getFilterTagIdsAnalytics();
defaultImport2 = importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */;
getSortOrderAnalytics = defaultImport2.getSortOrderAnalytics;
id = channel.id;
object2.forum_channel_sort_order = Reflect.apply(getSortOrderAnalytics, defaultImport2, [id]);
object2.forum_channel_session_id = sessionId ?? getForumChannelSessionId(channel.id);
value = importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */;
getLayoutAnalytics = value.getLayoutAnalytics;
id = channel.id;
object2.forum_channel_layout = Reflect.apply(getLayoutAnalytics, value, [id]);
object2.forum_channel_default_sort_order = channel.defaultSortOrder;
value = importDefault(7160) /* metro dependency 7160: ForumChannelAnalyticsManager */;
getTagSettingAnalytics = value.getTagSettingAnalytics;
id = channel.id;
object2.forum_channel_tag_setting = Reflect.apply(getTagSettingAnalytics, value, [id]);
object2.forum_channel_default_layout = channel.defaultForumLayout;
object2.forum_channel_is_moderator_report_channel = channel.isModeratorReportChannel();
r0 = object2;
} else {
r0 = null;
}
} else {
r0 = null;
}
return r0;
}
function convertSortOrderToReadableString(a0) { // fn#57418, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:2432, offset: 0x013e58a9, size: 153 bytes, params: 2, frame: 14
const ThreadSortOrder = (require(1388) /* metro dependency 1388: ThreadSortOrder */).ThreadSortOrder;
const CREATION_DATE = ThreadSortOrder.CREATION_DATE;
if (CREATION_DATE === a0) {
return ThreadSortOrderReadableForAnalytics.CREATION_DATE;
}
const LATEST_ACTIVITY = ThreadSortOrder.LATEST_ACTIVITY;
if (LATEST_ACTIVITY === a0) {
return ThreadSortOrderReadableForAnalytics.LATEST_ACTIVITY;
}
const Error = global.Error;
const value = 'Unexpected sort order ' + a0;
const value2 = Object.create(Error.prototype, {constructor: {value: Error}});
const error = new Error();
throw error instanceof Object ? error : value2;
}
function getForumPostDraftAppliedTagIds(a0) { // fn#57420, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:2844, offset: 0x013e5969, size: 234 bytes, params: 2, frame: 16
const channel = ChannelStore.getChannel(a0);
if (channel == null) {
return [];
}
const channel2 = ChannelStore.getChannel(channel.parent_id);
const value4 = undefined;
const availableTags = channel2 == null ? value4 : channel2.availableTags;
if (channel2 == null) {
return [];
}
if (availableTags == null) {
return [];
}
let value = DraftStore.getThreadSettings(a0);
const r3 = (value == null ? value4 : value.appliedTags) ?? new global.Set();
const Set = global.Set;
value = availableTags.map(function(a0) {
return a0.id;
});
const set = new Set();
const Array = global.Array;
return Array.from(r3).filter(_fun57422);
}
function collectForumPostAnalyticsMetadata({channelId, sessionId}) { // fn#57424, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:7335:3454, offset: 0x013e5a85, size: 695 bytes, params: 2, frame: 21
var locked;
var r7;
var r1;
var value4;
var object2;
var collectForumAnalyticsMetadataBinding;
var id;
var value5;
var threadMetadata;
var defaultImport2;
var castChannelIdAsMessageId;
var getForumPostReactionCountBinding;
var getForumPostUniqueReactionCountBinding;
var getForumPostAppliedTagIdsBinding;
var defaultImport3;
var getReadStateSnapshotAnalytics;
var value15;
var defaultImport4;
var value16;
var hasJoined;
var getForumPostAttachmentMimetypesBinding;
const channel = ChannelStore.getChannel(channelId);
if (channel != null) {
if (channel.isForumPost()) {
value4 = ChannelStore.getChannel(channel.parent_id);
if (value4 != null) {
if (value4.isForumLikeChannel()) {
object2 = {};
collectForumAnalyticsMetadataBinding = collectForumAnalyticsMetadata;
id = value4.id;
value5 = undefined;
copyDataProperties(object2, collectForumAnalyticsMetadataBinding({channelId: id,
sessionId: sessionId}),
channelId);
object2['thread_approximate_member_count'] = ThreadMembersStore.getMemberCount(channelId);
object2['thread_approximate_message_count'] = ThreadMessageStore.getCount(channelId);
threadMetadata = channel.threadMetadata;
object2['thread_archived'] = (threadMetadata == null ? value5 : threadMetadata.archived) === true;
threadMetadata = channel.threadMetadata;
locked = threadMetadata == null ? value5 : threadMetadata.locked;
r7 = locked != null && locked;
object2['thread_locked'] = r7;
threadMetadata = channel.threadMetadata;
r7 = (threadMetadata == null ? value5 : threadMetadata.autoArchiveDuration) ?? 0;
object2['thread_auto_archive_duration_minutes'] = r7;
object2['thread_approximate_creation_date'] = (importDefault(21) /* metro dependency 21: SnowflakeUtils */).extractTimestamp(channelId);
id = channel.id;
object2['forum_post_id'] = id;
defaultImport2 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
castChannelIdAsMessageId = defaultImport2.castChannelIdAsMessageId;
id = channel.id;
object2['forum_post_first_message_id'] = Reflect.apply(castChannelIdAsMessageId, defaultImport2,
[id]);
getForumPostReactionCountBinding = getForumPostReactionCount;
id = channel.id;
object2['forum_post_num_reactions'] = getForumPostReactionCountBinding(id);
getForumPostUniqueReactionCountBinding = getForumPostUniqueReactionCount;
id = channel.id;
object2['forum_post_num_unique_reactions'] = getForumPostUniqueReactionCountBinding(id);
getForumPostAppliedTagIdsBinding = getForumPostAppliedTagIds;
id = channel.id;
object2['forum_post_applied_tag_ids'] = getForumPostAppliedTagIdsBinding(id);
object2['forum_post_is_pinned'] = channel.hasFlag(ChannelFlags.PINNED);
defaultImport3 = importDefault(7161) /* metro dependency 7161: ForumPostAnalyticsManager */;
getReadStateSnapshotAnalytics = defaultImport3.getReadStateSnapshotAnalytics;
id = channel.id;
value15 = Reflect.apply(getReadStateSnapshotAnalytics, defaultImport3, [id]);
object2['forum_post_is_new'] = value15 == null ? value5 : value15.isNew;
defaultImport4 = importDefault(7161) /* metro dependency 7161: ForumPostAnalyticsManager */;
getReadStateSnapshotAnalytics = defaultImport4.getReadStateSnapshotAnalytics;
id = channel.id;
value16 = Reflect.apply(getReadStateSnapshotAnalytics, defaultImport4, [id]);
object2['forum_post_is_unread'] = value16 == null ? value5 : value16.hasUnreads;
hasJoined = JoinedThreadsStore.hasJoined;
id = channel.id;
object2['forum_post_is_following'] = Reflect.apply(hasJoined, JoinedThreadsStore, [id]);
getForumPostAttachmentMimetypesBinding = getForumPostAttachmentMimetypes;
id = channel.id;
object2['forum_post_attachment_mimetypes'] = getForumPostAttachmentMimetypesBinding(id);
r1 = object2;
} else {
r1 = null;
}
} else {
r1 = null;
}
return r1;
}
}
return null;
}