decord/source/modules/interaction_components/native/NativeSearchableSelectActionComponentUtils.tsx

114 lines
4.3 KiB
TypeScript
Raw Normal View History

2026-07-24 07:16:23 +00:00
// Module ID: 7895
// Function ID: 62613
2026-07-20 16:05:17 +00:00
// Name: getChannelIconData
2026-07-24 07:16:23 +00:00
// Dependencies: [1348, 1910, 1838, 1849, 653, 4359, 1327, 1395, 5487, 7896, 665, 689, 7897, 4593, 2]
2026-07-20 16:05:17 +00:00
// Exports: transformSearchableSelectOptions
2026-07-24 07:16:23 +00:00
// Module 7895 (getChannelIconData)
2026-07-23 10:11:24 +00:00
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
import closure_5 from "_createForOfIteratorHelperLoose";
import closure_6 from "_isNativeReflectConstruct";
import ME from "ME";
let closure_7;
let closure_8;
const require = arg1;
2026-07-20 16:05:17 +00:00
function getChannelIconData(channel, guild) {
if (channel.type === constants.GUILD_CATEGORY) {
2026-07-24 07:16:23 +00:00
let channelIconWithGuild = importDefault(7897);
2026-07-20 16:05:17 +00:00
} else {
2026-07-23 10:11:24 +00:00
channelIconWithGuild = require(4593) /* getThreadChannelIcon */.getChannelIconWithGuild(channel, guild);
const obj = require(4593) /* getThreadChannelIcon */;
2026-07-20 16:05:17 +00:00
}
return channelIconWithGuild;
}
2026-07-23 10:11:24 +00:00
({ ChannelTypes: closure_7, DEFAULT_ROLE_COLOR: closure_8 } = ME);
const result = require("_createForOfIteratorHelperLoose").fileFinishedImporting("modules/interaction_components/native/NativeSearchableSelectActionComponentUtils.tsx");
2026-07-20 16:05:17 +00:00
export const transformSearchableSelectOptions = function transformSearchableSelectOptions(found, guildId) {
2026-07-23 10:11:24 +00:00
const _require = guildId;
2026-07-20 16:05:17 +00:00
const guild2 = guild.getGuild(guildId);
const mapped = found.map((type) => {
let customIconSrc;
let unicodeEmoji;
type = type.type;
2026-07-23 10:11:24 +00:00
if (guildId(outer1_2[5]).SelectOptionType.USER === type) {
const user = outer1_6.getUser(type.value);
2026-07-20 16:05:17 +00:00
let tmp33 = type;
if (null != user) {
let obj = {};
const merged = Object.assign(type);
2026-07-23 10:11:24 +00:00
obj["iconSrc"] = guildId(outer1_2[7]).ensureAvatarSource(user.getAvatarSource(guildId, false)).uri;
2026-07-20 16:05:17 +00:00
tmp33 = obj;
2026-07-23 10:11:24 +00:00
const obj10 = guildId(outer1_2[7]);
2026-07-20 16:05:17 +00:00
}
return tmp33;
2026-07-23 10:11:24 +00:00
} else if (guildId(outer1_2[5]).SelectOptionType.ROLE === type) {
2026-07-20 16:05:17 +00:00
let role = null;
if (null != callback) {
2026-07-23 10:11:24 +00:00
role = outer1_4.getRole(tmp7.id, type.value);
2026-07-20 16:05:17 +00:00
}
let tmp11 = type;
if (null != role) {
tmp11 = type;
if (null != tmp7) {
let roleIconData = null;
if (obj14.canGuildUseRoleIcons(tmp7, role)) {
2026-07-23 10:11:24 +00:00
obj = guildId(outer1_2[8]);
2026-07-20 16:05:17 +00:00
roleIconData = obj.getRoleIconData(role);
}
if (null == roleIconData) {
obj = {};
const merged1 = Object.assign(type);
2026-07-23 10:11:24 +00:00
let obj2 = guildId(outer1_2[7]);
obj["iconSrc"] = obj2.ensureAvatarSource(callback(outer1_2[9])).uri;
2026-07-20 16:05:17 +00:00
if (null != role.colorString) {
2026-07-23 10:11:24 +00:00
let obj3 = guildId(outer1_2[10]);
2026-07-20 16:05:17 +00:00
let hex2intResult = obj3.hex2int(role.colorString);
} else {
2026-07-23 10:11:24 +00:00
hex2intResult = outer1_8;
2026-07-20 16:05:17 +00:00
}
obj["iconColor"] = 4278190080 | hex2intResult;
tmp11 = obj;
} else {
({ customIconSrc, unicodeEmoji } = roleIconData);
if (null != unicodeEmoji) {
const obj1 = {};
const merged2 = Object.assign(type);
obj2 = {};
({ id: obj7.id, name: obj7.name, animated: obj7.animated, url: obj7.src, surrogates: obj7.surrogates } = unicodeEmoji);
obj1["iconEmoji"] = obj2;
tmp11 = obj1;
} else if (null != customIconSrc) {
obj3 = {};
const merged3 = Object.assign(type);
obj3["iconSrc"] = customIconSrc;
tmp11 = obj3;
}
}
2026-07-23 10:11:24 +00:00
obj14 = guildId(outer1_2[8]);
2026-07-20 16:05:17 +00:00
}
}
return tmp11;
2026-07-23 10:11:24 +00:00
} else if (guildId(outer1_2[5]).SelectOptionType.CHANNEL === type) {
const channel = outer1_3.getChannel(type.value);
2026-07-20 16:05:17 +00:00
let tmp6 = type;
if (null != channel) {
const obj4 = {};
const merged4 = Object.assign(type);
2026-07-23 10:11:24 +00:00
obj4["iconSrc"] = guildId(outer1_2[7]).ensureAvatarSource(outer1_9(channel, callback)).uri;
const obj12 = guildId(outer1_2[7]);
obj4["iconColor"] = 4278190080 | guildId(outer1_2[10]).hex2int(callback(outer1_2[11]).unsafe_rawColors.PRIMARY_330);
2026-07-20 16:05:17 +00:00
tmp6 = obj4;
2026-07-23 10:11:24 +00:00
const obj13 = guildId(outer1_2[10]);
2026-07-20 16:05:17 +00:00
}
return tmp6;
} else {
return null;
}
});
2026-07-23 10:11:24 +00:00
return mapped.filter(_require(1327).isNotNullish);
2026-07-20 16:05:17 +00:00
};
export { getChannelIconData };