@sekyro/react 0.1.0-rc.11 → 0.1.0-rc.12
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/chunk-34326C2I.js +2 -0
- package/dist/{chunk-JNAKE3DW.js → chunk-4ZN7GIYK.js} +1 -1
- package/dist/{chunk-63LPCEVJ.js → chunk-ALUF2O22.js} +1 -1
- package/dist/{chunk-D5WF4UNP.js → chunk-IDZNOWTO.js} +1 -1
- package/dist/{chunk-MXPLBQHW.js → chunk-K7YYCJUR.js} +1 -1
- package/dist/{chunk-5XYKAT3V.js → chunk-LNZR3RXG.js} +1 -1
- package/dist/{chunk-746GPDBD.js → chunk-PTPTDOWD.js} +1 -1
- package/dist/chunk-WAVBS3GL.js +2 -0
- package/dist/document-capture-view-LR4OLZPG.js +2 -0
- package/dist/{eid-view-74CN2XAY.js → eid-view-OZETO2IS.js} +1 -1
- package/dist/{email-otp-view-DE624TXY.js → email-otp-view-2I346KUZ.js} +1 -1
- package/dist/{flow-views-CO5TQYTP.js → flow-views-TEE63CMW.js} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{overlay-de-UWA5CZLC.js → overlay-de-UTUY4YEE.js} +1 -1
- package/dist/{overlay-es-VCSJQ4KN.js → overlay-es-XQFAQT24.js} +1 -1
- package/dist/{overlay-pt-NQMWHKF5.js → overlay-pt-2YEUC3J2.js} +1 -1
- package/dist/{portrait-capture-view-Y5W776HP.js → portrait-capture-view-TNKPPDYM.js} +1 -1
- package/dist/verification/index.cjs +1 -1
- package/dist/verification/index.d.cts +1 -0
- package/dist/verification/index.d.ts +1 -0
- package/dist/verification/index.js +1 -1
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/chunk-ECWKDUB5.js +0 -2
- package/dist/chunk-PCNVEJSW.js +0 -2
- package/dist/document-capture-view-E2USDGQJ.js +0 -2
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{a as A}from"./chunk-PYAJMHZH.js";import{a as fe,b as ve,e as ge,f as Se}from"./chunk-746GPDBD.js";import{d as he}from"./chunk-PCNVEJSW.js";import{a as ye,b as Q}from"./chunk-MXPLBQHW.js";import{a as W,m as pe}from"./chunk-ECWKDUB5.js";import{a as h}from"./chunk-2KED7D2Q.js";import{useEffect as R,useLayoutEffect as Ue,useRef as q,useState as S}from"react";var ke={image:'<path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/><path d="M14 8A2 2 0 1 0 18 8A2 2 0 1 0 14 8Z" stroke="currentColor"/><path d="M2 12.5L3.75 10.97C4.66 10.17 6.04 10.22 6.89 11.07L11.18 15.36C11.87 16.05 12.95 16.14 13.75 15.58L14.04 15.37C15.19 14.57 16.74 14.66 17.78 15.6L21 18.5" stroke="currentColor" stroke-linecap="round"/>',flashlight:'<path d="M9 11.66V19C9 19.93 9 20.4 9.15 20.77C9.36 21.26 9.74 21.64 10.23 21.85C10.6 22 11.07 22 12 22C12.93 22 13.4 22 13.77 21.85C14.26 21.64 14.64 21.26 14.85 20.77C15 20.4 15 19.93 15 19V11.66C15 10.84 15 10.43 15.15 10.06C15.3 9.7 15.59 9.41 16.17 8.83L16.17 8.83L19.41 5.59C19.7 5.3 19.85 5.15 19.92 4.97C20 4.78 20 4.58 20 4.17V4C20 3.06 20 2.59 19.71 2.29C19.41 2 18.94 2 18 2H6C5.06 2 4.59 2 4.29 2.29C4 2.59 4 3.06 4 4V4.17C4 4.58 4 4.78 4.08 4.97C4.15 5.15 4.3 5.3 4.59 5.59L7.83 8.83C8.41 9.41 8.7 9.7 8.85 10.06C9 10.43 9 10.84 9 11.66Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 10H9" stroke="currentColor" stroke-linecap="round"/><path d="M12 13V15" stroke="currentColor" stroke-linecap="round"/><path d="M4.5 5H19.5" stroke="currentColor" stroke-linecap="round"/>'};var we={"dcv3.mrz.searching":"ضع صفحة جواز السفر كاملة داخل الإطار","dcv3.mrz.showMrzSide":"اعرض الوجه الذي يحتوي على سطرين أو ثلاثة أسطر من الحروف","dcv3.mrz.reading":"جارٍ قراءة الوثيقة… ثبّتها","dcv3.mrz.moveCloser":"اقترب حتى تملأ أسطر الحروف الإطار","dcv3.mrz.turnSideways":"أدر هاتفك أفقيًا لقراءة أسطر الحروف","dcv3.mrz.glare":"أمِل الوثيقة لإزالة الانعكاس","dcv3.mrz.holdStill":"لا تتحرك","dcv3.mrz.valid":"تمت قراءة الوثيقة. جارٍ التقاط الصورة","dcv3.mrz.looksLikePassport":"يبدو أن هذا جواز سفر","dcv3.mrz.looksLikeCard":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"};var E={"dcv3.mrz.searching":"Fit the whole passport page in the frame","dcv3.mrz.showMrzSide":"Show the side with the two or three lines of characters","dcv3.mrz.reading":"Reading the document… hold it steady","dcv3.mrz.moveCloser":"Move closer so the lines of characters fill the frame","dcv3.mrz.turnSideways":"Turn your phone sideways to read the lines of characters","dcv3.mrz.glare":"Tilt the document to remove the reflection","dcv3.mrz.holdStill":"Hold still","dcv3.mrz.valid":"Document read. Taking the photo","dcv3.mrz.looksLikePassport":"This looks like a passport","dcv3.mrz.looksLikeCard":"This looks like an identity card or residence permit"};var be={"dcv3.mrz.searching":"Cadrez toute la page du passeport","dcv3.mrz.showMrzSide":"Montrez la face avec les deux ou trois lignes de caractères","dcv3.mrz.reading":"Lecture du document… tenez-le immobile","dcv3.mrz.moveCloser":"Rapprochez-vous pour que les lignes de caractères remplissent le cadre","dcv3.mrz.turnSideways":"Tournez votre téléphone à l’horizontale pour lire les lignes de caractères","dcv3.mrz.glare":"Inclinez le document pour supprimer le reflet","dcv3.mrz.holdStill":"Ne bougez plus","dcv3.mrz.valid":"Document lu. Prise de la photo","dcv3.mrz.looksLikePassport":"Ceci ressemble à un passeport","dcv3.mrz.looksLikeCard":"Ceci ressemble à une carte d’identité ou un titre de séjour"};var Ce={"native.doc.introTitle":"سنلتقط صورة لوثيقتك","native.doc.introLead":"ستُفتح كاميرا هاتفك، وتُلتقط الصورة تلقائيًا بمجرد أن تكون الوثيقة داخل الإطار.","native.doc.tip.flat":"ضع الوثيقة مسطحة على سطح داكن.","native.doc.tip.glare":"تجنّب انعكاسات المصابيح أو الشمس.","native.doc.tip.frame":"أبقِ الوثيقة كاملة داخل الإطار.","native.doc.openCamera":"افتح الكاميرا","native.doc.changeDocument":"تغيير الوثيقة","native.scan.closer":"اقترب قليلًا","native.scan.farther":"ابتعد قليلًا","native.scan.glare":"أمِل البطاقة قليلًا","native.scan.dark":"الإضاءة ضعيفة. شغّل المصباح.","native.scan.blurry":"الصورة غير واضحة. ثبّت الهاتف.","native.scan.holdStill":"لا تتحرك","native.scan.reading":"جارٍ التحقق من وثيقتك…","native.scan.putDown":"يمكنك وضع وثيقتك جانبًا.","native.scan.retry":"لنحاول مرة أخرى"};var O={"native.doc.introTitle":"We'll photograph your document","native.doc.introLead":"Your phone's camera will open. The photo is taken by itself as soon as the document is well framed.","native.doc.tip.flat":"Lay the document flat on a dark surface.","native.doc.tip.glare":"Avoid glare from lamps or sunlight.","native.doc.tip.frame":"Keep the whole document in the frame.","native.doc.openCamera":"Open the camera","native.doc.changeDocument":"Change document","native.scan.closer":"Move a little closer","native.scan.farther":"Move back a little","native.scan.glare":"Tilt the card a little","native.scan.dark":"Too dark. Turn on the light.","native.scan.blurry":"Blurry image. Hold the phone still.","native.scan.holdStill":"Hold still","native.scan.reading":"Checking your document…","native.scan.putDown":"You can put your document down.","native.scan.retry":"Let's try that again"};var ze={"native.doc.introTitle":"Nous allons photographier votre pièce","native.doc.introLead":"La caméra de votre téléphone va s'ouvrir. La photo est prise automatiquement dès que la pièce est bien cadrée.","native.doc.tip.flat":"Posez la pièce à plat, sur une surface sombre.","native.doc.tip.glare":"Évitez les reflets de lampe ou de soleil.","native.doc.tip.frame":"Gardez toute la pièce dans le cadre.","native.doc.openCamera":"Ouvrir la caméra","native.doc.changeDocument":"Changer de document","native.scan.closer":"Approchez un peu","native.scan.farther":"Reculez un peu","native.scan.glare":"Inclinez un peu la carte","native.scan.dark":"Trop sombre. Allumez la lampe.","native.scan.blurry":"Image floue. Tenez le téléphone immobile.","native.scan.holdStill":"Ne bougez plus","native.scan.reading":"Vérification de votre document…","native.scan.putDown":"Vous pouvez poser votre pièce.","native.scan.retry":"Réessayons"};var Be=["locking","capturing"],Z=class Z{constructor(){this.shown={hint:null,locking:!1,card:null,manualShutter:!1};this.candidate=null;this.candidateSince=0;this.hintShownAt=0;this.lockLostAt=null;this.detectedSince=null;this.lostSince=null;this.shutterSince=null}present(e,r){return this.presentHint(e,r),this.presentLock(e,r),this.presentCard(e,r),this.shutterSince=e.manualShutter?this.shutterSince??r:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&r-this.shutterSince>=1e3},this.shown}presentHint(e,r){let a=e.phase==="framing"&&!(e.hint==="blurry"&&e.card===null)?e.hint:null;if(e.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(a!==this.candidate&&(this.candidate=a,this.candidateSince=r),a===this.shown.hint)return;let s=r-this.candidateSince>=(a===null?0:350),u=this.shown.hint===null||r-this.hintShownAt>=1200;s&&u&&(this.shown={...this.shown,hint:a},this.hintShownAt=r)}presentLock(e,r){if(Be.includes(e.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(e.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=r),r-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(e,r){let a=e.card;if(a===null||e.phase!=="framing"){if(e.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=r),r-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=r),r-this.detectedSince<250)return;let s=this.shown.card;if(s===null){this.shown={...this.shown,card:{...a}};return}let u=.35;this.shown={...this.shown,card:{fill:s.fill+(a.fill-s.fill)*u,offsetX:s.offsetX+(a.offsetX-s.offsetX)*u,offsetY:s.offsetY+(a.offsetY-s.offsetY)*u}}}};h(Z,"ScanPresenter");var Y=Z;import{Fragment as at,jsx as t,jsxs as m}from"react/jsx-runtime";var Fe={en:O,fr:ze,ar:Ce,es:O,pt:O,de:O},Ge=450,De=h(n=>e=>he(n.strings[e]??Fe[n.locale][e]??""),"useScanCopy");function Ne({name:n}){return t("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:ke[n]}})}h(Ne,"ScanGlyph");var Xe={en:E,fr:be,ar:we,es:E,pt:E,de:E};function We(n,e){return n===null||n.state==="fallback"||n.state==="mismatch"?null:n.state==="searching"?e?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":n.state==="valid"?"dcv3.mrz.valid":n.coach!==void 0?`dcv3.mrz.${n.coach}`:"dcv3.mrz.reading"}h(We,"mrzInstruction");function Me(n){return n.reason==="unreadable"?"doc.reason_unreadable":n.reason!==void 0&&n.reason!=="side_missing"?pe(n.reason):null}h(Me,"reasonOf");function xt({step:n,i18n:e,liveMrz:r,...a}){let[s,u]=S(!1);return s?t(et,{step:n,i18n:e,...r!==void 0?{liveMrz:r}:{},onClose:()=>u(!1)}):t(qe,{step:n,i18n:e,onOpen:()=>u(!0),...a})}h(xt,"DocumentCaptureView");function Qe({passport:n}){let r=Math.round(228/(n?1.42:1.586));return m("svg",{className:"sekyro-mark sekyro-mark--card",viewBox:`-12 -12 252 ${r+24}`,"aria-hidden":"true",focusable:"false",children:[t("defs",{children:t("clipPath",{id:"sekyro-card-clip",children:t("rect",{width:228,height:r,rx:"12.5"})})}),t("rect",{className:"sekyro-mark__card",width:228,height:r,rx:"12.5"}),t("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:r*.52,rx:"6"}),[0,1,2].map(a=>t("rect",{className:"sekyro-mark__text",x:"88",y:23+a*r*.12,width:100-a*20,height:"6",rx:"3"},a)),[0,1].map(a=>t("rect",{className:"sekyro-mark__text",x:"17",y:r*.74+a*9,width:194,height:"4",rx:"2"},a)),t("g",{clipPath:"url(#sekyro-card-clip)",children:t("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:t("rect",{x:"-1",width:"2",height:r,className:"sekyro-mark__beam"})})}),t("path",{className:"sekyro-mark__brackets",d:Ze(-10,-10,248,r+20,16,30)})]})}h(Qe,"ScanMark");function Ze(n,e,r,a,s,u){let w=Math.min(s,u*.6);return[[n,e,1,1],[n+r,e,-1,1],[n,e+a,1,-1],[n+r,e+a,-1,-1]].map(([b,T,f,K])=>`M${b} ${T+K*u}V${T+K*w}Q${b} ${T} ${b+f*w} ${T}H${b+f*u}`).join("")}h(Ze,"brackets");function qe({step:n,i18n:e,onOpen:r,onChangeCountry:a,onChangeDocument:s}){let u=De(e),w=n.documentType==="passport",y=Me(n);return m("section",{className:"sekyro-step","data-testid":"sekyro-document",children:[t(Qe,{passport:w}),t(fe,{title:u("native.doc.introTitle"),lead:u("native.doc.introLead")}),y!==null?m(ye,{tone:"warning",children:[t("span",{children:e.t(y)}),t("span",{children:Q(e,n.attemptsRemaining,n.attemptsExhausted)})]}):null,m("ul",{className:"sekyro-tiprows",children:[m("li",{children:[t(A,{name:w?"passport":"card"}),u("native.doc.tip.flat")]}),m("li",{children:[t(A,{name:"light"}),u("native.doc.tip.glare")]}),m("li",{children:[t(Ne,{name:"image"}),u("native.doc.tip.frame")]})]}),s!==void 0||a!==void 0?m("div",{className:"sekyro-links",children:[s!==void 0?t("button",{type:"button",className:"sekyro-link",onClick:s,children:u("native.doc.changeDocument")}):null,a!==void 0?t("button",{type:"button",className:"sekyro-link",onClick:a,children:e.t("native.doc.changeCountry")}):null]}):null,t(ve,{children:m(W,{full:!0,onClick:r,children:[t(A,{name:"camera"}),u("native.doc.openCamera")]})})]})}h(qe,"DocumentIntro");function Le(n,e,r){let a=n*.88,s=a/r;return{x:(n-a)/2,y:e*.42-s/2,w:a,h:s}}h(Le,"guideRect");var je={too_far:"native.scan.closer",too_close:"native.scan.farther",focus_far:"native.scan.farther",glare:"native.scan.glare",too_bright:"native.scan.glare",too_dark:"native.scan.dark",blurry:"native.scan.blurry"},Je=h(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function et({step:n,i18n:e,liveMrz:r,onClose:a}){let s=De(e),u=q(null),w=q(null),y=q(null),[b,T]=S("idle"),[f,K]=S(null),[xe,j]=S(null),[p,$e]=S({w:0,h:0}),[z,Te]=S({hint:null,locking:!1,card:null,manualShutter:!1}),[J,_e]=S({}),[ee,He]=S(null),[te,Re]=S(null),[ne,re]=S(0),[ae,se]=S(null),[I,oe]=S(null),L=n.documentType==="passport",P=L?1.42:1.586;ge(!0),Ue(()=>{let i=u.current;if(i===null)return;let c=h(()=>$e({w:i.clientWidth,h:i.clientHeight}),"measure");if(c(),typeof ResizeObserver>"u")return;let l=new ResizeObserver(c);return l.observe(i),()=>l.disconnect()},[]);let o=Le(p.w,p.h,P);R(()=>{p.w===0||p.h===0||y.current?.setGuide?.({viewAspect:p.w/p.h,rect:{x:o.x/p.w,y:o.y/p.h,width:o.w/p.w,height:o.h/p.h}})},[p.w,p.h,o.x,o.y,o.w,o.h]),R(()=>{let i=w.current;if(i===null)return;let c=n.capture({video:i,...r!==void 0?{liveMrz:r}:{}});y.current=c;let l=u.current;if(l!==null&&l.clientWidth>0&&l.clientHeight>0){let d=Le(l.clientWidth,l.clientHeight,P);c.setGuide?.({viewAspect:l.clientWidth/l.clientHeight,rect:{x:d.x/l.clientWidth,y:d.y/l.clientHeight,width:d.w/l.clientWidth,height:d.h/l.clientHeight}})}let C=new Y,g={scan:null,feedback:null,gate:null},N=h(d=>{g={...g,...d};let M=g.gate?.guide,Ye={phase:g.scan?.phase??"framing",hint:g.feedback?.reticle==="coaching"?g.feedback.key:null,card:M?.detected?{fill:M.fill,offsetX:M.offsetX,offsetY:M.offsetY}:null,manualShutter:g.scan?.manualShutter??!1},x=C.present(Ye,performance.now());Te($=>$.hint===x.hint&&$.locking===x.locking&&$.manualShutter===x.manualShutter&&$.card?.fill===x.card?.fill&&$.card?.offsetX===x.card?.offsetX&&$.card?.offsetY===x.card?.offsetY?$:x)},"present"),Ve=[c.on("state",T),c.on("feedback",d=>N({feedback:d})),c.on("gate",d=>N({gate:d})),c.on("scan",d=>{K(d),N({scan:d})}),c.on("captured",d=>{_e(M=>({...M,[tt(d.side,L,M)]:d.previewDataUrl})),He(d.previewDataUrl),Re(rt(i))}),c.on("error",j),c.on("mrz",d=>{d.state==="mismatch"?oe(d.format??null):se(d)})];return c.start().catch(()=>{}),()=>{for(let d of Ve)d();c.destroy(),y.current=null}},[n.issuer,n.documentType]);let k=f?.phase??"framing",D=k==="reading"||k==="result",B=k==="flipCue"||k==="reaskRecto",_=z.locking,ie=f?.captured.length??0;R(()=>{_&&re(i=>i+1)},[_]),R(()=>{ie>0&&re(i=>i+1)},[ie]);let Ae=f?.expected??null;R(()=>{se(null)},[Ae]),R(()=>{if(I===null)return;let i=setTimeout(()=>oe(null),2e3);return()=>clearTimeout(i)},[I]);let le=B||D?null:We(ae,L),U=I!==null?I==="TD3"?"dcv3.mrz.looksLikePassport":"dcv3.mrz.looksLikeCard":le,Ee=U===null?null:e.strings[U]??Xe[e.locale][U],ce=Me(n),ue=z.hint===null?null:je[z.hint]??`dcv2.${z.hint}`,Oe=ue??(k==="flipCue"?f?.notice==="same_face"?"doc.sameFace":"doc.flip":k==="reaskRecto"?"doc.reaskRecto":D?"native.scan.reading":k==="locking"||k==="capturing"||_?"native.scan.holdStill":f?.notice==="reread"?"doc.reread":f?.notice==="technical"?"native.scan.retry":f?.notice==="blurry"?"native.scan.blurry":ce??(L?"doc.showPage":"doc.showSide")),F=Ee??s(Oe),H=z.card,v=o;if(!_&&H!==null&&H.fill>=.45&&H.fill<=1.25&&!Je()){let i=o.w*H.fill,c=i/P,l=o.x+o.w/2+o.w*Math.max(-.25,Math.min(.25,H.offsetX)),C=o.y+o.h/2+o.h*Math.max(-.25,Math.min(.25,H.offsetY));v={x:l-i/2,y:C-c/2,w:i,h:c}}let V=o.w*.045,G=28,de=Math.min(V,G*.6),Ke=[[v.x,v.y,1,1],[v.x+v.w,v.y,-1,1],[v.x,v.y+v.h,1,-1],[v.x+v.w,v.y+v.h,-1,-1]],Ie=_?"is-locked":z.hint!==null?"is-coaching":"",Pe=L?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],me=o.y+o.h+48,X={insetInlineStart:o.x,insetBlockStart:o.y,inlineSize:o.w,blockSize:o.h,borderRadius:V};return t("section",{className:"sekyro-lm","aria-label":F,"data-testid":"sekyro-document",children:m("div",{ref:u,className:`sekyro-lm-stage${D?" is-reading":""}${B?" is-flip":""}`,style:{"--sekyro-guide-w":`${o.w}px`},children:[t("video",{ref:w,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:i=>{let c=i.currentTarget,l=c.getBoundingClientRect(),C=Math.max(l.width/(c.videoWidth||1),l.height/(c.videoHeight||1)),g=c.videoWidth*C,N=c.videoHeight*C;g>0&&N>0&&y.current?.focusAt((i.clientX-l.left+(g-l.width)/2)/g,(i.clientY-l.top+(N-l.height)/2)/N)}}),p.w>0?m(at,{children:[D&&te!==null?t("img",{className:"sekyro-lm-scene",src:te,alt:""}):null,D&&ee!==null?t("img",{className:"sekyro-lm-frozen",src:ee,alt:"",style:X}):null,m("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${p.w} ${p.h}`,"aria-hidden":"true",focusable:"false",children:[m("defs",{children:[m("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),t("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),m("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[t("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),t("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),t("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${p.w}V${p.h}H0Z${nt(o,V)}`}),t("rect",{width:p.w,height:Math.max(0,o.y),fill:"url(#sekyro-lm-top)"}),t("rect",{y:o.y+o.h,width:p.w,height:Math.max(0,p.h-o.y-o.h),fill:"url(#sekyro-lm-bottom)"}),t("g",{className:`sekyro-lm-brackets ${Ie}`,children:Ke.map(([i,c,l,C],g)=>t("path",{style:{transform:`translate(${i}px, ${c}px) scale(${l}, ${C})`},d:`M0 ${G}V${de}Q0 0 ${de} 0H${G}`},g))}),_?t("rect",{className:"sekyro-lm-trace",x:o.x,y:o.y,width:o.w,height:o.h,rx:V,pathLength:"1",style:{animationDuration:`${Ge}ms`}}):null]}),t("div",{className:"sekyro-lm-slot",style:X,"aria-hidden":"true",children:D?t("span",{className:"sekyro-lm-read is-repeating"}):ne>0?t("span",{className:"sekyro-lm-read"},ne):null})]}):null,le!==null?t("div",{className:"sekyro-lm-slot",style:X,"aria-hidden":"true",children:t("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${L?" is-page":""}${ae?.state==="valid"?" is-valid":""}`})}):null,m("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:o.y-64},children:[t("div",{role:"status","aria-live":"polite",children:t(Se,{swapKey:F,className:"sekyro-lm-line",children:F})}),ce!==null&&k==="framing"&&ue===null?t("p",{className:"sekyro-lm-attempts",children:Q(e,n.attemptsRemaining,n.attemptsExhausted)}):null]}),D?m("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:me-12},children:[t("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),s("native.scan.putDown")]}):B?t("div",{className:`sekyro-lm-under sekyro-lm-flip${k==="reaskRecto"?" is-toFront":""}`,style:{insetBlockStart:me-20},"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:m("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(P)},children:[t("span",{className:"sekyro-lm-flip-front"}),t("span",{className:"sekyro-lm-flip-back"})]})}):null,m("div",{className:"sekyro-lm-controls",children:[m("div",{className:"sekyro-lm-bar",children:[t("button",{type:"button",className:"sekyro-glass","aria-label":e.t("native.close"),onClick:a,children:t(A,{name:"close"})}),f?.torchAvailable?t("button",{type:"button",className:`sekyro-glass${f.torch?" is-on":""}`,"aria-label":e.t("doc.torchOn"),"aria-pressed":f.torch,onClick:()=>y.current?.setTorch(!f.torch),children:t(Ne,{name:"flashlight"})}):null]}),xe!==null?m("div",{className:"sekyro-lm-error",role:"alert",children:[t("p",{children:e.t("doc.cameraBlocked")}),t("p",{children:e.t("doc.cameraBlockedHint")}),t(W,{onClick:()=>{j(null),y.current?.retry()},children:e.t("doc.retryCamera")})]}):null,z.manualShutter?t("button",{type:"button",className:"sekyro-shutter","aria-label":e.t("doc.shutter"),onClick:()=>y.current?.shutter()}):null,t("ol",{className:"sekyro-lm-tray",children:Pe.map(({side:i,label:c})=>{let l=f?.captured.includes(i)??!1;return m("li",{className:l?"is-done":void 0,"aria-current":!l&&(L||f?.expected===i)?"step":void 0,children:[l?m("span",{className:"sekyro-lm-thumb",children:[J[i]!==void 0?t("img",{src:J[i],alt:""}):null,t("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:t("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,s(c)]},i)})})]}),b==="uploading"||b==="checking"?t("span",{className:"sekyro-visually-hidden",role:"status",children:b==="uploading"?e.t("doc.uploading"):s("native.scan.reading")}):null]})})}h(et,"LumiereScan");function tt(n,e,r){return e?"single":n==="recto"||n==="verso"?n:r.recto===void 0?"recto":"verso"}h(tt,"slotOf");function nt({x:n,y:e,w:r,h:a},s){return`M${n+s} ${e}H${n+r-s}Q${n+r} ${e} ${n+r} ${e+s}V${e+a-s}Q${n+r} ${e+a} ${n+r-s} ${e+a}H${n+s}Q${n} ${e+a} ${n} ${e+a-s}V${e+s}Q${n} ${e} ${n+s} ${e}Z`}h(nt,"roundedRect");function rt(n){let e=Math.round(n.videoWidth/4),r=Math.round(n.videoHeight/4);if(e===0||r===0||typeof document>"u")return null;try{let a=document.createElement("canvas");a.width=e,a.height=r;let s=a.getContext("2d");return s===null?null:(s.drawImage(n,0,0,e,r),a.toDataURL("image/jpeg",.7))}catch{return null}}h(rt,"sceneSnapshot");export{xt as DocumentCaptureView,Ge as LOCK_TRACE_MS,Le as guideRect,We as mrzInstruction,tt as slotOf};
|