2026-09-12 13:45:10 +00:00
|
|
|
// Module ID: 7763
|
|
|
|
|
// Function ID: 7764
|
2026-09-10 05:38:07 +00:00
|
|
|
// Name: UserSearchUtils
|
2026-09-12 13:45:10 +00:00
|
|
|
// Dependencies: [7764, 2021, 4285, 1074, 1925, 4481, 2]
|
2026-07-29 08:29:29 +00:00
|
|
|
// Exports: cleanString, getNames, getRelationshipType
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-09-12 13:45:10 +00:00
|
|
|
// Module 7763 (UserSearchUtils)
|
2026-09-10 05:38:07 +00:00
|
|
|
import StringUtils from "StringUtils" /* 1925 */;
|
2026-09-12 13:45:10 +00:00
|
|
|
import UserUtilsDefault from "UserUtils" /* 4481 */;
|
|
|
|
|
import FriendSuggestionStore from "FriendSuggestionStore" /* 7764 */;
|
2026-09-10 05:38:07 +00:00
|
|
|
import GuildMemberStore from "GuildMemberStore" /* 2021 */;
|
2026-09-12 13:45:10 +00:00
|
|
|
import RelationshipStore from "RelationshipStore" /* 4285 */;
|
2026-07-23 10:11:24 +00:00
|
|
|
|
2026-09-10 05:38:07 +00:00
|
|
|
require = fn;
|
|
|
|
|
const RelationshipTypes = fn(1074).RelationshipTypes;
|
|
|
|
|
const size = fn(2);
|
|
|
|
|
const result = size.fileFinishedImporting("modules/main_tabs_v2/UserSearchUtils.tsx");
|
2026-07-20 16:05:17 +00:00
|
|
|
|
2026-07-29 08:29:29 +00:00
|
|
|
export const cleanString = function cleanString(toLocaleLowerCase) {
|
2026-09-10 05:38:07 +00:00
|
|
|
return StringUtils.stripDiacritics(toLocaleLowerCase.toLocaleLowerCase()).trim();
|
2026-07-29 08:29:29 +00:00
|
|
|
};
|
2026-07-20 16:05:17 +00:00
|
|
|
export const getRelationshipType = function getRelationshipType(id) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const relationshipType = RelationshipStore.getRelationshipType(id);
|
2026-07-20 16:05:17 +00:00
|
|
|
let SUGGESTION = relationshipType;
|
|
|
|
|
if (relationshipType === RelationshipTypes.NONE) {
|
|
|
|
|
SUGGESTION = relationshipType;
|
2026-09-10 05:38:07 +00:00
|
|
|
if (null != FriendSuggestionStore.getSuggestion(id)) {
|
2026-07-29 08:29:29 +00:00
|
|
|
SUGGESTION = tmp2.SUGGESTION;
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return SUGGESTION;
|
|
|
|
|
};
|
|
|
|
|
export const getNames = function getNames(user) {
|
|
|
|
|
const names = {};
|
2026-09-10 05:38:07 +00:00
|
|
|
const nick = RelationshipStore.getNickname(user.id);
|
2026-07-20 16:05:17 +00:00
|
|
|
if (null != nick) {
|
2026-09-05 10:56:28 +00:00
|
|
|
const obj3 = names(1925);
|
|
|
|
|
let str = names(1925).stripDiacritics(nick.toLocaleLowerCase());
|
|
|
|
|
names[nick] = names(1925).stripDiacritics(nick.toLocaleLowerCase()).trim().split(" ");
|
|
|
|
|
let str2 = names(1925).stripDiacritics(nick.toLocaleLowerCase()).trim();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-09-10 05:38:07 +00:00
|
|
|
const globalName = UserUtilsDefault.getGlobalName(user);
|
2026-07-20 16:05:17 +00:00
|
|
|
if (tmp4) {
|
2026-09-05 10:56:28 +00:00
|
|
|
const obj6 = names(1925);
|
|
|
|
|
const str4 = names(1925).stripDiacritics(globalName.toLocaleLowerCase());
|
|
|
|
|
names[globalName] = names(1925).stripDiacritics(globalName.toLocaleLowerCase()).trim().split(" ");
|
|
|
|
|
const str5 = names(1925).stripDiacritics(globalName.toLocaleLowerCase()).trim();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
2026-07-29 08:29:29 +00:00
|
|
|
const username = user.username;
|
2026-07-23 10:11:24 +00:00
|
|
|
tmp4 = null != globalName && null == names[globalName];
|
2026-09-05 10:56:28 +00:00
|
|
|
const obj7 = names(1925);
|
|
|
|
|
const str7 = names(1925).stripDiacritics(username.toLocaleLowerCase());
|
|
|
|
|
names[user.username] = names(1925).stripDiacritics(username.toLocaleLowerCase()).trim().split(" ");
|
2026-09-10 05:38:07 +00:00
|
|
|
const nicknames = GuildMemberStore.getNicknames(user.id);
|
2026-07-29 08:29:29 +00:00
|
|
|
const item = nicknames.forEach((toLocaleLowerCase) => {
|
|
|
|
|
if (null == names[toLocaleLowerCase]) {
|
2026-09-10 05:38:07 +00:00
|
|
|
const str = StringUtils.stripDiacritics(toLocaleLowerCase.toLocaleLowerCase());
|
|
|
|
|
tmp[toLocaleLowerCase] = StringUtils.stripDiacritics(toLocaleLowerCase.toLocaleLowerCase()).trim().split(" ");
|
|
|
|
|
const str2 = StringUtils.stripDiacritics(toLocaleLowerCase.toLocaleLowerCase()).trim();
|
2026-07-20 16:05:17 +00:00
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
return { names, nick };
|
|
|
|
|
};
|