decord/source/modules/activities/panel/native/ActivityInviteSheet.tsx

191 lines
8.4 KiB
TypeScript
Raw Normal View History

2026-07-27 11:26:19 +00:00
// Module ID: 15779
// Function ID: 121676
2026-07-20 16:05:17 +00:00
// Name: Loading
2026-07-27 11:26:19 +00:00
// Dependencies: [57, 31, 27, 11741, 10026, 653, 5969, 482, 33, 4131, 689, 8296, 5462, 5482, 4099, 8297, 8288, 10419, 566, 10025, 5187, 5186, 1212, 1273, 12163, 9171, 15780, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-07-27 11:26:19 +00:00
// Module 15779 (Loading)
2026-07-23 10:11:24 +00:00
import _slicedToArray from "_slicedToArray";
import result from "result";
import { View } from "set";
import setSendState from "setSendState";
import _isNativeReflectConstruct from "_isNativeReflectConstruct";
import { ActivityActionTypes } from "ME";
import InviteSendStates from "InviteSendStates";
import { NOOP_NULL } from "sum";
import jsxProd from "jsxProd";
import _createForOfIteratorHelperLoose from "_createForOfIteratorHelperLoose";
let closure_10;
let closure_11;
let closure_13;
let closure_14;
let closure_15;
let closure_6;
let closure_7;
const require = arg1;
2026-07-20 16:05:17 +00:00
function Loading() {
2026-07-23 10:11:24 +00:00
const tmp = _createForOfIteratorHelperLoose();
2026-07-20 16:05:17 +00:00
const items = [];
let num = 0;
do {
2026-07-23 10:11:24 +00:00
let tmp2 = callback3;
let tmp3 = importDefault;
let tmp4 = dependencyMap;
2026-07-20 16:05:17 +00:00
let obj = { row: num };
2026-07-25 08:10:48 +00:00
let arr = items.push(callback3(importDefault(8296), obj, num));
2026-07-20 16:05:17 +00:00
num = num + 1;
} while (num < 10);
obj = {};
obj = { style: tmp.placeholderHeader };
const items1 = [callback3(View, obj), callback3(View, { style: tmp.placeholderLabel }), items];
obj.children = items1;
return callback4(closure_14, obj);
}
2026-07-23 10:11:24 +00:00
({ setSendState: closure_6, useInstantInviteSendStates: closure_7 } = setSendState);
({ InviteSendStates: closure_10, InviteTargetTypes: closure_11 } = InviteSendStates);
({ jsx: closure_13, Fragment: closure_14, jsxs: closure_15 } = jsxProd);
_createForOfIteratorHelperLoose = {};
_createForOfIteratorHelperLoose = { height: 16, width: "80%", margin: 16, marginBottom: 8, borderRadius: require("_createForOfIteratorHelperLoose").radii.sm, backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_MOD_MUTED };
_createForOfIteratorHelperLoose.placeholderHeader = _createForOfIteratorHelperLoose;
let obj1 = { height: 16, width: "40%", margin: 16, borderRadius: require("_createForOfIteratorHelperLoose").radii.sm, backgroundColor: require("_createForOfIteratorHelperLoose").colors.BACKGROUND_MOD_MUTED };
_createForOfIteratorHelperLoose.placeholderLabel = obj1;
_createForOfIteratorHelperLoose.emptyState = { backgroundColor: "transparent" };
_createForOfIteratorHelperLoose.searchAndShareContainer = { borderTopWidth: 1, borderColor: require("_createForOfIteratorHelperLoose").colors.BORDER_SUBTLE, marginTop: require("_createForOfIteratorHelperLoose").space.PX_8, paddingVertical: require("_createForOfIteratorHelperLoose").space.PX_8, paddingHorizontal: require("_createForOfIteratorHelperLoose").space.PX_12, flexDirection: "column", gap: require("_createForOfIteratorHelperLoose").space.PX_12 };
_createForOfIteratorHelperLoose = _createForOfIteratorHelperLoose.createStyles(_createForOfIteratorHelperLoose);
let obj2 = { borderTopWidth: 1, borderColor: require("_createForOfIteratorHelperLoose").colors.BORDER_SUBTLE, marginTop: require("_createForOfIteratorHelperLoose").space.PX_8, paddingVertical: require("_createForOfIteratorHelperLoose").space.PX_8, paddingHorizontal: require("_createForOfIteratorHelperLoose").space.PX_12, flexDirection: "column", gap: require("_createForOfIteratorHelperLoose").space.PX_12 };
let result = require("get ActivityIndicator").fileFinishedImporting("modules/activities/panel/native/ActivityInviteSheet.tsx");
2026-07-20 16:05:17 +00:00
export default function ActivityInviteSheet(activity) {
2026-07-23 10:11:24 +00:00
let result;
2026-07-20 16:05:17 +00:00
let tmp10;
activity = activity.activity;
2026-07-23 10:11:24 +00:00
const tmp = _createForOfIteratorHelperLoose();
2026-07-24 07:16:23 +00:00
analyticsLocations = analyticsLocations(5462)(analyticsLocations(5482).ACTIVITY_INVITE_SHEET).analyticsLocations;
2026-07-23 10:11:24 +00:00
let tmp3 = callback(React.useState(null), 2);
2026-07-20 16:05:17 +00:00
const first = tmp3[0];
2026-07-23 10:11:24 +00:00
const dependencyMap = tmp3[1];
2026-07-20 16:05:17 +00:00
const tmp5 = callback2((arg0) => arg0);
2026-07-23 10:11:24 +00:00
callback = tmp5;
2026-07-20 16:05:17 +00:00
const items = [activity, tmp5];
const items1 = [analyticsLocations];
callback = React.useCallback((arg0) => {
const party = activity.party;
let id;
if (null != party) {
id = party.id;
}
let tmp3 = null;
if (null != id) {
let tmp6;
if (null != tmp5[id]) {
tmp6 = tmp5[tmp2];
}
tmp3 = tmp6;
}
return tmp3;
}, items);
const items2 = [activity];
const callback1 = React.useCallback((userId) => {
2026-07-25 08:10:48 +00:00
let obj = analyticsLocations(4099);
2026-07-20 16:05:17 +00:00
obj.hideActionSheet();
obj = { userId, sourceAnalyticsLocations: analyticsLocations };
2026-07-25 08:10:48 +00:00
analyticsLocations(8297)(obj);
2026-07-20 16:05:17 +00:00
}, items1);
2026-07-23 10:11:24 +00:00
callback2 = React.useCallback((item) => {
2026-07-20 16:05:17 +00:00
const activity = item;
function markInviteSent() {
if (null != id) {
2026-07-23 10:11:24 +00:00
outer2_6(id, item.item.id, outer2_10.SENT);
2026-07-20 16:05:17 +00:00
}
}
if (null != activity) {
const party = activity.party;
let id;
if (null != party) {
id = party.id;
}
if (null != id) {
2026-07-23 10:11:24 +00:00
outer1_6(id, tmp.item.id, outer1_10.SENDING);
2026-07-25 08:10:48 +00:00
if (tmp.type === activity(8288).RowTypes.CHANNEL) {
2026-07-24 07:16:23 +00:00
let obj = { channelId: item.item.id, type: outer1_9.JOIN, activity, location: analyticsLocations(5482).ACTIVITY_INVITE_SHEET };
2026-07-27 11:26:19 +00:00
const obj3 = analyticsLocations(10419);
const sendActivityInviteResult = analyticsLocations(10419).sendActivityInvite(obj);
analyticsLocations(10419).sendActivityInvite(obj).then(markInviteSent).catch((arg0) => {
2026-07-23 10:11:24 +00:00
outer1_2(String(arg0));
2026-07-20 16:05:17 +00:00
});
2026-07-27 11:26:19 +00:00
const nextPromise = analyticsLocations(10419).sendActivityInvite(obj).then(markInviteSent);
2026-07-25 08:10:48 +00:00
} else if (tmp.type === activity(8288).RowTypes.DM) {
2026-07-27 11:26:19 +00:00
obj = analyticsLocations(10419);
2026-07-24 07:16:23 +00:00
obj = { userId: tmp.item.id, type: outer1_9.JOIN, activity, location: analyticsLocations(5482).ACTIVITY_INVITE_SHEET };
2026-07-20 16:05:17 +00:00
const result = obj.sendActivityInviteUser(obj);
2026-07-23 10:11:24 +00:00
result.then(markInviteSent).catch((arg0) => outer1_2(String(arg0)));
2026-07-20 16:05:17 +00:00
const nextPromise1 = result.then(markInviteSent);
}
}
}
}, items2);
2026-07-23 10:11:24 +00:00
let obj = activity(566);
const items3 = [_isNativeReflectConstruct];
const stateFromStores = obj.useStateFromStores(items3, () => outer1_8.getInviteSuggestionRows());
2026-07-24 07:16:23 +00:00
const tmp2 = analyticsLocations(5462);
2026-07-23 10:11:24 +00:00
[tmp10, result] = callback(React.useState(false), 2);
2026-07-20 16:05:17 +00:00
const effect = React.useEffect(() => {
callback(true);
2026-07-25 08:10:48 +00:00
let obj = activity(10025);
2026-07-23 10:11:24 +00:00
obj = { omitUserIds: new Set(), inviteTargetType: outer1_11.EMBEDDED_APPLICATION };
2026-07-20 16:05:17 +00:00
const inviteSuggestions = obj.loadInviteSuggestions(obj);
const set = new Set();
2026-07-23 10:11:24 +00:00
inviteSuggestions.catch(outer1_12).finally(() => {
outer1_4(false);
2026-07-20 16:05:17 +00:00
});
}, []);
obj = { value: analyticsLocations };
2026-07-23 10:11:24 +00:00
obj = { showGradient: null, scrollable: true, startExpanded: true };
2026-07-20 16:05:17 +00:00
let tmp16 = null != first;
if (!tmp16) {
tmp16 = !tmp12;
}
if (!tmp16) {
tmp16 = !tmp13;
}
obj.showGradient = tmp16;
const obj1 = {};
2026-07-23 10:11:24 +00:00
const intl = activity(1212).intl;
obj1.title = intl.string(activity(1212).t["OzOM/q"]);
obj.header = callback3(activity(5186).BottomSheetTitleHeader, obj1);
2026-07-20 16:05:17 +00:00
if (null != first) {
2026-07-27 11:26:19 +00:00
const obj2 = { style: tmp.emptyState, Illustration: activity(12163).AppCrash, title: first };
2026-07-23 10:11:24 +00:00
let tmp17Result = callback3(activity(1273).EmptyState, obj2);
2026-07-20 16:05:17 +00:00
} else if (tmp12) {
tmp17Result = callback3(Loading, {});
} else {
2026-07-23 10:11:24 +00:00
let obj3 = {};
2026-07-20 16:05:17 +00:00
const obj4 = {};
const obj5 = { style: tmp.searchAndShareContainer };
2026-07-25 08:10:48 +00:00
const obj6 = { size: "md", isRound: true, onChange: activity(10025).searchInviteSuggestions };
2026-07-23 10:11:24 +00:00
const intl2 = activity(1212).intl;
obj6.placeholder = intl2.string(activity(1212).t.iI1gMg);
2026-07-25 08:10:48 +00:00
obj5.children = callback3(activity(9171).SearchField, obj6);
2026-07-20 16:05:17 +00:00
obj4.children = callback3(View, obj5);
const items4 = [callback3(View, obj4), ];
if (tmp13) {
const obj7 = { style: tmp.emptyState };
2026-07-23 10:11:24 +00:00
const intl3 = activity(1212).intl;
obj7.title = intl3.string(activity(1212).t.ojoWgX);
let tmp24Result = tmp24(activity(1273).EmptyState, obj7);
2026-07-20 16:05:17 +00:00
} else {
const obj8 = { data: stateFromStores, error: first, getSendState: callback, onInviteSent: callback2, onPressAvatar: callback1 };
2026-07-27 11:26:19 +00:00
tmp24Result = tmp24(analyticsLocations(15780), obj8);
2026-07-20 16:05:17 +00:00
}
items4[1] = tmp24Result;
obj3.children = items4;
tmp17Result = closure_15(closure_14, obj3);
const tmp17 = closure_15;
const tmp18 = closure_14;
}
obj.children = tmp17Result;
2026-07-23 10:11:24 +00:00
obj.children = callback3(activity(5187).BottomSheet, obj);
2026-07-24 07:16:23 +00:00
return callback3(activity(5462).AnalyticsLocationProvider, obj);
2026-07-20 16:05:17 +00:00
};