@sekyro/react 0.1.0-rc.16 → 0.1.0-rc.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/{chunk-IUQTOOBI.js → chunk-3GCHNE7R.js} +1 -1
  3. package/dist/chunk-3H6KQ6BP.js +2 -0
  4. package/dist/chunk-455FWUKU.js +2 -0
  5. package/dist/chunk-55NNQK5P.js +2 -0
  6. package/dist/chunk-AGIBFSCL.js +2 -0
  7. package/dist/chunk-GUTF3SPK.js +2 -0
  8. package/dist/chunk-IAJAM4I6.js +2 -0
  9. package/dist/chunk-JTDARDD6.js +2 -0
  10. package/dist/chunk-T7C7Q4AN.js +2 -0
  11. package/dist/chunk-VBIVDLBE.js +2 -0
  12. package/dist/chunk-W3GLUWQ5.js +2 -0
  13. package/dist/chunk-ZFGI5LKP.js +2 -0
  14. package/dist/{chunk-IT66PZDO.js → chunk-ZZIBCKKC.js} +1 -1
  15. package/dist/document-capture-view-ZNZQMJBX.js +2 -0
  16. package/dist/eid-view-VYUU65A3.js +2 -0
  17. package/dist/email-otp-view-DUHRTUGD.js +2 -0
  18. package/dist/flow-views-VJPCIWEJ.js +2 -0
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.js +1 -1
  21. package/dist/overlay-de-TSLNGALH.js +2 -0
  22. package/dist/overlay-es-44JQULK7.js +2 -0
  23. package/dist/overlay-pt-D5TKF7PI.js +2 -0
  24. package/dist/portrait-capture-view-XUWOHJTS.js +2 -0
  25. package/dist/portrait-review-view-SJXQZTAK.js +2 -0
  26. package/dist/verification/index.cjs +1 -1
  27. package/dist/verification/index.d.cts +69 -4
  28. package/dist/verification/index.d.ts +69 -4
  29. package/dist/verification/index.js +1 -1
  30. package/dist/verification.css +215 -72
  31. package/package.json +2 -2
  32. package/sbom.cdx.json +4 -4
  33. package/dist/chunk-5TOBG5R2.js +0 -2
  34. package/dist/chunk-EZ5TVL6P.js +0 -2
  35. package/dist/chunk-FNBG3472.js +0 -2
  36. package/dist/chunk-GGTRTUW3.js +0 -2
  37. package/dist/chunk-H2KIOYQU.js +0 -2
  38. package/dist/chunk-KHBM3P4C.js +0 -2
  39. package/dist/chunk-NXVTUTKS.js +0 -2
  40. package/dist/chunk-OUG465K6.js +0 -2
  41. package/dist/chunk-PYAJMHZH.js +0 -2
  42. package/dist/chunk-XDPCJAYO.js +0 -2
  43. package/dist/chunk-YY76AMUA.js +0 -2
  44. package/dist/document-capture-view-PUGWMQAP.js +0 -2
  45. package/dist/eid-view-IMKKBPQV.js +0 -2
  46. package/dist/email-otp-view-YLMRRLC3.js +0 -2
  47. package/dist/flow-views-HFQJ45NS.js +0 -2
  48. package/dist/overlay-de-ZICWH4MW.js +0 -2
  49. package/dist/overlay-es-2ETCIRV4.js +0 -2
  50. package/dist/overlay-pt-2DX57E2U.js +0 -2
  51. package/dist/portrait-capture-view-M5OLPMMO.js +0 -2
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as an,c as ln,d as un}from"./chunk-AGIBFSCL.js";import{b as cn,c as Ze}from"./chunk-7MMT5M4E.js";import{a as rn,b as on,c as sn,d as O}from"./chunk-VBIVDLBE.js";import{a as B,k as Qt,l as Jt,m as Xt,n as en,o as tn,p as nn,q as $,r as We}from"./chunk-3GCHNE7R.js";import{a as r}from"./chunk-2KED7D2Q.js";import{useEffect as dn,useId as kr,useRef as Cr,useState as br}from"react";import{jsx as Z,jsxs as Qe}from"react/jsx-runtime";var Sr=220;function Je({title:e,description:t,options:s,busy:n,error:o,focus:c,testId:a,look:p="cards",marked:g,onChoose:d}){let M=kr(),N=We(),[b,l]=br(null),v=Cr(null);dn(()=>{o!==null&&l(null)},[o]),dn(()=>()=>{v.current!==null&&clearTimeout(v.current)},[]);let k=r(u=>{n||b!==null||(l(u),v.current=setTimeout(()=>{v.current=null,l(null),d(u)},Sr))},"choose");return Qe("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":M,"data-testid":a,children:[Qe("div",{className:p==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[Z("h2",{id:M,ref:c?N:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?Z("p",{className:"sekyro-text-muted",children:t}):null]}),o!==null?Z($,{tone:"danger",children:Z("span",{children:o})}):null,p==="buttons"?Z("div",{className:"sekyro-stack sekyro-stack--3",children:s.map((u,w)=>Z(B,{kind:w===0?"primary":"ghost",full:!0,disabled:n,"aria-busy":n||void 0,onClick:()=>d(u.id),children:u.label},u.id))}):Z("div",{className:"sekyro-choices",children:s.map(u=>Qe("button",{type:"button",className:"sekyro-card","aria-pressed":(b??g)===u.id,"aria-busy":n||void 0,disabled:n||b!==null&&b!==u.id,onClick:()=>k(u.id),children:[u.glyph!==void 0?Z("span",{className:"sekyro-card__tile",children:u.glyph}):null,Qe("span",{className:"sekyro-card__body",children:[Z("span",{className:"sekyro-card__title",children:u.label}),u.sub!==void 0?Z("span",{className:"sekyro-card__sub",children:u.sub}):null]}),Z("span",{className:"sekyro-radio","aria-hidden":"true"})]},u.id))})]})}r(Je,"ChoiceScreen");import{useId as Vr}from"react";import{Fragment as Rr,jsx as L,jsxs as J}from"react/jsx-runtime";function X({className:e,children:t}){return L("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}r(X,"Svg");var yt="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function pn(e){return J(X,{...e,children:[L("circle",{cx:"12",cy:"12",r:"4"}),L("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}r(pn,"SunIcon");function fn(e){return J(X,{...e,children:[L("circle",{cx:"12",cy:"12",r:"9"}),L("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}r(fn,"FaceUncoveredIcon");function mn(e){return J(X,{...e,children:[L("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),L("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),L("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}r(mn,"PhoneEyeLevelIcon");function yn(e){return J(X,{...e,children:[L("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),L("circle",{cx:"12",cy:"12",r:"2.8"})]})}r(yn,"LookStraightIcon");function gn(e){return J(X,{...e,children:[L("path",{d:yt}),L("path",{d:"M9 13l2 2 4-4"})]})}r(gn,"CameraCheckIcon");function hn(e){return J(X,{...e,children:[L("path",{d:yt}),L("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}r(hn,"CameraAskIcon");function vn(e){return J(X,{...e,children:[L("path",{d:yt}),L("path",{d:"M3 3l18 18"})]})}r(vn,"CameraBlockedIcon");function be({off:e,className:t}){return J(X,{className:t,children:[L("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?L("path",{d:"M4 4l16 16"}):J(Rr,{children:[L("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),L("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}r(be,"SpeakerIcon");function kn(e){return L(X,{...e,children:L("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}r(kn,"CheckIcon");function Cn(e){return J(X,{className:e.className??"sekyro-spinner",children:[L("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),L("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}r(Cn,"SpinnerIcon");import{jsx as le,jsxs as bn}from"react/jsx-runtime";var Xe=["light","uncover","eyeLevel","straight"],Mr={light:{key:"capture.tips.light",icon:r(()=>le(pn,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:r(()=>le(fn,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:r(()=>le(mn,{}),"icon")},straight:{key:"capture.tips.straight",icon:r(()=>le(yn,{}),"icon")}};function Sn({tips:e}){let t=O(),s=Vr();return e.length===0?null:bn("section",{className:"sekyro-tips","aria-labelledby":s,"data-testid":"sekyro-tips",children:[le("p",{className:"sekyro-tips__title",id:s,children:t("capture.tips.title")}),le("ul",{className:"sekyro-tips__list",children:e.map(n=>{let o=typeof n=="string"?Mr[n]:void 0,c=typeof n=="string"?n:n.id,a=o!==void 0?o.icon():typeof n=="string"?void 0:n.icon,p=o!==void 0?t(o.key):typeof n=="string"?n:n.text;return bn("li",{className:"sekyro-tips__item",children:[a!=null?le("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:a}):null,le("span",{children:p})]},c)})})]})}r(Sn,"TipList");var et=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","capture.tips.summary"];function fe(e){return e!==null&&et.includes(e)}r(fe,"isVoiceKey");import{useCallback as te,useEffect as me,useLayoutEffect as Ir,useMemo as xr,useRef as Re,useState as Te}from"react";var Lr=r((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function Se(e,t,s){let n;try{if(typeof e=="function")n=e(t,s);else{let o=e[s];n=o!=null&&Lr(o,t)?o[t]:null}}catch{return null}return typeof n=="string"&&n!==""?n:null}r(Se,"resolveClip");var wr="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Mn={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ee(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}r(ee,"synth");function Nr(){return ee()!==null&&typeof SpeechSynthesisUtterance=="function"}r(Nr,"speechAvailable");function Rn(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}r(Rn,"baseLang");function Ln(e,t){let s=r(o=>o.replace(/_/g,"-").toLowerCase(),"norm"),n=Rn(t);return e.find(o=>s(o.lang)===s(t))??e.find(o=>Rn(o.lang)===n)}r(Ln,"pickVoice");function wn(e){if(!Nr())return!1;let t=[];try{t=ee()?.getVoices()??[]}catch{return!0}return t.length===0||Ln(t,e)!==void 0}r(wn,"speechUsable");function Nn(e){let t=ee();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}r(Nn,"subscribeVoices");function Ae(e){try{let t=typeof location<"u"?location.href:"http://localhost/",s=new URL(e,t);return`clip:${s.origin}${s.pathname}`}catch{return`clip:${e}`}}r(Ae,"clipIdentity");function Vn(e){e.pause(),e.removeAttribute("src"),e.load()}r(Vn,"release");function In(){let e=null,t=null,s=0,n=null,o=[],c=new Map,a=r(()=>{o=ee()?.getVoices()??[]},"loadVoices"),p=!1,g=r(()=>{let l=ee();p||l===null||(p=!0,a(),l.addEventListener?.("voiceschanged",a))},"bindVoices"),d=r(()=>(e??(e=new Audio),e),"element"),M=r((l,v,k)=>{let u=ee();if(u!==null&&l!==""&&typeof SpeechSynthesisUtterance=="function"){g();let w=Ln(o,v);if(o.length===0||w!==void 0){u.cancel();let h=new SpeechSynthesisUtterance(l);h.lang=v,w!==void 0&&(h.voice=w),h.rate=.95,k!==void 0&&(h.onend=h.onerror=k),u.speak(h);return}}k?.()},"speak"),N=r(()=>{s+=1,n=null,e!==null&&(e.pause(),e.currentTime=0),ee()?.cancel()},"stop"),b=r(l=>{for(let v of l){let k=Ae(v);if(c.has(k))continue;let u=new Audio;u.preload="auto",u.src=v,c.set(k,u)}},"warmClips");return{say(l){let v=l.url!==null?Ae(l.url):`tts:${l.lang}:${l.text}`;if(v===n)return;n=v,s+=1;let k=s,u=l.onEnd,w=u!==void 0?()=>{k===s&&u()}:void 0;if(ee()?.cancel(),l.url!==null){let h=d();h.pause(),h.muted=!1,h.src=l.url,h.currentTime=0,h.onended=w??null,h.play()?.catch(R=>{k===s&&R?.name!=="AbortError"&&(l.speech?M(l.text,l.lang,w):w?.())});return}l.speech?M(l.text,l.lang,w):w?.()},unlock({lang:l,speech:v,prefetch:k}){let u=d();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let R=Uint8Array.from(atob(wr),P=>P.charCodeAt(0));t=URL.createObjectURL(new Blob([R],{type:"audio/wav"}))}let w=u.paused===!1&&t!==null&&u.src!==t;t!==null&&!w&&(u.muted=!0,u.onended=null,u.src=t,u.play()?.catch(()=>{}));let h=ee();if(v&&h!==null&&typeof SpeechSynthesisUtterance=="function"){g();let R=new SpeechSynthesisUtterance(" ");R.volume=0,R.lang=l,h.speak(R)}b(k??[])},prefetch:b,stop:N,dispose(){N(),p&&ee()?.removeEventListener?.("voiceschanged",a),p=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&Vn(e),e=null;for(let l of c.values())Vn(l);c.clear()}}}r(In,"createVoicePlayer");var xn="sekyro.voiceGuidance";function _n(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}r(_n,"readVoicePreference");function En(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}r(En,"writeVoicePreference");var Oe="capture.tips.summary",_r=typeof window<"u"?Ir:me,Er=Object.freeze({});function gt(e,t){let s=new Set,n=[];for(let o of et){let c=o===Oe?null:Se(e,o,t);c===null||s.has(Ae(c))||(s.add(Ae(c)),n.push(c))}return n}r(gt,"resolvedClipUrls");function ht({locale:e,defaultClips:t,options:s}){let n=s===!1,o=n?{}:s??{},c=o.storageKey===void 0?xn:o.storageKey,[a,p]=Te(o.defaultEnabled??!0),g=Re(a),[d,M]=Te(!1),[N,b]=Te("none"),[l,v]=Te(!1),k=Re(!1),[u,w]=Te(0),h=Re(null),R=te(()=>(h.current??(h.current=In()),h.current),[]),P=Mn[e],K=o.speechFallback,m=K===void 0||K===!0?!0:K===!1?!1:K.includes(e),q=o.clips??t??Er,F=Re(!1),j=Re(q);_r(()=>{j.current=q,g.current=a}),me(()=>{if(n||c===null)return;let C=_n(c);C!==null&&(g.current=C,p(C))},[n,c]),me(()=>{if(!(n||!m))return Nn(()=>w(C=>C+1))},[n,m]);let i=o.clips;me(()=>{if(n)return;let C=m&&wn(P);M(gt(q,e).length>0||C),b(i!==void 0&&Se(i,Oe,e)!==null?"partner":Se(q,Oe,e)!==null||C?"default":"none")},[n,q,i,e,m,P,u]),me(()=>{if(n||!a||!F.current)return;let C=gt(q,e);C.length>0&&R().prefetch(C)},[n,a,q,e,R]),me(()=>()=>{h.current?.dispose(),h.current=null,F.current=!1},[]);let A=te(C=>{n||(F.current=!0,R().unlock({lang:P,speech:m,...C?{prefetch:gt(j.current,e)}:{}}))},[n,R,P,m,e]),I=te(()=>A(g.current),[A]),x=te(()=>{k.current=!1,v(!1)},[]),_=te(()=>{x(),h.current?.stop()},[x]),se=te(()=>{k.current&&_()},[_]),ue=te((C,W)=>{if(n)return;if(k.current){_();return}let H=R();H.stop(),k.current=!0,v(!0);let ne=W?.clip===!1?null:Se(j.current,Oe,e);H.say({url:ne,text:C,lang:P,speech:m,onEnd:x})},[n,_,R,e,P,m,x]),T=te(C=>{n||(C?A(!0):_(),c!==null&&En(c,C),g.current=C,p(C))},[n,A,_,c]),E=te(()=>T(!g.current),[T]),de=te((C,W)=>{if(n||!a)return;k.current&&x();let H=Se(j.current,C,e);R().say({url:H,text:W,lang:P,speech:m})},[n,a,e,R,P,m,x]);return xr(()=>({supported:!n&&d,enabled:!n&&a,setEnabled:T,toggle:E,unlock:I,speakKey:de,stop:_,summary:n?"none":N,summaryPlaying:l,toggleSummary:ue,stopSummary:se}),[n,d,a,T,E,I,de,_,N,l,ue,se])}r(ht,"useVoiceGuidance");function vt(e,t,s,n){let{speakKey:o,stop:c,enabled:a}=e,p=Re(!1);me(()=>{if(!n||!a){p.current&&c(),p.current=!1;return}p.current=!0,fe(t)&&t!==Oe&&s!==""&&o(t,s)},[n,a,t,s,o,c])}r(vt,"useSpeakGuidance");import{isValidElement as lo,useCallback as it,useContext as uo,useEffect as oe,useMemo as we,useRef as he,useState as cr}from"react";import{useEffect as Pr,useRef as Ar}from"react";import{jsx as Ve,jsxs as kt}from"react/jsx-runtime";function Pn({showCoaching:e,attemptsText:t,showRetake:s,onRetake:n}){let o=O(),c=Ar(null);return Pr(()=>{s&&c.current?.focus()},[s]),!e&&!s?null:kt("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?kt("div",{className:"sekyro-stack sekyro-stack--1",children:[Ve("p",{className:"sekyro-text-body",children:o("capture.retryCoaching.title")}),kt("ul",{className:"sekyro-coaching",children:[Ve("li",{children:o("capture.retryCoaching.light")}),Ve("li",{children:o("capture.retryCoaching.eyeLevel")}),Ve("li",{children:o("capture.retryCoaching.head")})]}),t!==null?Ve("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:t}):null]}):null,s?Ve(B,{ref:c,className:"sekyro-btn--start",onClick:n,children:o("capture.recordAgain")}):null]})}r(Pn,"CapturedPanel");function tt(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}r(tt,"isDevBuild");import{createContext as An}from"react";var Tn=An(null),On=An(null);import{useContext as Tr,useId as Or,useState as Kr}from"react";import{jsx as ye,jsxs as nt}from"react/jsx-runtime";var Kn=["self","assisted"];function Fn({onChoose:e,legend:t,help:s}){let n=O(),o=Or(),c=`${o}-help`,[a,p]=Kr("self"),g=Tr(On);return g!==null?ye(Je,{title:t??n("capture.modePicker.legend"),description:s??n("capture.modePicker.help"),options:Kn.map(d=>({id:d,label:n(`capture.modePicker.${d}`),...g[d]!==void 0?{glyph:g[d]}:{}})),busy:!1,error:null,focus:!0,testId:"sekyro-capture-mode",onChoose:d=>e(d)}):nt("form",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-capture-mode",onSubmit:d=>{d.preventDefault(),e(a)},children:[nt("fieldset",{className:"sekyro-segmented","aria-describedby":c,children:[ye("legend",{className:"sekyro-segmented__legend",children:t??n("capture.modePicker.legend")}),ye("div",{className:"sekyro-segmented__options",children:Kn.map(d=>nt("label",{className:"sekyro-segmented__option",children:[ye("input",{type:"radio",className:"sekyro-segmented__input",name:o,value:d,checked:a===d,onChange:()=>p(d)}),nt("span",{className:"sekyro-segmented__face",children:[ye("span",{className:"sekyro-segmented__dot","aria-hidden":"true"}),n(`capture.modePicker.${d}`)]})]},d))})]}),ye("p",{id:c,className:"sekyro-text-muted",children:s??n("capture.modePicker.help")}),ye(B,{type:"submit",full:!0,children:n("capture.modePicker.continue")})]})}r(Fn,"CaptureModePicker");import{useCallback as qn,useEffect as Dn,useRef as Me}from"react";import{useId as Fr}from"react";import{jsx as rt,jsxs as Ct}from"react/jsx-runtime";var Br=["user","environment"];function Bn({value:e,onChange:t}){let s=O(),n=Fr();return Ct("fieldset",{className:"sekyro-segmented","data-testid":"sekyro-facing",children:[rt("legend",{className:"sekyro-segmented__legend",children:s("capture.cameraLabel")}),rt("div",{className:"sekyro-segmented__options",children:Br.map(o=>Ct("label",{className:"sekyro-segmented__option",children:[rt("input",{type:"radio",className:"sekyro-segmented__input",name:n,value:o,checked:e===o,onChange:()=>t(o)}),Ct("span",{className:"sekyro-segmented__face",children:[rt("span",{className:"sekyro-segmented__dot","aria-hidden":"true"}),s(`capture.facing.${o}`)]})]},o))})]})}r(Bn,"FacingPicker");import{useEffect as Hr,useState as Ur}from"react";import{jsx as Ke,jsxs as Gr}from"react/jsx-runtime";function Hn({state:e}){let t=O(),[s,n]=Ur(!1);Hr(()=>{e!=="unknown"&&n(!0)},[e]);let o=e==="granted"?Ke(gn,{}):e==="denied"?Ke(vn,{}):Ke(hn,{});return Gr("div",{role:s?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[Ke("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:o}),Ke("span",{children:t(`capture.permission.${e}`)})]})}r(Hn,"PermissionRow");import{jsx as ot,jsxs as Un}from"react/jsx-runtime";function Gn({voice:e}){let t=O();if(!e.supported)return null;let s=e.enabled;return Un("button",{type:"button",role:"switch","aria-checked":s,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:()=>e.toggle(),children:[Un("span",{className:"sekyro-switch__label",children:[ot(be,{off:!s}),t("capture.voiceGuidance")]}),ot("span",{className:"sekyro-switch__track","aria-hidden":"true",children:ot("span",{className:"sekyro-switch__thumb",children:s?ot(kn,{className:"sekyro-switch__check"}):null})})]})}r(Gn,"VoiceSwitch");import{Fragment as Dr,jsx as G,jsxs as Le}from"react/jsx-runtime";function jn({assets:e,onRetryAssets:t,permission:s,captureMode:n="self",canChooseFacing:o,facing:c,onFacingChange:a,voice:p,tips:g,summary:d,startLabel:M,startDisabled:N,onStart:b}){let l=O(),v=Me(d?.stop);v.current=d?.stop,Dn(()=>()=>v.current?.(),[]);let k=Me(null),u=Me(null),w=Me(null),h=Me(e),R=Me(!1);Dn(()=>{let i=h.current;if(h.current=e,i===e)return;let A=R.current;e!=="loading"&&(R.current=!1),qr(k.current)&&(e==="failed"?w.current?.focus():A&&u.current?.focus())},[e]);let P=qn(()=>{R.current=!0,t()},[t]),K=e==="loading",m=K||N,q=qn(()=>{m||(v.current?.(),b())},[m,b]),F;e==="failed"?F=Le($,{tone:"danger",testId:"sekyro-assets-error",children:[G("p",{className:"sekyro-text-body",children:l("fcv2.err.models")}),G(B,{kind:"ghost",ref:w,className:"sekyro-btn--start",onClick:P,"data-testid":"sekyro-assets-retry",children:l("common.retry")})]}):F=Le("div",{className:"sekyro-stack sekyro-stack--1",children:[G(B,{ref:u,full:!0,"data-testid":"sekyro-start","aria-disabled":m?"true":void 0,"aria-busy":K?"true":void 0,onClick:q,children:K?Le(Dr,{children:[G(Cn,{}),l("capture.preparing.title")]}):M??l("capture.start")}),K?G("p",{className:"sekyro-text-muted",children:l("capture.preparing.hint")}):null]});let j=n==="assisted";return Le("div",{ref:k,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[j?Le("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[G("h2",{className:"sekyro-text-body",children:l("capture.assisted.title")}),G("p",{className:"sekyro-text-muted",children:l("capture.assisted.lead")})]}):null,g!==!1?G(Sn,{tips:g}):null,d!==void 0?Le(B,{kind:"ghost",className:"sekyro-btn--start",onClick:d.toggle,"data-testid":"sekyro-tips-listen",children:[G(be,{off:!1}),l(d.playing?"capture.tips.stop":"capture.tips.listen")]}):null,G(Hn,{state:s}),j&&o?G(Bn,{value:c,onChange:a}):null,G(Gn,{voice:p}),G("p",{className:"sekyro-text-muted",children:l("capture.securityNote")}),F,G("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?l("capture.preparing.title"):e==="ready"?l("capture.ready"):""})]})}r(jn,"PreCaptureScreen");function qr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}r(qr,"focusIsOurs");import{useCallback as jr,useEffect as bt,useState as St}from"react";function $n(e){return Yn(e,"mobileRequired")}r($n,"useMobileRequired");function zn(e){return Yn(e,"returning").required}r(zn,"useReturning");function Yn(e,t){let[s,n]=St({required:!1,settled:e===void 0});return bt(()=>{let o=e?.[t];if(e===void 0||typeof o!="function"){n({required:!1,settled:!0});return}let c=!0;return n({required:!1,settled:!1}),Promise.resolve().then(()=>o.call(e)).then(a=>{c&&n({required:a===!0,settled:!0})},()=>{c&&n({required:!1,settled:!0})}),()=>{c=!1}},[e,t]),s}r(Yn,"useFlag");function Zn(e){let t=r(()=>e?.captureChoice??null,"initialChoice"),[s,n]=St(()=>({session:"self",choice:t(),settled:e===void 0}));bt(()=>{let a=e?.captureMode,p=e?.captureChoice??null;if(e===void 0||typeof a!="function"){n({session:"self",choice:p,settled:!0});return}let g=!0;return n({session:"self",choice:p,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(d=>{let M=e.captureChoice??null;g&&n({session:M!==null&&d===M?"choice":d==="assisted"||d==="choice"?d:"self",choice:M,settled:!0})},()=>{g&&n({session:"self",choice:null,settled:!0})}),()=>{g=!1}},[e]);let o=jr(a=>{e?.chooseCaptureMode?.(a),n(p=>({...p,choice:a}))},[e]);return{mode:s.session==="choice"?s.choice??"self":s.session==="assisted"?"assisted":"self",session:s.session,choice:s.choice,settled:s.settled,choose:o}}r(Zn,"useCaptureMode");function Wn(e){let[t,s]=St(!1);return bt(()=>{if(s(!1),e===void 0)return;let n=e.on("busy",()=>s(!0)),o=e.on("result",()=>s(!1));return()=>{n(),o()}},[e]),t}r(Wn,"useBusy");import{getLivenessAssetsStatus as $r,preloadLivenessAssets as zr,subscribeLivenessAssets as Yr}from"@sekyro/web";import{useCallback as Rt,useEffect as Qn,useRef as Jn,useState as Zr,useSyncExternalStore as Wr}from"react";var Qr=r(()=>"idle","serverSnapshot");function Xn(e){return zr(e!==void 0?{assetBaseUrl:e}:{})}r(Xn,"preload");function er(e,t=!0){let s=Wr(Rt(N=>Yr(N,e),[e]),()=>$r(e),Qr),[n,o]=Zr(null),c=Jn(!1),a=Rt(()=>{Xn(e).then(N=>{c.current&&N==="idle"&&o({base:e})})},[e]);Qn(()=>(c.current=!0,a(),()=>{c.current=!1}),[a]);let p=Jn(null);Qn(()=>{if(s!=="idle"){p.current={base:e};return}!t||p.current===null||p.current.base!==e||(p.current=null,a())},[s,e,a,t]);let g=Rt(()=>{Xn(e)},[e]);return{gate:n!==null&&n.base===e&&s==="idle"||s==="ready"?"ready":s==="failed"?"failed":"loading",retry:g}}r(er,"useLivenessAssets");import{createLivenessCapture as Jr}from"@sekyro/web";import{useCallback as Vt,useEffect as Xr,useRef as ge,useState as z}from"react";var tr={progress:0,hint:null,faceDetected:!1};function nr(e){let{videoRef:t,assetBaseUrl:s}=e,o=ge(e.verification).current,c=ge(!1);e.verification!==o&&!c.current&&tt()&&(c.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let a=ge(null),[p,g]=z("idle"),[d,M]=z(tr),[N,b]=z(!1),[l,v]=z(!1),[k,u]=z(null),[w,h]=z(!1),[R,P]=z(null),[K,m]=z(null),[q,F]=z(null),[j,i]=z(null),[A,I]=z(null),x=ge(null),_=ge("idle"),se=ge(-1),[ue,T]=z(0),E=ge(e);E.current=e,Xr(()=>{let H=t.current;if(H===null)return;let ne={video:H,...s!==void 0?{assetBaseUrl:s}:{}},S=o!==void 0?o.liveness(ne):Jr(ne);a.current=S;let Fe=r(()=>I(S.facingMode??null),"readFacing");Fe();let Ie=[S.on("state",f=>{f==="starting"?(_.current!=="starting"&&(se.current+=1,T(Math.max(0,se.current))),m(null),F(null),M(tr),v(!1),b(!1),u(null),P(null),x.current=null):f==="gating"&&_.current==="recording"&&(v(!1),b(!1),u(null),x.current=null),_.current=f,Fe(),g(f),E.current.onStateChange?.(f)}),S.on("gate",f=>{let ie=x.current;x.current=f.progress,b(ie!==null&&f.progress<ie-.001&&f.progress>0&&f.progress<1),f.progress>=1&&v(!0),M(f)}),S.on("frozen",({previewDataUrl:f})=>u(f)),S.on("profile",({animations:f})=>h(f==="reduced")),S.on("ramp",({colour:f})=>P(f)),S.on("captured",f=>{m(f),i(null),E.current.onCaptured?.(f)}),S.on("error",f=>{F(f);let ie=o?.reportCaptureIssue;ie!==void 0&&Ze(Be=>ie.call(o,Be),cn("liveness",f,Math.max(0,se.current))),E.current.onError?.(f)}),o?.on("result",f=>{i(f),E.current.onResult?.(f)})];return()=>{for(let f of Ie)f?.();a.current=null,S.destroy()}},[o,t,s]);let de=Vt(H=>{a.current?.start(H)},[]),C=Vt(()=>{a.current?.retry()},[]),W=Vt(()=>{let H=a.current,ne=H?.switchCamera()===!0;return ne&&(I(H?.facingMode??null),v(!1),b(!1),u(null),x.current=null),ne},[]);return{state:p,gate:d,draining:N,gateLocked:l,frozenPreview:k,reduceMotion:w,rampColour:R,artifacts:K,error:q,result:j,facingMode:A,start:de,retry:C,switchCamera:W,attempt:ue}}r(nr,"useLivenessHandle");import{useCallback as eo,useEffect as to,useState as st}from"react";var no=new Set(["national_number"]);function rr(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(s=>no.has(s));return t.length>0?{...e,options:t}:null}r(rr,"pending");function or(e){let[t,s]=st(null),[n,o]=st(e===void 0),[c,a]=st(!1),[p,g]=st(!1);to(()=>{if(s(null),e===void 0){o(!0);return}let b=!0,l=e.methodChoice;typeof l=="function"?(o(!1),Promise.resolve().then(()=>l.call(e)).then(k=>{b&&s(rr(k))},()=>{}).finally(()=>{b&&o(!0)})):o(!0);let v=e.on("method",k=>s(rr(k)));return()=>{b=!1,v()}},[e]);let d=eo(async b=>{if(e===void 0)return!1;a(!0),g(!1);try{return await e.selectMethod(b),s(null),!0}catch{return g(!0),!1}finally{a(!1)}},[e]),M=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:M==="national_number"&&!p?M:null,settled:n,busy:c,failed:p,select:d}}r(or,"useMethodChoice");import{useEffect as ro,useMemo as oo,useState as so}from"react";var io=["ar","fr","en"];function ao(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}r(ao,"isClipUrl");function co(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let s={};for(let n of io){let o=t[n];if(!(typeof o!="object"||o===null))for(let[c,a]of Object.entries(o))!fe(c)||!ao(a)||((s[n]??(s[n]={}))[c]=a)}return Object.keys(s).length>0?s:null}r(co,"toVoiceClipMap");function sr(e){let[t,s]=so(null);ro(()=>{if(s(null),e===void 0)return;let o=!0,c=r(p=>{if(!o)return;let g=typeof p=="object"&&p!==null&&typeof p.setId=="string"?p:null;s(d=>d?.setId===g?.setId?d:g)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(c,()=>c(null))}catch{c(null)}let a=e.on("view",p=>c(p.voice));return()=>{o=!1,a()}},[e]);let n=oo(()=>t!==null?co(t):null,[t]);return e===void 0?null:n}r(sr,"useServerVoiceClips");import{jsx as ir}from"react/jsx-runtime";function ar({voice:e}){let t=O();return ir(B,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:()=>e.toggle(),children:ir(be,{off:!e.enabled,className:"sekyro-icon"})})}r(ar,"VoiceChip");import{Fragment as lr,jsx as V,jsxs as Ne}from"react/jsx-runtime";var po=800;function fo(e){return e===void 0||e!==!1&&e.length===Xe.length&&Xe.every(t=>e.includes(t))}r(fo,"isDefaultTips");function mo(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}r(mo,"carriesActivation");function yo(e){return typeof e=="object"&&e!==null&&!lo(e)&&"tone"in e&&"text"in e}r(yo,"isNoticeObject");var go=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function ho(e){return e==="starting"||e==="gating"||e==="recording"}r(ho,"isCapturing");function vo(e){return e==="captured"||e==="uploading"||e==="checking"}r(vo,"isPostCapture");function Ui({verification:e,locale:t,dir:s,strings:n,slots:o,autoStart:c=!1,notice:a,startDisabled:p=!1,startLabel:g,tips:d,tipsSummary:M,coach:N,voice:b,onGuidance:l,onCaptured:v,onResult:k,onError:u,onStateChange:w,assetBaseUrl:h,className:R}){let P=on(t),K=we(()=>rn(t,n),[t,n,P]),m=we(()=>y=>K[y]??"",[K]),q=s??(t==="ar"?"rtl":"ltr"),F=he(null),j=uo(Tn),i=nr({verification:e,videoRef:F,assetBaseUrl:h,onCaptured:v,onResult:k,onError:u,onStateChange:w}),A=er(h,i.state==="idle"&&i.error===null),I=or(e),x=I.choice!==null,_=$n(e),se=zn(e),ue=Wn(e),T=ln(),E=Zn(e),de=E.settled&&E.session==="choice"&&E.choice===null,C=E.mode==="assisted",W=C&&T.canChooseFacing,H=b!==!1&&b?.clips===void 0,ne=sr(H?e:void 0),S=ht({locale:t,defaultClips:ne,options:b}),[Fe,Ie]=cr(null),f=C?Fe??(T.canChooseFacing?"environment":"user"):"user",ie=E.settled&&!de&&(!C||T.facingSettled),Be=he(null),He=he(!1),Mt=he(S.unlock);Mt.current=S.unlock,oe(()=>{let y=Be.current;if(y===null)return;let Q=["pointerup","touchend","click","keydown"],ce=r(()=>{for(let Pe of Q)y.removeEventListener(Pe,Ce,!0)},"disarm");function Ce(Pe){if(He.current){ce();return}mo(Pe)&&(He.current=!0,ce(),Mt.current())}r(Ce,"onGesture");for(let Pe of Q)y.addEventListener(Pe,Ce,{capture:!0,passive:!0});return ce},[]);let Lt=it(()=>{He.current||(He.current=!0,S.unlock()),i.start({facing:f})},[S.unlock,i.start,f]),wt=it(()=>i.start({facing:f}),[i.start,f]),Ue=he(!1),ve=i.state==="idle"&&i.error===null,Nt=!x&&!_.required&&(c===!0||c==="when-permitted"&&T.permission==="granted"),It=Nt&&I.settled&&_.settled&&ie,ur=c==="when-permitted"&&!T.permissionSettled&&!Ue.current,xt=Nt&&ve&&!Ue.current,at=(ur||xt||!ie)&&A.gate==="ready"?"loading":A.gate;oe(()=>{!It||!ve||A.gate!=="ready"||Ue.current||(Ue.current=!0,wt())},[It,ve,A.gate,wt]);let _t=de&&ve&&!x&&!_.required,dr=!_t&&ve&&!x&&!_.required&&!(xt&&A.gate==="ready"),Et=it(()=>{i.switchCamera()&&Ie(f==="user"?"environment":"user")},[i.switchCamera,f]),Pt=i.state!=="idle"&&i.facingMode!==null?i.facingMode:f;oe(()=>{let y=F.current?.style;Pt==="user"?y?.removeProperty("transform"):y&&(y.transform="none")},[Pt]);let Ge=we(()=>i.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(i.artifacts.keyframe):null,[i.artifacts]);oe(()=>{if(Ge!==null)return()=>URL.revokeObjectURL(Ge)},[Ge]);let At=i.frozenPreview??Ge,ke=e!==void 0,U=ho(i.state),ae=vo(i.state),qe=U||ae,Y=i.result,Tt=i.state==="done"&&Y!==null,Ot=i.state==="recording"&&i.frozenPreview!==null,ct=j!==null,xe=ae||Ot,Kt=ae?"checking":Ot?"frozen":i.state==="recording"?"recording":i.gateLocked||i.gate.progress>=1?"locked":i.gate.faceDetected?"aligning":"seeking",De=U?i.gate.hint:null,je=i.state==="starting"?"capture.preparing.title":De===null?null:De==="center"&&!i.gate.faceDetected?"fcv3.no_face":Qt(De),[pr,Ft]=cr(null);oe(()=>{if(je!=="fcv3.no_face"){Ft(je);return}if(!U)return;let y=setTimeout(()=>Ft(je),po);return()=>clearTimeout(y)},[je,U]);let lt=U&&typeof N=="string"&&N!=="",Bt=C&&U?m("capture.assisted.stage"):null,pe=U&&!lt?pr:null,ut=lt?N:pe===null?"":m(pe);vt(S,pe,ut,U);let Ht=he(l);Ht.current=l,oe(()=>{if(fe(pe))try{Ht.current?.(pe)}catch(y){console.error("[@sekyro/react] onGuidance threw:",y)}},[pe]);let _e=we(()=>({supported:S.supported,enabled:S.enabled,setEnabled:S.setEnabled,toggle:S.toggle}),[S.supported,S.enabled,S.setEnabled,S.toggle]),dt=o?.voicePrompt,Ut=dt!==void 0,Gt=b===void 0,qt=he(!1);oe(()=>{!Ut||!Gt||qt.current||!tt()||(qt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[Ut,Gt]);let fr=dt!==void 0?(y,Q,ce)=>dt(y,Q,ce,_e):S.supported?()=>V(ar,{voice:_e}):void 0,{summary:pt,summaryPlaying:Dt,toggleSummary:jt,stopSummary:$t}=S,$e=M!==void 0&&M!=="",zt=$e?M:m("capture.tips.summary"),Yt=$e?pt!=="none":pt==="partner"||pt==="default"&&fo(d),mr=we(()=>Yt?{playing:Dt,toggle:r(()=>jt(zt,{clip:!$e}),"toggle"),stop:$t}:void 0,[Yt,Dt,jt,zt,$t,$e]),yr=we(()=>({assets:at,retryAssets:A.retry,permission:T.permission,permissionSettled:T.permissionSettled,captureMode:E.mode,facing:f,setFacing:Ie,canChooseFacing:W,voice:_e}),[at,A.retry,T.permission,T.permissionSettled,E.mode,W,f,_e]),gr=yo(a)?V($,{tone:a.tone,testId:"sekyro-host-notice",children:V("span",{children:a.text})}):a??null,re=Y!==null&&Y.status==="retry"?Y:null,D=Tt&&Y.status==="unavailable"&&!x&&Y.reason!=="portrait_required"?Y:null,Ee=Tt&&(Y.status==="approved"||Y.status==="rejected"||Y.status==="review")?Y:null,ze=r((y,Q)=>{if(y===void 0)return null;if(y==="device_cooldown"){let Ce=tn(t,Q);if(Ce!==null)return m(Ce.key).replace("{time}",Ce.time)}let ce=en(y);return ce===null?null:m(ce)},"reasonText"),ft=r(y=>{let Q=y.retakeHint===void 0?null:Jt(y.retakeHint);return Q===null?ze(y.reason):m(Q)},"retryText"),hr=D!==null&&D.reason!==void 0&&D.reason!=="nni_unbound"&&D.reason!=="id_number_unbound"&&D.reason!=="method_required"&&D.reason!=="mobile_required"&&!(D.reason==="no_recorder"&&i.artifacts?.degraded==="NO_RECORDER"),Ye=D?.reason,Zt=i.attempt;oe(()=>{D===null||Ye===void 0||e?.reportCaptureIssue===void 0||go.has(Ye)||Ze(y=>e.reportCaptureIssue?.(y),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Ye,attempt:Math.min(1e3,Zt)})},[D,Ye,Zt,e]);let Wt=We(),vr=x&&I.auto===null&&!U&&!ae&&i.error===null,mt=it(async y=>{await I.select(y)&&i.state==="done"&&i.retry()},[I.select,i.state,i.retry]);return oe(()=>{I.auto!==null&&!I.busy&&!U&&!ae&&mt(I.auto)},[I.auto,I.busy,U,ae,mt]),V(sn,{value:m,children:Ne("div",{ref:Be,className:R===void 0?"sekyro-capture":`sekyro-capture ${R}`,dir:q,lang:t,"data-testid":"sekyro-liveness-capture","data-state":i.state,children:[o?.header,re!==null&&ft(re)!==null&&!(ct&&qe)?V($,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:V("span",{children:ft(re)})}):null,ue&&ae&&!ct?V($,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:V("span",{children:m("capture.busy")})}):null,_.required&&ve?V($,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:V("span",{children:m("reasons.mobile_required")})}):null,i.error!==null?o?.errorPanel!==void 0?o.errorPanel(i.error,i.retry):Ne($,{tone:"danger",testId:"sekyro-error-notice",children:[V("span",{children:m(Xt(i.error.kind))}),i.error.retryable?V(B,{ref:Wt,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:m("common.retry")}):null]}):null,D!==null?Ne($,{tone:"danger",testId:"sekyro-unavailable-notice",children:[V("span",{children:ze(D.reason)??m(D.reason===void 0?"errors.session_expired":"errors.network_error")}),hr?V(B,{ref:Wt,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:m("capture.recordAgain")}):null]}):null,Ee!==null&&ze(Ee.reason)!==null?V($,{tone:Ee.status==="rejected"?"danger":"info",testId:"sekyro-result-notice",children:V("span",{children:ze(Ee.reason,Ee.retryAfter)})}):null,V("div",{className:qe?void 0:"sekyro-hidden","data-capture-live":qe?"":void 0,children:ct?j({videoRef:F,guidance:xe&&ke?m("capture.checking"):ut,coached:lt&&!(xe&&ke),note:xe?ke?m(ue?"capture.busy":"capture.checkingHint"):null:re!==null?ft(re):Bt,settled:xe&&ke,progress:i.gate.progress,phase:Kt,still:xe?At:null,live:qe,switchCamera:U&&i.state!=="recording"&&W&&Et,ramp:i.rampColour===null?null:{colour:i.rampColour}}):V(an,{videoRef:F,guidanceText:ut,guidanceHint:De,guidanceKey:pe,progress:i.gate.progress,phase:Kt,draining:i.draining,stillUrl:At,showChecking:ke,onSwitchCamera:Et,canSwitchCamera:C&&U&&i.state!=="recording",operatorText:Bt,voicePrompt:fr,overlay:y=>Ne(lr,{children:[o?.stageOverlay?.(y),V(un,{colour:i.rampColour})]}),reduceMotion:i.reduceMotion})}),vr&&I.choice!==null?V(Je,{title:m("method.title"),description:m("method.description"),options:I.choice.options.map(y=>({id:y,label:m(`method.${y}`)})),busy:I.busy,error:I.failed?m("errors.network_error"):null,focus:i.state==="done",testId:"sekyro-method",look:"buttons",onChoose:y=>{mt(y)}}):null,_t?V(Fn,{onChoose:E.choose}):null,dr?Ne(lr,{children:[se&&o?.header===void 0&&o?.intro===void 0?Ne("div",{className:"sekyro-stack sekyro-stack--1",children:[V("h2",{className:"sekyro-text-body",children:m("returning.title")}),V("p",{className:"sekyro-text-muted",children:m("returning.description")})]}):null,gr,o?.intro!==void 0?o.intro(Lt,yr):V(jn,{assets:at,onRetryAssets:A.retry,permission:T.permission,captureMode:E.mode,canChooseFacing:W,facing:f,onFacingChange:Ie,voice:_e,tips:d??Xe,summary:mr,startLabel:g,startDisabled:p,onStart:Lt})]}):null,V(Pn,{showCoaching:re!==null,attemptsText:re?.attemptsRemaining!==void 0?nn(K,t,re.attemptsRemaining):null,showRetake:re!==null&&!U&&!ae||!ke&&i.state==="captured",onRetake:i.retry}),o?.footer]})})}r(Ui,"LivenessCapture");export{tt as a,Tn as b,On as c,Je as d,Fn as e,Bn as f,Xe as g,Zn as h,et as i,po as j,Ui as k};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{p as k,q as h,r as M}from"./chunk-3GCHNE7R.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};
@@ -0,0 +1,2 @@
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-3GCHNE7R.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};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as r,b as n,d as c}from"./chunk-T7C7Q4AN.js";import{a as o}from"./chunk-3GCHNE7R.js";import{a}from"./chunk-2KED7D2Q.js";import{jsx as e,jsxs as i}from"react/jsx-runtime";function h({title:s,lead:d,cameraLabel:l,uploadLabel:p,notice:m,testId:t,onCamera:u,onUpload:f}){return i("section",{className:"sekyro-step","data-testid":t,children:[e(n,{title:s,lead:d}),m,i(c,{children:[i(o,{full:!0,onClick:u,"data-testid":`${t}-camera`,children:[e(r,{name:"camera"}),l]}),e(o,{full:!0,kind:"ghost",onClick:f,"data-testid":`${t}-upload`,children:p})]})]})}a(h,"PhotoSourceView");export{h as a};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as I}from"./chunk-W3GLUWQ5.js";import{a as _,b as S,d as P,p as y,q as C}from"./chunk-T7C7Q4AN.js";import{a as m}from"./chunk-3GCHNE7R.js";import{a as s}from"./chunk-2KED7D2Q.js";import{useRef as R,useState as k}from"react";var b={"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 N={"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 E={en:g,fr:N,ar:b,es:g,pt:g,de:g},H="image/jpeg,image/png,image/heic,image/heif";function x(r){let o=r.strings,i=E[r.locale];return e=>o[e]??i[e]??""}s(x,"portraitCopy");function T({step:r,i18n:o}){if(r.reason===void 0||r.reason==="portrait_fix_review")return null;let i=x(o)(`reasons.${r.reason}`)||o.t("portrait.retryTitle");return n(y,{tone:"warning",children:[t("span",{children:i}),t("span",{children:C(o,r.attemptsRemaining,r.attemptsExhausted)})]})}s(T,"ReasonNotice");function V({step:r,i18n:o,onCamera:i,onUpload:e}){let a=x(o);return t(I,{testId:"sekyro-portrait-source",title:a("portrait.source.title"),lead:a("portrait.source.description"),cameraLabel:a("portrait.source.camera"),uploadLabel:a("portrait.source.upload"),notice:t(T,{step:r,i18n:o}),onCamera:i,onUpload:e})}s(V,"PortraitSourceView");function z({step:r,i18n:o,onCamera:i}){let e=x(o),a=R(null),[p,f]=k("idle"),u=p==="sending",l=r.photo?.uploadOffered===!0,v=s(async c=>{let w=c.currentTarget.files?.[0];if(c.currentTarget.value="",w!==void 0){f("sending");try{await r.uploadPortrait(w),f("idle")}catch(h){f(h instanceof TypeError&&h.message==="unsupported_file"?"unsupported":"failed")}}},"onFile");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-upload-screen",children:[t(S,{title:e("portrait.upload.title"),lead:e("portrait.upload.hint")}),p==="idle"||p==="sending"?t(T,{step:r,i18n:o}):null,p==="unsupported"||p==="failed"?t(y,{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:H,hidden:!0,"data-testid":"sekyro-portrait-upload","aria-label":e("portrait.upload.title"),onChange:c=>{v(c)}}),n(P,{children:[t(m,{full:!0,onClick:()=>a.current?.click(),disabled:u||!l||r.attemptsExhausted,children:e("portrait.upload.choose")}),i!==void 0?n(m,{full:!0,kind:"ghost",onClick:i,disabled:u,children:[t(_,{name:"camera"}),e("portrait.source.camera")]}):null]})]})}s(z,"PortraitUploadView");function A({step:r,i18n:o,onDeclined:i}){let e=x(o),[a,p]=k(!1),[f,u]=k(!1),l=r.pendingFix;if(l==null)return null;let v=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"),w=s(d=>e(`portrait.fixes.${d}`)||d,"fixName"),h=e("portrait.review.original"),U=e("portrait.review.fixed");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-review",children:[t(S,{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:h}),t("figcaption",{className:"sekyro-text-muted",children:h})]}),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:w(d)},d))})]}):null,f?t(y,{tone:"danger",children:t("span",{children:o.t("errors.network_error")})}):null,n(P,{children:[t(m,{full:!0,onClick:()=>{v(!0)},disabled:a,"data-testid":"sekyro-portrait-accept",children:e("portrait.review.accept")}),t(m,{full:!0,kind:"ghost",onClick:()=>{v(!1)},disabled:a,"data-testid":"sekyro-portrait-decline",children:c})]})]})}s(A,"PortraitReviewView");function O({screen:r,step:o,i18n:i,onCamera:e,onUpload:a,onDeclined:p}){return r==="review"?t(A,{step:o,i18n:i,onDeclined:p}):r==="upload"?t(z,{step:o,i18n:i,...e!==void 0?{onCamera:e}:{}}):t(V,{step:o,i18n:i,onCamera:e??a,onUpload:a})}s(O,"PortraitScreens");export{x as a,V as b,z as c,A as d,O as e};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as g}from"./chunk-5TOBG5R2.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 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(o={}){let e={};for(let r of Object.keys(l))e[l[r]]=o.colors?.[r]??t.colors[r];return e["--sekyro-radius"]=o.radius??t.radius,e["--sekyro-font"]=o.fontFamily??t.fontFamily,e}s(S,"themeToCssVars");var m=/^#[0-9a-f]{6}$/i,k=["brand","brandFg","bg","surface","fg","fgMuted"],b=["danger","success","warning"],u=!1;function p(o){let e=o?.colors;if(o===void 0||e===void 0||!b.some(i=>i in e))return o;!u&&g()&&(u=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));let{danger:r,success:a,warning:f,...n}=e;return{...o,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 F(o){let e={};if(!o)return e;let r={},a=o.colors??{};for(let i of k){let d=a[i];d!==void 0&&m.test(d)&&(r[i]=d)}r.brand&&(r.ring=r.brand),Object.keys(r).length&&(e.colors=r);let f=T[o.radius];f&&(e.radius=f);let n=h[o.fontFamily];return n!==void 0&&(e.fontFamily=n?`${n}, ${t.fontFamily}`:t.fontFamily),e}s(F,"brandingToTheme");function I(...o){let e={};for(let r of o)r?.colors&&(e.colors={...e.colors,...r.colors}),r?.radius&&(e.radius=r.radius),r?.fontFamily&&(e.fontFamily=r.fontFamily);return e}s(I,"mergeThemes");function C({theme:o,children:e,className:r}){return y(R,{theme:p(o),...r!==void 0?{className:r}:{},children:e})}s(C,"SekyroThemeProvider");function R({theme:o,children:e,className:r}){let a=S(o);return y("div",{className:r===void 0?"sekyro-root":`sekyro-root ${r}`,style:a,children:e})}s(R,"SekyroThemeRoot");export{c as a,t as b,S as c,p as d,F as e,I as f,C as g,R as h};
2
+ import{a as g}from"./chunk-JTDARDD6.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 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(o={}){let e={};for(let r of Object.keys(l))e[l[r]]=o.colors?.[r]??t.colors[r];return e["--sekyro-radius"]=o.radius??t.radius,e["--sekyro-font"]=o.fontFamily??t.fontFamily,e}s(S,"themeToCssVars");var m=/^#[0-9a-f]{6}$/i,k=["brand","brandFg","bg","surface","fg","fgMuted"],b=["danger","success","warning"],u=!1;function p(o){let e=o?.colors;if(o===void 0||e===void 0||!b.some(i=>i in e))return o;!u&&g()&&(u=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));let{danger:r,success:a,warning:f,...n}=e;return{...o,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 F(o){let e={};if(!o)return e;let r={},a=o.colors??{};for(let i of k){let d=a[i];d!==void 0&&m.test(d)&&(r[i]=d)}r.brand&&(r.ring=r.brand),Object.keys(r).length&&(e.colors=r);let f=T[o.radius];f&&(e.radius=f);let n=h[o.fontFamily];return n!==void 0&&(e.fontFamily=n?`${n}, ${t.fontFamily}`:t.fontFamily),e}s(F,"brandingToTheme");function I(...o){let e={};for(let r of o)r?.colors&&(e.colors={...e.colors,...r.colors}),r?.radius&&(e.radius=r.radius),r?.fontFamily&&(e.fontFamily=r.fontFamily);return e}s(I,"mergeThemes");function C({theme:o,children:e,className:r}){return y(R,{theme:p(o),...r!==void 0?{className:r}:{},children:e})}s(C,"SekyroThemeProvider");function R({theme:o,children:e,className:r}){let a=S(o);return y("div",{className:r===void 0?"sekyro-root":`sekyro-root ${r}`,style:a,children:e})}s(R,"SekyroThemeRoot");export{c as a,t as b,S as c,p as d,F as e,I as f,C as g,R as h};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as Ke}from"./chunk-W3GLUWQ5.js";import{a as $e,b as Ue,c as Re}from"./chunk-7MMT5M4E.js";import{d as Ee}from"./chunk-455FWUKU.js";import{a as V,b as le,d as de,j as Ie,k as Pe,l as Ae,n as Oe,p as ue,q as pe}from"./chunk-T7C7Q4AN.js";import"./chunk-VBIVDLBE.js";import{a as K,m as He,n as _e}from"./chunk-3GCHNE7R.js";import{a as d}from"./chunk-2KED7D2Q.js";import{useContext as Qe,useEffect as B,useLayoutEffect as ut,useRef as Y,useState as b}from"react";var Ve={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 Be={"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 W={"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 Ye={"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 Ge={"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 j={"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 Fe={"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 Xe={"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 We={"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 dt=["locking","capturing"],me=class me{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),g=this.shown.hint===null||o-this.hintShownAt>=1200;r&&g&&(this.shown={...this.shown,hint:a},this.hintShownAt=o)}presentLock(e,o){if(dt.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 g=.35;this.shown={...this.shown,card:{fill:r.fill+(a.fill-r.fill)*g,offsetX:r.offsetX+(a.offsetX-r.offsetX)*g,offsetY:r.offsetY+(a.offsetY-r.offsetY)*g}}}};d(me,"ScanPresenter");var ne=me;import{Fragment as he,jsx as t,jsxs as i}from"react/jsx-runtime";var pt={en:Q,fr:We,ar:Xe,es:Q,pt:Q,de:Q},mt=450,fe=d(n=>e=>Ee(n.strings[e]??pt[n.locale][e]??""),"useScanCopy");function oe({name:n}){return t("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:Ve[n]}})}d(oe,"ScanGlyph");var ht={en:W,fr:Ye,ar:Be,es:W,pt:W,de:W},ft={en:j,fr:Fe,ar:Ge,es:j,pt:j,de:j},gt="image/jpeg,image/png,image/heic,image/heif";function G(n){let e=n.strings,o=d(a=>e[a]??ft[n.locale][a],"text");return{t:d(a=>o(a)??"","t")}}d(G,"uploadCopy");function St(n,e){return n===null||n.state==="fallback"||n.state==="mismatch"?null:n.state==="searching"?e?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":n.state==="valid"?"dcv3.mrz.valid":n.coach!==void 0?`dcv3.mrz.${n.coach}`:"dcv3.mrz.reading"}d(St,"mrzInstruction");function ge(n){return n.reason==="unreadable"?"doc.reason_unreadable":n.reason!==void 0&&n.reason!=="side_missing"?_e(n.reason):null}d(ge,"reasonOf");function rn({step:n,i18n:e,liveMrz:o,ageLead:a,...r}){let[g,S]=b(!1),L=Y(-1),[h,f]=b("idle"),v=Y(null),k=typeof n.uploadDocument=="function",w=k?n.photo?.source??"camera":"camera",T=k&&w!=="camera"&&n.photo?.uploadOffered===!0,[y,F]=b(null),I=w==="upload"?"upload":w==="choice"?y??n.photo?.pick??"source":"camera",H=h==="sending"?void 0:()=>v.current?.click(),m=d(async P=>{let X=P.currentTarget.files?.[0];if(P.currentTarget.value="",X!==void 0){S(!1),f("sending");try{await n.uploadDocument(X),f("idle")}catch(q){f(q instanceof TypeError&&q.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),Z=T?t("input",{ref:v,type:"file",accept:gt,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":G(e).t("doc.uploadTitle"),onChange:P=>{m(P)}}):null,N=G(e);return I==="source"?t(Ke,{testId:"sekyro-doc-source",title:N.t("doc.source.title"),lead:N.t("doc.source.description"),cameraLabel:N.t("doc.source.camera"),uploadLabel:N.t("doc.source.upload"),notice:t(Se,{step:n,i18n:e}),onCamera:()=>F("camera"),onUpload:()=>F("upload")}):I==="upload"?i(he,{children:[t(kt,{step:n,i18n:e,ageLead:a===!0,upload:h,offered:T,onPick:()=>v.current?.click(),...w==="choice"?{onCamera:d(()=>F("camera"),"onCamera")}:{},...r}),Z]}):i(he,{children:[g?t(Ct,{step:n,i18n:e,attempts:L,...o!==void 0?{liveMrz:o}:{},...T&&H!==void 0?{onUpload:H}:{},onClose:()=>S(!1)}):t(yt,{step:n,i18n:e,ageLead:a===!0,onOpen:()=>S(!0),upload:h,...T&&H!==void 0?{onUpload:H}:{},...r}),Z]})}d(rn,"DocumentCaptureView");function Ze({passport:n}){let o=Math.round(228/(n?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:[t("defs",{children:t("clipPath",{id:"sekyro-card-clip",children:t("rect",{width:228,height:o,rx:"12.5"})})}),t("rect",{className:"sekyro-mark__card",width:228,height:o,rx:"12.5"}),t("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:o*.52,rx:"6"}),[0,1,2].map(a=>t("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=>t("rect",{className:"sekyro-mark__text",x:"17",y:o*.74+a*9,width:194,height:"4",rx:"2"},a)),t("g",{clipPath:"url(#sekyro-card-clip)",children:t("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:t("rect",{x:"-1",width:"2",height:o,className:"sekyro-mark__beam"})})}),t("path",{className:"sekyro-mark__brackets",d:vt(-10,-10,248,o+20,16,30)})]})}d(Ze,"ScanMark");function vt(n,e,o,a,r,g){let S=Math.min(r,g*.6);return[[n,e,1,1],[n+o,e,-1,1],[n,e+a,1,-1],[n+o,e+a,-1,-1]].map(([h,f,v,k])=>`M${h} ${f+k*g}V${f+k*S}Q${h} ${f} ${h+v*S} ${f}H${h+v*g}`).join("")}d(vt,"brackets");function yt({step:n,i18n:e,ageLead:o,onOpen:a,onChangeCountry:r,onChangeDocument:g,upload:S,onUpload:L}){let h=fe(e),f=G(e),v=n.documentType==="passport",k=ge(n),w=S==="sending",T=Qe(Pe)?.busy===!0;return i("section",{className:"sekyro-step","data-testid":"sekyro-document",children:[t(Ze,{passport:v}),t(le,{title:h("native.doc.introTitle"),lead:o?e.t("doc.ageStepUp"):h("native.doc.introLead")}),t(Se,{step:n,i18n:e}),i("ul",{className:"sekyro-tiprows",children:[i("li",{children:[t(V,{name:v?"passport":"card"}),h("native.doc.tip.flat")]}),i("li",{children:[t(V,{name:"light"}),h("native.doc.tip.glare")]}),i("li",{children:[t(oe,{name:"image"}),h("native.doc.tip.frame")]})]}),t(qe,{i18n:e,...g!==void 0?{onChangeDocument:g}:{},...r!==void 0?{onChangeCountry:r}:{}}),t(Je,{i18n:e,upload:S}),w?t("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):L!==void 0?t("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,i(de,{children:[i(K,{full:!0,onClick:a,disabled:w||T,children:[t(V,{name:"camera"}),h("native.doc.openCamera")]}),L!==void 0?i(K,{full:!0,kind:"ghost",onClick:L,children:[t(oe,{name:"image"}),f.t("doc.uploadInstead")]}):null]})]})}d(yt,"DocumentIntro");function Se({step:n,i18n:e}){let o=ge(n);return o===null?null:i(ue,{tone:"warning",children:[t("span",{children:e.t(o)}),t("span",{children:pe(e,n.attemptsRemaining,n.attemptsExhausted)})]})}d(Se,"ReasonNotice");function qe({i18n:n,onChangeCountry:e,onChangeDocument:o}){let a=fe(n);return o===void 0&&e===void 0?null:i("div",{className:"sekyro-links",children:[o!==void 0?t("button",{type:"button",className:"sekyro-link",onClick:o,children:a("native.doc.changeDocument")}):null,e!==void 0?t("button",{type:"button",className:"sekyro-link",onClick:e,children:n.t("native.doc.changeCountry")}):null]})}d(qe,"ChangeLinks");function Je({i18n:n,upload:e}){return e!=="unsupported"&&e!=="failed"?null:t(ue,{tone:"warning",children:t("span",{children:G(n).t(e==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}d(Je,"UploadNotice");function kt({step:n,i18n:e,ageLead:o,upload:a,offered:r,onPick:g,onCamera:S,onChangeCountry:L,onChangeDocument:h}){let f=G(e),v=a==="sending";return i("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[t(Ze,{passport:n.documentType==="passport"}),t(le,{title:f.t("doc.uploadTitle"),lead:o?e.t("doc.ageStepUp"):f.t("doc.uploadHint")}),o?t("p",{className:"sekyro-text-muted",children:f.t("doc.uploadHint")}):null,t(Se,{step:n,i18n:e}),t(qe,{i18n:e,...h!==void 0?{onChangeDocument:h}:{},...L!==void 0?{onChangeCountry:L}:{}}),t(Je,{i18n:e,upload:a}),v?t("p",{className:"sekyro-text-muted",role:"status",children:e.t("doc.uploading")}):null,i(de,{children:[i(K,{full:!0,onClick:g,disabled:v||!r||n.attemptsExhausted,children:[t(oe,{name:"image"}),f.t("doc.source.upload")]}),S!==void 0?i(K,{full:!0,kind:"ghost",onClick:S,disabled:v,children:[t(V,{name:"camera"}),f.t("doc.source.camera")]}):null]})]})}d(kt,"DocumentUploadScreen");function je(n,e,o){let a=n*.88,r=a/o;return{x:(n-a)/2,y:e*.42-r/2,w:a,h:r}}d(je,"guideRect");var bt={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"},wt=d(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function Ct({step:n,i18n:e,liveMrz:o,onClose:a,attempts:r,onUpload:g}){let S=fe(e),L=Qe($e),h=Y(L);h.current=L;let f=Y(null),v=Y(null),k=Y(null),[w,T]=b("idle"),[y,F]=b(null),[I,H]=b(null),[m,Z]=b({w:0,h:0}),[N,P]=b({hint:null,locking:!1,card:null,manualShutter:!1}),[X,q]=b({}),[ve,et]=b(null),[ye,tt]=b(null),[ke,be]=b(0),[we,Ce]=b(null),[J,De]=b(null),_=n.documentType==="passport",ee=_?1.42:1.586;Ie(!0),ut(()=>{let c=f.current;if(c===null)return;let u=d(()=>Z({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=je(m.w,m.h,ee);B(()=>{m.w===0||m.h===0||k.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]),B(()=>{let c=v.current;if(c===null)return;let u=n.capture({video:c,...o!==void 0?{liveMrz:o}:{}});k.current=u;let l=f.current;if(l!==null&&l.clientWidth>0&&l.clientHeight>0){let p=je(l.clientWidth,l.clientHeight,ee);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 M=new ne,D={scan:null,feedback:null,gate:null},U=d(p=>{D={...D,...p};let x=D.gate?.guide,lt={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},R=M.present(lt,performance.now());P(E=>E.hint===R.hint&&E.locking===R.locking&&E.manualShutter===R.manualShutter&&E.card?.fill===R.card?.fill&&E.card?.offsetX===R.card?.offsetX&&E.card?.offsetY===R.card?.offsetY?E:R)},"present"),ct=[u.on("state",T),u.on("feedback",p=>U({feedback:p})),u.on("gate",p=>U({gate:p})),u.on("scan",p=>{F(p),U({scan:p})}),u.on("captured",p=>{q(x=>({...x,[Dt(p.side,_,x)]:p.previewDataUrl})),et(p.previewDataUrl),tt(Nt(c))}),u.on("error",p=>{H(p);let x=h.current;x!==null&&Re(x,Ue("document",p,Math.max(0,r.current)))}),u.on("mrz",p=>{p.state==="mismatch"?De(p.format??null):Ce(p)})];return r.current+=1,u.start().catch(()=>{}),()=>{for(let p of ct)p();u.destroy(),k.current=null}},[n.issuer,n.documentType]);let z=y?.phase??"framing",$=z==="reading"||z==="result",ae=z==="flipCue"||z==="reaskRecto",A=N.locking,Le=y?.captured.length??0;B(()=>{A&&be(c=>c+1)},[A]),B(()=>{Le>0&&be(c=>c+1)},[Le]);let nt=y?.expected??null;B(()=>{Ce(null)},[nt]),B(()=>{if(J===null)return;let c=setTimeout(()=>De(null),2e3);return()=>clearTimeout(c)},[J]);let Ne=ae||$?null:St(we,_),re=J!==null?J==="TD3"?"dcv3.mrz.looksLikePassport":"dcv3.mrz.looksLikeCard":Ne,ot=re===null?null:e.strings[re]??ht[e.locale][re],ze=ge(n),xe=N.hint===null?null:bt[N.hint]??`dcv2.${N.hint}`,at=xe??(z==="flipCue"?y?.notice==="same_face"?"doc.sameFace":"doc.flip":z==="reaskRecto"?"doc.reaskRecto":$?"native.scan.reading":z==="locking"||z==="capturing"||A?"native.scan.holdStill":y?.notice==="reread"?"doc.reread":y?.notice==="technical"?"native.scan.retry":y?.notice==="blurry"?"native.scan.blurry":ze??(_?"doc.showPage":"doc.showSide")),se=ot??S(at),O=N.card,C=s;if(!A&&O!==null&&O.fill>=.45&&O.fill<=1.25&&!wt()){let c=s.w*O.fill,u=c/ee,l=s.x+s.w/2+s.w*Math.max(-.25,Math.min(.25,O.offsetX)),M=s.y+s.h/2+s.h*Math.max(-.25,Math.min(.25,O.offsetY));C={x:l-c/2,y:M-u/2,w:c,h:u}}let te=s.w*.045,ie=28,Te=Math.min(te,ie*.6),rt=[[C.x,C.y,1,1],[C.x+C.w,C.y,-1,1],[C.x,C.y+C.h,1,-1],[C.x+C.w,C.y+C.h,-1,-1]],st=A?"is-locked":N.hint!==null?"is-coaching":"",it=_?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],Me=s.y+s.h+48,ce={insetInlineStart:s.x,insetBlockStart:s.y,inlineSize:s.w,blockSize:s.h,borderRadius:te};return t("section",{className:"sekyro-lm","aria-label":se,"data-testid":"sekyro-document",children:i("div",{ref:f,className:`sekyro-lm-stage${$?" is-reading":""}${ae?" is-flip":""}`,style:{"--sekyro-guide-w":`${s.w}px`},children:[t("video",{ref:v,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:c=>{let u=c.currentTarget,l=u.getBoundingClientRect(),M=Math.max(l.width/(u.videoWidth||1),l.height/(u.videoHeight||1)),D=u.videoWidth*M,U=u.videoHeight*M;D>0&&U>0&&k.current?.focusAt((c.clientX-l.left+(D-l.width)/2)/D,(c.clientY-l.top+(U-l.height)/2)/U)}}),m.w>0?i(he,{children:[$&&ye!==null?t("img",{className:"sekyro-lm-scene",src:ye,alt:""}):null,$&&ve!==null?t("img",{className:"sekyro-lm-frozen",src:ve,alt:"",style:ce}):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:[t("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),t("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),i("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),t("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),t("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${m.w}V${m.h}H0Z${Lt(s,te)}`}),t("rect",{width:m.w,height:Math.max(0,s.y),fill:"url(#sekyro-lm-top)"}),t("rect",{y:s.y+s.h,width:m.w,height:Math.max(0,m.h-s.y-s.h),fill:"url(#sekyro-lm-bottom)"}),t("g",{className:`sekyro-lm-brackets ${st}`,children:rt.map(([c,u,l,M],D)=>t("path",{style:{transform:`translate(${c}px, ${u}px) scale(${l}, ${M})`},d:`M0 ${ie}V${Te}Q0 0 ${Te} 0H${ie}`},D))}),A?t("rect",{className:"sekyro-lm-trace",x:s.x,y:s.y,width:s.w,height:s.h,rx:te,pathLength:"1",style:{animationDuration:`${mt}ms`}}):null]}),t("div",{className:"sekyro-lm-slot",style:ce,"aria-hidden":"true",children:$?t("span",{className:"sekyro-lm-read is-repeating"}):ke>0?t("span",{className:"sekyro-lm-read"},ke):null})]}):null,Ne!==null?t("div",{className:"sekyro-lm-slot",style:ce,"aria-hidden":"true",children:t("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${_?" is-page":""}${we?.state==="valid"?" is-valid":""}`})}):null,i("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:s.y-64},children:[t("div",{role:"status","aria-live":"polite",children:t(Oe,{swapKey:se,className:"sekyro-lm-line",children:se})}),ze!==null&&z==="framing"&&xe===null?t("p",{className:"sekyro-lm-attempts",children:pe(e,n.attemptsRemaining,n.attemptsExhausted)}):null]}),$?i("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:Me-12},children:[t("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),S("native.scan.putDown")]}):ae?t("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(ee)},children:[t("span",{className:"sekyro-lm-flip-front"}),t("span",{className:"sekyro-lm-flip-back"})]})}):null,i("div",{className:"sekyro-lm-controls",children:[i("div",{className:"sekyro-lm-bar",children:[t("button",{type:"button",className:"sekyro-glass","aria-label":e.t("native.close"),onClick:a,children:t(V,{name:"close"})}),y?.torchAvailable?t("button",{type:"button",className:`sekyro-glass${y.torch?" is-on":""}`,"aria-label":e.t("doc.torchOn"),"aria-pressed":y.torch,onClick:()=>k.current?.setTorch(!y.torch),children:t(oe,{name:"flashlight"})}):null]}),I!==null?i("div",{className:"sekyro-lm-error",role:"alert",children:[t("p",{children:e.t("doc.cameraBlocked")}),t("p",{children:e.t(I.kind==="permission"?"doc.cameraBlockedHint":He(I.kind))}),t(K,{onClick:()=>{H(null),r.current+=1,k.current?.retry()},children:e.t("doc.retryCamera")})]}):null,N.manualShutter?t("button",{type:"button",className:"sekyro-shutter","aria-label":e.t("doc.shutter"),onClick:()=>k.current?.shutter()}):null,t("ol",{className:"sekyro-lm-tray",children:it.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:[X[c]!==void 0?t("img",{src:X[c],alt:""}):null,t("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:t("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,S(u)]},c)})}),g!==void 0?t("button",{type:"button",className:"sekyro-lm-upload",onClick:g,children:G(e).t("doc.uploadInstead")}):null,w==="uploading"||w==="checking"?null:t(Ae,{onStop:a})]}),w==="uploading"||w==="checking"?t("span",{className:"sekyro-visually-hidden",role:"status",children:w==="uploading"?e.t("doc.uploading"):S("native.scan.reading")}):null]})})}d(Ct,"LumiereScan");function Dt(n,e,o){return e?"single":n==="recto"||n==="verso"?n:o.recto===void 0?"recto":"verso"}d(Dt,"slotOf");function Lt({x:n,y:e,w:o,h:a},r){return`M${n+r} ${e}H${n+o-r}Q${n+o} ${e} ${n+o} ${e+r}V${e+a-r}Q${n+o} ${e+a} ${n+o-r} ${e+a}H${n+r}Q${n} ${e+a} ${n} ${e+a-r}V${e+r}Q${n} ${e} ${n+r} ${e}Z`}d(Lt,"roundedRect");function Nt(n){let e=Math.round(n.videoWidth/4),o=Math.round(n.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(n,0,0,e,o),a.toDataURL("image/jpeg",.7))}catch{return null}}d(Nt,"sceneSnapshot");export{rn as DocumentCaptureView,mt as LOCK_TRACE_MS,gt as UPLOAD_ACCEPT,je as guideRect,St as mrzInstruction,Dt as slotOf};
@@ -0,0 +1,2 @@
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-455FWUKU.js";import{d as x,m as W,p as A}from"./chunk-T7C7Q4AN.js";import"./chunk-VBIVDLBE.js";import{a as N,r as G}from"./chunk-3GCHNE7R.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};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as F,b as q,c as J}from"./chunk-GUTF3SPK.js";import{a as U}from"./chunk-VRDPGOXM.js";import{d as B}from"./chunk-455FWUKU.js";import{b as Y,d as N,f as K,m as G,p as b,q as j}from"./chunk-T7C7Q4AN.js";import"./chunk-VBIVDLBE.js";import{a as k}from"./chunk-3GCHNE7R.js";import{a as l}from"./chunk-2KED7D2Q.js";import{OtpInputError as pe}from"@sekyro/web";import{useEffect as ce,useId as ue,useRef as Oe,useState as p}from"react";var Q={"emailOtp.reason_otp_daily_cap_reached":"لا يمكننا إرسال رمز إلى بريدك الإلكتروني اليوم. اختر طريقة أخرى للتحقق إن كانت متاحة، أو حاول مرة أخرى لاحقًا.","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 O={"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.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 in a moment","emailOtp.reason_otp_rate_limited":"Too many codes requested. Wait a moment, then try again","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.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 dans un instant","emailOtp.reason_otp_rate_limited":"Trop de codes demandés. Patientez un instant, puis réessayez","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 C,jsx as a,jsxs as o}from"react/jsx-runtime";var fe={en:O,fr:X,ar:Q,es:O,pt:O,de:O},Z=l((e,r,f)=>{if(e===void 0)return 0;let y=Date.parse(e)-r;return Number.isFinite(y)?Math.min(f,Math.max(0,Math.ceil(y/1e3))):0},"secondsUntil"),ye=600,_e=60,ve=l(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"]);function Ae({step:e,i18n:r,className:f,defaultEmail:y="",onError:ae}){let i=l((t,s)=>B(r.strings[t]??fe[r.locale][t],s),"t"),[x,ie]=p(y),[_,T]=p(""),[n,z]=p(!1),[w,I]=p(null),[g,c]=p(!1),[R,te]=p(null),u=Oe(null),v=e.phase==="verify",d=v&&!g,V=J(v),m=ue(),[se,oe]=F(e.reason==="otp_mismatch",e.attemptsRemaining,()=>T("")),A=v?e.codeExpiresAt??"sent":null;ce(()=>{A!==null&&(c(!1),u.current!==null&&!ee.has(e.reason??"")&&te(u.current),u.current=null)},[A]);let L=l(async t=>{z(!0),I(null);try{await t()}catch(s){I(s instanceof pe&&s.field==="email"?i("emailOtp.emailInvalid"):r.t(U(s,r.strings))),ae?.(s)}finally{z(!1)}},"run"),D=l(t=>{let s=e.needsEmail?t?R:x.trim():null;u.current=s,L(async()=>{try{await e.send(s!==null?{email:s}:{})}catch(de){throw u.current=null,de}})},"send"),$=l(t=>{L(()=>e.verify(t))},"submitCode"),ne=l(t=>{t.preventDefault(),d?$(_):D(!1)},"onSubmit"),S=Z(e.codeExpiresAt,V,ye),E=Z(e.resendAvailableAt,V,_e),h=d&&e.codeExpiresAt!==void 0&&S===0,P=e.needsEmail&&!e.attemptsExhausted,W=v&&(e.codeExpiresAt===void 0||S>0),H=d&&P?()=>c(!0):g&&W?()=>c(!1):null;K(H===null?null:n?()=>{}:H);let[le,re]=i("emailOtp.sentTo").split("{email}"),M=e.context.simulation?.otpCode,me=e.reason==="otp_mismatch"?o(b,{tone:"danger",children:[a("span",{children:i("emailOtp.reason_otp_mismatch")}),a("span",{children:j(r,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&ee.has(e.reason)?a(b,{tone:"warning",children:a("span",{children:i(`emailOtp.reason_${e.reason}`)})}):null;return o("form",{className:`sekyro-step sekyro-otp${f?` ${f}`:""}`,"aria-labelledby":m,onSubmit:ne,noValidate:!0,children:[a(Y,{id:m,title:i(d?"emailOtp.verifyTitle":"emailOtp.sendTitle"),lead:d&&M!==void 0?a(G,{template:r.t("sandbox.otpHint"),code:M}):d?o(C,{children:[le,a("bdi",{dir:"ltr",className:"sekyro-mono",children:R??e.sentToMasked}),re]}):i("emailOtp.sendDescription")}),me,w!==null?a(b,{tone:"danger",children:a("span",{children:w})}):null,d?o(C,{children:[o("div",{className:"sekyro-field",children:[a("label",{className:"sekyro-label",htmlFor:`${m}-code`,children:i("emailOtp.codeLabel")}),a(q,{id:`${m}-code`,value:_,invalid:se,onChange:t=>{t!==""&&oe(),T(t),t.length===6&&_.length!==6&&!n&&!e.attemptsExhausted&&$(t)}}),a("span",{className:`sekyro-help sekyro-otp-expiry${h?" is-danger":""}`,"aria-hidden":!h||void 0,children:h?i("emailOtp.expired"):i("emailOtp.expiresIn",{time:ve(S)})})]}),a("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:h?i("emailOtp.expired"):""}),o(N,{children:[a(k,{type:"submit",full:!0,disabled:n||_.length!==6,"aria-busy":n||void 0,children:i("emailOtp.verify")}),o("div",{className:"sekyro-resend-row",children:[a("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:n||E>0,onClick:()=>D(!0),children:E>0?i("emailOtp.resendIn",{seconds:E}):i("emailOtp.resend")}),P?a("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:n,onClick:()=>c(!0),"data-testid":"sekyro-otp-change",children:i("emailOtp.changeEmail")}):null]})]})]}):o(C,{children:[e.needsEmail?o("div",{className:"sekyro-field",children:[a("label",{className:"sekyro-label",htmlFor:`${m}-email`,children:i("emailOtp.emailLabel")}),a("input",{id:`${m}-email`,className:"sekyro-input",type:"email",dir:"ltr",inputMode:"email",autoComplete:"email",autoCapitalize:"none",spellCheck:!1,placeholder:i("emailOtp.emailPlaceholder"),value:x,"aria-describedby":`${m}-email-help`,onChange:t=>ie(t.target.value)}),a("span",{id:`${m}-email-help`,className:"sekyro-help",children:i("emailOtp.emailHelper")})]}):a("p",{className:"sekyro-text-muted",children:i("emailOtp.prefilledNotice")}),o(N,{children:[a(k,{type:"submit",full:!0,disabled:n,"aria-busy":n||void 0,children:i("emailOtp.send")}),g&&W?a("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:n,onClick:()=>c(!1),"data-testid":"sekyro-otp-back-to-code",children:i("emailOtp.backToCode")}):null]})]})]})}l(Ae,"EmailOtpView");export{Ae as EmailOtpView};
@@ -0,0 +1,2 @@
1
+ "use client";
2
+ import{a as W,b as B,c as z,d as Z,f as j,g as O}from"./chunk-IAJAM4I6.js";import{d as P,k as Y}from"./chunk-JTDARDD6.js";import"./chunk-AGIBFSCL.js";import"./chunk-7MMT5M4E.js";import{a as G,b as N,c as K}from"./chunk-55NNQK5P.js";import"./chunk-VRDPGOXM.js";import{d as D}from"./chunk-455FWUKU.js";import{a as $,d as T,p as A}from"./chunk-T7C7Q4AN.js";import"./chunk-VBIVDLBE.js";import{a as C,r as R}from"./chunk-3GCHNE7R.js";import{a as d}from"./chunk-2KED7D2Q.js";import{HostedApiError as xe}from"@sekyro/web";import{detectIsMobile as se}from"@sekyro/web/core";import{useEffect as Q,useId as L,useMemo as x,useRef as Ie,useState as _}from"react";var X={"consent.human.terms.intro":"تؤكد Sekyro AI أن شخصًا حقيقيًا يُجري هذه الخطوة، نيابةً عن الجهة التي طلبتها.","consent.human.terms.data":"تلتقط Sekyro AI تسجيلًا قصيرًا لوجهك.","consent.human.terms.processing":"يُفحص هذا التسجيل للتأكد من أنك شخص حقيقي وحاضر، وقد يُقارَن بالوجوه التي سبق التحقق منها لدى هذه الجهة.","consent.human.terms.sharing":"تُبلَّغ الجهة التي طلبت هذا التحقق بنتيجته.","consent.human.terms.retention":"تُخزَّن بياناتك مشفّرة ولا يُحتفظ بها إلا للمدة التي يقتضيها القانون وإعدادات الجهة. لممارسة حقوقك المتعلقة بحماية البيانات، تواصل مع الجهة التي طلبت هذا التحقق.","capture.noCamera.title":"تتطلب هذه الخطوة كاميرا","capture.noCamera.body":"اسمح بالوصول إلى الكاميرا وحاول مرة أخرى، أو تابع على هاتف مزوّد بكاميرا.","capture.noCamera.continue":"المتابعة بدون كاميرا","capture.noCamera.deniedTitle":"اسمح بالوصول إلى الكاميرا","capture.noCamera.deniedBody":"حظر متصفحك الوصول إلى الكاميرا في هذه الصفحة. اسمح به من إعدادات الموقع ثم أعد المحاولة.","choice.title":"كيف تريد المتابعة؟","choice.description":"اختر خيارًا واحدًا.","choice.switch":"استخدم خيارًا آخر","contact.title":"كيف تريد استلام الرمز؟","contact.description":"اختر خيارًا واحدًا.","contact.phone":"عبر الهاتف (واتساب أو رسالة نصية)","contact.email":"عبر البريد الإلكتروني","contact.switch":"استخدم خيارًا آخر","summary.title":"تحقق من بياناتك","summary.description":"تأكد من أن هذه بياناتك قبل الصورة الحية.","summary.fullName":"الاسم الكامل","summary.birthDate":"تاريخ الميلاد","summary.nationality":"الجنسية","summary.documentType":"الوثيقة","summary.documentNumber":"رقم الوثيقة","summary.nni":"الرقم الوطني للتعريف الموريتاني (NNI)","summary.id_number":"رقم الهوية","summary.expiryDate":"تاريخ الانتهاء","summary.portraitAlt":"الصورة المسجلة","summary.source.registry":"من سجل الحالة المدنية","summary.source.document":"مقروءة من وثيقتك","summary.source.chip":"مقروءة من شريحة وثيقتك","summary.name":"الاسم","summary.birthYear":"سنة الميلاد","summary.confirm":"تأكيد ومتابعة","summary.retakeDocument":"مسح وثيقتي مرة أخرى","summary.retakeNationalNumber":"إدخال رقمي مرة أخرى","summary.noRetake":"لم يعد بإمكانك إعادة المحاولة. تواصل مع {org} إذا كانت هذه البيانات غير صحيحة","capture.tipsIcao.title":"لصورة الهوية:","capture.tipsIcao.glasses":"انزع نظارتك","capture.tipsIcao.headwear":"انزع القبعة. يُقبل غطاء الرأس الديني إذا كان الوجه ظاهرًا بالكامل","capture.tipsIcao.expression":"حافظ على تعبير محايد وفمك مغلق","capture.tipsIcao.faceCamera":"انظر مباشرة إلى الكاميرا وعيناك مفتوحتان","capture.tipsIcao.background":"قف أمام خلفية سادة فاتحة اللون","capture.tipsIcao.lighting":"استخدم إضاءة متساوية على وجهك: دون ظلال","capture.tipsIcao.hair":"أبعد شعرك عن وجهك وعينيك","capture.tipsIcao.summary":"قف أمام جدار سادة فاتح اللون مع إضاءة متساوية على وجهك. انزع نظارتك وأي قبعة. أبعد شعرك عن وجهك، وانظر مباشرة إلى الكاميرا وعيناك مفتوحتان، وحافظ على تعبير محايد وفمك مغلق، وابقَ ثابتًا.","portrait.retakeOnly":"نجح التحقق الحي. الصورة فقط تحتاج إلى محاولة أخرى","portrait.keepCamera":"ابقَ أمام الكاميرا","handoff.description":"امسح الرمز بهاتفك للمتابعة","handoff.qrAlt":"رمز QR يفتح عملية التحقق هذه على هاتفك","handoff.copyLink":"نسخ الرابط","handoff.copyFailed":"تعذّر نسخ الرابط. انسخ عنوان هذه الصفحة من متصفحك بدلًا من ذلك","handoff.waiting":"ستنتقل هذه الصفحة تلقائيًا بعد أن تُكمل الخطوة على هاتفك","inApp.title":"افتح الصفحة في متصفحك","inApp.description":"لا تعمل الكاميرا جيدًا داخل هذا التطبيق. افتح الرابط في Chrome أو Safari للمتابعة.","inApp.copyLink":"نسخ الرابط","inApp.copied":"تم نسخ الرابط. الصقه في متصفحك","inApp.copyFailed":"تعذّر نسخ الرابط. انسخ عنوان هذه الصفحة بدلًا من ذلك","inApp.continueAnyway":"المتابعة هنا على أي حال","inApp.openBrowser":"افتح في المتصفح"};var M={"consent.human.terms.intro":"Sekyro AI confirms that a real person is completing this step, on behalf of the organization that asked for it.","consent.human.terms.data":"Sekyro AI collects a short capture of your face.","consent.human.terms.processing":"The capture is checked to confirm that you are a real person who is present. It may be compared with faces already verified for this organization.","consent.human.terms.sharing":"The organization that requested this verification learns its outcome.","consent.human.terms.retention":"Your data is stored encrypted and kept only as long as the law and the organization's settings require. To exercise your data-protection rights, contact the organization that requested this verification.","capture.noCamera.title":"This step needs a camera","capture.noCamera.body":"Allow camera access and try again, or continue on a phone with a camera.","capture.noCamera.continue":"Continue without a camera","capture.noCamera.deniedTitle":"Allow camera access","capture.noCamera.deniedBody":"Your browser blocked the camera for this page. Allow it in the site settings, then try again.","choice.title":"Choose how to continue","choice.description":"Choose one option.","choice.switch":"Use another option","contact.title":"Where to send your code","contact.description":"Choose one option.","contact.phone":"By phone (WhatsApp or SMS)","contact.email":"By email","contact.switch":"Use another option","summary.title":"Check your details","summary.description":"Make sure this is you before the live photo.","summary.fullName":"Full name","summary.birthDate":"Date of birth","summary.nationality":"Nationality","summary.documentType":"Document","summary.documentNumber":"Document number","summary.nni":"Mauritanian national ID number (NNI)","summary.id_number":"ID number","summary.expiryDate":"Expiry date","summary.portraitAlt":"Photo on record","summary.source.registry":"From the civil registry","summary.source.document":"Read from your document","summary.source.chip":"Read from your document's chip","summary.name":"Name","summary.birthYear":"Year of birth","summary.confirm":"Confirm and continue","summary.retakeDocument":"Scan my document again","summary.retakeNationalNumber":"Enter my number again","summary.noRetake":"You can't try again. Contact {org} if these details are wrong","capture.tipsIcao.title":"For your ID photo:","capture.tipsIcao.glasses":"Remove your glasses","capture.tipsIcao.headwear":"Remove hats and caps. A religious head covering is fine if your whole face shows","capture.tipsIcao.expression":"Keep a neutral expression with your mouth closed","capture.tipsIcao.faceCamera":"Look straight at the camera with your eyes open","capture.tipsIcao.background":"Stand in front of a plain, light background","capture.tipsIcao.lighting":"Use even light on your face: no shadows","capture.tipsIcao.hair":"Keep your hair away from your face and eyes","capture.tipsIcao.summary":"Stand in front of a plain, light wall with even light on your face. Remove your glasses and any hat. Keep your hair off your face, look straight at the camera with your eyes open, keep a neutral expression with your mouth closed, and hold still.","portrait.retakeOnly":"Your live check passed. Only the photo needs another try","portrait.keepCamera":"Stay in front of the camera","handoff.description":"Scan with your phone to continue","handoff.qrAlt":"QR code that opens this verification on your phone","handoff.copyLink":"Copy link","handoff.copyFailed":"We couldn't copy the link. Copy this page's address from your browser instead","handoff.waiting":"This page moves on by itself once you finish on your phone","inApp.title":"Open in your browser","inApp.description":"The camera doesn't work well inside this app. Open the link in Chrome or Safari to continue.","inApp.copyLink":"Copy link","inApp.copied":"Link copied. Paste it in your browser","inApp.copyFailed":"We couldn't copy the link. Copy this page's address instead","inApp.continueAnyway":"Continue here anyway","inApp.openBrowser":"Open in browser"};var J={"consent.human.terms.intro":"Sekyro AI confirme qu'une personne réelle effectue cette étape, pour le compte de l'organisme qui l'a demandée.","consent.human.terms.data":"Sekyro AI recueille une courte capture de votre visage.","consent.human.terms.processing":"La capture est analysée pour confirmer que vous êtes une personne réelle et présente. Elle peut être comparée aux visages déjà vérifiés pour cet organisme.","consent.human.terms.sharing":"L'organisme qui a demandé cette vérification est informé de son résultat.","consent.human.terms.retention":"Vos données sont stockées chiffrées et conservées uniquement pendant la durée exigée par la loi et les paramètres de l'organisme. Pour exercer vos droits en matière de protection des données, contactez l'organisme qui a demandé cette vérification.","capture.noCamera.title":"Une caméra est nécessaire","capture.noCamera.body":"Autorisez l'accès à la caméra et réessayez, ou continuez sur un téléphone équipé d'une caméra.","capture.noCamera.continue":"Continuer sans caméra","capture.noCamera.deniedTitle":"Autorisez la caméra","capture.noCamera.deniedBody":"Votre navigateur a bloqué la caméra pour cette page. Autorisez-la dans les paramètres du site, puis réessayez.","choice.title":"Comment continuer ?","choice.description":"Choisissez une option.","choice.switch":"Utiliser une autre option","contact.title":"Où envoyer votre code ?","contact.description":"Choisissez une option.","contact.phone":"Par téléphone (WhatsApp ou SMS)","contact.email":"Par e-mail","contact.switch":"Utiliser une autre option","summary.title":"Vérifiez vos informations","summary.description":"Assurez-vous qu'il s'agit bien de vous avant la photo en direct.","summary.fullName":"Nom complet","summary.birthDate":"Date de naissance","summary.nationality":"Nationalité","summary.documentType":"Document","summary.documentNumber":"Numéro du document","summary.nni":"Numéro national d'identification mauritanien (NNI)","summary.id_number":"Numéro d'identité","summary.expiryDate":"Date d'expiration","summary.portraitAlt":"Photo enregistrée","summary.source.registry":"Issu de l'état civil","summary.source.document":"Lu sur votre document","summary.source.chip":"Lu sur la puce de votre document","summary.name":"Nom","summary.birthYear":"Année de naissance","summary.confirm":"Confirmer et continuer","summary.retakeDocument":"Scanner à nouveau mon document","summary.retakeNationalNumber":"Saisir à nouveau mon numéro","summary.noRetake":"Vous ne pouvez plus réessayer. Contactez {org} si ces informations sont incorrectes","capture.tipsIcao.title":"Pour votre photo d'identité :","capture.tipsIcao.glasses":"Retirez vos lunettes","capture.tipsIcao.headwear":"Retirez chapeau et casquette. Un couvre-chef religieux est accepté si tout le visage est visible","capture.tipsIcao.expression":"Gardez une expression neutre, la bouche fermée","capture.tipsIcao.faceCamera":"Regardez la caméra bien en face, les yeux ouverts","capture.tipsIcao.background":"Placez-vous devant un fond uni et clair","capture.tipsIcao.lighting":"Éclairez votre visage de façon uniforme : sans ombres","capture.tipsIcao.hair":"Dégagez vos cheveux du visage et des yeux","capture.tipsIcao.summary":"Placez-vous devant un mur uni et clair, le visage éclairé de façon uniforme. Retirez vos lunettes et tout chapeau. Dégagez vos cheveux du visage, regardez la caméra bien en face, les yeux ouverts, gardez une expression neutre, la bouche fermée, et ne bougez plus.","portrait.retakeOnly":"Votre vérification en direct est validée. Seule la photo est à refaire","portrait.keepCamera":"Restez face à la caméra","handoff.description":"Scannez avec votre téléphone pour continuer","handoff.qrAlt":"Code QR qui ouvre cette vérification sur votre téléphone","handoff.copyLink":"Copier le lien","handoff.copyFailed":"Nous n'avons pas pu copier le lien. Copiez plutôt l'adresse de cette page depuis votre navigateur","handoff.waiting":"Cette page avancera d’elle-même une fois l’étape terminée sur votre téléphone","inApp.title":"Ouvrez dans le navigateur","inApp.description":"La caméra fonctionne mal dans cette application. Ouvrez le lien dans Chrome ou Safari pour continuer.","inApp.copyLink":"Copier le lien","inApp.copied":"Lien copié. Collez-le dans votre navigateur","inApp.copyFailed":"Impossible de copier le lien. Copiez plutôt l'adresse de cette page","inApp.continueAnyway":"Continuer ici quand même","inApp.openBrowser":"Ouvrir dans le navigateur"};var te={M:{perBlock:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26],blocks:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16],formatBits:0},H:{perBlock:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28],blocks:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25],formatBits:2}},ee=20;function pe(e){let t=(16*e+128)*e+64;if(e>=2){let n=Math.floor(e/7)+2;t-=(25*n-10)*n-55,e>=7&&(t-=36)}return t}d(pe,"rawDataModules");function oe(e,t){let{perBlock:n,blocks:o}=te[t],r=n[e-1],a=o[e-1],c=Math.floor(pe(e)/8),s=a-c%a,i=Math.floor(c/a)-r;return[r,s===a?[[a,i]]:[[s,i],[a-s,i+1]]]}d(oe,"blockLayout");var V=d((e,t)=>oe(e,t)[1].reduce((n,[o,r])=>n+o*r,0),"dataCapacity");function E(e,t){let n=0;for(let o=7;o>=0;o-=1)n=n<<1^(n>>>7)*285,n^=(t>>>o&1)*e;return n&255}d(E,"gfMul");function fe(e){let t=new Array(e).fill(0);t[e-1]=1;let n=1;for(let o=0;o<e;o+=1){for(let r=0;r<e;r+=1)t[r]=E(t[r],n),r+1<e&&(t[r]=t[r]^t[r+1]);n=E(n,2)}return t}d(fe,"rsDivisor");function ye(e,t){let n=t.map(()=>0);for(let o of e){let r=o^n.shift();n.push(0),t.forEach((a,c)=>{n[c]=n[c]^E(a,r)})}return n}d(ye,"rsRemainder");function he(e,t,n){let o=[],r=d((u,y)=>{for(let b=y-1;b>=0;b-=1)o.push(u>>>b&1)},"put");r(4,4),r(e.length,t<10?8:16);for(let u of e)r(u,8);let a=V(t,n)*8;r(0,Math.min(4,a-o.length)),r(0,(8-o.length%8)%8);let c=[];for(let u=0;u<o.length;u+=8)c.push(o.slice(u,u+8).reduce((y,b)=>y<<1|b,0));for(let u=236;c.length<V(t,n);u^=253)c.push(u);let[s,i]=oe(t,n),m=fe(s),l=[],h=0;for(let[u,y]of i)for(let b=0;b<u;b+=1){let w=c.slice(h,h+y);h+=y,l.push({data:w,ec:ye(w,m)})}let f=[],g=Math.max(...l.map(u=>u.data.length));for(let u=0;u<g;u+=1)for(let y of l)u<y.data.length&&f.push(y.data[u]);for(let u=0;u<s;u+=1)for(let y of l)f.push(y.ec[u]);return f}d(he,"codewords");function ne(e){if(e===1)return[];let t=Math.floor(e/7)+2,n=Math.ceil((e*4+4)/(t*2-2))*2,o=[6];for(let r=e*4+10;o.length<t;r-=n)o.splice(1,0,r);return o}d(ne,"alignmentPositions");var be=[(e,t)=>(e+t)%2===0,e=>e%2===0,(e,t)=>t%3===0,(e,t)=>(e+t)%3===0,(e,t)=>(Math.floor(e/2)+Math.floor(t/3))%2===0,(e,t)=>e*t%2+e*t%3===0,(e,t)=>(e*t%2+e*t%3)%2===0,(e,t)=>((e+t)%2+e*t%3)%2===0],U=class U{constructor(t){this.size=t,this.dark=new Array(t*t).fill(!1),this.fixed=new Array(t*t).fill(!1)}set(t,n,o){this.dark[t*this.size+n]=o,this.fixed[t*this.size+n]=!0}get(t,n){return this.dark[t*this.size+n]===!0}};d(U,"Grid");var H=U;function ge(e,t){let n=e.size;for(let a=0;a<n;a+=1)e.set(6,a,a%2===0),e.set(a,6,a%2===0);for(let[a,c]of[[3,3],[3,n-4],[n-4,3]])for(let s=-4;s<=4;s+=1)for(let i=-4;i<=4;i+=1){let m=a+s,l=c+i;if(m<0||m>=n||l<0||l>=n)continue;let h=Math.max(Math.abs(s),Math.abs(i));e.set(m,l,h!==2&&h!==4)}let o=ne(t),r=o.length-1;if(o.forEach((a,c)=>o.forEach((s,i)=>{if(!(c===0&&i===0||c===0&&i===r||c===r&&i===0))for(let m=-2;m<=2;m+=1)for(let l=-2;l<=2;l+=1)e.set(a+m,s+l,Math.max(Math.abs(m),Math.abs(l))!==1)})),re(e,0),t>=7){let a=t;for(let s=0;s<12;s+=1)a=a<<1^(a>>>11)*7973;let c=t<<12|a;for(let s=0;s<18;s+=1){let i=(c>>>s&1)===1,m=n-11+s%3,l=Math.floor(s/3);e.set(m,l,i),e.set(l,m,i)}}}d(ge,"drawFunctionPatterns");function re(e,t,n=0){let o=e.size,r=n<<3|t,a=r;for(let i=0;i<10;i+=1)a=a<<1^(a>>>9)*1335;let c=(r<<10|a)^21522,s=d(i=>(c>>>i&1)===1,"bit");for(let i=0;i<=5;i+=1)e.set(i,8,s(i));e.set(7,8,s(6)),e.set(8,8,s(7)),e.set(8,7,s(8));for(let i=9;i<15;i+=1)e.set(8,14-i,s(i));for(let i=0;i<8;i+=1)e.set(8,o-1-i,s(i));for(let i=8;i<15;i+=1)e.set(o-15+i,8,s(i));e.set(o-8,8,!0)}d(re,"drawFormat");function ke(e,t){let n=e.size,o=0;for(let r=n-1;r>=1;r-=2){r===6&&(r=5);for(let a=0;a<n;a+=1)for(let c=0;c<2;c+=1){let s=r-c,m=(r+1&2)===0?n-1-a:a;e.fixed[m*n+s]!==!0&&(o<t.length*8&&(e.dark[m*n+s]=(t[o>>>3]>>>7-(o&7)&1)===1),o+=1)}}}d(ke,"placeData");function we(e,t){let n=be[t];for(let o=0;o<e.size;o+=1)for(let r=0;r<e.size;r+=1)e.fixed[o*e.size+r]!==!0&&n(o,r)&&(e.dark[o*e.size+r]=!e.dark[o*e.size+r])}d(we,"applyMask");function ve(e){let t=e.size,n=0,o=d(a=>{let c=1;for(let s=1;s<=t;s+=1)s<t&&a(s)===a(s-1)?c+=1:(c>=5&&(n+=3+(c-5)),c=1);for(let s=0;s+10<t;s+=1){let i=[!0,!1,!0,!0,!0,!1,!0];if(!(i.every((f,g)=>a(s+g)===f)||i.every((f,g)=>a(s+4+g)===f)))continue;let l=[0,1,2,3].every(f=>!a(s+f))&&i.every((f,g)=>a(s+4+g)===f),h=i.every((f,g)=>a(s+g)===f)&&[7,8,9,10].every(f=>!a(s+f));l&&(n+=40),h&&(n+=40)}},"line");for(let a=0;a<t;a+=1)o(c=>e.get(a,c));for(let a=0;a<t;a+=1)o(c=>e.get(c,a));for(let a=0;a+1<t;a+=1)for(let c=0;c+1<t;c+=1){let s=e.get(a,c);s===e.get(a,c+1)&&s===e.get(a+1,c)&&s===e.get(a+1,c+1)&&(n+=3)}let r=e.dark.filter(Boolean).length;return n+=Math.floor(Math.abs(r*20-t*t*10)/(t*t))*10,n}d(ve,"penalty");function ae(e,t={}){let n=t.ecl??"M",o=new TextEncoder().encode(e),r=1;for(;r<=ee&&!(4+(r<10?8:16)+o.length*8<=V(r,n)*8);r+=1);if(r>ee)throw new RangeError("text too long for a QR code");let a=he(o,r,n),c=d(m=>{let l=new H(r*4+17);return ge(l,r),ke(l,a),we(l,m),re(l,m,te[n].formatBits),l},"build"),s=null;if(t.mask!==void 0)s=c(t.mask);else{let m=Number.POSITIVE_INFINITY;for(let l=0;l<8;l+=1){let h=c(l),f=ve(h);f<m&&(m=f,s=h)}}let i=s;return{size:i.size,get:d((m,l)=>i.get(m,l),"get")}}d(ae,"encodeQr");var F=.42,Se=.2,k=d(e=>{let t=Math.round(e*1e3)/1e3;return String(t===0?0:t)},"num");function I(e,t,n,o){let r=`A${k(o)} ${k(o)} 0 0 1 `;return`M${k(e+o)} ${k(t)}H${k(e+n-o)}${r}${k(e+n)} ${k(t+o)}V${k(t+n-o)}${r}${k(e+n-o)} ${k(t+n)}H${k(e+o)}${r}${k(e)} ${k(t+n-o)}V${k(t+o)}${r}${k(e+o)} ${k(t)}Z`}d(I,"roundedSquare");function Ce(e){let t=(e-17)/4,n=ne(t),o=n.length-1,r=[];return n.forEach((a,c)=>n.forEach((s,i)=>{c===0&&i===0||c===0&&i===o||c===o&&i===0||r.push([a,s])})),r}d(Ce,"alignmentCentres");function ie(e,{quiet:t=4,logo:n=!1}={}){let o=e.size,r=d((u,y)=>u<7&&y<7||u<7&&y>=o-7||u>=o-7&&y<7,"isFinder"),a=Math.floor(o*Se),c=n?a%2===0?a-1:a:0,s=(o-c)/2,i=d((u,y)=>c>0&&u>=s&&u<s+c&&y>=s&&y<s+c,"inZone"),m=Ce(o).filter(([u,y])=>!i(u,y)),l=d((u,y)=>m.some(([b,w])=>Math.abs(u-b)<=2&&Math.abs(y-w)<=2),"isAlign"),h=`a${k(F)} ${k(F)} 0 1 0 `,f="";for(let u=0;u<o;u+=1)for(let y=0;y<o;y+=1)!e.get(u,y)||r(u,y)||l(u,y)||i(u,y)||(f+=`M${k(y+t+.5-F)} ${k(u+t+.5)}${h}${k(2*F)} 0${h}${k(-2*F)} 0Z`);let g="";for(let[u,y]of[[0,0],[0,o-7],[o-7,0]]){let b=y+t,w=u+t;g+=I(b,w,7,1.6)+I(b+1,w+1,5,.6)+I(b+2,w+2,3,.6)}for(let[u,y]of m){let b=y-2+t,w=u-2+t;g+=I(b,w,5,1.2)+I(b+1,w+1,3,.5)+I(b+2,w+2,1,.5)}return{size:o+t*2,dots:f,finders:g,logo:c>0?{x:s+t+.5,y:s+t+.5,size:c-1}:null}}d(ie,"styledQr");import{Fragment as q,jsx as p,jsxs as v}from"react/jsx-runtime";var Ae={en:M,fr:J,ar:X,es:M,pt:M,de:M},ce={en:N,fr:K,ar:G,es:N,pt:N,de:N};function S(e){let t=e.strings;return(n,o)=>D(t[n]??Ae[e.locale][n]??"",o)}d(S,"flowT");function ue(e,t){let n=S(t);return e.flatMap(o=>{let r=o.service==="phone_otp"?n("contact.phone"):o.service==="email_otp"?n("contact.email"):B(o,t),a=W[o.service];return r===null?[]:[{id:o.id,label:r,...a!==void 0?{glyph:p($,{name:a})}:{}}]})}d(ue,"labelled");function le({step:e,i18n:t,onError:n}){let o=S(t),{busy:r,error:a,run:c}=z(t,n),s=e.kind==="contact_choice";return p(P,{title:o(s?"contact.title":"choice.title"),description:o(s?"contact.description":"choice.description"),options:ue(e.choice.options,t),busy:r,error:a,focus:!0,testId:s?"sekyro-contact-choice":"sekyro-choice",onChoose:i=>c(()=>e.choose(i))})}d(le,"PlanChoiceView");var st=le,ct=le;function ut({step:e,i18n:t,onError:n,onOpen:o}){let r=S(t),{busy:a,error:c,run:s}=z(t,n),i=e,m=e.context.switchable,l=m===void 0?[]:m.options.filter(b=>b.id!==m.current),h=i.kind==="registry"&&(i.reason==="nni_not_found"||i.reason==="registry_record_not_found")&&i.canUseDocument||i.kind==="eid"&&i.reason?.startsWith("eid_")&&i.canUseCamera,f=l.length===1?l[0]:void 0,g=f!==void 0&&(f.service==="phone_otp"||f.service==="email_otp"),u=g&&i.canSwitch&&i.switchTo!==void 0?()=>i.switchTo.call(e):i.chooseOption===void 0||f===void 0?void 0:()=>i.chooseOption.call(e,f.id);if(l.length===0||h||f!==void 0&&(u===void 0||y()===null)||f===void 0&&i.chooseOption===void 0)return null;function y(){return f===void 0?r("choice.switch"):f.service==="phone_otp"||f.service==="email_otp"?r("contact.switch"):i.kind==="registry"&&f.service==="document"?t.t("population.useDocument"):i.kind==="eid"?t.strings["eid.useCamera"]??ce[t.locale]["eid.useCamera"]:B(f,t)}return d(y,"labelOf"),v("div",{className:"sekyro-stack sekyro-stack--1",children:[c!==null?p(A,{tone:"danger",children:p("span",{children:c})}):null,p(C,{kind:"secondary",disabled:a,"aria-busy":a||void 0,onClick:()=>u===void 0?o():s(u),"data-testid":g?"sekyro-contact-switch":"sekyro-lane-switch",children:y()})]})}d(ut,"LaneSwitch");function lt({step:e,i18n:t,onError:n,onClose:o}){let r=S(t),{busy:a,error:c,run:s}=z(t,n),i=e.context.switchable,m=e.chooseOption;return i===void 0||m===void 0?null:p(P,{title:r("choice.title"),description:r("choice.description"),options:ue(i.options,t),...i.current!==null?{marked:i.current}:{},busy:a,error:c,focus:!0,testId:"sekyro-lane-choice",onChoose:l=>l===i.current?o():s(()=>m.call(e,l))})}d(lt,"LaneChoiceView");var Ne=[["fullName","summary.fullName",!1],["birthDate","summary.birthDate",!0],["birthYear","summary.birthYear",!0],["nationality","summary.nationality",!0],["documentType","summary.documentType",!1],["documentNumberMasked","summary.documentNumber",!0],["idNumberMasked","summary.id_number",!0],["expiryDate","summary.expiryDate",!0]];function ze(e){let[t,n]=_(null);return Q(()=>{if(!e.portraitAvailable)return;let o=!0,r=null;return e.portrait().then(a=>{!o||a===null||!a.type.startsWith("image/")||typeof URL.createObjectURL!="function"||(r=URL.createObjectURL(a),n(r))}),()=>{o=!1,r!==null&&URL.revokeObjectURL(r)}},[e.portraitAvailable]),t}d(ze,"usePortraitUrl");var Me=d(e=>/^\d{4}-\d{2}-\d{2}$/.test(e),"isoDate");function Fe(e,t){try{return new Intl.DateTimeFormat(t==="ar"?"ar-u-nu-latn":t,{day:"numeric",month:"long",year:"numeric",timeZone:"UTC"}).format(new Date(`${e}T00:00:00Z`))}catch{return e}}d(Fe,"formatDate");function mt({step:e,i18n:t,onError:n}){let o=S(t),r=L(),a=R(),c=ze(e),{busy:s,error:i,run:m}=z(t,n),l=e.context.orgName,h=["registry","document","chip"].find(u=>u===e.source),f=e.summaryKind==="partial",g=d(u=>t.strings[`doc.type.${u}`]??u,"documentLabel");return v("section",{className:"sekyro-step","aria-labelledby":r,"data-testid":"sekyro-identity-summary",children:[v("div",{className:"sekyro-heading",children:[p("h2",{id:r,ref:a,tabIndex:-1,className:"sekyro-text-body",children:o("summary.title")}),p("p",{className:"sekyro-text-muted",children:o("summary.description")})]}),h!==void 0?p("p",{className:"sekyro-summary__source",children:o(`summary.source.${h}`)}):null,v("div",{className:"sekyro-summary",children:[c!==null?p("img",{className:"sekyro-summary__portrait",src:c,alt:o("summary.portraitAlt")}):null,p("dl",{className:"sekyro-summary__list",children:Ne.map(([u,y,b])=>{let w=u==="idNumberMasked"?e.idNumberMasked??e.nniMasked:e[u];return w===void 0?null:v("div",{className:"sekyro-summary__row",children:[p("dt",{className:"sekyro-text-muted",children:o(u==="fullName"&&f?"summary.name":y)}),p("dd",{children:Me(w)?Fe(w,t.locale):b?p("bdi",{dir:"ltr",children:w}):u==="documentType"?g(w):w})]},u)})})]}),i!==null?p(A,{tone:"danger",children:p("span",{children:i})}):null,e.retakeAvailable?null:p("p",{className:"sekyro-text-muted",children:o("summary.noRetake",{org:l})}),v(T,{children:[p(C,{full:!0,disabled:s,"aria-busy":s||void 0,onClick:()=>m(()=>e.confirm()),children:o("summary.confirm")}),e.retakeAvailable?p(C,{kind:"secondary",full:!0,disabled:s,onClick:()=>m(()=>e.retake()),children:o(e.retakeTarget==="national_number"?"summary.retakeNationalNumber":"summary.retakeDocument")}):null]})]})}d(mt,"IdentitySummaryView");var _e=["glasses","headwear","expression","faceCamera","background","lighting","hair"];function dt({step:e,i18n:t,livenessProps:n,sekyroIntro:o}){let r=S(t),[a,c]=_(null);Q(()=>e.onLivePhoto(u=>{let y=u.update?.coach;c(u.holding||y===void 0?null:t.t(`portrait.coach.${y}`))}),[e,t]);let s=e.instructions==="icao",i=e.icao?.profile==="selfie",m=x(()=>s?_e.filter(u=>!i||u!=="background").map(u=>({id:u,text:r(`capture.tipsIcao.${u}`)})):void 0,[s,i,t]),l=x(()=>s&&!i?{...n.strings,"capture.tips.title":r("capture.tipsIcao.title")}:n.strings,[s,i,n.strings,t]),h=i?void 0:r("capture.tipsIcao.title"),f=x(()=>o===!0&&m!==void 0?{...n.slots,intro:d((u,y)=>p(Z,{start:u,context:y,tips:m,...h!==void 0?{tipsTitle:h}:{}}),"intro")}:n.slots,[o,m,h,n.slots,t]),g=i?`${(m??[]).map(u=>u.text).join(". ")}.`:r("capture.tipsIcao.summary");return p(Y,{...n,...f!==void 0?{slots:f}:{},...l!==void 0?{strings:l}:{},...m!==void 0?{tips:m,tipsSummary:g}:{},coach:a})}d(dt,"LivePhotoLiveness");function pt({i18n:e}){let t=S(e);return v(A,{tone:"info",children:[p("strong",{children:t("portrait.retakeOnly")}),p("span",{children:t("portrait.keepCamera")})]})}d(pt,"PortraitRetakeNotice");function ft({i18n:e,provider:t}){let n=e.strings,o=d(r=>n[r]??ce[e.locale][r]??"","pick");return p("p",{className:"sekyro-text-muted","data-testid":"sekyro-eid-continue",children:t?D(o("eid.continueHint"),{provider:t}):o("eid.continueHintGeneric")})}d(ft,"EidContinueHint");async function Re(e){try{return await navigator.clipboard.writeText(e),!0}catch{return!1}}d(Re,"copy");function me({url:e,i18n:t,label:n,primary:o}){let r=S(t),[a,c]=_("idle"),s=n.startsWith("inApp.")?"inApp":"handoff";return v("div",{className:"sekyro-stack sekyro-stack--1",children:[p(C,{kind:o?"primary":"secondary",full:!0,onClick:()=>{Re(e).then(i=>c(i?"copied":"failed"))},children:r(n)}),p("p",{role:"status","aria-live":"polite",className:"sekyro-text-muted",children:a==="idle"?"":r(`${s}.${a==="copied"?"copied":"copyFailed"}`)})]})}d(me,"CopyLink");function de({url:e,i18n:t,refresh:n,footer:o,logoUrl:r}){let a=S(t),c=L(),[s,i]=_(!1),m=r!==void 0&&r!==""&&!s,l=x(()=>{try{return ie(ae(e,{ecl:m?"H":"M"}),{logo:m})}catch{return null}},[e,m]),h=Ie(n);h.current=n;let f=R();return Q(()=>{let g=setInterval(()=>{(typeof document>"u"||document.visibilityState!=="hidden")&&h.current?.().catch(()=>{})},5e3);return()=>clearInterval(g)},[]),v("section",{className:"sekyro-step sekyro-handoff","aria-labelledby":c,"data-testid":"sekyro-handoff",children:[v("div",{className:"sekyro-heading",children:[p("h2",{id:c,ref:f,tabIndex:-1,className:"sekyro-text-body",children:t.t("handoff.title")}),p("p",{className:"sekyro-text-muted",children:a("handoff.description")})]}),l!==null?v("svg",{className:"sekyro-qr",viewBox:`0 0 ${l.size} ${l.size}`,role:"img","aria-label":a("handoff.qrAlt"),children:[p("rect",{width:l.size,height:l.size,className:"sekyro-qr__bg"}),p("path",{d:l.dots,className:"sekyro-qr__fg"}),p("path",{d:l.finders,className:"sekyro-qr__fg",fillRule:"evenodd"}),l.logo!==null&&r!==void 0?p("image",{href:r,x:l.logo.x,y:l.logo.y,width:l.logo.size,height:l.logo.size,preserveAspectRatio:"xMidYMid meet",onError:()=>i(!0)}):null]}):null,v("p",{className:"sekyro-handoff__waiting",role:"status",children:[p("span",{className:"sekyro-handoff__pulse","aria-hidden":"true"}),a("handoff.waiting")]}),v(T,{children:[p(me,{url:e,i18n:t,label:"handoff.copyLink"}),o??null]})]})}d(de,"HandoffView");var Le=["intro","data","processing","sharing","retention"];function yt({i18n:e}){let t=S(e);return p(q,{children:Le.map(n=>p("p",{children:t(`consent.human.terms.${n}`)},n))})}d(yt,"HumanConsentTerms");function ht({url:e,i18n:t,logoUrl:n}){return x(()=>!se(),[])?p(de,{url:e,i18n:t,...n!==void 0?{logoUrl:n}:{}}):null}d(ht,"DesktopHandoffView");function bt({i18n:e,cause:t,onRetry:n,onContinue:o,handoffUrl:r,logoUrl:a}){let c=S(e),s=L(),i=R(),[m,l]=_("idle"),h=x(()=>r!==void 0&&!se(),[r]),f=t==="denied",g=d(()=>{o!==void 0&&(l("busy"),o(t).then(()=>l("idle"),b=>l(b instanceof xe&&b.code==="check_out_of_order"?"idle":"failed")))},"end"),u=v(q,{children:[p(C,{full:!0,kind:f||o===void 0?"primary":"secondary",onClick:n,children:e.t("common.retry")}),o!==void 0?p(C,{full:!0,kind:f?"secondary":"primary",disabled:m==="busy","aria-busy":m==="busy"||void 0,onClick:g,children:c("capture.noCamera.continue")}):null]}),y=m==="failed"?p(A,{tone:"danger",children:p("span",{children:e.t("errors.network_error")})}):null;return h&&r!==void 0?v("section",{className:"sekyro-stack sekyro-stack--4","aria-labelledby":s,"data-testid":"sekyro-no-camera","data-cause":t,children:[p(de,{url:r,i18n:e,...a!==void 0?{logoUrl:a}:{}}),p("h2",{id:s,ref:i,tabIndex:-1,className:"sekyro-text-body",children:c(f?"capture.noCamera.deniedTitle":"capture.noCamera.title")}),p("p",{className:"sekyro-text-muted",children:c(f?"capture.noCamera.deniedBody":"capture.noCamera.body")}),y,p("div",{className:"sekyro-stack sekyro-stack--3",children:u})]}):v(O,{tone:f?"warning":"neutral",icon:"camera",titleId:s,title:c(f?"capture.noCamera.deniedTitle":"capture.noCamera.title"),testId:"sekyro-no-camera",actions:u,children:[p("p",{children:c(f?"capture.noCamera.deniedBody":"capture.noCamera.body")}),y]})}d(bt,"NoCameraView");function gt({url:e,i18n:t,onContinue:n}){let o=S(t),r=L(),a=x(()=>j(e),[e]);return p(O,{tone:"brand",icon:"external",titleId:r,title:o("inApp.title"),testId:"sekyro-in-app",actions:v(q,{children:[a!==null?v("a",{className:"sekyro-btn sekyro-btn--primary sekyro-btn--full",href:a,"data-testid":"sekyro-open-browser",children:[p($,{name:"external"}),o("inApp.openBrowser")]}):null,p(me,{url:e,i18n:t,label:"inApp.copyLink",primary:a===null}),p(C,{kind:"ghost",full:!0,onClick:n,children:o("inApp.continueAnyway")})]}),children:p("p",{children:o("inApp.description")})})}d(gt,"InAppBrowserPrompt");export{st as ContactChoiceView,ht as DesktopHandoffView,ft as EidContinueHint,ct as GenericChoiceView,de as HandoffView,yt as HumanConsentTerms,mt as IdentitySummaryView,gt as InAppBrowserPrompt,lt as LaneChoiceView,ut as LaneSwitch,dt as LivePhotoLiveness,bt as NoCameraView,pt as PortraitRetakeNotice};