@sekyro/react 0.1.0-rc.35 → 0.1.0-rc.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as co}from"../chunk-HICSMGFX.js";import{a as ee,b as B,c as lo}from"../chunk-ODSPOWMV.js";import{a as qt,b as Yt,d as Wt,e as Zt}from"../chunk-ZARKJW2C.js";import{a as $,d as Ut,e as it,f as ze,g as $t,h as Kt}from"../chunk-2TEU3U7V.js";import{a as zt,b as Gt,c as oo}from"../chunk-GUTF3SPK.js";import{a as no,b as ro,c as so,d as io,e as ao,f as lt}from"../chunk-3GSNJJCA.js";import{a as Ze}from"../chunk-6JKZ5S2U.js";import{d as st,f as Dt,g as Mt,j as Ht}from"../chunk-ZXY2YUAP.js";import{b as At}from"../chunk-NEUOVHVC.js";import{a as Ft}from"../chunk-7MMT5M4E.js";import{a as ue}from"../chunk-VRDPGOXM.js";import{a as Xo,b as Jo,c as jo,d as en,e as tn,f as Oe,g as v}from"../chunk-ERWGG4X6.js";import{a as M,b as J,c as Qt,d as j,e as Xt,f as Ge,g as qe,h as at,i as Jt,k as Ye,l as jt,m as eo,o as to,p as P,q as We}from"../chunk-PEQBKIR7.js";import"../chunk-BMD5J7TC.js";import{a as h,c as rt,j as Zo,l as Qo,n as Bt,o as Lt,p as Vt,r as Re,s as ke}from"../chunk-P7TS7JPW.js";import{a as i}from"../chunk-2KED7D2Q.js";import{useEffect as on,useState as uo}from"react";function ct(e){let[t,n]=uo(()=>e?.currentStep?.()??null),[r,a]=uo(null);return on(()=>{if(e===void 0)return;if(typeof e.run!="function"){a(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let s=!0,o=e.on("step",l=>{s&&n(l)});return e.run().then(l=>{s&&n(u=>u??l)},l=>{s&&a(l)}),()=>{s=!1,o()}},[e]),{step:t,error:r}}i(ct,"useVerificationStep");import{useEffect as po,useId as nn,useMemo as rn,useRef as mo,useState as Se}from"react";import{Fragment as go,jsx as b,jsxs as G}from"react/jsx-runtime";var fo=i((e,t,n)=>{if(e===void 0)return 0;let r=Date.parse(e)-t;return Number.isFinite(r)?Math.min(n,Math.max(0,Math.ceil(r/1e3))):0},"secondsUntil"),sn=600,an=30,ln=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),cn=["whatsapp","sms"],yo=new Set(["otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited","otp_resend_limit","otp_number_invalid","otp_number_not_mobile"]);function un(e){let t=[];for(let n of e.phoneCountries??["MR"]){let r=e.phoneRules?.find(s=>s.code===n),a=r?.dial??qt(n);a!==void 0&&!t.some(s=>s.code===n)&&t.push({code:n,dial:`+${a}`,...r!==void 0?{rule:r}:{}})}return t}i(un,"phoneCountriesOf");function ut({step:e,locale:t,strings:n,className:r,defaultPhone:a,onError:s}){let o=v(t,n),{t:l}=o,u=rn(()=>un(e),[e.phoneCountries,e.phoneRules]),p=a??u[0]?.dial??"",f=e.phoneInternational===!0,g=Wt({countries:u,international:f,closed:!!e.phoneRules?.length,defaultPhone:p}),[k,m]=Se(""),[y,w]=Se(!1),[N,O]=Se(null),[R,S]=Se(null),[x,_]=Se(!1),[Z,H]=Se(null),U=mo(null),D=e.phase==="verify"&&!x,fe=e.phase==="verify",Ne=oo(fe),[_e,Fe]=zt(e.reason==="otp_mismatch",e.attemptsRemaining,()=>m("")),K=nn(),De=mo(null);po(()=>{let C=setTimeout(()=>De.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(C)},[D]);let se=e.phase==="verify"?e.codeExpiresAt??"sent":null;po(()=>{se!==null&&(_(!1),U.current!==null&&!yo.has(e.reason??"")&&H(U.current),U.current=null)},[se]);let ye=i(async C=>{w(!0),S(null);try{await C()}catch(A){S(ue(A,o.strings)),s?.(A)}finally{w(!1),O(null)}},"run"),z=cn.filter(C=>(e.channels??[]).includes(C)),Me=g.typed,ne=!e.needsPhone||Me!==null,ie=i((C,A=!1)=>{let d=e.needsPhone?A?Z:{number:Me??g.phone,shown:g.shown}:null;U.current=d,O(C??null),ye(async()=>{try{await e.send({...d!==null?{phone:d.number}:{},...C!==void 0?{channel:C}:{}})}catch(I){throw U.current=null,I}})},"send"),Pe=i(C=>{ye(()=>e.verify(C))},"submitCode"),He=i(C=>{C.preventDefault(),D?Pe(k):z.length<=1&&ne&&ie(z[0])},"onSubmit"),Ue=`${K}-phone`,ge=fo(e.codeExpiresAt,Ne,sn),Q=fo(e.resendAvailableAt,Ne,an),ae=D&&e.codeExpiresAt!==void 0&&ge===0,xe=e.needsPhone&&!e.attemptsExhausted,le=fe&&(e.codeExpiresAt===void 0||ge>0),Ie=D&&xe?()=>_(!0):x&&le?()=>_(!1):null;Ge(Ie===null?null:y?()=>{}:Ie);let L=i(C=>l(C==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),Te=i(C=>y&&N!==null&&N===C,"busyFor"),[nt,T]=l("otp.sentTo",{channel:L(e.channel)}).split("{number}"),ce=e.context.simulation?.otpCode,$e=e.reason==="otp_mismatch"?G(P,{tone:"danger",children:[b("span",{children:l("otp.reason_otp_mismatch")}),b("span",{children:We(o,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&yo.has(e.reason)?b(P,{tone:"warning",children:b("span",{children:l(`otp.reason_${e.reason}`)})}):e.reason==="tester_phone_mismatch"?b(P,{tone:"warning",children:b("span",{children:l("reasons.tester_phone_mismatch")})}):null,Ee=G(go,{children:[$e,R!==null?b(P,{tone:"danger",children:b("span",{children:l(R)})}):null]});if(D){let C=z.length===0;return G("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":K,onSubmit:He,noValidate:!0,children:[b(J,{id:K,title:l("otp.verifyTitle"),lead:ce!==void 0?b(eo,{template:l("sandbox.otpHint"),code:ce}):G(go,{children:[nt,b("bdi",{dir:"ltr",className:"sekyro-mono",children:Z?.shown??e.sentToMasked}),T]})}),Ee,G("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:`${K}-code`,children:l("otp.codeLabel")}),b(Gt,{id:`${K}-code`,value:k,invalid:_e,onChange:A=>{A!==""&&Fe(),m(A),A.length===6&&k.length!==6&&!y&&!e.attemptsExhausted&&Pe(A)}}),b("span",{className:`sekyro-help sekyro-otp-expiry${ae?" is-danger":""}`,"aria-hidden":!ae||void 0,children:ae?l("otp.expired"):l("otp.expiresIn",{time:ln(ge)})})]}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:ae?l("otp.expired"):""}),G(j,{children:[b(h,{type:"submit",full:!0,disabled:y||k.length!==6||e.attemptsExhausted,"aria-busy":y||void 0,children:l("otp.verify")}),G("div",{className:"sekyro-resend-row",children:[C?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y||Q>0,onClick:()=>ie(void 0,!0),children:Q>0?l("otp.resendIn",{seconds:Q}):l("otp.resend")}):Q>0?b("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:Q})}):z.map(A=>b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>ie(A,!0),children:l("otp.resendBy",{channel:L(A)})},A)),xe?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>_(!0),"data-testid":"sekyro-otp-change",children:l("otp.changeNumber")}):null]})]})]})}return G("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":K,onSubmit:He,noValidate:!0,children:[b(J,{id:K,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Ee,e.needsPhone?G("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:Ue,children:l("otp.phoneLabel")}),b(Zt,{field:g,id:Ue,locale:o.locale,t:l,inputRef:De,ready:ne})]}):b("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),G(j,{children:[z.length===1?b(h,{type:"submit",full:!0,disabled:y||!ne,"aria-busy":Te(z[0])||void 0,children:l("otp.sendBy",{channel:L(z[0])})}):z.length>1?G("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[b("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),b("div",{className:"sekyro-channel-row",children:z.map(C=>G(h,{kind:"primary",disabled:y||!ne,"aria-busy":Te(C)||void 0,onClick:()=>ie(C),children:[b(M,{name:C}),L(C)]},C))})]}):b(h,{type:"submit",full:!0,disabled:y||!ne,"aria-busy":y||void 0,children:l("otp.send")}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:y&&N!==null?l("otp.sending",{channel:L(N)}):""}),x&&le?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>_(!1),"data-testid":"sekyro-otp-back-to-code",children:l("otp.backToCode")}):null]})]})}i(ut,"PhoneOtpStep");import{lazy as dn,Suspense as pn,useMemo as mn,useState as fn}from"react";import{jsx as he,jsxs as gn}from"react/jsx-runtime";var yn={load:i(()=>import("../email-otp-view-EYS26ZZM.js"),"load")};function dt({locale:e,strings:t,...n}){let r=v(e,t),[a,s]=fn(0),o=mn(()=>dn(()=>yn.load().then(u=>({default:u.EmailOtpView}))),[a]),l=gn(P,{tone:"danger",children:[he("span",{children:r.t("errors.network_error")}),he(h,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return he(ee,{fallback:l,children:he(pn,{fallback:he("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:he(o,{...n,i18n:r})})},a)}i(dt,"EmailOtpStep");import{lazy as kn,Suspense as Sn,useMemo as hn,useState as bn}from"react";import{jsx as be,jsxs as Cn}from"react/jsx-runtime";var vn={load:i(()=>import("../eid-view-ZM7QAEME.js"),"load")};function pt({locale:e,strings:t,...n}){let r=v(e,t),[a,s]=bn(0),o=hn(()=>kn(()=>vn.load().then(u=>({default:u.EidView}))),[a]),l=Cn(P,{tone:"danger",children:[be("span",{children:r.t("errors.network_error")}),be(h,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return be(ee,{fallback:l,children:be(Sn,{fallback:be("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:be(o,{...n,i18n:r})})},a)}i(pt,"EidStep");import{useMemo as wn}from"react";import{jsx as mt,jsxs as Nn}from"react/jsx-runtime";function ft({step:e,locale:t,strings:n,className:r,onError:a}){let s=v(t,n),{busy:o,error:l,run:u}=so(s,a),p=wn(()=>e.choice.options.flatMap(g=>{let k=ro(g,s),m=no[g.service];return k===null?[]:[{id:g.id,label:k,glyph:m&&mt(M,{name:m})}]}),[e.choice.options,s]),f=e.choice.options.find(g=>g.service==="national_eid");return Nn("div",{className:r,children:[mt(Dt,{title:s.t("method.heading"),description:s.t("method.description"),options:p,busy:o,error:l,focus:!0,testId:"sekyro-method",onChoose:g=>u(()=>e.choose(g))}),f?.nationalEid?.afterPass==="continue"?mt(B,{view:"EidContinueHint",i18n:s,provider:f.nationalEid.providerName,quiet:!0}):null]})}i(ft,"MethodChoice");import{isValidNni as _n,normalizeNni as ko}from"@sekyro/web";import{useId as Pn,useState as yt}from"react";import{Fragment as En,jsx as F,jsxs as ve}from"react/jsx-runtime";var xn=new Set(["nni_not_found","registry_record_not_found"]),In=new Set(["nni_invalid","id_number_invalid"]);function Qe({step:e,locale:t,strings:n,className:r,onError:a}){let s=v(t,n),{t:o}=s,[l,u]=yt(""),[p,f]=yt(!1),[g,k]=yt(null),m=Pn(),y=e.attemptsExhausted,w=i(async U=>{f(!0),k(null);try{await U()}catch(D){k(ue(D,s.strings)),a?.(D)}finally{f(!1)}},"run"),N=i(U=>{if(U.preventDefault(),e.source!=="typed"){w(()=>e.confirm());return}let D=ko(l);if(!/^\d{10}$/.test(D))return k("population.invalid");if(!_n(D))return k("population.reason_id_number_invalid");w(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(D):e.submitNni(D))},"onSubmit"),O=We(s,e.attemptsRemaining,y),R=e.reason!==void 0&&xn.has(e.reason),S=e.reason!==void 0&&In.has(e.reason),x=ve(En,{children:[e.reason==="registry_unavailable"?ve(P,{tone:"warning",children:[F("span",{children:o("population.reason_registry_unavailable")}),F("span",{children:O})]}):null,R&&e.canUseDocument?ve(P,{tone:"warning",children:[F("span",{children:o("population.reason_registry_record_not_found_or_document")}),F("span",{children:O}),F(h,{kind:"secondary",disabled:p,onClick:()=>{w(()=>e.useDocument())},children:o("population.useDocument")})]}):null,R&&!e.canUseDocument||S?ve(P,{tone:"danger",children:[F("span",{children:o(R?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),F("span",{children:O})]}):null,y&&e.reason===void 0?F(P,{tone:"danger",children:F("span",{children:O})}):null,g!==null?F(P,{tone:"danger",children:F("span",{children:o(g)})}):null]}),[_,Z,H]=e.source==="document"?["population.fromDocument.title","population.fromDocument.description","population.fromDocument.continue"]:e.source==="bound"?["session.steps.population.title","population.bound.description","population.bound.confirm"]:e.recheck?["population.recheck.title","population.recheck.description","population.submit"]:["session.steps.population.title","session.steps.population.description","population.submit"];return ve("form",{className:`sekyro-step${r?` ${r}`:""}`,"aria-labelledby":m,onSubmit:N,noValidate:!0,children:[F(J,{id:m,title:o(_),lead:o(Z)}),x,e.source==="typed"?ve("div",{className:"sekyro-field",children:[F("label",{className:"sekyro-label",htmlFor:`${m}-id-number`,children:o("population.label")}),F("input",{id:`${m}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o("population.placeholder"),value:l,"aria-describedby":`${m}-id-number-help`,"aria-invalid":g==="population.invalid"||g==="population.reason_id_number_invalid"||void 0,onChange:U=>{k(null),u(ko(U.target.value).replace(/\D/g,"").slice(0,10))}}),F("span",{id:`${m}-id-number-help`,className:"sekyro-help",children:o("population.helper")})]}):null,F(j,{children:y?null:F(h,{type:"submit",full:!0,disabled:p,"aria-busy":p||void 0,children:o(H)})})]})}i(Qe,"IdNumberEntry");function Tn(e){return Qe(e)}i(Tn,"NniEntry");import{acceptedIssuers as Ln,acceptedTypesFor as Co,warmDocumentCapture as Vn}from"@sekyro/web";import{lazy as An,Suspense as Fn,useEffect as Dn,useMemo as Mn,useState as kt}from"react";import{acceptedIssuers as Rn,acceptedTypesFor as gt}from"@sekyro/web";import{useEffect as So,useMemo as ho,useState as bo}from"react";import{jsx as q,jsxs as Xe}from"react/jsx-runtime";var On=220;function Bn(e,t,n=[],r){let a=null;try{a=new Intl.DisplayNames([e],{type:"region"})}catch{}let s=t.map(u=>({code:u,name:a?.of(u)??u})),o=new Intl.Collator(e),l=i(u=>{if(u===r)return-1;let p=n.indexOf(u);return p<0?n.length:p},"rank");return s.sort((u,p)=>l(u.code)-l(p.code)||o.compare(u.name,p.name))}i(Bn,"countryNames");function vo({step:e,i18n:t,issuer:n,onPicked:r,ageStepUp:a=!1}){let{t:s,locale:o}=t,l=ho(()=>Rn(e.documents),[e.documents]),u=ho(()=>Bn(o,l,Object.keys(e.documents.byIssuer??{}),e.detectedCountry),[o,l,e.documents,e.detectedCountry]),p=l.length===1?l[0]:null,[f,g]=bo(n??p),[k,m]=bo(null),y=p===null?[]:gt(e.documents,p),w=p!==null&&y.length===1?y[0]:null;So(()=>{p!==null&&w!==null&&e.selectDocument(p,w)},[p,w]);let N=i((S,x)=>{e.selectDocument(S,x),r?.()},"pick"),O=i(S=>{let x=gt(e.documents,S);x.length===1?N(S,x[0]):g(S)},"chooseIssuer");if(So(()=>{if(k===null||f===null)return;let S=setTimeout(()=>N(f,k),On);return()=>clearTimeout(S)},[k]),Ge(f!==null&&l.length>1&&n===void 0?()=>{g(null),m(null)}:null),w!==null)return null;if(f===null)return Xe("section",{className:"sekyro-step",children:[q(J,{title:s("doc.countryTitle"),lead:s(a?"doc.ageStepUp":"doc.pickDescription")}),q(Yt,{countries:u,label:s("doc.countryLabel"),searchPlaceholder:s("doc.countrySearch"),noMatch:s("doc.noCountryMatch"),onPick:O}),q(j,{children:null})]});let R=gt(e.documents,f);return Xe("section",{className:"sekyro-step",children:[q(J,{title:s("doc.pickTitle"),lead:s(a&&p!==null?"doc.ageStepUp":"native.doc.holdIt")}),q("div",{className:"sekyro-choices",children:R.map(S=>Xe("button",{type:"button",className:"sekyro-card","aria-pressed":k===S,disabled:k!==null&&k!==S,onClick:()=>m(S),children:[q("span",{className:"sekyro-card__tile",children:q(M,{name:S==="passport"?"passport":"card"})}),Xe("span",{className:"sekyro-card__body",children:[q("span",{className:"sekyro-card__title",children:s(`doc.type.${S}`)}),q("span",{className:"sekyro-card__sub",children:s(`doc.sub.${S}`)})]}),q("span",{className:"sekyro-radio","aria-hidden":"true"})]},S))}),l.length>1?q("button",{type:"button",className:"sekyro-link",onClick:()=>{g(null),m(null)},children:s("native.doc.changeCountry")}):null,q(j,{children:null})]})}i(vo,"DocumentPicker");import{jsx as re,jsxs as Un}from"react/jsx-runtime";var Hn={load:i(()=>import("../document-capture-view-I72R2TZK.js"),"load")};function St({step:e,locale:t,strings:n,className:r,liveMrz:a,barcodeAssetBaseUrl:s}){let o=v(t,n),[l,u]=kt(0),[p,f]=kt(null),g=Ln(e.documents),k=g.length>1,m=e.issuer!==null&&Co(e.documents,e.issuer).length>1,y=e.documentType===null||e.issuer===null||p!==null,w=g.length===1&&Co(e.documents,g[0]).length===1,[N]=kt(()=>y&&!w),O=e.ageStepUp===!0,R=Mn(()=>An(()=>Hn.load().then(x=>({default:x.DocumentCaptureView}))),[l]);Dn(()=>{Vn()},[]);let S=Un(P,{tone:"danger",children:[re("span",{children:o.t("errors.network_error")}),re(h,{kind:"secondary",onClick:()=>u(x=>x+1),children:o.t("doc.retryCamera")})]});return re("div",{className:r,children:y?re(vo,{step:e,i18n:o,ageStepUp:O&&p===null&&N,...p==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>f(null)}):re(ee,{fallback:S,children:re(Fn,{fallback:re("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:re(R,{step:e,i18n:o,ageLead:O&&!N,liveMrz:e.documentType==="drivers_license"?void 0:a,barcodeAssetBaseUrl:s,...k?{onChangeCountry:i(()=>f("country"),"onChangeCountry")}:{},...m?{onChangeDocument:i(()=>f("document"),"onChangeDocument")}:{}})})},l)})}i(St,"DocumentCapture");import{warmPortraitCapture as $n}from"@sekyro/web";import{Component as Kn,lazy as wo,Suspense as No,useContext as zn,useEffect as Gn,useMemo as _o,useState as Po}from"react";import{jsx as E,jsxs as je}from"react/jsx-runtime";var qn={load:i(()=>import("../portrait-capture-view-E5LKQQ5Y.js"),"load")},Yn={load:i(()=>import("../portrait-review-view-NJHH2E4W.js"),"load")},bt=class bt extends Kn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(bt,"LoadBoundary");var Je=bt;function Wn({step:e,i18n:t}){let{t:n}=t,r=ke();return je("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[E("h2",{ref:r,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?E("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?je(P,{tone:"danger",children:[E("span",{children:n("portrait.uploadFailed")}),E(h,{kind:"secondary",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):E("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}i(Wn,"MatchPhase");function ht({step:e,locale:t,strings:n,className:r,assetBaseUrl:a,verification:s}){let o=v(t,n),l=Mt(s),u=zn(Ye),[p,f]=Po(0),[g,k]=Po(null),m=_o(()=>wo(()=>qn.load().then(H=>({default:H.PortraitCaptureView}))),[p]),y=_o(()=>wo(()=>Yn.load().then(H=>({default:H.PortraitScreens}))),[p]),w=typeof e.uploadPortrait=="function",N=w?e.photo?.source??"camera":"camera",O=w&&N!=="camera"&&e.photo?.uploadOffered===!0,R=N!=="upload",S=N==="upload"?"upload":N==="choice"?g??e.photo?.pick??"source":"camera",x=e.phase==="capture"&&e.photo?.cameraOnPhone===!0;if(Gn(()=>{e.phase==="capture"&&S==="camera"&&!x&&$n()},[e.phase,S,x]),e.phase==="match")return E("div",{className:r,children:E(Wn,{step:e,i18n:o})});let _=E("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")});if(u!==null&&(u.busy||u.failed!==null)&&e.phase==="capture"&&S==="camera")return je("section",{className:`sekyro-step${r?` ${r}`:""}`,children:[E(J,{title:o.t("session.steps.portrait.title")}),E(j,{children:E(h,{kind:"secondary",full:!0,disabled:u.busy,onClick:u.reset,children:o.t("portrait.retryCamera")})})]});if(e.phase==="review"||S!=="camera"||x)return E("div",{className:r,children:E(Je,{fallback:E(h,{kind:"ghost",onClick:()=>f(H=>H+1),children:o.t("common.retry")}),children:E(No,{fallback:_,children:E(y,{screen:e.phase==="review"?"review":x&&S==="camera"?"phone":S==="camera"?"review":S,step:e,i18n:o,...R?{onCamera:i(()=>k("camera"),"onCamera")}:{},onUpload:()=>k("upload"),onDeclined:()=>k(null)})})},p)});if(!l.settled)return E("div",{className:r,children:_});let Z=je(P,{tone:"danger",children:[E("span",{children:o.t("errors.network_error")}),E(h,{kind:"secondary",onClick:()=>f(H=>H+1),children:o.t("portrait.retryCamera")})]});return E("div",{className:r,children:E(Je,{fallback:Z,children:E(No,{fallback:_,children:E(m,{step:e,i18n:o,...a!==void 0?{assetBaseUrl:a}:{},...O?{onUpload:i(()=>k("upload"),"onUpload")}:{}})})},p)})}i(ht,"PortraitCapture");import{lazy as Zn,Suspense as Qn,useMemo as Xn,useState as Jn}from"react";import{jsx as de,jsxs as er}from"react/jsx-runtime";var jn={load:i(()=>import("../proof-of-address-view-LS3JZUTD.js"),"load")};function vt({step:e,locale:t,strings:n,className:r}){let a=v(t,n),[s,o]=Jn(0),l=Xn(()=>Zn(()=>jn.load().then(p=>({default:p.ProofOfAddressView}))),[s]),u=er(P,{tone:"danger",children:[de("span",{children:a.t("errors.network_error")}),de(h,{kind:"secondary",onClick:()=>o(p=>p+1),children:a.t("common.retry")})]});return de("div",{className:r,children:de(ee,{fallback:u,children:de(Qn,{fallback:de("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:a.t("common.loading")}),children:de(l,{step:e,i18n:a})})},s)})}i(vt,"ProofOfAddress");import{lazy as tr,Suspense as or,useMemo as nr,useState as rr}from"react";import{jsx as pe,jsxs as ir}from"react/jsx-runtime";var sr={load:i(()=>import("../form-view-Y5KA6R5T.js"),"load")};function Ct({step:e,locale:t,strings:n,className:r,onError:a}){let s=v(t,n),[o,l]=rr(0),u=nr(()=>tr(()=>sr.load().then(f=>({default:f.FormView}))),[o]),p=ir(P,{tone:"danger",children:[pe("span",{children:s.t("errors.network_error")}),pe(h,{kind:"secondary",onClick:()=>l(f=>f+1),children:s.t("common.retry")})]});return pe("div",{className:r,children:pe(ee,{fallback:p,children:pe(or,{fallback:pe("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:pe(u,{step:e,i18n:s,...a!==void 0?{onError:a}:{}})})},o)})}i(Ct,"FormStep");import{cameraUnavailableCauseOf as xr}from"@sekyro/web";import{useCallback as te,useContext as Ir,useEffect as Ae,useId as Tr,useMemo as Rt,useRef as oe,useState as W}from"react";var wt={light:{lineBrand:"#0d3b66",successSoft:"#d5f0e8",successFg:"#005341",onSuccess:"#ffffff",warningSoft:"#fff7e6",warningFg:"#735003",onWarning:"#191a1b",dangerSoft:"#ffdada",dangerFg:"#ca0f07",onDanger:"#ffffff",info:"#0563d4",infoSoft:"#d3e5ff",infoFg:"#064da5",onInfo:"#ffffff"},dark:{lineBrand:"#3f80bf",successSoft:"#002c23",successFg:"#53ffd4",onSuccess:"#030303",warningSoft:"#463102",warningFg:"#ffd98a",onWarning:"#030303",dangerSoft:"#9c1008",dangerFg:"#ffbbbb",onDanger:"#030303",info:"#5da9ff",infoSoft:"#063778",infoFg:"#acd0ff",onInfo:"#030303"},sizes:{buttonHeight:"52px",controlRadius:"10px",cardRadius:"16px",fieldRadius:"10px",iconTile:"56px",iconTileRadius:"16px",headerTile:"40px",choiceTile:"40px",tileRadius:"10px",resultDisc:"64px",resultRing:"8px",progressHeight:"4px",focusRing:"2px",focusRingOffset:"2px",otpBox:"60px",choiceMinHeight:"76px",stepGap:"32px",headingGap:"12px"},motion:{page:"320ms",easeOut:"cubic-bezier(0.16, 1, 0.3, 1)"}};var Be={light:{danger:{base:"#ca0f07",soft:"#ffdada",fg:"#ca0f07",on:"#ffffff"},success:{base:"#007a5e",soft:"#d5f0e8",fg:"#005341",on:"#ffffff"},warning:{base:"#ffab00",soft:"#fff7e6",fg:"#735003",on:"#191a1b"},info:{base:"#0563d4",soft:"#d3e5ff",fg:"#064da5",on:"#ffffff"}},dark:{danger:{base:"#ff7c7c",soft:"#9c1008",fg:"#ffbbbb",on:"#030303"},success:{base:"#00c897",soft:"#002c23",fg:"#53ffd4",on:"#030303"},warning:{base:"#ffbb2e",soft:"#463102",fg:"#ffd98a",on:"#030303"},info:{base:"#5da9ff",soft:"#063778",fg:"#acd0ff",on:"#030303"}}},ar=["danger","success","warning","info"];function Nt(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}i(Nt,"channel");function xo(e){let t=Nt(parseInt(e.slice(1,3),16)),n=Nt(parseInt(e.slice(3,5),16)),r=Nt(parseInt(e.slice(5,7),16));return .2126*t+.7152*n+.0722*r}i(xo,"luminance");function lr(e,t){let n=xo(e),r=xo(t),a=Math.max(n,r),s=Math.min(n,r);return(a+.05)/(s+.05)}i(lr,"contrastRatio");function Io(e,t){return Math.min(...ar.map(n=>lr(Be[e][n].fg,t)))}i(Io,"worstAgainst");function To(e,t,n){return Math.min(Io(e,t),Io(e,n))}i(To,"worstStatusContrast");function Eo(e,t){return To("light",e,t)>=To("dark",e,t)?"light":"dark"}i(Eo,"statusSchemeFor");import{useRef as dr,useState as pr}from"react";import{useEffect as cr,useId as ur,useRef as _t}from"react";import{jsx as Ce,jsxs as Ro}from"react/jsx-runtime";function et({open:e,title:t,closeLabel:n,onClose:r,children:a,actions:s,role:o,testId:l,returnFocus:u}){let p=_t(null),f=_t(null),g=_t(!1),k=ur();return cr(()=>{let m=p.current;if(m!==null){if(e&&!m.open?(f.current=typeof document>"u"?null:document.activeElement,typeof m.showModal=="function"?m.showModal():m.setAttribute("open","")):!e&&m.open&&(typeof m.close=="function"?m.close():m.removeAttribute("open")),!e&&g.current){let y=u?.current??(f.current instanceof HTMLElement?f.current:null);f.current=null,y?.focus()}g.current=e}},[e,u]),Ce("dialog",{ref:p,className:"sekyro-dialog","aria-labelledby":k,...o==="alertdialog"?{role:o}:{},"data-testid":l,onCancel:m=>{m.preventDefault(),r()},onClick:m=>{m.target===m.currentTarget&&r()},children:Ro("div",{className:"sekyro-dialog__panel",children:[Ro("div",{className:"sekyro-dialog__head",children:[Ce("h2",{id:k,className:"sekyro-dialog__title",children:t}),n!==void 0?Ce("button",{type:"button",className:"sekyro-disc sekyro-dialog__close","aria-label":n,onClick:r,children:Ce(M,{name:"close"})}):null]}),a!==void 0?Ce("div",{className:"sekyro-dialog__body",children:a}):null,s!==void 0?Ce("div",{className:"sekyro-dialog__actions",children:s}):null]})})}i(et,"FlowDialog");import{jsx as Le,jsxs as Oo}from"react/jsx-runtime";var mr=["intro","data","processing","sharing","retention"];function Bo({i18n:e,purpose:t="identity"}){let{t:n}=e,[r,a]=pr(!1),s=dr(null),[o,l=""]=n("consent.short").split("{terms}");return Oo("div",{className:"sekyro-consent","data-testid":"sekyro-consent",children:[Oo("p",{className:"sekyro-consent__line",children:[o,Le("button",{ref:s,type:"button",className:"sekyro-link sekyro-link--inline","aria-haspopup":"dialog",onClick:()=>a(!0),children:n("consent.termsLink")}),l]}),Le(et,{open:r,title:n("consent.termsTitle"),closeLabel:n("native.close"),onClose:()=>a(!1),returnFocus:s,testId:"sekyro-consent-terms",children:Le("div",{className:"sekyro-stack sekyro-stack--3",children:t==="human"?Le(B,{view:"HumanConsentTerms",i18n:e,quiet:!0}):mr.map(u=>Le("p",{children:n(`consent.terms.${u}`)},u))})})]})}i(Bo,"ConsentNotice");function Lo(e){let t=e.trim().split(/\s+/).filter(r=>r!=="");return(t.length>=2?[t[0],t[1]].map(r=>Array.from(r??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(Lo,"initials");import{useSyncExternalStore as fr}from"react";var Fo=i(e=>({colors:{...e?$.dark:$.light},radius:$.radius,fontFamily:$.font}),"brandTheme"),ta=Fo(!1),Vo=/^#[0-9a-f]{6}$/i;function Pt(e,t,n){if(t)return null;let r=it(e).colors,a=n?.colors?.bg??r?.bg,s=n?.colors?.surface??r?.surface;return a===void 0&&s===void 0||a!==void 0&&!Vo.test(a)||s!==void 0&&!Vo.test(s)?null:Eo(a??$.light.bg,s??$.light.surface)}i(Pt,"partnerStatusScheme");function tt(e,t,n){let r=it(e);if(n&&r.colors!==void 0){let{brand:a,brandFg:s}=r.colors;a!==void 0&&Sr(a,$.dark.bg)>=3?r.colors={brand:a,ring:a,...s!==void 0?{brandFg:s}:{}}:delete r.colors}if(Pt(e,n,t)==="dark"){let a=Be.dark;r.colors={...r.colors,danger:a.danger.base,success:a.success.base,warning:a.warning.fg}}return ze(Fo(n),r,Ut(t))}i(tt,"verificationTheme");function ot(e){let t=fr(kr,gr,()=>!1);return e==="dark"||e==="system"&&t}i(ot,"useDarkScheme");var yr="(prefers-color-scheme: dark)",Do=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(yr):null,"media"),gr=i(()=>Do()?.matches??!1,"prefersDark");function kr(e){let t=Do();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(kr,"subscribe");function Sr(e,t){let[n,r]=[Ao(e),Ao(t)];return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}i(Sr,"contrast");function Ao(e){let t=[1,3,5].map(n=>{let r=Number.parseInt(e.slice(n,n+2),16)/255;return r<=.03928?r/12.92:((r+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i(Ao,"luminance");var xt="sekyro.testerGate";function It(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}i(It,"store");function Mo(e=Date.now()){try{It()?.setItem(xt,String(e))}catch{}}i(Mo,"rememberTester");function Ho(e=Date.now()){try{let t=Number(It()?.getItem(xt)??"");return Number.isFinite(t)&&t>0&&e-t<2592e6}catch{return!1}}i(Ho,"rememberedTester");function Uo(){try{It()?.removeItem(xt)}catch{}}i(Uo,"forgetTester");import{useEffect as hr,useId as br,useState as vr}from"react";import{jsx as V,jsxs as me}from"react/jsx-runtime";var $o=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),Cr={review:{icon:"pending",tone:"info"},cooldown:{icon:"timer",tone:"info"},rejected:{icon:"close",tone:"neutral"},policy:{icon:"close",tone:"neutral"},inconclusive:{icon:"warning",tone:"neutral"},unavailable:{icon:"timer",tone:"neutral"},expired:{icon:"timer",tone:"neutral"}};function wr({screen:e}){if(e==="verified")return me("svg",{className:"sekyro-outcome sekyro-outcome--approved",viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[V("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"54",pathLength:"1"}),V("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),V("path",{className:"sekyro-outcome__glyph",d:"M6.5 12.5l3.6 3.6 7.4-8.2",pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]});let{icon:t,tone:n}=Cr[e];return V("span",{className:`sekyro-tile sekyro-tile--${n} sekyro-outcome-tile`,"aria-hidden":"true","data-screen":e,children:V(M,{name:t})})}i(wr,"OutcomeMark");function Nr({label:e,id:t,copied:n}){let[r,a]=vr(!1);return hr(()=>{if(!r)return;let s=setTimeout(()=>a(!1),1600);return()=>clearTimeout(s)},[r]),me("button",{type:"button",className:`sekyro-reference${r?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[V("span",{"aria-live":"polite",children:r?n:e}),V("bdi",{dir:"ltr",children:t}),V(M,{name:"copy"})]})}i(Nr,"ReferenceLine");function _r({step:e,t}){let n=e.context.sandbox?e.context.simulation?.reason:void 0;return n===void 0?null:me(Re,{tone:"warning",role:"status",testId:"sekyro-simulated-notice",children:[V("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:V(M,{name:"info"})}),me("div",{className:"sekyro-notice__body","data-reason":n,children:[V("strong",{children:t("sandbox.simulatedTitle")}),V("span",{children:t(n==="no_testers"?"sandbox.simulatedNoTesters":"sandbox.simulatedGate")})]})]})}i(_r,"SimulationNotice");function Pr(e,t){return e==="expired"?"native.result.expiredTitle":e!=="verified"?`session.result.${e}.title`:t.level===3?"session.result.verified.title":t.level===1&&t.assurance==="contact_phone"?"session.result.verified.titlePhone":t.level===1&&t.assurance==="contact_email"?"session.result.verified.titleEmail":t.level===1?"session.result.verified.titleContact":"session.result.verified.titleHuman"}i(Pr,"resultTitleKey");function Tt({step:e,locale:t,strings:n,className:r,onClose:a}){let s=v(t,n),{t:o}=s,l=br(),u=ke(),p=e.context.orgName,f=e.reasonCode??"",g=e.display==="platform_unsupported"?"policy":e.display,k=i(y=>(p!==""||y==="verified")&&y!=="cooldown"?o(`native.result.${y}`,{org:p}):o(`session.result.${y}.description`),"partnerLine"),m;switch(e.display){case"rejected":f==="identity_not_verified"?m=p!==""?o("reasons.identity_not_verified",{org:p}):o("session.result.identityNotVerified"):m=$o.has(rt(f))?o("session.result.detailsMismatch",{org:p}):k("rejected");break;case"policy":{if($o.has(rt(f)))m=o("session.result.detailsMismatch",{org:p});else if(f==="device_velocity_exceeded")m=o("session.result.deviceVelocity",{org:p});else if(f==="capture_tampered")m=o("session.result.deviceStop");else if(f==="camera_unavailable")m=o("reasons.camera_unavailable",{org:p});else if(f==="underage_estimated")m=o("reasons.underage_estimated");else if(f==="starter_credit_claimed")m=o("reasons.starter_credit_claimed");else if(f==="blocked_by_org")m=o("reasons.blocked_by_org");else{let y=f===""?null:Lt(f);m=y!==null?o(y,{org:p}):k("policy")}break}case"cooldown":{let y=Vt(s.locale,e.retryAfter);m=y!==null?o(y.key,{time:y.time}):o("session.result.cooldown.description");break}case"platform_unsupported":m=o("result.platform_unsupported");break;default:m=k(g)}return me("section",{className:`sekyro-result${r?` ${r}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[me("div",{className:"sekyro-result__body",children:[V(wr,{screen:g}),me("div",{className:"sekyro-heading",children:[V("h2",{id:l,ref:u,tabIndex:-1,className:"sekyro-text-body",children:o(Pr(g,e.result))}),V("p",{className:"sekyro-text-muted",children:m})]}),V(_r,{step:e,t:o}),V(Nr,{label:o("result.referenceLabel"),id:e.context.sessionId,copied:o("native.result.copied")})]}),a!==void 0?V("div",{className:"sekyro-actions",children:V(h,{full:!0,onClick:a,children:o("native.result.continue",{org:p})})}):null]})}i(Tt,"VerificationResultScreen");import{Fragment as Ve,jsx as c,jsxs as Y}from"react/jsx-runtime";function Er(e,t,n){let r=t?$.dark:$.light,a=t?$.roles.dark:$.roles.light,s=e.colors??{},o={},l=s.fg===r.fg&&s.surface===r.surface;s.brand===r.brand&&s.surface===r.surface&&(o["--sekyro-color-brand-soft"]=a.brandSoft),l&&(o["--sekyro-color-line"]=a.line,o["--sekyro-color-line-subtle"]=a.lineSubtle,o["--sekyro-color-line-strong"]=a.lineStrong,o["--sekyro-color-sunken"]=a.sunken),s.fgMuted===r.fgMuted&&s.surface===r.surface&&(o["--sekyro-color-fg-subtle"]=a.fgSubtle),e.fontFamily===$.font&&(o["--sekyro-font-display"]=$.fontDisplay);let u=t?wt.dark:wt.light;if(o["--sekyro-color-success-soft"]=u.successSoft,o["--sekyro-color-success-fg"]=u.successFg,o["--sekyro-color-on-success"]=u.onSuccess,o["--sekyro-color-warning-soft"]=u.warningSoft,o["--sekyro-color-warning-fg"]=u.warningFg,o["--sekyro-color-danger-soft"]=u.dangerSoft,o["--sekyro-color-danger-fg"]=u.dangerFg,o["--sekyro-color-on-danger"]=u.onDanger,o["--sekyro-color-info-soft"]=u.infoSoft,o["--sekyro-color-info-fg"]=u.infoFg,s.brand===r.brand&&(o["--sekyro-color-line-brand"]=u.lineBrand),n!==null){let p=Be[n];for(let f of["danger","success","warning","info"])o[`--sekyro-color-${f}-soft`]=p[f].soft,o[`--sekyro-color-${f}-fg`]=p[f].fg;o["--sekyro-color-on-success"]=p.success.on,o["--sekyro-color-on-danger"]=p.danger.on}return o}i(Er,"flowRoles");function Ot(e){let{verification:t,locale:n,strings:r,onStep:a,onResult:s}=e,{step:o,error:l}=ct(t);Ae(()=>{o!==null&&a?.(o)},[o,a]),Ae(()=>s===void 0?void 0:t.on("result",s),[t,s]);let u=ot(e.colorScheme??"light"),p=o?.context.branding,f=tt(p,e.theme,u),[g,k]=W(!1),m=`sekyro-verification${u?" sekyro-verification--dark":""}${g?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,y=oe(e.onClose);y.current=e.onClose;let w=oe(o);w.current=o;let N=te(()=>{let _=w.current;y.current?.(_?.kind==="result"?{reason:"finished",result:_.result}:{reason:"cancelled"})},[]),[O,R]=W(null),S=te(()=>{let _=w.current;_!==null&&_.kind!=="result"&&_.context.consentRecorded?R("close"):N()},[N]),x=Rt(()=>t.reportCaptureIssue===void 0?null:_=>t.reportCaptureIssue?.(_),[t]);return c(Kt,{theme:f,className:m,children:c(Oe,{locale:n,...r!==void 0?{strings:r}:{},children:c("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:Er(f,u,Pt(p,u,e.theme)),children:c(Jt.Provider,{value:k,children:c(at.Provider,{value:e.onClose!==void 0?N:void 0,children:c(qe.Provider,{value:e.onClose!==void 0?S:void 0,children:Y(Ft.Provider,{value:x,children:[c(Ar,{...e,step:o,error:l,immersive:g,onLeaveAsk:()=>R("history"),onClosed:N}),c(Br,{open:O!==null,onStay:()=>{O==="history"&&Et(),R(null)},onLeave:()=>{let _=O;R(null),_==="close"||e.onClose!==void 0?N():typeof window<"u"&&qo()}})]})})})})})})})}i(Ot,"SekyroVerification");function Rr(e,t){if(t===void 0||t==="aml_screening")return null;let n=e,r=n[`session.processing.${t}.title`],a=n[`session.processing.${t}.description`];return typeof r=="string"&&r!==""&&typeof a=="string"&&a!==""?{title:r,description:a}:null}i(Rr,"processingCopyOf");function Or({error:e,retry:t}){let{t:n}=v(),r=ke();return Y(Re,{tone:"danger",testId:"sekyro-error-notice",children:[c("span",{children:n(Bt(e))}),e.retryable?c(h,{ref:r,kind:"secondary",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}i(Or,"CameraErrorNotice");var zo="sekyroFlow";function Go(){let e=window.history.state;return typeof e=="object"&&e!==null&&e[zo]===!0}i(Go,"onGuard");function Et(){if(typeof window>"u"||Go())return;let e=window.history.state;window.history.pushState({...typeof e=="object"&&e!==null?e:{},[zo]:!0},"")}i(Et,"pushGuard");function qo(){window.history.back()}i(qo,"leaveHistory");function Br({open:e,onStay:t,onLeave:n}){let{t:r}=v();return c(et,{open:e,role:"alertdialog",title:r("leave.title"),onClose:t,testId:"sekyro-leave",actions:Y(Ve,{children:[c(h,{full:!0,onClick:t,children:r("leave.stay")}),c(h,{full:!0,kind:"danger",onClick:n,children:r("leave.confirm")})]}),children:c("p",{className:"sekyro-text-muted",children:r("leave.body")})})}i(Br,"LeaveDialog");function Lr(e,t){let[n,r]=W(!1),[a,s]=W(null),o=e===null?void 0:e.skipCapture,l=oe(o);l.current=o;let u=oe(!1),p=e?.key;Ae(()=>s(null),[p]);let f=te(()=>{if(u.current)return;let y=l.current;y!==void 0&&(u.current=!0,r(!0),s(null),y().catch(w=>s(t.t(ue(w,t.strings)))).finally(()=>{u.current=!1,r(!1)}))},[t]),g=te(()=>s(null),[]),k=o!==void 0,m=t.t("sandbox.skipCapture");return Rt(()=>k?{label:m,busy:n,failed:a,run:f,reset:g}:null,[k,m,n,a,f,g])}i(Lr,"useSkipCapture");function Vr({skip:e}){return Y(Ve,{children:[e.failed!==null?c(P,{tone:"danger",children:c("span",{children:e.failed})}):null,c(h,{kind:"ghost",full:!0,disabled:e.busy,"aria-busy":e.busy||void 0,onClick:e.run,"data-testid":"sekyro-skip-capture",children:e.label})]})}i(Vr,"SkipAction");function Ar(e){let{step:t,error:n,slots:r,immersive:a}=e,s=v(),{t:o}=s,[l,u]=W(!1),[p,f]=W([]),g=te(d=>(f(I=>[...I,d]),()=>f(I=>I.filter(X=>X!==d))),[]),[k,m]=W(null),y=te(d=>m(()=>d),[]),[w,N]=W(0),[O,R]=W(null),S=Lr(t,s),x=t?.context.testerGate!==void 0,[_,Z]=W(!1),H=oe(null);Ae(()=>{!x||H.current!==null||(H.current=Ho(),H.current&&Z(!0))},[x]);let U=t?.context.purpose??"identity",D=t?.context.returning===!0,fe=e.verification,Ne=U==="human"||t?.context.cameraUnavailableHandled===!0,_e=fe.reportCameraUnavailable!==void 0&&Ne?d=>fe.reportCameraUnavailable?.(d)??Promise.resolve():void 0,Fe=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,K=e.handoffUrl,De=oe({last:null,count:0}),se=te((d,I,X=!1)=>_e===void 0&&I!=="denied"?void 0:c(B,{view:"NoCameraView",i18n:s,quiet:!0,cause:I,onRetry:d,repeated:X,...Fe&&_e!==void 0?{onContinue:_e}:{},...K!==void 0?{handoffUrl:K}:{}}),[s,fe,Ne,Fe,K]),ye=Rt(()=>io(t),[t]),z=te((d,I)=>c(ao,{start:d,context:I,human:U==="human",returning:D,notice:I.permissionSettled&&I.permission==="denied"?se(d,"denied"):void 0,...ye!==void 0?{retry:ye}:{}}),[U,D,se,ye]),Me=te((d,I)=>{let X=xr(d.kind),Ke=De.current;d.kind==="permission"&&d!==Ke.last&&(Ke.last=d,Ke.count+=1);let Wo=d.kind==="permission"&&Ke.count>1;return(X!==void 0?se(I,X,Wo):void 0)??Y(Ve,{children:[c(Or,{error:d,retry:I}),X!==void 0&&K!==void 0?c(B,{view:"DesktopHandoffView",i18n:s,quiet:!0,url:K}):null]})},[se,K,s]),ne=oe(""),ie=e.livenessProps?.slots?.stageOverlay,Pe=te(d=>(d.guidance!==""&&!d.coached&&(ne.current=d.guidance),c(co,{testId:"sekyro-capture-stage",video:c("video",{ref:d.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:d.settled?o("capture.checkingTitle"):d.guidance!==""?d.guidance:ne.current,note:d.note,status:d.status,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:o("native.close"),overlay:ie?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:i(()=>N(I=>I+1),"onClose")},end:d.modeSwitch!=null?c(At,{view:d.modeSwitch,className:"sekyro-glass sekyro-glass--label"}):null,children:d.settled||!d.live?null:c(jt,{onStop:()=>N(I=>I+1)})})),[o,ie]),He=Tr(),Ue=t,ge=t!==null&&O===t.key&&t.context.switchable!==void 0,Q=k??(t===null||t.kind==="result"?null:ge?()=>R(null):t.context.switchable!==void 0&&typeof Ue?.chooseOption=="function"?()=>R(t.key):null),ae=oe(Q);ae.current=Q;let xe=oe(t);xe.current=t;let le=oe({ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0});le.current={ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0};let Ie=e.backNavigation==="history";if(Ae(()=>{if(!Ie||typeof window>"u")return;Et();let d=i(()=>{if(Go())return;let I=xe.current,X=ae.current;X!==null?(X(),Et()):I?.kind!=="result"&&I?.context.consentRecorded===!0?le.current.ask():le.current.hostClose?le.current.closed():qo()},"onPop");return window.addEventListener("popstate",d),()=>window.removeEventListener("popstate",d)},[Ie]),n!==null)return c(Re,{tone:"danger",children:c("span",{children:o(ue(n,s.strings))})});if(t===null)return Y("div",{className:"sekyro-skeleton",role:"status","aria-busy":"true",children:[c("span",{className:"sekyro-visually-hidden",children:o("common.loading")}),c("span",{className:"sekyro-skeleton__bar is-title"}),c("span",{className:"sekyro-skeleton__bar"}),c("span",{className:"sekyro-skeleton__bar is-short"}),c("span",{className:"sekyro-skeleton__bar is-block"})]});let{context:L}=t,Te=i(d=>{u(!0),d().finally(()=>u(!1))},"refresh"),nt=r?.header??c(Mr,{context:L,headerId:He,end:r?.headerEnd,...Q!==null?{onBack:Q}:{}}),T,ce=ge;if(_&&e.verification.testerGate!==void 0)T=c(st.Provider,{value:Pe,children:c(B,{view:"TesterGateView",i18n:s,verification:e.verification,attemptsLeft:L.testerGate?.attemptsLeft??0,livenessProps:{...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:e.livenessProps?.slots?.intro??z},locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice},onBound:()=>Mo(),onDone:d=>{d&&Uo(),Z(!1)}})});else if(ce)T=c(B,{view:"LaneChoiceView",i18n:s,step:t,onClose:()=>R(null)});else switch(t.kind){case"phone_otp":T=c(ut,{step:t});break;case"email_otp":T=c(dt,{step:t});break;case"method":T=c(ft,{step:t});break;case"registry":T=c(Qe,{step:t});break;case"document":T=c(St,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{},...e.documentBarcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:e.documentBarcodeAssetBaseUrl}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,I={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??z,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:Me}:{}},...w>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};T=c(st.Provider,{value:Pe,children:t.instructions==="icao"||t.livePhoto?.icao===!0?c(B,{view:"LivePhotoLiveness",i18n:s,step:t,livenessProps:I,sekyroIntro:d===void 0},w):c(Ht,{...I},w)});break}case"portrait":T=Y(Ve,{children:[t.retakeOnly?c(B,{view:"PortraitRetakeNotice",i18n:s,quiet:!0}):null,c(ht,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"proof_of_address":T=c(vt,{step:t});break;case"form":T=c(Ct,{step:t});break;case"contact_choice":T=c(B,{view:"ContactChoiceView",i18n:s,step:t});break;case"choice":T=c(B,{view:"GenericChoiceView",i18n:s,step:t});break;case"identity_summary":T=c(B,{view:"IdentitySummaryView",i18n:s,step:t});break;case"mobile_required":{let d=t.checkType==="doc_ocr"?o("handoff.lead.document"):t.checkType==="portrait_icao"?o("handoff.lead.portrait"):t.checkType==="poa"?o("handoff.lead.poa"):void 0;T=e.handoffUrl!==void 0?c(B,{view:"HandoffView",i18n:s,url:e.handoffUrl,refresh:t.refresh,...d!==void 0?{lead:d}:{}}):c(Ze,{tone:"brand",icon:"smartphone",title:o("handoff.title"),actions:c(h,{kind:"secondary",full:!0,disabled:l,onClick:()=>Te(t.refresh),children:o("common.refresh")}),children:c("p",{children:d??o("reasons.mobile_required")})});break}case"native_app_required":T=c(B,{view:"NativeAppView",i18n:s,org:L.orgName,nativeApp:t.nativeApp,...e.handoffUrl!==void 0?{fallbackUrl:e.handoffUrl}:{},refresh:t.refresh,footer:c(Ko,{org:L.orgName})});break;case"processing":{let d=Rr(s.strings,t.service);T=c(Ze,{tone:"brand",icon:"pending",busy:!t.stalled,live:!0,title:d?.title??o("session.processing.title"),actions:t.stalled?c(h,{kind:"secondary",full:!0,disabled:l,onClick:()=>Te(t.refresh),children:o("common.refresh")}):null,children:c("p",{children:d?.description??o("session.processing.description")})});break}case"eid":T=c(pt,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";T=c(Ze,{tone:"neutral",icon:"smartphone",title:o(d?"needsApp.title":"unsupported.title"),actions:c(Ko,{org:L.orgName}),children:c("p",{children:d?L.orgName!==""?o("needsApp.description",{org:L.orgName}):o("needsApp.descriptionNoOrg"):o("unsupported.description",{org:L.orgName})})});break}case"result":T=r?.result?.(t)??c(Fr,{step:t});break;default:{let d=t;T=null}}let $e=!a&&!L.consentRecorded&&t.kind!=="result"?c(Bo,{i18n:s,purpose:L.purpose}):null,Ee=S!==null&&!a&&!ce&&!_?c(Vr,{skip:S}):null,C=x&&!_&&!a&&!ce&&e.verification.testerGate!==void 0?c(B,{view:"TesterGateAction",i18n:s,quiet:!0,onOpen:()=>Z(!0)}):null,A=Ee===null&&C===null?$e:Y(Ve,{children:[C,Ee,$e]});return c(Xt.Provider,{value:y,children:c(Ye.Provider,{value:S,children:c(lo.Provider,{value:e.handoffUrl,children:Y(Qt.Provider,{value:A===null?null:{node:A,owner:p[0]??null,claim:g},children:[a?null:nt,!a&&t.kind!=="result"&&L.sections.length>1?c(Hr,{context:L,current:t.section,i18n:s}):null,c(to,{pageKey:t.key,children:T}),!a&&!ce&&t.kind!=="result"&&t.context.switchable!==void 0?c(B,{view:"LaneSwitch",i18n:s,step:t,onOpen:()=>R(t.key),quiet:!0},t.key):null,p.length===0?A:null,a?null:r?.footer!==void 0?r.footer:L.branding?.hideAttribution===!0?null:Y("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[c(M,{name:"lock"}),o("shell.verifiedBy")]})]})})})})}i(Ar,"Body");function Ko({org:e}){let{t}=v(),n=Ir(at);return n===void 0?null:c(h,{full:!0,onClick:n,children:t("native.result.continue",{org:e})})}i(Ko,"BackToOrg");function Fr({step:e}){return c(qe.Consumer,{children:t=>c(Tt,{step:e,...t!==void 0?{onClose:t}:{}})})}i(Fr,"ResultPage");function Dr(e){let t=e.levelName??e.purpose;return t==="contact"?"shell.subtitleContact":t==="human"?"shell.subtitleHuman":"shell.subtitle"}i(Dr,"subtitleKeyOf");function Mr({context:e,headerId:t,end:n,onBack:r}){let{t:a}=v(),[s,o]=W(!1),l=s?void 0:e.branding?.logoUrl,u=e.orgName!==""?e.orgName:a(e.returning?"returning.heading":"session.title");return c("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:Y("div",{className:"sekyro-org",children:[r!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__back","aria-label":a("common.back"),onClick:r,"data-testid":"sekyro-back",children:c(M,{name:"back"})}):null,c("span",{className:"sekyro-org__tile","aria-hidden":"true",children:l!==void 0?c("img",{className:"sekyro-org__logo",src:l,alt:"",onError:()=>o(!0)}):Lo(e.orgName)}),Y("div",{className:"sekyro-org__text",children:[c("h1",{id:t,className:"sekyro-org__name",children:u}),c("p",{className:"sekyro-org__sub",children:a(Dr(e))})]}),e.sandbox?c("span",{className:"sekyro-sandbox-badge","data-testid":"sekyro-sandbox-badge",children:a("app.sandboxBadge")}):null,n!=null?c("div",{className:"sekyro-org__end",children:n}):null,c(qe.Consumer,{children:p=>p!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":a("native.close"),onClick:p,children:c(M,{name:"close"})}):null})]})})}i(Mr,"OrgHeader");function Hr({context:e,current:t,i18n:n}){let r=t===null?-1:e.sections.indexOf(t),a=e.progress,s=a!==void 0&&a.length===e.sections.length?a:e.sections.map((o,l)=>({id:o,state:l<r?"done":l===r?"current":"upcoming"}));return c("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:s.map(({id:o,state:l})=>c("li",{className:`sekyro-progress__bar${l==="done"?" is-done":l==="current"?" is-current":""}`,...l==="current"?{"aria-current":"step"}:{},children:c("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${o}`]??o})},o))})}i(Hr,"SectionProgress");import{useEffect as Ur,useState as Yo}from"react";import{jsx as we}from"react/jsx-runtime";function $r(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i($r,"pageUrl");function Kr({hostedUrl:e,inAppBrowser:t,...n}){let[r,a]=Yo(t===!0);Ur(()=>{t===void 0&<()&&a(!0)},[t]);let[s,o]=Yo(!1),l=ot(n.colorScheme??"light"),u=n.handoffUrl??e??$r();return r&&!s?we($t,{theme:ze(tt(void 0,void 0,l),n.theme),className:`sekyro-verification${l?" sekyro-verification--dark":""}${n.className!==void 0?` ${n.className}`:""}`,children:we(Oe,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:we("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-flow",children:we(zr,{url:u,onContinue:()=>o(!0)})})})}):we(Ot,{...n,...u!==""?{handoffUrl:u}:{}})}i(Kr,"SekyroFlow");function zr({url:e,onContinue:t}){let n=v();return we(B,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}i(zr,"Prompt");export{St as DocumentCapture,pt as EidStep,dt as EmailOtpStep,Ct as FormStep,Qe as IdNumberEntry,ft as MethodChoice,Tn as NniEntry,ut as PhoneOtpStep,ht as PortraitCapture,vt as ProofOfAddress,Kr as SekyroFlow,Ot as SekyroVerification,Oe as StepI18nProvider,Tt as VerificationResultScreen,Xo as arSteps,Jo as enSteps,en as formatTemplate,jo as frSteps,lt as isInAppBrowser,Zo as loadSekyroLocale,tn as resolveSekyroStrings,Qo as retakeHintStringKey,v as useStepI18n,ct as useVerificationStep};
|
|
2
|
+
import{a as co}from"../chunk-HICSMGFX.js";import{a as ee,b as B,c as lo}from"../chunk-ODSPOWMV.js";import{a as qt,b as Yt,d as Wt,e as Zt}from"../chunk-ZARKJW2C.js";import{a as $,d as Ut,e as it,f as ze,g as $t,h as Kt}from"../chunk-2TEU3U7V.js";import{a as zt,b as Gt,c as oo}from"../chunk-GUTF3SPK.js";import{a as no,b as ro,c as so,d as io,e as ao,f as lt}from"../chunk-3GSNJJCA.js";import{a as Ze}from"../chunk-6JKZ5S2U.js";import{d as st,f as Dt,g as Mt,j as Ht}from"../chunk-ZXY2YUAP.js";import{b as At}from"../chunk-NEUOVHVC.js";import{a as Ft}from"../chunk-7MMT5M4E.js";import{a as ue}from"../chunk-VRDPGOXM.js";import{a as Xo,b as Jo,c as jo,d as en,e as tn,f as Oe,g as v}from"../chunk-ERWGG4X6.js";import{a as M,b as J,c as Qt,d as j,e as Xt,f as Ge,g as qe,h as at,i as Jt,k as Ye,l as jt,m as eo,o as to,p as P,q as We}from"../chunk-PEQBKIR7.js";import"../chunk-BMD5J7TC.js";import{a as h,c as rt,j as Zo,l as Qo,n as Bt,o as Lt,p as Vt,r as Re,s as ke}from"../chunk-P7TS7JPW.js";import{a as i}from"../chunk-2KED7D2Q.js";import{useEffect as on,useState as uo}from"react";function ct(e){let[t,n]=uo(()=>e?.currentStep?.()??null),[r,a]=uo(null);return on(()=>{if(e===void 0)return;if(typeof e.run!="function"){a(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let s=!0,o=e.on("step",l=>{s&&n(l)});return e.run().then(l=>{s&&n(u=>u??l)},l=>{s&&a(l)}),()=>{s=!1,o()}},[e]),{step:t,error:r}}i(ct,"useVerificationStep");import{useEffect as po,useId as nn,useMemo as rn,useRef as mo,useState as Se}from"react";import{Fragment as go,jsx as b,jsxs as G}from"react/jsx-runtime";var fo=i((e,t,n)=>{if(e===void 0)return 0;let r=Date.parse(e)-t;return Number.isFinite(r)?Math.min(n,Math.max(0,Math.ceil(r/1e3))):0},"secondsUntil"),sn=600,an=30,ln=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),cn=["whatsapp","sms"],yo=new Set(["otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited","otp_resend_limit","otp_number_invalid","otp_number_not_mobile"]);function un(e){let t=[];for(let n of e.phoneCountries??["MR"]){let r=e.phoneRules?.find(s=>s.code===n),a=r?.dial??qt(n);a!==void 0&&!t.some(s=>s.code===n)&&t.push({code:n,dial:`+${a}`,...r!==void 0?{rule:r}:{}})}return t}i(un,"phoneCountriesOf");function ut({step:e,locale:t,strings:n,className:r,defaultPhone:a,onError:s}){let o=v(t,n),{t:l}=o,u=rn(()=>un(e),[e.phoneCountries,e.phoneRules]),p=a??u[0]?.dial??"",f=e.phoneInternational===!0,g=Wt({countries:u,international:f,closed:!!e.phoneRules?.length,defaultPhone:p}),[k,m]=Se(""),[y,w]=Se(!1),[N,O]=Se(null),[R,S]=Se(null),[x,_]=Se(!1),[Z,H]=Se(null),U=mo(null),D=e.phase==="verify"&&!x,fe=e.phase==="verify",Ne=oo(fe),[_e,Fe]=zt(e.reason==="otp_mismatch",e.attemptsRemaining,()=>m("")),K=nn(),De=mo(null);po(()=>{let C=setTimeout(()=>De.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(C)},[D]);let se=e.phase==="verify"?e.codeExpiresAt??"sent":null;po(()=>{se!==null&&(_(!1),U.current!==null&&!yo.has(e.reason??"")&&H(U.current),U.current=null)},[se]);let ye=i(async C=>{w(!0),S(null);try{await C()}catch(A){S(ue(A,o.strings)),s?.(A)}finally{w(!1),O(null)}},"run"),z=cn.filter(C=>(e.channels??[]).includes(C)),Me=g.typed,ne=!e.needsPhone||Me!==null,ie=i((C,A=!1)=>{let d=e.needsPhone?A?Z:{number:Me??g.phone,shown:g.shown}:null;U.current=d,O(C??null),ye(async()=>{try{await e.send({...d!==null?{phone:d.number}:{},...C!==void 0?{channel:C}:{}})}catch(I){throw U.current=null,I}})},"send"),Pe=i(C=>{ye(()=>e.verify(C))},"submitCode"),He=i(C=>{C.preventDefault(),D?Pe(k):z.length<=1&&ne&&ie(z[0])},"onSubmit"),Ue=`${K}-phone`,ge=fo(e.codeExpiresAt,Ne,sn),Q=fo(e.resendAvailableAt,Ne,an),ae=D&&e.codeExpiresAt!==void 0&&ge===0,xe=e.needsPhone&&!e.attemptsExhausted,le=fe&&(e.codeExpiresAt===void 0||ge>0),Ie=D&&xe?()=>_(!0):x&&le?()=>_(!1):null;Ge(Ie===null?null:y?()=>{}:Ie);let L=i(C=>l(C==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),Te=i(C=>y&&N!==null&&N===C,"busyFor"),[nt,T]=l("otp.sentTo",{channel:L(e.channel)}).split("{number}"),ce=e.context.simulation?.otpCode,$e=e.reason==="otp_mismatch"?G(P,{tone:"danger",children:[b("span",{children:l("otp.reason_otp_mismatch")}),b("span",{children:We(o,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&yo.has(e.reason)?b(P,{tone:"warning",children:b("span",{children:l(`otp.reason_${e.reason}`)})}):e.reason==="tester_phone_mismatch"?b(P,{tone:"warning",children:b("span",{children:l("reasons.tester_phone_mismatch")})}):null,Ee=G(go,{children:[$e,R!==null?b(P,{tone:"danger",children:b("span",{children:l(R)})}):null]});if(D){let C=z.length===0;return G("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":K,onSubmit:He,noValidate:!0,children:[b(J,{id:K,title:l("otp.verifyTitle"),lead:ce!==void 0?b(eo,{template:l("sandbox.otpHint"),code:ce}):G(go,{children:[nt,b("bdi",{dir:"ltr",className:"sekyro-mono",children:Z?.shown??e.sentToMasked}),T]})}),Ee,G("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:`${K}-code`,children:l("otp.codeLabel")}),b(Gt,{id:`${K}-code`,value:k,invalid:_e,onChange:A=>{A!==""&&Fe(),m(A),A.length===6&&k.length!==6&&!y&&!e.attemptsExhausted&&Pe(A)}}),b("span",{className:`sekyro-help sekyro-otp-expiry${ae?" is-danger":""}`,"aria-hidden":!ae||void 0,children:ae?l("otp.expired"):l("otp.expiresIn",{time:ln(ge)})})]}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:ae?l("otp.expired"):""}),G(j,{children:[b(h,{type:"submit",full:!0,disabled:y||k.length!==6||e.attemptsExhausted,"aria-busy":y||void 0,children:l("otp.verify")}),G("div",{className:"sekyro-resend-row",children:[C?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y||Q>0,onClick:()=>ie(void 0,!0),children:Q>0?l("otp.resendIn",{seconds:Q}):l("otp.resend")}):Q>0?b("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:Q})}):z.map(A=>b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>ie(A,!0),children:l("otp.resendBy",{channel:L(A)})},A)),xe?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>_(!0),"data-testid":"sekyro-otp-change",children:l("otp.changeNumber")}):null]})]})]})}return G("form",{className:`sekyro-step sekyro-otp${r?` ${r}`:""}`,"aria-labelledby":K,onSubmit:He,noValidate:!0,children:[b(J,{id:K,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Ee,e.needsPhone?G("div",{className:"sekyro-field",children:[b("label",{className:"sekyro-label",htmlFor:Ue,children:l("otp.phoneLabel")}),b(Zt,{field:g,id:Ue,locale:o.locale,t:l,inputRef:De,ready:ne})]}):b("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),G(j,{children:[z.length===1?b(h,{type:"submit",full:!0,disabled:y||!ne,"aria-busy":Te(z[0])||void 0,children:l("otp.sendBy",{channel:L(z[0])})}):z.length>1?G("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[b("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),b("div",{className:"sekyro-channel-row",children:z.map(C=>G(h,{kind:"primary",disabled:y||!ne,"aria-busy":Te(C)||void 0,onClick:()=>ie(C),children:[b(M,{name:C}),L(C)]},C))})]}):b(h,{type:"submit",full:!0,disabled:y||!ne,"aria-busy":y||void 0,children:l("otp.send")}),b("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:y&&N!==null?l("otp.sending",{channel:L(N)}):""}),x&&le?b("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:y,onClick:()=>_(!1),"data-testid":"sekyro-otp-back-to-code",children:l("otp.backToCode")}):null]})]})}i(ut,"PhoneOtpStep");import{lazy as dn,Suspense as pn,useMemo as mn,useState as fn}from"react";import{jsx as he,jsxs as gn}from"react/jsx-runtime";var yn={load:i(()=>import("../email-otp-view-EYS26ZZM.js"),"load")};function dt({locale:e,strings:t,...n}){let r=v(e,t),[a,s]=fn(0),o=mn(()=>dn(()=>yn.load().then(u=>({default:u.EmailOtpView}))),[a]),l=gn(P,{tone:"danger",children:[he("span",{children:r.t("errors.network_error")}),he(h,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return he(ee,{fallback:l,children:he(pn,{fallback:he("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:he(o,{...n,i18n:r})})},a)}i(dt,"EmailOtpStep");import{lazy as kn,Suspense as Sn,useMemo as hn,useState as bn}from"react";import{jsx as be,jsxs as Cn}from"react/jsx-runtime";var vn={load:i(()=>import("../eid-view-ZM7QAEME.js"),"load")};function pt({locale:e,strings:t,...n}){let r=v(e,t),[a,s]=bn(0),o=hn(()=>kn(()=>vn.load().then(u=>({default:u.EidView}))),[a]),l=Cn(P,{tone:"danger",children:[be("span",{children:r.t("errors.network_error")}),be(h,{kind:"secondary",onClick:()=>s(u=>u+1),children:r.t("common.retry")})]});return be(ee,{fallback:l,children:be(Sn,{fallback:be("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:be(o,{...n,i18n:r})})},a)}i(pt,"EidStep");import{useMemo as wn}from"react";import{jsx as mt,jsxs as Nn}from"react/jsx-runtime";function ft({step:e,locale:t,strings:n,className:r,onError:a}){let s=v(t,n),{busy:o,error:l,run:u}=so(s,a),p=wn(()=>e.choice.options.flatMap(g=>{let k=ro(g,s),m=no[g.service];return k===null?[]:[{id:g.id,label:k,glyph:m&&mt(M,{name:m})}]}),[e.choice.options,s]),f=e.choice.options.find(g=>g.service==="national_eid");return Nn("div",{className:r,children:[mt(Dt,{title:s.t("method.heading"),description:s.t("method.description"),options:p,busy:o,error:l,focus:!0,testId:"sekyro-method",onChoose:g=>u(()=>e.choose(g))}),f?.nationalEid?.afterPass==="continue"?mt(B,{view:"EidContinueHint",i18n:s,provider:f.nationalEid.providerName,quiet:!0}):null]})}i(ft,"MethodChoice");import{isValidNni as _n,normalizeNni as ko}from"@sekyro/web";import{useId as Pn,useState as yt}from"react";import{Fragment as En,jsx as F,jsxs as ve}from"react/jsx-runtime";var xn=new Set(["nni_not_found","registry_record_not_found"]),In=new Set(["nni_invalid","id_number_invalid"]);function Qe({step:e,locale:t,strings:n,className:r,onError:a}){let s=v(t,n),{t:o}=s,[l,u]=yt(""),[p,f]=yt(!1),[g,k]=yt(null),m=Pn(),y=e.attemptsExhausted,w=i(async U=>{f(!0),k(null);try{await U()}catch(D){k(ue(D,s.strings)),a?.(D)}finally{f(!1)}},"run"),N=i(U=>{if(U.preventDefault(),e.source!=="typed"){w(()=>e.confirm());return}let D=ko(l);if(!/^\d{10}$/.test(D))return k("population.invalid");if(!_n(D))return k("population.reason_id_number_invalid");w(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(D):e.submitNni(D))},"onSubmit"),O=We(s,e.attemptsRemaining,y),R=e.reason!==void 0&&xn.has(e.reason),S=e.reason!==void 0&&In.has(e.reason),x=ve(En,{children:[e.reason==="registry_unavailable"?ve(P,{tone:"warning",children:[F("span",{children:o("population.reason_registry_unavailable")}),F("span",{children:O})]}):null,R&&e.canUseDocument?ve(P,{tone:"warning",children:[F("span",{children:o("population.reason_registry_record_not_found_or_document")}),F("span",{children:O}),F(h,{kind:"secondary",disabled:p,onClick:()=>{w(()=>e.useDocument())},children:o("population.useDocument")})]}):null,R&&!e.canUseDocument||S?ve(P,{tone:"danger",children:[F("span",{children:o(R?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),F("span",{children:O})]}):null,y&&e.reason===void 0?F(P,{tone:"danger",children:F("span",{children:O})}):null,g!==null?F(P,{tone:"danger",children:F("span",{children:o(g)})}):null]}),[_,Z,H]=e.source==="document"?["population.fromDocument.title","population.fromDocument.description","population.fromDocument.continue"]:e.source==="bound"?["session.steps.population.title","population.bound.description","population.bound.confirm"]:e.recheck?["population.recheck.title","population.recheck.description","population.submit"]:["session.steps.population.title","session.steps.population.description","population.submit"];return ve("form",{className:`sekyro-step${r?` ${r}`:""}`,"aria-labelledby":m,onSubmit:N,noValidate:!0,children:[F(J,{id:m,title:o(_),lead:o(Z)}),x,e.source==="typed"?ve("div",{className:"sekyro-field",children:[F("label",{className:"sekyro-label",htmlFor:`${m}-id-number`,children:o("population.label")}),F("input",{id:`${m}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o("population.placeholder"),value:l,"aria-describedby":`${m}-id-number-help`,"aria-invalid":g==="population.invalid"||g==="population.reason_id_number_invalid"||void 0,onChange:U=>{k(null),u(ko(U.target.value).replace(/\D/g,"").slice(0,10))}}),F("span",{id:`${m}-id-number-help`,className:"sekyro-help",children:o("population.helper")})]}):null,F(j,{children:y?null:F(h,{type:"submit",full:!0,disabled:p,"aria-busy":p||void 0,children:o(H)})})]})}i(Qe,"IdNumberEntry");function Tn(e){return Qe(e)}i(Tn,"NniEntry");import{acceptedIssuers as Ln,acceptedTypesFor as Co,warmDocumentCapture as Vn}from"@sekyro/web";import{lazy as An,Suspense as Fn,useEffect as Dn,useMemo as Mn,useState as kt}from"react";import{acceptedIssuers as Rn,acceptedTypesFor as gt}from"@sekyro/web";import{useEffect as So,useMemo as ho,useState as bo}from"react";import{jsx as q,jsxs as Xe}from"react/jsx-runtime";var On=220;function Bn(e,t,n=[],r){let a=null;try{a=new Intl.DisplayNames([e],{type:"region"})}catch{}let s=t.map(u=>({code:u,name:a?.of(u)??u})),o=new Intl.Collator(e),l=i(u=>{if(u===r)return-1;let p=n.indexOf(u);return p<0?n.length:p},"rank");return s.sort((u,p)=>l(u.code)-l(p.code)||o.compare(u.name,p.name))}i(Bn,"countryNames");function vo({step:e,i18n:t,issuer:n,onPicked:r,ageStepUp:a=!1}){let{t:s,locale:o}=t,l=ho(()=>Rn(e.documents),[e.documents]),u=ho(()=>Bn(o,l,Object.keys(e.documents.byIssuer??{}),e.detectedCountry),[o,l,e.documents,e.detectedCountry]),p=l.length===1?l[0]:null,[f,g]=bo(n??p),[k,m]=bo(null),y=p===null?[]:gt(e.documents,p),w=p!==null&&y.length===1?y[0]:null;So(()=>{p!==null&&w!==null&&e.selectDocument(p,w)},[p,w]);let N=i((S,x)=>{e.selectDocument(S,x),r?.()},"pick"),O=i(S=>{let x=gt(e.documents,S);x.length===1?N(S,x[0]):g(S)},"chooseIssuer");if(So(()=>{if(k===null||f===null)return;let S=setTimeout(()=>N(f,k),On);return()=>clearTimeout(S)},[k]),Ge(f!==null&&l.length>1&&n===void 0?()=>{g(null),m(null)}:null),w!==null)return null;if(f===null)return Xe("section",{className:"sekyro-step",children:[q(J,{title:s("doc.countryTitle"),lead:s(a?"doc.ageStepUp":"doc.pickDescription")}),q(Yt,{countries:u,label:s("doc.countryLabel"),searchPlaceholder:s("doc.countrySearch"),noMatch:s("doc.noCountryMatch"),onPick:O}),q(j,{children:null})]});let R=gt(e.documents,f);return Xe("section",{className:"sekyro-step",children:[q(J,{title:s("doc.pickTitle"),lead:s(a&&p!==null?"doc.ageStepUp":"native.doc.holdIt")}),q("div",{className:"sekyro-choices",children:R.map(S=>Xe("button",{type:"button",className:"sekyro-card","aria-pressed":k===S,disabled:k!==null&&k!==S,onClick:()=>m(S),children:[q("span",{className:"sekyro-card__tile",children:q(M,{name:S==="passport"?"passport":"card"})}),Xe("span",{className:"sekyro-card__body",children:[q("span",{className:"sekyro-card__title",children:s(`doc.type.${S}`)}),q("span",{className:"sekyro-card__sub",children:s(`doc.sub.${S}`)})]}),q("span",{className:"sekyro-radio","aria-hidden":"true"})]},S))}),l.length>1?q("button",{type:"button",className:"sekyro-link",onClick:()=>{g(null),m(null)},children:s("native.doc.changeCountry")}):null,q(j,{children:null})]})}i(vo,"DocumentPicker");import{jsx as re,jsxs as Un}from"react/jsx-runtime";var Hn={load:i(()=>import("../document-capture-view-7ZSM7YTT.js"),"load")};function St({step:e,locale:t,strings:n,className:r,liveMrz:a,barcodeAssetBaseUrl:s}){let o=v(t,n),[l,u]=kt(0),[p,f]=kt(null),g=Ln(e.documents),k=g.length>1,m=e.issuer!==null&&Co(e.documents,e.issuer).length>1,y=e.documentType===null||e.issuer===null||p!==null,w=g.length===1&&Co(e.documents,g[0]).length===1,[N]=kt(()=>y&&!w),O=e.ageStepUp===!0,R=Mn(()=>An(()=>Hn.load().then(x=>({default:x.DocumentCaptureView}))),[l]);Dn(()=>{Vn()},[]);let S=Un(P,{tone:"danger",children:[re("span",{children:o.t("errors.network_error")}),re(h,{kind:"secondary",onClick:()=>u(x=>x+1),children:o.t("doc.retryCamera")})]});return re("div",{className:r,children:y?re(vo,{step:e,i18n:o,ageStepUp:O&&p===null&&N,...p==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>f(null)}):re(ee,{fallback:S,children:re(Fn,{fallback:re("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:re(R,{step:e,i18n:o,ageLead:O&&!N,liveMrz:e.documentType==="drivers_license"?void 0:a,barcodeAssetBaseUrl:s,...k?{onChangeCountry:i(()=>f("country"),"onChangeCountry")}:{},...m?{onChangeDocument:i(()=>f("document"),"onChangeDocument")}:{}})})},l)})}i(St,"DocumentCapture");import{warmPortraitCapture as $n}from"@sekyro/web";import{Component as Kn,lazy as wo,Suspense as No,useContext as zn,useEffect as Gn,useMemo as _o,useState as Po}from"react";import{jsx as E,jsxs as je}from"react/jsx-runtime";var qn={load:i(()=>import("../portrait-capture-view-E5LKQQ5Y.js"),"load")},Yn={load:i(()=>import("../portrait-review-view-NJHH2E4W.js"),"load")},bt=class bt extends Kn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(bt,"LoadBoundary");var Je=bt;function Wn({step:e,i18n:t}){let{t:n}=t,r=ke();return je("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[E("h2",{ref:r,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?E("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?je(P,{tone:"danger",children:[E("span",{children:n("portrait.uploadFailed")}),E(h,{kind:"secondary",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):E("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}i(Wn,"MatchPhase");function ht({step:e,locale:t,strings:n,className:r,assetBaseUrl:a,verification:s}){let o=v(t,n),l=Mt(s),u=zn(Ye),[p,f]=Po(0),[g,k]=Po(null),m=_o(()=>wo(()=>qn.load().then(H=>({default:H.PortraitCaptureView}))),[p]),y=_o(()=>wo(()=>Yn.load().then(H=>({default:H.PortraitScreens}))),[p]),w=typeof e.uploadPortrait=="function",N=w?e.photo?.source??"camera":"camera",O=w&&N!=="camera"&&e.photo?.uploadOffered===!0,R=N!=="upload",S=N==="upload"?"upload":N==="choice"?g??e.photo?.pick??"source":"camera",x=e.phase==="capture"&&e.photo?.cameraOnPhone===!0;if(Gn(()=>{e.phase==="capture"&&S==="camera"&&!x&&$n()},[e.phase,S,x]),e.phase==="match")return E("div",{className:r,children:E(Wn,{step:e,i18n:o})});let _=E("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")});if(u!==null&&(u.busy||u.failed!==null)&&e.phase==="capture"&&S==="camera")return je("section",{className:`sekyro-step${r?` ${r}`:""}`,children:[E(J,{title:o.t("session.steps.portrait.title")}),E(j,{children:E(h,{kind:"secondary",full:!0,disabled:u.busy,onClick:u.reset,children:o.t("portrait.retryCamera")})})]});if(e.phase==="review"||S!=="camera"||x)return E("div",{className:r,children:E(Je,{fallback:E(h,{kind:"ghost",onClick:()=>f(H=>H+1),children:o.t("common.retry")}),children:E(No,{fallback:_,children:E(y,{screen:e.phase==="review"?"review":x&&S==="camera"?"phone":S==="camera"?"review":S,step:e,i18n:o,...R?{onCamera:i(()=>k("camera"),"onCamera")}:{},onUpload:()=>k("upload"),onDeclined:()=>k(null)})})},p)});if(!l.settled)return E("div",{className:r,children:_});let Z=je(P,{tone:"danger",children:[E("span",{children:o.t("errors.network_error")}),E(h,{kind:"secondary",onClick:()=>f(H=>H+1),children:o.t("portrait.retryCamera")})]});return E("div",{className:r,children:E(Je,{fallback:Z,children:E(No,{fallback:_,children:E(m,{step:e,i18n:o,...a!==void 0?{assetBaseUrl:a}:{},...O?{onUpload:i(()=>k("upload"),"onUpload")}:{}})})},p)})}i(ht,"PortraitCapture");import{lazy as Zn,Suspense as Qn,useMemo as Xn,useState as Jn}from"react";import{jsx as de,jsxs as er}from"react/jsx-runtime";var jn={load:i(()=>import("../proof-of-address-view-LS3JZUTD.js"),"load")};function vt({step:e,locale:t,strings:n,className:r}){let a=v(t,n),[s,o]=Jn(0),l=Xn(()=>Zn(()=>jn.load().then(p=>({default:p.ProofOfAddressView}))),[s]),u=er(P,{tone:"danger",children:[de("span",{children:a.t("errors.network_error")}),de(h,{kind:"secondary",onClick:()=>o(p=>p+1),children:a.t("common.retry")})]});return de("div",{className:r,children:de(ee,{fallback:u,children:de(Qn,{fallback:de("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:a.t("common.loading")}),children:de(l,{step:e,i18n:a})})},s)})}i(vt,"ProofOfAddress");import{lazy as tr,Suspense as or,useMemo as nr,useState as rr}from"react";import{jsx as pe,jsxs as ir}from"react/jsx-runtime";var sr={load:i(()=>import("../form-view-Y5KA6R5T.js"),"load")};function Ct({step:e,locale:t,strings:n,className:r,onError:a}){let s=v(t,n),[o,l]=rr(0),u=nr(()=>tr(()=>sr.load().then(f=>({default:f.FormView}))),[o]),p=ir(P,{tone:"danger",children:[pe("span",{children:s.t("errors.network_error")}),pe(h,{kind:"secondary",onClick:()=>l(f=>f+1),children:s.t("common.retry")})]});return pe("div",{className:r,children:pe(ee,{fallback:p,children:pe(or,{fallback:pe("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:pe(u,{step:e,i18n:s,...a!==void 0?{onError:a}:{}})})},o)})}i(Ct,"FormStep");import{cameraUnavailableCauseOf as xr}from"@sekyro/web";import{useCallback as te,useContext as Ir,useEffect as Ae,useId as Tr,useMemo as Rt,useRef as oe,useState as W}from"react";var wt={light:{lineBrand:"#0d3b66",successSoft:"#d5f0e8",successFg:"#005341",onSuccess:"#ffffff",warningSoft:"#fff7e6",warningFg:"#735003",onWarning:"#191a1b",dangerSoft:"#ffdada",dangerFg:"#ca0f07",onDanger:"#ffffff",info:"#0563d4",infoSoft:"#d3e5ff",infoFg:"#064da5",onInfo:"#ffffff"},dark:{lineBrand:"#3f80bf",successSoft:"#002c23",successFg:"#53ffd4",onSuccess:"#030303",warningSoft:"#463102",warningFg:"#ffd98a",onWarning:"#030303",dangerSoft:"#9c1008",dangerFg:"#ffbbbb",onDanger:"#030303",info:"#5da9ff",infoSoft:"#063778",infoFg:"#acd0ff",onInfo:"#030303"},sizes:{buttonHeight:"52px",controlRadius:"10px",cardRadius:"16px",fieldRadius:"10px",iconTile:"56px",iconTileRadius:"16px",headerTile:"40px",choiceTile:"40px",tileRadius:"10px",resultDisc:"64px",resultRing:"8px",progressHeight:"4px",focusRing:"2px",focusRingOffset:"2px",otpBox:"60px",choiceMinHeight:"76px",stepGap:"32px",headingGap:"12px"},motion:{page:"320ms",easeOut:"cubic-bezier(0.16, 1, 0.3, 1)"}};var Be={light:{danger:{base:"#ca0f07",soft:"#ffdada",fg:"#ca0f07",on:"#ffffff"},success:{base:"#007a5e",soft:"#d5f0e8",fg:"#005341",on:"#ffffff"},warning:{base:"#ffab00",soft:"#fff7e6",fg:"#735003",on:"#191a1b"},info:{base:"#0563d4",soft:"#d3e5ff",fg:"#064da5",on:"#ffffff"}},dark:{danger:{base:"#ff7c7c",soft:"#9c1008",fg:"#ffbbbb",on:"#030303"},success:{base:"#00c897",soft:"#002c23",fg:"#53ffd4",on:"#030303"},warning:{base:"#ffbb2e",soft:"#463102",fg:"#ffd98a",on:"#030303"},info:{base:"#5da9ff",soft:"#063778",fg:"#acd0ff",on:"#030303"}}},ar=["danger","success","warning","info"];function Nt(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}i(Nt,"channel");function xo(e){let t=Nt(parseInt(e.slice(1,3),16)),n=Nt(parseInt(e.slice(3,5),16)),r=Nt(parseInt(e.slice(5,7),16));return .2126*t+.7152*n+.0722*r}i(xo,"luminance");function lr(e,t){let n=xo(e),r=xo(t),a=Math.max(n,r),s=Math.min(n,r);return(a+.05)/(s+.05)}i(lr,"contrastRatio");function Io(e,t){return Math.min(...ar.map(n=>lr(Be[e][n].fg,t)))}i(Io,"worstAgainst");function To(e,t,n){return Math.min(Io(e,t),Io(e,n))}i(To,"worstStatusContrast");function Eo(e,t){return To("light",e,t)>=To("dark",e,t)?"light":"dark"}i(Eo,"statusSchemeFor");import{useRef as dr,useState as pr}from"react";import{useEffect as cr,useId as ur,useRef as _t}from"react";import{jsx as Ce,jsxs as Ro}from"react/jsx-runtime";function et({open:e,title:t,closeLabel:n,onClose:r,children:a,actions:s,role:o,testId:l,returnFocus:u}){let p=_t(null),f=_t(null),g=_t(!1),k=ur();return cr(()=>{let m=p.current;if(m!==null){if(e&&!m.open?(f.current=typeof document>"u"?null:document.activeElement,typeof m.showModal=="function"?m.showModal():m.setAttribute("open","")):!e&&m.open&&(typeof m.close=="function"?m.close():m.removeAttribute("open")),!e&&g.current){let y=u?.current??(f.current instanceof HTMLElement?f.current:null);f.current=null,y?.focus()}g.current=e}},[e,u]),Ce("dialog",{ref:p,className:"sekyro-dialog","aria-labelledby":k,...o==="alertdialog"?{role:o}:{},"data-testid":l,onCancel:m=>{m.preventDefault(),r()},onClick:m=>{m.target===m.currentTarget&&r()},children:Ro("div",{className:"sekyro-dialog__panel",children:[Ro("div",{className:"sekyro-dialog__head",children:[Ce("h2",{id:k,className:"sekyro-dialog__title",children:t}),n!==void 0?Ce("button",{type:"button",className:"sekyro-disc sekyro-dialog__close","aria-label":n,onClick:r,children:Ce(M,{name:"close"})}):null]}),a!==void 0?Ce("div",{className:"sekyro-dialog__body",children:a}):null,s!==void 0?Ce("div",{className:"sekyro-dialog__actions",children:s}):null]})})}i(et,"FlowDialog");import{jsx as Le,jsxs as Oo}from"react/jsx-runtime";var mr=["intro","data","processing","sharing","retention"];function Bo({i18n:e,purpose:t="identity"}){let{t:n}=e,[r,a]=pr(!1),s=dr(null),[o,l=""]=n("consent.short").split("{terms}");return Oo("div",{className:"sekyro-consent","data-testid":"sekyro-consent",children:[Oo("p",{className:"sekyro-consent__line",children:[o,Le("button",{ref:s,type:"button",className:"sekyro-link sekyro-link--inline","aria-haspopup":"dialog",onClick:()=>a(!0),children:n("consent.termsLink")}),l]}),Le(et,{open:r,title:n("consent.termsTitle"),closeLabel:n("native.close"),onClose:()=>a(!1),returnFocus:s,testId:"sekyro-consent-terms",children:Le("div",{className:"sekyro-stack sekyro-stack--3",children:t==="human"?Le(B,{view:"HumanConsentTerms",i18n:e,quiet:!0}):mr.map(u=>Le("p",{children:n(`consent.terms.${u}`)},u))})})]})}i(Bo,"ConsentNotice");function Lo(e){let t=e.trim().split(/\s+/).filter(r=>r!=="");return(t.length>=2?[t[0],t[1]].map(r=>Array.from(r??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(Lo,"initials");import{useSyncExternalStore as fr}from"react";var Fo=i(e=>({colors:{...e?$.dark:$.light},radius:$.radius,fontFamily:$.font}),"brandTheme"),ta=Fo(!1),Vo=/^#[0-9a-f]{6}$/i;function Pt(e,t,n){if(t)return null;let r=it(e).colors,a=n?.colors?.bg??r?.bg,s=n?.colors?.surface??r?.surface;return a===void 0&&s===void 0||a!==void 0&&!Vo.test(a)||s!==void 0&&!Vo.test(s)?null:Eo(a??$.light.bg,s??$.light.surface)}i(Pt,"partnerStatusScheme");function tt(e,t,n){let r=it(e);if(n&&r.colors!==void 0){let{brand:a,brandFg:s}=r.colors;a!==void 0&&Sr(a,$.dark.bg)>=3?r.colors={brand:a,ring:a,...s!==void 0?{brandFg:s}:{}}:delete r.colors}if(Pt(e,n,t)==="dark"){let a=Be.dark;r.colors={...r.colors,danger:a.danger.base,success:a.success.base,warning:a.warning.fg}}return ze(Fo(n),r,Ut(t))}i(tt,"verificationTheme");function ot(e){let t=fr(kr,gr,()=>!1);return e==="dark"||e==="system"&&t}i(ot,"useDarkScheme");var yr="(prefers-color-scheme: dark)",Do=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(yr):null,"media"),gr=i(()=>Do()?.matches??!1,"prefersDark");function kr(e){let t=Do();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(kr,"subscribe");function Sr(e,t){let[n,r]=[Ao(e),Ao(t)];return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}i(Sr,"contrast");function Ao(e){let t=[1,3,5].map(n=>{let r=Number.parseInt(e.slice(n,n+2),16)/255;return r<=.03928?r/12.92:((r+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i(Ao,"luminance");var xt="sekyro.testerGate";function It(){try{return typeof localStorage>"u"?null:localStorage}catch{return null}}i(It,"store");function Mo(e=Date.now()){try{It()?.setItem(xt,String(e))}catch{}}i(Mo,"rememberTester");function Ho(e=Date.now()){try{let t=Number(It()?.getItem(xt)??"");return Number.isFinite(t)&&t>0&&e-t<2592e6}catch{return!1}}i(Ho,"rememberedTester");function Uo(){try{It()?.removeItem(xt)}catch{}}i(Uo,"forgetTester");import{useEffect as hr,useId as br,useState as vr}from"react";import{jsx as V,jsxs as me}from"react/jsx-runtime";var $o=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),Cr={review:{icon:"pending",tone:"info"},cooldown:{icon:"timer",tone:"info"},rejected:{icon:"close",tone:"neutral"},policy:{icon:"close",tone:"neutral"},inconclusive:{icon:"warning",tone:"neutral"},unavailable:{icon:"timer",tone:"neutral"},expired:{icon:"timer",tone:"neutral"}};function wr({screen:e}){if(e==="verified")return me("svg",{className:"sekyro-outcome sekyro-outcome--approved",viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[V("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"54",pathLength:"1"}),V("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),V("path",{className:"sekyro-outcome__glyph",d:"M6.5 12.5l3.6 3.6 7.4-8.2",pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]});let{icon:t,tone:n}=Cr[e];return V("span",{className:`sekyro-tile sekyro-tile--${n} sekyro-outcome-tile`,"aria-hidden":"true","data-screen":e,children:V(M,{name:t})})}i(wr,"OutcomeMark");function Nr({label:e,id:t,copied:n}){let[r,a]=vr(!1);return hr(()=>{if(!r)return;let s=setTimeout(()=>a(!1),1600);return()=>clearTimeout(s)},[r]),me("button",{type:"button",className:`sekyro-reference${r?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[V("span",{"aria-live":"polite",children:r?n:e}),V("bdi",{dir:"ltr",children:t}),V(M,{name:"copy"})]})}i(Nr,"ReferenceLine");function _r({step:e,t}){let n=e.context.sandbox?e.context.simulation?.reason:void 0;return n===void 0?null:me(Re,{tone:"warning",role:"status",testId:"sekyro-simulated-notice",children:[V("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:V(M,{name:"info"})}),me("div",{className:"sekyro-notice__body","data-reason":n,children:[V("strong",{children:t("sandbox.simulatedTitle")}),V("span",{children:t(n==="no_testers"?"sandbox.simulatedNoTesters":"sandbox.simulatedGate")})]})]})}i(_r,"SimulationNotice");function Pr(e,t){return e==="expired"?"native.result.expiredTitle":e!=="verified"?`session.result.${e}.title`:t.level===3?"session.result.verified.title":t.level===1&&t.assurance==="contact_phone"?"session.result.verified.titlePhone":t.level===1&&t.assurance==="contact_email"?"session.result.verified.titleEmail":t.level===1?"session.result.verified.titleContact":"session.result.verified.titleHuman"}i(Pr,"resultTitleKey");function Tt({step:e,locale:t,strings:n,className:r,onClose:a}){let s=v(t,n),{t:o}=s,l=br(),u=ke(),p=e.context.orgName,f=e.reasonCode??"",g=e.display==="platform_unsupported"?"policy":e.display,k=i(y=>(p!==""||y==="verified")&&y!=="cooldown"?o(`native.result.${y}`,{org:p}):o(`session.result.${y}.description`),"partnerLine"),m;switch(e.display){case"rejected":f==="identity_not_verified"?m=p!==""?o("reasons.identity_not_verified",{org:p}):o("session.result.identityNotVerified"):m=$o.has(rt(f))?o("session.result.detailsMismatch",{org:p}):k("rejected");break;case"policy":{if($o.has(rt(f)))m=o("session.result.detailsMismatch",{org:p});else if(f==="device_velocity_exceeded")m=o("session.result.deviceVelocity",{org:p});else if(f==="capture_tampered")m=o("session.result.deviceStop");else if(f==="camera_unavailable")m=o("reasons.camera_unavailable",{org:p});else if(f==="underage_estimated")m=o("reasons.underage_estimated");else if(f==="starter_credit_claimed")m=o("reasons.starter_credit_claimed");else if(f==="blocked_by_org")m=o("reasons.blocked_by_org");else{let y=f===""?null:Lt(f);m=y!==null?o(y,{org:p}):k("policy")}break}case"cooldown":{let y=Vt(s.locale,e.retryAfter);m=y!==null?o(y.key,{time:y.time}):o("session.result.cooldown.description");break}case"platform_unsupported":m=o("result.platform_unsupported");break;default:m=k(g)}return me("section",{className:`sekyro-result${r?` ${r}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[me("div",{className:"sekyro-result__body",children:[V(wr,{screen:g}),me("div",{className:"sekyro-heading",children:[V("h2",{id:l,ref:u,tabIndex:-1,className:"sekyro-text-body",children:o(Pr(g,e.result))}),V("p",{className:"sekyro-text-muted",children:m})]}),V(_r,{step:e,t:o}),V(Nr,{label:o("result.referenceLabel"),id:e.context.sessionId,copied:o("native.result.copied")})]}),a!==void 0?V("div",{className:"sekyro-actions",children:V(h,{full:!0,onClick:a,children:o("native.result.continue",{org:p})})}):null]})}i(Tt,"VerificationResultScreen");import{Fragment as Ve,jsx as c,jsxs as Y}from"react/jsx-runtime";function Er(e,t,n){let r=t?$.dark:$.light,a=t?$.roles.dark:$.roles.light,s=e.colors??{},o={},l=s.fg===r.fg&&s.surface===r.surface;s.brand===r.brand&&s.surface===r.surface&&(o["--sekyro-color-brand-soft"]=a.brandSoft),l&&(o["--sekyro-color-line"]=a.line,o["--sekyro-color-line-subtle"]=a.lineSubtle,o["--sekyro-color-line-strong"]=a.lineStrong,o["--sekyro-color-sunken"]=a.sunken),s.fgMuted===r.fgMuted&&s.surface===r.surface&&(o["--sekyro-color-fg-subtle"]=a.fgSubtle),e.fontFamily===$.font&&(o["--sekyro-font-display"]=$.fontDisplay);let u=t?wt.dark:wt.light;if(o["--sekyro-color-success-soft"]=u.successSoft,o["--sekyro-color-success-fg"]=u.successFg,o["--sekyro-color-on-success"]=u.onSuccess,o["--sekyro-color-warning-soft"]=u.warningSoft,o["--sekyro-color-warning-fg"]=u.warningFg,o["--sekyro-color-danger-soft"]=u.dangerSoft,o["--sekyro-color-danger-fg"]=u.dangerFg,o["--sekyro-color-on-danger"]=u.onDanger,o["--sekyro-color-info-soft"]=u.infoSoft,o["--sekyro-color-info-fg"]=u.infoFg,s.brand===r.brand&&(o["--sekyro-color-line-brand"]=u.lineBrand),n!==null){let p=Be[n];for(let f of["danger","success","warning","info"])o[`--sekyro-color-${f}-soft`]=p[f].soft,o[`--sekyro-color-${f}-fg`]=p[f].fg;o["--sekyro-color-on-success"]=p.success.on,o["--sekyro-color-on-danger"]=p.danger.on}return o}i(Er,"flowRoles");function Ot(e){let{verification:t,locale:n,strings:r,onStep:a,onResult:s}=e,{step:o,error:l}=ct(t);Ae(()=>{o!==null&&a?.(o)},[o,a]),Ae(()=>s===void 0?void 0:t.on("result",s),[t,s]);let u=ot(e.colorScheme??"light"),p=o?.context.branding,f=tt(p,e.theme,u),[g,k]=W(!1),m=`sekyro-verification${u?" sekyro-verification--dark":""}${g?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,y=oe(e.onClose);y.current=e.onClose;let w=oe(o);w.current=o;let N=te(()=>{let _=w.current;y.current?.(_?.kind==="result"?{reason:"finished",result:_.result}:{reason:"cancelled"})},[]),[O,R]=W(null),S=te(()=>{let _=w.current;_!==null&&_.kind!=="result"&&_.context.consentRecorded?R("close"):N()},[N]),x=Rt(()=>t.reportCaptureIssue===void 0?null:_=>t.reportCaptureIssue?.(_),[t]);return c(Kt,{theme:f,className:m,children:c(Oe,{locale:n,...r!==void 0?{strings:r}:{},children:c("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:Er(f,u,Pt(p,u,e.theme)),children:c(Jt.Provider,{value:k,children:c(at.Provider,{value:e.onClose!==void 0?N:void 0,children:c(qe.Provider,{value:e.onClose!==void 0?S:void 0,children:Y(Ft.Provider,{value:x,children:[c(Ar,{...e,step:o,error:l,immersive:g,onLeaveAsk:()=>R("history"),onClosed:N}),c(Br,{open:O!==null,onStay:()=>{O==="history"&&Et(),R(null)},onLeave:()=>{let _=O;R(null),_==="close"||e.onClose!==void 0?N():typeof window<"u"&&qo()}})]})})})})})})})}i(Ot,"SekyroVerification");function Rr(e,t){if(t===void 0||t==="aml_screening")return null;let n=e,r=n[`session.processing.${t}.title`],a=n[`session.processing.${t}.description`];return typeof r=="string"&&r!==""&&typeof a=="string"&&a!==""?{title:r,description:a}:null}i(Rr,"processingCopyOf");function Or({error:e,retry:t}){let{t:n}=v(),r=ke();return Y(Re,{tone:"danger",testId:"sekyro-error-notice",children:[c("span",{children:n(Bt(e))}),e.retryable?c(h,{ref:r,kind:"secondary",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}i(Or,"CameraErrorNotice");var zo="sekyroFlow";function Go(){let e=window.history.state;return typeof e=="object"&&e!==null&&e[zo]===!0}i(Go,"onGuard");function Et(){if(typeof window>"u"||Go())return;let e=window.history.state;window.history.pushState({...typeof e=="object"&&e!==null?e:{},[zo]:!0},"")}i(Et,"pushGuard");function qo(){window.history.back()}i(qo,"leaveHistory");function Br({open:e,onStay:t,onLeave:n}){let{t:r}=v();return c(et,{open:e,role:"alertdialog",title:r("leave.title"),onClose:t,testId:"sekyro-leave",actions:Y(Ve,{children:[c(h,{full:!0,onClick:t,children:r("leave.stay")}),c(h,{full:!0,kind:"danger",onClick:n,children:r("leave.confirm")})]}),children:c("p",{className:"sekyro-text-muted",children:r("leave.body")})})}i(Br,"LeaveDialog");function Lr(e,t){let[n,r]=W(!1),[a,s]=W(null),o=e===null?void 0:e.skipCapture,l=oe(o);l.current=o;let u=oe(!1),p=e?.key;Ae(()=>s(null),[p]);let f=te(()=>{if(u.current)return;let y=l.current;y!==void 0&&(u.current=!0,r(!0),s(null),y().catch(w=>s(t.t(ue(w,t.strings)))).finally(()=>{u.current=!1,r(!1)}))},[t]),g=te(()=>s(null),[]),k=o!==void 0,m=t.t("sandbox.skipCapture");return Rt(()=>k?{label:m,busy:n,failed:a,run:f,reset:g}:null,[k,m,n,a,f,g])}i(Lr,"useSkipCapture");function Vr({skip:e}){return Y(Ve,{children:[e.failed!==null?c(P,{tone:"danger",children:c("span",{children:e.failed})}):null,c(h,{kind:"ghost",full:!0,disabled:e.busy,"aria-busy":e.busy||void 0,onClick:e.run,"data-testid":"sekyro-skip-capture",children:e.label})]})}i(Vr,"SkipAction");function Ar(e){let{step:t,error:n,slots:r,immersive:a}=e,s=v(),{t:o}=s,[l,u]=W(!1),[p,f]=W([]),g=te(d=>(f(I=>[...I,d]),()=>f(I=>I.filter(X=>X!==d))),[]),[k,m]=W(null),y=te(d=>m(()=>d),[]),[w,N]=W(0),[O,R]=W(null),S=Lr(t,s),x=t?.context.testerGate!==void 0,[_,Z]=W(!1),H=oe(null);Ae(()=>{!x||H.current!==null||(H.current=Ho(),H.current&&Z(!0))},[x]);let U=t?.context.purpose??"identity",D=t?.context.returning===!0,fe=e.verification,Ne=U==="human"||t?.context.cameraUnavailableHandled===!0,_e=fe.reportCameraUnavailable!==void 0&&Ne?d=>fe.reportCameraUnavailable?.(d)??Promise.resolve():void 0,Fe=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,K=e.handoffUrl,De=oe({last:null,count:0}),se=te((d,I,X=!1)=>_e===void 0&&I!=="denied"?void 0:c(B,{view:"NoCameraView",i18n:s,quiet:!0,cause:I,onRetry:d,repeated:X,...Fe&&_e!==void 0?{onContinue:_e}:{},...K!==void 0?{handoffUrl:K}:{}}),[s,fe,Ne,Fe,K]),ye=Rt(()=>io(t),[t]),z=te((d,I)=>c(ao,{start:d,context:I,human:U==="human",returning:D,notice:I.permissionSettled&&I.permission==="denied"?se(d,"denied"):void 0,...ye!==void 0?{retry:ye}:{}}),[U,D,se,ye]),Me=te((d,I)=>{let X=xr(d.kind),Ke=De.current;d.kind==="permission"&&d!==Ke.last&&(Ke.last=d,Ke.count+=1);let Wo=d.kind==="permission"&&Ke.count>1;return(X!==void 0?se(I,X,Wo):void 0)??Y(Ve,{children:[c(Or,{error:d,retry:I}),X!==void 0&&K!==void 0?c(B,{view:"DesktopHandoffView",i18n:s,quiet:!0,url:K}):null]})},[se,K,s]),ne=oe(""),ie=e.livenessProps?.slots?.stageOverlay,Pe=te(d=>(d.guidance!==""&&!d.coached&&(ne.current=d.guidance),c(co,{testId:"sekyro-capture-stage",video:c("video",{ref:d.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:d.settled?o("capture.checkingTitle"):d.guidance!==""?d.guidance:ne.current,note:d.note,status:d.status,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:o("native.close"),overlay:ie?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:i(()=>N(I=>I+1),"onClose")},end:d.modeSwitch!=null?c(At,{view:d.modeSwitch,className:"sekyro-glass sekyro-glass--label"}):null,children:d.settled||!d.live?null:c(jt,{onStop:()=>N(I=>I+1)})})),[o,ie]),He=Tr(),Ue=t,ge=t!==null&&O===t.key&&t.context.switchable!==void 0,Q=k??(t===null||t.kind==="result"?null:ge?()=>R(null):t.context.switchable!==void 0&&typeof Ue?.chooseOption=="function"?()=>R(t.key):null),ae=oe(Q);ae.current=Q;let xe=oe(t);xe.current=t;let le=oe({ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0});le.current={ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0};let Ie=e.backNavigation==="history";if(Ae(()=>{if(!Ie||typeof window>"u")return;Et();let d=i(()=>{if(Go())return;let I=xe.current,X=ae.current;X!==null?(X(),Et()):I?.kind!=="result"&&I?.context.consentRecorded===!0?le.current.ask():le.current.hostClose?le.current.closed():qo()},"onPop");return window.addEventListener("popstate",d),()=>window.removeEventListener("popstate",d)},[Ie]),n!==null)return c(Re,{tone:"danger",children:c("span",{children:o(ue(n,s.strings))})});if(t===null)return Y("div",{className:"sekyro-skeleton",role:"status","aria-busy":"true",children:[c("span",{className:"sekyro-visually-hidden",children:o("common.loading")}),c("span",{className:"sekyro-skeleton__bar is-title"}),c("span",{className:"sekyro-skeleton__bar"}),c("span",{className:"sekyro-skeleton__bar is-short"}),c("span",{className:"sekyro-skeleton__bar is-block"})]});let{context:L}=t,Te=i(d=>{u(!0),d().finally(()=>u(!1))},"refresh"),nt=r?.header??c(Mr,{context:L,headerId:He,end:r?.headerEnd,...Q!==null?{onBack:Q}:{}}),T,ce=ge;if(_&&e.verification.testerGate!==void 0)T=c(st.Provider,{value:Pe,children:c(B,{view:"TesterGateView",i18n:s,verification:e.verification,attemptsLeft:L.testerGate?.attemptsLeft??0,livenessProps:{...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:e.livenessProps?.slots?.intro??z},locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice},onBound:()=>Mo(),onDone:d=>{d&&Uo(),Z(!1)}})});else if(ce)T=c(B,{view:"LaneChoiceView",i18n:s,step:t,onClose:()=>R(null)});else switch(t.kind){case"phone_otp":T=c(ut,{step:t});break;case"email_otp":T=c(dt,{step:t});break;case"method":T=c(ft,{step:t});break;case"registry":T=c(Qe,{step:t});break;case"document":T=c(St,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{},...e.documentBarcodeAssetBaseUrl!==void 0?{barcodeAssetBaseUrl:e.documentBarcodeAssetBaseUrl}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,I={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??z,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:Me}:{}},...w>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};T=c(st.Provider,{value:Pe,children:t.instructions==="icao"||t.livePhoto?.icao===!0?c(B,{view:"LivePhotoLiveness",i18n:s,step:t,livenessProps:I,sekyroIntro:d===void 0},w):c(Ht,{...I},w)});break}case"portrait":T=Y(Ve,{children:[t.retakeOnly?c(B,{view:"PortraitRetakeNotice",i18n:s,quiet:!0}):null,c(ht,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"proof_of_address":T=c(vt,{step:t});break;case"form":T=c(Ct,{step:t});break;case"contact_choice":T=c(B,{view:"ContactChoiceView",i18n:s,step:t});break;case"choice":T=c(B,{view:"GenericChoiceView",i18n:s,step:t});break;case"identity_summary":T=c(B,{view:"IdentitySummaryView",i18n:s,step:t});break;case"mobile_required":{let d=t.checkType==="doc_ocr"?o("handoff.lead.document"):t.checkType==="portrait_icao"?o("handoff.lead.portrait"):t.checkType==="poa"?o("handoff.lead.poa"):void 0;T=e.handoffUrl!==void 0?c(B,{view:"HandoffView",i18n:s,url:e.handoffUrl,refresh:t.refresh,...d!==void 0?{lead:d}:{}}):c(Ze,{tone:"brand",icon:"smartphone",title:o("handoff.title"),actions:c(h,{kind:"secondary",full:!0,disabled:l,onClick:()=>Te(t.refresh),children:o("common.refresh")}),children:c("p",{children:d??o("reasons.mobile_required")})});break}case"native_app_required":T=c(B,{view:"NativeAppView",i18n:s,org:L.orgName,nativeApp:t.nativeApp,...e.handoffUrl!==void 0?{fallbackUrl:e.handoffUrl}:{},refresh:t.refresh,footer:c(Ko,{org:L.orgName})});break;case"processing":{let d=Rr(s.strings,t.service);T=c(Ze,{tone:"brand",icon:"pending",busy:!t.stalled,live:!0,title:d?.title??o("session.processing.title"),actions:t.stalled?c(h,{kind:"secondary",full:!0,disabled:l,onClick:()=>Te(t.refresh),children:o("common.refresh")}):null,children:c("p",{children:d?.description??o("session.processing.description")})});break}case"eid":T=c(pt,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";T=c(Ze,{tone:"neutral",icon:"smartphone",title:o(d?"needsApp.title":"unsupported.title"),actions:c(Ko,{org:L.orgName}),children:c("p",{children:d?L.orgName!==""?o("needsApp.description",{org:L.orgName}):o("needsApp.descriptionNoOrg"):o("unsupported.description",{org:L.orgName})})});break}case"result":T=r?.result?.(t)??c(Fr,{step:t});break;default:{let d=t;T=null}}let $e=!a&&!L.consentRecorded&&t.kind!=="result"?c(Bo,{i18n:s,purpose:L.purpose}):null,Ee=S!==null&&!a&&!ce&&!_?c(Vr,{skip:S}):null,C=x&&!_&&!a&&!ce&&e.verification.testerGate!==void 0?c(B,{view:"TesterGateAction",i18n:s,quiet:!0,onOpen:()=>Z(!0)}):null,A=Ee===null&&C===null?$e:Y(Ve,{children:[C,Ee,$e]});return c(Xt.Provider,{value:y,children:c(Ye.Provider,{value:S,children:c(lo.Provider,{value:e.handoffUrl,children:Y(Qt.Provider,{value:A===null?null:{node:A,owner:p[0]??null,claim:g},children:[a?null:nt,!a&&t.kind!=="result"&&L.sections.length>1?c(Hr,{context:L,current:t.section,i18n:s}):null,c(to,{pageKey:t.key,children:T}),!a&&!ce&&t.kind!=="result"&&t.context.switchable!==void 0?c(B,{view:"LaneSwitch",i18n:s,step:t,onOpen:()=>R(t.key),quiet:!0},t.key):null,p.length===0?A:null,a?null:r?.footer!==void 0?r.footer:L.branding?.hideAttribution===!0?null:Y("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[c(M,{name:"lock"}),o("shell.verifiedBy")]})]})})})})}i(Ar,"Body");function Ko({org:e}){let{t}=v(),n=Ir(at);return n===void 0?null:c(h,{full:!0,onClick:n,children:t("native.result.continue",{org:e})})}i(Ko,"BackToOrg");function Fr({step:e}){return c(qe.Consumer,{children:t=>c(Tt,{step:e,...t!==void 0?{onClose:t}:{}})})}i(Fr,"ResultPage");function Dr(e){let t=e.levelName??e.purpose;return t==="contact"?"shell.subtitleContact":t==="human"?"shell.subtitleHuman":"shell.subtitle"}i(Dr,"subtitleKeyOf");function Mr({context:e,headerId:t,end:n,onBack:r}){let{t:a}=v(),[s,o]=W(!1),l=s?void 0:e.branding?.logoUrl,u=e.orgName!==""?e.orgName:a(e.returning?"returning.heading":"session.title");return c("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:Y("div",{className:"sekyro-org",children:[r!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__back","aria-label":a("common.back"),onClick:r,"data-testid":"sekyro-back",children:c(M,{name:"back"})}):null,c("span",{className:"sekyro-org__tile","aria-hidden":"true",children:l!==void 0?c("img",{className:"sekyro-org__logo",src:l,alt:"",onError:()=>o(!0)}):Lo(e.orgName)}),Y("div",{className:"sekyro-org__text",children:[c("h1",{id:t,className:"sekyro-org__name",children:u}),c("p",{className:"sekyro-org__sub",children:a(Dr(e))})]}),e.sandbox?c("span",{className:"sekyro-sandbox-badge","data-testid":"sekyro-sandbox-badge",children:a("app.sandboxBadge")}):null,n!=null?c("div",{className:"sekyro-org__end",children:n}):null,c(qe.Consumer,{children:p=>p!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":a("native.close"),onClick:p,children:c(M,{name:"close"})}):null})]})})}i(Mr,"OrgHeader");function Hr({context:e,current:t,i18n:n}){let r=t===null?-1:e.sections.indexOf(t),a=e.progress,s=a!==void 0&&a.length===e.sections.length?a:e.sections.map((o,l)=>({id:o,state:l<r?"done":l===r?"current":"upcoming"}));return c("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:s.map(({id:o,state:l})=>c("li",{className:`sekyro-progress__bar${l==="done"?" is-done":l==="current"?" is-current":""}`,...l==="current"?{"aria-current":"step"}:{},children:c("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${o}`]??o})},o))})}i(Hr,"SectionProgress");import{useEffect as Ur,useState as Yo}from"react";import{jsx as we}from"react/jsx-runtime";function $r(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i($r,"pageUrl");function Kr({hostedUrl:e,inAppBrowser:t,...n}){let[r,a]=Yo(t===!0);Ur(()=>{t===void 0&<()&&a(!0)},[t]);let[s,o]=Yo(!1),l=ot(n.colorScheme??"light"),u=n.handoffUrl??e??$r();return r&&!s?we($t,{theme:ze(tt(void 0,void 0,l),n.theme),className:`sekyro-verification${l?" sekyro-verification--dark":""}${n.className!==void 0?` ${n.className}`:""}`,children:we(Oe,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:we("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-flow",children:we(zr,{url:u,onContinue:()=>o(!0)})})})}):we(Ot,{...n,...u!==""?{handoffUrl:u}:{}})}i(Kr,"SekyroFlow");function zr({url:e,onContinue:t}){let n=v();return we(B,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}i(zr,"Prompt");export{St as DocumentCapture,pt as EidStep,dt as EmailOtpStep,Ct as FormStep,Qe as IdNumberEntry,ft as MethodChoice,Tn as NniEntry,ut as PhoneOtpStep,ht as PortraitCapture,vt as ProofOfAddress,Kr as SekyroFlow,Ot as SekyroVerification,Oe as StepI18nProvider,Tt as VerificationResultScreen,Xo as arSteps,Jo as enSteps,en as formatTemplate,jo as frSteps,lt as isInAppBrowser,Zo as loadSekyroLocale,tn as resolveSekyroStrings,Qo as retakeHintStringKey,v as useStepI18n,ct as useVerificationStep};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sekyro/react",
|
|
3
|
-
"version": "0.1.0-rc.
|
|
3
|
+
"version": "0.1.0-rc.36",
|
|
4
4
|
"description": "Sekyro AI React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (Arabic, French, English, Spanish, Portuguese and German, RTL-safe, WCAG AAA defaults)",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE",
|
|
6
6
|
"repository": {
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"strings:steps": "node scripts/gen-step-strings.mjs"
|
|
76
76
|
},
|
|
77
77
|
"peerDependencies": {
|
|
78
|
-
"@sekyro/web": "^0.1.0-rc.
|
|
78
|
+
"@sekyro/web": "^0.1.0-rc.38 || ^0.2.0-rc.0",
|
|
79
79
|
"react": ">=18.2",
|
|
80
80
|
"react-dom": ">=18.2"
|
|
81
81
|
},
|
package/sbom.cdx.json
CHANGED
|
@@ -97,8 +97,8 @@
|
|
|
97
97
|
"type": "application",
|
|
98
98
|
"name": "react",
|
|
99
99
|
"group": "@sekyro",
|
|
100
|
-
"version": "0.1.0-rc.
|
|
101
|
-
"bom-ref": "@sekyro/react@0.1.0-rc.
|
|
100
|
+
"version": "0.1.0-rc.36",
|
|
101
|
+
"bom-ref": "@sekyro/react@0.1.0-rc.36",
|
|
102
102
|
"description": "Sekyro AI React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (Arabic, French, English, Spanish, Portuguese and German, RTL-safe, WCAG AAA defaults)",
|
|
103
103
|
"licenses": [
|
|
104
104
|
{
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
}
|
|
109
109
|
}
|
|
110
110
|
],
|
|
111
|
-
"purl": "pkg:npm/%40sekyro/react@0.1.0-rc.
|
|
111
|
+
"purl": "pkg:npm/%40sekyro/react@0.1.0-rc.36?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-react",
|
|
112
112
|
"externalReferences": [
|
|
113
113
|
{
|
|
114
114
|
"url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
|
|
@@ -147,7 +147,7 @@
|
|
|
147
147
|
"components": [],
|
|
148
148
|
"dependencies": [
|
|
149
149
|
{
|
|
150
|
-
"ref": "@sekyro/react@0.1.0-rc.
|
|
150
|
+
"ref": "@sekyro/react@0.1.0-rc.36"
|
|
151
151
|
}
|
|
152
152
|
]
|
|
153
153
|
}
|