@onairos/react-native 3.1.12 → 3.1.13
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/lib/commonjs/api/index.js +75 -1
- package/lib/commonjs/api/index.js.map +1 -1
- 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 +3 -0
- package/lib/commonjs/assets/images/EnochE.svg +19 -0
- 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 +3 -0
- package/lib/commonjs/assets/images/Personalitytraits.svg +3 -0
- package/lib/commonjs/assets/images/Redditicon.png +0 -0
- package/lib/commonjs/assets/images/Userpreferences.svg +3 -0
- package/lib/commonjs/assets/images/YouTubeicon3.png +0 -0
- package/lib/commonjs/assets/images/arrow.svg +20 -0
- package/lib/commonjs/assets/images/basicproficon.svg +43 -0
- package/lib/commonjs/assets/images/basicprofile.svg +3 -0
- package/lib/commonjs/assets/images/checkmark.svg +4 -0
- package/lib/commonjs/assets/images/contentanalysis.svg +3 -0
- package/lib/commonjs/assets/images/contenticon.svg +23 -0
- 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 +18 -0
- package/lib/commonjs/assets/images/x-close.svg +3 -0
- package/lib/commonjs/components/BodyText.js +27 -0
- package/lib/commonjs/components/BodyText.js.map +1 -0
- package/lib/commonjs/components/BrandMark.js +44 -0
- package/lib/commonjs/components/BrandMark.js.map +1 -0
- package/lib/commonjs/components/CodeInput.js +30 -0
- package/lib/commonjs/components/CodeInput.js.map +1 -0
- package/lib/commonjs/components/EmailInput.js +30 -0
- package/lib/commonjs/components/EmailInput.js.map +1 -0
- package/lib/commonjs/components/ExistingUserDataConfirmation.js +474 -0
- package/lib/commonjs/components/ExistingUserDataConfirmation.js.map +1 -0
- package/lib/commonjs/components/GoogleButton.js +55 -0
- package/lib/commonjs/components/GoogleButton.js.map +1 -0
- package/lib/commonjs/components/HeadingGroup.js +43 -0
- package/lib/commonjs/components/HeadingGroup.js.map +1 -0
- package/lib/commonjs/components/ModalHeader.js +99 -0
- package/lib/commonjs/components/ModalHeader.js.map +1 -0
- package/lib/commonjs/components/ModalSheet.js +41 -0
- package/lib/commonjs/components/ModalSheet.js.map +1 -0
- package/lib/commonjs/components/Onairos.js +1 -3
- package/lib/commonjs/components/Onairos.js.map +1 -1
- package/lib/commonjs/components/OnairosButton.js +171 -190
- package/lib/commonjs/components/OnairosButton.js.map +1 -1
- package/lib/commonjs/components/OnairosSignInButton.js +169 -0
- package/lib/commonjs/components/OnairosSignInButton.js.map +1 -0
- package/lib/commonjs/components/Overlay.js +5 -5
- package/lib/commonjs/components/Overlay.js.map +1 -1
- package/lib/commonjs/components/PersonaImage.js +60 -0
- package/lib/commonjs/components/PersonaImage.js.map +1 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js +156 -0
- package/lib/commonjs/components/PersonaLoadingScreen.js.map +1 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js +316 -0
- package/lib/commonjs/components/PersonalizationConsentScreen.js.map +1 -0
- package/lib/commonjs/components/PinCreationScreen.js +393 -0
- package/lib/commonjs/components/PinCreationScreen.js.map +1 -0
- package/lib/commonjs/components/PinInput.js +282 -120
- package/lib/commonjs/components/PinInput.js.map +1 -1
- package/lib/commonjs/components/PlatformConnectorsStep.js +828 -0
- package/lib/commonjs/components/PlatformConnectorsStep.js.map +1 -0
- package/lib/commonjs/components/PlatformToggle.js +180 -0
- package/lib/commonjs/components/PlatformToggle.js.map +1 -0
- package/lib/commonjs/components/PrimaryButton.js +180 -0
- package/lib/commonjs/components/PrimaryButton.js.map +1 -0
- package/lib/commonjs/components/SignInMatchAnimation.js +197 -0
- package/lib/commonjs/components/SignInMatchAnimation.js.map +1 -0
- package/lib/commonjs/components/SignInStep.js +179 -0
- package/lib/commonjs/components/SignInStep.js.map +1 -0
- package/lib/commonjs/components/TrainingModal.js +808 -563
- package/lib/commonjs/components/TrainingModal.js.map +1 -1
- package/lib/commonjs/components/UniversalOnboarding.js +2304 -1283
- package/lib/commonjs/components/UniversalOnboarding.js.map +1 -1
- package/lib/commonjs/components/VerificationStep.js +154 -0
- package/lib/commonjs/components/VerificationStep.js.map +1 -0
- package/lib/commonjs/components/WelcomeScreen.js +385 -0
- package/lib/commonjs/components/WelcomeScreen.js.map +1 -0
- package/lib/commonjs/components/icons/Basicproficon.js +37 -0
- package/lib/commonjs/components/icons/Basicproficon.js.map +1 -0
- package/lib/commonjs/components/icons/Basicprofile.js +21 -0
- package/lib/commonjs/components/icons/Basicprofile.js.map +1 -0
- package/lib/commonjs/components/icons/Checkbox.js +21 -0
- package/lib/commonjs/components/icons/Checkbox.js.map +1 -0
- package/lib/commonjs/components/icons/Checkmark.js +27 -0
- package/lib/commonjs/components/icons/Checkmark.js.map +1 -0
- package/lib/commonjs/components/icons/Contentanalysis.js +21 -0
- package/lib/commonjs/components/icons/Contentanalysis.js.map +1 -0
- package/lib/commonjs/components/icons/Contenticon.js +39 -0
- package/lib/commonjs/components/icons/Contenticon.js.map +1 -0
- package/lib/commonjs/components/icons/EnochE.js +41 -0
- package/lib/commonjs/components/icons/EnochE.js.map +1 -0
- package/lib/commonjs/components/icons/Personalityicon.js +30 -0
- package/lib/commonjs/components/icons/Personalityicon.js.map +1 -0
- package/lib/commonjs/components/icons/Personalityprofile.js +21 -0
- package/lib/commonjs/components/icons/Personalityprofile.js.map +1 -0
- package/lib/commonjs/components/icons/Personalitytraits.js +21 -0
- package/lib/commonjs/components/icons/Personalitytraits.js.map +1 -0
- package/lib/commonjs/components/icons/Userpreferences.js +21 -0
- package/lib/commonjs/components/icons/Userpreferences.js.map +1 -0
- package/lib/commonjs/components/icons/index.js +84 -0
- package/lib/commonjs/components/icons/index.js.map +1 -0
- package/lib/commonjs/components/onboarding/OAuthWebView.js +134 -743
- package/lib/commonjs/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/commonjs/config/api.js +34 -0
- package/lib/commonjs/config/api.js.map +1 -0
- package/lib/commonjs/context/AuthContext.js +345 -0
- package/lib/commonjs/context/AuthContext.js.map +1 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js +111 -0
- package/lib/commonjs/hooks/useConnectedAccounts.js.map +1 -0
- package/lib/commonjs/hooks/useConnections.js +120 -125
- package/lib/commonjs/hooks/useConnections.js.map +1 -1
- package/lib/commonjs/hooks/useUserConnections.js +148 -0
- package/lib/commonjs/hooks/useUserConnections.js.map +1 -0
- package/lib/commonjs/index.js +149 -27
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/services/apiClient.js +302 -0
- package/lib/commonjs/services/apiClient.js.map +1 -0
- package/lib/commonjs/services/apiKeyService.js +8 -9
- package/lib/commonjs/services/apiKeyService.js.map +1 -1
- package/lib/commonjs/services/authService.js +935 -0
- package/lib/commonjs/services/authService.js.map +1 -0
- package/lib/commonjs/services/biometricPinService.js +184 -0
- package/lib/commonjs/services/biometricPinService.js.map +1 -0
- package/lib/commonjs/services/connectedAccountsService.js +268 -0
- package/lib/commonjs/services/connectedAccountsService.js.map +1 -0
- package/lib/commonjs/services/googleAuthService.js +268 -0
- package/lib/commonjs/services/googleAuthService.js.map +1 -0
- package/lib/commonjs/services/imageCompressionService.js +260 -0
- package/lib/commonjs/services/imageCompressionService.js.map +1 -0
- package/lib/commonjs/services/jwtStorageService.js +256 -0
- package/lib/commonjs/services/jwtStorageService.js.map +1 -0
- package/lib/commonjs/services/mobileTrainingService.js +185 -0
- package/lib/commonjs/services/mobileTrainingService.js.map +1 -0
- package/lib/commonjs/services/pinEncryptionService.js +84 -0
- package/lib/commonjs/services/pinEncryptionService.js.map +1 -0
- package/lib/commonjs/services/pinStorageUtils.js +105 -0
- package/lib/commonjs/services/pinStorageUtils.js.map +1 -0
- package/lib/commonjs/services/platformAuthService.js +956 -722
- package/lib/commonjs/services/platformAuthService.js.map +1 -1
- package/lib/commonjs/services/storageService.js +404 -0
- package/lib/commonjs/services/storageService.js.map +1 -0
- package/lib/commonjs/services/trainingApiHelpers.js +73 -0
- package/lib/commonjs/services/trainingApiHelpers.js.map +1 -0
- package/lib/commonjs/services/userConnectionsService.js +486 -0
- package/lib/commonjs/services/userConnectionsService.js.map +1 -0
- package/lib/commonjs/services/youtubeMigrationService.js +415 -0
- package/lib/commonjs/services/youtubeMigrationService.js.map +1 -0
- package/lib/commonjs/theme/index.js +249 -0
- package/lib/commonjs/theme/index.js.map +1 -0
- package/lib/commonjs/utils/eventUtils.js +288 -0
- package/lib/commonjs/utils/eventUtils.js.map +1 -0
- package/lib/commonjs/utils/haptics.js +66 -0
- package/lib/commonjs/utils/haptics.js.map +1 -0
- package/lib/commonjs/utils/imagePreloader.js +6 -0
- package/lib/commonjs/utils/imagePreloader.js.map +1 -0
- package/lib/module/api/index.js +72 -0
- package/lib/module/api/index.js.map +1 -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 +3 -0
- package/lib/module/assets/images/EnochE.svg +19 -0
- 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 +3 -0
- package/lib/module/assets/images/Personalitytraits.svg +3 -0
- package/lib/module/assets/images/Redditicon.png +0 -0
- package/lib/module/assets/images/Userpreferences.svg +3 -0
- package/lib/module/assets/images/YouTubeicon3.png +0 -0
- package/lib/module/assets/images/arrow.svg +20 -0
- package/lib/module/assets/images/basicproficon.svg +43 -0
- package/lib/module/assets/images/basicprofile.svg +3 -0
- package/lib/module/assets/images/checkmark.svg +4 -0
- package/lib/module/assets/images/contentanalysis.svg +3 -0
- package/lib/module/assets/images/contenticon.svg +23 -0
- 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 +18 -0
- package/lib/module/assets/images/x-close.svg +3 -0
- package/lib/module/components/BodyText.js +20 -0
- package/lib/module/components/BodyText.js.map +1 -0
- package/lib/module/components/BrandMark.js +37 -0
- package/lib/module/components/BrandMark.js.map +1 -0
- package/lib/module/components/CodeInput.js +23 -0
- package/lib/module/components/CodeInput.js.map +1 -0
- package/lib/module/components/EmailInput.js +23 -0
- package/lib/module/components/EmailInput.js.map +1 -0
- package/lib/module/components/ExistingUserDataConfirmation.js +465 -0
- package/lib/module/components/ExistingUserDataConfirmation.js.map +1 -0
- package/lib/module/components/GoogleButton.js +48 -0
- package/lib/module/components/GoogleButton.js.map +1 -0
- package/lib/module/components/HeadingGroup.js +36 -0
- package/lib/module/components/HeadingGroup.js.map +1 -0
- package/lib/module/components/ModalHeader.js +92 -0
- package/lib/module/components/ModalHeader.js.map +1 -0
- package/lib/module/components/ModalSheet.js +34 -0
- package/lib/module/components/ModalSheet.js.map +1 -0
- package/lib/module/components/Onairos.js +1 -3
- package/lib/module/components/Onairos.js.map +1 -1
- package/lib/module/components/OnairosButton.js +172 -192
- package/lib/module/components/OnairosButton.js.map +1 -1
- package/lib/module/components/OnairosSignInButton.js +160 -0
- package/lib/module/components/OnairosSignInButton.js.map +1 -0
- package/lib/module/components/Overlay.js +5 -5
- package/lib/module/components/Overlay.js.map +1 -1
- package/lib/module/components/PersonaImage.js +53 -0
- package/lib/module/components/PersonaImage.js.map +1 -0
- package/lib/module/components/PersonaLoadingScreen.js +148 -0
- package/lib/module/components/PersonaLoadingScreen.js.map +1 -0
- package/lib/module/components/PersonalizationConsentScreen.js +309 -0
- package/lib/module/components/PersonalizationConsentScreen.js.map +1 -0
- package/lib/module/components/PinCreationScreen.js +386 -0
- package/lib/module/components/PinCreationScreen.js.map +1 -0
- package/lib/module/components/PinInput.js +283 -120
- package/lib/module/components/PinInput.js.map +1 -1
- package/lib/module/components/PlatformConnectorsStep.js +820 -0
- package/lib/module/components/PlatformConnectorsStep.js.map +1 -0
- package/lib/module/components/PlatformToggle.js +173 -0
- package/lib/module/components/PlatformToggle.js.map +1 -0
- package/lib/module/components/PrimaryButton.js +172 -0
- package/lib/module/components/PrimaryButton.js.map +1 -0
- package/lib/module/components/SignInMatchAnimation.js +189 -0
- package/lib/module/components/SignInMatchAnimation.js.map +1 -0
- package/lib/module/components/SignInStep.js +171 -0
- package/lib/module/components/SignInStep.js.map +1 -0
- package/lib/module/components/TrainingModal.js +809 -565
- package/lib/module/components/TrainingModal.js.map +1 -1
- package/lib/module/components/UniversalOnboarding.js +2307 -1284
- package/lib/module/components/UniversalOnboarding.js.map +1 -1
- package/lib/module/components/VerificationStep.js +146 -0
- package/lib/module/components/VerificationStep.js.map +1 -0
- package/lib/module/components/WelcomeScreen.js +378 -0
- package/lib/module/components/WelcomeScreen.js.map +1 -0
- package/lib/module/components/icons/Basicproficon.js +30 -0
- package/lib/module/components/icons/Basicproficon.js.map +1 -0
- package/lib/module/components/icons/Basicprofile.js +14 -0
- package/lib/module/components/icons/Basicprofile.js.map +1 -0
- package/lib/module/components/icons/Checkbox.js +14 -0
- package/lib/module/components/icons/Checkbox.js.map +1 -0
- package/lib/module/components/icons/Checkmark.js +20 -0
- package/lib/module/components/icons/Checkmark.js.map +1 -0
- package/lib/module/components/icons/Contentanalysis.js +14 -0
- package/lib/module/components/icons/Contentanalysis.js.map +1 -0
- package/lib/module/components/icons/Contenticon.js +32 -0
- package/lib/module/components/icons/Contenticon.js.map +1 -0
- package/lib/module/components/icons/EnochE.js +34 -0
- package/lib/module/components/icons/EnochE.js.map +1 -0
- package/lib/module/components/icons/Personalityicon.js +23 -0
- package/lib/module/components/icons/Personalityicon.js.map +1 -0
- package/lib/module/components/icons/Personalityprofile.js +14 -0
- package/lib/module/components/icons/Personalityprofile.js.map +1 -0
- package/lib/module/components/icons/Personalitytraits.js +14 -0
- package/lib/module/components/icons/Personalitytraits.js.map +1 -0
- package/lib/module/components/icons/Userpreferences.js +14 -0
- package/lib/module/components/icons/Userpreferences.js.map +1 -0
- package/lib/module/components/icons/index.js +13 -0
- package/lib/module/components/icons/index.js.map +1 -0
- package/lib/module/components/onboarding/OAuthWebView.js +136 -744
- package/lib/module/components/onboarding/OAuthWebView.js.map +1 -1
- package/lib/module/config/api.js +26 -0
- package/lib/module/config/api.js.map +1 -0
- package/lib/module/context/AuthContext.js +335 -0
- package/lib/module/context/AuthContext.js.map +1 -0
- package/lib/module/hooks/useConnectedAccounts.js +106 -0
- package/lib/module/hooks/useConnectedAccounts.js.map +1 -0
- package/lib/module/hooks/useConnections.js +119 -125
- package/lib/module/hooks/useConnections.js.map +1 -1
- package/lib/module/hooks/useUserConnections.js +140 -0
- package/lib/module/hooks/useUserConnections.js.map +1 -0
- package/lib/module/index.js +51 -15
- package/lib/module/index.js.map +1 -1
- package/lib/module/services/apiClient.js +298 -0
- package/lib/module/services/apiClient.js.map +1 -0
- package/lib/module/services/apiKeyService.js +8 -9
- package/lib/module/services/apiKeyService.js.map +1 -1
- package/lib/module/services/authService.js +905 -0
- package/lib/module/services/authService.js.map +1 -0
- package/lib/module/services/biometricPinService.js +173 -0
- package/lib/module/services/biometricPinService.js.map +1 -0
- package/lib/module/services/connectedAccountsService.js +255 -0
- package/lib/module/services/connectedAccountsService.js.map +1 -0
- package/lib/module/services/googleAuthService.js +258 -0
- package/lib/module/services/googleAuthService.js.map +1 -0
- package/lib/module/services/imageCompressionService.js +250 -0
- package/lib/module/services/imageCompressionService.js.map +1 -0
- package/lib/module/services/jwtStorageService.js +239 -0
- package/lib/module/services/jwtStorageService.js.map +1 -0
- package/lib/module/services/mobileTrainingService.js +172 -0
- package/lib/module/services/mobileTrainingService.js.map +1 -0
- package/lib/module/services/pinEncryptionService.js +75 -0
- package/lib/module/services/pinEncryptionService.js.map +1 -0
- package/lib/module/services/pinStorageUtils.js +93 -0
- package/lib/module/services/pinStorageUtils.js.map +1 -0
- package/lib/module/services/platformAuthService.js +943 -704
- package/lib/module/services/platformAuthService.js.map +1 -1
- package/lib/module/services/storageService.js +383 -0
- package/lib/module/services/storageService.js.map +1 -0
- package/lib/module/services/trainingApiHelpers.js +67 -0
- package/lib/module/services/trainingApiHelpers.js.map +1 -0
- package/lib/module/services/userConnectionsService.js +476 -0
- package/lib/module/services/userConnectionsService.js.map +1 -0
- package/lib/module/services/youtubeMigrationService.js +404 -0
- package/lib/module/services/youtubeMigrationService.js.map +1 -0
- package/lib/module/theme/index.js +244 -0
- package/lib/module/theme/index.js.map +1 -0
- package/lib/module/utils/eventUtils.js +270 -0
- package/lib/module/utils/eventUtils.js.map +1 -0
- package/lib/module/utils/haptics.js +59 -0
- package/lib/module/utils/haptics.js.map +1 -0
- package/lib/module/utils/imagePreloader.js +3 -0
- package/lib/module/utils/imagePreloader.js.map +1 -0
- package/lib/typescript/api/index.d.ts +8 -0
- package/lib/typescript/api/index.d.ts.map +1 -1
- package/lib/typescript/components/BodyText.d.ts +10 -0
- package/lib/typescript/components/BodyText.d.ts.map +1 -0
- package/lib/typescript/components/BrandMark.d.ts +11 -0
- package/lib/typescript/components/BrandMark.d.ts.map +1 -0
- package/lib/typescript/components/CodeInput.d.ts +10 -0
- package/lib/typescript/components/CodeInput.d.ts.map +1 -0
- package/lib/typescript/components/EmailInput.d.ts +8 -0
- package/lib/typescript/components/EmailInput.d.ts.map +1 -0
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts +12 -0
- package/lib/typescript/components/ExistingUserDataConfirmation.d.ts.map +1 -0
- package/lib/typescript/components/GoogleButton.d.ts +11 -0
- package/lib/typescript/components/GoogleButton.d.ts.map +1 -0
- package/lib/typescript/components/HeadingGroup.d.ts +11 -0
- package/lib/typescript/components/HeadingGroup.d.ts.map +1 -0
- package/lib/typescript/components/ModalHeader.d.ts +11 -0
- package/lib/typescript/components/ModalHeader.d.ts.map +1 -0
- package/lib/typescript/components/ModalSheet.d.ts +13 -0
- package/lib/typescript/components/ModalSheet.d.ts.map +1 -0
- package/lib/typescript/components/Onairos.d.ts.map +1 -1
- package/lib/typescript/components/OnairosButton.d.ts +29 -4
- package/lib/typescript/components/OnairosButton.d.ts.map +1 -1
- package/lib/typescript/components/OnairosSignInButton.d.ts +14 -0
- package/lib/typescript/components/OnairosSignInButton.d.ts.map +1 -0
- package/lib/typescript/components/PersonaImage.d.ts +8 -0
- package/lib/typescript/components/PersonaImage.d.ts.map +1 -0
- package/lib/typescript/components/PersonaLoadingScreen.d.ts +10 -0
- package/lib/typescript/components/PersonaLoadingScreen.d.ts.map +1 -0
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts +10 -0
- package/lib/typescript/components/PersonalizationConsentScreen.d.ts.map +1 -0
- package/lib/typescript/components/PinCreationScreen.d.ts +10 -0
- package/lib/typescript/components/PinCreationScreen.d.ts.map +1 -0
- package/lib/typescript/components/PinInput.d.ts +11 -1
- package/lib/typescript/components/PinInput.d.ts.map +1 -1
- package/lib/typescript/components/PlatformConnectorsStep.d.ts +11 -0
- package/lib/typescript/components/PlatformConnectorsStep.d.ts.map +1 -0
- package/lib/typescript/components/PlatformToggle.d.ts +20 -0
- package/lib/typescript/components/PlatformToggle.d.ts.map +1 -0
- package/lib/typescript/components/PrimaryButton.d.ts +22 -0
- package/lib/typescript/components/PrimaryButton.d.ts.map +1 -0
- package/lib/typescript/components/SignInMatchAnimation.d.ts +9 -0
- package/lib/typescript/components/SignInMatchAnimation.d.ts.map +1 -0
- package/lib/typescript/components/SignInStep.d.ts +12 -0
- package/lib/typescript/components/SignInStep.d.ts.map +1 -0
- package/lib/typescript/components/TrainingModal.d.ts +12 -1
- package/lib/typescript/components/TrainingModal.d.ts.map +1 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts +14 -1
- package/lib/typescript/components/UniversalOnboarding.d.ts.map +1 -1
- package/lib/typescript/components/VerificationStep.d.ts +13 -0
- package/lib/typescript/components/VerificationStep.d.ts.map +1 -0
- package/lib/typescript/components/WelcomeScreen.d.ts +9 -0
- package/lib/typescript/components/WelcomeScreen.d.ts.map +1 -0
- package/lib/typescript/components/icons/Basicproficon.d.ts +5 -0
- package/lib/typescript/components/icons/Basicproficon.d.ts.map +1 -0
- package/lib/typescript/components/icons/Basicprofile.d.ts +5 -0
- package/lib/typescript/components/icons/Basicprofile.d.ts.map +1 -0
- package/lib/typescript/components/icons/Checkbox.d.ts +5 -0
- package/lib/typescript/components/icons/Checkbox.d.ts.map +1 -0
- package/lib/typescript/components/icons/Checkmark.d.ts +5 -0
- package/lib/typescript/components/icons/Checkmark.d.ts.map +1 -0
- package/lib/typescript/components/icons/Contentanalysis.d.ts +5 -0
- package/lib/typescript/components/icons/Contentanalysis.d.ts.map +1 -0
- package/lib/typescript/components/icons/Contenticon.d.ts +5 -0
- package/lib/typescript/components/icons/Contenticon.d.ts.map +1 -0
- package/lib/typescript/components/icons/EnochE.d.ts +5 -0
- package/lib/typescript/components/icons/EnochE.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalityicon.d.ts +5 -0
- package/lib/typescript/components/icons/Personalityicon.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalityprofile.d.ts +5 -0
- package/lib/typescript/components/icons/Personalityprofile.d.ts.map +1 -0
- package/lib/typescript/components/icons/Personalitytraits.d.ts +5 -0
- package/lib/typescript/components/icons/Personalitytraits.d.ts.map +1 -0
- package/lib/typescript/components/icons/Userpreferences.d.ts +5 -0
- package/lib/typescript/components/icons/Userpreferences.d.ts.map +1 -0
- package/lib/typescript/components/icons/index.d.ts +12 -0
- package/lib/typescript/components/icons/index.d.ts.map +1 -0
- package/lib/typescript/components/onboarding/OAuthWebView.d.ts.map +1 -1
- package/lib/typescript/config/api.d.ts +24 -0
- package/lib/typescript/config/api.d.ts.map +1 -0
- package/lib/typescript/context/AuthContext.d.ts +34 -0
- package/lib/typescript/context/AuthContext.d.ts.map +1 -0
- package/lib/typescript/hooks/useConnectedAccounts.d.ts +11 -0
- package/lib/typescript/hooks/useConnectedAccounts.d.ts.map +1 -0
- package/lib/typescript/hooks/useConnections.d.ts +10 -5
- package/lib/typescript/hooks/useConnections.d.ts.map +1 -1
- package/lib/typescript/hooks/useUserConnections.d.ts +12 -0
- package/lib/typescript/hooks/useUserConnections.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +24 -6
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/services/apiClient.d.ts +91 -0
- package/lib/typescript/services/apiClient.d.ts.map +1 -0
- package/lib/typescript/services/apiKeyService.d.ts.map +1 -1
- package/lib/typescript/services/authService.d.ts +216 -0
- package/lib/typescript/services/authService.d.ts.map +1 -0
- package/lib/typescript/services/biometricPinService.d.ts +29 -0
- package/lib/typescript/services/biometricPinService.d.ts.map +1 -0
- package/lib/typescript/services/connectedAccountsService.d.ts +56 -0
- package/lib/typescript/services/connectedAccountsService.d.ts.map +1 -0
- package/lib/typescript/services/googleAuthService.d.ts +63 -0
- package/lib/typescript/services/googleAuthService.d.ts.map +1 -0
- package/lib/typescript/services/imageCompressionService.d.ts +37 -0
- package/lib/typescript/services/imageCompressionService.d.ts.map +1 -0
- package/lib/typescript/services/jwtStorageService.d.ts +86 -0
- package/lib/typescript/services/jwtStorageService.d.ts.map +1 -0
- package/lib/typescript/services/mobileTrainingService.d.ts +45 -0
- package/lib/typescript/services/mobileTrainingService.d.ts.map +1 -0
- package/lib/typescript/services/pinEncryptionService.d.ts +17 -0
- package/lib/typescript/services/pinEncryptionService.d.ts.map +1 -0
- package/lib/typescript/services/pinStorageUtils.d.ts +25 -0
- package/lib/typescript/services/pinStorageUtils.d.ts.map +1 -0
- package/lib/typescript/services/platformAuthService.d.ts +34 -109
- package/lib/typescript/services/platformAuthService.d.ts.map +1 -1
- package/lib/typescript/services/storageService.d.ts +128 -0
- package/lib/typescript/services/storageService.d.ts.map +1 -0
- package/lib/typescript/services/trainingApiHelpers.d.ts +38 -0
- package/lib/typescript/services/trainingApiHelpers.d.ts.map +1 -0
- package/lib/typescript/services/userConnectionsService.d.ts +90 -0
- package/lib/typescript/services/userConnectionsService.d.ts.map +1 -0
- package/lib/typescript/services/youtubeMigrationService.d.ts +12 -0
- package/lib/typescript/services/youtubeMigrationService.d.ts.map +1 -0
- package/lib/typescript/theme/index.d.ts +416 -0
- package/lib/typescript/theme/index.d.ts.map +1 -0
- package/lib/typescript/types/index.d.ts +39 -0
- package/lib/typescript/types/index.d.ts.map +1 -1
- package/lib/typescript/utils/eventUtils.d.ts +108 -0
- package/lib/typescript/utils/eventUtils.d.ts.map +1 -0
- package/lib/typescript/utils/haptics.d.ts +11 -0
- package/lib/typescript/utils/haptics.d.ts.map +1 -0
- package/lib/typescript/utils/imagePreloader.d.ts +2 -0
- package/lib/typescript/utils/imagePreloader.d.ts.map +1 -0
- package/package.json +158 -145
- package/src/api/index.ts +41 -0
- 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 +3 -0
- package/src/assets/images/EnochE.svg +19 -0
- 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 +3 -0
- package/src/assets/images/Personalitytraits.svg +3 -0
- package/src/assets/images/Redditicon.png +0 -0
- package/src/assets/images/Userpreferences.svg +3 -0
- package/src/assets/images/YouTubeicon3.png +0 -0
- package/src/assets/images/arrow.svg +20 -0
- package/src/assets/images/basicproficon.svg +43 -0
- package/src/assets/images/basicprofile.svg +3 -0
- package/src/assets/images/checkmark.svg +4 -0
- package/src/assets/images/contentanalysis.svg +3 -0
- package/src/assets/images/contenticon.svg +23 -0
- 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 +18 -0
- package/src/assets/images/x-close.svg +3 -0
- package/src/components/BodyText.tsx +33 -0
- package/src/components/BrandMark.tsx +62 -0
- package/src/components/CodeInput.tsx +32 -0
- package/src/components/EmailInput.tsx +31 -0
- package/src/components/ExistingUserDataConfirmation.tsx +507 -0
- package/src/components/GoogleButton.tsx +55 -0
- package/src/components/HeadingGroup.tsx +49 -0
- package/src/components/ModalHeader.tsx +125 -0
- package/src/components/ModalSheet.tsx +57 -0
- package/src/components/Onairos.tsx +422 -424
- package/src/components/OnairosButton.tsx +339 -359
- package/src/components/OnairosSignInButton.tsx +166 -0
- package/src/components/Overlay.tsx +506 -506
- package/src/components/PersonaImage.tsx +79 -0
- package/src/components/PersonaLoadingScreen.tsx +201 -0
- package/src/components/PersonalizationConsentScreen.tsx +410 -0
- package/src/components/PinCreationScreen.tsx +492 -0
- package/src/components/PinInput.tsx +555 -343
- package/src/components/PlatformConnectorsStep.tsx +892 -0
- package/src/components/PlatformToggle.tsx +226 -0
- package/src/components/PrimaryButton.tsx +214 -0
- package/src/components/SignInMatchAnimation.tsx +225 -0
- package/src/components/SignInStep.tsx +217 -0
- package/src/components/TrainingModal.tsx +1047 -737
- package/src/components/UniversalOnboarding.tsx +2888 -1820
- package/src/components/VerificationStep.tsx +198 -0
- package/src/components/WelcomeScreen.tsx +473 -0
- package/src/components/icons/Basicproficon.tsx +30 -0
- package/src/components/icons/Basicprofile.tsx +17 -0
- package/src/components/icons/Checkbox.tsx +17 -0
- package/src/components/icons/Checkmark.tsx +24 -0
- package/src/components/icons/Contentanalysis.tsx +17 -0
- package/src/components/icons/Contenticon.tsx +30 -0
- package/src/components/icons/EnochE.tsx +39 -0
- package/src/components/icons/Personalityicon.tsx +22 -0
- package/src/components/icons/Personalityprofile.tsx +17 -0
- package/src/components/icons/Personalitytraits.tsx +17 -0
- package/src/components/icons/Userpreferences.tsx +17 -0
- package/src/components/icons/index.ts +12 -0
- package/src/components/onboarding/OAuthWebView.tsx +232 -838
- package/src/config/api.ts +25 -0
- package/src/context/AuthContext.tsx +393 -0
- package/src/hooks/useConnectedAccounts.ts +139 -0
- package/src/hooks/useConnections.ts +129 -131
- package/src/hooks/useUserConnections.ts +166 -0
- package/src/index.ts +94 -49
- package/src/services/apiClient.ts +337 -0
- package/src/services/apiKeyService.ts +9 -11
- package/src/services/authService.ts +1008 -0
- package/src/services/biometricPinService.ts +193 -0
- package/src/services/connectedAccountsService.ts +290 -0
- package/src/services/googleAuthService.ts +279 -0
- package/src/services/imageCompressionService.ts +303 -0
- package/src/services/jwtStorageService.ts +257 -0
- package/src/services/mobileTrainingService.ts +204 -0
- package/src/services/pinEncryptionService.ts +76 -0
- package/src/services/pinStorageUtils.ts +97 -0
- package/src/services/platformAuthService.ts +1346 -1113
- package/src/services/storageService.ts +452 -0
- package/src/services/trainingApiHelpers.ts +67 -0
- package/src/services/userConnectionsService.ts +557 -0
- package/src/services/youtubeMigrationService.ts +454 -0
- package/src/theme/index.ts +239 -0
- package/src/types/index.ts +265 -238
- package/src/utils/eventUtils.ts +303 -0
- package/src/utils/haptics.ts +59 -0
- package/src/utils/imagePreloader.ts +2 -0
- package/README.md +0 -375
- 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/UniversalOnboarding.tsx.new +0 -455
- 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/UniversalOnboarding.tsx.new +0 -455
- 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/UniversalOnboarding.tsx.new +0 -455
|
@@ -6,109 +6,211 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.TrainingModal = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
8
|
var _reactNative = require("react-native");
|
|
9
|
-
var _MaterialIcons = _interopRequireDefault(require("react-native-vector-icons/MaterialIcons"));
|
|
10
9
|
var _socket = require("socket.io-client");
|
|
11
|
-
var
|
|
10
|
+
var _authService = require("../services/authService");
|
|
11
|
+
var _reactNativeHapticFeedback = _interopRequireDefault(require("react-native-haptic-feedback"));
|
|
12
|
+
var _asyncStorage = _interopRequireDefault(require("@react-native-async-storage/async-storage"));
|
|
13
|
+
var _pinEncryptionService = require("../services/pinEncryptionService");
|
|
14
|
+
var _pinStorageUtils = require("../services/pinStorageUtils");
|
|
15
|
+
var _mobileTrainingService = require("../services/mobileTrainingService");
|
|
16
|
+
var _ExistingUserDataConfirmation = require("./ExistingUserDataConfirmation");
|
|
12
17
|
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
13
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
|
+
// import EmailVerification from '../../../components/EmailVerification'; // Commented out - file doesn't exist
|
|
20
|
+
// import { sendEmailVerificationCode } from '../../../services/api'; // Commented out - use local API instead
|
|
21
|
+
|
|
14
22
|
const {
|
|
15
23
|
width,
|
|
16
24
|
height
|
|
17
25
|
} = _reactNative.Dimensions.get('window');
|
|
18
26
|
const TrainingModal = ({
|
|
19
27
|
visible,
|
|
20
|
-
progress,
|
|
21
|
-
eta,
|
|
22
28
|
onCancel,
|
|
23
29
|
onComplete,
|
|
24
30
|
modelKey,
|
|
25
31
|
username,
|
|
26
|
-
|
|
32
|
+
isPrimaryAuth = false,
|
|
33
|
+
autoFocusEmailInput = false,
|
|
34
|
+
// Add default value
|
|
35
|
+
navigation
|
|
27
36
|
}) => {
|
|
28
|
-
|
|
29
|
-
const
|
|
37
|
+
const [progress, setProgress] = (0, _react.useState)(0);
|
|
38
|
+
const [email, setEmail] = (0, _react.useState)('');
|
|
39
|
+
const [emailError, setEmailError] = (0, _react.useState)('');
|
|
40
|
+
const [isTrainingComplete, setIsTrainingComplete] = (0, _react.useState)(false);
|
|
41
|
+
const [isSubmittingEmail, setIsSubmittingEmail] = (0, _react.useState)(false);
|
|
30
42
|
const [socketConnected, setSocketConnected] = (0, _react.useState)(false);
|
|
31
43
|
const [trainingStatus, setTrainingStatus] = (0, _react.useState)('Initializing...');
|
|
32
44
|
const [hasError, setHasError] = (0, _react.useState)(false);
|
|
33
|
-
const [errorCode, setErrorCode] = (0, _react.useState)(null);
|
|
34
|
-
const [isTrainingComplete, setIsTrainingComplete] = (0, _react.useState)(false);
|
|
35
45
|
const [userTraits, setUserTraits] = (0, _react.useState)(null);
|
|
36
46
|
const [inferenceResults, setInferenceResults] = (0, _react.useState)(null);
|
|
37
|
-
const
|
|
38
|
-
const
|
|
39
|
-
const [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
47
|
+
const socketRef = (0, _react.useRef)(null);
|
|
48
|
+
const emailInputRef = (0, _react.useRef)(null); // Add email input ref
|
|
49
|
+
const [userToken, setUserToken] = (0, _react.useState)(null);
|
|
50
|
+
const [userInfo, setUserInfo] = (0, _react.useState)(null);
|
|
51
|
+
const [matchStep, setMatchStep] = (0, _react.useState)('email');
|
|
52
|
+
const [matchCount, setMatchCount] = (0, _react.useState)(0);
|
|
53
|
+
const [isContinueLoading, setIsContinueLoading] = (0, _react.useState)(false);
|
|
54
|
+
const [existingUserAccountInfo, setExistingUserAccountInfo] = (0, _react.useState)(null);
|
|
55
|
+
|
|
56
|
+
// --- Modal slide animation ---
|
|
57
|
+
const modalTranslateY = (0, _react.useRef)(new _reactNative.Animated.Value(height)).current;
|
|
58
|
+
const animationDuration = 300; // Increased duration for smoother animation
|
|
59
|
+
|
|
60
|
+
// Reset state when modal becomes invisible
|
|
61
|
+
(0, _react.useEffect)(() => {
|
|
62
|
+
if (!visible) {
|
|
63
|
+
// Reset all state
|
|
64
|
+
setEmail('');
|
|
65
|
+
setEmailError('');
|
|
66
|
+
setIsSubmittingEmail(false);
|
|
67
|
+
setMatchStep('email');
|
|
68
|
+
setMatchCount(0);
|
|
69
|
+
setIsContinueLoading(false);
|
|
70
|
+
setProgress(0);
|
|
71
|
+
setIsTrainingComplete(false);
|
|
72
|
+
setHasError(false);
|
|
73
|
+
setTrainingStatus('Initializing...');
|
|
74
|
+
setUserTraits(null);
|
|
75
|
+
setInferenceResults(null);
|
|
76
|
+
setUserToken(null);
|
|
77
|
+
setUserInfo(null);
|
|
78
|
+
|
|
79
|
+
// Reset animation value
|
|
80
|
+
modalTranslateY.setValue(height);
|
|
81
|
+
}
|
|
82
|
+
}, [visible]);
|
|
83
|
+
|
|
84
|
+
// Handle animation
|
|
85
|
+
(0, _react.useEffect)(() => {
|
|
86
|
+
if (visible) {
|
|
87
|
+
// Ensure we start from the bottom
|
|
88
|
+
modalTranslateY.setValue(height);
|
|
89
|
+
// Animate up
|
|
90
|
+
_reactNative.Animated.spring(modalTranslateY, {
|
|
91
|
+
toValue: 0,
|
|
92
|
+
useNativeDriver: true,
|
|
93
|
+
damping: 20,
|
|
94
|
+
mass: 1,
|
|
95
|
+
stiffness: 200
|
|
96
|
+
}).start();
|
|
97
|
+
}
|
|
98
|
+
}, [visible]);
|
|
99
|
+
|
|
100
|
+
// Handle modal close
|
|
101
|
+
const handleModalClose = () => {
|
|
102
|
+
_reactNative.Animated.spring(modalTranslateY, {
|
|
103
|
+
toValue: height,
|
|
104
|
+
useNativeDriver: true,
|
|
105
|
+
damping: 20,
|
|
106
|
+
mass: 1,
|
|
107
|
+
stiffness: 200
|
|
108
|
+
}).start(() => {
|
|
109
|
+
onCancel();
|
|
110
|
+
});
|
|
52
111
|
};
|
|
53
112
|
|
|
54
|
-
//
|
|
113
|
+
// Get auth token and user info on mount
|
|
55
114
|
(0, _react.useEffect)(() => {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
115
|
+
const loadUserData = async () => {
|
|
116
|
+
try {
|
|
117
|
+
const token = await (0, _authService.getAuthToken)();
|
|
118
|
+
setUserToken(token);
|
|
119
|
+
if (token) {
|
|
120
|
+
// Use provided username instead of making API call to avoid 404 error
|
|
121
|
+
// The backend JWT contains username but /api/user/profile endpoint doesn't exist
|
|
122
|
+
const fallbackUsername = username || 'mobile_user';
|
|
123
|
+
console.log('🔍 Using provided username for training:', fallbackUsername);
|
|
124
|
+
setUserInfo({
|
|
125
|
+
username: fallbackUsername,
|
|
126
|
+
email: null,
|
|
127
|
+
id: null // Will be filled by backend during training
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
} catch (error) {
|
|
131
|
+
console.error('Error loading user data:', error);
|
|
132
|
+
// Fallback user info
|
|
133
|
+
setUserInfo({
|
|
134
|
+
username: username || 'mobile_user',
|
|
135
|
+
email: null,
|
|
136
|
+
id: null
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
};
|
|
140
|
+
if (visible) {
|
|
141
|
+
loadUserData();
|
|
142
|
+
}
|
|
143
|
+
}, [visible, username]);
|
|
60
144
|
|
|
61
|
-
// Start training
|
|
62
|
-
const
|
|
145
|
+
// Start Enoch training via API
|
|
146
|
+
const startEnochTraining = async socketId => {
|
|
63
147
|
try {
|
|
64
148
|
setTrainingStatus('Starting training...');
|
|
65
|
-
|
|
66
|
-
setHasError(false);
|
|
67
|
-
setErrorCode(null);
|
|
149
|
+
setProgress(10);
|
|
68
150
|
if (!userToken) {
|
|
69
151
|
throw new Error('No authentication token available');
|
|
70
152
|
}
|
|
153
|
+
console.log('🚀 Starting Enoch training with socketId:', socketId);
|
|
154
|
+
|
|
155
|
+
// Get stored Onairos username for API calls
|
|
156
|
+
const storedUsername = await (0, _authService.getOnairosUsername)();
|
|
157
|
+
const finalUsername = storedUsername || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.username) || (userInfo === null || userInfo === void 0 ? void 0 : userInfo.name) || username || 'mobile_user';
|
|
71
158
|
|
|
72
|
-
//
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
console.log('
|
|
159
|
+
// Get connected platforms information
|
|
160
|
+
const connectedPlatforms = await _asyncStorage.default.getItem('connectedPlatforms');
|
|
161
|
+
const platformsList = connectedPlatforms ? JSON.parse(connectedPlatforms) : [];
|
|
162
|
+
console.log('📱 Connected platforms for training:', platformsList);
|
|
76
163
|
|
|
77
|
-
//
|
|
164
|
+
// Get encrypted PIN for training (if available)
|
|
165
|
+
const encryptedPin = await (0, _pinEncryptionService.getEncryptedPinForAPI)().catch(error => {
|
|
166
|
+
console.warn('⚠️ Could not get encrypted PIN for training:', error);
|
|
167
|
+
return null;
|
|
168
|
+
});
|
|
169
|
+
|
|
170
|
+
// Prepare user data for training - match backend expected format
|
|
78
171
|
const trainingData = {
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
172
|
+
socketId,
|
|
173
|
+
username: finalUsername,
|
|
174
|
+
// This will be used as fallback in backend
|
|
175
|
+
email: (userInfo === null || userInfo === void 0 ? void 0 : userInfo.email) || null,
|
|
176
|
+
// Backend will use this if available
|
|
177
|
+
modelKey: modelKey || null,
|
|
178
|
+
connectedPlatforms: platformsList,
|
|
179
|
+
// Include connected platforms
|
|
180
|
+
// Include encrypted PIN if available
|
|
181
|
+
...(encryptedPin && {
|
|
182
|
+
encryptedPin: encryptedPin,
|
|
183
|
+
hasPinData: true
|
|
184
|
+
})
|
|
84
185
|
};
|
|
85
|
-
console.log('📤
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
},
|
|
94
|
-
body: JSON.stringify(trainingData)
|
|
95
|
-
});
|
|
96
|
-
const result = await response.json();
|
|
186
|
+
console.log('📤 Starting training with YouTube migration check:', trainingData);
|
|
187
|
+
console.log('🔑 Using stored username:', storedUsername);
|
|
188
|
+
console.log('🔑 Final username for training:', finalUsername);
|
|
189
|
+
console.log('🔗 Connected platforms:', platformsList);
|
|
190
|
+
console.log('🔐 PIN included in training:', !!encryptedPin);
|
|
191
|
+
|
|
192
|
+
// Use the new training function that includes YouTube migration check
|
|
193
|
+
const result = await (0, _mobileTrainingService.startEnochTrainingWithYouTubeCheck)(trainingData);
|
|
97
194
|
if (result.success) {
|
|
98
195
|
console.log('🚀 Training Started:', result.message);
|
|
99
|
-
|
|
100
|
-
setInternalProgress(20);
|
|
101
|
-
} else {
|
|
102
|
-
console.error('Training start failed:', result.error);
|
|
196
|
+
console.log('🎯 Training Features:', result.features);
|
|
103
197
|
|
|
104
|
-
//
|
|
105
|
-
if (result.
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
198
|
+
// Log the new features from the spec
|
|
199
|
+
if (result.features) {
|
|
200
|
+
console.log('✅ Inference enabled:', result.features.inference);
|
|
201
|
+
console.log('💾 Storage method:', result.features.storage);
|
|
202
|
+
console.log('🔒 Compression enabled:', result.features.compression);
|
|
203
|
+
console.log('🔐 Encryption enabled:', result.features.encryption);
|
|
204
|
+
console.log('📊 Training type:', result.features.type);
|
|
205
|
+
console.log('🗄️ Databases:', result.features.databases);
|
|
206
|
+
console.log('📈 Query scores enabled:', result.features.queryScores);
|
|
111
207
|
}
|
|
208
|
+
setTrainingStatus('Training model...');
|
|
209
|
+
setProgress(20);
|
|
210
|
+
} else {
|
|
211
|
+
console.error('Training start failed:', result.error);
|
|
212
|
+
setTrainingStatus(`Error: ${result.error}`);
|
|
213
|
+
setHasError(true);
|
|
112
214
|
}
|
|
113
215
|
} catch (error) {
|
|
114
216
|
console.error('Training start error:', error);
|
|
@@ -117,268 +219,93 @@ const TrainingModal = ({
|
|
|
117
219
|
}
|
|
118
220
|
};
|
|
119
221
|
|
|
120
|
-
// Handle training errors with specific error codes
|
|
121
|
-
const handleTrainingError = (code, message) => {
|
|
122
|
-
console.error(`Training Error [${code}]:`, message);
|
|
123
|
-
setHasError(true);
|
|
124
|
-
switch (code) {
|
|
125
|
-
case 'PIN_REQUIRED':
|
|
126
|
-
setTrainingStatus('PIN setup required');
|
|
127
|
-
_reactNative.Alert.alert('PIN Required', 'Please set up your PIN first before training.', [{
|
|
128
|
-
text: 'Cancel',
|
|
129
|
-
style: 'cancel'
|
|
130
|
-
}, {
|
|
131
|
-
text: 'Set PIN',
|
|
132
|
-
onPress: () => {
|
|
133
|
-
// TODO: Navigate to PIN setup
|
|
134
|
-
console.log('Navigate to PIN setup');
|
|
135
|
-
}
|
|
136
|
-
}]);
|
|
137
|
-
break;
|
|
138
|
-
case 'CONNECTIONS_REQUIRED':
|
|
139
|
-
setTrainingStatus('No connected accounts');
|
|
140
|
-
_reactNative.Alert.alert('Connections Required', 'Please connect at least one social media account before training.', [{
|
|
141
|
-
text: 'Cancel',
|
|
142
|
-
style: 'cancel'
|
|
143
|
-
}, {
|
|
144
|
-
text: 'Connect',
|
|
145
|
-
onPress: () => {
|
|
146
|
-
// TODO: Navigate to connections
|
|
147
|
-
console.log('Navigate to connections');
|
|
148
|
-
}
|
|
149
|
-
}]);
|
|
150
|
-
break;
|
|
151
|
-
case 'INSUFFICIENT_DATA':
|
|
152
|
-
setTrainingStatus('Insufficient data for training');
|
|
153
|
-
_reactNative.Alert.alert('Insufficient Data', 'We need more interaction data to train your model effectively. Please use your connected platforms more and try again.', [{
|
|
154
|
-
text: 'OK',
|
|
155
|
-
style: 'default'
|
|
156
|
-
}]);
|
|
157
|
-
break;
|
|
158
|
-
case 'ENCRYPTION_REQUIRED':
|
|
159
|
-
setTrainingStatus('Model encryption failed');
|
|
160
|
-
_reactNative.Alert.alert('Encryption Error', 'Failed to encrypt your model. Please try again.', [{
|
|
161
|
-
text: 'OK',
|
|
162
|
-
style: 'default'
|
|
163
|
-
}]);
|
|
164
|
-
break;
|
|
165
|
-
default:
|
|
166
|
-
setTrainingStatus(`Error: ${message}`);
|
|
167
|
-
_reactNative.Alert.alert('Training Error', message || 'An unexpected error occurred during training.', [{
|
|
168
|
-
text: 'OK',
|
|
169
|
-
style: 'default'
|
|
170
|
-
}]);
|
|
171
|
-
}
|
|
172
|
-
};
|
|
173
|
-
|
|
174
|
-
// Simulate training progress for test mode
|
|
175
|
-
const simulateTraining = () => {
|
|
176
|
-
var _phases$currentPhase;
|
|
177
|
-
console.log('🧪 Starting simulated training with new schema phases...');
|
|
178
|
-
setTrainingStatus('Validating Requirements');
|
|
179
|
-
setInternalProgress(5);
|
|
180
|
-
|
|
181
|
-
// Simulate all phases from the new schema
|
|
182
|
-
const phases = [{
|
|
183
|
-
progress: 10,
|
|
184
|
-
status: 'Validating Requirements',
|
|
185
|
-
delay: 1000
|
|
186
|
-
}, {
|
|
187
|
-
progress: 25,
|
|
188
|
-
status: 'Training Model',
|
|
189
|
-
delay: 2000
|
|
190
|
-
}, {
|
|
191
|
-
progress: 50,
|
|
192
|
-
status: 'Training Model',
|
|
193
|
-
delay: 2000
|
|
194
|
-
}, {
|
|
195
|
-
progress: 65,
|
|
196
|
-
status: 'Model Trained - Running Test Inference',
|
|
197
|
-
delay: 1500
|
|
198
|
-
}, {
|
|
199
|
-
progress: 80,
|
|
200
|
-
status: 'Encrypting and Compressing Model',
|
|
201
|
-
delay: 1000
|
|
202
|
-
}, {
|
|
203
|
-
progress: 95,
|
|
204
|
-
status: 'Uploading Encrypted Model to ARDrive',
|
|
205
|
-
delay: 1500
|
|
206
|
-
}, {
|
|
207
|
-
progress: 100,
|
|
208
|
-
status: 'Complete!',
|
|
209
|
-
delay: 500
|
|
210
|
-
}];
|
|
211
|
-
let currentPhase = 0;
|
|
212
|
-
const progressInterval = setInterval(() => {
|
|
213
|
-
if (currentPhase < phases.length) {
|
|
214
|
-
const phase = phases[currentPhase];
|
|
215
|
-
setInternalProgress(phase.progress);
|
|
216
|
-
setTrainingStatus(phase.status);
|
|
217
|
-
if (phase.progress === 100) {
|
|
218
|
-
setIsTrainingComplete(true);
|
|
219
|
-
clearInterval(progressInterval);
|
|
220
|
-
|
|
221
|
-
// Mock completion results
|
|
222
|
-
const mockResults = {
|
|
223
|
-
completed: true,
|
|
224
|
-
message: "Model trained, encrypted, and stored successfully",
|
|
225
|
-
storage: "ARDrive",
|
|
226
|
-
encryption: true,
|
|
227
|
-
inference: isEnochSDK,
|
|
228
|
-
// Only Enoch SDK runs inference
|
|
229
|
-
modelUrl: `https://arweave.net/mock_tx_${Date.now()}`
|
|
230
|
-
};
|
|
231
|
-
setTrainingResults(mockResults);
|
|
232
|
-
|
|
233
|
-
// Auto-complete after a short delay
|
|
234
|
-
setTimeout(() => {
|
|
235
|
-
onComplete && onComplete();
|
|
236
|
-
}, 1000);
|
|
237
|
-
}
|
|
238
|
-
currentPhase++;
|
|
239
|
-
}
|
|
240
|
-
}, ((_phases$currentPhase = phases[currentPhase]) === null || _phases$currentPhase === void 0 ? void 0 : _phases$currentPhase.delay) || 1000);
|
|
241
|
-
|
|
242
|
-
// Cleanup interval on unmount
|
|
243
|
-
return () => clearInterval(progressInterval);
|
|
244
|
-
};
|
|
245
|
-
|
|
246
222
|
// Setup socket connection and training
|
|
247
223
|
(0, _react.useEffect)(() => {
|
|
248
|
-
if (!visible || !userInfo) return;
|
|
224
|
+
if (!visible || !userToken || !userInfo) return;
|
|
249
225
|
console.log('Setting up socket connection for training...');
|
|
250
226
|
console.log('🧑💻 User info available:', userInfo);
|
|
251
|
-
console.log('🧪 Test mode:', test);
|
|
252
|
-
console.log('🔧 Using Enoch SDK:', isEnochSDK);
|
|
253
227
|
|
|
254
|
-
//
|
|
255
|
-
|
|
256
|
-
|
|
228
|
+
// Initialize socket connection
|
|
229
|
+
socketRef.current = (0, _socket.io)('https://api2.onairos.uk', {
|
|
230
|
+
transports: ['websocket'],
|
|
231
|
+
autoConnect: false
|
|
232
|
+
});
|
|
233
|
+
|
|
234
|
+
// Socket event listeners
|
|
235
|
+
socketRef.current.on('connect', () => {
|
|
236
|
+
var _socketRef$current;
|
|
237
|
+
console.log('✅ Socket connected for training');
|
|
257
238
|
setSocketConnected(true);
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
239
|
+
const socketId = (_socketRef$current = socketRef.current) === null || _socketRef$current === void 0 ? void 0 : _socketRef$current.id;
|
|
240
|
+
if (socketId) {
|
|
241
|
+
// ❌ DISABLED: This was causing training to start too early (when modal opens)
|
|
242
|
+
// Training should only start when transitioning from connectors to PIN screen
|
|
243
|
+
// startEnochTraining(socketId);
|
|
244
|
+
console.log('🔌 Socket ready, but training will start only when user transitions to PIN screen');
|
|
245
|
+
}
|
|
246
|
+
});
|
|
247
|
+
socketRef.current.on('disconnect', () => {
|
|
248
|
+
console.log('❌ Socket disconnected');
|
|
249
|
+
setSocketConnected(false);
|
|
250
|
+
});
|
|
251
|
+
socketRef.current.on('trainingCompleted', data => {
|
|
252
|
+
console.log('✅ Training Complete:', data);
|
|
253
|
+
setTrainingStatus('Running test inference...');
|
|
254
|
+
setProgress(60);
|
|
255
|
+
});
|
|
256
|
+
socketRef.current.on('inferenceCompleted', data => {
|
|
257
|
+
console.log('🧠 Inference Complete:', data);
|
|
258
|
+
setTrainingStatus('Uploading to S3...');
|
|
259
|
+
setProgress(80);
|
|
260
|
+
setUserTraits(data.traits);
|
|
261
|
+
setInferenceResults(data.inferenceResults);
|
|
262
|
+
});
|
|
263
|
+
socketRef.current.on('modelStandby', data => {
|
|
264
|
+
console.log('🎉 All Complete:', data);
|
|
261
265
|
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
266
|
+
// Log completion details based on new spec
|
|
267
|
+
if (data.completed) {
|
|
268
|
+
console.log('✅ Training completed:', data.message);
|
|
269
|
+
console.log('💾 Storage method:', data.storage);
|
|
270
|
+
console.log('🔐 Encryption enabled:', data.encryption);
|
|
271
|
+
console.log('🧠 Inference enabled:', data.inference);
|
|
265
272
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
autoConnect: false
|
|
270
|
-
});
|
|
271
|
-
|
|
272
|
-
// Socket event listeners for new schema
|
|
273
|
-
socketRef.current.on('connect', () => {
|
|
274
|
-
var _socketRef$current;
|
|
275
|
-
console.log('✅ Socket connected for training');
|
|
276
|
-
setSocketConnected(true);
|
|
277
|
-
const socketId = (_socketRef$current = socketRef.current) === null || _socketRef$current === void 0 ? void 0 : _socketRef$current.id;
|
|
278
|
-
if (socketId) {
|
|
279
|
-
startTraining(socketId);
|
|
273
|
+
// Log database info for Enoch mode
|
|
274
|
+
if (data.databases && Array.isArray(data.databases)) {
|
|
275
|
+
console.log('🗄️ Databases used:', data.databases.join(', '));
|
|
280
276
|
}
|
|
281
|
-
});
|
|
282
|
-
socketRef.current.on('disconnect', () => {
|
|
283
|
-
console.log('❌ Socket disconnected');
|
|
284
|
-
setSocketConnected(false);
|
|
285
|
-
});
|
|
286
|
-
socketRef.current.on('connect_error', error => {
|
|
287
|
-
console.error('❌ Socket connection error:', error);
|
|
288
|
-
setTrainingStatus('Connection failed');
|
|
289
|
-
setHasError(true);
|
|
290
|
-
});
|
|
291
277
|
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
if (data.error) {
|
|
296
|
-
if (data.code) {
|
|
297
|
-
setErrorCode(data.code);
|
|
298
|
-
handleTrainingError(data.code, data.error);
|
|
299
|
-
} else {
|
|
300
|
-
console.error('Training update error:', data.error);
|
|
301
|
-
setTrainingStatus(`Error: ${data.error}`);
|
|
302
|
-
setHasError(true);
|
|
303
|
-
}
|
|
304
|
-
} else {
|
|
305
|
-
// Handle different status phases
|
|
306
|
-
if (data.status) {
|
|
307
|
-
setTrainingStatus(data.status);
|
|
308
|
-
|
|
309
|
-
// Update progress based on phase
|
|
310
|
-
switch (data.status) {
|
|
311
|
-
case 'Validating Requirements':
|
|
312
|
-
setInternalProgress(10);
|
|
313
|
-
break;
|
|
314
|
-
case 'Training Model':
|
|
315
|
-
setInternalProgress(data.percent || 40);
|
|
316
|
-
break;
|
|
317
|
-
case 'Model Trained - Running Test Inference':
|
|
318
|
-
setInternalProgress(65);
|
|
319
|
-
break;
|
|
320
|
-
case 'Encrypting and Compressing Model':
|
|
321
|
-
setInternalProgress(80);
|
|
322
|
-
break;
|
|
323
|
-
case 'Uploading Encrypted Model to ARDrive':
|
|
324
|
-
setInternalProgress(90);
|
|
325
|
-
break;
|
|
326
|
-
default:
|
|
327
|
-
if (data.percent) {
|
|
328
|
-
setInternalProgress(data.percent);
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
if (data.progress) {
|
|
333
|
-
setInternalProgress(data.progress);
|
|
334
|
-
}
|
|
278
|
+
// Log testing mode
|
|
279
|
+
if (data.testing) {
|
|
280
|
+
console.log('🧪 Testing mode enabled');
|
|
335
281
|
}
|
|
336
|
-
}
|
|
282
|
+
}
|
|
283
|
+
setIsTrainingComplete(true);
|
|
284
|
+
setTrainingStatus('Complete!');
|
|
285
|
+
setProgress(100);
|
|
337
286
|
|
|
338
|
-
//
|
|
339
|
-
|
|
340
|
-
console.log('✅ Training Complete:', data);
|
|
341
|
-
if (data.completed && data.storage === 'ARDrive' && data.encryption === true) {
|
|
342
|
-
setTrainingStatus('Training completed successfully!');
|
|
343
|
-
setIsTrainingComplete(true);
|
|
344
|
-
setInternalProgress(100);
|
|
345
|
-
setTrainingResults(data);
|
|
346
|
-
|
|
347
|
-
// Display results
|
|
348
|
-
console.log('✅ Model URL:', data.modelUrl);
|
|
349
|
-
console.log('✅ Storage:', data.storage);
|
|
350
|
-
console.log('✅ Encrypted:', data.encryption);
|
|
351
|
-
console.log('✅ Inference:', data.inference);
|
|
352
|
-
|
|
353
|
-
// Auto-complete after a short delay
|
|
354
|
-
setTimeout(() => {
|
|
355
|
-
onComplete && onComplete();
|
|
356
|
-
}, 1500);
|
|
357
|
-
} else {
|
|
358
|
-
console.error('Training completion missing required fields:', data);
|
|
359
|
-
setTrainingStatus('Training completed with warnings');
|
|
360
|
-
setHasError(true);
|
|
361
|
-
}
|
|
362
|
-
});
|
|
287
|
+
// Clear temporary PIN after training is complete
|
|
288
|
+
(0, _pinStorageUtils.clearTemporaryPin)();
|
|
363
289
|
|
|
364
|
-
//
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
290
|
+
// Show continue button for primary auth when training is complete
|
|
291
|
+
if (isPrimaryAuth) {
|
|
292
|
+
setMatchStep('found');
|
|
293
|
+
setMatchCount(Math.floor(Math.random() * 10) + 5);
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
socketRef.current.on('trainingUpdate', data => {
|
|
297
|
+
if (data.error) {
|
|
298
|
+
console.error('Training update error:', data.error);
|
|
299
|
+
setTrainingStatus(`Error: ${data.error}`);
|
|
300
|
+
setHasError(true);
|
|
301
|
+
} else if (data.progress) {
|
|
302
|
+
setProgress(data.progress);
|
|
303
|
+
setTrainingStatus(data.status || 'Training in progress...');
|
|
304
|
+
}
|
|
305
|
+
});
|
|
374
306
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
} catch (socketError) {
|
|
378
|
-
console.error('🚨 Production mode: Socket connection failed:', socketError);
|
|
379
|
-
setTrainingStatus('Failed to connect to training service');
|
|
380
|
-
setHasError(true);
|
|
381
|
-
}
|
|
307
|
+
// Connect to socket
|
|
308
|
+
socketRef.current.connect();
|
|
382
309
|
|
|
383
310
|
// Cleanup function
|
|
384
311
|
return () => {
|
|
@@ -388,330 +315,648 @@ const TrainingModal = ({
|
|
|
388
315
|
socketRef.current = null;
|
|
389
316
|
}
|
|
390
317
|
};
|
|
391
|
-
}, [visible,
|
|
392
|
-
|
|
393
|
-
//
|
|
394
|
-
|
|
395
|
-
if (
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
318
|
+
}, [visible, userToken, userInfo]);
|
|
319
|
+
|
|
320
|
+
// When modal becomes visible and autoFocus is requested, focus the email input
|
|
321
|
+
(0, _react.useEffect)(() => {
|
|
322
|
+
if (visible && autoFocusEmailInput && matchStep === 'email' && emailInputRef.current) {
|
|
323
|
+
const timer = setTimeout(() => {
|
|
324
|
+
var _emailInputRef$curren;
|
|
325
|
+
(_emailInputRef$curren = emailInputRef.current) === null || _emailInputRef$curren === void 0 || _emailInputRef$curren.focus();
|
|
326
|
+
}, 150); // Small delay to sync with modal animation
|
|
327
|
+
return () => clearTimeout(timer);
|
|
328
|
+
} else if (!visible && emailInputRef.current) {
|
|
329
|
+
// Optional: Blur input when modal is not visible
|
|
330
|
+
// emailInputRef.current?.blur();
|
|
331
|
+
}
|
|
332
|
+
}, [visible, autoFocusEmailInput, matchStep]);
|
|
333
|
+
|
|
334
|
+
// Validate email format
|
|
335
|
+
const validateEmail = email => {
|
|
336
|
+
// Check for reviewer bypass first
|
|
337
|
+
if (email.toLowerCase().trim() === 'reviewer') {
|
|
338
|
+
return true; // Valid for reviewer bypass
|
|
339
|
+
}
|
|
340
|
+
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
341
|
+
return emailRegex.test(email);
|
|
342
|
+
};
|
|
343
|
+
const handleEmailSubmit = async () => {
|
|
344
|
+
// Check for reviewer bypass
|
|
345
|
+
if (email.toLowerCase().trim() === 'reviewer') {
|
|
346
|
+
console.log('🔍 Reviewer bypass detected');
|
|
347
|
+
setEmail('reviewer@bypass.com'); // Set a valid email for the flow
|
|
348
|
+
if (onComplete) {
|
|
349
|
+
onComplete('reviewer@bypass.com');
|
|
416
350
|
}
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
351
|
+
return;
|
|
352
|
+
}
|
|
353
|
+
|
|
354
|
+
// Regular email validation and submission
|
|
355
|
+
if (!validateEmail(email)) {
|
|
356
|
+
setEmailError('Please enter a valid email address');
|
|
357
|
+
return;
|
|
358
|
+
}
|
|
359
|
+
setIsSubmittingEmail(true);
|
|
360
|
+
setEmailError('');
|
|
361
|
+
try {
|
|
362
|
+
console.log('📧 Sending verification code to:', email);
|
|
363
|
+
|
|
364
|
+
// Send verification code using the new API
|
|
365
|
+
// const result = await sendEmailVerificationCode(email); // Function not available
|
|
366
|
+
const result = {
|
|
367
|
+
success: true,
|
|
368
|
+
message: 'Email verification not implemented'
|
|
369
|
+
};
|
|
370
|
+
if (result.success) {
|
|
371
|
+
console.log('✅ Verification code sent successfully');
|
|
372
|
+
setMatchStep('verification'); // Move to verification step
|
|
373
|
+
} else {
|
|
374
|
+
console.log('❌ Failed to send verification code:', result.message);
|
|
375
|
+
setEmailError(result.message || 'Failed to send verification code. Please try again.');
|
|
376
|
+
}
|
|
377
|
+
} catch (error) {
|
|
378
|
+
console.error('❌ Error sending verification code:', error);
|
|
379
|
+
setEmailError('Network error. Please check your connection and try again.');
|
|
380
|
+
} finally {
|
|
381
|
+
setIsSubmittingEmail(false);
|
|
382
|
+
}
|
|
383
|
+
};
|
|
384
|
+
const handleVerificationComplete = async (verifiedEmail, isVerified, accountInfo) => {
|
|
385
|
+
if (isVerified) {
|
|
386
|
+
console.log('✅ Email verification completed for:', verifiedEmail);
|
|
387
|
+
console.log('🔍 AccountInfo received:', accountInfo);
|
|
388
|
+
console.log('🔍 ExistingUser flag:', accountInfo === null || accountInfo === void 0 ? void 0 : accountInfo.existingUser);
|
|
389
|
+
|
|
390
|
+
// Check if this is an existing user - must have accountInfo AND explicitly marked as existing
|
|
391
|
+
if (accountInfo && accountInfo.existingUser === true) {
|
|
392
|
+
console.log('🔍 Existing user detected:', accountInfo);
|
|
393
|
+
|
|
394
|
+
// CRITICAL FIX: Ensure we have a valid JWT token before proceeding
|
|
395
|
+
if (accountInfo.token && typeof accountInfo.token === 'string' && accountInfo.token.length > 50) {
|
|
396
|
+
console.log('✅ Valid JWT token found for existing user');
|
|
397
|
+
|
|
398
|
+
// Store the token immediately for existing users
|
|
399
|
+
await _asyncStorage.default.setItem('onairos_jwt_token', accountInfo.token);
|
|
400
|
+
await _asyncStorage.default.setItem('enoch_token', accountInfo.token);
|
|
401
|
+
await _asyncStorage.default.setItem('auth_token', accountInfo.token);
|
|
402
|
+
await _asyncStorage.default.setItem('user_email', verifiedEmail);
|
|
403
|
+
await _asyncStorage.default.setItem('auth_method', 'onairos');
|
|
404
|
+
console.log('✅ Existing user tokens stored successfully');
|
|
405
|
+
|
|
406
|
+
// NEW: Show existing user confirmation modal instead of immediately completing
|
|
407
|
+
setExistingUserAccountInfo(accountInfo);
|
|
408
|
+
setMatchStep('existing_user');
|
|
409
|
+
return;
|
|
410
|
+
} else {
|
|
411
|
+
console.error('❌ No valid JWT token for existing user - token:', accountInfo.token);
|
|
412
|
+
console.error('❌ Cannot proceed without valid authentication token');
|
|
413
|
+
|
|
414
|
+
// Don't fall back to email - throw error instead
|
|
415
|
+
throw new Error('No valid authentication token received from server');
|
|
416
|
+
}
|
|
417
|
+
return;
|
|
418
|
+
}
|
|
419
|
+
console.log('🔍 New user detected - proceeding with account creation flow');
|
|
420
|
+
|
|
421
|
+
// New user - proceed with account creation and continue to platform connectors
|
|
422
|
+
try {
|
|
423
|
+
console.log('📧 Creating Onairos account for verified email:', verifiedEmail);
|
|
424
|
+
const username = verifiedEmail.split('@')[0];
|
|
425
|
+
const onairosSignupResponse = await fetch('https://api2.onairos.uk/register/enoch', {
|
|
426
|
+
method: 'POST',
|
|
427
|
+
headers: {
|
|
428
|
+
'Content-Type': 'application/json'
|
|
429
|
+
},
|
|
430
|
+
body: JSON.stringify({
|
|
431
|
+
email: verifiedEmail,
|
|
432
|
+
username: username,
|
|
433
|
+
name: username,
|
|
434
|
+
emailVerified: true // Mark as verified
|
|
435
|
+
})
|
|
436
|
+
});
|
|
437
|
+
const onairosResponseData = await onairosSignupResponse.json();
|
|
438
|
+
console.log('🔗 Onairos account creation response:', onairosResponseData);
|
|
439
|
+
if (onairosResponseData.token) {
|
|
440
|
+
// Store tokens
|
|
441
|
+
await _asyncStorage.default.setItem('onairos_jwt_token', onairosResponseData.token);
|
|
442
|
+
await _asyncStorage.default.setItem('auth_token', onairosResponseData.token);
|
|
443
|
+
await _asyncStorage.default.setItem('enoch_token', onairosResponseData.token);
|
|
444
|
+
await _asyncStorage.default.setItem('onairos_username', onairosResponseData.username);
|
|
445
|
+
await _asyncStorage.default.setItem('user_email', verifiedEmail);
|
|
446
|
+
console.log('✅ Account created and tokens stored');
|
|
447
|
+
console.log('🔗 Proceeding to UniversalOnboarding platform connectors');
|
|
448
|
+
|
|
449
|
+
// Close the TrainingModal and proceed to UniversalOnboarding platform connectors
|
|
450
|
+
if (onComplete) {
|
|
451
|
+
// This is the account creation path for new users
|
|
452
|
+
// Always proceed to platform connectors for new users, regardless of backend response
|
|
453
|
+
console.log('📧 TrainingModal: New user account created - proceeding to platform connectors:', verifiedEmail);
|
|
454
|
+
onComplete(verifiedEmail);
|
|
455
|
+
}
|
|
456
|
+
} else {
|
|
457
|
+
// No token returned, continue with email to platform connectors
|
|
458
|
+
console.log('🔗 No token returned, proceeding to platform connectors with email');
|
|
459
|
+
// CRITICAL FIX: Store email even when account creation fails
|
|
460
|
+
await _asyncStorage.default.setItem('user_email', verifiedEmail);
|
|
461
|
+
console.log('✅ Email stored despite no token for admin check compatibility');
|
|
462
|
+
if (onComplete) {
|
|
463
|
+
onComplete(verifiedEmail);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
} catch (error) {
|
|
467
|
+
console.error('❌ Error creating account after verification:', error);
|
|
468
|
+
// Continue anyway to platform connectors
|
|
469
|
+
console.log('🔗 Error occurred, but proceeding to platform connectors');
|
|
470
|
+
// CRITICAL FIX: Store email even when account creation throws an error
|
|
471
|
+
await _asyncStorage.default.setItem('user_email', verifiedEmail);
|
|
472
|
+
console.log('✅ Email stored despite error for admin check compatibility');
|
|
473
|
+
if (onComplete) {
|
|
474
|
+
onComplete(verifiedEmail);
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
const handleVerificationBack = () => {
|
|
480
|
+
setMatchStep('email');
|
|
481
|
+
setEmailError('');
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
// Handle existing user confirmation
|
|
485
|
+
const handleExistingUserConfirm = async () => {
|
|
486
|
+
console.log('✅ Existing user confirmed data sharing');
|
|
487
|
+
if (existingUserAccountInfo && existingUserAccountInfo.token) {
|
|
488
|
+
if (onComplete) {
|
|
489
|
+
onComplete(existingUserAccountInfo.token);
|
|
490
|
+
}
|
|
491
|
+
} else {
|
|
492
|
+
console.error('❌ No token available for existing user');
|
|
493
|
+
setEmailError('Authentication error. Please try again.');
|
|
494
|
+
setMatchStep('email');
|
|
495
|
+
}
|
|
496
|
+
};
|
|
497
|
+
const handleExistingUserCancel = () => {
|
|
498
|
+
console.log('❌ Existing user cancelled data sharing');
|
|
499
|
+
setMatchStep('email');
|
|
500
|
+
setExistingUserAccountInfo(null);
|
|
501
|
+
setEmailError('');
|
|
431
502
|
};
|
|
503
|
+
const handleExistingUserAddMoreData = () => {
|
|
504
|
+
console.log('🔗 Existing user wants to add more data');
|
|
505
|
+
|
|
506
|
+
// Store the existing user info for later use
|
|
507
|
+
if (existingUserAccountInfo && existingUserAccountInfo.token) {
|
|
508
|
+
_asyncStorage.default.setItem('existing_user_token', existingUserAccountInfo.token);
|
|
509
|
+
_asyncStorage.default.setItem('existing_user_info', JSON.stringify(existingUserAccountInfo));
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
// Continue to new user flow (UniversalOnboarding) but with existing user context
|
|
513
|
+
setMatchStep('email');
|
|
514
|
+
setExistingUserAccountInfo(null);
|
|
515
|
+
|
|
516
|
+
// Call onComplete with email to trigger UniversalOnboarding
|
|
517
|
+
if (onComplete) {
|
|
518
|
+
onComplete(email);
|
|
519
|
+
}
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
// Ensure cancel button always works
|
|
523
|
+
const handleCancelPress = () => {
|
|
524
|
+
// Clear temporary PIN when cancelling
|
|
525
|
+
(0, _pinStorageUtils.clearTemporaryPin)();
|
|
526
|
+
onCancel();
|
|
527
|
+
};
|
|
528
|
+
const handleContinue = () => {
|
|
529
|
+
// Trigger haptic feedback when button is pressed
|
|
530
|
+
_reactNativeHapticFeedback.default.trigger('impactMedium', {
|
|
531
|
+
enableVibrateFallback: true,
|
|
532
|
+
ignoreAndroidSystemSettings: false
|
|
533
|
+
});
|
|
534
|
+
console.log('handleContinue called. Current email state:', email);
|
|
535
|
+
console.log('Continue button pressed, completing onboarding with email:', email);
|
|
536
|
+
|
|
537
|
+
// Make sure we have a valid email
|
|
538
|
+
if (!validateEmail(email)) {
|
|
539
|
+
console.log('Email validation failed, cannot continue');
|
|
540
|
+
return;
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
// Show loading state
|
|
544
|
+
setIsContinueLoading(true);
|
|
545
|
+
|
|
546
|
+
// Call onComplete immediately to prevent splash screen flash
|
|
547
|
+
// The loading state will still be visible during the transition
|
|
548
|
+
if (onComplete) {
|
|
549
|
+
console.log('Calling onComplete with email:', email);
|
|
550
|
+
onComplete(email);
|
|
551
|
+
// Note: We don't reset isContinueLoading because the component will unmount
|
|
552
|
+
}
|
|
553
|
+
};
|
|
554
|
+
|
|
555
|
+
// Calculate user-friendly message based on progress
|
|
556
|
+
const getUserFriendlyMessage = () => {
|
|
557
|
+
if (hasError) return 'Something went wrong. Please try again.';
|
|
558
|
+
if (isTrainingComplete) return 'Your persona is ready! 🎉';
|
|
559
|
+
if (progress < 20) {
|
|
560
|
+
return 'Keeping your data private...';
|
|
561
|
+
} else if (progress < 40) {
|
|
562
|
+
return 'Trying to understand your mind...';
|
|
563
|
+
} else if (progress < 60) {
|
|
564
|
+
return 'You\'re more interesting than I expected...';
|
|
565
|
+
} else if (progress < 80) {
|
|
566
|
+
return 'Finalizing your unique persona...';
|
|
567
|
+
} else if (progress < 95) {
|
|
568
|
+
return 'Almost done...';
|
|
569
|
+
} else {
|
|
570
|
+
return 'Just a few more seconds...';
|
|
571
|
+
}
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
// Calculate remaining time estimate
|
|
575
|
+
const getTimeEstimate = () => {
|
|
576
|
+
if (hasError) return 'Please try again';
|
|
577
|
+
if (isTrainingComplete) return 'Complete!';
|
|
578
|
+
|
|
579
|
+
// Rough time estimates based on progress
|
|
580
|
+
const remainingProgress = 100 - progress;
|
|
581
|
+
const estimatedSeconds = Math.ceil(remainingProgress / 100 * 120); // Assume 2 minutes total
|
|
582
|
+
|
|
583
|
+
if (estimatedSeconds > 60) {
|
|
584
|
+
return `About ${Math.ceil(estimatedSeconds / 60)} minute${Math.ceil(estimatedSeconds / 60) > 1 ? 's' : ''} remaining`;
|
|
585
|
+
} else if (estimatedSeconds > 0) {
|
|
586
|
+
return `About ${estimatedSeconds} seconds remaining`;
|
|
587
|
+
} else {
|
|
588
|
+
return 'Almost there...';
|
|
589
|
+
}
|
|
590
|
+
};
|
|
591
|
+
|
|
592
|
+
// Grabber bar
|
|
593
|
+
const Grabber = () => /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
594
|
+
style: styles.grabberContainer
|
|
595
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
596
|
+
style: styles.grabberBar
|
|
597
|
+
}));
|
|
598
|
+
if (!visible) return null;
|
|
599
|
+
const progressPercentage = Math.min(Math.max(progress, 0), 100);
|
|
432
600
|
return /*#__PURE__*/_react.default.createElement(_reactNative.Modal, {
|
|
433
601
|
visible: visible,
|
|
434
602
|
transparent: true,
|
|
435
|
-
animationType: "none"
|
|
436
|
-
|
|
437
|
-
onRequestClose:
|
|
438
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableWithoutFeedback,
|
|
439
|
-
|
|
440
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableWithoutFeedback, null, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
441
|
-
style: styles.bottomSheet
|
|
442
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
443
|
-
style: styles.handleContainer
|
|
444
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
445
|
-
style: styles.handle
|
|
446
|
-
})), /*#__PURE__*/_react.default.createElement(_reactNative.SafeAreaView, {
|
|
447
|
-
style: styles.container
|
|
603
|
+
animationType: "none" // Changed to none since we're handling animation
|
|
604
|
+
,
|
|
605
|
+
onRequestClose: handleModalClose
|
|
606
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableWithoutFeedback, {
|
|
607
|
+
onPress: handleModalClose
|
|
448
608
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
449
|
-
style: styles.
|
|
450
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
}
|
|
455
|
-
|
|
456
|
-
},
|
|
457
|
-
style: styles.
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
style: [styles.progressFill, {
|
|
462
|
-
width: `${progressPercentage}%`
|
|
609
|
+
style: styles.modalOverlay
|
|
610
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.KeyboardAvoidingView, {
|
|
611
|
+
behavior: _reactNative.Platform.OS === "ios" ? "padding" : "height",
|
|
612
|
+
keyboardVerticalOffset: 0,
|
|
613
|
+
style: styles.keyboardAvoidingView
|
|
614
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableWithoutFeedback, {
|
|
615
|
+
onPress: e => e.stopPropagation()
|
|
616
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Animated.View, {
|
|
617
|
+
style: [styles.modalContent, {
|
|
618
|
+
transform: [{
|
|
619
|
+
translateY: modalTranslateY
|
|
620
|
+
}]
|
|
463
621
|
}]
|
|
464
|
-
})
|
|
465
|
-
style: styles.
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
622
|
+
}, /*#__PURE__*/_react.default.createElement(Grabber, null), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
623
|
+
style: styles.closeButton,
|
|
624
|
+
onPress: onCancel
|
|
625
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
626
|
+
style: styles.closeButtonText
|
|
627
|
+
}, "\u2715")), matchStep === 'email' && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
628
|
+
style: [styles.primaryAuthHeader, {
|
|
629
|
+
marginTop: 40
|
|
630
|
+
}]
|
|
631
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
632
|
+
style: styles.primaryAuthTitle
|
|
633
|
+
}, "Sign in with Onairos"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
634
|
+
style: styles.primaryAuthSubtitle
|
|
635
|
+
})), isPrimaryAuth && matchStep === 'email' && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
636
|
+
style: styles.emailSection
|
|
637
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
638
|
+
style: styles.emailLabel
|
|
639
|
+
}, "Enter your email to sign in / create an account"), /*#__PURE__*/_react.default.createElement(_reactNative.TextInput, {
|
|
640
|
+
ref: emailInputRef,
|
|
641
|
+
style: [styles.emailInput, emailError ? styles.emailInputError : null],
|
|
642
|
+
value: email,
|
|
643
|
+
onChangeText: text => {
|
|
644
|
+
setEmail(text);
|
|
645
|
+
if (emailError) setEmailError('');
|
|
646
|
+
},
|
|
647
|
+
placeholder: "your.email@example.com",
|
|
648
|
+
keyboardType: "email-address",
|
|
649
|
+
autoCapitalize: "none",
|
|
650
|
+
autoCorrect: false,
|
|
651
|
+
returnKeyType: "done",
|
|
652
|
+
onSubmitEditing: () => _reactNative.Keyboard.dismiss()
|
|
653
|
+
}), emailError ? /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
475
654
|
style: styles.errorText
|
|
476
|
-
},
|
|
477
|
-
style: styles.
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
}
|
|
487
|
-
style: styles.
|
|
488
|
-
}, /*#__PURE__*/_react.default.createElement(
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
style: styles.resultItem
|
|
504
|
-
}, /*#__PURE__*/_react.default.createElement(_MaterialIcons.default, {
|
|
505
|
-
name: "psychology",
|
|
506
|
-
size: 16,
|
|
507
|
-
color: "#666"
|
|
655
|
+
}, emailError) : null, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
656
|
+
style: [styles.continueButton, (isSubmittingEmail || !email.includes('@') && email.toLowerCase().trim() !== 'reviewer') && styles.disabledButton, {
|
|
657
|
+
marginTop: 24
|
|
658
|
+
}],
|
|
659
|
+
onPress: handleEmailSubmit,
|
|
660
|
+
disabled: isSubmittingEmail || !email.includes('@') && email.toLowerCase().trim() !== 'reviewer',
|
|
661
|
+
activeOpacity: 0.8
|
|
662
|
+
}, isSubmittingEmail ? /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
663
|
+
size: "small",
|
|
664
|
+
color: "#FFFFFF"
|
|
665
|
+
}) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
666
|
+
style: styles.continueButtonText
|
|
667
|
+
}, "Continue"))), isPrimaryAuth && matchStep === 'verification' && /*#__PURE__*/_react.default.createElement(_reactNative.View, null, /*#__PURE__*/_react.default.createElement(_reactNative.Text, null, "Email verification step (not implemented)")), isPrimaryAuth && matchStep === 'existing_user' && existingUserAccountInfo && /*#__PURE__*/_react.default.createElement(_ExistingUserDataConfirmation.ExistingUserDataConfirmation, {
|
|
668
|
+
visible: true,
|
|
669
|
+
onConfirm: handleExistingUserConfirm,
|
|
670
|
+
onCancel: handleExistingUserCancel,
|
|
671
|
+
onAddMoreData: handleExistingUserAddMoreData,
|
|
672
|
+
accountInfo: existingUserAccountInfo,
|
|
673
|
+
userEmail: email
|
|
674
|
+
}), isPrimaryAuth && matchStep === 'searching' && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
675
|
+
style: styles.matchContainer
|
|
676
|
+
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
677
|
+
style: styles.matchTitle
|
|
678
|
+
}), /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
679
|
+
size: "large",
|
|
680
|
+
color: "#E9C46A",
|
|
681
|
+
style: styles.matchLoader
|
|
508
682
|
}), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
509
|
-
style: styles.
|
|
510
|
-
}, "
|
|
511
|
-
style: styles.
|
|
512
|
-
}, /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
513
|
-
style: styles.cancelButton,
|
|
514
|
-
onPress: onCancel
|
|
683
|
+
style: styles.matchMessage
|
|
684
|
+
}, "Searching for potential connections based on your email...")), isPrimaryAuth && matchStep === 'found' && progress >= 100 && /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
685
|
+
style: styles.matchContainer
|
|
515
686
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
516
|
-
style: styles.
|
|
517
|
-
}, "
|
|
518
|
-
style: styles.
|
|
519
|
-
onPress: onComplete
|
|
687
|
+
style: styles.matchTitle
|
|
688
|
+
}, "Connections Found"), /*#__PURE__*/_react.default.createElement(_reactNative.View, {
|
|
689
|
+
style: styles.matchCircle
|
|
520
690
|
}, /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
521
|
-
style: styles.
|
|
522
|
-
},
|
|
691
|
+
style: styles.matchCount
|
|
692
|
+
}, matchCount)), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
693
|
+
style: styles.matchMessage
|
|
694
|
+
}, "We found ", matchCount, " potential connections for you!"), /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
695
|
+
style: styles.matchSubMessage
|
|
696
|
+
}, "Complete your profile to see your personalized matches"), /*#__PURE__*/_react.default.createElement(_reactNative.TouchableOpacity, {
|
|
697
|
+
style: [styles.continueButton, isContinueLoading && styles.disabledButton],
|
|
698
|
+
onPress: handleContinue,
|
|
699
|
+
disabled: isContinueLoading
|
|
700
|
+
}, isContinueLoading ? /*#__PURE__*/_react.default.createElement(_reactNative.ActivityIndicator, {
|
|
701
|
+
size: "small",
|
|
702
|
+
color: "#FFFFFF"
|
|
703
|
+
}) : /*#__PURE__*/_react.default.createElement(_reactNative.Text, {
|
|
704
|
+
style: styles.continueButtonText
|
|
705
|
+
}, "continue to setup")))))))));
|
|
523
706
|
};
|
|
524
707
|
exports.TrainingModal = TrainingModal;
|
|
525
708
|
const styles = _reactNative.StyleSheet.create({
|
|
526
|
-
|
|
709
|
+
container: {
|
|
527
710
|
flex: 1,
|
|
528
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
529
|
-
justifyContent: 'flex-end',
|
|
530
|
-
alignItems: 'center'
|
|
531
|
-
},
|
|
532
|
-
bottomSheet: {
|
|
533
711
|
backgroundColor: '#fff',
|
|
534
|
-
|
|
535
|
-
height: height * 0.8,
|
|
536
|
-
borderTopLeftRadius: 24,
|
|
537
|
-
borderTopRightRadius: 24,
|
|
538
|
-
overflow: 'hidden'
|
|
539
|
-
},
|
|
540
|
-
handleContainer: {
|
|
541
|
-
width: '100%',
|
|
542
|
-
alignItems: 'center',
|
|
543
|
-
paddingTop: 12,
|
|
544
|
-
paddingBottom: 8
|
|
712
|
+
padding: 24
|
|
545
713
|
},
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
714
|
+
scrollContentContainer: {
|
|
715
|
+
flexGrow: 1,
|
|
716
|
+
justifyContent: 'flex-start',
|
|
717
|
+
paddingBottom: 0,
|
|
718
|
+
marginBottom: 0
|
|
551
719
|
},
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
720
|
+
actualContentWrapper: {
|
|
721
|
+
width: '100%',
|
|
722
|
+
alignItems: 'center' // Center content like headers if they are not full width
|
|
555
723
|
},
|
|
556
724
|
content: {
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
alignItems: 'center',
|
|
560
|
-
justifyContent: 'center',
|
|
561
|
-
padding: 24
|
|
725
|
+
// This style might be unused or redefined if still needed for specific children
|
|
726
|
+
// flex: 1, // Original content style, likely not needed for the wrapper anymore
|
|
562
727
|
},
|
|
563
728
|
title: {
|
|
564
729
|
fontSize: 24,
|
|
565
730
|
fontWeight: '600',
|
|
566
|
-
|
|
567
|
-
marginBottom:
|
|
568
|
-
color: _constants.COLORS.text.primary,
|
|
731
|
+
color: '#333',
|
|
732
|
+
marginBottom: 24,
|
|
569
733
|
textAlign: 'center'
|
|
570
734
|
},
|
|
571
735
|
subtitle: {
|
|
572
736
|
fontSize: 16,
|
|
573
|
-
color:
|
|
574
|
-
|
|
575
|
-
marginBottom: 32
|
|
576
|
-
},
|
|
577
|
-
statusText: {
|
|
578
|
-
fontSize: 14,
|
|
579
|
-
color: _constants.COLORS.text.secondary,
|
|
580
|
-
marginBottom: 24,
|
|
737
|
+
color: '#666',
|
|
738
|
+
marginBottom: 32,
|
|
581
739
|
textAlign: 'center'
|
|
582
740
|
},
|
|
583
741
|
progressContainer: {
|
|
584
|
-
|
|
585
|
-
marginBottom: 16
|
|
742
|
+
marginBottom: 24
|
|
586
743
|
},
|
|
587
744
|
progressBar: {
|
|
588
745
|
height: 8,
|
|
589
|
-
backgroundColor:
|
|
746
|
+
backgroundColor: '#F5F5F5',
|
|
590
747
|
borderRadius: 4,
|
|
591
|
-
overflow: 'hidden'
|
|
748
|
+
overflow: 'hidden',
|
|
749
|
+
marginBottom: 8
|
|
592
750
|
},
|
|
593
751
|
progressFill: {
|
|
594
752
|
height: '100%',
|
|
595
|
-
backgroundColor:
|
|
753
|
+
backgroundColor: '#1BA9D4',
|
|
596
754
|
borderRadius: 4
|
|
597
755
|
},
|
|
598
756
|
progressText: {
|
|
599
757
|
fontSize: 14,
|
|
600
|
-
color:
|
|
601
|
-
textAlign: '
|
|
602
|
-
marginTop: 8
|
|
603
|
-
},
|
|
604
|
-
etaText: {
|
|
605
|
-
fontSize: 14,
|
|
606
|
-
color: _constants.COLORS.text.secondary,
|
|
607
|
-
marginBottom: 24
|
|
758
|
+
color: '#666',
|
|
759
|
+
textAlign: 'right'
|
|
608
760
|
},
|
|
609
|
-
|
|
761
|
+
infoContainer: {
|
|
610
762
|
flexDirection: 'row',
|
|
611
763
|
alignItems: 'center',
|
|
612
764
|
marginBottom: 32
|
|
613
765
|
},
|
|
614
|
-
|
|
766
|
+
etaText: {
|
|
615
767
|
fontSize: 14,
|
|
616
|
-
color:
|
|
617
|
-
marginLeft: 8
|
|
768
|
+
color: '#666',
|
|
769
|
+
marginLeft: 8,
|
|
770
|
+
textAlign: 'center',
|
|
771
|
+
marginBottom: 16
|
|
618
772
|
},
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
width: '100%',
|
|
624
|
-
borderTopWidth: 1,
|
|
625
|
-
borderTopColor: '#eee',
|
|
626
|
-
paddingTop: 16,
|
|
627
|
-
paddingHorizontal: 24,
|
|
628
|
-
paddingBottom: 24
|
|
773
|
+
detailText: {
|
|
774
|
+
fontSize: 14,
|
|
775
|
+
color: '#666',
|
|
776
|
+
lineHeight: 20
|
|
629
777
|
},
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
778
|
+
emailSection: {
|
|
779
|
+
marginTop: 24,
|
|
780
|
+
marginBottom: 16,
|
|
781
|
+
width: '100%'
|
|
633
782
|
},
|
|
634
|
-
|
|
783
|
+
emailSectionPrimary: {
|
|
784
|
+
marginTop: 40,
|
|
785
|
+
marginBottom: 40
|
|
786
|
+
},
|
|
787
|
+
emailLabel: {
|
|
635
788
|
fontSize: 16,
|
|
636
|
-
|
|
789
|
+
fontWeight: '500',
|
|
790
|
+
color: '#333',
|
|
791
|
+
marginBottom: 12,
|
|
792
|
+
textAlign: 'center'
|
|
637
793
|
},
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
paddingHorizontal: 32,
|
|
641
|
-
borderRadius: 16,
|
|
642
|
-
backgroundColor: '#fff',
|
|
794
|
+
emailInput: {
|
|
795
|
+
height: 48,
|
|
643
796
|
borderWidth: 1,
|
|
644
|
-
borderColor: '#
|
|
645
|
-
|
|
646
|
-
|
|
797
|
+
borderColor: '#E0E0E0',
|
|
798
|
+
borderRadius: 8,
|
|
799
|
+
paddingHorizontal: 16,
|
|
647
800
|
fontSize: 16,
|
|
648
|
-
|
|
649
|
-
color: '#000'
|
|
801
|
+
marginBottom: 8
|
|
650
802
|
},
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
height: 48
|
|
803
|
+
emailInputError: {
|
|
804
|
+
borderColor: '#FF3B30'
|
|
654
805
|
},
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
806
|
+
errorText: {
|
|
807
|
+
color: '#FF3B30',
|
|
808
|
+
fontSize: 14,
|
|
658
809
|
marginBottom: 16
|
|
659
810
|
},
|
|
660
|
-
|
|
811
|
+
footer: {
|
|
812
|
+
flexDirection: 'row',
|
|
813
|
+
justifyContent: 'space-between',
|
|
814
|
+
marginTop: 24,
|
|
815
|
+
paddingTop: 16
|
|
816
|
+
},
|
|
817
|
+
completeButton: {
|
|
818
|
+
paddingVertical: 12,
|
|
819
|
+
paddingHorizontal: 24,
|
|
820
|
+
backgroundColor: '#1BA9D4',
|
|
821
|
+
borderRadius: 8
|
|
822
|
+
},
|
|
823
|
+
disabledButton: {
|
|
824
|
+
backgroundColor: '#CCCCCC',
|
|
825
|
+
opacity: 0.7
|
|
826
|
+
},
|
|
827
|
+
completeButtonText: {
|
|
828
|
+
color: '#fff',
|
|
829
|
+
fontSize: 16,
|
|
830
|
+
fontWeight: '600'
|
|
831
|
+
},
|
|
832
|
+
statusText: {
|
|
661
833
|
fontSize: 14,
|
|
662
|
-
color: '#
|
|
834
|
+
color: '#666',
|
|
663
835
|
marginLeft: 8
|
|
664
836
|
},
|
|
665
|
-
|
|
837
|
+
progressError: {
|
|
838
|
+
backgroundColor: '#FF3B30'
|
|
839
|
+
},
|
|
840
|
+
primaryAuthHeader: {
|
|
666
841
|
alignItems: 'center',
|
|
667
842
|
marginBottom: 24,
|
|
668
|
-
|
|
669
|
-
backgroundColor: '#FFF5F5',
|
|
670
|
-
borderRadius: 12,
|
|
671
|
-
borderWidth: 1,
|
|
672
|
-
borderColor: '#FFEBEE'
|
|
843
|
+
paddingHorizontal: 16
|
|
673
844
|
},
|
|
674
|
-
|
|
845
|
+
primaryAuthTitle: {
|
|
846
|
+
fontSize: 24,
|
|
847
|
+
fontWeight: '600',
|
|
848
|
+
color: '#333',
|
|
849
|
+
marginBottom: 8,
|
|
850
|
+
textAlign: 'center'
|
|
851
|
+
},
|
|
852
|
+
primaryAuthSubtitle: {
|
|
675
853
|
fontSize: 16,
|
|
854
|
+
color: '#555',
|
|
855
|
+
textAlign: 'center',
|
|
856
|
+
marginBottom: 16
|
|
857
|
+
},
|
|
858
|
+
matchContainer: {
|
|
859
|
+
alignItems: 'center',
|
|
860
|
+
padding: 20
|
|
861
|
+
},
|
|
862
|
+
matchTitle: {
|
|
863
|
+
fontSize: 24,
|
|
676
864
|
fontWeight: '600',
|
|
677
|
-
color: '#
|
|
678
|
-
|
|
679
|
-
|
|
865
|
+
color: '#333',
|
|
866
|
+
marginBottom: 16,
|
|
867
|
+
textAlign: 'center'
|
|
868
|
+
},
|
|
869
|
+
matchLoader: {
|
|
870
|
+
marginVertical: 20
|
|
871
|
+
},
|
|
872
|
+
matchMessage: {
|
|
873
|
+
fontSize: 16,
|
|
874
|
+
color: '#555',
|
|
875
|
+
textAlign: 'center',
|
|
876
|
+
marginVertical: 12
|
|
680
877
|
},
|
|
681
|
-
|
|
878
|
+
matchSubMessage: {
|
|
682
879
|
fontSize: 14,
|
|
683
|
-
color: '#
|
|
684
|
-
textAlign: 'center'
|
|
880
|
+
color: '#777',
|
|
881
|
+
textAlign: 'center',
|
|
882
|
+
marginTop: 8
|
|
685
883
|
},
|
|
686
|
-
|
|
884
|
+
matchCircle: {
|
|
885
|
+
width: 80,
|
|
886
|
+
height: 80,
|
|
887
|
+
borderRadius: 40,
|
|
888
|
+
backgroundColor: '#E9C46A',
|
|
889
|
+
justifyContent: 'center',
|
|
687
890
|
alignItems: 'center',
|
|
688
|
-
|
|
689
|
-
padding: 16,
|
|
690
|
-
backgroundColor: '#F5F5F5',
|
|
691
|
-
borderRadius: 12,
|
|
692
|
-
borderWidth: 1,
|
|
693
|
-
borderColor: '#E0E0E0'
|
|
891
|
+
marginVertical: 16
|
|
694
892
|
},
|
|
695
|
-
|
|
696
|
-
fontSize:
|
|
893
|
+
matchCount: {
|
|
894
|
+
fontSize: 32,
|
|
895
|
+
fontWeight: 'bold',
|
|
896
|
+
color: '#FFFFFF'
|
|
897
|
+
},
|
|
898
|
+
continueButton: {
|
|
899
|
+
marginTop: 40,
|
|
900
|
+
width: '85%',
|
|
901
|
+
height: 50,
|
|
902
|
+
backgroundColor: '#000000',
|
|
903
|
+
borderRadius: 8,
|
|
904
|
+
justifyContent: 'center',
|
|
905
|
+
alignItems: 'center',
|
|
906
|
+
alignSelf: 'center'
|
|
907
|
+
},
|
|
908
|
+
continueButtonText: {
|
|
909
|
+
color: '#FFFFFF',
|
|
910
|
+
fontSize: 18,
|
|
697
911
|
fontWeight: '600',
|
|
698
|
-
|
|
699
|
-
marginTop: 8,
|
|
700
|
-
marginBottom: 12
|
|
912
|
+
textAlign: 'center'
|
|
701
913
|
},
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
914
|
+
modalOverlay: {
|
|
915
|
+
flex: 1,
|
|
916
|
+
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
917
|
+
justifyContent: 'flex-end'
|
|
705
918
|
},
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
919
|
+
keyboardAvoidingView: {
|
|
920
|
+
flex: 1,
|
|
921
|
+
justifyContent: 'flex-end',
|
|
922
|
+
alignItems: 'stretch',
|
|
923
|
+
margin: 0,
|
|
924
|
+
padding: 0
|
|
710
925
|
},
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
926
|
+
modalContent: {
|
|
927
|
+
backgroundColor: '#fff',
|
|
928
|
+
borderTopLeftRadius: 20,
|
|
929
|
+
borderTopRightRadius: 20,
|
|
930
|
+
padding: 24,
|
|
931
|
+
paddingTop: 12,
|
|
932
|
+
minHeight: height * 0.4,
|
|
933
|
+
maxHeight: height * 0.9
|
|
934
|
+
},
|
|
935
|
+
closeButton: {
|
|
936
|
+
position: 'absolute',
|
|
937
|
+
top: 15,
|
|
938
|
+
// Adjust as needed for visual balance with grabber and padding
|
|
939
|
+
right: 20,
|
|
940
|
+
// Adjust as needed
|
|
941
|
+
padding: 5,
|
|
942
|
+
// Make it easier to tap
|
|
943
|
+
zIndex: 10 // Ensure it's above other content
|
|
944
|
+
},
|
|
945
|
+
closeButtonText: {
|
|
946
|
+
fontSize: 24,
|
|
947
|
+
// Make it a bit larger
|
|
948
|
+
color: '#888',
|
|
949
|
+
// Subtle color
|
|
950
|
+
fontWeight: '300'
|
|
951
|
+
},
|
|
952
|
+
grabberContainer: {
|
|
953
|
+
alignItems: 'center'
|
|
954
|
+
},
|
|
955
|
+
grabberBar: {
|
|
956
|
+
width: 48,
|
|
957
|
+
height: 5,
|
|
958
|
+
borderRadius: 3,
|
|
959
|
+
backgroundColor: '#E0E0E0'
|
|
715
960
|
}
|
|
716
961
|
});
|
|
717
962
|
//# sourceMappingURL=TrainingModal.js.map
|