342 lines
17 KiB
TypeScript
342 lines
17 KiB
TypeScript
/* Metro module 11483; source: modules/safety_hub/native/ClassificationMessageEvidence.tsx; dependencies: [57, 31, 27, 1310, 1878, 11473, 5267, 661, 33, 8177, 4501, 566, 4002, 11484, 11485, 5266, 4631, 9544, 8011, 9869, 9773, 4625, 21, 2] */
|
|
function _fun87966(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87966, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:6, offset: 0x01fcff0a, size: 429 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_5 = value.View;
|
|
const env0_6 = value.findNodeHandle;
|
|
const env0_7 = value.Image;
|
|
const env0_8 = value.ActivityIndicator;
|
|
const themeStore = importDefault(1310) /* metro dependency 1310: ThemeStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const safetyHubStore = importDefault(11473) /* metro dependency 11473: SafetyHubStore */;
|
|
value = require(5267) /* metro dependency 5267: SafetyHubConstants */;
|
|
const env0_12 = value.DEFAULT_MEDIA_MAX_WIDTH;
|
|
const env0_13 = value.DEFAULT_MEDIA_MAX_HEIGHT;
|
|
const env0_14 = value.VIDEO_PLACEHOLDER_WIDTH;
|
|
const env0_15 = value.VIDEO_PLACEHOLDER_HEIGHT;
|
|
const env0_16 = value.VIDEO_PLACEHOLDER_FILENAME;
|
|
const env0_17 = (require(661) /* metro dependency 661: Constants */).MessageTypes;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_18 = value.jsx;
|
|
const env0_19 = value.jsxs;
|
|
value = importDefault(8177) /* metro dependency 8177: RowGenerator */;
|
|
value = new value();
|
|
const env0_21 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({dummyVideoAttachments: {'width': 0,
|
|
'height': 0}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/safety_hub/native/ClassificationMessageEvidence.tsx');
|
|
exports.default = ClassificationEvidence_87967;
|
|
}
|
|
|
|
function ClassificationEvidence_87967({flaggedContent}) { // fn#87967, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:615, offset: 0x01fd00b7, size: 1006 bytes, params: 2, frame: 34
|
|
var object;
|
|
var r0;
|
|
var items3;
|
|
var defaultImport2;
|
|
var object2;
|
|
var moduleValue4;
|
|
var createMessageRecord;
|
|
var object5;
|
|
var Date;
|
|
var defaultImport3;
|
|
var extractTimestamp;
|
|
var value14;
|
|
var value15;
|
|
var date;
|
|
var items2;
|
|
const styles = useStyles();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
let binding = env0_4;
|
|
const value3 = binding.useRef(null);
|
|
let useState = binding.useState;
|
|
const value4 = Reflect.apply(useState, binding, [null]);
|
|
const binding2 = env0_3;
|
|
const value5 = binding2(value4, 2);
|
|
const property = value5[0];
|
|
const env0_2 = value5[1];
|
|
useState = binding.useState;
|
|
const value6 = binding2(Reflect.apply(useState, binding, [{}]), 2);
|
|
const property2 = value6[0];
|
|
var env0_3 = property2;
|
|
var env0_4 = value6[1];
|
|
const value7 = (require(566) /* metro dependency 566: flux */).useStateFromStores([ThemeStore], function() {
|
|
return require(dependencyMap[12]).isThemeLight(ThemeStore.theme);
|
|
});
|
|
const resolveAssetSource = Image.resolveAssetSource;
|
|
const r2 = value7 ? Reflect.apply(resolveAssetSource, Image,
|
|
[importDefault(11484) /* metro dependency 11484 */]) : Reflect.apply(resolveAssetSource, Image,
|
|
[importDefault(11485) /* metro dependency 11485 */]);
|
|
const property3 = flaggedContent[0];
|
|
binding = env0_4;
|
|
useState = binding.useState;
|
|
const value9 = env0_3(Reflect.apply(useState, binding, [property3.attachments.length]), 2);
|
|
const property4 = value9[0];
|
|
const env0_8 = value9[1];
|
|
const username = (require(566) /* metro dependency 566: flux */).useStateFromStores([SafetyHubStore], function() {
|
|
return SafetyHubStore.getUsername();
|
|
});
|
|
let id = property3.id;
|
|
const value10 = binding.useMemo(_fun87971, [property3.attachments, property2, r2]);
|
|
const value11 = binding.useCallback(_fun87973, [value10, property3.attachments, id, property2, r2]);
|
|
const value12 = binding.useCallback(_fun87975, [property]);
|
|
binding.useEffect(_fun87976, [property3.attachments]);
|
|
binding.useEffect(_fun87986, [property4]);
|
|
if (property3.content !== '') {
|
|
if (property4 > 0) {
|
|
items2 = [<ActivityIndicator />];
|
|
items2[1] = <View style={styles.dummyVideoAttachments}>{property3.attachments.filter(_fun87987).map(_fun87988)}</View>;
|
|
object = {children: items2};
|
|
} else {
|
|
items3 = [((Component) => <Component ref={value3} onTapImage={value11} inverted={false} />)(importDefault(9869) /* metro dependency 9869: ChatAndroid */)];
|
|
defaultImport2 = importDefault(9773) /* metro dependency 9773: ChatItem */;
|
|
object2 = {rowGenerator: env0_20};
|
|
moduleValue4 = require(4625) /* metro dependency 4625: MessageRecordUtils */;
|
|
createMessageRecord = moduleValue4.createMessageRecord;
|
|
object5 = {};
|
|
id = property3.id;
|
|
object5.id = id;
|
|
Date = global.Date;
|
|
defaultImport3 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
extractTimestamp = defaultImport3.extractTimestamp;
|
|
id = property3.id;
|
|
value14 = Reflect.apply(extractTimestamp, defaultImport3, [id]);
|
|
value15 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
object5.timestamp = (date instanceof Object ? date : value15).toUTCString();
|
|
object5.channel_id = '1';
|
|
object5.type = MessageTypes.DEFAULT;
|
|
object5.author = currentUser ?? ({'id': '0', 'avatar': null, 'discriminator': '0000', username: username});
|
|
object5.content = property3.content;
|
|
object5.attachments = value10;
|
|
object2.message = Reflect.apply(createMessageRecord, moduleValue4, [object5]);
|
|
object2.modifyRow = value12;
|
|
items3[1] = ((Component) => <Component {...object2} />)(defaultImport2);
|
|
object = {children: items3};
|
|
}
|
|
r0 = <View {...object} />;
|
|
} else if (property3.attachments.length === 0) {
|
|
r0 = null;
|
|
} else {
|
|
if (property4 > 0) {
|
|
items2 = [<ActivityIndicator />];
|
|
items2[1] = <View style={styles.dummyVideoAttachments}>{property3.attachments.filter(_fun87987).map(_fun87988)}</View>;
|
|
object = {children: items2};
|
|
} else {
|
|
items3 = [((Component) => <Component ref={value3} onTapImage={value11} inverted={false} />)(importDefault(9869) /* metro dependency 9869: ChatAndroid */)];
|
|
defaultImport2 = importDefault(9773) /* metro dependency 9773: ChatItem */;
|
|
object2 = {rowGenerator: env0_20};
|
|
moduleValue4 = require(4625) /* metro dependency 4625: MessageRecordUtils */;
|
|
createMessageRecord = moduleValue4.createMessageRecord;
|
|
object5 = {};
|
|
id = property3.id;
|
|
object5.id = id;
|
|
Date = global.Date;
|
|
defaultImport3 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
extractTimestamp = defaultImport3.extractTimestamp;
|
|
id = property3.id;
|
|
value14 = Reflect.apply(extractTimestamp, defaultImport3, [id]);
|
|
value15 = Object.create(Date.prototype, {constructor: {value: Date}});
|
|
date = new Date();
|
|
object5.timestamp = (date instanceof Object ? date : value15).toUTCString();
|
|
object5.channel_id = '1';
|
|
object5.type = MessageTypes.DEFAULT;
|
|
object5.author = currentUser ?? ({'id': '0', 'avatar': null, 'discriminator': '0000', username: username});
|
|
object5.content = property3.content;
|
|
object5.attachments = value10;
|
|
object2.message = Reflect.apply(createMessageRecord, moduleValue4, [object5]);
|
|
object2.modifyRow = value12;
|
|
items3[1] = ((Component) => <Component {...object2} />)(defaultImport2);
|
|
object = {children: items3};
|
|
}
|
|
r0 = <View {...object} />;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun87971() { // fn#87971, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:1114, offset: 0x01fd04ea, size: 34 bytes, params: 1, frame: 11
|
|
return env0_6.attachments.map(_fun87972);
|
|
}
|
|
|
|
function _fun87973({nativeEvent}) { // fn#87973, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:1511, offset: 0x01fd065c, size: 115 bytes, params: 2, frame: 15
|
|
(require(9544) /* metro dependency 9544: openMediaModal */).openMediaModal({'initialIndex': null,
|
|
'initialSources': null, 'disableDownload': true, 'disableMediaOverlayButton': true, 'shareable': false,
|
|
initialIndex: nativeEvent.index, initialSources: env0_10.map(_fun87974),
|
|
originViewOrOriginLayout: nativeEvent.layout});
|
|
}
|
|
|
|
function _fun87975(a0) { // fn#87975, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2153, offset: 0x01fd0802, size: 20 bytes, params: 2, frame: 2
|
|
a0.reactTag = env0_1;
|
|
}
|
|
|
|
function _fun87976() { // fn#87976, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2197, offset: 0x01fd0816, size: 53 bytes, params: 1, frame: 12
|
|
env0_6.attachments.filter(_fun87977).map(function(a0) {
|
|
var env0_0 = a0;
|
|
var value = _fun87979(a0);
|
|
value = value.then(_fun87982);
|
|
return value.finally(_fun87984);
|
|
});
|
|
}
|
|
|
|
function _fun87986() { // fn#87986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2496, offset: 0x01fd0952, size: 49 bytes, params: 1, frame: 12
|
|
var binding;
|
|
var value2;
|
|
if (env0_7 === 0) {
|
|
binding = env0_2;
|
|
value2 = environment.__proto__;
|
|
binding(findNodeHandle(env0_0.current));
|
|
}
|
|
}
|
|
|
|
function _fun87987({filename}) { // fn#87987, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2670, offset: 0x01fd0983, size: 47 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__;
|
|
return (require(4631) /* metro dependency 4631: MediaFormatTesters */).isVideoFile(filename);
|
|
}
|
|
|
|
function _fun87988(a0, a1) { // fn#87988, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2717, offset: 0x01fd09b2, size: 91 bytes, params: 3, frame: 17
|
|
var environment;
|
|
const env0_0 = a0;
|
|
const value = environment.__proto__;
|
|
return ((Component) => <Component source={{uri: a0.url}} onLoad={onLoad_87989} onError={onError_87992} key={a1} />)(importDefault(8011) /* metro dependency 8011 */);
|
|
}
|
|
|
|
function _fun87972(a0) { // fn#87972, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:1137, offset: 0x01fd050c, size: 336 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var moduleValue3;
|
|
var object4;
|
|
var value4;
|
|
var object5;
|
|
var value5;
|
|
var binding;
|
|
var id;
|
|
var property;
|
|
const object6 = {};
|
|
copyDataProperties(object6, a0, undefined);
|
|
const value2 = undefined;
|
|
object6['filename'] = (require(5266) /* metro dependency 5266: SafetyHubUtils */).getAttachmentFilename(a0);
|
|
object6['size'] = 0;
|
|
object6['proxy_url'] = a0.url;
|
|
const mediaFormatTestersModule = require(4631) /* metro dependency 4631: MediaFormatTesters */;
|
|
if (mediaFormatTestersModule.isImageFile(a0.filename)) {
|
|
object5 = {};
|
|
copyDataProperties(object5, object6, mediaFormatTestersModule);
|
|
value5 = environment.__proto__;
|
|
binding = env1_3;
|
|
id = a0.id;
|
|
property = binding[id];
|
|
object5['width'] = (property == null ? value2 : property.width) ?? DEFAULT_MEDIA_MAX_WIDTH;
|
|
binding = env1_3;
|
|
id = a0.id;
|
|
property = binding[id];
|
|
object5['height'] = (property == null ? value2 : property.height) ?? DEFAULT_MEDIA_MAX_HEIGHT;
|
|
r0 = object5;
|
|
} else {
|
|
moduleValue3 = mediaFormatTestersModule;
|
|
if (moduleValue3.isVideoFile(a0.filename)) {
|
|
object4 = {};
|
|
copyDataProperties(object4, object6, mediaFormatTestersModule);
|
|
object4['width'] = VIDEO_PLACEHOLDER_WIDTH;
|
|
object4['height'] = VIDEO_PLACEHOLDER_HEIGHT;
|
|
value4 = environment.__proto__;
|
|
object4['proxy_url'] = env1_5.uri;
|
|
object4['filename'] = VIDEO_PLACEHOLDER_FILENAME;
|
|
r0 = object4;
|
|
} else {
|
|
r0 = object6;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun87974(a0, a1) { // fn#87974, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:1565, offset: 0x01fd06cf, size: 307 bytes, params: 3, frame: 18
|
|
const object2 = {};
|
|
object2.uri = a0.url;
|
|
const value2 = undefined;
|
|
const mediaFormatTestersModule = require(4631) /* metro dependency 4631: MediaFormatTesters */;
|
|
object2.videoURI = mediaFormatTestersModule.isVideoFile(env1_6.attachments[a1].filename) ? a0.url : value2;
|
|
const moduleValue2 = mediaFormatTestersModule;
|
|
object2.thumbnail = moduleValue2.isVideoFile(env1_6.attachments[a1].filename) ? {width: VIDEO_PLACEHOLDER_WIDTH,
|
|
height: VIDEO_PLACEHOLDER_HEIGHT, uri: env1_5.uri} : value2;
|
|
object2.mediaIndex = a1;
|
|
object2.channelId = '1';
|
|
object2.messageId = id;
|
|
let property = env1_3[a0.id];
|
|
object2.width = (property == null ? value2 : property.width) ?? DEFAULT_MEDIA_MAX_WIDTH;
|
|
property = env1_3[a0.id];
|
|
object2.height = (property == null ? value2 : property.height) ?? DEFAULT_MEDIA_MAX_HEIGHT;
|
|
object2.accessoryType = 'attachment';
|
|
object2.attachmentId = a0.id;
|
|
return object2;
|
|
}
|
|
|
|
function _fun87977({filename}) { // fn#87977, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2224, offset: 0x01fd084b, size: 47 bytes, params: 2, frame: 12
|
|
const value = environment.__proto__.__proto__;
|
|
return (require(4631) /* metro dependency 4631: MediaFormatTesters */).isImageFile(filename);
|
|
}
|
|
|
|
function _fun87978(a0) { // fn#87978, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2271, offset: 0x01fd087a, size: 60 bytes, params: 2, frame: 12
|
|
let env0_0 = a0;
|
|
let value = ((a0) => {
|
|
var env0_0 = a0;
|
|
var Promise = global.Promise;
|
|
var value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
|
var value2 = new Promise(_fun87980);
|
|
return value2 instanceof Object ? value2 : value;
|
|
})(a0);
|
|
value = value.then(_fun87982);
|
|
return value.finally(_fun87984);
|
|
}
|
|
|
|
function onLoad_87989(a0) { // fn#87989, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2762, offset: 0x01fd0a0d, size: 48 bytes, params: 2, frame: 13
|
|
const env0_0 = a0;
|
|
env1_4(_fun87990);
|
|
env1_8(function(a0) {
|
|
return a0 - 1;
|
|
});
|
|
}
|
|
|
|
function onError_87992() { // fn#87992, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2867, offset: 0x01fd0a83, size: 25 bytes, params: 1, frame: 11
|
|
return env1_8(function(a0) {
|
|
return a0 - 1;
|
|
});
|
|
}
|
|
|
|
function getImageAttachmentDimensions(a0) { // fn#87979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2274, offset: 0x01fd08b6, size: 46 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
const Promise = global.Promise;
|
|
const value = Object.create(Promise.prototype, {constructor: {value: Promise}});
|
|
const promise = new Promise(function(a0, a1) {
|
|
return Image.getSize(a0.url, _fun87981, a1);
|
|
});
|
|
return promise instanceof Object ? promise : value;
|
|
}
|
|
|
|
function _fun87982(a0) { // fn#87982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2404, offset: 0x01fd0919, size: 32 bytes, params: 2, frame: 11
|
|
const env0_0 = a0;
|
|
return env2_4(_fun87983);
|
|
}
|
|
|
|
function _fun87984() { // fn#87984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2444, offset: 0x01fd0939, size: 25 bytes, params: 1, frame: 11
|
|
return env2_8(function(a0) {
|
|
return a0 - 1;
|
|
});
|
|
}
|
|
|
|
function _fun87990(a0) { // fn#87990, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2769, offset: 0x01fd0a3d, size: 70 bytes, params: 2, frame: 14
|
|
const object2 = {};
|
|
copyDataProperties(object2, a0, undefined);
|
|
const id = env1_0.id;
|
|
const binding = env0_0;
|
|
object2[id] = {width: binding.naturalSize.width, height: binding.naturalSize.height};
|
|
return object2;
|
|
}
|
|
|
|
function _fun87980(a0, a1) { // fn#87980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11669:2335, offset: 0x01fd08e4, size: 53 bytes, params: 3, frame: 15
|
|
return Image.getSize(a0.url, _fun87981, a1);
|
|
}
|
|
|