1618 lines
76 KiB
TypeScript
1618 lines
76 KiB
TypeScript
/* Metro module 9546; source: modules/media_viewer/native/MediaSourceUtil.tsx; dependencies: [31, 27, 661, 4631, 1391, 4838, 4841, 1477, 8430, 8349, 4641, 8191, 4627, 1909, 8355, 8368, 1360, 8621, 676, 3856, 9547, 4496, 1244, 9548, 2] */
|
|
import ImageUtils from '../../../utils/native/ImageUtils.tsx'; /* Metro dependency 1477 */
|
|
import AlertActionCreators from '../../../actions/native/AlertActionCreators.tsx'; /* Metro dependency 4496 */
|
|
import RenderMessageMarkup from '../../messages/renderMessageMarkup.tsx'; /* Metro dependency 8349 */
|
|
import UseStateFromSharedValue from '../../reanimated/native/useStateFromSharedValue.tsx'; /* Metro dependency 8621 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as ConstantsIOSModule from '../../../ConstantsIOS.tsx'; /* Metro dependency 676 */
|
|
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
|
|
import * as FlagUtilsModule from '../../../external/discord_common/js/shared/utils/FlagUtils.tsx'; /* Metro dependency 1391 */
|
|
import * as ServerModule from '../../../flow/Server.tsx'; /* Metro dependency 1909 */
|
|
import * as InteractionComponentUtilsModule from '../../interaction_components/InteractionComponentUtils.tsx'; /* Metro dependency 4627 */
|
|
import * as MediaFormatTestersModule from '../../messages/MediaFormatTesters.tsx'; /* Metro dependency 4631 */
|
|
import * as EmbedUtilsModule from '../../../utils/EmbedUtils.tsx'; /* Metro dependency 4641 */
|
|
import * as ObscuredMediaUtilsModule from '../../explicit_media_redaction/ObscuredMediaUtils.tsx'; /* Metro dependency 4838 */
|
|
import * as ExplicitMediaRedactionModelsModule from '../../explicit_media_redaction/ExplicitMediaRedactionModels.tsx'; /* Metro dependency 4841 */
|
|
import * as EmbedUtilsModule2 from '../../messages/native/renderer/EmbedUtils.tsx'; /* Metro dependency 8191 */
|
|
import * as TransformMessageComponentsModule from '../../messages/native/renderer/transformMessageComponents.tsx'; /* Metro dependency 8355 */
|
|
import * as RowGeneratorTypesModule from '../../messages/native/renderer/RowGeneratorTypes.tsx'; /* Metro dependency 8368 */
|
|
import * as MediaViewerAnalyticsManagerModule from '../MediaViewerAnalyticsManager.tsx'; /* Metro dependency 9547 */
|
|
|
|
function _fun74490(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#74490, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:6, offset: 0x01d8f2bb, size: 747 bytes, params: 8, frame: 35
|
|
const env0_0 = require;
|
|
const _arrayLikeToArray_74493 = function(a0, a1) {
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var value3;
|
|
var length;
|
|
var value5;
|
|
var value = undefined;
|
|
var value2 = value == null;
|
|
reducibleJoin2: while (true) {
|
|
if (value2) {
|
|
r0 = value2;
|
|
break reducibleJoin2;
|
|
}
|
|
value3 = value > a0.length;
|
|
r0 = value3;
|
|
break reducibleJoin2;
|
|
}
|
|
reducibleJoin4: while (true) {
|
|
if (r0) {
|
|
length = a0.length;
|
|
r1 = length;
|
|
break reducibleJoin4;
|
|
}
|
|
r1 = value;
|
|
break reducibleJoin4;
|
|
}
|
|
value = (0, global.Array)(r1);
|
|
var value4 = 0;
|
|
if (value4 < r1) {
|
|
r2 = value4;
|
|
reducibleLoop5: while (true) {
|
|
value[r2] = a0[r2];
|
|
value5 = typeof r2 === 'bigint' ? r2 + 1n : +r2 + 1;
|
|
if (value5 < r1) {
|
|
r2 = value5;
|
|
continue reducibleLoop5;
|
|
}
|
|
break reducibleLoop5;
|
|
}
|
|
}
|
|
return value;
|
|
};
|
|
const closure = function(a0, a1) {
|
|
var value = a0;
|
|
return global.Array.isArray(value) ? a1 ? value[value.length - 1] : value[0] : value;
|
|
};
|
|
const isValidImageAttachment2 = isValidImageAttachment;
|
|
const isValidVideoAttachment2 = isValidVideoAttachment;
|
|
const closure4 = function(a0) {
|
|
return a0.image != null || a0.thumbnail != null;
|
|
};
|
|
const closure5 = function(a0) {
|
|
return a0.video != null;
|
|
};
|
|
const isThumbnailAttachment2 = isThumbnailAttachment;
|
|
const closure7 = function(a0) {
|
|
return a0.proxy_url == null ? a0.url : a0.proxy_url !== '' ? a0.proxy_url : a0.url;
|
|
};
|
|
const extractMediaFromAttachment2 = extractMediaFromAttachment;
|
|
const getEmbedUrl2 = getEmbedUrl;
|
|
const getEmbedContentScanVersion = function(a0) {
|
|
return a0.contentScanVersion ?? (a0.content_scan_version ?? undefined);
|
|
};
|
|
const getMediaContentType = function(a0) {
|
|
return 'contentType' in a0 ? a0.contentType : 'content_type' in a0 && a0.content_type != null ? a0.content_type : undefined;
|
|
};
|
|
const closure10 = function(a0) {
|
|
var r0;
|
|
r0 = a0.image ?? a0.video;
|
|
r0 = r0 ?? a0.thumbnail;
|
|
return r0;
|
|
};
|
|
const extractMediaFromEmbed2 = extractMediaFromEmbed;
|
|
const downloadMediaAssetWithContentType2 = downloadMediaAssetWithContentType;
|
|
const isAnimatedWebpSource2 = isAnimatedWebpSource;
|
|
const isAnimatedAvifSource2 = isAnimatedAvifSource;
|
|
const isGIFSource2 = isGIFSource;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_7 = RegExp('\\.avif$', 'i');
|
|
object = {PORTAL: 0};
|
|
object[0] = 'PORTAL';
|
|
object.TIKTOK_IFRAME = 1;
|
|
object[1] = 'TIKTOK_IFRAME';
|
|
object.WEB_FILE_IFRAME = 2;
|
|
object[2] = 'WEB_FILE_IFRAME';
|
|
object.DEFAULT = 3;
|
|
object[3] = 'DEFAULT';
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/media_viewer/native/MediaSourceUtil.tsx');
|
|
exports.flattenSource = closure;
|
|
exports.isValidImageAttachment = isValidImageAttachment2;
|
|
exports.isValidVideoAttachment = isValidVideoAttachment2;
|
|
exports.isValidImageEmbed = closure4;
|
|
exports.isValidVideoEmbed = closure5;
|
|
exports.isThumbnailAttachment = isThumbnailAttachment2;
|
|
exports.getAttachmentUrl = closure7;
|
|
exports.extractMediaFromAttachment = extractMediaFromAttachment2;
|
|
exports.getEmbedUrl = getEmbedUrl2;
|
|
exports.getEmbedMedia = closure10;
|
|
exports.extractMediaFromEmbed = extractMediaFromEmbed2;
|
|
exports.extractMediaFromMessageComponents = extractMediaFromMessageComponents;
|
|
exports.extractMediaSourcesFromEmbed = extractMediaSourcesFromEmbed;
|
|
exports.extractMediaSourcesFromComponent = extractMediaSourcesFromComponent;
|
|
exports.extractMediaSourcesFromMessage = extractMediaSourcesFromMessage;
|
|
exports.setMediaSourcePortal = setMediaSourcePortal;
|
|
exports.getSelectedMediaSource = function(a0) {
|
|
var property = a0.index;
|
|
var value = property.get();
|
|
if (value < 0) {
|
|
return null;
|
|
}
|
|
if (value >= a0.sources.length) {
|
|
return null;
|
|
}
|
|
property = a0.sources[value];
|
|
value = null;
|
|
return value == property ? value : global.Array.isArray(property) ? property[property.length - 1] : property;
|
|
};
|
|
exports.useSelectedMediaSource = useSelectedMediaSource;
|
|
exports.downloadMediaAsset = function(a0, a1) {
|
|
return downloadMediaAssetWithContentType(a0, a1);
|
|
};
|
|
exports.downloadMediaAssetWithContentType = downloadMediaAssetWithContentType2;
|
|
exports.getYoutubeClipVideoIdFromURI = function(a0) {
|
|
var value = a0.match(RegExp('^https:\\/\\/www\\.youtube\\.com\\/embed\\/([A-Za-z0-9_-]*)(\\?clip=([A-Za-z0-9_-]+)(&clipt=([A-Za-z0-9_-]+)))?$',
|
|
|
|
''));
|
|
var value2 = null;
|
|
if (value2 == value) {
|
|
return value2;
|
|
}
|
|
if (value.length !== 6) {
|
|
return value2;
|
|
}
|
|
var property = value[1];
|
|
var property2 = value[3];
|
|
var property3 = value[5];
|
|
return value2 == property || value2 == property2 || value2 == property3 ? value2 : {videoId: property,
|
|
clip: property2, clipt: property3};
|
|
};
|
|
exports.getYoutubeVideoIdFromURI = getYoutubeVideoIdFromURI;
|
|
exports.VideoSourceType = object;
|
|
exports.getVideoSourceType = getVideoSourceType;
|
|
exports.supportOverlayVideoControls = function(a0) {
|
|
var r0;
|
|
r0 = a0.videoURI != null && a0.isGIFV !== true;
|
|
r0 = !r0 ? a0.embedURI != null && a0.embedProviderName === 'TikTok' : r0;
|
|
return r0;
|
|
};
|
|
exports.isAnimatedWebpSource = isAnimatedWebpSource2;
|
|
exports.isAnimatedAvifSource = isAnimatedAvifSource2;
|
|
exports.isGIFSource = isGIFSource2;
|
|
exports.isAnimatedImageSource = isAnimatedImageSource;
|
|
function _createForOfIteratorHelperLoose_74491(a0, a1) { // fn#74491, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:192, offset: 0x01d8f5a6, size: 372 bytes, params: 3, frame: 20
|
|
var r6;
|
|
var r9;
|
|
var r5;
|
|
var value3;
|
|
var regexp;
|
|
const env0_0 = a0;
|
|
const Symbol = global.Symbol;
|
|
let value = typeof Symbol !== 'undefined';
|
|
let r1 = value && a0[global.Symbol.iterator];
|
|
r1 = !r1 ? a0['@@iterator'] : r1;
|
|
if (r1) {
|
|
value = r1.call(a0);
|
|
return value.next.bind(value);
|
|
}
|
|
const Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
if (r1) {
|
|
}
|
|
return _fun74492;
|
|
}
|
|
value = undefined;
|
|
if (a0) {
|
|
if (typeof a0 === 'string') {
|
|
value = _arrayLikeToArray_74493(a0, value);
|
|
r5 = value;
|
|
} else {
|
|
value3 = ({}).toString.call(a0).slice(8, -1);
|
|
r6 = value3 === 'Object' && a0.constructor;
|
|
r9 = r6 ? a0.constructor.name : value3;
|
|
if (r9 === 'Map') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Set') {
|
|
r6 = global.Array.from(a0);
|
|
} else if (r9 === 'Arguments') {
|
|
value = _arrayLikeToArray_74493(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
regexp = RegExp('^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$', '');
|
|
if (regexp.test(r9)) {
|
|
value = _arrayLikeToArray_74493(a0, value);
|
|
r6 = value;
|
|
} else {
|
|
r6 = value;
|
|
}
|
|
}
|
|
r5 = r6;
|
|
}
|
|
} else {
|
|
r5 = value;
|
|
}
|
|
if (r5) {
|
|
if (r5) {
|
|
}
|
|
return _fun74492;
|
|
}
|
|
const TypeError = global.TypeError;
|
|
throw new TypeError('Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.');
|
|
function _fun74492() { // fn#74492, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:763, offset: 0x00c39d73, size: 69 bytes, params: 1, frame: 5
|
|
return env0_1 >= env0_0.length ? {done: true} : {done: false,
|
|
value: env0_0[typeof env0_1 === 'bigint' ? env0_1 : +env0_1]};
|
|
}
|
|
|
|
}
|
|
|
|
function isValidImageAttachment(a0) { // fn#74495, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:1194, offset: 0x01d8f758, size: 114 bytes, params: 2, frame: 17
|
|
if (a0 == null) {
|
|
return false;
|
|
}
|
|
const filename = a0.filename;
|
|
const height = a0.height;
|
|
const width = a0.width;
|
|
let r0 = (require(4631) /* metro dependency 4631: MediaFormatTesters */).isImageFile(filename) && height != null && height > 0;
|
|
r0 = r0 && width != null && width > 0 && !isThumbnailAttachment(a0);
|
|
return r0;
|
|
}
|
|
|
|
function isValidVideoAttachment(a0) { // fn#74496, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:1373, offset: 0x01d8f7ca, size: 79 bytes, params: 2, frame: 15
|
|
var r1;
|
|
var r0;
|
|
let value = a0 != null;
|
|
if (value) {
|
|
value = a0 != null;
|
|
if (value) {
|
|
value = require(4631) /* metro dependency 4631: MediaFormatTesters */;
|
|
value = value.isVideoFile(a0.filename);
|
|
r1 = value;
|
|
} else {
|
|
r1 = value;
|
|
}
|
|
r1 = r1 && a0.proxy_url != null;
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isThumbnailAttachment(a0) { // fn#74499, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:1608, offset: 0x01d8f848, size: 81 bytes, params: 2, frame: 16
|
|
var r1;
|
|
var r0;
|
|
var moduleValue;
|
|
let value = a0 != null;
|
|
if (value) {
|
|
value = a0.flags != null;
|
|
if (value) {
|
|
moduleValue = require(1391) /* metro dependency 1391: FlagUtils */;
|
|
r1 = moduleValue.hasFlag(a0.flags, MessageAttachmentFlags.IS_THUMBNAIL);
|
|
} else {
|
|
r1 = value;
|
|
}
|
|
r0 = r1;
|
|
} else {
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function extractMediaFromAttachment(a0, a1, a2, a3, a4) { // fn#74501, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:1806, offset: 0x01d8f8c5, size: 1038 bytes, params: 6, frame: 32
|
|
var id;
|
|
var uRL;
|
|
var items2;
|
|
var items3;
|
|
let width = a0.width;
|
|
if (width == null) {
|
|
return undefined;
|
|
}
|
|
width = a0.width;
|
|
const value = 0;
|
|
if (width <= value) {
|
|
return undefined;
|
|
}
|
|
let height = a0.height;
|
|
if (height == null) {
|
|
return undefined;
|
|
}
|
|
if (a0.height <= value) {
|
|
return undefined;
|
|
}
|
|
const value3 = undefined;
|
|
const enabledHarmTypesForMessage = (ObscuredMediaUtilsModule).getEnabledHarmTypesForMessage(a1);
|
|
const isMediaObscuredForHarmTypes = ObscuredMediaUtilsModule.isMediaObscuredForHarmTypes;
|
|
let object = {};
|
|
const ObscuredMediaTypes = (ExplicitMediaRedactionModelsModule).ObscuredMediaTypes;
|
|
const Attachment = ObscuredMediaTypes.Attachment;
|
|
object.type = Attachment;
|
|
object.media = a0;
|
|
const isMediaObscuredForHarmTypes2 = Reflect.apply(isMediaObscuredForHarmTypes, ObscuredMediaUtilsModule, [object,
|
|
enabledHarmTypesForMessage]);
|
|
const isVideoFile2 = MediaFormatTestersModule.isVideoFile(a0.filename);
|
|
const attachmentUrl = getAttachmentUrl(a0);
|
|
const defaultImport = ImageUtils;
|
|
const getMobileOptimizedSrc = defaultImport.getMobileOptimizedSrc;
|
|
width = a0.width;
|
|
height = a0.height;
|
|
const value7 = Reflect.apply(getMobileOptimizedSrc, defaultImport, [attachmentUrl, width, height,
|
|
isVideoFile2 ? 'png' : value3]);
|
|
if (isVideoFile2) {
|
|
object = {uri: value7};
|
|
id = a1.id;
|
|
object.messageId = id;
|
|
object.guildId = a3;
|
|
object.channelId = a1.channel_id;
|
|
object.videoURI = attachmentUrl;
|
|
object.filename = (importDefault(8430) /* metro dependency 8430: getDisplayFilename */)(a0);
|
|
object.mediaIndex = a2;
|
|
object.width = a0.width;
|
|
object.height = a0.height;
|
|
object.sourceURI = attachmentUrl;
|
|
object.description = a0.description;
|
|
object.accessoryType = 'attachment';
|
|
object.spoiler = a0.spoiler;
|
|
object.flags = a0.flags;
|
|
object.obscure = isMediaObscuredForHarmTypes2;
|
|
object.placeholder = a0.placeholder;
|
|
object.contentScanVersion = a0.content_scan_version;
|
|
object.mediaViewIndex = a4;
|
|
id = a0.id;
|
|
object.attachmentId = id;
|
|
return object;
|
|
}
|
|
object = {uri: value7};
|
|
object.messageId = a1.id;
|
|
object.guildId = a3;
|
|
object.channelId = a1.channel_id;
|
|
object.filename = (importDefault(8430) /* metro dependency 8430: getDisplayFilename */)(a0);
|
|
object.mediaIndex = a2;
|
|
object.width = a0.width;
|
|
object.height = a0.height;
|
|
object.sourceURI = a0.url;
|
|
object.description = a0.description;
|
|
object.accessoryType = 'attachment';
|
|
object.spoiler = a0.spoiler;
|
|
object.flags = a0.flags;
|
|
object.obscure = isMediaObscuredForHarmTypes2;
|
|
object.placeholder = a0.placeholder;
|
|
object.contentScanVersion = a0.content_scan_version;
|
|
object.mediaViewIndex = a4;
|
|
object.attachmentId = a0.id;
|
|
const object2 = {};
|
|
copyDataProperties(object2, object, height);
|
|
object2['uri'] = attachmentUrl;
|
|
const value10 = (importDefault(8430) /* metro dependency 8430: getDisplayFilename */)(a0).toLowerCase().endsWith('.webp');
|
|
const value13 = (importDefault(8430) /* metro dependency 8430: getDisplayFilename */)(a0).toLowerCase().endsWith('.avif');
|
|
const hasFlag = FlagUtilsModule.hasFlag;
|
|
const r18 = a0.flags ?? value;
|
|
const IS_ANIMATED = MessageAttachmentFlags.IS_ANIMATED;
|
|
if (Reflect.apply(hasFlag, FlagUtilsModule, [r18, IS_ANIMATED])) {
|
|
if (value10) {
|
|
uRL = new global.URL(attachmentUrl);
|
|
uRL.searchParams.append('animated', 'true');
|
|
if (value13) {
|
|
uRL.searchParams.append('format', 'webp');
|
|
}
|
|
items3 = [object];
|
|
object = {};
|
|
copyDataProperties(object, object2, height);
|
|
object['uri'] = uRL.toString();
|
|
items3[1] = object;
|
|
return items3;
|
|
}
|
|
if (value13) {
|
|
uRL = new global.URL(attachmentUrl);
|
|
uRL.searchParams.append('animated', 'true');
|
|
if (value13) {
|
|
uRL.searchParams.append('format', 'webp');
|
|
}
|
|
items3 = [object];
|
|
object = {};
|
|
copyDataProperties(object, object2, height);
|
|
object['uri'] = uRL.toString();
|
|
items3[1] = object;
|
|
return items3;
|
|
}
|
|
}
|
|
if (value13) {
|
|
uRL = new global.URL(attachmentUrl);
|
|
uRL.searchParams.append('format', 'webp');
|
|
items2 = [object];
|
|
object = {};
|
|
copyDataProperties(object, object2, height);
|
|
object['uri'] = uRL.toString();
|
|
items2[1] = object;
|
|
return items2;
|
|
}
|
|
return attachmentUrl === value7 ? object2 : [object, object2];
|
|
}
|
|
|
|
function extractMediaFromEmbed(a0, a1, a2, a3, a4) { // fn#74506, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:4074, offset: 0x01d8fe59, size: 1413 bytes, params: 6, frame: 34
|
|
var getEmbedUrlBinding;
|
|
var getMediaContentTypeBinding;
|
|
var thumbnail;
|
|
var object2;
|
|
var embedUrlBinding;
|
|
var defaultImport3;
|
|
var value12;
|
|
var push;
|
|
var object3;
|
|
var object4;
|
|
var object5;
|
|
const getEmbedMediaBinding = getEmbedMedia;
|
|
const value2 = undefined;
|
|
const embedMediaBinding = getEmbedMediaBinding(a0);
|
|
if (embedMediaBinding == null) {
|
|
return value2;
|
|
}
|
|
let video = a0.video;
|
|
let r15 = video != null ? getEmbedUrl(a0.video) : value2;
|
|
let type = a0.type;
|
|
const embedUrl = getEmbedUrl(embedMediaBinding);
|
|
const embedContentScanVersion = getEmbedContentScanVersion(a0);
|
|
const defaultImport = importDefault(1477) /* metro dependency 1477: ImageUtils */;
|
|
let getMobileOptimizedSrc = defaultImport.getMobileOptimizedSrc;
|
|
let width = embedMediaBinding.width;
|
|
let height = embedMediaBinding.height;
|
|
const value7 = Reflect.apply(getMobileOptimizedSrc, defaultImport, [embedUrl, width, height]);
|
|
const hasSpoilerEmbeds = (RenderMessageMarkup)(a1,
|
|
{contentMessage: a2}).hasSpoilerEmbeds;
|
|
const enabledHarmTypesForMessage = (ObscuredMediaUtilsModule).getEnabledHarmTypesForMessage(a1);
|
|
const isMediaObscuredForHarmTypes = ObscuredMediaUtilsModule.isMediaObscuredForHarmTypes;
|
|
const ObscuredMediaTypes = (ExplicitMediaRedactionModelsModule).ObscuredMediaTypes;
|
|
const Embed = ObscuredMediaTypes.Embed;
|
|
const isMediaObscuredForHarmTypes2 = Reflect.apply(isMediaObscuredForHarmTypes, ObscuredMediaUtilsModule,
|
|
[{type: Embed, media: a0}, enabledHarmTypesForMessage]);
|
|
const r23 = 'title' in a0 ? a0.title : 'rawTitle' in a0 ? a0.rawTitle : value2;
|
|
const isEmbedInline = EmbedUtilsModule.isEmbedInline;
|
|
object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
object['rawTitle'] = r23;
|
|
const isEmbedInline2 = Reflect.apply(isEmbedInline, EmbedUtilsModule, [object]);
|
|
const getEffectiveVideoProvider = EmbedUtilsModule.getEffectiveVideoProvider;
|
|
let provider = a0.provider;
|
|
const name = provider == null ? value2 : provider.name;
|
|
video = a0.video;
|
|
const value9 = Reflect.apply(getEffectiveVideoProvider, EmbedUtilsModule, [name, video == null ? value2 : video.url]);
|
|
const shouldPlayVideoInline2 = (EmbedUtilsModule2).shouldPlayVideoInline(value9);
|
|
let r3 = shouldPlayVideoInline2 && a0.video != null;
|
|
if (r15 == null) {
|
|
type = a0.type;
|
|
if (type === 'video') {
|
|
object = [];
|
|
thumbnail = a0.thumbnail;
|
|
if (thumbnail != null) {
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
thumbnail = a0.thumbnail;
|
|
embedUrlBinding = getEmbedUrlBinding(thumbnail);
|
|
defaultImport3 = defaultImport;
|
|
getMobileOptimizedSrc = defaultImport3.getMobileOptimizedSrc;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
value12 = Reflect.apply(getMobileOptimizedSrc, defaultImport3, [embedUrlBinding, width, height]);
|
|
push = object.push;
|
|
object3 = {uri: value12, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object3.flags = a0.flags;
|
|
object3.obscure = isMediaObscuredForHarmTypes2;
|
|
object3.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
thumbnail = a0.thumbnail;
|
|
object3.contentType = getMediaContentTypeBinding(thumbnail);
|
|
object3.messageId = a1.id;
|
|
object3.noCarousel = !isEmbedInline2;
|
|
object3.mediaIndex = a3;
|
|
object3.accessoryType = 'embed';
|
|
object3.channelId = a1.channel_id;
|
|
thumbnail = a0.thumbnail;
|
|
object3.sourceURI = thumbnail.url;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
object3.width = width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
object3.height = height;
|
|
Reflect.apply(push, object, [object3]);
|
|
}
|
|
r3 = r3 && a0.video != null;
|
|
if (r3) {
|
|
push = object.push;
|
|
object4 = {uri: value7, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object4.flags = a0.flags;
|
|
object4.obscure = isMediaObscuredForHarmTypes2;
|
|
object4.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
video = a0.video;
|
|
object4.contentType = getMediaContentTypeBinding(video);
|
|
object4.sourceURI = a0.url;
|
|
object4.messageId = a1.id;
|
|
object4.noCarousel = !isEmbedInline2;
|
|
object4.mediaIndex = a3;
|
|
object4.accessoryType = 'embed';
|
|
video = a0.video;
|
|
object4.width = video.width;
|
|
video = a0.video;
|
|
object4.height = video.height;
|
|
object4.channelId = a1.channel_id;
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
video = a0.video;
|
|
object4.embedURI = getEmbedUrlBinding(video);
|
|
object4.embedProviderName = value9;
|
|
object4.disableDownload = true;
|
|
Reflect.apply(push, object, [object4]);
|
|
}
|
|
if (object.length !== 0) {
|
|
return object.length === 1 ? object[0] : object.length !== 2 ? value2 : [object[0], object[1]];
|
|
}
|
|
return value2;
|
|
}
|
|
type = a0.type;
|
|
if (type === 'rich') {
|
|
if (r3) {
|
|
object = [];
|
|
thumbnail = a0.thumbnail;
|
|
if (thumbnail != null) {
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
thumbnail = a0.thumbnail;
|
|
embedUrlBinding = getEmbedUrlBinding(thumbnail);
|
|
defaultImport3 = importDefault(1477) /* metro dependency 1477: ImageUtils */;
|
|
getMobileOptimizedSrc = defaultImport3.getMobileOptimizedSrc;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
value12 = Reflect.apply(getMobileOptimizedSrc, defaultImport3, [embedUrlBinding, width, height]);
|
|
push = object.push;
|
|
object3 = {uri: value12, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object3.flags = a0.flags;
|
|
object3.obscure = isMediaObscuredForHarmTypes2;
|
|
object3.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
thumbnail = a0.thumbnail;
|
|
object3.contentType = getMediaContentTypeBinding(thumbnail);
|
|
object3.messageId = a1.id;
|
|
object3.noCarousel = !isEmbedInline2;
|
|
object3.mediaIndex = a3;
|
|
object3.accessoryType = 'embed';
|
|
object3.channelId = a1.channel_id;
|
|
thumbnail = a0.thumbnail;
|
|
object3.sourceURI = thumbnail.url;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
object3.width = width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
object3.height = height;
|
|
Reflect.apply(push, object, [object3]);
|
|
}
|
|
r3 = r3 && a0.video != null;
|
|
if (r3) {
|
|
push = object.push;
|
|
object4 = {uri: value7, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object4.flags = a0.flags;
|
|
object4.obscure = isMediaObscuredForHarmTypes2;
|
|
object4.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
video = a0.video;
|
|
object4.contentType = getMediaContentTypeBinding(video);
|
|
object4.sourceURI = a0.url;
|
|
object4.messageId = a1.id;
|
|
object4.noCarousel = !isEmbedInline2;
|
|
object4.mediaIndex = a3;
|
|
object4.accessoryType = 'embed';
|
|
video = a0.video;
|
|
object4.width = video.width;
|
|
video = a0.video;
|
|
object4.height = video.height;
|
|
object4.channelId = a1.channel_id;
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
video = a0.video;
|
|
object4.embedURI = getEmbedUrlBinding(video);
|
|
object4.embedProviderName = value9;
|
|
object4.disableDownload = true;
|
|
Reflect.apply(push, object, [object4]);
|
|
}
|
|
if (object.length !== 0) {
|
|
return object.length === 1 ? object[0] : object.length !== 2 ? value2 : [object[0], object[1]];
|
|
}
|
|
return value2;
|
|
}
|
|
object = {uri: value7};
|
|
object.messageId = a1.id;
|
|
object.guildId = a4;
|
|
object.channelId = a1.channel_id;
|
|
object.mediaIndex = a3;
|
|
width = embedMediaBinding.width;
|
|
object.width = width;
|
|
height = embedMediaBinding.height;
|
|
object.height = height;
|
|
object.sourceURI = embedMediaBinding.url;
|
|
object.accessoryType = 'embed';
|
|
object.noCarousel = !isEmbedInline2;
|
|
object.spoiler = hasSpoilerEmbeds;
|
|
object.flags = a0.flags;
|
|
object.obscure = isMediaObscuredForHarmTypes2;
|
|
object.contentScanVersion = embedContentScanVersion;
|
|
object.contentType = getMediaContentType(embedMediaBinding);
|
|
object5 = {};
|
|
copyDataProperties(object5, object, undefined);
|
|
object5['uri'] = embedUrl;
|
|
return embedUrl === value7 ? object5 : [object, object5];
|
|
}
|
|
type = a0.type;
|
|
if (type !== 'article') {
|
|
object = {uri: value7};
|
|
object.messageId = a1.id;
|
|
object.guildId = a4;
|
|
object.channelId = a1.channel_id;
|
|
object.mediaIndex = a3;
|
|
object.width = embedMediaBinding.width;
|
|
object.height = embedMediaBinding.height;
|
|
object.sourceURI = embedMediaBinding.url;
|
|
object.accessoryType = 'embed';
|
|
object.noCarousel = !isEmbedInline2;
|
|
object.spoiler = hasSpoilerEmbeds;
|
|
object.flags = a0.flags;
|
|
object.obscure = isMediaObscuredForHarmTypes2;
|
|
object.contentScanVersion = embedContentScanVersion;
|
|
object.contentType = getMediaContentType(embedMediaBinding);
|
|
object5 = {};
|
|
copyDataProperties(object5, object, undefined);
|
|
object5['uri'] = embedUrl;
|
|
return embedUrl === value7 ? object5 : [object, object5];
|
|
}
|
|
if (r3) {
|
|
object = [];
|
|
thumbnail = a0.thumbnail;
|
|
if (thumbnail != null) {
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
thumbnail = a0.thumbnail;
|
|
embedUrlBinding = getEmbedUrlBinding(thumbnail);
|
|
defaultImport3 = importDefault(1477) /* metro dependency 1477: ImageUtils */;
|
|
getMobileOptimizedSrc = defaultImport3.getMobileOptimizedSrc;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
value12 = Reflect.apply(getMobileOptimizedSrc, defaultImport3, [embedUrlBinding, width, height]);
|
|
push = object.push;
|
|
object3 = {uri: value12, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object3.flags = a0.flags;
|
|
object3.obscure = isMediaObscuredForHarmTypes2;
|
|
object3.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
thumbnail = a0.thumbnail;
|
|
object3.contentType = getMediaContentTypeBinding(thumbnail);
|
|
object3.messageId = a1.id;
|
|
object3.noCarousel = !isEmbedInline2;
|
|
object3.mediaIndex = a3;
|
|
object3.accessoryType = 'embed';
|
|
object3.channelId = a1.channel_id;
|
|
thumbnail = a0.thumbnail;
|
|
object3.sourceURI = thumbnail.url;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
object3.width = width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
object3.height = height;
|
|
Reflect.apply(push, object, [object3]);
|
|
}
|
|
r3 = r3 && a0.video != null;
|
|
if (r3) {
|
|
push = object.push;
|
|
object4 = {uri: value7, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object4.flags = a0.flags;
|
|
object4.obscure = isMediaObscuredForHarmTypes2;
|
|
object4.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
video = a0.video;
|
|
object4.contentType = getMediaContentTypeBinding(video);
|
|
object4.sourceURI = a0.url;
|
|
object4.messageId = a1.id;
|
|
object4.noCarousel = !isEmbedInline2;
|
|
object4.mediaIndex = a3;
|
|
object4.accessoryType = 'embed';
|
|
video = a0.video;
|
|
object4.width = video.width;
|
|
video = a0.video;
|
|
object4.height = video.height;
|
|
object4.channelId = a1.channel_id;
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
video = a0.video;
|
|
object4.embedURI = getEmbedUrlBinding(video);
|
|
object4.embedProviderName = value9;
|
|
object4.disableDownload = true;
|
|
Reflect.apply(push, object, [object4]);
|
|
}
|
|
if (object.length !== 0) {
|
|
return object.length === 1 ? object[0] : object.length !== 2 ? value2 : [object[0], object[1]];
|
|
}
|
|
return value2;
|
|
}
|
|
object = {uri: value7};
|
|
object.messageId = a1.id;
|
|
object.guildId = a4;
|
|
object.channelId = a1.channel_id;
|
|
object.mediaIndex = a3;
|
|
width = embedMediaBinding.width;
|
|
object.width = width;
|
|
height = embedMediaBinding.height;
|
|
object.height = height;
|
|
object.sourceURI = embedMediaBinding.url;
|
|
object.accessoryType = 'embed';
|
|
object.noCarousel = !isEmbedInline2;
|
|
object.spoiler = hasSpoilerEmbeds;
|
|
object.flags = a0.flags;
|
|
object.obscure = isMediaObscuredForHarmTypes2;
|
|
object.contentScanVersion = embedContentScanVersion;
|
|
object.contentType = getMediaContentType(embedMediaBinding);
|
|
object5 = {};
|
|
copyDataProperties(object5, object, undefined);
|
|
object5['uri'] = embedUrl;
|
|
return embedUrl === value7 ? object5 : [object, object5];
|
|
}
|
|
if (shouldPlayVideoInline2) {
|
|
type = a0.type;
|
|
if (type === 'video') {
|
|
object = [];
|
|
thumbnail = a0.thumbnail;
|
|
if (thumbnail != null) {
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
thumbnail = a0.thumbnail;
|
|
embedUrlBinding = getEmbedUrlBinding(thumbnail);
|
|
defaultImport3 = defaultImport;
|
|
getMobileOptimizedSrc = defaultImport3.getMobileOptimizedSrc;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
value12 = Reflect.apply(getMobileOptimizedSrc, defaultImport3, [embedUrlBinding, width, height]);
|
|
push = object.push;
|
|
object3 = {uri: value12, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object3.flags = a0.flags;
|
|
object3.obscure = isMediaObscuredForHarmTypes2;
|
|
object3.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
thumbnail = a0.thumbnail;
|
|
object3.contentType = getMediaContentTypeBinding(thumbnail);
|
|
object3.messageId = a1.id;
|
|
object3.noCarousel = !isEmbedInline2;
|
|
object3.mediaIndex = a3;
|
|
object3.accessoryType = 'embed';
|
|
object3.channelId = a1.channel_id;
|
|
thumbnail = a0.thumbnail;
|
|
object3.sourceURI = thumbnail.url;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
object3.width = width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
object3.height = height;
|
|
Reflect.apply(push, object, [object3]);
|
|
}
|
|
r3 = r3 && a0.video != null;
|
|
if (r3) {
|
|
push = object.push;
|
|
object4 = {uri: value7, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object4.flags = a0.flags;
|
|
object4.obscure = isMediaObscuredForHarmTypes2;
|
|
object4.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
video = a0.video;
|
|
object4.contentType = getMediaContentTypeBinding(video);
|
|
object4.sourceURI = a0.url;
|
|
object4.messageId = a1.id;
|
|
object4.noCarousel = !isEmbedInline2;
|
|
object4.mediaIndex = a3;
|
|
object4.accessoryType = 'embed';
|
|
video = a0.video;
|
|
object4.width = video.width;
|
|
video = a0.video;
|
|
object4.height = video.height;
|
|
object4.channelId = a1.channel_id;
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
video = a0.video;
|
|
object4.embedURI = getEmbedUrlBinding(video);
|
|
object4.embedProviderName = value9;
|
|
object4.disableDownload = true;
|
|
Reflect.apply(push, object, [object4]);
|
|
}
|
|
if (object.length !== 0) {
|
|
return object.length === 1 ? object[0] : object.length !== 2 ? value2 : [object[0], object[1]];
|
|
}
|
|
return value2;
|
|
}
|
|
type = a0.type;
|
|
if (type === 'rich') {
|
|
if (r3) {
|
|
object = [];
|
|
thumbnail = a0.thumbnail;
|
|
if (thumbnail != null) {
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
thumbnail = a0.thumbnail;
|
|
embedUrlBinding = getEmbedUrlBinding(thumbnail);
|
|
defaultImport3 = importDefault(1477) /* metro dependency 1477: ImageUtils */;
|
|
getMobileOptimizedSrc = defaultImport3.getMobileOptimizedSrc;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
value12 = Reflect.apply(getMobileOptimizedSrc, defaultImport3, [embedUrlBinding, width, height]);
|
|
push = object.push;
|
|
object3 = {uri: value12, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object3.flags = a0.flags;
|
|
object3.obscure = isMediaObscuredForHarmTypes2;
|
|
object3.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
thumbnail = a0.thumbnail;
|
|
object3.contentType = getMediaContentTypeBinding(thumbnail);
|
|
object3.messageId = a1.id;
|
|
object3.noCarousel = !isEmbedInline2;
|
|
object3.mediaIndex = a3;
|
|
object3.accessoryType = 'embed';
|
|
object3.channelId = a1.channel_id;
|
|
thumbnail = a0.thumbnail;
|
|
object3.sourceURI = thumbnail.url;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
object3.width = width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
object3.height = height;
|
|
Reflect.apply(push, object, [object3]);
|
|
}
|
|
r3 = r3 && a0.video != null;
|
|
if (r3) {
|
|
push = object.push;
|
|
object4 = {uri: value7, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object4.flags = a0.flags;
|
|
object4.obscure = isMediaObscuredForHarmTypes2;
|
|
object4.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
video = a0.video;
|
|
object4.contentType = getMediaContentTypeBinding(video);
|
|
object4.sourceURI = a0.url;
|
|
object4.messageId = a1.id;
|
|
object4.noCarousel = !isEmbedInline2;
|
|
object4.mediaIndex = a3;
|
|
object4.accessoryType = 'embed';
|
|
video = a0.video;
|
|
object4.width = video.width;
|
|
video = a0.video;
|
|
object4.height = video.height;
|
|
object4.channelId = a1.channel_id;
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
video = a0.video;
|
|
object4.embedURI = getEmbedUrlBinding(video);
|
|
object4.embedProviderName = value9;
|
|
object4.disableDownload = true;
|
|
Reflect.apply(push, object, [object4]);
|
|
}
|
|
if (object.length !== 0) {
|
|
return object.length === 1 ? object[0] : object.length !== 2 ? value2 : [object[0], object[1]];
|
|
}
|
|
return value2;
|
|
}
|
|
object = {uri: value7};
|
|
object.messageId = a1.id;
|
|
object.guildId = a4;
|
|
object.channelId = a1.channel_id;
|
|
object.mediaIndex = a3;
|
|
width = embedMediaBinding.width;
|
|
object.width = width;
|
|
height = embedMediaBinding.height;
|
|
object.height = height;
|
|
object.sourceURI = embedMediaBinding.url;
|
|
object.accessoryType = 'embed';
|
|
object.noCarousel = !isEmbedInline2;
|
|
object.spoiler = hasSpoilerEmbeds;
|
|
object.flags = a0.flags;
|
|
object.obscure = isMediaObscuredForHarmTypes2;
|
|
object.contentScanVersion = embedContentScanVersion;
|
|
object.contentType = getMediaContentType(embedMediaBinding);
|
|
object5 = {};
|
|
copyDataProperties(object5, object, undefined);
|
|
object5['uri'] = embedUrl;
|
|
return embedUrl === value7 ? object5 : [object, object5];
|
|
}
|
|
type = a0.type;
|
|
if (type !== 'article') {
|
|
object = {uri: value7};
|
|
object.messageId = a1.id;
|
|
object.guildId = a4;
|
|
object.channelId = a1.channel_id;
|
|
object.mediaIndex = a3;
|
|
object.width = embedMediaBinding.width;
|
|
object.height = embedMediaBinding.height;
|
|
object.sourceURI = embedMediaBinding.url;
|
|
object.accessoryType = 'embed';
|
|
object.noCarousel = !isEmbedInline2;
|
|
object.spoiler = hasSpoilerEmbeds;
|
|
object.flags = a0.flags;
|
|
object.obscure = isMediaObscuredForHarmTypes2;
|
|
object.contentScanVersion = embedContentScanVersion;
|
|
object.contentType = getMediaContentType(embedMediaBinding);
|
|
object5 = {};
|
|
copyDataProperties(object5, object, undefined);
|
|
object5['uri'] = embedUrl;
|
|
return embedUrl === value7 ? object5 : [object, object5];
|
|
}
|
|
if (r3) {
|
|
object = [];
|
|
thumbnail = a0.thumbnail;
|
|
if (thumbnail != null) {
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
thumbnail = a0.thumbnail;
|
|
embedUrlBinding = getEmbedUrlBinding(thumbnail);
|
|
defaultImport3 = importDefault(1477) /* metro dependency 1477: ImageUtils */;
|
|
getMobileOptimizedSrc = defaultImport3.getMobileOptimizedSrc;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
value12 = Reflect.apply(getMobileOptimizedSrc, defaultImport3, [embedUrlBinding, width, height]);
|
|
push = object.push;
|
|
object3 = {uri: value12, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object3.flags = a0.flags;
|
|
object3.obscure = isMediaObscuredForHarmTypes2;
|
|
object3.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
thumbnail = a0.thumbnail;
|
|
object3.contentType = getMediaContentTypeBinding(thumbnail);
|
|
object3.messageId = a1.id;
|
|
object3.noCarousel = !isEmbedInline2;
|
|
object3.mediaIndex = a3;
|
|
object3.accessoryType = 'embed';
|
|
object3.channelId = a1.channel_id;
|
|
thumbnail = a0.thumbnail;
|
|
object3.sourceURI = thumbnail.url;
|
|
thumbnail = a0.thumbnail;
|
|
width = thumbnail.width;
|
|
object3.width = width;
|
|
thumbnail = a0.thumbnail;
|
|
height = thumbnail.height;
|
|
object3.height = height;
|
|
Reflect.apply(push, object, [object3]);
|
|
}
|
|
r3 = r3 && a0.video != null;
|
|
if (r3) {
|
|
push = object.push;
|
|
object4 = {uri: value7, guildId: a4, spoiler: hasSpoilerEmbeds};
|
|
object4.flags = a0.flags;
|
|
object4.obscure = isMediaObscuredForHarmTypes2;
|
|
object4.contentScanVersion = embedContentScanVersion;
|
|
getMediaContentTypeBinding = getMediaContentType;
|
|
video = a0.video;
|
|
object4.contentType = getMediaContentTypeBinding(video);
|
|
object4.sourceURI = a0.url;
|
|
object4.messageId = a1.id;
|
|
object4.noCarousel = !isEmbedInline2;
|
|
object4.mediaIndex = a3;
|
|
object4.accessoryType = 'embed';
|
|
video = a0.video;
|
|
object4.width = video.width;
|
|
video = a0.video;
|
|
object4.height = video.height;
|
|
object4.channelId = a1.channel_id;
|
|
getEmbedUrlBinding = getEmbedUrl;
|
|
video = a0.video;
|
|
object4.embedURI = getEmbedUrlBinding(video);
|
|
object4.embedProviderName = value9;
|
|
object4.disableDownload = true;
|
|
Reflect.apply(push, object, [object4]);
|
|
}
|
|
if (object.length !== 0) {
|
|
return object.length === 1 ? object[0] : object.length !== 2 ? value2 : [object[0], object[1]];
|
|
}
|
|
return value2;
|
|
}
|
|
object = {uri: value7};
|
|
object.messageId = a1.id;
|
|
object.guildId = a4;
|
|
object.channelId = a1.channel_id;
|
|
object.mediaIndex = a3;
|
|
width = embedMediaBinding.width;
|
|
object.width = width;
|
|
height = embedMediaBinding.height;
|
|
object.height = height;
|
|
object.sourceURI = embedMediaBinding.url;
|
|
object.accessoryType = 'embed';
|
|
object.noCarousel = !isEmbedInline2;
|
|
object.spoiler = hasSpoilerEmbeds;
|
|
object.flags = a0.flags;
|
|
object.obscure = isMediaObscuredForHarmTypes2;
|
|
object.contentScanVersion = embedContentScanVersion;
|
|
object.contentType = getMediaContentType(embedMediaBinding);
|
|
object5 = {};
|
|
copyDataProperties(object5, object, undefined);
|
|
object5['uri'] = embedUrl;
|
|
return embedUrl === value7 ? object5 : [object, object5];
|
|
}
|
|
object = {uri: value7};
|
|
object.messageId = a1.id;
|
|
object.guildId = a4;
|
|
object.channelId = a1.channel_id;
|
|
object.mediaIndex = a3;
|
|
object.videoURI = r15;
|
|
object.embedURI = a0.url;
|
|
object.width = embedMediaBinding.width;
|
|
object.height = embedMediaBinding.height;
|
|
object.isGIFV = type === 'gifv';
|
|
object.sourceURI = embedMediaBinding.url;
|
|
provider = a0.provider;
|
|
object.embedProviderName = provider == null ? value2 : provider.name;
|
|
object.accessoryType = 'embed';
|
|
object.noCarousel = !isEmbedInline2;
|
|
object.spoiler = hasSpoilerEmbeds;
|
|
object.flags = a0.flags;
|
|
object.contentScanVersion = embedContentScanVersion;
|
|
object.contentType = getMediaContentType(embedMediaBinding);
|
|
object.obscure = isMediaObscuredForHarmTypes2;
|
|
thumbnail = a0.thumbnail;
|
|
if (thumbnail != null) {
|
|
object2 = {};
|
|
thumbnail = a0.thumbnail;
|
|
object2.width = thumbnail.width;
|
|
thumbnail = a0.thumbnail;
|
|
object2.height = thumbnail.height;
|
|
thumbnail = a0.thumbnail;
|
|
object2.uri = thumbnail.url;
|
|
r15 = object2;
|
|
} else {
|
|
r15 = value2;
|
|
}
|
|
object.thumbnail = r15;
|
|
return object;
|
|
}
|
|
|
|
function toMediaSourceFromUnfurledMedia(a0, a1, a2, a3, a4) { // fn#74507, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:6441, offset: 0x01d903de, size: 528 bytes, params: 6, frame: 26
|
|
var object2;
|
|
var r1;
|
|
var object;
|
|
const value2 = undefined;
|
|
const unfurledMediaItemType = (TransformMessageComponentsModule).getUnfurledMediaItemType(a2);
|
|
const MediaGalleryItemType = (RowGeneratorTypesModule).MediaGalleryItemType;
|
|
const VISUAL_PLACEHOLDER = MediaGalleryItemType.VISUAL_PLACEHOLDER;
|
|
if (unfurledMediaItemType === VISUAL_PLACEHOLDER) {
|
|
return null;
|
|
}
|
|
const VIDEO = MediaGalleryItemType.VIDEO;
|
|
const value4 = unfurledMediaItemType === VIDEO;
|
|
const defaultImport = ImageUtils;
|
|
const getMobileOptimizedSrc = defaultImport.getMobileOptimizedSrc;
|
|
let proxyUrl = a2.proxyUrl;
|
|
const width = a2.width;
|
|
const value5 = 0;
|
|
const r6 = width ?? value5;
|
|
const r5 = a2.height ?? value5;
|
|
const value7 = Reflect.apply(getMobileOptimizedSrc, defaultImport, [proxyUrl, r6, r5, value4 ? 'png' : value2]);
|
|
const contentScanMetadata = a2.contentScanMetadata;
|
|
const version = contentScanMetadata == null ? value2 : contentScanMetadata.version;
|
|
let value = ObscuredMediaUtilsModule;
|
|
value = value.getEnabledHarmTypesForMessage(a0);
|
|
const isMediaObscuredForHarmTypes = ObscuredMediaUtilsModule.isMediaObscuredForHarmTypes;
|
|
const ObscuredMediaTypes = (ExplicitMediaRedactionModelsModule).ObscuredMediaTypes;
|
|
const GenericMedia = ObscuredMediaTypes.GenericMedia;
|
|
value = Reflect.apply(isMediaObscuredForHarmTypes, ObscuredMediaUtilsModule, [{type: GenericMedia, media: a2},
|
|
value]);
|
|
object2 = {};
|
|
object2.messageId = a0.id;
|
|
object2.guildId = a1;
|
|
object2.channelId = a0.channel_id;
|
|
object2.uri = value7;
|
|
object2.sourceURI = a2.url;
|
|
object2.width = a2.width ?? value5;
|
|
object2.height = a2.height ?? value5;
|
|
object2.contentType = a2.contentType;
|
|
object2.description = a3;
|
|
object2.spoiler = a4;
|
|
object2.obscure = value;
|
|
object2.contentScanVersion = version;
|
|
object2.accessoryType = 'component';
|
|
object2.mediaIndex = value5;
|
|
const object3 = {};
|
|
copyDataProperties(object3, object2, r5);
|
|
proxyUrl = a2.proxyUrl;
|
|
if (value4) {
|
|
object3['videoURI'] = proxyUrl;
|
|
return object3;
|
|
}
|
|
object3['uri'] = proxyUrl;
|
|
if (a2.proxyUrl === value7) {
|
|
r1 = object3;
|
|
} else {
|
|
object = {};
|
|
copyDataProperties(object, object2, r5);
|
|
r1 = [object, object3];
|
|
}
|
|
return r1;
|
|
}
|
|
|
|
function handleDownloadError() { // fn#74508, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:7314, offset: 0x01d905ee, size: 150 bytes, params: 1, frame: 18
|
|
const defaultImport = AlertActionCreators;
|
|
const show = defaultImport.show;
|
|
const intl = (IndexNativeModule).intl;
|
|
const string = intl.string;
|
|
const t = (IndexNativeModule).t;
|
|
Reflect.apply(show, defaultImport, [{title: Reflect.apply(string, intl, [t.cV3alD]), body: intl.string(t.r4Zjzv),
|
|
isDismissable: true}]);
|
|
}
|
|
|
|
function downloadMediaAssetWithContentType(a0, a1, a2) { // fn#74509, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:7476, offset: 0x01d90684, size: 101 bytes, params: 4, frame: 17
|
|
const env0_0 = a1;
|
|
const r3 = a2 != null ? NativeModules.MediaManager.downloadMediaAssetWithContentType(a0, a1,
|
|
a2) : NativeModules.MediaManager.downloadMediaAsset(a0, a1);
|
|
return r3.then(_fun74510, handleDownloadError);
|
|
function _fun74510() { // fn#74510, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:7643, offset: 0x01d906e9, size: 249 bytes, params: 1, frame: 14
|
|
const MediaType = (ConstantsIOSModule).MediaType;
|
|
const IMAGE = MediaType.IMAGE;
|
|
if (IMAGE === require) {
|
|
(require(3856) /* metro dependency 3856: ToastUtils */).presentImageSaved();
|
|
} else if (MediaType.GIF === require) {
|
|
(require(3856) /* metro dependency 3856: ToastUtils */).presentGifSaved();
|
|
} else if (MediaType.VIDEO === require) {
|
|
(require(3856) /* metro dependency 3856: ToastUtils */).presentVideoSaved();
|
|
}
|
|
const MediaViewerAnalytics = (MediaViewerAnalyticsManagerModule).MediaViewerAnalytics;
|
|
MediaViewerAnalytics.trackMediaViewerDownloadButtonTapped();
|
|
}
|
|
|
|
}
|
|
|
|
function isAnimatedWebpSource(a0) { // fn#74511, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:8136, offset: 0x01d907e2, size: 143 bytes, params: 2, frame: 15
|
|
var uri;
|
|
var moduleValue;
|
|
var URL;
|
|
var uRL;
|
|
let r0 = a0.sourceURI != null && a0.uri != null;
|
|
if (r0) {
|
|
moduleValue = require(4631) /* metro dependency 4631: MediaFormatTesters */;
|
|
r0 = moduleValue.urlMatchesFileExtension(a0.sourceURI, WEBP_RE_IOS);
|
|
}
|
|
if (r0) {
|
|
URL = global.URL;
|
|
uri = a0.uri;
|
|
uRL = new URL();
|
|
uRL = uRL.searchParams.get('animated');
|
|
uRL = uRL === 'true';
|
|
r0 = uRL;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isAnimatedAvifSource(a0) { // fn#74512, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:8310, offset: 0x01d90871, size: 143 bytes, params: 2, frame: 15
|
|
var uri;
|
|
var moduleValue;
|
|
var URL;
|
|
var uRL;
|
|
let r0 = a0.sourceURI != null && a0.uri != null;
|
|
if (r0) {
|
|
moduleValue = require(4631) /* metro dependency 4631: MediaFormatTesters */;
|
|
r0 = moduleValue.urlMatchesFileExtension(a0.sourceURI, env0_7);
|
|
}
|
|
if (r0) {
|
|
URL = global.URL;
|
|
uri = a0.uri;
|
|
uRL = new URL();
|
|
uRL = uRL.searchParams.get('animated');
|
|
uRL = uRL === 'true';
|
|
r0 = uRL;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isGIFSource({sourceURI}) { // fn#74513, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:8484, offset: 0x01d90900, size: 66 bytes, params: 2, frame: 16
|
|
const urlMatchesFileExtension = MediaFormatTestersModule.urlMatchesFileExtension;
|
|
const GIF_RE_IOS = (ConstantsIOSModule).GIF_RE_IOS;
|
|
return Reflect.apply(urlMatchesFileExtension, MediaFormatTestersModule, [sourceURI, GIF_RE_IOS]);
|
|
}
|
|
|
|
function extractMediaFromMessageComponents(a0, a1, a2) { // fn#74514, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:9155, offset: 0x01d90942, size: 511 bytes, params: 4, frame: 38
|
|
var r7;
|
|
var r20;
|
|
var property;
|
|
var type;
|
|
const ComponentType = (ServerModule).ComponentType;
|
|
var MEDIA_GALLERY;
|
|
var THUMBNAIL;
|
|
var toMediaSourceFromUnfurledMediaBinding;
|
|
var media;
|
|
var description;
|
|
var spoiler;
|
|
var push;
|
|
var _createForOfIteratorHelperLoose_74491Binding;
|
|
var items3;
|
|
var value5;
|
|
var done;
|
|
var value6;
|
|
var value7;
|
|
var value8;
|
|
let length = a1.components.length;
|
|
let value = 0;
|
|
if (value === length) {
|
|
return [];
|
|
}
|
|
const items4 = [];
|
|
const value4 = InteractionComponentUtilsModule.flattenComponents(a1.components).values();
|
|
const items2 = [];
|
|
arraySpread(items2, value4, value, undefined);
|
|
length = items2.length;
|
|
if (value < length) {
|
|
r7 = value;
|
|
while (true) {
|
|
property = items2[r7];
|
|
type = property.type;
|
|
MEDIA_GALLERY = ComponentType.MEDIA_GALLERY;
|
|
if (MEDIA_GALLERY !== type) {
|
|
THUMBNAIL = ComponentType.THUMBNAIL;
|
|
if (THUMBNAIL !== type) {
|
|
break;
|
|
}
|
|
toMediaSourceFromUnfurledMediaBinding = toMediaSourceFromUnfurledMedia;
|
|
media = property.media;
|
|
description = property.description;
|
|
spoiler = property.spoiler;
|
|
value = toMediaSourceFromUnfurledMediaBinding(a0, a2, media, description, spoiler);
|
|
if (value == null) {
|
|
break;
|
|
}
|
|
push = items4.push;
|
|
media = property.media;
|
|
Reflect.apply(push, items4, [{sources: value, unfurledMediaItem: media}]);
|
|
break;
|
|
}
|
|
_createForOfIteratorHelperLoose_74491Binding = _createForOfIteratorHelperLoose_74491;
|
|
items3 = property.items;
|
|
value = _createForOfIteratorHelperLoose_74491Binding(items3);
|
|
value5 = value();
|
|
done = value5.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r20 = value5;
|
|
while (true) {
|
|
value6 = r20.value;
|
|
toMediaSourceFromUnfurledMediaBinding = toMediaSourceFromUnfurledMedia;
|
|
media = value6.media;
|
|
description = value6.description;
|
|
spoiler = value6.spoiler;
|
|
value7 = toMediaSourceFromUnfurledMediaBinding(a0, a2, media, description, spoiler);
|
|
if (value7 != null) {
|
|
push = items4.push;
|
|
media = value6.media;
|
|
Reflect.apply(push, items4, [{sources: value7, unfurledMediaItem: media}]);
|
|
}
|
|
value8 = value();
|
|
done = value8.done;
|
|
if (done) {
|
|
break;
|
|
}
|
|
r20 = value8;
|
|
continue;
|
|
}
|
|
value = typeof r7 === 'bigint' ? r7 + 1n : +r7 + 1;
|
|
length = items2.length;
|
|
if (value < length) {
|
|
r7 = value;
|
|
continue;
|
|
}
|
|
break;
|
|
}
|
|
}
|
|
return items4;
|
|
}
|
|
|
|
function extractMediaSourcesFromEmbed(a0, a1, a2, a3, a4) { // fn#74515, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:9826, offset: 0x01d90b41, size: 129 bytes, params: 6, frame: 16
|
|
const env0_0 = a0;
|
|
const env0_1 = a2;
|
|
const env0_2 = a3;
|
|
const env0_3 = a4;
|
|
const env0_4 = (RenderMessageMarkup)(a0,
|
|
{contentMessage: a1}).hasSpoilerEmbeds;
|
|
return (a2.images ?? [a2.image]).map(_fun74516);
|
|
function _fun74516(a0) { // fn#74516, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:9976, offset: 0x01d90bc2, size: 418 bytes, params: 2, frame: 25
|
|
let value = environment.__proto__;
|
|
const embedUrl = getEmbedUrl(a0);
|
|
const mobileOptimizedSrc = (ImageUtils).getMobileOptimizedSrc(embedUrl,
|
|
a0.width, a0.height);
|
|
const embedContentScanVersion = getEmbedContentScanVersion(importDefault);
|
|
const getEnabledHarmTypesForMessage = (ObscuredMediaUtilsModule).getEnabledHarmTypesForMessage;
|
|
const binding = env0_0;
|
|
value = Reflect.apply(getEnabledHarmTypesForMessage, value, [binding]);
|
|
const getMediaObscuredReasonFromBitmask = ObscuredMediaUtilsModule.getMediaObscuredReasonFromBitmask;
|
|
const ObscuredMediaTypes = (ExplicitMediaRedactionModelsModule).ObscuredMediaTypes;
|
|
const Embed = ObscuredMediaTypes.Embed;
|
|
value = Reflect.apply(getMediaObscuredReasonFromBitmask, ObscuredMediaUtilsModule, [{type: Embed,
|
|
media: importDefault}, value]).length > 0;
|
|
const binding2 = env0_3;
|
|
const hasSpoilerEmbedsBinding = hasSpoilerEmbeds;
|
|
return [{uri: mobileOptimizedSrc, messageId: binding.id, guildId: binding2, channelId: binding.channel_id,
|
|
mediaIndex: importAll, width: a0.width, height: a0.height, sourceURI: a0.url, accessoryType: 'embed',
|
|
noCarousel: false, spoiler: hasSpoilerEmbedsBinding, flags: importDefault.flags, obscure: value,
|
|
contentScanVersion: embedContentScanVersion, contentType: a0.contentType}, {uri: embedUrl,
|
|
messageId: binding.id, guildId: binding2, channelId: binding.channel_id, mediaIndex: importAll, width: a0.width,
|
|
height: a0.height, sourceURI: a0.url, accessoryType: 'embed', noCarousel: false,
|
|
spoiler: hasSpoilerEmbedsBinding, contentType: a0.contentType, flags: importDefault.flags, obscure: value,
|
|
contentScanVersion: embedContentScanVersion}];
|
|
}
|
|
|
|
}
|
|
|
|
function extractMediaSourcesFromComponent(a0, a1, a2, a3, a4) { // fn#74517, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:10749, offset: 0x01d90d64, size: 340 bytes, params: 6, frame: 24
|
|
let value = a4;
|
|
const env0_0 = a0;
|
|
const env0_1 = a2;
|
|
const value4 = (InteractionComponentUtilsModule).flattenComponents(a1).get(a3);
|
|
const value5 = null;
|
|
if (value5 != value4) {
|
|
var type = value4.type;
|
|
var ComponentType = (require(1909) /* metro dependency 1909: Server */).ComponentType;
|
|
var MEDIA_GALLERY = ComponentType.MEDIA_GALLERY;
|
|
if (MEDIA_GALLERY === type) {
|
|
var env0_2 = value5 != value && value <= value4.items.length ? value : 0;
|
|
value = value4.items.map(_fun74518);
|
|
value = value.filter((require(1360) /* metro dependency 1360: GlobalUtils */).isNotNullish);
|
|
return {initialIndex: env0_2, sources: value};
|
|
}
|
|
var THUMBNAIL = ComponentType.THUMBNAIL;
|
|
if (THUMBNAIL === type) {
|
|
value = toMediaSourceFromUnfurledMedia(a0, a2, value4.media, value4.description, value4.spoiler);
|
|
return value5 == value ? value5 : {initialIndex: 0, sources: [value]};
|
|
}
|
|
}
|
|
return value5;
|
|
function _fun74518({media, description, spoiler}, a1) { // fn#74518, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:10979, offset: 0x01d90eb8, size: 81 bytes, params: 3, frame: 20
|
|
return toMediaSourceFromUnfurledMedia(env0_0, importDefault, media, description,
|
|
spoiler) ?? (a1 < env0_2 ? null : null);
|
|
}
|
|
|
|
}
|
|
|
|
function extractMediaSourcesFromMessage(a0, a1, a2, a3) { // fn#74519, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:11379, offset: 0x01d90f09, size: 326 bytes, params: 5, frame: 28
|
|
var r11;
|
|
var r12;
|
|
var r14;
|
|
var r6;
|
|
var property;
|
|
var value3;
|
|
var push;
|
|
var value4;
|
|
var value5;
|
|
var has;
|
|
var type;
|
|
const items2 = [];
|
|
let attachments = a1.attachments;
|
|
let length = attachments.length;
|
|
let value = 0;
|
|
if (value < length) {
|
|
r11 = value;
|
|
r12 = value;
|
|
reducibleLoop1: while (true) {
|
|
attachments = a1.attachments;
|
|
property = attachments[r11];
|
|
reducibleJoin5: while (true) {
|
|
reducibleJoin3: while (true) {
|
|
if (isValidImageAttachment(property)) {
|
|
break reducibleJoin3;
|
|
}
|
|
if (isValidVideoAttachment(property)) {
|
|
break reducibleJoin3;
|
|
}
|
|
break reducibleJoin5;
|
|
}
|
|
value3 = extractMediaFromAttachment(property, a0, r11, a2, r12);
|
|
if (value3 == null) {
|
|
break reducibleJoin5;
|
|
}
|
|
push = items2.push;
|
|
Reflect.apply(push, items2, [value3]);
|
|
break reducibleJoin5;
|
|
}
|
|
reducibleJoin7: while (true) {
|
|
if (isThumbnailAttachment(property)) {
|
|
r14 = r12;
|
|
break reducibleJoin7;
|
|
}
|
|
value4 = r12 + 1;
|
|
r14 = value4;
|
|
break reducibleJoin7;
|
|
}
|
|
value5 = typeof r11 === 'bigint' ? r11 + 1n : +r11 + 1;
|
|
attachments = a1.attachments;
|
|
length = attachments.length;
|
|
if (value5 < length) {
|
|
r11 = value5;
|
|
r12 = r14;
|
|
continue reducibleLoop1;
|
|
}
|
|
break reducibleLoop1;
|
|
}
|
|
}
|
|
let embeds = a1.embeds;
|
|
length = embeds.length;
|
|
if (value < length) {
|
|
r6 = value;
|
|
reducibleLoop9: while (true) {
|
|
embeds = a1.embeds;
|
|
property = embeds[r6];
|
|
reducibleJoin15: while (true) {
|
|
reducibleJoin13: while (true) {
|
|
if (a3 == null) {
|
|
if (isValidImageEmbed(property)) {
|
|
break reducibleJoin13;
|
|
}
|
|
if (isValidVideoEmbed(property)) {
|
|
break reducibleJoin13;
|
|
}
|
|
break reducibleJoin15;
|
|
}
|
|
has = a3.has;
|
|
type = property.type;
|
|
if (Reflect.apply(has, a3, [type])) {
|
|
if (isValidImageEmbed(property)) {
|
|
break reducibleJoin13;
|
|
}
|
|
if (isValidVideoEmbed(property)) {
|
|
break reducibleJoin13;
|
|
}
|
|
break reducibleJoin15;
|
|
}
|
|
break reducibleJoin15;
|
|
}
|
|
value = extractMediaFromEmbed(property, a0, a1, r6, a2);
|
|
if (value == null) {
|
|
break reducibleJoin15;
|
|
}
|
|
push = items2.push;
|
|
Reflect.apply(push, items2, [value]);
|
|
break reducibleJoin15;
|
|
}
|
|
value = typeof r6 === 'bigint' ? r6 + 1n : +r6 + 1;
|
|
embeds = a1.embeds;
|
|
length = embeds.length;
|
|
if (value < length) {
|
|
r6 = value;
|
|
continue reducibleLoop9;
|
|
}
|
|
break reducibleLoop9;
|
|
}
|
|
}
|
|
return items2;
|
|
}
|
|
|
|
function setMediaSourcePortal(a0, a1) { // fn#74520, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:11874, offset: 0x01d9104f, size: 81 bytes, params: 3, frame: 14
|
|
var Array;
|
|
const value = flattenSource(a0);
|
|
if (!(value == null || value.obscure)) {
|
|
Array = global.Array;
|
|
if (Array.isArray(a0)) {
|
|
a0[0].portal = a1;
|
|
} else {
|
|
a0.portal = a1;
|
|
}
|
|
}
|
|
}
|
|
|
|
function useSelectedMediaSource(a0) { // fn#74522, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:12219, offset: 0x01d9110a, size: 102 bytes, params: 2, frame: 15
|
|
const env0_0 = a0;
|
|
const value2 = (UseStateFromSharedValue)(a0.index);
|
|
const useMemo = ReactModule.useMemo;
|
|
let items2 = [a0.sources, value2];
|
|
items2 = [value2, Reflect.apply(useMemo, ReactModule, [_fun74523, items2])];
|
|
return items2;
|
|
function _fun74523() { // fn#74523, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:12293, offset: 0x01d91170, size: 112 bytes, params: 1, frame: 13
|
|
if (env0_1 < 0) {
|
|
return null;
|
|
}
|
|
if (env0_1 >= env0_0.sources.length) {
|
|
return null;
|
|
}
|
|
const property = env0_0.sources[env0_1];
|
|
const value = null;
|
|
return value == property ? value : global.Array.isArray(property) ? property[property.length - 1] : property;
|
|
}
|
|
|
|
}
|
|
|
|
function getVideoSourceType(a0) { // fn#74527, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:13263, offset: 0x01d91304, size: 201 bytes, params: 2, frame: 15
|
|
var r0;
|
|
var moduleValue;
|
|
var moduleValue2;
|
|
if (a0.videoURI == null) {
|
|
if (a0.portal == null) {
|
|
r0 = a0.embedURI == null ? env0_8.DEFAULT : a0.embedProviderName === 'TikTok' ? env0_8.TIKTOK_IFRAME : env0_8.DEFAULT;
|
|
} else {
|
|
moduleValue2 = require(9548) /* metro dependency 9548: NativePortalView */;
|
|
r0 = moduleValue2.isPortalExpired(a0.portal) ? a0.embedURI == null ? env0_8.DEFAULT : a0.embedProviderName === 'TikTok' ? env0_8.TIKTOK_IFRAME : env0_8.DEFAULT : env0_8.PORTAL;
|
|
}
|
|
} else {
|
|
moduleValue = require(4631) /* metro dependency 4631: MediaFormatTesters */;
|
|
if (moduleValue.isWebPlayerVideoUrl(a0.videoURI)) {
|
|
r0 = env0_8.WEB_FILE_IFRAME;
|
|
} else if (a0.portal == null) {
|
|
r0 = a0.embedURI == null ? env0_8.DEFAULT : a0.embedProviderName === 'TikTok' ? env0_8.TIKTOK_IFRAME : env0_8.DEFAULT;
|
|
} else {
|
|
moduleValue2 = require(9548) /* metro dependency 9548: NativePortalView */;
|
|
r0 = moduleValue2.isPortalExpired(a0.portal) ? a0.embedURI == null ? env0_8.DEFAULT : a0.embedProviderName === 'TikTok' ? env0_8.TIKTOK_IFRAME : env0_8.DEFAULT : env0_8.PORTAL;
|
|
}
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function isAnimatedImageSource(a0) { // fn#74529, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:13818, offset: 0x01d91410, size: 43 bytes, params: 2, frame: 13
|
|
let r0 = isGIFSource(a0) || isAnimatedWebpSource(a0);
|
|
r0 = !r0 ? isAnimatedAvifSource(a0) : r0;
|
|
return r0;
|
|
}
|
|
|
|
}
|
|
|
|
function getEmbedUrl({proxyURL, url, srcIsAnimated}) { // fn#74502, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:3310, offset: 0x01d8fcd3, size: 254 bytes, params: 2, frame: 17
|
|
var uRL;
|
|
var pathname;
|
|
var value3;
|
|
if (proxyURL != null) {
|
|
if (proxyURL !== '') {
|
|
uRL = new global.URL(proxyURL);
|
|
pathname = uRL.pathname;
|
|
value3 = pathname.toLowerCase().endsWith('.avif');
|
|
pathname = uRL.pathname;
|
|
if (srcIsAnimated) {
|
|
if (pathname.toLowerCase().endsWith('.webp')) {
|
|
uRL.searchParams.append('animated', 'true');
|
|
if (value3) {
|
|
uRL.searchParams.append('format', 'webp');
|
|
}
|
|
return uRL.toString();
|
|
}
|
|
if (value3) {
|
|
uRL.searchParams.append('animated', 'true');
|
|
if (value3) {
|
|
uRL.searchParams.append('format', 'webp');
|
|
}
|
|
return uRL.toString();
|
|
}
|
|
return proxyURL;
|
|
}
|
|
if (value3) {
|
|
uRL.searchParams.append('format', 'webp');
|
|
return uRL.toString();
|
|
}
|
|
return proxyURL;
|
|
}
|
|
}
|
|
return url;
|
|
}
|
|
|
|
function getYoutubeVideoIdFromURI(a0) { // fn#74526, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9732:12967, offset: 0x01d9126d, size: 151 bytes, params: 2, frame: 14
|
|
var r1;
|
|
var r0;
|
|
var object;
|
|
const value = a0.match(RegExp('^https:\\/\\/www\\.youtube\\.com\\/embed\\/([A-Za-z0-9_-]*)(\\?start=([0-9]+))?$',
|
|
''));
|
|
const value2 = null;
|
|
if (value2 == value) {
|
|
r0 = value2;
|
|
} else if (value2 == value[1]) {
|
|
r0 = value2;
|
|
} else if (value[1].length !== 11) {
|
|
r0 = value2;
|
|
} else {
|
|
if (value.length !== 4) {
|
|
r1 = {videoId: value[1]};
|
|
} else if (value2 != value[3]) {
|
|
object = {videoId: value[1]};
|
|
object.start = global.Number(value[3]);
|
|
r1 = object;
|
|
} else {
|
|
r1 = {videoId: value[1]};
|
|
}
|
|
r0 = r1;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
global.__d(_fun74490, 9546, [31, 27, 661, 4631, 1391, 4838, 4841, 1477, 8430, 8349, 4641, 8191, 4627, 1909, 8355,
|
|
8368, 1360, 8621, 676, 3856, 9547, 4496, 1244, 9548,
|
|
2]) /* metro module 9546, dependencies: [31, 27, 661, 4631, 1391, 4838, 4841, 1477, 8430, 8349, 4641, 8191, 4627, 1909, 8355, 8368, 1360, 8621, 676, 3856, 9547, 4496, 1244, 9548, 2] */;
|