-color: ${e=>e.theme.color.black50};
`,Or=ct.ZP.div`
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.25);
  flex: 1;
`,Fr=ct.ZP.div`
  display: flex;
  max-width: 300px;
  position: absolute;
  top: 4px;
  text-align: center;
  font-size: 15px;
  font-weight: ${({theme:e})=>e.fontWeight.medium};
  color: ${({theme:e})=>e.color.white};

  @media (min-width: ${ht.AV.tablet}px) {
    top: ${e=>e.isLoginWeb?"4px":"30px"};
    max-width: initial;
  }
`,Ur=ct.ZP.div`
  display: flex;
  position: absolute;
  right: 0;
  bottom: 4px;
  left: 0;
  font-size: 24px;

  @media (min-width: ${ht.AV.tablet}px) {
    bottom: ${e=>e.isLoginWeb?"4px":"15px"};
  }
`,Rr=ct.ZP.div`
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  margin-right: 20px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.75);
  color: rgba(255, 255, 255, 0.75);
`,Nr=ct.ZP.div`
  display: flex;

  position: absolute;
  bottom: 30px;

  font-size: 15px;
  font-weight: ${({theme:e})=>e.fontWeight.medium};
  color: ${({theme:e})=>e.color.white};
`,Lr=ct.ZP.img`
  width: 100%;
`,Br=(0,n.memo)((0,it.Pi)((function(e){const t=e.webcam,r=e.webcamActive,i=e.side,a=e.preview,c=e.previewImage,l=e.continueCapture,u=e.isSubmitting,d=e.onCapture,p=e.track,f=e.retryCapture,g=e.timer,h="login-web"===e.source,m=(0,ft.kC)().isPhone;(0,n.useEffect)((()=>(document.addEventListener("keydown",T),()=>{document.removeEventListener("keydown",T)})),[]);const b=(0,P.Z)().formatMessage,y=r&&!a,_=!r,v=(0,n.useCallback)((()=>{switch(i){case"face":p("verify_document_face_tapped_take_photo",{loggingId:"aa5abad1-4454-4a0a-aa03-80dcff2472dd",action:M.Us.click,componentType:M.re.button});break;case"text":p("verify_document_text_tapped_take_photo",{loggingId:"9277259a-562d-46f1-a2f8-23dc1e4aeb15",action:M.Us.click,componentType:M.re.button})}}),[i,p]),w=(0,n.useCallback)((()=>{v(),d()}),[d,v]),T=(0,n.useCallback)((e=>{32===e.keyCode&&w()}),[w]),x=(0,n.useCallback)((()=>{switch(i){case"face":p("verify_document_face_retake_tapped_retake",{loggingId:"c47beb88-3dd5-4384-a104-2c1a92732ec5",action:M.Us.click,componentType:M.re.button});break;case"text":p("verify_document_text_retake_tapped_retake",{loggingId:"3d6a29b8-80cd-4821-bb28-d6707215c912",action:M.Us.click,componentType:M.re.button})}}),[i,p]),S=(0,n.useCallback)((()=>{x(),f()}),[f,x]),k=(0,n.useMemo)((()=>g?b(zt.holdStillCapture):"face"===i?b(zt.faceCapture):"text"===i?b(zt.textCapture):""),[b,i,g]);return(0,s.jsxs)(o.Box,{justifyContent:"center",alignItems:"center",flexDirection:m?"column":"row",children:[_&&(0,s.jsx)(st.Spinner,{size:3}),(0,s.jsxs)(o.Box,{flexDirection:h||m?"column":"row",alignContent:"center",display:_?"none":void 0,children:[(0,s.jsx)(Tr,{isLoginWeb:h,children:(0,s.jsx)(dr,{side:i})}),(0,s.jsxs)(Ir,{inactive:_,isLoginWeb:h,children:[!a&&(0,s.jsx)(o.Box,{alignItems:"center",justifyContent:"center",height:"100%",children:(0,s.jsx)(xr,{isLoginWeb:h,children:(0,s.jsxs)(Sr,{children:[(0,s.jsx)(cr,{webcam:t,blur:!1,flipped:!a}),y&&(0,s.jsx)(Cr,{children:(0,s.jsx)(wr,{})})]})})}),y&&(0,s.jsxs)(Cr,{children:[(0,s.jsx)(Fr,{isLoginWeb:h,children:(0,s.jsx)(Mr,{children:k})}),(0,s.jsx)(Ur,{isLoginWeb:h,children:(0,s.jsx)(Mr,{children:g?(0,s.jsx)(Rr,{children:g}):(0,s.jsx)(Te.Button,{compact:!0,onPress:w,testID:"idv-take-photo-button",children:b(zt.takePhoto)})})})]}),a&&(0,s.jsxs)(o.Box,{flexDirection:"row",alignItems:"center",justifyContent:"center",width:"100%",height:"100%",children:[c&&(0,s.jsx)(Lr,{src:c,alt:"Preview"}),c?(0,s.jsxs)(Cr,{children:[(0,s.jsx)(xr,{children:(0,s.jsx)(Sr,{children:(0,s.jsx)(wr,{})})}),(0,s.jsx)(Ur,{children:(0,s.jsx)(Mr,{children:(0,s.jsxs)(o.Box,{children:[(0,s.jsx)(o.Box,{spacingHorizontal:1,children:(0,s.jsx)(Te.Button,{compact:!0,onPress:S,disabled:u,children:b(zt.retake)})}),(0,s.jsx)(o.Box,{spacingHorizontal:1,children:(0,s.jsx)(Te.Button,{compact:!0,onPress:l,testID:"idv-next-photo-button",disabled:u,children:b(zt.continue)})})]})})})]}):(0,s.jsx)(Cr,{children:(0,s.jsx)(Nr,{children:(0,s.jsx)(Mr,{children:b(zt.processing)})})})]}),_&&(0,s.jsx)(Dr,{children:b(zt.enableWebcamCapture)})]})]})]})})));function qr({title:e,subtitle:t,errorMessages:r,actions:n,actionsSubtitle:i}){return(0,s.jsx)(Kt,{title:e,subtitle:t,actions:n,actionsSubtitle:i,testId:"id-capture-verification-error",children:r&&(0,s.jsx)(Vr,{children:r})})}const Vr=ct.ZP.div`
  width: 100%;
  margin: 0px 0px 20px;
  padding: 20px;

  font-weight: ${({theme:e})=>e.fontWeight.medium};
  text-align: center;
  color: ${({theme:e})=>e.color.text};
  border-radius: 8px;

  background-color: ${({theme:e})=>e.color.accessoryBackground};
`;(0,it.Pi)(qr);const Wr=(e,t)=>{if(!e)return"";const r=e.name;return"string"==typeof r&&r in zt?t(zt[r]):e.message};const $r=(0,it.Pi)((function({error:e,hideRetryButton:t,onRetry:r,source:n}){const i=(0,P.Z)().formatMessage,a=t?null:(0,s.jsx)(ze.Button,{onPress:r,block:!0,children:i(zt.tryAgainFailureView)}),o=(0,s.jsx)("div",{children:Wr(e,i)});return(0,s.jsx)(ot.VStack,{justifyContent:"space-evenly",alignContent:"center",maxWidth:490,spacing:4,testID:"id-capture-failure-view",children:(0,s.jsx)(qr,{title:i(zt.titleFailureView),subtitle:i(zt.subtitleFailureView),errorMessages:"login-web"!==n?o:null,actions:a,actionsSubtitle:i(zt.stillHavingIssues,{troubleShootingTipsLink:(0,s.jsx)(Se.Link,{to:"https://support.coinbase.com/customer/en/portal/articles/1220621-identity-verification",openInNewWindow:!0,children:i(zt.troubleShootingTipsLinkFailureView)})})})})})),zr=e=>"drivers_licence"===e,Yr=e=>"id_card"===e;function Hr(){const e=(0,P.Z)().formatMessage;return(0,s.jsx)(o.Box,{background:"primaryWash",spacing:3,maxWidth:"525px",children:(0,s.jsx)(Se.TextBody,{as:"p",testID:"privacyPolicyNote",children:e(zt.privacyPolicy,{privacyPolicyLink:(0,s.jsx)("a",{href:"https://www.coinbase.com/legal/privacy",target:"_blank",rel:"noopener noreferrer",children:e(zt.privacyPolicyLink)},"one")})})})}function Gr({onSelect:e,idType:t,isInUS:r,width:i}){const a=(0,P.Z)().formatMessage,c=(0,n.useCallback)((()=>e(t.type)),[t.type,e]),l=(0,n.useCallback)((e=>Yr(e)?a(r?zt.id_card_us:zt.id_card_non_us):a(zt[e])),[r,a]);return(0,s.jsxs)(Jt,{onClick:c,highlight:zr(t.type),"data-testid":`idv-id-type-${t.type}`,width:i,children:[zr(t.type)?(0,s.jsx)(bt.Pictogram,{name:"idVerification"}):(0,s.jsx)(bt.Pictogram,{name:"identityCard"}),(0,s.jsxs)(o.VStack,{spacingTop:2,alignItems:"center",children:[l(t.type),zr(t.type)&&(0,s.jsxs)(o.HStack,{alignItems:"center",spacingTop:1,children:[(0,s.jsx)(mt.Icon,{name:"dot",size:"xs",spacingVertical:.5}),(0,s.jsx)(Se.TextLegal,{as:"p",color:"foregroundMuted",children:a(zt.recommended)})]})]})]},t.type)}function Kr({onSelect:e,supportedIdTypes:t,source:r,isInUS:n,hidePrivacyPolicy:i,noMinWidth:a}){const c=(0,P.Z)().formatMessage,l=(0,s.jsx)(Se.Link,{variant:"body",to:"https://support.coinbase.com/customer/portal/articles/2749813",openInNewWindow:!0,children:c(zt.actionOtherIdIdType)});return(0,s.jsx)(o.VStack,{gap:4,children:t?(0,s.jsxs)(Kt,{title:c(zt.titleIdType),subtitle:c(zt.subtitleIdType),actions:l,maintainHeight:!0,children:[(0,s.jsx)(Xt,{source:r,alignSelf:"stretch",children:t.map(((r,i)=>(0,s.jsx)(Gr,{idType:r,isInUS:n,onSelect:e,width:a&&t.length>1?100/t.length+"%":void 0},`select-id-box-${i}`)))}),i?null:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.Spacer,{vertical:4}),(0,s.jsx)(Hr,{})]})]}):(0,s.jsx)(qr,{title:c(zt.errorTitleIdType),errorMessages:c(zt.errorMessageIdType),actions:(0,s.jsx)("div",{})})})}const Zr=(0,n.memo)(Kr),Qr=e=>{let t="";switch(e){case"production":t="https://login.coinbase.com";break;case"staging":t="https://login-staging.cbhq.net";break;default:t="https://login-dev.cbhq.net"}return t};function Jr({onStartWidget:e,environment:t}){const r=At((0,n.useState)(),2),i=r[0],a=r[1],o=Qr(t),c=(0,n.useCallback)((()=>{e()}),[e]);return(0,n.useEffect)((()=>{fetch(`${o}/api/two-factor/v1/idv/token`,{headers:{"Content-Type":"application/json"},credentials:"include"}).then((e=>e.text())).then((e=>{a(e)}))}),[o]),(0,n.useEffect)((()=>{window.document.addEventListener("idv_event",c)}),[]),i?(0,s.jsx)("iframe",{srcDoc:i,title:"IDV Iframe",width:"0",height:"0"}):(0,s.jsx)(s.Fragment,{})}const Xr=e=>e.preventDefault();function en({facematchType:e,idType:t,imageCaptureView:r,isSubmitting:i,backImageRequired:a,frontImage:c,backImage:l,onGoBack:u,onUpload:d,showFrontBlurryMessage:p,track:f,applicationContext:g,allowContinue:h,allowSubmit:m,onSubmit:b,onRenderWebcam:y}){const _=At((0,n.useState)("frontBack"),2),v=_[0],w=_[1],T=At((0,n.useState)(!1),2),x=T[0],S=T[1],k=(0,P.Z)().formatMessage;(0,n.useEffect)((()=>(window.addEventListener("dragover",Xr,!1),window.addEventListener("drop",Xr,!1),()=>{window.removeEventListener("dragover",Xr,!1),window.removeEventListener("drop",Xr,!1)})),[]);const E=(0,n.useCallback)((()=>{w("facematch"),y?.()}),[y]),I=(0,n.useCallback)((()=>{E(),"face"===e?f("verify_document_facematch_viewed",{loggingId:"20d1e4db-98ad-41f5-a4e5-1392a2655e04",action:M.Us.render,componentType:M.re.page}):"text"===e&&f("verify_document_textmatch_viewed",{loggingId:"7fc1f2b0-cead-4614-aade-abe7fced365d",action:M.Us.render,componentType:M.re.page})}),[e,E,f]),C=(0,n.useMemo)((()=>{if(r&&i)return"";switch(v){case"frontBack":return"account_recovery"===g?k(zt.frontBackAccountRecoveryTitle,{idType:k(zt[t])}):k(zt.frontBackTitle);case"facematch":return e?k(zt[`${e}Title`]):"";default:return""}}),[g,e,k,t,r,i,v]),D=(0,n.useMemo)((()=>{if(r&&i)return"";switch(v){case"frontBack":return"account_recovery"===g?"":k(zt.frontBackSubtitle,{idType:k(zt[t]).toLowerCase()});case"facematch":return e?k(zt[`${e}Subtitle`]):"";default:return""}}),[g,e,k,t,r,i,v]),j=(0,n.useCallback)((()=>{f("verify_document_file_upload_tapped_upload",{action:M.Us.render,componentType:M.re.page,loggingId:"4a976c3a-1f2b-4497-9324-07c35dd86ac9"}),b()}),[b,f]),A=(0,n.useMemo)((()=>"frontBack"===v?e?(0,s.jsx)(o.VStack,{spacingBottom:2,children:(0,s.jsx)(Te.Button,{onPress:I,disabled:!h,testID:"idv-image-upload-cta",children:k(zt.continueAction)})}):(0,s.jsx)(o.VStack,{spacingBottom:2,children:(0,s.jsx)(Te.Button,{onPress:j,disabled:!m||i,loading:i,testID:"idv-image-upload-cta",children:k(zt.uploadAction)})}):null),[h,m,e,k,i,I,j,v]),O=(0,n.useCallback)((e=>{const t={front:zt.blurryImageWarningFront,only:zt.blurryImageWarningOneSided};if(e)return t[e]}),[]),F=(0,n.useCallback)((e=>{const t=e.backImageRequired;return e.showFrontBlurryMessage?t?"front":"only":null}),[]),U=F({showFrontBlurryMessage:p,backImageRequired:a}),R=O(U);return p&&f("blurry_message_shown",{action:M.Us.render,componentType:M.re.text,loggingId:"e24ce537-12e9-49af-99cf-1fa27131bd1f",context:"uploads",side:U}),(0,s.jsx)(o.VStack,{children:(0,s.jsx)(Kt,{title:C,subtitle:D,actions:A,onGoBack:i?void 0:u,children:"frontBack"===v?(0,s.jsxs)(o.VStack,{maxWidth:"440px",children:[(0,s.jsxs)(o.HStack,{justifyContent:"center",children:[(0,s.jsx)(tn,{side:"front",onUpload:(e,t)=>{S(!1),d(e,t)},onDropRejected:()=>{S(!0)},file:c,showLabel:"passport"!==t,showWarning:p,track:f}),a&&(0,s.jsx)(tn,{side:"back",onUpload:(e,t)=>{S(!1),d(e,t)},onDropRejected:()=>{S(!0)},file:l,track:f})]}),R&&(0,s.jsxs)(n.Fragment,{children:[(0,s.jsx)(o.VStack,{spacingVertical:2,spacingHorizontal:8,children:(0,s.jsx)(o.Box,{justifyContent:"center",background:"negative",borderRadius:"roundedSmall",spacing:1,bordered:!0,children:(0,s.jsx)(Se.TextLabel2,{as:"p",color:"secondary",children:k(R)})})}),(0,s.jsx)(o.VStack,{children:(0,s.jsx)(Se.TextLabel2,{as:"p",color:"foregroundMuted",children:k(zt.blurryImageWarningText)})})]}),x?(0,s.jsx)(Se.TextLabel2,{as:"p",color:"negative",spacingVertical:1,children:k(zt.rejectionReason)}):null,(0,s.jsx)(o.VStack,{spacingTop:2,children:(0,s.jsx)(Se.TextLabel2,{as:"p",align:"center",children:k(zt.instructions)})})]}):(0,s.jsx)(o.Box,{children:r})})})}const tn=(0,n.memo)((({track:e,side:t,onUpload:r,file:n,showLabel:i=!0,showWarning:a,onDropRejected:c})=>{const l=(0,P.Z)().formatMessage,u=an[t],d=(0,ft.kC)(),p=d.isPhone,f=d.isPhoneLarge;return(0,s.jsxs)(o.VStack,{spacingHorizontal:2,children:[(0,s.jsx)(rn,{onDrop:n=>{"back"===t?e("verify_document_file_upload_tapped_back",{loggingId:"0ee2c860-608e-408c-b27a-b88a0883ccb6",componentType:M.re.card,action:M.Us.select}):"front"===t&&e("verify_document_file_upload_tapped_front",{loggingId:"58ad4d36-9d61-46a8-86a4-86499bce5290",componentType:M.re.card,action:M.Us.select}),n.length>0&&r(t,n[0])},multiple:!1,minSize:5e3,maxSize:15e6,accept:"image/jpeg,image/png",color:a?"warning":"coinbaseLight",onDropRejected:c,"data-testid":`image-upload-drop-${t}`,children:n?(0,s.jsx)(nn,{src:n.preview,alt:"Preview"}):(0,s.jsxs)(o.VStack,{alignContent:"center",alignItems:"center",children:[(0,s.jsx)(o.VStack,{children:(0,s.jsx)(u,{})}),(0,s.jsx)(Se.TextLabel2,{as:"p",color:"foregroundMuted",align:"center",spacingTop:1,spacingHorizontal:2,children:p||f?l(zt.accountRecoveryDropzone,{side:t}):l(zt.dropzone)})]})}),i&&(0,s.jsx)(Se.TextLabel2,{as:"p",align:"center",children:l(zt[t])})]})}));tn.displayName="DropImage";const rn=(0,ct.ZP)(yt.Z).attrs((e=>({activeClassName:"active",color:e.theme.color[e.color]||e.theme.color.textAccent})))`
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;

  width: 140px;
  min-height: 140px;
  border: 1px dashed ${({theme:e,color:t})=>e.color[t]};
  cursor: pointer;
  margin-bottom: 10px;

  &.active {
    border: 1px solid ${({theme:e})=>e.color.positive};
    box-shadow: 0 0 2px ${({theme:e})=>e.color.boxShadow};
    transition: border-color 0.5s linear, box-shadow 0.5s;
  }
`,nn=ct.ZP.img`
  max-width: 100%;
  max-height: 100%;
`,an={front:()=>(0,s.jsx)(bt.Pictogram,{name:"identityCard"}),back:()=>(0,s.jsx)(bt.Pictogram,{name:"identityCard"})},on=(0,n.memo)(en);function sn(){return(0,s.jsx)("svg",{viewBox:".5 1 36 36",xmlns:"http://www.w3.org/2000/svg",children:(0,s.jsx)("path",{d:"m11.6 20 4.3 4.2 10.5-10.4"})})}const cn={role:"none",focusable:"false","aria-hidden":"true"};function ln({className:e,size:t="huge",redraw:r,isDecorative:i}){const a=At((0,n.useState)(!1),2),o=a[0],c=a[1],l=!r&&o;(0,n.useEffect)((()=>{if(!r){const e=setTimeout((()=>c(!0)),500);return()=>clearTimeout(e)}c(!1)}),[r]);const u=i?cn:null;return(0,s.jsx)(un,{className:e,size:t,children:(0,s.jsx)(dn,Ft({size:t,drawn:l},u))})}const un=ct.ZP.div`
  display: flex;
  align-items: center;
  justify-content: center;
  ${({size:e})=>(0,wt.isNumber)(e)&&`width: ${ar(e)}px; height: ${ar(e)}px;`};
  ${({size:e})=>"tiny"===e&&"width: 13px;"};
  ${({size:e})=>"medium"===e&&"width: 25px;"};
  ${({size:e})=>"huge"===e&&"width: 100px;"};
  ${({size:e})=>"tiny"===e&&"height: 13px;"};
  ${({size:e})=>"medium"===e&&"height: 25px;"};
  ${({size:e})=>"huge"===e&&"height: 100px;"};
  border-radius: 50%;
  border: ${({size:e,theme:t})=>"tiny"===e?"none":`${"huge"===e?"4":"2"}px solid ${t.color.border}`};
`,dn=(0,ct.ZP)((e=>{e.drawn;let t=jt(e,It);return(0,s.jsx)(sn,Ft({},t))}))`
  width: 100%;
  height: 100%;
  fill: none;
  stroke: ${({theme:e})=>e.color.positive};
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-miterlimit: 10;
  stroke-dasharray: 50;
  stroke-dashoffset: 50;
  ${e=>e.drawn?"\n    opacity: 1;\n    stroke-dashoffset: 0;\n    transition: all 1s ease-out;\n    ":""};
`,pn=(0,n.memo)(ln),fn="IdCapture.SuccessView",gn=(0,A.vU)({title:{id:`${fn}.title`,defaultMessage:"Identity verified",description:"Title for successful identity verification"},subtitle:{id:`${fn}.subtitleText`,defaultMessage:"Congrats! Your identity has been successfully verified.",description:"Subtitle for successful identity verification"},continueAction:{id:`${fn}.continueAction`,defaultMessage:"Continue",description:"Label for next button"}});function hn({onContinue:e}){const t=(0,P.Z)().formatMessage;return(0,s.jsx)(lt.Box,{alignContent:"center",justifyContent:"center",testID:"idv-success-view",children:(0,s.jsxs)(Kt,{title:t(gn.title),subtitle:t(gn.subtitle),children:[(0,s.jsx)(lt.Box,{spacingTop:5,alignContent:"center",justifyContent:"center",children:(0,s.jsx)(pn,{})}),(0,s.jsx)(lt.Box,{spacingTop:2,children:(0,s.jsx)(ze.Button,{onPress:e,block:!0,children:t(gn.continueAction)})})]})})}const mn=(0,n.memo)(hn);let bn;const yn=e=>{const t=(0,n.useRef)(),r=At((0,n.useState)(!!bn),2),i=r[0],a=r[1],o=At((0,n.useState)(bn||{}),2),s=o[0],c=o[1],l=(0,n.useCallback)((e=>{c(e),bn=e,a(!0)}),[c,a]),u=(0,n.useCallback)((()=>{c({}),bn=void 0,a(!1)}),[c,a]);return(0,n.useEffect)((()=>{let r=!0;const n=["en","en-US"].includes(e);return n||t.current===e?n&&l({}):(u(),async function(){try{const t=await fetch(`https://translations.coinbase.com/aab9bdc6d/latest/${e}/id-capture-messages.json`);if(!t.ok)throw new Error("Missing translations");{const e=await t.json(),n={};Object.keys(e).forEach((t=>{n[t]=e[t].defaultMessage})),r&&l(n)}}catch(e){r&&l({})}}()),t.current=e,()=>{r=!1}}),[e,l,u]),[i,s]},_n=e=>(0,vt.paletteValueToCssVar)(e),vn=_n(["gray100",.3]),wn=_n(["gray100",.5]),Tn=_n("gray100"),xn=_n(["gray100",1e-4]),Sn=_t.palette.primary,kn=_n("blue70"),En=_n("blue80"),In=_t.palette.primaryWash,Cn=_n(["blue80",.03]),Dn=_n("blue5"),Mn=_n("blue10"),jn=_n("blue20");_n("blue40");const An=_n("gray10"),Pn=_t.palette.positive,On=_n("green50"),Fn=_n("green10"),Un=_n(["gray80",.02]),Rn=_n("gray15"),Nn=_n(["gray80",.33]),Ln=_n("gray40");_n("gray50");const Bn=_n("gray5"),qn=_n("gray60"),Vn=_n("gray90"),Wn=_n("gray10"),$n=_n("gray60"),zn=_t.palette.primaryWash,Yn=_t.palette.negative,Hn=_t.palette.negative,Gn=_t.palette.negativeForeground,Kn=_n("gray0"),Zn=_n(["gray0",.25]),Qn=_n(["gray0",.4]),Jn=_n(["gray0",.6]),Xn=_n(["gray0",.7]),ei=_n(["gray0",1e-4]),ti=_n("yellow30"),ri=_t.palette.line,ni={black50:wn,linkBlue:Sn,vibrantBlue:"#0152c3",lightSkyBlue:"#B0CAFF",positiveGreen:Pn,positiveGreenHover:On,superLightGrey:"#f5f6f8",lightGrey:"#f7f8fa",midLightGrey:Bn,superLightBlueGrey:In,whiteBlueGrey:An,lightBlueGrey:"#90a1b8",midGrey:"#9da6b1",middleDarkBlueGrey:"#5f7285",midDarkBlueGrey:"#4e5c68",darkBlueGrey:"#202a36",oceanBlue:"#0f3256",oceanBlueGrey:"#113355",deepOceanBlue:"#002f6b",darkOceanBlue:"#043169",midOceanBlue:"#0b3466"},ii={hidden:-1,normal:0,elevated:1,high:2,extraHigh:25,backdrop:999,overlay:1e3,top:1001},ai={tiny:"2px",small:"4px",medium:"8px",large:"16px",huge:"24px",enormous:"32px"},oi='-apple-system,\nBlinkMacSystemFont,\n"Segoe UI",\n"Roboto",\n"Oxygen",\n"Ubuntu",\n"Cantarell",\n"Fira Sans",\n"Droid Sans",\n"Helvetica Neue",\nsans-serif',si={fontFamily:`'CoinbaseSans', ${oi}`,sans:`'CoinbaseSans', ${oi}`,text:`'CoinbaseText', ${oi}`,display:`'CoinbaseDisplay', ${oi}`},ci={regular:si.fontFamily,sans:si.sans,text:si.text,display:si.display,monospace:{fontFamily:'\n  "Monaco",\n  monospace;'}.fontFamily},li={background:Kn,backgroundHover:Un,backgroundSelected:Un,backgroundActive:zn,backgroundPill:In,backgroundAccent:Sn,backgroundAlt:Kn,backgroundHoverAlt:Bn,backgroundAccentAlt:vn,backgroundWash:Cn,text:Tn,textLight:qn,textLightAlt:Ln,textAccent:Sn,textAccentHover:kn,textAccentActive:En,border:ri,borderHover:Wn,borderAccent:Sn,borderAccentHover:En,buttonFill:Sn,buttonFillHover:kn,buttonFillActive:En,buttonOutline:Bn,buttonOutlineHover:Sn,buttonOutlineActive:Sn,positive:Pn,positiveHover:On,positiveLight:Fn,negative:Yn,negativeForeground:Gn,warning:ti,iconBackground:Bn,iconFill:Sn,iconBackgroundAccent:Sn,iconFillAccent:Kn,iconLight:qn,iconWarning:Hn,iconGreyDark:$n,iconGreyDarkAlt:Rn,iconBlue:jn,iconBlueBorder:Dn,placeholder:Ln,disabled:Un,boxShadow:Un,maskDark:"rgba(50, 53, 61, 0.33)",maskLight:Xn,maskBlue:"rgba(26,54,80,0.7)",accessoryActive:Sn,accessoryInactive:Nn,accessoryBackground:Un,twitter:"#499FEC",facebook:"#415894",white:Kn,white25:Zn,white40:Qn,white60:Jn,grey90:Vn,blue10:Mn,black0:xn,white0:ei,transparent:"transparent",slate:qn,slateDark:Tn,cornFlowerBlue:Sn,catalinaBlue:Sn,heather:Bn,midnightBlue:Sn,black:Tn},ui={border:`1px solid ${ri}`,noRadius:"0px",subtleRadius:"2px",borderRadius:`${ai.small}`,mediumBorderRadius:`${ai.medium}`,largeBorderRadius:`${ai.large}`,radius:`${ai.small}`,insetRadius:"3px"},di={default:`0 4px 12px 0 ${li.boxShadow}`,hover:`0 2px 5px ${_n(["gray100",.08])}`,deep:`0 4px 16px ${_n(["blue100",.05])}`,light:`0px 8px 16px ${_n(["gray5",.5])}`},pi={typeVariant:!1,airdrop:{color:{grey5:"#F5F7F8",grey10:"#E7EBEE",grey30:"#B8C2CC",grey50:"#8899AA",grey60:_n("gray60"),grey70:"#587088",grey80:"#113355",background:"#F5F7F8"},spacing:{tiny:"6px",small:"12px",medium:"24px",large:"36px",xl:"48px",xxl:"96px"},pageBackgroundWidth:1440,pageContentPadding:24,borderRadius:"7.68px",fontFamily:'CoinbaseSans-Medium,CoinbaseSans,\'Avenir Next\',-apple-system,BlinkMacSystemFont,"Segoe UI","Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;'},size:ai,fontSize:{tinier:"10px",tiny:"12px",small:"14px",medium:"16px",large:"18px",huge:"24px",super:"32px",mega:"48px"},fontWeight:{ultraLight:400,thin:400,light:400,regular:400,medium:400,demiBold:500,bold:500,heavy:500},fontFamily:ci,color:Ft(Ft({},ni),li),border:ui,boxShadow:di,layout:{width:1180,padding:24},breakpoints:{giant:1170,desktop:992,tablet:1040,phone:768,phone_small:560},zIndex:ii,_snapshotDisplayName:"defaultTheme"};function fi({children:e,compact:t,locale:r}){const n=At(yn(r),2),i=n[0],a=n[1];return i?(0,s.jsx)(at.Z,{messages:a||{},locale:r,children:(0,s.jsx)(ct.f6,{theme:pi,children:(0,s.jsx)(Yt.Provider,{value:{compact:t},children:e})})}):null}const gi=(e,t,r)=>{const n=((e,t,r)=>{const n=new Uint8ClampedArray(e.length/4);let i=0,a=0;for(let o=0;o<r;o++)for(let r=0;r<t;r++){const t=.299*e[a]+.587*e[a+1]+.114*e[a+2];n[i++]=t,a+=4}return n})(e.data,e.width,e.height),i=((e,t,r,n)=>{const i=Math.round(Math.sqrt(n.length)),a=Math.floor(i/2),o=new Float32Array(t*r);for(let s=0;s<r;s++)for(let c=0;c<t;c++){const l=s,u=c,d=s*t+c;let p=0;for(let s=0;s<i;s++){for(let o=0;o<i;o++){const c=Math.min(r-1,Math.max(0,l+s-a))*t+Math.min(t-1,Math.max(0,u+o-a)),d=n[s*i+o];p+=e[c]*d}o[d]=p}}return o})(n,e.width,e.height,[0,1,0,1,-4,1,0,1,0]),a=function(e,t){const r=[];e.sort();for(let n=0;n<t.length;n++){const i=parseInt(t[n]*(e.length-1)/100,10);r.push(e[i])}return r}(i,[0,20,40,60,80,100]),o=(e=>{const t=e.reduce(((e,t)=>e+t))/e.length,r=e.map((e=>Math.pow(e-t,2))).reduce(((e,t)=>e+t))/e.length;return{mean:t,variance:r,std:Math.sqrt(r)}})(i),s=o.mean,c=o.std,l=o.variance,u=function(e){const t=[.52212686,-496936896e-14,-246943824e-19,1.00000771,1,.998165138,.00175438596,0,-453629947e-14,-.00864553314,-.00920201294,-.0851599168],r=[.0713160985,355718077e-13,1.26534093e-9,385350515e-14,.000154822728,.000917431193,.00175438596,.000223914017,453629947e-14,.000120076849,.000143781452,.416606184];return e.map(((e,n)=>e*r[n]+t[n]))}([s,c,l,...a,r,t,r/t]),d=function(e){const t=[-5.90492194,-243.546621,394.601212,-207.437112,25.8128237,187.373979,96.5640019,57.3582572,-121.378124,-1.98053908,-1.84080502,-.261269689];let r=-1.51348298;for(let n=0;n<e.length;n++)r+=t[n]*e[n];return 1/(1+Math.pow(Math.E,-r))}(u);return{variance:l,blurry:d}};class hi{constructor(e){this.getImageData=e=>{const t=document.createElement("canvas"),r=Tt().get(e,"tagName"),n="IMG"===r;if("VIDEO"===r)t.width=e.videoWidth||e.clientWidth,t.height=e.videoHeight||e.clientHeight,this.leaveBreadcrumb("ClearCam.snap.photoInterval",{hasVideo:!!e,width:t.width,height:t.height});else{if(!n){const t=r||typeof e;return this.onError?.(new Error(`blurryDetector.getImageData: Unidentified image source. Expected a video or image element, received: ${t}`)),{}}t.width=e.width,t.height=e.height}const i=t.getContext("2d");i?.drawImage(e,0,0,t.width,t.height);const a=document.createElement("canvas");a.width=256,a.height=256;const o=a.getContext("2d");if(!o)throw new Error("unable to create 2d context");o.imageSmoothingQuality="high",o.drawImage(t,0,0,a.width,a.height);return{canvas:t,resizedImgData:o.getImageData(0,0,a.width,a.height)}},this.getImageFromUrl=e=>new Promise(((t,r)=>{const n=new Image;n.onload=()=>{t(n)},n.onerror=e=>{r(e)},n.src=e})),this.calculateBlurry=(e,t,r,n)=>new Promise((i=>{const a=gi(t,r,n);i({variance:a.variance,blurry:a.blurry,position:e})})),this.calculateBlurryFromImageUrl=async e=>{const t=await this.getImageFromUrl(e),r=this.getImageData(t),n=r.resizedImgData,i=r.canvas.width,a=r.canvas.height,o=await this.calculateBlurry(0,n,i,a);return{variance:o.variance,blurry:o.blurry}},Object.assign(this,e)}}const mi={video:{width:{ideal:1280,max:1920},height:{ideal:720,max:1080}},audio:!1};const bi=class{constructor(e){this.reset(),this.blurryDetector=new hi(e),this.leaveBreadcrumb=e.leaveBreadcrumb}reset(){this.canvases=[],this.eventCallback=null,clearTimeout(this.blurTimer),clearInterval(this.photoInterval),clearInterval(this.pollerInterval)}attach(e,t){this.video=document.getElementById(e),this.canvas=document.getElementById(t),this.context=this.canvas.getContext("2d"),this.video.setAttribute("playsinline","true"),this.video.setAttribute("webkit-playsinline","true");const r=(e,t)=>{this.canvas.width=parseInt(e,10),this.canvas.height=parseInt(t,10),this.leaveBreadcrumb("ClearCam.attach.setCanvasSize",{hasVideo:!!this.video,width:e,height:t})};r(this.video.clientWidth,this.video.clientHeight),this.video.onloadedmetadata=()=>{r(this.video.videoWidth,this.video.videoHeight)};let n=!1;const i=e=>{n||(0,M.Kz)("verify_document_webcam_permission",{loggingId:"d02a4e75-26fe-43d4-8ad2-feccd3d7de2e",action:M.Us.measurement,componentType:M.re.content_script,context:"granted"}),this.stream=e,this.eventCallback&&this.eventCallback();try{this.video.srcObject=e}catch(t){window.URL?this.video.src=window.URL.createObjectURL(e):void 0!==this.video.mozSrcObject?this.video.mozSrcObject=e:this.video.src=e}};navigator.mediaDevices&&navigator.mediaDevices.getUserMedia?navigator.mediaDevices.enumerateDevices().then((e=>{const t=e.find((e=>"videoinput"===e.kind));n=""!==t?.label})).finally((()=>{navigator.mediaDevices.getUserMedia(mi).then(i).catch((e=>this.setError({name:e.name,message:"NotAllowedError"===e.name?"Webcam access was denied. Please give webcam permissions and try again.":"Initializing your webcam failed. Please reconnect your webcam and try again, or try from another device."},!1)))})):this.setError({name:"webcamNotSupported",message:"Webcam document verification is not supported on this browser. Please try again with a different browser or the Coinbase mobile app."})}unattach(){this.stream&&(this.stream.stop?this.stream.stop():(this.stream.getAudioTracks().forEach((e=>{e.stop()})),this.stream.getVideoTracks().forEach((e=>{e.stop()}))),this.reset())}onReady(e){this.eventCallback=e}async snap(e,t,r){const n=new Array(e).fill(null).map(((e,r)=>this.getSnapPromise(this.video,t*r))),i=await Promise.all(n),a=new Array(e).fill(null),o=new Array(e).fill(null),s=new Array(e).fill(null),c=i.map(((e,t)=>{const r=e.resizedImgData,n=e.canvas,i=e.canvas.width,o=e.canvas.height;return a[t]=n,this.blurryDetector.calculateBlurry(t,r,i,o)}));(await Promise.all(c)).forEach((e=>{const t=e.variance,r=e.blurry,n=e.position;o[n]=t,s[n]=r}));const l=s.filter((e=>e)),u=0===this.varianceOfVariances(o),d=this.leastBlurry(s);r(a[d].toDataURL("image/jpeg",1),u,a.length,s[d],l)}getSnapPromise(e,t){return new Promise((r=>{setTimeout((()=>{r(this.blurryDetector.getImageData(e))}),t)}))}varianceOfVariances(e){const t=e.reduce(((e,t)=>e+t))/e.length;return e.map((e=>Math.pow(e-t,2))).reduce(((e,t)=>e+t))/e.length}leastBlurry(e){let t=-1,r=1/0;return e.forEach(((e,n)=>{e<r&&(r=e,t=n)})),t}},yi=e=>{const t=(0,n.useRef)(e);return(0,n.useMemo)((()=>t.current()),[t])};function _i(e,t,r,n){r&&Object.defineProperty(e,t,{enumerable:r.enumerable,configurable:r.configurable,writable:r.writable,value:r.initializer?r.initializer.call(n):void 0})}function vi(e,t,r,n,i){var a={};return Object.keys(n).forEach((function(e){a[e]=n[e]})),a.enumerable=!!a.enumerable,a.configurable=!!a.configurable,("value"in a||a.initializer)&&(a.writable=!0),a=r.slice().reverse().reduce((function(r,n){return n(e,t,r)||r}),a),i&&void 0!==a.initializer&&(a.value=a.initializer?a.initializer.call(i):void 0,a.initializer=void 0),void 0===a.initializer&&(Object.defineProperty(e,t,a),a=null),a}const wi=["idType","imageUpload","pendingVerification","fallingBack","success","failure","loading"],Ti=[{country:{code:"GN",name:"Guinea",image:"/assets/global/flags_png/GN-c41c6ef0b847ede64439b7a7c32717988b3021481039b01683c8c2d9d0472ad6.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"BI",name:"Burundi",image:"/assets/global/flags_png/BI-7e1d1d5a9096ad964c9e663c04af28daf0528b2ee0ab1c2adc14ad42083e1b78.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"CH",name:"Switzerland",image:"/assets/global/flags_png/CH-96d0794f0c876c6ce6ba6464fb95dcfafd74760ed69e1e3794f47d5ec33b3967.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"SL",name:"Sierra Leone",image:"/assets/global/flags_png/SL-edb53959f517d4d7ce92bd7723a4ba857c2f94ca4013a8c7fb4a645b1eed4f41.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"GM",name:"Gambia",image:"/assets/global/flags_png/GM-59f5013f7e4d041b4ccf99d95e42d9d9988308888095490fb2b7dc45080a6711.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"AI",name:"Anguilla",image:"/global/flags_png/AI.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"MX",name:"Mexico",image:"/assets/global/flags_png/MX-1d218141f71d17d5272ae33d4d11861e90c5115616a4fa2c26bc9a6f995861ee.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"MY",name:"Malaysia",image:"/assets/global/flags_png/MY-76d732c891bffc597ecd5ad5dca8803a4c070722a134680967862b7672bbc72a.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"JO",name:"Jordan",image:"/assets/global/flags_png/JO-e0605553c19ff681d54806aa10ed3fdd787780b95f82cfe3cda0650ac097523b.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"US",name:"United States",image:"/assets/global/flags_png/US-0a82fbea3120e52b5a1f6d5929b3a8dc560e09670a78d3df6898e9e4d0fa885c.png"},supported_id_types:[{type:"id_card",backside_image_required:!1},{type:"drivers_licence",backside_image_required:!0}]},{country:{code:"KW",name:"Kuwait",image:"/assets/global/flags_png/KW-8dd21e63887abd4acf68931cc731301c33afc3124190c2ca3f958ef80ad0d249.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"PH",name:"Philippines",image:"/assets/global/flags_png/PH-c41367dd64579d0bf9333cb7fa3669be470d44a225c92532e959e7cc2c04cfda.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"SN",name:"Senegal",image:"/assets/global/flags_png/SN-f19d2313fc1abf2a3843a616f1ee217302b839f8c4bc593527254820e2875fe5.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"CV",name:"Cape Verde",image:"/assets/global/flags_png/CV-83b39ad0ee12e0d112a28172bc4fb11a04a5daae560ce0a04a53ff724f310af7.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:null,name:null,image:"/global/flags_png/.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"TJ",name:"Tajikistan",image:"/assets/global/flags_png/TJ-ff7aa55531286e8eb20e717a9c4f56d464a4386d5e5c8ce7430ae0bd6a8d15df.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"TG",name:"Togo",image:"/assets/global/flags_png/TG-b1981f7835f811f3aad78a4901a30adff133844e736b333c1d0898caea214417.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"GD",name:"Grenada",image:"/assets/global/flags_png/GD-7dcd8625416c86acd0bee916d563df06bdad28576089480e26ffd4c70ef53b72.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"SM",name:"San Marino",image:"/assets/global/flags_png/SM-a2fd6fedc4a5bda6d637471627e4d3194da0daec4b4150909c631bb2469db7d0.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"GH",name:"Ghana",image:"/assets/global/flags_png/GH-f046768981cc3e2603d655cc328ae2a8d764f97b306c24add6c9bd054e15513e.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"MH",name:"Marshall Islands",image:"/assets/global/flags_png/MH-6a5592db3e3996d02e002b07d71ae4c5bcd9b21ae4f6d6817c7e75dd33b4debc.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"NI",name:"Nicaragua",image:"/assets/global/flags_png/NI-5c218c73c3445f9b60334547e46bb52dd16372130bed2bba0a304a2b711d5a32.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"ET",name:"Ethiopia",image:"/assets/global/flags_png/ET-1327c50e090253f97e405c7a80a72bbdce6e4a246410af583c70e3c2f73e4648.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"DO",name:"Dominican Republic",image:"/assets/global/flags_png/DO-13564ce2f3ead0ff101e535eb55dc8032b8a62937c6880d3d67960aab0232fbe.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"PS",name:"Palestine, State of",image:"/global/flags_png/PS.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"ES",name:"Spain",image:"/assets/global/flags_png/ES-d8209526484cf8c2165c60a7e5c5c504428ebf84c882828743ee6dbd04687124.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"NA",name:"Namibia",image:"/assets/global/flags_png/NA-9e7dd89581ed9da6d82054e341c39c6ba5bd12aafac100455128bc687e415087.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"IL",name:"Israel",image:"/assets/global/flags_png/IL-b6d57d770003e9c55579f9d1eccc54060174702c46abb607ac72d89a1512f6a5.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"CU",name:"Cuba",image:"/assets/global/flags_png/CU-00f9b3412367396ba15a94561cc828f88a576c9083a637ba2bcc7dfa02630f27.png"},supported_id_types:[{type:"id_card",backside_image_required:!0}]},{country:{code:"MT",name:"Malta",image:"/assets/global/flags_png/MT-15b91f7f6e6fb0f948a15ba27eb69204440a9c5681be0608a4f8924fd3fff2ee.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"BM",name:"Bermuda",image:"/assets/global/flags_png/BM-79d46ef928c3d120484d4e18a41b32302a9c6ce931daf01950ba86e4badf68d4.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"FR",name:"France",image:"/assets/global/flags_png/FR-d356ff8d207eae6f3eb531811557fae88625a80d76eeeb30c8963f8177a9c6d4.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"NZ",name:"New Zealand",image:"/assets/global/flags_png/NZ-10c96dc10dbeef13956cdbfb64c08b66014310bb2d98394a1c8a0f9cbb85b5d2.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"IS",name:"Iceland",image:"/assets/global/flags_png/IS-b1e7b94fb01ddbc349ddcebe00c52cba8dc429b1685c332c0224b143f60bac3c.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"VN",name:"Vietnam",image:"/assets/global/flags_png/VN-a174dd1de08805ceb2b500cac6cd788512b6ab2bcdc15522abbed2722f17ca31.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"PY",name:"Paraguay",image:"/assets/global/flags_png/PY-1f6ed141f030569834f7c24aba6a8bf111ee519fad6cf5bbc7920bcda180228e.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"LV",name:"Latvia",image:"/assets/global/flags_png/LV-a017b864c011f9d999e6223c683ff209188a26f0019b90d71b224fa546caa6a4.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"KM",name:"Comoros",image:"/assets/global/flags_png/KM-52c1cab28097094fdd607eff764cd6ae65f5e3e8c876b261495fbd37bd766f27.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"CY",name:"Cyprus",image:"/assets/global/flags_png/CY-e8594ed00c9eca5395083ba3c56f7857eebb67a9b5eed0dd25f72cce6093745e.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"MA",name:"Morocco",image:"/assets/global/flags_png/MA-e747c360cc1be9324f43e291142d7b96b123b88ffa2f69854da3815b67780257.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"VC",name:"Saint Vincent And The Grenadines",image:"/assets/global/flags_png/VC-aed13ed9f164e7747575684d43dfa6b0d0b8f974ceb0413eef68cec4092c1132.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"BJ",name:"Benin",image:"/assets/global/flags_png/BJ-efa2a6fbdc44310eb884bdedaec62158013863f9151b7699f6b1d808149876fe.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"AF",name:"Afghanistan",image:"/assets/global/flags_png/AF-b00e21bc05ca5228358f3ea5ea2d3d18a2865f7f4220dd5f65085e0f615e9f30.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"DJ",name:"Djibouti",image:"/assets/global/flags_png/DJ-5de44ae051604942575cb2f9f578f5fd50bc30dfa2b69b2f0b2b70fdc8f58f90.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"EE",name:"Estonia",image:"/assets/global/flags_png/EE-4861c16101df972293fa5b87d7877207bb09a4c740bf003c4ee5e3d82d71ec65.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"NE",name:"Niger",image:"/assets/global/flags_png/NE-a86f1451872ce48a1da2c9e80dcce543694e01d5e7f87e262632c044c856f0bb.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"TD",name:"Chad",image:"/assets/global/flags_png/TD-7fb7d2ac180f785264ec68fbc495bb8ace12c6a185cbaf03ac0afbbb9605bdeb.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"MG",name:"Madagascar",image:"/assets/global/flags_png/MG-0e0e9e47ad730fbd100a535c775582e3ee66226fee5c3ed2dda51e541c9898f5.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"MS",name:"Montserrat",image:"/global/flags_png/MS.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"HT",name:"Haiti",image:"/assets/global/flags_png/HT-818489b232bf4784bafa605ee06c98316b7a7a4467289ed0f66224035480bdea.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"HR",name:"Croatia",image:"/assets/global/flags_png/HR-0866d54550819bf5348e8cc2bba5c1df67c97ca7262d8e01a366decef5b6dfe3.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"TN",name:"Tunisia",image:"/assets/global/flags_png/TN-a56021b9ede5eef3edd35278cb0aec93b1a76f1e3d659c9d7c6ae2f415ce03eb.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"GQ",name:"Equatorial Guinea",image:"/assets/global/flags_png/GQ-0389bd1e1b57e549489e12b3919b1d6f810c124f371ec38449039d3e4f41e690.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"HN",name:"Honduras",image:"/assets/global/flags_png/HN-121695181ed69962eee6bbe5179c556ef5116cfc1c5b223f6515d8c85c734b7d.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"IE",name:"Ireland",image:"/assets/global/flags_png/IE-60f9072ce15fec70c778c370b70db8dc2b25a0133387c9a9c6a17d2b3a6db615.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"LS",name:"Lesotho",image:"/assets/global/flags_png/LS-98737987866fcafee18364eff7c4aaf408331e09bbc9176824753b4c7891f79b.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"TH",name:"Thailand",image:"/assets/global/flags_png/TH-83a61cd6814771f5dbc332fc9c05ca52223679a2d76efcdaf83d67df11af8dba.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"BS",name:"Bahamas",image:"/assets/global/flags_png/BS-cc60a61ad2dc0ed89fbcfc76f4862d75940fd45313f4860d0e35aff6a85c9fde.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"OM",name:"Oman",image:"/assets/global/flags_png/OM-393773e87aec54f35e473bd597ae18f9509bc0cb6e87769c5228ba0139345f9b.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"LB",name:"Lebanon",image:"/assets/global/flags_png/LB-42914d5b3609bb250a362d275f6e693b113dc8a3da0202334d5043e2e7b62c14.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"GR",name:"Greece",image:"/assets/global/flags_png/GR-c0aa7c3f76f4c04e8a36b18ee7e9daaf35f6fac390015f7f67c8fc8b6c2810fd.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"GT",name:"Guatemala",image:"/assets/global/flags_png/GT-61ad5b69f2cd87073b7b73d7960d153a7ed306bd14b05c81407eb87663547789.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"GY",name:"Guyana",image:"/assets/global/flags_png/GY-cb78de3d91fb4ae1f4633831bfc62f0d31b6457667658c87a58ccb28452f4423.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"DM",name:"Dominica",image:"/assets/global/flags_png/DM-420e352dd71592f007c4c99a0e7d966b61e2cb42ee65e76b1e59027184d13f29.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"TC",name:"Turks and Caicos Islands",image:"/global/flags_png/TC.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"DE",name:"Germany",image:"/assets/global/flags_png/DE-e52ff00b7ab79ef57d15a5ff220821c79ea78eaaaf0ab69d92499fee9c2b90c1.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"TL",name:"Timor-Leste",image:"/assets/global/flags_png/TL-f0e77c5ef7581036cf4a07777c68f76f2a3acafe83a009e8a8716b8bacc95afd.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"LC",name:"Saint Lucia",image:"/assets/global/flags_png/LC-8405db2ded5166278356028f60a78ec7c69a528d51368d2fcfe1ddfdb7aee90f.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"AG",name:"Antigua and Barbuda",image:"/assets/global/flags_png/AG-2619d10c21e6e0cbb5f18c5b7e821acc95e9347d518f8edfdda2dd20e6d5dc75.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"KR",name:"Korea, Republic of",image:"/assets/global/flags_png/KR-99eea7a9cb66c3faa95f805afcc79d738e0cc2e4954c21f5b8ed590573ca2bc1.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"PT",name:"Portugal",image:"/assets/global/flags_png/PT-6e0067bc1836561689312c6416760e869aa6e559cb2a3f84ea5c7680d7904975.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"PR",name:"Puerto Rico",image:"/assets/global/flags_png/PR-27cdbde4e23714d16207d58ade70c3cfffcf460e6d01fef647f977ada4b89e65.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0}]},{country:{code:"LI",name:"Liechtenstein",image:"/assets/global/flags_png/LI-6c5fb9cdedc9541e45341d2d02b0de8bee5e75f5bc0c9a38ffabbe0a3e901803.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"TT",name:"Trinidad and Tobago",image:"/assets/global/flags_png/TT-4dab540bca8a5c7e00778e6e432b22109bfb307fb4fb1cc1c1386cb9bda895ab.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"LT",name:"Lithuania",image:"/assets/global/flags_png/LT-761ae6a739b2e41b32881b6bb4e960c6a8aa19e98af82f5395bfb656b21784a6.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"SS",name:"South Sudan",image:"/assets/global/flags_png/SS-12b91d26a42ec0c4f9c084110701b19f8d327a7023d66cf6631283c186ca055f.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"NO",name:"Norway",image:"/assets/global/flags_png/NO-976cd3d193a265971f90a4e432359892a62276c3c1c71ab8891572bf9f5b0a9d.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"SR",name:"Suriname",image:"/assets/global/flags_png/SR-bebc0e678f32cd54e09e7e4d1fb6ae558475d533baaf494f125f75d108bb64f0.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"BO",name:"Bolivia",image:"/assets/global/flags_png/BO-d96e1b15ca48663e162c568cf1aff2abba9d8bca613cb3e4e10fa4b86e7eb209.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"PK",name:"Pakistan",image:"/assets/global/flags_png/PK-aa21f333720ffd9c3f2b84ba4beee9e201bf343dfdd6f5bb5847626fb1dd98a8.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"BA",name:"Bosnia and Herzegovina",image:"/assets/global/flags_png/BA-6291083a6b780fc4abf6e3bbb79d6b6f3135d676f4e8b6545032a3dc8f711a75.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"JP",name:"Japan",image:"/assets/global/flags_png/JP-b9f8f51047cca19830bfa11791f3b207cd3d5a1e4911cacd7683076349e8f932.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"RS",name:"Serbia",image:"/assets/global/flags_png/RS-b0d3a0f365c2ea45d403d1764bcfd92b84582841bdb7f6523a4a986945280597.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"ZW",name:"Zimbabwe",image:"/assets/global/flags_png/ZW-1f30389ec0ba1293280c6903480dd4480bf5ea968b5ad11ad2187b2b24b68695.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"VE",name:"Venezuela, Bolivarian Republic of",image:"/assets/global/flags_png/VE-25225f9726d9dca96ce03a08b7cba02649c85f72dd0307eaccbbb1d4fffb26ad.png"},supported_id_types:[{type:"id_card",backside_image_required:!1},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"SI",name:"Slovenia",image:"/assets/global/flags_png/SI-5e411c4452dbc73c6959349ec3488eddabb8d896d544dc957f35a9753a751a29.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"DK",name:"Denmark",image:"/assets/global/flags_png/DK-94ba532301e27f13f7c96b4e73411e5f79f9843a092600dc6df41910eaee5a4d.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"ZM",name:"Zambia",image:"/assets/global/flags_png/ZM-54718800937bb6e9c0f531998361a80665e00d55807253be0340c573836e86d1.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"BT",name:"Bhutan",image:"/assets/global/flags_png/BT-e03afd356b0b4f88019ed875584fca5c84a302be5a85b36f60308a4e3fd99625.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"IT",name:"Italy",image:"/assets/global/flags_png/IT-177a121fdbf392bc52ff0d7b6762f0cd3df55d68cbbbc3736a2ed53a799dd277.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"TZ",name:"Tanzania, United Republic of",image:"/assets/global/flags_png/TZ-7a460cff962df829d59e42e3a6dfdfe1212467451f7e005241bc282060648a0f.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"UG",name:"Uganda",image:"/assets/global/flags_png/UG-2f9509c4719ad1b4216e8ddf7cf3c2355757464f3b7e879988a0531b02870f69.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"SE",name:"Sweden",image:"/assets/global/flags_png/SE-9d5b8c1442c9ee0951f893ce49b8fc2e662f1ef7eed71ca7f02ad1c677d0279f.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"CR",name:"Costa Rica",image:"/assets/global/flags_png/CR-57f6377b73a0388dd9d9ab3b1f8db83439d6b49a7e331deee485bb9823cf76a8.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"BZ",name:"Belize",image:"/assets/global/flags_png/BZ-ab8b66186a2a09c6635f6f7f3ac502f1deea7b48e7d843a207e94f856cfe9f33.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"GW",name:"Guinea-Bissau",image:"/assets/global/flags_png/GW-50a7fbf30fce350a8f491bd11a724e1cbaf598857e0c541be181393c00e62a73.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"FI",name:"Finland",image:"/assets/global/flags_png/FI-f94491eb812ae79a9121f988e183b7ad0db32f199023fca49a08841f646ed3e7.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"GU",name:"Guam",image:"/assets/global/flags_png/GU-bb1320e928531713e8e06a20b2c22930f67be53e4ee31c9b7d31207b45d43808.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"GG",name:"Guernsey",image:"/global/flags_png/GG.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"NP",name:"Nepal",image:"/assets/global/flags_png/NP-8ca9bf85fff30be6ed58fc5263f4beb5947e2ecae9deb4060c54ee8799777db4.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0}]},{country:{code:"MU",name:"Mauritius",image:"/assets/global/flags_png/MU-f9bbe3619de18eec6ab9a2490ecc6da4475d0fc179a3a04a4c4a314c8a9be41a.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"MV",name:"Maldives",image:"/assets/global/flags_png/MV-793d6a0304fcf43f4cc52c5921e45fc3050f4455d4b00b0de22d1ea2f99b41ca.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"TO",name:"Tonga",image:"/assets/global/flags_png/TO-8ec87a63b77e9116f7bbcec0abb7d3b1a507308a747718e66d03b3dad348b3b0.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"BE",name:"Belgium",image:"/assets/global/flags_png/BE-9193210af284b5e2364c2f0a0d9779556d680a24856ab39c71a106c7010da142.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"PL",name:"Poland",image:"/assets/global/flags_png/PL-e263c6d504c793f9a1cd93fdbd47a90eb29d2fbb94ad2579a714c06eacbe559d.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"MC",name:"Monaco",image:"/assets/global/flags_png/MC-dfd18537ca467b1e5f4e41d5dcedaa1f66303febea8410a90529c06a58dd23cb.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"CI",name:"Côte D'Ivoire",image:"/assets/global/flags_png/CI-7bd9410b4a0c69aec7f914a27a396e4d658943535608e3cb38c9e5a97cfd69e7.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"BD",name:"Bangladesh",image:"/assets/global/flags_png/BD-f6860232b45367be320373591a90c772f9fe8a91a4f55d84931858e9c46ed28f.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"LR",name:"Liberia",image:"/assets/global/flags_png/LR-35cdefea5dcf25363d5297fb026fa27c3f346ed678692ff6d457244be501ec45.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"TR",name:"Turkey",image:"/assets/global/flags_png/TR-5d878c72e91fa9685154dfa9472d8a6f7eca59e16c698b0a06a1d472cad4bf87.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"VI",name:"Virgin Islands, U.S.",image:"/assets/global/flags_png/VI-de2cc47f67e4eb5ed6f8290010618db6add1b4141323d154980a263b043f9f6b.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!0}]},{country:{code:"BB",name:"Barbados",image:"/assets/global/flags_png/BB-9770c2817c834feab0555d36c710976836ac61f4c5d88671d0318f3e4abe6ac4.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"EG",name:"Egypt",image:"/assets/global/flags_png/EG-91a7a3da04deb919f97a20bbb13bccedf9516665427be545b2abc28657ee31dc.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"AM",name:"Armenia",image:"/assets/global/flags_png/AM-f59a74e65dfe725c21cb1ce4520c64a7fd7d608c2bd0cfdc13b8260da83bb64f.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"LY",name:"Libya",image:"/assets/global/flags_png/LY-94adf172d5f62367b29c858aca874e4abad1d684994d653e30d10a90af17b300.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"BG",name:"Bulgaria",image:"/assets/global/flags_png/BG-62fe541732144f22386f9f29d709feb500db4d4f85253ffa46d3b19cd94e28fe.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"PE",name:"Peru",image:"/assets/global/flags_png/PE-169bd7eaed9043ffb6302b092038d92953f7160929216d6eb7a9e0dff1781300.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"YE",name:"Yemen",image:"/assets/global/flags_png/YE-44b072e67aad133f5f33a457a54645474371cd148beb3fd0623d6519d7f2cfef.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"JE",name:"Jersey",image:"/global/flags_png/JE.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"JM",name:"Jamaica",image:"/assets/global/flags_png/JM-63924f81ebc07d6ecd2e6148a3ba0443833b613bc52e37a841ac9cc467188255.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"UZ",name:"Uzbekistan",image:"/assets/global/flags_png/UZ-4a6c34ead6465d7bbd50eb799cfc576bf5ebb66a1d5309ba920308ab15defa4d.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"KN",name:"Saint Kitts And Nevis",image:"/assets/global/flags_png/KN-ef95950cfeff68efcf067aaa96640a77e93778c5ddd960b5d71d2209bf49c4e2.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"LA",name:"Lao People's Democratic Republic",image:"/assets/global/flags_png/LA-9abbf92086fe924725c45d4d679db5b010c884c07af69b994b5dad9855b51f75.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"KY",name:"Cayman Islands",image:"/assets/global/flags_png/KY-e414ee213853a0a51bcee1dffe84139e7589f8f546276419616890c4f0a2eda0.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"TW",name:"Taiwan, Republic Of China",image:"/assets/global/flags_png/TW-b9f0a61c4c41f893da19eaf02a91a0e8ebe2c9b11efb882becffa8469fd63f71.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"KH",name:"Cambodia",image:"/assets/global/flags_png/KH-972f67011028bb4c84c18b384a3b72bb1c93f579704dbbd057975aa7dc919f35.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"RW",name:"Rwanda",image:"/assets/global/flags_png/RW-6dfa4ac9ac2d02dafe7ad92f6e603b953911ff6241db68276653aa004a6122d1.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"HU",name:"Hungary",image:"/assets/global/flags_png/HU-7aac433c376ed9643e9235bdd8b62e794eb52cf66f745ff38f425bd32ed08c53.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"ML",name:"Mali",image:"/assets/global/flags_png/ML-54b0ba0993bfef8e037de9264cd345525302eba8b23df58d823424903e03f10b.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"MR",name:"Mauritania",image:"/assets/global/flags_png/MR-5aa969f5a698ef2ca82230fbab98a0c57e80abd8446c1063231d80c0f8ca05cd.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"CN",name:"China",image:"/assets/global/flags_png/CN-cc03ec5b10004f57ffeb662ffa0e6c08249bbb1e7d350ebef730d20be8cbf049.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"ME",name:"Montenegro",image:"/assets/global/flags_png/ME-f9f18e1397245b45a39a26a1c9f8a6b4f8a0ec17f3d984f1735055c2d5da6bf0.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0}]},{country:{code:"NG",name:"Nigeria",image:"/assets/global/flags_png/NG-8bbf5212669ca125058edbf2bbb12e2db8f001058048ce2bb0ba80c88d959183.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"BH",name:"Bahrain",image:"/assets/global/flags_png/BH-e5a3d35b1c248bf19aa0458b5e8782cf46079f867860e734534a8573c4faab66.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"GA",name:"Gabon",image:"/assets/global/flags_png/GA-16995ed800a3d740c001c74dede462c0ceeb8972828c02242d399dfaa3495f4f.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"IN",name:"India",image:"/assets/global/flags_png/IN-b7738f15a59973c4d1290a15a40fdccba013ff26ca2a042556c22d7b45a5e0c3.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"CZ",name:"Czech Republic",image:"/assets/global/flags_png/CZ-8bf38aa0e1bbf58a5bbc21d42933f13d3a14848158f89ab14f2a8b4690aed263.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"BN",name:"Brunei Darussalam",image:"/assets/global/flags_png/BN-275962ab3a3ddcae04fbd66fb3b926badfa2627aab5263d506889b9942699e1a.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"UY",name:"Uruguay",image:"/assets/global/flags_png/UY-14f7ec76cfd2df8bb0c71ef67a05add3dbb7ddf65a934c381d6cc3ce94b06aa9.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"BR",name:"Brazil",image:"/assets/global/flags_png/BR-c21ce346614adb4e722a26931d85616b012939ce7df101085ed9ca26c43dc5a9.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"TM",name:"Turkmenistan",image:"/assets/global/flags_png/TM-f921889cfdecf7d57dc95111a62e838d26aacc3ab04c8be93ba6f71f1d9bb0d3.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"MW",name:"Malawi",image:"/assets/global/flags_png/MW-c1ecded795dfb4a15559e9ca4844954a8703d369d77a8e4e570c465b8ba27641.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"KG",name:"Kyrgyzstan",image:"/assets/global/flags_png/KG-a291e68377af4cfdf4bd62a088ff157e1b149eb5b43af53ee33c346f36a6c08a.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"PA",name:"Panama",image:"/assets/global/flags_png/PA-bf2a97b5bbd9c338b0b258c23d6e965640b23da16709075b75f1e846375ec1a0.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"MM",name:"Myanmar",image:"/assets/global/flags_png/MM-0e8bcfd70f8da8369a9f113fbd811cabda5fc286342243d3f03fe295d62844c6.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"SA",name:"Saudi Arabia",image:"/assets/global/flags_png/SA-38b8ee14f6ced326dbc63281a12ae9a4afafea19b2d26fe67f63722c4531d5f2.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"SZ",name:"Swaziland",image:"/assets/global/flags_png/SZ-af157145c156d3474d9349a80cca2d3d046ef116d8a35a9619cef0042ebdc6d4.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"FM",name:"Micronesia, Federated States Of",image:"/assets/global/flags_png/FM-c61102237e76e20d2aeed7f163314de1441a1f9e5c9c562d07d5aaede4cd3cea.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"CO",name:"Colombia",image:"/assets/global/flags_png/CO-a55d6e9352a585ea52e99f23f24ec1d7b89bbf285f15eb520787f2e2a811b0b2.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"SC",name:"Seychelles",image:"/assets/global/flags_png/SC-c32e760e2857b7790eb9dca1c24d792de0f78f23fb87344d25a9ae0792df3882.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"ZA",name:"South Africa",image:"/assets/global/flags_png/ZA-b7265aa27cac5b7ac38ae755850979023b06d60b4e09ca9c90ab579e50793598.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"MK",name:"Macedonia, the Former Yugoslav Republic Of",image:"/assets/global/flags_png/MK-2a31049c8fd63434d648f66c1a748e36185621a00e8d8978381faa463aaf6b24.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"AO",name:"Angola",image:"/assets/global/flags_png/AO-2c08a655c0cdab284dcee731a67ef3a2c160b74749e7cb7611ffd41c31b159ae.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"AD",name:"Andorra",image:"/assets/global/flags_png/AD-2355e0d800bab63e14f4bf83f292962b14f71af0a1342b37385b121a857b0fe0.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"SV",name:"El Salvador",image:"/assets/global/flags_png/SV-416a08166a1209f7e7a45564dd91adf35d7a5546b701463df1b43c895f2671e9.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"SK",name:"Slovakia",image:"/assets/global/flags_png/SK-252679b427a918c09afa27c32b1698779e6797586d6da197607342d4220ff528.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"ID",name:"Indonesia",image:"/assets/global/flags_png/ID-a2b35a19da216882c01c2aee459e2298d9941b093ae4dabe07363a36d6e7d430.png"},supported_id_types:[{type:"id_card",backside_image_required:!1},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"AE",name:"United Arab Emirates",image:"/assets/global/flags_png/AE-28627bc4da520f791467dd0fcb9c2935145c94f8918ac1817b33d1f494f86124.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"GB",name:"United Kingdom",image:"/assets/global/flags_png/GB-159a0d57823209767afb5222800a32c3b9ba131ede295774ed2905d29ca8deb8.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"AT",name:"Austria",image:"/assets/global/flags_png/AT-d8a3142f0a58f389bee5e08bd6333e9b1e8c0ed3026fbdf47d80c58d8a7581a0.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"VU",name:"Vanuatu",image:"/assets/global/flags_png/VU-e5959233ae071d19b1a52e81383ca82c6331f5243124694806e09bbffa87a9f0.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"HK",name:"Hong Kong",image:"/assets/global/flags_png/HK-96e9fb9ea051b3a44aca0b4074444879f4e3421b9c35c773ea7536e3b57cceca.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"QA",name:"Qatar",image:"/assets/global/flags_png/QA-9b85ca4b8e710fe380a6ed3d0cd0fbbf8b1d76d4152eced79d6e6f2061bbb18f.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"SG",name:"Singapore",image:"/assets/global/flags_png/SG-a5f01955b4d5c3ace67f7a78af6b357a330de685dd93ce6b316e26650053783b.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"MZ",name:"Mozambique",image:"/assets/global/flags_png/MZ-2275d08d4be6213bace85042f8dc676bbcb54498ac716df90f376be0daeaa693.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"GI",name:"Gibraltar",image:"/assets/global/flags_png/GI-9eee466a2364ffae21c61cd4384e99a56c15ea6cca151ae329bd728eaa350c10.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"NL",name:"Netherlands",image:"/assets/global/flags_png/NL-440b9f01bb0f10988804081869241c6a8c9faf15058142bbf728eeb0f5ae5947.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"PW",name:"Palau",image:"/assets/global/flags_png/PW-16589de7593a2b6d5feae4c6b4b0e62d1cb539d3de13a814ca770d09690beddb.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"KE",name:"Kenya",image:"/assets/global/flags_png/KE-2f2c658bd12a09938b46977b5508d2a8a77e2f5d8ec7b4a2b6dde3b6b8bd6dbf.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"CA",name:"Canada",image:"/assets/global/flags_png/CA-1405870c5218539f0445c6fcc26550f3ab5d54cd3f1fd1d9c3a9aec11ac6a0e3.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"MN",name:"Mongolia",image:"/assets/global/flags_png/MN-a385a1acbaac2ffc1fe95748016e8a86d19ffe6fd621fbe9759ecb422f7f5904.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"BW",name:"Botswana",image:"/assets/global/flags_png/BW-5c4cee7f63f7de2f0f64fa866d0f6f8cd72fed5f1108d4cb50490a16cbf82360.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"ST",name:"Sao Tome and Principe",image:"/assets/global/flags_png/ST-5aaf251178b4477cce5cb9194ddfc5fd715f001fa96eb20b718a146f850535af.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"PG",name:"Papua New Guinea",image:"/assets/global/flags_png/PG-6b50ce557385ccb68755a8c0aca958b6e8323c153ddbb1cdbc8db3425e096711.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"AU",name:"Australia",image:"/assets/global/flags_png/AU-9ebcb91447a90f787ac94e36a2d2569de90e19604cf0994bdf9883a9a0cd6d26.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"LK",name:"Sri Lanka",image:"/assets/global/flags_png/LK-e369fa29c6acbf1e6841fb18dc0d7a16645a32964e8603e52173743c640be8f9.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"AR",name:"Argentina",image:"/assets/global/flags_png/AR-3629b8c69923e6ac078004ef7486370dd1b1f98425be498383f74daa155c9da6.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"VG",name:"Virgin Islands, British",image:"/global/flags_png/VG.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"CM",name:"Cameroon",image:"/assets/global/flags_png/CM-fc97c68ae8b0643103eee1913cea305321c62e3f4b491e15e0904f093896dfb9.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"AZ",name:"Azerbaijan",image:"/assets/global/flags_png/AZ-7d19711363fd0279b9216a084d3d14a505303b663b2768f9a41fff69f920146b.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"CL",name:"Chile",image:"/assets/global/flags_png/CL-01797d27e524659a3c8446642f3250a9fa3ea0fe91218a023c7ef1ce94aa6acc.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"IM",name:"Isle of Man",image:"/global/flags_png/IM.png"},supported_id_types:[{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"MO",name:"Macao",image:"/assets/global/flags_png/MO-0cb4c6bd0a01fef980609a90a456eeb617f2215674bf80b342feaf43853f3175.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"KZ",name:"Kazakhstan",image:"/assets/global/flags_png/KZ-11089225c353c8c065e1cce14e4c73c32ed3a794d49d549a5a3b72b9b8a50b0b.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"passport",backside_image_required:!1}]},{country:{code:"BF",name:"Burkina Faso",image:"/assets/global/flags_png/BF-24f8033cf685a324be5983f1f831a1f19459059dcb79cdd8b94b6449530ab66f.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"DZ",name:"Algeria",image:"/assets/global/flags_png/DZ-f943da52f45c5d9a85852c5b12ee3c6ce1d9f4df4e24d1b031ef7f225bb1792b.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"CD",name:"Congo, The Democratic Republic Of The",image:"/assets/global/flags_png/CD-af511db089986c5b5609d15e87db2b7256554653b0912458e9cbb8386d6ac342.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"IQ",name:"Iraq",image:"/assets/global/flags_png/IQ-97884b10dc0ddcd42534cb98cc40167a5eb226dea25be9a45c4c530194d5c117.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"LU",name:"Luxembourg",image:"/assets/global/flags_png/LU-ad3c08bc5f6a0ae9400b791531fdb4b02b7648d1358fc367ff7b1fc9d9ff0e19.png"},supported_id_types:[{type:"id_card",backside_image_required:!1},{type:"drivers_licence",backside_image_required:!1},{type:"passport",backside_image_required:!1}]},{country:{code:"FJ",name:"Fiji",image:"/assets/global/flags_png/FJ-503278dfcdcbfa7e2b4d04e03f78af3c7c28c04ea25cdb5375028f5db2dbffc7.png"},supported_id_types:[{type:"passport",backside_image_required:!1}]},{country:{code:"EC",name:"Ecuador",image:"/assets/global/flags_png/EC-8ca5c370182cc69a9befddf30b0bc86247a5906cf3fca8e18ceabad26e71978e.png"},supported_id_types:[{type:"id_card",backside_image_required:!0},{type:"drivers_licence",backside_image_required:!0},{type:"passport",backside_image_required:!1}]}];function xi(e){return function(e){return"object"==typeof e&&null!==e&&"message"in e}(e)?e.message:"unknown-error"}function Si(e,t){return(r,n)=>{(0,M.Kz)(e,Ft({componentType:M.re.content_script,action:M.Us.measurement,loggingId:t,error:xi(r),application_context:"not_set"},n))}}const ki={idvSubmit:(e,t,r,n,i)=>Si("verify_document_error","11913a31-c0e0-42d9-a185-e2f4a05c8439")(e,{context:t,method:r,status_code:n,raw_response:i}),idvProfilePoll:(e,t)=>Si("verify_document_polling_error","0c25266c-ff6c-48e6-9e94-a263b8040e0d")(e,{is_nullish:t}),supportedDocs:e=>Si("supported_docs_fetch_error","4662a90e-32a3-469e-abef-43ecbe6b36bf")(e),idvProfiles:e=>Si("idv_profiles_fetch_error","695070fd-2aa0-4101-8542-d7bfa185e27d")(e),idCaptureLogAnomaly:e=>Si("id_capture_flow_anomaly","026a0cd9-d626-40f5-94e8-24d8687cfe95")(e),createSession:e=>Si("id_capture_create_session_error","92270eb1-38a8-4d29-9369-050c7129d2c1")(e),getSession:e=>Si("id_capture_get_session_error","9e1d17db-9ed3-47e8-9a40-bdfe3b12fea5")(e),submitSession:e=>Si("id_capture_submit_session_error","ec6b6241-794c-4730-a603-44ae49c5ecd7")(e)};function Ei(e,t){const r=e.replace(/[^A-Za-z0-9\+\/]/g,""),n=r.length,i=t?Math.ceil((3*n+1>>2)/t)*t:3*n+1>>2,a=new Uint8Array(i);let o,s,c=0,l=0;for(let e=0;e<n;e++)if(s=3&e,c|=((u=r.charCodeAt(e))>64&&u<91?u-65:u>96&&u<123?u-71:u>47&&u<58?u+4:43===u?62:47===u?63:0)<<18-6*s,3===s||n-e==1){for(o=0;o<3&&l<i;o++,l++)a[l]=c>>>(16>>>o&24)&255;c=0}var u;return a}const Ii=(e,t)=>{if(Array.isArray(e))return e.map((e=>Ii(e,t)));if((0,wt.isPlainObject)(e)){const r={};return Object.keys(e).forEach((n=>{r[t(n)]=Ii(e[n],t)})),r}return e},Ci=Ii,Di=e=>e?Ci(e,(e=>(0,wt.camelCase)(e))):e;function Mi(e){return"object"==typeof e&&null!==e&&"apiClientErrorId"in e&&"message"in e&&"response"in e&&"requestId"in e&&"cfRay"in e&&"statusCode"in e}const ji=({shouldRetry:e})=>t=>{let r=0;return async function n(){let i;try{i=await t()}catch(t){if(await e(t,r))return new Promise((e=>{setTimeout((()=>{r+=1,e(n())}),2**r*1e3)}));throw t}return i}};var Ai,Pi,Oi,Fi,Ui,Ri,Ni,Li,Bi,qi,Vi,Wi,$i,zi,Yi,Hi,Gi,Ki,Zi,Qi,Ji,Xi,ea,ta,ra,na,ia,aa,oa,sa,ca,la,ua,da,pa,fa,ga,ha,ma,ba,ya,_a,va,wa,Ta,xa,Sa,ka,Ea,Ia,Ca,Da,Ma,ja,Aa,Pa,Oa,Fa,Ua,Ra,Na;const La=(Pi=vi((Ai=class{get supportedIdTypes(){let e=null;if(this.supportedIdTypesData){const t=Tt().find(this.supportedIdTypesData,(e=>e.country.code===this.country));t?.supportedIdTypes&&(e=t.supportedIdTypes.slice().reverse())}return e}get facematchRequired(){return"face"===this.forceFacematchType||!!this.eligibilityData?.facematchRequired}get textmatchRequired(){return"text"===this.forceFacematchType||!!this.eligibilityData?.textmatchRequired}get creationType(){return this.textmatchRequired?"textmatch":this.facematchRequired?"face_match":"api_netverify"}get facematchOrTextmatchRequired(){return this.facematchRequired||this.textmatchRequired}get facematchType(){return this.textmatchRequired?"text":this.facematchRequired?"face":void 0}get backsideImageRequired(){if(!this.selectedIdType||!this.supportedIdTypes)return!1;const e=this.supportedIdTypes.find((e=>e.type===this.selectedIdType));return!!e?.backsideImageRequired}get idType(){return Tt().camelCase(this.selectedIdType)}get submissionStatus(){return this.jumioProfileData?.status}get errorMessage(){return this.jumioProfileData?.failureReason?{name:"jumioFailure",message:this.jumioProfileData.failureReason}:this.error}get allowNewSubmission(){return this.submissions<=2}get allowFacematchContinue(){let e;return e=this.backsideImageRequired?!(!this.frontImageData||!this.backImageData):!!this.frontImageData,e}get allowFileUpload(){return!(!this.frontImageData||this.backsideImageRequired&&!this.backImageData||this.facematchOrTextmatchRequired&&!this.faceImageData)}get previewImage(){if(this.preview)return this.faceImageData}get failureCode(){if(this.jumioProfileData?.failureCode)return this.jumioProfileData.failureCode}resetError(){this.error=void 0}unfreeze(){this.preview=!1}reinitializeStore(e){this.resetError(),this.changeStep("loading"),this.webcamDisabled=!!e.webcamDisabled,this.initializeJumioProfileData(e.pendingVerificationId),this.checkMediaDevices()}checkMediaDevices(){navigator.mediaDevices?.enumerateDevices?navigator.mediaDevices.enumerateDevices().then((e=>{e.some((e=>"videoinput"===e.kind))||(this.webcamDisabled=!0)})):(navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia,this.webcamDisabled=!navigator.getUserMedia)}initializeJumioProfileData(e){e?(this.jumioProfileData={id:e},this.step="pendingVerification",this.pollSubmissionStatus()):this.startWidget()}constructor(e){this.onPendingResponse=void 0,_i(this,"step",Pi,this),_i(this,"country",Oi,this),_i(this,"applicationContext",Fi,this),_i(this,"isPhone",Ui,this),_i(this,"legalNameChange",Ri,this),_i(this,"forceFacematchType",Ni,this),_i(this,"allowCountryChange",Li,this),_i(this,"allowMobileUpload",Bi,this),_i(this,"supportedIdTypesData",qi,this),_i(this,"eligibilityData",Vi,this),_i(this,"selectedIdType",Wi,this),_i(this,"timer",$i,this),_i(this,"webcamActive",zi,this),_i(this,"frontImageData",Yi,this),_i(this,"backImageData",Hi,this),_i(this,"faceImageData",Gi,this),_i(this,"preview",Ki,this),_i(this,"jumioProfileData",Zi,this),_i(this,"error",Qi,this),_i(this,"submissions",Ji,this),_i(this,"flashVisible",Xi,this),_i(this,"numberObfuscated",ea,this),_i(this,"recoveryUrl",ta,this),_i(this,"webcamDriverDetected",ra,this),_i(this,"webcamDisabled",na,this),_i(this,"frontWebcamSpoof",ia,this),_i(this,"frontNumSnaps",aa,this),_i(this,"frontBlurryScore",oa,this),_i(this,"frontSnapBlurryScores",sa,this),_i(this,"backWebcamSpoof",ca,this),_i(this,"backNumSnaps",la,this),_i(this,"backBlurryScore",ua,this),_i(this,"backSnapBlurryScores",da,this),_i(this,"faceWebcamSpoof",pa,this),_i(this,"faceNumSnaps",fa,this),_i(this,"faceBlurryScore",ga,this),_i(this,"faceSnapBlurryScores",ha,this),_i(this,"isSubmitting",ma,this),_i(this,"source",ba,this),_i(this,"environment",ya,this),this.client=void 0,this.track=void 0,this.onApiError=void 0,this.blurryDetector=void 0,_i(this,"changeStep",_a,this),_i(this,"setWebcamError",va,this),_i(this,"setError",wa,this),_i(this,"selectIdType",Ta,this),this.logMeasurement=(e,t)=>{let r=t.loggingId,n=jt(t,Ct);this.track(e,Ft({action:M.Us.measurement,componentType:M.re.content_script,loggingId:r},n))},_i(this,"resetWebcamCapture",xa,this),_i(this,"resetImageForWebcamCapture",Sa,this),_i(this,"reset",ka,this),_i(this,"freeze",Ea,this),this.handleWebcamSnapComplete=(e,t,r,n,i)=>{this.faceImageData=e,this.faceWebcamSpoof=t,this.faceNumSnaps=r,this.faceBlurryScore=n,this.faceSnapBlurryScores=i,t&&(this.webcamDriverDetected=t)},_i(this,"snap",Ia,this),_i(this,"snapWithoutTimer",Ca,this),_i(this,"fetchSupportedDocumentTypes",Da,this),_i(this,"fetchEligibility",Ma,this),_i(this,"uploadImage",ja,this),_i(this,"resetIdImage",Aa,this),_i(this,"submitImages",Pa,this),this.clearPollTimer=()=>{clearTimeout(this.pollTimer)},_i(this,"pollSubmissionStatus",Oa,this),_i(this,"markWebcamActive",Fa,this),this.markWebcamActiveOnReady=()=>{this.webcam.onReady((()=>this.markWebcamActive()))},_i(this,"flash",Ua,this),_i(this,"onImageUploadSubmit",Ra,this),_i(this,"startWidget",Na,this),this.handleContinueCapture=()=>{this.onImageUploadSubmit()},this.convertToFormData=(e,t)=>{let r;if("face_image"!==e)r=[e,t];else{0;const n=t.match(/^data:image\/(\w+)/)[1],i=n.replace(/e/,""),a=t.replace(/^data:image\/\w+;base64,/,"");r=[e,new Blob([Ei(a)],{type:`image/${n}`}),`${e}.${i}`]}return r},this.onVerified=void 0,this.webcam=void 0,this.flashUi=void 0,this.isKycFallback=void 0,this.optionalTextmatch=void 0,this.client=e.client,this.track=e.track,this.applicationContext=e.applicationContext||null,this.isPhone=!!e.isPhone,this.onVerified=e.onVerified,this.webcam=e.webcam,this.onApiError=e.onApiError,this.webcam.setError=this.setWebcamError,this.webcamDisabled=!!e.webcamDisabled,this.country=e.country.toUpperCase(),this.legalNameChange=!!e.legalNameChange,this.forceFacematchType=e.forceFacematchType,this.optionalTextmatch=!!e.optionalTextmatch,this.allowCountryChange=!!e.allowCountryChange,this.allowMobileUpload=!!e.allowMobileUpload,this.supportedIdTypesData=Di(Ti),this.submissions=0,this.flashUi=e.flashUi,this.onPendingResponse=e.onPendingResponse,this.isKycFallback=e.isKycFallback||!1,this.blurryDetector=new hi({leaveBreadcrumb:(e,t)=>this.track(e,t),onError:this.onApiError}),this.source=e.source,this.environment=e.environment,"login-web"!==e.source&&this.initializeJumioProfileData(e.pendingVerificationId),this.checkMediaDevices()}}).prototype,"step",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"loading"}}),Oi=vi(Ai.prototype,"country",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Fi=vi(Ai.prototype,"applicationContext",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ui=vi(Ai.prototype,"isPhone",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ri=vi(Ai.prototype,"legalNameChange",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Ni=vi(Ai.prototype,"forceFacematchType",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Li=vi(Ai.prototype,"allowCountryChange",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Bi=vi(Ai.prototype,"allowMobileUpload",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),qi=vi(Ai.prototype,"supportedIdTypesData",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),Vi=vi(Ai.prototype,"eligibilityData",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Wi=vi(Ai.prototype,"selectedIdType",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"drivers_licence"}}),$i=vi(Ai.prototype,"timer",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),zi=vi(Ai.prototype,"webcamActive",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Yi=vi(Ai.prototype,"frontImageData",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Hi=vi(Ai.prototype,"backImageData",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Gi=vi(Ai.prototype,"faceImageData",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Ki=vi(Ai.prototype,"preview",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),Zi=vi(Ai.prototype,"jumioProfileData",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),Qi=vi(Ai.prototype,"error",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){}}),Ji=vi(Ai.prototype,"submissions",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),Xi=vi(Ai.prototype,"flashVisible",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ea=vi(Ai.prototype,"numberObfuscated",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),ta=vi(Ai.prototype,"recoveryUrl",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return null}}),ra=vi(Ai.prototype,"webcamDriverDetected",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),na=vi(Ai.prototype,"webcamDisabled",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ia=vi(Ai.prototype,"frontWebcamSpoof",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),aa=vi(Ai.prototype,"frontNumSnaps",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),oa=vi(Ai.prototype,"frontBlurryScore",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),sa=vi(Ai.prototype,"frontSnapBlurryScores",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),ca=vi(Ai.prototype,"backWebcamSpoof",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),la=vi(Ai.prototype,"backNumSnaps",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),ua=vi(Ai.prototype,"backBlurryScore",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),da=vi(Ai.prototype,"backSnapBlurryScores",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),pa=vi(Ai.prototype,"faceWebcamSpoof",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),fa=vi(Ai.prototype,"faceNumSnaps",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),ga=vi(Ai.prototype,"faceBlurryScore",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return 0}}),ha=vi(Ai.prototype,"faceSnapBlurryScores",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return[]}}),ma=vi(Ai.prototype,"isSubmitting",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return!1}}),ba=vi(Ai.prototype,"source",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"retail"}}),ya=vi(Ai.prototype,"environment",[xt.LO],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return"development"}}),vi(Ai.prototype,"supportedIdTypes",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"supportedIdTypes"),Ai.prototype),vi(Ai.prototype,"facematchRequired",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"facematchRequired"),Ai.prototype),vi(Ai.prototype,"textmatchRequired",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"textmatchRequired"),Ai.prototype),vi(Ai.prototype,"creationType",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"creationType"),Ai.prototype),vi(Ai.prototype,"facematchOrTextmatchRequired",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"facematchOrTextmatchRequired"),Ai.prototype),vi(Ai.prototype,"facematchType",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"facematchType"),Ai.prototype),vi(Ai.prototype,"backsideImageRequired",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"backsideImageRequired"),Ai.prototype),vi(Ai.prototype,"idType",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"idType"),Ai.prototype),vi(Ai.prototype,"submissionStatus",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"submissionStatus"),Ai.prototype),vi(Ai.prototype,"errorMessage",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"errorMessage"),Ai.prototype),vi(Ai.prototype,"allowNewSubmission",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"allowNewSubmission"),Ai.prototype),vi(Ai.prototype,"allowFacematchContinue",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"allowFacematchContinue"),Ai.prototype),vi(Ai.prototype,"allowFileUpload",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"allowFileUpload"),Ai.prototype),vi(Ai.prototype,"previewImage",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"previewImage"),Ai.prototype),vi(Ai.prototype,"failureCode",[xt.Fl],Object.getOwnPropertyDescriptor(Ai.prototype,"failureCode"),Ai.prototype),_a=vi(Ai.prototype,"changeStep",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{if(!wi.includes(e))throw new Error("Unknown step");"success"===e&&this.onVerified&&this.onVerified(),this.step=e}}}),va=vi(Ai.prototype,"setWebcamError",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return(e,t=!0)=>{this.webcamDisabled=t,this.error={name:e.name,message:e.message},this.changeStep("failure")}}}),wa=vi(Ai.prototype,"setError",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.error=e,this.changeStep("failure")}}}),vi(Ai.prototype,"resetError",[xt.aD],Object.getOwnPropertyDescriptor(Ai.prototype,"resetError"),Ai.prototype),Ta=vi(Ai.prototype,"selectIdType",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{this.selectedIdType=e,this.logMeasurement("verify_document_tapped_document_type",{document_type:e,loggingId:"03d007b3-719f-4782-8745-8fd1813f00aa"}),this.track("idv_start_id_selected",{document_type:e,action:M.Us.click,componentType:M.re.button,loggingId:"436cb29f-8c3b-4236-98d6-38ad60215bd9"}),this.changeStep("imageUpload")}}}),xa=vi(Ai.prototype,"resetWebcamCapture",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.unfreeze(),this.resetImageForWebcamCapture()}}}),Sa=vi(Ai.prototype,"resetImageForWebcamCapture",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{if("imageUpload"!==this.step)throw new Error("switch statements should be exhaustive");this.faceImageData=""}}}),ka=vi(Ai.prototype,"reset",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.webcam.reset(),this.webcam.unattach(),clearInterval(this.countdownTimer),clearTimeout(this.snapTimer),this.timer=null,this.unfreeze(),this.frontImageData="",this.backImageData="",this.faceImageData="",this.frontBlurryScore=0}}}),Ea=vi(Ai.prototype,"freeze",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.preview=!0}}}),vi(Ai.prototype,"unfreeze",[xt.aD],Object.getOwnPropertyDescriptor(Ai.prototype,"unfreeze"),Ai.prototype),Ia=vi(Ai.prototype,"snap",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{if(this.timer)return;this.timer=3,this.countdownTimer=setInterval((()=>{(0,xt.z)("snap",(()=>{this.timer=this.timer-1,0===this.timer&&(clearInterval(this.countdownTimer),this.timer=null,this.flashUi&&this.flashUi(),this.freeze())}))}),1e3);this.snapTimer=setTimeout((()=>{this.webcam.snap(5,500,((e,t,r,n,i)=>{this.webcam.unattach(),(0,xt.z)("webcam snap callack",(()=>{this.handleWebcamSnapComplete(e,t,r,n,i)}))}))}),500)}}}),Ca=vi(Ai.prototype,"snapWithoutTimer",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.webcam.snap(5,0,((e,t,r,n,i)=>{this.webcam.unattach(),(0,xt.z)("webcam snap callack",(()=>{this.handleWebcamSnapComplete(e,t,r,n,i),this.freeze()}))}))}}}),Da=vi(Ai.prototype,"fetchSupportedDocumentTypes",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return async()=>{const e=this.applicationContext?`application_context=${this.applicationContext}`:"";try{const t=await this.client.get(`/v2/jumio-profiles/supported-documents/${this.country}?${e}`);(0,xt.z)("fetchSupportedDocumentTypes",(()=>{this.supportedIdTypesData=[t.data]}))}catch(t){if("invalid country_code"===t.message)try{const t=await this.client.get(`/v2/jumio-profiles/supported-documents?${e}`);(0,xt.z)("fetchSupportedDocumentTypes",(()=>{this.supportedIdTypesData=t.data}))}catch(e){ki.supportedDocs(e),this.setError(e)}else ki.supportedDocs(t),this.setError(t)}}}}),Ma=vi(Ai.prototype,"fetchEligibility",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return async()=>{try{const e=await this.client.get("/v2/jumio-profiles/eligibility");(0,xt.z)("fetchEligibility",(()=>{this.eligibilityData=e.data}))}catch(e){this.setError(e),ki.idvProfiles(e)}}}}),ja=vi(Ai.prototype,"uploadImage",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return async(e,t)=>{const r=Tt().get(t,"preview"),n=(await this.blurryDetector.calculateBlurryFromImageUrl(r)).blurry;(0,xt.z)("uploadImage",(()=>{"front"===e?(this.frontImageData=t,this.frontBlurryScore=n):"back"===e?(this.backImageData=t,this.backBlurryScore=n):"face"===e&&(this.faceImageData=t,this.faceBlurryScore=n)}))}}}),Aa=vi(Ai.prototype,"resetIdImage",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return e=>{(0,xt.z)("resetImage",(()=>{switch(e){case"front":this.frontImageData="",this.frontBlurryScore=0;break;case"back":this.backImageData="",this.backBlurryScore=0}}))}}}),Pa=vi(Ai.prototype,"submitImages",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return async()=>{(0,M.KQ)("submit_idv");const e=new FormData;this.legalNameChange&&e.append("legal_name_changed","true"),this.allowCountryChange&&e.append("allow_country_change","true"),this.optionalTextmatch&&e.append("optional_textmatch","true"),e.append("country_code",this.country),e.append("id_type",this.selectedIdType),e.append("capture_method","file"),e.append("webcam_spoof_detected",String(this.webcamDriverDetected)),e.append("front_webcam_spoof",String(this.frontWebcamSpoof)),e.append("front_num_snaps",String(this.frontNumSnaps)),e.append("front_variance",String(this.frontBlurryScore)),e.append("front_snap_blurry_scores",JSON.stringify(this.frontSnapBlurryScores)),e.append("back_webcam_spoof",String(this.backWebcamSpoof)),e.append("back_num_snaps",String(this.backNumSnaps)),e.append("back_variance",String(this.backBlurryScore)),e.append("back_snap_blurry_scores",JSON.stringify(this.backSnapBlurryScores)),e.append("face_webcam_spoof",String(this.faceWebcamSpoof)),e.append("face_num_snaps",String(this.faceNumSnaps)),e.append("face_variance",String(this.faceBlurryScore)),e.append("face_snap_blurry_scores",JSON.stringify(this.faceSnapBlurryScores)),e.append("creation_type",this.creationType);const t=this.convertToFormData("front_image",this.frontImageData);if(e.append(...t),this.backsideImageRequired){const t=this.convertToFormData("back_image",this.backImageData);e.append(...t)}if(this.facematchOrTextmatchRequired){const t=this.convertToFormData("face_image",this.faceImageData);e.append(...t)}e.append("is_kyc_fallback",String(this.isKycFallback)),this.track("verify_document_upload_attempt",{action:M.Us.click,componentType:M.re.button,loggingId:"2723d174-e608-47a4-8d2a-305854d8b5c9"});const r=ji({shouldRetry:(e,t)=>Mi(e)&&"generic-error"===e.apiClientErrorId&&t<3})((()=>this.client.post("/v2/jumio-profiles",e)));let n;try{n=await r(),(0,M.KQ)("idv_submitted"),this.logMeasurement("verify_document_uploaded_success",{loggingId:"e0c5d97d-64ce-4ee1-bd33-5d8de75d3547",method:"file",status:n.data.status})}catch(e){this.error={name:"submitImagesError",message:e.message},ki.idvSubmit(e,"onboarding","file",Mi(e)?e.statusCode:void 0,Mi(e)?String(e.response):void 0),this.changeStep("failure")}n&&(this.jumioProfileData=n.data,this.onPendingResponse&&this.onPendingResponse(this.jumioProfileData),this.submissions=++this.submissions,this.pollSubmissionStatus())}}}),Oa=vi(Ai.prototype,"pollSubmissionStatus",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return async()=>{let e;try{e=await this.client.get(`/v2/jumio-profiles/${this.jumioProfileData.id}`)}catch(e){ki.idvProfilePoll(e,!!this.jumioProfileData?.id),this.setError({name:"pollSubmissionStatusError",message:e.message})}if(e){this.jumioProfileData=e.data;const t=this.jumioProfileData.status;"completed"===t?this.changeStep("success"):"success_pending_choice"===t?window.location.href="/verifications/documents/change_country":"failed"===t?this.changeStep("failure"):"falling_back"===t?this.changeStep("fallingBack"):this.pollTimer=setTimeout(this.pollSubmissionStatus,1e4)}}}}),Fa=vi(Ai.prototype,"markWebcamActive",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return()=>{this.webcamActive=!0}}}),Ua=vi(Ai.prototype,"flash",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return(e=250)=>{this.flashVisible=!0,setTimeout((()=>{(0,xt.z)("flash",(()=>{this.flashVisible=!1}))}),e)}}}),Ra=vi(Ai.prototype,"onImageUploadSubmit",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return async()=>{try{this.isSubmitting=!0,await this.submitImages()}catch(e){this.onApiError(e)}finally{this.isSubmitting=!1}"failure"!==this.step&&this.changeStep("pendingVerification")}}}),Na=vi(Ai.prototype,"startWidget",[xt.aD],{configurable:!0,enumerable:!0,writable:!0,initializer:function(){return async()=>{try{await Promise.all([this.fetchSupportedDocumentTypes(),this.fetchEligibility()]),this.error||this.changeStep("idType")}catch(e){this.setError(e)}}}}),vi(Ai.prototype,"reinitializeStore",[xt.aD],Object.getOwnPropertyDescriptor(Ai.prototype,"reinitializeStore"),Ai.prototype),Ai),Ba=e=>e.toLowerCase().split(/[_-]+/)[0]||"en",qa=["es-AR","es-CL","es-CO","es-CR","es-EC","es-mx","es-NI","es-PA","es-PE","es-US","es-VE"],Va=e=>qa.some((t=>t.toLowerCase()===e.toLowerCase()))?"es-LA":"es"===e?"es-ES":"pt"===e?"pt-BR":Ba(e),Wa=["es-LA","pt-PT","de","en","es","fr","ja","it","nl","pl","pt","ru","th","tr"];const $a=()=>(Et.get("coinbase_locale")||(()=>{let e;if(e=navigator.languages&&navigator.languages.length>0?navigator.languages[0]:navigator.language||navigator.userLanguage,e&&!Wa.includes(e)){const r=Va(e);return t=r,Wa.includes(t)?r:null}return e;var t})()||"en").toLowerCase(),za="https://coinbase-dev.cbhq.net/api",Ya="https://www.coinbase.com/api",Ha=()=>{localStorage.clear(),window.location.reload()};class Ga{static constructQueryString(e){const t=(0,wt.omitBy)(e,(e=>null==e));return(0,wt.map)(t,((e,t)=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`)).join("&")}static constructRoute(e,t){const r=Ga.constructQueryString(t);return`${e}${r&&`?${r}`}`}static setApiUrl(e){this.defaultUrl=e?Ya:za}constructor(e){this.baseUrl=void 0,this.cbVersion=void 0,this.cbClient=void 0,this.userLocale=void 0,this.jwtToken=void 0,this.onUnauthorized=void 0,this.getAcceptLanguage=()=>this.userLocale||$a(),this.setUserLocale=e=>this.userLocale=e,this.setJWT=e=>this.jwtToken=e,this.fetch=(e,t,r,n,i)=>{let a,o,s;if("GET"===t){const t=r?Ga.constructQueryString(r):"";o=`${e}${e.includes("?")?"&":"?"}${t}`}else"POST"!==t&&"PUT"!==t||(r instanceof FormData?a=r:(a=JSON.stringify(r),s="application/json"));const c=new Headers(Ft(Ft({Accept:"application/json","Accept-Language":this.getAcceptLanguage(),"CB-VERSION":this.cbVersion,"CB-CLIENT":this.cbClient},n),(0,M.zy)()));s&&c.set("Content-Type",s),this.jwtToken&&c.set("Authorization",`JWT ${this.jwtToken}`),this.deviceFingerprint&&c.set("CB-FP",this.deviceFingerprint),this.newStyleDeviceFingerprint&&c.set("CB-FP2",this.newStyleDeviceFingerprint);let l=null,u=null,d=null;return new Promise(((r,n)=>{fetch(this.baseUrl+(o||e),{method:t,body:a,headers:c,redirect:"follow",credentials:"include"}).then((e=>{if(204===e.status)return r(null);u=Ka(e.headers,"x-request-id"),d=Ka(e.headers,"cf-ray");const t={requestId:u,cfRay:d},n=e.json();return l=e.status,e.status>=200&&e.status<300?n.then((e=>i.preserveKeyNames?r(Ft({headers:t},e)):r(Ft({headers:t},Di(e))))):n.then((e=>{throw e}))})).catch((e=>{let t;if(e?.errors){const r=e.errors[0],n=r.message,i=jt(r,Dt);t=Ft({message:n,response:e,statusCode:l,requestId:u,cfRay:d},i)}else t={message:"Something went wrong, please try again.",response:e,requestId:u,cfRay:d,statusCode:l};const r=e?.errors,a=r?r[0].id:void 0;["expired_token","invalid_token"].includes(a)&&this.onUnauthorized(a),i.preserveKeyNames?n(t):n(Di(t))}))}))},this.post=(e,t,r={},n={})=>this.fetch(e,"POST",t,r,n),this.put=(e,t,r={},n={})=>this.fetch(e,"PUT",t,r,n),this.get=(e,t,r={},n={})=>this.fetch(e,"GET",t,r,n),this.delete=(e,t,r={},n={})=>this.fetch(e,"DELETE",t,r,n),this.baseUrl=this.constructor.defaultUrl,this.cbVersion=e.cbVersion||"2016-08-01",this.cbClient=e.cbClient,this.jwtToken=e.jwtToken,this.onUnauthorized=e.onUnauthorized||Ha}get deviceFingerprint(){return Et.get("df")}get newStyleDeviceFingerprint(){return Et.get("df2")}}function Ka(e=new Headers({}),t){const r=e.get(t)??"";return Array.isArray(r)?r[0]||"":r}Ga.defaultUrl=za;let Za;const Qa=(e,t,r,n)=>{if(Za)return r&&Za.setJWT(r),Za;const i={cbVersion:"2018-06-18",cbClient:"CoinbaseWeb",jwtToken:r,onUnauthorized:n};return Ga.setApiUrl(e),Za=new Ga(i),Za.setUserLocale(t),Za},Ja=(e,t)=>!!e&&(e>=.6&&"front"===t);function Xa(){const e=(0,P.Z)().formatMessage;return(0,s.jsx)(gt.TextBody,{as:"p",align:"center",children:e(zt.kycFallback)})}const eo=(0,it.Pi)((function(e){let t=e.countryCode,r=e.locale,i=e.forceFacematchType,a=e.noBorder,c=e.onRetry,l=e.skipSuccessViewAndDo,u=e.isKycFallback,d=void 0!==u&&u,p=e.showExplanation,f=e.skipPendingViewAndDo,g=e.track,h=e.applicationContext,m=e.flashUi,b=e.client,y=e.onContinue,_=e.onApiError,v=e.isVariant,w=e.environment,T=e.source,x=e.loader,S=e.noMinWidth,k=e.compact,E=jt(e,Mt);const I=(0,ft.kC)().isPhone,C=(0,n.useCallback)(((e,t,r)=>{g(e,Ft(Ft({},t),{},{id_capture_source:T||"none",is_unified_idv:!0,face_match:i||"none",request_source:h||"none"}),r)}),[T,g,h,i]),D=yi((()=>new La(Ft(Ft({webcam:new bi({leaveBreadcrumb:(e,t)=>C(e,t),onError:_})},E),{},{isKycFallback:d,isPhone:I,forceFacematchType:i,applicationContext:h,client:b??Qa("production"===w,r),track:C,flashUi:m?()=>m(650):()=>D.flash(650),onApiError:_,country:t,environment:w||"development",source:T||"retail"}))));(0,n.useEffect)((()=>(C("verify_document_viewed",{action:M.Us.render,componentType:M.re.page,loggingId:"3f44e68f-795a-4a34-931b-4657822a3ffb"}),()=>{D.clearPollTimer()})),[]),(0,n.useEffect)((()=>{"pendingVerification"===D.step&&f&&f(),"success"===D.step&&l&&l()}),[l,f,D.step]);const j=(0,n.useCallback)((()=>{c?.(D.failureCode),D.reinitializeStore({webcamDisabled:D.webcamDisabled,pendingVerificationId:null})}),[c,D]),A=(0,n.useCallback)((()=>{D.changeStep("idType")}),[D]),P=(0,n.useCallback)((()=>(0,s.jsx)(Zr,{isInUS:"US"===t,onSelect:e=>D.selectIdType(e),supportedIdTypes:D.supportedIdTypes,noMinWidth:!!S})),[t,D,S]),O=(0,n.useCallback)((()=>(0,s.jsx)($r,{error:D.errorMessage,onRetry:j,source:T})),[D.errorMessage,j,T]),F=(0,n.useCallback)((()=>{y?.()}),[y]),U=(0,n.useCallback)((()=>(0,s.jsx)(mn,{onContinue:F})),[F]),R=(0,n.useCallback)((()=>(0,s.jsx)(Kt,{maintainHeight:!0,children:(0,s.jsx)(lt.Box,{flexGrow:1,alignItems:"center",justifyContent:"center",minWidth:150,minHeight:150,height:"100%",children:x||(0,s.jsx)(st.Spinner,{size:3})})})),[x]),N=(0,n.useCallback)((()=>Ja(D.frontBlurryScore,"front")),[D.frontBlurryScore]),L=(0,n.useCallback)((({side:e})=>(0,s.jsx)(Br,{track:C,webcam:D.webcam,webcamActive:D.webcamActive,side:e,preview:D.preview,previewImage:D.previewImage,onCapture:D.snap,timer:D.timer,continueCapture:D.handleContinueCapture,retryCapture:D.resetWebcamCapture,isSubmitting:D.isSubmitting,source:T})),[C,D.handleContinueCapture,D.isSubmitting,D.preview,D.previewImage,D.resetWebcamCapture,D.snap,D.timer,D.webcam,D.webcamActive,T]),B=D.backImageData,q=(0,n.useCallback)((()=>(0,s.jsx)(on,{imageCaptureView:D.facematchType?L({side:D.facematchType}):null,track:C,idType:D.selectedIdType,backImageRequired:D.backsideImageRequired,facematchType:D.facematchType,frontImage:D.frontImageData,backImage:B,showFrontBlurryMessage:N(),allowContinue:D.allowFacematchContinue,allowSubmit:D.allowFileUpload,onUpload:D.uploadImage,onSubmit:D.onImageUploadSubmit,onGoBack:()=>{D.reset(),A()},isSubmitting:D.isSubmitting,onRenderWebcam:D.markWebcamActiveOnReady})),[D,L,C,N,A,B]),V=(0,n.useMemo)((function(){let e=(0,s.jsx)(s.Fragment,{});switch(D.step){case"loading":e=R();break;case"idType":C("verify_document_select_document_type_viewed",{action:M.Us.render,componentType:M.re.page,loggingId:"c0501088-9de5-4884-a258-262ff4eaadc6"}),e=P();break;case"imageUpload":C("verify_document_file_upload_viewed",{action:M.Us.render,componentType:M.re.page,loggingId:"6e5757d5-a207-4595-8ff8-02657d46ce6f"}),e=q();break;case"pendingVerification":if(C("verify_document_verification_pending",{action:M.Us.view,componentType:M.re.page,loggingId:"c27212af-0097-4145-8142-a1ff8222c20d",method:D.recoveryUrl?"qr-code":"text-message"}),f)break;e=(0,s.jsx)(ir,{});break;case"fallingBack":C("verify_document_viewed_fallback",{action:M.Us.render,componentType:M.re.page,loggingId:"97d05221-eedc-42d2-8850-107a9da92c44"}),e=(0,s.jsx)(ir,{fallback:!0});break;case"success":if(C("verify_document_viewed_success",{action:M.Us.render,componentType:M.re.page,loggingId:"beafd607-9664-45b8-8593-f35ba886d369"}),l)break;e=U();break;case"failure":C("verify_document_viewed_failure",{action:M.Us.render,componentType:M.re.page,loggingId:"bde8f8a1-6b57-4e1d-95ac-e7a9ba29890e",error:D.error?D.error.name:"No reason given"}),e=O();break;default:{const t=D.step;ki.idCaptureLogAnomaly(new Error(`Unhandled step ${t}`)),e=(0,s.jsxs)("div",{children:["Unhandled step: ",(0,s.jsx)("code",{children:D.step})]})}}return e}),[O,P,q,R,f,l,D.error,D.step,U,C,D.recoveryUrl]);return(0,s.jsx)(fi,{compact:k,locale:r,children:(0,s.jsxs)(o.VStack,{justifyContent:"center",alignItems:"center",testID:"identity-id-capture",children:[p&&"idType"===D.step&&(0,s.jsx)(lt.Box,{maxWidth:"575px",spacingBottom:3,children:(0,s.jsx)(Xa,{})}),"login-web"===T&&(0,s.jsx)(Jr,{environment:w,onStartWidget:D.startWidget}),(0,s.jsx)(to,{isVariant:v,flash:D.flashVisible,noBorder:a,isPhone:I,noMinWidth:S,children:V})]})})})),to=ct.ZP.div`
  display: flex;
  align-items: flex-start;
  align-self: stretch;
  position: relative;
  justify-content: center;
  ${({isPhone:e,noMinWidth:t})=>e||t?"":"min-width: 630px"};
  width: 100%;
  background-color: ${({theme:e,isVariant:t})=>!t&&e.color.background};

  overflow: hidden;
  padding-top: ${({isVariant:e})=>e?"24px":"0"};

  font-family: ${({theme:e})=>e.fontFamily.regular};
  font-weight: ${({theme:e})=>e.fontWeight.regular};
  -moz-osx-font-smoothing: grayscale;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;

  transition: filter 0.1s ease-in-out;

  ${({flash:e})=>e?"filter: opacity(0);":""}
  ${({noBorder:e,theme:t,isPhone:r})=>r||e?"":`${t.border.border};`}
  ${({isPhone:e})=>e?"align-self: stretch;":""}
`,ro=eo;let no;!function(e){e.UNKNOWN="UNKNOWN",e.INACTIVE="INACTIVE",e.INITIATED="INITIATED",e.PENDING="PENDING",e.ACTIVE="ACTIVE",e.ENABLED="ENABLED",e.ACTIVATED="ACTIVATED",e.CANCELLED="CANCELLED",e.DELETED="DELETED",e.DISABLED="DISABLED",e.NEW="NEW",e.SUCCESS_PENDING_CHOICE="SUCCESS_PENDING_CHOICE",e.COMPLETED="COMPLETED",e.FAILED="FAILED",e.FALLING_BACK="FALLING_BACK",e.CONSUMED="CONSUMED"}(no||(no={}));function io(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function ao(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?io(Object(r),!0).forEach((function(t){oo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):io(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function oo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const so=()=>`${H}/api/two-factor/v1/idv/activate`;var co=r(1241),lo=r(44),uo=r(1186),po=r(1223),fo=r(2157),go=r(1086);const ho=r.p+"af6cf0e9790a3863.png";var mo=r(7993),bo=r(7994),yo=r(7995);const _o=["children","target"],vo=["size"],wo=["size"],To=["twoFactorType"],xo=["children"],So=["alternateTwoFactorOptions","troubleshootOption"],ko=["step"];function Eo(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],c=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){l=!0,i=e}finally{try{if(!c&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(l)throw i}}return s}}(e,t)||function(e,t){if(!e)return;if("string"==typeof e)return Io(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Io(e,t)}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Io(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function Co(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},a=Object.keys(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(n=0;n<a.length;n++)r=a[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}function Do(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function Mo(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Do(Object(r),!0).forEach((function(t){jo(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Do(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function jo(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const Ao=(0,n.memo)((function(e){return(0,s.jsx)(o.Box,Mo({flexDirection:"column",flexGrow:1,width:"100%",maxWidth:448},e))})),Po="1.5.0",Oo="@cbhq/two-factor-web";const Fo=function(e){const t=(0,n.createContext)(e);return{ClientPropsContext:t,ClientPropsProvider:(0,n.memo)((function({clientProps:e,children:r}){return(0,s.jsx)(t.Provider,{value:e,children:r})}))}}({onSuccess:C,onToast:C,onCancel:C,action:""}),Uo=Fo.ClientPropsContext,Ro=Fo.ClientPropsProvider,No={TwoFactorClickButton:{label:"two_factor_click_button",loggingId:"cfb55774-900c-459e-aaf7-7459738cdd40"},TwoFactorErrorBoundaryLoad:{label:"two_factor_error_boundary_load",loggingId:"d4f16703-464b-447b-8461-e30b9586b6aa"},TwoFactorLoad:{label:"two_factor_load",loggingId:"c653579e-f193-499f-bf04-9169c6778142"},TwoFactorRequest:{label:"two_factor_request",loggingId:"9d3e263d-7156-4bec-909b-2a46e4ec6e52"},TwoFactorSubmit:{label:"two_factor_submit",loggingId:"e77e1e97-c309-4cde-9a43-4aef71f279a6"},TwoFactorClickHelpOption:{label:"two_factor_click_help_option",loggingId:"201c180c-cda6-47e0-90dc-2eaf9b8c747f"},TwoFactorIdvProgress:{label:"two_factor_idv_progress",loggingId:"d50b8ac6-557f-4031-b62d-ec0eee555c96"},TwoFactorIdvActivate:{label:"two_factor_idv_activate",loggingId:"1365f6ea-cf0e-4f01-8f92-357fc6e931db"},TwoFactorIdvCancel:{label:"two_factor_idv_cancel",loggingId:"0593edc6-fbf1-4f7f-a37c-4df41f267ff8"},TwoFactorIdvStatus:{label:"two_factor_idv_status",loggingId:"8476bd59-413d-473b-81da-810978ae918e"},TwoFactorIdvInvalidate:{label:"two_factor_idv_invalidate",loggingId:"86a17da9-9fe0-459e-b1ac-0b10256c902f"},TwoFactorIdCaptureError:{label:"two_factor_id_capture_error",loggingId:"6ad7caf7-a88a-4c6d-9e28-f6e190a14244"},TwoFactorUnauthorized:{label:"two_factor_unauthorized",loggingId:"b8c9ff14-1801-40ea-bc2d-a7663a07c2dc"},TwoFactorTryAnotherWayOptions:{label:"two_factor_try_another_way_options",loggingId:"57d1918e-abc1-4b13-baec-63c48544a6f4"},TwoFactorFeatureFlags:{label:"two_factor_feature_flags",loggingId:"16154699-9737-4469-83cb-4394e9e4039c"},TwoFactorGeneralError:{label:"two_factor_general_error",loggingId:"0112e5fc-88d7-4472-89fe-9ba540e38224"}};let Lo=function(e){return e.TryAnotherWay="try_another_way",e.RecoveryOption="recovery_option",e.CloseTryAnotherWay="close_try_another_way",e.NeedHelp="need_help",e.CloseNeedHelp="close_need_help",e.ResendChallenge="resend_challenge",e.ReloadTwoFactor="reload_two_factor",e.Back="back",e.U2FVerify="u2f_verify",e.DVOpenInbox="dv_open_inbox",e.IdvRestart="idv_restart",e.IdvCancel="idv_cancel",e.IdvSavePin="idv_save_pin",e.IdvSavePinConfirm="idv_save_pin_confirm",e.PushTryAgain="push_try_again",e.PushOpenFAQ="push_open_faq",e.WalletProvider="wallet_provider",e}({}),Bo=function(e){return e.NeedHelp="need_help",e.TryAnotherWay="try_another_way",e}({}),qo=function(e){return e.DVTroubleshoot="dv_troubleshoot",e.DVUpdateEmailLegacy="dv_update_email_legacy",e.DVUpdateEmail2dot0="dv_update_email_2.0",e.SMSTroubleshoot="sms_troubleshoot",e.SMSUpdatePhoneNumberLegacy="sms_update_phone_number_legacy",e.SMSUpdatePhoneNumber2dot0="sms_update_phone_number_2.0",e.TOTPTroubleshoot="totp_troubleshoot",e.TOTPUpdateAuthenticatorAppLegacy="totp_update_authenticator_app_legacy",e.TOTPUpdateAuthenticatorApp2dot0="totp_update_authenticator_app_2.0",e.U2FTroubleshoot="u2f_troubleshoot",e.U2FUpdateKeySupport="u2f_update_key_support",e.U2FUpdateKey2dot0="u2f_update_key_2.0",e.PushTroubleshoot="push_troubleshoot",e.WalletTroubleshoot="wallet_troubleshoot",e.EmailTroubleshoot="email_troubleshoot",e.PasswordTroubleshoot="password_troubleshoot",e.SwitchToSMS="switch_to_sms",e.SwitchToTOTP="switch_to_totp",e.SwitchToIDV="switch_to_idv",e.SwitchToPush="switch_to_push",e.SwitchToWallet="switch_to_wallet",e.SwitchToEmail="switch_to_email",e.SwitchToSecurityQuestions="switch_to_security_questions",e}({}),Vo=function(e){return e.IdvStatusMissing="idv_status_missing",e.IdvStarted="idv_started",e.IdvChallenged="idv_challenged",e.IdCaptureStarted="id_capture_started",e.IdCaptureComplete="id_capture_complete",e.IdvActivated="idv_activated",e.RecoveryCodeIssued="recovery_code_issued",e.RecoveryCodeRequested="recovery_code_requested",e.RecoveryCodeProvided="recovery_code_provided",e.ReturnToIdv="return_to_idv",e.IdvProcessing="idv_processing",e.IdvComplete="idv_complete",e}({});function Wo(e){return"string"==typeof e}function $o(){return(0,n.useContext)(Uo)}const zo={mockConfig:ae},Yo=Mo(Mo({},v),zo),Ho=function(e){const t=b(b(b({},e),d[v.target]),v),r=(0,n.createContext)(t);return{TwoFactorGlobalConfigContext:r,TwoFactorGlobalConfigProvider:(0,n.memo)((function(e){let i=e.children,a=e.target,o=void 0===a?v.target:a,c=e.onBoundaryError,l=void 0===c?v.onBoundaryError:c,u=e.featureFlags,f=void 0===u?v.featureFlags:u,m=h(e,g);const y=(0,n.useMemo)((()=>b(b(b(b({},t),m),d[o]),{},{target:o,onBoundaryError:l,featureFlags:b(b({},v.featureFlags),f)})),[o,l,f,m]);return(0,p.s)(y.apiHost),(0,s.jsx)(r.Provider,{value:y,children:i})}))}}(zo),Go=Ho.TwoFactorGlobalConfigContext,Ko=Ho.TwoFactorGlobalConfigProvider,Zo=(0,n.memo)((function(e){let t=e.children,r=e.target,n=void 0===r?Yo.target:r,i=Co(e,_o);var a;return a=d[n].apiHost,H=a,(e=>{G=e})(d[n].apiHost),(0,s.jsx)(Ko,Mo(Mo({target:n},i),{},{children:t}))}));function Qo(){return(0,n.useContext)(Go)}const Jo="u2fa";function Xo(){const e=$o().action,t=Qo(),r=t.target,i=function({target:e,version:t,clientId:r,action:i}){const a=(0,n.useCallback)(((n,a)=>B(B({},a),{},{loggingId:n.loggingId,target:e,client_id:r,client_action:i,version:t})),[e,t,r,i]);return{logEvent:(0,n.useCallback)(((e,t,r)=>{(0,M.Kz)(e.label,a(e,t),r)}),[a]),logMetric:(0,n.useCallback)(((e,t=!1,n)=>{const a={client_id:r,client_action:i};(0,M.HR)({metricName:`${e}`,metricType:M.t0.count,value:1,tags:t?B(B({},a),n):void 0})}),[i,r]),getChallengeEventMetadata:(0,n.useCallback)((e=>{const t=e.secondFactorType;switch(void 0===t?w.Y6.TYPE_UNSPECIFIED:t){case w.Y6.SMS:return{provider_name:e.sms?.providerName??""};case w.Y6.DEVICE_VERIFICATION:return{status_id:e.deviceVerification?.statusId??"",trusted:e.deviceVerification?.trusted??""};case w.Y6.IDV:return{country_code:e.idv?.countryCode??""};case w.Y6.PUSH:return{status_id:e.push?.statusId??""};default:return}}),[])}}({clientId:t.clientId,target:r,version:Po,action:e}),a=i.getChallengeEventMetadata,o=i.logEvent,s=i.logMetric;return{logEvent:o,logMetric:(0,n.useCallback)(((e,t)=>{s(`${Jo}.${e}`,!0,t)}),[s]),getChallengeEventMetadata:a}}function es(e){const t=Qo().featureFlags;return(0,n.useMemo)((()=>t[e]??!1),[t,e])}function ts(){const e=$o(),t=e.constraints,r=e.statusId,i=e.action,a=es(j.T9.PasswordEnabled),o=(0,n.useMemo)((()=>{const e=[];return a||e.push(j.QA.Password),e}),[a]);return(0,n.useMemo)((()=>{t?.mode===j.Fw.Allow?t.types=t.types.filter((e=>!o.includes(e))):t?.mode===j.Fw.Disallow&&o.forEach((e=>{t.types.includes(e)||t.types.push(e)}));return{statusId:r,action:i,constraints:t&&{mode:S[t.mode],types:t.types.map((e=>T[e]))}}}),[t,r,i,o])}const rs=(0,A.vU)({u2fIncompatibleBrowser:{id:"TwoFactorError.u2fIncompatibleBrowser",defaultMessage:"Security keys are not available in your current browser. Please try another browser or update your browser version.",description:"Error when attempting to use security keys on an incompatible or outdated browser"},u2fTimeoutOrDisallowed:{id:"TwoFactorError.u2fTimeoutOrDisallowed",defaultMessage:"Try your security key again or check that you are using the right one.",description:"Error when security key validation times out or is otherwise disallowed"},walletConnectionFailed:{id:"TwoFactorError.walletConnectionFailed",defaultMessage:"Connection with wallet was unsuccessful",description:"Error when Coinbase was not able to connect to the user’s wallet"},walletSignatureDenied:{id:"TwoFactorError.walletSignatureDenied",defaultMessage:"Message was not signed",description:"Error when the message failed to be signed by the user’s wallet"}});function ns(){const e=(0,P.Z)().formatMessage,t=W((0,n.useCallback)((t=>{switch(t){case be.D1.U2FIncompatibleBrowser:return e(rs.u2fIncompatibleBrowser);case be.D1.U2FTimeoutOrDisallowed:case be.D1.U2FFetchPublicKeyError:case be.D1.U2FMissingCredentialsError:case be.D1.U2FUnknowError:case be.D1.U2FCredentialError:return e(rs.u2fTimeoutOrDisallowed);case be.D1.WalletConnectionFailed:return e(rs.walletConnectionFailed);case be.D1.WalletSignatureDenied:return e(rs.walletSignatureDenied);default:return}}),[e])),r=t.parseTwoFactorApiError,i=t.getTwoFactorError;return{parseTwoFactorApiError:r,getTwoFactorError:(0,n.useCallback)(((e,t)=>Mo(Mo({},i(e)),{},{error:t})),[i])}}function is(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=Eo((0,n.useState)(),2),c=s[0],l=s[1],u=(0,U.Lo)(),d=ts(),p=ns().parseTwoFactorApiError;return{loading:t,error:a,challengeMetadata:c,challengeTwoFactor:(0,n.useCallback)((async e=>{r(!0);const t=await u(Mo(Mo({},d),e));if(r(!1),t instanceof Error){const e=p(t);return o(e),void l(void 0)}return o(void 0),l(t),t}),[u,d,p]),resetState:(0,n.useCallback)((()=>{r(!1),o(void 0),l(void 0)}),[])}}function as(){const e=$o(),t=e.onError,r=e.onToast,i=(0,n.useCallback)(((e,t)=>{t&&r({type:j.k.Error,message:e.message})}),[r]);return{handleError:(0,n.useCallback)(((e,r=!0)=>{t?t(e,(e=>i(e,!!r))):i(e,!!r)}),[t,i])}}const os=[{name:"Windows",value:"Win"},{name:"iPhone",value:"iPhone"},{name:"iPad",value:"iPad"},{name:"Android",value:"Android"},{name:"Mac OS",value:"Mac"},{name:"Linux",value:"Linux"},{name:"Palm",value:"Palm"}],ss=[{name:"Chrome",value:"Chrome"},{name:"Chrome",value:"CriOS"},{name:"Firefox",value:"Firefox"},{name:"Firefox",value:"FxiOS"},{name:"Safari",value:"Safari"},{name:"Internet Explorer",value:"MSIE"},{name:"Opera",value:"Opera"},{name:"Mozilla",value:"Mozilla"}];function cs(e,t){for(const r of t){if(new RegExp(r.value,"i").test(e))return r.name}return""}function ls(e){const t=(0,n.useMemo)((()=>{const e=[navigator.platform,navigator.userAgent,navigator.appVersion,navigator.vendor].join(" ");return{os:cs(e,os),browser:cs(e,ss)||"Unknown"}}),[]),r=t.browser,i=t.os,o=$o().config,s=(0,a.Ge)().account,c=(0,n.useMemo)((()=>`${r}${i?` (${i})`:""}`),[r,i]);return(0,n.useMemo)((()=>{const t=(o?.push??{}).templateName,r=void 0===t?"":t;switch(e){case w.Y6.PUSH:return{push:{device:c,pushTemplateId:r}};case w.Y6.WALLET:return{wallet:{address:s??""}};default:return{}}}),[c,e,o,s])}function us({enabledTwoFactorIndex:e,twoFactorMethodIndex:t}){const r=function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=Eo((0,n.useState)(),2),c=s[0],l=s[1],u=(0,U.CM)(),d=ts(),p=ns(),f=p.getTwoFactorError,g=p.parseTwoFactorApiError,h=Xo().logEvent;return{loading:t,error:a,enabledTwoFactorOptions:c,getEnabledTwoFactor:(0,n.useCallback)((async()=>{r(!0);const e=await u(d);if(r(!1),e instanceof Error){const t=g(e);return t.type===be.D1.Unauthorized&&h(No.TwoFactorUnauthorized,{action:M.Us.view,componentType:M.re.page,result:j.x4.Failure}),o(t),void l(void 0)}const t=e.enabledTypes,n=t?.every((({methods:e})=>e?.every((e=>e.type!==w.Y6.TYPE_UNSPECIFIED))));if(n)o(void 0),l(t);else{const e=f(be.D1.UnknownError);o(e),l(void 0)}}),[u,d,g,f,h])}}(),i=r.loading,a=r.error,o=r.enabledTwoFactorOptions,s=r.getEnabledTwoFactor,c=(0,n.useMemo)((()=>o?.[e]),[o,e]),l=(0,n.useMemo)((()=>c?.methods?.[t]),[c,t]);return{loadingEnabled:i,enabledError:a,enabledTwoFactorOptions:o,getEnabledTwoFactor:s,enabledTwoFactor:c,twoFactorMethod:l}}function ds({currentTwoFactorEventData:e,twoFactorType:t,advanceTwoFactorMethod:r}){const i=Xo(),a=i.logEvent,o=i.logMetric,s=as().handleError,c=(0,n.useCallback)(((r,n)=>{t&&a(No.TwoFactorSubmit,Mo(Mo(Mo(Mo({},function(e){switch(e){case w.Y6.NO_2FA:case w.Y6.BYPASS:case w.Y6.DEVICE_VERIFICATION:case w.Y6.IDV:case w.Y6.PUSH:return{action:M.Us.render,componentType:M.re.page};case w.Y6.SMS:case w.Y6.TOTP:case w.Y6.RECOVERY_CODE:case w.Y6.EMAIL:return{action:M.Us.keyPress,componentType:M.re.text_input};case w.Y6.U2F:case w.Y6.WALLET:return{action:M.Us.click,componentType:M.re.button};default:return(0,M.Kz)(No.TwoFactorGeneralError.label,{action:M.Us.measurement,componentType:M.re.page,loggingId:No.TwoFactorGeneralError.loggingId,message:`Invalid event data: unspecified action and componentType for ${e}`}),{action:M.Us.measurement,componentType:M.re.page}}}(t)),n&&{error_type:n}),e),{},{result:r}),M.E3.high)}),[t,e,a]),l=(0,n.useCallback)((e=>{o("verify",{result:e,method:t??"unknown"})}),[o,t]);return{handleVerifySuccess:(0,n.useCallback)((e=>{c(j.x4.Success),l(j.x4.Success),r(e)}),[c,l,r]),handleVerifyError:(0,n.useCallback)(((e,t)=>{c(j.x4.Failure,e.type),l(j.x4.Failure),s(e,t)}),[s,c,l])}}const ps={twoFactorMethodIndex:0,enabledTwoFactorIndex:0,setEnabledTwoFactor:C,loadingChallenge:!1,loadingEnabled:!1,challengeTwoFactor:async()=>{},handleChallengeError:I,getEnabledTwoFactor:I,handleVerifySuccess:C,handleVerifyError:I},fs=(0,n.createContext)(ps),gs=(0,n.memo)((function({children:e}){const t=function(){const e=Eo((0,n.useState)({enabledTwoFactorIndex:0,twoFactorMethodIndex:0,proofTokens:[]}),2),t=e[0],r=e[1],i=(0,n.useCallback)(((e,t,n)=>{r((r=>{const i=r.proofTokens.length===t;if(!t||i)return r;let a=r.twoFactorMethodIndex;return r.twoFactorMethodIndex===t-1||(a+=1,n()),Mo(Mo({},r),{},{proofTokens:[...r.proofTokens,e],twoFactorMethodIndex:a})}))}),[]),a=(0,n.useCallback)(((e,t)=>{r((r=>r.enabledTwoFactorIndex===e?r:(t(),{proofTokens:[],twoFactorMethodIndex:0,enabledTwoFactorIndex:e})))}),[]);return Mo(Mo({},t),{},{advanceTwoFactorMethod:i,setEnabledTwoFactor:a})}(),r=t.twoFactorMethodIndex,i=t.enabledTwoFactorIndex,a=t.advanceTwoFactorMethod,o=t.setEnabledTwoFactor,c=t.proofTokens,l=us({enabledTwoFactorIndex:i,twoFactorMethodIndex:r}),u=l.loadingEnabled,d=l.enabledError,p=l.enabledTwoFactorOptions,f=l.getEnabledTwoFactor,g=l.enabledTwoFactor,h=l.twoFactorMethod,m=(0,n.useMemo)((()=>function({enabledTwoFactorOptions:e,enabledTwoFactor:t,twoFactorMethod:r,enabledTwoFactorIndex:n,twoFactorMethodIndex:i}){return e&&t?.methods&&r?.type?{option_index:n,method_index:i,num_options:e.length,num_methods:t.methods.length,method:r.type}:{}}({enabledTwoFactorOptions:p,enabledTwoFactor:g,twoFactorMethod:h,enabledTwoFactorIndex:i,twoFactorMethodIndex:r})),[p,g,i,h,r]),b=function({twoFactorType:e,currentTwoFactorEventData:t}){const r=Xo(),i=r.logEvent,a=r.getChallengeEventMetadata,o=r.logMetric,s=as().handleError,c=is(),l=c.loading,u=c.error,d=c.challengeMetadata,p=c.challengeTwoFactor,f=c.resetState,g=ls(e),h=(0,n.useCallback)(((e,r,n)=>{const o=a(n??{});i(No.TwoFactorRequest,Mo(Mo(Mo(Mo({},r&&{error_type:r}),t),o),{},{action:M.Us.render,componentType:M.re.page,result:e}))}),[t,i,a]),m=(0,n.useCallback)((t=>{o("challenge",{result:t,method:e??"unknown"})}),[o,e]),b=(0,n.useCallback)(((e,t)=>{h(j.x4.Failure,e.type),m(j.x4.Failure),s(e,t)}),[s,h,m]);return{loadingChallenge:l,challengeError:u,challengeMetadata:d,challengeTwoFactor:(0,n.useCallback)((async()=>{if(!e)return;const t=await p(Mo({secondFactorType:e},g));return t&&(h(j.x4.Success,void 0,t),m(j.x4.Success)),t}),[e,p,g,h,m]),handleChallengeError:b,resetChallengeState:f}}({currentTwoFactorEventData:m,twoFactorType:h?.type}),y=b.loadingChallenge,_=b.challengeError,v=b.challengeMetadata,w=b.challengeTwoFactor,T=b.handleChallengeError,x=b.resetChallengeState,S=(0,n.useCallback)((e=>{o(e,x)}),[o,x]),k=(0,n.useMemo)((()=>g?.methods?.length),[g]),E=(0,n.useCallback)((e=>{k&&a(e,k,x)}),[a,k,x]),I=ds({currentTwoFactorEventData:m,twoFactorType:h?.type,advanceTwoFactorMethod:E}),C=I.handleVerifyError,D=I.handleVerifySuccess,A=(0,n.useMemo)((()=>{if(c.length===k)return function(e){return e.join("")}(c)}),[k,c]),P=(0,n.useMemo)((()=>({twoFactorMethodIndex:r,enabledTwoFactorIndex:i,setEnabledTwoFactor:S,getEnabledTwoFactor:f,loadingEnabled:u,enabledError:d,enabledTwoFactorOptions:p,enabledTwoFactor:g,twoFactorMethod:h,loadingChallenge:y,challengeError:_,challengeMetadata:v,challengeTwoFactor:w,handleChallengeError:T,handleVerifySuccess:D,handleVerifyError:C,proofToken:A})),[r,i,S,f,u,d,p,g,h,w,T,y,_,v,D,C,A]);return(0,s.jsx)(fs.Provider,{value:P,children:e})})),hs=(0,n.memo)((function(e){let t=e.size,r=void 0===t?150:t,n=Co(e,vo);return(0,s.jsx)(o.Box,Mo(Mo({flexGrow:1,alignItems:"center",justifyContent:"center",testID:"base-loader"},n),{},{children:(0,s.jsx)(ye.LottieStatusAnimation,{width:r,status:"loading"})}))})),ms=(0,n.memo)((function(e){let t=e.size,r=void 0===t?150:t,n=Co(e,wo);const i=$o().loader;return i?(0,s.jsx)(o.Box,Mo(Mo({flexGrow:1,alignItems:"center",justifyContent:"center",testID:"loader",minWidth:r,minHeight:r},n),{},{children:i})):(0,s.jsx)(hs,Mo({size:r},n))})),bs={loading:!1,setLoading:C},ys=(0,n.createContext)(bs),_s=(0,n.memo)((function({children:e}){const t=Eo((0,n.useState)({}),2),r=t[0],i=t[1],a=(0,n.useCallback)(((e,t)=>{i((r=>{const n=Mo({},r);return t?n[e]=!0:delete n[e],n}))}),[]),o=(0,n.useMemo)((()=>Object.values(r).some((e=>e))),[r]),c=(0,n.useMemo)((()=>({loading:o,setLoading:a})),[o,a]),l=(0,n.useMemo)((()=>o?{maxHeight:0,overflow:"hidden"}:{}),[o]);return(0,s.jsxs)(ys.Provider,{value:c,children:[o&&(0,s.jsx)(ms,{testID:"global-loader"}),(0,s.jsx)(Ao,Mo(Mo({},l),{},{children:e}))]})}));function vs(){const e=Qo().target;return{isMockEnv:(0,n.useMemo)((()=>e===j.TN.Mock),[e]),isMSW:(0,n.useMemo)((()=>"true"==={NODE_ENV:"production",NODE_DEBUG:void 0}.MSW_API),[])}}function ws(e){const t=(0,n.useCallback)(((t,r)=>{const n=function(e){const t=new URL(e).pathname.split("/api/two-factor/v1");return t[t.length-1].toLowerCase()}(t),i={body:r?.body,config:e};switch(n){case"/enabled-types":return function({config:e}){const t=e.enabledTypes,r=(void 0===t?[]:t).map((e=>e.map((e=>T[e]))));return{enabled_types:(n=r,n.map(((e,t)=>({name:`Method ${t+1}`,methods:e.map((e=>({type:e,options:ue(e)})))}))))};var n}(i);case"/challenge":return pe(i);case"/verify":return he(i);case"/status":return me(i);case"/idv/activate":return{status:w.U5.ACTIVATED};case"/recovery-code/cancel":return{status:w.U5.CANCELLED};default:return}}),[e]);return{getMockResponse:t}}function Ts(){const e=(0,ve.rH)(),t=function(){const e=Qo().mockConfig,t=ws(Mo(Mo({},ae),e)).getMockResponse,r=(0,n.useCallback)((()=>async(e,r)=>{console.log(`mocked request: ${e}, init:`,r);const n=t(e,r);return console.log(`mocked response: ${e}`,n),n instanceof O.ApiError?n:{requestTime:0,timeUntilFirstByte:0,timeUntilFirstChunk:0,headers:r?.headers,status:200,json:async()=>n,text:async()=>JSON.stringify(n),ok:!0,body:r?.body,url:e}}),[t]);return r}(),r=function(){const e=Qo().clientId,t=(0,n.useCallback)((t=>async(r,n)=>{const i=Mo(Mo({},n),{},{headers:Mo(Mo({},n?.headers),{},{"two-factor-client-id":e})});return t(r,i)}),[e]);return t}(),i=vs().isMockEnv,a=(0,n.useMemo)((()=>i?t():e),[i,t,e]);return(0,n.useMemo)((()=>(0,_e.iE)(r(a))),[a,r])}const xs=(0,n.memo)((function({children:e}){const t=Ts();return(0,s.jsx)(_e.N5,{fetch:t,children:e})}));function Ss(e){const t=(0,n.useRef)(Math.random()),r=(0,n.useContext)(ys),i=r.setLoading,a=r.loading;return(0,n.useEffect)((()=>{"boolean"==typeof e&&i(t.current,e)}),[i,t,e]),a}const ks=(0,n.memo)((function({children:e}){const t=Eo((0,n.useState)(!0),2),r=t[0],i=t[1],a=(0,P.Z)().locale,o=Qo().target;Ss(r);const c=(0,n.useCallback)((()=>{i(!1)}),[]);return(0,s.jsx)(we.l0,{locale:a,isProd:o===j.TN.Production,serviceIdentifier:"unified-two-factor-web",onLoadMessages:c,awaitLoadMessages:!1,children:!r&&e})})),Es=(0,A.vU)({title:{id:"Fallback.title",defaultMessage:"We're having connection issues",description:"Title of fallback error screen"},description:{id:"Fallback.description",defaultMessage:"Please try again later today.",description:"Description of fallback error screen"},back:{id:"Fallback.back",defaultMessage:"Back",description:"Button text to exit component and go back to parent application"},tryAgain:{id:"Fallback.tryAgain",defaultMessage:"Try again",description:"Button text to try again"}}),Is=(0,n.memo)((function({onReloadPress:e,event:t,title:r,showDescription:i=!0}){const a=(0,P.Z)().formatMessage,c=Xo().logEvent,l=$o().onCancel,u=(0,n.useCallback)((()=>{c(No.TwoFactorClickButton,Mo(Mo({},t),{},{action:M.Us.click,componentType:M.re.button,button_type:Lo.Back})),l()}),[l,t,c]),d=(0,n.useCallback)((()=>{c(No.TwoFactorClickButton,Mo(Mo({},t),{},{action:M.Us.click,componentType:M.re.button,button_type:Lo.ReloadTwoFactor})),e?.()}),[e,t,c]);return(0,s.jsxs)(o.VStack,{flexGrow:1,alignItems:"center",testID:"fallback",children:[(0,s.jsx)(xe.HeroSquare,{name:"coinbaseIsDown"}),(0,s.jsx)(Se.TextTitle1,{as:"h3",spacingTop:2,align:"center",children:r??a(Es.title)}),i&&(0,s.jsx)(Se.TextBody,{as:"p",align:"center",spacingTop:1,children:a(Es.description)}),(0,s.jsx)(o.VStack,{alignSelf:"stretch",spacingHorizontal:4,spacingTop:4,children:(0,s.jsxs)(Te.ButtonGroup,{accessibilityLabel:"fallback-button-group",vertical:!0,children:[e&&(0,s.jsx)(Te.Button,{onPress:d,variant:"primary",testID:"fallback-reload-button",children:a(Es.tryAgain)}),(0,s.jsx)(Te.Button,{onPress:u,variant:"secondary",testID:"fallback-back-button",children:a(Es.back)})]})})]})})),Cs=(0,n.memo)((function({children:e}){const t=$o(),r=t.action,i=t.onError,a=Qo().onBoundaryError,o=ns().getTwoFactorError,c=Xo().logEvent,l=(0,n.useCallback)(((e,t)=>{c(No.TwoFactorErrorBoundaryLoad,{action:M.Us.render,componentType:M.re.page}),i?.(o(be.D1.BoundaryError),C),a(function(e,t,r,n){return{error:e,errorInfo:t,context:n.name,details:{version:n.version,action:r}}}(e,t,r,{name:Oo,version:Po}))}),[o,i,r,a,c]);return(0,s.jsx)(_,{fallback:(0,s.jsx)(Is,{}),onError:l,children:e})}));function Ds(){return(0,n.useContext)(fs)}const Ms=(0,n.memo)((function({onReload:e,event:t,error:r}){const i=Ds().twoFactorMethod,a=(0,n.useMemo)((()=>Mo(Mo({},t),i&&{method:i?.type})),[t,i]);return(0,s.jsx)(Is,{event:a,onReloadPress:e,title:r,showDescription:!1})})),js=(0,n.memo)((function({loading:e,onReload:t,event:r,error:i,children:a=null}){Ss(e);const o=(0,n.useMemo)((()=>e?{maxHeight:0,overflow:"hidden"}:{}),[e]);return i?(0,s.jsx)(Ms,{onReload:t,event:r,error:i}):(0,s.jsx)(Ao,Mo(Mo({testID:"load-view-wrapper"},o),{},{children:a}))}));let As=function(e){return e.BackButton="back_button",e}({});const Ps={enter:"e1yceb0m",enterActive:"e10xbcef",exit:"e1jmug54",exitActive:"ei9sigy"},Os={enter:"efq8fi5",enterActive:"e8rzqn2",exit:"ek6jerg",exitActive:"esd2c3y",exitDone:"e14kilz9"},Fs=(0,n.memo)((function({BaseView:e,DrawerView:t,onOpenDrawer:r,onCloseDrawer:i,toggleText:a,toggleType:c,toggleTestID:l="responsive-drawer-toggle"}){const u=Eo((0,n.useState)(!1),2),d=u[0],p=u[1],f=Eo((0,n.useState)(!1),2),g=f[0],h=f[1],m=(0,n.useCallback)((()=>{p((e=>(e||r?.(),!0)))}),[r]),b=(0,n.useCallback)((e=>{p((t=>(t&&i?.(e),!1)))}),[i]),y=(0,n.useCallback)((async e=>{b(),e&&(h(!0),await function(e){let t;const r=new Promise(((r,n)=>{const i=setTimeout(r,e);t=()=>{n(new Error(D)),clearTimeout(i)}}));return r.cancel=()=>t(),r}(750),h(!1))}),[b]),_=(0,n.useCallback)((()=>{b(As.BackButton)}),[b]);return(0,s.jsx)(o.VStack,{flexGrow:1,width:"100%",children:(0,s.jsxs)(o.VStack,{flexGrow:1,position:"relative",overflow:"hidden",children:[(0,s.jsx)(Ve,{mountOnEnter:!0,timeout:750,in:!d,classNames:Os,children:(0,s.jsxs)(o.VStack,{children:[(0,s.jsx)(e,{}),g&&(0,s.jsx)(ms,{position:"absolute",left:0,right:0,bottom:0,top:0,background:!0,testID:"responsive-drawer-loader"}),"link"===c?(0,s.jsx)(o.Box,{spacingVertical:3,justifyContent:"center",testID:"responsive-drawer-toggle-link",children:(0,s.jsx)(Se.Link,{variant:"body",color:"primary",onPress:m,testID:l,children:a})}):(0,s.jsx)(o.Box,{spacingTop:2,testID:"responsive-drawer-toggle-button",children:(0,s.jsx)(Te.Button,{block:!0,onPress:m,variant:"secondary",testID:l,children:a})})]})}),(0,s.jsx)(Ve,{mountOnEnter:!0,unmountOnExit:!0,timeout:750,in:d,classNames:Ps,children:(0,s.jsxs)(o.VStack,{background:!0,spacingHorizontal:We.gutter,children:[(0,s.jsx)(o.Box,{spacingTop:.5,children:(0,s.jsx)(Te.IconButton,{name:"backArrow",onPress:_,testID:"responsive-drawer-back-button"})}),(0,s.jsx)(o.Box,{spacingVertical:2,children:(0,s.jsx)(t,{onCloseDrawer:y})})]})})]})})})),Us=(0,A.vU)({havingTrouble:{id:"ViewWithHelpDrawer.havingTrouble",defaultMessage:"Having trouble? Try another way",description:"A question asking if the user is having trouble"}}),Rs=(0,n.memo)((function(e){let t=e.twoFactorType,r=Co(e,To);const i=(0,P.Z)().formatMessage,a=Xo().logEvent,o=(0,n.useCallback)((()=>{a(No.TwoFactorClickButton,{action:M.Us.click,componentType:M.re.button,button_type:Lo.TryAnotherWay,method:t})}),[a,t]),c=(0,n.useCallback)((e=>{e&&a(No.TwoFactorClickButton,{action:M.Us.click,componentType:M.re.button,button_type:Lo.CloseTryAnotherWay,close_type:e,method:t})}),[a,t]),l=(0,n.useMemo)((()=>i(Us.havingTrouble)),[i]);return(0,s.jsx)(Fs,Mo(Mo({},r),{},{onOpenDrawer:o,onCloseDrawer:c,toggleText:l,toggleType:"link"}))}));function Ns({id:e,showErrorToast:t,onSuccess:r,onError:i}){const a=Ds(),o=a.handleVerifySuccess,s=a.handleVerifyError,l=function({id:e,secret:t}){const r=R((0,n.useState)(),2),i=r[0],a=r[1],o=R((0,n.useState)(),2),s=o[0],l=o[1],u=(0,n.useCallback)((e=>!(!e?.status?.completed&&!e?.status?.proofToken||(a(e.status.proofToken??c),l(e?.status?.secondFactorType),0))),[]),d=Y({id:e,secret:t,onResponse:u}),p=d.loading,f=d.error,g=d.startPoll,h=d.cancelPoll;return{loading:p,error:f,startPoll:(0,n.useCallback)((()=>{e&&g()}),[e,g]),cancelPoll:h,proofToken:i,twoFactorType:s}}({id:e}),u=l.error,d=l.loading,p=l.proofToken,f=l.startPoll,g=l.cancelPoll;return(0,$e.d)(f,g),(0,n.useEffect)((()=>{Wo(p)&&(r?.(),o(p))}),[p,o,r]),(0,n.useEffect)((()=>{u&&(i?.(u),s(u,t))}),[u,s,i,t]),{error:u,loading:d,startPoll:f}}const Ls=(0,n.memo)((function({title:e,description:t,align:r,spacingBottom:i=5}){const a=(0,n.useMemo)((()=>"string"==typeof t?[t]:Array.isArray(t)?t:void 0),[t]);return(0,s.jsxs)(o.VStack,{spacingBottom:i,children:[(0,s.jsx)(Se.TextTitle1,{as:"h2",align:r,children:e}),a&&(0,s.jsx)(o.VStack,{gap:3,spacingTop:1,testID:"description",children:a.map((e=>(0,s.jsx)(Se.TextBody,{as:"p",color:"foregroundMuted",align:r,dangerouslySetClassName:"twue83p",children:e},e)))})]})})),Bs=(0,A.vU)({resendCodeSuccess:{id:"ResendChallenge.resendCodeSuccess",defaultMessage:"Your code is on the way",description:"Toast for when SMS code is successfully resent"},resendPushSuccess:{id:"ResendChallenge.resendPushSuccess",defaultMessage:"Your security prompt is on the way",description:"Toast for when security prompt is successfully resent"},resendEmailSuccess:{id:"ResendChallenge.resendEmailSuccess",defaultMessage:"Email sent to {email}",description:"Toast for when verification email is successfully resent"}}),qs=(0,A.vU)({yourPrimaryPhoneNumber:{id:"TwoFactorOption.yourPrimaryPhoneNumber",defaultMessage:"your primary phone number",description:"Fallback text used in place of user's phone number"},yourEmail:{id:"TwoFactorOption.yourEmail",defaultMessage:"your email",description:"Placeholder text for missing email"}});function Vs(){const e=(0,P.Z)().formatMessage;return(0,n.useCallback)((t=>{const r=t?.options?.[0];if(r)return r;switch(t?.type){case w.Y6.SMS:return e(qs.yourPrimaryPhoneNumber);case w.Y6.DEVICE_VERIFICATION:return e(qs.yourEmail);default:return""}}),[e])}const Ws=(0,A.vU)({resendCode:{id:"ResendChallengeButton.resendCode",defaultMessage:"Resend code",description:"Button text to resend code"},resendEmail:{id:"ResendChallengeButton.resendEmail",defaultMessage:"Resend email",description:"Button text to resend email"},resendPush:{id:"ResendChallengeButton.resendPush",defaultMessage:"Resend",description:"Button text to resend push"},resendCodeAfterWait:{id:"ResendChallengeButton.resendCodeAfterWait",defaultMessage:"Resend code in {seconds}",description:"Button text to resend code after waiting a specific number of seconds"},resendEmailAfterWait:{id:"ResendChallengeButton.resendEmailAfterWait",defaultMessage:"Resend email in {seconds}",description:"Button text to resend email after waiting a specific number of seconds"},resendPushAfterWait:{id:"ResendChallengeButton.resendPushAfterWait",defaultMessage:"Resend in {seconds}",description:"Button text to resend push after waiting a specific number of seconds"}}),$s=(0,n.memo)((function({startWithCooldown:e,twoFactorType:t}){const r=function(){const e=(0,P.Z)().formatMessage,t=$o().onToast,r=Ds(),i=r.challengeTwoFactor,a=r.loadingChallenge,o=r.twoFactorMethod,s=Vs(),c=(0,n.useMemo)((()=>{switch(o?.type){case w.Y6.SMS:return e(Bs.resendCodeSuccess);case w.Y6.DEVICE_VERIFICATION:return e(Bs.resendEmailSuccess,{email:s(o)});case w.Y6.PUSH:return e(Bs.resendPushSuccess);default:return}}),[e,s,o]);return{resendChallenge:(0,n.useCallback)((async()=>{const e=await i();return e&&c&&t({type:j.k.Reaction,message:c}),e}),[i,t,c]),loading:a}}(),i=r.resendChallenge,a=r.loading,o=Xo().logEvent,c=Eo((0,n.useState)(e?30:0),2),l=c[0],u=c[1],d=(0,P.Z)().formatMessage,p=(0,n.useMemo)((()=>0!==l),[l]);(0,n.useEffect)((()=>{let e;return l&&(e=window.setTimeout((()=>{u((e=>e-1))}),1e3)),()=>{e&&clearTimeout(e)}}),[l]);const f=(0,n.useMemo)((()=>{switch(t){case w.Y6.SMS:return d(Ws.resendCode);case w.Y6.DEVICE_VERIFICATION:return d(Ws.resendEmail);case w.Y6.PUSH:return d(Ws.resendPush);case w.Y6.EMAIL:return d(Ws.resendCode);default:return""}}),[t,d]),g=(0,n.useMemo)((()=>{const e={seconds:l};switch(t){case w.Y6.SMS:return d(Ws.resendCodeAfterWait,e);case w.Y6.DEVICE_VERIFICATION:return d(Ws.resendEmailAfterWait,e);case w.Y6.PUSH:return d(Ws.resendPushAfterWait,e);case w.Y6.EMAIL:return d(Ws.resendCodeAfterWait,e);default:return""}}),[t,l,d]),h=(0,n.useMemo)((()=>p?g:f),[p,f,g]),m=(0,n.useCallback)((async()=>{o(No.TwoFactorClickButton,{action:M.Us.click,componentType:M.re.button,method:t,button_type:Lo.ResendChallenge});await i()&&u(30)}),[i,u,o,t]);return(0,s.jsx)(ze.Button,{block:!0,variant:"secondary",onPress:m,disabled:p,loading:a,testID:"resend-challenge-button",children:h})})),zs={[w.Y6.SMS]:{token:"0000000"},[w.Y6.TOTP]:{token:"000000"},[w.Y6.U2F]:{clientDataJson:k((new TextEncoder).encode("000000"))}};const Ys=(0,A.vU)({simulateVerify:{id:"SimulateButton.simulateVerify",defaultMessage:"Simulate",description:"An action that simulates a 2FA verification by bypassing the usual requirements"}}),Hs=(0,n.memo)((function({twoFactorType:e}){const t=Eo((0,n.useState)(!1),2),r=t[0],i=t[1],a=(0,P.Z)().formatMessage,o=Ds(),l=o.challengeMetadata,u=o.handleVerifySuccess,d=o.handleVerifyError,p=function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=(0,U.yl)(),l=(0,Ye.$H)(),u=ts(),d=ns().parseTwoFactorApiError;return{loading:t,error:a,simulateVerifyTwoFactor:(0,n.useCallback)((async(e,t)=>{let n;r(!0);const i=u;if(e===w.Y6.DEVICE_VERIFICATION)i.deviceVerification=`dv_${t?.statusId}`,n=await l(i);else{switch(e){case w.Y6.SMS:i.sms=zs.SMS;break;case w.Y6.TOTP:i.totp=zs.TOTP;break;case w.Y6.U2F:i.u2f=zs.U2F}n=await s(i)}if(r(!1),n instanceof O.ApiError){const e=n.status;if(0===e||302===e)return o(void 0),null}if(n instanceof Error){const e=d(n);return o(e),null}return o(void 0),n.proofToken??c}),[s,l,u,d])}}(),f=p.error,g=p.simulateVerifyTwoFactor,h=Qo().target;(0,n.useEffect)((()=>{f&&d(f)}),[f,d]);const m=(0,n.useCallback)((async()=>{i(!0);const t=l?.deviceVerification?.statusId,r=await g(e,{statusId:t});Wo(r)?u(r):i(!1)}),[g,u,e,l]);return h===j.TN.Production?null:(0,s.jsx)(Te.Button,{block:!0,variant:"secondary",testID:"simulate-verify-button",onPress:m,loading:r,children:a(Ys.simulateVerify)})})),Gs=(0,n.memo)((function(e){let t=e.children,r=Co(e,xo);return(0,s.jsx)(o.Box,Mo(Mo({},r),{},{children:(0,s.jsxs)(o.HStack,{borderRadius:"standard",spacingVertical:2,spacingHorizontal:3,flexGrow:1,alignItems:"center",gap:2,dangerouslySetClassName:"wywvfly",children:[(0,s.jsx)(He.Icon,{name:"warning",size:"m",color:"foreground",testID:"warning-icon"}),(0,s.jsx)(Se.TextBody,{as:"p",children:t})]})}))})),Ks=(0,A.vU)({title:{id:"DVConfirmation.title",defaultMessage:"We don’t recognize this device",description:"Title for the Device Verification Confirmation screen telling user that device is unrecognized"},description:{id:"DVConfirmation.description",defaultMessage:"Confirm this is your device from the email we just sent to {email}.",description:"Description for the Device Verification Confirmation screen prompting user to go to inbox and confirm email"},rateLimitWarning:{id:"DVConfirmation.rateLimitWarning",defaultMessage:"Wait a few minutes for your email to arrive or tap the help button below to update your email",description:"Rate limit warning that advises user to wait or press help button"}}),Zs=(0,n.memo)((function(){const e=(0,P.Z)().formatMessage,t=Ds(),r=t.twoFactorMethod,i=t.challengeError,a=Vs(),c=(0,$e.b)(),l=(0,n.useMemo)((()=>c?"phoneUnknown":"desktopUnknown"),[c]),u=(0,n.useMemo)((()=>i?.type===be.D1.TooManyRequests),[i]);return(0,s.jsxs)(o.VStack,{testID:"device-verification-confirmation",flexGrow:1,children:[(0,s.jsx)(o.Box,{spacingBottom:5,justifyContent:"center",children:(0,s.jsx)(xe.HeroSquare,{alt:l,name:l,testID:"device-verification-confirmation-image",scaleMultiplier:.683})}),(0,s.jsx)(Ls,{title:e(Ks.title),description:e(Ks.description,{email:a(r)}),align:"center"}),u&&(0,s.jsx)(Gs,{spacingBottom:3,testID:"device-verification-confirmation-warning",children:e(Ks.rateLimitWarning)}),(0,s.jsxs)(Te.ButtonGroup,{vertical:!0,accessibilityLabel:"Validation Actions",children:[(0,s.jsx)(Hs,{twoFactorType:w.Y6.DEVICE_VERIFICATION}),(0,s.jsx)($s,{twoFactorType:w.Y6.DEVICE_VERIFICATION})]})]})})),Qs={spacingHorizontal:0},Js=(0,n.memo)((function({id:e,title:t,description:r,onPress:i,onCloseDrawer:a,to:o,twoFactorType:c,menuType:l,closeOnPress:u,switchBaseView:d=!1,openBlankWindow:p=!0,isRecoveryOption:f=!1}){const g=Xo().logEvent,h=(0,n.useCallback)((async t=>{g(No.TwoFactorClickHelpOption,Mo({action:M.Us.click,componentType:M.re.button,menu_type:l,option_id:e,method:c,isRecoveryOption:f},o&&{option_link:o}),M.E3.high),o&&p&&window.open(o,"_blank","noopener"),o&&!p&&window.location.assign(o),u&&await a(d),i?.(t)}),[o,i,a,u,d,g,e,c,l,p,f]);return(0,s.jsx)(Ge.ListCell,{multiline:!0,accessory:"arrow",title:t,description:r,onPress:h,outerSpacing:Qs})})),Xs=(0,n.memo)((function({title:e,options:t,onCloseDrawer:r,twoFactorType:n,menuType:i,testID:a}){return(0,s.jsxs)(o.VStack,{testID:a,width:"100%",children:[(0,s.jsx)(Se.TextTitle1,{as:"h2",spacingBottom:1,children:e}),t.map((e=>(0,s.jsx)(Js,Mo({onCloseDrawer:r,twoFactorType:n,menuType:i},e),e.id)))]})})),ec=(0,A.vU)({title:{id:"TryAnotherWay.title",defaultMessage:"Try another way",description:"Title for the Try Another Way screen"},troubleshootTitle:{id:"TryAnotherWay.troubleshootTitle",defaultMessage:"Troubleshoot",description:"Title for the Try Another Way option to troubleshoot and navigate to help center"},troubleshootDescription:{id:"TryAnotherWay.troubleshootDescription",defaultMessage:"Visit our Help Center to find quick solutions and troubleshoot.",description:"Description for the Try Another Way option to troubleshoot and navigate to help center"},contactUsTitle:{id:"TryAnotherWay.contactUsTitle",defaultMessage:"Contact us",description:"Title for the Try Another Way option to help center"},contactUsDescription:{id:"TryAnotherWay.contactUsDescription",defaultMessage:"For better security of your account, please reach out to our Customer Support team to help you with your account access.",description:"Description for the Try Another Way option to troubleshoot and navigate to help center"}}),tc=(0,n.memo)((function(e){let t=e.alternateTwoFactorOptions,r=e.troubleshootOption,i=Co(e,So);const a=(0,P.Z)().formatMessage,o=es(j.T9.ContactUsHelpOption),c=(0,n.useMemo)((()=>Mo({title:a(o?ec.contactUsTitle:ec.troubleshootTitle),description:a(o?ec.contactUsDescription:ec.troubleshootDescription)},r)),[a,o,r]),l=(0,n.useMemo)((()=>[...t,c]),[t,c]);return(0,s.jsx)(Xs,Mo({title:a(ec.title),options:l,menuType:Bo.TryAnotherWay},i))})),rc=(0,A.vU)({smsTitle:{id:"AlternateTwoFactorOptions.smsTitle",defaultMessage:"Receive a text (SMS)",description:"Title for Help Menu option to switch back to SMS as two-factor authentication"},smsDescription:{id:"AlternateTwoFactorOptions.smsDescription",defaultMessage:"We’ll text you a 7 digit code to {phoneNumber}",description:"Description for Help Menu option to receive code and switch back to SMS as two-factor authentication"},totpTitle:{id:"AlternateTwoFactorOptions.totpTitle",defaultMessage:"Use your authenticator app",description:"Title for Help Menu option to switch back to TOTP / authenticator app as two-factor authentication"},totpDescription:{id:"AlternateTwoFactorOptions.totpDescription",defaultMessage:"Enter the 6-digit code from your authenticator app.",description:"Description for Help Menu option to receive code and switch back to TOTP / authenticator app as two-factor authentication"},idvTitle:{id:"AlternateTwoFactorOptions.idvTitle",defaultMessage:"Verify your info",description:"Title for Help Menu option to switch back to IDV (ID verification) as two-factor authentication"},idvDescription:{id:"AlternateTwoFactorOptions.idvDescription",defaultMessage:"Upload a photo of yourself and your ID to prove you own this account.",description:"Description for Help Menu option to upload photos of self and ID, and switch back to IDV (ID verification) as two-factor authentication"},pushTitle:{id:"AlternateTwoFactorOptions.pushTitle",defaultMessage:"Tap a push notification",description:"Title for Help Menu option to switch to push two-factor authentication"},pushDescription:{id:"AlternateTwoFactorOptions.pushDescription",defaultMessage:"Tap “Yes” on a push notification from your Coinbase app.",description:"Description for Help Menu option to receive push notification on app and switch back to push two-factor authentication"},walletTitle:{id:"AlternateTwoFactorOptions.walletTitle",defaultMessage:"Connect your wallet",description:"Title for Help Menu option to switch to wallet two-factor authentication"},walletDescription:{id:"AlternateTwoFactorOptions.walletDescription",defaultMessage:"Sign a message with your crypto wallet to prove it’s you.",description:"Description for Help Menu option to sign a message with a connected crypto wallet and switch back to wallet two-factor authentication"},emailTitle:{id:"AlternateTwoFactorOptions.emailTitle",defaultMessage:"Receive an email",description:"Title for Help Menu option to switch back to email as two-factor authentication"},emailDescription:{id:"AlternateTwoFactorOptions.emailDescription",defaultMessage:"We’ll email you a 6 digit code to {email}",description:"Description for Help Menu option to receive code and switch back to email as two-factor authentication"},questionsTitle:{id:"AlternateTwoFactorOptions.questionsTitle",defaultMessage:"Verify your credentials",description:"Title for Help Menu option to switch back to email as two-factor authentication"},questionsDescription:{id:"AlternateTwoFactorOptions.questionsDescription",defaultMessage:"Answer a few identity questions to prove you own this account.",description:"Description for Help Menu option to receive code and switch back to email as two-factor authentication"}});function nc({showDefaultIDVOption:e,idvOption:t,legacyRecoveryOption:r}){const i=(0,P.Z)().formatMessage,a=function(){const e=Ds(),t=e.enabledTwoFactorOptions,r=e.enabledTwoFactorIndex;return(0,n.useMemo)((()=>Boolean(t?.some((({methods:e},t)=>r!==t&&e?.some((({type:e})=>e===w.Y6.IDV)))))),[r,t])}(),o=es(j.T9.LegacyAccountRecovery),s=Ds(),c=s.setEnabledTwoFactor,l=s.enabledTwoFactorIndex,u=s.enabledTwoFactorOptions,d=s.twoFactorMethod,p=Vs(),f=Xo().logEvent,g=(0,n.useCallback)((e=>{f(No.TwoFactorTryAnotherWayOptions,{action:M.Us.measurement,componentType:M.re.page,twoFactorType:d?.type??"UNKNOWN",optionIds:e.map((e=>e.id)),isIDVAvailable:a,isLegacyRecovery:o})}),[f,d?.type,o,a]),h=(0,n.useCallback)((e=>()=>{c(e)}),[c]),m=(0,n.useCallback)((({methods:r},n)=>{if(n===l)return[];const a=r?.[0],o={onPress:h(n),switchBaseView:!0,closeOnPress:!0};switch(a?.type){case w.Y6.SMS:return[Mo(Mo({},o),{},{id:qo.SwitchToSMS,title:i(rc.smsTitle),description:i(rc.smsDescription,{phoneNumber:p(a)})})];case w.Y6.TOTP:return[Mo(Mo({},o),{},{id:qo.SwitchToTOTP,title:i(rc.totpTitle),description:i(rc.totpDescription)})];case w.Y6.IDV:{const r=[];return e?r.push(Mo(Mo({},o),{},{id:qo.SwitchToIDV,title:i(rc.idvTitle),description:i(rc.idvDescription),isRecoveryOption:!0})):t&&r.push(Mo(Mo(Mo({},o),t),{},{isRecoveryOption:!0})),r}case w.Y6.PUSH:return[Mo(Mo({},o),{},{id:qo.SwitchToPush,title:i(rc.pushTitle),description:i(rc.pushDescription)})];case w.Y6.WALLET:return[Mo(Mo({},o),{},{id:qo.SwitchToWallet,title:i(rc.walletTitle),description:i(rc.walletDescription)})];case w.Y6.EMAIL:return[Mo(Mo({},o),{},{id:qo.SwitchToEmail,title:i(rc.emailTitle),description:i(rc.emailDescription,{email:p(a)})})];case w.Y6.SECURITY_QUESTION:return[Mo(Mo({},o),{},{id:qo.SwitchToSecurityQuestions,title:i(rc.questionsTitle),description:i(rc.questionsDescription)})];default:return[]}}),[l,h,i,p,e,t]);return(0,n.useMemo)((()=>{const e=[];return u?.forEach(((t,r)=>{const n=m(t,r);e.push(...n)})),o&&r&&e.push(r),g(e),e}),[u,m,o,r,g])}const ic="/account_recovery",ac="/email_recovery";function oc(){const e=(0,P.Z)().locale,t=es(j.T9.ContactUsHelpOption),r=`https://help.coinbase.com/${e}/coinbase/managing-my-account/get-back-into-my-account/2-step-verification-troubleshooting`,i=`https://help.coinbase.com/${e}/contact-us`,a=`https://help.coinbase.com/${e}/coinbase/managing-my-account/verify-my-identity/why-didnt-i-receive-a-verification-email`,o=`https://help.coinbase.com/${e}/contact-us?product=coinbase&topic=login_authentication_and_verification_issues&category=2FA&subCategory=2fa_security_key`,s=(0,n.useMemo)((()=>t?i:r),[i,r,t]);return{HELP_OPTION_URLS:{[w.Y6.SMS]:s,[w.Y6.TOTP]:s,[w.Y6.U2F]:s,[w.Y6.PUSH]:s,[w.Y6.WALLET]:s,[w.Y6.EMAIL]:s,[w.Y6.DEVICE_VERIFICATION]:a,[w.Y6.PASSWORD]:s},ACCOUNT_RECOVERY_LEGACY_URL:ic,EMAIL_RECOVERY_LEGACY_URL:ac,U2F_CONTACT_SUPPORT_LEGACY_URL:o}}const sc=(0,A.vU)({legacyEmailTitle:{id:"DVTryAnotherWay.updateEmailTitle",defaultMessage:"Update your email",description:"Title for the Device Verification Try Another Way option to update email"},legacyEmailDescription:{id:"DVTryAnotherWay.updateEmailDescription",defaultMessage:"New email address? Verify your identity and change it here.",description:"Description for the Device Verification Try Another Way option to verify identity and update email"},emailRecoveryTitle:{id:"DVTryAnotherWay.emailRecoveryTitleNew",defaultMessage:"Update your email address",description:"Title for the Device Verification Try Another Way option to update email"},emailRecoveryDescription:{id:"DVTryAnotherWay.emailRecoveryIDVDescriptionNew",defaultMessage:"New email address? Verify your identity to change it here.",description:"Description for the Device Verification Try Another Way option to verify identity and update email"}}),cc=(0,n.memo)((function({onCloseDrawer:e}){const t=(0,P.Z)().formatMessage,r=`${Qo().apiHost}${ac}`,i=(0,n.useMemo)((()=>({id:qo.DVUpdateEmail2dot0,title:t(sc.emailRecoveryTitle),description:t(sc.emailRecoveryDescription)})),[t]);(0,n.useMemo)((()=>({title:t(sc.legacyEmailTitle),description:t(sc.legacyEmailDescription),id:qo.DVUpdateEmailLegacy,to:r,openBlankWindow:!1})),[r,t]);const a=nc({showDefaultIDVOption:!1,idvOption:i,legacyRecoveryOption:void 0}),o=oc().HELP_OPTION_URLS,c=(0,n.useMemo)((()=>({id:qo.DVTroubleshoot,to:o[w.Y6.DEVICE_VERIFICATION]})),[o]);return(0,s.jsx)(tc,{onCloseDrawer:e,twoFactorType:w.Y6.DEVICE_VERIFICATION,alternateTwoFactorOptions:a,troubleshootOption:c,testID:"device-verification-try-another-way"})})),lc=(0,n.memo)((function(){const e=function(){const e=Ds(),t=e.challengeError,r=e.challengeMetadata,i=e.challengeTwoFactor,a=e.handleChallengeError;return(0,n.useEffect)((()=>{i()}),[i]),(0,n.useEffect)((()=>{if(t){const e=t.type!==be.D1.TooManyRequests;a(t,e)}}),[t,a]),{loading:(0,n.useMemo)((()=>!(t||r&&!r?.deviceVerification?.proofToken&&!r?.deviceVerification?.trusted)),[t,r]),statusId:r?.deviceVerification?.statusId}}(),t=e.loading,r=e.statusId;!function(){const e=Ds(),t=e.challengeMetadata,r=e.handleVerifySuccess;(0,n.useEffect)((()=>{const e=t?.deviceVerification?.proofToken;e?r(e):t?.deviceVerification?.trusted&&r(c)}),[t,r])}();const i=Ns({id:r,showErrorToast:!1}),a=i.startPoll,o=i.error,l=i.loading,u=(0,n.useMemo)((()=>t||!!o&&l),[t,o,l]);return(0,s.jsx)(js,{loading:u,error:o?.message,onReload:a,children:(0,s.jsx)(Rs,{BaseView:Zs,DrawerView:cc,toggleTestID:"device-verification-toggle-help-button",twoFactorType:w.Y6.DEVICE_VERIFICATION})})})),uc=[be.D1.TooManyRequests,be.D1.AttemptLimitReached];const dc=(0,A.vU)({inputGroupA11yLabel:{id:"InputCode.inputGroupA11yLabel",defaultMessage:"numerical code inputs",description:"Accessibility label for group of individual digit inputs used to enter numerical code"},digitInputA11yLabel:{id:"InputCode.digitInputA11yLabel",defaultMessage:"{codeLength} digit code, digit {index}",description:"Accessibility label for digit input at given index, ranging from 1 to N for a group of N inputs"}}),pc=(0,n.memo)((function({twoFactorType:e,codeLength:t,errorTestID:r,onError:i,onSuccess:a}){const o=function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=(0,U.yl)(),l=ts(),u=ns().parseTwoFactorApiError;return{loading:t,error:a,verifyCode:(0,n.useCallback)((async(e,t)=>{r(!0);const n=l;switch(e){case w.Y6.SMS:n.sms={token:t};break;case w.Y6.TOTP:n.totp={token:t};break;case w.Y6.RECOVERY_CODE:n.rc={token:t};break;case w.Y6.EMAIL:n.email={token:t}}const i=await s(n);if(r(!1),i instanceof Error){const e=u(i);return o(e),null}return o(void 0),i.proofToken??c}),[s,l,u])}}(),l=o.error,u=o.verifyCode,d=Eo((0,n.useState)(!1),2),p=d[0],f=d[1],g=function(){const e=(0,n.useRef)(!1);return(0,n.useEffect)((()=>(e.current=!0,()=>{e.current=!1})),[]),(0,n.useCallback)((()=>e.current),[])}();(0,n.useEffect)((()=>{l&&i(l)}),[l,i]);const h=(0,n.useCallback)((async t=>{f(!0);const r=await u(e,t),n=Wo(r);let i=!n;return n&&(i=a(r)),!!i&&(g()&&f(!1),!0)}),[g,e,u,a]);return(0,s.jsx)(we.hF,{codeLength:t,onSubmit:h,loading:p,error:l?.message,errorTestID:r,inputGroupA11yLabel:dc.inputGroupA11yLabel,digitInputA11yLabel:dc.digitInputA11yLabel})})),fc=(0,n.memo)((function(e){const t=Ds(),r=t.twoFactorMethodIndex,i=t.enabledTwoFactor,a=t.handleVerifySuccess,o=t.handleVerifyError,c=(0,n.useMemo)((()=>{const e=i?.methods?.length;return!!e&&r===e-1}),[r,i]),l=(0,n.useCallback)((e=>{o(e,!1)}),[o]),u=(0,n.useCallback)((e=>(a(e),!c)),[c,a]);return(0,s.jsx)(pc,Mo({onSuccess:u,onError:l},e))})),gc=(0,A.vU)({title:{id:"EmailInputCode.title",defaultMessage:"Enter the 6-digit code we emailed to {email}",description:"Title for the Email Code Input screen prompting user to input the code"},description:{id:"EmailInputCode.description",defaultMessage:"This helps us keep your account secure by verifying that it’s really you.",description:"Description for the Email Code Input screen explaining the reason for requiring 2FA"},attemptLimitReached:{id:"EmailInputCode.attemptLimitReached",defaultMessage:"You’ve tried to enter your code too many times. Please wait for 5 minutes to try again.",description:"Error when user reaches the attempt limit for Email"}}),hc=[be.D1.TooManyRequests,be.D1.AttemptLimitReached],mc=(0,n.memo)((function(){const e=(0,P.Z)().formatMessage,t=Ds(),r=t.twoFactorMethod,i=t.challengeError,a=Vs(),c=(0,n.useMemo)((()=>i?.type&&hc.includes(i.type)),[i]);return(0,s.jsxs)(o.VStack,{testID:"email-input-code",children:[(0,s.jsx)(Ls,{title:e(gc.title,{email:a(r)}),description:e(gc.description)}),c&&(0,s.jsx)(Gs,{spacingBottom:3,testID:"email-input-code-warning",children:e(gc.attemptLimitReached)}),(0,s.jsx)(fc,{codeLength:6,twoFactorType:w.Y6.EMAIL,errorTestID:"email-input-code-error"}),(0,s.jsx)($s,{twoFactorType:w.Y6.EMAIL,startWithCooldown:!0})]})})),bc=(0,A.vU)({updateEmailTitle:{id:"EmailTryAnotherWay.updateEmailTitle",defaultMessage:"Verify by ID",description:"Title for the Email Try Another Way option to update phone number"},updateEmailDescription:{id:"EmailTryAnotherWay.updateEmailDescription",defaultMessage:"New email? Verify your identity update your email.",description:"Description for the Email Try Another Way option to verify identity and update phone number"}}),yc=(0,n.memo)((function({onCloseDrawer:e}){const t=(0,P.Z)().formatMessage,r=oc().HELP_OPTION_URLS,i=(0,n.useMemo)((()=>({id:qo.EmailTroubleshoot,to:r[w.Y6.EMAIL]})),[r]),a=nc({showDefaultIDVOption:!1,idvOption:(0,n.useMemo)((()=>({id:qo.EmailTroubleshoot,title:t(bc.updateEmailTitle),description:t(bc.updateEmailDescription)})),[t])});return(0,s.jsx)(tc,{onCloseDrawer:e,twoFactorType:w.Y6.EMAIL,alternateTwoFactorOptions:a,troubleshootOption:i,testID:"email-try-another-way"})})),_c=(0,n.memo)((function(){return function(){const e=Ds(),t=e.challengeError,r=e.challengeTwoFactor,i=e.handleChallengeError;(0,n.useEffect)((()=>{r()}),[r]),(0,n.useEffect)((()=>{if(t){const e=t.type&&!uc.includes(t.type);i(t,e)}}),[t,i])}(),(0,s.jsx)(Rs,{BaseView:mc,DrawerView:yc,toggleTestID:"email-toggle-help-button",twoFactorType:w.Y6.EMAIL})})),vc=(0,A.vU)({cancel:{id:"Footer.cancel",defaultMessage:"Cancel ID verification",description:"Button text to cancel the ID verification process"},lostPin:{id:"Footer.lostPin",defaultMessage:"I lost my pin and need to start over",description:"Button text for when the user has lost their recovery pin and needs to start the process over"},customerSupport:{id:"IDVFooter.customerSupport",defaultMessage:"Customer Support does not have this information",description:"message to inform user customer support does not have access to their pin"}}),wc=(0,A.vU)({title:{id:"CancelModal.title",defaultMessage:"Cancel ID Verification?",description:"Modal title to cancel identity verification"},description:{id:"CancelModal.description",defaultMessage:"You haven't finished ID verification yet. You'll have to start this process over if you cancel now.",description:"Modal Description to inform user that cancellation would lead to restarting the process all over again."},cancel:{id:"CancelModal.cancel",defaultMessage:"Yes, cancel",description:"Cancel the identity verification"},goBack:{id:"CancelModal.goBack",defaultMessage:"No, go back",description:"Go back and not cancel the identity verification"}}),Tc=(0,n.memo)((function({onCancel:e,visible:t,onClose:r}){const i=(0,P.Z)().formatMessage,a=(0,n.useCallback)((async()=>{await e()}),[e]);return(0,s.jsx)(Qe.Alert,{title:i(wc.title),body:i(wc.description),visible:t,stacked:!0,actionLayout:"vertical",preferredActionLabel:i(wc.cancel),onPreferredActionPress:a,dismissActionLabel:i(wc.goBack),onRequestClose:r,testID:"idv-cancel-modal"})})),xc=(0,n.memo)((function({step:e,status:t}){const r=(0,P.Z)().formatMessage,i=Xo().logEvent,a=$o().onCancel,c=Eo((0,Ke.useToggler)(!1),2),l=c[0],u=c[1],d=u.toggleOn,p=u.toggleOff,f=(0,n.useCallback)((async()=>{i(No.TwoFactorClickButton,Mo({action:M.Us.click,componentType:M.re.button,button_type:Lo.IdvCancel,step_type:e},t&&{idv_status:t})),p(),a()}),[e,t,i,p,a]),g=(0,n.useMemo)((()=>r(e===be.yg.InputRecoveryCode?vc.lostPin:vc.cancel)),[e,r]);return(0,s.jsxs)(o.VStack,{spacingVertical:3,justifyContent:"center",testID:"idv-footer",children:[(0,s.jsx)(Ze.Link,{variant:"body",onPress:d,testID:"idv-footer-cancel-btn",children:g}),e===be.yg.InputRecoveryCode&&(0,s.jsx)(Se.TextLabel2,{color:"foregroundMuted",as:"p",align:"center",spacingTop:2,children:r(vc.customerSupport)}),(0,s.jsx)(Tc,{onCancel:f,visible:l,onClose:p})]})}));const Sc="idv-status-id";function kc(){const e=Eo((0,n.useState)(),2),t=e[0],r=e[1],i=function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=(0,U.$z)(),c=ns().parseTwoFactorApiError,l=Xo().logEvent,u=(0,n.useCallback)(((e,t,r)=>{l(No.TwoFactorIdvStatus,Mo(Mo(Mo({},!!t&&{error_type:t}),!!r&&r),{},{action:M.Us.render,componentType:M.re.page,result:e}))}),[l]);return{getStatus:(0,n.useCallback)((async()=>{r(!0);const e={type:w.Y6.RECOVERY_CODE,rc:{associatedSecondFactorType:w.Y6.IDV},id:Sc},t=await s(e);if(r(!1),t instanceof Error){const e=c(t);return o(e),u(j.x4.Failure,e.type),null}const n=function(e){return{isSameDevice:e.status?.rc?.isSameDevice,idvStatus:e.status?.rc?.idvStatus,recoveryCodeStatus:e.status?.rc?.rcStatus}}(t);return u(j.x4.Success,void 0,n),n}),[s,c,u]),loading:t,error:a}}(),a=i.getStatus,o=i.loading,s=i.error,c=function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=nt(),c=ns().parseTwoFactorApiError,l=Xo().logEvent,u=(0,n.useCallback)(((e,t)=>{l(No.TwoFactorIdvInvalidate,Mo(Mo({},!!t&&{error_type:t}),{},{action:M.Us.render,componentType:M.re.page,result:e}))}),[l]);return{loading:t,error:a,invalidateRecoveryCode:(0,n.useCallback)((async()=>{r(!0);const e=await s({});if(r(!1),e instanceof Error){const t=c(e);return o(t),u(j.x4.Failure,t.type),!1}return u(j.x4.Success),!0}),[s,c,u])}}(),l=c.invalidateRecoveryCode,u=c.error,d=as().handleError,p=Xo().logEvent,f=(0,n.useCallback)((async()=>{if(!t)return;await l()&&r(be.yg.Idv)}),[l,t]),g=(0,n.useCallback)((()=>{switch(t){case be.yg.Idv:r(be.yg.SaveRecoveryCode);break;case be.yg.InputRecoveryCode:case be.yg.SaveRecoveryCode:r(be.yg.Status)}}),[t]),h=(0,n.useMemo)((()=>o||!s&&!t),[o,s,t]),m=(0,n.useCallback)((async()=>{const e=await a(),t=e?.idvStatus,n=e?.recoveryCodeStatus;if(!t)return void p(No.TwoFactorIdvProgress,{action:M.Us.measurement,componentType:M.re.page,progress_type:Vo.IdvStatusMissing});if(t===w.U5.INACTIVE)return p(No.TwoFactorIdvProgress,{action:M.Us.measurement,componentType:M.re.page,progress_type:Vo.IdvStarted}),void r(be.yg.Idv);let i;i=n===w.U5.INACTIVE?be.yg.SaveRecoveryCode:e.isSameDevice?be.yg.Status:be.yg.InputRecoveryCode,p(No.TwoFactorIdvProgress,{action:M.Us.view,componentType:M.re.page,progress_type:Vo.ReturnToIdv,step_type:i,is_same_device:Boolean(e.isSameDevice)}),r(i)}),[a,p]);return(0,n.useEffect)((()=>{m()}),[m]),(0,n.useEffect)((()=>{s&&d(s,!1)}),[s,d]),(0,n.useEffect)((()=>{u&&d(u)}),[u,d]),{step:t,loading:h,error:s,handleResetIdv:f,handleAdvanceStep:g,handleLoadInitialStep:m}}const Ec=(0,n.memo)((function(e){let t=e.step,r=Co(e,ko);const i=(0,n.useMemo)((()=>({step_type:t})),[t]);return(0,s.jsx)(js,Mo({event:i},r))}));function Ic(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=(()=>{const e=(0,_e.Db)(),t=(0,n.useCallback)((async(t,r)=>{const n={profile_id:t.profileId},i=ao(ao({},r||{}),{},{method:"POST"}),a=so();return await e(a,n,i)}),[e]);return t})(),c=ns().parseTwoFactorApiError,l=Xo().logEvent,u=(0,n.useCallback)(((e,t)=>{l(No.TwoFactorIdvActivate,Mo(Mo({},!!t&&{error_type:t}),{},{action:M.Us.render,componentType:M.re.page,result:e}))}),[l]);return{loading:t,error:a,activateIdv:(0,n.useCallback)((async e=>{r(!0);const t=await s({profileId:e});if(r(!1),t instanceof Error){const e=c(t);return o(e),u(j.x4.Failure,e.type),!1}return u(j.x4.Success),!0}),[s,c,u])}}const Cc=(0,n.memo)((function({onContinue:e,countryCode:t}){const r=Eo((0,n.useState)(),2),i=r[0],a=r[1],c=(0,P.Z)().locale,l=$o(),u=l.loader,d=l.action,p=Ic(),f=p.activateIdv,g=p.loading,h=p.error,m=as().handleError,b=Qo().target,y=ns().getTwoFactorError,_=Xo().logEvent,v=(0,n.useCallback)((async({id:e})=>{_(No.TwoFactorIdvProgress,{action:M.Us.measurement,componentType:M.re.page,progress_type:Vo.IdCaptureComplete,verification_id:e}),a(e)}),[_]),w=(0,n.useCallback)((async()=>{if(!i)return;const t=await f(i);_(No.TwoFactorIdvProgress,{action:M.Us.measurement,componentType:M.re.page,progress_type:Vo.IdvActivated,result:t}),t&&e()}),[i,f,_,e]),T=(0,n.useCallback)(((e,t,r)=>{(0,M.Kz)(e,Mo(Mo({},t),{},{twoFactorAction:d}),r)}),[d]),x=(0,n.useCallback)((e=>{_(No.TwoFactorIdCaptureError,{action:M.Us.measurement,componentType:M.re.page,errorName:e.name??"unknown"},M.E3.high);const t=y(be.D1.IdCaptureApiError,e);m(t,!0)}),[y,_,m]);return(0,n.useEffect)((()=>{_(No.TwoFactorIdvProgress,{action:M.Us.measurement,componentType:M.re.page,progress_type:Vo.IdCaptureStarted})}),[_]),(0,n.useEffect)((()=>{w()}),[w]),(0,n.useEffect)((()=>{h&&m(h,!1)}),[h,m]),(0,s.jsx)(Ec,{loading:g&&!!h,error:h?.message,onReload:w,step:be.yg.Idv,children:(0,s.jsx)(o.VStack,{testID:"idv-id-capture",alignItems:"center",children:(0,s.jsx)(ro,{allowMobileUpload:!0,forceFacematchType:"face",noBorder:!0,onPendingResponse:v,countryCode:t,locale:c,environment:b,source:"login-web",loader:u,applicationContext:"two-factor-web",onApiError:x,track:T,noMinWidth:!0,compact:!0})})})})),Dc=(0,n.memo)((function({onContinue:e}){const t=Ds(),r=t.challengeTwoFactor,i=t.challengeMetadata,a=t.handleChallengeError,o=t.loadingChallenge,c=t.challengeError,l=Xo().logEvent;(0,n.useEffect)((()=>{r(),l(No.TwoFactorIdvProgress,{action:M.Us.measurement,componentType:M.re.page,progress_type:Vo.IdvChallenged})}),[r,l]),(0,n.useEffect)((()=>{c&&a(c,!1)}),[c,a]);const u=(0,n.useMemo)((()=>o||!c&&!i),[o,c,i]),d=(0,n.useMemo)((()=>{if(i)return i.idv?.countryCode?i.idv.countryCode:(l({label:"idv.missing_country",loggingId:"9a3ea1a6-8d7c-4c26-8a5c-8a369151ce74"},{action:M.Us.measurement,componentType:M.re.page}),"US")}),[i,l]);return(0,s.jsx)(Ec,{loading:u,error:c?.message,onReload:r,step:be.yg.Idv,children:d&&(0,s.jsx)(Cc,{onContinue:e,countryCode:d})})})),Mc=(0,A.vU)({title:{id:"InputRecoveryCode.title",defaultMessage:"Enter your recovery pin",description:"Page main heading"},description:{id:"InputRecoveryCode.description",defaultMessage:"You have started your account recovery, but we don’t recognize this device. Enter the pin from the account recovery process to help us verify that it’s really you.",description:"Information about why pin is required"}}),jc=(0,n.memo)((function({onContinue:e}){const t=(0,P.Z)().formatMessage,r=Xo().logEvent,i=as().handleError;(0,n.useEffect)((()=>{r(No.TwoFactorIdvProgress,{action:M.Us.view,componentType:M.re.page,progress_type:Vo.RecoveryCodeRequested})}),[r]);const a=(0,n.useCallback)(((e,t)=>{r(No.TwoFactorIdvProgress,Mo(Mo({},t&&{error_type:t}),{},{action:M.Us.keyPress,componentType:M.re.text_input,progress_type:Vo.RecoveryCodeProvided,result:e}))}),[r]),c=(0,n.useCallback)((e=>{a(j.x4.Failure,e.type),i(e,!1)}),[a,i]),l=(0,n.useCallback)((()=>(a(j.x4.Success),e(),!1)),[e,a]),u=(0,n.useMemo)((()=>[t(Mc.description)]),[t]);return(0,s.jsxs)(o.VStack,{testID:"idv-input-recovery-code",children:[(0,s.jsx)(Ls,{title:t(Mc.title),description:u}),(0,s.jsx)(pc,{twoFactorType:w.Y6.RECOVERY_CODE,codeLength:6,onSuccess:l,onError:c,errorTestID:"idv-input-recovery-code-error"})]})}));const Ac=(0,A.vU)({title:{id:"SaveCodePrompt.title",defaultMessage:"Please don’t lose this pin",description:"Page main heading"},description:{id:"SaveCodePrompt.description",defaultMessage:"If you leave and come back on another device, you’ll need this recovery pin to finish verifying your ID.",description:"Information about why the pin is important"},toastWarnCopyCode:{id:"SaveCodePrompt.toastWarnCopyCode",defaultMessage:"Save pin to continue",description:"Toast message to show when user clicks continue without copying and downloading the code"},iSavedMyPin:{id:"SaveCodePrompt.iSavedMyPin",defaultMessage:"I saved my pin",description:"Button text to continue to next screen"},warning:{id:"SaveCodePrompt.warning",defaultMessage:"For security reasons, do not save this to your email or give this pin to anyone.",description:"Warning to not share pin"},writeDown:{id:"SaveCodePrompt.writeDown",defaultMessage:"Write down your pin",description:"Write down your pin for future references"},screenshot:{id:"SaveCodePrompt.screenshot",defaultMessage:"Screenshot your pin",description:"Take screenshot of the pin for future references"},store:{id:"SaveCodePrompt.store",defaultMessage:"Store in a safe place",description:"Store the written pin in a safe place"},save:{id:"SaveCodePrompt.save",defaultMessage:"Save locally on your device",description:"Save the screenshot locally on your device"},secure:{id:"SaveCodePrompt.secure",defaultMessage:"Secure",description:"Extremely secure way of storing the pin"},moderate:{id:"SaveCodePrompt.moderate",defaultMessage:"Moderate",description:"Moderately secure way of storing the pin"},copiedPinToast:{id:"SaveCodePrompt.copiedPinToast",defaultMessage:"Copied pin to clipboard",description:"Toast message telling user that pin was copied to clipboard"}}),Pc=(0,A.vU)({title:{id:"SaveConfirmationModal.title",defaultMessage:"Did you save your pin code?",description:"Confirmation from the user that the pin is saved"},description:{id:"SaveConfirmationModal.description",defaultMessage:"Confirm that you have saved your pin code to continue.",description:"Confirmation from the user that the pin is saved in order to continue"},goBack:{id:"SaveConfirmationModal.goBack",defaultMessage:"No, go back",description:"Go back to the screen showing the recovery pin"},continue:{id:"SaveConfirmationModal.continue",defaultMessage:"Yes, I saved my pin",description:"Continue to the next screen as the pin is saved"}}),Oc=(0,n.memo)((function({onContinue:e,visible:t,onClose:r}){const i=(0,P.Z)().formatMessage,a=(0,n.useCallback)((()=>{e()}),[e]);return(0,s.jsx)(Qe.Alert,{title:i(Pc.title),body:i(Pc.description),visible:t,stacked:!0,actionLayout:"vertical",preferredActionLabel:i(Pc.continue),onPreferredActionPress:a,dismissActionLabel:i(Pc.goBack),onRequestClose:r,testID:"idv-cancel-modal"})})),Fc=(0,n.memo)((function({image:e,title:t,description:r,securityLevel:n}){return(0,s.jsxs)(o.HStack,{justifyContent:"space-between",children:[(0,s.jsxs)(o.HStack,{alignItems:"center",children:[(0,s.jsx)(bt.Pictogram,{scaleMultiplier:.66,dimension:"48x48",name:e}),(0,s.jsxs)(o.VStack,{spacingHorizontal:2,children:[(0,s.jsx)(Se.TextHeadline,{as:"p",children:t}),(0,s.jsx)(Se.TextBody,{as:"p",color:"foregroundMuted",children:r})]})]}),(0,s.jsx)(Se.TextBody,{as:"p",children:n})]})})),Uc=(0,n.memo)((function({onContinue:e,code:t}){const r=(0,P.Z)().formatMessage,i=Xo().logEvent,a=Eo((0,Ke.useToggler)(!1),2),c=a[0],l=a[1],u=l.toggleOn,d=l.toggleOff,p=$o().onToast,f=(0,n.useCallback)((()=>{i(No.TwoFactorClickButton,{action:M.Us.click,componentType:M.re.button,button_type:Lo.IdvSavePin}),u()}),[u,i]),g=(0,n.useCallback)((()=>{i(No.TwoFactorClickButton,{action:M.Us.click,componentType:M.re.button,button_type:Lo.IdvSavePinConfirm}),e()}),[e,i]),h=(0,n.useCallback)((async()=>{await async function(e){return navigator.clipboard?.writeText(e)}(t),p({type:j.k.Reaction,message:r(Ac.copiedPinToast)})}),[t,p,r]);return(0,n.useEffect)((()=>{i(No.TwoFactorIdvProgress,{action:M.Us.view,componentType:M.re.page,progress_type:Vo.RecoveryCodeIssued})}),[i]),(0,s.jsxs)(o.VStack,{justifyContent:"space-between",testID:"idv-save-recovery-code",children:[(0,s.jsx)(Ls,{title:r(Ac.title),description:r(Ac.description),spacingBottom:3}),(0,s.jsxs)(o.VStack,{alignItems:"center",background:"primary",borderRadius:"standard",spacing:3,onClick:h,dangerouslySetClassName:"c1t1xw7q",children:[(0,s.jsx)(Se.TextDisplay1,{as:"h2",color:"negativeForeground",spacingBottom:1,testID:"idv-code",children:(0,s.jsxs)(o.HStack,{justifyContent:"center",gap:1,children:[(0,s.jsx)("span",{children:t.substring(0,3)}),(0,s.jsx)("span",{children:t.substring(3)})]})}),(0,s.jsx)(Se.TextLabel2,{as:"p",align:"center",color:"negativeForeground",children:r(Ac.warning)})]}),(0,s.jsxs)(o.VStack,{gap:4,spacingVertical:5,children:[(0,s.jsx)(Fc,{image:"completeQuiz",title:r(Ac.writeDown),description:r(Ac.store),securityLevel:r(Ac.secure)}),(0,s.jsx)(Fc,{image:"camera",title:r(Ac.screenshot),description:r(Ac.save),securityLevel:r(Ac.moderate)})]}),(0,s.jsx)(Te.Button,{variant:"secondary",testID:"idv-i-saved-my-pin-btn",block:!0,onPress:f,children:(0,s.jsx)(Se.TextHeadline,{as:"p",children:r(Ac.iSavedMyPin)})}),(0,s.jsx)(Oc,{onContinue:g,visible:c,onClose:d})]})})),Rc=(0,n.memo)((function({onContinue:e}){const t=function(){const e=Eo((0,n.useState)(""),2),t=e[0],r=e[1],i=is(),a=i.challengeTwoFactor,o=i.loading,s=i.error,c=as().handleError,l=(0,n.useCallback)((async()=>{const e=await a({secondFactorType:w.Y6.RECOVERY_CODE,recoveryCode:{associatedSecondFactorType:w.Y6.IDV}}),t=e?.recoveryCode?.codes?.[0];t&&r(t)}),[a]);return(0,n.useEffect)((()=>{l()}),[l]),(0,n.useEffect)((()=>{s&&c(s,!1)}),[s,c]),{getRecoveryCode:l,code:t,loading:o,error:s}}(),r=t.getRecoveryCode,i=t.code,a=t.loading,o=t.error,c=(0,n.useMemo)((()=>a||!i&&!o),[a,i,o]);return(0,s.jsx)(Ec,{loading:c,error:o?.message,onReload:r,step:be.yg.SaveRecoveryCode,children:(0,s.jsx)(Uc,{code:i,onContinue:e})})}));function Nc(){const e=Eo((0,n.useState)(),2),t=e[0],r=e[1],i=Ds(),a=i.handleVerifySuccess,o=i.handleVerifyError,s=function(){const e=Ds(),t=e.enabledTwoFactorIndex,r=e.getEnabledTwoFactor,i=e.setEnabledTwoFactor;return(0,n.useCallback)((()=>{0===t?r():i(0)}),[t,r,i])}(),l=Xo().logEvent,u=(0,n.useCallback)((e=>{l(No.TwoFactorIdvProgress,{action:M.Us.view,componentType:M.re.page,progress_type:Vo.IdvComplete,result:e})}),[l]),d=(0,n.useCallback)((e=>{const t=e.status?.proofToken,n=e.status?.rc?.rcStatus,i=e.status?.rc?.idvStatus;return i&&r(i),n===w.U5.ACTIVE?(u(j.x4.Success),a(t??c),!0):n===w.U5.INACTIVE?(s(),!0):i===w.U5.FAILED&&(u(j.x4.Failure),!0)}),[a,s,u]),p=Y({type:w.Y6.RECOVERY_CODE,rc:{associatedSecondFactorType:w.Y6.IDV},id:"idv-status-id",onResponse:d}),f=p.error,g=p.startPoll,h=p.loading;return(0,n.useEffect)((()=>{f&&o(f,!1)}),[f,o]),(0,n.useEffect)((()=>{g()}),[g]),{idvStatus:t,error:f,loading:h,startPoll:g}}const Lc=(0,n.memo)((function({title:e,description:t,onActionButtonPress:r,actionButtonText:n,actionButtonTestID:i,iconName:a,iconColor:c="primary",align:l="center",testID:u}){return(0,s.jsxs)(o.VStack,{testID:u,alignItems:l,children:[a&&(0,s.jsx)(o.Box,{height:128,width:128,alignItems:"center",justifyContent:"center",spacingBottom:4,children:(0,s.jsx)(mt.Icon,{testID:"base-status-icon",name:a,size:"l",color:c})}),(0,s.jsx)(Se.TextTitle1,{as:"h2",children:e}),(0,s.jsx)(o.Box,{spacingTop:2,spacingBottom:5,children:"string"==typeof t?(0,s.jsx)(Se.TextBody,{testID:"base-status-string-description",as:"p",color:"foregroundMuted",align:"center",children:t}):t}),(0,s.jsx)(Te.Button,{block:!0,onPress:r,testID:i,children:n})]})})),Bc=(0,A.vU)({title:{id:"IdvStatusFailed.title",defaultMessage:"We couldn’t verify your ID",description:"Page main heading"},instructionListTitle:{id:"IdvStatusFailed.instructionListTitle",defaultMessage:"Please make sure:",description:"Label for list of instruction to check"},useValidId:{id:"IdvStatusFailed.useValidId",defaultMessage:"You’re using a valid government-issued ID",description:"Instruction to verfiy if user is using valid id"},idMatchesTheInfo:{id:"IdvStatusFailed.idMatchesTheInfo",defaultMessage:"Your ID matches the personal info for your account exactly",description:"Instruction to make sure if the user info matches with the user id"},clearTextAndVisibleCard:{id:"IdvStatusFailed.clearTextAndVisibleCard",defaultMessage:"The text is clear and your entire card is visible",description:"Instruction to make sure the text is clear and enire id is visible"},needHelp:{id:"IdvStatusFailed.needHelp",defaultMessage:"Need help?",description:"Need help text"},tryAgain:{id:"IdvStatusFailed.tryAgain",defaultMessage:"Try again",description:"Button text to retry ID verification"},learnMore:{id:"IdvStatusFailed.learnMore",defaultMessage:"Learn more",description:"Link text for learn more"}});function qc(){const e=(0,P.Z)().formatMessage,t=(0,n.useMemo)((()=>[e(Bc.useValidId),e(Bc.idMatchesTheInfo),e(Bc.clearTextAndVisibleCard)]),[e]),r=(0,P.Z)().locale;return(0,s.jsxs)(o.VStack,{children:[(0,s.jsx)(Se.TextBody,{as:"p",color:"foregroundMuted",children:e(Bc.instructionListTitle)}),(0,s.jsx)(o.VStack,{spacingStart:3,spacingTop:1,spacingBottom:3,children:t.map((e=>(0,s.jsxs)(o.HStack,{gap:1,children:[(0,s.jsx)(Se.TextBody,{as:"p",color:"foregroundMuted",children:"•"}),(0,s.jsx)(Se.TextBody,{as:"p",color:"foregroundMuted",children:e})]},e)))}),(0,s.jsx)(o.Box,{alignItems:"center",children:(0,s.jsxs)(Se.TextBody,{as:"p",color:"foregroundMuted",children:[e(Bc.needHelp)," ",(0,s.jsx)(Se.Link,{variant:"body",to:`https://help.coinbase.com/${r}/coinbase/getting-started/getting-started-with-coinbase/id-doc-verification`,target:"_blank",rel:"noopener noreferrer",children:e(Bc.learnMore)})]})})]})}const Vc=(0,n.memo)((function({onRetry:e}){const t=(0,P.Z)().formatMessage,r=Xo().logEvent,i=(0,n.useCallback)((()=>{r(No.TwoFactorClickButton,{action:M.Us.click,componentType:M.re.button,button_type:Lo.IdvRestart}),e()}),[r,e]);return(0,s.jsx)(Lc,{title:t(Bc.title),align:"flex-start",description:(0,s.jsx)(qc,{}),actionButtonText:t(Bc.tryAgain),onActionButtonPress:i,actionButtonTestID:"idv-failed-try-again-button",testID:"idv-failed-status"})})),Wc=(0,A.vU)({title:{id:"IdvStatusPending.title",defaultMessage:"We’re verifying your ID",description:"Page main heading"},description:{id:"IdvStatusPending.description",defaultMessage:"You can close this page. This should take about 10 minutes; we’ll email you when we’re done.",description:"Description and info about loading time."}}),$c=(0,n.memo)((function(){const e=(0,P.Z)().formatMessage,t=Xo().logEvent;return(0,n.useEffect)((()=>{t(No.TwoFactorIdvProgress,{action:M.Us.view,componentType:M.re.page,progress_type:Vo.IdvProcessing})}),[t]),(0,s.jsxs)(o.VStack,{testID:"idv-pending-status",children:[(0,s.jsx)(hs,{size:240,testID:"idv-pending-loader"}),(0,s.jsx)(Se.TextTitle1,{as:"h1",align:"center",children:e(Wc.title)}),(0,s.jsx)(Se.TextBody,{as:"p",align:"center",color:"foregroundMuted",spacingTop:2,children:e(Wc.description)})]})})),zc=(0,n.memo)((function({onRetry:e,onUpdateStatus:t}){const r=Nc(),i=r.idvStatus,a=r.startPoll,o=r.error,c=r.loading;(0,n.useEffect)((()=>{i&&t(i)}),[t,i]);const l=(0,n.useMemo)((()=>i?i===w.U5.FAILED?(0,s.jsx)(Vc,{onRetry:e}):(0,s.jsx)($c,{}):null),[i,e]),u=(0,n.useMemo)((()=>!i||(i===w.U5.COMPLETED||!!o&&c)),[i,o,c]);return(0,s.jsx)(Ec,{loading:u,error:o?.message,onReload:a,step:be.yg.Status,children:l})})),Yc=(0,n.memo)((function(){const e=Eo((0,n.useState)(),2),t=e[0],r=e[1],i=kc(),a=i.step,c=i.loading,l=i.error,u=i.handleResetIdv,d=i.handleLoadInitialStep,p=i.handleAdvanceStep,f=(0,n.useMemo)((()=>{switch(a){case be.yg.Idv:return(0,s.jsx)(Dc,{onContinue:p});case be.yg.SaveRecoveryCode:return(0,s.jsx)(Rc,{onContinue:p});case be.yg.InputRecoveryCode:return(0,s.jsx)(jc,{onContinue:p});case be.yg.Status:return(0,s.jsx)(zc,{onRetry:u,onUpdateStatus:r});default:return null}}),[a,p,u]);return(0,s.jsx)(js,{loading:c,error:l?.message,onReload:d,children:(0,s.jsxs)(o.VStack,{children:[f,f&&a&&(0,s.jsx)(xc,{step:a,status:t})]})})}));const Hc=(0,n.memo)((function(){const e=function(){const e=Ds(),t=e.challengeTwoFactor,r=e.handleChallengeError,i=e.challengeError,a=e.loadingChallenge;return(0,n.useEffect)((()=>{i&&r(i,!1)}),[i,r]),{loading:(0,n.useMemo)((()=>!i||a),[i,a]),challengeTwoFactor:t,error:i}}(),t=e.error,r=e.challengeTwoFactor,i=function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=(0,U.yl)(),l=ts(),u=ns().parseTwoFactorApiError;return{loading:t,error:a,verifyNo2FA:(0,n.useCallback)((async e=>{r(!0);const t=l;e===w.Y6.BYPASS?t.bypass={}:e===w.Y6.NO_2FA&&(t.no2fa={});const n=await s(t);if(r(!1),n instanceof Error){const e=u(n);return o(e),null}return o(void 0),n.proofToken??c}),[s,l,u])}}(),a=i.error,o=i.verifyNo2FA,l=Ds(),u=l.handleVerifySuccess,d=l.twoFactorMethod,p=(0,n.useCallback)((async()=>{if(!d?.type)return;if(!await r())return;const e=await o(d?.type);Wo(e)&&u(e)}),[d,r,o,u]),f=(0,n.useMemo)((()=>t?.message??a?.message),[t,a]);return(0,n.useEffect)((()=>{p()}),[p]),(0,s.jsx)(js,{loading:!f,error:f,onReload:p})})),Gc="a1ir2zrf";function Kc({avatarSrc:e}){return(0,s.jsx)("div",{className:Gc,children:e?(0,s.jsx)("img",{src:e,alt:"Avatar"}):(0,s.jsx)("div",{className:"iconContainer",children:(0,s.jsx)(mt.Icon,{name:"profile",size:"s",color:"foregroundMuted"})})})}function Zc({onPress:e,username:t,avatarSrc:r}){return(0,s.jsx)(lo.Pressable,{onPress:e,backgroundColor:"background",borderColor:"line",borderWidth:"button",borderRadius:"input",width:"100%",className:"p86exkd",children:(0,s.jsxs)(o.HStack,{alignItems:"center",gap:1,spacing:2,children:[(0,s.jsx)(Kc,{avatarSrc:r}),(0,s.jsx)(Se.TextHeadline,{as:"p",overflow:"truncate",children:t})]})})}const Qc=(0,A.vU)({title:{id:"PasswordInputCode.title",defaultMessage:"Sign in to Coinbase",description:"Title for the Email Code Input screen prompting user to input the code"},description:{id:"PasswordInputCode.description",defaultMessage:"Not your device? Use a private or incognito window to sign in.",description:"Description for the Email Code Input screen explaining the reason for requiring 2FA"},attemptLimitReached:{id:"PasswordInputCode.attemptLimitReached",defaultMessage:"You’ve tried to enter your code too many times. Please wait for 5 minutes to try again.",description:"Error when user reaches the attempt limit for Email"}});const Jc=(0,n.memo)((function(){const e=(0,P.Z)().formatMessage,t=Ds(),r=t.twoFactorMethod,i=(t.challengeError,t.challengeMetadata),a=t.handleVerifySuccess,l=(t.handleVerifyError,Vs()),u=Eo((0,n.useState)(!i?.identify),2),d=u[0],p=u[1],f=function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=(0,U.yl)(),l=ts(),u=ns().parseTwoFactorApiError;return{loading:t,error:a,verifyPassword:(0,n.useCallback)((async(e,t)=>{r(!0);const n={password:t,email:e},i=l;i.password=n;const a=await s(i);if(r(!1),a instanceof Error){const e=u(a);return o(e),null}return o(void 0),a.proofToken??c}),[s,l,u])}}(),g=f.verifyPassword,h=Eo((0,n.useState)(!1),2),m=(h[0],h[1]),b=Eo((0,n.useState)(""),2),y=b[0],_=b[1],v=Eo((0,n.useState)("foregroundMuted"),2),w=v[0],T=v[1],x=function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=(0,n.useCallback)((()=>r((e=>!e))),[r]);return[(0,n.useMemo)((()=>t?"text":"password"),[t]),(0,s.jsx)(Te.IconButton,{name:t?"visibleActive":"visibleInactive",transparent:!0,variant:"foregroundMuted",onPress:i,accessibilityLabel:"show-password"})]}(),S=Eo(x,2),k=S[0],E=S[1],I=Eo((0,n.useState)(""),2),C=I[0],D=I[1],M=Eo((0,n.useState)(""),2),j=M[0],A=M[1],O=Eo((0,n.useState)(""),2),F=O[0],R=(O[1],(0,n.useCallback)((()=>{p(!1)}),[])),N=(0,n.useCallback)((e=>(e.preventDefault(),D(""),T("foregroundMuted"),m(e.target.value.length>5),_(e.target.value))),[]),L=(0,n.useCallback)((e=>(e.preventDefault(),A(e.target.value))),[]),B=(0,n.useCallback)((async e=>{if(e.preventDefault(),d){const e=await g(j,y);Wo(e)&&a(e)}else p(!0)}),[j,d,y,g,a]);return(0,s.jsxs)(o.VStack,{testID:"password-input-code",children:[(0,s.jsx)(Ls,{title:e(Qc.title,{email:l(r)}),description:e(Qc.description)}),(0,s.jsxs)("form",{onSubmit:B,children:[!d&&(0,s.jsx)(co.TextInput,{autoFocus:!0,label:"Email",placeholder:"Your email address",onChange:L,testID:"email-input"}),d&&(0,s.jsxs)(o.VStack,{spacingBottom:3,children:[(0,s.jsx)(o.Box,{spacingBottom:3,children:(0,s.jsx)(Zc,{username:j,avatarSrc:F,onPress:R})}),(0,s.jsx)(co.TextInput,{autoFocus:!0,label:"Enter your password",value:y,onChange:N,variant:w,helperText:C,type:k,end:E,testID:"password-input"})]}),(0,s.jsx)(o.VStack,{spacingBottom:5,spacingTop:2,children:(0,s.jsx)(Te.Button,{type:"submit",testID:"password-submit-button",children:"Continue"})})]})]})})),Xc=(0,A.vU)({updatePasswordTitle:{id:"PasswordTryAnotherWay.updatePasswordTitle",defaultMessage:"Verify by ID",description:"Title for the Password Try Another Way option to update phone number"},updatePasswordDescription:{id:"PasswordTryAnotherWay.updatePasswordDescription",defaultMessage:"New password? Verify your identity update your email.",description:"Description for the Password Try Another Way option to verify identity and update phone number"}}),el=(0,n.memo)((function({onCloseDrawer:e}){const t=(0,P.Z)().formatMessage,r=oc().HELP_OPTION_URLS,i=(0,n.useMemo)((()=>({id:qo.PasswordTroubleshoot,to:r[w.Y6.PASSWORD]})),[r]),a=nc({showDefaultIDVOption:!1,idvOption:(0,n.useMemo)((()=>({id:qo.PasswordTroubleshoot,title:t(Xc.updatePasswordTitle),description:t(Xc.updatePasswordDescription)})),[t])});return(0,s.jsx)(tc,{onCloseDrawer:e,twoFactorType:w.Y6.PASSWORD,alternateTwoFactorOptions:a,troubleshootOption:i,testID:"password-try-another-way"})})),tl=(0,n.memo)((function(){return(0,s.jsx)(Rs,{BaseView:Jc,DrawerView:el,toggleTestID:"password-toggle-help-button",twoFactorType:w.Y6.PASSWORD})})),rl=(0,A.vU)({pushRateLimitError:{id:"ChallengePush.pushRateLimitError",defaultMessage:"Please wait 30 seconds before resending a new Coinbase security prompt.",description:"Error message informing user to wait before sending new push security prompt"}});const nl="PUSH_VERIFIED_COUNT";function il(){const e=parseInt(window.localStorage.getItem(nl)??"0");return Number.isNaN(e)?0:e}const al=(0,A.vU)({title:{id:"PushFailed.title",defaultMessage:"Verification denied",description:"Generic title message for the user to inform them that the push verification was stopped"},description:{id:"PushFailed.description",defaultMessage:"You indicated that you do not recognize this activity in the Security Prompt sent to your mobile device.",description:"Generic description informing user that the push verification attempt was stopped"},tryAgainDescription:{id:"PushFailed.tryAgainDescription",defaultMessage:"If this was a mistake, you can re-send the prompt and try again.",description:"Message informing user that they can try again if stopping the verification was a mistake"},tryAgain:{id:"PushFailed.tryAgain",defaultMessage:"Try again",description:"Button text telling user to try again"}}),ol=(0,n.memo)((function({onTryAgainPress:e}){const t=(0,P.Z)().formatMessage,r=Xo().logEvent,i=$o().config,a=(0,n.useCallback)((()=>{r(No.TwoFactorClickButton,{action:M.Us.click,componentType:M.re.button,button_type:Lo.PushTryAgain}),e()}),[r,e]),c=i?.push??{},l=c.failedTitle,u=c.failedDescription,d=(0,n.useMemo)((()=>({title:l??t(al.title),description:u??t(al.description),body:t(al.tryAgainDescription)})),[l,u,t]);return(0,s.jsxs)(o.VStack,{testID:"push-failed",children:[(0,s.jsx)(Ls,{title:d.title,description:d.description,spacingBottom:1}),(0,s.jsx)(Se.TextBody,{as:"p",color:"foregroundMuted",children:d.body}),(0,s.jsx)(o.Box,{spacingTop:5,children:(0,s.jsx)(Te.Button,{block:!0,onPress:a,testID:"push-try-again-button",children:t(al.tryAgain)})})]})})),sl=(0,A.vU)({title:{id:"PushMultipleTabs.title",defaultMessage:"Multiple Tabs Open",description:"Title inform user that they have multiple tabs open trying to sign-in"},description:{id:"PushMultipleTabs.description",defaultMessage:"Continue signing in on the new browser page you opened.",description:"Instructs user that this page is no longer valid because a newer sign in attempt was started on another browser page"}}),cl=(0,n.memo)((function(){const e=(0,P.Z)().formatMessage;return(0,s.jsxs)(o.VStack,{flexGrow:1,alignItems:"center",spacing:4,testID:"push-multiple-tabs",children:[(0,s.jsx)(xe.Pictogram,{alt:"browserMultiPlatform",name:"browserMultiPlatform",dimension:"64x64",scaleMultiplier:2,testID:"push-multiple-tabs-open-image"}),(0,s.jsx)(Se.TextTitle1,{as:"h3",spacingTop:6,align:"center",color:"foreground",children:e(sl.title)}),(0,s.jsx)(Se.TextBody,{as:"p",spacingTop:2,align:"center",color:"foregroundMuted",children:e(sl.description)})]})})),ll=(0,A.vU)({title:{id:"PushPrompt.title",defaultMessage:"Open the Coinbase app on your mobile device",description:"Title for user instructing them to open coinbase app in their device"},description:{id:"PushPrompt.description",defaultMessage:'To protect your account, we’re making sure this is actually you. Please open Coinbase on your mobile device and tap "Yes" on the prompt.',description:'Informs user we are confirming the activity was initiated by them, and that they should click "Yes" on the mobile prompt to continue'},openFAQButtonLabel:{id:"PushPrompt.openFAQButtonLabel",defaultMessage:"Why am I receiving this message?",description:"Label of the button which opens FAQs"}}),ul=(0,A.vU)({changeQuestion:{id:"PushFAQModal.changeQuestion",defaultMessage:"Why did this change?",description:"FAQ question, why user is seeing Push two factor"},changeAnswer:{id:"PushFAQModal.changeAnswer",defaultMessage:"We've updated your 2-step verification method to Coinbase Security Prompt. Security Prompt is faster and more reliable because you don't need to get a text message, and it will help you stay more secure.",description:"FAQ answer, explaining user that the push is more secure, and we updated their two factor method to push notifications by default."},updateSettingsQuestion:{id:"PushFAQModal.updateSettingsQuestion",defaultMessage:"How can I change my 2-step verification method?",description:"FAQ question, how can user change the 2-step verification method"},updateSettingsAnswer:{id:"PushFAQModal.updateSettingsAnswer",defaultMessage:"You can change your 2-step verification method within your Coinbase account Settings in the Security tab.",description:"FAQ answer, instruction for user to change their default two factor method"}}),dl=(0,n.memo)((function({visible:e,onClose:t}){const r=(0,P.Z)().formatMessage,i=(0,n.useMemo)((()=>[{question:r(ul.changeQuestion),answer:r(ul.changeAnswer)},{question:r(ul.updateSettingsQuestion),answer:r(ul.updateSettingsAnswer)}]),[r]);return(0,s.jsxs)(po.Modal,{visible:e,hideCloseButton:!1,hideDividers:!0,onRequestClose:t,children:[(0,s.jsx)(Qe.ModalHeader,{}),(0,s.jsx)(fo.ModalBody,{children:(0,s.jsx)(o.VStack,{testID:"faq-list",children:i.map((({question:e,answer:t})=>(0,s.jsxs)(o.VStack,{spacingBottom:3,children:[(0,s.jsx)(Se.TextBody,{as:"p",spacingBottom:1,children:e}),(0,s.jsx)(Se.TextBody,{as:"p",color:"foregroundMuted",children:t})]},e)))})})]})})),pl=(0,n.memo)((function(){const e=(0,P.Z)().formatMessage,t=Eo((0,Ke.useToggler)(),2),r=t[0],i=t[1],a=i.toggleOn,c=i.toggleOff,l=il()<3,u=Xo().logEvent,d=(0,n.useCallback)((()=>{u(No.TwoFactorClickButton,{action:M.Us.click,componentType:M.re.button,button_type:Lo.PushOpenFAQ}),a()}),[a,u]),p=(0,n.useMemo)((()=>({title:e(ll.title),description:e(ll.description),openFAQButtonLabel:e(ll.openFAQButtonLabel)})),[e]);return(0,s.jsxs)(o.VStack,{testID:"push-prompt",children:[(0,s.jsx)(Ls,{title:p.title,description:p.description,spacingBottom:1}),l&&(0,s.jsx)(o.Box,{spacingTop:3,children:(0,s.jsx)(Se.Link,{variant:"body",onPress:d,testID:"open-faq-button",children:p.openFAQButtonLabel})}),(0,s.jsx)(o.Box,{justifyContent:"center",spacingTop:5,children:(0,s.jsx)(uo.SpotSquare,{name:"phoneNotifications",testID:"device-notification-image",scaleMultiplier:2})}),(0,s.jsx)(o.Box,{spacingTop:5,children:(0,s.jsx)($s,{twoFactorType:w.Y6.PUSH,startWithCooldown:!0})}),(0,s.jsx)(dl,{visible:r,onClose:c})]})})),fl=(0,A.vU)({troubleshootDescription:{id:"PushTryAnotherWay.troubleshootDescription",defaultMessage:"Not receiving your security prompt? Install the latest version of the Coinbase app or try refreshing the app. For other issues, visit our Help Center.",description:"Description for Troubleshoot option telling user how to resolve issues around not receiving security prompts for two-factor authentication"}}),gl=(0,n.memo)((function({onCloseDrawer:e}){const t=(0,P.Z)().formatMessage,r=nc({showDefaultIDVOption:!1}),i=oc().HELP_OPTION_URLS,a=(0,n.useMemo)((()=>({id:qo.PushTroubleshoot,to:i[w.Y6.PUSH],description:t(fl.troubleshootDescription)})),[i,t]);return(0,s.jsx)(tc,{onCloseDrawer:e,twoFactorType:w.Y6.PUSH,alternateTwoFactorOptions:r,troubleshootOption:a,testID:"push-try-another-way"})})),hl=[j.mu.VerifyDenied,j.mu.MissingCacheKey,j.mu.ChallengeInvalidated],ml=(0,n.memo)((function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=function(){const e=(0,P.Z)().formatMessage,t=Ds(),r=t.challengeTwoFactor,i=t.challengeError,a=t.handleChallengeError,o=t.challengeMetadata;return(0,n.useEffect)((()=>{r()}),[r]),(0,n.useEffect)((()=>{i&&(i.type===be.D1.TooManyRequests&&(i.message=e(rl.pushRateLimitError)),a(i))}),[i,a,e]),{statusId:o?.push?.statusId,challengeTwoFactor:r}}(),a=i.statusId,o=i.challengeTwoFactor,c=Ns({id:a,showErrorToast:!1,onSuccess:(0,n.useCallback)((()=>{!function(){const e=il();window.localStorage.setItem(nl,(e+1).toString())}()}),[]),onError:(0,n.useCallback)((e=>{e.type===j.mu.VerifyDenied&&r(!0)}),[])}).error,l=(0,n.useCallback)((()=>{r(!1),o()}),[o]),u=(0,n.useCallback)((()=>{o()}),[o]),d=(0,n.useMemo)((()=>{if(!c||!hl.includes(c.type))return c?.message}),[c]),p=(0,n.useMemo)((()=>{if(c?.type===j.mu.ChallengeInvalidated)return(0,s.jsx)(cl,{});const e=t?()=>(0,s.jsx)(ol,{onTryAgainPress:l}):pl;return(0,s.jsx)(Rs,{BaseView:e,DrawerView:gl,twoFactorType:w.Y6.PUSH,toggleTestID:"push-toggle-help-button"})}),[c,t,l]);return(0,s.jsx)(js,{error:d,onReload:u,children:p})}));function bl(){const e=Eo((0,n.useState)("security_questions"),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=(0,U.yl)(),a=ts(),o=ns().parseTwoFactorApiError;return{loading:t,verifyQuestions:(0,n.useCallback)((async(e,t)=>{r(!0);const n=a;e===w.Y6.SECURITY_QUESTION&&(n.securityQuestion={answers:[...t]});const s=await i(n);return r(!1),s instanceof Error?{error:o(s)}:{proofToken:s?.proofToken??c}}),[a,i,o])}}().verifyQuestions,l=$o().onSuccess,u=as().handleError,d=(0,n.useCallback)((()=>{switch(t){case"security_questions":r("identity_card_number");break;case"identity_card_number":r("status")}}),[t]),p=(0,n.useCallback)((()=>{r("security_questions")}),[]),f=(0,n.useCallback)((async e=>{d();try{if(!e)throw new Error("Payload was empty");const t=await s(w.Y6.SECURITY_QUESTION,e),r=t.proofToken,n=t.error;o(w.U5.PENDING),r?l(r,j.QA.SecurityQuestions):n&&n.type===be.D1.InvalidSecurityQuestionAttempt?(o(w.U5.FAILED),u({error:n,type:n.type,message:n.message},!1)):n&&n.type===be.D1.SQAttemptLimitReached&&(o(w.U5.UNKNOWN),u({error:n,type:n.type,message:n.message},!1))}catch(e){console.error(e)}}),[u,l,d,s]),g=(0,n.useCallback)((e=>{f(e)}),[f]);return{step:t,status:a,setSecurtityStep:d,handleRetryFlow:p,handleSubmitQuestions:g}}const yl=(0,A.vU)({idPrompt:{id:"IDCard.idPrompt",defaultMessage:"Enter your {placeholder1} number",description:"Title for the ID card page"},driverLicense:{id:"IDCard.driverLicense",defaultMessage:"Driver's License",description:"US ID for driving"},continue:{id:"IDCard.continue",defaultMessage:"Continue",description:"Button to proceed to the next page"},verifyQuestionsPrompt:{id:"IDCard.verifyQuestionsPrompt",defaultMessage:"Providing information below will give you access to your account for 24 hours. Make sure info entered matches what we have on file.",description:"Modal title to cancel identity verification"},dLIdPlaceholder:{id:"IDCard.dLIdPlaceholder",defaultMessage:"ID",description:"General identification"},passportPlaceholder:{id:"IDCard.passportPlaceholder",defaultMessage:"passport",description:'name for travel ID "passport" for travel'},nationalId:{id:"IDCard.nationalId",defaultMessage:"national ID",description:"name for national ID for travel"},nameErrorTxt:{id:"IDCard.nameErrorTxt",defaultMessage:"Please enter your card number",description:"Notify user they need to enter a number befor proceeding"}}),_l=(0,n.memo)((function({handleSubmit:e,idNumber:t,userIdCardType:r,updateIdNumber:i,payload:a}){const c=(0,P.Z)().formatMessage,l=Eo((0,n.useState)(!1),2),u=l[0],d=l[1],p=Eo((0,n.useState)(),2),f=p[0],g=p[1],h=Eo((0,n.useState)(),2),m=h[0],b=h[1],y=(0,n.useCallback)((e=>{d(!1),b(void 0),g(""),""===e?(d(!1),b("negative"),g(c(yl.nameErrorTxt))):d(!0)}),[c]),_=(0,n.useCallback)((e=>{const t=e.currentTarget.value;i(t),y(t)}),[i,y]),v=(0,n.useCallback)((()=>c("SECURITY_QUESTION_ID_DRIVING_LICENSE"===r?yl.dLIdPlaceholder:"SECURITY_QUESTION_ID_PASSPORT"===r?yl.passportPlaceholder:yl.nationalId)),[c,r]),w=(0,n.useCallback)((()=>{e(a)}),[e,a]),T=(0,n.useMemo)((()=>{const e=v();return{placeholder1:(0,s.jsx)(Se.TextTitle2,{color:"primary",as:"label",children:e})}}),[v]);return(0,s.jsxs)(o.VStack,{gap:1,children:[(0,s.jsx)(lt.Box,{spacingBottom:2,width:"100%",children:(0,s.jsx)(Se.TextTitle2,{as:"h2",children:c(yl.idPrompt,T)})}),(0,s.jsx)(lt.Box,{spacingBottom:3,children:(0,s.jsx)(Se.TextBody,{as:"p",children:c(yl.verifyQuestionsPrompt)})}),(0,s.jsx)(o.VStack,{gap:2,children:(0,s.jsx)(co.TextInput,{variant:m,helperText:f,value:t,onChange:_,label:c(yl.idPrompt,{placeholder1:v()}),placeholder:v(),type:"text",autoComplete:"off"})}),(0,s.jsx)(lt.Box,{spacingTop:4,children:(0,s.jsx)(ze.Button,{disabled:!u,onPress:w,block:!0,children:c(yl.continue)})})]})})),vl=(0,A.vU)({socialSecurity:{id:"SecurityQuestion.socialSecurity",defaultMessage:"Enter your Social Security Number",description:"Lable to prompt user to enter their social security"},socialPlaceholder:{id:"SecurityQuestion.socialPlaceholder",defaultMessage:"000-00-0000",description:"Placeholder of the social security input"},verifyTitle:{id:"SecurityQuestion.verifyTitle",defaultMessage:"Verify your Identity",description:"Modal title to cancel identity verification"},verifyQuestionsPrompt:{id:"SecurityQuestion.verifyQuestionsPrompt",defaultMessage:"Providing information below will give you access to your account for 24 hours. Make sure info entered matches what we have on file.",description:"Modal title to cancel identity verification"},nameLabel:{id:"SecurityQuestion.nameLabel",defaultMessage:"Enter your name",description:"Title for a user to state their name in the input"},firstNamePlaceholder:{id:"SecurityQuestion.firstNamePlaceholder",defaultMessage:"First name",description:"Placeholder for a users given name appearing in the input"},familyNamePlaceholder:{id:"SecurityQuestion.familyNamePlaceholder",defaultMessage:"Family name",description:"Placeholder for a users family or last name appearing in the input"},dobLabel:{id:"SecurityQuestion.dobLable",defaultMessage:"Date of Birth",description:"Label for a users date of birth "},continue:{id:"SecurityQuestion.continue",defaultMessage:"Continue",description:"Button to proceed to the next page"},socialErrorTxt:{id:"SecurityQuestion.socialErrorTxt",defaultMessage:"Please check the format of your social",description:"Error to let users know they need to enter their social in an appropriate format"},nameErrorTxt:{id:"SecurityQuestion.nameErrorTxt",defaultMessage:"Please enter your name",description:"A prompt to tell users to enter their name"},dateErrorTxt:{id:"SecurityQuestion.dateErrorTxt",defaultMessage:"Please enter a valid birthday",description:"A prompt to ensure the user puts in a valid birthday"}}),wl=(0,n.memo)((function({handleContinue:e,firstName:t,updateFirstName:r,familyName:i,updateFamilyName:a,dob:o,updateDob:c,socialSecurity:l,updateSocialSecurity:u,hasSocialSecurityNo:d}){const p=(0,P.Z)().formatMessage,f=Eo((0,n.useState)(),2),g=f[0],h=f[1],m=Eo((0,n.useState)(),2),b=m[0],y=m[1],_=Eo((0,n.useState)(),2),v=_[0],w=_[1],T=Eo((0,n.useState)(),2),x=T[0],S=T[1],k=Eo((0,n.useState)(),2),E=k[0],I=k[1],C=Eo((0,n.useState)(),2),D=C[0],M=C[1],j=Eo((0,n.useState)(!1),2),A=j[0],O=j[1],F=Eo((0,n.useState)(),2),U=F[0],R=F[1],N=Eo((0,n.useState)(),2),L=N[0],B=N[1],q=Eo((0,n.useState)(!1),2),V=q[0],W=q[1],$=Eo((0,n.useState)(),2),z=$[0],Y=$[1],H=Eo((0,n.useState)(),2),G=H[0],K=H[1],Z=(0,n.useCallback)((e=>{h(!1),w(void 0),y(""),""===e?(h(!1),w("negative"),y(p(vl.nameErrorTxt))):h(!0)}),[p]),Q=(0,n.useCallback)((e=>{S(!1),M(void 0),I(""),""===e?(S(!1),M("negative"),I(p(vl.nameErrorTxt))):S(!0)}),[p]),J=(0,n.useCallback)((e=>{O(!1),B(void 0),R("");const t=/^(19|20)\d\d[- /.](0[1-9]|1[012])[- /.](0[1-9]|[12][0-9]|3[01])$/.test(e);t?O(t):(O(t),B("negative"),R(p(vl.dateErrorTxt)))}),[p]),X=(0,n.useCallback)((e=>{W(!1),K(void 0),Y("");const t=/^(?!666|000|9\d{2})\d{3}-(?!00)\d{2}-(?!0{4})\d{4}$/.test(e);t?W(t):(W(t),K("negative"),Y(p(vl.socialErrorTxt)))}),[p]),ee=d&&!V||!g||!x||!A,te=(0,n.useCallback)((e=>{const t=e.currentTarget.value;r(t),Z(t)}),[r,Z]),re=(0,n.useCallback)((e=>{const t=e.currentTarget.value;a(t),Q(t)}),[a,Q]),ne=(0,n.useCallback)((e=>{const t=e.currentTarget.value;c(t),J(t)}),[c,J]),ie=(0,n.useCallback)((e=>{const t=e.currentTarget.value;u(t),X(t)}),[u,X]);return(0,s.jsxs)(ot.VStack,{gap:1,children:[(0,s.jsx)(lt.Box,{spacingBottom:2,children:(0,s.jsx)(go.TextTitle2,{as:"h2",children:p(vl.verifyTitle)})}),(0,s.jsx)(lt.Box,{spacingBottom:3,children:(0,s.jsx)(gt.TextBody,{as:"p",children:p(vl.verifyQuestionsPrompt)})}),(0,s.jsxs)(ot.VStack,{gap:2,children:[(0,s.jsx)(co.TextInput,{variant:v,helperText:b,value:t,onChange:te,label:p(vl.nameLabel),placeholder:p(vl.firstNamePlaceholder),type:"text",autoComplete:"off"}),(0,s.jsx)(co.TextInput,{variant:D,helperText:E,value:i,onChange:re,placeholder:p(vl.familyNamePlaceholder),type:"text",autoComplete:"off"})]}),(0,s.jsx)(lt.Box,{children:(0,s.jsx)(co.TextInput,{variant:L,helperText:U,value:o,onChange:ne,type:"date",label:p(vl.dobLabel),autoComplete:"off"})}),d&&(0,s.jsx)(lt.Box,{children:(0,s.jsx)(co.TextInput,{helperText:z,variant:G,onChange:ie,value:l,label:p(vl.socialSecurity),placeholder:p(vl.socialPlaceholder),autoComplete:"off"})}),(0,s.jsx)(lt.Box,{spacingTop:4,children:(0,s.jsx)(ze.Button,{disabled:ee,onPress:e,block:!0,children:p(vl.continue)})})]})})),Tl=(0,A.vU)({notVerifiedTitle:{id:"FailedPageOne.notVerifiedTitle",defaultMessage:"We couldn't verify your information",description:"Title of the first attempt failure page after security questions"},notVerifiedDescription:{id:"FailedPageOne.verifiedDescription",defaultMessage:"Please make sure that your info matches the personal info on your account exactly.",description:"Description letting users know double check the info they provided that it is correct"},uploadID:{id:"FailedPageOne.uploadID",defaultMessage:"Upload",description:"Button to take the user to the ID upload page to try the other recovery method"},retry:{id:"FailedPageOne.retry",defaultMessage:"Retry",description:"Button to let users attempt the process again"},needHelp:{id:"FailedPageOne.needHelp",defaultMessage:"Need help? {placeholder}",description:"Let users know they can press the blue words to contact customer service"},helpPlaceholder:{id:"FailedPageOne.PageOne",defaultMessage:"Contact us.",description:"Link within the need help text for users to click on to reach out to coinbase"}}),xl=(0,n.memo)((function({handleRetry:e}){const t=(0,P.Z)().formatMessage,r=(0,n.useMemo)((()=>({placeholder:(0,s.jsx)(Se.TextBody,{color:"primary",as:"label",children:t(Tl.helpPlaceholder)})})),[t]);return(0,s.jsxs)(o.VStack,{width:"100%",gap:4,alignItems:"center",children:[(0,s.jsxs)(o.VStack,{width:"100%",gap:2,children:[(0,s.jsx)(lt.Box,{children:(0,s.jsx)(Se.TextTitle2,{as:"h1",children:t(Tl.notVerifiedTitle)})}),(0,s.jsx)(lt.Box,{children:(0,s.jsx)(Se.TextBody,{as:"p",children:t(Tl.notVerifiedDescription)})})]}),(0,s.jsx)(lt.Box,{width:"100%",children:(0,s.jsx)(Te.Button,{onPress:e,block:!0,children:t(Tl.retry)})}),(0,s.jsx)(lt.Box,{width:"100%",children:(0,s.jsx)(Te.Button,{variant:"secondary",onPress:e,block:!0,children:t(Tl.uploadID)})}),(0,s.jsx)(lt.Box,{minHeight:"60%",alignItems:"center",children:(0,s.jsx)(Se.TextBody,{as:"p",children:t(Tl.needHelp,r)})})]})})),Sl=(0,A.vU)({notVerifiedTitle:{id:"FailedPageTwo.notVerifiedTitle",defaultMessage:"We couldn't verify your information",description:"Title of the second attempt failure page after security questions"},failedAttemptTwoDescription:{id:"FailedPageTwo.failedAttemptTwoDescription",defaultMessage:"The information you provided doesn't match the information we have on file. Please contact our Customer Support team.",description:"Let users know the information they entered does not match what we have in our system and to reach out to CX"},contactUs:{id:"FailedPageTwo.contactUs",defaultMessage:"Contact us.",description:"Button to allow users to reach out to coinbase via customer service"},toSignIn:{id:"FailedPageTwo.toSignIn",defaultMessage:"Back to sign in",description:"Button to take users to the sign in page"}}),kl=(0,n.memo)((function(){const e=(0,P.Z)().formatMessage,t=(0,n.useCallback)((()=>{}),[]),r=(0,n.useCallback)((()=>{}),[]);return(0,s.jsxs)(o.VStack,{width:"100%",gap:4,alignItems:"center",children:[(0,s.jsx)(lt.Box,{children:(0,s.jsx)(xe.HeroSquare,{name:"verifyInfo"})}),(0,s.jsxs)(o.VStack,{width:"100%",alignItems:"center",gap:2,children:[(0,s.jsx)(lt.Box,{children:(0,s.jsx)(Se.TextTitle2,{as:"h1",children:e(Sl.notVerifiedTitle)})}),(0,s.jsx)(lt.Box,{children:(0,s.jsx)(Se.TextBody,{align:"center",as:"p",children:e(Sl.failedAttemptTwoDescription)})})]}),(0,s.jsx)(lt.Box,{width:"100%",children:(0,s.jsx)(Te.Button,{onPress:t,block:!0,children:e(Sl.contactUs)})}),(0,s.jsx)(lt.Box,{width:"100%",children:(0,s.jsx)(Te.Button,{variant:"secondary",onPress:r,block:!0,children:e(Sl.toSignIn)})})]})})),El=(0,A.vU)({title:{id:"PendingPage.title",defaultMessage:" ... we are verifying your questions",description:"Place holder for loading page"}}),Il=(0,n.memo)((function(){const e=(0,P.Z)().formatMessage;return(0,s.jsxs)(ot.VStack,{spacingStart:3,spacingBottom:4,children:[(0,s.jsx)(hs,{size:240,testID:"idv-pending-loader"}),(0,s.jsx)(Se.TextTitle2,{as:"h2",align:"center",children:e(El.title)})]})})),Cl=(0,n.memo)((function({status:e,handleRetry:t}){const r=(0,n.useMemo)((()=>{if(!e)return null;switch(e){case w.U5.FAILED:return(0,s.jsx)(xl,{handleRetry:t});case w.U5.UNKNOWN:return(0,s.jsx)(kl,{});case w.U5.PENDING:default:return(0,s.jsx)(Il,{})}}),[t,e]);return(0,s.jsx)(lt.Box,{width:"100%",height:"100%",children:r})})),Dl=(0,n.memo)((function(){const e=bl(),t=e.step,r=e.status,i=e.setSecurtityStep,a=e.handleRetryFlow,c=e.handleSubmitQuestions,l=function(){const e=Eo((0,n.useState)([]),2),t=e[0],r=e[1],i=Ds(),a=i.loadingChallenge,o=i.challengeError,s=i.challengeTwoFactor,c=i.handleChallengeError,l=(0,n.useCallback)((async()=>{const e=await s();e?.securityQuestion?.questions?r(e.securityQuestion.questions):o&&c(o)}),[o,s,c]);(0,n.useEffect)((()=>{l()}),[l]);const u=(0,n.useMemo)((()=>Boolean(t.find((e=>"SECURITY_QUESTION_ID_SSN"===e.id)))),[t]),d=(0,n.useMemo)((()=>t.find((e=>"SECURITY_QUESTION_ID_PASSPORT"===e.id||"SECURITY_QUESTION_ID_NATIONAL_ID"===e.id||"SECURITY_QUESTION_ID_DRIVING_LICENSE"===e.id))?.id),[t]);return{loadingChallenge:a,securityQuestionList:t,challengeQuestionList:l,hasSocialSecurityNo:u,userIdCardType:d}}(),u=l.loadingChallenge,d=l.hasSocialSecurityNo,p=l.userIdCardType,f=function(e,t){const r=Eo((0,n.useState)(""),2),i=r[0],a=r[1],o=Eo((0,n.useState)(""),2),s=o[0],c=o[1],l=Eo((0,n.useState)(""),2),u=l[0],d=l[1],p=Eo((0,n.useState)(""),2),f=p[0],g=p[1],h=Eo((0,n.useState)(),2),m=h[0],b=h[1],y=(0,n.useCallback)((e=>{a(e)}),[]),_=(0,n.useCallback)((e=>{c(e)}),[]),v=(0,n.useCallback)((e=>{d(e)}),[]),w=(0,n.useCallback)((e=>{g(e)}),[]),T=(0,n.useCallback)((e=>{b(e)}),[]),x=(0,n.useMemo)((()=>[t?{questionId:"SECURITY_QUESTION_ID_SSN",answer:f}:{questionId:"SECURITY_QUESTION_ID_NATIONAL_ID",answer:f},{questionId:"SECURITY_QUESTION_ID_DATE_OF_BIRTH",answer:u},{questionId:"SECURITY_QUESTION_ID_FIRST_NAME",answer:i},{questionId:"SECURITY_QUESTION_ID_LAST_NAME",answer:s},{questionId:e,answer:m}]),[u,s,i,t,m,f,e]);return{firstName:i,updateFirstName:y,familyName:s,updateFamilyName:_,dob:u,updateDob:v,socialSecurity:f,updateSocialSecurity:w,idNumber:m,updateIdNumber:T,payload:x}}(p,d),g=f.firstName,h=f.updateFirstName,m=f.familyName,b=f.updateFamilyName,y=f.dob,_=f.updateDob,v=f.socialSecurity,w=f.updateSocialSecurity,T=f.idNumber,x=f.updateIdNumber,S=f.payload,k=(0,n.useMemo)((()=>{switch(t){case"security_questions":return(0,s.jsx)(wl,{firstName:g,updateFirstName:h,familyName:m,updateFamilyName:b,dob:y,updateDob:_,socialSecurity:v,updateSocialSecurity:w,handleContinue:i,hasSocialSecurityNo:d});case"identity_card_number":return(0,s.jsx)(_l,{userIdCardType:p,idNumber:T,updateIdNumber:x,handleSubmit:c,payload:S});case"status":return(0,s.jsx)(Cl,{status:r,handleRetry:a});default:return null}}),[t,g,h,m,b,y,_,v,w,i,d,p,T,x,c,S,r,a]);return(0,s.jsx)(js,{loading:u,error:"",onReload:a,children:(0,s.jsx)(o.VStack,{children:k})})}));const Ml=(0,A.vU)({title:{id:"WhatsAppBanner.title",defaultMessage:"We sent this code through WhatsApp",description:"Title that informs the user a code was sent using WhatsApp messaging"},description:{id:"WhatsAppBanner.description",defaultMessage:"If you don’t want to use WhatsApp or don’t have a WhatsApp account, you can resend code as an SMS",description:"Informs the user that they can attempt to resend the code using SMS"}}),jl=(0,n.memo)((function(){const e=(0,Ke.useSpectrum)(),t=(0,P.Z)().formatMessage,r=(0,n.useMemo)((()=>"light"===e?"#F5FFFB":"#00331E"),[e]);return(0,s.jsx)(o.Box,{spacingVertical:2,spacingHorizontal:3,testID:"whatsapp-banner",children:(0,s.jsxs)(o.HStack,{spacing:2,borderColor:"line",borderRadius:"standard",dangerouslySetBackground:r,children:[(0,s.jsx)("img",{src:ho,alt:"WhatsApp Logo",width:20,height:20}),(0,s.jsxs)(o.VStack,{spacingStart:2,children:[(0,s.jsx)(Se.TextHeadline,{as:"p",color:"foreground",children:t(Ml.title)}),(0,s.jsx)(Se.TextBody,{as:"p",color:"foregroundMuted",children:t(Ml.description)})]})]})})})),Al=(0,A.vU)({title:{id:"SMSInputCode.title",defaultMessage:"Enter the 7-digit code we texted to {phoneNumber}",description:"Title for the SMS Code Input screen prompting user to input code"},description:{id:"SMSInputCode.description",defaultMessage:"This helps us keep your account secure by verifying that it’s really you.",description:"Description for the SMS Code Input screen explaining the reason for requiring 2FA"},rateLimitWarning:{id:"SMSInputCode.rateLimitWarning",defaultMessage:"That’s too many attempts. Wait a few minutes before trying again, or click Try Another Way for more options.",description:"Rate limit warning that advises user to wait for a few minutes, or use the Try Another Way menu for more options"}}),Pl=(0,n.memo)((function(){const e=(0,P.Z)().formatMessage,t=Ds(),r=t.twoFactorMethod,i=t.challengeError,a=t.challengeMetadata,c=Vs(),l=(0,n.useMemo)((()=>i?.type===be.D1.TooManyRequests),[i]),u=(a?.sms??{}).providerName;return(0,s.jsxs)(o.VStack,{testID:"sms-input-code",children:["WhatsApp"===u&&(0,s.jsx)(jl,{}),(0,s.jsx)(Ls,{title:e(Al.title,{phoneNumber:c(r)}),description:e(Al.description)}),l&&(0,s.jsx)(Gs,{spacingBottom:3,testID:"sms-input-code-warning",children:e(Al.rateLimitWarning)}),(0,s.jsx)(fc,{codeLength:7,twoFactorType:w.Y6.SMS,errorTestID:"sms-input-code-error"}),(0,s.jsx)($s,{twoFactorType:w.Y6.SMS,startWithCooldown:!0})]})}));function Ol(){return`${Qo().apiHost}${ic}`}const Fl=(0,A.vU)({updatePhoneNumberTitle:{id:"SMSTryAnotherWay.updatePhoneNumberTitle",defaultMessage:"Update your phone number",description:"Title for the SMS Try Another Way option to update phone number"},updatePhoneNumberDescription:{id:"SMSTryAnotherWay.updatePhoneNumberDescription",defaultMessage:"New number? Verify your identity and change it here.",description:"Description for the SMS Try Another Way option to verify identity and update phone number"}}),Ul=(0,n.memo)((function({onCloseDrawer:e}){const t=(0,P.Z)().formatMessage,r=Ol(),i=es(j.T9.LegacyAccountRecovery),a=(0,n.useMemo)((()=>({title:t(Fl.updatePhoneNumberTitle),description:t(Fl.updatePhoneNumberDescription)})),[t]),o=nc({showDefaultIDVOption:i,idvOption:(0,n.useMemo)((()=>Mo(Mo({},a),{},{id:qo.SMSUpdatePhoneNumber2dot0})),[a]),legacyRecoveryOption:(0,n.useMemo)((()=>Mo(Mo({},a),{},{id:qo.SMSUpdatePhoneNumberLegacy,to:r,openBlankWindow:!1})),[a,r])}),c=oc().HELP_OPTION_URLS,l=(0,n.useMemo)((()=>({id:qo.SMSTroubleshoot,to:c[w.Y6.SMS]})),[c]);return(0,s.jsx)(tc,{onCloseDrawer:e,twoFactorType:w.Y6.SMS,alternateTwoFactorOptions:o,troubleshootOption:l,testID:"sms-try-another-way"})})),Rl=(0,n.memo)((function(){return function(){const e=Ds(),t=e.challengeError,r=e.challengeTwoFactor,i=e.handleChallengeError;(0,n.useEffect)((()=>{r()}),[r]),(0,n.useEffect)((()=>{if(t){const e=t.type!==be.D1.TooManyRequests;i(t,e)}}),[t,i])}(),(0,s.jsx)(Rs,{BaseView:Pl,DrawerView:Ul,toggleTestID:"sms-toggle-help-button",twoFactorType:w.Y6.SMS})}));const Nl=(0,A.vU)({title:{id:"TOTPInputCode.title",defaultMessage:"Enter the 6-digit code from your authenticator app",description:"Title for the TOTP Code Input screen prompting user to input code"},description:{id:"TOTPInputCode.description",defaultMessage:"This helps us keep your account secure by verifying that it’s really you.",description:"Description for the TOTP Code Input screen explaining the reason for requiring 2FA"}}),Ll=(0,n.memo)((function(){const e=(0,P.Z)().formatMessage;return(0,s.jsxs)(o.VStack,{testID:"totp-input-code",children:[(0,s.jsx)(Ls,{title:e(Nl.title),description:e(Nl.description)}),(0,s.jsx)(fc,{codeLength:6,twoFactorType:w.Y6.TOTP,errorTestID:"totp-input-code-error"})]})})),Bl=(0,A.vU)({updateAuthenticatorAppTitle:{id:"TOTPTryAnotherWay.updateAuthenticatorAppTitle",defaultMessage:"Update your authenticator app",description:"Title for the TOTP Try Another Way option to update authenticator app"},updateAuthenticatorAppDescription:{id:"TOTPTryAnotherWay.updateAuthenticatorAppDescription",defaultMessage:"New authenticator app? Verify your identity and change it here.",description:"Description for the TOTP Try Another Way option to verify identity and update authenticator app"}}),ql=(0,n.memo)((function({onCloseDrawer:e}){const t=(0,P.Z)().formatMessage,r=Ol(),i=es(j.T9.LegacyAccountRecovery),a=(0,n.useMemo)((()=>({title:t(Bl.updateAuthenticatorAppTitle),description:t(Bl.updateAuthenticatorAppDescription)})),[t]),o=nc({showDefaultIDVOption:i,idvOption:(0,n.useMemo)((()=>Mo(Mo({},a),{},{id:qo.TOTPUpdateAuthenticatorApp2dot0})),[a]),legacyRecoveryOption:(0,n.useMemo)((()=>Mo(Mo({},a),{},{id:qo.TOTPUpdateAuthenticatorAppLegacy,to:r,openBlankWindow:!1})),[a,r])}),c=oc().HELP_OPTION_URLS,l=(0,n.useMemo)((()=>({id:qo.TOTPTroubleshoot,to:c[w.Y6.TOTP]})),[c]);return(0,s.jsx)(tc,{onCloseDrawer:e,twoFactorType:w.Y6.TOTP,alternateTwoFactorOptions:o,troubleshootOption:l,testID:"totp-try-another-way"})})),Vl=(0,n.memo)((function(){return function(){const e=Ds(),t=e.challengeTwoFactor,r=e.challengeError,i=e.handleChallengeError;(0,n.useEffect)((()=>{t()}),[t]),(0,n.useEffect)((()=>{r&&i(r)}),[r,i])}(),(0,s.jsx)(Rs,{BaseView:Ll,DrawerView:ql,toggleTestID:"totp-toggle-help-button",twoFactorType:w.Y6.TOTP})}));function Wl(e){return e.toLowerCase().replace(/_/g,"-")}function $l(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Ds(),a=i.challengeTwoFactor,o=i.challengeError,s=i.handleChallengeError,l=i.handleVerifySuccess,u=i.handleVerifyError,d=function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=(0,U.yl)(),l=ts(),u=ns(),d=u.getTwoFactorError,p=u.parseTwoFactorApiError,f=vs(),g=f.isMockEnv,h=f.isMSW,m=(0,n.useCallback)((async e=>{if(!navigator.credentials)return{error:d(be.D1.U2FIncompatibleBrowser)};let t;try{t=Mo(Mo({},e),{},{challenge:E(e?.challenge??""),allowCredentials:e?.allowCredentials?.map((e=>Mo(Mo({},e),{},{type:Wl(e?.type??""),id:E(e?.id??"")}))),userVerification:e?.userVerification?Wl(e.userVerification):void 0})}catch(e){return{error:d(be.D1.U2FFetchPublicKeyError,e)}}return new Promise((e=>{navigator.credentials.get({publicKey:t}).then((t=>{try{if(!t)return void e({error:d(be.D1.U2FMissingCredentialsError)});const r=t,n=r.response;e({credentials:{id:k(r.rawId),clientDataJson:k(n.clientDataJSON),authenticatorData:k(n.authenticatorData),signature:k(n.signature),userHandle:n.userHandle?k(n.userHandle):""}})}catch(t){e({error:d(be.D1.U2FUnknowError,t)})}})).catch((t=>{e({error:d(be.D1.U2FCredentialError,t)})}))}))}),[d]);return{loading:t,error:a,verifyU2F:(0,n.useCallback)((async e=>{if(r(!0),h||g)return r(!1),o(void 0),window.confirm("Please confirm your security key")?`2FAPT~${k(new Uint8Array(26))}`:null;const t=await m(e),n=t.credentials,i=t.error;if(i)return r(!1),o(i),null;const a=Mo(Mo({},l),{},{u2f:n}),u=await s(a);if(r(!1),u instanceof Error){const e=p(u);return o(e),null}return o(void 0),u.proofToken??c}),[s,m,l,p,h,g])}}(),p=d.error,f=d.verifyU2F;(0,n.useEffect)((()=>{o&&s(o)}),[o,s]),(0,n.useEffect)((()=>{p&&u(p)}),[p,u]);return{authenticateKey:(0,n.useCallback)((async()=>{r(!0);const e=await a(),t=e?.u2f;if(!t)return void r(!1);const n=await f(t);Wo(n)?l(n):r(!1)}),[a,l,f]),loading:t}}const zl=(0,A.vU)({title:{id:"U2FConnectKeys.title",defaultMessage:"Connect your security key and tap it",description:"Title for the U2F Connect Key screen prompting user to connect security key"},description:{id:"U2FConnectKeys.description",defaultMessage:"This helps us keep your account secure by verifying that it’s really you.",description:"Description for U2F Connect Key screen explaining the reason for requiring 2FA"},verify:{id:"U2FConnectKeys.verify",defaultMessage:"Verify",description:"Button text to start the process of verifying a security key"}}),Yl=(0,n.memo)((function(){const e=Xo().logEvent,t=(0,P.Z)().formatMessage,r=$l(),i=r.authenticateKey,a=r.loading,c=(0,n.useCallback)((()=>{e(No.TwoFactorClickButton,{action:M.Us.click,componentType:M.re.button,button_type:Lo.U2FVerify}),i()}),[i,e]);return(0,n.useEffect)((()=>{(0,ve.Dt)()||(0,ve.gn)()||i()}),[i]),(0,s.jsxs)(o.VStack,{testID:"u2f-connect-key",flexGrow:1,children:[(0,s.jsx)(Ls,{title:t(zl.title),description:t(zl.description)}),(0,s.jsxs)(Te.ButtonGroup,{vertical:!0,accessibilityLabel:"Validation Actions",children:[(0,s.jsx)(Hs,{twoFactorType:w.Y6.U2F}),(0,s.jsx)(Te.Button,{block:!0,variant:"primary",onPress:c,loading:a,testID:"u2f-verify-button",children:t(zl.verify)})]})]})})),Hl=(0,A.vU)({updateKeyTitle:{id:"U2FTryAnotherWay.updateKeyTitle",defaultMessage:"Update your security key",description:"Title for the U2F Try Another Way option to update security key"},updateKeySupportDescription:{id:"U2FTryAnotherWay.updateKeySupportDescription",defaultMessage:"New security key? Contact our support team to change it.",description:"Description for the U2F Try Another Way option to contact support team and update security key"},updateKeyVerifyDescription:{id:"U2FTryAnotherWay.updateKeyVerifyDescription",defaultMessage:"New security key? Verify your identity and change it here.",description:"Description for the U2F Try Another Way option to verify identity and update security key"}}),Gl=(0,n.memo)((function({onCloseDrawer:e}){const t=(0,P.Z)().formatMessage,r=es(j.T9.LegacyAccountRecovery),i=(0,n.useMemo)((()=>({title:t(Hl.updateKeyTitle)})),[t]),a=(0,n.useMemo)((()=>Mo(Mo({},i),{},{id:qo.U2FUpdateKey2dot0,description:t(Hl.updateKeyVerifyDescription)})),[i,t]),o=oc(),c=o.HELP_OPTION_URLS,l=o.U2F_CONTACT_SUPPORT_LEGACY_URL,u=(0,n.useMemo)((()=>({id:qo.U2FTroubleshoot,to:c[w.Y6.U2F]})),[c]),d=nc({showDefaultIDVOption:r,idvOption:a,legacyRecoveryOption:(0,n.useMemo)((()=>Mo(Mo({},i),{},{id:qo.U2FUpdateKeySupport,description:t(Hl.updateKeySupportDescription),to:l})),[l,i,t])});return(0,s.jsx)(tc,{onCloseDrawer:e,twoFactorType:w.Y6.U2F,alternateTwoFactorOptions:d,troubleshootOption:u,testID:"u2f-try-another-way"})})),Kl=(0,n.memo)((function(){return(0,s.jsx)(Rs,{BaseView:Yl,DrawerView:Gl,toggleTestID:"u2f-toggle-help-button",twoFactorType:w.Y6.U2F})}));function Zl(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),o=i[0],s=i[1],c=ns().getTwoFactorError,l=(0,a.Ge)(),u=l.activate,d=l.account,p=l.deactivate,f=l.library,g=(0,n.useCallback)((()=>{p()}),[p]),h=(0,n.useCallback)((async e=>{r(!0);try{await u(e,void 0,!0);const t=await e.getAccount();return r(!1),s(void 0),t}catch(e){return s(c(be.D1.WalletConnectionFailed)),g(),null}finally{r(!1)}}),[u,c,g]),m=(0,n.useCallback)((async e=>{if(d&&f){r(!0);try{const t=await f.getSigner(d).signMessage(e);return s(void 0),t}catch(e){e instanceof Error&&s(c(be.D1.WalletSignatureDenied))}finally{r(!1)}}}),[d,f,c]);return{loading:t,disconnect:g,connectWallet:h,signMessage:m,error:o}}const Ql=new mo._k({supportedChainIds:[1]}),Jl=new bo.zw({bridge:"https://bridge.walletconnect.org",qrcode:!0}),Xl={coinbaseWallet:{wallet:new yo.J({url:"https://coinbase.com",appName:"Coinbase"}),asset:"https://static-assets.coinbase.com/coinbase/coinbase-logo-round.svg"},walletConnect:{wallet:Jl,asset:"https://static-assets.coinbase.com/international/walletconnect.png"},browserWalletExtensions:{wallet:Ql,asset:"https://static-assets.coinbase.com/international/otherWallet.png"}},eu=(0,A.vU)({title:{id:"WalletConnect.title",defaultMessage:"Connect your wallet using one of the providers below.",description:"Title for the Wallet Connection screen instructing user to connect their wallet using a provider"},description:{id:"WalletConnect.description",defaultMessage:"Your wallet signature can be used to prove your identity.",description:"Description for the Wallet Connection screen explaining the reason for connecting a wallet"}}),tu=(0,A.vU)({coinbaseWallet:{defaultMessage:"Coinbase Wallet",description:"Coinbase Wallet"},walletConnect:{defaultMessage:"WalletConnect",description:"WalletConnect"},browserWalletExtensions:{defaultMessage:"Browser Wallet Extensions",description:"Browser wallet extensions"}}),ru=(0,n.memo)((function({onAdvanceStep:e,onComplete:t,onError:r}){const i=(0,P.Z)().formatMessage,a=Zl(),c=a.loading,l=a.connectWallet,u=a.error,d=r=>async()=>{const n=Xl[r].wallet;e("CONNECTING");const i=await l(n);if(i)return e("CONNECTED"),void t(i);e("NOT_CONNECTED")};return(0,n.useEffect)((()=>{u&&r(u)}),[u,r]),(0,s.jsxs)(o.VStack,{testID:"wallet-connect",children:[(0,s.jsx)(Ls,{title:i(eu.title),description:i(eu.description),spacingBottom:1}),(0,s.jsx)(o.Divider,{spacingVertical:2}),(0,s.jsx)(o.VStack,{gap:0,children:Object.keys(Xl).map((e=>{const t=Xl[e].asset;return(0,s.jsx)(Ge.ListCell,{disabled:c,testID:`test-${e}`,description:(0,s.jsx)(Se.TextHeadline,{as:"span",children:i(tu[e])}),onPress:d(e),media:(0,s.jsx)(Ge.CellMedia,{type:"asset",source:t,title:e}),accessory:"arrow"},e)}))})]})})),nu=(0,n.memo)((function({messageToSign:e,onAdvanceStep:t,onComplete:r,onError:i}){const a=Zl(),c=a.signMessage,l=a.loading,u=a.error,d=ns().getTwoFactorError,p=(0,n.useCallback)((async()=>{if(e){t("SIGNING");try{const t=await c(e);t&&r(t)}catch(e){const t=d(be.D1.UnknownError);i(t)}}}),[e,c,t,r,d,i]);return(0,n.useEffect)((()=>{e&&p()}),[e,p]),(0,n.useEffect)((()=>{u&&i(u)}),[u,i]),(0,s.jsxs)(o.VStack,{testID:"wallet-sign",children:[(0,s.jsx)(Ls,{title:"Sign the message we sent with your wallet",description:"We'll use your signature to verify your identity",spacingBottom:1}),(0,s.jsx)(o.Divider,{}),(0,s.jsx)(ms,{}),(0,s.jsx)(o.Box,{spacingTop:5,children:(0,s.jsx)(Te.Button,{block:!0,variant:"secondary",disabled:l,onPress:p,testID:"resend-wallet-message",children:"Resend Message"})})]})})),iu=(0,n.memo)((function({onCloseDrawer:e}){const t=nc({showDefaultIDVOption:!1}),r=oc().HELP_OPTION_URLS,i=(0,n.useMemo)((()=>({id:qo.WalletTroubleshoot,to:r[w.Y6.WALLET]})),[r]);return(0,s.jsx)(tc,{onCloseDrawer:e,twoFactorType:w.Y6.WALLET,alternateTwoFactorOptions:t,troubleshootOption:i,testID:"wallet-try-another-way"})})),au=[be.D1.WalletConnectionFailed,be.D1.WalletSignatureDenied],ou=(0,n.memo)((function(){const e=Eo((0,n.useState)(),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),o=i[0],l=i[1],u=function(){const e=Eo((0,n.useState)("NOT_CONNECTED"),2),t=e[0],r=e[1],i=(0,a.Ge)().deactivate,o=(0,n.useCallback)((e=>{r(e)}),[]);return{step:t,handleResetWallet:(0,n.useCallback)((()=>{i(),r("NOT_CONNECTED")}),[i]),handleAdvanceStep:o}}(),d=u.handleAdvanceStep,p=Zl(),f=p.loading,g=p.disconnect,h=function(){const e=Eo((0,n.useState)(),2),t=e[0],r=e[1],i=Ds().handleChallengeError,a=is(),o=a.challengeTwoFactor,s=a.loading,c=a.error,l=(0,n.useCallback)((async e=>{const t=await o({secondFactorType:w.Y6.WALLET,wallet:{address:e}});return r(t?.wallet?.message),t?.wallet?.message}),[o]);return(0,n.useEffect)((()=>{if(c){const e=c.type!==be.D1.WalletMismatch;i(c,e)}}),[c,i]),{challenge:l,messageToSign:t,loading:s,error:c}}(),m=h.challenge,b=h.loading,y=function(){const e=Eo((0,n.useState)(!1),2),t=e[0],r=e[1],i=Eo((0,n.useState)(),2),a=i[0],o=i[1],s=(0,U.yl)(),l=ts(),u=ns().parseTwoFactorApiError;return{loading:t,error:a,verify:(0,n.useCallback)((async e=>{r(!0);const t=l;t.wallet={signedMessage:e};const n=await s(t);if(r(!1),n instanceof Error){const e=u(n);return o(e),null}return o(void 0),n.proofToken??c}),[l,s,u])}}(),_=y.verify,v=y.loading,T=y.error,x=as().handleError,S=Ds().handleVerifySuccess,k=(0,n.useCallback)((e=>{t!==e&&(au.includes(e.type)?x(e,!0):r(e))}),[t,x]),E=(0,n.useCallback)((()=>{g(),l(void 0),r(void 0),d("NOT_CONNECTED")}),[g,d]),I=(0,n.useCallback)((async e=>{const t=await m(e);l(t)}),[m]),C=(0,n.useCallback)((async e=>{const t=await _(e);Wo(t)&&S(t)}),[_,S]),D=(0,n.useCallback)((()=>o&&""!==o?(0,s.jsx)(nu,{messageToSign:o,onComplete:C,onAdvanceStep:d,onError:k}):(0,s.jsx)(ru,{onAdvanceStep:d,onComplete:I,onError:k})),[o,d,I,C,k]);(0,n.useEffect)((()=>{T&&k(T)}),[T,k]);const M=(0,n.useMemo)((()=>f??b??v),[f,b,v]);return(0,s.jsx)(js,{loading:M,onReload:E,error:t?.message,children:(0,s.jsx)(Rs,{BaseView:D,DrawerView:iu,twoFactorType:w.Y6.WALLET,toggleTestID:"wallet-toggle-help-button"})})}));const su=(0,n.memo)((function(){const e=Ds().twoFactorMethod,t=function(){const e=Ds(),t=e.twoFactorMethod,r=e.loadingEnabled,i=e.enabledError,a=e.enabledTwoFactorOptions,o=e.getEnabledTwoFactor,s=as().handleError,c=Xo(),l=c.logEvent,u=c.logMetric,d=Qo().featureFlags;(0,n.useEffect)((()=>{o()}),[o]);const p=(0,n.useCallback)(((e,t)=>{l(No.TwoFactorLoad,Mo(Mo({},t),{},{action:M.Us.render,componentType:M.re.page,result:e}))}),[l]),f=(0,n.useCallback)((e=>{u("getAllEnabled",{result:e})}),[u]);return(0,n.useEffect)((()=>{l(No.TwoFactorFeatureFlags,{action:M.Us.measurement,componentType:M.re.page,featureFlags:d})}),[l,d]),(0,n.useEffect)((()=>{if(a){const e=a?.map((e=>e?.methods?.map((e=>e.type))));p(j.x4.Success,{options:JSON.stringify(e),num_options:a.length}),f(j.x4.Success)}}),[a,p,f]),(0,n.useEffect)((()=>{i&&(s(i,!1),p(j.x4.Failure,{error_type:i.type}),f(j.x4.Failure))}),[i,s,p,f]),{loading:(0,n.useMemo)((()=>r||!i&&!t),[t,r,i]),handleReload:o,error:i}}(),r=t.loading,i=t.error,a=t.handleReload;!function(){const e=Ds(),t=e.proofToken,r=e.twoFactorMethod,i=$o().onSuccess,a=(0,n.useRef)(!1);(0,n.useEffect)((()=>{if(Wo(t)&&r?.type&&!a.current){const e=x[r.type];i(t,e),a.current=!0}}),[i,t,r])}();const o=(0,n.useMemo)((()=>{if(r)return null;switch(e?.type){case w.Y6.NO_2FA:case w.Y6.BYPASS:return(0,s.jsx)(Hc,{});case w.Y6.IDV:case w.Y6.RECOVERY_CODE:return(0,s.jsx)(Yc,{});case w.Y6.SMS:return(0,s.jsx)(Rl,{});case w.Y6.TOTP:return(0,s.jsx)(Vl,{});case w.Y6.U2F:return(0,s.jsx)(Kl,{});case w.Y6.DEVICE_VERIFICATION:return(0,s.jsx)(lc,{});case w.Y6.EMAIL:return(0,s.jsx)(_c,{});case w.Y6.PUSH:return(0,s.jsx)(ml,{});case w.Y6.WALLET:return(0,s.jsx)(ou,{});case w.Y6.PASSWORD:return(0,s.jsx)(tl,{});case w.Y6.SECURITY_QUESTION:return(0,s.jsx)(Dl,{})}return(0,s.jsx)(Ms,{})}),[r,e]);return(0,s.jsx)(js,{loading:r,onReload:a,error:i?.message,children:o})}));function cu(e){const t=new i.Q(e);return t.pollingInterval=12e3,t}u.loggingPrefix=`${Oo}:`;const lu=(0,n.memo)((function(e){return(0,s.jsx)(Ro,{clientProps:e,children:(0,s.jsx)(Ao,Mo(Mo({},e.rootBoxProps),{},{children:(0,s.jsx)(_s,{children:(0,s.jsx)(ks,{children:(0,s.jsx)(Cs,{children:(0,s.jsx)(xs,{children:(0,s.jsx)(a.Ht,{getLibrary:cu,children:(0,s.jsx)(gs,{children:(0,s.jsx)(su,{})})})})})})})}))})}))},7898:e=>{"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<32;n++){var i=t.charAt(n);if(void 0!==r[i])throw new TypeError(i+" is ambiguous");r[i]=n}function a(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function o(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=a(t)^n>>5}for(t=a(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=a(t)^31&i}return t}function s(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var s=(e=n).lastIndexOf("1");if(-1===s)return"No separator character for "+e;if(0===s)return"Missing prefix for "+e;var c=e.slice(0,s),l=e.slice(s+1);if(l.length<6)return"Data too short";var u=o(c);if("string"==typeof u)return u;for(var d=[],p=0;p<l.length;++p){var f=l.charAt(p),g=r[f];if(void 0===g)return"Unknown character "+f;u=a(u)^g,p+6>=l.length||d.push(g)}return 1!==u?"Invalid checksum for "+e:{prefix:c,words:d}}function c(e,t,r,n){for(var i=0,a=0,o=(1<<r)-1,s=[],c=0;c<e.length;++c)for(i=i<<t|e[c],a+=t;a>=r;)a-=r,s.push(i>>a&o);if(n)a>0&&s.push(i<<r-a&o);else{if(a>=t)return"Excess padding";if(i<<r-a&o)return"Non-zero padding"}return s}e.exports={decodeUnsafe:function(){var e=s.apply(null,arguments);if("object"==typeof e)return e},decode:function(e){var t=s.apply(null,arguments);if("object"==typeof t)return t;throw new Error(t)},encode:function(e,r,n){if(n=n||90,e.length+7+r.length>n)throw new TypeError("Exceeds length limit");var i=o(e=e.toLowerCase());if("string"==typeof i)throw new Error(i);for(var s=e+"1",c=0;c<r.length;++c){var l=r[c];if(l>>5!=0)throw new Error("Non 5-bit word");i=a(i)^l,s+=t.charAt(l)}for(c=0;c<6;++c)i=a(i);for(i^=1,c=0;c<6;++c){s+=t.charAt(i>>5*(5-c)&31)}return s},toWordsUnsafe:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=c(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=c(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},7762:function(e,t,r){var n;e=r.nmd(e),function(){var i,a="Expected a function",o="__lodash_hash_undefined__",s="__lodash_placeholder__",c=16,l=32,u=64,d=128,p=256,f=1/0,g=9007199254740991,h=NaN,m=4294967295,b=[["ary",d],["bind",1],["bindKey",2],["curry",8],["curryRight",c],["flip",512],["partial",l],["partialRight",u],["rearg",p]],y="[object Arguments]",_="[object Array]",v="[object Boolean]",w="[object Date]",T="[object Error]",x="[object Function]",S="[object GeneratorFunction]",k="[object Map]",E="[object Number]",I="[object Object]",C="[object Promise]",D="[object RegExp]",M="[object Set]",j="[object String]",A="[object Symbol]",P="[object WeakMap]",O="[object ArrayBuffer]",F="[object DataView]",U="[object Float32Array]",R="[object Float64Array]",N="[object Int8Array]",L="[object Int16Array]",B="[object Int32Array]",q="[object Uint8Array]",V="[object Uint8ClampedArray]",W="[object Uint16Array]",$="[object Uint32Array]",z=/\b__p \+= '';/g,Y=/\b(__p \+=) '' \+/g,H=/(__e\(.*?\)|\b__t\)) \+\n'';/g,G=/&(?:amp|lt|gt|quot|#39);/g,K=/[&<>"']/g,Z=RegExp(G.source),Q=RegExp(K.source),J=/<%-([\s\S]+?)%>/g,X=/<%([\s\S]+?)%>/g,ee=/<%=([\s\S]+?)%>/g,te=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,re=/^\w*$/,ne=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ie=/[\\^$.*+?()[\]{}|]/g,ae=RegExp(ie.source),oe=/^\s+/,se=/\s/,ce=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,le=/\{\n\/\* \[wrapped with (.+)\] \*/,ue=/,? & /,de=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,pe=/[()=,{}\[\]\/\s]/,fe=/\\(\\)?/g,ge=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,he=/\w*$/,me=/^[-+]0x[0-9a-f]+$/i,be=/^0b[01]+$/i,ye=/^\[object .+?Constructor\]$/,_e=/^0o[0-7]+$/i,ve=/^(?:0|[1-9]\d*)$/,we=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Te=/($^)/,xe=/['\n\r\u2028\u2029\\]/g,Se="\\ud800-\\udfff",ke="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Ee="\\u2700-\\u27bf",Ie="a-z\\xdf-\\xf6\\xf8-\\xff",Ce="A-Z\\xc0-\\xd6\\xd8-\\xde",De="\\ufe0e\\ufe0f",Me="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",je="['’]",Ae="["+Se+"]",Pe="["+Me+"]",Oe="["+ke+"]",Fe="\\d+",Ue="["+Ee+"]",Re="["+Ie+"]",Ne="[^"+Se+Me+Fe+Ee+Ie+Ce+"]",Le="\\ud83c[\\udffb-\\udfff]",Be="[^"+Se+"]",qe="(?:\\ud83c[\\udde6-\\uddff]){2}",Ve="[\\ud800-\\udbff][\\udc00-\\udfff]",We="["+Ce+"]",$e="\\u200d",ze="(?:"+Re+"|"+Ne+")",Ye="(?:"+We+"|"+Ne+")",He="(?:['’](?:d|ll|m|re|s|t|ve))?",Ge="(?:['’](?:D|LL|M|RE|S|T|VE))?",Ke="(?:"+Oe+"|"+Le+")"+"?",Ze="["+De+"]?",Qe=Ze+Ke+("(?:"+$e+"(?:"+[Be,qe,Ve].join("|")+")"+Ze+Ke+")*"),Je="(?:"+[Ue,qe,Ve].join("|")+")"+Qe,Xe="(?:"+[Be+Oe+"?",Oe,qe,Ve,Ae].join("|")+")",et=RegExp(je,"g"),tt=RegExp(Oe,"g"),rt=RegExp(Le+"(?="+Le+")|"+Xe+Qe,"g"),nt=RegExp([We+"?"+Re+"+"+He+"(?="+[Pe,We,"$"].join("|")+")",Ye+"+"+Ge+"(?="+[Pe,We+ze,"$"].join("|")+")",We+"?"+ze+"+"+He,We+"+"+Ge,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",Fe,Je].join("|"),"g"),it=RegExp("["+$e+Se+ke+De+"]"),at=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,ot=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],st=-1,ct={};ct[U]=ct[R]=ct[N]=ct[L]=ct[B]=ct[q]=ct[V]=ct[W]=ct[$]=!0,ct[y]=ct[_]=ct[O]=ct[v]=ct[F]=ct[w]=ct[T]=ct[x]=ct[k]=ct[E]=ct[I]=ct[D]=ct[M]=ct[j]=ct[P]=!1;var lt={};lt[y]=lt[_]=lt[O]=lt[F]=lt[v]=lt[w]=lt[U]=lt[R]=lt[N]=lt[L]=lt[B]=lt[k]=lt[E]=lt[I]=lt[D]=lt[M]=lt[j]=lt[A]=lt[q]=lt[V]=lt[W]=lt[$]=!0,lt[T]=lt[x]=lt[P]=!1;var ut={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},dt=parseFloat,pt=parseInt,ft="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,gt="object"==typeof self&&self&&self.Object===Object&&self,ht=ft||gt||Function("return this")(),mt=t&&!t.nodeType&&t,bt=mt&&e&&!e.nodeType&&e,yt=bt&&bt.exports===mt,_t=yt&&ft.process,vt=function(){try{var e=bt&&bt.require&&bt.require("util").types;return e||_t&&_t.binding&&_t.binding("util")}catch(e){}}(),wt=vt&&vt.isArrayBuffer,Tt=vt&&vt.isDate,xt=vt&&vt.isMap,St=vt&&vt.isRegExp,kt=vt&&vt.isSet,Et=vt&&vt.isTypedArray;function It(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function Ct(e,t,r,n){for(var i=-1,a=null==e?0:e.length;++i<a;){var o=e[i];t(n,o,r(o),e)}return n}function Dt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}function Mt(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}function jt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(!t(e[r],r,e))return!1;return!0}function At(e,t){for(var r=-1,n=null==e?0:e.length,i=0,a=[];++r<n;){var o=e[r];t(o,r,e)&&(a[i++]=o)}return a}function Pt(e,t){return!!(null==e?0:e.length)&&Wt(e,t,0)>-1}function Ot(e,t,r){for(var n=-1,i=null==e?0:e.length;++n<i;)if(r(t,e[n]))return!0;return!1}function Ft(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}function Ut(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}function Rt(e,t,r,n){var i=-1,a=null==e?0:e.length;for(n&&a&&(r=e[++i]);++i<a;)r=t(r,e[i],i,e);return r}function Nt(e,t,r,n){var i=null==e?0:e.length;for(n&&i&&(r=e[--i]);i--;)r=t(r,e[i],i,e);return r}function Lt(e,t){for(var r=-1,n=null==e?0:e.length;++r<n;)if(t(e[r],r,e))return!0;return!1}var Bt=Ht("length");function qt(e,t,r){var n;return r(e,(function(e,r,i){if(t(e,r,i))return n=r,!1})),n}function Vt(e,t,r,n){for(var i=e.length,a=r+(n?1:-1);n?a--:++a<i;)if(t(e[a],a,e))return a;return-1}function Wt(e,t,r){return t==t?function(e,t,r){var n=r-1,i=e.length;for(;++n<i;)if(e[n]===t)return n;return-1}(e,t,r):Vt(e,zt,r)}function $t(e,t,r,n){for(var i=r-1,a=e.length;++i<a;)if(n(e[i],t))return i;return-1}function zt(e){return e!=e}function Yt(e,t){var r=null==e?0:e.length;return r?Zt(e,t)/r:h}function Ht(e){return function(t){return null==t?i:t[e]}}function Gt(e){return function(t){return null==e?i:e[t]}}function Kt(e,t,r,n,i){return i(e,(function(e,i,a){r=n?(n=!1,e):t(r,e,i,a)})),r}function Zt(e,t){for(var r,n=-1,a=e.length;++n<a;){var o=t(e[n]);o!==i&&(r=r===i?o:r+o)}return r}function Qt(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}function Jt(e){return e?e.slice(0,hr(e)+1).replace(oe,""):e}function Xt(e){return function(t){return e(t)}}function er(e,t){return Ft(t,(function(t){return e[t]}))}function tr(e,t){return e.has(t)}function rr(e,t){for(var r=-1,n=e.length;++r<n&&Wt(t,e[r],0)>-1;);return r}function nr(e,t){for(var r=e.length;r--&&Wt(t,e[r],0)>-1;);return r}var ir=Gt({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",Ĳ:"IJ",ĳ:"ij",Œ:"Oe",œ:"oe",ŉ:"'n",ſ:"s"}),ar=Gt({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function or(e){return"\\"+ut[e]}function sr(e){return it.test(e)}function cr(e){var t=-1,r=Array(e.size);return e.forEach((function(e,n){r[++t]=[n,e]})),r}function lr(e,t){return function(r){return e(t(r))}}function ur(e,t){for(var r=-1,n=e.length,i=0,a=[];++r<n;){var o=e[r];o!==t&&o!==s||(e[r]=s,a[i++]=r)}return a}function dr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}function pr(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=[e,e]})),r}function fr(e){return sr(e)?function(e){var t=rt.lastIndex=0;for(;rt.test(e);)++t;return t}(e):Bt(e)}function gr(e){return sr(e)?function(e){return e.match(rt)||[]}(e):function(e){return e.split("")}(e)}function hr(e){for(var t=e.length;t--&&se.test(e.charAt(t)););return t}var mr=Gt({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var br=function e(t){var r,n=(t=null==t?ht:br.defaults(ht.Object(),t,br.pick(ht,ot))).Array,se=t.Date,Se=t.Error,ke=t.Function,Ee=t.Math,Ie=t.Object,Ce=t.RegExp,De=t.String,Me=t.TypeError,je=n.prototype,Ae=ke.prototype,Pe=Ie.prototype,Oe=t["__core-js_shared__"],Fe=Ae.toString,Ue=Pe.hasOwnProperty,Re=0,Ne=(r=/[^.]+$/.exec(Oe&&Oe.keys&&Oe.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"",Le=Pe.toString,Be=Fe.call(Ie),qe=ht._,Ve=Ce("^"+Fe.call(Ue).replace(ie,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),We=yt?t.Buffer:i,$e=t.Symbol,ze=t.Uint8Array,Ye=We?We.allocUnsafe:i,He=lr(Ie.getPrototypeOf,Ie),Ge=Ie.create,Ke=Pe.propertyIsEnumerable,Ze=je.splice,Qe=$e?$e.isConcatSpreadable:i,Je=$e?$e.iterator:i,Xe=$e?$e.toStringTag:i,rt=function(){try{var e=pa(Ie,"defineProperty");return e({},"",{}),e}catch(e){}}(),it=t.clearTimeout!==ht.clearTimeout&&t.clearTimeout,ut=se&&se.now!==ht.Date.now&&se.now,ft=t.setTimeout!==ht.setTimeout&&t.setTimeout,gt=Ee.ceil,mt=Ee.floor,bt=Ie.getOwnPropertySymbols,_t=We?We.isBuffer:i,vt=t.isFinite,Bt=je.join,Gt=lr(Ie.keys,Ie),yr=Ee.max,_r=Ee.min,vr=se.now,wr=t.parseInt,Tr=Ee.random,xr=je.reverse,Sr=pa(t,"DataView"),kr=pa(t,"Map"),Er=pa(t,"Promise"),Ir=pa(t,"Set"),Cr=pa(t,"WeakMap"),Dr=pa(Ie,"create"),Mr=Cr&&new Cr,jr={},Ar=Na(Sr),Pr=Na(kr),Or=Na(Er),Fr=Na(Ir),Ur=Na(Cr),Rr=$e?$e.prototype:i,Nr=Rr?Rr.valueOf:i,Lr=Rr?Rr.toString:i;function Br(e){if(rs(e)&&!zo(e)&&!(e instanceof $r)){if(e instanceof Wr)return e;if(Ue.call(e,"__wrapped__"))return La(e)}return new Wr(e)}var qr=function(){function e(){}return function(t){if(!ts(t))return{};if(Ge)return Ge(t);e.prototype=t;var r=new e;return e.prototype=i,r}}();function Vr(){}function Wr(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=i}function $r(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=m,this.__views__=[]}function zr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Yr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Hr(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}function Gr(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new Hr;++t<r;)this.add(e[t])}function Kr(e){var t=this.__data__=new Yr(e);this.size=t.size}function Zr(e,t){var r=zo(e),n=!r&&$o(e),i=!r&&!n&&Ko(e),a=!r&&!n&&!i&&us(e),o=r||n||i||a,s=o?Qt(e.length,De):[],c=s.length;for(var l in e)!t&&!Ue.call(e,l)||o&&("length"==l||i&&("offset"==l||"parent"==l)||a&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||_a(l,c))||s.push(l);return s}function Qr(e){var t=e.length;return t?e[Kn(0,t-1)]:i}function Jr(e,t){return Fa(Mi(e),cn(t,0,e.length))}function Xr(e){return Fa(Mi(e))}function en(e,t,r){(r!==i&&!qo(e[t],r)||r===i&&!(t in e))&&on(e,t,r)}function tn(e,t,r){var n=e[t];Ue.call(e,t)&&qo(n,r)&&(r!==i||t in e)||on(e,t,r)}function rn(e,t){for(var r=e.length;r--;)if(qo(e[r][0],t))return r;return-1}function nn(e,t,r,n){return fn(e,(function(e,i,a){t(n,e,r(e),a)})),n}function an(e,t){return e&&ji(t,As(t),e)}function on(e,t,r){"__proto__"==t&&rt?rt(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}function sn(e,t){for(var r=-1,a=t.length,o=n(a),s=null==e;++r<a;)o[r]=s?i:Is(e,t[r]);return o}function cn(e,t,r){return e==e&&(r!==i&&(e=e<=r?e:r),t!==i&&(e=e>=t?e:t)),e}function ln(e,t,r,n,a,o){var s,c=1&t,l=2&t,u=4&t;if(r&&(s=a?r(e,n,a,o):r(e)),s!==i)return s;if(!ts(e))return e;var d=zo(e);if(d){if(s=function(e){var t=e.length,r=new e.constructor(t);t&&"string"==typeof e[0]&&Ue.call(e,"index")&&(r.index=e.index,r.input=e.input);return r}(e),!c)return Mi(e,s)}else{var p=ha(e),f=p==x||p==S;if(Ko(e))return Si(e,c);if(p==I||p==y||f&&!a){if(s=l||f?{}:ba(e),!c)return l?function(e,t){return ji(e,ga(e),t)}(e,function(e,t){return e&&ji(t,Ps(t),e)}(s,e)):function(e,t){return ji(e,fa(e),t)}(e,an(s,e))}else{if(!lt[p])return a?e:{};s=function(e,t,r){var n=e.constructor;switch(t){case O:return ki(e);case v:case w:return new n(+e);case F:return function(e,t){var r=t?ki(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.byteLength)}(e,r);case U:case R:case N:case L:case B:case q:case V:case W:case $:return Ei(e,r);case k:return new n;case E:case j:return new n(e);case D:return function(e){var t=new e.constructor(e.source,he.exec(e));return t.lastIndex=e.lastIndex,t}(e);case M:return new n;case A:return i=e,Nr?Ie(Nr.call(i)):{}}var i}(e,p,c)}}o||(o=new Kr);var g=o.get(e);if(g)return g;o.set(e,s),ss(e)?e.forEach((function(n){s.add(ln(n,t,r,n,e,o))})):ns(e)&&e.forEach((function(n,i){s.set(i,ln(n,t,r,i,e,o))}));var h=d?i:(u?l?aa:ia:l?Ps:As)(e);return Dt(h||e,(function(n,i){h&&(n=e[i=n]),tn(s,i,ln(n,t,r,i,e,o))})),s}function un(e,t,r){var n=r.length;if(null==e)return!n;for(e=Ie(e);n--;){var a=r[n],o=t[a],s=e[a];if(s===i&&!(a in e)||!o(s))return!1}return!0}function dn(e,t,r){if("function"!=typeof e)throw new Me(a);return ja((function(){e.apply(i,r)}),t)}function pn(e,t,r,n){var i=-1,a=Pt,o=!0,s=e.length,c=[],l=t.length;if(!s)return c;r&&(t=Ft(t,Xt(r))),n?(a=Ot,o=!1):t.length>=200&&(a=tr,o=!1,t=new Gr(t));e:for(;++i<s;){var u=e[i],d=null==r?u:r(u);if(u=n||0!==u?u:0,o&&d==d){for(var p=l;p--;)if(t[p]===d)continue e;c.push(u)}else a(t,d,n)||c.push(u)}return c}Br.templateSettings={escape:J,evaluate:X,interpolate:ee,variable:"",imports:{_:Br}},Br.prototype=Vr.prototype,Br.prototype.constructor=Br,Wr.prototype=qr(Vr.prototype),Wr.prototype.constructor=Wr,$r.prototype=qr(Vr.prototype),$r.prototype.constructor=$r,zr.prototype.clear=function(){this.__data__=Dr?Dr(null):{},this.size=0},zr.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},zr.prototype.get=function(e){var t=this.__data__;if(Dr){var r=t[e];return r===o?i:r}return Ue.call(t,e)?t[e]:i},zr.prototype.has=function(e){var t=this.__data__;return Dr?t[e]!==i:Ue.call(t,e)},zr.prototype.set=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Dr&&t===i?o:t,this},Yr.prototype.clear=function(){this.__data__=[],this.size=0},Yr.prototype.delete=function(e){var t=this.__data__,r=rn(t,e);return!(r<0)&&(r==t.length-1?t.pop():Ze.call(t,r,1),--this.size,!0)},Yr.prototype.get=function(e){var t=this.__data__,r=rn(t,e);return r<0?i:t[r][1]},Yr.prototype.has=function(e){return rn(this.__data__,e)>-1},Yr.prototype.set=function(e,t){var r=this.__data__,n=rn(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},Hr.prototype.clear=function(){this.size=0,this.__data__={hash:new zr,map:new(kr||Yr),string:new zr}},Hr.prototype.delete=function(e){var t=ua(this,e).delete(e);return this.size-=t?1:0,t},Hr.prototype.get=function(e){return ua(this,e).get(e)},Hr.prototype.has=function(e){return ua(this,e).has(e)},Hr.prototype.set=function(e,t){var r=ua(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},Gr.prototype.add=Gr.prototype.push=function(e){return this.__data__.set(e,o),this},Gr.prototype.has=function(e){return this.__data__.has(e)},Kr.prototype.clear=function(){this.__data__=new Yr,this.size=0},Kr.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},Kr.prototype.get=function(e){return this.__data__.get(e)},Kr.prototype.has=function(e){return this.__data__.has(e)},Kr.prototype.set=function(e,t){var r=this.__data__;if(r instanceof Yr){var n=r.__data__;if(!kr||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new Hr(n)}return r.set(e,t),this.size=r.size,this};var fn=Oi(wn),gn=Oi(Tn,!0);function hn(e,t){var r=!0;return fn(e,(function(e,n,i){return r=!!t(e,n,i)})),r}function mn(e,t,r){for(var n=-1,a=e.length;++n<a;){var o=e[n],s=t(o);if(null!=s&&(c===i?s==s&&!ls(s):r(s,c)))var c=s,l=o}return l}function bn(e,t){var r=[];return fn(e,(function(e,n,i){t(e,n,i)&&r.push(e)})),r}function yn(e,t,r,n,i){var a=-1,o=e.length;for(r||(r=ya),i||(i=[]);++a<o;){var s=e[a];t>0&&r(s)?t>1?yn(s,t-1,r,n,i):Ut(i,s):n||(i[i.length]=s)}return i}var _n=Fi(),vn=Fi(!0);function wn(e,t){return e&&_n(e,t,As)}function Tn(e,t){return e&&vn(e,t,As)}function xn(e,t){return At(t,(function(t){return Jo(e[t])}))}function Sn(e,t){for(var r=0,n=(t=vi(t,e)).length;null!=e&&r<n;)e=e[Ra(t[r++])];return r&&r==n?e:i}function kn(e,t,r){var n=t(e);return zo(e)?n:Ut(n,r(e))}function En(e){return null==e?e===i?"[object Undefined]":"[object Null]":Xe&&Xe in Ie(e)?function(e){var t=Ue.call(e,Xe),r=e[Xe];try{e[Xe]=i;var n=!0}catch(e){}var a=Le.call(e);n&&(t?e[Xe]=r:delete e[Xe]);return a}(e):function(e){return Le.call(e)}(e)}function In(e,t){return e>t}function Cn(e,t){return null!=e&&Ue.call(e,t)}function Dn(e,t){return null!=e&&t in Ie(e)}function Mn(e,t,r){for(var a=r?Ot:Pt,o=e[0].length,s=e.length,c=s,l=n(s),u=1/0,d=[];c--;){var p=e[c];c&&t&&(p=Ft(p,Xt(t))),u=_r(p.length,u),l[c]=!r&&(t||o>=120&&p.length>=120)?new Gr(c&&p):i}p=e[0];var f=-1,g=l[0];e:for(;++f<o&&d.length<u;){var h=p[f],m=t?t(h):h;if(h=r||0!==h?h:0,!(g?tr(g,m):a(d,m,r))){for(c=s;--c;){var b=l[c];if(!(b?tr(b,m):a(e[c],m,r)))continue e}g&&g.push(m),d.push(h)}}return d}function jn(e,t,r){var n=null==(e=Ca(e,t=vi(t,e)))?e:e[Ra(Za(t))];return null==n?i:It(n,e,r)}function An(e){return rs(e)&&En(e)==y}function Pn(e,t,r,n,a){return e===t||(null==e||null==t||!rs(e)&&!rs(t)?e!=e&&t!=t:function(e,t,r,n,a,o){var s=zo(e),c=zo(t),l=s?_:ha(e),u=c?_:ha(t),d=(l=l==y?I:l)==I,p=(u=u==y?I:u)==I,f=l==u;if(f&&Ko(e)){if(!Ko(t))return!1;s=!0,d=!1}if(f&&!d)return o||(o=new Kr),s||us(e)?ra(e,t,r,n,a,o):function(e,t,r,n,i,a,o){switch(r){case F:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case O:return!(e.byteLength!=t.byteLength||!a(new ze(e),new ze(t)));case v:case w:case E:return qo(+e,+t);case T:return e.name==t.name&&e.message==t.message;case D:case j:return e==t+"";case k:var s=cr;case M:var c=1&n;if(s||(s=dr),e.size!=t.size&&!c)return!1;var l=o.get(e);if(l)return l==t;n|=2,o.set(e,t);var u=ra(s(e),s(t),n,i,a,o);return o.delete(e),u;case A:if(Nr)return Nr.call(e)==Nr.call(t)}return!1}(e,t,l,r,n,a,o);if(!(1&r)){var g=d&&Ue.call(e,"__wrapped__"),h=p&&Ue.call(t,"__wrapped__");if(g||h){var m=g?e.value():e,b=h?t.value():t;return o||(o=new Kr),a(m,b,r,n,o)}}if(!f)return!1;return o||(o=new Kr),function(e,t,r,n,a,o){var s=1&r,c=ia(e),l=c.length,u=ia(t),d=u.length;if(l!=d&&!s)return!1;var p=l;for(;p--;){var f=c[p];if(!(s?f in t:Ue.call(t,f)))return!1}var g=o.get(e),h=o.get(t);if(g&&h)return g==t&&h==e;var m=!0;o.set(e,t),o.set(t,e);var b=s;for(;++p<l;){var y=e[f=c[p]],_=t[f];if(n)var v=s?n(_,y,f,t,e,o):n(y,_,f,e,t,o);if(!(v===i?y===_||a(y,_,r,n,o):v)){m=!1;break}b||(b="constructor"==f)}if(m&&!b){var w=e.constructor,T=t.constructor;w==T||!("constructor"in e)||!("constructor"in t)||"function"==typeof w&&w instanceof w&&"function"==typeof T&&T instanceof T||(m=!1)}return o.delete(e),o.delete(t),m}(e,t,r,n,a,o)}(e,t,r,n,Pn,a))}function On(e,t,r,n){var a=r.length,o=a,s=!n;if(null==e)return!o;for(e=Ie(e);a--;){var c=r[a];if(s&&c[2]?c[1]!==e[c[0]]:!(c[0]in e))return!1}for(;++a<o;){var l=(c=r[a])[0],u=e[l],d=c[1];if(s&&c[2]){if(u===i&&!(l in e))return!1}else{var p=new Kr;if(n)var f=n(u,d,l,e,t,p);if(!(f===i?Pn(d,u,3,n,p):f))return!1}}return!0}function Fn(e){return!(!ts(e)||(t=e,Ne&&Ne in t))&&(Jo(e)?Ve:ye).test(Na(e));var t}function Un(e){return"function"==typeof e?e:null==e?ic:"object"==typeof e?zo(e)?Vn(e[0],e[1]):qn(e):fc(e)}function Rn(e){if(!Sa(e))return Gt(e);var t=[];for(var r in Ie(e))Ue.call(e,r)&&"constructor"!=r&&t.push(r);return t}function Nn(e){if(!ts(e))return function(e){var t=[];if(null!=e)for(var r in Ie(e))t.push(r);return t}(e);var t=Sa(e),r=[];for(var n in e)("constructor"!=n||!t&&Ue.call(e,n))&&r.push(n);return r}function Ln(e,t){return e<t}function Bn(e,t){var r=-1,i=Ho(e)?n(e.length):[];return fn(e,(function(e,n,a){i[++r]=t(e,n,a)})),i}function qn(e){var t=da(e);return 1==t.length&&t[0][2]?Ea(t[0][0],t[0][1]):function(r){return r===e||On(r,e,t)}}function Vn(e,t){return wa(e)&&ka(t)?Ea(Ra(e),t):function(r){var n=Is(r,e);return n===i&&n===t?Cs(r,e):Pn(t,n,3)}}function Wn(e,t,r,n,a){e!==t&&_n(t,(function(o,s){if(a||(a=new Kr),ts(o))!function(e,t,r,n,a,o,s){var c=Da(e,r),l=Da(t,r),u=s.get(l);if(u)return void en(e,r,u);var d=o?o(c,l,r+"",e,t,s):i,p=d===i;if(p){var f=zo(l),g=!f&&Ko(l),h=!f&&!g&&us(l);d=l,f||g||h?zo(c)?d=c:Go(c)?d=Mi(c):g?(p=!1,d=Si(l,!0)):h?(p=!1,d=Ei(l,!0)):d=[]:as(l)||$o(l)?(d=c,$o(c)?d=ys(c):ts(c)&&!Jo(c)||(d=ba(l))):p=!1}p&&(s.set(l,d),a(d,l,n,o,s),s.delete(l));en(e,r,d)}(e,t,s,r,Wn,n,a);else{var c=n?n(Da(e,s),o,s+"",e,t,a):i;c===i&&(c=o),en(e,s,c)}}),Ps)}function $n(e,t){var r=e.length;if(r)return _a(t+=t<0?r:0,r)?e[t]:i}function zn(e,t,r){t=t.length?Ft(t,(function(e){return zo(e)?function(t){return Sn(t,1===e.length?e[0]:e)}:e})):[ic];var n=-1;t=Ft(t,Xt(la()));var i=Bn(e,(function(e,r,i){var a=Ft(t,(function(t){return t(e)}));return{criteria:a,index:++n,value:e}}));return function(e,t){var r=e.length;for(e.sort(t);r--;)e[r]=e[r].value;return e}(i,(function(e,t){return function(e,t,r){var n=-1,i=e.criteria,a=t.criteria,o=i.length,s=r.length;for(;++n<o;){var c=Ii(i[n],a[n]);if(c)return n>=s?c:c*("desc"==r[n]?-1:1)}return e.index-t.index}(e,t,r)}))}function Yn(e,t,r){for(var n=-1,i=t.length,a={};++n<i;){var o=t[n],s=Sn(e,o);r(s,o)&&ei(a,vi(o,e),s)}return a}function Hn(e,t,r,n){var i=n?$t:Wt,a=-1,o=t.length,s=e;for(e===t&&(t=Mi(t)),r&&(s=Ft(e,Xt(r)));++a<o;)for(var c=0,l=t[a],u=r?r(l):l;(c=i(s,u,c,n))>-1;)s!==e&&Ze.call(s,c,1),Ze.call(e,c,1);return e}function Gn(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==a){var a=i;_a(i)?Ze.call(e,i,1):pi(e,i)}}return e}function Kn(e,t){return e+mt(Tr()*(t-e+1))}function Zn(e,t){var r="";if(!e||t<1||t>g)return r;do{t%2&&(r+=e),(t=mt(t/2))&&(e+=e)}while(t);return r}function Qn(e,t){return Aa(Ia(e,t,ic),e+"")}function Jn(e){return Qr(qs(e))}function Xn(e,t){var r=qs(e);return Fa(r,cn(t,0,r.length))}function ei(e,t,r,n){if(!ts(e))return e;for(var a=-1,o=(t=vi(t,e)).length,s=o-1,c=e;null!=c&&++a<o;){var l=Ra(t[a]),u=r;if("__proto__"===l||"constructor"===l||"prototype"===l)return e;if(a!=s){var d=c[l];(u=n?n(d,l,c):i)===i&&(u=ts(d)?d:_a(t[a+1])?[]:{})}tn(c,l,u),c=c[l]}return e}var ti=Mr?function(e,t){return Mr.set(e,t),e}:ic,ri=rt?function(e,t){return rt(e,"toString",{configurable:!0,enumerable:!1,value:tc(t),writable:!0})}:ic;function ni(e){return Fa(qs(e))}function ii(e,t,r){var i=-1,a=e.length;t<0&&(t=-t>a?0:a+t),(r=r>a?a:r)<0&&(r+=a),a=t>r?0:r-t>>>0,t>>>=0;for(var o=n(a);++i<a;)o[i]=e[i+t];return o}function ai(e,t){var r;return fn(e,(function(e,n,i){return!(r=t(e,n,i))})),!!r}function oi(e,t,r){var n=0,i=null==e?n:e.length;if("number"==typeof t&&t==t&&i<=2147483647){for(;n<i;){var a=n+i>>>1,o=e[a];null!==o&&!ls(o)&&(r?o<=t:o<t)?n=a+1:i=a}return i}return si(e,t,ic,r)}function si(e,t,r,n){var a=0,o=null==e?0:e.length;if(0===o)return 0;for(var s=(t=r(t))!=t,c=null===t,l=ls(t),u=t===i;a<o;){var d=mt((a+o)/2),p=r(e[d]),f=p!==i,g=null===p,h=p==p,m=ls(p);if(s)var b=n||h;else b=u?h&&(n||f):c?h&&f&&(n||!g):l?h&&f&&!g&&(n||!m):!g&&!m&&(n?p<=t:p<t);b?a=d+1:o=d}return _r(o,4294967294)}function ci(e,t){for(var r=-1,n=e.length,i=0,a=[];++r<n;){var o=e[r],s=t?t(o):o;if(!r||!qo(s,c)){var c=s;a[i++]=0===o?0:o}}return a}function li(e){return"number"==typeof e?e:ls(e)?h:+e}function ui(e){if("string"==typeof e)return e;if(zo(e))return Ft(e,ui)+"";if(ls(e))return Lr?Lr.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function di(e,t,r){var n=-1,i=Pt,a=e.length,o=!0,s=[],c=s;if(r)o=!1,i=Ot;else if(a>=200){var l=t?null:Zi(e);if(l)return dr(l);o=!1,i=tr,c=new Gr}else c=t?[]:s;e:for(;++n<a;){var u=e[n],d=t?t(u):u;if(u=r||0!==u?u:0,o&&d==d){for(var p=c.length;p--;)if(c[p]===d)continue e;t&&c.push(d),s.push(u)}else i(c,d,r)||(c!==s&&c.push(d),s.push(u))}return s}function pi(e,t){return null==(e=Ca(e,t=vi(t,e)))||delete e[Ra(Za(t))]}function fi(e,t,r,n){return ei(e,t,r(Sn(e,t)),n)}function gi(e,t,r,n){for(var i=e.length,a=n?i:-1;(n?a--:++a<i)&&t(e[a],a,e););return r?ii(e,n?0:a,n?a+1:i):ii(e,n?a+1:0,n?i:a)}function hi(e,t){var r=e;return r instanceof $r&&(r=r.value()),Rt(t,(function(e,t){return t.func.apply(t.thisArg,Ut([e],t.args))}),r)}function mi(e,t,r){var i=e.length;if(i<2)return i?di(e[0]):[];for(var a=-1,o=n(i);++a<i;)for(var s=e[a],c=-1;++c<i;)c!=a&&(o[a]=pn(o[a]||s,e[c],t,r));return di(yn(o,1),t,r)}function bi(e,t,r){for(var n=-1,a=e.length,o=t.length,s={};++n<a;){var c=n<o?t[n]:i;r(s,e[n],c)}return s}function yi(e){return Go(e)?e:[]}function _i(e){return"function"==typeof e?e:ic}function vi(e,t){return zo(e)?e:wa(e,t)?[e]:Ua(_s(e))}var wi=Qn;function Ti(e,t,r){var n=e.length;return r=r===i?n:r,!t&&r>=n?e:ii(e,t,r)}var xi=it||function(e){return ht.clearTimeout(e)};function Si(e,t){if(t)return e.slice();var r=e.length,n=Ye?Ye(r):new e.constructor(r);return e.copy(n),n}function ki(e){var t=new e.constructor(e.byteLength);return new ze(t).set(new ze(e)),t}function Ei(e,t){var r=t?ki(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function Ii(e,t){if(e!==t){var r=e!==i,n=null===e,a=e==e,o=ls(e),s=t!==i,c=null===t,l=t==t,u=ls(t);if(!c&&!u&&!o&&e>t||o&&s&&l&&!c&&!u||n&&s&&l||!r&&l||!a)return 1;if(!n&&!o&&!u&&e<t||u&&r&&a&&!n&&!o||c&&r&&a||!s&&a||!l)return-1}return 0}function Ci(e,t,r,i){for(var a=-1,o=e.length,s=r.length,c=-1,l=t.length,u=yr(o-s,0),d=n(l+u),p=!i;++c<l;)d[c]=t[c];for(;++a<s;)(p||a<o)&&(d[r[a]]=e[a]);for(;u--;)d[c++]=e[a++];return d}function Di(e,t,r,i){for(var a=-1,o=e.length,s=-1,c=r.length,l=-1,u=t.length,d=yr(o-c,0),p=n(d+u),f=!i;++a<d;)p[a]=e[a];for(var g=a;++l<u;)p[g+l]=t[l];for(;++s<c;)(f||a<o)&&(p[g+r[s]]=e[a++]);return p}function Mi(e,t){var r=-1,i=e.length;for(t||(t=n(i));++r<i;)t[r]=e[r];return t}function ji(e,t,r,n){var a=!r;r||(r={});for(var o=-1,s=t.length;++o<s;){var c=t[o],l=n?n(r[c],e[c],c,r,e):i;l===i&&(l=e[c]),a?on(r,c,l):tn(r,c,l)}return r}function Ai(e,t){return function(r,n){var i=zo(r)?Ct:nn,a=t?t():{};return i(r,e,la(n,2),a)}}function Pi(e){return Qn((function(t,r){var n=-1,a=r.length,o=a>1?r[a-1]:i,s=a>2?r[2]:i;for(o=e.length>3&&"function"==typeof o?(a--,o):i,s&&va(r[0],r[1],s)&&(o=a<3?i:o,a=1),t=Ie(t);++n<a;){var c=r[n];c&&e(t,c,n,o)}return t}))}function Oi(e,t){return function(r,n){if(null==r)return r;if(!Ho(r))return e(r,n);for(var i=r.length,a=t?i:-1,o=Ie(r);(t?a--:++a<i)&&!1!==n(o[a],a,o););return r}}function Fi(e){return function(t,r,n){for(var i=-1,a=Ie(t),o=n(t),s=o.length;s--;){var c=o[e?s:++i];if(!1===r(a[c],c,a))break}return t}}function Ui(e){return function(t){var r=sr(t=_s(t))?gr(t):i,n=r?r[0]:t.charAt(0),a=r?Ti(r,1).join(""):t.slice(1);return n[e]()+a}}function Ri(e){return function(t){return Rt(Js($s(t).replace(et,"")),e,"")}}function Ni(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=qr(e.prototype),n=e.apply(r,t);return ts(n)?n:r}}function Li(e){return function(t,r,n){var a=Ie(t);if(!Ho(t)){var o=la(r,3);t=As(t),r=function(e){return o(a[e],e,a)}}var s=e(t,r,n);return s>-1?a[o?t[s]:s]:i}}function Bi(e){return na((function(t){var r=t.length,n=r,o=Wr.prototype.thru;for(e&&t.reverse();n--;){var s=t[n];if("function"!=typeof s)throw new Me(a);if(o&&!c&&"wrapper"==sa(s))var c=new Wr([],!0)}for(n=c?n:r;++n<r;){var l=sa(s=t[n]),u="wrapper"==l?oa(s):i;c=u&&Ta(u[0])&&424==u[1]&&!u[4].length&&1==u[9]?c[sa(u[0])].apply(c,u[3]):1==s.length&&Ta(s)?c[l]():c.thru(s)}return function(){var e=arguments,n=e[0];if(c&&1==e.length&&zo(n))return c.plant(n).value();for(var i=0,a=r?t[i].apply(this,e):n;++i<r;)a=t[i].call(this,a);return a}}))}function qi(e,t,r,a,o,s,c,l,u,p){var f=t&d,g=1&t,h=2&t,m=24&t,b=512&t,y=h?i:Ni(e);return function d(){for(var _=arguments.length,v=n(_),w=_;w--;)v[w]=arguments[w];if(m)var T=ca(d),x=function(e,t){for(var r=e.length,n=0;r--;)e[r]===t&&++n;return n}(v,T);if(a&&(v=Ci(v,a,o,m)),s&&(v=Di(v,s,c,m)),_-=x,m&&_<p){var S=ur(v,T);return Gi(e,t,qi,d.placeholder,r,v,S,l,u,p-_)}var k=g?r:this,E=h?k[e]:e;return _=v.length,l?v=function(e,t){var r=e.length,n=_r(t.length,r),a=Mi(e);for(;n--;){var o=t[n];e[n]=_a(o,r)?a[o]:i}return e}(v,l):b&&_>1&&v.reverse(),f&&u<_&&(v.length=u),this&&this!==ht&&this instanceof d&&(E=y||Ni(E)),E.apply(k,v)}}function Vi(e,t){return function(r,n){return function(e,t,r,n){return wn(e,(function(e,i,a){t(n,r(e),i,a)})),n}(r,e,t(n),{})}}function Wi(e,t){return function(r,n){var a;if(r===i&&n===i)return t;if(r!==i&&(a=r),n!==i){if(a===i)return n;"string"==typeof r||"string"==typeof n?(r=ui(r),n=ui(n)):(r=li(r),n=li(n)),a=e(r,n)}return a}}function $i(e){return na((function(t){return t=Ft(t,Xt(la())),Qn((function(r){var n=this;return e(t,(function(e){return It(e,n,r)}))}))}))}function zi(e,t){var r=(t=t===i?" ":ui(t)).length;if(r<2)return r?Zn(t,e):t;var n=Zn(t,gt(e/fr(t)));return sr(t)?Ti(gr(n),0,e).join(""):n.slice(0,e)}function Yi(e){return function(t,r,a){return a&&"number"!=typeof a&&va(t,r,a)&&(r=a=i),t=gs(t),r===i?(r=t,t=0):r=gs(r),function(e,t,r,i){for(var a=-1,o=yr(gt((t-e)/(r||1)),0),s=n(o);o--;)s[i?o:++a]=e,e+=r;return s}(t,r,a=a===i?t<r?1:-1:gs(a),e)}}function Hi(e){return function(t,r){return"string"==typeof t&&"string"==typeof r||(t=bs(t),r=bs(r)),e(t,r)}}function Gi(e,t,r,n,a,o,s,c,d,p){var f=8&t;t|=f?l:u,4&(t&=~(f?u:l))||(t&=-4);var g=[e,t,a,f?o:i,f?s:i,f?i:o,f?i:s,c,d,p],h=r.apply(i,g);return Ta(e)&&Ma(h,g),h.placeholder=n,Pa(h,e,t)}function Ki(e){var t=Ee[e];return function(e,r){if(e=bs(e),(r=null==r?0:_r(hs(r),292))&&vt(e)){var n=(_s(e)+"e").split("e");return+((n=(_s(t(n[0]+"e"+(+n[1]+r)))+"e").split("e"))[0]+"e"+(+n[1]-r))}return t(e)}}var Zi=Ir&&1/dr(new Ir([,-0]))[1]==f?function(e){return new Ir(e)}:lc;function Qi(e){return function(t){var r=ha(t);return r==k?cr(t):r==M?pr(t):function(e,t){return Ft(t,(function(t){return[t,e[t]]}))}(t,e(t))}}function Ji(e,t,r,o,f,g,h,m){var b=2&t;if(!b&&"function"!=typeof e)throw new Me(a);var y=o?o.length:0;if(y||(t&=-97,o=f=i),h=h===i?h:yr(hs(h),0),m=m===i?m:hs(m),y-=f?f.length:0,t&u){var _=o,v=f;o=f=i}var w=b?i:oa(e),T=[e,t,r,o,f,_,v,g,h,m];if(w&&function(e,t){var r=e[1],n=t[1],i=r|n,a=i<131,o=n==d&&8==r||n==d&&r==p&&e[7].length<=t[8]||384==n&&t[7].length<=t[8]&&8==r;if(!a&&!o)return e;1&n&&(e[2]=t[2],i|=1&r?0:4);var c=t[3];if(c){var l=e[3];e[3]=l?Ci(l,c,t[4]):c,e[4]=l?ur(e[3],s):t[4]}(c=t[5])&&(l=e[5],e[5]=l?Di(l,c,t[6]):c,e[6]=l?ur(e[5],s):t[6]);(c=t[7])&&(e[7]=c);n&d&&(e[8]=null==e[8]?t[8]:_r(e[8],t[8]));null==e[9]&&(e[9]=t[9]);e[0]=t[0],e[1]=i}(T,w),e=T[0],t=T[1],r=T[2],o=T[3],f=T[4],!(m=T[9]=T[9]===i?b?0:e.length:yr(T[9]-y,0))&&24&t&&(t&=-25),t&&1!=t)x=8==t||t==c?function(e,t,r){var a=Ni(e);return function o(){for(var s=arguments.length,c=n(s),l=s,u=ca(o);l--;)c[l]=arguments[l];var d=s<3&&c[0]!==u&&c[s-1]!==u?[]:ur(c,u);return(s-=d.length)<r?Gi(e,t,qi,o.placeholder,i,c,d,i,i,r-s):It(this&&this!==ht&&this instanceof o?a:e,this,c)}}(e,t,m):t!=l&&33!=t||f.length?qi.apply(i,T):function(e,t,r,i){var a=1&t,o=Ni(e);return function t(){for(var s=-1,c=arguments.length,l=-1,u=i.length,d=n(u+c),p=this&&this!==ht&&this instanceof t?o:e;++l<u;)d[l]=i[l];for(;c--;)d[l++]=arguments[++s];return It(p,a?r:this,d)}}(e,t,r,o);else var x=function(e,t,r){var n=1&t,i=Ni(e);return function t(){return(this&&this!==ht&&this instanceof t?i:e).apply(n?r:this,arguments)}}(e,t,r);return Pa((w?ti:Ma)(x,T),e,t)}function Xi(e,t,r,n){return e===i||qo(e,Pe[r])&&!Ue.call(n,r)?t:e}function ea(e,t,r,n,a,o){return ts(e)&&ts(t)&&(o.set(t,e),Wn(e,t,i,ea,o),o.delete(t)),e}function ta(e){return as(e)?i:e}function ra(e,t,r,n,a,o){var s=1&r,c=e.length,l=t.length;if(c!=l&&!(s&&l>c))return!1;var u=o.get(e),d=o.get(t);if(u&&d)return u==t&&d==e;var p=-1,f=!0,g=2&r?new Gr:i;for(o.set(e,t),o.set(t,e);++p<c;){var h=e[p],m=t[p];if(n)var b=s?n(m,h,p,t,e,o):n(h,m,p,e,t,o);if(b!==i){if(b)continue;f=!1;break}if(g){if(!Lt(t,(function(e,t){if(!tr(g,t)&&(h===e||a(h,e,r,n,o)))return g.push(t)}))){f=!1;break}}else if(h!==m&&!a(h,m,r,n,o)){f=!1;break}}return o.delete(e),o.delete(t),f}function na(e){return Aa(Ia(e,i,za),e+"")}function ia(e){return kn(e,As,fa)}function aa(e){return kn(e,Ps,ga)}var oa=Mr?function(e){return Mr.get(e)}:lc;function sa(e){for(var t=e.name+"",r=jr[t],n=Ue.call(jr,t)?r.length:0;n--;){var i=r[n],a=i.func;if(null==a||a==e)return i.name}return t}function ca(e){return(Ue.call(Br,"placeholder")?Br:e).placeholder}function la(){var e=Br.iteratee||ac;return e=e===ac?Un:e,arguments.length?e(arguments[0],arguments[1]):e}function ua(e,t){var r,n,i=e.__data__;return("string"==(n=typeof(r=t))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?i["string"==typeof t?"string":"hash"]:i.map}function da(e){for(var t=As(e),r=t.length;r--;){var n=t[r],i=e[n];t[r]=[n,i,ka(i)]}return t}function pa(e,t){var r=function(e,t){return null==e?i:e[t]}(e,t);return Fn(r)?r:i}var fa=bt?function(e){return null==e?[]:(e=Ie(e),At(bt(e),(function(t){return Ke.call(e,t)})))}:mc,ga=bt?function(e){for(var t=[];e;)Ut(t,fa(e)),e=He(e);return t}:mc,ha=En;function ma(e,t,r){for(var n=-1,i=(t=vi(t,e)).length,a=!1;++n<i;){var o=Ra(t[n]);if(!(a=null!=e&&r(e,o)))break;e=e[o]}return a||++n!=i?a:!!(i=null==e?0:e.length)&&es(i)&&_a(o,i)&&(zo(e)||$o(e))}function ba(e){return"function"!=typeof e.constructor||Sa(e)?{}:qr(He(e))}function ya(e){return zo(e)||$o(e)||!!(Qe&&e&&e[Qe])}function _a(e,t){var r=typeof e;return!!(t=null==t?g:t)&&("number"==r||"symbol"!=r&&ve.test(e))&&e>-1&&e%1==0&&e<t}function va(e,t,r){if(!ts(r))return!1;var n=typeof t;return!!("number"==n?Ho(r)&&_a(t,r.length):"string"==n&&t in r)&&qo(r[t],e)}function wa(e,t){if(zo(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ls(e))||(re.test(e)||!te.test(e)||null!=t&&e in Ie(t))}function Ta(e){var t=sa(e),r=Br[t];if("function"!=typeof r||!(t in $r.prototype))return!1;if(e===r)return!0;var n=oa(r);return!!n&&e===n[0]}(Sr&&ha(new Sr(new ArrayBuffer(1)))!=F||kr&&ha(new kr)!=k||Er&&ha(Er.resolve())!=C||Ir&&ha(new Ir)!=M||Cr&&ha(new Cr)!=P)&&(ha=function(e){var t=En(e),r=t==I?e.constructor:i,n=r?Na(r):"";if(n)switch(n){case Ar:return F;case Pr:return k;case Or:return C;case Fr:return M;case Ur:return P}return t});var xa=Oe?Jo:bc;function Sa(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||Pe)}function ka(e){return e==e&&!ts(e)}function Ea(e,t){return function(r){return null!=r&&(r[e]===t&&(t!==i||e in Ie(r)))}}function Ia(e,t,r){return t=yr(t===i?e.length-1:t,0),function(){for(var i=arguments,a=-1,o=yr(i.length-t,0),s=n(o);++a<o;)s[a]=i[t+a];a=-1;for(var c=n(t+1);++a<t;)c[a]=i[a];return c[t]=r(s),It(e,this,c)}}function Ca(e,t){return t.length<2?e:Sn(e,ii(t,0,-1))}function Da(e,t){if(("constructor"!==t||"function"!=typeof e[t])&&"__proto__"!=t)return e[t]}var Ma=Oa(ti),ja=ft||function(e,t){return ht.setTimeout(e,t)},Aa=Oa(ri);function Pa(e,t,r){var n=t+"";return Aa(e,function(e,t){var r=t.length;if(!r)return e;var n=r-1;return t[n]=(r>1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(ce,"{\n/* [wrapped with "+t+"] */\n")}(n,function(e,t){return Dt(b,(function(r){var n="_."+r[0];t&r[1]&&!Pt(e,n)&&e.push(n)})),e.sort()}(function(e){var t=e.match(le);return t?t[1].split(ue):[]}(n),r)))}function Oa(e){var t=0,r=0;return function(){var n=vr(),a=16-(n-r);if(r=n,a>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(i,arguments)}}function Fa(e,t){var r=-1,n=e.length,a=n-1;for(t=t===i?n:t;++r<t;){var o=Kn(r,a),s=e[o];e[o]=e[r],e[r]=s}return e.length=t,e}var Ua=function(e){var t=Fo(e,(function(e){return 500===r.size&&r.clear(),e})),r=t.cache;return t}((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(ne,(function(e,r,n,i){t.push(n?i.replace(fe,"$1"):r||e)})),t}));function Ra(e){if("string"==typeof e||ls(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function Na(e){if(null!=e){try{return Fe.call(e)}catch(e){}try{return e+""}catch(e){}}return""}function La(e){if(e instanceof $r)return e.clone();var t=new Wr(e.__wrapped__,e.__chain__);return t.__actions__=Mi(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}var Ba=Qn((function(e,t){return Go(e)?pn(e,yn(t,1,Go,!0)):[]})),qa=Qn((function(e,t){var r=Za(t);return Go(r)&&(r=i),Go(e)?pn(e,yn(t,1,Go,!0),la(r,2)):[]})),Va=Qn((function(e,t){var r=Za(t);return Go(r)&&(r=i),Go(e)?pn(e,yn(t,1,Go,!0),i,r):[]}));function Wa(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:hs(r);return i<0&&(i=yr(n+i,0)),Vt(e,la(t,3),i)}function $a(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var a=n-1;return r!==i&&(a=hs(r),a=r<0?yr(n+a,0):_r(a,n-1)),Vt(e,la(t,3),a,!0)}function za(e){return(null==e?0:e.length)?yn(e,1):[]}function Ya(e){return e&&e.length?e[0]:i}var Ha=Qn((function(e){var t=Ft(e,yi);return t.length&&t[0]===e[0]?Mn(t):[]})),Ga=Qn((function(e){var t=Za(e),r=Ft(e,yi);return t===Za(r)?t=i:r.pop(),r.length&&r[0]===e[0]?Mn(r,la(t,2)):[]})),Ka=Qn((function(e){var t=Za(e),r=Ft(e,yi);return(t="function"==typeof t?t:i)&&r.pop(),r.length&&r[0]===e[0]?Mn(r,i,t):[]}));function Za(e){var t=null==e?0:e.length;return t?e[t-1]:i}var Qa=Qn(Ja);function Ja(e,t){return e&&e.length&&t&&t.length?Hn(e,t):e}var Xa=na((function(e,t){var r=null==e?0:e.length,n=sn(e,t);return Gn(e,Ft(t,(function(e){return _a(e,r)?+e:e})).sort(Ii)),n}));function eo(e){return null==e?e:xr.call(e)}var to=Qn((function(e){return di(yn(e,1,Go,!0))})),ro=Qn((function(e){var t=Za(e);return Go(t)&&(t=i),di(yn(e,1,Go,!0),la(t,2))})),no=Qn((function(e){var t=Za(e);return t="function"==typeof t?t:i,di(yn(e,1,Go,!0),i,t)}));function io(e){if(!e||!e.length)return[];var t=0;return e=At(e,(function(e){if(Go(e))return t=yr(e.length,t),!0})),Qt(t,(function(t){return Ft(e,Ht(t))}))}function ao(e,t){if(!e||!e.length)return[];var r=io(e);return null==t?r:Ft(r,(function(e){return It(t,i,e)}))}var oo=Qn((function(e,t){return Go(e)?pn(e,t):[]})),so=Qn((function(e){return mi(At(e,Go))})),co=Qn((function(e){var t=Za(e);return Go(t)&&(t=i),mi(At(e,Go),la(t,2))})),lo=Qn((function(e){var t=Za(e);return t="function"==typeof t?t:i,mi(At(e,Go),i,t)})),uo=Qn(io);var po=Qn((function(e){var t=e.length,r=t>1?e[t-1]:i;return r="function"==typeof r?(e.pop(),r):i,ao(e,r)}));function fo(e){var t=Br(e);return t.__chain__=!0,t}function go(e,t){return t(e)}var ho=na((function(e){var t=e.length,r=t?e[0]:0,n=this.__wrapped__,a=function(t){return sn(t,e)};return!(t>1||this.__actions__.length)&&n instanceof $r&&_a(r)?((n=n.slice(r,+r+(t?1:0))).__actions__.push({func:go,args:[a],thisArg:i}),new Wr(n,this.__chain__).thru((function(e){return t&&!e.length&&e.push(i),e}))):this.thru(a)}));var mo=Ai((function(e,t,r){Ue.call(e,r)?++e[r]:on(e,r,1)}));var bo=Li(Wa),yo=Li($a);function _o(e,t){return(zo(e)?Dt:fn)(e,la(t,3))}function vo(e,t){return(zo(e)?Mt:gn)(e,la(t,3))}var wo=Ai((function(e,t,r){Ue.call(e,r)?e[r].push(t):on(e,r,[t])}));var To=Qn((function(e,t,r){var i=-1,a="function"==typeof t,o=Ho(e)?n(e.length):[];return fn(e,(function(e){o[++i]=a?It(t,e,r):jn(e,t,r)})),o})),xo=Ai((function(e,t,r){on(e,r,t)}));function So(e,t){return(zo(e)?Ft:Bn)(e,la(t,3))}var ko=Ai((function(e,t,r){e[r?0:1].push(t)}),(function(){return[[],[]]}));var Eo=Qn((function(e,t){if(null==e)return[];var r=t.length;return r>1&&va(e,t[0],t[1])?t=[]:r>2&&va(t[0],t[1],t[2])&&(t=[t[0]]),zn(e,yn(t,1),[])})),Io=ut||function(){return ht.Date.now()};function Co(e,t,r){return t=r?i:t,t=e&&null==t?e.length:t,Ji(e,d,i,i,i,i,t)}function Do(e,t){var r;if("function"!=typeof t)throw new Me(a);return e=hs(e),function(){return--e>0&&(r=t.apply(this,arguments)),e<=1&&(t=i),r}}var Mo=Qn((function(e,t,r){var n=1;if(r.length){var i=ur(r,ca(Mo));n|=l}return Ji(e,n,t,r,i)})),jo=Qn((function(e,t,r){var n=3;if(r.length){var i=ur(r,ca(jo));n|=l}return Ji(t,n,e,r,i)}));function Ao(e,t,r){var n,o,s,c,l,u,d=0,p=!1,f=!1,g=!0;if("function"!=typeof e)throw new Me(a);function h(t){var r=n,a=o;return n=o=i,d=t,c=e.apply(a,r)}function m(e){var r=e-u;return u===i||r>=t||r<0||f&&e-d>=s}function b(){var e=Io();if(m(e))return y(e);l=ja(b,function(e){var r=t-(e-u);return f?_r(r,s-(e-d)):r}(e))}function y(e){return l=i,g&&n?h(e):(n=o=i,c)}function _(){var e=Io(),r=m(e);if(n=arguments,o=this,u=e,r){if(l===i)return function(e){return d=e,l=ja(b,t),p?h(e):c}(u);if(f)return xi(l),l=ja(b,t),h(u)}return l===i&&(l=ja(b,t)),c}return t=bs(t)||0,ts(r)&&(p=!!r.leading,s=(f="maxWait"in r)?yr(bs(r.maxWait)||0,t):s,g="trailing"in r?!!r.trailing:g),_.cancel=function(){l!==i&&xi(l),d=0,n=u=o=l=i},_.flush=function(){return l===i?c:y(Io())},_}var Po=Qn((function(e,t){return dn(e,1,t)})),Oo=Qn((function(e,t,r){return dn(e,bs(t)||0,r)}));function Fo(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new Me(a);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(Fo.Cache||Hr),r}function Uo(e){if("function"!=typeof e)throw new Me(a);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}Fo.Cache=Hr;var Ro=wi((function(e,t){var r=(t=1==t.length&&zo(t[0])?Ft(t[0],Xt(la())):Ft(yn(t,1),Xt(la()))).length;return Qn((function(n){for(var i=-1,a=_r(n.length,r);++i<a;)n[i]=t[i].call(this,n[i]);return It(e,this,n)}))})),No=Qn((function(e,t){var r=ur(t,ca(No));return Ji(e,l,i,t,r)})),Lo=Qn((function(e,t){var r=ur(t,ca(Lo));return Ji(e,u,i,t,r)})),Bo=na((function(e,t){return Ji(e,p,i,i,i,t)}));function qo(e,t){return e===t||e!=e&&t!=t}var Vo=Hi(In),Wo=Hi((function(e,t){return e>=t})),$o=An(function(){return arguments}())?An:function(e){return rs(e)&&Ue.call(e,"callee")&&!Ke.call(e,"callee")},zo=n.isArray,Yo=wt?Xt(wt):function(e){return rs(e)&&En(e)==O};function Ho(e){return null!=e&&es(e.length)&&!Jo(e)}function Go(e){return rs(e)&&Ho(e)}var Ko=_t||bc,Zo=Tt?Xt(Tt):function(e){return rs(e)&&En(e)==w};function Qo(e){if(!rs(e))return!1;var t=En(e);return t==T||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!as(e)}function Jo(e){if(!ts(e))return!1;var t=En(e);return t==x||t==S||"[object AsyncFunction]"==t||"[object Proxy]"==t}function Xo(e){return"number"==typeof e&&e==hs(e)}function es(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=g}function ts(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function rs(e){return null!=e&&"object"==typeof e}var ns=xt?Xt(xt):function(e){return rs(e)&&ha(e)==k};function is(e){return"number"==typeof e||rs(e)&&En(e)==E}function as(e){if(!rs(e)||En(e)!=I)return!1;var t=He(e);if(null===t)return!0;var r=Ue.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&Fe.call(r)==Be}var os=St?Xt(St):function(e){return rs(e)&&En(e)==D};var ss=kt?Xt(kt):function(e){return rs(e)&&ha(e)==M};function cs(e){return"string"==typeof e||!zo(e)&&rs(e)&&En(e)==j}function ls(e){return"symbol"==typeof e||rs(e)&&En(e)==A}var us=Et?Xt(Et):function(e){return rs(e)&&es(e.length)&&!!ct[En(e)]};var ds=Hi(Ln),ps=Hi((function(e,t){return e<=t}));function fs(e){if(!e)return[];if(Ho(e))return cs(e)?gr(e):Mi(e);if(Je&&e[Je])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[Je]());var t=ha(e);return(t==k?cr:t==M?dr:qs)(e)}function gs(e){return e?(e=bs(e))===f||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}function hs(e){var t=gs(e),r=t%1;return t==t?r?t-r:t:0}function ms(e){return e?cn(hs(e),0,m):0}function bs(e){if("number"==typeof e)return e;if(ls(e))return h;if(ts(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=ts(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=Jt(e);var r=be.test(e);return r||_e.test(e)?pt(e.slice(2),r?2:8):me.test(e)?h:+e}function ys(e){return ji(e,Ps(e))}function _s(e){return null==e?"":ui(e)}var vs=Pi((function(e,t){if(Sa(t)||Ho(t))ji(t,As(t),e);else for(var r in t)Ue.call(t,r)&&tn(e,r,t[r])})),ws=Pi((function(e,t){ji(t,Ps(t),e)})),Ts=Pi((function(e,t,r,n){ji(t,Ps(t),e,n)})),xs=Pi((function(e,t,r,n){ji(t,As(t),e,n)})),Ss=na(sn);var ks=Qn((function(e,t){e=Ie(e);var r=-1,n=t.length,a=n>2?t[2]:i;for(a&&va(t[0],t[1],a)&&(n=1);++r<n;)for(var o=t[r],s=Ps(o),c=-1,l=s.length;++c<l;){var u=s[c],d=e[u];(d===i||qo(d,Pe[u])&&!Ue.call(e,u))&&(e[u]=o[u])}return e})),Es=Qn((function(e){return e.push(i,ea),It(Fs,i,e)}));function Is(e,t,r){var n=null==e?i:Sn(e,t);return n===i?r:n}function Cs(e,t){return null!=e&&ma(e,t,Dn)}var Ds=Vi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),e[t]=r}),tc(ic)),Ms=Vi((function(e,t,r){null!=t&&"function"!=typeof t.toString&&(t=Le.call(t)),Ue.call(e,t)?e[t].push(r):e[t]=[r]}),la),js=Qn(jn);function As(e){return Ho(e)?Zr(e):Rn(e)}function Ps(e){return Ho(e)?Zr(e,!0):Nn(e)}var Os=Pi((function(e,t,r){Wn(e,t,r)})),Fs=Pi((function(e,t,r,n){Wn(e,t,r,n)})),Us=na((function(e,t){var r={};if(null==e)return r;var n=!1;t=Ft(t,(function(t){return t=vi(t,e),n||(n=t.length>1),t})),ji(e,aa(e),r),n&&(r=ln(r,7,ta));for(var i=t.length;i--;)pi(r,t[i]);return r}));var Rs=na((function(e,t){return null==e?{}:function(e,t){return Yn(e,t,(function(t,r){return Cs(e,r)}))}(e,t)}));function Ns(e,t){if(null==e)return{};var r=Ft(aa(e),(function(e){return[e]}));return t=la(t),Yn(e,r,(function(e,r){return t(e,r[0])}))}var Ls=Qi(As),Bs=Qi(Ps);function qs(e){return null==e?[]:er(e,As(e))}var Vs=Ri((function(e,t,r){return t=t.toLowerCase(),e+(r?Ws(t):t)}));function Ws(e){return Qs(_s(e).toLowerCase())}function $s(e){return(e=_s(e))&&e.replace(we,ir).replace(tt,"")}var zs=Ri((function(e,t,r){return e+(r?"-":"")+t.toLowerCase()})),Ys=Ri((function(e,t,r){return e+(r?" ":"")+t.toLowerCase()})),Hs=Ui("toLowerCase");var Gs=Ri((function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}));var Ks=Ri((function(e,t,r){return e+(r?" ":"")+Qs(t)}));var Zs=Ri((function(e,t,r){return e+(r?" ":"")+t.toUpperCase()})),Qs=Ui("toUpperCase");function Js(e,t,r){return e=_s(e),(t=r?i:t)===i?function(e){return at.test(e)}(e)?function(e){return e.match(nt)||[]}(e):function(e){return e.match(de)||[]}(e):e.match(t)||[]}var Xs=Qn((function(e,t){try{return It(e,i,t)}catch(e){return Qo(e)?e:new Se(e)}})),ec=na((function(e,t){return Dt(t,(function(t){t=Ra(t),on(e,t,Mo(e[t],e))})),e}));function tc(e){return function(){return e}}var rc=Bi(),nc=Bi(!0);function ic(e){return e}function ac(e){return Un("function"==typeof e?e:ln(e,1))}var oc=Qn((function(e,t){return function(r){return jn(r,e,t)}})),sc=Qn((function(e,t){return function(r){return jn(e,r,t)}}));function cc(e,t,r){var n=As(t),i=xn(t,n);null!=r||ts(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=xn(t,As(t)));var a=!(ts(r)&&"chain"in r&&!r.chain),o=Jo(e);return Dt(i,(function(r){var n=t[r];e[r]=n,o&&(e.prototype[r]=function(){var t=this.__chain__;if(a||t){var r=e(this.__wrapped__);return(r.__actions__=Mi(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,Ut([this.value()],arguments))})})),e}function lc(){}var uc=$i(Ft),dc=$i(jt),pc=$i(Lt);function fc(e){return wa(e)?Ht(Ra(e)):function(e){return function(t){return Sn(t,e)}}(e)}var gc=Yi(),hc=Yi(!0);function mc(){return[]}function bc(){return!1}var yc=Wi((function(e,t){return e+t}),0),_c=Ki("ceil"),vc=Wi((function(e,t){return e/t}),1),wc=Ki("floor");var Tc,xc=Wi((function(e,t){return e*t}),1),Sc=Ki("round"),kc=Wi((function(e,t){return e-t}),0);return Br.after=function(e,t){if("function"!=typeof t)throw new Me(a);return e=hs(e),function(){if(--e<1)return t.apply(this,arguments)}},Br.ary=Co,Br.assign=vs,Br.assignIn=ws,Br.assignInWith=Ts,Br.assignWith=xs,Br.at=Ss,Br.before=Do,Br.bind=Mo,Br.bindAll=ec,Br.bindKey=jo,Br.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return zo(e)?e:[e]},Br.chain=fo,Br.chunk=function(e,t,r){t=(r?va(e,t,r):t===i)?1:yr(hs(t),0);var a=null==e?0:e.length;if(!a||t<1)return[];for(var o=0,s=0,c=n(gt(a/t));o<a;)c[s++]=ii(e,o,o+=t);return c},Br.compact=function(e){for(var t=-1,r=null==e?0:e.length,n=0,i=[];++t<r;){var a=e[t];a&&(i[n++]=a)}return i},Br.concat=function(){var e=arguments.length;if(!e)return[];for(var t=n(e-1),r=arguments[0],i=e;i--;)t[i-1]=arguments[i];return Ut(zo(r)?Mi(r):[r],yn(t,1))},Br.cond=function(e){var t=null==e?0:e.length,r=la();return e=t?Ft(e,(function(e){if("function"!=typeof e[1])throw new Me(a);return[r(e[0]),e[1]]})):[],Qn((function(r){for(var n=-1;++n<t;){var i=e[n];if(It(i[0],this,r))return It(i[1],this,r)}}))},Br.conforms=function(e){return function(e){var t=As(e);return function(r){return un(r,e,t)}}(ln(e,1))},Br.constant=tc,Br.countBy=mo,Br.create=function(e,t){var r=qr(e);return null==t?r:an(r,t)},Br.curry=function e(t,r,n){var a=Ji(t,8,i,i,i,i,i,r=n?i:r);return a.placeholder=e.placeholder,a},Br.curryRight=function e(t,r,n){var a=Ji(t,c,i,i,i,i,i,r=n?i:r);return a.placeholder=e.placeholder,a},Br.debounce=Ao,Br.defaults=ks,Br.defaultsDeep=Es,Br.defer=Po,Br.delay=Oo,Br.difference=Ba,Br.differenceBy=qa,Br.differenceWith=Va,Br.drop=function(e,t,r){var n=null==e?0:e.length;return n?ii(e,(t=r||t===i?1:hs(t))<0?0:t,n):[]},Br.dropRight=function(e,t,r){var n=null==e?0:e.length;return n?ii(e,0,(t=n-(t=r||t===i?1:hs(t)))<0?0:t):[]},Br.dropRightWhile=function(e,t){return e&&e.length?gi(e,la(t,3),!0,!0):[]},Br.dropWhile=function(e,t){return e&&e.length?gi(e,la(t,3),!0):[]},Br.fill=function(e,t,r,n){var a=null==e?0:e.length;return a?(r&&"number"!=typeof r&&va(e,t,r)&&(r=0,n=a),function(e,t,r,n){var a=e.length;for((r=hs(r))<0&&(r=-r>a?0:a+r),(n=n===i||n>a?a:hs(n))<0&&(n+=a),n=r>n?0:ms(n);r<n;)e[r++]=t;return e}(e,t,r,n)):[]},Br.filter=function(e,t){return(zo(e)?At:bn)(e,la(t,3))},Br.flatMap=function(e,t){return yn(So(e,t),1)},Br.flatMapDeep=function(e,t){return yn(So(e,t),f)},Br.flatMapDepth=function(e,t,r){return r=r===i?1:hs(r),yn(So(e,t),r)},Br.flatten=za,Br.flattenDeep=function(e){return(null==e?0:e.length)?yn(e,f):[]},Br.flattenDepth=function(e,t){return(null==e?0:e.length)?yn(e,t=t===i?1:hs(t)):[]},Br.flip=function(e){return Ji(e,512)},Br.flow=rc,Br.flowRight=nc,Br.fromPairs=function(e){for(var t=-1,r=null==e?0:e.length,n={};++t<r;){var i=e[t];n[i[0]]=i[1]}return n},Br.functions=function(e){return null==e?[]:xn(e,As(e))},Br.functionsIn=function(e){return null==e?[]:xn(e,Ps(e))},Br.groupBy=wo,Br.initial=function(e){return(null==e?0:e.length)?ii(e,0,-1):[]},Br.intersection=Ha,Br.intersectionBy=Ga,Br.intersectionWith=Ka,Br.invert=Ds,Br.invertBy=Ms,Br.invokeMap=To,Br.iteratee=ac,Br.keyBy=xo,Br.keys=As,Br.keysIn=Ps,Br.map=So,Br.mapKeys=function(e,t){var r={};return t=la(t,3),wn(e,(function(e,n,i){on(r,t(e,n,i),e)})),r},Br.mapValues=function(e,t){var r={};return t=la(t,3),wn(e,(function(e,n,i){on(r,n,t(e,n,i))})),r},Br.matches=function(e){return qn(ln(e,1))},Br.matchesProperty=function(e,t){return Vn(e,ln(t,1))},Br.memoize=Fo,Br.merge=Os,Br.mergeWith=Fs,Br.method=oc,Br.methodOf=sc,Br.mixin=cc,Br.negate=Uo,Br.nthArg=function(e){return e=hs(e),Qn((function(t){return $n(t,e)}))},Br.omit=Us,Br.omitBy=function(e,t){return Ns(e,Uo(la(t)))},Br.once=function(e){return Do(2,e)},Br.orderBy=function(e,t,r,n){return null==e?[]:(zo(t)||(t=null==t?[]:[t]),zo(r=n?i:r)||(r=null==r?[]:[r]),zn(e,t,r))},Br.over=uc,Br.overArgs=Ro,Br.overEvery=dc,Br.overSome=pc,Br.partial=No,Br.partialRight=Lo,Br.partition=ko,Br.pick=Rs,Br.pickBy=Ns,Br.property=fc,Br.propertyOf=function(e){return function(t){return null==e?i:Sn(e,t)}},Br.pull=Qa,Br.pullAll=Ja,Br.pullAllBy=function(e,t,r){return e&&e.length&&t&&t.length?Hn(e,t,la(r,2)):e},Br.pullAllWith=function(e,t,r){return e&&e.length&&t&&t.length?Hn(e,t,i,r):e},Br.pullAt=Xa,Br.range=gc,Br.rangeRight=hc,Br.rearg=Bo,Br.reject=function(e,t){return(zo(e)?At:bn)(e,Uo(la(t,3)))},Br.remove=function(e,t){var r=[];if(!e||!e.length)return r;var n=-1,i=[],a=e.length;for(t=la(t,3);++n<a;){var o=e[n];t(o,n,e)&&(r.push(o),i.push(n))}return Gn(e,i),r},Br.rest=function(e,t){if("function"!=typeof e)throw new Me(a);return Qn(e,t=t===i?t:hs(t))},Br.reverse=eo,Br.sampleSize=function(e,t,r){return t=(r?va(e,t,r):t===i)?1:hs(t),(zo(e)?Jr:Xn)(e,t)},Br.set=function(e,t,r){return null==e?e:ei(e,t,r)},Br.setWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:ei(e,t,r,n)},Br.shuffle=function(e){return(zo(e)?Xr:ni)(e)},Br.slice=function(e,t,r){var n=null==e?0:e.length;return n?(r&&"number"!=typeof r&&va(e,t,r)?(t=0,r=n):(t=null==t?0:hs(t),r=r===i?n:hs(r)),ii(e,t,r)):[]},Br.sortBy=Eo,Br.sortedUniq=function(e){return e&&e.length?ci(e):[]},Br.sortedUniqBy=function(e,t){return e&&e.length?ci(e,la(t,2)):[]},Br.split=function(e,t,r){return r&&"number"!=typeof r&&va(e,t,r)&&(t=r=i),(r=r===i?m:r>>>0)?(e=_s(e))&&("string"==typeof t||null!=t&&!os(t))&&!(t=ui(t))&&sr(e)?Ti(gr(e),0,r):e.split(t,r):[]},Br.spread=function(e,t){if("function"!=typeof e)throw new Me(a);return t=null==t?0:yr(hs(t),0),Qn((function(r){var n=r[t],i=Ti(r,0,t);return n&&Ut(i,n),It(e,this,i)}))},Br.tail=function(e){var t=null==e?0:e.length;return t?ii(e,1,t):[]},Br.take=function(e,t,r){return e&&e.length?ii(e,0,(t=r||t===i?1:hs(t))<0?0:t):[]},Br.takeRight=function(e,t,r){var n=null==e?0:e.length;return n?ii(e,(t=n-(t=r||t===i?1:hs(t)))<0?0:t,n):[]},Br.takeRightWhile=function(e,t){return e&&e.length?gi(e,la(t,3),!1,!0):[]},Br.takeWhile=function(e,t){return e&&e.length?gi(e,la(t,3)):[]},Br.tap=function(e,t){return t(e),e},Br.throttle=function(e,t,r){var n=!0,i=!0;if("function"!=typeof e)throw new Me(a);return ts(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),Ao(e,t,{leading:n,maxWait:t,trailing:i})},Br.thru=go,Br.toArray=fs,Br.toPairs=Ls,Br.toPairsIn=Bs,Br.toPath=function(e){return zo(e)?Ft(e,Ra):ls(e)?[e]:Mi(Ua(_s(e)))},Br.toPlainObject=ys,Br.transform=function(e,t,r){var n=zo(e),i=n||Ko(e)||us(e);if(t=la(t,4),null==r){var a=e&&e.constructor;r=i?n?new a:[]:ts(e)&&Jo(a)?qr(He(e)):{}}return(i?Dt:wn)(e,(function(e,n,i){return t(r,e,n,i)})),r},Br.unary=function(e){return Co(e,1)},Br.union=to,Br.unionBy=ro,Br.unionWith=no,Br.uniq=function(e){return e&&e.length?di(e):[]},Br.uniqBy=function(e,t){return e&&e.length?di(e,la(t,2)):[]},Br.uniqWith=function(e,t){return t="function"==typeof t?t:i,e&&e.length?di(e,i,t):[]},Br.unset=function(e,t){return null==e||pi(e,t)},Br.unzip=io,Br.unzipWith=ao,Br.update=function(e,t,r){return null==e?e:fi(e,t,_i(r))},Br.updateWith=function(e,t,r,n){return n="function"==typeof n?n:i,null==e?e:fi(e,t,_i(r),n)},Br.values=qs,Br.valuesIn=function(e){return null==e?[]:er(e,Ps(e))},Br.without=oo,Br.words=Js,Br.wrap=function(e,t){return No(_i(t),e)},Br.xor=so,Br.xorBy=co,Br.xorWith=lo,Br.zip=uo,Br.zipObject=function(e,t){return bi(e||[],t||[],tn)},Br.zipObjectDeep=function(e,t){return bi(e||[],t||[],ei)},Br.zipWith=po,Br.entries=Ls,Br.entriesIn=Bs,Br.extend=ws,Br.extendWith=Ts,cc(Br,Br),Br.add=yc,Br.attempt=Xs,Br.camelCase=Vs,Br.capitalize=Ws,Br.ceil=_c,Br.clamp=function(e,t,r){return r===i&&(r=t,t=i),r!==i&&(r=(r=bs(r))==r?r:0),t!==i&&(t=(t=bs(t))==t?t:0),cn(bs(e),t,r)},Br.clone=function(e){return ln(e,4)},Br.cloneDeep=function(e){return ln(e,5)},Br.cloneDeepWith=function(e,t){return ln(e,5,t="function"==typeof t?t:i)},Br.cloneWith=function(e,t){return ln(e,4,t="function"==typeof t?t:i)},Br.conformsTo=function(e,t){return null==t||un(e,t,As(t))},Br.deburr=$s,Br.defaultTo=function(e,t){return null==e||e!=e?t:e},Br.divide=vc,Br.endsWith=function(e,t,r){e=_s(e),t=ui(t);var n=e.length,a=r=r===i?n:cn(hs(r),0,n);return(r-=t.length)>=0&&e.slice(r,a)==t},Br.eq=qo,Br.escape=function(e){return(e=_s(e))&&Q.test(e)?e.replace(K,ar):e},Br.escapeRegExp=function(e){return(e=_s(e))&&ae.test(e)?e.replace(ie,"\\$&"):e},Br.every=function(e,t,r){var n=zo(e)?jt:hn;return r&&va(e,t,r)&&(t=i),n(e,la(t,3))},Br.find=bo,Br.findIndex=Wa,Br.findKey=function(e,t){return qt(e,la(t,3),wn)},Br.findLast=yo,Br.findLastIndex=$a,Br.findLastKey=function(e,t){return qt(e,la(t,3),Tn)},Br.floor=wc,Br.forEach=_o,Br.forEachRight=vo,Br.forIn=function(e,t){return null==e?e:_n(e,la(t,3),Ps)},Br.forInRight=function(e,t){return null==e?e:vn(e,la(t,3),Ps)},Br.forOwn=function(e,t){return e&&wn(e,la(t,3))},Br.forOwnRight=function(e,t){return e&&Tn(e,la(t,3))},Br.get=Is,Br.gt=Vo,Br.gte=Wo,Br.has=function(e,t){return null!=e&&ma(e,t,Cn)},Br.hasIn=Cs,Br.head=Ya,Br.identity=ic,Br.includes=function(e,t,r,n){e=Ho(e)?e:qs(e),r=r&&!n?hs(r):0;var i=e.length;return r<0&&(r=yr(i+r,0)),cs(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&Wt(e,t,r)>-1},Br.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var i=null==r?0:hs(r);return i<0&&(i=yr(n+i,0)),Wt(e,t,i)},Br.inRange=function(e,t,r){return t=gs(t),r===i?(r=t,t=0):r=gs(r),function(e,t,r){return e>=_r(t,r)&&e<yr(t,r)}(e=bs(e),t,r)},Br.invoke=js,Br.isArguments=$o,Br.isArray=zo,Br.isArrayBuffer=Yo,Br.isArrayLike=Ho,Br.isArrayLikeObject=Go,Br.isBoolean=function(e){return!0===e||!1===e||rs(e)&&En(e)==v},Br.isBuffer=Ko,Br.isDate=Zo,Br.isElement=function(e){return rs(e)&&1===e.nodeType&&!as(e)},Br.isEmpty=function(e){if(null==e)return!0;if(Ho(e)&&(zo(e)||"string"==typeof e||"function"==typeof e.splice||Ko(e)||us(e)||$o(e)))return!e.length;var t=ha(e);if(t==k||t==M)return!e.size;if(Sa(e))return!Rn(e).length;for(var r in e)if(Ue.call(e,r))return!1;return!0},Br.isEqual=function(e,t){return Pn(e,t)},Br.isEqualWith=function(e,t,r){var n=(r="function"==typeof r?r:i)?r(e,t):i;return n===i?Pn(e,t,i,r):!!n},Br.isError=Qo,Br.isFinite=function(e){return"number"==typeof e&&vt(e)},Br.isFunction=Jo,Br.isInteger=Xo,Br.isLength=es,Br.isMap=ns,Br.isMatch=function(e,t){return e===t||On(e,t,da(t))},Br.isMatchWith=function(e,t,r){return r="function"==typeof r?r:i,On(e,t,da(t),r)},Br.isNaN=function(e){return is(e)&&e!=+e},Br.isNative=function(e){if(xa(e))throw new Se("Unsupported core-js use. Try https://npms.io/search?q=ponyfill.");return Fn(e)},Br.isNil=function(e){return null==e},Br.isNull=function(e){return null===e},Br.isNumber=is,Br.isObject=ts,Br.isObjectLike=rs,Br.isPlainObject=as,Br.isRegExp=os,Br.isSafeInteger=function(e){return Xo(e)&&e>=-9007199254740991&&e<=g},Br.isSet=ss,Br.isString=cs,Br.isSymbol=ls,Br.isTypedArray=us,Br.isUndefined=function(e){return e===i},Br.isWeakMap=function(e){return rs(e)&&ha(e)==P},Br.isWeakSet=function(e){return rs(e)&&"[object WeakSet]"==En(e)},Br.join=function(e,t){return null==e?"":Bt.call(e,t)},Br.kebabCase=zs,Br.last=Za,Br.lastIndexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return-1;var a=n;return r!==i&&(a=(a=hs(r))<0?yr(n+a,0):_r(a,n-1)),t==t?function(e,t,r){for(var n=r+1;n--;)if(e[n]===t)return n;return n}(e,t,a):Vt(e,zt,a,!0)},Br.lowerCase=Ys,Br.lowerFirst=Hs,Br.lt=ds,Br.lte=ps,Br.max=function(e){return e&&e.length?mn(e,ic,In):i},Br.maxBy=function(e,t){return e&&e.length?mn(e,la(t,2),In):i},Br.mean=function(e){return Yt(e,ic)},Br.meanBy=function(e,t){return Yt(e,la(t,2))},Br.min=function(e){return e&&e.length?mn(e,ic,Ln):i},Br.minBy=function(e,t){return e&&e.length?mn(e,la(t,2),Ln):i},Br.stubArray=mc,Br.stubFalse=bc,Br.stubObject=function(){return{}},Br.stubString=function(){return""},Br.stubTrue=function(){return!0},Br.multiply=xc,Br.nth=function(e,t){return e&&e.length?$n(e,hs(t)):i},Br.noConflict=function(){return ht._===this&&(ht._=qe),this},Br.noop=lc,Br.now=Io,Br.pad=function(e,t,r){e=_s(e);var n=(t=hs(t))?fr(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return zi(mt(i),r)+e+zi(gt(i),r)},Br.padEnd=function(e,t,r){e=_s(e);var n=(t=hs(t))?fr(e):0;return t&&n<t?e+zi(t-n,r):e},Br.padStart=function(e,t,r){e=_s(e);var n=(t=hs(t))?fr(e):0;return t&&n<t?zi(t-n,r)+e:e},Br.parseInt=function(e,t,r){return r||null==t?t=0:t&&(t=+t),wr(_s(e).replace(oe,""),t||0)},Br.random=function(e,t,r){if(r&&"boolean"!=typeof r&&va(e,t,r)&&(t=r=i),r===i&&("boolean"==typeof t?(r=t,t=i):"boolean"==typeof e&&(r=e,e=i)),e===i&&t===i?(e=0,t=1):(e=gs(e),t===i?(t=e,e=0):t=gs(t)),e>t){var n=e;e=t,t=n}if(r||e%1||t%1){var a=Tr();return _r(e+a*(t-e+dt("1e-"+((a+"").length-1))),t)}return Kn(e,t)},Br.reduce=function(e,t,r){var n=zo(e)?Rt:Kt,i=arguments.length<3;return n(e,la(t,4),r,i,fn)},Br.reduceRight=function(e,t,r){var n=zo(e)?Nt:Kt,i=arguments.length<3;return n(e,la(t,4),r,i,gn)},Br.repeat=function(e,t,r){return t=(r?va(e,t,r):t===i)?1:hs(t),Zn(_s(e),t)},Br.replace=function(){var e=arguments,t=_s(e[0]);return e.length<3?t:t.replace(e[1],e[2])},Br.result=function(e,t,r){var n=-1,a=(t=vi(t,e)).length;for(a||(a=1,e=i);++n<a;){var o=null==e?i:e[Ra(t[n])];o===i&&(n=a,o=r),e=Jo(o)?o.call(e):o}return e},Br.round=Sc,Br.runInContext=e,Br.sample=function(e){return(zo(e)?Qr:Jn)(e)},Br.size=function(e){if(null==e)return 0;if(Ho(e))return cs(e)?fr(e):e.length;var t=ha(e);return t==k||t==M?e.size:Rn(e).length},Br.snakeCase=Gs,Br.some=function(e,t,r){var n=zo(e)?Lt:ai;return r&&va(e,t,r)&&(t=i),n(e,la(t,3))},Br.sortedIndex=function(e,t){return oi(e,t)},Br.sortedIndexBy=function(e,t,r){return si(e,t,la(r,2))},Br.sortedIndexOf=function(e,t){var r=null==e?0:e.length;if(r){var n=oi(e,t);if(n<r&&qo(e[n],t))return n}return-1},Br.sortedLastIndex=function(e,t){return oi(e,t,!0)},Br.sortedLastIndexBy=function(e,t,r){return si(e,t,la(r,2),!0)},Br.sortedLastIndexOf=function(e,t){if(null==e?0:e.length){var r=oi(e,t,!0)-1;if(qo(e[r],t))return r}return-1},Br.startCase=Ks,Br.startsWith=function(e,t,r){return e=_s(e),r=null==r?0:cn(hs(r),0,e.length),t=ui(t),e.slice(r,r+t.length)==t},Br.subtract=kc,Br.sum=function(e){return e&&e.length?Zt(e,ic):0},Br.sumBy=function(e,t){return e&&e.length?Zt(e,la(t,2)):0},Br.template=function(e,t,r){var n=Br.templateSettings;r&&va(e,t,r)&&(t=i),e=_s(e),t=Ts({},t,n,Xi);var a,o,s=Ts({},t.imports,n.imports,Xi),c=As(s),l=er(s,c),u=0,d=t.interpolate||Te,p="__p += '",f=Ce((t.escape||Te).source+"|"+d.source+"|"+(d===ee?ge:Te).source+"|"+(t.evaluate||Te).source+"|$","g"),g="//# sourceURL="+(Ue.call(t,"sourceURL")?(t.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++st+"]")+"\n";e.replace(f,(function(t,r,n,i,s,c){return n||(n=i),p+=e.slice(u,c).replace(xe,or),r&&(a=!0,p+="' +\n__e("+r+") +\n'"),s&&(o=!0,p+="';\n"+s+";\n__p += '"),n&&(p+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),u=c+t.length,t})),p+="';\n";var h=Ue.call(t,"variable")&&t.variable;if(h){if(pe.test(h))throw new Se("Invalid `variable` option passed into `_.template`")}else p="with (obj) {\n"+p+"\n}\n";p=(o?p.replace(z,""):p).replace(Y,"$1").replace(H,"$1;"),p="function("+(h||"obj")+") {\n"+(h?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(a?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+p+"return __p\n}";var m=Xs((function(){return ke(c,g+"return "+p).apply(i,l)}));if(m.source=p,Qo(m))throw m;return m},Br.times=function(e,t){if((e=hs(e))<1||e>g)return[];var r=m,n=_r(e,m);t=la(t),e-=m;for(var i=Qt(n,t);++r<e;)t(r);return i},Br.toFinite=gs,Br.toInteger=hs,Br.toLength=ms,Br.toLower=function(e){return _s(e).toLowerCase()},Br.toNumber=bs,Br.toSafeInteger=function(e){return e?cn(hs(e),-9007199254740991,g):0===e?e:0},Br.toString=_s,Br.toUpper=function(e){return _s(e).toUpperCase()},Br.trim=function(e,t,r){if((e=_s(e))&&(r||t===i))return Jt(e);if(!e||!(t=ui(t)))return e;var n=gr(e),a=gr(t);return Ti(n,rr(n,a),nr(n,a)+1).join("")},Br.trimEnd=function(e,t,r){if((e=_s(e))&&(r||t===i))return e.slice(0,hr(e)+1);if(!e||!(t=ui(t)))return e;var n=gr(e);return Ti(n,0,nr(n,gr(t))+1).join("")},Br.trimStart=function(e,t,r){if((e=_s(e))&&(r||t===i))return e.replace(oe,"");if(!e||!(t=ui(t)))return e;var n=gr(e);return Ti(n,rr(n,gr(t))).join("")},Br.truncate=function(e,t){var r=30,n="...";if(ts(t)){var a="separator"in t?t.separator:a;r="length"in t?hs(t.length):r,n="omission"in t?ui(t.omission):n}var o=(e=_s(e)).length;if(sr(e)){var s=gr(e);o=s.length}if(r>=o)return e;var c=r-fr(n);if(c<1)return n;var l=s?Ti(s,0,c).join(""):e.slice(0,c);if(a===i)return l+n;if(s&&(c+=l.length-c),os(a)){if(e.slice(c).search(a)){var u,d=l;for(a.global||(a=Ce(a.source,_s(he.exec(a))+"g")),a.lastIndex=0;u=a.exec(d);)var p=u.index;l=l.slice(0,p===i?c:p)}}else if(e.indexOf(ui(a),c)!=c){var f=l.lastIndexOf(a);f>-1&&(l=l.slice(0,f))}return l+n},Br.unescape=function(e){return(e=_s(e))&&Z.test(e)?e.replace(G,mr):e},Br.uniqueId=function(e){var t=++Re;return _s(e)+t},Br.upperCase=Zs,Br.upperFirst=Qs,Br.each=_o,Br.eachRight=vo,Br.first=Ya,cc(Br,(Tc={},wn(Br,(function(e,t){Ue.call(Br.prototype,t)||(Tc[t]=e)})),Tc),{chain:!1}),Br.VERSION="4.17.21",Dt(["bind","bindKey","curry","curryRight","partial","partialRight"],(function(e){Br[e].placeholder=Br})),Dt(["drop","take"],(function(e,t){$r.prototype[e]=function(r){r=r===i?1:yr(hs(r),0);var n=this.__filtered__&&!t?new $r(this):this.clone();return n.__filtered__?n.__takeCount__=_r(r,n.__takeCount__):n.__views__.push({size:_r(r,m),type:e+(n.__dir__<0?"Right":"")}),n},$r.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}})),Dt(["filter","map","takeWhile"],(function(e,t){var r=t+1,n=1==r||3==r;$r.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:la(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}})),Dt(["head","last"],(function(e,t){var r="take"+(t?"Right":"");$r.prototype[e]=function(){return this[r](1).value()[0]}})),Dt(["initial","tail"],(function(e,t){var r="drop"+(t?"":"Right");$r.prototype[e]=function(){return this.__filtered__?new $r(this):this[r](1)}})),$r.prototype.compact=function(){return this.filter(ic)},$r.prototype.find=function(e){return this.filter(e).head()},$r.prototype.findLast=function(e){return this.reverse().find(e)},$r.prototype.invokeMap=Qn((function(e,t){return"function"==typeof e?new $r(this):this.map((function(r){return jn(r,e,t)}))})),$r.prototype.reject=function(e){return this.filter(Uo(la(e)))},$r.prototype.slice=function(e,t){e=hs(e);var r=this;return r.__filtered__&&(e>0||t<0)?new $r(r):(e<0?r=r.takeRight(-e):e&&(r=r.drop(e)),t!==i&&(r=(t=hs(t))<0?r.dropRight(-t):r.take(t-e)),r)},$r.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},$r.prototype.toArray=function(){return this.take(m)},wn($r.prototype,(function(e,t){var r=/^(?:filter|find|map|reject)|While$/.test(t),n=/^(?:head|last)$/.test(t),a=Br[n?"take"+("last"==t?"Right":""):t],o=n||/^find/.test(t);a&&(Br.prototype[t]=function(){var t=this.__wrapped__,s=n?[1]:arguments,c=t instanceof $r,l=s[0],u=c||zo(t),d=function(e){var t=a.apply(Br,Ut([e],s));return n&&p?t[0]:t};u&&r&&"function"==typeof l&&1!=l.length&&(c=u=!1);var p=this.__chain__,f=!!this.__actions__.length,g=o&&!p,h=c&&!f;if(!o&&u){t=h?t:new $r(this);var m=e.apply(t,s);return m.__actions__.push({func:go,args:[d],thisArg:i}),new Wr(m,p)}return g&&h?e.apply(this,s):(m=this.thru(d),g?n?m.value()[0]:m.value():m)})})),Dt(["pop","push","shift","sort","splice","unshift"],(function(e){var t=je[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);Br.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(zo(i)?i:[],e)}return this[r]((function(r){return t.apply(zo(r)?r:[],e)}))}})),wn($r.prototype,(function(e,t){var r=Br[t];if(r){var n=r.name+"";Ue.call(jr,n)||(jr[n]=[]),jr[n].push({name:t,func:r})}})),jr[qi(i,2).name]=[{name:"wrapper",func:i}],$r.prototype.clone=function(){var e=new $r(this.__wrapped__);return e.__actions__=Mi(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=Mi(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=Mi(this.__views__),e},$r.prototype.reverse=function(){if(this.__filtered__){var e=new $r(this);e.__dir__=-1,e.__filtered__=!0}else(e=this.clone()).__dir__*=-1;return e},$r.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=zo(e),n=t<0,i=r?e.length:0,a=function(e,t,r){var n=-1,i=r.length;for(;++n<i;){var a=r[n],o=a.size;switch(a.type){case"drop":e+=o;break;case"dropRight":t-=o;break;case"take":t=_r(t,e+o);break;case"takeRight":e=yr(e,t-o)}}return{start:e,end:t}}(0,i,this.__views__),o=a.start,s=a.end,c=s-o,l=n?s:o-1,u=this.__iteratees__,d=u.length,p=0,f=_r(c,this.__takeCount__);if(!r||!n&&i==c&&f==c)return hi(e,this.__actions__);var g=[];e:for(;c--&&p<f;){for(var h=-1,m=e[l+=t];++h<d;){var b=u[h],y=b.iteratee,_=b.type,v=y(m);if(2==_)m=v;else if(!v){if(1==_)continue e;break e}}g[p++]=m}return g},Br.prototype.at=ho,Br.prototype.chain=function(){return fo(this)},Br.prototype.commit=function(){return new Wr(this.value(),this.__chain__)},Br.prototype.next=function(){this.__values__===i&&(this.__values__=fs(this.value()));var e=this.__index__>=this.__values__.length;return{done:e,value:e?i:this.__values__[this.__index__++]}},Br.prototype.plant=function(e){for(var t,r=this;r instanceof Vr;){var n=La(r);n.__index__=0,n.__values__=i,t?a.__wrapped__=n:t=n;var a=n;r=r.__wrapped__}return a.__wrapped__=e,t},Br.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof $r){var t=e;return this.__actions__.length&&(t=new $r(this)),(t=t.reverse()).__actions__.push({func:go,args:[eo],thisArg:i}),new Wr(t,this.__chain__)}return this.thru(eo)},Br.prototype.toJSON=Br.prototype.valueOf=Br.prototype.value=function(){return hi(this.__wrapped__,this.__actions__)},Br.prototype.first=Br.prototype.head,Je&&(Br.prototype[Je]=function(){return this}),Br}();ht._=br,(n=function(){return br}.call(t,r,t,e))===i||(e.exports=n)}.call(this)},3645:()=>{},7763:()=>{}}]);
//# sourceMappingURL=vendors~AccountRecovery-UpdateInformation~DepositTrigger~LinkDenebIMPS~OpenBanking~advanced-portfoli~8eb4dbc5-b62e34fb47eec5da.chunk.js.map�A
�Eo��