718 lines
36 KiB
TypeScript
718 lines
36 KiB
TypeScript
/* Metro module 8872; source: utils/MaskedLinkUtils.tsx; dependencies: [8873, 1379, 1867, 8874, 4814, 3793, 1934, 661, 3855, 4647, 1244, 683, 8875, 8876, 8877, 8878, 3847, 10195, 10199, 6626, 10200, 10202, 2] */
|
|
function _fun69157(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#69157, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9057:6, offset: 0x01c6b26e, size: 279 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const blockedDomainStore = importDefault(8873) /* metro dependency 8873: BlockedDomainStore */;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const maskedLinkStore = importDefault(8874) /* metro dependency 8874: MaskedLinkStore */;
|
|
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
|
|
const relationshipStore = importDefault(3793) /* metro dependency 3793: RelationshipStore */;
|
|
const selectedChannelStore = importDefault(1934) /* metro dependency 1934: SelectedChannelStore */;
|
|
const constantsModule = require(661) /* metro dependency 661: Constants */;
|
|
const env0_10 = constantsModule.ChannelTypes;
|
|
const env0_11 = constantsModule.AnalyticEvents;
|
|
const env0_12 = constantsModule.GuildFeatures;
|
|
const env0_13 = constantsModule.MessageFlags;
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('utils/MaskedLinkUtils.tsx');
|
|
exports.isLinkTrusted = isLinkTrusted;
|
|
exports.handleClick = handleClick;
|
|
}
|
|
|
|
function isLinkTrusted(a0, a1) { // fn#69158, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9057:326, offset: 0x01c6b385, size: 122 bytes, params: 3, frame: 14
|
|
var isFriend;
|
|
var value;
|
|
const getChannel = ChannelStore.getChannel;
|
|
const getChannelId = SelectedChannelStore.getChannelId;
|
|
const value2 = Reflect.apply(getChannel, ChannelStore, [Reflect.apply(getChannelId, SelectedChannelStore, [])]);
|
|
let r1 = value2 != null && value2.type === ChannelTypes.DM;
|
|
if (r1) {
|
|
isFriend = RelationshipStore.isFriend;
|
|
value = value2.getRecipientId();
|
|
value = !Reflect.apply(isFriend, RelationshipStore, [value ?? '']);
|
|
r1 = value;
|
|
}
|
|
return !r1 && a0 === a1;
|
|
}
|
|
|
|
function handleClick(a0, a1) { // fn#69159, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9057:496, offset: 0x01c6b3ff, size: 2143 bytes, params: 3, frame: 53
|
|
var r1;
|
|
var guild_id;
|
|
var r39;
|
|
var r10;
|
|
var r11;
|
|
var r12;
|
|
var r15;
|
|
var r102;
|
|
var r27;
|
|
var r6;
|
|
var r13;
|
|
var r21;
|
|
var r212;
|
|
var r213;
|
|
var object2;
|
|
var decodeURI;
|
|
var error;
|
|
var encodeURI;
|
|
var value5;
|
|
var message;
|
|
var basicChannel;
|
|
var getGuild;
|
|
var guild;
|
|
var messageReference;
|
|
var message_id;
|
|
var channel_id;
|
|
var channel;
|
|
var value20;
|
|
var defaultImport2;
|
|
var track;
|
|
var URL_CLICKED;
|
|
var id;
|
|
var defaultImport3;
|
|
var closure;
|
|
const TRUSTED_URLS = (require(10199) /* metro dependency 10199: TrustedURLs */).TRUSTED_URLS;
|
|
var protocol;
|
|
var value30;
|
|
const trustDomain = (require(10202) /* metro dependency 10202: MaskedLinkActionCreators */).trustDomain;
|
|
const trustProtocol = (require(10202) /* metro dependency 10202: MaskedLinkActionCreators */).trustProtocol;
|
|
var defaultImport7;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
let value = a2;
|
|
const value2 = undefined;
|
|
const r2 = value !== value2 ? value : [];
|
|
var env0_2;
|
|
const trusted = a0.trusted;
|
|
const onClick = a0.onClick;
|
|
const env0_0 = a0.onConfirm;
|
|
const onCancel = a0.onCancel;
|
|
const shouldConfirm = a0.shouldConfirm;
|
|
const messageId = a0.messageId;
|
|
const channelId = a0.channelId;
|
|
const defaultImport = importDefault(3855) /* metro dependency 3855 */;
|
|
const value3 = defaultImport.sanitizeUrl(a0.href);
|
|
const value4 = null;
|
|
if (value4 == value3) {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
defaultImport7 = importDefault(4647) /* metro dependency 4647: AlertActionCreators */;
|
|
defaultImport7.show({title: intl.string(t.x87gan), body: intl.format(t['9rqRwl'], {url: a0.href}),
|
|
isDismissable: true, contextKey: a3});
|
|
} else {
|
|
try {
|
|
decodeURI = global.decodeURI;
|
|
decodeURI(value3);
|
|
r1 = value3;
|
|
} catch (error) {
|
|
encodeURI = global.encodeURI;
|
|
value5 = encodeURI(value3);
|
|
env0_2 = value5;
|
|
r1 = value5;
|
|
}
|
|
var value6 = false;
|
|
if (value4 == messageId) {
|
|
r6 = value6;
|
|
r11 = value4;
|
|
r12 = channelId;
|
|
r13 = value4;
|
|
r15 = messageId;
|
|
} else if (value4 == channelId) {
|
|
r6 = value6;
|
|
r11 = value4;
|
|
r12 = channelId;
|
|
r13 = value4;
|
|
r15 = messageId;
|
|
} else {
|
|
message = MessageStore.getMessage(channelId, messageId);
|
|
basicChannel = ChannelStore.getBasicChannel(channelId);
|
|
guild_id = value4 == basicChannel ? value2 : basicChannel.guild_id;
|
|
r39 = value4 != guild_id ? guild_id : value4;
|
|
guild = GuildStore.getGuild(r39);
|
|
if (value4 == message) {
|
|
guild_id = value2;
|
|
} else {
|
|
messageReference = message.messageReference;
|
|
guild_id = value4 == messageReference ? value2 : messageReference.guild_id;
|
|
}
|
|
r10 = value4 != guild_id && value4 != (value4 == message ? value2 : message.webhookId) && (value4 == message ? value2 : message.hasFlag(MessageFlags.IS_CROSSPOST)) && value4 != r39;
|
|
if (r10) {
|
|
if (value4 == message) {
|
|
guild_id = value2;
|
|
} else {
|
|
messageReference = message.messageReference;
|
|
guild_id = value4 == messageReference ? value2 : messageReference.guild_id;
|
|
}
|
|
if (value4 != guild_id) {
|
|
messageReference = message.messageReference;
|
|
message_id = messageReference.message_id;
|
|
messageReference = message.messageReference;
|
|
channel_id = messageReference.channel_id;
|
|
messageReference = message.messageReference;
|
|
r11 = messageReference.guild_id;
|
|
r12 = channel_id;
|
|
r15 = message_id;
|
|
} else {
|
|
r11 = r39;
|
|
r12 = channelId;
|
|
r15 = messageId;
|
|
}
|
|
} else {
|
|
r11 = r39;
|
|
r12 = channelId;
|
|
r15 = messageId;
|
|
}
|
|
r102 = (value4 == basicChannel ? value2 : basicChannel.type) === ChannelTypes.GUILD_ANNOUNCEMENT && (value4 == guild ? value2 : guild.features.has(GuildFeatures.COMMUNITY)) === true;
|
|
r27 = value4 == message ? value2 : message.hasFlag(MessageFlags.EPHEMERAL);
|
|
r27 = value4 != message && !(r27 === true);
|
|
r10 = r27 && (r10 || r102);
|
|
r6 = r10;
|
|
r13 = r39;
|
|
}
|
|
if (value4 != channelId) {
|
|
channel = ChannelStore.getChannel(channelId);
|
|
getGuild = GuildStore.getGuild;
|
|
r10 = value4 == channel ? value2 : channel.getGuildId();
|
|
value20 = Reflect.apply(getGuild, GuildStore, [r10]);
|
|
r10 = value4 != channel && value4 != value20 && value20.features.has(GuildFeatures.DISCOVERABLE);
|
|
if (r10) {
|
|
defaultImport2 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
track = defaultImport2.track;
|
|
URL_CLICKED = AnalyticEvents.URL_CLICKED;
|
|
object2 = {};
|
|
object2.url_domain = (require(8875) /* metro dependency 8875: MaskedLinkStoreMethodsAdditionalNative */).getHostname(r1);
|
|
id = value20.id;
|
|
object2.guild_id = id;
|
|
id = channel.id;
|
|
object2.channel_id = id;
|
|
Reflect.apply(track, defaultImport2, [URL_CLICKED, object2]);
|
|
}
|
|
if ((importDefault(8876) /* metro dependency 8876: isChangelogChannel */)(channelId)) {
|
|
defaultImport3 = importDefault(683) /* metro dependency 683: AnalyticsUtils */;
|
|
defaultImport3.track(AnalyticEvents.CHANGE_LOG_CTA_CLICKED, {cta_type: 'inline_link', target: r1});
|
|
}
|
|
}
|
|
(importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */).trackLinkClicked(r1);
|
|
if (value4 != onClick) {
|
|
if (onClick(a1)) {
|
|
return value2;
|
|
}
|
|
closure = onConfirm;
|
|
r21 = value4 != onCancel ? onCancel : function() {
|
|
};
|
|
if (value4 !== BlockedDomainStore.isBlockedDomain(r1)) {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
(importDefault(10195) /* metro dependency 10195: BlockedDomainModalActionCreatorsNative */).show(r1);
|
|
return value2;
|
|
}
|
|
r212 = (typeof trusted === 'function' ? trusted() : trusted) || TRUSTED_URLS.has(r1);
|
|
protocol = (require(8875) /* metro dependency 8875: MaskedLinkStoreMethodsAdditionalNative */).getProtocol(r1);
|
|
r213 = protocol === 'http:' || protocol === 'https:';
|
|
if (r213) {
|
|
if (r212) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
|
|
guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (MaskedLinkStore.isTrustedDomain(r1)) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
|
|
guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (r213) {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6,
|
|
contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
|
|
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true,
|
|
contextKey: a3});
|
|
}
|
|
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
|
|
guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6,
|
|
contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
|
|
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true,
|
|
contextKey: a3});
|
|
}
|
|
}
|
|
} else if (r213) {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
|
|
}
|
|
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
var value24 = (require(8878) /* metro dependency 8878: getOnClick */).default(r1, {skipExtensionCheck: value2,
|
|
analyticsLocations: r2, messageId: messageId});
|
|
if (value4 == value24) {
|
|
closure = onConfirm;
|
|
r21 = value4 != onCancel ? onCancel : function() {
|
|
};
|
|
if (value4 !== BlockedDomainStore.isBlockedDomain(r1)) {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
(importDefault(10195) /* metro dependency 10195: BlockedDomainModalActionCreatorsNative */).show(r1);
|
|
return value2;
|
|
}
|
|
r212 = (typeof trusted === 'function' ? trusted() : trusted) || TRUSTED_URLS.has(r1);
|
|
protocol = (require(8875) /* metro dependency 8875: MaskedLinkStoreMethodsAdditionalNative */).getProtocol(r1);
|
|
r213 = protocol === 'http:' || protocol === 'https:';
|
|
if (r213) {
|
|
if (r212) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
|
|
guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (MaskedLinkStore.isTrustedDomain(r1)) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
|
|
guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (r213) {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6,
|
|
contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
|
|
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true,
|
|
contextKey: a3});
|
|
}
|
|
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId,
|
|
guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6,
|
|
contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
|
|
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true,
|
|
contextKey: a3});
|
|
}
|
|
}
|
|
} else if (r213) {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
|
|
}
|
|
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
if (value24(a1)) {
|
|
return value2;
|
|
}
|
|
closure = onConfirm;
|
|
r21 = value4 != onCancel ? onCancel : function() {
|
|
};
|
|
if (value4 !== BlockedDomainStore.isBlockedDomain(r1)) {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
(importDefault(10195) /* metro dependency 10195: BlockedDomainModalActionCreatorsNative */).show(r1);
|
|
return value2;
|
|
}
|
|
r212 = (typeof trusted === 'function' ? trusted() : trusted) || TRUSTED_URLS.has(r1);
|
|
protocol = (require(8875) /* metro dependency 8875: MaskedLinkStoreMethodsAdditionalNative */).getProtocol(r1);
|
|
r213 = protocol === 'http:' || protocol === 'https:';
|
|
if (r213) {
|
|
if (r212) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (MaskedLinkStore.isTrustedDomain(r1)) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (r213) {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
|
|
}
|
|
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
|
|
}
|
|
}
|
|
} else if (r213) {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
|
|
}
|
|
} else if (MaskedLinkStore.isTrustedProtocol(r1)) {
|
|
if (value4 == a1) {
|
|
closure();
|
|
} else if (value4 == shouldConfirm) {
|
|
if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else if (shouldConfirm) {
|
|
closure();
|
|
} else if (r6) {
|
|
value = importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */;
|
|
value.trackAnnouncementMessageLinkClicked({messageId: r15, channelId: channelId, guildId: r13,
|
|
sourceChannelId: r12,
|
|
sourceGuildId: r11});
|
|
}
|
|
} else {
|
|
if (value4 != a1) {
|
|
a1.preventDefault();
|
|
}
|
|
if (r213) {
|
|
value30 = (require(6626) /* metro dependency 6626: MarkupLinkRule */).punycodeLink(r1);
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: value4 != value30 ? value30.displayTarget : r1,
|
|
|
|
|
|
|
|
trustUrl: trustDomain, onConfirm: closure, onCancel: r21, isProtocol: value6, contextKey: a3});
|
|
} else {
|
|
(importDefault(10200) /* metro dependency 10200: MaskedLinkModalActionCreatorsNative */).show({url: r1,
|
|
trustUrl: trustProtocol, onConfirm: closure, onCancel: r21, isProtocol: true, contextKey: a3});
|
|
}
|
|
}
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function handleClickOnConfirm() { // fn#69160, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9057:2085, owner: handleClick.onConfirm, offset: 0x01c6bc5e, size: 150 bytes, params: 1, frame: 13
|
|
var value2;
|
|
var value3;
|
|
if (env0_4) {
|
|
value2 = environment.__proto__;
|
|
(importDefault(8877) /* metro dependency 8877: LinkAnalyticsUtils */).trackAnnouncementMessageLinkClicked({messageId: env0_5,
|
|
|
|
channelId: channelId, guildId: env0_3, sourceChannelId: env0_6, sourceGuildId: guild_id});
|
|
}
|
|
if (onConfirm == null) {
|
|
value3 = environment.__proto__;
|
|
(importDefault(3847) /* metro dependency 3847: openURL */)(env0_2);
|
|
} else {
|
|
onConfirm();
|
|
}
|
|
}
|
|
|