@sekyro/elements 0.1.0-rc.31 → 0.1.0-rc.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/cdn/chunks/{capture-session-doc-2JNGYSH6-GFUM3RZY.js → capture-session-doc-2GJ726S6-2H3IPQT3.js} +1 -1
- package/dist/cdn/chunks/{chunk-V6PELUV7.js → chunk-647NLEGV.js} +1 -1
- package/dist/cdn/chunks/{chunk-5OPKZZON.js → chunk-B4B5NNWF.js} +1 -1
- package/dist/cdn/chunks/{chunk-JICBF2XL.js → chunk-C4H77SCY.js} +1 -1
- package/dist/cdn/chunks/{chunk-7V3YMJPI.js → chunk-DCDSAYG4.js} +1 -1
- package/dist/cdn/chunks/{chunk-DO66BOHU.js → chunk-ERJRG52Z.js} +1 -1
- package/dist/cdn/chunks/{chunk-HTIKUYTU.js → chunk-F3BSTTXB.js} +1 -1
- package/dist/cdn/chunks/{chunk-AKU6DWJM.js → chunk-G4FFU5ST.js} +1 -1
- package/dist/cdn/chunks/chunk-GP6QFI3S.js +33 -0
- package/dist/cdn/chunks/chunk-HOEI5HQR.js +1 -0
- package/dist/cdn/chunks/{chunk-XVHJIXFH.js → chunk-HVC5SOWQ.js} +1 -1
- package/dist/cdn/chunks/{chunk-EB2QC3GA.js → chunk-K3XSP444.js} +1 -1
- package/dist/cdn/chunks/{chunk-5AGMJYMI.js → chunk-L2THMRAZ.js} +1 -1
- package/dist/cdn/chunks/{chunk-SYUAQ7BF.js → chunk-LK5ZZB5W.js} +1 -1
- package/dist/cdn/chunks/{chunk-PWGUNXYH.js → chunk-MZETEVSB.js} +1 -1
- package/dist/cdn/chunks/chunk-PQGILDKC.js +1 -0
- package/dist/cdn/chunks/chunk-QYOVP3SU.js +1 -0
- package/dist/cdn/chunks/{chunk-SOCYEC7N.js → chunk-S67OYV2K.js} +1 -1
- package/dist/cdn/chunks/chunk-WX5XRIRN.js +1 -0
- package/dist/cdn/chunks/{chunk-4MHDMYKP.js → chunk-XVONSDHT.js} +1 -1
- package/dist/cdn/chunks/chunk-XY3RKF2D.js +3 -0
- package/dist/cdn/chunks/{create-document-capture-DNJSSCWA-M73L4ODE.js → create-document-capture-NUZAIYUH-XUGCJ7DH.js} +1 -1
- package/dist/cdn/chunks/document-capture-view-HKEUWRPE-RG7TBRYZ.js +1 -0
- package/dist/cdn/chunks/{eid-view-XM5VHPPM-6KKXEHDA.js → eid-view-Y5OFAHVC-J7PHT73P.js} +1 -1
- package/dist/cdn/chunks/{email-otp-view-RQV5WU3T-TP222TAL.js → email-otp-view-ZEVLA5UZ-EEPZQDQ2.js} +1 -1
- package/dist/cdn/chunks/flow-views-ARNNXDI4-DG6547SK.js +1 -0
- package/dist/cdn/chunks/{form-view-Z7ODA3GO-2R5H32O2.js → form-view-PQQO4VIK-UMDKNDGI.js} +1 -1
- package/dist/cdn/chunks/overlay-de-QAMFKRTE-YSXFO53C.js +1 -0
- package/dist/cdn/chunks/overlay-es-5RUP36SI-HFW77Y5Z.js +1 -0
- package/dist/cdn/chunks/overlay-pt-7EUG7TIT-FUKZ7M5O.js +1 -0
- package/dist/cdn/chunks/plan-runner-BFNZHO4C-7RPJM7XJ.js +1 -0
- package/dist/cdn/chunks/portrait-capture-view-EKCFW3YQ-RBLI5X5Y.js +1 -0
- package/dist/cdn/chunks/portrait-review-view-NKIVRFCL-UAYMHF4D.js +1 -0
- package/dist/cdn/chunks/proof-of-address-view-HYTT7NHY-2DKOEB3I.js +1 -0
- package/dist/cdn/define.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/{chunk-W4G27O4B.js → chunk-25BK7D5W.js} +1 -1
- package/dist/chunk-2Z5FHSRB.js +33 -0
- package/dist/{chunk-3DAPWPSR.js → chunk-73ETQUUL.js} +1 -1
- package/dist/{chunk-YHNEYMR2.js → chunk-B7CZCSMF.js} +1 -1
- package/dist/{chunk-BA2AJKJM.js → chunk-ENB7AFED.js} +1 -1
- package/dist/{chunk-QEDULGVW.js → chunk-FV5OWBNU.js} +1 -1
- package/dist/{chunk-SVNDR2JE.js → chunk-HFOCTDYM.js} +1 -1
- package/dist/{chunk-WQIU4I3K.js → chunk-N2BPYCKG.js} +1 -1
- package/dist/{chunk-35LCXJCF.js → chunk-N3WQ4QSD.js} +1 -1
- package/dist/chunk-NAURWQ6C.js +1 -0
- package/dist/{chunk-A5EHF3BR.js → chunk-RV6PEFNT.js} +1 -1
- package/dist/{chunk-CMJWPBX6.js → chunk-TC5736OF.js} +1 -1
- package/dist/chunk-Y7JBM2YL.js +1 -0
- package/dist/define.cjs +5 -5
- package/dist/define.js +1 -1
- package/dist/document-capture-view-HKEUWRPE-KB4IVUEE.js +1 -0
- package/dist/{eid-view-XM5VHPPM-XKR4NZTZ.js → eid-view-Y5OFAHVC-NUZ7QUBA.js} +1 -1
- package/dist/{email-otp-view-RQV5WU3T-JY72E4XM.js → email-otp-view-ZEVLA5UZ-LAXHM22A.js} +1 -1
- package/dist/flow-views-ARNNXDI4-YXYLG7SQ.js +1 -0
- package/dist/{form-view-Z7ODA3GO-2ONECUO5.js → form-view-PQQO4VIK-H7PE6SJF.js} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +1 -1
- package/dist/overlay-de-QAMFKRTE-Q37YV6YD.js +1 -0
- package/dist/overlay-es-5RUP36SI-N7N3ULGK.js +1 -0
- package/dist/overlay-pt-7EUG7TIT-5S423QBY.js +1 -0
- package/dist/portrait-capture-view-EKCFW3YQ-7UBYR6BX.js +1 -0
- package/dist/portrait-review-view-NKIVRFCL-IP7ZWZ6B.js +1 -0
- package/dist/proof-of-address-view-HYTT7NHY-QFJ33FM2.js +1 -0
- package/dist/styles.css +3 -1
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/cdn/chunks/chunk-44UA2IDQ.js +0 -1
- package/dist/cdn/chunks/chunk-6T7VBPLY.js +0 -3
- package/dist/cdn/chunks/chunk-EGCT7K5E.js +0 -1
- package/dist/cdn/chunks/chunk-LBEHJATK.js +0 -1
- package/dist/cdn/chunks/chunk-PRZX4CTP.js +0 -33
- package/dist/cdn/chunks/chunk-Y6MS7VVL.js +0 -1
- package/dist/cdn/chunks/chunk-ZWGMVZWP.js +0 -1
- package/dist/cdn/chunks/document-capture-view-RFBBBM3S-MO6WL377.js +0 -1
- package/dist/cdn/chunks/flow-views-GYVML5BT-MTJUSGHX.js +0 -1
- package/dist/cdn/chunks/overlay-de-ZQRK2WPD-YEE555KF.js +0 -1
- package/dist/cdn/chunks/overlay-es-XSQAIH32-DCYWAHRS.js +0 -1
- package/dist/cdn/chunks/overlay-pt-2LMQDJ4F-EWEOFJ27.js +0 -1
- package/dist/cdn/chunks/plan-runner-JXCJC5MM-BF6RMCBJ.js +0 -1
- package/dist/cdn/chunks/portrait-capture-view-ZBOXEM6H-LSOMBP5R.js +0 -1
- package/dist/cdn/chunks/portrait-review-view-BWCMLEID-JA7RWO6C.js +0 -1
- package/dist/cdn/chunks/proof-of-address-view-LW5RYD5I-Q3UXH6YT.js +0 -1
- package/dist/chunk-H7LR746C.js +0 -33
- package/dist/chunk-JGYTOIH7.js +0 -1
- package/dist/chunk-JREXIOVU.js +0 -1
- package/dist/chunk-YLWJXCPT.js +0 -1
- package/dist/document-capture-view-RFBBBM3S-ZNPUP6QX.js +0 -1
- package/dist/flow-views-GYVML5BT-WVKFYYSN.js +0 -1
- package/dist/overlay-de-ZQRK2WPD-FMRJWQQX.js +0 -1
- package/dist/overlay-es-XSQAIH32-VTIW3L6E.js +0 -1
- package/dist/overlay-pt-2LMQDJ4F-BB366XXI.js +0 -1
- package/dist/portrait-capture-view-ZBOXEM6H-PNCYH3WV.js +0 -1
- package/dist/portrait-review-view-BWCMLEID-MAO4RY74.js +0 -1
- package/dist/proof-of-address-view-LW5RYD5I-RDTH7FUR.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as Mr,d as Ar}from"./chunk-SYUAQ7BF.js";import{a as Ir}from"./chunk-AKU6DWJM.js";import{b as Lr,c as Nt}from"./chunk-DO66BOHU.js";import{d as _t}from"./chunk-6T7VBPLY.js";import{c as at}from"./chunk-ZWGMVZWP.js";import{a as xr,b as Rr,c as Nr,d as Ee}from"./chunk-PWGUNXYH.js";import{F as Er,K as xt,L as Rt,a as W,b as de,c as Y,m as Cr,n as Fe,p as _r,q as nt,r as wr,s as Sr,t as wt,u as le,v as me,w as $e,y as St}from"./chunk-EB2QC3GA.js";import{a}from"./chunk-5QL6W6FW.js";import{c as gr,d as vr,e as kr,h as br}from"./chunk-5OPKZZON.js";import{b as Ct}from"./chunk-EGCT7K5E.js";import{g as yr}from"./chunk-6MYG4HWP.js";import{a as l,c as T}from"./chunk-4FHWXBOB.js";var jr=T(W(),1),g=T(de(),1),ne=T(de(),1),ve=T(W(),1),K=T(de(),1),_=T(W(),1),y=T(W(),1),ot=T(W(),1),ye=T(de(),1),nn=T(W(),1),ee=T(W(),1),ct=T(W(),1),Se=T(de(),1),xe=T(de(),1),P=T(de(),1);var ut=T(W(),1),pe=T(W(),1);var J=T(W(),1);var L=T(W(),1),ge=T(W(),1),He=T(W(),1),Ut=T(de(),1),k=T(de(),1);function ce({className:e,children:t}){return(0,g.jsx)("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})}l(ce,"ne");a(ce,"Svg");var jt="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 Tr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,g.jsx)("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"})]})}l(Tr,"pn");a(Tr,"SunIcon");function Hr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,g.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}l(Hr,"fn");a(Hr,"FaceUncoveredIcon");function Or(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,g.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,g.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}l(Or,"mn");a(Or,"PhoneEyeLevelIcon");function Pr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("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"}),(0,g.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}l(Pr,"yn");a(Pr,"LookStraightIcon");function Br(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("path",{d:jt}),(0,g.jsx)("path",{d:"M9 13l2 2 4-4"})]})}l(Br,"gn");a(Br,"CameraCheckIcon");function qr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("path",{d:jt}),(0,g.jsx)("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"})]})}l(qr,"hn");a(qr,"CameraAskIcon");function Vr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("path",{d:jt}),(0,g.jsx)("path",{d:"M3 3l18 18"})]})}l(Vr,"vn");a(Vr,"CameraBlockedIcon");function it({off:e,className:t}){return(0,g.jsxs)(ce,{className:t,children:[(0,g.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,g.jsx)("path",{d:"M4 4l16 16"}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,g.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}l(it,"Ve");a(it,"SpeakerIcon");function Dr(e){return(0,g.jsx)(ce,{...e,children:(0,g.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}l(Dr,"Cn");a(Dr,"CheckIcon");function Fr(e){return(0,g.jsxs)(ce,{className:e.className??"sekyro-spinner",children:[(0,g.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,g.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}l(Fr,"kn");a(Fr,"SpinnerIcon");var Mt=["light","uncover","eyeLevel","straight"],qn={light:{key:"capture.tips.light",icon:a(()=>(0,ne.jsx)(Tr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:a(()=>(0,ne.jsx)(Hr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:a(()=>(0,ne.jsx)(Or,{}),"icon")},straight:{key:"capture.tips.straight",icon:a(()=>(0,ne.jsx)(Pr,{}),"icon")}};function $r({tips:e}){let t=Ee(),n=(0,jr.useId)();return e.length===0?null:(0,ne.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,ne.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,ne.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let s=typeof r=="string"?qn[r]:void 0,i=typeof r=="string"?r:r.id,c=s!==void 0?s.icon():typeof r=="string"?void 0:r.icon,p=s!==void 0?t(s.key):typeof r=="string"?r:r.text;return(0,ne.jsxs)("li",{className:"sekyro-tips__item",children:[c!=null?(0,ne.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:c}):null,(0,ne.jsx)("span",{children:p})]},i)})})]})}l($r,"Sn");a($r,"TipList");var Vn=220;function Kr({title:e,description:t,options:n,busy:r,error:s,focus:i,testId:c,look:p="cards",marked:w,onChoose:h}){let m=(0,ve.useId)(),R=wt(),[x,U]=(0,ve.useState)(null),M=(0,ve.useRef)(null);(0,ve.useEffect)(()=>{s!==null&&U(null)},[s]),(0,ve.useEffect)(()=>()=>{M.current!==null&&clearTimeout(M.current)},[]);let B=a(A=>{r||x!==null||(U(A),M.current=setTimeout(()=>{M.current=null,U(null),h(A)},Vn))},"choose");return(0,K.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":m,"data-testid":c,children:[(0,K.jsxs)("div",{className:p==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,K.jsx)("h2",{id:m,ref:i?R:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,K.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),s!==null?(0,K.jsx)(le,{tone:"danger",children:(0,K.jsx)("span",{children:s})}):null,p==="buttons"?(0,K.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((A,te)=>(0,K.jsx)(Y,{kind:te===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:l(()=>h(A.id),"onClick"),children:A.label},A.id))}):(0,K.jsx)("div",{className:"sekyro-choices",children:n.map(A=>(0,K.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(x??w)===A.id,"aria-busy":r||void 0,disabled:r||x!==null&&x!==A.id,onClick:l(()=>B(A.id),"onClick"),children:[A.glyph!==void 0?(0,K.jsx)("span",{className:"sekyro-card__tile",children:A.glyph}):null,(0,K.jsxs)("span",{className:"sekyro-card__body",children:[(0,K.jsx)("span",{className:"sekyro-card__title",children:A.label}),A.sub!==void 0?(0,K.jsx)("span",{className:"sekyro-card__sub",children:A.sub}):null]}),(0,K.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},A.id))})]})}l(Kr,"Vn");a(Kr,"ChoiceScreen");var Gr=["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","fcv3.one_face","capture.tips.summary","capture.lookAtColours"];function lt(e){return e!==null&&Gr.includes(e)}l(lt,"he");a(lt,"isVoiceKey");var Dn=a((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let s=e[n];r=s!=null&&Dn(s,t)?s[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}l(je,"we");a(je,"resolveClip");var Fn="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",$n={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function oe(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}l(oe,"re");a(oe,"synth");function zr(){return oe()!==null&&typeof SpeechSynthesisUtterance=="function"}l(zr,"Ir");a(zr,"speechAvailable");function At(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}l(At,"wn");a(At,"baseLang");function Tt(e,t){let n=a(s=>s.replace(/_/g,"-").toLowerCase(),"norm"),r=At(t);return e.find(s=>n(s.lang)===n(t))??e.find(s=>At(s.lang)===r)}l(Tt,"_n");a(Tt,"pickVoice");function Wr(e){if(!zr())return!1;let t=[];try{t=oe()?.getVoices()??[]}catch{return!0}return t.length===0||Tt(t,e)!==void 0}l(Wr,"In");a(Wr,"speechUsable");function Zr(e){let t=oe();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}l(Zr,"xn");a(Zr,"subscribeVoices");function Ge(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}l(Ge,"He");a(Ge,"clipIdentity");function Et(e){e.pause(),e.removeAttribute("src"),e.load()}l(Et,"Mn");a(Et,"release");function Qr(){let e=null,t=null,n=0,r=null,s=null,i=null,c=!1,p=null,w=[],h=new Map,m=a(()=>{w=oe()?.getVoices()??[]},"loadVoices"),R=!1,x=a(()=>{let f=oe();R||f===null||(R=!0,m(),f.addEventListener?.("voiceschanged",m))},"bindVoices"),U=a(()=>(e??(e=new Audio),e),"element"),M=a((f,N,S,b)=>{let u=oe();if(u!==null&&f!==""&&typeof SpeechSynthesisUtterance=="function"){x();let E=Tt(w,N);if(w.length===0||E!==void 0){u.cancel();let j=new SpeechSynthesisUtterance(f);j.lang=N,E!==void 0&&(j.voice=E),j.rate=.95,S!==void 0&&(j.onend=S),(S!==void 0||b!==void 0)&&(j.onerror=D=>{b!==void 0&&D.error==="not-allowed"?b():S?.()}),u.speak(j);return}}S?.()},"speak"),B=a(()=>{n+=1,r=null,s=i=null,e!==null&&(e.pause(),e.currentTime=0),oe()?.cancel()},"stop"),A=a(f=>{for(let N of f){let S=Ge(N);if(h.has(S))continue;let b=new Audio;b.preload="auto",b.src=N,h.set(S,b)}},"warmClips"),te=a((f,N,S)=>{let b={utterance:f,generation:N,end:S};p=b;let u=a(()=>N===n&&p===b,"live"),E=a(()=>{u()&&(s=b)},"block");if(oe()?.cancel(),f.url!==null){let j=U();j.pause(),j.muted=!1,j.src=f.url,j.currentTime=0,j.onended=S??null;let D=a(()=>{i===b&&(i=null)},"settled"),o=j.play();if(o===void 0)return;i=b,o.then(D,H=>{if(D(),!u())return;let O=H?.name;if(O!=="AbortError"){if(O==="NotAllowedError")return E();f.speech?M(f.text,f.lang,S,E):S?.()}});return}f.speech?M(f.text,f.lang,S,E):S?.()},"start");return{say(f){let N=f.url!==null?Ge(f.url):`tts:${f.lang}:${f.text}`;if(N===r)return;r=N,s=i=null,n+=1;let S=n,b=f.onEnd;te(f,S,b!==void 0?()=>{S===n&&b()}:void 0)},unlock({lang:f,speech:N,prefetch:S}){let b=s??(c?null:i);c=!0;let u=b!==null&&b.generation===n?b:null;s=i=null,u!==null&&te(u.utterance,u.generation,u.end);let E=U();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let H=Uint8Array.from(atob(Fn),O=>O.charCodeAt(0));t=URL.createObjectURL(new Blob([H],{type:"audio/wav"}))}let j=E.paused===!1&&t!==null&&E.src!==t;t!==null&&!j&&(u===null||u.utterance.url===null)&&(E.muted=!0,E.onended=null,E.src=t,E.play()?.catch(()=>{}));let D=oe(),o=u!==null&&u.utterance.url===null;if(N&&!o&&D!==null&&typeof SpeechSynthesisUtterance=="function"){x();let H=new SpeechSynthesisUtterance(" ");H.volume=0,H.lang=f,D.speak(H)}A(S??[])},prefetch:A,stop:B,dispose(){B(),R&&oe()?.removeEventListener?.("voiceschanged",m),R=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&Et(e),e=null;for(let f of h.values())Et(f);h.clear()}}}l(Qr,"En");a(Qr,"createVoicePlayer");var Kn="sekyro.voiceGuidance";function Xr(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}}l(Xr,"Nn");a(Xr,"readVoicePreference");function Yr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}l(Yr,"Pn");a(Yr,"writeVoicePreference");var Ke="capture.tips.summary",Gn=typeof window<"u"?_.useLayoutEffect:_.useEffect,zn=Object.freeze({});function st(e,t){let n=new Set,r=[];for(let s of Gr){let i=s===Ke?null:je(e,s,t);i===null||n.has(Ge(i))||(n.add(Ge(i)),r.push(i))}return r}l(st,"vt");a(st,"resolvedClipUrls");function Jr({locale:e,defaultClips:t,options:n}){let r=n===!1,s=r?{}:n??{},i=s.storageKey===void 0?Kn:s.storageKey,[c,p]=(0,_.useState)(s.defaultEnabled??!0),w=(0,_.useRef)(c),[h,m]=(0,_.useState)(!1),[R,x]=(0,_.useState)("none"),[U,M]=(0,_.useState)(!1),B=(0,_.useRef)(!1),[A,te]=(0,_.useState)(0),f=(0,_.useRef)(null),N=(0,_.useCallback)(()=>(f.current??(f.current=Qr()),f.current),[]),S=$n[e],b=s.speechFallback,u=b===void 0||b===!0?!0:b===!1?!1:b.includes(e),E=s.clips??t??zn,j=(0,_.useRef)(!1),D=(0,_.useRef)(E);Gn(()=>{D.current=E,w.current=c}),(0,_.useEffect)(()=>{if(r||i===null)return;let I=Xr(i);I!==null&&(w.current=I,p(I))},[r,i]),(0,_.useEffect)(()=>{if(!(r||!u))return Zr(()=>te(I=>I+1))},[r,u]);let o=s.clips;(0,_.useEffect)(()=>{if(r)return;let I=u&&Wr(S);m(st(E,e).length>0||I),x(o!==void 0&&je(o,Ke,e)!==null?"partner":je(E,Ke,e)!==null||I?"default":"none")},[r,E,o,e,u,S,A]),(0,_.useEffect)(()=>{if(r||!c||!j.current)return;let I=st(E,e);I.length>0&&N().prefetch(I)},[r,c,E,e,N]),(0,_.useEffect)(()=>()=>{f.current?.dispose(),f.current=null,j.current=!1},[]);let H=(0,_.useCallback)(I=>{r||(j.current=!0,N().unlock({lang:S,speech:u,...I?{prefetch:st(D.current,e)}:{}}))},[r,N,S,u,e]),O=(0,_.useCallback)(()=>H(w.current),[H]),Z=(0,_.useCallback)(()=>{B.current=!1,M(!1)},[]),F=(0,_.useCallback)(()=>{Z(),f.current?.stop()},[Z]),ke=(0,_.useCallback)(()=>{B.current&&F()},[F]),he=(0,_.useCallback)((I,Re)=>{if(r)return;if(B.current){F();return}let be=N();be.stop(),B.current=!0,M(!0);let q=Re?.clip===!1?null:je(D.current,Ke,e);be.say({url:q,text:I,lang:S,speech:u,onEnd:Z})},[r,F,N,e,S,u,Z]),Q=(0,_.useCallback)(I=>{r||(I?H(!0):F(),i!==null&&Yr(i,I),w.current=I,p(I))},[r,H,F,i]),X=(0,_.useCallback)(()=>Q(!w.current),[Q]),ae=(0,_.useCallback)((I,Re)=>{if(r||!c)return;B.current&&Z();let be=je(D.current,I,e);N().say({url:be,text:Re,lang:S,speech:u})},[r,c,e,N,S,u,Z]);return(0,_.useMemo)(()=>({supported:!r&&h,enabled:!r&&c,setEnabled:Q,toggle:X,unlock:O,speakKey:ae,stop:F,summary:r?"none":R,summaryPlaying:U,toggleSummary:he,stopSummary:ke}),[r,h,c,Q,X,O,ae,F,R,U,he,ke])}l(Jr,"Ct");a(Jr,"useVoiceGuidance");function en(e,t,n,r){let{speakKey:s,stop:i,enabled:c}=e,p=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!r||!c){p.current&&i(),p.current=!1;return}p.current=!0,lt(t)&&t!==Ke&&n!==""&&s(t,n)},[r,c,t,n,s,i])}l(en,"kt");a(en,"useSpeakGuidance");function ze(e,t){let n=tn(e);return n==="face"&&(t==="lighting"||e==="liveness_inconclusive")?"again":n}l(ze,"On");a(ze,"retryCoachingOf");function tn(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}l(tn,"Kr");a(tn,"coachingOfReason");var Te={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},again:{title:"capture.retryTips.title",tips:["capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function rn({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:s}){let i=Ee(),c=(0,ot.useRef)(null);return(0,ot.useEffect)(()=>{r&&c.current?.focus()},[r]),!e&&!r?null:(0,ye.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,ye.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,ye.jsx)("p",{className:"sekyro-text-body",children:i(Te[t].title)}),(0,ye.jsx)("ul",{className:"sekyro-coaching",children:Te[t].tips.map(p=>(0,ye.jsx)("li",{children:i(p)},p))}),n!==null?(0,ye.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,ye.jsx)(Y,{ref:c,className:"sekyro-btn--start",onClick:s,children:i("capture.recordAgain")}):null]})}l(rn,"Hn");a(rn,"CapturedPanel");function Ht(){try{return!1}catch{return!1}}l(Ht,"rt");a(Ht,"isDevBuild");var Wn=(0,nn.createContext)(null);function an({state:e}){let t=Ee(),[n,r]=(0,ct.useState)(!1);(0,ct.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let s=e==="granted"?(0,Se.jsx)(Br,{}):e==="denied"?(0,Se.jsx)(Vr,{}):(0,Se.jsx)(qr,{});return(0,Se.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,Se.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:s}),(0,Se.jsx)("span",{children:t(`capture.permission.${e}`)})]})}l(an,"Gn");a(an,"PermissionRow");function sn({voice:e}){let t=Ee();if(!e.supported)return null;let n=e.enabled;return(0,xe.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:l(()=>e.toggle(),"onClick"),children:[(0,xe.jsxs)("span",{className:"sekyro-switch__label",children:[(0,xe.jsx)(it,{off:!n}),t("capture.voiceGuidance")]}),(0,xe.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,xe.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,xe.jsx)(Dr,{className:"sekyro-switch__check"}):null})})]})}l(sn,"Fn");a(sn,"VoiceSwitch");function ln({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:s,tips:i,summary:c,startLabel:p,startDisabled:w,onStart:h}){let m=Ee(),R=(0,ee.useRef)(c?.stop);R.current=c?.stop,(0,ee.useEffect)(()=>()=>R.current?.(),[]);let x=(0,ee.useRef)(null),U=(0,ee.useRef)(null),M=(0,ee.useRef)(null),B=(0,ee.useRef)(e),A=(0,ee.useRef)(!1);(0,ee.useEffect)(()=>{let u=B.current;if(B.current=e,u===e)return;let E=A.current;e!=="loading"&&(A.current=!1),on(x.current)&&(e==="failed"?M.current?.focus():E&&U.current?.focus())},[e]);let te=(0,ee.useCallback)(()=>{A.current=!0,t()},[t]),f=e==="loading",N=f||w,S=(0,ee.useCallback)(()=>{N||(R.current?.(),h())},[N,h]),b;return e==="failed"?b=(0,P.jsxs)(le,{tone:"danger",testId:"sekyro-assets-error",children:[(0,P.jsx)("p",{className:"sekyro-text-body",children:m("fcv2.err.models")}),(0,P.jsx)(Y,{kind:"ghost",ref:M,className:"sekyro-btn--start",onClick:te,"data-testid":"sekyro-assets-retry",children:m("common.retry")})]}):b=(0,P.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,P.jsx)(Y,{ref:U,full:!0,"data-testid":"sekyro-start","aria-disabled":N?"true":void 0,"aria-busy":f?"true":void 0,onClick:S,children:f?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Fr,{}),m("capture.preparing.title")]}):p??m("capture.start")}),f?(0,P.jsx)("p",{className:"sekyro-text-muted",children:m("capture.preparing.hint")}):null]}),(0,P.jsxs)("div",{ref:x,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,P.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,P.jsx)("h2",{className:"sekyro-text-body",children:m("capture.assisted.title")}),(0,P.jsx)("p",{className:"sekyro-text-muted",children:m("capture.assisted.lead")})]}):null,i!==!1?(0,P.jsx)($r,{tips:i}):null,c!==void 0?(0,P.jsxs)(Y,{kind:"ghost",className:"sekyro-btn--start",onClick:c.toggle,"data-testid":"sekyro-tips-listen",children:[(0,P.jsx)(it,{off:!1}),m(c.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,P.jsx)(an,{state:n}),(0,P.jsx)(sn,{voice:s}),(0,P.jsx)("p",{className:"sekyro-text-muted",children:m("capture.securityNote")}),b,(0,P.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?m("capture.preparing.title"):e==="ready"?m("capture.ready"):""})]})}l(ln,"jn");a(ln,"PreCaptureScreen");function on(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}l(on,"Br");a(on,"focusIsOurs");function cn(){let[e,t]=(0,ut.useState)({state:"unknown",settled:!1});return(0,ut.useEffect)(()=>yr(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}l(cn,"Yn");a(cn,"useCameraStatus");function un(e){return Ot(e,"mobileRequired")}l(un,"$n");a(un,"useMobileRequired");function dn(e){return Ot(e,"returning").required}l(dn,"zn");a(dn,"useReturning");function Ot(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let s=e?.[t];if(e===void 0||typeof s!="function"){r({required:!1,settled:!0});return}let i=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>s.call(e)).then(c=>{i&&r({required:c===!0,settled:!0})},()=>{i&&r({required:!1,settled:!0})}),()=>{i=!1}},[e,t]),n}l(Ot,"Zn");a(Ot,"useFlag");function pn(e){let t=a(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let i=e?.captureMode,c=e?.captureChoice??null;if(e===void 0||typeof i!="function"){r({session:"self",choice:c,settled:!0});return}let p=!0;return r({session:"self",choice:c,settled:!1}),Promise.resolve().then(()=>i.call(e)).then(w=>{let h=e.captureChoice??null;p&&r({session:h!==null&&w===h?"choice":w==="assisted"||w==="choice"?w:"self",choice:h,settled:!0})},()=>{p&&r({session:"self",choice:null,settled:!0})}),()=>{p=!1}},[e]);let s=(0,pe.useCallback)(i=>{e?.chooseCaptureMode?.(i),r(c=>({...c,choice:i}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:s}}l(pn,"Wn");a(pn,"useCaptureMode");function hn(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),s=e.on("result",()=>n(!1));return()=>{r(),s()}},[e]),t}l(hn,"Qn");a(hn,"useBusy");var Zn=a(()=>"idle","serverSnapshot");function Lt(e){return gr(e!==void 0?{assetBaseUrl:e}:{})}l(Lt,"er");a(Lt,"preload");function fn(e,t=!0){let n=(0,J.useSyncExternalStore)((0,J.useCallback)(h=>kr(h,e),[e]),()=>vr(e),Zn),[r,s]=(0,J.useState)(null),i=(0,J.useRef)(!1),c=(0,J.useCallback)(()=>{Lt(e).then(h=>{i.current&&h==="idle"&&s({base:e})})},[e]);(0,J.useEffect)(()=>(i.current=!0,c(),()=>{i.current=!1}),[c]);let p=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(n!=="idle"){p.current={base:e};return}!t||p.current===null||p.current.base!==e||(p.current=null,c())},[n,e,c,t]);let w=(0,J.useCallback)(()=>{Lt(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:w}}l(fn,"tr");a(fn,"useLivenessAssets");var Ur={progress:0,hint:null,faceDetected:!1};function mn(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,L.useRef)(e.verification).current,s=(0,L.useRef)(!1);e.verification!==r&&!s.current&&Ht()&&(s.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 i=(0,L.useRef)(null),[c,p]=(0,L.useState)("idle"),[w,h]=(0,L.useState)(Ur),[m,R]=(0,L.useState)(!1),[x,U]=(0,L.useState)(!1),[M,B]=(0,L.useState)(null),[A,te]=(0,L.useState)(!1),[f,N]=(0,L.useState)(null),[S,b]=(0,L.useState)(null),[u,E]=(0,L.useState)(null),[j,D]=(0,L.useState)(null),[o,H]=(0,L.useState)(null),[O,Z]=(0,L.useState)(!1),F=(0,L.useRef)(null),ke=(0,L.useRef)("idle"),he=(0,L.useRef)(-1),[Q,X]=(0,L.useState)(0),ae=(0,L.useRef)(e);ae.current=e,(0,L.useEffect)(()=>{let re=t.current;if(re===null)return;let ue={video:re,...n!==void 0?{assetBaseUrl:n}:{}},G=r!==void 0?r.liveness(ue):br(ue);i.current=G;let Ne=a(()=>H(G.facingMode??null),"readFacing");Ne();let We=[G.on("state",C=>{C==="mode_switch"?Z(!0):C!=="starting"&&C!=="gating"&&Z(!1),C==="starting"?(ke.current!=="starting"&&(he.current+=1,X(Math.max(0,he.current))),b(null),E(null),h(Ur),U(!1),R(!1),B(null),N(null),F.current=null):C==="gating"&&ke.current==="recording"&&(U(!1),R(!1),B(null),F.current=null),ke.current=C,Ne(),p(C),ae.current.onStateChange?.(C)}),G.on("gate",C=>{let Ce=F.current;F.current=C.progress,R(Ce!==null&&C.progress<Ce-.001&&C.progress>0&&C.progress<1),C.progress>=1&&U(!0),h(C)}),G.on("frozen",({previewDataUrl:C})=>B(C)),G.on("profile",({animations:C})=>te(C==="reduced")),G.on("ramp",({colour:C})=>N(C)),G.on("captured",C=>{b(C),D(null),ae.current.onCaptured?.(C)}),G.on("error",C=>{E(C);let Ce=r?.reportCaptureIssue;Ce!==void 0&&Nt(Le=>Ce.call(r,Le),Lr("liveness",C,Math.max(0,he.current))),ae.current.onError?.(C)}),r?.on("result",C=>{D(C),ae.current.onResult?.(C)})];return()=>{for(let C of We)C?.();i.current=null,G.destroy()}},[r,t,n]);let I=(0,L.useCallback)(()=>{i.current?.start()},[]),Re=(0,L.useCallback)(()=>{i.current?.retry()},[]),be=(0,L.useCallback)(async()=>{let re=i.current;return re===null||typeof re.canSwitchCaptureMode!="function"?!1:await re.canSwitchCaptureMode().catch(()=>!1)===!0},[]),q=(0,L.useCallback)(async re=>{let ue=i.current;if(ue===null||typeof ue.setCaptureMode!="function")return!1;let G=await ue.setCaptureMode(re).catch(()=>!1)===!0;return G&&H(ue.facingMode??null),G},[]);return{state:c,gate:w,draining:m,gateLocked:x,frozenPreview:M,reduceMotion:A,rampColour:f,artifacts:S,error:u,result:j,facingMode:o,start:I,retry:Re,canSwitchCaptureMode:be,setCaptureMode:q,modeRestarted:O,attempt:Q}}l(mn,"rr");a(mn,"useLivenessHandle");var Qn=new Set(["national_number"]);function It(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>Qn.has(n));return t.length>0?{...e,options:t}:null}l(It,"or");a(It,"pending");function yn(e){let[t,n]=(0,ge.useState)(null),[r,s]=(0,ge.useState)(e===void 0),[i,c]=(0,ge.useState)(!1),[p,w]=(0,ge.useState)(!1);(0,ge.useEffect)(()=>{if(n(null),e===void 0){s(!0);return}let R=!0,x=e.methodChoice;typeof x=="function"?(s(!1),Promise.resolve().then(()=>x.call(e)).then(M=>{R&&n(It(M))},()=>{}).finally(()=>{R&&s(!0)})):s(!0);let U=e.on("method",M=>n(It(M)));return()=>{R=!1,U()}},[e]);let h=(0,ge.useCallback)(async R=>{if(e===void 0)return!1;c(!0),w(!1);try{return await e.selectMethod(R),n(null),!0}catch{return w(!0),!1}finally{c(!1)}},[e]),m=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:m==="national_number"&&!p?m:null,settled:r,busy:i,failed:p,select:h}}l(yn,"sr");a(yn,"useMethodChoice");var Xn=["ar","fr","en"];function gn(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}}l(gn,"co");a(gn,"isClipUrl");function vn(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of Xn){let s=t[r];if(!(typeof s!="object"||s===null))for(let[i,c]of Object.entries(s))!lt(i)||!gn(c)||((n[r]??(n[r]={}))[i]=c)}return Object.keys(n).length>0?n:null}l(vn,"lo");a(vn,"toVoiceClipMap");function kn(e){let[t,n]=(0,He.useState)(null);(0,He.useEffect)(()=>{if(n(null),e===void 0)return;let s=!0,i=a(p=>{if(!s)return;let w=typeof p=="object"&&p!==null&&typeof p.setId=="string"?p:null;n(h=>h?.setId===w?.setId?h:w)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(i,()=>i(null))}catch{i(null)}let c=e.on("view",p=>i(p.voice));return()=>{s=!1,c()}},[e]);let r=(0,He.useMemo)(()=>t!==null?vn(t):null,[t]);return e===void 0?null:r}l(kn,"ir");a(kn,"useServerVoiceClips");function bn({voice:e}){let t=Ee();return(0,Ut.jsx)(Y,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:l(()=>e.toggle(),"onClick"),children:(0,Ut.jsx)(it,{off:!e.enabled,className:"sekyro-icon"})})}l(bn,"cr");a(bn,"VoiceChip");var Yn=new Set(["abandoned","not_opened","cancelled","superseded"]),Jn=800,ea="capture.lookAtColours";function Cn(e){return e===void 0||e!==!1&&e.length===Mt.length&&Mt.every(t=>e.includes(t))}l(Cn,"go");a(Cn,"isDefaultTips");function _n(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}l(_n,"ho");a(_n,"carriesActivation");function wn(e){return typeof e=="object"&&e!==null&&!(0,y.isValidElement)(e)&&"tone"in e&&"text"in e}l(wn,"vo");a(wn,"isNoticeObject");var ta=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function Sn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}l(Sn,"ko");a(Sn,"isCapturing");function xn(e){return e==="captured"||e==="uploading"||e==="checking"}l(xn,"bo");a(xn,"isPostCapture");function ra({verification:e,locale:t,dir:n,strings:r,slots:s,autoStart:i=!1,notice:c,startDisabled:p=!1,startLabel:w,tips:h,tipsSummary:m,coach:R,voice:x,onGuidance:U,onCaptured:M,onResult:B,onError:A,onStateChange:te,assetBaseUrl:f,className:N}){let S=Rr(t),b=(0,y.useMemo)(()=>xr(t,r),[t,r,S]),u=(0,y.useMemo)(()=>v=>b[v]??"",[b]),E=n??(t==="ar"?"rtl":"ltr"),j=(0,y.useRef)(null),D=(0,y.useContext)(Wn),o=mn({verification:e,videoRef:j,assetBaseUrl:f,onCaptured:M,onResult:B,onError:A,onStateChange:te}),H=fn(f,o.state==="idle"&&o.error===null),O=yn(e),Z=O.choice!==null,F=un(e),ke=dn(e),he=hn(e),Q=cn(),X=pn(e),ae=X.session==="choice",I=X.mode==="assisted",Re=x!==!1&&x?.clips===void 0,be=kn(Re?e:void 0),q=Jr({locale:t,defaultClips:be,options:x}),re=I?"environment":"user",ue=X.settled,G=(0,y.useRef)(null),Ne=(0,y.useRef)(!1),We=(0,y.useRef)(q.unlock);We.current=q.unlock,(0,y.useEffect)(()=>{let v=G.current;if(v===null)return;let ie=["pointerup","touchend","click","keydown"],we=a(()=>{for(let De of ie)v.removeEventListener(De,Ae,!0)},"disarm");function Ae(De){if(Ne.current){we();return}_n(De)&&(Ne.current=!0,we(),We.current())}l(Ae,"Re"),a(Ae,"onGesture");for(let De of ie)v.addEventListener(De,Ae,{capture:!0,passive:!0});return we},[]);let C=(0,y.useCallback)(()=>{Ne.current||(Ne.current=!0,q.unlock()),o.start()},[q.unlock,o.start]),Ce=(0,y.useCallback)(()=>o.start(),[o.start]),Le=(0,y.useRef)(!1),Oe=o.state==="idle"&&o.error===null,Vt=!Z&&!F.required&&(i===!0||i==="when-permitted"&&Q.permission==="granted"),Dt=Vt&&O.settled&&F.settled&&ue,Ln=i==="when-permitted"&&!Q.permissionSettled&&!Le.current,Ft=Vt&&Oe&&!Le.current,pt=(Ln||Ft||!ue)&&H.gate==="ready"?"loading":H.gate;(0,y.useEffect)(()=>{!Dt||!Oe||H.gate!=="ready"||Le.current||(Le.current=!0,Ce())},[Dt,Oe,H.gate,Ce]);let In=Oe&&!Z&&!F.required&&!(Ft&&H.gate==="ready"),[$t,Kt]=(0,y.useState)(!1),{canSwitchCaptureMode:Gt,setCaptureMode:zt}=o;(0,y.useEffect)(()=>{if(!X.settled||!ae){Kt(!1);return}let v=!0;return Gt().then(ie=>{v&&Kt(ie)}),()=>{v=!1}},[X.settled,ae,Gt]);let{choose:Wt}=X,Ie=I?"self":"assisted",Un=(0,y.useCallback)(async()=>{await zt(Ie)&&Wt(Ie)},[zt,Wt,Ie]),Zt=o.state!=="idle"&&o.facingMode!==null?o.facingMode:re;(0,y.useEffect)(()=>{let v=j.current?.style;Zt==="user"?v?.removeProperty("transform"):v&&(v.transform="none")},[Zt]);let Ze=(0,y.useMemo)(()=>o.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(o.artifacts.keyframe):null,[o.artifacts]);(0,y.useEffect)(()=>{if(Ze!==null)return()=>URL.revokeObjectURL(Ze)},[Ze]);let Qt=o.frozenPreview??Ze,Ue=e!==void 0,$=Sn(o.state),fe=xn(o.state),Pe=$||fe,se=o.result,Xt=o.state==="done"&&se!==null,Qe=$&&o.rampColour!==null,ht=o.state==="recording"&&o.frozenPreview!==null&&!Qe,Be=D!==null,Yt=$t&&$&&!ht?{to:Ie,label:u(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:u(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:a(()=>{Un()},"onSwitch")}:null,Xe=o.modeRestarted&&$?u("capture.modeSwitch.restarted"):null,qe=fe||ht,Jt=fe?"checking":ht?"frozen":o.state==="recording"||Qe?"recording":o.gateLocked||o.gate.progress>=1?"locked":o.gate.faceDetected?"aligning":"seeking",Ye=$?o.gate.hint:null,Je=o.state==="starting"?"capture.preparing.title":Ye===null?null:Ye==="center"&&!o.gate.faceDetected?"fcv3.no_face":Cr(Ye),[jn,er]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(Je!=="fcv3.no_face"){er(Je);return}if(!$)return;let v=setTimeout(()=>er(Je),Jn);return()=>clearTimeout(v)},[Je,$]);let ft=$&&!Qe&&typeof R=="string"&&R!=="",tr=I&&$?u("capture.assisted.stage"):null,Me=$&&!ft?Qe?ea:jn:null,mt=ft?R:Me===null?"":u(Me);en(q,Me,mt,$);let rr=(0,y.useRef)(U);rr.current=U,(0,y.useEffect)(()=>{if(lt(Me))try{rr.current?.(Me)}catch(v){console.error("[@sekyro/react] onGuidance threw:",v)}},[Me]);let Ve=(0,y.useMemo)(()=>({supported:q.supported,enabled:q.enabled,setEnabled:q.setEnabled,toggle:q.toggle}),[q.supported,q.enabled,q.setEnabled,q.toggle]),yt=s?.voicePrompt,nr=yt!==void 0,ar=x===void 0,sr=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!nr||!ar||sr.current||!Ht()||(sr.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."))},[nr,ar]);let Tn=yt!==void 0?(v,ie,we)=>yt(v,ie,we,Ve):q.supported?()=>(0,k.jsx)(bn,{voice:Ve}):void 0,{summary:gt,summaryPlaying:ir,toggleSummary:lr,stopSummary:or}=q,et=m!==void 0&&m!=="",cr=et?m:u("capture.tips.summary"),ur=et?gt!=="none":gt==="partner"||gt==="default"&&Cn(h),Hn=(0,y.useMemo)(()=>ur?{playing:ir,toggle:a(()=>lr(cr,{clip:!et}),"toggle"),stop:or}:void 0,[ur,ir,lr,cr,or,et]),dr=(0,y.useMemo)(()=>({assets:pt,retryAssets:H.retry,permission:Q.permission,permissionSettled:Q.permissionSettled,captureMode:X.mode,facing:re,voice:Ve}),[pt,H.retry,Q.permission,Q.permissionSettled,X.mode,re,Ve]),On=wn(c)?(0,k.jsx)(le,{tone:c.tone,testId:"sekyro-host-notice",children:(0,k.jsx)("span",{children:c.text})}):c??null,V=se!==null&&se.status==="retry"?se:null,tt=V!==null&&s?.intro!==void 0&&!$&&!fe&&o.error===null,pr=V===null?void 0:{reason:String(V.reasonCode??""),...V.retakeHint!==void 0?{retakeHint:V.retakeHint}:{},...V.attemptsRemaining!==void 0?{attemptsRemaining:V.attemptsRemaining}:{}},z=Xt&&se.status==="unavailable"&&!Z&&se.reasonCode!=="portrait_required"?se:null,_e=Xt&&(se.status==="verified"||se.status==="not_verified"||se.status==="review")?se:null,vt=a((v,ie)=>{if(v===void 0)return null;if(v==="device_cooldown"){let Ae=wr(t,ie);if(Ae!==null)return u(Ae.key).replace("{time}",Ae.time)}let we=nt(v);return we===null?null:u(we)},"reasonText"),kt=a(v=>{let ie=v.retakeHint===void 0?null:Fe(v.retakeHint);return ie===null?vt(v.reasonCode):u(ie)},"retryText"),hr=_e===null?null:vt(_e.reasonCode,_e.retryAfter)??(_e.status==="not_verified"&&_e.reason!==void 0&&Yn.has(_e.reason)?u("errors.session_expired"):null),Pn=z!==null&&z.reasonCode!==void 0&&z.reasonCode!=="nni_unbound"&&z.reasonCode!=="id_number_unbound"&&z.reasonCode!=="method_required"&&z.reasonCode!=="mobile_required"&&!(z.reasonCode==="no_recorder"&&o.artifacts?.degraded==="NO_RECORDER"),rt=z?.reasonCode,fr=o.attempt;(0,y.useEffect)(()=>{z===null||rt===void 0||e?.reportCaptureIssue===void 0||ta.has(rt)||Nt(v=>e.reportCaptureIssue?.(v),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:rt,attempt:Math.min(1e3,fr)})},[z,rt,fr,e]);let mr=wt(),Bn=Z&&O.auto===null&&!$&&!fe&&o.error===null,bt=(0,y.useCallback)(async v=>{await O.select(v)&&o.state==="done"&&o.retry()},[O.select,o.state,o.retry]);return(0,y.useEffect)(()=>{O.auto!==null&&!O.busy&&!$&&!fe&&bt(O.auto)},[O.auto,O.busy,$,fe,bt]),(0,k.jsx)(Nr,{value:u,children:(0,k.jsxs)("div",{ref:G,className:N===void 0?"sekyro-capture":`sekyro-capture ${N}`,dir:E,lang:t,"data-testid":"sekyro-liveness-capture","data-state":o.state,children:[s?.header,V!==null&&kt(V)!==null&&!(Be&&Pe)&&!tt?(0,k.jsx)(le,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,k.jsx)("span",{children:kt(V)})}):null,Xe!==null&&!Be?(0,k.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,k.jsx)("span",{children:Xe})}):null,he&&fe&&!Be?(0,k.jsx)(le,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,k.jsx)("span",{children:u("capture.busy")})}):null,F.required&&Oe?(0,k.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,k.jsx)("span",{children:u("reasons.mobile_required")})}):null,o.error!==null?s?.errorPanel!==void 0?s.errorPanel(o.error,o.retry):(0,k.jsxs)(le,{tone:"danger",testId:"sekyro-error-notice",children:[(0,k.jsx)("span",{children:u(_r(o.error))}),o.error.retryable?(0,k.jsx)(Y,{ref:mr,kind:"ghost",className:"sekyro-btn--start",onClick:o.retry,children:u("common.retry")}):null]}):null,z!==null?(0,k.jsxs)(le,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,k.jsx)("span",{children:(z.reasonCode==="attestation"&&z.attestationError==="clock_wrong"?u("errors.device_clock"):vt(z.reasonCode))??u(z.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),Pn?(0,k.jsx)(Y,{ref:mr,kind:"ghost",className:"sekyro-btn--start",onClick:o.retry,children:u(z.reasonCode==="attestation"?"common.retry":"capture.recordAgain")}):null]}):null,hr!==null&&_e!==null?(0,k.jsx)(le,{tone:_e.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,k.jsx)("span",{children:hr})}):null,(0,k.jsx)("div",{className:Pe?void 0:"sekyro-hidden","data-capture-live":Pe?"":void 0,children:Be?D({videoRef:j,guidance:qe&&Ue?u("capture.checking"):mt,coached:ft&&!(qe&&Ue),note:qe?Ue?u(he?"capture.busy":"capture.checkingHint"):null:Xe??tr,settled:qe&&Ue,progress:o.gate.progress,phase:Jt,still:qe?Qt:null,live:Pe,modeSwitch:Yt,...$t||V!==null?{status:Xe??(V!==null&&$?kt(V):null)}:{},ramp:o.rampColour===null?null:{colour:o.rampColour}}):(0,k.jsx)(Mr,{videoRef:j,guidanceText:mt,guidanceHint:Ye,guidanceKey:Me,progress:o.gate.progress,phase:Jt,draining:o.draining,stillUrl:Qt,showChecking:Ue,operatorText:tr,voicePrompt:Tn,overlay:l(v=>(0,k.jsxs)(k.Fragment,{children:[s?.stageOverlay?.(v),(0,k.jsx)(Ar,{colour:o.rampColour})]}),"overlay"),reduceMotion:o.reduceMotion,modeSwitch:Yt})}),Bn&&O.choice!==null?(0,k.jsx)(Kr,{title:u("method.title"),description:u("method.description"),options:O.choice.options.map(v=>({id:v,label:u(`method.${v}`)})),busy:O.busy,error:O.failed?u("errors.network_error"):null,focus:o.state==="done",testId:"sekyro-method",look:"buttons",onChoose:l(v=>{bt(v)},"onChoose")}):null,tt&&s?.intro!==void 0&&pr!==void 0?s.intro(o.retry,{...dr,retry:pr}):null,In?(0,k.jsxs)(k.Fragment,{children:[ke&&s?.header===void 0&&s?.intro===void 0?(0,k.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,k.jsx)("h2",{className:"sekyro-text-body",children:u("returning.title")}),(0,k.jsx)("p",{className:"sekyro-text-muted",children:u("returning.description")})]}):null,On,s?.intro!==void 0?s.intro(C,dr):(0,k.jsx)(ln,{assets:pt,onRetryAssets:H.retry,permission:Q.permission,captureMode:X.mode,voice:Ve,tips:h??Mt,summary:Hn,startLabel:w,startDisabled:p,onStart:C})]}):null,(0,k.jsx)(rn,{showCoaching:V!==null&&!(Be&&Pe)&&!tt,coaching:ze(V?.reasonCode,V?.retakeHint),attemptsText:V?.attemptsRemaining!==void 0?Sr(b,t,V.attemptsRemaining):null,showRetake:V!==null&&!$&&!fe&&!tt||!Ue&&o.state==="captured",onRetake:o.retry}),s?.footer]})})}l(ra,"Ni");a(ra,"LivenessCapture");var Pt=T(W(),1),dt=T(W(),1),d=T(de(),1);var La={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function na(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return _t(e,t.locale)??t.t("method.nationalNumber");case"national_eid":return _t(e,t.locale)??t.t("method.nationalEid");default:return null}}l(na,"J");a(na,"identityLabel");function aa(e,t){let[n,r]=(0,Pt.useState)(!1),[s,i]=(0,Pt.useState)(null);return{busy:n,error:s,run:a(c=>{r(!0),i(null),c().then(()=>r(!1),p=>{r(!1),i(e.t(Ir(p,e.strings))),t?.(p)})},"run")}}l(aa,"Q");a(aa,"useChoiceAction");function Bt(){let e=`sekyro-face-light-${(0,dt.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,d.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("defs",{children:(0,d.jsx)("mask",{id:e,children:(0,d.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,d.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,d.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,d.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,d.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}l(Bt,"O");a(Bt,"FaceMark");var sa={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function ia(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}l(ia,"le");a(ia,"faceIntroRetryOf");var Nn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function la({start:e,context:t,tips:n,tipsTitle:r,human:s=!1,returning:i=!1,notice:c,retry:p}){let w=at(),{t:h}=w,m=p??An(t),R=(0,dt.useContext)(Er)?.busy===!0;if(m!==void 0&&c===void 0&&t.captureMode!=="assisted")return(0,d.jsx)(En,{retry:m,start:e,context:t,disabled:R});let x=m===void 0?"face":ze(m.reason,m.retakeHint),U=x==="face"?null:Te[x].tips;return(0,d.jsxs)("section",{className:"sekyro-step",children:[(0,d.jsx)(Bt,{}),t.captureMode==="assisted"?(0,d.jsx)($e,{title:h("capture.assisted.heading"),lead:h("capture.assisted.lead")}):i?(0,d.jsx)($e,{title:h("returning.heading"),lead:h("returning.description")}):(0,d.jsx)($e,{title:h(s?"native.face.humanIntroTitle":"native.face.introTitle"),lead:h(s?"native.face.humanIntroLead":"native.face.introLead")}),m!==void 0?(0,d.jsx)(Mn,{retry:m,title:Te[x].title}):null,r!==void 0&&U===null?(0,d.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,d.jsx)("ul",{className:"sekyro-tiprows",children:U!==null?U.map(M=>(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:Nn[M]??"face"}),h(M)]},M)):n!==void 0?n.map(M=>(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:sa[M.id]??"face"}),M.text]},M.id)):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:"light"}),h("capture.tips.light")]}),(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:"jGlasses"}),h("capture.tips.uncover")]}),(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:"smartphone"}),h("capture.tips.eyeLevel")]})]})}),c??null,c!==void 0?null:t.assets==="failed"?(0,d.jsx)(Y,{kind:"secondary",full:!0,onClick:t.retryAssets,children:h("common.retry")}):null,c!==void 0?null:(0,d.jsx)(St,{children:(0,d.jsxs)(Y,{full:!0,disabled:t.assets!=="ready"||R,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,d.jsx)(me,{name:"camera"}),h("capture.start")]})})]})}l(la,"ue");a(la,"FaceIntro");var oa=new Set(["match_inconclusive","no_face_source","below_threshold"]);function qt(e){return e==="probe_not_from_liveness"?"capture.retrySamePerson.message":e==="faces_differ"?"reasons.faces_differ":oa.has(e)?"capture.retryMatch.message":nt(e)}l(qt,"F");a(qt,"retryReasonKey");function Mn({retry:e,title:t}){let n=at(),r=e.retakeHint===void 0?null:Fe(e.retakeHint),s=qt(e.reason);return(0,d.jsxs)(xt,{tone:"warning",children:[r!==null?(0,d.jsx)("span",{children:n.t(r)}):s!==null?(0,d.jsx)("span",{children:n.t(s)}):null,r===null?(0,d.jsx)("span",{children:n.t(t)}):null,(0,d.jsx)("span",{children:Rt(n,e.attemptsRemaining,e.attemptsExhausted)})]})}l(Mn,"U");a(Mn,"RetryNotice");function An(e){let t=e.retry;if(t!==void 0)return{reason:t.reason,...t.retakeHint!==void 0?{retakeHint:t.retakeHint}:{},attemptsRemaining:t.attemptsRemaining??0,attemptsExhausted:t.attemptsRemaining===0}}l(An,"G");a(An,"faceIntroRetryOfContext");var Rn=[{key:"capture.retryCoaching.light",icon:"light"},{key:"capture.retryCoaching.eyeLevel",icon:"smartphone"},{key:"capture.retryCoaching.head",icon:"face"}],ca={appearance:"hintTitles.appearance",motion:"hintTitles.motion",lighting:"hintTitles.lighting",framing:"hintTitles.framing"};function En({retry:e,start:t,context:n,disabled:r}){let s=at(),{t:i}=s,c=ze(e.reason,e.retakeHint),p=c==="face"?Rn:Te[c].tips.map(x=>({key:x,icon:Rn.find(U=>U.key===x)?.icon??Nn[x]??"face"})),w=e.retakeHint===void 0?null:Fe(e.retakeHint),h=qt(e.reason),m=w!==null?i(w):h!==null?i(h):void 0,R=i((e.retakeHint!==void 0?ca[e.retakeHint]:void 0)??"hintTitles.default");return(0,d.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-face-retry",children:[(0,d.jsx)(Bt,{}),(0,d.jsx)($e,{title:R}),m!==void 0?(0,d.jsx)(xt,{tone:"warning",children:(0,d.jsx)("span",{children:m})}):null,(0,d.jsx)("ul",{className:"sekyro-tiprows",children:p.slice(0,3).map(x=>(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:x.icon}),i(x.key)]},x.key))}),n.assets==="failed"?(0,d.jsx)(Y,{kind:"secondary",full:!0,onClick:n.retryAssets,children:i("common.retry")}):null,(0,d.jsxs)(St,{children:[(0,d.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:Rt(s,e.attemptsRemaining,e.attemptsExhausted)}),(0,d.jsxs)(Y,{full:!0,disabled:n.assets!=="ready"||r||e.attemptsExhausted,"aria-busy":n.assets==="loading"||void 0,onClick:t,children:[(0,d.jsx)(me,{name:"camera"}),i("capture.recordAgain")]})]})]})}l(En,"q");a(En,"FaceRetry");function ua(e){return Ct(e)}l(ua,"ye");a(ua,"isInAppBrowser");function da(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let s=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${s};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}l(da,"ge");a(da,"androidBrowserIntent");export{Kr as a,Ht as b,Wn as c,pn as d,ra as e,La as f,na as g,aa as h,ia as i,la as j,ua as k,da as l};
|
|
1
|
+
import{b as Mr,d as Ar}from"./chunk-LK5ZZB5W.js";import{a as Ir}from"./chunk-G4FFU5ST.js";import{b as Lr,c as Nt}from"./chunk-ERJRG52Z.js";import{d as _t}from"./chunk-XY3RKF2D.js";import{c as at}from"./chunk-PQGILDKC.js";import{a as xr,b as Rr,c as Nr,d as Ee}from"./chunk-MZETEVSB.js";import{F as Er,K as xt,L as Rt,a as W,b as de,c as Y,m as Cr,n as Fe,p as _r,q as nt,r as wr,s as Sr,t as wt,u as le,v as me,w as $e,y as St}from"./chunk-K3XSP444.js";import{a}from"./chunk-5QL6W6FW.js";import{c as gr,d as kr,e as vr,h as br}from"./chunk-B4B5NNWF.js";import{b as Ct}from"./chunk-QYOVP3SU.js";import{g as yr}from"./chunk-6MYG4HWP.js";import{a as l,c as T}from"./chunk-4FHWXBOB.js";var jr=T(W(),1),g=T(de(),1),ne=T(de(),1),ke=T(W(),1),K=T(de(),1),_=T(W(),1),y=T(W(),1),ot=T(W(),1),ye=T(de(),1),nn=T(W(),1),ee=T(W(),1),ct=T(W(),1),Se=T(de(),1),xe=T(de(),1),P=T(de(),1);var ut=T(W(),1),pe=T(W(),1);var J=T(W(),1);var L=T(W(),1),ge=T(W(),1),He=T(W(),1),Ut=T(de(),1),v=T(de(),1);function ce({className:e,children:t}){return(0,g.jsx)("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})}l(ce,"ne");a(ce,"Svg");var jt="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 Tr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,g.jsx)("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"})]})}l(Tr,"pn");a(Tr,"SunIcon");function Hr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,g.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}l(Hr,"fn");a(Hr,"FaceUncoveredIcon");function Or(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,g.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,g.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}l(Or,"mn");a(Or,"PhoneEyeLevelIcon");function Pr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("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"}),(0,g.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}l(Pr,"yn");a(Pr,"LookStraightIcon");function Br(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("path",{d:jt}),(0,g.jsx)("path",{d:"M9 13l2 2 4-4"})]})}l(Br,"gn");a(Br,"CameraCheckIcon");function qr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("path",{d:jt}),(0,g.jsx)("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"})]})}l(qr,"hn");a(qr,"CameraAskIcon");function Vr(e){return(0,g.jsxs)(ce,{...e,children:[(0,g.jsx)("path",{d:jt}),(0,g.jsx)("path",{d:"M3 3l18 18"})]})}l(Vr,"vn");a(Vr,"CameraBlockedIcon");function it({off:e,className:t}){return(0,g.jsxs)(ce,{className:t,children:[(0,g.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,g.jsx)("path",{d:"M4 4l16 16"}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,g.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}l(it,"Ve");a(it,"SpeakerIcon");function Dr(e){return(0,g.jsx)(ce,{...e,children:(0,g.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}l(Dr,"Cn");a(Dr,"CheckIcon");function Fr(e){return(0,g.jsxs)(ce,{className:e.className??"sekyro-spinner",children:[(0,g.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,g.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}l(Fr,"kn");a(Fr,"SpinnerIcon");var Mt=["light","uncover","eyeLevel","straight"],qn={light:{key:"capture.tips.light",icon:a(()=>(0,ne.jsx)(Tr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:a(()=>(0,ne.jsx)(Hr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:a(()=>(0,ne.jsx)(Or,{}),"icon")},straight:{key:"capture.tips.straight",icon:a(()=>(0,ne.jsx)(Pr,{}),"icon")}};function $r({tips:e}){let t=Ee(),n=(0,jr.useId)();return e.length===0?null:(0,ne.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,ne.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,ne.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let s=typeof r=="string"?qn[r]:void 0,i=typeof r=="string"?r:r.id,c=s!==void 0?s.icon():typeof r=="string"?void 0:r.icon,p=s!==void 0?t(s.key):typeof r=="string"?r:r.text;return(0,ne.jsxs)("li",{className:"sekyro-tips__item",children:[c!=null?(0,ne.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:c}):null,(0,ne.jsx)("span",{children:p})]},i)})})]})}l($r,"Sn");a($r,"TipList");var Vn=220;function Kr({title:e,description:t,options:n,busy:r,error:s,focus:i,testId:c,look:p="cards",marked:w,onChoose:h}){let m=(0,ke.useId)(),R=wt(),[x,U]=(0,ke.useState)(null),M=(0,ke.useRef)(null);(0,ke.useEffect)(()=>{s!==null&&U(null)},[s]),(0,ke.useEffect)(()=>()=>{M.current!==null&&clearTimeout(M.current)},[]);let B=a(A=>{r||x!==null||(U(A),M.current=setTimeout(()=>{M.current=null,U(null),h(A)},Vn))},"choose");return(0,K.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":m,"data-testid":c,children:[(0,K.jsxs)("div",{className:p==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,K.jsx)("h2",{id:m,ref:i?R:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,K.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),s!==null?(0,K.jsx)(le,{tone:"danger",children:(0,K.jsx)("span",{children:s})}):null,p==="buttons"?(0,K.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((A,te)=>(0,K.jsx)(Y,{kind:te===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:l(()=>h(A.id),"onClick"),children:A.label},A.id))}):(0,K.jsx)("div",{className:"sekyro-choices",children:n.map(A=>(0,K.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(x??w)===A.id,"aria-busy":r||void 0,disabled:r||x!==null&&x!==A.id,onClick:l(()=>B(A.id),"onClick"),children:[A.glyph!==void 0?(0,K.jsx)("span",{className:"sekyro-card__tile",children:A.glyph}):null,(0,K.jsxs)("span",{className:"sekyro-card__body",children:[(0,K.jsx)("span",{className:"sekyro-card__title",children:A.label}),A.sub!==void 0?(0,K.jsx)("span",{className:"sekyro-card__sub",children:A.sub}):null]}),(0,K.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},A.id))})]})}l(Kr,"Vn");a(Kr,"ChoiceScreen");var Gr=["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","fcv3.one_face","capture.tips.summary","capture.lookAtColours"];function lt(e){return e!==null&&Gr.includes(e)}l(lt,"he");a(lt,"isVoiceKey");var Dn=a((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let s=e[n];r=s!=null&&Dn(s,t)?s[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}l(je,"we");a(je,"resolveClip");var Fn="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",$n={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function oe(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}l(oe,"re");a(oe,"synth");function zr(){return oe()!==null&&typeof SpeechSynthesisUtterance=="function"}l(zr,"Ir");a(zr,"speechAvailable");function At(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}l(At,"wn");a(At,"baseLang");function Tt(e,t){let n=a(s=>s.replace(/_/g,"-").toLowerCase(),"norm"),r=At(t);return e.find(s=>n(s.lang)===n(t))??e.find(s=>At(s.lang)===r)}l(Tt,"_n");a(Tt,"pickVoice");function Wr(e){if(!zr())return!1;let t=[];try{t=oe()?.getVoices()??[]}catch{return!0}return t.length===0||Tt(t,e)!==void 0}l(Wr,"In");a(Wr,"speechUsable");function Zr(e){let t=oe();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}l(Zr,"xn");a(Zr,"subscribeVoices");function Ge(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}l(Ge,"He");a(Ge,"clipIdentity");function Et(e){e.pause(),e.removeAttribute("src"),e.load()}l(Et,"Mn");a(Et,"release");function Qr(){let e=null,t=null,n=0,r=null,s=null,i=null,c=!1,p=null,w=[],h=new Map,m=a(()=>{w=oe()?.getVoices()??[]},"loadVoices"),R=!1,x=a(()=>{let f=oe();R||f===null||(R=!0,m(),f.addEventListener?.("voiceschanged",m))},"bindVoices"),U=a(()=>(e??(e=new Audio),e),"element"),M=a((f,N,S,b)=>{let u=oe();if(u!==null&&f!==""&&typeof SpeechSynthesisUtterance=="function"){x();let E=Tt(w,N);if(w.length===0||E!==void 0){u.cancel();let j=new SpeechSynthesisUtterance(f);j.lang=N,E!==void 0&&(j.voice=E),j.rate=.95,S!==void 0&&(j.onend=S),(S!==void 0||b!==void 0)&&(j.onerror=D=>{b!==void 0&&D.error==="not-allowed"?b():S?.()}),u.speak(j);return}}S?.()},"speak"),B=a(()=>{n+=1,r=null,s=i=null,e!==null&&(e.pause(),e.currentTime=0),oe()?.cancel()},"stop"),A=a(f=>{for(let N of f){let S=Ge(N);if(h.has(S))continue;let b=new Audio;b.preload="auto",b.src=N,h.set(S,b)}},"warmClips"),te=a((f,N,S)=>{let b={utterance:f,generation:N,end:S};p=b;let u=a(()=>N===n&&p===b,"live"),E=a(()=>{u()&&(s=b)},"block");if(oe()?.cancel(),f.url!==null){let j=U();j.pause(),j.muted=!1,j.src=f.url,j.currentTime=0,j.onended=S??null;let D=a(()=>{i===b&&(i=null)},"settled"),o=j.play();if(o===void 0)return;i=b,o.then(D,H=>{if(D(),!u())return;let O=H?.name;if(O!=="AbortError"){if(O==="NotAllowedError")return E();f.speech?M(f.text,f.lang,S,E):S?.()}});return}f.speech?M(f.text,f.lang,S,E):S?.()},"start");return{say(f){let N=f.url!==null?Ge(f.url):`tts:${f.lang}:${f.text}`;if(N===r)return;r=N,s=i=null,n+=1;let S=n,b=f.onEnd;te(f,S,b!==void 0?()=>{S===n&&b()}:void 0)},unlock({lang:f,speech:N,prefetch:S}){let b=s??(c?null:i);c=!0;let u=b!==null&&b.generation===n?b:null;s=i=null,u!==null&&te(u.utterance,u.generation,u.end);let E=U();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let H=Uint8Array.from(atob(Fn),O=>O.charCodeAt(0));t=URL.createObjectURL(new Blob([H],{type:"audio/wav"}))}let j=E.paused===!1&&t!==null&&E.src!==t;t!==null&&!j&&(u===null||u.utterance.url===null)&&(E.muted=!0,E.onended=null,E.src=t,E.play()?.catch(()=>{}));let D=oe(),o=u!==null&&u.utterance.url===null;if(N&&!o&&D!==null&&typeof SpeechSynthesisUtterance=="function"){x();let H=new SpeechSynthesisUtterance(" ");H.volume=0,H.lang=f,D.speak(H)}A(S??[])},prefetch:A,stop:B,dispose(){B(),R&&oe()?.removeEventListener?.("voiceschanged",m),R=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&Et(e),e=null;for(let f of h.values())Et(f);h.clear()}}}l(Qr,"En");a(Qr,"createVoicePlayer");var Kn="sekyro.voiceGuidance";function Xr(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}}l(Xr,"Nn");a(Xr,"readVoicePreference");function Yr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}l(Yr,"Pn");a(Yr,"writeVoicePreference");var Ke="capture.tips.summary",Gn=typeof window<"u"?_.useLayoutEffect:_.useEffect,zn=Object.freeze({});function st(e,t){let n=new Set,r=[];for(let s of Gr){let i=s===Ke?null:je(e,s,t);i===null||n.has(Ge(i))||(n.add(Ge(i)),r.push(i))}return r}l(st,"vt");a(st,"resolvedClipUrls");function Jr({locale:e,defaultClips:t,options:n}){let r=n===!1,s=r?{}:n??{},i=s.storageKey===void 0?Kn:s.storageKey,[c,p]=(0,_.useState)(s.defaultEnabled??!0),w=(0,_.useRef)(c),[h,m]=(0,_.useState)(!1),[R,x]=(0,_.useState)("none"),[U,M]=(0,_.useState)(!1),B=(0,_.useRef)(!1),[A,te]=(0,_.useState)(0),f=(0,_.useRef)(null),N=(0,_.useCallback)(()=>(f.current??(f.current=Qr()),f.current),[]),S=$n[e],b=s.speechFallback,u=b===void 0||b===!0?!0:b===!1?!1:b.includes(e),E=s.clips??t??zn,j=(0,_.useRef)(!1),D=(0,_.useRef)(E);Gn(()=>{D.current=E,w.current=c}),(0,_.useEffect)(()=>{if(r||i===null)return;let I=Xr(i);I!==null&&(w.current=I,p(I))},[r,i]),(0,_.useEffect)(()=>{if(!(r||!u))return Zr(()=>te(I=>I+1))},[r,u]);let o=s.clips;(0,_.useEffect)(()=>{if(r)return;let I=u&&Wr(S);m(st(E,e).length>0||I),x(o!==void 0&&je(o,Ke,e)!==null?"partner":je(E,Ke,e)!==null||I?"default":"none")},[r,E,o,e,u,S,A]),(0,_.useEffect)(()=>{if(r||!c||!j.current)return;let I=st(E,e);I.length>0&&N().prefetch(I)},[r,c,E,e,N]),(0,_.useEffect)(()=>()=>{f.current?.dispose(),f.current=null,j.current=!1},[]);let H=(0,_.useCallback)(I=>{r||(j.current=!0,N().unlock({lang:S,speech:u,...I?{prefetch:st(D.current,e)}:{}}))},[r,N,S,u,e]),O=(0,_.useCallback)(()=>H(w.current),[H]),Z=(0,_.useCallback)(()=>{B.current=!1,M(!1)},[]),F=(0,_.useCallback)(()=>{Z(),f.current?.stop()},[Z]),ve=(0,_.useCallback)(()=>{B.current&&F()},[F]),he=(0,_.useCallback)((I,Re)=>{if(r)return;if(B.current){F();return}let be=N();be.stop(),B.current=!0,M(!0);let q=Re?.clip===!1?null:je(D.current,Ke,e);be.say({url:q,text:I,lang:S,speech:u,onEnd:Z})},[r,F,N,e,S,u,Z]),Q=(0,_.useCallback)(I=>{r||(I?H(!0):F(),i!==null&&Yr(i,I),w.current=I,p(I))},[r,H,F,i]),X=(0,_.useCallback)(()=>Q(!w.current),[Q]),ae=(0,_.useCallback)((I,Re)=>{if(r||!c)return;B.current&&Z();let be=je(D.current,I,e);N().say({url:be,text:Re,lang:S,speech:u})},[r,c,e,N,S,u,Z]);return(0,_.useMemo)(()=>({supported:!r&&h,enabled:!r&&c,setEnabled:Q,toggle:X,unlock:O,speakKey:ae,stop:F,summary:r?"none":R,summaryPlaying:U,toggleSummary:he,stopSummary:ve}),[r,h,c,Q,X,O,ae,F,R,U,he,ve])}l(Jr,"Ct");a(Jr,"useVoiceGuidance");function en(e,t,n,r){let{speakKey:s,stop:i,enabled:c}=e,p=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!r||!c){p.current&&i(),p.current=!1;return}p.current=!0,lt(t)&&t!==Ke&&n!==""&&s(t,n)},[r,c,t,n,s,i])}l(en,"kt");a(en,"useSpeakGuidance");function ze(e,t){let n=tn(e);return n==="face"&&(t==="lighting"||e==="liveness_inconclusive")?"again":n}l(ze,"On");a(ze,"retryCoachingOf");function tn(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}l(tn,"Kr");a(tn,"coachingOfReason");var Te={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},again:{title:"capture.retryTips.title",tips:["capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function rn({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:s}){let i=Ee(),c=(0,ot.useRef)(null);return(0,ot.useEffect)(()=>{r&&c.current?.focus()},[r]),!e&&!r?null:(0,ye.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,ye.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,ye.jsx)("p",{className:"sekyro-text-body",children:i(Te[t].title)}),(0,ye.jsx)("ul",{className:"sekyro-coaching",children:Te[t].tips.map(p=>(0,ye.jsx)("li",{children:i(p)},p))}),n!==null?(0,ye.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,ye.jsx)(Y,{ref:c,className:"sekyro-btn--start",onClick:s,children:i("capture.recordAgain")}):null]})}l(rn,"Hn");a(rn,"CapturedPanel");function Ht(){try{return!1}catch{return!1}}l(Ht,"rt");a(Ht,"isDevBuild");var Wn=(0,nn.createContext)(null);function an({state:e}){let t=Ee(),[n,r]=(0,ct.useState)(!1);(0,ct.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let s=e==="granted"?(0,Se.jsx)(Br,{}):e==="denied"?(0,Se.jsx)(Vr,{}):(0,Se.jsx)(qr,{});return(0,Se.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,Se.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:s}),(0,Se.jsx)("span",{children:t(`capture.permission.${e}`)})]})}l(an,"Gn");a(an,"PermissionRow");function sn({voice:e}){let t=Ee();if(!e.supported)return null;let n=e.enabled;return(0,xe.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:l(()=>e.toggle(),"onClick"),children:[(0,xe.jsxs)("span",{className:"sekyro-switch__label",children:[(0,xe.jsx)(it,{off:!n}),t("capture.voiceGuidance")]}),(0,xe.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,xe.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,xe.jsx)(Dr,{className:"sekyro-switch__check"}):null})})]})}l(sn,"Fn");a(sn,"VoiceSwitch");function ln({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:s,tips:i,summary:c,startLabel:p,startDisabled:w,onStart:h}){let m=Ee(),R=(0,ee.useRef)(c?.stop);R.current=c?.stop,(0,ee.useEffect)(()=>()=>R.current?.(),[]);let x=(0,ee.useRef)(null),U=(0,ee.useRef)(null),M=(0,ee.useRef)(null),B=(0,ee.useRef)(e),A=(0,ee.useRef)(!1);(0,ee.useEffect)(()=>{let u=B.current;if(B.current=e,u===e)return;let E=A.current;e!=="loading"&&(A.current=!1),on(x.current)&&(e==="failed"?M.current?.focus():E&&U.current?.focus())},[e]);let te=(0,ee.useCallback)(()=>{A.current=!0,t()},[t]),f=e==="loading",N=f||w,S=(0,ee.useCallback)(()=>{N||(R.current?.(),h())},[N,h]),b;return e==="failed"?b=(0,P.jsxs)(le,{tone:"danger",testId:"sekyro-assets-error",children:[(0,P.jsx)("p",{className:"sekyro-text-body",children:m("fcv2.err.models")}),(0,P.jsx)(Y,{kind:"ghost",ref:M,className:"sekyro-btn--start",onClick:te,"data-testid":"sekyro-assets-retry",children:m("common.retry")})]}):b=(0,P.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,P.jsx)(Y,{ref:U,full:!0,"data-testid":"sekyro-start","aria-disabled":N?"true":void 0,"aria-busy":f?"true":void 0,onClick:S,children:f?(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(Fr,{}),m("capture.preparing.title")]}):p??m("capture.start")}),f?(0,P.jsx)("p",{className:"sekyro-text-muted",children:m("capture.preparing.hint")}):null]}),(0,P.jsxs)("div",{ref:x,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,P.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,P.jsx)("h2",{className:"sekyro-text-body",children:m("capture.assisted.title")}),(0,P.jsx)("p",{className:"sekyro-text-muted",children:m("capture.assisted.lead")})]}):null,i!==!1?(0,P.jsx)($r,{tips:i}):null,c!==void 0?(0,P.jsxs)(Y,{kind:"ghost",className:"sekyro-btn--start",onClick:c.toggle,"data-testid":"sekyro-tips-listen",children:[(0,P.jsx)(it,{off:!1}),m(c.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,P.jsx)(an,{state:n}),(0,P.jsx)(sn,{voice:s}),(0,P.jsx)("p",{className:"sekyro-text-muted",children:m("capture.securityNote")}),b,(0,P.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?m("capture.preparing.title"):e==="ready"?m("capture.ready"):""})]})}l(ln,"jn");a(ln,"PreCaptureScreen");function on(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}l(on,"Br");a(on,"focusIsOurs");function cn(){let[e,t]=(0,ut.useState)({state:"unknown",settled:!1});return(0,ut.useEffect)(()=>yr(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}l(cn,"Yn");a(cn,"useCameraStatus");function un(e){return Ot(e,"mobileRequired")}l(un,"$n");a(un,"useMobileRequired");function dn(e){return Ot(e,"returning").required}l(dn,"zn");a(dn,"useReturning");function Ot(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let s=e?.[t];if(e===void 0||typeof s!="function"){r({required:!1,settled:!0});return}let i=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>s.call(e)).then(c=>{i&&r({required:c===!0,settled:!0})},()=>{i&&r({required:!1,settled:!0})}),()=>{i=!1}},[e,t]),n}l(Ot,"Zn");a(Ot,"useFlag");function pn(e){let t=a(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let i=e?.captureMode,c=e?.captureChoice??null;if(e===void 0||typeof i!="function"){r({session:"self",choice:c,settled:!0});return}let p=!0;return r({session:"self",choice:c,settled:!1}),Promise.resolve().then(()=>i.call(e)).then(w=>{let h=e.captureChoice??null;p&&r({session:h!==null&&w===h?"choice":w==="assisted"||w==="choice"?w:"self",choice:h,settled:!0})},()=>{p&&r({session:"self",choice:null,settled:!0})}),()=>{p=!1}},[e]);let s=(0,pe.useCallback)(i=>{e?.chooseCaptureMode?.(i),r(c=>({...c,choice:i}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:s}}l(pn,"Wn");a(pn,"useCaptureMode");function hn(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),s=e.on("result",()=>n(!1));return()=>{r(),s()}},[e]),t}l(hn,"Qn");a(hn,"useBusy");var Zn=a(()=>"idle","serverSnapshot");function Lt(e){return gr(e!==void 0?{assetBaseUrl:e}:{})}l(Lt,"er");a(Lt,"preload");function fn(e,t=!0){let n=(0,J.useSyncExternalStore)((0,J.useCallback)(h=>vr(h,e),[e]),()=>kr(e),Zn),[r,s]=(0,J.useState)(null),i=(0,J.useRef)(!1),c=(0,J.useCallback)(()=>{Lt(e).then(h=>{i.current&&h==="idle"&&s({base:e})})},[e]);(0,J.useEffect)(()=>(i.current=!0,c(),()=>{i.current=!1}),[c]);let p=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(n!=="idle"){p.current={base:e};return}!t||p.current===null||p.current.base!==e||(p.current=null,c())},[n,e,c,t]);let w=(0,J.useCallback)(()=>{Lt(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:w}}l(fn,"tr");a(fn,"useLivenessAssets");var Ur={progress:0,hint:null,faceDetected:!1};function mn(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,L.useRef)(e.verification).current,s=(0,L.useRef)(!1);e.verification!==r&&!s.current&&Ht()&&(s.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 i=(0,L.useRef)(null),[c,p]=(0,L.useState)("idle"),[w,h]=(0,L.useState)(Ur),[m,R]=(0,L.useState)(!1),[x,U]=(0,L.useState)(!1),[M,B]=(0,L.useState)(null),[A,te]=(0,L.useState)(!1),[f,N]=(0,L.useState)(null),[S,b]=(0,L.useState)(null),[u,E]=(0,L.useState)(null),[j,D]=(0,L.useState)(null),[o,H]=(0,L.useState)(null),[O,Z]=(0,L.useState)(!1),F=(0,L.useRef)(null),ve=(0,L.useRef)("idle"),he=(0,L.useRef)(-1),[Q,X]=(0,L.useState)(0),ae=(0,L.useRef)(e);ae.current=e,(0,L.useEffect)(()=>{let re=t.current;if(re===null)return;let ue={video:re,...n!==void 0?{assetBaseUrl:n}:{}},G=r!==void 0?r.liveness(ue):br(ue);i.current=G;let Ne=a(()=>H(G.facingMode??null),"readFacing");Ne();let We=[G.on("state",C=>{C==="mode_switch"?Z(!0):C!=="starting"&&C!=="gating"&&Z(!1),C==="starting"?(ve.current!=="starting"&&(he.current+=1,X(Math.max(0,he.current))),b(null),E(null),h(Ur),U(!1),R(!1),B(null),N(null),F.current=null):C==="gating"&&ve.current==="recording"&&(U(!1),R(!1),B(null),F.current=null),ve.current=C,Ne(),p(C),ae.current.onStateChange?.(C)}),G.on("gate",C=>{let Ce=F.current;F.current=C.progress,R(Ce!==null&&C.progress<Ce-.001&&C.progress>0&&C.progress<1),C.progress>=1&&U(!0),h(C)}),G.on("frozen",({previewDataUrl:C})=>B(C)),G.on("profile",({animations:C})=>te(C==="reduced")),G.on("ramp",({colour:C})=>N(C)),G.on("captured",C=>{b(C),D(null),ae.current.onCaptured?.(C)}),G.on("error",C=>{E(C);let Ce=r?.reportCaptureIssue;Ce!==void 0&&Nt(Le=>Ce.call(r,Le),Lr("liveness",C,Math.max(0,he.current))),ae.current.onError?.(C)}),r?.on("result",C=>{D(C),ae.current.onResult?.(C)})];return()=>{for(let C of We)C?.();i.current=null,G.destroy()}},[r,t,n]);let I=(0,L.useCallback)(()=>{i.current?.start()},[]),Re=(0,L.useCallback)(()=>{i.current?.retry()},[]),be=(0,L.useCallback)(async()=>{let re=i.current;return re===null||typeof re.canSwitchCaptureMode!="function"?!1:await re.canSwitchCaptureMode().catch(()=>!1)===!0},[]),q=(0,L.useCallback)(async re=>{let ue=i.current;if(ue===null||typeof ue.setCaptureMode!="function")return!1;let G=await ue.setCaptureMode(re).catch(()=>!1)===!0;return G&&H(ue.facingMode??null),G},[]);return{state:c,gate:w,draining:m,gateLocked:x,frozenPreview:M,reduceMotion:A,rampColour:f,artifacts:S,error:u,result:j,facingMode:o,start:I,retry:Re,canSwitchCaptureMode:be,setCaptureMode:q,modeRestarted:O,attempt:Q}}l(mn,"rr");a(mn,"useLivenessHandle");var Qn=new Set(["national_number"]);function It(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>Qn.has(n));return t.length>0?{...e,options:t}:null}l(It,"or");a(It,"pending");function yn(e){let[t,n]=(0,ge.useState)(null),[r,s]=(0,ge.useState)(e===void 0),[i,c]=(0,ge.useState)(!1),[p,w]=(0,ge.useState)(!1);(0,ge.useEffect)(()=>{if(n(null),e===void 0){s(!0);return}let R=!0,x=e.methodChoice;typeof x=="function"?(s(!1),Promise.resolve().then(()=>x.call(e)).then(M=>{R&&n(It(M))},()=>{}).finally(()=>{R&&s(!0)})):s(!0);let U=e.on("method",M=>n(It(M)));return()=>{R=!1,U()}},[e]);let h=(0,ge.useCallback)(async R=>{if(e===void 0)return!1;c(!0),w(!1);try{return await e.selectMethod(R),n(null),!0}catch{return w(!0),!1}finally{c(!1)}},[e]),m=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:m==="national_number"&&!p?m:null,settled:r,busy:i,failed:p,select:h}}l(yn,"sr");a(yn,"useMethodChoice");var Xn=["ar","fr","en"];function gn(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}}l(gn,"co");a(gn,"isClipUrl");function kn(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of Xn){let s=t[r];if(!(typeof s!="object"||s===null))for(let[i,c]of Object.entries(s))!lt(i)||!gn(c)||((n[r]??(n[r]={}))[i]=c)}return Object.keys(n).length>0?n:null}l(kn,"lo");a(kn,"toVoiceClipMap");function vn(e){let[t,n]=(0,He.useState)(null);(0,He.useEffect)(()=>{if(n(null),e===void 0)return;let s=!0,i=a(p=>{if(!s)return;let w=typeof p=="object"&&p!==null&&typeof p.setId=="string"?p:null;n(h=>h?.setId===w?.setId?h:w)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(i,()=>i(null))}catch{i(null)}let c=e.on("view",p=>i(p.voice));return()=>{s=!1,c()}},[e]);let r=(0,He.useMemo)(()=>t!==null?kn(t):null,[t]);return e===void 0?null:r}l(vn,"ir");a(vn,"useServerVoiceClips");function bn({voice:e}){let t=Ee();return(0,Ut.jsx)(Y,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:l(()=>e.toggle(),"onClick"),children:(0,Ut.jsx)(it,{off:!e.enabled,className:"sekyro-icon"})})}l(bn,"cr");a(bn,"VoiceChip");var Yn=new Set(["abandoned","not_opened","cancelled","superseded"]),Jn=800,ea="capture.lookAtColours";function Cn(e){return e===void 0||e!==!1&&e.length===Mt.length&&Mt.every(t=>e.includes(t))}l(Cn,"go");a(Cn,"isDefaultTips");function _n(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}l(_n,"ho");a(_n,"carriesActivation");function wn(e){return typeof e=="object"&&e!==null&&!(0,y.isValidElement)(e)&&"tone"in e&&"text"in e}l(wn,"vo");a(wn,"isNoticeObject");var ta=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function Sn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}l(Sn,"ko");a(Sn,"isCapturing");function xn(e){return e==="captured"||e==="uploading"||e==="checking"}l(xn,"bo");a(xn,"isPostCapture");function ra({verification:e,locale:t,dir:n,strings:r,slots:s,autoStart:i=!1,notice:c,startDisabled:p=!1,startLabel:w,tips:h,tipsSummary:m,coach:R,voice:x,onGuidance:U,onCaptured:M,onResult:B,onError:A,onStateChange:te,assetBaseUrl:f,className:N}){let S=Rr(t),b=(0,y.useMemo)(()=>xr(t,r),[t,r,S]),u=(0,y.useMemo)(()=>k=>b[k]??"",[b]),E=n??(t==="ar"?"rtl":"ltr"),j=(0,y.useRef)(null),D=(0,y.useContext)(Wn),o=mn({verification:e,videoRef:j,assetBaseUrl:f,onCaptured:M,onResult:B,onError:A,onStateChange:te}),H=fn(f,o.state==="idle"&&o.error===null),O=yn(e),Z=O.choice!==null,F=un(e),ve=dn(e),he=hn(e),Q=cn(),X=pn(e),ae=X.session==="choice",I=X.mode==="assisted",Re=x!==!1&&x?.clips===void 0,be=vn(Re?e:void 0),q=Jr({locale:t,defaultClips:be,options:x}),re=I?"environment":"user",ue=X.settled,G=(0,y.useRef)(null),Ne=(0,y.useRef)(!1),We=(0,y.useRef)(q.unlock);We.current=q.unlock,(0,y.useEffect)(()=>{let k=G.current;if(k===null)return;let ie=["pointerup","touchend","click","keydown"],we=a(()=>{for(let De of ie)k.removeEventListener(De,Ae,!0)},"disarm");function Ae(De){if(Ne.current){we();return}_n(De)&&(Ne.current=!0,we(),We.current())}l(Ae,"Re"),a(Ae,"onGesture");for(let De of ie)k.addEventListener(De,Ae,{capture:!0,passive:!0});return we},[]);let C=(0,y.useCallback)(()=>{Ne.current||(Ne.current=!0,q.unlock()),o.start()},[q.unlock,o.start]),Ce=(0,y.useCallback)(()=>o.start(),[o.start]),Le=(0,y.useRef)(!1),Oe=o.state==="idle"&&o.error===null,Vt=!Z&&!F.required&&(i===!0||i==="when-permitted"&&Q.permission==="granted"),Dt=Vt&&O.settled&&F.settled&&ue,Ln=i==="when-permitted"&&!Q.permissionSettled&&!Le.current,Ft=Vt&&Oe&&!Le.current,pt=(Ln||Ft||!ue)&&H.gate==="ready"?"loading":H.gate;(0,y.useEffect)(()=>{!Dt||!Oe||H.gate!=="ready"||Le.current||(Le.current=!0,Ce())},[Dt,Oe,H.gate,Ce]);let In=Oe&&!Z&&!F.required&&!(Ft&&H.gate==="ready"),[$t,Kt]=(0,y.useState)(!1),{canSwitchCaptureMode:Gt,setCaptureMode:zt}=o;(0,y.useEffect)(()=>{if(!X.settled||!ae){Kt(!1);return}let k=!0;return Gt().then(ie=>{k&&Kt(ie)}),()=>{k=!1}},[X.settled,ae,Gt]);let{choose:Wt}=X,Ie=I?"self":"assisted",Un=(0,y.useCallback)(async()=>{await zt(Ie)&&Wt(Ie)},[zt,Wt,Ie]),Zt=o.state!=="idle"&&o.facingMode!==null?o.facingMode:re;(0,y.useEffect)(()=>{let k=j.current?.style;Zt==="user"?k?.removeProperty("transform"):k&&(k.transform="none")},[Zt]);let Ze=(0,y.useMemo)(()=>o.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(o.artifacts.keyframe):null,[o.artifacts]);(0,y.useEffect)(()=>{if(Ze!==null)return()=>URL.revokeObjectURL(Ze)},[Ze]);let Qt=o.frozenPreview??Ze,Ue=e!==void 0,$=Sn(o.state),fe=xn(o.state),Pe=$||fe,se=o.result,Xt=o.state==="done"&&se!==null,Qe=$&&o.rampColour!==null,ht=o.state==="recording"&&o.frozenPreview!==null&&!Qe,Be=D!==null,Yt=$t&&$&&!ht?{to:Ie,label:u(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:u(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:a(()=>{Un()},"onSwitch")}:null,Xe=o.modeRestarted&&$?u("capture.modeSwitch.restarted"):null,qe=fe||ht,Jt=fe?"checking":ht?"frozen":o.state==="recording"||Qe?"recording":o.gateLocked||o.gate.progress>=1?"locked":o.gate.faceDetected?"aligning":"seeking",Ye=$?o.gate.hint:null,Je=o.state==="starting"?"capture.preparing.title":Ye===null?null:Ye==="center"&&!o.gate.faceDetected?"fcv3.no_face":Cr(Ye),[jn,er]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(Je!=="fcv3.no_face"){er(Je);return}if(!$)return;let k=setTimeout(()=>er(Je),Jn);return()=>clearTimeout(k)},[Je,$]);let ft=$&&!Qe&&typeof R=="string"&&R!=="",tr=I&&$?u("capture.assisted.stage"):null,Me=$&&!ft?Qe?ea:jn:null,mt=ft?R:Me===null?"":u(Me);en(q,Me,mt,$);let rr=(0,y.useRef)(U);rr.current=U,(0,y.useEffect)(()=>{if(lt(Me))try{rr.current?.(Me)}catch(k){console.error("[@sekyro/react] onGuidance threw:",k)}},[Me]);let Ve=(0,y.useMemo)(()=>({supported:q.supported,enabled:q.enabled,setEnabled:q.setEnabled,toggle:q.toggle}),[q.supported,q.enabled,q.setEnabled,q.toggle]),yt=s?.voicePrompt,nr=yt!==void 0,ar=x===void 0,sr=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!nr||!ar||sr.current||!Ht()||(sr.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."))},[nr,ar]);let Tn=yt!==void 0?(k,ie,we)=>yt(k,ie,we,Ve):q.supported?()=>(0,v.jsx)(bn,{voice:Ve}):void 0,{summary:gt,summaryPlaying:ir,toggleSummary:lr,stopSummary:or}=q,et=m!==void 0&&m!=="",cr=et?m:u("capture.tips.summary"),ur=et?gt!=="none":gt==="partner"||gt==="default"&&Cn(h),Hn=(0,y.useMemo)(()=>ur?{playing:ir,toggle:a(()=>lr(cr,{clip:!et}),"toggle"),stop:or}:void 0,[ur,ir,lr,cr,or,et]),dr=(0,y.useMemo)(()=>({assets:pt,retryAssets:H.retry,permission:Q.permission,permissionSettled:Q.permissionSettled,captureMode:X.mode,facing:re,voice:Ve}),[pt,H.retry,Q.permission,Q.permissionSettled,X.mode,re,Ve]),On=wn(c)?(0,v.jsx)(le,{tone:c.tone,testId:"sekyro-host-notice",children:(0,v.jsx)("span",{children:c.text})}):c??null,V=se!==null&&se.status==="retry"?se:null,tt=V!==null&&s?.intro!==void 0&&!$&&!fe&&o.error===null,pr=V===null?void 0:{reason:String(V.reasonCode??""),...V.retakeHint!==void 0?{retakeHint:V.retakeHint}:{},...V.attemptsRemaining!==void 0?{attemptsRemaining:V.attemptsRemaining}:{}},z=Xt&&se.status==="unavailable"&&!Z&&se.reasonCode!=="portrait_required"?se:null,_e=Xt&&(se.status==="verified"||se.status==="not_verified"||se.status==="review")?se:null,kt=a((k,ie)=>{if(k===void 0)return null;if(k==="device_cooldown"){let Ae=wr(t,ie);if(Ae!==null)return u(Ae.key).replace("{time}",Ae.time)}let we=nt(k);return we===null?null:u(we)},"reasonText"),vt=a(k=>{let ie=k.retakeHint===void 0?null:Fe(k.retakeHint);return ie===null?kt(k.reasonCode):u(ie)},"retryText"),hr=_e===null?null:kt(_e.reasonCode,_e.retryAfter)??(_e.status==="not_verified"&&_e.reason!==void 0&&Yn.has(_e.reason)?u("errors.session_expired"):null),Pn=z!==null&&z.reasonCode!==void 0&&z.reasonCode!=="nni_unbound"&&z.reasonCode!=="id_number_unbound"&&z.reasonCode!=="method_required"&&z.reasonCode!=="mobile_required"&&!(z.reasonCode==="no_recorder"&&o.artifacts?.degraded==="NO_RECORDER"),rt=z?.reasonCode,fr=o.attempt;(0,y.useEffect)(()=>{z===null||rt===void 0||e?.reportCaptureIssue===void 0||ta.has(rt)||Nt(k=>e.reportCaptureIssue?.(k),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:rt,attempt:Math.min(1e3,fr)})},[z,rt,fr,e]);let mr=wt(),Bn=Z&&O.auto===null&&!$&&!fe&&o.error===null,bt=(0,y.useCallback)(async k=>{await O.select(k)&&o.state==="done"&&o.retry()},[O.select,o.state,o.retry]);return(0,y.useEffect)(()=>{O.auto!==null&&!O.busy&&!$&&!fe&&bt(O.auto)},[O.auto,O.busy,$,fe,bt]),(0,v.jsx)(Nr,{value:u,children:(0,v.jsxs)("div",{ref:G,className:N===void 0?"sekyro-capture":`sekyro-capture ${N}`,dir:E,lang:t,"data-testid":"sekyro-liveness-capture","data-state":o.state,children:[s?.header,V!==null&&vt(V)!==null&&!(Be&&Pe)&&!tt?(0,v.jsx)(le,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,v.jsx)("span",{children:vt(V)})}):null,Xe!==null&&!Be?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,v.jsx)("span",{children:Xe})}):null,he&&fe&&!Be?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,v.jsx)("span",{children:u("capture.busy")})}):null,F.required&&Oe?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,v.jsx)("span",{children:u("reasons.mobile_required")})}):null,o.error!==null?s?.errorPanel!==void 0?s.errorPanel(o.error,o.retry):(0,v.jsxs)(le,{tone:"danger",testId:"sekyro-error-notice",children:[(0,v.jsx)("span",{children:u(_r(o.error))}),o.error.retryable?(0,v.jsx)(Y,{ref:mr,kind:"ghost",className:"sekyro-btn--start",onClick:o.retry,children:u("common.retry")}):null]}):null,z!==null?(0,v.jsxs)(le,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,v.jsx)("span",{children:(z.reasonCode==="attestation"&&z.attestationError==="clock_wrong"?u("errors.device_clock"):kt(z.reasonCode))??u(z.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),Pn?(0,v.jsx)(Y,{ref:mr,kind:"ghost",className:"sekyro-btn--start",onClick:o.retry,children:u(z.reasonCode==="attestation"?"common.retry":"capture.recordAgain")}):null]}):null,hr!==null&&_e!==null?(0,v.jsx)(le,{tone:_e.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,v.jsx)("span",{children:hr})}):null,(0,v.jsx)("div",{className:Pe?void 0:"sekyro-hidden","data-capture-live":Pe?"":void 0,children:Be?D({videoRef:j,guidance:qe&&Ue?u("capture.checking"):mt,coached:ft&&!(qe&&Ue),note:qe?Ue?u(he?"capture.busy":"capture.checkingHint"):null:Xe??tr,settled:qe&&Ue,progress:o.gate.progress,phase:Jt,still:qe?Qt:null,live:Pe,modeSwitch:Yt,...$t||V!==null?{status:Xe??(V!==null&&$?vt(V):null)}:{},ramp:o.rampColour===null?null:{colour:o.rampColour}}):(0,v.jsx)(Mr,{videoRef:j,guidanceText:mt,guidanceHint:Ye,guidanceKey:Me,progress:o.gate.progress,phase:Jt,draining:o.draining,stillUrl:Qt,showChecking:Ue,operatorText:tr,voicePrompt:Tn,overlay:l(k=>(0,v.jsxs)(v.Fragment,{children:[s?.stageOverlay?.(k),(0,v.jsx)(Ar,{colour:o.rampColour})]}),"overlay"),reduceMotion:o.reduceMotion,modeSwitch:Yt})}),Bn&&O.choice!==null?(0,v.jsx)(Kr,{title:u("method.title"),description:u("method.description"),options:O.choice.options.map(k=>({id:k,label:u(`method.${k}`)})),busy:O.busy,error:O.failed?u("errors.network_error"):null,focus:o.state==="done",testId:"sekyro-method",look:"buttons",onChoose:l(k=>{bt(k)},"onChoose")}):null,tt&&s?.intro!==void 0&&pr!==void 0?s.intro(o.retry,{...dr,retry:pr}):null,In?(0,v.jsxs)(v.Fragment,{children:[ve&&s?.header===void 0&&s?.intro===void 0?(0,v.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,v.jsx)("h2",{className:"sekyro-text-body",children:u("returning.title")}),(0,v.jsx)("p",{className:"sekyro-text-muted",children:u("returning.description")})]}):null,On,s?.intro!==void 0?s.intro(C,dr):(0,v.jsx)(ln,{assets:pt,onRetryAssets:H.retry,permission:Q.permission,captureMode:X.mode,voice:Ve,tips:h??Mt,summary:Hn,startLabel:w,startDisabled:p,onStart:C})]}):null,(0,v.jsx)(rn,{showCoaching:V!==null&&!(Be&&Pe)&&!tt,coaching:ze(V?.reasonCode,V?.retakeHint),attemptsText:V?.attemptsRemaining!==void 0?Sr(b,t,V.attemptsRemaining):null,showRetake:V!==null&&!$&&!fe&&!tt||!Ue&&o.state==="captured",onRetake:o.retry}),s?.footer]})})}l(ra,"Ni");a(ra,"LivenessCapture");var Pt=T(W(),1),dt=T(W(),1),d=T(de(),1);var La={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function na(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return _t(e,t.locale)??t.t("method.nationalNumber");case"national_eid":return _t(e,t.locale)??t.t("method.nationalEid");default:return null}}l(na,"J");a(na,"identityLabel");function aa(e,t){let[n,r]=(0,Pt.useState)(!1),[s,i]=(0,Pt.useState)(null);return{busy:n,error:s,run:a(c=>{r(!0),i(null),c().then(()=>r(!1),p=>{r(!1),i(e.t(Ir(p,e.strings))),t?.(p)})},"run")}}l(aa,"Q");a(aa,"useChoiceAction");function Bt(){let e=`sekyro-face-light-${(0,dt.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,d.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,d.jsx)("defs",{children:(0,d.jsx)("mask",{id:e,children:(0,d.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,d.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,d.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,d.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,d.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}l(Bt,"O");a(Bt,"FaceMark");var sa={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function ia(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}l(ia,"le");a(ia,"faceIntroRetryOf");var Nn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function la({start:e,context:t,tips:n,tipsTitle:r,human:s=!1,returning:i=!1,notice:c,retry:p}){let w=at(),{t:h}=w,m=p??An(t),R=(0,dt.useContext)(Er)?.busy===!0;if(m!==void 0&&c===void 0&&t.captureMode!=="assisted")return(0,d.jsx)(En,{retry:m,start:e,context:t,disabled:R});let x=m===void 0?"face":ze(m.reason,m.retakeHint),U=x==="face"?null:Te[x].tips;return(0,d.jsxs)("section",{className:"sekyro-step",children:[(0,d.jsx)(Bt,{}),t.captureMode==="assisted"?(0,d.jsx)($e,{title:h("capture.assisted.heading"),lead:h("capture.assisted.lead")}):i?(0,d.jsx)($e,{title:h("returning.heading"),lead:h("returning.description")}):(0,d.jsx)($e,{title:h(s?"native.face.humanIntroTitle":"native.face.introTitle"),lead:h(s?"native.face.humanIntroLead":"native.face.introLead")}),m!==void 0?(0,d.jsx)(Mn,{retry:m,title:Te[x].title}):null,r!==void 0&&U===null?(0,d.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,d.jsx)("ul",{className:"sekyro-tiprows",children:U!==null?U.map(M=>(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:Nn[M]??"face"}),h(M)]},M)):n!==void 0?n.map(M=>(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:sa[M.id]??"face"}),M.text]},M.id)):(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:"light"}),h("capture.tips.light")]}),(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:"jGlasses"}),h("capture.tips.uncover")]}),(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:"smartphone"}),h("capture.tips.eyeLevel")]})]})}),c??null,c!==void 0?null:t.assets==="failed"?(0,d.jsx)(Y,{kind:"secondary",full:!0,onClick:t.retryAssets,children:h("common.retry")}):null,c!==void 0?null:(0,d.jsx)(St,{children:(0,d.jsxs)(Y,{full:!0,disabled:t.assets!=="ready"||R,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,d.jsx)(me,{name:"camera"}),h("capture.start")]})})]})}l(la,"ue");a(la,"FaceIntro");var oa=new Set(["match_inconclusive","no_face_source","below_threshold"]);function qt(e){return e==="probe_not_from_liveness"?"capture.retrySamePerson.message":e==="faces_differ"?"reasons.faces_differ":oa.has(e)?"capture.retryMatch.message":nt(e)}l(qt,"F");a(qt,"retryReasonKey");function Mn({retry:e,title:t}){let n=at(),r=e.retakeHint===void 0?null:Fe(e.retakeHint),s=qt(e.reason);return(0,d.jsxs)(xt,{tone:"warning",children:[r!==null?(0,d.jsx)("span",{children:n.t(r)}):s!==null?(0,d.jsx)("span",{children:n.t(s)}):null,r===null?(0,d.jsx)("span",{children:n.t(t)}):null,(0,d.jsx)("span",{children:Rt(n,e.attemptsRemaining,e.attemptsExhausted)})]})}l(Mn,"U");a(Mn,"RetryNotice");function An(e){let t=e.retry;if(t!==void 0)return{reason:t.reason,...t.retakeHint!==void 0?{retakeHint:t.retakeHint}:{},attemptsRemaining:t.attemptsRemaining??0,attemptsExhausted:t.attemptsRemaining===0}}l(An,"G");a(An,"faceIntroRetryOfContext");var Rn=[{key:"capture.retryCoaching.light",icon:"light"},{key:"capture.retryCoaching.eyeLevel",icon:"smartphone"},{key:"capture.retryCoaching.head",icon:"face"}],ca={appearance:"hintTitles.appearance",motion:"hintTitles.motion",lighting:"hintTitles.lighting",framing:"hintTitles.framing"};function En({retry:e,start:t,context:n,disabled:r}){let s=at(),{t:i}=s,c=ze(e.reason,e.retakeHint),p=c==="face"?Rn:Te[c].tips.map(x=>({key:x,icon:Rn.find(U=>U.key===x)?.icon??Nn[x]??"face"})),w=e.retakeHint===void 0?null:Fe(e.retakeHint),h=qt(e.reason),m=w!==null?i(w):h!==null?i(h):void 0,R=i((e.retakeHint!==void 0?ca[e.retakeHint]:void 0)??"hintTitles.default");return(0,d.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-face-retry",children:[(0,d.jsx)(Bt,{}),(0,d.jsx)($e,{title:R}),m!==void 0?(0,d.jsx)(xt,{tone:"warning",children:(0,d.jsx)("span",{children:m})}):null,(0,d.jsx)("ul",{className:"sekyro-tiprows",children:p.slice(0,3).map(x=>(0,d.jsxs)("li",{children:[(0,d.jsx)(me,{name:x.icon}),i(x.key)]},x.key))}),n.assets==="failed"?(0,d.jsx)(Y,{kind:"secondary",full:!0,onClick:n.retryAssets,children:i("common.retry")}):null,(0,d.jsxs)(St,{children:[(0,d.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:Rt(s,e.attemptsRemaining,e.attemptsExhausted)}),(0,d.jsxs)(Y,{full:!0,disabled:n.assets!=="ready"||r||e.attemptsExhausted,"aria-busy":n.assets==="loading"||void 0,onClick:t,children:[(0,d.jsx)(me,{name:"camera"}),i("capture.recordAgain")]})]})]})}l(En,"q");a(En,"FaceRetry");function ua(e){return Ct(e)}l(ua,"ye");a(ua,"isInAppBrowser");function da(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let s=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${s};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}l(da,"ge");a(da,"androidBrowserIntent");export{Kr as a,Ht as b,Wn as c,pn as d,ra as e,La as f,na as g,aa as h,ia as i,la as j,ua as k,da as l};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{d as I}from"./chunk-PWGUNXYH.js";import{a as C,b as P,c as H}from"./chunk-EB2QC3GA.js";import{a as u}from"./chunk-5QL6W6FW.js";import{a as T}from"./chunk-5OPKZZON.js";import{a as s,b as D,c as N}from"./chunk-4FHWXBOB.js";var j=D(l=>{"use strict";var Q=C();function V(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}s(V,"formatProdErrorMessage");function h(){}s(h,"noop");var c={d:{f:h,r:s(function(){throw Error(V(522))},"r"),D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},ee=Symbol.for("react.portal");function re(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ee,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}s(re,"createPortal$1");var O=Q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function M(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}s(M,"getCrossOriginStringAs");l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c;l.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(V(299));return re(r,e,null,t)};l.flushSync=function(r){var e=O.T,t=c.p;try{if(O.T=null,c.p=2,r)return r()}finally{O.T=e,c.p=t,c.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,c.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&c.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin),o=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?c.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:o,fetchPriority:i}):t==="script"&&c.d.X(r,{crossOrigin:n,integrity:o,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=M(e.as,e.crossOrigin);c.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&c.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin);c.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=M(e.as,e.crossOrigin);c.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else c.d.m(r)};l.requestFormReset=function(r){c.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,t){return O.H.useFormState(r,e,t)};l.useFormStatus=function(){return O.H.useHostTransitionStatus()};l.version="19.2.0"});var W=D((de,B)=>{"use strict";function U(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(U)}catch(r){console.error(r)}}s(U,"checkDCE");U(),B.exports=j()});var z=N(C(),1),f=N(P(),1),a=N(P(),1);var E=N(C(),1),Z=N(W(),1),v=N(P(),1);var te=Array.from({length:56},(r,e)=>{let t=e/56*2*Math.PI-Math.PI/2,n=Math.cos(t),o=Math.sin(t);return{id:`tick-${e}`,frac:e/55,x1:150+108*n,y1:150+108*o,x2:150+138*n,y2:150+138*o,style:{transitionDelay:`${e*6}ms`}}});function F(r,e,t,n){return t?"var(--sekyro-color-success)":r?n?"color-mix(in srgb, var(--sekyro-color-warning) 75%, transparent)":e<.33?"color-mix(in srgb, var(--sekyro-color-brand) 55%, transparent)":e<.66?"color-mix(in srgb, var(--sekyro-color-brand) 80%, transparent)":"var(--sekyro-color-brand)":"color-mix(in srgb, var(--sekyro-color-surface) 32%, transparent)"}s(F,"T");u(F,"tickColor");var ae="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function G({progress:r,phase:e,draining:t=!1}){let n=Math.min(1,Math.max(0,r)),o=Math.round(n*56),i=e==="checking",y=e==="recording",d=e==="frozen",m=i||d,p=i||y||d,k=e==="locked"||p,S=t&&!k;return(0,f.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 300 300",preserveAspectRatio:"xMidYMid meet",className:"sekyro-stage__arc","data-testid":"sekyro-capture-arc","data-phase":e,"data-filled":o,"data-recording":y?"":void 0,"data-draining":S?"":void 0,children:[(0,f.jsx)("path",{fillRule:"evenodd",d:ae,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":m?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),(0,f.jsxs)("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[(0,f.jsx)("g",{className:m?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:te.map((g,x)=>(0,f.jsx)("line",{x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:F(x<o,g.frac,k,S),strokeWidth:3,strokeLinecap:"round",style:g.style,className:"sekyro-arc__tick"},g.id))}),(0,f.jsx)("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:(0,f.jsx)("circle",{cx:150,cy:150,r:100,fill:"none",stroke:k?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:k?3.5:2.5,className:p?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}s(G,"x");u(G,"CaptureArc");function ne({videoRef:r,guidanceText:e,guidanceHint:t,guidanceKey:n,progress:o,phase:i,draining:y=!1,stillUrl:d,showChecking:m,operatorText:p=null,voicePrompt:k,overlay:S,reduceMotion:g=!1,modeSwitch:x=null}){let b=I(),w=i==="checking",_=w||i==="frozen",A=_&&m?b("capture.checking"):e,L=k?.(t,A,n);return(0,a.jsxs)("div",{className:g?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[(0,a.jsx)("video",{ref:r,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),d!==null&&_?(0,a.jsx)("img",{src:d,alt:b("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,(0,a.jsx)(G,{progress:o,phase:i,draining:y}),S?.(r),L!=null&&!_?(0,a.jsx)("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:L}):null,x!==null&&!_?(0,a.jsx)($,{view:x,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,w&&m?(0,a.jsxs)("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[(0,a.jsx)(Y,{}),b("capture.cameraOff")]}):null,(0,a.jsxs)("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[(0,a.jsx)("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:A},A),_&&m?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint",children:b("capture.checkingHint")}):p!==null&&!_?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}s(ne,"ne");u(ne,"CaptureStage");function $({view:r,className:e,kind:t}){let n=(0,z.useId)(),o=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(K,{}),(0,a.jsx)("span",{children:r.label})]}),i={onClick:r.onSwitch,"aria-describedby":n,"data-testid":"sekyro-capture-mode-switch","data-mode":r.to};return(0,a.jsxs)(a.Fragment,{children:[t==="chip"?(0,a.jsx)(H,{kind:"chip",className:e,...i,children:o}):(0,a.jsx)("button",{type:"button",className:e,...i,children:o}),(0,a.jsx)("span",{id:n,className:"sekyro-visually-hidden",children:r.description})]})}s($,"H");u($,"ModeSwitchChip");function K(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),(0,a.jsx)("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}s(K,"D");u(K,"FlipCameraIcon");function Y(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon sekyro-icon--sm",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M3 3l18 18"})]})}s(Y,"G");u(Y,"CameraOffIcon");var ie=typeof window>"u"?E.useEffect:E.useLayoutEffect,R="data-sekyro-ramp",se=[["background-color","transparent"],["background-image","none"]];function q(r){let e=[],t=r.ownerDocument;for(let i=r;i!==null&&i!==t.documentElement;i=i.parentElement){if(!(i instanceof HTMLElement)&&!(i instanceof SVGElement))continue;let y=i.style;for(let[d,m]of se){let p=y.getPropertyValue(d),k=y.getPropertyPriority(d);y.setProperty(d,m,"important"),e.push(()=>{p===""?y.removeProperty(d):y.setProperty(d,p,k)})}}let n=t.documentElement,o=n.hasAttribute(R);return n.setAttribute(R,""),o||e.push(()=>n.removeAttribute(R)),()=>{for(let i of e.reverse())i()}}s(q,"z");u(q,"clearAncestorBackdrops");function X(r){return{position:"fixed",inset:0,minWidth:"100vw",minHeight:"100lvh",margin:0,padding:0,border:0,zIndex:-1,pointerEvents:"none",backgroundColor:T(r)}}s(X,"B");u(X,"washStyle");function J(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:T(r)}}s(J,"Y");u(J,"coverStyle");function oe({colour:r}){let e=(0,E.useRef)(null),t=r!==null;return ie(()=>{let n=e.current?.parentElement;if(!(!t||n===null||n===void 0))return q(n)},[t]),r===null||typeof document>"u"?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{ref:e,"aria-hidden":"true","data-testid":"sekyro-screen-ramp-cover","data-colour":r,style:J(r)}),(0,Z.createPortal)((0,v.jsx)("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":r,style:X(r)}),document.body)]})}s(oe,"de");u(oe,"ScreenRampLayer");export{W as a,ne as b,$ as c,oe as d};
|
|
1
|
+
import{d as I}from"./chunk-MZETEVSB.js";import{a as C,b as P,c as H}from"./chunk-K3XSP444.js";import{a as u}from"./chunk-5QL6W6FW.js";import{a as T}from"./chunk-B4B5NNWF.js";import{a as s,b as D,c as N}from"./chunk-4FHWXBOB.js";var j=D(l=>{"use strict";var Q=C();function V(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}s(V,"formatProdErrorMessage");function h(){}s(h,"noop");var c={d:{f:h,r:s(function(){throw Error(V(522))},"r"),D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},ee=Symbol.for("react.portal");function re(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ee,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}s(re,"createPortal$1");var O=Q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function M(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}s(M,"getCrossOriginStringAs");l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c;l.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(V(299));return re(r,e,null,t)};l.flushSync=function(r){var e=O.T,t=c.p;try{if(O.T=null,c.p=2,r)return r()}finally{O.T=e,c.p=t,c.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,c.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&c.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin),o=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?c.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:o,fetchPriority:i}):t==="script"&&c.d.X(r,{crossOrigin:n,integrity:o,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=M(e.as,e.crossOrigin);c.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&c.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin);c.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=M(e.as,e.crossOrigin);c.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else c.d.m(r)};l.requestFormReset=function(r){c.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,t){return O.H.useFormState(r,e,t)};l.useFormStatus=function(){return O.H.useHostTransitionStatus()};l.version="19.2.0"});var W=D((de,B)=>{"use strict";function U(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(U)}catch(r){console.error(r)}}s(U,"checkDCE");U(),B.exports=j()});var z=N(C(),1),f=N(P(),1),a=N(P(),1);var E=N(C(),1),Z=N(W(),1),v=N(P(),1);var te=Array.from({length:56},(r,e)=>{let t=e/56*2*Math.PI-Math.PI/2,n=Math.cos(t),o=Math.sin(t);return{id:`tick-${e}`,frac:e/55,x1:150+108*n,y1:150+108*o,x2:150+138*n,y2:150+138*o,style:{transitionDelay:`${e*6}ms`}}});function F(r,e,t,n){return t?"var(--sekyro-color-success)":r?n?"color-mix(in srgb, var(--sekyro-color-warning) 75%, transparent)":e<.33?"color-mix(in srgb, var(--sekyro-color-brand) 55%, transparent)":e<.66?"color-mix(in srgb, var(--sekyro-color-brand) 80%, transparent)":"var(--sekyro-color-brand)":"color-mix(in srgb, var(--sekyro-color-surface) 32%, transparent)"}s(F,"T");u(F,"tickColor");var ae="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function G({progress:r,phase:e,draining:t=!1}){let n=Math.min(1,Math.max(0,r)),o=Math.round(n*56),i=e==="checking",y=e==="recording",d=e==="frozen",m=i||d,p=i||y||d,k=e==="locked"||p,S=t&&!k;return(0,f.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 300 300",preserveAspectRatio:"xMidYMid meet",className:"sekyro-stage__arc","data-testid":"sekyro-capture-arc","data-phase":e,"data-filled":o,"data-recording":y?"":void 0,"data-draining":S?"":void 0,children:[(0,f.jsx)("path",{fillRule:"evenodd",d:ae,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":m?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),(0,f.jsxs)("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[(0,f.jsx)("g",{className:m?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:te.map((g,x)=>(0,f.jsx)("line",{x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:F(x<o,g.frac,k,S),strokeWidth:3,strokeLinecap:"round",style:g.style,className:"sekyro-arc__tick"},g.id))}),(0,f.jsx)("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:(0,f.jsx)("circle",{cx:150,cy:150,r:100,fill:"none",stroke:k?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:k?3.5:2.5,className:p?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}s(G,"x");u(G,"CaptureArc");function ne({videoRef:r,guidanceText:e,guidanceHint:t,guidanceKey:n,progress:o,phase:i,draining:y=!1,stillUrl:d,showChecking:m,operatorText:p=null,voicePrompt:k,overlay:S,reduceMotion:g=!1,modeSwitch:x=null}){let b=I(),w=i==="checking",_=w||i==="frozen",A=_&&m?b("capture.checking"):e,L=k?.(t,A,n);return(0,a.jsxs)("div",{className:g?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[(0,a.jsx)("video",{ref:r,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),d!==null&&_?(0,a.jsx)("img",{src:d,alt:b("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,(0,a.jsx)(G,{progress:o,phase:i,draining:y}),S?.(r),L!=null&&!_?(0,a.jsx)("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:L}):null,x!==null&&!_?(0,a.jsx)($,{view:x,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,w&&m?(0,a.jsxs)("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[(0,a.jsx)(Y,{}),b("capture.cameraOff")]}):null,(0,a.jsxs)("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[(0,a.jsx)("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:A},A),_&&m?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint",children:b("capture.checkingHint")}):p!==null&&!_?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}s(ne,"ne");u(ne,"CaptureStage");function $({view:r,className:e,kind:t}){let n=(0,z.useId)(),o=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(K,{}),(0,a.jsx)("span",{children:r.label})]}),i={onClick:r.onSwitch,"aria-describedby":n,"data-testid":"sekyro-capture-mode-switch","data-mode":r.to};return(0,a.jsxs)(a.Fragment,{children:[t==="chip"?(0,a.jsx)(H,{kind:"chip",className:e,...i,children:o}):(0,a.jsx)("button",{type:"button",className:e,...i,children:o}),(0,a.jsx)("span",{id:n,className:"sekyro-visually-hidden",children:r.description})]})}s($,"H");u($,"ModeSwitchChip");function K(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),(0,a.jsx)("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}s(K,"D");u(K,"FlipCameraIcon");function Y(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon sekyro-icon--sm",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M3 3l18 18"})]})}s(Y,"G");u(Y,"CameraOffIcon");var ie=typeof window>"u"?E.useEffect:E.useLayoutEffect,R="data-sekyro-ramp",se=[["background-color","transparent"],["background-image","none"]];function q(r){let e=[],t=r.ownerDocument;for(let i=r;i!==null&&i!==t.documentElement;i=i.parentElement){if(!(i instanceof HTMLElement)&&!(i instanceof SVGElement))continue;let y=i.style;for(let[d,m]of se){let p=y.getPropertyValue(d),k=y.getPropertyPriority(d);y.setProperty(d,m,"important"),e.push(()=>{p===""?y.removeProperty(d):y.setProperty(d,p,k)})}}let n=t.documentElement,o=n.hasAttribute(R);return n.setAttribute(R,""),o||e.push(()=>n.removeAttribute(R)),()=>{for(let i of e.reverse())i()}}s(q,"z");u(q,"clearAncestorBackdrops");function X(r){return{position:"fixed",inset:0,minWidth:"100vw",minHeight:"100lvh",margin:0,padding:0,border:0,zIndex:-1,pointerEvents:"none",backgroundColor:T(r)}}s(X,"B");u(X,"washStyle");function J(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:T(r)}}s(J,"Y");u(J,"coverStyle");function oe({colour:r}){let e=(0,E.useRef)(null),t=r!==null;return ie(()=>{let n=e.current?.parentElement;if(!(!t||n===null||n===void 0))return q(n)},[t]),r===null||typeof document>"u"?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{ref:e,"aria-hidden":"true","data-testid":"sekyro-screen-ramp-cover","data-colour":r,style:J(r)}),(0,Z.createPortal)((0,v.jsx)("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":r,style:X(r)}),document.body)]})}s(oe,"de");u(oe,"ScreenRampLayer");export{W as a,ne as b,$ as c,oe as d};
|
|
2
2
|
/*! Bundled license information:
|
|
3
3
|
|
|
4
4
|
react-dom/cjs/react-dom.production.js:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C,d as f,e as l,f as d,g as m,h as v,i as p,j as g,l as x}from"./chunk-
|
|
1
|
+
import{a as C,d as f,e as l,f as d,g as m,h as v,i as p,j as g,l as x}from"./chunk-K3XSP444.js";import{a as i}from"./chunk-5QL6W6FW.js";import{a as o,c as b}from"./chunk-4FHWXBOB.js";var r=b(C(),1);var y={ar:l,fr:d,en:f};function h(e,t){let s=v(e),a=s===void 0?y[m(e)]:{...y.en,...s};if(t===void 0)return a;let n={...a};for(let u of Object.keys(t)){let c=t[u];typeof c=="string"&&(n[u]=c)}return x(n,t),n}o(h,"T");i(h,"resolveStrings");function j(e){let[,t]=(0,r.useState)(0),s=p(e);return(0,r.useEffect)(()=>{if(!s)return;let a=!0;return g(e).then(()=>a&&t(n=>n+1)),()=>{a=!1}},[e,s]),!s}o(j,"w");i(j,"useLocaleReady");var S=(0,r.createContext)(e=>f[e]??""),E=S.Provider;function k(){return(0,r.useContext)(S)}o(k,"I");i(k,"useStrings");export{h as a,j as b,E as c,k as d};
|