/* Metro module 8630; source: modules/emojis/hooks/useEmojiAndSource.tsx; dependencies: [5, 57, 31, 1867, 6540, 6820, 661, 3800, 632, 2] */ import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */ import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */ import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */ import EmojiStore from '../EmojiStore.tsx'; /* Metro dependency 6540 */ import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */ import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */ import * as UseStateFromStoresModule from '../../../external/discord_common/js/packages/flux/useStateFromStores.tsx'; /* Metro dependency 632 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ import * as EmojiTypesModule from '../EmojiTypes.tsx'; /* Metro dependency 3800 */ import * as ExpressionSourceRecordModule from '../records/ExpressionSourceRecord.tsx'; /* Metro dependency 6820 */ function _fun68098(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#68098, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8815:6, offset: 0x01c3e7c4, size: 245 bytes, params: 8, frame: 19 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); (FileImportTrackerModule).fileFinishedImporting('modules/emojis/hooks/useEmojiAndSource.tsx'); exports.useEmojiAndSource = useEmojiAndSource; function useEmojiAndSource({emojiId, refreshPositionKey}) { // fn#68099, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8815:356, offset: 0x01c3e8b9, size: 449 bytes, params: 2, frame: 27 let env0_3 = undefined; let env0_4 = undefined; const {joinedEmojiSourceGuildRecord, emoji} = (UseStateFromStoresModule).useStateFromStoresObject([EmojiStore, GuildStore], _fun68100); const value4 = joinedEmojiSourceGuildRecord != null; const r10 = (value4 ? joinedEmojiSourceGuildRecord != null && joinedEmojiSourceGuildRecord.features.has(GuildFeatures.DISCOVERABLE) : !value4) && emojiId != null; let binding = env0_4; let useState = binding.useState; const value9 = Reflect.apply(useState, binding, [r10]); const binding2 = env0_3; const value10 = binding2(value9, 2); const property = value10[0]; env0_3 = value10[1]; useState = binding.useState; const value11 = binding2(Reflect.apply(useState, binding, [null]), 2); const property2 = value11[0]; env0_4 = value11[1]; const r14 = joinedEmojiSourceGuildRecord != null ? ExpressionSourceGuildRecord.createFromGuildRecord(joinedEmojiSourceGuildRecord) : null; binding = env0_4; const value12 = binding.useState(r14); const binding3 = env0_3; let value = binding3(value12, 2); const property3 = value[0]; const env0_5 = value[1]; useState = binding.useState; value = binding3(Reflect.apply(useState, binding, [null]), 2); const property4 = value[0]; const env0_6 = value[1]; const env0_7 = binding.useRef(refreshPositionKey); binding.useEffect(_fun68101); binding.useEffect(_fun68102, [emojiId, r10]); return {expressionSourceGuild: property3, expressionSourceApplication: property4, sourceType: property2, joinedEmojiSourceGuildRecord: joinedEmojiSourceGuildRecord, hasJoinedEmojiSourceGuild: value4, emoji: emoji, isFetching: property}; function _fun68100() { // fn#68100, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8815:439, offset: 0x01c3ea7a, size: 150 bytes, params: 1, frame: 16 const emojiStoreBinding = EmojiStore; const guildStoreBinding = GuildStore; const emojiIdBinding = emojiId; const value3 = null; const r5 = value3 != emojiIdBinding ? emojiStoreBinding.getCustomEmojiById(emojiIdBinding) : value3; const value5 = undefined; const type = value3 == r5 ? value5 : r5.type; const EmojiTypes = (EmojiTypesModule).EmojiTypes; const GUILD = EmojiTypes.GUILD; return type === GUILD ? {emoji: r5, joinedEmojiSourceGuildRecord: guildStoreBinding.getGuild(value3 == r5 ? value5 : r5.guildId)} : {'emoji': null, 'joinedEmojiSourceGuildRecord': null}; } function _fun68101() { // fn#68101, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8815:1040, offset: 0x01c3eb10, size: 21 bytes, params: 1, frame: 2 env0_7.current = refreshPositionKey; } function _fun68102() { // fn#68102, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8815:1073, offset: 0x01c3eb25, size: 87 bytes, params: 1, frame: 12 if (env0_7.current != null) { env0_7.current(); } if (Module00005) { _fun68103()(); } else if (env0_7.current != null) { env0_7.current(); } function _fun68103() { // fn#68103, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8815:1113, offset: 0x01c3eb7c, size: 36 bytes, params: 1, frame: 12 const env0_0 = env2_2(_fun68105); return _fun68106; function* _fun68105() { // fn#68105, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8815:1133, offset: 0x01c3ebab, size: 196 bytes, params: 1, frame: 17 var r2; var value4; var binding; var value5; var type; var value7; if (true) { value = environment.__proto__.__proto__.__proto__; var value3 = null; if (value3 != require) { value4 = environment.__proto__.__proto__.__proto__.__proto__; binding = env4_9; yield binding(require); value5 = undefined; if (false) { return value5; } r2 = value5; if (value3 != r2) { binding = env3_4; type = r2.type; binding(type); type = r2.type; value7 = environment.__proto__.__proto__.__proto__.__proto__; if (env4_8.APPLICATION === type) { EmojiStore(r2.application); } else if (env4_8.GUILD === type) { GuildStore(r2.guild); } } env3_3(false); if (value3 != ExpressionSourceGuildRecord.current) { ExpressionSourceGuildRecord.current(); } } else { r2 = value3; if (value3 != r2) { binding = env3_4; type = r2.type; binding(type); type = r2.type; value7 = environment.__proto__.__proto__.__proto__.__proto__; if (env4_8.APPLICATION === type) { EmojiStore(r2.application); } else if (env4_8.GUILD === type) { GuildStore(r2.guild); } } env3_3(false); if (value3 != ExpressionSourceGuildRecord.current) { ExpressionSourceGuildRecord.current(); } } } } function _fun68106() { // fn#68106, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:8815:1322, offset: 0x00c3945f, size: 30 bytes, params: 1, frame: 13 return env0_0.apply(this, arguments); } } } } } global.__d(_fun68098, 8630, [5, 57, 31, 1867, 6540, 6820, 661, 3800, 632, 2]) /* metro module 8630, dependencies: [5, 57, 31, 1867, 6540, 6820, 661, 3800, 632, 2] */;