react-native-timacare 3.3.11 → 3.3.12

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 (43) hide show
  1. package/lib/commonjs/RNTimacare.js +1 -1
  2. package/lib/commonjs/RNTimacare.js.flow +2 -2
  3. package/lib/commonjs/RNTimacare.js.map +1 -1
  4. package/lib/commonjs/screens/camera/CCCDCameraScreen.js +1 -1
  5. package/lib/commonjs/screens/camera/CCCDCameraScreen.js.flow +248 -112
  6. package/lib/commonjs/screens/camera/CCCDCameraScreen.js.map +1 -1
  7. package/lib/commonjs/screens/nationalID/index.js +1 -1
  8. package/lib/commonjs/screens/nationalID/index.js.flow +4 -2
  9. package/lib/commonjs/screens/nationalID/index.js.map +1 -1
  10. package/lib/commonjs/screens/nationalIDBack/index.js +1 -1
  11. package/lib/commonjs/screens/nationalIDBack/index.js.flow +3 -1
  12. package/lib/commonjs/screens/nationalIDBack/index.js.map +1 -1
  13. package/lib/commonjs/screens/uploadVideo/index.js +1 -1
  14. package/lib/commonjs/screens/uploadVideo/index.js.flow +109 -61
  15. package/lib/commonjs/screens/uploadVideo/index.js.map +1 -1
  16. package/lib/commonjs/screens/uploadVideo/videoStore.js +1 -1
  17. package/lib/commonjs/screens/uploadVideo/videoStore.js.flow +4 -4
  18. package/lib/commonjs/screens/uploadVideo/videoStore.js.map +1 -1
  19. package/lib/module/RNTimacare.js +1 -1
  20. package/lib/module/RNTimacare.js.map +1 -1
  21. package/lib/module/screens/camera/CCCDCameraScreen.js +1 -1
  22. package/lib/module/screens/camera/CCCDCameraScreen.js.map +1 -1
  23. package/lib/module/screens/nationalID/index.js +1 -1
  24. package/lib/module/screens/nationalID/index.js.map +1 -1
  25. package/lib/module/screens/nationalIDBack/index.js +1 -1
  26. package/lib/module/screens/nationalIDBack/index.js.map +1 -1
  27. package/lib/module/screens/uploadVideo/index.js +1 -1
  28. package/lib/module/screens/uploadVideo/index.js.map +1 -1
  29. package/lib/module/screens/uploadVideo/videoStore.js +1 -1
  30. package/lib/module/screens/uploadVideo/videoStore.js.map +1 -1
  31. package/lib/typescript/RNTimacare.d.ts +1 -1
  32. package/lib/typescript/RNTimacare.d.ts.map +1 -1
  33. package/lib/typescript/screens/camera/CCCDCameraScreen.d.ts.map +1 -1
  34. package/lib/typescript/screens/nationalID/index.d.ts.map +1 -1
  35. package/lib/typescript/screens/nationalIDBack/index.d.ts.map +1 -1
  36. package/lib/typescript/screens/uploadVideo/index.d.ts.map +1 -1
  37. package/package.json +3 -2
  38. package/src/RNTimacare.tsx +2 -2
  39. package/src/screens/camera/CCCDCameraScreen.tsx +248 -112
  40. package/src/screens/nationalID/index.tsx +4 -2
  41. package/src/screens/nationalIDBack/index.tsx +3 -1
  42. package/src/screens/uploadVideo/index.tsx +109 -61
  43. package/src/screens/uploadVideo/videoStore.tsx +4 -4
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.RNTimacare=RNTimacare;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _react=_interopRequireWildcard(require("react"));var _navigation=require("./navigation");var _reactNative=require("react-native");var _AppStore=_interopRequireDefault(require("./AppStore"));var _reactNativeFbsdkNext=require("react-native-fbsdk-next");var _jsxFileName="/Users/tima/Documents/Tima/tima-care-v2-sdk/src/RNTimacare.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}function RNTimacare(props){(0,_react.useEffect)(function(){if(_reactNative.Platform.OS==='android'){_reactNativeFbsdkNext.Settings.initializeSDK();}_AppStore.default.getDeviceId();_AppStore.default.getPublicIp();_AppStore.default.getAppId();_AppStore.default.getDevicePayload();},[]);return _react.default.createElement(_navigation.PrimaryNavigator,(0,_extends2.default)({},props,{__self:this,__source:{fileName:_jsxFileName,lineNumber:18,columnNumber:10}}));}
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.RNTimacare=RNTimacare;var _react=_interopRequireWildcard(require("react"));var _navigation=require("./navigation");var _reactNative=require("react-native");var _AppStore=_interopRequireDefault(require("./AppStore"));var _reactNativeFbsdkNext=require("react-native-fbsdk-next");var _jsxFileName="/Users/tima/Documents/Tima/tima-care-v2-sdk/src/RNTimacare.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}function RNTimacare(){(0,_react.useEffect)(function(){if(_reactNative.Platform.OS==='android'){_reactNativeFbsdkNext.Settings.initializeSDK();}_AppStore.default.getDeviceId();_AppStore.default.getPublicIp();_AppStore.default.getAppId();_AppStore.default.getDevicePayload();},[]);return _react.default.createElement(_navigation.PrimaryNavigator,{__self:this,__source:{fileName:_jsxFileName,lineNumber:18,columnNumber:10}});}
2
2
  //# sourceMappingURL=RNTimacare.js.map
@@ -5,7 +5,7 @@ import { Platform } from 'react-native';
5
5
  import appStore from './AppStore';
6
6
  import { Settings } from 'react-native-fbsdk-next';
7
7
 
8
- export function RNTimacare(props) {
8
+ export function RNTimacare() {
9
9
  useEffect(() => {
10
10
  if (Platform.OS === 'android') {
11
11
  Settings.initializeSDK();
@@ -15,5 +15,5 @@ export function RNTimacare(props) {
15
15
  appStore.getAppId();
16
16
  appStore.getDevicePayload();
17
17
  }, []);
18
- return <PrimaryNavigator {...props} />;
18
+ return <PrimaryNavigator />;
19
19
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_navigation","_reactNative","_AppStore","_interopRequireDefault","_reactNativeFbsdkNext","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","RNTimacare","props","useEffect","Platform","OS","Settings","initializeSDK","appStore","getDeviceId","getPublicIp","getAppId","getDevicePayload","createElement","PrimaryNavigator","_extends2","__self","__source","fileName","lineNumber","columnNumber"],"sourceRoot":"../../src","sources":["RNTimacare.tsx"],"mappings":"0PACA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,WAAA,CAAAD,OAAA,iBACA,IAAAE,YAAA,CAAAF,OAAA,iBACA,IAAAG,SAAA,CAAAC,sBAAA,CAAAJ,OAAA,gBACA,IAAAK,qBAAA,CAAAL,OAAA,4BAAmD,IAAAM,YAAA,2EAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAT,wBAAAS,CAAA,CAAAE,CAAA,MAA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AAE,CAAC,CACN,MAAO,CAAAzC,MAAA,CAAAe,OAAA,CAAA2B,aAAA,CAACvC,WAAA,CAAAwC,gBAAgB,IAAAC,SAAA,CAAA7B,OAAA,KAAKgB,KAAK,EAAAc,MAAA,MAAAC,QAAA,EAAAC,QAAA,CAAAvC,YAAA,CAAAwC,UAAA,IAAAC,YAAA,MAAG,CAAC,CACxC"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_navigation","_reactNative","_AppStore","_interopRequireDefault","_reactNativeFbsdkNext","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","RNTimacare","useEffect","Platform","OS","Settings","initializeSDK","appStore","getDeviceId","getPublicIp","getAppId","getDevicePayload","createElement","PrimaryNavigator","__self","__source","fileName","lineNumber","columnNumber"],"sourceRoot":"../../src","sources":["RNTimacare.tsx"],"mappings":"0KACA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,WAAA,CAAAD,OAAA,iBACA,IAAAE,YAAA,CAAAF,OAAA,iBACA,IAAAG,SAAA,CAAAC,sBAAA,CAAAJ,OAAA,gBACA,IAAAK,qBAAA,CAAAL,OAAA,4BAAmD,IAAAM,YAAA,2EAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,CAAA,CAAAD,CAAA,IAAAF,CAAA,YAAAT,wBAAAS,CAAA,CAAAE,CAAA,MAAAA,CAAA,EAAAF,CAAA,EAAAA,CAAA,CAAAI,UAAA,QAAAJ,CAAA,WAAAA,CAAA,mBAAAA,CAAA,qBAAAA,CAAA,QAAAK,OAAA,CAAAL,CAAA,MAAAG,CAAA,CAAAJ,wBAAA,CAAAG,CAAA,KAAAC,CAAA,EAAAA,CAAA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 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=CCCDCameraScreen;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeVisionCamera=require("react-native-vision-camera");var _icons=require("../../assets/icons");var _MText=require("../../components/MText");var _imageEditor=_interopRequireDefault(require("@react-native-community/image-editor"));var _native=require("@react-navigation/native");var _reactNativeDeviceInfo=_interopRequireDefault(require("react-native-device-info"));var _jsxFileName="/Users/tima/Documents/Tima/tima-care-v2-sdk/src/screens/camera/CCCDCameraScreen.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var _Dimensions$get=_reactNative.Dimensions.get('window'),screenWidth=_Dimensions$get.width,screenHeight=_Dimensions$get.height;var frameWidth=screenWidth*0.85;var frameHeight=frameWidth*0.63;var frameLeft=(screenWidth-frameWidth)/2;var frameTop=(screenWidth*4/3-frameHeight)/2;function CCCDCameraScreen(props){var navigation=(0,_native.useNavigation)();var camera=(0,_react.useRef)(null);var device=(0,_reactNativeVisionCamera.useCameraDevice)('back');var _useState=(0,_react.useState)(true),_useState2=(0,_slicedToArray2.default)(_useState,2),cameraActive=_useState2[0],setCameraActive=_useState2[1];var _useCameraPermission=(0,_reactNativeVisionCamera.useCameraPermission)(),hasPermission=_useCameraPermission.hasPermission,requestPermission=_useCameraPermission.requestPermission;(0,_react.useEffect)(function(){if(!hasPermission)requestPermission();},[hasPermission,requestPermission]);var takePicture=function _callee2(){var photo;return _regenerator.default.async(function _callee2$(_context2){while(1)switch(_context2.prev=_context2.next){case 0:if(!(camera.current==null)){_context2.next=2;break;}return _context2.abrupt("return");case 2:_context2.next=4;return _regenerator.default.awrap(camera.current.takePhoto({skipMetadata:true}));case 4:photo=_context2.sent;_reactNative.Image.getSize("file://"+photo.path,function _callee(width,height){var previewHeight,scaleX,scaleY,cropData,croppedUri;return _regenerator.default.async(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:previewHeight=screenWidth*4/3;scaleX=width/screenWidth;scaleY=height/previewHeight;cropData={offset:{x:frameLeft*scaleX,y:frameTop*scaleY},size:{width:frameWidth*scaleX,height:frameHeight*scaleY},displaySize:{width:frameWidth*scaleX,height:frameHeight*scaleY},resizeMode:'contain'};_context.prev=4;_context.next=7;return _regenerator.default.awrap(_imageEditor.default.cropImage("file://"+photo.path,cropData));case 7:croppedUri=_context.sent;setCameraActive(false);navigation.goBack();if(props.route.params.callback){props.route.params.callback(croppedUri.uri);}_context.next=16;break;case 13:_context.prev=13;_context.t0=_context["catch"](4);console.error(_context.t0);case 16:case"end":return _context.stop();}},null,null,[[4,13]],Promise);});case 6:case"end":return _context2.stop();}},null,null,null,Promise);};if(!device||!hasPermission)return _react.default.createElement(_reactNative.View,{style:{flex:1,backgroundColor:'#000'},__self:this,__source:{fileName:_jsxFileName,lineNumber:87,columnNumber:12}});return _react.default.createElement(_reactNative.View,{style:styles.container,__self:this,__source:{fileName:_jsxFileName,lineNumber:89,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:styles.topContainer,__self:this,__source:{fileName:_jsxFileName,lineNumber:90,columnNumber:7}},_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){navigation.goBack();},style:[{width:48,height:48,zIndex:1000,alignItems:'center'}],__self:this,__source:{fileName:_jsxFileName,lineNumber:91,columnNumber:9}},_react.default.createElement(_icons.IconBackWhite,{__self:this,__source:{fileName:_jsxFileName,lineNumber:99,columnNumber:11}}))),_react.default.createElement(_reactNativeVisionCamera.Camera,{style:styles.camera,device:device,isActive:cameraActive,photo:true,ref:camera,__self:this,__source:{fileName:_jsxFileName,lineNumber:102,columnNumber:7}}),_react.default.createElement(_reactNative.View,{style:styles.overlay,__self:this,__source:{fileName:_jsxFileName,lineNumber:109,columnNumber:7}},_react.default.createElement(_reactNative.View,{style:styles.darkOverlayTop,__self:this,__source:{fileName:_jsxFileName,lineNumber:110,columnNumber:9}}),_react.default.createElement(_reactNative.View,{style:styles.row,__self:this,__source:{fileName:_jsxFileName,lineNumber:111,columnNumber:9}},_react.default.createElement(_reactNative.View,{style:styles.darkOverlaySide,__self:this,__source:{fileName:_jsxFileName,lineNumber:112,columnNumber:11}}),_react.default.createElement(_reactNative.View,{style:styles.frameBorder,__self:this,__source:{fileName:_jsxFileName,lineNumber:113,columnNumber:11}}),_react.default.createElement(_reactNative.View,{style:styles.darkOverlaySide,__self:this,__source:{fileName:_jsxFileName,lineNumber:114,columnNumber:11}})),_react.default.createElement(_reactNative.View,{style:styles.darkOverlayBottom,__self:this,__source:{fileName:_jsxFileName,lineNumber:116,columnNumber:9}})),_react.default.createElement(_reactNative.View,{style:styles.captureButton,__self:this,__source:{fileName:_jsxFileName,lineNumber:118,columnNumber:7}},_react.default.createElement(_MText.MText,{style:{color:'#fff',marginBottom:16,textAlign:'center',paddingHorizontal:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:119,columnNumber:9}},"Vui l\xF2ng \u0111\u1EB7t gi\u1EA5y t\u1EDD n\u1EB1m v\u1EEBa khung h\xECnh ch\u1EEF nh\u1EADt, ch\u1EE5p \u0111\u1EE7 \xE1nh s\xE1ng v\xE0 r\xF5 n\xE9t."),_react.default.createElement(_reactNative.TouchableOpacity,{onPress:takePicture,__self:this,__source:{fileName:_jsxFileName,lineNumber:130,columnNumber:9}},_react.default.createElement(_icons.TakePhotoSvg,{__self:this,__source:{fileName:_jsxFileName,lineNumber:131,columnNumber:11}}))));}var overlayColor='rgba(22, 22, 22, 0.7)';var styles=_reactNative.StyleSheet.create({container:{flex:1,backgroundColor:'#000'},camera:{flex:1},overlay:(0,_extends2.default)({},_reactNative.StyleSheet.absoluteFillObject,{justifyContent:'center',alignItems:'center'}),frameBorder:{width:frameWidth,height:frameHeight,borderColor:'#FDFDFD',borderWidth:2},row:{flexDirection:'row',alignItems:'center'},darkOverlayTop:{width:'100%',height:(screenHeight-frameHeight)/2,backgroundColor:overlayColor},darkOverlayBottom:{width:'100%',height:(screenHeight-frameHeight)/2,backgroundColor:overlayColor},darkOverlaySide:{width:(screenWidth-frameWidth)/2,height:frameHeight,backgroundColor:overlayColor},captureContainer:{position:'absolute',bottom:40,width:'100%',alignItems:'center'},captureButton:{position:'absolute',bottom:30,alignSelf:'center',flexDirection:'column',alignItems:'center'},topContainer:{position:'absolute',top:_reactNativeDeviceInfo.default.hasNotch()?60:24},textContainer:{position:'absolute',top:_reactNativeDeviceInfo.default.hasNotch()?60:24}});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=CCCDCameraScreen;var _extends2=_interopRequireDefault(require("@babel/runtime/helpers/extends"));var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _reactNativeVisionCamera=require("react-native-vision-camera");var _icons=require("../../assets/icons");var _MText=require("../../components/MText");var _native=require("@react-navigation/native");var _reactNativeSafeAreaContext=require("react-native-safe-area-context");var _reactNativeImageManipulator=_interopRequireDefault(require("@oguzhnatly/react-native-image-manipulator"));var _jsxFileName="/Users/tima/Documents/Tima/tima-care-v2-sdk/src/screens/camera/CCCDCameraScreen.tsx",_this=this;function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var _Dimensions$get=_reactNative.Dimensions.get('window'),screenWidth=_Dimensions$get.width,screenHeight=_Dimensions$get.height;var getImageSize=function getImageSize(uri){return new Promise(function(resolve,reject){_reactNative.Image.getSize(uri,function(width,height){return resolve({width:width,height:height});},function(err){return reject(err);});});};var clamp=function clamp(value,min,max){return Math.min(Math.max(value,min),max);};function CCCDCameraScreen(props){var _props$route2,_props$route2$params;var insets=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)();var navigation=(0,_native.useNavigation)();var camera=(0,_react.useRef)(null);var device=(0,_reactNativeVisionCamera.useCameraDevice)('back');var _useState=(0,_react.useState)(true),_useState2=(0,_slicedToArray2.default)(_useState,2),cameraActive=_useState2[0],setCameraActive=_useState2[1];var _useCameraPermission=(0,_reactNativeVisionCamera.useCameraPermission)(),hasPermission=_useCameraPermission.hasPermission,requestPermission=_useCameraPermission.requestPermission;var _useState3=(0,_react.useState)({width:screenWidth,height:screenHeight}),_useState4=(0,_slicedToArray2.default)(_useState3,2),previewLayout=_useState4[0],setPreviewLayout=_useState4[1];(0,_react.useEffect)(function(){if(!hasPermission)requestPermission();},[hasPermission,requestPermission]);var takePicture=function _callee(){var photo,_props$route,_props$route$params,imageUri,_await$getImageSize,width,height,previewWidth,previewHeight,_frameWidth,_frameHeight,_frameX,_frameY,scale,renderedWidth,renderedHeight,offsetX,offsetY,cropX,cropY,cropWidth,cropHeight,cropXInt,cropYInt,cropWidthInt,cropHeightInt,cropData,result;return _regenerator.default.async(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:if(!(camera.current==null)){_context.next=2;break;}return _context.abrupt("return");case 2:_context.next=4;return _regenerator.default.awrap(camera.current.takePhoto({skipMetadata:true}));case 4:photo=_context.sent;_context.prev=5;imageUri="file://"+photo.path;_context.next=9;return _regenerator.default.awrap(getImageSize(imageUri));case 9:_await$getImageSize=_context.sent;width=_await$getImageSize.width;height=_await$getImageSize.height;previewWidth=previewLayout.width||screenWidth;previewHeight=previewLayout.height||screenHeight;_frameWidth=previewWidth*0.85;_frameHeight=_frameWidth*0.63;_frameX=(previewWidth-_frameWidth)/2;_frameY=(previewHeight-_frameHeight)/2;scale=Math.max(previewWidth/width,previewHeight/height);renderedWidth=width*scale;renderedHeight=height*scale;offsetX=(renderedWidth-previewWidth)/2;offsetY=(renderedHeight-previewHeight)/2;cropX=(_frameX+offsetX)/scale;cropY=(_frameY+offsetY)/scale;cropWidth=_frameWidth/scale;cropHeight=_frameHeight/scale;cropXInt=Math.floor(clamp(cropX,0,Math.max(0,width-1)));cropYInt=Math.floor(clamp(cropY,0,Math.max(0,height-1)));cropWidthInt=Math.floor(clamp(cropWidth,1,Math.max(1,width-cropXInt)));cropHeightInt=Math.floor(clamp(cropHeight,1,Math.max(1,height-cropYInt)));cropData={offset:{x:cropXInt,y:cropYInt},size:{width:cropWidthInt,height:cropHeightInt}};_context.next=34;return _regenerator.default.awrap(_reactNativeImageManipulator.default.manipulate(imageUri,[{crop:{originX:cropXInt,originY:cropYInt,width:cropWidthInt,height:cropHeightInt}}],{format:'jpg',compress:1}));case 34:result=_context.sent;setCameraActive(false);navigation.goBack();if((_props$route=props.route)!=null&&(_props$route$params=_props$route.params)!=null&&_props$route$params.callback){props.route.params.callback(result==null?void 0:result.uri);}_context.next=43;break;case 40:_context.prev=40;_context.t0=_context["catch"](5);console.error(_context.t0);case 43:case"end":return _context.stop();}},null,null,[[5,40]],Promise);};if(!device||!hasPermission)return _react.default.createElement(_reactNative.View,{style:{flex:1,backgroundColor:'#000'},__self:this,__source:{fileName:_jsxFileName,lineNumber:136,columnNumber:12}});var frameWidth=previewLayout.width*0.85;var frameHeight=frameWidth*0.63;var frameX=(previewLayout.width-frameWidth)/2;var frameY=(previewLayout.height-frameHeight)/2;return _react.default.createElement(_reactNative.View,{style:$container,onLayout:function onLayout(e){var _e$nativeEvent$layout=e.nativeEvent.layout,width=_e$nativeEvent$layout.width,height=_e$nativeEvent$layout.height;if(width>0&&height>0)setPreviewLayout({width:width,height:height});},__self:this,__source:{fileName:_jsxFileName,lineNumber:144,columnNumber:5}},_react.default.createElement(_reactNativeVisionCamera.Camera,{style:{flex:1},device:device,isActive:cameraActive,photo:true,ref:camera,__self:this,__source:{fileName:_jsxFileName,lineNumber:151,columnNumber:7}}),_react.default.createElement(_reactNative.View,{style:$overlay,pointerEvents:"none",__self:this,__source:{fileName:_jsxFileName,lineNumber:158,columnNumber:7}},_react.default.createElement(_reactNative.View,{style:[$darkOverlayTop,{height:frameY}],__self:this,__source:{fileName:_jsxFileName,lineNumber:159,columnNumber:9}}),_react.default.createElement(_reactNative.View,{style:$row,__self:this,__source:{fileName:_jsxFileName,lineNumber:160,columnNumber:9}},_react.default.createElement(_reactNative.View,{style:[$darkOverlaySide,{width:frameX,height:frameHeight}],__self:this,__source:{fileName:_jsxFileName,lineNumber:161,columnNumber:11}}),_react.default.createElement(_reactNative.View,{style:[$frameBorder,{width:frameWidth,height:frameHeight}],__self:this,__source:{fileName:_jsxFileName,lineNumber:164,columnNumber:11}},_react.default.createElement(Corner,{style:{top:0,left:0,borderTopWidth:CORNER_WIDTH,borderLeftWidth:CORNER_WIDTH,borderColor:BORDER_COLOR},__self:this,__source:{fileName:_jsxFileName,lineNumber:168,columnNumber:13}}),_react.default.createElement(Corner,{style:{top:0,right:0,borderTopWidth:CORNER_WIDTH,borderRightWidth:CORNER_WIDTH,borderColor:BORDER_COLOR},__self:this,__source:{fileName:_jsxFileName,lineNumber:179,columnNumber:13}}),_react.default.createElement(Corner,{style:{bottom:0,left:0,borderBottomWidth:CORNER_WIDTH,borderLeftWidth:CORNER_WIDTH,borderColor:BORDER_COLOR},__self:this,__source:{fileName:_jsxFileName,lineNumber:190,columnNumber:13}}),_react.default.createElement(Corner,{style:{bottom:0,right:0,borderBottomWidth:CORNER_WIDTH,borderRightWidth:CORNER_WIDTH,borderColor:BORDER_COLOR},__self:this,__source:{fileName:_jsxFileName,lineNumber:201,columnNumber:13}})),_react.default.createElement(_reactNative.View,{style:[$darkOverlaySide,{width:frameX,height:frameHeight}],__self:this,__source:{fileName:_jsxFileName,lineNumber:211,columnNumber:11}})),_react.default.createElement(_reactNative.View,{style:[$darkOverlayBottom,{height:frameY}],__self:this,__source:{fileName:_jsxFileName,lineNumber:215,columnNumber:9}})),_react.default.createElement(_reactNative.View,{style:[$back,{top:insets.top+16}],__self:this,__source:{fileName:_jsxFileName,lineNumber:217,columnNumber:7}},_react.default.createElement(_reactNative.TouchableOpacity,{onPress:function onPress(){navigation.goBack();},style:{position:'absolute',left:0,width:48,height:48,zIndex:1000,alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:218,columnNumber:9}},_react.default.createElement(_icons.IconBackWhite,{__self:this,__source:{fileName:_jsxFileName,lineNumber:231,columnNumber:11}})),_react.default.createElement(_MText.MText,{style:{textAlign:'center',zIndex:10,color:'#FFFFFF',fontSize:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:233,columnNumber:9}},props!=null&&(_props$route2=props.route)!=null&&(_props$route2$params=_props$route2.params)!=null&&_props$route2$params.front?'Chụp CMND/ CCCD mặt trước':'Chụp CMND/ CCCD mặt sau')),_react.default.createElement(_reactNative.View,{style:{position:'absolute',bottom:24+insets.bottom,alignSelf:'center',flexDirection:'column',alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:246,columnNumber:7}},_react.default.createElement(_MText.MText,{style:{color:'#fff',marginBottom:16,textAlign:'center',paddingHorizontal:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:255,columnNumber:9}},"Vui l\xF2ng \u0111\u1EB7t gi\u1EA5y t\u1EDD n\u1EB1m v\u1EEBa khung h\xECnh ch\u1EEF nh\u1EADt, ch\u1EE5p \u0111\u1EE7 \xE1nh s\xE1ng v\xE0 r\xF5 n\xE9t."),_react.default.createElement(_reactNative.TouchableOpacity,{onPress:takePicture,__self:this,__source:{fileName:_jsxFileName,lineNumber:266,columnNumber:9}},_react.default.createElement(_icons.TakePhotoSvg,{__self:this,__source:{fileName:_jsxFileName,lineNumber:267,columnNumber:11}}))));}var CORNER_SIZE=20;var CORNER_WIDTH=2;var BORDER_COLOR='#FDFDFD';var Corner=function Corner(_ref){var style=_ref.style;return _react.default.createElement(_reactNative.View,{style:[style,{position:'absolute',width:CORNER_SIZE,height:CORNER_SIZE}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:279,columnNumber:3}});};var overlayColor='rgba(22, 22, 22, 0.7)';var $back={position:'absolute',left:0,right:0};var $overlay=(0,_extends2.default)({},_reactNative.StyleSheet.absoluteFillObject,{justifyContent:'center',alignItems:'center'});var $container={flex:1,backgroundColor:'#000'};var $row={flexDirection:'row',alignItems:'center'};var $darkOverlayTop={width:'100%',backgroundColor:overlayColor};var $darkOverlayBottom={width:'100%',backgroundColor:overlayColor};var $darkOverlaySide={backgroundColor:overlayColor};var $frameBorder={};
2
2
  //# sourceMappingURL=CCCDCameraScreen.js.map
@@ -16,21 +16,37 @@ import {
16
16
  } from 'react-native-vision-camera';
17
17
  import { IconBackWhite, TakePhotoSvg } from '../../assets/icons';
18
18
  import { MText } from '../../components/MText';
19
- import ImageEditor from '@react-native-community/image-editor';
20
- import { CommonActions, useNavigation } from '@react-navigation/native';
21
- import DeviceInfo from 'react-native-device-info';
19
+ import { useNavigation } from '@react-navigation/native';
20
+ import { useSafeAreaInsets } from 'react-native-safe-area-context';
21
+ import RNImageManipulator from '@oguzhnatly/react-native-image-manipulator';
22
22
 
23
23
  const { width: screenWidth, height: screenHeight } = Dimensions.get('window');
24
- const frameWidth = screenWidth * 0.85;
25
- const frameHeight = frameWidth * 0.63; // tỷ lệ giống CCCD
26
- const frameLeft = (screenWidth - frameWidth) / 2;
27
- const frameTop = ((screenWidth * 4) / 3 - frameHeight) / 2;
24
+
25
+ const getImageSize = (
26
+ uri: string
27
+ ): Promise<{ width: number; height: number }> =>
28
+ new Promise((resolve, reject) => {
29
+ Image.getSize(
30
+ uri,
31
+ (width, height) => resolve({ width, height }),
32
+ (err) => reject(err)
33
+ );
34
+ });
35
+
36
+ const clamp = (value: number, min: number, max: number) =>
37
+ Math.min(Math.max(value, min), max);
38
+
28
39
  export default function CCCDCameraScreen(props) {
40
+ const insets = useSafeAreaInsets();
29
41
  const navigation = useNavigation();
30
42
  const camera = useRef(null);
31
43
  const device = useCameraDevice('back');
32
44
  const [cameraActive, setCameraActive] = useState(true);
33
45
  const { hasPermission, requestPermission } = useCameraPermission();
46
+ const [previewLayout, setPreviewLayout] = useState({
47
+ width: screenWidth,
48
+ height: screenHeight,
49
+ });
34
50
 
35
51
  useEffect(() => {
36
52
  if (!hasPermission) requestPermission();
@@ -43,79 +59,199 @@ export default function CCCDCameraScreen(props) {
43
59
  skipMetadata: true,
44
60
  });
45
61
 
46
- Image.getSize(`file://${photo.path}`, async (width, height) => {
47
- const previewHeight = (screenWidth * 4) / 3; // Tỷ lệ khung preview camera
62
+ try {
63
+ const imageUri = `file://${photo.path}`;
64
+ const { width, height } = await getImageSize(imageUri);
65
+ const previewWidth = previewLayout.width || screenWidth;
66
+ const previewHeight = previewLayout.height || screenHeight;
67
+
68
+ const frameWidth = previewWidth * 0.85;
69
+ const frameHeight = frameWidth * 0.63; // tỷ lệ giống CCCD
70
+ const frameX = (previewWidth - frameWidth) / 2;
71
+ const frameY = (previewHeight - frameHeight) / 2;
72
+
73
+ // Tính scale dựa trên `resizeMode="cover"` mặc định của Vision Camera phủ kín màn hình
74
+ const scale = Math.max(previewWidth / width, previewHeight / height);
75
+
76
+ // Kích thước của ảnh nếu được hiển thị và zoom lên để cover màn hình
77
+ const renderedWidth = width * scale;
78
+ const renderedHeight = height * scale;
48
79
 
49
- // Tính scale giữa ảnh thật khung preview
50
- const scaleX = width / screenWidth;
51
- const scaleY = height / previewHeight;
80
+ // Độ phân giải của các phần bị tràn ra khỏi màn hình (do cover)
81
+ const offsetX = (renderedWidth - previewWidth) / 2;
82
+ const offsetY = (renderedHeight - previewHeight) / 2;
83
+
84
+ // Tính tọa độ vùng cần crop trên ảnh gốc dựa vào toạ độ của khung UI
85
+ const cropX = (frameX + offsetX) / scale;
86
+ const cropY = (frameY + offsetY) / scale;
87
+ const cropWidth = frameWidth / scale;
88
+ const cropHeight = frameHeight / scale;
89
+
90
+ const cropXInt = Math.floor(clamp(cropX, 0, Math.max(0, width - 1)));
91
+ const cropYInt = Math.floor(clamp(cropY, 0, Math.max(0, height - 1)));
92
+ const cropWidthInt = Math.floor(
93
+ clamp(cropWidth, 1, Math.max(1, width - cropXInt))
94
+ );
95
+ const cropHeightInt = Math.floor(
96
+ clamp(cropHeight, 1, Math.max(1, height - cropYInt))
97
+ );
52
98
 
53
- // Tính tọa độ vùng cần crop trên ảnh gốc
54
99
  const cropData = {
55
100
  offset: {
56
- x: frameLeft * scaleX,
57
- y: frameTop * scaleY,
101
+ x: cropXInt,
102
+ y: cropYInt,
58
103
  },
59
104
  size: {
60
- width: frameWidth * scaleX,
61
- height: frameHeight * scaleY,
62
- },
63
- displaySize: {
64
- width: frameWidth * scaleX,
65
- height: frameHeight * scaleY,
105
+ width: cropWidthInt,
106
+ height: cropHeightInt,
66
107
  },
67
- resizeMode: 'contain',
68
108
  };
69
109
 
70
- try {
71
- const croppedUri = await ImageEditor.cropImage(
72
- `file://${photo.path}`,
73
- cropData
74
- );
75
- setCameraActive(false);
76
- navigation.goBack();
77
- if (props.route.params.callback) {
78
- props.route.params.callback(croppedUri.uri);
79
- }
80
- } catch (err) {
81
- console.error(err);
110
+ const result = await RNImageManipulator.manipulate(
111
+ imageUri,
112
+ [
113
+ {
114
+ crop: {
115
+ originX: cropXInt,
116
+ originY: cropYInt,
117
+ width: cropWidthInt,
118
+ height: cropHeightInt,
119
+ },
120
+ },
121
+ ],
122
+ { format: 'jpg', compress: 1 }
123
+ );
124
+ setCameraActive(false);
125
+ navigation.goBack();
126
+
127
+ if (props.route?.params?.callback) {
128
+ props.route.params.callback(result?.uri);
82
129
  }
83
- });
130
+ } catch (err) {
131
+ console.error(err);
132
+ }
84
133
  };
85
134
 
86
135
  if (!device || !hasPermission)
87
136
  return <View style={{ flex: 1, backgroundColor: '#000' }} />;
137
+
138
+ const frameWidth = previewLayout.width * 0.85;
139
+ const frameHeight = frameWidth * 0.63;
140
+ const frameX = (previewLayout.width - frameWidth) / 2;
141
+ const frameY = (previewLayout.height - frameHeight) / 2;
142
+
88
143
  return (
89
- <View style={styles.container}>
90
- <View style={styles.topContainer}>
91
- <TouchableOpacity
92
- onPress={() => {
93
- navigation.goBack();
94
- }}
95
- style={[
96
- { width: 48, height: 48, zIndex: 1000, alignItems: 'center' },
97
- ]}
98
- >
99
- <IconBackWhite />
100
- </TouchableOpacity>
101
- </View>
144
+ <View
145
+ style={$container}
146
+ onLayout={(e) => {
147
+ const { width, height } = e.nativeEvent.layout;
148
+ if (width > 0 && height > 0) setPreviewLayout({ width, height });
149
+ }}
150
+ >
102
151
  <Camera
103
- style={styles.camera}
152
+ style={{ flex: 1 }}
104
153
  device={device}
105
154
  isActive={cameraActive}
106
155
  photo={true}
107
156
  ref={camera}
108
157
  />
109
- <View style={styles.overlay}>
110
- <View style={styles.darkOverlayTop} />
111
- <View style={styles.row}>
112
- <View style={styles.darkOverlaySide} />
113
- <View style={styles.frameBorder} />
114
- <View style={styles.darkOverlaySide} />
158
+ <View style={$overlay} pointerEvents="none">
159
+ <View style={[$darkOverlayTop, { height: frameY }]} />
160
+ <View style={$row}>
161
+ <View
162
+ style={[$darkOverlaySide, { width: frameX, height: frameHeight }]}
163
+ />
164
+ <View
165
+ style={[$frameBorder, { width: frameWidth, height: frameHeight }]}
166
+ >
167
+ {/* Top Left */}
168
+ <Corner
169
+ style={{
170
+ top: 0,
171
+ left: 0,
172
+ borderTopWidth: CORNER_WIDTH,
173
+ borderLeftWidth: CORNER_WIDTH,
174
+ borderColor: BORDER_COLOR,
175
+ }}
176
+ />
177
+
178
+ {/* Top Right */}
179
+ <Corner
180
+ style={{
181
+ top: 0,
182
+ right: 0,
183
+ borderTopWidth: CORNER_WIDTH,
184
+ borderRightWidth: CORNER_WIDTH,
185
+ borderColor: BORDER_COLOR,
186
+ }}
187
+ />
188
+
189
+ {/* Bottom Left */}
190
+ <Corner
191
+ style={{
192
+ bottom: 0,
193
+ left: 0,
194
+ borderBottomWidth: CORNER_WIDTH,
195
+ borderLeftWidth: CORNER_WIDTH,
196
+ borderColor: BORDER_COLOR,
197
+ }}
198
+ />
199
+
200
+ {/* Bottom Right */}
201
+ <Corner
202
+ style={{
203
+ bottom: 0,
204
+ right: 0,
205
+ borderBottomWidth: CORNER_WIDTH,
206
+ borderRightWidth: CORNER_WIDTH,
207
+ borderColor: BORDER_COLOR,
208
+ }}
209
+ />
210
+ </View>
211
+ <View
212
+ style={[$darkOverlaySide, { width: frameX, height: frameHeight }]}
213
+ />
115
214
  </View>
116
- <View style={styles.darkOverlayBottom} />
215
+ <View style={[$darkOverlayBottom, { height: frameY }]} />
117
216
  </View>
118
- <View style={styles.captureButton}>
217
+ <View style={[$back, { top: insets.top + 16 }]}>
218
+ <TouchableOpacity
219
+ onPress={() => {
220
+ navigation.goBack();
221
+ }}
222
+ style={{
223
+ position: 'absolute',
224
+ left: 0,
225
+ width: 48,
226
+ height: 48,
227
+ zIndex: 1000,
228
+ alignItems: 'center',
229
+ }}
230
+ >
231
+ <IconBackWhite />
232
+ </TouchableOpacity>
233
+ <MText
234
+ style={{
235
+ textAlign: 'center',
236
+ zIndex: 10,
237
+ color: '#FFFFFF',
238
+ fontSize: 16,
239
+ }}
240
+ >
241
+ {props?.route?.params?.front
242
+ ? 'Chụp CMND/ CCCD mặt trước'
243
+ : 'Chụp CMND/ CCCD mặt sau'}
244
+ </MText>
245
+ </View>
246
+ <View
247
+ style={{
248
+ position: 'absolute',
249
+ bottom: 24 + insets.bottom,
250
+ alignSelf: 'center',
251
+ flexDirection: 'column',
252
+ alignItems: 'center',
253
+ }}
254
+ >
119
255
  <MText
120
256
  style={{
121
257
  color: '#fff',
@@ -135,59 +271,59 @@ export default function CCCDCameraScreen(props) {
135
271
  );
136
272
  }
137
273
 
274
+ const CORNER_SIZE = 20;
275
+ const CORNER_WIDTH = 2;
276
+ const BORDER_COLOR = '#FDFDFD';
277
+
278
+ const Corner = ({ style }: { style: ViewStyle }) => (
279
+ <View
280
+ style={[
281
+ style,
282
+ {
283
+ position: 'absolute',
284
+ width: CORNER_SIZE,
285
+ height: CORNER_SIZE,
286
+ },
287
+ ]}
288
+ />
289
+ );
290
+
138
291
  const overlayColor = 'rgba(22, 22, 22, 0.7)';
139
- const styles = StyleSheet.create({
140
- container: { flex: 1, backgroundColor: '#000' },
141
- camera: { flex: 1 },
142
- overlay: {
143
- ...StyleSheet.absoluteFillObject,
144
- justifyContent: 'center',
145
- alignItems: 'center',
146
- },
147
- frameBorder: {
148
- width: frameWidth,
149
- height: frameHeight,
150
- borderColor: '#FDFDFD',
151
- borderWidth: 2,
152
- },
153
- row: {
154
- flexDirection: 'row',
155
- alignItems: 'center',
156
- },
157
- darkOverlayTop: {
158
- width: '100%',
159
- height: (screenHeight - frameHeight) / 2,
160
- backgroundColor: overlayColor,
161
- },
162
- darkOverlayBottom: {
163
- width: '100%',
164
- height: (screenHeight - frameHeight) / 2,
165
- backgroundColor: overlayColor,
166
- },
167
- darkOverlaySide: {
168
- width: (screenWidth - frameWidth) / 2,
169
- height: frameHeight,
170
- backgroundColor: overlayColor,
171
- },
172
- captureContainer: {
173
- position: 'absolute',
174
- bottom: 40,
175
- width: '100%',
176
- alignItems: 'center',
177
- },
178
- captureButton: {
179
- position: 'absolute',
180
- bottom: 30,
181
- alignSelf: 'center',
182
- flexDirection: 'column',
183
- alignItems: 'center',
184
- },
185
- topContainer: {
186
- position: 'absolute',
187
- top: DeviceInfo.hasNotch() ? 60 : 24,
188
- },
189
- textContainer: {
190
- position: 'absolute',
191
- top: DeviceInfo.hasNotch() ? 60 : 24,
192
- },
193
- });
292
+ const $back: ViewStyle = {
293
+ position: 'absolute',
294
+ left: 0,
295
+ right: 0,
296
+ };
297
+
298
+ const $overlay: ViewStyle = {
299
+ ...StyleSheet.absoluteFillObject,
300
+ justifyContent: 'center',
301
+ alignItems: 'center',
302
+ };
303
+
304
+ const $container: ViewStyle = {
305
+ flex: 1,
306
+ backgroundColor: '#000',
307
+ };
308
+
309
+ const $row: ViewStyle = {
310
+ flexDirection: 'row',
311
+ alignItems: 'center',
312
+ };
313
+
314
+ const $darkOverlayTop: ViewStyle = {
315
+ width: '100%',
316
+ backgroundColor: overlayColor,
317
+ };
318
+
319
+ const $darkOverlayBottom: ViewStyle = {
320
+ width: '100%',
321
+ backgroundColor: overlayColor,
322
+ };
323
+ const $darkOverlaySide: ViewStyle = {
324
+ backgroundColor: overlayColor,
325
+ };
326
+ const $frameBorder: ViewStyle = {
327
+ // borderColor: '#FDFDFD',
328
+ // borderWidth: 2,
329
+ };
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeVisionCamera","_icons","_MText","_imageEditor","_interopRequireDefault","_native","_reactNativeDeviceInfo","_jsxFileName","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_Dimensions$get","Dimensions","screenWidth","width","screenHeight","height","frameWidth","frameHeight","frameLeft","frameTop","CCCDCameraScreen","props","navigation","useNavigation","camera","useRef","device","useCameraDevice","_useState","useState","_useState2","_slicedToArray2","cameraActive","setCameraActive","_useCameraPermission","useCameraPermission","hasPermission","requestPermission","useEffect","takePicture","_callee2","photo","_regenerator","async","_callee2$","_context2","prev","next","current","abrupt","awrap","takePhoto","skipMetadata","sent","Image","getSize","path","_callee","previewHeight","scaleX","scaleY","cropData","croppedUri","_callee$","_context","offset","x","y","size","displaySize","resizeMode","ImageEditor","cropImage","goBack","route","params","callback","uri","t0","console","error","stop","Promise","createElement","View","style","flex","backgroundColor","__self","__source","fileName","lineNumber","columnNumber","styles","container","topContainer","TouchableOpacity","onPress","zIndex","alignItems","IconBackWhite","Camera","isActive","ref","overlay","darkOverlayTop","row","darkOverlaySide","frameBorder","darkOverlayBottom","captureButton","MText","color","marginBottom","textAlign","paddingHorizontal","TakePhotoSvg","overlayColor","StyleSheet","create","_extends2","absoluteFillObject","justifyContent","borderColor","borderWidth","flexDirection","captureContainer","position","bottom","alignSelf","top","DeviceInfo","hasNotch","textContainer"],"sourceRoot":"../../../../src","sources":["screens/camera/CCCDCameraScreen.tsx"],"mappings":"waACA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBASA,IAAAE,wBAAA,CAAAF,OAAA,+BAKA,IAAAG,MAAA,CAAAH,OAAA,uBACA,IAAAI,MAAA,CAAAJ,OAAA,2BACA,IAAAK,YAAA,CAAAC,sBAAA,CAAAN,OAAA,0CACA,IAAAO,OAAA,CAAAP,OAAA,6BACA,IAAAQ,sBAAA,CAAAF,sBAAA,CAAAN,OAAA,8BAAkD,IAAAS,YAAA,gGAAAC,yBAAAC,CAAA,wBAAAC,OAAA,iBAAAC,CAAA,KAAAD,OAAA,GAAAE,CAAA,KAAAF,OAAA,UAAAF,wBAAA,UAAAA,yBAAAC,CAAA,SAAAA,CAAA,CAAAG,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,CACbE,MAAM,CAAE,CAACD,YAAY,CAAGG,WAAW,EAAI,CAAC,CACxCsE,eAAe,CAAE8B,YACnB,CAAC,CACDV,eAAe,CAAE,CACf9F,KAAK,CAAE,CAACD,WAAW,CAAGI,UAAU,EAAI,CAAC,CACrCD,MAAM,CAAEE,WAAW,CACnBsE,eAAe,CAAE8B,YACnB,CAAC,CACDS,gBAAgB,CAAE,CAChBC,QAAQ,CAAE,UAAU,CACpBC,MAAM,CAAE,EAAE,CACVnH,KAAK,CAAE,MAAM,CACbsF,UAAU,CAAE,QACd,CAAC,CACDW,aAAa,CAAE,CACbiB,QAAQ,CAAE,UAAU,CACpBC,MAAM,CAAE,EAAE,CACVC,SAAS,CAAE,QAAQ,CACnBJ,aAAa,CAAE,QAAQ,CACvB1B,UAAU,CAAE,QACd,CAAC,CACDJ,YAAY,CAAE,CACZgC,QAAQ,CAAE,UAAU,CACpBG,GAAG,CAAEC,8BAAU,CAACC,QAAQ,CAAC,CAAC,CAAG,EAAE,CAAG,EACpC,CAAC,CACDC,aAAa,CAAE,CACbN,QAAQ,CAAE,UAAU,CACpBG,GAAG,CAAEC,8BAAU,CAACC,QAAQ,CAAC,CAAC,CAAG,EAAE,CAAG,EACpC,CACF,CAAC,CAAC"}
1
+ {"version":3,"names":["_react","_interopRequireWildcard","require","_reactNative","_reactNativeVisionCamera","_icons","_MText","_native","_reactNativeSafeAreaContext","_reactNativeImageManipulator","_interopRequireDefault","_jsxFileName","_this","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","prototype","hasOwnProperty","call","i","set","_Dimensions$get","Dimensions","screenWidth","width","screenHeight","height","getImageSize","uri","Promise","resolve","reject","Image","getSize","err","clamp","value","min","max","Math","CCCDCameraScreen","props","_props$route2","_props$route2$params","insets","useSafeAreaInsets","navigation","useNavigation","camera","useRef","device","useCameraDevice","_useState","useState","_useState2","_slicedToArray2","cameraActive","setCameraActive","_useCameraPermission","useCameraPermission","hasPermission","requestPermission","_useState3","_useState4","previewLayout","setPreviewLayout","useEffect","takePicture","_callee","photo","_props$route","_props$route$params","imageUri","_await$getImageSize","previewWidth","previewHeight","_frameWidth","_frameHeight","_frameX","_frameY","scale","renderedWidth","renderedHeight","offsetX","offsetY","cropX","cropY","cropWidth","cropHeight","cropXInt","cropYInt","cropWidthInt","cropHeightInt","cropData","result","_regenerator","async","_callee$","_context","prev","next","current","abrupt","awrap","takePhoto","skipMetadata","sent","path","frameWidth","frameHeight","frameX","frameY","floor","offset","x","y","size","RNImageManipulator","manipulate","crop","originX","originY","format","compress","goBack","route","params","callback","t0","console","error","stop","createElement","View","style","flex","backgroundColor","__self","__source","fileName","lineNumber","columnNumber","$container","onLayout","_e$nativeEvent$layout","nativeEvent","layout","Camera","isActive","ref","$overlay","pointerEvents","$darkOverlayTop","$row","$darkOverlaySide","$frameBorder","Corner","top","left","borderTopWidth","CORNER_WIDTH","borderLeftWidth","borderColor","BORDER_COLOR","right","borderRightWidth","bottom","borderBottomWidth","$darkOverlayBottom","$back","TouchableOpacity","onPress","position","zIndex","alignItems","IconBackWhite","MText","textAlign","color","fontSize","front","alignSelf","flexDirection","marginBottom","paddingHorizontal","TakePhotoSvg","CORNER_SIZE","_ref","overlayColor","_extends2","StyleSheet","absoluteFillObject","justifyContent"],"sourceRoot":"../../../../src","sources":["screens/camera/CCCDCameraScreen.tsx"],"mappings":"waACA,IAAAA,MAAA,CAAAC,uBAAA,CAAAC,OAAA,WACA,IAAAC,YAAA,CAAAD,OAAA,iBASA,IAAAE,wBAAA,CAAAF,OAAA,+BAKA,IAAAG,MAAA,CAAAH,OAAA,uBACA,IAAAI,MAAA,CAAAJ,OAAA,2BACA,IAAAK,OAAA,CAAAL,OAAA,6BACA,IAAAM,2BAAA,CAAAN,OAAA,mCACA,IAAAO,4BAAA,CAAAC,sBAAA,CAAAR,OAAA,gDAA4E,IAAAS,YAAA,uFAAAC,KAAA,eAAAC,yBAAAC,CAAA,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QAAQ,CAAE,UAAU,CACpBpJ,KAAK,CAAEkK,WAAW,CAClBhK,MAAM,CAAEgK,WACV,CAAC,CACD,CAAAjD,MAAA,CAAA1I,KAAA,CAAA2I,QAAA,EAAAC,QAAA,CAAA7I,YAAA,CAAA8I,UAAA,KAAAC,YAAA,IACH,CAAC,EACH,CAED,GAAM,CAAA+C,YAAY,CAAG,uBAAuB,CAC5C,GAAM,CAAAnB,KAAgB,CAAG,CACvBG,QAAQ,CAAE,UAAU,CACpBd,IAAI,CAAE,CAAC,CACPM,KAAK,CAAE,CACT,CAAC,CAED,GAAM,CAAAd,QAAmB,IAAAuC,SAAA,CAAAvL,OAAA,KACpBwL,uBAAU,CAACC,kBAAkB,EAChCC,cAAc,CAAE,QAAQ,CACxBlB,UAAU,CAAE,QAAQ,EACrB,CAED,GAAM,CAAAhC,UAAqB,CAAG,CAC5BP,IAAI,CAAE,CAAC,CACPC,eAAe,CAAE,MACnB,CAAC,CAED,GAAM,CAAAiB,IAAe,CAAG,CACtB6B,aAAa,CAAE,KAAK,CACpBR,UAAU,CAAE,QACd,CAAC,CAED,GAAM,CAAAtB,eAA0B,CAAG,CACjChI,KAAK,CAAE,MAAM,CACbgH,eAAe,CAAEoD,YACnB,CAAC,CAED,GAAM,CAAApB,kBAA6B,CAAG,CACpChJ,KAAK,CAAE,MAAM,CACbgH,eAAe,CAAEoD,YACnB,CAAC,CACD,GAAM,CAAAlC,gBAA2B,CAAG,CAClClB,eAAe,CAAEoD,YACnB,CAAC,CACD,GAAM,CAAAjC,YAAuB,CAAG,CAGhC,CAAC"}
@@ -1,2 +1,2 @@
1
- var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.NationalID=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _native=require("@react-navigation/native");var _mobxReactLite=require("mobx-react-lite");var _CommonStyles=require("../CommonStyles");var _keyboardspace=_interopRequireDefault(require("../../components/keyboardspace"));var _MButton=_interopRequireDefault(require("../../components/MButton"));var _navigation=require("../../navigation");var _MText=require("../../components/MText");var _icons=require("../../assets/icons");var _Store=_interopRequireDefault(require("./Store"));var _mobx=require("mobx");var _Loading=_interopRequireDefault(require("../../components/Loading"));var _reactNativeLinearGradient=_interopRequireDefault(require("react-native-linear-gradient"));var _MHeader=_interopRequireDefault(require("../../components/MHeader"));var _LivenessStore=_interopRequireDefault(require("../liveness/LivenessStore"));var _jsxFileName="/Users/tima/Documents/Tima/tima-care-v2-sdk/src/screens/nationalID/index.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var logoView={position:'absolute',width:'100%',height:'100%',resizeMode:'cover'};var _Dimensions$get=_reactNative.Dimensions.get('window'),screenWidth=_Dimensions$get.width,screenHeight=_Dimensions$get.height;var frameWidth=screenWidth*0.85;var frameHeight=frameWidth*0.63;var NationalID=exports.NationalID=(0,_mobxReactLite.observer)(function NationalID(props){var _props$route$params,_this=this;var navigation=(0,_native.useNavigation)();var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isLoading=_useState2[0],setIsLoading=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),photo=_useState4[0],setPhoto=_useState4[1];var _useState5=(0,_react.useState)(null),_useState6=(0,_slicedToArray2.default)(_useState5,2),base64=_useState6[0],setBase64=_useState6[1];var loan=(0,_mobx.toJS)((_props$route$params=props.route.params)==null?void 0:_props$route$params.loan);var nextStep=function nextStep(){setIsLoading(true);var form=new FormData();form.append('image',{uri:photo,type:'image/jpg',name:'image.jpg'});form.append('loanbriefId',loan==null?void 0:loan.id);form.append('TypeDocumentId',311);form.append('UploadFrom',3);form.append('SubTypeId',1);_Store.default.uploadImage(form,function(){setIsLoading(false);_Store.default.photo=photo;navigation.dispatch(_native.StackActions.push(_navigation.ScreenNames.NationalIDBack,{loan:loan}));},function(){setIsLoading(false);});};var takePhoto=function takePhoto(){_LivenessStore.default.getConfigOcr(function(data){if(data===1){navigation.push(_navigation.ScreenNames.CCCDCameraScreen,{front:false,callback:function callback(photo){setPhoto(photo);}});}else{navigation.push(_navigation.ScreenNames.Camera,{front:false,callback:function callback(photo){setPhoto(photo);},base64:function base64(data){setBase64(data);}});}},function(){navigation.push(_navigation.ScreenNames.Camera,{front:false,callback:function callback(photo){setPhoto(photo);},base64:function base64(data){setBase64(data);}});});};return _react.default.createElement(_reactNative.View,{style:{flex:1},__self:this,__source:{fileName:_jsxFileName,lineNumber:134,columnNumber:5}},_react.default.createElement(_reactNative.Image,{source:require('../../assets/img/EKYC.png'),style:logoView,__self:this,__source:{fileName:_jsxFileName,lineNumber:135,columnNumber:7}}),_react.default.createElement(_MHeader.default,{title:"X\xE1c th\u1EF1c kh\xE1ch h\xE0ng",onBack:function onBack(){navigation.goBack();},__self:this,__source:{fileName:_jsxFileName,lineNumber:136,columnNumber:7}}),_react.default.createElement(_reactNative.SafeAreaView,{style:_CommonStyles.commonStyles.fill,__self:this,__source:{fileName:_jsxFileName,lineNumber:142,columnNumber:7}},_react.default.createElement(_reactNative.ScrollView,{style:_CommonStyles.commonStyles.fill,__self:this,__source:{fileName:_jsxFileName,lineNumber:143,columnNumber:9}},_react.default.createElement(_reactNative.View,{style:{},__self:this,__source:{fileName:_jsxFileName,lineNumber:144,columnNumber:11}},_react.default.createElement(_reactNative.View,{style:{paddingHorizontal:16,paddingBottom:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:13}},_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',alignItems:'center',marginTop:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:146,columnNumber:15}},_react.default.createElement(_icons.TimaSmallWhite,{__self:this,__source:{fileName:_jsxFileName,lineNumber:153,columnNumber:17}}),_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormalBold,{fontSize:16,color:'#FFFFFF',marginLeft:8}],__self:this,__source:{fileName:_jsxFileName,lineNumber:154,columnNumber:17}},"Ch\u1EE5p CMND/ CCCD m\u1EB7t tr\u01B0\u1EDBc")),_react.default.createElement(_reactNative.View,{style:{width:'100%',height:frameHeight,borderWidth:8,borderRadius:6,borderColor:'#FFFFFF',marginTop:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:163,columnNumber:15}},_react.default.createElement(_reactNative.Image,{source:photo?{uri:photo}:require('../../assets/img/national_id.png'),style:{width:'100%',height:'100%'},__self:this,__source:{fileName:_jsxFileName,lineNumber:173,columnNumber:17}})),_react.default.createElement(_reactNative.View,{style:{marginTop:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:185,columnNumber:15}},_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormalBold,{fontSize:16}],__self:this,__source:{fileName:_jsxFileName,lineNumber:186,columnNumber:17}},"L\u01B0u \xFD ch\u1EE5p CMND/ CCCD"),_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',marginTop:16,alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:189,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:196,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:{color:'#333333',marginLeft:8,fontSize:12},__self:this,__source:{fileName:_jsxFileName,lineNumber:197,columnNumber:19}},"N\xEAn \u0111\u1EB7t CCCD/ CMND l\xEAn m\u1EB7t ph\u1EB3ng \u0111\u1EC3 ch\u1EE5p")),_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',marginTop:8},__self:this,__source:{fileName:_jsxFileName,lineNumber:203,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{style:{marginTop:5},__self:this,__source:{fileName:_jsxFileName,lineNumber:204,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:{color:'#333333',marginLeft:8,fontSize:12},__self:this,__source:{fileName:_jsxFileName,lineNumber:205,columnNumber:19}},"\u0110\u1EB7t CCCD/ CMND n\u1EB1m g\u1ECDn trong khung h\xECnh",'\n',"(Kh\xF4ng qu\xE1 nh\u1ECF hay qu\xE1 to l\xE0m m\u1EA5t chi ti\u1EBFt)")),_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',marginTop:8,alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:212,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:219,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:{color:'#333333',marginLeft:8,fontSize:12},__self:this,__source:{fileName:_jsxFileName,lineNumber:220,columnNumber:19}},"Ch\u1ECDn n\u01A1i \xE1nh s\xE1ng t\u1ED1t, tr\xE1nh l\xF3a/ ch\xF3i h\xECnh ch\u1EE5p")))))),_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',paddingHorizontal:16,marginBottom:30},__self:this,__source:{fileName:_jsxFileName,lineNumber:230,columnNumber:9}},_react.default.createElement(_MButton.default,{onPress:function onPress(){takePhoto();},disabled:isLoading,style:[_CommonStyles.commonStyles.row,_CommonStyles.commonStyles.alignCenter,_CommonStyles.commonStyles.justifyCenter,{backgroundColor:'#FFFFFF',height:40,borderRadius:30,flex:1,marginRight:8,borderWidth:1,borderColor:'#EF4123'}],__self:this,__source:{fileName:_jsxFileName,lineNumber:237,columnNumber:11}},_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormal,{color:'#F05123'}],__self:this,__source:{fileName:_jsxFileName,lineNumber:257,columnNumber:13}},"Ch\u1EE5p \u1EA3nh")),_react.default.createElement(_mobxReactLite.Observer,{__self:this,__source:{fileName:_jsxFileName,lineNumber:262,columnNumber:11}},function(){return _react.default.createElement(_MButton.default,{disabled:!photo||isLoading,onPress:nextStep,style:{flex:1},__self:_this,__source:{fileName:_jsxFileName,lineNumber:264,columnNumber:15}},_react.default.createElement(_reactNativeLinearGradient.default,{colors:['#FF7A00','#EF4123'],style:[_CommonStyles.commonStyles.alignCenter,_CommonStyles.commonStyles.justifyCenter,{height:40,borderRadius:30,marginLeft:8}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:269,columnNumber:17}},_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormal,{color:'white'}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:281,columnNumber:19}},"Ti\u1EBFp t\u1EE5c")));})),(loan==null?void 0:loan.isPipelineCIMB)&&_react.default.createElement(_reactNative.View,{style:{marginBottom:24,marginTop:8,flexDirection:'row',justifyContent:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:290,columnNumber:11}},_react.default.createElement(_MText.MText,{style:{fontSize:12,color:'#333333'},__self:this,__source:{fileName:_jsxFileName,lineNumber:298,columnNumber:13}},"Cung c\u1EA5p b\u1EDFi",' '),_react.default.createElement(_icons.CIMBBank,{__self:this,__source:{fileName:_jsxFileName,lineNumber:301,columnNumber:13}})),_react.default.createElement(_keyboardspace.default,{__self:this,__source:{fileName:_jsxFileName,lineNumber:304,columnNumber:9}})),_react.default.createElement(_Loading.default,{isLoading:isLoading,__self:this,__source:{fileName:_jsxFileName,lineNumber:306,columnNumber:7}}));});
1
+ var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.NationalID=void 0;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _reactNative=require("react-native");var _native=require("@react-navigation/native");var _mobxReactLite=require("mobx-react-lite");var _CommonStyles=require("../CommonStyles");var _keyboardspace=_interopRequireDefault(require("../../components/keyboardspace"));var _MButton=_interopRequireDefault(require("../../components/MButton"));var _navigation=require("../../navigation");var _MText=require("../../components/MText");var _icons=require("../../assets/icons");var _Store=_interopRequireDefault(require("./Store"));var _mobx=require("mobx");var _Loading=_interopRequireDefault(require("../../components/Loading"));var _reactNativeLinearGradient=_interopRequireDefault(require("react-native-linear-gradient"));var _MHeader=_interopRequireDefault(require("../../components/MHeader"));var _LivenessStore=_interopRequireDefault(require("../liveness/LivenessStore"));var _jsxFileName="/Users/tima/Documents/Tima/tima-care-v2-sdk/src/screens/nationalID/index.tsx";function _getRequireWildcardCache(e){if("function"!=typeof WeakMap)return null;var r=new WeakMap(),t=new WeakMap();return(_getRequireWildcardCache=function _getRequireWildcardCache(e){return e?t:r;})(e);}function _interopRequireWildcard(e,r){if(!r&&e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache(r);if(t&&t.has(e))return t.get(e);var n={__proto__:null},a=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var u in e)if("default"!==u&&Object.prototype.hasOwnProperty.call(e,u)){var i=a?Object.getOwnPropertyDescriptor(e,u):null;i&&(i.get||i.set)?Object.defineProperty(n,u,i):n[u]=e[u];}return n.default=e,t&&t.set(e,n),n;}var logoView={position:'absolute',width:'100%',height:'100%',resizeMode:'cover'};var _Dimensions$get=_reactNative.Dimensions.get('window'),screenWidth=_Dimensions$get.width,screenHeight=_Dimensions$get.height;var frameWidth=screenWidth*0.85;var frameHeight=frameWidth*0.63;var frameAspectRatio=frameWidth/frameHeight;var NationalID=exports.NationalID=(0,_mobxReactLite.observer)(function NationalID(props){var _props$route$params,_this=this;var navigation=(0,_native.useNavigation)();var _useState=(0,_react.useState)(false),_useState2=(0,_slicedToArray2.default)(_useState,2),isLoading=_useState2[0],setIsLoading=_useState2[1];var _useState3=(0,_react.useState)(null),_useState4=(0,_slicedToArray2.default)(_useState3,2),photo=_useState4[0],setPhoto=_useState4[1];var _useState5=(0,_react.useState)(null),_useState6=(0,_slicedToArray2.default)(_useState5,2),base64=_useState6[0],setBase64=_useState6[1];var loan=(0,_mobx.toJS)((_props$route$params=props.route.params)==null?void 0:_props$route$params.loan);var nextStep=function nextStep(){setIsLoading(true);var form=new FormData();form.append('image',{uri:photo,type:'image/jpg',name:'image.jpg'});form.append('loanbriefId',loan==null?void 0:loan.id);form.append('TypeDocumentId',311);form.append('UploadFrom',3);form.append('SubTypeId',1);_Store.default.uploadImage(form,function(){setIsLoading(false);_Store.default.photo=photo;navigation.dispatch(_native.StackActions.push(_navigation.ScreenNames.NationalIDBack,{loan:loan}));},function(){setIsLoading(false);});};var takePhoto=function takePhoto(){_LivenessStore.default.getConfigOcr(function(data){if(data===1){navigation.push(_navigation.ScreenNames.CCCDCameraScreen,{front:true,callback:function callback(photo){setPhoto(photo);}});}else{navigation.push(_navigation.ScreenNames.Camera,{front:false,callback:function callback(photo){setPhoto(photo);},base64:function base64(data){setBase64(data);}});}},function(){navigation.push(_navigation.ScreenNames.Camera,{front:false,callback:function callback(photo){setPhoto(photo);},base64:function base64(data){setBase64(data);}});});};return _react.default.createElement(_reactNative.View,{style:{flex:1},__self:this,__source:{fileName:_jsxFileName,lineNumber:135,columnNumber:5}},_react.default.createElement(_reactNative.Image,{source:require('../../assets/img/EKYC.png'),style:logoView,__self:this,__source:{fileName:_jsxFileName,lineNumber:136,columnNumber:7}}),_react.default.createElement(_MHeader.default,{title:"X\xE1c th\u1EF1c kh\xE1ch h\xE0ng",onBack:function onBack(){navigation.goBack();},__self:this,__source:{fileName:_jsxFileName,lineNumber:137,columnNumber:7}}),_react.default.createElement(_reactNative.SafeAreaView,{style:_CommonStyles.commonStyles.fill,__self:this,__source:{fileName:_jsxFileName,lineNumber:143,columnNumber:7}},_react.default.createElement(_reactNative.ScrollView,{style:_CommonStyles.commonStyles.fill,__self:this,__source:{fileName:_jsxFileName,lineNumber:144,columnNumber:9}},_react.default.createElement(_reactNative.View,{style:{},__self:this,__source:{fileName:_jsxFileName,lineNumber:145,columnNumber:11}},_react.default.createElement(_reactNative.View,{style:{paddingHorizontal:16,paddingBottom:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:146,columnNumber:13}},_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',alignItems:'center',marginTop:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:147,columnNumber:15}},_react.default.createElement(_icons.TimaSmallWhite,{__self:this,__source:{fileName:_jsxFileName,lineNumber:154,columnNumber:17}}),_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormalBold,{fontSize:16,color:'#FFFFFF',marginLeft:8}],__self:this,__source:{fileName:_jsxFileName,lineNumber:155,columnNumber:17}},"Ch\u1EE5p CMND/ CCCD m\u1EB7t tr\u01B0\u1EDBc")),_react.default.createElement(_reactNative.View,{style:{width:'100%',aspectRatio:frameAspectRatio,borderWidth:8,borderRadius:6,borderColor:'#FFFFFF',marginTop:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:164,columnNumber:15}},_react.default.createElement(_reactNative.Image,{source:photo?{uri:photo}:require('../../assets/img/national_id.png'),style:{width:'100%',height:'100%',resizeMode:'cover'},__self:this,__source:{fileName:_jsxFileName,lineNumber:174,columnNumber:17}})),_react.default.createElement(_reactNative.View,{style:{marginTop:24},__self:this,__source:{fileName:_jsxFileName,lineNumber:187,columnNumber:15}},_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormalBold,{fontSize:16}],__self:this,__source:{fileName:_jsxFileName,lineNumber:188,columnNumber:17}},"L\u01B0u \xFD ch\u1EE5p CMND/ CCCD"),_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',marginTop:16,alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:191,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:198,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:{color:'#333333',marginLeft:8,fontSize:12},__self:this,__source:{fileName:_jsxFileName,lineNumber:199,columnNumber:19}},"N\xEAn \u0111\u1EB7t CCCD/ CMND l\xEAn m\u1EB7t ph\u1EB3ng \u0111\u1EC3 ch\u1EE5p")),_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',marginTop:8},__self:this,__source:{fileName:_jsxFileName,lineNumber:205,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{style:{marginTop:5},__self:this,__source:{fileName:_jsxFileName,lineNumber:206,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:{color:'#333333',marginLeft:8,fontSize:12},__self:this,__source:{fileName:_jsxFileName,lineNumber:207,columnNumber:19}},"\u0110\u1EB7t CCCD/ CMND n\u1EB1m g\u1ECDn trong khung h\xECnh",'\n',"(Kh\xF4ng qu\xE1 nh\u1ECF hay qu\xE1 to l\xE0m m\u1EA5t chi ti\u1EBFt)")),_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',marginTop:8,alignItems:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:214,columnNumber:17}},_react.default.createElement(_icons.TimaSmall,{__self:this,__source:{fileName:_jsxFileName,lineNumber:221,columnNumber:19}}),_react.default.createElement(_MText.MText,{style:{color:'#333333',marginLeft:8,fontSize:12},__self:this,__source:{fileName:_jsxFileName,lineNumber:222,columnNumber:19}},"Ch\u1ECDn n\u01A1i \xE1nh s\xE1ng t\u1ED1t, tr\xE1nh l\xF3a/ ch\xF3i h\xECnh ch\u1EE5p")))))),_react.default.createElement(_reactNative.View,{style:{flexDirection:'row',paddingHorizontal:16,marginBottom:30},__self:this,__source:{fileName:_jsxFileName,lineNumber:232,columnNumber:9}},_react.default.createElement(_MButton.default,{onPress:function onPress(){takePhoto();},disabled:isLoading,style:[_CommonStyles.commonStyles.row,_CommonStyles.commonStyles.alignCenter,_CommonStyles.commonStyles.justifyCenter,{backgroundColor:'#FFFFFF',height:40,borderRadius:30,flex:1,marginRight:8,borderWidth:1,borderColor:'#EF4123'}],__self:this,__source:{fileName:_jsxFileName,lineNumber:239,columnNumber:11}},_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormal,{color:'#F05123'}],__self:this,__source:{fileName:_jsxFileName,lineNumber:259,columnNumber:13}},"Ch\u1EE5p \u1EA3nh")),_react.default.createElement(_mobxReactLite.Observer,{__self:this,__source:{fileName:_jsxFileName,lineNumber:264,columnNumber:11}},function(){return _react.default.createElement(_MButton.default,{disabled:!photo||isLoading,onPress:nextStep,style:{flex:1},__self:_this,__source:{fileName:_jsxFileName,lineNumber:266,columnNumber:15}},_react.default.createElement(_reactNativeLinearGradient.default,{colors:['#FF7A00','#EF4123'],style:[_CommonStyles.commonStyles.alignCenter,_CommonStyles.commonStyles.justifyCenter,{height:40,borderRadius:30,marginLeft:8}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:271,columnNumber:17}},_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormal,{color:'white'}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:283,columnNumber:19}},"Ti\u1EBFp t\u1EE5c")));})),(loan==null?void 0:loan.isPipelineCIMB)&&_react.default.createElement(_reactNative.View,{style:{marginBottom:24,marginTop:8,flexDirection:'row',justifyContent:'center'},__self:this,__source:{fileName:_jsxFileName,lineNumber:292,columnNumber:11}},_react.default.createElement(_MText.MText,{style:{fontSize:12,color:'#333333'},__self:this,__source:{fileName:_jsxFileName,lineNumber:300,columnNumber:13}},"Cung c\u1EA5p b\u1EDFi",' '),_react.default.createElement(_icons.CIMBBank,{__self:this,__source:{fileName:_jsxFileName,lineNumber:303,columnNumber:13}})),_react.default.createElement(_keyboardspace.default,{__self:this,__source:{fileName:_jsxFileName,lineNumber:306,columnNumber:9}})),_react.default.createElement(_Loading.default,{isLoading:isLoading,__self:this,__source:{fileName:_jsxFileName,lineNumber:308,columnNumber:7}}));});
2
2
  //# sourceMappingURL=index.js.map