/* Metro module 13240; source: modules/guild_identity/native/EditGuildIdentityAvatar.tsx; dependencies: [31, 1945, 1878, 661, 1880, 33, 4501, 566, 6771, 6789, 8398, 13201, 8403, 3802, 8402, 7882, 4080, 13202, 1962, 13203, 13203, 8396, 5278, 1244, 8417, 13204, 2] */ function _fun100979(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#100979, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:6, offset: 0x0220384f, size: 294 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importAll(31) /* metro dependency 31 */; const guildMemberStore = importDefault(1945) /* metro dependency 1945: GuildMemberStore */; const userStore = importDefault(1878) /* metro dependency 1878: UserStore */; let value = require(661) /* metro dependency 661: Constants */; const env0_6 = value.AnalyticsSections; const env0_7 = value.AnalyticsObjects; const env0_8 = value.UpsellTypes; const env0_9 = (require(1880) /* metro dependency 1880: PremiumConstants */).PremiumUpsellTypes; value = require(33) /* metro dependency 33 */; const env0_10 = value.jsx; const env0_11 = value.jsxs; const env0_12 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({editAvatarIcon: {'position': 'absolute', 'right': 0}}); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_identity/native/EditGuildIdentityAvatar.tsx'); exports.default = EditGuildIdentityAvatar; } function EditGuildIdentityAvatar({userId, guildId, disabled, disableStatus, style, statusStyle, avatarStyle}) { // fn#100980, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:424, offset: 0x02203975, size: 825 bytes, params: 2, frame: 36 var r15; var r0; var PressableOpacity; var intl; var HeaderAvatar; var object3; var value12; var items2; let value = undefined; disableStatus = disableStatus === value || disableStatus; const styles = useStyles(); const fluxModule = require(566) /* metro dependency 566: flux */; const useStateFromStores = fluxModule.useStateFromStores; let object = [UserStore]; const currentUser = Reflect.apply(useStateFromStores, fluxModule, [object, function() { return UserStore.getCurrentUser(); }]); const value4 = fluxModule.useStateFromStores([GuildMemberStore], _fun100982); const defaultImport = importDefault(6771) /* metro dependency 6771: useAnalyticsLocations */; const EDIT_AVATAR = (importDefault(6789) /* metro dependency 6789: AnalyticsLocation */).EDIT_AVATAR; const analyticsLocations = defaultImport(EDIT_AVATAR).analyticsLocations; const env0_3 = analyticsLocations; const {pendingAvatar, pendingAvatarDecoration, setPendingAvatar} = (importDefault(8398) /* metro dependency 8398: usePendingAvatarSettings */)({guildId: guildId, analyticsLocations: analyticsLocations}); const value6 = (importDefault(13201) /* metro dependency 13201: useUploadAvatar */)({guildId: guildId, analyticsLocations: analyticsLocations}); const pendingAvatarSrc = (require(8403) /* metro dependency 8403: RecentAvatarUtils */).getPendingAvatarSrc({userId: userId, image: pendingAvatar}); const canUsePremiumGuildMemberProfile2 = (importDefault(3802) /* metro dependency 3802: PremiumUtils */).canUsePremiumGuildMemberProfile(currentUser); const defaultImport5 = importDefault(3802) /* metro dependency 3802: PremiumUtils */; const value8 = !defaultImport5.canUseAnimatedAvatar(currentUser); const value10 = (require(8402) /* metro dependency 8402: ProfileCustomizationUtils */).showRemoveAvatar(pendingAvatar, value4 == null ? value : value4.avatar); const r21 = value !== pendingAvatarDecoration ? pendingAvatarDecoration : value4 == null ? value : value4.avatarDecoration; const binding = env0_3; const useCallback = binding.useCallback; if (currentUser == null) { r0 = null; } else { PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity; object = {style: style, disabled: disabled, onPress: Reflect.apply(useCallback, binding, [_fun100983, [guildId, value4, currentUser, canUsePremiumGuildMemberProfile2, value8, value10, r21, analyticsLocations, value6, setPendingAvatar]]), accessibilityRole: 'button'}; intl = (require(1244) /* metro dependency 1244: indexNative */).intl; object.accessibilityLabel = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['70lEQe']); HeaderAvatar = importDefault(8417) /* metro dependency 8417: HeaderAvatar */; object3 = {user: currentUser}; value12 = pendingAvatar === null; r15 = value12 ? value : guildId; object3.guildId = r15; r15 = value12 ? value : pendingAvatarSrc; object3.pendingAvatarSrc = r15; object3.pendingAvatarDecoration = pendingAvatarDecoration; object3.statusStyle = statusStyle; object3.disableStatus = disableStatus; object3.style = avatarStyle; items2 = []; items2[1] = !disabled && ((Component) => )(importDefault(13204) /* metro dependency 13204: EditIcon */); value = {items2}; r0 = value; } return r0; } function _fun100982() { // fn#100982, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:648, offset: 0x02203cae, size: 65 bytes, params: 1, frame: 16 const currentUserBinding = currentUser; const value2 = null; return value2 != currentUserBinding ? GuildMemberStore.getMember(guildId, value2 == currentUser ? undefined : currentUser.id) : value2; } function _fun100983() { // fn#100983, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:1163, offset: 0x02203cef, size: 300 bytes, params: 1, frame: 20 var environment; var binding; var value4; var defaultImport2; if (env0_2 != null && currentUser != null) { binding = env0_6; value4 = environment.__proto__; if (binding) { defaultImport2 = importDefault(dependencyMap[16]); defaultImport2.openLazy(require(dependencyMap[18])(dependencyMap[17], dependencyMap.paths), 'Change Avatar', {handleUploadAvatarSelect: env0_5, handleRemoveAvatarSelect: handleRemoveAvatarSelect_100984, handleUploadGIFAvatarSelect: handleUploadGIFAvatarSelect_100985, handleEditAvatarDecorationSelect: handleEditAvatarDecorationSelect_100986, showAnimatedAvatarUpsell: env0_7, showRemoveAvatar: env0_8}); } else { importDefault(dependencyMap[15]).handleShowUpsellAlert({initialUpsellKey: UpsellTypes.PREMIUM_GUILD_PROFILE, analyticsLocation: {section: AnalyticsSections.PREMIUM_GUILD_MEMBER_PROFILE, object: AnalyticsObjects.EDIT_GUILD_PROFILE_AVATAR}, analyticsLocations: analyticsLocations, analyticsProperties: {type: PremiumUpsellTypes.PREMIUM_GUILD_IDENTITY_MODAL}}); } } } function handleRemoveAvatarSelect_100984() { // fn#100984, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:1300, offset: 0x02203e1b, size: 51 bytes, params: 1, frame: 11 let value = environment.__proto__.__proto__; (importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */).hideActionSheet(); value = environment.__proto__; setPendingAvatar(null); } function handleUploadGIFAvatarSelect_100985() { // fn#100985, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:1369, offset: 0x02203e4e, size: 167 bytes, params: 1, frame: 19 let value = environment.__proto__.__proto__; importDefault(dependencyMap[16]).hideActionSheet(); const defaultImport2 = importDefault(dependencyMap[16]); const openLazy = defaultImport2.openLazy; value = require(dependencyMap[18]); value = value(dependencyMap[19], dependencyMap.paths); const object2 = {}; const ProfileAssetType = require(dependencyMap[20]).ProfileAssetType; const AVATAR = ProfileAssetType.AVATAR; object2.profileAssetType = AVATAR; const GIFSelectionContext = require(dependencyMap[20]).GIFSelectionContext; const PROFILE_EDIT = GIFSelectionContext.PROFILE_EDIT; object2.selectionContext = PROFILE_EDIT; object2.guildId = guildId; Reflect.apply(openLazy, defaultImport2, [value, 'Select GIF Avatar', object2]); } function handleEditAvatarDecorationSelect_100986() { // fn#100986, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:13430:1619, offset: 0x02203ef5, size: 77 bytes, params: 1, frame: 14 const value = environment.__proto__.__proto__; (require(8396) /* metro dependency 8396: AvatarDecorationUtils */).openAvatarDecorationActionSheet({user: currentUser, guildId: guildId, currentAvatarDecoration: env1_9, analyticsLocations: analyticsLocations}); }