330 lines
16 KiB
TypeScript
330 lines
16 KiB
TypeScript
/* Metro module 14557; source: modules/guild_themes/native/GuildThemeNuxActionSheet.tsx; dependencies: [5, 57, 31, 27, 3969, 4042, 1376, 33, 3, 4501, 697, 14558, 4044, 566, 4080, 1244, 6275, 14559, 4573, 7988, 7987, 1305, 4578, 2] */
|
|
function _fun110088(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#110088, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:6, offset: 0x02369b02, size: 560 bytes, params: 8, frame: 24
|
|
var object3;
|
|
const env0_0 = require;
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_3 = importDefault(5) /* metro dependency 5 */;
|
|
const env0_4 = importDefault(57) /* metro dependency 57 */;
|
|
const env0_5 = importAll(31) /* metro dependency 31 */;
|
|
const env0_6 = (require(27) /* metro dependency 27 */).View;
|
|
const selectedGuildStore = importDefault(3969) /* metro dependency 3969: SelectedGuildStore */;
|
|
const guildThemeRuntimeStore = importDefault(4042) /* metro dependency 4042: GuildThemeRuntimeStore */;
|
|
const env0_9 = (require(1376) /* metro dependency 1376: DismissibleContentConstants */).ContentDismissActionType;
|
|
let value = require(33) /* metro dependency 33 */;
|
|
const env0_10 = value.jsx;
|
|
const env0_11 = value.jsxs;
|
|
value = importDefault(3) /* metro dependency 3: Logger */;
|
|
value = new value('GuildThemeNuxActionSheet');
|
|
value = require(4501) /* metro dependency 4501: createStyles */;
|
|
const createStyles = value.createStyles;
|
|
object3 = {};
|
|
const object4 = {};
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object4.padding = PX_16;
|
|
let PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object4.paddingTop = PX_8;
|
|
object4.paddingBottom = 0;
|
|
object3.container = object4;
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object3.title = {textAlign: 'center', marginBottom: PX_8};
|
|
const PX_24 = (importDefault(697) /* metro dependency 697: native */).space.PX_24;
|
|
object3.description = {textAlign: 'center', marginBottom: PX_24};
|
|
let PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object3.options = {marginBottom: PX_12};
|
|
PX_12 = (importDefault(697) /* metro dependency 697: native */).space.PX_12;
|
|
object3.warning = {marginBottom: PX_12};
|
|
PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object3.footer = {gap: PX_8};
|
|
const env0_13 = Reflect.apply(createStyles, value, [object3]);
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/guild_themes/native/GuildThemeNuxActionSheet.tsx');
|
|
exports.default = GuildThemeNuxActionSheet;
|
|
exports.GUILD_THEME_NUX_ACTION_SHEET_KEY = 'GuildThemeNuxActionSheet';
|
|
}
|
|
|
|
function GuildThemeNuxActionSheet({guildId, markAsDismissed}) { // fn#110089, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:758, offset: 0x02369d32, size: 1596 bytes, params: 2, frame: 38
|
|
const HelpMessage = (require(1305) /* metro dependency 1305: native */).HelpMessage;
|
|
const styles = useStyles();
|
|
const binding = env0_5;
|
|
let useState = binding.useState;
|
|
const getInitialGuildThemeNuxSelection = (require(14558) /* metro dependency 14558: GuildThemeNuxUtils */).getInitialGuildThemeNuxSelection;
|
|
const value2 = Reflect.apply(useState, binding, [getInitialGuildThemeNuxSelection]);
|
|
const binding2 = env0_4;
|
|
const value3 = binding2(value2, 2);
|
|
const property = value3[0];
|
|
const env0_2 = value3[1];
|
|
useState = binding.useState;
|
|
const value5 = binding2(Reflect.apply(useState, binding, [null]), 2);
|
|
const property2 = value5[0];
|
|
const env0_3 = value5[1];
|
|
useState = binding.useState;
|
|
const value6 = binding2(Reflect.apply(useState, binding, [false]), 2);
|
|
const property3 = value6[0];
|
|
var env0_4 = value6[1];
|
|
var env0_5 = binding.useRef(false);
|
|
const GuildThemeSourcePreference = (require(4044) /* metro dependency 4044: Client */).GuildThemeSourcePreference;
|
|
let PERSONAL = GuildThemeSourcePreference.PERSONAL;
|
|
const value7 = property === PERSONAL;
|
|
const guildId2 = (require(566) /* metro dependency 566: flux */).useStateFromStores([SelectedGuildStore],
|
|
function() {
|
|
return SelectedGuildStore.getGuildId();
|
|
});
|
|
const value8 = (require(566) /* metro dependency 566: flux */).useStateFromStores([GuildThemeRuntimeStore],
|
|
_fun110091, [guildId]);
|
|
binding.useEffect(_fun110092, [guildId, guildId2]);
|
|
const value9 = binding.useCallback(_fun110093, []);
|
|
const value10 = binding.useCallback(_fun110094, [markAsDismissed]);
|
|
const value12 = binding.useCallback(env0_3(_fun110096), [guildId, value7, markAsDismissed, guildId2]);
|
|
const value13 = binding.useCallback(_fun110097, [value10]);
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const t = (require(1244) /* metro dependency 1244: indexNative */).t;
|
|
const r12 = value7 ? Reflect.apply(string, intl, [t.cvoikF]) : Reflect.apply(string, intl, [t['cY+Oob']]);
|
|
const BottomSheet = (require(6275) /* metro dependency 6275: BottomSheetNative */).BottomSheet;
|
|
const bottomSheetProps = {startExpanded: true,
|
|
dismissAccessibilityLabel: intl.string((require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq),
|
|
onDismiss: value13, contentStyles: styles.container};
|
|
const items2 = [((Component) => <Component themeSettings={value8} isPersonal={value7} />)(importDefault(14559) /* metro dependency 14559: GuildThemeNuxPreviewGraphic */)];
|
|
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
|
|
string = intl.string;
|
|
const Q9zFy9 = (require(1244) /* metro dependency 1244: indexNative */).t.Q9zFy9;
|
|
items2[1] = <Text accessibilityRole="header" variant="heading-xl/semibold" color="mobile-text-heading-primary" style={styles.title}>{Reflect.apply(string,
|
|
intl, [Q9zFy9])}</Text>;
|
|
string = intl.string;
|
|
const XLpBLj = (require(1244) /* metro dependency 1244: indexNative */).t.XLpBLj;
|
|
items2[2] = <Text variant="text-md/normal" color="text-default" style={styles.description}>{Reflect.apply(string,
|
|
intl, [XLpBLj])}</Text>;
|
|
const TableRadioGroup = (require(7988) /* metro dependency 7988: TableRadioGroupNative */).TableRadioGroup;
|
|
const TableRadioRow = (require(7987) /* metro dependency 7987: TableRadioRowNative */).TableRadioRow;
|
|
string = intl.string;
|
|
const aN3RNQ = (require(1244) /* metro dependency 1244: indexNative */).t.aN3RNQ;
|
|
const GUILD = GuildThemeSourcePreference.GUILD;
|
|
const tableRadioRow = <TableRadioRow label={Reflect.apply(string, intl, [aN3RNQ])} value={GUILD} />;
|
|
string = intl.string;
|
|
const js8y7t = (require(1244) /* metro dependency 1244: indexNative */).t.js8y7t;
|
|
PERSONAL = GuildThemeSourcePreference.PERSONAL;
|
|
items2[3] = <View style={styles.options}><TableRadioGroup hasIcons={false} value={property} onChange={value9}>{tableRadioRow}<TableRadioRow label={Reflect.apply(string,
|
|
intl, [js8y7t])} value={PERSONAL} /></TableRadioGroup></View>;
|
|
items2[4] = value7 ? <View style={styles.warning}><HelpMessage messageType={(require(1305) /* metro dependency 1305: native */).HelpMessageTypes.WARNING} borderRadius={(importDefault(697) /* metro dependency 697: native */).radii.md}>{intl.string((require(1244) /* metro dependency 1244: indexNative */).t.tTHQAy)}</HelpMessage></View> : null;
|
|
items2[5] = property2 != null ? <View style={styles.warning}><HelpMessage messageType={(require(1305) /* metro dependency 1305: native */).HelpMessageTypes.ERROR} borderRadius={(importDefault(697) /* metro dependency 697: native */).radii.md}>{property2}</HelpMessage></View> : null;
|
|
const Button = (require(4578) /* metro dependency 4578: ButtonNative */).Button;
|
|
items2[6] = <View style={styles.footer}><Button text={r12} variant={value7 ? 'secondary' : 'primary'} loading={property3} disabled={property3} onPress={value12} /></View>;
|
|
return (
|
|
<BottomSheet {...bottomSheetProps}>
|
|
{items2}
|
|
</BottomSheet>
|
|
);
|
|
}
|
|
|
|
function _fun110091() { // fn#110091, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1151, offset: 0x0236a381, size: 66 bytes, params: 1, frame: 12
|
|
let value = environment.__proto__;
|
|
value = GuildThemeRuntimeStore.getGuildThemeSnapshot(guildId);
|
|
const value2 = null;
|
|
return value2 != value && value.enabled && value2 != value.themeSettings ? value.themeSettings : value2;
|
|
}
|
|
|
|
function _fun110092() { // fn#110092, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1271, offset: 0x0236a3c3, size: 61 bytes, params: 1, frame: 11
|
|
var value;
|
|
if (guildId !== guildId) {
|
|
value = environment.__proto__;
|
|
value = importDefault(4080) /* metro dependency 4080: ActionSheetActionCreators */;
|
|
value.hideActionSheet('GuildThemeNuxActionSheet');
|
|
}
|
|
}
|
|
|
|
function _fun110093(a0) { // fn#110093, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1341, offset: 0x0236a400, size: 30 bytes, params: 2, frame: 12
|
|
env0_3(null);
|
|
env0_2(a0);
|
|
}
|
|
|
|
function _fun110094(a0) { // fn#110094, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1381, offset: 0x0236a41e, size: 45 bytes, params: 2, frame: 11
|
|
if (!env0_5.current) {
|
|
env0_5.current = true;
|
|
markAsDismissed(a0);
|
|
}
|
|
}
|
|
|
|
function* _fun110096() { // fn#110096, original name: ?anon_0_, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1442, offset: 0x0236a456, size: 288 bytes, params: 1, frame: 18
|
|
var binding;
|
|
var binding2;
|
|
var property;
|
|
var value4;
|
|
var saveGuildThemeNuxPreference;
|
|
var value5;
|
|
var value6;
|
|
var value7;
|
|
var error;
|
|
var binding3;
|
|
var binding4;
|
|
var intl;
|
|
var string;
|
|
var t;
|
|
var fEptJP;
|
|
if (true) {
|
|
value = environment.__proto__;
|
|
if (SelectedGuildStore === require) {
|
|
env1_4(true);
|
|
env1_3(null);
|
|
try {
|
|
binding = env2_0;
|
|
} catch (error) {
|
|
binding = env2_12;
|
|
binding.error('Failed to save guild theme NUX preference', error);
|
|
binding = env1_3;
|
|
binding3 = env2_0;
|
|
binding4 = env2_2;
|
|
intl = binding3(binding4[15]).intl;
|
|
string = intl.string;
|
|
t = binding3(binding4[15]).t;
|
|
fEptJP = t.fEptJP;
|
|
binding(Reflect.apply(string, intl, [fEptJP]));
|
|
env1_4(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
binding2 = env2_2;
|
|
} catch (error) {
|
|
binding = env2_12;
|
|
binding.error('Failed to save guild theme NUX preference', error);
|
|
binding = env1_3;
|
|
binding3 = env2_0;
|
|
binding4 = env2_2;
|
|
intl = binding3(binding4[15]).intl;
|
|
string = intl.string;
|
|
t = binding3(binding4[15]).t;
|
|
fEptJP = t.fEptJP;
|
|
binding(Reflect.apply(string, intl, [fEptJP]));
|
|
env1_4(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
property = binding2[11];
|
|
} catch (error) {
|
|
binding = env2_12;
|
|
binding.error('Failed to save guild theme NUX preference', error);
|
|
binding = env1_3;
|
|
binding3 = env2_0;
|
|
binding4 = env2_2;
|
|
intl = binding3(binding4[15]).intl;
|
|
string = intl.string;
|
|
t = binding3(binding4[15]).t;
|
|
fEptJP = t.fEptJP;
|
|
binding(Reflect.apply(string, intl, [fEptJP]));
|
|
env1_4(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value4 = binding(property);
|
|
} catch (error) {
|
|
binding = env2_12;
|
|
binding.error('Failed to save guild theme NUX preference', error);
|
|
binding = env1_3;
|
|
binding3 = env2_0;
|
|
binding4 = env2_2;
|
|
intl = binding3(binding4[15]).intl;
|
|
string = intl.string;
|
|
t = binding3(binding4[15]).t;
|
|
fEptJP = t.fEptJP;
|
|
binding(Reflect.apply(string, intl, [fEptJP]));
|
|
env1_4(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
saveGuildThemeNuxPreference = value4.saveGuildThemeNuxPreference;
|
|
} catch (error) {
|
|
binding = env2_12;
|
|
binding.error('Failed to save guild theme NUX preference', error);
|
|
binding = env1_3;
|
|
binding3 = env2_0;
|
|
binding4 = env2_2;
|
|
intl = binding3(binding4[15]).intl;
|
|
string = intl.string;
|
|
t = binding3(binding4[15]).t;
|
|
fEptJP = t.fEptJP;
|
|
binding(Reflect.apply(string, intl, [fEptJP]));
|
|
env1_4(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
binding = env2_12;
|
|
binding.error('Failed to save guild theme NUX preference', error);
|
|
binding = env1_3;
|
|
binding3 = env2_0;
|
|
binding4 = env2_2;
|
|
intl = binding3(binding4[15]).intl;
|
|
string = intl.string;
|
|
t = binding3(binding4[15]).t;
|
|
fEptJP = t.fEptJP;
|
|
binding(Reflect.apply(string, intl, [fEptJP]));
|
|
env1_4(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
} catch (error) {
|
|
binding = env2_12;
|
|
binding.error('Failed to save guild theme NUX preference', error);
|
|
binding = env1_3;
|
|
binding3 = env2_0;
|
|
binding4 = env2_2;
|
|
intl = binding3(binding4[15]).intl;
|
|
string = intl.string;
|
|
t = binding3(binding4[15]).t;
|
|
fEptJP = t.fEptJP;
|
|
binding(Reflect.apply(string, intl, [fEptJP]));
|
|
env1_4(false);
|
|
return undefined;
|
|
}
|
|
try {
|
|
value5 = Reflect.apply(saveGuildThemeNuxPreference, value4, [require, View]);
|
|
} catch (error) {
|
|
binding = env2_12;
|
|
binding.error('Failed to save guild theme NUX preference', error);
|
|
binding = env1_3;
|
|
binding3 = env2_0;
|
|
binding4 = env2_2;
|
|
intl = binding3(binding4[15]).intl;
|
|
string = intl.string;
|
|
t = binding3(binding4[15]).t;
|
|
fEptJP = t.fEptJP;
|
|
binding(Reflect.apply(string, intl, [fEptJP]));
|
|
env1_4(false);
|
|
return undefined;
|
|
}
|
|
yield value5;
|
|
try {
|
|
value6 = undefined;
|
|
value7 = false;
|
|
} catch (error) {
|
|
binding = env2_12;
|
|
binding.error('Failed to save guild theme NUX preference', error);
|
|
binding = env1_3;
|
|
binding3 = env2_0;
|
|
binding4 = env2_2;
|
|
intl = binding3(binding4[15]).intl;
|
|
string = intl.string;
|
|
t = binding3(binding4[15]).t;
|
|
fEptJP = t.fEptJP;
|
|
binding(Reflect.apply(string, intl, [fEptJP]));
|
|
env1_4(false);
|
|
return undefined;
|
|
}
|
|
if (value7) {
|
|
return value6;
|
|
}
|
|
env1_5.current = true;
|
|
var TAKE_ACTION = env2_9.TAKE_ACTION;
|
|
importDefault(TAKE_ACTION);
|
|
binding = env2_1;
|
|
binding(env2_2[14]).hideActionSheet('GuildThemeNuxActionSheet');
|
|
}
|
|
}
|
|
}
|
|
|
|
function _fun110097() { // fn#110097, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14754:1745, offset: 0x0236a576, size: 29 bytes, params: 1, frame: 11
|
|
const binding = env0_8;
|
|
const USER_DISMISS = ContentDismissActionType.USER_DISMISS;
|
|
binding(USER_DISMISS);
|
|
}
|
|
|