UNPKG

react-native-bynn-sdk

Version:

Bynn Mobile SDK for React Native - Identity verification and KYC

1 lines 7.89 kB
const _0x4cdd12=_0x8064;(function(_0x3825c7,_0x47251b){const _0x4a3750=_0x8064,_0x1e3a84=_0x3825c7();while(!![]){try{const _0x369dd5=parseInt(_0x4a3750(0x9e))/0x1*(-parseInt(_0x4a3750(0x89))/0x2)+-parseInt(_0x4a3750(0xb6))/0x3+parseInt(_0x4a3750(0xb3))/0x4*(-parseInt(_0x4a3750(0xa9))/0x5)+parseInt(_0x4a3750(0xb8))/0x6*(-parseInt(_0x4a3750(0xa6))/0x7)+-parseInt(_0x4a3750(0xb5))/0x8*(-parseInt(_0x4a3750(0x8f))/0x9)+parseInt(_0x4a3750(0xba))/0xa+-parseInt(_0x4a3750(0xa5))/0xb*(-parseInt(_0x4a3750(0xa1))/0xc);if(_0x369dd5===_0x47251b)break;else _0x1e3a84['push'](_0x1e3a84['shift']());}catch(_0x12753a){_0x1e3a84['push'](_0x1e3a84['shift']());}}}(_0x1b9f,0x32cec));import _0x232a32,{useRef,useState,useEffect}from'react';import{View,StyleSheet,SafeAreaView,Text,TouchableOpacity,Platform,ActivityIndicator,Alert,Keyboard,KeyboardAvoidingView,TouchableWithoutFeedback,Image}from'react-native';import _0x2ffc3d from'react-native-phone-number-input';import{Font,Height,Width}from'../utils/dimensions';import{submitPhoneVerification}from'../api';import{useBynnSession}from'../useBynnSession';function _0x8064(_0x1dae80,_0x334227){const _0x1b9fd7=_0x1b9f();return _0x8064=function(_0x8064fd,_0x2f49c0){_0x8064fd=_0x8064fd-0x88;let _0x2be6a8=_0x1b9fd7[_0x8064fd];return _0x2be6a8;},_0x8064(_0x1dae80,_0x334227);}import{PhoneVerificationView}from'./PhoneVerificationView';function _0x1b9f(){const _0x1b114d=['warn','#FFFFFF','remove','center','left','continueButton','textInputTextAndroid','#D4DAE3','black','current','1841NtgxqB','addListener','createElement','2388oWMbAu','space-between','textInputContainer','absolute','51821vBAbNp','14utpZKp','ios','log','5Dwtmqe','#15181E','red','buttonAboveKeyboard','flagButton','Good\x20to\x20go','Error','100%','row','textInputText','111236QekBHL','buttonContainer','16CENoxZ','1130169SORjfR','#FFFFF','1051998zOFBfu','dismiss','717100kCQoqt','keyboardDidShow','Fragment','contain','178AfCsUj','message','#BDBDBD','phone_required','#374255','400','530802jnufgl','error','enter_phone','android','alert'];_0x1b9f=function(){return _0x1b114d;};return _0x1b9f();}import _0x353c73 from'./ExitView';import{useTranslation}from'react-i18next';import'../i18n';export const PhoneInputView=()=>{const _0x2b001e=_0x8064,_0x520aef=useRef(null),[_0x135e0f,_0x4bb8a4]=useState(![]),[_0x4e2cb2,_0x3860e7]=useState(_0x2b001e(0x9b)),[_0x51dc33,_0x3c9536]=useState(''),[_0x266a21,_0x2c1b6b]=useState(!![]),[_0x1b2b05,_0x188c6d]=useState(![]),[_0x55a9e5,_0x9d3baf]=useState(![]),{sessionId:_0x3a3d03}=useBynnSession(),[_0x27759f,_0x26f8e6]=useState(![]),{t:_0x39003d}=useTranslation();useEffect(()=>{const _0x49e719=_0x2b001e,_0x343fa6=Keyboard['addListener'](_0x49e719(0xbb),()=>{_0x9d3baf(!![]);}),_0x10eebe=Keyboard[_0x49e719(0x9f)]('keyboardDidHide',()=>{_0x9d3baf(![]);});return()=>{const _0x3b2c93=_0x49e719;_0x343fa6[_0x3b2c93(0x96)](),_0x10eebe[_0x3b2c93(0x96)]();};},[]);const _0x3c69a0=()=>{const _0x2322d5=_0x2b001e;Keyboard[_0x2322d5(0xb9)]();},_0x1137fb=async()=>{const _0x5491bc=_0x2b001e;console[_0x5491bc(0xa8)]('--->',_0x51dc33);const _0x338483=_0x520aef[_0x5491bc(0x9d)]?.['isValidNumber'](_0x51dc33);if(_0x338483){console[_0x5491bc(0xa8)](_0x5491bc(0xae),_0x51dc33);try{if(!_0x3a3d03)throw new Error('No\x20session');_0x4bb8a4(!![]),await submitPhoneVerification(_0x3a3d03,_0x51dc33+''),_0x4bb8a4(![]),_0x188c6d(!![]);}catch(_0x423f3a){console[_0x5491bc(0x90)](_0x423f3a),_0x4bb8a4(![]),Alert[_0x5491bc(0x93)](_0x5491bc(0xaf),_0x423f3a[_0x5491bc(0x8a)]);}}else console[_0x5491bc(0x94)]('Invalid\x20number'),(_0x2c1b6b(![]),_0x3860e7(_0x5491bc(0xab)));},_0x55ab43=_0x3a5b8f=>{const _0x2d28ba=_0x2b001e;_0x3860e7(_0x2d28ba(0x9b)),_0x3c9536(_0x3a5b8f),_0x2c1b6b(!![]);};return _0x232a32[_0x2b001e(0xa0)](_0x232a32[_0x2b001e(0xbc)],null,_0x1b2b05?_0x232a32[_0x2b001e(0xa0)](PhoneVerificationView,{'phone':_0x51dc33}):_0x232a32['createElement'](TouchableWithoutFeedback,{'onPress':_0x3c69a0},_0x232a32[_0x2b001e(0xa0)](KeyboardAvoidingView,{'behavior':Platform['OS']===_0x2b001e(0xa7)?'padding':'height','style':{'flex':0x1,'backgroundColor':'#FFFFFF'}},_0x232a32['createElement'](SafeAreaView,{'style':{'flex':0x1,'alignItems':'center','backgroundColor':'#FFFFFF'}},_0x232a32[_0x2b001e(0xa0)](View,{'style':{'flexDirection':_0x2b001e(0xb1),'justifyContent':_0x2b001e(0xa2),'width':'90%'}},_0x232a32[_0x2b001e(0xa0)](TouchableOpacity,{'onPress':()=>_0x26f8e6(!![])},_0x232a32['createElement'](Image,{'resizeMode':_0x2b001e(0x88),'style':{'height':Height(0x18),'width':Width(0x18)},'source':require('../assets/leftIcon.png')}))),_0x232a32[_0x2b001e(0xa0)](Text,{'style':{'fontSize':Font(0x19),'marginBottom':Height(0x14),'fontWeight':'600','lineHeight':Height(0x20),'textAlign':_0x2b001e(0x98),'alignSelf':'flex-start','marginLeft':'4%','paddingHorizontal':Width(0x5),'marginTop':Height(0xf)}},_0x39003d(_0x2b001e(0x91))),_0x232a32['createElement'](Text,{'style':{'fontSize':Font(0x11),'fontWeight':_0x2b001e(0x8e),'lineHeight':Height(0x18),'color':_0x2b001e(0x8d),'width':'90%'}},_0x39003d('enter_mobile_number_description')),_0x232a32[_0x2b001e(0xa0)](View,{'style':{'marginTop':Height(0xf)}},_0x232a32[_0x2b001e(0xa0)](_0x2ffc3d,{'containerStyle':[styles[_0x2b001e(0xa3)],{'borderColor':_0x4e2cb2,'zIndex':-0x1}],'textContainerStyle':{'backgroundColor':'transparent'},'textInputStyle':Platform['OS']==_0x2b001e(0x92)?styles[_0x2b001e(0x9a)]:styles[_0x2b001e(0xb2)],'textInputProps':{'placeholderTextColor':'grey','cursorColor':_0x2b001e(0x9c),'selectionColor':'#D3D3D3'},'codeTextStyle':{'fontSize':Font(0x11),'color':'black'},'flagButtonStyle':styles[_0x2b001e(0xad)],'ref':_0x520aef,'autoFocus':!![],'value':_0x51dc33,'defaultValue':_0x51dc33,'defaultCode':'US','placeholder':_0x39003d(_0x2b001e(0x91)),'onChangeFormattedText':_0x55ab43}),!_0x266a21?_0x232a32[_0x2b001e(0xa0)](Text,{'style':{'color':'red'}},_0x51dc33==''?_0x39003d(_0x2b001e(0x8c)):_0x39003d('invalid_phone')):null),_0x232a32['createElement'](View,{'style':[styles[_0x2b001e(0xb4)],_0x55a9e5?styles[_0x2b001e(0xac)]:styles['buttonAtBottom']]},_0x232a32['createElement'](TouchableOpacity,{'onPress':()=>{_0x3c69a0(),_0x1137fb();},'style':styles[_0x2b001e(0x99)]},_0x135e0f?_0x232a32['createElement'](ActivityIndicator,{'color':'white'}):_0x232a32['createElement'](Text,{'style':{'color':_0x2b001e(0x95),'fontSize':Font(0x10),'lineHeight':Height(0x18),'fontWeight':'500'}},_0x39003d('send_code')))),_0x232a32['createElement'](_0x353c73,{'visible':_0x27759f,'onCancel':()=>_0x26f8e6(![]),'onConfirm':()=>_0x26f8e6(![])})))));};const styles=StyleSheet['create']({'container':{'flex':0x1,'backgroundColor':_0x4cdd12(0xb7)},'textInputContainer':{'justifyContent':_0x4cdd12(0x97),'borderRadius':Height(0x5),'marginBottom':Height(0x5),'width':'90%','height':Height(0x39),'borderWidth':Height(0x2),'zIndex':-0xc8,'padding':0x1},'textInputText':{'fontSize':Font(0x11),'color':_0x4cdd12(0x9c)},'textInputContainerAndroid':{'justifyContent':_0x4cdd12(0x97),'borderRadius':Height(0x5),'marginBottom':Height(0x14),'width':'95%','height':Height(0x37),'borderWidth':Height(0x1),'borderColor':_0x4cdd12(0x8b),'padding':0x1},'textInputTextAndroid':{'fontSize':Font(0x11),'color':'black','position':_0x4cdd12(0xa4),'top':0x2,'left':Width(0x41),'width':Width(0x96)},'flagButton':{'flexDirection':'row','width':'20%','justifyContent':_0x4cdd12(0x97),'paddingLeft':Width(0xf)},'buttonContainer':{'justifyContent':_0x4cdd12(0x97),'alignItems':_0x4cdd12(0x97),'width':_0x4cdd12(0xb0)},'buttonAtBottom':{'position':_0x4cdd12(0xa4),'bottom':Height(0x1e)},'buttonAboveKeyboard':{'position':'absolute','bottom':Platform['OS']==='ios'?Height(0x14):Height(0xa)},'continueButton':{'height':Height(0x38),'width':Width(0x168),'backgroundColor':_0x4cdd12(0xaa),'justifyContent':_0x4cdd12(0x97),'alignItems':'center','borderRadius':Height(0x38),'marginVertical':Height(0xa),'flexDirection':_0x4cdd12(0xb1),'columnGap':0x5}});