@sekyro/react 0.1.0-rc.13 → 0.1.0-rc.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +4 -0
  3. package/dist/{chunk-PTPTDOWD.js → chunk-6EP4O2CE.js} +1 -1
  4. package/dist/{chunk-K7YYCJUR.js → chunk-AIBCIUYT.js} +1 -1
  5. package/dist/{chunk-34326C2I.js → chunk-IJE64ZEN.js} +1 -1
  6. package/dist/{chunk-LNZR3RXG.js → chunk-JCCXPYU4.js} +1 -1
  7. package/dist/{chunk-Y37ZXFOA.js → chunk-TLHEN5T3.js} +1 -1
  8. package/dist/{chunk-IDZNOWTO.js → chunk-TS3UFW5B.js} +1 -1
  9. package/dist/{chunk-Z5UFPMM6.js → chunk-UFAOAYQY.js} +1 -1
  10. package/dist/chunk-VKSX4KC3.js +2 -0
  11. package/dist/{chunk-4ZN7GIYK.js → chunk-Z43XZ75N.js} +1 -1
  12. package/dist/{document-capture-view-LR4OLZPG.js → document-capture-view-6NADWNPQ.js} +1 -1
  13. package/dist/{eid-view-OZETO2IS.js → eid-view-BKKVB5QT.js} +1 -1
  14. package/dist/{email-otp-view-2I346KUZ.js → email-otp-view-56JMHX3M.js} +1 -1
  15. package/dist/{flow-views-KKP7HKFG.js → flow-views-7FMODRP7.js} +1 -1
  16. package/dist/index.cjs +1 -1
  17. package/dist/index.js +1 -1
  18. package/dist/{overlay-de-UTUY4YEE.js → overlay-de-PSIG4NLI.js} +1 -1
  19. package/dist/{overlay-es-XQFAQT24.js → overlay-es-36OOIBXG.js} +1 -1
  20. package/dist/{overlay-pt-2YEUC3J2.js → overlay-pt-NWIPFF4D.js} +1 -1
  21. package/dist/{portrait-capture-view-TNKPPDYM.js → portrait-capture-view-JYTBBXFU.js} +1 -1
  22. package/dist/verification/index.cjs +1 -1
  23. package/dist/verification/index.d.cts +7 -2
  24. package/dist/verification/index.d.ts +7 -2
  25. package/dist/verification/index.js +1 -1
  26. package/dist/verification.css +17 -7
  27. package/package.json +2 -2
  28. package/sbom.cdx.json +4 -4
  29. package/dist/chunk-WAVBS3GL.js +0 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @sekyro/react
2
2
 
3
+ ## 0.1.0-rc.14
4
+
5
+ ### Patch Changes
6
+
7
+ - a5ce0c1: Phone step: the hint below the field is now one line for every country, "Type your phone number without the prefix" (and its translation in each locale), instead of "8 digits" for Mauritania. The `otp.phonePlaceholder` key stays in the dictionaries but the step no longer reads it; an override of it now goes under `otp.phonePlaceholderGeneric`. The free international field still shows no hint.
8
+ - 5ef8039: Phone step: with the server's phone rules, the number field groups digits as they are typed, stops at the country's longest length and enables Send only on a valid length, with an inline message when the person leaves the field or presses Enter too early. A full number typed or pasted lands on its country, Arabic-Indic digits are accepted, a leading `00` or a national prefix is handled, and an open flow offers "Another country". The two new server reasons `otp_number_invalid` and `otp_number_not_mobile` show their own notice. On a server without rules the field behaves as before. Additive: nothing to change on an existing integration.
9
+ - 3d43b65: Phone step: one field. The country choice moved into the field's leading segment (flag, calling code and chevron over a native select named with the country), the number takes the rest of the width, and the format hint sits below the field so it is never cut off. A flow with one country shows the flag and code without a chevron.
10
+ - Updated dependencies [c40301a]
11
+ - @sekyro/web@0.1.0-rc.17
12
+
3
13
  ## 0.1.0-rc.13
4
14
 
5
15
  ### Patch Changes
package/README.md CHANGED
@@ -219,6 +219,10 @@ its own stylesheet (`import "@sekyro/react/verification.css"` next to `styles.cs
219
219
  needs `@sekyro/web` 0.1.0-rc.8 or later (the step runner). The server decides the steps
220
220
  from the session's flow; the component renders whichever step comes next.
221
221
 
222
+ The phone step follows the rules the server sends per country: it groups digits as they are typed, stops at the
223
+ country's longest length, enables Send only on a valid length and says so inline otherwise. A full number typed or
224
+ pasted lands on its country, and an open flow offers "Another country". The value sent is always the number in E.164.
225
+
222
226
  `verification.css` loads the SDK's fonts (subset Inter, Geist and Cairo,
223
227
  woff2, OFL) from `fonts/` beside it: your bundler emits them as assets (allow
224
228
  them in your CSP `font-src`); they load only for the text that needs them and
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{u as c}from"./chunk-34326C2I.js";import{a as n}from"./chunk-2KED7D2Q.js";import{createContext as d,useContext as m,useEffect as u,useRef as f,useState as x}from"react";import{jsx as i,jsxs as N}from"react/jsx-runtime";function h({id:e,title:t,lead:o}){let s=c();return N("div",{className:"sekyro-heading",children:[i("h2",{id:e,ref:s,tabIndex:-1,className:"sekyro-text-body",children:t}),o!==void 0?i("p",{className:"sekyro-text-muted",children:o}):null]})}n(h,"StepHeading");function R({children:e}){return i("div",{className:"sekyro-actions",children:e})}n(R,"StepActions");var w=d(void 0),v=d(()=>{});function C(e){let t=m(v);u(()=>(t(e),()=>t(!1)),[e,t])}n(C,"useImmersive");var g=100;function y({swapKey:e,className:t,children:o}){let[s,l]=x({key:e,node:o}),a=f(o);a.current=o;let r=s.key!==e;return u(()=>{if(!r)return;let p=setTimeout(()=>l({key:e,node:a.current}),g);return()=>clearTimeout(p)},[r,e]),i("div",{className:`${t}${r?" is-leaving":""}`,"aria-hidden":r||void 0,children:r?s.node:o},s.key)}n(y,"Swap");var b=n(({pageKey:e,children:t})=>i(y,{swapKey:e,className:"sekyro-page",children:t}),"PageSwap");export{h as a,R as b,w as c,v as d,C as e,y as f,b as g};
2
+ import{u as c}from"./chunk-IJE64ZEN.js";import{a as n}from"./chunk-2KED7D2Q.js";import{createContext as d,useContext as m,useEffect as u,useRef as f,useState as x}from"react";import{jsx as i,jsxs as N}from"react/jsx-runtime";function h({id:e,title:t,lead:o}){let s=c();return N("div",{className:"sekyro-heading",children:[i("h2",{id:e,ref:s,tabIndex:-1,className:"sekyro-text-body",children:t}),o!==void 0?i("p",{className:"sekyro-text-muted",children:o}):null]})}n(h,"StepHeading");function R({children:e}){return i("div",{className:"sekyro-actions",children:e})}n(R,"StepActions");var w=d(void 0),v=d(()=>{});function C(e){let t=m(v);u(()=>(t(e),()=>t(!1)),[e,t])}n(C,"useImmersive");var g=100;function y({swapKey:e,className:t,children:o}){let[s,l]=x({key:e,node:o}),a=f(o);a.current=o;let r=s.key!==e;return u(()=>{if(!r)return;let p=setTimeout(()=>l({key:e,node:a.current}),g);return()=>clearTimeout(p)},[r,e]),i("div",{className:`${t}${r?" is-leaving":""}`,"aria-hidden":r||void 0,children:r?s.node:o},s.key)}n(y,"Swap");var b=n(({pageKey:e,children:t})=>i(y,{swapKey:e,className:"sekyro-page",children:t}),"PageSwap");export{h as a,R as b,w as c,v as d,C as e,y as f,b as g};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{o as n,t as r}from"./chunk-34326C2I.js";import{a as o}from"./chunk-2KED7D2Q.js";import{jsx as i}from"react/jsx-runtime";function a({tone:t,children:e}){return i(r,{tone:t,children:e})}o(a,"StepNotice");function f(t,e,p){return p?t.t("common.noAttemptsLeft"):n(t.strings,t.locale,e)}o(f,"attemptsLine");export{a,f as b};
2
+ import{o as n,t as r}from"./chunk-IJE64ZEN.js";import{a as o}from"./chunk-2KED7D2Q.js";import{jsx as i}from"react/jsx-runtime";function a({tone:t,children:e}){return i(r,{tone:t,children:e})}o(a,"StepNotice");function f(t,e,p){return p?t.t("common.noAttemptsLeft"):n(t.strings,t.locale,e)}o(f,"attemptsLine");export{a,f as b};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as r}from"./chunk-2KED7D2Q.js";import{forwardRef as k}from"react";import{jsx as T}from"react/jsx-runtime";var A=k(r(function({kind:t="primary",full:n=!1,className:a,type:o,...i},s){let c=["sekyro-btn",`sekyro-btn--${t}`];return n&&c.push("sekyro-btn--full"),a!==void 0&&c.push(a),T("button",{ref:s,type:o??"button",className:c.join(" "),...i})},"Button"));var u={"capture.start":"Start camera","capture.recordAgain":"Start a new attempt","capture.switchCamera":"Switch camera","capture.preparing.title":"Preparing secure capture…","capture.checking":"We're checking your identity…","capture.checkingHint":"This usually takes a few seconds. Keep this page open","capture.securityNote":"Your images are encrypted and used only for this verification","capture.cameraOff":"Camera off","capture.previewAlt":"Preview of the captured image of your face","capture.retryCoaching.title":"That attempt didn't work. A few adjustments will help:","capture.retryCoaching.light":"Find good lighting, with the light on your face and not behind you","capture.retryCoaching.eyeLevel":"Hold your phone at eye level","capture.retryCoaching.head":"Look straight at the camera and keep your head upright","capture.attemptsRemaining.one":"{count} attempt remaining","capture.attemptsRemaining.other":"{count} attempts remaining","common.retry":"Try again","fcv2.err.permission":"Allow camera access in your browser settings (the camera icon in the address bar), then try again","fcv2.err.notfound":"No camera detected. Connect or enable a camera, then try again","fcv2.err.inuse":"Another app is using the camera. Close it, then try again","fcv2.err.insecure":"The camera needs a secure connection (HTTPS). Reopen this page over HTTPS","fcv2.err.unsupported":"Your browser cannot capture in a supported format. Open this page in a recent browser such as Chrome or Safari","fcv2.err.generic":"The camera is unavailable. Try again, or contact support if it keeps failing","fcv3.no_face":"We can't see your face. Hold the phone in front of you","fcv3.come_closer":"Bring the phone a little closer","fcv3.move_back":"Move the phone a little farther away","fcv3.center_face":"Center your face in the circle","fcv3.straighten":"Hold your head straight","fcv3.more_light":"Find a brighter spot. Light your face","fcv3.too_bright":"Too much light. Move out of direct light","fcv3.hold_still":"Perfect, hold still","fcv3.steady_camera":"Hold the phone steady","fcv3.hold_upright":"Hold the phone upright","reasons.no_face":"No face could be detected during the check","reasons.media_unreadable":"The submitted capture could not be read","reasons.clip_too_short":"The capture was too short","reasons.spoof_detected":"The liveness check could not confirm a live person in front of the camera","reasons.review_band":"The automatic check was not conclusive, so it was sent to human review","reasons.nni_not_found":"The national identification number was not found in the civil registry","reasons.nni_invalid":"The national identification number is not a valid 10-digit NNI","reasons.registry_unavailable":"The civil registry could not be reached to confirm your number","reasons.result_from_cache":"The registry check was confirmed from a recent copy of the registry","reasons.no_face_source":"No face could be detected in the selfie photo","reasons.no_face_reference":"No reference photo was available to compare your selfie against. The requester needs to resolve this, so retaking your selfie will not help","reasons.low_quality_reference":"The reference photo on file was not clear enough to compare against","reasons.below_threshold":"The selfie did not match the photo on the identity document closely enough","reasons.side_missing":"One side of the identity document was not submitted","reasons.mrz_checksum_failed":"The machine-readable zone of the document could not be validated","reasons.unreadable":"The document photo was not clear enough to read","reasons.expired_document":"The identity document has expired","reasons.authenticity_review":"The document was sent to human review to confirm its authenticity","reasons.registry_mismatch":"The document's details did not match the civil registry. A reviewer will check","reasons.document_nni_mismatch":"This document belongs to a different person than the one this verification was created for","reasons.id_number_invalid":"The ID number is not valid","reasons.registry_record_not_found":"No record was found in the registry for this ID number","reasons.document_id_number_mismatch":"This document belongs to a different person than the one this verification was created for","reasons.otp_mismatch":"The verification code did not match the one we sent","reasons.otp_expired":"The verification code expired before it was entered","reasons.otp_send_failed":"We could not send a verification code to your phone","reasons.uncalibrated_capture_channel":"Desktop/webcam captures are not yet auto-decided, so your verification went to human review","reasons.capture_back_camera":"Use the front camera. Hold the phone in front of your face and try again","reasons.capture_not_upright":"Hold your phone upright, not sideways, and try again","reasons.location_not_allowed":"Verification isn't available in your region.","reasons.anonymizer_blocked":"Turn off your VPN or proxy, then open the link again.","reasons.nationality_not_allowed":"This service can't verify this document. Contact the organization for other options.","reasons.document_type_not_accepted":"This type of document isn't accepted. Choose another document.","reasons.underage":"You don't meet the minimum age for this service.","reasons.age_unverifiable":"We couldn't read your date of birth. Take a clearer photo of your document.","reasons.nationality_unreadable":"We couldn't read your nationality. Take a clearer photo of your document.","reasons.name_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.birth_date_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.nationality_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.document_number_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.liveness_inconclusive":"Let's try again: face a light source and hold still.","reasons.match_inconclusive":"We couldn't confirm it's you. Try again in good light, without glasses.","hints.appearance":"Let's try again: face a light source and hold still.","hints.motion":"Hold still and keep the phone steady, then try again.","hints.lighting":"Face a window or a lamp so your face is well lit, then try again.","hints.framing":"Move closer so your face fills the frame, then try again.","reasons.subject_revoked":"The identity on file for this check is no longer available. The requester needs to run a full verification, so retrying will not help","reasons.probe_not_from_liveness":"Keep your face in the frame the whole time, then try again.","reasons.document_authenticity":"Use the original card, not a photo or a copy, and avoid reflections.","reasons.mobile_required":"Continue on your phone to take the selfie.","reasons.capture_tampered":"We couldn't verify this capture. Use your phone's built-in camera, without screen recording or camera apps.","reasons.device_velocity_exceeded":"This device can't be used for another verification right now. Contact the organization.","reasons.device_cooldown":"Too many attempts. Try again later.","cooldown.retryIn":"Too many attempts. Try again {time}.","cooldown.retryAt":"Too many attempts. Try again after {time}.","capture.busy":"Our service is busy. Trying again…","errors.inference_unavailable":"Try again in a moment.","method.title":"How do you want to verify?","method.description":"Choose one option to continue","returning.title":"Confirm it's you","returning.description":"You verified your identity before. One short face capture confirms it's still you.","method.national_number":"Enter my Mauritanian national ID number (NNI)","method.document_photo":"Photo of my document","errors.method_required":"Choose how you want to verify, then continue","errors.attestation_invalid":"We could not confirm this browser session is genuine. Reload the page and try again","errors.network_error":"We could not reach the verification service. Check your internet connection and try again","errors.session_expired":"This verification session has expired. Ask the organisation that sent you here for a new link","errors.nni_unbound":"This link was created without your national ID number. Ask the requester for a new link","errors.id_number_unbound":"This link was created without your ID number. Ask the requester for a new link","capture.tips.title":"For a successful check:","capture.tips.light":"Face a light source and avoid strong light behind you","capture.tips.uncover":"Uncover your face: no glasses, mask or hand in front of it","capture.tips.eyeLevel":"Hold your phone at eye level","capture.tips.straight":"Look straight at the camera and keep still","capture.tips.summary":"Stand in a well-lit area. Uncover your face: no glasses, no mask. Once the camera starts, hold your phone at eye level, look straight at the camera and keep still.","capture.tips.listen":"Listen to the instructions","capture.tips.stop":"Stop","capture.permission.granted":"Camera access allowed","capture.permission.prompt":"Your browser will ask to use the camera. Choose Allow","capture.permission.denied":"Camera access is blocked. Allow it in your browser settings (the camera icon in the address bar), then reload this page","capture.permission.unknown":"We'll ask to use your camera when you start","capture.cameraLabel":"Camera","capture.facing.user":"Front camera","capture.facing.environment":"Back camera","capture.assisted.title":"Capture the person's face","capture.assisted.lead":"Point the back camera at the person's face and hold the phone upright. The voice guidance speaks to the person being filmed.","capture.assisted.stage":"Point the camera at the person's face","capture.voiceGuidance":"Voice guidance","capture.preparing.hint":"Setting up on-device face detection. This can take a moment on a slow connection","capture.ready":"Ready. Start when you are","fcv2.err.models":"The face-detection models could not be loaded. Check your connection and try again"};var d={"capture.start":"تشغيل الكاميرا","capture.recordAgain":"ابدأ محاولة جديدة","capture.switchCamera":"تبديل الكاميرا","capture.preparing.title":"جارٍ تجهيز الالتقاط الآمن…","capture.checking":"نتحقق من هويتك…","capture.checkingHint":"يستغرق هذا عادةً بضع ثوانٍ. أبقِ هذه الصفحة مفتوحة","capture.securityNote":"تُشفَّر لقطاتك وتُستخدم فقط لهذا التحقق","capture.cameraOff":"الكاميرا مطفأة","capture.previewAlt":"معاينة الصورة الملتقطة لوجهك","capture.retryCoaching.title":"لم تنجح هذه المحاولة. بعض التعديلات ستساعد:","capture.retryCoaching.light":"اختر مكانًا جيد الإضاءة، بحيث يكون الضوء على وجهك لا خلفك","capture.retryCoaching.eyeLevel":"أمسك هاتفك بمستوى العينين","capture.retryCoaching.head":"انظر مباشرة إلى الكاميرا وأبقِ رأسك مستقيمًا","capture.attemptsRemaining.zero":"لم تتبقَّ أي محاولة","capture.attemptsRemaining.one":"تبقّت محاولة واحدة","capture.attemptsRemaining.two":"تبقّت محاولتان","capture.attemptsRemaining.few":"تبقّت {count} محاولات","capture.attemptsRemaining.many":"تبقّت {count} محاولة","capture.attemptsRemaining.other":"تبقّت {count} محاولة","common.retry":"أعد المحاولة","fcv2.err.permission":"اسمح بالوصول إلى الكاميرا من إعدادات المتصفح (أيقونة الكاميرا في شريط العنوان) ثم أعد المحاولة","fcv2.err.notfound":"لم يتم العثور على كاميرا. وصِّل كاميرا أو فعِّلها ثم أعد المحاولة","fcv2.err.inuse":"تطبيق آخر يستخدم الكاميرا. أغلقه ثم أعد المحاولة","fcv2.err.insecure":"تتطلب الكاميرا اتصالًا آمنًا (HTTPS). افتح هذه الصفحة عبر HTTPS","fcv2.err.unsupported":"متصفحك لا يستطيع الالتقاط بصيغة مدعومة. افتح هذه الصفحة في متصفح حديث مثل كروم أو سفاري","fcv2.err.generic":"الكاميرا غير متاحة. أعد المحاولة، وتواصل مع الدعم إذا استمرت المشكلة","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":"أمسك الهاتف بشكل عمودي","reasons.no_face":"تعذّر اكتشاف أي وجه أثناء التحقق","reasons.media_unreadable":"تعذّرت قراءة اللقطة المُرسلة","reasons.clip_too_short":"كانت اللقطة أقصر من اللازم","reasons.spoof_detected":"لم يتمكن فحص الحضور الحي من تأكيد وجود شخص حقيقي أمام الكاميرا","reasons.review_band":"لم يكن الفحص التلقائي حاسمًا، لذا أُحيل إلى مراجعة بشرية","reasons.nni_not_found":"لم يُعثر على الرقم الوطني في سجل الحالة المدنية","reasons.nni_invalid":"الرقم الوطني ليس رقمًا صالحًا مكوّنًا من 10 أرقام","reasons.registry_unavailable":"تعذّر الوصول إلى سجل الحالة المدنية لتأكيد رقمك","reasons.result_from_cache":"أُكِّد فحص السجل استنادًا إلى نسخة حديثة من السجل","reasons.no_face_source":"تعذّر اكتشاف وجه في الصورة الذاتية","reasons.no_face_reference":"لم تتوفّر صورة مرجعية لمقارنة صورتك الذاتية بها. على الجهة الطالبة معالجة ذلك، وإعادة التقاط صورتك الذاتية لن تُجدي","reasons.low_quality_reference":"الصورة المرجعية المحفوظة لم تكن واضحة بما يكفي للمقارنة","reasons.below_threshold":"الصورة الذاتية لم تطابق صورة وثيقة الهوية بدرجة كافية","reasons.side_missing":"أحد وجهي وثيقة الهوية لم يُرسل","reasons.mrz_checksum_failed":"تعذّر التحقق من منطقة القراءة الآلية في الوثيقة","reasons.unreadable":"صورة الوثيقة لم تكن واضحة بما يكفي للقراءة","reasons.expired_document":"انتهت صلاحية وثيقة الهوية","reasons.authenticity_review":"أُحيلت الوثيقة إلى مراجعة بشرية للتأكد من صحتها","reasons.registry_mismatch":"بيانات الوثيقة لا تطابق السجل المدني. سيتحقق منها مراجع","reasons.document_nni_mismatch":"هذه الوثيقة تخص شخصًا آخر غير الشخص الذي أُنشئ له هذا التحقق","reasons.id_number_invalid":"رقم الهوية غير صالح","reasons.registry_record_not_found":"لم يُعثر على أي سجل لرقم الهوية هذا في السجل","reasons.document_id_number_mismatch":"هذه الوثيقة تخص شخصًا آخر غير الشخص الذي أُنشئ له هذا التحقق","reasons.otp_mismatch":"رمز التحقّق لا يطابق الرمز الذي أرسلناه","reasons.otp_expired":"انتهت صلاحية رمز التحقّق قبل إدخاله","reasons.otp_send_failed":"تعذّر إرسال رمز التحقّق إلى هاتفك","reasons.uncalibrated_capture_channel":"جودة الكاميرا المكتبية غير معايَرة بعد، لذا أُحيل تحققك إلى مراجعة بشرية","reasons.capture_back_camera":"استخدم الكاميرا الأمامية. أمسك الهاتف أمام وجهك وحاول مرة أخرى","reasons.capture_not_upright":"أمسك هاتفك بشكل عمودي وليس أفقيًا، ثم حاول مرة أخرى","reasons.location_not_allowed":"التحقق غير متاح في منطقتك.","reasons.anonymizer_blocked":"أوقف تشغيل VPN أو الوكيل ثم افتح الرابط مجددًا.","reasons.nationality_not_allowed":"لا يمكن لهذه الخدمة التحقق من هذه الوثيقة. تواصل مع الجهة لمعرفة الخيارات الأخرى.","reasons.document_type_not_accepted":"هذا النوع من الوثائق غير مقبول. اختر وثيقة أخرى.","reasons.underage":"لا تستوفي الحد الأدنى للسن لهذه الخدمة.","reasons.age_unverifiable":"تعذّرت قراءة تاريخ ميلادك. التقط صورة أوضح لوثيقتك.","reasons.nationality_unreadable":"تعذّرت قراءة جنسيتك. التقط صورة أوضح لوثيقتك.","reasons.name_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.birth_date_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.nationality_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.document_number_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.liveness_inconclusive":"لنحاول مجددًا: اجعل وجهك مقابل مصدر ضوء وابقَ ثابتًا.","reasons.match_inconclusive":"لم نتمكّن من التأكد من أنك أنت. حاول مجددًا في إضاءة جيدة ومن دون نظارات.","hints.appearance":"لنحاول مجددًا: اجعل وجهك مقابل مصدر ضوء وابقَ ثابتًا.","hints.motion":"ابقَ ثابتًا وأمسك الهاتف بثبات، ثم حاول مجددًا.","hints.lighting":"اجعل وجهك مقابل نافذة أو مصباح حتى يكون مضاءً جيدًا، ثم حاول مجددًا.","hints.framing":"اقترب أكثر حتى يملأ وجهك الإطار، ثم حاول مجددًا.","reasons.subject_revoked":"لم تعد الهوية المحفوظة لهذا التحقق متاحة. على الجهة الطالبة إجراء تحقق كامل، وإعادة المحاولة لن تُجدي","reasons.probe_not_from_liveness":"أبقِ وجهك داخل الإطار طوال الوقت، ثم حاول مجددًا.","reasons.document_authenticity":"استخدم البطاقة الأصلية، لا صورة لها ولا نسخة منها، وتجنّب الانعكاسات.","reasons.mobile_required":"تابع على هاتفك لالتقاط صورة لوجهك.","reasons.capture_tampered":"تعذّر التحقق من هذا الالتقاط. استخدم الكاميرا المدمجة في هاتفك، دون تسجيل الشاشة أو تطبيقات الكاميرا.","reasons.device_velocity_exceeded":"لا يمكن استخدام هذا الجهاز لعملية تحقق أخرى حاليًا. تواصل مع الجهة.","reasons.device_cooldown":"محاولات كثيرة. حاول مجددًا لاحقًا.","cooldown.retryIn":"محاولات كثيرة. حاول مجددًا {time}.","cooldown.retryAt":"محاولات كثيرة. حاول مجددًا بعد {time}.","capture.busy":"خدمتنا مشغولة حاليًا. نعيد المحاولة…","errors.inference_unavailable":"حاول مجددًا بعد لحظات.","method.title":"كيف تريد التحقق من هويتك؟","method.description":"اختر إحدى الطريقتين للمتابعة","returning.title":"أكّد أنك أنت","returning.description":"سبق أن تحقّقت من هويتك. التقاط قصير لوجهك يكفي لتأكيد أنك أنت.","method.national_number":"إدخال الرقم الوطني للتعريف الموريتاني (NNI)","method.document_photo":"تصوير وثيقتي","errors.method_required":"اختر طريقة التحقق، ثم تابع","errors.attestation_invalid":"تعذّر التأكد من سلامة جلسة المتصفح. أعد تحميل الصفحة وحاول مجددًا","errors.network_error":"تعذّر الوصول إلى خدمة التحقق. تحقق من اتصالك بالإنترنت وأعد المحاولة","errors.session_expired":"انتهت صلاحية جلسة التحقق هذه. اطلب رابطًا جديدًا من الجهة التي أرسلتك إلى هنا","errors.nni_unbound":"أُنشئ هذا الرابط دون رقمك الوطني للتعريف. اطلب رابطًا جديدًا من الجهة الطالبة","errors.id_number_unbound":"أُنشئ هذا الرابط دون رقم هويتك. اطلب رابطًا جديدًا من الجهة الطالبة","capture.tips.title":"لتحقق ناجح:","capture.tips.light":"اجعل الضوء أمام وجهك وتجنّب الإضاءة القوية خلفك","capture.tips.uncover":"اكشف وجهك: بلا نظارات أو كمامة أو يد أمامه","capture.tips.eyeLevel":"أمسك هاتفك بمستوى العينين","capture.tips.straight":"انظر مباشرة إلى الكاميرا وابقَ ثابتًا","capture.tips.summary":"اختر مكانًا جيد الإضاءة. اكشف وجهك: بلا نظارات أو كمامة. بعد تشغيل الكاميرا، أمسك هاتفك بمستوى العينين، وانظر مباشرة إلى الكاميرا وابقَ ثابتًا.","capture.tips.listen":"استمع إلى التعليمات","capture.tips.stop":"إيقاف","capture.permission.granted":"تم السماح بالوصول إلى الكاميرا","capture.permission.prompt":"سيطلب متصفحك استخدام الكاميرا. اختر «السماح»","capture.permission.denied":"الوصول إلى الكاميرا محظور. اسمح به من إعدادات المتصفح (رمز الكاميرا في شريط العنوان)، ثم أعد تحميل الصفحة","capture.permission.unknown":"سنطلب استخدام الكاميرا عند البدء","capture.cameraLabel":"الكاميرا","capture.facing.user":"الكاميرا الأمامية","capture.facing.environment":"الكاميرا الخلفية","capture.assisted.title":"صوّر وجه الشخص","capture.assisted.lead":"وجّه الكاميرا الخلفية نحو وجه الشخص وأمسك الهاتف بشكل عمودي. الإرشادات الصوتية تخاطب الشخص الذي تصوّره.","capture.assisted.stage":"وجّه الكاميرا نحو وجه الشخص","capture.voiceGuidance":"الإرشاد الصوتي","capture.preparing.hint":"يجري إعداد كشف الوجه على جهازك. قد يستغرق ذلك لحظة على اتصال بطيء","capture.ready":"جاهز. ابدأ عندما تكون مستعدًا","fcv2.err.models":"تعذّر تحميل نماذج التعرف على الوجه. تحقق من اتصالك ثم أعد المحاولة"};var p={"capture.start":"Démarrer la caméra","capture.recordAgain":"Commencer une nouvelle tentative","capture.switchCamera":"Changer de caméra","capture.preparing.title":"Préparation de la capture sécurisée…","capture.checking":"Nous vérifions votre identité…","capture.checkingHint":"Cela prend généralement quelques secondes. Gardez cette page ouverte","capture.securityNote":"Vos images sont chiffrées et utilisées uniquement pour cette vérification","capture.cameraOff":"Caméra éteinte","capture.previewAlt":"Aperçu de l’image capturée de votre visage","capture.retryCoaching.title":"Cette tentative n'a pas abouti. Quelques ajustements vous aideront :","capture.retryCoaching.light":"Placez-vous dans un endroit bien éclairé, avec la lumière sur le visage et non derrière vous","capture.retryCoaching.eyeLevel":"Tenez votre téléphone à hauteur des yeux","capture.retryCoaching.head":"Regardez droit vers la caméra, la tête bien droite","capture.attemptsRemaining.one":"{count} tentative restante","capture.attemptsRemaining.other":"{count} tentatives restantes","common.retry":"Réessayer","fcv2.err.permission":"Autorisez la caméra dans les réglages du navigateur (icône caméra dans la barre d’adresse), puis réessayez","fcv2.err.notfound":"Aucune caméra détectée. Branchez ou activez une caméra, puis réessayez","fcv2.err.inuse":"La caméra est utilisée par une autre application. Fermez-la, puis réessayez","fcv2.err.insecure":"La caméra nécessite une connexion sécurisée (HTTPS). Rouvrez cette page en HTTPS","fcv2.err.unsupported":"Votre navigateur ne prend pas en charge un format de capture compatible. Ouvrez cette page dans un navigateur récent comme Chrome ou Safari","fcv2.err.generic":"Caméra indisponible. Réessayez, ou contactez le support si le problème persiste","fcv3.no_face":"Nous ne voyons pas votre visage. Tenez le téléphone devant vous","fcv3.come_closer":"Rapprochez un peu le téléphone","fcv3.move_back":"Éloignez un peu le téléphone","fcv3.center_face":"Centrez votre visage dans le cercle","fcv3.straighten":"Tenez la tête droite","fcv3.more_light":"Cherchez un endroit plus lumineux. Éclairez votre visage","fcv3.too_bright":"Trop de lumière. Évitez la lumière directe sur le visage","fcv3.hold_still":"Parfait, ne bougez plus","fcv3.steady_camera":"Tenez le téléphone stable","fcv3.hold_upright":"Tenez le téléphone à la verticale","reasons.no_face":"Aucun visage n’a pu être détecté pendant la vérification","reasons.media_unreadable":"La capture envoyée n’a pas pu être lue","reasons.clip_too_short":"La capture était trop courte","reasons.spoof_detected":"Le contrôle de présence n'a pas pu confirmer la présence d'une personne réelle devant la caméra","reasons.review_band":"Le contrôle automatique n'a pas été concluant, il a donc été transmis à un examen humain","reasons.nni_not_found":"Le numéro national d'identification n'a pas été trouvé dans le registre d'état civil","reasons.nni_invalid":"Le numéro national d'identification n'est pas un NNI valide à 10 chiffres","reasons.registry_unavailable":"Le registre d'état civil n'a pas pu être joint pour confirmer votre numéro","reasons.result_from_cache":"Le contrôle du registre a été confirmé à partir d'une copie récente du registre","reasons.no_face_source":"Aucun visage n'a pu être détecté sur la photo selfie","reasons.no_face_reference":"Aucune photo de référence n'était disponible pour comparer votre selfie. C'est au demandeur de le résoudre : reprendre votre selfie n'y changera rien","reasons.low_quality_reference":"La photo de référence enregistrée n'était pas assez nette pour la comparaison","reasons.below_threshold":"Le selfie ne correspondait pas suffisamment à la photo de la pièce d'identité","reasons.side_missing":"Un côté de la pièce d'identité n'a pas été envoyé","reasons.mrz_checksum_failed":"La zone de lecture automatique du document n'a pas pu être validée","reasons.unreadable":"La photo du document n'était pas assez nette pour être lue","reasons.expired_document":"La pièce d'identité a expiré","reasons.authenticity_review":"Le document a été transmis à un examen humain pour confirmer son authenticité","reasons.registry_mismatch":"Les informations du document ne correspondent pas au registre civil. Un examinateur va vérifier","reasons.document_nni_mismatch":"Ce document appartient à une autre personne que celle pour qui cette vérification a été créée","reasons.id_number_invalid":"Le numéro d'identité n'est pas valide","reasons.registry_record_not_found":"Aucun dossier n'a été trouvé dans le registre pour ce numéro d'identité","reasons.document_id_number_mismatch":"Ce document appartient à une autre personne que celle pour qui cette vérification a été créée","reasons.otp_mismatch":"Le code de vérification ne correspond pas à celui que nous avons envoyé","reasons.otp_expired":"Le code de vérification a expiré avant d'être saisi","reasons.otp_send_failed":"Nous n'avons pas pu envoyer de code de vérification à votre téléphone","reasons.uncalibrated_capture_channel":"Les captures webcam ne sont pas encore décidées automatiquement, votre vérification part donc en revue humaine","reasons.capture_back_camera":"Utilisez la caméra avant. Tenez le téléphone devant votre visage et réessayez","reasons.capture_not_upright":"Tenez votre téléphone à la verticale, pas à l'horizontale, et réessayez","reasons.location_not_allowed":"La vérification n'est pas disponible dans votre région.","reasons.anonymizer_blocked":"Désactivez votre VPN ou proxy, puis rouvrez le lien.","reasons.nationality_not_allowed":"Ce service ne peut pas vérifier ce document. Contactez l'organisation pour d'autres options.","reasons.document_type_not_accepted":"Ce type de document n'est pas accepté. Choisissez un autre document.","reasons.underage":"Vous n'avez pas l'âge minimum requis pour ce service.","reasons.age_unverifiable":"Nous n'avons pas pu lire votre date de naissance. Prenez une photo plus nette de votre document.","reasons.nationality_unreadable":"Nous n'avons pas pu lire votre nationalité. Prenez une photo plus nette de votre document.","reasons.name_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.birth_date_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.nationality_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.document_number_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.liveness_inconclusive":"Réessayons : placez-vous face à une source de lumière et restez immobile.","reasons.match_inconclusive":"Nous n'avons pas pu confirmer qu'il s'agit bien de vous. Réessayez dans un endroit bien éclairé, sans lunettes.","hints.appearance":"Réessayons : placez-vous face à une source de lumière et restez immobile.","hints.motion":"Restez immobile et tenez le téléphone bien stable, puis réessayez.","hints.lighting":"Placez-vous face à une fenêtre ou une lampe pour que votre visage soit bien éclairé, puis réessayez.","hints.framing":"Rapprochez-vous pour que votre visage remplisse le cadre, puis réessayez.","reasons.subject_revoked":"L'identité enregistrée pour cette vérification n'est plus disponible. Le demandeur doit lancer une vérification complète : réessayer n'y changera rien","reasons.probe_not_from_liveness":"Gardez votre visage dans le cadre tout du long, puis réessayez.","reasons.document_authenticity":"Utilisez la carte originale, pas une photo ni une copie, et évitez les reflets.","reasons.mobile_required":"Continuez sur votre téléphone pour prendre le selfie.","reasons.capture_tampered":"Nous n'avons pas pu vérifier cette capture. Utilisez l'appareil photo intégré de votre téléphone, sans enregistrement d'écran ni application de caméra.","reasons.device_velocity_exceeded":"Cet appareil ne peut pas servir à une autre vérification pour le moment. Contactez l'organisation.","reasons.device_cooldown":"Trop de tentatives. Réessayez plus tard.","cooldown.retryIn":"Trop de tentatives. Réessayez {time}.","cooldown.retryAt":"Trop de tentatives. Réessayez à partir de {time}.","capture.busy":"Notre service est très sollicité. Nouvel essai en cours…","errors.inference_unavailable":"Réessayez dans un instant.","method.title":"Comment souhaitez-vous vérifier votre identité ?","method.description":"Choisissez une option pour continuer","returning.title":"Confirmez qu'il s'agit bien de vous","returning.description":"Vous avez déjà vérifié votre identité. Une courte capture du visage confirme qu'il s'agit toujours de vous.","method.national_number":"Saisir mon numéro national d'identification mauritanien (NNI)","method.document_photo":"Photographier mon document","errors.method_required":"Choisissez comment vérifier votre identité, puis continuez","errors.attestation_invalid":"Nous n'avons pas pu confirmer l'authenticité de cette session de navigateur. Rechargez la page et réessayez","errors.network_error":"Nous n'avons pas pu joindre le service de vérification. Vérifiez votre connexion internet et réessayez","errors.session_expired":"Cette session de vérification a expiré. Demandez un nouveau lien à l'organisme qui vous a envoyé ici","errors.nni_unbound":"Ce lien a été créé sans votre numéro national d'identification. Demandez un nouveau lien à l'organisme demandeur","errors.id_number_unbound":"Ce lien a été créé sans votre numéro d'identité. Demandez un nouveau lien à l'organisme demandeur","capture.tips.title":"Pour une vérification réussie :","capture.tips.light":"Placez-vous face à la lumière et évitez une forte lumière derrière vous","capture.tips.uncover":"Dégagez votre visage : ni lunettes, ni masque, ni main devant","capture.tips.eyeLevel":"Tenez votre téléphone à hauteur des yeux","capture.tips.straight":"Regardez droit vers la caméra et restez immobile","capture.tips.summary":"Placez-vous dans une zone bien éclairée. Dégagez votre visage : ni lunettes, ni masque. Une fois la caméra démarrée, tenez votre téléphone à hauteur des yeux, regardez droit vers la caméra et restez immobile.","capture.tips.listen":"Écouter les instructions","capture.tips.stop":"Arrêter","capture.permission.granted":"Accès à la caméra autorisé","capture.permission.prompt":"Votre navigateur va demander l’accès à la caméra. Choisissez « Autoriser »","capture.permission.denied":"L’accès à la caméra est bloqué. Autorisez-le dans les réglages du navigateur (icône caméra dans la barre d’adresse), puis rechargez la page","capture.permission.unknown":"Nous demanderons l’accès à la caméra au démarrage","capture.cameraLabel":"Caméra","capture.facing.user":"Caméra avant","capture.facing.environment":"Caméra arrière","capture.assisted.title":"Filmez le visage de la personne","capture.assisted.lead":"Pointez la caméra arrière vers le visage de la personne et tenez le téléphone à la verticale. Le guidage vocal s'adresse à la personne filmée.","capture.assisted.stage":"Pointez la caméra vers le visage de la personne","capture.voiceGuidance":"Guidage vocal","capture.preparing.hint":"Mise en place de la détection du visage sur l’appareil. Cela peut prendre un instant sur une connexion lente","capture.ready":"Prêt. Commencez quand vous voulez","fcv2.err.models":"Impossible de charger les modèles de détection du visage. Vérifiez votre connexion puis réessayez"};var l={},m=r(e=>e==="es"||e==="pt"||e==="de","isOverlayLocale");function h(e){return m(e)?"en":e}r(h,"baseLocale");function f(e){return m(e)?l[e]:void 0}r(f,"overlayOf");function g(e){return m(e)&&l[e]===void 0}r(g,"overlayPending");function _(e){return g(e)?(e==="es"?import("./overlay-es-XQFAQT24.js"):e==="pt"?import("./overlay-pt-2YEUC3J2.js"):import("./overlay-de-UTUY4YEE.js")).then(n=>{l[e]=n.overlay},()=>{l[e]={}}):Promise.resolve()}r(_,"loadSekyroLocale");var v=Object.freeze({"reasons.id_number_invalid":"reasons.nni_invalid","reasons.registry_record_not_found":"reasons.nni_not_found","reasons.document_id_number_mismatch":"reasons.document_nni_mismatch","errors.id_number_unbound":"errors.nni_unbound","population.reason_id_number_invalid":"population.reason_nni_invalid","population.reason_registry_record_not_found":"population.reason_nni_not_found","population.reason_registry_record_not_found_or_document":"population.reason_nni_not_found_or_document","summary.id_number":"summary.nni"}),C=new Map(Object.entries(v).filter(([e])=>e.startsWith("reasons.")).map(([e,t])=>[t.slice(8),e.slice(8)]));function y(e){return C.get(e)??e}r(y,"genericReason");function b(e,t){let n=e,a=t;for(let[o,i]of Object.entries(v)){let s=a[o],c=a[i];typeof s!="string"&&typeof c=="string"?n[o]=c:typeof c!="string"&&typeof s=="string"&&(n[i]=s)}}r(b,"aliasRenamedKeys");function W(e){switch(e){case"center":return"fcv3.center_face";case"closer":return"fcv3.come_closer";case"farther":return"fcv3.move_back";case"light":return"fcv3.more_light";case"still":case"hold":return"fcv3.hold_still";case"upright":return"fcv3.hold_upright";default:{let t=e;throw new Error(`hintStringKey: unhandled hint ${t}`)}}}r(W,"hintStringKey");function G(e){let t=`hints.${e}`;return Object.hasOwn(u,t)?t:null}r(G,"retakeHintStringKey");function $(e){return`fcv2.err.${e}`}r($,"captureErrorStringKey");function Y(e){switch(e){case"no_recorder":return"fcv2.err.unsupported";case"attestation":return"errors.attestation_invalid";case"network":return"errors.network_error";case"nni_unbound":case"id_number_unbound":return"errors.id_number_unbound";case"method_required":return"errors.method_required";case"inference_unavailable":return"errors.inference_unavailable";default:{let t=`reasons.${y(e)}`;return Object.hasOwn(u,t)?t:null}}}r(Y,"reasonStringKey");function Q(e,t,n=new Date){if(t===void 0)return null;let a=new Date(t),o=a.getTime()-n.getTime();if(!Number.isFinite(o)||o<=0)return null;if(o<36e5){let c=Math.max(1,Math.ceil(o/6e4));return{key:"cooldown.retryIn",time:new Intl.RelativeTimeFormat(e,{numeric:"always"}).format(c,"minute")}}let i=a.toDateString()===n.toDateString();return{key:"cooldown.retryAt",time:new Intl.DateTimeFormat(e,{...i?{}:{day:"numeric",month:"long"},hour:"2-digit",minute:"2-digit"}).format(a)}}r(Q,"retryAfterTime");function J(e,t,n){let a=new Intl.PluralRules(t).select(n);return((a==="other"?void 0:e[`capture.attemptsRemaining.${a}`])??e["capture.attemptsRemaining.other"]).replace("{count}",new Intl.NumberFormat(t).format(n))}r(J,"attemptsRemainingText");import{createContext as L,useContext as S,useEffect as x,useState as R}from"react";var w={ar:d,fr:p,en:u};function ie(e,t){let n=f(e),a=n===void 0?w[h(e)]:{...w.en,...n};if(t===void 0)return a;let o={...a};for(let i of Object.keys(t)){let s=t[i];typeof s=="string"&&(o[i]=s)}return b(o,t),o}r(ie,"resolveStrings");function se(e){let[,t]=R(0),n=g(e);return x(()=>{if(!n)return;let a=!0;return _(e).then(()=>a&&t(o=>o+1)),()=>{a=!1}},[e,n]),!n}r(se,"useLocaleReady");var z=L(e=>u[e]??""),ce=z.Provider;function ue(){return S(z)}r(ue,"useStrings");import{useCallback as N}from"react";function me(){return N(e=>{e?.focus()},[])}r(me,"useFocusOnMount");import{jsx as q}from"react/jsx-runtime";function fe({tone:e,role:t,children:n,testId:a}){return q("div",{role:t??(e==="info"?"status":"alert"),className:`sekyro-notice sekyro-notice--${e}`,"data-testid":a,children:n})}r(fe,"Notice");export{A as a,u as b,y as c,b as d,d as e,p as f,h as g,f as h,_ as i,W as j,G as k,$ as l,Y as m,Q as n,J as o,ie as p,se as q,ce as r,ue as s,fe as t,me as u};
2
+ import{a as r}from"./chunk-2KED7D2Q.js";import{forwardRef as k}from"react";import{jsx as T}from"react/jsx-runtime";var A=k(r(function({kind:t="primary",full:n=!1,className:a,type:o,...i},s){let c=["sekyro-btn",`sekyro-btn--${t}`];return n&&c.push("sekyro-btn--full"),a!==void 0&&c.push(a),T("button",{ref:s,type:o??"button",className:c.join(" "),...i})},"Button"));var u={"capture.start":"Start camera","capture.recordAgain":"Start a new attempt","capture.switchCamera":"Switch camera","capture.preparing.title":"Preparing secure capture…","capture.checking":"We're checking your identity…","capture.checkingHint":"This usually takes a few seconds. Keep this page open","capture.securityNote":"Your images are encrypted and used only for this verification","capture.cameraOff":"Camera off","capture.previewAlt":"Preview of the captured image of your face","capture.retryCoaching.title":"That attempt didn't work. A few adjustments will help:","capture.retryCoaching.light":"Find good lighting, with the light on your face and not behind you","capture.retryCoaching.eyeLevel":"Hold your phone at eye level","capture.retryCoaching.head":"Look straight at the camera and keep your head upright","capture.attemptsRemaining.one":"{count} attempt remaining","capture.attemptsRemaining.other":"{count} attempts remaining","common.retry":"Try again","fcv2.err.permission":"Allow camera access in your browser settings (the camera icon in the address bar), then try again","fcv2.err.notfound":"No camera detected. Connect or enable a camera, then try again","fcv2.err.inuse":"Another app is using the camera. Close it, then try again","fcv2.err.insecure":"The camera needs a secure connection (HTTPS). Reopen this page over HTTPS","fcv2.err.unsupported":"Your browser cannot capture in a supported format. Open this page in a recent browser such as Chrome or Safari","fcv2.err.generic":"The camera is unavailable. Try again, or contact support if it keeps failing","fcv3.no_face":"We can't see your face. Hold the phone in front of you","fcv3.come_closer":"Bring the phone a little closer","fcv3.move_back":"Move the phone a little farther away","fcv3.center_face":"Center your face in the circle","fcv3.straighten":"Hold your head straight","fcv3.more_light":"Find a brighter spot. Light your face","fcv3.too_bright":"Too much light. Move out of direct light","fcv3.hold_still":"Perfect, hold still","fcv3.steady_camera":"Hold the phone steady","fcv3.hold_upright":"Hold the phone upright","reasons.no_face":"No face could be detected during the check","reasons.media_unreadable":"The submitted capture could not be read","reasons.clip_too_short":"The capture was too short","reasons.spoof_detected":"The liveness check could not confirm a live person in front of the camera","reasons.review_band":"The automatic check was not conclusive, so it was sent to human review","reasons.nni_not_found":"The national identification number was not found in the civil registry","reasons.nni_invalid":"The national identification number is not a valid 10-digit NNI","reasons.registry_unavailable":"The civil registry could not be reached to confirm your number","reasons.result_from_cache":"The registry check was confirmed from a recent copy of the registry","reasons.no_face_source":"No face could be detected in the selfie photo","reasons.no_face_reference":"No reference photo was available to compare your selfie against. The requester needs to resolve this, so retaking your selfie will not help","reasons.low_quality_reference":"The reference photo on file was not clear enough to compare against","reasons.below_threshold":"The selfie did not match the photo on the identity document closely enough","reasons.side_missing":"One side of the identity document was not submitted","reasons.mrz_checksum_failed":"The machine-readable zone of the document could not be validated","reasons.unreadable":"The document photo was not clear enough to read","reasons.expired_document":"The identity document has expired","reasons.authenticity_review":"The document was sent to human review to confirm its authenticity","reasons.registry_mismatch":"The document's details did not match the civil registry. A reviewer will check","reasons.document_nni_mismatch":"This document belongs to a different person than the one this verification was created for","reasons.id_number_invalid":"The ID number is not valid","reasons.registry_record_not_found":"No record was found in the registry for this ID number","reasons.document_id_number_mismatch":"This document belongs to a different person than the one this verification was created for","reasons.otp_mismatch":"The verification code did not match the one we sent","reasons.otp_expired":"The verification code expired before it was entered","reasons.otp_send_failed":"We could not send a verification code to your phone","reasons.uncalibrated_capture_channel":"Desktop/webcam captures are not yet auto-decided, so your verification went to human review","reasons.capture_back_camera":"Use the front camera. Hold the phone in front of your face and try again","reasons.capture_not_upright":"Hold your phone upright, not sideways, and try again","reasons.location_not_allowed":"Verification isn't available in your region.","reasons.anonymizer_blocked":"Turn off your VPN or proxy, then open the link again.","reasons.nationality_not_allowed":"This service can't verify this document. Contact the organization for other options.","reasons.document_type_not_accepted":"This type of document isn't accepted. Choose another document.","reasons.underage":"You don't meet the minimum age for this service.","reasons.age_unverifiable":"We couldn't read your date of birth. Take a clearer photo of your document.","reasons.nationality_unreadable":"We couldn't read your nationality. Take a clearer photo of your document.","reasons.name_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.birth_date_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.nationality_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.document_number_mismatch":"The details don't match the information the organization has. Contact the organization.","reasons.liveness_inconclusive":"Let's try again: face a light source and hold still.","reasons.match_inconclusive":"We couldn't confirm it's you. Try again in good light, without glasses.","hints.appearance":"Let's try again: face a light source and hold still.","hints.motion":"Hold still and keep the phone steady, then try again.","hints.lighting":"Face a window or a lamp so your face is well lit, then try again.","hints.framing":"Move closer so your face fills the frame, then try again.","reasons.subject_revoked":"The identity on file for this check is no longer available. The requester needs to run a full verification, so retrying will not help","reasons.probe_not_from_liveness":"Keep your face in the frame the whole time, then try again.","reasons.document_authenticity":"Use the original card, not a photo or a copy, and avoid reflections.","reasons.mobile_required":"Continue on your phone to take the selfie.","reasons.capture_tampered":"We couldn't verify this capture. Use your phone's built-in camera, without screen recording or camera apps.","reasons.device_velocity_exceeded":"This device can't be used for another verification right now. Contact the organization.","reasons.device_cooldown":"Too many attempts. Try again later.","cooldown.retryIn":"Too many attempts. Try again {time}.","cooldown.retryAt":"Too many attempts. Try again after {time}.","capture.busy":"Our service is busy. Trying again…","errors.inference_unavailable":"Try again in a moment.","method.title":"How do you want to verify?","method.description":"Choose one option to continue","returning.title":"Confirm it's you","returning.description":"You verified your identity before. One short face capture confirms it's still you.","method.national_number":"Enter my Mauritanian national ID number (NNI)","method.document_photo":"Photo of my document","errors.method_required":"Choose how you want to verify, then continue","errors.attestation_invalid":"We could not confirm this browser session is genuine. Reload the page and try again","errors.network_error":"We could not reach the verification service. Check your internet connection and try again","errors.session_expired":"This verification session has expired. Ask the organisation that sent you here for a new link","errors.nni_unbound":"This link was created without your national ID number. Ask the requester for a new link","errors.id_number_unbound":"This link was created without your ID number. Ask the requester for a new link","capture.tips.title":"For a successful check:","capture.tips.light":"Face a light source and avoid strong light behind you","capture.tips.uncover":"Uncover your face: no glasses, mask or hand in front of it","capture.tips.eyeLevel":"Hold your phone at eye level","capture.tips.straight":"Look straight at the camera and keep still","capture.tips.summary":"Stand in a well-lit area. Uncover your face: no glasses, no mask. Once the camera starts, hold your phone at eye level, look straight at the camera and keep still.","capture.tips.listen":"Listen to the instructions","capture.tips.stop":"Stop","capture.permission.granted":"Camera access allowed","capture.permission.prompt":"Your browser will ask to use the camera. Choose Allow","capture.permission.denied":"Camera access is blocked. Allow it in your browser settings (the camera icon in the address bar), then reload this page","capture.permission.unknown":"We'll ask to use your camera when you start","capture.cameraLabel":"Camera","capture.facing.user":"Front camera","capture.facing.environment":"Back camera","capture.assisted.title":"Capture the person's face","capture.assisted.lead":"Point the back camera at the person's face and hold the phone upright. The voice guidance speaks to the person being filmed.","capture.assisted.stage":"Point the camera at the person's face","capture.voiceGuidance":"Voice guidance","capture.preparing.hint":"Setting up on-device face detection. This can take a moment on a slow connection","capture.ready":"Ready. Start when you are","fcv2.err.models":"The face-detection models could not be loaded. Check your connection and try again"};var d={"capture.start":"تشغيل الكاميرا","capture.recordAgain":"ابدأ محاولة جديدة","capture.switchCamera":"تبديل الكاميرا","capture.preparing.title":"جارٍ تجهيز الالتقاط الآمن…","capture.checking":"نتحقق من هويتك…","capture.checkingHint":"يستغرق هذا عادةً بضع ثوانٍ. أبقِ هذه الصفحة مفتوحة","capture.securityNote":"تُشفَّر لقطاتك وتُستخدم فقط لهذا التحقق","capture.cameraOff":"الكاميرا مطفأة","capture.previewAlt":"معاينة الصورة الملتقطة لوجهك","capture.retryCoaching.title":"لم تنجح هذه المحاولة. بعض التعديلات ستساعد:","capture.retryCoaching.light":"اختر مكانًا جيد الإضاءة، بحيث يكون الضوء على وجهك لا خلفك","capture.retryCoaching.eyeLevel":"أمسك هاتفك بمستوى العينين","capture.retryCoaching.head":"انظر مباشرة إلى الكاميرا وأبقِ رأسك مستقيمًا","capture.attemptsRemaining.zero":"لم تتبقَّ أي محاولة","capture.attemptsRemaining.one":"تبقّت محاولة واحدة","capture.attemptsRemaining.two":"تبقّت محاولتان","capture.attemptsRemaining.few":"تبقّت {count} محاولات","capture.attemptsRemaining.many":"تبقّت {count} محاولة","capture.attemptsRemaining.other":"تبقّت {count} محاولة","common.retry":"أعد المحاولة","fcv2.err.permission":"اسمح بالوصول إلى الكاميرا من إعدادات المتصفح (أيقونة الكاميرا في شريط العنوان) ثم أعد المحاولة","fcv2.err.notfound":"لم يتم العثور على كاميرا. وصِّل كاميرا أو فعِّلها ثم أعد المحاولة","fcv2.err.inuse":"تطبيق آخر يستخدم الكاميرا. أغلقه ثم أعد المحاولة","fcv2.err.insecure":"تتطلب الكاميرا اتصالًا آمنًا (HTTPS). افتح هذه الصفحة عبر HTTPS","fcv2.err.unsupported":"متصفحك لا يستطيع الالتقاط بصيغة مدعومة. افتح هذه الصفحة في متصفح حديث مثل كروم أو سفاري","fcv2.err.generic":"الكاميرا غير متاحة. أعد المحاولة، وتواصل مع الدعم إذا استمرت المشكلة","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":"أمسك الهاتف بشكل عمودي","reasons.no_face":"تعذّر اكتشاف أي وجه أثناء التحقق","reasons.media_unreadable":"تعذّرت قراءة اللقطة المُرسلة","reasons.clip_too_short":"كانت اللقطة أقصر من اللازم","reasons.spoof_detected":"لم يتمكن فحص الحضور الحي من تأكيد وجود شخص حقيقي أمام الكاميرا","reasons.review_band":"لم يكن الفحص التلقائي حاسمًا، لذا أُحيل إلى مراجعة بشرية","reasons.nni_not_found":"لم يُعثر على الرقم الوطني في سجل الحالة المدنية","reasons.nni_invalid":"الرقم الوطني ليس رقمًا صالحًا مكوّنًا من 10 أرقام","reasons.registry_unavailable":"تعذّر الوصول إلى سجل الحالة المدنية لتأكيد رقمك","reasons.result_from_cache":"أُكِّد فحص السجل استنادًا إلى نسخة حديثة من السجل","reasons.no_face_source":"تعذّر اكتشاف وجه في الصورة الذاتية","reasons.no_face_reference":"لم تتوفّر صورة مرجعية لمقارنة صورتك الذاتية بها. على الجهة الطالبة معالجة ذلك، وإعادة التقاط صورتك الذاتية لن تُجدي","reasons.low_quality_reference":"الصورة المرجعية المحفوظة لم تكن واضحة بما يكفي للمقارنة","reasons.below_threshold":"الصورة الذاتية لم تطابق صورة وثيقة الهوية بدرجة كافية","reasons.side_missing":"أحد وجهي وثيقة الهوية لم يُرسل","reasons.mrz_checksum_failed":"تعذّر التحقق من منطقة القراءة الآلية في الوثيقة","reasons.unreadable":"صورة الوثيقة لم تكن واضحة بما يكفي للقراءة","reasons.expired_document":"انتهت صلاحية وثيقة الهوية","reasons.authenticity_review":"أُحيلت الوثيقة إلى مراجعة بشرية للتأكد من صحتها","reasons.registry_mismatch":"بيانات الوثيقة لا تطابق السجل المدني. سيتحقق منها مراجع","reasons.document_nni_mismatch":"هذه الوثيقة تخص شخصًا آخر غير الشخص الذي أُنشئ له هذا التحقق","reasons.id_number_invalid":"رقم الهوية غير صالح","reasons.registry_record_not_found":"لم يُعثر على أي سجل لرقم الهوية هذا في السجل","reasons.document_id_number_mismatch":"هذه الوثيقة تخص شخصًا آخر غير الشخص الذي أُنشئ له هذا التحقق","reasons.otp_mismatch":"رمز التحقّق لا يطابق الرمز الذي أرسلناه","reasons.otp_expired":"انتهت صلاحية رمز التحقّق قبل إدخاله","reasons.otp_send_failed":"تعذّر إرسال رمز التحقّق إلى هاتفك","reasons.uncalibrated_capture_channel":"جودة الكاميرا المكتبية غير معايَرة بعد، لذا أُحيل تحققك إلى مراجعة بشرية","reasons.capture_back_camera":"استخدم الكاميرا الأمامية. أمسك الهاتف أمام وجهك وحاول مرة أخرى","reasons.capture_not_upright":"أمسك هاتفك بشكل عمودي وليس أفقيًا، ثم حاول مرة أخرى","reasons.location_not_allowed":"التحقق غير متاح في منطقتك.","reasons.anonymizer_blocked":"أوقف تشغيل VPN أو الوكيل ثم افتح الرابط مجددًا.","reasons.nationality_not_allowed":"لا يمكن لهذه الخدمة التحقق من هذه الوثيقة. تواصل مع الجهة لمعرفة الخيارات الأخرى.","reasons.document_type_not_accepted":"هذا النوع من الوثائق غير مقبول. اختر وثيقة أخرى.","reasons.underage":"لا تستوفي الحد الأدنى للسن لهذه الخدمة.","reasons.age_unverifiable":"تعذّرت قراءة تاريخ ميلادك. التقط صورة أوضح لوثيقتك.","reasons.nationality_unreadable":"تعذّرت قراءة جنسيتك. التقط صورة أوضح لوثيقتك.","reasons.name_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.birth_date_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.nationality_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.document_number_mismatch":"بياناتك لا تطابق المعلومات المتوفرة لدى الجهة. تواصل مع الجهة.","reasons.liveness_inconclusive":"لنحاول مجددًا: اجعل وجهك مقابل مصدر ضوء وابقَ ثابتًا.","reasons.match_inconclusive":"لم نتمكّن من التأكد من أنك أنت. حاول مجددًا في إضاءة جيدة ومن دون نظارات.","hints.appearance":"لنحاول مجددًا: اجعل وجهك مقابل مصدر ضوء وابقَ ثابتًا.","hints.motion":"ابقَ ثابتًا وأمسك الهاتف بثبات، ثم حاول مجددًا.","hints.lighting":"اجعل وجهك مقابل نافذة أو مصباح حتى يكون مضاءً جيدًا، ثم حاول مجددًا.","hints.framing":"اقترب أكثر حتى يملأ وجهك الإطار، ثم حاول مجددًا.","reasons.subject_revoked":"لم تعد الهوية المحفوظة لهذا التحقق متاحة. على الجهة الطالبة إجراء تحقق كامل، وإعادة المحاولة لن تُجدي","reasons.probe_not_from_liveness":"أبقِ وجهك داخل الإطار طوال الوقت، ثم حاول مجددًا.","reasons.document_authenticity":"استخدم البطاقة الأصلية، لا صورة لها ولا نسخة منها، وتجنّب الانعكاسات.","reasons.mobile_required":"تابع على هاتفك لالتقاط صورة لوجهك.","reasons.capture_tampered":"تعذّر التحقق من هذا الالتقاط. استخدم الكاميرا المدمجة في هاتفك، دون تسجيل الشاشة أو تطبيقات الكاميرا.","reasons.device_velocity_exceeded":"لا يمكن استخدام هذا الجهاز لعملية تحقق أخرى حاليًا. تواصل مع الجهة.","reasons.device_cooldown":"محاولات كثيرة. حاول مجددًا لاحقًا.","cooldown.retryIn":"محاولات كثيرة. حاول مجددًا {time}.","cooldown.retryAt":"محاولات كثيرة. حاول مجددًا بعد {time}.","capture.busy":"خدمتنا مشغولة حاليًا. نعيد المحاولة…","errors.inference_unavailable":"حاول مجددًا بعد لحظات.","method.title":"كيف تريد التحقق من هويتك؟","method.description":"اختر إحدى الطريقتين للمتابعة","returning.title":"أكّد أنك أنت","returning.description":"سبق أن تحقّقت من هويتك. التقاط قصير لوجهك يكفي لتأكيد أنك أنت.","method.national_number":"إدخال الرقم الوطني للتعريف الموريتاني (NNI)","method.document_photo":"تصوير وثيقتي","errors.method_required":"اختر طريقة التحقق، ثم تابع","errors.attestation_invalid":"تعذّر التأكد من سلامة جلسة المتصفح. أعد تحميل الصفحة وحاول مجددًا","errors.network_error":"تعذّر الوصول إلى خدمة التحقق. تحقق من اتصالك بالإنترنت وأعد المحاولة","errors.session_expired":"انتهت صلاحية جلسة التحقق هذه. اطلب رابطًا جديدًا من الجهة التي أرسلتك إلى هنا","errors.nni_unbound":"أُنشئ هذا الرابط دون رقمك الوطني للتعريف. اطلب رابطًا جديدًا من الجهة الطالبة","errors.id_number_unbound":"أُنشئ هذا الرابط دون رقم هويتك. اطلب رابطًا جديدًا من الجهة الطالبة","capture.tips.title":"لتحقق ناجح:","capture.tips.light":"اجعل الضوء أمام وجهك وتجنّب الإضاءة القوية خلفك","capture.tips.uncover":"اكشف وجهك: بلا نظارات أو كمامة أو يد أمامه","capture.tips.eyeLevel":"أمسك هاتفك بمستوى العينين","capture.tips.straight":"انظر مباشرة إلى الكاميرا وابقَ ثابتًا","capture.tips.summary":"اختر مكانًا جيد الإضاءة. اكشف وجهك: بلا نظارات أو كمامة. بعد تشغيل الكاميرا، أمسك هاتفك بمستوى العينين، وانظر مباشرة إلى الكاميرا وابقَ ثابتًا.","capture.tips.listen":"استمع إلى التعليمات","capture.tips.stop":"إيقاف","capture.permission.granted":"تم السماح بالوصول إلى الكاميرا","capture.permission.prompt":"سيطلب متصفحك استخدام الكاميرا. اختر «السماح»","capture.permission.denied":"الوصول إلى الكاميرا محظور. اسمح به من إعدادات المتصفح (رمز الكاميرا في شريط العنوان)، ثم أعد تحميل الصفحة","capture.permission.unknown":"سنطلب استخدام الكاميرا عند البدء","capture.cameraLabel":"الكاميرا","capture.facing.user":"الكاميرا الأمامية","capture.facing.environment":"الكاميرا الخلفية","capture.assisted.title":"صوّر وجه الشخص","capture.assisted.lead":"وجّه الكاميرا الخلفية نحو وجه الشخص وأمسك الهاتف بشكل عمودي. الإرشادات الصوتية تخاطب الشخص الذي تصوّره.","capture.assisted.stage":"وجّه الكاميرا نحو وجه الشخص","capture.voiceGuidance":"الإرشاد الصوتي","capture.preparing.hint":"يجري إعداد كشف الوجه على جهازك. قد يستغرق ذلك لحظة على اتصال بطيء","capture.ready":"جاهز. ابدأ عندما تكون مستعدًا","fcv2.err.models":"تعذّر تحميل نماذج التعرف على الوجه. تحقق من اتصالك ثم أعد المحاولة"};var p={"capture.start":"Démarrer la caméra","capture.recordAgain":"Commencer une nouvelle tentative","capture.switchCamera":"Changer de caméra","capture.preparing.title":"Préparation de la capture sécurisée…","capture.checking":"Nous vérifions votre identité…","capture.checkingHint":"Cela prend généralement quelques secondes. Gardez cette page ouverte","capture.securityNote":"Vos images sont chiffrées et utilisées uniquement pour cette vérification","capture.cameraOff":"Caméra éteinte","capture.previewAlt":"Aperçu de l’image capturée de votre visage","capture.retryCoaching.title":"Cette tentative n'a pas abouti. Quelques ajustements vous aideront :","capture.retryCoaching.light":"Placez-vous dans un endroit bien éclairé, avec la lumière sur le visage et non derrière vous","capture.retryCoaching.eyeLevel":"Tenez votre téléphone à hauteur des yeux","capture.retryCoaching.head":"Regardez droit vers la caméra, la tête bien droite","capture.attemptsRemaining.one":"{count} tentative restante","capture.attemptsRemaining.other":"{count} tentatives restantes","common.retry":"Réessayer","fcv2.err.permission":"Autorisez la caméra dans les réglages du navigateur (icône caméra dans la barre d’adresse), puis réessayez","fcv2.err.notfound":"Aucune caméra détectée. Branchez ou activez une caméra, puis réessayez","fcv2.err.inuse":"La caméra est utilisée par une autre application. Fermez-la, puis réessayez","fcv2.err.insecure":"La caméra nécessite une connexion sécurisée (HTTPS). Rouvrez cette page en HTTPS","fcv2.err.unsupported":"Votre navigateur ne prend pas en charge un format de capture compatible. Ouvrez cette page dans un navigateur récent comme Chrome ou Safari","fcv2.err.generic":"Caméra indisponible. Réessayez, ou contactez le support si le problème persiste","fcv3.no_face":"Nous ne voyons pas votre visage. Tenez le téléphone devant vous","fcv3.come_closer":"Rapprochez un peu le téléphone","fcv3.move_back":"Éloignez un peu le téléphone","fcv3.center_face":"Centrez votre visage dans le cercle","fcv3.straighten":"Tenez la tête droite","fcv3.more_light":"Cherchez un endroit plus lumineux. Éclairez votre visage","fcv3.too_bright":"Trop de lumière. Évitez la lumière directe sur le visage","fcv3.hold_still":"Parfait, ne bougez plus","fcv3.steady_camera":"Tenez le téléphone stable","fcv3.hold_upright":"Tenez le téléphone à la verticale","reasons.no_face":"Aucun visage n’a pu être détecté pendant la vérification","reasons.media_unreadable":"La capture envoyée n’a pas pu être lue","reasons.clip_too_short":"La capture était trop courte","reasons.spoof_detected":"Le contrôle de présence n'a pas pu confirmer la présence d'une personne réelle devant la caméra","reasons.review_band":"Le contrôle automatique n'a pas été concluant, il a donc été transmis à un examen humain","reasons.nni_not_found":"Le numéro national d'identification n'a pas été trouvé dans le registre d'état civil","reasons.nni_invalid":"Le numéro national d'identification n'est pas un NNI valide à 10 chiffres","reasons.registry_unavailable":"Le registre d'état civil n'a pas pu être joint pour confirmer votre numéro","reasons.result_from_cache":"Le contrôle du registre a été confirmé à partir d'une copie récente du registre","reasons.no_face_source":"Aucun visage n'a pu être détecté sur la photo selfie","reasons.no_face_reference":"Aucune photo de référence n'était disponible pour comparer votre selfie. C'est au demandeur de le résoudre : reprendre votre selfie n'y changera rien","reasons.low_quality_reference":"La photo de référence enregistrée n'était pas assez nette pour la comparaison","reasons.below_threshold":"Le selfie ne correspondait pas suffisamment à la photo de la pièce d'identité","reasons.side_missing":"Un côté de la pièce d'identité n'a pas été envoyé","reasons.mrz_checksum_failed":"La zone de lecture automatique du document n'a pas pu être validée","reasons.unreadable":"La photo du document n'était pas assez nette pour être lue","reasons.expired_document":"La pièce d'identité a expiré","reasons.authenticity_review":"Le document a été transmis à un examen humain pour confirmer son authenticité","reasons.registry_mismatch":"Les informations du document ne correspondent pas au registre civil. Un examinateur va vérifier","reasons.document_nni_mismatch":"Ce document appartient à une autre personne que celle pour qui cette vérification a été créée","reasons.id_number_invalid":"Le numéro d'identité n'est pas valide","reasons.registry_record_not_found":"Aucun dossier n'a été trouvé dans le registre pour ce numéro d'identité","reasons.document_id_number_mismatch":"Ce document appartient à une autre personne que celle pour qui cette vérification a été créée","reasons.otp_mismatch":"Le code de vérification ne correspond pas à celui que nous avons envoyé","reasons.otp_expired":"Le code de vérification a expiré avant d'être saisi","reasons.otp_send_failed":"Nous n'avons pas pu envoyer de code de vérification à votre téléphone","reasons.uncalibrated_capture_channel":"Les captures webcam ne sont pas encore décidées automatiquement, votre vérification part donc en revue humaine","reasons.capture_back_camera":"Utilisez la caméra avant. Tenez le téléphone devant votre visage et réessayez","reasons.capture_not_upright":"Tenez votre téléphone à la verticale, pas à l'horizontale, et réessayez","reasons.location_not_allowed":"La vérification n'est pas disponible dans votre région.","reasons.anonymizer_blocked":"Désactivez votre VPN ou proxy, puis rouvrez le lien.","reasons.nationality_not_allowed":"Ce service ne peut pas vérifier ce document. Contactez l'organisation pour d'autres options.","reasons.document_type_not_accepted":"Ce type de document n'est pas accepté. Choisissez un autre document.","reasons.underage":"Vous n'avez pas l'âge minimum requis pour ce service.","reasons.age_unverifiable":"Nous n'avons pas pu lire votre date de naissance. Prenez une photo plus nette de votre document.","reasons.nationality_unreadable":"Nous n'avons pas pu lire votre nationalité. Prenez une photo plus nette de votre document.","reasons.name_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.birth_date_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.nationality_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.document_number_mismatch":"Ces informations ne correspondent pas à celles dont dispose l'organisation. Contactez l'organisation.","reasons.liveness_inconclusive":"Réessayons : placez-vous face à une source de lumière et restez immobile.","reasons.match_inconclusive":"Nous n'avons pas pu confirmer qu'il s'agit bien de vous. Réessayez dans un endroit bien éclairé, sans lunettes.","hints.appearance":"Réessayons : placez-vous face à une source de lumière et restez immobile.","hints.motion":"Restez immobile et tenez le téléphone bien stable, puis réessayez.","hints.lighting":"Placez-vous face à une fenêtre ou une lampe pour que votre visage soit bien éclairé, puis réessayez.","hints.framing":"Rapprochez-vous pour que votre visage remplisse le cadre, puis réessayez.","reasons.subject_revoked":"L'identité enregistrée pour cette vérification n'est plus disponible. Le demandeur doit lancer une vérification complète : réessayer n'y changera rien","reasons.probe_not_from_liveness":"Gardez votre visage dans le cadre tout du long, puis réessayez.","reasons.document_authenticity":"Utilisez la carte originale, pas une photo ni une copie, et évitez les reflets.","reasons.mobile_required":"Continuez sur votre téléphone pour prendre le selfie.","reasons.capture_tampered":"Nous n'avons pas pu vérifier cette capture. Utilisez l'appareil photo intégré de votre téléphone, sans enregistrement d'écran ni application de caméra.","reasons.device_velocity_exceeded":"Cet appareil ne peut pas servir à une autre vérification pour le moment. Contactez l'organisation.","reasons.device_cooldown":"Trop de tentatives. Réessayez plus tard.","cooldown.retryIn":"Trop de tentatives. Réessayez {time}.","cooldown.retryAt":"Trop de tentatives. Réessayez à partir de {time}.","capture.busy":"Notre service est très sollicité. Nouvel essai en cours…","errors.inference_unavailable":"Réessayez dans un instant.","method.title":"Comment souhaitez-vous vérifier votre identité ?","method.description":"Choisissez une option pour continuer","returning.title":"Confirmez qu'il s'agit bien de vous","returning.description":"Vous avez déjà vérifié votre identité. Une courte capture du visage confirme qu'il s'agit toujours de vous.","method.national_number":"Saisir mon numéro national d'identification mauritanien (NNI)","method.document_photo":"Photographier mon document","errors.method_required":"Choisissez comment vérifier votre identité, puis continuez","errors.attestation_invalid":"Nous n'avons pas pu confirmer l'authenticité de cette session de navigateur. Rechargez la page et réessayez","errors.network_error":"Nous n'avons pas pu joindre le service de vérification. Vérifiez votre connexion internet et réessayez","errors.session_expired":"Cette session de vérification a expiré. Demandez un nouveau lien à l'organisme qui vous a envoyé ici","errors.nni_unbound":"Ce lien a été créé sans votre numéro national d'identification. Demandez un nouveau lien à l'organisme demandeur","errors.id_number_unbound":"Ce lien a été créé sans votre numéro d'identité. Demandez un nouveau lien à l'organisme demandeur","capture.tips.title":"Pour une vérification réussie :","capture.tips.light":"Placez-vous face à la lumière et évitez une forte lumière derrière vous","capture.tips.uncover":"Dégagez votre visage : ni lunettes, ni masque, ni main devant","capture.tips.eyeLevel":"Tenez votre téléphone à hauteur des yeux","capture.tips.straight":"Regardez droit vers la caméra et restez immobile","capture.tips.summary":"Placez-vous dans une zone bien éclairée. Dégagez votre visage : ni lunettes, ni masque. Une fois la caméra démarrée, tenez votre téléphone à hauteur des yeux, regardez droit vers la caméra et restez immobile.","capture.tips.listen":"Écouter les instructions","capture.tips.stop":"Arrêter","capture.permission.granted":"Accès à la caméra autorisé","capture.permission.prompt":"Votre navigateur va demander l’accès à la caméra. Choisissez « Autoriser »","capture.permission.denied":"L’accès à la caméra est bloqué. Autorisez-le dans les réglages du navigateur (icône caméra dans la barre d’adresse), puis rechargez la page","capture.permission.unknown":"Nous demanderons l’accès à la caméra au démarrage","capture.cameraLabel":"Caméra","capture.facing.user":"Caméra avant","capture.facing.environment":"Caméra arrière","capture.assisted.title":"Filmez le visage de la personne","capture.assisted.lead":"Pointez la caméra arrière vers le visage de la personne et tenez le téléphone à la verticale. Le guidage vocal s'adresse à la personne filmée.","capture.assisted.stage":"Pointez la caméra vers le visage de la personne","capture.voiceGuidance":"Guidage vocal","capture.preparing.hint":"Mise en place de la détection du visage sur l’appareil. Cela peut prendre un instant sur une connexion lente","capture.ready":"Prêt. Commencez quand vous voulez","fcv2.err.models":"Impossible de charger les modèles de détection du visage. Vérifiez votre connexion puis réessayez"};var l={},m=r(e=>e==="es"||e==="pt"||e==="de","isOverlayLocale");function h(e){return m(e)?"en":e}r(h,"baseLocale");function f(e){return m(e)?l[e]:void 0}r(f,"overlayOf");function g(e){return m(e)&&l[e]===void 0}r(g,"overlayPending");function _(e){return g(e)?(e==="es"?import("./overlay-es-36OOIBXG.js"):e==="pt"?import("./overlay-pt-NWIPFF4D.js"):import("./overlay-de-PSIG4NLI.js")).then(n=>{l[e]=n.overlay},()=>{l[e]={}}):Promise.resolve()}r(_,"loadSekyroLocale");var v=Object.freeze({"reasons.id_number_invalid":"reasons.nni_invalid","reasons.registry_record_not_found":"reasons.nni_not_found","reasons.document_id_number_mismatch":"reasons.document_nni_mismatch","errors.id_number_unbound":"errors.nni_unbound","population.reason_id_number_invalid":"population.reason_nni_invalid","population.reason_registry_record_not_found":"population.reason_nni_not_found","population.reason_registry_record_not_found_or_document":"population.reason_nni_not_found_or_document","summary.id_number":"summary.nni"}),C=new Map(Object.entries(v).filter(([e])=>e.startsWith("reasons.")).map(([e,t])=>[t.slice(8),e.slice(8)]));function y(e){return C.get(e)??e}r(y,"genericReason");function b(e,t){let n=e,a=t;for(let[o,i]of Object.entries(v)){let s=a[o],c=a[i];typeof s!="string"&&typeof c=="string"?n[o]=c:typeof c!="string"&&typeof s=="string"&&(n[i]=s)}}r(b,"aliasRenamedKeys");function W(e){switch(e){case"center":return"fcv3.center_face";case"closer":return"fcv3.come_closer";case"farther":return"fcv3.move_back";case"light":return"fcv3.more_light";case"still":case"hold":return"fcv3.hold_still";case"upright":return"fcv3.hold_upright";default:{let t=e;throw new Error(`hintStringKey: unhandled hint ${t}`)}}}r(W,"hintStringKey");function G(e){let t=`hints.${e}`;return Object.hasOwn(u,t)?t:null}r(G,"retakeHintStringKey");function $(e){return`fcv2.err.${e}`}r($,"captureErrorStringKey");function Y(e){switch(e){case"no_recorder":return"fcv2.err.unsupported";case"attestation":return"errors.attestation_invalid";case"network":return"errors.network_error";case"nni_unbound":case"id_number_unbound":return"errors.id_number_unbound";case"method_required":return"errors.method_required";case"inference_unavailable":return"errors.inference_unavailable";default:{let t=`reasons.${y(e)}`;return Object.hasOwn(u,t)?t:null}}}r(Y,"reasonStringKey");function Q(e,t,n=new Date){if(t===void 0)return null;let a=new Date(t),o=a.getTime()-n.getTime();if(!Number.isFinite(o)||o<=0)return null;if(o<36e5){let c=Math.max(1,Math.ceil(o/6e4));return{key:"cooldown.retryIn",time:new Intl.RelativeTimeFormat(e,{numeric:"always"}).format(c,"minute")}}let i=a.toDateString()===n.toDateString();return{key:"cooldown.retryAt",time:new Intl.DateTimeFormat(e,{...i?{}:{day:"numeric",month:"long"},hour:"2-digit",minute:"2-digit"}).format(a)}}r(Q,"retryAfterTime");function J(e,t,n){let a=new Intl.PluralRules(t).select(n);return((a==="other"?void 0:e[`capture.attemptsRemaining.${a}`])??e["capture.attemptsRemaining.other"]).replace("{count}",new Intl.NumberFormat(t).format(n))}r(J,"attemptsRemainingText");import{createContext as L,useContext as S,useEffect as x,useState as R}from"react";var w={ar:d,fr:p,en:u};function ie(e,t){let n=f(e),a=n===void 0?w[h(e)]:{...w.en,...n};if(t===void 0)return a;let o={...a};for(let i of Object.keys(t)){let s=t[i];typeof s=="string"&&(o[i]=s)}return b(o,t),o}r(ie,"resolveStrings");function se(e){let[,t]=R(0),n=g(e);return x(()=>{if(!n)return;let a=!0;return _(e).then(()=>a&&t(o=>o+1)),()=>{a=!1}},[e,n]),!n}r(se,"useLocaleReady");var z=L(e=>u[e]??""),ce=z.Provider;function ue(){return S(z)}r(ue,"useStrings");import{useCallback as N}from"react";function me(){return N(e=>{e?.focus()},[])}r(me,"useFocusOnMount");import{jsx as q}from"react/jsx-runtime";function fe({tone:e,role:t,children:n,testId:a}){return q("div",{role:t??(e==="info"?"status":"alert"),className:`sekyro-notice sekyro-notice--${e}`,"data-testid":a,children:n})}r(fe,"Notice");export{A as a,u as b,y as c,b as d,d as e,p as f,h as g,f as h,_ as i,W as j,G as k,$ as l,Y as m,Q as n,J as o,ie as p,se as q,ce as r,ue as s,fe as t,me as u};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as S,s as I}from"./chunk-34326C2I.js";import{a as n}from"./chunk-2KED7D2Q.js";import{jsx as y,jsxs as R}from"react/jsx-runtime";var P=Array.from({length:56},(t,e)=>{let s=e/56*2*Math.PI-Math.PI/2,o=Math.cos(s),a=Math.sin(s);return{id:`tick-${e}`,frac:e/55,x1:150+108*o,y1:150+108*a,x2:150+138*o,y2:150+138*a,style:{transitionDelay:`${e*6}ms`}}});function T(t,e,s,o){return s?"var(--sekyro-color-success)":t?o?"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)"}n(T,"tickColor");var A="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function x({progress:t,phase:e,draining:s=!1}){let o=Math.min(1,Math.max(0,t)),a=Math.round(o*56),c=e==="checking",f=e==="recording",u=e==="frozen",l=c||u,_=c||f||u,d=e==="locked"||_,p=s&&!d;return R("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":a,"data-recording":f?"":void 0,"data-draining":p?"":void 0,children:[y("path",{fillRule:"evenodd",d:A,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":l?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),R("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[y("g",{className:l?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:P.map((i,C)=>y("line",{x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,stroke:T(C<a,i.frac,d,p),strokeWidth:3,strokeLinecap:"round",style:i.style,className:"sekyro-arc__tick"},i.id))}),y("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:y("circle",{cx:150,cy:150,r:100,fill:"none",stroke:d?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:d?3.5:2.5,className:_?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}n(x,"CaptureArc");import{jsx as r,jsxs as k}from"react/jsx-runtime";function B({videoRef:t,guidanceText:e,guidanceHint:s,guidanceKey:o,progress:a,phase:c,draining:f=!1,stillUrl:u,showChecking:l,onSwitchCamera:_,canSwitchCamera:d,operatorText:p=null,voicePrompt:i,overlay:C,reduceMotion:E=!1}){let m=I(),b=c==="checking",g=b||c==="frozen",h=g&&l?m("capture.checking"):e,v=i?.(s,h,o);return k("div",{className:E?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[r("video",{ref:t,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),u!==null&&g?r("img",{src:u,alt:m("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,r(x,{progress:a,phase:c,draining:f}),C?.(t),v!=null&&!g?r("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:v}):null,d?r(S,{kind:"chip",onClick:_,"aria-label":m("capture.switchCamera"),className:"sekyro-stage__corner-end","data-testid":"sekyro-switch-camera",children:r(G,{})}):null,b&&l?k("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[r(U,{}),m("capture.cameraOff")]}):null,k("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[r("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:h},h),g&&l?r("span",{className:"sekyro-stage__guidance-hint",children:m("capture.checkingHint")}):p!==null&&!g?r("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}n(B,"CaptureStage");function G(){return k("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[r("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"}),r("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),r("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}n(G,"FlipCameraIcon");function U(){return k("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:[r("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"}),r("path",{d:"M3 3l18 18"})]})}n(U,"CameraOffIcon");import{hasMultipleCameras as H,subscribeCameraPermission as $}from"@sekyro/web";import{useEffect as N,useState as M}from"react";function J(){let[t,e]=M({state:"unknown",settled:!1}),[s,o]=M({canChoose:!1,settled:!1});return N(()=>$(a=>e({state:a,settled:!0})),[]),N(()=>{let a=!0;return H().then(c=>{a&&o({canChoose:c,settled:!0})},()=>{a&&o({canChoose:!1,settled:!0})}),()=>{a=!1}},[]),{permission:t.state,permissionSettled:t.settled,canChooseFacing:s.canChoose,facingSettled:s.settled}}n(J,"useCameraStatus");import{screenRampColourValue as D}from"@sekyro/web";import{jsx as V}from"react/jsx-runtime";function te({colour:t}){return t===null?null:V("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":t,style:{position:"fixed",inset:0,pointerEvents:"none",backgroundColor:D(t)}})}n(te,"ScreenRampLayer");export{B as a,G as b,J as c,te as d};
2
+ import{a as S,s as I}from"./chunk-IJE64ZEN.js";import{a as n}from"./chunk-2KED7D2Q.js";import{jsx as y,jsxs as R}from"react/jsx-runtime";var P=Array.from({length:56},(t,e)=>{let s=e/56*2*Math.PI-Math.PI/2,o=Math.cos(s),a=Math.sin(s);return{id:`tick-${e}`,frac:e/55,x1:150+108*o,y1:150+108*a,x2:150+138*o,y2:150+138*a,style:{transitionDelay:`${e*6}ms`}}});function T(t,e,s,o){return s?"var(--sekyro-color-success)":t?o?"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)"}n(T,"tickColor");var A="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function x({progress:t,phase:e,draining:s=!1}){let o=Math.min(1,Math.max(0,t)),a=Math.round(o*56),c=e==="checking",f=e==="recording",u=e==="frozen",l=c||u,_=c||f||u,d=e==="locked"||_,p=s&&!d;return R("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":a,"data-recording":f?"":void 0,"data-draining":p?"":void 0,children:[y("path",{fillRule:"evenodd",d:A,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":l?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),R("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[y("g",{className:l?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:P.map((i,C)=>y("line",{x1:i.x1,y1:i.y1,x2:i.x2,y2:i.y2,stroke:T(C<a,i.frac,d,p),strokeWidth:3,strokeLinecap:"round",style:i.style,className:"sekyro-arc__tick"},i.id))}),y("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:y("circle",{cx:150,cy:150,r:100,fill:"none",stroke:d?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:d?3.5:2.5,className:_?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}n(x,"CaptureArc");import{jsx as r,jsxs as k}from"react/jsx-runtime";function B({videoRef:t,guidanceText:e,guidanceHint:s,guidanceKey:o,progress:a,phase:c,draining:f=!1,stillUrl:u,showChecking:l,onSwitchCamera:_,canSwitchCamera:d,operatorText:p=null,voicePrompt:i,overlay:C,reduceMotion:E=!1}){let m=I(),b=c==="checking",g=b||c==="frozen",h=g&&l?m("capture.checking"):e,v=i?.(s,h,o);return k("div",{className:E?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[r("video",{ref:t,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),u!==null&&g?r("img",{src:u,alt:m("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,r(x,{progress:a,phase:c,draining:f}),C?.(t),v!=null&&!g?r("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:v}):null,d?r(S,{kind:"chip",onClick:_,"aria-label":m("capture.switchCamera"),className:"sekyro-stage__corner-end","data-testid":"sekyro-switch-camera",children:r(G,{})}):null,b&&l?k("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[r(U,{}),m("capture.cameraOff")]}):null,k("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[r("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:h},h),g&&l?r("span",{className:"sekyro-stage__guidance-hint",children:m("capture.checkingHint")}):p!==null&&!g?r("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}n(B,"CaptureStage");function G(){return k("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[r("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"}),r("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),r("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}n(G,"FlipCameraIcon");function U(){return k("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:[r("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"}),r("path",{d:"M3 3l18 18"})]})}n(U,"CameraOffIcon");import{hasMultipleCameras as H,subscribeCameraPermission as $}from"@sekyro/web";import{useEffect as N,useState as M}from"react";function J(){let[t,e]=M({state:"unknown",settled:!1}),[s,o]=M({canChoose:!1,settled:!1});return N(()=>$(a=>e({state:a,settled:!0})),[]),N(()=>{let a=!0;return H().then(c=>{a&&o({canChoose:c,settled:!0})},()=>{a&&o({canChoose:!1,settled:!0})}),()=>{a=!1}},[]),{permission:t.state,permissionSettled:t.settled,canChooseFacing:s.canChoose,facingSettled:s.settled}}n(J,"useCameraStatus");import{screenRampColourValue as D}from"@sekyro/web";import{jsx as V}from"react/jsx-runtime";function te({colour:t}){return t===null?null:V("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":t,style:{position:"fixed",inset:0,pointerEvents:"none",backgroundColor:D(t)}})}n(te,"ScreenRampLayer");export{B as a,G as b,J as c,te as d};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as g}from"./chunk-Z5UFPMM6.js";import{a as s}from"./chunk-2KED7D2Q.js";var c={light:{brand:"#0d3b66",brandFg:"#ffffff",fg:"#13141f",fgMuted:"#4e5270",bg:"#f6f7fb",surface:"#ffffff",ring:"#0d3b66",danger:"#ca0f07",success:"#007a5e",warning:"#735003"},dark:{brand:"#6ea2d3",brandFg:"#051a2e",fg:"#f6f7fb",fgMuted:"#cbcedc",bg:"#13141f",surface:"#1d1e2c",ring:"#6ea2d3",danger:"#ff7c7c",success:"#00c897",warning:"#ffd98a"},roles:{light:{brandSoft:"#eaf2fa",line:"#cbcedc",lineSubtle:"#e2e4ee",lineStrong:"#8c91a9",sunken:"#eeeff5",fgSubtle:"#686d8a"},dark:{brandSoft:"#092b4b",line:"#4e5270",lineSubtle:"#2b2d40",lineStrong:"#686d8a",sunken:"#0b0c14",fgSubtle:"#8c91a9"}},stage:"#051a2e",stageAccent:"#69dfef",radius:"10px",radiusLg:"16px",font:'"Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontDisplay:'"Sekyro Geist", Geist, "Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontArabic:'"Sekyro Cairo", Cairo, "Sekyro Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif'};import{jsx as y}from"react/jsx-runtime";var t={colors:{...c.light},radius:c.radiusLg,fontFamily:c.font},l={brand:"--sekyro-color-brand",brandFg:"--sekyro-color-brand-fg",fg:"--sekyro-color-fg",fgMuted:"--sekyro-color-fg-muted",bg:"--sekyro-color-bg",surface:"--sekyro-color-surface",ring:"--sekyro-color-ring",danger:"--sekyro-color-danger",success:"--sekyro-color-success",warning:"--sekyro-color-warning"};function S(o={}){let e={};for(let r of Object.keys(l))e[l[r]]=o.colors?.[r]??t.colors[r];return e["--sekyro-radius"]=o.radius??t.radius,e["--sekyro-font"]=o.fontFamily??t.fontFamily,e}s(S,"themeToCssVars");var m=/^#[0-9a-f]{6}$/i,k=["brand","brandFg","bg","surface","fg","fgMuted"],b=["danger","success","warning"],u=!1;function p(o){let e=o?.colors;if(o===void 0||e===void 0||!b.some(i=>i in e))return o;!u&&g()&&(u=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));let{danger:r,success:a,warning:f,...n}=e;return{...o,colors:n}}s(p,"stripDeprecatedStatusColors");var T={none:"0px",sm:"6px",md:"10px",lg:"16px",full:"9999px"},h={system:"",inter:"Inter","ibm-plex-sans-arabic":'"IBM Plex Sans Arabic"',"noto-sans-arabic":'"Noto Sans Arabic"',roboto:"Roboto"};function F(o){let e={};if(!o)return e;let r={},a=o.colors??{};for(let i of k){let d=a[i];d!==void 0&&m.test(d)&&(r[i]=d)}r.brand&&(r.ring=r.brand),Object.keys(r).length&&(e.colors=r);let f=T[o.radius];f&&(e.radius=f);let n=h[o.fontFamily];return n!==void 0&&(e.fontFamily=n?`${n}, ${t.fontFamily}`:t.fontFamily),e}s(F,"brandingToTheme");function I(...o){let e={};for(let r of o)r?.colors&&(e.colors={...e.colors,...r.colors}),r?.radius&&(e.radius=r.radius),r?.fontFamily&&(e.fontFamily=r.fontFamily);return e}s(I,"mergeThemes");function C({theme:o,children:e,className:r}){return y(R,{theme:p(o),...r!==void 0?{className:r}:{},children:e})}s(C,"SekyroThemeProvider");function R({theme:o,children:e,className:r}){let a=S(o);return y("div",{className:r===void 0?"sekyro-root":`sekyro-root ${r}`,style:a,children:e})}s(R,"SekyroThemeRoot");export{c as a,t as b,S as c,p as d,F as e,I as f,C as g,R as h};
2
+ import{a as g}from"./chunk-UFAOAYQY.js";import{a as s}from"./chunk-2KED7D2Q.js";var c={light:{brand:"#0d3b66",brandFg:"#ffffff",fg:"#13141f",fgMuted:"#4e5270",bg:"#f6f7fb",surface:"#ffffff",ring:"#0d3b66",danger:"#ca0f07",success:"#007a5e",warning:"#735003"},dark:{brand:"#6ea2d3",brandFg:"#051a2e",fg:"#f6f7fb",fgMuted:"#cbcedc",bg:"#13141f",surface:"#1d1e2c",ring:"#6ea2d3",danger:"#ff7c7c",success:"#00c897",warning:"#ffd98a"},roles:{light:{brandSoft:"#eaf2fa",line:"#cbcedc",lineSubtle:"#e2e4ee",lineStrong:"#8c91a9",sunken:"#eeeff5",fgSubtle:"#686d8a"},dark:{brandSoft:"#092b4b",line:"#4e5270",lineSubtle:"#2b2d40",lineStrong:"#686d8a",sunken:"#0b0c14",fgSubtle:"#8c91a9"}},stage:"#051a2e",stageAccent:"#69dfef",radius:"10px",radiusLg:"16px",font:'"Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontDisplay:'"Sekyro Geist", Geist, "Sekyro Inter", Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", "Noto Sans", sans-serif',fontArabic:'"Sekyro Cairo", Cairo, "Sekyro Inter", "Noto Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif'};import{jsx as y}from"react/jsx-runtime";var t={colors:{...c.light},radius:c.radiusLg,fontFamily:c.font},l={brand:"--sekyro-color-brand",brandFg:"--sekyro-color-brand-fg",fg:"--sekyro-color-fg",fgMuted:"--sekyro-color-fg-muted",bg:"--sekyro-color-bg",surface:"--sekyro-color-surface",ring:"--sekyro-color-ring",danger:"--sekyro-color-danger",success:"--sekyro-color-success",warning:"--sekyro-color-warning"};function S(o={}){let e={};for(let r of Object.keys(l))e[l[r]]=o.colors?.[r]??t.colors[r];return e["--sekyro-radius"]=o.radius??t.radius,e["--sekyro-font"]=o.fontFamily??t.fontFamily,e}s(S,"themeToCssVars");var m=/^#[0-9a-f]{6}$/i,k=["brand","brandFg","bg","surface","fg","fgMuted"],b=["danger","success","warning"],u=!1;function p(o){let e=o?.colors;if(o===void 0||e===void 0||!b.some(i=>i in e))return o;!u&&g()&&(u=!0,console.warn("[sekyro] theme.colors.danger/success/warning are ignored: status colours are standard (removed in 1.0)"));let{danger:r,success:a,warning:f,...n}=e;return{...o,colors:n}}s(p,"stripDeprecatedStatusColors");var T={none:"0px",sm:"6px",md:"10px",lg:"16px",full:"9999px"},h={system:"",inter:"Inter","ibm-plex-sans-arabic":'"IBM Plex Sans Arabic"',"noto-sans-arabic":'"Noto Sans Arabic"',roboto:"Roboto"};function F(o){let e={};if(!o)return e;let r={},a=o.colors??{};for(let i of k){let d=a[i];d!==void 0&&m.test(d)&&(r[i]=d)}r.brand&&(r.ring=r.brand),Object.keys(r).length&&(e.colors=r);let f=T[o.radius];f&&(e.radius=f);let n=h[o.fontFamily];return n!==void 0&&(e.fontFamily=n?`${n}, ${t.fontFamily}`:t.fontFamily),e}s(F,"brandingToTheme");function I(...o){let e={};for(let r of o)r?.colors&&(e.colors={...e.colors,...r.colors}),r?.radius&&(e.radius=r.radius),r?.fontFamily&&(e.fontFamily=r.fontFamily);return e}s(I,"mergeThemes");function C({theme:o,children:e,className:r}){return y(R,{theme:p(o),...r!==void 0?{className:r}:{},children:e})}s(C,"SekyroThemeProvider");function R({theme:o,children:e,className:r}){let a=S(o);return y("div",{className:r===void 0?"sekyro-root":`sekyro-root ${r}`,style:a,children:e})}s(R,"SekyroThemeRoot");export{c as a,t as b,S as c,p as d,F as e,I as f,C as g,R as h};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as c}from"./chunk-PYAJMHZH.js";import{a as f,b as h}from"./chunk-PTPTDOWD.js";import{a as k}from"./chunk-VRDPGOXM.js";import{g as y}from"./chunk-WAVBS3GL.js";import{a as u}from"./chunk-34326C2I.js";import{a as s}from"./chunk-2KED7D2Q.js";import{useState as g}from"react";var C={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function b(o,t){switch(o.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=o.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}s(b,"identityLabel");function L(o,t){let[n,i]=g(!1),[d,m]=g(null);return{busy:n,error:d,run:s(r=>{i(!0),m(null),r().then(()=>i(!1),l=>{i(!1),m(o.t(k(l,o.strings))),t?.(l)})},"run")}}s(L,"useChoiceAction");import{useId as _}from"react";import{Fragment as N,jsx as e,jsxs as a}from"react/jsx-runtime";function I(){let o=`sekyro-face-light-${_().replace(/[^A-Za-z0-9_-]/g,"")}`;return a("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[e("defs",{children:e("mask",{id:o,children:e("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),e("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),e("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),e("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),e("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${o})`})]})}s(I,"FaceMark");var v={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function T({start:o,context:t,tips:n,tipsTitle:i,extra:d,human:m=!1,notice:p}){let{t:r}=y();return a("section",{className:"sekyro-step",children:[e(I,{}),t.captureMode==="assisted"?e(f,{title:r("capture.assisted.title"),lead:r("capture.assisted.lead")}):e(f,{title:r(m?"native.face.humanIntroTitle":"native.face.introTitle"),lead:r(m?"native.face.humanIntroLead":"native.face.introLead")}),i!==void 0?e("p",{className:"sekyro-section-label",children:i}):null,e("ul",{className:"sekyro-tiprows",children:n!==void 0?n.map(l=>a("li",{children:[e(c,{name:v[l.id]??"face"}),l.text]},l.id)):a(N,{children:[a("li",{children:[e(c,{name:"light"}),r("capture.tips.light")]}),a("li",{children:[e(c,{name:"jGlasses"}),r("capture.tips.uncover")]}),a("li",{children:[e(c,{name:"smartphone"}),r("capture.tips.eyeLevel")]})]})}),d,p??null,p!==void 0?null:t.assets==="failed"?e(u,{kind:"ghost",onClick:t.retryAssets,children:r("common.refresh")}):null,p!==void 0?null:e(h,{children:a(u,{full:!0,disabled:t.assets!=="ready","aria-busy":t.assets==="loading"||void 0,onClick:o,children:[e(c,{name:"camera"}),r("capture.start")]})})]})}s(T,"FaceIntro");export{C as a,b,L as c,T as d};
2
+ import{a as c}from"./chunk-PYAJMHZH.js";import{a as f,b as h}from"./chunk-6EP4O2CE.js";import{a as k}from"./chunk-VRDPGOXM.js";import{g as y}from"./chunk-VKSX4KC3.js";import{a as u}from"./chunk-IJE64ZEN.js";import{a as s}from"./chunk-2KED7D2Q.js";import{useState as g}from"react";var C={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function b(o,t){switch(o.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=o.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}s(b,"identityLabel");function L(o,t){let[n,i]=g(!1),[d,m]=g(null);return{busy:n,error:d,run:s(r=>{i(!0),m(null),r().then(()=>i(!1),l=>{i(!1),m(o.t(k(l,o.strings))),t?.(l)})},"run")}}s(L,"useChoiceAction");import{useId as _}from"react";import{Fragment as N,jsx as e,jsxs as a}from"react/jsx-runtime";function I(){let o=`sekyro-face-light-${_().replace(/[^A-Za-z0-9_-]/g,"")}`;return a("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[e("defs",{children:e("mask",{id:o,children:e("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),e("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),e("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),e("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),e("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${o})`})]})}s(I,"FaceMark");var v={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function T({start:o,context:t,tips:n,tipsTitle:i,extra:d,human:m=!1,notice:p}){let{t:r}=y();return a("section",{className:"sekyro-step",children:[e(I,{}),t.captureMode==="assisted"?e(f,{title:r("capture.assisted.title"),lead:r("capture.assisted.lead")}):e(f,{title:r(m?"native.face.humanIntroTitle":"native.face.introTitle"),lead:r(m?"native.face.humanIntroLead":"native.face.introLead")}),i!==void 0?e("p",{className:"sekyro-section-label",children:i}):null,e("ul",{className:"sekyro-tiprows",children:n!==void 0?n.map(l=>a("li",{children:[e(c,{name:v[l.id]??"face"}),l.text]},l.id)):a(N,{children:[a("li",{children:[e(c,{name:"light"}),r("capture.tips.light")]}),a("li",{children:[e(c,{name:"jGlasses"}),r("capture.tips.uncover")]}),a("li",{children:[e(c,{name:"smartphone"}),r("capture.tips.eyeLevel")]})]})}),d,p??null,p!==void 0?null:t.assets==="failed"?e(u,{kind:"ghost",onClick:t.retryAssets,children:r("common.refresh")}):null,p!==void 0?null:e(h,{children:a(u,{full:!0,disabled:t.assets!=="ready","aria-busy":t.assets==="loading"||void 0,onClick:o,children:[e(c,{name:"camera"}),r("capture.start")]})})]})}s(T,"FaceIntro");export{C as a,b,L as c,T as d};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as Jt,c as Xt,d as en}from"./chunk-LNZR3RXG.js";import{a as D,j as Dt,k as qt,l as jt,m as $t,n as zt,o as Yt,p as Zt,q as Wt,r as Qt,s as U,t as j,u as qe}from"./chunk-34326C2I.js";import{a as n}from"./chunk-2KED7D2Q.js";import{useId as cr}from"react";import{Fragment as ar,jsx as V,jsxs as X}from"react/jsx-runtime";function ee({className:e,children:t}){return V("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}n(ee,"Svg");var at="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function tn(e){return X(ee,{...e,children:[V("circle",{cx:"12",cy:"12",r:"4"}),V("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}n(tn,"SunIcon");function nn(e){return X(ee,{...e,children:[V("circle",{cx:"12",cy:"12",r:"9"}),V("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}n(nn,"FaceUncoveredIcon");function rn(e){return X(ee,{...e,children:[V("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),V("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),V("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}n(rn,"PhoneEyeLevelIcon");function on(e){return X(ee,{...e,children:[V("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),V("circle",{cx:"12",cy:"12",r:"2.8"})]})}n(on,"LookStraightIcon");function sn(e){return X(ee,{...e,children:[V("path",{d:at}),V("path",{d:"M9 13l2 2 4-4"})]})}n(sn,"CameraCheckIcon");function an(e){return X(ee,{...e,children:[V("path",{d:at}),V("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}n(an,"CameraAskIcon");function cn(e){return X(ee,{...e,children:[V("path",{d:at}),V("path",{d:"M3 3l18 18"})]})}n(cn,"CameraBlockedIcon");function ve({off:e,className:t}){return X(ee,{className:t,children:[V("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?V("path",{d:"M4 4l16 16"}):X(ar,{children:[V("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),V("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}n(ve,"SpeakerIcon");function ln(e){return V(ee,{...e,children:V("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}n(ln,"CheckIcon");function un(e){return X(ee,{className:e.className??"sekyro-spinner",children:[V("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),V("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}n(un,"SpinnerIcon");import{jsx as ce,jsxs as dn}from"react/jsx-runtime";var je=["light","uncover","eyeLevel","straight"],lr={light:{key:"capture.tips.light",icon:n(()=>ce(tn,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:n(()=>ce(nn,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:n(()=>ce(rn,{}),"icon")},straight:{key:"capture.tips.straight",icon:n(()=>ce(on,{}),"icon")}};function pn({tips:e}){let t=U(),s=cr();return e.length===0?null:dn("section",{className:"sekyro-tips","aria-labelledby":s,"data-testid":"sekyro-tips",children:[ce("p",{className:"sekyro-tips__title",id:s,children:t("capture.tips.title")}),ce("ul",{className:"sekyro-tips__list",children:e.map(o=>{let r=typeof o=="string"?lr[o]:void 0,a=typeof o=="string"?o:o.id,l=r!==void 0?r.icon():typeof o=="string"?void 0:o.icon,p=r!==void 0?t(r.key):typeof o=="string"?o:o.text;return dn("li",{className:"sekyro-tips__item",children:[l!=null?ce("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:l}):null,ce("span",{children:p})]},a)})})]})}n(pn,"TipList");import{useEffect as fn,useId as ur,useRef as dr,useState as pr}from"react";import{jsx as te,jsxs as $e}from"react/jsx-runtime";var fr=220;function mn({title:e,description:t,options:s,busy:o,error:r,focus:a,testId:l,look:p="cards",marked:C,onChoose:b}){let w=ur(),M=qe(),[k,c]=pr(null),g=dr(null);fn(()=>{r!==null&&c(null)},[r]),fn(()=>()=>{g.current!==null&&clearTimeout(g.current)},[]);let v=n(u=>{o||k!==null||(c(u),g.current=setTimeout(()=>{g.current=null,c(null),b(u)},fr))},"choose");return $e("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":l,children:[$e("div",{className:"sekyro-stack sekyro-stack--1",children:[te("h2",{id:w,ref:a?M:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?te("p",{className:"sekyro-text-muted",children:t}):null]}),r!==null?te(j,{tone:"danger",children:te("span",{children:r})}):null,p==="buttons"?te("div",{className:"sekyro-stack sekyro-stack--3",children:s.map((u,L)=>te(D,{kind:L===0?"primary":"ghost",full:!0,disabled:o,"aria-busy":o||void 0,onClick:()=>b(u.id),children:u.label},u.id))}):te("div",{className:"sekyro-choices",children:s.map(u=>$e("button",{type:"button",className:"sekyro-card","aria-pressed":(k??C)===u.id,"aria-busy":o||void 0,disabled:o||k!==null&&k!==u.id,onClick:()=>v(u.id),children:[u.glyph,$e("span",{className:"sekyro-card__body",children:[te("span",{className:"sekyro-card__title",children:u.label}),u.sub!==void 0?te("span",{className:"sekyro-card__sub",children:u.sub}):null]}),te("span",{className:"sekyro-radio","aria-hidden":"true"})]},u.id))})]})}n(mn,"ChoiceScreen");var ze=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","capture.tips.summary"];function pe(e){return e!==null&&ze.includes(e)}n(pe,"isVoiceKey");import{useCallback as re,useEffect as fe,useLayoutEffect as hr,useMemo as vr,useRef as Ce,useState as Pe}from"react";var mr=n((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function ke(e,t,s){let o;try{if(typeof e=="function")o=e(t,s);else{let r=e[s];o=r!=null&&mr(r,t)?r[t]:null}}catch{return null}return typeof o=="string"&&o!==""?o:null}n(ke,"resolveClip");var yr="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",hn={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ne(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}n(ne,"synth");function gr(){return ne()!==null&&typeof SpeechSynthesisUtterance=="function"}n(gr,"speechAvailable");function yn(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}n(yn,"baseLang");function vn(e,t){let s=n(r=>r.replace(/_/g,"-").toLowerCase(),"norm"),o=yn(t);return e.find(r=>s(r.lang)===s(t))??e.find(r=>yn(r.lang)===o)}n(vn,"pickVoice");function kn(e){if(!gr())return!1;let t=[];try{t=ne()?.getVoices()??[]}catch{return!0}return t.length===0||vn(t,e)!==void 0}n(kn,"speechUsable");function Cn(e){let t=ne();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}n(Cn,"subscribeVoices");function _e(e){try{let t=typeof location<"u"?location.href:"http://localhost/",s=new URL(e,t);return`clip:${s.origin}${s.pathname}`}catch{return`clip:${e}`}}n(_e,"clipIdentity");function gn(e){e.pause(),e.removeAttribute("src"),e.load()}n(gn,"release");function bn(){let e=null,t=null,s=0,o=null,r=[],a=new Map,l=n(()=>{r=ne()?.getVoices()??[]},"loadVoices"),p=!1,C=n(()=>{let c=ne();p||c===null||(p=!0,l(),c.addEventListener?.("voiceschanged",l))},"bindVoices"),b=n(()=>(e??(e=new Audio),e),"element"),w=n((c,g,v)=>{let u=ne();if(u!==null&&c!==""&&typeof SpeechSynthesisUtterance=="function"){C();let L=vn(r,g);if(r.length===0||L!==void 0){u.cancel();let m=new SpeechSynthesisUtterance(c);m.lang=g,L!==void 0&&(m.voice=L),m.rate=.95,v!==void 0&&(m.onend=m.onerror=v),u.speak(m);return}}v?.()},"speak"),M=n(()=>{s+=1,o=null,e!==null&&(e.pause(),e.currentTime=0),ne()?.cancel()},"stop"),k=n(c=>{for(let g of c){let v=_e(g);if(a.has(v))continue;let u=new Audio;u.preload="auto",u.src=g,a.set(v,u)}},"warmClips");return{say(c){let g=c.url!==null?_e(c.url):`tts:${c.lang}:${c.text}`;if(g===o)return;o=g,s+=1;let v=s,u=c.onEnd,L=u!==void 0?()=>{v===s&&u()}:void 0;if(ne()?.cancel(),c.url!==null){let m=b();m.pause(),m.muted=!1,m.src=c.url,m.currentTime=0,m.onended=L??null,m.play()?.catch(S=>{v===s&&S?.name!=="AbortError"&&(c.speech?w(c.text,c.lang,L):L?.())});return}c.speech?w(c.text,c.lang,L):L?.()},unlock({lang:c,speech:g,prefetch:v}){let u=b();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let S=Uint8Array.from(atob(yr),N=>N.charCodeAt(0));t=URL.createObjectURL(new Blob([S],{type:"audio/wav"}))}let L=u.paused===!1&&t!==null&&u.src!==t;t!==null&&!L&&(u.muted=!0,u.onended=null,u.src=t,u.play()?.catch(()=>{}));let m=ne();if(g&&m!==null&&typeof SpeechSynthesisUtterance=="function"){C();let S=new SpeechSynthesisUtterance(" ");S.volume=0,S.lang=c,m.speak(S)}k(v??[])},prefetch:k,stop:M,dispose(){M(),p&&ne()?.removeEventListener?.("voiceschanged",l),p=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&gn(e),e=null;for(let c of a.values())gn(c);a.clear()}}}n(bn,"createVoicePlayer");var Sn="sekyro.voiceGuidance";function Vn(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}n(Vn,"readVoicePreference");function Rn(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}n(Rn,"writeVoicePreference");var Ae="capture.tips.summary",kr=typeof window<"u"?hr:fe,Cr=Object.freeze({});function ct(e,t){let s=new Set,o=[];for(let r of ze){let a=r===Ae?null:ke(e,r,t);a===null||s.has(_e(a))||(s.add(_e(a)),o.push(a))}return o}n(ct,"resolvedClipUrls");function lt({locale:e,defaultClips:t,options:s}){let o=s===!1,r=o?{}:s??{},a=r.storageKey===void 0?Sn:r.storageKey,[l,p]=Pe(r.defaultEnabled??!0),C=Ce(l),[b,w]=Pe(!1),[M,k]=Pe("none"),[c,g]=Pe(!1),v=Ce(!1),[u,L]=Pe(0),m=Ce(null),S=re(()=>(m.current??(m.current=bn()),m.current),[]),N=hn[e],O=r.speechFallback,d=O===void 0||O===!0?!0:O===!1?!1:O.includes(e),G=r.clips??t??Cr,F=Ce(!1),q=Ce(G);kr(()=>{q.current=G,C.current=l}),fe(()=>{if(o||a===null)return;let f=Vn(a);f!==null&&(C.current=f,p(f))},[o,a]),fe(()=>{if(!(o||!d))return Cn(()=>L(f=>f+1))},[o,d]);let i=r.clips;fe(()=>{if(o)return;let f=d&&kn(N);w(ct(G,e).length>0||f),k(i!==void 0&&ke(i,Ae,e)!==null?"partner":ke(G,Ae,e)!==null||f?"default":"none")},[o,G,i,e,d,N,u]),fe(()=>{if(o||!l||!F.current)return;let f=ct(G,e);f.length>0&&S().prefetch(f)},[o,l,G,e,S]),fe(()=>()=>{m.current?.dispose(),m.current=null,F.current=!1},[]);let E=re(f=>{o||(F.current=!0,S().unlock({lang:N,speech:d,...f?{prefetch:ct(q.current,e)}:{}}))},[o,S,N,d,e]),I=re(()=>E(C.current),[E]),_=re(()=>{v.current=!1,g(!1)},[]),A=re(()=>{_(),m.current?.stop()},[_]),Y=re(()=>{v.current&&A()},[A]),ue=re((f,K)=>{if(o)return;if(v.current){A();return}let oe=S();oe.stop(),v.current=!0,g(!0);let x=K?.clip===!1?null:ke(q.current,Ae,e);oe.say({url:x,text:f,lang:N,speech:d,onEnd:_})},[o,A,S,e,N,d,_]),P=re(f=>{o||(f?E(!0):A(),a!==null&&Rn(a,f),C.current=f,p(f))},[o,E,A,a]),Z=re(()=>P(!C.current),[P]),T=re((f,K)=>{if(o||!l)return;v.current&&_();let oe=ke(q.current,f,e);S().say({url:oe,text:K,lang:N,speech:d})},[o,l,e,S,N,d,_]);return vr(()=>({supported:!o&&b,enabled:!o&&l,setEnabled:P,toggle:Z,unlock:I,speakKey:T,stop:A,summary:o?"none":M,summaryPlaying:c,toggleSummary:ue,stopSummary:Y}),[o,b,l,P,Z,I,T,A,M,c,ue,Y])}n(lt,"useVoiceGuidance");function ut(e,t,s,o){let{speakKey:r,stop:a,enabled:l}=e,p=Ce(!1);fe(()=>{if(!o||!l){p.current&&a(),p.current=!1;return}p.current=!0,pe(t)&&t!==Ae&&s!==""&&r(t,s)},[o,l,t,s,r,a])}n(ut,"useSpeakGuidance");import{isValidElement as Yr,useCallback as Je,useContext as Zr,useEffect as le,useMemo as Le,useRef as me,useState as Wn}from"react";import{useEffect as br,useRef as Sr}from"react";import{jsx as be,jsxs as dt}from"react/jsx-runtime";function Ln({showCoaching:e,attemptsText:t,showRetake:s,onRetake:o}){let r=U(),a=Sr(null);return br(()=>{s&&a.current?.focus()},[s]),!e&&!s?null:dt("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?dt("div",{className:"sekyro-stack sekyro-stack--1",children:[be("p",{className:"sekyro-text-body",children:r("capture.retryCoaching.title")}),dt("ul",{className:"sekyro-coaching",children:[be("li",{children:r("capture.retryCoaching.light")}),be("li",{children:r("capture.retryCoaching.eyeLevel")}),be("li",{children:r("capture.retryCoaching.head")})]}),t!==null?be("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:t}):null]}):null,s?be(D,{ref:a,className:"sekyro-btn--start",onClick:o,children:r("capture.recordAgain")}):null]})}n(Ln,"CapturedPanel");function Ye(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}n(Ye,"isDevBuild");import{createContext as Vr}from"react";var wn=Vr(null);import{useCallback as En,useEffect as _n,useRef as Se}from"react";import{useId as Rr}from"react";import{jsx as Ze,jsxs as pt}from"react/jsx-runtime";var Lr=["user","environment"];function Mn({value:e,onChange:t}){let s=U(),o=Rr();return pt("fieldset",{className:"sekyro-segmented","data-testid":"sekyro-facing",children:[Ze("legend",{className:"sekyro-segmented__legend",children:s("capture.cameraLabel")}),Ze("div",{className:"sekyro-segmented__options",children:Lr.map(r=>pt("label",{className:"sekyro-segmented__option",children:[Ze("input",{type:"radio",className:"sekyro-segmented__input",name:o,value:r,checked:e===r,onChange:()=>t(r)}),pt("span",{className:"sekyro-segmented__face",children:[Ze("span",{className:"sekyro-segmented__dot","aria-hidden":"true"}),s(`capture.facing.${r}`)]})]},r))})]})}n(Mn,"FacingPicker");import{useEffect as wr,useState as Mr}from"react";import{jsx as Te,jsxs as Ir}from"react/jsx-runtime";function In({state:e}){let t=U(),[s,o]=Mr(!1);wr(()=>{e!=="unknown"&&o(!0)},[e]);let r=e==="granted"?Te(sn,{}):e==="denied"?Te(cn,{}):Te(an,{});return Ir("div",{role:s?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[Te("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:r}),Te("span",{children:t(`capture.permission.${e}`)})]})}n(In,"PermissionRow");import{jsx as We,jsxs as xn}from"react/jsx-runtime";function Nn({voice:e}){let t=U();if(!e.supported)return null;let s=e.enabled;return xn("button",{type:"button",role:"switch","aria-checked":s,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:()=>e.toggle(),children:[xn("span",{className:"sekyro-switch__label",children:[We(ve,{off:!s}),t("capture.voiceGuidance")]}),We("span",{className:"sekyro-switch__track","aria-hidden":"true",children:We("span",{className:"sekyro-switch__thumb",children:s?We(ln,{className:"sekyro-switch__check"}):null})})]})}n(Nn,"VoiceSwitch");import{Fragment as Nr,jsx as B,jsxs as Ve}from"react/jsx-runtime";function Pn({assets:e,onRetryAssets:t,permission:s,captureMode:o="self",canChooseFacing:r,facing:a,onFacingChange:l,voice:p,tips:C,summary:b,startLabel:w,startDisabled:M,onStart:k}){let c=U(),g=Se(b?.stop);g.current=b?.stop,_n(()=>()=>g.current?.(),[]);let v=Se(null),u=Se(null),L=Se(null),m=Se(e),S=Se(!1);_n(()=>{let i=m.current;if(m.current=e,i===e)return;let E=S.current;e!=="loading"&&(S.current=!1),xr(v.current)&&(e==="failed"?L.current?.focus():E&&u.current?.focus())},[e]);let N=En(()=>{S.current=!0,t()},[t]),O=e==="loading",d=O||M,G=En(()=>{d||(g.current?.(),k())},[d,k]),F;e==="failed"?F=Ve(j,{tone:"danger",testId:"sekyro-assets-error",children:[B("p",{className:"sekyro-text-body",children:c("fcv2.err.models")}),B(D,{kind:"ghost",ref:L,className:"sekyro-btn--start",onClick:N,"data-testid":"sekyro-assets-retry",children:c("common.retry")})]}):F=Ve("div",{className:"sekyro-stack sekyro-stack--1",children:[B(D,{ref:u,full:!0,"data-testid":"sekyro-start","aria-disabled":d?"true":void 0,"aria-busy":O?"true":void 0,onClick:G,children:O?Ve(Nr,{children:[B(un,{}),c("capture.preparing.title")]}):w??c("capture.start")}),O?B("p",{className:"sekyro-text-muted",children:c("capture.preparing.hint")}):null]});let q=o==="assisted";return Ve("div",{ref:v,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[q?Ve("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[B("h2",{className:"sekyro-text-body",children:c("capture.assisted.title")}),B("p",{className:"sekyro-text-muted",children:c("capture.assisted.lead")})]}):null,C!==!1?B(pn,{tips:C}):null,b!==void 0?Ve(D,{kind:"ghost",className:"sekyro-btn--start",onClick:b.toggle,"data-testid":"sekyro-tips-listen",children:[B(ve,{off:!1}),c(b.playing?"capture.tips.stop":"capture.tips.listen")]}):null,B(In,{state:s}),q&&r?B(Mn,{value:a,onChange:l}):null,B(Nn,{voice:p}),B("p",{className:"sekyro-text-muted",children:c("capture.securityNote")}),F,B("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?c("capture.preparing.title"):e==="ready"?c("capture.ready"):""})]})}n(Pn,"PreCaptureScreen");function xr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}n(xr,"focusIsOurs");import{useEffect as ft,useState as mt}from"react";function An(e){return Kn(e,"mobileRequired")}n(An,"useMobileRequired");function Tn(e){return Kn(e,"returning").required}n(Tn,"useReturning");function Kn(e,t){let[s,o]=mt({required:!1,settled:e===void 0});return ft(()=>{let r=e?.[t];if(e===void 0||typeof r!="function"){o({required:!1,settled:!0});return}let a=!0;return o({required:!1,settled:!1}),Promise.resolve().then(()=>r.call(e)).then(l=>{a&&o({required:l===!0,settled:!0})},()=>{a&&o({required:!1,settled:!0})}),()=>{a=!1}},[e,t]),s}n(Kn,"useFlag");function On(e){let[t,s]=mt({mode:"self",settled:e===void 0});return ft(()=>{let o=e?.captureMode;if(e===void 0||typeof o!="function"){s({mode:"self",settled:!0});return}let r=!0;return s({mode:"self",settled:!1}),Promise.resolve().then(()=>o.call(e)).then(a=>{r&&s({mode:a==="assisted"?"assisted":"self",settled:!0})},()=>{r&&s({mode:"self",settled:!0})}),()=>{r=!1}},[e]),t}n(On,"useCaptureMode");function Fn(e){let[t,s]=mt(!1);return ft(()=>{if(s(!1),e===void 0)return;let o=e.on("busy",()=>s(!0)),r=e.on("result",()=>s(!1));return()=>{o(),r()}},[e]),t}n(Fn,"useBusy");import{getLivenessAssetsStatus as Er,preloadLivenessAssets as _r,subscribeLivenessAssets as Pr}from"@sekyro/web";import{useCallback as yt,useEffect as Hn,useRef as Un,useState as Ar,useSyncExternalStore as Tr}from"react";var Kr=n(()=>"idle","serverSnapshot");function Bn(e){return _r(e!==void 0?{assetBaseUrl:e}:{})}n(Bn,"preload");function Gn(e,t=!0){let s=Tr(yt(M=>Pr(M,e),[e]),()=>Er(e),Kr),[o,r]=Ar(null),a=Un(!1),l=yt(()=>{Bn(e).then(M=>{a.current&&M==="idle"&&r({base:e})})},[e]);Hn(()=>(a.current=!0,l(),()=>{a.current=!1}),[l]);let p=Un(null);Hn(()=>{if(s!=="idle"){p.current={base:e};return}!t||p.current===null||p.current.base!==e||(p.current=null,l())},[s,e,l,t]);let C=yt(()=>{Bn(e)},[e]);return{gate:o!==null&&o.base===e&&s==="idle"||s==="ready"?"ready":s==="failed"?"failed":"loading",retry:C}}n(Gn,"useLivenessAssets");import{createLivenessCapture as Or}from"@sekyro/web";import{useCallback as gt,useEffect as Fr,useRef as Re,useState as z}from"react";var Dn={progress:0,hint:null,faceDetected:!1};function qn(e){let{videoRef:t,assetBaseUrl:s}=e,r=Re(e.verification).current,a=Re(!1);e.verification!==r&&!a.current&&Ye()&&(a.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let l=Re(null),[p,C]=z("idle"),[b,w]=z(Dn),[M,k]=z(!1),[c,g]=z(!1),[v,u]=z(null),[L,m]=z(!1),[S,N]=z(null),[O,d]=z(null),[G,F]=z(null),[q,i]=z(null),[E,I]=z(null),_=Re(null),A=Re("idle"),Y=Re(e);Y.current=e,Fr(()=>{let T=t.current;if(T===null)return;let f={video:T,...s!==void 0?{assetBaseUrl:s}:{}},K=r!==void 0?r.liveness(f):Or(f);l.current=K;let oe=n(()=>I(K.facingMode??null),"readFacing");oe();let x=[K.on("state",h=>{h==="starting"?(d(null),F(null),w(Dn),g(!1),k(!1),u(null),N(null),_.current=null):h==="gating"&&A.current==="recording"&&(g(!1),k(!1),u(null),_.current=null),A.current=h,oe(),C(h),Y.current.onStateChange?.(h)}),K.on("gate",h=>{let ye=_.current;_.current=h.progress,k(ye!==null&&h.progress<ye-.001&&h.progress>0&&h.progress<1),h.progress>=1&&g(!0),w(h)}),K.on("frozen",({previewDataUrl:h})=>u(h)),K.on("profile",({animations:h})=>m(h==="reduced")),K.on("ramp",({colour:h})=>N(h)),K.on("captured",h=>{d(h),i(null),Y.current.onCaptured?.(h)}),K.on("error",h=>{F(h),Y.current.onError?.(h)}),r?.on("result",h=>{i(h),Y.current.onResult?.(h)})];return()=>{for(let h of x)h?.();l.current=null,K.destroy()}},[r,t,s]);let ue=gt(T=>{l.current?.start(T)},[]),P=gt(()=>{l.current?.retry()},[]),Z=gt(()=>{let T=l.current,f=T?.switchCamera()===!0;return f&&(I(T?.facingMode??null),g(!1),k(!1),u(null),_.current=null),f},[]);return{state:p,gate:b,draining:M,gateLocked:c,frozenPreview:v,reduceMotion:L,rampColour:S,artifacts:O,error:G,result:q,facingMode:E,start:ue,retry:P,switchCamera:Z}}n(qn,"useLivenessHandle");import{useCallback as Hr,useEffect as Ur,useState as Qe}from"react";var Br=new Set(["national_number"]);function jn(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(s=>Br.has(s));return t.length>0?{...e,options:t}:null}n(jn,"pending");function $n(e){let[t,s]=Qe(null),[o,r]=Qe(e===void 0),[a,l]=Qe(!1),[p,C]=Qe(!1);Ur(()=>{if(s(null),e===void 0){r(!0);return}let k=!0,c=e.methodChoice;typeof c=="function"?(r(!1),Promise.resolve().then(()=>c.call(e)).then(v=>{k&&s(jn(v))},()=>{}).finally(()=>{k&&r(!0)})):r(!0);let g=e.on("method",v=>s(jn(v)));return()=>{k=!1,g()}},[e]);let b=Hr(async k=>{if(e===void 0)return!1;l(!0),C(!1);try{return await e.selectMethod(k),s(null),!0}catch{return C(!0),!1}finally{l(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!p?w:null,settled:o,busy:a,failed:p,select:b}}n($n,"useMethodChoice");import{useEffect as Gr,useMemo as Dr,useState as qr}from"react";var jr=["ar","fr","en"];function $r(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}n($r,"isClipUrl");function zr(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let s={};for(let o of jr){let r=t[o];if(!(typeof r!="object"||r===null))for(let[a,l]of Object.entries(r))!pe(a)||!$r(l)||((s[o]??(s[o]={}))[a]=l)}return Object.keys(s).length>0?s:null}n(zr,"toVoiceClipMap");function zn(e){let[t,s]=qr(null);Gr(()=>{if(s(null),e===void 0)return;let r=!0,a=n(p=>{if(!r)return;let C=typeof p=="object"&&p!==null&&typeof p.setId=="string"?p:null;s(b=>b?.setId===C?.setId?b:C)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(a,()=>a(null))}catch{a(null)}let l=e.on("view",p=>a(p.voice));return()=>{r=!1,l()}},[e]);let o=Dr(()=>t!==null?zr(t):null,[t]);return e===void 0?null:o}n(zn,"useServerVoiceClips");import{jsx as Yn}from"react/jsx-runtime";function Zn({voice:e}){let t=U();return Yn(D,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:()=>e.toggle(),children:Yn(ve,{off:!e.enabled,className:"sekyro-icon"})})}n(Zn,"VoiceChip");import{Fragment as Qn,jsx as R,jsxs as we}from"react/jsx-runtime";var Wr=800;function Qr(e){return e===void 0||e!==!1&&e.length===je.length&&je.every(t=>e.includes(t))}n(Qr,"isDefaultTips");function Jr(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}n(Jr,"carriesActivation");function Xr(e){return typeof e=="object"&&e!==null&&!Yr(e)&&"tone"in e&&"text"in e}n(Xr,"isNoticeObject");function eo(e){return e==="starting"||e==="gating"||e==="recording"}n(eo,"isCapturing");function to(e){return e==="captured"||e==="uploading"||e==="checking"}n(to,"isPostCapture");function mi({verification:e,locale:t,dir:s,strings:o,slots:r,autoStart:a=!1,notice:l,startDisabled:p=!1,startLabel:C,tips:b,tipsSummary:w,coach:M,voice:k,onGuidance:c,onCaptured:g,onResult:v,onError:u,onStateChange:L,assetBaseUrl:m,className:S}){let N=Wt(t),O=Le(()=>Zt(t,o),[t,o,N]),d=Le(()=>y=>O[y]??"",[O]),G=s??(t==="ar"?"rtl":"ltr"),F=me(null),q=Zr(wn),i=qn({verification:e,videoRef:F,assetBaseUrl:m,onCaptured:g,onResult:v,onError:u,onStateChange:L}),E=Gn(m,i.state==="idle"&&i.error===null),I=$n(e),_=I.choice!==null,A=An(e),Y=Tn(e),ue=Fn(e),P=Xt(),Z=On(e),T=Z.mode==="assisted",f=T&&P.canChooseFacing,K=k!==!1&&k?.clips===void 0,oe=zn(K?e:void 0),x=lt({locale:t,defaultClips:oe,options:k}),[h,ye]=Wn(null),W=T?h??(P.canChooseFacing?"environment":"user"):"user",ht=Z.settled&&(!T||P.facingSettled),vt=me(null),Ke=me(!1),kt=me(x.unlock);kt.current=x.unlock,le(()=>{let y=vt.current;if(y===null)return;let J=["pointerup","touchend","click","keydown"],ae=n(()=>{for(let Ee of J)y.removeEventListener(Ee,he,!0)},"disarm");function he(Ee){if(Ke.current){ae();return}Jr(Ee)&&(Ke.current=!0,ae(),kt.current())}n(he,"onGesture");for(let Ee of J)y.addEventListener(Ee,he,{capture:!0,passive:!0});return ae},[]);let Ct=Je(()=>{Ke.current||(Ke.current=!0,x.unlock()),i.start({facing:W})},[x.unlock,i.start,W]),bt=Je(()=>i.start({facing:W}),[i.start,W]),Oe=me(!1),Me=i.state==="idle"&&i.error===null,St=!_&&!A.required&&(a===!0||a==="when-permitted"&&P.permission==="granted"),Vt=St&&I.settled&&A.settled&&ht,Jn=a==="when-permitted"&&!P.permissionSettled&&!Oe.current,Rt=St&&Me&&!Oe.current,Xe=(Jn||Rt||!ht)&&E.gate==="ready"?"loading":E.gate;le(()=>{!Vt||!Me||E.gate!=="ready"||Oe.current||(Oe.current=!0,bt())},[Vt,Me,E.gate,bt]);let Xn=Me&&!_&&!A.required&&!(Rt&&E.gate==="ready"),Lt=Je(()=>{i.switchCamera()&&ye(W==="user"?"environment":"user")},[i.switchCamera,W]),wt=i.state!=="idle"&&i.facingMode!==null?i.facingMode:W;le(()=>{let y=F.current?.style;wt==="user"?y?.removeProperty("transform"):y&&(y.transform="none")},[wt]);let Fe=Le(()=>i.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(i.artifacts.keyframe):null,[i.artifacts]);le(()=>{if(Fe!==null)return()=>URL.revokeObjectURL(Fe)},[Fe]);let Mt=i.frozenPreview??Fe,ge=e!==void 0,H=eo(i.state),ie=to(i.state),He=H||ie,$=i.result,It=i.state==="done"&&$!==null,xt=i.state==="recording"&&i.frozenPreview!==null,et=q!==null,Ie=ie||xt,Nt=ie?"checking":xt?"frozen":i.state==="recording"?"recording":i.gateLocked||i.gate.progress>=1?"locked":i.gate.faceDetected?"aligning":"seeking",Ue=H?i.gate.hint:null,Be=i.state==="starting"?"capture.preparing.title":Ue===null?null:Ue==="center"&&!i.gate.faceDetected?"fcv3.no_face":Dt(Ue),[er,Et]=Wn(null);le(()=>{if(Be!=="fcv3.no_face"){Et(Be);return}if(!H)return;let y=setTimeout(()=>Et(Be),Wr);return()=>clearTimeout(y)},[Be,H]);let tt=H&&typeof M=="string"&&M!=="",_t=T&&H?d("capture.assisted.stage"):null,de=H&&!tt?er:null,nt=tt?M:de===null?"":d(de);ut(x,de,nt,H);let Pt=me(c);Pt.current=c,le(()=>{if(pe(de))try{Pt.current?.(de)}catch(y){console.error("[@sekyro/react] onGuidance threw:",y)}},[de]);let xe=Le(()=>({supported:x.supported,enabled:x.enabled,setEnabled:x.setEnabled,toggle:x.toggle}),[x.supported,x.enabled,x.setEnabled,x.toggle]),rt=r?.voicePrompt,At=rt!==void 0,Tt=k===void 0,Kt=me(!1);le(()=>{!At||!Tt||Kt.current||!Ye()||(Kt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[At,Tt]);let tr=rt!==void 0?(y,J,ae)=>rt(y,J,ae,xe):x.supported?()=>R(Zn,{voice:xe}):void 0,{summary:ot,summaryPlaying:Ot,toggleSummary:Ft,stopSummary:Ht}=x,Ge=w!==void 0&&w!=="",Ut=Ge?w:d("capture.tips.summary"),Bt=Ge?ot!=="none":ot==="partner"||ot==="default"&&Qr(b),nr=Le(()=>Bt?{playing:Ot,toggle:n(()=>Ft(Ut,{clip:!Ge}),"toggle"),stop:Ht}:void 0,[Bt,Ot,Ft,Ut,Ht,Ge]),rr=Le(()=>({assets:Xe,retryAssets:E.retry,permission:P.permission,permissionSettled:P.permissionSettled,captureMode:Z.mode,facing:W,setFacing:ye,canChooseFacing:f,voice:xe}),[Xe,E.retry,P.permission,P.permissionSettled,Z.mode,f,W,xe]),or=Xr(l)?R(j,{tone:l.tone,testId:"sekyro-host-notice",children:R("span",{children:l.text})}):l??null,se=$!==null&&$.status==="retry"?$:null,Q=It&&$.status==="unavailable"&&!_&&$.reason!=="portrait_required"?$:null,Ne=It&&($.status==="approved"||$.status==="rejected"||$.status==="review")?$:null,De=n((y,J)=>{if(y===void 0)return null;if(y==="device_cooldown"){let he=zt(t,J);if(he!==null)return d(he.key).replace("{time}",he.time)}let ae=$t(y);return ae===null?null:d(ae)},"reasonText"),st=n(y=>{let J=y.retakeHint===void 0?null:qt(y.retakeHint);return J===null?De(y.reason):d(J)},"retryText"),sr=Q!==null&&Q.reason!==void 0&&Q.reason!=="nni_unbound"&&Q.reason!=="id_number_unbound"&&Q.reason!=="method_required"&&Q.reason!=="mobile_required"&&!(Q.reason==="no_recorder"&&i.artifacts?.degraded==="NO_RECORDER"),Gt=qe(),ir=_&&I.auto===null&&!H&&!ie&&i.error===null,it=Je(async y=>{await I.select(y)&&i.state==="done"&&i.retry()},[I.select,i.state,i.retry]);return le(()=>{I.auto!==null&&!I.busy&&!H&&!ie&&it(I.auto)},[I.auto,I.busy,H,ie,it]),R(Qt,{value:d,children:we("div",{ref:vt,className:S===void 0?"sekyro-capture":`sekyro-capture ${S}`,dir:G,lang:t,"data-testid":"sekyro-liveness-capture","data-state":i.state,children:[r?.header,se!==null&&st(se)!==null&&!(et&&He)?R(j,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:R("span",{children:st(se)})}):null,ue&&ie&&!et?R(j,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:R("span",{children:d("capture.busy")})}):null,A.required&&Me?R(j,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:R("span",{children:d("reasons.mobile_required")})}):null,i.error!==null?r?.errorPanel!==void 0?r.errorPanel(i.error,i.retry):we(j,{tone:"danger",testId:"sekyro-error-notice",children:[R("span",{children:d(jt(i.error.kind))}),i.error.retryable?R(D,{ref:Gt,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:d("common.retry")}):null]}):null,Q!==null?we(j,{tone:"danger",testId:"sekyro-unavailable-notice",children:[R("span",{children:De(Q.reason)??d(Q.reason===void 0?"errors.session_expired":"errors.network_error")}),sr?R(D,{ref:Gt,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:d("capture.recordAgain")}):null]}):null,Ne!==null&&De(Ne.reason)!==null?R(j,{tone:Ne.status==="rejected"?"danger":"info",testId:"sekyro-result-notice",children:R("span",{children:De(Ne.reason,Ne.retryAfter)})}):null,R("div",{className:He?void 0:"sekyro-hidden","data-capture-live":He?"":void 0,children:et?q({videoRef:F,guidance:Ie&&ge?d("capture.checking"):nt,coached:tt&&!(Ie&&ge),note:Ie?ge?d(ue?"capture.busy":"capture.checkingHint"):null:se!==null?st(se):_t,settled:Ie&&ge,progress:i.gate.progress,phase:Nt,still:Ie?Mt:null,live:He,switchCamera:H&&i.state!=="recording"&&f&&Lt,ramp:i.rampColour===null?null:{colour:i.rampColour}}):R(Jt,{videoRef:F,guidanceText:nt,guidanceHint:Ue,guidanceKey:de,progress:i.gate.progress,phase:Nt,draining:i.draining,stillUrl:Mt,showChecking:ge,onSwitchCamera:Lt,canSwitchCamera:T&&H&&i.state!=="recording",operatorText:_t,voicePrompt:tr,overlay:y=>we(Qn,{children:[r?.stageOverlay?.(y),R(en,{colour:i.rampColour})]}),reduceMotion:i.reduceMotion})}),ir&&I.choice!==null?R(mn,{title:d("method.title"),description:d("method.description"),options:I.choice.options.map(y=>({id:y,label:d(`method.${y}`)})),busy:I.busy,error:I.failed?d("errors.network_error"):null,focus:i.state==="done",testId:"sekyro-method",look:"buttons",onChoose:y=>{it(y)}}):null,Xn?we(Qn,{children:[Y&&r?.header===void 0?we("div",{className:"sekyro-stack sekyro-stack--1",children:[R("h2",{className:"sekyro-text-body",children:d("returning.title")}),R("p",{className:"sekyro-text-muted",children:d("returning.description")})]}):null,or,r?.intro!==void 0?r.intro(Ct,rr):R(Pn,{assets:Xe,onRetryAssets:E.retry,permission:P.permission,captureMode:Z.mode,canChooseFacing:f,facing:W,onFacingChange:ye,voice:xe,tips:b??je,summary:nr,startLabel:C,startDisabled:p,onStart:Ct})]}):null,R(Ln,{showCoaching:se!==null,attemptsText:se?.attemptsRemaining!==void 0?Yt(O,t,se.attemptsRemaining):null,showRetake:se!==null&&!H&&!ie||!ge&&i.state==="captured",onRetake:i.retry}),r?.footer]})})}n(mi,"LivenessCapture");export{Ye as a,wn as b,Mn as c,je as d,mn as e,ze as f,Wr as g,mi as h};
2
+ import{a as Jt,c as Xt,d as en}from"./chunk-JCCXPYU4.js";import{a as D,j as Dt,k as qt,l as jt,m as $t,n as zt,o as Yt,p as Zt,q as Wt,r as Qt,s as U,t as j,u as qe}from"./chunk-IJE64ZEN.js";import{a as n}from"./chunk-2KED7D2Q.js";import{useId as cr}from"react";import{Fragment as ar,jsx as V,jsxs as X}from"react/jsx-runtime";function ee({className:e,children:t}){return V("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}n(ee,"Svg");var at="M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z";function tn(e){return X(ee,{...e,children:[V("circle",{cx:"12",cy:"12",r:"4"}),V("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}n(tn,"SunIcon");function nn(e){return X(ee,{...e,children:[V("circle",{cx:"12",cy:"12",r:"9"}),V("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}n(nn,"FaceUncoveredIcon");function rn(e){return X(ee,{...e,children:[V("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),V("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),V("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}n(rn,"PhoneEyeLevelIcon");function on(e){return X(ee,{...e,children:[V("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),V("circle",{cx:"12",cy:"12",r:"2.8"})]})}n(on,"LookStraightIcon");function sn(e){return X(ee,{...e,children:[V("path",{d:at}),V("path",{d:"M9 13l2 2 4-4"})]})}n(sn,"CameraCheckIcon");function an(e){return X(ee,{...e,children:[V("path",{d:at}),V("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}n(an,"CameraAskIcon");function cn(e){return X(ee,{...e,children:[V("path",{d:at}),V("path",{d:"M3 3l18 18"})]})}n(cn,"CameraBlockedIcon");function ve({off:e,className:t}){return X(ee,{className:t,children:[V("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?V("path",{d:"M4 4l16 16"}):X(ar,{children:[V("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),V("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}n(ve,"SpeakerIcon");function ln(e){return V(ee,{...e,children:V("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}n(ln,"CheckIcon");function un(e){return X(ee,{className:e.className??"sekyro-spinner",children:[V("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),V("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}n(un,"SpinnerIcon");import{jsx as ce,jsxs as dn}from"react/jsx-runtime";var je=["light","uncover","eyeLevel","straight"],lr={light:{key:"capture.tips.light",icon:n(()=>ce(tn,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:n(()=>ce(nn,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:n(()=>ce(rn,{}),"icon")},straight:{key:"capture.tips.straight",icon:n(()=>ce(on,{}),"icon")}};function pn({tips:e}){let t=U(),s=cr();return e.length===0?null:dn("section",{className:"sekyro-tips","aria-labelledby":s,"data-testid":"sekyro-tips",children:[ce("p",{className:"sekyro-tips__title",id:s,children:t("capture.tips.title")}),ce("ul",{className:"sekyro-tips__list",children:e.map(o=>{let r=typeof o=="string"?lr[o]:void 0,a=typeof o=="string"?o:o.id,l=r!==void 0?r.icon():typeof o=="string"?void 0:o.icon,p=r!==void 0?t(r.key):typeof o=="string"?o:o.text;return dn("li",{className:"sekyro-tips__item",children:[l!=null?ce("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:l}):null,ce("span",{children:p})]},a)})})]})}n(pn,"TipList");import{useEffect as fn,useId as ur,useRef as dr,useState as pr}from"react";import{jsx as te,jsxs as $e}from"react/jsx-runtime";var fr=220;function mn({title:e,description:t,options:s,busy:o,error:r,focus:a,testId:l,look:p="cards",marked:C,onChoose:b}){let w=ur(),M=qe(),[k,c]=pr(null),g=dr(null);fn(()=>{r!==null&&c(null)},[r]),fn(()=>()=>{g.current!==null&&clearTimeout(g.current)},[]);let v=n(u=>{o||k!==null||(c(u),g.current=setTimeout(()=>{g.current=null,c(null),b(u)},fr))},"choose");return $e("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":l,children:[$e("div",{className:"sekyro-stack sekyro-stack--1",children:[te("h2",{id:w,ref:a?M:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?te("p",{className:"sekyro-text-muted",children:t}):null]}),r!==null?te(j,{tone:"danger",children:te("span",{children:r})}):null,p==="buttons"?te("div",{className:"sekyro-stack sekyro-stack--3",children:s.map((u,L)=>te(D,{kind:L===0?"primary":"ghost",full:!0,disabled:o,"aria-busy":o||void 0,onClick:()=>b(u.id),children:u.label},u.id))}):te("div",{className:"sekyro-choices",children:s.map(u=>$e("button",{type:"button",className:"sekyro-card","aria-pressed":(k??C)===u.id,"aria-busy":o||void 0,disabled:o||k!==null&&k!==u.id,onClick:()=>v(u.id),children:[u.glyph,$e("span",{className:"sekyro-card__body",children:[te("span",{className:"sekyro-card__title",children:u.label}),u.sub!==void 0?te("span",{className:"sekyro-card__sub",children:u.sub}):null]}),te("span",{className:"sekyro-radio","aria-hidden":"true"})]},u.id))})]})}n(mn,"ChoiceScreen");var ze=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","capture.tips.summary"];function pe(e){return e!==null&&ze.includes(e)}n(pe,"isVoiceKey");import{useCallback as re,useEffect as fe,useLayoutEffect as hr,useMemo as vr,useRef as Ce,useState as Pe}from"react";var mr=n((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function ke(e,t,s){let o;try{if(typeof e=="function")o=e(t,s);else{let r=e[s];o=r!=null&&mr(r,t)?r[t]:null}}catch{return null}return typeof o=="string"&&o!==""?o:null}n(ke,"resolveClip");var yr="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",hn={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ne(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}n(ne,"synth");function gr(){return ne()!==null&&typeof SpeechSynthesisUtterance=="function"}n(gr,"speechAvailable");function yn(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}n(yn,"baseLang");function vn(e,t){let s=n(r=>r.replace(/_/g,"-").toLowerCase(),"norm"),o=yn(t);return e.find(r=>s(r.lang)===s(t))??e.find(r=>yn(r.lang)===o)}n(vn,"pickVoice");function kn(e){if(!gr())return!1;let t=[];try{t=ne()?.getVoices()??[]}catch{return!0}return t.length===0||vn(t,e)!==void 0}n(kn,"speechUsable");function Cn(e){let t=ne();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}n(Cn,"subscribeVoices");function _e(e){try{let t=typeof location<"u"?location.href:"http://localhost/",s=new URL(e,t);return`clip:${s.origin}${s.pathname}`}catch{return`clip:${e}`}}n(_e,"clipIdentity");function gn(e){e.pause(),e.removeAttribute("src"),e.load()}n(gn,"release");function bn(){let e=null,t=null,s=0,o=null,r=[],a=new Map,l=n(()=>{r=ne()?.getVoices()??[]},"loadVoices"),p=!1,C=n(()=>{let c=ne();p||c===null||(p=!0,l(),c.addEventListener?.("voiceschanged",l))},"bindVoices"),b=n(()=>(e??(e=new Audio),e),"element"),w=n((c,g,v)=>{let u=ne();if(u!==null&&c!==""&&typeof SpeechSynthesisUtterance=="function"){C();let L=vn(r,g);if(r.length===0||L!==void 0){u.cancel();let m=new SpeechSynthesisUtterance(c);m.lang=g,L!==void 0&&(m.voice=L),m.rate=.95,v!==void 0&&(m.onend=m.onerror=v),u.speak(m);return}}v?.()},"speak"),M=n(()=>{s+=1,o=null,e!==null&&(e.pause(),e.currentTime=0),ne()?.cancel()},"stop"),k=n(c=>{for(let g of c){let v=_e(g);if(a.has(v))continue;let u=new Audio;u.preload="auto",u.src=g,a.set(v,u)}},"warmClips");return{say(c){let g=c.url!==null?_e(c.url):`tts:${c.lang}:${c.text}`;if(g===o)return;o=g,s+=1;let v=s,u=c.onEnd,L=u!==void 0?()=>{v===s&&u()}:void 0;if(ne()?.cancel(),c.url!==null){let m=b();m.pause(),m.muted=!1,m.src=c.url,m.currentTime=0,m.onended=L??null,m.play()?.catch(S=>{v===s&&S?.name!=="AbortError"&&(c.speech?w(c.text,c.lang,L):L?.())});return}c.speech?w(c.text,c.lang,L):L?.()},unlock({lang:c,speech:g,prefetch:v}){let u=b();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let S=Uint8Array.from(atob(yr),N=>N.charCodeAt(0));t=URL.createObjectURL(new Blob([S],{type:"audio/wav"}))}let L=u.paused===!1&&t!==null&&u.src!==t;t!==null&&!L&&(u.muted=!0,u.onended=null,u.src=t,u.play()?.catch(()=>{}));let m=ne();if(g&&m!==null&&typeof SpeechSynthesisUtterance=="function"){C();let S=new SpeechSynthesisUtterance(" ");S.volume=0,S.lang=c,m.speak(S)}k(v??[])},prefetch:k,stop:M,dispose(){M(),p&&ne()?.removeEventListener?.("voiceschanged",l),p=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&gn(e),e=null;for(let c of a.values())gn(c);a.clear()}}}n(bn,"createVoicePlayer");var Sn="sekyro.voiceGuidance";function Vn(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}n(Vn,"readVoicePreference");function Rn(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}n(Rn,"writeVoicePreference");var Ae="capture.tips.summary",kr=typeof window<"u"?hr:fe,Cr=Object.freeze({});function ct(e,t){let s=new Set,o=[];for(let r of ze){let a=r===Ae?null:ke(e,r,t);a===null||s.has(_e(a))||(s.add(_e(a)),o.push(a))}return o}n(ct,"resolvedClipUrls");function lt({locale:e,defaultClips:t,options:s}){let o=s===!1,r=o?{}:s??{},a=r.storageKey===void 0?Sn:r.storageKey,[l,p]=Pe(r.defaultEnabled??!0),C=Ce(l),[b,w]=Pe(!1),[M,k]=Pe("none"),[c,g]=Pe(!1),v=Ce(!1),[u,L]=Pe(0),m=Ce(null),S=re(()=>(m.current??(m.current=bn()),m.current),[]),N=hn[e],O=r.speechFallback,d=O===void 0||O===!0?!0:O===!1?!1:O.includes(e),G=r.clips??t??Cr,F=Ce(!1),q=Ce(G);kr(()=>{q.current=G,C.current=l}),fe(()=>{if(o||a===null)return;let f=Vn(a);f!==null&&(C.current=f,p(f))},[o,a]),fe(()=>{if(!(o||!d))return Cn(()=>L(f=>f+1))},[o,d]);let i=r.clips;fe(()=>{if(o)return;let f=d&&kn(N);w(ct(G,e).length>0||f),k(i!==void 0&&ke(i,Ae,e)!==null?"partner":ke(G,Ae,e)!==null||f?"default":"none")},[o,G,i,e,d,N,u]),fe(()=>{if(o||!l||!F.current)return;let f=ct(G,e);f.length>0&&S().prefetch(f)},[o,l,G,e,S]),fe(()=>()=>{m.current?.dispose(),m.current=null,F.current=!1},[]);let E=re(f=>{o||(F.current=!0,S().unlock({lang:N,speech:d,...f?{prefetch:ct(q.current,e)}:{}}))},[o,S,N,d,e]),I=re(()=>E(C.current),[E]),_=re(()=>{v.current=!1,g(!1)},[]),A=re(()=>{_(),m.current?.stop()},[_]),Y=re(()=>{v.current&&A()},[A]),ue=re((f,K)=>{if(o)return;if(v.current){A();return}let oe=S();oe.stop(),v.current=!0,g(!0);let x=K?.clip===!1?null:ke(q.current,Ae,e);oe.say({url:x,text:f,lang:N,speech:d,onEnd:_})},[o,A,S,e,N,d,_]),P=re(f=>{o||(f?E(!0):A(),a!==null&&Rn(a,f),C.current=f,p(f))},[o,E,A,a]),Z=re(()=>P(!C.current),[P]),T=re((f,K)=>{if(o||!l)return;v.current&&_();let oe=ke(q.current,f,e);S().say({url:oe,text:K,lang:N,speech:d})},[o,l,e,S,N,d,_]);return vr(()=>({supported:!o&&b,enabled:!o&&l,setEnabled:P,toggle:Z,unlock:I,speakKey:T,stop:A,summary:o?"none":M,summaryPlaying:c,toggleSummary:ue,stopSummary:Y}),[o,b,l,P,Z,I,T,A,M,c,ue,Y])}n(lt,"useVoiceGuidance");function ut(e,t,s,o){let{speakKey:r,stop:a,enabled:l}=e,p=Ce(!1);fe(()=>{if(!o||!l){p.current&&a(),p.current=!1;return}p.current=!0,pe(t)&&t!==Ae&&s!==""&&r(t,s)},[o,l,t,s,r,a])}n(ut,"useSpeakGuidance");import{isValidElement as Yr,useCallback as Je,useContext as Zr,useEffect as le,useMemo as Le,useRef as me,useState as Wn}from"react";import{useEffect as br,useRef as Sr}from"react";import{jsx as be,jsxs as dt}from"react/jsx-runtime";function Ln({showCoaching:e,attemptsText:t,showRetake:s,onRetake:o}){let r=U(),a=Sr(null);return br(()=>{s&&a.current?.focus()},[s]),!e&&!s?null:dt("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?dt("div",{className:"sekyro-stack sekyro-stack--1",children:[be("p",{className:"sekyro-text-body",children:r("capture.retryCoaching.title")}),dt("ul",{className:"sekyro-coaching",children:[be("li",{children:r("capture.retryCoaching.light")}),be("li",{children:r("capture.retryCoaching.eyeLevel")}),be("li",{children:r("capture.retryCoaching.head")})]}),t!==null?be("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:t}):null]}):null,s?be(D,{ref:a,className:"sekyro-btn--start",onClick:o,children:r("capture.recordAgain")}):null]})}n(Ln,"CapturedPanel");function Ye(){try{return process.env.NODE_ENV!=="production"}catch{return!1}}n(Ye,"isDevBuild");import{createContext as Vr}from"react";var wn=Vr(null);import{useCallback as En,useEffect as _n,useRef as Se}from"react";import{useId as Rr}from"react";import{jsx as Ze,jsxs as pt}from"react/jsx-runtime";var Lr=["user","environment"];function Mn({value:e,onChange:t}){let s=U(),o=Rr();return pt("fieldset",{className:"sekyro-segmented","data-testid":"sekyro-facing",children:[Ze("legend",{className:"sekyro-segmented__legend",children:s("capture.cameraLabel")}),Ze("div",{className:"sekyro-segmented__options",children:Lr.map(r=>pt("label",{className:"sekyro-segmented__option",children:[Ze("input",{type:"radio",className:"sekyro-segmented__input",name:o,value:r,checked:e===r,onChange:()=>t(r)}),pt("span",{className:"sekyro-segmented__face",children:[Ze("span",{className:"sekyro-segmented__dot","aria-hidden":"true"}),s(`capture.facing.${r}`)]})]},r))})]})}n(Mn,"FacingPicker");import{useEffect as wr,useState as Mr}from"react";import{jsx as Te,jsxs as Ir}from"react/jsx-runtime";function In({state:e}){let t=U(),[s,o]=Mr(!1);wr(()=>{e!=="unknown"&&o(!0)},[e]);let r=e==="granted"?Te(sn,{}):e==="denied"?Te(cn,{}):Te(an,{});return Ir("div",{role:s?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[Te("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:r}),Te("span",{children:t(`capture.permission.${e}`)})]})}n(In,"PermissionRow");import{jsx as We,jsxs as xn}from"react/jsx-runtime";function Nn({voice:e}){let t=U();if(!e.supported)return null;let s=e.enabled;return xn("button",{type:"button",role:"switch","aria-checked":s,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:()=>e.toggle(),children:[xn("span",{className:"sekyro-switch__label",children:[We(ve,{off:!s}),t("capture.voiceGuidance")]}),We("span",{className:"sekyro-switch__track","aria-hidden":"true",children:We("span",{className:"sekyro-switch__thumb",children:s?We(ln,{className:"sekyro-switch__check"}):null})})]})}n(Nn,"VoiceSwitch");import{Fragment as Nr,jsx as B,jsxs as Ve}from"react/jsx-runtime";function Pn({assets:e,onRetryAssets:t,permission:s,captureMode:o="self",canChooseFacing:r,facing:a,onFacingChange:l,voice:p,tips:C,summary:b,startLabel:w,startDisabled:M,onStart:k}){let c=U(),g=Se(b?.stop);g.current=b?.stop,_n(()=>()=>g.current?.(),[]);let v=Se(null),u=Se(null),L=Se(null),m=Se(e),S=Se(!1);_n(()=>{let i=m.current;if(m.current=e,i===e)return;let E=S.current;e!=="loading"&&(S.current=!1),xr(v.current)&&(e==="failed"?L.current?.focus():E&&u.current?.focus())},[e]);let N=En(()=>{S.current=!0,t()},[t]),O=e==="loading",d=O||M,G=En(()=>{d||(g.current?.(),k())},[d,k]),F;e==="failed"?F=Ve(j,{tone:"danger",testId:"sekyro-assets-error",children:[B("p",{className:"sekyro-text-body",children:c("fcv2.err.models")}),B(D,{kind:"ghost",ref:L,className:"sekyro-btn--start",onClick:N,"data-testid":"sekyro-assets-retry",children:c("common.retry")})]}):F=Ve("div",{className:"sekyro-stack sekyro-stack--1",children:[B(D,{ref:u,full:!0,"data-testid":"sekyro-start","aria-disabled":d?"true":void 0,"aria-busy":O?"true":void 0,onClick:G,children:O?Ve(Nr,{children:[B(un,{}),c("capture.preparing.title")]}):w??c("capture.start")}),O?B("p",{className:"sekyro-text-muted",children:c("capture.preparing.hint")}):null]});let q=o==="assisted";return Ve("div",{ref:v,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[q?Ve("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[B("h2",{className:"sekyro-text-body",children:c("capture.assisted.title")}),B("p",{className:"sekyro-text-muted",children:c("capture.assisted.lead")})]}):null,C!==!1?B(pn,{tips:C}):null,b!==void 0?Ve(D,{kind:"ghost",className:"sekyro-btn--start",onClick:b.toggle,"data-testid":"sekyro-tips-listen",children:[B(ve,{off:!1}),c(b.playing?"capture.tips.stop":"capture.tips.listen")]}):null,B(In,{state:s}),q&&r?B(Mn,{value:a,onChange:l}):null,B(Nn,{voice:p}),B("p",{className:"sekyro-text-muted",children:c("capture.securityNote")}),F,B("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?c("capture.preparing.title"):e==="ready"?c("capture.ready"):""})]})}n(Pn,"PreCaptureScreen");function xr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}n(xr,"focusIsOurs");import{useEffect as ft,useState as mt}from"react";function An(e){return Kn(e,"mobileRequired")}n(An,"useMobileRequired");function Tn(e){return Kn(e,"returning").required}n(Tn,"useReturning");function Kn(e,t){let[s,o]=mt({required:!1,settled:e===void 0});return ft(()=>{let r=e?.[t];if(e===void 0||typeof r!="function"){o({required:!1,settled:!0});return}let a=!0;return o({required:!1,settled:!1}),Promise.resolve().then(()=>r.call(e)).then(l=>{a&&o({required:l===!0,settled:!0})},()=>{a&&o({required:!1,settled:!0})}),()=>{a=!1}},[e,t]),s}n(Kn,"useFlag");function On(e){let[t,s]=mt({mode:"self",settled:e===void 0});return ft(()=>{let o=e?.captureMode;if(e===void 0||typeof o!="function"){s({mode:"self",settled:!0});return}let r=!0;return s({mode:"self",settled:!1}),Promise.resolve().then(()=>o.call(e)).then(a=>{r&&s({mode:a==="assisted"?"assisted":"self",settled:!0})},()=>{r&&s({mode:"self",settled:!0})}),()=>{r=!1}},[e]),t}n(On,"useCaptureMode");function Fn(e){let[t,s]=mt(!1);return ft(()=>{if(s(!1),e===void 0)return;let o=e.on("busy",()=>s(!0)),r=e.on("result",()=>s(!1));return()=>{o(),r()}},[e]),t}n(Fn,"useBusy");import{getLivenessAssetsStatus as Er,preloadLivenessAssets as _r,subscribeLivenessAssets as Pr}from"@sekyro/web";import{useCallback as yt,useEffect as Hn,useRef as Un,useState as Ar,useSyncExternalStore as Tr}from"react";var Kr=n(()=>"idle","serverSnapshot");function Bn(e){return _r(e!==void 0?{assetBaseUrl:e}:{})}n(Bn,"preload");function Gn(e,t=!0){let s=Tr(yt(M=>Pr(M,e),[e]),()=>Er(e),Kr),[o,r]=Ar(null),a=Un(!1),l=yt(()=>{Bn(e).then(M=>{a.current&&M==="idle"&&r({base:e})})},[e]);Hn(()=>(a.current=!0,l(),()=>{a.current=!1}),[l]);let p=Un(null);Hn(()=>{if(s!=="idle"){p.current={base:e};return}!t||p.current===null||p.current.base!==e||(p.current=null,l())},[s,e,l,t]);let C=yt(()=>{Bn(e)},[e]);return{gate:o!==null&&o.base===e&&s==="idle"||s==="ready"?"ready":s==="failed"?"failed":"loading",retry:C}}n(Gn,"useLivenessAssets");import{createLivenessCapture as Or}from"@sekyro/web";import{useCallback as gt,useEffect as Fr,useRef as Re,useState as z}from"react";var Dn={progress:0,hint:null,faceDetected:!1};function qn(e){let{videoRef:t,assetBaseUrl:s}=e,r=Re(e.verification).current,a=Re(!1);e.verification!==r&&!a.current&&Ye()&&(a.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: the `verification` prop changed identity after mount. The first instance stays bound (the camera is not rebuilt); create the verification once (useMemo / useState / outside render) instead of on every render."));let l=Re(null),[p,C]=z("idle"),[b,w]=z(Dn),[M,k]=z(!1),[c,g]=z(!1),[v,u]=z(null),[L,m]=z(!1),[S,N]=z(null),[O,d]=z(null),[G,F]=z(null),[q,i]=z(null),[E,I]=z(null),_=Re(null),A=Re("idle"),Y=Re(e);Y.current=e,Fr(()=>{let T=t.current;if(T===null)return;let f={video:T,...s!==void 0?{assetBaseUrl:s}:{}},K=r!==void 0?r.liveness(f):Or(f);l.current=K;let oe=n(()=>I(K.facingMode??null),"readFacing");oe();let x=[K.on("state",h=>{h==="starting"?(d(null),F(null),w(Dn),g(!1),k(!1),u(null),N(null),_.current=null):h==="gating"&&A.current==="recording"&&(g(!1),k(!1),u(null),_.current=null),A.current=h,oe(),C(h),Y.current.onStateChange?.(h)}),K.on("gate",h=>{let ye=_.current;_.current=h.progress,k(ye!==null&&h.progress<ye-.001&&h.progress>0&&h.progress<1),h.progress>=1&&g(!0),w(h)}),K.on("frozen",({previewDataUrl:h})=>u(h)),K.on("profile",({animations:h})=>m(h==="reduced")),K.on("ramp",({colour:h})=>N(h)),K.on("captured",h=>{d(h),i(null),Y.current.onCaptured?.(h)}),K.on("error",h=>{F(h),Y.current.onError?.(h)}),r?.on("result",h=>{i(h),Y.current.onResult?.(h)})];return()=>{for(let h of x)h?.();l.current=null,K.destroy()}},[r,t,s]);let ue=gt(T=>{l.current?.start(T)},[]),P=gt(()=>{l.current?.retry()},[]),Z=gt(()=>{let T=l.current,f=T?.switchCamera()===!0;return f&&(I(T?.facingMode??null),g(!1),k(!1),u(null),_.current=null),f},[]);return{state:p,gate:b,draining:M,gateLocked:c,frozenPreview:v,reduceMotion:L,rampColour:S,artifacts:O,error:G,result:q,facingMode:E,start:ue,retry:P,switchCamera:Z}}n(qn,"useLivenessHandle");import{useCallback as Hr,useEffect as Ur,useState as Qe}from"react";var Br=new Set(["national_number"]);function jn(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(s=>Br.has(s));return t.length>0?{...e,options:t}:null}n(jn,"pending");function $n(e){let[t,s]=Qe(null),[o,r]=Qe(e===void 0),[a,l]=Qe(!1),[p,C]=Qe(!1);Ur(()=>{if(s(null),e===void 0){r(!0);return}let k=!0,c=e.methodChoice;typeof c=="function"?(r(!1),Promise.resolve().then(()=>c.call(e)).then(v=>{k&&s(jn(v))},()=>{}).finally(()=>{k&&r(!0)})):r(!0);let g=e.on("method",v=>s(jn(v)));return()=>{k=!1,g()}},[e]);let b=Hr(async k=>{if(e===void 0)return!1;l(!0),C(!1);try{return await e.selectMethod(k),s(null),!0}catch{return C(!0),!1}finally{l(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!p?w:null,settled:o,busy:a,failed:p,select:b}}n($n,"useMethodChoice");import{useEffect as Gr,useMemo as Dr,useState as qr}from"react";var jr=["ar","fr","en"];function $r(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}n($r,"isClipUrl");function zr(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let s={};for(let o of jr){let r=t[o];if(!(typeof r!="object"||r===null))for(let[a,l]of Object.entries(r))!pe(a)||!$r(l)||((s[o]??(s[o]={}))[a]=l)}return Object.keys(s).length>0?s:null}n(zr,"toVoiceClipMap");function zn(e){let[t,s]=qr(null);Gr(()=>{if(s(null),e===void 0)return;let r=!0,a=n(p=>{if(!r)return;let C=typeof p=="object"&&p!==null&&typeof p.setId=="string"?p:null;s(b=>b?.setId===C?.setId?b:C)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(a,()=>a(null))}catch{a(null)}let l=e.on("view",p=>a(p.voice));return()=>{r=!1,l()}},[e]);let o=Dr(()=>t!==null?zr(t):null,[t]);return e===void 0?null:o}n(zn,"useServerVoiceClips");import{jsx as Yn}from"react/jsx-runtime";function Zn({voice:e}){let t=U();return Yn(D,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:()=>e.toggle(),children:Yn(ve,{off:!e.enabled,className:"sekyro-icon"})})}n(Zn,"VoiceChip");import{Fragment as Qn,jsx as R,jsxs as we}from"react/jsx-runtime";var Wr=800;function Qr(e){return e===void 0||e!==!1&&e.length===je.length&&je.every(t=>e.includes(t))}n(Qr,"isDefaultTips");function Jr(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}n(Jr,"carriesActivation");function Xr(e){return typeof e=="object"&&e!==null&&!Yr(e)&&"tone"in e&&"text"in e}n(Xr,"isNoticeObject");function eo(e){return e==="starting"||e==="gating"||e==="recording"}n(eo,"isCapturing");function to(e){return e==="captured"||e==="uploading"||e==="checking"}n(to,"isPostCapture");function mi({verification:e,locale:t,dir:s,strings:o,slots:r,autoStart:a=!1,notice:l,startDisabled:p=!1,startLabel:C,tips:b,tipsSummary:w,coach:M,voice:k,onGuidance:c,onCaptured:g,onResult:v,onError:u,onStateChange:L,assetBaseUrl:m,className:S}){let N=Wt(t),O=Le(()=>Zt(t,o),[t,o,N]),d=Le(()=>y=>O[y]??"",[O]),G=s??(t==="ar"?"rtl":"ltr"),F=me(null),q=Zr(wn),i=qn({verification:e,videoRef:F,assetBaseUrl:m,onCaptured:g,onResult:v,onError:u,onStateChange:L}),E=Gn(m,i.state==="idle"&&i.error===null),I=$n(e),_=I.choice!==null,A=An(e),Y=Tn(e),ue=Fn(e),P=Xt(),Z=On(e),T=Z.mode==="assisted",f=T&&P.canChooseFacing,K=k!==!1&&k?.clips===void 0,oe=zn(K?e:void 0),x=lt({locale:t,defaultClips:oe,options:k}),[h,ye]=Wn(null),W=T?h??(P.canChooseFacing?"environment":"user"):"user",ht=Z.settled&&(!T||P.facingSettled),vt=me(null),Ke=me(!1),kt=me(x.unlock);kt.current=x.unlock,le(()=>{let y=vt.current;if(y===null)return;let J=["pointerup","touchend","click","keydown"],ae=n(()=>{for(let Ee of J)y.removeEventListener(Ee,he,!0)},"disarm");function he(Ee){if(Ke.current){ae();return}Jr(Ee)&&(Ke.current=!0,ae(),kt.current())}n(he,"onGesture");for(let Ee of J)y.addEventListener(Ee,he,{capture:!0,passive:!0});return ae},[]);let Ct=Je(()=>{Ke.current||(Ke.current=!0,x.unlock()),i.start({facing:W})},[x.unlock,i.start,W]),bt=Je(()=>i.start({facing:W}),[i.start,W]),Oe=me(!1),Me=i.state==="idle"&&i.error===null,St=!_&&!A.required&&(a===!0||a==="when-permitted"&&P.permission==="granted"),Vt=St&&I.settled&&A.settled&&ht,Jn=a==="when-permitted"&&!P.permissionSettled&&!Oe.current,Rt=St&&Me&&!Oe.current,Xe=(Jn||Rt||!ht)&&E.gate==="ready"?"loading":E.gate;le(()=>{!Vt||!Me||E.gate!=="ready"||Oe.current||(Oe.current=!0,bt())},[Vt,Me,E.gate,bt]);let Xn=Me&&!_&&!A.required&&!(Rt&&E.gate==="ready"),Lt=Je(()=>{i.switchCamera()&&ye(W==="user"?"environment":"user")},[i.switchCamera,W]),wt=i.state!=="idle"&&i.facingMode!==null?i.facingMode:W;le(()=>{let y=F.current?.style;wt==="user"?y?.removeProperty("transform"):y&&(y.transform="none")},[wt]);let Fe=Le(()=>i.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(i.artifacts.keyframe):null,[i.artifacts]);le(()=>{if(Fe!==null)return()=>URL.revokeObjectURL(Fe)},[Fe]);let Mt=i.frozenPreview??Fe,ge=e!==void 0,H=eo(i.state),ie=to(i.state),He=H||ie,$=i.result,It=i.state==="done"&&$!==null,xt=i.state==="recording"&&i.frozenPreview!==null,et=q!==null,Ie=ie||xt,Nt=ie?"checking":xt?"frozen":i.state==="recording"?"recording":i.gateLocked||i.gate.progress>=1?"locked":i.gate.faceDetected?"aligning":"seeking",Ue=H?i.gate.hint:null,Be=i.state==="starting"?"capture.preparing.title":Ue===null?null:Ue==="center"&&!i.gate.faceDetected?"fcv3.no_face":Dt(Ue),[er,Et]=Wn(null);le(()=>{if(Be!=="fcv3.no_face"){Et(Be);return}if(!H)return;let y=setTimeout(()=>Et(Be),Wr);return()=>clearTimeout(y)},[Be,H]);let tt=H&&typeof M=="string"&&M!=="",_t=T&&H?d("capture.assisted.stage"):null,de=H&&!tt?er:null,nt=tt?M:de===null?"":d(de);ut(x,de,nt,H);let Pt=me(c);Pt.current=c,le(()=>{if(pe(de))try{Pt.current?.(de)}catch(y){console.error("[@sekyro/react] onGuidance threw:",y)}},[de]);let xe=Le(()=>({supported:x.supported,enabled:x.enabled,setEnabled:x.setEnabled,toggle:x.toggle}),[x.supported,x.enabled,x.setEnabled,x.toggle]),rt=r?.voicePrompt,At=rt!==void 0,Tt=k===void 0,Kt=me(!1);le(()=>{!At||!Tt||Kt.current||!Ye()||(Kt.current=!0,console.warn("[@sekyro/react] <LivenessCapture>: `slots.voicePrompt` is set and `voice` is undefined, so the component speaks the guidance itself. If your slot plays audio, pass voice={false} or the person hears every hint twice; pass voice={{}} to keep the built-in voice and silence this warning."))},[At,Tt]);let tr=rt!==void 0?(y,J,ae)=>rt(y,J,ae,xe):x.supported?()=>R(Zn,{voice:xe}):void 0,{summary:ot,summaryPlaying:Ot,toggleSummary:Ft,stopSummary:Ht}=x,Ge=w!==void 0&&w!=="",Ut=Ge?w:d("capture.tips.summary"),Bt=Ge?ot!=="none":ot==="partner"||ot==="default"&&Qr(b),nr=Le(()=>Bt?{playing:Ot,toggle:n(()=>Ft(Ut,{clip:!Ge}),"toggle"),stop:Ht}:void 0,[Bt,Ot,Ft,Ut,Ht,Ge]),rr=Le(()=>({assets:Xe,retryAssets:E.retry,permission:P.permission,permissionSettled:P.permissionSettled,captureMode:Z.mode,facing:W,setFacing:ye,canChooseFacing:f,voice:xe}),[Xe,E.retry,P.permission,P.permissionSettled,Z.mode,f,W,xe]),or=Xr(l)?R(j,{tone:l.tone,testId:"sekyro-host-notice",children:R("span",{children:l.text})}):l??null,se=$!==null&&$.status==="retry"?$:null,Q=It&&$.status==="unavailable"&&!_&&$.reason!=="portrait_required"?$:null,Ne=It&&($.status==="approved"||$.status==="rejected"||$.status==="review")?$:null,De=n((y,J)=>{if(y===void 0)return null;if(y==="device_cooldown"){let he=zt(t,J);if(he!==null)return d(he.key).replace("{time}",he.time)}let ae=$t(y);return ae===null?null:d(ae)},"reasonText"),st=n(y=>{let J=y.retakeHint===void 0?null:qt(y.retakeHint);return J===null?De(y.reason):d(J)},"retryText"),sr=Q!==null&&Q.reason!==void 0&&Q.reason!=="nni_unbound"&&Q.reason!=="id_number_unbound"&&Q.reason!=="method_required"&&Q.reason!=="mobile_required"&&!(Q.reason==="no_recorder"&&i.artifacts?.degraded==="NO_RECORDER"),Gt=qe(),ir=_&&I.auto===null&&!H&&!ie&&i.error===null,it=Je(async y=>{await I.select(y)&&i.state==="done"&&i.retry()},[I.select,i.state,i.retry]);return le(()=>{I.auto!==null&&!I.busy&&!H&&!ie&&it(I.auto)},[I.auto,I.busy,H,ie,it]),R(Qt,{value:d,children:we("div",{ref:vt,className:S===void 0?"sekyro-capture":`sekyro-capture ${S}`,dir:G,lang:t,"data-testid":"sekyro-liveness-capture","data-state":i.state,children:[r?.header,se!==null&&st(se)!==null&&!(et&&He)?R(j,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:R("span",{children:st(se)})}):null,ue&&ie&&!et?R(j,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:R("span",{children:d("capture.busy")})}):null,A.required&&Me?R(j,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:R("span",{children:d("reasons.mobile_required")})}):null,i.error!==null?r?.errorPanel!==void 0?r.errorPanel(i.error,i.retry):we(j,{tone:"danger",testId:"sekyro-error-notice",children:[R("span",{children:d(jt(i.error.kind))}),i.error.retryable?R(D,{ref:Gt,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:d("common.retry")}):null]}):null,Q!==null?we(j,{tone:"danger",testId:"sekyro-unavailable-notice",children:[R("span",{children:De(Q.reason)??d(Q.reason===void 0?"errors.session_expired":"errors.network_error")}),sr?R(D,{ref:Gt,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:d("capture.recordAgain")}):null]}):null,Ne!==null&&De(Ne.reason)!==null?R(j,{tone:Ne.status==="rejected"?"danger":"info",testId:"sekyro-result-notice",children:R("span",{children:De(Ne.reason,Ne.retryAfter)})}):null,R("div",{className:He?void 0:"sekyro-hidden","data-capture-live":He?"":void 0,children:et?q({videoRef:F,guidance:Ie&&ge?d("capture.checking"):nt,coached:tt&&!(Ie&&ge),note:Ie?ge?d(ue?"capture.busy":"capture.checkingHint"):null:se!==null?st(se):_t,settled:Ie&&ge,progress:i.gate.progress,phase:Nt,still:Ie?Mt:null,live:He,switchCamera:H&&i.state!=="recording"&&f&&Lt,ramp:i.rampColour===null?null:{colour:i.rampColour}}):R(Jt,{videoRef:F,guidanceText:nt,guidanceHint:Ue,guidanceKey:de,progress:i.gate.progress,phase:Nt,draining:i.draining,stillUrl:Mt,showChecking:ge,onSwitchCamera:Lt,canSwitchCamera:T&&H&&i.state!=="recording",operatorText:_t,voicePrompt:tr,overlay:y=>we(Qn,{children:[r?.stageOverlay?.(y),R(en,{colour:i.rampColour})]}),reduceMotion:i.reduceMotion})}),ir&&I.choice!==null?R(mn,{title:d("method.title"),description:d("method.description"),options:I.choice.options.map(y=>({id:y,label:d(`method.${y}`)})),busy:I.busy,error:I.failed?d("errors.network_error"):null,focus:i.state==="done",testId:"sekyro-method",look:"buttons",onChoose:y=>{it(y)}}):null,Xn?we(Qn,{children:[Y&&r?.header===void 0?we("div",{className:"sekyro-stack sekyro-stack--1",children:[R("h2",{className:"sekyro-text-body",children:d("returning.title")}),R("p",{className:"sekyro-text-muted",children:d("returning.description")})]}):null,or,r?.intro!==void 0?r.intro(Ct,rr):R(Pn,{assets:Xe,onRetryAssets:E.retry,permission:P.permission,captureMode:Z.mode,canChooseFacing:f,facing:W,onFacingChange:ye,voice:xe,tips:b??je,summary:nr,startLabel:C,startDisabled:p,onStart:Ct})]}):null,R(Ln,{showCoaching:se!==null,attemptsText:se?.attemptsRemaining!==void 0?Yt(O,t,se.attemptsRemaining):null,showRetake:se!==null&&!H&&!ie||!ge&&i.state==="captured",onRetake:i.retry}),r?.footer]})})}n(mi,"LivenessCapture");export{Ye as a,wn as b,Mn as c,je as d,mn as e,ze as f,Wr as g,mi as h};