This commit is contained in:
janisslsm committed 2026-11-01 12:12:55 +02:00
1 parent 1781d25a15
commit 732c0ad767
33051 files changed
+2591613 -3019689

No files matched your search

@@ -0,0 +1,129 @@
// Metro module 11814 (f11815).
import AuthenticationStore from "../../../stores/AuthenticationStore";
import { AnalyticEvents, MarketingURLs, Routes } from "../../../Constants";
import ModalActionCreators from "../../../actions/ModalActionCreators";
import { showSimpleLoadingModal } from "./SimpleLoadingModal";
import MobileWebHandoffUtils from "../MobileWebHandoffUtils";
import AnalyticsUtils from "../../../utils/AnalyticsUtils";
import { maybeExtractId } from "../../../_bundle/Module513";
import { getLoginHandoffSourceFromRedirectTo, LoginHandoffSource } from "../../auth/LoginHandoffSource";
import URLUtils from "../../../utils/URLUtils";
import Linking from "../../../lib/native/Linking";
let c8101_8;
const createHandoffTokenWithLoadingModal = function createHandoffTokenWithLoadingModal({ nonce, fingerprint, handoffSource }) {
return new Promise((resolve) => {
ModalActionCreators.popWithKey(c8101_8);
if (AuthenticationStore.isAuthenticated()) {
showSimpleLoadingModal(c8101_8, {
operation: () => MobileWebHandoffUtils.createHandoffToken(nonce),
onResolved: resolve,
onRejected: () => {
AnalyticsUtils.track(AnalyticEvents.MOBILE_WEB_HANDOFF_FAILURE, {
reason: "handoff_token_fetch_failure",
fingerprint: maybeExtractId(fingerprint),
handoff_source: handoffSource
}, {
fingerprint
});
resolve("null");
}
});
} else {
AnalyticsUtils.track(AnalyticEvents.MOBILE_WEB_HANDOFF_FAILURE, {
reason: "user_not_authenticated_in_app",
fingerprint: maybeExtractId(fingerprint),
handoff_source: handoffSource
}, {
fingerprint
});
resolve("null");
}
});
};
c8101_8 = "mweb-handoff";
const r27 = {
redirectWithHandoffToken: async function redirectWithHandoffToken(c27185_0, c27185_1) {
let c27185_4;
let env30458;
c27185_4 = void 0;
const r10 = env30458 = {};
let c27185_3 = r10;
env30458[1] = void 0;
env30458[2] = void 0;
env30458[0] = c27185_0;
let r13 = c27185_1;
if (r13 === void 0) {
r13 = {};
}
const forceExternalBrowser = r13.forceExternalBrowser;
if (forceExternalBrowser !== void 0) {
env30458[1] = forceExternalBrowser;
const { forceExternalBrowser: _forceExternalBrowser, ...rest } = r13;
env30458[2] = rest;
env30458[3] = void 0;
env30458[4] = void 0;
env30458[5] = void 0;
} else {
env30458[1] = false;
const { forceExternalBrowser: _forceExternalBrowser, ...rest } = r13;
env30458[2] = rest;
env30458[3] = void 0;
env30458[4] = void 0;
env30458[5] = void 0;
}
await void 0;
let nonce2 = env30458[2].nonce;
if (nonce2 == null) {
nonce2 = MobileWebHandoffUtils.generateNonce();
}
env30458[3] = {
...env30458[2],
nonce: nonce2,
handoffSource: getLoginHandoffSourceFromRedirectTo(env30458[0])
};
env30458[4] = await (0, createHandoffTokenWithLoadingModal)(env30458[3]);
env30458[5] = env30458[2].skipLoginRedirect === true ? (function sanitizeRedirectURL(a0) {
const uRL = new URL(`${location.protocol}${window.GLOBAL_ENV.WEBAPP_ENDPOINT}`);
const uRL2 = new URL(a0, uRL);
uRL.pathname = uRL2.pathname;
uRL.search = uRL2.search;
uRL.hash = uRL2.hash;
return uRL;
})(env30458[0]) : new URL(URLUtils.makeUrl(Routes.LOGIN_HANDOFF, false));
env30458[5].searchParams.append("handoff_token", env30458[4]);
if (env30458[2].skipLoginRedirect !== true) {
env30458[5].searchParams.append("handoff_key", env30458[3].nonce);
env30458[5].searchParams.append("redirect_to", env30458[0]);
}
if (env30458[1]) {
Linking.openURLExternally(env30458[5].href);
} else {
Linking.performURLNavigation(env30458[5].href);
}
},
redirectDeveloperPortalWithHandoffToken: async function redirectDeveloperPortalWithHandoffToken(c27186_0, c27186_1) {
let c27186_4;
c27186_4 = void 0;
let c30459_0 = c27186_0;
let r36 = c27186_1;
if (r36 === void 0) {
r36 = {};
}
let c30459_1 = r36;
await void 0;
const nonce4 = c30459_1.nonce;
let nonce3 = nonce4;
if (nonce4 == null) {
nonce3 = MobileWebHandoffUtils.generateNonce();
}
let c30459_2 = {
...c30459_1,
nonce: nonce3,
handoffSource: LoginHandoffSource.ROLE_SUBSCRIPTION_SETTING
};
let c30459_3 = await (0, createHandoffTokenWithLoadingModal)(c30459_2);
let c30459_4 = new URL(`${location.protocol}${MarketingURLs.DEVELOPER_PORTAL_LOGIN_HANDOFF(c30459_2.nonce, c30459_3, c30459_0)}`);
Linking.performURLNavigation(c30459_4.href);
}
};
export default r27;
@@ -0,0 +1,16 @@
// Metro module 11815 (f11816).
import ModalActionCreators from "../../../actions/ModalActionCreators";
export function showSimpleLoadingModal(a0, a1) {
ModalActionCreators.pushLazy(import("./SimpleLoadingModalUI"), {
...a1,
onDismissed: () => {
ModalActionCreators.popWithKey(a0);
const onDismissed2 = a1.onDismissed;
if (onDismissed2 != null) {
onDismissed2.call(a1);
}
}
}, a0, {
animation: "none"
});
}
@@ -0,0 +1,79 @@
// Metro module 11816 (f11817).
import { useRef, useCallback, useEffect } from "react";
import { Modal, View } from "react-native";
import { createStyles } from "../../../design/components/Styles/native/createStyles";
import { ActivityIndicator } from "../../../design/components/ActivityIndicator/native/ActivityIndicator.native";
const useStyles = createStyles({
modalBackground: {
flex: 1,
alignItems: "center",
flexDirection: "column",
justifyContent: "center"
}
});
let c8103_7 = {
OPENING: 0,
0: "OPENING",
SHOWN: 1,
1: "SHOWN",
DISMISSED: 2,
2: "DISMISSED"
};
export default function SimpleLoadingModal(props) {
let c19193_2, c19193_3, c19193_4, ref, callback, callback2, callback3;
const { operation, onResolved = () => {} } = props;
let c19193_1 = onResolved;
let onRejected = props.onRejected;
if (onRejected === void 0) {
onRejected = () => {};
}
c19193_2 = onRejected;
let cancelable = props.cancelable;
if (cancelable === void 0) {
cancelable = false;
}
c19193_3 = cancelable;
let onDismissed = props.onDismissed;
if (onDismissed === void 0) {
onDismissed = () => {};
}
c19193_4 = onDismissed;
ref = void 0;
callback = void 0;
callback2 = void 0;
callback3 = void 0;
const styles = useStyles();
ref = useRef(c8103_7.OPENING);
callback = useCallback(() => {
if (ref.current === c8103_7.SHOWN) {
c19193_4();
}
ref.current = c8103_7.DISMISSED;
}, [onDismissed]);
callback2 = useCallback((a0) => {
c19193_1(a0);
callback();
}, [callback, onResolved]);
callback3 = useCallback((a0) => {
c19193_2(a0);
callback();
}, [callback, onRejected]);
useEffect(() => {
operation().then((result) => callback2(result)).catch((error) => callback3(error));
}, [operation, callback2, callback3]);
return <Modal transparent animationType="none" onShow={() => {
if (ref.current === c8103_7.DISMISSED) {
c19193_4();
} else {
ref.current = c8103_7.SHOWN;
}
}} onRequestClose={() => {
if (c19193_3) {
callback();
}
}}>
<View style={styles.modalBackground}>
<ActivityIndicator />
</View>
</Modal>;
};