/* Metro module 6819; source: modules/guild/native/GuildIcon.tsx; dependencies: [57, 31, 6820, 1422, 661, 33, 4501, 697, 1861, 6619, 5475, 6821, 290, 2] */ function _fun53594(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53594, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6997:6, offset: 0x01350ad5, size: 1285 bytes, params: 8, frame: 37 var object5; const env0_0 = require; const closure = function(a0) { return {width: a0, height: a0, borderRadius: a0 / 3}; }; const coerceStableAsset = function(a0) { var value = a0; return global.Array.isArray(value) ? value[0]?.uri : value != null ? typeof value === 'number' ? value : value.uri : undefined; }; const Object = global.Object; Object.defineProperty(exports, '__esModule', {value: true}); const env0_3 = importDefault(57) /* metro dependency 57 */; let value = importAll(31) /* metro dependency 31 */; const env0_5 = (require(6820) /* metro dependency 6820: ExpressionSourceRecord */).ExpressionSourceGuildRecord; const guildRecordModule = require(1422) /* metro dependency 1422: GuildRecord */; const env0_6 = guildRecordModule.getGuildIconSource; const env0_7 = guildRecordModule.getGuildAcronym; const Fonts = (require(661) /* metro dependency 661: Constants */).Fonts; const env0_8 = (require(33) /* metro dependency 33 */).jsx; object5 = {XXXSMALL: 'XXXSMALL', XXSMALL_12: 'XXSMALL_12', XXSMALL: 'XXSMALL', XSMALL_20: 'XSMALL_20', XSMALL: 'XSMALL', SMALL: 'SMALL', SMALL_32: 'SMALL_32', SMALL_36: 'SMALL_36', NORMAL: 'NORMAL', LARGE: 'LARGE', XLARGE: 'XLARGE', XXLARGE: 'XXLARGE'}; const object6 = {}; let XXXSMALL = object5.XXXSMALL; object6[XXXSMALL] = [6, 4, 4, 4, 2, 1]; let XXSMALL_12 = object5.XXSMALL_12; object6[XXSMALL_12] = [8, 6, 6, 4, 4, 2]; let XXSMALL = object5.XXSMALL; object6[XXSMALL] = [10, 8, 8, 6, 6, 4]; let XSMALL_20 = object5.XSMALL_20; object6[XSMALL_20] = [12, 10, 10, 8, 8, 6]; let XSMALL = object5.XSMALL; object6[XSMALL] = [16, 16, 16, 14, 14, 12]; let SMALL = object5.SMALL; object6[SMALL] = [16, 16, 16, 14, 14, 12]; let SMALL_32 = object5.SMALL_32; object6[SMALL_32] = [16, 16, 16, 14, 14, 12]; let SMALL_36 = object5.SMALL_36; object6[SMALL_36] = [16, 16, 16, 14, 14, 12]; let NORMAL = object5.NORMAL; object6[NORMAL] = [16, 16, 16, 14, 14, 12]; let LARGE = object5.LARGE; object6[LARGE] = [16, 16, 16, 14, 14, 12]; let XLARGE = object5.XLARGE; object6[XLARGE] = [16, 16, 16, 14, 14, 12]; let XXLARGE = object5.XXLARGE; object6[XXLARGE] = [16, 16, 16, 14, 14, 12]; const object7 = {}; XXXSMALL = object5.XXXSMALL; object7[XXXSMALL] = 10; XXSMALL_12 = object5.XXSMALL_12; object7[XXSMALL_12] = 12; XXSMALL = object5.XXSMALL; object7[XXSMALL] = 16; XSMALL_20 = object5.XSMALL_20; object7[XSMALL_20] = 20; XSMALL = object5.XSMALL; object7[XSMALL] = 24; SMALL = object5.SMALL; object7[SMALL] = 30; SMALL_32 = object5.SMALL_32; object7[SMALL_32] = 32; SMALL_36 = object5.SMALL_36; object7[SMALL_36] = 36; NORMAL = object5.NORMAL; object7[NORMAL] = 40; LARGE = object5.LARGE; object7[LARGE] = 48; XLARGE = object5.XLARGE; object7[XLARGE] = 64; XXLARGE = object5.XXLARGE; object7[XXLARGE] = 80; const createStylesModule = require(4501) /* metro dependency 4501: createStyles */; const createStyles = createStylesModule.createStyles; const object8 = {guildIcon: {'justifyContent': 'center', 'alignItems': 'center', 'overflow': 'hidden'}}; XXXSMALL = object5.XXXSMALL; object8[XXXSMALL] = closure(10); XXSMALL_12 = object5.XXSMALL_12; object8[XXSMALL_12] = closure(12); XXSMALL = object5.XXSMALL; object8[XXSMALL] = closure(16); XSMALL_20 = object5.XSMALL_20; object8[XSMALL_20] = closure(20); XSMALL = object5.XSMALL; object8[XSMALL] = closure(24); SMALL = object5.SMALL; object8[SMALL] = closure(30); SMALL_32 = object5.SMALL_32; object8[SMALL_32] = closure(32); SMALL_36 = object5.SMALL_36; object8[SMALL_36] = closure(36); NORMAL = object5.NORMAL; object8[NORMAL] = closure(40); LARGE = object5.LARGE; object8[LARGE] = closure(48); XLARGE = object5.XLARGE; object8[XLARGE] = closure(64); XXLARGE = object5.XXLARGE; object8[XXLARGE] = closure(80); const BACKGROUND_BRAND = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BRAND; object8['guildTextContainer'] = {backgroundColor: BACKGROUND_BRAND}; const MOBILE_GUILDBAR_ICON_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.MOBILE_GUILDBAR_ICON_BACKGROUND_DEFAULT; object8['guildTextContainerInactive'] = {backgroundColor: MOBILE_GUILDBAR_ICON_BACKGROUND_DEFAULT}; const BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW; object8['guildTextContainerInactiveNested'] = {backgroundColor: BACKGROUND_BASE_LOW}; const INTERACTIVE_TEXT_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_TEXT_DEFAULT; let PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD; object8['guildText'] = {color: INTERACTIVE_TEXT_DEFAULT, fontFamily: PRIMARY_SEMIBOLD}; const object10 = {}; PRIMARY_SEMIBOLD = Fonts.PRIMARY_SEMIBOLD; object10.fontFamily = PRIMARY_SEMIBOLD; const WHITE = (importDefault(697) /* metro dependency 697: native */).colors.WHITE; object10.color = WHITE; object8['guildTextActive'] = object10; object8['guildTextContainerInactiveAlt'] = {backgroundColor: 'transparent'}; const env0_12 = Reflect.apply(createStyles, createStylesModule, [object8]); value = value.memo(GuildIconInner); (require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild/native/GuildIcon.tsx'); exports.default = value; exports.GuildIconSizes = object5; exports.ImageSizes = object7; } function getGuildIconSource_53596(a0, a1, a2, a3) { // fn#53596, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6997:2074, offset: 0x01350ff4, size: 109 bytes, params: 5, frame: 18 const value = null; return value == a0 ? value != a3 ? {uri: a3} : value : value != a0.icon ? a0 instanceof ExpressionSourceGuildRecord ? a0.getIconSource(env0_11[a1], a2) : getGuildIconSource(a0, env0_11[a1], a2) : value != a3 ? {uri: a3} : value; } function GuildIconInner({guild, icon, animate, loadingStyle, size = env0_9.NORMAL, selected, TABS_altDefaultBackground, nested, textStyle, preloadAnimation, value = '', style}) { // fn#53598, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6997:2356, offset: 0x013510b5, size: 928 bytes, params: 2, frame: 39 var r3; var r13; var r0; let value = undefined; icon = icon === value ? null : icon; animate = !(animate === value) && animate; const env0_3 = size; const env0_4 = selected; TABS_altDefaultBackground = !(TABS_altDefaultBackground === value) && TABS_altDefaultBackground; nested = !(nested === value) && nested; const styles = useStyles(); const guildIconSource_53596 = getGuildIconSource_53596(guild, size, animate, icon); let binding = env0_4; const value11 = binding.useRef(guildIconSource_53596); let useState = binding.useState; const value12 = Reflect.apply(useState, binding, [{}]); const binding2 = env0_3; const env0_10 = binding2(value12, 2)[1]; useState = binding.useState; const value14 = binding2(Reflect.apply(useState, binding, [false]), 2); let property = value14[0]; const env0_11 = value14[1]; const env0_12 = binding.useRef(true); const value15 = (importDefault(6619) /* metro dependency 6619: useRefValue */)(value11); const coerceStableAssetBinding = coerceStableAsset; const value16 = coerceStableAssetBinding(value15); const value17 = coerceStableAssetBinding(guildIconSource_53596); const value18 = value16 !== value17; const r12 = value18 ? preloadAnimation && value17 === 'string' : !value18; const value21 = !r12; binding = env0_4; binding.useEffect(function() { return _fun53600; }, []); binding.useEffect(_fun53601, [value21, animate, value18, guild, icon, preloadAnimation, size]); const r15 = r12 ? value15 : guildIconSource_53596; const value22 = r15 == null; const r17 = value22 || property ? value : loadingStyle ?? value; const r16 = value22 ? selected !== false ? value : nested ? styles.guildTextContainerInactiveNested : TABS_altDefaultBackground ? styles.guildTextContainerInactiveAlt : styles.guildTextContainerInactive : value; value = guild != null ? getGuildAcronym(guild) : (require(1861) /* metro dependency 1861: StringUtils */).getAcronym(value); if (value22) { property = env0_10[size]; r3 = value === value ? value : property[value.length]; property = property[property.length - 1]; r13 = r3 ?? property; } else { r13 = value; } const {handleLoaded, wrapperStyle, textComponentStyle} = env0_4.useMemo(_fun53604, [style, size, styles, r17, r16, r13, selected, textStyle, value22]); if (value22) { r0 = ((Component) => {((NativeText) => {value})((require(290) /* metro dependency 290 */).NativeText)})(importDefault(6821) /* metro dependency 6821: NativeView */); } else { value = ((Component) => )(importDefault(5475) /* metro dependency 5475: FastImage */); r0 = value; } return r0; } function _fun53599() { // fn#53599, offset: 0x01351455, size: 9 bytes, params: 1, frame: 1 return _fun53600; } function _fun53601() { // fn#53601, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6997:2835, offset: 0x01351471, size: 148 bytes, params: 1, frame: 20 var environment; let value = environment.__proto__; const guildIconSource_53596 = getGuildIconSource_53596(guild, env0_3, animate, icon); const value4 = coerceStableAsset(guildIconSource_53596); if (env0_14) { if (env0_13) { env0_9.current = guildIconSource_53596; } } else if (env0_13) { if (preloadAnimation) { if (typeof value4 !== 'string') { if (env0_13) { env0_9.current = guildIconSource_53596; } } else { value = importDefault(5475) /* metro dependency 5475: FastImage */; value = value.preload(value4); value.then(function() { global.setTimeout(_fun53603, 0); }); } } else if (env0_13) { env0_9.current = guildIconSource_53596; } } else if (env0_13) { env0_9.current = guildIconSource_53596; } } function _fun53604() { // fn#53604, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6997:3405, offset: 0x01351551, size: 226 bytes, params: 1, frame: 14 const items2 = [styles.guildIcon]; items2[1] = styles[env0_3]; items2[2] = style; if (env0_16 != null) { items2.push(env0_16); } if (env0_15) { items2.unshift(styles.guildTextContainer); } if (env0_17 != null) { items2.push(env0_17); } return {handleLoaded: handleLoaded, wrapperStyle: items2, textComponentStyle: env0_15 ? [selected === false ? styles.guildText : styles.guildTextActive, {fontSize: env0_18}, textStyle] : undefined}; } function _fun53600() { // fn#53600, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6997:2798, offset: 0x0135145e, size: 19 bytes, params: 1, frame: 2 env1_12.current = false; } function _fun53602() { // fn#53602, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6997:2952, offset: 0x01351505, size: 27 bytes, params: 1, frame: 13 global.setTimeout(_fun53603, 0); } function handleLoaded() { // fn#53605, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6997:3531, offset: 0x01351633, size: 18 bytes, params: 1, frame: 11 return env1_11(true); } function _fun53603() { // fn#53603, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6997:2969, offset: 0x01351520, size: 49 bytes, params: 1, frame: 11 var binding; var value2; if (env2_12.current) { binding = env2_9; value2 = environment.__proto__; binding.current = env1_0; binding = env2_10; binding({}); } }