@sekyro/react 0.1.0-rc.25 → 0.1.0-rc.27
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.
- package/CHANGELOG.md +39 -0
- package/dist/chunk-2UDX3MRT.js +2 -0
- package/dist/chunk-3MCTR3RI.js +2 -0
- package/dist/chunk-5V26KZGZ.js +2 -0
- package/dist/{chunk-H52ULGOP.js → chunk-A7UG6YDG.js} +1 -1
- package/dist/{chunk-X3RL4N3W.js → chunk-CBQYUAKA.js} +1 -1
- package/dist/{chunk-RTYAGWRR.js → chunk-DTXKBOS4.js} +1 -1
- package/dist/chunk-FE6AS435.js +2 -0
- package/dist/{chunk-BDXOOTQL.js → chunk-HO5RMTZU.js} +1 -1
- package/dist/{chunk-J2W5XO7Q.js → chunk-KGUF5KAK.js} +1 -1
- package/dist/chunk-U5GKKEZQ.js +2 -0
- package/dist/{chunk-UNYAD2GI.js → chunk-VN4C5C2R.js} +1 -1
- package/dist/{chunk-YE6VVNPZ.js → chunk-VOIZLJLI.js} +1 -1
- package/dist/{chunk-MJ6TE26G.js → chunk-WVYPT45I.js} +1 -1
- package/dist/chunk-ZARKJW2C.js +2 -0
- package/dist/{chunk-6ZRCWVYJ.js → chunk-ZTCQFWDM.js} +1 -1
- package/dist/document-capture-view-5FWUD45F.js +2 -0
- package/dist/{eid-view-7CTFIZ5R.js → eid-view-U2HL2IX7.js} +1 -1
- package/dist/{email-otp-view-MB334KKV.js → email-otp-view-CMJHROOH.js} +1 -1
- package/dist/flow-views-O3KBN7YF.js +2 -0
- package/dist/form-view-WVPN7ZUY.js +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/overlay-de-PVJMYZGV.js +2 -0
- package/dist/overlay-es-PZCE25XM.js +2 -0
- package/dist/overlay-pt-PZ3L6DR7.js +2 -0
- package/dist/{portrait-capture-view-DSUGE7PI.js → portrait-capture-view-UYISOXXV.js} +1 -1
- package/dist/portrait-review-view-67VI2Q6K.js +2 -0
- package/dist/proof-of-address-view-EIQXYYM3.js +2 -0
- package/dist/{theme-quu7XV_Y.d.ts → theme-CMvkgsqM.d.cts} +2 -0
- package/dist/{theme-quu7XV_Y.d.cts → theme-CMvkgsqM.d.ts} +2 -0
- package/dist/verification/index.cjs +1 -1
- package/dist/verification/index.d.cts +89 -5
- package/dist/verification/index.d.ts +89 -5
- package/dist/verification/index.js +1 -1
- package/dist/verification.css +80 -10
- package/package.json +3 -3
- package/sbom.cdx.json +5 -5
- package/dist/chunk-ND4YIVDH.js +0 -2
- package/dist/chunk-Q32AQDEB.js +0 -2
- package/dist/chunk-TXFU3GMZ.js +0 -2
- package/dist/chunk-XCX4NPBX.js +0 -2
- package/dist/document-capture-view-ZKT3W6UE.js +0 -2
- package/dist/flow-views-SRAXHC6K.js +0 -2
- package/dist/overlay-de-ILMZBGZH.js +0 -2
- package/dist/overlay-es-YLDY73HJ.js +0 -2
- package/dist/overlay-pt-GZXT2S6D.js +0 -2
- package/dist/portrait-review-view-PPYEEMYM.js +0 -2
- package/dist/proof-of-address-view-2M6UDK76.js +0 -2
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{q as k,r as h,s as M}from"./chunk-Q32AQDEB.js";import{a as t}from"./chunk-2KED7D2Q.js";var m={success:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M8.5 12.5L10.5 14.5L15.5 9.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',pending:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M12 8V12L14.5 14.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',info:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M12 17V11" stroke="currentColor" stroke-linecap="round"/><path d="M12 8H12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',timer:'<path d="M3 13A9 9 0 1 0 21 13A9 9 0 1 0 3 13Z" stroke="currentColor"/><path d="M12 9V13L14.5 15.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.5 4.5L7.5 2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M20.5 4.5L16.5 2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',closeCircle:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M14.5 9.5L9.5 14.5M9.5 9.5L14.5 14.5" stroke="currentColor" stroke-linecap="round"/>',sms:'<path d="M14.6 19.21C14.26 19.41 14.05 19.76 13.63 20.47L13.09 21.39C12.6 22.2 11.4 22.2 10.91 21.39L10.37 20.47C9.95 19.76 9.74 19.41 9.4 19.21C9.07 19.01 8.64 19.01 7.79 18.99C6.53 18.97 5.75 18.89 5.09 18.62C3.86 18.11 2.89 17.14 2.38 15.91C2 14.99 2 13.83 2 11.5V10.5C2 7.23 2 5.59 2.74 4.39C3.15 3.71 3.71 3.15 4.39 2.74C5.59 2 7.23 2 10.5 2H13.5C16.77 2 18.41 2 19.61 2.74C20.29 3.15 20.85 3.71 21.26 4.39C22 5.59 22 7.23 22 10.5V11.5C22 13.83 22 14.99 21.62 15.91C21.11 17.14 20.14 18.11 18.91 18.62C18.25 18.89 17.47 18.97 16.21 18.99C15.36 19.01 14.93 19.01 14.6 19.21Z" stroke="currentColor" stroke-linecap="round"/>',whatsapp:'<path d="M17.47 14.38c-0.3-0.15-1.76-0.87-2.03-0.97c-0.27-0.1-0.47-0.15-0.670.15c-0.20.3-0.770.97-0.94 1.16c-0.170.2-0.350.22-0.640.07c-0.3-0.15-1.25-0.46-2.39-1.48c-0.88-0.79-1.48-1.76-1.65-2.06c-0.17-0.3-0.02-0.460.13-0.61c0.13-0.130.3-0.350.45-0.52s0.2-0.30.3-0.5c0.1-0.20.05-0.37-0.03-0.52s-0.67-1.61-0.92-2.21c-0.24-0.58-0.49-0.5-0.67-0.51a13 13 0 0 0-0.57-0.01c-0.2 0-0.520.07-0.790.37c-0.270.3-1.04 1.02-1.04 2.48c0 1.46 1.06 2.88 1.21 3.07s2.1 3.2 5.08 4.49c0.710.31 1.260.49 1.690.63c0.710.23 1.360.2 1.870.12c0.57-0.09 1.76-0.72 2.01-1.41s0.25-1.290.17-1.41c-0.07-0.12-0.27-0.2-0.57-0.35m-5.42 7.4h0a9.87 9.87 0 0 1-5.03-1.38l-0.36-0.21l-3.740.98l1-3.65l-0.23-0.37a9.86 9.86 0 0 1-1.51-5.26c0-5.45 4.44-9.88 9.89-9.88c2.64 0 5.12 1.03 6.99 2.9a9.82 9.82 0 0 1 2.89 6.99c0 5.45-4.44 9.88-9.88 9.88m8.41-18.3A11.82 11.82 0 0 0 12.05 0C5.5 0 0.16 5.330.16 11.89c0 2.10.55 4.14 1.59 5.95L0.06 24l6.3-1.65a11.9 11.9 0 0 0 5.68 1.45h0.01c6.55 0 11.89-5.33 11.89-11.89a11.82 11.82 0 0 0-3.48-8.41" fill="currentColor"/>',back:'<path d="M15 5L9 12L15 19" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',warning:'<path d="M5.31 10.76C8.23 5.59 9.69 3 12 3C14.31 3 15.77 5.59 18.69 10.76L19.05 11.41C21.48 15.71 22.69 17.86 21.59 19.43C20.5 21 17.79 21 12.36 21H11.64C6.21 21 3.5 21 2.41 19.43C1.31 17.86 2.52 15.71 4.95 11.41L5.31 10.76Z" stroke="currentColor"/><path d="M12 8V13" stroke="currentColor" stroke-linecap="round"/><path d="M12 16H12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',external:'<path d="M9 15L15 9M15 13.5V9H10.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/>'};var d={id:'<path d="M4 6H17C18.66 6 20 7.34 20 9V19C20 20.66 18.66 22 17 22H7C5.34 22 4 20.66 4 19V6ZM4 6V5" stroke="currentColor" stroke-linejoin="round"/><path d="M9 13A3 3 0 1 0 15 13A3 3 0 1 0 9 13Z" stroke="currentColor"/><path d="M18 6H5.07C4.48 6 4 5.52 4 4.93C4 4.4 4.39 3.94 4.92 3.87L15.72 2.33C16.92 2.15 18 3.09 18 4.31V6Z" stroke="currentColor" stroke-linejoin="round"/><path d="M10 19H14" stroke="currentColor" stroke-linecap="round"/>',card:'<path d="M2 12C2 8.23 2 6.34 3.17 5.17C4.34 4 6.23 4 10 4H14C17.77 4 19.66 4 20.83 5.17C22 6.34 22 8.23 22 12C22 15.77 22 17.66 20.83 18.83C19.66 20 17.77 20 14 20H10C6.23 20 4.34 20 3.17 18.83C2 17.66 2 15.77 2 12Z" stroke="currentColor"/><path d="M10 16H6" stroke="currentColor" stroke-linecap="round"/><path d="M14 16H12.5" stroke="currentColor" stroke-linecap="round"/><path d="M2 10L22 10" stroke="currentColor" stroke-linecap="round"/>',lock:'<path d="M2 16C2 13.17 2 11.76 2.88 10.88C3.76 10 5.17 10 8 10H16C18.83 10 20.24 10 21.12 10.88C22 11.76 22 13.17 22 16C22 18.83 22 20.24 21.12 21.12C20.24 22 18.83 22 16 22H8C5.17 22 3.76 22 2.88 21.12C2 20.24 2 18.83 2 16Z" stroke="currentColor"/><path d="M6 10V8C6 4.69 8.69 2 12 2C15.31 2 18 4.69 18 8V10" stroke="currentColor" stroke-linecap="round"/>',passport:'<path d="M4 6H17C18.66 6 20 7.34 20 9V19C20 20.66 18.66 22 17 22H7C5.34 22 4 20.66 4 19V6ZM4 6V5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M15 13A3 3 0 1 1 9 13A3 3 0 1 1 15 13Z" stroke="currentColor" stroke-linecap="round"/><path d="M18 6H5.07C4.48 6 4 5.52 4 4.93C4 4.4 4.39 3.94 4.92 3.87L15.72 2.33C16.92 2.15 18 3.09 18 4.31V6Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 19H14" stroke="currentColor" stroke-linecap="round"/>',camera:'<path d="M9 13A3 3 0 1 0 15 13A3 3 0 1 0 9 13Z" stroke="currentColor"/><path d="M9.78 21H14.22C17.34 21 18.9 21 20.02 20.26C20.51 19.95 20.93 19.54 21.25 19.06C22 17.96 22 16.43 22 13.36C22 10.3 22 8.77 21.25 7.67C20.93 7.19 20.51 6.78 20.02 6.46C19.3 5.99 18.4 5.82 17.02 5.76C16.36 5.76 15.8 5.27 15.67 4.64C15.47 3.68 14.62 3 13.63 3H10.37C9.38 3 8.53 3.68 8.33 4.64C8.2 5.27 7.64 5.76 6.98 5.76C5.6 5.82 4.7 5.99 3.98 6.46C3.49 6.78 3.07 7.19 2.75 7.67C2 8.77 2 10.3 2 13.36C2 16.43 2 17.96 2.75 19.06C3.07 19.54 3.49 19.95 3.98 20.26C5.1 21 6.66 21 9.78 21Z" stroke="currentColor"/><path d="M19 10H18" stroke="currentColor" stroke-linecap="round"/>',light:'<path d="M6 12A6 6 0 1 0 18 12A6 6 0 1 0 6 12Z" stroke="currentColor"/><path d="M12 2V3" stroke="currentColor" stroke-linecap="round"/><path d="M12 21V22" stroke="currentColor" stroke-linecap="round"/><path d="M22 12L21 12" stroke="currentColor" stroke-linecap="round"/><path d="M3 12L2 12" stroke="currentColor" stroke-linecap="round"/><path d="M19.07 4.93L18.68 5.32" stroke="currentColor" stroke-linecap="round"/><path d="M5.32 18.68L4.93 19.07" stroke="currentColor" stroke-linecap="round"/><path d="M19.07 19.07L18.68 18.68" stroke="currentColor" stroke-linecap="round"/><path d="M5.32 5.32L4.93 4.93" stroke="currentColor" stroke-linecap="round"/>',jGlasses:'<path d="M14 16A4 4 0 1 0 22 16A4 4 0 1 0 14 16Z" stroke="currentColor"/><path d="M2 16A4 4 0 1 0 10 16A4 4 0 1 0 2 16Z" stroke="currentColor"/><path d="M14 16.21L13.34 15.98C12.47 15.67 11.53 15.67 10.66 15.98L10 16.21" stroke="currentColor" stroke-linecap="round"/><path d="M2 16L2.76 7.61C2.88 6.34 2.94 5.71 3.31 5.24C3.68 4.77 4.28 4.57 5.48 4.17L6 4" stroke="currentColor" stroke-linecap="round"/><path d="M22 16L21.24 7.61C21.12 6.34 21.06 5.71 20.69 5.24C20.32 4.77 19.72 4.57 18.52 4.17L18 4" stroke="currentColor" stroke-linecap="round"/>',smartphone:'<path d="M4 10C4 6.23 4 4.34 5.17 3.17C6.34 2 8.23 2 12 2C15.77 2 17.66 2 18.83 3.17C20 4.34 20 6.23 20 10V14C20 17.77 20 19.66 18.83 20.83C17.66 22 15.77 22 12 22C8.23 22 6.34 22 5.17 20.83C4 19.66 4 17.77 4 14V10Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 19H9" stroke="currentColor" stroke-linecap="round"/>',close:'<path d="M19.01 5L5.01 19" stroke="currentColor" stroke-linecap="round"/><path d="M19 19L5 5" stroke="currentColor" stroke-linecap="round"/>',phone:'<path d="M18.68 19.96C19.19 19.91 19.64 19.63 20 19.25L21.42 17.76C22.38 16.75 22.11 15.02 20.88 14.31L18.97 13.21C18.17 12.75 17.19 12.88 16.56 13.55L16.1 14.03C16.1 14.03 15.02 15.17 12.06 12.06C9.11 8.94 10.19 7.81 10.19 7.81L10.48 7.5C11.18 6.76 11.25 5.56 10.63 4.69L9.37 2.91C8.61 1.83 7.14 1.69 6.26 2.61L4.69 4.26C4.26 4.72 3.97 5.31 4 5.97C4.09 7.65 4.81 11.26 8.82 15.48C13.06 19.95 17.05 20.12 18.68 19.96Z" stroke="currentColor" stroke-linecap="round"/>',email:'<path d="M2 12C2 8.23 2 6.34 3.17 5.17C4.34 4 6.23 4 10 4H14C17.77 4 19.66 4 20.83 5.17C22 6.34 22 8.23 22 12C22 15.77 22 17.66 20.83 18.83C19.66 20 17.77 20 14 20H10C6.23 20 4.34 20 3.17 18.83C2 17.66 2 15.77 2 12Z" stroke="currentColor"/><path d="M6 8L8.16 9.8C10 11.33 10.91 12.09 12 12.09C13.09 12.09 14 11.33 15.84 9.8L18 8" stroke="currentColor" stroke-linecap="round"/>',face:'<path d="M9 16C9.85 16.63 10.88 17 12 17C13.12 17 14.15 16.63 15 16" stroke="currentColor" stroke-linecap="round"/><path d="M2.2 10C3 6.08 6.08 3 10 2.2" stroke="currentColor" stroke-linecap="round"/><path d="M2.2 14C3 17.92 6.08 21 10 21.8" stroke="currentColor" stroke-linecap="round"/><path d="M21.8 10C21 6.08 17.92 3 14 2.2" stroke="currentColor" stroke-linecap="round"/><path d="M21.8 14C21 17.92 17.92 21 14 21.8" stroke="currentColor" stroke-linecap="round"/><path d="M15.5 10.5C15.5 11.05 15.28 11.5 15 11.5C14.72 11.5 14.5 11.05 14.5 10.5C14.5 9.95 14.72 9.5 15 9.5C15.28 9.5 15.5 9.95 15.5 10.5Z" stroke="currentColor"/><path d="M8.5 10.5A0.5 1 0 1 0 9.5 10.5A0.5 1 0 1 0 8.5 10.5Z" stroke="currentColor"/>',copy:'<path d="M6 11C6 8.17 6 6.76 6.88 5.88C7.76 5 9.17 5 12 5H15C17.83 5 19.24 5 20.12 5.88C21 6.76 21 8.17 21 11V16C21 18.83 21 20.24 20.12 21.12C19.24 22 17.83 22 15 22H12C9.17 22 7.76 22 6.88 21.12C6 20.24 6 18.83 6 16V11Z" stroke="currentColor"/><path d="M6 19C4.34 19 3 17.66 3 16V10C3 6.23 3 4.34 4.17 3.17C5.34 2 7.23 2 11 2H15C16.66 2 18 3.34 18 5" stroke="currentColor"/>'};import{jsx as S}from"react/jsx-runtime";function f({name:r,className:o}){return S("svg",{className:`sekyro-glyph${o?` ${o}`:""}`,viewBox:"0 0 24 24",fill:"none",stroke:"none",strokeWidth:1.5,"aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:r in d?d[r]:m[r]}})}t(f,"Icon");import{createContext as a,useContext as l,useEffect as C,useId as x,useLayoutEffect as g,useRef as L,useState as H}from"react";import{jsx as s,jsxs as u}from"react/jsx-runtime";function B({id:r,title:o,lead:e}){let n=M();return u("div",{className:"sekyro-heading",children:[s("h2",{id:r,ref:n,tabIndex:-1,className:"sekyro-text-body",children:o}),e!==void 0?s("p",{className:"sekyro-text-muted",children:e}):null]})}t(B,"StepHeading");var A=a(null),v=typeof window>"u"?C:g;function G({children:r}){let o=l(A),e=x(),n=o?.claim;return v(()=>n?.(e),[n,e]),u("div",{className:"sekyro-actions",children:[r,o!==null&&o.owner===e?o.node:null]})}t(G,"StepActions");var Z=a(()=>{});function P(r){let o=l(Z),e=L(r);e.current=r;let n=r!==null;C(()=>{if(n)return o(()=>e.current?.()),()=>o(null)},[n,o])}t(P,"useFlowBack");var q=a(void 0),z=a(void 0),V=a(()=>{});function D(r){let o=l(V);C(()=>(o(r),()=>o(!1)),[r,o])}t(D,"useImmersive");var b=a(null);function J({onStop:r}){let o=l(b);return o===null?null:s("button",{type:"button",className:"sekyro-lm-upload",disabled:o.busy,"aria-busy":o.busy||void 0,"data-testid":"sekyro-skip-capture",onClick:()=>{r?.(),o.run()},children:o.label})}t(J,"CameraSkip");function Q({template:r,code:o}){let[e,n]=r.split("{code}");return u("span",{"data-testid":"sekyro-test-code-line",children:[e,s("bdi",{dir:"ltr",className:"sekyro-mono sekyro-test-code",children:o}),n]})}t(Q,"TestCodeLine");var I=100;function w({swapKey:r,className:o,children:e}){let[n,y]=H({key:r,node:e}),p=L(e);p.current=e;let c=n.key!==r;return C(()=>{if(!c)return;let N=setTimeout(()=>y({key:r,node:p.current}),I);return()=>clearTimeout(N)},[c,r]),s("div",{className:`${o}${c?" is-leaving":""}`,"aria-hidden":c||void 0,children:c?n.node:e},n.key)}t(w,"Swap");var U=t(({pageKey:r,children:o})=>s(w,{swapKey:r,className:"sekyro-page",children:o}),"PageSwap");import{jsx as i,jsxs as _}from"react/jsx-runtime";var O={info:"info",warning:"warning",danger:"warning"};function s1({tone:r,children:o}){return _(h,{tone:r,children:[i("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:i(f,{name:O[r]})}),i("div",{className:"sekyro-notice__body",children:o})]})}t(s1,"StepNotice");function a1(r,o,e){return e?r.t("common.noAttemptsLeft"):k(r.strings,r.locale,o)}t(a1,"attemptsLine");export{f as a,B as b,A as c,G as d,Z as e,P as f,q as g,z as h,V as i,D as j,b as k,J as l,Q as m,w as n,U as o,s1 as p,a1 as q};
|
|
2
|
+
import{q as h,r as M,s as m}from"./chunk-3MCTR3RI.js";import{a as n}from"./chunk-2KED7D2Q.js";var f={success:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M8.5 12.5L10.5 14.5L15.5 9.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',pending:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M12 8V12L14.5 14.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',info:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M12 17V11" stroke="currentColor" stroke-linecap="round"/><path d="M12 8H12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',timer:'<path d="M3 13A9 9 0 1 0 21 13A9 9 0 1 0 3 13Z" stroke="currentColor"/><path d="M12 9V13L14.5 15.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M3.5 4.5L7.5 2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M20.5 4.5L16.5 2" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',closeCircle:'<path d="M2 12A10 10 0 1 0 22 12A10 10 0 1 0 2 12Z" stroke="currentColor"/><path d="M14.5 9.5L9.5 14.5M9.5 9.5L14.5 14.5" stroke="currentColor" stroke-linecap="round"/>',sms:'<path d="M14.6 19.21C14.26 19.41 14.05 19.76 13.63 20.47L13.09 21.39C12.6 22.2 11.4 22.2 10.91 21.39L10.37 20.47C9.95 19.76 9.74 19.41 9.4 19.21C9.07 19.01 8.64 19.01 7.79 18.99C6.53 18.97 5.75 18.89 5.09 18.62C3.86 18.11 2.89 17.14 2.38 15.91C2 14.99 2 13.83 2 11.5V10.5C2 7.23 2 5.59 2.74 4.39C3.15 3.71 3.71 3.15 4.39 2.74C5.59 2 7.23 2 10.5 2H13.5C16.77 2 18.41 2 19.61 2.74C20.29 3.15 20.85 3.71 21.26 4.39C22 5.59 22 7.23 22 10.5V11.5C22 13.83 22 14.99 21.62 15.91C21.11 17.14 20.14 18.11 18.91 18.62C18.25 18.89 17.47 18.97 16.21 18.99C15.36 19.01 14.93 19.01 14.6 19.21Z" stroke="currentColor" stroke-linecap="round"/>',whatsapp:'<path d="M17.47 14.38c-0.3-0.15-1.76-0.87-2.03-0.97c-0.27-0.1-0.47-0.15-0.670.15c-0.20.3-0.770.97-0.94 1.16c-0.170.2-0.350.22-0.640.07c-0.3-0.15-1.25-0.46-2.39-1.48c-0.88-0.79-1.48-1.76-1.65-2.06c-0.17-0.3-0.02-0.460.13-0.61c0.13-0.130.3-0.350.45-0.52s0.2-0.30.3-0.5c0.1-0.20.05-0.37-0.03-0.52s-0.67-1.61-0.92-2.21c-0.24-0.58-0.49-0.5-0.67-0.51a13 13 0 0 0-0.57-0.01c-0.2 0-0.520.07-0.790.37c-0.270.3-1.04 1.02-1.04 2.48c0 1.46 1.06 2.88 1.21 3.07s2.1 3.2 5.08 4.49c0.710.31 1.260.49 1.690.63c0.710.23 1.360.2 1.870.12c0.57-0.09 1.76-0.72 2.01-1.41s0.25-1.290.17-1.41c-0.07-0.12-0.27-0.2-0.57-0.35m-5.42 7.4h0a9.87 9.87 0 0 1-5.03-1.38l-0.36-0.21l-3.740.98l1-3.65l-0.23-0.37a9.86 9.86 0 0 1-1.51-5.26c0-5.45 4.44-9.88 9.89-9.88c2.64 0 5.12 1.03 6.99 2.9a9.82 9.82 0 0 1 2.89 6.99c0 5.45-4.44 9.88-9.88 9.88m8.41-18.3A11.82 11.82 0 0 0 12.05 0C5.5 0 0.16 5.330.16 11.89c0 2.10.55 4.14 1.59 5.95L0.06 24l6.3-1.65a11.9 11.9 0 0 0 5.68 1.45h0.01c6.55 0 11.89-5.33 11.89-11.89a11.82 11.82 0 0 0-3.48-8.41" fill="currentColor"/>',back:'<path d="M15 5L9 12L15 19" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',warning:'<path d="M5.31 10.76C8.23 5.59 9.69 3 12 3C14.31 3 15.77 5.59 18.69 10.76L19.05 11.41C21.48 15.71 22.69 17.86 21.59 19.43C20.5 21 17.79 21 12.36 21H11.64C6.21 21 3.5 21 2.41 19.43C1.31 17.86 2.52 15.71 4.95 11.41L5.31 10.76Z" stroke="currentColor"/><path d="M12 8V13" stroke="currentColor" stroke-linecap="round"/><path d="M12 16H12" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/>',external:'<path d="M9 15L15 9M15 13.5V9H10.5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/>'};var u={id:'<path d="M4 6H17C18.66 6 20 7.34 20 9V19C20 20.66 18.66 22 17 22H7C5.34 22 4 20.66 4 19V6ZM4 6V5" stroke="currentColor" stroke-linejoin="round"/><path d="M9 13A3 3 0 1 0 15 13A3 3 0 1 0 9 13Z" stroke="currentColor"/><path d="M18 6H5.07C4.48 6 4 5.52 4 4.93C4 4.4 4.39 3.94 4.92 3.87L15.72 2.33C16.92 2.15 18 3.09 18 4.31V6Z" stroke="currentColor" stroke-linejoin="round"/><path d="M10 19H14" stroke="currentColor" stroke-linecap="round"/>',card:'<path d="M2 12C2 8.23 2 6.34 3.17 5.17C4.34 4 6.23 4 10 4H14C17.77 4 19.66 4 20.83 5.17C22 6.34 22 8.23 22 12C22 15.77 22 17.66 20.83 18.83C19.66 20 17.77 20 14 20H10C6.23 20 4.34 20 3.17 18.83C2 17.66 2 15.77 2 12Z" stroke="currentColor"/><path d="M10 16H6" stroke="currentColor" stroke-linecap="round"/><path d="M14 16H12.5" stroke="currentColor" stroke-linecap="round"/><path d="M2 10L22 10" stroke="currentColor" stroke-linecap="round"/>',lock:'<path d="M2 16C2 13.17 2 11.76 2.88 10.88C3.76 10 5.17 10 8 10H16C18.83 10 20.24 10 21.12 10.88C22 11.76 22 13.17 22 16C22 18.83 22 20.24 21.12 21.12C20.24 22 18.83 22 16 22H8C5.17 22 3.76 22 2.88 21.12C2 20.24 2 18.83 2 16Z" stroke="currentColor"/><path d="M6 10V8C6 4.69 8.69 2 12 2C15.31 2 18 4.69 18 8V10" stroke="currentColor" stroke-linecap="round"/>',passport:'<path d="M4 6H17C18.66 6 20 7.34 20 9V19C20 20.66 18.66 22 17 22H7C5.34 22 4 20.66 4 19V6ZM4 6V5" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M15 13A3 3 0 1 1 9 13A3 3 0 1 1 15 13Z" stroke="currentColor" stroke-linecap="round"/><path d="M18 6H5.07C4.48 6 4 5.52 4 4.93C4 4.4 4.39 3.94 4.92 3.87L15.72 2.33C16.92 2.15 18 3.09 18 4.31V6Z" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 19H14" stroke="currentColor" stroke-linecap="round"/>',camera:'<path d="M9 13A3 3 0 1 0 15 13A3 3 0 1 0 9 13Z" stroke="currentColor"/><path d="M9.78 21H14.22C17.34 21 18.9 21 20.02 20.26C20.51 19.95 20.93 19.54 21.25 19.06C22 17.96 22 16.43 22 13.36C22 10.3 22 8.77 21.25 7.67C20.93 7.19 20.51 6.78 20.02 6.46C19.3 5.99 18.4 5.82 17.02 5.76C16.36 5.76 15.8 5.27 15.67 4.64C15.47 3.68 14.62 3 13.63 3H10.37C9.38 3 8.53 3.68 8.33 4.64C8.2 5.27 7.64 5.76 6.98 5.76C5.6 5.82 4.7 5.99 3.98 6.46C3.49 6.78 3.07 7.19 2.75 7.67C2 8.77 2 10.3 2 13.36C2 16.43 2 17.96 2.75 19.06C3.07 19.54 3.49 19.95 3.98 20.26C5.1 21 6.66 21 9.78 21Z" stroke="currentColor"/><path d="M19 10H18" stroke="currentColor" stroke-linecap="round"/>',light:'<path d="M6 12A6 6 0 1 0 18 12A6 6 0 1 0 6 12Z" stroke="currentColor"/><path d="M12 2V3" stroke="currentColor" stroke-linecap="round"/><path d="M12 21V22" stroke="currentColor" stroke-linecap="round"/><path d="M22 12L21 12" stroke="currentColor" stroke-linecap="round"/><path d="M3 12L2 12" stroke="currentColor" stroke-linecap="round"/><path d="M19.07 4.93L18.68 5.32" stroke="currentColor" stroke-linecap="round"/><path d="M5.32 18.68L4.93 19.07" stroke="currentColor" stroke-linecap="round"/><path d="M19.07 19.07L18.68 18.68" stroke="currentColor" stroke-linecap="round"/><path d="M5.32 5.32L4.93 4.93" stroke="currentColor" stroke-linecap="round"/>',jGlasses:'<path d="M14 16A4 4 0 1 0 22 16A4 4 0 1 0 14 16Z" stroke="currentColor"/><path d="M2 16A4 4 0 1 0 10 16A4 4 0 1 0 2 16Z" stroke="currentColor"/><path d="M14 16.21L13.34 15.98C12.47 15.67 11.53 15.67 10.66 15.98L10 16.21" stroke="currentColor" stroke-linecap="round"/><path d="M2 16L2.76 7.61C2.88 6.34 2.94 5.71 3.31 5.24C3.68 4.77 4.28 4.57 5.48 4.17L6 4" stroke="currentColor" stroke-linecap="round"/><path d="M22 16L21.24 7.61C21.12 6.34 21.06 5.71 20.69 5.24C20.32 4.77 19.72 4.57 18.52 4.17L18 4" stroke="currentColor" stroke-linecap="round"/>',smartphone:'<path d="M4 10C4 6.23 4 4.34 5.17 3.17C6.34 2 8.23 2 12 2C15.77 2 17.66 2 18.83 3.17C20 4.34 20 6.23 20 10V14C20 17.77 20 19.66 18.83 20.83C17.66 22 15.77 22 12 22C8.23 22 6.34 22 5.17 20.83C4 19.66 4 17.77 4 14V10Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 19H9" stroke="currentColor" stroke-linecap="round"/>',close:'<path d="M19.01 5L5.01 19" stroke="currentColor" stroke-linecap="round"/><path d="M19 19L5 5" stroke="currentColor" stroke-linecap="round"/>',phone:'<path d="M18.68 19.96C19.19 19.91 19.64 19.63 20 19.25L21.42 17.76C22.38 16.75 22.11 15.02 20.88 14.31L18.97 13.21C18.17 12.75 17.19 12.88 16.56 13.55L16.1 14.03C16.1 14.03 15.02 15.17 12.06 12.06C9.11 8.94 10.19 7.81 10.19 7.81L10.48 7.5C11.18 6.76 11.25 5.56 10.63 4.69L9.37 2.91C8.61 1.83 7.14 1.69 6.26 2.61L4.69 4.26C4.26 4.72 3.97 5.31 4 5.97C4.09 7.65 4.81 11.26 8.82 15.48C13.06 19.95 17.05 20.12 18.68 19.96Z" stroke="currentColor" stroke-linecap="round"/>',email:'<path d="M2 12C2 8.23 2 6.34 3.17 5.17C4.34 4 6.23 4 10 4H14C17.77 4 19.66 4 20.83 5.17C22 6.34 22 8.23 22 12C22 15.77 22 17.66 20.83 18.83C19.66 20 17.77 20 14 20H10C6.23 20 4.34 20 3.17 18.83C2 17.66 2 15.77 2 12Z" stroke="currentColor"/><path d="M6 8L8.16 9.8C10 11.33 10.91 12.09 12 12.09C13.09 12.09 14 11.33 15.84 9.8L18 8" stroke="currentColor" stroke-linecap="round"/>',face:'<path d="M9 16C9.85 16.63 10.88 17 12 17C13.12 17 14.15 16.63 15 16" stroke="currentColor" stroke-linecap="round"/><path d="M2.2 10C3 6.08 6.08 3 10 2.2" stroke="currentColor" stroke-linecap="round"/><path d="M2.2 14C3 17.92 6.08 21 10 21.8" stroke="currentColor" stroke-linecap="round"/><path d="M21.8 10C21 6.08 17.92 3 14 2.2" stroke="currentColor" stroke-linecap="round"/><path d="M21.8 14C21 17.92 17.92 21 14 21.8" stroke="currentColor" stroke-linecap="round"/><path d="M15.5 10.5C15.5 11.05 15.28 11.5 15 11.5C14.72 11.5 14.5 11.05 14.5 10.5C14.5 9.95 14.72 9.5 15 9.5C15.28 9.5 15.5 9.95 15.5 10.5Z" stroke="currentColor"/><path d="M8.5 10.5A0.5 1 0 1 0 9.5 10.5A0.5 1 0 1 0 8.5 10.5Z" stroke="currentColor"/>',copy:'<path d="M6 11C6 8.17 6 6.76 6.88 5.88C7.76 5 9.17 5 12 5H15C17.83 5 19.24 5 20.12 5.88C21 6.76 21 8.17 21 11V16C21 18.83 21 20.24 20.12 21.12C19.24 22 17.83 22 15 22H12C9.17 22 7.76 22 6.88 21.12C6 20.24 6 18.83 6 16V11Z" stroke="currentColor"/><path d="M6 19C4.34 19 3 17.66 3 16V10C3 6.23 3 4.34 4.17 3.17C5.34 2 7.23 2 11 2H15C16.66 2 18 3.34 18 5" stroke="currentColor"/>'};import{jsx as S}from"react/jsx-runtime";function L({name:e,className:o}){return S("svg",{className:`sekyro-glyph${o?` ${o}`:""}`,viewBox:"0 0 24 24",fill:"none",stroke:"none",strokeWidth:1.5,"aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:e in u?u[e]:f[e]}})}n(L,"Icon");import{createContext as c,useContext as d,useEffect as i,useId as x,useLayoutEffect as g,useRef as y,useState as H}from"react";import{jsx as a,jsxs as p}from"react/jsx-runtime";function B({id:e,title:o,lead:r,lang:t}){let C=m(),l=t?.title!==void 0?t.dir:void 0,s=t?.lead!==void 0?t.dir:void 0;return p("div",{className:"sekyro-heading",children:[a("h2",{id:e,ref:C,tabIndex:-1,className:"sekyro-text-body",lang:t?.title,dir:l,children:o}),r!==void 0?a("p",{className:"sekyro-text-muted",lang:t?.lead,dir:s,children:r}):null]})}n(B,"StepHeading");var A=c(null),v=typeof window>"u"?i:g;function G({children:e}){let o=d(A),r=x(),t=o?.claim;return v(()=>t?.(r),[t,r]),p("div",{className:"sekyro-actions",children:[e,o!==null&&o.owner===r?o.node:null]})}n(G,"StepActions");var Z=c(()=>{});function D(e){let o=d(Z),r=y(e);r.current=e;let t=e!==null;i(()=>{if(t)return o(()=>r.current?.()),()=>o(null)},[t,o])}n(D,"useFlowBack");var P=c(void 0),q=c(void 0),V=c(()=>{});function z(e){let o=d(V);i(()=>(o(e),()=>o(!1)),[e,o])}n(z,"useImmersive");var b=c(null);function J({onStop:e}){let o=d(b);return o===null?null:a("button",{type:"button",className:"sekyro-lm-upload",disabled:o.busy,"aria-busy":o.busy||void 0,"data-testid":"sekyro-skip-capture",onClick:()=>{e?.(),o.run()},children:o.label})}n(J,"CameraSkip");function Q({template:e,code:o}){let[r,t]=e.split("{code}");return p("span",{"data-testid":"sekyro-test-code-line",children:[r,a("bdi",{dir:"ltr",className:"sekyro-mono sekyro-test-code",children:o}),t]})}n(Q,"TestCodeLine");var I=100;function w({swapKey:e,className:o,children:r}){let[t,C]=H({key:e,node:r}),l=y(r);l.current=r;let s=t.key!==e;return i(()=>{if(!s)return;let N=setTimeout(()=>C({key:e,node:l.current}),I);return()=>clearTimeout(N)},[s,e]),a("div",{className:`${o}${s?" is-leaving":""}`,"aria-hidden":s||void 0,children:s?t.node:r},t.key)}n(w,"Swap");var U=n(({pageKey:e,children:o})=>a(w,{swapKey:e,className:"sekyro-page",children:o}),"PageSwap");import{jsx as k,jsxs as _}from"react/jsx-runtime";var O={info:"info",warning:"warning",danger:"warning"};function s1({tone:e,children:o}){return _(M,{tone:e,children:[k("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:k(L,{name:O[e]})}),k("div",{className:"sekyro-notice__body",children:o})]})}n(s1,"StepNotice");function a1(e,o,r){return r?e.t("common.noAttemptsLeft"):h(e.strings,e.locale,o)}n(a1,"attemptsLine");export{L as a,B as b,A as c,G as d,Z as e,D as f,P as g,q as h,V as i,z as j,b as k,J as l,Q as m,w as n,U as o,s1 as p,a1 as q};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{d as I}from"./chunk-
|
|
2
|
+
import{d as I}from"./chunk-VOIZLJLI.js";import{a as S}from"./chunk-3MCTR3RI.js";import{a}from"./chunk-2KED7D2Q.js";import{useId as V}from"react";import{jsx as k,jsxs as E}from"react/jsx-runtime";var A=Array.from({length:56},(r,e)=>{let s=e/56*2*Math.PI-Math.PI/2,t=Math.cos(s),i=Math.sin(s);return{id:`tick-${e}`,frac:e/55,x1:150+108*t,y1:150+108*i,x2:150+138*t,y2:150+138*i,style:{transitionDelay:`${e*6}ms`}}});function T(r,e,s,t){return s?"var(--sekyro-color-success)":r?t?"color-mix(in srgb, var(--sekyro-color-warning) 75%, transparent)":e<.33?"color-mix(in srgb, var(--sekyro-color-brand) 55%, transparent)":e<.66?"color-mix(in srgb, var(--sekyro-color-brand) 80%, transparent)":"var(--sekyro-color-brand)":"color-mix(in srgb, var(--sekyro-color-surface) 32%, transparent)"}a(T,"tickColor");var w="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function x({progress:r,phase:e,draining:s=!1}){let t=Math.min(1,Math.max(0,r)),i=Math.round(t*56),n=e==="checking",l=e==="recording",c=e==="frozen",u=n||c,p=n||l||c,y=e==="locked"||p,f=s&&!y;return E("svg",{"aria-hidden":"true",viewBox:"0 0 300 300",preserveAspectRatio:"xMidYMid meet",className:"sekyro-stage__arc","data-testid":"sekyro-capture-arc","data-phase":e,"data-filled":i,"data-recording":l?"":void 0,"data-draining":f?"":void 0,children:[k("path",{fillRule:"evenodd",d:w,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":u?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),E("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[k("g",{className:u?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:A.map((d,_)=>k("line",{x1:d.x1,y1:d.y1,x2:d.x2,y2:d.y2,stroke:T(_<i,d.frac,y,f),strokeWidth:3,strokeLinecap:"round",style:d.style,className:"sekyro-arc__tick"},d.id))}),k("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:k("circle",{cx:150,cy:150,r:100,fill:"none",stroke:y?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:y?3.5:2.5,className:p?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}a(x,"CaptureArc");import{Fragment as M,jsx as o,jsxs as m}from"react/jsx-runtime";function ne({videoRef:r,guidanceText:e,guidanceHint:s,guidanceKey:t,progress:i,phase:n,draining:l=!1,stillUrl:c,showChecking:u,operatorText:p=null,voicePrompt:y,overlay:f,reduceMotion:d=!1,modeSwitch:_=null}){let h=I(),b=n==="checking",g=b||n==="frozen",v=g&&u?h("capture.checking"):e,C=y?.(s,v,t);return m("div",{className:d?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[o("video",{ref:r,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),c!==null&&g?o("img",{src:c,alt:h("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,o(x,{progress:i,phase:n,draining:l}),f?.(r),C!=null&&!g?o("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:C}):null,_!==null&&!g?o(H,{view:_,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,b&&u?m("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[o(G,{}),h("capture.cameraOff")]}):null,m("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[o("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:v},v),g&&u?o("span",{className:"sekyro-stage__guidance-hint",children:h("capture.checkingHint")}):p!==null&&!g?o("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}a(ne,"CaptureStage");function H({view:r,className:e,kind:s}){let t=V(),i=m(M,{children:[o(D,{}),o("span",{children:r.label})]}),n={onClick:r.onSwitch,"aria-describedby":t,"data-testid":"sekyro-capture-mode-switch","data-mode":r.to};return m(M,{children:[s==="chip"?o(S,{kind:"chip",className:e,...n,children:i}):o("button",{type:"button",className:e,...n,children:i}),o("span",{id:t,className:"sekyro-visually-hidden",children:r.description})]})}a(H,"ModeSwitchChip");function D(){return m("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[o("path",{d:"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"}),o("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),o("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}a(D,"FlipCameraIcon");function G(){return m("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon sekyro-icon--sm",children:[o("path",{d:"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"}),o("path",{d:"M3 3l18 18"})]})}a(G,"CameraOffIcon");import{screenRampColourValue as P}from"@sekyro/web";import{useEffect as U,useLayoutEffect as $,useRef as L}from"react";import{createPortal as K}from"react-dom";import{Fragment as X,jsx as N,jsxs as Z}from"react/jsx-runtime";var W=typeof window>"u"?U:$,R="data-sekyro-ramp",O=[["background-color","transparent"],["background-image","none"]];function z(r){let e=[],s=r.ownerDocument;for(let n=r;n!==null&&n!==s.documentElement;n=n.parentElement){if(!(n instanceof HTMLElement)&&!(n instanceof SVGElement))continue;let l=n.style;for(let[c,u]of O){let p=l.getPropertyValue(c),y=l.getPropertyPriority(c);l.setProperty(c,u,"important"),e.push(()=>{p===""?l.removeProperty(c):l.setProperty(c,p,y)})}}let t=s.documentElement,i=t.hasAttribute(R);return t.setAttribute(R,""),i||e.push(()=>t.removeAttribute(R)),()=>{for(let n of e.reverse())n()}}a(z,"clearAncestorBackdrops");function B(r){return{position:"fixed",inset:0,minWidth:"100vw",minHeight:"100lvh",margin:0,padding:0,border:0,zIndex:-1,pointerEvents:"none",backgroundColor:P(r)}}a(B,"washStyle");function Y(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:P(r)}}a(Y,"coverStyle");function de({colour:r}){let e=L(null),s=r!==null;return W(()=>{let t=e.current?.parentElement;if(!(!s||t===null||t===void 0))return z(t)},[s]),r===null||typeof document>"u"?null:Z(X,{children:[N("div",{ref:e,"aria-hidden":"true","data-testid":"sekyro-screen-ramp-cover","data-colour":r,style:Y(r)}),K(N("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":r,style:B(r)}),document.body)]})}a(de,"ScreenRampLayer");export{ne as a,H as b,de as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{c as g}from"./chunk-2UDX3MRT.js";import{a as s}from"./chunk-2KED7D2Q.js";var c={light:{brand:"#0d3b66",brandFg:"#ffffff",fg:"#13141f",fgMuted:"#4e5270",bg:"#f6f7fb",surface:"#ffffff",ring:"#0d3b66",danger:"#ca0f07",success:"#007a5e",warning:"#735003"},dark:{brand:"#6ea2d3",brandFg:"#051a2e",fg:"#f6f7fb",fgMuted:"#cbcedc",bg:"#13141f",surface:"#1d1e2c",ring:"#6ea2d3",danger:"#ff7c7c",success:"#00c897",warning:"#ffd98a"},roles:{light:{brandSoft:"#eaf2fa",line:"#cbcedc",lineSubtle:"#e2e4ee",lineStrong:"#8c91a9",sunken:"#eeeff5",fgSubtle:"#686d8a"},dark:{brandSoft:"#092b4b",line:"#4e5270",lineSubtle:"#2b2d40",lineStrong:"#686d8a",sunken:"#0b0c14",fgSubtle:"#8c91a9"}},stage:"#051a2e",stageAccent:"#69dfef",radius:"10px",radiusLg:"16px",font:'"Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontDisplay:'"Sekyro Geist", Geist, "Sekyro Geist Fallback", "Sekyro Geist Fallback Roboto", "Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontArabic:'"Sekyro Cairo", Cairo, "Sekyro Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif'};import{jsx as y}from"react/jsx-runtime";var t={colors:{...c.light},radius:c.radiusLg,fontFamily:c.font},l={brand:"--sekyro-color-brand",brandFg:"--sekyro-color-brand-fg",fg:"--sekyro-color-fg",fgMuted:"--sekyro-color-fg-muted",bg:"--sekyro-color-bg",surface:"--sekyro-color-surface",ring:"--sekyro-color-ring",danger:"--sekyro-color-danger",success:"--sekyro-color-success",warning:"--sekyro-color-warning"};function S(r={}){let e={};for(let o of Object.keys(l))e[l[o]]=r.colors?.[o]??t.colors[o];return e["--sekyro-radius"]=r.radius??t.radius,e["--sekyro-font"]=r.fontFamily??t.fontFamily,e}s(S,"themeToCssVars");var k=/^#[0-9a-f]{6}$/i,m=["brand","brandFg","bg","surface","fg","fgMuted"],b=["danger","success","warning"],u=!1;function p(r){let e=r?.colors;if(r===void 0||e===void 0||!b.some(i=>i in e))return r;!u&&g()&&(u=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));let{danger:o,success:a,warning:f,...n}=e;return{...r,colors:n}}s(p,"stripDeprecatedStatusColors");var T={none:"0px",sm:"6px",md:"10px",lg:"16px",full:"9999px"},h={system:"",inter:"Inter","ibm-plex-sans-arabic":'"IBM Plex Sans Arabic"',"noto-sans-arabic":'"Noto Sans Arabic"',roboto:"Roboto"};function x(r){let e={};if(!r)return e;let o={},a=r.colors??{};for(let i of m){let d=a[i];d!==void 0&&k.test(d)&&(o[i]=d)}o.brand&&(o.ring=o.brand),Object.keys(o).length&&(e.colors=o);let f=T[r.radius];f&&(e.radius=f);let n=h[r.fontFamily];return n!==void 0&&(e.fontFamily=n?`${n}, ${t.fontFamily}`:t.fontFamily),e}s(x,"brandingToTheme");function I(...r){let e={};for(let o of r)o?.colors&&(e.colors={...e.colors,...o.colors}),o?.radius&&(e.radius=o.radius),o?.fontFamily&&(e.fontFamily=o.fontFamily);return e}s(I,"mergeThemes");function C({theme:r,children:e,className:o}){return y(R,{theme:p(r),...o!==void 0?{className:o}:{},children:e})}s(C,"SekyroThemeProvider");function R({theme:r,children:e,className:o}){let a=S(r);return y("div",{className:o===void 0?"sekyro-root":`sekyro-root ${o}`,style:a,children:e})}s(R,"SekyroThemeRoot");export{c as a,t as b,S as c,p as d,x as e,I as f,C as g,R as h};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as v,b as _}from"./chunk-
|
|
2
|
+
import{a as v,b as _}from"./chunk-2UDX3MRT.js";import{a as x}from"./chunk-VRDPGOXM.js";import{g as S}from"./chunk-5V26KZGZ.js";import{a as p,b as y,d as N,k as C,p as b,q as w}from"./chunk-HO5RMTZU.js";import{a as k,l as I,o as R}from"./chunk-3MCTR3RI.js";import{a as i}from"./chunk-2KED7D2Q.js";import{useState as E}from"react";var U={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function Y(e,r){switch(e.service){case"document":return r.t("method.document_photo");case"population_registry":return r.t("method.national_number");case"national_eid":{let a=e.nationalEid?.providerName;return a?r.t("method.national_eid",{provider:a}):r.t("method.national_eidGeneric")}default:return null}}i(Y,"identityLabel");function q(e,r){let[a,n]=E(!1),[c,m]=E(null);return{busy:a,error:c,run:i(u=>{n(!0),m(null),u().then(()=>n(!1),f=>{n(!1),m(e.t(x(f,e.strings))),r?.(f)})},"run")}}i(q,"useChoiceAction");import{useContext as H,useId as L}from"react";import{Fragment as M,jsx as t,jsxs as s}from"react/jsx-runtime";function O(){let e=`sekyro-face-light-${L().replace(/[^A-Za-z0-9_-]/g,"")}`;return s("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[t("defs",{children:t("mask",{id:e,children:t("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),t("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),t("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),t("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),t("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}i(O,"FaceMark");var B={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function te(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}i(te,"faceIntroRetryOf");var F={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function ne({start:e,context:r,tips:a,tipsTitle:n,human:c=!1,returning:m=!1,notice:d,retry:u}){let f=S(),{t:o}=f,g=u===void 0?"face":v(u.reason),h=g==="face"?null:_[g].tips,A=H(C)?.busy===!0;return s("section",{className:"sekyro-step",children:[t(O,{}),r.captureMode==="assisted"?t(y,{title:o("capture.assisted.heading"),lead:o("capture.assisted.lead")}):m?t(y,{title:o("returning.heading"),lead:o("returning.description")}):t(y,{title:o(c?"native.face.humanIntroTitle":"native.face.introTitle"),lead:o(c?"native.face.humanIntroLead":"native.face.introLead")}),u!==void 0?t(T,{retry:u,title:_[g].title}):null,n!==void 0&&h===null?t("p",{className:"sekyro-section-label",children:n}):null,t("ul",{className:"sekyro-tiprows",children:h!==null?h.map(l=>s("li",{children:[t(p,{name:F[l]??"face"}),o(l)]},l)):a!==void 0?a.map(l=>s("li",{children:[t(p,{name:B[l.id]??"face"}),l.text]},l.id)):s(M,{children:[s("li",{children:[t(p,{name:"light"}),o("capture.tips.light")]}),s("li",{children:[t(p,{name:"jGlasses"}),o("capture.tips.uncover")]}),s("li",{children:[t(p,{name:"smartphone"}),o("capture.tips.eyeLevel")]})]})}),d??null,d!==void 0?null:r.assets==="failed"?t(k,{kind:"secondary",full:!0,onClick:r.retryAssets,children:o("common.retry")}):null,d!==void 0?null:t(N,{children:s(k,{full:!0,disabled:r.assets!=="ready"||A,"aria-busy":r.assets==="loading"||void 0,onClick:e,children:[t(p,{name:"camera"}),o("capture.start")]})})]})}i(ne,"FaceIntro");var K=new Set(["match_inconclusive","no_face_source","below_threshold"]);function T({retry:e,title:r}){let a=S(),n=e.retakeHint===void 0?null:I(e.retakeHint),c=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":K.has(e.reason)?"capture.retryMatch.message":R(e.reason);return s(b,{tone:"warning",children:[n!==null?t("span",{children:a.t(n)}):c!==null?t("span",{children:a.t(c)}):null,n===null?t("span",{children:a.t(r)}):null,t("span",{children:w(a,e.attemptsRemaining,e.attemptsExhausted)})]})}i(T,"RetryNotice");import{isInAppBrowser as $}from"@sekyro/web/client";function se(e){return $(e)}i(se,"isInAppBrowser");function ce(e,r){let a=r??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(a))return null;let n;try{n=new URL(e)}catch{return null}if(n.protocol!=="https:"&&n.protocol!=="http:")return null;let c=n.protocol.slice(0,-1);return`intent://${n.host}${n.pathname}${n.search}#Intent;scheme=${c};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}i(ce,"androidBrowserIntent");export{U as a,Y as b,q as c,te as d,ne as e,se as f,ce as g};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{b as i,d as u,e as f,f as y,g,h as S,i as l,j as p}from"./chunk-
|
|
2
|
+
import{b as i,d as u,e as f,f as y,g,h as S,i as l,j as p}from"./chunk-3MCTR3RI.js";import{a as s}from"./chunk-2KED7D2Q.js";import{createContext as m,useContext as x,useEffect as L,useState as v}from"react";var d={ar:f,fr:y,en:i};function T(e,t){let n=S(e),r=n===void 0?d[g(e)]:{...d.en,...n};if(t===void 0)return r;let o={...r};for(let a of Object.keys(t)){let c=t[a];typeof c=="string"&&(o[a]=c)}return u(o,t),o}s(T,"resolveStrings");function w(e){let[,t]=v(0),n=l(e);return L(()=>{if(!n)return;let r=!0;return p(e).then(()=>r&&t(o=>o+1)),()=>{r=!1}},[e,n]),!n}s(w,"useLocaleReady");var k=m(e=>i[e]??""),C=k.Provider;function I(){return x(k)}s(I,"useStrings");export{T as a,w as b,C as c,I as d};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as r,d as i}from"./chunk-
|
|
2
|
+
import{a as r,d as i}from"./chunk-HO5RMTZU.js";import{s as n}from"./chunk-3MCTR3RI.js";import{a}from"./chunk-2KED7D2Q.js";import{jsx as t,jsxs as s}from"react/jsx-runtime";function g({tone:c,icon:l,busy:d,title:u,titleId:o,children:m,actions:e,live:y,testId:p}){let f=n();return s("section",{className:"sekyro-step sekyro-status",...o!==void 0?{"aria-labelledby":o}:{},...y?{role:"status","aria-live":"polite"}:{},"data-testid":p,children:[s("div",{className:"sekyro-status__body",children:[t("span",{className:`sekyro-tile sekyro-tile--${c}${d?" is-busy":""}`,"aria-hidden":"true",children:t(r,{name:l})}),s("div",{className:"sekyro-heading sekyro-status__text",children:[t("h2",{id:o,ref:f,tabIndex:-1,className:"sekyro-text-body",children:u}),m]})]}),e!=null&&e!==!1?t(i,{children:e}):null]})}a(g,"StatusPage");export{g as a};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as r}from"./chunk-2KED7D2Q.js";var ie="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",X;function z(e){return X??(X=new Map(ie.split(" ").map(n=>{let[o,t]=n.slice(2).split("/");return[n.slice(0,2),[o,t]]}))),X.get(e.toUpperCase())}r(z,"entryOf");function Ne(e){return z(e)?.[0]}r(Ne,"dialCodeOf");function ee(e){return z(e)?.[1]}r(ee,"nationalPrefixOf");import{useEffect as he,useId as fe,useMemo as ge,useRef as W,useState as K}from"react";import{useId as ae,useState as ue}from"react";import{Fragment as de,jsx as M,jsxs as B}from"react/jsx-runtime";var ne=r(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold");function ce(e,n){let o=ne(n.trim());return o===""?e:e.filter(t=>ne(t.name).includes(o)||t.code.toLowerCase()===o)}r(ce,"matchCountries");function te({countries:e,label:n,searchPlaceholder:o,noMatch:t,onPick:P,selected:S,searchRef:d,scroll:R=!1,searchable:T=!0,detail:O,extra:p}){let[m,N]=ue(""),i=ae(),k=ce(e,m),f=B("ul",{className:`sekyro-rows${R?" sekyro-rows--scroll":""}`,children:[k.map(a=>{let C=O?.(a.code);return M("li",{children:B("button",{type:"button",className:"sekyro-row-btn","aria-current":S===a.code||void 0,onClick:()=>P(a.code),children:[M("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:J(a.code)}),M("span",{className:"sekyro-row-btn__name",children:a.name}),C!==void 0?M("bdi",{className:"sekyro-row-btn__detail",dir:"ltr",children:C}):null]})},a.code)}),p!==void 0?M("li",{children:B("button",{type:"button",className:"sekyro-row-btn","aria-current":p.current||void 0,onClick:p.onPick,children:[M("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:"🌐"}),M("span",{className:"sekyro-row-btn__name",children:p.label})]})}):null]});return T?B(de,{children:[B("div",{className:"sekyro-field",children:[M("label",{className:"sekyro-label",htmlFor:i,children:n}),M("input",{ref:d,id:i,type:"search",className:"sekyro-input",placeholder:o,value:m,onChange:a=>N(a.target.value)})]}),k.length===0&&p===void 0?M("p",{className:"sekyro-text-muted",children:t}):f]}):f}r(te,"CountryList");import{normalizeNni as pe}from"@sekyro/web";function H(e){let n=pe(e).replace(/\D/g,"");return/^\D*\+/.test(e)?`+${n}`:n.startsWith("00")?`+${n.slice(2)}`:n}r(H,"digitsOf");var q=r((e,n)=>(n.trunk!==void 0&&e.startsWith(n.trunk)?e.slice(n.trunk.length):e).slice(0,Math.max(...n.lengths)),"fitDigits");function Z(e,n){let o="",t=0;for(let P of n?.formats?.find(S=>new RegExp(`^(?:${S.leading})`).test(e))?.groups??[])t<e.length&&(o+=(t>0?" ":"")+e.slice(t,t+P)),t+=P;return o+e.slice(t)}r(Z,"groupDigits");function oe(e,n){let o=0;for(let t=n;t>0&&o<e.length;o+=1)e[o]!==" "&&(t-=1);return o}r(oe,"caretAfter");var Q=r((e,n)=>n.find(o=>e.startsWith(o.dial)),"countryOfNumber"),re=r((e,n)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${n} $1`),"lengthsLabel");import{Fragment as Pe,jsx as L,jsxs as j}from"react/jsx-runtime";function le(e){let n=H(e).replace("+","");return/^\d{8,15}$/.test(n)?`+${n}`:null}r(le,"normalizedPhone");var J=r(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),n=>127397+n.charCodeAt(0))),"flagOf");function ye(e,n){if(n===null||!e.startsWith(n.dial))return le(e);let o=e.slice(n.dial.length).replace(/\D/g,""),t=ee(n.code);return t!==void 0&&o.startsWith(t)&&(o=o.slice(t.length)),le(n.dial+o)}r(ye,"e164Of");var se=r((e,n)=>(Q(e,n)??n[0])?.code??null,"countryFor");function me(e){let n=null;try{n=new Intl.DisplayNames([e],{type:"region"})}catch{}return o=>`${n?.of(o.code)??o.code} (${o.dial})`}r(me,"countryLabels");var Ce="other",be=8;function _e({countries:e,international:n,closed:o,defaultPhone:t}){let[P,S]=K(()=>se(t,e)),[d,R]=K(t),[T,O]=K(!1),[p,m]=K(!1),N=e.map(u=>u.code).join(","),i=e.find(u=>u.code===P)??null,k=W(i);i!==null&&(k.current=i),he(()=>{if(P===null||!e.some(u=>u.code===P)){let u=se(t,e);S(u);let l=k.current,b=e.find(h=>h.code===u)?.dial;b!==void 0&&R(h=>l!==null&&h.startsWith(l.dial)?b+h.slice(l.dial.length):h.startsWith("+")?h:b)}},[N,t]);let f=T||i===null,a=f||d.startsWith("+")&&!d.startsWith(i.dial),C=a?void 0:i.rule,$=a?d:d.replace(i.dial,"").replace(/\D/g,""),c=C?q($,C):$,_=a&&!f&&!n&&o&&!e.some(u=>u.dial.startsWith(d)),A=_?null:C?C.lengths.includes(c.length)?i.dial+c:null:f&&!d.startsWith("+")?null:ye(d,T?null:i),U=a||i===null?A??d:`${i.dial} ${Z(c,C)}`,x=a?H(d).replace("+","")==="":c==="";return{countries:e,international:n,phone:d,selected:i,other:T,whole:a,free:f,rule:C,national:c,refused:_,typed:A,shown:U,empty:x,lengthShown:p,setLengthShown:m,onNumber:r(u=>{let l=u.target,b=u.nativeEvent.inputType,h=Math.max(0,l.value.lastIndexOf("+")),E=H(l.value.slice(h)),w=Q(E,e),I=H(l.value.slice(h,l.selectionStart)).length,G=E,V=E;if(m(!1),!w&&(f||E.startsWith("+")))n&&O(!0);else{let D=w??i,g=w?E.slice(w.dial.length):E;if(S(D.code),O(!1),g===c&&b?.startsWith("delete")&&(b.endsWith("Forward")||(I-=1),g=g.slice(0,I)+g.slice(I+1)),D.rule){let s=q(g,D.rule),y=g.length-s.length;I-=y,g=y>0&&!w&&c.length===s.length?c:s}V=D.dial+g,G=Z(g,D.rule)}R(V),l.value=G;let v=oe(G,I);l.setSelectionRange(v,v)},"onNumber"),onCountry:r(u=>{m(!1);let l=e.find(b=>b.code===u);O(l===void 0),l!==void 0&&S(l.code),R(l===void 0?"":l.dial+(a?"":c))},"onCountry")}}r(_e,"usePhoneField");function xe({field:e,id:n,locale:o,t,inputRef:P,invalid:S=!1,describedby:d,required:R,compact:T=!1,ready:O}){let{selected:p,whole:m,other:N,free:i,national:k,rule:f,phone:a,refused:C,typed:$,countries:c,international:_}=e,[A,U]=K(!1),x=W(null),F=W(null),Y=W(null),u=W(null),l=P??u,b=fe(),h=C?t("otp.reason_otp_destination_not_allowed"):e.lengthShown&&f?t("otp.phoneLengthError",{digits:re(f,t("otp.or"))}):"",E=c.length>1||_,w=me(o),I=ge(()=>{let s=null;try{s=new Intl.DisplayNames([o],{type:"region"})}catch{}return c.map(y=>({code:y.code,name:s?.of(y.code)??y.code}))},[c,o]),G=c.length>be,V=[m?"":`${n}-dial ${n}-hint`,h?`${n}-error`:"",d??""].join(" ").trim()||void 0,v=r(s=>{U(!1),requestAnimationFrame(()=>(s==="lead"?x.current:l.current)?.focus())},"close"),D=r(()=>{if(A)return v("lead");U(!0),requestAnimationFrame(()=>(Y.current??F.current?.querySelector('[aria-current="true"]')??F.current?.querySelector("button"))?.focus())},"toggle"),g=r(()=>j("span",{className:"sekyro-phone__dial",id:`${n}-dial`,"aria-hidden":E||void 0,children:[L("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:N?"🌐":J(p.code)}),N?null:p.dial]}),"dial");return j(Pe,{children:[j("div",{className:`sekyro-phone${T?" sekyro-phone--compact":""}`,dir:"ltr",children:[p===null||m&&!N?null:E?L("button",{ref:x,type:"button",className:"sekyro-phone__lead sekyro-phone__pick","aria-label":`${t("otp.countryLabel")}: ${N?t("otp.otherCountry"):w(p)}`,"aria-expanded":A,"aria-controls":A?b:void 0,onClick:D,children:g()}):L("div",{className:"sekyro-phone__lead",children:g()}),L("input",{ref:l,id:n,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel",required:R,"aria-describedby":V,"aria-invalid":!!h||S||void 0,placeholder:i?"+":void 0,value:m?a:Z(k,f),onChange:e.onNumber,onKeyDown:s=>{s.key==="Enter"&&O===!1&&e.setLengthShown(!0)},onBlur:s=>{let y=s.relatedTarget;y!==null&&(x.current?.contains(y)||F.current?.contains(y))||e.setLengthShown(k!==""&&$===null)}})]}),A?L("div",{ref:F,id:b,className:"sekyro-phone__list",onKeyDown:s=>{s.key==="Escape"&&(s.preventDefault(),v("lead"))},children:L(te,{countries:I,label:L("span",{className:"sekyro-visually-hidden",children:t("otp.countrySearch")}),searchPlaceholder:t("otp.countrySearch"),noMatch:t("doc.noCountryMatch"),searchable:G,scroll:!0,...G?{searchRef:Y}:{},...!N&&p!==null?{selected:p.code}:{},detail:s=>c.find(y=>y.code===s)?.dial,onPick:s=>{e.onCountry(s),v("number")},..._?{extra:{label:t("otp.otherCountry"),current:N,onPick:r(()=>{e.onCountry(Ce),v("number")},"onPick")}}:{}})}):null,m?null:L("span",{className:"sekyro-help",id:`${n}-hint`,children:t("otp.phonePlaceholderGeneric")}),h?L("span",{className:"sekyro-help is-danger",id:`${n}-error`,role:"alert",children:h}):null]})}r(xe,"PhoneField");export{Ne as a,te as b,J as c,_e as d,xe as e};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as b}from"./chunk-
|
|
2
|
+
import{a as b}from"./chunk-CBQYUAKA.js";import{d as I}from"./chunk-A7UG6YDG.js";import{a as _,b as P,d as S,p as x,q as C}from"./chunk-HO5RMTZU.js";import{a as f}from"./chunk-3MCTR3RI.js";import{a as s}from"./chunk-2KED7D2Q.js";import{useRef as E,useState as k}from"react";var N={"portrait.source.title":"كيف تريد إضافة صورتك الشخصية؟","portrait.source.description":"التقط صورة جديدة بالكاميرا، أو ارفع صورة حديثة من هذا الجهاز.","portrait.source.camera":"التقاط صورة","portrait.source.upload":"رفع صورة","portrait.source.uploadInstead":"رفع صورة بدلًا من ذلك","portrait.upload.title":"ارفع صورتك الشخصية","portrait.upload.hint":"صورة حديثة لوجهك، تنظر فيها مباشرة إلى الكاميرا، أمام جدار فاتح وبلون واحد.","portrait.upload.choose":"اختيار صورة","portrait.upload.unsupported":"اختر صورة بصيغة JPEG أو PNG أو HEIC.","portrait.upload.failed":"تعذّر إرسال هذه الصورة. حاول مرة أخرى.","portrait.review.title":"تحقّق من صورتك المعدّلة","portrait.review.description":"عدّلنا صورتك لتطابق قواعد صور الهوية. لم نغيّر وجهك.","portrait.review.original":"صورتك","portrait.review.fixed":"الصورة المعدّلة","portrait.review.fixesTitle":"ما الذي غيّرناه","portrait.review.accept":"استخدام هذه الصورة","portrait.review.retake":"إعادة الالتقاط","portrait.review.uploadAnother":"رفع صورة أخرى","portrait.fixes.crop":"قُصّت","portrait.fixes.scale":"غُيّر حجمها","portrait.fixes.straighten":"عُدّل ميلها","portrait.fixes.background":"استُبدلت الخلفية","portrait.fixes.exposure":"عُدّل السطوع","portrait.fixes.white_balance":"وُزنت الألوان","reasons.portrait_morph_suspected":"لا يمكن استخدام هذه الصورة. التقط صورة جديدة للشخص.","reasons.portrait_reference_mismatch":"لا تطابق الصورة المرجع. التقط صورة جديدة للشخص.","reasons.portrait_declined_fix":"التقط صورة أخرى أو ارفعها."};var g={"portrait.source.title":"How do you want to add your ID photo?","portrait.source.description":"Take a new photo with the camera, or upload a recent photo from this device.","portrait.source.camera":"Take a photo","portrait.source.upload":"Upload a photo","portrait.source.uploadInstead":"Upload a photo instead","portrait.upload.title":"Upload your ID photo","portrait.upload.hint":"A recent photo of your face, looking straight at the camera, in front of a plain, light wall.","portrait.upload.choose":"Choose a photo","portrait.upload.unsupported":"Choose a JPEG, PNG or HEIC photo.","portrait.upload.failed":"We could not send this photo. Try again.","portrait.review.title":"Check your adjusted photo","portrait.review.description":"We adjusted your photo to meet the ID photo rules. Your face was not changed.","portrait.review.original":"Your photo","portrait.review.fixed":"Adjusted photo","portrait.review.fixesTitle":"What we changed","portrait.review.accept":"Use this photo","portrait.review.retake":"Take another","portrait.review.uploadAnother":"Upload another","portrait.fixes.crop":"Cropped","portrait.fixes.scale":"Resized","portrait.fixes.straighten":"Straightened","portrait.fixes.background":"Background replaced","portrait.fixes.exposure":"Brightness adjusted","portrait.fixes.white_balance":"Colours balanced","reasons.portrait_morph_suspected":"This photo cannot be used. Take a new photo of the person.","reasons.portrait_reference_mismatch":"The photo does not match the reference. Take a new photo of the person.","reasons.portrait_declined_fix":"Take or upload another photo."};var T={"portrait.source.title":"Comment voulez-vous ajouter votre photo d'identité ?","portrait.source.description":"Prenez une nouvelle photo avec la caméra, ou importez une photo récente depuis cet appareil.","portrait.source.camera":"Prendre une photo","portrait.source.upload":"Importer une photo","portrait.source.uploadInstead":"Importer une photo à la place","portrait.upload.title":"Importez votre photo d'identité","portrait.upload.hint":"Une photo récente de votre visage, de face, devant un mur clair et uni.","portrait.upload.choose":"Choisir une photo","portrait.upload.unsupported":"Choisissez une photo JPEG, PNG ou HEIC.","portrait.upload.failed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","portrait.review.title":"Vérifiez votre photo ajustée","portrait.review.description":"Nous avons ajusté votre photo pour qu'elle respecte les règles des photos d'identité. Votre visage n'a pas été modifié.","portrait.review.original":"Votre photo","portrait.review.fixed":"Photo ajustée","portrait.review.fixesTitle":"Ce que nous avons modifié","portrait.review.accept":"Utiliser cette photo","portrait.review.retake":"Reprendre","portrait.review.uploadAnother":"Importer une autre","portrait.fixes.crop":"Recadrée","portrait.fixes.scale":"Redimensionnée","portrait.fixes.straighten":"Redressée","portrait.fixes.background":"Fond remplacé","portrait.fixes.exposure":"Luminosité ajustée","portrait.fixes.white_balance":"Couleurs équilibrées","reasons.portrait_morph_suspected":"Cette photo ne peut pas être utilisée. Prenez une nouvelle photo de la personne.","reasons.portrait_reference_mismatch":"La photo ne correspond pas à la référence. Prenez une nouvelle photo de la personne.","reasons.portrait_declined_fix":"Prenez ou importez une autre photo."};import{jsx as t,jsxs as n}from"react/jsx-runtime";var H={en:g,fr:T,ar:N,es:g,pt:g,de:g},V="image/jpeg,image/png,image/heic,image/heif";function v(r){let o=r.strings,i=H[r.locale];return e=>o[e]??i[e]??""}s(v,"portraitCopy");function R({step:r,i18n:o}){if(r.reason===void 0||r.reason==="portrait_fix_review")return null;let i=v(o)(`reasons.${r.reason}`)||o.t("portrait.retryTitle");return n(x,{tone:"warning",children:[t("span",{children:i}),t("span",{children:C(o,r.attemptsRemaining,r.attemptsExhausted)})]})}s(R,"ReasonNotice");function z({step:r,i18n:o,onCamera:i,onUpload:e}){let a=v(o),p=r.photo?.cameraOnPhone===!0;return t(b,{testId:"sekyro-portrait-source",title:a("portrait.source.title"),lead:a("portrait.source.description"),cameraLabel:p?o.t("capture.source.phone"):a("portrait.source.camera"),onPhone:p,uploadLabel:a("portrait.source.upload"),notice:t(R,{step:r,i18n:o}),onCamera:i,onUpload:e})}s(z,"PortraitSourceView");function A({step:r,i18n:o,onCamera:i}){let e=v(o),a=E(null),[p,h]=k("idle"),u=p==="sending",l=r.photo?.uploadOffered===!0,w=s(async c=>{let y=c.currentTarget.files?.[0];if(c.currentTarget.value="",y!==void 0){h("sending");try{await r.uploadPortrait(y),h("idle")}catch(m){h(m instanceof TypeError&&m.message==="unsupported_file"?"unsupported":"failed")}}},"onFile");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-upload-screen",children:[t(P,{title:e("portrait.upload.title"),lead:e("portrait.upload.hint")}),p==="idle"||p==="sending"?t(R,{step:r,i18n:o}):null,p==="unsupported"||p==="failed"?t(x,{tone:"warning",children:t("span",{children:e(p==="unsupported"?"portrait.upload.unsupported":"portrait.upload.failed")})}):null,u?t("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:o.t("portrait.uploading")}):null,t("input",{ref:a,type:"file",accept:V,hidden:!0,"data-testid":"sekyro-portrait-upload","aria-label":e("portrait.upload.title"),onChange:c=>{w(c)}}),n(S,{children:[t(f,{full:!0,onClick:()=>a.current?.click(),disabled:u||!l||r.attemptsExhausted,children:e("portrait.upload.choose")}),i!==void 0?n(f,{full:!0,kind:"ghost",onClick:i,disabled:u,children:[t(_,{name:"camera"}),e("portrait.source.camera")]}):null]})]})}s(A,"PortraitUploadView");function j({step:r,i18n:o,onDeclined:i}){let e=v(o),[a,p]=k(!1),[h,u]=k(!1),l=r.pendingFix;if(l==null)return null;let w=s(async d=>{p(!0),u(!1);try{await r.confirmFix(d),d||i?.()}catch{u(!0)}finally{p(!1)}},"answer"),c=r.photo?.source==="upload"?e("portrait.review.uploadAnother"):e("portrait.review.retake"),y=s(d=>e(`portrait.fixes.${d}`)||d,"fixName"),m=e("portrait.review.original"),U=e("portrait.review.fixed");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-review",children:[t(P,{title:e("portrait.review.title"),lead:e("portrait.review.description")}),n("div",{className:"sekyro-portrait-pair",children:[n("figure",{className:"sekyro-portrait-pair__item",children:[t("img",{src:l.originalUrl,alt:m}),t("figcaption",{className:"sekyro-text-muted",children:m})]}),n("figure",{className:"sekyro-portrait-pair__item",children:[t("img",{src:l.fixedUrl,alt:U}),t("figcaption",{className:"sekyro-text-muted",children:U})]})]}),l.fixes.length>0?n("div",{className:"sekyro-stack sekyro-stack--1",children:[t("p",{className:"sekyro-text-body",children:e("portrait.review.fixesTitle")}),t("ul",{className:"sekyro-portrait-fixes","data-testid":"sekyro-portrait-fixes",children:l.fixes.map(d=>t("li",{children:y(d)},d))})]}):null,h?t(x,{tone:"danger",children:t("span",{children:o.t("errors.network_error")})}):null,n(S,{children:[t(f,{full:!0,onClick:()=>{w(!0)},disabled:a,"data-testid":"sekyro-portrait-accept",children:e("portrait.review.accept")}),t(f,{full:!0,kind:"ghost",onClick:()=>{w(!1)},disabled:a,"data-testid":"sekyro-portrait-decline",children:c})]})]})}s(j,"PortraitReviewView");function Q({screen:r,step:o,i18n:i,onCamera:e,onUpload:a,onDeclined:p}){return r==="phone"?t(I,{i18n:i,lead:i.t("handoff.lead.portrait"),refresh:o.refresh,actions:t(f,{kind:"ghost",full:!0,onClick:a,children:v(i)("portrait.source.upload")})}):r==="review"?t(j,{step:o,i18n:i,onDeclined:p}):r==="upload"?t(A,{step:o,i18n:i,...e!==void 0?{onCamera:e}:{}}):t(z,{step:o,i18n:i,onCamera:e??a,onUpload:a})}s(Q,"PortraitScreens");export{v as a,z as b,A as c,j as d,Q as e};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{a as Be}from"./chunk-CBQYUAKA.js";import{d as Ve}from"./chunk-A7UG6YDG.js";import"./chunk-WVYPT45I.js";import{a as $e,b as Ue,c as Ee}from"./chunk-7MMT5M4E.js";import{d as Pe}from"./chunk-5V26KZGZ.js";import{a as Y,b as pe,d as me,j as Ie,k as Oe,l as Ae,n as Ke,p as he,q as fe}from"./chunk-HO5RMTZU.js";import"./chunk-VOIZLJLI.js";import{a as O,m as He,o as Re}from"./chunk-3MCTR3RI.js";import{a as d}from"./chunk-2KED7D2Q.js";import{useContext as qe,useEffect as G,useLayoutEffect as mt,useRef as F,useState as k}from"react";var Ye={image:'<path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/><path d="M14 8A2 2 0 1 0 18 8A2 2 0 1 0 14 8Z" stroke="currentColor"/><path d="M2 12.5L3.75 10.97C4.66 10.17 6.04 10.22 6.89 11.07L11.18 15.36C11.87 16.05 12.95 16.14 13.75 15.58L14.04 15.37C15.19 14.57 16.74 14.66 17.78 15.6L21 18.5" stroke="currentColor" stroke-linecap="round"/>',flashlight:'<path d="M9 11.66V19C9 19.93 9 20.4 9.15 20.77C9.36 21.26 9.74 21.64 10.23 21.85C10.6 22 11.07 22 12 22C12.93 22 13.4 22 13.77 21.85C14.26 21.64 14.64 21.26 14.85 20.77C15 20.4 15 19.93 15 19V11.66C15 10.84 15 10.43 15.15 10.06C15.3 9.7 15.59 9.41 16.17 8.83L16.17 8.83L19.41 5.59C19.7 5.3 19.85 5.15 19.92 4.97C20 4.78 20 4.58 20 4.17V4C20 3.06 20 2.59 19.71 2.29C19.41 2 18.94 2 18 2H6C5.06 2 4.59 2 4.29 2.29C4 2.59 4 3.06 4 4V4.17C4 4.58 4 4.78 4.08 4.97C4.15 5.15 4.3 5.3 4.59 5.59L7.83 8.83C8.41 9.41 8.7 9.7 8.85 10.06C9 10.43 9 10.84 9 11.66Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 10H9" stroke="currentColor" stroke-linecap="round"/><path d="M12 13V15" stroke="currentColor" stroke-linecap="round"/><path d="M4.5 5H19.5" stroke="currentColor" stroke-linecap="round"/>'};var Ge={"dcv3.mrz.searching":"ضع صفحة جواز السفر كاملة داخل الإطار","dcv3.mrz.showMrzSide":"اعرض الوجه الذي يحتوي على سطرين أو ثلاثة أسطر من الحروف","dcv3.mrz.reading":"جارٍ قراءة الوثيقة… ثبّتها","dcv3.mrz.moveCloser":"اقترب حتى تملأ أسطر الحروف الإطار","dcv3.mrz.turnSideways":"أدر هاتفك أفقيًا لقراءة أسطر الحروف","dcv3.mrz.glare":"أمِل الوثيقة لإزالة الانعكاس","dcv3.mrz.holdStill":"لا تتحرك","dcv3.mrz.valid":"تمت قراءة الوثيقة. جارٍ التقاط الصورة","dcv3.mrz.looksLikePassport":"يبدو أن هذا جواز سفر","dcv3.mrz.looksLikeCard":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"};var Q={"dcv3.mrz.searching":"Fit the whole passport page in the frame","dcv3.mrz.showMrzSide":"Show the side with the two or three lines of characters","dcv3.mrz.reading":"Reading the document… hold it steady","dcv3.mrz.moveCloser":"Move closer so the lines of characters fill the frame","dcv3.mrz.turnSideways":"Turn your phone sideways to read the lines of characters","dcv3.mrz.glare":"Tilt the document to remove the reflection","dcv3.mrz.holdStill":"Hold still","dcv3.mrz.valid":"Document read. Taking the photo","dcv3.mrz.looksLikePassport":"This looks like a passport","dcv3.mrz.looksLikeCard":"This looks like an identity card or residence permit"};var Fe={"dcv3.mrz.searching":"Cadrez toute la page du passeport","dcv3.mrz.showMrzSide":"Montrez la face avec les deux ou trois lignes de caractères","dcv3.mrz.reading":"Lecture du document… tenez-le immobile","dcv3.mrz.moveCloser":"Rapprochez-vous pour que les lignes de caractères remplissent le cadre","dcv3.mrz.turnSideways":"Tournez votre téléphone à l’horizontale pour lire les lignes de caractères","dcv3.mrz.glare":"Inclinez le document pour supprimer le reflet","dcv3.mrz.holdStill":"Ne bougez plus","dcv3.mrz.valid":"Document lu. Prise de la photo","dcv3.mrz.looksLikePassport":"Ceci ressemble à un passeport","dcv3.mrz.looksLikeCard":"Ceci ressemble à une carte d’identité ou un titre de séjour"};var We={"doc.uploadInstead":"رفع صورة بدلًا من ذلك","doc.uploadTitle":"ارفع صورة لوثيقتك","doc.uploadHint":"صورة واضحة للوثيقة كاملة، ملتقطة بكاميرا.","doc.uploadUnsupported":"اختر صورة للوثيقة بصيغة JPEG أو PNG أو HEIC.","doc.uploadFailed":"تعذّر إرسال هذه الصورة. أعد المحاولة.","doc.source.title":"كيف تريد إضافة وثيقتك؟","doc.source.description":"التقط صورة بالكاميرا، أو ارفع صورة للوثيقة من هذا الجهاز.","doc.source.camera":"التقاط صورة","doc.source.upload":"رفع صورة"};var Z={"doc.uploadInstead":"Upload a photo instead","doc.uploadTitle":"Upload a photo of your document","doc.uploadHint":"A clear photo of the whole document, taken with a camera.","doc.uploadUnsupported":"Choose a JPEG, PNG or HEIC photo of the document.","doc.uploadFailed":"We could not send this photo. Try again.","doc.source.title":"How do you want to add your document?","doc.source.description":"Take a photo with the camera, or upload a photo of the document from this device.","doc.source.camera":"Take a photo","doc.source.upload":"Upload a photo"};var Xe={"doc.uploadInstead":"Téléverser une photo à la place","doc.uploadTitle":"Téléversez une photo de votre document","doc.uploadHint":"Une photo nette du document entier, prise avec un appareil photo.","doc.uploadUnsupported":"Choisissez une photo JPEG, PNG ou HEIC du document.","doc.uploadFailed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","doc.source.title":"Comment voulez-vous ajouter votre document ?","doc.source.description":"Prenez une photo avec la caméra, ou importez une photo du document depuis cet appareil.","doc.source.camera":"Prendre une photo","doc.source.upload":"Importer une photo"};var je={"native.doc.introTitle":"سنلتقط صورة لوثيقتك","native.doc.introLead":"ستُفتح كاميرا هاتفك، وتُلتقط الصورة تلقائيًا بمجرد أن تكون الوثيقة داخل الإطار.","native.doc.tip.flat":"ضع الوثيقة مسطحة على سطح داكن.","native.doc.tip.glare":"تجنّب انعكاسات المصابيح أو الشمس.","native.doc.tip.frame":"أبقِ الوثيقة كاملة داخل الإطار.","native.doc.openCamera":"افتح الكاميرا","native.doc.changeDocument":"تغيير الوثيقة","native.scan.closer":"اقترب قليلًا","native.scan.farther":"ابتعد قليلًا","native.scan.glare":"أمِل البطاقة قليلًا","native.scan.dark":"الإضاءة ضعيفة. شغّل المصباح.","native.scan.blurry":"الصورة غير واضحة. ثبّت الهاتف.","native.scan.holdStill":"لا تتحرك","native.scan.reading":"جارٍ التحقق من وثيقتك…","native.scan.putDown":"يمكنك وضع وثيقتك جانبًا.","native.scan.retry":"لنحاول مرة أخرى"};var q={"native.doc.introTitle":"Photograph your document","native.doc.introLead":"Your phone's camera will open. The photo is taken by itself as soon as the document is well framed.","native.doc.tip.flat":"Lay the document flat on a dark surface.","native.doc.tip.glare":"Avoid glare from lamps or sunlight.","native.doc.tip.frame":"Keep the whole document in the frame.","native.doc.openCamera":"Open the camera","native.doc.changeDocument":"Change document","native.scan.closer":"Move a little closer","native.scan.farther":"Move back a little","native.scan.glare":"Tilt the card a little","native.scan.dark":"Too dark. Turn on the light.","native.scan.blurry":"Blurry image. Hold the phone still.","native.scan.holdStill":"Hold still","native.scan.reading":"Checking your document…","native.scan.putDown":"You can put your document down.","native.scan.retry":"Let's try that again"};var Qe={"native.doc.introTitle":"Photographiez votre pièce","native.doc.introLead":"La caméra de votre téléphone va s'ouvrir. La photo est prise automatiquement dès que la pièce est bien cadrée.","native.doc.tip.flat":"Posez la pièce à plat, sur une surface sombre.","native.doc.tip.glare":"Évitez les reflets de lampe ou de soleil.","native.doc.tip.frame":"Gardez toute la pièce dans le cadre.","native.doc.openCamera":"Ouvrir la caméra","native.doc.changeDocument":"Changer de document","native.scan.closer":"Approchez un peu","native.scan.farther":"Reculez un peu","native.scan.glare":"Inclinez un peu la carte","native.scan.dark":"Trop sombre. Allumez la lampe.","native.scan.blurry":"Image floue. Tenez le téléphone immobile.","native.scan.holdStill":"Ne bougez plus","native.scan.reading":"Vérification de votre document…","native.scan.putDown":"Vous pouvez poser votre pièce.","native.scan.retry":"Réessayons"};var pt=["locking","capturing"],ge=class ge{constructor(){this.shown={hint:null,locking:!1,card:null,manualShutter:!1};this.candidate=null;this.candidateSince=0;this.hintShownAt=0;this.lockLostAt=null;this.detectedSince=null;this.lostSince=null;this.shutterSince=null}present(e,o){return this.presentHint(e,o),this.presentLock(e,o),this.presentCard(e,o),this.shutterSince=e.manualShutter?this.shutterSince??o:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&o-this.shutterSince>=1e3},this.shown}presentHint(e,o){let a=e.phase==="framing"&&!(e.hint==="blurry"&&e.card===null)?e.hint:null;if(e.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(a!==this.candidate&&(this.candidate=a,this.candidateSince=o),a===this.shown.hint)return;let r=o-this.candidateSince>=(a===null?0:350),h=this.shown.hint===null||o-this.hintShownAt>=1200;r&&h&&(this.shown={...this.shown,hint:a},this.hintShownAt=o)}presentLock(e,o){if(pt.includes(e.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(e.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=o),o-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(e,o){let a=e.card;if(a===null||e.phase!=="framing"){if(e.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=o),o-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=o),o-this.detectedSince<250)return;let r=this.shown.card;if(r===null){this.shown={...this.shown,card:{...a}};return}let h=.35;this.shown={...this.shown,card:{fill:r.fill+(a.fill-r.fill)*h,offsetX:r.offsetX+(a.offsetX-r.offsetX)*h,offsetY:r.offsetY+(a.offsetY-r.offsetY)*h}}}};d(ge,"ScanPresenter");var ae=ge;import{Fragment as Se,jsx as n,jsxs as i}from"react/jsx-runtime";var ht={en:q,fr:Qe,ar:je,es:q,pt:q,de:q},ft=450,ve=d(t=>e=>Pe(t.strings[e]??ht[t.locale][e]??""),"useScanCopy");function re({name:t}){return n("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:Ye[t]}})}d(re,"ScanGlyph");var gt={en:Q,fr:Fe,ar:Ge,es:Q,pt:Q,de:Q},St={en:Z,fr:Xe,ar:We,es:Z,pt:Z,de:Z},vt="image/jpeg,image/png,image/heic,image/heif";function W(t){let e=t.strings,o=d(a=>e[a]??St[t.locale][a],"text");return{t:d(a=>o(a)??"","t")}}d(W,"uploadCopy");function yt(t,e){return t===null||t.state==="fallback"||t.state==="mismatch"?null:t.state==="searching"?e?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":t.state==="valid"?"dcv3.mrz.valid":t.coach!==void 0?`dcv3.mrz.${t.coach}`:"dcv3.mrz.reading"}d(yt,"mrzInstruction");var kt={document_type_mismatch:"doc.reason_document_type_mismatch",document_number_invalid:"doc.reason_document_number_invalid",provider_unavailable:"doc.reason_provider_unavailable",document_type_not_supported:"doc.reason_document_type_not_supported",document_sides_mismatch:"doc.reason_document_sides_mismatch"};function ye(t){if(t.reason==="unreadable")return"doc.reason_unreadable";let e=t.reason!==void 0?kt[t.reason]:void 0;return e!==void 0?e:t.reason==="tester_document_mismatch"?"reasons.tester_document_mismatch":t.reason!==void 0&&t.reason!=="side_missing"?Re(t.reason):null}d(ye,"reasonOf");var bt=new Set(["document_type_not_accepted","tester_document_mismatch","document_type_mismatch","provider_unavailable","document_type_not_supported","document_sides_mismatch"]);function un({step:t,i18n:e,liveMrz:o,barcodeAssetBaseUrl:a,ageLead:r,...h}){let[b,v]=k(!1),g=F(-1),[f,S]=k("idle"),L=F(null),w=typeof t.uploadDocument=="function",N=w?t.photo?.source??"camera":"camera",A=w&&N!=="camera"&&t.photo?.uploadOffered===!0,[y,K]=k(null),M=N==="upload"?"upload":N==="choice"?y??t.photo?.pick??"source":"camera",H=f==="sending"?void 0:()=>L.current?.click(),m=d(async R=>{let ee=R.currentTarget.files?.[0];if(R.currentTarget.value="",ee!==void 0){v(!1),S("sending");try{await t.uploadDocument(ee),S("idle")}catch(j){S(j instanceof TypeError&&j.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),J=A?n("input",{ref:L,type:"file",accept:vt,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":W(e).t("doc.uploadTitle"),onChange:R=>{m(R)}}):null,C=W(e),X=t.photo?.cameraOnPhone===!0;return M==="camera"&&X?n(Ve,{i18n:e,lead:e.t("handoff.lead.document"),refresh:t.refresh,actions:n(O,{kind:"ghost",full:!0,onClick:()=>K("upload"),children:C.t("doc.source.upload")})}):M==="source"?n(Be,{testId:"sekyro-doc-source",title:C.t("doc.source.title"),lead:C.t("doc.source.description"),cameraLabel:X?e.t("capture.source.phone"):C.t("doc.source.camera"),onPhone:X,uploadLabel:C.t("doc.source.upload"),notice:n(ke,{step:t,i18n:e}),onCamera:()=>K("camera"),onUpload:()=>K("upload")}):M==="upload"?i(Se,{children:[n(_t,{step:t,i18n:e,ageLead:r===!0,upload:f,offered:A,onPick:()=>L.current?.click(),...N==="choice"?{onCamera:d(()=>K("camera"),"onCamera")}:{},...h}),J]}):i(Se,{children:[b?n(Lt,{step:t,i18n:e,attempts:g,...o!==void 0?{liveMrz:o}:{},...a!==void 0?{barcodeAssetBaseUrl:a}:{},...A&&H!==void 0?{onUpload:H}:{},onClose:()=>v(!1)}):n(Ct,{step:t,i18n:e,ageLead:r===!0,onOpen:()=>v(!0),upload:f,...A&&H!==void 0?{onUpload:H}:{},...h}),J]})}d(un,"DocumentCaptureView");function Je({passport:t}){let o=Math.round(228/(t?1.42:1.586));return i("svg",{className:"sekyro-mark sekyro-mark--card",viewBox:`-12 -12 252 ${o+24}`,"aria-hidden":"true",focusable:"false",children:[n("defs",{children:n("clipPath",{id:"sekyro-card-clip",children:n("rect",{width:228,height:o,rx:"12.5"})})}),n("rect",{className:"sekyro-mark__card",width:228,height:o,rx:"12.5"}),n("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:o*.52,rx:"6"}),[0,1,2].map(a=>n("rect",{className:"sekyro-mark__text",x:"88",y:23+a*o*.12,width:100-a*20,height:"6",rx:"3"},a)),[0,1].map(a=>n("rect",{className:"sekyro-mark__text",x:"17",y:o*.74+a*9,width:194,height:"4",rx:"2"},a)),n("g",{clipPath:"url(#sekyro-card-clip)",children:n("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:n("rect",{x:"-1",width:"2",height:o,className:"sekyro-mark__beam"})})}),n("path",{className:"sekyro-mark__brackets",d:wt(-10,-10,248,o+20,16,30)})]})}d(Je,"ScanMark");function wt(t,e,o,a,r,h){let b=Math.min(r,h*.6);return[[t,e,1,1],[t+o,e,-1,1],[t,e+a,1,-1],[t+o,e+a,-1,-1]].map(([g,f,S,L])=>`M${g} ${f+L*h}V${f+L*b}Q${g} ${f} ${g+S*b} ${f}H${g+S*h}`).join("")}d(wt,"brackets");function Ct({step:t,i18n:e,ageLead:o,onOpen:a,onChangeCountry:r,onChangeDocument:h,upload:b,onUpload:v}){let g=ve(e),f=W(e),S=t.documentType==="passport",L=ye(t),w=b==="sending",N=qe(Oe)?.busy===!0;return i("section",{className:"sekyro-step","data-testid":"sekyro-document",children:[n(Je,{passport:S}),n(pe,{title:g("native.doc.introTitle"),lead:o?e.t("doc.ageStepUp"):g("native.doc.introLead")}),n(ke,{step:t,i18n:e}),t.reason!==void 0&&bt.has(t.reason)?null:i("ul",{className:"sekyro-tiprows",children:[i("li",{children:[n(Y,{name:S?"passport":"card"}),g("native.doc.tip.flat")]}),i("li",{children:[n(Y,{name:"light"}),g("native.doc.tip.glare")]}),i("li",{children:[n(re,{name:"image"}),g("native.doc.tip.frame")]})]}),n(et,{i18n:e,...h!==void 0?{onChangeDocument:h}:{},...r!==void 0?{onChangeCountry:r}:{}}),n(tt,{i18n:e,upload:b}),w?n("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):v!==void 0?n("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,i(me,{children:[i(O,{full:!0,onClick:a,disabled:w||N,children:[n(Y,{name:"camera"}),g("native.doc.openCamera")]}),v!==void 0?i(O,{full:!0,kind:"ghost",onClick:v,children:[n(re,{name:"image"}),f.t("doc.uploadInstead")]}):null]})]})}d(Ct,"DocumentIntro");function ke({step:t,i18n:e}){let o=ye(t);return o===null?null:i(he,{tone:"warning",children:[n("span",{children:e.t(o)}),n("span",{children:fe(e,t.attemptsRemaining,t.attemptsExhausted)})]})}d(ke,"ReasonNotice");function et({i18n:t,onChangeCountry:e,onChangeDocument:o}){let a=ve(t);return o===void 0&&e===void 0?null:i("div",{className:"sekyro-links",children:[o!==void 0?n("button",{type:"button",className:"sekyro-link",onClick:o,children:a("native.doc.changeDocument")}):null,e!==void 0?n("button",{type:"button",className:"sekyro-link",onClick:e,children:t.t("native.doc.changeCountry")}):null]})}d(et,"ChangeLinks");function tt({i18n:t,upload:e}){return e!=="unsupported"&&e!=="failed"?null:n(he,{tone:"warning",children:n("span",{children:W(t).t(e==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}d(tt,"UploadNotice");function _t({step:t,i18n:e,ageLead:o,upload:a,offered:r,onPick:h,onCamera:b,onChangeCountry:v,onChangeDocument:g}){let f=W(e),S=a==="sending";return i("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[n(Je,{passport:t.documentType==="passport"}),n(pe,{title:f.t("doc.uploadTitle"),lead:o?e.t("doc.ageStepUp"):f.t("doc.uploadHint")}),o?n("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,n(ke,{step:t,i18n:e}),n(et,{i18n:e,...g!==void 0?{onChangeDocument:g}:{},...v!==void 0?{onChangeCountry:v}:{}}),n(tt,{i18n:e,upload:a}),S?n("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):null,i(me,{children:[i(O,{full:!0,onClick:h,disabled:S||!r||t.attemptsExhausted,children:[n(re,{name:"image"}),f.t("doc.source.upload")]}),b!==void 0?i(O,{full:!0,kind:"ghost",onClick:b,disabled:S,children:[n(Y,{name:"camera"}),f.t("doc.source.camera")]}):null]})]})}d(_t,"DocumentUploadScreen");function Ze(t,e,o){let a=t*.88,r=a/o;return{x:(t-a)/2,y:e*.42-r/2,w:a,h:r}}d(Ze,"guideRect");var Dt={too_far:"native.scan.closer",too_close:"native.scan.farther",focus_far:"native.scan.farther",glare:"native.scan.glare",too_bright:"native.scan.glare",too_dark:"native.scan.dark",blurry:"native.scan.blurry"},Nt=d(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function Lt({step:t,i18n:e,liveMrz:o,barcodeAssetBaseUrl:a,onClose:r,attempts:h,onUpload:b}){let v=ve(e),g=qe($e),f=F(g);f.current=g;let S=F(null),L=F(null),w=F(null),[N,A]=k("idle"),[y,K]=k(null),[M,H]=k(null),[m,J]=k({w:0,h:0}),[C,X]=k({hint:null,locking:!1,card:null,manualShutter:!1}),[R,ee]=k({}),[j,nt]=k(null),[be,ot]=k(null),[we,Ce]=k(0),[_e,De]=k(null),[te,Ne]=k(null),$=t.documentType==="passport",ne=$?1.42:1.586;Ie(!0),mt(()=>{let c=S.current;if(c===null)return;let u=d(()=>J({w:c.clientWidth,h:c.clientHeight}),"measure");if(u(),typeof ResizeObserver>"u")return;let l=new ResizeObserver(u);return l.observe(c),()=>l.disconnect()},[]);let s=Ze(m.w,m.h,ne);G(()=>{m.w===0||m.h===0||w.current?.setGuide?.({viewAspect:m.w/m.h,rect:{x:s.x/m.w,y:s.y/m.h,width:s.w/m.w,height:s.h/m.h}})},[m.w,m.h,s.x,s.y,s.w,s.h]),G(()=>{let c=L.current;if(c===null)return;let u=t.capture({video:c,...o!==void 0?{liveMrz:o}:{},...a!==void 0?{barcodeAssetBaseUrl:a}:{}});w.current=u;let l=S.current;if(l!==null&&l.clientWidth>0&&l.clientHeight>0){let p=Ze(l.clientWidth,l.clientHeight,ne);u.setGuide?.({viewAspect:l.clientWidth/l.clientHeight,rect:{x:p.x/l.clientWidth,y:p.y/l.clientHeight,width:p.w/l.clientWidth,height:p.h/l.clientHeight}})}let T=new ae,D={scan:null,feedback:null,gate:null},E=d(p=>{D={...D,...p};let x=D.gate?.guide,ut={phase:D.scan?.phase??"framing",hint:D.feedback?.reticle==="coaching"?D.feedback.key:null,card:x?.detected?{fill:x.fill,offsetX:x.offsetX,offsetY:x.offsetY}:null,manualShutter:D.scan?.manualShutter??!1},P=T.present(ut,performance.now());X(I=>I.hint===P.hint&&I.locking===P.locking&&I.manualShutter===P.manualShutter&&I.card?.fill===P.card?.fill&&I.card?.offsetX===P.card?.offsetX&&I.card?.offsetY===P.card?.offsetY?I:P)},"present"),dt=[u.on("state",A),u.on("feedback",p=>E({feedback:p})),u.on("gate",p=>E({gate:p})),u.on("scan",p=>{K(p),E({scan:p})}),u.on("captured",p=>{ee(x=>({...x,[zt(p.side,$,x)]:p.previewDataUrl})),nt(p.previewDataUrl),ot(Tt(c))}),u.on("error",p=>{H(p);let x=f.current;x!==null&&Ee(x,Ue("document",p,Math.max(0,h.current)))}),u.on("mrz",p=>{p.state==="mismatch"?Ne(p.format??null):De(p)})];return h.current+=1,u.start().catch(()=>{}),()=>{for(let p of dt)p();u.destroy(),w.current=null}},[t.issuer,t.documentType]);let z=y?.phase??"framing",U=z==="reading"||z==="result",se=z==="flipCue"||z==="reaskRecto",V=C.locking,Le=y?.captured.length??0;G(()=>{V&&Ce(c=>c+1)},[V]),G(()=>{Le>0&&Ce(c=>c+1)},[Le]);let at=y?.expected??null;G(()=>{De(null)},[at]),G(()=>{if(te===null)return;let c=setTimeout(()=>Ne(null),2e3);return()=>clearTimeout(c)},[te]);let ze=se||U||t.documentType==="drivers_license"?null:yt(_e,$),ie=te!==null?te==="TD3"?"dcv3.mrz.looksLikePassport":"dcv3.mrz.looksLikeCard":ze,rt=ie===null?null:e.strings[ie]??gt[e.locale][ie],ce=ye(t),xe=C.hint===null?null:Dt[C.hint]??`dcv2.${C.hint}`,st=xe??(z==="flipCue"?y?.notice==="same_face"?"doc.sameFace":"doc.flip":z==="reaskRecto"?"doc.reaskRecto":U?"native.scan.reading":z==="locking"||z==="capturing"||V?"native.scan.holdStill":y?.notice==="reread"?ce??"doc.reread":y?.notice==="technical"?"native.scan.retry":y?.notice==="blurry"?"native.scan.blurry":ce??($?"doc.showPage":"doc.showSide")),le=rt??v(st),B=C.card,_=s;if(!V&&B!==null&&B.fill>=.45&&B.fill<=1.25&&!Nt()){let c=s.w*B.fill,u=c/ne,l=s.x+s.w/2+s.w*Math.max(-.25,Math.min(.25,B.offsetX)),T=s.y+s.h/2+s.h*Math.max(-.25,Math.min(.25,B.offsetY));_={x:l-c/2,y:T-u/2,w:c,h:u}}let oe=s.w*.045,de=28,Te=Math.min(oe,de*.6),it=[[_.x,_.y,1,1],[_.x+_.w,_.y,-1,1],[_.x,_.y+_.h,1,-1],[_.x+_.w,_.y+_.h,-1,-1]],ct=V?"is-locked":C.hint!==null?"is-coaching":"",lt=$?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],Me=s.y+s.h+48,ue={insetInlineStart:s.x,insetBlockStart:s.y,inlineSize:s.w,blockSize:s.h,borderRadius:oe};return n("section",{className:"sekyro-lm","aria-label":le,"data-testid":"sekyro-document",children:i("div",{ref:S,className:`sekyro-lm-stage${U?" is-reading":""}${se?" is-flip":""}`,style:{"--sekyro-guide-w":`${s.w}px`},children:[n("video",{ref:L,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:c=>{let u=c.currentTarget,l=u.getBoundingClientRect(),T=Math.max(l.width/(u.videoWidth||1),l.height/(u.videoHeight||1)),D=u.videoWidth*T,E=u.videoHeight*T;D>0&&E>0&&w.current?.focusAt((c.clientX-l.left+(D-l.width)/2)/D,(c.clientY-l.top+(E-l.height)/2)/E)}}),m.w>0?i(Se,{children:[U&&be!==null?n("img",{className:"sekyro-lm-scene",src:be,alt:""}):null,U&&j!==null?n("img",{className:"sekyro-lm-frozen",src:j,alt:"",style:ue}):null,i("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${m.w} ${m.h}`,"aria-hidden":"true",focusable:"false",children:[i("defs",{children:[i("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[n("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),n("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),i("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[n("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),n("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),n("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${m.w}V${m.h}H0Z${xt(s,oe)}`}),n("rect",{width:m.w,height:Math.max(0,s.y),fill:"url(#sekyro-lm-top)"}),n("rect",{y:s.y+s.h,width:m.w,height:Math.max(0,m.h-s.y-s.h),fill:"url(#sekyro-lm-bottom)"}),n("g",{className:`sekyro-lm-brackets ${ct}`,children:it.map(([c,u,l,T],D)=>n("path",{style:{transform:`translate(${c}px, ${u}px) scale(${l}, ${T})`},d:`M0 ${de}V${Te}Q0 0 ${Te} 0H${de}`},D))}),V?n("rect",{className:"sekyro-lm-trace",x:s.x,y:s.y,width:s.w,height:s.h,rx:oe,pathLength:"1",style:{animationDuration:`${ft}ms`}}):null]}),n("div",{className:"sekyro-lm-slot",style:ue,"aria-hidden":"true",children:U?n("span",{className:"sekyro-lm-read is-repeating"}):we>0?n("span",{className:"sekyro-lm-read"},we):null})]}):null,ze!==null?n("div",{className:"sekyro-lm-slot",style:ue,"aria-hidden":"true",children:n("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${$?" is-page":""}${_e?.state==="valid"?" is-valid":""}`})}):null,i("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:s.y-64},children:[n("div",{role:"status","aria-live":"polite",children:n(Ke,{swapKey:le,className:"sekyro-lm-line",children:le})}),ce!==null&&z==="framing"&&xe===null?n("p",{className:"sekyro-lm-attempts",children:fe(e,t.attemptsRemaining,t.attemptsExhausted)}):null]}),U?i("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:Me-12},children:[n("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),v("native.scan.putDown")]}):se?n("div",{className:`sekyro-lm-under sekyro-lm-flip${z==="reaskRecto"?" is-toFront":""}`,style:{insetBlockStart:Me-20},"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:i("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(ne)},children:[n("span",{className:"sekyro-lm-flip-front"}),n("span",{className:"sekyro-lm-flip-back"})]})}):null,i("div",{className:"sekyro-lm-controls",children:[i("div",{className:"sekyro-lm-bar",children:[n("button",{type:"button",className:"sekyro-glass","aria-label":e.t("native.close"),onClick:r,children:n(Y,{name:"close"})}),y?.torchAvailable?n("button",{type:"button",className:`sekyro-glass${y.torch?" is-on":""}`,"aria-label":e.t("doc.torchOn"),"aria-pressed":y.torch,onClick:()=>w.current?.setTorch(!y.torch),children:n(re,{name:"flashlight"})}):null]}),M!==null?i("div",{className:"sekyro-lm-error",role:"alert",children:[n("p",{children:e.t("doc.cameraBlocked")}),n("p",{children:e.t(M.kind==="permission"?"doc.cameraBlockedHint":He(M.kind))}),n(O,{onClick:()=>{H(null),h.current+=1,w.current?.retry()},children:e.t("doc.retryCamera")})]}):null,C.manualShutter?n("button",{type:"button",className:"sekyro-shutter","aria-label":e.t("doc.shutter"),onClick:()=>w.current?.shutter()}):null,n("ol",{className:"sekyro-lm-tray",children:lt.map(({side:c,label:u})=>{let l=y?.captured.includes(c)??!1;return i("li",{className:l?"is-done":void 0,"aria-current":!l&&($||y?.expected===c)?"step":void 0,children:[l?i("span",{className:"sekyro-lm-thumb",children:[R[c]!==void 0?n("img",{src:R[c],alt:""}):null,n("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:n("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,v(u)]},c)})}),b!==void 0?n("button",{type:"button",className:"sekyro-lm-upload",onClick:b,children:W(e).t("doc.uploadInstead")}):null,N==="uploading"||N==="checking"?null:n(Ae,{onStop:r})]}),N==="uploading"||N==="checking"?n("span",{className:"sekyro-visually-hidden",role:"status",children:N==="uploading"?e.t("doc.uploading"):v("native.scan.reading")}):null]})})}d(Lt,"LumiereScan");function zt(t,e,o){return e?"single":t==="recto"||t==="verso"?t:o.recto===void 0?"recto":"verso"}d(zt,"slotOf");function xt({x:t,y:e,w:o,h:a},r){return`M${t+r} ${e}H${t+o-r}Q${t+o} ${e} ${t+o} ${e+r}V${e+a-r}Q${t+o} ${e+a} ${t+o-r} ${e+a}H${t+r}Q${t} ${e+a} ${t} ${e+a-r}V${e+r}Q${t} ${e} ${t+r} ${e}Z`}d(xt,"roundedRect");function Tt(t){let e=Math.round(t.videoWidth/4),o=Math.round(t.videoHeight/4);if(e===0||o===0||typeof document>"u")return null;try{let a=document.createElement("canvas");a.width=e,a.height=o;let r=a.getContext("2d");return r===null?null:(r.drawImage(t,0,0,e,o),a.toDataURL("image/jpeg",.7))}catch{return null}}d(Tt,"sceneSnapshot");export{un as DocumentCaptureView,ft as LOCK_TRACE_MS,vt as UPLOAD_ACCEPT,Ze as guideRect,yt as mrzInstruction,zt as slotOf};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as O,b as K,c as z}from"./chunk-GUTF3SPK.js";import{a as Y,b as y,c as q}from"./chunk-55NNQK5P.js";import{a as U}from"./chunk-VRDPGOXM.js";import{d as $}from"./chunk-
|
|
2
|
+
import{a as O,b as K,c as z}from"./chunk-GUTF3SPK.js";import{a as Y,b as y,c as q}from"./chunk-55NNQK5P.js";import{a as U}from"./chunk-VRDPGOXM.js";import{d as $}from"./chunk-5V26KZGZ.js";import{d as x,m as W,p as A}from"./chunk-HO5RMTZU.js";import"./chunk-VOIZLJLI.js";import{a as N,s as G}from"./chunk-3MCTR3RI.js";import{a}from"./chunk-2KED7D2Q.js";import{isValidNni as ce,normalizeNni as J}from"@sekyro/web";import{useEffect as R,useId as ue,useRef as Q,useState as S}from"react";import{Fragment as w,jsx as n,jsxs as l}from"react/jsx-runtime";var X={en:y,fr:q,ar:Y,es:y,pt:y,de:y},C=6,me=new Set(["eid_identifier_invalid","eid_code_invalid","eid_locked","eid_not_enrolled"]),Z=a((e,t)=>{if(e===void 0)return 0;let p=Date.parse(e)-t;return Number.isFinite(p)?Math.max(0,Math.ceil(p/1e3)):0},"secondsUntil"),pe=a(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss");function Ae({step:e,i18n:t,className:p,onError:j}){let B=t.strings,o=a((i,s)=>$(B[i]??X[t.locale][i]??"",s),"t"),P=a((i,s)=>{let ae=new Intl.PluralRules(t.locale).select(s),V=`${i}.${ae}`,le=B[V]??X[t.locale][V]??o(`${i}.other`);return $(le,{count:new Intl.NumberFormat(t.locale).format(s)})},"plural"),v=a(i=>e.providerName?o(`eid.${i}`,{provider:e.providerName}):o(`eid.${i}Generic`),"named"),[I,ee]=S(""),[f,h]=S(""),[c,D]=S(!1),[g,u]=S(null),r=e.phase==="code",F=z(r),d=ue(),ne=G(),[ie,oe]=O(e.reason==="eid_code_invalid",e.codeAttemptsRemaining??0,()=>h("")),m=a(async i=>{D(!0),u(null);try{await i()}catch(s){u(U(s,t.strings)),j?.(s)}finally{D(!1)}},"run"),T=Q(!1);R(()=>{!e.identifierBound||r||e.reason!==void 0||T.current||(T.current=!0,m(()=>e.start()))},[e.identifierBound,r,e.reason]),R(()=>{(e.reason==="eid_code_invalid"||e.codeExpiresAt!==void 0)&&h("")},[e.reason,e.codeExpiresAt,e.codeAttemptsRemaining]);let H=Q(r);R(()=>{r&&!H.current&&document.getElementById(`${d}-code`)?.focus(),H.current=r},[r,d]);let b=e.reason==="eid_locked",M=Z(e.codeExpiresAt,F),E=r&&e.codeExpiresAt!==void 0&&M===0,_=Z(e.resendAvailableAt,F),L=e.resendsRemaining===0||e.reason==="eid_resend_limit",te=a(i=>{if(i.preventDefault(),r){f.length===C&&!b&&m(()=>e.verify(f));return}if(e.identifierBound){m(()=>e.start());return}let s=J(I);if(e.country==="MR"){if(!/^\d{10}$/.test(s))return u("population.invalid");if(!ce(s))return u("population.reason_nni_invalid")}m(()=>e.start(s))},"onSubmit"),k=e.reason?.startsWith("eid_")?e.reason:void 0,re=l(w,{children:[k!==void 0?l(A,{tone:me.has(k)?"danger":"warning",children:[n("span",{children:o(`reasons.${k}`)}),k==="eid_code_invalid"&&e.codeAttemptsRemaining!==void 0?n("span",{children:P("eid.codeAttemptsRemaining",e.codeAttemptsRemaining)}):null,e.canUseCamera?n(N,{kind:"secondary",disabled:c,onClick:()=>{m(()=>e.useCamera())},children:o("eid.useCamera")}):null]}):null,g!==null?n(A,{tone:"danger",children:n("span",{children:t.t(g)})}):null]}),[de,se]=r?[v("codeTitle"),v("codeHelp")]:[v("identifierTitle"),v(e.identifierBound?"boundDescription":"identifierDescription")];return l("form",{className:`sekyro-step sekyro-otp${p?` ${p}`:""}`,"aria-labelledby":d,onSubmit:te,noValidate:!0,"data-testid":"sekyro-eid",children:[l("div",{className:"sekyro-heading",children:[n("h2",{id:d,ref:ne,tabIndex:-1,className:"sekyro-text-body",children:de}),n("p",{className:"sekyro-text-muted",children:r&&e.context.simulation!==void 0?n(W,{template:t.t("sandbox.otpHint"),code:e.context.simulation.otpCode}):se}),e.afterPass==="continue"?n("p",{className:"sekyro-text-muted","data-testid":"sekyro-eid-continue",children:e.providerName?o("eid.continueHint",{provider:e.providerName}):o("eid.continueHintGeneric")}):null]}),re,r?l(w,{children:[l("div",{className:"sekyro-field",children:[n("label",{className:"sekyro-label",htmlFor:`${d}-code`,children:o("eid.codeLabel")}),b?n("input",{id:`${d}-code`,className:"sekyro-input sekyro-input--number",dir:"ltr",value:f,disabled:!0,readOnly:!0}):n(K,{id:`${d}-code`,value:f,length:C,invalid:ie,onChange:i=>{u(null),i!==""&&oe(),h(i)}}),e.codeExpiresAt!==void 0?n("span",{className:`sekyro-help sekyro-otp-expiry${E?" is-danger":""}`,children:E?o("eid.expired"):o("eid.expiresIn",{time:pe(M)})}):null]}),n("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:E?o("eid.expired"):""}),l(x,{children:[n(N,{type:"submit",full:!0,disabled:c||f.length!==C||b,"aria-busy":c||void 0,children:o("eid.verify")}),n("div",{className:"sekyro-resend-row",children:L?n("p",{className:"sekyro-resend is-waiting",children:o("eid.noResendsLeft")}):n("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:c||_>0||b,onClick:()=>{m(()=>e.resend())},children:_>0?o("eid.resendIn",{seconds:_}):o("eid.resend")})}),!L&&e.resendsRemaining!==void 0?n("p",{className:"sekyro-help sekyro-center",children:P("eid.resendsRemaining",e.resendsRemaining)}):null]})]}):l(w,{children:[e.identifierBound?null:l("div",{className:"sekyro-field",children:[n("label",{className:"sekyro-label",htmlFor:`${d}-nni`,children:t.t("population.label")}),n("input",{id:`${d}-nni`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:t.t("population.placeholder"),value:I,"aria-describedby":`${d}-nni-help`,"aria-invalid":g==="population.invalid"||g==="population.reason_nni_invalid"||void 0,onChange:i=>{u(null),ee(J(i.target.value).replace(/\D/g,"").slice(0,10))}}),n("span",{id:`${d}-nni-help`,className:"sekyro-help",children:t.t("population.helper")})]}),n(x,{children:n(N,{type:"submit",full:!0,disabled:c,"aria-busy":c||void 0,children:o("eid.start")})})]})]})}a(Ae,"EidView");export{Ae as EidView};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as B,b as F,c as J}from"./chunk-GUTF3SPK.js";import{a as U}from"./chunk-VRDPGOXM.js";import{d as M}from"./chunk-ND4YIVDH.js";import{b as Y,d as k,f as K,m as G,p as b,q as j}from"./chunk-BDXOOTQL.js";import"./chunk-YE6VVNPZ.js";import{a as C}from"./chunk-Q32AQDEB.js";import{a as r}from"./chunk-2KED7D2Q.js";import{OtpInputError as pe}from"@sekyro/web";import{useEffect as ce,useId as ue,useRef as fe,useState as p}from"react";var Q={"emailOtp.reason_otp_daily_cap_reached":"لا يمكننا إرسال رمز إلى بريدك الإلكتروني اليوم. اختر طريقة أخرى للتحقق إن كانت متاحة، أو حاول مرة أخرى لاحقًا.","emailOtp.reason_payment_method_required":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_spend_cap_reached":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_insufficient_balance":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_account_verification_required":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.sendTitle":"تحقّق من بريدك الإلكتروني","emailOtp.sendDescription":"سنرسل إليك عبر البريد الإلكتروني رمزًا يُستخدم مرة واحدة لتأكيد أن هذا العنوان يخصّك","emailOtp.prefilledNotice":"سنرسل رمز تحقّق إلى بريدك الإلكتروني المسجّل.","emailOtp.emailLabel":"البريد الإلكتروني","emailOtp.emailHelper":"سنرسل رمزًا يُستخدم مرة واحدة إلى هذا العنوان","emailOtp.emailPlaceholder":"عنوان بريدك الإلكتروني","emailOtp.emailInvalid":"أدخل عنوان بريد إلكتروني صالحًا","emailOtp.send":"أرسل لي رمزًا عبر البريد الإلكتروني","emailOtp.verifyTitle":"أدخل الرمز","emailOtp.verifyDescription":"أدخل الرمز المكوّن من 6 أرقام الذي أرسلناه إلى بريدك الإلكتروني لإتمام التحقّق من عنوانك","emailOtp.sentTo":"أرسلنا رمزًا مكوّنًا من 6 أرقام إلى {email}","emailOtp.codeLabel":"رمز التحقّق","emailOtp.codeHelper":"أدخل الرمز المكوّن من 6 أرقام الوارد في الرسالة","emailOtp.verify":"تحقّق من الرمز","emailOtp.resend":"إعادة إرسال الرمز","emailOtp.resendIn":"إعادة إرسال الرمز خلال {seconds} ثانية","emailOtp.expiresIn":"ينتهي الرمز خلال {time}","emailOtp.expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد","emailOtp.reason_otp_mismatch":"الرمز غير صحيح. تحقّق منه وأعد إدخاله","emailOtp.reason_otp_expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد للمتابعة","emailOtp.reason_otp_send_failed":"تعذّر إرسال الرسالة. أعد المحاولة لاحقًا. إذا تكرر ذلك، فتواصل مع الجهة التي طلبت منك التحقق.","emailOtp.reason_otp_rate_limited":"طُلبت رموز كثيرة لهذا العنوان. أعد المحاولة لاحقًا أو أدخل عنوانًا آخر.","emailOtp.reason_email_invalid":"لا يمكننا الإرسال إلى هذا العنوان. تحقّق منه أو أدخل عنوانًا آخر","emailOtp.reason_email_disposable":"استخدم بريدًا إلكترونيًا دائمًا، وليس عنوانًا مؤقتًا","emailOtp.changeEmail":"تغيير البريد الإلكتروني","emailOtp.backToCode":"العودة إلى الرمز","emailOtp.reason_otp_resend_limit":"لا يمكنك طلب رموز أخرى. أدخل آخر رمز وصلك"};var f={"emailOtp.reason_otp_daily_cap_reached":"We can't email you a code today. Choose another way to verify if one is offered, or try again later.","emailOtp.reason_payment_method_required":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_spend_cap_reached":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_insufficient_balance":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_account_verification_required":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.sendTitle":"Verify your email address","emailOtp.sendDescription":"We'll email you a one-time code to confirm this address is yours","emailOtp.prefilledNotice":"We'll send a verification code to your registered email address.","emailOtp.emailLabel":"Email address","emailOtp.emailHelper":"We'll send a one-time code to this address","emailOtp.emailPlaceholder":"Your email address","emailOtp.emailInvalid":"Enter a valid email address","emailOtp.send":"Email me a code","emailOtp.verifyTitle":"Enter the code","emailOtp.verifyDescription":"Type the 6-digit code we emailed you to finish verifying your address","emailOtp.sentTo":"We sent a 6-digit code to {email}","emailOtp.codeLabel":"Verification code","emailOtp.codeHelper":"Enter the 6-digit code from the email","emailOtp.verify":"Verify code","emailOtp.resend":"Resend code","emailOtp.resendIn":"Resend code in {seconds}s","emailOtp.expiresIn":"Code expires in {time}","emailOtp.expired":"That code has expired. Resend a new one","emailOtp.reason_otp_mismatch":"That code was incorrect. Check it and enter it again","emailOtp.reason_otp_expired":"That code has expired. Resend a new code to continue","emailOtp.reason_otp_send_failed":"We couldn't send the email. Try again later. If it keeps happening, contact the organization that asked you to verify.","emailOtp.reason_otp_rate_limited":"Too many codes were requested for this address. Try again later, or enter another address.","emailOtp.reason_email_invalid":"We can't send to this address. Check it or enter another one","emailOtp.reason_email_disposable":"Use a permanent email address, not a temporary one","emailOtp.changeEmail":"Change email","emailOtp.backToCode":"Back to code","emailOtp.reason_otp_resend_limit":"You can't get more codes. Enter the last code you received"};var X={"emailOtp.reason_otp_daily_cap_reached":"Nous ne pouvons pas vous envoyer de code par e-mail aujourd'hui. Choisissez une autre méthode si elle est proposée, ou réessayez plus tard.","emailOtp.reason_payment_method_required":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_spend_cap_reached":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_insufficient_balance":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_account_verification_required":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.sendTitle":"Vérifiez votre e-mail","emailOtp.sendDescription":"Nous vous enverrons par e-mail un code à usage unique pour confirmer que cette adresse vous appartient","emailOtp.prefilledNotice":"Nous enverrons un code de vérification à votre adresse e-mail enregistrée.","emailOtp.emailLabel":"Adresse e-mail","emailOtp.emailHelper":"Nous enverrons un code à usage unique à cette adresse","emailOtp.emailPlaceholder":"Votre adresse e-mail","emailOtp.emailInvalid":"Saisissez une adresse e-mail valide","emailOtp.send":"M'envoyer un code par e-mail","emailOtp.verifyTitle":"Saisissez le code","emailOtp.verifyDescription":"Saisissez le code à 6 chiffres que nous vous avons envoyé par e-mail pour finaliser la vérification de votre adresse","emailOtp.sentTo":"Nous avons envoyé un code à 6 chiffres à {email}","emailOtp.codeLabel":"Code de vérification","emailOtp.codeHelper":"Saisissez le code à 6 chiffres reçu par e-mail","emailOtp.verify":"Vérifier le code","emailOtp.resend":"Renvoyer le code","emailOtp.resendIn":"Renvoyer le code dans {seconds} s","emailOtp.expiresIn":"Le code expire dans {time}","emailOtp.expired":"Ce code a expiré. Renvoyez-en un nouveau","emailOtp.reason_otp_mismatch":"Ce code est incorrect. Vérifiez-le et saisissez-le à nouveau","emailOtp.reason_otp_expired":"Ce code a expiré. Renvoyez un nouveau code pour continuer","emailOtp.reason_otp_send_failed":"Nous n'avons pas pu envoyer l'e-mail. Réessayez plus tard. Si le problème continue, contactez l'organisation qui vous a demandé de vous vérifier.","emailOtp.reason_otp_rate_limited":"Trop de codes ont été demandés pour cette adresse. Réessayez plus tard ou saisissez une autre adresse.","emailOtp.reason_email_invalid":"Nous ne pouvons pas envoyer à cette adresse. Vérifiez-la ou saisissez-en une autre","emailOtp.reason_email_disposable":"Utilisez une adresse e-mail permanente, pas une adresse temporaire","emailOtp.changeEmail":"Changer d'adresse e-mail","emailOtp.backToCode":"Retour au code","emailOtp.reason_otp_resend_limit":"Vous ne pouvez plus demander de code. Saisissez le dernier code reçu"};import{Fragment as N,jsx as i,jsxs as s}from"react/jsx-runtime";var Oe={en:f,fr:X,ar:Q,es:f,pt:f,de:f},Z=r((e,l,O)=>{if(e===void 0)return 0;let _=Date.parse(e)-l;return Number.isFinite(_)?Math.min(O,Math.max(0,Math.ceil(_/1e3))):0},"secondsUntil"),_e=600,he=60,ye=r(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),ee=new Set(["otp_expired","otp_send_failed","otp_rate_limited","otp_resend_limit","email_invalid","email_disposable","otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","account_verification_required"]);function Ve({step:e,i18n:l,className:O,defaultEmail:_="",onError:ie}){let a=r((t,o)=>M(l.strings[t]??Oe[l.locale][t],o),"t"),[T,ae]=p(_),[h,x]=p(""),[n,w]=p(!1),[z,I]=p(null),[g,c]=p(!1),[R,te]=p(null),u=fe(null),y=e.phase==="verify",m=y&&!g,q=J(y),d=ue(),[oe,se]=B(e.reason==="otp_mismatch",e.attemptsRemaining,()=>x("")),V=y?e.codeExpiresAt??"sent":null;ce(()=>{V!==null&&(c(!1),u.current!==null&&!ee.has(e.reason??"")&&te(u.current),u.current=null)},[V]);let A=r(async t=>{w(!0),I(null);try{await t()}catch(o){I(o instanceof pe&&o.field==="email"?a("emailOtp.emailInvalid"):l.t(U(o,l.strings))),ie?.(o)}finally{w(!1)}},"run"),L=r(t=>{let o=e.needsEmail?t?R:T.trim():null;u.current=o,A(async()=>{try{await e.send(o!==null?{email:o}:{})}catch(me){throw u.current=null,me}})},"send"),D=r(t=>{A(()=>e.verify(t))},"submitCode"),ne=r(t=>{t.preventDefault(),m?D(h):L(!1)},"onSubmit"),S=Z(e.codeExpiresAt,q,_e),E=Z(e.resendAvailableAt,q,he),v=m&&e.codeExpiresAt!==void 0&&S===0,$=e.needsEmail&&!e.attemptsExhausted,P=y&&(e.codeExpiresAt===void 0||S>0),W=m&&$?()=>c(!0):g&&P?()=>c(!1):null;K(W===null?null:n?()=>{}:W);let[re,le]=a("emailOtp.sentTo").split("{email}"),H=e.context.simulation?.otpCode,de=e.reason==="otp_mismatch"?s(b,{tone:"danger",children:[i("span",{children:a("emailOtp.reason_otp_mismatch")}),i("span",{children:j(l,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&ee.has(e.reason)?i(b,{tone:"warning",children:i("span",{children:a(`emailOtp.reason_${e.reason}`)})}):null;return s("form",{className:`sekyro-step sekyro-otp${O?` ${O}`:""}`,"aria-labelledby":d,onSubmit:ne,noValidate:!0,children:[i(Y,{id:d,title:a(m?"emailOtp.verifyTitle":"emailOtp.sendTitle"),lead:m&&H!==void 0?i(G,{template:l.t("sandbox.otpHint"),code:H}):m?s(N,{children:[re,i("bdi",{dir:"ltr",className:"sekyro-mono",children:R??e.sentToMasked}),le]}):a("emailOtp.sendDescription")}),de,z!==null?i(b,{tone:"danger",children:i("span",{children:z})}):null,m?s(N,{children:[s("div",{className:"sekyro-field",children:[i("label",{className:"sekyro-label",htmlFor:`${d}-code`,children:a("emailOtp.codeLabel")}),i(F,{id:`${d}-code`,value:h,invalid:oe,onChange:t=>{t!==""&&se(),x(t),t.length===6&&h.length!==6&&!n&&!e.attemptsExhausted&&D(t)}}),i("span",{className:`sekyro-help sekyro-otp-expiry${v?" is-danger":""}`,"aria-hidden":!v||void 0,children:v?a("emailOtp.expired"):a("emailOtp.expiresIn",{time:ye(S)})})]}),i("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:v?a("emailOtp.expired"):""}),s(k,{children:[i(C,{type:"submit",full:!0,disabled:n||h.length!==6,"aria-busy":n||void 0,children:a("emailOtp.verify")}),s("div",{className:"sekyro-resend-row",children:[i("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:n||E>0,onClick:()=>L(!0),children:E>0?a("emailOtp.resendIn",{seconds:E}):a("emailOtp.resend")}),$?i("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:n,onClick:()=>c(!0),"data-testid":"sekyro-otp-change",children:a("emailOtp.changeEmail")}):null]})]})]}):s(N,{children:[e.needsEmail?s("div",{className:"sekyro-field",children:[i("label",{className:"sekyro-label",htmlFor:`${d}-email`,children:a("emailOtp.emailLabel")}),i("input",{id:`${d}-email`,className:"sekyro-input",type:"email",dir:"ltr",inputMode:"email",autoComplete:"email",autoCapitalize:"none",spellCheck:!1,placeholder:a("emailOtp.emailPlaceholder"),value:T,"aria-describedby":`${d}-email-help`,onChange:t=>ae(t.target.value)}),i("span",{id:`${d}-email-help`,className:"sekyro-help",children:a("emailOtp.emailHelper")})]}):i("p",{className:"sekyro-text-muted",children:a("emailOtp.prefilledNotice")}),s(k,{children:[i(C,{type:"submit",full:!0,disabled:n,"aria-busy":n||void 0,children:a("emailOtp.send")}),g&&P?i("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:n,onClick:()=>c(!1),"data-testid":"sekyro-otp-back-to-code",children:a("emailOtp.backToCode")}):null]})]})]})}r(Ve,"EmailOtpView");export{Ve as EmailOtpView};
|
|
2
|
+
import{a as B,b as F,c as J}from"./chunk-GUTF3SPK.js";import{a as U}from"./chunk-VRDPGOXM.js";import{d as M}from"./chunk-5V26KZGZ.js";import{b as Y,d as k,f as K,m as G,p as b,q as j}from"./chunk-HO5RMTZU.js";import"./chunk-VOIZLJLI.js";import{a as C}from"./chunk-3MCTR3RI.js";import{a as r}from"./chunk-2KED7D2Q.js";import{OtpInputError as pe}from"@sekyro/web";import{useEffect as ce,useId as ue,useRef as fe,useState as p}from"react";var Q={"emailOtp.reason_otp_daily_cap_reached":"لا يمكننا إرسال رمز إلى بريدك الإلكتروني اليوم. اختر طريقة أخرى للتحقق إن كانت متاحة، أو حاول مرة أخرى لاحقًا.","emailOtp.reason_payment_method_required":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_spend_cap_reached":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_insufficient_balance":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.reason_account_verification_required":"طريقة التحقق هذه غير متاحة حاليًا. اختر طريقة أخرى للتحقق إن كانت متاحة.","emailOtp.sendTitle":"تحقّق من بريدك الإلكتروني","emailOtp.sendDescription":"سنرسل إليك عبر البريد الإلكتروني رمزًا يُستخدم مرة واحدة لتأكيد أن هذا العنوان يخصّك","emailOtp.prefilledNotice":"سنرسل رمز تحقّق إلى بريدك الإلكتروني المسجّل.","emailOtp.emailLabel":"البريد الإلكتروني","emailOtp.emailHelper":"سنرسل رمزًا يُستخدم مرة واحدة إلى هذا العنوان","emailOtp.emailPlaceholder":"عنوان بريدك الإلكتروني","emailOtp.emailInvalid":"أدخل عنوان بريد إلكتروني صالحًا","emailOtp.send":"أرسل لي رمزًا عبر البريد الإلكتروني","emailOtp.verifyTitle":"أدخل الرمز","emailOtp.verifyDescription":"أدخل الرمز المكوّن من 6 أرقام الذي أرسلناه إلى بريدك الإلكتروني لإتمام التحقّق من عنوانك","emailOtp.sentTo":"أرسلنا رمزًا مكوّنًا من 6 أرقام إلى {email}","emailOtp.codeLabel":"رمز التحقّق","emailOtp.codeHelper":"أدخل الرمز المكوّن من 6 أرقام الوارد في الرسالة","emailOtp.verify":"تحقّق من الرمز","emailOtp.resend":"إعادة إرسال الرمز","emailOtp.resendIn":"إعادة إرسال الرمز خلال {seconds} ثانية","emailOtp.expiresIn":"ينتهي الرمز خلال {time}","emailOtp.expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد","emailOtp.reason_otp_mismatch":"الرمز غير صحيح. تحقّق منه وأعد إدخاله","emailOtp.reason_otp_expired":"انتهت صلاحية الرمز. أعد إرسال رمز جديد للمتابعة","emailOtp.reason_otp_send_failed":"تعذّر إرسال الرسالة. أعد المحاولة لاحقًا. إذا تكرر ذلك، فتواصل مع الجهة التي طلبت منك التحقق.","emailOtp.reason_otp_rate_limited":"طُلبت رموز كثيرة لهذا العنوان. أعد المحاولة لاحقًا أو أدخل عنوانًا آخر.","emailOtp.reason_email_invalid":"لا يمكننا الإرسال إلى هذا العنوان. تحقّق منه أو أدخل عنوانًا آخر","emailOtp.reason_email_disposable":"استخدم بريدًا إلكترونيًا دائمًا، وليس عنوانًا مؤقتًا","emailOtp.changeEmail":"تغيير البريد الإلكتروني","emailOtp.backToCode":"العودة إلى الرمز","emailOtp.reason_otp_resend_limit":"لا يمكنك طلب رموز أخرى. أدخل آخر رمز وصلك"};var f={"emailOtp.reason_otp_daily_cap_reached":"We can't email you a code today. Choose another way to verify if one is offered, or try again later.","emailOtp.reason_payment_method_required":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_spend_cap_reached":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_insufficient_balance":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.reason_account_verification_required":"This verification method is not available right now. Choose another way to verify if one is offered.","emailOtp.sendTitle":"Verify your email address","emailOtp.sendDescription":"We'll email you a one-time code to confirm this address is yours","emailOtp.prefilledNotice":"We'll send a verification code to your registered email address.","emailOtp.emailLabel":"Email address","emailOtp.emailHelper":"We'll send a one-time code to this address","emailOtp.emailPlaceholder":"Your email address","emailOtp.emailInvalid":"Enter a valid email address","emailOtp.send":"Email me a code","emailOtp.verifyTitle":"Enter the code","emailOtp.verifyDescription":"Type the 6-digit code we emailed you to finish verifying your address","emailOtp.sentTo":"We sent a 6-digit code to {email}","emailOtp.codeLabel":"Verification code","emailOtp.codeHelper":"Enter the 6-digit code from the email","emailOtp.verify":"Verify code","emailOtp.resend":"Resend code","emailOtp.resendIn":"Resend code in {seconds}s","emailOtp.expiresIn":"Code expires in {time}","emailOtp.expired":"That code has expired. Resend a new one","emailOtp.reason_otp_mismatch":"That code was incorrect. Check it and enter it again","emailOtp.reason_otp_expired":"That code has expired. Resend a new code to continue","emailOtp.reason_otp_send_failed":"We couldn't send the email. Try again later. If it keeps happening, contact the organization that asked you to verify.","emailOtp.reason_otp_rate_limited":"Too many codes were requested for this address. Try again later, or enter another address.","emailOtp.reason_email_invalid":"We can't send to this address. Check it or enter another one","emailOtp.reason_email_disposable":"Use a permanent email address, not a temporary one","emailOtp.changeEmail":"Change email","emailOtp.backToCode":"Back to code","emailOtp.reason_otp_resend_limit":"You can't get more codes. Enter the last code you received"};var X={"emailOtp.reason_otp_daily_cap_reached":"Nous ne pouvons pas vous envoyer de code par e-mail aujourd'hui. Choisissez une autre méthode si elle est proposée, ou réessayez plus tard.","emailOtp.reason_payment_method_required":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_spend_cap_reached":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_insufficient_balance":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.reason_account_verification_required":"Cette méthode de vérification n'est pas disponible pour le moment. Choisissez une autre méthode si elle est proposée.","emailOtp.sendTitle":"Vérifiez votre e-mail","emailOtp.sendDescription":"Nous vous enverrons par e-mail un code à usage unique pour confirmer que cette adresse vous appartient","emailOtp.prefilledNotice":"Nous enverrons un code de vérification à votre adresse e-mail enregistrée.","emailOtp.emailLabel":"Adresse e-mail","emailOtp.emailHelper":"Nous enverrons un code à usage unique à cette adresse","emailOtp.emailPlaceholder":"Votre adresse e-mail","emailOtp.emailInvalid":"Saisissez une adresse e-mail valide","emailOtp.send":"M'envoyer un code par e-mail","emailOtp.verifyTitle":"Saisissez le code","emailOtp.verifyDescription":"Saisissez le code à 6 chiffres que nous vous avons envoyé par e-mail pour finaliser la vérification de votre adresse","emailOtp.sentTo":"Nous avons envoyé un code à 6 chiffres à {email}","emailOtp.codeLabel":"Code de vérification","emailOtp.codeHelper":"Saisissez le code à 6 chiffres reçu par e-mail","emailOtp.verify":"Vérifier le code","emailOtp.resend":"Renvoyer le code","emailOtp.resendIn":"Renvoyer le code dans {seconds} s","emailOtp.expiresIn":"Le code expire dans {time}","emailOtp.expired":"Ce code a expiré. Renvoyez-en un nouveau","emailOtp.reason_otp_mismatch":"Ce code est incorrect. Vérifiez-le et saisissez-le à nouveau","emailOtp.reason_otp_expired":"Ce code a expiré. Renvoyez un nouveau code pour continuer","emailOtp.reason_otp_send_failed":"Nous n'avons pas pu envoyer l'e-mail. Réessayez plus tard. Si le problème continue, contactez l'organisation qui vous a demandé de vous vérifier.","emailOtp.reason_otp_rate_limited":"Trop de codes ont été demandés pour cette adresse. Réessayez plus tard ou saisissez une autre adresse.","emailOtp.reason_email_invalid":"Nous ne pouvons pas envoyer à cette adresse. Vérifiez-la ou saisissez-en une autre","emailOtp.reason_email_disposable":"Utilisez une adresse e-mail permanente, pas une adresse temporaire","emailOtp.changeEmail":"Changer d'adresse e-mail","emailOtp.backToCode":"Retour au code","emailOtp.reason_otp_resend_limit":"Vous ne pouvez plus demander de code. Saisissez le dernier code reçu"};import{Fragment as N,jsx as i,jsxs as s}from"react/jsx-runtime";var Oe={en:f,fr:X,ar:Q,es:f,pt:f,de:f},Z=r((e,l,O)=>{if(e===void 0)return 0;let _=Date.parse(e)-l;return Number.isFinite(_)?Math.min(O,Math.max(0,Math.ceil(_/1e3))):0},"secondsUntil"),_e=600,he=60,ye=r(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),ee=new Set(["otp_expired","otp_send_failed","otp_rate_limited","otp_resend_limit","email_invalid","email_disposable","otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","account_verification_required"]);function Ve({step:e,i18n:l,className:O,defaultEmail:_="",onError:ie}){let a=r((t,o)=>M(l.strings[t]??Oe[l.locale][t],o),"t"),[T,ae]=p(_),[h,x]=p(""),[n,w]=p(!1),[z,I]=p(null),[g,c]=p(!1),[R,te]=p(null),u=fe(null),y=e.phase==="verify",m=y&&!g,q=J(y),d=ue(),[oe,se]=B(e.reason==="otp_mismatch",e.attemptsRemaining,()=>x("")),V=y?e.codeExpiresAt??"sent":null;ce(()=>{V!==null&&(c(!1),u.current!==null&&!ee.has(e.reason??"")&&te(u.current),u.current=null)},[V]);let A=r(async t=>{w(!0),I(null);try{await t()}catch(o){I(o instanceof pe&&o.field==="email"?a("emailOtp.emailInvalid"):l.t(U(o,l.strings))),ie?.(o)}finally{w(!1)}},"run"),L=r(t=>{let o=e.needsEmail?t?R:T.trim():null;u.current=o,A(async()=>{try{await e.send(o!==null?{email:o}:{})}catch(me){throw u.current=null,me}})},"send"),D=r(t=>{A(()=>e.verify(t))},"submitCode"),ne=r(t=>{t.preventDefault(),m?D(h):L(!1)},"onSubmit"),S=Z(e.codeExpiresAt,q,_e),E=Z(e.resendAvailableAt,q,he),v=m&&e.codeExpiresAt!==void 0&&S===0,$=e.needsEmail&&!e.attemptsExhausted,P=y&&(e.codeExpiresAt===void 0||S>0),W=m&&$?()=>c(!0):g&&P?()=>c(!1):null;K(W===null?null:n?()=>{}:W);let[re,le]=a("emailOtp.sentTo").split("{email}"),H=e.context.simulation?.otpCode,de=e.reason==="otp_mismatch"?s(b,{tone:"danger",children:[i("span",{children:a("emailOtp.reason_otp_mismatch")}),i("span",{children:j(l,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&ee.has(e.reason)?i(b,{tone:"warning",children:i("span",{children:a(`emailOtp.reason_${e.reason}`)})}):null;return s("form",{className:`sekyro-step sekyro-otp${O?` ${O}`:""}`,"aria-labelledby":d,onSubmit:ne,noValidate:!0,children:[i(Y,{id:d,title:a(m?"emailOtp.verifyTitle":"emailOtp.sendTitle"),lead:m&&H!==void 0?i(G,{template:l.t("sandbox.otpHint"),code:H}):m?s(N,{children:[re,i("bdi",{dir:"ltr",className:"sekyro-mono",children:R??e.sentToMasked}),le]}):a("emailOtp.sendDescription")}),de,z!==null?i(b,{tone:"danger",children:i("span",{children:z})}):null,m?s(N,{children:[s("div",{className:"sekyro-field",children:[i("label",{className:"sekyro-label",htmlFor:`${d}-code`,children:a("emailOtp.codeLabel")}),i(F,{id:`${d}-code`,value:h,invalid:oe,onChange:t=>{t!==""&&se(),x(t),t.length===6&&h.length!==6&&!n&&!e.attemptsExhausted&&D(t)}}),i("span",{className:`sekyro-help sekyro-otp-expiry${v?" is-danger":""}`,"aria-hidden":!v||void 0,children:v?a("emailOtp.expired"):a("emailOtp.expiresIn",{time:ye(S)})})]}),i("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:v?a("emailOtp.expired"):""}),s(k,{children:[i(C,{type:"submit",full:!0,disabled:n||h.length!==6,"aria-busy":n||void 0,children:a("emailOtp.verify")}),s("div",{className:"sekyro-resend-row",children:[i("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:n||E>0,onClick:()=>L(!0),children:E>0?a("emailOtp.resendIn",{seconds:E}):a("emailOtp.resend")}),$?i("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:n,onClick:()=>c(!0),"data-testid":"sekyro-otp-change",children:a("emailOtp.changeEmail")}):null]})]})]}):s(N,{children:[e.needsEmail?s("div",{className:"sekyro-field",children:[i("label",{className:"sekyro-label",htmlFor:`${d}-email`,children:a("emailOtp.emailLabel")}),i("input",{id:`${d}-email`,className:"sekyro-input",type:"email",dir:"ltr",inputMode:"email",autoComplete:"email",autoCapitalize:"none",spellCheck:!1,placeholder:a("emailOtp.emailPlaceholder"),value:T,"aria-describedby":`${d}-email-help`,onChange:t=>ae(t.target.value)}),i("span",{id:`${d}-email-help`,className:"sekyro-help",children:a("emailOtp.emailHelper")})]}):i("p",{className:"sekyro-text-muted",children:a("emailOtp.prefilledNotice")}),s(k,{children:[i(C,{type:"submit",full:!0,disabled:n,"aria-busy":n||void 0,children:a("emailOtp.send")}),g&&P?i("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:n,onClick:()=>c(!1),"data-testid":"sekyro-otp-back-to-code",children:a("emailOtp.backToCode")}):null]})]})]})}r(Ve,"EmailOtpView");export{Ve as EmailOtpView};
|