import{f as A,e as e,P as t,j as r,B as o,d as i,g as n,n as a,r as s,u as l,c as d,h as c,b as p,i as u,l as g,o as f,S as h,C as x,s as C}from"./chunk-5b723e6e.js";import{I as w,i as b,R as m,c as V,C as S,S as y}from"./chunk-d034b417.js";import{T as v,R as I,u as k,a as D,b as q,S as H,U as j,c as M,d as F,Q as B,e as R,f as P,g as E}from"./chunk-fae379a6.js";import{u as z,m as T}from"./chunk-4f4afcb4.js";import{P as O,W as X,C as Q}from"./chunk-39846631.js";import"./chunk-f4e27fd3.js";import{A as U}from"./chunk-56643838.js";import"./chunk-ba537d74.js";import"./chunk-748531e9.js";import"./chunk-60817d1f.js";import"./chunk-d2b7acc0.js";import"./chunk-8412c433.js";import"./chunk-1676c7f9.js";import"./chunk-36520099.js";import"./chunk-a566fd67.js";import"./chunk-f365de99.js";import"./chunk-a41972f4.js";import"./chunk-222f8468.js";let K=A`
  .popup-content {
    margin: auto;
    width: 100%;
    max-width: 568px;
    background-color: ${e("popup.backgroundColor")};
    padding: ${e("popup.padding")};
    border: ${e("popup.border")};
    border-radius: ${e("popup.borderRadius")};
  }

  [role=tooltip].popup-content {
    width: 200px;
    box-shadow: 0 0 3px rgba(0, 0, 0, .16);
    background-color: ${e("popup.backgroundColor")};
    padding: ${e("popup.padding")};
    border: ${e("popup.border")};
    border-radius: ${e("popup.borderRadius")};
  }

  .popup-overlay {
    background: ${e("popup.overlay.backgroundColor")};
  }

  [data-popup=tooltip].popup-overlay {
    background: transparent
  }

  .popup-arrow {
    -webkit-filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));
    filter: drop-shadow(0 -3px 3px rgba(0, 0, 0, .16));
    color: #fff;
    stroke-width: 2px;
    stroke: #d7d7d7;
    stroke-dasharray: 30px;
    stroke-dashoffset: -54px;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0
  }
`,N=o+1e3,_=({open:A,children:e,overlayStyle:t,...o})=>r.jsx(r.Fragment,{children:A&&r.jsxs(r.Fragment,{children:[r.jsx(O,{overlayStyle:{...t,zIndex:N},closeOnDocumentClick:!1,closeOnEscape:!1,modal:!0,open:A,...o,children:e}),r.jsx(K,{})]})});_.propTypes={open:t.bool,children:t.node,overlayStyle:t.shape({})},_.defaultProps={open:!1,children:null,overlayStyle:{}};let{flipY:W,spin:L,splash:G}=U,$=i.img`
  position: absolute;
  top: 0;
  left: 0;
`,{animationDuration:Z}=W,Y=G.default,J=i.div`
  ${W.default}
  ${L.default}
`,AA=i.div`
  cursor: pointer;
  text-align: center;
  width: ${({theme:A})=>n(A,"IDCapturing.captureIcon.width")};
  height: ${({theme:A})=>n(A,"IDCapturing.captureIcon.height")};

  img {
    width: 100%;
  }

  z-index: ${o+20};
  position: fixed;
  bottom: ${50}px;
`,Ae=i.div`
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  position: absolute;
  margin: auto;
  width: ${({theme:A})=>n(A,"IDCapturing.loadingIcon.width")};
  height: ${({theme:A})=>n(A,"IDCapturing.loadingIcon.height")};

  img {
    width: 100%;
  }

  z-index: ${o+20};
`,At=i.div`
  color: #fff;
  text-align: center;
`,Ar=i.div`
  transform: translateZ(1000px); // to fix rotating bug on safari
  transform-style: preserve-3d;
  position: absolute;
  top: ${A=>A.y};
  z-index: ${o+20};
`,Ao=i.div`
  display: flex;
  flex-direction: column;
  align-items: center;
`;i(At)`
  margin-left: 10px;
  color: ${({theme:A})=>n(A,"IDCapturing.title.color")};
  font-size: ${({theme:A})=>n(A,"IDCapturing.title.fontSize")};
  font-weight: ${({theme:A})=>n(A,"IDCapturing.title.fontWeight")};
  background-color: ${({theme:A})=>n(A,"IDCapturing.title.backgroundColor")};
`;let Ai=i(At)`
  margin-top: 4px;
  font-weight: 500;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
`,An=i(At)`
  font-size: 20px;
  margin-left: 10px;
  color: green;
  position: absolute;
  left: 0;
  top: 10px;
  background: white;
  z-index: ${o+30};
`,Aa=i(At)`
  position: absolute;
  text-align: center;
  top: ${A=>A.y};
  z-index: ${o+20};
  color: ${({theme:A})=>n(A,"IDCapturing.instruction.color")};
  font-size: ${({theme:A})=>n(A,"IDCapturing.instruction.fontSize")};
  font-weight: ${({theme:A})=>n(A,"IDCapturing.instruction.fontWeight")};
  background-color: ${({theme:A})=>n(A,"IDCapturing.instruction.backgroundColor")};
  border: ${({theme:A})=>n(A,"IDCapturing.instruction.border")};
  border-radius: ${({theme:A})=>n(A,"IDCapturing.instruction.borderRadius")};
`;i(Aa)`
  padding: ${({theme:A})=>n(A,"IDCapturing.error.padding")};
  color: ${({theme:A})=>n(A,"IDCapturing.error.color")};
  font-size: ${({theme:A})=>n(A,"IDCapturing.error.fontSize")};
  font-weight: ${({theme:A})=>n(A,"IDCapturing.error.fontWeight")};
  background-color: ${({theme:A})=>n(A,"IDCapturing.error.backgroundColor")};
  border: ${({theme:A})=>n(A,"IDCapturing.error.border")};
  border-radius: ${({theme:A})=>n(A,"IDCapturing.error.borderRadius")};
`,i(At)`
  position: absolute;
  text-align: center;
  padding: 5px 10px;
  margin: 0 10px;
  top: ${A=>A.y};
  z-index: ${o+20};
  color: ${({theme:A})=>n(A,"IDCapturing.countdown.color")};
  font-size: ${({theme:A})=>n(A,"IDCapturing.countdown.fontSize")};
  font-weight: ${({theme:A})=>n(A,"IDCapturing.countdown.fontWeight")};
  background-color: ${({theme:A})=>n(A,"IDCapturing.countdown.backgroundColor")};
  border: ${({theme:A})=>n(A,"IDCapturing.countdown.border")};
  border-radius: ${({theme:A})=>n(A,"IDCapturing.countdown.borderRadius")};
`,i.div`
  font-size: 18px;
  text-align: center;
  padding: 10px;
`;let As=i.div`
  position: fixed;
  top: ${A=>A.y};
  z-index: ${o+20};
  display: flex;
  align-items: center;
  gap: 16px;
  color: #d1d1d1;
  font-size: 16px;
`,Al=A=>{let e,t,{width:o,height:i,type:s,...l}=A,d=a(),c=(e=A,t=d,{width:e.width??n(t,"IDCapturing.rectangleMask.width"),height:e.height??n(t,"IDCapturing.rectangleMask.height"),strokeWidth:e.strokeWidth??n(t,"IDCapturing.rectangleMask.strokeWidth"),radius:e.radius??n(t,"IDCapturing.rectangleMask.radius"),paddingStyle:e.paddingStyle??n(t,"IDCapturing.rectangleMask.paddingStyle"),defaultRectStyles:e.default??n(t,"IDCapturing.rectangleMask.default"),errorRectStyles:e.error??n(t,"IDCapturing.rectangleMask.error")});return r.jsxs(J,{width:o,height:i,children:[r.jsx($,{src:(v.ERROR,"data:image/png;base64, "),width:o,height:i}),r.jsx(I,{type:s,...l,...c})]})},Ad="SESSION_TIMEOUT",Ac="CONFIRM",Ap="QR_INVALID",Au="QR_INSTRUCTIONS",{CountdownMessage:Ag,ErrorMessage:Af,InstructionContainer:Ah,InstructionText:Ax}=M,{AutoCapturingIcon:AC}=w,Aw=s.forwardRef((A,e)=>{let{usePortraitMask:t,windowAndVideoInfo:o,refVideo:i,frontSide:u,allowedCardTypes:g,settings:f,onCaptureDone:h,onUISpacingChange:x,outputEncryptionSettings:C,uploadFromDevice:w,uploadFlowAPI:b}=A,m=a(),[V,S]=s.useState({}),{yDescription:y,yMessage:I,yButtonRow:M,yInstruction:F,yToggleButton:B}=V,R=l("IDCapturing.captureIcon.src","ic_camera.svg"),P=l("IDCapturing.loadingIcon.src","ic_loading.png"),[E,z]=s.useState(""),{debug:T}=d.useSDKSettings(),[O,U]=s.useState(null),[K,N]=s.useState(""),[W,L]=s.useState(null),{showPopup:G,popupShown:$,popupType:Z}=k(),Y=c(),[J,At]=s.useState(!1),Ar=s.useCallback(A=>{null===A?N(""):N(Y(A.code,{side:u?Y("front"):Y("back")}))},[Y,u]),Ao=s.useCallback(()=>{U(""),G({popupType:Ad})},[G]),Ai=s.useCallback((...A)=>{U(""),h(...A)},[h]),{warmupDone:Aa,takePictureManually:Ac,restartSession:Ap,resetIsProcessingImageBlobTaken:Au,isPostProcessing:Aw,isAutoCapturing:Ab,isProcessing:Am,autoCaptureDuration:AV,isAutoCaptureModeOn:AS,onToggleAutoCaptureMode:Ay,pauseScan:Av,resumeScan:AI,setUploadInProgress:Ak}=D({shouldStart:!0,refVideo:i,cropArea:W,settings:f,onModelErrorChange:Ar,frontSide:u,allowedCardTypes:g,onDebugInfoChange:z,onSessionTimeout:Ao,onCaptureDone:Ai,onAboutToTimeout:s.useCallback(({curTimeLeft:A})=>{U(Y("remaining_time",{x:A}))},[Y]),outputEncryptionSettings:C}),AD=s.useMemo(()=>({pauseScan:Av,resumeScan:AI,setUploadInProgress:Ak,restartSession:Ap}),[Av,AI,Ak,Ap]),Aq=s.useCallback(()=>{G({popupType:null}),Au()},[G,Au]),AH=s.useCallback(async()=>{At(!1),Aq(),await Ap()},[Ap,Aq]),{showCaptureButtonInAuto:Aj=!0,showHoldStillProgress:AM=!1,showAutoCaptureToggle:AF}=f??{},AB=n(m,"IDCapturing.backgroundColor");s.useEffect(()=>{if(o){let A,e,r,i,n,a,s,l,d,{videoAreaWidth:c,videoAreaHeight:u,lostX:g,lostY:f,clientHeight:h}=o;t?(s=.7*(l=u-165),d=(A=f+10)+45,r=(n=AF?d+l+20:d+l-13)+28,a=d+l/2-60,i=(e=r+20)+60):(l=Math.floor(Math.min((s=p.isMobile?c-12:Math.floor(.7*c))/1.5,h-2*f-160-100)),d=(A=f+10+80*!!p.isMobile)+55,r=(n=AF?d+l+20:d+l-13)+28,a=d+l/2-60,i=(e=r+20)+60+40*!!p.isMobile),L({x:Math.floor((c-s)/2)+g,y:d,width:s,height:l,surroundStyle:{backgroundColor:AB}});let C={yTitle:A,yDescription:e,yMessage:r,yButtonRow:i,yInstruction:a,yToggleButton:n};S(C),x(C)}},[AF,o,t,x,AB]);let AR=s.useCallback(async()=>{U(""),await Ac()},[Ac]);return s.useImperativeHandle(e,()=>({restartSession:AH}),[AH]),r.jsxs(r.Fragment,{children:[!Aa&&r.jsx(X,{}),T&&r.jsx(An,{children:E}),AM&&!Ab&&Aw&&r.jsx(Ae,{children:r.jsx("img",{src:P,alt:"",className:"spin"})}),!AM&&(Ab||Aw)&&r.jsx(Ae,{children:r.jsx("img",{src:P,alt:"",className:"spin"})}),W&&r.jsx(Q,{x:`${W.x}px`,y:`${W.y}px`,width:`${W.width}px`,height:`${W.height}px`,surroundStyle:W.surroundStyle,children:r.jsx(Al,{width:W.width,height:W.height,type:K?v.ERROR:v.DEFAULT})}),K&&r.jsx(Af,{y:`${y}px`,children:K}),AM&&Ab&&r.jsxs(Ah,{y:`${F}px`,children:[r.jsx(AC,{duration:AV,onCircleAnimationEnd:()=>{At(!0)}}),r.jsx(Ax,{children:J?Y("id_capture.instruction.capturing_done"):Y("id_capture.instruction.hold_still")})]}),AF&&r.jsxs(As,{y:`${B}px`,children:[r.jsx("span",{children:Y("toggle_id_capture_mode")}),r.jsx(q,{checked:AS,disabled:Ab||Aw,onChange:Ay})]}),(!AS||Aj)&&!(Ab||Aw)&&!(f.disableCaptureButtonIfAlert&&K)&&r.jsx(AA,{onClick:AR,y:`${M}px`,children:r.jsx("img",{src:R,alt:""})}),O&&r.jsx(Ag,{className:"message",y:`${I}px`,children:O},O),r.jsx(_,{open:$,children:Z===Ad&&r.jsx(H,{onOk:AH,maxSessionTime:f?.idCardSessionTime})}),r.jsx(j,{uploadFromDevice:w,uploadFlowAPI:b,scanControl:AD,isCaptureInFlight:Am,shouldShowSpinner:Aw,bottomOffset:50})]})});Aw.propTypes={usePortraitMask:t.bool,windowAndVideoInfo:t.shape({}),refVideo:t.shape({}),frontSide:t.bool,allowedCardTypes:t.arrayOf(t.string),settings:t.shape({}),onCaptureDone:t.func,onUISpacingChange:t.func,outputEncryptionSettings:t.shape({}),uploadFromDevice:t.shape({enable:t.bool,enableConfirmPopup:t.bool}),uploadFlowAPI:t.shape({})},Aw.defaultProps={usePortraitMask:!1,windowAndVideoInfo:{},refVideo:{},frontSide:!0,allowedCardTypes:[],settings:{},onCaptureDone:()=>{},onUISpacingChange:()=>{},outputEncryptionSettings:null,uploadFromDevice:void 0,uploadFlowAPI:void 0};let{Message:Ab,Tooltip:Am,QRInvalidPopupContent:AV,QRInstructions:AS}=B;function Ay(A){let{windowAndVideoInfo:e,onUISpacingChange:t,refVideo:o,settings:i,onCaptureDone:n,outputEncryptionSettings:a}=A,[l,d]=s.useState(null),[g,f]=s.useState({}),{yTooltip:h,yMessage:x}=g,{sendEvent:C}=u.useSDKTracking(),{showPopup:w,popupShown:m,popupType:V}=k(),[S,y]=s.useState(!1),[v,I]=s.useState(null),D=s.useRef(()=>{}),q=c(),H=s.useRef();s.useEffect(()=>{C({tag:"id_qr",event:"user_activity.start",log:{}}),H.current=performance.now()},[C]),s.useEffect(()=>{w({popupType:Au})},[w]),s.useEffect(()=>{if(e){let{videoAreaWidth:A,lostX:r,lostY:o}=e,i=p.isMobile?Math.min(A-6,145):145,n=o+10,a=n+90,s=a+40,l=s+i+20,c=Math.floor((A-i)/2)+r;d({x:c,y:s,width:i,height:i,surroundStyle:{opacity:.6,background:"#000"}});let u={yTitle:n,yTooltip:l,yMessage:a};f(u),t(u)}},[e,t]);let j=s.useCallback(A=>{(C({tag:"id_qr",event:"sdk_ui.scan_time_out",log:{}}),I(""),i?.isQrStepOnly)?D.current():n(A)},[n,C,i?.isQrStepOnly]),M=s.useCallback(A=>{let{validateResult:{valid:e}}=A;I("");let t=performance.now();e?(C({tag:"id_qr",event:"sdk_ui.scan_success",log:{time_capture_in_seconds:(t-H.current)/1e3}}),n(A)):(w({popupType:Ap}),C({tag:"id_qr",event:"sdk_ui.invalid_qr_alert",log:{}}))},[w,n,C]),{isProcessing:B,restartSession:R,warmupDone:P}=F({shouldStart:S,refVideo:o,cropArea:l,settings:i,onSessionTimeout:j,onCaptureDone:M,onAboutToTimeout:s.useCallback(({curTimeLeft:A})=>{I(q("remaining_time",{x:A}))},[q]),outputEncryptionSettings:a,estimatedStartTime:Date.now()+1e4});D.current=R;let E=s.useCallback(()=>{w({popupType:null})},[w]),z=s.useCallback(async()=>{E(),H.current=performance.now(),C({tag:"id_qr",event:"user_activity.invalid_qr_retry",log:{}}),await R()},[R,E,C]),T=s.useCallback(()=>{E(),C({tag:"id_qr",event:"user_activity.invalid_qr_skip",log:{}}),n()},[E,n,C]),O=s.useCallback(()=>{E(),y(!0)},[E]);return r.jsxs(r.Fragment,{children:[!P&&r.jsx(X,{contentStyle:{maxWidth:"300px"}}),l&&r.jsx(Q,{x:`${l.x}px`,y:`${l.y}px`,width:`${l.width}px`,height:`${l.height}px`,surroundStyle:l.surroundStyle,children:r.jsxs(J,{width:l.width,height:l.height,children:[r.jsx($,{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKUAAAClCAYAAAA9Kz3aAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAQ4SURBVHgB7dzRcdNIGAfwb5V7SIYXqABTwcUdhEIApwLogKSDo4IYKIR04FwFZyogL3fhHpBuZcWWHSdHuNhm5+b3m1GyWq08nvF/Pq1WM0pxT81k9PhrxGFuDiLqQTxYMz0YfhwHRbqavBhFpEE8UBPNZYq9i/2IizQcX97nnPS9AVeT0VH+6Ld5O4qNa44FszzXgTyLjUvnuaC9/95v/stdB/ow1kexNXtBidrfpY7NawtbOrqavMy5qp4fDMfT20bdWin/ziflr3SyPjhdNLkM5w//HA9W5cv3eBwUKRel0WamaelpDtlhvowf3nLw5GD44XTtjJsdNwPZRMpzgubdflS/3XdOADflkA+aqN/k5qscusdLh9aCuRLK9QrZzgHS8V1lFn5UG85c6s5u3KOsBDOtDq7/mO/ncL5/NPwwCtiCPycvx1Wumn3PbI55Pmv1nfWnvp3OBZJt6vLVXonn2pvqziyU3RJAu/7YzSHbS3bA1qXjfON8fZ/SHHUrPotKWS3KaO4Ym0OyC23O8vzxXd/TVcv0JT+p2Y/6S3+geiaU7MrN/OVVnifVfvfocCZfui8Ekl16kpcZ02ztu9M+yq6a+LYI5d7SQdiVPK/8vd/7NqjyU5rFQma9kSc18MOmfTMNqoDCCCXFEUqKI5QURygpjlBSHKGkOEJJcYSS4gglxRFKiiOUFEcoKY5QUhyhpDhCSXGq9vUpS7vTgJ27JYPte2O6d8fAzyGDAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAPw/XU1ejNot4CdZzmDqGumsO9QcHww/jgN26GYGq7wz6A8vt2FX0mC5XQUURigpjlBSHKGkOEJJcYSS4gglxRFKiiOUFEcoKY5QUhyhpDhCSXGEkuIIJcURSoqTQ9lM+530NGD3BvNGE81lDuXedN7xLeIwYMdSxK99e++i+hpx0Xc0h81k9DhgR64mo0GzVAz3cx6rJ8PxZY7j+bzzr6jfBOxILoSvl/bOU87j9Y1OOp1370W8btMbsGVtzupoRn1Pet/+nYXyYDg+n1fLXErz5bs5C9i65izN8tZK05zDcdtaWhLqq2UefHQ1eSWYbE2Xr+ao70nPF63VgS9P8r+3SwPP83acEzwN2IBuatisBLKOOH00/HAy30/rJ60GMw9ob4TGTaR3wsl/1a7qfI36dZ4evukv2euBbKXbPmC9Ys4Hp4tmtoTUfI6Hf82pV8SU6/pVKoN4sPQ0h+wwL4qvrYHfFsjZGXHnl5qV2U95G8TWeHdRiVbf7bMNs2nhaXeDve6Xu067vlQ/y+Ec5fC8Wp2UbspeUKL2d6lj8/49jItRcU/dnKAtw3GYot7AU59qsQRAebpiVA/iwapp/jNtn9Sk2YOa7/sHAkRRmOg7J7kAAAAASUVORK5CYII=",width:l.width-8,height:l.height-8,alt:"",style:{top:4,left:4}}),r.jsxs("svg",{width:l.width,height:l.height,children:[r.jsx("rect",{x:1,y:1,rx:10,ry:10,width:l.width-2,height:l.height-2,style:{fill:"none"}}),r.jsx("path",{d:"M0,11.6 Q0,0 11.6,0 L0,0 Z",style:{fill:"rgba(0, 0, 0, 0.6)"}}),r.jsx("path",{d:`M0,${l.height-11.6} Q0,${l.height} 11.6,${l.height} L0,${l.height} Z`,style:{fill:"rgba(0, 0, 0, 0.6)"}}),r.jsx("path",{d:`M${l.width-11.6},${l.height} Q${l.width},${l.height} ${l.width},${l.height-11.6} L${l.width},${l.height} Z`,style:{fill:"rgba(0, 0, 0, 0.6)"}}),r.jsx("path",{d:`M${l.width-11.6},0 Q${l.width},0 ${l.width},11.6 L${l.width},0 Z`,style:{fill:"rgba(0, 0, 0, 0.6)"}})]})]})}),r.jsx(Am,{y:`${h}px`,children:q("qr_tooltip")}),v&&r.jsx(Ab,{className:"message",y:`${x}px`,children:v},v),B&&r.jsx(Ae,{children:r.jsx("img",{src:b,alt:"",className:"spin"})}),r.jsxs(_,{contentStyle:{maxWidth:"332px"},open:m,children:[V===Ap&&r.jsx(AV,{onRetry:z,onSkip:T}),V===Au&&r.jsx(AS,{onClickStart:O,onTimeout:O,timeout:10})]})]})}Ay.propTypes={windowAndVideoInfo:t.shape({}),onUISpacingChange:t.func,refVideo:t.shape({}),settings:t.shape({maxRetriesScanQrSettings:t.shape({enable:t.bool}),isQrStepOnly:t.bool}),onCaptureDone:t.func,outputEncryptionSettings:t.shape({})},Ay.defaultProps={windowAndVideoInfo:{},onUISpacingChange:()=>{},refVideo:{},settings:{},onCaptureDone:()=>{},outputEncryptionSettings:null};let Av="SUCCESS",AI="WARNING",Ak={[Av]:"✓",[AI]:"!"},AD=i.div`
  font-weight: normal;
  border: 1px solid rgba(233, 233, 233, 1);
  border-radius: 34px;
  padding: 12px;
`,Aq=i.div`
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: ${({type:A,theme:e})=>g`
    ${n(e,`QRStep.resultText.${A===Av?"success":"error"}.mainColor`)}
  `};
  display: flex;
  justify-content: center;
  align-items: center;
  color: #fff;
  margin-right: 8px;
  font-weight: bold;
`,AH=i.div`
  display: flex;
  justify-content: center;
  align-items: center;
  ${({type:A,theme:e})=>{let t=A===Av?"success":"error";return g`
      color: ${n(e,`QRStep.resultText.${t}.textColor`)};
      font-size: ${n(e,`QRStep.resultText.${t}.fontSize`)};
      font-weight: ${n(e,`QRStep.resultText.${t}.fontWeight`)};
    `}};
`,Aj=({children:A,type:e,className:t})=>r.jsx(AD,{className:t,children:r.jsxs(AH,{type:e,children:[r.jsx(Aq,{type:e,children:Ak[e]}),A]})});Aj.propTypes={children:t.node,type:t.string,className:t.string},Aj.defaultProps={children:null,type:Av,className:""};let{ConfirmButton:AM,RetryButton:AF}=V,AB=i.div`
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  padding: 10px;
`,AR=i.div`
  text-align: center;
  font-size: 1rem;
  color: #ea3223;
  margin-top: 10px;
`,AP=i.img`
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: ${({theme:A})=>n(A,"IDConfirmPopup.image.borderRadius")};
`,AE=i.div`
  margin: 20px 0;
  width: 100%;
  display: flex;
  justify-content: space-evenly;
  gap: 10px;
`,Az=({imageTaken:A,onConfirm:e,onTryAgain:t,error:o,hasValidQR:i,frontSide:n})=>{let[a,l]=s.useState(null),{lang:p}=d.useSDKSettings(),{sendEvent:g}=u.useSDKTracking(),f=c();return s.useEffect(()=>{g({tag:n?"id_front":"id_back",event:"user_activity.show_confirm",log:{}})},[n,g]),s.useEffect(()=>{let e;return A&&l(e=URL.createObjectURL(A.blob)),()=>{URL.revokeObjectURL(e)}},[A]),r.jsxs(AB,{children:[null!==i&&r.jsx(R,{mb:"20px",children:r.jsx("div",{children:r.jsx(Aj,{type:i?Av:AI,children:f(i?"CONFIRM_POPUP_VALID_QR":"CONFIRM_POPUP_INVALID_QR")})})}),r.jsx(m,{ratio:1.5,children:r.jsx(AP,{src:a})}),o&&r.jsx(AR,{className:"confirm-popup-error-message",children:o.msg[p]}),r.jsxs(AE,{children:[r.jsx(AF,{onClick:()=>{g({tag:n?"id_front":"id_back",event:"user_activity.retry",log:{}}),t()},children:f("BTN_TRY_AGAIN")}),r.jsx(AM,{onClick:()=>{g({tag:n?"id_front":"id_back",event:"user_activity.submit",log:{}}),e()},children:f("BTN_USE_THIS_PICTURE")})]})]})};Az.propTypes={imageTaken:t.shape({}),error:t.shape({msg:t.shape({})}),onConfirm:t.func,onTryAgain:t.func,hasValidQR:t.bool,frontSide:t.bool},Az.defaultProps={imageTaken:null,error:null,onConfirm:()=>{},onTryAgain:()=>{},hasValidQR:null,frontSide:!0};let AT={tsBlue:"#0276f1",tsSecondary:"rgba(0, 47, 117, 0.6)"},AO=A`
  .text-primary {
    color: ${A=>A.theme.tsBlue};
  }
`,{Title:AX}=M;function AQ(A){let{onClickMenu:e,settings:t,outputEncryptionSettings:o,defaultCameraId:i,globalStyle:n,styledComponent:a,frontCamera:p,scannerTypeCons:u,allowedCardTypes:g,uploadFromDevice:C,...w}=A,{numberOfCaptures:b,stepNumber:m,frontSide:V,scannerType:y,usePortraitMask:v,shouldShowSpinner:I,handleQRCaptureDone:k,handleIDCardCaptureDone:D,handleRestartSession:q,refIDCardReader:H,handleClickConfirm:j,popupType:M,popupShown:F,popupProps:B,uploadFlowAPI:R}=w,P=s.useRef(null),{onErrorCallback:E,onCloseCallback:T}=z(),[O,X]=s.useState(null),[Q,U]=s.useState(!1),{lang:K}=d.useSDKSettings(),N=l("IDCapturing.loadingIcon.src","ic_loading.png"),W=c(),L=W(V?"ID_TITLE_FRONT":"ID_TITLE_BACK"),G=W("ID_DESCRIPTION"),$=W("qr_title"),[AA,At]=s.useState({}),{yTitle:An}=AA,Aa=s.useCallback(A=>{X(A),U(!0)},[]);return s.useEffect(()=>{U(!1)},[p]),r.jsxs(f,{theme:AT,children:[r.jsxs(J,{children:[r.jsxs(S,{frontCamera:p,onVideoPlayed:Aa,onClose:T,onClickMenu:e,flipHorizontal:p,ref:P,onError:E,defaultCameraId:i,videoSettings:t?.imageSettings.videoSettings,children:[Q&&r.jsxs(r.Fragment,{children:[y===u.ID_CARD&&r.jsx(Aw,{ref:H,windowAndVideoInfo:O,refVideo:P,settings:t,onCaptureDone:D,onUISpacingChange:At,frontSide:V,allowedCardTypes:g,description:G,usePortraitMask:v,outputEncryptionSettings:o,uploadFromDevice:C,uploadFlowAPI:R},m),y===u.QR_CODE&&r.jsx(Ay,{refVideo:P,windowAndVideoInfo:O,settings:t,onCaptureDone:k,onUISpacingChange:At,outputEncryptionSettings:o},m)]}),r.jsx(Y,{keyForTransition:b}),r.jsx(Ar,{y:`${An}px`,children:r.jsx(h,{children:r.jsx(x,{timeout:{enter:Z,exit:Z},classNames:"flipY",unmountOnExit:!0,children:r.jsxs(Ao,{children:[y===u.ID_CARD&&r.jsxs(r.Fragment,{children:[r.jsx(AX,{className:"title",children:"string"==typeof L?L:L?.[K]}),r.jsx(Ai,{children:"string"==typeof G?G:G?.[K]})]}),y===u.QR_CODE&&r.jsx(AX,{className:"title",children:"string"==typeof $?$:$?.[K]})]})},L)})}),I&&r.jsx(Ae,{children:r.jsx("img",{src:N,alt:"",className:"spin"})})]},p),r.jsx(_,{open:F,children:M===Ac&&r.jsx(Az,{...B,onConfirm:j,onTryAgain:q,frontSide:V,title:L})})]}),r.jsx(n,{})]})}let AU={allowedCardTypes:t.arrayOf(t.string),settings:t.shape({imageSettings:t.shape({videoSettings:t.shape({})})}),onClose:t.func,onClickMenu:t.func,onError:t.func,outputEncryptionSettings:t.shape({}),defaultCameraId:t.string,globalStyle:t.shape({}),styledComponent:t.shape({CloseCameraButton:t.node}),frontCamera:t.bool,scannerTypeCons:t.shape({ID_CARD:t.string,QR_CODE:t.string}).isRequired};AQ.propTypes=AU,AQ.defaultProps={allowedCardTypes:[],settings:null,onClose:()=>{},onClickMenu:()=>{},onError:()=>{},outputEncryptionSettings:null,defaultCameraId:void 0,globalStyle:AO,styledComponent:{CloseCameraButton:null},frontCamera:!1};let AK={closeButton:{top:"10px",right:"10px",left:"auto",bottom:"auto",display:"block",src:"data:image/svg+xml,%3csvg width='24' height='24' viewBox='0 0 24 24' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M17.9999 5.99994C17.8124 5.81247 17.5581 5.70715 17.2929 5.70715C17.0278 5.70715 16.7735 5.81247 16.5859 5.99994L11.9999 10.5859L7.41394 5.99994C7.22641 5.81247 6.9721 5.70715 6.70694 5.70715C6.44178 5.70715 6.18747 5.81247 5.99994 5.99994C5.81247 6.18747 5.70715 6.44178 5.70715 6.70694C5.70715 6.9721 5.81247 7.22641 5.99994 7.41394L10.5859 11.9999L5.99994 16.5859C5.81247 16.7735 5.70715 17.0278 5.70715 17.2929C5.70715 17.5581 5.81247 17.8124 5.99994 17.9999C6.18747 18.1874 6.44178 18.2927 6.70694 18.2927C6.9721 18.2927 7.22641 18.1874 7.41394 17.9999L11.9999 13.4139L16.5859 17.9999C16.7735 18.1874 17.0278 18.2927 17.2929 18.2927C17.5581 18.2927 17.8124 18.1874 17.9999 17.9999C18.1874 17.8124 18.2927 17.5581 18.2927 17.2929C18.2927 17.0278 18.1874 16.7735 17.9999 16.5859L13.4139 11.9999L17.9999 7.41394C18.1874 7.22641 18.2927 6.9721 18.2927 6.70694C18.2927 6.44178 18.1874 6.18747 17.9999 5.99994Z' fill='%23D1D1D1'/%3e%3c/svg%3e",width:"30px",height:"auto"},popup:{backgroundColor:"#fff",padding:"5px",border:"1px solid #d7d7d7",borderRadius:"10px",overlay:{backgroundColor:"rgba(0, 0, 0, 0.5)"}},IDCapturing:{backgroundColor:"rgba(0, 0, 0, 0.6)",title:{color:"#fff",fontSize:"20px",fontWeight:"700",backgroundColor:"unset"},instruction:{color:"#fff",fontSize:"14px",fontWeight:"500",backgroundColor:"unset",border:"unset",borderRadius:"unset"},error:{padding:"5px 10px",color:"rgba(229, 77, 46, 1)",fontSize:"14px",fontWeight:"500",backgroundColor:"transparent",border:"unset",borderRadius:"3px"},countdown:{color:"rgba(229, 77, 46, 1)",fontSize:"14px",fontWeight:"500",backgroundColor:"transparent",border:"unset",borderRadius:"3px"},cardIcon:{src:"",width:"auto",height:"38px"},captureIcon:{src:"data:image/svg+xml,%3csvg width='81' height='81' viewBox='0 0 81 81' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3ccircle cx='40.5' cy='40.5' r='38' stroke='white' stroke-width='5'/%3e%3ccircle cx='40.5' cy='40.5' r='32.5' fill='white'/%3e%3c/svg%3e",width:"80px",height:"80px"},loadingIcon:{src:b,width:"47px",height:"47px"},timeoutPopup:{padding:"10px",text:{color:"#000",fontSize:"1rem",fontWeight:"normal",textAlign:"center",border:"unset",borderRadius:"unset"},button:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:"rgba(2, 118, 241, 1)",border:"none",borderRadius:"0.25rem",outline:"none",height:"50px"}},rectangleMask:{width:600,height:400,strokeWidth:2,strokeStyles:{},radius:10,paddingStyle:{fill:"rgba(0, 0, 0, 0.6)"},default:{fill:"none",stroke:"#01AA4F",strokeWidth:2},error:{fill:"rgba(249, 0, 0, 0.2)",strokeWidth:2,stroke:"rgba(229, 77, 46, 1)"}}},IDConfirmPopup:{confirmButton:{color:"#fff",fontSize:"1rem",fontWeight:"400",backgroundColor:"rgba(2, 118, 241, 1)",border:"none",borderRadius:"100px",outline:"none"},retryButton:{color:"#000",fontSize:"1rem",fontWeight:"400",backgroundColor:"#fff",border:"1px solid rgba(29, 29, 29, 0.2)",borderRadius:"100px",outline:"none"},image:{borderRadius:"5px"}},QRStep:{guidelinePopup:{image:{src:"data:image/svg+xml,%3csvg width='255' height='229' viewBox='0 0 255 229' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cg filter='url(%23filter0_dd_22_788)'%3e%3crect x='68' y='40' width='119' height='119' rx='13' fill='white'/%3e%3crect x='69' y='41' width='117' height='117' rx='12' stroke='%230276F1' stroke-width='2'/%3e%3c/g%3e%3cg clip-path='url(%23clip0_22_788)'%3e%3cpath d='M84 57V85.5547H112.555V57H84ZM105.836 78.8359H90.7188V63.7188H105.836V78.8359Z' fill='%2337366F'/%3e%3cpath d='M101.637 67.918H94.918V74.6367H101.637V67.918Z' fill='%2337366F'/%3e%3cpath d='M141.445 57V85.5547H170V57H141.445ZM163.281 78.8359H148.164V63.7188H163.281V78.8359Z' fill='%2337366F'/%3e%3cpath d='M159.082 67.918H152.363V74.6367H159.082V67.918Z' fill='%2337366F'/%3e%3cpath d='M84 114.445V143H112.555V114.445H84ZM105.836 136.281H90.7188V121.164H105.836V136.281Z' fill='%2337366F'/%3e%3cpath d='M101.637 125.363H94.918V132.082H101.637V125.363Z' fill='%2337366F'/%3e%3cpath d='M97.4375 90.0898H90.7188V96.8086H97.4375V90.0898Z' fill='%2337366F'/%3e%3cpath d='M104.156 103.527V96.8086H97.4375V103.527H103.988V110.246H110.707V103.527H104.156Z' fill='%2337366F'/%3e%3cpath d='M137.75 69.9336H131.031V76.6523H137.75V69.9336Z' fill='%2337366F'/%3e%3cpath d='M124.312 63.7188H117.594V76.6523H124.312V63.7188Z' fill='%2337366F'/%3e%3cpath d='M131.031 57H124.312V63.7188H131.031V57Z' fill='%2337366F'/%3e%3cpath d='M124.312 76.6523V83.3711H117.594V90.0898H131.031V76.6523H124.312Z' fill='%2337366F'/%3e%3cpath d='M131.031 116.629V110.078H124.312V96.8086H117.594V110.246H124.312V116.797H131.031V123.348H144.469V116.629H131.031Z' fill='%2337366F'/%3e%3cpath d='M137.75 90.0898H131.031V103.527H137.75V90.0898Z' fill='%2337366F'/%3e%3cpath d='M163.281 96.6406V90.0898H151.02V96.8086H144.469V103.527H151.188V110.078H170V96.6406H163.281ZM163.281 103.359H151.188V96.8086H163.281V103.359Z' fill='%2337366F'/%3e%3cpath d='M170 116.629H163.281V130.066H170V116.629Z' fill='%2337366F'/%3e%3cpath d='M144.469 103.527H137.75V110.246H144.469V103.527Z' fill='%2337366F'/%3e%3cpath d='M151.188 123.348H144.469V130.066H151.188V123.348Z' fill='%2337366F'/%3e%3cpath d='M157.906 116.629H151.188V123.348H157.906V116.629Z' fill='%2337366F'/%3e%3cpath d='M151.188 130.066V143H157.906V136.785H163.281V130.066H151.188Z' fill='%2337366F'/%3e%3cpath d='M124.312 116.797H117.594V129.562H124.312V116.797Z' fill='%2337366F'/%3e%3cpath d='M137.75 136.281V129.562H124.312V143H131.031V136.281H137.582V143H144.301V136.281H137.75Z' fill='%2337366F'/%3e%3cpath d='M117.594 90.0898H104.156V96.8086H117.594V90.0898Z' fill='%2337366F'/%3e%3cpath d='M90.7188 96.8086H84V110.246H90.7188V96.8086Z' fill='%2337366F'/%3e%3c/g%3e%3crect x='58' y='98' width='141' height='80' fill='url(%23paint0_linear_22_788)'/%3e%3cline x1='59.5' y1='98.5' x2='197.5' y2='98.5' stroke='%230276F1' stroke-width='7' stroke-linecap='round'/%3e%3cdefs%3e%3cfilter id='filter0_dd_22_788' x='0' y='-26' width='255' height='255' filterUnits='userSpaceOnUse' color-interpolation-filters='sRGB'%3e%3cfeFlood flood-opacity='0' result='BackgroundImageFix'/%3e%3cfeColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/%3e%3cfeMorphology radius='28' operator='erode' in='SourceAlpha' result='effect1_dropShadow_22_788'/%3e%3cfeOffset dy='32'/%3e%3cfeGaussianBlur stdDeviation='24'/%3e%3cfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.16 0'/%3e%3cfeBlend mode='normal' in2='BackgroundImageFix' result='effect1_dropShadow_22_788'/%3e%3cfeColorMatrix in='SourceAlpha' type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0' result='hardAlpha'/%3e%3cfeMorphology radius='4' operator='erode' in='SourceAlpha' result='effect2_dropShadow_22_788'/%3e%3cfeOffset dy='2'/%3e%3cfeGaussianBlur stdDeviation='36'/%3e%3cfeComposite in2='hardAlpha' operator='out'/%3e%3cfeColorMatrix type='matrix' values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.08 0'/%3e%3cfeBlend mode='normal' in2='effect1_dropShadow_22_788' result='effect2_dropShadow_22_788'/%3e%3cfeBlend mode='normal' in='SourceGraphic' in2='effect2_dropShadow_22_788' result='shape'/%3e%3c/filter%3e%3clinearGradient id='paint0_linear_22_788' x1='128' y1='68.4' x2='128' y2='178' gradientUnits='userSpaceOnUse'%3e%3cstop stop-color='%23B3CFEC'/%3e%3cstop offset='1' stop-color='%23B3CFEC' stop-opacity='0'/%3e%3c/linearGradient%3e%3cclipPath id='clip0_22_788'%3e%3crect width='86' height='86' fill='white' transform='translate(84 57)'/%3e%3c/clipPath%3e%3c/defs%3e%3c/svg%3e",borderRadius:"5px",backgroundColor:"transparent"},guideText:{color:"rgba(94, 94, 94, 1)",fontSize:"16px",fontWeight:"400",textAlign:"center",lineHeight:"20px"},countdownText:{color:"rgba(153, 153, 153, 1)",fontSize:"16px",fontWeight:"700",textAlign:"center",lineHeight:"20px"},startButton:{color:"#fff",fontSize:"16px",fontWeight:"700",backgroundColor:"rgba(2, 118, 241, 1)",border:"none",borderRadius:"100px",outline:"none",height:"56px"}},scanTooltip:{backgroundColor:"transparent",borderRadius:"8px",color:"#fff",padding:"10px",textAlign:"center"},scanCountdown:{textAlign:"center",color:"#E54D2E",fontSize:"14px",fontWeight:"normal",backgroundColor:"transparent",border:"none",borderRadius:"3px",padding:"5px 10px"},invalidPopup:{padding:"10px",title:{display:"none",color:"rgba(94, 94, 94, 1)",fontSize:"16px",fontWeight:"bold",margin:"25px 0 0 0",padding:"0 0 0 0"},description:{color:"rgba(94, 94, 94, 1)",fontSize:"16px",fontWeight:"normal",textAlign:"center",margin:"30px 0 0 0",padding:"0 0 0 0"},retryButton:{color:"#fff",fontSize:"16px",fontWeight:"700",backgroundColor:"rgba(2, 118, 241, 1)",border:"none",borderRadius:"100px",outline:"none",height:"56px",margin:"30px 0 0 0"},skipButton:{color:"rgba(29, 29, 29, 1)",fontSize:"16px",fontWeight:"normal",backgroundColor:"unset",border:"1px solid rgba(29, 29, 29, 0.2)",borderRadius:"100px",outline:"none",height:"56px",margin:"12px 0"}},resultText:{success:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#34ce60"},error:{textColor:"#000",fontSize:"1rem",fontWeight:"normal",mainColor:"#ff9532"}}}};var AN=T({},y,{v1:{...AK},v2:{...AK}});let A_=[{scannerType:P.ID_CARD,title:"Mặt trước của CCCD",description:"Đặt CCCD của bạn v\xe0o khung h\xecnh",titleIcon:"id_card_front.svg",cardSide:C.IDCardSide.FRONT,cardType:C.IDCardType.VN,frontCamera:!1,enableConfirmPopup:!0,title_vi:"Mặt trước",title_en:"Front Face"},{scannerType:P.ID_CARD,title:"Mặt sau của CCCD",description:"Đặt CCCD của bạn v\xe0o khung h\xecnh",titleIcon:"id_card_back.svg",cardSide:C.IDCardSide.BACK,cardType:C.IDCardType.VN,frontCamera:!1,enableConfirmPopup:!0,title_vi:"Mặt sau",title_en:"Rear Face"}];function AW(A){let{themeVersion:e}=d.useSDKSettings();return r.jsx(E,{...A,customTheme:AN[e],uiOnlyComponent:AQ})}let AL={logCredentials:t.shape({}),clientSettings:t.shape({}),customTheme:t.shape({}),onError:t.func,onStepDone:t.func,steps:t.arrayOf(t.shape({})),detectIdCard:t.func,outputEncryptionSettings:t.shape({}),themeVersion:t.string};AW.propTypes=AL,AW.defaultProps={logCredentials:void 0,clientSettings:void 0,customTheme:{},onError:()=>{},onStepDone:()=>{},steps:A_,detectIdCard:void 0,outputEncryptionSettings:null,themeVersion:"v2"};export{AL as ReadIDCardUIOnlyPropTypes,AW as default};
