decord/source/modules/share/native/ShareScreenModal.tsx

288 lines
8.6 KiB
TypeScript
Raw Normal View History

2026-08-24 06:08:38 +00:00
// Module ID: 13417
// Function ID: 13418
2026-07-20 16:05:17 +00:00
// Name: onClose
2026-08-24 06:08:38 +00:00
// Dependencies: [5, 32, 19, 1391, 13369, 21, 3, 5265, 9105, 589, 4775, 692, 13418, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-24 06:08:38 +00:00
// Module 13417 (onClose)
import timestampDefault from "timestamp" /* 3 */;
import _modDef5265 from "module_5265" /* 5265 */;
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "_slicedToArray" /* 32 */;
import closure_5 from "noop" /* 19 */;
import closure_6 from "ensureGuildLoaded" /* 1391 */;
import { SHARE_SCREEN_MODAL_KEY } from "SHARE_SCREEN_MODAL_KEY" /* 13369 */;
import { jsx } from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
let require = arg1;
2026-07-20 16:05:17 +00:00
function onClose() {
2026-08-24 06:08:38 +00:00
_modDef5265.popWithKey(SHARE_SCREEN_MODAL_KEY);
2026-07-20 16:05:17 +00:00
}
2026-08-24 06:08:38 +00:00
let closure_9 = new timestampDefault("ShareScreenModal");
const tmp2 = new timestampDefault("ShareScreenModal");
const result = require("set").fileFinishedImporting("modules/share/native/ShareScreenModal.tsx");
2026-07-20 16:05:17 +00:00
export default function ShareScreenModal(text) {
text = text.text;
2026-08-24 06:08:38 +00:00
require = text;
2026-07-20 16:05:17 +00:00
const channelId = text.channelId;
const shareId = text.shareId;
const attachmentManifest = text.attachmentManifest;
2026-07-29 08:29:29 +00:00
let first;
let React;
let stateFromStores;
2026-08-24 06:08:38 +00:00
closure_7 = undefined;
2026-07-29 08:29:29 +00:00
let first1;
let obj = React;
let tmp = first(React.useState(null), 2);
2026-07-23 10:11:24 +00:00
first = tmp[0];
React = tmp[1];
2026-07-29 08:29:29 +00:00
let items = [shareId, attachmentManifest];
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
function _fetchAttachments() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = attachmentManifest(function*() {
if (v0 === 2) {
v0 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
v0 = 2;
if (0 === c4) {
if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp3;
closure_0 = tmp7;
2026-07-29 08:29:29 +00:00
closure_0 = undefined;
2026-08-24 06:08:38 +00:00
if (undefined !== closure_1_2) {
2026-07-29 08:29:29 +00:00
if (undefined !== c3) {
c3 = 1;
2026-08-24 06:08:38 +00:00
obj1 = closure_2_1(closure_2_2[8]);
2026-07-29 08:29:29 +00:00
c4 = 2;
v0 = 1;
obj1 = { value: null, done: false };
obj1[0] = obj1.sharedAttachments(tmp20, tmp21);
return obj1;
}
}
}
} else {
if (1 === tmp7) {
c3 = 0;
closure_1 = closure_2;
2026-08-24 06:08:38 +00:00
closure_2_9.error("Error fetching attachments:", closure_1);
2026-07-29 08:29:29 +00:00
} else if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 !== 2) {
closure_0 = arg1;
v0(closure_0);
c3 = 0;
}
c3 = 0;
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
v0 = 3;
} catch (tmp24) {
closure_2 = tmp24;
if (tmp4 === c3) {
v0 = tmp2;
throw tmp24;
} else {
c4 = tmp;
}
}
}
});
2026-08-24 06:08:38 +00:00
closure_0 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
!(function fetchAttachments() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fetchAttachments.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-23 10:11:24 +00:00
})();
2026-07-20 16:05:17 +00:00
}, items);
2026-07-23 10:11:24 +00:00
const items1 = [stateFromStores];
2026-07-29 08:29:29 +00:00
stateFromStores = require(shareId[9]).useStateFromStores(items1, () => stateFromStores.getChannel(channelId));
const tmp6 = first(React.useState(null), 2);
closure_7 = tmp6[1];
2026-07-20 16:05:17 +00:00
const items2 = [channelId, stateFromStores];
const effect1 = React.useEffect(() => {
function _fetchChannel() {
2026-07-29 08:29:29 +00:00
const self = this;
const tmp = attachmentManifest(function*() {
if (c5 === 2) {
c5 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp6 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
c5 = 2;
if (0 === c4) {
if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 === 2) {
c5 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
closure_1 = tmp3;
closure_0 = tmp7;
2026-07-29 08:29:29 +00:00
closure_0 = undefined;
2026-08-24 06:08:38 +00:00
if (null != closure_1_1) {
if (null == closure_1_6) {
c3 = 1;
obj1 = closure_2_1(closure_2_2[10]);
2026-07-29 08:29:29 +00:00
c4 = 2;
c5 = 1;
obj1 = { value: null, done: false };
obj1[0] = obj1.fetchChannel(tmp20);
return obj1;
}
}
}
} else {
if (1 === tmp7) {
c3 = 0;
closure_1 = closure_2;
2026-08-24 06:08:38 +00:00
closure_2_9.error("Error fetching channel:", closure_1);
2026-07-29 08:29:29 +00:00
} else if (arg0 === 1) {
c5 = 3;
throw arg1;
} else if (arg0 !== 2) {
closure_0 = arg1;
2026-08-24 06:08:38 +00:00
closure_1_7(closure_0);
2026-07-29 08:29:29 +00:00
c3 = 0;
}
c3 = 0;
c5 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
}
c5 = 3;
} catch (tmp24) {
closure_2 = tmp24;
if (tmp4 === c3) {
c5 = tmp2;
throw tmp24;
} else {
c4 = tmp;
}
}
}
});
2026-08-24 06:08:38 +00:00
closure_0 = tmp;
2026-07-29 08:29:29 +00:00
const apply = tmp.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-20 16:05:17 +00:00
}
2026-07-23 10:11:24 +00:00
!(function fetchChannel() {
2026-07-29 08:29:29 +00:00
const self = this;
const apply = _fetchChannel.apply;
if (typeof apply === "unknown") {
let applyArgumentsResult = HermesBuiltin.applyArguments(self);
} else {
applyArgumentsResult = apply(self, arguments);
}
return applyArgumentsResult;
2026-07-23 10:11:24 +00:00
})();
2026-07-20 16:05:17 +00:00
}, items2);
2026-07-29 08:29:29 +00:00
first1 = stateFromStores;
if (stateFromStores == null) {
first1 = tmp6[0];
}
const items3 = [text, first, channelId, first1];
const memo = obj.useMemo(() => {
const obj = { text: closure_0, attachments: null };
let items = first;
if (first == null) {
items = [];
}
obj[1] = items;
if (null != first1) {
if (tmp.type !== text(shareId[11]).ChannelTypes.DM) {
obj.targetChannelId = channelId;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
let isArray = tmp;
if (tmp) {
isArray = "recipients" in tmp;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (isArray) {
const _Array = Array;
isArray = Array.isArray(tmp.recipients);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (isArray) {
obj.targetUserId = tmp.recipients[0];
} else {
let tmp4 = tmp;
if (tmp) {
tmp4 = "recipient" in tmp;
}
if (tmp4) {
tmp4 = "id" in tmp.recipient;
}
if (tmp4) {
const recipient = tmp.recipient;
let id;
if (recipient != null) {
id = recipient.id;
}
obj.targetUserId = id;
2026-07-20 16:05:17 +00:00
}
}
}
}
2026-07-29 08:29:29 +00:00
return obj;
2026-07-20 16:05:17 +00:00
}, items3);
obj = { sharedContent: memo, onClose };
2026-07-29 08:29:29 +00:00
return first1(channelId(shareId[12]), obj);
2026-07-20 16:05:17 +00:00
};