@velion-la/onboarding-sdk-react-native 1.0.0-beta.2

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 (557) hide show
  1. package/CHANGELOG.md +66 -0
  2. package/LICENSE +12 -0
  3. package/README.md +803 -0
  4. package/lib/commonjs/camera/AddressSearchBar.js +304 -0
  5. package/lib/commonjs/camera/AddressSearchBar.js.map +1 -0
  6. package/lib/commonjs/camera/DocumentCapture.js +505 -0
  7. package/lib/commonjs/camera/DocumentCapture.js.map +1 -0
  8. package/lib/commonjs/camera/LivenessCamera.js +534 -0
  9. package/lib/commonjs/camera/LivenessCamera.js.map +1 -0
  10. package/lib/commonjs/camera/MapAddressPicker.js +341 -0
  11. package/lib/commonjs/camera/MapAddressPicker.js.map +1 -0
  12. package/lib/commonjs/core/VelionOnboarding.js +815 -0
  13. package/lib/commonjs/core/VelionOnboarding.js.map +1 -0
  14. package/lib/commonjs/core/sessionDeclinedCopy.js +56 -0
  15. package/lib/commonjs/core/sessionDeclinedCopy.js.map +1 -0
  16. package/lib/commonjs/core/sessionStateMapper.js +137 -0
  17. package/lib/commonjs/core/sessionStateMapper.js.map +1 -0
  18. package/lib/commonjs/core/sseReasonMessages.js +450 -0
  19. package/lib/commonjs/core/sseReasonMessages.js.map +1 -0
  20. package/lib/commonjs/data/iso3166Alpha2Codes.json +1 -0
  21. package/lib/commonjs/data/iso3166CountryNames.json +251 -0
  22. package/lib/commonjs/i18n/index.js +30 -0
  23. package/lib/commonjs/i18n/index.js.map +1 -0
  24. package/lib/commonjs/i18n/strings/en.js +261 -0
  25. package/lib/commonjs/i18n/strings/en.js.map +1 -0
  26. package/lib/commonjs/i18n/strings/es.js +266 -0
  27. package/lib/commonjs/i18n/strings/es.js.map +1 -0
  28. package/lib/commonjs/index.js +213 -0
  29. package/lib/commonjs/index.js.map +1 -0
  30. package/lib/commonjs/package.json +1 -0
  31. package/lib/commonjs/steps/AddressInfoStep.js +650 -0
  32. package/lib/commonjs/steps/AddressInfoStep.js.map +1 -0
  33. package/lib/commonjs/steps/DocumentsOcrStep.js +397 -0
  34. package/lib/commonjs/steps/DocumentsOcrStep.js.map +1 -0
  35. package/lib/commonjs/steps/EmailContactStep.js +145 -0
  36. package/lib/commonjs/steps/EmailContactStep.js.map +1 -0
  37. package/lib/commonjs/steps/EmailOtpStep.js +220 -0
  38. package/lib/commonjs/steps/EmailOtpStep.js.map +1 -0
  39. package/lib/commonjs/steps/FaceMatchStep.js +166 -0
  40. package/lib/commonjs/steps/FaceMatchStep.js.map +1 -0
  41. package/lib/commonjs/steps/FingerprintStep.js +92 -0
  42. package/lib/commonjs/steps/FingerprintStep.js.map +1 -0
  43. package/lib/commonjs/steps/HumanBasicInfoStep.js +243 -0
  44. package/lib/commonjs/steps/HumanBasicInfoStep.js.map +1 -0
  45. package/lib/commonjs/steps/HumanExtendedInfoStep.js +268 -0
  46. package/lib/commonjs/steps/HumanExtendedInfoStep.js.map +1 -0
  47. package/lib/commonjs/steps/LegalBasicInfoStep.js +188 -0
  48. package/lib/commonjs/steps/LegalBasicInfoStep.js.map +1 -0
  49. package/lib/commonjs/steps/LegalExtendedInfoStep.js +166 -0
  50. package/lib/commonjs/steps/LegalExtendedInfoStep.js.map +1 -0
  51. package/lib/commonjs/steps/LivenessMatchStep.js +707 -0
  52. package/lib/commonjs/steps/LivenessMatchStep.js.map +1 -0
  53. package/lib/commonjs/steps/PhoneContactStep.js +146 -0
  54. package/lib/commonjs/steps/PhoneContactStep.js.map +1 -0
  55. package/lib/commonjs/steps/PhoneOtpStep.js +219 -0
  56. package/lib/commonjs/steps/PhoneOtpStep.js.map +1 -0
  57. package/lib/commonjs/steps/SwornDeclarationStep.js +196 -0
  58. package/lib/commonjs/steps/SwornDeclarationStep.js.map +1 -0
  59. package/lib/commonjs/steps/TaxInfoStep.js +244 -0
  60. package/lib/commonjs/steps/TaxInfoStep.js.map +1 -0
  61. package/lib/commonjs/steps/TermsAndConditionsStep.js +238 -0
  62. package/lib/commonjs/steps/TermsAndConditionsStep.js.map +1 -0
  63. package/lib/commonjs/steps/_shared.js +40 -0
  64. package/lib/commonjs/steps/_shared.js.map +1 -0
  65. package/lib/commonjs/steps/types.js +6 -0
  66. package/lib/commonjs/steps/types.js.map +1 -0
  67. package/lib/commonjs/transport/api.js +176 -0
  68. package/lib/commonjs/transport/api.js.map +1 -0
  69. package/lib/commonjs/transport/irisWebSocket.js +121 -0
  70. package/lib/commonjs/transport/irisWebSocket.js.map +1 -0
  71. package/lib/commonjs/transport/secureUrl.js +50 -0
  72. package/lib/commonjs/transport/secureUrl.js.map +1 -0
  73. package/lib/commonjs/transport/sse.js +248 -0
  74. package/lib/commonjs/transport/sse.js.map +1 -0
  75. package/lib/commonjs/types/index.js +391 -0
  76. package/lib/commonjs/types/index.js.map +1 -0
  77. package/lib/commonjs/ui/MapFallbackBoundary.js +42 -0
  78. package/lib/commonjs/ui/MapFallbackBoundary.js.map +1 -0
  79. package/lib/commonjs/ui/StepShell.js +118 -0
  80. package/lib/commonjs/ui/StepShell.js.map +1 -0
  81. package/lib/commonjs/ui/VelionOnboardingScreen.js +217 -0
  82. package/lib/commonjs/ui/VelionOnboardingScreen.js.map +1 -0
  83. package/lib/commonjs/ui/forms/index.js +38 -0
  84. package/lib/commonjs/ui/forms/index.js.map +1 -0
  85. package/lib/commonjs/ui/forms/useInlineValidation.js +88 -0
  86. package/lib/commonjs/ui/forms/useInlineValidation.js.map +1 -0
  87. package/lib/commonjs/ui/forms/validators.js +34 -0
  88. package/lib/commonjs/ui/forms/validators.js.map +1 -0
  89. package/lib/commonjs/ui/icons/HomeHeartIcon.js +38 -0
  90. package/lib/commonjs/ui/icons/HomeHeartIcon.js.map +1 -0
  91. package/lib/commonjs/ui/icons/StepIcon.js +59 -0
  92. package/lib/commonjs/ui/icons/StepIcon.js.map +1 -0
  93. package/lib/commonjs/ui/overlays/AnalyzingOverlay.js +284 -0
  94. package/lib/commonjs/ui/overlays/AnalyzingOverlay.js.map +1 -0
  95. package/lib/commonjs/ui/overlays/LoadingOverlay.js +108 -0
  96. package/lib/commonjs/ui/overlays/LoadingOverlay.js.map +1 -0
  97. package/lib/commonjs/ui/overlays/ProgressBar.js +95 -0
  98. package/lib/commonjs/ui/overlays/ProgressBar.js.map +1 -0
  99. package/lib/commonjs/ui/overlays/RetryDialog.js +125 -0
  100. package/lib/commonjs/ui/overlays/RetryDialog.js.map +1 -0
  101. package/lib/commonjs/ui/overlays/index.js +33 -0
  102. package/lib/commonjs/ui/overlays/index.js.map +1 -0
  103. package/lib/commonjs/ui/primitives/Banner.js +81 -0
  104. package/lib/commonjs/ui/primitives/Banner.js.map +1 -0
  105. package/lib/commonjs/ui/primitives/Button.js +142 -0
  106. package/lib/commonjs/ui/primitives/Button.js.map +1 -0
  107. package/lib/commonjs/ui/primitives/Card.js +50 -0
  108. package/lib/commonjs/ui/primitives/Card.js.map +1 -0
  109. package/lib/commonjs/ui/primitives/Checkbox.js +139 -0
  110. package/lib/commonjs/ui/primitives/Checkbox.js.map +1 -0
  111. package/lib/commonjs/ui/primitives/CountrySelect.js +288 -0
  112. package/lib/commonjs/ui/primitives/CountrySelect.js.map +1 -0
  113. package/lib/commonjs/ui/primitives/DatePicker.js +245 -0
  114. package/lib/commonjs/ui/primitives/DatePicker.js.map +1 -0
  115. package/lib/commonjs/ui/primitives/Input.js +101 -0
  116. package/lib/commonjs/ui/primitives/Input.js.map +1 -0
  117. package/lib/commonjs/ui/primitives/Select.js +209 -0
  118. package/lib/commonjs/ui/primitives/Select.js.map +1 -0
  119. package/lib/commonjs/ui/primitives/Spinner.js +25 -0
  120. package/lib/commonjs/ui/primitives/Spinner.js.map +1 -0
  121. package/lib/commonjs/ui/primitives/index.js +69 -0
  122. package/lib/commonjs/ui/primitives/index.js.map +1 -0
  123. package/lib/commonjs/ui/theme/ThemeProvider.js +74 -0
  124. package/lib/commonjs/ui/theme/ThemeProvider.js.map +1 -0
  125. package/lib/commonjs/ui/theme/index.js +68 -0
  126. package/lib/commonjs/ui/theme/index.js.map +1 -0
  127. package/lib/commonjs/ui/theme/tokens.js +154 -0
  128. package/lib/commonjs/ui/theme/tokens.js.map +1 -0
  129. package/lib/commonjs/utils/EventEmitter.js +144 -0
  130. package/lib/commonjs/utils/EventEmitter.js.map +1 -0
  131. package/lib/commonjs/utils/base64.js +53 -0
  132. package/lib/commonjs/utils/base64.js.map +1 -0
  133. package/lib/commonjs/utils/deviceFingerprint.js +132 -0
  134. package/lib/commonjs/utils/deviceFingerprint.js.map +1 -0
  135. package/lib/commonjs/utils/documentTypeOptions.js +35 -0
  136. package/lib/commonjs/utils/documentTypeOptions.js.map +1 -0
  137. package/lib/commonjs/utils/googleMapsPreflight.js +77 -0
  138. package/lib/commonjs/utils/googleMapsPreflight.js.map +1 -0
  139. package/lib/commonjs/utils/hmac.js +58 -0
  140. package/lib/commonjs/utils/hmac.js.map +1 -0
  141. package/lib/commonjs/utils/iso3166Countries.js +98 -0
  142. package/lib/commonjs/utils/iso3166Countries.js.map +1 -0
  143. package/lib/commonjs/utils/jpegFromUri.js +44 -0
  144. package/lib/commonjs/utils/jpegFromUri.js.map +1 -0
  145. package/lib/commonjs/utils/keepAwake.js +58 -0
  146. package/lib/commonjs/utils/keepAwake.js.map +1 -0
  147. package/lib/commonjs/utils/log.js +42 -0
  148. package/lib/commonjs/utils/log.js.map +1 -0
  149. package/lib/commonjs/utils/osGeocoder.js +70 -0
  150. package/lib/commonjs/utils/osGeocoder.js.map +1 -0
  151. package/lib/commonjs/utils/parseGoogleAddressComponents.js +74 -0
  152. package/lib/commonjs/utils/parseGoogleAddressComponents.js.map +1 -0
  153. package/lib/commonjs/utils/personNameNormalize.js +24 -0
  154. package/lib/commonjs/utils/personNameNormalize.js.map +1 -0
  155. package/lib/commonjs/utils/sdkError.js +34 -0
  156. package/lib/commonjs/utils/sdkError.js.map +1 -0
  157. package/lib/commonjs/utils/sdkVersion.js +13 -0
  158. package/lib/commonjs/utils/sdkVersion.js.map +1 -0
  159. package/lib/commonjs/utils/stepConfig.js +65 -0
  160. package/lib/commonjs/utils/stepConfig.js.map +1 -0
  161. package/lib/commonjs/utils/taxInfoConfig.js +19 -0
  162. package/lib/commonjs/utils/taxInfoConfig.js.map +1 -0
  163. package/lib/module/camera/AddressSearchBar.js +299 -0
  164. package/lib/module/camera/AddressSearchBar.js.map +1 -0
  165. package/lib/module/camera/DocumentCapture.js +500 -0
  166. package/lib/module/camera/DocumentCapture.js.map +1 -0
  167. package/lib/module/camera/LivenessCamera.js +529 -0
  168. package/lib/module/camera/LivenessCamera.js.map +1 -0
  169. package/lib/module/camera/MapAddressPicker.js +337 -0
  170. package/lib/module/camera/MapAddressPicker.js.map +1 -0
  171. package/lib/module/core/VelionOnboarding.js +811 -0
  172. package/lib/module/core/VelionOnboarding.js.map +1 -0
  173. package/lib/module/core/sessionDeclinedCopy.js +52 -0
  174. package/lib/module/core/sessionDeclinedCopy.js.map +1 -0
  175. package/lib/module/core/sessionStateMapper.js +128 -0
  176. package/lib/module/core/sessionStateMapper.js.map +1 -0
  177. package/lib/module/core/sseReasonMessages.js +446 -0
  178. package/lib/module/core/sseReasonMessages.js.map +1 -0
  179. package/lib/module/data/iso3166Alpha2Codes.json +1 -0
  180. package/lib/module/data/iso3166CountryNames.json +251 -0
  181. package/lib/module/i18n/index.js +25 -0
  182. package/lib/module/i18n/index.js.map +1 -0
  183. package/lib/module/i18n/strings/en.js +257 -0
  184. package/lib/module/i18n/strings/en.js.map +1 -0
  185. package/lib/module/i18n/strings/es.js +262 -0
  186. package/lib/module/i18n/strings/es.js.map +1 -0
  187. package/lib/module/index.js +36 -0
  188. package/lib/module/index.js.map +1 -0
  189. package/lib/module/steps/AddressInfoStep.js +646 -0
  190. package/lib/module/steps/AddressInfoStep.js.map +1 -0
  191. package/lib/module/steps/DocumentsOcrStep.js +391 -0
  192. package/lib/module/steps/DocumentsOcrStep.js.map +1 -0
  193. package/lib/module/steps/EmailContactStep.js +140 -0
  194. package/lib/module/steps/EmailContactStep.js.map +1 -0
  195. package/lib/module/steps/EmailOtpStep.js +215 -0
  196. package/lib/module/steps/EmailOtpStep.js.map +1 -0
  197. package/lib/module/steps/FaceMatchStep.js +161 -0
  198. package/lib/module/steps/FaceMatchStep.js.map +1 -0
  199. package/lib/module/steps/FingerprintStep.js +87 -0
  200. package/lib/module/steps/FingerprintStep.js.map +1 -0
  201. package/lib/module/steps/HumanBasicInfoStep.js +238 -0
  202. package/lib/module/steps/HumanBasicInfoStep.js.map +1 -0
  203. package/lib/module/steps/HumanExtendedInfoStep.js +263 -0
  204. package/lib/module/steps/HumanExtendedInfoStep.js.map +1 -0
  205. package/lib/module/steps/LegalBasicInfoStep.js +183 -0
  206. package/lib/module/steps/LegalBasicInfoStep.js.map +1 -0
  207. package/lib/module/steps/LegalExtendedInfoStep.js +161 -0
  208. package/lib/module/steps/LegalExtendedInfoStep.js.map +1 -0
  209. package/lib/module/steps/LivenessMatchStep.js +701 -0
  210. package/lib/module/steps/LivenessMatchStep.js.map +1 -0
  211. package/lib/module/steps/PhoneContactStep.js +141 -0
  212. package/lib/module/steps/PhoneContactStep.js.map +1 -0
  213. package/lib/module/steps/PhoneOtpStep.js +214 -0
  214. package/lib/module/steps/PhoneOtpStep.js.map +1 -0
  215. package/lib/module/steps/SwornDeclarationStep.js +191 -0
  216. package/lib/module/steps/SwornDeclarationStep.js.map +1 -0
  217. package/lib/module/steps/TaxInfoStep.js +239 -0
  218. package/lib/module/steps/TaxInfoStep.js.map +1 -0
  219. package/lib/module/steps/TermsAndConditionsStep.js +233 -0
  220. package/lib/module/steps/TermsAndConditionsStep.js.map +1 -0
  221. package/lib/module/steps/_shared.js +33 -0
  222. package/lib/module/steps/_shared.js.map +1 -0
  223. package/lib/module/steps/types.js +4 -0
  224. package/lib/module/steps/types.js.map +1 -0
  225. package/lib/module/transport/api.js +173 -0
  226. package/lib/module/transport/api.js.map +1 -0
  227. package/lib/module/transport/irisWebSocket.js +115 -0
  228. package/lib/module/transport/irisWebSocket.js.map +1 -0
  229. package/lib/module/transport/secureUrl.js +45 -0
  230. package/lib/module/transport/secureUrl.js.map +1 -0
  231. package/lib/module/transport/sse.js +242 -0
  232. package/lib/module/transport/sse.js.map +1 -0
  233. package/lib/module/types/index.js +457 -0
  234. package/lib/module/types/index.js.map +1 -0
  235. package/lib/module/ui/MapFallbackBoundary.js +37 -0
  236. package/lib/module/ui/MapFallbackBoundary.js.map +1 -0
  237. package/lib/module/ui/StepShell.js +114 -0
  238. package/lib/module/ui/StepShell.js.map +1 -0
  239. package/lib/module/ui/VelionOnboardingScreen.js +212 -0
  240. package/lib/module/ui/VelionOnboardingScreen.js.map +1 -0
  241. package/lib/module/ui/forms/index.js +5 -0
  242. package/lib/module/ui/forms/index.js.map +1 -0
  243. package/lib/module/ui/forms/useInlineValidation.js +84 -0
  244. package/lib/module/ui/forms/useInlineValidation.js.map +1 -0
  245. package/lib/module/ui/forms/validators.js +27 -0
  246. package/lib/module/ui/forms/validators.js.map +1 -0
  247. package/lib/module/ui/icons/HomeHeartIcon.js +33 -0
  248. package/lib/module/ui/icons/HomeHeartIcon.js.map +1 -0
  249. package/lib/module/ui/icons/StepIcon.js +55 -0
  250. package/lib/module/ui/icons/StepIcon.js.map +1 -0
  251. package/lib/module/ui/overlays/AnalyzingOverlay.js +279 -0
  252. package/lib/module/ui/overlays/AnalyzingOverlay.js.map +1 -0
  253. package/lib/module/ui/overlays/LoadingOverlay.js +104 -0
  254. package/lib/module/ui/overlays/LoadingOverlay.js.map +1 -0
  255. package/lib/module/ui/overlays/ProgressBar.js +90 -0
  256. package/lib/module/ui/overlays/ProgressBar.js.map +1 -0
  257. package/lib/module/ui/overlays/RetryDialog.js +121 -0
  258. package/lib/module/ui/overlays/RetryDialog.js.map +1 -0
  259. package/lib/module/ui/overlays/index.js +6 -0
  260. package/lib/module/ui/overlays/index.js.map +1 -0
  261. package/lib/module/ui/primitives/Banner.js +77 -0
  262. package/lib/module/ui/primitives/Banner.js.map +1 -0
  263. package/lib/module/ui/primitives/Button.js +138 -0
  264. package/lib/module/ui/primitives/Button.js.map +1 -0
  265. package/lib/module/ui/primitives/Card.js +46 -0
  266. package/lib/module/ui/primitives/Card.js.map +1 -0
  267. package/lib/module/ui/primitives/Checkbox.js +136 -0
  268. package/lib/module/ui/primitives/Checkbox.js.map +1 -0
  269. package/lib/module/ui/primitives/CountrySelect.js +284 -0
  270. package/lib/module/ui/primitives/CountrySelect.js.map +1 -0
  271. package/lib/module/ui/primitives/DatePicker.js +241 -0
  272. package/lib/module/ui/primitives/DatePicker.js.map +1 -0
  273. package/lib/module/ui/primitives/Input.js +97 -0
  274. package/lib/module/ui/primitives/Input.js.map +1 -0
  275. package/lib/module/ui/primitives/Select.js +205 -0
  276. package/lib/module/ui/primitives/Select.js.map +1 -0
  277. package/lib/module/ui/primitives/Spinner.js +21 -0
  278. package/lib/module/ui/primitives/Spinner.js.map +1 -0
  279. package/lib/module/ui/primitives/index.js +12 -0
  280. package/lib/module/ui/primitives/index.js.map +1 -0
  281. package/lib/module/ui/theme/ThemeProvider.js +67 -0
  282. package/lib/module/ui/theme/ThemeProvider.js.map +1 -0
  283. package/lib/module/ui/theme/index.js +5 -0
  284. package/lib/module/ui/theme/index.js.map +1 -0
  285. package/lib/module/ui/theme/tokens.js +145 -0
  286. package/lib/module/ui/theme/tokens.js.map +1 -0
  287. package/lib/module/utils/EventEmitter.js +139 -0
  288. package/lib/module/utils/EventEmitter.js.map +1 -0
  289. package/lib/module/utils/base64.js +47 -0
  290. package/lib/module/utils/base64.js.map +1 -0
  291. package/lib/module/utils/deviceFingerprint.js +129 -0
  292. package/lib/module/utils/deviceFingerprint.js.map +1 -0
  293. package/lib/module/utils/documentTypeOptions.js +31 -0
  294. package/lib/module/utils/documentTypeOptions.js.map +1 -0
  295. package/lib/module/utils/googleMapsPreflight.js +73 -0
  296. package/lib/module/utils/googleMapsPreflight.js.map +1 -0
  297. package/lib/module/utils/hmac.js +53 -0
  298. package/lib/module/utils/hmac.js.map +1 -0
  299. package/lib/module/utils/iso3166Countries.js +92 -0
  300. package/lib/module/utils/iso3166Countries.js.map +1 -0
  301. package/lib/module/utils/jpegFromUri.js +40 -0
  302. package/lib/module/utils/jpegFromUri.js.map +1 -0
  303. package/lib/module/utils/keepAwake.js +53 -0
  304. package/lib/module/utils/keepAwake.js.map +1 -0
  305. package/lib/module/utils/log.js +37 -0
  306. package/lib/module/utils/log.js.map +1 -0
  307. package/lib/module/utils/osGeocoder.js +65 -0
  308. package/lib/module/utils/osGeocoder.js.map +1 -0
  309. package/lib/module/utils/parseGoogleAddressComponents.js +69 -0
  310. package/lib/module/utils/parseGoogleAddressComponents.js.map +1 -0
  311. package/lib/module/utils/personNameNormalize.js +20 -0
  312. package/lib/module/utils/personNameNormalize.js.map +1 -0
  313. package/lib/module/utils/sdkError.js +29 -0
  314. package/lib/module/utils/sdkError.js.map +1 -0
  315. package/lib/module/utils/sdkVersion.js +9 -0
  316. package/lib/module/utils/sdkVersion.js.map +1 -0
  317. package/lib/module/utils/stepConfig.js +59 -0
  318. package/lib/module/utils/stepConfig.js.map +1 -0
  319. package/lib/module/utils/taxInfoConfig.js +15 -0
  320. package/lib/module/utils/taxInfoConfig.js.map +1 -0
  321. package/lib/typescript/camera/AddressSearchBar.d.ts +37 -0
  322. package/lib/typescript/camera/AddressSearchBar.d.ts.map +1 -0
  323. package/lib/typescript/camera/DocumentCapture.d.ts +34 -0
  324. package/lib/typescript/camera/DocumentCapture.d.ts.map +1 -0
  325. package/lib/typescript/camera/LivenessCamera.d.ts +50 -0
  326. package/lib/typescript/camera/LivenessCamera.d.ts.map +1 -0
  327. package/lib/typescript/camera/MapAddressPicker.d.ts +57 -0
  328. package/lib/typescript/camera/MapAddressPicker.d.ts.map +1 -0
  329. package/lib/typescript/core/VelionOnboarding.d.ts +115 -0
  330. package/lib/typescript/core/VelionOnboarding.d.ts.map +1 -0
  331. package/lib/typescript/core/sessionDeclinedCopy.d.ts +16 -0
  332. package/lib/typescript/core/sessionDeclinedCopy.d.ts.map +1 -0
  333. package/lib/typescript/core/sessionStateMapper.d.ts +33 -0
  334. package/lib/typescript/core/sessionStateMapper.d.ts.map +1 -0
  335. package/lib/typescript/core/sseReasonMessages.d.ts +20 -0
  336. package/lib/typescript/core/sseReasonMessages.d.ts.map +1 -0
  337. package/lib/typescript/i18n/index.d.ts +13 -0
  338. package/lib/typescript/i18n/index.d.ts.map +1 -0
  339. package/lib/typescript/i18n/strings/en.d.ts +3 -0
  340. package/lib/typescript/i18n/strings/en.d.ts.map +1 -0
  341. package/lib/typescript/i18n/strings/es.d.ts +260 -0
  342. package/lib/typescript/i18n/strings/es.d.ts.map +1 -0
  343. package/lib/typescript/index.d.ts +26 -0
  344. package/lib/typescript/index.d.ts.map +1 -0
  345. package/lib/typescript/steps/AddressInfoStep.d.ts +26 -0
  346. package/lib/typescript/steps/AddressInfoStep.d.ts.map +1 -0
  347. package/lib/typescript/steps/DocumentsOcrStep.d.ts +26 -0
  348. package/lib/typescript/steps/DocumentsOcrStep.d.ts.map +1 -0
  349. package/lib/typescript/steps/EmailContactStep.d.ts +15 -0
  350. package/lib/typescript/steps/EmailContactStep.d.ts.map +1 -0
  351. package/lib/typescript/steps/EmailOtpStep.d.ts +21 -0
  352. package/lib/typescript/steps/EmailOtpStep.d.ts.map +1 -0
  353. package/lib/typescript/steps/FaceMatchStep.d.ts +27 -0
  354. package/lib/typescript/steps/FaceMatchStep.d.ts.map +1 -0
  355. package/lib/typescript/steps/FingerprintStep.d.ts +25 -0
  356. package/lib/typescript/steps/FingerprintStep.d.ts.map +1 -0
  357. package/lib/typescript/steps/HumanBasicInfoStep.d.ts +25 -0
  358. package/lib/typescript/steps/HumanBasicInfoStep.d.ts.map +1 -0
  359. package/lib/typescript/steps/HumanExtendedInfoStep.d.ts +23 -0
  360. package/lib/typescript/steps/HumanExtendedInfoStep.d.ts.map +1 -0
  361. package/lib/typescript/steps/LegalBasicInfoStep.d.ts +17 -0
  362. package/lib/typescript/steps/LegalBasicInfoStep.d.ts.map +1 -0
  363. package/lib/typescript/steps/LegalExtendedInfoStep.d.ts +17 -0
  364. package/lib/typescript/steps/LegalExtendedInfoStep.d.ts.map +1 -0
  365. package/lib/typescript/steps/LivenessMatchStep.d.ts +26 -0
  366. package/lib/typescript/steps/LivenessMatchStep.d.ts.map +1 -0
  367. package/lib/typescript/steps/PhoneContactStep.d.ts +15 -0
  368. package/lib/typescript/steps/PhoneContactStep.d.ts.map +1 -0
  369. package/lib/typescript/steps/PhoneOtpStep.d.ts +19 -0
  370. package/lib/typescript/steps/PhoneOtpStep.d.ts.map +1 -0
  371. package/lib/typescript/steps/SwornDeclarationStep.d.ts +20 -0
  372. package/lib/typescript/steps/SwornDeclarationStep.d.ts.map +1 -0
  373. package/lib/typescript/steps/TaxInfoStep.d.ts +19 -0
  374. package/lib/typescript/steps/TaxInfoStep.d.ts.map +1 -0
  375. package/lib/typescript/steps/TermsAndConditionsStep.d.ts +21 -0
  376. package/lib/typescript/steps/TermsAndConditionsStep.d.ts.map +1 -0
  377. package/lib/typescript/steps/_shared.d.ts +11 -0
  378. package/lib/typescript/steps/_shared.d.ts.map +1 -0
  379. package/lib/typescript/steps/types.d.ts +68 -0
  380. package/lib/typescript/steps/types.d.ts.map +1 -0
  381. package/lib/typescript/transport/api.d.ts +35 -0
  382. package/lib/typescript/transport/api.d.ts.map +1 -0
  383. package/lib/typescript/transport/irisWebSocket.d.ts +72 -0
  384. package/lib/typescript/transport/irisWebSocket.d.ts.map +1 -0
  385. package/lib/typescript/transport/secureUrl.d.ts +14 -0
  386. package/lib/typescript/transport/secureUrl.d.ts.map +1 -0
  387. package/lib/typescript/transport/sse.d.ts +54 -0
  388. package/lib/typescript/transport/sse.d.ts.map +1 -0
  389. package/lib/typescript/types/index.d.ts +1010 -0
  390. package/lib/typescript/types/index.d.ts.map +1 -0
  391. package/lib/typescript/ui/MapFallbackBoundary.d.ts +28 -0
  392. package/lib/typescript/ui/MapFallbackBoundary.d.ts.map +1 -0
  393. package/lib/typescript/ui/StepShell.d.ts +19 -0
  394. package/lib/typescript/ui/StepShell.d.ts.map +1 -0
  395. package/lib/typescript/ui/VelionOnboardingScreen.d.ts +19 -0
  396. package/lib/typescript/ui/VelionOnboardingScreen.d.ts.map +1 -0
  397. package/lib/typescript/ui/forms/index.d.ts +3 -0
  398. package/lib/typescript/ui/forms/index.d.ts.map +1 -0
  399. package/lib/typescript/ui/forms/useInlineValidation.d.ts +30 -0
  400. package/lib/typescript/ui/forms/useInlineValidation.d.ts.map +1 -0
  401. package/lib/typescript/ui/forms/validators.d.ts +11 -0
  402. package/lib/typescript/ui/forms/validators.d.ts.map +1 -0
  403. package/lib/typescript/ui/icons/HomeHeartIcon.d.ts +14 -0
  404. package/lib/typescript/ui/icons/HomeHeartIcon.d.ts.map +1 -0
  405. package/lib/typescript/ui/icons/StepIcon.d.ts +26 -0
  406. package/lib/typescript/ui/icons/StepIcon.d.ts.map +1 -0
  407. package/lib/typescript/ui/overlays/AnalyzingOverlay.d.ts +24 -0
  408. package/lib/typescript/ui/overlays/AnalyzingOverlay.d.ts.map +1 -0
  409. package/lib/typescript/ui/overlays/LoadingOverlay.d.ts +19 -0
  410. package/lib/typescript/ui/overlays/LoadingOverlay.d.ts.map +1 -0
  411. package/lib/typescript/ui/overlays/ProgressBar.d.ts +26 -0
  412. package/lib/typescript/ui/overlays/ProgressBar.d.ts.map +1 -0
  413. package/lib/typescript/ui/overlays/RetryDialog.d.ts +17 -0
  414. package/lib/typescript/ui/overlays/RetryDialog.d.ts.map +1 -0
  415. package/lib/typescript/ui/overlays/index.d.ts +4 -0
  416. package/lib/typescript/ui/overlays/index.d.ts.map +1 -0
  417. package/lib/typescript/ui/primitives/Banner.d.ts +11 -0
  418. package/lib/typescript/ui/primitives/Banner.d.ts.map +1 -0
  419. package/lib/typescript/ui/primitives/Button.d.ts +27 -0
  420. package/lib/typescript/ui/primitives/Button.d.ts.map +1 -0
  421. package/lib/typescript/ui/primitives/Card.d.ts +10 -0
  422. package/lib/typescript/ui/primitives/Card.d.ts.map +1 -0
  423. package/lib/typescript/ui/primitives/Checkbox.d.ts +25 -0
  424. package/lib/typescript/ui/primitives/Checkbox.d.ts.map +1 -0
  425. package/lib/typescript/ui/primitives/CountrySelect.d.ts +31 -0
  426. package/lib/typescript/ui/primitives/CountrySelect.d.ts.map +1 -0
  427. package/lib/typescript/ui/primitives/DatePicker.d.ts +42 -0
  428. package/lib/typescript/ui/primitives/DatePicker.d.ts.map +1 -0
  429. package/lib/typescript/ui/primitives/Input.d.ts +17 -0
  430. package/lib/typescript/ui/primitives/Input.d.ts.map +1 -0
  431. package/lib/typescript/ui/primitives/Select.d.ts +26 -0
  432. package/lib/typescript/ui/primitives/Select.d.ts.map +1 -0
  433. package/lib/typescript/ui/primitives/Spinner.d.ts +10 -0
  434. package/lib/typescript/ui/primitives/Spinner.d.ts.map +1 -0
  435. package/lib/typescript/ui/primitives/index.d.ts +10 -0
  436. package/lib/typescript/ui/primitives/index.d.ts.map +1 -0
  437. package/lib/typescript/ui/theme/ThemeProvider.d.ts +23 -0
  438. package/lib/typescript/ui/theme/ThemeProvider.d.ts.map +1 -0
  439. package/lib/typescript/ui/theme/index.d.ts +3 -0
  440. package/lib/typescript/ui/theme/index.d.ts.map +1 -0
  441. package/lib/typescript/ui/theme/tokens.d.ts +42 -0
  442. package/lib/typescript/ui/theme/tokens.d.ts.map +1 -0
  443. package/lib/typescript/utils/EventEmitter.d.ts +98 -0
  444. package/lib/typescript/utils/EventEmitter.d.ts.map +1 -0
  445. package/lib/typescript/utils/base64.d.ts +19 -0
  446. package/lib/typescript/utils/base64.d.ts.map +1 -0
  447. package/lib/typescript/utils/deviceFingerprint.d.ts +42 -0
  448. package/lib/typescript/utils/deviceFingerprint.d.ts.map +1 -0
  449. package/lib/typescript/utils/documentTypeOptions.d.ts +13 -0
  450. package/lib/typescript/utils/documentTypeOptions.d.ts.map +1 -0
  451. package/lib/typescript/utils/googleMapsPreflight.d.ts +44 -0
  452. package/lib/typescript/utils/googleMapsPreflight.d.ts.map +1 -0
  453. package/lib/typescript/utils/hmac.d.ts +39 -0
  454. package/lib/typescript/utils/hmac.d.ts.map +1 -0
  455. package/lib/typescript/utils/iso3166Countries.d.ts +27 -0
  456. package/lib/typescript/utils/iso3166Countries.d.ts.map +1 -0
  457. package/lib/typescript/utils/jpegFromUri.d.ts +29 -0
  458. package/lib/typescript/utils/jpegFromUri.d.ts.map +1 -0
  459. package/lib/typescript/utils/keepAwake.d.ts +16 -0
  460. package/lib/typescript/utils/keepAwake.d.ts.map +1 -0
  461. package/lib/typescript/utils/log.d.ts +18 -0
  462. package/lib/typescript/utils/log.d.ts.map +1 -0
  463. package/lib/typescript/utils/osGeocoder.d.ts +38 -0
  464. package/lib/typescript/utils/osGeocoder.d.ts.map +1 -0
  465. package/lib/typescript/utils/parseGoogleAddressComponents.d.ts +43 -0
  466. package/lib/typescript/utils/parseGoogleAddressComponents.d.ts.map +1 -0
  467. package/lib/typescript/utils/personNameNormalize.d.ts +10 -0
  468. package/lib/typescript/utils/personNameNormalize.d.ts.map +1 -0
  469. package/lib/typescript/utils/sdkError.d.ts +14 -0
  470. package/lib/typescript/utils/sdkError.d.ts.map +1 -0
  471. package/lib/typescript/utils/sdkVersion.d.ts +7 -0
  472. package/lib/typescript/utils/sdkVersion.d.ts.map +1 -0
  473. package/lib/typescript/utils/stepConfig.d.ts +8 -0
  474. package/lib/typescript/utils/stepConfig.d.ts.map +1 -0
  475. package/lib/typescript/utils/taxInfoConfig.d.ts +7 -0
  476. package/lib/typescript/utils/taxInfoConfig.d.ts.map +1 -0
  477. package/package.json +99 -0
  478. package/src/camera/AddressSearchBar.tsx +363 -0
  479. package/src/camera/DocumentCapture.tsx +505 -0
  480. package/src/camera/LivenessCamera.tsx +602 -0
  481. package/src/camera/MapAddressPicker.tsx +397 -0
  482. package/src/core/VelionOnboarding.ts +974 -0
  483. package/src/core/sessionDeclinedCopy.ts +76 -0
  484. package/src/core/sessionStateMapper.ts +167 -0
  485. package/src/core/sseReasonMessages.ts +531 -0
  486. package/src/data/iso3166Alpha2Codes.json +1 -0
  487. package/src/data/iso3166CountryNames.json +251 -0
  488. package/src/i18n/index.ts +26 -0
  489. package/src/i18n/strings/en.ts +289 -0
  490. package/src/i18n/strings/es.ts +291 -0
  491. package/src/index.ts +137 -0
  492. package/src/steps/AddressInfoStep.tsx +726 -0
  493. package/src/steps/DocumentsOcrStep.tsx +472 -0
  494. package/src/steps/EmailContactStep.tsx +159 -0
  495. package/src/steps/EmailOtpStep.tsx +250 -0
  496. package/src/steps/FaceMatchStep.tsx +177 -0
  497. package/src/steps/FingerprintStep.tsx +99 -0
  498. package/src/steps/HumanBasicInfoStep.tsx +274 -0
  499. package/src/steps/HumanExtendedInfoStep.tsx +353 -0
  500. package/src/steps/LegalBasicInfoStep.tsx +205 -0
  501. package/src/steps/LegalExtendedInfoStep.tsx +171 -0
  502. package/src/steps/LivenessMatchStep.tsx +846 -0
  503. package/src/steps/PhoneContactStep.tsx +160 -0
  504. package/src/steps/PhoneOtpStep.tsx +249 -0
  505. package/src/steps/SwornDeclarationStep.tsx +220 -0
  506. package/src/steps/TaxInfoStep.tsx +277 -0
  507. package/src/steps/TermsAndConditionsStep.tsx +261 -0
  508. package/src/steps/_shared.ts +44 -0
  509. package/src/steps/types.ts +72 -0
  510. package/src/transport/api.ts +257 -0
  511. package/src/transport/irisWebSocket.ts +186 -0
  512. package/src/transport/secureUrl.ts +47 -0
  513. package/src/transport/sse.ts +310 -0
  514. package/src/types/index.ts +1198 -0
  515. package/src/ui/MapFallbackBoundary.tsx +46 -0
  516. package/src/ui/StepShell.tsx +137 -0
  517. package/src/ui/VelionOnboardingScreen.tsx +223 -0
  518. package/src/ui/forms/index.ts +12 -0
  519. package/src/ui/forms/useInlineValidation.ts +115 -0
  520. package/src/ui/forms/validators.ts +29 -0
  521. package/src/ui/icons/HomeHeartIcon.tsx +34 -0
  522. package/src/ui/icons/StepIcon.tsx +77 -0
  523. package/src/ui/overlays/AnalyzingOverlay.tsx +323 -0
  524. package/src/ui/overlays/LoadingOverlay.tsx +115 -0
  525. package/src/ui/overlays/ProgressBar.tsx +99 -0
  526. package/src/ui/overlays/RetryDialog.tsx +128 -0
  527. package/src/ui/overlays/index.ts +3 -0
  528. package/src/ui/primitives/Banner.tsx +81 -0
  529. package/src/ui/primitives/Button.tsx +164 -0
  530. package/src/ui/primitives/Card.tsx +55 -0
  531. package/src/ui/primitives/Checkbox.tsx +153 -0
  532. package/src/ui/primitives/CountrySelect.tsx +356 -0
  533. package/src/ui/primitives/DatePicker.tsx +266 -0
  534. package/src/ui/primitives/Input.tsx +110 -0
  535. package/src/ui/primitives/Select.tsx +259 -0
  536. package/src/ui/primitives/Spinner.tsx +17 -0
  537. package/src/ui/primitives/index.ts +9 -0
  538. package/src/ui/theme/ThemeProvider.tsx +102 -0
  539. package/src/ui/theme/index.ts +17 -0
  540. package/src/ui/theme/tokens.ts +159 -0
  541. package/src/utils/EventEmitter.ts +155 -0
  542. package/src/utils/base64.ts +44 -0
  543. package/src/utils/deviceFingerprint.ts +184 -0
  544. package/src/utils/documentTypeOptions.ts +31 -0
  545. package/src/utils/googleMapsPreflight.ts +72 -0
  546. package/src/utils/hmac.ts +61 -0
  547. package/src/utils/iso3166Countries.ts +111 -0
  548. package/src/utils/jpegFromUri.ts +42 -0
  549. package/src/utils/keepAwake.ts +62 -0
  550. package/src/utils/log.ts +37 -0
  551. package/src/utils/osGeocoder.ts +75 -0
  552. package/src/utils/parseGoogleAddressComponents.ts +123 -0
  553. package/src/utils/personNameNormalize.ts +17 -0
  554. package/src/utils/sdkError.ts +40 -0
  555. package/src/utils/sdkVersion.ts +6 -0
  556. package/src/utils/stepConfig.ts +75 -0
  557. package/src/utils/taxInfoConfig.ts +14 -0
@@ -0,0 +1,144 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TypedEventEmitter = void 0;
7
+ /**
8
+ * @fileoverview Typed, memory-safe EventEmitter for internal SDK communication.
9
+ *
10
+ * Design rationale:
11
+ * - Fully typed via generics — no `any` escapes at the call sites.
12
+ * - All `on()` calls return an unsubscribe function, which is the preferred
13
+ * modern pattern over imperative `off()` calls. This makes cleanup trivial
14
+ * via a collected array of disposables.
15
+ * - Listeners that throw are caught and logged, preventing one bad subscriber
16
+ * from silently breaking the entire event chain.
17
+ * - `removeAllListeners()` is explicitly called in `VelionOnboarding.destroy()`
18
+ * to prevent memory leaks in long-lived single-page applications.
19
+ */
20
+
21
+ /** A strongly-typed listener function for a given event payload. */
22
+
23
+ /** A function returned by `on()` that removes the registered listener when called. */
24
+
25
+ /**
26
+ * A generic, compile-time safe EventEmitter.
27
+ *
28
+ * @typeParam TEventMap - An object type mapping event names to their payload types.
29
+ *
30
+ * @example
31
+ * ```typescript
32
+ * interface MyEvents {
33
+ * 'data:ready': { records: string[] };
34
+ * 'error': Error;
35
+ * }
36
+ *
37
+ * const emitter = new TypedEventEmitter<MyEvents>();
38
+ *
39
+ * const unsub = emitter.on('data:ready', ({ records }) => {
40
+ * // `records` is correctly typed as string[]
41
+ * console.log(records);
42
+ * });
43
+ *
44
+ * emitter.emit('data:ready', { records: ['a', 'b'] });
45
+ * unsub(); // Clean up
46
+ * ```
47
+ */
48
+ class TypedEventEmitter {
49
+ /**
50
+ * Internal store. Using a `Map<K, Set<Listener>>` gives O(1) lookups and
51
+ * avoids duplicate listeners with zero extra checks (Set semantics).
52
+ */
53
+ _listeners = new Map();
54
+
55
+ /**
56
+ * Registers a listener for the given event. The listener will be invoked
57
+ * synchronously every time `emit(event, payload)` is called.
58
+ *
59
+ * @param event - The event name to subscribe to.
60
+ * @param listener - The callback to invoke. Receives the typed payload.
61
+ * @returns An unsubscribe function. Call it to remove this specific listener.
62
+ */
63
+ on(event, listener) {
64
+ if (!this._listeners.has(event)) {
65
+ this._listeners.set(event, new Set());
66
+ }
67
+ const listeners = this._listeners.get(event);
68
+ if (listeners) listeners.add(listener);
69
+ return () => this.off(event, listener);
70
+ }
71
+
72
+ /**
73
+ * Registers a one-time listener. The listener is automatically removed
74
+ * after the first time the event fires.
75
+ *
76
+ * @param event - The event name to subscribe to.
77
+ * @param listener - The callback to invoke once.
78
+ * @returns An unsubscribe function. Call it to cancel before the event fires.
79
+ */
80
+ once(event, listener) {
81
+ const wrapper = payload => {
82
+ listener(payload);
83
+ this.off(event, wrapper);
84
+ };
85
+ return this.on(event, wrapper);
86
+ }
87
+
88
+ /**
89
+ * Emits an event, synchronously invoking all registered listeners.
90
+ * Errors thrown by individual listeners are caught and logged to prevent
91
+ * cascading failures.
92
+ *
93
+ * @param event - The event name to emit.
94
+ * @param payload - The data to pass to each listener.
95
+ */
96
+ emit(event, payload) {
97
+ const set = this._listeners.get(event);
98
+ if (!set || set.size === 0) return;
99
+ for (const listener of set) {
100
+ try {
101
+ listener(payload);
102
+ } catch (err) {
103
+ console.error(`[VelionSDK] Uncaught error in listener for event "${String(event)}":`, err);
104
+ }
105
+ }
106
+ }
107
+
108
+ /**
109
+ * Removes a specific listener for an event.
110
+ *
111
+ * @param event - The event name.
112
+ * @param listener - The exact listener function reference to remove.
113
+ */
114
+ off(event, listener) {
115
+ this._listeners.get(event)?.delete(listener);
116
+ }
117
+
118
+ /**
119
+ * Removes all listeners, optionally scoped to a single event.
120
+ * Called by `VelionOnboarding.destroy()` to prevent memory leaks.
121
+ *
122
+ * @param event - If provided, only clears listeners for that event.
123
+ * If omitted, clears ALL listeners on ALL events.
124
+ */
125
+ removeAllListeners(event) {
126
+ if (event !== undefined) {
127
+ this._listeners.delete(event);
128
+ } else {
129
+ this._listeners.clear();
130
+ }
131
+ }
132
+
133
+ /**
134
+ * Returns the number of registered listeners for a given event.
135
+ * Useful for debugging and testing assertions.
136
+ *
137
+ * @param event - The event name to check.
138
+ */
139
+ listenerCount(event) {
140
+ return this._listeners.get(event)?.size ?? 0;
141
+ }
142
+ }
143
+ exports.TypedEventEmitter = TypedEventEmitter;
144
+ //# sourceMappingURL=EventEmitter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["TypedEventEmitter","_listeners","Map","on","event","listener","has","set","Set","listeners","get","add","off","once","wrapper","payload","emit","size","err","console","error","String","delete","removeAllListeners","undefined","clear","listenerCount","exports"],"sourceRoot":"../../../src","sources":["utils/EventEmitter.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAGA;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,iBAAiB,CAA4C;EACxE;AACF;AACA;AACA;EACmBC,UAAU,GAAG,IAAIC,GAAG,CAGnC,CAAC;;EAEH;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEC,EAAEA,CACAC,KAAQ,EACRC,QAAgC,EACnB;IACb,IAAI,CAAC,IAAI,CAACJ,UAAU,CAACK,GAAG,CAACF,KAAK,CAAC,EAAE;MAC/B,IAAI,CAACH,UAAU,CAACM,GAAG,CAACH,KAAK,EAAE,IAAII,GAAG,CAAC,CAAC,CAAC;IACvC;IACA,MAAMC,SAAS,GAAG,IAAI,CAACR,UAAU,CAACS,GAAG,CAACN,KAAK,CAAC;IAC5C,IAAIK,SAAS,EAAEA,SAAS,CAACE,GAAG,CAACN,QAA6B,CAAC;IAE3D,OAAO,MAAM,IAAI,CAACO,GAAG,CAACR,KAAK,EAAEC,QAAQ,CAAC;EACxC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEQ,IAAIA,CACFT,KAAQ,EACRC,QAAgC,EACnB;IACb,MAAMS,OAA+B,GAAIC,OAAO,IAAK;MACnDV,QAAQ,CAACU,OAAO,CAAC;MACjB,IAAI,CAACH,GAAG,CAACR,KAAK,EAAEU,OAAO,CAAC;IAC1B,CAAC;IACD,OAAO,IAAI,CAACX,EAAE,CAACC,KAAK,EAAEU,OAAO,CAAC;EAChC;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;AACA;EACEE,IAAIA,CAA4BZ,KAAQ,EAAEW,OAAqB,EAAQ;IACrE,MAAMR,GAAG,GAAG,IAAI,CAACN,UAAU,CAACS,GAAG,CAACN,KAAK,CAAC;IACtC,IAAI,CAACG,GAAG,IAAIA,GAAG,CAACU,IAAI,KAAK,CAAC,EAAE;IAE5B,KAAK,MAAMZ,QAAQ,IAAIE,GAAG,EAAE;MAC1B,IAAI;QACDF,QAAQ,CAA4BU,OAAO,CAAC;MAC/C,CAAC,CAAC,OAAOG,GAAG,EAAE;QACZC,OAAO,CAACC,KAAK,CACX,qDAAqDC,MAAM,CAACjB,KAAK,CAAC,IAAI,EACtEc,GACF,CAAC;MACH;IACF;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEN,GAAGA,CACDR,KAAQ,EACRC,QAAgC,EAC1B;IACN,IAAI,CAACJ,UAAU,CAACS,GAAG,CAACN,KAAK,CAAC,EAAEkB,MAAM,CAACjB,QAA6B,CAAC;EACnE;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACEkB,kBAAkBA,CAACnB,KAAuB,EAAQ;IAChD,IAAIA,KAAK,KAAKoB,SAAS,EAAE;MACvB,IAAI,CAACvB,UAAU,CAACqB,MAAM,CAAClB,KAAK,CAAC;IAC/B,CAAC,MAAM;MACL,IAAI,CAACH,UAAU,CAACwB,KAAK,CAAC,CAAC;IACzB;EACF;;EAEA;AACF;AACA;AACA;AACA;AACA;EACEC,aAAaA,CAACtB,KAAsB,EAAU;IAC5C,OAAO,IAAI,CAACH,UAAU,CAACS,GAAG,CAACN,KAAK,CAAC,EAAEa,IAAI,IAAI,CAAC;EAC9C;AACF;AAACU,OAAA,CAAA3B,iBAAA,GAAAA,iBAAA","ignoreList":[]}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.base64ToBytes = base64ToBytes;
7
+ exports.bytesToBase64 = bytesToBase64;
8
+ exports.bytesToHexLower = bytesToHexLower;
9
+ /**
10
+ * Base64 helpers without `Buffer` (RN does not ship a Buffer global) and
11
+ * without leaning on `react-native-quick-base64`. Hermes provides `btoa` /
12
+ * `atob`, which take Latin-1 strings — we wrap them with byte arrays so
13
+ * callers don't have to think about the in-between.
14
+ */
15
+
16
+ /**
17
+ * Encodes a `Uint8Array` to a standard base64 string.
18
+ *
19
+ * Implementation note: `btoa` requires a Latin-1 string. We convert the byte
20
+ * array to one char per byte via `String.fromCharCode`, in chunks to avoid
21
+ * blowing the JS argument-list limit on large frames (~1 MB JPEG).
22
+ */
23
+ function bytesToBase64(bytes) {
24
+ const CHUNK = 0x8000; // 32 KiB — well below the spread-args limit.
25
+ let binary = '';
26
+ for (let i = 0; i < bytes.length; i += CHUNK) {
27
+ const slice = bytes.subarray(i, i + CHUNK);
28
+ binary += String.fromCharCode(...slice);
29
+ }
30
+ // `btoa` is part of the WHATWG spec and is available on Hermes (RN ≥ 0.74).
31
+ return globalThis.btoa(binary);
32
+ }
33
+
34
+ /** Decodes a standard base64 string into a `Uint8Array`. */
35
+ function base64ToBytes(b64) {
36
+ const binary = globalThis.atob(b64);
37
+ const bytes = new Uint8Array(binary.length);
38
+ for (let i = 0; i < binary.length; i += 1) {
39
+ bytes[i] = binary.charCodeAt(i);
40
+ }
41
+ return bytes;
42
+ }
43
+
44
+ /** Lowercase hex (`'a1f3…'`) — matches the canonical Iris HMAC format. */
45
+ function bytesToHexLower(bytes) {
46
+ let out = '';
47
+ for (let i = 0; i < bytes.length; i += 1) {
48
+ const v = bytes[i] ?? 0;
49
+ out += v.toString(16).padStart(2, '0');
50
+ }
51
+ return out;
52
+ }
53
+ //# sourceMappingURL=base64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["bytesToBase64","bytes","CHUNK","binary","i","length","slice","subarray","String","fromCharCode","globalThis","btoa","base64ToBytes","b64","atob","Uint8Array","charCodeAt","bytesToHexLower","out","v","toString","padStart"],"sourceRoot":"../../../src","sources":["utils/base64.ts"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASA,aAAaA,CAACC,KAAiB,EAAU;EACvD,MAAMC,KAAK,GAAG,MAAM,CAAC,CAAC;EACtB,IAAIC,MAAM,GAAG,EAAE;EACf,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,KAAK,CAACI,MAAM,EAAED,CAAC,IAAIF,KAAK,EAAE;IAC5C,MAAMI,KAAK,GAAGL,KAAK,CAACM,QAAQ,CAACH,CAAC,EAAEA,CAAC,GAAGF,KAAK,CAAC;IAC1CC,MAAM,IAAIK,MAAM,CAACC,YAAY,CAAC,GAAGH,KAAK,CAAC;EACzC;EACA;EACA,OAAOI,UAAU,CAACC,IAAI,CAACR,MAAM,CAAC;AAChC;;AAEA;AACO,SAASS,aAAaA,CAACC,GAAW,EAAc;EACrD,MAAMV,MAAM,GAAGO,UAAU,CAACI,IAAI,CAACD,GAAG,CAAC;EACnC,MAAMZ,KAAK,GAAG,IAAIc,UAAU,CAACZ,MAAM,CAACE,MAAM,CAAC;EAC3C,KAAK,IAAID,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGD,MAAM,CAACE,MAAM,EAAED,CAAC,IAAI,CAAC,EAAE;IACzCH,KAAK,CAACG,CAAC,CAAC,GAAGD,MAAM,CAACa,UAAU,CAACZ,CAAC,CAAC;EACjC;EACA,OAAOH,KAAK;AACd;;AAEA;AACO,SAASgB,eAAeA,CAAChB,KAAiB,EAAU;EACzD,IAAIiB,GAAG,GAAG,EAAE;EACZ,KAAK,IAAId,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,KAAK,CAACI,MAAM,EAAED,CAAC,IAAI,CAAC,EAAE;IACxC,MAAMe,CAAC,GAAGlB,KAAK,CAACG,CAAC,CAAC,IAAI,CAAC;IACvBc,GAAG,IAAIC,CAAC,CAACC,QAAQ,CAAC,EAAE,CAAC,CAACC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;EACxC;EACA,OAAOH,GAAG;AACZ","ignoreList":[]}
@@ -0,0 +1,132 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.generateDeviceFingerprint = generateDeviceFingerprint;
7
+ var _types = require("../types");
8
+ /**
9
+ * @fileoverview Device Fingerprint via Fingerprint Pro RN SDK.
10
+ *
11
+ * Uses the official `@fingerprintjs/fingerprintjs-pro-react-native` agent
12
+ * class to identify the device.
13
+ *
14
+ * Why a real SDK and not a hand-rolled hash:
15
+ * - The backend (`PublicSdkSessionController.fingerprint`) reads only
16
+ * `request_id` and `sealed_result` from the body. A custom `visitor_id`
17
+ * field is silently dropped and the AML enrichment lookup never runs.
18
+ * - Fingerprint Pro returns a stable `requestId` (lookup key against the
19
+ * Fingerprint server) and a `sealedResult` (encrypted payload the
20
+ * backend decrypts with its private key for server-side identification).
21
+ *
22
+ * The Fingerprint Pro RN SDK is loaded **dynamically** so it stays an
23
+ * optional peer dep: hosts that don't ship the fingerprint module get a
24
+ * clear `FINGERPRINT_FAILED` error instead of a hard module-resolution
25
+ * crash at app boot. (The Velion example app installs it; third-party
26
+ * consumers without a Fingerprint workspace can swap defaults via
27
+ * `fingerprintApiKey` / `fingerprintEndpoint` in `VelionConfig`.)
28
+ */
29
+
30
+ /** Public shape of the result. */
31
+
32
+ /**
33
+ * Fingerprint Pro public API key for the shared Velion workspace. Hardcoded
34
+ * by design — Fingerprint distinguishes public keys (safe to ship in client
35
+ * code; bound to your domain/bundle ID at the Fingerprint dashboard) from
36
+ * secret keys (server-only, used by the worker to decrypt sealedResult or
37
+ * call the Server API). This constant is the *public* one.
38
+ */
39
+ const VELION_FP_PUBLIC_KEY = 'GU2vrZByydGqG9HYUaz2';
40
+
41
+ /**
42
+ * Loaded once per process. We resolve the optional native module lazily so
43
+ * its absence is reported as a clean SDK error rather than crashing the
44
+ * Metro bundler at startup with "Unable to resolve module".
45
+ */
46
+
47
+ function loadAgentCtor() {
48
+ // Avoid bundler hoisting at build time so missing optional dep doesn't
49
+ // crash the host app at boot.
50
+ // eslint-disable-next-line @typescript-eslint/no-require-imports
51
+ const mod = require('@fingerprintjs/fingerprintjs-pro-react-native');
52
+ if (typeof mod.FingerprintJsProAgent !== 'function') {
53
+ throw new Error('Module @fingerprintjs/fingerprintjs-pro-react-native is installed ' + 'but does not export FingerprintJsProAgent. Upgrade to v3+ of the package.');
54
+ }
55
+ return mod.FingerprintJsProAgent;
56
+ }
57
+
58
+ /**
59
+ * Calls Fingerprint Pro RN to obtain `requestId` + optional `sealedResult`,
60
+ * the only two pieces of data the Velion backend cares about. Throws a
61
+ * shaped `SdkError` on any failure (missing module, agent init error,
62
+ * network).
63
+ */
64
+ async function generateDeviceFingerprint(options) {
65
+ let AgentCtor;
66
+ try {
67
+ AgentCtor = loadAgentCtor();
68
+ } catch (err) {
69
+ throw {
70
+ code: _types.SdkErrorCode.FINGERPRINT_FAILED,
71
+ message: 'Fingerprint Pro RN module is not installed. Add ' + '`@fingerprintjs/fingerprintjs-pro-react-native` to your app ' + '(and re-run `expo prebuild`) to enable the DEVICE_FINGERPRINT step.',
72
+ cause: err
73
+ };
74
+ }
75
+ const trimmedEndpoint = options.endpoint.replace(/\/$/, '').trim();
76
+ // An empty string is treated as "no custom endpoint" — the SDK falls through
77
+ // to its built-in public endpoint (api.fpjs.io). This is useful for
78
+ // diagnosing whether a custom proxy (e.g. fp.velion.la) is the cause of a
79
+ // ClientTimeout when the public path works.
80
+ const useCustomEndpoint = trimmedEndpoint.length > 0;
81
+ const apiKey = options.apiKey?.trim() || VELION_FP_PUBLIC_KEY;
82
+ // Internal cap for the call. The Fingerprint SDK has its own retry/timeout
83
+ // logic that on iOS occasionally hangs past 30s without surfacing the error
84
+ // to the JS layer; we Promise.race against this to guarantee a clean failure.
85
+ const timeoutMs = Math.max(6000, options.timeoutMs ?? 15000);
86
+ const agent = new AgentCtor({
87
+ apiKey,
88
+ region: 'us',
89
+ ...(useCustomEndpoint && {
90
+ endpointUrl: trimmedEndpoint,
91
+ // If the custom endpoint is unreachable (proxy misconfigured, DNS, etc.)
92
+ // the SDK falls back to the public Fingerprint Pro endpoint so the step
93
+ // still completes during development.
94
+ fallbackEndpointUrls: ['https://api.fpjs.io']
95
+ }),
96
+ extendedResponseFormat: true,
97
+ requestOptions: {
98
+ timeout: Math.floor(timeoutMs * 0.75)
99
+ }
100
+ });
101
+ let visitorData;
102
+ let timeoutHandle = null;
103
+ try {
104
+ visitorData = await Promise.race([agent.getVisitorData(), new Promise((_resolve, reject) => {
105
+ timeoutHandle = setTimeout(() => reject(new Error(`Fingerprint Pro getVisitorData() did not return within ${timeoutMs}ms`)), timeoutMs);
106
+ })]);
107
+ } catch (err) {
108
+ throw {
109
+ code: _types.SdkErrorCode.FINGERPRINT_FAILED,
110
+ message: 'No pudimos completar el reconocimiento del dispositivo. ' + 'Probá nuevamente; si el problema persiste, verificá tu conexión ' + '(sin VPN ni proxies) o que el bundle ID de la app esté habilitado ' + 'en el dashboard de Fingerprint Pro.',
111
+ cause: err
112
+ };
113
+ } finally {
114
+ if (timeoutHandle !== null) clearTimeout(timeoutHandle);
115
+ }
116
+ const requestId = visitorData.requestId;
117
+ if (typeof requestId !== 'string' || requestId.length === 0) {
118
+ throw {
119
+ code: _types.SdkErrorCode.FINGERPRINT_FAILED,
120
+ message: 'Fingerprint Pro did not return a requestId — backend cannot ' + 'enrich the session without it.',
121
+ cause: undefined
122
+ };
123
+ }
124
+ const result = {
125
+ request_id: requestId
126
+ };
127
+ if (typeof visitorData.sealedResult === 'string' && visitorData.sealedResult.length > 0) {
128
+ result.sealed_result = visitorData.sealedResult;
129
+ }
130
+ return result;
131
+ }
132
+ //# sourceMappingURL=deviceFingerprint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_types","require","VELION_FP_PUBLIC_KEY","loadAgentCtor","mod","FingerprintJsProAgent","Error","generateDeviceFingerprint","options","AgentCtor","err","code","SdkErrorCode","FINGERPRINT_FAILED","message","cause","trimmedEndpoint","endpoint","replace","trim","useCustomEndpoint","length","apiKey","timeoutMs","Math","max","agent","region","endpointUrl","fallbackEndpointUrls","extendedResponseFormat","requestOptions","timeout","floor","visitorData","timeoutHandle","Promise","race","getVisitorData","_resolve","reject","setTimeout","clearTimeout","requestId","undefined","result","request_id","sealedResult","sealed_result"],"sourceRoot":"../../../src","sources":["utils/deviceFingerprint.ts"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.resolveDocumentTypeOptions = resolveDocumentTypeOptions;
7
+ /**
8
+ * Default identification document option for HUMAN_BASIC_INFO when the backend
9
+ * does not send `accepted_country_documents` (same label keys as legacy UI).
10
+ */
11
+
12
+ const DOCUMENT_TYPE_LABELS_BY_PRESET = {
13
+ es: {
14
+ ARG_DNI: 'DNI (Argentina)'
15
+ },
16
+ en: {
17
+ ARG_DNI: 'DNI (Argentina)'
18
+ },
19
+ ar: {
20
+ ARG_DNI: 'DNI (Argentina)'
21
+ }
22
+ };
23
+ /**
24
+ * Fallback list for the HUMAN_BASIC_INFO identification type selector when step config
25
+ * does not include document types from the backend.
26
+ */
27
+ function resolveDocumentTypeOptions(uiLocale) {
28
+ const labelLocale = uiLocale === 'en' ? 'en' : uiLocale === 'ar' ? 'ar' : 'es';
29
+ const labelMap = DOCUMENT_TYPE_LABELS_BY_PRESET[labelLocale];
30
+ return [{
31
+ value: 'ARG_DNI',
32
+ label: labelMap.ARG_DNI
33
+ }];
34
+ }
35
+ //# sourceMappingURL=documentTypeOptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["DOCUMENT_TYPE_LABELS_BY_PRESET","es","ARG_DNI","en","ar","resolveDocumentTypeOptions","uiLocale","labelLocale","labelMap","value","label"],"sourceRoot":"../../../src","sources":["utils/documentTypeOptions.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;;AAEA,MAAMA,8BAA8B,GAAG;EACrCC,EAAE,EAAE;IACFC,OAAO,EAAE;EACX,CAAC;EACDC,EAAE,EAAE;IACFD,OAAO,EAAE;EACX,CAAC;EACDE,EAAE,EAAE;IACFF,OAAO,EAAE;EACX;AACF,CAAU;AAIV;AACA;AACA;AACA;AACO,SAASG,0BAA0BA,CACxCC,QAAgB,EACyB;EACzC,MAAMC,WAAyB,GAC7BD,QAAQ,KAAK,IAAI,GAAG,IAAI,GAAGA,QAAQ,KAAK,IAAI,GAAG,IAAI,GAAG,IAAI;EAC5D,MAAME,QAAQ,GAAGR,8BAA8B,CAACO,WAAW,CAAC;EAC5D,OAAO,CAAC;IAAEE,KAAK,EAAE,SAAS;IAAEC,KAAK,EAAEF,QAAQ,CAACN;EAAQ,CAAC,CAAC;AACxD","ignoreList":[]}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.isAndroidGoogleMapsKeyInManifest = isAndroidGoogleMapsKeyInManifest;
7
+ exports.isReactNativeMapsAvailable = isReactNativeMapsAvailable;
8
+ var _reactNative = require("react-native");
9
+ var _log = require("./log");
10
+ /**
11
+ * Pre-flight checks for the assisted address flow.
12
+ *
13
+ * The SDK no longer calls any Google REST API from the client — reverse
14
+ * geocoding goes through the OS native geocoder (see `osGeocoder.ts`). What
15
+ * we still need to verify is:
16
+ * 1. `react-native-maps` is linked.
17
+ * 2. On Android, the Google Maps key is declared in `AndroidManifest.xml`
18
+ * as `<meta-data android:name="com.google.android.geo.API_KEY" .../>`.
19
+ * Without that, mounting `<MapView>` throws a native
20
+ * `IllegalStateException` from the Fabric UI manager — a JS error
21
+ * boundary cannot catch it because the throw happens in a native
22
+ * thread during the UI commit.
23
+ *
24
+ * Note that these probes cannot catch the iOS-specific case where
25
+ * `react-native-maps` IS installed but the `AirGoogleMaps` sub-target was
26
+ * never added to the Xcode project — that one only surfaces at render time
27
+ * and is handled by `MapFallbackBoundary`.
28
+ */
29
+
30
+ /**
31
+ * Returns true when `react-native-maps` is importable and exposes the
32
+ * MapView component we need.
33
+ */
34
+ function isReactNativeMapsAvailable() {
35
+ try {
36
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
37
+ const mod = require('react-native-maps');
38
+ return typeof mod?.default === 'function' || typeof mod?.MapView === 'function';
39
+ } catch (err) {
40
+ _log.log.warn('[gmaps-preflight] react-native-maps unavailable', err);
41
+ return false;
42
+ }
43
+ }
44
+
45
+ /**
46
+ * Best-effort probe for the Android `com.google.android.geo.API_KEY` meta-data
47
+ * in the host's `AndroidManifest.xml`.
48
+ *
49
+ * Returns:
50
+ * - `true` on iOS (the check does not apply — Apple Maps needs no key).
51
+ * - `true` when we can confirm the key is wired via the Expo config
52
+ * (`android.config.googleMaps.apiKey`). Expo prebuild copies that
53
+ * into the manifest, so its presence in `expoConfig` is a reliable
54
+ * proxy for the real meta-data.
55
+ * - `false` when `expo-constants` is available AND the Expo config does not
56
+ * declare the key — we know prebuild produced a manifest without
57
+ * the meta-data, so mounting `<MapView>` would crash.
58
+ * - `undefined` when `expo-constants` is not installed (bare RN). We cannot
59
+ * probe the manifest without a custom native module; the caller
60
+ * should default to the previous behaviour (trust the integrator
61
+ * when they pass `googleMapsApiKey` via `VelionConfig`).
62
+ */
63
+ function isAndroidGoogleMapsKeyInManifest() {
64
+ if (_reactNative.Platform.OS !== 'android') return true;
65
+ let Constants;
66
+ try {
67
+ // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
68
+ const mod = require('expo-constants');
69
+ Constants = mod?.default ?? mod;
70
+ } catch {
71
+ return undefined;
72
+ }
73
+ const expoConfig = Constants?.expoConfig;
74
+ const key = expoConfig?.android?.config?.googleMaps?.apiKey;
75
+ return typeof key === 'string' && key.trim().length > 0;
76
+ }
77
+ //# sourceMappingURL=googleMapsPreflight.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_reactNative","require","_log","isReactNativeMapsAvailable","mod","default","MapView","err","log","warn","isAndroidGoogleMapsKeyInManifest","Platform","OS","Constants","undefined","expoConfig","key","android","config","googleMaps","apiKey","trim","length"],"sourceRoot":"../../../src","sources":["utils/googleMapsPreflight.ts"],"mappings":";;;;;;;AAoBA,IAAAA,YAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AArBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACO,SAASE,0BAA0BA,CAAA,EAAY;EACpD,IAAI;IACF;IACA,MAAMC,GAAG,GAAGH,OAAO,CAAC,mBAAmB,CAAC;IACxC,OAAO,OAAOG,GAAG,EAAEC,OAAO,KAAK,UAAU,IAAI,OAAOD,GAAG,EAAEE,OAAO,KAAK,UAAU;EACjF,CAAC,CAAC,OAAOC,GAAG,EAAE;IACZC,QAAG,CAACC,IAAI,CAAC,iDAAiD,EAAEF,GAAG,CAAC;IAChE,OAAO,KAAK;EACd;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,gCAAgCA,CAAA,EAAwB;EACtE,IAAIC,qBAAQ,CAACC,EAAE,KAAK,SAAS,EAAE,OAAO,IAAI;EAC1C,IAAIC,SAAkB;EACtB,IAAI;IACF;IACA,MAAMT,GAAG,GAAGH,OAAO,CAAC,gBAAgB,CAAC;IACrCY,SAAS,GAAGT,GAAG,EAAEC,OAAO,IAAID,GAAG;EACjC,CAAC,CAAC,MAAM;IACN,OAAOU,SAAS;EAClB;EACA,MAAMC,UAAU,GAAIF,SAAS,EAA2CE,UAE3D;EACb,MAAMC,GAAG,GAAGD,UAAU,EAAEE,OAAO,EAAEC,MAAM,EAAEC,UAAU,EAAEC,MAAM;EAC3D,OAAO,OAAOJ,GAAG,KAAK,QAAQ,IAAIA,GAAG,CAACK,IAAI,CAAC,CAAC,CAACC,MAAM,GAAG,CAAC;AACzD","ignoreList":[]}
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.buildSignedFrameEnvelope = buildSignedFrameEnvelope;
7
+ exports.importHmacKey = importHmacKey;
8
+ var _hmac = require("@noble/hashes/hmac");
9
+ var _sha = require("@noble/hashes/sha256");
10
+ var _base = require("./base64");
11
+ /**
12
+ * @fileoverview HMAC-SHA256 over JPEG frames for the Iris liveness flow.
13
+ *
14
+ * React Native's WebCrypto support is incomplete in Hermes (no `subtle.sign`),
15
+ * so we lean on `@noble/hashes` — pure JavaScript, ~10 KB, no native code.
16
+ *
17
+ * Canonical message (must match the Iris orchestrator exactly):
18
+ * `${sessionId}\n${frameId}\n${ts}\n${sha256hex(jpeg)}`
19
+ *
20
+ * Output: lowercase hex MAC, sent in the JSON envelope's `mac` field.
21
+ */
22
+
23
+ /** Decode the base64 frame_integrity_key from `/liveness-init`. */
24
+ function importHmacKey(base64) {
25
+ return {
26
+ raw: (0, _base.base64ToBytes)(base64)
27
+ };
28
+ }
29
+
30
+ /**
31
+ * Build the signed envelope sent over the Iris WebSocket. Mirrors
32
+ * `LivenessModule.buildSignedEnvelope`:
33
+ * 1. Compute SHA-256 of the JPEG bytes (hex, lowercase).
34
+ * 2. Build the canonical message.
35
+ * 3. HMAC-SHA256 with the imported key.
36
+ * 4. Wrap into `{ type: 'FRAME', frameId, timestamp, image, mac }`.
37
+ *
38
+ * Returns the JSON string ready to `ws.send`.
39
+ */
40
+ function buildSignedFrameEnvelope(args) {
41
+ const ts = args.timestamp ?? Date.now();
42
+ const digest = (0, _sha.sha256)(args.jpegBytes);
43
+ const digestHex = (0, _base.bytesToHexLower)(digest);
44
+ const canonical = `${args.sessionId}\n${args.frameId}\n${ts}\n${digestHex}`;
45
+ const mac = (0, _hmac.hmac)(_sha.sha256, args.key.raw, new TextEncoder().encode(canonical));
46
+ const macHex = (0, _base.bytesToHexLower)(mac);
47
+ return {
48
+ json: JSON.stringify({
49
+ type: 'FRAME',
50
+ frameId: args.frameId,
51
+ timestamp: ts,
52
+ image: args.jpegBase64,
53
+ mac: macHex
54
+ }),
55
+ timestamp: ts
56
+ };
57
+ }
58
+ //# sourceMappingURL=hmac.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_hmac","require","_sha","_base","importHmacKey","base64","raw","base64ToBytes","buildSignedFrameEnvelope","args","ts","timestamp","Date","now","digest","sha256","jpegBytes","digestHex","bytesToHexLower","canonical","sessionId","frameId","mac","hmac","key","TextEncoder","encode","macHex","json","JSON","stringify","type","image","jpegBase64"],"sourceRoot":"../../../src","sources":["utils/hmac.ts"],"mappings":";;;;;;;AAYA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAdA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACO,SAASG,aAAaA,CAACC,MAAc,EAAW;EACrD,OAAO;IAAEC,GAAG,EAAE,IAAAC,mBAAa,EAACF,MAAM;EAAE,CAAC;AACvC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASG,wBAAwBA,CAACC,IAQxC,EAAuC;EACtC,MAAMC,EAAE,GAAGD,IAAI,CAACE,SAAS,IAAIC,IAAI,CAACC,GAAG,CAAC,CAAC;EACvC,MAAMC,MAAM,GAAG,IAAAC,WAAM,EAACN,IAAI,CAACO,SAAS,CAAC;EACrC,MAAMC,SAAS,GAAG,IAAAC,qBAAe,EAACJ,MAAM,CAAC;EACzC,MAAMK,SAAS,GAAG,GAAGV,IAAI,CAACW,SAAS,KAAKX,IAAI,CAACY,OAAO,KAAKX,EAAE,KAAKO,SAAS,EAAE;EAC3E,MAAMK,GAAG,GAAG,IAAAC,UAAI,EAACR,WAAM,EAAEN,IAAI,CAACe,GAAG,CAAClB,GAAG,EAAE,IAAImB,WAAW,CAAC,CAAC,CAACC,MAAM,CAACP,SAAS,CAAC,CAAC;EAC3E,MAAMQ,MAAM,GAAG,IAAAT,qBAAe,EAACI,GAAG,CAAC;EACnC,OAAO;IACLM,IAAI,EAAEC,IAAI,CAACC,SAAS,CAAC;MACnBC,IAAI,EAAE,OAAO;MACbV,OAAO,EAAEZ,IAAI,CAACY,OAAO;MACrBV,SAAS,EAAED,EAAE;MACbsB,KAAK,EAAEvB,IAAI,CAACwB,UAAU;MACtBX,GAAG,EAAEK;IACP,CAAC,CAAC;IACFhB,SAAS,EAAED;EACb,CAAC;AACH","ignoreList":[]}
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.filterIso3166Countries = filterIso3166Countries;
7
+ exports.listIso3166CountriesForUi = listIso3166CountriesForUi;
8
+ var _iso3166Alpha2Codes = _interopRequireDefault(require("../data/iso3166Alpha2Codes.json"));
9
+ var _iso3166CountryNames = _interopRequireDefault(require("../data/iso3166CountryNames.json"));
10
+ var _log = require("./log");
11
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
12
+ /**
13
+ * ISO 3166-1 alpha-2 country list with localized display names.
14
+ *
15
+ * Strategy:
16
+ * 1. If `Intl.DisplayNames` is available (full ICU build, polyfilled
17
+ * Hermes, native iOS runtime, …), use it — it covers every BCP-47
18
+ * locale and stays current with ICU updates.
19
+ * 2. Otherwise fall back to a built-in map covering all 249 ISO 3166-1
20
+ * alpha-2 codes in `es` and `en`. The names match the official
21
+ * Spanish convention (es. wikipedia.org/wiki/ISO_3166-1) and the ISO
22
+ * English short name. Hermes default builds (which ship without
23
+ * `Intl.DisplayNames`) get full localized names without needing
24
+ * `@formatjs/intl-displaynames`.
25
+ */
26
+
27
+ function intlLocaleTag(locale) {
28
+ if (locale === 'en') return 'en';
29
+ /** Rioplatense UI uses Spanish country names with regional formatting. */
30
+ if (locale === 'ar') return 'es-AR';
31
+ return 'es';
32
+ }
33
+ let didWarnAboutFallback = false;
34
+ const NAMES_MAP = _iso3166CountryNames.default;
35
+ function fallbackName(code, lang) {
36
+ const entry = NAMES_MAP[code.toUpperCase()];
37
+ if (!entry || entry.length === 0) return code;
38
+ // [0] = es, [1] = en. Fall through to ES (or to the code itself) if the
39
+ // requested locale is missing.
40
+ return (lang === 'en' ? entry[1] : entry[0]) ?? entry[0] ?? code;
41
+ }
42
+ function buildResolver(localeTag) {
43
+ const lang = localeTag.toLowerCase().startsWith('en') ? 'en' : 'es';
44
+ const intl = globalThis.Intl;
45
+ if (intl && typeof intl.DisplayNames === 'function') {
46
+ try {
47
+ const dn = new intl.DisplayNames([localeTag], {
48
+ type: 'region'
49
+ });
50
+ // Wrap so unknown codes still fall back to the built-in map.
51
+ return {
52
+ of: code => dn.of(code) ?? fallbackName(code, lang)
53
+ };
54
+ } catch (err) {
55
+ // Some Hermes builds expose DisplayNames but throw on construction —
56
+ // fall through to the built-in map.
57
+ _log.log.warn('[iso3166] Intl.DisplayNames threw, falling back', err);
58
+ }
59
+ }
60
+ if (!didWarnAboutFallback) {
61
+ didWarnAboutFallback = true;
62
+ _log.log.info('[iso3166] Using built-in ISO 3166-1 country names (Intl.DisplayNames unavailable). ' + 'All 249 alpha-2 codes resolved via the bundled map.');
63
+ }
64
+ return {
65
+ of: code => fallbackName(code, lang)
66
+ };
67
+ }
68
+
69
+ /**
70
+ * Returns all ISO 3166-1 alpha-2 countries sorted by localized display name.
71
+ */
72
+ function listIso3166CountriesForUi(locale) {
73
+ const tag = intlLocaleTag(locale);
74
+ const codes = _iso3166Alpha2Codes.default;
75
+ const dn = buildResolver(tag);
76
+ const collator = globalThis.Intl?.Collator;
77
+ return codes.map(code => ({
78
+ code,
79
+ name: dn.of(code) ?? code
80
+ })).sort((a, b) => {
81
+ if (collator) {
82
+ return new collator(tag, {
83
+ sensitivity: 'base'
84
+ }).compare(a.name, b.name);
85
+ }
86
+ return a.name.localeCompare(b.name);
87
+ });
88
+ }
89
+
90
+ /**
91
+ * Filters by country name or code (case-insensitive).
92
+ */
93
+ function filterIso3166Countries(options, query) {
94
+ const q = query.trim().toLowerCase();
95
+ if (q.length === 0) return [...options];
96
+ return options.filter(o => o.code.toLowerCase().includes(q) || o.name.toLowerCase().includes(q));
97
+ }
98
+ //# sourceMappingURL=iso3166Countries.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_iso3166Alpha2Codes","_interopRequireDefault","require","_iso3166CountryNames","_log","e","__esModule","default","intlLocaleTag","locale","didWarnAboutFallback","NAMES_MAP","COUNTRY_NAMES","fallbackName","code","lang","entry","toUpperCase","length","buildResolver","localeTag","toLowerCase","startsWith","intl","globalThis","Intl","DisplayNames","dn","type","of","err","log","warn","info","listIso3166CountriesForUi","tag","codes","ISO_CODES","collator","Collator","map","name","sort","a","b","sensitivity","compare","localeCompare","filterIso3166Countries","options","query","q","trim","filter","o","includes"],"sourceRoot":"../../../src","sources":["utils/iso3166Countries.ts"],"mappings":"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","ignoreList":[]}