314 lines
16 KiB
TypeScript
314 lines
16 KiB
TypeScript
/* Metro module 14302; source: modules/auth/native/components/Auth.tsx; dependencies: [57, 31, 27, 661, 33, 14303, 5282, 14312, 5315, 8980, 4501, 697, 14353, 8973, 1599, 8584, 14354, 9002, 5280, 478, 1244, 14355, 4884, 14359, 2] */
|
|
import Module00057 from '../../../../by-id/module-00057.js'; /* Metro dependency 57 */
|
|
import BackgroundImage from './atoms/BackgroundImage.tsx'; /* Metro dependency 8584 */
|
|
import UseWideAuthView from '../useWideAuthView.tsx'; /* Metro dependency 8973 */
|
|
import AuthManager from '../AuthManager.tsx'; /* Metro dependency 14355 */
|
|
import UseOrientationLock from '../useOrientationLock.tsx'; /* Metro dependency 14359 */
|
|
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 JsxRuntimeModule from '../../../../by-id/module-00033-JsxRuntime.js'; /* Metro dependency 33 */
|
|
import * as ConstantsModule from '../../../../Constants.tsx'; /* Metro dependency 661 */
|
|
import * as CreateStylesModule from '../../../../design/components/Styles/native/createStyles.tsx'; /* Metro dependency 4501 */
|
|
import * as TTIAnalyticsUtilsModule from '../../../tti_analytics/native/TTIAnalyticsUtils.tsx'; /* Metro dependency 4884 */
|
|
import * as NavigatorNativeModule from '../../../../design/components/Navigator/native/Navigator.native.tsx'; /* Metro dependency 5280 */
|
|
import * as NavigatorHeaderNativeModule from '../../../../design/components/Navigator/native/NavigatorHeader.native.tsx'; /* Metro dependency 5282 */
|
|
import * as RegistrationStepsUtilsModule from '../RegistrationStepsUtils.tsx'; /* Metro dependency 14303 */
|
|
import * as RegistrationUtilsModule from '../RegistrationUtils.tsx'; /* Metro dependency 14312 */
|
|
import * as UseIsHCaptchaModalOpenTrackingModule from './utils/useIsHCaptchaModalOpenTracking.tsx'; /* Metro dependency 14353 */
|
|
import * as Module14354Module from '../../../../by-id/module-14354.js'; /* Metro dependency 14354 */
|
|
|
|
function _fun108193(global, require, importDefault, importAll, module, exports, dependencyMap) { // fn#108193, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:6, offset: 0x02317f07, size: 676 bytes, params: 8, frame: 25
|
|
const env0_0 = require;
|
|
const getInitialAuthScreen = function() {
|
|
return AuthStates.WELCOME;
|
|
};
|
|
let Object = global.Object;
|
|
Object.defineProperty(exports, '__esModule', {value: true});
|
|
let value = ReactModule;
|
|
const StyleSheet = ReactNativeModule.StyleSheet;
|
|
const AuthStates = (ConstantsModule).AuthStates;
|
|
const allAuthScreens = (RegistrationStepsUtilsModule).getAllAuthScreens();
|
|
Object = global.Object;
|
|
const fromEntries = Object.fromEntries;
|
|
const Object2 = global.Object;
|
|
const value6 = Object2.entries(allAuthScreens);
|
|
const env0_12 = Reflect.apply(fromEntries, Object, [value6.map(_fun108198)]);
|
|
object = {};
|
|
const LOGIN = AuthStates.LOGIN;
|
|
object[LOGIN] = (require(8980) /* metro dependency 8980: MFAUtils */).hasWebAuthn ? 600 : 540;
|
|
const MFA = AuthStates.MFA;
|
|
object[MFA] = 600;
|
|
const createStyles = CreateStylesModule.createStyles;
|
|
object = {};
|
|
object.transparent = {backgroundColor: 'transparent'};
|
|
object.cardContainer = {'flex': 1, 'position': 'relative', 'backgroundColor': 'transparent'};
|
|
object.wideOuterContainer = {'flex': 1, 'justifyContent': 'center'};
|
|
const object3 = {'backgroundColor': 'transparent', 'borderRadius': null, 'maxWidth': 480, 'alignSelf': 'center',
|
|
'width': '100%', 'maxHeight': '90%', 'overflow': 'hidden', 'height': 520};
|
|
object3.borderRadius = (importDefault(697) /* metro dependency 697: native */).radii.lg;
|
|
object.wideCard = object3;
|
|
let BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object.wideHeaderFlat = {borderBottomWidth: 0, backgroundColor: BACKGROUND_BASE_LOW};
|
|
const object5 = {};
|
|
object5.borderBottomWidth = StyleSheet.hairlineWidth;
|
|
const BORDER_SUBTLE = (importDefault(697) /* metro dependency 697: native */).colors.BORDER_SUBTLE;
|
|
object5.borderBottomColor = BORDER_SUBTLE;
|
|
BACKGROUND_BASE_LOW = (importDefault(697) /* metro dependency 697: native */).colors.BACKGROUND_BASE_LOW;
|
|
object5.backgroundColor = BACKGROUND_BASE_LOW;
|
|
object.wideHeader = object5;
|
|
const env0_14 = Reflect.apply(createStyles, CreateStylesModule, [object]);
|
|
const context = value.createContext(function() {
|
|
});
|
|
value = value.memo(Auth);
|
|
(FileImportTrackerModule).fileFinishedImporting('modules/auth/native/components/Auth.tsx');
|
|
exports.default = value;
|
|
exports.TrackRegistrationContext = context;
|
|
function NavigatorWithCaptchaHook() { // fn#108195, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:1453, offset: 0x023181ba, size: 977 bytes, params: 1, frame: 38
|
|
var r16;
|
|
var transparent;
|
|
var r5;
|
|
const Navigator = (NavigatorNativeModule).Navigator;
|
|
var object3;
|
|
var intl;
|
|
var Provider;
|
|
var object5;
|
|
var object6;
|
|
var value11;
|
|
var object8;
|
|
var items3;
|
|
var object10;
|
|
var space;
|
|
(UseIsHCaptchaModalOpenTrackingModule).useIsHCaptchaModalOpenTracking();
|
|
const value2 = (UseWideAuthView)();
|
|
const styles = useStyles();
|
|
const binding = env0_4;
|
|
const useState = binding.useState;
|
|
const value4 = Module00057(Reflect.apply(useState, binding, [getInitialAuthScreen()]), 2);
|
|
const property = value4[0];
|
|
const env0_0 = value4[1];
|
|
const [property2, property3] = Module00057(env0_4.useState(false), 2);
|
|
const value7 = (require(1599) /* metro dependency 1599 */).useKeyboardState(function(a0) {
|
|
return a0.height;
|
|
});
|
|
const value8 = value7 > 200;
|
|
const value9 = env0_4.useCallback(_fun108197, []);
|
|
const jsxRuntimeEnv0_9Binding = jsxRuntimeEnv0_9;
|
|
const value10 = ((Component) => <Component backgroundImageSource={Module14354Module} backgroundImageCover />)(BackgroundImage);
|
|
if (value2) {
|
|
Provider = (require(9002) /* metro dependency 9002: WideAuthScrollContext */).WideAuthScrollContext.Provider;
|
|
object5 = {value: property3};
|
|
object6 = {};
|
|
value11 = null;
|
|
object6.style = [styles.wideOuterContainer, value8 ? {paddingBottom: value7} : value11];
|
|
object8 = {};
|
|
items3 = [styles.wideCard];
|
|
r16 = value11 != property ? {height: value11 != env0_13[property] ? env0_13[property] : 520} : value11;
|
|
items3[1] = r16;
|
|
r16 = value8 ? {'maxHeight': '100%', 'height': '100%', 'marginTop': 32, 'borderBottomLeftRadius': 0,
|
|
'borderBottomRightRadius': 0} : value11;
|
|
items3[2] = r16;
|
|
object8.style = items3;
|
|
var navigatorProps2 = {'screens': null, 'containerStyle': null, 'viewStyle': null, 'headerStatusBarHeight': 0,
|
|
'cardOverlayEnabled': false, 'cardShadowEnabled': false, screens: env0_12,
|
|
containerStyle: styles.cardContainer,
|
|
viewStyle: property !== AuthStates.WELCOME ? value11 : styles.transparent,
|
|
initialRouteName: getInitialAuthScreen(), onWillFocus: Keyboard.dismiss, onStateChange: value9,
|
|
headerStyle: property2 ? styles.wideHeader : styles.wideHeaderFlat};
|
|
object10 = {};
|
|
object10.paddingLeft = (require(478) /* metro dependency 478: PlatformUtils */).isAndroid() ? (importDefault(697) /* metro dependency 697: native */).space.PX_12 : 20;
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
object10.paddingTop = space.PX_24;
|
|
space = (importDefault(697) /* metro dependency 697: native */).space;
|
|
object10.paddingBottom = space.PX_16;
|
|
navigatorProps2.headerLeftContainerStyle = object10;
|
|
navigatorProps2.disableHeaderAnimation = true;
|
|
r5 = (
|
|
<Provider {...object5}>
|
|
<View {...object6}>
|
|
<View {...object8}>
|
|
<Navigator {...navigatorProps2} />
|
|
</View>
|
|
</View>
|
|
</Provider>
|
|
);
|
|
} else {
|
|
object3 = {screens: env0_11};
|
|
transparent = styles.transparent;
|
|
object3.viewStyle = transparent;
|
|
transparent = styles.transparent;
|
|
object3.containerStyle = transparent;
|
|
intl = (require(1244) /* metro dependency 1244: indexNative */).intl;
|
|
object3.headerBackTitle = intl.string((require(1244) /* metro dependency 1244: indexNative */).t['13/7kX']);
|
|
object3.initialRouteName = getInitialAuthScreen();
|
|
object3.onWillFocus = Keyboard.dismiss;
|
|
object3.headerStyle = {borderBottomWidth: 0};
|
|
r5 = <Navigator {...object3} />;
|
|
}
|
|
return (
|
|
<>
|
|
{value10}
|
|
{r5}
|
|
</>
|
|
);
|
|
function _fun108197(a0) { // fn#108197, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:1728, offset: 0x02318595, size: 82 bytes, params: 2, frame: 15
|
|
const binding = env0_0;
|
|
const value2 = null;
|
|
const value3 = undefined;
|
|
const name = value2 == a0 || value2 == a0.routes[a0.index] ? value3 : a0.routes[a0.index].name;
|
|
binding(value2 != name ? name : value2);
|
|
env0_1(false);
|
|
return value3;
|
|
}
|
|
|
|
}
|
|
|
|
function _fun108198(a0) { // fn#108198, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:351, offset: 0x023185e7, size: 336 bytes, params: 2, frame: 18
|
|
var environment;
|
|
var r0;
|
|
var r1;
|
|
var r2;
|
|
var r8;
|
|
var item3;
|
|
var value4;
|
|
var headerLeft_1081992;
|
|
var object;
|
|
const value = Object.create(environment);
|
|
const iterator = a0[Symbol.iterator]();
|
|
const iterator2 = iterator.next;
|
|
let item2 = Reflect.apply(iterator2, iterator, []);
|
|
let item = item2.value;
|
|
item2 = item2.done ? undefined : iterator;
|
|
const value2 = undefined;
|
|
const value3 = item2 === value2;
|
|
const r7 = value3 ? value2 : item;
|
|
if (value3) {
|
|
r0 = item2;
|
|
r1 = value3;
|
|
r2 = value2;
|
|
} else {
|
|
item3 = Reflect.apply(iterator2, item2, []);
|
|
item = item3.value;
|
|
item3 = item3.done ? undefined : item2;
|
|
value4 = item3 === value2;
|
|
if (value4) {
|
|
r0 = item3;
|
|
r1 = value4;
|
|
r2 = value2;
|
|
} else {
|
|
r0 = item3;
|
|
r1 = value4;
|
|
r2 = item;
|
|
}
|
|
}
|
|
if (!r1) {
|
|
r0.return();
|
|
}
|
|
const items2 = [r7];
|
|
const object4 = {};
|
|
copyDataProperties(object4, r2, value);
|
|
const fullscreen = r2.fullscreen;
|
|
const value5 = null;
|
|
let r3 = fullscreen ? {'fullscreen': false, 'headerTransparent': false} : value5;
|
|
copyDataProperties(object4, r3, value);
|
|
const MFA = AuthStates.MFA;
|
|
if (r7 === MFA) {
|
|
r3 = value5;
|
|
r8 = value;
|
|
} else if (r7 === AuthStates.WELCOME) {
|
|
r3 = value5;
|
|
r8 = value;
|
|
} else {
|
|
headerLeft_1081992 = headerLeft_108199;
|
|
r3 = {headerLeft: headerLeft_1081992};
|
|
r8 = headerLeft_1081992;
|
|
}
|
|
copyDataProperties(object4, r3, r8);
|
|
const Set = global.Set;
|
|
const REGISTER_IDENTITY = AuthStates.REGISTER_IDENTITY;
|
|
const LOGIN = AuthStates.LOGIN;
|
|
const AGE_GATE_UNDERAGE = AuthStates.AGE_GATE_UNDERAGE;
|
|
const set = new Set([REGISTER_IDENTITY, LOGIN, AGE_GATE_UNDERAGE]);
|
|
if (set.has(r7)) {
|
|
object = {};
|
|
object.cardStyleInterpolator = (require(5315) /* metro dependency 5315 */).CardStyleInterpolators.forFadeFromCenter;
|
|
r2 = object;
|
|
} else {
|
|
r2 = value5;
|
|
}
|
|
copyDataProperties(object4, r2, Set);
|
|
items2[1] = object4;
|
|
return items2;
|
|
function headerLeft_108199(a0) { // fn#108199, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:456, offset: 0x02318737, size: 133 bytes, params: 2, frame: 17
|
|
var environment;
|
|
var r0;
|
|
var object;
|
|
var binding;
|
|
const headerLeft_108199BackImage2 = headerLeft_108199BackImage;
|
|
var value;
|
|
let headerLeft = env0_0.headerLeft;
|
|
if (headerLeft != null) {
|
|
binding = env0_0;
|
|
headerLeft = binding.headerLeft;
|
|
object = {};
|
|
copyDataProperties(object, a0, undefined);
|
|
object['backImage'] = headerLeft_108199BackImage2;
|
|
r0 = Reflect.apply(headerLeft, binding, [object]);
|
|
} else {
|
|
value = environment.__proto__;
|
|
const BackButtonWithTracking = (require(14312) /* metro dependency 14312: RegistrationUtils */).BackButtonWithTracking;
|
|
value = <BackButtonWithTracking {...a0} {...{['backImage']: headerLeft_108199BackImage2}} />;
|
|
r0 = value;
|
|
}
|
|
return r0;
|
|
function headerLeft_108199BackImage() { // fn#108200, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:484, owner: headerLeft_108199.backImage, offset: 0x023187bc, size: 45 bytes, params: 1, frame: 13
|
|
const HeaderBackImage = (NavigatorHeaderNativeModule).HeaderBackImage;
|
|
return <HeaderBackImage />;
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function Auth() { // fn#108202, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:2995, offset: 0x023187e9, size: 180 bytes, params: 1, frame: 16
|
|
env0_4.useEffect(_fun108203, []);
|
|
env0_4.useLayoutEffect(_fun108205, []);
|
|
(UseOrientationLock)();
|
|
const env0_0 = env0_4.useRef(undefined);
|
|
const value2 = env0_4.useCallback(_fun108206, []);
|
|
const Provider = env0_15.Provider;
|
|
return (
|
|
<Provider value={value2()}>
|
|
<NavigatorWithCaptchaHook />
|
|
</Provider>
|
|
);
|
|
function _fun108203() { // fn#108203, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:3024, offset: 0x0231889d, size: 46 bytes, params: 1, frame: 11
|
|
var environment;
|
|
const value = environment.__proto__;
|
|
(AuthManager).initialize();
|
|
return _fun108204;
|
|
function _fun108204() { // fn#108204, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:3051, offset: 0x023188cb, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__.__proto__;
|
|
return (AuthManager).terminate();
|
|
}
|
|
|
|
}
|
|
|
|
function _fun108205() { // fn#108205, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:3101, offset: 0x023188f0, size: 37 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (TTIAnalyticsUtilsModule).trackAppUIViewed();
|
|
}
|
|
|
|
function _fun108206() { // fn#108206, source: /ci/build/discord/discord/discord_android_rn/android/app/src/main/assets/index.android.bundle:14499:3189, offset: 0x02318915, size: 45 bytes, params: 1, frame: 11
|
|
const value = environment.__proto__;
|
|
return (RegistrationUtilsModule).getTrackRegTransition(env0_0);
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
global.__d(_fun108193, 14302, [57, 31, 27, 661, 33, 14303, 5282, 14312, 5315, 8980, 4501, 697, 14353, 8973, 1599,
|
|
8584, 14354, 9002, 5280, 478, 1244, 14355, 4884, 14359,
|
|
2]) /* metro module 14302, dependencies: [57, 31, 27, 661, 33, 14303, 5282, 14312, 5315, 8980, 4501, 697, 14353, 8973, 1599, 8584, 14354, 9002, 5280, 478, 1244, 14355, 4884, 14359, 2] */;
|