95 lines
5.3 KiB
TypeScript
95 lines
5.3 KiB
TypeScript
/* Metro module 8818; source: modules/user_profile/hooks/useUserProfileMutuals.tsx; dependencies: [57, 31, 5221, 4896, 5189, 566, 22, 8819, 2] */
|
|
function _fun68927(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68927, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9003:6, offset: 0x01c61d7b, size: 187 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 = (require(31) /* metro dependency 31 */).useMemo;
|
|
const userAffinitiesV2Store = importDefault(5221) /* metro dependency 5221: UserAffinitiesV2Store */;
|
|
const sortedGuildStore = importDefault(4896) /* metro dependency 4896: SortedGuildStore */;
|
|
const userProfileStore = importDefault(5189) /* metro dependency 5189: UserProfileStore */;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/user_profile/hooks/useUserProfileMutuals.tsx');
|
|
exports.default = useUserProfileMutuals;
|
|
}
|
|
|
|
function useUserProfileMutuals(a0) { // fn#68928, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9003:250, offset: 0x01c61e36, size: 358 bytes, params: 2, frame: 24
|
|
const env0_0 = a0;
|
|
const fluxModule = require(566) /* metro dependency 566: flux */;
|
|
const useStateFromStoresArray = fluxModule.useStateFromStoresArray;
|
|
const value3 = env0_3(Reflect.apply(useStateFromStoresArray, fluxModule, [[UserProfileStore], _fun68929]), 5);
|
|
const property = value3[0];
|
|
const property2 = value3[1];
|
|
const property3 = value3[2];
|
|
const property4 = value3[3];
|
|
const property5 = value3[4];
|
|
const userAffinitiesMap = fluxModule.useStateFromStores([UserAffinitiesV2Store], function() {
|
|
return UserAffinitiesV2Store.getUserAffinitiesMap();
|
|
});
|
|
const flattenedGuildIds = fluxModule.useStateFromStores([SortedGuildStore], function() {
|
|
return SortedGuildStore.getFlattenedGuildIds();
|
|
});
|
|
const value4 = useMemo(_fun68932, [property2, userAffinitiesMap]);
|
|
const value5 = useMemo(_fun68934, [property3, flattenedGuildIds]);
|
|
return {mutualFriendsCount: property ?? (importDefault(8819) /* metro dependency 8819: usePrevValue */)(property),
|
|
mutualFriends: value4 ?? (importDefault(8819) /* metro dependency 8819: usePrevValue */)(value4),
|
|
mutualGuilds: value5 ?? (importDefault(8819) /* metro dependency 8819: usePrevValue */)(value5),
|
|
isFetching: property4, isFetchingFriends: property5};
|
|
}
|
|
|
|
function _fun68929() { // fn#68929, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9003:327, offset: 0x01c61f9c, size: 120 bytes, params: 1, frame: 13
|
|
const value = environment.__proto__;
|
|
const getMutualFriendsCount = UserProfileStore.getMutualFriendsCount;
|
|
const binding = env0_0;
|
|
const getMutualFriends = UserProfileStore.getMutualFriends;
|
|
const getMutualGuilds = UserProfileStore.getMutualGuilds;
|
|
return [Reflect.apply(getMutualFriendsCount, UserProfileStore, [binding.id]), Reflect.apply(getMutualFriends,
|
|
UserProfileStore, [binding.id]), Reflect.apply(getMutualGuilds, UserProfileStore, [binding.id]),
|
|
UserProfileStore.isFetchingProfile(binding.id), UserProfileStore.isFetchingFriends(binding.id)];
|
|
}
|
|
|
|
function _fun68932() { // fn#68932, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9003:645, offset: 0x01c6203a, size: 87 bytes, params: 1, frame: 14
|
|
var environment;
|
|
var r0;
|
|
var value2;
|
|
var moduleValue;
|
|
if (env0_1 == null) {
|
|
r0 = env0_1;
|
|
} else if (env0_1.length < 2) {
|
|
r0 = env0_1;
|
|
} else {
|
|
value2 = environment.__proto__;
|
|
moduleValue = require(22) /* metro dependency 22 */;
|
|
r0 = moduleValue.sortBy(env0_1, _fun68933);
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun68934() { // fn#68934, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9003:808, offset: 0x01c620d9, size: 131 bytes, params: 1, frame: 16
|
|
if (env0_2 == null) {
|
|
return env0_2;
|
|
}
|
|
if (env0_2.length < 2) {
|
|
return env0_2;
|
|
}
|
|
const Object = global.Object;
|
|
const fromEntries = Object.fromEntries;
|
|
const flattenedGuildIdsBinding = flattenedGuildIds;
|
|
const env0_0 = Reflect.apply(fromEntries, Object, [flattenedGuildIdsBinding.map(function(a0, a1) {
|
|
return [a0, a1];
|
|
})]);
|
|
const moduleValue = require(22) /* metro dependency 22 */;
|
|
return moduleValue.sortBy(env0_2, _fun68936);
|
|
}
|
|
|
|
function _fun68933({user}) { // fn#68933, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9003:689, offset: 0x01c62091, size: 72 bytes, params: 2, frame: 12
|
|
let value = environment.__proto__;
|
|
const communicationProbability = userAffinitiesMap.get(user.id)?.communicationProbability;
|
|
value = -1;
|
|
return value * (communicationProbability ?? value);
|
|
}
|
|
|
|
function _fun68936({guild}) { // fn#68936, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9003:918, offset: 0x01c6215c, size: 44 bytes, params: 2, frame: 2
|
|
return env0_0[guild.id] ?? flattenedGuildIds.length;
|
|
}
|
|
|