393 lines
22 KiB
TypeScript
393 lines
22 KiB
TypeScript
/* Metro module 6790; source: modules/guild_onboarding/native/GuildOnboardingCompleted.tsx; dependencies: [31, 27, 4502, 1938, 1867, 1878, 6603, 33, 4501, 697, 1484, 566, 6736, 3868, 6791, 1423, 1852, 1360, 4017, 4504, 5475, 6618, 4573, 1244, 1305, 6792, 6819, 3738, 6822, 2] */
|
|
import GuildStore from '../../../stores/GuildStore.tsx'; /* Metro dependency 1867 */
|
|
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
|
|
import GuildRoleStore from '../../../stores/GuildRoleStore.tsx'; /* Metro dependency 1938 */
|
|
import ReanimatedRexport from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import AccessibilityStore from '../../a11y/AccessibilityStore.tsx'; /* Metro dependency 4502 */
|
|
import GuildOnboardingPromptsStore from '../GuildOnboardingPromptsStore.tsx'; /* Metro dependency 6603 */
|
|
import UseGuildRoleMemberCounts from '../../guild_role_subscriptions/useGuildRoleMemberCounts.tsx'; /* Metro dependency 6736 */
|
|
import GuildIcon from '../../guild/native/GuildIcon.tsx'; /* Metro dependency 6819 */
|
|
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
|
|
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
|
|
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
|
|
import * as NativeModule from '../../../design/void/native.tsx'; /* Metro dependency 1305 */
|
|
import * as GlobalUtilsModule from '../../../utils/GlobalUtils.tsx'; /* Metro dependency 1360 */
|
|
import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
|
|
import * as NativeModule2 from '../../../external/discord_common/js/packages/design/native.tsx'; /* Metro dependency 3868 */
|
|
import * as ReanimatedRexportModule from '../../reanimated/ReanimatedRexport.tsx'; /* Metro dependency 4017 */
|
|
import * as TimingModule from '../../../design/animation/reanimated/timing/timing.tsx'; /* Metro dependency 4504 */
|
|
import * as TextModule from '../../../design/components/Text/native/Text.tsx'; /* Metro dependency 4573 */
|
|
import * as SafeAreaViewModule from '../../../components_native/common/SafeAreaView.tsx'; /* Metro dependency 6618 */
|
|
import * as UserProfileRolesCardModule from '../../user_profile/native/UserProfileRolesCard.tsx'; /* Metro dependency 6792 */
|
|
import * as GuildIconModule from '../../guild/native/GuildIcon.tsx'; /* Metro dependency 6819 */
|
|
|
|
function _fun53451(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#53451, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:6, offset: 0x0134b5bc, size: 747 bytes, params: 8, frame: 26
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactNativeModule;
|
|
const StyleSheet = value.StyleSheet;
|
|
const env0_4 = value.View;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object = {screen: {'flex': 1, 'position': 'relative'}, container: {'backgroundColor': 'rgba(0, 0, 0, 0.5)',
|
|
'paddingHorizontal': 24, 'display': 'flex', 'justifyContent': 'center', 'flexGrow': 1}};
|
|
const BACKGROUND_BASE_LOWEST = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOWEST;
|
|
object.containerWithoutSplash = {backgroundColor: BACKGROUND_BASE_LOWEST};
|
|
object.backgroundImage = {'position': 'absolute', 'width': '100%', 'height': '100%'};
|
|
object.title = {};
|
|
object.subtitle = {marginTop: 16};
|
|
const object4 = {'marginTop': 24, 'padding': 16, 'paddingBottom': 32};
|
|
object4.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
const BACKGROUND_SURFACE_HIGH = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_SURFACE_HIGH;
|
|
object4.backgroundColor = BACKGROUND_SURFACE_HIGH;
|
|
object.card = object4;
|
|
object.username = {marginTop: 16};
|
|
object.rolesHeader = {marginTop: 8};
|
|
object.roles = {'marginTop': 12, 'display': 'flex', 'flexDirection': 'row', 'flexWrap': 'wrap'};
|
|
object.role = {marginRight: 8};
|
|
const object7 = {'paddingHorizontal': 8, 'height': 28, 'borderRadius': null, 'display': 'flex',
|
|
'justifyContent': 'center'};
|
|
object7.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.xs;
|
|
object7.borderWidth = StyleSheet.hairlineWidth;
|
|
let BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object7.borderColor = BORDER_SUBTLE;
|
|
object.roleOverflow = object7;
|
|
const object8 = {'marginTop': 24, 'borderColor': null, 'borderWidth': 2, 'borderRadius': null, 'padding': 12,
|
|
'display': 'flex', 'flexDirection': 'row', 'alignItems': 'center'};
|
|
BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object8.borderColor = BORDER_SUBTLE;
|
|
object8.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.sm;
|
|
object.animation = object8;
|
|
object.wave = {transform: [{translateX: 24}, {rotate: '5deg'}]};
|
|
object.animationText = {'flexGrow': 1, 'marginLeft': 8};
|
|
const env0_12 = Reflect.apply(createStyles, value, [object]);
|
|
object = {code: "function GuildOnboardingCompletedTsx1(){const{withSequence,withTiming,withDelay,ANIMATION_DURATION,Easing,useReducedMotion}=this.__closure;const opacity=withSequence(withTiming(0,{duration:0}),withDelay(ANIMATION_DURATION,withTiming(0.5,{duration:ANIMATION_DURATION})),withTiming(1,{duration:ANIMATION_DURATION,easing:Easing.out(Easing.ease)}));const scale=withSequence(withTiming(1,{duration:0}),withDelay(ANIMATION_DURATION,withTiming(1.5,{duration:ANIMATION_DURATION,easing:Easing.out(Easing.ease)})),withTiming(1,{duration:useReducedMotion?1:ANIMATION_DURATION,easing:Easing.out(Easing.ease)}));const rawRotation=withSequence(withTiming('0deg',{duration:0}),withDelay(ANIMATION_DURATION,withTiming('-2deg',{duration:ANIMATION_DURATION})),withTiming('-5deg',{duration:ANIMATION_DURATION}));return{opacity:opacity,transform:[{rotate:rawRotation},{scale:scale}]};}"};
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/guild_onboarding/native/GuildOnboardingCompleted.tsx');
|
|
exports.default = GuildOnboardingCompleted;
|
|
function GuildOnboardingCompleted({guildId, prompts, completeOnboarding, onClose}) { // fn#53452, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:2290, offset: 0x0134b8a7, size: 2256 bytes, params: 2, frame: 49
|
|
var object8;
|
|
var r18;
|
|
var defaultImport;
|
|
var getGuildSplashURL;
|
|
var object;
|
|
const styles = useStyles();
|
|
const styles2 = styles;
|
|
const value3 = (UseNavigationNativeModule).useNavigation();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const guild = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildStore], function() {
|
|
return GuildStore.getGuild(guildId);
|
|
});
|
|
const value4 = (UseGuildRoleMemberCounts)(guildId);
|
|
const nativeModule = NativeModule2;
|
|
const useThemeContext = nativeModule.useThemeContext;
|
|
object8 = {backgroundColor: (require(6791) /* metro dependency 6791: useProfileThemeValuesNative */).useProfileThemeValues(Reflect.apply(useThemeContext,
|
|
nativeModule, []).theme)?.rolePillBackgroundColor};
|
|
if (guild != null) {
|
|
defaultImport = importDefault(1423) /* metro dependency 1423: AvatarUtils */;
|
|
getGuildSplashURL = defaultImport.getGuildSplashURL;
|
|
object = {};
|
|
object.id = guild.id;
|
|
object.splash = guild.splash;
|
|
object.size = 400 * (importDefault(1852) /* metro dependency 1852: getDevicePixelRatioNative */)();
|
|
r18 = Reflect.apply(getGuildSplashURL, defaultImport, [object]);
|
|
} else {
|
|
r18 = null;
|
|
}
|
|
const env0_7 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([GuildOnboardingPromptsStore],
|
|
function() {
|
|
return GuildOnboardingPromptsStore.getOnboardingResponses(guildId);
|
|
}, [guildId]);
|
|
const value11 = prompts.map(function(a0) {
|
|
return a0.options;
|
|
}).flat().filter(_fun53457);
|
|
const binding = styles2;
|
|
const {numSharedRoleMembers, allSelectedRoleIds} = binding.useMemo(_fun53458, [value4, value11]);
|
|
const value13 = (require(566) /* metro dependency 566: flux */).useStateFromStoresArray([GuildRoleStore],
|
|
function() {
|
|
return GuildRoleStore.getManyRoles(guildId, allSelectedRoleIds);
|
|
}, [allSelectedRoleIds, guildId]);
|
|
binding.useLayoutEffect(_fun53462, [value3]);
|
|
binding.useEffect(function() {
|
|
global.setTimeout(_fun53465, 3600);
|
|
}, [completeOnboarding, onClose]);
|
|
const useReducedMotion = (require(566) /* metro dependency 566: flux */).useStateFromStores([AccessibilityStore],
|
|
function() {
|
|
return AccessibilityStore.useReducedMotion;
|
|
});
|
|
const useAnimatedStyle = ReanimatedRexportModule.useAnimatedStyle;
|
|
const GuildOnboardingCompletedB2 = GuildOnboardingCompletedB;
|
|
const object2 = {};
|
|
object2.withSequence = ReanimatedRexportModule.withSequence;
|
|
object2.withTiming = (require(4504) /* metro dependency 4504: timing */).withTiming;
|
|
object2.withDelay = ReanimatedRexportModule.withDelay;
|
|
object2.ANIMATION_DURATION = 400;
|
|
const Easing = ReanimatedRexportModule.Easing;
|
|
object2.Easing = Easing;
|
|
object2.useReducedMotion = useReducedMotion;
|
|
GuildOnboardingCompletedB2.__closure = object2;
|
|
GuildOnboardingCompletedB2.__workletHash = 8282245217026;
|
|
GuildOnboardingCompletedB2.__initData = env0_13;
|
|
const value14 = Reflect.apply(useAnimatedStyle, ReanimatedRexportModule, [GuildOnboardingCompletedB2]);
|
|
if (currentUser == null) {
|
|
return null;
|
|
}
|
|
if (guild == null) {
|
|
return null;
|
|
}
|
|
const value15 = value13.length - 3;
|
|
const r6 = (
|
|
r18 != null
|
|
? ((Component) => <Component source={{uri: r18}} style={styles.backgroundImage} />)(importDefault(5475) /* metro dependency 5475: FastImage */)
|
|
: null
|
|
);
|
|
const SafeAreaPaddingView = (SafeAreaViewModule).SafeAreaPaddingView;
|
|
const items10 = [styles.container];
|
|
items10[1] = r18 == null ? styles.containerWithoutSplash : null;
|
|
const Text = (TextModule).Text;
|
|
const value17 = 'always-white';
|
|
const r13 = r18 == null ? 'mobile-text-heading-primary' : value17;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const PFWIYe = (require(1244) /* metro dependency 1244: indexNative */).t.PFWIYe;
|
|
const items11 = [
|
|
<Text
|
|
style={styles.title}
|
|
accessibilityRole="header"
|
|
variant="heading-xxl/extrabold"
|
|
color={r13}
|
|
>
|
|
{Reflect.apply(string, intl, [PFWIYe])}
|
|
</Text>,
|
|
];
|
|
items11[1] = (
|
|
<Text
|
|
style={styles.subtitle}
|
|
accessibilityRole="header"
|
|
variant="text-md/medium"
|
|
color={r18 == null ? 'text-muted' : value17}
|
|
>
|
|
{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.og4NNr)}
|
|
</Text>
|
|
);
|
|
const Avatar = (NativeModule).Avatar;
|
|
const AvatarSizes = (NativeModule).AvatarSizes;
|
|
const XXLARGE = AvatarSizes.XXLARGE;
|
|
const items12 = [
|
|
<Avatar
|
|
size={XXLARGE}
|
|
user={currentUser}
|
|
guildId={guildId}
|
|
animate={false}
|
|
/>,
|
|
];
|
|
const object3 = {'style': null, 'variant': 'heading-xl/semibold', 'color': 'mobile-text-heading-primary'};
|
|
let username = styles.username;
|
|
object3.style = username;
|
|
username = currentUser.username;
|
|
items12[1] = (
|
|
<Text {...object3}>
|
|
{username}
|
|
</Text>
|
|
);
|
|
items12[2] = (
|
|
numSharedRoleMembers > 0
|
|
? (
|
|
<Text
|
|
style={styles.rolesHeader}
|
|
variant="text-sm/normal"
|
|
color="text-muted"
|
|
>
|
|
{intl.format((require(1244) /* metro dependency 1244: indexNative */).t.l1Jc1n,
|
|
{numSharedRoleMembers: numSharedRoleMembers})}
|
|
</Text>
|
|
)
|
|
: null
|
|
);
|
|
items12[3] = (
|
|
<View style={styles.roles}>
|
|
{value13.slice(0, 3).map(_fun53468)}
|
|
{
|
|
value15 > 0
|
|
? (
|
|
<View style={[styles.roleOverflow, object8]}>
|
|
<Text variant="heading-deprecated-12/semibold" color="mobile-text-heading-primary">
|
|
{'+' + value15}
|
|
</Text>
|
|
</View>
|
|
)
|
|
: null
|
|
}
|
|
</View>
|
|
);
|
|
const View2 = (ReanimatedRexport).View;
|
|
const items15 = [styles.animation, value14];
|
|
const GuildIconSizes = (GuildIconModule).GuildIconSizes;
|
|
const LARGE = GuildIconSizes.LARGE;
|
|
const items16 = [
|
|
<GuildIcon guild={guild} size={LARGE} />,
|
|
];
|
|
const format = intl.format;
|
|
const FXREhf = (require(1244) /* metro dependency 1244: indexNative */).t.FXREhf;
|
|
items16[1] = (
|
|
<View style={styles.animationText}>
|
|
<Text variant="text-sm/medium" color="mobile-text-heading-primary">
|
|
{Reflect.apply(format, intl, [FXREhf, {guildName: guild.name}])}
|
|
</Text>
|
|
<Text variant="text-xs/normal" color="text-muted">
|
|
{'' + (importDefault(3738) /* metro dependency 3738 */)().format('LL')}
|
|
</Text>
|
|
</View>
|
|
);
|
|
items16[2] = ((Component) => <Component source={importDefault(6822) /* metro dependency 6822 */} style={styles.wave} />)(importDefault(5475) /* metro dependency 5475: FastImage */);
|
|
items12[4] = (
|
|
<View2 style={items15}>
|
|
{items16}
|
|
</View2>
|
|
);
|
|
items11[2] = (
|
|
<View style={styles.card}>
|
|
{items12}
|
|
</View>
|
|
);
|
|
return (
|
|
<View style={styles.screen}>
|
|
{r6}
|
|
<SafeAreaPaddingView bottom style={items10}>
|
|
<View>
|
|
{items11}
|
|
</View>
|
|
</SafeAreaPaddingView>
|
|
</View>
|
|
);
|
|
function _fun53457({id}) { // fn#53457, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:2882, offset: 0x0134c1bf, size: 27 bytes, params: 2, frame: 11
|
|
return env0_7.includes(id);
|
|
}
|
|
|
|
function _fun53458() { // fn#53458, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:2917, offset: 0x0134c1da, size: 174 bytes, params: 1, frame: 18
|
|
var r2;
|
|
var Math;
|
|
var max;
|
|
var value6;
|
|
var items2;
|
|
const value3 = env0_8.map(function(a0) {
|
|
return a0.roleIds;
|
|
}).flat();
|
|
const value5 = value3.filter((GlobalUtilsModule).isNotNullish);
|
|
let value = 0;
|
|
if (env0_6 != null) {
|
|
if (value5.length > value) {
|
|
Math = global.Math;
|
|
max = Math.max;
|
|
value6 = value5.map(_fun53460);
|
|
items2 = [];
|
|
arraySpread(items2, value6, value, value);
|
|
value = apply(max, items2, Math, value);
|
|
r2 = value;
|
|
} else {
|
|
r2 = value;
|
|
}
|
|
} else {
|
|
r2 = value;
|
|
}
|
|
return {numSharedRoleMembers: r2, allSelectedRoleIds: value5};
|
|
function _fun53460(a0) { // fn#53460, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:3054, offset: 0x0134c288, size: 30 bytes, params: 2, frame: 3
|
|
const value = environment.__proto__;
|
|
return env1_6[a0] ?? 0;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun53462() { // fn#53462, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:3266, offset: 0x0134c2c6, size: 36 bytes, params: 1, frame: 12
|
|
env0_4.setOptions({headerLeft: function() {
|
|
return null;
|
|
}});
|
|
}
|
|
|
|
function _fun53464() { // fn#53464, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:3327, offset: 0x0134c2ea, size: 31 bytes, params: 1, frame: 13
|
|
global.setTimeout(function() {
|
|
completeOnboarding();
|
|
onClose();
|
|
}, 3600);
|
|
function _fun53465() { // fn#53465, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:3344, offset: 0x0134c309, size: 23 bytes, params: 1, frame: 10
|
|
completeOnboarding();
|
|
onClose();
|
|
}
|
|
|
|
}
|
|
|
|
function GuildOnboardingCompletedB() { // fn#53467, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:3472, owner: GuildOnboardingCompleted.B, offset: 0x0134c32f, size: 649 bytes, params: 1, frame: 31
|
|
let value = environment.__proto__;
|
|
let withSequence = ReanimatedRexportModule.withSequence;
|
|
let withTiming = TimingModule.withTiming;
|
|
const value2 = Reflect.apply(withTiming, TimingModule, [0, {duration: 0}]);
|
|
let withDelay = ReanimatedRexportModule.withDelay;
|
|
withTiming = TimingModule.withTiming;
|
|
const value3 = 400;
|
|
const value4 = Reflect.apply(withDelay, ReanimatedRexportModule, [value3, Reflect.apply(withTiming, TimingModule, [0.5,
|
|
{duration: value3}])]);
|
|
withTiming = TimingModule.withTiming;
|
|
object = {duration: value3};
|
|
const Easing = ReanimatedRexportModule.Easing;
|
|
let out = Easing.out;
|
|
const Easing2 = ReanimatedRexportModule.Easing;
|
|
object.easing = Reflect.apply(out, Easing, [Easing2.ease]);
|
|
const value5 = 1;
|
|
const value6 = Reflect.apply(withSequence, ReanimatedRexportModule, [value2, value4, Reflect.apply(withTiming,
|
|
TimingModule, [value5, object])]);
|
|
withSequence = ReanimatedRexportModule.withSequence;
|
|
const value7 = TimingModule.withTiming(value5, {duration: 0});
|
|
withDelay = ReanimatedRexportModule.withDelay;
|
|
withTiming = TimingModule.withTiming;
|
|
object = {duration: value3};
|
|
out = Easing.out;
|
|
const Easing3 = ReanimatedRexportModule.Easing;
|
|
object.easing = Reflect.apply(out, Easing, [Easing3.ease]);
|
|
const value8 = Reflect.apply(withDelay, ReanimatedRexportModule, [value3, Reflect.apply(withTiming, TimingModule, [1.5,
|
|
object])]);
|
|
withTiming = TimingModule.withTiming;
|
|
object = {};
|
|
object.duration = useReducedMotion ? value5 : value3;
|
|
out = Easing.out;
|
|
const Easing4 = ReanimatedRexportModule.Easing;
|
|
object.easing = Reflect.apply(out, Easing, [Easing4.ease]);
|
|
value = Reflect.apply(withSequence, ReanimatedRexportModule, [value7, value8, Reflect.apply(withTiming, TimingModule, [value5,
|
|
object])]);
|
|
object = {opacity: value6};
|
|
withSequence = ReanimatedRexportModule.withSequence;
|
|
const value10 = TimingModule.withTiming('0deg', {duration: 0});
|
|
withDelay = ReanimatedRexportModule.withDelay;
|
|
const value11 = Reflect.apply(withDelay, ReanimatedRexportModule, [value3, TimingModule.withTiming('-2deg',
|
|
{duration: value3})]);
|
|
object.transform = [{rotate: Reflect.apply(withSequence, ReanimatedRexportModule, [value10, value11,
|
|
TimingModule.withTiming('-5deg', {duration: value3})])}, {scale: value}];
|
|
return object;
|
|
}
|
|
|
|
function _fun53468(a0) { // fn#53468, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:6968:5492, offset: 0x0134c5b8, size: 112 bytes, params: 2, frame: 19
|
|
const viewBindingProps = {style: styles.role};
|
|
const RoleItem = (UserProfileRolesCardModule).RoleItem;
|
|
return (
|
|
<View {...viewBindingProps} key={a0.id}>
|
|
<RoleItem
|
|
role={a0}
|
|
guildId={guild.id}
|
|
disableInteraction
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun53451, 6790, [31, 27, 4502, 1938, 1867, 1878, 6603, 33, 4501, 697, 1484, 566, 6736, 3868, 6791, 1423,
|
|
1852, 1360, 4017, 4504, 5475, 6618, 4573, 1244, 1305, 6792, 6819, 3738, 6822,
|
|
2]) /* metro module 6790, dependencies: [31, 27, 4502, 1938, 1867, 1878, 6603, 33, 4501, 697, 1484, 566, 6736, 3868, 6791, 1423, 1852, 1360, 4017, 4504, 5475, 6618, 4573, 1244, 1305, 6792, 6819, 3738, 6822, 2] */;
|