/* Metro module 5198; source: modules/games/hooks/useGame.tsx; dependencies: [5, 31, 5199, 661, 566, 5202, 2] */ import Module00005 from '../../../by-id/module-00005.js'; /* Metro dependency 5 */ import GameStore from '../GameStore.tsx'; /* Metro dependency 5199 */ 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 FluxModule from '../../../external/discord_common/js/packages/flux/index.tsx'; /* Metro dependency 566 */ import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */ function _fun45885(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#45885, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5376:6, offset: 0x0119a6ee, size: 261 bytes, params: 8, frame: 21 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); let value = Module00005; const QueryIds = (ConstantsModule).QueryIds; const createFetchStore = FluxModule.createFetchStore; object = {}; const GAME = QueryIds.GAME; object.getQueryId = GAME; object.get = get_45886; const env0_2 = value(_fun45888); object.load = load_45889; object.getIsLoading = getIsLoading; object.getError = function(a0) { var value = null; return value != a0 && GameStore.didFetchingFail(a0) ? new global.Error('Failed to fetch game data') : value; }; value = Reflect.apply(createFetchStore, FluxModule, [GameStore, object]); (FileImportTrackerModule).fileFinishedImporting('modules/games/hooks/useGame.tsx'); exports.useGame = value; exports.useGames = useGames; function get_45886(a0) { // fn#45886, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5376:199, offset: 0x0119a7f3, size: 97 bytes, params: 2, frame: 14 var r1; var r0; var gameStoreBinding; var game; const value = null; if (value == a0) { r0 = value; } else { gameStoreBinding = GameStore; if (gameStoreBinding.hasNoData(a0)) { r1 = (require(566) /* metro dependency 566: flux */).NO_DATA; } else { game = GameStore.getGame(a0); r1 = value != game ? game : value; } r0 = r1; } return r0; } function* _fun45888(a0) { // fn#45888, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5376:302, offset: 0x0119a85d, size: 81 bytes, params: 2, frame: 13 let value = undefined; if (false) { return value; } if (a0 != null) { value = environment.__proto__; value = env1_0(env1_1[5]); yield value.fetchGamesWithSupplementalData([a0]); value = undefined; if (false) { return value; } } } function load_45889() { // fn#45889, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5376:379, offset: 0x00d6b059, size: 30 bytes, params: 1, frame: 13 return env0_2.apply(this, arguments); } function getIsLoading(a0) { // fn#45890, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5376:436, offset: 0x0119a8ae, size: 32 bytes, params: 2, frame: 12 return a0 != null && GameStore.isFetching(a0); } function useGames(a0) { // fn#45892, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5376:640, offset: 0x0119a919, size: 44 bytes, params: 2, frame: 14 const env0_0 = a0; ReactModule.useEffect(_fun45893, [a0]); function _fun45893() { // fn#45893, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:5376:674, offset: 0x0119a945, size: 67 bytes, params: 1, frame: 15 let binding = env0_0; const value = binding.map(function(a0) { return [a0]; }); binding = env1_5; const fetchMany = binding.fetchMany; const items2 = []; arraySpread(items2, value, 0, undefined); apply(fetchMany, items2, binding, undefined); } } } global.__d(_fun45885, 5198, [5, 31, 5199, 661, 566, 5202, 2]) /* metro module 5198, dependencies: [5, 31, 5199, 661, 566, 5202, 2] */;