decord/source/modules/safety_hub/native/ClassificationMessageEvidence.tsx

265 lines
9.3 KiB
TypeScript
Raw Normal View History

2026-09-02 09:53:35 +00:00
// Module ID: 11681
// Function ID: 11682
2026-07-20 16:05:17 +00:00
// Name: ClassificationEvidence
2026-09-02 09:53:35 +00:00
// Dependencies: [32, 19, 17, 1301, 1921, 8716, 8705, 673, 21, 7850, 4478, 586, 1362, 11682, 11683, 8704, 4671, 8581, 8411, 11684, 8794, 4737, 11, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-09-02 09:53:35 +00:00
// Module 11681 (ClassificationEvidence)
import setOptionsDefault from "setOptions" /* 7850 */;
2026-08-24 06:08:38 +00:00
import closure_3 from "_slicedToArray" /* 32 */;
import closure_4 from "noop" /* 19 */;
import get_ActivityIndicator from "get ActivityIndicator" /* 17 */;
2026-09-02 09:53:35 +00:00
import closure_9 from "handleThemeChange" /* 1301 */;
import closure_10 from "mergeGuildAvatar" /* 1921 */;
import closure_11 from "handleSafetyHubRequestAgeVerificationResetModalAction" /* 8716 */;
import SafetyHubView from "SafetyHubView" /* 8705 */;
import { MessageTypes } from "ME" /* 673 */;
2026-08-24 06:08:38 +00:00
import jsxProd from "jsxProd" /* 21 */;
2026-09-01 10:26:29 +00:00
import createCacheKey from "createCacheKey" /* 4478 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
({ View: c5, findNodeHandle: closure_6, Image: error, ActivityIndicator: closure_8 } = get_ActivityIndicator);
2026-07-29 08:29:29 +00:00
({ DEFAULT_MEDIA_MAX_WIDTH: closure_12, DEFAULT_MEDIA_MAX_HEIGHT: map1, VIDEO_PLACEHOLDER_WIDTH: closure_14, VIDEO_PLACEHOLDER_HEIGHT: closure_15, VIDEO_PLACEHOLDER_FILENAME: closure_16 } = SafetyHubView);
2026-07-23 10:11:24 +00:00
({ jsx: closure_18, jsxs: closure_19 } = jsxProd);
2026-08-24 06:08:38 +00:00
let closure_20 = new setOptionsDefault();
2026-07-29 08:29:29 +00:00
let closure_21 = createCacheKey.createStyles({ dummyVideoAttachments: { width: 0, height: 0 } });
2026-08-24 06:08:38 +00:00
let tmp5 = new setOptionsDefault();
const result = require("set").fileFinishedImporting("modules/safety_hub/native/ClassificationMessageEvidence.tsx");
2026-07-20 16:05:17 +00:00
export default function ClassificationEvidence(arg0) {
2026-07-29 08:29:29 +00:00
let attachments = callback2();
2026-09-02 09:53:35 +00:00
let obj = ref(586);
2026-07-23 10:11:24 +00:00
const items = [memo];
2026-07-29 08:29:29 +00:00
const stateFromStores = obj.useStateFromStores(items, () => memo.getCurrentUser());
2026-08-24 06:08:38 +00:00
obj1 = React;
2026-07-23 10:11:24 +00:00
ref = React.useRef(null);
2026-07-29 08:29:29 +00:00
const tmp6 = first1(React.useState(null), 2);
const first = tmp6[0];
2026-08-24 06:08:38 +00:00
dependencyMap = tmp6[1];
2026-07-29 08:29:29 +00:00
const tmp8 = first1(React.useState({}), 2);
first1 = tmp8[0];
React = tmp8[1];
2026-09-02 09:53:35 +00:00
let obj2 = ref(586);
2026-07-23 10:11:24 +00:00
const items1 = [id];
2026-07-29 08:29:29 +00:00
const resolveAssetSource = first3.resolveAssetSource;
2026-09-02 09:53:35 +00:00
if (obj2.useStateFromStores(items1, () => ref(1362).isThemeLight(id.theme))) {
let assetSource = resolveAssetSource(tmp11(11682));
2026-07-29 08:29:29 +00:00
let tmp13 = tmp11;
2026-07-20 16:05:17 +00:00
} else {
2026-09-02 09:53:35 +00:00
assetSource = resolveAssetSource(tmp11(11683));
2026-07-29 08:29:29 +00:00
tmp13 = tmp11;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
let first2 = arg0.flaggedContent[0];
const tmp5Result = first1(obj1.useState(first2.attachments.length), 2);
first3 = tmp5Result[0];
2026-08-24 06:08:38 +00:00
closure_8 = tmp5Result[1];
2026-09-02 09:53:35 +00:00
let tmpResult = tmp(586);
2026-08-24 06:08:38 +00:00
const items2 = [closure_11];
2026-07-29 08:29:29 +00:00
id = first2.id;
const items3 = [first2.attachments, first1, assetSource];
const stateFromStores1 = tmpResult.useStateFromStores(items2, () => username.getUsername());
memo = obj1.useMemo(() => {
const attachments = first2.attachments;
2026-07-20 16:05:17 +00:00
return attachments.map((filename) => {
let obj = {};
const merged = Object.assign(filename);
2026-07-29 08:29:29 +00:00
let str = filename.filename;
if (str == null) {
str = "";
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj.filename = str;
2026-08-24 06:08:38 +00:00
obj.flags = closure_1_0(closure_1_2[15]).getSpoilerFlagsForAttachment(filename);
2026-07-29 08:29:29 +00:00
obj.size = 0;
obj.proxy_url = filename.url;
2026-08-24 06:08:38 +00:00
const obj2 = closure_1_0(closure_1_2[15]);
const tmp2 = closure_1_0;
const tmp3 = closure_1_2;
2026-07-20 16:05:17 +00:00
if (obj3.isImageFile(filename.filename)) {
obj = {};
const merged1 = Object.assign(obj);
let width;
2026-07-29 08:29:29 +00:00
if (table[filename.id] != null) {
2026-07-20 16:05:17 +00:00
width = tmp16.width;
}
2026-07-29 08:29:29 +00:00
if (width == null) {
2026-08-24 06:08:38 +00:00
width = closure_1_12;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj.width = width;
2026-07-20 16:05:17 +00:00
let height;
2026-07-29 08:29:29 +00:00
if (table[filename.id] != null) {
height = tmp18.height;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (height == null) {
2026-08-24 06:08:38 +00:00
height = closure_1_13;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj.height = height;
2026-07-20 16:05:17 +00:00
let tmp4 = obj;
2026-07-29 08:29:29 +00:00
const tmp15 = table;
2026-07-20 16:05:17 +00:00
} else {
tmp4 = obj;
2026-07-29 08:29:29 +00:00
if (tmp2Result.isVideoFile(filename.filename)) {
2026-07-20 16:05:17 +00:00
obj = {};
const merged2 = Object.assign(obj);
2026-08-24 06:08:38 +00:00
obj.width = closure_1_14;
obj.height = closure_1_15;
2026-07-29 08:29:29 +00:00
obj.proxy_url = uri.uri;
2026-08-24 06:08:38 +00:00
obj.filename = closure_1_16;
2026-07-20 16:05:17 +00:00
tmp4 = obj;
}
2026-07-29 08:29:29 +00:00
tmp2Result = tmp2(tmp3[16]);
2026-07-20 16:05:17 +00:00
}
return tmp4;
});
}, items3);
2026-07-29 08:29:29 +00:00
const items4 = [memo, first2.attachments, id, first1, assetSource];
2026-07-20 16:05:17 +00:00
const items5 = [first];
2026-07-29 08:29:29 +00:00
const callback = obj1.useCallback((nativeEvent) => {
2026-07-20 16:05:17 +00:00
({ index, layout } = nativeEvent.nativeEvent);
2026-07-29 08:29:29 +00:00
const mapped = memo.map((uri) => {
let obj = { uri: uri.url, videoURI: null, thumbnail: null, mediaIndex: null, channelId: "1", messageId: null, width: null, height: null, accessoryType: "attachment", attachmentId: null };
2026-07-20 16:05:17 +00:00
let url;
2026-07-29 08:29:29 +00:00
if (obj2.isVideoFile(attachments.attachments[arg1].filename)) {
2026-07-20 16:05:17 +00:00
url = uri.url;
}
2026-07-29 08:29:29 +00:00
obj[1] = url;
2026-08-24 06:08:38 +00:00
obj2 = closure_1_0(closure_1_2[16]);
const tmp = closure_1_0;
const tmp2 = closure_1_2;
2026-07-29 08:29:29 +00:00
const tmp3 = attachments;
let tmp5;
if (tmpResult.isVideoFile(tmp3.attachments[arg1].filename)) {
obj = { width: null, height: null, uri: null };
2026-08-24 06:08:38 +00:00
obj[0] = closure_1_14;
obj[1] = closure_1_15;
2026-07-29 08:29:29 +00:00
obj[2] = uri.uri;
tmp5 = obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[2] = tmp5;
obj[3] = arg1;
2026-08-24 06:08:38 +00:00
obj[5] = closure_9;
2026-07-20 16:05:17 +00:00
let width;
2026-07-29 08:29:29 +00:00
if (table[uri.id] != null) {
width = tmp10.width;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (width == null) {
2026-08-24 06:08:38 +00:00
width = closure_1_12;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[6] = width;
2026-07-20 16:05:17 +00:00
let height;
2026-07-29 08:29:29 +00:00
if (table[uri.id] != null) {
height = tmp12.height;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (height == null) {
2026-08-24 06:08:38 +00:00
height = closure_1_13;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj[7] = height;
obj[9] = uri.id;
2026-07-20 16:05:17 +00:00
return obj;
});
2026-09-02 09:53:35 +00:00
ref(8581).openMediaModal({ initialIndex: index, initialSources: mapped, disableDownload: true, disableMediaOverlayButton: true, shareable: false, originViewOrOriginLayout: layout });
2026-07-20 16:05:17 +00:00
}, items4);
2026-07-29 08:29:29 +00:00
const items6 = [first2.attachments];
const callback1 = obj1.useCallback((arg0) => {
2026-07-20 16:05:17 +00:00
arg0.reactTag = first;
}, items5);
2026-07-29 08:29:29 +00:00
const effect = obj1.useEffect(() => {
const attachments = first2.attachments;
const found = attachments.filter((filename) => callback(table[16]).isImageFile(filename.filename));
2026-07-20 16:05:17 +00:00
const mapped = found.map((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
2026-07-29 08:29:29 +00:00
const promise = new Promise((arg0, arg1) => {
const url = arg0;
2026-08-24 06:08:38 +00:00
return closure_1_7.getSize(url.url, (width, height) => callback({ width, height }), arg1);
2026-07-29 08:29:29 +00:00
});
return new Promise((arg0, arg1) => {
const url = arg0;
2026-08-24 06:08:38 +00:00
return closure_1_7.getSize(url.url, (width, height) => callback({ width, height }), arg1);
2026-07-29 08:29:29 +00:00
}).then((arg0) => {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
return closure_1_4((arg0) => {
2026-07-23 10:11:24 +00:00
const obj = {};
const merged = Object.assign(arg0);
obj[id.id] = id;
return obj;
});
2026-07-29 08:29:29 +00:00
}).finally(() => callback((arg0) => arg0 - 1));
2026-07-20 16:05:17 +00:00
});
}, items6);
2026-07-29 08:29:29 +00:00
const items7 = [first3];
const effect1 = obj1.useEffect(() => {
if (0 === first3) {
dependencyMap(first2(ref.current));
2026-07-20 16:05:17 +00:00
}
}, items7);
2026-07-29 08:29:29 +00:00
if ("" === first2.content) {
if (0 === first2.attachments.length) {
2026-07-20 16:05:17 +00:00
return null;
}
}
2026-07-29 08:29:29 +00:00
if (first3 > 0) {
obj = { children: null };
2026-07-23 10:11:24 +00:00
const items8 = [callback(closure_8, {}), ];
2026-07-29 08:29:29 +00:00
obj = { style: null, children: null };
obj[0] = attachments.dummyVideoAttachments;
attachments = first2.attachments;
2026-09-01 10:26:29 +00:00
first2 = attachments.filter((filename) => ref(4671).isVideoFile(filename.filename));
2026-07-29 08:29:29 +00:00
obj[1] = first2.map((uri) => {
2026-08-24 06:08:38 +00:00
closure_0 = uri;
2026-07-23 10:11:24 +00:00
obj = {
2026-07-20 16:05:17 +00:00
source: obj,
onLoad(arg0) {
2026-08-24 06:08:38 +00:00
closure_0 = arg0;
closure_1_4((arg0) => {
2026-07-20 16:05:17 +00:00
let obj = {};
const merged = Object.assign(arg0);
2026-07-23 10:11:24 +00:00
obj = { width: closure_0.naturalSize.width, height: closure_0.naturalSize.height };
obj[closure_0.id] = obj;
2026-07-20 16:05:17 +00:00
return obj;
});
2026-08-24 06:08:38 +00:00
closure_1_8((arg0) => arg0 - 1);
2026-07-20 16:05:17 +00:00
},
onError() {
2026-07-29 08:29:29 +00:00
return callback((arg0) => arg0 - 1);
2026-07-20 16:05:17 +00:00
}
};
obj = { uri: uri.url };
2026-09-02 09:53:35 +00:00
return closure_1_18(first(8411), obj, arg1);
2026-07-20 16:05:17 +00:00
});
2026-07-29 08:29:29 +00:00
items8[1] = callback(tmp24, obj);
obj[0] = items8;
let obj5 = obj;
2026-07-20 16:05:17 +00:00
} else {
2026-07-29 08:29:29 +00:00
obj1 = { ref: null, onTapImage: null, inverted: false };
obj1[0] = ref;
obj1[1] = callback;
2026-09-02 09:53:35 +00:00
const items9 = [callback(tmp13(11684), obj1), ];
2026-08-24 06:08:38 +00:00
obj2 = { rowGenerator: null, message: null, modifyRow: null, pointerEvents: "none" };
2026-07-29 08:29:29 +00:00
obj2[0] = closure_20;
2026-09-02 09:53:35 +00:00
let tmp13Result = tmp13(8794);
2026-09-01 10:26:29 +00:00
tmpResult = tmp(4737);
2026-07-29 08:29:29 +00:00
const obj3 = { id: null, timestamp: null, channel_id: "1", type: null, author: null, content: null, attachments: null };
obj3[0] = first2.id;
2026-07-20 16:05:17 +00:00
const _Date = Date;
2026-07-29 08:29:29 +00:00
tmp13Result = tmp13(11);
const date = new Date(tmp13Result.extractTimestamp(first2.id));
obj3[1] = date.toUTCString();
obj3[3] = MessageTypes.DEFAULT;
let tmp25 = stateFromStores;
if (stateFromStores == null) {
const obj4 = { id: "0", avatar: null, discriminator: "0000", username: null };
obj4[3] = stateFromStores1;
tmp25 = obj4;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
obj5 = { children: null };
obj3[4] = tmp25;
obj3[5] = first2.content;
obj3[6] = memo;
obj2[1] = tmpResult.createMessageRecord(obj3);
obj2[2] = callback1;
items9[1] = callback(tmp13Result, obj2);
obj5[0] = items9;
const tmp29 = callback;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
closure_19(assetSource, obj5);
2026-07-20 16:05:17 +00:00
};