259 lines
12 KiB
TypeScript
259 lines
12 KiB
TypeScript
// Module ID: 5592
|
|
// Function ID: 5593
|
|
// Name: GuildOnboardingConnectionPrompt
|
|
// Dependencies: [19, 17, 5218, 5203, 4949, 1862, 5195, 5196, 5192, 676, 21, 4255, 5220, 712, 1480, 1581, 589, 5202, 698, 4449, 5194, 5257, 4251, 1236, 5593, 5615, 4665, 2]
|
|
// Exports: default
|
|
|
|
// Module 5592 (GuildOnboardingConnectionPrompt)
|
|
import collectGuildAnalyticsMetadata from "collectGuildAnalyticsMetadata";
|
|
import get_ActivityIndicator from "isChattableChannel";
|
|
import get from "get";
|
|
import recomputeFromAppTokens from "recomputeFromAppTokens";
|
|
import set from "set";
|
|
import createGuildRecordFromRust from "createGuildRecordFromRust";
|
|
import handleUpdate from "handleUpdate";
|
|
import { OnboardingConnectionType } from "serverPromptToClientPrompt";
|
|
import { GuildOnboardingModalStates as closure_12 } from "GUILD_ONBOARDING_MODAL_KEY";
|
|
import { AnalyticEvents } from "ME";
|
|
import jsxProd from "SafeAreaPaddingView";
|
|
import createCacheKey from "createCacheKey";
|
|
|
|
let c4;
|
|
let c5;
|
|
let closure_14;
|
|
let closure_15;
|
|
const require = arg1;
|
|
({ View: c4, ScrollView: c5 } = get_ActivityIndicator);
|
|
({ jsx: closure_14, jsxs: closure_15 } = jsxProd);
|
|
createCacheKey = { flex: { flex: 1 }, container: null, scrollContainer: null, header: null, title: null, description: null, connectionsList: null, footer: null, footerContent: null };
|
|
createCacheKey = { display: "flex", flex: 1, flexGrow: 1, marginTop: require("NAV_BAR_HEIGHT").NAV_BAR_HEIGHT, marginBottom: require("Themes").space.PX_16, backgroundColor: require("Themes").colors.BACKGROUND_BASE_LOWER };
|
|
createCacheKey[1] = createCacheKey;
|
|
createCacheKey[2] = { display: "flex", flexGrow: 1, paddingHorizontal: require("Themes").space.PX_16, paddingTop: require("Themes").space.PX_16, backgroundColor: require("Themes").colors.BACKGROUND_BASE_LOWER };
|
|
let obj1 = { display: "flex", flexGrow: 1, paddingHorizontal: require("Themes").space.PX_16, paddingTop: require("Themes").space.PX_16, backgroundColor: require("Themes").colors.BACKGROUND_BASE_LOWER };
|
|
createCacheKey[3] = { marginBottom: require("Themes").space.PX_24 };
|
|
let obj2 = { marginBottom: require("Themes").space.PX_24 };
|
|
createCacheKey[4] = { marginBottom: require("Themes").space.PX_8 };
|
|
let obj3 = { marginBottom: require("Themes").space.PX_8 };
|
|
createCacheKey[5] = { marginTop: require("Themes").space.PX_8 };
|
|
let obj4 = { marginTop: require("Themes").space.PX_8 };
|
|
createCacheKey[6] = { marginTop: require("Themes").space.PX_8 };
|
|
let obj5 = { marginTop: require("Themes").space.PX_8 };
|
|
createCacheKey[7] = { display: "flex", flexDirection: "column", justifyContent: "flex-end", alignItems: "center", bottom: 0, paddingBottom: require("Themes").space.PX_8, position: "absolute", width: "100%", backgroundColor: require("Themes").colors.BACKGROUND_BASE_LOWER };
|
|
let obj6 = { display: "flex", flexDirection: "column", justifyContent: "flex-end", alignItems: "center", bottom: 0, paddingBottom: require("Themes").space.PX_8, position: "absolute", width: "100%", backgroundColor: require("Themes").colors.BACKGROUND_BASE_LOWER };
|
|
createCacheKey[8] = { width: "100%", paddingHorizontal: require("Themes").space.PX_16 };
|
|
createCacheKey = createCacheKey.createStyles(createCacheKey);
|
|
let obj7 = { width: "100%", paddingHorizontal: require("Themes").space.PX_16 };
|
|
const result = require("get").fileFinishedImporting("modules/guild_onboarding/native/GuildOnboardingConnectionPrompt.tsx");
|
|
|
|
export default function GuildOnboardingConnectionPrompt(guildId) {
|
|
guildId = guildId.guildId;
|
|
const onComplete = guildId.onComplete;
|
|
const isLastStep = guildId.isLastStep;
|
|
let navigation;
|
|
let closure_4;
|
|
let stateFromStores;
|
|
let stateFromStoresArray;
|
|
let stateFromStores1;
|
|
let stateFromStores2;
|
|
let stateFromStores3;
|
|
let stateFromStores4;
|
|
let tmp = createCacheKey();
|
|
let obj = guildId(isLastStep[14]);
|
|
navigation = obj.useNavigation();
|
|
const bottom = onComplete(isLastStep[15])().bottom;
|
|
const sum = 64 + bottom;
|
|
const sum1 = sum + onComplete(isLastStep[13]).space.PX_8;
|
|
closure_4 = navigation.useRef(false);
|
|
let obj1 = guildId(isLastStep[16]);
|
|
const items = [stateFromStores4];
|
|
stateFromStores = obj1.useStateFromStores(items, () => stateFromStores4.getOnboardingConnections(guildId));
|
|
let obj2 = guildId(isLastStep[16]);
|
|
const items1 = [stateFromStores4];
|
|
stateFromStoresArray = obj2.useStateFromStoresArray(items1, () => stateFromStores4.getOnboardingPromptsForOnboarding(guildId));
|
|
let obj3 = guildId(isLastStep[16]);
|
|
const items2 = [stateFromStores3];
|
|
stateFromStores1 = obj3.useStateFromStores(items2, () => stateFromStores3.getGuild(guildId));
|
|
let obj4 = guildId(isLastStep[16]);
|
|
const items3 = [stateFromStoresArray];
|
|
stateFromStores2 = obj4.useStateFromStores(items3, () => stateFromStoresArray.getRulesPrompt(guildId));
|
|
let obj5 = guildId(isLastStep[16]);
|
|
const items4 = [stateFromStores4];
|
|
stateFromStores3 = obj5.useStateFromStores(items4, () => stateFromStores4.isLoading());
|
|
let obj6 = guildId(isLastStep[16]);
|
|
const items5 = [stateFromStores1, stateFromStores2];
|
|
const items6 = [stateFromStores];
|
|
stateFromStores4 = obj6.useStateFromStores(items5, () => {
|
|
const iter = stateFromStores[Symbol.iterator]();
|
|
const nextResult = iter.next();
|
|
while (iter !== undefined) {
|
|
let tmp3 = nextResult;
|
|
let connection_type = nextResult.connection_type;
|
|
if (outer1_11.APPLICATION === connection_type) {
|
|
let tmp13 = stateFromStores1;
|
|
let tmp14 = nextResult;
|
|
if (null != stateFromStores1.getNewestTokenForApplication(tmp3.application_id)) {
|
|
let tmp15 = iter;
|
|
iter.return();
|
|
let flag2 = true;
|
|
return true;
|
|
}
|
|
} else if (tmp4.PROVIDER_CONNECTED_ACCOUNT === connection_type) {
|
|
let tmp6 = nextResult;
|
|
if (null != tmp3.provider_id) {
|
|
let tmp7 = stateFromStores2;
|
|
let tmp8 = nextResult;
|
|
let account = stateFromStores2.getAccount(null, tmp3.provider_id);
|
|
if (null != account) {
|
|
let tmp11 = account;
|
|
if (!tmp10.revoked) {
|
|
let tmp12 = iter;
|
|
iter.return();
|
|
let flag = true;
|
|
return true;
|
|
}
|
|
}
|
|
}
|
|
} else {
|
|
let tmp5 = nextResult;
|
|
let connection_type2 = tmp3.connection_type;
|
|
}
|
|
continue;
|
|
}
|
|
return false;
|
|
}, items6);
|
|
const items7 = [guildId, stateFromStores3, stateFromStores];
|
|
const effect = navigation.useEffect(() => {
|
|
if (!stateFromStores3) {
|
|
if (0 !== stateFromStores.length) {
|
|
if (!ref.current) {
|
|
let obj = guildId(isLastStep[17]);
|
|
const providerConnectionState = obj.getProviderConnectionState(tmp);
|
|
const applicationConnectionState = guildId(isLastStep[17]).getApplicationConnectionState(tmp);
|
|
const obj2 = guildId(isLastStep[17]);
|
|
obj = {};
|
|
const obj3 = onComplete(isLastStep[18]);
|
|
const merged = Object.assign(guildId(isLastStep[19]).collectGuildAnalyticsMetadata(guildId));
|
|
obj.step = guildId(isLastStep[20]).CONNECTIONS_STEP;
|
|
obj.required = false;
|
|
({ connected: obj4.provider_connections_connected, notConnected: obj4.provider_connections_not_connected } = providerConnectionState);
|
|
({ connected: obj4.application_connections_connected, notConnected: obj4.application_connections_not_connected } = applicationConnectionState);
|
|
obj3.track(outer1_13.GUILD_ONBOARDING_STEP_VIEWED, obj);
|
|
tmp12.current = true;
|
|
const obj5 = guildId(isLastStep[19]);
|
|
}
|
|
}
|
|
}
|
|
}, items7);
|
|
const items8 = [stateFromStoresArray.length, stateFromStores1, stateFromStores2, navigation, onComplete, stateFromStores, stateFromStores4, isLastStep, guildId];
|
|
const callback = navigation.useCallback(() => {
|
|
let obj = guildId(isLastStep[17]);
|
|
const providerConnectionState = obj.getProviderConnectionState(stateFromStores);
|
|
const applicationConnectionState = guildId(isLastStep[17]).getApplicationConnectionState(stateFromStores);
|
|
const obj2 = guildId(isLastStep[17]);
|
|
const tmp = guildId;
|
|
const tmp2 = isLastStep;
|
|
obj = {};
|
|
const obj3 = onComplete(isLastStep[18]);
|
|
const merged = Object.assign(guildId(isLastStep[19]).collectGuildAnalyticsMetadata(guildId));
|
|
obj.step = guildId(isLastStep[20]).CONNECTIONS_STEP;
|
|
obj.skipped = !stateFromStores4;
|
|
obj.back = false;
|
|
obj.options_selected = 0;
|
|
obj.in_onboarding = true;
|
|
obj.is_final_step = isLastStep;
|
|
({ connected: obj4.provider_connections_connected, notConnected: obj4.provider_connections_not_connected } = providerConnectionState);
|
|
({ connected: obj4.application_connections_connected, notConnected: obj4.application_connections_not_connected } = applicationConnectionState);
|
|
obj3.track(outer1_13.GUILD_ONBOARDING_STEP_COMPLETED, obj);
|
|
if (stateFromStoresArray.length > 0) {
|
|
navigation.push(outer1_12.PROMPT, { currentPrompt: 0 });
|
|
} else {
|
|
if (tmpResult.showRulesInOnboarding(stateFromStores1, stateFromStores2)) {
|
|
navigation.push(outer1_12.RULES);
|
|
} else {
|
|
onComplete();
|
|
}
|
|
tmpResult = tmp(tmp2[17]);
|
|
}
|
|
}, items8);
|
|
obj = { top: true, style: items9, children: null };
|
|
items9 = [, ];
|
|
({ flex: arr12[0], container: arr12[1] } = tmp);
|
|
if (stateFromStores3) {
|
|
obj = { style: null, children: null };
|
|
const items10 = [tmp.flex, { justifyContent: "center", alignItems: "center" }];
|
|
obj[0] = items10;
|
|
obj1 = { variant: "text-md/normal", color: "text-muted", children: null };
|
|
const intl4 = tmp2(tmp3[23]).intl;
|
|
obj1[2] = intl4.string(tmp2(tmp3[23]).t.ZTNur7);
|
|
obj[1] = tmp13(tmp2(tmp3[22]).Text, obj1);
|
|
obj[2] = tmp13(closure_4, obj);
|
|
let tmp19 = obj;
|
|
} else {
|
|
obj2 = { style: null, children: null };
|
|
obj2[0] = tmp.flex;
|
|
obj3 = { contentContainerStyle: null, children: null };
|
|
const items11 = [tmp.scrollContainer, ];
|
|
obj4 = { paddingBottom: null };
|
|
obj4[0] = sum1;
|
|
items11[1] = obj4;
|
|
obj3[0] = items11;
|
|
obj5 = { style: null, children: null };
|
|
obj5[0] = tmp.header;
|
|
obj6 = { style: null, accessibilityRole: "header", variant: "heading-xl/semibold", color: "mobile-text-heading-primary", children: null };
|
|
obj6[0] = tmp.title;
|
|
const intl = tmp2(tmp3[23]).intl;
|
|
obj6[4] = intl.string(tmp2(tmp3[23]).t.eDVMrA);
|
|
const items12 = [tmp13(tmp2(tmp3[22]).Text, obj6), ];
|
|
const obj7 = { style: null, variant: "text-md/normal", color: "text-muted", children: null };
|
|
obj7[0] = tmp.description;
|
|
const intl2 = tmp2(tmp3[23]).intl;
|
|
obj7[3] = intl2.string(tmp2(tmp3[23]).t.BozOXu);
|
|
items12[1] = tmp13(tmp2(tmp3[22]).Text, obj7);
|
|
obj5[1] = items12;
|
|
const items13 = [callback(closure_4, obj5), ];
|
|
const obj8 = { style: null, children: null };
|
|
obj8[0] = tmp.connectionsList;
|
|
obj8[1] = stateFromStores.map((connection) => {
|
|
const obj = { connection, guildId, location: null };
|
|
obj[2] = onComplete(isLastStep[25]).GUILD_ONBOARDING;
|
|
return outer1_14(onComplete(isLastStep[24]), obj, arg1);
|
|
});
|
|
items13[1] = tmp13(closure_4, obj8);
|
|
obj3[1] = items13;
|
|
const items14 = [callback(stateFromStores, obj3), ];
|
|
const obj9 = { style: null, children: null };
|
|
const items15 = [, , ];
|
|
({ footer: arr17[0], footerContent: arr17[1] } = tmp);
|
|
const obj10 = { paddingBottom: null };
|
|
obj10[0] = bottom;
|
|
items15[2] = obj10;
|
|
obj9[0] = items15;
|
|
if (stateFromStores4) {
|
|
let str = "primary";
|
|
} else {
|
|
str = "secondary";
|
|
}
|
|
const obj11 = { variant: null, size: "md", text: null, onPress: null, grow: true };
|
|
obj11[0] = str;
|
|
const intl3 = tmp2(tmp3[23]).intl;
|
|
const string = intl3.string;
|
|
const t = tmp2(tmp3[23]).t;
|
|
if (isLastStep) {
|
|
const _HermesInternal = HermesInternal;
|
|
let combined = "" + string(t["8SuVoE"]) + " \u{1F389}";
|
|
} else if (stateFromStores4) {
|
|
combined = string(t.PDTjLN);
|
|
} else {
|
|
combined = string(t["5Wxrcd"]);
|
|
}
|
|
obj11[2] = combined;
|
|
obj11[3] = callback;
|
|
obj9[1] = tmp13(tmp2(tmp3[26]).Button, obj11);
|
|
items14[1] = tmp13(closure_4, obj9);
|
|
obj2[1] = items14;
|
|
obj[2] = callback(closure_4, obj2);
|
|
tmp19 = obj;
|
|
let tmp14 = callback;
|
|
}
|
|
return closure_14(guildId(isLastStep[21]).SafeAreaPaddingView, tmp19);
|
|
};
|