/* Metro module 9321; source: modules/lurker_mode/native/LurkerServerPreviewJoinButton.tsx; dependencies: [31, 1379, 1878, 3785, 661, 33, 566, 6927, 1314, 6914, 6929, 6593, 4578, 1244, 1423, 3995, 2] */
function _fun72815(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#72815, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9507:6, offset: 0x01d54ae7, size: 222 bytes, params: 8, frame: 19
const env0_0 = require;
const Object = global.Object;
Object.defineProperty(exports, '__esModule', {value: true});
let value = importAll(31) /* metro dependency 31 */;
const channelStore = importDefault(1379) /* metro dependency 1379: ChannelStore */;
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
const lurkingStore = importDefault(3785) /* metro dependency 3785: LurkingStore */;
const env0_7 = (require(661) /* metro dependency 661: Constants */).JoinGuildSources;
const env0_8 = (require(33) /* metro dependency 33 */).jsx;
value = value.memo(LurkerServerPreviewJoinButton);
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/lurker_mode/native/LurkerServerPreviewJoinButton.tsx');
exports.default = value;
}
function LurkerServerPreviewJoinButton({guildId, joinSource, onBeforeJoin}) { // fn#72816, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9507:191, offset: 0x01d54bc5, size: 442 bytes, params: 2, frame: 20
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const value2 = currentUser.useCallback(_fun72818, [guildId, joinSource, onBeforeJoin]);
if (currentUser == null) {
return (
);
}
const userAvatarSource = (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getUserAvatarSource(currentUser,
false);
const value4 = intl.formatToPlainString((require(1244) /* metro dependency 1244: indexNative */).t['5qtVhX'],
{usernameHook: usernameHook_72819});
const Button2 = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
const Icon = Button2.Icon;
return (
}
onPress={value2}
/>
);
}
function _fun72818() { // fn#72818, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9507:351, offset: 0x01d54d7f, size: 279 bytes, params: 1, frame: 21
var value5;
var moduleValue;
let value = environment.__proto__;
const lurkingSourceForGuild = LurkingStore.getLurkingSourceForGuild(guildId);
const value4 = undefined;
const type = lurkingSourceForGuild == null ? value4 : lurkingSourceForGuild.type;
const DIRECTORY_ENTRY = JoinGuildSources.DIRECTORY_ENTRY;
if (type === DIRECTORY_ENTRY) {
value5 = ChannelStore.getChannel(lurkingSourceForGuild.directoryChannelId);
if (value5 != null) {
moduleValue = require(6927) /* metro dependency 6927: HubProgressActionCreators */;
moduleValue.setHubProgressActionComplete(value5.getGuildId(),
(require(1314) /* metro dependency 1314: preloaded_user_settings */).HubProgressStep.JOIN_GUILD);
}
}
const lurkerPreviewAnalyticsModule = require(6914) /* metro dependency 6914: LurkerPreviewAnalytics */;
const trackJoinClicked = lurkerPreviewAnalyticsModule.trackJoinClicked;
guildIdBinding = guildId;
const joinSourceBinding = joinSource;
const defaultImport = importDefault(6929) /* metro dependency 6929: LurkerPreviewManager */;
Reflect.apply(trackJoinClicked, lurkerPreviewAnalyticsModule, [guildIdBinding, joinSourceBinding,
defaultImport.hasNavigatedAway(guildIdBinding)]);
if (onBeforeJoin != null) {
onBeforeJoin();
}
value = importDefault(6593) /* metro dependency 6593: GuildActionCreators */;
value.joinGuild(guildId, {source: joinSource});
return value4;
}
function LurkerServerPreviewJoinButtonUsernameHook() { // fn#72819, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9507:936, owner: LurkerServerPreviewJoinButton.usernameHook, offset: 0x01d54e96, size: 45 bytes, params: 1, frame: 11
const value = environment.__proto__;
return (importDefault(3995) /* metro dependency 3995: UserUtils */).getFormattedName(currentUser);
}