225 lines
13 KiB
TypeScript
225 lines
13 KiB
TypeScript
/* Metro module 11399; source: modules/summaries/native/SummaryActionSheet.tsx; dependencies: [31, 27, 1379, 4814, 9865, 661, 33, 4080, 11399, 1962, 4501, 697, 6860, 9905, 3856, 1244, 4800, 9212, 7153, 7165, 4007, 21, 1230, 6275, 6618, 10236, 4573, 11400, 9173, 9694, 8194, 2] */
|
|
function _fun87332(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#87332, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:6, offset: 0x01fb8f99, size: 509 bytes, params: 8, frame: 24
|
|
var object2;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importAll(31) /* metro dependency 31 */;
|
|
const env0_4 = (require(27) /* metro dependency 27 */).View;
|
|
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
|
|
const messageStore = importDefault(4814) /* metro dependency 4814: MessageStore */;
|
|
const summaryStore = importDefault(9865) /* metro dependency 9865: SummaryStore */;
|
|
let value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_8 = value.AnalyticsSections;
|
|
const env0_9 = value.MessageFlags;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object2 = {summaryContainer: {'padding': 16, 'margin': 16, 'marginBottom': 24, 'justifyContent': 'center',
|
|
'alignItems': 'center'}};
|
|
object2.summaryContent = {textAlign: 'center'};
|
|
const object4 = {'marginBottom': 8, 'borderRadius': null, 'border': 1, 'overflow': 'hidden', 'alignItems': 'center',
|
|
'justifyContent': 'center'};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.round;
|
|
const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND;
|
|
object4.backgroundColor = BACKGROUND_BRAND;
|
|
object2.summaryIconContainer = object4;
|
|
const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE;
|
|
object2.summaryIcon = {'margin': 8, 'width': 20, 'height': 20, tintColor: WHITE};
|
|
object2.summaryTopic = {marginBottom: 4};
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object2.divider = {height: 1, backgroundColor: BORDER_SUBTLE};
|
|
object2.actionsContainer = {'flexDirection': 'row', 'justifyContent': 'space-evenly', 'marginBottom': 16};
|
|
const env0_12 = Reflect.apply(createStyles, value, [object2]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/summaries/native/SummaryActionSheet.tsx');
|
|
exports.default = SummaryActionSheet;
|
|
exports.openSummaryDividerActionSheet = openSummaryDividerActionSheet;
|
|
}
|
|
|
|
function SummaryActionSheet({summary}) { // fn#87333, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:932, offset: 0x01fb9196, size: 1190 bytes, params: 2, frame: 36
|
|
const styles = useStyles();
|
|
let binding = env0_3;
|
|
const value3 = binding.useRef(null);
|
|
const channel = ChannelStore.getChannel(summary.channelId);
|
|
const message = MessageStore.getMessage(summary.channelId, summary.startId);
|
|
let r12 = message != null && message.hasFlag(MessageFlags.HAS_THREAD);
|
|
let r13 = channel != null && message != null && !message.hasFlag(MessageFlags.HAS_THREAD) && (require(6860) /* metro dependency 6860: ThreadHooks */).computeCanStartPublicThread(channel,
|
|
message);
|
|
const value10 = env0_3.useCallback(_fun87334, [channel?.guild_id]);
|
|
binding = env0_3;
|
|
const value11 = binding.useCallback(_fun87335, [summary, channel]);
|
|
const value12 = binding.useCallback(_fun87336, [summary, channel, message]);
|
|
const value13 = binding.useCallback(_fun87337, [channel, message]);
|
|
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
|
const SafeAreaPaddingView = (require(6618) /* metro dependency 6618: SafeAreaView */).SafeAreaPaddingView;
|
|
const TopicsIcon = (require(10236) /* metro dependency 10236: TopicsIcon */).TopicsIcon;
|
|
const items2 = [<View style={styles.summaryIconContainer}><TopicsIcon style={styles.summaryIcon} size="custom" /></View>];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
items2[1] = <Text style={[styles.summaryContent,
|
|
styles.summaryTopic]} variant="heading-md/extrabold" color="mobile-text-heading-primary">{summary.topic}</Text>;
|
|
items2[2] = <Text style={[styles.summaryContent]} variant="heading-md/medium" color="text-default">{summary.summShort}</Text>;
|
|
const items4 = [<View style={styles.summaryContainer}>{items2}</View>];
|
|
items4[1] = <View style={styles.divider} />;
|
|
const SummaryActionSheetButton = (require(11400) /* metro dependency 11400: SummaryActionSheetButton */).SummaryActionSheetButton;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const summaryActionSheetButton = <SummaryActionSheetButton label={Reflect.apply(string, intl,
|
|
[(require(1244) /* metro dependency 1244: indexNative */).t['NY/nlb']])} iconSource={importDefault(9173) /* metro dependency 9173: Share */} onPress={value11} />;
|
|
r13 = r13 && <SummaryActionSheetButton label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.rBIGBL)} iconSource={importDefault(9694) /* metro dependency 9694 */} onPress={value12} />;
|
|
r12 = r12 && <SummaryActionSheetButton label={intl.string((require(1244) /* metro dependency 1244: indexNative */).t['39d0Wj'])} iconSource={importDefault(9694) /* metro dependency 9694 */} onPress={value13} />;
|
|
string = intl.string;
|
|
const QLkZ39 = (require(1244) /* metro dependency 1244: indexNative */).t.QLkZ39;
|
|
items4[2] = <View style={styles.actionsContainer}>{summaryActionSheetButton}{r13}{r12}<SummaryActionSheetButton label={Reflect.apply(string,
|
|
intl, [QLkZ39])} iconSource={importDefault(8194) /* metro dependency 8194 */} onPress={value10} /></View>;
|
|
return (
|
|
<BottomSheet ref={value3}>
|
|
<SafeAreaPaddingView bottom>
|
|
{items4}
|
|
</SafeAreaPaddingView>
|
|
</BottomSheet>
|
|
);
|
|
}
|
|
|
|
function openSummaryDividerActionSheet(a0, a1) { // fn#87338, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:3440, offset: 0x01fb9a29, size: 135 bytes, params: 3, frame: 18
|
|
var defaultImport;
|
|
var openLazy;
|
|
var value;
|
|
const summary = SummaryStore.findSummary(a0, a1);
|
|
if (summary != null) {
|
|
defaultImport = importDefault(dependencyMap[7]);
|
|
openLazy = defaultImport.openLazy;
|
|
value = require(dependencyMap[9]);
|
|
value = value(dependencyMap[8], dependencyMap.paths);
|
|
Reflect.apply(openLazy, defaultImport, [value, 'SummaryDivider' + a1, {summary: summary}]);
|
|
}
|
|
}
|
|
|
|
function _fun87334() { // fn#87334, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:1206, offset: 0x01fb963c, size: 166 bytes, params: 1, frame: 18
|
|
var defaultImport2;
|
|
var openLazy;
|
|
let value = environment.__proto__;
|
|
const value2 = undefined;
|
|
importDefault(dependencyMap[7]).hideActionSheet();
|
|
if ((env0_1 == null ? value2 : env0_1.guild_id) != null) {
|
|
defaultImport2 = importDefault(dependencyMap[7]);
|
|
openLazy = defaultImport2.openLazy;
|
|
value = require(dependencyMap[9]);
|
|
value = value(dependencyMap[13], dependencyMap.paths);
|
|
Reflect.apply(openLazy, defaultImport2, [value, 'GuildHighlightsNotifications',
|
|
{guildId: env0_1 == null ? value2 : env0_1.guild_id}]);
|
|
}
|
|
return value2;
|
|
}
|
|
|
|
function _fun87335() { // fn#87335, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:1428, offset: 0x01fb96e2, size: 315 bytes, params: 1, frame: 26
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var formatToPlainString;
|
|
var I3yTDn;
|
|
var object2;
|
|
var summaryBinding;
|
|
var topic;
|
|
var moduleValue;
|
|
var getChannelPermalink;
|
|
var binding;
|
|
var value3;
|
|
var moduleValue2;
|
|
var showShareActionSheet;
|
|
let value = environment.__proto__;
|
|
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
|
|
if (env0_1 != null) {
|
|
formatToPlainString = intl.formatToPlainString;
|
|
I3yTDn = t.I3yTDn;
|
|
object2 = {};
|
|
summaryBinding = summary;
|
|
topic = summaryBinding.topic;
|
|
object2.topic = topic;
|
|
moduleValue = require(4800) /* metro dependency 4800: ChannelUtils */;
|
|
getChannelPermalink = moduleValue.getChannelPermalink;
|
|
binding = env0_1;
|
|
object2.url = Reflect.apply(getChannelPermalink, moduleValue, [binding.guild_id, binding.id,
|
|
summaryBinding.startId,
|
|
summaryBinding.id]);
|
|
value3 = Reflect.apply(formatToPlainString, intl, [I3yTDn, object2]);
|
|
moduleValue2 = require(9212) /* metro dependency 9212: showShareActionSheetAndroid */;
|
|
showShareActionSheet = moduleValue2.showShareActionSheet;
|
|
topic = summaryBinding.topic;
|
|
Reflect.apply(showShareActionSheet, moduleValue2, [{message: value3, subject: topic},
|
|
AnalyticsSections.SUMMARY_ACTION_SHEET]);
|
|
} else {
|
|
value = require(3856) /* metro dependency 3856: ToastUtils */;
|
|
value.presentFailedToast(intl.string(t.gvkcQl));
|
|
}
|
|
}
|
|
|
|
function _fun87336() { // fn#87336, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:1793, offset: 0x01fb981d, size: 383 bytes, params: 1, frame: 21
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var defaultImport2;
|
|
var openThreadCreationForMobile;
|
|
var binding;
|
|
var summaryBinding;
|
|
var defaultImport3;
|
|
var changeThreadSettings;
|
|
var id;
|
|
var moduleValue;
|
|
var navigateToCreateThread;
|
|
var guild_id;
|
|
var defaultImport4;
|
|
var castMessageIdAsChannelId;
|
|
var moduleValue2;
|
|
var transitionToGuild;
|
|
let value = environment.__proto__;
|
|
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
|
|
if (env0_1 == null) {
|
|
value = require(3856) /* metro dependency 3856: ToastUtils */;
|
|
value.presentError(intl.string(t['/+DWeQ']));
|
|
} else if (env0_2 != null) {
|
|
defaultImport2 = importDefault(7153) /* metro dependency 7153: ThreadActionCreators */;
|
|
openThreadCreationForMobile = defaultImport2.openThreadCreationForMobile;
|
|
binding = env0_1;
|
|
summaryBinding = summary;
|
|
Reflect.apply(openThreadCreationForMobile, defaultImport2, [binding, summaryBinding.startId,
|
|
AnalyticsSections.SUMMARY_ACTION_SHEET]);
|
|
defaultImport3 = importDefault(7165) /* metro dependency 7165: DraftActionCreators */;
|
|
changeThreadSettings = defaultImport3.changeThreadSettings;
|
|
id = binding.id;
|
|
Reflect.apply(changeThreadSettings, defaultImport3, [id, {name: summaryBinding.topic}]);
|
|
moduleValue = require(4007) /* metro dependency 4007: NavigationRouteUtilsNative */;
|
|
navigateToCreateThread = moduleValue.navigateToCreateThread;
|
|
guild_id = binding.guild_id;
|
|
defaultImport4 = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
castMessageIdAsChannelId = defaultImport4.castMessageIdAsChannelId;
|
|
id = env0_2.id;
|
|
if (!Reflect.apply(navigateToCreateThread, moduleValue, [guild_id, Reflect.apply(castMessageIdAsChannelId,
|
|
defaultImport4, [id])])) {
|
|
moduleValue2 = require(1230) /* metro dependency 1230: router_utils */;
|
|
transitionToGuild = moduleValue2.transitionToGuild;
|
|
guild_id = env0_1.guild_id;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
Reflect.apply(transitionToGuild, moduleValue2, [guild_id, value.castMessageIdAsChannelId(env0_2.id)]);
|
|
}
|
|
} else {
|
|
value = require(3856) /* metro dependency 3856: ToastUtils */;
|
|
value.presentError(intl.string(t['/+DWeQ']));
|
|
}
|
|
}
|
|
|
|
function _fun87337() { // fn#87337, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:11585:2225, offset: 0x01fb999c, size: 141 bytes, params: 1, frame: 17
|
|
var moduleValue;
|
|
var transitionToGuild;
|
|
var guild_id;
|
|
let value = environment.__proto__;
|
|
(importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet();
|
|
if (env0_1 != null && env0_2 != null) {
|
|
moduleValue = require(1230) /* metro dependency 1230: router_utils */;
|
|
transitionToGuild = moduleValue.transitionToGuild;
|
|
guild_id = env0_1.guild_id;
|
|
value = importDefault(21) /* metro dependency 21: SnowflakeUtils */;
|
|
Reflect.apply(transitionToGuild, moduleValue, [guild_id, value.castMessageIdAsChannelId(env0_2.id)]);
|
|
}
|
|
}
|
|
|