@sekyro/react 0.1.0-rc.12 → 0.1.0-rc.13

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,5 +1,5 @@
1
- import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-DqD8Nyoq.cjs';
2
- export { k as StringKey, A as retakeHintStringKey } from '../theme-DqD8Nyoq.cjs';
1
+ import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-qTwMxyZM.cjs';
2
+ export { k as StringKey, A as retakeHintStringKey } from '../theme-qTwMxyZM.cjs';
3
3
  import * as react from 'react';
4
4
  import { ReactNode } from 'react';
5
5
  import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
@@ -1,5 +1,5 @@
1
- import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-DqD8Nyoq.js';
2
- export { k as StringKey, A as retakeHintStringKey } from '../theme-DqD8Nyoq.js';
1
+ import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-qTwMxyZM.js';
2
+ export { k as StringKey, A as retakeHintStringKey } from '../theme-qTwMxyZM.js';
3
3
  import * as react from 'react';
4
4
  import { ReactNode } from 'react';
5
5
  import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as dt}from"../chunk-4ZN7GIYK.js";import{a as F,d as ke,e as Se,f as be}from"../chunk-ZCAZDOMD.js";import{a as nt}from"../chunk-EZ5TVL6P.js";import{a as it}from"../chunk-YY76AMUA.js";import{a as at,b as lt,c as ct,d as pt}from"../chunk-IDZNOWTO.js";import{a as z}from"../chunk-PYAJMHZH.js";import{a as je,b as et,d as tt,g as ot}from"../chunk-ALUF2O22.js";import{b as Xe}from"../chunk-LNZR3RXG.js";import{a as q,b as J,c as ve,d as rt,g as st}from"../chunk-PTPTDOWD.js";import{a as oe}from"../chunk-VRDPGOXM.js";import{a as Wt,b as Yt,c as zt,d as Zt,e as qt,f as pe,g as P}from"../chunk-WAVBS3GL.js";import{a as _,b as Ce}from"../chunk-K7YYCJUR.js";import{a as C,c as Ze,i as $t,k as Gt,l as qe,m as Je,n as Qe,t as ge,u as te}from"../chunk-34326C2I.js";import{a as i}from"../chunk-2KED7D2Q.js";import{useEffect as Jt,useState as ut}from"react";function xe(e){let[t,o]=ut(()=>e?.currentStep?.()??null),[n,l]=ut(null);return Jt(()=>{if(e===void 0)return;if(typeof e.run!="function"){l(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let s=!0,r=e.on("step",a=>{s&&o(a)});return e.run().then(a=>{s&&o(c=>c??a)},a=>{s&&l(a)}),()=>{s=!1,r()}},[e]),{step:t,error:n}}i(xe,"useVerificationStep");import{useEffect as vt,useId as Xt,useMemo as Ct,useRef as Nt,useState as de}from"react";var Qt="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",mt;function ft(e){return mt??(mt=new Map(Qt.split(" ").map(t=>{let[o,n]=t.slice(2).split("/");return[t.slice(0,2),[o,n]]}))),mt.get(e.toUpperCase())}i(ft,"entryOf");function yt(e){return ft(e)?.[0]}i(yt,"dialCodeOf");function ht(e){return ft(e)?.[1]}i(ht,"nationalPrefixOf");import{Fragment as bt,jsx as k,jsxs as U}from"react/jsx-runtime";var gt=i((e,t)=>{if(e===void 0)return 0;let o=Date.parse(e)-t;return Number.isFinite(o)?Math.max(0,Math.ceil(o/1e3)):0},"secondsUntil"),jt=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),eo=["whatsapp","sms"],to=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"]);function kt(e){let t=e.replace(/[\s-]/g,""),o=t.startsWith("+")?t.slice(1):t;return/^\d{8,15}$/.test(o)?`+${o}`:null}i(kt,"normalizedPhone");var oo=i(e=>String.fromCodePoint(...Array.from(e,t=>127397+t.charCodeAt(0))),"flagOf");function no(e){let t=[];for(let o of e.phoneCountries??["MR"]){let n=yt(o);n!==void 0&&!t.some(l=>l.code===o)&&t.push({code:o,dial:`+${n}`})}return t}i(no,"phoneCountriesOf");function ro(e,t){if(t===null||!e.startsWith(t.dial))return kt(e);let o=e.slice(t.dial.length).replace(/\D/g,""),n=ht(t.code);return n!==void 0&&o.startsWith(n)&&(o=o.slice(n.length)),kt(t.dial+o)}i(ro,"e164Of");function St(e,t){return t.filter(n=>e.startsWith(n.dial)).sort((n,l)=>l.dial.length-n.dial.length)[0]?.code??t[0]?.code??null}i(St,"countryFor");function so(e,t){let o=null;try{o=new Intl.DisplayNames([e],{type:"region"})}catch{}return new Map(t.map(n=>[n,o?.of(n)??n]))}i(so,"countryLabels");function io({id:e,label:t,value:o,onChange:n,placeholder:l,countries:s,country:r,onCountry:a,locale:c,countryLabel:u}){let f=s.find(g=>g.code===r)?.dial??null,m=f===null||o.startsWith("+")&&!o.startsWith(f),h=m?o:o.slice(o.startsWith(f)?f.length:0).trim(),y=Ct(()=>so(c,s.map(g=>g.code)),[c,s]),N=Nt(null);vt(()=>{let g=setTimeout(()=>N.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(g)},[]);let x=U("div",{className:"sekyro-phone",dir:"ltr",children:[m||r===null?null:U("span",{className:"sekyro-phone__dial",id:`${e}-dial`,children:[k("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:oo(r)}),f]}),k("input",{ref:N,id:e,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",...m?{}:{"aria-describedby":`${e}-dial`},placeholder:f===null?"+":l,value:h,onChange:g=>{let v=g.target.value.replace(/[^\d +]/g,"");n(v.startsWith("+")||f===null?v:f+v.replace(/\D/g,""))}})]});return U("div",{className:"sekyro-field",children:[k("label",{className:"sekyro-label",htmlFor:e,children:t}),s.length>1?U("div",{className:"sekyro-phone-row",children:[k("select",{className:"sekyro-phone__country","aria-label":u,value:r??"",onChange:g=>{let v=s.find(L=>L.code===g.target.value);v!==void 0&&(a(v.code),n(m&&o.startsWith("+")?o:v.dial+h.replace(/\D/g,"")))},children:s.map(g=>k("option",{value:g.code,children:`${y.get(g.code)??g.code} (${g.dial})`},g.code))}),x]}):x]})}i(io,"PhoneField");function Ie({step:e,locale:t,strings:o,className:n,defaultPhone:l,onError:s}){let r=P(t,o),{t:a}=r,c=Ct(()=>no(e),[e.phoneCountries]),u=l??c[0]?.dial??"",[f,m]=de(()=>St(u,c)),h=c.map(S=>S.code).join(",");vt(()=>{if(f===null||!c.some(S=>S.code===f)){let S=St(u,c);m(S);let M=N.current,_e=c.find(ee=>ee.code===S)?.dial;_e!==void 0&&g(ee=>M!==null&&ee.startsWith(M.dial)?_e+ee.slice(M.dial.length):ee.startsWith("+")?ee:_e)}},[h,u]);let y=c.find(S=>S.code===f)??null,N=Nt(y);y!==null&&(N.current=y);let[x,g]=de(u),[v,L]=de(""),[T,Z]=de(!1),[b,B]=de(null),I=e.phase==="verify",G=it(I),A=Xt(),H=i(async S=>{Z(!0),B(null);try{await S()}catch(M){B(oe(M,r.strings)),s?.(M)}finally{Z(!1)}},"run"),Y=eo.filter(S=>(e.channels??[]).includes(S)),ye=c.length===0&&!x.trim().startsWith("+")?null:ro(x,y),w=!e.needsPhone||ye!==null,X=i((S,M=!1)=>{H(()=>e.send({...e.needsPhone&&(!M||x!==u)?{phone:ye??x}:{},...S!==void 0?{channel:S}:{}}))},"send"),d=i(S=>{H(()=>e.verify(S))},"submitCode"),E=i(S=>{S.preventDefault(),I?d(v):Y.length<=1&&w&&X(Y[0])},"onSubmit"),j=gt(e.codeExpiresAt,G),ce=gt(e.resendAvailableAt,G),he=I&&e.codeExpiresAt!==void 0&&j===0,we=i(S=>a(S==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[Ht,Ut]=a("otp.sentTo",{channel:we(e.channel)}).split("{number}"),Kt=e.reason==="otp_mismatch"?U(_,{tone:"danger",children:[k("span",{children:a("otp.reason_otp_mismatch")}),k("span",{children:Ce(r,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&to.has(e.reason)?k(_,{tone:"warning",children:k("span",{children:a(`otp.reason_${e.reason}`)})}):null,ze=U(bt,{children:[Kt,b!==null?k(_,{tone:"danger",children:k("span",{children:a(b)})}):null]});if(I){let S=Y.length===0;return U("form",{className:`sekyro-step sekyro-otp${n?` ${n}`:""}`,"aria-labelledby":A,onSubmit:E,noValidate:!0,children:[k(q,{id:A,title:a("otp.verifyTitle"),lead:U(bt,{children:[Ht,k("bdi",{dir:"ltr",className:"sekyro-mono",children:e.sentToMasked}),Ut]})}),ze,U("div",{className:"sekyro-field",children:[k("label",{className:"sekyro-label",htmlFor:`${A}-code`,children:a("otp.codeLabel")}),k(nt,{id:`${A}-code`,value:v,invalid:e.reason==="otp_mismatch",onChange:M=>{L(M),M.length===6&&v.length!==6&&!T&&!e.attemptsExhausted&&d(M)}}),k("span",{className:`sekyro-help sekyro-otp-expiry${he?" is-danger":""}`,"aria-hidden":!he||void 0,children:he?a("otp.expired"):a("otp.expiresIn",{time:jt(j)})})]}),k("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:he?a("otp.expired"):""}),U(J,{children:[k(C,{type:"submit",full:!0,disabled:T||v.length!==6||e.attemptsExhausted,"aria-busy":T||void 0,children:a("otp.verify")}),S?k("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:T||ce>0,onClick:()=>X(void 0,!0),children:ce>0?a("otp.resendIn",{seconds:ce}):a("otp.resend")}):ce>0?k("p",{className:"sekyro-resend is-waiting",children:a("otp.resendIn",{seconds:ce})}):k("div",{className:"sekyro-resend-row",children:Y.map(M=>k("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:T,onClick:()=>X(M,!0),children:a("otp.resendBy",{channel:we(M)})},M))})]})]})}return U("form",{className:`sekyro-step sekyro-otp${n?` ${n}`:""}`,"aria-labelledby":A,onSubmit:E,noValidate:!0,children:[k(q,{id:A,title:a("otp.sendTitle"),lead:a("otp.sendDescription")}),ze,e.needsPhone?k(io,{id:`${A}-phone`,label:a("otp.phoneLabel"),value:x,onChange:g,placeholder:a(f==="MR"?"otp.phonePlaceholder":"otp.phonePlaceholderGeneric"),countries:c,country:f,onCountry:m,locale:r.locale,countryLabel:a("otp.countryLabel")}):k("p",{className:"sekyro-text-muted",children:a("otp.prefilledNotice")}),k(J,{children:Y.length>0?U("div",{className:"sekyro-actions__group",role:"group","aria-label":a("otp.chooseChannel"),children:[k("p",{className:"sekyro-label","aria-hidden":"true",children:a("otp.chooseChannel")}),Y.map((S,M)=>k(C,{kind:M===0?"primary":"ghost",full:!0,disabled:T||!w,"aria-busy":M===0&&T||void 0,onClick:()=>X(S),children:a("otp.sendBy",{channel:we(S)})},S))]}):k(C,{type:"submit",full:!0,disabled:T||!w,"aria-busy":T||void 0,children:a("otp.send")})})]})}i(Ie,"PhoneOtpStep");import{lazy as lo,Suspense as co,useMemo as po,useState as uo}from"react";import{Component as ao}from"react";var Ee=class Ee extends ao{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Ee,"LoadBoundary");var W=Ee;import{jsx as ne,jsxs as fo}from"react/jsx-runtime";var mo={load:i(()=>import("../email-otp-view-2I346KUZ.js"),"load")};function Me({locale:e,strings:t,...o}){let n=P(e,t),[l,s]=uo(0),r=po(()=>lo(()=>mo.load().then(c=>({default:c.EmailOtpView}))),[l]),a=fo(_,{tone:"danger",children:[ne("span",{children:n.t("errors.network_error")}),ne(C,{kind:"ghost",onClick:()=>s(c=>c+1),children:n.t("common.retry")})]});return ne(W,{fallback:a,children:ne(co,{fallback:ne("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:n.t("common.loading")}),children:ne(r,{...o,i18n:n})})},l)}i(Me,"EmailOtpStep");import{lazy as yo,Suspense as ho,useMemo as go,useState as ko}from"react";import{jsx as re,jsxs as bo}from"react/jsx-runtime";var So={load:i(()=>import("../eid-view-OZETO2IS.js"),"load")};function Te({locale:e,strings:t,...o}){let n=P(e,t),[l,s]=ko(0),r=go(()=>yo(()=>So.load().then(c=>({default:c.EidView}))),[l]),a=bo(_,{tone:"danger",children:[re("span",{children:n.t("errors.network_error")}),re(C,{kind:"ghost",onClick:()=>s(c=>c+1),children:n.t("common.retry")})]});return re(W,{fallback:a,children:re(ho,{fallback:re("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:n.t("common.loading")}),children:re(r,{...o,i18n:n})})},l)}i(Te,"EidStep");import{useMemo as xo}from"react";import{lazy as vo,Suspense as Co,useMemo as No,useState as Po}from"react";import{jsx as se,jsxs as _o}from"react/jsx-runtime";var wo={load:i(()=>import("../flow-views-TEE63CMW.js"),"load")};function V({view:e,i18n:t,quiet:o,...n}){let[l,s]=Po(0),r=No(()=>vo(()=>wo.load().then(c=>({default:c[e]}))),[e,l]),a=_o(_,{tone:"danger",children:[se("span",{children:t.t("errors.network_error")}),se(C,{kind:"ghost",onClick:()=>s(c=>c+1),children:t.t("common.retry")})]});return se(W,{fallback:a,children:se(Co,{fallback:o===!0?null:se("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:se(r,{...n,i18n:t})})},l)}i(V,"Flow");import{jsx as Le,jsxs as Io}from"react/jsx-runtime";function Ae({step:e,locale:t,strings:o,className:n,onError:l}){let s=P(t,o),{busy:r,error:a,run:c}=ct(s,l),u=xo(()=>e.choice.options.flatMap(m=>{let h=lt(m,s),y=at[m.service];return h===null?[]:[{id:m.id,label:h,glyph:y&&Le(z,{name:y})}]}),[e.choice.options,s]),f=e.choice.options.find(m=>m.service==="national_eid");return Io("div",{className:n,children:[Le(tt,{title:s.t("method.title"),description:s.t("method.description"),options:u,busy:r,error:a,focus:!0,testId:"sekyro-method",onChoose:m=>c(()=>e.choose(m))}),f?.nationalEid?.afterPass==="continue"?Le(V,{view:"EidContinueHint",i18n:s,provider:f.nationalEid.providerName,quiet:!0}):null]})}i(Ae,"MethodChoice");import{isValidNni as Eo,normalizeNni as Pt}from"@sekyro/web";import{useId as Mo,useState as Ve}from"react";import{Fragment as Vo,jsx as R,jsxs as ie}from"react/jsx-runtime";var To=new Set(["nni_not_found","registry_record_not_found"]),Lo=new Set(["nni_invalid","id_number_invalid"]);function Ne({step:e,locale:t,strings:o,className:n,onError:l}){let s=P(t,o),{t:r}=s,[a,c]=Ve(""),[u,f]=Ve(!1),[m,h]=Ve(null),y=Mo(),N=e.attemptsExhausted,x=i(async G=>{f(!0),h(null);try{await G()}catch(A){h(oe(A,s.strings)),l?.(A)}finally{f(!1)}},"run"),g=i(G=>{if(G.preventDefault(),e.source!=="typed"){x(()=>e.confirm());return}let A=Pt(a);if(!/^\d{10}$/.test(A))return h("population.invalid");if(!Eo(A))return h("population.reason_id_number_invalid");x(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(A):e.submitNni(A))},"onSubmit"),v=Ce(s,e.attemptsRemaining,N),L=e.reason!==void 0&&To.has(e.reason),T=e.reason!==void 0&&Lo.has(e.reason),Z=ie(Vo,{children:[e.reason==="registry_unavailable"?ie(_,{tone:"warning",children:[R("span",{children:r("population.reason_registry_unavailable")}),R("span",{children:v})]}):null,L&&e.canUseDocument?ie(_,{tone:"warning",children:[R("span",{children:r("population.reason_registry_record_not_found_or_document")}),R("span",{children:v}),R(C,{kind:"ghost",disabled:u,onClick:()=>{x(()=>e.useDocument())},children:r("population.useDocument")})]}):null,L&&!e.canUseDocument||T?ie(_,{tone:"danger",children:[R("span",{children:r(L?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),R("span",{children:v})]}):null,N&&e.reason===void 0?R(_,{tone:"danger",children:R("span",{children:v})}):null,m!==null?R(_,{tone:"danger",children:R("span",{children:r(m)})}):null]}),[b,B,I]=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 ie("form",{className:`sekyro-step${n?` ${n}`:""}`,"aria-labelledby":y,onSubmit:g,noValidate:!0,children:[R(q,{id:y,title:r(b),lead:r(B)}),Z,e.source==="typed"?ie("div",{className:"sekyro-field",children:[R("label",{className:"sekyro-label",htmlFor:`${y}-id-number`,children:r("population.label")}),R("input",{id:`${y}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:r("population.placeholder"),value:a,"aria-describedby":`${y}-id-number-help`,"aria-invalid":m==="population.invalid"||m==="population.reason_id_number_invalid"||void 0,onChange:G=>{h(null),c(Pt(G.target.value).replace(/\D/g,"").slice(0,10))}}),R("span",{id:`${y}-id-number-help`,className:"sekyro-help",children:r("population.helper")})]}):null,R(J,{children:N?null:R(C,{type:"submit",full:!0,disabled:u,"aria-busy":u||void 0,children:r(I)})})]})}i(Ne,"IdNumberEntry");function Ao(e){return Ne(e)}i(Ao,"NniEntry");import{acceptedIssuers as Ho,acceptedTypesFor as Uo,warmDocumentCapture as Ko}from"@sekyro/web";import{lazy as $o,Suspense as Go,useEffect as Wo,useMemo as Yo,useState as Et}from"react";import{acceptedIssuers as Ro,acceptedTypesFor as Re}from"@sekyro/web";import{useEffect as wt,useId as Oo,useMemo as _t,useState as Oe}from"react";import{jsx as O,jsxs as ae}from"react/jsx-runtime";var xt=i(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),Bo=i(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),Do=220;function Fo(e,t,o=[]){let n=null;try{n=new Intl.DisplayNames([e],{type:"region"})}catch{}let l=t.map(a=>({code:a,name:n?.of(a)??a})),s=new Intl.Collator(e),r=i(a=>{let c=o.indexOf(a);return c<0?o.length:c},"rank");return l.sort((a,c)=>r(a.code)-r(c.code)||s.compare(a.name,c.name))}i(Fo,"countryNames");function It({step:e,i18n:t,issuer:o,onPicked:n}){let{t:l,locale:s}=t,r=_t(()=>Ro(e.documents),[e.documents]),a=_t(()=>Fo(s,r,Object.keys(e.documents.byIssuer??{})),[s,r,e.documents]),c=r.length===1?r[0]:null,[u,f]=Oe(o??c),[m,h]=Oe(""),[y,N]=Oe(null),x=Oo(),g=c===null?[]:Re(e.documents,c),v=c!==null&&g.length===1?g[0]:null;wt(()=>{c!==null&&v!==null&&e.selectDocument(c,v)},[c,v]);let L=i((b,B)=>{e.selectDocument(b,B),n?.()},"pick"),T=i(b=>{let B=Re(e.documents,b);B.length===1?L(b,B[0]):f(b)},"chooseIssuer");if(wt(()=>{if(y===null||u===null)return;let b=setTimeout(()=>L(u,y),Do);return()=>clearTimeout(b)},[y]),v!==null)return null;if(u===null){let b=xt(m.trim()),B=b===""?a:a.filter(I=>xt(I.name).includes(b)||I.code.toLowerCase()===b);return ae("section",{className:"sekyro-step",children:[O(q,{title:l("doc.countryTitle"),lead:l("doc.pickDescription")}),ae("div",{className:"sekyro-field",children:[O("label",{className:"sekyro-label",htmlFor:x,children:l("doc.countryLabel")}),O("input",{id:x,type:"search",className:"sekyro-input",placeholder:l("doc.countrySearch"),value:m,onChange:I=>h(I.target.value)})]}),B.length===0?O("p",{className:"sekyro-text-muted",children:l("doc.noCountryMatch")}):O("ul",{className:"sekyro-rows",children:B.map(I=>O("li",{children:ae("button",{type:"button",className:"sekyro-row-btn",onClick:()=>T(I.code),children:[O("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:Bo(I.code)}),I.name]})},I.code))}),O(J,{children:null})]})}let Z=Re(e.documents,u);return ae("section",{className:"sekyro-step",children:[O(q,{title:l("doc.pickTitle"),lead:l("native.doc.holdIt")}),O("div",{className:"sekyro-choices",children:Z.map(b=>ae("button",{type:"button",className:"sekyro-card","aria-pressed":y===b,disabled:y!==null&&y!==b,onClick:()=>N(b),children:[O(z,{name:b==="passport"?"passport":"card"}),ae("span",{className:"sekyro-card__body",children:[O("span",{className:"sekyro-card__title",children:l(`doc.type.${b}`)}),O("span",{className:"sekyro-card__sub",children:l(`doc.sub.${b}`)})]}),O("span",{className:"sekyro-radio","aria-hidden":"true"})]},b))}),r.length>1?O("button",{type:"button",className:"sekyro-link",onClick:()=>{f(null),N(null)},children:l("native.doc.changeCountry")}):null,O(J,{children:null})]})}i(It,"DocumentPicker");import{jsx as Q,jsxs as Zo}from"react/jsx-runtime";var zo={load:i(()=>import("../document-capture-view-LR4OLZPG.js"),"load")};function Be({step:e,locale:t,strings:o,className:n,liveMrz:l}){let s=P(t,o),[r,a]=Et(0),[c,u]=Et(null),f=Ho(e.documents).length>1,m=e.issuer!==null&&Uo(e.documents,e.issuer).length>1,h=Yo(()=>$o(()=>zo.load().then(N=>({default:N.DocumentCaptureView}))),[r]);Wo(()=>{Ko()},[]);let y=Zo(_,{tone:"danger",children:[Q("span",{children:s.t("errors.network_error")}),Q(C,{kind:"ghost",onClick:()=>a(N=>N+1),children:s.t("doc.retryCamera")})]});return Q("div",{className:n,children:e.documentType===null||e.issuer===null||c!==null?Q(It,{step:e,i18n:s,...c==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>u(null)}):Q(W,{fallback:y,children:Q(Go,{fallback:Q("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:Q(h,{step:e,i18n:s,liveMrz:l,...f?{onChangeCountry:i(()=>u("country"),"onChangeCountry")}:{},...m?{onChangeDocument:i(()=>u("document"),"onChangeDocument")}:{}})})},r)})}i(Be,"DocumentCapture");import{warmPortraitCapture as qo}from"@sekyro/web";import{Component as Jo,lazy as Qo,Suspense as Xo,useEffect as jo,useMemo as en,useState as tn}from"react";import{jsx as D,jsxs as Fe}from"react/jsx-runtime";var on={load:i(()=>import("../portrait-capture-view-TNKPPDYM.js"),"load")},Ue=class Ue extends Jo{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Ue,"LoadBoundary");var De=Ue;function nn({step:e,i18n:t}){let{t:o}=t,n=te();return Fe("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[D("h2",{ref:n,tabIndex:-1,className:"sekyro-text-body",children:o(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?D("p",{className:"sekyro-text-muted",children:o("portrait.reviewDescription")}):null,e.uploadFailed?Fe(_,{tone:"danger",children:[D("span",{children:o("portrait.uploadFailed")}),D(C,{kind:"ghost",onClick:()=>{e.resubmit()},children:o("portrait.sendAgain")})]}):D("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:o("portrait.matching")})]})}i(nn,"MatchPhase");function He({step:e,locale:t,strings:o,className:n,assetBaseUrl:l}){let s=P(t,o),[r,a]=tn(0),c=en(()=>Qo(()=>on.load().then(f=>({default:f.PortraitCaptureView}))),[r]);if(jo(()=>{e.phase==="capture"&&qo()},[e.phase]),e.phase==="match")return D("div",{className:n,children:D(nn,{step:e,i18n:s})});let u=Fe(_,{tone:"danger",children:[D("span",{children:s.t("errors.network_error")}),D(C,{kind:"ghost",onClick:()=>a(f=>f+1),children:s.t("portrait.retryCamera")})]});return D("div",{className:n,children:D(De,{fallback:u,children:D(Xo,{fallback:D("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:D(c,{step:e,i18n:s,...l!==void 0?{assetBaseUrl:l}:{}})})},r)})}i(He,"PortraitCapture");import{cameraUnavailableCauseOf as bn}from"@sekyro/web";import{useCallback as me,useEffect as Dt,useId as vn,useRef as Ge,useState as fe}from"react";import{useId as rn,useState as sn}from"react";import{jsx as Pe,jsxs as Mt}from"react/jsx-runtime";var an=["intro","data","processing","sharing","retention"];function Tt({i18n:e,purpose:t="identity"}){let{t:o}=e,[n,l]=sn(!1),s=rn(),[r,a=""]=o("consent.short").split("{terms}");return Mt("section",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-consent",children:[Mt("p",{className:"sekyro-text-muted",children:[r,Pe("button",{type:"button",className:"sekyro-link","aria-expanded":n,"aria-controls":s,onClick:()=>l(c=>!c),children:o("consent.termsLink")}),a]}),Pe("div",{id:s,hidden:!n,className:"sekyro-stack sekyro-stack--1 sekyro-text-muted","data-testid":"sekyro-consent-terms",children:t==="human"?Pe(V,{view:"HumanConsentTerms",i18n:e,quiet:!0}):an.map(c=>Pe("p",{children:o(`consent.terms.${c}`)},c))})]})}i(Tt,"ConsentNotice");function Lt(e){let t=e.trim().split(/\s+/).filter(n=>n!=="");return(t.length>=2?[t[0],t[1]].map(n=>Array.from(n??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(Lt,"initials");import{useSyncExternalStore as ln}from"react";var Vt=i(e=>({colors:{...e?F.dark:F.light},radius:F.radiusLg,fontFamily:F.font}),"brandTheme"),_s=Vt(!1);function Rt(e,t,o){let n=ke(e);if(o&&n.colors!==void 0){let{brand:l,brandFg:s}=n.colors;l!==void 0&&un(l,F.dark.bg)>=3?n.colors={brand:l,ring:l,...s!==void 0?{brandFg:s}:{}}:delete n.colors}return Se(Vt(o),n,t)}i(Rt,"verificationTheme");function Ot(e){let t=ln(dn,pn,()=>!1);return e==="dark"||e==="system"&&t}i(Ot,"useDarkScheme");var cn="(prefers-color-scheme: dark)",Bt=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(cn):null,"media"),pn=i(()=>Bt()?.matches??!1,"prefersDark");function dn(e){let t=Bt();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(dn,"subscribe");function un(e,t){let[o,n]=[At(e),At(t)];return(Math.max(o,n)+.05)/(Math.min(o,n)+.05)}i(un,"contrast");function At(e){let t=[1,3,5].map(o=>{let n=Number.parseInt(e.slice(o,o+2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i(At,"luminance");import{useEffect as mn,useId as fn,useState as yn}from"react";import{jsx as K,jsxs as ue}from"react/jsx-runtime";var hn=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),gn={approved:"M6.5 12.5l3.6 3.6 7.4-8.2",review:"M12 7v5l3.2 2",expired:"M8 5h8M8 19h8M9 5c0 4 6 5 6 7s-6 3-6 7M15 5c0 4-6 5-6 7s6 3 6 7",rejected:"M8 8l8 8M16 8l-8 8"};function kn({outcome:e}){return ue("svg",{className:`sekyro-outcome sekyro-outcome--${e}`,viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[K("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"57",pathLength:"1"}),K("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),K("path",{className:"sekyro-outcome__glyph",d:gn[e],pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]})}i(kn,"OutcomeMark");function Sn({label:e,id:t,copied:o}){let[n,l]=yn(!1);return mn(()=>{if(!n)return;let s=setTimeout(()=>l(!1),1600);return()=>clearTimeout(s)},[n]),ue("button",{type:"button",className:`sekyro-reference${n?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>l(!0),()=>{})},children:[K("span",{"aria-live":"polite",children:n?o:e}),K("bdi",{dir:"ltr",children:t}),K(z,{name:"copy"})]})}i(Sn,"ReferenceLine");function Ke({step:e,locale:t,strings:o,className:n,onClose:l}){let s=P(t,o),{t:r}=s,a=fn(),c=te(),u=e.context.orgName,f=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",m;switch(e.display){case"policy_stop":{let h=e.failureReason??"";if(hn.has(Ze(h)))m=r("session.result.detailsMismatch",{org:u});else if(h==="device_velocity_exceeded")m=r("session.result.deviceVelocity",{org:u});else if(h==="capture_tampered")m=r("session.result.deviceStop");else if(h==="camera_unavailable")m=r("reasons.camera_unavailable",{org:u});else{let y=Je(h);m=y!==null?r(y,{org:u}):r("session.result.rejected.description")}break}case"cooldown":{let h=Qe(s.locale,e.retryAfter);m=h!==null?r(h.key,{time:h.time}):r("reasons.device_cooldown");break}case"platform_unsupported":m=r("result.platform_unsupported");break;case"attempts_exhausted":m=r("common.noAttemptsLeft");break;default:m=u!==""?r(`native.result.${f}`,{org:u}):r(`session.result.${f}.description`)}return ue("section",{className:`sekyro-result${n?` ${n}`:""}`,"aria-labelledby":a,"data-testid":"sekyro-result",children:[ue("div",{className:"sekyro-result__body",children:[K(kn,{outcome:e.display==="cooldown"?"review":f}),ue("div",{className:"sekyro-heading",children:[K("h2",{id:a,ref:c,tabIndex:-1,className:"sekyro-text-body",children:r(`session.result.${f}.title`)}),K("p",{className:"sekyro-text-muted",children:m})]}),K(Sn,{label:r("result.referenceLabel"),id:e.context.sessionId,copied:r("native.result.copied")})]}),l!==void 0?K("div",{className:"sekyro-actions",children:K(C,{full:!0,onClick:l,children:u!==""?r("native.result.back",{org:u}):r("native.close")})}):null]})}i(Ke,"VerificationResultScreen");import{Fragment as $e,jsx as p,jsxs as $}from"react/jsx-runtime";function Cn(e,t){let o=t?F.dark:F.light,n=t?F.roles.dark:F.roles.light,l=e.colors??{},s={},r=l.fg===o.fg&&l.surface===o.surface;return l.brand===o.brand&&l.surface===o.surface&&(s["--sekyro-color-brand-soft"]=n.brandSoft),r&&(s["--sekyro-color-line"]=n.line,s["--sekyro-color-line-subtle"]=n.lineSubtle,s["--sekyro-color-line-strong"]=n.lineStrong,s["--sekyro-color-sunken"]=n.sunken),l.fgMuted===o.fgMuted&&l.surface===o.surface&&(s["--sekyro-color-fg-subtle"]=n.fgSubtle),e.fontFamily===F.font&&(s["--sekyro-font-display"]=F.fontDisplay),s}i(Cn,"flowRoles");function We(e){let{verification:t,locale:o,strings:n,onStep:l,onResult:s}=e,{step:r,error:a}=xe(t);Dt(()=>{r!==null&&l?.(r)},[r,l]),Dt(()=>s===void 0?void 0:t.on("result",s),[t,s]);let c=Ot(e.colorScheme??"light"),u=Rt(r?.context.branding,e.theme,c),[f,m]=fe(!1),h=`sekyro-verification${c?" sekyro-verification--dark":""}${f?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,y=Ge(e.onClose);y.current=e.onClose;let N=Ge(r);N.current=r;let x=me(()=>{let g=N.current;y.current?.(g?.kind==="result"?{reason:"finished",result:g.result}:{reason:"cancelled"})},[]);return p(be,{theme:u,className:h,children:p(pe,{locale:o,...n!==void 0?{strings:n}:{},children:p("div",{dir:e.dir??(o==="ar"?"rtl":"ltr"),lang:o,className:"sekyro-flow",style:Cn(u,c),children:p(rt.Provider,{value:m,children:p(ve.Provider,{value:e.onClose!==void 0?x:void 0,children:p(wn,{...e,step:r,error:a,immersive:f})})})})})})}i(We,"SekyroVerification");function Nn(e,t){if(t===void 0)return null;let o=e,n=o[`session.processing.${t}.title`],l=o[`session.processing.${t}.description`];return typeof n=="string"&&n!==""&&typeof l=="string"&&l!==""?{title:n,description:l}:null}i(Nn,"processingCopyOf");function Pn({error:e,retry:t}){let{t:o}=P(),n=te();return $(ge,{tone:"danger",testId:"sekyro-error-notice",children:[p("span",{children:o(qe(e.kind))}),e.retryable?p(C,{ref:n,kind:"ghost",className:"sekyro-btn--start",onClick:t,children:o("common.retry")}):null]})}i(Pn,"CameraErrorNotice");function wn(e){let{step:t,error:o,slots:n,immersive:l}=e,s=P(),{t:r}=s,[a,c]=fe(!1),[u,f]=fe(0),[m,h]=fe(null),y=t?.context.purpose??"identity",N=e.verification,x=y==="human"||t?.context.cameraUnavailableHandled===!0,g=N.reportCameraUnavailable!==void 0&&x?d=>N.reportCameraUnavailable?.(d)??Promise.resolve():void 0,v=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,L=e.handoffUrl,T=me((d,E)=>g===void 0?void 0:p(V,{view:"NoCameraView",i18n:s,quiet:!0,cause:E,onRetry:d,...v?{onContinue:g}:{},...L!==void 0?{handoffUrl:L}:{}}),[s,N,x,v,L]),Z=me((d,E)=>p(pt,{start:d,context:E,human:y==="human",extra:E.canChooseFacing&&p(et,{value:E.facing,onChange:E.setFacing}),notice:E.permissionSettled&&E.permission==="denied"?T(d,"denied"):void 0}),[y,T]),b=me((d,E)=>{let j=bn(d.kind);return(j!==void 0?T(E,j):void 0)??$($e,{children:[p(Pn,{error:d,retry:E}),j!==void 0&&L!==void 0?p(V,{view:"DesktopHandoffView",i18n:s,quiet:!0,url:L}):null]})},[T,L,s]),B=Ge(""),I=e.livenessProps?.slots?.stageOverlay,G=me(d=>(d.guidance!==""&&!d.coached&&(B.current=d.guidance),p(dt,{testId:"sekyro-capture-stage",video:p("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.guidance!==""?d.guidance:B.current,note:d.note,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:r("native.close"),overlay:I?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:i(()=>f(E=>E+1),"onClose")},end:d.switchCamera&&p("button",{type:"button",className:"sekyro-glass",onClick:d.switchCamera,"aria-label":r("capture.switchCamera"),children:p(Xe,{})})})),[r,I]),A=vn();if(o!==null)return p(ge,{tone:"danger",children:p("span",{children:r(oe(o,s.strings))})});if(t===null)return p("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r("common.loading")});let{context:H}=t,Y=i(d=>{c(!0),d().finally(()=>c(!1))},"refresh"),ye=n?.header??p(xn,{context:H,headerId:A,end:n?.headerEnd}),w,X=m===t.key&&t.context.switchable!==void 0;if(X)w=p(V,{view:"LaneChoiceView",i18n:s,step:t,onClose:()=>h(null)});else switch(t.kind){case"phone_otp":w=p(Ie,{step:t});break;case"email_otp":w=p(Me,{step:t});break;case"method":w=p(Ae,{step:t});break;case"registry":w=p(Ne,{step:t});break;case"document":w=p(Be,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,E={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??Z,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:b}:{}},...u>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};w=p(je.Provider,{value:G,children:t.instructions==="icao"||t.livePhoto?.icao===!0?p(V,{view:"LivePhotoLiveness",i18n:s,step:t,livenessProps:E,sekyroIntro:d===void 0},u):p(ot,{...E},u)});break}case"portrait":w=$($e,{children:[t.retakeOnly?p(V,{view:"PortraitRetakeNotice",i18n:s,quiet:!0}):null,p(He,{step:t,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":w=p(V,{view:"ContactChoiceView",i18n:s,step:t});break;case"choice":w=p(V,{view:"GenericChoiceView",i18n:s,step:t});break;case"identity_summary":w=p(V,{view:"IdentitySummaryView",i18n:s,step:t});break;case"mobile_required":w=e.handoffUrl!==void 0?p(V,{view:"HandoffView",i18n:s,url:e.handoffUrl,refresh:t.refresh}):$(ge,{tone:"info",children:[p("strong",{children:r("handoff.title")}),p("span",{children:r("reasons.mobile_required")}),p(C,{kind:"ghost",disabled:a,onClick:()=>Y(t.refresh),children:r("common.refresh")})]});break;case"processing":{let d=Nn(s.strings,t.service);w=$("section",{className:"sekyro-stack sekyro-stack--1",role:"status","aria-live":"polite",children:[p("h2",{className:"sekyro-text-body",children:d?.title??r("session.processing.title")}),p("p",{className:"sekyro-text-muted",children:d?.description??r("session.processing.description")}),t.stalled?p(C,{kind:"ghost",disabled:a,onClick:()=>Y(t.refresh),children:r("common.refresh")}):null]});break}case"eid":w=p(Te,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";w=$("section",{className:"sekyro-stack sekyro-stack--1",children:[p("h2",{className:"sekyro-text-body",children:r(d?"needsApp.title":"unsupported.title")}),p("p",{children:d?H.orgName!==""?r("needsApp.description",{org:H.orgName}):r("needsApp.descriptionNoOrg"):r("unsupported.description",{org:H.orgName})})]});break}case"result":w=n?.result?.(t)??p(_n,{step:t});break;default:{let d=t;w=null}}return $($e,{children:[l?null:ye,!l&&t.kind!=="result"&&H.sections.length>1?p(In,{context:H,current:t.section,i18n:s}):null,!l&&!H.consentRecorded&&t.kind!=="result"?p(Tt,{i18n:s,purpose:H.purpose}):null,p(st,{pageKey:t.key,children:w}),!l&&!X&&t.kind!=="result"&&t.context.switchable!==void 0?p(V,{view:"LaneSwitch",i18n:s,step:t,onOpen:()=>h(t.key),quiet:!0},t.key):null,l?null:n?.footer!==void 0?n.footer:H.branding?.hideAttribution===!0?null:$("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[p(z,{name:"lock"}),r("shell.verifiedBy")]})]})}i(wn,"Body");function _n({step:e}){return p(ve.Consumer,{children:t=>p(Ke,{step:e,...t!==void 0?{onClose:t}:{}})})}i(_n,"ResultPage");function xn({context:e,headerId:t,end:o}){let{t:n}=P(),[l,s]=fe(!1),r=l?void 0:e.branding?.logoUrl,a=e.orgName!==""?e.orgName:n(e.returning?"returning.title":"session.title");return $("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:[$("div",{className:"sekyro-org",children:[p("span",{className:"sekyro-org__tile","aria-hidden":"true",children:r!==void 0?p("img",{className:"sekyro-org__logo",src:r,alt:"",onError:()=>s(!0)}):Lt(e.orgName)}),$("div",{className:"sekyro-org__text",children:[p("h1",{id:t,className:"sekyro-org__name",children:a}),p("p",{className:"sekyro-org__sub",children:n(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),o!=null?p("div",{className:"sekyro-org__end",children:o}):null,p(ve.Consumer,{children:c=>c!==void 0?p("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":n("native.close"),onClick:c,children:p(z,{name:"close"})}):null})]}),e.returning?p("p",{className:"sekyro-text-muted",children:n("returning.description")}):null]})}i(xn,"OrgHeader");function In({context:e,current:t,i18n:o}){let n=t===null?-1:e.sections.indexOf(t),l=e.progress,s=l!==void 0&&l.length===e.sections.length?l:e.sections.map((r,a)=>({id:r,state:a<n?"done":a===n?"current":"upcoming"}));return p("ol",{className:"sekyro-progress__bars","aria-label":o.t("session.progressLabel"),children:s.map(({id:r,state:a})=>p("li",{className:`sekyro-progress__bar${a==="done"?" is-done":a==="current"?" is-current":""}`,...a==="current"?{"aria-current":"step"}:{},children:p("span",{className:"sekyro-visually-hidden",children:o.strings[`section.${r}`]??r})},r))})}i(In,"SectionProgress");import{useEffect as Mn,useState as Ft}from"react";var En=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function Ye(e){let t=e??(typeof navigator>"u"?"":String(navigator.userAgent??""));return En.test(t)}i(Ye,"isInAppBrowser");import{jsx as le}from"react/jsx-runtime";function Tn(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i(Tn,"pageUrl");function Ln({hostedUrl:e,inAppBrowser:t,...o}){let[n,l]=Ft(t===!0);Mn(()=>{t===void 0&&Ye()&&l(!0)},[t]);let[s,r]=Ft(!1),a=o.handoffUrl??e??Tn();return n&&!s?le(be,{theme:Se(ke(void 0),o.theme),...o.className!==void 0?{className:o.className}:{},children:le(pe,{locale:o.locale,...o.strings!==void 0?{strings:o.strings}:{},children:le("div",{dir:o.dir??(o.locale==="ar"?"rtl":"ltr"),lang:o.locale,className:"sekyro-stack sekyro-stack--4",children:le(An,{url:a,onContinue:()=>r(!0)})})})}):le(We,{...o,...a!==""?{handoffUrl:a}:{}})}i(Ln,"SekyroFlow");function An({url:e,onContinue:t}){let o=P();return le(V,{view:"InAppBrowserPrompt",i18n:o,url:e,onContinue:t})}i(An,"Prompt");export{Be as DocumentCapture,Te as EidStep,Me as EmailOtpStep,Ne as IdNumberEntry,Ae as MethodChoice,Ao as NniEntry,Ie as PhoneOtpStep,He as PortraitCapture,Ln as SekyroFlow,We as SekyroVerification,pe as StepI18nProvider,Ke as VerificationResultScreen,Wt as arSteps,Yt as enSteps,Zt as formatTemplate,zt as frSteps,Ye as isInAppBrowser,$t as loadSekyroLocale,qt as resolveSekyroStrings,Gt as retakeHintStringKey,P as useStepI18n,xe as useVerificationStep};
2
+ import{a as gt}from"../chunk-4ZN7GIYK.js";import{a as D,d as st,e as pe,f as be,g as it,h as at}from"../chunk-Y37ZXFOA.js";import{a as lt}from"../chunk-EZ5TVL6P.js";import{a as dt}from"../chunk-YY76AMUA.js";import{a as ut,b as mt,c as ft,d as yt}from"../chunk-IDZNOWTO.js";import{a as z}from"../chunk-PYAJMHZH.js";import{b as tt,c as ot,e as nt,h as rt}from"../chunk-Z5UFPMM6.js";import{b as et}from"../chunk-LNZR3RXG.js";import{a as q,b as J,c as ve,d as ct,g as pt}from"../chunk-PTPTDOWD.js";import{a as oe}from"../chunk-VRDPGOXM.js";import{a as to,b as oo,c as no,d as ro,e as so,f as de,g as w}from"../chunk-WAVBS3GL.js";import{a as x,b as Ce}from"../chunk-K7YYCJUR.js";import{a as C,c as Je,i as jt,k as eo,l as Qe,m as Xe,n as je,t as ke,u as te}from"../chunk-34326C2I.js";import{a as i}from"../chunk-2KED7D2Q.js";import{useEffect as io,useState as ht}from"react";function xe(e){let[t,o]=ht(()=>e?.currentStep?.()??null),[n,a]=ht(null);return io(()=>{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,r=e.on("step",l=>{s&&o(l)});return e.run().then(l=>{s&&o(c=>c??l)},l=>{s&&a(l)}),()=>{s=!1,r()}},[e]),{step:t,error:n}}i(xe,"useVerificationStep");import{useEffect as _t,useId as lo,useMemo as xt,useRef as It,useState as ue}from"react";var ao="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",St;function kt(e){return St??(St=new Map(ao.split(" ").map(t=>{let[o,n]=t.slice(2).split("/");return[t.slice(0,2),[o,n]]}))),St.get(e.toUpperCase())}i(kt,"entryOf");function bt(e){return kt(e)?.[0]}i(bt,"dialCodeOf");function vt(e){return kt(e)?.[1]}i(vt,"nationalPrefixOf");import{Fragment as Pt,jsx as h,jsxs as U}from"react/jsx-runtime";var Ct=i((e,t)=>{if(e===void 0)return 0;let o=Date.parse(e)-t;return Number.isFinite(o)?Math.max(0,Math.ceil(o/1e3)):0},"secondsUntil"),co=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),po=["whatsapp","sms"],uo=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"]);function Nt(e){let t=e.replace(/[\s-]/g,""),o=t.startsWith("+")?t.slice(1):t;return/^\d{8,15}$/.test(o)?`+${o}`:null}i(Nt,"normalizedPhone");var mo=i(e=>String.fromCodePoint(...Array.from(e,t=>127397+t.charCodeAt(0))),"flagOf");function fo(e){let t=[];for(let o of e.phoneCountries??["MR"]){let n=bt(o);n!==void 0&&!t.some(a=>a.code===o)&&t.push({code:o,dial:`+${n}`})}return t}i(fo,"phoneCountriesOf");function yo(e,t){if(t===null||!e.startsWith(t.dial))return Nt(e);let o=e.slice(t.dial.length).replace(/\D/g,""),n=vt(t.code);return n!==void 0&&o.startsWith(n)&&(o=o.slice(n.length)),Nt(t.dial+o)}i(yo,"e164Of");function wt(e,t){return t.filter(n=>e.startsWith(n.dial)).sort((n,a)=>a.dial.length-n.dial.length)[0]?.code??t[0]?.code??null}i(wt,"countryFor");function go(e,t){let o=null;try{o=new Intl.DisplayNames([e],{type:"region"})}catch{}return new Map(t.map(n=>[n,o?.of(n)??n]))}i(go,"countryLabels");function ho({id:e,label:t,value:o,onChange:n,placeholder:a,countries:s,country:r,onCountry:l,locale:c,countryLabel:m}){let f=s.find(S=>S.code===r)?.dial??null,u=f===null||o.startsWith("+")&&!o.startsWith(f),g=u?o:o.slice(o.startsWith(f)?f.length:0).trim(),y=xt(()=>go(c,s.map(S=>S.code)),[c,s]),N=It(null);_t(()=>{let S=setTimeout(()=>N.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(S)},[]);let _=U("div",{className:"sekyro-phone",dir:"ltr",children:[u||r===null?null:U("span",{className:"sekyro-phone__dial",id:`${e}-dial`,children:[h("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:mo(r)}),f]}),h("input",{ref:N,id:e,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",...u?{}:{"aria-describedby":`${e}-dial`},placeholder:f===null?"+":a,value:g,onChange:S=>{let k=S.target.value.replace(/[^\d +]/g,"");n(k.startsWith("+")||f===null?k:f+k.replace(/\D/g,""))}})]});return U("div",{className:"sekyro-field",children:[h("label",{className:"sekyro-label",htmlFor:e,children:t}),s.length>1?U("div",{className:"sekyro-phone-row",children:[h("select",{className:"sekyro-phone__country","aria-label":m,value:r??"",onChange:S=>{let k=s.find(A=>A.code===S.target.value);k!==void 0&&(l(k.code),n(u&&o.startsWith("+")?o:k.dial+g.replace(/\D/g,"")))},children:s.map(S=>h("option",{value:S.code,children:`${y.get(S.code)??S.code} (${S.dial})`},S.code))}),_]}):_]})}i(ho,"PhoneField");function Ie({step:e,locale:t,strings:o,className:n,defaultPhone:a,onError:s}){let r=w(t,o),{t:l}=r,c=xt(()=>fo(e),[e.phoneCountries]),m=a??c[0]?.dial??"",[f,u]=ue(()=>wt(m,c)),g=c.map(b=>b.code).join(",");_t(()=>{if(f===null||!c.some(b=>b.code===f)){let b=wt(m,c);u(b);let T=N.current,_e=c.find(ee=>ee.code===b)?.dial;_e!==void 0&&S(ee=>T!==null&&ee.startsWith(T.dial)?_e+ee.slice(T.dial.length):ee.startsWith("+")?ee:_e)}},[g,m]);let y=c.find(b=>b.code===f)??null,N=It(y);y!==null&&(N.current=y);let[_,S]=ue(m),[k,A]=ue(""),[M,Z]=ue(!1),[v,B]=ue(null),I=e.phase==="verify",G=dt(I),L=lo(),H=i(async b=>{Z(!0),B(null);try{await b()}catch(T){B(oe(T,r.strings)),s?.(T)}finally{Z(!1)}},"run"),Y=po.filter(b=>(e.channels??[]).includes(b)),he=c.length===0&&!_.trim().startsWith("+")?null:yo(_,y),P=!e.needsPhone||he!==null,X=i((b,T=!1)=>{H(()=>e.send({...e.needsPhone&&(!T||_!==m)?{phone:he??_}:{},...b!==void 0?{channel:b}:{}}))},"send"),d=i(b=>{H(()=>e.verify(b))},"submitCode"),E=i(b=>{b.preventDefault(),I?d(k):Y.length<=1&&P&&X(Y[0])},"onSubmit"),j=Ct(e.codeExpiresAt,G),ce=Ct(e.resendAvailableAt,G),Se=I&&e.codeExpiresAt!==void 0&&j===0,Pe=i(b=>l(b==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[Jt,Qt]=l("otp.sentTo",{channel:Pe(e.channel)}).split("{number}"),Xt=e.reason==="otp_mismatch"?U(x,{tone:"danger",children:[h("span",{children:l("otp.reason_otp_mismatch")}),h("span",{children:Ce(r,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&uo.has(e.reason)?h(x,{tone:"warning",children:h("span",{children:l(`otp.reason_${e.reason}`)})}):null,qe=U(Pt,{children:[Xt,v!==null?h(x,{tone:"danger",children:h("span",{children:l(v)})}):null]});if(I){let b=Y.length===0;return U("form",{className:`sekyro-step sekyro-otp${n?` ${n}`:""}`,"aria-labelledby":L,onSubmit:E,noValidate:!0,children:[h(q,{id:L,title:l("otp.verifyTitle"),lead:U(Pt,{children:[Jt,h("bdi",{dir:"ltr",className:"sekyro-mono",children:e.sentToMasked}),Qt]})}),qe,U("div",{className:"sekyro-field",children:[h("label",{className:"sekyro-label",htmlFor:`${L}-code`,children:l("otp.codeLabel")}),h(lt,{id:`${L}-code`,value:k,invalid:e.reason==="otp_mismatch",onChange:T=>{A(T),T.length===6&&k.length!==6&&!M&&!e.attemptsExhausted&&d(T)}}),h("span",{className:`sekyro-help sekyro-otp-expiry${Se?" is-danger":""}`,"aria-hidden":!Se||void 0,children:Se?l("otp.expired"):l("otp.expiresIn",{time:co(j)})})]}),h("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:Se?l("otp.expired"):""}),U(J,{children:[h(C,{type:"submit",full:!0,disabled:M||k.length!==6||e.attemptsExhausted,"aria-busy":M||void 0,children:l("otp.verify")}),b?h("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:M||ce>0,onClick:()=>X(void 0,!0),children:ce>0?l("otp.resendIn",{seconds:ce}):l("otp.resend")}):ce>0?h("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:ce})}):h("div",{className:"sekyro-resend-row",children:Y.map(T=>h("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:M,onClick:()=>X(T,!0),children:l("otp.resendBy",{channel:Pe(T)})},T))})]})]})}return U("form",{className:`sekyro-step sekyro-otp${n?` ${n}`:""}`,"aria-labelledby":L,onSubmit:E,noValidate:!0,children:[h(q,{id:L,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),qe,e.needsPhone?h(ho,{id:`${L}-phone`,label:l("otp.phoneLabel"),value:_,onChange:S,placeholder:l(f==="MR"?"otp.phonePlaceholder":"otp.phonePlaceholderGeneric"),countries:c,country:f,onCountry:u,locale:r.locale,countryLabel:l("otp.countryLabel")}):h("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),h(J,{children:Y.length>0?U("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[h("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),Y.map((b,T)=>h(C,{kind:T===0?"primary":"ghost",full:!0,disabled:M||!P,"aria-busy":T===0&&M||void 0,onClick:()=>X(b),children:l("otp.sendBy",{channel:Pe(b)})},b))]}):h(C,{type:"submit",full:!0,disabled:M||!P,"aria-busy":M||void 0,children:l("otp.send")})})]})}i(Ie,"PhoneOtpStep");import{lazy as ko,Suspense as bo,useMemo as vo,useState as Co}from"react";import{Component as So}from"react";var Ee=class Ee extends So{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Ee,"LoadBoundary");var W=Ee;import{jsx as ne,jsxs as wo}from"react/jsx-runtime";var No={load:i(()=>import("../email-otp-view-2I346KUZ.js"),"load")};function Te({locale:e,strings:t,...o}){let n=w(e,t),[a,s]=Co(0),r=vo(()=>ko(()=>No.load().then(c=>({default:c.EmailOtpView}))),[a]),l=wo(x,{tone:"danger",children:[ne("span",{children:n.t("errors.network_error")}),ne(C,{kind:"ghost",onClick:()=>s(c=>c+1),children:n.t("common.retry")})]});return ne(W,{fallback:l,children:ne(bo,{fallback:ne("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:n.t("common.loading")}),children:ne(r,{...o,i18n:n})})},a)}i(Te,"EmailOtpStep");import{lazy as Po,Suspense as _o,useMemo as xo,useState as Io}from"react";import{jsx as re,jsxs as To}from"react/jsx-runtime";var Eo={load:i(()=>import("../eid-view-OZETO2IS.js"),"load")};function Me({locale:e,strings:t,...o}){let n=w(e,t),[a,s]=Io(0),r=xo(()=>Po(()=>Eo.load().then(c=>({default:c.EidView}))),[a]),l=To(x,{tone:"danger",children:[re("span",{children:n.t("errors.network_error")}),re(C,{kind:"ghost",onClick:()=>s(c=>c+1),children:n.t("common.retry")})]});return re(W,{fallback:l,children:re(_o,{fallback:re("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:n.t("common.loading")}),children:re(r,{...o,i18n:n})})},a)}i(Me,"EidStep");import{useMemo as Bo}from"react";import{lazy as Mo,Suspense as Ao,useMemo as Lo,useState as Ro}from"react";import{jsx as se,jsxs as Oo}from"react/jsx-runtime";var Vo={load:i(()=>import("../flow-views-KKP7HKFG.js"),"load")};function R({view:e,i18n:t,quiet:o,...n}){let[a,s]=Ro(0),r=Lo(()=>Mo(()=>Vo.load().then(c=>({default:c[e]}))),[e,a]),l=Oo(x,{tone:"danger",children:[se("span",{children:t.t("errors.network_error")}),se(C,{kind:"ghost",onClick:()=>s(c=>c+1),children:t.t("common.retry")})]});return se(W,{fallback:l,children:se(Ao,{fallback:o===!0?null:se("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:se(r,{...n,i18n:t})})},a)}i(R,"Flow");import{jsx as Ae,jsxs as Do}from"react/jsx-runtime";function Le({step:e,locale:t,strings:o,className:n,onError:a}){let s=w(t,o),{busy:r,error:l,run:c}=ft(s,a),m=Bo(()=>e.choice.options.flatMap(u=>{let g=mt(u,s),y=ut[u.service];return g===null?[]:[{id:u.id,label:g,glyph:y&&Ae(z,{name:y})}]}),[e.choice.options,s]),f=e.choice.options.find(u=>u.service==="national_eid");return Do("div",{className:n,children:[Ae(nt,{title:s.t("method.title"),description:s.t("method.description"),options:m,busy:r,error:l,focus:!0,testId:"sekyro-method",onChoose:u=>c(()=>e.choose(u))}),f?.nationalEid?.afterPass==="continue"?Ae(R,{view:"EidContinueHint",i18n:s,provider:f.nationalEid.providerName,quiet:!0}):null]})}i(Le,"MethodChoice");import{isValidNni as Fo,normalizeNni as Et}from"@sekyro/web";import{useId as Ho,useState as Re}from"react";import{Fragment as Go,jsx as V,jsxs as ie}from"react/jsx-runtime";var Uo=new Set(["nni_not_found","registry_record_not_found"]),Ko=new Set(["nni_invalid","id_number_invalid"]);function Ne({step:e,locale:t,strings:o,className:n,onError:a}){let s=w(t,o),{t:r}=s,[l,c]=Re(""),[m,f]=Re(!1),[u,g]=Re(null),y=Ho(),N=e.attemptsExhausted,_=i(async G=>{f(!0),g(null);try{await G()}catch(L){g(oe(L,s.strings)),a?.(L)}finally{f(!1)}},"run"),S=i(G=>{if(G.preventDefault(),e.source!=="typed"){_(()=>e.confirm());return}let L=Et(l);if(!/^\d{10}$/.test(L))return g("population.invalid");if(!Fo(L))return g("population.reason_id_number_invalid");_(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(L):e.submitNni(L))},"onSubmit"),k=Ce(s,e.attemptsRemaining,N),A=e.reason!==void 0&&Uo.has(e.reason),M=e.reason!==void 0&&Ko.has(e.reason),Z=ie(Go,{children:[e.reason==="registry_unavailable"?ie(x,{tone:"warning",children:[V("span",{children:r("population.reason_registry_unavailable")}),V("span",{children:k})]}):null,A&&e.canUseDocument?ie(x,{tone:"warning",children:[V("span",{children:r("population.reason_registry_record_not_found_or_document")}),V("span",{children:k}),V(C,{kind:"ghost",disabled:m,onClick:()=>{_(()=>e.useDocument())},children:r("population.useDocument")})]}):null,A&&!e.canUseDocument||M?ie(x,{tone:"danger",children:[V("span",{children:r(A?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),V("span",{children:k})]}):null,N&&e.reason===void 0?V(x,{tone:"danger",children:V("span",{children:k})}):null,u!==null?V(x,{tone:"danger",children:V("span",{children:r(u)})}):null]}),[v,B,I]=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 ie("form",{className:`sekyro-step${n?` ${n}`:""}`,"aria-labelledby":y,onSubmit:S,noValidate:!0,children:[V(q,{id:y,title:r(v),lead:r(B)}),Z,e.source==="typed"?ie("div",{className:"sekyro-field",children:[V("label",{className:"sekyro-label",htmlFor:`${y}-id-number`,children:r("population.label")}),V("input",{id:`${y}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:r("population.placeholder"),value:l,"aria-describedby":`${y}-id-number-help`,"aria-invalid":u==="population.invalid"||u==="population.reason_id_number_invalid"||void 0,onChange:G=>{g(null),c(Et(G.target.value).replace(/\D/g,"").slice(0,10))}}),V("span",{id:`${y}-id-number-help`,className:"sekyro-help",children:r("population.helper")})]}):null,V(J,{children:N?null:V(C,{type:"submit",full:!0,disabled:m,"aria-busy":m||void 0,children:r(I)})})]})}i(Ne,"IdNumberEntry");function $o(e){return Ne(e)}i($o,"NniEntry");import{acceptedIssuers as Jo,acceptedTypesFor as Qo,warmDocumentCapture as Xo}from"@sekyro/web";import{lazy as jo,Suspense as en,useEffect as tn,useMemo as on,useState as Rt}from"react";import{acceptedIssuers as Wo,acceptedTypesFor as Ve}from"@sekyro/web";import{useEffect as Tt,useId as Yo,useMemo as Mt,useState as Oe}from"react";import{jsx as O,jsxs as ae}from"react/jsx-runtime";var At=i(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),zo=i(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),Zo=220;function qo(e,t,o=[]){let n=null;try{n=new Intl.DisplayNames([e],{type:"region"})}catch{}let a=t.map(l=>({code:l,name:n?.of(l)??l})),s=new Intl.Collator(e),r=i(l=>{let c=o.indexOf(l);return c<0?o.length:c},"rank");return a.sort((l,c)=>r(l.code)-r(c.code)||s.compare(l.name,c.name))}i(qo,"countryNames");function Lt({step:e,i18n:t,issuer:o,onPicked:n}){let{t:a,locale:s}=t,r=Mt(()=>Wo(e.documents),[e.documents]),l=Mt(()=>qo(s,r,Object.keys(e.documents.byIssuer??{})),[s,r,e.documents]),c=r.length===1?r[0]:null,[m,f]=Oe(o??c),[u,g]=Oe(""),[y,N]=Oe(null),_=Yo(),S=c===null?[]:Ve(e.documents,c),k=c!==null&&S.length===1?S[0]:null;Tt(()=>{c!==null&&k!==null&&e.selectDocument(c,k)},[c,k]);let A=i((v,B)=>{e.selectDocument(v,B),n?.()},"pick"),M=i(v=>{let B=Ve(e.documents,v);B.length===1?A(v,B[0]):f(v)},"chooseIssuer");if(Tt(()=>{if(y===null||m===null)return;let v=setTimeout(()=>A(m,y),Zo);return()=>clearTimeout(v)},[y]),k!==null)return null;if(m===null){let v=At(u.trim()),B=v===""?l:l.filter(I=>At(I.name).includes(v)||I.code.toLowerCase()===v);return ae("section",{className:"sekyro-step",children:[O(q,{title:a("doc.countryTitle"),lead:a("doc.pickDescription")}),ae("div",{className:"sekyro-field",children:[O("label",{className:"sekyro-label",htmlFor:_,children:a("doc.countryLabel")}),O("input",{id:_,type:"search",className:"sekyro-input",placeholder:a("doc.countrySearch"),value:u,onChange:I=>g(I.target.value)})]}),B.length===0?O("p",{className:"sekyro-text-muted",children:a("doc.noCountryMatch")}):O("ul",{className:"sekyro-rows",children:B.map(I=>O("li",{children:ae("button",{type:"button",className:"sekyro-row-btn",onClick:()=>M(I.code),children:[O("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:zo(I.code)}),I.name]})},I.code))}),O(J,{children:null})]})}let Z=Ve(e.documents,m);return ae("section",{className:"sekyro-step",children:[O(q,{title:a("doc.pickTitle"),lead:a("native.doc.holdIt")}),O("div",{className:"sekyro-choices",children:Z.map(v=>ae("button",{type:"button",className:"sekyro-card","aria-pressed":y===v,disabled:y!==null&&y!==v,onClick:()=>N(v),children:[O(z,{name:v==="passport"?"passport":"card"}),ae("span",{className:"sekyro-card__body",children:[O("span",{className:"sekyro-card__title",children:a(`doc.type.${v}`)}),O("span",{className:"sekyro-card__sub",children:a(`doc.sub.${v}`)})]}),O("span",{className:"sekyro-radio","aria-hidden":"true"})]},v))}),r.length>1?O("button",{type:"button",className:"sekyro-link",onClick:()=>{f(null),N(null)},children:a("native.doc.changeCountry")}):null,O(J,{children:null})]})}i(Lt,"DocumentPicker");import{jsx as Q,jsxs as rn}from"react/jsx-runtime";var nn={load:i(()=>import("../document-capture-view-LR4OLZPG.js"),"load")};function Be({step:e,locale:t,strings:o,className:n,liveMrz:a}){let s=w(t,o),[r,l]=Rt(0),[c,m]=Rt(null),f=Jo(e.documents).length>1,u=e.issuer!==null&&Qo(e.documents,e.issuer).length>1,g=on(()=>jo(()=>nn.load().then(N=>({default:N.DocumentCaptureView}))),[r]);tn(()=>{Xo()},[]);let y=rn(x,{tone:"danger",children:[Q("span",{children:s.t("errors.network_error")}),Q(C,{kind:"ghost",onClick:()=>l(N=>N+1),children:s.t("doc.retryCamera")})]});return Q("div",{className:n,children:e.documentType===null||e.issuer===null||c!==null?Q(Lt,{step:e,i18n:s,...c==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>m(null)}):Q(W,{fallback:y,children:Q(en,{fallback:Q("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:Q(g,{step:e,i18n:s,liveMrz:a,...f?{onChangeCountry:i(()=>m("country"),"onChangeCountry")}:{},...u?{onChangeDocument:i(()=>m("document"),"onChangeDocument")}:{}})})},r)})}i(Be,"DocumentCapture");import{warmPortraitCapture as sn}from"@sekyro/web";import{Component as an,lazy as ln,Suspense as cn,useEffect as pn,useMemo as dn,useState as un}from"react";import{jsx as F,jsxs as Fe}from"react/jsx-runtime";var mn={load:i(()=>import("../portrait-capture-view-TNKPPDYM.js"),"load")},Ue=class Ue extends an{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Ue,"LoadBoundary");var De=Ue;function fn({step:e,i18n:t}){let{t:o}=t,n=te();return Fe("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[F("h2",{ref:n,tabIndex:-1,className:"sekyro-text-body",children:o(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?F("p",{className:"sekyro-text-muted",children:o("portrait.reviewDescription")}):null,e.uploadFailed?Fe(x,{tone:"danger",children:[F("span",{children:o("portrait.uploadFailed")}),F(C,{kind:"ghost",onClick:()=>{e.resubmit()},children:o("portrait.sendAgain")})]}):F("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:o("portrait.matching")})]})}i(fn,"MatchPhase");function He({step:e,locale:t,strings:o,className:n,assetBaseUrl:a}){let s=w(t,o),[r,l]=un(0),c=dn(()=>ln(()=>mn.load().then(f=>({default:f.PortraitCaptureView}))),[r]);if(pn(()=>{e.phase==="capture"&&sn()},[e.phase]),e.phase==="match")return F("div",{className:n,children:F(fn,{step:e,i18n:s})});let m=Fe(x,{tone:"danger",children:[F("span",{children:s.t("errors.network_error")}),F(C,{kind:"ghost",onClick:()=>l(f=>f+1),children:s.t("portrait.retryCamera")})]});return F("div",{className:n,children:F(De,{fallback:m,children:F(cn,{fallback:F("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:F(c,{step:e,i18n:s,...a!==void 0?{assetBaseUrl:a}:{}})})},r)})}i(He,"PortraitCapture");import{cameraUnavailableCauseOf as An}from"@sekyro/web";import{useCallback as ye,useEffect as Zt,useId as Ln,useRef as Ye,useState as ge}from"react";var me={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"}}},yn=["danger","success","warning","info"];function Ke(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}i(Ke,"channel");function Vt(e){let t=Ke(parseInt(e.slice(1,3),16)),o=Ke(parseInt(e.slice(3,5),16)),n=Ke(parseInt(e.slice(5,7),16));return .2126*t+.7152*o+.0722*n}i(Vt,"luminance");function gn(e,t){let o=Vt(e),n=Vt(t),a=Math.max(o,n),s=Math.min(o,n);return(a+.05)/(s+.05)}i(gn,"contrastRatio");function Ot(e,t){return Math.min(...yn.map(o=>gn(me[e][o].fg,t)))}i(Ot,"worstAgainst");function Bt(e,t,o){return Math.min(Ot(e,t),Ot(e,o))}i(Bt,"worstStatusContrast");function Dt(e,t){return Bt("light",e,t)>=Bt("dark",e,t)?"light":"dark"}i(Dt,"statusSchemeFor");import{useId as hn,useState as Sn}from"react";import{jsx as we,jsxs as Ft}from"react/jsx-runtime";var kn=["intro","data","processing","sharing","retention"];function Ht({i18n:e,purpose:t="identity"}){let{t:o}=e,[n,a]=Sn(!1),s=hn(),[r,l=""]=o("consent.short").split("{terms}");return Ft("section",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-consent",children:[Ft("p",{className:"sekyro-text-muted",children:[r,we("button",{type:"button",className:"sekyro-link","aria-expanded":n,"aria-controls":s,onClick:()=>a(c=>!c),children:o("consent.termsLink")}),l]}),we("div",{id:s,hidden:!n,className:"sekyro-stack sekyro-stack--1 sekyro-text-muted","data-testid":"sekyro-consent-terms",children:t==="human"?we(R,{view:"HumanConsentTerms",i18n:e,quiet:!0}):kn.map(c=>we("p",{children:o(`consent.terms.${c}`)},c))})]})}i(Ht,"ConsentNotice");function Ut(e){let t=e.trim().split(/\s+/).filter(n=>n!=="");return(t.length>=2?[t[0],t[1]].map(n=>Array.from(n??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(Ut,"initials");import{useSyncExternalStore as bn}from"react";var Gt=i(e=>({colors:{...e?D.dark:D.light},radius:D.radiusLg,fontFamily:D.font}),"brandTheme"),Us=Gt(!1),Kt=/^#[0-9a-f]{6}$/i;function $e(e,t,o){if(t)return null;let n=pe(e).colors,a=o?.colors?.bg??n?.bg,s=o?.colors?.surface??n?.surface;return a===void 0&&s===void 0||a!==void 0&&!Kt.test(a)||s!==void 0&&!Kt.test(s)?null:Dt(a??D.light.bg,s??D.light.surface)}i($e,"partnerStatusScheme");function Wt(e,t,o){let n=pe(e);if(o&&n.colors!==void 0){let{brand:a,brandFg:s}=n.colors;a!==void 0&&wn(a,D.dark.bg)>=3?n.colors={brand:a,ring:a,...s!==void 0?{brandFg:s}:{}}:delete n.colors}if($e(e,o,t)==="dark"){let a=me.dark;n.colors={...n.colors,danger:a.danger.base,success:a.success.base,warning:a.warning.fg}}return be(Gt(o),n,st(t))}i(Wt,"verificationTheme");function Yt(e){let t=bn(Nn,Cn,()=>!1);return e==="dark"||e==="system"&&t}i(Yt,"useDarkScheme");var vn="(prefers-color-scheme: dark)",zt=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(vn):null,"media"),Cn=i(()=>zt()?.matches??!1,"prefersDark");function Nn(e){let t=zt();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i(Nn,"subscribe");function wn(e,t){let[o,n]=[$t(e),$t(t)];return(Math.max(o,n)+.05)/(Math.min(o,n)+.05)}i(wn,"contrast");function $t(e){let t=[1,3,5].map(o=>{let n=Number.parseInt(e.slice(o,o+2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i($t,"luminance");import{useEffect as Pn,useId as _n,useState as xn}from"react";import{jsx as K,jsxs as fe}from"react/jsx-runtime";var In=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),En={approved:"M6.5 12.5l3.6 3.6 7.4-8.2",review:"M12 7v5l3.2 2",expired:"M8 5h8M8 19h8M9 5c0 4 6 5 6 7s-6 3-6 7M15 5c0 4-6 5-6 7s6 3 6 7",rejected:"M8 8l8 8M16 8l-8 8"};function Tn({outcome:e}){return fe("svg",{className:`sekyro-outcome sekyro-outcome--${e}`,viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[K("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"57",pathLength:"1"}),K("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),K("path",{className:"sekyro-outcome__glyph",d:En[e],pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]})}i(Tn,"OutcomeMark");function Mn({label:e,id:t,copied:o}){let[n,a]=xn(!1);return Pn(()=>{if(!n)return;let s=setTimeout(()=>a(!1),1600);return()=>clearTimeout(s)},[n]),fe("button",{type:"button",className:`sekyro-reference${n?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[K("span",{"aria-live":"polite",children:n?o:e}),K("bdi",{dir:"ltr",children:t}),K(z,{name:"copy"})]})}i(Mn,"ReferenceLine");function Ge({step:e,locale:t,strings:o,className:n,onClose:a}){let s=w(t,o),{t:r}=s,l=_n(),c=te(),m=e.context.orgName,f=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",u;switch(e.display){case"policy_stop":{let g=e.failureReason??"";if(In.has(Je(g)))u=r("session.result.detailsMismatch",{org:m});else if(g==="device_velocity_exceeded")u=r("session.result.deviceVelocity",{org:m});else if(g==="capture_tampered")u=r("session.result.deviceStop");else if(g==="camera_unavailable")u=r("reasons.camera_unavailable",{org:m});else{let y=Xe(g);u=y!==null?r(y,{org:m}):r("session.result.rejected.description")}break}case"cooldown":{let g=je(s.locale,e.retryAfter);u=g!==null?r(g.key,{time:g.time}):r("reasons.device_cooldown");break}case"platform_unsupported":u=r("result.platform_unsupported");break;case"attempts_exhausted":u=r("common.noAttemptsLeft");break;default:u=m!==""?r(`native.result.${f}`,{org:m}):r(`session.result.${f}.description`)}return fe("section",{className:`sekyro-result${n?` ${n}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[fe("div",{className:"sekyro-result__body",children:[K(Tn,{outcome:e.display==="cooldown"?"review":f}),fe("div",{className:"sekyro-heading",children:[K("h2",{id:l,ref:c,tabIndex:-1,className:"sekyro-text-body",children:r(`session.result.${f}.title`)}),K("p",{className:"sekyro-text-muted",children:u})]}),K(Mn,{label:r("result.referenceLabel"),id:e.context.sessionId,copied:r("native.result.copied")})]}),a!==void 0?K("div",{className:"sekyro-actions",children:K(C,{full:!0,onClick:a,children:m!==""?r("native.result.back",{org:m}):r("native.close")})}):null]})}i(Ge,"VerificationResultScreen");import{Fragment as We,jsx as p,jsxs as $}from"react/jsx-runtime";function Rn(e,t,o){let n=t?D.dark:D.light,a=t?D.roles.dark:D.roles.light,s=e.colors??{},r={},l=s.fg===n.fg&&s.surface===n.surface;if(s.brand===n.brand&&s.surface===n.surface&&(r["--sekyro-color-brand-soft"]=a.brandSoft),l&&(r["--sekyro-color-line"]=a.line,r["--sekyro-color-line-subtle"]=a.lineSubtle,r["--sekyro-color-line-strong"]=a.lineStrong,r["--sekyro-color-sunken"]=a.sunken),s.fgMuted===n.fgMuted&&s.surface===n.surface&&(r["--sekyro-color-fg-subtle"]=a.fgSubtle),e.fontFamily===D.font&&(r["--sekyro-font-display"]=D.fontDisplay),o!==null){let c=me[o];r["--sekyro-color-danger-soft"]=c.danger.soft,r["--sekyro-color-success-soft"]=c.success.soft,r["--sekyro-color-warning-soft"]=c.warning.soft}return r}i(Rn,"flowRoles");function ze(e){let{verification:t,locale:o,strings:n,onStep:a,onResult:s}=e,{step:r,error:l}=xe(t);Zt(()=>{r!==null&&a?.(r)},[r,a]),Zt(()=>s===void 0?void 0:t.on("result",s),[t,s]);let c=Yt(e.colorScheme??"light"),m=r?.context.branding,f=Wt(m,e.theme,c),[u,g]=ge(!1),y=`sekyro-verification${c?" sekyro-verification--dark":""}${u?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,N=Ye(e.onClose);N.current=e.onClose;let _=Ye(r);_.current=r;let S=ye(()=>{let k=_.current;N.current?.(k?.kind==="result"?{reason:"finished",result:k.result}:{reason:"cancelled"})},[]);return p(at,{theme:f,className:y,children:p(de,{locale:o,...n!==void 0?{strings:n}:{},children:p("div",{dir:e.dir??(o==="ar"?"rtl":"ltr"),lang:o,className:"sekyro-flow",style:Rn(f,c,$e(m,c,e.theme)),children:p(ct.Provider,{value:g,children:p(ve.Provider,{value:e.onClose!==void 0?S:void 0,children:p(Bn,{...e,step:r,error:l,immersive:u})})})})})})}i(ze,"SekyroVerification");function Vn(e,t){if(t===void 0)return null;let o=e,n=o[`session.processing.${t}.title`],a=o[`session.processing.${t}.description`];return typeof n=="string"&&n!==""&&typeof a=="string"&&a!==""?{title:n,description:a}:null}i(Vn,"processingCopyOf");function On({error:e,retry:t}){let{t:o}=w(),n=te();return $(ke,{tone:"danger",testId:"sekyro-error-notice",children:[p("span",{children:o(Qe(e.kind))}),e.retryable?p(C,{ref:n,kind:"ghost",className:"sekyro-btn--start",onClick:t,children:o("common.retry")}):null]})}i(On,"CameraErrorNotice");function Bn(e){let{step:t,error:o,slots:n,immersive:a}=e,s=w(),{t:r}=s,[l,c]=ge(!1),[m,f]=ge(0),[u,g]=ge(null),y=t?.context.purpose??"identity",N=e.verification,_=y==="human"||t?.context.cameraUnavailableHandled===!0,S=N.reportCameraUnavailable!==void 0&&_?d=>N.reportCameraUnavailable?.(d)??Promise.resolve():void 0,k=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,A=e.handoffUrl,M=ye((d,E)=>S===void 0?void 0:p(R,{view:"NoCameraView",i18n:s,quiet:!0,cause:E,onRetry:d,...k?{onContinue:S}:{},...A!==void 0?{handoffUrl:A}:{}}),[s,N,_,k,A]),Z=ye((d,E)=>p(yt,{start:d,context:E,human:y==="human",extra:E.canChooseFacing&&p(ot,{value:E.facing,onChange:E.setFacing}),notice:E.permissionSettled&&E.permission==="denied"?M(d,"denied"):void 0}),[y,M]),v=ye((d,E)=>{let j=An(d.kind);return(j!==void 0?M(E,j):void 0)??$(We,{children:[p(On,{error:d,retry:E}),j!==void 0&&A!==void 0?p(R,{view:"DesktopHandoffView",i18n:s,quiet:!0,url:A}):null]})},[M,A,s]),B=Ye(""),I=e.livenessProps?.slots?.stageOverlay,G=ye(d=>(d.guidance!==""&&!d.coached&&(B.current=d.guidance),p(gt,{testId:"sekyro-capture-stage",video:p("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.guidance!==""?d.guidance:B.current,note:d.note,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:r("native.close"),overlay:I?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:i(()=>f(E=>E+1),"onClose")},end:d.switchCamera&&p("button",{type:"button",className:"sekyro-glass",onClick:d.switchCamera,"aria-label":r("capture.switchCamera"),children:p(et,{})})})),[r,I]),L=Ln();if(o!==null)return p(ke,{tone:"danger",children:p("span",{children:r(oe(o,s.strings))})});if(t===null)return p("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r("common.loading")});let{context:H}=t,Y=i(d=>{c(!0),d().finally(()=>c(!1))},"refresh"),he=n?.header??p(Fn,{context:H,headerId:L,end:n?.headerEnd}),P,X=u===t.key&&t.context.switchable!==void 0;if(X)P=p(R,{view:"LaneChoiceView",i18n:s,step:t,onClose:()=>g(null)});else switch(t.kind){case"phone_otp":P=p(Ie,{step:t});break;case"email_otp":P=p(Te,{step:t});break;case"method":P=p(Le,{step:t});break;case"registry":P=p(Ne,{step:t});break;case"document":P=p(Be,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,E={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??Z,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:v}:{}},...m>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:s.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};P=p(tt.Provider,{value:G,children:t.instructions==="icao"||t.livePhoto?.icao===!0?p(R,{view:"LivePhotoLiveness",i18n:s,step:t,livenessProps:E,sekyroIntro:d===void 0},m):p(rt,{...E},m)});break}case"portrait":P=$(We,{children:[t.retakeOnly?p(R,{view:"PortraitRetakeNotice",i18n:s,quiet:!0}):null,p(He,{step:t,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":P=p(R,{view:"ContactChoiceView",i18n:s,step:t});break;case"choice":P=p(R,{view:"GenericChoiceView",i18n:s,step:t});break;case"identity_summary":P=p(R,{view:"IdentitySummaryView",i18n:s,step:t});break;case"mobile_required":P=e.handoffUrl!==void 0?p(R,{view:"HandoffView",i18n:s,url:e.handoffUrl,refresh:t.refresh}):$(ke,{tone:"info",children:[p("strong",{children:r("handoff.title")}),p("span",{children:r("reasons.mobile_required")}),p(C,{kind:"ghost",disabled:l,onClick:()=>Y(t.refresh),children:r("common.refresh")})]});break;case"processing":{let d=Vn(s.strings,t.service);P=$("section",{className:"sekyro-stack sekyro-stack--1",role:"status","aria-live":"polite",children:[p("h2",{className:"sekyro-text-body",children:d?.title??r("session.processing.title")}),p("p",{className:"sekyro-text-muted",children:d?.description??r("session.processing.description")}),t.stalled?p(C,{kind:"ghost",disabled:l,onClick:()=>Y(t.refresh),children:r("common.refresh")}):null]});break}case"eid":P=p(Me,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";P=$("section",{className:"sekyro-stack sekyro-stack--1",children:[p("h2",{className:"sekyro-text-body",children:r(d?"needsApp.title":"unsupported.title")}),p("p",{children:d?H.orgName!==""?r("needsApp.description",{org:H.orgName}):r("needsApp.descriptionNoOrg"):r("unsupported.description",{org:H.orgName})})]});break}case"result":P=n?.result?.(t)??p(Dn,{step:t});break;default:{let d=t;P=null}}return $(We,{children:[a?null:he,!a&&t.kind!=="result"&&H.sections.length>1?p(Hn,{context:H,current:t.section,i18n:s}):null,!a&&!H.consentRecorded&&t.kind!=="result"?p(Ht,{i18n:s,purpose:H.purpose}):null,p(pt,{pageKey:t.key,children:P}),!a&&!X&&t.kind!=="result"&&t.context.switchable!==void 0?p(R,{view:"LaneSwitch",i18n:s,step:t,onOpen:()=>g(t.key),quiet:!0},t.key):null,a?null:n?.footer!==void 0?n.footer:H.branding?.hideAttribution===!0?null:$("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[p(z,{name:"lock"}),r("shell.verifiedBy")]})]})}i(Bn,"Body");function Dn({step:e}){return p(ve.Consumer,{children:t=>p(Ge,{step:e,...t!==void 0?{onClose:t}:{}})})}i(Dn,"ResultPage");function Fn({context:e,headerId:t,end:o}){let{t:n}=w(),[a,s]=ge(!1),r=a?void 0:e.branding?.logoUrl,l=e.orgName!==""?e.orgName:n(e.returning?"returning.title":"session.title");return $("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:[$("div",{className:"sekyro-org",children:[p("span",{className:"sekyro-org__tile","aria-hidden":"true",children:r!==void 0?p("img",{className:"sekyro-org__logo",src:r,alt:"",onError:()=>s(!0)}):Ut(e.orgName)}),$("div",{className:"sekyro-org__text",children:[p("h1",{id:t,className:"sekyro-org__name",children:l}),p("p",{className:"sekyro-org__sub",children:n(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),o!=null?p("div",{className:"sekyro-org__end",children:o}):null,p(ve.Consumer,{children:c=>c!==void 0?p("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":n("native.close"),onClick:c,children:p(z,{name:"close"})}):null})]}),e.returning?p("p",{className:"sekyro-text-muted",children:n("returning.description")}):null]})}i(Fn,"OrgHeader");function Hn({context:e,current:t,i18n:o}){let n=t===null?-1:e.sections.indexOf(t),a=e.progress,s=a!==void 0&&a.length===e.sections.length?a:e.sections.map((r,l)=>({id:r,state:l<n?"done":l===n?"current":"upcoming"}));return p("ol",{className:"sekyro-progress__bars","aria-label":o.t("session.progressLabel"),children:s.map(({id:r,state:l})=>p("li",{className:`sekyro-progress__bar${l==="done"?" is-done":l==="current"?" is-current":""}`,...l==="current"?{"aria-current":"step"}:{},children:p("span",{className:"sekyro-visually-hidden",children:o.strings[`section.${r}`]??r})},r))})}i(Hn,"SectionProgress");import{useEffect as Kn,useState as qt}from"react";var Un=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function Ze(e){let t=e??(typeof navigator>"u"?"":String(navigator.userAgent??""));return Un.test(t)}i(Ze,"isInAppBrowser");import{jsx as le}from"react/jsx-runtime";function $n(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i($n,"pageUrl");function Gn({hostedUrl:e,inAppBrowser:t,...o}){let[n,a]=qt(t===!0);Kn(()=>{t===void 0&&Ze()&&a(!0)},[t]);let[s,r]=qt(!1),l=o.handoffUrl??e??$n();return n&&!s?le(it,{theme:be(pe(void 0),o.theme),...o.className!==void 0?{className:o.className}:{},children:le(de,{locale:o.locale,...o.strings!==void 0?{strings:o.strings}:{},children:le("div",{dir:o.dir??(o.locale==="ar"?"rtl":"ltr"),lang:o.locale,className:"sekyro-stack sekyro-stack--4",children:le(Wn,{url:l,onContinue:()=>r(!0)})})})}):le(ze,{...o,...l!==""?{handoffUrl:l}:{}})}i(Gn,"SekyroFlow");function Wn({url:e,onContinue:t}){let o=w();return le(R,{view:"InAppBrowserPrompt",i18n:o,url:e,onContinue:t})}i(Wn,"Prompt");export{Be as DocumentCapture,Me as EidStep,Te as EmailOtpStep,Ne as IdNumberEntry,Le as MethodChoice,$o as NniEntry,Ie as PhoneOtpStep,He as PortraitCapture,Gn as SekyroFlow,ze as SekyroVerification,de as StepI18nProvider,Ge as VerificationResultScreen,to as arSteps,oo as enSteps,ro as formatTemplate,no as frSteps,Ze as isInAppBrowser,jt as loadSekyroLocale,so as resolveSekyroStrings,eo as retakeHintStringKey,w as useStepI18n,xe as useVerificationStep};
@@ -213,6 +213,9 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
213
213
 
214
214
  /* Notices: soft tinted blocks, no heavy border. */
215
215
  .sekyro-root .sekyro-notice { border-color: transparent; border-radius: var(--sekyro-radius); font: var(--sekyro-type-flow-label) var(--sekyro-font); }
216
+ /* On a partner page the notices sit on the chosen standard status set's soft surface (set by the flow); else today's tint. */
217
+ .sekyro-root .sekyro-notice--warning { background: var(--sekyro-color-warning-soft, color-mix(in srgb, var(--sekyro-color-warning) 10%, var(--sekyro-color-surface))); }
218
+ .sekyro-root .sekyro-notice--danger { background: var(--sekyro-color-danger-soft, color-mix(in srgb, var(--sekyro-color-danger) 8%, var(--sekyro-color-surface))); }
216
219
 
217
220
  /* ── Fields: white with a hairline; a 2px ring on focus (red with an error) ── */
218
221
  .sekyro-root .sekyro-label { font: var(--sekyro-type-flow-label) var(--sekyro-font); color: var(--sekyro-color-fg-muted); }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sekyro/react",
3
- "version": "0.1.0-rc.12",
3
+ "version": "0.1.0-rc.13",
4
4
  "description": "Sekyro AI React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (ar/fr/en, RTL-safe, WCAG AAA defaults)",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
@@ -74,7 +74,7 @@
74
74
  "strings:steps": "node scripts/gen-step-strings.mjs"
75
75
  },
76
76
  "peerDependencies": {
77
- "@sekyro/web": "^0.1.0-rc.14 || ^0.2.0-rc.0",
77
+ "@sekyro/web": "^0.1.0-rc.15 || ^0.2.0-rc.0",
78
78
  "react": ">=18.2",
79
79
  "react-dom": ">=18.2"
80
80
  },
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.12",
101
- "bom-ref": "@sekyro/react@0.1.0-rc.12",
100
+ "version": "0.1.0-rc.13",
101
+ "bom-ref": "@sekyro/react@0.1.0-rc.13",
102
102
  "description": "Sekyro AI React SDK — the themeable, accessible <LivenessCapture /> component over @sekyro/web (ar/fr/en, 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.12?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-react",
111
+ "purl": "pkg:npm/%40sekyro/react@0.1.0-rc.13?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.12"
150
+ "ref": "@sekyro/react@0.1.0-rc.13"
151
151
  }
152
152
  ]
153
153
  }
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{a as s}from"./chunk-2KED7D2Q.js";var a={light:{brand:"#0d3b66",brandFg:"#ffffff",fg:"#13141f",fgMuted:"#4e5270",bg:"#f6f7fb",surface:"#ffffff",ring:"#0d3b66",danger:"#ca0f07",success:"#007a5e",warning:"#735003"},dark:{brand:"#6ea2d3",brandFg:"#051a2e",fg:"#f6f7fb",fgMuted:"#cbcedc",bg:"#13141f",surface:"#1d1e2c",ring:"#6ea2d3",danger:"#ff7c7c",success:"#00c897",warning:"#ffd98a"},roles:{light:{brandSoft:"#eaf2fa",line:"#cbcedc",lineSubtle:"#e2e4ee",lineStrong:"#8c91a9",sunken:"#eeeff5",fgSubtle:"#686d8a"},dark:{brandSoft:"#092b4b",line:"#4e5270",lineSubtle:"#2b2d40",lineStrong:"#686d8a",sunken:"#0b0c14",fgSubtle:"#8c91a9"}},stage:"#051a2e",stageAccent:"#69dfef",radius:"10px",radiusLg:"16px",font:'"Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontDisplay:'"Sekyro Geist", Geist, "Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontArabic:'"Sekyro Cairo", Cairo, "Sekyro Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif'};import{jsx as k}from"react/jsx-runtime";var n={colors:{...a.light},radius:a.radiusLg,fontFamily:a.font},c={brand:"--sekyro-color-brand",brandFg:"--sekyro-color-brand-fg",fg:"--sekyro-color-fg",fgMuted:"--sekyro-color-fg-muted",bg:"--sekyro-color-bg",surface:"--sekyro-color-surface",ring:"--sekyro-color-ring",danger:"--sekyro-color-danger",success:"--sekyro-color-success",warning:"--sekyro-color-warning"};function y(r={}){let o={};for(let e of Object.keys(c))o[c[e]]=r.colors?.[e]??n.colors[e];return o["--sekyro-radius"]=r.radius??n.radius,o["--sekyro-font"]=r.fontFamily??n.fontFamily,o}s(y,"themeToCssVars");var g=/^#[0-9a-f]{6}$/i,l={none:"0px",sm:"6px",md:"10px",lg:"16px",full:"9999px"},u={system:"",inter:"Inter","ibm-plex-sans-arabic":'"IBM Plex Sans Arabic"',"noto-sans-arabic":'"Noto Sans Arabic"',roboto:"Roboto"};function b(r){let o={};if(!r)return o;let e={};for(let[f,d]of Object.entries(r.colors??{}))f in c&&f!=="ring"&&g.test(d??"")&&(e[f]=d);e.brand&&(e.ring=e.brand),Object.keys(e).length&&(o.colors=e);let t=l[r.radius];t&&(o.radius=t);let i=u[r.fontFamily];return i!==void 0&&(o.fontFamily=i?`${i}, ${n.fontFamily}`:n.fontFamily),o}s(b,"brandingToTheme");function p(...r){let o={};for(let e of r)e?.colors&&(o.colors={...o.colors,...e.colors}),e?.radius&&(o.radius=e.radius),e?.fontFamily&&(o.fontFamily=e.fontFamily);return o}s(p,"mergeThemes");function h({theme:r,children:o,className:e}){let t=y(r);return k("div",{className:e===void 0?"sekyro-root":`sekyro-root ${e}`,style:t,children:o})}s(h,"SekyroThemeProvider");export{a,n as b,y as c,b as d,p as e,h as f};