@tsocial/tvweb-sdk.platform 5.35.1 → 5.37.0
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.
- package/build/esm/chunk-147a2e31.js +1 -0
- package/build/esm/chunk-2932b8ef.js +1 -0
- package/build/esm/chunk-2bfdf00f.js +1 -0
- package/build/esm/chunk-2e802851.js +10 -0
- package/build/esm/chunk-2f57cc44.js +1 -0
- package/build/esm/chunk-337b9ebf.js +1 -0
- package/build/esm/chunk-38f2d65b.js +45 -0
- package/build/esm/chunk-39db42b0.js +1 -0
- package/build/esm/chunk-5993adde.js +1 -0
- package/build/esm/chunk-5d5d5df1.js +85 -0
- package/build/esm/chunk-68e90ba2.js +1121 -0
- package/build/esm/chunk-77790073.js +1 -0
- package/build/esm/chunk-7d0d639a.js +1 -0
- package/build/esm/chunk-9038aebd.js +1 -0
- package/build/esm/chunk-a4a97e90.js +256 -0
- package/build/esm/chunk-bcf5eed2.js +1 -0
- package/build/esm/chunk-c04f48e4.js +1 -0
- package/build/esm/chunk-ccb7bcab.js +1 -0
- package/build/esm/chunk-d02bd3cc.js +428 -0
- package/build/esm/chunk-e5b81ec5.js +1 -0
- package/build/esm/chunk-e7ee9d9f.js +3 -0
- package/build/esm/chunk-fbc39ae4.js +3 -0
- package/build/esm/tvweb-sdk.platform.esm.min.js +1 -0
- package/build/tvweb-sdk.platform.cjs.min.js +986 -1131
- package/build/tvweb-sdk.platform.standalone.js +82433 -100524
- package/build/tvweb-sdk.platform.standalone.min.js +986 -1131
- package/build/types/index.d.ts +22 -11
- package/package.json +7 -8
- package/build/tvweb-sdk.platform.esm.min.js +0 -2089
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{A as e,C as r,T as s,r as a,m as n,c as t,s as o,j as i,a4 as c,az as l,b as u,P as p,k as m}from"./chunk-68e90ba2.js";import{p as d,g as f,S as h,a as g,O as C,C as j,E as y,b as D,B as F,c as x,L as S}from"./chunk-a4a97e90.js";import{u as b,C as T}from"./chunk-147a2e31.js";import{M as k,O as I,W as E,C as R}from"./chunk-5d5d5df1.js";import{D as L}from"./chunk-fbc39ae4.js";import{u as v}from"./chunk-bcf5eed2.js";import"./chunk-7d0d639a.js";import"./chunk-9038aebd.js";import"./chunk-c04f48e4.js";let P=m.isMobile?{width:{ideal:640}}:null;function A(p){let{apiCheck:m,onLivenessDetectionDone:L,captureFrameSettings:A,onFramesCaptured:M,frontCamera:H,flipVideoHorizontal:O,customDirectionIcon:w,customStepTimeConstraints:U,onProcessing:V,customErrors:$,apiCredentials:_,outputEncryptionSettings:B,cameraScale:K,defaultCameraId:N,passiveModeAuto:z,offsetFaceY:G,styledComponent:Y,serviceSettings:W,onReset:q,isLoading:J}=p,Q=e(),{onErrorCallback:X,onCloseCallback:Z}=v(),ee=r.useAsset("bg_camera_mask.png"),er=r.useAsset("bg_camera_mask_red.png"),es=s("IDCapturing.loadingIcon.src","ic_loading.gif"),[ea,en]=a.useState({}),{yFaceDetectionError:et,yFaceVerificationStepsWrapper:eo}=ea,[ei,ec]=a.useState(""),[el,eu]=a.useState(),ep=a.useMemo(()=>({backgroundColor:n("Selfie.backgroundColor")({theme:Q})}),[Q]),em=a.useCallback(({lostY:e,height:r,clientHeight:s})=>{let a=e+25,n=a+30;en({yFaceDetectionError:a,yFaceVerificationStepsWrapper:n+r+20});let t=Math.floor(e),o=Math.floor(s-e),i=Math.floor(n);return 0!==G&&(i+G<t||i+G+r>o)?X({code:`offsetFaceY must be in [-${i-t}, ${o-r-i}]`}):i+=G,{y:i}},[G,X]),{shouldResetFlowOnOrientationChange:ed,countdownToTakePicture:ef,cropArea:eh,curStepIndex:eg,faceDetectionError:eC,resetFlow:ej,handleTriggerPassiveMode:ey,handleVideoPlayed:eD,refVideo:eF,showCountdown:ex,steps:eS,refIsReseting:eb,videoPlayed:eT,warmupDone:ek,showCaptureButton:eI,shouldShowCountdown:eE,showLoading:eR}=b({currentOrientation:el,apiCheck:m,bgCameraMask:ee,bgCameraMaskRed:er,surroundStyle:ep,onLivenessDetectionDone:L,onError:X,cropAreaDimension:em,customDirectionIcon:w,captureFrameSettings:A,onFramesCaptured:M,setRemainingTime:ec,customStepTimeConstraints:U,onProcessing:V,customErrors:$,apiCredentials:_,outputEncryptionSettings:B,cameraScale:K,passiveModeAuto:z,serviceSettings:W,onReset:q});a.useEffect(()=>{"string"==typeof eS[0]?.directionIcon&&Promise.all(eS.map(e=>d(e.directionIcon)))},[eS]);let{CloseCameraButton:eL}=Y,ev=f(p,Q),eP=eb.current?0:eg/eS.length*100,{lang:eA}=t.useSDKSettings(),eM=a.useRef(0),eH=a.useRef({}),eO=a.useRef(o.ErrorDuration.SHORT),ew=a.useMemo(()=>{let{msg:e,duration:r=o.ErrorDuration.SHORT}=eC||{},s=e?.[eA];return Date.now()-eM.current>=eO.current&&(eM.current=Date.now(),eO.current=r,eH.current=s),eH.current},[eC,eg]),eU=a.useCallback(e=>{eu(e),ed?ej():e===k.LANDSCAPE?eF.current?.pause():eF.current?.play()},[eF,ej,ed]);return i.jsx(I,{onOrientationChange:eU,children:i.jsxs(c,{frontCamera:H,onVideoPlayed:eD,onClose:Z,flipHorizontal:O??H,ref:eF,videoSettings:P,onError:X,scale:K,defaultCameraId:N,closeButton:eL||i.jsx(l,{}),children:[!ek&&i.jsx(E,{}),eT?i.jsxs(i.Fragment,{children:["string"==typeof ew?i.jsx(h,{top:et-15,className:"face-detection-error",children:ew}):null,eh.current?i.jsxs(R,{x:`${eh.current.x}px`,y:`${eh.current.y}px`,width:`${eh.current.width}px`,height:`${eh.current.height}px`,surroundStyle:eh.current.surroundStyle,children:[i.jsx(g,{}),i.jsx(C,{...ev,progress:eP,showErrorRing:!!eC&&n("Selfie.progressCircle.showErrorRing")({theme:Q})}),eE?i.jsx(j,{children:ef}):null,eC&&i.jsx(y,{})]}):null,ei&&i.jsx(D,{top:eo-30,children:ei}),eI?i.jsx(F,{children:i.jsx(x,{onClick:ey,disabled:ex,children:u(Q,"Selfie.captureIcon.src")?i.jsx("img",{src:u(Q,"Selfie.captureIcon.src"),alt:""}):i.jsx(T,{fillColor:"rgba(193, 197, 204, 1)"})})}):null]}):null,(eR||J)&&i.jsx(S,{children:i.jsx("img",{src:es,alt:""})})]})})}A.propTypes={apiCheck:p.bool,mode:p.string,onLivenessDetectionDone:p.func,onClose:p.func,onError:p.func,onReset:p.func,captureFrameSettings:p.shape({}),onFramesCaptured:p.func,frontCamera:p.bool,isLoading:p.bool,flipVideoHorizontal:p.bool,customDirectionIcon:p.shape({}),customStepTimeConstraints:p.shape({}),onProcessing:p.func,customErrors:p.shape({}),apiCredentials:p.shape({accessKey:p.string,secretKey:p.string,apiUrl:p.string}),outputEncryptionSettings:p.shape({}),cameraScale:p.number,defaultCameraId:p.string,passiveModeAuto:p.bool,offsetFaceY:p.number,styledComponent:p.shape({CloseCameraButton:p.node}),serviceSettings:p.shape({})},A.defaultProps={apiCheck:!1,mode:null,onLivenessDetectionDone:null,onClose:null,onError:()=>{},onReset:()=>{},captureFrameSettings:{enable:!1,framesIntervalTime:180,framesBatchLength:0},onFramesCaptured:()=>{},frontCamera:!0,isLoading:!1,flipVideoHorizontal:null,customDirectionIcon:{[o.FaceDirection.LEFT]:i.jsx(L,{type:o.FaceDirection.LEFT}),[o.FaceDirection.RIGHT]:i.jsx(L,{type:o.FaceDirection.RIGHT}),[o.FaceDirection.UP]:i.jsx(L,{type:o.FaceDirection.UP}),[o.FaceDirection.FRONTAL]:i.jsx(L,{type:o.FaceDirection.FRONTAL})},customStepTimeConstraints:{[o.FaceDirection.UP]:{delayTime:0},[o.FaceDirection.LEFT]:{delayTime:0},[o.FaceDirection.RIGHT]:{delayTime:0},[o.FaceDirection.FRONTAL]:{delayTime:2e3}},onProcessing:()=>{},customErrors:null,apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},outputEncryptionSettings:null,cameraScale:1,defaultCameraId:void 0,passiveModeAuto:!1,offsetFaceY:0,styledComponent:{CloseCameraButton:null},serviceSettings:{enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:!0,enableVerifySanityIDCard:!0,enableVerifyFaceLiveness:!0,enableDetectIDCardTampering:!0,enableReadIDCardInfo:!0}};export{A as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{ah as n,aT as t,ai as i,$ as r}from"./chunk-68e90ba2.js";function e(){if(f)return u;f=1;var r=i(),e=function(){if(o)return a;o=1;var t=n();return a=function(){return t.Date.now()}}(),c=t(),v=Math.max,d=Math.min;return u=function(n,t,i){var a,o,u,f,l,m,s=0,p=!1,g=!1,h=!0;if("function"!=typeof n)throw TypeError("Expected a function");function T(t){var i=a,r=o;return a=o=void 0,s=t,f=n.apply(r,i)}t=c(t)||0,r(i)&&(p=!!i.leading,u=(g="maxWait"in i)?v(c(i.maxWait)||0,t):u,h="trailing"in i?!!i.trailing:h);function x(n){var i=n-m,r=n-s;return void 0===m||i>=t||i<0||g&&r>=u}function y(){var n,i,r,a,o=e();if(x(o))return E(o);l=setTimeout(y,(i=(n=o)-m,r=n-s,a=t-i,g?d(a,u-r):a))}function E(n){return(l=void 0,h&&a)?T(n):(a=o=void 0,f)}function w(){var n,i=e(),r=x(i);if(a=arguments,o=this,m=i,r){if(void 0===l){return s=n=m,l=setTimeout(y,t),p?T(n):f}if(g)return clearTimeout(l),l=setTimeout(y,t),T(m)}return void 0===l&&(l=setTimeout(y,t)),f}return w.cancel=function(){void 0!==l&&clearTimeout(l),s=0,a=m=o=l=void 0},w.flush=function(){return void 0===l?f:E(e())},w}}var a,o,u,f,c,v,d=r(function(){if(v)return c;v=1;var n=e(),t=i();return c=function(i,r,e){var a=!0,o=!0;if("function"!=typeof i)throw TypeError("Expected a function");return t(e)&&(a="leading"in e?!!e.leading:a,o="trailing"in e?!!e.trailing:o),n(i,r,{leading:a,maxWait:r,trailing:o})}}());export{e as r,d as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{aj as r,ak as n,aR as t,ag as e,aS as u,$ as o}from"./chunk-68e90ba2.js";import{r as a,f as i,g as c,h as s,i as p,j as f,k as l,l as _,n as v,o as g,p as b}from"./chunk-bcf5eed2.js";function j(){if(d)return O;d=1;var t=r(),e=n(),u=s();return O=function(r){if(!e(r))return!1;var n=t(r);return"[object Error]"==n||"[object DOMException]"==n||"string"==typeof r.message&&"string"==typeof r.name&&!u(r)}}function m(){return M?I:(M=1,I=/<%=([\s\S]+?)%>/g)}var y,h,O,d,w,E,R,$,k,S,x,L,P,U,q,A,D,F,I,M,z,B,C,G,H,J,K,N,Q,T,V,W,X,Y,Z=o(function(){if(Y)return X;Y=1;var r=function(){if(h)return y;h=1;var r=a(),n=i(),t=c();return y=n(function(n,e,u,o){r(e,t(e),n,o)})}(),n=function(){if(E)return w;E=1;var r=f(),n=p(),t=j();return w=n(function(n,e){try{return r(n,void 0,e)}catch(r){return t(r)?r:Error(r)}})}(),o=function(){if($)return R;$=1;var r=t();return R=function(n,t){return r(t,function(r){return n[r]})}}(),s=function(){if(S)return k;S=1;var r=e(),n=Object.prototype,t=n.hasOwnProperty;return k=function(e,u,o,a){return void 0===e||r(e,n[o])&&!t.call(a,o)?u:e}}(),O=function(){if(L)return x;L=1;var r={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};return x=function(n){return"\\"+r[n]}}(),d=j(),I=b(),M=function(){if(F)return D;F=1;var r=v(),n=function(){if(A)return q;A=1;var r=_(),n=U?P:(U=1,P=l()(Object.keys,Object)),t=Object.prototype.hasOwnProperty;return q=function(e){if(!r(e))return n(e);var u=[];for(var o in Object(e))t.call(e,o)&&"constructor"!=o&&u.push(o);return u}}(),t=g();return D=function(e){return t(e)?r(e):n(e)}}(),Z=m(),rr=function(){if(W)return V;W=1;var r=function(){if(J)return H;J=1;var r=function(){if(G)return C;G=1;var r=B?z:(B=1,z=function(r){return function(n){return null==r?void 0:r[n]}});return C=r({"&":"&","<":"<",">":">",'"':""","'":"'"})}(),n=u(),t=/[&<>"']/g,e=RegExp(t.source);return H=function(u){return(u=n(u))&&e.test(u)?u.replace(t,r):u}}(),n=N?K:(N=1,K=/<%-([\s\S]+?)%>/g),t=T?Q:(T=1,Q=/<%([\s\S]+?)%>/g),e=m();return V={escape:n,evaluate:t,interpolate:e,variable:"",imports:{_:{escape:r}}}}(),rn=u(),rt=/\b__p \+= '';/g,re=/\b(__p \+=) '' \+/g,ru=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ro=/[()=,{}\[\]\/\s]/,ra=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ri=/($^)/,rc=/['\n\r\u2028\u2029\\]/g,rs=Object.prototype.hasOwnProperty;return X=function(t,e,u){var a=rr.imports._.templateSettings||rr;u&&I(t,e,u)&&(e=void 0),t=rn(t),e=r({},e,a,s);var i=r({},e.imports,a.imports,s),c=M(i),p=o(i,c),f,l,_=0,v=e.interpolate||ri,g="__p += '",b=RegExp((e.escape||ri).source+"|"+v.source+"|"+(v===Z?ra:ri).source+"|"+(e.evaluate||ri).source+"|$","g"),j=rs.call(e,"sourceURL")?"//# sourceURL="+(e.sourceURL+"").replace(/\s/g," ")+"\n":"";t.replace(b,function(r,n,e,u,o,a){return e||(e=u),g+=t.slice(_,a).replace(rc,O),n&&(f=!0,g+="' +\n__e("+n+") +\n'"),o&&(l=!0,g+="';\n"+o+";\n__p += '"),e&&(g+="' +\n((__t = ("+e+")) == null ? '' : __t) +\n'"),_=a+r.length,r}),g+="';\n";var m=rs.call(e,"variable")&&e.variable;if(m){if(ro.test(m))throw Error("Invalid `variable` option passed into `_.template`")}else g="with (obj) {\n"+g+"\n}\n";g=(l?g.replace(rt,""):g).replace(re,"$1").replace(ru,"$1;"),g="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(f?", __e = _.escape":"")+(l?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+g+"return __p\n}";var y=n(function(){return Function(c,j+"return "+g).apply(void 0,p)});if(y.source=g,d(y))throw y;return y}}());export{Z as t};
|
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import{aM as e,z as i,aN as r,aO as t,aP as s,m as o,b as n,r as a,K as l,P as d,D as c,s as g,X as h,j as f,i as u,y as p,B as m,k as w,aQ as k}from"./chunk-68e90ba2.js";var b=Object.freeze({__proto__:null,blink:e,flipY:i,slide:r,spin:t,splash:s});let R=({curStep:e,faceDirection:i})=>{let r=n(e,"stepTimeConstraints.delayTime");return!!r&&(null===e.firstFrameSpottedAt?(e.name===i&&(e.firstFrameSpottedAt=new Date().getTime()),!0):!!(new Date().getTime()-e.firstFrameSpottedAt<r)||!1)},S=(e,i)=>({radius:e.radius??o("Selfie.progressCircle.radius")({theme:i}),strokeWidth:e.strokeWidth??o("Selfie.progressCircle.strokeWidth")({theme:i}),progress:e.progress??o("Selfie.progressCircle.progress")({theme:i}),showErrorRing:e.showErrorRing??o("Selfie.progressCircle.showErrorRing")({theme:i}),activeColor:e.activeColor??o("Selfie.progressCircle.activeColor")({theme:i}),innerPadding:e.innerPadding??o("Selfie.progressCircle.innerPadding")({theme:i}),outsideRingColor:e.outsideRingColor??o("Selfie.progressCircle.outsideRingColor")({theme:i}),outsideRingOpacity:e.outsideRingOpacity??o("Selfie.progressCircle.outsideRingOpacity")({theme:i}),insideRingColor:e.insideRingColor??o("Selfie.progressCircle.insideRingColor")({theme:i}),insideRingWidth:e.insideRingWidth??o("Selfie.progressCircle.insideRingWidth")({theme:i}),insideRingStrokeDash:e.insideRingStrokeDash??o("Selfie.progressCircle.insideRingStrokeDash")({theme:i}),errorRingWidth:e.errorRingWidth??o("Selfie.progressCircle.errorRingWidth")({theme:i}),errorRingColor:e.errorRingColor??o("Selfie.progressCircle.errorRingColor")({theme:i}),dashedRingColor:e.dashedRingColor??o("Selfie.progressCircle.dashedRingColor")({theme:i}),dashedRingOpacity:e.dashedRingOpacity??o("Selfie.progressCircle.dashedRingOpacity")({theme:i}),dashedRingWidth:e.dashedRingWidth??o("Selfie.progressCircle.dashedRingWidth")({theme:i}),dashedRingLineThick:e.dashedRingLineThick??o("Selfie.progressCircle.dashedRingLineThick")({theme:i}),dashedRingLineSpacing:e.dashedRingLineSpacing??o("Selfie.progressCircle.dashedRingLineSpacing")({theme:i}),dashedInsideRingColor:e.dashedInsideRingColor??o("Selfie.progressCircle.dashedInsideRingColor")({theme:i}),dashedInsideRingWidth:e.dashedInsideRingWidth??o("Selfie.progressCircle.dashedInsideRingWidth")({theme:i}),showOutsideRing:e.showOutsideRing??o("Selfie.progressCircle.showOutsideRing")({theme:i}),showInsideRing:e.showInsideRing??o("Selfie.progressCircle.showInsideRing")({theme:i}),showDashedRing:e.showDashedRing??o("Selfie.progressCircle.showDashedRing")({theme:i})}),_=(e,i)=>({radius:e.radius??o("Selfie.progressCircleV2.radius")({theme:i}),strokeWidth:e.strokeWidth??o("Selfie.progressCircleV2.strokeWidth")({theme:i}),progress:e.progress??o("Selfie.progressCircleV2.progress")({theme:i}),activeColor:e.activeColor??o("Selfie.progressCircleV2.activeColor")({theme:i}),neutralColor:e.neutralColor??o("Selfie.progressCircleV2.neutralColor")({theme:i}),errorColor:e.errorColor??o("Selfie.progressCircleV2.errorColor")({theme:i}),tickWidth:e.tickWidth??o("Selfie.progressCircleV2.tickWidth")({theme:i}),numberOfTicks:e.numberOfTicks??o("Selfie.progressCircleV2.numberOfTicks")({theme:i})}),y=({incomingFrame:e,currentBestFrame:i})=>e?.isEyeClosed&&!i?.isEyeClosed?i:!e?.isEyeClosed&&i?.isEyeClosed?e:e?.blurScore>i?.blurScore?e:i;function C(e){return new Promise(i=>{let r=new Image;r.onload=i,r.onerror=i,r.src=e})}let x=[],v=()=>{x=[]},$=(e,i,r,t)=>{t&&v(),x.push({id:null});let s=x.length-1;if(e&&e.key){let t=new Blob([JSON.stringify(i)]);r.uploadFile({file:t,metadata:JSON.stringify({type:"selfie"}),label:"video"},{"X-TV-Key":e.key}).then(e=>{e&&e.data&&e.data.file_id?x[s].id=e.data.file_id:x[s].id=-1})}else{let e=new Blob([JSON.stringify(i)]);r.uploadFile({file:e,metadata:JSON.stringify({type:"selfie"}),label:"video"}).then(e=>{e&&e.data&&e.data.file_id?x[s].id=e.data.file_id:x[s].id=-1})}},W=()=>new Promise(e=>{let i=setInterval(()=>{x.every(e=>e.id)&&(e(),clearInterval(i))},200)}),j=e=>e.enable?x.some(e=>-1===e.id)?null:x:[],I=[],O=null,D=!1,A=()=>I,T=()=>{D=!0,I=[];try{O instanceof MediaStream&&(O.getTracks().forEach(e=>e.stop()),O=null)}catch(e){}};async function E({outputImagesSize:e,videoEl:i,resultAnalyzeVideoAndWindowSizes:r}){let t;T();let s=document.createElement("canvas");s.width=e,s.height=e;let o=s.getContext("2d");try{let n={mimeType:"video/webm"};try{let e=(O=i?.captureStream()?.clone()).getVideoTracks()[0];await e.applyConstraints({width:{min:360,ideal:400},height:{min:360,ideal:400}})}catch(e){}MediaRecorder.isTypeSupported("video/mp4")&&(D=!1,!function e(i,r,t,s){if(!i||!s)return;let{cropX:o,cropY:n,cropWidth:a,cropHeight:l}=s;i.drawImage(r,o,n,a,l,0,0,t,t),D||requestAnimationFrame(()=>e(i,r,t,s))}(o,i,e,r),O=s.captureStream(25),n={mimeType:"video/mp4",videoBitsPerSecond:25e5}),t=new MediaRecorder(O,n);let a=async()=>{await new Promise((e,i)=>{t.ondataavailable=r=>(function(e,i,r){if(e.data.size>0){let r=new Blob([e.data],{type:"video/mp4"});I.push(r),i()}else console.error("No video have recored!"),r()})(r,e,i),"inactive"!==t.state&&t.stop()})};t.stopVideoRecording=a,t.discardRecording=()=>{"inactive"!==t.state&&t.stop()}}catch(e){}return{mediaRecorder:t}}let P={data:{settings:{sdk_settings:{passive_liveness_settings:{auto_capture:{enable:!0,show_capture_button:!0,show_countdown:!0,wait_for_best_image_time_ms_web:3e3},manual_capture:{show_countdown:!0,wait_for_best_image_time_ms_web:3e3},blur_check:{enable:!0,web_blurry_threshold:.4},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5,force_check:!1},web_is_required_frontal_face:!0},active_liveness_settings:{reset_flow_on_orientation_change:!0,wait_before_start_flow_ms:2e3,face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,take_one_picture_time_ms:3e3,limit_time_liveness_check:{enable:!1,limit_time_second:45,remain_time_show:10,format:"s",max_retry_count:0,non_stoppable:!1},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5,force_check:!1},exif_data_settings:{enable:!0},record_video:{enable:!1},save_encoded_frames:{enable:!1,enable_logging:!1,frames_batch_len:0,frames_interval_ms:180,quality_android:90,quality_ios:80},auto_gen_frame_ids:{enable:!1,max_items:50}}}}}},V=30,L=e=>{let{shouldStart:i,totalTime:r,totalDelayBetweenReset:t,interruptible:s=!0,onReset:o,onTick:n,onTimesUp:d}=e,c=a.useRef(new l({totalTime:r,totalDelayBetweenReset:t,interruptible:s}));return a.useEffect(()=>c.current.on("tick",({remainTime:e})=>{n({remainTime:e})}),[n]),a.useEffect(()=>c.current.on("delaystart",()=>{d()}),[d]),a.useEffect(()=>c.current.on("reset",({attemptCount:e,fromBackground:i})=>{o({attemptCount:e,fromBackground:i})}),[o]),a.useEffect(()=>i?c.current.start():()=>{},[i]),{stopTimer:a.useCallback(()=>{c.current.stop()},[])}},{ErrorDuration:z}=g;function M({children:e,errorMsg:i,className:r}){return h.isValidElement(e)?i?f.jsx("div",{className:r,children:h.cloneElement(e,{errorMsg:i})}):null:i?f.jsx("div",{className:r,children:i}):null}function B({children:e,className:i,error:r}){let t=a.useRef(0),s=a.useRef(""),o=c(),n=a.useRef(z.SHORT),{code:l,duration:d=z.SHORT}=r||{},g=o(l);return Date.now()-t.current>=n.current?(t.current=Date.now(),n.current=d,s.current=g,M({children:e,errorMsg:g,className:i})):M({children:e,errorMsg:s.current,className:i})}B.propTypes={children:d.node,className:d.string},B.defaultProps={className:""};let N=u.g`
|
|
2
|
+
transition: stroke-dashoffset 0.4s;
|
|
3
|
+
transform: rotate(-90deg);
|
|
4
|
+
transform-origin: 50% 50%;
|
|
5
|
+
`,F=u.circle`
|
|
6
|
+
transition: stroke-dashoffset 0.4s, stroke 0.4s;
|
|
7
|
+
transform: rotate(-90deg);
|
|
8
|
+
transform-origin: 50% 50%;
|
|
9
|
+
fill: none;
|
|
10
|
+
`,H=u.circle`
|
|
11
|
+
transition: stroke-dashoffset 0.4s;
|
|
12
|
+
transform: rotate(-90deg);
|
|
13
|
+
transform-origin: 50% 50%;
|
|
14
|
+
`;function K({className:e,style:i,radius:r,strokeWidth:t,progress:s,showErrorRing:o,activeColor:n,innerPadding:a,outsideRingColor:l,outsideRingOpacity:d,insideRingColor:c,insideRingWidth:g,insideRingStrokeDash:h,errorRingWidth:u,errorRingColor:p,dashedRingColor:m,dashedRingOpacity:w,dashedRingWidth:k,dashedRingLineThick:b,dashedRingLineSpacing:R,dashedInsideRingColor:S,dashedInsideRingWidth:_,showOutsideRing:y,showInsideRing:C,showDashedRing:x}){let v=2*r,$=2*r,W=r-2*t,j=2*Math.PI*W,I=W-k/2-t/2-a,O=2*Math.PI*I,D=I-_/2-k/2,A=2*Math.PI*D,T=D-g/2-_/2,E=D-u/2-_/2;return f.jsxs("svg",{className:e,style:i,width:v,height:$,viewBox:`0 0 ${v} ${$}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[y?f.jsxs(f.Fragment,{children:[f.jsx("circle",{"data-testid":"outsideRing",opacity:d,cx:r,cy:r,r:W,stroke:l}),f.jsx(H,{"data-testid":"outsideAnimateRing",cx:r,cy:r,r:W,stroke:n,strokeWidth:t,strokeLinecap:"round",strokeDasharray:`${j} ${j}`,style:{strokeDashoffset:j-s/100*j}})]}):null,x?f.jsxs(f.Fragment,{children:[f.jsx("circle",{"data-testid":"dashedRing",opacity:w,cx:r,cy:r,r:I,stroke:m,strokeWidth:k,strokeDasharray:`${b} ${R}`}),f.jsx("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",children:f.jsx("circle",{cx:r,cy:r,r:I,stroke:n,strokeWidth:k,strokeDasharray:`${b} ${R}`})}),f.jsx("g",{mask:"url(#mask0)",children:f.jsx(H,{"data-testid":"dashedAnimateRing",cx:r,cy:r,r:I,stroke:n,strokeWidth:k,strokeDasharray:`${O} ${O}`,style:{strokeDashoffset:O-s/100*O}})}),f.jsx("circle",{"data-testid":"dashedInsideRing",opacity:w,cx:r,cy:r,r:D,stroke:S,strokeWidth:_}),f.jsx(H,{"data-testid":"dashedInsideAnimateRing",cx:r,cy:r,r:D,stroke:n,strokeWidth:_,strokeLinecap:"round",strokeDasharray:`${A} ${A}`,style:{strokeDashoffset:A-s/100*A}})]}):null,C?f.jsx("circle",{"data-testid":"insideRing",strokeDasharray:h,cx:r,cy:r,r:T,stroke:c,strokeWidth:g}):null,o?f.jsx("circle",{"data-testid":"errorRing",strokeDasharray:h,cx:r,cy:r,r:E,stroke:p,strokeWidth:u}):null]})}K.propTypes={className:d.string,style:d.shape({}),radius:d.number,strokeWidth:d.number,progress:d.number,showErrorRing:d.bool,activeColor:d.string,innerPadding:d.number,outsideRingColor:d.string,outsideRingOpacity:d.number,insideRingColor:d.string,insideRingWidth:d.number,insideRingStrokeDash:d.string,errorRingColor:d.string,errorRingWidth:d.number,dashedRingColor:d.string,dashedRingOpacity:d.number,dashedRingWidth:d.number,dashedRingLineThick:d.number,dashedRingLineSpacing:d.number,dashedInsideRingColor:d.string,dashedInsideRingWidth:d.number,showOutsideRing:d.bool,showDashedRing:d.bool,showInsideRing:d.bool},K.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,showErrorRing:!1,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:3,insideRingStrokeDash:"0",errorRingColor:"#df0000",errorRingWidth:3,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!0,showDashedRing:!0,showInsideRing:!0};let{blink:U,slide:q,spin:J}=b,X=p`
|
|
15
|
+
z-index: ${m+20};
|
|
16
|
+
color: #ffffff;
|
|
17
|
+
`,Y=u.div`
|
|
18
|
+
${X}
|
|
19
|
+
`,Z=p`
|
|
20
|
+
${X}
|
|
21
|
+
${({top:e})=>e&&p`
|
|
22
|
+
top: ${e}px;
|
|
23
|
+
`}
|
|
24
|
+
${({bottom:e})=>e&&p`
|
|
25
|
+
bottom: ${e}px;
|
|
26
|
+
`}
|
|
27
|
+
${({centerY:e})=>e&&p`
|
|
28
|
+
top: 50%;
|
|
29
|
+
transform: translateY(-50%);
|
|
30
|
+
`}
|
|
31
|
+
font-size: ${o("Selfie.error.fontSize")};
|
|
32
|
+
font-weight: ${o("Selfie.error.fontWeight")};
|
|
33
|
+
background: ${o("Selfie.error.backgroundColor")};
|
|
34
|
+
color: ${o("Selfie.error.color")};
|
|
35
|
+
padding: ${o("Selfie.error.padding")};
|
|
36
|
+
border-radius: ${o("Selfie.error.borderRadius")};
|
|
37
|
+
position: absolute;
|
|
38
|
+
white-space: pre-wrap;
|
|
39
|
+
text-align: center;
|
|
40
|
+
max-width: 80%;
|
|
41
|
+
`;u(B)`
|
|
42
|
+
${Z}
|
|
43
|
+
`;let G=u.div`
|
|
44
|
+
${Z}
|
|
45
|
+
`,Q=u.div`
|
|
46
|
+
z-index: ${m+20};
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
position: absolute;
|
|
50
|
+
left: 50%;
|
|
51
|
+
transform: translate(-50%, 0);
|
|
52
|
+
${({top:e})=>e&&p`
|
|
53
|
+
top: ${e}px;
|
|
54
|
+
`}
|
|
55
|
+
`,ee=u(Y)`
|
|
56
|
+
font-size: ${o("Selfie.countdown.fontSize")};
|
|
57
|
+
font-weight: ${o("Selfie.countdown.fontWeight")};
|
|
58
|
+
background: ${o("Selfie.countdown.backgroundColor")};
|
|
59
|
+
color: ${o("Selfie.countdown.color")};
|
|
60
|
+
padding: ${o("Selfie.countdown.padding")};
|
|
61
|
+
border-radius: ${o("Selfie.countdown.borderRadius")};
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
`,ei=u(ee)`
|
|
64
|
+
position: absolute;
|
|
65
|
+
left: 50%;
|
|
66
|
+
transform: translate(-50%, 0);
|
|
67
|
+
${({top:e})=>e&&p`
|
|
68
|
+
top: ${e}px;
|
|
69
|
+
`}
|
|
70
|
+
`,er=u(Y)`
|
|
71
|
+
position: absolute;
|
|
72
|
+
${({top:e})=>e&&p`
|
|
73
|
+
top: ${e}px;
|
|
74
|
+
`}
|
|
75
|
+
${({bottom:e})=>e&&p`
|
|
76
|
+
bottom: ${e}px;
|
|
77
|
+
`}
|
|
78
|
+
color: ${o("Selfie.Active.instruction.color")};
|
|
79
|
+
font-size: ${o("Selfie.Active.instruction.fontSize")};
|
|
80
|
+
font-weight: ${o("Selfie.Active.instruction.fontWeight")};
|
|
81
|
+
text-shadow: ${o("Selfie.Active.instruction.textShadow")};
|
|
82
|
+
background-color: ${o("Selfie.Active.instruction.backgroundColor")};
|
|
83
|
+
border: ${o("Selfie.Active.instruction.border")};
|
|
84
|
+
border-radius: ${o("Selfie.Active.instruction.borderRadius")};
|
|
85
|
+
`,et=u.div`
|
|
86
|
+
height: ${()=>w.isMobile?"50px":"70px"};
|
|
87
|
+
position: absolute;
|
|
88
|
+
${({top:e})=>e&&p`
|
|
89
|
+
top: ${e}px;
|
|
90
|
+
`}
|
|
91
|
+
${({bottom:e})=>e&&p`
|
|
92
|
+
bottom: ${e}px;
|
|
93
|
+
`}
|
|
94
|
+
width: 100%;
|
|
95
|
+
display: flex;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
align-items: center;
|
|
98
|
+
z-index: ${m+20};
|
|
99
|
+
`,es=u.div`
|
|
100
|
+
width: ${o("Selfie.Active.imageHolder.width")};
|
|
101
|
+
height: ${o("Selfie.Active.imageHolder.height")};
|
|
102
|
+
border-radius: ${o("Selfie.Active.imageHolder.borderRadius")};
|
|
103
|
+
font-size: ${o("Selfie.Active.imageHolder.fontSize")};
|
|
104
|
+
color: ${o("Selfie.Active.imageHolder.color")};
|
|
105
|
+
font-weight: ${o("Selfie.Active.imageHolder.fontWeight")};
|
|
106
|
+
|
|
107
|
+
${({theme:e})=>"v2"===n(e,"themeVersion")?"border: unset;":`border: ${o("Selfie.Active.imageHolder.border")({theme:e})};`}
|
|
108
|
+
|
|
109
|
+
display: flex;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
align-items: center;
|
|
112
|
+
|
|
113
|
+
& + & {
|
|
114
|
+
margin-left: 10px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
${e=>e.active?p`
|
|
118
|
+
img:not(.image_preview) {
|
|
119
|
+
border: ${o("Selfie.Active.imageHolder.activeStepBorder")};
|
|
120
|
+
border-radius: ${o("Selfie.Active.imageHolder.activeStepBorderRadius")};
|
|
121
|
+
}
|
|
122
|
+
`:p`
|
|
123
|
+
opacity: 0.3;
|
|
124
|
+
`}
|
|
125
|
+
|
|
126
|
+
img {
|
|
127
|
+
width: 100%;
|
|
128
|
+
margin: 0;
|
|
129
|
+
border-radius: ${o("Selfie.Active.imageHolder.borderRadius")};
|
|
130
|
+
}
|
|
131
|
+
img.image_preview {
|
|
132
|
+
border: ${o("Selfie.Active.imageHolder.border")};
|
|
133
|
+
}
|
|
134
|
+
`,eo=u.div`
|
|
135
|
+
color: #ffffff;
|
|
136
|
+
height: 70px;
|
|
137
|
+
position: absolute;
|
|
138
|
+
bottom: 0;
|
|
139
|
+
width: 100%;
|
|
140
|
+
display: flex;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
align-items: center;
|
|
143
|
+
z-index: ${m+20};
|
|
144
|
+
`,en=u.div`
|
|
145
|
+
${({disabled:e})=>e?p`
|
|
146
|
+
pointer-events: none;
|
|
147
|
+
`:p`
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
`}
|
|
150
|
+
text-align: center;
|
|
151
|
+
|
|
152
|
+
img {
|
|
153
|
+
width: ${o("Selfie.captureIcon.width")};
|
|
154
|
+
}
|
|
155
|
+
`,ea=u.div`
|
|
156
|
+
position: absolute;
|
|
157
|
+
width: 100%;
|
|
158
|
+
top: 0;
|
|
159
|
+
bottom: 0;
|
|
160
|
+
display: flex;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
align-items: center;
|
|
163
|
+
color: #ffffff;
|
|
164
|
+
font-size: 140px;
|
|
165
|
+
opacity: 0.6;
|
|
166
|
+
`,el=u.div`
|
|
167
|
+
position: absolute;
|
|
168
|
+
width: 100%;
|
|
169
|
+
top: 0;
|
|
170
|
+
bottom: 0;
|
|
171
|
+
display: flex;
|
|
172
|
+
flex-direction: column;
|
|
173
|
+
justify-content: center;
|
|
174
|
+
align-items: center;
|
|
175
|
+
${q.default};
|
|
176
|
+
${U.default};
|
|
177
|
+
`,ed=u(K)`
|
|
178
|
+
position: absolute;
|
|
179
|
+
top: 0;
|
|
180
|
+
left: 0;
|
|
181
|
+
width: 100%;
|
|
182
|
+
height: 100%;
|
|
183
|
+
`,ec=u(({className:e="",radius:i=80,neutralColor:r="#CBD5E1",activeColor:t="#0276F1",errorColor:s="#E84848",strokeWidth:o=2,tickWidth:n=15,numberOfTicks:a=200,progress:l=0,showErrorRing:d=!1})=>{let c=2*i,g=i-5,h=2*Math.PI*g,u=Array.from({length:a}).map((e,r)=>{let t=360*r/a+3;return f.jsx("use",{href:"#tick",transform:`rotate(${t} ${i} ${i})`},r)}),p=i-V,m=2*Math.PI*p;return f.jsxs("svg",{height:c,width:c,viewBox:`0 0 ${c} ${c}`,className:e,xmlns:"http://www.w3.org/2000/svg",children:[d?f.jsx("circle",{cx:i,cy:i,r:i-V,stroke:s,strokeWidth:o,fill:"none"}):f.jsxs(f.Fragment,{children:[f.jsx("circle",{cx:i,cy:i,r:p,stroke:r,strokeWidth:o,fill:"none"}),f.jsx(F,{cx:i,cy:i,r:p,stroke:t,strokeWidth:o,strokeLinecap:"round",strokeDasharray:`${m} ${m}`,style:{strokeDashoffset:m-l/100*m}})]}),f.jsx("defs",{children:f.jsx("line",{id:"tick",x1:i,y1:"0",x2:i,y2:n,stroke:r,strokeWidth:o,strokeLinecap:"round"})}),f.jsx("g",{id:"border-segments",children:u}),f.jsx("mask",{id:"tickMask",maskUnits:"userSpaceOnUse",children:f.jsx("g",{id:"tick-mask-segments",children:u})}),f.jsx("g",{mask:"url(#tickMask)",children:f.jsx(N,{strokeDasharray:`${h} ${h}`,style:{strokeDashoffset:h-l/100*h},children:f.jsx("circle",{cx:i,cy:i,r:g,stroke:t,strokeWidth:20,fill:"none"})})})]})})`
|
|
184
|
+
position: absolute;
|
|
185
|
+
top: 0;
|
|
186
|
+
left: 0;
|
|
187
|
+
width: 100%;
|
|
188
|
+
height: 100%;
|
|
189
|
+
`,eg=u(function({className:e=""}){return f.jsx("svg",{className:e,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:f.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"})})})`
|
|
190
|
+
width: 100%;
|
|
191
|
+
height: 100%;
|
|
192
|
+
vertical-align: middle;
|
|
193
|
+
margin: 0;
|
|
194
|
+
color: ${o("Selfie.backgroundColor")};
|
|
195
|
+
`,eh=u(function({className:e="",radius:i=160,backgroundColor:r="#fff",padding:t=0}){let s=2*i;return f.jsxs("svg",{className:e,width:s,height:s,viewBox:`0 0 ${s} ${s}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[f.jsxs("mask",{id:"CIRCLE_MASK",children:[f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#CIRCLE_MASK)"}),f.jsx("circle",{cx:i,cy:i,r:i-t,fill:"black"})]}),f.jsx("circle",{cx:i,cy:i,r:i,fill:"none"}),f.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:r,mask:"url(#CIRCLE_MASK)"})]})})`
|
|
196
|
+
width: 100%;
|
|
197
|
+
height: 100%;
|
|
198
|
+
vertical-align: middle;
|
|
199
|
+
margin: 0;
|
|
200
|
+
color: ${o("Selfie.backgroundColor")};
|
|
201
|
+
`,ef=u.div`
|
|
202
|
+
position: absolute;
|
|
203
|
+
z-index: -1;
|
|
204
|
+
background: rgba(223, 0, 0, 0.2);
|
|
205
|
+
border-radius: 50%;
|
|
206
|
+
width: 86%;
|
|
207
|
+
height: 86%;
|
|
208
|
+
top: 7%;
|
|
209
|
+
left: 7%;
|
|
210
|
+
`,eu=k`
|
|
211
|
+
from {
|
|
212
|
+
opacity: 1;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
to {
|
|
216
|
+
opacity: 0;
|
|
217
|
+
}
|
|
218
|
+
`,ep=u.div`
|
|
219
|
+
position: absolute;
|
|
220
|
+
width: 100%;
|
|
221
|
+
top: 0;
|
|
222
|
+
bottom: 0;
|
|
223
|
+
z-index: -1;
|
|
224
|
+
background: rgba(255, 255, 255, 0.3);
|
|
225
|
+
animation: ${eu} 1s infinite;
|
|
226
|
+
border-radius: 50%;
|
|
227
|
+
`,em=u.div`
|
|
228
|
+
top: 0;
|
|
229
|
+
left: 0;
|
|
230
|
+
right: 0;
|
|
231
|
+
bottom: 0;
|
|
232
|
+
position: absolute;
|
|
233
|
+
margin: auto;
|
|
234
|
+
width: ${o("Selfie.loadingIcon.width")};
|
|
235
|
+
height: ${o("Selfie.loadingIcon.height")};
|
|
236
|
+
|
|
237
|
+
img {
|
|
238
|
+
width: 100%;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
z-index: ${m+20};
|
|
242
|
+
${J.default}
|
|
243
|
+
`,ew=u.div`
|
|
244
|
+
text-align: center;
|
|
245
|
+
color: ${o("Selfie.title.color")};
|
|
246
|
+
font-size: ${o("Selfie.title.fontSize")};
|
|
247
|
+
font-weight: ${o("Selfie.title.fontWeight")};
|
|
248
|
+
background-color: ${o("Selfie.title.backgroundColor")};
|
|
249
|
+
position: absolute;
|
|
250
|
+
top: ${e=>e.y};
|
|
251
|
+
z-index: ${m+10};
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
justify-content: center;
|
|
255
|
+
width: 100%;
|
|
256
|
+
`;export{V as A,eo as B,ea as C,ef as E,er as F,el as I,em as L,ed as O,G as S,ew as T,eg as a,ei as b,en as c,_ as d,eh as e,ec as f,S as g,ep as h,et as i,es as j,Q as k,ee as l,j as m,P as n,$ as o,C as p,A as q,T as r,v as s,R as t,L as u,E as v,W as w,y as x};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r,r as e,s as o,a2 as n,ac as t,ad as i,ae as a,af as u,ag as s,ah as d,ai as c,aj as l,ak as g,al as f,am as p,an as h,$ as b,u as y,ao as x}from"./chunk-68e90ba2.js";let k=e.createContext(!1),C=({children:e,debug:o=!1})=>r.jsx(k.Provider,{value:o,children:e}),T=()=>e.useContext(k),v={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},m={IDCapturing:{backgroundColor:"rgba(0, 0, 0, 0.6)",titleFront:{color:"#fff",fontSize:"20px",fontWeight:"normal",backgroundColor:"unset"},titleBack:{color:"#fff",fontSize:"20px",fontWeight:"normal",backgroundColor:"unset"},instruction:{padding:"unset",color:"#fff",fontSize:"16px",fontWeight:"normal",backgroundColor:"unset",border:"unset",borderRadius:"unset"},captureInstruction:{capturing:{padding:"12px 12px",color:"#ffffff",fontSize:"14px",fontWeight:"normal",background:"rgba(15, 23, 42, 0.25)",border:"none",borderRadius:"100px"},captured:{padding:"12px 12px",color:"#ffffff",fontSize:"14px",fontWeight:"normal",background:"rgba(15, 23, 42, 0.25)",border:"none",borderRadius:"100px"}},error:{padding:"5px 10px",color:"#fff",fontSize:"16px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px"},toggle:{color:"#d1d1d1",fontSize:"16px",fontWeight:"500",gap:"16px",backgroundColor:"#fff",active:{backgroundColor:"#2196f3"},inactive:{backgroundColor:"#ccc"}},countdown:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px"},cardIcon:{src:"",width:"auto",height:"38px"},captureIcon:{src:"",width:"60px",height:"60px",disabled:{src:""}},loadingIcon:{src:"",width:"100px",height:"100px"},rectangleMask:{width:600,height:400,strokeWidth:2,strokeStyles:{},radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"},default:{fill:"none",stroke:"#fff",strokeWidth:2,strokeDasharray:"7, 4",opacity:.6},error:{fill:"rgba(234,50,35, 0.1)",strokeWidth:2,stroke:"#ea3223"}}},IDConfirmPopup:{image:{borderRadius:"5px"}},QRStep:{title:{color:"#fff",fontSize:"20px",fontWeight:"700",backgroundColor:"unset"},guidelinePopup:{image:{src:"",borderRadius:"5px",backgroundColor:"#e7e6e6"},guideText:{color:v.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",lineHeight:"20px"},countdownText:{color:v.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",lineHeight:"20px"}},scanTooltip:{backgroundColor:"#00ce78",borderRadius:"8px",color:"#fff",padding:"10px",textAlign:"center"},scanCountdown:{textAlign:"center",color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"none",borderRadius:"3px",padding:"5px 10px"},invalidPopup:{padding:"10px",title:{display:"block",color:v.tsSecondary,fontSize:"16px",fontWeight:"bold",margin:"25px 0 0 0",padding:"0 0 0 0"},description:{color:v.tsSecondary,fontSize:"16px",fontWeight:"normal",textAlign:"center",margin:"30px 0 0 0",padding:"0 0 0 0"},retryButton:{color:"#fff",fontSize:"1rem",fontWeight:"normal",backgroundColor:v.tsBlue,border:"none",borderRadius:"3px",outline:"none",height:"66px",margin:"30px 0 0 0"},skipButton:{color:v.tsBlue,fontSize:"1rem",fontWeight:"normal",backgroundColor:"unset",border:"none",borderRadius:"unset",outline:"none",height:"unset",margin:"20px 0"}},resultText:{success:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#34ce60"},error:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#ff9532"}}}},D={IDCapturing:{backgroundColor:"rgba(0, 0, 0, 0.6)",titleFront:{...o.DesignToken.Typography.h4,color:o.DesignToken.Color.base.white,backgroundColor:"unset"},titleBack:{...o.DesignToken.Typography.h4,color:o.DesignToken.Color.base.white,backgroundColor:"unset"},instruction:{...o.DesignToken.Typography.body,padding:"5px 10px",color:"rgba(255, 255, 255, 0.8)",backgroundColor:"unset",border:"unset",borderRadius:"unset"},captureInstruction:{capturing:{...o.DesignToken.Typography.label,color:o.DesignToken.Color.base.white,padding:`6px ${o.DesignToken.Spacing.sm}`,background:"rgba(15, 23, 42, 0.35)",border:"none",borderRadius:"100px"},captured:{...o.DesignToken.Typography.label,color:o.DesignToken.Color.base.white,padding:`6px ${o.DesignToken.Spacing.sm}`,background:"rgba(15, 23, 42, 0.35)",border:"none",borderRadius:"100px"}},error:{...o.DesignToken.Typography.body,padding:"5px 10px",color:o.DesignToken.Color.semantic.error[400],backgroundColor:"transparent",border:"unset",borderRadius:o.DesignToken.CornerRadius["2xs"]},toggle:{...o.DesignToken.Typography.body,color:o.DesignToken.Color.base.white,gap:o.DesignToken.Spacing.base,backgroundColor:o.DesignToken.Color.base.white,active:{backgroundColor:o.DesignToken.Color.base.blue},inactive:{backgroundColor:o.DesignToken.Color.neutral[300]}},countdown:{...o.DesignToken.Typography.body,color:o.DesignToken.Color.semantic.error[400],backgroundColor:"transparent",border:"unset",borderRadius:o.DesignToken.CornerRadius["2xs"]},cardIcon:{src:"",width:"auto",height:"38px"},captureIcon:{src:"",width:o.DesignToken.Height["7xl"],height:o.DesignToken.Height["7xl"],disabled:{src:""}},loadingIcon:{src:"",width:"47px",height:"47px"},rectangleMask:{width:600,height:400,strokeWidth:n.getCSSNumericValue(o.DesignToken.BorderWidth["3xl"]),strokeStyles:{},radius:n.getCSSNumericValue(o.DesignToken.CornerRadius.base),paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"},default:{fill:"none",stroke:o.DesignToken.Color.neutral[400],strokeWidth:n.getCSSNumericValue(o.DesignToken.BorderWidth["3xl"])},error:{fill:"none",strokeWidth:n.getCSSNumericValue(o.DesignToken.BorderWidth["3xl"]),stroke:o.DesignToken.Color.semantic.error[400]}}},IDConfirmPopup:{image:{borderRadius:o.DesignToken.CornerRadius["2xs"]}},QRStep:{title:{...o.DesignToken.Typography.h4,backgroundColor:"unset"},guidelinePopup:{image:{src:"",borderRadius:o.DesignToken.CornerRadius["2xs"],backgroundColor:"transparent"},guideText:{...o.DesignToken.Typography.body,color:o.DesignToken.Color.neutral[600],textAlign:"center"},countdownText:{...o.DesignToken.UIText.medium,color:o.DesignToken.Color.neutral[500],textAlign:"center"}},scanTooltip:{backgroundColor:"transparent",borderRadius:o.DesignToken.CornerRadius.xs,color:o.DesignToken.Color.base.white,padding:"10px",textAlign:"center"},scanCountdown:{...o.DesignToken.Typography.body,color:o.DesignToken.Color.semantic.error[400],textAlign:"center",backgroundColor:"transparent",border:"none",borderRadius:o.DesignToken.CornerRadius["2xs"],padding:"0px"},invalidPopup:{padding:"10px",title:{...o.DesignToken.Typography.h6,color:o.DesignToken.Color.content.primary,display:"none",margin:"25px 0 0 0",padding:"0 0 0 0"},description:{...o.DesignToken.Typography.body,color:o.DesignToken.Color.content.secondary,textAlign:"center",margin:"30px 0 0 0",padding:"0 0 0 0"},retryButton:{...o.DesignToken.Typography.body,color:o.DesignToken.Color.base.white,backgroundColor:o.DesignToken.Color.base.blue,borderRadius:o.DesignToken.CornerRadius.xs,border:"none",outline:"none",height:o.DesignToken.Height["3xl"],margin:"24px 0 0 0"},skipButton:{...o.DesignToken.Typography.body,color:o.DesignToken.Color.content.primary,backgroundColor:o.DesignToken.Color.background.tertiary,borderRadius:o.DesignToken.CornerRadius.xs,border:"none",outline:"none",height:o.DesignToken.Height["3xl"],margin:"12px 0"}},resultText:{success:{...o.DesignToken.Typography.body,textColor:o.DesignToken.Color.content.primary,mainColor:o.DesignToken.Color.semantic.success[400]},error:{...o.DesignToken.Typography.body,textColor:o.DesignToken.Color.content.primary,mainColor:o.DesignToken.Color.semantic.warning[500]}}}},R=m,S=D,{DesignToken:W}=o,w={FlashLiveness:{maskFill:"#fff",mask:{strokeColor:W.Color.separators.secondary,strokeColorError:W.Color.semantic.error[400],strokeWidth:4,path:"M118.5 2.5C54.2233 2.5 2.5 59.5579 2.5 129.447C2.5 146.072 3.68394 172.618 8.16415 200.483C12.6369 228.301 20.4309 257.673 33.7816 279.787C46.9667 301.626 59.6817 317.047 73.3658 327.003C87.1207 337.011 101.735 341.41 118.5 341.41C135.265 341.41 149.879 337.011 163.634 327.003C177.318 317.047 190.033 301.626 203.218 279.787C216.569 257.673 224.363 228.301 228.836 200.483C233.316 172.618 234.5 146.072 234.5 129.447C234.5 59.5579 182.777 2.5 118.5 2.5Z",width:237,height:344},title:{hidden:!1,height:"auto",color:W.Color.content.primary,fontSize:W.Typography.h5.fontSize,fontWeight:W.Typography.h5.fontWeight,lineHeight:W.Typography.h5.lineHeight},guideline:{text:{close:{color:W.Color.content.primary,fontSize:W.Typography.h6.fontSize,fontWeight:W.FontWeight["semi-bold"],background:W.Color.background.secondary,border:`${W.BorderWidth.base} solid ${W.Color.separators.tertiary}`,borderRadius:"100px",padding:"12px 16px"},far:{color:W.Color.content.primary,fontSize:W.Typography.h6.fontSize,fontWeight:W.FontWeight["semi-bold"],background:W.Color.background.secondary,border:`${W.BorderWidth.base} solid ${W.Color.separators.tertiary}`,borderRadius:"100px",padding:"12px 16px"},flashing:{color:W.Color.content["on-bg-color"],fontSize:W.Typography.label.fontSize,fontWeight:W.Typography.label.fontWeight,background:"rgba(15, 23, 42, 0.35)",border:"none",borderRadius:"100px",padding:"12px 16px"}},icon:{color:W.Color.blue[900],src:""}},instruction:{color:W.Color.content["on-bg-color"],fontSize:W.Typography.label.fontSize,fontWeight:W.Typography.label.fontWeight,background:"rgba(15, 23, 42, 0.35)",border:"none",borderRadius:"100px"},timeoutText:{color:W.Color.semantic.error[400],fontSize:W.Typography.body.fontSize,fontWeight:W.Typography.body.fontWeight,padding:"0"},errorOverlay:{backgroundColor:"transparent",opacity:0},progressBar:{mainColor:W.Color.blue[900],secondaryColor:W.Color.blue[100],textColor:W.Color.blue[900],fontSize:W.Typography.body.fontSize,fontWeight:W.FontWeight["semi-bold"]},flashing:{logo:{src:"",width:"140px",height:"auto"},backgroundPattern:{srcMobile:"",srcDesktop:"",width:"100%",height:"auto"}}}},z=w,j=w,{DesignToken:_}=o,A={Selfie:{backgroundColor:"#FFF",title:{...o.DesignToken.Typography.h5,color:o.DesignToken.Color.content.primary},countdown:{color:_.Color.semantic.error[400],fontSize:_.Typography.body.fontSize,fontWeight:_.Typography.body.fontWeight,backgroundColor:"transparent",border:"unset",borderRadius:"3px",padding:"0px"},loadingIcon:{src:"",width:"47px",height:"47px"},error:{color:_.Color.semantic.error[400],fontSize:_.Typography.body.fontSize,fontWeight:_.Typography.body.fontWeight,backgroundColor:"transparent",border:"unset",borderRadius:"3px",padding:"5px 10px"},progressCircle:{activeColor:"rgba(52, 152, 211, 1)",innerPadding:3,showDashedRing:!0,showOutsideRing:!1,dashedRingLineThick:"2",dashedRingLineSpacing:"3.5",dashedRingColor:"rgba(193, 197, 204, 1)",dashedRingOpacity:1,insideRingColor:"#fff",insideRingWidth:10,insideRingStrokeDash:"0",outsideRingOpacity:1,outsideRingColor:"#fff",errorRingWidth:0,radius:160,strokeWidth:3,progress:0,showErrorRing:!1,errorRingColor:"#df0000",dashedRingWidth:10,dashedInsideRingColor:"#fff",dashedInsideRingWidth:3,showInsideRing:!0},progressCircleV2:{activeColor:_.Color.blue[900],neutralColor:_.Color.neutral[300],errorColor:_.Color.semantic.error[400],radius:160,strokeWidth:2,progress:0,tickWidth:15,numberOfTicks:200},Active:{instruction:{color:_.Color.content.primary,fontSize:_.Typography.body.fontSize,fontWeight:_.Typography.body.fontWeight,textShadow:"none",backgroundColor:"unset",border:"unset",borderRadius:"unset"},directionIcon:{frontal:"",frontalWidth:"168px",left:"",leftWidth:"150px",right:"",rightWidth:"150px",up:"",upWidth:"150px"},imageHolder:{width:"72px",height:"72px",borderRadius:"50%",border:`3px solid ${_.Color.blue[900]}`,fontSize:"16px",color:"#fff",fontWeight:"700",frontal:"",left:"",right:"",up:"",activeStepBorder:`1px solid ${_.Color.separators.tertiary}`,activeStepBorderRadius:"50%"}}}},I={Selfie:{backgroundColor:"rgba(0, 0, 0, 0.6)",captureIcon:{src:"",width:"50px"},countdown:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px",padding:"5px 10px"},loadingIcon:{src:"",width:"47px",height:"47px"},error:{color:"#fff",fontSize:"18px",fontWeight:"normal",backgroundColor:"#ea3223",border:"unset",borderRadius:"3px",padding:"5px 10px"},progressCircle:{radius:160,strokeWidth:3,progress:0,showErrorRing:!0,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:1,insideRingStrokeDash:"2",errorRingColor:"#df0000",errorRingWidth:1,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!1,showDashedRing:!1,showInsideRing:!0},Active:{instruction:{color:"#fff",fontSize:"20px",fontWeight:"normal",textShadow:"2px 2px 4px #000000",backgroundColor:"unset",border:"unset",borderRadius:"unset"},directionIcon:{frontal:"",frontalWidth:"140px",left:"",leftWidth:"80px",right:"",rightWidth:"80px",up:"",upWidth:"80px"},imageHolder:{width:"40px",height:"40px",borderRadius:"50%",border:"2px solid #fff",fontSize:"16px",color:"#fff",fontWeight:"700",frontal:"",left:"",right:"",up:""}}}},O=A,{DesignToken:P}=o,B={PassiveLiveness:{instruction:{color:P.Color.content["on-bg-color"],fontSize:P.Typography.label.fontSize,fontWeight:P.Typography.label.fontWeight,background:"rgba(15, 23, 42, 0.35)",border:"none",borderRadius:"100px",backdropFilter:"blur(28px)",padding:"12px 12px"}}},F=B,q=B,H={closeButton:{top:o.DesignToken.Spacing.base,right:o.DesignToken.Spacing.base,left:"auto",bottom:"auto",display:"block",src:"",width:"24px",height:"auto"},popup:{backgroundColor:o.DesignToken.Color.base.white,padding:"10px",border:"none",borderRadius:o.DesignToken.CornerRadius.sm,overlay:{backgroundColor:o.DesignToken.Color.mask[70]},title:{...o.DesignToken.Typography.h6,fontWeight:o.DesignToken.FontWeight["semi-bold"],color:o.DesignToken.Color.content.primary,textAlign:"center",display:"initial",margin:"25px 0 0 0",padding:"0 0 0 0"},description:{...o.DesignToken.Typography.body,color:o.DesignToken.Color.content.secondary,textAlign:"center",border:"unset",borderRadius:"unset",margin:"30px 0 0 0",padding:"0 0 0 0"},primaryButton:{...o.DesignToken.Typography.body,color:o.DesignToken.Color.base.white,backgroundColor:o.DesignToken.Color.base.blue,borderRadius:o.DesignToken.CornerRadius.xs,border:"none",outline:"none",height:o.DesignToken.Height["3xl"],maxWidth:"unset"},secondaryButton:{...o.DesignToken.Typography.body,color:o.DesignToken.Color.content.primary,backgroundColor:o.DesignToken.Color.background.tertiary,borderRadius:o.DesignToken.CornerRadius.xs,border:"none",outline:"none",height:o.DesignToken.Height["3xl"],maxWidth:"unset"}}},$={v1:{...R,...z,...I,...F,...H},v2:{...S,...j,...O,...q,...H}};function L(){if(rn)return ro;rn=1;var r=u();return ro=function(){try{var e=r(Object,"defineProperty");return e({},"",{}),e}catch(r){}}()}function M(){if(ri)return rt;ri=1;var r=L();return rt=function(e,o,n){"__proto__"==o&&r?r(e,o,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[o]=n}}function U(){if(ru)return ra;ru=1;var r=M(),e=s();return ra=function(o,n,t){(void 0===t||e(o[n],t))&&(void 0!==t||n in o)||r(o,n,t)}}var E,V,K,N,Q,Z,G,J,X,Y,rr,re,ro,rn,rt,ri,ra,ru,rs,rd,rc,rl,rg,rf,rp,rh,rb,ry,rx,rk,rC,rT,rv,rm,rD,rR,rS,rW,rw,rz,rj,r_,rA,rI,rO,rP,rB,rF,rq,rH,r$,rL,rM,rU,rE,rV,rK,rN,rQ,rZ,rG,rJ,rX,rY,r0,r1,r2,r3,r5,r6,r4,r7,r8,r9,er,ee,eo,en,et,ei,ea,eu,es,ed,ec,el,eg,ef,ep,eh,eb,ey,ex,ek,eC,eT,ev,em,eD,eR,eS,eW,ew,ez,ej,e_,eA,eI,eO,eP={exports:{}};eP.exports;function eB(){return rD?rm:(rD=1,rm=function(r,e){return function(o){return r(e(o))}})}function eF(){return rS?rR:(rS=1,rR=eB()(Object.getPrototypeOf,Object))}function eq(){if(rw)return rW;rw=1;var r=Object.prototype;return rW=function(e){var o=e&&e.constructor;return e===("function"==typeof o&&o.prototype||r)}}function eH(){if(rO)return rI;rO=1;var r=function(){if(rA)return r_;rA=1;var r=l(),e=g();return r_=function(o){return e(o)&&"[object Arguments]"==r(o)}}(),e=g(),o=Object.prototype,n=o.hasOwnProperty,t=o.propertyIsEnumerable;return rI=r(function(){return arguments}())?r:function(r){return e(r)&&n.call(r,"callee")&&!t.call(r,"callee")}}function e$(){return rB?rP:(rB=1,rP=function(r){return"number"==typeof r&&r>-1&&r%1==0&&r<=0x1fffffffffffff})}function eL(){if(rq)return rF;rq=1;var r=f(),e=e$();return rF=function(o){return null!=o&&e(o.length)&&!r(o)}}var eM={exports:{}};function eU(){var r,e,o,n,t,i,a,u;if(rU)return eM.exports;return rU=1,r=eM,e=eM.exports,o=d(),n=rM?rL:(rM=1,rL=function(){return!1}),u=(a=(i=(t=e&&!e.nodeType&&e)&&r&&!r.nodeType&&r)&&i.exports===t?o.Buffer:void 0)?a.isBuffer:void 0,r.exports=u||n,eM.exports}function eE(){if(rV)return rE;rV=1;var r=l(),e=eF(),o=g(),n=Object.prototype,t=Function.prototype.toString,i=n.hasOwnProperty,a=t.call(Object);return rE=function(n){if(!o(n)||"[object Object]"!=r(n))return!1;var u=e(n);if(null===u)return!0;var s=i.call(u,"constructor")&&u.constructor;return"function"==typeof s&&s instanceof s&&t.call(s)==a}}eM.exports;var eV={exports:{}};eV.exports;function eK(){if(rX)return rJ;rX=1;var r=function(){if(rN)return rK;rN=1;var r=l(),e=e$(),o=g(),n={};return n["[object Float32Array]"]=n["[object Float64Array]"]=n["[object Int8Array]"]=n["[object Int16Array]"]=n["[object Int32Array]"]=n["[object Uint8Array]"]=n["[object Uint8ClampedArray]"]=n["[object Uint16Array]"]=n["[object Uint32Array]"]=!0,n["[object Arguments]"]=n["[object Array]"]=n["[object ArrayBuffer]"]=n["[object Boolean]"]=n["[object DataView]"]=n["[object Date]"]=n["[object Error]"]=n["[object Function]"]=n["[object Map]"]=n["[object Number]"]=n["[object Object]"]=n["[object RegExp]"]=n["[object Set]"]=n["[object String]"]=n["[object WeakMap]"]=!1,rK=function(t){return o(t)&&e(t.length)&&!!n[r(t)]}}(),e=rZ?rQ:(rZ=1,rQ=function(r){return function(e){return r(e)}}),o=function(){var r,e,o,n,t,i;if(rG)return eV.exports;return rG=1,r=eV,e=eV.exports,o=p(),i=(t=(n=e&&!e.nodeType&&e)&&r&&!r.nodeType&&r)&&t.exports===n&&o.process,r.exports=function(){try{var r=t&&t.require&&t.require("util").types;if(r)return r;return i&&i.binding&&i.binding("util")}catch(r){}}(),eV.exports}(),n=o&&o.isTypedArray;return rJ=n?e(n):r}function eN(){return r0?rY:(r0=1,rY=function(r,e){if("constructor"!==e||"function"!=typeof r[e]){if("__proto__"!=e)return r[e]}})}function eQ(){if(r5)return r3;r5=1;var r=function(){if(r2)return r1;r2=1;var r=M(),e=s(),o=Object.prototype.hasOwnProperty;return r1=function(n,t,i){var a=n[t];o.call(n,t)&&e(a,i)&&(void 0!==i||t in n)||r(n,t,i)}}(),e=M();return r3=function(o,n,t,i){var a=!t;t||(t={});for(var u=-1,s=n.length;++u<s;){var d=n[u],c=i?i(t[d],o[d],d,t,o):void 0;void 0===c&&(c=o[d]),a?e(t,d,c):r(t,d,c)}return t}}function eZ(){if(r8)return r7;r8=1;var r=/^(?:0|[1-9]\d*)$/;return r7=function(e,o){var n=typeof e;return!!(o=null==o?0x1fffffffffffff:o)&&("number"==n||"symbol"!=n&&r.test(e))&&e>-1&&e%1==0&&e<o}}function eG(){if(er)return r9;er=1;var r=r4?r6:(r4=1,r6=function(r,e){for(var o=-1,n=Array(r);++o<r;)n[o]=e(o);return n}),e=eH(),o=h(),n=eU(),t=eZ(),i=eK(),a=Object.prototype.hasOwnProperty;return r9=function(u,s){var d=o(u),c=!d&&e(u),l=!d&&!c&&n(u),g=!d&&!c&&!l&&i(u),f=d||c||l||g,p=f?r(u.length,String):[],h=p.length;for(var b in u)(s||a.call(u,b))&&!(f&&("length"==b||l&&("offset"==b||"parent"==b)||g&&("buffer"==b||"byteLength"==b||"byteOffset"==b)||t(b,h)))&&p.push(b);return p}}function eJ(){if(ea)return ei;ea=1;var r=eG(),e=function(){if(et)return en;et=1;var r=c(),e=eq(),o=eo?ee:(eo=1,ee=function(r){var e=[];if(null!=r)for(var o in Object(r))e.push(o);return e}),n=Object.prototype.hasOwnProperty;return en=function(t){if(!r(t))return o(t);var i=e(t),a=[];for(var u in t)"constructor"==u&&(i||!n.call(t,u))||a.push(u);return a}}(),o=eL();return ei=function(n){return o(n)?r(n,!0):e(n)}}function eX(){return ep?ef:(ep=1,ef=function(r){return r})}function eY(){return eb?eh:(eb=1,eh=function(r,e,o){switch(o.length){case 0:return r.call(e);case 1:return r.call(e,o[0]);case 2:return r.call(e,o[0],o[1]);case 3:return r.call(e,o[0],o[1],o[2])}return r.apply(e,o)})}function e0(){if(ew)return eW;ew=1;var r=eX(),e=function(){if(ex)return ey;ex=1;var r=eY(),e=Math.max;return ey=function(o,n,t){return n=e(void 0===n?o.length-1:n,0),function(){for(var i=arguments,a=-1,u=e(i.length-n,0),s=Array(u);++a<u;)s[a]=i[n+a];a=-1;for(var d=Array(n+1);++a<n;)d[a]=i[a];return d[n]=t(s),r(o,this,d)}}}(),o=function(){if(eS)return eR;eS=1;var r=function(){if(ev)return eT;ev=1;var r=eC?ek:(eC=1,ek=function(r){return function(){return r}}),e=L(),o=eX();return eT=e?function(o,n){return e(o,"toString",{configurable:!0,enumerable:!1,value:r(n),writable:!0})}:o}();return eR=(function(){if(eD)return em;eD=1;var r=Date.now;return em=function(e){var o=0,n=0;return function(){var t=r(),i=16-(t-n);if(n=t,i>0){if(++o>=800)return arguments[0]}else o=0;return e.apply(void 0,arguments)}}})()(r)}();return eW=function(n,t){return o(e(n,t,r),n+"")}}function e1(){if(ej)return ez;ej=1;var r=s(),e=eL(),o=eZ(),n=c();return ez=function(t,i,a){if(!n(a))return!1;var u=typeof i;return("number"==u?!!(e(a)&&o(i,a.length)):"string"==u&&i in a)&&r(a[i],t)}}function e2(){if(eA)return e_;eA=1;var r=e0(),e=e1();return e_=function(o){return r(function(r,n){var t=-1,i=n.length,a=i>1?n[i-1]:void 0,u=i>2?n[2]:void 0;for(a=o.length>3&&"function"==typeof a?(i--,a):void 0,u&&e(n[0],n[1],u)&&(a=i<3?void 0:a,i=1),r=Object(r);++t<i;){var s=n[t];s&&o(r,s,t,a)}return r})}}var e3=b(function(){if(eO)return eI;eO=1;var r=function(){if(eg)return el;eg=1;var r=function(){if(re)return rr;re=1;var r=t(),e=function(){if(V)return E;V=1;var r=t();return E=function(){this.__data__=new r,this.size=0}}(),o=N?K:(N=1,K=function(r){var e=this.__data__,o=e.delete(r);return this.size=e.size,o}),n=Z?Q:(Z=1,Q=function(r){return this.__data__.get(r)}),u=J?G:(J=1,G=function(r){return this.__data__.has(r)}),s=function(){if(Y)return X;Y=1;var r=t(),e=i(),o=a();return X=function(n,t){var i=this.__data__;if(i instanceof r){var a=i.__data__;if(!e||a.length<199)return a.push([n,t]),this.size=++i.size,this;i=this.__data__=new o(a)}return i.set(n,t),this.size=i.size,this}}();function d(e){var o=this.__data__=new r(e);this.size=o.size}return d.prototype.clear=e,d.prototype.delete=o,d.prototype.get=n,d.prototype.has=u,d.prototype.set=s,rr=d}(),e=U(),o=rl?rc:(rl=1,rc=(rd?rs:(rd=1,rs=function(r){return function(e,o,n){for(var t=-1,i=Object(e),a=n(e),u=a.length;u--;){var s=a[r?u:++t];if(!1===o(i[s],s,i))break}return e}}))()),n=function(){if(ec)return ed;ec=1;var r=U(),e=function(){var r,e,o,n,t,i,a;if(rg)return eP.exports;return rg=1,r=eP,e=eP.exports,o=d(),a=(i=(t=(n=e&&!e.nodeType&&e)&&r&&!r.nodeType&&r)&&t.exports===n?o.Buffer:void 0)?i.allocUnsafe:void 0,r.exports=function(r,e){if(e)return r.slice();var o=r.length,n=a?a(o):new r.constructor(o);return r.copy(n),n},eP.exports}(),o=function(){if(rx)return ry;rx=1;var r=function(){if(rb)return rh;rb=1;var r=rp?rf:(rp=1,rf=d().Uint8Array);return rh=function(e){var o=new e.constructor(e.byteLength);return new r(o).set(new r(e)),o}}();return ry=function(e,o){var n=o?r(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}}(),n=rC?rk:(rC=1,rk=function(r,e){var o=-1,n=r.length;for(e||(e=Array(n));++o<n;)e[o]=r[o];return e}),t=function(){if(rj)return rz;rj=1;var r=function(){if(rv)return rT;rv=1;var r=c(),e=Object.create;return rT=function(){function o(){}return function(n){if(!r(n))return{};if(e)return e(n);o.prototype=n;var t=new o;return o.prototype=void 0,t}}()}(),e=eF(),o=eq();return rz=function(n){return"function"!=typeof n.constructor||o(n)?{}:r(e(n))}}(),i=eH(),a=h(),u=function(){if(r$)return rH;r$=1;var r=eL(),e=g();return rH=function(o){return e(o)&&r(o)}}(),s=eU(),l=f(),p=c(),b=eE(),y=eK(),x=eN(),k=function(){if(es)return eu;es=1;var r=eQ(),e=eJ();return eu=function(o){return r(o,e(o))}}();return ed=function(d,c,g,f,h,C,T){var v=x(d,g),m=x(c,g),D=T.get(m);if(D)return void r(d,g,D);var R=C?C(v,m,g+"",d,c,T):void 0,S=void 0===R;if(S){var W=a(m),w=!W&&s(m),z=!W&&!w&&y(m);R=m,W||w||z?a(v)?R=v:u(v)?R=n(v):w?(S=!1,R=e(m,!0)):z?(S=!1,R=o(m,!0)):R=[]:b(m)||i(m)?(R=v,i(v)?R=k(v):(!p(v)||l(v))&&(R=t(m))):S=!1}S&&(T.set(m,R),h(R,m,f,C,T),T.delete(m)),r(d,g,R)}}(),u=c(),s=eJ(),l=eN();return el=function t(i,a,d,c,g){i!==a&&o(a,function(o,s){if(g||(g=new r),u(o))n(i,a,s,d,t,c,g);else{var f=c?c(l(i,s),o,s+"",i,a,g):void 0;void 0===f&&(f=o),e(i,s,f)}},s)}}();return eI=e2()(function(e,o,n){r(e,o,n)})}());let e5=r=>{let{customTheme:o,clientSettings:n,themeVersion:t,uiSettings:i,defaultThemes:a=$}=r,u=y.getWebSetting(n,"data.settings.sdk_settings.ui_custom_settings");return e.useMemo(()=>{let r=x.selectUiSettings(i,u);return{...e3({},x.mapUISettingsToCustomTheme(r),o),themeVersion:t,defaultThemes:a}},[o,a,t,i,u])},e6=()=>{},e4=e.createContext({onDoneCallback:e6,onErrorCallback:e6,onCloseCallback:e6}),e7=({children:o,onDone:n=e6,onError:t=e6,onClose:i=e6})=>{let a=e.useCallback(r=>{n&&n(r)},[n]),u=e.useCallback(r=>{t&&t(r)},[t]),s=e.useCallback(()=>{i&&i()},[i]),d=e.useMemo(()=>({onDoneCallback:a,onErrorCallback:u,onCloseCallback:s}),[a,u,s]);return r.jsx(e4.Provider,{value:d,children:o})},e8=()=>{let r=e.useContext(e4);if(void 0===r)throw Error("useSDKCallback must be used within a SDKCallbackProvider");return r},e9=e.createContext(""),or=({children:e,isWrappedBy:o=""})=>r.jsx(e9.Provider,{value:o,children:e}),oe=()=>e.useContext(e9);export{C as D,e7 as S,or as W,D as a,T as b,oe as c,$ as d,e5 as e,e2 as f,eJ as g,eE as h,e0 as i,eY as j,eB as k,eq as l,e3 as m,eG as n,eL as o,e1 as p,eQ as r,v as t,e8 as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
let e;import{d as t,r as s,j as n,a as i,aa as l,c as r,a9 as a,ab as o,o as c,u as u,g as g,p as d,s as S,e as h,X as v}from"./chunk-68e90ba2.js";import{e as f,d as j,c as p,D as b,S as x}from"./chunk-bcf5eed2.js";let k=s.createContext({}),y={},C=({children:e,enableGetClientSettings:i,clientSettings:l,apiCredentials:r,flowId:a})=>{let{apiClient:o}=t.useApiClient({apiCredentials:r}),[c,u]=s.useState({}),[g,d]=s.useState(!1);s.useEffect(()=>{i?async function e(){try{if(!o||"function"!=typeof o.clientSettings)return;let e=await o.clientSettings({flow_id:a});u(e)}catch(e){console.error(e)}finally{d(!0)}}():d(!0)},[i,o,a]);let S=y;return(l&&Object.keys(l).length>0?S=l:i&&(S=c),g)?n.jsx(k.Provider,{value:S,children:e}):null},m=()=>s.useContext(k),_=({children:e,onError:t})=>{let s=m();return n.jsx(i.LicenseProvider,{clientSettings:s,onError:t,children:e})},E=({children:e,onError:t,type:s})=>{let i=m();return n.jsx(l.Provider,{clientSettings:i,type:s,onError:t,children:e})},D={},P=({children:e,customTexts:t=D})=>{let s=m(),{lang:i,uiSettings:l}=r.useSDKSettings(),c=a({customTexts:t,clientSettings:s,lang:i,uiSettings:l});return n.jsx(o.SDKLocaleProvider,{value:c,children:e})},L={},B=({children:e,customTheme:t=L})=>{let s=m(),{uiSettings:i,themeVersion:l}=r.useSDKSettings(),a=f({customTheme:t,clientSettings:s,themeVersion:l,uiSettings:i,defaultThemes:j});return n.jsx(c,{theme:a,children:e})},z=v.lazy(()=>import("./chunk-337b9ebf.js")),w=v.lazy(()=>import("./chunk-77790073.js")),A=v.lazy(()=>import("./chunk-ccb7bcab.js")),K=v.lazy(()=>import("./chunk-2bfdf00f.js")),I=v.lazy(()=>import("./chunk-e7ee9d9f.js")),V=v.lazy(()=>import("./chunk-2932b8ef.js"));var T=(e=e=>{var t,i,l;let a,{logCredentials:o={enable:!1},livenessComponent:c,customTheme:v={},customTexts:f,...j}=e,{mode:k,flowId:y,onError:C,onClose:D,debug:L,onLivenessDetectionDone:T}=j,W=m(),{billingSettings:M,enableBilling:O,themeVersion:G}=r.useSDKSettings(),F=u.getWebSetting(W,"data.settings.sdk_settings.billing_settings.billing_config"),{submitBilling:U}=g({enable:O,onError:C,billingSettings:M??{json:F??{}},billingUrl:u.getWebSetting(W,"data.settings.sdk_settings.billing_settings.url")}),X=d.buildBillingInput(e),$=p(),q="face_authen"===$?S.BillingService.faceAuth:S.BillingService.selfie,H=s.useCallback(async(...e)=>{if("face_authen"===$)return void await T(...e);try{if(!await U({service:q,input:X,output:{...d.buildBillingOutput(e?.[0]||{}),sdkStatus:S.BillingStatus.success}}))return}catch(e){console.error(e)}await T(...e)},[X,q,$,T,U]),J=s.useCallback(e=>{S.ErrorsWithoutBilling.includes(e.code)?C(e):(U({service:q,input:X,output:{error:e,sdkStatus:S.BillingStatus.fail}}),C&&C(e))},[U,q,X,C]),N=s.useCallback(()=>{U({service:q,input:X,output:{sdkStatus:S.BillingStatus.cancel}}),D&&D()},[U,q,X,D]),Q=(t=k,i=c,l=G,a=K,t===S.Mode.ACTIVE&&(a=i?.ActiveLiveness??("v1"===l?I:K)),t===S.Mode.PASSIVE_V2&&(a=i?.PassiveLivenessV2??A),t===S.Mode.PASSIVE&&(a=i?.PassiveLiveness??("v1"===l?V:w)),"string"==typeof t&&t.startsWith("flash")&&(a=i?.FlashLiveness??z),a);return n.jsx(b,{debug:L,children:n.jsx(x,{onDone:T,onError:J,onClose:N,children:n.jsx(P,{customTexts:f,children:n.jsx(E,{onError:J,type:"face_authen"===y?"face_auth":"liveness",children:n.jsx(_,{onError:C,children:n.jsx(B,{customTheme:v,children:n.jsx(h.SDKTrackingProvider,{value:{tracking:{...o}},children:n.jsx(s.Suspense,{fallback:null,children:n.jsx(Q,{...j,onLivenessDetectionDone:H})})})})})})})})})},function(t){let{apiCheck:s,apiCredentials:i,serviceSettings:l,flowId:r,clientSettings:a}=t,o=s&&(l?.enableGetClientSettings??!0);return n.jsx(C,{enableGetClientSettings:o,clientSettings:a,apiCredentials:i,flowId:r,children:n.jsx(e,{...t})})}),W=Object.freeze({__proto__:null,default:T});export{C as C,T as L,P as S,W as i,m as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,u as t,k as s,b as a,A as i,m as n,ap as r,aq as l,M as o,O as _,Q as g,j as d,ar as c,as as m,at as f,au as u,av as v,aC as b,aD as h,az as p,G as k,R as y,d as S,f as C,s as F,aA as x,aB as w,Y as E,P as W}from"./chunk-68e90ba2.js";import{d as R}from"./chunk-5993adde.js";import{t as M}from"./chunk-7d0d639a.js";import{C as L,O as O}from"./chunk-5d5d5df1.js";import{u as D,S as B,a as I,o as P,b as T,c as j,d as A,n as V,l as q,f as U,F as z,e as Q,s as N,g as G,h as J,i as H,j as K,W as $,k as X,m as Y,p as Z,q as ee,r as et,A as es,O as ea}from"./chunk-2e802851.js";import{m as ei,u as en,b as er}from"./chunk-bcf5eed2.js";import{u as el}from"./chunk-c04f48e4.js";let eo=0,e_=1,eg={data:{settings:{sdk_settings:{passive_liveness_v2_settings:{frontal_face_check:{enable:!0,up_down_bound_min:.35,up_down_bound_max:.7},capture_frame_settings:{enable:!1,frames_batch_length:10,frames_interval_time:0,frame_quality:.8,frame_scale:1,auto_capture_min_frames:8,auto_capture_min_frames_far:8,auto_capture_min_frames_close:0},not_qualified_settings:{enable_far:!1,threshold_far:.11},close_eyes_settings:{enable:!1,timeout:5,force_check:!1},face_settings:{chin_height:20,max_far_face_ratio:.9,min_far_face_ratio:.8,mobile:{chin_height:20,max_far_face_ratio:.9,min_far_face_ratio:.85}},timeout_settings:{enable:!0,total:30,countdown:10,max_retry_count:0,non_stoppable:!1},exif_data_settings:{enable:!0},mask_settings:{mobile:{oval_vertical_padding:20,oval_horizontal_padding:20,oval_vertical_offset:60,small_scale:.65},oval_horizontal_padding:20,oval_vertical_padding:20,oval_vertical_offset:0,small_scale:.6},image_settings:{valid_face_ratio:.6,image_quality:1,crop_center_far:!0,crop_center_close:!1,detection_to_whole_face_ratio:.8},blur_far_settings:{enable:!0,blurry_threshold:.4,wait_for_best_image_time_ms:1e3},brightness_detection_far_settings:{enable_too_bright_check:!1,enable_too_dark_check:!1,too_bright_threshold:.83,too_dark_threshold:.195},output_image_settings:{image_ordering:["far","close"]},auto_gen_frame_ids:{enable:!1,max_items:50}}}}}},ed=()=>{let i=el();return e.useMemo(()=>{let e=ei({},eg,i),n={enable:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.capture_frame_settings.enable"),framesIntervalTime:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.capture_frame_settings.frames_interval_time"),framesBatchLength:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.capture_frame_settings.frames_batch_length"),frameScale:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.capture_frame_settings.frame_scale"),frameQuality:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.capture_frame_settings.frame_quality"),autoCaptureMinFrames:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.capture_frame_settings.auto_capture_min_frames"),autoCaptureMinFramesFar:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.capture_frame_settings.auto_capture_min_frames_far"),autoCaptureMinFramesClose:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.capture_frame_settings.auto_capture_min_frames_close")},r={smallScale:t.getWebSetting(e,s.isMobile?"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.mobile.small_scale":"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.small_scale"),largeScale:t.getWebSetting(e,s.isMobile?"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.mobile.small_scale":"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.small_scale"),ovalPadding:{left:t.getWebSetting(e,s.isMobile?"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.mobile.oval_horizontal_padding":"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.oval_horizontal_padding"),right:t.getWebSetting(e,s.isMobile?"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.mobile.oval_horizontal_padding":"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.oval_horizontal_padding"),top:t.getWebSetting(e,s.isMobile?"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.mobile.oval_vertical_padding":"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.oval_vertical_padding"),bottom:t.getWebSetting(e,s.isMobile?"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.mobile.oval_vertical_padding":"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.oval_vertical_padding")},ovalVerticalOffset:t.getWebSetting(e,s.isMobile?"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.mobile.oval_vertical_offset":"data.settings.sdk_settings.passive_liveness_v2_settings.mask_settings.oval_vertical_offset"),chinToMaskBottomPadding:t.getWebSetting(e,s.isMobile?"data.settings.sdk_settings.passive_liveness_v2_settings.face_settings.mobile.chin_height":"data.settings.sdk_settings.passive_liveness_v2_settings.face_settings.chin_height")},l={minFarFaceRatio:t.getWebSetting(e,s.isMobile?"data.settings.sdk_settings.passive_liveness_v2_settings.face_settings.mobile.min_far_face_ratio":"data.settings.sdk_settings.passive_liveness_v2_settings.face_settings.min_far_face_ratio"),maxFarFaceRatio:t.getWebSetting(e,s.isMobile?"data.settings.sdk_settings.passive_liveness_v2_settings.face_settings.mobile.max_far_face_ratio":"data.settings.sdk_settings.passive_liveness_v2_settings.face_settings.max_far_face_ratio")},o={enable:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.close_eyes_settings.enable"),timeout:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.close_eyes_settings.timeout"),forceCheck:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.close_eyes_settings.force_check")},_={enable:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.exif_data_settings.enable")},g={imageQuality:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.image_settings.image_quality"),validFaceRatio:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.image_settings.valid_face_ratio"),enableCropCenterFar:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.image_settings.crop_center_far"),detectionToWholeFaceRatio:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.image_settings.detection_to_whole_face_ratio")},d=t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.timeout_settings.max_retry_count"),c={enable:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.timeout_settings.enable"),total:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.timeout_settings.total"),countdown:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.timeout_settings.countdown"),enableMaxRetryCount:d>0,maxRetryCount:d,interruptible:!t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.timeout_settings.non_stoppable")},m={enable:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.blur_far_settings.enable"),threshold:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.blur_far_settings.blurry_threshold"),duration:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.blur_far_settings.wait_for_best_image_time_ms")},f={enable:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.not_qualified_settings.enable_far"),threshold:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.not_qualified_settings.threshold_far")},u={enableTooBrightCheck:a(e,"data.settings.sdk_settings.passive_liveness_v2_settings.brightness_detection_far_settings.enable_too_bright_check"),enableTooDarkCheck:a(e,"data.settings.sdk_settings.passive_liveness_v2_settings.brightness_detection_far_settings.enable_too_dark_check"),tooBrightThreshold:a(e,"data.settings.sdk_settings.passive_liveness_v2_settings.brightness_detection_far_settings.too_bright_threshold"),tooDarkThreshold:a(e,"data.settings.sdk_settings.passive_liveness_v2_settings.brightness_detection_far_settings.too_dark_threshold")},v={imageOrdering:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.output_image_settings.image_ordering"),farImageOrder:e_,closeImageOrder:eo};Array.isArray(v.imageOrdering)&&2===v.imageOrdering.length&&"far"===v.imageOrdering[0]&&"close"===v.imageOrdering[1]&&(v.farImageOrder=0,v.closeImageOrder=1);let b={enable:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.auto_gen_frame_ids.enable")&&c.enable,maxItems:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.auto_gen_frame_ids.max_items")};return{captureFrameSettings:n,livenessSettings:{},flashSettings:{},maskSettings:r,faceSettings:l,closeEyesSettings:o,exifSettings:_,imageSettings:g,timeoutSettings:c,blurCheckFarSettings:m,blurCheckCloseSettings:{},notQualifiedFarSettings:f,notQualifiedCloseSettings:{},brightnessDetectionFarSettings:u,brightnessDetectionCloseSettings:{},outputImageSettings:v,autoGenFrameIds:b,frontalFaceCheckSettings:{enable:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.frontal_face_check.enable"),upDownBoundMin:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.frontal_face_check.up_down_bound_min"),upDownBoundMax:t.getWebSetting(e,"data.settings.sdk_settings.passive_liveness_v2_settings.frontal_face_check.up_down_bound_max")}}},[i])},ec=s.isMobile?{width:{ideal:640},whiteBalanceMode:"none"}:{width:{ideal:9999},whiteBalanceMode:"none"},em=(e,t)=>""===t.faceError&&(!!e.isEyeClosed&&!t.isEyeClosed||(!!e.isEyeClosed||!t.isEyeClosed)&&(!!u.hasBetterBrightnessScore(t.brightnessScore,e.brightnessScore)||!!u.hasSameBrightnessScore(t.brightnessScore,e.brightnessScore)&&v.hasBetterBlurScore(t.blurScore,e.blurScore)));function ef(t){let{onReset:s,onDone:a,frontCamera:u,styledComponent:v,onFramesCaptured:S,customComponent:C,extraConfig:F}=t,{onErrorCallback:x,onCloseCallback:w}=en(),E=ed(),W=C?.PassiveLivenessBody??b,O=C?.PassiveLivenessError??h,Z=C?.PassiveLivenessCloseIcon??p,{maskSettings:ee,faceSettings:et,captureFrameSettings:es,exifSettings:ea,imageSettings:ei,timeoutSettings:el,blurCheckFarSettings:eo,outputImageSettings:e_,autoGenFrameIds:eg}=E,ef=e.useRef(),eu=D(),ev=er(),[eb,eh]=e.useState(""),ep=e.useMemo(()=>M(eh,1e3),[]),[ek,ey]=e.useState(!1),[eS,eC]=e.useState(B.LOADING),eF=i(),ex={width:n("FlashLiveness.mask.width")({theme:eF}),height:n("FlashLiveness.mask.height")({theme:eF}),strokeColor:(eS===B.FAR_FACE||eS===B.CLOSE_FACE)&&eb&&!ek?n("FlashLiveness.mask.strokeColorError")({theme:eF}):n("FlashLiveness.mask.strokeColor")({theme:eF}),strokeWidth:2*n("FlashLiveness.mask.strokeWidth")({theme:eF}),path:n("FlashLiveness.mask.path")({theme:eF}),backgroundColor:n("FlashLiveness.maskFill")({theme:eF})},ew=e.useRef(null),[eE,eW,eR]=I(),[eM,eL]=e.useState(0),[eO,eD]=e.useState(!1),eB=e.useRef({frames:[],images:[]}),eI=e.useRef(!1),eP=P(),eT=T({compareFn:em,duration:eo.duration,minFrames:es.autoCaptureMinFrames}),[ej,eA]=e.useState(!1),{sessionId:eV,updateSessionId:eq}=j(),eU=e.useRef(r.createSingleUUID()),{onVideoPlayed:ez,cropArea:eQ,isPlaying:eN}=A({}),{smallScale:eG,largeScale:eJ}=V(ee,{width:ex.width,height:ex.height},{width:eQ.width,height:eQ.height}),eH=1e3*el.total/es.framesIntervalTime,{uuids:eK,getNextUUID:e$,reset:eX}=l({total:Math.min(eg.maxItems,Math.ceil(eH/es.framesBatchLength*1.2))}),eY=e.useCallback(e=>{let t=e[e.length-1];try{let e=JSON.parse(t.metadata);eg.enable&&(e.global_batch_id=e$()),e.global_session_id=eU.current,t.metadata=JSON.stringify(e)}catch(e){console.error("Unable to process last frame metadata",e)}},[eg.enable,e$]),eZ=e.useRef(null),{playVoice:e2}=o.useVoicePlayer(),e0=e.useMemo(()=>R(()=>{if(eI.current=!1,eB.current.frames=[],eB.current.images=[],eZ.current=null,eL(eG),eC(B.FAR_FACE),e2("move_face_into_frame"),eq(),eT.stopCapturing(),ey(!1),eg.enable){let e=eX();_.addExifData("frame_batch_ids",e)}s()},200,{leading:!0}),[eG,e2,eq,eT,eg.enable,s,eX]),e1=q({offset:ee.ovalVerticalOffset,ovalPadding:ee.ovalPadding,largeScale:eJ,maskHeight:eQ.height,ovalHeight:ex.height}),e8=e.useCallback(async()=>{eC(B.STOP_DECTECTING),eu("selfie_passive_v2","user_activity",()=>({passive_liveness_in_ms:performance.now()-ef.current}));let{frames:e}=eB.current;if(es.enable&&es.framesBatchLength>0){let t=e.length%es.framesBatchLength;if(0!==t){let s=e.slice(-1*t);eY(s),"function"==typeof S&&S(s)}}eB.current.images[e_.farImageOrder].blob=await eB.current.images[e_.farImageOrder].blob,_.addExifData("selfie_type","passive_v2"),_.addExifData("passive_liveness_v2",{number_of_frames:{far_frames:e.length},passive_liveness_in_ms:Math.round(performance.now()-ef.current),face_settings:{max_far_face_ratio:et.maxFarFaceRatio,min_far_face_ratio:et.minFarFaceRatio},mask_settings:{oval_vertical_offset:ee.ovalVerticalOffset,small_scale:ee.smallScale},image_settings:{valid_face_ratio:ei.validFaceRatio}});let t=await _.writeCurrentExif({imageData:eB.current.images[e_.farImageOrder],enableExifData:ea.enable});eB.current.images[e_.farImageOrder].blob=t,eP.enable&&(eB.current.images[e_.farImageOrder].encrypted=await g.encrypt({blob:eB.current.images[e_.farImageOrder].blob,key:eP.key})),eB.current.images=eB.current.images.filter(e=>!!e);try{"function"==typeof a&&await a({images:eB.current.images,frames:eB.current.frames})}catch(e){x({error:e})}},[eu,es.enable,es.framesBatchLength,e_.farImageOrder,et.maxFarFaceRatio,et.minFarFaceRatio,ee.ovalVerticalOffset,ee.smallScale,ei.validFaceRatio,ea.enable,eP.enable,eP.key,eY,S,a,x]),e3=e.useCallback(({prediction:e,canvas:t})=>{if(!es.enable)return;let{frames:s}=eB.current,a=U({prediction:e,canvas:t,index:s.length,quality:es.frameQuality});if(a.metadata=JSON.stringify({type:z.FAR_FACE,time:Math.round(performance.now()),session_id:eV}),s.push(a),es.framesBatchLength<=0||s.length%es.framesBatchLength!=0)return;let i=s.slice(-1*es.framesBatchLength);eY(i),"function"==typeof S&&S(i)},[es.enable,es.frameQuality,es.framesBatchLength,S,eY,eV]),e9=e.useCallback(async()=>{let{frames:e}=eB.current;0===e.length&&(eI.current=!0)},[]),e5=e.useMemo(()=>({x:Math.max(eW?.left,0),y:Math.max(eW?.top,0),width:Math.min(eW?.right-eW?.left,eQ.width),height:Math.min(eW?.bottom-eW?.top,eQ.height)}),[eQ.height,eQ.width,eW?.bottom,eW?.left,eW?.right,eW?.top]),e6=e.useCallback(async({frame:e,prediction:t,canvas:s,originalRatio:a})=>{if("no_face"===e.faceError||eB.current.images[e_.farImageOrder])return;if(es.enable){let e=performance.now();if(null!==eZ.current&&e-eZ.current<es.framesIntervalTime)return;eZ.current=e}let i=e=>{let t=X({maskBoundingBox:e5,faceRatio:e.faceRatio,validFaceRatio:ei.validFaceRatio,video:ew.current,shouldCropCenterSquare:ei.enableCropCenterFar,cropArea:eQ,frame:e.snapshot,facePrediction:e.facePrediction,detectionToWholeFaceRatio:ei.detectionToWholeFaceRatio}),s={blob:k.takePicture({canvas:t,quality:ei.imageQuality}),gesture:"frontal",captureTime:e.captureTime,selfieLabel:z.FAR_FACE,qualifyScore:e.qualifyScore,blurScore:e.blurScore,brightnessScore:e.brightnessScore};_.addExifData("model_score.face_blurry_score",s.blurScore),_.addExifData("model_score.face_brightness_score",s.brightnessScore),_.addExifData("model_score.face_qualify_score",s.qualifyScore),_.addExifData("selfie_label",s.selfieLabel),_.addExifData("capture_time",s.captureTime),_.addExifData("type",s.gesture),eB.current.images[e_.farImageOrder]=s},n={qualifyScore:e.qualifyScore,blurScore:e.blurScore,isEyeClosed:e.isEyeClosed,faceRatio:e.faceRatio,snapshot:Q(ew.current),captureTime:Date.now(),facePrediction:N(t,a),brightnessScore:e.brightnessScore,faceError:e.faceError};if(!eo.enable){e3({prediction:t,canvas:s}),i(n),await e8();return}if(!eT.isAutoCapturing()){await e2("please_hold_still"),ey(!0),e3({prediction:t,canvas:s}),eT.startCapturing({onDone:async e=>{i(e),await e8()},initialFrame:n});return}e3({prediction:t,canvas:s}),eT.captureFrame(n)},[e_.farImageOrder,es.enable,es.framesIntervalTime,eo.enable,eT,e3,e5,ei.validFaceRatio,ei.enableCropCenterFar,ei.detectionToWholeFaceRatio,ei.imageQuality,eQ,e8,e2]),{warmupDone:e4}=G({onError:x,isVideoPlaying:eN,step:eS,cropArea:eQ,videoRef:ew,onFarFaceDetected:e9,onFarFullFaceDetected:e6,onFaceError:e.useCallback(({error:e})=>{ep(e),("no_face"===e||"multiple_faces"===e)&&"no_face"===e&&eI.current&&e0()},[e0,ep]),faceSettings:et,maskBoundingRect:eW,shouldPauseFaceDetection:eR||ej,faceDetectionSettings:E,shouldContinueOnError:ek,debug:ev});J(ew.current);H(()=>{!async function(){let{resourceReport:e,measureReport:t}=await y.reportAll();Object.values(e).forEach(e=>{eu("selfie_passive_v2","sdk.download_model",e)}),Object.values(t).forEach(e=>{eu("selfie_passive_v2","sdk.init_model",e)})}()},e4),H(()=>{eC(B.FAR_FACE),eL(eG),e2("move_face_into_frame"),eD(!0),eg.enable&&_.addExifData("frame_batch_ids",eK),_.addExifData("global_session_id",eU.current),ef.current||(ef.current=performance.now())},e4&&eN),H(()=>eu("selfie_passive_v2","user_activity.start"),!0),H(()=>eu("selfie_passive_v2","user_activity.start_far"),eS===B.FAR_FACE);let{Loading:e7}=v,te=e.useCallback(()=>{ey(!1),eT.stopCapturing(),eA(!0)},[eT]),tt=e.useCallback(()=>{eA(!1),e0()},[e0]),{remaining:ts}=K({shouldStart:eO&&el.enable,onTimeout:te,onDelayEnd:tt,onError:x,totalTime:el.total,totalDelay:3,maxRetriesSettings:{enable:el.enableMaxRetryCount,total:el.maxRetryCount},interruptible:el.interruptible}),ta=Y(eb),ti=eQ.y+eQ.height/2+e1,tn=eo.duration,tr=Math.max(tn,es.autoCaptureMinFrames*es.framesIntervalTime);return d.jsxs(d.Fragment,{children:[d.jsx(c,{frontCamera:u,onVideoPlayed:ez,onClose:w,flipHorizontal:u,ref:ew,onError:x,videoSettings:ec,closeButton:d.jsx(Z,{}),children:d.jsxs($,{overlay:!e4||!eN,loadingComponent:e7,children:[!ek&&""!==eb&&d.jsx(m,{}),d.jsx(L,{x:`${Math.round(eQ.x)}px`,y:`${Math.round(eQ.y)}px`,width:`${eQ.width}px`,height:`${eQ.height}px`,surroundStyle:{background:n("FlashLiveness.maskFill")({theme:eF})},children:d.jsx(f,{ref:eE,scale:eM,debug:ev,width:eQ.width,height:eQ.height,padding:ee.ovalPadding,verticalOffset:e1,mask:ex})}),!ek&&""!==ta&&d.jsx(O,{errorY:ti,errorMessage:ta})]})}),d.jsx(W,{step:eS,errorCode:eb,timeoutProps:{remaining:ts,warningThreshold:el.countdown,total:el.total,shouldStart:eO&&el.enable},isAutoCapturing:ek,autoCaptureDuration:tr,extraConfig:F})]})}let eu=t=>{let{apiCheck:s,onLivenessDetectionDone:a,frontalMinSize:i,serviceSettings:n,apiCredentials:r,...l}=t,o=l.customComponent?.FlashLivenessLoading??x,[_,g]=e.useState(!1),c=P(),m=el(),f=C.getEnabledServices(n,m),{verifyLiveness:u}=function({outputEncryptionSettings:t,selfieType:s,enabledServices:a,apiCredentials:i}){let{apiClient:n}=S.useApiClient({apiCredentials:i});return{verifyLiveness:e.useCallback(async({videos:e,images:i,metadata:r})=>{try{let l=await Promise.all(i.map(e=>{if(!t.enable)return n.uploadImage({label:"portrait",file:e.blob,metadata:JSON.stringify({label:e.selfieLabel})});let s=new Blob([e.encrypted.hex]);return n.uploadImage({file:s,label:"portrait",metadata:JSON.stringify({label:e.selfieLabel})},{"X-TV-Key":t.key})})),o=null;a.enableVerifyFaceLiveness&&(o=n.verifyFaceLiveness({images:l.map(e=>({id:e?.data?.image_id,label:"portrait"})),videos:e,metadata:r,selfie_type:s}));let _=null;a.enableVerifySanityPortrait&&(_=n.requestVerifyPortrait({image:{id:l[l.length-1]?.data?.image_id},selfie_type:s}));let[g,d]=await Promise.all([o,_]);return{uploadedImages:l,faceLivenessResult:g,portraitResult:d}}catch(e){return console.error(e),{}}},[n,a.enableVerifyFaceLiveness,a.enableVerifySanityPortrait,t.enable,t.key,s])}}({apiCredentials:r,outputEncryptionSettings:c,selfieType:F.Mode.PASSIVE_V2,enabledServices:f}),{captureFrameSettings:v}=ed(),{framesIntervalTime:b}=v,{onFramesCaptured:h,onReset:p}=t,{onErrorCallback:k}=en(),y=Z(),W=async e=>{let t=e;if(c.enable&&(t=await w.encryptFrames(t,c.key)),"function"==typeof h&&h(t),s&&f.enableUploadFrames){let e={};c.enable&&(e["X-TV-Key"]=c.key),ee.uploadFrameBatch(et(t),y,e)}},R=async e=>{let t={frame_interval:b},n=e.images.filter(e=>"frontal"===e.gesture),r=n.map(e=>e.blob),l=n.map(e=>e.encrypted),o=r[r.length-1],_=o&&"number"==typeof i?await E.scaleImage(o,{minsize:i}):null,d=e.frames;if(c.enable&&(d=await w.encryptFrames(d,c.key)),!s||!f.enableUploadImages)return void await a({capturedFrames:d,frontalFaces:r,frontalFacesEncrypted:l,frontalScaledImage:_,steps:[],metadata:t});try{g(!0);let s=null;s=v.enable?await ee.getAllUploadedBatches():[{frames:et(d)}];let{uploadedImages:i,faceLivenessResult:n,portraitResult:o}=await u({videos:s,images:e.images,metadata:t});if(ee.resetUploadBatches(),g(!1),n?.errors)throw n.errors;if(o?.errors)throw o.errors;await a({capturedFrames:d,steps:[],frontalFaces:r.map((e,t)=>({blob:e,id:i?.[t]?.data?.image_id})),frontalFacesEncrypted:l,frontalScaledImage:_,apiCheckPassed:n?.data.is_live??!1,verifyFaceLivenessResult:n?.data??null,verifyPortraitResult:o?.data??null,uploadFramesResult:s})}catch(e){console.error(e),g(!1),k({error:e})}};return d.jsxs(d.Fragment,{children:[d.jsx(ef,{...l,apiCheck:s,onDone:R,onFramesCaptured:W,onReset:()=>{ee.resetUploadBatches(),"function"==typeof p&&p()}}),s&&d.jsx(o,{loading:_})]})},ev=e=>{let{apiCredentials:t,outputEncryptionSettings:s}=e;return d.jsx(O,{version:"v2",unmountOnHidden:!0,children:d.jsx(es,{apiCredentials:t,children:d.jsx(ea,{settings:s,children:d.jsx(eu,{...e})})})})};ev.propTypes={apiCheck:W.bool,apiCredentials:W.shape({accessKey:W.string,secretKey:W.string,apiUrl:W.string}),onReset:W.func,onLivenessDetectionDone:W.func,onClose:W.func,onError:W.func,onFramesCaptured:W.func,frontCamera:W.bool,styledComponent:W.shape({CloseCameraButton:W.node}),outputEncryptionSettings:W.shape({key:W.string}),frontalMinSize:W.number,serviceSettings:W.shape({enableGetClientSettings:W.bool,enableUploadFrames:W.bool,enableUploadImages:W.bool,enableVerifySanityPortrait:W.bool,enableVerifyFaceLiveness:W.bool}),mode:W.string,flowId:W.string,customTexts:W.shape({}),customComponents:W.shape({PassiveLivenessBody:W.elementType}),extraConfig:W.shape({})},ev.defaultProps={apiCheck:!1,apiCredentials:{},onReset:()=>{},onLivenessDetectionDone:()=>{},onClose:()=>{},onError:()=>{},onFramesCaptured:()=>{},frontCamera:!0,styledComponent:{CloseCameraButton:null},outputEncryptionSettings:{key:""},frontalMinSize:null,serviceSettings:{enableGetClientSettings:!0,enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:!0,enableVerifyFaceLiveness:!0},flowId:"",customTexts:{},customComponents:{PassiveLivenessBody:null},extraConfig:null};export{ev as default};
|