decord/source/modules/activities/utils/useRefocusOrLaunchActivity.tsx

165 lines
6 KiB
TypeScript
Raw Normal View History

// Module ID: 11614
// Function ID: 11615
2026-07-20 16:05:17 +00:00
// Name: useRefocusOrLaunchActivity
// Dependencies: [5, 19, 9603, 1956, 9604, 7237, 504, 9599, 9600, 9628, 11615, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
// Module 11614 (useRefocusOrLaunchActivity)
import asyncGeneratorStep from "asyncGeneratorStep" /* 5 */;
import noop from "module_19" /* 19 */;
import FramesStore from "FramesStore" /* 9603 */;
import EmbeddedActivitiesStore from "EmbeddedActivitiesStore" /* 1956 */;
2026-07-23 10:11:24 +00:00
const require = fn;
const FramesConstants = fn(9604);
({ MAIN_SURFACE: closure_7, FrameLayoutModes: closure_8 } = FramesConstants);
const size = fn(2);
let result = size.fileFinishedImporting("modules/activities/utils/useRefocusOrLaunchActivity.tsx");
2026-07-20 16:05:17 +00:00
export default function useRefocusOrLaunchActivity(applicationId) {
applicationId = applicationId.applicationId;
let analyticsLocations = applicationId.analyticsLocations;
2026-07-20 16:05:17 +00:00
const runBeforeLaunchAttempt = applicationId.runBeforeLaunchAttempt;
const runAfterLaunchAttempt = applicationId.runAfterLaunchAttempt;
2026-07-29 08:29:29 +00:00
let stateFromStores1;
const data = applicationId(runBeforeLaunchAttempt[5]).useApplication(applicationId).data;
2026-07-29 08:29:29 +00:00
let obj = applicationId(runBeforeLaunchAttempt[5]);
2026-07-23 10:11:24 +00:00
const items = [stateFromStores1];
const stateFromStores = applicationId(runBeforeLaunchAttempt[6]).useStateFromStores(items, () => stateFromStores1.getCurrentEmbeddedActivity());
2026-07-29 08:29:29 +00:00
let obj2 = applicationId(runBeforeLaunchAttempt[6]);
2026-07-23 10:11:24 +00:00
const items1 = [stateFromStores];
2026-08-06 08:05:19 +00:00
stateFromStores1 = applicationId(runBeforeLaunchAttempt[6]).useStateFromStores(items1, () => stateFromStores.getMainFrame());
const obj3 = applicationId(runBeforeLaunchAttempt[6]);
2026-07-23 10:11:24 +00:00
const canLaunchFrameResult = applicationId(runBeforeLaunchAttempt[7]).canLaunchFrame(data);
2026-07-29 08:29:29 +00:00
c7 = canLaunchFrameResult;
2026-07-20 16:05:17 +00:00
const items2 = [analyticsLocations, data, applicationId, canLaunchFrameResult, stateFromStores, stateFromStores1, runAfterLaunchAttempt, runBeforeLaunchAttempt];
return data.useCallback(runAfterLaunchAttempt(function*(arg0, value) {
2026-07-29 08:29:29 +00:00
if (c5 === 2) {
c5 = 3;
throw new TypeError("Generator functions may not be called on executing generators");
2026-07-29 08:29:29 +00:00
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
const obj2 = { value, done: true };
return obj2;
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 {
c5 = 2;
if (0 === dependencyMap) {
if (arg0 === 1) {
c5 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c5 = 3;
const obj4 = { value, done: true };
return obj4;
2026-07-29 08:29:29 +00:00
} else {
if (null != applicationId) {
if (null != data) {
let tmp9 = null != stateFromStores;
2026-07-29 08:29:29 +00:00
if (tmp9) {
tmp9 = tmp43.applicationId === tmp41;
2026-07-29 08:29:29 +00:00
}
if (null != stateFromStores1) {
if (tmp10.applicationId === tmp41) {
const obj5 = { frameId: tmp10.id, layoutMode: constants.FOCUSED };
const result = tmp3(9600).updateFrameLayoutMode(obj5);
const obj10 = tmp3(9600);
2026-07-29 08:29:29 +00:00
}
}
if (tmp9) {
const _location = tmp43.location;
2026-07-29 08:29:29 +00:00
let guild_id = null;
if ("guild_id" in _location) {
guild_id = _location.guild_id;
}
tmp3(9628)(guild_id, _location);
const tmp26 = tmp3(9628);
2026-07-29 08:29:29 +00:00
} else {
if (runBeforeLaunchAttempt != null) {
runBeforeLaunchAttempt();
2026-07-29 08:29:29 +00:00
}
c4 = 1;
if (c7) {
const obj7 = { applicationId: tmp41, surface, analyticsContext: null };
const obj8 = { isStart: true, analyticsLocations };
obj7.analyticsContext = obj8;
2026-07-29 08:29:29 +00:00
dependencyMap = 2;
c5 = 1;
const obj9 = { value: tmp3(9600).launchFrame(obj7), done: false };
return obj9;
2026-07-29 08:29:29 +00:00
} else {
let id;
if (tmp42 != null) {
const bot = tmp42.bot;
2026-07-29 08:29:29 +00:00
if (bot != null) {
id = bot.id;
}
}
if (null == id) {
c4 = 0;
}
}
}
const obj11 = { appId: tmp41, botId: null, analyticsLocations: null };
2026-07-29 08:29:29 +00:00
let id1;
if (tmp42 != null) {
const bot2 = tmp42.bot;
2026-07-29 08:29:29 +00:00
if (bot2 != null) {
id1 = bot2.id;
}
}
obj11.botId = id1;
if (analyticsLocations == null) {
analyticsLocations = [];
2026-07-29 08:29:29 +00:00
}
obj11.analyticsLocations = analyticsLocations;
2026-07-29 08:29:29 +00:00
dependencyMap = 3;
c5 = 1;
const obj12 = { value: analyticsLocations(11615).launchActivityInBotDM(obj11), done: false };
return obj12;
2026-07-29 08:29:29 +00:00
}
}
c5 = 3;
}
} else if (1 === tmp7) {
c4 = 0;
} else if (2 === tmp7) {
if (arg0 === 1) {
c5 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c4 = 0;
c5 = 3;
const obj13 = { value, done: true };
return obj13;
2026-07-29 08:29:29 +00:00
}
} else if (arg0 === 1) {
c5 = 3;
throw value;
2026-07-29 08:29:29 +00:00
} else if (arg0 === 2) {
c4 = 0;
c5 = 3;
const obj = { value, done: true };
2026-07-29 08:29:29 +00:00
return obj;
}
if (closure_129_3 != null) {
closure_129_3();
2026-07-29 08:29:29 +00:00
}
} catch (tmp33) {
closure_3 = tmp33;
2026-07-29 08:29:29 +00:00
if (tmp4 === c4) {
c5 = tmp2;
throw tmp33;
2026-07-29 08:29:29 +00:00
} else {
dependencyMap = tmp;
}
}
}
}), items2);
2026-07-20 16:05:17 +00:00
};