decord/source/modules/guild_onboarding/native/ProviderConnectionCard.tsx

146 lines
5.1 KiB
TypeScript
Raw Normal View History

2026-09-03 10:05:34 +00:00
// Module ID: 5978
// Function ID: 5979
2026-07-20 16:05:17 +00:00
// Name: ProviderConnectionCard
2026-09-03 10:05:34 +00:00
// Dependencies: [5, 19, 673, 21, 4413, 5236, 1233, 5979, 5980, 695, 4701, 1430, 1362, 1296, 4421, 5977, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-09-03 10:05:34 +00:00
// Module 5978 (ProviderConnectionCard)
2026-08-24 06:08:38 +00:00
import closure_3 from "asyncGeneratorStep" /* 5 */;
import closure_4 from "noop" /* 19 */;
2026-09-02 09:53:35 +00:00
import { AnalyticEvents } from "ME" /* 673 */;
2026-08-24 06:08:38 +00:00
import { jsx } from "jsxProd" /* 21 */;
2026-07-23 10:11:24 +00:00
const require = arg1;
2026-08-24 06:08:38 +00:00
const result = require("set").fileFinishedImporting("modules/guild_onboarding/native/ProviderConnectionCard.tsx");
2026-07-20 16:05:17 +00:00
export default function ProviderConnectionCard(connection) {
connection = connection.connection;
const guildId = connection.guildId;
const _location = connection.location;
2026-07-29 08:29:29 +00:00
let callback;
2026-07-23 10:11:24 +00:00
let startConnection;
2026-07-29 08:29:29 +00:00
const tmp3 = guildId(_location[4])();
callback = tmp3;
2026-07-20 16:05:17 +00:00
let stringResult = null;
if (null != connection.provider_id) {
2026-07-29 08:29:29 +00:00
let value = tmp(tmp2[5]).get(connection.provider_id);
2026-07-20 16:05:17 +00:00
let name;
2026-07-29 08:29:29 +00:00
if (value != null) {
2026-07-20 16:05:17 +00:00
name = value.name;
}
stringResult = name;
2026-07-29 08:29:29 +00:00
const tmpResult = tmp(tmp2[5]);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
if (stringResult == null) {
const intl = connection(tmp2[6]).intl;
stringResult = intl.string(connection(tmp2[6]).t.NzCoRx);
2026-07-20 16:05:17 +00:00
}
if (null != connection.description) {
if (connection.description.length > 0) {
let description = connection.description;
}
2026-07-29 08:29:29 +00:00
const startProviderConnection = connection(tmp2[8]).useStartProviderConnection(connection.provider_id);
2026-07-23 10:11:24 +00:00
startConnection = startProviderConnection.startConnection;
2026-07-20 16:05:17 +00:00
({ hasConnection, canConnect, loading } = startProviderConnection);
const items = [startConnection, guildId, connection.provider_id, _location];
2026-07-29 08:29:29 +00:00
const items1 = [connection.provider_id, tmp3];
callback = startConnection.useCallback(callback(function*() {
if (v0 === 2) {
v0 = 3;
HermesBuiltin.throwTypeError();
} else if (tmp3 === 3) {
if (arg0 === 1) {
throw arg1;
} else if (arg0 === 2) {
let obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} else {
try {
v0 = 2;
if (0 === dependencyMap) {
if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
2026-08-24 06:08:38 +00:00
obj1 = {};
2026-09-02 09:53:35 +00:00
const obj5 = v0(695);
2026-09-03 10:05:34 +00:00
const merged = Object.assign(closure_1_0(4701).collectGuildAnalyticsMetadata(v0));
2026-07-29 08:29:29 +00:00
obj1.connection_type = "provider";
2026-08-24 06:08:38 +00:00
const provider_id = closure_1_0.provider_id;
c0 = provider_id;
2026-07-29 08:29:29 +00:00
if (provider_id == null) {
c0 = undefined;
}
obj1.provider_id = c0;
obj1.location = dependencyMap;
2026-08-24 06:08:38 +00:00
obj5.track(closure_1_5.GUILD_ONBOARDING_CONNECTION_CLICKED, obj1);
2026-07-29 08:29:29 +00:00
dependencyMap = 1;
v0 = 1;
const obj2 = { value: null, done: false };
2026-08-24 06:08:38 +00:00
obj2[0] = closure_1_4("Guild Onboarding");
2026-07-29 08:29:29 +00:00
return obj2;
}
} else if (arg0 === 1) {
v0 = 3;
throw arg1;
} else if (arg0 === 2) {
v0 = 3;
obj = { value: null, done: true };
obj[0] = arg1;
return obj;
} else {
v0 = 3;
2026-09-01 10:26:29 +00:00
return { value: "HermesInternal", done: null };
2026-07-29 08:29:29 +00:00
}
} catch (tmp9) {
v0 = tmp;
throw tmp9;
}
2026-07-20 16:05:17 +00:00
}
}), items);
2026-07-23 10:11:24 +00:00
const memo = startConnection.useMemo(() => {
2026-07-20 16:05:17 +00:00
if (null != connection.provider_id) {
let obj = guildId(_location[5]);
2026-07-29 08:29:29 +00:00
const value = obj.get(tmp.provider_id);
2026-07-20 16:05:17 +00:00
let icon;
2026-07-29 08:29:29 +00:00
if (value != null) {
2026-07-20 16:05:17 +00:00
icon = value.icon;
}
if (null == icon) {
const source = obj2.makeSource(null);
2026-07-29 08:29:29 +00:00
obj = { source: null, style: null, disableColor: true };
obj[0] = source;
obj[1] = { width: 32, height: 32 };
2026-08-24 06:08:38 +00:00
return closure_1_6(connection(_location[13]).Icon, obj);
2026-07-20 16:05:17 +00:00
} else {
icon = value.icon;
2026-08-24 06:08:38 +00:00
connection(_location[12]).isThemeDark(closure_3) ? icon.darkPNG : icon.lightPNG;
2026-07-20 16:05:17 +00:00
const obj3 = connection(_location[12]);
}
2026-07-23 10:11:24 +00:00
obj2 = connection(_location[11]);
2026-07-20 16:05:17 +00:00
} else {
2026-08-24 06:08:38 +00:00
return closure_1_6(connection(_location[14]).LinkIcon, { size: "lg", color: "text-subtle" });
2026-07-20 16:05:17 +00:00
}
}, items1);
2026-07-29 08:29:29 +00:00
let obj = { displayName: null, description: null, icon: null, isLoading: null, isConnected: null, canConnect: null, onConnect: null };
obj[0] = stringResult;
obj[1] = description;
obj[2] = memo;
obj[3] = loading;
obj[4] = hasConnection;
obj[5] = canConnect;
obj[6] = callback;
return jsx(tmp(tmp2[15]), { displayName: null, description: null, icon: null, isLoading: null, isConnected: null, canConnect: null, onConnect: null });
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
description = tmp(tmp2[7])(connection.provider_id);
2026-07-20 16:05:17 +00:00
};