@onairos/react-native 3.7.2 → 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 (237) hide show
  1. package/lib/commonjs/api/index.js +219 -9
  2. package/lib/commonjs/components/BodyText.js +27 -9
  3. package/lib/commonjs/components/BrandMark.js +111 -10
  4. package/lib/commonjs/components/CodeInput.js +116 -9
  5. package/lib/commonjs/components/EmailInput.js +30 -8
  6. package/lib/commonjs/components/GoogleButton.js +56 -9
  7. package/lib/commonjs/components/HeadingGroup.js +43 -9
  8. package/lib/commonjs/components/LLMDataInputModal.js +664 -14
  9. package/lib/commonjs/components/ModalHeader.js +99 -9
  10. package/lib/commonjs/components/ModalSheet.js +47 -9
  11. package/lib/commonjs/components/Onairos.js +380 -14
  12. package/lib/commonjs/components/OnairosButton.js +313 -13
  13. package/lib/commonjs/components/OnairosSignInButton.js +130 -12
  14. package/lib/commonjs/components/Overlay.js +465 -13
  15. package/lib/commonjs/components/PersonaImage.js +137 -10
  16. package/lib/commonjs/components/PersonaLoadingScreen.js +318 -12
  17. package/lib/commonjs/components/PersonalizationConsentScreen.js +467 -13
  18. package/lib/commonjs/components/PinCreationScreen.js +403 -12
  19. package/lib/commonjs/components/PinInput.js +464 -9
  20. package/lib/commonjs/components/PlatformConnectorsStep.js +1311 -23
  21. package/lib/commonjs/components/PlatformList.js +137 -10
  22. package/lib/commonjs/components/PlatformToggle.js +180 -9
  23. package/lib/commonjs/components/PrimaryButton.js +180 -10
  24. package/lib/commonjs/components/SignInMatchAnimation.js +197 -9
  25. package/lib/commonjs/components/SignInStep.js +345 -12
  26. package/lib/commonjs/components/UniversalOnboarding.js +2780 -30
  27. package/lib/commonjs/components/VerificationStep.js +176 -11
  28. package/lib/commonjs/components/WelcomeScreen.js +461 -22
  29. package/lib/commonjs/components/icons/Basicproficon.js +37 -8
  30. package/lib/commonjs/components/icons/Basicprofile.js +21 -8
  31. package/lib/commonjs/components/icons/Checkbox.js +21 -8
  32. package/lib/commonjs/components/icons/Checkmark.js +27 -8
  33. package/lib/commonjs/components/icons/Contentanalysis.js +21 -8
  34. package/lib/commonjs/components/icons/Contenticon.js +39 -8
  35. package/lib/commonjs/components/icons/EnochE.js +41 -8
  36. package/lib/commonjs/components/icons/Personalityicon.js +30 -8
  37. package/lib/commonjs/components/icons/Personalityprofile.js +21 -8
  38. package/lib/commonjs/components/icons/Personalitytraits.js +21 -8
  39. package/lib/commonjs/components/icons/Userpreferences.js +21 -8
  40. package/lib/commonjs/components/icons/index.js +84 -17
  41. package/lib/commonjs/components/onboarding/OAuthWebView.js +1754 -18
  42. package/lib/commonjs/components/onboarding/OnboardingHeader.js +74 -10
  43. package/lib/commonjs/components/onboarding/PinInput.js +283 -10
  44. package/lib/commonjs/components/onboarding/PlatformConnector.js +249 -11
  45. package/lib/commonjs/config/PLATFORM_APIS.md +849 -0
  46. package/lib/commonjs/config/api.js +56 -7
  47. package/lib/commonjs/constants/index.js +120 -7
  48. package/lib/commonjs/context/AuthContext.js +345 -10
  49. package/lib/commonjs/hooks/useConnectedAccounts.js +111 -9
  50. package/lib/commonjs/hooks/useConnections.js +102 -8
  51. package/lib/commonjs/hooks/useCredentials.js +178 -10
  52. package/lib/commonjs/hooks/useUserConnections.js +148 -10
  53. package/lib/commonjs/index.js +439 -34
  54. package/lib/commonjs/services/apiClient.js +298 -8
  55. package/lib/commonjs/services/biometricPinService.js +180 -8
  56. package/lib/commonjs/services/chatGPTConversationExtractor.js +155 -8
  57. package/lib/commonjs/services/chatGPTConversationService.js +275 -9
  58. package/lib/commonjs/services/claudeConversationExtractor.js +103 -8
  59. package/lib/commonjs/services/claudeConversationService.js +158 -9
  60. package/lib/commonjs/services/connectedAccountsService.js +310 -10
  61. package/lib/commonjs/services/googleAuthService.js +252 -11
  62. package/lib/commonjs/services/hingeDataExtractor.js +105 -8
  63. package/lib/commonjs/services/hingeDataService.js +150 -9
  64. package/lib/commonjs/services/imageCompressionService.js +260 -7
  65. package/lib/commonjs/services/instagramDataExtractor.js +126 -8
  66. package/lib/commonjs/services/instagramDataService.js +163 -9
  67. package/lib/commonjs/services/jwtStorageService.js +276 -7
  68. package/lib/commonjs/services/linkedinDOMExtractor.js +245 -7
  69. package/lib/commonjs/services/linkedinProfileService.js +222 -9
  70. package/lib/commonjs/services/linkedinScrapingService.js +230 -8
  71. package/lib/commonjs/services/llmDataStorage.js +294 -8
  72. package/lib/commonjs/services/mobileTrainingService.js +186 -8
  73. package/lib/commonjs/services/netflixDataExtractor.js +120 -8
  74. package/lib/commonjs/services/netflixDataService.js +198 -9
  75. package/lib/commonjs/services/pinEncryptionService.js +84 -8
  76. package/lib/commonjs/services/pinStorageUtils.js +105 -7
  77. package/lib/commonjs/services/platformAuthService.js +1484 -12
  78. package/lib/commonjs/services/sephoraDataExtractor.js +140 -8
  79. package/lib/commonjs/services/sephoraDataService.js +200 -9
  80. package/lib/commonjs/services/spotifyDataExtractor.js +148 -8
  81. package/lib/commonjs/services/spotifyDataService.js +241 -9
  82. package/lib/commonjs/services/storageService.js +404 -8
  83. package/lib/commonjs/services/telegramDataExtractor.js +115 -8
  84. package/lib/commonjs/services/telegramDataService.js +499 -9
  85. package/lib/commonjs/services/trainingApiHelpers.js +73 -7
  86. package/lib/commonjs/services/userConnectionsService.js +340 -10
  87. package/lib/commonjs/services/youtubeMigrationService.js +416 -10
  88. package/lib/commonjs/theme/index.js +250 -7
  89. package/lib/commonjs/types/ambient.d.js +2 -1
  90. package/lib/commonjs/types/declarations.d.js +2 -1
  91. package/lib/commonjs/types/index.js +6 -1
  92. package/lib/commonjs/types/node-fix.d.js +2 -1
  93. package/lib/commonjs/types/node-override.d.js +2 -1
  94. package/lib/commonjs/types/opacity.d.js +2 -1
  95. package/lib/commonjs/types.js +14 -1
  96. package/lib/commonjs/utils/Portal.js +98 -8
  97. package/lib/commonjs/utils/api.js +130 -9
  98. package/lib/commonjs/utils/assetRegistry.js +210 -35
  99. package/lib/commonjs/utils/auth.js +112 -9
  100. package/lib/commonjs/utils/connectorTests.js +613 -29
  101. package/lib/commonjs/utils/crypto.js +62 -8
  102. package/lib/commonjs/utils/debugHelper.js +64 -1
  103. package/lib/commonjs/utils/encryption.js +76 -7
  104. package/lib/commonjs/utils/eventUtils.js +288 -1
  105. package/lib/commonjs/utils/haptics.js +66 -9
  106. package/lib/commonjs/utils/imagePreloader.js +6 -1
  107. package/lib/commonjs/utils/networkDiagnostics.js +226 -8
  108. package/lib/commonjs/utils/onairosApi.js +350 -9
  109. package/lib/commonjs/utils/programmaticFlow.js +117 -9
  110. package/lib/commonjs/utils/retryHelper.js +220 -1
  111. package/lib/commonjs/utils/secureStorage.js +349 -10
  112. package/lib/commonjs/utils/webviewScripts/chatgpt.js +551 -1
  113. package/lib/commonjs/utils/webviewScripts/claude.js +376 -1
  114. package/lib/commonjs/utils/webviewScripts/hinge.js +411 -1
  115. package/lib/commonjs/utils/webviewScripts/index.js +698 -15
  116. package/lib/commonjs/utils/webviewScripts/instagram.js +454 -1
  117. package/lib/commonjs/utils/webviewScripts/linkedin.js +880 -1
  118. package/lib/commonjs/utils/webviewScripts/netflix.js +382 -1
  119. package/lib/commonjs/utils/webviewScripts/sephora.js +516 -1
  120. package/lib/commonjs/utils/webviewScripts/spotify.js +419 -1
  121. package/lib/commonjs/utils/webviewScripts/telegram.js +678 -1
  122. package/lib/module/api/index.js +211 -1
  123. package/lib/module/components/BodyText.js +20 -1
  124. package/lib/module/components/BrandMark.js +104 -1
  125. package/lib/module/components/CodeInput.js +109 -1
  126. package/lib/module/components/EmailInput.js +23 -1
  127. package/lib/module/components/GoogleButton.js +49 -1
  128. package/lib/module/components/HeadingGroup.js +36 -1
  129. package/lib/module/components/LLMDataInputModal.js +656 -7
  130. package/lib/module/components/ModalHeader.js +92 -1
  131. package/lib/module/components/ModalSheet.js +39 -1
  132. package/lib/module/components/Onairos.js +373 -1
  133. package/lib/module/components/OnairosButton.js +305 -1
  134. package/lib/module/components/OnairosSignInButton.js +121 -1
  135. package/lib/module/components/Overlay.js +456 -1
  136. package/lib/module/components/PersonaImage.js +129 -1
  137. package/lib/module/components/PersonaLoadingScreen.js +310 -1
  138. package/lib/module/components/PersonalizationConsentScreen.js +460 -1
  139. package/lib/module/components/PinCreationScreen.js +396 -1
  140. package/lib/module/components/PinInput.js +456 -1
  141. package/lib/module/components/PlatformConnectorsStep.js +1302 -6
  142. package/lib/module/components/PlatformList.js +129 -1
  143. package/lib/module/components/PlatformToggle.js +173 -1
  144. package/lib/module/components/PrimaryButton.js +172 -1
  145. package/lib/module/components/SignInMatchAnimation.js +189 -1
  146. package/lib/module/components/SignInStep.js +338 -1
  147. package/lib/module/components/UniversalOnboarding.js +2770 -1
  148. package/lib/module/components/VerificationStep.js +168 -1
  149. package/lib/module/components/WelcomeScreen.js +453 -1
  150. package/lib/module/components/icons/Basicproficon.js +30 -1
  151. package/lib/module/components/icons/Basicprofile.js +14 -1
  152. package/lib/module/components/icons/Checkbox.js +14 -1
  153. package/lib/module/components/icons/Checkmark.js +20 -1
  154. package/lib/module/components/icons/Contentanalysis.js +14 -1
  155. package/lib/module/components/icons/Contenticon.js +32 -1
  156. package/lib/module/components/icons/EnochE.js +34 -1
  157. package/lib/module/components/icons/Personalityicon.js +23 -1
  158. package/lib/module/components/icons/Personalityprofile.js +14 -1
  159. package/lib/module/components/icons/Personalitytraits.js +14 -1
  160. package/lib/module/components/icons/Userpreferences.js +14 -1
  161. package/lib/module/components/icons/index.js +13 -1
  162. package/lib/module/components/onboarding/OAuthWebView.js +1746 -1
  163. package/lib/module/components/onboarding/OnboardingHeader.js +66 -1
  164. package/lib/module/components/onboarding/PinInput.js +274 -1
  165. package/lib/module/components/onboarding/PlatformConnector.js +240 -1
  166. package/lib/module/config/PLATFORM_APIS.md +849 -0
  167. package/lib/module/config/api.js +47 -1
  168. package/lib/module/constants/index.js +114 -1
  169. package/lib/module/context/AuthContext.js +335 -1
  170. package/lib/module/hooks/useConnectedAccounts.js +106 -1
  171. package/lib/module/hooks/useConnections.js +95 -1
  172. package/lib/module/hooks/useCredentials.js +171 -6
  173. package/lib/module/hooks/useUserConnections.js +140 -1
  174. package/lib/module/index.js +172 -1
  175. package/lib/module/services/apiClient.js +295 -1
  176. package/lib/module/services/biometricPinService.js +169 -1
  177. package/lib/module/services/chatGPTConversationExtractor.js +149 -1
  178. package/lib/module/services/chatGPTConversationService.js +268 -1
  179. package/lib/module/services/claudeConversationExtractor.js +97 -1
  180. package/lib/module/services/claudeConversationService.js +151 -1
  181. package/lib/module/services/connectedAccountsService.js +293 -1
  182. package/lib/module/services/googleAuthService.js +241 -1
  183. package/lib/module/services/hingeDataExtractor.js +99 -1
  184. package/lib/module/services/hingeDataService.js +143 -1
  185. package/lib/module/services/imageCompressionService.js +250 -1
  186. package/lib/module/services/instagramDataExtractor.js +120 -1
  187. package/lib/module/services/instagramDataService.js +156 -1
  188. package/lib/module/services/jwtStorageService.js +257 -1
  189. package/lib/module/services/linkedinDOMExtractor.js +234 -1
  190. package/lib/module/services/linkedinProfileService.js +210 -1
  191. package/lib/module/services/linkedinScrapingService.js +219 -1
  192. package/lib/module/services/llmDataStorage.js +277 -1
  193. package/lib/module/services/mobileTrainingService.js +173 -1
  194. package/lib/module/services/netflixDataExtractor.js +114 -1
  195. package/lib/module/services/netflixDataService.js +191 -1
  196. package/lib/module/services/pinEncryptionService.js +74 -6
  197. package/lib/module/services/pinStorageUtils.js +93 -1
  198. package/lib/module/services/platformAuthService.js +1461 -1
  199. package/lib/module/services/sephoraDataExtractor.js +134 -1
  200. package/lib/module/services/sephoraDataService.js +193 -1
  201. package/lib/module/services/spotifyDataExtractor.js +142 -1
  202. package/lib/module/services/spotifyDataService.js +234 -1
  203. package/lib/module/services/storageService.js +383 -1
  204. package/lib/module/services/telegramDataExtractor.js +109 -1
  205. package/lib/module/services/telegramDataService.js +493 -1
  206. package/lib/module/services/trainingApiHelpers.js +67 -1
  207. package/lib/module/services/userConnectionsService.js +329 -1
  208. package/lib/module/services/youtubeMigrationService.js +405 -1
  209. package/lib/module/theme/index.js +245 -1
  210. package/lib/module/types.js +10 -1
  211. package/lib/module/utils/Portal.js +90 -1
  212. package/lib/module/utils/api.js +118 -1
  213. package/lib/module/utils/assetRegistry.js +200 -34
  214. package/lib/module/utils/auth.js +100 -1
  215. package/lib/module/utils/connectorTests.js +600 -27
  216. package/lib/module/utils/crypto.js +54 -1
  217. package/lib/module/utils/debugHelper.js +54 -1
  218. package/lib/module/utils/encryption.js +67 -1
  219. package/lib/module/utils/eventUtils.js +270 -1
  220. package/lib/module/utils/haptics.js +59 -8
  221. package/lib/module/utils/imagePreloader.js +3 -1
  222. package/lib/module/utils/networkDiagnostics.js +217 -1
  223. package/lib/module/utils/onairosApi.js +333 -1
  224. package/lib/module/utils/programmaticFlow.js +111 -1
  225. package/lib/module/utils/retryHelper.js +211 -1
  226. package/lib/module/utils/secureStorage.js +330 -6
  227. package/lib/module/utils/webviewScripts/chatgpt.js +545 -1
  228. package/lib/module/utils/webviewScripts/claude.js +370 -1
  229. package/lib/module/utils/webviewScripts/hinge.js +405 -1
  230. package/lib/module/utils/webviewScripts/index.js +434 -1
  231. package/lib/module/utils/webviewScripts/instagram.js +448 -1
  232. package/lib/module/utils/webviewScripts/linkedin.js +874 -1
  233. package/lib/module/utils/webviewScripts/netflix.js +376 -1
  234. package/lib/module/utils/webviewScripts/sephora.js +510 -1
  235. package/lib/module/utils/webviewScripts/spotify.js +413 -1
  236. package/lib/module/utils/webviewScripts/telegram.js +672 -1
  237. package/package.json +2 -2
@@ -1 +1,516 @@
1
- 'use strict';Object['defineProperty'](exports,_0x35e0(0x0),{'value':!![]}),exports[_0x35e0(0x1)]=exports['SEPHORA_EXPORT_SCRIPT']=exports[_0x35e0(0x2)]=exports[_0x35e0(0x3)]=void 0x0;function _0x35e0(_0x33100d,_0x35e065){_0x33100d=_0x33100d-0x0;const _0x42d226=_0x3310();let _0x4ab974=_0x42d226[_0x33100d];return _0x4ab974;}function _0x3310(){const _0x56068e=['__esModule','SEPHORA_SUCCESS_SCRIPT','SEPHORA_ERROR_SCRIPT','SEPHORA_CONSENT_POPUP_SCRIPT','SEPHORA_EXPORT_SCRIPT','\x0a(function()\x20{\x0a\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27🔄\x20[SEPHORA]\x20Script\x20version:\x20SDK_V1\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27DEBUG_LOG\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Sephora\x20Script\x20version:\x20SDK_V1\x20loaded\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(!document.body)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_ERROR\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Page\x20not\x20ready\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return;\x0a\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20============================================================\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER\x20API\x20CONFIGURATION\x20-\x20REPLACE\x20WITH\x20ACTUAL\x20ENDPOINTS\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20============================================================\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20SEPHORA_CONFIG\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Base\x20URL\x20for\x20Sephora\x20API\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20baseUrl:\x20\x27https://www.sephora.com\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20apiBase:\x20\x27https://api.sephora.com\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20API\x20Endpoints\x20-\x20PLACEHOLDERS\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20endpoints:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Shopping\x20basket\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20basket:\x20\x27/api/basket\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cart:\x20\x27/api/v3/users/current/basket\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Order\x20history\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orders:\x20\x27/api/v3/users/current/orders\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orderHistory:\x20\x27/api/users/orders\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Favorites/Loves\x20list\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20loves:\x20\x27/api/v3/users/current/loves\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20favorites:\x20\x27/api/users/favorites\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Product\x20ratings/reviews\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ratings:\x20\x27/api/v3/users/current/ratings\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Beauty\x20profile/preferences\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20beautyProfile:\x20\x27/api/v3/users/current/beauty-profile\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20User\x20info\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20userInfo:\x20\x27/api/v3/users/current\x27,\x20\x20//\x20PLACEHOLDER\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Extract\x20authentication\x20data\x20from\x20cookies/page\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20getAuth:\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20auth\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20token:\x20null,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20userId:\x20null,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20sessionId:\x20null,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Check\x20for\x20auth\x20token\x20in\x20cookies\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20tokenMatch\x20=\x20document.cookie.match(/sephora_token=([^;]+)/);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(tokenMatch)\x20auth.token\x20=\x20tokenMatch[1];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Alternative:\x20check\x20for\x20bearer\x20token\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20bearerMatch\x20=\x20document.cookie.match(/access_token=([^;]+)/);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(bearerMatch)\x20auth.token\x20=\x20bearerMatch[1];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Check\x20for\x20session\x20ID\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20sessionMatch\x20=\x20document.cookie.match(/JSESSIONID=([^;]+)/);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(sessionMatch)\x20auth.sessionId\x20=\x20sessionMatch[1];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Try\x20to\x20get\x20user\x20ID\x20from\x20page\x20data\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Check\x20for\x20user\x20data\x20in\x20window\x20object\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(window.user\x20&&\x20window.user.id)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20auth.userId\x20=\x20window.user.id;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Check\x20for\x20SephoraData\x20object\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(window.SephoraData\x20&&\x20window.SephoraData.user)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20auth.userId\x20=\x20window.SephoraData.user.id;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Check\x20meta\x20tags\x20or\x20data\x20attributes\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20userMeta\x20=\x20document.querySelector(\x27meta[name=\x22user-id\x22]\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(userMeta)\x20auth.userId\x20=\x20userMeta.content;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(e)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Could\x20not\x20extract\x20user\x20data\x20from\x20page\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20return\x20auth;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Request\x20headers\x20template\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20getHeaders:\x20(auth)\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27Accept\x27:\x20\x27application/json\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27Content-Type\x27:\x20\x27application/json\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27Authorization\x27:\x20auth.token\x20?\x20\x27Bearer\x20\x27\x20+\x20auth.token\x20:\x20undefined,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x27X-Session-Id\x27:\x20auth.sessionId\x20||\x20undefined,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Sephora-specific\x20headers\x20-\x20PLACEHOLDERS\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20\x27X-Sephora-Client\x27:\x20\x27web\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20\x27X-Sephora-Version\x27:\x20\x271.0\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20})\x0a\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20//\x20============================================================\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27🚀\x20[SEPHORA]\x20Starting\x20extraction...\x27);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20(async\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x201:\x20Get\x20authentication\x20data\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_auth\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x202,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Getting\x20authentication...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Getting\x20auth\x20data...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20auth\x20=\x20SEPHORA_CONFIG.getAuth();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Auth:\x27,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hasToken:\x20!!auth.token,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hasSession:\x20!!auth.sessionId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20hasUserId:\x20!!auth.userId\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20headers\x20=\x20SEPHORA_CONFIG.getHeaders(auth);\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x202:\x20Fetch\x20current\x20basket/cart\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_basket\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2010,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetching\x20shopping\x20basket...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20basket\x20=\x20{\x20items:\x20[],\x20total:\x200\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Fetching\x20basket...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20basketResponse\x20=\x20await\x20fetch(SEPHORA_CONFIG.baseUrl\x20+\x20SEPHORA_CONFIG.endpoints.basket,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20method:\x20\x27GET\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20credentials:\x20\x27include\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20headers:\x20headers\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Basket\x20response:\x27,\x20basketResponse.status);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(basketResponse.ok)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20basketData\x20=\x20await\x20basketResponse.json();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20based\x20on\x20actual\x20API\x20response\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20basket\x20=\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20items:\x20basketData.items\x20||\x20basketData.products\x20||\x20[],\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20total:\x20basketData.total\x20||\x20basketData.subtotal\x20||\x200,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20itemCount:\x20basketData.itemCount\x20||\x20basketData.count\x20||\x200\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Basket\x20items:\x27,\x20basket.items.length);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(basketError)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[SEPHORA]\x20Basket\x20fetch\x20error:\x27,\x20basketError.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x203:\x20Fetch\x20order\x20history\x20(purchases)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_orders\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2030,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetching\x20purchase\x20history...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20orders\x20=\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Fetching\x20orders...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20ordersResponse\x20=\x20await\x20fetch(SEPHORA_CONFIG.baseUrl\x20+\x20SEPHORA_CONFIG.endpoints.orders,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20method:\x20\x27GET\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20credentials:\x20\x27include\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20headers:\x20headers\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Orders\x20response:\x27,\x20ordersResponse.status);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(ordersResponse.ok)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20ordersData\x20=\x20await\x20ordersResponse.json();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20based\x20on\x20actual\x20API\x20response\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orders\x20=\x20ordersData.orders\x20||\x20ordersData.data\x20||\x20ordersData\x20||\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Found\x27,\x20orders.length,\x20\x27orders\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(ordersError)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[SEPHORA]\x20Orders\x20fetch\x20error:\x27,\x20ordersError.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x204:\x20Fetch\x20loves/favorites\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_loves\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2050,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetching\x20favorites...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20loves\x20=\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Fetching\x20loves...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20lovesResponse\x20=\x20await\x20fetch(SEPHORA_CONFIG.baseUrl\x20+\x20SEPHORA_CONFIG.endpoints.loves,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20method:\x20\x27GET\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20credentials:\x20\x27include\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20headers:\x20headers\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Loves\x20response:\x27,\x20lovesResponse.status);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(lovesResponse.ok)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20lovesData\x20=\x20await\x20lovesResponse.json();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20based\x20on\x20actual\x20API\x20response\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20loves\x20=\x20lovesData.products\x20||\x20lovesData.items\x20||\x20lovesData.loves\x20||\x20lovesData\x20||\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Found\x27,\x20loves.length,\x20\x27loved\x20products\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(lovesError)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[SEPHORA]\x20Loves\x20fetch\x20error:\x27,\x20lovesError.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x205:\x20Fetch\x20product\x20ratings\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27fetching_ratings\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2070,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetching\x20ratings...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20let\x20ratings\x20=\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Fetching\x20ratings...\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20ratingsResponse\x20=\x20await\x20fetch(SEPHORA_CONFIG.baseUrl\x20+\x20SEPHORA_CONFIG.endpoints.ratings,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20method:\x20\x27GET\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20credentials:\x20\x27include\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20headers:\x20headers\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Ratings\x20response:\x27,\x20ratingsResponse.status);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20if\x20(ratingsResponse.ok)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20ratingsData\x20=\x20await\x20ratingsResponse.json();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20PLACEHOLDER:\x20Adjust\x20based\x20on\x20actual\x20API\x20response\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ratings\x20=\x20ratingsData.ratings\x20||\x20ratingsData.reviews\x20||\x20ratingsData\x20||\x20[];\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27[SEPHORA]\x20Found\x27,\x20ratings.length,\x20\x27ratings\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(ratingsError)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.warn(\x27[SEPHORA]\x20Ratings\x20fetch\x20error:\x27,\x20ratingsError.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x206:\x20Process\x20and\x20format\x20data\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_PROGRESS\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20stage:\x20\x27processing\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20progress:\x2085,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Processing\x20data...\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Format\x20basket\x20items\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20formattedBasket\x20=\x20basket.items.map(item\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20id:\x20item.id\x20||\x20item.skuId\x20||\x20item.productId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20name:\x20item.displayName\x20||\x20item.name\x20||\x20item.productName,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20brand:\x20item.brand\x20||\x20item.brandName,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20price:\x20item.price\x20||\x20item.currentPrice,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20quantity:\x20item.quantity\x20||\x201,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20category:\x20item.category\x20||\x20item.productCategory,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20imageUrl:\x20item.image\x20||\x20item.heroImage,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Format\x20orders\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20formattedOrders\x20=\x20orders.slice(0,\x2050).map(order\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orderId:\x20order.id\x20||\x20order.orderId\x20||\x20order.orderNumber,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20date:\x20order.date\x20||\x20order.orderDate\x20||\x20order.createdAt,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20total:\x20order.total\x20||\x20order.orderTotal,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20order.status\x20||\x20order.orderStatus,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20items:\x20(order.items\x20||\x20order.products\x20||\x20[]).map(item\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20id:\x20item.id\x20||\x20item.skuId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20name:\x20item.displayName\x20||\x20item.name,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20brand:\x20item.brand,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20price:\x20item.price,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20quantity:\x20item.quantity\x20||\x201,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}))\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Format\x20loved/favorited\x20products\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20formattedLoves\x20=\x20loves.slice(0,\x20100).map(item\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20id:\x20item.id\x20||\x20item.skuId\x20||\x20item.productId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20name:\x20item.displayName\x20||\x20item.name\x20||\x20item.productName,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20brand:\x20item.brand\x20||\x20item.brandName,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20category:\x20item.category\x20||\x20item.productCategory,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20price:\x20item.price\x20||\x20item.currentPrice,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20rating:\x20item.rating\x20||\x20item.averageRating,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20addedAt:\x20item.addedAt\x20||\x20item.createdAt,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27love\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20Format\x20ratings\x20(could\x20indicate\x20dislikes\x20if\x20rating\x20is\x20low)\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20const\x20formattedRatings\x20=\x20ratings.slice(0,\x2050).map(rating\x20=>\x20({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20productId:\x20rating.productId\x20||\x20rating.skuId,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20productName:\x20rating.productName\x20||\x20rating.displayName,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20rating:\x20rating.rating\x20||\x20rating.score,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20review:\x20rating.review\x20||\x20rating.text\x20||\x20\x27\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20date:\x20rating.date\x20||\x20rating.createdAt,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20isRecommended:\x20rating.isRecommended\x20||\x20rating.recommend,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20(rating.rating\x20>=\x204)\x20?\x20\x27positive\x27\x20:\x20(rating.rating\x20<=\x202)\x20?\x20\x27negative\x27\x20:\x20\x27neutral\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20//\x20STEP\x207:\x20Send\x20results\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.log(\x27✅\x20[SEPHORA]\x20Extraction\x20complete:\x27,\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20basket:\x20formattedBasket.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orders:\x20formattedOrders.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20loves:\x20formattedLoves.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ratings:\x20formattedRatings.length\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20});\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_COMPLETE\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27success\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20data:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20basket:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20items:\x20formattedBasket,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20total:\x20basket.total,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20itemCount:\x20formattedBasket.length\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20orders:\x20formattedOrders,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20loves:\x20formattedLoves,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20ratings:\x20formattedRatings,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20summary:\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20totalBasketItems:\x20formattedBasket.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20totalOrders:\x20formattedOrders.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20totalLovedProducts:\x20formattedLoves.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20totalRatings:\x20formattedRatings.length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20positiveRatings:\x20formattedRatings.filter(r\x20=>\x20r.type\x20===\x20\x27positive\x27).length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20negativeRatings:\x20formattedRatings.filter(r\x20=>\x20r.type\x20===\x20\x27negative\x27).length,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20userId:\x20auth.userId\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20},\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20success:\x20true\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x20catch\x20(error)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20console.error(\x27❌\x20[SEPHORA]\x20Export\x20failed:\x27,\x20error.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_ERROR\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Fetch\x20failed:\x20\x27\x20+\x20error.message,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20success:\x20false\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}\x0a\x20\x20\x20\x20\x20\x20\x20\x20})();\x0a\x0a\x20\x20\x20\x20}\x20catch\x20(error)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20console.error(\x27❌\x20[SEPHORA]\x20Init\x20error:\x27,\x20error.message);\x0a\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_EXPORT_ERROR\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20\x27Script\x20error:\x20\x27\x20+\x20error.message,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20success:\x20false\x0a\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20}\x0a})();\x0atrue;\x0a','\x0a(function()\x20{\x0a\x20\x20\x20\x20console.log(\x27✅\x20Sephora\x20export\x20successful!\x27);\x0a})();\x0atrue;\x0a','\x0a(function()\x20{\x0a\x20\x20\x20\x20console.log(\x27❌\x20Sephora\x20export\x20failed!\x27);\x0a})();\x0atrue;\x0a'];_0x3310=function(){return _0x56068e;};return _0x3310();}const SEPHORA_CONSENT_POPUP_SCRIPT=exports[_0x35e0(0x3)]='\x0a(function()\x20{\x0a\x20\x20\x20\x20try\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20existing\x20=\x20document.getElementById(\x27onairos-consent-overlay\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20if\x20(existing)\x20existing.remove();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20overlay\x20=\x20document.createElement(\x27div\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20overlay.id\x20=\x20\x27onairos-consent-overlay\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20overlay.style.cssText\x20=\x20`\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20position:\x20fixed;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20top:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20left:\x200;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x20100%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20height:\x20100%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20rgba(0,\x200,\x200,\x200.7);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20z-index:\x20999999;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20display:\x20flex;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20align-items:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20justify-content:\x20center;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-family:\x20-apple-system,\x20BlinkMacSystemFont,\x20\x27Segoe\x20UI\x27,\x20Roboto,\x20sans-serif;\x0a\x20\x20\x20\x20\x20\x20\x20\x20`;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20const\x20popup\x20=\x20document.createElement(\x27div\x27);\x0a\x20\x20\x20\x20\x20\x20\x20\x20popup.style.cssText\x20=\x20`\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20white;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x2016px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2032px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20max-width:\x20400px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20width:\x2090%;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20box-shadow:\x200\x2020px\x2060px\x20rgba(0,\x200,\x200,\x200.3);\x0a\x20\x20\x20\x20\x20\x20\x20\x20`;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20popup.innerHTML\x20=\x20`\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20style=\x22text-align:\x20center;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20style=\x22font-size:\x2048px;\x20margin-bottom:\x2016px;\x22>💄</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<h2\x20style=\x22margin:\x200\x200\x2012px\x200;\x20font-size:\x2024px;\x20color:\x20#1a1a1a;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Export\x20Sephora\x20Data?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</h2>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<p\x20style=\x22margin:\x200\x200\x2024px\x200;\x20color:\x20#666;\x20font-size:\x2016px;\x20line-height:\x201.5;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20Allow\x20Onairos\x20to\x20export\x20your\x20Sephora\x20shopping\x20activity\x20(basket,\x20favorites,\x20purchases)\x20for\x20analysis?\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</p>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20style=\x22display:\x20flex;\x20gap:\x2012px;\x20justify-content:\x20center;\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20id=\x22onairos-deny\x22\x20style=\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20flex:\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2014px\x2024px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x202px\x20solid\x20#e0e0e0;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20white;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20#666;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x208px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2016px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-weight:\x20600;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22>Deny</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20id=\x22onairos-allow\x22\x20style=\x22\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20flex:\x201;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20padding:\x2014px\x2024px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border:\x20none;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20background:\x20linear-gradient(135deg,\x20#000000\x200%,\x20#333333\x20100%);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20color:\x20white;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20border-radius:\x208px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-size:\x2016px;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20font-weight:\x20600;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20cursor:\x20pointer;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x22>Allow</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20`;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20overlay.appendChild(popup);\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.body.appendChild(overlay);\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-deny\x27).onclick\x20=\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20overlay.remove();\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_CONSENT\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27denied\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-allow\x27).onclick\x20=\x20()\x20=>\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-allow\x27).innerHTML\x20=\x20\x27⏳\x20Starting...\x27;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20document.getElementById(\x27onairos-allow\x27).disabled\x20=\x20true;\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_CONSENT\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27allowed\x27\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20setTimeout(()\x20=>\x20overlay.remove(),\x20500);\x0a\x20\x20\x20\x20\x20\x20\x20\x20};\x0a\x20\x20\x20\x20}\x20catch\x20(error)\x20{\x0a\x20\x20\x20\x20\x20\x20\x20\x20window.ReactNativeWebView.postMessage(JSON.stringify({\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20type:\x20\x27SEPHORA_CONSENT\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20status:\x20\x27error\x27,\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20message:\x20error.message\x0a\x20\x20\x20\x20\x20\x20\x20\x20}));\x0a\x20\x20\x20\x20}\x0a})();\x0atrue;\x0a',SEPHORA_EXPORT_SCRIPT=exports[_0x35e0(0x4)]=_0x35e0(0x5),SEPHORA_SUCCESS_SCRIPT=exports['SEPHORA_SUCCESS_SCRIPT']=_0x35e0(0x6),SEPHORA_ERROR_SCRIPT=exports[_0x35e0(0x2)]=_0x35e0(0x7);
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SEPHORA_SUCCESS_SCRIPT = exports.SEPHORA_EXPORT_SCRIPT = exports.SEPHORA_ERROR_SCRIPT = exports.SEPHORA_CONSENT_POPUP_SCRIPT = void 0;
7
+ /**
8
+ * Sephora WebView Injection Scripts
9
+ *
10
+ * JavaScript code injected into Sephora WebView to:
11
+ * 1. Show consent popup for user approval
12
+ * 2. Fetch user shopping data (basket, purchases, favorites)
13
+ * 3. Extract product preferences data
14
+ * 4. Track progress during export
15
+ * 5. Send data back to React Native
16
+ *
17
+ * @reference ChatGPT implementation: src/utils/webviewScripts/chatgpt.ts
18
+ *
19
+ * NOTE: API endpoints and token structures are PLACEHOLDERS
20
+ * Sephora uses multiple APIs for different data types (like Gemini pattern)
21
+ */
22
+
23
+ /**
24
+ * Consent Popup Script
25
+ * Shows user consent UI before exporting data
26
+ */
27
+ const SEPHORA_CONSENT_POPUP_SCRIPT = exports.SEPHORA_CONSENT_POPUP_SCRIPT = `
28
+ (function() {
29
+ try {
30
+ const existing = document.getElementById('onairos-consent-overlay');
31
+ if (existing) existing.remove();
32
+
33
+ const overlay = document.createElement('div');
34
+ overlay.id = 'onairos-consent-overlay';
35
+ overlay.style.cssText = \`
36
+ position: fixed;
37
+ top: 0;
38
+ left: 0;
39
+ width: 100%;
40
+ height: 100%;
41
+ background: rgba(0, 0, 0, 0.7);
42
+ z-index: 999999;
43
+ display: flex;
44
+ align-items: center;
45
+ justify-content: center;
46
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
47
+ \`;
48
+
49
+ const popup = document.createElement('div');
50
+ popup.style.cssText = \`
51
+ background: white;
52
+ border-radius: 16px;
53
+ padding: 32px;
54
+ max-width: 400px;
55
+ width: 90%;
56
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
57
+ \`;
58
+
59
+ popup.innerHTML = \`
60
+ <div style="text-align: center;">
61
+ <div style="font-size: 48px; margin-bottom: 16px;">💄</div>
62
+ <h2 style="margin: 0 0 12px 0; font-size: 24px; color: #1a1a1a;">
63
+ Export Sephora Data?
64
+ </h2>
65
+ <p style="margin: 0 0 24px 0; color: #666; font-size: 16px; line-height: 1.5;">
66
+ Allow Onairos to export your Sephora shopping activity (basket, favorites, purchases) for analysis?
67
+ </p>
68
+ <div style="display: flex; gap: 12px; justify-content: center;">
69
+ <button id="onairos-deny" style="
70
+ flex: 1;
71
+ padding: 14px 24px;
72
+ border: 2px solid #e0e0e0;
73
+ background: white;
74
+ color: #666;
75
+ border-radius: 8px;
76
+ font-size: 16px;
77
+ font-weight: 600;
78
+ cursor: pointer;
79
+ ">Deny</button>
80
+ <button id="onairos-allow" style="
81
+ flex: 1;
82
+ padding: 14px 24px;
83
+ border: none;
84
+ background: linear-gradient(135deg, #000000 0%, #333333 100%);
85
+ color: white;
86
+ border-radius: 8px;
87
+ font-size: 16px;
88
+ font-weight: 600;
89
+ cursor: pointer;
90
+ ">Allow</button>
91
+ </div>
92
+ </div>
93
+ \`;
94
+
95
+ overlay.appendChild(popup);
96
+ document.body.appendChild(overlay);
97
+
98
+ document.getElementById('onairos-deny').onclick = () => {
99
+ overlay.remove();
100
+ window.ReactNativeWebView.postMessage(JSON.stringify({
101
+ type: 'SEPHORA_CONSENT',
102
+ status: 'denied'
103
+ }));
104
+ };
105
+
106
+ document.getElementById('onairos-allow').onclick = () => {
107
+ document.getElementById('onairos-allow').innerHTML = '⏳ Starting...';
108
+ document.getElementById('onairos-allow').disabled = true;
109
+
110
+ window.ReactNativeWebView.postMessage(JSON.stringify({
111
+ type: 'SEPHORA_CONSENT',
112
+ status: 'allowed'
113
+ }));
114
+
115
+ setTimeout(() => overlay.remove(), 500);
116
+ };
117
+ } catch (error) {
118
+ window.ReactNativeWebView.postMessage(JSON.stringify({
119
+ type: 'SEPHORA_CONSENT',
120
+ status: 'error',
121
+ message: error.message
122
+ }));
123
+ }
124
+ })();
125
+ true;
126
+ `;
127
+
128
+ /**
129
+ * Export Script - Sephora data extraction
130
+ *
131
+ * Sephora has multiple APIs (similar to Gemini pattern):
132
+ * 1. Cart/Basket API
133
+ * 2. Order History API
134
+ * 3. Loves/Favorites API
135
+ * 4. Product recommendations/ratings
136
+ *
137
+ * TODO: Fill in actual API endpoints once known:
138
+ * - BASKET_ENDPOINT: Current shopping basket
139
+ * - ORDERS_ENDPOINT: Purchase history
140
+ * - LOVES_ENDPOINT: Liked/favorited products
141
+ * - PROFILE_ENDPOINT: User beauty profile
142
+ */
143
+ const SEPHORA_EXPORT_SCRIPT = exports.SEPHORA_EXPORT_SCRIPT = `
144
+ (function() {
145
+ try {
146
+ console.log('🔄 [SEPHORA] Script version: SDK_V1');
147
+ window.ReactNativeWebView.postMessage(JSON.stringify({
148
+ type: 'DEBUG_LOG',
149
+ message: 'Sephora Script version: SDK_V1 loaded'
150
+ }));
151
+
152
+ if (!document.body) {
153
+ window.ReactNativeWebView.postMessage(JSON.stringify({
154
+ type: 'SEPHORA_EXPORT_ERROR',
155
+ message: 'Page not ready'
156
+ }));
157
+ return;
158
+ }
159
+
160
+ // ============================================================
161
+ // PLACEHOLDER API CONFIGURATION - REPLACE WITH ACTUAL ENDPOINTS
162
+ // ============================================================
163
+ const SEPHORA_CONFIG = {
164
+ // Base URL for Sephora API
165
+ baseUrl: 'https://www.sephora.com',
166
+ apiBase: 'https://api.sephora.com', // PLACEHOLDER
167
+
168
+ // API Endpoints - PLACEHOLDERS
169
+ endpoints: {
170
+ // Shopping basket
171
+ basket: '/api/basket', // PLACEHOLDER
172
+ cart: '/api/v3/users/current/basket', // PLACEHOLDER
173
+
174
+ // Order history
175
+ orders: '/api/v3/users/current/orders', // PLACEHOLDER
176
+ orderHistory: '/api/users/orders', // PLACEHOLDER
177
+
178
+ // Favorites/Loves list
179
+ loves: '/api/v3/users/current/loves', // PLACEHOLDER
180
+ favorites: '/api/users/favorites', // PLACEHOLDER
181
+
182
+ // Product ratings/reviews
183
+ ratings: '/api/v3/users/current/ratings', // PLACEHOLDER
184
+
185
+ // Beauty profile/preferences
186
+ beautyProfile: '/api/v3/users/current/beauty-profile', // PLACEHOLDER
187
+
188
+ // User info
189
+ userInfo: '/api/v3/users/current', // PLACEHOLDER
190
+ },
191
+
192
+ // Extract authentication data from cookies/page
193
+ getAuth: () => {
194
+ const auth = {
195
+ token: null,
196
+ userId: null,
197
+ sessionId: null,
198
+ };
199
+
200
+ // Check for auth token in cookies
201
+ const tokenMatch = document.cookie.match(/sephora_token=([^;]+)/);
202
+ if (tokenMatch) auth.token = tokenMatch[1];
203
+
204
+ // Alternative: check for bearer token
205
+ const bearerMatch = document.cookie.match(/access_token=([^;]+)/);
206
+ if (bearerMatch) auth.token = bearerMatch[1];
207
+
208
+ // Check for session ID
209
+ const sessionMatch = document.cookie.match(/JSESSIONID=([^;]+)/);
210
+ if (sessionMatch) auth.sessionId = sessionMatch[1];
211
+
212
+ // Try to get user ID from page data
213
+ try {
214
+ // Check for user data in window object
215
+ if (window.user && window.user.id) {
216
+ auth.userId = window.user.id;
217
+ }
218
+ // Check for SephoraData object
219
+ if (window.SephoraData && window.SephoraData.user) {
220
+ auth.userId = window.SephoraData.user.id;
221
+ }
222
+ // Check meta tags or data attributes
223
+ const userMeta = document.querySelector('meta[name="user-id"]');
224
+ if (userMeta) auth.userId = userMeta.content;
225
+ } catch (e) {
226
+ console.log('[SEPHORA] Could not extract user data from page');
227
+ }
228
+
229
+ return auth;
230
+ },
231
+
232
+ // Request headers template
233
+ getHeaders: (auth) => ({
234
+ 'Accept': 'application/json',
235
+ 'Content-Type': 'application/json',
236
+ 'Authorization': auth.token ? 'Bearer ' + auth.token : undefined,
237
+ 'X-Session-Id': auth.sessionId || undefined,
238
+ // Sephora-specific headers - PLACEHOLDERS
239
+ // 'X-Sephora-Client': 'web',
240
+ // 'X-Sephora-Version': '1.0',
241
+ })
242
+ };
243
+ // ============================================================
244
+
245
+ console.log('🚀 [SEPHORA] Starting extraction...');
246
+
247
+ (async () => {
248
+ try {
249
+ // STEP 1: Get authentication data
250
+ window.ReactNativeWebView.postMessage(JSON.stringify({
251
+ type: 'SEPHORA_EXPORT_PROGRESS',
252
+ stage: 'fetching_auth',
253
+ progress: 2,
254
+ message: 'Getting authentication...'
255
+ }));
256
+
257
+ console.log('[SEPHORA] Getting auth data...');
258
+ const auth = SEPHORA_CONFIG.getAuth();
259
+ console.log('[SEPHORA] Auth:', {
260
+ hasToken: !!auth.token,
261
+ hasSession: !!auth.sessionId,
262
+ hasUserId: !!auth.userId
263
+ });
264
+
265
+ const headers = SEPHORA_CONFIG.getHeaders(auth);
266
+
267
+ // STEP 2: Fetch current basket/cart
268
+ window.ReactNativeWebView.postMessage(JSON.stringify({
269
+ type: 'SEPHORA_EXPORT_PROGRESS',
270
+ stage: 'fetching_basket',
271
+ progress: 10,
272
+ message: 'Fetching shopping basket...'
273
+ }));
274
+
275
+ let basket = { items: [], total: 0 };
276
+ console.log('[SEPHORA] Fetching basket...');
277
+
278
+ try {
279
+ const basketResponse = await fetch(SEPHORA_CONFIG.baseUrl + SEPHORA_CONFIG.endpoints.basket, {
280
+ method: 'GET',
281
+ credentials: 'include',
282
+ headers: headers
283
+ });
284
+
285
+ console.log('[SEPHORA] Basket response:', basketResponse.status);
286
+
287
+ if (basketResponse.ok) {
288
+ const basketData = await basketResponse.json();
289
+ // PLACEHOLDER: Adjust based on actual API response
290
+ basket = {
291
+ items: basketData.items || basketData.products || [],
292
+ total: basketData.total || basketData.subtotal || 0,
293
+ itemCount: basketData.itemCount || basketData.count || 0
294
+ };
295
+ console.log('[SEPHORA] Basket items:', basket.items.length);
296
+ }
297
+ } catch (basketError) {
298
+ console.warn('[SEPHORA] Basket fetch error:', basketError.message);
299
+ }
300
+
301
+ // STEP 3: Fetch order history (purchases)
302
+ window.ReactNativeWebView.postMessage(JSON.stringify({
303
+ type: 'SEPHORA_EXPORT_PROGRESS',
304
+ stage: 'fetching_orders',
305
+ progress: 30,
306
+ message: 'Fetching purchase history...'
307
+ }));
308
+
309
+ let orders = [];
310
+ console.log('[SEPHORA] Fetching orders...');
311
+
312
+ try {
313
+ const ordersResponse = await fetch(SEPHORA_CONFIG.baseUrl + SEPHORA_CONFIG.endpoints.orders, {
314
+ method: 'GET',
315
+ credentials: 'include',
316
+ headers: headers
317
+ });
318
+
319
+ console.log('[SEPHORA] Orders response:', ordersResponse.status);
320
+
321
+ if (ordersResponse.ok) {
322
+ const ordersData = await ordersResponse.json();
323
+ // PLACEHOLDER: Adjust based on actual API response
324
+ orders = ordersData.orders || ordersData.data || ordersData || [];
325
+ console.log('[SEPHORA] Found', orders.length, 'orders');
326
+ }
327
+ } catch (ordersError) {
328
+ console.warn('[SEPHORA] Orders fetch error:', ordersError.message);
329
+ }
330
+
331
+ // STEP 4: Fetch loves/favorites
332
+ window.ReactNativeWebView.postMessage(JSON.stringify({
333
+ type: 'SEPHORA_EXPORT_PROGRESS',
334
+ stage: 'fetching_loves',
335
+ progress: 50,
336
+ message: 'Fetching favorites...'
337
+ }));
338
+
339
+ let loves = [];
340
+ console.log('[SEPHORA] Fetching loves...');
341
+
342
+ try {
343
+ const lovesResponse = await fetch(SEPHORA_CONFIG.baseUrl + SEPHORA_CONFIG.endpoints.loves, {
344
+ method: 'GET',
345
+ credentials: 'include',
346
+ headers: headers
347
+ });
348
+
349
+ console.log('[SEPHORA] Loves response:', lovesResponse.status);
350
+
351
+ if (lovesResponse.ok) {
352
+ const lovesData = await lovesResponse.json();
353
+ // PLACEHOLDER: Adjust based on actual API response
354
+ loves = lovesData.products || lovesData.items || lovesData.loves || lovesData || [];
355
+ console.log('[SEPHORA] Found', loves.length, 'loved products');
356
+ }
357
+ } catch (lovesError) {
358
+ console.warn('[SEPHORA] Loves fetch error:', lovesError.message);
359
+ }
360
+
361
+ // STEP 5: Fetch product ratings
362
+ window.ReactNativeWebView.postMessage(JSON.stringify({
363
+ type: 'SEPHORA_EXPORT_PROGRESS',
364
+ stage: 'fetching_ratings',
365
+ progress: 70,
366
+ message: 'Fetching ratings...'
367
+ }));
368
+
369
+ let ratings = [];
370
+ console.log('[SEPHORA] Fetching ratings...');
371
+
372
+ try {
373
+ const ratingsResponse = await fetch(SEPHORA_CONFIG.baseUrl + SEPHORA_CONFIG.endpoints.ratings, {
374
+ method: 'GET',
375
+ credentials: 'include',
376
+ headers: headers
377
+ });
378
+
379
+ console.log('[SEPHORA] Ratings response:', ratingsResponse.status);
380
+
381
+ if (ratingsResponse.ok) {
382
+ const ratingsData = await ratingsResponse.json();
383
+ // PLACEHOLDER: Adjust based on actual API response
384
+ ratings = ratingsData.ratings || ratingsData.reviews || ratingsData || [];
385
+ console.log('[SEPHORA] Found', ratings.length, 'ratings');
386
+ }
387
+ } catch (ratingsError) {
388
+ console.warn('[SEPHORA] Ratings fetch error:', ratingsError.message);
389
+ }
390
+
391
+ // STEP 6: Process and format data
392
+ window.ReactNativeWebView.postMessage(JSON.stringify({
393
+ type: 'SEPHORA_EXPORT_PROGRESS',
394
+ stage: 'processing',
395
+ progress: 85,
396
+ message: 'Processing data...'
397
+ }));
398
+
399
+ // Format basket items
400
+ const formattedBasket = basket.items.map(item => ({
401
+ id: item.id || item.skuId || item.productId,
402
+ name: item.displayName || item.name || item.productName,
403
+ brand: item.brand || item.brandName,
404
+ price: item.price || item.currentPrice,
405
+ quantity: item.quantity || 1,
406
+ category: item.category || item.productCategory,
407
+ imageUrl: item.image || item.heroImage,
408
+ }));
409
+
410
+ // Format orders
411
+ const formattedOrders = orders.slice(0, 50).map(order => ({
412
+ orderId: order.id || order.orderId || order.orderNumber,
413
+ date: order.date || order.orderDate || order.createdAt,
414
+ total: order.total || order.orderTotal,
415
+ status: order.status || order.orderStatus,
416
+ items: (order.items || order.products || []).map(item => ({
417
+ id: item.id || item.skuId,
418
+ name: item.displayName || item.name,
419
+ brand: item.brand,
420
+ price: item.price,
421
+ quantity: item.quantity || 1,
422
+ }))
423
+ }));
424
+
425
+ // Format loved/favorited products
426
+ const formattedLoves = loves.slice(0, 100).map(item => ({
427
+ id: item.id || item.skuId || item.productId,
428
+ name: item.displayName || item.name || item.productName,
429
+ brand: item.brand || item.brandName,
430
+ category: item.category || item.productCategory,
431
+ price: item.price || item.currentPrice,
432
+ rating: item.rating || item.averageRating,
433
+ addedAt: item.addedAt || item.createdAt,
434
+ type: 'love'
435
+ }));
436
+
437
+ // Format ratings (could indicate dislikes if rating is low)
438
+ const formattedRatings = ratings.slice(0, 50).map(rating => ({
439
+ productId: rating.productId || rating.skuId,
440
+ productName: rating.productName || rating.displayName,
441
+ rating: rating.rating || rating.score,
442
+ review: rating.review || rating.text || '',
443
+ date: rating.date || rating.createdAt,
444
+ isRecommended: rating.isRecommended || rating.recommend,
445
+ type: (rating.rating >= 4) ? 'positive' : (rating.rating <= 2) ? 'negative' : 'neutral'
446
+ }));
447
+
448
+ // STEP 7: Send results
449
+ console.log('✅ [SEPHORA] Extraction complete:', {
450
+ basket: formattedBasket.length,
451
+ orders: formattedOrders.length,
452
+ loves: formattedLoves.length,
453
+ ratings: formattedRatings.length
454
+ });
455
+
456
+ window.ReactNativeWebView.postMessage(JSON.stringify({
457
+ type: 'SEPHORA_EXPORT_COMPLETE',
458
+ status: 'success',
459
+ data: {
460
+ basket: {
461
+ items: formattedBasket,
462
+ total: basket.total,
463
+ itemCount: formattedBasket.length
464
+ },
465
+ orders: formattedOrders,
466
+ loves: formattedLoves,
467
+ ratings: formattedRatings,
468
+ summary: {
469
+ totalBasketItems: formattedBasket.length,
470
+ totalOrders: formattedOrders.length,
471
+ totalLovedProducts: formattedLoves.length,
472
+ totalRatings: formattedRatings.length,
473
+ positiveRatings: formattedRatings.filter(r => r.type === 'positive').length,
474
+ negativeRatings: formattedRatings.filter(r => r.type === 'negative').length,
475
+ },
476
+ userId: auth.userId
477
+ },
478
+ success: true
479
+ }));
480
+
481
+ } catch (error) {
482
+ console.error('❌ [SEPHORA] Export failed:', error.message);
483
+ window.ReactNativeWebView.postMessage(JSON.stringify({
484
+ type: 'SEPHORA_EXPORT_ERROR',
485
+ status: 'error',
486
+ message: 'Fetch failed: ' + error.message,
487
+ success: false
488
+ }));
489
+ }
490
+ })();
491
+
492
+ } catch (error) {
493
+ console.error('❌ [SEPHORA] Init error:', error.message);
494
+ window.ReactNativeWebView.postMessage(JSON.stringify({
495
+ type: 'SEPHORA_EXPORT_ERROR',
496
+ status: 'error',
497
+ message: 'Script error: ' + error.message,
498
+ success: false
499
+ }));
500
+ }
501
+ })();
502
+ true;
503
+ `;
504
+ const SEPHORA_SUCCESS_SCRIPT = exports.SEPHORA_SUCCESS_SCRIPT = `
505
+ (function() {
506
+ console.log('✅ Sephora export successful!');
507
+ })();
508
+ true;
509
+ `;
510
+ const SEPHORA_ERROR_SCRIPT = exports.SEPHORA_ERROR_SCRIPT = `
511
+ (function() {
512
+ console.log('❌ Sephora export failed!');
513
+ })();
514
+ true;
515
+ `;
516
+ //# sourceMappingURL=sephora.js.map