decord/source/modules/coded_links/MessageCodedLinkManager.tsx

357 lines
15 KiB
TypeScript
Raw Normal View History

// Module ID: 17665
// Function ID: 17666
// Name: MessageCodedLinkManager
// Dependencies: [5, 7571, 1958, 4624, 4623, 4628, 17666, 8527, 7438, 12222, 7232, 17673, 2]
2026-07-20 16:05:17 +00:00
// Module 17665 (MessageCodedLinkManager)
import findCodedLinksDefault from "findCodedLinks" /* 4623 */;
import setupLoadFromMessageManagerHandlersDefault from "setupLoadFromMessageManagerHandlers" /* 17673 */;
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import GuildTemplateStore from "GuildTemplateStore" /* 7571 */;
import ChannelStore from "ChannelStore" /* 1958 */;
import InviteStore from "InviteStore" /* 4624 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 7232 */;
2026-07-23 10:11:24 +00:00
const require = fn;
2026-07-20 16:05:17 +00:00
function resolveMessageCodedLinks(content) {
2026-08-31 15:47:37 +00:00
closure_0 = content;
content = content.content;
if (content == null) {
content = null;
2026-07-20 16:05:17 +00:00
}
let arr = findCodedLinksDefault(content);
2026-08-31 15:47:37 +00:00
let tmp2 = null != arr;
if (tmp2) {
tmp2 = 0 !== arr.length;
}
if (tmp2) {
let item = arr.forEach((item) => {
({ type, code } = item);
if (code(dependencyMap[5]).CodedLinkType.INVITE === type) {
const result = tmp(tmp2[6]).queueMessageLinkFetch(closure_3(function*(arg0, value) {
2026-07-29 08:29:29 +00:00
if (c0 === 2) {
c0 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-07-29 08:29:29 +00:00
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
const obj3 = { value, done: true };
return obj3;
2026-07-29 08:29:29 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c0 = 2;
if (0 === v1) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
c0 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c0 = 3;
const obj4 = { value, done: true };
return obj4;
2026-07-29 08:29:29 +00:00
} else {
if (null == invite.getInvite(code)) {
v1 = 1;
2026-07-29 08:29:29 +00:00
c0 = 1;
const obj5 = { value: v1(dependencyMap[7]).resolveInvite(tmp6), done: false };
return obj5;
2026-07-29 08:29:29 +00:00
}
tmp6 = code;
2026-07-29 08:29:29 +00:00
}
} else if (arg0 === 1) {
c0 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c0 = 3;
const obj = { value, done: true };
2026-07-29 08:29:29 +00:00
return obj;
}
c0 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
} catch (tmp10) {
c0 = tmp;
throw tmp10;
}
}
}));
const tmpResult = tmp(tmp2[6]);
2026-08-31 15:47:37 +00:00
} else if (tmp(tmp2[5]).CodedLinkType.TEMPLATE === type) {
const result1 = tmp(tmp2[6]).queueMessageLinkFetch(closure_3(function*(arg0, value) {
2026-07-29 08:29:29 +00:00
if (c0 === 2) {
c0 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-07-29 08:29:29 +00:00
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
const obj3 = { value, done: true };
return obj3;
2026-07-29 08:29:29 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c0 = 2;
if (0 === v1) {
2026-07-29 08:29:29 +00:00
if (arg0 === 1) {
c0 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c0 = 3;
const obj4 = { value, done: true };
return obj4;
2026-07-29 08:29:29 +00:00
} else {
if (null == guildTemplate.getGuildTemplate(code)) {
v1 = 1;
2026-07-29 08:29:29 +00:00
c0 = 1;
const obj5 = { value: v1(dependencyMap[8]).resolveGuildTemplate(tmp6), done: false };
return obj5;
2026-07-29 08:29:29 +00:00
}
tmp6 = code;
2026-07-29 08:29:29 +00:00
}
} else if (arg0 === 1) {
c0 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c0 = 3;
const obj = { value, done: true };
2026-07-29 08:29:29 +00:00
return obj;
}
c0 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
} catch (tmp10) {
c0 = tmp;
throw tmp10;
}
}
}));
const tmpResult3 = tmp(tmp2[6]);
2026-08-31 15:47:37 +00:00
} else if (tmp(tmp2[5]).CodedLinkType.BUILD_OVERRIDE !== type) {
if (tmp(tmp2[5]).CodedLinkType.MANUAL_BUILD_OVERRIDE !== type) {
if (tmp(tmp2[5]).CodedLinkType.EVENT !== type) {
if (tmp(tmp2[5]).CodedLinkType.CHANNEL_LINK !== type) {
if (tmp(tmp2[5]).CodedLinkType.ACTIVITY_BOOKMARK !== type) {
if (tmp(tmp2[5]).CodedLinkType.EMBEDDED_ACTIVITY_INVITE !== type) {
if (tmp(tmp2[5]).CodedLinkType.GUILD_PRODUCT !== type) {
if (tmp(tmp2[5]).CodedLinkType.SERVER_SHOP !== type) {
if (tmp(tmp2[5]).CodedLinkType.SOCIAL_LAYER_STOREFRONT !== type) {
if (tmp(tmp2[5]).CodedLinkType.SOCIAL_LAYER_STOREFRONT_APP !== type) {
if (tmp(tmp2[5]).CodedLinkType.QUESTS_EMBED !== type) {
if (tmp(tmp2[5]).CodedLinkType.APP_DIRECTORY_STOREFRONT !== type) {
if (tmp(tmp2[5]).CodedLinkType.APP_DIRECTORY_STOREFRONT_SKU !== type) {
if (tmp(tmp2[5]).CodedLinkType.APP_OAUTH2_LINK !== type) {
if (tmp(tmp2[5]).CodedLinkType.COLLECTIBLES_SHOP !== type) {
if (tmp(tmp2[5]).CodedLinkType.EXPERIMENT !== type) {
if (tmp(tmp2[5]).CodedLinkType.GAME_PROFILE !== type) {
if (tmp(tmp2[5]).CodedLinkType.GAME_SERVER_SHARE !== type) {
if (tmp(tmp2[5]).CodedLinkType.USER_PROFILE !== type) {
if (tmp(tmp2[5]).CodedLinkType.APP_DIRECTORY_PROFILE === type) {
const embedApplication = tmp(tmp2[9]).getEmbedApplication(code);
const tmpResult4 = tmp(tmp2[9]);
2026-08-14 17:33:39 +00:00
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
throw Error("Unknown coded link type: " + type);
}
2026-07-29 08:29:29 +00:00
}
2026-07-20 16:05:17 +00:00
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});
}
2026-08-31 15:47:37 +00:00
const message_snapshots = content.message_snapshots;
if (message_snapshots != null) {
const item1 = message_snapshots.forEach((message) => {
const arr = findCodedLinksDefault(message.message.content);
2026-08-31 15:47:37 +00:00
let tmp = null != arr;
if (tmp) {
tmp = 0 !== arr.length;
}
if (tmp) {
const item = arr.forEach((item) => {
({ type, code } = item);
if (code(dependencyMap[5]).CodedLinkType.INVITE === type) {
const result = tmp(tmp2[6]).queueMessageLinkFetch(closure_3(function*(arg0, value) {
2026-08-31 15:47:37 +00:00
if (c0 === 2) {
c0 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-08-31 15:47:37 +00:00
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw value;
2026-08-31 15:47:37 +00:00
} else if (arg0 === 2) {
const obj3 = { value, done: true };
return obj3;
2026-08-31 15:47:37 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-08-31 15:47:37 +00:00
}
} else {
try {
c0 = 2;
if (0 === v1) {
2026-08-31 15:47:37 +00:00
if (arg0 === 1) {
c0 = 3;
throw value;
2026-08-31 15:47:37 +00:00
} else if (arg0 === 2) {
c0 = 3;
const obj4 = { value, done: true };
return obj4;
2026-08-31 15:47:37 +00:00
} else {
if (null == invite.getInvite(code)) {
v1 = 1;
2026-08-31 15:47:37 +00:00
c0 = 1;
const obj5 = { value: v1(dependencyMap[7]).resolveInvite(tmp6), done: false };
return obj5;
2026-08-31 15:47:37 +00:00
}
tmp6 = code;
2026-08-31 15:47:37 +00:00
}
} else if (arg0 === 1) {
c0 = 3;
throw value;
2026-08-31 15:47:37 +00:00
} else if (arg0 === 2) {
c0 = 3;
const obj = { value, done: true };
2026-08-31 15:47:37 +00:00
return obj;
}
c0 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-08-31 15:47:37 +00:00
} catch (tmp10) {
c0 = tmp;
throw tmp10;
}
}
}));
const tmpResult = tmp(tmp2[6]);
2026-08-31 15:47:37 +00:00
} else if (tmp(tmp2[5]).CodedLinkType.TEMPLATE === type) {
const result1 = tmp(tmp2[6]).queueMessageLinkFetch(closure_3(function*(arg0, value) {
2026-08-31 15:47:37 +00:00
if (c0 === 2) {
c0 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-08-31 15:47:37 +00:00
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw value;
2026-08-31 15:47:37 +00:00
} else if (arg0 === 2) {
const obj3 = { value, done: true };
return obj3;
2026-08-31 15:47:37 +00:00
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-08-31 15:47:37 +00:00
}
} else {
try {
c0 = 2;
if (0 === v1) {
2026-08-31 15:47:37 +00:00
if (arg0 === 1) {
c0 = 3;
throw value;
2026-08-31 15:47:37 +00:00
} else if (arg0 === 2) {
c0 = 3;
const obj4 = { value, done: true };
return obj4;
2026-08-31 15:47:37 +00:00
} else {
if (null == guildTemplate.getGuildTemplate(code)) {
v1 = 1;
2026-08-31 15:47:37 +00:00
c0 = 1;
const obj5 = { value: v1(dependencyMap[8]).resolveGuildTemplate(tmp6), done: false };
return obj5;
2026-08-31 15:47:37 +00:00
}
tmp6 = code;
2026-08-31 15:47:37 +00:00
}
} else if (arg0 === 1) {
c0 = 3;
throw value;
2026-08-31 15:47:37 +00:00
} else if (arg0 === 2) {
c0 = 3;
const obj = { value, done: true };
2026-08-31 15:47:37 +00:00
return obj;
}
c0 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-08-31 15:47:37 +00:00
} catch (tmp10) {
c0 = tmp;
throw tmp10;
}
}
}));
const tmpResult3 = tmp(tmp2[6]);
2026-08-31 15:47:37 +00:00
} else if (tmp(tmp2[5]).CodedLinkType.BUILD_OVERRIDE !== type) {
if (tmp(tmp2[5]).CodedLinkType.MANUAL_BUILD_OVERRIDE !== type) {
if (tmp(tmp2[5]).CodedLinkType.EVENT !== type) {
if (tmp(tmp2[5]).CodedLinkType.CHANNEL_LINK !== type) {
if (tmp(tmp2[5]).CodedLinkType.ACTIVITY_BOOKMARK !== type) {
if (tmp(tmp2[5]).CodedLinkType.EMBEDDED_ACTIVITY_INVITE !== type) {
if (tmp(tmp2[5]).CodedLinkType.GUILD_PRODUCT !== type) {
if (tmp(tmp2[5]).CodedLinkType.SERVER_SHOP !== type) {
if (tmp(tmp2[5]).CodedLinkType.SOCIAL_LAYER_STOREFRONT !== type) {
if (tmp(tmp2[5]).CodedLinkType.SOCIAL_LAYER_STOREFRONT_APP !== type) {
if (tmp(tmp2[5]).CodedLinkType.QUESTS_EMBED !== type) {
if (tmp(tmp2[5]).CodedLinkType.APP_DIRECTORY_STOREFRONT !== type) {
if (tmp(tmp2[5]).CodedLinkType.APP_DIRECTORY_STOREFRONT_SKU !== type) {
if (tmp(tmp2[5]).CodedLinkType.APP_OAUTH2_LINK !== type) {
if (tmp(tmp2[5]).CodedLinkType.COLLECTIBLES_SHOP !== type) {
if (tmp(tmp2[5]).CodedLinkType.EXPERIMENT !== type) {
if (tmp(tmp2[5]).CodedLinkType.GAME_PROFILE !== type) {
if (tmp(tmp2[5]).CodedLinkType.GAME_SERVER_SHARE !== type) {
if (tmp(tmp2[5]).CodedLinkType.USER_PROFILE !== type) {
if (tmp(tmp2[5]).CodedLinkType.APP_DIRECTORY_PROFILE === type) {
const embedApplication = tmp(tmp2[9]).getEmbedApplication(code);
const tmpResult4 = tmp(tmp2[9]);
2026-08-31 15:47:37 +00:00
} else {
const _Error = Error;
const _HermesInternal = HermesInternal;
throw Error("Unknown coded link type: " + type);
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
}
});
}
});
}
2026-07-20 16:05:17 +00:00
}
2026-08-31 15:47:37 +00:00
class MessageCodedLinkManager extends tmp7 {
2026-07-29 08:29:29 +00:00
constructor() {
tmp3 = new MessageCodedLinkManager(tmp2, tmp, new.target);
tmp4 = closure_1(closure_2[11])(tmp3, resolveMessageCodedLinks);
2026-07-29 08:29:29 +00:00
return tmp3;
}
}
const tmp5 = new tmp(tmp4, tmp3, tmp2, Object, defineProperty, MessageCodedLinkManager, importDefault);
setupLoadFromMessageManagerHandlersDefault(tmp5, resolveMessageCodedLinks);
const size = fn(2);
let result = size.fileFinishedImporting("modules/coded_links/MessageCodedLinkManager.tsx");
2026-07-20 16:05:17 +00:00
export default tmp5;