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