293 lines
16 KiB
TypeScript
293 lines
16 KiB
TypeScript
/* Metro module 14880; source: modules/icymi/native/ICYMIServerRecommendationRow.tsx; dependencies: [57, 5, 31, 27, 4502, 1867, 9569, 661, 33, 14815, 697, 566, 1423, 1418, 7599, 5475, 6819, 9580, 3857, 1244, 6593, 4573, 4578, 14854, 8671, 2] */
|
|
function _fun112569(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#112569, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:6, offset: 0x023d285d, size: 381 bytes, params: 8, frame: 19
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_4 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_5 = importAll(31) /* metro dependency 31 */;
|
|
const env0_6 = (require(27) /* metro dependency 27 */).View;
|
|
const accessibilityStore = importDefault(4502) /* metro dependency 4502: AccessibilityStore */;
|
|
const guildStore = importDefault(1867) /* metro dependency 1867: GuildStore */;
|
|
const icymiStore = importDefault(9569) /* metro dependency 9569: ICYMIStore */;
|
|
let value = require(661) /* metro dependency 661: Constants */;
|
|
const env0_10 = value.AnalyticsObjects;
|
|
const env0_11 = value.AnalyticsPages;
|
|
const env0_12 = value.AnalyticsSections;
|
|
const env0_13 = value.GuildFeatures;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_14 = value.jsx;
|
|
const env0_15 = value.jsxs;
|
|
const env0_16 = value.Fragment;
|
|
const env0_17 = (require(14815) /* metro dependency 14815: createICYMIStyles */).createICYMIStyles(_fun112582);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/icymi/native/ICYMIServerRecommendationRow.tsx');
|
|
exports.ICYMIServerRecommendationRow = ICYMIServerRecommendationRow;
|
|
}
|
|
|
|
function CutoutGuildBanner_112570({guild}) { // fn#112570, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:1082, offset: 0x023d29da, size: 526 bytes, params: 2, frame: 27
|
|
var object2;
|
|
const value3 = env0_17();
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const value4 = !useReducedMotion;
|
|
const r15 = guild.banner != null ? (importDefault(1423) /* metro dependency 1423: AvatarUtils */).getAnimatableSourceWithFallback(useReducedMotion ? value4 : guild.features.has(GuildFeatures.ANIMATED_BANNER),
|
|
_fun112572) : undefined;
|
|
const value7 = env0_5.useMemo(_fun112573, [guild]);
|
|
object2 = {style: value3.bannerImage};
|
|
const ClipView = importDefault(7599) /* metro dependency 7599: ClipView */;
|
|
const CutoutShape = (require(7599) /* metro dependency 7599: ClipView */).CutoutShape;
|
|
const RoundedRect = CutoutShape.RoundedRect;
|
|
const clipView = <ClipView cutouts={[{'shape': null, 'x': 8, 'y': 46, 'width': 56, 'height': 56, 'cornerRadius': 20,
|
|
shape: RoundedRect}]}>{guild.banner != null ? ((Component) => <Component style={value3.bannerImage} source={r15} resizeMode="cover" />)(importDefault(5475) /* metro dependency 5475: FastImage */) : <View style={[value3.bannerImage,
|
|
value3.emptyBanner]} />}</ClipView>;
|
|
const GuildIcon = importDefault(6819) /* metro dependency 6819: GuildIcon */;
|
|
const guildIcon = value3.guildIcon;
|
|
const GuildIconSizes = (require(6819) /* metro dependency 6819: GuildIcon */).GuildIconSizes;
|
|
const LARGE = GuildIconSizes.LARGE;
|
|
return (
|
|
<View {...object2}>
|
|
{clipView}
|
|
<GuildIcon
|
|
style={guildIcon}
|
|
guild={value7}
|
|
size={LARGE}
|
|
animate={value4}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function FeaturedServer_112574({guild}) { // fn#112574, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:1794, offset: 0x023d2c5c, size: 552 bytes, params: 2, frame: 30
|
|
const value2 = env0_17();
|
|
const value3 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], _fun112575);
|
|
const value5 = env0_5.useCallback(env0_4(_fun112577), [guild.id]);
|
|
const [property, env0_1] = env0_3(env0_5.useState(false), 2);
|
|
const featuredServerContainer = value2.featuredServerContainer;
|
|
const items2 = [<CutoutGuildBanner_112570 guild={guild} />];
|
|
const featuredServerInnerContainer = value2.featuredServerInnerContainer;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
items2[1] = <View style={featuredServerInnerContainer}><Text maxFontSizeMultiplier={1} lineClamp={1} style={value2.featuredServerTitle} variant="text-md/semibold" color="mobile-text-heading-primary">{guild.name}</Text><Text maxFontSizeMultiplier={1} lineClamp={3} variant="text-xs/normal" color="text-default">{guild.description}</Text></View>;
|
|
const buttonContainer = value2.buttonContainer;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
items2[2] = <View style={buttonContainer}><Button disabled={value3} loading={property} text={value3 ? Reflect.apply(string,
|
|
intl, [t.cEnaWx]) : Reflect.apply(string, intl, [t.VJlc0S])} size="sm" onPress={value5} grow /></View>;
|
|
return (
|
|
<View style={featuredServerContainer}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function RecommendedGuildsRow({discoverableGuilds}) { // fn#112580, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:3466, offset: 0x023d314d, size: 215 bytes, params: 2, frame: 19
|
|
var r0;
|
|
var space;
|
|
var PX_16;
|
|
var value;
|
|
const binding = env0_5;
|
|
const useCallback = binding.useCallback;
|
|
const object = [discoverableGuilds];
|
|
if (discoverableGuilds.length === 0) {
|
|
r0 = null;
|
|
} else {
|
|
value = importDefault(8671) /* metro dependency 8671: FastestListAndroid */;
|
|
var valueProps = {sections: [discoverableGuilds.length]};
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
PX_16 = space.PX_16;
|
|
valueProps.insetStart = PX_16;
|
|
valueProps.renderItem = Reflect.apply(useCallback, binding, [_fun112581, valueProps]);
|
|
valueProps.estimatedListSize = 'windowSize';
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
PX_16 = space.PX_16;
|
|
valueProps.itemSize = 200 + PX_16;
|
|
valueProps.horizontal = true;
|
|
valueProps.listId = 'recommended-servers-list';
|
|
valueProps.showsHorizontalScrollIndicator = false;
|
|
value = ((Component) => <Component {...valueProps} />)(value);
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun112582(a0) { // fn#112582, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:330, offset: 0x023d3256, size: 431 bytes, params: 2, frame: 16
|
|
const object2 = {};
|
|
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object2.container = {marginVertical: PX_24};
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.title = {marginBottom: PX_8, marginHorizontal: a0.margin};
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object2.subtitle = {marginBottom: PX_16, marginHorizontal: a0.margin};
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object2.featuredServerInnerContainer = {marginHorizontal: PX_12, marginTop: 36};
|
|
const object3 = {position: 'absolute'};
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object3.bottom = PX_12;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object3.left = PX_12;
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object3.right = PX_12;
|
|
object2.buttonContainer = object3;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object2.featuredServerTitle = {marginBottom: PX_8};
|
|
object2.guildIcon = {'position': 'absolute', 'top': 50, 'left': 12};
|
|
object2.bannerImage = {'height': 72, 'width': 200};
|
|
const BACKGROUND_MOD_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_MOD_SUBTLE;
|
|
object2.emptyBanner = {backgroundColor: BACKGROUND_MOD_SUBTLE};
|
|
const object4 = {'borderRadius': null, 'backgroundColor': null, 'height': 244, 'width': 200, 'overflow': 'hidden'};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
const CARD_BACKGROUND_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.CARD_BACKGROUND_DEFAULT;
|
|
object4.backgroundColor = CARD_BACKGROUND_DEFAULT;
|
|
object2.featuredServerContainer = object4;
|
|
return object2;
|
|
}
|
|
|
|
function ICYMIServerRecommendationRow() { // fn#112583, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:3985, offset: 0x023d3405, size: 421 bytes, params: 1, frame: 29
|
|
var r0;
|
|
var jsxRuntimeEnv0_16Binding;
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
var string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
var items2;
|
|
const value2 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([ICYMIStore], function() {
|
|
return ICYMIStore.getDiscoverableGuilds();
|
|
});
|
|
const value3 = env0_17();
|
|
if (value2.length === 0) {
|
|
r0 = null;
|
|
} else {
|
|
jsxRuntimeEnv0_16Binding = jsxRuntimeEnv0_16;
|
|
var viewBindingProps = {style: value3.container};
|
|
string = intl.string;
|
|
items2 = [<Text style={value3.title} variant="heading-lg/semibold" color="mobile-text-heading-primary">{Reflect.apply(string,
|
|
|
|
intl, [t.lv1tce])}</Text>];
|
|
string = intl.string;
|
|
items2[1] = <Text style={value3.subtitle} variant="heading-sm/normal" color="text-muted">{Reflect.apply(string,
|
|
intl, [t.x4OezN])}</Text>;
|
|
items2[2] = <RecommendedGuildsRow discoverableGuilds={value2} />;
|
|
r0 = <><View {...viewBindingProps}>{items2}</View>{((Separator) => <Separator />)((require(14854) /* metro dependency 14854: ICYMIShared */).Separator)}</>;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function _fun112572(a0) { // fn#112572, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:1291, offset: 0x023d2be8, size: 71 bytes, params: 2, frame: 14
|
|
let value = environment.__proto__;
|
|
value = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
|
|
const getGuildBannerSource = value.getGuildBannerSource;
|
|
const guildBinding = guild;
|
|
return Reflect.apply(getGuildBannerSource, value, [{id: guildBinding.id, banner: guildBinding.banner}, a0]);
|
|
}
|
|
|
|
function _fun112573() { // fn#112573, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:1375, offset: 0x023d2c2f, size: 45 bytes, params: 1, frame: 11
|
|
let value = environment.__proto__;
|
|
value = require(1418) /* metro dependency 1418: GuildRecordUtils */;
|
|
return value.fromClientDiscoverableGuild(guild);
|
|
}
|
|
|
|
function _fun112575() { // fn#112575, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:1874, offset: 0x023d2e84, size: 38 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
const getGuild = GuildStore.getGuild;
|
|
return Reflect.apply(getGuild, GuildStore, [guild.id]) != null;
|
|
}
|
|
|
|
function* _fun112577() { // fn#112577, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:1922, offset: 0x023d2eb5, size: 525 bytes, params: 1, frame: 24
|
|
var environment;
|
|
var binding4;
|
|
var dehydrated;
|
|
var value11;
|
|
var transitionToGuildSync;
|
|
var object2;
|
|
if (true) {
|
|
value = environment.__proto__;
|
|
importDefault(true);
|
|
var binding = env2_1;
|
|
var binding2 = env2_2;
|
|
binding(binding2[17]).itemInteracted('recommended_guilds', 'recommended_guilds', 'press_join_guild');
|
|
var value5 = binding(binding2[17]);
|
|
var feedItemActioned = value5.feedItemActioned;
|
|
var object3 = {};
|
|
var id = require.id;
|
|
object3.itemId = id;
|
|
object3.itemType = 'recommended_guilds';
|
|
object3.actionParameters = {'actionGestureType': 'press', 'actionTargetElement': 'item_container',
|
|
'actionIntentType': 'join', 'actionDestinationType': 'guild'};
|
|
Reflect.apply(feedItemActioned, value5, [object3]);
|
|
var value6 = binding(binding2[17]);
|
|
yield value6.gravityJoinGuild([require.id], 'recommended_guilds');
|
|
var value7 = undefined;
|
|
if (false) {
|
|
return value7;
|
|
}
|
|
if (value7) {
|
|
object3 = {};
|
|
object3.state = {analyticsSource: {page: env2_11.ICYMI, section: env2_12.ICYMI_RECOMMENDED_SERVERS,
|
|
object: env2_10.LIST_ITEM}};
|
|
binding = env2_1;
|
|
binding4 = env2_2;
|
|
binding(binding4[17]).addedRecommendedGuild();
|
|
dehydrated = binding(binding4[17]).fetchDehydrated({'isReloading': true, 'forceRefresh': true});
|
|
dehydrated.then(env2_4(_fun112579));
|
|
value11 = binding(binding4[20]);
|
|
transitionToGuildSync = value11.transitionToGuildSync;
|
|
id = require.id;
|
|
object2 = {};
|
|
copyDataProperties(object2, object3, undefined);
|
|
yield Reflect.apply(transitionToGuildSync, value11, [id, object2]);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
importDefault(false);
|
|
} else {
|
|
importDefault(false);
|
|
binding = env2_1;
|
|
var binding3 = env2_2;
|
|
value = binding(binding3[18]);
|
|
var open = value.open;
|
|
binding = env2_0;
|
|
var intl = binding(binding3[19]).intl;
|
|
var string = intl.string;
|
|
var CG4Hks = binding(binding3[19]).t.CG4Hks;
|
|
Reflect.apply(open, value, [{key: 'RecommeendedServersRow', content: Reflect.apply(string, intl,
|
|
[CG4Hks])}]);
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun112581(a0, a1) { // fn#112581, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:3541, offset: 0x023d3224, size: 50 bytes, params: 3, frame: 14
|
|
var r0;
|
|
const property = discoverableGuilds[a1];
|
|
let value = null;
|
|
if (value == property) {
|
|
r0 = value;
|
|
} else {
|
|
value = environment.__proto__;
|
|
value = <FeaturedServer_112574 guild={property} />;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
}
|
|
|
|
function* _fun112579() { // fn#112579, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15077:2614, offset: 0x023d30cd, size: 128 bytes, params: 1, frame: 15
|
|
if (true) {
|
|
value = environment.__proto__.__proto__.__proto__.__proto__;
|
|
var value3 = env4_1(env4_2[17]);
|
|
yield value3.reloadICYMITab();
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
var value6 = env4_1(env4_2[17]);
|
|
var getGuildChannelScores = value6.getGuildChannelScores;
|
|
yield Reflect.apply(getGuildChannelScores, value6, []);
|
|
if (false) {
|
|
return undefined;
|
|
}
|
|
env4_1(env4_2[17]).getRecommendedGuilds();
|
|
}
|
|
}
|
|
|