decord/beta/source/modules/webauthn/native/PasskeyUpsellManager.tsx
2026-10-07 22:43:51 +00:00

87 lines
3.8 KiB
TypeScript

// Module ID: 15516
// Function ID: 15517
// Name: PasskeyUpsellManager
// Dependencies: [502, 1377, 14492, 1085, 6613, 6439, 4698, 2036, 4736, 6086, 15513, 2]
// Module 15516 (PasskeyUpsellManager)
import Constants from "Constants" /* 1085 */;
import dismissible_content from "dismissible_content" /* 2036 */;
import DismissibleContentUnsafeUtils from "DismissibleContentUnsafeUtils" /* 4698 */;
import NavigationRouteUtils from "NavigationRouteUtils" /* 4736 */;
import WebAuthnActionCreators from "WebAuthnActionCreators" /* 6086 */;
import MFAUtils from "MFAUtils" /* 6439 */;
import PasskeyUpsellActionCreatorsDefault from "PasskeyUpsellActionCreators" /* 15513 */;
import AuthenticationStore from "AuthenticationStore" /* 502 */;
import UserStore from "UserStore" /* 1377 */;
import WebAuthnStore from "WebAuthnStore" /* 14492 */;
import AutomaticLifecycleManager from "AutomaticLifecycleManager" /* 6613 */;
import size from "module_2" /* 2 */;
let map;
const LoginStates = Constants.LoginStates;
let c7 = false;
let c8 = false;
class PasskeyUpsellManager extends AutomaticLifecycleManager {
constructor() {
const applyArgumentsResult = HermesBuiltin.applyArguments(this, new.target);
applyArgumentsResult.actions = { POST_CONNECTION_OPEN: applyArgumentsResult.handlePasskeyUpsellShow, LOGIN_RESET: applyArgumentsResult.handleLogout, LOGIN_SUCCESS: applyArgumentsResult.handleLoginSuccess, LOGOUT: applyArgumentsResult.handleLogout };
map = new Map();
const result = map.set(AuthenticationStore, applyArgumentsResult.handlePasskeyUpsellShow);
const result1 = result.set(UserStore, applyArgumentsResult.handlePasskeyUpsellShow);
applyArgumentsResult.stores = result1.set(WebAuthnStore, applyArgumentsResult.handlePasskeyUpsellShow);
return applyArgumentsResult;
}
handlePasskeyUpsellShow() {
const tmp = c8;
if (tmp) {
if (MFAUtils.hasWebAuthn) {
const obj = AuthenticationStore;
if (AuthenticationStore.getLoginStatus() === LoginStates.NONE) {
if (obj.attemptedPasswordLogin()) {
const tmp2Result = DismissibleContentUnsafeUtils;
if (!tmp2Result.UNSAFE_isDismissibleContentDismissed(dismissible_content.DismissibleContent.PASSWORDLESS_UPSELL)) {
if (!WebAuthnStore.hasFetchedCredentials()) {
const tmp2Result3 = NavigationRouteUtils;
if (!tmp2Result3.isModalOpen()) {
const currentUser = UserStore.getCurrentUser();
const tmp7 = undefined !== currentUser && currentUser.verified;
if (tmp7) {
if (WebAuthnStore.hasFetchedCredentials()) {
const obj6 = PasskeyUpsellActionCreatorsDefault;
obj6.openPasskeyUpsell();
} else {
const tmp8 = c7;
if (!tmp8) {
c7 = true;
const tmp2Result4 = WebAuthnActionCreators;
const webAuthnCredentials = tmp2Result4.fetchWebAuthnCredentials();
}
}
}
}
}
}
}
}
}
}
}
handleLoginSuccess() {
c8 = true;
}
handleLogout() {
c7 = false;
c8 = false;
}
markDismissed(USER_DISMISS) {
const obj = DismissibleContentUnsafeUtils;
const obj2 = { dismissAction: USER_DISMISS, forceTrack: true };
return obj.UNSAFE_markDismissibleContentAsDismissed(dismissible_content.DismissibleContent.PASSWORDLESS_UPSELL, obj2);
}
}
const prototype = PasskeyUpsellManager.prototype;
const passkeyUpsellManager = new PasskeyUpsellManager();
let result = size.fileFinishedImporting("modules/webauthn/native/PasskeyUpsellManager.tsx");
export default passkeyUpsellManager;