113 lines
6.6 KiB
TypeScript
113 lines
6.6 KiB
TypeScript
/* Metro module 15640; source: modules/captcha/native/HcaptchaModal.tsx; dependencies: [29, 31, 27, 1949, 1878, 661, 33, 4501, 566, 1484, 1909, 1585, 1244, 9486, 4571, 4572, 697, 4573, 477, 15639, 5278, 4066, 2] */
|
|
function _fun119773(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#119773, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15848:6, offset: 0x02518d3f, size: 389 bytes, params: 8, frame: 21
|
|
const env0_0 = require;
|
|
const env0_3 = ['onMessage', 'onClose'];
|
|
const Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
const env0_4 = importDefault(29) /* metro dependency 29 */;
|
|
const env0_5 = importAll(31) /* metro dependency 31 */;
|
|
let value = require(27) /* metro dependency 27 */;
|
|
const env0_6 = value.ActivityIndicator;
|
|
const env0_7 = value.View;
|
|
const env0_8 = value.StyleSheet;
|
|
const localeStore = importDefault(1949) /* metro dependency 1949: LocaleStore */;
|
|
const userStore = importDefault(1878) /* metro dependency 1878: UserStore */;
|
|
const ModalAnimation = (require(661) /* metro dependency 661: Constants */).ModalAnimation;
|
|
value = require(33) /* metro dependency 33 */;
|
|
const env0_11 = value.jsx;
|
|
const env0_12 = value.jsxs;
|
|
const env0_13 = (require(4501) /* metro dependency 4501: createStyles */).createStyles({container: {'flex': 1,
|
|
'justifyContent': 'center', 'alignItems': 'center'}, title: {textAlign: 'center'},
|
|
closeButtonContainer: {'position': 'absolute', 'top': 0, 'left': 0, 'zIndex': 2},
|
|
closeButtonHitArea: {'minWidth': 44, 'minHeight': 44, 'justifyContent': 'center', 'alignItems': 'center'}});
|
|
const closure = HcaptchaModal;
|
|
const FADE = ModalAnimation.FADE;
|
|
closure.modalConfig = {animation: FADE};
|
|
(require(2) /* metro dependency 2 */).fileFinishedImporting('modules/captcha/native/HcaptchaModal.tsx');
|
|
exports.default = closure;
|
|
}
|
|
|
|
function HcaptchaModal(a0) { // fn#119774, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15848:559, offset: 0x02518ec4, size: 1011 bytes, params: 2, frame: 32
|
|
var r5;
|
|
var Stack;
|
|
var object;
|
|
var value12;
|
|
var items4;
|
|
var moduleValue3;
|
|
const onMessage = a0.onMessage;
|
|
a0.onClose;
|
|
const binding = env0_4;
|
|
const value2 = undefined;
|
|
const value3 = binding(a0, env0_3);
|
|
const styles = useStyles();
|
|
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
|
|
return UserStore.getCurrentUser();
|
|
});
|
|
const value4 = (require(1484) /* metro dependency 1484: useNavigationNative */).useNavigation();
|
|
const getState = value4.getState;
|
|
const routes = Reflect.apply(getState, value4, []).routes;
|
|
let r4 = routes.length > 0 && routes[0].name === 'auth';
|
|
r4 = !r4 ? (currentUser == null ? value2 : currentUser.ageVerificationStatus) === (require(1909) /* metro dependency 1909: Server */).AgeVerificationStatusUkAndAusOnly.CLIENT_ONLY_PENDING : r4;
|
|
const value8 = (importDefault(1585) /* metro dependency 1585: useSafeAreaInsetsNative */)();
|
|
const intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
let string = intl.string;
|
|
const value9 = Reflect.apply(string, intl, [(require(1244) /* metro dependency 1244: indexNative */).t.wsoPhr]);
|
|
const value10 = env0_5.useCallback(_fun119776, [onMessage]);
|
|
(importDefault(4571) /* metro dependency 4571: useBackPressHandler */)(_fun119777);
|
|
if (r4) {
|
|
r5 = !r4;
|
|
} else {
|
|
Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
|
|
object = {};
|
|
value12 = 16;
|
|
object.spacing = importDefault(dependencyMap[value12]).space.PX_16;
|
|
object.align = 'center';
|
|
items4 = [((Text) => <Text accessibilityRole="header" variant="heading-lg/bold" color="mobile-text-heading-primary" style={styles.title}>{value9}</Text>)((require(4573) /* metro dependency 4573: Text */).Text)];
|
|
moduleValue3 = require(477) /* metro dependency 477: PlatformUtils */;
|
|
items4[1] = <ActivityIndicator size="small" color={moduleValue3.isAndroid() ? importDefault(dependencyMap[value12]).unsafe_rawColors.WHITE : value2} />;
|
|
r5 = <Stack {...object}>{items4}</Stack>;
|
|
}
|
|
const items2 = [r5];
|
|
items2[1] = <View style={StyleSheet.absoluteFillObject}>{((Component) => <Component {...value3} {...{['languageCode']: LocaleStore.locale}} {...{['onMessage']: onMessage}} />)(importDefault(15639) /* metro dependency 15639 */)}</View>;
|
|
const items3 = [styles.closeButtonContainer];
|
|
const object3 = {};
|
|
const top = value8.top;
|
|
const PX_8 = (importDefault(697) /* metro dependency 697: native */).space.PX_8;
|
|
object3.paddingTop = top + PX_8;
|
|
const left = value8.left;
|
|
const PX_16 = (importDefault(697) /* metro dependency 697: native */).space.PX_16;
|
|
object3.paddingLeft = left + PX_16;
|
|
items3[1] = object3;
|
|
const PressableOpacity = (require(5278) /* metro dependency 5278: Pressables */).PressableOpacity;
|
|
string = intl.string;
|
|
const cpT0Cq = (require(1244) /* metro dependency 1244: indexNative */).t.cpT0Cq;
|
|
const XLargeIcon = (require(4066) /* metro dependency 4066: XLargeIcon */).XLargeIcon;
|
|
const INTERACTIVE_ICON_DEFAULT = (importDefault(697) /* metro dependency 697: native */).colors.INTERACTIVE_ICON_DEFAULT;
|
|
items2[2] = <View style={items3} pointerEvents="box-none"><PressableOpacity accessibilityRole="button" accessibilityLabel={Reflect.apply(string,
|
|
intl,
|
|
[cpT0Cq])} onPress={value10} style={styles.closeButtonHitArea}><XLargeIcon color={INTERACTIVE_ICON_DEFAULT} /></PressableOpacity></View>;
|
|
return (
|
|
<View style={styles.container}>
|
|
{items2}
|
|
</View>
|
|
);
|
|
}
|
|
|
|
function _fun119776() { // fn#119776, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15848:923, offset: 0x025192b7, size: 76 bytes, params: 1, frame: 14
|
|
var object;
|
|
let onMessageBinding = onMessage;
|
|
if (onMessageBinding != null) {
|
|
onMessageBinding = onMessage;
|
|
object = {};
|
|
value = environment.__proto__;
|
|
object.data = (require(9486) /* metro dependency 9486: SharedCaptchaUtils */).CaptchaError.CANCEL;
|
|
onMessageBinding({nativeEvent: object});
|
|
}
|
|
}
|
|
|
|
function _fun119777() { // fn#119777, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:15848:1014, offset: 0x02519303, size: 17 bytes, params: 1, frame: 9
|
|
env0_1();
|
|
return true;
|
|
}
|
|
|