@sekyro/react 0.1.0-rc.10 → 0.1.0-rc.11

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.
Files changed (38) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -1
  3. package/dist/{chunk-MLGCQ74X.js → chunk-5XYKAT3V.js} +1 -1
  4. package/dist/chunk-63LPCEVJ.js +2 -0
  5. package/dist/{chunk-RFJSBXAH.js → chunk-746GPDBD.js} +1 -1
  6. package/dist/{chunk-3MMLW5JQ.js → chunk-D5WF4UNP.js} +1 -1
  7. package/dist/chunk-ECWKDUB5.js +2 -0
  8. package/dist/{chunk-R5W7UDFX.js → chunk-JNAKE3DW.js} +1 -1
  9. package/dist/chunk-MXPLBQHW.js +2 -0
  10. package/dist/chunk-PCNVEJSW.js +2 -0
  11. package/dist/chunk-VRDPGOXM.js +2 -0
  12. package/dist/{document-capture-view-BSK7QPBT.js → document-capture-view-E2USDGQJ.js} +1 -1
  13. package/dist/{eid-view-EOTE4E3T.js → eid-view-74CN2XAY.js} +1 -1
  14. package/dist/{email-otp-view-TL43KM5T.js → email-otp-view-DE624TXY.js} +1 -1
  15. package/dist/flow-views-CO5TQYTP.js +2 -0
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.d.cts +2 -2
  18. package/dist/index.d.ts +2 -2
  19. package/dist/index.js +1 -1
  20. package/dist/{overlay-de-SAZKXC6H.js → overlay-de-UWA5CZLC.js} +1 -1
  21. package/dist/{overlay-es-H7CXA7UL.js → overlay-es-VCSJQ4KN.js} +1 -1
  22. package/dist/{overlay-pt-VW4D7A3A.js → overlay-pt-NQMWHKF5.js} +1 -1
  23. package/dist/{portrait-capture-view-YIONZJPI.js → portrait-capture-view-Y5W776HP.js} +1 -1
  24. package/dist/{theme-DiGLpM-i.d.cts → theme-DqD8Nyoq.d.cts} +4 -0
  25. package/dist/{theme-DiGLpM-i.d.ts → theme-DqD8Nyoq.d.ts} +4 -0
  26. package/dist/verification/index.cjs +1 -1
  27. package/dist/verification/index.d.cts +17 -6
  28. package/dist/verification/index.d.ts +17 -6
  29. package/dist/verification/index.js +1 -1
  30. package/dist/verification.css +9 -0
  31. package/package.json +4 -3
  32. package/sbom.cdx.json +4 -4
  33. package/dist/chunk-5OAGLIJS.js +0 -2
  34. package/dist/chunk-BTCCJFMS.js +0 -2
  35. package/dist/chunk-G2GWGZYH.js +0 -2
  36. package/dist/chunk-RFCYXRRC.js +0 -2
  37. package/dist/chunk-RIE46W4P.js +0 -2
  38. package/dist/flow-views-5ADJL2OW.js +0 -2
@@ -1,5 +1,5 @@
1
- import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-DiGLpM-i.cjs';
2
- export { k as StringKey, A as retakeHintStringKey } from '../theme-DiGLpM-i.cjs';
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';
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';
@@ -66,6 +66,9 @@ interface StepStrings {
66
66
  "population.fromDocument.title": string;
67
67
  "population.fromDocument.description": string;
68
68
  "population.fromDocument.continue": string;
69
+ "population.reason_id_number_invalid": string;
70
+ "population.reason_registry_record_not_found": string;
71
+ "population.reason_registry_record_not_found_or_document": string;
69
72
  "session.steps.doc.titleRecto": string;
70
73
  "session.steps.doc.titleVerso": string;
71
74
  "session.steps.doc.description": string;
@@ -195,6 +198,8 @@ interface StepStrings {
195
198
  "population.recheck.title": string;
196
199
  "population.recheck.description": string;
197
200
  "otp.phoneInvalid": string;
201
+ "otp.countryLabel": string;
202
+ "otp.phonePlaceholderGeneric": string;
198
203
  "otp.codeInvalid": string;
199
204
  "doc.countryTitle": string;
200
205
  "doc.countryLabel": string;
@@ -359,6 +364,7 @@ interface StepStrings {
359
364
  "summary.documentType"?: string;
360
365
  "summary.documentNumber"?: string;
361
366
  "summary.nni"?: string;
367
+ "summary.id_number"?: string;
362
368
  "summary.expiryDate"?: string;
363
369
  "summary.portraitAlt"?: string;
364
370
  "summary.source.registry"?: string;
@@ -445,10 +451,10 @@ interface StepComponentProps {
445
451
 
446
452
  interface PhoneOtpStepProps extends StepComponentProps {
447
453
  step: PhoneOtpStepHandle;
448
- /** Initial value of the number field (default `+222`). */
454
+ /** Initial value of the number field (default: the calling code of the flow's first contact country, else empty). */
449
455
  defaultPhone?: string;
450
456
  }
451
- declare function PhoneOtpStep({ step, locale, strings, className, defaultPhone, onError }: PhoneOtpStepProps): react.JSX.Element;
457
+ declare function PhoneOtpStep({ step, locale, strings, className, defaultPhone: initialPhone, onError }: PhoneOtpStepProps): react.JSX.Element;
452
458
 
453
459
  interface EmailOtpStepProps extends StepComponentProps {
454
460
  step: EmailOtpStepHandle;
@@ -466,7 +472,12 @@ declare function MethodChoice({ step, locale, strings, className, onError }: Ste
466
472
  step: MethodStepHandle;
467
473
  }): react.JSX.Element;
468
474
 
469
- declare function NniEntry({ step, locale, strings, className, onError }: StepComponentProps & {
475
+ /** The registry step: type the national number, or confirm the number the session holds. */
476
+ declare function IdNumberEntry({ step, locale, strings, className, onError }: StepComponentProps & {
477
+ step: RegistryStepHandle;
478
+ }): react.JSX.Element;
479
+ /** @deprecated Use {@link IdNumberEntry} (the same component). */
480
+ declare function NniEntry(input: StepComponentProps & {
470
481
  step: RegistryStepHandle;
471
482
  }): react.JSX.Element;
472
483
 
@@ -559,4 +570,4 @@ declare function VerificationResultScreen({ step, locale, strings, className, on
559
570
  onClose?: () => void;
560
571
  }): react.JSX.Element;
561
572
 
562
- export { DocumentCapture, EidStep, type EidStepProps, EmailOtpStep, type EmailOtpStepProps, MethodChoice, NniEntry, PhoneOtpStep, type PhoneOtpStepProps, PortraitCapture, type SekyroCloseEvent, type SekyroColorScheme, SekyroFlow, type SekyroFlowProps, SekyroLocale, type SekyroStringKey, type SekyroStrings, SekyroVerification, type SekyroVerificationProps, type StepComponentProps, type StepI18n, StepI18nProvider, type StepStrings, type StepTranslate, Strings, VerificationResultScreen, arSteps, enSteps, formatTemplate, frSteps, isInAppBrowser, loadSekyroLocale, resolveSekyroStrings, useStepI18n, useVerificationStep };
573
+ export { DocumentCapture, EidStep, type EidStepProps, EmailOtpStep, type EmailOtpStepProps, IdNumberEntry, MethodChoice, NniEntry, PhoneOtpStep, type PhoneOtpStepProps, PortraitCapture, type SekyroCloseEvent, type SekyroColorScheme, SekyroFlow, type SekyroFlowProps, SekyroLocale, type SekyroStringKey, type SekyroStrings, SekyroVerification, type SekyroVerificationProps, type StepComponentProps, type StepI18n, StepI18nProvider, type StepStrings, type StepTranslate, Strings, VerificationResultScreen, arSteps, enSteps, formatTemplate, frSteps, isInAppBrowser, loadSekyroLocale, resolveSekyroStrings, useStepI18n, useVerificationStep };
@@ -1,5 +1,5 @@
1
- import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-DiGLpM-i.js';
2
- export { k as StringKey, A as retakeHintStringKey } from '../theme-DiGLpM-i.js';
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';
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';
@@ -66,6 +66,9 @@ interface StepStrings {
66
66
  "population.fromDocument.title": string;
67
67
  "population.fromDocument.description": string;
68
68
  "population.fromDocument.continue": string;
69
+ "population.reason_id_number_invalid": string;
70
+ "population.reason_registry_record_not_found": string;
71
+ "population.reason_registry_record_not_found_or_document": string;
69
72
  "session.steps.doc.titleRecto": string;
70
73
  "session.steps.doc.titleVerso": string;
71
74
  "session.steps.doc.description": string;
@@ -195,6 +198,8 @@ interface StepStrings {
195
198
  "population.recheck.title": string;
196
199
  "population.recheck.description": string;
197
200
  "otp.phoneInvalid": string;
201
+ "otp.countryLabel": string;
202
+ "otp.phonePlaceholderGeneric": string;
198
203
  "otp.codeInvalid": string;
199
204
  "doc.countryTitle": string;
200
205
  "doc.countryLabel": string;
@@ -359,6 +364,7 @@ interface StepStrings {
359
364
  "summary.documentType"?: string;
360
365
  "summary.documentNumber"?: string;
361
366
  "summary.nni"?: string;
367
+ "summary.id_number"?: string;
362
368
  "summary.expiryDate"?: string;
363
369
  "summary.portraitAlt"?: string;
364
370
  "summary.source.registry"?: string;
@@ -445,10 +451,10 @@ interface StepComponentProps {
445
451
 
446
452
  interface PhoneOtpStepProps extends StepComponentProps {
447
453
  step: PhoneOtpStepHandle;
448
- /** Initial value of the number field (default `+222`). */
454
+ /** Initial value of the number field (default: the calling code of the flow's first contact country, else empty). */
449
455
  defaultPhone?: string;
450
456
  }
451
- declare function PhoneOtpStep({ step, locale, strings, className, defaultPhone, onError }: PhoneOtpStepProps): react.JSX.Element;
457
+ declare function PhoneOtpStep({ step, locale, strings, className, defaultPhone: initialPhone, onError }: PhoneOtpStepProps): react.JSX.Element;
452
458
 
453
459
  interface EmailOtpStepProps extends StepComponentProps {
454
460
  step: EmailOtpStepHandle;
@@ -466,7 +472,12 @@ declare function MethodChoice({ step, locale, strings, className, onError }: Ste
466
472
  step: MethodStepHandle;
467
473
  }): react.JSX.Element;
468
474
 
469
- declare function NniEntry({ step, locale, strings, className, onError }: StepComponentProps & {
475
+ /** The registry step: type the national number, or confirm the number the session holds. */
476
+ declare function IdNumberEntry({ step, locale, strings, className, onError }: StepComponentProps & {
477
+ step: RegistryStepHandle;
478
+ }): react.JSX.Element;
479
+ /** @deprecated Use {@link IdNumberEntry} (the same component). */
480
+ declare function NniEntry(input: StepComponentProps & {
470
481
  step: RegistryStepHandle;
471
482
  }): react.JSX.Element;
472
483
 
@@ -559,4 +570,4 @@ declare function VerificationResultScreen({ step, locale, strings, className, on
559
570
  onClose?: () => void;
560
571
  }): react.JSX.Element;
561
572
 
562
- export { DocumentCapture, EidStep, type EidStepProps, EmailOtpStep, type EmailOtpStepProps, MethodChoice, NniEntry, PhoneOtpStep, type PhoneOtpStepProps, PortraitCapture, type SekyroCloseEvent, type SekyroColorScheme, SekyroFlow, type SekyroFlowProps, SekyroLocale, type SekyroStringKey, type SekyroStrings, SekyroVerification, type SekyroVerificationProps, type StepComponentProps, type StepI18n, StepI18nProvider, type StepStrings, type StepTranslate, Strings, VerificationResultScreen, arSteps, enSteps, formatTemplate, frSteps, isInAppBrowser, loadSekyroLocale, resolveSekyroStrings, useStepI18n, useVerificationStep };
573
+ export { DocumentCapture, EidStep, type EidStepProps, EmailOtpStep, type EmailOtpStepProps, IdNumberEntry, MethodChoice, NniEntry, PhoneOtpStep, type PhoneOtpStepProps, PortraitCapture, type SekyroCloseEvent, type SekyroColorScheme, SekyroFlow, type SekyroFlowProps, SekyroLocale, type SekyroStringKey, type SekyroStrings, SekyroVerification, type SekyroVerificationProps, type StepComponentProps, type StepI18n, StepI18nProvider, type StepStrings, type StepTranslate, Strings, VerificationResultScreen, arSteps, enSteps, formatTemplate, frSteps, isInAppBrowser, loadSekyroLocale, resolveSekyroStrings, useStepI18n, useVerificationStep };
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as st}from"../chunk-R5W7UDFX.js";import{a as B,d as ye,e as ke,f as he}from"../chunk-ZCAZDOMD.js";import{a as Xe}from"../chunk-EZ5TVL6P.js";import{a as et}from"../chunk-YY76AMUA.js";import{a as tt,b as ot,c as nt,d as rt}from"../chunk-3MMLW5JQ.js";import{a as q}from"../chunk-PYAJMHZH.js";import{a as Ye,b as Ge,d as Qe,g as Je}from"../chunk-5OAGLIJS.js";import{b as We}from"../chunk-MLGCQ74X.js";import{a as Y,b as G,c as ge,d as Ze,g as je}from"../chunk-RFJSBXAH.js";import{a as ee}from"../chunk-RFCYXRRC.js";import{a as xt,b as It,c as Et,d as Vt,e as Lt,f as ae,g as v}from"../chunk-G2GWGZYH.js";import{a as N,b as Se}from"../chunk-BTCCJFMS.js";import{a as b,g as Pt,i as _t,j as Ke,k as ze,l as qe,r as fe,s as j}from"../chunk-RIE46W4P.js";import{a as i}from"../chunk-2KED7D2Q.js";import{useEffect as Tt,useState as it}from"react";function Ce(e){let[t,n]=it(()=>e?.currentStep?.()??null),[s,a]=it(null);return Tt(()=>{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 r=!0,o=e.on("step",l=>{r&&n(l)});return e.run().then(l=>{r&&n(c=>c??l)},l=>{r&&a(l)}),()=>{r=!1,o()}},[e]),{step:t,error:s}}i(Ce,"useVerificationStep");import{useEffect as Rt,useId as Mt,useRef as Dt,useState as be}from"react";import{Fragment as lt,jsx as h,jsxs as U}from"react/jsx-runtime";var at=i((e,t)=>{if(e===void 0)return 0;let n=Date.parse(e)-t;return Number.isFinite(n)?Math.max(0,Math.ceil(n/1e3)):0},"secondsUntil"),At=i(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Bt=["whatsapp","sms"],Ot=new Set(["otp_daily_cap_reached","payment_method_required","spend_cap_reached","otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited"]),J="+222";function Ft(e){let t=e.replace(/[\s-]/g,""),n=t.startsWith("+")?t.slice(1):t;return/^\d{8,15}$/.test(n)?`+${n}`:null}i(Ft,"normalizedPhone");function Ht({id:e,label:t,value:n,onChange:s,placeholder:a}){let r=n.startsWith("+")&&!n.startsWith(J),o=r?n:n.slice(n.startsWith(J)?J.length:0).trim(),l=Dt(null);return Rt(()=>{let c=setTimeout(()=>l.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(c)},[]),U("div",{className:"sekyro-field",children:[h("label",{className:"sekyro-label",htmlFor:e,children:t}),U("div",{className:"sekyro-phone",dir:"ltr",children:[r?null:U("span",{className:"sekyro-phone__dial",id:`${e}-dial`,children:[h("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:"🇲🇷"}),J]}),h("input",{ref:l,id:e,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",...r?{}:{"aria-describedby":`${e}-dial`},placeholder:a,value:o,onChange:c=>{let u=c.target.value.replace(/[^\d +]/g,"");s(u.startsWith("+")?u:J+u.replace(/\D/g,""))}})]})]})}i(Ht,"PhoneField");function Ne({step:e,locale:t,strings:n,className:s,defaultPhone:a=J,onError:r}){let o=v(t,n),{t:l}=o,[c,u]=be(a),[k,f]=be(""),[m,y]=be(!1),[w,D]=be(null),T=e.phase==="verify",R=et(T),_=Mt(),$=i(async I=>{y(!0),D(null);try{await I()}catch(M){D(ee(M,o.strings)),r?.(M)}finally{y(!1)}},"run"),O=Bt.filter(I=>(e.channels??[]).includes(I)),g=Ft(c),P=!e.needsPhone||g!==null,S=i((I,M=!1)=>{$(()=>e.send({...e.needsPhone&&(!M||c!==a)?{phone:g??c}:{},...I!==void 0?{channel:I}:{}}))},"send"),de=i(I=>{$(()=>e.verify(I))},"submitCode"),ue=i(I=>{I.preventDefault(),T?de(k):O.length<=1&&P&&S(O[0])},"onSubmit"),F=at(e.codeExpiresAt,R),W=at(e.resendAvailableAt,R),X=T&&e.codeExpiresAt!==void 0&&F===0,C=i(I=>l(I==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[me,d]=l("otp.sentTo",{channel:C(e.channel)}).split("{number}"),x=e.reason==="otp_mismatch"?U(N,{tone:"danger",children:[h("span",{children:l("otp.reason_otp_mismatch")}),h("span",{children:Se(o,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Ot.has(e.reason)?h(N,{tone:"warning",children:h("span",{children:l(`otp.reason_${e.reason}`)})}):null,Z=U(lt,{children:[x,w!==null?h(N,{tone:"danger",children:h("span",{children:l(w)})}):null]});if(T){let I=O.length===0;return U("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":_,onSubmit:ue,noValidate:!0,children:[h(Y,{id:_,title:l("otp.verifyTitle"),lead:U(lt,{children:[me,h("bdi",{dir:"ltr",className:"sekyro-mono",children:e.sentToMasked}),d]})}),Z,U("div",{className:"sekyro-field",children:[h("label",{className:"sekyro-label",htmlFor:`${_}-code`,children:l("otp.codeLabel")}),h(Xe,{id:`${_}-code`,value:k,invalid:e.reason==="otp_mismatch",onChange:M=>{f(M),M.length===6&&k.length!==6&&!m&&!e.attemptsExhausted&&de(M)}}),h("span",{className:`sekyro-help sekyro-otp-expiry${X?" is-danger":""}`,"aria-hidden":!X||void 0,children:X?l("otp.expired"):l("otp.expiresIn",{time:At(F)})})]}),h("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:X?l("otp.expired"):""}),U(G,{children:[h(b,{type:"submit",full:!0,disabled:m||k.length!==6||e.attemptsExhausted,"aria-busy":m||void 0,children:l("otp.verify")}),I?h("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:m||W>0,onClick:()=>S(void 0,!0),children:W>0?l("otp.resendIn",{seconds:W}):l("otp.resend")}):W>0?h("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:W})}):h("div",{className:"sekyro-resend-row",children:O.map(M=>h("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:m,onClick:()=>S(M,!0),children:l("otp.resendBy",{channel:C(M)})},M))})]})]})}return U("form",{className:`sekyro-step sekyro-otp${s?` ${s}`:""}`,"aria-labelledby":_,onSubmit:ue,noValidate:!0,children:[h(Y,{id:_,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),Z,e.needsPhone?h(Ht,{id:`${_}-phone`,label:l("otp.phoneLabel"),value:c,onChange:u,placeholder:l("otp.phonePlaceholder").replace(J,"").trim()}):h("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),h(G,{children:O.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")}),O.map((I,M)=>h(b,{kind:M===0?"primary":"ghost",full:!0,disabled:m||!P,"aria-busy":M===0&&m||void 0,onClick:()=>S(I),children:l("otp.sendBy",{channel:C(I)})},I))]}):h(b,{type:"submit",full:!0,disabled:m||!P,"aria-busy":m||void 0,children:l("otp.send")})})]})}i(Ne,"PhoneOtpStep");import{lazy as Ut,Suspense as Kt,useMemo as zt,useState as qt}from"react";import{Component as $t}from"react";var we=class we extends $t{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(we,"LoadBoundary");var z=we;import{jsx as te,jsxs as Yt}from"react/jsx-runtime";var Wt={load:i(()=>import("../email-otp-view-TL43KM5T.js"),"load")};function Pe({locale:e,strings:t,...n}){let s=v(e,t),[a,r]=qt(0),o=zt(()=>Ut(()=>Wt.load().then(c=>({default:c.EmailOtpView}))),[a]),l=Yt(N,{tone:"danger",children:[te("span",{children:s.t("errors.network_error")}),te(b,{kind:"ghost",onClick:()=>r(c=>c+1),children:s.t("common.retry")})]});return te(z,{fallback:l,children:te(Kt,{fallback:te("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:te(o,{...n,i18n:s})})},a)}i(Pe,"EmailOtpStep");import{lazy as Gt,Suspense as Qt,useMemo as Jt,useState as Xt}from"react";import{jsx as oe,jsxs as jt}from"react/jsx-runtime";var Zt={load:i(()=>import("../eid-view-EOTE4E3T.js"),"load")};function _e({locale:e,strings:t,...n}){let s=v(e,t),[a,r]=Xt(0),o=Jt(()=>Gt(()=>Zt.load().then(c=>({default:c.EidView}))),[a]),l=jt(N,{tone:"danger",children:[oe("span",{children:s.t("errors.network_error")}),oe(b,{kind:"ghost",onClick:()=>r(c=>c+1),children:s.t("common.retry")})]});return oe(z,{fallback:l,children:oe(Qt,{fallback:oe("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:s.t("common.loading")}),children:oe(o,{...n,i18n:s})})},a)}i(_e,"EidStep");import{useMemo as io}from"react";import{lazy as eo,Suspense as to,useMemo as oo,useState as no}from"react";import{jsx as ne,jsxs as so}from"react/jsx-runtime";var ro={load:i(()=>import("../flow-views-5ADJL2OW.js"),"load")};function E({view:e,i18n:t,quiet:n,...s}){let[a,r]=no(0),o=oo(()=>eo(()=>ro.load().then(c=>({default:c[e]}))),[e,a]),l=so(N,{tone:"danger",children:[ne("span",{children:t.t("errors.network_error")}),ne(b,{kind:"ghost",onClick:()=>r(c=>c+1),children:t.t("common.retry")})]});return ne(z,{fallback:l,children:ne(to,{fallback:n===!0?null:ne("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:ne(o,{...s,i18n:t})})},a)}i(E,"Flow");import{jsx as xe,jsxs as ao}from"react/jsx-runtime";function Ie({step:e,locale:t,strings:n,className:s,onError:a}){let r=v(t,n),{busy:o,error:l,run:c}=nt(r,a),u=io(()=>e.choice.options.flatMap(f=>{let m=ot(f,r),y=tt[f.service];return m===null?[]:[{id:f.id,label:m,glyph:y&&xe(q,{name:y})}]}),[e.choice.options,r]),k=e.choice.options.find(f=>f.service==="national_eid");return ao("div",{className:s,children:[xe(Qe,{title:r.t("method.title"),description:r.t("method.description"),options:u,busy:o,error:l,focus:!0,testId:"sekyro-method",onChoose:f=>c(()=>e.choose(f))}),k?.nationalEid?.afterPass==="continue"?xe(E,{view:"EidContinueHint",i18n:r,provider:k.nationalEid.providerName,quiet:!0}):null]})}i(Ie,"MethodChoice");import{isValidNni as lo,normalizeNni as pt}from"@sekyro/web";import{useId as po,useState as Ee}from"react";import{Fragment as co,jsx as V,jsxs as re}from"react/jsx-runtime";function Ve({step:e,locale:t,strings:n,className:s,onError:a}){let r=v(t,n),{t:o}=r,[l,c]=Ee(""),[u,k]=Ee(!1),[f,m]=Ee(null),y=po(),w=e.attemptsExhausted,D=i(async P=>{k(!0),m(null);try{await P()}catch(S){m(ee(S,r.strings)),a?.(S)}finally{k(!1)}},"run"),T=i(P=>{if(P.preventDefault(),e.source!=="typed"){D(()=>e.confirm());return}let S=pt(l);if(!/^\d{10}$/.test(S))return m("population.invalid");if(!lo(S))return m("population.reason_nni_invalid");D(()=>e.submitNni(S))},"onSubmit"),R=Se(r,e.attemptsRemaining,w),_=re(co,{children:[e.reason==="registry_unavailable"?re(N,{tone:"warning",children:[V("span",{children:o("population.reason_registry_unavailable")}),V("span",{children:R})]}):null,e.reason==="nni_not_found"&&e.canUseDocument?re(N,{tone:"warning",children:[V("span",{children:o("population.reason_nni_not_found_or_document")}),V("span",{children:R}),V(b,{kind:"ghost",disabled:u,onClick:()=>{D(()=>e.useDocument())},children:o("population.useDocument")})]}):null,e.reason==="nni_not_found"&&!e.canUseDocument||e.reason==="nni_invalid"?re(N,{tone:"danger",children:[V("span",{children:o(e.reason==="nni_not_found"?"population.reason_nni_not_found":"population.reason_nni_invalid")}),V("span",{children:R})]}):null,w&&e.reason===void 0?V(N,{tone:"danger",children:V("span",{children:R})}):null,f!==null?V(N,{tone:"danger",children:V("span",{children:o(f)})}):null]}),[$,O,g]=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 re("form",{className:`sekyro-step${s?` ${s}`:""}`,"aria-labelledby":y,onSubmit:T,noValidate:!0,children:[V(Y,{id:y,title:o($),lead:o(O)}),_,e.source==="typed"?re("div",{className:"sekyro-field",children:[V("label",{className:"sekyro-label",htmlFor:`${y}-nni`,children:o("population.label")}),V("input",{id:`${y}-nni`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:o("population.placeholder"),value:l,"aria-describedby":`${y}-nni-help`,"aria-invalid":f==="population.invalid"||f==="population.reason_nni_invalid"||void 0,onChange:P=>{m(null),c(pt(P.target.value).replace(/\D/g,"").slice(0,10))}}),V("span",{id:`${y}-nni-help`,className:"sekyro-help",children:o("population.helper")})]}):null,V(G,{children:w?null:V(b,{type:"submit",full:!0,disabled:u,"aria-busy":u||void 0,children:o(g)})})]})}i(Ve,"NniEntry");import{acceptedIssuers as ho,acceptedTypesFor as go,warmDocumentCapture as So}from"@sekyro/web";import{lazy as bo,Suspense as vo,useEffect as Co,useMemo as No,useState as ft}from"react";import{acceptedIssuers as uo,acceptedTypesFor as Le}from"@sekyro/web";import{useEffect as ct,useId as mo,useMemo as dt,useState as Te}from"react";import{jsx as L,jsxs as se}from"react/jsx-runtime";var ut=i(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),fo=i(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),yo=220;function ko(e,t){let n=null;try{n=new Intl.DisplayNames([e],{type:"region"})}catch{}let s=t.map(r=>({code:r,name:n?.of(r)??r})),a=new Intl.Collator(e);return s.sort((r,o)=>r.code==="MR"?-1:o.code==="MR"?1:a.compare(r.name,o.name))}i(ko,"countryNames");function mt({step:e,i18n:t,issuer:n,onPicked:s}){let{t:a,locale:r}=t,o=dt(()=>uo(e.documents),[e.documents]),l=dt(()=>ko(r,o),[r,o]),c=o.length===1?o[0]:null,[u,k]=Te(n??c),[f,m]=Te(""),[y,w]=Te(null),D=mo(),T=c===null?[]:Le(e.documents,c),R=c!==null&&T.length===1?T[0]:null;ct(()=>{c!==null&&R!==null&&e.selectDocument(c,R)},[c,R]);let _=i((g,P)=>{e.selectDocument(g,P),s?.()},"pick"),$=i(g=>{let P=Le(e.documents,g);P.length===1?_(g,P[0]):k(g)},"chooseIssuer");if(ct(()=>{if(y===null||u===null)return;let g=setTimeout(()=>_(u,y),yo);return()=>clearTimeout(g)},[y]),R!==null)return null;if(u===null){let g=ut(f.trim()),P=g===""?l:l.filter(S=>ut(S.name).includes(g)||S.code.toLowerCase()===g);return se("section",{className:"sekyro-step",children:[L(Y,{title:a("doc.countryTitle"),lead:a("doc.pickDescription")}),se("div",{className:"sekyro-field",children:[L("label",{className:"sekyro-label",htmlFor:D,children:a("doc.countryLabel")}),L("input",{id:D,type:"search",className:"sekyro-input",placeholder:a("doc.countrySearch"),value:f,onChange:S=>m(S.target.value)})]}),P.length===0?L("p",{className:"sekyro-text-muted",children:a("doc.noCountryMatch")}):L("ul",{className:"sekyro-rows",children:P.map(S=>L("li",{children:se("button",{type:"button",className:"sekyro-row-btn",onClick:()=>$(S.code),children:[L("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:fo(S.code)}),S.name]})},S.code))}),L(G,{children:null})]})}let O=Le(e.documents,u);return se("section",{className:"sekyro-step",children:[L(Y,{title:a("doc.pickTitle"),lead:a("native.doc.holdIt")}),L("div",{className:"sekyro-choices",children:O.map(g=>se("button",{type:"button",className:"sekyro-card","aria-pressed":y===g,disabled:y!==null&&y!==g,onClick:()=>w(g),children:[L(q,{name:g==="passport"?"passport":"card"}),se("span",{className:"sekyro-card__body",children:[L("span",{className:"sekyro-card__title",children:a(`doc.type.${g}`)}),L("span",{className:"sekyro-card__sub",children:a(`doc.sub.${g}`)})]}),L("span",{className:"sekyro-radio","aria-hidden":"true"})]},g))}),o.length>1?L("button",{type:"button",className:"sekyro-link",onClick:()=>{k(null),w(null)},children:a("native.doc.changeCountry")}):null,L(G,{children:null})]})}i(mt,"DocumentPicker");import{jsx as Q,jsxs as Po}from"react/jsx-runtime";var wo={load:i(()=>import("../document-capture-view-BSK7QPBT.js"),"load")};function Re({step:e,locale:t,strings:n,className:s,liveMrz:a}){let r=v(t,n),[o,l]=ft(0),[c,u]=ft(null),k=ho(e.documents).length>1,f=e.issuer!==null&&go(e.documents,e.issuer).length>1,m=No(()=>bo(()=>wo.load().then(w=>({default:w.DocumentCaptureView}))),[o]);Co(()=>{So()},[]);let y=Po(N,{tone:"danger",children:[Q("span",{children:r.t("errors.network_error")}),Q(b,{kind:"ghost",onClick:()=>l(w=>w+1),children:r.t("doc.retryCamera")})]});return Q("div",{className:s,children:e.documentType===null||e.issuer===null||c!==null?Q(mt,{step:e,i18n:r,...c==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>u(null)}):Q(z,{fallback:y,children:Q(vo,{fallback:Q("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:Q(m,{step:e,i18n:r,liveMrz:a,...k?{onChangeCountry:i(()=>u("country"),"onChangeCountry")}:{},...f?{onChangeDocument:i(()=>u("document"),"onChangeDocument")}:{}})})},o)})}i(Re,"DocumentCapture");import{warmPortraitCapture as _o}from"@sekyro/web";import{Component as xo,lazy as Io,Suspense as Eo,useEffect as Vo,useMemo as Lo,useState as To}from"react";import{jsx as A,jsxs as De}from"react/jsx-runtime";var Ro={load:i(()=>import("../portrait-capture-view-YIONZJPI.js"),"load")},Be=class Be extends xo{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};i(Be,"LoadBoundary");var Me=Be;function Mo({step:e,i18n:t}){let{t:n}=t,s=j();return De("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[A("h2",{ref:s,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?A("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?De(N,{tone:"danger",children:[A("span",{children:n("portrait.uploadFailed")}),A(b,{kind:"ghost",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):A("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}i(Mo,"MatchPhase");function Ae({step:e,locale:t,strings:n,className:s,assetBaseUrl:a}){let r=v(t,n),[o,l]=To(0),c=Lo(()=>Io(()=>Ro.load().then(k=>({default:k.PortraitCaptureView}))),[o]);if(Vo(()=>{e.phase==="capture"&&_o()},[e.phase]),e.phase==="match")return A("div",{className:s,children:A(Mo,{step:e,i18n:r})});let u=De(N,{tone:"danger",children:[A("span",{children:r.t("errors.network_error")}),A(b,{kind:"ghost",onClick:()=>l(k=>k+1),children:r.t("portrait.retryCamera")})]});return A("div",{className:s,children:A(Me,{fallback:u,children:A(Eo,{fallback:A("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")}),children:A(c,{step:e,i18n:r,...a!==void 0?{assetBaseUrl:a}:{}})})},o)})}i(Ae,"PortraitCapture");import{cameraUnavailableCauseOf as Jo}from"@sekyro/web";import{useCallback as pe,useEffect as Nt,useId as Xo,useRef as He,useState as ce}from"react";import{useId as Do,useState as Ao}from"react";import{jsx as ve,jsxs as yt}from"react/jsx-runtime";var Bo=["intro","data","processing","sharing","retention"];function kt({i18n:e,purpose:t="identity"}){let{t:n}=e,[s,a]=Ao(!1),r=Do(),[o,l=""]=n("consent.short").split("{terms}");return yt("section",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-consent",children:[yt("p",{className:"sekyro-text-muted",children:[o,ve("button",{type:"button",className:"sekyro-link","aria-expanded":s,"aria-controls":r,onClick:()=>a(c=>!c),children:n("consent.termsLink")}),l]}),ve("div",{id:r,hidden:!s,className:"sekyro-stack sekyro-stack--1 sekyro-text-muted","data-testid":"sekyro-consent-terms",children:t==="human"?ve(E,{view:"HumanConsentTerms",i18n:e,quiet:!0}):Bo.map(c=>ve("p",{children:n(`consent.terms.${c}`)},c))})]})}i(kt,"ConsentNotice");function ht(e){let t=e.trim().split(/\s+/).filter(s=>s!=="");return(t.length>=2?[t[0],t[1]].map(s=>Array.from(s??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}i(ht,"initials");import{useSyncExternalStore as Oo}from"react";var St=i(e=>({colors:{...e?B.dark:B.light},radius:B.radiusLg,fontFamily:B.font}),"brandTheme"),Zr=St(!1);function bt(e,t,n){let s=ye(e);if(n&&s.colors!==void 0){let{brand:a,brandFg:r}=s.colors;a!==void 0&&Uo(a,B.dark.bg)>=3?s.colors={brand:a,ring:a,...r!==void 0?{brandFg:r}:{}}:delete s.colors}return ke(St(n),s,t)}i(bt,"verificationTheme");function vt(e){let t=Oo($o,Ho,()=>!1);return e==="dark"||e==="system"&&t}i(vt,"useDarkScheme");var Fo="(prefers-color-scheme: dark)",Ct=i(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Fo):null,"media"),Ho=i(()=>Ct()?.matches??!1,"prefersDark");function $o(e){let t=Ct();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}i($o,"subscribe");function Uo(e,t){let[n,s]=[gt(e),gt(t)];return(Math.max(n,s)+.05)/(Math.min(n,s)+.05)}i(Uo,"contrast");function gt(e){let t=[1,3,5].map(n=>{let s=Number.parseInt(e.slice(n,n+2),16)/255;return s<=.03928?s/12.92:((s+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}i(gt,"luminance");import{useEffect as Ko,useId as zo,useState as qo}from"react";import{jsx as H,jsxs as le}from"react/jsx-runtime";var Wo=new Set(["document_nni_mismatch","name_mismatch","birth_date_mismatch"]),Yo={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 Go({outcome:e}){return le("svg",{className:`sekyro-outcome sekyro-outcome--${e}`,viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[H("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"57",pathLength:"1"}),H("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),H("path",{className:"sekyro-outcome__glyph",d:Yo[e],pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]})}i(Go,"OutcomeMark");function Qo({label:e,id:t,copied:n}){let[s,a]=qo(!1);return Ko(()=>{if(!s)return;let r=setTimeout(()=>a(!1),1600);return()=>clearTimeout(r)},[s]),le("button",{type:"button",className:`sekyro-reference${s?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[H("span",{"aria-live":"polite",children:s?n:e}),H("bdi",{dir:"ltr",children:t}),H(q,{name:"copy"})]})}i(Qo,"ReferenceLine");function Oe({step:e,locale:t,strings:n,className:s,onClose:a}){let r=v(t,n),{t:o}=r,l=zo(),c=j(),u=e.context.orgName,k=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",f;switch(e.display){case"policy_stop":{let m=e.failureReason??"";if(Wo.has(m))f=o("session.result.detailsMismatch",{org:u});else if(m==="device_velocity_exceeded")f=o("session.result.deviceVelocity",{org:u});else if(m==="capture_tampered")f=o("session.result.deviceStop");else if(m==="camera_unavailable")f=o("reasons.camera_unavailable",{org:u});else{let y=ze(m);f=y!==null?o(y,{org:u}):o("session.result.rejected.description")}break}case"cooldown":{let m=qe(r.locale,e.retryAfter);f=m!==null?o(m.key,{time:m.time}):o("reasons.device_cooldown");break}case"platform_unsupported":f=o("result.platform_unsupported");break;case"attempts_exhausted":f=o("common.noAttemptsLeft");break;default:f=u!==""?o(`native.result.${k}`,{org:u}):o(`session.result.${k}.description`)}return le("section",{className:`sekyro-result${s?` ${s}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[le("div",{className:"sekyro-result__body",children:[H(Go,{outcome:e.display==="cooldown"?"review":k}),le("div",{className:"sekyro-heading",children:[H("h2",{id:l,ref:c,tabIndex:-1,className:"sekyro-text-body",children:o(`session.result.${k}.title`)}),H("p",{className:"sekyro-text-muted",children:f})]}),H(Qo,{label:o("result.referenceLabel"),id:e.context.sessionId,copied:o("native.result.copied")})]}),a!==void 0?H("div",{className:"sekyro-actions",children:H(b,{full:!0,onClick:a,children:u!==""?o("native.result.back",{org:u}):o("native.close")})}):null]})}i(Oe,"VerificationResultScreen");import{Fragment as Fe,jsx as p,jsxs as K}from"react/jsx-runtime";function Zo(e,t){let n=t?B.dark:B.light,s=t?B.roles.dark:B.roles.light,a=e.colors??{},r={},o=a.fg===n.fg&&a.surface===n.surface;return a.brand===n.brand&&a.surface===n.surface&&(r["--sekyro-color-brand-soft"]=s.brandSoft),o&&(r["--sekyro-color-line"]=s.line,r["--sekyro-color-line-subtle"]=s.lineSubtle,r["--sekyro-color-line-strong"]=s.lineStrong,r["--sekyro-color-sunken"]=s.sunken),a.fgMuted===n.fgMuted&&a.surface===n.surface&&(r["--sekyro-color-fg-subtle"]=s.fgSubtle),e.fontFamily===B.font&&(r["--sekyro-font-display"]=B.fontDisplay),r}i(Zo,"flowRoles");function $e(e){let{verification:t,locale:n,strings:s,onStep:a,onResult:r}=e,{step:o,error:l}=Ce(t);Nt(()=>{o!==null&&a?.(o)},[o,a]),Nt(()=>r===void 0?void 0:t.on("result",r),[t,r]);let c=vt(e.colorScheme??"light"),u=bt(o?.context.branding,e.theme,c),[k,f]=ce(!1),m=`sekyro-verification${c?" sekyro-verification--dark":""}${k?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,y=He(e.onClose);y.current=e.onClose;let w=He(o);w.current=o;let D=pe(()=>{let T=w.current;y.current?.(T?.kind==="result"?{reason:"finished",result:T.result}:{reason:"cancelled"})},[]);return p(he,{theme:u,className:m,children:p(ae,{locale:n,...s!==void 0?{strings:s}:{},children:p("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:Zo(u,c),children:p(Ze.Provider,{value:f,children:p(ge.Provider,{value:e.onClose!==void 0?D:void 0,children:p(tn,{...e,step:o,error:l,immersive:k})})})})})})}i($e,"SekyroVerification");function jo(e,t){if(t===void 0)return null;let n=e,s=n[`session.processing.${t}.title`],a=n[`session.processing.${t}.description`];return typeof s=="string"&&s!==""&&typeof a=="string"&&a!==""?{title:s,description:a}:null}i(jo,"processingCopyOf");function en({error:e,retry:t}){let{t:n}=v(),s=j();return K(fe,{tone:"danger",testId:"sekyro-error-notice",children:[p("span",{children:n(Ke(e.kind))}),e.retryable?p(b,{ref:s,kind:"ghost",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}i(en,"CameraErrorNotice");function tn(e){let{step:t,error:n,slots:s,immersive:a}=e,r=v(),{t:o}=r,[l,c]=ce(!1),[u,k]=ce(0),[f,m]=ce(null),y=t?.context.purpose??"identity",w=e.verification,D=y==="human"||t?.context.cameraUnavailableHandled===!0,T=w.reportCameraUnavailable!==void 0&&D?d=>w.reportCameraUnavailable?.(d)??Promise.resolve():void 0,R=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,_=e.handoffUrl,$=pe((d,x)=>T===void 0?void 0:p(E,{view:"NoCameraView",i18n:r,quiet:!0,cause:x,onRetry:d,...R?{onContinue:T}:{},..._!==void 0?{handoffUrl:_}:{}}),[r,w,D,R,_]),O=pe((d,x)=>p(rt,{start:d,context:x,human:y==="human",extra:x.canChooseFacing&&p(Ge,{value:x.facing,onChange:x.setFacing}),notice:x.permissionSettled&&x.permission==="denied"?$(d,"denied"):void 0}),[y,$]),g=pe((d,x)=>{let Z=Jo(d.kind);return(Z!==void 0?$(x,Z):void 0)??K(Fe,{children:[p(en,{error:d,retry:x}),Z!==void 0&&_!==void 0?p(E,{view:"DesktopHandoffView",i18n:r,quiet:!0,url:_}):null]})},[$,_,r]),P=He(""),S=e.livenessProps?.slots?.stageOverlay,de=pe(d=>(d.guidance!==""&&!d.coached&&(P.current=d.guidance),p(st,{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:P.current,note:d.note,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:o("native.close"),overlay:S?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:i(()=>k(x=>x+1),"onClose")},end:d.switchCamera&&p("button",{type:"button",className:"sekyro-glass",onClick:d.switchCamera,"aria-label":o("capture.switchCamera"),children:p(We,{})})})),[o,S]),ue=Xo();if(n!==null)return p(fe,{tone:"danger",children:p("span",{children:o(ee(n,r.strings))})});if(t===null)return p("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o("common.loading")});let{context:F}=t,W=i(d=>{c(!0),d().finally(()=>c(!1))},"refresh"),X=s?.header??p(nn,{context:F,headerId:ue,end:s?.headerEnd}),C,me=f===t.key&&t.context.switchable!==void 0;if(me)C=p(E,{view:"LaneChoiceView",i18n:r,step:t,onClose:()=>m(null)});else switch(t.kind){case"phone_otp":C=p(Ne,{step:t});break;case"email_otp":C=p(Pe,{step:t});break;case"method":C=p(Ie,{step:t});break;case"registry":C=p(Ve,{step:t});break;case"document":C=p(Re,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,x={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??O,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:g}:{}},...u>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:r.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};C=p(Ye.Provider,{value:de,children:t.instructions==="icao"||t.livePhoto?.icao===!0?p(E,{view:"LivePhotoLiveness",i18n:r,step:t,livenessProps:x,sekyroIntro:d===void 0},u):p(Je,{...x},u)});break}case"portrait":C=K(Fe,{children:[t.retakeOnly?p(E,{view:"PortraitRetakeNotice",i18n:r,quiet:!0}):null,p(Ae,{step:t,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":C=p(E,{view:"ContactChoiceView",i18n:r,step:t});break;case"choice":C=p(E,{view:"GenericChoiceView",i18n:r,step:t});break;case"identity_summary":C=p(E,{view:"IdentitySummaryView",i18n:r,step:t});break;case"mobile_required":C=e.handoffUrl!==void 0?p(E,{view:"HandoffView",i18n:r,url:e.handoffUrl,refresh:t.refresh}):K(fe,{tone:"info",children:[p("strong",{children:o("handoff.title")}),p("span",{children:o("reasons.mobile_required")}),p(b,{kind:"ghost",disabled:l,onClick:()=>W(t.refresh),children:o("common.refresh")})]});break;case"processing":{let d=jo(r.strings,t.service);C=K("section",{className:"sekyro-stack sekyro-stack--1",role:"status","aria-live":"polite",children:[p("h2",{className:"sekyro-text-body",children:d?.title??o("session.processing.title")}),p("p",{className:"sekyro-text-muted",children:d?.description??o("session.processing.description")}),t.stalled?p(b,{kind:"ghost",disabled:l,onClick:()=>W(t.refresh),children:o("common.refresh")}):null]});break}case"eid":C=p(_e,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";C=K("section",{className:"sekyro-stack sekyro-stack--1",children:[p("h2",{className:"sekyro-text-body",children:o(d?"needsApp.title":"unsupported.title")}),p("p",{children:d?F.orgName!==""?o("needsApp.description",{org:F.orgName}):o("needsApp.descriptionNoOrg"):o("unsupported.description",{org:F.orgName})})]});break}case"result":C=s?.result?.(t)??p(on,{step:t});break;default:{let d=t;C=null}}return K(Fe,{children:[a?null:X,!a&&t.kind!=="result"&&F.sections.length>1?p(rn,{context:F,current:t.section,i18n:r}):null,!a&&!F.consentRecorded&&t.kind!=="result"?p(kt,{i18n:r,purpose:F.purpose}):null,p(je,{pageKey:t.key,children:C}),!a&&!me&&t.kind!=="result"&&t.context.switchable!==void 0?p(E,{view:"LaneSwitch",i18n:r,step:t,onOpen:()=>m(t.key),quiet:!0},t.key):null,a?null:s?.footer!==void 0?s.footer:F.branding?.hideAttribution===!0?null:K("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[p(q,{name:"lock"}),o("shell.verifiedBy")]})]})}i(tn,"Body");function on({step:e}){return p(ge.Consumer,{children:t=>p(Oe,{step:e,...t!==void 0?{onClose:t}:{}})})}i(on,"ResultPage");function nn({context:e,headerId:t,end:n}){let{t:s}=v(),[a,r]=ce(!1),o=a?void 0:e.branding?.logoUrl,l=e.orgName!==""?e.orgName:s(e.returning?"returning.title":"session.title");return K("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:[K("div",{className:"sekyro-org",children:[p("span",{className:"sekyro-org__tile","aria-hidden":"true",children:o!==void 0?p("img",{className:"sekyro-org__logo",src:o,alt:"",onError:()=>r(!0)}):ht(e.orgName)}),K("div",{className:"sekyro-org__text",children:[p("h1",{id:t,className:"sekyro-org__name",children:l}),p("p",{className:"sekyro-org__sub",children:s(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),n!=null?p("div",{className:"sekyro-org__end",children:n}):null,p(ge.Consumer,{children:c=>c!==void 0?p("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":s("native.close"),onClick:c,children:p(q,{name:"close"})}):null})]}),e.returning?p("p",{className:"sekyro-text-muted",children:s("returning.description")}):null]})}i(nn,"OrgHeader");function rn({context:e,current:t,i18n:n}){let s=t===null?-1:e.sections.indexOf(t),a=e.progress,r=a!==void 0&&a.length===e.sections.length?a:e.sections.map((o,l)=>({id:o,state:l<s?"done":l===s?"current":"upcoming"}));return p("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:r.map(({id:o,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:n.strings[`section.${o}`]??o})},o))})}i(rn,"SectionProgress");import{useEffect as an,useState as wt}from"react";var sn=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function Ue(e){let t=e??(typeof navigator>"u"?"":String(navigator.userAgent??""));return sn.test(t)}i(Ue,"isInAppBrowser");import{jsx as ie}from"react/jsx-runtime";function ln(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}i(ln,"pageUrl");function pn({hostedUrl:e,inAppBrowser:t,...n}){let[s,a]=wt(t===!0);an(()=>{t===void 0&&Ue()&&a(!0)},[t]);let[r,o]=wt(!1),l=n.handoffUrl??e??ln();return s&&!r?ie(he,{theme:ke(ye(void 0),n.theme),...n.className!==void 0?{className:n.className}:{},children:ie(ae,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:ie("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-stack sekyro-stack--4",children:ie(cn,{url:l,onContinue:()=>o(!0)})})})}):ie($e,{...n,...l!==""?{handoffUrl:l}:{}})}i(pn,"SekyroFlow");function cn({url:e,onContinue:t}){let n=v();return ie(E,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}i(cn,"Prompt");export{Re as DocumentCapture,_e as EidStep,Pe as EmailOtpStep,Ie as MethodChoice,Ve as NniEntry,Ne as PhoneOtpStep,Ae as PortraitCapture,pn as SekyroFlow,$e as SekyroVerification,ae as StepI18nProvider,Oe as VerificationResultScreen,xt as arSteps,It as enSteps,Vt as formatTemplate,Et as frSteps,Ue as isInAppBrowser,Pt as loadSekyroLocale,Lt as resolveSekyroStrings,_t as retakeHintStringKey,v as useStepI18n,Ce as useVerificationStep};
2
+ import{a as dt}from"../chunk-JNAKE3DW.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-D5WF4UNP.js";import{a as z}from"../chunk-PYAJMHZH.js";import{a as je,b as et,d as tt,g as ot}from"../chunk-63LPCEVJ.js";import{b as Xe}from"../chunk-5XYKAT3V.js";import{a as q,b as J,c as ve,d as rt,g as st}from"../chunk-746GPDBD.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-PCNVEJSW.js";import{a as _,b as Ce}from"../chunk-MXPLBQHW.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-ECWKDUB5.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","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-DE624TXY.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-74CN2XAY.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-CO5TQYTP.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-E2USDGQJ.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-Y5W776HP.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};
@@ -240,6 +240,15 @@ p.sekyro-resend { display: flex; align-items: center; min-block-size: 44px; marg
240
240
  }
241
241
  .sekyro-phone__dial { display: inline-flex; align-items: center; gap: 6px; padding-inline-end: 0.75rem; border-inline-end: 1px solid var(--sekyro-color-line); color: var(--sekyro-color-fg); }
242
242
  .sekyro-phone__flag { font-size: 1.25rem; line-height: 1; }
243
+ /* Several contact countries (person data spec Q16): the country select first in the page's direction, then the number. */
244
+ .sekyro-phone-row { display: flex; align-items: stretch; gap: 0.5rem; }
245
+ .sekyro-phone-row > .sekyro-phone { flex: 1; min-inline-size: 0; }
246
+ .sekyro-phone__country {
247
+ flex: 0 1 auto; max-inline-size: 45%; min-block-size: 60px; padding-inline: 0.75rem;
248
+ border: 1px solid var(--sekyro-color-line); border-radius: var(--sekyro-radius); background: var(--sekyro-color-surface);
249
+ font: var(--sekyro-type-flow-body) var(--sekyro-font); color: var(--sekyro-color-fg);
250
+ }
251
+ .sekyro-phone__country:focus-visible { outline: none; border-color: var(--sekyro-color-ring); box-shadow: inset 0 0 0 1px var(--sekyro-color-ring); }
243
252
  .sekyro-phone__input {
244
253
  flex: 1; min-inline-size: 0; padding: 0; border: 0; outline: none; background: transparent;
245
254
  font: inherit; font-variant-numeric: tabular-nums; color: var(--sekyro-color-fg); caret-color: var(--sekyro-color-brand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sekyro/react",
3
- "version": "0.1.0-rc.10",
3
+ "version": "0.1.0-rc.11",
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": {
@@ -65,7 +65,7 @@
65
65
  ],
66
66
  "scripts": {
67
67
  "build": "tsup",
68
- "test": "node scripts/check-css.mjs && node scripts/gen-step-strings.mjs --check && vitest run",
68
+ "test": "node scripts/check-css.mjs && node scripts/gen-step-strings.mjs --check && node scripts/gen-dial-codes.mjs --check && vitest run",
69
69
  "size": "node scripts/check-size.mjs",
70
70
  "voice:texts": "node --experimental-strip-types scripts/export-voice-texts.mts",
71
71
  "typecheck": "tsc --noEmit",
@@ -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.12 || ^0.2.0-rc.0",
77
+ "@sekyro/web": "^0.1.0-rc.13 || ^0.2.0-rc.0",
78
78
  "react": ">=18.2",
79
79
  "react-dom": ">=18.2"
80
80
  },
@@ -91,6 +91,7 @@
91
91
  "@vitejs/plugin-react": "^4",
92
92
  "jest-axe": "^10",
93
93
  "jsdom": "^25",
94
+ "libphonenumber-js": "1.12.10",
94
95
  "qrcode": "1.5.4",
95
96
  "react": "19.2.0",
96
97
  "react-dom": "19.2.0",
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.10",
101
- "bom-ref": "@sekyro/react@0.1.0-rc.10",
100
+ "version": "0.1.0-rc.11",
101
+ "bom-ref": "@sekyro/react@0.1.0-rc.11",
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.10?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.11?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.10"
150
+ "ref": "@sekyro/react@0.1.0-rc.11"
151
151
  }
152
152
  ]
153
153
  }
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{a as Jt,c as Xt,d as en}from"./chunk-MLGCQ74X.js";import{a as D,h as Dt,i as qt,j as jt,k as $t,l as zt,m as Yt,n as Zt,o as Wt,p as Qt,q as U,r as j,s as qe}from"./chunk-RIE46W4P.js";import{a as n}from"./chunk-2KED7D2Q.js";import{useId as cr}from"react";import{Fragment as ar,jsx as V,jsxs as J}from"react/jsx-runtime";function X({className:e,children:t}){return V("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}n(X,"Svg");var at="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function tn(e){return J(X,{...e,children:[V("circle",{cx:"12",cy:"12",r:"4"}),V("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}n(tn,"SunIcon");function nn(e){return J(X,{...e,children:[V("circle",{cx:"12",cy:"12",r:"9"}),V("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}n(nn,"FaceUncoveredIcon");function rn(e){return J(X,{...e,children:[V("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),V("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),V("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}n(rn,"PhoneEyeLevelIcon");function on(e){return J(X,{...e,children:[V("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),V("circle",{cx:"12",cy:"12",r:"2.8"})]})}n(on,"LookStraightIcon");function sn(e){return J(X,{...e,children:[V("path",{d:at}),V("path",{d:"M9 13l2 2 4-4"})]})}n(sn,"CameraCheckIcon");function an(e){return J(X,{...e,children:[V("path",{d:at}),V("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}n(an,"CameraAskIcon");function cn(e){return J(X,{...e,children:[V("path",{d:at}),V("path",{d:"M3 3l18 18"})]})}n(cn,"CameraBlockedIcon");function ve({off:e,className:t}){return J(X,{className:t,children:[V("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?V("path",{d:"M4 4l16 16"}):J(ar,{children:[V("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),V("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}n(ve,"SpeakerIcon");function ln(e){return V(X,{...e,children:V("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}n(ln,"CheckIcon");function un(e){return J(X,{className:e.className??"sekyro-spinner",children:[V("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),V("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}n(un,"SpinnerIcon");import{jsx as ce,jsxs as dn}from"react/jsx-runtime";var je=["light","uncover","eyeLevel","straight"],lr={light:{key:"capture.tips.light",icon:n(()=>ce(tn,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:n(()=>ce(nn,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:n(()=>ce(rn,{}),"icon")},straight:{key:"capture.tips.straight",icon:n(()=>ce(on,{}),"icon")}};function pn({tips:e}){let t=U(),s=cr();return e.length===0?null:dn("section",{className:"sekyro-tips","aria-labelledby":s,"data-testid":"sekyro-tips",children:[ce("p",{className:"sekyro-tips__title",id:s,children:t("capture.tips.title")}),ce("ul",{className:"sekyro-tips__list",children:e.map(o=>{let r=typeof o=="string"?lr[o]:void 0,a=typeof o=="string"?o:o.id,l=r!==void 0?r.icon():typeof o=="string"?void 0:o.icon,p=r!==void 0?t(r.key):typeof o=="string"?o:o.text;return dn("li",{className:"sekyro-tips__item",children:[l!=null?ce("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:l}):null,ce("span",{children:p})]},a)})})]})}n(pn,"TipList");import{useEffect as fn,useId as ur,useRef as dr,useState as pr}from"react";import{jsx as ee,jsxs as $e}from"react/jsx-runtime";var fr=220;function mn({title:e,description:t,options:s,busy:o,error:r,focus:a,testId:l,look:p="cards",marked:C,onChoose:b}){let w=ur(),M=qe(),[k,c]=pr(null),g=dr(null);fn(()=>{r!==null&&c(null)},[r]),fn(()=>()=>{g.current!==null&&clearTimeout(g.current)},[]);let v=n(u=>{o||k!==null||(c(u),g.current=setTimeout(()=>{g.current=null,c(null),b(u)},fr))},"choose");return $e("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":l,children:[$e("div",{className:"sekyro-stack sekyro-stack--1",children:[ee("h2",{id:w,ref:a?M:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?ee("p",{className:"sekyro-text-muted",children:t}):null]}),r!==null?ee(j,{tone:"danger",children:ee("span",{children:r})}):null,p==="buttons"?ee("div",{className:"sekyro-stack sekyro-stack--3",children:s.map((u,L)=>ee(D,{kind:L===0?"primary":"ghost",full:!0,disabled:o,"aria-busy":o||void 0,onClick:()=>b(u.id),children:u.label},u.id))}):ee("div",{className:"sekyro-choices",children:s.map(u=>$e("button",{type:"button",className:"sekyro-card","aria-pressed":(k??C)===u.id,"aria-busy":o||void 0,disabled:o||k!==null&&k!==u.id,onClick:()=>v(u.id),children:[u.glyph,$e("span",{className:"sekyro-card__body",children:[ee("span",{className:"sekyro-card__title",children:u.label}),u.sub!==void 0?ee("span",{className:"sekyro-card__sub",children:u.sub}):null]}),ee("span",{className:"sekyro-radio","aria-hidden":"true"})]},u.id))})]})}n(mn,"ChoiceScreen");var ze=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","capture.tips.summary"];function pe(e){return e!==null&&ze.includes(e)}n(pe,"isVoiceKey");import{useCallback as ne,useEffect as fe,useLayoutEffect as hr,useMemo as vr,useRef as Ce,useState as _e}from"react";var mr=n((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function ke(e,t,s){let o;try{if(typeof e=="function")o=e(t,s);else{let r=e[s];o=r!=null&&mr(r,t)?r[t]:null}}catch{return null}return typeof o=="string"&&o!==""?o:null}n(ke,"resolveClip");var yr="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",hn={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function te(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}n(te,"synth");function gr(){return te()!==null&&typeof SpeechSynthesisUtterance=="function"}n(gr,"speechAvailable");function yn(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}n(yn,"baseLang");function vn(e,t){let s=n(r=>r.replace(/_/g,"-").toLowerCase(),"norm"),o=yn(t);return e.find(r=>s(r.lang)===s(t))??e.find(r=>yn(r.lang)===o)}n(vn,"pickVoice");function kn(e){if(!gr())return!1;let t=[];try{t=te()?.getVoices()??[]}catch{return!0}return t.length===0||vn(t,e)!==void 0}n(kn,"speechUsable");function Cn(e){let t=te();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}n(Cn,"subscribeVoices");function Pe(e){try{let t=typeof location<"u"?location.href:"http://localhost/",s=new URL(e,t);return`clip:${s.origin}${s.pathname}`}catch{return`clip:${e}`}}n(Pe,"clipIdentity");function gn(e){e.pause(),e.removeAttribute("src"),e.load()}n(gn,"release");function bn(){let e=null,t=null,s=0,o=null,r=[],a=new Map,l=n(()=>{r=te()?.getVoices()??[]},"loadVoices"),p=!1,C=n(()=>{let c=te();p||c===null||(p=!0,l(),c.addEventListener?.("voiceschanged",l))},"bindVoices"),b=n(()=>(e??(e=new Audio),e),"element"),w=n((c,g,v)=>{let u=te();if(u!==null&&c!==""&&typeof SpeechSynthesisUtterance=="function"){C();let L=vn(r,g);if(r.length===0||L!==void 0){u.cancel();let m=new SpeechSynthesisUtterance(c);m.lang=g,L!==void 0&&(m.voice=L),m.rate=.95,v!==void 0&&(m.onend=m.onerror=v),u.speak(m);return}}v?.()},"speak"),M=n(()=>{s+=1,o=null,e!==null&&(e.pause(),e.currentTime=0),te()?.cancel()},"stop"),k=n(c=>{for(let g of c){let v=Pe(g);if(a.has(v))continue;let u=new Audio;u.preload="auto",u.src=g,a.set(v,u)}},"warmClips");return{say(c){let g=c.url!==null?Pe(c.url):`tts:${c.lang}:${c.text}`;if(g===o)return;o=g,s+=1;let v=s,u=c.onEnd,L=u!==void 0?()=>{v===s&&u()}:void 0;if(te()?.cancel(),c.url!==null){let m=b();m.pause(),m.muted=!1,m.src=c.url,m.currentTime=0,m.onended=L??null,m.play()?.catch(S=>{v===s&&S?.name!=="AbortError"&&(c.speech?w(c.text,c.lang,L):L?.())});return}c.speech?w(c.text,c.lang,L):L?.()},unlock({lang:c,speech:g,prefetch:v}){let u=b();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let S=Uint8Array.from(atob(yr),N=>N.charCodeAt(0));t=URL.createObjectURL(new Blob([S],{type:"audio/wav"}))}let L=u.paused===!1&&t!==null&&u.src!==t;t!==null&&!L&&(u.muted=!0,u.onended=null,u.src=t,u.play()?.catch(()=>{}));let m=te();if(g&&m!==null&&typeof SpeechSynthesisUtterance=="function"){C();let S=new SpeechSynthesisUtterance(" ");S.volume=0,S.lang=c,m.speak(S)}k(v??[])},prefetch:k,stop:M,dispose(){M(),p&&te()?.removeEventListener?.("voiceschanged",l),p=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&gn(e),e=null;for(let c of a.values())gn(c);a.clear()}}}n(bn,"createVoicePlayer");var Sn="sekyro.voiceGuidance";function Vn(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}n(Vn,"readVoicePreference");function Rn(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}n(Rn,"writeVoicePreference");var Ae="capture.tips.summary",kr=typeof window<"u"?hr:fe,Cr=Object.freeze({});function ct(e,t){let s=new Set,o=[];for(let r of ze){let a=r===Ae?null:ke(e,r,t);a===null||s.has(Pe(a))||(s.add(Pe(a)),o.push(a))}return o}n(ct,"resolvedClipUrls");function lt({locale:e,defaultClips:t,options:s}){let o=s===!1,r=o?{}:s??{},a=r.storageKey===void 0?Sn:r.storageKey,[l,p]=_e(r.defaultEnabled??!0),C=Ce(l),[b,w]=_e(!1),[M,k]=_e("none"),[c,g]=_e(!1),v=Ce(!1),[u,L]=_e(0),m=Ce(null),S=ne(()=>(m.current??(m.current=bn()),m.current),[]),N=hn[e],O=r.speechFallback,d=O===void 0||O===!0?!0:O===!1?!1:O.includes(e),G=r.clips??t??Cr,F=Ce(!1),q=Ce(G);kr(()=>{q.current=G,C.current=l}),fe(()=>{if(o||a===null)return;let f=Vn(a);f!==null&&(C.current=f,p(f))},[o,a]),fe(()=>{if(!(o||!d))return Cn(()=>L(f=>f+1))},[o,d]);let i=r.clips;fe(()=>{if(o)return;let f=d&&kn(N);w(ct(G,e).length>0||f),k(i!==void 0&&ke(i,Ae,e)!==null?"partner":ke(G,Ae,e)!==null||f?"default":"none")},[o,G,i,e,d,N,u]),fe(()=>{if(o||!l||!F.current)return;let f=ct(G,e);f.length>0&&S().prefetch(f)},[o,l,G,e,S]),fe(()=>()=>{m.current?.dispose(),m.current=null,F.current=!1},[]);let E=ne(f=>{o||(F.current=!0,S().unlock({lang:N,speech:d,...f?{prefetch:ct(q.current,e)}:{}}))},[o,S,N,d,e]),I=ne(()=>E(C.current),[E]),P=ne(()=>{v.current=!1,g(!1)},[]),A=ne(()=>{P(),m.current?.stop()},[P]),Y=ne(()=>{v.current&&A()},[A]),ue=ne((f,K)=>{if(o)return;if(v.current){A();return}let re=S();re.stop(),v.current=!0,g(!0);let x=K?.clip===!1?null:ke(q.current,Ae,e);re.say({url:x,text:f,lang:N,speech:d,onEnd:P})},[o,A,S,e,N,d,P]),_=ne(f=>{o||(f?E(!0):A(),a!==null&&Rn(a,f),C.current=f,p(f))},[o,E,A,a]),Z=ne(()=>_(!C.current),[_]),T=ne((f,K)=>{if(o||!l)return;v.current&&P();let re=ke(q.current,f,e);S().say({url:re,text:K,lang:N,speech:d})},[o,l,e,S,N,d,P]);return vr(()=>({supported:!o&&b,enabled:!o&&l,setEnabled:_,toggle:Z,unlock:I,speakKey:T,stop:A,summary:o?"none":M,summaryPlaying:c,toggleSummary:ue,stopSummary:Y}),[o,b,l,_,Z,I,T,A,M,c,ue,Y])}n(lt,"useVoiceGuidance");function ut(e,t,s,o){let{speakKey:r,stop:a,enabled:l}=e,p=Ce(!1);fe(()=>{if(!o||!l){p.current&&a(),p.current=!1;return}p.current=!0,pe(t)&&t!==Ae&&s!==""&&r(t,s)},[o,l,t,s,r,a])}n(ut,"useSpeakGuidance");import{isValidElement as Yr,useCallback as Je,useContext as Zr,useEffect as le,useMemo as Le,useRef as me,useState as Wn}from"react";import{useEffect as br,useRef as Sr}from"react";import{jsx as be,jsxs as dt}from"react/jsx-runtime";function Ln({showCoaching:e,attemptsText:t,showRetake:s,onRetake:o}){let r=U(),a=Sr(null);return br(()=>{s&&a.current?.focus()},[s]),!e&&!s?null:dt("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?dt("div",{className:"sekyro-stack sekyro-stack--1",children:[be("p",{className:"sekyro-text-body",children:r("capture.retryCoaching.title")}),dt("ul",{className:"sekyro-coaching",children:[be("li",{children:r("capture.retryCoaching.light")}),be("li",{children:r("capture.retryCoaching.eyeLevel")}),be("li",{children:r("capture.retryCoaching.head")})]}),t!==null?be("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:t}):null]}):null,s?be(D,{ref:a,className:"sekyro-btn--start",onClick:o,children:r("capture.recordAgain")}):null]})}n(Ln,"CapturedPanel");function Ye(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}n(Ye,"isDevBuild");import{createContext as Vr}from"react";var wn=Vr(null);import{useCallback as En,useEffect as Pn,useRef as Se}from"react";import{useId as Rr}from"react";import{jsx as Ze,jsxs as pt}from"react/jsx-runtime";var Lr=["user","environment"];function Mn({value:e,onChange:t}){let s=U(),o=Rr();return pt("fieldset",{className:"sekyro-segmented","data-testid":"sekyro-facing",children:[Ze("legend",{className:"sekyro-segmented__legend",children:s("capture.cameraLabel")}),Ze("div",{className:"sekyro-segmented__options",children:Lr.map(r=>pt("label",{className:"sekyro-segmented__option",children:[Ze("input",{type:"radio",className:"sekyro-segmented__input",name:o,value:r,checked:e===r,onChange:()=>t(r)}),pt("span",{className:"sekyro-segmented__face",children:[Ze("span",{className:"sekyro-segmented__dot","aria-hidden":"true"}),s(`capture.facing.${r}`)]})]},r))})]})}n(Mn,"FacingPicker");import{useEffect as wr,useState as Mr}from"react";import{jsx as Te,jsxs as Ir}from"react/jsx-runtime";function In({state:e}){let t=U(),[s,o]=Mr(!1);wr(()=>{e!=="unknown"&&o(!0)},[e]);let r=e==="granted"?Te(sn,{}):e==="denied"?Te(cn,{}):Te(an,{});return Ir("div",{role:s?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[Te("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:r}),Te("span",{children:t(`capture.permission.${e}`)})]})}n(In,"PermissionRow");import{jsx as We,jsxs as xn}from"react/jsx-runtime";function Nn({voice:e}){let t=U();if(!e.supported)return null;let s=e.enabled;return xn("button",{type:"button",role:"switch","aria-checked":s,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:()=>e.toggle(),children:[xn("span",{className:"sekyro-switch__label",children:[We(ve,{off:!s}),t("capture.voiceGuidance")]}),We("span",{className:"sekyro-switch__track","aria-hidden":"true",children:We("span",{className:"sekyro-switch__thumb",children:s?We(ln,{className:"sekyro-switch__check"}):null})})]})}n(Nn,"VoiceSwitch");import{Fragment as Nr,jsx as B,jsxs as Ve}from"react/jsx-runtime";function _n({assets:e,onRetryAssets:t,permission:s,captureMode:o="self",canChooseFacing:r,facing:a,onFacingChange:l,voice:p,tips:C,summary:b,startLabel:w,startDisabled:M,onStart:k}){let c=U(),g=Se(b?.stop);g.current=b?.stop,Pn(()=>()=>g.current?.(),[]);let v=Se(null),u=Se(null),L=Se(null),m=Se(e),S=Se(!1);Pn(()=>{let i=m.current;if(m.current=e,i===e)return;let E=S.current;e!=="loading"&&(S.current=!1),xr(v.current)&&(e==="failed"?L.current?.focus():E&&u.current?.focus())},[e]);let N=En(()=>{S.current=!0,t()},[t]),O=e==="loading",d=O||M,G=En(()=>{d||(g.current?.(),k())},[d,k]),F;e==="failed"?F=Ve(j,{tone:"danger",testId:"sekyro-assets-error",children:[B("p",{className:"sekyro-text-body",children:c("fcv2.err.models")}),B(D,{kind:"ghost",ref:L,className:"sekyro-btn--start",onClick:N,"data-testid":"sekyro-assets-retry",children:c("common.retry")})]}):F=Ve("div",{className:"sekyro-stack sekyro-stack--1",children:[B(D,{ref:u,full:!0,"data-testid":"sekyro-start","aria-disabled":d?"true":void 0,"aria-busy":O?"true":void 0,onClick:G,children:O?Ve(Nr,{children:[B(un,{}),c("capture.preparing.title")]}):w??c("capture.start")}),O?B("p",{className:"sekyro-text-muted",children:c("capture.preparing.hint")}):null]});let q=o==="assisted";return Ve("div",{ref:v,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[q?Ve("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[B("h2",{className:"sekyro-text-body",children:c("capture.assisted.title")}),B("p",{className:"sekyro-text-muted",children:c("capture.assisted.lead")})]}):null,C!==!1?B(pn,{tips:C}):null,b!==void 0?Ve(D,{kind:"ghost",className:"sekyro-btn--start",onClick:b.toggle,"data-testid":"sekyro-tips-listen",children:[B(ve,{off:!1}),c(b.playing?"capture.tips.stop":"capture.tips.listen")]}):null,B(In,{state:s}),q&&r?B(Mn,{value:a,onChange:l}):null,B(Nn,{voice:p}),B("p",{className:"sekyro-text-muted",children:c("capture.securityNote")}),F,B("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?c("capture.preparing.title"):e==="ready"?c("capture.ready"):""})]})}n(_n,"PreCaptureScreen");function xr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}n(xr,"focusIsOurs");import{useEffect as ft,useState as mt}from"react";function An(e){return Kn(e,"mobileRequired")}n(An,"useMobileRequired");function Tn(e){return Kn(e,"returning").required}n(Tn,"useReturning");function Kn(e,t){let[s,o]=mt({required:!1,settled:e===void 0});return ft(()=>{let r=e?.[t];if(e===void 0||typeof r!="function"){o({required:!1,settled:!0});return}let a=!0;return o({required:!1,settled:!1}),Promise.resolve().then(()=>r.call(e)).then(l=>{a&&o({required:l===!0,settled:!0})},()=>{a&&o({required:!1,settled:!0})}),()=>{a=!1}},[e,t]),s}n(Kn,"useFlag");function On(e){let[t,s]=mt({mode:"self",settled:e===void 0});return ft(()=>{let o=e?.captureMode;if(e===void 0||typeof o!="function"){s({mode:"self",settled:!0});return}let r=!0;return s({mode:"self",settled:!1}),Promise.resolve().then(()=>o.call(e)).then(a=>{r&&s({mode:a==="assisted"?"assisted":"self",settled:!0})},()=>{r&&s({mode:"self",settled:!0})}),()=>{r=!1}},[e]),t}n(On,"useCaptureMode");function Fn(e){let[t,s]=mt(!1);return ft(()=>{if(s(!1),e===void 0)return;let o=e.on("busy",()=>s(!0)),r=e.on("result",()=>s(!1));return()=>{o(),r()}},[e]),t}n(Fn,"useBusy");import{getLivenessAssetsStatus as Er,preloadLivenessAssets as Pr,subscribeLivenessAssets as _r}from"@sekyro/web";import{useCallback as yt,useEffect as Hn,useRef as Un,useState as Ar,useSyncExternalStore as Tr}from"react";var Kr=n(()=>"idle","serverSnapshot");function Bn(e){return Pr(e!==void 0?{assetBaseUrl:e}:{})}n(Bn,"preload");function Gn(e,t=!0){let s=Tr(yt(M=>_r(M,e),[e]),()=>Er(e),Kr),[o,r]=Ar(null),a=Un(!1),l=yt(()=>{Bn(e).then(M=>{a.current&&M==="idle"&&r({base:e})})},[e]);Hn(()=>(a.current=!0,l(),()=>{a.current=!1}),[l]);let p=Un(null);Hn(()=>{if(s!=="idle"){p.current={base:e};return}!t||p.current===null||p.current.base!==e||(p.current=null,l())},[s,e,l,t]);let C=yt(()=>{Bn(e)},[e]);return{gate:o!==null&&o.base===e&&s==="idle"||s==="ready"?"ready":s==="failed"?"failed":"loading",retry:C}}n(Gn,"useLivenessAssets");import{createLivenessCapture as Or}from"@sekyro/web";import{useCallback as gt,useEffect as Fr,useRef as Re,useState as z}from"react";var Dn={progress:0,hint:null,faceDetected:!1};function qn(e){let{videoRef:t,assetBaseUrl:s}=e,r=Re(e.verification).current,a=Re(!1);e.verification!==r&&!a.current&&Ye()&&(a.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let l=Re(null),[p,C]=z("idle"),[b,w]=z(Dn),[M,k]=z(!1),[c,g]=z(!1),[v,u]=z(null),[L,m]=z(!1),[S,N]=z(null),[O,d]=z(null),[G,F]=z(null),[q,i]=z(null),[E,I]=z(null),P=Re(null),A=Re("idle"),Y=Re(e);Y.current=e,Fr(()=>{let T=t.current;if(T===null)return;let f={video:T,...s!==void 0?{assetBaseUrl:s}:{}},K=r!==void 0?r.liveness(f):Or(f);l.current=K;let re=n(()=>I(K.facingMode??null),"readFacing");re();let x=[K.on("state",h=>{h==="starting"?(d(null),F(null),w(Dn),g(!1),k(!1),u(null),N(null),P.current=null):h==="gating"&&A.current==="recording"&&(g(!1),k(!1),u(null),P.current=null),A.current=h,re(),C(h),Y.current.onStateChange?.(h)}),K.on("gate",h=>{let ye=P.current;P.current=h.progress,k(ye!==null&&h.progress<ye-.001&&h.progress>0&&h.progress<1),h.progress>=1&&g(!0),w(h)}),K.on("frozen",({previewDataUrl:h})=>u(h)),K.on("profile",({animations:h})=>m(h==="reduced")),K.on("ramp",({colour:h})=>N(h)),K.on("captured",h=>{d(h),i(null),Y.current.onCaptured?.(h)}),K.on("error",h=>{F(h),Y.current.onError?.(h)}),r?.on("result",h=>{i(h),Y.current.onResult?.(h)})];return()=>{for(let h of x)h?.();l.current=null,K.destroy()}},[r,t,s]);let ue=gt(T=>{l.current?.start(T)},[]),_=gt(()=>{l.current?.retry()},[]),Z=gt(()=>{let T=l.current,f=T?.switchCamera()===!0;return f&&(I(T?.facingMode??null),g(!1),k(!1),u(null),P.current=null),f},[]);return{state:p,gate:b,draining:M,gateLocked:c,frozenPreview:v,reduceMotion:L,rampColour:S,artifacts:O,error:G,result:q,facingMode:E,start:ue,retry:_,switchCamera:Z}}n(qn,"useLivenessHandle");import{useCallback as Hr,useEffect as Ur,useState as Qe}from"react";var Br=new Set(["national_number"]);function jn(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(s=>Br.has(s));return t.length>0?{...e,options:t}:null}n(jn,"pending");function $n(e){let[t,s]=Qe(null),[o,r]=Qe(e===void 0),[a,l]=Qe(!1),[p,C]=Qe(!1);Ur(()=>{if(s(null),e===void 0){r(!0);return}let k=!0,c=e.methodChoice;typeof c=="function"?(r(!1),Promise.resolve().then(()=>c.call(e)).then(v=>{k&&s(jn(v))},()=>{}).finally(()=>{k&&r(!0)})):r(!0);let g=e.on("method",v=>s(jn(v)));return()=>{k=!1,g()}},[e]);let b=Hr(async k=>{if(e===void 0)return!1;l(!0),C(!1);try{return await e.selectMethod(k),s(null),!0}catch{return C(!0),!1}finally{l(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!p?w:null,settled:o,busy:a,failed:p,select:b}}n($n,"useMethodChoice");import{useEffect as Gr,useMemo as Dr,useState as qr}from"react";var jr=["ar","fr","en"];function $r(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}n($r,"isClipUrl");function zr(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let s={};for(let o of jr){let r=t[o];if(!(typeof r!="object"||r===null))for(let[a,l]of Object.entries(r))!pe(a)||!$r(l)||((s[o]??(s[o]={}))[a]=l)}return Object.keys(s).length>0?s:null}n(zr,"toVoiceClipMap");function zn(e){let[t,s]=qr(null);Gr(()=>{if(s(null),e===void 0)return;let r=!0,a=n(p=>{if(!r)return;let C=typeof p=="object"&&p!==null&&typeof p.setId=="string"?p:null;s(b=>b?.setId===C?.setId?b:C)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(a,()=>a(null))}catch{a(null)}let l=e.on("view",p=>a(p.voice));return()=>{r=!1,l()}},[e]);let o=Dr(()=>t!==null?zr(t):null,[t]);return e===void 0?null:o}n(zn,"useServerVoiceClips");import{jsx as Yn}from"react/jsx-runtime";function Zn({voice:e}){let t=U();return Yn(D,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:()=>e.toggle(),children:Yn(ve,{off:!e.enabled,className:"sekyro-icon"})})}n(Zn,"VoiceChip");import{Fragment as Qn,jsx as R,jsxs as we}from"react/jsx-runtime";var Wr=800;function Qr(e){return e===void 0||e!==!1&&e.length===je.length&&je.every(t=>e.includes(t))}n(Qr,"isDefaultTips");function Jr(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}n(Jr,"carriesActivation");function Xr(e){return typeof e=="object"&&e!==null&&!Yr(e)&&"tone"in e&&"text"in e}n(Xr,"isNoticeObject");function eo(e){return e==="starting"||e==="gating"||e==="recording"}n(eo,"isCapturing");function to(e){return e==="captured"||e==="uploading"||e==="checking"}n(to,"isPostCapture");function mi({verification:e,locale:t,dir:s,strings:o,slots:r,autoStart:a=!1,notice:l,startDisabled:p=!1,startLabel:C,tips:b,tipsSummary:w,coach:M,voice:k,onGuidance:c,onCaptured:g,onResult:v,onError:u,onStateChange:L,assetBaseUrl:m,className:S}){let N=Wt(t),O=Le(()=>Zt(t,o),[t,o,N]),d=Le(()=>y=>O[y]??"",[O]),G=s??(t==="ar"?"rtl":"ltr"),F=me(null),q=Zr(wn),i=qn({verification:e,videoRef:F,assetBaseUrl:m,onCaptured:g,onResult:v,onError:u,onStateChange:L}),E=Gn(m,i.state==="idle"&&i.error===null),I=$n(e),P=I.choice!==null,A=An(e),Y=Tn(e),ue=Fn(e),_=Xt(),Z=On(e),T=Z.mode==="assisted",f=T&&_.canChooseFacing,K=k!==!1&&k?.clips===void 0,re=zn(K?e:void 0),x=lt({locale:t,defaultClips:re,options:k}),[h,ye]=Wn(null),W=T?h??(_.canChooseFacing?"environment":"user"):"user",ht=Z.settled&&(!T||_.facingSettled),vt=me(null),Ke=me(!1),kt=me(x.unlock);kt.current=x.unlock,le(()=>{let y=vt.current;if(y===null)return;let Q=["pointerup","touchend","click","keydown"],ae=n(()=>{for(let Ee of Q)y.removeEventListener(Ee,he,!0)},"disarm");function he(Ee){if(Ke.current){ae();return}Jr(Ee)&&(Ke.current=!0,ae(),kt.current())}n(he,"onGesture");for(let Ee of Q)y.addEventListener(Ee,he,{capture:!0,passive:!0});return ae},[]);let Ct=Je(()=>{Ke.current||(Ke.current=!0,x.unlock()),i.start({facing:W})},[x.unlock,i.start,W]),bt=Je(()=>i.start({facing:W}),[i.start,W]),Oe=me(!1),Me=i.state==="idle"&&i.error===null,St=!P&&!A.required&&(a===!0||a==="when-permitted"&&_.permission==="granted"),Vt=St&&I.settled&&A.settled&&ht,Jn=a==="when-permitted"&&!_.permissionSettled&&!Oe.current,Rt=St&&Me&&!Oe.current,Xe=(Jn||Rt||!ht)&&E.gate==="ready"?"loading":E.gate;le(()=>{!Vt||!Me||E.gate!=="ready"||Oe.current||(Oe.current=!0,bt())},[Vt,Me,E.gate,bt]);let Xn=Me&&!P&&!A.required&&!(Rt&&E.gate==="ready"),Lt=Je(()=>{i.switchCamera()&&ye(W==="user"?"environment":"user")},[i.switchCamera,W]),wt=i.state!=="idle"&&i.facingMode!==null?i.facingMode:W;le(()=>{let y=F.current?.style;wt==="user"?y?.removeProperty("transform"):y&&(y.transform="none")},[wt]);let Fe=Le(()=>i.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(i.artifacts.keyframe):null,[i.artifacts]);le(()=>{if(Fe!==null)return()=>URL.revokeObjectURL(Fe)},[Fe]);let Mt=i.frozenPreview??Fe,ge=e!==void 0,H=eo(i.state),ie=to(i.state),He=H||ie,$=i.result,It=i.state==="done"&&$!==null,xt=i.state==="recording"&&i.frozenPreview!==null,et=q!==null,Ie=ie||xt,Nt=ie?"checking":xt?"frozen":i.state==="recording"?"recording":i.gateLocked||i.gate.progress>=1?"locked":i.gate.faceDetected?"aligning":"seeking",Ue=H?i.gate.hint:null,Be=i.state==="starting"?"capture.preparing.title":Ue===null?null:Ue==="center"&&!i.gate.faceDetected?"fcv3.no_face":Dt(Ue),[er,Et]=Wn(null);le(()=>{if(Be!=="fcv3.no_face"){Et(Be);return}if(!H)return;let y=setTimeout(()=>Et(Be),Wr);return()=>clearTimeout(y)},[Be,H]);let tt=H&&typeof M=="string"&&M!=="",Pt=T&&H?d("capture.assisted.stage"):null,de=H&&!tt?er:null,nt=tt?M:de===null?"":d(de);ut(x,de,nt,H);let _t=me(c);_t.current=c,le(()=>{if(pe(de))try{_t.current?.(de)}catch(y){console.error("[@sekyro/react] onGuidance threw:",y)}},[de]);let xe=Le(()=>({supported:x.supported,enabled:x.enabled,setEnabled:x.setEnabled,toggle:x.toggle}),[x.supported,x.enabled,x.setEnabled,x.toggle]),rt=r?.voicePrompt,At=rt!==void 0,Tt=k===void 0,Kt=me(!1);le(()=>{!At||!Tt||Kt.current||!Ye()||(Kt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[At,Tt]);let tr=rt!==void 0?(y,Q,ae)=>rt(y,Q,ae,xe):x.supported?()=>R(Zn,{voice:xe}):void 0,{summary:ot,summaryPlaying:Ot,toggleSummary:Ft,stopSummary:Ht}=x,Ge=w!==void 0&&w!=="",Ut=Ge?w:d("capture.tips.summary"),Bt=Ge?ot!=="none":ot==="partner"||ot==="default"&&Qr(b),nr=Le(()=>Bt?{playing:Ot,toggle:n(()=>Ft(Ut,{clip:!Ge}),"toggle"),stop:Ht}:void 0,[Bt,Ot,Ft,Ut,Ht,Ge]),rr=Le(()=>({assets:Xe,retryAssets:E.retry,permission:_.permission,permissionSettled:_.permissionSettled,captureMode:Z.mode,facing:W,setFacing:ye,canChooseFacing:f,voice:xe}),[Xe,E.retry,_.permission,_.permissionSettled,Z.mode,f,W,xe]),or=Xr(l)?R(j,{tone:l.tone,testId:"sekyro-host-notice",children:R("span",{children:l.text})}):l??null,oe=$!==null&&$.status==="retry"?$:null,se=It&&$.status==="unavailable"&&!P&&$.reason!=="portrait_required"?$:null,Ne=It&&($.status==="approved"||$.status==="rejected"||$.status==="review")?$:null,De=n((y,Q)=>{if(y===void 0)return null;if(y==="device_cooldown"){let he=zt(t,Q);if(he!==null)return d(he.key).replace("{time}",he.time)}let ae=$t(y);return ae===null?null:d(ae)},"reasonText"),st=n(y=>{let Q=y.retakeHint===void 0?null:qt(y.retakeHint);return Q===null?De(y.reason):d(Q)},"retryText"),sr=se!==null&&se.reason!==void 0&&se.reason!=="nni_unbound"&&se.reason!=="method_required"&&se.reason!=="mobile_required"&&!(se.reason==="no_recorder"&&i.artifacts?.degraded==="NO_RECORDER"),Gt=qe(),ir=P&&I.auto===null&&!H&&!ie&&i.error===null,it=Je(async y=>{await I.select(y)&&i.state==="done"&&i.retry()},[I.select,i.state,i.retry]);return le(()=>{I.auto!==null&&!I.busy&&!H&&!ie&&it(I.auto)},[I.auto,I.busy,H,ie,it]),R(Qt,{value:d,children:we("div",{ref:vt,className:S===void 0?"sekyro-capture":`sekyro-capture ${S}`,dir:G,lang:t,"data-testid":"sekyro-liveness-capture","data-state":i.state,children:[r?.header,oe!==null&&st(oe)!==null&&!(et&&He)?R(j,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:R("span",{children:st(oe)})}):null,ue&&ie&&!et?R(j,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:R("span",{children:d("capture.busy")})}):null,A.required&&Me?R(j,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:R("span",{children:d("reasons.mobile_required")})}):null,i.error!==null?r?.errorPanel!==void 0?r.errorPanel(i.error,i.retry):we(j,{tone:"danger",testId:"sekyro-error-notice",children:[R("span",{children:d(jt(i.error.kind))}),i.error.retryable?R(D,{ref:Gt,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:d("common.retry")}):null]}):null,se!==null?we(j,{tone:"danger",testId:"sekyro-unavailable-notice",children:[R("span",{children:De(se.reason)??d(se.reason===void 0?"errors.session_expired":"errors.network_error")}),sr?R(D,{ref:Gt,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:d("capture.recordAgain")}):null]}):null,Ne!==null&&De(Ne.reason)!==null?R(j,{tone:Ne.status==="rejected"?"danger":"info",testId:"sekyro-result-notice",children:R("span",{children:De(Ne.reason,Ne.retryAfter)})}):null,R("div",{className:He?void 0:"sekyro-hidden","data-capture-live":He?"":void 0,children:et?q({videoRef:F,guidance:Ie&&ge?d("capture.checking"):nt,coached:tt&&!(Ie&&ge),note:Ie?ge?d(ue?"capture.busy":"capture.checkingHint"):null:oe!==null?st(oe):Pt,settled:Ie&&ge,progress:i.gate.progress,phase:Nt,still:Ie?Mt:null,live:He,switchCamera:H&&i.state!=="recording"&&f&&Lt,ramp:i.rampColour===null?null:{colour:i.rampColour}}):R(Jt,{videoRef:F,guidanceText:nt,guidanceHint:Ue,guidanceKey:de,progress:i.gate.progress,phase:Nt,draining:i.draining,stillUrl:Mt,showChecking:ge,onSwitchCamera:Lt,canSwitchCamera:T&&H&&i.state!=="recording",operatorText:Pt,voicePrompt:tr,overlay:y=>we(Qn,{children:[r?.stageOverlay?.(y),R(en,{colour:i.rampColour})]}),reduceMotion:i.reduceMotion})}),ir&&I.choice!==null?R(mn,{title:d("method.title"),description:d("method.description"),options:I.choice.options.map(y=>({id:y,label:d(`method.${y}`)})),busy:I.busy,error:I.failed?d("errors.network_error"):null,focus:i.state==="done",testId:"sekyro-method",look:"buttons",onChoose:y=>{it(y)}}):null,Xn?we(Qn,{children:[Y&&r?.header===void 0?we("div",{className:"sekyro-stack sekyro-stack--1",children:[R("h2",{className:"sekyro-text-body",children:d("returning.title")}),R("p",{className:"sekyro-text-muted",children:d("returning.description")})]}):null,or,r?.intro!==void 0?r.intro(Ct,rr):R(_n,{assets:Xe,onRetryAssets:E.retry,permission:_.permission,captureMode:Z.mode,canChooseFacing:f,facing:W,onFacingChange:ye,voice:xe,tips:b??je,summary:nr,startLabel:C,startDisabled:p,onStart:Ct})]}):null,R(Ln,{showCoaching:oe!==null,attemptsText:oe?.attemptsRemaining!==void 0?Yt(O,t,oe.attemptsRemaining):null,showRetake:oe!==null&&!H&&!ie||!ge&&i.state==="captured",onRetake:i.retry}),r?.footer]})})}n(mi,"LivenessCapture");export{wn as a,Mn as b,je as c,mn as d,ze as e,Wr as f,mi as g};
@@ -1,2 +0,0 @@
1
- "use client";
2
- import{m as n,r}from"./chunk-RIE46W4P.js";import{a as o}from"./chunk-2KED7D2Q.js";import{jsx as i}from"react/jsx-runtime";function a({tone:t,children:e}){return i(r,{tone:t,children:e})}o(a,"StepNotice");function f(t,e,p){return p?t.t("common.noAttemptsLeft"):n(t.strings,t.locale,e)}o(f,"attemptsLine");export{a,f as b};