@onairos/react-native 3.1.17 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +374 -403
- package/lib/commonjs/api/index.js +1 -75
- package/lib/commonjs/api/index.js.map +1 -1
- package/lib/commonjs/assets/images/email.png +0 -0
- package/lib/commonjs/assets/images/linkedin.png +0 -0
- package/lib/commonjs/assets/images/reddit.png +0 -0
- package/lib/commonjs/assets/images/youtube.png +0 -0
- package/lib/commonjs/components/DataRequestModal.js.map +1 -1
- package/lib/commonjs/components/DataRequestScreen.js.map +1 -1
- package/lib/commonjs/components/EmailVerificationModal.js.map +1 -1
- package/lib/commonjs/components/Onairos.js +3 -1
- package/lib/commonjs/components/Onairos.js.map +1 -1
- package/lib/commonjs/components/OnairosButton.js +190 -171
- package/lib/commonjs/components/OnairosButton.js.map +1 -1
- package/lib/commonjs/components/Overlay.js +5 -5
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/components/PinInput.js +120 -282
- package/lib/commonjs/components/PinInput.js.map +1 -1
- package/lib/commonjs/components/PlatformList.js.map +1 -1
- package/lib/commonjs/components/TrainingModal.js +563 -808
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +1283 -2304
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.tsx.new +455 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +743 -134
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/commonjs/components/onboarding/OnboardingHeader.js.map +1 -1
- package/lib/commonjs/components/onboarding/PinInput.js.map +1 -1
- package/lib/commonjs/components/onboarding/PlatformConnector.js.map +1 -1
- package/lib/commonjs/components/screens/ConnectorScreen.js.map +1 -1
- package/lib/commonjs/components/screens/LoadingScreen.js.map +1 -1
- package/lib/commonjs/components/screens/PinCreationScreen.js.map +1 -1
- package/lib/commonjs/constants/index.js.map +1 -1
- package/lib/commonjs/hooks/useConnections.js +125 -120
- package/lib/commonjs/hooks/useConnections.js.map +1 -1
- package/lib/commonjs/hooks/useCredentials.js.map +1 -1
- package/lib/commonjs/index.js +31 -193
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/apiKeyService.js +102 -101
- package/lib/commonjs/services/apiKeyService.js.map +1 -1
- package/lib/commonjs/services/oauthService.js.map +1 -1
- package/lib/commonjs/services/platformAuthService.js +722 -956
- package/lib/commonjs/services/platformAuthService.js.map +1 -1
- package/lib/commonjs/types/ambient.d.js.map +1 -1
- package/lib/commonjs/types/declarations.d.js.map +1 -1
- package/lib/commonjs/types/index.d.js.map +1 -1
- package/lib/commonjs/types/index.js.map +1 -1
- package/lib/commonjs/types/node-fix.d.js.map +1 -1
- package/lib/commonjs/types/node-override.d.js.map +1 -1
- package/lib/commonjs/types/opacity.d.js.map +1 -1
- package/lib/commonjs/types/types.d.js.map +1 -1
- package/lib/commonjs/types.js.map +1 -1
- package/lib/commonjs/utils/Portal.js +4 -4
- package/lib/commonjs/utils/Portal.js.map +1 -1
- package/lib/commonjs/utils/api.js +24 -24
- package/lib/commonjs/utils/api.js.map +1 -1
- package/lib/commonjs/utils/auth.js +18 -18
- package/lib/commonjs/utils/auth.js.map +1 -1
- package/lib/commonjs/utils/crypto.js +13 -13
- package/lib/commonjs/utils/crypto.js.map +1 -1
- package/lib/commonjs/utils/debugHelper.js.map +1 -1
- package/lib/commonjs/utils/encryption.js +12 -12
- package/lib/commonjs/utils/encryption.js.map +1 -1
- package/lib/commonjs/utils/onairosApi.js.map +1 -1
- package/lib/commonjs/utils/programmaticFlow.js +16 -16
- package/lib/commonjs/utils/programmaticFlow.js.map +1 -1
- package/lib/commonjs/utils/retryHelper.js +27 -27
- package/lib/commonjs/utils/retryHelper.js.map +1 -1
- package/lib/commonjs/utils/secureStorage.js.map +1 -1
- package/lib/module/api/index.js +0 -72
- package/lib/module/api/index.js.map +1 -1
- package/lib/module/assets/images/email.png +0 -0
- package/lib/module/assets/images/linkedin.png +0 -0
- package/lib/module/assets/images/reddit.png +0 -0
- package/lib/module/assets/images/youtube.png +0 -0
- package/lib/module/components/DataRequestModal.js.map +1 -1
- package/lib/module/components/DataRequestScreen.js.map +1 -1
- package/lib/module/components/EmailVerificationModal.js.map +1 -1
- package/lib/module/components/Onairos.js +3 -1
- package/lib/module/components/Onairos.js.map +1 -1
- package/lib/module/components/OnairosButton.js +192 -172
- package/lib/module/components/OnairosButton.js.map +1 -1
- package/lib/module/components/Overlay.js +5 -5
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/components/PinInput.js +120 -283
- package/lib/module/components/PinInput.js.map +1 -1
- package/lib/module/components/PlatformList.js.map +1 -1
- package/lib/module/components/TrainingModal.js +565 -809
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +1284 -2307
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.tsx.new +455 -0
- package/lib/module/components/onboarding/OAuthWebView.js +744 -136
- package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/module/components/onboarding/OnboardingHeader.js.map +1 -1
- package/lib/module/components/onboarding/PinInput.js.map +1 -1
- package/lib/module/components/onboarding/PlatformConnector.js.map +1 -1
- package/lib/module/components/screens/ConnectorScreen.js.map +1 -1
- package/lib/module/components/screens/LoadingScreen.js.map +1 -1
- package/lib/module/components/screens/PinCreationScreen.js.map +1 -1
- package/lib/module/constants/index.js.map +1 -1
- package/lib/module/hooks/useConnections.js +125 -119
- package/lib/module/hooks/useConnections.js.map +1 -1
- package/lib/module/hooks/useCredentials.js.map +1 -1
- package/lib/module/index.js +15 -51
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/apiKeyService.js +102 -101
- package/lib/module/services/apiKeyService.js.map +1 -1
- package/lib/module/services/oauthService.js.map +1 -1
- package/lib/module/services/platformAuthService.js +704 -943
- package/lib/module/services/platformAuthService.js.map +1 -1
- package/lib/module/types/ambient.d.js.map +1 -1
- package/lib/module/types/declarations.d.js.map +1 -1
- package/lib/module/types/index.d.js.map +1 -1
- package/lib/module/types/index.js.map +1 -1
- package/lib/module/types/node-fix.d.js.map +1 -1
- package/lib/module/types/node-override.d.js.map +1 -1
- package/lib/module/types/opacity.d.js.map +1 -1
- package/lib/module/types/types.d.js.map +1 -1
- package/lib/module/types.js.map +1 -1
- package/lib/module/utils/Portal.js +4 -4
- package/lib/module/utils/Portal.js.map +1 -1
- package/lib/module/utils/api.js +24 -24
- package/lib/module/utils/api.js.map +1 -1
- package/lib/module/utils/auth.js +18 -18
- package/lib/module/utils/auth.js.map +1 -1
- package/lib/module/utils/crypto.js +13 -13
- package/lib/module/utils/crypto.js.map +1 -1
- package/lib/module/utils/debugHelper.js.map +1 -1
- package/lib/module/utils/encryption.js +12 -12
- package/lib/module/utils/encryption.js.map +1 -1
- package/lib/module/utils/onairosApi.js.map +1 -1
- package/lib/module/utils/programmaticFlow.js +16 -16
- package/lib/module/utils/programmaticFlow.js.map +1 -1
- package/lib/module/utils/retryHelper.js +27 -27
- package/lib/module/utils/retryHelper.js.map +1 -1
- package/lib/module/utils/secureStorage.js.map +1 -1
- package/lib/typescript/api/index.d.ts +7 -15
- package/lib/typescript/api/index.d.ts.map +1 -1
- package/lib/typescript/components/DataRequestModal.d.ts +10 -10
- package/lib/typescript/components/DataRequestScreen.d.ts +10 -10
- package/lib/typescript/components/EmailVerificationModal.d.ts +10 -10
- package/lib/typescript/components/Onairos.d.ts +3 -3
- package/lib/typescript/components/Onairos.d.ts.map +1 -1
- package/lib/typescript/components/OnairosButton.d.ts +11 -36
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
- package/lib/typescript/components/Overlay.d.ts +3 -3
- package/lib/typescript/components/PinInput.d.ts +3 -13
- package/lib/typescript/components/PinInput.d.ts.map +1 -1
- package/lib/typescript/components/PlatformList.d.ts +3 -3
- package/lib/typescript/components/TrainingModal.d.ts +3 -14
- package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +3 -16
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts +9 -9
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
- package/lib/typescript/components/onboarding/OnboardingHeader.d.ts +10 -10
- package/lib/typescript/components/onboarding/PinInput.d.ts +3 -3
- package/lib/typescript/components/onboarding/PlatformConnector.d.ts +12 -12
- package/lib/typescript/components/screens/ConnectorScreen.d.ts +8 -8
- package/lib/typescript/components/screens/LoadingScreen.d.ts +8 -8
- package/lib/typescript/components/screens/PinCreationScreen.d.ts +9 -9
- package/lib/typescript/constants/index.d.ts +52 -52
- package/lib/typescript/hooks/useConnections.d.ts +8 -13
- package/lib/typescript/hooks/useConnections.d.ts.map +1 -1
- package/lib/typescript/hooks/useCredentials.d.ts +8 -8
- package/lib/typescript/index.d.ts +17 -35
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/services/apiKeyService.d.ts +131 -131
- package/lib/typescript/services/apiKeyService.d.ts.map +1 -1
- package/lib/typescript/services/oauthService.d.ts +49 -49
- package/lib/typescript/services/platformAuthService.d.ts +143 -68
- package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
- package/lib/typescript/types/index.d.ts +225 -264
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/types.d.ts +266 -266
- package/lib/typescript/utils/Portal.d.ts +13 -13
- package/lib/typescript/utils/api.d.ts +5 -5
- package/lib/typescript/utils/auth.d.ts +5 -5
- package/lib/typescript/utils/crypto.d.ts +3 -3
- package/lib/typescript/utils/debugHelper.d.ts +28 -28
- package/lib/typescript/utils/encryption.d.ts +18 -18
- package/lib/typescript/utils/onairosApi.d.ts +86 -86
- package/lib/typescript/utils/programmaticFlow.d.ts +22 -22
- package/lib/typescript/utils/retryHelper.d.ts +68 -68
- package/lib/typescript/utils/secureStorage.d.ts +93 -93
- package/package.json +149 -163
- package/src/api/index.ts +110 -151
- package/src/assets/images/email.png +0 -0
- package/src/assets/images/linkedin.png +0 -0
- package/src/assets/images/reddit.png +0 -0
- package/src/assets/images/youtube.png +0 -0
- package/src/components/DataRequestScreen.tsx +355 -355
- package/src/components/EmailVerificationModal.tsx +363 -363
- package/src/components/Onairos.tsx +424 -422
- package/src/components/OnairosButton.tsx +359 -339
- package/src/components/Overlay.tsx +506 -506
- package/src/components/PinInput.tsx +343 -555
- package/src/components/PlatformList.tsx +144 -144
- package/src/components/TrainingModal.tsx +737 -1047
- package/src/components/UniversalOnboarding.tsx +1820 -2888
- package/src/components/UniversalOnboarding.tsx.new +455 -0
- package/src/components/onboarding/OAuthWebView.tsx +838 -232
- package/src/hooks/useConnections.ts +163 -161
- package/src/hooks/useCredentials.ts +174 -174
- package/src/index.js +14 -14
- package/src/index.ts +49 -94
- package/src/services/apiKeyService.ts +921 -919
- package/src/services/platformAuthService.ts +1113 -1346
- package/src/types/ambient.d.ts +28 -28
- package/src/types/index.ts +238 -265
- package/src/types/node-fix.d.ts +18 -18
- package/src/types/node-override.d.ts +23 -23
- package/src/types/opacity.d.ts +15 -15
- package/src/types/types.d.ts +17 -17
- package/src/utils/Portal.tsx +82 -82
- package/src/utils/api.js +111 -111
- package/src/utils/auth.js +103 -103
- package/src/utils/crypto.js +59 -59
- package/src/utils/encryption.ts +68 -68
- package/src/utils/programmaticFlow.ts +112 -112
- package/src/utils/retryHelper.ts +274 -274
- package/types/index.d.ts +213 -213
- package/types/node-env.d.ts +14 -14
- package/lib/commonjs/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/commonjs/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/commonjs/assets/icons/Facebookicon.png +0 -0
- package/lib/commonjs/assets/icons/Gmail.png +0 -0
- package/lib/commonjs/assets/icons/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/icons/Redditicon.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon2.png +0 -0
- package/lib/commonjs/assets/icons/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/icons/farcaster.png +0 -0
- package/lib/commonjs/assets/icons/instagram.png +0 -0
- package/lib/commonjs/assets/icons/pinterest.png +0 -0
- package/lib/commonjs/assets/icons/swerv_logo.png +0 -0
- package/lib/commonjs/assets/icons/twitter.jpg +0 -0
- package/lib/commonjs/assets/images/Checkbox.svg +0 -3
- package/lib/commonjs/assets/images/EnochE.svg +0 -19
- package/lib/commonjs/assets/images/Enochicon1.png +0 -0
- package/lib/commonjs/assets/images/Face_ID_logo.png +0 -0
- package/lib/commonjs/assets/images/Facebookicon.png +0 -0
- package/lib/commonjs/assets/images/Gmail.png +0 -0
- package/lib/commonjs/assets/images/Googlelogo.png +0 -0
- package/lib/commonjs/assets/images/Linkedinicon.png +0 -0
- package/lib/commonjs/assets/images/Onairoslogo.png +0 -0
- package/lib/commonjs/assets/images/Personalityprofile.svg +0 -3
- package/lib/commonjs/assets/images/Personalitytraits.svg +0 -3
- package/lib/commonjs/assets/images/Redditicon.png +0 -0
- package/lib/commonjs/assets/images/Userpreferences.svg +0 -3
- package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/images/arrow.svg +0 -20
- package/lib/commonjs/assets/images/basicproficon.svg +0 -43
- package/lib/commonjs/assets/images/basicprofile.svg +0 -3
- package/lib/commonjs/assets/images/checkmark.svg +0 -4
- package/lib/commonjs/assets/images/contentanalysis.svg +0 -3
- package/lib/commonjs/assets/images/contenticon.svg +0 -23
- package/lib/commonjs/assets/images/persona1.png +0 -0
- package/lib/commonjs/assets/images/persona2.png +0 -0
- package/lib/commonjs/assets/images/persona3.png +0 -0
- package/lib/commonjs/assets/images/persona4.png +0 -0
- package/lib/commonjs/assets/images/persona5.png +0 -0
- package/lib/commonjs/assets/images/personalityicon.svg +0 -18
- package/lib/commonjs/assets/images/x-close.svg +0 -3
- package/lib/commonjs/components/BodyText.js +0 -27
- package/lib/commonjs/components/BodyText.js.map +0 -1
- package/lib/commonjs/components/BrandMark.js +0 -44
- package/lib/commonjs/components/BrandMark.js.map +0 -1
- package/lib/commonjs/components/CodeInput.js +0 -30
- package/lib/commonjs/components/CodeInput.js.map +0 -1
- package/lib/commonjs/components/EmailInput.js +0 -30
- package/lib/commonjs/components/EmailInput.js.map +0 -1
- package/lib/commonjs/components/ExistingUserDataConfirmation.js +0 -474
- package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +0 -1
- package/lib/commonjs/components/GoogleButton.js +0 -55
- package/lib/commonjs/components/GoogleButton.js.map +0 -1
- package/lib/commonjs/components/HeadingGroup.js +0 -43
- package/lib/commonjs/components/HeadingGroup.js.map +0 -1
- package/lib/commonjs/components/ModalHeader.js +0 -99
- package/lib/commonjs/components/ModalHeader.js.map +0 -1
- package/lib/commonjs/components/ModalSheet.js +0 -41
- package/lib/commonjs/components/ModalSheet.js.map +0 -1
- package/lib/commonjs/components/OnairosSignInButton.js +0 -127
- package/lib/commonjs/components/OnairosSignInButton.js.map +0 -1
- package/lib/commonjs/components/PersonaImage.js +0 -60
- package/lib/commonjs/components/PersonaImage.js.map +0 -1
- package/lib/commonjs/components/PersonaLoadingScreen.js +0 -156
- package/lib/commonjs/components/PersonaLoadingScreen.js.map +0 -1
- package/lib/commonjs/components/PersonalizationConsentScreen.js +0 -316
- package/lib/commonjs/components/PersonalizationConsentScreen.js.map +0 -1
- package/lib/commonjs/components/PinCreationScreen.js +0 -393
- package/lib/commonjs/components/PinCreationScreen.js.map +0 -1
- package/lib/commonjs/components/PlatformConnectorsStep.js +0 -828
- package/lib/commonjs/components/PlatformConnectorsStep.js.map +0 -1
- package/lib/commonjs/components/PlatformToggle.js +0 -180
- package/lib/commonjs/components/PlatformToggle.js.map +0 -1
- package/lib/commonjs/components/PrimaryButton.js +0 -180
- package/lib/commonjs/components/PrimaryButton.js.map +0 -1
- package/lib/commonjs/components/SignInMatchAnimation.js +0 -197
- package/lib/commonjs/components/SignInMatchAnimation.js.map +0 -1
- package/lib/commonjs/components/SignInStep.js +0 -179
- package/lib/commonjs/components/SignInStep.js.map +0 -1
- package/lib/commonjs/components/VerificationStep.js +0 -154
- package/lib/commonjs/components/VerificationStep.js.map +0 -1
- package/lib/commonjs/components/WelcomeScreen.js +0 -385
- package/lib/commonjs/components/WelcomeScreen.js.map +0 -1
- package/lib/commonjs/components/icons/Basicproficon.js +0 -37
- package/lib/commonjs/components/icons/Basicproficon.js.map +0 -1
- package/lib/commonjs/components/icons/Basicprofile.js +0 -21
- package/lib/commonjs/components/icons/Basicprofile.js.map +0 -1
- package/lib/commonjs/components/icons/Checkbox.js +0 -21
- package/lib/commonjs/components/icons/Checkbox.js.map +0 -1
- package/lib/commonjs/components/icons/Checkmark.js +0 -27
- package/lib/commonjs/components/icons/Checkmark.js.map +0 -1
- package/lib/commonjs/components/icons/Contentanalysis.js +0 -21
- package/lib/commonjs/components/icons/Contentanalysis.js.map +0 -1
- package/lib/commonjs/components/icons/Contenticon.js +0 -39
- package/lib/commonjs/components/icons/Contenticon.js.map +0 -1
- package/lib/commonjs/components/icons/EnochE.js +0 -41
- package/lib/commonjs/components/icons/EnochE.js.map +0 -1
- package/lib/commonjs/components/icons/Personalityicon.js +0 -30
- package/lib/commonjs/components/icons/Personalityicon.js.map +0 -1
- package/lib/commonjs/components/icons/Personalityprofile.js +0 -21
- package/lib/commonjs/components/icons/Personalityprofile.js.map +0 -1
- package/lib/commonjs/components/icons/Personalitytraits.js +0 -21
- package/lib/commonjs/components/icons/Personalitytraits.js.map +0 -1
- package/lib/commonjs/components/icons/Userpreferences.js +0 -21
- package/lib/commonjs/components/icons/Userpreferences.js.map +0 -1
- package/lib/commonjs/components/icons/index.js +0 -84
- package/lib/commonjs/components/icons/index.js.map +0 -1
- package/lib/commonjs/config/api.js +0 -34
- package/lib/commonjs/config/api.js.map +0 -1
- package/lib/commonjs/context/AuthContext.js +0 -345
- package/lib/commonjs/context/AuthContext.js.map +0 -1
- package/lib/commonjs/hooks/useConnectedAccounts.js +0 -111
- package/lib/commonjs/hooks/useConnectedAccounts.js.map +0 -1
- package/lib/commonjs/hooks/useUserConnections.js +0 -148
- package/lib/commonjs/hooks/useUserConnections.js.map +0 -1
- package/lib/commonjs/services/apiClient.js +0 -302
- package/lib/commonjs/services/apiClient.js.map +0 -1
- package/lib/commonjs/services/authService.js +0 -935
- package/lib/commonjs/services/authService.js.map +0 -1
- package/lib/commonjs/services/biometricPinService.js +0 -184
- package/lib/commonjs/services/biometricPinService.js.map +0 -1
- package/lib/commonjs/services/connectedAccountsService.js +0 -268
- package/lib/commonjs/services/connectedAccountsService.js.map +0 -1
- package/lib/commonjs/services/googleAuthService.js +0 -268
- package/lib/commonjs/services/googleAuthService.js.map +0 -1
- package/lib/commonjs/services/imageCompressionService.js +0 -260
- package/lib/commonjs/services/imageCompressionService.js.map +0 -1
- package/lib/commonjs/services/jwtStorageService.js +0 -256
- package/lib/commonjs/services/jwtStorageService.js.map +0 -1
- package/lib/commonjs/services/mobileTrainingService.js +0 -185
- package/lib/commonjs/services/mobileTrainingService.js.map +0 -1
- package/lib/commonjs/services/pinEncryptionService.js +0 -84
- package/lib/commonjs/services/pinEncryptionService.js.map +0 -1
- package/lib/commonjs/services/pinStorageUtils.js +0 -105
- package/lib/commonjs/services/pinStorageUtils.js.map +0 -1
- package/lib/commonjs/services/storageService.js +0 -404
- package/lib/commonjs/services/storageService.js.map +0 -1
- package/lib/commonjs/services/trainingApiHelpers.js +0 -73
- package/lib/commonjs/services/trainingApiHelpers.js.map +0 -1
- package/lib/commonjs/services/userConnectionsService.js +0 -486
- package/lib/commonjs/services/userConnectionsService.js.map +0 -1
- package/lib/commonjs/services/youtubeMigrationService.js +0 -415
- package/lib/commonjs/services/youtubeMigrationService.js.map +0 -1
- package/lib/commonjs/theme/index.js +0 -249
- package/lib/commonjs/theme/index.js.map +0 -1
- package/lib/commonjs/utils/eventUtils.js +0 -288
- package/lib/commonjs/utils/eventUtils.js.map +0 -1
- package/lib/commonjs/utils/haptics.js +0 -66
- package/lib/commonjs/utils/haptics.js.map +0 -1
- package/lib/commonjs/utils/imagePreloader.js +0 -6
- package/lib/commonjs/utils/imagePreloader.js.map +0 -1
- package/lib/module/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/lib/module/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/lib/module/assets/icons/Facebookicon.png +0 -0
- package/lib/module/assets/icons/Gmail.png +0 -0
- package/lib/module/assets/icons/Linkedinicon.png +0 -0
- package/lib/module/assets/icons/Redditicon.png +0 -0
- package/lib/module/assets/icons/YouTubeicon2.png +0 -0
- package/lib/module/assets/icons/YouTubeicon3.png +0 -0
- package/lib/module/assets/icons/farcaster.png +0 -0
- package/lib/module/assets/icons/instagram.png +0 -0
- package/lib/module/assets/icons/pinterest.png +0 -0
- package/lib/module/assets/icons/swerv_logo.png +0 -0
- package/lib/module/assets/icons/twitter.jpg +0 -0
- package/lib/module/assets/images/Checkbox.svg +0 -3
- package/lib/module/assets/images/EnochE.svg +0 -19
- package/lib/module/assets/images/Enochicon1.png +0 -0
- package/lib/module/assets/images/Face_ID_logo.png +0 -0
- package/lib/module/assets/images/Facebookicon.png +0 -0
- package/lib/module/assets/images/Gmail.png +0 -0
- package/lib/module/assets/images/Googlelogo.png +0 -0
- package/lib/module/assets/images/Linkedinicon.png +0 -0
- package/lib/module/assets/images/Onairoslogo.png +0 -0
- package/lib/module/assets/images/Personalityprofile.svg +0 -3
- package/lib/module/assets/images/Personalitytraits.svg +0 -3
- package/lib/module/assets/images/Redditicon.png +0 -0
- package/lib/module/assets/images/Userpreferences.svg +0 -3
- package/lib/module/assets/images/YouTubeicon3.png +0 -0
- package/lib/module/assets/images/arrow.svg +0 -20
- package/lib/module/assets/images/basicproficon.svg +0 -43
- package/lib/module/assets/images/basicprofile.svg +0 -3
- package/lib/module/assets/images/checkmark.svg +0 -4
- package/lib/module/assets/images/contentanalysis.svg +0 -3
- package/lib/module/assets/images/contenticon.svg +0 -23
- package/lib/module/assets/images/persona1.png +0 -0
- package/lib/module/assets/images/persona2.png +0 -0
- package/lib/module/assets/images/persona3.png +0 -0
- package/lib/module/assets/images/persona4.png +0 -0
- package/lib/module/assets/images/persona5.png +0 -0
- package/lib/module/assets/images/personalityicon.svg +0 -18
- package/lib/module/assets/images/x-close.svg +0 -3
- package/lib/module/components/BodyText.js +0 -20
- package/lib/module/components/BodyText.js.map +0 -1
- package/lib/module/components/BrandMark.js +0 -37
- package/lib/module/components/BrandMark.js.map +0 -1
- package/lib/module/components/CodeInput.js +0 -23
- package/lib/module/components/CodeInput.js.map +0 -1
- package/lib/module/components/EmailInput.js +0 -23
- package/lib/module/components/EmailInput.js.map +0 -1
- package/lib/module/components/ExistingUserDataConfirmation.js +0 -465
- package/lib/module/components/ExistingUserDataConfirmation.js.map +0 -1
- package/lib/module/components/GoogleButton.js +0 -48
- package/lib/module/components/GoogleButton.js.map +0 -1
- package/lib/module/components/HeadingGroup.js +0 -36
- package/lib/module/components/HeadingGroup.js.map +0 -1
- package/lib/module/components/ModalHeader.js +0 -92
- package/lib/module/components/ModalHeader.js.map +0 -1
- package/lib/module/components/ModalSheet.js +0 -34
- package/lib/module/components/ModalSheet.js.map +0 -1
- package/lib/module/components/OnairosSignInButton.js +0 -118
- package/lib/module/components/OnairosSignInButton.js.map +0 -1
- package/lib/module/components/PersonaImage.js +0 -53
- package/lib/module/components/PersonaImage.js.map +0 -1
- package/lib/module/components/PersonaLoadingScreen.js +0 -148
- package/lib/module/components/PersonaLoadingScreen.js.map +0 -1
- package/lib/module/components/PersonalizationConsentScreen.js +0 -309
- package/lib/module/components/PersonalizationConsentScreen.js.map +0 -1
- package/lib/module/components/PinCreationScreen.js +0 -386
- package/lib/module/components/PinCreationScreen.js.map +0 -1
- package/lib/module/components/PlatformConnectorsStep.js +0 -820
- package/lib/module/components/PlatformConnectorsStep.js.map +0 -1
- package/lib/module/components/PlatformToggle.js +0 -173
- package/lib/module/components/PlatformToggle.js.map +0 -1
- package/lib/module/components/PrimaryButton.js +0 -172
- package/lib/module/components/PrimaryButton.js.map +0 -1
- package/lib/module/components/SignInMatchAnimation.js +0 -189
- package/lib/module/components/SignInMatchAnimation.js.map +0 -1
- package/lib/module/components/SignInStep.js +0 -171
- package/lib/module/components/SignInStep.js.map +0 -1
- package/lib/module/components/VerificationStep.js +0 -146
- package/lib/module/components/VerificationStep.js.map +0 -1
- package/lib/module/components/WelcomeScreen.js +0 -378
- package/lib/module/components/WelcomeScreen.js.map +0 -1
- package/lib/module/components/icons/Basicproficon.js +0 -30
- package/lib/module/components/icons/Basicproficon.js.map +0 -1
- package/lib/module/components/icons/Basicprofile.js +0 -14
- package/lib/module/components/icons/Basicprofile.js.map +0 -1
- package/lib/module/components/icons/Checkbox.js +0 -14
- package/lib/module/components/icons/Checkbox.js.map +0 -1
- package/lib/module/components/icons/Checkmark.js +0 -20
- package/lib/module/components/icons/Checkmark.js.map +0 -1
- package/lib/module/components/icons/Contentanalysis.js +0 -14
- package/lib/module/components/icons/Contentanalysis.js.map +0 -1
- package/lib/module/components/icons/Contenticon.js +0 -32
- package/lib/module/components/icons/Contenticon.js.map +0 -1
- package/lib/module/components/icons/EnochE.js +0 -34
- package/lib/module/components/icons/EnochE.js.map +0 -1
- package/lib/module/components/icons/Personalityicon.js +0 -23
- package/lib/module/components/icons/Personalityicon.js.map +0 -1
- package/lib/module/components/icons/Personalityprofile.js +0 -14
- package/lib/module/components/icons/Personalityprofile.js.map +0 -1
- package/lib/module/components/icons/Personalitytraits.js +0 -14
- package/lib/module/components/icons/Personalitytraits.js.map +0 -1
- package/lib/module/components/icons/Userpreferences.js +0 -14
- package/lib/module/components/icons/Userpreferences.js.map +0 -1
- package/lib/module/components/icons/index.js +0 -13
- package/lib/module/components/icons/index.js.map +0 -1
- package/lib/module/config/api.js +0 -26
- package/lib/module/config/api.js.map +0 -1
- package/lib/module/context/AuthContext.js +0 -335
- package/lib/module/context/AuthContext.js.map +0 -1
- package/lib/module/hooks/useConnectedAccounts.js +0 -106
- package/lib/module/hooks/useConnectedAccounts.js.map +0 -1
- package/lib/module/hooks/useUserConnections.js +0 -140
- package/lib/module/hooks/useUserConnections.js.map +0 -1
- package/lib/module/services/apiClient.js +0 -298
- package/lib/module/services/apiClient.js.map +0 -1
- package/lib/module/services/authService.js +0 -905
- package/lib/module/services/authService.js.map +0 -1
- package/lib/module/services/biometricPinService.js +0 -173
- package/lib/module/services/biometricPinService.js.map +0 -1
- package/lib/module/services/connectedAccountsService.js +0 -255
- package/lib/module/services/connectedAccountsService.js.map +0 -1
- package/lib/module/services/googleAuthService.js +0 -258
- package/lib/module/services/googleAuthService.js.map +0 -1
- package/lib/module/services/imageCompressionService.js +0 -250
- package/lib/module/services/imageCompressionService.js.map +0 -1
- package/lib/module/services/jwtStorageService.js +0 -239
- package/lib/module/services/jwtStorageService.js.map +0 -1
- package/lib/module/services/mobileTrainingService.js +0 -172
- package/lib/module/services/mobileTrainingService.js.map +0 -1
- package/lib/module/services/pinEncryptionService.js +0 -75
- package/lib/module/services/pinEncryptionService.js.map +0 -1
- package/lib/module/services/pinStorageUtils.js +0 -93
- package/lib/module/services/pinStorageUtils.js.map +0 -1
- package/lib/module/services/storageService.js +0 -383
- package/lib/module/services/storageService.js.map +0 -1
- package/lib/module/services/trainingApiHelpers.js +0 -67
- package/lib/module/services/trainingApiHelpers.js.map +0 -1
- package/lib/module/services/userConnectionsService.js +0 -476
- package/lib/module/services/userConnectionsService.js.map +0 -1
- package/lib/module/services/youtubeMigrationService.js +0 -404
- package/lib/module/services/youtubeMigrationService.js.map +0 -1
- package/lib/module/theme/index.js +0 -244
- package/lib/module/theme/index.js.map +0 -1
- package/lib/module/utils/eventUtils.js +0 -270
- package/lib/module/utils/eventUtils.js.map +0 -1
- package/lib/module/utils/haptics.js +0 -59
- package/lib/module/utils/haptics.js.map +0 -1
- package/lib/module/utils/imagePreloader.js +0 -3
- package/lib/module/utils/imagePreloader.js.map +0 -1
- package/lib/typescript/components/BodyText.d.ts +0 -10
- package/lib/typescript/components/BodyText.d.ts.map +0 -1
- package/lib/typescript/components/BrandMark.d.ts +0 -11
- package/lib/typescript/components/BrandMark.d.ts.map +0 -1
- package/lib/typescript/components/CodeInput.d.ts +0 -10
- package/lib/typescript/components/CodeInput.d.ts.map +0 -1
- package/lib/typescript/components/EmailInput.d.ts +0 -8
- package/lib/typescript/components/EmailInput.d.ts.map +0 -1
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +0 -12
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts.map +0 -1
- package/lib/typescript/components/GoogleButton.d.ts +0 -11
- package/lib/typescript/components/GoogleButton.d.ts.map +0 -1
- package/lib/typescript/components/HeadingGroup.d.ts +0 -11
- package/lib/typescript/components/HeadingGroup.d.ts.map +0 -1
- package/lib/typescript/components/ModalHeader.d.ts +0 -11
- package/lib/typescript/components/ModalHeader.d.ts.map +0 -1
- package/lib/typescript/components/ModalSheet.d.ts +0 -13
- package/lib/typescript/components/ModalSheet.d.ts.map +0 -1
- package/lib/typescript/components/OnairosSignInButton.d.ts +0 -14
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +0 -1
- package/lib/typescript/components/PersonaImage.d.ts +0 -8
- package/lib/typescript/components/PersonaImage.d.ts.map +0 -1
- package/lib/typescript/components/PersonaLoadingScreen.d.ts +0 -10
- package/lib/typescript/components/PersonaLoadingScreen.d.ts.map +0 -1
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts +0 -10
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts.map +0 -1
- package/lib/typescript/components/PinCreationScreen.d.ts +0 -10
- package/lib/typescript/components/PinCreationScreen.d.ts.map +0 -1
- package/lib/typescript/components/PlatformConnectorsStep.d.ts +0 -11
- package/lib/typescript/components/PlatformConnectorsStep.d.ts.map +0 -1
- package/lib/typescript/components/PlatformToggle.d.ts +0 -20
- package/lib/typescript/components/PlatformToggle.d.ts.map +0 -1
- package/lib/typescript/components/PrimaryButton.d.ts +0 -22
- package/lib/typescript/components/PrimaryButton.d.ts.map +0 -1
- package/lib/typescript/components/SignInMatchAnimation.d.ts +0 -9
- package/lib/typescript/components/SignInMatchAnimation.d.ts.map +0 -1
- package/lib/typescript/components/SignInStep.d.ts +0 -12
- package/lib/typescript/components/SignInStep.d.ts.map +0 -1
- package/lib/typescript/components/VerificationStep.d.ts +0 -13
- package/lib/typescript/components/VerificationStep.d.ts.map +0 -1
- package/lib/typescript/components/WelcomeScreen.d.ts +0 -9
- package/lib/typescript/components/WelcomeScreen.d.ts.map +0 -1
- package/lib/typescript/components/icons/Basicproficon.d.ts +0 -5
- package/lib/typescript/components/icons/Basicproficon.d.ts.map +0 -1
- package/lib/typescript/components/icons/Basicprofile.d.ts +0 -5
- package/lib/typescript/components/icons/Basicprofile.d.ts.map +0 -1
- package/lib/typescript/components/icons/Checkbox.d.ts +0 -5
- package/lib/typescript/components/icons/Checkbox.d.ts.map +0 -1
- package/lib/typescript/components/icons/Checkmark.d.ts +0 -5
- package/lib/typescript/components/icons/Checkmark.d.ts.map +0 -1
- package/lib/typescript/components/icons/Contentanalysis.d.ts +0 -5
- package/lib/typescript/components/icons/Contentanalysis.d.ts.map +0 -1
- package/lib/typescript/components/icons/Contenticon.d.ts +0 -5
- package/lib/typescript/components/icons/Contenticon.d.ts.map +0 -1
- package/lib/typescript/components/icons/EnochE.d.ts +0 -5
- package/lib/typescript/components/icons/EnochE.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalityicon.d.ts +0 -5
- package/lib/typescript/components/icons/Personalityicon.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalityprofile.d.ts +0 -5
- package/lib/typescript/components/icons/Personalityprofile.d.ts.map +0 -1
- package/lib/typescript/components/icons/Personalitytraits.d.ts +0 -5
- package/lib/typescript/components/icons/Personalitytraits.d.ts.map +0 -1
- package/lib/typescript/components/icons/Userpreferences.d.ts +0 -5
- package/lib/typescript/components/icons/Userpreferences.d.ts.map +0 -1
- package/lib/typescript/components/icons/index.d.ts +0 -12
- package/lib/typescript/components/icons/index.d.ts.map +0 -1
- package/lib/typescript/config/api.d.ts +0 -24
- package/lib/typescript/config/api.d.ts.map +0 -1
- package/lib/typescript/context/AuthContext.d.ts +0 -34
- package/lib/typescript/context/AuthContext.d.ts.map +0 -1
- package/lib/typescript/hooks/useConnectedAccounts.d.ts +0 -11
- package/lib/typescript/hooks/useConnectedAccounts.d.ts.map +0 -1
- package/lib/typescript/hooks/useUserConnections.d.ts +0 -12
- package/lib/typescript/hooks/useUserConnections.d.ts.map +0 -1
- package/lib/typescript/services/apiClient.d.ts +0 -91
- package/lib/typescript/services/apiClient.d.ts.map +0 -1
- package/lib/typescript/services/authService.d.ts +0 -216
- package/lib/typescript/services/authService.d.ts.map +0 -1
- package/lib/typescript/services/biometricPinService.d.ts +0 -29
- package/lib/typescript/services/biometricPinService.d.ts.map +0 -1
- package/lib/typescript/services/connectedAccountsService.d.ts +0 -56
- package/lib/typescript/services/connectedAccountsService.d.ts.map +0 -1
- package/lib/typescript/services/googleAuthService.d.ts +0 -63
- package/lib/typescript/services/googleAuthService.d.ts.map +0 -1
- package/lib/typescript/services/imageCompressionService.d.ts +0 -37
- package/lib/typescript/services/imageCompressionService.d.ts.map +0 -1
- package/lib/typescript/services/jwtStorageService.d.ts +0 -86
- package/lib/typescript/services/jwtStorageService.d.ts.map +0 -1
- package/lib/typescript/services/mobileTrainingService.d.ts +0 -45
- package/lib/typescript/services/mobileTrainingService.d.ts.map +0 -1
- package/lib/typescript/services/pinEncryptionService.d.ts +0 -17
- package/lib/typescript/services/pinEncryptionService.d.ts.map +0 -1
- package/lib/typescript/services/pinStorageUtils.d.ts +0 -25
- package/lib/typescript/services/pinStorageUtils.d.ts.map +0 -1
- package/lib/typescript/services/storageService.d.ts +0 -128
- package/lib/typescript/services/storageService.d.ts.map +0 -1
- package/lib/typescript/services/trainingApiHelpers.d.ts +0 -38
- package/lib/typescript/services/trainingApiHelpers.d.ts.map +0 -1
- package/lib/typescript/services/userConnectionsService.d.ts +0 -90
- package/lib/typescript/services/userConnectionsService.d.ts.map +0 -1
- package/lib/typescript/services/youtubeMigrationService.d.ts +0 -12
- package/lib/typescript/services/youtubeMigrationService.d.ts.map +0 -1
- package/lib/typescript/theme/index.d.ts +0 -416
- package/lib/typescript/theme/index.d.ts.map +0 -1
- package/lib/typescript/utils/eventUtils.d.ts +0 -108
- package/lib/typescript/utils/eventUtils.d.ts.map +0 -1
- package/lib/typescript/utils/haptics.d.ts +0 -11
- package/lib/typescript/utils/haptics.d.ts.map +0 -1
- package/lib/typescript/utils/imagePreloader.d.ts +0 -2
- package/lib/typescript/utils/imagePreloader.d.ts.map +0 -1
- package/src/assets/fonts/EBGaramond-VariableFont_wght.ttf +0 -0
- package/src/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf +0 -0
- package/src/assets/icons/Facebookicon.png +0 -0
- package/src/assets/icons/Gmail.png +0 -0
- package/src/assets/icons/Linkedinicon.png +0 -0
- package/src/assets/icons/Redditicon.png +0 -0
- package/src/assets/icons/YouTubeicon2.png +0 -0
- package/src/assets/icons/YouTubeicon3.png +0 -0
- package/src/assets/icons/farcaster.png +0 -0
- package/src/assets/icons/instagram.png +0 -0
- package/src/assets/icons/pinterest.png +0 -0
- package/src/assets/icons/swerv_logo.png +0 -0
- package/src/assets/icons/twitter.jpg +0 -0
- package/src/assets/images/Checkbox.svg +0 -3
- package/src/assets/images/EnochE.svg +0 -19
- package/src/assets/images/Enochicon1.png +0 -0
- package/src/assets/images/Face_ID_logo.png +0 -0
- package/src/assets/images/Facebookicon.png +0 -0
- package/src/assets/images/Gmail.png +0 -0
- package/src/assets/images/Googlelogo.png +0 -0
- package/src/assets/images/Linkedinicon.png +0 -0
- package/src/assets/images/Onairoslogo.png +0 -0
- package/src/assets/images/Personalityprofile.svg +0 -3
- package/src/assets/images/Personalitytraits.svg +0 -3
- package/src/assets/images/Redditicon.png +0 -0
- package/src/assets/images/Userpreferences.svg +0 -3
- package/src/assets/images/YouTubeicon3.png +0 -0
- package/src/assets/images/arrow.svg +0 -20
- package/src/assets/images/basicproficon.svg +0 -43
- package/src/assets/images/basicprofile.svg +0 -3
- package/src/assets/images/checkmark.svg +0 -4
- package/src/assets/images/contentanalysis.svg +0 -3
- package/src/assets/images/contenticon.svg +0 -23
- package/src/assets/images/persona1.png +0 -0
- package/src/assets/images/persona2.png +0 -0
- package/src/assets/images/persona3.png +0 -0
- package/src/assets/images/persona4.png +0 -0
- package/src/assets/images/persona5.png +0 -0
- package/src/assets/images/personalityicon.svg +0 -18
- package/src/assets/images/x-close.svg +0 -3
- package/src/components/BodyText.tsx +0 -33
- package/src/components/BrandMark.tsx +0 -62
- package/src/components/CodeInput.tsx +0 -32
- package/src/components/EmailInput.tsx +0 -31
- package/src/components/ExistingUserDataConfirmation.tsx +0 -507
- package/src/components/GoogleButton.tsx +0 -55
- package/src/components/HeadingGroup.tsx +0 -49
- package/src/components/ModalHeader.tsx +0 -125
- package/src/components/ModalSheet.tsx +0 -57
- package/src/components/OnairosSignInButton.tsx +0 -130
- package/src/components/PersonaImage.tsx +0 -79
- package/src/components/PersonaLoadingScreen.tsx +0 -201
- package/src/components/PersonalizationConsentScreen.tsx +0 -410
- package/src/components/PinCreationScreen.tsx +0 -492
- package/src/components/PlatformConnectorsStep.tsx +0 -892
- package/src/components/PlatformToggle.tsx +0 -226
- package/src/components/PrimaryButton.tsx +0 -214
- package/src/components/SignInMatchAnimation.tsx +0 -225
- package/src/components/SignInStep.tsx +0 -217
- package/src/components/VerificationStep.tsx +0 -198
- package/src/components/WelcomeScreen.tsx +0 -473
- package/src/components/icons/Basicproficon.tsx +0 -30
- package/src/components/icons/Basicprofile.tsx +0 -17
- package/src/components/icons/Checkbox.tsx +0 -17
- package/src/components/icons/Checkmark.tsx +0 -24
- package/src/components/icons/Contentanalysis.tsx +0 -17
- package/src/components/icons/Contenticon.tsx +0 -30
- package/src/components/icons/EnochE.tsx +0 -39
- package/src/components/icons/Personalityicon.tsx +0 -22
- package/src/components/icons/Personalityprofile.tsx +0 -17
- package/src/components/icons/Personalitytraits.tsx +0 -17
- package/src/components/icons/Userpreferences.tsx +0 -17
- package/src/components/icons/index.ts +0 -12
- package/src/config/api.ts +0 -25
- package/src/context/AuthContext.tsx +0 -393
- package/src/hooks/useConnectedAccounts.ts +0 -139
- package/src/hooks/useUserConnections.ts +0 -166
- package/src/services/apiClient.ts +0 -337
- package/src/services/authService.ts +0 -1008
- package/src/services/biometricPinService.ts +0 -193
- package/src/services/connectedAccountsService.ts +0 -290
- package/src/services/googleAuthService.ts +0 -279
- package/src/services/imageCompressionService.ts +0 -303
- package/src/services/jwtStorageService.ts +0 -257
- package/src/services/mobileTrainingService.ts +0 -204
- package/src/services/pinEncryptionService.ts +0 -76
- package/src/services/pinStorageUtils.ts +0 -97
- package/src/services/storageService.ts +0 -452
- package/src/services/trainingApiHelpers.ts +0 -67
- package/src/services/userConnectionsService.ts +0 -557
- package/src/services/youtubeMigrationService.ts +0 -454
- package/src/theme/index.ts +0 -239
- package/src/utils/eventUtils.ts +0 -303
- package/src/utils/haptics.ts +0 -59
- package/src/utils/imagePreloader.ts +0 -2
|
@@ -6,575 +6,391 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.UniversalOnboarding = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var
|
|
9
|
+
var _MaterialIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialIcons"));
|
|
10
10
|
var _PinInput = require("./PinInput");
|
|
11
|
+
var _TrainingModal = require("./TrainingModal");
|
|
12
|
+
var _DataRequestScreen = require("./DataRequestScreen");
|
|
11
13
|
var _OAuthWebView = require("./onboarding/OAuthWebView");
|
|
14
|
+
var _useConnections = require("../hooks/useConnections");
|
|
15
|
+
var _constants = require("../constants");
|
|
12
16
|
var _platformAuthService = require("../services/platformAuthService");
|
|
13
|
-
var _haptics = require("../utils/haptics");
|
|
14
|
-
var _authService = require("../services/authService");
|
|
15
|
-
var _socket = require("socket.io-client");
|
|
16
|
-
var _pinStorageUtils = require("../services/pinStorageUtils");
|
|
17
|
-
var _pinEncryptionService = require("../services/pinEncryptionService");
|
|
18
|
-
var _mobileTrainingService = require("../services/mobileTrainingService");
|
|
19
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
20
|
-
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
21
|
-
//
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
18
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
19
|
+
// Optional Opacity SDK imports with error handling
|
|
20
|
+
let opacityInit = null;
|
|
21
|
+
let OpacityEnvironment = null;
|
|
22
|
+
let opacityGet = null;
|
|
23
|
+
try {
|
|
24
|
+
const opacitySDK = require('@opacity-labs/react-native-opacity');
|
|
25
|
+
opacityInit = opacitySDK.init;
|
|
26
|
+
OpacityEnvironment = opacitySDK.OpacityEnvironment;
|
|
27
|
+
opacityGet = opacitySDK.get;
|
|
28
|
+
} catch (error) {
|
|
29
|
+
console.warn('Opacity SDK not available:', error);
|
|
30
|
+
// Opacity SDK will be disabled if not available
|
|
31
|
+
}
|
|
28
32
|
const {
|
|
29
33
|
height,
|
|
30
34
|
width
|
|
31
35
|
} = _reactNative.Dimensions.get('window');
|
|
32
|
-
// ConnectionStatus interface is now imported from hooks/useConnections
|
|
33
|
-
|
|
34
36
|
const UniversalOnboarding = ({
|
|
35
37
|
visible,
|
|
36
38
|
onClose,
|
|
37
39
|
AppName,
|
|
40
|
+
appIcon,
|
|
38
41
|
requestData,
|
|
39
42
|
returnLink,
|
|
40
43
|
onComplete,
|
|
41
44
|
embedd = false,
|
|
42
45
|
debug = false,
|
|
43
|
-
|
|
46
|
+
testMode = false,
|
|
44
47
|
preferredPlatform,
|
|
45
|
-
|
|
48
|
+
inferenceData,
|
|
49
|
+
auto = false,
|
|
50
|
+
partner
|
|
46
51
|
}) => {
|
|
47
|
-
|
|
48
|
-
const [step, setStep] = (0, _react.useState)(primaryAuthOnly ? 'persona' : 'connect');
|
|
52
|
+
const [step, setStep] = (0, _react.useState)('email');
|
|
49
53
|
const [connections, setConnections] = (0, _react.useState)({});
|
|
50
54
|
const [pin, setPin] = (0, _react.useState)('');
|
|
51
55
|
const [selectedTier, setSelectedTier] = (0, _react.useState)('Medium');
|
|
52
|
-
|
|
53
|
-
|
|
56
|
+
const [training, setTraining] = (0, _react.useState)({
|
|
57
|
+
progress: 0,
|
|
58
|
+
eta: ''
|
|
59
|
+
});
|
|
60
|
+
const [slideAnim] = (0, _react.useState)(new _reactNative.Animated.Value(height));
|
|
54
61
|
const [platformToggles, setPlatformToggles] = (0, _react.useState)({});
|
|
55
62
|
const [oauthUrl, setOauthUrl] = (0, _react.useState)('');
|
|
56
63
|
const [currentPlatform, setCurrentPlatform] = (0, _react.useState)('');
|
|
64
|
+
const [username, setUsername] = (0, _react.useState)('Avatar');
|
|
65
|
+
const [isConnectingPlatform, setIsConnectingPlatform] = (0, _react.useState)(false);
|
|
66
|
+
const [showLoginWebView, setShowLoginWebView] = (0, _react.useState)(false);
|
|
57
67
|
const [email, setEmail] = (0, _react.useState)('');
|
|
58
|
-
const [
|
|
59
|
-
const [
|
|
60
|
-
|
|
61
|
-
// Debug logging for modal visibility
|
|
62
|
-
(0, _react.useEffect)(() => {
|
|
63
|
-
console.log('🔍 UniversalOnboarding: visible prop changed to:', visible);
|
|
64
|
-
console.log('🔍 UniversalOnboarding: modalVisible state is:', modalVisible);
|
|
65
|
-
console.log('🔍 UniversalOnboarding: current step is:', step);
|
|
66
|
-
console.log('🔍 UniversalOnboarding: primaryAuthOnly is:', primaryAuthOnly);
|
|
67
|
-
}, [visible, modalVisible, step, primaryAuthOnly]);
|
|
68
|
-
const isCompletingRef = (0, _react.useRef)(false);
|
|
69
|
-
const [connectionsCount, setConnectionsCount] = (0, _react.useState)(5); // Simulated connections count
|
|
70
|
-
|
|
71
|
-
// Add state for showing additional platforms
|
|
72
|
-
const [showAdditionalPlatforms, setShowAdditionalPlatforms] = (0, _react.useState)(false);
|
|
73
|
-
const [additionalPlatformsOpacity] = (0, _react.useState)(new _reactNative.Animated.Value(0));
|
|
74
|
-
|
|
75
|
-
// Add ref for ScrollView to control scroll position
|
|
76
|
-
const scrollViewRef = (0, _react.useRef)(null);
|
|
77
|
-
// Get the authenticated user from auth context
|
|
78
|
-
// const { user } = useAuth(); // Hook not available
|
|
79
|
-
const user = null;
|
|
80
|
-
|
|
81
|
-
// State for storing the correct username
|
|
82
|
-
const [username, setUsername] = (0, _react.useState)('');
|
|
83
|
-
|
|
84
|
-
// Real training state variables (replacing fake persona state)
|
|
85
|
-
const [personaProgress, setPersonaProgress] = (0, _react.useState)(0);
|
|
86
|
-
const [personaStatus, setPersonaStatus] = (0, _react.useState)('Initializing...');
|
|
87
|
-
const [isPersonaComplete, setIsPersonaComplete] = (0, _react.useState)(false);
|
|
88
|
-
const [socketConnected, setSocketConnected] = (0, _react.useState)(false);
|
|
89
|
-
const [hasError, setHasError] = (0, _react.useState)(false);
|
|
90
|
-
const [userTraits, setUserTraits] = (0, _react.useState)(null);
|
|
91
|
-
const [inferenceResults, setInferenceResults] = (0, _react.useState)(null);
|
|
92
|
-
const [userToken, setUserToken] = (0, _react.useState)(null);
|
|
93
|
-
const [userInfo, setUserInfo] = (0, _react.useState)(null);
|
|
94
|
-
const [animatedDots, setAnimatedDots] = (0, _react.useState)('');
|
|
95
|
-
const socketRef = (0, _react.useRef)(null);
|
|
96
|
-
const dotsAnimationRef = (0, _react.useRef)(null);
|
|
97
|
-
|
|
98
|
-
// Existing user state
|
|
68
|
+
const [verificationCode, setVerificationCode] = (0, _react.useState)('');
|
|
69
|
+
const [isVerifyingCode, setIsVerifyingCode] = (0, _react.useState)(false);
|
|
99
70
|
const [isExistingUser, setIsExistingUser] = (0, _react.useState)(false);
|
|
100
|
-
const [existingUserToken, setExistingUserToken] = (0, _react.useState)(null);
|
|
101
|
-
const [existingUserInfo, setExistingUserInfo] = (0, _react.useState)(null);
|
|
102
|
-
|
|
103
|
-
// Data scenario states
|
|
104
|
-
const [dataScenario, setDataScenario] = (0, _react.useState)(null);
|
|
105
|
-
const [dataDetails, setDataDetails] = (0, _react.useState)(null);
|
|
106
|
-
const [showDataWarning, setShowDataWarning] = (0, _react.useState)(false);
|
|
107
|
-
|
|
108
|
-
// ✅ NEW: Background training state
|
|
109
|
-
const [isBackgroundTrainingStarted, setIsBackgroundTrainingStarted] = (0, _react.useState)(false);
|
|
110
|
-
const [backgroundTrainingProgress, setBackgroundTrainingProgress] = (0, _react.useState)('');
|
|
111
|
-
const [backgroundSocketId, setBackgroundSocketId] = (0, _react.useState)(null);
|
|
112
|
-
|
|
113
|
-
// Function to store connected platforms
|
|
114
|
-
const storeConnectedPlatform = async platformId => {
|
|
115
|
-
try {
|
|
116
|
-
const storedPlatforms = await _asyncStorage.default.getItem('connectedPlatforms');
|
|
117
|
-
let platforms = storedPlatforms ? JSON.parse(storedPlatforms) : [];
|
|
118
|
-
|
|
119
|
-
// Add platform if not already in the list
|
|
120
|
-
if (!platforms.includes(platformId)) {
|
|
121
|
-
platforms.push(platformId);
|
|
122
|
-
await _asyncStorage.default.setItem('connectedPlatforms', JSON.stringify(platforms));
|
|
123
|
-
console.log('📱 Stored connected platform:', platformId, 'Total platforms:', platforms);
|
|
124
|
-
}
|
|
125
|
-
} catch (error) {
|
|
126
|
-
console.error('Error storing connected platform:', error);
|
|
127
|
-
}
|
|
128
|
-
};
|
|
129
|
-
|
|
130
|
-
// Function to remove connected platform from storage
|
|
131
|
-
const removeConnectedPlatform = async platformId => {
|
|
132
|
-
try {
|
|
133
|
-
const storedPlatforms = await _asyncStorage.default.getItem('connectedPlatforms');
|
|
134
|
-
let platforms = storedPlatforms ? JSON.parse(storedPlatforms) : [];
|
|
135
71
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
} catch (error) {
|
|
141
|
-
console.error('Error removing connected platform:', error);
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
|
-
// Function to handle disconnect confirmation
|
|
146
|
-
const handleDisconnectPlatform = (platformId, platformName) => {
|
|
147
|
-
_reactNative.Alert.alert('Disconnect Platform', `Are you sure you want to disconnect ${platformName}?`, [{
|
|
148
|
-
text: 'No',
|
|
149
|
-
style: 'cancel'
|
|
150
|
-
}, {
|
|
151
|
-
text: 'Yes',
|
|
152
|
-
style: 'destructive',
|
|
153
|
-
onPress: async () => {
|
|
154
|
-
try {
|
|
155
|
-
// Update local state to show disconnected
|
|
156
|
-
setConnectionStatuses(prev => ({
|
|
157
|
-
...prev,
|
|
158
|
-
[platformId]: 'disconnected'
|
|
159
|
-
}));
|
|
160
|
-
setConnections(prev => {
|
|
161
|
-
const newConnections = {
|
|
162
|
-
...prev
|
|
163
|
-
};
|
|
164
|
-
delete newConnections[platformId];
|
|
165
|
-
return newConnections;
|
|
166
|
-
});
|
|
167
|
-
setPlatformToggles(prev => ({
|
|
168
|
-
...prev,
|
|
169
|
-
[platformId]: false
|
|
170
|
-
}));
|
|
171
|
-
|
|
172
|
-
// Remove from storage
|
|
173
|
-
await removeConnectedPlatform(platformId);
|
|
174
|
-
|
|
175
|
-
// Call the disconnect function from the hook
|
|
176
|
-
await disconnectPlatform();
|
|
177
|
-
console.log('🔌 Disconnected platform:', platformId);
|
|
178
|
-
} catch (error) {
|
|
179
|
-
console.error('Error disconnecting platform:', error);
|
|
180
|
-
}
|
|
181
|
-
}
|
|
182
|
-
}]);
|
|
183
|
-
};
|
|
184
|
-
|
|
185
|
-
// Function to start animated dots
|
|
186
|
-
const startDotsAnimation = () => {
|
|
187
|
-
if (dotsAnimationRef.current) {
|
|
188
|
-
clearInterval(dotsAnimationRef.current);
|
|
189
|
-
}
|
|
190
|
-
let dotCount = 0;
|
|
191
|
-
dotsAnimationRef.current = setInterval(() => {
|
|
192
|
-
dotCount = (dotCount + 1) % 4; // 0, 1, 2, 3, then back to 0
|
|
193
|
-
if (dotCount === 0) {
|
|
194
|
-
setAnimatedDots('');
|
|
195
|
-
} else {
|
|
196
|
-
setAnimatedDots('.'.repeat(dotCount));
|
|
197
|
-
}
|
|
198
|
-
}, 500); // Change every 500ms
|
|
199
|
-
};
|
|
200
|
-
|
|
201
|
-
// Function to stop animated dots
|
|
202
|
-
const stopDotsAnimation = () => {
|
|
203
|
-
if (dotsAnimationRef.current) {
|
|
204
|
-
clearInterval(dotsAnimationRef.current);
|
|
205
|
-
dotsAnimationRef.current = null;
|
|
206
|
-
}
|
|
207
|
-
setAnimatedDots('');
|
|
208
|
-
};
|
|
72
|
+
// Add refs for cleanup and code inputs
|
|
73
|
+
const successTimeoutRef = (0, _react.useRef)(null);
|
|
74
|
+
const isMountedRef = (0, _react.useRef)(true);
|
|
75
|
+
const codeInputRefs = (0, _react.useRef)([]);
|
|
209
76
|
|
|
210
|
-
//
|
|
211
|
-
const
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
77
|
+
// Add state for showing additional platforms
|
|
78
|
+
const [showAllPlatforms, setShowAllPlatforms] = (0, _react.useState)(false);
|
|
79
|
+
|
|
80
|
+
// Parse test mode options
|
|
81
|
+
const testModeOptions = typeof testMode === 'object' ? testMode : {};
|
|
82
|
+
const isTestMode = testMode === true || typeof testMode === 'object' && testMode !== null;
|
|
83
|
+
const showTestControls = (debug || isTestMode) && requestData;
|
|
84
|
+
|
|
85
|
+
// Simple 2-flow system
|
|
86
|
+
const isExistingUserFlow = testModeOptions.existingUser || false;
|
|
87
|
+
const isNewUserFlow = testModeOptions.newUser || false;
|
|
88
|
+
const platforms = [{
|
|
89
|
+
id: 'instagram',
|
|
90
|
+
name: 'Instagram',
|
|
91
|
+
icon: require('../assets/images/instagram.png')
|
|
215
92
|
}, {
|
|
216
93
|
id: 'youtube',
|
|
217
94
|
name: 'YouTube',
|
|
218
|
-
|
|
95
|
+
icon: require('../assets/images/youtube.png')
|
|
96
|
+
}, {
|
|
97
|
+
id: 'email',
|
|
98
|
+
name: 'Gmail',
|
|
99
|
+
icon: require('../assets/images/email.png')
|
|
219
100
|
}, {
|
|
220
|
-
id: 'linkedin',
|
|
221
|
-
name: 'LinkedIn',
|
|
222
|
-
color: '#0077B5'
|
|
223
|
-
}];
|
|
224
|
-
const additionalPlatforms = [{
|
|
225
101
|
id: 'reddit',
|
|
226
102
|
name: 'Reddit',
|
|
227
|
-
|
|
103
|
+
icon: require('../assets/images/reddit.png')
|
|
228
104
|
}, {
|
|
229
|
-
id: '
|
|
230
|
-
name: '
|
|
231
|
-
|
|
105
|
+
id: 'pinterest',
|
|
106
|
+
name: 'Pinterest',
|
|
107
|
+
icon: require('../assets/images/pinterest.png')
|
|
232
108
|
}];
|
|
233
109
|
|
|
234
|
-
//
|
|
235
|
-
const
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
//
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
const isConnecting = false;
|
|
247
|
-
const isConnected = () => false;
|
|
248
|
-
|
|
249
|
-
// Track connection statuses and currently connecting platform
|
|
250
|
-
const [connectionStatuses, setConnectionStatuses] = (0, _react.useState)({});
|
|
251
|
-
const [connectingPlatform, setConnectingPlatform] = (0, _react.useState)(null);
|
|
252
|
-
|
|
253
|
-
// Function to get the platform icon based on platform ID
|
|
254
|
-
const getPlatformIcon = platformId => {
|
|
255
|
-
switch (platformId) {
|
|
256
|
-
case 'instagram':
|
|
257
|
-
return require('../assets/icons/instagram.png');
|
|
258
|
-
case 'youtube':
|
|
259
|
-
return require('../assets/icons/YouTubeicon2.png');
|
|
260
|
-
case 'reddit':
|
|
261
|
-
return require('../assets/icons/Redditicon.png');
|
|
262
|
-
case 'pinterest':
|
|
263
|
-
return require('../assets/icons/pinterest.png');
|
|
264
|
-
case 'facebook':
|
|
265
|
-
return require('../assets/icons/Facebookicon.png');
|
|
266
|
-
case 'linkedin':
|
|
267
|
-
return require('../assets/icons/Linkedinicon.png');
|
|
268
|
-
case 'gmail':
|
|
269
|
-
return require('../assets/icons/Gmail.png');
|
|
270
|
-
}
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
// Track if the modal has ever been visible to prevent initial onClose call
|
|
274
|
-
const hasBeenVisibleRef = (0, _react.useRef)(false);
|
|
110
|
+
// Define primary platforms (shown by default)
|
|
111
|
+
const primaryPlatforms = platforms.slice(0, 3); // Instagram, YouTube, Gmail
|
|
112
|
+
const additionalPlatforms = platforms.slice(3); // Reddit, Pinterest
|
|
113
|
+
|
|
114
|
+
// Get platforms to display based on showAllPlatforms state
|
|
115
|
+
const platformsToDisplay = showAllPlatforms ? platforms : primaryPlatforms;
|
|
116
|
+
const {
|
|
117
|
+
connectPlatform,
|
|
118
|
+
disconnectPlatform,
|
|
119
|
+
getConnectionStatus,
|
|
120
|
+
isConnecting
|
|
121
|
+
} = (0, _useConnections.useConnections)();
|
|
275
122
|
(0, _react.useEffect)(() => {
|
|
123
|
+
// Set mounted flag
|
|
124
|
+
isMountedRef.current = true;
|
|
276
125
|
if (visible) {
|
|
277
|
-
hasBeenVisibleRef.current = true; // Mark that modal has been visible
|
|
278
|
-
isCompletingRef.current = false; // Reset flag when becoming visible
|
|
279
|
-
setModalVisible(true);
|
|
280
126
|
loadInitialStatus();
|
|
281
127
|
// Animate in
|
|
282
128
|
_reactNative.Animated.spring(slideAnim, {
|
|
283
129
|
toValue: 0,
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
useNativeDriver: true
|
|
130
|
+
useNativeDriver: true,
|
|
131
|
+
bounciness: 0
|
|
287
132
|
}).start();
|
|
288
|
-
|
|
133
|
+
|
|
134
|
+
// Set up deep link listener for OAuth callbacks
|
|
135
|
+
// Using the subscription pattern for React Native's Linking API
|
|
136
|
+
const subscription = _reactNative.Linking.addListener('url', ({
|
|
137
|
+
url
|
|
138
|
+
}) => {
|
|
139
|
+
if ((0, _platformAuthService.isOAuthCallback)(url)) {
|
|
140
|
+
handleOAuthCallback(url);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// Check for initial URL (app was opened via deep link)
|
|
145
|
+
_reactNative.Linking.getInitialURL().then(initialUrl => {
|
|
146
|
+
if (initialUrl && (0, _platformAuthService.isOAuthCallback)(initialUrl)) {
|
|
147
|
+
handleOAuthCallback(initialUrl);
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
|
|
151
|
+
// Initialize platform toggles
|
|
152
|
+
const initialToggles = {};
|
|
153
|
+
platforms.forEach(platform => {
|
|
154
|
+
initialToggles[platform.id] = false;
|
|
155
|
+
});
|
|
156
|
+
setPlatformToggles(initialToggles);
|
|
157
|
+
|
|
158
|
+
// Debug mode for Expo Go
|
|
159
|
+
if (debug || _reactNative.Platform.OS === 'web') {
|
|
160
|
+
console.log('Debug mode enabled - Using mock data for onboarding');
|
|
161
|
+
console.log('Configuration:', {
|
|
162
|
+
auto,
|
|
163
|
+
partner,
|
|
164
|
+
hasInferenceData: !!inferenceData,
|
|
165
|
+
inferenceDataType: typeof inferenceData
|
|
166
|
+
});
|
|
167
|
+
|
|
168
|
+
// Pre-populate with mock connections in debug mode
|
|
169
|
+
if (testMode || _reactNative.Platform.OS === 'web') {
|
|
170
|
+
setConnections({
|
|
171
|
+
instagram: {
|
|
172
|
+
userName: 'instagram_user',
|
|
173
|
+
connected: true
|
|
174
|
+
},
|
|
175
|
+
youtube: {
|
|
176
|
+
userName: 'youtube_user',
|
|
177
|
+
connected: true
|
|
178
|
+
}
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// If there's a preferred platform, pre-connect
|
|
184
|
+
if (preferredPlatform && debug) {
|
|
185
|
+
setConnections(prev => ({
|
|
186
|
+
...prev,
|
|
187
|
+
[preferredPlatform]: {
|
|
188
|
+
userName: `${preferredPlatform}_user`,
|
|
189
|
+
connected: true
|
|
190
|
+
}
|
|
191
|
+
}));
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Return cleanup function
|
|
289
195
|
return () => {
|
|
196
|
+
// Remove event listener using the subscription
|
|
290
197
|
subscription.remove();
|
|
291
198
|
};
|
|
292
|
-
} else
|
|
293
|
-
//
|
|
199
|
+
} else {
|
|
200
|
+
// Animate out
|
|
294
201
|
_reactNative.Animated.timing(slideAnim, {
|
|
295
202
|
toValue: height,
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
// Longer duration for a more elegant exit
|
|
299
|
-
easing: _reactNative.Easing.bezier(0.16, 1, 0.3, 1) // Custom bezier curve for a luxurious, smooth exit
|
|
203
|
+
duration: 250,
|
|
204
|
+
useNativeDriver: true
|
|
300
205
|
}).start(() => {
|
|
301
|
-
//
|
|
302
|
-
setTimeout(() => {
|
|
303
|
-
setModalVisible(false);
|
|
304
|
-
onClose(); // Call onClose from props
|
|
305
|
-
}, 16);
|
|
206
|
+
// Reset state if needed
|
|
306
207
|
});
|
|
307
|
-
} else if (hasBeenVisibleRef.current && isCompletingRef.current) {
|
|
308
|
-
// If completing, hide modal immediately without any animation or delay
|
|
309
|
-
setModalVisible(false);
|
|
310
|
-
// Don't call onClose() when completing - let parent handle the navigation
|
|
311
|
-
isCompletingRef.current = false; // Reset for next time
|
|
312
208
|
}
|
|
313
|
-
}, [visible,
|
|
209
|
+
}, [visible, preferredPlatform]);
|
|
314
210
|
|
|
315
|
-
// Cleanup
|
|
211
|
+
// Cleanup effect for unmounting
|
|
316
212
|
(0, _react.useEffect)(() => {
|
|
317
213
|
return () => {
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
socketRef.current.disconnect();
|
|
321
|
-
socketRef.current = null;
|
|
322
|
-
}
|
|
323
|
-
stopDotsAnimation();
|
|
324
|
-
};
|
|
325
|
-
}, [visible]);
|
|
326
|
-
|
|
327
|
-
// Set up deep link listener for OAuth callbacks
|
|
328
|
-
const handleUrl = (0, _react.useCallback)(({
|
|
329
|
-
url
|
|
330
|
-
}) => {
|
|
331
|
-
if ((0, _platformAuthService.isOAuthCallback)(url)) {
|
|
332
|
-
handleOAuthCallback(url);
|
|
333
|
-
}
|
|
334
|
-
}, []);
|
|
335
|
-
|
|
336
|
-
// Load user data and authentication token when modal becomes visible
|
|
337
|
-
(0, _react.useEffect)(() => {
|
|
338
|
-
const loadUserData = async () => {
|
|
339
|
-
try {
|
|
340
|
-
// Check for existing user info first
|
|
341
|
-
const existingToken = await _asyncStorage.default.getItem('existing_user_token');
|
|
342
|
-
const existingInfo = await _asyncStorage.default.getItem('existing_user_info');
|
|
343
|
-
if (existingToken && existingInfo) {
|
|
344
|
-
console.log('🔍 Found existing user info - user wants to add more data');
|
|
345
|
-
setIsExistingUser(true);
|
|
346
|
-
setExistingUserToken(existingToken);
|
|
347
|
-
setExistingUserInfo(JSON.parse(existingInfo));
|
|
214
|
+
// Set mounted flag to false
|
|
215
|
+
isMountedRef.current = false;
|
|
348
216
|
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
const token = (await _asyncStorage.default.getItem('onairos_jwt_token')) || (await _asyncStorage.default.getItem('auth_token'));
|
|
354
|
-
setUserToken(token);
|
|
355
|
-
if (token) {
|
|
356
|
-
var _user$email;
|
|
357
|
-
// Use provided username or get stored username
|
|
358
|
-
const storedUsername = await (0, _authService.getOnairosUsername)();
|
|
359
|
-
const fallbackUsername = storedUsername || (user === null || user === void 0 || (_user$email = user.email) === null || _user$email === void 0 ? void 0 : _user$email.split('@')[0]) || (user === null || user === void 0 ? void 0 : user.name) || 'mobile_user';
|
|
360
|
-
console.log('🔍 Using username for training:', fallbackUsername);
|
|
361
|
-
setUserInfo({
|
|
362
|
-
username: fallbackUsername,
|
|
363
|
-
email: (user === null || user === void 0 ? void 0 : user.email) || null,
|
|
364
|
-
id: null // Will be filled by backend during training
|
|
365
|
-
});
|
|
366
|
-
setUsername(fallbackUsername);
|
|
367
|
-
}
|
|
368
|
-
} catch (error) {
|
|
369
|
-
var _user$email2;
|
|
370
|
-
console.error('Error loading user data:', error);
|
|
371
|
-
// Fallback user info
|
|
372
|
-
const fallbackUsername = (user === null || user === void 0 || (_user$email2 = user.email) === null || _user$email2 === void 0 ? void 0 : _user$email2.split('@')[0]) || (user === null || user === void 0 ? void 0 : user.name) || 'mobile_user';
|
|
373
|
-
setUserInfo({
|
|
374
|
-
username: fallbackUsername,
|
|
375
|
-
email: (user === null || user === void 0 ? void 0 : user.email) || null,
|
|
376
|
-
id: null
|
|
377
|
-
});
|
|
378
|
-
setUsername(fallbackUsername);
|
|
217
|
+
// Clear any pending timeouts
|
|
218
|
+
if (successTimeoutRef.current) {
|
|
219
|
+
clearTimeout(successTimeoutRef.current);
|
|
220
|
+
successTimeoutRef.current = null;
|
|
379
221
|
}
|
|
380
222
|
};
|
|
381
|
-
|
|
382
|
-
|
|
223
|
+
}, []);
|
|
224
|
+
const handleClose = () => {
|
|
225
|
+
// Clear any pending timeouts before closing
|
|
226
|
+
if (successTimeoutRef.current) {
|
|
227
|
+
clearTimeout(successTimeoutRef.current);
|
|
228
|
+
successTimeoutRef.current = null;
|
|
383
229
|
}
|
|
384
|
-
}, [visible, user]);
|
|
385
|
-
const loadInitialStatus = async () => {
|
|
386
|
-
try {
|
|
387
|
-
// Get the stored Onairos username first
|
|
388
|
-
const storedUsername = await (0, _authService.getOnairosUsername)();
|
|
389
|
-
const fallbackUsername = (user === null || user === void 0 ? void 0 : user.email) || (user === null || user === void 0 ? void 0 : user.name) || `user_${Math.floor(Math.random() * 10000)}`;
|
|
390
|
-
const finalUsername = storedUsername || fallbackUsername;
|
|
391
|
-
console.log('🔍 Loading username for data connections:', {
|
|
392
|
-
storedUsername,
|
|
393
|
-
fallbackUsername,
|
|
394
|
-
finalUsername
|
|
395
|
-
});
|
|
396
|
-
setUsername(finalUsername);
|
|
397
|
-
|
|
398
|
-
// Initialize connection statuses
|
|
399
|
-
const connectionStatus = await getConnectionStatus();
|
|
400
|
-
console.log('Initial connection status:', connectionStatus);
|
|
401
|
-
|
|
402
|
-
// Update the main connections state
|
|
403
|
-
setConnections(connectionStatus);
|
|
404
|
-
|
|
405
|
-
// Convert connections object to status strings
|
|
406
|
-
const statuses = {};
|
|
407
|
-
Object.keys(connectionStatus).forEach(platform => {
|
|
408
|
-
var _connectionStatus$pla;
|
|
409
|
-
statuses[platform] = (_connectionStatus$pla = connectionStatus[platform]) !== null && _connectionStatus$pla !== void 0 && _connectionStatus$pla.connected ? 'connected' : 'disconnected';
|
|
410
|
-
});
|
|
411
|
-
setConnectionStatuses(statuses);
|
|
412
230
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
Object.keys(connectionStatus).forEach(platform => {
|
|
416
|
-
var _connectionStatus$pla2;
|
|
417
|
-
toggles[platform] = ((_connectionStatus$pla2 = connectionStatus[platform]) === null || _connectionStatus$pla2 === void 0 ? void 0 : _connectionStatus$pla2.connected) || false;
|
|
418
|
-
});
|
|
419
|
-
setPlatformToggles(toggles);
|
|
420
|
-
console.log('Connection statuses set:', statuses);
|
|
421
|
-
console.log('Platform toggles set:', toggles);
|
|
422
|
-
} catch (error) {
|
|
423
|
-
console.error('Error loading initial connection status:', error);
|
|
424
|
-
// Set empty objects as fallback
|
|
425
|
-
setConnections({});
|
|
426
|
-
setConnectionStatuses({});
|
|
427
|
-
setPlatformToggles({});
|
|
428
|
-
|
|
429
|
-
// Still set a fallback username even if other loading fails
|
|
430
|
-
const fallbackUsername = (user === null || user === void 0 ? void 0 : user.email) || (user === null || user === void 0 ? void 0 : user.name) || `user_${Math.floor(Math.random() * 10000)}`;
|
|
431
|
-
setUsername(fallbackUsername);
|
|
432
|
-
}
|
|
433
|
-
};
|
|
434
|
-
const handleClose = () => {
|
|
435
|
-
const currentlyCompleting = isCompletingRef.current; // Capture ref's current value
|
|
231
|
+
// Set mounted flag to false
|
|
232
|
+
isMountedRef.current = false;
|
|
436
233
|
|
|
437
|
-
// Animate out
|
|
234
|
+
// Animate out and then call onClose
|
|
438
235
|
_reactNative.Animated.timing(slideAnim, {
|
|
439
236
|
toValue: height,
|
|
440
|
-
|
|
441
|
-
useNativeDriver: true
|
|
442
|
-
duration: 500,
|
|
443
|
-
// Longer duration for a more elegant exit
|
|
444
|
-
easing: _reactNative.Easing.bezier(0.16, 1, 0.3, 1) // Custom bezier curve for a luxurious, smooth exit
|
|
237
|
+
duration: 250,
|
|
238
|
+
useNativeDriver: true
|
|
445
239
|
}).start(() => {
|
|
446
|
-
//
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
if (!currentlyCompleting) {
|
|
450
|
-
// Use the captured value
|
|
451
|
-
onClose();
|
|
452
|
-
}
|
|
453
|
-
// Do NOT reset isCompletingRef.current here. The useEffect watching props.visible is responsible for that.
|
|
454
|
-
}, 100);
|
|
240
|
+
// Only call onClose if component is still meant to be mounted
|
|
241
|
+
// This prevents the "User closed onboarding" error
|
|
242
|
+
onClose();
|
|
455
243
|
});
|
|
456
244
|
};
|
|
457
|
-
const
|
|
458
|
-
// Trigger haptic feedback when connect button is pressed
|
|
459
|
-
(0, _haptics.triggerHaptic)(_haptics.HapticType.BUTTON_PRESS);
|
|
460
|
-
setConnectingPlatform(platformId);
|
|
245
|
+
const loadInitialStatus = (0, _react.useCallback)(async () => {
|
|
461
246
|
try {
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
const success = await (0, _platformAuthService.initiateNativeAuth)(platformId, username);
|
|
467
|
-
if (success) {
|
|
468
|
-
// Update connections state
|
|
469
|
-
setConnections(prev => ({
|
|
470
|
-
...prev,
|
|
471
|
-
[platformId]: {
|
|
472
|
-
userName: username,
|
|
473
|
-
connected: true
|
|
474
|
-
}
|
|
475
|
-
}));
|
|
476
|
-
|
|
477
|
-
// Update platform toggles
|
|
478
|
-
setPlatformToggles(prev => ({
|
|
479
|
-
...prev,
|
|
480
|
-
[platformId]: true
|
|
481
|
-
}));
|
|
482
|
-
|
|
483
|
-
// Update connection statuses
|
|
484
|
-
setConnectionStatuses(prev => ({
|
|
485
|
-
...prev,
|
|
486
|
-
[platformId]: 'connected'
|
|
487
|
-
}));
|
|
488
|
-
|
|
489
|
-
// Store the connected platform
|
|
490
|
-
await storeConnectedPlatform(platformId);
|
|
491
|
-
}
|
|
492
|
-
} else {
|
|
493
|
-
// For other platforms, use the web OAuth flow
|
|
494
|
-
setCurrentPlatform(platformId);
|
|
495
|
-
const oauthUrl = await (0, _platformAuthService.initiateOAuth)(platformId, username);
|
|
496
|
-
if (oauthUrl) {
|
|
497
|
-
setOauthUrl(oauthUrl);
|
|
498
|
-
setStep('oauth');
|
|
499
|
-
}
|
|
500
|
-
}
|
|
247
|
+
console.log('🔄 Loading initial connection status...');
|
|
248
|
+
const status = await getConnectionStatus();
|
|
249
|
+
console.log('✅ Connection status loaded:', status);
|
|
250
|
+
setConnections(status || {});
|
|
501
251
|
} catch (error) {
|
|
502
|
-
console.error(
|
|
503
|
-
|
|
504
|
-
|
|
252
|
+
console.error('❌ Failed to load connection status:', error);
|
|
253
|
+
// Set empty connections to prevent crashes
|
|
254
|
+
setConnections({});
|
|
505
255
|
}
|
|
506
|
-
};
|
|
256
|
+
}, [getConnectionStatus]);
|
|
507
257
|
const togglePlatform = (0, _react.useCallback)(async platformId => {
|
|
508
|
-
// If toggling on, initiate the OAuth flow for the platform
|
|
509
258
|
if (!platformToggles[platformId]) {
|
|
259
|
+
// Attempt to connect platform
|
|
510
260
|
try {
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
userName: `${platformId}_user`,
|
|
521
|
-
connected: true
|
|
522
|
-
}
|
|
523
|
-
}));
|
|
524
|
-
// Store the connected platform
|
|
525
|
-
await storeConnectedPlatform(platformId);
|
|
261
|
+
setIsConnectingPlatform(true);
|
|
262
|
+
console.log(`🔌 Initiating connection for ${platformId}`);
|
|
263
|
+
|
|
264
|
+
// Test API connectivity first
|
|
265
|
+
console.log('🔍 Testing API connectivity...');
|
|
266
|
+
const connectivityTest = await (0, _platformAuthService.testApiConnectivity)();
|
|
267
|
+
if (!connectivityTest.success) {
|
|
268
|
+
console.error('❌ API connectivity test failed:', connectivityTest.error);
|
|
269
|
+
_reactNative.Alert.alert('Network Error', `${connectivityTest.error}\n\nPlease check your internet connection and try again.`);
|
|
526
270
|
return;
|
|
527
271
|
}
|
|
272
|
+
console.log('✅ API connectivity confirmed');
|
|
528
273
|
|
|
529
|
-
//
|
|
530
|
-
if (
|
|
531
|
-
//
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
274
|
+
// Instagram: Use Opacity SDK exclusively
|
|
275
|
+
if (platformId === 'instagram') {
|
|
276
|
+
// Check if Opacity SDK is available
|
|
277
|
+
if (!opacityInit || !OpacityEnvironment || !opacityGet) {
|
|
278
|
+
console.error('❌ Opacity SDK not available for Instagram');
|
|
279
|
+
throw new Error('Instagram connection requires the Opacity SDK. Please ensure @opacity-labs/react-native-opacity is properly installed and configured.');
|
|
280
|
+
}
|
|
281
|
+
console.log('🔌 Initializing Opacity SDK for Instagram...');
|
|
282
|
+
|
|
283
|
+
// Initialize Opacity SDK with your API key
|
|
284
|
+
const apiKey = 'OsamaTest-7bde2407-7360-462a-86b4-b26d7f890cbb';
|
|
285
|
+
await opacityInit({
|
|
286
|
+
apiKey,
|
|
287
|
+
environment: OpacityEnvironment.Production,
|
|
288
|
+
shouldShowErrorsInWebView: true
|
|
289
|
+
});
|
|
290
|
+
console.log('✅ Opacity SDK initialized successfully');
|
|
291
|
+
console.log('📱 Fetching Instagram profile...');
|
|
292
|
+
|
|
293
|
+
// Fetch Instagram profile using Opacity SDK
|
|
294
|
+
const profile = await opacityGet('flow:instagram:profile');
|
|
295
|
+
if (profile && typeof profile === 'object') {
|
|
296
|
+
console.log('✅ Instagram profile retrieved:', profile);
|
|
297
|
+
|
|
298
|
+
// Extract username from profile or use fallback
|
|
299
|
+
const instagramUsername = profile.username || profile.name || username;
|
|
543
300
|
|
|
544
|
-
// Update platform
|
|
301
|
+
// Update platform toggle state
|
|
545
302
|
setPlatformToggles(prev => ({
|
|
546
303
|
...prev,
|
|
547
304
|
[platformId]: true
|
|
548
305
|
}));
|
|
549
306
|
|
|
550
|
-
//
|
|
551
|
-
|
|
307
|
+
// Update connections state with Instagram data
|
|
308
|
+
setConnections(prev => ({
|
|
309
|
+
...prev,
|
|
310
|
+
[platformId]: {
|
|
311
|
+
userName: instagramUsername,
|
|
312
|
+
connected: true,
|
|
313
|
+
profileData: profile // Store additional profile data
|
|
314
|
+
}
|
|
315
|
+
}));
|
|
316
|
+
console.log(`✅ Instagram successfully connected for user: ${instagramUsername}`);
|
|
317
|
+
} else {
|
|
318
|
+
throw new Error('Invalid or empty Instagram profile data returned from Opacity SDK');
|
|
319
|
+
}
|
|
320
|
+
} else {
|
|
321
|
+
// For all other platforms (non-Instagram), check if they have native SDK
|
|
322
|
+
if ((0, _platformAuthService.hasNativeSDK)(platformId)) {
|
|
323
|
+
console.log(`📱 Using native SDK for ${platformId}`);
|
|
324
|
+
// Use native SDK for authentication
|
|
325
|
+
const success = await (0, _platformAuthService.initiateNativeAuth)(platformId, username);
|
|
326
|
+
if (success) {
|
|
327
|
+
console.log(`✅ Native authentication successful for ${platformId}`);
|
|
328
|
+
// Update platform toggle state
|
|
329
|
+
setPlatformToggles(prev => ({
|
|
330
|
+
...prev,
|
|
331
|
+
[platformId]: true
|
|
332
|
+
}));
|
|
333
|
+
|
|
334
|
+
// Update connections state
|
|
335
|
+
setConnections(prev => ({
|
|
336
|
+
...prev,
|
|
337
|
+
[platformId]: {
|
|
338
|
+
userName: username,
|
|
339
|
+
connected: true
|
|
340
|
+
}
|
|
341
|
+
}));
|
|
342
|
+
} else {
|
|
343
|
+
throw new Error(`Native authentication failed for ${platformId}`);
|
|
344
|
+
}
|
|
345
|
+
} else {
|
|
346
|
+
// Use OAuth WebView flow
|
|
347
|
+
console.log(`🌐 Initiating OAuth flow for ${platformId}`);
|
|
348
|
+
const oauthUrl = await (0, _platformAuthService.initiateOAuth)(platformId, username, AppName);
|
|
349
|
+
if (oauthUrl) {
|
|
350
|
+
console.log(`✅ Received OAuth URL for ${platformId}:`, oauthUrl);
|
|
351
|
+
setCurrentPlatform(platformId);
|
|
352
|
+
setOauthUrl(oauthUrl);
|
|
353
|
+
setStep('oauth');
|
|
354
|
+
} else {
|
|
355
|
+
console.error(`❌ No OAuth URL returned for ${platformId}`);
|
|
356
|
+
throw new Error(`Failed to get authorization URL for ${platformId}. Please try again.`);
|
|
357
|
+
}
|
|
552
358
|
}
|
|
553
|
-
return;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
// For other platforms, use the web OAuth flow
|
|
557
|
-
setCurrentPlatform(platformId);
|
|
558
|
-
const oauthUrl = await (0, _platformAuthService.initiateOAuth)(platformId, username);
|
|
559
|
-
|
|
560
|
-
// If oauthUrl is null, it means we should use native SDK (which should have been caught above)
|
|
561
|
-
if (oauthUrl) {
|
|
562
|
-
setOauthUrl(oauthUrl);
|
|
563
|
-
setStep('oauth');
|
|
564
359
|
}
|
|
565
360
|
} catch (error) {
|
|
566
|
-
console.error(
|
|
567
|
-
|
|
568
|
-
|
|
361
|
+
console.error(`❌ Error connecting ${platformId}:`, error);
|
|
362
|
+
|
|
363
|
+
// Provide user-friendly error messages based on platform
|
|
364
|
+
let errorMessage = 'Unknown error occurred';
|
|
365
|
+
if (error instanceof Error) {
|
|
366
|
+
if (platformId === 'instagram') {
|
|
367
|
+
if (error.message.includes('Initialize')) {
|
|
368
|
+
errorMessage = 'Failed to initialize Instagram connection. Please check your internet connection.';
|
|
369
|
+
} else if (error.message.includes('profile')) {
|
|
370
|
+
errorMessage = 'Unable to retrieve Instagram profile. Please try again or check your Instagram account permissions.';
|
|
371
|
+
} else {
|
|
372
|
+
errorMessage = error.message;
|
|
373
|
+
}
|
|
374
|
+
} else {
|
|
375
|
+
errorMessage = error.message;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
_reactNative.Alert.alert(`${platformId.charAt(0).toUpperCase() + platformId.slice(1)} Connection Failed`, errorMessage, [{
|
|
379
|
+
text: 'OK',
|
|
380
|
+
style: 'default'
|
|
381
|
+
}]);
|
|
382
|
+
} finally {
|
|
383
|
+
setIsConnectingPlatform(false);
|
|
569
384
|
}
|
|
570
385
|
} else {
|
|
571
|
-
//
|
|
386
|
+
// Disconnect platform
|
|
387
|
+
console.log(`🔌 Disconnecting ${platformId}`);
|
|
572
388
|
setPlatformToggles(prev => ({
|
|
573
389
|
...prev,
|
|
574
|
-
[platformId]:
|
|
390
|
+
[platformId]: false
|
|
575
391
|
}));
|
|
576
392
|
|
|
577
|
-
//
|
|
393
|
+
// Update connections state
|
|
578
394
|
setConnections(prev => {
|
|
579
395
|
const newConnections = {
|
|
580
396
|
...prev
|
|
@@ -583,50 +399,50 @@ const UniversalOnboarding = ({
|
|
|
583
399
|
return newConnections;
|
|
584
400
|
});
|
|
585
401
|
}
|
|
586
|
-
}, [platformToggles, username]);
|
|
402
|
+
}, [platformToggles, username, AppName]);
|
|
587
403
|
|
|
588
|
-
/**
|
|
589
|
-
* Handles OAuth callback URLs
|
|
404
|
+
/**
|
|
405
|
+
* Handles OAuth callback URLs
|
|
590
406
|
*/
|
|
591
407
|
const handleOAuthCallback = (0, _react.useCallback)(url => {
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
const platform = parsedUrl.searchParams.get('platform') || currentPlatform;
|
|
597
|
-
if (code && platform) {
|
|
598
|
-
// Update connections state
|
|
599
|
-
setConnections(prev => ({
|
|
600
|
-
...prev,
|
|
601
|
-
[platform]: {
|
|
602
|
-
userName: username,
|
|
603
|
-
connected: true
|
|
604
|
-
}
|
|
605
|
-
}));
|
|
408
|
+
console.log('🔗 OAuth callback received:', url);
|
|
409
|
+
const result = (0, _platformAuthService.handleOAuthCallbackUrl)(url);
|
|
410
|
+
if (result.success && result.platform && result.code) {
|
|
411
|
+
console.log(`✅ OAuth successful for ${result.platform}`);
|
|
606
412
|
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
413
|
+
// Update connections state
|
|
414
|
+
setConnections(prev => ({
|
|
415
|
+
...prev,
|
|
416
|
+
[result.platform]: {
|
|
417
|
+
userName: username,
|
|
418
|
+
connected: true
|
|
419
|
+
}
|
|
420
|
+
}));
|
|
612
421
|
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
422
|
+
// Update platform toggles
|
|
423
|
+
setPlatformToggles(prev => ({
|
|
424
|
+
...prev,
|
|
425
|
+
[result.platform]: true
|
|
426
|
+
}));
|
|
427
|
+
|
|
428
|
+
// Close OAuth window and return to connect step
|
|
429
|
+
setOauthUrl('');
|
|
430
|
+
setCurrentPlatform('');
|
|
431
|
+
setStep('connect');
|
|
432
|
+
console.log(`🎉 ${result.platform} successfully connected via OAuth`);
|
|
433
|
+
} else {
|
|
434
|
+
console.error('❌ OAuth callback failed or incomplete');
|
|
618
435
|
}
|
|
619
|
-
}, [
|
|
436
|
+
}, [username]);
|
|
620
437
|
|
|
621
|
-
/**
|
|
622
|
-
* Handles
|
|
438
|
+
/**
|
|
439
|
+
* Handles completion of the OAuth flow
|
|
623
440
|
*/
|
|
624
|
-
const handleOAuthSuccess = (0, _react.useCallback)(
|
|
625
|
-
console.log(
|
|
626
|
-
console.log(`📝 Received result:`, code);
|
|
627
|
-
if (currentPlatform) {
|
|
628
|
-
console.log(`✅ Updating connection state for ${currentPlatform}`);
|
|
441
|
+
const handleOAuthSuccess = (0, _react.useCallback)(code => {
|
|
442
|
+
console.log(`OAuth success for ${currentPlatform} with code: ${code}`);
|
|
629
443
|
|
|
444
|
+
// Update connections for the current platform
|
|
445
|
+
if (currentPlatform) {
|
|
630
446
|
// Update connections state
|
|
631
447
|
setConnections(prev => ({
|
|
632
448
|
...prev,
|
|
@@ -641,893 +457,513 @@ const UniversalOnboarding = ({
|
|
|
641
457
|
...prev,
|
|
642
458
|
[currentPlatform]: true
|
|
643
459
|
}));
|
|
644
|
-
|
|
645
|
-
// Update connection statuses
|
|
646
|
-
setConnectionStatuses(prev => ({
|
|
647
|
-
...prev,
|
|
648
|
-
[currentPlatform]: 'connected'
|
|
649
|
-
}));
|
|
650
|
-
|
|
651
|
-
// Store the connected platform
|
|
652
|
-
await storeConnectedPlatform(currentPlatform);
|
|
653
|
-
console.log(`💾 ${currentPlatform} connection stored successfully`);
|
|
460
|
+
console.log(`Successfully connected ${currentPlatform} for user ${username}`);
|
|
654
461
|
}
|
|
655
462
|
|
|
656
|
-
// Close
|
|
657
|
-
console.log('🔄 Returning to connect step');
|
|
463
|
+
// Close OAuth window and return to connect step
|
|
658
464
|
setOauthUrl('');
|
|
465
|
+
setCurrentPlatform('');
|
|
659
466
|
setStep('connect');
|
|
660
|
-
}, [currentPlatform, username
|
|
661
|
-
|
|
662
|
-
|
|
467
|
+
}, [currentPlatform, username]);
|
|
468
|
+
|
|
469
|
+
// Function to check for existing account (spoofed for now)
|
|
470
|
+
const checkExistingAccount = (0, _react.useCallback)(async () => {
|
|
471
|
+
console.log('Checking for existing account...');
|
|
472
|
+
// TODO: Implement actual logic to check cookies/storage for existing account
|
|
473
|
+
// For now, this is spoofed and doesn't do anything
|
|
474
|
+
return false;
|
|
475
|
+
}, []);
|
|
476
|
+
|
|
477
|
+
// Function to handle email submission
|
|
478
|
+
const handleEmailSubmit = (0, _react.useCallback)(async () => {
|
|
479
|
+
console.log('🚀 handleEmailSubmit called with email:', email);
|
|
480
|
+
console.log('🧪 testMode value:', testMode);
|
|
481
|
+
console.log('🧪 isTestMode computed:', isTestMode);
|
|
482
|
+
try {
|
|
483
|
+
if (!email || !email.trim()) {
|
|
484
|
+
console.log('❌ No email provided');
|
|
485
|
+
_reactNative.Alert.alert('Error', 'Please enter your email address');
|
|
486
|
+
return;
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
// Basic email validation
|
|
490
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
491
|
+
if (!emailRegex.test(email.trim())) {
|
|
492
|
+
console.log('❌ Invalid email format');
|
|
493
|
+
_reactNative.Alert.alert('Error', 'Please enter a valid email address');
|
|
494
|
+
return;
|
|
495
|
+
}
|
|
496
|
+
console.log('📧 Email validation passed, proceeding...');
|
|
497
|
+
|
|
498
|
+
// Check if we should skip API calls entirely (only for specific test scenarios)
|
|
499
|
+
const shouldSkipApiCalls = typeof testMode === 'object' && testMode !== null && testMode.skipApiCalls === true;
|
|
500
|
+
if (shouldSkipApiCalls) {
|
|
501
|
+
console.log('🧪 Test mode with skipApiCalls: true - Skipping API call, proceeding to verification');
|
|
502
|
+
setStep('verify');
|
|
503
|
+
return;
|
|
504
|
+
}
|
|
663
505
|
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
506
|
+
// Add loading state to prevent multiple submissions
|
|
507
|
+
if (isVerifyingCode) {
|
|
508
|
+
console.log('⚠️ Email verification already in progress');
|
|
509
|
+
return;
|
|
510
|
+
}
|
|
511
|
+
setIsVerifyingCode(true);
|
|
512
|
+
console.log('🔄 Starting email verification process...');
|
|
513
|
+
console.log('📡 Will make API call with testMode flag:', isTestMode);
|
|
667
514
|
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
515
|
+
// Wrap the entire API call in a timeout to prevent hanging
|
|
516
|
+
const timeoutPromise = new Promise((_, reject) => {
|
|
517
|
+
setTimeout(() => reject(new Error('Request timeout')), 10000); // 10 second timeout
|
|
518
|
+
});
|
|
519
|
+
try {
|
|
520
|
+
// Safety check for function availability with detailed debugging
|
|
521
|
+
console.log('🔍 Checking requestEmailVerification function availability...');
|
|
522
|
+
console.log('🔍 Type of requestEmailVerification:', typeof _platformAuthService.requestEmailVerification);
|
|
523
|
+
console.log('🔍 requestEmailVerification function:', _platformAuthService.requestEmailVerification);
|
|
524
|
+
if (typeof _platformAuthService.requestEmailVerification !== 'function') {
|
|
525
|
+
console.error('❌ requestEmailVerification function not available');
|
|
526
|
+
console.error('❌ Available functions from platformAuthService:', {
|
|
527
|
+
requestEmailVerification: typeof _platformAuthService.requestEmailVerification,
|
|
528
|
+
verifyEmailCode: typeof _platformAuthService.verifyEmailCode,
|
|
529
|
+
checkEmailVerificationStatus: typeof _platformAuthService.checkEmailVerificationStatus
|
|
530
|
+
});
|
|
531
|
+
// In development, just proceed anyway
|
|
532
|
+
console.log('🧪 Proceeding without API call in development mode');
|
|
533
|
+
setStep('verify');
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
console.log('✅ requestEmailVerification function is available');
|
|
537
|
+
console.log('🔄 Making API call to requestEmailVerification...');
|
|
538
|
+
|
|
539
|
+
// Race between API call and timeout
|
|
540
|
+
const result = await Promise.race([(0, _platformAuthService.requestEmailVerification)(email.trim(), isTestMode), timeoutPromise]);
|
|
541
|
+
console.log('📡 Email verification API result:', result);
|
|
542
|
+
if (result && result.success) {
|
|
543
|
+
console.log('✅ Verification code requested successfully');
|
|
544
|
+
setStep('verify');
|
|
545
|
+
} else {
|
|
546
|
+
console.warn('⚠️ Email verification request failed, but proceeding anyway:', result);
|
|
547
|
+
// In development mode, proceed even if API fails
|
|
548
|
+
setStep('verify');
|
|
549
|
+
}
|
|
550
|
+
} catch (verificationError) {
|
|
551
|
+
console.error('❌ Error in email verification API call:', verificationError);
|
|
552
|
+
// In development mode, proceed even if API fails
|
|
553
|
+
console.log('🧪 API failed but proceeding to verification step in development mode');
|
|
554
|
+
setStep('verify');
|
|
555
|
+
} finally {
|
|
556
|
+
setIsVerifyingCode(false);
|
|
557
|
+
}
|
|
558
|
+
} catch (error) {
|
|
559
|
+
console.error('❌ Unexpected error in email submission:', error);
|
|
560
|
+
setIsVerifyingCode(false);
|
|
671
561
|
|
|
672
|
-
//
|
|
562
|
+
// In development mode, still try to proceed
|
|
563
|
+
console.log('🧪 Error occurred but attempting to proceed to verification step');
|
|
673
564
|
try {
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
// ❌ DISABLED: Don't start new training when PIN is submitted
|
|
679
|
-
// Just show persona step with error state
|
|
680
|
-
setStep('persona');
|
|
681
|
-
setPersonaStatus('Error: Failed to continue training');
|
|
682
|
-
setHasError(true);
|
|
565
|
+
setStep('verify');
|
|
566
|
+
} catch (stepError) {
|
|
567
|
+
console.error('❌ Failed to set step to verify:', stepError);
|
|
568
|
+
_reactNative.Alert.alert('Error', 'An unexpected error occurred. Please try again.');
|
|
683
569
|
}
|
|
684
|
-
} else {
|
|
685
|
-
console.log('ℹ️ [PIN SUBMIT] No background training detected');
|
|
686
|
-
// ❌ DISABLED: Don't start training when PIN is submitted
|
|
687
|
-
// Training should only start during connector→PIN transition
|
|
688
|
-
setStep('persona');
|
|
689
|
-
setPersonaStatus('No training in progress. Please restart the flow.');
|
|
690
|
-
setHasError(true);
|
|
691
570
|
}
|
|
692
|
-
|
|
693
|
-
}, [isBackgroundTrainingStarted, backgroundSocketId]);
|
|
571
|
+
}, [email, isVerifyingCode, debug, testMode, isTestMode]);
|
|
694
572
|
|
|
695
|
-
//
|
|
696
|
-
const
|
|
573
|
+
// Function to handle verification code submission
|
|
574
|
+
const handleVerificationSubmit = (0, _react.useCallback)(async () => {
|
|
575
|
+
if (!verificationCode.trim() || verificationCode.trim().length !== 6) {
|
|
576
|
+
_reactNative.Alert.alert('Error', 'Please enter a 6-digit verification code');
|
|
577
|
+
return;
|
|
578
|
+
}
|
|
579
|
+
setIsVerifyingCode(true);
|
|
697
580
|
try {
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
// Use provided token or get from AsyncStorage to avoid state timing issues
|
|
702
|
-
const token = authToken || (await _asyncStorage.default.getItem('onairos_jwt_token')) || (await _asyncStorage.default.getItem('auth_token'));
|
|
703
|
-
if (!token) {
|
|
704
|
-
console.error('❌ No authentication token available');
|
|
705
|
-
throw new Error('No authentication token available');
|
|
581
|
+
// Safety check for function availability
|
|
582
|
+
if (typeof _platformAuthService.verifyEmailCode !== 'function') {
|
|
583
|
+
throw new Error('Email verification service not available');
|
|
706
584
|
}
|
|
707
|
-
console.log('🚀 Starting Enoch training with socketId:', socketId);
|
|
708
|
-
console.log('🔑 Using auth token:', token ? `${token.substring(0, 20)}...` : 'None');
|
|
709
|
-
|
|
710
|
-
// Get stored Onairos username for API calls
|
|
711
|
-
const storedUsername = await (0, _authService.getOnairosUsername)();
|
|
712
|
-
const finalUsername = storedUsername || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.username) || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || username || 'mobile_user';
|
|
713
|
-
|
|
714
|
-
// Get connected platforms information
|
|
715
|
-
const connectedPlatforms = await _asyncStorage.default.getItem('connectedPlatforms');
|
|
716
|
-
const platformsList = connectedPlatforms ? JSON.parse(connectedPlatforms) : [];
|
|
717
|
-
console.log('📱 Connected platforms for training:', platformsList);
|
|
718
|
-
|
|
719
|
-
// Get encrypted PIN for training (if available)
|
|
720
|
-
const encryptedPin = await (0, _pinEncryptionService.getEncryptedPinForAPI)().catch(error => {
|
|
721
|
-
console.warn('⚠️ Could not get encrypted PIN for training:', error);
|
|
722
|
-
return null;
|
|
723
|
-
});
|
|
724
585
|
|
|
725
|
-
//
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
console.log('📡 Training API response:', result);
|
|
743
|
-
|
|
744
|
-
// Handle CONNECTIONS_REQUIRED scenario (pre-training validation)
|
|
745
|
-
if (result.requiresConnections || result.code === 'CONNECTIONS_REQUIRED') {
|
|
746
|
-
console.log('🔗 Connections required detected from HTTP response');
|
|
747
|
-
setDataScenario('CONNECTIONS_REQUIRED');
|
|
748
|
-
setDataDetails(result);
|
|
749
|
-
setShowDataWarning(true);
|
|
750
|
-
setPersonaStatus('Connections required');
|
|
751
|
-
setHasError(true);
|
|
752
|
-
stopDotsAnimation();
|
|
753
|
-
return;
|
|
586
|
+
// Test Mode: Use specific flows
|
|
587
|
+
if (isTestMode) {
|
|
588
|
+
console.log('🧪 Test mode verification - simulating success');
|
|
589
|
+
if (isExistingUserFlow) {
|
|
590
|
+
// Flow 1: Existing User → Data Request → Close (return API URL)
|
|
591
|
+
console.log('🧪 Test Flow 1: Existing User → Show Data Request');
|
|
592
|
+
setIsExistingUser(true);
|
|
593
|
+
setStep('dataRequest');
|
|
594
|
+
return;
|
|
595
|
+
} else if (isNewUserFlow) {
|
|
596
|
+
// Flow 2: New User → Platform Connect → PIN → Training
|
|
597
|
+
console.log('🧪 Test Flow 2: New User → Platform Connect');
|
|
598
|
+
const emailPrefix = email.trim().split('@')[0] || 'TestUser';
|
|
599
|
+
setUsername(emailPrefix);
|
|
600
|
+
setStep('connect');
|
|
601
|
+
return;
|
|
602
|
+
}
|
|
754
603
|
}
|
|
604
|
+
|
|
605
|
+
// Real API call (production) or test mode
|
|
606
|
+
const result = await (0, _platformAuthService.verifyEmailCode)(email.trim(), verificationCode.trim(), isTestMode);
|
|
755
607
|
if (result.success) {
|
|
756
|
-
console.log('
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
console.log('
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
console.log('
|
|
766
|
-
|
|
767
|
-
|
|
608
|
+
console.log('✅ Email verification successful');
|
|
609
|
+
|
|
610
|
+
// Check if user exists in backend (properly typed now)
|
|
611
|
+
const existingUser = result.existingUser || false;
|
|
612
|
+
setIsExistingUser(existingUser);
|
|
613
|
+
if (existingUser) {
|
|
614
|
+
console.log('👤 Existing user detected, showing data request screen');
|
|
615
|
+
setStep('dataRequest');
|
|
616
|
+
} else {
|
|
617
|
+
console.log('🆕 New user, proceeding to platform connection');
|
|
618
|
+
// Safely set username from email prefix
|
|
619
|
+
try {
|
|
620
|
+
const emailPrefix = email.trim().split('@')[0];
|
|
621
|
+
if (emailPrefix && emailPrefix.length > 0) {
|
|
622
|
+
setUsername(emailPrefix);
|
|
623
|
+
} else {
|
|
624
|
+
setUsername('User'); // Fallback username
|
|
625
|
+
}
|
|
626
|
+
} catch (usernameError) {
|
|
627
|
+
console.warn('Failed to extract username from email, using fallback:', usernameError);
|
|
628
|
+
setUsername('User');
|
|
629
|
+
}
|
|
630
|
+
setStep('connect');
|
|
768
631
|
}
|
|
769
|
-
setPersonaStatus('Training model...');
|
|
770
|
-
setPersonaProgress(25);
|
|
771
632
|
} else {
|
|
772
|
-
|
|
773
|
-
setPersonaStatus(`Error: ${result.error || 'Training failed to start'}`);
|
|
774
|
-
setHasError(true);
|
|
775
|
-
stopDotsAnimation();
|
|
633
|
+
_reactNative.Alert.alert('Verification Failed', result.error || 'Invalid verification code');
|
|
776
634
|
}
|
|
777
635
|
} catch (error) {
|
|
778
|
-
console.error('❌
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
636
|
+
console.error('❌ Error verifying code:', error);
|
|
637
|
+
_reactNative.Alert.alert('Error', 'Failed to verify code');
|
|
638
|
+
} finally {
|
|
639
|
+
setIsVerifyingCode(false);
|
|
782
640
|
}
|
|
783
|
-
};
|
|
641
|
+
}, [email, verificationCode]);
|
|
642
|
+
const handlePinSubmit = (0, _react.useCallback)(async userPin => {
|
|
643
|
+
setPin(userPin);
|
|
644
|
+
setStep('training');
|
|
784
645
|
|
|
785
|
-
|
|
786
|
-
const continueBackgroundTrainingWithPin = async userPin => {
|
|
646
|
+
// Save session data for "Never Connect Again" functionality
|
|
787
647
|
try {
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
648
|
+
const sessionData = {
|
|
649
|
+
pin: userPin,
|
|
650
|
+
connections,
|
|
651
|
+
platformToggles,
|
|
652
|
+
selectedTier,
|
|
653
|
+
username,
|
|
654
|
+
timestamp: Date.now(),
|
|
655
|
+
appName: AppName,
|
|
656
|
+
inferenceData: auto ? inferenceData : undefined,
|
|
657
|
+
partner
|
|
658
|
+
};
|
|
795
659
|
|
|
796
|
-
//
|
|
797
|
-
|
|
660
|
+
// Store session data in secure storage for future use
|
|
661
|
+
console.log('Saving session data for future "Never Connect Again" functionality:', sessionData);
|
|
798
662
|
|
|
799
|
-
|
|
800
|
-
|
|
663
|
+
// TODO: Implement actual secure storage of session data
|
|
664
|
+
// This would typically involve:
|
|
665
|
+
// 1. Storing encrypted session data locally
|
|
666
|
+
// 2. Setting cookies in WebView for onairos.uk domain
|
|
667
|
+
// 3. Storing authentication tokens securely
|
|
801
668
|
|
|
802
|
-
//
|
|
803
|
-
console.log('
|
|
669
|
+
// For now, we'll simulate this with console logging
|
|
670
|
+
console.log('Session data saved - future apps will detect existing account');
|
|
804
671
|
} catch (error) {
|
|
805
|
-
console.error('
|
|
806
|
-
throw error;
|
|
672
|
+
console.error('Failed to save session data:', error);
|
|
807
673
|
}
|
|
808
|
-
};
|
|
674
|
+
}, [connections, selectedTier, platformToggles, username, AppName, auto, inferenceData, partner]);
|
|
675
|
+
const handleTrainingComplete = (0, _react.useCallback)(async () => {
|
|
676
|
+
console.log('🎉 Training completed successfully');
|
|
677
|
+
console.log('🔍 Auto mode enabled:', auto);
|
|
678
|
+
console.log('🔍 Inference data available:', !!inferenceData);
|
|
679
|
+
try {
|
|
680
|
+
if (auto && inferenceData) {
|
|
681
|
+
console.log('🤖 Auto mode: Making API request to get URL and perform inference');
|
|
809
682
|
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
683
|
+
// First, get the API URL from backend
|
|
684
|
+
const apiUrlResponse = await fetch('https://api2.onairos.uk/', {
|
|
685
|
+
method: 'POST',
|
|
686
|
+
headers: {
|
|
687
|
+
'Content-Type': 'application/json'
|
|
688
|
+
},
|
|
689
|
+
body: JSON.stringify({
|
|
690
|
+
Info: {
|
|
691
|
+
storage: 'secure',
|
|
692
|
+
appId: AppName,
|
|
693
|
+
confirmations: Object.keys(requestData || {}),
|
|
694
|
+
EncryptedUserPin: pin,
|
|
695
|
+
// Use the actual PIN from user
|
|
696
|
+
account: email.trim(),
|
|
697
|
+
proofMode: false
|
|
698
|
+
}
|
|
699
|
+
})
|
|
700
|
+
});
|
|
701
|
+
if (!apiUrlResponse.ok) {
|
|
702
|
+
throw new Error(`Failed to get API URL: ${apiUrlResponse.status}`);
|
|
703
|
+
}
|
|
704
|
+
const {
|
|
705
|
+
apiUrl,
|
|
706
|
+
token
|
|
707
|
+
} = await apiUrlResponse.json();
|
|
708
|
+
console.log('✅ Received API URL:', apiUrl);
|
|
709
|
+
console.log('✅ Received token:', (token === null || token === void 0 ? void 0 : token.substring(0, 20)) + '...');
|
|
710
|
+
|
|
711
|
+
// Now make the inference call with the provided data
|
|
712
|
+
const inferenceResponse = await fetch(apiUrl, {
|
|
713
|
+
method: 'POST',
|
|
714
|
+
headers: {
|
|
715
|
+
'Content-Type': 'application/json',
|
|
716
|
+
'Authorization': `Bearer ${token}`
|
|
717
|
+
},
|
|
718
|
+
body: JSON.stringify({
|
|
719
|
+
...inferenceData,
|
|
720
|
+
userEmail: email.trim(),
|
|
721
|
+
appName: AppName,
|
|
722
|
+
timestamp: new Date().toISOString()
|
|
723
|
+
})
|
|
724
|
+
});
|
|
725
|
+
if (!inferenceResponse.ok) {
|
|
726
|
+
throw new Error(`Inference API failed: ${inferenceResponse.status}`);
|
|
727
|
+
}
|
|
728
|
+
const inferenceResults = await inferenceResponse.json();
|
|
729
|
+
console.log('✅ Auto mode inference results:', inferenceResults);
|
|
816
730
|
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
try {
|
|
820
|
-
var _user$email4;
|
|
821
|
-
console.log('🚀 Starting persona creation...');
|
|
822
|
-
|
|
823
|
-
// Ensure we have a valid authentication token before starting
|
|
824
|
-
console.log('🔐 Step 1: Ensuring authentication token...');
|
|
825
|
-
const authToken = await ensureAuthToken();
|
|
826
|
-
if (!authToken) {
|
|
827
|
-
throw new Error('Failed to create or retrieve authentication token');
|
|
828
|
-
}
|
|
731
|
+
// Close the modal first
|
|
732
|
+
handleClose();
|
|
829
733
|
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
734
|
+
// Complete onboarding with inference results
|
|
735
|
+
setTimeout(() => {
|
|
736
|
+
onComplete(apiUrl, token, {
|
|
737
|
+
pin,
|
|
738
|
+
connections,
|
|
739
|
+
platformToggles,
|
|
740
|
+
selectedTier,
|
|
741
|
+
tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier],
|
|
742
|
+
sessionSaved: true,
|
|
743
|
+
// Add inference data if auto mode is enabled
|
|
744
|
+
...(auto && inferenceData && {
|
|
745
|
+
inferenceData
|
|
746
|
+
}),
|
|
747
|
+
// Add partner info for special partners
|
|
748
|
+
...(partner && {
|
|
749
|
+
partner: partner === 'couplebible' ? 'CoupleBible' : partner
|
|
750
|
+
}),
|
|
751
|
+
autoMode: true,
|
|
752
|
+
inferenceResults,
|
|
753
|
+
apiUrl,
|
|
754
|
+
token
|
|
755
|
+
});
|
|
756
|
+
}, 100);
|
|
757
|
+
} else {
|
|
758
|
+
console.log('📋 Standard mode: Returning API URL for manual use');
|
|
759
|
+
|
|
760
|
+
// Prepare completion data
|
|
761
|
+
const completionData = {
|
|
762
|
+
pin,
|
|
763
|
+
connections,
|
|
764
|
+
platformToggles,
|
|
765
|
+
selectedTier,
|
|
766
|
+
tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier],
|
|
767
|
+
sessionSaved: true,
|
|
768
|
+
// Add inference data if auto mode is enabled
|
|
769
|
+
...(auto && inferenceData && {
|
|
770
|
+
inferenceData
|
|
771
|
+
}),
|
|
772
|
+
// Add partner info for special partners
|
|
773
|
+
...(partner && {
|
|
774
|
+
partner: partner === 'couplebible' ? 'CoupleBible' : partner
|
|
775
|
+
}),
|
|
776
|
+
autoMode: false
|
|
849
777
|
};
|
|
850
|
-
|
|
851
|
-
setUsername(fallbackUsername);
|
|
852
|
-
console.log('🧑💻 Set user info:', newUserInfo);
|
|
778
|
+
console.log('Completion data prepared:', completionData);
|
|
853
779
|
|
|
854
|
-
//
|
|
855
|
-
|
|
856
|
-
}
|
|
780
|
+
// Close the modal first
|
|
781
|
+
handleClose();
|
|
857
782
|
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
id: null
|
|
863
|
-
};
|
|
864
|
-
if (!authToken) {
|
|
865
|
-
console.error('❌ No authentication token available after ensureAuthToken');
|
|
866
|
-
throw new Error('No authentication token available');
|
|
783
|
+
// Then call the completion callback
|
|
784
|
+
setTimeout(() => {
|
|
785
|
+
onComplete('https://api2.onairos.uk', 'dummy-token', completionData);
|
|
786
|
+
}, 100);
|
|
867
787
|
}
|
|
868
|
-
console.log('🔧 Setting up socket connection for real training...');
|
|
869
|
-
console.log('🧑💻 User info available:', currentUserInfo);
|
|
870
|
-
console.log('🔑 Token available:', !!authToken);
|
|
871
|
-
console.log('🌐 Attempting to connect to: https://api2.onairos.uk');
|
|
872
|
-
console.log('📱 Device platform:', _reactNative.Platform.OS);
|
|
873
|
-
console.log('🔗 Network connectivity check starting...');
|
|
874
|
-
setPersonaStatus('Connecting');
|
|
875
|
-
setPersonaProgress(5);
|
|
876
|
-
|
|
877
|
-
// Initialize socket connection with enhanced configuration
|
|
878
|
-
socketRef.current = (0, _socket.io)('https://api2.onairos.uk', {
|
|
879
|
-
transports: ['websocket', 'polling'],
|
|
880
|
-
// Add polling as fallback
|
|
881
|
-
autoConnect: false,
|
|
882
|
-
timeout: 15000,
|
|
883
|
-
// Increase timeout to 15 seconds
|
|
884
|
-
reconnection: true,
|
|
885
|
-
// Enable reconnection with limits
|
|
886
|
-
reconnectionAttempts: 3,
|
|
887
|
-
reconnectionDelay: 1000,
|
|
888
|
-
forceNew: true // Force a new connection
|
|
889
|
-
});
|
|
890
|
-
console.log('🔌 Socket instance created:', {
|
|
891
|
-
connected: socketRef.current.connected,
|
|
892
|
-
id: socketRef.current.id,
|
|
893
|
-
disconnected: socketRef.current.disconnected
|
|
894
|
-
});
|
|
895
|
-
|
|
896
|
-
// Socket event listeners with enhanced error handling
|
|
897
|
-
socketRef.current.on('connect', () => {
|
|
898
|
-
var _socketRef$current, _socketRef$current2, _socketRef$current3, _socketRef$current4;
|
|
899
|
-
console.log('✅ Socket connected for training');
|
|
900
|
-
console.log('🔌 Socket connection details:', {
|
|
901
|
-
id: (_socketRef$current = socketRef.current) === null || _socketRef$current === void 0 ? void 0 : _socketRef$current.id,
|
|
902
|
-
connected: (_socketRef$current2 = socketRef.current) === null || _socketRef$current2 === void 0 ? void 0 : _socketRef$current2.connected,
|
|
903
|
-
transport: (_socketRef$current3 = socketRef.current) === null || _socketRef$current3 === void 0 || (_socketRef$current3 = _socketRef$current3.io) === null || _socketRef$current3 === void 0 || (_socketRef$current3 = _socketRef$current3.engine) === null || _socketRef$current3 === void 0 || (_socketRef$current3 = _socketRef$current3.transport) === null || _socketRef$current3 === void 0 ? void 0 : _socketRef$current3.name
|
|
904
|
-
});
|
|
905
|
-
setSocketConnected(true);
|
|
906
|
-
setPersonaStatus('Starting training');
|
|
907
|
-
setPersonaProgress(10);
|
|
908
|
-
const socketId = (_socketRef$current4 = socketRef.current) === null || _socketRef$current4 === void 0 ? void 0 : _socketRef$current4.id;
|
|
909
|
-
console.log('🔌 Socket ID for training:', socketId);
|
|
910
|
-
if (socketId) {
|
|
911
|
-
// Add a small delay to ensure socket is fully ready and registered on backend
|
|
912
|
-
console.log('🔄 Socket ready for persona display with token:', authToken ? `${authToken.substring(0, 20)}...` : 'None');
|
|
913
|
-
console.log('⏰ Socket registered but training will not start from persona screen...');
|
|
914
|
-
// ❌ DISABLED: Don't start training from persona screen
|
|
915
|
-
// Training should only start during connector→PIN transition
|
|
916
|
-
// setTimeout(() => {
|
|
917
|
-
// console.log('🚀 Now starting training with socket ID:', socketId);
|
|
918
|
-
// startEnochTraining(socketId, authToken);
|
|
919
|
-
// }, 2000);
|
|
920
|
-
|
|
921
|
-
// Just show the persona screen without starting training
|
|
922
|
-
setPersonaStatus('Waiting for training to start from connector→PIN transition');
|
|
923
|
-
} else {
|
|
924
|
-
console.error('❌ No socket ID available after connection');
|
|
925
|
-
setPersonaStatus('Connection error. Please try again.');
|
|
926
|
-
setHasError(true);
|
|
927
|
-
stopDotsAnimation();
|
|
928
|
-
}
|
|
929
|
-
});
|
|
930
|
-
socketRef.current.on('disconnect', reason => {
|
|
931
|
-
var _socketRef$current5;
|
|
932
|
-
console.log('❌ Socket disconnected, reason:', reason);
|
|
933
|
-
console.log('🔍 Disconnect details:', {
|
|
934
|
-
reason: reason,
|
|
935
|
-
wasConnected: socketConnected,
|
|
936
|
-
socketId: (_socketRef$current5 = socketRef.current) === null || _socketRef$current5 === void 0 ? void 0 : _socketRef$current5.id
|
|
937
|
-
});
|
|
938
|
-
setSocketConnected(false);
|
|
939
|
-
});
|
|
940
|
-
socketRef.current.on('reconnect', attemptNumber => {
|
|
941
|
-
console.log('🔄 Socket reconnected after', attemptNumber, 'attempts');
|
|
942
|
-
setSocketConnected(true);
|
|
943
|
-
});
|
|
944
|
-
socketRef.current.on('reconnect_attempt', attemptNumber => {
|
|
945
|
-
console.log('🔄 Socket reconnection attempt:', attemptNumber);
|
|
946
|
-
setPersonaStatus(`Reconnecting... (${attemptNumber}/3)`);
|
|
947
|
-
});
|
|
948
|
-
socketRef.current.on('reconnect_error', error => {
|
|
949
|
-
console.error('❌ Socket reconnection error:', error);
|
|
950
|
-
});
|
|
951
|
-
socketRef.current.on('reconnect_failed', () => {
|
|
952
|
-
console.error('❌ Socket reconnection failed after all attempts');
|
|
953
|
-
setPersonaStatus('Connection failed. Please try again.');
|
|
954
|
-
setHasError(true);
|
|
955
|
-
stopDotsAnimation();
|
|
956
|
-
});
|
|
957
|
-
socketRef.current.on('connect_error', error => {
|
|
958
|
-
console.error('❌ Socket connection error:', error);
|
|
959
|
-
console.error('❌ Socket error details:', {
|
|
960
|
-
message: error.message,
|
|
961
|
-
name: error.name,
|
|
962
|
-
stack: error.stack,
|
|
963
|
-
errorObject: error
|
|
964
|
-
});
|
|
965
|
-
setPersonaStatus('Connection error. Please try again.');
|
|
966
|
-
setHasError(true);
|
|
967
|
-
stopDotsAnimation();
|
|
968
|
-
});
|
|
969
|
-
socketRef.current.on('trainingCompleted', data => {
|
|
970
|
-
console.log('✅ Training Complete:', data);
|
|
971
|
-
setPersonaStatus('Running test inference');
|
|
972
|
-
setPersonaProgress(60);
|
|
973
|
-
});
|
|
974
|
-
socketRef.current.on('inferenceCompleted', data => {
|
|
975
|
-
console.log('🧠 Inference Complete:', data);
|
|
976
|
-
setPersonaStatus('Uploading to S3');
|
|
977
|
-
setPersonaProgress(80);
|
|
978
|
-
setUserTraits(data.traits);
|
|
979
|
-
setInferenceResults(data.inferenceResults);
|
|
980
|
-
});
|
|
981
|
-
socketRef.current.on('modelStandby', data => {
|
|
982
|
-
console.log('🎉 All Complete:', data);
|
|
983
|
-
|
|
984
|
-
// Log completion details based on new spec
|
|
985
|
-
if (data.completed) {
|
|
986
|
-
console.log('✅ Training completed:', data.message);
|
|
987
|
-
console.log('💾 Storage method:', data.storage);
|
|
988
|
-
console.log('🔐 Encryption enabled:', data.encryption);
|
|
989
|
-
console.log('🧠 Inference enabled:', data.inference);
|
|
990
|
-
|
|
991
|
-
// Log database info for Enoch mode
|
|
992
|
-
if (data.databases && Array.isArray(data.databases)) {
|
|
993
|
-
console.log('🗄️ Databases used:', data.databases.join(', '));
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
// Log testing mode
|
|
997
|
-
if (data.testing) {
|
|
998
|
-
console.log('🧪 Testing mode enabled');
|
|
999
|
-
}
|
|
1000
|
-
}
|
|
1001
|
-
setIsPersonaComplete(true);
|
|
1002
|
-
setPersonaStatus('Complete!');
|
|
1003
|
-
setPersonaProgress(100);
|
|
1004
|
-
stopDotsAnimation();
|
|
1005
|
-
});
|
|
1006
|
-
socketRef.current.on('trainingUpdate', data => {
|
|
1007
|
-
console.log('📊 Training update:', data);
|
|
1008
|
-
|
|
1009
|
-
// Handle YouTube token expiry
|
|
1010
|
-
if (data.error && data.error.includes('YouTube access token has expired')) {
|
|
1011
|
-
console.log('🔄 YouTube token expired, triggering reconnection...');
|
|
1012
|
-
setDataScenario(null);
|
|
1013
|
-
setShowDataWarning(false);
|
|
1014
|
-
setPersonaStatus('YouTube token expired - reconnecting...');
|
|
1015
|
-
|
|
1016
|
-
// Try to refresh tokens first before full reconnection
|
|
1017
|
-
setTimeout(async () => {
|
|
1018
|
-
try {
|
|
1019
|
-
// Import the refresh function
|
|
1020
|
-
const {
|
|
1021
|
-
refreshYouTubeTokens
|
|
1022
|
-
} = await Promise.resolve().then(() => _interopRequireWildcard(require('../services/platformAuthService')));
|
|
1023
|
-
console.log('🔄 Attempting to refresh YouTube tokens...');
|
|
1024
|
-
const refreshSuccess = await refreshYouTubeTokens();
|
|
1025
|
-
if (refreshSuccess) {
|
|
1026
|
-
console.log('✅ YouTube tokens refreshed, but training restart disabled');
|
|
1027
|
-
setPersonaStatus('YouTube tokens refreshed - but training only starts from connector→PIN');
|
|
1028
|
-
|
|
1029
|
-
// ❌ DISABLED: Don't restart training from persona screen
|
|
1030
|
-
// Training should only start during connector→PIN transition
|
|
1031
|
-
// if (socketRef.current?.id) {
|
|
1032
|
-
// startEnochTraining(socketRef.current.id, userToken ?? undefined);
|
|
1033
|
-
// }
|
|
1034
|
-
|
|
1035
|
-
setHasError(true); // Show error so user can restart flow properly
|
|
1036
|
-
} else {
|
|
1037
|
-
console.log('❌ Token refresh failed, attempting full reconnection...');
|
|
1038
|
-
setPersonaStatus('Token refresh failed - please restart from connector screen');
|
|
1039
|
-
|
|
1040
|
-
// ❌ DISABLED: Don't restart training from persona screen
|
|
1041
|
-
// Fall back to full reconnection
|
|
1042
|
-
try {
|
|
1043
|
-
await handleConnectPlatform('youtube');
|
|
1044
|
-
console.log('✅ YouTube reconnected, but training restart disabled');
|
|
1045
|
-
setPersonaStatus('YouTube reconnected - please restart from connector screen');
|
|
1046
|
-
|
|
1047
|
-
// ❌ DISABLED: Don't restart training from persona screen
|
|
1048
|
-
// Training should only start during connector→PIN transition
|
|
1049
|
-
// if (socketRef.current?.id) {
|
|
1050
|
-
// startEnochTraining(socketRef.current.id, userToken ?? undefined);
|
|
1051
|
-
// }
|
|
1052
|
-
|
|
1053
|
-
setHasError(true); // Show error so user can restart flow properly
|
|
1054
|
-
} catch (reconnectError) {
|
|
1055
|
-
console.error('❌ YouTube reconnection failed:', reconnectError);
|
|
1056
|
-
setPersonaStatus('YouTube reconnection failed. Please restart from connector screen.');
|
|
1057
|
-
setHasError(true);
|
|
1058
|
-
stopDotsAnimation();
|
|
1059
|
-
}
|
|
1060
|
-
}
|
|
1061
|
-
} catch (error) {
|
|
1062
|
-
console.error('❌ YouTube token refresh/reconnection error:', error);
|
|
1063
|
-
setPersonaStatus('YouTube connection failed. Please try again.');
|
|
1064
|
-
setHasError(true);
|
|
1065
|
-
stopDotsAnimation();
|
|
1066
|
-
}
|
|
1067
|
-
}, 1000);
|
|
1068
|
-
return;
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
// Handle connections required scenario (pre-training validation)
|
|
1072
|
-
if (data.requiresConnections || data.code === 'CONNECTIONS_REQUIRED') {
|
|
1073
|
-
console.log('🔗 Connections required detected from socket');
|
|
1074
|
-
setDataScenario('CONNECTIONS_REQUIRED');
|
|
1075
|
-
setDataDetails(data);
|
|
1076
|
-
setShowDataWarning(true);
|
|
1077
|
-
setPersonaStatus('Connections required');
|
|
1078
|
-
setHasError(true);
|
|
1079
|
-
stopDotsAnimation();
|
|
1080
|
-
return;
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
// Handle data scenario responses
|
|
1084
|
-
if (data.code === 'NO_DATA') {
|
|
1085
|
-
console.log('🚫 No data scenario detected');
|
|
1086
|
-
setDataScenario('NO_DATA');
|
|
1087
|
-
setDataDetails(data.details);
|
|
1088
|
-
setShowDataWarning(true);
|
|
1089
|
-
setPersonaStatus('No interaction data found');
|
|
1090
|
-
setHasError(true);
|
|
1091
|
-
stopDotsAnimation();
|
|
1092
|
-
return;
|
|
1093
|
-
}
|
|
1094
|
-
if (data.code === 'LIMITED_DATA') {
|
|
1095
|
-
console.log('ℹ️ Limited data scenario detected');
|
|
1096
|
-
setDataScenario('LIMITED_DATA');
|
|
1097
|
-
setDataDetails(data.details);
|
|
1098
|
-
setShowDataWarning(true);
|
|
1099
|
-
setPersonaStatus('Creating your persona with available data');
|
|
1100
|
-
// Don't set hasError - training continues
|
|
1101
|
-
return;
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
// Handle regular training updates
|
|
1105
|
-
if (data.error) {
|
|
1106
|
-
console.error('❌ Training update error:', data.error);
|
|
1107
|
-
setPersonaStatus(`Error: ${data.error}`);
|
|
1108
|
-
setHasError(true);
|
|
1109
|
-
stopDotsAnimation();
|
|
1110
|
-
} else if (data.progress) {
|
|
1111
|
-
setPersonaProgress(data.progress);
|
|
1112
|
-
setPersonaStatus(data.status || 'Training in progress');
|
|
1113
|
-
// Clear data warning if training progresses normally
|
|
1114
|
-
if (showDataWarning && data.progress > 30) {
|
|
1115
|
-
setShowDataWarning(false);
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
});
|
|
1119
|
-
|
|
1120
|
-
// Connect to socket with timeout
|
|
1121
|
-
console.log('🔌 Attempting to connect to socket...');
|
|
1122
|
-
console.log('🔌 Socket config:', {
|
|
1123
|
-
url: 'https://api2.onairos.uk',
|
|
1124
|
-
transports: ['websocket'],
|
|
1125
|
-
autoConnect: false,
|
|
1126
|
-
timeout: 10000,
|
|
1127
|
-
reconnection: false
|
|
1128
|
-
});
|
|
1129
|
-
socketRef.current.connect();
|
|
1130
|
-
console.log('🔌 Socket connect() called - waiting for connection...');
|
|
1131
|
-
|
|
1132
|
-
// Add immediate state check
|
|
1133
|
-
setTimeout(() => {
|
|
1134
|
-
var _socketRef$current6, _socketRef$current7, _socketRef$current8, _socketRef$current9;
|
|
1135
|
-
console.log('🔍 Socket state after 1 second:', {
|
|
1136
|
-
connected: (_socketRef$current6 = socketRef.current) === null || _socketRef$current6 === void 0 ? void 0 : _socketRef$current6.connected,
|
|
1137
|
-
disconnected: (_socketRef$current7 = socketRef.current) === null || _socketRef$current7 === void 0 ? void 0 : _socketRef$current7.disconnected,
|
|
1138
|
-
id: (_socketRef$current8 = socketRef.current) === null || _socketRef$current8 === void 0 ? void 0 : _socketRef$current8.id,
|
|
1139
|
-
engineConnected: (_socketRef$current9 = socketRef.current) === null || _socketRef$current9 === void 0 || (_socketRef$current9 = _socketRef$current9.io) === null || _socketRef$current9 === void 0 || (_socketRef$current9 = _socketRef$current9.engine) === null || _socketRef$current9 === void 0 ? void 0 : _socketRef$current9.readyState
|
|
1140
|
-
});
|
|
1141
|
-
}, 1000);
|
|
1142
|
-
setTimeout(() => {
|
|
1143
|
-
var _socketRef$current0, _socketRef$current1, _socketRef$current10, _socketRef$current11;
|
|
1144
|
-
console.log('🔍 Socket state after 5 seconds:', {
|
|
1145
|
-
connected: (_socketRef$current0 = socketRef.current) === null || _socketRef$current0 === void 0 ? void 0 : _socketRef$current0.connected,
|
|
1146
|
-
disconnected: (_socketRef$current1 = socketRef.current) === null || _socketRef$current1 === void 0 ? void 0 : _socketRef$current1.disconnected,
|
|
1147
|
-
id: (_socketRef$current10 = socketRef.current) === null || _socketRef$current10 === void 0 ? void 0 : _socketRef$current10.id,
|
|
1148
|
-
engineConnected: (_socketRef$current11 = socketRef.current) === null || _socketRef$current11 === void 0 || (_socketRef$current11 = _socketRef$current11.io) === null || _socketRef$current11 === void 0 || (_socketRef$current11 = _socketRef$current11.engine) === null || _socketRef$current11 === void 0 ? void 0 : _socketRef$current11.readyState
|
|
1149
|
-
});
|
|
1150
|
-
}, 5000);
|
|
1151
|
-
|
|
1152
|
-
// Set a timeout for socket connection with enhanced fallback
|
|
1153
|
-
setTimeout(() => {
|
|
1154
|
-
if (!socketConnected && socketRef.current && !socketRef.current.connected) {
|
|
1155
|
-
console.error('❌ Socket connection timeout after 20 seconds');
|
|
1156
|
-
console.error('🔍 Socket state:', {
|
|
1157
|
-
connected: socketRef.current.connected,
|
|
1158
|
-
disconnected: socketRef.current.disconnected,
|
|
1159
|
-
id: socketRef.current.id
|
|
1160
|
-
});
|
|
1161
|
-
setPersonaStatus('Connection timeout. Please check your internet and try again.');
|
|
1162
|
-
setHasError(true);
|
|
1163
|
-
stopDotsAnimation();
|
|
1164
|
-
|
|
1165
|
-
// Cleanup socket
|
|
1166
|
-
if (socketRef.current) {
|
|
1167
|
-
socketRef.current.disconnect();
|
|
1168
|
-
socketRef.current = null;
|
|
1169
|
-
}
|
|
1170
|
-
}
|
|
1171
|
-
}, 20000); // Increased timeout to 20 seconds
|
|
1172
788
|
} catch (error) {
|
|
1173
|
-
console.error('❌ Error in
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
} else {
|
|
1196
|
-
baseMessage = 'Just a few more seconds';
|
|
1197
|
-
}
|
|
1198
|
-
return baseMessage + animatedDots;
|
|
1199
|
-
};
|
|
789
|
+
console.error('❌ Error in training complete:', error);
|
|
790
|
+
|
|
791
|
+
// Fallback to standard mode
|
|
792
|
+
const completionData = {
|
|
793
|
+
pin,
|
|
794
|
+
connections,
|
|
795
|
+
platformToggles,
|
|
796
|
+
selectedTier,
|
|
797
|
+
tierData: requestData === null || requestData === void 0 ? void 0 : requestData[selectedTier],
|
|
798
|
+
sessionSaved: true,
|
|
799
|
+
// Add inference data if auto mode is enabled
|
|
800
|
+
...(auto && inferenceData && {
|
|
801
|
+
inferenceData
|
|
802
|
+
}),
|
|
803
|
+
// Add partner info for special partners
|
|
804
|
+
...(partner && {
|
|
805
|
+
partner: partner === 'couplebible' ? 'CoupleBible' : partner
|
|
806
|
+
}),
|
|
807
|
+
autoMode: false,
|
|
808
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
809
|
+
};
|
|
810
|
+
console.log('Fallback completion data:', completionData);
|
|
1200
811
|
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
console.log('🎉 Real persona creation completed successfully');
|
|
1204
|
-
// Cleanup socket connection
|
|
1205
|
-
if (socketRef.current) {
|
|
1206
|
-
console.log('🔌 Disconnecting training socket...');
|
|
1207
|
-
socketRef.current.disconnect();
|
|
1208
|
-
socketRef.current = null;
|
|
1209
|
-
}
|
|
1210
|
-
// Clear temporary PIN since training is complete
|
|
1211
|
-
(0, _pinStorageUtils.clearTemporaryPin)();
|
|
1212
|
-
// Set the completion flag BEFORE calling onComplete
|
|
1213
|
-
isCompletingRef.current = true;
|
|
812
|
+
// Close the modal first
|
|
813
|
+
handleClose();
|
|
1214
814
|
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
console.log('✅ Using real authentication token for onComplete:', `${realToken.substring(0, 30)}...`);
|
|
1220
|
-
// Call onComplete with the REAL token that was created during ensureAuthToken
|
|
1221
|
-
onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', realToken, {
|
|
1222
|
-
email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
|
|
1223
|
-
...userInfo
|
|
1224
|
-
});
|
|
1225
|
-
} else {
|
|
1226
|
-
console.error('❌ No real authentication token found after training completion');
|
|
1227
|
-
// Fallback to placeholder token if no real token exists
|
|
1228
|
-
onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', 'training-complete-token', {
|
|
1229
|
-
email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
|
|
1230
|
-
...userInfo
|
|
1231
|
-
});
|
|
1232
|
-
}
|
|
1233
|
-
} catch (error) {
|
|
1234
|
-
console.error('❌ Error retrieving real token for onComplete:', error);
|
|
1235
|
-
// Fallback to placeholder token on error
|
|
1236
|
-
onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', 'training-complete-token', {
|
|
1237
|
-
email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
|
|
1238
|
-
...userInfo
|
|
1239
|
-
});
|
|
815
|
+
// Then call the completion callback
|
|
816
|
+
setTimeout(() => {
|
|
817
|
+
onComplete('https://api2.onairos.uk', 'dummy-token', completionData);
|
|
818
|
+
}, 100);
|
|
1240
819
|
}
|
|
1241
|
-
};
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
820
|
+
}, [pin, connections, platformToggles, selectedTier, requestData, auto, inferenceData, partner, handleClose, onComplete, AppName, email]);
|
|
821
|
+
const handleDataRequestAccept = (0, _react.useCallback)(async () => {
|
|
822
|
+
console.log('Data request accepted for existing user');
|
|
823
|
+
console.log('🔍 Auto mode enabled:', auto);
|
|
824
|
+
console.log('🔍 Inference data available:', !!inferenceData);
|
|
1245
825
|
try {
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
let existingToken = (await _asyncStorage.default.getItem('onairos_jwt_token')) || (await _asyncStorage.default.getItem('enoch_token')) || (await _asyncStorage.default.getItem('auth_token'));
|
|
1249
|
-
if (existingToken && existingToken.trim().length > 20) {
|
|
1250
|
-
console.log('✅ Authentication token already exists:', `${existingToken.substring(0, 20)}...`);
|
|
1251
|
-
console.log('🔍 Token length:', existingToken.length);
|
|
1252
|
-
console.log('🔍 Token format check:', existingToken.includes('.') ? 'Looks like JWT' : 'Not JWT format');
|
|
1253
|
-
return existingToken;
|
|
1254
|
-
}
|
|
1255
|
-
console.log('🔐 Creating Enoch authentication token for universal onboarding...');
|
|
1256
|
-
|
|
1257
|
-
// Create user accounts and get proper Enoch token
|
|
1258
|
-
const fallbackEmail = (user === null || user === void 0 ? void 0 : user.email) || `${username || 'user'}@onairos.temp`;
|
|
1259
|
-
const fallbackUsername = username || (user === null || user === void 0 || (_user$name = user.name) === null || _user$name === void 0 ? void 0 : _user$name.split('@')[0]) || 'mobile_user';
|
|
1260
|
-
console.log('🔐 Using credentials:', {
|
|
1261
|
-
email: fallbackEmail,
|
|
1262
|
-
username: fallbackUsername
|
|
1263
|
-
});
|
|
826
|
+
if (auto && inferenceData) {
|
|
827
|
+
console.log('🤖 Auto mode: Making API request to get URL and perform inference');
|
|
1264
828
|
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
try {
|
|
1268
|
-
const enochRegisterResponse = await fetch('https://api2.onairos.uk/enoch/users/register', {
|
|
829
|
+
// First, get the API URL from backend
|
|
830
|
+
const apiUrlResponse = await fetch('https://api2.onairos.uk/', {
|
|
1269
831
|
method: 'POST',
|
|
1270
832
|
headers: {
|
|
1271
833
|
'Content-Type': 'application/json'
|
|
1272
834
|
},
|
|
1273
835
|
body: JSON.stringify({
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
836
|
+
Info: {
|
|
837
|
+
storage: 'secure',
|
|
838
|
+
// or whatever storage type
|
|
839
|
+
appId: AppName,
|
|
840
|
+
confirmations: Object.keys(requestData || {}),
|
|
841
|
+
EncryptedUserPin: 'temp-pin',
|
|
842
|
+
// This would come from user PIN in real flow
|
|
843
|
+
account: email.trim(),
|
|
844
|
+
proofMode: false
|
|
845
|
+
}
|
|
1277
846
|
})
|
|
1278
847
|
});
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
}
|
|
1321
|
-
|
|
1322
|
-
// Validate the token format
|
|
1323
|
-
if (typeof authToken !== 'string' || authToken.length < 20) {
|
|
1324
|
-
console.error('❌ Invalid token format:', authToken);
|
|
1325
|
-
throw new Error('Invalid token format received');
|
|
1326
|
-
}
|
|
1327
|
-
|
|
1328
|
-
// Check if it looks like a JWT
|
|
1329
|
-
const jwtParts = authToken.split('.');
|
|
1330
|
-
if (jwtParts.length !== 3) {
|
|
1331
|
-
console.warn('⚠️ Token does not appear to be a valid JWT:', `${authToken.substring(0, 20)}...`);
|
|
848
|
+
if (!apiUrlResponse.ok) {
|
|
849
|
+
throw new Error(`Failed to get API URL: ${apiUrlResponse.status}`);
|
|
850
|
+
}
|
|
851
|
+
const {
|
|
852
|
+
apiUrl,
|
|
853
|
+
token
|
|
854
|
+
} = await apiUrlResponse.json();
|
|
855
|
+
console.log('✅ Received API URL:', apiUrl);
|
|
856
|
+
console.log('✅ Received token:', (token === null || token === void 0 ? void 0 : token.substring(0, 20)) + '...');
|
|
857
|
+
|
|
858
|
+
// Now make the inference call with the provided data
|
|
859
|
+
const inferenceResponse = await fetch(apiUrl, {
|
|
860
|
+
method: 'POST',
|
|
861
|
+
headers: {
|
|
862
|
+
'Content-Type': 'application/json',
|
|
863
|
+
'Authorization': `Bearer ${token}`
|
|
864
|
+
},
|
|
865
|
+
body: JSON.stringify({
|
|
866
|
+
...inferenceData,
|
|
867
|
+
userEmail: email.trim(),
|
|
868
|
+
appName: AppName,
|
|
869
|
+
timestamp: new Date().toISOString()
|
|
870
|
+
})
|
|
871
|
+
});
|
|
872
|
+
if (!inferenceResponse.ok) {
|
|
873
|
+
throw new Error(`Inference API failed: ${inferenceResponse.status}`);
|
|
874
|
+
}
|
|
875
|
+
const inferenceResults = await inferenceResponse.json();
|
|
876
|
+
console.log('✅ Auto mode inference results:', inferenceResults);
|
|
877
|
+
|
|
878
|
+
// Complete onboarding with inference results
|
|
879
|
+
onComplete(apiUrl, token, {
|
|
880
|
+
existingAccount: true,
|
|
881
|
+
email: email.trim(),
|
|
882
|
+
dataRequestAccepted: true,
|
|
883
|
+
requestData,
|
|
884
|
+
autoMode: true,
|
|
885
|
+
inferenceResults,
|
|
886
|
+
apiUrl,
|
|
887
|
+
token
|
|
888
|
+
});
|
|
1332
889
|
} else {
|
|
1333
|
-
console.log('
|
|
890
|
+
console.log('📋 Standard mode: Returning API URL for manual use');
|
|
891
|
+
|
|
892
|
+
// Standard mode: just return the API URL
|
|
893
|
+
onComplete('https://api2.onairos.uk', 'existing-session-token', {
|
|
894
|
+
existingAccount: true,
|
|
895
|
+
email: email.trim(),
|
|
896
|
+
dataRequestAccepted: true,
|
|
897
|
+
requestData,
|
|
898
|
+
autoMode: false
|
|
899
|
+
});
|
|
1334
900
|
}
|
|
1335
|
-
|
|
1336
|
-
// Store the token in multiple locations for maximum compatibility
|
|
1337
|
-
await _asyncStorage.default.setItem('onairos_jwt_token', authToken);
|
|
1338
|
-
await _asyncStorage.default.setItem('auth_token', authToken);
|
|
1339
|
-
await _asyncStorage.default.setItem('enoch_token', authToken);
|
|
1340
|
-
await _asyncStorage.default.setItem('onairos_username', onairosResponseData.username || fallbackUsername);
|
|
1341
|
-
console.log('✅ Successfully stored authentication tokens');
|
|
1342
|
-
console.log('🔑 Token preview:', `${authToken.substring(0, 20)}...`);
|
|
1343
|
-
console.log('🔑 Token length:', authToken.length);
|
|
1344
|
-
console.log('👤 Username stored:', onairosResponseData.username || fallbackUsername);
|
|
1345
|
-
return authToken;
|
|
1346
901
|
} catch (error) {
|
|
1347
|
-
console.error('❌ Error
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
// ✅ NEW: Start background training when transitioning from connectors to PIN screen
|
|
1358
|
-
console.log('🚀 [TRANSITION] Starting background training during connect → pin transition');
|
|
1359
|
-
startBackgroundTraining().catch(error => {
|
|
1360
|
-
console.error('❌ [TRANSITION] Background training failed during transition:', error);
|
|
1361
|
-
// Continue to PIN screen even if training fails
|
|
902
|
+
console.error('❌ Error in data request accept:', error);
|
|
903
|
+
|
|
904
|
+
// Fallback to standard mode
|
|
905
|
+
onComplete('https://api2.onairos.uk', 'existing-session-token', {
|
|
906
|
+
existingAccount: true,
|
|
907
|
+
email: email.trim(),
|
|
908
|
+
dataRequestAccepted: true,
|
|
909
|
+
requestData,
|
|
910
|
+
autoMode: false,
|
|
911
|
+
error: error instanceof Error ? error.message : 'Unknown error'
|
|
1362
912
|
});
|
|
1363
|
-
setStep('pin');
|
|
1364
913
|
}
|
|
1365
|
-
};
|
|
1366
|
-
const
|
|
1367
|
-
console.log('
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
}
|
|
1376
|
-
};
|
|
1377
|
-
|
|
1378
|
-
// Removed navigation dependency for SDK compatibility
|
|
1379
|
-
|
|
1380
|
-
// Training is now handled by the TrainingModal component
|
|
1381
|
-
|
|
1382
|
-
// ✅ NEW: Background training function - starts when PIN screen appears
|
|
1383
|
-
const startBackgroundTraining = (0, _react.useCallback)(async () => {
|
|
1384
|
-
try {
|
|
1385
|
-
console.log('🚀 [BACKGROUND] Starting background training optimization...');
|
|
1386
|
-
setBackgroundTrainingProgress('Connecting...');
|
|
1387
|
-
|
|
1388
|
-
// Step 1: Ensure authentication token exists
|
|
1389
|
-
const authToken = await ensureAuthToken();
|
|
1390
|
-
if (!authToken) {
|
|
1391
|
-
throw new Error('Failed to create authentication token for background training');
|
|
1392
|
-
}
|
|
1393
|
-
console.log('✅ [BACKGROUND] Auth token ready:', `${authToken.substring(0, 20)}...`);
|
|
1394
|
-
setUserToken(authToken);
|
|
1395
|
-
|
|
1396
|
-
// Step 2: Set up user info if not available
|
|
1397
|
-
if (!userInfo) {
|
|
1398
|
-
var _user$email5;
|
|
1399
|
-
const storedUsername = await (0, _authService.getOnairosUsername)();
|
|
1400
|
-
const fallbackUsername = storedUsername || (user === null || user === void 0 || (_user$email5 = user.email) === null || _user$email5 === void 0 ? void 0 : _user$email5.split('@')[0]) || (user === null || user === void 0 ? void 0 : user.name) || 'mobile_user';
|
|
1401
|
-
const newUserInfo = {
|
|
1402
|
-
username: fallbackUsername,
|
|
1403
|
-
email: (user === null || user === void 0 ? void 0 : user.email) || null,
|
|
1404
|
-
id: null
|
|
1405
|
-
};
|
|
1406
|
-
setUserInfo(newUserInfo);
|
|
1407
|
-
setUsername(fallbackUsername);
|
|
1408
|
-
console.log('🧑💻 [BACKGROUND] User info set:', newUserInfo);
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
// Step 3: Initialize socket connection for background training
|
|
1412
|
-
console.log('🔌 [BACKGROUND] Setting up socket for background training...');
|
|
1413
|
-
setBackgroundTrainingProgress('Initializing data collection...');
|
|
1414
|
-
const backgroundSocket = (0, _socket.io)('https://api2.onairos.uk', {
|
|
1415
|
-
transports: ['websocket', 'polling'],
|
|
1416
|
-
autoConnect: false,
|
|
1417
|
-
timeout: 15000,
|
|
1418
|
-
reconnection: true,
|
|
1419
|
-
reconnectionAttempts: 3,
|
|
1420
|
-
reconnectionDelay: 1000,
|
|
1421
|
-
forceNew: true
|
|
1422
|
-
});
|
|
914
|
+
}, [email, onComplete, requestData, auto, inferenceData, AppName]);
|
|
915
|
+
const handleDataRequestDecline = (0, _react.useCallback)(() => {
|
|
916
|
+
console.log('Data request declined');
|
|
917
|
+
handleClose();
|
|
918
|
+
}, [handleClose]);
|
|
919
|
+
const canProceedToPin = (0, _react.useCallback)(() => {
|
|
920
|
+
// Test mode: Always allow proceeding (simulates platform connections)
|
|
921
|
+
if (isTestMode || testModeOptions.skipRealConnections) {
|
|
922
|
+
console.log('🧪 Test mode: Allowing proceed without real platform connections');
|
|
923
|
+
return true;
|
|
924
|
+
}
|
|
1423
925
|
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
console.log('✅ [BACKGROUND] Socket connected, starting background data collection...');
|
|
1427
|
-
const socketId = backgroundSocket.id;
|
|
1428
|
-
setBackgroundSocketId(socketId || null);
|
|
1429
|
-
setBackgroundTrainingProgress('Collecting your data...');
|
|
1430
|
-
if (socketId) {
|
|
1431
|
-
// Step 4: Start background training WITHOUT PIN (per backend instructions)
|
|
1432
|
-
await startBackgroundEnochTraining(socketId, authToken);
|
|
1433
|
-
}
|
|
1434
|
-
});
|
|
1435
|
-
backgroundSocket.on('trainingUpdate', data => {
|
|
1436
|
-
if (data.progress) {
|
|
1437
|
-
setBackgroundTrainingProgress(data.status || 'Processing...');
|
|
1438
|
-
console.log('📊 [BACKGROUND] Training progress:', data.progress, '%');
|
|
1439
|
-
}
|
|
1440
|
-
});
|
|
1441
|
-
backgroundSocket.on('disconnect', () => {
|
|
1442
|
-
console.log('❌ [BACKGROUND] Socket disconnected');
|
|
1443
|
-
});
|
|
926
|
+
// Production: Check if at least one platform is connected
|
|
927
|
+
const hasPlatformConnected = Object.values(platformToggles).some(value => value === true);
|
|
1444
928
|
|
|
1445
|
-
|
|
1446
|
-
|
|
929
|
+
// Auto mode validation
|
|
930
|
+
if (auto && partner !== 'couplebible' && !inferenceData) {
|
|
931
|
+
console.warn('Auto mode enabled but no inference data provided (and partner is not couplebible)');
|
|
932
|
+
return false;
|
|
933
|
+
}
|
|
934
|
+
return hasPlatformConnected;
|
|
935
|
+
}, [platformToggles, auto, partner, inferenceData, isTestMode, testModeOptions]);
|
|
936
|
+
const handleProceed = () => {
|
|
937
|
+
console.log('Proceeding to next step');
|
|
938
|
+
// Show success screen first
|
|
939
|
+
setStep('success');
|
|
1447
940
|
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
} catch (error) {
|
|
1452
|
-
console.error('❌ [BACKGROUND] Background training failed:', error);
|
|
1453
|
-
setBackgroundTrainingProgress('');
|
|
1454
|
-
throw error;
|
|
941
|
+
// Clear any existing timeout
|
|
942
|
+
if (successTimeoutRef.current) {
|
|
943
|
+
clearTimeout(successTimeoutRef.current);
|
|
1455
944
|
}
|
|
1456
|
-
}, [userInfo, username, user]);
|
|
1457
945
|
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
// Prepare background training data
|
|
1465
|
-
const backgroundData = {
|
|
1466
|
-
socketId,
|
|
1467
|
-
username: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.username) || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || username || 'mobile_user',
|
|
1468
|
-
email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || null,
|
|
1469
|
-
modelKey: null,
|
|
1470
|
-
connectedPlatforms: [],
|
|
1471
|
-
// No connected platforms for background training
|
|
1472
|
-
platformConnections: {} // No platform connections for background training
|
|
1473
|
-
// No encrypted PIN for background training
|
|
1474
|
-
};
|
|
1475
|
-
console.log('📤 Sending background training data to /mobile-training/enoch:', backgroundData);
|
|
1476
|
-
|
|
1477
|
-
// Use the new training function that includes YouTube migration check
|
|
1478
|
-
const backgroundResult = await (0, _mobileTrainingService.startEnochTrainingWithYouTubeCheck)(backgroundData);
|
|
1479
|
-
console.log('📡 Background training API response:', backgroundResult);
|
|
1480
|
-
|
|
1481
|
-
// Handle CONNECTIONS_REQUIRED scenario (pre-training validation)
|
|
1482
|
-
if (backgroundResult.requiresConnections || backgroundResult.code === 'CONNECTIONS_REQUIRED') {
|
|
1483
|
-
console.log('🔗 Connections required detected from background training');
|
|
1484
|
-
setDataScenario('CONNECTIONS_REQUIRED');
|
|
1485
|
-
setDataDetails(backgroundResult);
|
|
1486
|
-
setShowDataWarning(true);
|
|
1487
|
-
setPersonaStatus('Connections required');
|
|
1488
|
-
setHasError(true);
|
|
1489
|
-
stopDotsAnimation();
|
|
1490
|
-
return;
|
|
946
|
+
// After a delay, proceed to PIN
|
|
947
|
+
successTimeoutRef.current = setTimeout(() => {
|
|
948
|
+
// Only proceed if component is still mounted and visible
|
|
949
|
+
if (isMountedRef.current && visible) {
|
|
950
|
+
setStep('pin');
|
|
1491
951
|
}
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
console.log('🎯 Background training Features:', backgroundResult.features);
|
|
1495
|
-
|
|
1496
|
-
// ✅ CRITICAL: Set background training started flag
|
|
1497
|
-
setIsBackgroundTrainingStarted(true);
|
|
1498
|
-
|
|
1499
|
-
// Log the new features from the spec
|
|
1500
|
-
if (backgroundResult.features) {
|
|
1501
|
-
console.log('✅ Inference enabled:', backgroundResult.features.inference);
|
|
1502
|
-
console.log('💾 Storage method:', backgroundResult.features.storage);
|
|
1503
|
-
console.log('🔒 Compression enabled:', backgroundResult.features.compression);
|
|
1504
|
-
console.log('🔐 Encryption enabled:', backgroundResult.features.encryption);
|
|
1505
|
-
console.log('📊 Training type:', backgroundResult.features.type);
|
|
1506
|
-
console.log('🗄️ Databases:', backgroundResult.features.databases);
|
|
1507
|
-
console.log('📈 Query scores enabled:', backgroundResult.features.queryScores);
|
|
1508
|
-
}
|
|
1509
|
-
setPersonaStatus('Background training model...');
|
|
1510
|
-
setPersonaProgress(25);
|
|
1511
|
-
} else {
|
|
1512
|
-
console.error('❌ Background training start failed:', backgroundResult.error);
|
|
1513
|
-
setPersonaStatus(`Error: ${backgroundResult.error || 'Background training failed to start'}`);
|
|
1514
|
-
setHasError(true);
|
|
1515
|
-
stopDotsAnimation();
|
|
1516
|
-
}
|
|
1517
|
-
} catch (error) {
|
|
1518
|
-
console.error('❌ Background training start error:', error);
|
|
1519
|
-
setPersonaStatus(`Error: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
|
1520
|
-
setHasError(true);
|
|
1521
|
-
stopDotsAnimation();
|
|
1522
|
-
}
|
|
952
|
+
successTimeoutRef.current = null;
|
|
953
|
+
}, 3000);
|
|
1523
954
|
};
|
|
1524
955
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Modal, {
|
|
956
|
+
visible: visible,
|
|
1525
957
|
transparent: true,
|
|
1526
|
-
visible: modalVisible,
|
|
1527
958
|
animationType: "none",
|
|
959
|
+
statusBarTranslucent: true,
|
|
1528
960
|
onRequestClose: handleClose
|
|
961
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableWithoutFeedback, {
|
|
962
|
+
onPress: handleClose
|
|
1529
963
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1530
964
|
style: styles.modalOverlay
|
|
965
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableWithoutFeedback, {
|
|
966
|
+
onPress: e => e.stopPropagation()
|
|
1531
967
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
1532
968
|
style: [styles.bottomSheet, {
|
|
1533
969
|
transform: [{
|
|
@@ -1538,313 +974,214 @@ const UniversalOnboarding = ({
|
|
|
1538
974
|
style: styles.container
|
|
1539
975
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1540
976
|
style: styles.handleContainer
|
|
1541
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1542
|
-
onPress: handleClose,
|
|
1543
|
-
style: styles.handleButton
|
|
1544
977
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1545
978
|
style: styles.handle
|
|
1546
|
-
}))
|
|
1547
|
-
style: styles.
|
|
979
|
+
})), step === 'email' && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
980
|
+
style: styles.emailInputContainer
|
|
981
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
982
|
+
style: styles.emailHeader
|
|
983
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
984
|
+
style: styles.onairosIcon
|
|
985
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
986
|
+
source: require('../assets/images/onairos_logo.png'),
|
|
987
|
+
style: styles.onairosLogo,
|
|
988
|
+
resizeMode: "contain"
|
|
989
|
+
})), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
990
|
+
style: styles.emailTitle
|
|
991
|
+
}, "Welcome to Onairos"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
992
|
+
style: styles.emailSubtitle
|
|
993
|
+
}, "Enter your email to get started")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
994
|
+
style: styles.emailInputSection
|
|
995
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, {
|
|
996
|
+
style: styles.emailInput,
|
|
997
|
+
value: email,
|
|
998
|
+
onChangeText: setEmail,
|
|
999
|
+
placeholder: "Enter your email address",
|
|
1000
|
+
keyboardType: "email-address",
|
|
1001
|
+
autoCapitalize: "none",
|
|
1002
|
+
autoCorrect: false,
|
|
1003
|
+
autoFocus: true
|
|
1004
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1005
|
+
style: [styles.emailSubmitButton, !email.trim() && styles.emailSubmitButtonDisabled],
|
|
1006
|
+
onPress: handleEmailSubmit,
|
|
1007
|
+
disabled: !email.trim()
|
|
1008
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1009
|
+
style: styles.emailSubmitButtonText
|
|
1010
|
+
}, "Continue")))), step === 'verify' && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1011
|
+
style: styles.emailInputContainer
|
|
1012
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1013
|
+
style: styles.emailHeader
|
|
1548
1014
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1015
|
+
style: styles.onairosIcon
|
|
1016
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
1017
|
+
source: require('../assets/images/onairos_logo.png'),
|
|
1018
|
+
style: styles.onairosLogo,
|
|
1019
|
+
resizeMode: "contain"
|
|
1020
|
+
})), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1021
|
+
style: styles.emailTitle
|
|
1022
|
+
}, "Enter Verification Code"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1023
|
+
style: styles.emailSubtitle
|
|
1024
|
+
}, "We've sent a 6-digit code to ", email), isTestMode && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1025
|
+
style: styles.developmentNote
|
|
1026
|
+
}, "\uD83D\uDD0D Test Mode: Any 6-digit code will work")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1027
|
+
style: styles.emailInputSection
|
|
1028
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1029
|
+
style: styles.codeInputContainer
|
|
1030
|
+
}, [0, 1, 2, 3, 4, 5].map(index => /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, {
|
|
1031
|
+
key: index,
|
|
1032
|
+
ref: ref => codeInputRefs.current[index] = ref,
|
|
1033
|
+
style: [styles.codeDigit, verificationCode.length === index && styles.codeDigitActive],
|
|
1034
|
+
value: verificationCode[index] || '',
|
|
1035
|
+
onChangeText: text => {
|
|
1036
|
+
if (text.length <= 1 && /^\d*$/.test(text)) {
|
|
1037
|
+
const newCode = verificationCode.split('');
|
|
1038
|
+
newCode[index] = text;
|
|
1039
|
+
const updatedCode = newCode.join('').slice(0, 6);
|
|
1040
|
+
setVerificationCode(updatedCode);
|
|
1041
|
+
|
|
1042
|
+
// Auto-focus next input
|
|
1043
|
+
if (text && index < 5) {
|
|
1044
|
+
var _codeInputRefs$curren;
|
|
1045
|
+
(_codeInputRefs$curren = codeInputRefs.current[index + 1]) === null || _codeInputRefs$curren === void 0 || _codeInputRefs$curren.focus();
|
|
1046
|
+
}
|
|
1047
|
+
}
|
|
1048
|
+
},
|
|
1049
|
+
onKeyPress: ({
|
|
1050
|
+
nativeEvent
|
|
1051
|
+
}) => {
|
|
1052
|
+
// Handle backspace to move to previous input
|
|
1053
|
+
if (nativeEvent.key === 'Backspace' && !verificationCode[index] && index > 0) {
|
|
1054
|
+
var _codeInputRefs$curren2;
|
|
1055
|
+
(_codeInputRefs$curren2 = codeInputRefs.current[index - 1]) === null || _codeInputRefs$curren2 === void 0 || _codeInputRefs$curren2.focus();
|
|
1056
|
+
}
|
|
1057
|
+
},
|
|
1058
|
+
keyboardType: "number-pad",
|
|
1059
|
+
maxLength: 1,
|
|
1060
|
+
textAlign: "center",
|
|
1061
|
+
autoFocus: index === 0
|
|
1062
|
+
}))), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1063
|
+
style: [styles.emailSubmitButton, (verificationCode.length !== 6 || isVerifyingCode) && styles.emailSubmitButtonDisabled],
|
|
1064
|
+
onPress: handleVerificationSubmit,
|
|
1065
|
+
disabled: verificationCode.length !== 6 || isVerifyingCode
|
|
1066
|
+
}, isVerifyingCode ? /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
1067
|
+
size: "small",
|
|
1068
|
+
color: "#fff"
|
|
1069
|
+
}) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1070
|
+
style: styles.emailSubmitButtonText
|
|
1071
|
+
}, "Verify")), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1072
|
+
style: styles.backButton,
|
|
1073
|
+
onPress: () => setStep('email')
|
|
1074
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1075
|
+
style: styles.backButtonText
|
|
1076
|
+
}, "\u2190 Back to email")))), step === 'connect' && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1549
1077
|
style: styles.header
|
|
1550
1078
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1551
1079
|
style: styles.headerContent
|
|
1552
1080
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1553
|
-
style: styles.appIcon
|
|
1554
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1555
|
-
style: styles.appIconText
|
|
1556
|
-
}, "O")), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1557
|
-
style: styles.arrow
|
|
1558
|
-
}, "\u2192"), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1559
1081
|
style: styles.onairosIcon
|
|
1560
1082
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
1561
|
-
source: require('../assets/images/
|
|
1562
|
-
style: styles.
|
|
1083
|
+
source: require('../assets/images/onairos_logo.png'),
|
|
1084
|
+
style: styles.onairosLogo,
|
|
1563
1085
|
resizeMode: "contain"
|
|
1564
|
-
}))
|
|
1086
|
+
})), /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
1087
|
+
name: "arrow-forward",
|
|
1088
|
+
size: 24,
|
|
1089
|
+
color: "#666",
|
|
1090
|
+
style: styles.arrow
|
|
1091
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1092
|
+
style: styles.appIcon
|
|
1093
|
+
}, appIcon ? /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
1094
|
+
source: appIcon,
|
|
1095
|
+
style: styles.appIconImage,
|
|
1096
|
+
resizeMode: "contain"
|
|
1097
|
+
}) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1098
|
+
style: styles.appIconText
|
|
1099
|
+
}, AppName.charAt(0))))), /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, {
|
|
1100
|
+
style: styles.content,
|
|
1101
|
+
contentContainerStyle: styles.scrollContent,
|
|
1102
|
+
showsVerticalScrollIndicator: true,
|
|
1103
|
+
bounces: true,
|
|
1104
|
+
scrollEnabled: true,
|
|
1105
|
+
nestedScrollEnabled: true,
|
|
1106
|
+
keyboardShouldPersistTaps: "handled"
|
|
1107
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1565
1108
|
style: styles.titleContainer
|
|
1566
1109
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1567
1110
|
style: styles.mainTitle
|
|
1568
|
-
},
|
|
1111
|
+
}, "Let ", AppName, " learn about you from your data and apps"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1569
1112
|
style: styles.privacyMessage
|
|
1570
|
-
},
|
|
1571
|
-
style: styles.
|
|
1572
|
-
|
|
1573
|
-
}, "How it's used \u2192")), isExistingUser && existingUserInfo && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1574
|
-
style: styles.existingUserBanner
|
|
1575
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1576
|
-
style: styles.existingUserText
|
|
1577
|
-
}, "\u2705 You already have ", ((_existingUserInfo$exi = existingUserInfo.existingUserData) === null || _existingUserInfo$exi === void 0 || (_existingUserInfo$exi = _existingUserInfo$exi.summary) === null || _existingUserInfo$exi === void 0 ? void 0 : _existingUserInfo$exi.connectionsCount) || 0, " connections"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1578
|
-
style: styles.existingUserSubtext
|
|
1579
|
-
}, "Add more platforms to get even better insights")), connectionStatuses['linkedin'] === 'connected' && Object.values(connectionStatuses).filter(status => status === 'connected').length === 1 && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1580
|
-
style: styles.linkedinRequirementContainer
|
|
1581
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1582
|
-
style: styles.linkedinRequirementText
|
|
1583
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1584
|
-
style: styles.linkedinRequirementAsterisk
|
|
1585
|
-
}, "*"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1586
|
-
style: styles.linkedinRequirementMessage
|
|
1587
|
-
}, " LinkedIn requires pairing with an additional platform for optimal results"))))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1588
|
-
style: {
|
|
1589
|
-
height: 1,
|
|
1590
|
-
backgroundColor: '#CCCCCC',
|
|
1591
|
-
width: '100%',
|
|
1592
|
-
marginVertical: 0
|
|
1593
|
-
}
|
|
1594
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.ScrollView, {
|
|
1595
|
-
ref: scrollViewRef,
|
|
1596
|
-
style: styles.platformsScrollView,
|
|
1597
|
-
contentContainerStyle: styles.platformsScrollContent,
|
|
1598
|
-
showsVerticalScrollIndicator: true,
|
|
1599
|
-
bounces: true,
|
|
1600
|
-
alwaysBounceVertical: true,
|
|
1601
|
-
indicatorStyle: "black",
|
|
1602
|
-
scrollEventThrottle: 16,
|
|
1603
|
-
directionalLockEnabled: true,
|
|
1604
|
-
keyboardShouldPersistTaps: "handled",
|
|
1605
|
-
decelerationRate: "normal",
|
|
1606
|
-
contentOffset: {
|
|
1607
|
-
x: 0,
|
|
1608
|
-
y: 60
|
|
1609
|
-
}
|
|
1610
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1113
|
+
}, "None of your app data is shared with ANYONE"), (debug || testMode) && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1114
|
+
style: styles.developmentNote
|
|
1115
|
+
}, "\uD83E\uDDEA Test Mode: You can proceed without connecting any platforms")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1611
1116
|
style: styles.platformsContainer
|
|
1612
|
-
},
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1117
|
+
}, platformsToDisplay.map(platform => /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1118
|
+
key: platform.id,
|
|
1119
|
+
style: styles.platformItem,
|
|
1120
|
+
onPress: () => togglePlatform(platform.id),
|
|
1121
|
+
disabled: isConnectingPlatform
|
|
1617
1122
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1618
1123
|
style: styles.platformInfo
|
|
1619
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1624
|
-
style: styles.platformIconText
|
|
1625
|
-
}, "@")), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1124
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
1125
|
+
source: platform.icon,
|
|
1126
|
+
style: styles.platformIcon,
|
|
1127
|
+
resizeMode: "contain"
|
|
1128
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1626
1129
|
style: styles.platformName
|
|
1627
|
-
},
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
...prev,
|
|
1646
|
-
email: true
|
|
1647
|
-
}));
|
|
1648
|
-
|
|
1649
|
-
// Store the connected platform
|
|
1650
|
-
await storeConnectedPlatform('email');
|
|
1651
|
-
setStep('connections');
|
|
1652
|
-
},
|
|
1653
|
-
style: [styles.footerButtonConfirm, {
|
|
1654
|
-
paddingVertical: 8,
|
|
1655
|
-
paddingHorizontal: 16
|
|
1656
|
-
}]
|
|
1130
|
+
}, platform.name)), isConnectingPlatform && currentPlatform === platform.id ? /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
1131
|
+
size: "small",
|
|
1132
|
+
color: _constants.COLORS.primary
|
|
1133
|
+
}) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1134
|
+
style: [styles.platformToggle, platformToggles[platform.id] && styles.platformToggleActive]
|
|
1135
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1136
|
+
style: [styles.platformToggleThumb, platformToggles[platform.id] && styles.platformToggleThumbActive]
|
|
1137
|
+
})))), additionalPlatforms.length > 0 && /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1138
|
+
style: styles.expandButton,
|
|
1139
|
+
onPress: () => setShowAllPlatforms(!showAllPlatforms)
|
|
1140
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
1141
|
+
name: showAllPlatforms ? "expand_less" : "add",
|
|
1142
|
+
size: 24,
|
|
1143
|
+
color: _constants.COLORS.primary
|
|
1144
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1145
|
+
style: styles.expandButtonText
|
|
1146
|
+
}, showAllPlatforms ? "Show Less" : `${additionalPlatforms.length} More Connectors`))), showTestControls && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1147
|
+
style: styles.testModeContainer
|
|
1657
1148
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1658
|
-
style: styles.
|
|
1659
|
-
}, "
|
|
1660
|
-
|
|
1661
|
-
// Show main platforms first
|
|
1662
|
-
_react.default.createElement(_react.default.Fragment, null, mainPlatforms.map(platform => {
|
|
1663
|
-
const isConnected = connectionStatuses[platform.id] === 'connected';
|
|
1664
|
-
const isPlatformConnecting = connectingPlatform === platform.id;
|
|
1665
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1666
|
-
key: platform.id,
|
|
1667
|
-
style: styles.platformItem
|
|
1668
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1669
|
-
style: styles.platformInfo
|
|
1670
|
-
}, platform.id === 'linkedin' ?
|
|
1671
|
-
/*#__PURE__*/
|
|
1672
|
-
// Use square container for LinkedIn
|
|
1673
|
-
_react.default.createElement(_reactNative.View, {
|
|
1674
|
-
style: [styles.linkedinPlatformIcon, {
|
|
1675
|
-
backgroundColor: platform.color
|
|
1676
|
-
}]
|
|
1677
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
1678
|
-
source: getPlatformIcon(platform.id),
|
|
1679
|
-
style: styles.platformIconImage,
|
|
1680
|
-
resizeMode: "contain"
|
|
1681
|
-
})) : platform.id === 'pinterest' ?
|
|
1682
|
-
/*#__PURE__*/
|
|
1683
|
-
// Use smaller circular container for Pinterest
|
|
1684
|
-
_react.default.createElement(_reactNative.View, {
|
|
1685
|
-
style: [styles.pinterestPlatformIcon, {
|
|
1686
|
-
backgroundColor: platform.color
|
|
1687
|
-
}]
|
|
1688
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
1689
|
-
source: getPlatformIcon(platform.id),
|
|
1690
|
-
style: styles.pinterestIconImage,
|
|
1691
|
-
resizeMode: "contain"
|
|
1692
|
-
})) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1693
|
-
style: [styles.platformIcon, {
|
|
1694
|
-
backgroundColor: platform.color
|
|
1695
|
-
}]
|
|
1696
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
1697
|
-
source: getPlatformIcon(platform.id),
|
|
1698
|
-
style: platform.id === 'youtube' ? styles.youtubeIconImage : styles.platformIconImage,
|
|
1699
|
-
resizeMode: "contain"
|
|
1700
|
-
})), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1701
|
-
style: styles.platformName
|
|
1702
|
-
}, platform.name, platform.id === 'linkedin' && connectionStatuses['linkedin'] === 'connected' && Object.values(connectionStatuses).filter(status => status === 'connected').length === 1 && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1703
|
-
style: styles.asterisk
|
|
1704
|
-
}, "*"))), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1705
|
-
onPress: () => {
|
|
1706
|
-
if (isConnected) {
|
|
1707
|
-
// Handle disconnect
|
|
1708
|
-
handleDisconnectPlatform(platform.id, platform.name);
|
|
1709
|
-
} else {
|
|
1710
|
-
// Handle connect
|
|
1711
|
-
handleConnectPlatform(platform.id);
|
|
1712
|
-
}
|
|
1713
|
-
},
|
|
1714
|
-
onLongPress: platform.id === 'youtube' ? () => {
|
|
1715
|
-
// Start a timer for haptic feedback at 2 seconds
|
|
1716
|
-
const hapticTimer = setTimeout(() => {
|
|
1717
|
-
// Provide haptic feedback
|
|
1718
|
-
_reactNative.Vibration.vibrate(100);
|
|
1719
|
-
}, 2000);
|
|
1720
|
-
|
|
1721
|
-
// Start a timer for 4 seconds for the bypass
|
|
1722
|
-
const bypassTimer = setTimeout(() => {
|
|
1723
|
-
handleReviewerBypass();
|
|
1724
|
-
}, 4000);
|
|
1725
|
-
|
|
1726
|
-
// Store the timer
|
|
1727
|
-
setLongPressTimer(bypassTimer);
|
|
1728
|
-
} : undefined,
|
|
1729
|
-
onPressOut: platform.id === 'youtube' ? () => {
|
|
1730
|
-
// Clear the timer if the press is released before 4 seconds
|
|
1731
|
-
if (longPressTimer) {
|
|
1732
|
-
clearTimeout(longPressTimer);
|
|
1733
|
-
setLongPressTimer(null);
|
|
1734
|
-
}
|
|
1735
|
-
} : undefined,
|
|
1736
|
-
style: [isConnected ? styles.footerButtonConnected : styles.footerButtonConfirm, {
|
|
1737
|
-
paddingVertical: 8,
|
|
1738
|
-
paddingHorizontal: 16
|
|
1739
|
-
}],
|
|
1740
|
-
disabled: isPlatformConnecting
|
|
1741
|
-
}, isPlatformConnecting ? /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
1742
|
-
size: "small",
|
|
1743
|
-
color: "#fff"
|
|
1744
|
-
}) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1745
|
-
style: isConnected ? styles.footerButtonTextConnected : styles.footerButtonTextConfirm
|
|
1746
|
-
}, isConnected ? 'Connected' : 'Connect')));
|
|
1747
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1748
|
-
style: styles.additionalPlatformsToggle,
|
|
1149
|
+
style: styles.testModeTitle
|
|
1150
|
+
}, "\uD83E\uDDEA Test Mode - 2 Main Flows"), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1151
|
+
style: styles.testExistingUserButton,
|
|
1749
1152
|
onPress: () => {
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
// Expanding - show platforms first, then animate in and scroll
|
|
1754
|
-
setShowAdditionalPlatforms(true);
|
|
1755
|
-
_reactNative.Animated.timing(additionalPlatformsOpacity, {
|
|
1756
|
-
toValue: 1,
|
|
1757
|
-
duration: 300,
|
|
1758
|
-
useNativeDriver: true
|
|
1759
|
-
}).start();
|
|
1760
|
-
|
|
1761
|
-
// Auto-scroll to reveal additional platforms when expanding
|
|
1762
|
-
setTimeout(() => {
|
|
1763
|
-
var _scrollViewRef$curren;
|
|
1764
|
-
(_scrollViewRef$curren = scrollViewRef.current) === null || _scrollViewRef$curren === void 0 || _scrollViewRef$curren.scrollTo({
|
|
1765
|
-
y: 220,
|
|
1766
|
-
// Scroll down to reveal additional platforms and hint at Gmail
|
|
1767
|
-
animated: true
|
|
1768
|
-
});
|
|
1769
|
-
}, 100);
|
|
1770
|
-
} else {
|
|
1771
|
-
// Collapsing - animate out first, then hide platforms and scroll back up
|
|
1772
|
-
_reactNative.Animated.timing(additionalPlatformsOpacity, {
|
|
1773
|
-
toValue: 0,
|
|
1774
|
-
duration: 300,
|
|
1775
|
-
useNativeDriver: true
|
|
1776
|
-
}).start(() => {
|
|
1777
|
-
setShowAdditionalPlatforms(false);
|
|
1778
|
-
});
|
|
1779
|
-
|
|
1780
|
-
// Scroll back up smoothly when collapsing
|
|
1781
|
-
setTimeout(() => {
|
|
1782
|
-
var _scrollViewRef$curren2;
|
|
1783
|
-
(_scrollViewRef$curren2 = scrollViewRef.current) === null || _scrollViewRef$curren2 === void 0 || _scrollViewRef$curren2.scrollTo({
|
|
1784
|
-
y: 0,
|
|
1785
|
-
// Scroll back to top
|
|
1786
|
-
animated: true
|
|
1787
|
-
});
|
|
1788
|
-
}, 100);
|
|
1789
|
-
}
|
|
1153
|
+
// Flow 1: Existing User
|
|
1154
|
+
setIsExistingUser(true);
|
|
1155
|
+
setStep('dataRequest');
|
|
1790
1156
|
}
|
|
1791
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1157
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
1158
|
+
name: "person",
|
|
1159
|
+
size: 20,
|
|
1160
|
+
color: "#28a745"
|
|
1161
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1162
|
+
style: styles.testExistingUserButtonText
|
|
1163
|
+
}, "Flow 1: Existing User (Email \u2192 Code \u2192 Data Request \u2192 Close)")), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1164
|
+
style: styles.testSkipToTrainingButton,
|
|
1165
|
+
onPress: () => {
|
|
1166
|
+
// Flow 2: New User - Skip to connect step
|
|
1167
|
+
setStep('connect');
|
|
1796
1168
|
}
|
|
1797
|
-
},
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
source: getPlatformIcon(platform.id),
|
|
1814
|
-
style: styles.gmailIconImage,
|
|
1815
|
-
resizeMode: "contain"
|
|
1816
|
-
})) : /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1817
|
-
style: [styles.platformIcon, {
|
|
1818
|
-
backgroundColor: platform.color
|
|
1819
|
-
}]
|
|
1820
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Image, {
|
|
1821
|
-
source: getPlatformIcon(platform.id),
|
|
1822
|
-
style: platform.id === 'reddit' ? styles.redditIconImage : styles.platformIconImage,
|
|
1823
|
-
resizeMode: "contain"
|
|
1824
|
-
})), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1825
|
-
style: styles.platformName
|
|
1826
|
-
}, platform.name)), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1827
|
-
onPress: () => {
|
|
1828
|
-
if (isConnected) {
|
|
1829
|
-
// Handle disconnect
|
|
1830
|
-
handleDisconnectPlatform(platform.id, platform.name);
|
|
1831
|
-
} else {
|
|
1832
|
-
// Handle connect
|
|
1833
|
-
handleConnectPlatform(platform.id);
|
|
1834
|
-
}
|
|
1835
|
-
},
|
|
1836
|
-
style: [isConnected ? styles.footerButtonConnected : styles.footerButtonConfirm, {
|
|
1837
|
-
paddingVertical: 8,
|
|
1838
|
-
paddingHorizontal: 16
|
|
1839
|
-
}],
|
|
1840
|
-
disabled: isPlatformConnecting
|
|
1841
|
-
}, isPlatformConnecting ? /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
1842
|
-
size: "small",
|
|
1843
|
-
color: "#fff"
|
|
1844
|
-
}) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1845
|
-
style: isConnected ? styles.footerButtonTextConnected : styles.footerButtonTextConfirm
|
|
1846
|
-
}, isConnected ? 'Connected' : 'Connect')));
|
|
1847
|
-
}))))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1169
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
1170
|
+
name: "person-add",
|
|
1171
|
+
size: 20,
|
|
1172
|
+
color: "#17a2b8"
|
|
1173
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1174
|
+
style: styles.testSkipToTrainingButtonText
|
|
1175
|
+
}, "Flow 2: New User (Connect \u2192 PIN \u2192 Training)")), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1176
|
+
style: styles.testDataRequestButton,
|
|
1177
|
+
onPress: () => setStep('dataRequest')
|
|
1178
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
1179
|
+
name: "preview",
|
|
1180
|
+
size: 20,
|
|
1181
|
+
color: _constants.COLORS.primary
|
|
1182
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1183
|
+
style: styles.testDataRequestButtonText
|
|
1184
|
+
}, "Preview Data Request Screen")))), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1848
1185
|
style: styles.footer
|
|
1849
1186
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1850
1187
|
style: styles.footerButtonCancel,
|
|
@@ -1852,155 +1189,58 @@ const UniversalOnboarding = ({
|
|
|
1852
1189
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1853
1190
|
style: styles.footerButtonText
|
|
1854
1191
|
}, "Cancel")), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1855
|
-
style: [styles.footerButtonConfirm, !
|
|
1192
|
+
style: [styles.footerButtonConfirm, !canProceedToPin() && styles.footerButtonDisabled],
|
|
1856
1193
|
onPress: handleProceed,
|
|
1857
|
-
disabled: !
|
|
1194
|
+
disabled: !canProceedToPin()
|
|
1858
1195
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1859
1196
|
style: styles.footerButtonTextConfirm
|
|
1860
|
-
}, "
|
|
1861
|
-
|
|
1862
|
-
minLength: 8,
|
|
1863
|
-
requireSpecialChar: true,
|
|
1864
|
-
requireNumber: true,
|
|
1865
|
-
onBack: () => setStep('connect'),
|
|
1866
|
-
enableBiometricStorage: true
|
|
1867
|
-
// ✅ REMOVED: Background training now starts during transition, not on component mount
|
|
1868
|
-
// onBackgroundTrainingStart={startBackgroundTraining}
|
|
1869
|
-
,
|
|
1870
|
-
showBackgroundProgress: true,
|
|
1871
|
-
backgroundProgressText: backgroundTrainingProgress || "Training is starting in the background..."
|
|
1872
|
-
}), step === 'persona' && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1873
|
-
style: styles.personaContainer
|
|
1197
|
+
}, "Connect")))), step === 'success' && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1198
|
+
style: styles.successContainer
|
|
1874
1199
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1875
|
-
style: styles.
|
|
1876
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1877
|
-
style: [styles.personaBackButton,
|
|
1878
|
-
// Highlight the back button when there's insufficient data
|
|
1879
|
-
(dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED') && styles.highlightedBackButton],
|
|
1880
|
-
onPress: () => setStep('connect') // Changed from 'pin' to 'connect' to go back to platform connections
|
|
1881
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1882
|
-
style: [{
|
|
1883
|
-
fontSize: 24
|
|
1884
|
-
},
|
|
1885
|
-
// Make the arrow more prominent when insufficient data
|
|
1886
|
-
(dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED') && styles.highlightedBackArrow]
|
|
1887
|
-
}, "\u2190")), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1888
|
-
style: styles.personaTitle
|
|
1889
|
-
}, isPersonaComplete ? 'Your persona is ready! 🎉' : 'Creating your persona')), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1890
|
-
style: styles.personaSubtitle
|
|
1891
|
-
}, isPersonaComplete ? 'We\'ve created a personalized experience just for you.' : 'This will only take a moment. We\'re personalizing your experience.'), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1892
|
-
style: styles.personaProgressContainer
|
|
1893
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1894
|
-
style: styles.personaProgressBar
|
|
1200
|
+
style: styles.successContent
|
|
1895
1201
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1896
|
-
style:
|
|
1897
|
-
|
|
1898
|
-
|
|
1202
|
+
style: styles.successIcon
|
|
1203
|
+
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
1204
|
+
name: "check",
|
|
1205
|
+
size: 48,
|
|
1206
|
+
color: "#fff"
|
|
1899
1207
|
})), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1900
|
-
style: styles.
|
|
1901
|
-
},
|
|
1902
|
-
style: styles.
|
|
1903
|
-
},
|
|
1904
|
-
style:
|
|
1905
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1906
|
-
style: styles.dataWarningHeader
|
|
1907
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1908
|
-
style: styles.dataWarningIcon
|
|
1909
|
-
}, dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED' ? '‼️' : 'ℹ️'), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1910
|
-
style: [styles.dataWarningTitle, {
|
|
1911
|
-
color: dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED' ? '#000000' : '#0369A1'
|
|
1912
|
-
}]
|
|
1913
|
-
}, dataScenario === 'CONNECTIONS_REQUIRED' ? 'Not enough data to personalize your experience' : dataScenario === 'NO_DATA' ? 'Not enough data to personalize your experience' : 'Working with your available data')), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1914
|
-
style: [styles.dataWarningMessage, {
|
|
1915
|
-
color: dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED' ? '#374151' : '#0C4A6E'
|
|
1916
|
-
}]
|
|
1917
|
-
}, dataScenario === 'CONNECTIONS_REQUIRED' ? 'To provide the best experience possible, please go back and add an additional platform.' : dataScenario === 'NO_DATA' ? 'To provide the best experience possible, please go back and add an additional platform.' : 'We\'re building your persona with the information currently available.'), (dataScenario === 'NO_DATA' || dataScenario === 'CONNECTIONS_REQUIRED') && /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1918
|
-
style: styles.goBackButton,
|
|
1919
|
-
onPress: () => setStep('connect'),
|
|
1920
|
-
activeOpacity: 0.8
|
|
1921
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1922
|
-
style: styles.goBackButtonText
|
|
1923
|
-
}, "\u2190 Add another platform")), (dataDetails === null || dataDetails === void 0 ? void 0 : dataDetails.suggestions) && dataScenario !== 'NO_DATA' && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1924
|
-
style: [styles.dataWarningSuggestions, {
|
|
1925
|
-
borderTopColor: 'rgba(3, 105, 161, 0.2)'
|
|
1926
|
-
}]
|
|
1927
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1928
|
-
style: [styles.dataWarningSuggestionsTitle, {
|
|
1929
|
-
color: '#0369A1'
|
|
1930
|
-
}]
|
|
1931
|
-
}, "For higher model quality:"), dataDetails.suggestions.slice(0, 2).map((suggestion, index) => {
|
|
1932
|
-
// Override specific suggestions with new text
|
|
1933
|
-
let displayText = suggestion;
|
|
1934
|
-
if (suggestion.toLowerCase().includes('better model quality') || suggestion.toLowerCase().includes('interact with more content')) {
|
|
1935
|
-
displayText = 'Connect additional platforms';
|
|
1936
|
-
} else if (suggestion.toLowerCase().includes('like/dislike more videos') || suggestion.toLowerCase().includes('posts, or content')) {
|
|
1937
|
-
displayText = 'Interact and generate more content (like/dislike more videos, etc.)';
|
|
1938
|
-
}
|
|
1939
|
-
return /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1940
|
-
key: index,
|
|
1941
|
-
style: [styles.dataWarningSuggestionItem, {
|
|
1942
|
-
color: '#0C4A6E'
|
|
1943
|
-
}]
|
|
1944
|
-
}, "\u2022 ", displayText);
|
|
1945
|
-
})), dataScenario === 'LIMITED_DATA' && /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1946
|
-
style: [styles.dataWarningContinueNote, {
|
|
1947
|
-
color: '#0369A1'
|
|
1948
|
-
}]
|
|
1949
|
-
})), personaStatus.includes('YouTube token expired') && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1950
|
-
style: [styles.dataWarningContainer, styles.dataInfoContainer]
|
|
1951
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1952
|
-
style: styles.dataWarningHeader
|
|
1953
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1954
|
-
style: styles.dataWarningIcon
|
|
1955
|
-
}, "\uD83D\uDD04"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1956
|
-
style: [styles.dataWarningTitle, {
|
|
1957
|
-
color: '#0369A1'
|
|
1958
|
-
}]
|
|
1959
|
-
}, "Refreshing YouTube connection")), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1960
|
-
style: [styles.dataWarningMessage, {
|
|
1961
|
-
color: '#0C4A6E'
|
|
1962
|
-
}]
|
|
1963
|
-
}, "Your YouTube access expired. We're automatically reconnecting...")), isPersonaComplete && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1964
|
-
style: styles.personaCompleteContainer
|
|
1965
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1966
|
-
style: styles.personaContinueButton,
|
|
1967
|
-
onPress: () => {
|
|
1968
|
-
console.log('🎯 Continue button pressed - completing onboarding');
|
|
1969
|
-
handlePersonaComplete();
|
|
1970
|
-
},
|
|
1971
|
-
activeOpacity: 0.8
|
|
1972
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1973
|
-
style: styles.personaContinueButtonText
|
|
1974
|
-
}, "Continue"))), hasError && !isPersonaComplete && !showDataWarning && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1975
|
-
style: styles.personaCompleteContainer
|
|
1976
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1977
|
-
style: styles.personaCompleteTitle
|
|
1978
|
-
}, "Something went wrong"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1979
|
-
style: styles.personaCompleteSubtitle
|
|
1980
|
-
}, "Please try again or contact support if the issue persists."), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
1981
|
-
style: [styles.personaContinueButton, {
|
|
1982
|
-
backgroundColor: '#FF3B30'
|
|
1983
|
-
}],
|
|
1984
|
-
onPress: () => {
|
|
1985
|
-
console.log('🔄 Retry button pressed - redirecting to connector screen');
|
|
1986
|
-
setHasError(false);
|
|
1987
|
-
// ❌ DISABLED: Don't start new training on retry
|
|
1988
|
-
// Training should only start during connector→PIN transition
|
|
1989
|
-
// startPersonaCreation();
|
|
1990
|
-
|
|
1991
|
-
// Instead, go back to connector screen so user can restart proper flow
|
|
1992
|
-
setStep('connect');
|
|
1993
|
-
setPersonaStatus('Initializing');
|
|
1994
|
-
setPersonaProgress(0);
|
|
1995
|
-
},
|
|
1996
|
-
activeOpacity: 0.8
|
|
1208
|
+
style: styles.successTitle
|
|
1209
|
+
}, "Never Connect Again!"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1210
|
+
style: styles.successSubtitle
|
|
1211
|
+
}, "Your login session has been saved"), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1212
|
+
style: styles.successMessage
|
|
1997
1213
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1998
|
-
style: styles.
|
|
1999
|
-
}, "
|
|
2000
|
-
style:
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
1214
|
+
style: styles.successMessageText
|
|
1215
|
+
}, "Your Onairos account and platform connections are now saved in your browser cookies. Next time you use any app with Onairos, you'll be automatically signed in without needing to reconnect your accounts.")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
1216
|
+
style: styles.progressIndicator
|
|
1217
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
1218
|
+
size: "small",
|
|
1219
|
+
color: "#4CAF50"
|
|
1220
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
1221
|
+
style: styles.progressText
|
|
1222
|
+
}, "Continuing...")))), step === 'pin' && /*#__PURE__*/_react.default.createElement(_PinInput.PinInput, {
|
|
1223
|
+
onSubmit: handlePinSubmit,
|
|
1224
|
+
minLength: 8,
|
|
1225
|
+
requireSpecialChar: true,
|
|
1226
|
+
requireNumber: true,
|
|
1227
|
+
onBack: () => setStep('connect')
|
|
1228
|
+
}), step === 'training' && /*#__PURE__*/_react.default.createElement(_TrainingModal.TrainingModal, {
|
|
1229
|
+
visible: step === 'training',
|
|
1230
|
+
progress: training.progress,
|
|
1231
|
+
eta: training.eta,
|
|
1232
|
+
onCancel: handleClose,
|
|
1233
|
+
onComplete: handleTrainingComplete,
|
|
1234
|
+
modelKey: "onairosTrainingModel",
|
|
1235
|
+
username: username,
|
|
1236
|
+
test: isTestMode
|
|
1237
|
+
}), step === 'dataRequest' && /*#__PURE__*/_react.default.createElement(_DataRequestScreen.DataRequestScreen, {
|
|
1238
|
+
onAccept: handleDataRequestAccept,
|
|
1239
|
+
onDecline: handleDataRequestDecline,
|
|
1240
|
+
requestData: requestData || {},
|
|
1241
|
+
AppName: AppName,
|
|
1242
|
+
appIcon: appIcon
|
|
1243
|
+
}), step === 'oauth' && oauthUrl && /*#__PURE__*/_react.default.createElement(_OAuthWebView.OAuthWebView, {
|
|
2004
1244
|
url: oauthUrl,
|
|
2005
1245
|
platform: currentPlatform,
|
|
2006
1246
|
onClose: () => {
|
|
@@ -2009,147 +1249,33 @@ const UniversalOnboarding = ({
|
|
|
2009
1249
|
},
|
|
2010
1250
|
onSuccess: handleOAuthSuccess,
|
|
2011
1251
|
onComplete: () => setStep('connect')
|
|
2012
|
-
}))
|
|
2013
|
-
style: styles.modalContent
|
|
2014
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2015
|
-
style: styles.privacyHeader
|
|
2016
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
2017
|
-
style: styles.backButton,
|
|
2018
|
-
onPress: () => setStep('connect')
|
|
2019
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2020
|
-
style: styles.backButtonText
|
|
2021
|
-
}, "\u2190")), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2022
|
-
style: styles.headerTitle
|
|
2023
|
-
}, "How Enoch uses personal data"), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2024
|
-
style: styles.backButtonSpacer
|
|
2025
|
-
})), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2026
|
-
style: styles.privacyDetailsContainer
|
|
2027
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2028
|
-
style: styles.privacyDetailsTitle
|
|
2029
|
-
}), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2030
|
-
style: styles.privacyBulletPoint
|
|
2031
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2032
|
-
style: styles.bulletPoint
|
|
2033
|
-
}, "\u2022"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2034
|
-
style: styles.privacyBulletText
|
|
2035
|
-
}, "Enoch legally accesses your platform data with explicit permission for this event only - never stored post-session and auto-deleted.")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2036
|
-
style: styles.privacyBulletPoint
|
|
2037
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2038
|
-
style: styles.bulletPoint
|
|
2039
|
-
}, "\u2022"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2040
|
-
style: styles.privacyBulletText
|
|
2041
|
-
}, "Enoch NEVER sells your data. You are a user, not a commodity.")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2042
|
-
style: styles.privacyBulletPoint
|
|
2043
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2044
|
-
style: styles.bulletPoint
|
|
2045
|
-
}, "\u2022"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2046
|
-
style: styles.privacyBulletText
|
|
2047
|
-
}, "Data collected builds your Onairos persona, enabling personalized experiences across future products while prioritizing your data sovereignty."))), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
2048
|
-
style: styles.footerButtonConfirm,
|
|
2049
|
-
onPress: () => {
|
|
2050
|
-
(0, _haptics.triggerHaptic)(_haptics.HapticType.BUTTON_PRESS);
|
|
2051
|
-
setStep('connect');
|
|
2052
|
-
}
|
|
2053
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2054
|
-
style: styles.footerButtonTextConfirm
|
|
2055
|
-
}, "Got it"))), step === 'connections' && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2056
|
-
style: styles.modalContent
|
|
2057
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2058
|
-
style: styles.privacyHeader
|
|
2059
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
2060
|
-
style: styles.backButton,
|
|
2061
|
-
onPress: () => setStep(primaryAuthOnly ? 'connections' : 'connect')
|
|
2062
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2063
|
-
style: styles.backButtonText
|
|
2064
|
-
}, "\u2190")), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2065
|
-
style: styles.headerTitle
|
|
2066
|
-
}, "Connections Found"), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2067
|
-
style: styles.backButtonSpacer
|
|
2068
|
-
})), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2069
|
-
style: styles.privacyDetailsContainer
|
|
2070
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2071
|
-
style: styles.connectionsCountText
|
|
2072
|
-
}, "We found ", connectionsCount, " potential connections for you!"), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2073
|
-
style: styles.privacyBulletPoint
|
|
2074
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2075
|
-
style: styles.bulletPoint
|
|
2076
|
-
}, "\u2022"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2077
|
-
style: styles.privacyBulletText
|
|
2078
|
-
}, "Continue to see your personalized matches")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2079
|
-
style: styles.privacyBulletPoint
|
|
2080
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2081
|
-
style: styles.bulletPoint
|
|
2082
|
-
}, "\u2022"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2083
|
-
style: styles.privacyBulletText
|
|
2084
|
-
}, "Your privacy is protected - we only show compatible profiles")), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
2085
|
-
style: styles.privacyBulletPoint
|
|
2086
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2087
|
-
style: styles.bulletPoint
|
|
2088
|
-
}, "\u2022"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2089
|
-
style: styles.privacyBulletText
|
|
2090
|
-
}, "Ready to start building meaningful connections?"))), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
2091
|
-
style: styles.footerButtonConfirm,
|
|
2092
|
-
onPress: async () => {
|
|
2093
|
-
(0, _haptics.triggerHaptic)(_haptics.HapticType.BUTTON_PRESS);
|
|
2094
|
-
// Complete the onboarding flow
|
|
2095
|
-
isCompletingRef.current = true;
|
|
2096
|
-
|
|
2097
|
-
// Check if this is an existing user adding more data
|
|
2098
|
-
if (isExistingUser && existingUserToken) {
|
|
2099
|
-
console.log('🔑 EXISTING USER: UniversalOnboarding complete, returning existing user token:', `${existingUserToken.substring(0, 20)}...`);
|
|
2100
|
-
onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', existingUserToken, {
|
|
2101
|
-
email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
|
|
2102
|
-
...userInfo
|
|
2103
|
-
});
|
|
2104
|
-
} else {
|
|
2105
|
-
// For new users, retrieve the stored JWT token from TrainingModal
|
|
2106
|
-
const storedToken = (await _asyncStorage.default.getItem('onairos_jwt_token')) || (await _asyncStorage.default.getItem('auth_token')) || (await _asyncStorage.default.getItem('enoch_token'));
|
|
2107
|
-
const storedEmail = await _asyncStorage.default.getItem('user_email');
|
|
2108
|
-
if (storedToken) {
|
|
2109
|
-
console.log('🔑 NEW USER: UniversalOnboarding complete, returning stored JWT token:', `${storedToken.substring(0, 20)}...`);
|
|
2110
|
-
onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', storedToken, {
|
|
2111
|
-
email: storedEmail || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
|
|
2112
|
-
...userInfo
|
|
2113
|
-
});
|
|
2114
|
-
} else {
|
|
2115
|
-
console.warn('⚠️ NEW USER: No stored JWT token found, using fallback');
|
|
2116
|
-
onComplete === null || onComplete === void 0 || onComplete('https://api2.onairos.uk', 'connections-complete-token', {
|
|
2117
|
-
email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || '',
|
|
2118
|
-
...userInfo
|
|
2119
|
-
});
|
|
2120
|
-
}
|
|
2121
|
-
}
|
|
2122
|
-
}
|
|
2123
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
2124
|
-
style: styles.footerButtonTextConfirm
|
|
2125
|
-
}, "Continue to Setup")))))));
|
|
1252
|
+
})))))));
|
|
2126
1253
|
};
|
|
2127
1254
|
exports.UniversalOnboarding = UniversalOnboarding;
|
|
2128
1255
|
const styles = _reactNative.StyleSheet.create({
|
|
2129
1256
|
modalOverlay: {
|
|
2130
1257
|
flex: 1,
|
|
1258
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
2131
1259
|
justifyContent: 'flex-end',
|
|
2132
|
-
|
|
1260
|
+
alignItems: 'center'
|
|
2133
1261
|
},
|
|
2134
1262
|
bottomSheet: {
|
|
2135
|
-
backgroundColor: '#
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
width: '100%'
|
|
1263
|
+
backgroundColor: '#fff',
|
|
1264
|
+
width: width,
|
|
1265
|
+
height: height * 0.8,
|
|
1266
|
+
borderTopLeftRadius: 24,
|
|
1267
|
+
borderTopRightRadius: 24,
|
|
1268
|
+
overflow: 'hidden'
|
|
2142
1269
|
},
|
|
2143
1270
|
container: {
|
|
2144
|
-
flex: 1
|
|
1271
|
+
flex: 1,
|
|
1272
|
+
backgroundColor: '#fff'
|
|
2145
1273
|
},
|
|
2146
1274
|
handleContainer: {
|
|
1275
|
+
width: '100%',
|
|
2147
1276
|
alignItems: 'center',
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
handleButton: {
|
|
2151
|
-
padding: 10,
|
|
2152
|
-
width: 60
|
|
1277
|
+
paddingTop: 12,
|
|
1278
|
+
paddingBottom: 8
|
|
2153
1279
|
},
|
|
2154
1280
|
handle: {
|
|
2155
1281
|
width: 40,
|
|
@@ -2158,58 +1284,57 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
2158
1284
|
backgroundColor: '#E0E0E0'
|
|
2159
1285
|
},
|
|
2160
1286
|
header: {
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
paddingHorizontal: 24
|
|
1287
|
+
padding: 24,
|
|
1288
|
+
alignItems: 'center'
|
|
2164
1289
|
},
|
|
2165
1290
|
headerContent: {
|
|
2166
1291
|
flexDirection: 'row',
|
|
2167
1292
|
alignItems: 'center',
|
|
2168
1293
|
justifyContent: 'center',
|
|
2169
|
-
marginBottom:
|
|
1294
|
+
marginBottom: 16
|
|
2170
1295
|
},
|
|
2171
1296
|
appIcon: {
|
|
2172
1297
|
width: 48,
|
|
2173
1298
|
height: 48,
|
|
2174
|
-
borderRadius:
|
|
1299
|
+
borderRadius: 16,
|
|
2175
1300
|
backgroundColor: '#F5F5F5',
|
|
2176
1301
|
alignItems: 'center',
|
|
2177
1302
|
justifyContent: 'center'
|
|
2178
1303
|
},
|
|
2179
1304
|
appIconText: {
|
|
2180
1305
|
fontSize: 24,
|
|
2181
|
-
|
|
2182
|
-
|
|
1306
|
+
color: '#000'
|
|
1307
|
+
},
|
|
1308
|
+
appIconImage: {
|
|
1309
|
+
width: 32,
|
|
1310
|
+
height: 32
|
|
2183
1311
|
},
|
|
2184
1312
|
arrow: {
|
|
2185
|
-
marginHorizontal: 16
|
|
2186
|
-
fontSize: 24,
|
|
2187
|
-
color: '#666'
|
|
1313
|
+
marginHorizontal: 16
|
|
2188
1314
|
},
|
|
2189
1315
|
onairosIcon: {
|
|
2190
|
-
width:
|
|
2191
|
-
height:
|
|
2192
|
-
borderRadius:
|
|
2193
|
-
backgroundColor: '
|
|
1316
|
+
width: 48,
|
|
1317
|
+
height: 48,
|
|
1318
|
+
borderRadius: 16,
|
|
1319
|
+
backgroundColor: '#F5F5F5',
|
|
2194
1320
|
alignItems: 'center',
|
|
2195
1321
|
justifyContent: 'center'
|
|
2196
1322
|
},
|
|
2197
1323
|
onairosIconText: {
|
|
2198
1324
|
fontSize: 24,
|
|
2199
|
-
|
|
2200
|
-
color: '#fff'
|
|
1325
|
+
color: '#000'
|
|
2201
1326
|
},
|
|
2202
|
-
|
|
2203
|
-
width:
|
|
2204
|
-
height:
|
|
1327
|
+
onairosLogo: {
|
|
1328
|
+
width: 32,
|
|
1329
|
+
height: 32
|
|
2205
1330
|
},
|
|
2206
1331
|
titleContainer: {
|
|
2207
|
-
|
|
1332
|
+
marginBottom: 20
|
|
2208
1333
|
},
|
|
2209
1334
|
mainTitle: {
|
|
2210
|
-
fontSize:
|
|
1335
|
+
fontSize: 20,
|
|
2211
1336
|
fontWeight: '600',
|
|
2212
|
-
color: '#
|
|
1337
|
+
color: '#000',
|
|
2213
1338
|
textAlign: 'center',
|
|
2214
1339
|
marginBottom: 12
|
|
2215
1340
|
},
|
|
@@ -2217,102 +1342,44 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
2217
1342
|
fontSize: 14,
|
|
2218
1343
|
color: '#666',
|
|
2219
1344
|
textAlign: 'center',
|
|
2220
|
-
marginBottom:
|
|
2221
|
-
},
|
|
2222
|
-
privacyLink: {
|
|
2223
|
-
color: '#000000',
|
|
2224
|
-
fontWeight: '600',
|
|
2225
|
-
textDecorationLine: 'underline'
|
|
2226
|
-
},
|
|
2227
|
-
boldText: {
|
|
2228
|
-
fontWeight: 'bold'
|
|
1345
|
+
marginBottom: 12
|
|
2229
1346
|
},
|
|
2230
1347
|
content: {
|
|
2231
1348
|
flex: 1,
|
|
2232
1349
|
paddingHorizontal: 24
|
|
2233
1350
|
},
|
|
2234
|
-
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
},
|
|
2238
|
-
platformsScrollContent: {
|
|
2239
|
-
paddingBottom: 0,
|
|
2240
|
-
paddingHorizontal: 24
|
|
2241
|
-
},
|
|
2242
|
-
platformsContainer: {
|
|
2243
|
-
marginTop: 16
|
|
2244
|
-
},
|
|
2245
|
-
platformItem: {
|
|
2246
|
-
flexDirection: 'row',
|
|
2247
|
-
alignItems: 'center',
|
|
2248
|
-
justifyContent: 'space-between',
|
|
2249
|
-
paddingVertical: 16,
|
|
2250
|
-
paddingHorizontal: 8,
|
|
2251
|
-
borderBottomWidth: 1,
|
|
2252
|
-
borderBottomColor: '#E5E5E5'
|
|
2253
|
-
},
|
|
2254
|
-
platformInfo: {
|
|
2255
|
-
flexDirection: 'row',
|
|
2256
|
-
alignItems: 'center'
|
|
2257
|
-
},
|
|
2258
|
-
platformIcon: {
|
|
2259
|
-
width: 40,
|
|
2260
|
-
height: 40,
|
|
2261
|
-
borderRadius: 20,
|
|
2262
|
-
backgroundColor: '#F5F5F5',
|
|
2263
|
-
alignItems: 'center',
|
|
2264
|
-
justifyContent: 'center',
|
|
2265
|
-
marginRight: 16
|
|
2266
|
-
},
|
|
2267
|
-
platformIconText: {
|
|
2268
|
-
fontSize: 18,
|
|
2269
|
-
fontWeight: 'bold',
|
|
2270
|
-
color: '#333',
|
|
2271
|
-
textAlign: 'center',
|
|
2272
|
-
textAlignVertical: 'center'
|
|
2273
|
-
},
|
|
2274
|
-
platformIconImage: {
|
|
2275
|
-
width: 24,
|
|
2276
|
-
height: 24
|
|
2277
|
-
},
|
|
2278
|
-
youtubeIconImage: {
|
|
2279
|
-
width: 58,
|
|
2280
|
-
height: 58
|
|
1351
|
+
scrollContent: {
|
|
1352
|
+
flexGrow: 1,
|
|
1353
|
+
paddingBottom: 20
|
|
2281
1354
|
},
|
|
2282
|
-
|
|
2283
|
-
|
|
2284
|
-
height: 34
|
|
2285
|
-
},
|
|
2286
|
-
pinterestIconImage: {
|
|
2287
|
-
width: 48,
|
|
2288
|
-
height: 48
|
|
2289
|
-
},
|
|
2290
|
-
gmailIconImage: {
|
|
2291
|
-
width: 32,
|
|
2292
|
-
height: 32
|
|
1355
|
+
platformsContainer: {
|
|
1356
|
+
marginTop: 16
|
|
2293
1357
|
},
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2297
|
-
borderRadius: 8,
|
|
2298
|
-
backgroundColor: '#F5F5F5',
|
|
1358
|
+
platformItem: {
|
|
1359
|
+
flexDirection: 'row',
|
|
1360
|
+
justifyContent: 'space-between',
|
|
2299
1361
|
alignItems: 'center',
|
|
2300
|
-
|
|
2301
|
-
|
|
1362
|
+
padding: 12,
|
|
1363
|
+
backgroundColor: '#fff',
|
|
1364
|
+
borderRadius: 12,
|
|
1365
|
+
marginBottom: 8,
|
|
1366
|
+
borderWidth: 1,
|
|
1367
|
+
borderColor: '#eee'
|
|
2302
1368
|
},
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
height: 34,
|
|
2306
|
-
borderRadius: 17,
|
|
2307
|
-
backgroundColor: '#F5F5F5',
|
|
1369
|
+
platformInfo: {
|
|
1370
|
+
flexDirection: 'row',
|
|
2308
1371
|
alignItems: 'center',
|
|
2309
|
-
|
|
2310
|
-
|
|
1372
|
+
flex: 1
|
|
1373
|
+
},
|
|
1374
|
+
platformIcon: {
|
|
1375
|
+
width: 24,
|
|
1376
|
+
height: 24,
|
|
1377
|
+
marginRight: 12
|
|
2311
1378
|
},
|
|
2312
1379
|
platformName: {
|
|
2313
1380
|
fontSize: 16,
|
|
2314
|
-
|
|
2315
|
-
|
|
1381
|
+
fontWeight: '500',
|
|
1382
|
+
color: '#000'
|
|
2316
1383
|
},
|
|
2317
1384
|
footer: {
|
|
2318
1385
|
flexDirection: 'row',
|
|
@@ -2320,389 +1387,301 @@ const styles = _reactNative.StyleSheet.create({
|
|
|
2320
1387
|
justifyContent: 'space-between',
|
|
2321
1388
|
padding: 24,
|
|
2322
1389
|
borderTopWidth: 1,
|
|
2323
|
-
borderTopColor: '#
|
|
1390
|
+
borderTopColor: '#eee',
|
|
1391
|
+
backgroundColor: '#fff'
|
|
2324
1392
|
},
|
|
2325
1393
|
footerButtonCancel: {
|
|
2326
|
-
paddingVertical:
|
|
1394
|
+
paddingVertical: 8,
|
|
2327
1395
|
paddingHorizontal: 16
|
|
2328
1396
|
},
|
|
2329
|
-
footerButtonText: {
|
|
2330
|
-
color: '#666',
|
|
2331
|
-
fontSize: 16
|
|
2332
|
-
},
|
|
2333
1397
|
footerButtonConfirm: {
|
|
2334
|
-
paddingVertical:
|
|
2335
|
-
paddingHorizontal:
|
|
2336
|
-
|
|
2337
|
-
|
|
2338
|
-
|
|
2339
|
-
|
|
2340
|
-
footerButtonConnected: {
|
|
2341
|
-
paddingVertical: 12,
|
|
2342
|
-
paddingHorizontal: 24,
|
|
2343
|
-
backgroundColor: '#E9C46A',
|
|
2344
|
-
borderRadius: 8
|
|
1398
|
+
paddingVertical: 16,
|
|
1399
|
+
paddingHorizontal: 32,
|
|
1400
|
+
borderRadius: 16,
|
|
1401
|
+
backgroundColor: '#fff',
|
|
1402
|
+
borderWidth: 1,
|
|
1403
|
+
borderColor: '#000'
|
|
2345
1404
|
},
|
|
2346
1405
|
footerButtonDisabled: {
|
|
2347
|
-
|
|
1406
|
+
opacity: 0.5
|
|
2348
1407
|
},
|
|
2349
|
-
|
|
2350
|
-
color: '#
|
|
2351
|
-
fontSize: 16
|
|
2352
|
-
fontWeight: '600'
|
|
1408
|
+
footerButtonText: {
|
|
1409
|
+
color: '#666',
|
|
1410
|
+
fontSize: 16
|
|
2353
1411
|
},
|
|
2354
|
-
|
|
1412
|
+
footerButtonTextConfirm: {
|
|
2355
1413
|
color: '#000',
|
|
2356
1414
|
fontSize: 16,
|
|
2357
1415
|
fontWeight: '600'
|
|
2358
1416
|
},
|
|
2359
|
-
|
|
2360
|
-
flex: 1
|
|
2361
|
-
},
|
|
2362
|
-
modalContent: {
|
|
1417
|
+
successContainer: {
|
|
2363
1418
|
flex: 1,
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
borderTopRightRadius: 20,
|
|
2367
|
-
padding: 24
|
|
2368
|
-
},
|
|
2369
|
-
backButton: {
|
|
2370
|
-
padding: 8,
|
|
2371
|
-
width: 40
|
|
1419
|
+
justifyContent: 'center',
|
|
1420
|
+
alignItems: 'center'
|
|
2372
1421
|
},
|
|
2373
|
-
|
|
2374
|
-
|
|
2375
|
-
|
|
1422
|
+
successContent: {
|
|
1423
|
+
backgroundColor: '#fff',
|
|
1424
|
+
padding: 24,
|
|
1425
|
+
borderRadius: 16,
|
|
1426
|
+
alignItems: 'center'
|
|
2376
1427
|
},
|
|
2377
|
-
|
|
2378
|
-
|
|
1428
|
+
successIcon: {
|
|
1429
|
+
backgroundColor: '#4CAF50',
|
|
1430
|
+
borderRadius: 24,
|
|
1431
|
+
padding: 12,
|
|
1432
|
+
marginBottom: 16
|
|
2379
1433
|
},
|
|
2380
|
-
|
|
2381
|
-
fontSize:
|
|
1434
|
+
successTitle: {
|
|
1435
|
+
fontSize: 22,
|
|
2382
1436
|
fontWeight: '600',
|
|
2383
|
-
color: '#
|
|
2384
|
-
textAlign: 'center'
|
|
2385
|
-
|
|
2386
|
-
privacyHeader: {
|
|
2387
|
-
flexDirection: 'row',
|
|
2388
|
-
alignItems: 'center',
|
|
2389
|
-
justifyContent: 'space-between',
|
|
2390
|
-
paddingHorizontal: 16,
|
|
2391
|
-
paddingVertical: 20,
|
|
2392
|
-
backgroundColor: '#FFFFFF',
|
|
2393
|
-
borderBottomWidth: 1,
|
|
2394
|
-
borderBottomColor: '#F0F0F0'
|
|
2395
|
-
},
|
|
2396
|
-
privacyDetailsContainer: {
|
|
2397
|
-
paddingHorizontal: 24,
|
|
2398
|
-
paddingVertical: 8,
|
|
2399
|
-
flex: 1,
|
|
2400
|
-
marginTop: 20
|
|
1437
|
+
color: '#000',
|
|
1438
|
+
textAlign: 'center',
|
|
1439
|
+
marginBottom: 16
|
|
2401
1440
|
},
|
|
2402
|
-
|
|
2403
|
-
fontSize:
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
marginBottom:
|
|
1441
|
+
successSubtitle: {
|
|
1442
|
+
fontSize: 14,
|
|
1443
|
+
color: '#666',
|
|
1444
|
+
textAlign: 'center',
|
|
1445
|
+
marginBottom: 16
|
|
2407
1446
|
},
|
|
2408
|
-
|
|
2409
|
-
|
|
2410
|
-
|
|
2411
|
-
|
|
1447
|
+
successMessage: {
|
|
1448
|
+
backgroundColor: '#f0f0f0',
|
|
1449
|
+
padding: 16,
|
|
1450
|
+
borderRadius: 8,
|
|
1451
|
+
marginBottom: 16
|
|
2412
1452
|
},
|
|
2413
|
-
|
|
2414
|
-
fontSize:
|
|
2415
|
-
|
|
2416
|
-
color: '#333'
|
|
1453
|
+
successMessageText: {
|
|
1454
|
+
fontSize: 14,
|
|
1455
|
+
color: '#666'
|
|
2417
1456
|
},
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
1457
|
+
platformToggle: {
|
|
1458
|
+
width: 50,
|
|
1459
|
+
height: 28,
|
|
1460
|
+
borderRadius: 14,
|
|
1461
|
+
borderWidth: 1,
|
|
1462
|
+
borderColor: '#ddd',
|
|
1463
|
+
backgroundColor: '#f0f0f0',
|
|
1464
|
+
justifyContent: 'center',
|
|
1465
|
+
paddingHorizontal: 2
|
|
2423
1466
|
},
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
color: '#333',
|
|
2428
|
-
marginBottom: 24
|
|
1467
|
+
platformToggleActive: {
|
|
1468
|
+
borderColor: '#4CAF50',
|
|
1469
|
+
backgroundColor: '#4CAF50'
|
|
2429
1470
|
},
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
1471
|
+
platformToggleThumb: {
|
|
1472
|
+
width: 22,
|
|
1473
|
+
height: 22,
|
|
1474
|
+
borderRadius: 11,
|
|
2433
1475
|
backgroundColor: '#fff',
|
|
2434
|
-
|
|
1476
|
+
shadowColor: '#000',
|
|
1477
|
+
shadowOffset: {
|
|
1478
|
+
width: 0,
|
|
1479
|
+
height: 1
|
|
1480
|
+
},
|
|
1481
|
+
shadowOpacity: 0.2,
|
|
1482
|
+
shadowRadius: 2,
|
|
1483
|
+
elevation: 2
|
|
2435
1484
|
},
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
alignItems: 'center',
|
|
2439
|
-
justifyContent: 'space-between',
|
|
2440
|
-
marginBottom: 16,
|
|
2441
|
-
paddingVertical: 8
|
|
1485
|
+
platformToggleThumbActive: {
|
|
1486
|
+
alignSelf: 'flex-end'
|
|
2442
1487
|
},
|
|
2443
|
-
|
|
2444
|
-
|
|
1488
|
+
// Dark mode styles
|
|
1489
|
+
darkPlatformItem: {
|
|
1490
|
+
backgroundColor: '#333',
|
|
1491
|
+
borderColor: '#555'
|
|
2445
1492
|
},
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
marginBottom: 32,
|
|
2449
|
-
paddingHorizontal: 24
|
|
1493
|
+
darkText: {
|
|
1494
|
+
color: '#fff'
|
|
2450
1495
|
},
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
fontWeight: '600',
|
|
2454
|
-
color: '#333',
|
|
2455
|
-
textAlign: 'center',
|
|
2456
|
-
flex: 1,
|
|
2457
|
-
marginBottom: 8
|
|
1496
|
+
darkSubText: {
|
|
1497
|
+
color: '#ccc'
|
|
2458
1498
|
},
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2462
|
-
|
|
2463
|
-
textAlign: 'center'
|
|
1499
|
+
progressIndicator: {
|
|
1500
|
+
flexDirection: 'row',
|
|
1501
|
+
alignItems: 'center',
|
|
1502
|
+
marginTop: 16
|
|
2464
1503
|
},
|
|
2465
|
-
|
|
2466
|
-
|
|
2467
|
-
|
|
1504
|
+
progressText: {
|
|
1505
|
+
fontSize: 16,
|
|
1506
|
+
fontWeight: '500',
|
|
1507
|
+
color: '#000',
|
|
1508
|
+
marginLeft: 8
|
|
2468
1509
|
},
|
|
2469
|
-
|
|
2470
|
-
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
|
|
1510
|
+
// Email input styles
|
|
1511
|
+
emailInputContainer: {
|
|
1512
|
+
flex: 1,
|
|
1513
|
+
justifyContent: 'flex-start',
|
|
1514
|
+
alignItems: 'center',
|
|
1515
|
+
padding: 24,
|
|
1516
|
+
paddingTop: 60
|
|
2475
1517
|
},
|
|
2476
|
-
|
|
2477
|
-
|
|
2478
|
-
|
|
2479
|
-
borderRadius: 4
|
|
1518
|
+
emailHeader: {
|
|
1519
|
+
alignItems: 'center',
|
|
1520
|
+
marginBottom: 32
|
|
2480
1521
|
},
|
|
2481
|
-
|
|
2482
|
-
fontSize:
|
|
1522
|
+
emailTitle: {
|
|
1523
|
+
fontSize: 24,
|
|
2483
1524
|
fontWeight: '600',
|
|
2484
|
-
color: '#
|
|
1525
|
+
color: '#000',
|
|
2485
1526
|
textAlign: 'center',
|
|
1527
|
+
marginTop: 16,
|
|
2486
1528
|
marginBottom: 8
|
|
2487
1529
|
},
|
|
2488
|
-
|
|
2489
|
-
fontSize:
|
|
1530
|
+
emailSubtitle: {
|
|
1531
|
+
fontSize: 16,
|
|
2490
1532
|
color: '#666',
|
|
2491
1533
|
textAlign: 'center'
|
|
2492
1534
|
},
|
|
2493
|
-
|
|
2494
|
-
alignItems: 'center',
|
|
2495
|
-
paddingHorizontal: 0
|
|
2496
|
-
},
|
|
2497
|
-
personaCompleteTitle: {
|
|
2498
|
-
fontSize: 20,
|
|
2499
|
-
fontWeight: '600',
|
|
2500
|
-
color: '#333',
|
|
2501
|
-
marginBottom: 8,
|
|
2502
|
-
textAlign: 'center'
|
|
2503
|
-
},
|
|
2504
|
-
personaCompleteSubtitle: {
|
|
2505
|
-
fontSize: 14,
|
|
2506
|
-
color: '#666',
|
|
2507
|
-
textAlign: 'center',
|
|
2508
|
-
marginBottom: 40
|
|
2509
|
-
},
|
|
2510
|
-
personaContinueButton: {
|
|
2511
|
-
backgroundColor: '#000000',
|
|
2512
|
-
paddingVertical: 16,
|
|
2513
|
-
paddingHorizontal: 48,
|
|
2514
|
-
borderRadius: 16,
|
|
2515
|
-
alignItems: 'center',
|
|
1535
|
+
emailInputSection: {
|
|
2516
1536
|
width: '100%',
|
|
2517
|
-
|
|
2518
|
-
shadowColor: '#000',
|
|
2519
|
-
shadowOffset: {
|
|
2520
|
-
width: 0,
|
|
2521
|
-
height: 2
|
|
2522
|
-
},
|
|
2523
|
-
shadowOpacity: 0.1,
|
|
2524
|
-
shadowRadius: 4,
|
|
2525
|
-
elevation: 3
|
|
1537
|
+
maxWidth: 320
|
|
2526
1538
|
},
|
|
2527
|
-
|
|
2528
|
-
|
|
1539
|
+
emailInput: {
|
|
1540
|
+
borderWidth: 1,
|
|
1541
|
+
borderColor: '#ddd',
|
|
1542
|
+
borderRadius: 12,
|
|
1543
|
+
padding: 16,
|
|
2529
1544
|
fontSize: 16,
|
|
2530
|
-
|
|
2531
|
-
|
|
2532
|
-
progressError: {
|
|
2533
|
-
backgroundColor: '#FF3B30'
|
|
1545
|
+
marginBottom: 16,
|
|
1546
|
+
backgroundColor: '#fff'
|
|
2534
1547
|
},
|
|
2535
|
-
|
|
2536
|
-
|
|
1548
|
+
emailSubmitButton: {
|
|
1549
|
+
backgroundColor: '#4CAF50',
|
|
1550
|
+
paddingVertical: 16,
|
|
1551
|
+
paddingHorizontal: 32,
|
|
2537
1552
|
borderRadius: 12,
|
|
2538
|
-
|
|
2539
|
-
borderWidth: 1,
|
|
2540
|
-
shadowColor: '#000',
|
|
2541
|
-
shadowOffset: {
|
|
2542
|
-
width: 0,
|
|
2543
|
-
height: 2
|
|
2544
|
-
},
|
|
2545
|
-
shadowOpacity: 0.1,
|
|
2546
|
-
shadowRadius: 4,
|
|
2547
|
-
elevation: 3
|
|
2548
|
-
},
|
|
2549
|
-
dataWarningHeader: {
|
|
2550
|
-
flexDirection: 'row',
|
|
2551
|
-
alignItems: 'center',
|
|
2552
|
-
marginBottom: 8
|
|
1553
|
+
alignItems: 'center'
|
|
2553
1554
|
},
|
|
2554
|
-
|
|
2555
|
-
|
|
2556
|
-
marginRight: 8
|
|
1555
|
+
emailSubmitButtonDisabled: {
|
|
1556
|
+
opacity: 0.5
|
|
2557
1557
|
},
|
|
2558
|
-
|
|
1558
|
+
emailSubmitButtonText: {
|
|
1559
|
+
color: '#fff',
|
|
2559
1560
|
fontSize: 16,
|
|
2560
|
-
fontWeight: '600'
|
|
2561
|
-
flex: 1
|
|
2562
|
-
},
|
|
2563
|
-
dataWarningMessage: {
|
|
2564
|
-
fontSize: 14,
|
|
2565
|
-
marginBottom: 0,
|
|
2566
|
-
lineHeight: 20
|
|
2567
|
-
},
|
|
2568
|
-
dataWarningSuggestions: {
|
|
2569
|
-
marginTop: 12,
|
|
2570
|
-
paddingTop: 12,
|
|
2571
|
-
borderTopWidth: 1
|
|
1561
|
+
fontWeight: '600'
|
|
2572
1562
|
},
|
|
2573
|
-
|
|
1563
|
+
// Verification code styles
|
|
1564
|
+
developmentNote: {
|
|
2574
1565
|
fontSize: 14,
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
lineHeight: 18
|
|
2582
|
-
},
|
|
2583
|
-
dataWarningContinueNote: {
|
|
2584
|
-
fontSize: 13,
|
|
2585
|
-
fontWeight: '500',
|
|
2586
|
-
marginTop: 12,
|
|
2587
|
-
fontStyle: 'italic'
|
|
2588
|
-
},
|
|
2589
|
-
dataWarningError: {
|
|
2590
|
-
backgroundColor: '#FFF5F5',
|
|
2591
|
-
borderColor: '#FEB2B2'
|
|
2592
|
-
},
|
|
2593
|
-
dataInfoContainer: {
|
|
2594
|
-
backgroundColor: '#F0F9FF',
|
|
2595
|
-
borderColor: '#BAE6FD'
|
|
1566
|
+
color: '#FF9800',
|
|
1567
|
+
textAlign: 'center',
|
|
1568
|
+
marginTop: 8,
|
|
1569
|
+
backgroundColor: '#FFF3E0',
|
|
1570
|
+
padding: 8,
|
|
1571
|
+
borderRadius: 4
|
|
2596
1572
|
},
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
width: 0,
|
|
2603
|
-
height: 0
|
|
2604
|
-
},
|
|
2605
|
-
shadowOpacity: 0.15,
|
|
2606
|
-
shadowRadius: 8
|
|
1573
|
+
codeInputContainer: {
|
|
1574
|
+
flexDirection: 'row',
|
|
1575
|
+
justifyContent: 'space-between',
|
|
1576
|
+
marginBottom: 24,
|
|
1577
|
+
paddingHorizontal: 20
|
|
2607
1578
|
},
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
1579
|
+
codeDigit: {
|
|
1580
|
+
width: 45,
|
|
1581
|
+
height: 55,
|
|
2611
1582
|
borderWidth: 2,
|
|
2612
|
-
borderColor: '#
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
|
|
2617
|
-
|
|
2618
|
-
shadowOpacity: 0.3,
|
|
2619
|
-
shadowRadius: 8,
|
|
2620
|
-
elevation: 5
|
|
1583
|
+
borderColor: '#ddd',
|
|
1584
|
+
borderRadius: 8,
|
|
1585
|
+
fontSize: 24,
|
|
1586
|
+
fontWeight: '600',
|
|
1587
|
+
color: '#000',
|
|
1588
|
+
backgroundColor: '#fff'
|
|
2621
1589
|
},
|
|
2622
|
-
|
|
2623
|
-
|
|
2624
|
-
fontWeight: 'bold'
|
|
1590
|
+
codeDigitActive: {
|
|
1591
|
+
borderColor: '#4CAF50'
|
|
2625
1592
|
},
|
|
2626
|
-
|
|
2627
|
-
backgroundColor: '#000000',
|
|
1593
|
+
backButton: {
|
|
2628
1594
|
paddingVertical: 12,
|
|
2629
|
-
|
|
2630
|
-
borderRadius: 8,
|
|
2631
|
-
marginTop: 12,
|
|
2632
|
-
alignItems: 'center',
|
|
2633
|
-
shadowColor: '#000000',
|
|
2634
|
-
shadowOffset: {
|
|
2635
|
-
width: 0,
|
|
2636
|
-
height: 0
|
|
2637
|
-
},
|
|
2638
|
-
shadowOpacity: 0.3,
|
|
2639
|
-
shadowRadius: 6,
|
|
2640
|
-
elevation: 3
|
|
1595
|
+
alignItems: 'center'
|
|
2641
1596
|
},
|
|
2642
|
-
|
|
2643
|
-
color: '#
|
|
2644
|
-
fontSize:
|
|
2645
|
-
fontWeight: '600'
|
|
1597
|
+
backButtonText: {
|
|
1598
|
+
color: '#666',
|
|
1599
|
+
fontSize: 16
|
|
2646
1600
|
},
|
|
2647
|
-
|
|
2648
|
-
|
|
2649
|
-
|
|
1601
|
+
// Expand button styles
|
|
1602
|
+
expandButton: {
|
|
1603
|
+
flexDirection: 'row',
|
|
2650
1604
|
alignItems: 'center',
|
|
2651
|
-
|
|
2652
|
-
|
|
1605
|
+
justifyContent: 'center',
|
|
1606
|
+
padding: 12,
|
|
1607
|
+
backgroundColor: '#f8f9fa',
|
|
1608
|
+
borderRadius: 12,
|
|
1609
|
+
borderWidth: 1,
|
|
1610
|
+
borderColor: '#e9ecef',
|
|
1611
|
+
marginTop: 8
|
|
2653
1612
|
},
|
|
2654
|
-
|
|
1613
|
+
expandButtonText: {
|
|
2655
1614
|
fontSize: 14,
|
|
2656
|
-
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
asterisk: {
|
|
2660
|
-
color: '#FF6B6B',
|
|
2661
|
-
fontSize: 16,
|
|
2662
|
-
fontWeight: 'bold',
|
|
2663
|
-
marginLeft: 2
|
|
1615
|
+
fontWeight: '500',
|
|
1616
|
+
color: _constants.COLORS.primary,
|
|
1617
|
+
marginLeft: 8
|
|
2664
1618
|
},
|
|
2665
|
-
|
|
2666
|
-
|
|
1619
|
+
// Test mode styles
|
|
1620
|
+
testModeContainer: {
|
|
1621
|
+
marginTop: 16,
|
|
1622
|
+
paddingHorizontal: 16,
|
|
1623
|
+
backgroundColor: '#f8f9fa',
|
|
1624
|
+
borderRadius: 12,
|
|
1625
|
+
padding: 16,
|
|
2667
1626
|
borderWidth: 1,
|
|
2668
|
-
borderColor: '#
|
|
2669
|
-
borderRadius: 8,
|
|
2670
|
-
paddingHorizontal: 12,
|
|
2671
|
-
paddingVertical: 8,
|
|
2672
|
-
marginTop: 8,
|
|
2673
|
-
marginHorizontal: 4
|
|
1627
|
+
borderColor: '#e9ecef'
|
|
2674
1628
|
},
|
|
2675
|
-
|
|
2676
|
-
fontSize:
|
|
2677
|
-
|
|
1629
|
+
testModeTitle: {
|
|
1630
|
+
fontSize: 16,
|
|
1631
|
+
fontWeight: '600',
|
|
1632
|
+
color: '#495057',
|
|
1633
|
+
marginBottom: 12,
|
|
2678
1634
|
textAlign: 'center'
|
|
2679
1635
|
},
|
|
2680
|
-
|
|
2681
|
-
|
|
2682
|
-
|
|
1636
|
+
testDataRequestButton: {
|
|
1637
|
+
flexDirection: 'row',
|
|
1638
|
+
alignItems: 'center',
|
|
1639
|
+
justifyContent: 'center',
|
|
1640
|
+
padding: 12,
|
|
1641
|
+
backgroundColor: '#fff3cd',
|
|
1642
|
+
borderRadius: 12,
|
|
1643
|
+
borderWidth: 1,
|
|
1644
|
+
borderColor: '#ffeaa7',
|
|
1645
|
+
marginBottom: 8
|
|
2683
1646
|
},
|
|
2684
|
-
|
|
2685
|
-
|
|
1647
|
+
testDataRequestButtonText: {
|
|
1648
|
+
fontSize: 14,
|
|
1649
|
+
fontWeight: '500',
|
|
1650
|
+
color: '#856404',
|
|
1651
|
+
marginLeft: 8
|
|
2686
1652
|
},
|
|
2687
|
-
|
|
2688
|
-
|
|
2689
|
-
|
|
2690
|
-
|
|
1653
|
+
testExistingUserButton: {
|
|
1654
|
+
flexDirection: 'row',
|
|
1655
|
+
alignItems: 'center',
|
|
1656
|
+
justifyContent: 'center',
|
|
1657
|
+
padding: 12,
|
|
1658
|
+
backgroundColor: '#d4edda',
|
|
2691
1659
|
borderRadius: 12,
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
1660
|
+
borderWidth: 1,
|
|
1661
|
+
borderColor: '#c3e6cb',
|
|
1662
|
+
marginBottom: 8
|
|
2695
1663
|
},
|
|
2696
|
-
|
|
1664
|
+
testExistingUserButtonText: {
|
|
2697
1665
|
fontSize: 14,
|
|
2698
|
-
fontWeight: '
|
|
2699
|
-
color: '#
|
|
2700
|
-
|
|
1666
|
+
fontWeight: '500',
|
|
1667
|
+
color: '#155724',
|
|
1668
|
+
marginLeft: 8
|
|
2701
1669
|
},
|
|
2702
|
-
|
|
2703
|
-
|
|
2704
|
-
|
|
2705
|
-
|
|
1670
|
+
testSkipToTrainingButton: {
|
|
1671
|
+
flexDirection: 'row',
|
|
1672
|
+
alignItems: 'center',
|
|
1673
|
+
justifyContent: 'center',
|
|
1674
|
+
padding: 12,
|
|
1675
|
+
backgroundColor: '#d1ecf1',
|
|
1676
|
+
borderRadius: 12,
|
|
1677
|
+
borderWidth: 1,
|
|
1678
|
+
borderColor: '#bee5eb'
|
|
1679
|
+
},
|
|
1680
|
+
testSkipToTrainingButtonText: {
|
|
1681
|
+
fontSize: 14,
|
|
1682
|
+
fontWeight: '500',
|
|
1683
|
+
color: '#0c5460',
|
|
1684
|
+
marginLeft: 8
|
|
2706
1685
|
}
|
|
2707
1686
|
});
|
|
2708
1687
|
//# sourceMappingURL=UniversalOnboarding.js.map
|