@transfergratis/react-native-sdk 0.1.3 → 0.1.5

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 (308) hide show
  1. package/android/.idea/caches/deviceStreaming.xml +860 -0
  2. package/android/build/.transforms/{7ec900c0f64f5f1a7c88998dd44001b8 → 01c28d00c798aa4846f16ce72123ebf9}/transformed/classes/classes_dex/classes.dex +0 -0
  3. package/android/build/intermediates/aapt_friendly_merged_manifests/debug/processDebugManifest/aapt/AndroidManifest.xml +1 -0
  4. package/android/build/intermediates/aar_main_jar/debug/syncDebugLibJars/classes.jar +0 -0
  5. package/android/build/intermediates/annotations_typedef_file/debug/extractDebugAnnotations/typedefs.txt +0 -0
  6. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  7. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +2 -2
  8. package/android/build/intermediates/incremental/debug-mergeJavaRes/merge-state +0 -0
  9. package/android/build/intermediates/manifest_merge_blame_file/debug/processDebugManifest/manifest-merger-blame-debug-report.txt +51 -48
  10. package/android/build/intermediates/merged_java_res/debug/mergeDebugJavaResource/feature-transfergratis-react-native-sdk.jar +0 -0
  11. package/android/build/intermediates/merged_manifest/debug/processDebugManifest/AndroidManifest.xml +1 -0
  12. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  13. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  14. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  15. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  16. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  17. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  18. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  19. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  20. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  21. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  22. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  23. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  24. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  25. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +1 -1
  34. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  48. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  50. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  51. package/android/build/outputs/aar/transfergratis-react-native-sdk-debug.aar +0 -0
  52. package/android/build/outputs/logs/manifest-merger-debug-report.txt +27 -23
  53. package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkModule.class +0 -0
  54. package/android/build/tmp/kotlin-classes/debug/kyc/transfergratis/com/TransfergratisSdkView.class +0 -0
  55. package/android/build.gradle +1 -5
  56. package/android/src/main/AndroidManifest.xml +1 -0
  57. package/build/api/axios.d.ts +30 -0
  58. package/build/api/axios.d.ts.map +1 -0
  59. package/build/api/axios.js +92 -0
  60. package/build/api/axios.js.map +1 -0
  61. package/build/components/EnhancedCameraView.d.ts +1 -41
  62. package/build/components/EnhancedCameraView.d.ts.map +1 -1
  63. package/build/components/EnhancedCameraView.js +76 -35
  64. package/build/components/EnhancedCameraView.js.map +1 -1
  65. package/build/components/EnhancedCameraView.web.d.ts +1 -41
  66. package/build/components/EnhancedCameraView.web.d.ts.map +1 -1
  67. package/build/components/EnhancedCameraView.web.js +28 -4
  68. package/build/components/EnhancedCameraView.web.js.map +1 -1
  69. package/build/components/KYCElements/CountrySelectionTemplate.d.ts +2 -2
  70. package/build/components/KYCElements/CountrySelectionTemplate.d.ts.map +1 -1
  71. package/build/components/KYCElements/CountrySelectionTemplate.js +71 -114
  72. package/build/components/KYCElements/CountrySelectionTemplate.js.map +1 -1
  73. package/build/components/KYCElements/FileUploadTemplate.d.ts.map +1 -1
  74. package/build/components/KYCElements/FileUploadTemplate.js +7 -3
  75. package/build/components/KYCElements/FileUploadTemplate.js.map +1 -1
  76. package/build/components/KYCElements/IDCardCapture.d.ts +7 -2
  77. package/build/components/KYCElements/IDCardCapture.d.ts.map +1 -1
  78. package/build/components/KYCElements/IDCardCapture.js +253 -104
  79. package/build/components/KYCElements/IDCardCapture.js.map +1 -1
  80. package/build/components/KYCElements/InitializationStep.d.ts +5 -0
  81. package/build/components/KYCElements/InitializationStep.d.ts.map +1 -0
  82. package/build/components/KYCElements/InitializationStep.js +41 -0
  83. package/build/components/KYCElements/InitializationStep.js.map +1 -0
  84. package/build/components/KYCElements/LocationCaptureTemplate.d.ts.map +1 -1
  85. package/build/components/KYCElements/LocationCaptureTemplate.js +15 -13
  86. package/build/components/KYCElements/LocationCaptureTemplate.js.map +1 -1
  87. package/build/components/KYCElements/OrientationVideoCapture.d.ts +2 -2
  88. package/build/components/KYCElements/OrientationVideoCapture.d.ts.map +1 -1
  89. package/build/components/KYCElements/OrientationVideoCapture.js.map +1 -1
  90. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts +2 -2
  91. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.d.ts.map +1 -1
  92. package/build/components/KYCElements/OrientationVideoCaptureEnhanced.js.map +1 -1
  93. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts +2 -2
  94. package/build/components/KYCElements/OrientationVideoCaptureFinal.d.ts.map +1 -1
  95. package/build/components/KYCElements/OrientationVideoCaptureFinal.js.map +1 -1
  96. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts +12 -0
  97. package/build/components/KYCElements/ReviewSubmitTemplate.d.ts.map +1 -0
  98. package/build/components/KYCElements/ReviewSubmitTemplate.js +171 -0
  99. package/build/components/KYCElements/ReviewSubmitTemplate.js.map +1 -0
  100. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts +6 -2
  101. package/build/components/KYCElements/SelfieCaptureTemplate.d.ts.map +1 -1
  102. package/build/components/KYCElements/SelfieCaptureTemplate.js +105 -35
  103. package/build/components/KYCElements/SelfieCaptureTemplate.js.map +1 -1
  104. package/build/components/KYCElements/VerificationProgressTemplate.d.ts +12 -0
  105. package/build/components/KYCElements/VerificationProgressTemplate.d.ts.map +1 -0
  106. package/build/components/KYCElements/VerificationProgressTemplate.js +93 -0
  107. package/build/components/KYCElements/VerificationProgressTemplate.js.map +1 -0
  108. package/build/components/OverLay/IdCard.d.ts +1 -1
  109. package/build/components/OverLay/IdCard.d.ts.map +1 -1
  110. package/build/components/OverLay/IdCard.js +10 -6
  111. package/build/components/OverLay/IdCard.js.map +1 -1
  112. package/build/components/OverLay/SelfieOverlay.d.ts +1 -1
  113. package/build/components/OverLay/SelfieOverlay.d.ts.map +1 -1
  114. package/build/components/OverLay/SelfieOverlay.js +5 -4
  115. package/build/components/OverLay/SelfieOverlay.js.map +1 -1
  116. package/build/components/OverLay/type.d.ts +71 -1
  117. package/build/components/OverLay/type.d.ts.map +1 -1
  118. package/build/components/OverLay/type.js.map +1 -1
  119. package/build/components/TemplateKYCExample.d.ts.map +1 -1
  120. package/build/components/TemplateKYCExample.js +72 -197
  121. package/build/components/TemplateKYCExample.js.map +1 -1
  122. package/build/components/TemplateKYCFlowRefactored.d.ts.map +1 -1
  123. package/build/components/TemplateKYCFlowRefactored.js +63 -39
  124. package/build/components/TemplateKYCFlowRefactored.js.map +1 -1
  125. package/build/components/VisionCameraView.js +1 -1
  126. package/build/components/VisionCameraView.js.map +1 -1
  127. package/build/components/example/OrientationVideoExample.d.ts.map +1 -1
  128. package/build/components/example/OrientationVideoExample.js +1 -5
  129. package/build/components/example/OrientationVideoExample.js.map +1 -1
  130. package/build/components/ui/Button.js +1 -1
  131. package/build/components/ui/Button.js.map +1 -1
  132. package/build/config/countriesData.d.ts +3 -0
  133. package/build/config/countriesData.d.ts.map +1 -0
  134. package/build/config/countriesData.js +79 -0
  135. package/build/config/countriesData.js.map +1 -0
  136. package/build/config/region_mapping.d.ts +3 -0
  137. package/build/config/region_mapping.d.ts.map +1 -0
  138. package/build/config/region_mapping.js +687 -0
  139. package/build/config/region_mapping.js.map +1 -0
  140. package/build/hooks/useI18n.d.ts +11 -0
  141. package/build/hooks/useI18n.d.ts.map +1 -0
  142. package/build/hooks/useI18n.js +37 -0
  143. package/build/hooks/useI18n.js.map +1 -0
  144. package/build/hooks/useOrientationVideo.d.ts +1 -2
  145. package/build/hooks/useOrientationVideo.d.ts.map +1 -1
  146. package/build/hooks/useOrientationVideo.js +2 -1
  147. package/build/hooks/useOrientationVideo.js.map +1 -1
  148. package/build/hooks/useRealtimeVerifier.d.ts +28 -0
  149. package/build/hooks/useRealtimeVerifier.d.ts.map +1 -0
  150. package/build/hooks/useRealtimeVerifier.js +91 -0
  151. package/build/hooks/useRealtimeVerifier.js.map +1 -0
  152. package/build/hooks/useTemplateKYCFlow.d.ts +1 -0
  153. package/build/hooks/useTemplateKYCFlow.d.ts.map +1 -1
  154. package/build/hooks/useTemplateKYCFlow.js +337 -38
  155. package/build/hooks/useTemplateKYCFlow.js.map +1 -1
  156. package/build/i18n/en/index.d.ts +168 -0
  157. package/build/i18n/en/index.d.ts.map +1 -0
  158. package/build/i18n/en/index.js +195 -0
  159. package/build/i18n/en/index.js.map +1 -0
  160. package/build/i18n/fr/index.d.ts +168 -0
  161. package/build/i18n/fr/index.d.ts.map +1 -0
  162. package/build/i18n/fr/index.js +194 -0
  163. package/build/i18n/fr/index.js.map +1 -0
  164. package/build/i18n/index.d.ts +10 -0
  165. package/build/i18n/index.d.ts.map +1 -0
  166. package/build/i18n/index.js +56 -0
  167. package/build/i18n/index.js.map +1 -0
  168. package/build/i18n/types.d.ts +153 -0
  169. package/build/i18n/types.d.ts.map +1 -0
  170. package/build/i18n/types.js +3 -0
  171. package/build/i18n/types.js.map +1 -0
  172. package/build/i18n/usage-example.d.ts +4 -0
  173. package/build/i18n/usage-example.d.ts.map +1 -0
  174. package/build/i18n/usage-example.js +189 -0
  175. package/build/i18n/usage-example.js.map +1 -0
  176. package/build/modules/api/CardAuthentification.d.ts +22 -0
  177. package/build/modules/api/CardAuthentification.d.ts.map +1 -0
  178. package/build/modules/api/CardAuthentification.js +107 -0
  179. package/build/modules/api/CardAuthentification.js.map +1 -0
  180. package/build/modules/api/KYCService.d.ts +57 -1
  181. package/build/modules/api/KYCService.d.ts.map +1 -1
  182. package/build/modules/api/KYCService.js +348 -27
  183. package/build/modules/api/KYCService.js.map +1 -1
  184. package/build/modules/api/SelfieVerification.d.ts +3 -0
  185. package/build/modules/api/SelfieVerification.d.ts.map +1 -0
  186. package/build/modules/api/SelfieVerification.js +9 -0
  187. package/build/modules/api/SelfieVerification.js.map +1 -0
  188. package/build/modules/api/backendApi.d.ts +2 -0
  189. package/build/modules/api/backendApi.d.ts.map +1 -0
  190. package/build/modules/api/backendApi.js +6 -0
  191. package/build/modules/api/backendApi.js.map +1 -0
  192. package/build/modules/api/types.d.ts +20 -0
  193. package/build/modules/api/types.d.ts.map +1 -0
  194. package/build/modules/api/types.js +2 -0
  195. package/build/modules/api/types.js.map +1 -0
  196. package/build/modules/camera/VisionCameraModule.d.ts +1 -1
  197. package/build/modules/camera/VisionCameraModule.d.ts.map +1 -1
  198. package/build/modules/camera/VisionCameraModule.js +8 -2
  199. package/build/modules/camera/VisionCameraModule.js.map +1 -1
  200. package/build/types/KYC.types.d.ts +59 -7
  201. package/build/types/KYC.types.d.ts.map +1 -1
  202. package/build/types/KYC.types.js +9 -1
  203. package/build/types/KYC.types.js.map +1 -1
  204. package/build/utils/cropByObb.d.ts +11 -0
  205. package/build/utils/cropByObb.d.ts.map +1 -0
  206. package/build/utils/cropByObb.js +78 -0
  207. package/build/utils/cropByObb.js.map +1 -0
  208. package/build/utils/get-document-type-info.d.ts +13 -0
  209. package/build/utils/get-document-type-info.d.ts.map +1 -0
  210. package/build/utils/get-document-type-info.js +59 -0
  211. package/build/utils/get-document-type-info.js.map +1 -0
  212. package/build/utils/pathToBase64.d.ts +3 -0
  213. package/build/utils/pathToBase64.d.ts.map +1 -0
  214. package/build/utils/pathToBase64.js +47 -0
  215. package/build/utils/pathToBase64.js.map +1 -0
  216. package/build/utils/remove-duplicate.d.ts +2 -0
  217. package/build/utils/remove-duplicate.d.ts.map +1 -0
  218. package/build/utils/remove-duplicate.js +4 -0
  219. package/build/utils/remove-duplicate.js.map +1 -0
  220. package/package.json +3 -1
  221. package/src/api/axios.ts +144 -0
  222. package/src/components/EnhancedCameraView.tsx +96 -78
  223. package/src/components/EnhancedCameraView.web.tsx +41 -40
  224. package/src/components/KYCElements/CountrySelectionTemplate.tsx +104 -136
  225. package/src/components/KYCElements/FileUploadTemplate.tsx +14 -8
  226. package/src/components/KYCElements/IDCardCapture.tsx +311 -115
  227. package/src/components/KYCElements/InitializationStep.tsx +53 -0
  228. package/src/components/KYCElements/LocationCaptureTemplate.tsx +17 -15
  229. package/src/components/KYCElements/OrientationVideoCapture.tsx +2 -2
  230. package/src/components/KYCElements/OrientationVideoCaptureEnhanced.tsx +2 -2
  231. package/src/components/KYCElements/OrientationVideoCaptureFinal.tsx +2 -2
  232. package/src/components/KYCElements/ReviewSubmitTemplate.tsx +201 -0
  233. package/src/components/KYCElements/SelfieCaptureTemplate.tsx +140 -53
  234. package/src/components/KYCElements/VerificationProgressTemplate.tsx +123 -0
  235. package/src/components/OverLay/IdCard.tsx +17 -9
  236. package/src/components/OverLay/SelfieOverlay.tsx +6 -5
  237. package/src/components/OverLay/type.ts +64 -2
  238. package/src/components/TemplateKYCExample.tsx +76 -197
  239. package/src/components/TemplateKYCFlowRefactored.tsx +74 -46
  240. package/src/components/VisionCameraView.tsx +1 -1
  241. package/src/components/example/OrientationVideoExample.tsx +3 -7
  242. package/src/components/ui/Button.tsx +1 -1
  243. package/src/config/countriesData.ts +84 -0
  244. package/src/config/region_mapping.ts +688 -0
  245. package/src/hooks/useI18n.ts +53 -0
  246. package/src/hooks/useOrientationVideo.ts +2 -2
  247. package/src/hooks/useRealtimeVerifier.ts +128 -0
  248. package/src/hooks/useTemplateKYCFlow.tsx +375 -53
  249. package/src/i18n/README.md +288 -0
  250. package/src/i18n/en/index.ts +206 -0
  251. package/src/i18n/fr/index.ts +205 -0
  252. package/src/i18n/index.ts +65 -0
  253. package/src/i18n/types.ts +172 -0
  254. package/src/i18n/usage-example.tsx +202 -0
  255. package/src/modules/api/CardAuthentification.ts +114 -0
  256. package/src/modules/api/KYCService.ts +403 -30
  257. package/src/modules/api/SelfieVerification.ts +11 -0
  258. package/src/modules/api/backendApi.ts +8 -0
  259. package/src/modules/api/types.ts +24 -0
  260. package/src/modules/camera/VisionCameraModule.ts +16 -7
  261. package/src/types/KYC.types.ts +83 -14
  262. package/src/utils/cropByObb.ts +99 -0
  263. package/src/utils/get-document-type-info.ts +62 -0
  264. package/src/utils/pathToBase64.ts +47 -0
  265. package/src/utils/remove-duplicate.ts +3 -0
  266. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/results.bin +0 -1
  267. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/BuildConfig.dex +0 -0
  268. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$1.dex +0 -0
  269. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$2.dex +0 -0
  270. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$1.dex +0 -0
  271. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$2.dex +0 -0
  272. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$3.dex +0 -0
  273. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$4.dex +0 -0
  274. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$5.dex +0 -0
  275. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$6.dex +0 -0
  276. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.dex +0 -0
  277. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.dex +0 -0
  278. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.dex +0 -0
  279. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.dex +0 -0
  280. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$View$1.dex +0 -0
  281. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.dex +0 -0
  282. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.dex +0 -0
  283. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkModule.dex +0 -0
  284. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/bundleLibRuntimeToDirDebug_dex/kyc/transfergratis/com/TransfergratisSdkView.dex +0 -0
  285. package/android/build/.transforms/d6df0e53bfc3165a876965af720f910a/transformed/bundleLibRuntimeToDirDebug/desugar_graph.bin +0 -0
  286. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/BuildConfig.class +0 -0
  287. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$1.class +0 -0
  288. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$1$5$2.class +0 -0
  289. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$1.class +0 -0
  290. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$2.class +0 -0
  291. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$3.class +0 -0
  292. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$4.class +0 -0
  293. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$5.class +0 -0
  294. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunction$6.class +0 -0
  295. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$1.class +0 -0
  296. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$2.class +0 -0
  297. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$3.class +0 -0
  298. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$AsyncFunctionWithPromise$4.class +0 -0
  299. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$$inlined$View$1.class +0 -0
  300. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$1.class +0 -0
  301. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule$definition$lambda$5$lambda$4$$inlined$Prop$2.class +0 -0
  302. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkModule.class +0 -0
  303. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/kyc/transfergratis/com/TransfergratisSdkView.class +0 -0
  304. package/android/build/tmp/kotlin-classes/debug/META-INF/transfergratis-sdk_debug.kotlin_module +0 -0
  305. package/src/types/nativewind.d.ts +0 -2
  306. /package/android/build/.transforms/{7ec900c0f64f5f1a7c88998dd44001b8 → 01c28d00c798aa4846f16ce72123ebf9}/results.bin +0 -0
  307. /package/android/build/intermediates/java_res/debug/processDebugJavaRes/out/META-INF/{transfergratis-sdk_debug.kotlin_module → transfergratis-react-native-sdk_debug.kotlin_module} +0 -0
  308. /package/android/build/{intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/META-INF/transfergratis-sdk_debug.kotlin_module → tmp/kotlin-classes/debug/META-INF/transfergratis-react-native-sdk_debug.kotlin_module} +0 -0
@@ -3,27 +3,40 @@ import { View, Text, StyleSheet, Alert, ScrollView } from 'react-native';
3
3
  import { EnhancedCameraView } from '../EnhancedCameraView';
4
4
  import { Button } from '../ui/Button';
5
5
  import { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';
6
+ import { useI18n } from '../../hooks/useI18n';
6
7
  import SelfieOverlay from '../OverLay/SelfieOverlay';
8
+ import selfieVerification from '../../modules/api/SelfieVerification';
9
+ import pathToBase64 from '../../utils/pathToBase64';
7
10
  export const SelfieCaptureTemplate = ({ component, value, onValueChange, error, language, }) => {
11
+ const { t } = useI18n();
8
12
  const config = component.config;
9
- const maxAttempts = config.max_attempts || 3;
10
- const orientations = config.orientations || ['front'];
13
+ const orientations = (config.orientations || ['center']);
11
14
  const { actions, state, } = useTemplateKYCFlowContext();
15
+ const [silentCaptureResult, setSilentCaptureResult] = useState({ success: false, isAnalyzing: false });
12
16
  const [showCamera, setShowCamera] = useState(false);
13
17
  const [currentOrientation, setCurrentOrientation] = useState(orientations[0]);
14
18
  const [capturedImages, setCapturedImages] = useState(value || {});
15
- const [attempts, setAttempts] = useState(0);
16
19
  const getLocalizedText = (text) => {
17
- return text[language] || text.en || '';
20
+ if (!text)
21
+ return '';
22
+ // If text is a nested record (e.g., per theme/device), try to pick a default then localize
23
+ const maybeNested = text;
24
+ if (maybeNested && typeof maybeNested === 'object' && 'en' in maybeNested === false && 'fr' in maybeNested === false) {
25
+ const firstKey = Object.keys(maybeNested)[0];
26
+ const nested = maybeNested[firstKey];
27
+ return nested?.[language] || nested?.en || '';
28
+ }
29
+ const loc = text;
30
+ return loc[language] || loc.en || '';
18
31
  };
19
32
  const getOrientationInstructions = (orientation) => {
20
33
  switch (orientation) {
21
- case 'front':
22
- return 'Prenez un selfie de face, regardez droit devant vous';
34
+ case 'center':
35
+ return state.currentLanguage === "en" ? "Take a selfie of face, look straight ahead you" : "Prenez un selfie de face, regardez droit devant vous";
23
36
  case 'left':
24
- return 'Tournez votre tête vers la gauche, gardez les épaules droites';
37
+ return state.currentLanguage === "en" ? "Turn your head to the left, keep your shoulders straight" : "Tournez votre tête vers la gauche, gardez les épaules droites";
25
38
  case 'right':
26
- return 'Tournez votre tête vers la droite, gardez les épaules droites';
39
+ return state.currentLanguage === "en" ? "Turn your head to the right, keep your shoulders straight" : "Tournez votre tête vers la droite, gardez les épaules droites";
27
40
  default:
28
41
  return getLocalizedText(component.instructions);
29
42
  }
@@ -33,52 +46,102 @@ export const SelfieCaptureTemplate = ({ component, value, onValueChange, error,
33
46
  }, [showCamera]);
34
47
  const getOrientationLabel = (orientation) => {
35
48
  switch (orientation) {
36
- case 'front':
37
- return 'Selfie de face';
49
+ case 'center':
50
+ return state.currentLanguage === "en" ? "Selfie de face" : "Selfie de face";
38
51
  case 'left':
39
- return 'Selfie profil gauche';
52
+ return state.currentLanguage === "en" ? "Selfie profil gauche" : "Selfie profil gauche";
40
53
  case 'right':
41
- return 'Selfie profil droit';
54
+ return state.currentLanguage === "en" ? "Selfie profil droit" : "Selfie profil droit";
42
55
  default:
43
56
  return getLocalizedText(component.labels);
44
57
  }
45
58
  };
59
+ const getOrientationOpposite = (orientation) => {
60
+ switch (orientation) {
61
+ case 'center':
62
+ return 'center';
63
+ case 'left':
64
+ return 'left';
65
+ case 'right':
66
+ return 'right';
67
+ default:
68
+ return orientation;
69
+ }
70
+ };
46
71
  const getInstructions = (orientation) => {
72
+ const lang = state.currentLanguage;
47
73
  switch (orientation) {
48
- case 'front':
49
- return { title: 'Center your face', subtitle: 'Align your face to the center of the selfie area and then take a photo' };
74
+ case 'center':
75
+ return {
76
+ title: lang === "en" ? 'Center your face' : 'Mettez votre face au centre',
77
+ subtitle: lang === "en"
78
+ ? 'Align your face to the center of the selfie area and then take a photo'
79
+ : 'Alignez votre visage au centre de la zone selfie puis prenez une photo'
80
+ };
50
81
  case 'left':
51
- return { title: 'Turn your head left', subtitle: 'Slowly turn your head to the left while keeping your face in the selfie area' };
82
+ return {
83
+ title: lang === 'en'
84
+ ? 'Turn your head left'
85
+ : 'Tournez la tête vers la gauche',
86
+ subtitle: lang === 'en'
87
+ ? 'Slowly turn your head to the left while keeping your face in the selfie area'
88
+ : 'Tournez lentement la tête vers la gauche en gardant votre visage dans la zone selfie'
89
+ };
52
90
  case 'right':
53
- return { title: 'Turn your head right', subtitle: 'Slowly turn your head to the right while keeping your face in the selfie area' };
91
+ return {
92
+ title: lang === 'en'
93
+ ? 'Turn your head right'
94
+ : 'Tournez la tête vers la droite',
95
+ subtitle: lang === 'en'
96
+ ? 'Slowly turn your head to the right while keeping your face in the selfie area'
97
+ : 'Tournez lentement la tête vers la droite en gardant votre visage dans la zone selfie'
98
+ };
54
99
  default:
55
100
  return { title: getLocalizedText(component.labels), subtitle: getLocalizedText(component.instructions) };
56
101
  }
57
102
  };
58
- const handleCapture = (result) => {
103
+ const handleSilentCapture = (result) => {
104
+ if (silentCaptureResult.isAnalyzing) {
105
+ return;
106
+ }
59
107
  if (result.success && result.path) {
60
- const newImages = { ...capturedImages, [currentOrientation]: result.path };
108
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: true, success: false, error: '' }));
109
+ selfieVerification(result.path).then((response) => {
110
+ if (response.length > 0) {
111
+ const res = response[0];
112
+ if (res?.orientation_direction === getOrientationOpposite(currentOrientation) && res?.capture) {
113
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: true, error: '', path: result.path }));
114
+ }
115
+ else {
116
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: 'Le selfie n\'est pas correct' }));
117
+ }
118
+ }
119
+ else {
120
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: 'Le selfie n\'est pas correct' }));
121
+ }
122
+ }).catch((e) => {
123
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: e?.message || 'Erreur de vérification du selfie' }));
124
+ });
125
+ }
126
+ };
127
+ const handleCapture = async (result) => {
128
+ console.log("handleCapturessss", silentCaptureResult);
129
+ if (silentCaptureResult.success && silentCaptureResult.path) {
130
+ const base64 = await pathToBase64(silentCaptureResult.path);
131
+ // Keep backward-compatible structure for UI validation and add *_base64 fields for backend payload
132
+ const newImages = {
133
+ ...capturedImages,
134
+ [currentOrientation]: { dir: silentCaptureResult.path, file: base64 },
135
+ };
61
136
  setCapturedImages(newImages);
62
137
  onValueChange(newImages);
63
138
  setShowCamera(false);
64
- setAttempts(0);
65
139
  // Passer à l'orientation suivante si disponible
66
140
  const currentIndex = orientations.indexOf(currentOrientation);
67
141
  if (currentIndex < orientations.length - 1) {
68
142
  setCurrentOrientation(orientations[currentIndex + 1]);
69
143
  }
70
144
  }
71
- else {
72
- const newAttempts = attempts + 1;
73
- setAttempts(newAttempts);
74
- if (newAttempts >= maxAttempts) {
75
- Alert.alert('Limite atteinte', `Vous avez atteint le nombre maximum de tentatives (${maxAttempts}).`);
76
- setShowCamera(false);
77
- }
78
- else {
79
- Alert.alert('Erreur', result.error || 'Impossible de prendre le selfie');
80
- }
81
- }
82
145
  };
83
146
  const handleError = (event) => {
84
147
  Alert.alert('Erreur', event.message);
@@ -90,9 +153,10 @@ export const SelfieCaptureTemplate = ({ component, value, onValueChange, error,
90
153
  const isAllOrientationsCompleted = () => {
91
154
  return orientations.every(orientation => isOrientationCompleted(orientation));
92
155
  };
156
+ console.log("Current Orientation", currentOrientation);
93
157
  if (showCamera) {
94
158
  return (<View style={styles.containerCamera}>
95
- <EnhancedCameraView instructions={getOrientationInstructions(currentOrientation)} showCamera={true} cameraType="front" style={styles.camera} onCapture={handleCapture} onError={handleError} onClose={() => setShowCamera(false)} quality="high" showCaptureButton={true} showSwitchCamera={false} enableFlash={false} overlayComponent={<SelfieOverlay xMin={20} yMin={140} xMax={370} yMax={340} cornerOpacity={1} instructions={""} orientation={currentOrientation} instructionsTile={getInstructions(currentOrientation).title} instructionsSubtitle={getInstructions(currentOrientation).subtitle} stepperProps={{
159
+ <EnhancedCameraView instructions={getOrientationInstructions(currentOrientation)} showCamera={true} cameraType="front" style={styles.camera} onCapture={handleCapture} onError={handleError} onClose={() => setShowCamera(false)} quality="high" showCaptureButton={true} showSwitchCamera={false} enableFlash={false} silentCaptureResult={silentCaptureResult} onSilentCapture={handleSilentCapture} overlayComponent={<SelfieOverlay xMin={20} yMin={140} xMax={370} yMax={340} cornerOpacity={1} instructions={""} language={state.currentLanguage} orientation={currentOrientation} instructionsTile={getInstructions(currentOrientation).title} instructionsSubtitle={getInstructions(currentOrientation).subtitle} stepperProps={{
96
160
  back: () => {
97
161
  setShowCamera(false);
98
162
  },
@@ -146,25 +210,31 @@ export const SelfieCaptureTemplate = ({ component, value, onValueChange, error,
146
210
  </View>))}
147
211
  <View style={{ backgroundColor: "#F6CB0D1A", width: "100%", padding: 10, borderRadius: 10 }}>
148
212
  <Text style={{ color: '#997E06', fontSize: 16, fontWeight: 'bold' }}>
149
- Tips for a good selfie:
213
+ {state.currentLanguage === "en"
214
+ ? "Tips for a good selfie:"
215
+ : "Conseils pour une bonne photo selfie :"}
150
216
  </Text>
151
217
  <View style={{ paddingLeft: 10, paddingTop: 4 }}>
152
218
  <Text style={{ color: '#997E06', fontSize: 14, fontWeight: 'bold' }}>
153
- {`• Remove glasses and hat \n• Look directly at the camera \n• Ensure good lighting \n`}
219
+ {state.currentLanguage === "en"
220
+ ? `• Remove glasses and hat \n• Look directly at the camera \n• Ensure good lighting \n`
221
+ : `• Retirez vos lunettes et votre chapeau \n• Regardez directement la caméra \n• Assurez-vous d'une bonne luminosité \n`}
154
222
  </Text>
155
223
  </View>
156
224
  </View>
157
225
  <View style={{ height: 10 }}/>
158
226
  {isAllOrientationsCompleted() ? <>
159
- <Button title="Continuer" fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {
227
+ <Button title={t('common.continue')} fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={async () => {
160
228
  onValueChange(capturedImages);
161
229
  actions.nextComponent();
162
230
  }}/>
163
- </> : (<Button title="Start Selfie" fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {
231
+ </> : (<Button title={t('kyc.selfieCapture.captureButton')} fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {
164
232
  if (isAllOrientationsCompleted()) {
165
233
  onValueChange(capturedImages);
234
+ actions.nextComponent();
166
235
  }
167
236
  else {
237
+ setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: '' }));
168
238
  setShowCamera(true);
169
239
  }
170
240
  }}/>)}
@@ -1 +1 @@
1
- {"version":3,"file":"SelfieCaptureTemplate.js","sourceRoot":"","sources":["../../../src/components/KYCElements/SelfieCaptureTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAEzE,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,yBAAyB,EA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,EAAE,SAAS;QAChB,YAAY,EAAE,EAAE;KACjB;IACD,eAAe,EAAE;QACf,eAAe,EAAE,SAAS;QAC1B,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;IACD,mBAAmB,EAAE;QACnB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,OAAO;KACf;IACD,SAAS,EAAE;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,EAAE;KACd;CACF,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { View, Text, StyleSheet, Alert, ScrollView } from 'react-native';\nimport { TemplateComponent, SelfieConfig, LocalizedText } from '../../types/KYC.types';\nimport { EnhancedCameraView } from '../EnhancedCameraView';\nimport { Button } from '../ui/Button';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport SelfieOverlay from '../OverLay/SelfieOverlay';\n\ninterface SelfieCaptureTemplateProps {\n component: TemplateComponent;\n value: Record<string, string> | undefined;\n onValueChange: (value: Record<string, string>) => void;\n error?: string;\n language: string;\n}\n\nexport const SelfieCaptureTemplate: React.FC<SelfieCaptureTemplateProps> = ({\n component,\n value,\n onValueChange,\n error,\n language,\n}) => {\n const config = component.config as SelfieConfig;\n const maxAttempts = config.max_attempts || 3;\n const orientations = config.orientations || ['front'];\n const { actions, state, } = useTemplateKYCFlowContext();\n\n const [showCamera, setShowCamera] = useState(false);\n const [currentOrientation, setCurrentOrientation] = useState<string>(orientations[0]);\n const [capturedImages, setCapturedImages] = useState<Record<string, string>>(value || {});\n const [attempts, setAttempts] = useState(0);\n\n const getLocalizedText = (text: LocalizedText): string => {\n return text[language] || text.en || '';\n };\n\n const getOrientationInstructions = (orientation: string): string => {\n switch (orientation) {\n case 'front':\n return 'Prenez un selfie de face, regardez droit devant vous';\n case 'left':\n return 'Tournez votre tête vers la gauche, gardez les épaules droites';\n case 'right':\n return 'Tournez votre tête vers la droite, gardez les épaules droites';\n default:\n return getLocalizedText(component.instructions);\n }\n };\n\n useEffect(() => {\n actions.showCustomStepper(!showCamera);\n }, [showCamera]);\n\n const getOrientationLabel = (orientation: string): string => {\n switch (orientation) {\n case 'front':\n return 'Selfie de face';\n case 'left':\n return 'Selfie profil gauche';\n case 'right':\n return 'Selfie profil droit';\n default:\n return getLocalizedText(component.labels);\n }\n };\n\n const getInstructions = (orientation: string): { title: string, subtitle: string } => {\n switch (orientation) {\n case 'front':\n return { title: 'Center your face', subtitle: 'Align your face to the center of the selfie area and then take a photo' };\n case 'left':\n return { title: 'Turn your head left', subtitle: 'Slowly turn your head to the left while keeping your face in the selfie area' };\n case 'right':\n return { title: 'Turn your head right', subtitle: 'Slowly turn your head to the right while keeping your face in the selfie area' };\n default:\n return { title: getLocalizedText(component.labels), subtitle: getLocalizedText(component.instructions) };\n }\n };\n\n const handleCapture = (result: { success: boolean; path?: string; error?: string }) => {\n if (result.success && result.path) {\n const newImages = { ...capturedImages, [currentOrientation]: result.path };\n setCapturedImages(newImages);\n onValueChange(newImages);\n setShowCamera(false);\n setAttempts(0);\n\n // Passer à l'orientation suivante si disponible\n const currentIndex = orientations.indexOf(currentOrientation as any);\n if (currentIndex < orientations.length - 1) {\n setCurrentOrientation(orientations[currentIndex + 1]);\n }\n } else {\n const newAttempts = attempts + 1;\n setAttempts(newAttempts);\n\n if (newAttempts >= maxAttempts) {\n Alert.alert(\n 'Limite atteinte',\n `Vous avez atteint le nombre maximum de tentatives (${maxAttempts}).`\n );\n setShowCamera(false);\n } else {\n Alert.alert('Erreur', result.error || 'Impossible de prendre le selfie');\n }\n }\n };\n\n const handleError = (event: { message: string }) => {\n Alert.alert('Erreur', event.message);\n setShowCamera(false);\n };\n\n\n const isOrientationCompleted = (orientation: string): boolean => {\n return !!capturedImages[orientation];\n };\n\n const isAllOrientationsCompleted = (): boolean => {\n return orientations.every(orientation => isOrientationCompleted(orientation));\n };\n\n if (showCamera) {\n return (\n <View style={styles.containerCamera}>\n <EnhancedCameraView\n instructions={getOrientationInstructions(currentOrientation)}\n showCamera={true}\n cameraType=\"front\"\n style={styles.camera}\n onCapture={handleCapture}\n onError={handleError}\n onClose={() => setShowCamera(false)}\n quality=\"high\"\n showCaptureButton={true}\n showSwitchCamera={false}\n enableFlash={false}\n overlayComponent={<SelfieOverlay\n xMin={20}\n yMin={140}\n xMax={370}\n yMax={340}\n cornerOpacity={1}\n instructions={\"\"}\n orientation={currentOrientation as 'front' | 'left' | 'right'}\n instructionsTile={getInstructions(currentOrientation).title}\n instructionsSubtitle={getInstructions(currentOrientation).subtitle}\n stepperProps={{\n back: () => {\n setShowCamera(false);\n },\n selectedDocumentType: \"Selfie\",\n step: state.currentComponentIndex + 1,\n totalSteps: state.template.components.length,\n }} />}\n />\n </View>\n );\n }\n\n\n return (\n <View style={[{\n maxWidth: 760,\n width: '100%',\n height: '100%',\n }]}>\n <View style={styles.container}>\n <Text style={styles.title}>{getLocalizedText(component.labels)}</Text>\n <Text style={styles.description}>{getLocalizedText(component.instructions)}</Text>\n\n <ScrollView style={styles.orientationsContainer} showsVerticalScrollIndicator={false}>\n <View style={{ flexDirection: 'column', alignItems: 'center', gap: 10 }}>\n\n {orientations.map((orientation, key) => (\n <View key={orientation} style={{\n backgroundColor: '#F3F4F6',\n borderRadius: 12,\n flexDirection: 'row',\n alignItems: 'center',\n gap: 10,\n width: '100%',\n paddingVertical: 10,\n paddingHorizontal: 10,\n }}>\n <View style={{\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: isOrientationCompleted(orientation) ? '#2DBE60' : '#D1D5DB',\n borderRadius: 100,\n width: 30,\n height: 30,\n }}>\n <Text style={{ color: 'white', fontSize: 16, fontWeight: 'bold' }}>{key + 1}</Text>\n </View>\n\n\n <Text style={styles.orientationTitle}>\n {getOrientationLabel(orientation)}\n </Text>\n\n\n\n </View>\n ))}\n <View style={{ backgroundColor: \"#F6CB0D1A\", width: \"100%\", padding: 10, borderRadius: 10 }} >\n <Text style={{ color: '#997E06', fontSize: 16, fontWeight: 'bold' }}>\n Tips for a good selfie:\n </Text>\n <View style={{ paddingLeft: 10, paddingTop: 4 }}>\n <Text style={{ color: '#997E06', fontSize: 14, fontWeight: 'bold' }}>\n {`• Remove glasses and hat \\n• Look directly at the camera \\n• Ensure good lighting \\n`}\n </Text>\n </View>\n </View>\n <View style={{ height: 10 }} />\n {isAllOrientationsCompleted() ? <>\n <Button title=\"Continuer\" fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {\n onValueChange(capturedImages);\n actions.nextComponent();\n }} />\n </> : (\n <Button title=\"Start Selfie\" fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {\n if (isAllOrientationsCompleted()) {\n onValueChange(capturedImages);\n } else {\n setShowCamera(true);\n }\n }} />\n )}\n\n </View>\n </ScrollView>\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n paddingVertical: 10,\n },\n container: {\n backgroundColor: 'white',\n margin: 15,\n borderRadius: 20,\n paddingVertical: 20,\n paddingHorizontal: 16,\n // shadow\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.35,\n shadowRadius: 4.84,\n elevation: 10,\n\n\n // padding: 16,\n },\n containerCamera: {\n flex: 1,\n // maxWidth: 760,\n width: '100%',\n height: '100%',\n // borderRadius: 12,\n backgroundColor: '#f5f5f5',\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#333',\n marginBottom: 8,\n textAlign: 'center',\n },\n description: {\n fontSize: 16,\n color: '#666',\n marginBottom: 20,\n lineHeight: 22,\n textAlign: 'center',\n },\n camera: {\n flex: 1,\n // borderRadius: 12,\n overflow: 'hidden',\n },\n attemptsText: {\n fontSize: 14,\n color: '#666',\n textAlign: 'center',\n marginBottom: 10,\n },\n orientationsContainer: {\n // flex: 1,\n },\n orientationContainer: {\n backgroundColor: 'white',\n borderRadius: 12,\n padding: 16,\n marginBottom: 16,\n shadowColor: '#000',\n shadowOffset: {\n width: 0,\n height: 2,\n },\n shadowOpacity: 0.1,\n shadowRadius: 3.84,\n elevation: 5,\n },\n orientationTitle: {\n fontSize: 18,\n fontWeight: '600',\n color: '#333',\n // marginBottom: 12,\n },\n capturedImageContainer: {\n alignItems: 'center',\n },\n capturedImage: {\n width: 200,\n height: 200,\n borderRadius: 12,\n marginBottom: 12,\n },\n captureButton: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#2DBD60',\n paddingVertical: 16,\n paddingHorizontal: 24,\n borderRadius: 12,\n marginTop: 8,\n },\n captureIcon: {\n fontSize: 24,\n marginRight: 8,\n },\n captureText: {\n fontSize: 16,\n fontWeight: '600',\n color: 'white',\n },\n retakeButton: {\n backgroundColor: '#FF6B6B',\n paddingVertical: 12,\n paddingHorizontal: 20,\n borderRadius: 8,\n },\n retakeButtonText: {\n fontSize: 14,\n fontWeight: '600',\n color: 'white',\n },\n completionContainer: {\n alignItems: 'center',\n padding: 20,\n },\n completionText: {\n fontSize: 18,\n fontWeight: '600',\n color: '#2DBD60',\n marginBottom: 16,\n },\n retakeAllButton: {\n backgroundColor: '#FF6B6B',\n paddingVertical: 12,\n paddingHorizontal: 20,\n borderRadius: 8,\n },\n retakeAllButtonText: {\n fontSize: 14,\n fontWeight: '600',\n color: 'white',\n },\n errorText: {\n color: '#dc2626',\n fontSize: 14,\n textAlign: 'center',\n marginTop: 10,\n },\n}); "]}
1
+ {"version":3,"file":"SelfieCaptureTemplate.js","sourceRoot":"","sources":["../../../src/components/KYCElements/SelfieCaptureTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE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EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,OAAO;KACf;IACD,YAAY,EAAE;QACZ,eAAe,EAAE,SAAS;QAC1B,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;IACD,gBAAgB,EAAE;QAChB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,OAAO;KACf;IACD,mBAAmB,EAAE;QACnB,UAAU,EAAE,QAAQ;QACpB,OAAO,EAAE,EAAE;KACZ;IACD,cAAc,EAAE;QACd,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,SAAS;QAChB,YAAY,EAAE,EAAE;KACjB;IACD,eAAe,EAAE;QACf,eAAe,EAAE,SAAS;QAC1B,eAAe,EAAE,EAAE;QACnB,iBAAiB,EAAE,EAAE;QACrB,YAAY,EAAE,CAAC;KAChB;IACD,mBAAmB,EAAE;QACnB,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,KAAK;QACjB,KAAK,EAAE,OAAO;KACf;IACD,SAAS,EAAE;QACT,KAAK,EAAE,SAAS;QAChB,QAAQ,EAAE,EAAE;QACZ,SAAS,EAAE,QAAQ;QACnB,SAAS,EAAE,EAAE;KACd;CACF,CAAC,CAAC","sourcesContent":["import React, { useEffect, useState } from 'react';\nimport { View, Text, StyleSheet, Alert, ScrollView } from 'react-native';\nimport { TemplateComponent, SelfieConfig, LocalizedText, ISilentCaptureResult, OrientationType } from '../../types/KYC.types';\nimport { EnhancedCameraView } from '../EnhancedCameraView';\nimport { Button } from '../ui/Button';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../../hooks/useI18n';\nimport SelfieOverlay from '../OverLay/SelfieOverlay';\nimport selfieVerification from '../../modules/api/SelfieVerification';\nimport pathToBase64 from '../../utils/pathToBase64';\n\ninterface IImagePayload {\n dir: string;\n file: string;\n}\ninterface SelfieCaptureTemplateProps {\n component: TemplateComponent;\n value: Record<string, IImagePayload> | undefined;\n onValueChange: (value: Record<string, IImagePayload>) => void;\n error?: string;\n language: string;\n}\n\nexport const SelfieCaptureTemplate: React.FC<SelfieCaptureTemplateProps> = ({\n component,\n value,\n onValueChange,\n error,\n language,\n}) => {\n const { t } = useI18n();\n const config = component.config as SelfieConfig;\n const orientations: OrientationType[] = (config.orientations || ['center']) as OrientationType[];\n const { actions, state, } = useTemplateKYCFlowContext();\n\n const [silentCaptureResult, setSilentCaptureResult] = useState<ISilentCaptureResult>({ success: false, isAnalyzing: false });\n\n\n const [showCamera, setShowCamera] = useState(false);\n const [currentOrientation, setCurrentOrientation] = useState<OrientationType>(orientations[0]);\n const [capturedImages, setCapturedImages] = useState<Record<string, IImagePayload>>(value || {});\n\n const getLocalizedText = (text: LocalizedText | Record<string, LocalizedText>): string => {\n if (!text) return '';\n // If text is a nested record (e.g., per theme/device), try to pick a default then localize\n const maybeNested = text as Record<string, LocalizedText>;\n if (maybeNested && typeof maybeNested === 'object' && 'en' in maybeNested === false && 'fr' in maybeNested === false) {\n const firstKey = Object.keys(maybeNested)[0];\n const nested = maybeNested[firstKey] as LocalizedText;\n return nested?.[language] || nested?.en || '';\n }\n const loc = text as LocalizedText;\n return loc[language] || loc.en || '';\n };\n\n const getOrientationInstructions = (orientation: OrientationType): string => {\n switch (orientation) {\n case 'center':\n return state.currentLanguage === \"en\" ? \"Take a selfie of face, look straight ahead you\" : \"Prenez un selfie de face, regardez droit devant vous\";\n case 'left':\n return state.currentLanguage === \"en\" ? \"Turn your head to the left, keep your shoulders straight\" : \"Tournez votre tête vers la gauche, gardez les épaules droites\";\n case 'right':\n return state.currentLanguage === \"en\" ? \"Turn your head to the right, keep your shoulders straight\" : \"Tournez votre tête vers la droite, gardez les épaules droites\";\n default:\n return getLocalizedText(component.instructions as LocalizedText);\n }\n };\n\n useEffect(() => {\n actions.showCustomStepper(!showCamera);\n }, [showCamera]);\n\n const getOrientationLabel = (orientation: OrientationType): string => {\n switch (orientation) {\n case 'center':\n return state.currentLanguage === \"en\" ? \"Selfie de face\" : \"Selfie de face\";\n case 'left':\n return state.currentLanguage === \"en\" ? \"Selfie profil gauche\" : \"Selfie profil gauche\";\n case 'right':\n return state.currentLanguage === \"en\" ? \"Selfie profil droit\" : \"Selfie profil droit\";\n default:\n return getLocalizedText(component.labels as LocalizedText);\n }\n };\n const getOrientationOpposite = (orientation: OrientationType): OrientationType => {\n switch (orientation) {\n case 'center':\n\n return 'center';\n case 'left':\n return 'left';\n case 'right':\n return 'right';\n default:\n return orientation;\n }\n }\n\n const getInstructions = (orientation: OrientationType): { title: string, subtitle: string } => {\n const lang = state.currentLanguage;\n switch (orientation) {\n case 'center':\n return {\n title:\n\n lang === \"en\" ? 'Center your face' : 'Mettez votre face au centre',\n subtitle: lang === \"en\"\n ? 'Align your face to the center of the selfie area and then take a photo'\n : 'Alignez votre visage au centre de la zone selfie puis prenez une photo'\n };\n case 'left':\n return {\n title:\n lang === 'en'\n ? 'Turn your head left'\n : 'Tournez la tête vers la gauche',\n subtitle:\n lang === 'en'\n ? 'Slowly turn your head to the left while keeping your face in the selfie area'\n : 'Tournez lentement la tête vers la gauche en gardant votre visage dans la zone selfie'\n };\n case 'right':\n return {\n title:\n lang === 'en'\n ? 'Turn your head right'\n : 'Tournez la tête vers la droite',\n subtitle:\n lang === 'en'\n ? 'Slowly turn your head to the right while keeping your face in the selfie area'\n : 'Tournez lentement la tête vers la droite en gardant votre visage dans la zone selfie'\n };\n default:\n return { title: getLocalizedText(component.labels as LocalizedText), subtitle: getLocalizedText(component.instructions as LocalizedText) };\n }\n };\n\n const handleSilentCapture = (result: { success: boolean; path?: string; error?: string }) => {\n if (silentCaptureResult.isAnalyzing) {\n return;\n }\n if (result.success && result.path) {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: true, success: false, error: '' }));\n selfieVerification(result.path).then((response) => {\n if (response.length > 0) {\n const res = response[0];\n if (res?.orientation_direction === getOrientationOpposite(currentOrientation) && res?.capture) {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: true, error: '', path: result.path }));\n } else {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: 'Le selfie n\\'est pas correct' }));\n }\n } else {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: 'Le selfie n\\'est pas correct' }));\n }\n }).catch((e: any) => {\n\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: e?.message || 'Erreur de vérification du selfie' }));\n });\n }\n }\n\n const handleCapture = async (result: { success: boolean; path?: string; error?: string }) => {\n console.log(\"handleCapturessss\", silentCaptureResult);\n\n if (silentCaptureResult.success && silentCaptureResult.path) {\n const base64 = await pathToBase64(silentCaptureResult.path);\n // Keep backward-compatible structure for UI validation and add *_base64 fields for backend payload\n const newImages: Record<string, any> = {\n ...capturedImages,\n [currentOrientation]: { dir: silentCaptureResult.path, file: base64 } as IImagePayload,\n };\n setCapturedImages(newImages);\n onValueChange(newImages);\n setShowCamera(false);\n\n\n // Passer à l'orientation suivante si disponible\n const currentIndex = orientations.indexOf(currentOrientation as OrientationType);\n if (currentIndex < orientations.length - 1) {\n setCurrentOrientation(orientations[currentIndex + 1]);\n }\n }\n };\n\n const handleError = (event: { message: string }) => {\n Alert.alert('Erreur', event.message);\n setShowCamera(false);\n };\n\n\n const isOrientationCompleted = (orientation: OrientationType): boolean => {\n return !!capturedImages[orientation];\n };\n\n const isAllOrientationsCompleted = (): boolean => {\n return orientations.every(orientation => isOrientationCompleted(orientation));\n };\n console.log(\"Current Orientation\", currentOrientation);\n\n\n if (showCamera) {\n return (\n <View style={styles.containerCamera}>\n <EnhancedCameraView\n instructions={getOrientationInstructions(currentOrientation)}\n showCamera={true}\n cameraType=\"front\"\n style={styles.camera}\n onCapture={handleCapture}\n onError={handleError}\n onClose={() => setShowCamera(false)}\n quality=\"high\"\n showCaptureButton={true}\n showSwitchCamera={false}\n enableFlash={false}\n silentCaptureResult={silentCaptureResult}\n onSilentCapture={handleSilentCapture}\n overlayComponent={<SelfieOverlay\n xMin={20}\n yMin={140}\n xMax={370}\n yMax={340}\n cornerOpacity={1}\n instructions={\"\"}\n language={state.currentLanguage}\n orientation={currentOrientation as 'center' | 'left' | 'right'}\n instructionsTile={getInstructions(currentOrientation).title}\n instructionsSubtitle={getInstructions(currentOrientation).subtitle}\n stepperProps={{\n back: () => {\n setShowCamera(false);\n },\n selectedDocumentType: \"Selfie\",\n step: state.currentComponentIndex + 1,\n totalSteps: state.template.components.length,\n }} />}\n />\n </View>\n );\n }\n\n\n return (\n <View style={[{\n maxWidth: 760,\n width: '100%',\n height: '100%',\n }]}>\n <View style={styles.container}>\n <Text style={styles.title}>{getLocalizedText(component.labels as LocalizedText)}</Text>\n <Text style={styles.description}>{getLocalizedText(component.instructions as LocalizedText)}</Text>\n\n <ScrollView style={styles.orientationsContainer} showsVerticalScrollIndicator={false}>\n <View style={{ flexDirection: 'column', alignItems: 'center', gap: 10 }}>\n\n {orientations.map((orientation, key) => (\n <View key={orientation} style={{\n backgroundColor: '#F3F4F6',\n borderRadius: 12,\n flexDirection: 'row',\n alignItems: 'center',\n gap: 10,\n width: '100%',\n paddingVertical: 10,\n paddingHorizontal: 10,\n }}>\n <View style={{\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: isOrientationCompleted(orientation) ? '#2DBE60' : '#D1D5DB',\n borderRadius: 100,\n width: 30,\n height: 30,\n }}>\n <Text style={{ color: 'white', fontSize: 16, fontWeight: 'bold' }}>{key + 1}</Text>\n </View>\n\n\n <Text style={styles.orientationTitle}>\n {getOrientationLabel(orientation)}\n </Text>\n\n\n\n </View>\n ))}\n <View style={{ backgroundColor: \"#F6CB0D1A\", width: \"100%\", padding: 10, borderRadius: 10 }} >\n <Text style={{ color: '#997E06', fontSize: 16, fontWeight: 'bold' }}>\n {state.currentLanguage === \"en\"\n ? \"Tips for a good selfie:\" \n : \"Conseils pour une bonne photo selfie :\"}\n </Text>\n <View style={{ paddingLeft: 10, paddingTop: 4 }}>\n <Text style={{ color: '#997E06', fontSize: 14, fontWeight: 'bold' }}>\n {state.currentLanguage === \"en\"\n ? `• Remove glasses and hat \\n• Look directly at the camera \\n• Ensure good lighting \\n`\n : `• Retirez vos lunettes et votre chapeau \\n• Regardez directement la caméra \\n• Assurez-vous d'une bonne luminosité \\n`\n }\n </Text>\n </View>\n </View>\n <View style={{ height: 10 }} />\n {isAllOrientationsCompleted() ? <>\n <Button title={t('common.continue')} fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={async () => {\n onValueChange(capturedImages);\n actions.nextComponent();\n }} />\n </> : (\n <Button title={t('kyc.selfieCapture.captureButton')} fullWidth style={{ paddingVertical: 20, paddingTop: 12 }} onPress={() => {\n if (isAllOrientationsCompleted()) {\n onValueChange(capturedImages);\n actions.nextComponent();\n } else {\n setSilentCaptureResult((prev) => ({ ...prev, isAnalyzing: false, success: false, error: '' }));\n setShowCamera(true);\n }\n }} />\n )}\n\n </View>\n </ScrollView>\n\n {error && (\n <Text style={styles.errorText}>{error}</Text>\n )}\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n root: {\n flex: 1,\n paddingVertical: 10,\n },\n container: {\n backgroundColor: 'white',\n margin: 15,\n borderRadius: 20,\n paddingVertical: 20,\n paddingHorizontal: 16,\n // shadow\n shadowColor: '#000',\n shadowOffset: { width: 0, height: 2 },\n shadowOpacity: 0.35,\n shadowRadius: 4.84,\n elevation: 10,\n\n\n // padding: 16,\n },\n containerCamera: {\n flex: 1,\n // maxWidth: 760,\n width: '100%',\n height: '100%',\n // borderRadius: 12,\n backgroundColor: '#f5f5f5',\n },\n title: {\n fontSize: 24,\n fontWeight: 'bold',\n color: '#333',\n marginBottom: 8,\n textAlign: 'center',\n },\n description: {\n fontSize: 16,\n color: '#666',\n marginBottom: 20,\n lineHeight: 22,\n textAlign: 'center',\n },\n camera: {\n flex: 1,\n // borderRadius: 12,\n overflow: 'hidden',\n },\n attemptsText: {\n fontSize: 14,\n color: '#666',\n textAlign: 'center',\n marginBottom: 10,\n },\n orientationsContainer: {\n // flex: 1,\n },\n orientationContainer: {\n backgroundColor: 'white',\n borderRadius: 12,\n padding: 16,\n marginBottom: 16,\n shadowColor: '#000',\n shadowOffset: {\n width: 0,\n height: 2,\n },\n shadowOpacity: 0.1,\n shadowRadius: 3.84,\n elevation: 5,\n },\n orientationTitle: {\n fontSize: 18,\n fontWeight: '600',\n color: '#333',\n // marginBottom: 12,\n },\n capturedImageContainer: {\n alignItems: 'center',\n },\n capturedImage: {\n width: 200,\n height: 200,\n borderRadius: 12,\n marginBottom: 12,\n },\n captureButton: {\n flexDirection: 'row',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: '#2DBD60',\n paddingVertical: 16,\n paddingHorizontal: 24,\n borderRadius: 12,\n marginTop: 8,\n },\n captureIcon: {\n fontSize: 24,\n marginRight: 8,\n },\n captureText: {\n fontSize: 16,\n fontWeight: '600',\n color: 'white',\n },\n retakeButton: {\n backgroundColor: '#FF6B6B',\n paddingVertical: 12,\n paddingHorizontal: 20,\n borderRadius: 8,\n },\n retakeButtonText: {\n fontSize: 14,\n fontWeight: '600',\n color: 'white',\n },\n completionContainer: {\n alignItems: 'center',\n padding: 20,\n },\n completionText: {\n fontSize: 18,\n fontWeight: '600',\n color: '#2DBD60',\n marginBottom: 16,\n },\n retakeAllButton: {\n backgroundColor: '#FF6B6B',\n paddingVertical: 12,\n paddingHorizontal: 20,\n borderRadius: 8,\n },\n retakeAllButtonText: {\n fontSize: 14,\n fontWeight: '600',\n color: 'white',\n },\n errorText: {\n color: '#dc2626',\n fontSize: 14,\n textAlign: 'center',\n marginTop: 10,\n },\n}); "]}
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import { TemplateComponent } from '../../types/KYC.types';
3
+ interface VerificationProgressTemplateProps {
4
+ component: TemplateComponent;
5
+ value: unknown;
6
+ onValueChange: (data: unknown) => void;
7
+ error?: string;
8
+ language?: string;
9
+ }
10
+ export declare const VerificationProgressTemplate: React.FC<VerificationProgressTemplateProps>;
11
+ export {};
12
+ //# sourceMappingURL=VerificationProgressTemplate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VerificationProgressTemplate.d.ts","sourceRoot":"","sources":["../../../src/components/KYCElements/VerificationProgressTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAI1D,UAAU,iCAAiC;IACzC,SAAS,EAAE,iBAAiB,CAAC;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,aAAa,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,4BAA4B,EAAE,KAAK,CAAC,EAAE,CAAC,iCAAiC,CA6EpF,CAAC"}
@@ -0,0 +1,93 @@
1
+ import React from 'react';
2
+ import { View, Text, StyleSheet, TouchableOpacity } from 'react-native';
3
+ import { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';
4
+ import { useI18n } from '../../hooks/useI18n';
5
+ export const VerificationProgressTemplate = () => {
6
+ const { t } = useI18n();
7
+ const { state, actions } = useTemplateKYCFlowContext();
8
+ const verification = state.verification;
9
+ const isSuccess = verification.status === 'success';
10
+ const isFailed = verification.status === 'failed';
11
+ if (isSuccess) {
12
+ return (<View style={styles.container}>
13
+ <Text style={styles.title}>{t('kyc.verificationProgress.steps.complete')}</Text>
14
+ <Text style={styles.subtitle}>{t('kyc.verificationProgress.subtitle')}</Text>
15
+ <TouchableOpacity style={[styles.button, styles.primary]} onPress={() => actions.resetTemplate()}>
16
+ <Text style={styles.buttonText}>{t('common.continue')}</Text>
17
+ </TouchableOpacity>
18
+ {verification.result?.referenceId ? (<Text style={styles.refText}>{`Verification ID: ${verification.result.referenceId}`}</Text>) : null}
19
+ </View>);
20
+ }
21
+ if (isFailed) {
22
+ return (<View style={styles.container}>
23
+ <Text style={styles.title}>{t('kyc.verificationProgress.status.failed')}</Text>
24
+ <Text style={styles.subtitle}>{t('errors.validationError')}</Text>
25
+ <View style={styles.issuesBox}>
26
+ <Text style={styles.issuesTitle}>{t('common.error')}</Text>
27
+ {(verification.result?.issues || []).map((issue, idx) => (<Text key={idx} style={styles.issueItem}>• {issue}</Text>))}
28
+ </View>
29
+ <TouchableOpacity style={[styles.button, styles.primary]} onPress={() => actions.goToComponent(state.template.components.find(c => c.type !== 'review_submit' && c.type !== 'verification_progress')?.id || 0)}>
30
+ <Text style={styles.buttonText}>{t('common.retry')}</Text>
31
+ </TouchableOpacity>
32
+ <TouchableOpacity style={[styles.button, styles.secondary]}>
33
+ <Text style={styles.secondaryText}>{t('common.info')}</Text>
34
+ </TouchableOpacity>
35
+ {verification.result?.referenceId ? (<Text style={styles.refText}>{`Reference ID: ${verification.result.referenceId}`}</Text>) : null}
36
+ </View>);
37
+ }
38
+ return (<View style={styles.container}>
39
+ <Text style={styles.title}>{t('kyc.verificationProgress.title')}</Text>
40
+ <Text style={styles.subtitle}>{t('kyc.verificationProgress.estimatedTime')}</Text>
41
+
42
+ <View style={styles.timeline}>
43
+ <View style={[styles.dot, styles.done]}><Text style={styles.stepCheckmark}>✓</Text></View>
44
+ <View style={styles.line}/>
45
+ <View style={[styles.dot, styles.active]}><Text style={styles.stepCheckmark}>2</Text></View>
46
+ <View style={styles.line}/>
47
+ <View style={[styles.dot, styles.pending]}><Text style={styles.stepCheckmark}>3</Text></View>
48
+ </View>
49
+
50
+ <View style={styles.row}>
51
+ <Text style={styles.stepLabel}>{t('kyc.verificationProgress.status.completed')}</Text>
52
+ <Text style={styles.stepLabel}>{t('kyc.verificationProgress.steps.analyzing')}</Text>
53
+ <Text style={styles.stepLabel}>{t('kyc.verificationProgress.steps.verifying')}</Text>
54
+ </View>
55
+
56
+ <View style={styles.card}>
57
+ <Text style={styles.cardTitle}>{t('kyc.idCardCapture.title')}</Text>
58
+ <Text style={styles.cardLine}>{t('kyc.verificationProgress.steps.extracting')}</Text>
59
+ <Text style={styles.cardTitle}>{t('kyc.selfieCapture.title')}</Text>
60
+ <Text style={styles.cardLine}>{t('kyc.verificationProgress.steps.analyzing')}</Text>
61
+ <Text style={styles.cardTitle}>{t('kyc.verificationProgress.title')}</Text>
62
+ <Text style={styles.cardLine}>{t('kyc.verificationProgress.status.pending')}</Text>
63
+ </View>
64
+ </View>);
65
+ };
66
+ const styles = StyleSheet.create({
67
+ container: { flex: 1, width: '100%', paddingHorizontal: 16, paddingVertical: 12 },
68
+ title: { fontSize: 24, fontWeight: 'bold', color: '#111827', textAlign: 'center', marginTop: 12 },
69
+ subtitle: { fontSize: 14, color: '#6B7280', textAlign: 'center', marginTop: 8 },
70
+ timeline: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginTop: 24 },
71
+ dot: { width: 38, height: 38, borderRadius: 34, justifyContent: 'center', alignItems: 'center' },
72
+ stepCheckmark: { color: 'white', fontSize: 16, fontWeight: 'bold' },
73
+ line: { flex: 1, height: 4, backgroundColor: '#E5E7EB' },
74
+ done: { backgroundColor: '#10B981' },
75
+ active: { backgroundColor: '#F59E0B' },
76
+ pending: { backgroundColor: '#E5E7EB' },
77
+ row: { flexDirection: 'row', justifyContent: 'space-between', marginTop: 8 },
78
+ stepLabel: { fontSize: 14, color: '#111827', fontWeight: '600' },
79
+ card: { backgroundColor: 'white', padding: 16, borderRadius: 16, marginTop: 24 },
80
+ cardTitle: { fontSize: 16, color: '#6B7280', marginTop: 8 },
81
+ cardLine: { fontSize: 18, color: '#111827', fontWeight: '600', marginTop: 2 },
82
+ // Success/Failure specific
83
+ button: { paddingVertical: 14, borderRadius: 10, alignItems: 'center', marginTop: 20 },
84
+ primary: { backgroundColor: '#2DBD60' },
85
+ buttonText: { color: 'white', fontSize: 16, fontWeight: '600' },
86
+ refText: { marginTop: 12, textAlign: 'center', color: '#6B7280' },
87
+ issuesBox: { backgroundColor: '#FEF2F2', borderRadius: 16, padding: 16, marginTop: 20 },
88
+ issuesTitle: { color: '#991B1B', fontWeight: '700', marginBottom: 8 },
89
+ issueItem: { color: '#991B1B', marginTop: 4 },
90
+ secondary: { backgroundColor: '#F3F4F6' },
91
+ secondaryText: { color: '#111827', fontSize: 16, fontWeight: '600' },
92
+ });
93
+ //# sourceMappingURL=VerificationProgressTemplate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VerificationProgressTemplate.js","sourceRoot":"","sources":["../../../src/components/KYCElements/VerificationProgressTemplate.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAExE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAU9C,MAAM,CAAC,MAAM,4BAA4B,GAAgD,GAAG,EAAE;IAC5F,MAAM,EAAE,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC;IACxB,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,GAAG,yBAAyB,EAAE,CAAC;IAEvD,MAAM,YAAY,GAAG,KAAK,CAAC,YAAY,CAAC;IAExC,MAAM,SAAS,GAAG,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC;IACpD,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,KAAK,QAAQ,CAAC;IAElD,IAAI,SAAS,EAAE,CAAC;QACd,OAAO,CACL,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAC5B;QAAA,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,yCAAyC,CAAC,C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AAe,EAAE,SAAS,EAAE,YAAY,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IACvF,WAAW,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,YAAY,EAAE,CAAC,EAAE;IACrE,SAAS,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC,EAAE;IAC7C,SAAS,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE;IACzC,aAAa,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;CACrE,CAAC,CAAC","sourcesContent":["import React from 'react';\nimport { View, Text, StyleSheet, TouchableOpacity } from 'react-native';\nimport { TemplateComponent } from '../../types/KYC.types';\nimport { useTemplateKYCFlowContext } from '../../hooks/useTemplateKYCFlow';\nimport { useI18n } from '../../hooks/useI18n';\n\ninterface VerificationProgressTemplateProps {\n component: TemplateComponent;\n value: unknown;\n onValueChange: (data: unknown) => void;\n error?: string;\n language?: string;\n}\n\nexport const VerificationProgressTemplate: React.FC<VerificationProgressTemplateProps> = () => {\n const { t } = useI18n();\n const { state, actions } = useTemplateKYCFlowContext();\n\n const verification = state.verification;\n\n const isSuccess = verification.status === 'success';\n const isFailed = verification.status === 'failed';\n\n if (isSuccess) {\n return (\n <View style={styles.container}>\n <Text style={styles.title}>{t('kyc.verificationProgress.steps.complete')}</Text>\n <Text style={styles.subtitle}>{t('kyc.verificationProgress.subtitle')}</Text>\n <TouchableOpacity style={[styles.button, styles.primary]} onPress={() => actions.resetTemplate()}>\n <Text style={styles.buttonText}>{t('common.continue')}</Text>\n </TouchableOpacity>\n {verification.result?.referenceId ? (\n <Text style={styles.refText}>{`Verification ID: ${verification.result.referenceId}`}</Text>\n ) : null}\n </View>\n );\n }\n\n if (isFailed) {\n return (\n <View style={styles.container}>\n <Text style={styles.title}>{t('kyc.verificationProgress.status.failed')}</Text>\n <Text style={styles.subtitle}>{t('errors.validationError')}</Text>\n <View style={styles.issuesBox}>\n <Text style={styles.issuesTitle}>{t('common.error')}</Text>\n {(verification.result?.issues || []).map((issue, idx) => (\n <Text key={idx} style={styles.issueItem}>• {issue}</Text>\n ))}\n </View>\n <TouchableOpacity style={[styles.button, styles.primary]} onPress={() => actions.goToComponent( state.template.components.find(c=>c.type!=='review_submit' && c.type!=='verification_progress')?.id || 0)}>\n <Text style={styles.buttonText}>{t('common.retry')}</Text>\n </TouchableOpacity>\n <TouchableOpacity style={[styles.button, styles.secondary]}>\n <Text style={styles.secondaryText}>{t('common.info')}</Text>\n </TouchableOpacity>\n {verification.result?.referenceId ? (\n <Text style={styles.refText}>{`Reference ID: ${verification.result.referenceId}`}</Text>\n ) : null}\n </View>\n );\n }\n\n return (\n <View style={styles.container}>\n <Text style={styles.title}>{t('kyc.verificationProgress.title')}</Text>\n <Text style={styles.subtitle}>{t('kyc.verificationProgress.estimatedTime')}</Text>\n\n <View style={styles.timeline}>\n <View style={[styles.dot, styles.done]}><Text style={styles.stepCheckmark}>✓</Text></View>\n <View style={styles.line} />\n <View style={[styles.dot, styles.active]}><Text style={styles.stepCheckmark}>2</Text></View>\n <View style={styles.line} />\n <View style={[styles.dot, styles.pending]}><Text style={styles.stepCheckmark}>3</Text></View>\n </View>\n\n <View style={styles.row}>\n <Text style={styles.stepLabel}>{t('kyc.verificationProgress.status.completed')}</Text>\n <Text style={styles.stepLabel}>{t('kyc.verificationProgress.steps.analyzing')}</Text>\n <Text style={styles.stepLabel}>{t('kyc.verificationProgress.steps.verifying')}</Text>\n </View>\n\n <View style={styles.card}>\n <Text style={styles.cardTitle}>{t('kyc.idCardCapture.title')}</Text>\n <Text style={styles.cardLine}>{t('kyc.verificationProgress.steps.extracting')}</Text>\n <Text style={styles.cardTitle}>{t('kyc.selfieCapture.title')}</Text>\n <Text style={styles.cardLine}>{t('kyc.verificationProgress.steps.analyzing')}</Text>\n <Text style={styles.cardTitle}>{t('kyc.verificationProgress.title')}</Text>\n <Text style={styles.cardLine}>{t('kyc.verificationProgress.status.pending')}</Text>\n </View>\n </View>\n );\n};\n\nconst styles = StyleSheet.create({\n container: { flex: 1, width: '100%', paddingHorizontal: 16, paddingVertical: 12 },\n title: { fontSize: 24, fontWeight: 'bold', color: '#111827', textAlign: 'center', marginTop: 12 },\n subtitle: { fontSize: 14, color: '#6B7280', textAlign: 'center', marginTop: 8 },\n timeline: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', marginTop: 24 },\n dot: { width: 38, height: 38, borderRadius: 34, justifyContent: 'center', alignItems: 'center' },\n stepCheckmark: { color: 'white', fontSize: 16, fontWeight: 'bold' },\n line: { flex: 1, height: 4, backgroundColor: '#E5E7EB' },\n done: { backgroundColor: '#10B981' },\n active: { backgroundColor: '#F59E0B' },\n pending: { backgroundColor: '#E5E7EB' },\n row: { flexDirection: 'row', justifyContent: 'space-between', marginTop: 8 },\n stepLabel: { fontSize: 14, color: '#111827', fontWeight: '600' },\n card: { backgroundColor: 'white', padding: 16, borderRadius: 16, marginTop: 24 },\n cardTitle: { fontSize: 16, color: '#6B7280', marginTop: 8 },\n cardLine: { fontSize: 18, color: '#111827', fontWeight: '600', marginTop: 2 },\n // Success/Failure specific\n button: { paddingVertical: 14, borderRadius: 10, alignItems: 'center', marginTop: 20 },\n primary: { backgroundColor: '#2DBD60' },\n buttonText: { color: 'white', fontSize: 16, fontWeight: '600' },\n refText: { marginTop: 12, textAlign: 'center', color: '#6B7280' },\n issuesBox: { backgroundColor: '#FEF2F2', borderRadius: 16, padding: 16, marginTop: 20 },\n issuesTitle: { color: '#991B1B', fontWeight: '700', marginBottom: 8 },\n issueItem: { color: '#991B1B', marginTop: 4 },\n secondary: { backgroundColor: '#F3F4F6' },\n secondaryText: { color: '#111827', fontSize: 16, fontWeight: '600' },\n});\n\n\n\n"]}
@@ -1,4 +1,4 @@
1
1
  import { IdCardOverlayProps } from "./type";
2
- declare const IdCardOverlay: ({ xMin: xMinProps, yMin: yMinProps, xMax: xMaxProps, yMax: yMaxProps, cornerOpacity, instructions, cornerColor, stepperProps }: IdCardOverlayProps) => import("react").JSX.Element;
2
+ declare const IdCardOverlay: ({ xMin: xMinProps, yMin: yMinProps, xMax: xMaxProps, yMax: yMaxProps, cornerOpacity, instructions, cornerColor, stepperProps, isSuccess, language }: IdCardOverlayProps) => import("react").JSX.Element;
3
3
  export default IdCardOverlay;
4
4
  //# sourceMappingURL=IdCard.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"IdCard.d.ts","sourceRoot":"","sources":["../../../src/components/OverLay/IdCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAM5C,QAAA,MAAM,aAAa,GAAI,gIAA4I,kBAAkB,gCA2IpL,CAAA;AAED,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"IdCard.d.ts","sourceRoot":"","sources":["../../../src/components/OverLay/IdCard.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAM5C,QAAA,MAAM,aAAa,GAAI,qJAAkK,kBAAkB,gCAmJ1M,CAAA;AAED,eAAe,aAAa,CAAC"}
@@ -2,7 +2,7 @@ import { Animated, Dimensions, StyleSheet, Text, View } from "react-native";
2
2
  import Svg, { Defs, Mask, Rect, Path } from "react-native-svg";
3
3
  import ScanningLine from "../Svgs/scanningLine";
4
4
  import StepOverlay from "./StepOverlay";
5
- const IdCardOverlay = ({ xMin: xMinProps, yMin: yMinProps, xMax: xMaxProps, yMax: yMaxProps, cornerOpacity, instructions, cornerColor = "#4CAF50", stepperProps }) => {
5
+ const IdCardOverlay = ({ xMin: xMinProps, yMin: yMinProps, xMax: xMaxProps, yMax: yMaxProps, cornerOpacity, instructions, cornerColor = "#4CAF50", stepperProps, isSuccess, language }) => {
6
6
  const screenWidth = Dimensions.get('window').width;
7
7
  const screenHeight = Dimensions.get('window').height;
8
8
  const boxWidth = xMaxProps - xMinProps;
@@ -14,7 +14,7 @@ const IdCardOverlay = ({ xMin: xMinProps, yMin: yMinProps, xMax: xMaxProps, yMax
14
14
  const yMax = yMin + boxHeight;
15
15
  return (<View style={StyleSheet.absoluteFill}>
16
16
  {stepperProps ? (<StepOverlay {...stepperProps}/>) : null}
17
-
17
+
18
18
  <Animated.View style={[styles.topIntruction]}>
19
19
  <Text style={styles.topIntructionText}>
20
20
  💡 {instructions}
@@ -51,15 +51,19 @@ const IdCardOverlay = ({ xMin: xMinProps, yMin: yMinProps, xMax: xMaxProps, yMax
51
51
  <Path d={`M ${xMax - 15} ${yMax} Q ${xMax} ${yMax} ${xMax} ${yMax - 15} L ${xMax} ${yMax - 20}`} stroke={cornerColor} strokeWidth="8" fill="none" opacity={cornerOpacity}/>
52
52
  <Path d={`M ${xMax - 20} ${yMax} L ${xMax - 15} ${yMax}`} stroke={cornerColor} strokeWidth="8" opacity={cornerOpacity}/>
53
53
  </Svg>
54
-
55
- <ScanningLine yMin={yMin} screenWidth={screenWidth} height={screenHeight} yMax={yMax}/>
54
+ {isSuccess ? null : (<ScanningLine yMin={yMin} screenWidth={screenWidth} height={screenHeight} yMax={yMax}/>)}
55
+ {/* <ScanningLine yMin={yMin} screenWidth={screenWidth} height={screenHeight} yMax={yMax} /> */}
56
56
 
57
57
  <View style={styles.bottomIntruction}>
58
58
  <Text style={styles.bottomTitle}>
59
- Mesurez 100cm de hauteur.
59
+ {language === "en" ? "Measure 100cm in height." : "Mesurez 100cm de hauteur."}
60
+
60
61
  </Text>
61
62
  <Text style={styles.bottomSubtitle}>
62
- Ne pas déplacer la caméra pendant la capture. • Ne pas déplacer la caméra pendant la capture.
63
+ {language === "en"
64
+ ? "Do not move the camera during capture. • Do not move the camera during capture."
65
+ : "Ne pas déplacer la caméra pendant la capture. • Ne pas déplacer la caméra pendant la capture."}
66
+
63
67
  </Text>
64
68
  </View>
65
69
  </View>);