@onairos/react-native 3.7.1 → 3.7.3

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 (241) hide show
  1. package/lib/commonjs/api/index.js +219 -9
  2. package/lib/commonjs/assets/icons/spotify.png +0 -0
  3. package/lib/commonjs/assets/images/spotify.png +0 -0
  4. package/lib/commonjs/components/BodyText.js +27 -9
  5. package/lib/commonjs/components/BrandMark.js +111 -10
  6. package/lib/commonjs/components/CodeInput.js +116 -9
  7. package/lib/commonjs/components/EmailInput.js +30 -8
  8. package/lib/commonjs/components/GoogleButton.js +56 -9
  9. package/lib/commonjs/components/HeadingGroup.js +43 -9
  10. package/lib/commonjs/components/LLMDataInputModal.js +664 -14
  11. package/lib/commonjs/components/ModalHeader.js +99 -9
  12. package/lib/commonjs/components/ModalSheet.js +47 -9
  13. package/lib/commonjs/components/Onairos.js +380 -14
  14. package/lib/commonjs/components/OnairosButton.js +313 -13
  15. package/lib/commonjs/components/OnairosSignInButton.js +130 -12
  16. package/lib/commonjs/components/Overlay.js +465 -13
  17. package/lib/commonjs/components/PersonaImage.js +137 -10
  18. package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
  19. package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
  20. package/lib/commonjs/components/PinCreationScreen.js +403 -12
  21. package/lib/commonjs/components/PinInput.js +464 -9
  22. package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
  23. package/lib/commonjs/components/PlatformList.js +137 -10
  24. package/lib/commonjs/components/PlatformToggle.js +180 -9
  25. package/lib/commonjs/components/PrimaryButton.js +180 -10
  26. package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
  27. package/lib/commonjs/components/SignInStep.js +345 -12
  28. package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
  29. package/lib/commonjs/components/VerificationStep.js +176 -11
  30. package/lib/commonjs/components/WelcomeScreen.js +461 -22
  31. package/lib/commonjs/components/icons/Basicproficon.js +37 -8
  32. package/lib/commonjs/components/icons/Basicprofile.js +21 -8
  33. package/lib/commonjs/components/icons/Checkbox.js +21 -8
  34. package/lib/commonjs/components/icons/Checkmark.js +27 -8
  35. package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
  36. package/lib/commonjs/components/icons/Contenticon.js +39 -8
  37. package/lib/commonjs/components/icons/EnochE.js +41 -8
  38. package/lib/commonjs/components/icons/Personalityicon.js +30 -8
  39. package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
  40. package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
  41. package/lib/commonjs/components/icons/Userpreferences.js +21 -8
  42. package/lib/commonjs/components/icons/index.js +84 -17
  43. package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
  44. package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
  45. package/lib/commonjs/components/onboarding/PinInput.js +283 -10
  46. package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
  47. package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
  48. package/lib/commonjs/config/api.js +56 -7
  49. package/lib/commonjs/constants/index.js +120 -7
  50. package/lib/commonjs/context/AuthContext.js +345 -10
  51. package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
  52. package/lib/commonjs/hooks/useConnections.js +102 -8
  53. package/lib/commonjs/hooks/useCredentials.js +178 -10
  54. package/lib/commonjs/hooks/useUserConnections.js +148 -10
  55. package/lib/commonjs/index.js +439 -34
  56. package/lib/commonjs/services/apiClient.js +298 -8
  57. package/lib/commonjs/services/biometricPinService.js +180 -8
  58. package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
  59. package/lib/commonjs/services/chatGPTConversationService.js +275 -9
  60. package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
  61. package/lib/commonjs/services/claudeConversationService.js +158 -9
  62. package/lib/commonjs/services/connectedAccountsService.js +310 -10
  63. package/lib/commonjs/services/googleAuthService.js +252 -11
  64. package/lib/commonjs/services/hingeDataExtractor.js +105 -8
  65. package/lib/commonjs/services/hingeDataService.js +150 -9
  66. package/lib/commonjs/services/imageCompressionService.js +260 -7
  67. package/lib/commonjs/services/instagramDataExtractor.js +126 -8
  68. package/lib/commonjs/services/instagramDataService.js +163 -9
  69. package/lib/commonjs/services/jwtStorageService.js +276 -7
  70. package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
  71. package/lib/commonjs/services/linkedinProfileService.js +222 -9
  72. package/lib/commonjs/services/linkedinScrapingService.js +230 -8
  73. package/lib/commonjs/services/llmDataStorage.js +294 -8
  74. package/lib/commonjs/services/mobileTrainingService.js +186 -8
  75. package/lib/commonjs/services/netflixDataExtractor.js +120 -8
  76. package/lib/commonjs/services/netflixDataService.js +198 -9
  77. package/lib/commonjs/services/pinEncryptionService.js +84 -8
  78. package/lib/commonjs/services/pinStorageUtils.js +105 -7
  79. package/lib/commonjs/services/platformAuthService.js +1484 -12
  80. package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
  81. package/lib/commonjs/services/sephoraDataService.js +200 -9
  82. package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
  83. package/lib/commonjs/services/spotifyDataService.js +241 -9
  84. package/lib/commonjs/services/storageService.js +404 -8
  85. package/lib/commonjs/services/telegramDataExtractor.js +115 -8
  86. package/lib/commonjs/services/telegramDataService.js +499 -9
  87. package/lib/commonjs/services/trainingApiHelpers.js +73 -7
  88. package/lib/commonjs/services/userConnectionsService.js +340 -10
  89. package/lib/commonjs/services/youtubeMigrationService.js +416 -10
  90. package/lib/commonjs/theme/index.js +250 -7
  91. package/lib/commonjs/types/ambient.d.js +2 -1
  92. package/lib/commonjs/types/declarations.d.js +2 -1
  93. package/lib/commonjs/types/index.js +6 -1
  94. package/lib/commonjs/types/node-fix.d.js +2 -1
  95. package/lib/commonjs/types/node-override.d.js +2 -1
  96. package/lib/commonjs/types/opacity.d.js +2 -1
  97. package/lib/commonjs/types.js +14 -1
  98. package/lib/commonjs/utils/Portal.js +98 -8
  99. package/lib/commonjs/utils/api.js +130 -9
  100. package/lib/commonjs/utils/assetRegistry.js +210 -35
  101. package/lib/commonjs/utils/auth.js +112 -9
  102. package/lib/commonjs/utils/connectorTests.js +613 -29
  103. package/lib/commonjs/utils/crypto.js +62 -8
  104. package/lib/commonjs/utils/debugHelper.js +64 -1
  105. package/lib/commonjs/utils/encryption.js +76 -7
  106. package/lib/commonjs/utils/eventUtils.js +288 -1
  107. package/lib/commonjs/utils/haptics.js +66 -9
  108. package/lib/commonjs/utils/imagePreloader.js +6 -1
  109. package/lib/commonjs/utils/networkDiagnostics.js +226 -8
  110. package/lib/commonjs/utils/onairosApi.js +350 -9
  111. package/lib/commonjs/utils/programmaticFlow.js +117 -9
  112. package/lib/commonjs/utils/retryHelper.js +220 -1
  113. package/lib/commonjs/utils/secureStorage.js +349 -10
  114. package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
  115. package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
  116. package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
  117. package/lib/commonjs/utils/webviewScripts/index.js +698 -15
  118. package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
  119. package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
  120. package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
  121. package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
  122. package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
  123. package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
  124. package/lib/module/api/index.js +211 -1
  125. package/lib/module/assets/icons/spotify.png +0 -0
  126. package/lib/module/assets/images/spotify.png +0 -0
  127. package/lib/module/components/BodyText.js +20 -1
  128. package/lib/module/components/BrandMark.js +104 -1
  129. package/lib/module/components/CodeInput.js +109 -1
  130. package/lib/module/components/EmailInput.js +23 -1
  131. package/lib/module/components/GoogleButton.js +49 -1
  132. package/lib/module/components/HeadingGroup.js +36 -1
  133. package/lib/module/components/LLMDataInputModal.js +656 -7
  134. package/lib/module/components/ModalHeader.js +92 -1
  135. package/lib/module/components/ModalSheet.js +39 -1
  136. package/lib/module/components/Onairos.js +373 -1
  137. package/lib/module/components/OnairosButton.js +305 -1
  138. package/lib/module/components/OnairosSignInButton.js +121 -1
  139. package/lib/module/components/Overlay.js +456 -1
  140. package/lib/module/components/PersonaImage.js +129 -1
  141. package/lib/module/components/PersonaLoadingScreen.js +310 -1
  142. package/lib/module/components/PersonalizationConsentScreen.js +460 -1
  143. package/lib/module/components/PinCreationScreen.js +396 -1
  144. package/lib/module/components/PinInput.js +456 -1
  145. package/lib/module/components/PlatformConnectorsStep.js +1302 -6
  146. package/lib/module/components/PlatformList.js +129 -1
  147. package/lib/module/components/PlatformToggle.js +173 -1
  148. package/lib/module/components/PrimaryButton.js +172 -1
  149. package/lib/module/components/SignInMatchAnimation.js +189 -1
  150. package/lib/module/components/SignInStep.js +338 -1
  151. package/lib/module/components/UniversalOnboarding.js +2770 -1
  152. package/lib/module/components/VerificationStep.js +168 -1
  153. package/lib/module/components/WelcomeScreen.js +453 -1
  154. package/lib/module/components/icons/Basicproficon.js +30 -1
  155. package/lib/module/components/icons/Basicprofile.js +14 -1
  156. package/lib/module/components/icons/Checkbox.js +14 -1
  157. package/lib/module/components/icons/Checkmark.js +20 -1
  158. package/lib/module/components/icons/Contentanalysis.js +14 -1
  159. package/lib/module/components/icons/Contenticon.js +32 -1
  160. package/lib/module/components/icons/EnochE.js +34 -1
  161. package/lib/module/components/icons/Personalityicon.js +23 -1
  162. package/lib/module/components/icons/Personalityprofile.js +14 -1
  163. package/lib/module/components/icons/Personalitytraits.js +14 -1
  164. package/lib/module/components/icons/Userpreferences.js +14 -1
  165. package/lib/module/components/icons/index.js +13 -1
  166. package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
  167. package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
  168. package/lib/module/components/onboarding/PinInput.js +274 -1
  169. package/lib/module/components/onboarding/PlatformConnector.js +240 -1
  170. package/lib/module/config/PLATFORM_APIS.md +849 -0
  171. package/lib/module/config/api.js +47 -1
  172. package/lib/module/constants/index.js +114 -1
  173. package/lib/module/context/AuthContext.js +335 -1
  174. package/lib/module/hooks/useConnectedAccounts.js +106 -1
  175. package/lib/module/hooks/useConnections.js +95 -1
  176. package/lib/module/hooks/useCredentials.js +171 -6
  177. package/lib/module/hooks/useUserConnections.js +140 -1
  178. package/lib/module/index.js +172 -1
  179. package/lib/module/services/apiClient.js +295 -1
  180. package/lib/module/services/biometricPinService.js +169 -1
  181. package/lib/module/services/chatGPTConversationExtractor.js +149 -1
  182. package/lib/module/services/chatGPTConversationService.js +268 -1
  183. package/lib/module/services/claudeConversationExtractor.js +97 -1
  184. package/lib/module/services/claudeConversationService.js +151 -1
  185. package/lib/module/services/connectedAccountsService.js +293 -1
  186. package/lib/module/services/googleAuthService.js +241 -1
  187. package/lib/module/services/hingeDataExtractor.js +99 -1
  188. package/lib/module/services/hingeDataService.js +143 -1
  189. package/lib/module/services/imageCompressionService.js +250 -1
  190. package/lib/module/services/instagramDataExtractor.js +120 -1
  191. package/lib/module/services/instagramDataService.js +156 -1
  192. package/lib/module/services/jwtStorageService.js +257 -1
  193. package/lib/module/services/linkedinDOMExtractor.js +234 -1
  194. package/lib/module/services/linkedinProfileService.js +210 -1
  195. package/lib/module/services/linkedinScrapingService.js +219 -1
  196. package/lib/module/services/llmDataStorage.js +277 -1
  197. package/lib/module/services/mobileTrainingService.js +173 -1
  198. package/lib/module/services/netflixDataExtractor.js +114 -1
  199. package/lib/module/services/netflixDataService.js +191 -1
  200. package/lib/module/services/pinEncryptionService.js +74 -6
  201. package/lib/module/services/pinStorageUtils.js +93 -1
  202. package/lib/module/services/platformAuthService.js +1461 -1
  203. package/lib/module/services/sephoraDataExtractor.js +134 -1
  204. package/lib/module/services/sephoraDataService.js +193 -1
  205. package/lib/module/services/spotifyDataExtractor.js +142 -1
  206. package/lib/module/services/spotifyDataService.js +234 -1
  207. package/lib/module/services/storageService.js +383 -1
  208. package/lib/module/services/telegramDataExtractor.js +109 -1
  209. package/lib/module/services/telegramDataService.js +493 -1
  210. package/lib/module/services/trainingApiHelpers.js +67 -1
  211. package/lib/module/services/userConnectionsService.js +329 -1
  212. package/lib/module/services/youtubeMigrationService.js +405 -1
  213. package/lib/module/theme/index.js +245 -1
  214. package/lib/module/types.js +10 -1
  215. package/lib/module/utils/Portal.js +90 -1
  216. package/lib/module/utils/api.js +118 -1
  217. package/lib/module/utils/assetRegistry.js +200 -34
  218. package/lib/module/utils/auth.js +100 -1
  219. package/lib/module/utils/connectorTests.js +600 -27
  220. package/lib/module/utils/crypto.js +54 -1
  221. package/lib/module/utils/debugHelper.js +54 -1
  222. package/lib/module/utils/encryption.js +67 -1
  223. package/lib/module/utils/eventUtils.js +270 -1
  224. package/lib/module/utils/haptics.js +59 -8
  225. package/lib/module/utils/imagePreloader.js +3 -1
  226. package/lib/module/utils/networkDiagnostics.js +217 -1
  227. package/lib/module/utils/onairosApi.js +333 -1
  228. package/lib/module/utils/programmaticFlow.js +111 -1
  229. package/lib/module/utils/retryHelper.js +211 -1
  230. package/lib/module/utils/secureStorage.js +330 -6
  231. package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
  232. package/lib/module/utils/webviewScripts/claude.js +370 -1
  233. package/lib/module/utils/webviewScripts/hinge.js +405 -1
  234. package/lib/module/utils/webviewScripts/index.js +434 -1
  235. package/lib/module/utils/webviewScripts/instagram.js +448 -1
  236. package/lib/module/utils/webviewScripts/linkedin.js +874 -1
  237. package/lib/module/utils/webviewScripts/netflix.js +376 -1
  238. package/lib/module/utils/webviewScripts/sephora.js +510 -1
  239. package/lib/module/utils/webviewScripts/spotify.js +413 -1
  240. package/lib/module/utils/webviewScripts/telegram.js +672 -1
  241. package/package.json +2 -2
@@ -1 +1,329 @@
1
- import{getAuthToken,getUserProfile,ensureAuthentication}from'./authService';import AsyncStorage from'@react-native-async-storage/async-storage';import{API_CONFIG}from'../config/api';const getUserIdWithFallbacks=async()=>{const _0x7ba18d={'snwAi':_0x26ce(0x0),'SugGA':_0x26ce(0x1),'AKRgl':_0x26ce(0x2),'HwagW':_0x26ce(0x3),'cVPkj':'✅\x20[USER\x20ID]\x20Got\x20user\x20ID\x20from\x20AsyncStorage:','tamvZ':_0x26ce(0x4),'tKDkP':'uploadProfilePicture\x20has\x20been\x20removed\x20from\x20SDK.\x20Consuming\x20apps\x20should\x20call\x20the\x20Enoch\x20API\x20directly.','nHzTu':_0x26ce(0x5),'yQNHc':_0x26ce(0x6),'xTics':function(_0xcefec1){return _0xcefec1();},'kfifG':function(_0x9ed0d3,_0x4a8bb7){return _0x9ed0d3!==_0x4a8bb7;},'Zlezx':_0x26ce(0x7),'aFpbV':_0x26ce(0x8),'yPvgE':function(_0x3c7ca0,_0x2af4aa){return _0x3c7ca0===_0x2af4aa;},'ACmHw':function(_0x11b372,_0x196d8e){return _0x11b372!==_0x196d8e;},'mxUcu':'epssz','NCuls':'âš ī¸\x20[USER\x20ID]\x20getUserProfile\x20failed:','Etxlz':_0x26ce(0x9),'aJwJX':_0x26ce(0xa),'SLBLJ':function(_0x4ea52b,_0x4e427f){return _0x4ea52b>_0x4e427f;},'ytMYR':function(_0xa62606,_0x3d9a21){return _0xa62606===_0x3d9a21;},'KffXz':_0x26ce(0xb),'bzRFP':'cvZJA','uooCF':'âš ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20user\x20ID\x20found:','CJVuH':_0x26ce(0xc),'qtevu':_0x26ce(0xd),'rTpSm':_0x26ce(0xe),'PKrKY':function(_0x48f322,_0x4afd3a){return _0x48f322>_0x4afd3a;},'zitSQ':function(_0x52a30b,_0x24d20c){return _0x52a30b===_0x24d20c;},'umcIZ':'gncCp','KDRbM':'✅\x20[USER\x20ID]\x20Got\x20email\x20from\x20AsyncStorage\x20(backend\x20supports\x20usernames):','qtwXW':'DivsC','KOkDF':_0x26ce(0xf),'lNRwY':_0x26ce(0x10),'oCYJe':_0x26ce(0x11),'CAMwN':'LdEeu','LpPVl':_0x26ce(0x12)};try{console[_0x26ce(0x13)](_0x26ce(0x14));try{if(_0x7ba18d[_0x26ce(0x15)]!==_0x7ba18d[_0x26ce(0x15)])return _0x370f2f[_0x26ce(0x16)](_0x26ce(0x17)),[];else{const _0x47aa01=await _0x7ba18d['xTics'](getUserProfile);if(_0x7ba18d[_0x26ce(0x18)](_0x47aa01,null)&&_0x47aa01!==void 0x0&&_0x47aa01['id']&&_0x7ba18d['kfifG'](_0x47aa01['id'],_0x7ba18d[_0x26ce(0x19)]))return console[_0x26ce(0x13)](_0x7ba18d[_0x26ce(0x1a)],_0x47aa01['id']),_0x47aa01['id'];else console[_0x26ce(0x16)](_0x26ce(0x1b),_0x7ba18d[_0x26ce(0x1c)](_0x47aa01,null)||_0x47aa01===void 0x0?void 0x0:_0x47aa01['id']);}}catch(_0x153bdf){_0x7ba18d['ACmHw'](_0x26ce(0x1d),_0x7ba18d['mxUcu'])?_0x27598f['warn'](_0x7ba18d[_0x26ce(0x1e)],_0x309354):console[_0x26ce(0x16)](_0x7ba18d[_0x26ce(0x1f)],_0x153bdf);}const _0x502cfc=await AsyncStorage[_0x26ce(0x20)](_0x7ba18d[_0x26ce(0x21)]);if(_0x502cfc&&_0x7ba18d['ACmHw'](_0x502cfc,_0x7ba18d[_0x26ce(0x22)])&&_0x7ba18d[_0x26ce(0x18)](_0x502cfc,_0x7ba18d[_0x26ce(0x19)])&&_0x7ba18d['SLBLJ'](_0x502cfc[_0x26ce(0x23)],0xa)){if(_0x7ba18d[_0x26ce(0x24)](_0x7ba18d[_0x26ce(0x25)],'pWtNT'))return console['log'](_0x26ce(0x26),_0x502cfc),_0x502cfc;else _0x2e59e1[_0x26ce(0x13)]('🔍\x20[USER\x20ID]\x20JWT\x20token\x20found\x20but\x20no\x20local\x20user\x20identifier\x20-\x20backend\x20should\x20handle\x20via\x20token');}else{if(_0x502cfc){if(_0x7ba18d[_0x26ce(0x24)](_0x7ba18d[_0x26ce(0x27)],_0x7ba18d[_0x26ce(0x27)]))console[_0x26ce(0x16)](_0x7ba18d[_0x26ce(0x28)],_0x502cfc);else return _0x1aef95[_0x26ce(0x13)](_0x7ba18d[_0x26ce(0x29)],_0x159dd1),_0x41d3f3[_0x26ce(0x13)](_0x7ba18d[_0x26ce(0x2a)],_0x3fbcaf['stringify'](_0x1557e2,_0x593ab7[_0x26ce(0x2b)](_0x392251))),[];}}const _0x703d5=await AsyncStorage[_0x26ce(0x20)](_0x26ce(0x2c));if(_0x703d5&&_0x7ba18d[_0x26ce(0x2d)](_0x703d5[_0x26ce(0x23)],0x2)&&_0x7ba18d[_0x26ce(0x18)](_0x703d5,_0x7ba18d['aJwJX'])){if(_0x7ba18d[_0x26ce(0x2e)]!==_0x7ba18d[_0x26ce(0x2e)])_0x4f5e93[_0x26ce(0x16)](_0x7ba18d[_0x26ce(0x2f)],_0x8306b9);else return console[_0x26ce(0x13)](_0x7ba18d['qtevu'],_0x703d5),_0x703d5;}else _0x703d5&&console['warn'](_0x26ce(0x0),_0x703d5);const _0x1369ab=await AsyncStorage[_0x26ce(0x20)](_0x7ba18d[_0x26ce(0x30)]);if(_0x1369ab&&_0x1369ab[_0x26ce(0x31)]('@')&&_0x7ba18d[_0x26ce(0x32)](_0x1369ab[_0x26ce(0x23)],0x5))return _0x7ba18d[_0x26ce(0x33)](_0x7ba18d[_0x26ce(0x34)],_0x26ce(0x35))?(console[_0x26ce(0x13)](_0x7ba18d[_0x26ce(0x36)],_0x1369ab),_0x1369ab):(_0xfbfeb4['log'](_0x7ba18d[_0x26ce(0x37)],_0x4176db),_0x491975);else _0x1369ab&&console[_0x26ce(0x16)](_0x7ba18d['HwagW'],_0x1369ab);try{const _0x47da82=await _0x7ba18d[_0x26ce(0x38)](getAuthToken);if(_0x47da82&&_0x7ba18d[_0x26ce(0x1c)](_0x47da82[_0x26ce(0x39)]('.')['length'],0x3)){if(_0x7ba18d[_0x26ce(0x1c)](_0x7ba18d[_0x26ce(0x3a)],_0x7ba18d[_0x26ce(0x3b)]))return _0x13e03b['warn'](_0x7ba18d['tamvZ']),_0x16f542[_0x26ce(0x16)](_0x26ce(0x3c)),{'success':![],'error':_0x7ba18d[_0x26ce(0x3d)]};else console['log'](_0x7ba18d['lNRwY']);}}catch(_0x4d36e5){console[_0x26ce(0x16)](_0x7ba18d[_0x26ce(0x3e)],_0x4d36e5);}return console['error'](_0x7ba18d['oCYJe']),null;}catch(_0x1ab030){if(_0x7ba18d[_0x26ce(0x3f)]===_0x26ce(0x40))_0x3ffe1a[_0x26ce(0x16)](_0x7ba18d[_0x26ce(0x3e)],_0x2e2234);else return console[_0x26ce(0x41)](_0x7ba18d[_0x26ce(0x42)],_0x1ab030),null;}};import{PERSONA_IMAGES}from'../utils/assetRegistry';const samImage=PERSONA_IMAGES[_0x26ce(0x43)],anandImage=PERSONA_IMAGES[_0x26ce(0x44)],chrisImage=PERSONA_IMAGES[_0x26ce(0x45)],katieImage=PERSONA_IMAGES['level4'],yanniImage=PERSONA_IMAGES[_0x26ce(0x46)],API_BASE_URL=API_CONFIG['BASE_URL'],transformAPIConnection=_0x1770fc=>{const _0x20566a={'fRZkb':'🔄\x20Transforming\x20API\x20connection:','EPQUh':function(_0x1f8bab,_0x548164){return _0x1f8bab===_0x548164;},'FXijE':function(_0x4041a0,_0x56ad1b){return _0x4041a0(_0x56ad1b);},'hhccG':function(_0x54a0de,_0xf63a14){return _0x54a0de*_0xf63a14;},'TpCCT':_0x26ce(0x47),'MGSRI':'Hi!\x20Nice\x20to\x20meet\x20you.','mkiTm':function(_0x38acc2,_0x4e158d){return _0x38acc2===_0x4e158d;}};var _0x16be72,_0x3bd4dc;return console[_0x26ce(0x13)](_0x20566a[_0x26ce(0x48)],{'id':_0x1770fc['id'],'name':_0x1770fc['name'],'description':_0x1770fc[_0x26ce(0x49)],'hasPhoto':!!_0x1770fc['photo'],'photoLength':_0x20566a[_0x26ce(0x4a)](_0x16be72=_0x1770fc[_0x26ce(0x4b)],null)||_0x20566a['EPQUh'](_0x16be72,void 0x0)?void 0x0:_0x16be72[_0x26ce(0x23)],'interests':_0x1770fc[_0x26ce(0x4c)],'sharedPassions':_0x1770fc[_0x26ce(0x4d)],'complementaryQualities':_0x1770fc[_0x26ce(0x4e)],'compatibility':_0x1770fc['compatibility']}),{'id':_0x20566a['FXijE'](parseInt,_0x1770fc['id'])||parseInt(_0x1770fc[_0x26ce(0x4f)]||'')||_0x20566a[_0x26ce(0x50)](Math[_0x26ce(0x51)](),0x3e8),'name':_0x1770fc[_0x26ce(0x52)]||'Unknown\x20User','description':_0x1770fc['description']||_0x20566a[_0x26ce(0x53)],'photo':_0x1770fc[_0x26ce(0x4b)]||'','bio':_0x1770fc[_0x26ce(0x54)]||'','interests':_0x1770fc[_0x26ce(0x4c)]||[],'mutualConnections':_0x1770fc[_0x26ce(0x55)]||0x0,'compatibility':_0x1770fc[_0x26ce(0x56)]||0x0,'conversationStarters':_0x1770fc[_0x26ce(0x57)]||[_0x20566a[_0x26ce(0x58)]],'sharedPassions':_0x1770fc[_0x26ce(0x4d)]||[],'complementaryQualities':_0x1770fc[_0x26ce(0x4e)]||[],'meaningfulCoincidences':_0x1770fc['meaningfulCoincidences']||[],'mutualConnectionsList':(_0x20566a[_0x26ce(0x59)](_0x3bd4dc=_0x1770fc['mutualConnectionsList'],null)||_0x20566a[_0x26ce(0x59)](_0x3bd4dc,void 0x0)?void 0x0:_0x3bd4dc[_0x26ce(0x5a)](_0x352e90=>({'name':_0x352e90['name'],'photo':_0x352e90[_0x26ce(0x4b)],'context':_0x352e90[_0x26ce(0x5b)]})))||[]};};export const getUserConnectionsByUsername=async _0x59acd1=>{const _0x37d260={'JpRDT':_0x26ce(0x5c),'skKsD':function(_0x505080,_0x1efc69){return _0x505080===_0x1efc69;},'jMZxZ':_0x26ce(0x5d),'wluJN':function(_0x1c32b5){return _0x1c32b5();},'fDgAO':_0x26ce(0x5e),'LYAmS':_0x26ce(0x5f),'mSPDK':_0x26ce(0x60),'dyFHP':_0x26ce(0x61),'KvYOL':_0x26ce(0x62),'xexgn':function(_0xc9a758,_0x2814b0){return _0xc9a758===_0x2814b0;},'bqTKG':function(_0x32ce73,_0x5e7c20){return _0x32ce73!==_0x5e7c20;},'zURMs':function(_0x2d11d3,_0x846793){return _0x2d11d3!==_0x846793;},'jvpoC':function(_0x1ddad3,_0x315808){return _0x1ddad3>_0x315808;},'dpzYL':_0x26ce(0x63),'QSPvd':_0x26ce(0x1),'xNUWS':_0x26ce(0x2)};try{if(_0x37d260[_0x26ce(0x64)](_0x26ce(0x65),_0x37d260[_0x26ce(0x66)])){const _0x105ee5=_0x585baa['connections'][_0x26ce(0x5a)](_0x246dcd);return _0x5499e8[_0x26ce(0x13)](_0x37d260['JpRDT'],_0x105ee5['length']),_0x105ee5;}else{var _0x576755,_0xb3095d;console[_0x26ce(0x13)](_0x26ce(0x67),_0x59acd1);const _0xef1d9=await _0x37d260['wluJN'](getAuthToken);if(!_0xef1d9)return console['warn'](_0x37d260['fDgAO']),console[_0x26ce(0x16)](_0x26ce(0x68)),[];console[_0x26ce(0x13)](_0x37d260[_0x26ce(0x69)],_0xef1d9[_0x26ce(0x6a)](0x0,0x14)+_0x26ce(0x6b));const _0x3e489e={'success':![],'message':_0x37d260[_0x26ce(0x6c)],'connections':[],'source':_0x37d260[_0x26ce(0x6d)]};console[_0x26ce(0x13)](_0x37d260['KvYOL'],{'success':_0x3e489e[_0x26ce(0x6e)],'connectionsCount':((_0x576755=_0x3e489e[_0x26ce(0x6f)])===null||_0x37d260[_0x26ce(0x70)](_0x576755,void 0x0)?void 0x0:_0x576755['length'])||0x0,'source':_0x3e489e[_0x26ce(0x71)],'firstConnection':_0x37d260[_0x26ce(0x72)](_0xb3095d=_0x3e489e[_0x26ce(0x6f)],null)&&_0x37d260[_0x26ce(0x73)](_0xb3095d,void 0x0)&&_0xb3095d[0x0]?{'id':_0x3e489e[_0x26ce(0x6f)][0x0]['id'],'name':_0x3e489e[_0x26ce(0x6f)][0x0][_0x26ce(0x52)],'description':_0x3e489e[_0x26ce(0x6f)][0x0][_0x26ce(0x49)]}:null});if(_0x3e489e[_0x26ce(0x6e)]&&_0x3e489e[_0x26ce(0x6f)]&&_0x37d260[_0x26ce(0x74)](_0x3e489e[_0x26ce(0x6f)][_0x26ce(0x23)],0x0)){const _0x4caf73=_0x3e489e[_0x26ce(0x6f)][_0x26ce(0x5a)](transformAPIConnection);return console[_0x26ce(0x13)](_0x37d260[_0x26ce(0x75)],_0x4caf73['length']),_0x4caf73;}return[];}}catch(_0x611142){return console[_0x26ce(0x13)](_0x37d260[_0x26ce(0x76)],_0x611142),console[_0x26ce(0x13)](_0x37d260[_0x26ce(0x77)],JSON[_0x26ce(0x78)](_0x611142,Object[_0x26ce(0x2b)](_0x611142))),[];}};function _0x163a(){const _0x46ca71=['âš ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20username\x20found:','❌\x20Error\x20fetching\x20connections\x20by\x20username:','❌\x20[NETWORK\x20ERROR]\x20Full\x20error\x20details:','âš ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20email\x20found:','âš ī¸\x20[DEPRECATED]\x20uploadProfilePicture\x20has\x20been\x20removed\x20from\x20SDK','âš ī¸\x20[USER\x20ID]\x20JWT\x20token\x20access\x20failed:','PkInm','fallback_user','✅\x20[USER\x20ID]\x20Got\x20user\x20ID\x20from\x20getUserProfile:','user_id','marker','pWtNT','ArWxz','✅\x20[USER\x20ID]\x20Got\x20username\x20from\x20AsyncStorage\x20(backend\x20supports\x20usernames):','user_email','VWVpe','🔍\x20[USER\x20ID]\x20JWT\x20token\x20found\x20but\x20no\x20local\x20user\x20identifier\x20-\x20backend\x20should\x20handle\x20via\x20token','❌\x20[USER\x20ID]\x20No\x20valid\x20user\x20identifier\x20found','❌\x20[USER\x20ID]\x20Error\x20getting\x20user\x20identifier:','log','🔍\x20[USER\x20ID]\x20Attempting\x20to\x20get\x20user\x20identifier\x20with\x20multiple\x20methods...','yQNHc','warn','âš ī¸\x20[CONNECTIONS\x20API]\x20No\x20authentication\x20token\x20available\x20for\x20user\x20ID\x20connections\x20request','kfifG','Zlezx','aFpbV','âš ī¸\x20[USER\x20ID]\x20getUserProfile\x20returned\x20invalid/fallback\x20ID:','yPvgE','epssz','snwAi','NCuls','getItem','Etxlz','aJwJX','length','ytMYR','KffXz','✅\x20[USER\x20ID]\x20Got\x20user\x20ID\x20from\x20AsyncStorage:','bzRFP','uooCF','SugGA','AKRgl','getOwnPropertyNames','onairos_username','SLBLJ','CJVuH','HwagW','rTpSm','includes','PKrKY','zitSQ','umcIZ','gncCp','KDRbM','cVPkj','xTics','split','qtwXW','KOkDF','â„šī¸\x20Consuming\x20apps\x20should\x20call\x20/enoch/users/{id}/profile-picture/base64\x20directly','tKDkP','nHzTu','CAMwN','gxYxC','error','LpPVl','level1','level2','level3','level5','Looking\x20to\x20connect','fRZkb','description','EPQUh','photo','interests','sharedPassions','complementaryQualities','_id','hhccG','random','name','TpCCT','bio','mutualConnections','compatibility','conversationStarters','MGSRI','mkiTm','map','context','🔄\x20Transformed\x20connections\x20by\x20userId:','egTBE','âš ī¸\x20[CONNECTIONS\x20API]\x20No\x20authentication\x20token\x20available\x20for\x20connections\x20request','✅\x20[CONNECTIONS\x20API]\x20Using\x20authenticated\x20request\x20with\x20token:','API\x20function\x20not\x20available','mock','✅\x20API\x20connections\x20fetched\x20by\x20username:','🔄\x20Transformed\x20connections\x20by\x20username:','skKsD','FHOZx','jMZxZ','🔍\x20Fetching\x20connections\x20for\x20username:','âš ī¸\x20[CONNECTIONS\x20API]\x20This\x20may\x20result\x20in\x20limited\x20or\x20cached\x20data\x20from\x20backend','LYAmS','substring','...','mSPDK','dyFHP','success','connections','xexgn','source','bqTKG','zURMs','jvpoC','dpzYL','QSPvd','xNUWS','stringify','🔍\x20Fetching\x20connections\x20for\x20userId:','✅\x20API\x20connections\x20fetched\x20by\x20userId:','❌\x20Error\x20fetching\x20connections\x20by\x20userId:','❌\x20[NETWORK\x20ERROR\x20FALLBACK]\x20Full\x20error\x20details:','ygshR','pvTqE','AFEnD','nmyff','iBpcq','Gbnmz','qwrNH','PoZAw','✅\x20[USER\x20ID]\x20Got\x20email\x20from\x20AsyncStorage\x20(backend\x20supports\x20usernames):','✅\x20Successfully\x20got\x20connections\x20by\x20user\x20ID:','USER_CONNECTIONS','🔍\x20[USER\x20DEBUG]\x20AsyncStorage\x20data:','none','🔄\x20[USER\x20DEBUG]\x20Using\x20stored\x20username\x20as\x20email\x20fallback:','🔄\x20[USER\x20DEBUG]\x20Using\x20stored\x20email\x20as\x20fallback:','đŸŽ¯\x20[USER\x20DEBUG]\x20Final\x20user\x20identifiers\x20to\x20use:','ZlxAT','đŸŽ¯\x20PRIORITY:\x20Attempting\x20to\x20fetch\x20connections\x20by\x20email\x20(working\x20endpoint):','đŸŽ¯\x20FALLBACK:\x20Attempting\x20to\x20fetch\x20connections\x20by\x20user\x20ID:','sBKrg','cNtGX','âš ī¸\x20No\x20user\x20identifier\x20available\x20or\x20no\x20connections\x20found','Rhfxu','DZxCE','❌\x20Error\x20in\x20getUserConnections:','GQvyV','hAjTV','CjKyF','taKUz','ESvMw','UGgDM','Qmjns','DARmE','auth_token','kDgtk','jVoSE','cXjPA','email','nusAK','RdVUA','Cmhbi','xzwMK','PXFeB','hpEyy','xcGjo','PecyH','iTZFN','ljjyg','✅\x20Successfully\x20got\x20connections\x20by\x20email:','âš ī¸\x20No\x20connections\x20found\x20by\x20email,\x20trying\x20user\x20ID...','HDKdF','XLHCZ','bkdNx','UkfIp','xeuai','âš ī¸\x20No\x20connections\x20found\x20by\x20user\x20ID','laEvQ','âš ī¸\x20[USER\x20ID]\x20Invalid\x20stored\x20user\x20ID\x20found:','lueQz','fOkIM','ZNicb','fLQBP','qIode','uploadProfilePicture\x20has\x20been\x20removed\x20from\x20SDK.\x20Consuming\x20apps\x20should\x20call\x20the\x20Enoch\x20API\x20directly.'];_0x163a=function(){return _0x46ca71;};return _0x163a();}function _0x26ce(_0x163a2d,_0x26ce15){_0x163a2d=_0x163a2d-0x0;const _0x19b6c4=_0x163a();let _0x268d21=_0x19b6c4[_0x163a2d];return _0x268d21;}export const getUserConnectionsByUserId=async _0x34065b=>{const _0x9aa629={'ygshR':_0x26ce(0x79),'pvTqE':function(_0x590714){return _0x590714();},'AFEnD':'✅\x20[CONNECTIONS\x20API]\x20Using\x20authenticated\x20request\x20with\x20token:','nmyff':_0x26ce(0x60),'YdDeb':_0x26ce(0x7a),'OfBGj':function(_0x21536e,_0x550318){return _0x21536e===_0x550318;},'iBpcq':function(_0x29a8b9,_0x2072ae){return _0x29a8b9!==_0x2072ae;},'Gbnmz':function(_0x472d4c,_0x3cb02e){return _0x472d4c>_0x3cb02e;},'qwrNH':_0x26ce(0x5c),'PoZAw':_0x26ce(0x7b),'iokXp':_0x26ce(0x7c)};try{var _0x288791,_0x1adaa8;console['log'](_0x9aa629[_0x26ce(0x7d)],_0x34065b);const _0x4e869e=await _0x9aa629[_0x26ce(0x7e)](getAuthToken);if(!_0x4e869e)return console[_0x26ce(0x16)](_0x26ce(0x17)),[];console[_0x26ce(0x13)](_0x9aa629[_0x26ce(0x7f)],_0x4e869e['substring'](0x0,0x14)+_0x26ce(0x6b));const _0x383008={'success':![],'message':_0x9aa629[_0x26ce(0x80)],'connections':[],'source':'mock'};console['log'](_0x9aa629['YdDeb'],{'success':_0x383008[_0x26ce(0x6e)],'connectionsCount':(_0x9aa629['OfBGj'](_0x288791=_0x383008[_0x26ce(0x6f)],null)||_0x288791===void 0x0?void 0x0:_0x288791[_0x26ce(0x23)])||0x0,'source':_0x383008[_0x26ce(0x71)],'firstConnection':_0x9aa629[_0x26ce(0x81)](_0x1adaa8=_0x383008[_0x26ce(0x6f)],null)&&_0x9aa629['iBpcq'](_0x1adaa8,void 0x0)&&_0x1adaa8[0x0]?{'id':_0x383008['connections'][0x0]['id'],'name':_0x383008[_0x26ce(0x6f)][0x0][_0x26ce(0x52)],'description':_0x383008[_0x26ce(0x6f)][0x0][_0x26ce(0x49)]}:null});if(_0x383008[_0x26ce(0x6e)]&&_0x383008[_0x26ce(0x6f)]&&_0x9aa629[_0x26ce(0x82)](_0x383008[_0x26ce(0x6f)][_0x26ce(0x23)],0x0)){const _0x10432c=_0x383008['connections'][_0x26ce(0x5a)](transformAPIConnection);return console[_0x26ce(0x13)](_0x9aa629[_0x26ce(0x83)],_0x10432c['length']),_0x10432c;}return[];}catch(_0xbdc0d8){return console[_0x26ce(0x13)](_0x9aa629[_0x26ce(0x84)],_0xbdc0d8),console[_0x26ce(0x13)](_0x9aa629['iokXp'],JSON['stringify'](_0xbdc0d8,Object[_0x26ce(0x2b)](_0xbdc0d8))),[];}};export const getUserConnections=async()=>{const _0x24f6ed={'iTZFN':'❌\x20Error\x20fetching\x20connections\x20by\x20userId:','ljjyg':'❌\x20[NETWORK\x20ERROR\x20FALLBACK]\x20Full\x20error\x20details:','sZWTt':_0x26ce(0x85),'xeuai':_0x26ce(0x86),'GQvyV':function(_0x332cc1,_0x2082f2){return _0x332cc1===_0x2082f2;},'hAjTV':'CjKyF','taKUz':function(_0x57b811,_0x4af02e){return _0x57b811(_0x4af02e);},'ESvMw':_0x26ce(0x87),'UGgDM':'🔍\x20[USER\x20DEBUG]\x20Checking\x20all\x20available\x20user\x20data\x20sources...','Qmjns':_0x26ce(0x2c),'DARmE':_0x26ce(0x9),'PCkdE':_0x26ce(0x88),'kDgtk':_0x26ce(0x89),'jVoSE':'đŸŽ¯\x20getUserConnections\x20-\x20User\x20profile:','cXjPA':function(_0x3b6826,_0x58f901){return _0x3b6826!==_0x58f901;},'nusAK':function(_0x1b3536,_0x543815){return _0x1b3536===_0x543815;},'uQdUN':function(_0x22356a,_0x9f4a08){return _0x22356a===_0x9f4a08;},'xzwMK':function(_0x3af3a,_0x47ecd7){return _0x3af3a===_0x47ecd7;},'RdVUA':function(_0x1946fa,_0x3066d5){return _0x1946fa===_0x3066d5;},'Cmhbi':function(_0x505858,_0x2fc7bd){return _0x505858===_0x2fc7bd;},'PXFeB':function(_0x1247d2,_0x472107){return _0x1247d2&&_0x472107;},'hpEyy':_0x26ce(0x8a),'xcGjo':function(_0x259b0e,_0x9085d9){return _0x259b0e&&_0x9085d9;},'ZPAMz':_0x26ce(0x8b),'WvBZN':_0x26ce(0x8c),'PecyH':_0x26ce(0x8d),'fVoOu':_0x26ce(0x8e),'DmzJQ':function(_0x283252,_0x52f5d0){return _0x283252(_0x52f5d0);},'HDKdF':_0x26ce(0x8f),'XLHCZ':function(_0xc6d9af,_0x3ca837){return _0xc6d9af>_0x3ca837;},'bkdNx':_0x26ce(0x90),'UkfIp':_0x26ce(0x91),'laEvQ':_0x26ce(0x92),'lueQz':function(_0x1e6cae,_0x4173ea){return _0x1e6cae!==_0x4173ea;},'fOkIM':_0x26ce(0x93),'hmiSP':_0x26ce(0x94),'ZNicb':_0x26ce(0x95)};try{if(_0x24f6ed[_0x26ce(0x96)](_0x24f6ed[_0x26ce(0x97)],_0x26ce(0x98))){await _0x24f6ed[_0x26ce(0x99)](ensureAuthentication,_0x24f6ed[_0x26ce(0x9a)]),console['log'](_0x24f6ed[_0x26ce(0x9b)]);const _0xce8661=await AsyncStorage[_0x26ce(0x20)](_0x24f6ed[_0x26ce(0x9c)]),_0x59538a=await AsyncStorage[_0x26ce(0x20)](_0x26ce(0xe)),_0x1477be=await AsyncStorage[_0x26ce(0x20)](_0x24f6ed[_0x26ce(0x9d)]),_0x79460c=await AsyncStorage[_0x26ce(0x20)](_0x26ce(0x9e));console[_0x26ce(0x13)](_0x24f6ed['PCkdE'],{'storedUsername':_0xce8661,'storedEmail':_0x59538a,'storedUserId':_0x1477be,'hasAuthToken':!!_0x79460c,'authTokenPreview':_0x79460c?_0x79460c[_0x26ce(0x6a)](0x0,0x14)+_0x26ce(0x6b):_0x24f6ed[_0x26ce(0x9f)]});const _0x1f6fd1=await getUserProfile();console[_0x26ce(0x13)](_0x24f6ed[_0x26ce(0xa0)],{'hasId':!!(_0x1f6fd1!==null&&_0x1f6fd1!==void 0x0&&_0x1f6fd1['id']),'hasEmail':!!(_0x1f6fd1!==null&&_0x24f6ed[_0x26ce(0xa1)](_0x1f6fd1,void 0x0)&&_0x1f6fd1[_0x26ce(0xa2)]),'email':_0x1f6fd1===null||_0x24f6ed[_0x26ce(0xa3)](_0x1f6fd1,void 0x0)?void 0x0:_0x1f6fd1[_0x26ce(0xa2)],'id':_0x24f6ed['uQdUN'](_0x1f6fd1,null)||_0x24f6ed['xzwMK'](_0x1f6fd1,void 0x0)?void 0x0:_0x1f6fd1['id']});let _0x8f1eda=_0x1f6fd1===null||_0x24f6ed[_0x26ce(0xa4)](_0x1f6fd1,void 0x0)?void 0x0:_0x1f6fd1[_0x26ce(0xa2)],_0x73a2fc=_0x24f6ed[_0x26ce(0xa5)](_0x1f6fd1,null)||_0x24f6ed[_0x26ce(0xa6)](_0x1f6fd1,void 0x0)?void 0x0:_0x1f6fd1['id'];_0x24f6ed[_0x26ce(0xa7)](!_0x8f1eda,_0xce8661)&&(console[_0x26ce(0x13)](_0x24f6ed[_0x26ce(0xa8)],_0xce8661),_0x8f1eda=_0xce8661);_0x24f6ed[_0x26ce(0xa9)](!_0x8f1eda,_0x59538a)&&(console['log'](_0x24f6ed['ZPAMz'],_0x59538a),_0x8f1eda=_0x59538a);!_0x73a2fc&&_0x1477be&&(console[_0x26ce(0x13)]('🔄\x20[USER\x20DEBUG]\x20Using\x20stored\x20user\x20ID\x20as\x20fallback:',_0x1477be),_0x73a2fc=_0x1477be);console['log'](_0x24f6ed['WvBZN'],{'userEmail':_0x8f1eda,'userId':_0x73a2fc,'willTryEmail':!!_0x8f1eda,'willTryUserId':!!_0x73a2fc});if(_0x8f1eda){if(_0x24f6ed[_0x26ce(0xa1)](_0x24f6ed[_0x26ce(0xaa)],'ZlxAT'))return _0xe797e9[_0x26ce(0x13)](_0x24f6ed[_0x26ce(0xab)],_0x67b265),_0x5b2751['log'](_0x24f6ed[_0x26ce(0xac)],_0xdf3379['stringify'](_0x5ef298,_0x5cb420[_0x26ce(0x2b)](_0x51d95e))),[];else{console[_0x26ce(0x13)](_0x24f6ed['fVoOu'],_0x8f1eda);const _0x5cbb4a=await _0x24f6ed['DmzJQ'](getUserConnectionsByUsername,_0x8f1eda);if(_0x5cbb4a[_0x26ce(0x23)]>0x0)return console[_0x26ce(0x13)](_0x26ce(0xad),_0x5cbb4a[_0x26ce(0x23)]),_0x5cbb4a;console[_0x26ce(0x13)](_0x26ce(0xae));}}if(_0x73a2fc){console[_0x26ce(0x13)](_0x24f6ed[_0x26ce(0xaf)],_0x73a2fc);const _0x2cc6b9=await _0x24f6ed[_0x26ce(0x99)](getUserConnectionsByUserId,_0x73a2fc);if(_0x24f6ed[_0x26ce(0xb0)](_0x2cc6b9[_0x26ce(0x23)],0x0))return _0x24f6ed[_0x26ce(0xa4)](_0x24f6ed[_0x26ce(0xb1)],_0x24f6ed[_0x26ce(0xb2)])?(_0x4492a8['log'](_0x24f6ed['sZWTt'],_0x2026cb),_0x5466b8):(console[_0x26ce(0x13)](_0x24f6ed[_0x26ce(0xb3)],_0x2cc6b9[_0x26ce(0x23)]),_0x2cc6b9);console[_0x26ce(0x13)](_0x26ce(0xb4));}return console[_0x26ce(0x13)](_0x24f6ed[_0x26ce(0xb5)]),[];}else _0x310b6e[_0x26ce(0x16)](_0x26ce(0xb6),_0x4560e9);}catch(_0x4e2157){return _0x24f6ed[_0x26ce(0xb7)](_0x24f6ed[_0x26ce(0xb8)],_0x24f6ed['hmiSP'])?(console[_0x26ce(0x13)](_0x24f6ed[_0x26ce(0xb9)],_0x4e2157),[]):(_0x4e87f6[_0x26ce(0x13)](_0x24f6ed['xeuai'],_0x6035d1[_0x26ce(0x23)]),_0x6f78c2);}};export const uploadProfilePicture=async(_0x4e13c6,_0x1215b6)=>{const _0x3c3ead={'fLQBP':_0x26ce(0x4),'qIode':_0x26ce(0x3c)};return console['warn'](_0x3c3ead[_0x26ce(0xba)]),console[_0x26ce(0x16)](_0x3c3ead[_0x26ce(0xbb)]),{'success':![],'error':_0x26ce(0xbc)};};
1
+ import { getAuthToken, getUserProfile, ensureAuthentication } from './authService';
2
+ import AsyncStorage from '@react-native-async-storage/async-storage';
3
+ import { API_CONFIG } from '../config/api';
4
+
5
+ /**
6
+ * Get user identifier (ID or username) using multiple fallback methods
7
+ * Backend now supports both user IDs and usernames for profile picture uploads
8
+ * @returns Promise<string | null>
9
+ */
10
+ const getUserIdWithFallbacks = async () => {
11
+ try {
12
+ console.log('🔍 [USER ID] Attempting to get user identifier with multiple methods...');
13
+
14
+ // Method 1: Try getUserProfile first
15
+ try {
16
+ const userProfile = await getUserProfile();
17
+ if (userProfile !== null && userProfile !== void 0 && userProfile.id && userProfile.id !== 'fallback_user') {
18
+ console.log('✅ [USER ID] Got user ID from getUserProfile:', userProfile.id);
19
+ return userProfile.id;
20
+ } else {
21
+ console.warn('âš ī¸ [USER ID] getUserProfile returned invalid/fallback ID:', userProfile === null || userProfile === void 0 ? void 0 : userProfile.id);
22
+ }
23
+ } catch (error) {
24
+ console.warn('âš ī¸ [USER ID] getUserProfile failed:', error);
25
+ }
26
+
27
+ // Method 2: Check AsyncStorage for stored user ID (but validate it)
28
+ const storedUserId = await AsyncStorage.getItem('user_id');
29
+ if (storedUserId && storedUserId !== 'marker' && storedUserId !== 'fallback_user' && storedUserId.length > 10) {
30
+ console.log('✅ [USER ID] Got user ID from AsyncStorage:', storedUserId);
31
+ return storedUserId;
32
+ } else if (storedUserId) {
33
+ console.warn('âš ī¸ [USER ID] Invalid stored user ID found:', storedUserId);
34
+ }
35
+
36
+ // Method 3: Try stored username (backend now supports usernames!)
37
+ const storedUsername = await AsyncStorage.getItem('onairos_username');
38
+ if (storedUsername && storedUsername.length > 2 && storedUsername !== 'marker') {
39
+ console.log('✅ [USER ID] Got username from AsyncStorage (backend supports usernames):', storedUsername);
40
+ return storedUsername;
41
+ } else if (storedUsername) {
42
+ console.warn('âš ī¸ [USER ID] Invalid stored username found:', storedUsername);
43
+ }
44
+
45
+ // Method 4: Try stored email as username fallback
46
+ const storedEmail = await AsyncStorage.getItem('user_email');
47
+ if (storedEmail && storedEmail.includes('@') && storedEmail.length > 5) {
48
+ console.log('✅ [USER ID] Got email from AsyncStorage (backend supports usernames):', storedEmail);
49
+ return storedEmail;
50
+ } else if (storedEmail) {
51
+ console.warn('âš ī¸ [USER ID] Invalid stored email found:', storedEmail);
52
+ }
53
+
54
+ // Method 5: Check JWT token for user info (but don't decode, just log)
55
+ try {
56
+ const token = await getAuthToken();
57
+ if (token && token.split('.').length === 3) {
58
+ console.log('🔍 [USER ID] JWT token found but no local user identifier - backend should handle via token');
59
+ // Don't try to decode JWT here - let the backend handle it
60
+ }
61
+ } catch (error) {
62
+ console.warn('âš ī¸ [USER ID] JWT token access failed:', error);
63
+ }
64
+ console.error('❌ [USER ID] No valid user identifier found');
65
+ return null;
66
+ } catch (error) {
67
+ console.error('❌ [USER ID] Error getting user identifier:', error);
68
+ return null;
69
+ }
70
+ };
71
+
72
+ // Import images for fallback connections from centralized registry
73
+ import { PERSONA_IMAGES } from '../utils/assetRegistry';
74
+ const samImage = PERSONA_IMAGES.level1;
75
+ const anandImage = PERSONA_IMAGES.level2;
76
+ const chrisImage = PERSONA_IMAGES.level3;
77
+ const katieImage = PERSONA_IMAGES.level4;
78
+ const yanniImage = PERSONA_IMAGES.level5;
79
+ const API_BASE_URL = API_CONFIG.BASE_URL;
80
+
81
+ // Interface for API connection response - updated to match actual backend format
82
+
83
+ // Interface for API response
84
+
85
+ // Interface for the transformed connection used by UI
86
+
87
+ /**
88
+ * Transform API connection to UI connection format
89
+ */
90
+ const transformAPIConnection = apiConnection => {
91
+ var _apiConnection$photo, _apiConnection$mutual;
92
+ console.log('🔄 Transforming API connection:', {
93
+ id: apiConnection.id,
94
+ name: apiConnection.name,
95
+ description: apiConnection.description,
96
+ hasPhoto: !!apiConnection.photo,
97
+ photoLength: (_apiConnection$photo = apiConnection.photo) === null || _apiConnection$photo === void 0 ? void 0 : _apiConnection$photo.length,
98
+ interests: apiConnection.interests,
99
+ sharedPassions: apiConnection.sharedPassions,
100
+ complementaryQualities: apiConnection.complementaryQualities,
101
+ compatibility: apiConnection.compatibility
102
+ });
103
+ return {
104
+ id: parseInt(apiConnection.id) || parseInt(apiConnection._id || '') || Math.random() * 1000,
105
+ // Try id first, then _id, then random
106
+ name: apiConnection.name || 'Unknown User',
107
+ description: apiConnection.description || 'Looking to connect',
108
+ photo: apiConnection.photo || '',
109
+ // This will be a URL string from API, or empty string
110
+ bio: apiConnection.bio || '',
111
+ interests: apiConnection.interests || [],
112
+ mutualConnections: apiConnection.mutualConnections || 0,
113
+ compatibility: apiConnection.compatibility || 0,
114
+ conversationStarters: apiConnection.conversationStarters || ['Hi! Nice to meet you.'],
115
+ // UI REQUIRED FIELDS - These are actually rendered in ProfileDetailScreen
116
+ sharedPassions: apiConnection.sharedPassions || [],
117
+ // Don't fallback to interests since we now have separate Interests section
118
+ complementaryQualities: apiConnection.complementaryQualities || [],
119
+ meaningfulCoincidences: apiConnection.meaningfulCoincidences || [],
120
+ mutualConnectionsList: ((_apiConnection$mutual = apiConnection.mutualConnectionsList) === null || _apiConnection$mutual === void 0 ? void 0 : _apiConnection$mutual.map(mutual => ({
121
+ name: mutual.name,
122
+ photo: mutual.photo,
123
+ // URL string from API
124
+ context: mutual.context
125
+ }))) || []
126
+ };
127
+ };
128
+
129
+ /**
130
+ * Get user connections by username
131
+ * @param username - Username to fetch connections for
132
+ * @returns Promise<Connection[]>
133
+ */
134
+ export const getUserConnectionsByUsername = async username => {
135
+ try {
136
+ var _response$connections, _response$connections2;
137
+ console.log('🔍 Fetching connections for username:', username);
138
+ const token = await getAuthToken();
139
+
140
+ // Enhanced token validation and warning
141
+ if (!token) {
142
+ console.warn('âš ī¸ [CONNECTIONS API] No authentication token available for connections request');
143
+ console.warn('âš ī¸ [CONNECTIONS API] This may result in limited or cached data from backend');
144
+ return []; // Return empty array instead of making unauthenticated request
145
+ }
146
+ console.log('✅ [CONNECTIONS API] Using authenticated request with token:', `${token.substring(0, 20)}...`);
147
+
148
+ // Use the same pattern as other working APIs - import and call with token
149
+ // const { getUserConnectionsByUsername: apiCall } = await import('../../services/api'); // Commented out - path issue
150
+ const response = {
151
+ success: false,
152
+ message: 'API function not available',
153
+ connections: [],
154
+ source: 'mock'
155
+ };
156
+ console.log('✅ API connections fetched by username:', {
157
+ success: response.success,
158
+ connectionsCount: ((_response$connections = response.connections) === null || _response$connections === void 0 ? void 0 : _response$connections.length) || 0,
159
+ source: response.source,
160
+ firstConnection: (_response$connections2 = response.connections) !== null && _response$connections2 !== void 0 && _response$connections2[0] ? {
161
+ id: response.connections[0].id,
162
+ name: response.connections[0].name,
163
+ description: response.connections[0].description
164
+ } : null
165
+ });
166
+ if (response.success && response.connections && response.connections.length > 0) {
167
+ const transformedConnections = response.connections.map(transformAPIConnection);
168
+ console.log('🔄 Transformed connections by username:', transformedConnections.length);
169
+ return transformedConnections;
170
+ }
171
+ return [];
172
+ } catch (error) {
173
+ console.log('❌ Error fetching connections by username:', error);
174
+ console.log('❌ [NETWORK ERROR] Full error details:', JSON.stringify(error, Object.getOwnPropertyNames(error)));
175
+ return [];
176
+ }
177
+ };
178
+
179
+ /**
180
+ * Get user connections by user ID
181
+ * @param userId - User ID to fetch connections for
182
+ * @returns Promise<Connection[]>
183
+ */
184
+ export const getUserConnectionsByUserId = async userId => {
185
+ try {
186
+ var _response$connections3, _response$connections4;
187
+ console.log('🔍 Fetching connections for userId:', userId);
188
+ const token = await getAuthToken();
189
+ if (!token) {
190
+ console.warn('âš ī¸ [CONNECTIONS API] No authentication token available for user ID connections request');
191
+ return []; // Return empty array instead of making unauthenticated request
192
+ }
193
+ console.log('✅ [CONNECTIONS API] Using authenticated request with token:', `${token.substring(0, 20)}...`);
194
+
195
+ // Use the same pattern as other working APIs - import and call with token
196
+ // const { getUserConnections: apiCall } = await import('../../services/api'); // Commented out - path issue
197
+ const response = {
198
+ success: false,
199
+ message: 'API function not available',
200
+ connections: [],
201
+ source: 'mock'
202
+ };
203
+ console.log('✅ API connections fetched by userId:', {
204
+ success: response.success,
205
+ connectionsCount: ((_response$connections3 = response.connections) === null || _response$connections3 === void 0 ? void 0 : _response$connections3.length) || 0,
206
+ source: response.source,
207
+ firstConnection: (_response$connections4 = response.connections) !== null && _response$connections4 !== void 0 && _response$connections4[0] ? {
208
+ id: response.connections[0].id,
209
+ name: response.connections[0].name,
210
+ description: response.connections[0].description
211
+ } : null
212
+ });
213
+ if (response.success && response.connections && response.connections.length > 0) {
214
+ const transformedConnections = response.connections.map(transformAPIConnection);
215
+ console.log('🔄 Transformed connections by userId:', transformedConnections.length);
216
+ return transformedConnections;
217
+ }
218
+ return [];
219
+ } catch (error) {
220
+ console.log('❌ Error fetching connections by userId:', error);
221
+ console.log('❌ [NETWORK ERROR FALLBACK] Full error details:', JSON.stringify(error, Object.getOwnPropertyNames(error)));
222
+ return [];
223
+ }
224
+ };
225
+
226
+ /**
227
+ * Get user connections with automatic detection of user info
228
+ * PRIORITIZES the working email/username endpoint over the failing user ID endpoint
229
+ * @returns Promise<Connection[]>
230
+ */
231
+ export const getUserConnections = async () => {
232
+ try {
233
+ // ENHANCED DEBUG: Check authentication status first
234
+ await ensureAuthentication('USER_CONNECTIONS');
235
+
236
+ // ENHANCED DEBUG: Check what user data we actually have available
237
+ console.log('🔍 [USER DEBUG] Checking all available user data sources...');
238
+
239
+ // Check AsyncStorage for user data
240
+ const storedUsername = await AsyncStorage.getItem('onairos_username');
241
+ const storedEmail = await AsyncStorage.getItem('user_email');
242
+ const storedUserId = await AsyncStorage.getItem('user_id');
243
+ const authToken = await AsyncStorage.getItem('auth_token');
244
+ console.log('🔍 [USER DEBUG] AsyncStorage data:', {
245
+ storedUsername,
246
+ storedEmail,
247
+ storedUserId,
248
+ hasAuthToken: !!authToken,
249
+ authTokenPreview: authToken ? `${authToken.substring(0, 20)}...` : 'none'
250
+ });
251
+
252
+ // First try to get user profile to determine username/userId
253
+ const userProfile = await getUserProfile();
254
+ console.log('đŸŽ¯ getUserConnections - User profile:', {
255
+ hasId: !!(userProfile !== null && userProfile !== void 0 && userProfile.id),
256
+ hasEmail: !!(userProfile !== null && userProfile !== void 0 && userProfile.email),
257
+ email: userProfile === null || userProfile === void 0 ? void 0 : userProfile.email,
258
+ id: userProfile === null || userProfile === void 0 ? void 0 : userProfile.id
259
+ });
260
+
261
+ // FALLBACK: If getUserProfile fails, try to use stored data directly
262
+ let userEmail = userProfile === null || userProfile === void 0 ? void 0 : userProfile.email;
263
+ let userId = userProfile === null || userProfile === void 0 ? void 0 : userProfile.id;
264
+ if (!userEmail && storedUsername) {
265
+ console.log('🔄 [USER DEBUG] Using stored username as email fallback:', storedUsername);
266
+ userEmail = storedUsername;
267
+ }
268
+ if (!userEmail && storedEmail) {
269
+ console.log('🔄 [USER DEBUG] Using stored email as fallback:', storedEmail);
270
+ userEmail = storedEmail;
271
+ }
272
+ if (!userId && storedUserId) {
273
+ console.log('🔄 [USER DEBUG] Using stored user ID as fallback:', storedUserId);
274
+ userId = storedUserId;
275
+ }
276
+ console.log('đŸŽ¯ [USER DEBUG] Final user identifiers to use:', {
277
+ userEmail,
278
+ userId,
279
+ willTryEmail: !!userEmail,
280
+ willTryUserId: !!userId
281
+ });
282
+
283
+ // PRIORITY 1: Try by email/username first (this endpoint is working!)
284
+ if (userEmail) {
285
+ console.log('đŸŽ¯ PRIORITY: Attempting to fetch connections by email (working endpoint):', userEmail);
286
+ const connections = await getUserConnectionsByUsername(userEmail);
287
+ if (connections.length > 0) {
288
+ console.log('✅ Successfully got connections by email:', connections.length);
289
+ return connections;
290
+ }
291
+ console.log('âš ī¸ No connections found by email, trying user ID...');
292
+ }
293
+
294
+ // PRIORITY 2: Try by user ID only if email fails (this endpoint has ObjectId issues)
295
+ if (userId) {
296
+ console.log('đŸŽ¯ FALLBACK: Attempting to fetch connections by user ID:', userId);
297
+ const connections = await getUserConnectionsByUserId(userId);
298
+ if (connections.length > 0) {
299
+ console.log('✅ Successfully got connections by user ID:', connections.length);
300
+ return connections;
301
+ }
302
+ console.log('âš ī¸ No connections found by user ID');
303
+ }
304
+ console.log('âš ī¸ No user identifier available or no connections found');
305
+ return [];
306
+ } catch (error) {
307
+ console.log('❌ Error in getUserConnections:', error);
308
+ return [];
309
+ }
310
+ };
311
+
312
+ /**
313
+ * @deprecated This function uses Enoch-specific endpoints and has been removed from the SDK.
314
+ * Consuming apps (like OnairosEvents) should call the profile picture API directly:
315
+ * POST /enoch/users/{userIdentifier}/profile-picture/base64
316
+ *
317
+ * @param _imageUri - Image URI (file:// or base64)
318
+ * @param _fileType - File type (jpg, png)
319
+ * @returns Promise with error indicating deprecation
320
+ */
321
+ export const uploadProfilePicture = async (_imageUri, _fileType) => {
322
+ console.warn('âš ī¸ [DEPRECATED] uploadProfilePicture has been removed from SDK');
323
+ console.warn('â„šī¸ Consuming apps should call /enoch/users/{id}/profile-picture/base64 directly');
324
+ return {
325
+ success: false,
326
+ error: 'uploadProfilePicture has been removed from SDK. Consuming apps should call the Enoch API directly.'
327
+ };
328
+ };
329
+ //# sourceMappingURL=userConnectionsService.js.map