Files
2026-07-28 01:06:53 +03:00

159 lines
8.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] */
import ObjectWithoutProperties from '../../../by-id/module-00029-ObjectWithoutProperties.js'; /* Metro dependency 29 */
import Native from '../../../external/discord_common/js/packages/tokens/native.tsx'; /* Metro dependency 697 */
import UseSafeAreaInsetsNative from '../../safe_area/useSafeAreaInsets.native.tsx'; /* Metro dependency 1585 */
import UserStore from '../../../stores/UserStore.tsx'; /* Metro dependency 1878 */
import LocaleStore from '../../user_settings/LocaleStore.tsx'; /* Metro dependency 1949 */
import UseBackPressHandler from '../../routing/native/useBackPressHandler.tsx'; /* Metro dependency 4571 */
import * as FileImportTrackerModule from '../../../by-id/module-00002-FileImportTracker.js'; /* Metro dependency 2 */
import * as ReactNativeModule from '../../../by-id/module-00027-ReactNative.js'; /* Metro dependency 27 */
import * as ReactModule from '../../../by-id/module-00031-React.js'; /* Metro dependency 31 */
import * as ConstantsModule from '../../../Constants.tsx'; /* Metro dependency 661 */
import * as IndexNativeModule from '../../../intl/index.native.tsx'; /* Metro dependency 1244 */
import * as UseNavigationNativeModule from '../../../design/components/Navigator/native/useNavigation.native.tsx'; /* Metro dependency 1484 */
import * as XLargeIconModule from '../../../design/components/Icon/native/redesign/generated/XLargeIcon.tsx'; /* Metro dependency 4066 */
import * as CreateStylesModule from '../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
import * as PressablesModule from '../../../design/void/Pressables/native/Pressables.tsx'; /* Metro dependency 5278 */
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});
let value = ReactNativeModule;
const env0_6 = value.ActivityIndicator;
const env0_7 = value.View;
const env0_8 = value.StyleSheet;
const ModalAnimation = (ConstantsModule).ModalAnimation;
value = require(33) /* metro dependency 33 */;
const env0_11 = value.jsx;
const env0_12 = value.jsxs;
const env0_13 = (CreateStylesModule).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 HcaptchaModal2 = HcaptchaModal;
const FADE = ModalAnimation.FADE;
HcaptchaModal2.modalConfig = {animation: FADE};
(FileImportTrackerModule).fileFinishedImporting('modules/captcha/native/HcaptchaModal.tsx');
exports.default = HcaptchaModal2;
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 object2;
var value12;
var items4;
var moduleValue3;
const onMessage = a0.onMessage;
a0.onClose;
const value2 = undefined;
const value3 = ObjectWithoutProperties(a0, env0_3);
const styles = useStyles();
const currentUser = (require(566) /* metro dependency 566: flux */).useStateFromStores([UserStore], function() {
return UserStore.getCurrentUser();
});
const value4 = (UseNavigationNativeModule).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 = (UseSafeAreaInsetsNative)();
const intl = (IndexNativeModule).intl;
let string = intl.string;
const value9 = Reflect.apply(string, intl, [(IndexNativeModule).t.wsoPhr]);
const value10 = ReactModule.useCallback(_fun119776, [onMessage]);
(UseBackPressHandler)(_fun119777);
if (r4) {
r5 = !r4;
} else {
Stack = (require(4572) /* metro dependency 4572: StackNative */).Stack;
object2 = {};
value12 = 16;
object2.spacing = importDefault(dependencyMap[value12]).space.PX_16;
object2.align = 'center';
const Text = (require(4573) /* metro dependency 4573: Text */).Text;
items4 = [
<Text
accessibilityRole="header"
variant="heading-lg/bold"
color="mobile-text-heading-primary"
style={styles.title}
>
{value9}
</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 {...object2}>
{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 object4 = {};
const top = value8.top;
const PX_8 = (Native).space.PX_8;
object4.paddingTop = top + PX_8;
const left = value8.left;
const PX_16 = (Native).space.PX_16;
object4.paddingLeft = left + PX_16;
items3[1] = object4;
const PressableOpacity = (PressablesModule).PressableOpacity;
string = intl.string;
const cpT0Cq = (IndexNativeModule).t.cpT0Cq;
const XLargeIcon = (XLargeIconModule).XLargeIcon;
const INTERACTIVE_ICON_DEFAULT = (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 object2;
let onMessageBinding = onMessage;
if (onMessageBinding != null) {
onMessageBinding = onMessage;
object2 = {};
value = environment.__proto__;
object2.data = (require(9486) /* metro dependency 9486: SharedCaptchaUtils */).CaptchaError.CANCEL;
onMessageBinding({nativeEvent: object2});
}
}
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;
}
}
}
global.__d(_fun119773, 15640, [29, 31, 27, 1949, 1878, 661, 33, 4501, 566, 1484, 1909, 1585, 1244, 9486, 4571, 4572,
697, 4573, 477, 15639, 5278, 4066,
2]) /* metro module 15640, dependencies: [29, 31, 27, 1949, 1878, 661, 33, 4501, 566, 1484, 1909, 1585, 1244, 9486, 4571, 4572, 697, 4573, 477, 15639, 5278, 4066, 2] */;