@onairos/react-native 3.1.12 → 3.1.14

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