decord/source/modules/oauth2/native/ApplicationDetails.tsx

151 lines
5.6 KiB
TypeScript
Raw Normal View History

2026-08-25 06:04:03 +00:00
// Module ID: 10608
// Function ID: 10609
2026-07-20 16:05:17 +00:00
// Name: ApplicationDetailsEntry
2026-08-25 06:04:03 +00:00
// Dependencies: [19, 17, 21, 4380, 712, 10586, 10609, 10611, 11, 10584, 4323, 1236, 4925, 10588, 10613, 4343, 9049, 10615, 10428, 4376, 2]
2026-07-20 16:05:17 +00:00
// Exports: default
2026-08-25 06:04:03 +00:00
// Module 10608 (ApplicationDetailsEntry)
2026-08-24 06:08:38 +00:00
import DISCORD_EPOCHDefault from "DISCORD_EPOCH" /* 11 */;
import noopAll from "noop" /* 19 */;
import ThemesDefault from "Themes" /* 712 */;
import getSystemLocale from "getSystemLocale" /* 1236 */;
2026-08-25 06:04:03 +00:00
import ClockIcon from "ClockIcon" /* 4343 */;
import Text from "Text" /* 4376 */;
import LockIcon from "LockIcon" /* 4925 */;
import set from "set" /* 9049 */;
import ShieldIcon from "ShieldIcon" /* 10428 */;
import items2 from "items" /* 10584 */;
import getApplicationDetailsText from "getApplicationDetailsText" /* 10588 */;
2026-08-24 06:08:38 +00:00
import { View } from "get ActivityIndicator" /* 17 */;
import jsxProd from "jsxProd" /* 21 */;
2026-08-25 06:04:03 +00:00
import createCacheKey from "createCacheKey" /* 4380 */;
2026-07-23 10:11:24 +00:00
2026-08-24 06:08:38 +00:00
require = arg1;
2026-07-29 08:29:29 +00:00
function ApplicationDetailsEntry(children) {
const iconComponent = children.iconComponent;
2026-08-24 06:08:38 +00:00
const tmp = callback2();
2026-07-29 08:29:29 +00:00
let obj = { style: tmp.entry, children: null };
2026-07-20 16:05:17 +00:00
let iconComponentResult = null;
if (null != iconComponent) {
2026-07-29 08:29:29 +00:00
obj = { style: null };
obj[0] = tmp.entryIcon;
2026-07-20 16:05:17 +00:00
iconComponentResult = iconComponent(obj);
}
const items = [iconComponentResult, ];
2026-07-29 08:29:29 +00:00
obj = { variant: "text-sm/normal", color: "text-default", style: tmp.entryText, children: children.text };
2026-08-24 06:08:38 +00:00
items[1] = callback(Text.Text, obj);
2026-07-29 08:29:29 +00:00
obj[1] = items;
2026-07-20 16:05:17 +00:00
return closure_5(View, obj);
}
2026-08-24 06:08:38 +00:00
noopAll;
2026-07-29 08:29:29 +00:00
({ jsx: c4, jsxs: c5 } = jsxProd);
createCacheKey = { applicationDetails: { flexDirection: "column", gap: 16 }, entry: { flexDirection: "row", alignItems: "center", gap: 8 }, entryText: { flex: 1 }, entryIcon: null };
2026-08-24 06:08:38 +00:00
createCacheKey = { width: 16, height: 16, tintColor: ThemesDefault.colors.TEXT_MUTED };
2026-07-29 08:29:29 +00:00
createCacheKey[3] = createCacheKey;
2026-08-24 06:08:38 +00:00
let closure_6 = createCacheKey.createStyles(createCacheKey);
const result = require("set").fileFinishedImporting("modules/oauth2/native/ApplicationDetails.tsx");
2026-07-20 16:05:17 +00:00
export default function ApplicationDetails(arg0) {
({ application, scopes, redirectUri, approximateGuildCount, disclosures } = arg0);
({ isEmbeddedFlow, connectedAccount } = arg0);
2026-08-24 06:08:38 +00:00
let obj = DISCORD_EPOCHDefault;
const tmp2 = callback2();
obj1 = items2;
2026-07-20 16:05:17 +00:00
let joined = null;
const securityMessage = obj1.getSecurityMessage(scopes);
if (null != redirectUri) {
if (!isEmbeddedFlow) {
2026-07-29 08:29:29 +00:00
try {
const _URL = URL;
const uRL = new URL(redirectUri);
const parts = uRL.href.split("/");
const substr = parts.slice(0, 3);
joined = substr.join("/");
const str = uRL.href;
} catch (err) {
joined = tmp;
}
2026-07-20 16:05:17 +00:00
}
}
2026-07-29 08:29:29 +00:00
obj = { style: tmp2.applicationDetails, children: null };
let tmp15 = null;
if (null != joined) {
obj = { iconComponent: null, text: null };
2026-08-25 06:04:03 +00:00
obj[0] = tmp5(4323).LinkIcon;
2026-07-29 08:29:29 +00:00
const intl = tmp5(1236).intl;
obj1 = { origin: null };
obj1[0] = joined;
obj[1] = intl.format(tmp5(1236).t["5k5OKD"], obj1);
tmp15 = callback(ApplicationDetailsEntry, obj);
}
const items = [tmp15, , , , , , ];
2026-08-24 06:08:38 +00:00
const obj2 = { iconComponent: LockIcon.LockIcon, text: null };
2026-07-29 08:29:29 +00:00
const date = new Date(obj.extractTimestamp(application.id));
const tmp13 = closure_5;
const tmp14 = View;
2026-08-24 06:08:38 +00:00
obj2[1] = getApplicationDetailsText.getApplicationDetailsText(application);
2026-07-29 08:29:29 +00:00
items[1] = callback(ApplicationDetailsEntry, obj2);
let tmp18Result = null;
if (null != connectedAccount) {
const obj3 = { iconComponent: null, text: null };
2026-08-25 06:04:03 +00:00
obj3[0] = tmp5(10613).HammerIcon;
2026-07-29 08:29:29 +00:00
const intl2 = tmp5(1236).intl;
obj3[1] = intl2.string(tmp5(1236).t["8qui3M"]);
tmp18Result = tmp18(tmp19, obj3);
}
items[2] = tmp18Result;
2026-08-24 06:08:38 +00:00
const obj4 = { iconComponent: ClockIcon.ClockIcon, text: null };
2026-07-29 08:29:29 +00:00
const intl3 = tmp5(1236).intl;
2026-08-24 06:08:38 +00:00
obj4[1] = intl3.formatToPlainString(getSystemLocale.t["+1bjc8"], { date });
2026-07-29 08:29:29 +00:00
items[3] = callback(ApplicationDetailsEntry, obj4);
tmp18Result = null;
2026-08-24 06:08:38 +00:00
if (scopes.includes(set.OAuth2Scopes.BOT)) {
2026-07-29 08:29:29 +00:00
tmp18Result = null;
if (null != approximateGuildCount) {
const obj5 = { iconComponent: null, text: null };
2026-08-25 06:04:03 +00:00
obj5[0] = tmp5(10615).RobotIcon;
2026-07-29 08:29:29 +00:00
const intl4 = tmp5(1236).intl;
const obj6 = { guildCount: null };
obj6[0] = approximateGuildCount;
obj5[1] = intl4.formatToPlainString(tmp5(1236).t.UHGHSP, obj6);
tmp18Result = tmp18(tmp19, obj5);
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
items[4] = tmp18Result;
2026-08-24 06:08:38 +00:00
const tmp5Result = getApplicationDetailsText;
items[5] = callback(ApplicationDetailsEntry, { iconComponent: ShieldIcon.ShieldIcon, text: securityMessage });
2026-07-29 08:29:29 +00:00
let mapped = null;
if (null != disclosures) {
mapped = disclosures.map((toFixed) => {
2026-08-25 06:04:03 +00:00
let obj = callback(10586);
2026-07-29 08:29:29 +00:00
const textForDisclosure = obj.getTextForDisclosure(toFixed);
2026-08-25 06:04:03 +00:00
if (callback(10586).ApplicationDisclosure.IP_LOCATION === toFixed) {
2026-07-29 08:29:29 +00:00
obj = { iconComponent: null };
2026-08-25 06:04:03 +00:00
obj[0] = tmp(10609).GlobeEarthIcon;
2026-07-29 08:29:29 +00:00
let tmp4 = obj;
} else {
tmp4 = null;
2026-08-25 06:04:03 +00:00
if (tmp(10586).ApplicationDisclosure.DISPLAYS_ADVERTISEMENTS === toFixed) {
2026-07-29 08:29:29 +00:00
obj = { iconComponent: null };
2026-08-25 06:04:03 +00:00
obj[0] = tmp(10611).EmbedIcon;
2026-07-29 08:29:29 +00:00
tmp4 = obj;
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
let tmp5 = null;
if (null != tmp4) {
tmp5 = null;
if (null != textForDisclosure) {
2026-08-24 06:08:38 +00:00
obj1 = { text: null };
2026-07-29 08:29:29 +00:00
obj1[0] = textForDisclosure;
const merged = Object.assign(tmp4);
tmp5 = callback2(closure_7, obj1, toFixed.toFixed());
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
}
return tmp5;
});
2026-07-20 16:05:17 +00:00
}
2026-07-29 08:29:29 +00:00
items[6] = mapped;
obj[1] = items;
return tmp13(tmp14, obj);
2026-07-20 16:05:17 +00:00
};