@sekyro/elements 0.1.0-rc.4 → 0.1.0-rc.6

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 (83) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/README.md +8 -9
  3. package/custom-elements.json +2 -2
  4. package/dist/cdn/chunks/{capture-session-doc-FRBI7OKF-AIBTLOVK.js → capture-session-doc-LUA4Y7PZ-LOMSB7V7.js} +1 -1
  5. package/dist/cdn/chunks/{chunk-5K4YQOZN.js → chunk-33KMCERZ.js} +1 -1
  6. package/dist/cdn/chunks/{chunk-UGP2ZH7W.js → chunk-3ELDB5WG.js} +1 -1
  7. package/dist/cdn/chunks/chunk-4FTXJ6MZ.js +1 -0
  8. package/dist/cdn/chunks/{chunk-HMNCXTZQ.js → chunk-AXYGICTN.js} +2 -2
  9. package/dist/cdn/chunks/{chunk-AOM2HJGY.js → chunk-D2JAXHZF.js} +1 -1
  10. package/dist/cdn/chunks/{chunk-COQQVNNG.js → chunk-DBGVBAMW.js} +1 -1
  11. package/dist/cdn/chunks/{chunk-SIPFHN7E.js → chunk-DQAVYXAF.js} +1 -1
  12. package/dist/cdn/chunks/{chunk-QOZB3DLY.js → chunk-ETJPN5LO.js} +1 -1
  13. package/dist/cdn/chunks/{chunk-X4MIUKLT.js → chunk-F4IM73DE.js} +1 -1
  14. package/dist/cdn/chunks/{chunk-LA2MA2UQ.js → chunk-FGBKOHVK.js} +1 -1
  15. package/dist/cdn/chunks/{chunk-RPCMWL2U.js → chunk-FWZOENNU.js} +1 -1
  16. package/dist/cdn/chunks/{chunk-H22YHQ6V.js → chunk-HH33TJJH.js} +1 -1
  17. package/dist/cdn/chunks/{chunk-G2RZQTCT.js → chunk-L2UAVB62.js} +1 -1
  18. package/dist/cdn/chunks/{chunk-AN2KDTP4.js → chunk-M4UCDUJB.js} +1 -1
  19. package/dist/cdn/chunks/chunk-NYF6B3ZA.js +1 -0
  20. package/dist/cdn/chunks/{chunk-AKUFZTNC.js → chunk-OGRBLEPE.js} +1 -1
  21. package/dist/cdn/chunks/chunk-OPRYWIQM.js +33 -0
  22. package/dist/cdn/chunks/{chunk-5ZNWYB3D.js → chunk-QMITFZK4.js} +1 -1
  23. package/dist/cdn/chunks/chunk-UGHWANZX.js +1 -0
  24. package/dist/cdn/chunks/{chunk-GIGTK355.js → chunk-W4RXHXFP.js} +1 -1
  25. package/dist/cdn/chunks/{create-document-capture-2YBCDEUB-GYUIXEAL.js → create-document-capture-ZTJKSEJB-NIBVRVLZ.js} +1 -1
  26. package/dist/cdn/chunks/{document-capture-view-UL3ISHNS-E6AP35NA.js → document-capture-view-ZKT3W6UE-FQWRXOHT.js} +1 -1
  27. package/dist/cdn/chunks/{eid-view-FKFEF42L-4OPACR2A.js → eid-view-7CTFIZ5R-PN357YSL.js} +1 -1
  28. package/dist/cdn/chunks/{email-otp-view-NRZCAJJ4-UFM2YDCD.js → email-otp-view-MB334KKV-YKOW7MU6.js} +1 -1
  29. package/dist/cdn/chunks/{flow-views-N7LBFI55-36234BJJ.js → flow-views-SRAXHC6K-J3H3VF3P.js} +1 -1
  30. package/dist/cdn/chunks/overlay-de-ILMZBGZH-DIOHROVO.js +1 -0
  31. package/dist/cdn/chunks/overlay-es-YLDY73HJ-LSXKLJQ2.js +1 -0
  32. package/dist/cdn/chunks/overlay-pt-GZXT2S6D-ASML67UA.js +1 -0
  33. package/dist/cdn/chunks/plan-runner-INQLWFGS-24JH5MQZ.js +1 -0
  34. package/dist/cdn/chunks/{portrait-capture-view-6KZGPAJU-CFUUPI5B.js → portrait-capture-view-DSUGE7PI-L7U7UVJY.js} +1 -1
  35. package/dist/cdn/chunks/{portrait-review-view-TBSABVSX-J5ZCIFSX.js → portrait-review-view-PPYEEMYM-V4UMKNJE.js} +1 -1
  36. package/dist/cdn/chunks/{proof-of-address-view-3GG3XEQK-7DFCRBNZ.js → proof-of-address-view-2M6UDK76-ND76DOHN.js} +1 -1
  37. package/dist/cdn/define.js +1 -1
  38. package/dist/cdn/index.js +1 -1
  39. package/dist/{chunk-UXPM24JI.js → chunk-3BGD4PJ7.js} +1 -1
  40. package/dist/{chunk-PMIO3U3J.js → chunk-BJ2YKUCC.js} +1 -1
  41. package/dist/{chunk-JUB6FRPB.js → chunk-F2IPIZ4J.js} +1 -1
  42. package/dist/{chunk-A75VY7L7.js → chunk-FSGDOTCB.js} +1 -1
  43. package/dist/{chunk-CFERAKA2.js → chunk-KHBP6WWR.js} +1 -1
  44. package/dist/{chunk-JCCTKW23.js → chunk-LNCABBX7.js} +1 -1
  45. package/dist/{chunk-PNTIMH72.js → chunk-OSC2SC2X.js} +1 -1
  46. package/dist/{chunk-2FHYNKUL.js → chunk-PFH7S4E7.js} +1 -1
  47. package/dist/chunk-ULVT7UW6.js +1 -0
  48. package/dist/chunk-UUDX5GK4.js +33 -0
  49. package/dist/{chunk-UZJG5SPC.js → chunk-VEOZABLV.js} +1 -1
  50. package/dist/{chunk-YPBTBTOU.js → chunk-XLLG6AKG.js} +1 -1
  51. package/dist/{chunk-APM7FCA2.js → chunk-YQ7XHAQJ.js} +1 -1
  52. package/dist/define.cjs +5 -5
  53. package/dist/define.js +1 -1
  54. package/dist/{document-capture-view-UL3ISHNS-K636D7VR.js → document-capture-view-ZKT3W6UE-5JRPJOO5.js} +1 -1
  55. package/dist/{eid-view-FKFEF42L-ZXQWPIIA.js → eid-view-7CTFIZ5R-OL2YXQZO.js} +1 -1
  56. package/dist/{email-otp-view-NRZCAJJ4-RANTR7SO.js → email-otp-view-MB334KKV-Q7237EQV.js} +1 -1
  57. package/dist/{flow-views-N7LBFI55-DZ3PH2EP.js → flow-views-SRAXHC6K-DUSVVMFO.js} +1 -1
  58. package/dist/index.cjs +5 -5
  59. package/dist/index.d.cts +11 -3
  60. package/dist/index.d.ts +11 -3
  61. package/dist/index.js +1 -1
  62. package/dist/overlay-de-ILMZBGZH-L5N7BMI4.js +1 -0
  63. package/dist/overlay-es-YLDY73HJ-JYBZEXG5.js +1 -0
  64. package/dist/overlay-pt-GZXT2S6D-WCIUJ4DI.js +1 -0
  65. package/dist/{portrait-capture-view-6KZGPAJU-LAGNB7A4.js → portrait-capture-view-DSUGE7PI-HBLXJDXY.js} +1 -1
  66. package/dist/{portrait-review-view-TBSABVSX-MLNZZBL5.js → portrait-review-view-PPYEEMYM-W66WNNUM.js} +1 -1
  67. package/dist/{proof-of-address-view-3GG3XEQK-FWM7OQ4K.js → proof-of-address-view-2M6UDK76-27QSU4R3.js} +1 -1
  68. package/dist/styles.css +14 -8
  69. package/package.json +2 -2
  70. package/sbom.cdx.json +4 -4
  71. package/dist/cdn/chunks/chunk-FYPP4Q7V.js +0 -33
  72. package/dist/cdn/chunks/chunk-H5GXVL63.js +0 -1
  73. package/dist/cdn/chunks/chunk-KLODCY6G.js +0 -1
  74. package/dist/cdn/chunks/chunk-YRTHQZAW.js +0 -1
  75. package/dist/cdn/chunks/overlay-de-KYSF3MDD-XORYFTYU.js +0 -1
  76. package/dist/cdn/chunks/overlay-es-36H5G6S5-22UFLFPZ.js +0 -1
  77. package/dist/cdn/chunks/overlay-pt-EB4UDBFE-CWJXQDCQ.js +0 -1
  78. package/dist/cdn/chunks/plan-runner-KQM7I4MR-HEXIU27Q.js +0 -1
  79. package/dist/chunk-LYFBZCIH.js +0 -33
  80. package/dist/chunk-WBXQX6DQ.js +0 -1
  81. package/dist/overlay-de-KYSF3MDD-2ZNXM2N7.js +0 -1
  82. package/dist/overlay-es-36H5G6S5-VQWD57TO.js +0 -1
  83. package/dist/overlay-pt-EB4UDBFE-6VWPTFO2.js +0 -1
@@ -1 +1 @@
1
- "use client";import{a as S}from"./chunk-H22YHQ6V.js";import{a as q}from"./chunk-YRTHQZAW.js";import"./chunk-QOZB3DLY.js";import{d as M}from"./chunk-X4MIUKLT.js";import"./chunk-LA2MA2UQ.js";import{K as b,L as G,a as O,b as j,c as k,v as F,w as D,y as R}from"./chunk-SIPFHN7E.js";import{a as i}from"./chunk-5QL6W6FW.js";import{a as s,c as x}from"./chunk-4FHWXBOB.js";var v=x(O(),1),f=x(O(),1),o=x(j(),1),t=x(j(),1);var ee={"poa.title":"إثبات العنوان","poa.lead":"ارفع وثيقة حديثة تُظهر اسمك وعنوانك الحالي.","poa.accepted":"الوثائق المقبولة","poa.acceptedFor":"مقبول في {country}","poa.kindDated":"{kind}، صادر خلال آخر {days} يومًا","poa.kinds.utility_bill":"فاتورة كهرباء أو ماء أو غاز","poa.kinds.telecom_bill":"فاتورة هاتف أو إنترنت","poa.kinds.bank_statement":"كشف حساب بنكي","poa.kinds.tax_notice":"إشعار ضريبي","poa.kinds.rental_agreement":"عقد إيجار","poa.kinds.government_certificate":"شهادة السكن","poa.kinds.insurance_statement":"وثيقة تأمين","poa.source.camera":"التقاط صورة","poa.source.upload":"رفع ملف","poa.source.lead":"صورة للوثيقة، أو ملف PDF أو صورة من جهازك","poa.upload.hint":"PDF أو JPEG أو PNG، بحد أقصى 3 صفحات و10 ميغابايت","poa.upload.choose":"اختيار ملف","poa.upload.addPage":"إضافة صفحة","poa.upload.pages":"{count} من 3 صفحات","poa.upload.send":"إرسال الوثيقة","poa.upload.sending":"جارٍ إرسال وثيقتك…","poa.upload.unsupported":"نوع الملف هذا غير مقبول. اختر ملف PDF أو JPEG أو PNG","poa.upload.tooManyPages":"أرسل 3 صفحات على الأكثر. احذف صفحة أو اختر ملفًا أقصر","poa.upload.tooLarge":"حجم الملف يتجاوز 10 ميغابايت. اختر ملفًا أصغر","poa.upload.failed":"تعذّر إرسال الوثيقة. تحقّق من اتصالك وحاول مرة أخرى","poa.camera.lead":"ضع الوثيقة بشكل مسطّح واملأ الإطار. التقط صورة واحدة لكل صفحة","poa.camera.capture":"التقاط الصورة","poa.camera.retake":"إعادة الالتقاط","poa.camera.next":"الصفحة التالية","poa.camera.page":"الصفحة {number}","poa.letter.title":"رسالة من صاحب الفاتورة","poa.letter.lead":"الوثيقة باسم شخص آخر. أضف رسالة موقّعة من هذا الشخص تفيد بأنك تسكن في هذا العنوان","poa.letter.send":"إرسال الرسالة","poa.licence.use":"استخدام العنوان المذكور في رخصة القيادة","poa.licence.note":"قرأنا هذا العنوان من رخصتك. لا تحتاج إلى وثيقة أخرى.","poa.retry.document_too_old":"هذه الوثيقة أقدم من المسموح. ارفع وثيقة أحدث من القائمة أدناه","poa.retry.document_date_invalid":"تاريخ الوثيقة في المستقبل. ارفع وثيقة بتاريخ اليوم أو قبله","poa.retry.document_kind_not_accepted":"نوع هذه الوثيقة غير مقبول. ارفع إحدى الوثائق المذكورة أدناه","poa.retry.name_mismatch":"الاسم في الوثيقة لا يطابق اسمك. ارفع وثيقة باسمك","poa.retry.address_mismatch":"العنوان في الوثيقة لا يطابق العنوان الذي وصلنا. ارفع وثيقة لهذا العنوان","poa.retry.holder_letter_missing":"يجب أن تكون الرسالة موقّعة وأن تذكر اسمك واسم صاحب الفاتورة. ارفع رسالة كاملة","poa.retry.unreadable":"تعذّرت قراءة الوثيقة. ارفع نسخة كاملة وأكثر وضوحًا","poa.retry.pdf_protected":"أزل كلمة المرور من ملف PDF وحاول مرة أخرى","poa.retry.provider_unavailable":"تعذّر فحص الوثيقة حاليًا. حاول مرة أخرى بعد قليل","poa.hint.blurry":"الصورة غير واضحة","poa.hint.cropped":"جزء من الوثيقة مقطوع","poa.hint.glare":"يوجد انعكاس ضوء على الوثيقة","reasons.provider_unavailable":"تعذّر فحص الوثيقة حاليًا","reasons.pdf_protected":"ملف PDF محمي بكلمة مرور أو يحتوي على محتوى نشط","reasons.document_kind_not_accepted":"نوع الوثيقة غير مقبول","reasons.document_date_invalid":"تاريخ الوثيقة في المستقبل","reasons.document_too_old":"الوثيقة قديمة جدًا","reasons.document_tampered":"يبدو أن الوثيقة قد عُدّلت","reasons.holder_letter_required":"يلزم تقديم رسالة من صاحب الفاتورة","reasons.holder_letter_missing":"رسالة صاحب الفاتورة مفقودة أو غير مكتملة","reasons.address_mismatch":"العنوان لا يطابق العنوان المقدَّم"},z={"poa.title":"Proof of address","poa.lead":"Upload a recent document that shows your name and your current address.","poa.accepted":"Accepted documents","poa.acceptedFor":"Accepted for {country}","poa.kindDated":"{kind}, dated within the last {days} days","poa.kinds.utility_bill":"Electricity, water or gas bill","poa.kinds.telecom_bill":"Phone or internet bill","poa.kinds.bank_statement":"Bank statement","poa.kinds.tax_notice":"Tax notice","poa.kinds.rental_agreement":"Rental agreement","poa.kinds.government_certificate":"Residence certificate","poa.kinds.insurance_statement":"Insurance statement","poa.source.camera":"Take a photo","poa.source.upload":"Upload a file","poa.source.lead":"A photo of the document, or a PDF or image from your device","poa.upload.hint":"PDF, JPEG or PNG, up to 3 pages and 10 MB","poa.upload.choose":"Choose a file","poa.upload.addPage":"Add a page","poa.upload.pages":"{count} of 3 pages","poa.upload.send":"Send document","poa.upload.sending":"Sending your document…","poa.upload.unsupported":"This file type is not accepted. Choose a PDF, JPEG or PNG","poa.upload.tooManyPages":"Send at most 3 pages. Remove a page or choose a shorter file","poa.upload.tooLarge":"The file is over 10 MB. Choose a smaller file","poa.upload.failed":"We could not send the document. Check your connection and try again","poa.camera.lead":"Lay the document flat and fill the frame. Take one photo per page","poa.camera.capture":"Take photo","poa.camera.retake":"Retake","poa.camera.next":"Next page","poa.camera.page":"Page {number}","poa.letter.title":"Letter from the bill holder","poa.letter.lead":"The document is in another person's name. Add a signed letter from that person saying that you live at this address","poa.letter.send":"Send letter","poa.licence.use":"Use the address on my driver's license","poa.licence.note":"We read this address from your license. You don't need another document.","poa.retry.document_too_old":"This document is older than allowed. Upload a more recent one from the list below","poa.retry.document_date_invalid":"The date on the document is in the future. Upload a document with today's date or earlier","poa.retry.document_kind_not_accepted":"This document type is not accepted. Upload one of the documents listed below","poa.retry.name_mismatch":"The name on the document does not match yours. Upload a document in your name","poa.retry.address_mismatch":"The address on the document does not match the one we were given. Upload a document for that address","poa.retry.holder_letter_missing":"The letter must be signed and name both you and the bill holder. Upload a complete letter","poa.retry.unreadable":"We could not read the document. Upload a sharper, complete copy","poa.retry.pdf_protected":"Remove the password from the PDF and try again","poa.retry.provider_unavailable":"The document could not be checked right now. Try again in a moment","poa.hint.blurry":"The image is blurry","poa.hint.cropped":"Part of the document is cut off","poa.hint.glare":"There is glare on the document","reasons.provider_unavailable":"The document could not be checked right now","reasons.pdf_protected":"The PDF is password-protected or contains active content","reasons.document_kind_not_accepted":"The document type is not accepted","reasons.document_date_invalid":"The document date is in the future","reasons.document_too_old":"The document is too old","reasons.document_tampered":"The document appears to have been edited","reasons.holder_letter_required":"A letter from the bill holder is needed","reasons.holder_letter_missing":"The letter from the bill holder is missing or incomplete","reasons.address_mismatch":"The address does not match the one supplied"},ae={"poa.title":"Justificatif de domicile","poa.lead":"Importez un document récent qui indique votre nom et votre adresse actuelle.","poa.accepted":"Documents acceptés","poa.acceptedFor":"Accepté pour {country}","poa.kindDated":"{kind}, daté des {days} derniers jours","poa.kinds.utility_bill":"Facture d'électricité, d'eau ou de gaz","poa.kinds.telecom_bill":"Facture de téléphone ou d'internet","poa.kinds.bank_statement":"Relevé bancaire","poa.kinds.tax_notice":"Avis d'imposition","poa.kinds.rental_agreement":"Bail ou quittance de loyer","poa.kinds.government_certificate":"Certificat de résidence","poa.kinds.insurance_statement":"Attestation d'assurance","poa.source.camera":"Prendre une photo","poa.source.upload":"Importer un fichier","poa.source.lead":"Une photo du document, ou un PDF ou une image depuis votre appareil","poa.upload.hint":"PDF, JPEG ou PNG, 3 pages et 10 Mo au maximum","poa.upload.choose":"Choisir un fichier","poa.upload.addPage":"Ajouter une page","poa.upload.pages":"{count} sur 3 pages","poa.upload.send":"Envoyer le document","poa.upload.sending":"Envoi de votre document…","poa.upload.unsupported":"Ce type de fichier n'est pas accepté. Choisissez un PDF, un JPEG ou un PNG","poa.upload.tooManyPages":"Envoyez 3 pages au maximum. Retirez une page ou choisissez un fichier plus court","poa.upload.tooLarge":"Le fichier dépasse 10 Mo. Choisissez un fichier plus léger","poa.upload.failed":"Nous n'avons pas pu envoyer le document. Vérifiez votre connexion et réessayez","poa.camera.lead":"Posez le document à plat et remplissez le cadre. Prenez une photo par page","poa.camera.capture":"Prendre la photo","poa.camera.retake":"Reprendre","poa.camera.next":"Page suivante","poa.camera.page":"Page {number}","poa.letter.title":"Lettre du titulaire de la facture","poa.letter.lead":"Le document est au nom d'une autre personne. Ajoutez une lettre signée de cette personne attestant que vous habitez à cette adresse","poa.letter.send":"Envoyer la lettre","poa.licence.use":"Utiliser l'adresse de mon permis de conduire","poa.licence.note":"Nous avons lu cette adresse sur votre permis. Vous n'avez pas besoin d'un autre document.","poa.retry.document_too_old":"Ce document est plus ancien que la limite. Importez un document plus récent parmi ceux de la liste ci-dessous","poa.retry.document_date_invalid":"La date du document est dans le futur. Importez un document daté d'aujourd'hui ou d'avant","poa.retry.document_kind_not_accepted":"Ce type de document n'est pas accepté. Importez l'un des documents de la liste ci-dessous","poa.retry.name_mismatch":"Le nom sur le document ne correspond pas au vôtre. Importez un document à votre nom","poa.retry.address_mismatch":"L'adresse du document ne correspond pas à celle qui nous a été transmise. Importez un document pour cette adresse","poa.retry.holder_letter_missing":"La lettre doit être signée et nommer à la fois vous et le titulaire de la facture. Importez une lettre complète","poa.retry.unreadable":"Nous n'avons pas pu lire le document. Importez une copie plus nette et complète","poa.retry.pdf_protected":"Retirez le mot de passe du PDF et réessayez","poa.retry.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment. Réessayez dans un instant","poa.hint.blurry":"L'image est floue","poa.hint.cropped":"Une partie du document est coupée","poa.hint.glare":"Il y a un reflet sur le document","reasons.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment","reasons.pdf_protected":"Le PDF est protégé par un mot de passe ou contient du contenu actif","reasons.document_kind_not_accepted":"Ce type de document n'est pas accepté","reasons.document_date_invalid":"La date du document est dans le futur","reasons.document_too_old":"Le document est trop ancien","reasons.document_tampered":"Le document semble avoir été modifié","reasons.holder_letter_required":"Une lettre du titulaire de la facture est nécessaire","reasons.holder_letter_missing":"La lettre du titulaire de la facture est absente ou incomplète","reasons.address_mismatch":"L'adresse ne correspond pas à celle qui a été transmise"};function J({blob:a,label:n}){let[e,r]=(0,f.useState)(void 0);return(0,f.useEffect)(()=>{if(typeof URL.createObjectURL!="function")return;let d=URL.createObjectURL(a);return r(d),()=>URL.revokeObjectURL(d)},[a]),(0,o.jsx)("img",{src:e,alt:n})}s(J,"Q");i(J,"PageThumb");function B({step:a,i18n:n,c:e,title:r,notice:d,intro:m,onUpload:p}){let y=(0,f.useRef)(null),l=(0,f.useRef)(null),[c,_]=(0,f.useState)([]),[h,P]=(0,f.useState)(!1),[L,C]=(0,f.useState)("idle"),[K,U]=(0,f.useState)(!1),A=i(u=>{P(!1),u.start().catch(()=>P(!0))},"open");(0,f.useEffect)(()=>{let u=y.current;if(u===null)return;let g;try{g=a.capturePage({video:u})}catch{P(!0);return}return l.current=g,A(g),()=>{g.destroy(),l.current=null}},[]);let E=c.length>=a.maxPages,Q=i(async()=>{let u=l.current;if(!(u===null||E)){C("taking"),U(!1);try{await u.takePage()}catch{}_([...u.pages]),C("idle")}},"take"),X=i(u=>{let g=l.current;g!==null&&(g.removePage(u),_([...g.pages]))},"retake"),Z=i(async()=>{let u=l.current;if(!(u===null||c.length===0)){C("sending"),U(!1);try{await u.submitPages()}catch{U(!0)}C("idle")}},"send"),T=L==="sending";return(0,o.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-poa-camera",children:[(0,o.jsx)(D,{title:r,lead:e("poa.camera.lead")}),d,K?(0,o.jsx)(b,{tone:"danger",children:(0,o.jsx)("span",{children:e("poa.upload.failed")})}):null,h?(0,o.jsxs)(b,{tone:"danger",children:[(0,o.jsx)("span",{children:e("doc.cameraBlocked")}),(0,o.jsx)("span",{children:e("doc.cameraBlockedHint")}),l.current!==null?(0,o.jsx)(k,{kind:"secondary",onClick:s(()=>l.current!==null&&A(l.current),"onClick"),children:e("doc.retryCamera")}):null]}):null,c.length===0?m:null,(0,o.jsx)("video",{ref:y,className:"sekyro-poa-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true"}),c.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status",children:e("poa.upload.pages",{count:c.length})}),(0,o.jsx)("ul",{className:"sekyro-poa-pages",children:c.map((u,g)=>{let I=e("poa.camera.page",{number:g+1});return(0,o.jsxs)("li",{children:[(0,o.jsx)(J,{blob:u,label:I}),(0,o.jsx)(k,{kind:"ghost",onClick:s(()=>X(g),"onClick"),disabled:T,"aria-label":`${e("poa.camera.retake")} ${I}`,children:e("poa.camera.retake")})]},g)})})]}):null,T?(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,o.jsxs)(R,{children:[(0,o.jsxs)(k,{full:!0,kind:c.length>0?"secondary":"primary",onClick:s(()=>{Q()},"onClick"),disabled:E||h||L!=="idle"||a.attemptsExhausted,"aria-busy":L==="taking"||void 0,children:[(0,o.jsx)(F,{name:"camera"}),e("poa.camera.capture")]}),c.length>0?(0,o.jsx)(k,{full:!0,onClick:s(()=>{Z()},"onClick"),disabled:L!=="idle","aria-busy":T||void 0,children:e("poa.upload.send")}):null,p!==void 0?(0,o.jsx)(k,{full:!0,kind:"ghost",onClick:p,disabled:T,children:e("poa.source.upload")}):null]})]})}s(B,"K");i(B,"PageCamera");function $(a,n){try{let e=new Intl.DisplayNames([n],{type:"region",fallback:"code"}).of(a);return e!==void 0&&e!==""?e:a}catch{return a}}s($,"J");i($,"regionName");var te={en:z,fr:ae,ar:ee,es:z,pt:z,de:z},oe="image/jpeg,image/png,image/heic,image/heif,application/pdf";function V(a){let n=a.strings,e=te[a.locale];return(r,d)=>q(n[r]??e[r]??"",d)}s(V,"ae");i(V,"poaCopy");function N({step:a,i18n:n,c:e}){if(a.reason===void 0)return null;let r=e(`poa.retry.${a.reason}`)||e(`reasons.${a.reason}`)||e("poa.retry.unreadable");return(0,t.jsxs)(b,{tone:"warning",children:[(0,t.jsx)("span",{children:r}),(0,t.jsx)("span",{children:G(n,a.attemptsRemaining,a.attemptsExhausted)})]})}s(N,"U");i(N,"RetryNotice");function w({step:a,i18n:n,c:e}){let r=(0,v.useId)(),{country:d}=a.rule,m=d===null?e("poa.accepted"):e("poa.acceptedFor",{country:$(d,n.locale)});return(0,t.jsxs)("div",{className:"sekyro-poa-accepted",children:[(0,t.jsx)("p",{id:r,className:"sekyro-poa-accepted__title",children:m}),(0,t.jsx)("ul",{className:"sekyro-poa-list","aria-labelledby":r,children:a.rule.kinds.map(p=>(0,t.jsx)("li",{children:e("poa.kindDated",{kind:e(`poa.kinds.${p.kind}`)||p.kind,days:p.maxAgeDays})},p.kind))})]})}s(w,"j");i(w,"AcceptedList");var ne={unsupported:"poa.upload.unsupported",tooMany:"poa.upload.tooManyPages",tooLarge:"poa.upload.tooLarge",failed:"poa.upload.failed"};function W(a){return a instanceof TypeError&&a.message==="unsupported_file"?"unsupported":a instanceof RangeError&&a.message==="file_too_large"?"tooLarge":a instanceof RangeError&&(a.message==="too_many_pages"||a.message==="no_pages")?"tooMany":"failed"}s(W,"re");i(W,"refusalOf");function H({step:a,i18n:n,c:e,letter:r,onCamera:d}){let m=(0,v.useRef)(null),[p,y]=(0,v.useState)("idle"),l=p==="sending",c=i(async _=>{let h=Array.from(_.currentTarget.files??[]);if(_.currentTarget.value="",h.length!==0){if(h.length>a.maxPages){y("tooMany");return}y("sending");try{await(r?a.uploadHolderLetter(h):a.uploadPages(h)),y("idle")}catch(P){y(W(P))}}},"onFiles");return(0,t.jsxs)("section",{className:"sekyro-step","data-testid":r?"sekyro-poa-letter":"sekyro-poa-upload",children:[(0,t.jsx)(D,{title:e(r?"poa.letter.title":"poa.title"),lead:e(r?"poa.letter.lead":"poa.lead")}),p==="idle"||l?(0,t.jsx)(N,{step:a,i18n:n,c:e}):null,p!=="idle"&&!l?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:e(ne[p])})}):null,r?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),(0,t.jsx)("p",{className:"sekyro-text-muted",children:e("poa.upload.hint")}),l?(0,t.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,t.jsx)("input",{ref:m,type:"file",accept:oe,multiple:!0,hidden:!0,"data-testid":"sekyro-poa-file","aria-label":e(r?"poa.letter.title":"poa.title"),onChange:s(_=>{c(_)},"onChange")}),(0,t.jsxs)(R,{children:[(0,t.jsx)(k,{full:!0,onClick:s(()=>m.current?.click(),"onClick"),disabled:l||!a.photo.uploadOffered||a.attemptsExhausted,"aria-busy":l||void 0,children:e("poa.upload.choose")}),d!==void 0?(0,t.jsxs)(k,{full:!0,kind:"ghost",onClick:d,disabled:l,children:[(0,t.jsx)(F,{name:a.photo.cameraOnPhone===!0?"smartphone":"camera"}),a.photo.cameraOnPhone===!0?e("capture.source.phone"):e("poa.source.camera")]}):null]})]})}s(H,"se");i(H,"UploadScreen");function Y({step:a,c:n}){let[e,r]=(0,v.useState)("idle"),d=a.useLicenceAddress;if(d===void 0)return null;let m=i(async()=>{r("sending");try{await d(),r("idle")}catch{r("failed")}},"onUse");return(0,t.jsxs)("div",{className:"sekyro-poa-licence","data-testid":"sekyro-poa-licence",children:[(0,t.jsx)("p",{className:"sekyro-text-muted",children:n("poa.licence.note")}),e==="failed"?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:n("poa.upload.failed")})}):null,(0,t.jsx)(k,{full:!0,kind:"secondary",onClick:s(()=>{m()},"onClick"),disabled:e==="sending"||a.attemptsExhausted,"aria-busy":e==="sending"||void 0,children:n("poa.licence.use")})]})}s(Y,"de");i(Y,"LicenceShortcut");function re({step:a,i18n:n}){let e=V(n),[r,d]=(0,v.useState)(null),m=a.phase==="holder_letter",p=a.photo.source,y=p==="choice"?r??a.photo.pick:p,l=a.photo.cameraOnPhone===!0,c=a.photo.uploadOffered?()=>d("upload"):void 0,_=e(m?"poa.letter.title":"poa.title"),h;return y===null?h=(0,t.jsx)(S,{testId:"sekyro-poa-source",title:_,lead:e("poa.source.lead"),cameraLabel:e(l?"capture.source.phone":"poa.source.camera"),uploadLabel:e("poa.source.upload"),onPhone:l,notice:(0,t.jsx)(N,{step:a,i18n:n,c:e}),onCamera:s(()=>d("camera"),"onCamera"),onUpload:s(()=>d("upload"),"onUpload")}):y==="camera"&&l?h=(0,t.jsx)(M,{i18n:n,lead:e("handoff.lead.poa"),refresh:a.refresh,actions:c!==void 0?(0,t.jsx)(k,{kind:"ghost",full:!0,onClick:c,children:e("poa.source.upload")}):null}):y==="camera"?h=(0,t.jsx)(B,{step:a,i18n:n,c:e,title:_,notice:(0,t.jsx)(N,{step:a,i18n:n,c:e}),intro:m?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),...p==="choice"&&c!==void 0?{onUpload:c}:{}}):h=(0,t.jsx)(H,{step:a,i18n:n,c:e,letter:m,...p==="choice"?{onCamera:i(()=>d("camera"),"onCamera")}:{}}),(0,t.jsxs)(t.Fragment,{children:[m?null:(0,t.jsx)(Y,{step:a,c:e}),h]})}s(re,"ze");i(re,"ProofOfAddressView");export{oe as POA_UPLOAD_ACCEPT,re as ProofOfAddressView,V as poaCopy};
1
+ "use client";import{a as S}from"./chunk-HH33TJJH.js";import{a as q}from"./chunk-UGHWANZX.js";import"./chunk-ETJPN5LO.js";import{d as M}from"./chunk-F4IM73DE.js";import"./chunk-FGBKOHVK.js";import{K as b,L as G,a as O,b as j,c as k,v as F,w as D,y as R}from"./chunk-DQAVYXAF.js";import{a as i}from"./chunk-5QL6W6FW.js";import{a as s,c as x}from"./chunk-4FHWXBOB.js";var v=x(O(),1),f=x(O(),1),o=x(j(),1),t=x(j(),1);var ee={"poa.title":"إثبات العنوان","poa.lead":"ارفع وثيقة حديثة تُظهر اسمك وعنوانك الحالي.","poa.accepted":"الوثائق المقبولة","poa.acceptedFor":"مقبول في {country}","poa.kindDated":"{kind}، صادر خلال آخر {days} يومًا","poa.kinds.utility_bill":"فاتورة كهرباء أو ماء أو غاز","poa.kinds.telecom_bill":"فاتورة هاتف أو إنترنت","poa.kinds.bank_statement":"كشف حساب بنكي","poa.kinds.tax_notice":"إشعار ضريبي","poa.kinds.rental_agreement":"عقد إيجار","poa.kinds.government_certificate":"شهادة السكن","poa.kinds.insurance_statement":"وثيقة تأمين","poa.source.camera":"التقاط صورة","poa.source.upload":"رفع ملف","poa.source.lead":"صورة للوثيقة، أو ملف PDF أو صورة من جهازك","poa.upload.hint":"PDF أو JPEG أو PNG، بحد أقصى 3 صفحات و10 ميغابايت","poa.upload.choose":"اختيار ملف","poa.upload.addPage":"إضافة صفحة","poa.upload.pages":"{count} من 3 صفحات","poa.upload.send":"إرسال الوثيقة","poa.upload.sending":"جارٍ إرسال وثيقتك…","poa.upload.unsupported":"نوع الملف هذا غير مقبول. اختر ملف PDF أو JPEG أو PNG","poa.upload.tooManyPages":"أرسل 3 صفحات على الأكثر. احذف صفحة أو اختر ملفًا أقصر","poa.upload.tooLarge":"حجم الملف يتجاوز 10 ميغابايت. اختر ملفًا أصغر","poa.upload.failed":"تعذّر إرسال الوثيقة. تحقّق من اتصالك وحاول مرة أخرى","poa.camera.lead":"ضع الوثيقة بشكل مسطّح واملأ الإطار. التقط صورة واحدة لكل صفحة","poa.camera.capture":"التقاط الصورة","poa.camera.retake":"إعادة الالتقاط","poa.camera.next":"الصفحة التالية","poa.camera.page":"الصفحة {number}","poa.letter.title":"رسالة من صاحب الفاتورة","poa.letter.lead":"الوثيقة باسم شخص آخر. أضف رسالة موقّعة من هذا الشخص تفيد بأنك تسكن في هذا العنوان","poa.letter.send":"إرسال الرسالة","poa.licence.use":"استخدام العنوان المذكور في رخصة القيادة","poa.licence.note":"قرأنا هذا العنوان من رخصتك. لا تحتاج إلى وثيقة أخرى.","poa.retry.document_too_old":"هذه الوثيقة أقدم من المسموح. ارفع وثيقة أحدث من القائمة أدناه","poa.retry.document_date_invalid":"تاريخ الوثيقة في المستقبل. ارفع وثيقة بتاريخ اليوم أو قبله","poa.retry.document_kind_not_accepted":"نوع هذه الوثيقة غير مقبول. ارفع إحدى الوثائق المذكورة أدناه","poa.retry.name_mismatch":"الاسم في الوثيقة لا يطابق اسمك. ارفع وثيقة باسمك","poa.retry.address_mismatch":"العنوان في الوثيقة لا يطابق العنوان الذي وصلنا. ارفع وثيقة لهذا العنوان","poa.retry.holder_letter_missing":"يجب أن تكون الرسالة موقّعة وأن تذكر اسمك واسم صاحب الفاتورة. ارفع رسالة كاملة","poa.retry.unreadable":"تعذّرت قراءة الوثيقة. ارفع نسخة كاملة وأكثر وضوحًا","poa.retry.pdf_protected":"أزل كلمة المرور من ملف PDF وحاول مرة أخرى","poa.retry.provider_unavailable":"تعذّر فحص الوثيقة حاليًا. حاول مرة أخرى بعد قليل","poa.hint.blurry":"الصورة غير واضحة","poa.hint.cropped":"جزء من الوثيقة مقطوع","poa.hint.glare":"يوجد انعكاس ضوء على الوثيقة","reasons.provider_unavailable":"تعذّر فحص الوثيقة حاليًا","reasons.pdf_protected":"ملف PDF محمي بكلمة مرور أو يحتوي على محتوى نشط","reasons.document_kind_not_accepted":"نوع الوثيقة غير مقبول","reasons.document_date_invalid":"تاريخ الوثيقة في المستقبل","reasons.document_too_old":"الوثيقة قديمة جدًا","reasons.document_tampered":"يبدو أن الوثيقة قد عُدّلت","reasons.holder_letter_required":"يلزم تقديم رسالة من صاحب الفاتورة","reasons.holder_letter_missing":"رسالة صاحب الفاتورة مفقودة أو غير مكتملة","reasons.address_mismatch":"العنوان لا يطابق العنوان المقدَّم"},z={"poa.title":"Proof of address","poa.lead":"Upload a recent document that shows your name and your current address.","poa.accepted":"Accepted documents","poa.acceptedFor":"Accepted for {country}","poa.kindDated":"{kind}, dated within the last {days} days","poa.kinds.utility_bill":"Electricity, water or gas bill","poa.kinds.telecom_bill":"Phone or internet bill","poa.kinds.bank_statement":"Bank statement","poa.kinds.tax_notice":"Tax notice","poa.kinds.rental_agreement":"Rental agreement","poa.kinds.government_certificate":"Residence certificate","poa.kinds.insurance_statement":"Insurance statement","poa.source.camera":"Take a photo","poa.source.upload":"Upload a file","poa.source.lead":"A photo of the document, or a PDF or image from your device","poa.upload.hint":"PDF, JPEG or PNG, up to 3 pages and 10 MB","poa.upload.choose":"Choose a file","poa.upload.addPage":"Add a page","poa.upload.pages":"{count} of 3 pages","poa.upload.send":"Send document","poa.upload.sending":"Sending your document…","poa.upload.unsupported":"This file type is not accepted. Choose a PDF, JPEG or PNG","poa.upload.tooManyPages":"Send at most 3 pages. Remove a page or choose a shorter file","poa.upload.tooLarge":"The file is over 10 MB. Choose a smaller file","poa.upload.failed":"We could not send the document. Check your connection and try again","poa.camera.lead":"Lay the document flat and fill the frame. Take one photo per page","poa.camera.capture":"Take photo","poa.camera.retake":"Retake","poa.camera.next":"Next page","poa.camera.page":"Page {number}","poa.letter.title":"Letter from the bill holder","poa.letter.lead":"The document is in another person's name. Add a signed letter from that person saying that you live at this address","poa.letter.send":"Send letter","poa.licence.use":"Use the address on my driver's license","poa.licence.note":"We read this address from your license. You don't need another document.","poa.retry.document_too_old":"This document is older than allowed. Upload a more recent one from the list below","poa.retry.document_date_invalid":"The date on the document is in the future. Upload a document with today's date or earlier","poa.retry.document_kind_not_accepted":"This document type is not accepted. Upload one of the documents listed below","poa.retry.name_mismatch":"The name on the document does not match yours. Upload a document in your name","poa.retry.address_mismatch":"The address on the document does not match the one we were given. Upload a document for that address","poa.retry.holder_letter_missing":"The letter must be signed and name both you and the bill holder. Upload a complete letter","poa.retry.unreadable":"We could not read the document. Upload a sharper, complete copy","poa.retry.pdf_protected":"Remove the password from the PDF and try again","poa.retry.provider_unavailable":"The document could not be checked right now. Try again in a moment","poa.hint.blurry":"The image is blurry","poa.hint.cropped":"Part of the document is cut off","poa.hint.glare":"There is glare on the document","reasons.provider_unavailable":"The document could not be checked right now","reasons.pdf_protected":"The PDF is password-protected or contains active content","reasons.document_kind_not_accepted":"The document type is not accepted","reasons.document_date_invalid":"The document date is in the future","reasons.document_too_old":"The document is too old","reasons.document_tampered":"The document appears to have been edited","reasons.holder_letter_required":"A letter from the bill holder is needed","reasons.holder_letter_missing":"The letter from the bill holder is missing or incomplete","reasons.address_mismatch":"The address does not match the one supplied"},ae={"poa.title":"Justificatif de domicile","poa.lead":"Importez un document récent qui indique votre nom et votre adresse actuelle.","poa.accepted":"Documents acceptés","poa.acceptedFor":"Accepté pour {country}","poa.kindDated":"{kind}, daté des {days} derniers jours","poa.kinds.utility_bill":"Facture d'électricité, d'eau ou de gaz","poa.kinds.telecom_bill":"Facture de téléphone ou d'internet","poa.kinds.bank_statement":"Relevé bancaire","poa.kinds.tax_notice":"Avis d'imposition","poa.kinds.rental_agreement":"Bail ou quittance de loyer","poa.kinds.government_certificate":"Certificat de résidence","poa.kinds.insurance_statement":"Attestation d'assurance","poa.source.camera":"Prendre une photo","poa.source.upload":"Importer un fichier","poa.source.lead":"Une photo du document, ou un PDF ou une image depuis votre appareil","poa.upload.hint":"PDF, JPEG ou PNG, 3 pages et 10 Mo au maximum","poa.upload.choose":"Choisir un fichier","poa.upload.addPage":"Ajouter une page","poa.upload.pages":"{count} sur 3 pages","poa.upload.send":"Envoyer le document","poa.upload.sending":"Envoi de votre document…","poa.upload.unsupported":"Ce type de fichier n'est pas accepté. Choisissez un PDF, un JPEG ou un PNG","poa.upload.tooManyPages":"Envoyez 3 pages au maximum. Retirez une page ou choisissez un fichier plus court","poa.upload.tooLarge":"Le fichier dépasse 10 Mo. Choisissez un fichier plus léger","poa.upload.failed":"Nous n'avons pas pu envoyer le document. Vérifiez votre connexion et réessayez","poa.camera.lead":"Posez le document à plat et remplissez le cadre. Prenez une photo par page","poa.camera.capture":"Prendre la photo","poa.camera.retake":"Reprendre","poa.camera.next":"Page suivante","poa.camera.page":"Page {number}","poa.letter.title":"Lettre du titulaire de la facture","poa.letter.lead":"Le document est au nom d'une autre personne. Ajoutez une lettre signée de cette personne attestant que vous habitez à cette adresse","poa.letter.send":"Envoyer la lettre","poa.licence.use":"Utiliser l'adresse de mon permis de conduire","poa.licence.note":"Nous avons lu cette adresse sur votre permis. Vous n'avez pas besoin d'un autre document.","poa.retry.document_too_old":"Ce document est plus ancien que la limite. Importez un document plus récent parmi ceux de la liste ci-dessous","poa.retry.document_date_invalid":"La date du document est dans le futur. Importez un document daté d'aujourd'hui ou d'avant","poa.retry.document_kind_not_accepted":"Ce type de document n'est pas accepté. Importez l'un des documents de la liste ci-dessous","poa.retry.name_mismatch":"Le nom sur le document ne correspond pas au vôtre. Importez un document à votre nom","poa.retry.address_mismatch":"L'adresse du document ne correspond pas à celle qui nous a été transmise. Importez un document pour cette adresse","poa.retry.holder_letter_missing":"La lettre doit être signée et nommer à la fois vous et le titulaire de la facture. Importez une lettre complète","poa.retry.unreadable":"Nous n'avons pas pu lire le document. Importez une copie plus nette et complète","poa.retry.pdf_protected":"Retirez le mot de passe du PDF et réessayez","poa.retry.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment. Réessayez dans un instant","poa.hint.blurry":"L'image est floue","poa.hint.cropped":"Une partie du document est coupée","poa.hint.glare":"Il y a un reflet sur le document","reasons.provider_unavailable":"Le document n'a pas pu être vérifié pour le moment","reasons.pdf_protected":"Le PDF est protégé par un mot de passe ou contient du contenu actif","reasons.document_kind_not_accepted":"Ce type de document n'est pas accepté","reasons.document_date_invalid":"La date du document est dans le futur","reasons.document_too_old":"Le document est trop ancien","reasons.document_tampered":"Le document semble avoir été modifié","reasons.holder_letter_required":"Une lettre du titulaire de la facture est nécessaire","reasons.holder_letter_missing":"La lettre du titulaire de la facture est absente ou incomplète","reasons.address_mismatch":"L'adresse ne correspond pas à celle qui a été transmise"};function J({blob:a,label:n}){let[e,r]=(0,f.useState)(void 0);return(0,f.useEffect)(()=>{if(typeof URL.createObjectURL!="function")return;let d=URL.createObjectURL(a);return r(d),()=>URL.revokeObjectURL(d)},[a]),(0,o.jsx)("img",{src:e,alt:n})}s(J,"Q");i(J,"PageThumb");function B({step:a,i18n:n,c:e,title:r,notice:d,intro:m,onUpload:p}){let y=(0,f.useRef)(null),l=(0,f.useRef)(null),[c,_]=(0,f.useState)([]),[h,P]=(0,f.useState)(!1),[L,C]=(0,f.useState)("idle"),[K,U]=(0,f.useState)(!1),A=i(u=>{P(!1),u.start().catch(()=>P(!0))},"open");(0,f.useEffect)(()=>{let u=y.current;if(u===null)return;let g;try{g=a.capturePage({video:u})}catch{P(!0);return}return l.current=g,A(g),()=>{g.destroy(),l.current=null}},[]);let E=c.length>=a.maxPages,Q=i(async()=>{let u=l.current;if(!(u===null||E)){C("taking"),U(!1);try{await u.takePage()}catch{}_([...u.pages]),C("idle")}},"take"),X=i(u=>{let g=l.current;g!==null&&(g.removePage(u),_([...g.pages]))},"retake"),Z=i(async()=>{let u=l.current;if(!(u===null||c.length===0)){C("sending"),U(!1);try{await u.submitPages()}catch{U(!0)}C("idle")}},"send"),T=L==="sending";return(0,o.jsxs)("section",{className:"sekyro-step","data-testid":"sekyro-poa-camera",children:[(0,o.jsx)(D,{title:r,lead:e("poa.camera.lead")}),d,K?(0,o.jsx)(b,{tone:"danger",children:(0,o.jsx)("span",{children:e("poa.upload.failed")})}):null,h?(0,o.jsxs)(b,{tone:"danger",children:[(0,o.jsx)("span",{children:e("doc.cameraBlocked")}),(0,o.jsx)("span",{children:e("doc.cameraBlockedHint")}),l.current!==null?(0,o.jsx)(k,{kind:"secondary",onClick:s(()=>l.current!==null&&A(l.current),"onClick"),children:e("doc.retryCamera")}):null]}):null,c.length===0?m:null,(0,o.jsx)("video",{ref:y,className:"sekyro-poa-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true"}),c.length>0?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status",children:e("poa.upload.pages",{count:c.length})}),(0,o.jsx)("ul",{className:"sekyro-poa-pages",children:c.map((u,g)=>{let I=e("poa.camera.page",{number:g+1});return(0,o.jsxs)("li",{children:[(0,o.jsx)(J,{blob:u,label:I}),(0,o.jsx)(k,{kind:"ghost",onClick:s(()=>X(g),"onClick"),disabled:T,"aria-label":`${e("poa.camera.retake")} ${I}`,children:e("poa.camera.retake")})]},g)})})]}):null,T?(0,o.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,o.jsxs)(R,{children:[(0,o.jsxs)(k,{full:!0,kind:c.length>0?"secondary":"primary",onClick:s(()=>{Q()},"onClick"),disabled:E||h||L!=="idle"||a.attemptsExhausted,"aria-busy":L==="taking"||void 0,children:[(0,o.jsx)(F,{name:"camera"}),e("poa.camera.capture")]}),c.length>0?(0,o.jsx)(k,{full:!0,onClick:s(()=>{Z()},"onClick"),disabled:L!=="idle","aria-busy":T||void 0,children:e("poa.upload.send")}):null,p!==void 0?(0,o.jsx)(k,{full:!0,kind:"ghost",onClick:p,disabled:T,children:e("poa.source.upload")}):null]})]})}s(B,"K");i(B,"PageCamera");function $(a,n){try{let e=new Intl.DisplayNames([n],{type:"region",fallback:"code"}).of(a);return e!==void 0&&e!==""?e:a}catch{return a}}s($,"J");i($,"regionName");var te={en:z,fr:ae,ar:ee,es:z,pt:z,de:z},oe="image/jpeg,image/png,image/heic,image/heif,application/pdf";function V(a){let n=a.strings,e=te[a.locale];return(r,d)=>q(n[r]??e[r]??"",d)}s(V,"ae");i(V,"poaCopy");function N({step:a,i18n:n,c:e}){if(a.reason===void 0)return null;let r=e(`poa.retry.${a.reason}`)||e(`reasons.${a.reason}`)||e("poa.retry.unreadable");return(0,t.jsxs)(b,{tone:"warning",children:[(0,t.jsx)("span",{children:r}),(0,t.jsx)("span",{children:G(n,a.attemptsRemaining,a.attemptsExhausted)})]})}s(N,"U");i(N,"RetryNotice");function w({step:a,i18n:n,c:e}){let r=(0,v.useId)(),{country:d}=a.rule,m=d===null?e("poa.accepted"):e("poa.acceptedFor",{country:$(d,n.locale)});return(0,t.jsxs)("div",{className:"sekyro-poa-accepted",children:[(0,t.jsx)("p",{id:r,className:"sekyro-poa-accepted__title",children:m}),(0,t.jsx)("ul",{className:"sekyro-poa-list","aria-labelledby":r,children:a.rule.kinds.map(p=>(0,t.jsx)("li",{children:e("poa.kindDated",{kind:e(`poa.kinds.${p.kind}`)||p.kind,days:p.maxAgeDays})},p.kind))})]})}s(w,"j");i(w,"AcceptedList");var ne={unsupported:"poa.upload.unsupported",tooMany:"poa.upload.tooManyPages",tooLarge:"poa.upload.tooLarge",failed:"poa.upload.failed"};function W(a){return a instanceof TypeError&&a.message==="unsupported_file"?"unsupported":a instanceof RangeError&&a.message==="file_too_large"?"tooLarge":a instanceof RangeError&&(a.message==="too_many_pages"||a.message==="no_pages")?"tooMany":"failed"}s(W,"re");i(W,"refusalOf");function H({step:a,i18n:n,c:e,letter:r,onCamera:d}){let m=(0,v.useRef)(null),[p,y]=(0,v.useState)("idle"),l=p==="sending",c=i(async _=>{let h=Array.from(_.currentTarget.files??[]);if(_.currentTarget.value="",h.length!==0){if(h.length>a.maxPages){y("tooMany");return}y("sending");try{await(r?a.uploadHolderLetter(h):a.uploadPages(h)),y("idle")}catch(P){y(W(P))}}},"onFiles");return(0,t.jsxs)("section",{className:"sekyro-step","data-testid":r?"sekyro-poa-letter":"sekyro-poa-upload",children:[(0,t.jsx)(D,{title:e(r?"poa.letter.title":"poa.title"),lead:e(r?"poa.letter.lead":"poa.lead")}),p==="idle"||l?(0,t.jsx)(N,{step:a,i18n:n,c:e}):null,p!=="idle"&&!l?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:e(ne[p])})}):null,r?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),(0,t.jsx)("p",{className:"sekyro-text-muted",children:e("poa.upload.hint")}),l?(0,t.jsx)("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:e("poa.upload.sending")}):null,(0,t.jsx)("input",{ref:m,type:"file",accept:oe,multiple:!0,hidden:!0,"data-testid":"sekyro-poa-file","aria-label":e(r?"poa.letter.title":"poa.title"),onChange:s(_=>{c(_)},"onChange")}),(0,t.jsxs)(R,{children:[(0,t.jsx)(k,{full:!0,onClick:s(()=>m.current?.click(),"onClick"),disabled:l||!a.photo.uploadOffered||a.attemptsExhausted,"aria-busy":l||void 0,children:e("poa.upload.choose")}),d!==void 0?(0,t.jsxs)(k,{full:!0,kind:"ghost",onClick:d,disabled:l,children:[(0,t.jsx)(F,{name:a.photo.cameraOnPhone===!0?"smartphone":"camera"}),a.photo.cameraOnPhone===!0?e("capture.source.phone"):e("poa.source.camera")]}):null]})]})}s(H,"se");i(H,"UploadScreen");function Y({step:a,c:n}){let[e,r]=(0,v.useState)("idle"),d=a.useLicenceAddress;if(d===void 0)return null;let m=i(async()=>{r("sending");try{await d(),r("idle")}catch{r("failed")}},"onUse");return(0,t.jsxs)("div",{className:"sekyro-poa-licence","data-testid":"sekyro-poa-licence",children:[(0,t.jsx)("p",{className:"sekyro-text-muted",children:n("poa.licence.note")}),e==="failed"?(0,t.jsx)(b,{tone:"danger",children:(0,t.jsx)("span",{children:n("poa.upload.failed")})}):null,(0,t.jsx)(k,{full:!0,kind:"secondary",onClick:s(()=>{m()},"onClick"),disabled:e==="sending"||a.attemptsExhausted,"aria-busy":e==="sending"||void 0,children:n("poa.licence.use")})]})}s(Y,"de");i(Y,"LicenceShortcut");function re({step:a,i18n:n}){let e=V(n),[r,d]=(0,v.useState)(null),m=a.phase==="holder_letter",p=a.photo.source,y=p==="choice"?r??a.photo.pick:p,l=a.photo.cameraOnPhone===!0,c=a.photo.uploadOffered?()=>d("upload"):void 0,_=e(m?"poa.letter.title":"poa.title"),h;return y===null?h=(0,t.jsx)(S,{testId:"sekyro-poa-source",title:_,lead:e("poa.source.lead"),cameraLabel:e(l?"capture.source.phone":"poa.source.camera"),uploadLabel:e("poa.source.upload"),onPhone:l,notice:(0,t.jsx)(N,{step:a,i18n:n,c:e}),onCamera:s(()=>d("camera"),"onCamera"),onUpload:s(()=>d("upload"),"onUpload")}):y==="camera"&&l?h=(0,t.jsx)(M,{i18n:n,lead:e("handoff.lead.poa"),refresh:a.refresh,actions:c!==void 0?(0,t.jsx)(k,{kind:"ghost",full:!0,onClick:c,children:e("poa.source.upload")}):null}):y==="camera"?h=(0,t.jsx)(B,{step:a,i18n:n,c:e,title:_,notice:(0,t.jsx)(N,{step:a,i18n:n,c:e}),intro:m?null:(0,t.jsx)(w,{step:a,i18n:n,c:e}),...p==="choice"&&c!==void 0?{onUpload:c}:{}}):h=(0,t.jsx)(H,{step:a,i18n:n,c:e,letter:m,...p==="choice"?{onCamera:i(()=>d("camera"),"onCamera")}:{}}),(0,t.jsxs)(t.Fragment,{children:[m?null:(0,t.jsx)(Y,{step:a,c:e}),h]})}s(re,"ze");i(re,"ProofOfAddressView");export{oe as POA_UPLOAD_ACCEPT,re as ProofOfAddressView,V as poaCopy};
@@ -1 +1 @@
1
- import{g as e}from"./chunks/chunk-FYPP4Q7V.js";import"./chunks/chunk-COQQVNNG.js";import"./chunks/chunk-UGP2ZH7W.js";import"./chunks/chunk-AKUFZTNC.js";import"./chunks/chunk-AN2KDTP4.js";import"./chunks/chunk-AOM2HJGY.js";import"./chunks/chunk-HMNCXTZQ.js";import"./chunks/chunk-5K4YQOZN.js";import"./chunks/chunk-YRTHQZAW.js";import"./chunks/chunk-QOZB3DLY.js";import"./chunks/chunk-X4MIUKLT.js";import"./chunks/chunk-LA2MA2UQ.js";import"./chunks/chunk-SIPFHN7E.js";import"./chunks/chunk-KLODCY6G.js";import"./chunks/chunk-H5GXVL63.js";import"./chunks/chunk-GIGTK355.js";import"./chunks/chunk-P7K7ELYZ.js";import"./chunks/chunk-5QL6W6FW.js";import"./chunks/chunk-CW56KMMH.js";import"./chunks/chunk-JS2IXPNL.js";import"./chunks/chunk-4FHWXBOB.js";e();export{e as defineSekyroElements};
1
+ import{g as e}from"./chunks/chunk-OPRYWIQM.js";import"./chunks/chunk-DBGVBAMW.js";import"./chunks/chunk-3ELDB5WG.js";import"./chunks/chunk-OGRBLEPE.js";import"./chunks/chunk-M4UCDUJB.js";import"./chunks/chunk-D2JAXHZF.js";import"./chunks/chunk-AXYGICTN.js";import"./chunks/chunk-33KMCERZ.js";import"./chunks/chunk-UGHWANZX.js";import"./chunks/chunk-ETJPN5LO.js";import"./chunks/chunk-F4IM73DE.js";import"./chunks/chunk-FGBKOHVK.js";import"./chunks/chunk-DQAVYXAF.js";import"./chunks/chunk-NYF6B3ZA.js";import"./chunks/chunk-4FTXJ6MZ.js";import"./chunks/chunk-W4RXHXFP.js";import"./chunks/chunk-P7K7ELYZ.js";import"./chunks/chunk-5QL6W6FW.js";import"./chunks/chunk-CW56KMMH.js";import"./chunks/chunk-JS2IXPNL.js";import"./chunks/chunk-4FHWXBOB.js";e();export{e as defineSekyroElements};
package/dist/cdn/index.js CHANGED
@@ -1 +1 @@
1
- import{a as e,b as r,c as t,d as o,e as i,f as a,g as f}from"./chunks/chunk-FYPP4Q7V.js";import"./chunks/chunk-COQQVNNG.js";import"./chunks/chunk-UGP2ZH7W.js";import"./chunks/chunk-AKUFZTNC.js";import"./chunks/chunk-AN2KDTP4.js";import"./chunks/chunk-AOM2HJGY.js";import{a as n}from"./chunks/chunk-HMNCXTZQ.js";import"./chunks/chunk-5K4YQOZN.js";import"./chunks/chunk-YRTHQZAW.js";import"./chunks/chunk-QOZB3DLY.js";import"./chunks/chunk-X4MIUKLT.js";import"./chunks/chunk-LA2MA2UQ.js";import"./chunks/chunk-SIPFHN7E.js";import"./chunks/chunk-KLODCY6G.js";import"./chunks/chunk-H5GXVL63.js";import"./chunks/chunk-GIGTK355.js";import"./chunks/chunk-P7K7ELYZ.js";import"./chunks/chunk-5QL6W6FW.js";import"./chunks/chunk-CW56KMMH.js";import"./chunks/chunk-JS2IXPNL.js";import"./chunks/chunk-4FHWXBOB.js";export{r as ATTRIBUTES,i as EVENTS,t as PROPERTIES,o as SLOTS,a as SekyroVerificationElement,e as TAG_NAME,n as createVerification,f as defineSekyroElements};
1
+ import{a as e,b as r,c as t,d as o,e as i,f as a,g as f}from"./chunks/chunk-OPRYWIQM.js";import"./chunks/chunk-DBGVBAMW.js";import"./chunks/chunk-3ELDB5WG.js";import"./chunks/chunk-OGRBLEPE.js";import"./chunks/chunk-M4UCDUJB.js";import"./chunks/chunk-D2JAXHZF.js";import{a as n}from"./chunks/chunk-AXYGICTN.js";import"./chunks/chunk-33KMCERZ.js";import"./chunks/chunk-UGHWANZX.js";import"./chunks/chunk-ETJPN5LO.js";import"./chunks/chunk-F4IM73DE.js";import"./chunks/chunk-FGBKOHVK.js";import"./chunks/chunk-DQAVYXAF.js";import"./chunks/chunk-NYF6B3ZA.js";import"./chunks/chunk-4FTXJ6MZ.js";import"./chunks/chunk-W4RXHXFP.js";import"./chunks/chunk-P7K7ELYZ.js";import"./chunks/chunk-5QL6W6FW.js";import"./chunks/chunk-CW56KMMH.js";import"./chunks/chunk-JS2IXPNL.js";import"./chunks/chunk-4FHWXBOB.js";export{r as ATTRIBUTES,i as EVENTS,t as PROPERTIES,o as SLOTS,a as SekyroVerificationElement,e as TAG_NAME,n as createVerification,f as defineSekyroElements};
@@ -1 +1 @@
1
- import{a as v,b}from"./chunk-APM7FCA2.js";import{a,c as p,i as d}from"./chunk-SSU37LFQ.js";var r=p(v(),1),o=p(b(),1),m=p(v(),1);import{normalizeNni as C}from"@sekyro/web";function w(t,e,i){let[n,c]=(0,r.useState)(!1),s=(0,r.useRef)(i);return s.current=i,(0,r.useEffect)(()=>{t&&(c(!0),s.current())},[t,e]),[n,()=>c(!1)]}a(w,"I");d(w,"useWrongCode");function x({id:t,value:e,onChange:i,length:n=6,describedBy:c,invalid:s}){let[y,f]=(0,r.useState)(!1),[h,k]=(0,r.useState)(0);(0,r.useEffect)(()=>{s&&k(l=>l+1)},[s]);let g=(0,r.useRef)(null);(0,r.useEffect)(()=>{let l=setTimeout(()=>g.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(l)},[]);let N=e.length<n?e.length:-1;return(0,o.jsxs)("div",{className:"sekyro-otp-boxes",dir:"ltr",children:[(0,o.jsx)("div",{className:`sekyro-otp-row${h>0?" is-shaking":""}`,"aria-hidden":"true",children:Array.from({length:n},(l,u)=>(0,o.jsx)("span",{className:`sekyro-otp-box${u<e.length?" is-filled":""}${y&&u===N?" is-current":""}${s?" is-invalid":""}`,children:e[u]!==void 0?(0,o.jsx)("span",{className:"sekyro-otp-digit",children:e[u]},e[u]):null},u))},h),(0,o.jsx)("input",{ref:g,id:t,className:"sekyro-input sekyro-input--code",dir:"ltr",inputMode:"numeric",autoComplete:"one-time-code",value:e,"aria-describedby":c,"aria-invalid":s||void 0,onFocus:a(()=>f(!0),"onFocus"),onBlur:a(()=>f(!1),"onBlur"),onChange:a(l=>i(C(l.target.value).replace(/\D/g,"").slice(0,n)),"onChange")})]})}a(x,"S");d(x,"CodeInput");function I(t){let[e,i]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!t)return;let n=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(n)},[t]),e}a(I,"B");d(I,"useNow");export{w as a,x as b,I as c};
1
+ import{a as v,b}from"./chunk-YQ7XHAQJ.js";import{a,c as p,i as d}from"./chunk-SSU37LFQ.js";var r=p(v(),1),o=p(b(),1),m=p(v(),1);import{normalizeNni as C}from"@sekyro/web";function w(t,e,i){let[n,c]=(0,r.useState)(!1),s=(0,r.useRef)(i);return s.current=i,(0,r.useEffect)(()=>{t&&(c(!0),s.current())},[t,e]),[n,()=>c(!1)]}a(w,"I");d(w,"useWrongCode");function x({id:t,value:e,onChange:i,length:n=6,describedBy:c,invalid:s}){let[y,f]=(0,r.useState)(!1),[h,k]=(0,r.useState)(0);(0,r.useEffect)(()=>{s&&k(l=>l+1)},[s]);let g=(0,r.useRef)(null);(0,r.useEffect)(()=>{let l=setTimeout(()=>g.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(l)},[]);let N=e.length<n?e.length:-1;return(0,o.jsxs)("div",{className:"sekyro-otp-boxes",dir:"ltr",children:[(0,o.jsx)("div",{className:`sekyro-otp-row${h>0?" is-shaking":""}`,"aria-hidden":"true",children:Array.from({length:n},(l,u)=>(0,o.jsx)("span",{className:`sekyro-otp-box${u<e.length?" is-filled":""}${y&&u===N?" is-current":""}${s?" is-invalid":""}`,children:e[u]!==void 0?(0,o.jsx)("span",{className:"sekyro-otp-digit",children:e[u]},e[u]):null},u))},h),(0,o.jsx)("input",{ref:g,id:t,className:"sekyro-input sekyro-input--code",dir:"ltr",inputMode:"numeric",autoComplete:"one-time-code",value:e,"aria-describedby":c,"aria-invalid":s||void 0,onFocus:a(()=>f(!0),"onFocus"),onBlur:a(()=>f(!1),"onBlur"),onChange:a(l=>i(C(l.target.value).replace(/\D/g,"").slice(0,n)),"onChange")})]})}a(x,"S");d(x,"CodeInput");function I(t){let[e,i]=(0,m.useState)(()=>Date.now());return(0,m.useEffect)(()=>{if(!t)return;let n=setInterval(()=>i(Date.now()),1e3);return()=>clearInterval(n)},[t]),e}a(I,"B");d(I,"useNow");export{w as a,x as b,I as c};
@@ -1 +1 @@
1
- import{b,t as r,v as l,y as o}from"./chunk-APM7FCA2.js";import{a,c as p,i}from"./chunk-SSU37LFQ.js";var s=p(b(),1);function f({tone:d,icon:n,busy:c,title:m,titleId:e,children:u,actions:t,live:y,testId:h}){let k=r();return(0,s.jsxs)("section",{className:"sekyro-step sekyro-status",...e!==void 0?{"aria-labelledby":e}:{},...y?{role:"status","aria-live":"polite"}:{},"data-testid":h,children:[(0,s.jsxs)("div",{className:"sekyro-status__body",children:[(0,s.jsx)("span",{className:`sekyro-tile sekyro-tile--${d}${c?" is-busy":""}`,"aria-hidden":"true",children:(0,s.jsx)(l,{name:n})}),(0,s.jsxs)("div",{className:"sekyro-heading sekyro-status__text",children:[(0,s.jsx)("h2",{id:e,ref:k,tabIndex:-1,className:"sekyro-text-body",children:m}),u]})]}),t!=null&&t!==!1?(0,s.jsx)(o,{children:t}):null]})}a(f,"g");i(f,"StatusPage");export{f as a};
1
+ import{b,t as r,v as l,y as o}from"./chunk-YQ7XHAQJ.js";import{a,c as p,i}from"./chunk-SSU37LFQ.js";var s=p(b(),1);function f({tone:d,icon:n,busy:c,title:m,titleId:e,children:u,actions:t,live:y,testId:h}){let k=r();return(0,s.jsxs)("section",{className:"sekyro-step sekyro-status",...e!==void 0?{"aria-labelledby":e}:{},...y?{role:"status","aria-live":"polite"}:{},"data-testid":h,children:[(0,s.jsxs)("div",{className:"sekyro-status__body",children:[(0,s.jsx)("span",{className:`sekyro-tile sekyro-tile--${d}${c?" is-busy":""}`,"aria-hidden":"true",children:(0,s.jsx)(l,{name:n})}),(0,s.jsxs)("div",{className:"sekyro-heading sekyro-status__text",children:[(0,s.jsx)("h2",{id:e,ref:k,tabIndex:-1,className:"sekyro-text-body",children:m}),u]})]}),t!=null&&t!==!1?(0,s.jsx)(o,{children:t}):null]})}a(f,"g");i(f,"StatusPage");export{f as a};
@@ -1 +1 @@
1
- import{a as d}from"./chunk-APM7FCA2.js";import{a as i,c as r,i as t}from"./chunk-SSU37LFQ.js";var s=r(d(),1);var u=(0,s.createContext)(null);function c(a,n,o){let e=n.detail;return{check:a,kind:n.kind,...e?.name!==void 0?{name:e.name}:{},...e?.phase!==void 0?{phase:e.phase}:{},...e?.engineKind!==void 0?{engineKind:e.engineKind}:{},attempt:Math.max(0,Math.min(1e3,o))}}i(c,"a");t(c,"captureIssueOf");function m(a,n){if(a!==void 0)try{a(n)}catch{}}i(m,"o");t(m,"sendCaptureIssue");export{u as a,c as b,m as c};
1
+ import{a as d}from"./chunk-YQ7XHAQJ.js";import{a as i,c as r,i as t}from"./chunk-SSU37LFQ.js";var s=r(d(),1);var u=(0,s.createContext)(null);function c(a,n,o){let e=n.detail;return{check:a,kind:n.kind,...e?.name!==void 0?{name:e.name}:{},...e?.phase!==void 0?{phase:e.phase}:{},...e?.engineKind!==void 0?{engineKind:e.engineKind}:{},attempt:Math.max(0,Math.min(1e3,o))}}i(c,"a");t(c,"captureIssueOf");function m(a,n){if(a!==void 0)try{a(n)}catch{}}i(m,"o");t(m,"sendCaptureIssue");export{u as a,c as b,m as c};
@@ -1 +1 @@
1
- import{b as pr,d as hr}from"./chunk-JCCTKW23.js";import{b as gr,c as kt}from"./chunk-JUB6FRPB.js";import{a as kr}from"./chunk-YZ6YGLNN.js";import{c as bt}from"./chunk-WBXQX6DQ.js";import{a as cr,b as ur,c as dr,d as Re}from"./chunk-CFERAKA2.js";import{F as mr,K as yr,L as vr,a as F,b as de,c as X,m as ar,n as Je,p as ir,q as Xe,r as or,s as lr,t as gt,u as se,v as Ae,w as et,y as fr}from"./chunk-APM7FCA2.js";import{a as i,c as E,i as s}from"./chunk-SSU37LFQ.js";var _r=E(F(),1),v=E(de(),1),ee=E(de(),1),ye=E(F(),1),q=E(de(),1),_=E(F(),1),y=E(F(),1),st=E(F(),1),fe=E(de(),1),Hr=E(F(),1),Y=E(F(),1),it=E(F(),1),we=E(de(),1),Se=E(de(),1),U=E(de(),1),ot=E(F(),1),pe=E(F(),1),Q=E(F(),1),M=E(F(),1),me=E(F(),1),Te=E(F(),1),Nt=E(de(),1),k=E(de(),1);import{subscribeCameraPermission as Un}from"@sekyro/web";import{getLivenessAssetsStatus as jn,preloadLivenessAssets as Tn,subscribeLivenessAssets as Pn}from"@sekyro/web";import{createLivenessCapture as qn}from"@sekyro/web";function ie({className:e,children:t}){return(0,v.jsx)("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}i(ie,"te");s(ie,"Svg");var Mt="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 Cr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,v.jsx)("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}i(Cr,"cn");s(Cr,"SunIcon");function wr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,v.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}i(wr,"ln");s(wr,"FaceUncoveredIcon");function Sr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,v.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,v.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}i(Sr,"un");s(Sr,"PhoneEyeLevelIcon");function xr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,v.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}i(xr,"dn");s(xr,"LookStraightIcon");function Nr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:Mt}),(0,v.jsx)("path",{d:"M9 13l2 2 4-4"})]})}i(Nr,"pn");s(Nr,"CameraCheckIcon");function Mr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:Mt}),(0,v.jsx)("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}i(Mr,"fn");s(Mr,"CameraAskIcon");function Lr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:Mt}),(0,v.jsx)("path",{d:"M3 3l18 18"})]})}i(Lr,"mn");s(Lr,"CameraBlockedIcon");function rt({off:e,className:t}){return(0,v.jsxs)(ie,{className:t,children:[(0,v.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,v.jsx)("path",{d:"M4 4l16 16"}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,v.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}i(rt,"Ve");s(rt,"SpeakerIcon");function Rr(e){return(0,v.jsx)(ie,{...e,children:(0,v.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}i(Rr,"yn");s(Rr,"CheckIcon");function Ar(e){return(0,v.jsxs)(ie,{className:e.className??"sekyro-spinner",children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,v.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}i(Ar,"gn");s(Ar,"SpinnerIcon");var _t=["light","uncover","eyeLevel","straight"],Sn={light:{key:"capture.tips.light",icon:s(()=>(0,ee.jsx)(Cr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:s(()=>(0,ee.jsx)(wr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:s(()=>(0,ee.jsx)(Sr,{}),"icon")},straight:{key:"capture.tips.straight",icon:s(()=>(0,ee.jsx)(xr,{}),"icon")}};function Er({tips:e}){let t=Re(),n=(0,_r.useId)();return e.length===0?null:(0,ee.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,ee.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,ee.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let a=typeof r=="string"?Sn[r]:void 0,o=typeof r=="string"?r:r.id,l=a!==void 0?a.icon():typeof r=="string"?void 0:r.icon,u=a!==void 0?t(a.key):typeof r=="string"?r:r.text;return(0,ee.jsxs)("li",{className:"sekyro-tips__item",children:[l!=null?(0,ee.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:l}):null,(0,ee.jsx)("span",{children:u})]},o)})})]})}i(Er,"vn");s(Er,"TipList");var xn=220;function Ir({title:e,description:t,options:n,busy:r,error:a,focus:o,testId:l,look:u="cards",marked:S,onChoose:h}){let w=(0,ye.useId)(),x=gt(),[I,d]=(0,ye.useState)(null),N=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{a!==null&&d(null)},[a]),(0,ye.useEffect)(()=>()=>{N.current!==null&&clearTimeout(N.current)},[]);let L=s(p=>{r||I!==null||(d(p),N.current=setTimeout(()=>{N.current=null,d(null),h(p)},xn))},"choose");return(0,q.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":l,children:[(0,q.jsxs)("div",{className:u==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,q.jsx)("h2",{id:w,ref:o?x:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,q.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),a!==null?(0,q.jsx)(se,{tone:"danger",children:(0,q.jsx)("span",{children:a})}):null,u==="buttons"?(0,q.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((p,j)=>(0,q.jsx)(X,{kind:j===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:i(()=>h(p.id),"onClick"),children:p.label},p.id))}):(0,q.jsx)("div",{className:"sekyro-choices",children:n.map(p=>(0,q.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(I??S)===p.id,"aria-busy":r||void 0,disabled:r||I!==null&&I!==p.id,onClick:i(()=>L(p.id),"onClick"),children:[p.glyph!==void 0?(0,q.jsx)("span",{className:"sekyro-card__tile",children:p.glyph}):null,(0,q.jsxs)("span",{className:"sekyro-card__body",children:[(0,q.jsx)("span",{className:"sekyro-card__title",children:p.label}),p.sub!==void 0?(0,q.jsx)("span",{className:"sekyro-card__sub",children:p.sub}):null]}),(0,q.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},p.id))})]})}i(Ir,"kn");s(Ir,"ChoiceScreen");var Ur=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary"];function nt(e){return e!==null&&Ur.includes(e)}i(nt,"he");s(nt,"isVoiceKey");var Nn=s((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let a=e[n];r=a!=null&&Nn(a,t)?a[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}i(je,"Me");s(je,"resolveClip");var Mn="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Ln={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ae(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}i(ae,"ne");s(ae,"synth");function jr(){return ae()!==null&&typeof SpeechSynthesisUtterance=="function"}i(jr,"wr");s(jr,"speechAvailable");function Ct(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}i(Ct,"bn");s(Ct,"baseLang");function Lt(e,t){let n=s(a=>a.replace(/_/g,"-").toLowerCase(),"norm"),r=Ct(t);return e.find(a=>n(a.lang)===n(t))??e.find(a=>Ct(a.lang)===r)}i(Lt,"Vn");s(Lt,"pickVoice");function Tr(e){if(!jr())return!1;let t=[];try{t=ae()?.getVoices()??[]}catch{return!0}return t.length===0||Lt(t,e)!==void 0}i(Tr,"Mn");s(Tr,"speechUsable");function Pr(e){let t=ae();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}i(Pr,"wn");s(Pr,"subscribeVoices");function $e(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}i($e,"Ke");s($e,"clipIdentity");function wt(e){e.pause(),e.removeAttribute("src"),e.load()}i(wt,"Sn");s(wt,"release");function Br(){let e=null,t=null,n=0,r=null,a=[],o=new Map,l=s(()=>{a=ae()?.getVoices()??[]},"loadVoices"),u=!1,S=s(()=>{let d=ae();u||d===null||(u=!0,l(),d.addEventListener?.("voiceschanged",l))},"bindVoices"),h=s(()=>(e??(e=new Audio),e),"element"),w=s((d,N,L)=>{let p=ae();if(p!==null&&d!==""&&typeof SpeechSynthesisUtterance=="function"){S();let j=Lt(a,N);if(a.length===0||j!==void 0){p.cancel();let C=new SpeechSynthesisUtterance(d);C.lang=N,j!==void 0&&(C.voice=j),C.rate=.95,L!==void 0&&(C.onend=C.onerror=L),p.speak(C);return}}L?.()},"speak"),x=s(()=>{n+=1,r=null,e!==null&&(e.pause(),e.currentTime=0),ae()?.cancel()},"stop"),I=s(d=>{for(let N of d){let L=$e(N);if(o.has(L))continue;let p=new Audio;p.preload="auto",p.src=N,o.set(L,p)}},"warmClips");return{say(d){let N=d.url!==null?$e(d.url):`tts:${d.lang}:${d.text}`;if(N===r)return;r=N,n+=1;let L=n,p=d.onEnd,j=p!==void 0?()=>{L===n&&p()}:void 0;if(ae()?.cancel(),d.url!==null){let C=h();C.pause(),C.muted=!1,C.src=d.url,C.currentTime=0,C.onended=j??null,C.play()?.catch(A=>{L===n&&A?.name!=="AbortError"&&(d.speech?w(d.text,d.lang,j):j?.())});return}d.speech?w(d.text,d.lang,j):j?.()},unlock({lang:d,speech:N,prefetch:L}){let p=h();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let A=Uint8Array.from(atob(Mn),O=>O.charCodeAt(0));t=URL.createObjectURL(new Blob([A],{type:"audio/wav"}))}let j=p.paused===!1&&t!==null&&p.src!==t;t!==null&&!j&&(p.muted=!0,p.onended=null,p.src=t,p.play()?.catch(()=>{}));let C=ae();if(N&&C!==null&&typeof SpeechSynthesisUtterance=="function"){S();let A=new SpeechSynthesisUtterance(" ");A.volume=0,A.lang=d,C.speak(A)}I(L??[])},prefetch:I,stop:x,dispose(){x(),u&&ae()?.removeEventListener?.("voiceschanged",l),u=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&wt(e),e=null;for(let d of o.values())wt(d);o.clear()}}}i(Br,"Ln");s(Br,"createVoicePlayer");var Rn="sekyro.voiceGuidance";function qr(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}}i(qr,"xn");s(qr,"readVoicePreference");function Or(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}i(Or,"In");s(Or,"writeVoicePreference");var Ve="capture.tips.summary",An=typeof window<"u"?_.useLayoutEffect:_.useEffect,En=Object.freeze({});function tt(e,t){let n=new Set,r=[];for(let a of Ur){let o=a===Ve?null:je(e,a,t);o===null||n.has($e(o))||(n.add($e(o)),r.push(o))}return r}i(tt,"gt");s(tt,"resolvedClipUrls");function Vr({locale:e,defaultClips:t,options:n}){let r=n===!1,a=r?{}:n??{},o=a.storageKey===void 0?Rn:a.storageKey,[l,u]=(0,_.useState)(a.defaultEnabled??!0),S=(0,_.useRef)(l),[h,w]=(0,_.useState)(!1),[x,I]=(0,_.useState)("none"),[d,N]=(0,_.useState)(!1),L=(0,_.useRef)(!1),[p,j]=(0,_.useState)(0),C=(0,_.useRef)(null),A=(0,_.useCallback)(()=>(C.current??(C.current=Br()),C.current),[]),O=Ln[e],H=a.speechFallback,f=H===void 0||H===!0?!0:H===!1?!1:H.includes(e),D=a.clips??t??En,oe=(0,_.useRef)(!1),le=(0,_.useRef)(D);An(()=>{le.current=D,S.current=l}),(0,_.useEffect)(()=>{if(r||o===null)return;let R=qr(o);R!==null&&(S.current=R,u(R))},[r,o]),(0,_.useEffect)(()=>{if(!(r||!f))return Pr(()=>j(R=>R+1))},[r,f]);let c=a.clips;(0,_.useEffect)(()=>{if(r)return;let R=f&&Tr(O);w(tt(D,e).length>0||R),I(c!==void 0&&je(c,Ve,e)!==null?"partner":je(D,Ve,e)!==null||R?"default":"none")},[r,D,c,e,f,O,p]),(0,_.useEffect)(()=>{if(r||!l||!oe.current)return;let R=tt(D,e);R.length>0&&A().prefetch(R)},[r,l,D,e,A]),(0,_.useEffect)(()=>()=>{C.current?.dispose(),C.current=null,oe.current=!1},[]);let V=(0,_.useCallback)(R=>{r||(oe.current=!0,A().unlock({lang:O,speech:f,...R?{prefetch:tt(le.current,e)}:{}}))},[r,A,O,f,e]),T=(0,_.useCallback)(()=>V(S.current),[V]),G=(0,_.useCallback)(()=>{L.current=!1,N(!1)},[]),B=(0,_.useCallback)(()=>{G(),C.current?.stop()},[G]),ve=(0,_.useCallback)(()=>{L.current&&B()},[B]),he=(0,_.useCallback)((R,xe)=>{if(r)return;if(L.current){B();return}let ge=A();ge.stop(),L.current=!0,N(!0);let P=xe?.clip===!1?null:je(le.current,Ve,e);ge.say({url:P,text:R,lang:O,speech:f,onEnd:G})},[r,B,A,e,O,f,G]),K=(0,_.useCallback)(R=>{r||(R?V(!0):B(),o!==null&&Or(o,R),S.current=R,u(R))},[r,V,B,o]),z=(0,_.useCallback)(()=>K(!S.current),[K]),te=(0,_.useCallback)((R,xe)=>{if(r||!l)return;L.current&&G();let ge=je(le.current,R,e);A().say({url:ge,text:xe,lang:O,speech:f})},[r,l,e,A,O,f,G]);return(0,_.useMemo)(()=>({supported:!r&&h,enabled:!r&&l,setEnabled:K,toggle:z,unlock:T,speakKey:te,stop:B,summary:r?"none":x,summaryPlaying:d,toggleSummary:he,stopSummary:ve}),[r,h,l,K,z,T,te,B,x,d,he,ve])}i(Vr,"ht");s(Vr,"useVoiceGuidance");function $r(e,t,n,r){let{speakKey:a,stop:o,enabled:l}=e,u=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!r||!l){u.current&&o(),u.current=!1;return}u.current=!0,nt(t)&&t!==Ve&&n!==""&&a(t,n)},[r,l,t,n,a,o])}i($r,"vt");s($r,"useSpeakGuidance");function at(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}i(at,"Pn");s(at,"retryCoachingOf");var Fe={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function Fr({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:a}){let o=Re(),l=(0,st.useRef)(null);return(0,st.useEffect)(()=>{r&&l.current?.focus()},[r]),!e&&!r?null:(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,fe.jsx)("p",{className:"sekyro-text-body",children:o(Fe[t].title)}),(0,fe.jsx)("ul",{className:"sekyro-coaching",children:Fe[t].tips.map(u=>(0,fe.jsx)("li",{children:o(u)},u))}),n!==null?(0,fe.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,fe.jsx)(X,{ref:l,className:"sekyro-btn--start",onClick:a,children:o("capture.recordAgain")}):null]})}i(Fr,"An");s(Fr,"CapturedPanel");function Rt(){try{return!1}catch{return!1}}i(Rt,"tt");s(Rt,"isDevBuild");var In=(0,Hr.createContext)(null);function Dr({state:e}){let t=Re(),[n,r]=(0,it.useState)(!1);(0,it.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let a=e==="granted"?(0,we.jsx)(Nr,{}):e==="denied"?(0,we.jsx)(Lr,{}):(0,we.jsx)(Mr,{});return(0,we.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,we.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:a}),(0,we.jsx)("span",{children:t(`capture.permission.${e}`)})]})}i(Dr,"Kn");s(Dr,"PermissionRow");function Gr({voice:e}){let t=Re();if(!e.supported)return null;let n=e.enabled;return(0,Se.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:i(()=>e.toggle(),"onClick"),children:[(0,Se.jsxs)("span",{className:"sekyro-switch__label",children:[(0,Se.jsx)(rt,{off:!n}),t("capture.voiceGuidance")]}),(0,Se.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,Se.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,Se.jsx)(Rr,{className:"sekyro-switch__check"}):null})})]})}i(Gr,"Un");s(Gr,"VoiceSwitch");function Kr({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:a,tips:o,summary:l,startLabel:u,startDisabled:S,onStart:h}){let w=Re(),x=(0,Y.useRef)(l?.stop);x.current=l?.stop,(0,Y.useEffect)(()=>()=>x.current?.(),[]);let I=(0,Y.useRef)(null),d=(0,Y.useRef)(null),N=(0,Y.useRef)(null),L=(0,Y.useRef)(e),p=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{let f=L.current;if(L.current=e,f===e)return;let D=p.current;e!=="loading"&&(p.current=!1),zr(I.current)&&(e==="failed"?N.current?.focus():D&&d.current?.focus())},[e]);let j=(0,Y.useCallback)(()=>{p.current=!0,t()},[t]),C=e==="loading",A=C||S,O=(0,Y.useCallback)(()=>{A||(x.current?.(),h())},[A,h]),H;return e==="failed"?H=(0,U.jsxs)(se,{tone:"danger",testId:"sekyro-assets-error",children:[(0,U.jsx)("p",{className:"sekyro-text-body",children:w("fcv2.err.models")}),(0,U.jsx)(X,{kind:"ghost",ref:N,className:"sekyro-btn--start",onClick:j,"data-testid":"sekyro-assets-retry",children:w("common.retry")})]}):H=(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,U.jsx)(X,{ref:d,full:!0,"data-testid":"sekyro-start","aria-disabled":A?"true":void 0,"aria-busy":C?"true":void 0,onClick:O,children:C?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ar,{}),w("capture.preparing.title")]}):u??w("capture.start")}),C?(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.preparing.hint")}):null]}),(0,U.jsxs)("div",{ref:I,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,U.jsx)("h2",{className:"sekyro-text-body",children:w("capture.assisted.title")}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.assisted.lead")})]}):null,o!==!1?(0,U.jsx)(Er,{tips:o}):null,l!==void 0?(0,U.jsxs)(X,{kind:"ghost",className:"sekyro-btn--start",onClick:l.toggle,"data-testid":"sekyro-tips-listen",children:[(0,U.jsx)(rt,{off:!1}),w(l.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,U.jsx)(Dr,{state:n}),(0,U.jsx)(Gr,{voice:a}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.securityNote")}),H,(0,U.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?w("capture.preparing.title"):e==="ready"?w("capture.ready"):""})]})}i(Kr,"Gn");s(Kr,"PreCaptureScreen");function zr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}i(zr,"Or");s(zr,"focusIsOurs");function Zr(){let[e,t]=(0,ot.useState)({state:"unknown",settled:!1});return(0,ot.useEffect)(()=>Un(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}i(Zr,"Fn");s(Zr,"useCameraStatus");function Qr(e){return At(e,"mobileRequired")}i(Qr,"qn");s(Qr,"useMobileRequired");function Wr(e){return At(e,"returning").required}i(Wr,"Dn");s(Wr,"useReturning");function At(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let a=e?.[t];if(e===void 0||typeof a!="function"){r({required:!1,settled:!0});return}let o=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(l=>{o&&r({required:l===!0,settled:!0})},()=>{o&&r({required:!1,settled:!0})}),()=>{o=!1}},[e,t]),n}i(At,"jn");s(At,"useFlag");function Yr(e){let t=s(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let o=e?.captureMode,l=e?.captureChoice??null;if(e===void 0||typeof o!="function"){r({session:"self",choice:l,settled:!0});return}let u=!0;return r({session:"self",choice:l,settled:!1}),Promise.resolve().then(()=>o.call(e)).then(S=>{let h=e.captureChoice??null;u&&r({session:h!==null&&S===h?"choice":S==="assisted"||S==="choice"?S:"self",choice:h,settled:!0})},()=>{u&&r({session:"self",choice:null,settled:!0})}),()=>{u=!1}},[e]);let a=(0,pe.useCallback)(o=>{e?.chooseCaptureMode?.(o),r(l=>({...l,choice:o}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:a}}i(Yr,"$n");s(Yr,"useCaptureMode");function Jr(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),a=e.on("result",()=>n(!1));return()=>{r(),a()}},[e]),t}i(Jr,"zn");s(Jr,"useBusy");var Bn=s(()=>"idle","serverSnapshot");function St(e){return Tn(e!==void 0?{assetBaseUrl:e}:{})}i(St,"Wn");s(St,"preload");function Xr(e,t=!0){let n=(0,Q.useSyncExternalStore)((0,Q.useCallback)(h=>Pn(h,e),[e]),()=>jn(e),Bn),[r,a]=(0,Q.useState)(null),o=(0,Q.useRef)(!1),l=(0,Q.useCallback)(()=>{St(e).then(h=>{o.current&&h==="idle"&&a({base:e})})},[e]);(0,Q.useEffect)(()=>(o.current=!0,l(),()=>{o.current=!1}),[l]);let u=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{if(n!=="idle"){u.current={base:e};return}!t||u.current===null||u.current.base!==e||(u.current=null,l())},[n,e,l,t]);let S=(0,Q.useCallback)(()=>{St(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:S}}i(Xr,"Qn");s(Xr,"useLivenessAssets");var br={progress:0,hint:null,faceDetected:!1};function en(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,M.useRef)(e.verification).current,a=(0,M.useRef)(!1);e.verification!==r&&!a.current&&Rt()&&(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 o=(0,M.useRef)(null),[l,u]=(0,M.useState)("idle"),[S,h]=(0,M.useState)(br),[w,x]=(0,M.useState)(!1),[I,d]=(0,M.useState)(!1),[N,L]=(0,M.useState)(null),[p,j]=(0,M.useState)(!1),[C,A]=(0,M.useState)(null),[O,H]=(0,M.useState)(null),[f,D]=(0,M.useState)(null),[oe,le]=(0,M.useState)(null),[c,V]=(0,M.useState)(null),[T,G]=(0,M.useState)(!1),B=(0,M.useRef)(null),ve=(0,M.useRef)("idle"),he=(0,M.useRef)(-1),[K,z]=(0,M.useState)(0),te=(0,M.useRef)(e);te.current=e,(0,M.useEffect)(()=>{let J=t.current;if(J===null)return;let ce={video:J,...n!==void 0?{assetBaseUrl:n}:{}},$=r!==void 0?r.liveness(ce):qn(ce);o.current=$;let Ne=s(()=>V($.facingMode??null),"readFacing");Ne();let He=[$.on("state",b=>{b==="mode_switch"?G(!0):b!=="starting"&&b!=="gating"&&G(!1),b==="starting"?(ve.current!=="starting"&&(he.current+=1,z(Math.max(0,he.current))),H(null),D(null),h(br),d(!1),x(!1),L(null),A(null),B.current=null):b==="gating"&&ve.current==="recording"&&(d(!1),x(!1),L(null),B.current=null),ve.current=b,Ne(),u(b),te.current.onStateChange?.(b)}),$.on("gate",b=>{let ke=B.current;B.current=b.progress,x(ke!==null&&b.progress<ke-.001&&b.progress>0&&b.progress<1),b.progress>=1&&d(!0),h(b)}),$.on("frozen",({previewDataUrl:b})=>L(b)),$.on("profile",({animations:b})=>j(b==="reduced")),$.on("ramp",({colour:b})=>A(b)),$.on("captured",b=>{H(b),le(null),te.current.onCaptured?.(b)}),$.on("error",b=>{D(b);let ke=r?.reportCaptureIssue;ke!==void 0&&kt(Ee=>ke.call(r,Ee),gr("liveness",b,Math.max(0,he.current))),te.current.onError?.(b)}),r?.on("result",b=>{le(b),te.current.onResult?.(b)})];return()=>{for(let b of He)b?.();o.current=null,$.destroy()}},[r,t,n]);let R=(0,M.useCallback)(()=>{o.current?.start()},[]),xe=(0,M.useCallback)(()=>{o.current?.retry()},[]),ge=(0,M.useCallback)(async()=>{let J=o.current;return J===null||typeof J.canSwitchCaptureMode!="function"?!1:await J.canSwitchCaptureMode().catch(()=>!1)===!0},[]),P=(0,M.useCallback)(async J=>{let ce=o.current;if(ce===null||typeof ce.setCaptureMode!="function")return!1;let $=await ce.setCaptureMode(J).catch(()=>!1)===!0;return $&&V(ce.facingMode??null),$},[]);return{state:l,gate:S,draining:w,gateLocked:I,frozenPreview:N,reduceMotion:p,rampColour:C,artifacts:O,error:f,result:oe,facingMode:c,start:R,retry:xe,canSwitchCaptureMode:ge,setCaptureMode:P,modeRestarted:T,attempt:K}}i(en,"Xn");s(en,"useLivenessHandle");var On=new Set(["national_number"]);function xt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>On.has(n));return t.length>0?{...e,options:t}:null}i(xt,"er");s(xt,"pending");function tn(e){let[t,n]=(0,me.useState)(null),[r,a]=(0,me.useState)(e===void 0),[o,l]=(0,me.useState)(!1),[u,S]=(0,me.useState)(!1);(0,me.useEffect)(()=>{if(n(null),e===void 0){a(!0);return}let x=!0,I=e.methodChoice;typeof I=="function"?(a(!1),Promise.resolve().then(()=>I.call(e)).then(N=>{x&&n(xt(N))},()=>{}).finally(()=>{x&&a(!0)})):a(!0);let d=e.on("method",N=>n(xt(N)));return()=>{x=!1,d()}},[e]);let h=(0,me.useCallback)(async x=>{if(e===void 0)return!1;l(!0),S(!1);try{return await e.selectMethod(x),n(null),!0}catch{return S(!0),!1}finally{l(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!u?w:null,settled:r,busy:o,failed:u,select:h}}i(tn,"tr");s(tn,"useMethodChoice");var Vn=["ar","fr","en"];function rn(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}}i(rn,"oo");s(rn,"isClipUrl");function nn(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of Vn){let a=t[r];if(!(typeof a!="object"||a===null))for(let[o,l]of Object.entries(a))!nt(o)||!rn(l)||((n[r]??(n[r]={}))[o]=l)}return Object.keys(n).length>0?n:null}i(nn,"so");s(nn,"toVoiceClipMap");function sn(e){let[t,n]=(0,Te.useState)(null);(0,Te.useEffect)(()=>{if(n(null),e===void 0)return;let a=!0,o=s(u=>{if(!a)return;let S=typeof u=="object"&&u!==null&&typeof u.setId=="string"?u:null;n(h=>h?.setId===S?.setId?h:S)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(o,()=>o(null))}catch{o(null)}let l=e.on("view",u=>o(u.voice));return()=>{a=!1,l()}},[e]);let r=(0,Te.useMemo)(()=>t!==null?nn(t):null,[t]);return e===void 0?null:r}i(sn,"nr");s(sn,"useServerVoiceClips");function an({voice:e}){let t=Re();return(0,Nt.jsx)(X,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:i(()=>e.toggle(),"onClick"),children:(0,Nt.jsx)(rt,{off:!e.enabled,className:"sekyro-icon"})})}i(an,"or");s(an,"VoiceChip");var $n=new Set(["abandoned","not_opened","cancelled","superseded"]),Fn=800;function on(e){return e===void 0||e!==!1&&e.length===_t.length&&_t.every(t=>e.includes(t))}i(on,"uo");s(on,"isDefaultTips");function ln(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}i(ln,"po");s(ln,"carriesActivation");function cn(e){return typeof e=="object"&&e!==null&&!(0,y.isValidElement)(e)&&"tone"in e&&"text"in e}i(cn,"fo");s(cn,"isNoticeObject");var Hn=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function un(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}i(un,"yo");s(un,"isCapturing");function dn(e){return e==="captured"||e==="uploading"||e==="checking"}i(dn,"go");s(dn,"isPostCapture");function Dn({verification:e,locale:t,dir:n,strings:r,slots:a,autoStart:o=!1,notice:l,startDisabled:u=!1,startLabel:S,tips:h,tipsSummary:w,coach:x,voice:I,onGuidance:d,onCaptured:N,onResult:L,onError:p,onStateChange:j,assetBaseUrl:C,className:A}){let O=ur(t),H=(0,y.useMemo)(()=>cr(t,r),[t,r,O]),f=(0,y.useMemo)(()=>g=>H[g]??"",[H]),D=n??(t==="ar"?"rtl":"ltr"),oe=(0,y.useRef)(null),le=(0,y.useContext)(In),c=en({verification:e,videoRef:oe,assetBaseUrl:C,onCaptured:N,onResult:L,onError:p,onStateChange:j}),V=Xr(C,c.state==="idle"&&c.error===null),T=tn(e),G=T.choice!==null,B=Qr(e),ve=Wr(e),he=Jr(e),K=Zr(),z=Yr(e),te=z.session==="choice",R=z.mode==="assisted",xe=I!==!1&&I?.clips===void 0,ge=sn(xe?e:void 0),P=Vr({locale:t,defaultClips:ge,options:I}),J=R?"environment":"user",ce=z.settled,$=(0,y.useRef)(null),Ne=(0,y.useRef)(!1),He=(0,y.useRef)(P.unlock);He.current=P.unlock,(0,y.useEffect)(()=>{let g=$.current;if(g===null)return;let ne=["pointerup","touchend","click","keydown"],Ce=s(()=>{for(let Oe of ne)g.removeEventListener(Oe,Le,!0)},"disarm");function Le(Oe){if(Ne.current){Ce();return}ln(Oe)&&(Ne.current=!0,Ce(),He.current())}i(Le,"Re"),s(Le,"onGesture");for(let Oe of ne)g.addEventListener(Oe,Le,{capture:!0,passive:!0});return Ce},[]);let b=(0,y.useCallback)(()=>{Ne.current||(Ne.current=!0,P.unlock()),c.start()},[P.unlock,c.start]),ke=(0,y.useCallback)(()=>c.start(),[c.start]),Ee=(0,y.useRef)(!1),Pe=c.state==="idle"&&c.error===null,It=!G&&!B.required&&(o===!0||o==="when-permitted"&&K.permission==="granted"),Ut=It&&T.settled&&B.settled&&ce,fn=o==="when-permitted"&&!K.permissionSettled&&!Ee.current,jt=It&&Pe&&!Ee.current,ct=(fn||jt||!ce)&&V.gate==="ready"?"loading":V.gate;(0,y.useEffect)(()=>{!Ut||!Pe||V.gate!=="ready"||Ee.current||(Ee.current=!0,ke())},[Ut,Pe,V.gate,ke]);let mn=Pe&&!G&&!B.required&&!(jt&&V.gate==="ready"),[Tt,Pt]=(0,y.useState)(!1),{canSwitchCaptureMode:Bt,setCaptureMode:qt}=c;(0,y.useEffect)(()=>{if(!z.settled||!te){Pt(!1);return}let g=!0;return Bt().then(ne=>{g&&Pt(ne)}),()=>{g=!1}},[z.settled,te,Bt]);let{choose:Ot}=z,Ie=R?"self":"assisted",yn=(0,y.useCallback)(async()=>{await qt(Ie)&&Ot(Ie)},[qt,Ot,Ie]),Vt=c.state!=="idle"&&c.facingMode!==null?c.facingMode:J;(0,y.useEffect)(()=>{let g=oe.current?.style;Vt==="user"?g?.removeProperty("transform"):g&&(g.transform="none")},[Vt]);let De=(0,y.useMemo)(()=>c.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(c.artifacts.keyframe):null,[c.artifacts]);(0,y.useEffect)(()=>{if(De!==null)return()=>URL.revokeObjectURL(De)},[De]);let $t=c.frozenPreview??De,Ue=e!==void 0,Z=un(c.state),be=dn(c.state),Ge=Z||be,re=c.result,Ft=c.state==="done"&&re!==null,ut=c.state==="recording"&&c.frozenPreview!==null,Ke=le!==null,Ht=Tt&&Z&&!ut?{to:Ie,label:f(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:f(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:s(()=>{yn()},"onSwitch")}:null,ze=c.modeRestarted&&Z?f("capture.modeSwitch.restarted"):null,Be=be||ut,Dt=be?"checking":ut?"frozen":c.state==="recording"?"recording":c.gateLocked||c.gate.progress>=1?"locked":c.gate.faceDetected?"aligning":"seeking",Ze=Z?c.gate.hint:null,Qe=c.state==="starting"?"capture.preparing.title":Ze===null?null:Ze==="center"&&!c.gate.faceDetected?"fcv3.no_face":ar(Ze),[vn,Gt]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(Qe!=="fcv3.no_face"){Gt(Qe);return}if(!Z)return;let g=setTimeout(()=>Gt(Qe),Fn);return()=>clearTimeout(g)},[Qe,Z]);let dt=Z&&typeof x=="string"&&x!=="",Kt=R&&Z?f("capture.assisted.stage"):null,Me=Z&&!dt?vn:null,pt=dt?x:Me===null?"":f(Me);$r(P,Me,pt,Z);let zt=(0,y.useRef)(d);zt.current=d,(0,y.useEffect)(()=>{if(nt(Me))try{zt.current?.(Me)}catch(g){console.error("[@sekyro/react] onGuidance threw:",g)}},[Me]);let qe=(0,y.useMemo)(()=>({supported:P.supported,enabled:P.enabled,setEnabled:P.setEnabled,toggle:P.toggle}),[P.supported,P.enabled,P.setEnabled,P.toggle]),ht=a?.voicePrompt,Zt=ht!==void 0,Qt=I===void 0,Wt=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!Zt||!Qt||Wt.current||!Rt()||(Wt.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."))},[Zt,Qt]);let gn=ht!==void 0?(g,ne,Ce)=>ht(g,ne,Ce,qe):P.supported?()=>(0,k.jsx)(an,{voice:qe}):void 0,{summary:ft,summaryPlaying:Yt,toggleSummary:Jt,stopSummary:Xt}=P,We=w!==void 0&&w!=="",er=We?w:f("capture.tips.summary"),tr=We?ft!=="none":ft==="partner"||ft==="default"&&on(h),kn=(0,y.useMemo)(()=>tr?{playing:Yt,toggle:s(()=>Jt(er,{clip:!We}),"toggle"),stop:Xt}:void 0,[tr,Yt,Jt,er,Xt,We]),bn=(0,y.useMemo)(()=>({assets:ct,retryAssets:V.retry,permission:K.permission,permissionSettled:K.permissionSettled,captureMode:z.mode,facing:J,voice:qe}),[ct,V.retry,K.permission,K.permissionSettled,z.mode,J,qe]),_n=cn(l)?(0,k.jsx)(se,{tone:l.tone,testId:"sekyro-host-notice",children:(0,k.jsx)("span",{children:l.text})}):l??null,ue=re!==null&&re.status==="retry"?re:null,W=Ft&&re.status==="unavailable"&&!G&&re.reasonCode!=="portrait_required"?re:null,_e=Ft&&(re.status==="verified"||re.status==="not_verified"||re.status==="review")?re:null,mt=s((g,ne)=>{if(g===void 0)return null;if(g==="device_cooldown"){let Le=or(t,ne);if(Le!==null)return f(Le.key).replace("{time}",Le.time)}let Ce=Xe(g);return Ce===null?null:f(Ce)},"reasonText"),yt=s(g=>{let ne=g.retakeHint===void 0?null:Je(g.retakeHint);return ne===null?mt(g.reasonCode):f(ne)},"retryText"),rr=_e===null?null:mt(_e.reasonCode,_e.retryAfter)??(_e.status==="not_verified"&&_e.reason!==void 0&&$n.has(_e.reason)?f("errors.session_expired"):null),Cn=W!==null&&W.reasonCode!==void 0&&W.reasonCode!=="nni_unbound"&&W.reasonCode!=="id_number_unbound"&&W.reasonCode!=="method_required"&&W.reasonCode!=="mobile_required"&&!(W.reasonCode==="no_recorder"&&c.artifacts?.degraded==="NO_RECORDER"),Ye=W?.reasonCode,nr=c.attempt;(0,y.useEffect)(()=>{W===null||Ye===void 0||e?.reportCaptureIssue===void 0||Hn.has(Ye)||kt(g=>e.reportCaptureIssue?.(g),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Ye,attempt:Math.min(1e3,nr)})},[W,Ye,nr,e]);let sr=gt(),wn=G&&T.auto===null&&!Z&&!be&&c.error===null,vt=(0,y.useCallback)(async g=>{await T.select(g)&&c.state==="done"&&c.retry()},[T.select,c.state,c.retry]);return(0,y.useEffect)(()=>{T.auto!==null&&!T.busy&&!Z&&!be&&vt(T.auto)},[T.auto,T.busy,Z,be,vt]),(0,k.jsx)(dr,{value:f,children:(0,k.jsxs)("div",{ref:$,className:A===void 0?"sekyro-capture":`sekyro-capture ${A}`,dir:D,lang:t,"data-testid":"sekyro-liveness-capture","data-state":c.state,children:[a?.header,ue!==null&&yt(ue)!==null&&!(Ke&&Ge)?(0,k.jsx)(se,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,k.jsx)("span",{children:yt(ue)})}):null,ze!==null&&!Ke?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,k.jsx)("span",{children:ze})}):null,he&&be&&!Ke?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,k.jsx)("span",{children:f("capture.busy")})}):null,B.required&&Pe?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,k.jsx)("span",{children:f("reasons.mobile_required")})}):null,c.error!==null?a?.errorPanel!==void 0?a.errorPanel(c.error,c.retry):(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-error-notice",children:[(0,k.jsx)("span",{children:f(ir(c.error))}),c.error.retryable?(0,k.jsx)(X,{ref:sr,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f("common.retry")}):null]}):null,W!==null?(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,k.jsx)("span",{children:mt(W.reasonCode)??f(W.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),Cn?(0,k.jsx)(X,{ref:sr,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f("capture.recordAgain")}):null]}):null,rr!==null&&_e!==null?(0,k.jsx)(se,{tone:_e.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,k.jsx)("span",{children:rr})}):null,(0,k.jsx)("div",{className:Ge?void 0:"sekyro-hidden","data-capture-live":Ge?"":void 0,children:Ke?le({videoRef:oe,guidance:Be&&Ue?f("capture.checking"):pt,coached:dt&&!(Be&&Ue),note:Be?Ue?f(he?"capture.busy":"capture.checkingHint"):null:ze??(ue!==null?yt(ue):Kt),settled:Be&&Ue,progress:c.gate.progress,phase:Dt,still:Be?$t:null,live:Ge,modeSwitch:Ht,...Tt?{status:ze}:{},ramp:c.rampColour===null?null:{colour:c.rampColour}}):(0,k.jsx)(pr,{videoRef:oe,guidanceText:pt,guidanceHint:Ze,guidanceKey:Me,progress:c.gate.progress,phase:Dt,draining:c.draining,stillUrl:$t,showChecking:Ue,operatorText:Kt,voicePrompt:gn,overlay:i(g=>(0,k.jsxs)(k.Fragment,{children:[a?.stageOverlay?.(g),(0,k.jsx)(hr,{colour:c.rampColour})]}),"overlay"),reduceMotion:c.reduceMotion,modeSwitch:Ht})}),wn&&T.choice!==null?(0,k.jsx)(Ir,{title:f("method.title"),description:f("method.description"),options:T.choice.options.map(g=>({id:g,label:f(`method.${g}`)})),busy:T.busy,error:T.failed?f("errors.network_error"):null,focus:c.state==="done",testId:"sekyro-method",look:"buttons",onChoose:i(g=>{vt(g)},"onChoose")}):null,mn?(0,k.jsxs)(k.Fragment,{children:[ve&&a?.header===void 0&&a?.intro===void 0?(0,k.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,k.jsx)("h2",{className:"sekyro-text-body",children:f("returning.title")}),(0,k.jsx)("p",{className:"sekyro-text-muted",children:f("returning.description")})]}):null,_n,a?.intro!==void 0?a.intro(b,bn):(0,k.jsx)(Kr,{assets:ct,onRetryAssets:V.retry,permission:K.permission,captureMode:z.mode,voice:qe,tips:h??_t,summary:kn,startLabel:S,startDisabled:u,onStart:b})]}):null,(0,k.jsx)(Fr,{showCoaching:ue!==null,coaching:at(ue?.reasonCode),attemptsText:ue?.attemptsRemaining!==void 0?lr(H,t,ue.attemptsRemaining):null,showRetake:ue!==null&&!Z&&!be||!Ue&&c.state==="captured",onRetake:c.retry}),a?.footer]})})}i(Dn,"_i");s(Dn,"LivenessCapture");var Et=E(F(),1),lt=E(F(),1),m=E(de(),1);import{isInAppBrowser as Jn}from"@sekyro/web/client";var vs={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function Gn(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=e.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}i(Gn,"Y");s(Gn,"identityLabel");function Kn(e,t){let[n,r]=(0,Et.useState)(!1),[a,o]=(0,Et.useState)(null);return{busy:n,error:a,run:s(l=>{r(!0),o(null),l().then(()=>r(!1),u=>{r(!1),o(e.t(kr(u,e.strings))),t?.(u)})},"run")}}i(Kn,"q");s(Kn,"useChoiceAction");function pn(){let e=`sekyro-face-light-${(0,lt.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,m.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,m.jsx)("defs",{children:(0,m.jsx)("mask",{id:e,children:(0,m.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,m.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,m.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}i(pn,"O");s(pn,"FaceMark");var zn={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function Zn(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}i(Zn,"te");s(Zn,"faceIntroRetryOf");var Qn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function Wn({start:e,context:t,tips:n,tipsTitle:r,human:a=!1,returning:o=!1,notice:l,retry:u}){let S=bt(),{t:h}=S,w=u===void 0?"face":at(u.reason),x=w==="face"?null:Fe[w].tips,I=(0,lt.useContext)(mr)?.busy===!0;return(0,m.jsxs)("section",{className:"sekyro-step",children:[(0,m.jsx)(pn,{}),t.captureMode==="assisted"?(0,m.jsx)(et,{title:h("capture.assisted.heading"),lead:h("capture.assisted.lead")}):o?(0,m.jsx)(et,{title:h("returning.heading"),lead:h("returning.description")}):(0,m.jsx)(et,{title:h(a?"native.face.humanIntroTitle":"native.face.introTitle"),lead:h(a?"native.face.humanIntroLead":"native.face.introLead")}),u!==void 0?(0,m.jsx)(hn,{retry:u,title:Fe[w].title}):null,r!==void 0&&x===null?(0,m.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,m.jsx)("ul",{className:"sekyro-tiprows",children:x!==null?x.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:Qn[d]??"face"}),h(d)]},d)):n!==void 0?n.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:zn[d.id]??"face"}),d.text]},d.id)):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"light"}),h("capture.tips.light")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"jGlasses"}),h("capture.tips.uncover")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"smartphone"}),h("capture.tips.eyeLevel")]})]})}),l??null,l!==void 0?null:t.assets==="failed"?(0,m.jsx)(X,{kind:"secondary",full:!0,onClick:t.retryAssets,children:h("common.retry")}):null,l!==void 0?null:(0,m.jsx)(fr,{children:(0,m.jsxs)(X,{full:!0,disabled:t.assets!=="ready"||I,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,m.jsx)(Ae,{name:"camera"}),h("capture.start")]})})]})}i(Wn,"ne");s(Wn,"FaceIntro");var Yn=new Set(["match_inconclusive","no_face_source","below_threshold"]);function hn({retry:e,title:t}){let n=bt(),r=e.retakeHint===void 0?null:Je(e.retakeHint),a=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":Yn.has(e.reason)?"capture.retryMatch.message":Xe(e.reason);return(0,m.jsxs)(yr,{tone:"warning",children:[r!==null?(0,m.jsx)("span",{children:n.t(r)}):a!==null?(0,m.jsx)("span",{children:n.t(a)}):null,r===null?(0,m.jsx)("span",{children:n.t(t)}):null,(0,m.jsx)("span",{children:vr(n,e.attemptsRemaining,e.attemptsExhausted)})]})}i(hn,"T");s(hn,"RetryNotice");function Xn(e){return Jn(e)}i(Xn,"se");s(Xn,"isInAppBrowser");function es(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let a=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${a};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}i(es,"ce");s(es,"androidBrowserIntent");export{Ir as a,Rt as b,In as c,Yr as d,Dn as e,vs as f,Gn as g,Kn as h,Zn as i,Wn as j,Xn as k,es as l};
1
+ import{b as pr,d as hr}from"./chunk-LNCABBX7.js";import{b as gr,c as kt}from"./chunk-F2IPIZ4J.js";import{a as kr}from"./chunk-YZ6YGLNN.js";import{c as bt}from"./chunk-ULVT7UW6.js";import{a as cr,b as ur,c as dr,d as Re}from"./chunk-KHBP6WWR.js";import{F as mr,K as yr,L as vr,a as F,b as de,c as X,m as ar,n as Je,p as ir,q as Xe,r as or,s as lr,t as gt,u as se,v as Ae,w as et,y as fr}from"./chunk-YQ7XHAQJ.js";import{a as i,c as E,i as s}from"./chunk-SSU37LFQ.js";var _r=E(F(),1),v=E(de(),1),ee=E(de(),1),ye=E(F(),1),q=E(de(),1),_=E(F(),1),y=E(F(),1),st=E(F(),1),fe=E(de(),1),Hr=E(F(),1),Y=E(F(),1),it=E(F(),1),we=E(de(),1),Se=E(de(),1),U=E(de(),1),ot=E(F(),1),pe=E(F(),1),Q=E(F(),1),M=E(F(),1),me=E(F(),1),Te=E(F(),1),Nt=E(de(),1),k=E(de(),1);import{subscribeCameraPermission as Un}from"@sekyro/web";import{getLivenessAssetsStatus as jn,preloadLivenessAssets as Tn,subscribeLivenessAssets as Pn}from"@sekyro/web";import{createLivenessCapture as qn}from"@sekyro/web";function ie({className:e,children:t}){return(0,v.jsx)("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}i(ie,"te");s(ie,"Svg");var Mt="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 Cr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,v.jsx)("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}i(Cr,"cn");s(Cr,"SunIcon");function wr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,v.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}i(wr,"ln");s(wr,"FaceUncoveredIcon");function Sr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,v.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,v.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}i(Sr,"un");s(Sr,"PhoneEyeLevelIcon");function xr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,v.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}i(xr,"dn");s(xr,"LookStraightIcon");function Nr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:Mt}),(0,v.jsx)("path",{d:"M9 13l2 2 4-4"})]})}i(Nr,"pn");s(Nr,"CameraCheckIcon");function Mr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:Mt}),(0,v.jsx)("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}i(Mr,"fn");s(Mr,"CameraAskIcon");function Lr(e){return(0,v.jsxs)(ie,{...e,children:[(0,v.jsx)("path",{d:Mt}),(0,v.jsx)("path",{d:"M3 3l18 18"})]})}i(Lr,"mn");s(Lr,"CameraBlockedIcon");function rt({off:e,className:t}){return(0,v.jsxs)(ie,{className:t,children:[(0,v.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,v.jsx)("path",{d:"M4 4l16 16"}):(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,v.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}i(rt,"Ve");s(rt,"SpeakerIcon");function Rr(e){return(0,v.jsx)(ie,{...e,children:(0,v.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}i(Rr,"yn");s(Rr,"CheckIcon");function Ar(e){return(0,v.jsxs)(ie,{className:e.className??"sekyro-spinner",children:[(0,v.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,v.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}i(Ar,"gn");s(Ar,"SpinnerIcon");var _t=["light","uncover","eyeLevel","straight"],Sn={light:{key:"capture.tips.light",icon:s(()=>(0,ee.jsx)(Cr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:s(()=>(0,ee.jsx)(wr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:s(()=>(0,ee.jsx)(Sr,{}),"icon")},straight:{key:"capture.tips.straight",icon:s(()=>(0,ee.jsx)(xr,{}),"icon")}};function Er({tips:e}){let t=Re(),n=(0,_r.useId)();return e.length===0?null:(0,ee.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,ee.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,ee.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let a=typeof r=="string"?Sn[r]:void 0,o=typeof r=="string"?r:r.id,l=a!==void 0?a.icon():typeof r=="string"?void 0:r.icon,u=a!==void 0?t(a.key):typeof r=="string"?r:r.text;return(0,ee.jsxs)("li",{className:"sekyro-tips__item",children:[l!=null?(0,ee.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:l}):null,(0,ee.jsx)("span",{children:u})]},o)})})]})}i(Er,"vn");s(Er,"TipList");var xn=220;function Ir({title:e,description:t,options:n,busy:r,error:a,focus:o,testId:l,look:u="cards",marked:S,onChoose:h}){let w=(0,ye.useId)(),x=gt(),[I,d]=(0,ye.useState)(null),N=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{a!==null&&d(null)},[a]),(0,ye.useEffect)(()=>()=>{N.current!==null&&clearTimeout(N.current)},[]);let L=s(p=>{r||I!==null||(d(p),N.current=setTimeout(()=>{N.current=null,d(null),h(p)},xn))},"choose");return(0,q.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":l,children:[(0,q.jsxs)("div",{className:u==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,q.jsx)("h2",{id:w,ref:o?x:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,q.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),a!==null?(0,q.jsx)(se,{tone:"danger",children:(0,q.jsx)("span",{children:a})}):null,u==="buttons"?(0,q.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((p,j)=>(0,q.jsx)(X,{kind:j===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:i(()=>h(p.id),"onClick"),children:p.label},p.id))}):(0,q.jsx)("div",{className:"sekyro-choices",children:n.map(p=>(0,q.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(I??S)===p.id,"aria-busy":r||void 0,disabled:r||I!==null&&I!==p.id,onClick:i(()=>L(p.id),"onClick"),children:[p.glyph!==void 0?(0,q.jsx)("span",{className:"sekyro-card__tile",children:p.glyph}):null,(0,q.jsxs)("span",{className:"sekyro-card__body",children:[(0,q.jsx)("span",{className:"sekyro-card__title",children:p.label}),p.sub!==void 0?(0,q.jsx)("span",{className:"sekyro-card__sub",children:p.sub}):null]}),(0,q.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},p.id))})]})}i(Ir,"kn");s(Ir,"ChoiceScreen");var Ur=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary"];function nt(e){return e!==null&&Ur.includes(e)}i(nt,"he");s(nt,"isVoiceKey");var Nn=s((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let a=e[n];r=a!=null&&Nn(a,t)?a[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}i(je,"Me");s(je,"resolveClip");var Mn="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",Ln={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function ae(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}i(ae,"ne");s(ae,"synth");function jr(){return ae()!==null&&typeof SpeechSynthesisUtterance=="function"}i(jr,"wr");s(jr,"speechAvailable");function Ct(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}i(Ct,"bn");s(Ct,"baseLang");function Lt(e,t){let n=s(a=>a.replace(/_/g,"-").toLowerCase(),"norm"),r=Ct(t);return e.find(a=>n(a.lang)===n(t))??e.find(a=>Ct(a.lang)===r)}i(Lt,"Vn");s(Lt,"pickVoice");function Tr(e){if(!jr())return!1;let t=[];try{t=ae()?.getVoices()??[]}catch{return!0}return t.length===0||Lt(t,e)!==void 0}i(Tr,"Mn");s(Tr,"speechUsable");function Pr(e){let t=ae();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}i(Pr,"wn");s(Pr,"subscribeVoices");function $e(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}i($e,"Ke");s($e,"clipIdentity");function wt(e){e.pause(),e.removeAttribute("src"),e.load()}i(wt,"Sn");s(wt,"release");function Br(){let e=null,t=null,n=0,r=null,a=[],o=new Map,l=s(()=>{a=ae()?.getVoices()??[]},"loadVoices"),u=!1,S=s(()=>{let d=ae();u||d===null||(u=!0,l(),d.addEventListener?.("voiceschanged",l))},"bindVoices"),h=s(()=>(e??(e=new Audio),e),"element"),w=s((d,N,L)=>{let p=ae();if(p!==null&&d!==""&&typeof SpeechSynthesisUtterance=="function"){S();let j=Lt(a,N);if(a.length===0||j!==void 0){p.cancel();let C=new SpeechSynthesisUtterance(d);C.lang=N,j!==void 0&&(C.voice=j),C.rate=.95,L!==void 0&&(C.onend=C.onerror=L),p.speak(C);return}}L?.()},"speak"),x=s(()=>{n+=1,r=null,e!==null&&(e.pause(),e.currentTime=0),ae()?.cancel()},"stop"),I=s(d=>{for(let N of d){let L=$e(N);if(o.has(L))continue;let p=new Audio;p.preload="auto",p.src=N,o.set(L,p)}},"warmClips");return{say(d){let N=d.url!==null?$e(d.url):`tts:${d.lang}:${d.text}`;if(N===r)return;r=N,n+=1;let L=n,p=d.onEnd,j=p!==void 0?()=>{L===n&&p()}:void 0;if(ae()?.cancel(),d.url!==null){let C=h();C.pause(),C.muted=!1,C.src=d.url,C.currentTime=0,C.onended=j??null,C.play()?.catch(A=>{L===n&&A?.name!=="AbortError"&&(d.speech?w(d.text,d.lang,j):j?.())});return}d.speech?w(d.text,d.lang,j):j?.()},unlock({lang:d,speech:N,prefetch:L}){let p=h();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let A=Uint8Array.from(atob(Mn),O=>O.charCodeAt(0));t=URL.createObjectURL(new Blob([A],{type:"audio/wav"}))}let j=p.paused===!1&&t!==null&&p.src!==t;t!==null&&!j&&(p.muted=!0,p.onended=null,p.src=t,p.play()?.catch(()=>{}));let C=ae();if(N&&C!==null&&typeof SpeechSynthesisUtterance=="function"){S();let A=new SpeechSynthesisUtterance(" ");A.volume=0,A.lang=d,C.speak(A)}I(L??[])},prefetch:I,stop:x,dispose(){x(),u&&ae()?.removeEventListener?.("voiceschanged",l),u=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&wt(e),e=null;for(let d of o.values())wt(d);o.clear()}}}i(Br,"Ln");s(Br,"createVoicePlayer");var Rn="sekyro.voiceGuidance";function qr(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}}i(qr,"xn");s(qr,"readVoicePreference");function Or(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}i(Or,"In");s(Or,"writeVoicePreference");var Ve="capture.tips.summary",An=typeof window<"u"?_.useLayoutEffect:_.useEffect,En=Object.freeze({});function tt(e,t){let n=new Set,r=[];for(let a of Ur){let o=a===Ve?null:je(e,a,t);o===null||n.has($e(o))||(n.add($e(o)),r.push(o))}return r}i(tt,"gt");s(tt,"resolvedClipUrls");function Vr({locale:e,defaultClips:t,options:n}){let r=n===!1,a=r?{}:n??{},o=a.storageKey===void 0?Rn:a.storageKey,[l,u]=(0,_.useState)(a.defaultEnabled??!0),S=(0,_.useRef)(l),[h,w]=(0,_.useState)(!1),[x,I]=(0,_.useState)("none"),[d,N]=(0,_.useState)(!1),L=(0,_.useRef)(!1),[p,j]=(0,_.useState)(0),C=(0,_.useRef)(null),A=(0,_.useCallback)(()=>(C.current??(C.current=Br()),C.current),[]),O=Ln[e],H=a.speechFallback,f=H===void 0||H===!0?!0:H===!1?!1:H.includes(e),D=a.clips??t??En,oe=(0,_.useRef)(!1),le=(0,_.useRef)(D);An(()=>{le.current=D,S.current=l}),(0,_.useEffect)(()=>{if(r||o===null)return;let R=qr(o);R!==null&&(S.current=R,u(R))},[r,o]),(0,_.useEffect)(()=>{if(!(r||!f))return Pr(()=>j(R=>R+1))},[r,f]);let c=a.clips;(0,_.useEffect)(()=>{if(r)return;let R=f&&Tr(O);w(tt(D,e).length>0||R),I(c!==void 0&&je(c,Ve,e)!==null?"partner":je(D,Ve,e)!==null||R?"default":"none")},[r,D,c,e,f,O,p]),(0,_.useEffect)(()=>{if(r||!l||!oe.current)return;let R=tt(D,e);R.length>0&&A().prefetch(R)},[r,l,D,e,A]),(0,_.useEffect)(()=>()=>{C.current?.dispose(),C.current=null,oe.current=!1},[]);let V=(0,_.useCallback)(R=>{r||(oe.current=!0,A().unlock({lang:O,speech:f,...R?{prefetch:tt(le.current,e)}:{}}))},[r,A,O,f,e]),T=(0,_.useCallback)(()=>V(S.current),[V]),G=(0,_.useCallback)(()=>{L.current=!1,N(!1)},[]),B=(0,_.useCallback)(()=>{G(),C.current?.stop()},[G]),ve=(0,_.useCallback)(()=>{L.current&&B()},[B]),he=(0,_.useCallback)((R,xe)=>{if(r)return;if(L.current){B();return}let ge=A();ge.stop(),L.current=!0,N(!0);let P=xe?.clip===!1?null:je(le.current,Ve,e);ge.say({url:P,text:R,lang:O,speech:f,onEnd:G})},[r,B,A,e,O,f,G]),K=(0,_.useCallback)(R=>{r||(R?V(!0):B(),o!==null&&Or(o,R),S.current=R,u(R))},[r,V,B,o]),z=(0,_.useCallback)(()=>K(!S.current),[K]),te=(0,_.useCallback)((R,xe)=>{if(r||!l)return;L.current&&G();let ge=je(le.current,R,e);A().say({url:ge,text:xe,lang:O,speech:f})},[r,l,e,A,O,f,G]);return(0,_.useMemo)(()=>({supported:!r&&h,enabled:!r&&l,setEnabled:K,toggle:z,unlock:T,speakKey:te,stop:B,summary:r?"none":x,summaryPlaying:d,toggleSummary:he,stopSummary:ve}),[r,h,l,K,z,T,te,B,x,d,he,ve])}i(Vr,"ht");s(Vr,"useVoiceGuidance");function $r(e,t,n,r){let{speakKey:a,stop:o,enabled:l}=e,u=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!r||!l){u.current&&o(),u.current=!1;return}u.current=!0,nt(t)&&t!==Ve&&n!==""&&a(t,n)},[r,l,t,n,a,o])}i($r,"vt");s($r,"useSpeakGuidance");function at(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}i(at,"Pn");s(at,"retryCoachingOf");var Fe={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function Fr({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:a}){let o=Re(),l=(0,st.useRef)(null);return(0,st.useEffect)(()=>{r&&l.current?.focus()},[r]),!e&&!r?null:(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,fe.jsx)("p",{className:"sekyro-text-body",children:o(Fe[t].title)}),(0,fe.jsx)("ul",{className:"sekyro-coaching",children:Fe[t].tips.map(u=>(0,fe.jsx)("li",{children:o(u)},u))}),n!==null?(0,fe.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,fe.jsx)(X,{ref:l,className:"sekyro-btn--start",onClick:a,children:o("capture.recordAgain")}):null]})}i(Fr,"An");s(Fr,"CapturedPanel");function Rt(){try{return!1}catch{return!1}}i(Rt,"tt");s(Rt,"isDevBuild");var In=(0,Hr.createContext)(null);function Dr({state:e}){let t=Re(),[n,r]=(0,it.useState)(!1);(0,it.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let a=e==="granted"?(0,we.jsx)(Nr,{}):e==="denied"?(0,we.jsx)(Lr,{}):(0,we.jsx)(Mr,{});return(0,we.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,we.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:a}),(0,we.jsx)("span",{children:t(`capture.permission.${e}`)})]})}i(Dr,"Kn");s(Dr,"PermissionRow");function Gr({voice:e}){let t=Re();if(!e.supported)return null;let n=e.enabled;return(0,Se.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:i(()=>e.toggle(),"onClick"),children:[(0,Se.jsxs)("span",{className:"sekyro-switch__label",children:[(0,Se.jsx)(rt,{off:!n}),t("capture.voiceGuidance")]}),(0,Se.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,Se.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,Se.jsx)(Rr,{className:"sekyro-switch__check"}):null})})]})}i(Gr,"Un");s(Gr,"VoiceSwitch");function Kr({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:a,tips:o,summary:l,startLabel:u,startDisabled:S,onStart:h}){let w=Re(),x=(0,Y.useRef)(l?.stop);x.current=l?.stop,(0,Y.useEffect)(()=>()=>x.current?.(),[]);let I=(0,Y.useRef)(null),d=(0,Y.useRef)(null),N=(0,Y.useRef)(null),L=(0,Y.useRef)(e),p=(0,Y.useRef)(!1);(0,Y.useEffect)(()=>{let f=L.current;if(L.current=e,f===e)return;let D=p.current;e!=="loading"&&(p.current=!1),zr(I.current)&&(e==="failed"?N.current?.focus():D&&d.current?.focus())},[e]);let j=(0,Y.useCallback)(()=>{p.current=!0,t()},[t]),C=e==="loading",A=C||S,O=(0,Y.useCallback)(()=>{A||(x.current?.(),h())},[A,h]),H;return e==="failed"?H=(0,U.jsxs)(se,{tone:"danger",testId:"sekyro-assets-error",children:[(0,U.jsx)("p",{className:"sekyro-text-body",children:w("fcv2.err.models")}),(0,U.jsx)(X,{kind:"ghost",ref:N,className:"sekyro-btn--start",onClick:j,"data-testid":"sekyro-assets-retry",children:w("common.retry")})]}):H=(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,U.jsx)(X,{ref:d,full:!0,"data-testid":"sekyro-start","aria-disabled":A?"true":void 0,"aria-busy":C?"true":void 0,onClick:O,children:C?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(Ar,{}),w("capture.preparing.title")]}):u??w("capture.start")}),C?(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.preparing.hint")}):null]}),(0,U.jsxs)("div",{ref:I,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,U.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,U.jsx)("h2",{className:"sekyro-text-body",children:w("capture.assisted.title")}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.assisted.lead")})]}):null,o!==!1?(0,U.jsx)(Er,{tips:o}):null,l!==void 0?(0,U.jsxs)(X,{kind:"ghost",className:"sekyro-btn--start",onClick:l.toggle,"data-testid":"sekyro-tips-listen",children:[(0,U.jsx)(rt,{off:!1}),w(l.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,U.jsx)(Dr,{state:n}),(0,U.jsx)(Gr,{voice:a}),(0,U.jsx)("p",{className:"sekyro-text-muted",children:w("capture.securityNote")}),H,(0,U.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?w("capture.preparing.title"):e==="ready"?w("capture.ready"):""})]})}i(Kr,"Gn");s(Kr,"PreCaptureScreen");function zr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}i(zr,"Or");s(zr,"focusIsOurs");function Zr(){let[e,t]=(0,ot.useState)({state:"unknown",settled:!1});return(0,ot.useEffect)(()=>Un(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}i(Zr,"Fn");s(Zr,"useCameraStatus");function Qr(e){return At(e,"mobileRequired")}i(Qr,"qn");s(Qr,"useMobileRequired");function Wr(e){return At(e,"returning").required}i(Wr,"Dn");s(Wr,"useReturning");function At(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let a=e?.[t];if(e===void 0||typeof a!="function"){r({required:!1,settled:!0});return}let o=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(l=>{o&&r({required:l===!0,settled:!0})},()=>{o&&r({required:!1,settled:!0})}),()=>{o=!1}},[e,t]),n}i(At,"jn");s(At,"useFlag");function Yr(e){let t=s(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let o=e?.captureMode,l=e?.captureChoice??null;if(e===void 0||typeof o!="function"){r({session:"self",choice:l,settled:!0});return}let u=!0;return r({session:"self",choice:l,settled:!1}),Promise.resolve().then(()=>o.call(e)).then(S=>{let h=e.captureChoice??null;u&&r({session:h!==null&&S===h?"choice":S==="assisted"||S==="choice"?S:"self",choice:h,settled:!0})},()=>{u&&r({session:"self",choice:null,settled:!0})}),()=>{u=!1}},[e]);let a=(0,pe.useCallback)(o=>{e?.chooseCaptureMode?.(o),r(l=>({...l,choice:o}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:a}}i(Yr,"$n");s(Yr,"useCaptureMode");function Jr(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),a=e.on("result",()=>n(!1));return()=>{r(),a()}},[e]),t}i(Jr,"zn");s(Jr,"useBusy");var Bn=s(()=>"idle","serverSnapshot");function St(e){return Tn(e!==void 0?{assetBaseUrl:e}:{})}i(St,"Wn");s(St,"preload");function Xr(e,t=!0){let n=(0,Q.useSyncExternalStore)((0,Q.useCallback)(h=>Pn(h,e),[e]),()=>jn(e),Bn),[r,a]=(0,Q.useState)(null),o=(0,Q.useRef)(!1),l=(0,Q.useCallback)(()=>{St(e).then(h=>{o.current&&h==="idle"&&a({base:e})})},[e]);(0,Q.useEffect)(()=>(o.current=!0,l(),()=>{o.current=!1}),[l]);let u=(0,Q.useRef)(null);(0,Q.useEffect)(()=>{if(n!=="idle"){u.current={base:e};return}!t||u.current===null||u.current.base!==e||(u.current=null,l())},[n,e,l,t]);let S=(0,Q.useCallback)(()=>{St(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:S}}i(Xr,"Qn");s(Xr,"useLivenessAssets");var br={progress:0,hint:null,faceDetected:!1};function en(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,M.useRef)(e.verification).current,a=(0,M.useRef)(!1);e.verification!==r&&!a.current&&Rt()&&(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 o=(0,M.useRef)(null),[l,u]=(0,M.useState)("idle"),[S,h]=(0,M.useState)(br),[w,x]=(0,M.useState)(!1),[I,d]=(0,M.useState)(!1),[N,L]=(0,M.useState)(null),[p,j]=(0,M.useState)(!1),[C,A]=(0,M.useState)(null),[O,H]=(0,M.useState)(null),[f,D]=(0,M.useState)(null),[oe,le]=(0,M.useState)(null),[c,V]=(0,M.useState)(null),[T,G]=(0,M.useState)(!1),B=(0,M.useRef)(null),ve=(0,M.useRef)("idle"),he=(0,M.useRef)(-1),[K,z]=(0,M.useState)(0),te=(0,M.useRef)(e);te.current=e,(0,M.useEffect)(()=>{let J=t.current;if(J===null)return;let ce={video:J,...n!==void 0?{assetBaseUrl:n}:{}},$=r!==void 0?r.liveness(ce):qn(ce);o.current=$;let Ne=s(()=>V($.facingMode??null),"readFacing");Ne();let He=[$.on("state",b=>{b==="mode_switch"?G(!0):b!=="starting"&&b!=="gating"&&G(!1),b==="starting"?(ve.current!=="starting"&&(he.current+=1,z(Math.max(0,he.current))),H(null),D(null),h(br),d(!1),x(!1),L(null),A(null),B.current=null):b==="gating"&&ve.current==="recording"&&(d(!1),x(!1),L(null),B.current=null),ve.current=b,Ne(),u(b),te.current.onStateChange?.(b)}),$.on("gate",b=>{let ke=B.current;B.current=b.progress,x(ke!==null&&b.progress<ke-.001&&b.progress>0&&b.progress<1),b.progress>=1&&d(!0),h(b)}),$.on("frozen",({previewDataUrl:b})=>L(b)),$.on("profile",({animations:b})=>j(b==="reduced")),$.on("ramp",({colour:b})=>A(b)),$.on("captured",b=>{H(b),le(null),te.current.onCaptured?.(b)}),$.on("error",b=>{D(b);let ke=r?.reportCaptureIssue;ke!==void 0&&kt(Ee=>ke.call(r,Ee),gr("liveness",b,Math.max(0,he.current))),te.current.onError?.(b)}),r?.on("result",b=>{le(b),te.current.onResult?.(b)})];return()=>{for(let b of He)b?.();o.current=null,$.destroy()}},[r,t,n]);let R=(0,M.useCallback)(()=>{o.current?.start()},[]),xe=(0,M.useCallback)(()=>{o.current?.retry()},[]),ge=(0,M.useCallback)(async()=>{let J=o.current;return J===null||typeof J.canSwitchCaptureMode!="function"?!1:await J.canSwitchCaptureMode().catch(()=>!1)===!0},[]),P=(0,M.useCallback)(async J=>{let ce=o.current;if(ce===null||typeof ce.setCaptureMode!="function")return!1;let $=await ce.setCaptureMode(J).catch(()=>!1)===!0;return $&&V(ce.facingMode??null),$},[]);return{state:l,gate:S,draining:w,gateLocked:I,frozenPreview:N,reduceMotion:p,rampColour:C,artifacts:O,error:f,result:oe,facingMode:c,start:R,retry:xe,canSwitchCaptureMode:ge,setCaptureMode:P,modeRestarted:T,attempt:K}}i(en,"Xn");s(en,"useLivenessHandle");var On=new Set(["national_number"]);function xt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>On.has(n));return t.length>0?{...e,options:t}:null}i(xt,"er");s(xt,"pending");function tn(e){let[t,n]=(0,me.useState)(null),[r,a]=(0,me.useState)(e===void 0),[o,l]=(0,me.useState)(!1),[u,S]=(0,me.useState)(!1);(0,me.useEffect)(()=>{if(n(null),e===void 0){a(!0);return}let x=!0,I=e.methodChoice;typeof I=="function"?(a(!1),Promise.resolve().then(()=>I.call(e)).then(N=>{x&&n(xt(N))},()=>{}).finally(()=>{x&&a(!0)})):a(!0);let d=e.on("method",N=>n(xt(N)));return()=>{x=!1,d()}},[e]);let h=(0,me.useCallback)(async x=>{if(e===void 0)return!1;l(!0),S(!1);try{return await e.selectMethod(x),n(null),!0}catch{return S(!0),!1}finally{l(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!u?w:null,settled:r,busy:o,failed:u,select:h}}i(tn,"tr");s(tn,"useMethodChoice");var Vn=["ar","fr","en"];function rn(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}}i(rn,"oo");s(rn,"isClipUrl");function nn(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of Vn){let a=t[r];if(!(typeof a!="object"||a===null))for(let[o,l]of Object.entries(a))!nt(o)||!rn(l)||((n[r]??(n[r]={}))[o]=l)}return Object.keys(n).length>0?n:null}i(nn,"so");s(nn,"toVoiceClipMap");function sn(e){let[t,n]=(0,Te.useState)(null);(0,Te.useEffect)(()=>{if(n(null),e===void 0)return;let a=!0,o=s(u=>{if(!a)return;let S=typeof u=="object"&&u!==null&&typeof u.setId=="string"?u:null;n(h=>h?.setId===S?.setId?h:S)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(o,()=>o(null))}catch{o(null)}let l=e.on("view",u=>o(u.voice));return()=>{a=!1,l()}},[e]);let r=(0,Te.useMemo)(()=>t!==null?nn(t):null,[t]);return e===void 0?null:r}i(sn,"nr");s(sn,"useServerVoiceClips");function an({voice:e}){let t=Re();return(0,Nt.jsx)(X,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:i(()=>e.toggle(),"onClick"),children:(0,Nt.jsx)(rt,{off:!e.enabled,className:"sekyro-icon"})})}i(an,"or");s(an,"VoiceChip");var $n=new Set(["abandoned","not_opened","cancelled","superseded"]),Fn=800;function on(e){return e===void 0||e!==!1&&e.length===_t.length&&_t.every(t=>e.includes(t))}i(on,"uo");s(on,"isDefaultTips");function ln(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}i(ln,"po");s(ln,"carriesActivation");function cn(e){return typeof e=="object"&&e!==null&&!(0,y.isValidElement)(e)&&"tone"in e&&"text"in e}i(cn,"fo");s(cn,"isNoticeObject");var Hn=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function un(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}i(un,"yo");s(un,"isCapturing");function dn(e){return e==="captured"||e==="uploading"||e==="checking"}i(dn,"go");s(dn,"isPostCapture");function Dn({verification:e,locale:t,dir:n,strings:r,slots:a,autoStart:o=!1,notice:l,startDisabled:u=!1,startLabel:S,tips:h,tipsSummary:w,coach:x,voice:I,onGuidance:d,onCaptured:N,onResult:L,onError:p,onStateChange:j,assetBaseUrl:C,className:A}){let O=ur(t),H=(0,y.useMemo)(()=>cr(t,r),[t,r,O]),f=(0,y.useMemo)(()=>g=>H[g]??"",[H]),D=n??(t==="ar"?"rtl":"ltr"),oe=(0,y.useRef)(null),le=(0,y.useContext)(In),c=en({verification:e,videoRef:oe,assetBaseUrl:C,onCaptured:N,onResult:L,onError:p,onStateChange:j}),V=Xr(C,c.state==="idle"&&c.error===null),T=tn(e),G=T.choice!==null,B=Qr(e),ve=Wr(e),he=Jr(e),K=Zr(),z=Yr(e),te=z.session==="choice",R=z.mode==="assisted",xe=I!==!1&&I?.clips===void 0,ge=sn(xe?e:void 0),P=Vr({locale:t,defaultClips:ge,options:I}),J=R?"environment":"user",ce=z.settled,$=(0,y.useRef)(null),Ne=(0,y.useRef)(!1),He=(0,y.useRef)(P.unlock);He.current=P.unlock,(0,y.useEffect)(()=>{let g=$.current;if(g===null)return;let ne=["pointerup","touchend","click","keydown"],Ce=s(()=>{for(let Oe of ne)g.removeEventListener(Oe,Le,!0)},"disarm");function Le(Oe){if(Ne.current){Ce();return}ln(Oe)&&(Ne.current=!0,Ce(),He.current())}i(Le,"Re"),s(Le,"onGesture");for(let Oe of ne)g.addEventListener(Oe,Le,{capture:!0,passive:!0});return Ce},[]);let b=(0,y.useCallback)(()=>{Ne.current||(Ne.current=!0,P.unlock()),c.start()},[P.unlock,c.start]),ke=(0,y.useCallback)(()=>c.start(),[c.start]),Ee=(0,y.useRef)(!1),Pe=c.state==="idle"&&c.error===null,It=!G&&!B.required&&(o===!0||o==="when-permitted"&&K.permission==="granted"),Ut=It&&T.settled&&B.settled&&ce,fn=o==="when-permitted"&&!K.permissionSettled&&!Ee.current,jt=It&&Pe&&!Ee.current,ct=(fn||jt||!ce)&&V.gate==="ready"?"loading":V.gate;(0,y.useEffect)(()=>{!Ut||!Pe||V.gate!=="ready"||Ee.current||(Ee.current=!0,ke())},[Ut,Pe,V.gate,ke]);let mn=Pe&&!G&&!B.required&&!(jt&&V.gate==="ready"),[Tt,Pt]=(0,y.useState)(!1),{canSwitchCaptureMode:Bt,setCaptureMode:qt}=c;(0,y.useEffect)(()=>{if(!z.settled||!te){Pt(!1);return}let g=!0;return Bt().then(ne=>{g&&Pt(ne)}),()=>{g=!1}},[z.settled,te,Bt]);let{choose:Ot}=z,Ie=R?"self":"assisted",yn=(0,y.useCallback)(async()=>{await qt(Ie)&&Ot(Ie)},[qt,Ot,Ie]),Vt=c.state!=="idle"&&c.facingMode!==null?c.facingMode:J;(0,y.useEffect)(()=>{let g=oe.current?.style;Vt==="user"?g?.removeProperty("transform"):g&&(g.transform="none")},[Vt]);let De=(0,y.useMemo)(()=>c.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(c.artifacts.keyframe):null,[c.artifacts]);(0,y.useEffect)(()=>{if(De!==null)return()=>URL.revokeObjectURL(De)},[De]);let $t=c.frozenPreview??De,Ue=e!==void 0,Z=un(c.state),be=dn(c.state),Ge=Z||be,re=c.result,Ft=c.state==="done"&&re!==null,ut=c.state==="recording"&&c.frozenPreview!==null,Ke=le!==null,Ht=Tt&&Z&&!ut?{to:Ie,label:f(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:f(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:s(()=>{yn()},"onSwitch")}:null,ze=c.modeRestarted&&Z?f("capture.modeSwitch.restarted"):null,Be=be||ut,Dt=be?"checking":ut?"frozen":c.state==="recording"?"recording":c.gateLocked||c.gate.progress>=1?"locked":c.gate.faceDetected?"aligning":"seeking",Ze=Z?c.gate.hint:null,Qe=c.state==="starting"?"capture.preparing.title":Ze===null?null:Ze==="center"&&!c.gate.faceDetected?"fcv3.no_face":ar(Ze),[vn,Gt]=(0,y.useState)(null);(0,y.useEffect)(()=>{if(Qe!=="fcv3.no_face"){Gt(Qe);return}if(!Z)return;let g=setTimeout(()=>Gt(Qe),Fn);return()=>clearTimeout(g)},[Qe,Z]);let dt=Z&&typeof x=="string"&&x!=="",Kt=R&&Z?f("capture.assisted.stage"):null,Me=Z&&!dt?vn:null,pt=dt?x:Me===null?"":f(Me);$r(P,Me,pt,Z);let zt=(0,y.useRef)(d);zt.current=d,(0,y.useEffect)(()=>{if(nt(Me))try{zt.current?.(Me)}catch(g){console.error("[@sekyro/react] onGuidance threw:",g)}},[Me]);let qe=(0,y.useMemo)(()=>({supported:P.supported,enabled:P.enabled,setEnabled:P.setEnabled,toggle:P.toggle}),[P.supported,P.enabled,P.setEnabled,P.toggle]),ht=a?.voicePrompt,Zt=ht!==void 0,Qt=I===void 0,Wt=(0,y.useRef)(!1);(0,y.useEffect)(()=>{!Zt||!Qt||Wt.current||!Rt()||(Wt.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."))},[Zt,Qt]);let gn=ht!==void 0?(g,ne,Ce)=>ht(g,ne,Ce,qe):P.supported?()=>(0,k.jsx)(an,{voice:qe}):void 0,{summary:ft,summaryPlaying:Yt,toggleSummary:Jt,stopSummary:Xt}=P,We=w!==void 0&&w!=="",er=We?w:f("capture.tips.summary"),tr=We?ft!=="none":ft==="partner"||ft==="default"&&on(h),kn=(0,y.useMemo)(()=>tr?{playing:Yt,toggle:s(()=>Jt(er,{clip:!We}),"toggle"),stop:Xt}:void 0,[tr,Yt,Jt,er,Xt,We]),bn=(0,y.useMemo)(()=>({assets:ct,retryAssets:V.retry,permission:K.permission,permissionSettled:K.permissionSettled,captureMode:z.mode,facing:J,voice:qe}),[ct,V.retry,K.permission,K.permissionSettled,z.mode,J,qe]),_n=cn(l)?(0,k.jsx)(se,{tone:l.tone,testId:"sekyro-host-notice",children:(0,k.jsx)("span",{children:l.text})}):l??null,ue=re!==null&&re.status==="retry"?re:null,W=Ft&&re.status==="unavailable"&&!G&&re.reasonCode!=="portrait_required"?re:null,_e=Ft&&(re.status==="verified"||re.status==="not_verified"||re.status==="review")?re:null,mt=s((g,ne)=>{if(g===void 0)return null;if(g==="device_cooldown"){let Le=or(t,ne);if(Le!==null)return f(Le.key).replace("{time}",Le.time)}let Ce=Xe(g);return Ce===null?null:f(Ce)},"reasonText"),yt=s(g=>{let ne=g.retakeHint===void 0?null:Je(g.retakeHint);return ne===null?mt(g.reasonCode):f(ne)},"retryText"),rr=_e===null?null:mt(_e.reasonCode,_e.retryAfter)??(_e.status==="not_verified"&&_e.reason!==void 0&&$n.has(_e.reason)?f("errors.session_expired"):null),Cn=W!==null&&W.reasonCode!==void 0&&W.reasonCode!=="nni_unbound"&&W.reasonCode!=="id_number_unbound"&&W.reasonCode!=="method_required"&&W.reasonCode!=="mobile_required"&&!(W.reasonCode==="no_recorder"&&c.artifacts?.degraded==="NO_RECORDER"),Ye=W?.reasonCode,nr=c.attempt;(0,y.useEffect)(()=>{W===null||Ye===void 0||e?.reportCaptureIssue===void 0||Hn.has(Ye)||kt(g=>e.reportCaptureIssue?.(g),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Ye,attempt:Math.min(1e3,nr)})},[W,Ye,nr,e]);let sr=gt(),wn=G&&T.auto===null&&!Z&&!be&&c.error===null,vt=(0,y.useCallback)(async g=>{await T.select(g)&&c.state==="done"&&c.retry()},[T.select,c.state,c.retry]);return(0,y.useEffect)(()=>{T.auto!==null&&!T.busy&&!Z&&!be&&vt(T.auto)},[T.auto,T.busy,Z,be,vt]),(0,k.jsx)(dr,{value:f,children:(0,k.jsxs)("div",{ref:$,className:A===void 0?"sekyro-capture":`sekyro-capture ${A}`,dir:D,lang:t,"data-testid":"sekyro-liveness-capture","data-state":c.state,children:[a?.header,ue!==null&&yt(ue)!==null&&!(Ke&&Ge)?(0,k.jsx)(se,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,k.jsx)("span",{children:yt(ue)})}):null,ze!==null&&!Ke?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,k.jsx)("span",{children:ze})}):null,he&&be&&!Ke?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,k.jsx)("span",{children:f("capture.busy")})}):null,B.required&&Pe?(0,k.jsx)(se,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,k.jsx)("span",{children:f("reasons.mobile_required")})}):null,c.error!==null?a?.errorPanel!==void 0?a.errorPanel(c.error,c.retry):(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-error-notice",children:[(0,k.jsx)("span",{children:f(ir(c.error))}),c.error.retryable?(0,k.jsx)(X,{ref:sr,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f("common.retry")}):null]}):null,W!==null?(0,k.jsxs)(se,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,k.jsx)("span",{children:mt(W.reasonCode)??f(W.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),Cn?(0,k.jsx)(X,{ref:sr,kind:"ghost",className:"sekyro-btn--start",onClick:c.retry,children:f("capture.recordAgain")}):null]}):null,rr!==null&&_e!==null?(0,k.jsx)(se,{tone:_e.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,k.jsx)("span",{children:rr})}):null,(0,k.jsx)("div",{className:Ge?void 0:"sekyro-hidden","data-capture-live":Ge?"":void 0,children:Ke?le({videoRef:oe,guidance:Be&&Ue?f("capture.checking"):pt,coached:dt&&!(Be&&Ue),note:Be?Ue?f(he?"capture.busy":"capture.checkingHint"):null:ze??(ue!==null?yt(ue):Kt),settled:Be&&Ue,progress:c.gate.progress,phase:Dt,still:Be?$t:null,live:Ge,modeSwitch:Ht,...Tt?{status:ze}:{},ramp:c.rampColour===null?null:{colour:c.rampColour}}):(0,k.jsx)(pr,{videoRef:oe,guidanceText:pt,guidanceHint:Ze,guidanceKey:Me,progress:c.gate.progress,phase:Dt,draining:c.draining,stillUrl:$t,showChecking:Ue,operatorText:Kt,voicePrompt:gn,overlay:i(g=>(0,k.jsxs)(k.Fragment,{children:[a?.stageOverlay?.(g),(0,k.jsx)(hr,{colour:c.rampColour})]}),"overlay"),reduceMotion:c.reduceMotion,modeSwitch:Ht})}),wn&&T.choice!==null?(0,k.jsx)(Ir,{title:f("method.title"),description:f("method.description"),options:T.choice.options.map(g=>({id:g,label:f(`method.${g}`)})),busy:T.busy,error:T.failed?f("errors.network_error"):null,focus:c.state==="done",testId:"sekyro-method",look:"buttons",onChoose:i(g=>{vt(g)},"onChoose")}):null,mn?(0,k.jsxs)(k.Fragment,{children:[ve&&a?.header===void 0&&a?.intro===void 0?(0,k.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,k.jsx)("h2",{className:"sekyro-text-body",children:f("returning.title")}),(0,k.jsx)("p",{className:"sekyro-text-muted",children:f("returning.description")})]}):null,_n,a?.intro!==void 0?a.intro(b,bn):(0,k.jsx)(Kr,{assets:ct,onRetryAssets:V.retry,permission:K.permission,captureMode:z.mode,voice:qe,tips:h??_t,summary:kn,startLabel:S,startDisabled:u,onStart:b})]}):null,(0,k.jsx)(Fr,{showCoaching:ue!==null,coaching:at(ue?.reasonCode),attemptsText:ue?.attemptsRemaining!==void 0?lr(H,t,ue.attemptsRemaining):null,showRetake:ue!==null&&!Z&&!be||!Ue&&c.state==="captured",onRetake:c.retry}),a?.footer]})})}i(Dn,"_i");s(Dn,"LivenessCapture");var Et=E(F(),1),lt=E(F(),1),m=E(de(),1);import{isInAppBrowser as Jn}from"@sekyro/web/client";var vs={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function Gn(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=e.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}i(Gn,"Y");s(Gn,"identityLabel");function Kn(e,t){let[n,r]=(0,Et.useState)(!1),[a,o]=(0,Et.useState)(null);return{busy:n,error:a,run:s(l=>{r(!0),o(null),l().then(()=>r(!1),u=>{r(!1),o(e.t(kr(u,e.strings))),t?.(u)})},"run")}}i(Kn,"q");s(Kn,"useChoiceAction");function pn(){let e=`sekyro-face-light-${(0,lt.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,m.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,m.jsx)("defs",{children:(0,m.jsx)("mask",{id:e,children:(0,m.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,m.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,m.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,m.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}i(pn,"O");s(pn,"FaceMark");var zn={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function Zn(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}i(Zn,"te");s(Zn,"faceIntroRetryOf");var Qn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function Wn({start:e,context:t,tips:n,tipsTitle:r,human:a=!1,returning:o=!1,notice:l,retry:u}){let S=bt(),{t:h}=S,w=u===void 0?"face":at(u.reason),x=w==="face"?null:Fe[w].tips,I=(0,lt.useContext)(mr)?.busy===!0;return(0,m.jsxs)("section",{className:"sekyro-step",children:[(0,m.jsx)(pn,{}),t.captureMode==="assisted"?(0,m.jsx)(et,{title:h("capture.assisted.heading"),lead:h("capture.assisted.lead")}):o?(0,m.jsx)(et,{title:h("returning.heading"),lead:h("returning.description")}):(0,m.jsx)(et,{title:h(a?"native.face.humanIntroTitle":"native.face.introTitle"),lead:h(a?"native.face.humanIntroLead":"native.face.introLead")}),u!==void 0?(0,m.jsx)(hn,{retry:u,title:Fe[w].title}):null,r!==void 0&&x===null?(0,m.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,m.jsx)("ul",{className:"sekyro-tiprows",children:x!==null?x.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:Qn[d]??"face"}),h(d)]},d)):n!==void 0?n.map(d=>(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:zn[d.id]??"face"}),d.text]},d.id)):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"light"}),h("capture.tips.light")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"jGlasses"}),h("capture.tips.uncover")]}),(0,m.jsxs)("li",{children:[(0,m.jsx)(Ae,{name:"smartphone"}),h("capture.tips.eyeLevel")]})]})}),l??null,l!==void 0?null:t.assets==="failed"?(0,m.jsx)(X,{kind:"secondary",full:!0,onClick:t.retryAssets,children:h("common.retry")}):null,l!==void 0?null:(0,m.jsx)(fr,{children:(0,m.jsxs)(X,{full:!0,disabled:t.assets!=="ready"||I,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,m.jsx)(Ae,{name:"camera"}),h("capture.start")]})})]})}i(Wn,"ne");s(Wn,"FaceIntro");var Yn=new Set(["match_inconclusive","no_face_source","below_threshold"]);function hn({retry:e,title:t}){let n=bt(),r=e.retakeHint===void 0?null:Je(e.retakeHint),a=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":Yn.has(e.reason)?"capture.retryMatch.message":Xe(e.reason);return(0,m.jsxs)(yr,{tone:"warning",children:[r!==null?(0,m.jsx)("span",{children:n.t(r)}):a!==null?(0,m.jsx)("span",{children:n.t(a)}):null,r===null?(0,m.jsx)("span",{children:n.t(t)}):null,(0,m.jsx)("span",{children:vr(n,e.attemptsRemaining,e.attemptsExhausted)})]})}i(hn,"T");s(hn,"RetryNotice");function Xn(e){return Jn(e)}i(Xn,"se");s(Xn,"isInAppBrowser");function es(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let a=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${a};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}i(es,"ce");s(es,"androidBrowserIntent");export{Ir as a,Rt as b,In as c,Yr as d,Dn as e,vs as f,Gn as g,Kn as h,Zn as i,Wn as j,Xn as k,es as l};
@@ -1 +1 @@
1
- import{a as C,d as f,e as l,f as d,g as m,h as v,i as p,j as g,l as x}from"./chunk-APM7FCA2.js";import{a as o,c as b,i}from"./chunk-SSU37LFQ.js";var r=b(C(),1);var y={ar:l,fr:d,en:f};function h(e,t){let s=v(e),a=s===void 0?y[m(e)]:{...y.en,...s};if(t===void 0)return a;let n={...a};for(let u of Object.keys(t)){let c=t[u];typeof c=="string"&&(n[u]=c)}return x(n,t),n}o(h,"T");i(h,"resolveStrings");function j(e){let[,t]=(0,r.useState)(0),s=p(e);return(0,r.useEffect)(()=>{if(!s)return;let a=!0;return g(e).then(()=>a&&t(n=>n+1)),()=>{a=!1}},[e,s]),!s}o(j,"w");i(j,"useLocaleReady");var S=(0,r.createContext)(e=>f[e]??""),E=S.Provider;function k(){return(0,r.useContext)(S)}o(k,"I");i(k,"useStrings");export{h as a,j as b,E as c,k as d};
1
+ import{a as C,d as f,e as l,f as d,g as m,h as v,i as p,j as g,l as x}from"./chunk-YQ7XHAQJ.js";import{a as o,c as b,i}from"./chunk-SSU37LFQ.js";var r=b(C(),1);var y={ar:l,fr:d,en:f};function h(e,t){let s=v(e),a=s===void 0?y[m(e)]:{...y.en,...s};if(t===void 0)return a;let n={...a};for(let u of Object.keys(t)){let c=t[u];typeof c=="string"&&(n[u]=c)}return x(n,t),n}o(h,"T");i(h,"resolveStrings");function j(e){let[,t]=(0,r.useState)(0),s=p(e);return(0,r.useEffect)(()=>{if(!s)return;let a=!0;return g(e).then(()=>a&&t(n=>n+1)),()=>{a=!1}},[e,s]),!s}o(j,"w");i(j,"useLocaleReady");var S=(0,r.createContext)(e=>f[e]??""),E=S.Provider;function k(){return(0,r.useContext)(S)}o(k,"I");i(k,"useStrings");export{h as a,j as b,E as c,k as d};
@@ -1,4 +1,4 @@
1
- import{d as H}from"./chunk-CFERAKA2.js";import{a as T,b as C,c as D}from"./chunk-APM7FCA2.js";import{a as s,b as L,c as N,i as u}from"./chunk-SSU37LFQ.js";var V=L(l=>{"use strict";var Q=T();function I(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}s(I,"formatProdErrorMessage");function h(){}s(h,"noop");var c={d:{f:h,r:s(function(){throw Error(I(522))},"r"),D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},ee=Symbol.for("react.portal");function re(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ee,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}s(re,"createPortal$1");var O=Q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function M(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}s(M,"getCrossOriginStringAs");l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c;l.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(I(299));return re(r,e,null,t)};l.flushSync=function(r){var e=O.T,t=c.p;try{if(O.T=null,c.p=2,r)return r()}finally{O.T=e,c.p=t,c.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,c.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&c.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin),o=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?c.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:o,fetchPriority:i}):t==="script"&&c.d.X(r,{crossOrigin:n,integrity:o,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=M(e.as,e.crossOrigin);c.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&c.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin);c.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=M(e.as,e.crossOrigin);c.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else c.d.m(r)};l.requestFormReset=function(r){c.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,t){return O.H.useFormState(r,e,t)};l.useFormStatus=function(){return O.H.useHostTransitionStatus()};l.version="19.2.0"});var B=L((de,U)=>{"use strict";function j(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j)}catch(r){console.error(r)}}s(j,"checkDCE");j(),U.exports=V()});var W=N(T(),1),f=N(C(),1),a=N(C(),1),E=N(T(),1),Z=N(B(),1),v=N(C(),1);import{screenRampColourValue as Y}from"@sekyro/web";var te=Array.from({length:56},(r,e)=>{let t=e/56*2*Math.PI-Math.PI/2,n=Math.cos(t),o=Math.sin(t);return{id:`tick-${e}`,frac:e/55,x1:150+108*n,y1:150+108*o,x2:150+138*n,y2:150+138*o,style:{transitionDelay:`${e*6}ms`}}});function z(r,e,t,n){return t?"var(--sekyro-color-success)":r?n?"color-mix(in srgb, var(--sekyro-color-warning) 75%, transparent)":e<.33?"color-mix(in srgb, var(--sekyro-color-brand) 55%, transparent)":e<.66?"color-mix(in srgb, var(--sekyro-color-brand) 80%, transparent)":"var(--sekyro-color-brand)":"color-mix(in srgb, var(--sekyro-color-surface) 32%, transparent)"}s(z,"T");u(z,"tickColor");var ae="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function F({progress:r,phase:e,draining:t=!1}){let n=Math.min(1,Math.max(0,r)),o=Math.round(n*56),i=e==="checking",y=e==="recording",d=e==="frozen",m=i||d,p=i||y||d,k=e==="locked"||p,S=t&&!k;return(0,f.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 300 300",preserveAspectRatio:"xMidYMid meet",className:"sekyro-stage__arc","data-testid":"sekyro-capture-arc","data-phase":e,"data-filled":o,"data-recording":y?"":void 0,"data-draining":S?"":void 0,children:[(0,f.jsx)("path",{fillRule:"evenodd",d:ae,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":m?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),(0,f.jsxs)("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[(0,f.jsx)("g",{className:m?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:te.map((g,x)=>(0,f.jsx)("line",{x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:z(x<o,g.frac,k,S),strokeWidth:3,strokeLinecap:"round",style:g.style,className:"sekyro-arc__tick"},g.id))}),(0,f.jsx)("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:(0,f.jsx)("circle",{cx:150,cy:150,r:100,fill:"none",stroke:k?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:k?3.5:2.5,className:p?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}s(F,"x");u(F,"CaptureArc");function ne({videoRef:r,guidanceText:e,guidanceHint:t,guidanceKey:n,progress:o,phase:i,draining:y=!1,stillUrl:d,showChecking:m,operatorText:p=null,voicePrompt:k,overlay:S,reduceMotion:g=!1,modeSwitch:x=null}){let b=H(),R=i==="checking",_=R||i==="frozen",A=_&&m?b("capture.checking"):e,w=k?.(t,A,n);return(0,a.jsxs)("div",{className:g?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[(0,a.jsx)("video",{ref:r,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),d!==null&&_?(0,a.jsx)("img",{src:d,alt:b("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,(0,a.jsx)(F,{progress:o,phase:i,draining:y}),S?.(r),w!=null&&!_?(0,a.jsx)("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:w}):null,x!==null&&!_?(0,a.jsx)(G,{view:x,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,R&&m?(0,a.jsxs)("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[(0,a.jsx)(K,{}),b("capture.cameraOff")]}):null,(0,a.jsxs)("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[(0,a.jsx)("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:A},A),_&&m?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint",children:b("capture.checkingHint")}):p!==null&&!_?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}s(ne,"ne");u(ne,"CaptureStage");function G({view:r,className:e,kind:t}){let n=(0,W.useId)(),o=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)($,{}),(0,a.jsx)("span",{children:r.label})]}),i={onClick:r.onSwitch,"aria-describedby":n,"data-testid":"sekyro-capture-mode-switch","data-mode":r.to};return(0,a.jsxs)(a.Fragment,{children:[t==="chip"?(0,a.jsx)(D,{kind:"chip",className:e,...i,children:o}):(0,a.jsx)("button",{type:"button",className:e,...i,children:o}),(0,a.jsx)("span",{id:n,className:"sekyro-visually-hidden",children:r.description})]})}s(G,"H");u(G,"ModeSwitchChip");function $(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),(0,a.jsx)("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}s($,"D");u($,"FlipCameraIcon");function K(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon sekyro-icon--sm",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M3 3l18 18"})]})}s(K,"G");u(K,"CameraOffIcon");var ie=typeof window>"u"?E.useEffect:E.useLayoutEffect,P="data-sekyro-ramp",se=[["background-color","transparent"],["background-image","none"]];function q(r){let e=[],t=r.ownerDocument;for(let i=r;i!==null&&i!==t.documentElement;i=i.parentElement){if(!(i instanceof HTMLElement)&&!(i instanceof SVGElement))continue;let y=i.style;for(let[d,m]of se){let p=y.getPropertyValue(d),k=y.getPropertyPriority(d);y.setProperty(d,m,"important"),e.push(()=>{p===""?y.removeProperty(d):y.setProperty(d,p,k)})}}let n=t.documentElement,o=n.hasAttribute(P);return n.setAttribute(P,""),o||e.push(()=>n.removeAttribute(P)),()=>{for(let i of e.reverse())i()}}s(q,"z");u(q,"clearAncestorBackdrops");function X(r){return{position:"fixed",inset:0,minWidth:"100vw",minHeight:"100lvh",margin:0,padding:0,border:0,zIndex:-1,pointerEvents:"none",backgroundColor:Y(r)}}s(X,"B");u(X,"washStyle");function J(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:Y(r)}}s(J,"Y");u(J,"coverStyle");function oe({colour:r}){let e=(0,E.useRef)(null),t=r!==null;return ie(()=>{let n=e.current?.parentElement;if(!(!t||n===null||n===void 0))return q(n)},[t]),r===null||typeof document>"u"?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{ref:e,"aria-hidden":"true","data-testid":"sekyro-screen-ramp-cover","data-colour":r,style:J(r)}),(0,Z.createPortal)((0,v.jsx)("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":r,style:X(r)}),document.body)]})}s(oe,"de");u(oe,"ScreenRampLayer");export{B as a,ne as b,G as c,oe as d};
1
+ import{d as H}from"./chunk-KHBP6WWR.js";import{a as T,b as C,c as D}from"./chunk-YQ7XHAQJ.js";import{a as s,b as L,c as N,i as u}from"./chunk-SSU37LFQ.js";var V=L(l=>{"use strict";var Q=T();function I(r){var e="https://react.dev/errors/"+r;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var t=2;t<arguments.length;t++)e+="&args[]="+encodeURIComponent(arguments[t])}return"Minified React error #"+r+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}s(I,"formatProdErrorMessage");function h(){}s(h,"noop");var c={d:{f:h,r:s(function(){throw Error(I(522))},"r"),D:h,C:h,L:h,m:h,X:h,S:h,M:h},p:0,findDOMNode:null},ee=Symbol.for("react.portal");function re(r,e,t){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ee,key:n==null?null:""+n,children:r,containerInfo:e,implementation:t}}s(re,"createPortal$1");var O=Q.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function M(r,e){if(r==="font")return"";if(typeof e=="string")return e==="use-credentials"?e:""}s(M,"getCrossOriginStringAs");l.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c;l.createPortal=function(r,e){var t=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)throw Error(I(299));return re(r,e,null,t)};l.flushSync=function(r){var e=O.T,t=c.p;try{if(O.T=null,c.p=2,r)return r()}finally{O.T=e,c.p=t,c.d.f()}};l.preconnect=function(r,e){typeof r=="string"&&(e?(e=e.crossOrigin,e=typeof e=="string"?e==="use-credentials"?e:"":void 0):e=null,c.d.C(r,e))};l.prefetchDNS=function(r){typeof r=="string"&&c.d.D(r)};l.preinit=function(r,e){if(typeof r=="string"&&e&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin),o=typeof e.integrity=="string"?e.integrity:void 0,i=typeof e.fetchPriority=="string"?e.fetchPriority:void 0;t==="style"?c.d.S(r,typeof e.precedence=="string"?e.precedence:void 0,{crossOrigin:n,integrity:o,fetchPriority:i}):t==="script"&&c.d.X(r,{crossOrigin:n,integrity:o,fetchPriority:i,nonce:typeof e.nonce=="string"?e.nonce:void 0})}};l.preinitModule=function(r,e){if(typeof r=="string")if(typeof e=="object"&&e!==null){if(e.as==null||e.as==="script"){var t=M(e.as,e.crossOrigin);c.d.M(r,{crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0})}}else e==null&&c.d.M(r)};l.preload=function(r,e){if(typeof r=="string"&&typeof e=="object"&&e!==null&&typeof e.as=="string"){var t=e.as,n=M(t,e.crossOrigin);c.d.L(r,t,{crossOrigin:n,integrity:typeof e.integrity=="string"?e.integrity:void 0,nonce:typeof e.nonce=="string"?e.nonce:void 0,type:typeof e.type=="string"?e.type:void 0,fetchPriority:typeof e.fetchPriority=="string"?e.fetchPriority:void 0,referrerPolicy:typeof e.referrerPolicy=="string"?e.referrerPolicy:void 0,imageSrcSet:typeof e.imageSrcSet=="string"?e.imageSrcSet:void 0,imageSizes:typeof e.imageSizes=="string"?e.imageSizes:void 0,media:typeof e.media=="string"?e.media:void 0})}};l.preloadModule=function(r,e){if(typeof r=="string")if(e){var t=M(e.as,e.crossOrigin);c.d.m(r,{as:typeof e.as=="string"&&e.as!=="script"?e.as:void 0,crossOrigin:t,integrity:typeof e.integrity=="string"?e.integrity:void 0})}else c.d.m(r)};l.requestFormReset=function(r){c.d.r(r)};l.unstable_batchedUpdates=function(r,e){return r(e)};l.useFormState=function(r,e,t){return O.H.useFormState(r,e,t)};l.useFormStatus=function(){return O.H.useHostTransitionStatus()};l.version="19.2.0"});var B=L((de,U)=>{"use strict";function j(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j)}catch(r){console.error(r)}}s(j,"checkDCE");j(),U.exports=V()});var W=N(T(),1),f=N(C(),1),a=N(C(),1),E=N(T(),1),Z=N(B(),1),v=N(C(),1);import{screenRampColourValue as Y}from"@sekyro/web";var te=Array.from({length:56},(r,e)=>{let t=e/56*2*Math.PI-Math.PI/2,n=Math.cos(t),o=Math.sin(t);return{id:`tick-${e}`,frac:e/55,x1:150+108*n,y1:150+108*o,x2:150+138*n,y2:150+138*o,style:{transitionDelay:`${e*6}ms`}}});function z(r,e,t,n){return t?"var(--sekyro-color-success)":r?n?"color-mix(in srgb, var(--sekyro-color-warning) 75%, transparent)":e<.33?"color-mix(in srgb, var(--sekyro-color-brand) 55%, transparent)":e<.66?"color-mix(in srgb, var(--sekyro-color-brand) 80%, transparent)":"var(--sekyro-color-brand)":"color-mix(in srgb, var(--sekyro-color-surface) 32%, transparent)"}s(z,"T");u(z,"tickColor");var ae="M0 -50 H300 V350 H0 Z M50 150 a100,100 0 1 0 200,0 a100,100 0 1 0 -200,0 Z";function F({progress:r,phase:e,draining:t=!1}){let n=Math.min(1,Math.max(0,r)),o=Math.round(n*56),i=e==="checking",y=e==="recording",d=e==="frozen",m=i||d,p=i||y||d,k=e==="locked"||p,S=t&&!k;return(0,f.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 300 300",preserveAspectRatio:"xMidYMid meet",className:"sekyro-stage__arc","data-testid":"sekyro-capture-arc","data-phase":e,"data-filled":o,"data-recording":y?"":void 0,"data-draining":S?"":void 0,children:[(0,f.jsx)("path",{fillRule:"evenodd",d:ae,fill:"color-mix(in srgb, var(--sekyro-color-fg) var(--sekyro-scrim, 96%), transparent)",style:{"--sekyro-scrim":m?"100%":"96%"},className:"sekyro-arc__scrim sekyro-capture-fade-in","data-testid":"sekyro-capture-scrim"}),(0,f.jsxs)("g",{className:e==="locked"?"sekyro-capture-settle":void 0,children:[(0,f.jsx)("g",{className:m?"sekyro-arc__ring sekyro-arc__ring--dim":"sekyro-arc__ring",children:te.map((g,x)=>(0,f.jsx)("line",{x1:g.x1,y1:g.y1,x2:g.x2,y2:g.y2,stroke:z(x<o,g.frac,k,S),strokeWidth:3,strokeLinecap:"round",style:g.style,className:"sekyro-arc__tick"},g.id))}),(0,f.jsx)("g",{className:e==="seeking"?"sekyro-capture-breathe":void 0,children:(0,f.jsx)("circle",{cx:150,cy:150,r:100,fill:"none",stroke:k?"var(--sekyro-color-success)":"var(--sekyro-color-surface)",strokeWidth:k?3.5:2.5,className:p?"sekyro-arc__guide sekyro-arc__guide--spin sekyro-capture-ring-spin":"sekyro-arc__guide sekyro-capture-fade-in","data-testid":"sekyro-capture-guide"})})]})]})}s(F,"x");u(F,"CaptureArc");function ne({videoRef:r,guidanceText:e,guidanceHint:t,guidanceKey:n,progress:o,phase:i,draining:y=!1,stillUrl:d,showChecking:m,operatorText:p=null,voicePrompt:k,overlay:S,reduceMotion:g=!1,modeSwitch:x=null}){let b=H(),R=i==="checking",_=R||i==="frozen",A=_&&m?b("capture.checking"):e,w=k?.(t,A,n);return(0,a.jsxs)("div",{className:g?"sekyro-stage sekyro-capture-reduce":"sekyro-stage","data-testid":"sekyro-capture-stage",children:[(0,a.jsx)("video",{ref:r,playsInline:!0,muted:!0,className:"sekyro-stage__video","data-testid":"sekyro-capture-video"}),d!==null&&_?(0,a.jsx)("img",{src:d,alt:b("capture.previewAlt"),className:"sekyro-stage__still sekyro-capture-develop","data-testid":"sekyro-capture-still"}):null,(0,a.jsx)(F,{progress:o,phase:i,draining:y}),S?.(r),w!=null&&!_?(0,a.jsx)("div",{className:"sekyro-stage__corner-start","data-testid":"sekyro-voice-slot",children:w}):null,x!==null&&!_?(0,a.jsx)(G,{view:x,className:"sekyro-stage__corner-end sekyro-stage__mode-switch",kind:"chip"}):null,R&&m?(0,a.jsxs)("span",{className:"sekyro-stage__corner-end sekyro-stage__pill sekyro-capture-pill-in","data-testid":"sekyro-camera-off-pill",children:[(0,a.jsx)(K,{}),b("capture.cameraOff")]}):null,(0,a.jsxs)("p",{"aria-live":"polite",className:"sekyro-stage__guidance","data-testid":"sekyro-capture-guidance",children:[(0,a.jsx)("span",{className:"sekyro-stage__guidance-text sekyro-capture-text-in",children:A},A),_&&m?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint",children:b("capture.checkingHint")}):p!==null&&!_?(0,a.jsx)("span",{className:"sekyro-stage__guidance-hint","data-testid":"sekyro-operator-line",children:p}):null]})]})}s(ne,"ne");u(ne,"CaptureStage");function G({view:r,className:e,kind:t}){let n=(0,W.useId)(),o=(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)($,{}),(0,a.jsx)("span",{children:r.label})]}),i={onClick:r.onSwitch,"aria-describedby":n,"data-testid":"sekyro-capture-mode-switch","data-mode":r.to};return(0,a.jsxs)(a.Fragment,{children:[t==="chip"?(0,a.jsx)(D,{kind:"chip",className:e,...i,children:o}):(0,a.jsx)("button",{type:"button",className:e,...i,children:o}),(0,a.jsx)("span",{id:n,className:"sekyro-visually-hidden",children:r.description})]})}s(G,"H");u(G,"ModeSwitchChip");function $(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M15.4 11.9a3.5 3.5 0 0 0-6.1-1.4M15.4 11.9h-2.1m2.1 0V9.8"}),(0,a.jsx)("path",{d:"M8.6 13.4a3.5 3.5 0 0 0 6.1 1.4M8.6 13.4h2.1m-2.1 0v2.1"})]})}s($,"D");u($,"FlipCameraIcon");function K(){return(0,a.jsxs)("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:"sekyro-icon sekyro-icon--sm",children:[(0,a.jsx)("path",{d:"M4 7.5h2.2l1.4-1.9h8.8l1.4 1.9H20a1.6 1.6 0 0 1 1.6 1.6v8.3A1.6 1.6 0 0 1 20 19H4a1.6 1.6 0 0 1-1.6-1.6V9.1A1.6 1.6 0 0 1 4 7.5Z"}),(0,a.jsx)("path",{d:"M3 3l18 18"})]})}s(K,"G");u(K,"CameraOffIcon");var ie=typeof window>"u"?E.useEffect:E.useLayoutEffect,P="data-sekyro-ramp",se=[["background-color","transparent"],["background-image","none"]];function q(r){let e=[],t=r.ownerDocument;for(let i=r;i!==null&&i!==t.documentElement;i=i.parentElement){if(!(i instanceof HTMLElement)&&!(i instanceof SVGElement))continue;let y=i.style;for(let[d,m]of se){let p=y.getPropertyValue(d),k=y.getPropertyPriority(d);y.setProperty(d,m,"important"),e.push(()=>{p===""?y.removeProperty(d):y.setProperty(d,p,k)})}}let n=t.documentElement,o=n.hasAttribute(P);return n.setAttribute(P,""),o||e.push(()=>n.removeAttribute(P)),()=>{for(let i of e.reverse())i()}}s(q,"z");u(q,"clearAncestorBackdrops");function X(r){return{position:"fixed",inset:0,minWidth:"100vw",minHeight:"100lvh",margin:0,padding:0,border:0,zIndex:-1,pointerEvents:"none",backgroundColor:Y(r)}}s(X,"B");u(X,"washStyle");function J(r){return{position:"absolute",inset:0,pointerEvents:"none",backgroundColor:Y(r)}}s(J,"Y");u(J,"coverStyle");function oe({colour:r}){let e=(0,E.useRef)(null),t=r!==null;return ie(()=>{let n=e.current?.parentElement;if(!(!t||n===null||n===void 0))return q(n)},[t]),r===null||typeof document>"u"?null:(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)("div",{ref:e,"aria-hidden":"true","data-testid":"sekyro-screen-ramp-cover","data-colour":r,style:J(r)}),(0,Z.createPortal)((0,v.jsx)("div",{"aria-hidden":"true","data-testid":"sekyro-screen-ramp","data-colour":r,style:X(r)}),document.body)]})}s(oe,"de");u(oe,"ScreenRampLayer");export{B as a,ne as b,G as c,oe as d};
2
2
  /*! Bundled license information:
3
3
 
4
4
  react-dom/cjs/react-dom.production.js:
@@ -1 +1 @@
1
- import{b,c as t,v as s,w as i,y as l}from"./chunk-APM7FCA2.js";import{a as o,c as k,i as r}from"./chunk-SSU37LFQ.js";var a=k(b(),1);function x({title:n,lead:d,cameraLabel:c,uploadLabel:m,notice:p,testId:e,onCamera:h,onUpload:u,onPhone:f=!1}){return(0,a.jsxs)("section",{className:"sekyro-step","data-testid":e,children:[(0,a.jsx)(i,{title:n,lead:d}),p,(0,a.jsxs)(l,{children:[(0,a.jsxs)(t,{full:!0,onClick:h,"data-testid":`${e}-camera`,children:[(0,a.jsx)(s,{name:f?"smartphone":"camera"}),c]}),(0,a.jsx)(t,{full:!0,kind:"ghost",onClick:u,"data-testid":`${e}-upload`,children:m})]})]})}o(x,"k");r(x,"PhotoSourceView");export{x as a};
1
+ import{b,c as t,v as s,w as i,y as l}from"./chunk-YQ7XHAQJ.js";import{a as o,c as k,i as r}from"./chunk-SSU37LFQ.js";var a=k(b(),1);function x({title:n,lead:d,cameraLabel:c,uploadLabel:m,notice:p,testId:e,onCamera:h,onUpload:u,onPhone:f=!1}){return(0,a.jsxs)("section",{className:"sekyro-step","data-testid":e,children:[(0,a.jsx)(i,{title:n,lead:d}),p,(0,a.jsxs)(l,{children:[(0,a.jsxs)(t,{full:!0,onClick:h,"data-testid":`${e}-camera`,children:[(0,a.jsx)(s,{name:f?"smartphone":"camera"}),c]}),(0,a.jsx)(t,{full:!0,kind:"ghost",onClick:u,"data-testid":`${e}-upload`,children:m})]})]})}o(x,"k");r(x,"PhotoSourceView");export{x as a};
@@ -1 +1 @@
1
- import{d as U}from"./chunk-JCCTKW23.js";import{E as C,I as H,a as Z,b as E,v as B}from"./chunk-APM7FCA2.js";import{a as N,c as R,i as d}from"./chunk-SSU37LFQ.js";var y=R(Z(),1),s=R(E(),1);var b=72;function P(c,t){let r=c*.72,a=r*1.32;return{cx:c/2,cy:(t-a)/2.1+a/2,a:r/2,b:a/2}}N(P,"B");d(P,"faceOval");function z({cx:c,cy:t,a:r,b:a}){return Array.from({length:b},(j,M)=>{let m=-Math.PI/2+M/b*2*Math.PI,h=Math.cos(m),i=Math.sin(m),u=c+r*h,f=t+a*i,k=Math.hypot(a*h,r*i),p=a*h/k,$=r*i/k,o=d(v=>Math.round(v*10)/10,"r");return`M${o(u+p*16)} ${o(f+$*16)}L${o(u+p*28)} ${o(f+$*28)}`})}N(z,"E");d(z,"ticks");function F({video:c,instruction:t,note:r,status:a,busy:j,progress:M,still:m,overlay:h,ramp:i,onClose:u,closeLabel:f,end:k,live:p=!0,children:$,testId:o}){C(p);let v=(0,y.useRef)(null),[l,A]=(0,y.useState)({w:0,h:0});(0,y.useLayoutEffect)(()=>{let x=v.current;if(x===null)return;let I=d(()=>A({w:x.clientWidth,h:x.clientHeight}),"measure");if(I(),typeof ResizeObserver>"u")return;let L=new ResizeObserver(I);return L.observe(x),()=>L.disconnect()},[]);let e=P(l.w,l.h),g=l.w>0?z(e):[],w=Math.round(Math.min(1,Math.max(0,M))*b),S=e.cy-e.b,n=Math.max(e.a,e.b)+40,O=70*Math.PI/180;return(0,s.jsx)("section",{className:"sekyro-lm sekyro-fc","aria-label":t,"data-testid":o,"data-ramp":i?"":void 0,children:(0,s.jsxs)("div",{ref:v,className:"sekyro-lm-stage",children:[c,m?(0,s.jsx)("img",{className:"sekyro-lm-video sekyro-fc-still",src:m,alt:""}):null,h,(0,s.jsx)(U,{colour:i??null}),l.w>0?(0,s.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${l.w} ${l.h}`,"aria-hidden":"true",focusable:"false",children:[(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:"sekyro-fc-fade",gradientUnits:"userSpaceOnUse",x1:e.cx-n*Math.sin(O),y1:e.cy,x2:e.cx,y2:e.cy,children:[(0,s.jsx)("stop",{offset:"0",className:"sekyro-fc-fade",stopOpacity:"0"}),(0,s.jsx)("stop",{offset:"1",className:"sekyro-fc-fade"})]}),(0,s.jsx)("mask",{id:"sekyro-fc-light",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:l.w,height:l.h,children:(0,s.jsx)("path",{className:"sekyro-fc-sweep",style:{transformOrigin:`${e.cx}px ${e.cy}px`},d:`M${e.cx} ${e.cy}L${e.cx-n*Math.sin(O)} ${e.cy-n*Math.cos(O)}A${n} ${n} 0 0 1 ${e.cx} ${e.cy-n}Z`,fill:"url(#sekyro-fc-fade)"})})]}),(0,s.jsx)("path",{className:"sekyro-fc-scrim",fillRule:"evenodd",d:`M0 0H${l.w}V${l.h}H0Z M${e.cx-e.a} ${e.cy}a${e.a} ${e.b} 0 1 0 ${2*e.a} 0a${e.a} ${e.b} 0 1 0 ${-2*e.a} 0Z`}),(0,s.jsx)("ellipse",{className:"sekyro-fc-rim",cx:e.cx,cy:e.cy,rx:e.a,ry:e.b}),(0,s.jsx)("path",{className:"sekyro-fc-ticks",d:g.join("")}),w>0?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-done",d:g.slice(0,w).join("")}):null,w<b?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-light",d:g.join(""),mask:"url(#sekyro-fc-light)"}):null]}):null,(0,s.jsx)("div",{className:"sekyro-lm-instruction sekyro-fc-instruction",style:{insetBlockStart:S-80},children:(0,s.jsx)("div",{role:"status","aria-live":"polite",children:(0,s.jsx)(H,{swapKey:t,className:"sekyro-lm-line",children:t})})}),a!==void 0?(0,s.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-camera-status",children:a??""}):null,r?(0,s.jsxs)("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:S+2*e.b+48},children:[j?(0,s.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}):null,(0,s.jsx)("span",{children:r})]}):null,(0,s.jsxs)("div",{className:"sekyro-lm-controls",children:[(0,s.jsxs)("div",{className:"sekyro-lm-bar",children:[u!==void 0?(0,s.jsx)("button",{type:"button",className:"sekyro-glass","aria-label":f,onClick:u,children:(0,s.jsx)(B,{name:"close"})}):null,k]}),$]})]})})}N(F,"T");d(F,"FaceCamera");export{F as a};
1
+ import{d as U}from"./chunk-LNCABBX7.js";import{E as C,I as H,a as Z,b as E,v as B}from"./chunk-YQ7XHAQJ.js";import{a as N,c as R,i as d}from"./chunk-SSU37LFQ.js";var y=R(Z(),1),s=R(E(),1);var b=72;function P(c,t){let r=c*.72,a=r*1.32;return{cx:c/2,cy:(t-a)/2.1+a/2,a:r/2,b:a/2}}N(P,"B");d(P,"faceOval");function z({cx:c,cy:t,a:r,b:a}){return Array.from({length:b},(j,M)=>{let m=-Math.PI/2+M/b*2*Math.PI,h=Math.cos(m),i=Math.sin(m),u=c+r*h,f=t+a*i,k=Math.hypot(a*h,r*i),p=a*h/k,$=r*i/k,o=d(v=>Math.round(v*10)/10,"r");return`M${o(u+p*16)} ${o(f+$*16)}L${o(u+p*28)} ${o(f+$*28)}`})}N(z,"E");d(z,"ticks");function F({video:c,instruction:t,note:r,status:a,busy:j,progress:M,still:m,overlay:h,ramp:i,onClose:u,closeLabel:f,end:k,live:p=!0,children:$,testId:o}){C(p);let v=(0,y.useRef)(null),[l,A]=(0,y.useState)({w:0,h:0});(0,y.useLayoutEffect)(()=>{let x=v.current;if(x===null)return;let I=d(()=>A({w:x.clientWidth,h:x.clientHeight}),"measure");if(I(),typeof ResizeObserver>"u")return;let L=new ResizeObserver(I);return L.observe(x),()=>L.disconnect()},[]);let e=P(l.w,l.h),g=l.w>0?z(e):[],w=Math.round(Math.min(1,Math.max(0,M))*b),S=e.cy-e.b,n=Math.max(e.a,e.b)+40,O=70*Math.PI/180;return(0,s.jsx)("section",{className:"sekyro-lm sekyro-fc","aria-label":t,"data-testid":o,"data-ramp":i?"":void 0,children:(0,s.jsxs)("div",{ref:v,className:"sekyro-lm-stage",children:[c,m?(0,s.jsx)("img",{className:"sekyro-lm-video sekyro-fc-still",src:m,alt:""}):null,h,(0,s.jsx)(U,{colour:i??null}),l.w>0?(0,s.jsxs)("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${l.w} ${l.h}`,"aria-hidden":"true",focusable:"false",children:[(0,s.jsxs)("defs",{children:[(0,s.jsxs)("linearGradient",{id:"sekyro-fc-fade",gradientUnits:"userSpaceOnUse",x1:e.cx-n*Math.sin(O),y1:e.cy,x2:e.cx,y2:e.cy,children:[(0,s.jsx)("stop",{offset:"0",className:"sekyro-fc-fade",stopOpacity:"0"}),(0,s.jsx)("stop",{offset:"1",className:"sekyro-fc-fade"})]}),(0,s.jsx)("mask",{id:"sekyro-fc-light",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:l.w,height:l.h,children:(0,s.jsx)("path",{className:"sekyro-fc-sweep",style:{transformOrigin:`${e.cx}px ${e.cy}px`},d:`M${e.cx} ${e.cy}L${e.cx-n*Math.sin(O)} ${e.cy-n*Math.cos(O)}A${n} ${n} 0 0 1 ${e.cx} ${e.cy-n}Z`,fill:"url(#sekyro-fc-fade)"})})]}),(0,s.jsx)("path",{className:"sekyro-fc-scrim",fillRule:"evenodd",d:`M0 0H${l.w}V${l.h}H0Z M${e.cx-e.a} ${e.cy}a${e.a} ${e.b} 0 1 0 ${2*e.a} 0a${e.a} ${e.b} 0 1 0 ${-2*e.a} 0Z`}),(0,s.jsx)("ellipse",{className:"sekyro-fc-rim",cx:e.cx,cy:e.cy,rx:e.a,ry:e.b}),(0,s.jsx)("path",{className:"sekyro-fc-ticks",d:g.join("")}),w>0?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-done",d:g.slice(0,w).join("")}):null,w<b?(0,s.jsx)("path",{className:"sekyro-fc-ticks is-light",d:g.join(""),mask:"url(#sekyro-fc-light)"}):null]}):null,(0,s.jsx)("div",{className:"sekyro-lm-instruction sekyro-fc-instruction",style:{insetBlockStart:S-80},children:(0,s.jsx)("div",{role:"status","aria-live":"polite",children:(0,s.jsx)(H,{swapKey:t,className:"sekyro-lm-line",children:t})})}),a!==void 0?(0,s.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-camera-status",children:a??""}):null,r?(0,s.jsxs)("p",{className:"sekyro-lm-under sekyro-lm-note",style:{insetBlockStart:S+2*e.b+48},children:[j?(0,s.jsx)("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}):null,(0,s.jsx)("span",{children:r})]}):null,(0,s.jsxs)("div",{className:"sekyro-lm-controls",children:[(0,s.jsxs)("div",{className:"sekyro-lm-bar",children:[u!==void 0?(0,s.jsx)("button",{type:"button",className:"sekyro-glass","aria-label":f,onClick:u,children:(0,s.jsx)(B,{name:"close"})}):null,k]}),$]})]})})}N(F,"T");d(F,"FaceCamera");export{F as a};