This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,16 @@
// Metro module 7705 (f7706).
import { intl, t } from "../../intl/index.native";
import { ReportSubType } from "./MenuTypes";
import { ChannelTypes } from "../../_bundle/Module692";
import { DmSpamFilterV2 } from "../user_settings/UserSettings";
import * as _Module1306 from "../../_bundle/Module1306";
const r12 = {
getTitle: () => intl.string(t.vJOqMB),
getDisabledTitle: () => intl.string(t["B5ZvY+"]),
getDescription: () => intl.string(t["43UEUh"]),
eligibleReportSubtypes: [ReportSubType.SUB_SPAM],
eligibleChannelTypes: [ChannelTypes.DM, ChannelTypes.GROUP_DM],
onApply: () => DmSpamFilterV2.updateSetting(_Module1306.DmSpamFilterV2.NON_FRIENDS),
predicate: () => DmSpamFilterV2.getSetting() === _Module1306.DmSpamFilterV2.DISABLED
};
export default r12;
@@ -0,0 +1,44 @@
// Metro module 7704 (f7705).
import { useMemo } from "react";
import { SettingsUpsells } from "./MenuTypes";
import IarSettingsUpsellsConfigDmSpamFilter from "./IarSettingsUpsellsConfigDmSpamFilter";
import IarSettingsUpsellsConfigScFiltersSexualMedia from "./IarSettingsUpsellsConfigScFiltersSexualMedia";
import IarSettingsUpsellsConfigScFiltersGraphicMedia from "./IarSettingsUpsellsConfigScFiltersGraphicMedia";
import { isNotNullish } from "../../utils/GlobalUtils";
const r15 = {};
r15[SettingsUpsells.SAFETY_DM_SPAM_FILTER] = IarSettingsUpsellsConfigDmSpamFilter;
r15[SettingsUpsells.SAFETY_SC_FILTERS_SEXUAL_MEDIA] = IarSettingsUpsellsConfigScFiltersSexualMedia;
r15[SettingsUpsells.SAFETY_SC_FILTERS_GRAPHIC_MEDIA] = IarSettingsUpsellsConfigScFiltersGraphicMedia;
let c4839_3 = r15;
export { c4839_3 as SettingsUpsellsConfigRegistry };
export function useIarReportSettingsUpsells(a0) {
return useMemo(() => {
const r1 = a0 != null;
let r9 = null;
if (r1) {
let c26038_0 = a0;
const r10 = [];
let c26038_1 = r10;
Object.entries(c4839_3).forEach((item) => {
const [r23, r24] = item;
if (r24.eligibleReportSubtypes == null || r24.eligibleReportSubtypes.includes(c26038_0)) {
c26038_1.push(r23);
}
});
r9 = r10.length !== 0 ? r10 : null;
}
return r9;
}, [a0]);
}
export function useSettingsUpsellsConfigs(a0, a1) {
return useMemo(() => a0.map((item) => {
const r11 = c4839_3[item];
const { predicate, eligibleChannelTypes } = r11;
let r4 = predicate == null || (predicate == null ? void 0 : predicate()) === true;
const r14 = a1 == null || eligibleChannelTypes == null || eligibleChannelTypes.includes(a1);
if (r4) {
r4 = r14;
}
return r4 ? r11 : null;
}).filter(isNotNullish), [a0, a1]);
}
@@ -0,0 +1,32 @@
// Metro module 7707 (f7708).
import { getGoreContentSettingOrDefault, updateGoreContentSetting } from "../explicit_media_redaction/SensitiveMediaGoreRedactionSettingsUtils";
import { ExplicitContentRedaction } from "../../_bundle/Module1306";
import { intl, t } from "../../intl/index.native";
import { ReportSubType } from "./MenuTypes";
const r12 = {
getTitle: () => intl.string(t.RVX1zT),
getDisabledTitle: () => intl.string(t.SYkEBi),
getDescription: () => intl.string(t.aqlmp8),
eligibleReportSubtypes: [ReportSubType.SUB_GORE, ReportSubType.SUB_GLORIFYING_VIOLENCE],
onApply: () => {
const goreContentSettingOrDefault = getGoreContentSettingOrDefault();
const { goreContentGuilds, goreContentFriendDm, goreContentNonFriendDm } = goreContentSettingOrDefault;
const r14 = {};
if (goreContentGuilds === ExplicitContentRedaction.SHOW) {
r14.goreContentGuilds = ExplicitContentRedaction.BLUR;
}
if (goreContentFriendDm === ExplicitContentRedaction.SHOW) {
r14.goreContentFriendDm = ExplicitContentRedaction.BLUR;
}
if (goreContentNonFriendDm === ExplicitContentRedaction.SHOW) {
r14.goreContentNonFriendDm = ExplicitContentRedaction.BLUR;
}
return updateGoreContentSetting(r14);
},
predicate: () => {
const goreContentSettingOrDefault = getGoreContentSettingOrDefault();
const { goreContentGuilds, goreContentFriendDm, goreContentNonFriendDm } = goreContentSettingOrDefault;
return goreContentGuilds === ExplicitContentRedaction.SHOW || goreContentFriendDm === ExplicitContentRedaction.SHOW || goreContentNonFriendDm === ExplicitContentRedaction.SHOW;
}
};
export default r12;
@@ -0,0 +1,33 @@
// Metro module 7706 (f7707).
import { getExplicitContentSettingOrDefault, updateExplicitContentSetting } from "../explicit_media_redaction/SensitiveMediaExplicitRedactionSettingsUtils";
import { ExplicitContentRedaction } from "../../_bundle/Module1306";
import * as _index_native from "../../intl/index.native";
import { intl } from "../../intl/index.native";
import { ReportSubType } from "./MenuTypes";
const r12 = {
getTitle: () => intl.string(_index_native.t["Gtck/t"]),
getDisabledTitle: () => intl.string(_index_native.t.E6UmXa),
getDescription: () => intl.string(_index_native.t.jcRSp6),
eligibleReportSubtypes: [ReportSubType.SUB_CSAM, ReportSubType.SUB_LOLI, ReportSubType.SUB_NCP, ReportSubType.SUB_SEXUALLY_DEGRADING_CONTENT, ReportSubType.SUB_UNSOLICITED_PORN],
onApply: () => {
const explicitContentSettingOrDefault = getExplicitContentSettingOrDefault();
const { explicitContentGuilds, explicitContentFriendDm, explicitContentNonFriendDm } = explicitContentSettingOrDefault;
const r14 = {};
if (explicitContentGuilds === ExplicitContentRedaction.SHOW) {
r14.explicitContentGuilds = ExplicitContentRedaction.BLUR;
}
if (explicitContentFriendDm === ExplicitContentRedaction.SHOW) {
r14.explicitContentFriendDm = ExplicitContentRedaction.BLUR;
}
if (explicitContentNonFriendDm === ExplicitContentRedaction.SHOW) {
r14.explicitContentNonFriendDm = ExplicitContentRedaction.BLUR;
}
return updateExplicitContentSetting(r14);
},
predicate: () => {
const explicitContentSettingOrDefault = getExplicitContentSettingOrDefault();
const { explicitContentGuilds, explicitContentFriendDm, explicitContentNonFriendDm } = explicitContentSettingOrDefault;
return explicitContentGuilds === ExplicitContentRedaction.SHOW || explicitContentFriendDm === ExplicitContentRedaction.SHOW || explicitContentNonFriendDm === ExplicitContentRedaction.SHOW;
}
};
export default r12;
+2
View File
@@ -0,0 +1,2 @@
// Metro module 7701 (f7702).
export const REMEDIATION_ELEMENT_TYPES = ["ignore_users", "block_users", "leave_guild", "delete_message", "deauthorize_app", "share_with_parents"];
+45
View File
@@ -0,0 +1,45 @@
// Metro module 7693 (f7694).
const r6 = {
GUILD: "guild",
GUILD_DISCOVERY: "guild_discovery",
GUILD_DIRECTORY_ENTRY: "guild_directory_entry",
MESSAGE: "message",
STAGE_CHANNEL: "stage_channel",
GUILD_SCHEDULED_EVENT: "guild_scheduled_event",
FIRST_DM: "first_dm",
USER: "user",
APPLICATION: "application",
WIDGET: "widget"
};
const r22 = {
MESSAGE: "report_to_mod_message"
};
const r24 = {
MESSAGE: "message_urf",
USER: "user_urf",
GUILD: "guild_urf",
MEDIA_TAKEDOWN: "media_takedown"
};
const r29 = {
SUB_SPAM: "sub_spam",
SUB_UNSOLICITED_PORN: "sub_unsolicited_porn",
SUB_SEXUALLY_DEGRADING_CONTENT: "sub_sexually_degrading_content",
SUB_NCP: "sub_ncp",
SUB_LOLI: "sub_loli",
SUB_CSAM: "sub_csam",
SUB_GENERAL_HARASSMENT: "sub_general_harassment",
SUB_VULGAR_LANGUAGE: "sub_vulgar_language",
SUB_RACIST_OR_DICRIMINATORY_LANGUAGE_OR_IMAGERY: "sub_racist_or_discriminatory_language_or_imagery",
SUB_GORE: "sub_gore",
SUB_GLORIFYING_VIOLENCE: "sub_glorifying_violence"
};
const r41 = {
SAFETY_DM_SPAM_FILTER: "safety_dm_spam_filter",
SAFETY_SC_FILTERS_SEXUAL_MEDIA: "safety_sc_filters_sexual_media",
SAFETY_SC_FILTERS_GRAPHIC_MEDIA: "safety_sc_filters_graphic_media"
};
export { r6 as ReportNames };
export { r22 as ModeratorReportNames };
export { r24 as UnauthenticatedReportNames };
export { r29 as ReportSubType };
export { r41 as SettingsUpsells };
+392
View File
@@ -0,0 +1,392 @@
// Metro module 7692 (f7693).
import StageInstanceStore from "../stage_channels/StageInstanceStore";
import MessageRecord from "../../records/MessageRecord";
import UserRecord from "../../records/UserRecord";
import { AnalyticEvents } from "../../Constants";
import { ReportNames, UnauthenticatedReportNames, ModeratorReportNames } from "./MenuTypes";
import { showReportModal } from "./showReportModal.native";
import { submitHeadlessReport } from "./ReportUtils";
import { dangerouslyConstructGuildRecordFromUntypedObject } from "../../utils/GuildRecordUtils";
import AppAnalyticsUtils from "../app_analytics/AppAnalyticsUtils";
export function showReportModalForGuild(a0, a1) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: ReportNames.GUILD,
...{
guild_id: a0.id
}
});
showReportModal({
name: ReportNames.GUILD,
record: a0
}, {}, {
onSubmit: a1
});
}
export function showReportModalForGuildDirectoryEntry(a0, a1) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: ReportNames.GUILD_DIRECTORY_ENTRY,
...{
channel_id: a0.channelId,
guild_id: a0.guildId
}
});
showReportModal({
name: ReportNames.GUILD_DIRECTORY_ENTRY,
record: a0
}, {}, {
onSubmit: a1
});
}
export function showReportModalForMessage(a0, a1, a2) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: ReportNames.MESSAGE,
...{
message_id: a0.id,
channel_id: a0.channel_id
}
});
showReportModal({
name: ReportNames.MESSAGE,
record: a0
}, {}, {
onSubmit: a2
});
}
export function showStaffTestReportModalForMessage(a0, a1, a2) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: ReportNames.MESSAGE,
...{
message_id: a0.id,
channel_id: a0.channel_id
}
});
showReportModal({
name: ReportNames.MESSAGE,
record: a0
}, {
variant: "staff"
}, {
onSubmit: a2
});
}
export function showStaffTestReportModalForGuild(a0, a1, a2) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: ReportNames.GUILD,
...{
guild_id: a0.id
}
});
showReportModal({
name: ReportNames.GUILD,
record: a0
}, {
variant: "staff"
}, {
onSubmit: a2
});
}
export function showReportModalForStageChannel(a0, a1) {
const stageInstanceByChannel = StageInstanceStore.getStageInstanceByChannel(a0.id);
if (stageInstanceByChannel != null) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: ReportNames.STAGE_CHANNEL,
...{
stage_instance_id: stageInstanceByChannel.id,
channel_id: stageInstanceByChannel.channel_id,
guild_id: stageInstanceByChannel.guild_id
}
});
showReportModal({
name: ReportNames.STAGE_CHANNEL,
record: stageInstanceByChannel
}, {}, {
onSubmit: a1
});
}
}
export function showReportModalForGuildScheduledEvent(a0, a1) {
const GUILD_SCHEDULED_EVENT = ReportNames.GUILD_SCHEDULED_EVENT;
let channel_id = a0.channel_id;
if (channel_id == null) {
channel_id = void 0;
}
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: GUILD_SCHEDULED_EVENT,
...{
guild_scheduled_event_id: a0.id,
guild_id: a0.guild_id,
channel_id
}
});
showReportModal({
name: ReportNames.GUILD_SCHEDULED_EVENT,
record: a0
}, {}, {
onSubmit: a1
});
}
export function showReportModalForFirstDM(a0, a1) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: ReportNames.FIRST_DM,
...{
message_id: a0.id,
channel_id: a0.channel_id
}
});
showReportModal({
name: ReportNames.FIRST_DM,
record: a0
}, {}, {
onSubmit: a1,
isEligibleForFeedback: false
});
}
export async function submitHamReportForFirstDM(record, c26018_1) {
let c26018_4 = 0;
let c29847_0;
L12: {
try {
c29847_0 = c26018_1;
c26018_4 = 1;
await submitHeadlessReport({
name: ReportNames.FIRST_DM,
record
}, {
variant: "_first_dm_ham_v1"
});
const r55 = c29847_0;
if (r55 != null) {
r55();
}
c26018_4 = 0;
} catch ($e) {
let r26 = $e;
if (c26018_4 !== 0) {
while (true) {
try {
c26018_4 = 0;
break L12;
} catch ($e) {
r26 = $e;
if (c26018_4 === 0) {
break;
}
}
}
}
throw r26;
}
}
}
export function showReportModalForUser(a0, a1, a2, a3) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: ReportNames.USER,
...{
reported_user_id: a0.id
}
});
showReportModal({
name: ReportNames.USER,
record: a0,
contextualGuildId: a1
}, {}, {
onSubmit: a2,
appContext: a3
});
}
export function showStaffTestReportModalForUser(a0, a1, a2, a3) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: ReportNames.USER,
...{
reported_user_id: a0.id
}
});
showReportModal({
name: ReportNames.USER,
record: a0,
contextualGuildId: a1
}, {
variant: "staff"
}, {
onSubmit: a2,
isEligibleForFeedback: false,
appContext: a3
});
}
export function showUnauthenticatedReportModalForUser(a0, a1) {
const userRecord = new UserRecord({});
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: UnauthenticatedReportNames.USER,
...{
reported_user_id: userRecord.id
}
});
showReportModal({
name: UnauthenticatedReportNames.USER,
record: userRecord
}, {}, {
onClose: a1,
isEligibleForFeedback: false,
isAuthenticated: false,
emailToken: a0
});
}
export function showUnauthenticatedReportModalForGuild(a0, a1) {
const record3 = dangerouslyConstructGuildRecordFromUntypedObject({});
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: UnauthenticatedReportNames.GUILD,
...{
guild_id: record3.id
}
});
showReportModal({
name: UnauthenticatedReportNames.GUILD,
record: record3
}, {}, {
onClose: a1,
isEligibleForFeedback: false,
isAuthenticated: false,
emailToken: a0
});
}
export function showUnauthenticatedReportModalForTida(a0, a1) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: UnauthenticatedReportNames.MEDIA_TAKEDOWN,
...{}
});
showReportModal({
name: UnauthenticatedReportNames.MEDIA_TAKEDOWN
}, {}, {
onClose: a1,
isEligibleForFeedback: false,
isAuthenticated: false,
emailToken: a0
});
}
export function showUnauthenticatedReportModalForMessage(a0, a1) {
const messageRecord = new MessageRecord({});
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: UnauthenticatedReportNames.MESSAGE,
...{
message_id: void 0,
channel_id: void 0
}
});
showReportModal({
name: UnauthenticatedReportNames.MESSAGE,
record: messageRecord
}, {}, {
onClose: a1,
isEligibleForFeedback: false,
isAuthenticated: false,
emailToken: a0
});
}
export async function submitReportForInappropriateConversationSafetyAlert(record2, c26019_1, c26019_2) {
let c26019_5 = 0;
let c29848_0, c29848_1;
L12: {
try {
c29848_0 = c26019_1;
c29848_1 = c26019_2;
c26019_5 = 1;
await submitHeadlessReport({
name: ReportNames.MESSAGE,
record: record2
}, {
variant: "safety_alerts_headless_v1"
});
const r56 = c29848_0;
if (r56 != null) {
r56();
}
c26019_5 = 0;
} catch ($e) {
let r26 = $e;
if (c26019_5 !== 0) {
while (true) {
try {
c26019_5 = 0;
const r64 = c29848_1;
if (r64 == null) {
break L12;
}
r64();
break L12;
} catch ($e) {
r26 = $e;
if (c26019_5 === 0) {
break;
}
}
}
}
throw r26;
}
}
}
export function showReportModalForInappropriateConversationSafetyAlert(a0, a1) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: ReportNames.MESSAGE,
...{
message_id: a0.id,
channel_id: a0.channel_id
}
});
showReportModal({
name: ReportNames.MESSAGE,
record: a0
}, {
variant: "safety_alerts_v1"
}, {
onSubmit: a1
});
}
export function showReportModalForWidget(a0, a1, a2, a3) {
let id = a1.id;
if (id == null) {
id = "";
}
showReportModal({
name: ReportNames.WIDGET,
widget_id: id,
user_id: a0,
widget: a1
}, {}, {
onSubmit: a2,
appContext: a3
});
}
export function showReportModalForApp({ application, entrypoint, contextualGuildId, contextualChannelId, onSubmit, appContext }) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.REPORT_APPLICATION_CLICKED, {
application_id: application.id,
location: entrypoint
});
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MODAL_OPEN, {
report_type: ReportNames.APPLICATION,
...{
application_id: application.id,
guild_id: contextualGuildId,
channel_id: contextualChannelId
}
});
showReportModal({
name: ReportNames.APPLICATION,
record: application,
contextualGuildId,
contextualChannelId,
entrypoint
}, {}, {
onSubmit,
appContext
});
}
export function showReportToModMessageModal(a0, a1) {
showReportModal({
name: ModeratorReportNames.MESSAGE,
record: a0
}, {}, {
onSubmit: a1,
isEligibleForFeedback: false
});
}
+469
View File
@@ -0,0 +1,469 @@
// Metro module 7696 (f7697).
import { useCallback } from "react";
import DevSettingsStore from "../devtools/dev_settings/DevSettingsStore";
import { AnalyticEvents, Endpoints } from "../../Constants";
import { SafetyToastType } from "../safety_common/Constants";
import { HTTP } from "../../_bundle/sendRequest";
import { ReportMenuTypeSets } from "../../_bundle/Module7695";
import SafetyToastsActionCreators_native from "../safety_common/SafetyToastsActionCreators.native";
import Dispatcher from "../../Dispatcher";
import Module38 from "../../_bundle/Module38";
import { UnauthenticatedReportNames, ReportNames, ModeratorReportNames } from "./MenuTypes";
import AppAnalyticsUtils from "../app_analytics/AppAnalyticsUtils";
import { HermesBuiltin } from "../../_hermes/prelude";
let getUnauthenticatedReportNameSafely, getReportNameSafely, getModeratorReportNameSafely, genSubmitData;
const getReportMenu = async function getReportMenu(c26021_0, c26021_1) {
let c29850_0 = await HTTP.get({
url: Endpoints.GET_REPORT_MENU(getReportNameSafely(c26021_0)),
query: c26021_1?.variant != null ? {
variant: c26021_1.variant
} : void 0,
rejectWithError: false
});
const body4 = c29850_0.body;
let body = body4;
if (body4 == null) {
body = JSON.parse(c29850_0.text);
}
return body;
};
getUnauthenticatedReportNameSafely = function getUnauthenticatedReportNameSafely(a0) {
const name2 = a0.name;
Module38(Object.values(UnauthenticatedReportNames).includes(name2), `Invalid report type ${a0.name}`);
return name2;
};
getReportNameSafely = function getReportNameSafely(a0) {
const name2 = a0.name;
Module38(Object.values(ReportNames).includes(name2), `Invalid report type ${a0.name}`);
return name2;
};
getModeratorReportNameSafely = function getModeratorReportNameSafely(a0) {
const name2 = a0.name;
Module38(Object.values(ModeratorReportNames).includes(name2), `Invalid report type ${a0.name}`);
return name2;
};
genSubmitData = function genSubmitData(a0, a1, a2, a3) {
let language = a0.language;
if (language == null) {
language = "en";
}
const r5 = {
channel_id: void 0,
message_id: void 0,
stage_instance_id: void 0,
guild_id: void 0,
guild_scheduled_event_id: void 0,
user_id: void 0,
email_token: void 0,
application_id: void 0,
entrypoint: void 0,
widget_id: void 0
};
const r6 = {
version: a0.version,
variant: a0.variant,
language,
breadcrumbs: a2.map((item) => item.nodeRef),
elements: a2.reduce((acc, item) => {
const multiSelect = item.multiSelect;
let textInput2 = item.textInput;
const r11 = {
...acc
};
let r12 = multiSelect != null;
if (r12) {
const r3 = {};
r3[multiSelect.name] = Object.keys(multiSelect.state);
r12 = r3;
}
HermesBuiltin.copyDataProperties(r11, r12);
const r20 = Object;
const r22 = Object;
if (textInput2 == null) {
textInput2 = {};
}
HermesBuiltin.copyDataProperties(r11, r20.fromEntries(r22.entries(textInput2).map((item) => {
const [r5, r14] = item;
return [r5, r14.value];
})));
return r11;
}, {})
};
if (a1.name !== ReportNames.MESSAGE && a1.name !== ReportNames.FIRST_DM) {
if (a1.name !== ReportNames.GUILD && a1.name !== ReportNames.GUILD_DISCOVERY) {
if (a1.name === ReportNames.GUILD_DIRECTORY_ENTRY) {
const record3 = a1.record;
return {
...r6,
...r5,
name: a1.name,
channel_id: record3.channelId,
guild_id: record3.guildId
};
}
if (a1.name === ReportNames.STAGE_CHANNEL) {
const record2 = a1.record;
return {
...r6,
...r5,
name: a1.name,
channel_id: record2.channel_id,
guild_id: record2.guild_id,
stage_instance_id: record2.id
};
}
if (a1.name === ReportNames.GUILD_SCHEDULED_EVENT) {
const record = a1.record;
return {
...r6,
...r5,
name: a1.name,
guild_id: record.guild_id,
guild_scheduled_event_id: record.id
};
}
return a1.name === ReportNames.USER ? {
...r6,
...r5,
name: a1.name,
user_id: a1.record.id,
guild_id: a1.contextualGuildId
} : a1.name === UnauthenticatedReportNames.USER ? {
...r6,
...r5,
name: a1.name,
user_id: a1.record.id,
guild_id: a1.contextualGuildId,
email_token: a3
} : a1.name === UnauthenticatedReportNames.MESSAGE ? {
...r6,
...r5,
name: a1.name,
message_id: a1.record.id,
email_token: a3
} : a1.name === UnauthenticatedReportNames.GUILD ? {
...r6,
...r5,
name: a1.name,
guild_id: a1.record.id,
email_token: a3
} : a1.name === ReportNames.APPLICATION ? {
...r6,
...r5,
name: a1.name,
application_id: a1.record.id,
guild_id: a1.contextualGuildId,
channel_id: a1.contextualChannelId,
entrypoint: a1.entrypoint
} : a1.name === ReportNames.WIDGET ? {
...r6,
...r5,
name: a1.name,
user_id: a1.user_id,
widget_id: a1.widget_id
} : a1.name === UnauthenticatedReportNames.MEDIA_TAKEDOWN ? {
...r6,
...r5,
name: a1.name,
email_token: a3
} : null;
}
return {
...r6,
...r5,
name: a1.name,
guild_id: a1.record.id
};
}
const record4 = a1.record;
return {
...r6,
...r5,
name: a1.name,
channel_id: record4.channel_id,
message_id: record4.id
};
};
const r39 = {
SETTINGS_UPSELLS_VIEWED: "SETTINGS_UPSELLS_VIEWED",
SETTINGS_UPSELLS_APPLY_CLICKED: "SETTINGS_UPSELLS_APPLY_CLICKED",
SETTINGS_UPSELLS_GO_TO_SETTINGS_LINK_CLICKED: "SETTINGS_UPSELLS_GO_TO_SETTINGS_LINK_CLICKED"
};
export { getReportMenu };
export async function getReportMenuForModeratorReport(c26022_0, c26022_1) {
let c29851_0 = await HTTP.get({
url: Endpoints.GET_REPORT_MENU(getModeratorReportNameSafely(c26022_0)),
query: c26022_1?.variant != null ? {
variant: c26022_1.variant
} : void 0,
rejectWithError: false
});
const body4 = c29851_0.body;
let body2 = body4;
if (body4 == null) {
body2 = JSON.parse(c29851_0.text);
}
return body2;
}
export async function getUnauthenticatedReportMenu(c26023_0, c26023_1) {
let c29852_0 = await HTTP.get({
url: Endpoints.GET_UNAUTHENTICATED_REPORT_MENU(getUnauthenticatedReportNameSafely(c26023_0)),
query: c26023_1?.variant != null ? {
variant: c26023_1.variant
} : void 0,
rejectWithError: false
});
const body4 = c29852_0.body;
let body3 = body4;
if (body4 == null) {
body3 = JSON.parse(c29852_0.text);
}
return body3;
}
export async function submitHeadlessReport(c26024_0, c26024_1) {
let c26024_3;
c26024_3 = void 0;
let c29853_0 = c26024_0;
let c29853_1 = getReportNameSafely(c26024_0);
let c29853_2 = await getReportMenu(c26024_0, c26024_1);
await HTTP.post({
url: Endpoints.SUBMIT_REPORT_MENU(c29853_1),
body: (0, genSubmitData)(c29853_2, c29853_0, [{
nodeRef: c29853_2.root_node_id,
destination: ["", c29853_2.success_node_id]
}]),
rejectWithError: false
});
}
export function submitReport(a0, a1, a2) {
let r52;
if (DevSettingsStore.get("iar_skip_api_report_submit")) {
r52 = Promise.resolve();
} else if (ReportMenuTypeSets.REPORT_TO_MOD.has(a1.name)) {
const { version, variant } = a0;
let language = a0.language;
if (language == null) {
language = "en";
}
const r56 = {
version,
variant,
language,
breadcrumbs: a2.map((item) => item.nodeRef),
elements: a2.reduce((acc, item) => {
const multiSelect = item.multiSelect;
let textInput2 = item.textInput;
const r11 = {
...acc
};
let r12 = multiSelect != null;
if (r12) {
const r3 = {};
r3[multiSelect.name] = Object.keys(multiSelect.state);
r12 = r3;
}
HermesBuiltin.copyDataProperties(r11, r12);
const r20 = Object;
const r22 = Object;
if (textInput2 == null) {
textInput2 = {};
}
HermesBuiltin.copyDataProperties(r11, r20.fromEntries(r22.entries(textInput2).map((item) => {
const [r5, r14] = item;
return [r5, r14.value];
})));
return r11;
}, {})
};
const name3 = a1.name;
const MESSAGE = ModeratorReportNames.MESSAGE;
let body4 = null;
if (name3 === MESSAGE) {
const r71 = {
channel_id: void 0,
message_id: void 0,
guild_id: void 0
};
const record = a1.record;
body4 = {
...r56,
...r71,
name: a1.name,
channel_id: record.channel_id,
message_id: record.id
};
}
let c15966_0 = body4;
Module38(ReportMenuTypeSets.REPORT_TO_MOD.has(a1.name), `Invalid report type ${a1.name}`);
if (a1.name !== ModeratorReportNames.MESSAGE) {
throw new Error(`Invalid report type ${a1.name}`);
}
r52 = HTTP.post({
url: Endpoints.SUBMIT_MODERATOR_MESSAGE_REPORT(a1.record.channel_id, a1.record.id),
body: body4,
rejectWithError: false
}).then((result) => {
SafetyToastsActionCreators_native.showSuccessToast(SafetyToastType.REPORT_TO_MOD_SUCCESS);
if (c15966_0?.channel_id != null && c15966_0?.message_id != null) {
Dispatcher.dispatch({
type: "REPORT_TO_MOD_REPORT_MESSAGE_SUCCESS",
channelId: c15966_0.channel_id,
messageId: c15966_0.message_id
});
}
return result;
});
} else {
const name2 = a1.name;
Module38(Object.values(ReportNames).includes(name2), `Invalid report type ${a1.name}`);
r52 = HTTP.post({
url: Endpoints.SUBMIT_REPORT_MENU(name2),
body: genSubmitData(a0, a1, a2),
rejectWithError: false
});
}
return r52;
}
export function submitUnauthenticatedReport(a0, a1, a2, a3) {
if (DevSettingsStore.get("iar_skip_api_report_submit")) {
return Promise.resolve();
}
const name2 = a1.name;
Module38(Object.values(UnauthenticatedReportNames).includes(name2), `Invalid report type ${a1.name}`);
return HTTP.post({
url: Endpoints.SUBMIT_UNAUTHENTICATED_REPORT_MENU(name2),
body: genSubmitData(a0, a1, a2, a3),
rejectWithError: true
});
}
export function sendUnauthenticatedReportPincode(a0, a1) {
let length;
const r18 = Endpoints.SEND_UNAUTHENTICATED_REPORT_PINCODE(a0);
const r25 = 0 < a1.length;
let r0 = 5381;
let r1 = 0;
let r3 = 5381;
if (r25) {
do {
r0 = (r0 << 5) + r0 + a1.charCodeAt(r1) | 0;
r1 = r1 + 1;
length = a1.length;
r3 = r0;
} while (r1 < length);
}
return HTTP.post({
url: `${r18}?b=${(r3 >>> 0).toString(36)}`,
body: {
name: a0,
email: a1
},
rejectWithError: false,
failImmediatelyWhenRateLimited: true
});
}
export async function verifyUnauthenticatedReport(name, email, code) {
return (await HTTP.post({
url: Endpoints.VERIFY_UNAUTHENTICATED_REPORT(name),
body: {
name,
email,
code
},
rejectWithError: false
})).body;
}
export async function getDsaExperiment() {
return await HTTP.get({
url: Endpoints.DSA_EXPERIMENT_UNAUTHENTICATED,
rejectWithError: false
});
}
export async function fetchUrfCapabilities() {
return await HTTP.get({
url: Endpoints.DSA_CAPABILITIES,
rejectWithError: false
});
}
export async function submitReportSecondLook(token) {
return (await HTTP.post({
url: Endpoints.SUBMIT_REPORT_SECOND_LOOK,
body: {
token
},
rejectWithError: false
})).body;
}
export { getUnauthenticatedReportNameSafely };
export { getReportNameSafely };
export { getModeratorReportNameSafely };
export function getModeratorReportEndpointSafely(a0) {
Module38(ReportMenuTypeSets.REPORT_TO_MOD.has(a0.name), `Invalid report type ${a0.name}`);
if (a0.name === ModeratorReportNames.MESSAGE) {
return Endpoints.SUBMIT_MODERATOR_MESSAGE_REPORT(a0.record.channel_id, a0.record.id);
}
throw new Error(`Invalid report type ${a0.name}`);
}
export function trackCloseReportModalAnalytics(a0, a1, a2) {
let guildId;
const IAR_MODAL_CLOSE = AnalyticEvents.IAR_MODAL_CLOSE;
const r13 = {
report_type: a0.name,
report_id: a2,
navigation_history: a1,
message_id: a0.name !== ReportNames.MESSAGE ? a0.name === ReportNames.FIRST_DM ? a0.record.id : void 0 : a0.record.id,
stage_instance_id: a0.name === ReportNames.STAGE_CHANNEL ? a0.record.id : void 0,
guild_scheduled_event_id: null,
guild_id: null,
channel_id: null,
application_id: null
};
const guild_scheduled_event_id = a0.name === ReportNames.GUILD_SCHEDULED_EVENT ? a0.record.id : void 0;
L16: {
r13.guild_scheduled_event_id = guild_scheduled_event_id;
if (a0.name !== ReportNames.GUILD && a0.name !== ReportNames.GUILD_DISCOVERY) {
if (a0.name === ReportNames.GUILD_DIRECTORY_ENTRY) {
guildId = a0.record.guildId;
break L16;
}
const name2 = a0.name;
const GUILD_SCHEDULED_EVENT = ReportNames.GUILD_SCHEDULED_EVENT;
guildId = void 0;
if (name2 !== GUILD_SCHEDULED_EVENT) {
break L16;
}
guildId = a0.record.guild_id;
} else {
guildId = a0.record.id;
}
}
r13.guild_id = guildId;
r13.channel_id = a0.name === ReportNames.GUILD_SCHEDULED_EVENT ? a0.record.channel_id : a0.name === ReportNames.GUILD_DIRECTORY_ENTRY ? a0.record.channelId : void 0;
r13.application_id = a0.name === ReportNames.APPLICATION ? a0.record.id : void 0;
AppAnalyticsUtils.trackWithMetadata(IAR_MODAL_CLOSE, r13);
}
export function showInAppReportsFeedbackModal(a0, a1) {
Dispatcher.dispatch({
type: "IN_APP_REPORTS_SHOW_FEEDBACK",
reportId: a1,
reportType: a0.name
});
}
export function areRequiredElementsUnfilled({ freeTextElements, dropdownElements, countrySelectElement, radioGroupElements, multiSelectElement, contentUrlInputElement }, { textInput, multiSelect }) {
const r19 = freeTextElements.some((freeTextElement) => freeTextElement.should_submit_data === true && ((textInput == null ? void 0 : textInput[freeTextElement.name]) == null || (textInput == null ? void 0 : textInput[freeTextElement.name].value) === "" || !(textInput == null ? void 0 : textInput[freeTextElement.name]?.isValid))) || dropdownElements.some((dropdownElement) => dropdownElement.should_submit_data === true && ((textInput == null ? void 0 : textInput[dropdownElement.name]) == null || (textInput == null ? void 0 : textInput[dropdownElement.name].value) === "")) || countrySelectElement?.should_submit_data === true && ((textInput == null ? void 0 : textInput[countrySelectElement.name]) == null || (textInput == null ? void 0 : textInput[countrySelectElement.name].value) === "") || radioGroupElements.some((radioGroupElement) => radioGroupElement.should_submit_data === true && ((textInput == null ? void 0 : textInput[radioGroupElement.name]) == null || (textInput == null ? void 0 : textInput[radioGroupElement.name].value) === "")) || multiSelectElement?.should_submit_data === true && (multiSelect == null || Object.keys(multiSelect).length === 0) || contentUrlInputElement?.should_submit_data === true && ((textInput == null ? void 0 : textInput[contentUrlInputElement.name]) == null || (textInput == null ? void 0 : textInput[contentUrlInputElement.name].value) === "" || !(textInput == null ? void 0 : textInput[contentUrlInputElement.name]?.isValid));
return r19;
}
export { r39 as TrackIarSettingsUpsellsActionType };
export function useTrackSettingsUpsellsAction(a0, a1, a2) {
let c15968_0 = a0;
const report_subtype = a1;
const report_id = a2;
return useCallback((settings_upsells_type) => (a0) => {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_SETTINGS_UPSELLS_ACTION, {
report_id,
report_type: c15968_0.name,
report_subtype,
settings_upsells_type,
action: a0
});
}, [a2, a0, a1]);
}
@@ -0,0 +1,32 @@
// Metro module 11966 (f11967).
import { createExperiment } from "../experiments/index";
const experiment = createExperiment({
kind: "user",
id: "2023-09_iar_user_reporting",
label: "Safety Experience IAR User Reporting",
defaultConfig: {
enabled: false
},
treatments: [{
id: 1,
label: "Enabled",
config: {
enabled: true
}
}]
});
export default experiment;
export function useIsIarUserReportingEnabled(a0) {
return experiment.useExperiment({
location: a0
}, {
autoTrackExposure: true
}).enabled;
}
export function isIarUserReportingEnabled(a0) {
return experiment.getCurrentConfig({
location: a0
}, {
autoTrackExposure: true
}).enabled;
}
@@ -0,0 +1,24 @@
// Metro module 16181 (f16182).
import * as _index_native from "../../intl/index.native";
import { intl } from "../../intl/index.native";
let c11599_2 = {
COULD_NOT_FIND: "I couldn't find what I was looking for",
CONFUSING_LANGUAGE: "I found the language confusing",
OTHER: "Other"
};
export default function getInAppReportsFeedbackOptions() {
return [{
label: intl.string(_index_native.t.cigGCe),
code: 2,
value: c11599_2.COULD_NOT_FIND
}, {
label: intl.string(_index_native.t.ZyXA0q),
code: 3,
value: c11599_2.CONFUSING_LANGUAGE
}, {
label: intl.string(_index_native.t.emlT91),
code: 1,
value: c11599_2.OTHER
}];
};
export { c11599_2 as InAppReportsFeedbackReasonOption };
@@ -0,0 +1,57 @@
// Metro module 11967 (f11968).
import ApplicationStore from "../../applications/ApplicationStore";
import { ActionSheet } from "../../../design/components/Sheet/native/ActionSheet.native";
import { Text } from "../../../design/components/Text/native/Text";
import { intl, t } from "../../../intl/index.native";
import { ActionSheetRow } from "../../../design/components/Sheet/native/ActionSheetRow.native";
import ActionSheetActionCreators from "../../action_sheet/native/ActionSheetActionCreators";
import { showReportModalForUser, showReportModalForApp } from "../ReportModals";
import { useStateFromStores } from "../../../_bundle/Module589";
import { useApplication } from "../../applications/ApplicationActionCreators";
let c8211_6, ReportAppBehavior;
const ReportAppProfile = function ReportAppProfile(props) {
const { user, contextualGuildId, onSubmit, appContext } = props;
return <ActionSheetRow label={<Text variant="heading-md/semibold">
{intl.string(t.eyEkG1)}
</Text>} subLabel={<Text variant="text-xs/medium">
{intl.string(t.ptItsj)}
</Text>} onPress={() => {
ActionSheetActionCreators.hideActionSheet(c8211_6);
showReportModalForUser(user, contextualGuildId, onSubmit, appContext);
}} arrow />;
};
ReportAppBehavior = function ReportAppBehavior(props) {
const { user: user2, entrypoint, contextualGuildId: contextualGuildId2, contextualChannelId, onSubmit: onSubmit2, appContext: appContext2 } = props;
const data = useApplication(useStateFromStores([ApplicationStore], () => ApplicationStore.getAppIdForBotUserId(user2.id))).data;
return <ActionSheetRow label={<Text variant="heading-md/semibold">
{intl.string(t.atP0yX)}
</Text>} subLabel={<Text variant="text-xs/medium">
{intl.string(t.UGg603)}
</Text>} onPress={() => {
if (data != null) {
ActionSheetActionCreators.hideActionSheet(c8211_6);
showReportModalForApp({
application: data,
entrypoint,
contextualGuildId: contextualGuildId2,
contextualChannelId,
onSubmit: onSubmit2,
appContext: appContext2
});
}
}} arrow disabled={data == null} />;
};
c8211_6 = "BotReportChooser";
export default function BotReportChooser(props) {
return <ActionSheet header={<Text style={{
textAlign: "center"
}} variant="redesign/heading-18/bold">
{intl.string(t.Bd10bR)}
</Text>}>
<ActionSheetRow.Group hasIcons={false}>
<ReportAppProfile {...props} />
<ReportAppBehavior {...props} />
</ActionSheetRow.Group>
</ActionSheet>;
};
export const BOT_REPORT_CHOOSER_KEY = "BotReportChooser";
@@ -0,0 +1,13 @@
// Metro module 7702 (f7703).
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { Icon } from "../../../../design/void/native";
import Module7703 from "../../../../_bundle/Module7703";
const useStyles = createStyles({
tintColor: {
tintColor: Module712.colors.INTERACTIVE_TEXT_DEFAULT
}
});
export default function Arrow() {
return <Icon source={Module7703} size={Icon.Sizes.MEDIUM} style={useStyles().tintColor} />;
};
@@ -0,0 +1,121 @@
// Metro module 7697 (f7698).
import { useState, useMemo } from "react";
import { IN_APP_REPORTS_NODE } from "./InAppReportsConstants";
import { HeaderActionButton } from "../../../../design/components/Navigator/native/HeaderActionButton.native";
import Module7699 from "../../../../_bundle/Module7699";
import { intl, t } from "../../../../intl/index.native";
import NodeView from "./NodeView";
import useMountEffect from "../../../../hooks/useMountEffect";
import { getOrFetchLinkedUsers } from "../../../parent_tools/FamilyCenterUtils";
import { trackCloseReportModalAnalytics, showInAppReportsFeedbackModal, submitReport } from "../../ReportUtils";
import { hideReportModal } from "../../showReportModal.native";
import { Navigator } from "../../../../design/components/Navigator/native/Navigator.native";
function $mk105460() {
return (a0) => a0();
}
export default function InAppReportModal(props) {
let nodes, root_node_id, success_node_id, fail_node_id, state, setState, state2, setState2, state3, setState3, state4, setState4, closeModal2;
const { reportType, menu, afterSubmit, isEligibleForFeedback } = props;
nodes = void 0;
root_node_id = void 0;
success_node_id = void 0;
fail_node_id = void 0;
state = void 0;
setState = void 0;
state2 = void 0;
setState2 = void 0;
state3 = void 0;
setState3 = void 0;
state4 = void 0;
setState4 = void 0;
const addOnCloseCallback2 = function addOnCloseCallback(c26031_0) {
setState4((prevState4) => [...prevState4, c26031_0]);
};
closeModal2 = function closeModal() {
trackCloseReportModalAnalytics(reportType, state3, state);
hideReportModal();
state4.forEach($mk105460());
if (isEligibleForFeedback) {
showInAppReportsFeedbackModal(reportType, state);
}
};
nodes = menu.nodes;
root_node_id = menu.root_node_id;
success_node_id = menu.success_node_id;
fail_node_id = menu.fail_node_id;
[state, setState] = useState(void 0);
[state2, setState2] = useState(void 0);
[state3, setState3] = useState([]);
[state4, setState4] = useState([]);
useMountEffect(() => {
getOrFetchLinkedUsers();
});
const memo = useMemo(() => {
let _onSubmit2 = function _onSubmit() {
const r9 = async (c31440_0) => {
let c31440_2;
c31440_2 = void 0;
let c31970_0 = c31440_0;
let c31970_1 = await submitReport(menu, reportType, c31440_0);
let c31970_2 = c31970_1 == null ? void 0 : c31970_1.body?.report_id;
if (c31970_2 != null) {
(0, setState)(c31970_2);
}
let c31970_3 = c31970_0[c31970_0.length - 1];
(0, setState2)(nodes[c31970_3.nodeRef].report_type);
if (afterSubmit != null) {
afterSubmit();
}
};
_onSubmit2 = r9;
return r9.apply(this, arguments);
};
const node = nodes[root_node_id];
if (node == null) {
trackCloseReportModalAnalytics(reportType, state3, state);
hideReportModal();
state4.forEach($mk105460());
if (isEligibleForFeedback) {
showInAppReportsFeedbackModal(reportType, state);
}
return {};
}
let onNavigate2;
const params = {
node,
history: []
};
const nodes2 = nodes;
const reportType2 = reportType;
const state5 = state2;
const success_node_id2 = success_node_id;
const fail_node_id2 = fail_node_id;
const state6 = state;
const closeModal3 = closeModal2;
const addOnCloseCallback3 = addOnCloseCallback2;
const onSubmit2 = function onSubmit(a0) {
return _onSubmit2.apply(this, arguments);
};
onNavigate2 = function onNavigate(c29854_0) {
setState3((prevState3) => [...prevState3, c29854_0]);
};
const screens = {};
screens[IN_APP_REPORTS_NODE] = {
headerRight: () => <HeaderActionButton source={Module7699} onPress={closeModal3} accessibilityLabel={intl.string(t.cpT0Cq)} />,
headerTitle: () => null,
fullscreen: true,
render: (a0) => {
return <NodeView {...a0} nodeMap={nodes2} reportType={reportType2} reportSubType={state5} successNodeId={success_node_id2} failNodeId={fail_node_id2} onSubmit={(event) => onSubmit2([...a0.history, event])} closeModal={closeModal3} addOnCloseCallback={addOnCloseCallback3} reportId={state6} onNavigate={onNavigate2} />;
}
};
return {
initialStack: [{
name: IN_APP_REPORTS_NODE,
params
}],
screens
};
}, [closeModal2, state]);
const { initialStack, screens } = memo;
return initialStack == null ? null : screens == null ? null : <Navigator screens={screens} initialRouteStack={initialStack} headerBackTitle={intl.string(t["13/7kX"])} />;
};
@@ -0,0 +1,36 @@
// Metro module 12406 (f12407).
import { useMemo, useCallback } from "react";
import ChannelStore from "../../../../stores/ChannelStore";
import RelationshipStore from "../../../../stores/RelationshipStore";
import { AnalyticEvents } from "../../../../Constants";
import { useStateFromStores } from "../../../../_bundle/Module589";
import NicknameUtils from "../../../../utils/NicknameUtils";
import AppAnalyticsUtils from "../../../app_analytics/AppAnalyticsUtils";
import RelationshipActionCreators from "../../../../actions/RelationshipActionCreators";
import SafetyToastsActionCreators_native from "../../../safety_common/SafetyToastsActionCreators.native";
import InAppReportsUpsellsTableRow from "./InAppReportsUpsellsTableRow";
import { intl, t } from "../../../../intl/index.native";
import { DenyIcon } from "../../../../design/components/Icon/native/redesign/generated/DenyIcon";
export default function BlockUserElement(props) {
let stateFromStores;
const { user, channelId, reportId } = props;
stateFromStores = void 0;
const stateFromStores2 = useStateFromStores([RelationshipStore], () => RelationshipStore.isBlocked(user.id), [user]);
stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId), [channelId]);
const memo = useMemo(() => NicknameUtils.getName(stateFromStores?.guild_id, stateFromStores?.id, user), [stateFromStores, user]);
const callback = useCallback(() => {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_BLOCK_USER_BUTTON_CLICKED, {
other_user_id: user.id,
report_id: reportId
});
RelationshipActionCreators.blockUser(user.id, {
location: "ReportMenuBlockUser-iOS"
});
SafetyToastsActionCreators_native.showBlockSuccessToast(user.id, channelId);
}, [user, reportId, channelId]);
return user != null ? <InAppReportsUpsellsTableRow title={intl.formatToPlainString(t["Q1o/f3"], {
username: memo
})} disabledTitle={intl.formatToPlainString(t["kA0S/d"], {
username: memo
})} description={intl.string(t.G08MKu)} disabled={stateFromStores2} variant="danger" onPress={callback} icon={<DenyIcon color="text-feedback-critical" />} /> : null;
};
@@ -0,0 +1,84 @@
// Metro module 12415 (f12416).
import { View } from "react-native";
import { Fonts } from "../../../../_bundle/Module505";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { intl, t } from "../../../../intl/index.native";
import ReportToMod_messages from "../../../report_to_mod/ReportToMod.messages";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { LegacyText } from "../../../../design/void/native";
const useStyles = createStyles({
container: {
flex: 0,
alignSelf: "stretch",
paddingBottom: 12
},
paddingHorizontal: {
paddingHorizontal: 16
},
divider: {
height: 1,
alignSelf: "stretch",
backgroundColor: Module712.colors.BORDER_SUBTLE,
marginBottom: 16
},
descriptionText: {
lineHeight: 16,
textAlign: "center",
marginBottom: 12
},
errorText: {
color: Module712.unsafe_rawColors.RED_400,
fontSize: 12,
lineHeight: 16,
fontFamily: Fonts.PRIMARY_SEMIBOLD,
textAlign: "center",
marginTop: 12
}
});
export default function InAppReportsBottomButton(props) {
let r21, r69, r70, text, variant;
const { button, onPress: onPress2, disabled, hasError, isModeratorReport } = props;
const styles = useStyles();
if (button == null) {
return null;
}
const r31 = intl.string(t.i4jeWR);
if (button.type === "submit") {
if (isModeratorReport) {
r70 = intl.string(ReportToMod_messages.ZUyreS);
r69 = void 0;
} else {
const r61 = intl.string(t["G+vU89"]);
r69 = intl.format(t.Q0tSKT, {});
r70 = r61;
}
variant = "destructive";
text = r70;
r21 = r69;
} else if (button.type === "next") {
text = intl.string(t.PDTjLN);
variant = void 0;
r21 = void 0;
} else {
const type = button.type;
text = r31;
variant = void 0;
r21 = void 0;
if (type === "cancel") {
text = intl.string(t["ETE/oC"]);
variant = "secondary";
r21 = void 0;
}
}
const r83 = isModeratorReport ? intl.string(ReportToMod_messages.psKFdJ) : intl.string(t.h6D8Vy);
return <View style={styles.container}>
<View style={styles.divider} />
<View style={styles.paddingHorizontal}>
{r21 != null ? <Text style={styles.descriptionText} variant="text-xs/medium" color="text-default">{r21}</Text> : null}
<Button disabled={disabled} onPress={() => onPress2(button)} text={text} variant={variant} />
{hasError ? <LegacyText style={styles.errorText}>{r83}</LegacyText> : null}
</View>
</View>;
};
@@ -0,0 +1,86 @@
// Metro module 12401 (f12402).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import Module12 from "../../../../_bundle/Module12";
import { Text } from "../../../../design/components/Text/native/Text";
import { ReportMenuTypeSets } from "../../../../_bundle/Module7695";
import { intl, t } from "../../../../intl/index.native";
import ReportToMod_messages from "../../../report_to_mod/ReportToMod.messages";
const useStyles = createStyles({
container: {
flex: 0,
alignSelf: "stretch",
marginBottom: 16,
paddingHorizontal: 16
},
title: {
lineHeight: 16,
marginBottom: 8
},
breadCrumbItemContainer: {
flexDirection: "row",
justifyContent: "flex-start",
marginBottom: 8,
marginEnd: 32,
overflow: "visible"
},
breadCrumbDot: {
marginStart: 2,
marginTop: 8,
width: 4,
height: 4,
borderRadius: 2,
backgroundColor: Module712.colors.BACKGROUND_BRAND
},
breadCrumbBar: {
position: "absolute",
width: 2,
top: 10,
bottom: -12,
left: 3,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWEST
},
breadCrumbText: {
marginStart: 8,
lineHeight: 20
}
});
export default function Breadcrumbs(props) {
let c19821_1;
const { element, menuName, ...rest } = props;
c19821_1 = void 0;
const styles = useStyles();
if (element != null && element.type === "breadcrumbs") {
const r10 = Module12.flatMap(rest.history, ({ destination: [r22], multiSelect }) => {
const r25 = Object;
let r28 = multiSelect?.state;
if (r28 == null) {
r28 = {};
}
const r29 = [null, null];
const r30 = r25.values(r28);
if (r30.length > 0) {
r29[0] = r30.join(", ");
}
if (r22 !== "") {
r29[1] = r22;
}
return r29;
}).filter((item) => item != null);
c19821_1 = r10;
return r10.length !== 0 ? <View style={styles.container}>
<Text style={styles.title} accessibilityRole="header" variant="text-xs/bold">
{ReportMenuTypeSets.REPORT_TO_MOD.has(menuName) ? intl.string(ReportToMod_messages["6mx/DP"]) : intl.string(t["+3V9Tp"])}
</Text>
{r10.map((item, index) => <View key={`${item}+${index}`} style={styles.breadCrumbItemContainer}>
{index !== c19821_1.length - 1 ? <View style={styles.breadCrumbBar} /> : null}
<View style={styles.breadCrumbDot} />
<Text lineClamp={2} ellipsizeMode="tail" style={styles.breadCrumbText} variant="text-md/medium">
{item}
</Text>
</View>)}
</View> : null;
}
return null;
};
@@ -0,0 +1,66 @@
// Metro module 12397 (f12398).
import { View } from "react-native";
import GuildStore from "../../../../stores/GuildStore";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { hexWithOpacity } from "../../../../utils/ColorUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import GuildIcon, { GuildIconSizes } from "../../../guild/native/GuildIcon";
const useStyles = createStyles({
container: {
alignSelf: "stretch",
marginHorizontal: 16,
marginBottom: 16
},
borderColor: {
color: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY
},
title: {
lineHeight: 16,
marginBottom: 8
},
itemContainer: {
minHeight: 40,
borderRadius: Module712.radii.sm,
borderWidth: 1,
padding: 8
},
guildInfo: {
display: "flex",
flexDirection: "row",
alignItems: "center"
},
guildName: {
lineHeight: 18,
marginStart: 8
},
topic: {
lineHeight: 20,
marginTop: 8
}
});
export default function ChannelPreview(props) {
const stageInstance = props.stageInstance;
const styles = useStyles();
const stateFromStores = useStateFromStores([GuildStore], () => GuildStore.getGuild(stageInstance.guild_id));
if (stateFromStores != null && stageInstance != null) {
const borderColor = hexWithOpacity(styles.borderColor.color, 0.08);
return <View style={styles.container}>
<Text style={styles.title} accessibilityRole="header" variant="text-xs/bold">
{intl.string(t.InbJ8x)}
</Text>
<View style={[styles.itemContainer, {
borderColor
}]}>
<View style={styles.guildInfo}>
<GuildIcon guild={stateFromStores} size={GuildIconSizes.XXSMALL} selected={false} />
<Text style={styles.guildName} variant="text-sm/medium" color="text-default">{stateFromStores.name}</Text>
</View>
<Text style={styles.topic} variant="text-md/bold" color="mobile-text-heading-primary">{stageInstance.topic}</Text>
</View>
</View>;
}
return null;
};
@@ -0,0 +1,2 @@
// Metro module 7698 (f7699).
export const IN_APP_REPORTS_NODE = "IN_APP_REPORTS_NODE";
@@ -0,0 +1,26 @@
// Metro module 12408 (f12409).
import { useState, useEffect, useCallback } from "react";
import MessageStore from "../../../../stores/MessageStore";
import { AnalyticEvents } from "../../../../Constants";
import { useStateFromStores } from "../../../../_bundle/Module589";
import AppAnalyticsUtils from "../../../app_analytics/AppAnalyticsUtils";
import MessageActionCreators from "../../../../actions/MessageActionCreators";
import InAppReportsUpsellsTableRow from "./InAppReportsUpsellsTableRow";
import { intl, t } from "../../../../intl/index.native";
import { TrashIcon } from "../../../../design/components/Icon/native/redesign/generated/TrashIcon";
export default function DeleteMessageElement(props) {
const { message, reportId } = props;
const [disabled, setState] = useState(false);
const stateFromStores = useStateFromStores([MessageStore], () => MessageStore.getMessage(message.getChannelId(), message.id) == null, [message]);
useEffect(() => {
setState(stateFromStores);
}, [stateFromStores]);
const callback = useCallback(() => {
setState(true);
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_DELETE_MESSAGE_BUTTON_CLICKED, {
report_id: reportId
});
MessageActionCreators.deleteMessage(message.getChannelId(), message.id);
}, [message, reportId]);
return <InAppReportsUpsellsTableRow title={intl.string(t.c9BHL9)} disabledTitle={intl.string(t.AT2KSd)} description={intl.string(t.dK8S0w)} disabled={disabled} variant="danger" onPress={callback} icon={<TrashIcon color="text-feedback-critical" />} />;
};
@@ -0,0 +1,41 @@
// Metro module 12412 (f12413).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { RowButton } from "../../../../design/components/TableRow/native/RowButton.native";
import { TableRowIcon } from "../../../../design/components/TableRow/native/TableRowIcon.native";
import { LinkExternalMediumIcon } from "../../../../design/components/Icon/native/redesign/generated/LinkExternalMediumIcon";
import Linking from "../../../../lib/native/Linking";
let useStyles;
const ExternalLinkItem = function ExternalLinkItem(props) {
const data = props.data;
const { url, link_text, link_description } = data;
return data.is_localized ? <RowButton label={link_text} subLabel={link_description} trailing={<TableRowIcon IconComponent={LinkExternalMediumIcon} />} onPress={function onPress() {
Linking.openURL(url);
}} arrow={false} accessibilityRole="link" /> : null;
};
useStyles = createStyles({
linksContainer: {
flex: 1,
alignSelf: "stretch",
paddingHorizontal: 16
},
headerText: {
marginBottom: 8
}
});
export default function ExternalLinksElement(props) {
const elements = props.elements;
const styles = useStyles();
if (elements != null && elements.length !== 0 && elements.find((element) => element.data.is_localized) != null) {
const r6 = elements.some((element) => element.data.is_header_hidden);
return <View style={styles.linksContainer}>
{r6 ? !r6 : <Text style={styles.headerText} variant="heading-deprecated-12/extrabold" color="text-default" accessibilityRole="header">
{intl.string(t.hvVgAZ).toUpperCase()}
</Text>}
{elements.map((element, index) => <ExternalLinkItem key={`external-link-${index}`} data={element.data} />)}
</View>;
}
return null;
};
@@ -0,0 +1,65 @@
// Metro module 12400 (f12401).
import { View } from "react-native";
import AccessibilityStore from "../../../a11y/AccessibilityStore";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { hexWithOpacity } from "../../../../utils/ColorUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import GuildIcon from "../../../guild/native/GuildIcon";
import { fromClientDiscoverableGuild } from "../../../../utils/GuildRecordUtils";
const useStyles = createStyles({
container: {
alignSelf: "stretch",
marginHorizontal: 16,
marginBottom: 16
},
borderColor: {
color: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY
},
title: {
textTransform: "uppercase",
lineHeight: 16,
marginBottom: 8
},
itemContainer: {
minHeight: 40,
borderRadius: Module712.radii.sm,
borderWidth: 1,
padding: 8
},
guildInfo: {
display: "flex",
flexDirection: "row",
alignItems: "center"
},
guildName: {
lineHeight: 18,
marginStart: 8
},
guildIcon: {
borderRadius: Module712.radii.xs,
width: 18,
height: 18
}
});
export default function GuildDiscoveryPreviewElement(props) {
const guild = props.guild;
const styles = useStyles();
const stateFromStores = useStateFromStores([AccessibilityStore], () => AccessibilityStore.useReducedMotion);
const borderColor = hexWithOpacity(styles.borderColor.color, 0.08);
return <View style={styles.container}>
<Text style={styles.title} accessibilityRole="header" variant="text-xs/bold">
{intl.string(t.nTe4HC)}
</Text>
<View style={[styles.itemContainer, {
borderColor
}]}>
<View style={styles.guildInfo}>
<GuildIcon style={styles.guildIcon} guild={fromClientDiscoverableGuild(guild)} animate={!stateFromStores} />
<Text style={styles.guildName} variant="text-sm/medium" color="text-default">{guild.name}</Text>
</View>
</View>
</View>;
};
@@ -0,0 +1,50 @@
// Metro module 12398 (f12399).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { hexWithOpacity } from "../../../../utils/ColorUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import GuildIcon, { GuildIconSizes } from "../../../guild/native/GuildIcon";
const useStyles = createStyles({
container: {
alignSelf: "stretch",
marginHorizontal: 16,
marginBottom: 16
},
borderColor: {
color: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY
},
title: {
lineHeight: 16,
marginBottom: 8
},
guildContainer: {
flexDirection: "row",
alignItems: "center",
justifyContent: "flex-start",
minHeight: 40,
borderRadius: Module712.radii.sm,
borderWidth: 1,
padding: 12
},
guildInfo: {
marginLeft: 8
}
});
export default function GuildPreview(props) {
const guild = props.guild;
const styles = useStyles();
const borderColor = hexWithOpacity(styles.borderColor.color, 0.08);
return <View style={styles.container}>
<Text style={styles.title} accessibilityRole="header" variant="text-xs/bold">
{intl.string(t["0ox7Hq"]).toUpperCase()}
</Text>
<View style={[styles.guildContainer, {
borderColor
}]}>
<GuildIcon size={GuildIconSizes.LARGE} guild={guild} />
<Text variant="text-md/semibold" color="mobile-text-heading-primary" style={styles.guildInfo}>{guild.name}</Text>
</View>
</View>;
};
@@ -0,0 +1,66 @@
// Metro module 12399 (f12400).
import { View } from "react-native";
import GuildStore from "../../../../stores/GuildStore";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { hexWithOpacity } from "../../../../utils/ColorUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import GuildIcon, { GuildIconSizes } from "../../../guild/native/GuildIcon";
const useStyles = createStyles({
container: {
alignSelf: "stretch",
marginHorizontal: 16,
marginBottom: 16
},
borderColor: {
color: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY
},
title: {
lineHeight: 16,
marginBottom: 8
},
itemContainer: {
minHeight: 40,
borderRadius: Module712.radii.sm,
borderWidth: 1,
padding: 8
},
guildInfo: {
display: "flex",
flexDirection: "row",
alignItems: "center"
},
guildName: {
lineHeight: 18,
marginStart: 8
},
eventName: {
lineHeight: 20,
marginTop: 8
}
});
export default function GuildScheduledEventPreview(props) {
const event = props.event;
const styles = useStyles();
const stateFromStores = useStateFromStores([GuildStore], () => GuildStore.getGuild(event.guild_id));
if (stateFromStores == null) {
return null;
}
const borderColor = hexWithOpacity(styles.borderColor.color, 0.08);
return <View style={styles.container}>
<Text style={styles.title} accessibilityRole="header" variant="text-xs/bold">
{intl.string(t.SDTOL7)}
</Text>
<View style={[styles.itemContainer, {
borderColor
}]}>
<View style={styles.guildInfo}>
<GuildIcon guild={stateFromStores} size={GuildIconSizes.XXSMALL} selected={false} />
<Text style={styles.guildName} variant="text-sm/medium" color="text-default">{stateFromStores.name}</Text>
</View>
<Text style={styles.eventName} variant="text-md/bold" color="mobile-text-heading-primary">{event.name}</Text>
</View>
</View>;
};
@@ -0,0 +1,55 @@
// Metro module 12403 (f12404).
import { useMemo, useCallback } from "react";
import ChannelStore from "../../../../stores/ChannelStore";
import RelationshipStore from "../../../../stores/RelationshipStore";
import { AnalyticEvents } from "../../../../Constants";
import { useStateFromStoresObject, useStateFromStores } from "../../../../_bundle/Module589";
import NicknameUtils from "../../../../utils/NicknameUtils";
import AppAnalyticsUtils from "../../../app_analytics/AppAnalyticsUtils";
import RelationshipActionCreators from "../../../../actions/RelationshipActionCreators";
import InAppReportsUpsellsTableRow from "./InAppReportsUpsellsTableRow";
import { intl, t } from "../../../../intl/index.native";
import { EyeSlashIcon } from "../../../../design/components/Icon/native/redesign/generated/EyeSlashIcon";
export default function IgnoreUserElement(props) {
let stateFromStores;
const { user, channelId, reportId } = props;
stateFromStores = void 0;
const stateFromStoresObject = useStateFromStoresObject([RelationshipStore], () => ({
isIgnored: RelationshipStore.isIgnored(user.id),
isBlocked: RelationshipStore.isBlocked(user.id)
}), [user]);
let isIgnored = stateFromStoresObject.isIgnored;
const isBlocked = stateFromStoresObject.isBlocked;
stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId), [channelId]);
const memo = useMemo(() => NicknameUtils.getName(stateFromStores?.guild_id, stateFromStores?.id, user), [stateFromStores, user]);
const callback = useCallback(() => {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_IGNORE_USER_BUTTON_CLICKED, {
other_user_id: user.id,
report_id: reportId
});
RelationshipActionCreators.ignoreUser(user.id, "mobile_iar_ignore_user_element", channelId);
}, [user, reportId, channelId]);
let r37 = null;
if (user != null) {
const props2 = {
title: intl.formatToPlainString(t.U3yyFs, {
username: memo
}),
disabledTitle: intl.formatToPlainString(t["264qVM"], {
username: memo
}),
description: intl.string(t.naWE6W),
disabled: null,
onPress: null,
icon: null
};
if (!isIgnored) {
isIgnored = isBlocked;
}
props2.disabled = isIgnored;
props2.onPress = callback;
props2.icon = <EyeSlashIcon />;
r37 = <InAppReportsUpsellsTableRow {...props2} />;
}
return r37;
};
@@ -0,0 +1,45 @@
// Metro module 12409 (f12410).
import { useState, useEffect, useCallback } from "react";
import { AnalyticEvents } from "../../../../Constants";
import GuildSettingsActionCreators from "../../../guild_settings/GuildSettingsActionCreators";
import AppAnalyticsUtils from "../../../app_analytics/AppAnalyticsUtils";
import InAppReportsUpsellsTableRow from "./InAppReportsUpsellsTableRow";
import { intl, t } from "../../../../intl/index.native";
import AlertActionCreators from "../../../../actions/native/AlertActionCreators";
import Alert from "../../../../components_native/common/Alert";
import { DoorExitIcon } from "../../../../design/components/Icon/native/redesign/generated/DoorExitIcon";
export default function LeaveGuildElement(props) {
let callback;
const { guild, addCallback, reportId } = props;
callback = void 0;
const [disabled, setState] = useState(false);
const r3 = guild != null;
let c19827_4 = r3;
useEffect(() => {
setState(!c19827_4);
}, [r3]);
callback = useCallback(() => {
if (guild != null) {
addCallback(() => GuildSettingsActionCreators.leaveGuild(guild.id));
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_LEAVE_GUILD_BUTTON_CLICKED, {
guild_id: guild.id,
report_id: reportId
});
setState(true);
}
}, [addCallback, reportId, guild]);
return <InAppReportsUpsellsTableRow title={intl.string(t.cU96ip)} disabledTitle={intl.string(t.rJGMXU)} description={intl.formatToPlainString(t["26mR6/"], {
guildName: guild?.name
})} disabled={disabled} variant="danger" onPress={function onPress() {
AlertActionCreators.show({
title: intl.string(t.J2TBi3),
body: intl.formatToPlainString(t.TB1og8, {
name: guild?.name
}),
confirmText: intl.string(t.p89ACt),
cancelText: intl.string(t.gm1Vej),
onConfirm: callback,
confirmColor: Alert.Colors.RED
});
}} icon={<DoorExitIcon color="text-feedback-critical" />} />;
};
@@ -0,0 +1,56 @@
// Metro module 7712 (f7713).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import RowGenerator from "../../../messages/native/renderer/RowGenerator";
import { hexWithOpacity } from "../../../../utils/ColorUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import ChatItem from "../../../../components_native/chat/ChatItem";
const useStyles = createStyles({
container: {
alignSelf: "stretch",
marginHorizontal: 16,
marginBottom: 16
},
borderColor: {
color: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY
},
title: {
lineHeight: 16,
marginBottom: 8
},
chatItemContainer: {
minHeight: 40,
borderRadius: Module712.radii.sm,
borderWidth: 1,
padding: 8
}
});
const rowGenerator = new RowGenerator();
rowGenerator.setOptions({
renderCodedLinks: false,
renderGiftCode: false,
renderActivityInstanceEmbed: false,
renderActivityInviteEmbed: false,
renderEmbeds: true,
ignoreMentioned: true,
inlineAttachmentMedia: false,
inlineEmbedMedia: true,
renderReactions: false
});
export default function MessagePreview(props) {
const message = props.message;
const styles = useStyles();
const borderColor = hexWithOpacity(styles.borderColor.color, 0.08);
return <View style={styles.container}>
<Text style={styles.title} accessibilityRole="header" variant="text-xs/bold">
{intl.string(t.iouM3a)}
</Text>
<View style={[styles.chatItemContainer, {
borderColor
}]}>
<ChatItem rowGenerator={rowGenerator} maxHeight={120} message={message} />
</View>
</View>;
};
@@ -0,0 +1,29 @@
// Metro module 12411 (f12412).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { TableRowGroup } from "../../../../design/components/TableRow/native/TableRowGroup.native";
import { TableCheckboxRow } from "../../../../design/components/TableRow/native/TableCheckboxRow.native";
const useStyles = createStyles({
container: {
paddingHorizontal: Module712.space.PX_16,
paddingVertical: Module712.space.PX_16
}
});
export default function MultiSelect(props) {
const { element, onPress: onPress2, state } = props;
const styles = useStyles();
if (element != null && element.type === "checkbox") {
return <View style={styles.container}>
<TableRowGroup hasIcons={false}>
{element.data.map((item) => {
let [c27288_0, c27288_1, subLabel] = item;
const label = c27288_1;
const key = c27288_0;
return <TableCheckboxRow key={key} label={label} subLabel={subLabel} onPress={() => onPress2(c27288_0, c27288_1)} checked={key in state} />;
})}
</TableRowGroup>
</View>;
}
return null;
};
@@ -0,0 +1,45 @@
// Metro module 12407 (f12408).
import { useMemo, useState, useCallback } from "react";
import ChannelStore from "../../../../stores/ChannelStore";
import { AnalyticEvents } from "../../../../Constants";
import { MuteUntilSeconds } from "../../../user_settings/UserSettingsConstants";
import { useStateFromStores } from "../../../../_bundle/Module589";
import NicknameUtils from "../../../../utils/NicknameUtils";
import { getMuteSettings, handleMuteSettingPress } from "../../../main_tabs_v2/native/sidebar/details/screens/MuteSettingsUtils";
import AppAnalyticsUtils from "../../../app_analytics/AppAnalyticsUtils";
import SafetyToastsActionCreators_native from "../../../safety_common/SafetyToastsActionCreators.native";
import InAppReportsUpsellsTableRow from "./InAppReportsUpsellsTableRow";
import { intl, t } from "../../../../intl/index.native";
import { BellSlashIcon } from "../../../../design/components/Icon/native/redesign/generated/BellSlashIcon";
export default function MuteUserElement(props) {
let setState;
const { user, channelId, reportId } = props;
setState = void 0;
const dMFromUserId = ChannelStore.getDMFromUserId(user.id);
const stateFromStores = useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId), [channelId]);
const memo = useMemo(() => NicknameUtils.getName(stateFromStores?.guild_id, stateFromStores?.id, user), [stateFromStores, user]);
let muted = useMemo(() => getMuteSettings(dMFromUserId), [dMFromUserId]).muted;
if (muted == null) {
muted = false;
}
let disabled;
[disabled, setState] = useState(muted);
const callback = useCallback(() => {
setState(true);
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_MUTE_USER_BUTTON_CLICKED, {
other_user_id: user.id,
report_id: reportId
});
handleMuteSettingPress({
channelId: dMFromUserId,
guildId: null,
muteDurationSeconds: MuteUntilSeconds.ALWAYS
});
SafetyToastsActionCreators_native.showMuteSuccessToast(user.id, channelId);
}, [dMFromUserId, channelId, user, reportId]);
return user == null ? null : <InAppReportsUpsellsTableRow title={intl.formatToPlainString(t.TRp5wR, {
username: memo
})} disabledTitle={intl.formatToPlainString(t.raALhx, {
username: memo
})} description={intl.string(t["yM/+AJ"])} disabled={disabled} onPress={callback} icon={<BellSlashIcon />} />;
};
@@ -0,0 +1,18 @@
// Metro module 12402 (f12403).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { TableRowGroup } from "../../../../design/components/TableRow/native/TableRowGroup.native";
import { intl, t } from "../../../../intl/index.native";
const useStyles = createStyles({
container: {
paddingHorizontal: Module712.space.PX_16,
marginBottom: Module712.space.PX_32
}
});
export default function RemediationsElement(props) {
const children = props.children;
return <View style={useStyles().container}>
<TableRowGroup title={intl.string(t["k+QA9N"])} hasIcons>{children}</TableRowGroup>
</View>;
};
@@ -0,0 +1,73 @@
// Metro module 12410 (f12411).
import { useState } from "react";
import { View } from "react-native";
import ChannelStore from "../../../../stores/ChannelStore";
import { AnalyticEvents, UserSettingsSections } from "../../../../Constants";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import useMountEffect from "../../../../hooks/useMountEffect";
import { TrackIarSettingsUpsellsActionType, useTrackSettingsUpsellsAction } from "../../ReportUtils";
import InAppReportsUpsellsTableRow from "./InAppReportsUpsellsTableRow";
import { SettingsIcon } from "../../../../design/components/Icon/native/redesign/generated/SettingsIcon";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { useSettingsUpsellsConfigs } from "../../IarSettingsUpsellsConfigRegistry";
import { TableRowGroup } from "../../../../design/components/TableRow/native/TableRowGroup.native";
import { intl, t } from "../../../../intl/index.native";
import { Text } from "../../../../design/components/Text/native/Text";
import { openUserSettings } from "../../../user_settings/core/native/openUserSettings";
import AppAnalyticsUtils from "../../../app_analytics/AppAnalyticsUtils";
let useStyles;
const SettingsUpsellsTableRow = function SettingsUpsellsTableRow(props) {
const { title, disabledTitle, description, onButtonClick, trackSettingsUpsellsAction } = props;
const [disabled, setState] = useState(false);
useMountEffect(() => {
trackSettingsUpsellsAction(TrackIarSettingsUpsellsActionType.SETTINGS_UPSELLS_VIEWED);
});
return <InAppReportsUpsellsTableRow title={title} disabledTitle={disabledTitle} description={description} disabled={disabled} onPress={() => {
onButtonClick();
setState(true);
trackSettingsUpsellsAction(TrackIarSettingsUpsellsActionType.SETTINGS_UPSELLS_APPLY_CLICKED);
}} icon={<SettingsIcon />} />;
};
useStyles = createStyles({
container: {
paddingHorizontal: Module712.space.PX_16
},
settingsContainer: {
width: "100%",
marginBottom: Module712.space.PX_8
},
goToSettingsText: {
marginTop: Module712.space.PX_4
}
});
export default function SettingsUpsellElement(props) {
let trackSettingsUpsellsAction2;
const { settingsUpsells, channelId, reportId, reportType, reportSubType } = props;
trackSettingsUpsellsAction2 = void 0;
const styles = useStyles();
const settingsUpsellsConfigs = useSettingsUpsellsConfigs(settingsUpsells, useStateFromStores([ChannelStore], () => ChannelStore.getChannel(channelId))?.type);
trackSettingsUpsellsAction2 = useTrackSettingsUpsellsAction(reportType, reportSubType, reportId);
return settingsUpsellsConfigs.length !== 0 ? <View style={styles.container}>
<View style={styles.settingsContainer}>
<TableRowGroup title={intl.string(t["1yxTIJ"])} hasIcons>
{settingsUpsellsConfigs.map(({ getTitle, getDisabledTitle, getDescription, onApply }, index) => <SettingsUpsellsTableRow key={index} title={getTitle()} disabledTitle={getDisabledTitle()} description={getDescription()} onButtonClick={onApply} trackSettingsUpsellsAction={trackSettingsUpsellsAction2(settingsUpsells[index])} />)}
</TableRowGroup>
</View>
<Text variant="text-sm/medium" style={styles.goToSettingsText}>
{intl.format(t["u7mo+k"], {
goToSettingsHook: () => {
openUserSettings({
screen: UserSettingsSections.CONTENT_AND_SOCIAL
});
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_SETTINGS_UPSELLS_ACTION, {
report_id: reportId,
report_type: reportType.name,
report_subtype: reportSubType,
action: TrackIarSettingsUpsellsActionType.SETTINGS_UPSELLS_GO_TO_SETTINGS_LINK_CLICKED
});
}
})}
</Text>
</View> : null;
};
@@ -0,0 +1,38 @@
// Metro module 12405 (f12406).
import { useState, useCallback } from "react";
import { shareIarWithParents } from "../../../parent_tools/FamilyCenterActionCreators";
import { showSafetySuccess } from "../../../toast/native/ToastUtils";
import { intl, t } from "../../../../intl/index.native";
import SafetyToastsActionCreators_native from "../../../safety_common/SafetyToastsActionCreators.native";
import InAppReportsUpsellsTableRow from "./InAppReportsUpsellsTableRow";
import { ShareIcon } from "../../../../design/components/Icon/native/redesign/generated/ShareIcon";
export default ({ parents }) => {
const [disabled, setState] = useState(false);
const callback = useCallback(() => {
shareIarWithParents().then(() => {
showSafetySuccess("IAR_SHARE_WITH_PARENT_SUCCESS", intl.formatToPlainString(t.wr4IT5, {
count: parents.length,
parent1: parents[0].username,
parent2: parents[1]?.username,
parent3: parents[2]?.username
}));
setState(true);
}).catch(() => {
SafetyToastsActionCreators_native.showFailedToast();
});
}, [parents]);
if (parents.length === 0) {
return null;
}
return <InAppReportsUpsellsTableRow title={intl.formatToPlainString(t.HqyWeO, {
count: parents.length,
parent1: parents[0].username,
parent2: parents[1]?.username,
parent3: parents[2]?.username
})} disabledTitle={intl.formatToPlainString(t.BlAMme, {
count: parents.length,
parent1: parents[0].username,
parent2: parents[1]?.username,
parent3: parents[2]?.username
})} icon={<ShareIcon />} description={intl.string(t["5l/hlt"])} disabled={disabled} onPress={callback} />;
};
@@ -0,0 +1,18 @@
// Metro module 7709 (f7710).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { ShieldSpotIllustration } from "../../../../design/assets/native";
const useStyles = createStyles({
container: {
flex: 0,
alignSelf: "center",
marginBottom: 16
}
});
export default function ShieldElement(props) {
const element = props.element;
const styles = useStyles();
return element == null ? null : element.type === "success" ? <View style={styles.container}>
<ShieldSpotIllustration width={100} height={100} />
</View> : null;
};
@@ -0,0 +1,35 @@
// Metro module 7711 (f7712).
import { useRef } from "react";
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import { getParser } from "../../../markup/CustomMarkup.native";
import { Text } from "../../../../design/components/Text/native/Text";
const useStyles = createStyles({
container: {
marginBottom: 16,
paddingHorizontal: 16
},
header: {
marginBottom: 8
},
body: {
marginBottom: 16
}
});
export default function TextElement(props) {
const data = props.element.data;
const { header, body, is_localized } = data;
const styles = useStyles();
const ref = useRef(getParser());
return is_localized ? header == null ? body == null ? null : <View style={styles.container}>
{header != null && <Text style={styles.header} variant="heading-md/extrabold" color="mobile-text-heading-primary">{header}</Text>}
{body != null && <Text style={styles.body} variant="text-md/medium">
{ref.current(body)}
</Text>}
</View> : <View style={styles.container}>
{header != null && <Text style={styles.header} variant="heading-md/extrabold" color="mobile-text-heading-primary">{header}</Text>}
{body != null && <Text style={styles.body} variant="text-md/medium">
{ref.current(body)}
</Text>}
</View> : null;
};
@@ -0,0 +1,116 @@
// Metro module 7710 (f7711).
import { useState } from "react";
import { Linking, View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import useInitialValue from "../../../../hooks/useInitialValue";
import { getParser } from "../../../markup/CustomMarkup.native";
import { isIOS } from "../../../../utils/PlatformUtils";
import { getSystemVersionMajor } from "../../../../utils/native/DeviceUtils";
import Linking2 from "../../../../lib/native/Linking";
import { Text } from "../../../../design/components/Text/native/Text";
import { Button } from "../../../../design/components/Button/native/Button.native";
import { intl, t } from "../../../../intl/index.native";
import { copy } from "../../../../utils/ClipboardUtils.native";
import { presentCopiedToClipboard } from "../../../toast/native/ToastUtils";
let env4845 = {};
const useStyles = createStyles({
container: {
marginBottom: 16,
paddingHorizontal: 16
},
header: {
marginBottom: 8
},
description: {
marginBottom: 16
},
trailingButtonContainer: {
paddingHorizontal: 8
},
smsInfoContainer: {
display: "flex",
flexDirection: "row",
alignItems: "center"
},
smsNumberContainer: {
flex: 1,
display: "flex",
flexDirection: "row",
alignItems: "center",
justifyContent: "space-between",
borderRadius: Module712.radii.xs,
borderColor: Module712.colors.BACKGROUND_BASE_LOWEST,
borderWidth: 1,
padding: 8,
backgroundColor: Module712.colors.BACKGROUND_BASE_LOW,
marginBottom: 8
},
smsNumberContainerSuccess: {
borderColor: Module712.colors.STATUS_POSITIVE_BACKGROUND
},
startButtonContainer: {
paddingHorizontal: 12,
marginBottom: 8,
marginLeft: 12
}
});
export default function TextLineElement(props) {
let setState;
const data = props.element.data;
const { title, body, sms, sms_body, is_localized } = data;
setState = void 0;
let _handleOpenSms2 = function _handleOpenSms() {
const r9 = async () => {
let c29856_1;
let env31441;
c29856_1 = void 0;
const r9 = env31441 = {
$parent: env4845
};
let c29856_0 = r9;
env31441[0] = void 0;
const r26 = (function buildSmsUrl(a0, a1) {
const r9 = isIOS() ? getSystemVersionMajor() < 8 ? ";" : "&" : "?";
return `sms:${a0}` + (a1 != null ? `${r9}body=${encodeURIComponent(a1)}` : "");
})(sms, sms_body);
env31441[0] = r26;
if (await Linking.canOpenURL(r26)) {
Linking2.openURL(env31441[0]);
}
};
_handleOpenSms2 = r9;
return r9.apply(this, arguments);
};
const styles = useStyles();
let state;
[state, setState] = useState(false);
const initialValue = useInitialValue(() => getParser());
if (is_localized) {
const r12 = state ? styles.smsNumberContainerSuccess : {};
return <View style={styles.container}>
<Text style={styles.header} variant="heading-md/extrabold" color="mobile-text-heading-primary" accessibilityRole="header">{title}</Text>
<Text style={styles.description} variant="text-md/medium">
{initialValue(body)}
</Text>
<View style={styles.smsInfoContainer}>
<View style={[styles.smsNumberContainer, r12]}>
<Text variant="text-sm/semibold" color="interactive-text-active">{sms}</Text>
<View style={styles.trailingButtonContainer}>
<Button text={state ? intl.string(t.t5VZ88) : intl.string(t.OpuAlK)} size="sm" onPress={function handleCopyPress() {
copy(sms);
presentCopiedToClipboard();
setState(true);
}} variant="secondary" />
</View>
</View>
<View style={styles.startButtonContainer}>
<Button text={intl.string(t.BDYHSe)} size="md" onPress={function handleOpenSms() {
return _handleOpenSms2.apply(this, arguments);
}} />
</View>
</View>
</View>;
}
return null;
};
@@ -0,0 +1,6 @@
// Metro module 12404 (f12405).
import { TableRow } from "../../../../design/components/TableRow/native/TableRow.native";
export default function InAppReportsUpsellsTableRow(props) {
const { title, disabledTitle, description, variant = "default", disabled } = props;
return <TableRow label={disabled ? disabledTitle ?? title : title} subLabel={disabled ? null : description} onPress={props.onPress} icon={props.icon} disabled={disabled} variant={variant} />;
};
@@ -0,0 +1,53 @@
// Metro module 12395 (f12396).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import { hexWithOpacity } from "../../../../utils/ColorUtils";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { Avatar, AvatarSizes } from "../../../../design/void/native";
const useStyles = createStyles({
container: {
alignSelf: "stretch",
marginHorizontal: 16,
marginBottom: 16
},
borderColor: {
color: Module712.colors.MOBILE_TEXT_HEADING_PRIMARY
},
title: {
lineHeight: 16,
marginBottom: 8
},
userContainer: {
flexDirection: "row",
alignItems: "center",
justifyContent: "flex-start",
minHeight: 40,
borderRadius: Module712.radii.sm,
borderWidth: 1,
padding: 12
},
userProfileInfo: {
marginLeft: 8
}
});
export default function UserPreview(props) {
const user = props.user;
const styles = useStyles();
const borderColor = hexWithOpacity(styles.borderColor.color, 0.08);
return <View style={styles.container}>
<Text style={styles.title} accessibilityRole="header" variant="text-xs/bold">
{intl.string(t.Rsth7z).toUpperCase()}
</Text>
<View style={[styles.userContainer, {
borderColor
}]}>
<Avatar size={AvatarSizes.LARGE_48} user={user} guildId={void 0} />
<View style={styles.userProfileInfo}>
{user.globalName != null && <Text variant="text-md/semibold" color="mobile-text-heading-primary">{user.globalName}</Text>}
<Text color="text-default" variant="text-sm/normal">{user.username}</Text>
</View>
</View>
</View>;
};
@@ -0,0 +1,34 @@
// Metro module 12396 (f12397).
import { View } from "react-native";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import UserProfileSharedStyles from "../../../user_profile/native/UserProfileSharedStyles";
import { isGameWidget } from "../../../user_profile/UserProfileGameWidgetTypes";
import { Text } from "../../../../design/components/Text/native/Text";
import { intl, t } from "../../../../intl/index.native";
import { WidgetSection } from "../../../user_profile/native/UserProfileWidgetsBoard";
const useStyles = createStyles({
container: {
alignSelf: "stretch",
marginHorizontal: 16,
marginBottom: 16
},
title: {
lineHeight: 16,
marginBottom: 8
},
card: {
backgroundColor: Module712.colors.USER_PROFILE_CONTAINER_BACKGROUND
}
});
export default function WidgetPreview(props) {
const { widget, userId } = props;
const styles2 = useStyles();
const styles = UserProfileSharedStyles();
return isGameWidget(widget) ? widget.games.length !== 0 ? <View style={styles2.container}>
<Text style={styles2.title} accessibilityRole="header" variant="text-xs/bold">
{intl.string(t.SpsnDY).toUpperCase()}
</Text>
<WidgetSection userId={userId} widget={widget} disableInteraction cardStyle={[styles.card, styles2.card]} />
</View> : null : null;
};
@@ -0,0 +1,578 @@
// Metro module 7700 (f7701).
import _slicedToArray from "../../../../_bundle/_slicedToArray";
import { useState, useRef, useEffect, useMemo, useCallback } from "react";
import { ScrollView, View } from "react-native";
import DevSettingsStore from "../../../devtools/dev_settings/DevSettingsStore";
import ChannelStore from "../../../../stores/ChannelStore";
import PermissionStore from "../../../../stores/PermissionStore";
import { REMEDIATION_ELEMENT_TYPES } from "../../MenuConstants";
import { IN_APP_REPORTS_NODE } from "./InAppReportsConstants";
import { AnalyticEvents, ChannelTypes } from "../../../../Constants";
import { Permissions } from "../../../../_bundle/Module505";
import { createStyles } from "../../../../design/components/Styles/native/createStyles";
import Module712 from "../../../../_bundle/Module712";
import useInitialValue from "../../../../hooks/useInitialValue";
import { getParser } from "../../../markup/CustomMarkup.native";
import { Text } from "../../../../design/components/Text/native/Text";
import { hexWithOpacity } from "../../../../utils/ColorUtils";
import { CircleInformationIcon } from "../../../../design/components/Icon/native/redesign/generated/CircleInformationIcon";
import { useStateFromStores } from "../../../../_bundle/Module589";
import { PressableHighlight } from "../../../../design/void/Pressables/native/Pressables";
import Arrow from "./Arrow";
import { useNavigation } from "../../../../design/components/Navigator/native/useNavigation.native";
import { useIsScreenReaderEnabled } from "../../../a11y/native/useIsScreenReaderEnabled.native";
import { setAccessibilityFocus } from "../../../a11y/native/setAccessibilityFocus.android";
import { ReportMenuTypeSets } from "../../../../_bundle/Module7695";
import { ReportNames } from "../../MenuTypes";
import AppAnalyticsUtils from "../../../app_analytics/AppAnalyticsUtils";
import { AccessibilityAnnouncer } from "../../../../_bundle/Module3902";
import { useIarReportSettingsUpsells } from "../../IarSettingsUpsellsConfigRegistry";
import { useUserIsTeen } from "../../../self_mod/hooks/useUserIsTeen";
import { useActiveLinkUsers } from "../../../parent_tools/hooks/useUserLinks";
import { SafeAreaPaddingView } from "../../../../components_native/common/SafeAreaView";
import InAppReportsShieldElement from "./InAppReportsShieldElement";
import InAppReportsTextLineElement from "./InAppReportsTextLineElement";
import InAppReportsTextElement from "./InAppReportsTextElement";
import InAppReportsMessagePreview from "./InAppReportsMessagePreview";
import InAppReportsUserPreview from "./InAppReportsUserPreview";
import InAppReportsWidgetPreviewElement from "./InAppReportsWidgetPreviewElement";
import InAppReportsChannelPreview from "./InAppReportsChannelPreview";
import InAppReportsGuildPreviewElement from "./InAppReportsGuildPreviewElement";
import InAppReportsGuildScheduledEventPreview from "./InAppReportsGuildScheduledEventPreview";
import InAppReportsGuildDiscoveryPreviewElement from "./InAppReportsGuildDiscoveryPreviewElement";
import InAppReportsBreadCrumbs from "./InAppReportsBreadCrumbs";
import InAppReportsRemediationsElement from "./InAppReportsRemediationsElement";
import InAppReportsIgnoreUserElement from "./InAppReportsIgnoreUserElement";
import InAppReportsShareWithParentElement from "./InAppReportsShareWithParentElement";
import InAppReportsBlockUserElement from "./InAppReportsBlockUserElement";
import InAppReportsMuteUserElement from "./InAppReportsMuteUserElement";
import InAppReportsDeleteMessageElement from "./InAppReportsDeleteMessageElement";
import InAppReportsLeaveGuildElement from "./InAppReportsLeaveGuildElement";
import InAppReportsSettingsUpsellsElement from "./InAppReportsSettingsUpsellsElement";
import InAppReportsMultiSelect from "./InAppReportsMultiSelect";
import InAppReportsExternalLinkElement from "./InAppReportsExternalLinkElement";
import InAppReportsBottomButton from "./InAppReportsBottomButton";
function $mk79238($env) {
return (a0) => a0.type === $env[0];
}
let useStyles, InfoView, ChildItem, ChildrenView, NullComponent;
const HeaderView = function HeaderView(props) {
const node2 = props.node;
const { header, subheader, description } = node2;
const headerRef = props.headerRef;
const styles = useStyles();
const initialValue = useInitialValue(() => getParser());
return <View style={styles.headerContainer}>
{header != null && header !== "" && <Text ref={headerRef} style={styles.header} variant="heading-xl/extrabold" color="mobile-text-heading-primary" accessibilityRole="header">{header}</Text>}
{subheader != null ? subheader.length > 0 ? <Text style={styles.subheader} variant="text-md/medium" color="text-default">
{initialValue(subheader)}
</Text> : null : null}
{description != null ? description.length > 0 ? <Text style={styles.description} variant="text-xs/medium" color="text-default">{description}</Text> : null : null}
</View>;
};
InfoView = function InfoView(props) {
const info = props.node.info;
const styles = useStyles();
const initialValue = useInitialValue(() => getParser());
return info != null ? <View style={[styles.infoBox, {
backgroundColor: hexWithOpacity(styles.infoBox.backgroundColor, 0.1)
}]}>
<CircleInformationIcon size="md" color={styles.infoBox.backgroundColor} />
<Text style={styles.infoBoxText} variant="text-sm/normal" color="interactive-text-active">
{initialValue(info)}
</Text>
</View> : null;
};
ChildItem = function ChildItem(props) {
const { child, nodeMap: nodeMap3, ...rest } = props;
let c15970_1 = rest;
const styles = useStyles();
const [r19, r27] = child;
const [onPress2] = useState(() => () => c15970_1.onPress(child));
let r14 = useStateFromStores([DevSettingsStore], () => DevSettingsStore.get("iar_show_report_sub_type_labels"));
const report_type = nodeMap3[r27]?.report_type;
const r55 = [<Text style={styles.childButtonText} variant="text-md/semibold" color="mobile-text-heading-primary">{r19}</Text>, ,];
if (r14) {
r14 = report_type != null;
}
if (r14) {
r14 = <Text style={styles.debugText} variant="text-xs/normal" color="text-muted">{report_type}</Text>;
}
r55[1] = r14;
return <PressableHighlight style={styles.childButton} accessibilityRole="button" onPress={onPress2}>
<View style={styles.childContainer}>
<View style={styles.childContent}>{r55}</View>
<Arrow />
</View>
</PressableHighlight>;
};
ChildrenView = function ChildrenView(props) {
const children = props.node.children;
const { onSelectChild, nodeMap } = props;
const styles = useStyles();
return children == null ? null : children.length !== 0 ? <View style={styles.childrenContainer}>
{children.map((item) => {
const r10 = _slicedToArray(item, 2);
return <ChildItem key={`${r10[0]}+${r10[1]}`} child={item} nodeMap={nodeMap} onPress={onSelectChild} />;
})}
</View> : null;
};
NullComponent = function NullComponent() {
return null;
};
useStyles = createStyles({
container: {
flex: 1,
alignSelf: "stretch",
justifyContent: "flex-start",
alignItems: "center",
backgroundColor: Module712.colors.BACKGROUND_BASE_LOWER,
marginTop: 30
},
scrollView: {
flex: 1,
alignSelf: "stretch",
marginTop: 24
},
childrenContainer: {
flex: 1,
alignSelf: "stretch",
paddingHorizontal: 16
},
headerContainer: {
alignSelf: "stretch",
marginBottom: 24,
paddingHorizontal: 16
},
header: {
marginBottom: 8,
textAlign: "center"
},
subheader: {
lineHeight: 20,
marginBottom: 8,
textAlign: "center"
},
description: {
lineHeight: 16,
marginBottom: 8,
textAlign: "center"
},
infoBox: {
alignSelf: "stretch",
backgroundColor: Module712.unsafe_rawColors.BLUE_345,
borderRadius: Module712.radii.xs,
borderColor: Module712.unsafe_rawColors.BLUE_345,
borderWidth: 1,
padding: 8,
flexDirection: "row",
marginBottom: 16,
marginHorizontal: 16
},
infoBoxText: {
flex: 1,
lineHeight: 18,
marginStart: 8,
marginTop: 3
},
childButton: {
marginBottom: 8,
borderRadius: Module712.radii.xs
},
childContainer: {
minHeight: 60,
flexDirection: "row",
alignItems: "center",
justifyContent: "flex-start",
backgroundColor: Module712.colors.BACKGROUND_SURFACE_HIGH,
paddingVertical: 16,
paddingStart: 16,
paddingEnd: 8,
borderRadius: Module712.radii.xs
},
childContent: {
flex: 1
},
childButtonText: {
lineHeight: 20
},
debugText: {
marginTop: 4,
lineHeight: 16
}
});
export default function NodeView(props) {
let r200;
let node, reportType, history2, nodeMap2, closeModal, onSubmit, onNavigate, c15972_12, callback, callback2;
let env15973;
let env15974;
let env15975;
let env15976;
let c15972_0 = props;
const styles = useStyles();
const navigation = useNavigation();
const isScreenReaderEnabled = useIsScreenReaderEnabled();
const ref = useRef(null);
const ref2 = useRef(false);
useEffect(() => {
if (isScreenReaderEnabled) {
let c26034_0, c26034_1;
const focusHeader = function focusHeader() {
if (!ref2.current) {
ref2.current = true;
setAccessibilityFocus({
ref,
delay: 300
});
}
};
c26034_0 = navigation.addListener("transitionEnd", (a0) => {
if (a0.data?.closing !== true && !ref2.current) {
ref2.current = true;
setAccessibilityFocus({
ref,
delay: 300
});
}
});
c26034_1 = setTimeout(focusHeader, 500);
return () => {
c26034_0();
clearTimeout(c26034_1);
};
}
}, [navigation, isScreenReaderEnabled]);
node = props.node;
reportType = props.reportType;
const reportSubType = props.reportSubType;
history2 = props.history;
nodeMap2 = props.nodeMap;
closeModal = props.closeModal;
const addOnCloseCallback = props.addOnCloseCallback;
onSubmit = props.onSubmit;
const reportId = props.reportId;
onNavigate = props.onNavigate;
const memo = useMemo(() => reportType.name === "message" ? reportType.record.channel_id : void 0, [reportType]);
const r57 = env15973 = {};
env15973[0] = void 0;
const elements2 = node.elements;
env15973[0] = "checkbox";
const element = elements2.find($mk79238(r57));
c15972_12 = element;
const r62 = env15974 = {};
env15974[0] = void 0;
const elements3 = node.elements;
env15974[0] = "text_line_resource";
const element3 = elements3.find($mk79238(r62));
const r67 = env15975 = {};
env15975[0] = void 0;
const elements4 = node.elements;
env15975[0] = "text";
const element2 = elements4.find($mk79238(r67));
const isModeratorReport = ReportMenuTypeSets.REPORT_TO_MOD.has(reportType.name);
let [disabled, setState] = useState(false);
const [state, setState2] = useState(false);
const [state2, setState3] = useState(() => ({}));
const [hasError, setState4] = useState(false);
callback = useCallback((a0) => ({
nodeRef: node.id,
destination: a0,
multiSelect: c15972_12 != null ? {
name: c15972_12.name,
state: state2
} : void 0
}), [node, element, state2]);
useEffect(() => {
if (c15972_12 != null) {
const data = c15972_12.data;
if (data != null) {
let c26035_0;
const _loop = function _loop(c29855_0, c29855_1) {
if (c26035_0 === true) {
setState3((prevState3) => {
const r0 = {
...prevState3
};
r0[c29855_0] = c29855_1;
return r0;
});
}
};
for (const item of data) {
let r31, r32;
[r31, r32, , c26035_0] = item;
_loop(r31, r32);
}
}
}
}, [element]);
useEffect(() => navigation.addListener("beforeRemove", () => {
const onNavigate2 = c15972_0.onNavigate;
if (onNavigate2 != null) {
onNavigate2.call(c15972_0, "..");
}
}), [navigation, props]);
useEffect(() => {
if (node.is_auto_submit && !state) {
setState2(true);
onSubmit({
nodeRef: node.id,
destination: ["", node.id]
});
}
}, [node.is_auto_submit, state, onSubmit, node.id]);
callback2 = useCallback((a0) => {
const [, r7] = a0;
const r11 = callback(a0);
const node2 = nodeMap2[r7];
if (node2 == null) {
closeModal();
} else {
let env26036;
const r21 = env26036 = {};
const elements = node2.elements;
env26036[0] = "skip";
if (elements.find($mk79238(r21)) != null) {
if (node2.button?.type === "next") {
return callback2(["", node2.button.target]);
}
}
if (!(reportType.name !== ReportNames.MESSAGE && reportType.name !== ReportNames.FIRST_DM)) {
AppAnalyticsUtils.trackWithMetadata(AnalyticEvents.IAR_NAVIGATE, {
message_id: reportType.record.id,
content_type: reportType.name,
report_sub_type: node2.report_type,
current_node: node.id,
next_node: node2.id
});
}
navigation.push(IN_APP_REPORTS_NODE, {
node: node2,
history: [...history2, r11]
});
if (onNavigate != null) {
onNavigate(node2.key);
}
}
}, [node, nodeMap2, navigation, history2, onNavigate, closeModal, reportType, callback]);
useEffect(() => {
if (node.button?.type === "done" || node.button?.type === "cancel" || history2.length === 0) {
navigation.setOptions({
headerLeft: NullComponent
});
}
}, [node, history2, navigation]);
const callback3 = useCallback((a0) => {
const channel = ChannelStore.getChannel(a0.getChannelId());
return channel != null && (channel.type !== ChannelTypes.DM && channel.type !== ChannelTypes.GROUP_DM && PermissionStore.canWithPartialContext(Permissions.MANAGE_MESSAGES, {
channelId: channel.id
}));
}, []);
const iarReportSettingsUpsells = useIarReportSettingsUpsells(reportSubType);
const r128 = env15976 = {};
env15976[0] = void 0;
const elements5 = node.elements;
env15976[0] = "ignore_users";
const r134 = elements5.find($mk79238(r128)) != null && (reportType.name === "message" || reportType.name === "first_dm" || reportType.name === "user" || reportType.name === "report_to_mod_message");
let r146 = useUserIsTeen();
const activeLinkUsers = useActiveLinkUsers();
if (r146) {
r146 = activeLinkUsers.length > 0;
}
if (r146) {
let env15977;
const r152 = env15977 = {};
const elements6 = node.elements;
env15977[0] = "share_with_parents";
r146 = elements6.find($mk79238(r152)) != null;
}
let env15978;
const props2 = {
style: styles.container,
bottom: true,
top: true,
children: null
};
const props3 = {
style: styles.scrollView,
children: null
};
const r171 = env15978 = {};
env15978[0] = void 0;
const elements = node.elements;
env15978[0] = "success";
const children = [<InAppReportsShieldElement element={elements.find($mk79238(r171))} />, <HeaderView node={node} headerRef={ref} />, <InfoView node={node} />, element3 != null ? <InAppReportsTextLineElement element={element3} /> : null, , , , , , , , , , , , , , ,];
const r189 = element2 != null && <InAppReportsTextElement element={element2} />;
let env15979;
L21: {
children[4] = r189;
const r193 = env15979 = {};
const elements7 = node.elements;
env15979[0] = "message_preview";
const r199 = elements7.find($mk79238(r193)) == null;
r200 = null;
if (!r199) {
if (reportType.name !== "message" && reportType.name !== "first_dm") {
const name = reportType.name;
r200 = null;
if (name !== "report_to_mod_message") {
break L21;
}
}
r200 = <InAppReportsMessagePreview message={reportType.record} />;
}
}
let env15980;
children[5] = r200;
const r211 = env15980 = {};
const elements8 = node.elements;
env15980[0] = "user_preview";
const r218 = elements8.find($mk79238(r211)) != null ? reportType.name === "user" ? <InAppReportsUserPreview user={reportType.record} /> : null : null;
let env15981;
children[6] = r218;
const r225 = env15981 = {};
const elements9 = node.elements;
env15981[0] = "widget_preview";
const r232 = elements9.find($mk79238(r225)) != null ? reportType.name === "widget" ? <InAppReportsWidgetPreviewElement widget={reportType.widget} userId={reportType.user_id} /> : null : null;
let env15982;
children[7] = r232;
const r240 = env15982 = {};
const elements10 = node.elements;
env15982[0] = "channel_preview";
const r247 = elements10.find($mk79238(r240)) != null ? reportType.name === "stage_channel" ? <InAppReportsChannelPreview stageInstance={reportType.record} /> : null : null;
let env15983;
children[8] = r247;
const r254 = env15983 = {};
const elements11 = node.elements;
env15983[0] = "guild_preview";
const r261 = elements11.find($mk79238(r254)) != null ? reportType.name === "guild" ? <InAppReportsGuildPreviewElement guild={reportType.record} /> : null : null;
let env15984;
children[9] = r261;
const r268 = env15984 = {};
const elements12 = node.elements;
env15984[0] = "guild_scheduled_event_preview";
const r275 = elements12.find($mk79238(r268)) != null ? reportType.name === "guild_scheduled_event" ? <InAppReportsGuildScheduledEventPreview event={reportType.record} /> : null : null;
let env15985;
children[10] = r275;
const r282 = env15985 = {};
const elements13 = node.elements;
env15985[0] = "guild_discovery_preview";
const r289 = elements13.find($mk79238(r282)) != null ? reportType.name === "guild_discovery" ? <InAppReportsGuildDiscoveryPreviewElement guild={reportType.record} /> : null : null;
let env15986;
children[11] = r289;
const r298 = env15986 = {};
env15986[0] = void 0;
const elements14 = node.elements;
env15986[0] = "breadcrumbs";
children[12] = <InAppReportsBreadCrumbs element={elements14.find($mk79238(r298))} menuName={reportType.name} history={history2} />;
let r310 = node.elements.some((element) => REMEDIATION_ELEMENT_TYPES.includes(element.type));
if (r310) {
const r321 = [r134 && <InAppReportsIgnoreUserElement user={reportType.name === "user" ? reportType.record : reportType.record.author} channelId={memo} reportId={reportId} />, , , , , ,];
if (r146) {
r146 = <InAppReportsShareWithParentElement parents={activeLinkUsers} />;
}
let env15987;
r321[1] = r146;
const r325 = env15987 = {};
const elements15 = node.elements;
env15987[0] = "block_users";
r321[2] = elements15.find($mk79238(r325)) != null && (reportType.name === "message" || reportType.name === "first_dm" || reportType.name === "user" || reportType.name === "report_to_mod_message") && <InAppReportsBlockUserElement user={reportType.name === "user" ? reportType.record : reportType.record.author} channelId={memo} reportId={reportId} />;
let r348 = !r134;
if (!r134) {
let env15988;
const r349 = env15988 = {};
const elements16 = node.elements;
env15988[0] = "mute_users";
r348 = elements16.find($mk79238(r349)) != null;
}
if (r348) {
r348 = reportType.name === "message" || reportType.name === "first_dm" || reportType.name === "user" || reportType.name === "report_to_mod_message";
}
if (r348) {
r348 = <InAppReportsMuteUserElement user={reportType.name === "user" ? reportType.record : reportType.record.author} channelId={memo} reportId={reportId} />;
}
let env15989;
r321[3] = r348;
const r371 = env15989 = {};
const elements17 = node.elements;
env15989[0] = "delete_message";
const r377 = elements17.find($mk79238(r371)) != null && (reportType.name === "message" || reportType.name === "report_to_mod_message") && callback3(reportType.record) && <InAppReportsDeleteMessageElement message={reportType.record} reportId={reportId} />;
let env15990;
r321[4] = r377;
const r388 = env15990 = {};
const elements18 = node.elements;
env15990[0] = "leave_guild";
r321[5] = elements18.find($mk79238(r388)) != null && reportType.name === "guild" && <InAppReportsLeaveGuildElement guild={reportType.record} reportId={reportId} addCallback={addOnCloseCallback} />;
r310 = <InAppReportsRemediationsElement>{r321}</InAppReportsRemediationsElement>;
}
let env15991;
children[13] = r310;
const r402 = env15991 = {};
const elements19 = node.elements;
env15991[0] = "settings_upsells";
const r408 = elements19.find($mk79238(r402)) != null && (reportType.name === "message" || reportType.name === "report_to_mod_message") && iarReportSettingsUpsells != null && <InAppReportsSettingsUpsellsElement settingsUpsells={iarReportSettingsUpsells} channelId={reportType.record.channel_id} reportId={reportId} reportType={reportType} reportSubType={reportSubType} />;
let env15992;
children[14] = r408;
children[15] = <InAppReportsMultiSelect element={element} state={state2} onPress={(event, a1) => {
const r2 = {
...state2
};
if (event in state2) {
delete r2[event];
} else {
r2[event] = a1;
}
setState3(r2);
}} />;
children[16] = <ChildrenView node={node} onSelectChild={callback2} nodeMap={nodeMap2} />;
const r427 = env15992 = {};
env15992[0] = void 0;
const elements20 = node.elements;
env15992[0] = "external_link";
const r433 = elements20.find($mk79238(r427)) != null;
let r434 = null;
if (r433) {
const elements21 = node.elements;
let c15993_0 = "external_link";
r434 = <InAppReportsExternalLinkElement elements={elements21.filter((item) => item.type === c15993_0)} />;
}
children[17] = r434;
props3.children = children;
const children2 = [<ScrollView {...props3} />, ,];
if (!disabled) {
disabled = element?.should_submit_data === true && Object.keys(state2).length === 0;
}
children2[1] = <InAppReportsBottomButton isModeratorReport={isModeratorReport} disabled={disabled} button={node.button} hasError={hasError} onPress={(event) => {
L7: {
const type = event.type;
if (type !== "done" && type !== "cancel") {
if (type === "next") {
callback2(["", event.target]);
break L7;
}
if (type !== "submit") {
break L7;
}
setState(true);
const r7 = ["", c15972_0.successNodeId];
let c26037_0 = r7;
onSubmit(callback(r7)).then(() => {
setState4(false);
const r10 = nodeMap2[c15972_0.successNodeId];
if (r10?.header != null) {
AccessibilityAnnouncer.announce(r10.header);
}
callback2(c26037_0);
}).catch(() => {
setState4(true);
}).finally(() => {
setState(false);
});
} else {
callback2(["", -1]);
}
}
}} />;
props2.children = children2;
return <SafeAreaPaddingView {...props2} />;
};
@@ -0,0 +1,51 @@
// Metro module 16180 (f16181).
import { AnalyticEvents } from "../../../../../Constants";
import { FeedbackType } from "../../../../feedback/Constants";
import getInAppReportsFeedbackOptions from "../../../getInAppReportsFeedbackOptions";
import { improperGetEnglishIntlMessageText } from "../../../../../intl/migration";
import FeedbackActionSheet from "../../../../feedback/native/FeedbackActionSheet";
import { intl, t } from "../../../../../intl/index.native";
import AnalyticsUtils from "../../../../../utils/AnalyticsUtils";
import trackInAppReportsFeedback from "../../../trackInAppReportsFeedback";
import { processOptOut } from "../../../../feedback/FeedbackUtils";
import { presentFeedbackSent } from "../../../../toast/native/ToastUtils";
export default function InAppReportsFeedbackActionSheet(props) {
const { reportId, reportType } = props;
const inAppReportsFeedbackOptions = getInAppReportsFeedbackOptions();
const otherKey = improperGetEnglishIntlMessageText("CALL_FEEDBACK_OPTION_OTHER");
return <FeedbackActionSheet headerLabel={intl.string(t.MP5lDj)} showHeaderCloseButton hideDontShowAgainCheckbox ratingsBodyLabel={intl.string(t["7Ct0Dj"])} reasonsHeaderLabel={intl.string(t.FJmoxF)} reasons={inAppReportsFeedbackOptions} feedbackReasons={[otherKey]} otherKey={otherKey} trackOpen={function trackOpen() {
AnalyticsUtils.track(AnalyticEvents.IAR_FEEDBACK_MODAL_VIEWED, {
report_id: reportId,
report_type: reportType
});
}} trackReport={function trackReport(a0) {
const { rating, reason } = a0;
let feedback = a0.feedback;
const dontShowAgain = a0.dontShowAgain;
const problem = reason != null ? reason.value : null;
if (feedback == null) {
feedback = "";
}
let dontShowAgain2 = dontShowAgain;
if (dontShowAgain2 == null) {
dontShowAgain2 = false;
}
trackInAppReportsFeedback({
rating,
problem,
feedback,
reportId,
reportType,
dontShowAgain: dontShowAgain2
});
if (dontShowAgain) {
processOptOut({
feedbackType: FeedbackType.IN_APP_REPORTS,
location: "InAppReportsFeedbackActionSheet"
});
}
if (rating != null) {
presentFeedbackSent();
}
}} />;
};
@@ -0,0 +1,67 @@
// Metro module 7694 (f7695).
import { ReportMenuTypeSets } from "../../_bundle/Module7695";
import { getReportMenuForModeratorReport, getReportMenu } from "./ReportUtils";
import ModalActionCreators from "../../actions/ModalActionCreators";
import "../../_bundle/asyncRequire";
let c4834_4 = "IN_APP_REPORT_MODAL_KEY";
export async function showReportModal(c26020_0, c26020_1, c26020_2) {
let c26020_5 = 0;
let c29849_2, c29849_3, c29849_0, c29849_1, c29849_4;
L17: {
try {
c29849_2 = void 0;
c29849_3 = void 0;
c29849_0 = c26020_0;
c29849_1 = c26020_1;
c29849_2 = c26020_2.onSubmit;
const isEligibleForFeedback = c26020_2.isEligibleForFeedback;
if (isEligibleForFeedback !== void 0) {
c29849_3 = isEligibleForFeedback;
c29849_4 = void 0;
} else {
c29849_3 = true;
c29849_4 = void 0;
}
await void 0;
c26020_5 = 1;
if (ReportMenuTypeSets.REPORT_TO_MOD.has(c29849_0.name)) {
c29849_4 = await getReportMenuForModeratorReport(c29849_0, c29849_1);
ModalActionCreators.pushLazy(import("./native/components/InAppReportModal"), {
menu: c29849_4,
reportType: c29849_0,
afterSubmit: c29849_2,
isEligibleForFeedback: c29849_3
}, c4834_4);
c26020_5 = 0;
} else {
c29849_4 = await getReportMenu(c29849_0, c29849_1);
ModalActionCreators.pushLazy(import("./native/components/InAppReportModal"), {
menu: c29849_4,
reportType: c29849_0,
afterSubmit: c29849_2,
isEligibleForFeedback: c29849_3
}, c4834_4);
c26020_5 = 0;
}
} catch ($e) {
let r33 = $e;
if (c26020_5 !== 0) {
while (true) {
try {
c26020_5 = 0;
break L17;
} catch ($e) {
r33 = $e;
if (c26020_5 === 0) {
break;
}
}
}
}
throw r33;
}
}
}
export function hideReportModal() {
ModalActionCreators.popWithKey(c4834_4);
}
@@ -0,0 +1,14 @@
// Metro module 16183 (f16184).
import { AnalyticEvents } from "../../Constants";
import AnalyticsUtils from "../../utils/AnalyticsUtils";
export default function trackInAppReportsFeedback(a0) {
const { problem, feedback, reportType, reportId = null, rating = null } = a0;
AnalyticsUtils.track(AnalyticEvents.IAR_FEEDBACK_SUBMITTED, {
reason: problem,
report_type: reportType,
report_id: reportId,
rating,
feedback,
dont_show_again: a0.dontShowAgain
});
};