@onairos/react-native 3.1.18 → 3.2.1

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