/* Metro module 10718; source: modules/activities/utils/useEmbeddedActivityBackground.tsx; dependencies: [57, 31, 6873, 2] */ import Module00057 from '../../../by-id/module-00057.js'; /* Metro dependency 57 */ 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 ApplicationAssetUtilsModule from '../../../utils/ApplicationAssetUtils.tsx'; /* Metro dependency 6873 */ function _fun82351(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#82351, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10904:6, offset: 0x01ef40ff, size: 147 bytes, params: 8, frame: 18 const env0_0 = require; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_4 = ['embedded_cover', 'embedded_background']; (FileImportTrackerModule).fileFinishedImporting('modules/activities/utils/useEmbeddedActivityBackground.tsx'); exports.default = useEmbeddedActivityBackground; function useEmbeddedActivityBackground({applicationId, size, names, format}) { // fn#82352, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10904:261, offset: 0x01ef4192, size: 287 bytes, params: 2, frame: 27 const r4 = names !== undefined ? names : env0_4; format = format === undefined ? 'png' : format; let env0_2 = undefined; let env0_3 = undefined; var env0_4; let binding = env0_3; let useState = binding.useState; const value2 = Reflect.apply(useState, binding, [null]); const binding2 = env0_2; const value3 = binding2(value2, 2); const property = value3[0]; env0_2 = value3[1]; useState = binding.useState; const value4 = binding2(Reflect.apply(useState, binding, [true]), 2); const property2 = value4[0]; env0_3 = value4[1]; const assetImage = (ApplicationAssetUtilsModule).getAssetImage(applicationId, property, size, format); const r1 = property2 ? 'loading' : assetImage != null ? 'fetched' : 'not-found'; binding = env0_3; env0_4 = binding.useRef(r4); binding.useEffect(_fun82353); binding.useEffect(_fun82354, [applicationId]); return {url: assetImage, state: r1}; function _fun82353() { // fn#82353, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10904:548, offset: 0x01ef42b1, size: 21 bytes, params: 1, frame: 2 env0_4.current = env0_1; } function _fun82354() { // fn#82354, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10904:581, offset: 0x01ef42c6, size: 89 bytes, params: 1, frame: 13 var environment; var value2; var moduleValue; const env0_0 = env0_4.current; if (applicationId != null) { value2 = environment.__proto__; moduleValue = require(6873) /* metro dependency 6873: ApplicationAssetUtils */; moduleValue.getAssets(applicationId).then(_fun82355); } function _fun82355(a0) { // fn#82355, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:10904:638, offset: 0x01ef431f, size: 161 bytes, params: 2, frame: 24 var r4; var property; var value6; var id; var currentBinding; var includes; var name; var value7; env1_3(false); const Object = global.Object; const value2 = Object.entries(a0); let length = value2.length; const value3 = 0; if (value3 < length) { r4 = value3; reducibleLoop1: while (true) { property = value2[r4]; value6 = env2_2(property, 2); value6[value3]; property = value6[1]; if (property != null) { id = property.id; reducibleJoin4: while (true) { if (id === '') { break reducibleJoin4; } currentBinding = current; includes = currentBinding.includes; name = property.name; if (Reflect.apply(includes, currentBinding, [name])) { env1_2(property.id); return undefined; } break reducibleJoin4; } } value7 = typeof r4 === 'bigint' ? r4 + 1n : +r4 + 1; length = value2.length; if (!(value7 < length)) { return undefined; } r4 = value7; continue reducibleLoop1; } } } } } } global.__d(_fun82351, 10718, [57, 31, 6873, 2]) /* metro module 10718, dependencies: [57, 31, 6873, 2] */;