112 lines
6.5 KiB
TypeScript
112 lines
6.5 KiB
TypeScript
/* Metro module 9398; source: modules/oauth2/native/AuthorizeScopes.tsx; dependencies: [31, 27, 33, 4501, 1244, 6988, 697, 4073, 4573, 6518, 4121, 8042, 4122, 2] */
|
|
function _fun73272(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#73272, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:6, offset: 0x01d65f0e, size: 319 bytes, params: 8, frame: 20
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
importAll(31) /* metro dependency 31 */;
|
|
const env0_3 = (require(27) /* metro dependency 27 */).View;
|
|
const value = require(33) /* metro dependency 33 */;
|
|
const env0_4 = value.jsx;
|
|
const env0_5 = value.jsxs;
|
|
const env0_6 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({scopesContainer: {'flexDirection': 'column',
|
|
'gap': 16}, scopes: {'flexDirection': 'column', 'gap': 16}, scopeContainer: {flexDirection: 'row'},
|
|
scope: {'flex': 1, 'flexDirection': 'column', 'justifyContent': 'center'}, iconWrapper: {'marginRight': 12,
|
|
'width': 20, 'height': 20}, fakeScopeIcon: {opacity: 0.6}});
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/oauth2/native/AuthorizeScopes.tsx');
|
|
exports.default = AuthorizeScopes;
|
|
}
|
|
|
|
function Scope({text, error, isFake}) { // fn#73273, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:433, offset: 0x01d6604d, size: 602 bytes, params: 2, frame: 31
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const styles = useStyles();
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const r11 = isFake ? Reflect.apply(string, intl, [t.OX8EMU]) : Reflect.apply(string, intl, [t['0lpCFG']]);
|
|
const value6 = '';
|
|
return (
|
|
<View
|
|
style={styles.scopeContainer}
|
|
accessible
|
|
accessibilityLabel={value6 + r11 + ': ' + text + (error != null ? '. ' + error : value6)}
|
|
>
|
|
<View
|
|
style={styles.iconWrapper}
|
|
accessible={false}
|
|
importantForAccessibility="no-hide-descendants"
|
|
>
|
|
{isFake ? ((CircleXIcon) => <CircleXIcon style={styles.fakeScopeIcon} color={(importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED} size="refresh_sm" />)((require(6988) /* metro dependency 6988: CircleXIcon */).CircleXIcon) : ((CircleCheckIcon) => <CircleCheckIcon color={(importDefault(697) /* metro dependency 697: native */).colors.TEXT_MUTED} size="refresh_sm" />)((require(4073) /* metro dependency 4073: CircleCheckIcon */).CircleCheckIcon)}
|
|
</View>
|
|
<View style={styles.scope}>
|
|
<Text variant="text-md/normal" color={isFake ? 'text-muted' : undefined}>
|
|
{text}
|
|
</Text>
|
|
{error != null ? <Text variant="text-xs/normal">{error}</Text> : null}
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function AuthorizeScopes({application, accountScopes, requestedScopes, integrationType, errors, isTrustedName}) { // fn#73274, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:1227, offset: 0x01d662a7, size: 556 bytes, params: 2, frame: 29
|
|
isTrustedName = !(isTrustedName === undefined) && isTrustedName;
|
|
const styles = useStyles();
|
|
const value2 = (importDefault(6518) /* metro dependency 6518: useInitialValue */)(_fun73275);
|
|
if (accountScopes.length === 0) {
|
|
return null;
|
|
}
|
|
const value3 = value2();
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const r16 = isTrustedName ? t.PZpY9c : t['1Hz+Sl'];
|
|
const ApplicationIntegrationType = (require(8042) /* metro dependency 8042: ApplicationIntegrationType */).ApplicationIntegrationType;
|
|
const USER_INSTALL = ApplicationIntegrationType.USER_INSTALL;
|
|
let r10 = integrationType === USER_INSTALL && requestedScopes.includes((require(4122) /* metro dependency 4122: OAuth2Scopes */).OAuth2Scopes.APPLICATIONS_COMMANDS);
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
const text = <Text variant="heading-sm/normal" color="text-default">{intl.format(r16,
|
|
{application: application.name})}</Text>;
|
|
const value8 = accountScopes.map(_fun73276).flat();
|
|
r10 = r10 && <Scope text={intl.string((require(1244) /* metro dependency 1244: indexNative */).t.Ls2XRq)} />;
|
|
return (
|
|
<View style={styles.scopesContainer}>
|
|
{text}
|
|
<View style={styles.scopes}>
|
|
{value8}
|
|
{r10}
|
|
<Scope text={value3} isFake />
|
|
</View>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun73275() { // fn#73275, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:1370, offset: 0x01d664d3, size: 96 bytes, params: 1, frame: 17
|
|
let value = environment.__proto__;
|
|
const FAKE_SCOPES = (require(4121) /* metro dependency 4121: scopes */).FAKE_SCOPES;
|
|
const Math = global.Math;
|
|
const floor = Math.floor;
|
|
const Math2 = global.Math;
|
|
value = Math2.random();
|
|
const FAKE_SCOPES2 = (require(4121) /* metro dependency 4121: scopes */).FAKE_SCOPES;
|
|
return FAKE_SCOPES[Reflect.apply(floor, Math, [value * FAKE_SCOPES2.length])];
|
|
}
|
|
|
|
function _fun73276(a0) { // fn#73276, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:1846, offset: 0x01d66533, size: 72 bytes, params: 2, frame: 14
|
|
var environment;
|
|
const env0_0 = a0;
|
|
let value = environment.__proto__;
|
|
const getScopeNames = (require(4121) /* metro dependency 4121: scopes */).getScopeNames;
|
|
value = Reflect.apply(getScopeNames, value, [a0, accountScopes]);
|
|
return value.map(_fun73277);
|
|
}
|
|
|
|
function _fun73277(a0, a1) { // fn#73277, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:9584:1882, offset: 0x01d6657b, size: 130 bytes, params: 3, frame: 21
|
|
const value = environment.__proto__.__proto__;
|
|
return (
|
|
<Scope
|
|
text={a0}
|
|
error={a1 !== 0 || errors == null || errors[env0_0] == null ? undefined : errors[env0_0][0]}
|
|
key={'' + env0_0 + '-' + a1}
|
|
/>
|
|
);
|
|
}
|
|
|