@sekyro/react 0.1.0-rc.40 → 0.1.0-rc.41

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @sekyro/react
2
2
 
3
+ ## 0.1.0-rc.41
4
+
5
+ ### Patch Changes
6
+
7
+ - 67d39fe: The confirm details screen shows the person's name in Arabic script on an Arabic page when the document or the chip gives one, with the father's name when the document prints it. Other pages show the Latin name.
8
+ - Updated dependencies [67d39fe]
9
+ - @sekyro/web@0.1.0-rc.43
10
+
3
11
  ## 0.1.0-rc.40
4
12
 
5
13
  ### Patch Changes
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as y}from"./chunk-WIHBHY2K.js";import{q as w}from"./chunk-OLU5EOHP.js";import{a as d}from"./chunk-MDXA7C7O.js";import{a as t}from"./chunk-2KED7D2Q.js";import{createContext as C,useContext as R,useState as v}from"react";import{lazy as S,Suspense as b,useMemo as x,useState as g}from"react";import{Component as N}from"react";var c=class c extends N{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};t(c,"LoadBoundary");var p=c;import{jsx as r,jsxs as V}from"react/jsx-runtime";var h={load:t(()=>import("./flow-views-Q4Z2BS6Z.js"),"load")};function k({view:n,i18n:e,quiet:o,...a}){let[i,f]=g(0),s=x(()=>S(()=>h.load().then(m=>({default:m[n]}))),[n,i]),u=V(w,{tone:"danger",children:[r("span",{children:e.t("errors.network_error")}),r(d,{kind:"secondary",onClick:()=>f(m=>m+1),children:e.t("common.retry")})]});return r(p,{fallback:u,children:r(b,{fallback:o===!0?null:r("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:e.t("common.loading")}),children:r(s,{...a,i18n:e})})},i)}t(k,"Flow");import{Fragment as F,jsx as l,jsxs as B}from"react/jsx-runtime";var P=C(void 0);function K({i18n:n,lead:e,refresh:o,actions:a}){let i=R(P),[f,s]=v(!1);if(i!==void 0)return l(k,{view:"HandoffView",i18n:n,url:i,lead:e,...o!==void 0?{refresh:o}:{},footer:a});let u=t(()=>{o!==void 0&&(s(!0),o().catch(()=>{}).finally(()=>s(!1)))},"again");return l(y,{tone:"brand",icon:"smartphone",title:n.t("handoff.title"),testId:"sekyro-phone-handoff",actions:B(F,{children:[a,o!==void 0?l(d,{kind:"secondary",full:!0,disabled:f,onClick:u,children:n.t("common.refresh")}):null]}),children:l("p",{children:e})})}t(K,"PhoneHandoff");export{p as a,k as b,P as c,K as d};
2
+ import{a as y}from"./chunk-WIHBHY2K.js";import{q as w}from"./chunk-OLU5EOHP.js";import{a as d}from"./chunk-MDXA7C7O.js";import{a as t}from"./chunk-2KED7D2Q.js";import{createContext as C,useContext as R,useState as v}from"react";import{lazy as S,Suspense as b,useMemo as x,useState as g}from"react";import{Component as N}from"react";var c=class c extends N{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};t(c,"LoadBoundary");var p=c;import{jsx as r,jsxs as V}from"react/jsx-runtime";var h={load:t(()=>import("./flow-views-JC2DWBW3.js"),"load")};function k({view:n,i18n:e,quiet:o,...a}){let[i,f]=g(0),s=x(()=>S(()=>h.load().then(m=>({default:m[n]}))),[n,i]),u=V(w,{tone:"danger",children:[r("span",{children:e.t("errors.network_error")}),r(d,{kind:"secondary",onClick:()=>f(m=>m+1),children:e.t("common.retry")})]});return r(p,{fallback:u,children:r(b,{fallback:o===!0?null:r("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:e.t("common.loading")}),children:r(s,{...a,i18n:e})})},i)}t(k,"Flow");import{Fragment as F,jsx as l,jsxs as B}from"react/jsx-runtime";var P=C(void 0);function K({i18n:n,lead:e,refresh:o,actions:a}){let i=R(P),[f,s]=v(!1);if(i!==void 0)return l(k,{view:"HandoffView",i18n:n,url:i,lead:e,...o!==void 0?{refresh:o}:{},footer:a});let u=t(()=>{o!==void 0&&(s(!0),o().catch(()=>{}).finally(()=>s(!1)))},"again");return l(y,{tone:"brand",icon:"smartphone",title:n.t("handoff.title"),testId:"sekyro-phone-handoff",actions:B(F,{children:[a,o!==void 0?l(d,{kind:"secondary",full:!0,disabled:f,onClick:u,children:n.t("common.refresh")}):null]}),children:l("p",{children:e})})}t(K,"PhoneHandoff");export{p as a,k as b,P as c,K as d};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as b}from"./chunk-HJDSATKF.js";import{d as I}from"./chunk-JDVMIABI.js";import{a as _,b as P,d as S,q as x,r as C}from"./chunk-OLU5EOHP.js";import{a as f}from"./chunk-MDXA7C7O.js";import{a as s}from"./chunk-2KED7D2Q.js";import{useRef as E,useState as k}from"react";var N={"portrait.source.title":"كيف تريد إضافة صورتك الشخصية؟","portrait.source.description":"التقط صورة جديدة بالكاميرا، أو ارفع صورة حديثة من هذا الجهاز.","portrait.source.camera":"التقاط صورة","portrait.source.upload":"رفع صورة","portrait.source.uploadInstead":"رفع صورة بدلًا من ذلك","portrait.upload.title":"ارفع صورتك الشخصية","portrait.upload.hint":"صورة حديثة لوجهك، تنظر فيها مباشرة إلى الكاميرا، أمام جدار فاتح وبلون واحد.","portrait.upload.choose":"اختيار صورة","portrait.upload.unsupported":"اختر صورة بصيغة JPEG أو PNG أو HEIC.","portrait.upload.failed":"تعذّر إرسال هذه الصورة. حاول مرة أخرى.","portrait.review.title":"تحقّق من صورتك المعدّلة","portrait.review.description":"عدّلنا صورتك لتطابق قواعد صور الهوية. لم نغيّر وجهك.","portrait.review.original":"صورتك","portrait.review.fixed":"الصورة المعدّلة","portrait.review.fixesTitle":"ما الذي غيّرناه","portrait.review.accept":"استخدام هذه الصورة","portrait.review.retake":"إعادة الالتقاط","portrait.review.uploadAnother":"رفع صورة أخرى","portrait.fixes.crop":"قُصّت","portrait.fixes.scale":"غُيّر حجمها","portrait.fixes.straighten":"عُدّل ميلها","portrait.fixes.background":"استُبدلت الخلفية","portrait.fixes.exposure":"عُدّل السطوع","portrait.fixes.white_balance":"وُزنت الألوان","reasons.portrait_morph_suspected":"لا يمكن استخدام هذه الصورة. التقط صورة جديدة للشخص.","reasons.portrait_reference_mismatch":"لا تطابق الصورة المرجع. التقط صورة جديدة للشخص.","reasons.portrait_declined_fix":"التقط صورة أخرى أو ارفعها."};var g={"portrait.source.title":"How do you want to add your ID photo?","portrait.source.description":"Take a new photo with the camera, or upload a recent photo from this device.","portrait.source.camera":"Take a photo","portrait.source.upload":"Upload a photo","portrait.source.uploadInstead":"Upload a photo instead","portrait.upload.title":"Upload your ID photo","portrait.upload.hint":"A recent photo of your face, looking straight at the camera, in front of a plain, light wall.","portrait.upload.choose":"Choose a photo","portrait.upload.unsupported":"Choose a JPEG, PNG or HEIC photo.","portrait.upload.failed":"We could not send this photo. Try again.","portrait.review.title":"Check your adjusted photo","portrait.review.description":"We adjusted your photo to meet the ID photo rules. Your face was not changed.","portrait.review.original":"Your photo","portrait.review.fixed":"Adjusted photo","portrait.review.fixesTitle":"What we changed","portrait.review.accept":"Use this photo","portrait.review.retake":"Take another","portrait.review.uploadAnother":"Upload another","portrait.fixes.crop":"Cropped","portrait.fixes.scale":"Resized","portrait.fixes.straighten":"Straightened","portrait.fixes.background":"Background replaced","portrait.fixes.exposure":"Brightness adjusted","portrait.fixes.white_balance":"Colours balanced","reasons.portrait_morph_suspected":"This photo cannot be used. Take a new photo of the person.","reasons.portrait_reference_mismatch":"The photo does not match the reference. Take a new photo of the person.","reasons.portrait_declined_fix":"Take or upload another photo."};var T={"portrait.source.title":"Comment voulez-vous ajouter votre photo d'identité ?","portrait.source.description":"Prenez une nouvelle photo avec la caméra, ou importez une photo récente depuis cet appareil.","portrait.source.camera":"Prendre une photo","portrait.source.upload":"Importer une photo","portrait.source.uploadInstead":"Importer une photo à la place","portrait.upload.title":"Importez votre photo d'identité","portrait.upload.hint":"Une photo récente de votre visage, de face, devant un mur clair et uni.","portrait.upload.choose":"Choisir une photo","portrait.upload.unsupported":"Choisissez une photo JPEG, PNG ou HEIC.","portrait.upload.failed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","portrait.review.title":"Vérifiez votre photo ajustée","portrait.review.description":"Nous avons ajusté votre photo pour qu'elle respecte les règles des photos d'identité. Votre visage n'a pas été modifié.","portrait.review.original":"Votre photo","portrait.review.fixed":"Photo ajustée","portrait.review.fixesTitle":"Ce que nous avons modifié","portrait.review.accept":"Utiliser cette photo","portrait.review.retake":"Reprendre","portrait.review.uploadAnother":"Importer une autre","portrait.fixes.crop":"Recadrée","portrait.fixes.scale":"Redimensionnée","portrait.fixes.straighten":"Redressée","portrait.fixes.background":"Fond remplacé","portrait.fixes.exposure":"Luminosité ajustée","portrait.fixes.white_balance":"Couleurs équilibrées","reasons.portrait_morph_suspected":"Cette photo ne peut pas être utilisée. Prenez une nouvelle photo de la personne.","reasons.portrait_reference_mismatch":"La photo ne correspond pas à la référence. Prenez une nouvelle photo de la personne.","reasons.portrait_declined_fix":"Prenez ou importez une autre photo."};import{jsx as t,jsxs as n}from"react/jsx-runtime";var H={en:g,fr:T,ar:N,es:g,pt:g,de:g},V="image/jpeg,image/png,image/heic,image/heif";function v(r){let o=r.strings,i=H[r.locale];return e=>o[e]??i[e]??""}s(v,"portraitCopy");function R({step:r,i18n:o}){if(r.reason===void 0||r.reason==="portrait_fix_review")return null;let i=v(o)(`reasons.${r.reason}`)||o.t("portrait.retryTitle");return n(x,{tone:"warning",children:[t("span",{children:i}),t("span",{children:C(o,r.attemptsRemaining,r.attemptsExhausted)})]})}s(R,"ReasonNotice");function z({step:r,i18n:o,onCamera:i,onUpload:e}){let a=v(o),p=r.photo?.cameraOnPhone===!0;return t(b,{testId:"sekyro-portrait-source",title:a("portrait.source.title"),lead:a("portrait.source.description"),cameraLabel:p?o.t("capture.source.phone"):a("portrait.source.camera"),onPhone:p,uploadLabel:a("portrait.source.upload"),notice:t(R,{step:r,i18n:o}),onCamera:i,onUpload:e})}s(z,"PortraitSourceView");function A({step:r,i18n:o,onCamera:i}){let e=v(o),a=E(null),[p,h]=k("idle"),u=p==="sending",l=r.photo?.uploadOffered===!0,w=s(async c=>{let y=c.currentTarget.files?.[0];if(c.currentTarget.value="",y!==void 0){h("sending");try{await r.uploadPortrait(y),h("idle")}catch(m){h(m instanceof TypeError&&m.message==="unsupported_file"?"unsupported":"failed")}}},"onFile");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-upload-screen",children:[t(P,{title:e("portrait.upload.title"),lead:e("portrait.upload.hint")}),p==="idle"||p==="sending"?t(R,{step:r,i18n:o}):null,p==="unsupported"||p==="failed"?t(x,{tone:"warning",children:t("span",{children:e(p==="unsupported"?"portrait.upload.unsupported":"portrait.upload.failed")})}):null,u?t("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:o.t("portrait.uploading")}):null,t("input",{ref:a,type:"file",accept:V,hidden:!0,"data-testid":"sekyro-portrait-upload","aria-label":e("portrait.upload.title"),onChange:c=>{w(c)}}),n(S,{children:[t(f,{full:!0,onClick:()=>a.current?.click(),disabled:u||!l||r.attemptsExhausted,children:e("portrait.upload.choose")}),i!==void 0?n(f,{full:!0,kind:"ghost",onClick:i,disabled:u,children:[t(_,{name:"camera"}),e("portrait.source.camera")]}):null]})]})}s(A,"PortraitUploadView");function j({step:r,i18n:o,onDeclined:i}){let e=v(o),[a,p]=k(!1),[h,u]=k(!1),l=r.pendingFix;if(l==null)return null;let w=s(async d=>{p(!0),u(!1);try{await r.confirmFix(d),d||i?.()}catch{u(!0)}finally{p(!1)}},"answer"),c=r.photo?.source==="upload"?e("portrait.review.uploadAnother"):e("portrait.review.retake"),y=s(d=>e(`portrait.fixes.${d}`)||d,"fixName"),m=e("portrait.review.original"),U=e("portrait.review.fixed");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-review",children:[t(P,{title:e("portrait.review.title"),lead:e("portrait.review.description")}),n("div",{className:"sekyro-portrait-pair",children:[n("figure",{className:"sekyro-portrait-pair__item",children:[t("img",{src:l.originalUrl,alt:m}),t("figcaption",{className:"sekyro-text-muted",children:m})]}),n("figure",{className:"sekyro-portrait-pair__item",children:[t("img",{src:l.fixedUrl,alt:U}),t("figcaption",{className:"sekyro-text-muted",children:U})]})]}),l.fixes.length>0?n("div",{className:"sekyro-stack sekyro-stack--1",children:[t("p",{className:"sekyro-text-body",children:e("portrait.review.fixesTitle")}),t("ul",{className:"sekyro-portrait-fixes","data-testid":"sekyro-portrait-fixes",children:l.fixes.map(d=>t("li",{children:y(d)},d))})]}):null,h?t(x,{tone:"danger",children:t("span",{children:o.t("errors.network_error")})}):null,n(S,{children:[t(f,{full:!0,onClick:()=>{w(!0)},disabled:a,"data-testid":"sekyro-portrait-accept",children:e("portrait.review.accept")}),t(f,{full:!0,kind:"ghost",onClick:()=>{w(!1)},disabled:a,"data-testid":"sekyro-portrait-decline",children:c})]})]})}s(j,"PortraitReviewView");function Q({screen:r,step:o,i18n:i,onCamera:e,onUpload:a,onDeclined:p}){return r==="phone"?t(I,{i18n:i,lead:i.t("handoff.lead.portrait"),refresh:o.refresh,actions:t(f,{kind:"ghost",full:!0,onClick:a,children:v(i)("portrait.source.upload")})}):r==="review"?t(j,{step:o,i18n:i,onDeclined:p}):r==="upload"?t(A,{step:o,i18n:i,...e!==void 0?{onCamera:e}:{}}):t(z,{step:o,i18n:i,onCamera:e??a,onUpload:a})}s(Q,"PortraitScreens");export{v as a,z as b,A as c,j as d,Q as e};
2
+ import{a as b}from"./chunk-HJDSATKF.js";import{d as I}from"./chunk-NZKIRHZR.js";import{a as _,b as P,d as S,q as x,r as C}from"./chunk-OLU5EOHP.js";import{a as f}from"./chunk-MDXA7C7O.js";import{a as s}from"./chunk-2KED7D2Q.js";import{useRef as E,useState as k}from"react";var N={"portrait.source.title":"كيف تريد إضافة صورتك الشخصية؟","portrait.source.description":"التقط صورة جديدة بالكاميرا، أو ارفع صورة حديثة من هذا الجهاز.","portrait.source.camera":"التقاط صورة","portrait.source.upload":"رفع صورة","portrait.source.uploadInstead":"رفع صورة بدلًا من ذلك","portrait.upload.title":"ارفع صورتك الشخصية","portrait.upload.hint":"صورة حديثة لوجهك، تنظر فيها مباشرة إلى الكاميرا، أمام جدار فاتح وبلون واحد.","portrait.upload.choose":"اختيار صورة","portrait.upload.unsupported":"اختر صورة بصيغة JPEG أو PNG أو HEIC.","portrait.upload.failed":"تعذّر إرسال هذه الصورة. حاول مرة أخرى.","portrait.review.title":"تحقّق من صورتك المعدّلة","portrait.review.description":"عدّلنا صورتك لتطابق قواعد صور الهوية. لم نغيّر وجهك.","portrait.review.original":"صورتك","portrait.review.fixed":"الصورة المعدّلة","portrait.review.fixesTitle":"ما الذي غيّرناه","portrait.review.accept":"استخدام هذه الصورة","portrait.review.retake":"إعادة الالتقاط","portrait.review.uploadAnother":"رفع صورة أخرى","portrait.fixes.crop":"قُصّت","portrait.fixes.scale":"غُيّر حجمها","portrait.fixes.straighten":"عُدّل ميلها","portrait.fixes.background":"استُبدلت الخلفية","portrait.fixes.exposure":"عُدّل السطوع","portrait.fixes.white_balance":"وُزنت الألوان","reasons.portrait_morph_suspected":"لا يمكن استخدام هذه الصورة. التقط صورة جديدة للشخص.","reasons.portrait_reference_mismatch":"لا تطابق الصورة المرجع. التقط صورة جديدة للشخص.","reasons.portrait_declined_fix":"التقط صورة أخرى أو ارفعها."};var g={"portrait.source.title":"How do you want to add your ID photo?","portrait.source.description":"Take a new photo with the camera, or upload a recent photo from this device.","portrait.source.camera":"Take a photo","portrait.source.upload":"Upload a photo","portrait.source.uploadInstead":"Upload a photo instead","portrait.upload.title":"Upload your ID photo","portrait.upload.hint":"A recent photo of your face, looking straight at the camera, in front of a plain, light wall.","portrait.upload.choose":"Choose a photo","portrait.upload.unsupported":"Choose a JPEG, PNG or HEIC photo.","portrait.upload.failed":"We could not send this photo. Try again.","portrait.review.title":"Check your adjusted photo","portrait.review.description":"We adjusted your photo to meet the ID photo rules. Your face was not changed.","portrait.review.original":"Your photo","portrait.review.fixed":"Adjusted photo","portrait.review.fixesTitle":"What we changed","portrait.review.accept":"Use this photo","portrait.review.retake":"Take another","portrait.review.uploadAnother":"Upload another","portrait.fixes.crop":"Cropped","portrait.fixes.scale":"Resized","portrait.fixes.straighten":"Straightened","portrait.fixes.background":"Background replaced","portrait.fixes.exposure":"Brightness adjusted","portrait.fixes.white_balance":"Colours balanced","reasons.portrait_morph_suspected":"This photo cannot be used. Take a new photo of the person.","reasons.portrait_reference_mismatch":"The photo does not match the reference. Take a new photo of the person.","reasons.portrait_declined_fix":"Take or upload another photo."};var T={"portrait.source.title":"Comment voulez-vous ajouter votre photo d'identité ?","portrait.source.description":"Prenez une nouvelle photo avec la caméra, ou importez une photo récente depuis cet appareil.","portrait.source.camera":"Prendre une photo","portrait.source.upload":"Importer une photo","portrait.source.uploadInstead":"Importer une photo à la place","portrait.upload.title":"Importez votre photo d'identité","portrait.upload.hint":"Une photo récente de votre visage, de face, devant un mur clair et uni.","portrait.upload.choose":"Choisir une photo","portrait.upload.unsupported":"Choisissez une photo JPEG, PNG ou HEIC.","portrait.upload.failed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","portrait.review.title":"Vérifiez votre photo ajustée","portrait.review.description":"Nous avons ajusté votre photo pour qu'elle respecte les règles des photos d'identité. Votre visage n'a pas été modifié.","portrait.review.original":"Votre photo","portrait.review.fixed":"Photo ajustée","portrait.review.fixesTitle":"Ce que nous avons modifié","portrait.review.accept":"Utiliser cette photo","portrait.review.retake":"Reprendre","portrait.review.uploadAnother":"Importer une autre","portrait.fixes.crop":"Recadrée","portrait.fixes.scale":"Redimensionnée","portrait.fixes.straighten":"Redressée","portrait.fixes.background":"Fond remplacé","portrait.fixes.exposure":"Luminosité ajustée","portrait.fixes.white_balance":"Couleurs équilibrées","reasons.portrait_morph_suspected":"Cette photo ne peut pas être utilisée. Prenez une nouvelle photo de la personne.","reasons.portrait_reference_mismatch":"La photo ne correspond pas à la référence. Prenez une nouvelle photo de la personne.","reasons.portrait_declined_fix":"Prenez ou importez une autre photo."};import{jsx as t,jsxs as n}from"react/jsx-runtime";var H={en:g,fr:T,ar:N,es:g,pt:g,de:g},V="image/jpeg,image/png,image/heic,image/heif";function v(r){let o=r.strings,i=H[r.locale];return e=>o[e]??i[e]??""}s(v,"portraitCopy");function R({step:r,i18n:o}){if(r.reason===void 0||r.reason==="portrait_fix_review")return null;let i=v(o)(`reasons.${r.reason}`)||o.t("portrait.retryTitle");return n(x,{tone:"warning",children:[t("span",{children:i}),t("span",{children:C(o,r.attemptsRemaining,r.attemptsExhausted)})]})}s(R,"ReasonNotice");function z({step:r,i18n:o,onCamera:i,onUpload:e}){let a=v(o),p=r.photo?.cameraOnPhone===!0;return t(b,{testId:"sekyro-portrait-source",title:a("portrait.source.title"),lead:a("portrait.source.description"),cameraLabel:p?o.t("capture.source.phone"):a("portrait.source.camera"),onPhone:p,uploadLabel:a("portrait.source.upload"),notice:t(R,{step:r,i18n:o}),onCamera:i,onUpload:e})}s(z,"PortraitSourceView");function A({step:r,i18n:o,onCamera:i}){let e=v(o),a=E(null),[p,h]=k("idle"),u=p==="sending",l=r.photo?.uploadOffered===!0,w=s(async c=>{let y=c.currentTarget.files?.[0];if(c.currentTarget.value="",y!==void 0){h("sending");try{await r.uploadPortrait(y),h("idle")}catch(m){h(m instanceof TypeError&&m.message==="unsupported_file"?"unsupported":"failed")}}},"onFile");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-upload-screen",children:[t(P,{title:e("portrait.upload.title"),lead:e("portrait.upload.hint")}),p==="idle"||p==="sending"?t(R,{step:r,i18n:o}):null,p==="unsupported"||p==="failed"?t(x,{tone:"warning",children:t("span",{children:e(p==="unsupported"?"portrait.upload.unsupported":"portrait.upload.failed")})}):null,u?t("p",{className:"sekyro-text-muted",role:"status","aria-busy":"true",children:o.t("portrait.uploading")}):null,t("input",{ref:a,type:"file",accept:V,hidden:!0,"data-testid":"sekyro-portrait-upload","aria-label":e("portrait.upload.title"),onChange:c=>{w(c)}}),n(S,{children:[t(f,{full:!0,onClick:()=>a.current?.click(),disabled:u||!l||r.attemptsExhausted,children:e("portrait.upload.choose")}),i!==void 0?n(f,{full:!0,kind:"ghost",onClick:i,disabled:u,children:[t(_,{name:"camera"}),e("portrait.source.camera")]}):null]})]})}s(A,"PortraitUploadView");function j({step:r,i18n:o,onDeclined:i}){let e=v(o),[a,p]=k(!1),[h,u]=k(!1),l=r.pendingFix;if(l==null)return null;let w=s(async d=>{p(!0),u(!1);try{await r.confirmFix(d),d||i?.()}catch{u(!0)}finally{p(!1)}},"answer"),c=r.photo?.source==="upload"?e("portrait.review.uploadAnother"):e("portrait.review.retake"),y=s(d=>e(`portrait.fixes.${d}`)||d,"fixName"),m=e("portrait.review.original"),U=e("portrait.review.fixed");return n("section",{className:"sekyro-step","data-testid":"sekyro-portrait-review",children:[t(P,{title:e("portrait.review.title"),lead:e("portrait.review.description")}),n("div",{className:"sekyro-portrait-pair",children:[n("figure",{className:"sekyro-portrait-pair__item",children:[t("img",{src:l.originalUrl,alt:m}),t("figcaption",{className:"sekyro-text-muted",children:m})]}),n("figure",{className:"sekyro-portrait-pair__item",children:[t("img",{src:l.fixedUrl,alt:U}),t("figcaption",{className:"sekyro-text-muted",children:U})]})]}),l.fixes.length>0?n("div",{className:"sekyro-stack sekyro-stack--1",children:[t("p",{className:"sekyro-text-body",children:e("portrait.review.fixesTitle")}),t("ul",{className:"sekyro-portrait-fixes","data-testid":"sekyro-portrait-fixes",children:l.fixes.map(d=>t("li",{children:y(d)},d))})]}):null,h?t(x,{tone:"danger",children:t("span",{children:o.t("errors.network_error")})}):null,n(S,{children:[t(f,{full:!0,onClick:()=>{w(!0)},disabled:a,"data-testid":"sekyro-portrait-accept",children:e("portrait.review.accept")}),t(f,{full:!0,kind:"ghost",onClick:()=>{w(!1)},disabled:a,"data-testid":"sekyro-portrait-decline",children:c})]})]})}s(j,"PortraitReviewView");function Q({screen:r,step:o,i18n:i,onCamera:e,onUpload:a,onDeclined:p}){return r==="phone"?t(I,{i18n:i,lead:i.t("handoff.lead.portrait"),refresh:o.refresh,actions:t(f,{kind:"ghost",full:!0,onClick:a,children:v(i)("portrait.source.upload")})}):r==="review"?t(j,{step:o,i18n:i,onDeclined:p}):r==="upload"?t(A,{step:o,i18n:i,...e!==void 0?{onCamera:e}:{}}):t(z,{step:o,i18n:i,onCamera:e??a,onUpload:a})}s(Q,"PortraitScreens");export{v as a,z as b,A as c,j as d,Q as e};
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as nt}from"./chunk-HJDSATKF.js";import{d as tt}from"./chunk-JDVMIABI.js";import"./chunk-WIHBHY2K.js";import{a as Xe,b as We,c as je}from"./chunk-7MMT5M4E.js";import{d as Qe}from"./chunk-V3BQZTXH.js";import{a as O,b as we,d as be,k as Ze,l as Je,m as qe,o as et,q as le,r as de}from"./chunk-OLU5EOHP.js";import"./chunk-TLYACCNO.js";import{a as $,m as Ge,o as Fe}from"./chunk-MDXA7C7O.js";import{a as s}from"./chunk-2KED7D2Q.js";import{acceptedTypesFor as Mt}from"@sekyro/web";import{useContext as ut,useEffect as U,useLayoutEffect as Pt,useRef as L,useState as k}from"react";var ot={image:'<path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/><path d="M14 8A2 2 0 1 0 18 8A2 2 0 1 0 14 8Z" stroke="currentColor"/><path d="M2 12.5L3.75 10.97C4.66 10.17 6.04 10.22 6.89 11.07L11.18 15.36C11.87 16.05 12.95 16.14 13.75 15.58L14.04 15.37C15.19 14.57 16.74 14.66 17.78 15.6L21 18.5" stroke="currentColor" stroke-linecap="round"/>',flashlight:'<path d="M9 11.66V19C9 19.93 9 20.4 9.15 20.77C9.36 21.26 9.74 21.64 10.23 21.85C10.6 22 11.07 22 12 22C12.93 22 13.4 22 13.77 21.85C14.26 21.64 14.64 21.26 14.85 20.77C15 20.4 15 19.93 15 19V11.66C15 10.84 15 10.43 15.15 10.06C15.3 9.7 15.59 9.41 16.17 8.83L16.17 8.83L19.41 5.59C19.7 5.3 19.85 5.15 19.92 4.97C20 4.78 20 4.58 20 4.17V4C20 3.06 20 2.59 19.71 2.29C19.41 2 18.94 2 18 2H6C5.06 2 4.59 2 4.29 2.29C4 2.59 4 3.06 4 4V4.17C4 4.58 4 4.78 4.08 4.97C4.15 5.15 4.3 5.3 4.59 5.59L7.83 8.83C8.41 9.41 8.7 9.7 8.85 10.06C9 10.43 9 10.84 9 11.66Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 10H9" stroke="currentColor" stroke-linecap="round"/><path d="M12 13V15" stroke="currentColor" stroke-linecap="round"/><path d="M4.5 5H19.5" stroke="currentColor" stroke-linecap="round"/>'};var rt={"dcv3.mrz.searching":"ضع صفحة جواز السفر كاملة داخل الإطار","dcv3.mrz.showMrzSide":"اعرض الوجه الذي يحتوي على سطرين أو ثلاثة أسطر من الحروف","dcv3.mrz.reading":"جارٍ قراءة الوثيقة… ثبّتها","dcv3.mrz.moveCloser":"اقترب حتى تملأ أسطر الحروف الإطار","dcv3.mrz.turnSideways":"أدر هاتفك أفقيًا لقراءة أسطر الحروف","dcv3.mrz.glare":"أمِل الوثيقة لإزالة الانعكاس","dcv3.mrz.holdStill":"لا تتحرك","dcv3.mrz.valid":"تمت قراءة الوثيقة. جارٍ التقاط الصورة","dcv3.mrz.looksLikePassport":"يبدو أن هذا جواز سفر","dcv3.mrz.looksLikeCard":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"};var Q={"dcv3.mrz.searching":"Fit the whole passport page in the frame","dcv3.mrz.showMrzSide":"Show the side with the two or three lines of characters","dcv3.mrz.reading":"Reading the document… hold it steady","dcv3.mrz.moveCloser":"Move closer so the lines of characters fill the frame","dcv3.mrz.turnSideways":"Turn your phone sideways to read the lines of characters","dcv3.mrz.glare":"Tilt the document to remove the reflection","dcv3.mrz.holdStill":"Hold still","dcv3.mrz.valid":"Document read. Taking the photo","dcv3.mrz.looksLikePassport":"This looks like a passport","dcv3.mrz.looksLikeCard":"This looks like an identity card or residence permit"};var at={"dcv3.mrz.searching":"Cadrez toute la page du passeport","dcv3.mrz.showMrzSide":"Montrez la face avec les deux ou trois lignes de caractères","dcv3.mrz.reading":"Lecture du document… tenez-le immobile","dcv3.mrz.moveCloser":"Rapprochez-vous pour que les lignes de caractères remplissent le cadre","dcv3.mrz.turnSideways":"Tournez votre téléphone à l’horizontale pour lire les lignes de caractères","dcv3.mrz.glare":"Inclinez le document pour supprimer le reflet","dcv3.mrz.holdStill":"Ne bougez plus","dcv3.mrz.valid":"Document lu. Prise de la photo","dcv3.mrz.looksLikePassport":"Ceci ressemble à un passeport","dcv3.mrz.looksLikeCard":"Ceci ressemble à une carte d’identité ou un titre de séjour"};var st={"doc.uploadInstead":"رفع صورة بدلًا من ذلك","doc.uploadTitle":"ارفع صورة لوثيقتك","doc.uploadHint":"صورة واضحة للوثيقة كاملة، ملتقطة بكاميرا.","doc.uploadUnsupported":"اختر صورة للوثيقة بصيغة JPEG أو PNG أو HEIC.","doc.uploadFailed":"تعذّر إرسال هذه الصورة. أعد المحاولة.","doc.source.title":"كيف تريد إضافة وثيقتك؟","doc.source.description":"التقط صورة بالكاميرا، أو ارفع صورة للوثيقة من هذا الجهاز.","doc.source.camera":"التقاط صورة","doc.source.upload":"رفع صورة"};var Z={"doc.uploadInstead":"Upload a photo instead","doc.uploadTitle":"Upload a photo of your document","doc.uploadHint":"A clear photo of the whole document, taken with a camera.","doc.uploadUnsupported":"Choose a JPEG, PNG or HEIC photo of the document.","doc.uploadFailed":"We could not send this photo. Try again.","doc.source.title":"How do you want to add your document?","doc.source.description":"Take a photo with the camera, or upload a photo of the document from this device.","doc.source.camera":"Take a photo","doc.source.upload":"Upload a photo"};var it={"doc.uploadInstead":"Téléverser une photo à la place","doc.uploadTitle":"Téléversez une photo de votre document","doc.uploadHint":"Une photo nette du document entier, prise avec un appareil photo.","doc.uploadUnsupported":"Choisissez une photo JPEG, PNG ou HEIC du document.","doc.uploadFailed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","doc.source.title":"Comment voulez-vous ajouter votre document ?","doc.source.description":"Prenez une photo avec la caméra, ou importez une photo du document depuis cet appareil.","doc.source.camera":"Prendre une photo","doc.source.upload":"Importer une photo"};var ct={"native.doc.introTitle":"سنلتقط صورة لوثيقتك","native.doc.introLead":"تُلتقط الصورة تلقائيًا عندما تكون الوثيقة داخل الإطار.","native.doc.tip.flat":"ضع الوثيقة مسطحة على سطح داكن.","native.doc.tip.glare":"تجنّب انعكاسات الضوء.","native.doc.tip.frame":"أبقِ الوثيقة كاملة داخل الإطار.","native.doc.openCamera":"افتح الكاميرا","native.doc.changeDocument":"تغيير الوثيقة","native.doc.titleOf.carte_identite":"صوّر بطاقة هويتك","native.doc.titleOf.passport":"صوّر جواز سفرك","native.doc.titleOf.residence_permit":"صوّر بطاقة إقامتك","native.doc.titleOf.drivers_license":"صوّر رخصة قيادتك","native.doc.onlyType.carte_identite":"{country}: تُقبل بطاقة الهوية فقط هنا.","native.doc.onlyType.passport":"{country}: يُقبل جواز السفر فقط هنا.","native.doc.onlyType.residence_permit":"{country}: تُقبل بطاقة الإقامة فقط هنا.","native.doc.onlyType.drivers_license":"{country}: تُقبل رخصة القيادة فقط هنا.","native.scan.closer":"اقترب قليلًا","native.scan.farther":"ابتعد قليلًا","native.scan.glare":"أمِل البطاقة قليلًا","native.scan.dark":"الإضاءة ضعيفة. شغّل المصباح.","native.scan.blurry":"الصورة غير واضحة. ثبّت الهاتف.","native.scan.holdStill":"لا تتحرك","native.scan.reading":"جارٍ التحقق من وثيقتك…","native.scan.putDown":"يمكنك وضع وثيقتك جانبًا.","native.scan.retry":"لنحاول مرة أخرى","native.scan.seenPassport":"يبدو أن هذا جواز سفر","native.scan.seenCard":"يبدو أن هذه بطاقة هوية أو بطاقة إقامة","native.scan.showInstead.carte_identite":"أظهر بطاقة هويتك بدلًا منها","native.scan.showInstead.passport":"أظهر صفحة الصورة في جواز سفرك بدلًا منها","native.scan.showInstead.residence_permit":"أظهر بطاقة إقامتك بدلًا منها","native.scan.showInstead.drivers_license":"أظهر رخصة قيادتك بدلًا منها","native.scan.expired":"انتهت صلاحية هذه الوثيقة. امسح وثيقة سارية."};var J={"native.doc.introTitle":"Photograph your document","native.doc.introLead":"The photo is taken by itself once the document is in the frame.","native.doc.tip.flat":"Lay it flat on a dark surface.","native.doc.tip.glare":"Avoid glare from lights.","native.doc.tip.frame":"Keep all of it in the frame.","native.doc.openCamera":"Open the camera","native.doc.changeDocument":"Change document","native.doc.titleOf.carte_identite":"Photograph your identity card","native.doc.titleOf.passport":"Photograph your passport","native.doc.titleOf.residence_permit":"Photograph your residence permit","native.doc.titleOf.drivers_license":"Photograph your driver's license","native.doc.onlyType.carte_identite":"{country}: only an identity card is accepted here.","native.doc.onlyType.passport":"{country}: only a passport is accepted here.","native.doc.onlyType.residence_permit":"{country}: only a residence permit is accepted here.","native.doc.onlyType.drivers_license":"{country}: only a driver's license is accepted here.","native.scan.closer":"Move a little closer","native.scan.farther":"Move back a little","native.scan.glare":"Tilt the card a little","native.scan.dark":"Too dark. Turn on the light.","native.scan.blurry":"Blurry image. Hold the phone still.","native.scan.holdStill":"Hold still","native.scan.reading":"Checking your document…","native.scan.putDown":"You can put your document down.","native.scan.retry":"Let's try that again","native.scan.seenPassport":"This looks like a passport","native.scan.seenCard":"This looks like an identity card or residence permit","native.scan.showInstead.carte_identite":"Show your identity card instead","native.scan.showInstead.passport":"Show the photo page of your passport instead","native.scan.showInstead.residence_permit":"Show your residence permit instead","native.scan.showInstead.drivers_license":"Show your driver's license instead","native.scan.expired":"This document has expired. Scan a valid document."};var lt={"native.doc.introTitle":"Photographiez votre pièce","native.doc.introLead":"La photo se prend toute seule quand la pièce est bien cadrée.","native.doc.tip.flat":"Posez la pièce à plat sur fond sombre.","native.doc.tip.glare":"Évitez les reflets de lumière.","native.doc.tip.frame":"Gardez toute la pièce dans le cadre.","native.doc.openCamera":"Ouvrir la caméra","native.doc.changeDocument":"Changer de document","native.doc.titleOf.carte_identite":"Photographiez votre carte d'identité","native.doc.titleOf.passport":"Photographiez votre passeport","native.doc.titleOf.residence_permit":"Photographiez votre titre de séjour","native.doc.titleOf.drivers_license":"Photographiez votre permis de conduire","native.doc.onlyType.carte_identite":"{country} : seule la carte d'identité est acceptée ici.","native.doc.onlyType.passport":"{country} : seul le passeport est accepté ici.","native.doc.onlyType.residence_permit":"{country} : seul le titre de séjour est accepté ici.","native.doc.onlyType.drivers_license":"{country} : seul le permis de conduire est accepté ici.","native.scan.closer":"Approchez un peu","native.scan.farther":"Reculez un peu","native.scan.glare":"Inclinez un peu la carte","native.scan.dark":"Trop sombre. Allumez la lampe.","native.scan.blurry":"Image floue. Tenez le téléphone immobile.","native.scan.holdStill":"Ne bougez plus","native.scan.reading":"Vérification de votre document…","native.scan.putDown":"Vous pouvez poser votre pièce.","native.scan.retry":"Réessayons","native.scan.seenPassport":"Ceci ressemble à un passeport","native.scan.seenCard":"Ceci ressemble à une carte d'identité ou un titre de séjour","native.scan.showInstead.carte_identite":"Montrez plutôt votre carte d'identité","native.scan.showInstead.passport":"Montrez plutôt la page photo de votre passeport","native.scan.showInstead.residence_permit":"Montrez plutôt votre titre de séjour","native.scan.showInstead.drivers_license":"Montrez plutôt votre permis de conduire","native.scan.expired":"Ce document a expiré. Scannez un document valide."};var _e=class _e{constructor(){this.shown=null;this.shownAt=0;this.yielded=null;this.shownPhotos=0}present(t,o,r,a,m=0){(t===null||t.key!==this.yielded)&&(this.yielded=null);let f=this.shown;return t!==null&&this.yielded===null?f?.kind==="problem"&&f.key===t.key&&f.action===t.action?(this.shownPhotos=m,!t.blocking&&o!==null&&a-this.shownAt>=3e3?(this.yielded=t.key,this.show({kind:"hint",key:o,action:null},a,m)):f):this.show({kind:"problem",key:t.key,action:t.action},a,m):f?.kind==="problem"&&t===null&&m===this.shownPhotos&&(r||a-this.shownAt<3e3)?f:o===null?this.show(null,a):f?.kind==="hint"&&f.key===o?f:this.show({kind:"hint",key:o,action:null},a)}show(t,o,r=this.shownPhotos){return this.shown=t,this.shownAt=o,this.shownPhotos=r,t}};s(_e,"NoticeBand");var ue=_e;var Lt=["locking","capturing"],Ce=class Ce{constructor(){this.shown={hint:null,locking:!1,card:null,manualShutter:!1};this.candidate=null;this.candidateSince=0;this.hintShownAt=0;this.lockLostAt=null;this.detectedSince=null;this.lostSince=null;this.shutterSince=null}present(t,o){return this.presentHint(t,o),this.presentLock(t,o),this.presentCard(t,o),this.shutterSince=t.manualShutter?this.shutterSince??o:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&o-this.shutterSince>=1e3},this.shown}presentHint(t,o){let r=t.phase==="framing"&&!(t.hint==="blurry"&&t.card===null)?t.hint:null;if(t.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(r!==this.candidate&&(this.candidate=r,this.candidateSince=o),r===this.shown.hint)return;let a=o-this.candidateSince>=(r===null?0:350),m=this.shown.hint===null||o-this.hintShownAt>=2500;a&&m&&(this.shown={...this.shown,hint:r},this.hintShownAt=o)}presentLock(t,o){if(Lt.includes(t.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(t.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=o),o-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(t,o){let r=t.card;if(r===null||t.phase!=="framing"){if(t.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=o),o-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=o),o-this.detectedSince<250)return;let a=this.shown.card;if(a===null){this.shown={...this.shown,card:{...r}};return}let m=.35;this.shown={...this.shown,card:{fill:a.fill+(r.fill-a.fill)*m,offsetX:a.offsetX+(r.offsetX-a.offsetX)*m,offsetY:a.offsetY+(r.offsetY-a.offsetY)*m}}}};s(Ce,"ScanPresenter");var pe=Ce;import{Fragment as Ne,jsx as n,jsxs as d}from"react/jsx-runtime";var Rt={en:J,fr:lt,ar:ct,es:J,pt:J,de:J},It=450,ze=s(e=>(t,o)=>Qe(e.strings[t]??Rt[e.locale][t]??"",o),"useScanCopy");function Ht(e,t){try{return new Intl.DisplayNames([t],{type:"region"}).of(e)??e}catch{return e}}s(Ht,"regionName");function $t(e){let t=e.documentType,o=t===null?"native.doc.introTitle":`native.doc.titleOf.${t}`,r=t!==null&&e.issuer!==null&&Mt(e.documents,e.issuer).length===1;return{titleKey:o,onlyKey:r?`native.doc.onlyType.${t}`:null}}s($t,"introCopy");function me({name:e}){return n("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:ot[e]}})}s(me,"ScanGlyph");var Ot={en:Q,fr:at,ar:rt,es:Q,pt:Q,de:Q},Ut={en:Z,fr:it,ar:st,es:Z,pt:Z,de:Z},Et="image/jpeg,image/png,image/heic,image/heif";function G(e){let t=e.strings,o=s(r=>t[r]??Ut[e.locale][r],"text");return{t:s(r=>o(r)??"","t")}}s(G,"uploadCopy");function At(e,t){return e===null||e.state==="fallback"||e.state==="mismatch"||e.state==="expired"?null:e.state==="searching"?t?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":e.state==="valid"?"dcv3.mrz.valid":e.coach==="holdStill"?"dcv3.mrz.holdStill":"dcv3.mrz.reading"}s(At,"mrzInstruction");function Kt(e){return e?.state==="reading"&&e.coach!==void 0&&e.coach!=="holdStill"?`mrz:${e.coach}`:null}s(Kt,"mrzHint");function Bt(e){return e==="carte_identite"||e==="passport"||e==="residence_permit"||e==="drivers_license"?`native.scan.showInstead.${e}`:null}s(Bt,"showInsteadKey");var Vt={document_type_mismatch:"doc.reason_document_type_mismatch",document_number_invalid:"doc.reason_document_number_invalid",provider_unavailable:"doc.reason_provider_unavailable",document_type_not_supported:"doc.reason_document_type_not_supported",document_sides_mismatch:"doc.reason_document_sides_mismatch",document_side_not_read:"doc.reason_document_side_not_read"};function xe(e){if(e.reason==="unreadable")return"doc.reason_unreadable";let t=e.reason!==void 0?Vt[e.reason]:void 0;return t!==void 0?t:e.reason==="tester_document_mismatch"?"reasons.tester_document_mismatch":e.reason!==void 0&&e.reason!=="side_missing"?Fe(e.reason):null}s(xe,"reasonOf");var pt=new Set(["document_type_not_accepted","tester_document_mismatch","document_type_mismatch","provider_unavailable","document_type_not_supported","document_sides_mismatch","document_side_not_read"]);function Vn({step:e,i18n:t,liveMrz:o,barcodeAssetBaseUrl:r,ageLead:a,...m}){let[f,u]=k(!1),y=L(-1),[v,S]=k("idle"),_=L(null),N=typeof e.uploadDocument=="function",C=N?e.photo?.source??"camera":"camera",M=N&&C!=="camera"&&e.photo?.uploadOffered===!0,[w,B]=k(null),I=C==="upload"?"upload":C==="choice"?w??e.photo?.pick??"source":"camera",E=v==="sending"?void 0:()=>_.current?.click(),g=s(async V=>{let X=V.currentTarget.files?.[0];if(V.currentTarget.value="",X!==void 0){u(!1),S("sending");try{await e.uploadDocument(X),S("idle")}catch(ee){S(ee instanceof TypeError&&ee.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),q=M?n("input",{ref:_,type:"file",accept:Et,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":G(t).t("doc.uploadTitle"),onChange:V=>{g(V)}}):null,x=G(t),F=e.photo?.cameraOnPhone===!0;return I==="camera"&&F?n(tt,{i18n:t,lead:t.t("handoff.lead.document"),refresh:e.refresh,actions:n($,{kind:"ghost",full:!0,onClick:()=>B("upload"),children:x.t("doc.source.upload")})}):I==="source"?n(nt,{testId:"sekyro-doc-source",title:x.t("doc.source.title"),lead:x.t("doc.source.description"),cameraLabel:F?t.t("capture.source.phone"):x.t("doc.source.camera"),onPhone:F,uploadLabel:x.t("doc.source.upload"),notice:n(Te,{step:e,i18n:t}),onCamera:()=>B("camera"),onUpload:()=>B("upload")}):I==="upload"?d(Ne,{children:[n(Ft,{step:e,i18n:t,ageLead:a===!0,upload:v,offered:M,onPick:()=>_.current?.click(),...C==="choice"?{onCamera:s(()=>B("camera"),"onCamera")}:{},...m}),q]}):d(Ne,{children:[f?n(jt,{step:e,i18n:t,attempts:y,...o!==void 0?{liveMrz:o}:{},...r!==void 0?{barcodeAssetBaseUrl:r}:{},...M&&E!==void 0?{onUpload:E}:{},onClose:()=>u(!1)}):n(Gt,{step:e,i18n:t,ageLead:a===!0,onOpen:()=>u(!0),upload:v,...M&&E!==void 0?{onUpload:E}:{},...m}),q]})}s(Vn,"DocumentCaptureView");function mt({passport:e}){let o=Math.round(228/(e?1.42:1.586));return d("svg",{className:`sekyro-mark sekyro-mark--card${e?" sekyro-mark--passport":""}`,viewBox:`-12 ${e?-22:-12} 252 ${o+(e?34:24)}`,"aria-hidden":"true",focusable:"false",children:[n("defs",{children:n("clipPath",{id:"sekyro-card-clip",children:n("rect",{width:228,height:o,rx:"12.5"})})}),e?n("rect",{className:"sekyro-mark__page",x:"10",y:"-14",width:208,height:o,rx:"10"}):null,n("rect",{className:"sekyro-mark__card",width:228,height:o,rx:"12.5"}),n("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:o*(e?.5:.62),rx:"6"}),[0,1,2].map(r=>n("rect",{className:"sekyro-mark__text",x:"88",y:23+r*o*.12,width:100-r*20,height:"6",rx:"3"},r)),e?[0,1].map(r=>n("line",{className:"sekyro-mark__code",x1:"17",x2:211,y1:o*.75+r*11,y2:o*.75+r*11},r)):n("rect",{className:"sekyro-mark__text",x:"88",y:23+3*o*.12,width:"60",height:"6",rx:"3"}),n("g",{clipPath:"url(#sekyro-card-clip)",children:n("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:n("rect",{x:"-1",width:"2",height:o,className:"sekyro-mark__beam"})})}),n("path",{className:"sekyro-mark__brackets",d:Yt(-10,-10,248,o+20,16,30)})]})}s(mt,"ScanMark");function Yt(e,t,o,r,a,m){let f=Math.min(a,m*.6);return[[e,t,1,1],[e+o,t,-1,1],[e,t+r,1,-1],[e+o,t+r,-1,-1]].map(([y,v,S,_])=>`M${y} ${v+_*m}V${v+_*f}Q${y} ${v} ${y+S*f} ${v}H${y+S*m}`).join("")}s(Yt,"brackets");function Gt({step:e,i18n:t,ageLead:o,onOpen:r,onChangeCountry:a,onChangeDocument:m,upload:f,onUpload:u}){let y=ze(t),v=G(t),S=e.documentType==="passport",_=$t(e),N=xe(e),C=f==="sending",M=ut(Je)?.busy===!0;return d("section",{className:"sekyro-step sekyro-step--doc-intro","data-testid":"sekyro-document",children:[n(mt,{passport:S}),n(we,{title:y(_.titleKey)||y("native.doc.introTitle"),lead:o?t.t("doc.ageStepUp"):y("native.doc.introLead")}),_.onlyKey!==null&&e.issuer!==null?n("p",{className:"sekyro-text-muted sekyro-doc-only",children:y(_.onlyKey,{country:Ht(e.issuer,t.locale)})}):null,n(Te,{step:e,i18n:t}),e.reason!==void 0&&pt.has(e.reason)?null:d("ul",{className:"sekyro-tiprows",children:[d("li",{children:[n(O,{name:S?"passport":"card"}),y("native.doc.tip.flat")]}),d("li",{children:[n(O,{name:"light"}),y("native.doc.tip.glare")]}),d("li",{children:[n(me,{name:"image"}),y("native.doc.tip.frame")]})]}),n(ht,{i18n:t,...m!==void 0?{onChangeDocument:m}:{},...a!==void 0?{onChangeCountry:a}:{}}),n(ft,{i18n:t,upload:f}),C?n("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):u!==void 0?n("p",{className:"sekyro-text-muted",children:v.t("doc.uploadHint")}):null,d(be,{children:[d($,{full:!0,onClick:r,disabled:C||M,children:[n(O,{name:"camera"}),y("native.doc.openCamera")]}),u!==void 0?d($,{full:!0,kind:"ghost",onClick:u,children:[n(me,{name:"image"}),v.t("doc.uploadInstead")]}):null]})]})}s(Gt,"DocumentIntro");function Te({step:e,i18n:t}){let o=xe(e);return o===null&&e.reasonHidden===!0?n(le,{tone:"info",children:n("span",{children:de(t,e.attemptsRemaining,e.attemptsExhausted)})}):o===null?null:d(le,{tone:"warning",children:[n("span",{children:t.t(o)}),n("span",{children:de(t,e.attemptsRemaining,e.attemptsExhausted)})]})}s(Te,"ReasonNotice");function ht({i18n:e,onChangeCountry:t,onChangeDocument:o}){let r=ze(e);return o===void 0&&t===void 0?null:d("div",{className:"sekyro-links",children:[o!==void 0?n("button",{type:"button",className:"sekyro-link",onClick:o,children:r("native.doc.changeDocument")}):null,t!==void 0?n("button",{type:"button",className:"sekyro-link",onClick:t,children:e.t("native.doc.changeCountry")}):null]})}s(ht,"ChangeLinks");function ft({i18n:e,upload:t}){return t!=="unsupported"&&t!=="failed"?null:n(le,{tone:"warning",children:n("span",{children:G(e).t(t==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}s(ft,"UploadNotice");function Ft({step:e,i18n:t,ageLead:o,upload:r,offered:a,onPick:m,onCamera:f,onChangeCountry:u,onChangeDocument:y}){let v=G(t),S=r==="sending";return d("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[n(mt,{passport:e.documentType==="passport"}),n(we,{title:v.t("doc.uploadTitle"),lead:o?t.t("doc.ageStepUp"):v.t("doc.uploadHint")}),o?n("p",{className:"sekyro-text-muted",children:v.t("doc.uploadHint")}):null,n(Te,{step:e,i18n:t}),n(ht,{i18n:t,...y!==void 0?{onChangeDocument:y}:{},...u!==void 0?{onChangeCountry:u}:{}}),n(ft,{i18n:t,upload:r}),S?n("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):null,d(be,{children:[d($,{full:!0,onClick:m,disabled:S||!a||e.attemptsExhausted,children:[n(me,{name:"image"}),v.t("doc.source.upload")]}),f!==void 0?d($,{full:!0,kind:"ghost",onClick:f,disabled:S,children:[n(O,{name:"camera"}),v.t("doc.source.camera")]}):null]})]})}s(Ft,"DocumentUploadScreen");function dt(e,t,o){let r=e*.88,a=r/o;return{x:(e-r)/2,y:t*.42-a/2,w:r,h:a}}s(dt,"guideRect");var Xt={"mrz:moveCloser":"dcv3.mrz.moveCloser","mrz:turnSideways":"dcv3.mrz.turnSideways","mrz:glare":"dcv3.mrz.glare",too_far:"native.scan.closer",too_close:"native.scan.farther",focus_far:"native.scan.farther",glare:"native.scan.glare",too_bright:"native.scan.glare",too_dark:"native.scan.dark",blurry:"native.scan.blurry"},Wt=s(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function jt({step:e,i18n:t,liveMrz:o,barcodeAssetBaseUrl:r,onClose:a,attempts:m,onUpload:f}){let u=ze(t),y=ut(Xe),v=L(y);v.current=y;let S=L(null),_=L(null),N=L(null),[C,M]=k("idle"),[w,B]=k(null),[I,E]=k(null),[g,q]=k({w:0,h:0}),[x,F]=k({hint:null,locking:!1,card:null,manualShutter:!1}),[V,X]=k({}),[ee,Le]=k({}),[Me,Pe]=k(null),[Re,yt]=k(null),[Ie,He]=k(0),[he,$e]=k(null),[fe,vt]=k(null),[te,gt]=k(0),ne=L(0);ne.current=te;let[St,Oe]=k(0),Ue=L(0),oe=L(null);U(()=>{Oe(ne.current)},[e.reason,e.attemptsRemaining]);let A=e.documentType==="passport",re=A?1.42:1.586;Ze(!0),Pt(()=>{let c=S.current;if(c===null)return;let h=s(()=>q({w:c.clientWidth,h:c.clientHeight}),"measure");if(h(),typeof ResizeObserver>"u")return;let p=new ResizeObserver(h);return p.observe(c),()=>p.disconnect()},[]);let i=dt(g.w,g.h,re);U(()=>{g.w===0||g.h===0||N.current?.setGuide?.({viewAspect:g.w/g.h,rect:{x:i.x/g.w,y:i.y/g.h,width:i.w/g.w,height:i.h/g.h}})},[g.w,g.h,i.x,i.y,i.w,i.h]),U(()=>{let c=_.current;if(c===null)return;let h=e.capture({video:c,...o!==void 0?{liveMrz:o}:{},...r!==void 0?{barcodeAssetBaseUrl:r}:{}});N.current=h,X({}),Le({}),Pe(null);let p=S.current;if(p!==null&&p.clientWidth>0&&p.clientHeight>0){let l=dt(p.clientWidth,p.clientHeight,re);h.setGuide?.({viewAspect:p.clientWidth/p.clientHeight,rect:{x:l.x/p.clientWidth,y:l.y/p.clientHeight,width:l.w/p.clientWidth,height:l.h/p.clientHeight}})}let T=new pe,D={scan:null,feedback:null,gate:null,mrz:null},H=s(l=>{D={...D,...l};let b=D.gate?.guide,Tt={phase:D.scan?.phase??"framing",hint:D.feedback?.reticle==="coaching"?D.feedback.key:e.documentType==="drivers_license"?null:Kt(D.mrz),card:b?.detected?{fill:b.fill,offsetX:b.offsetX,offsetY:b.offsetY}:null,manualShutter:D.scan?.manualShutter??!1},W=T.present(Tt,performance.now());F(j=>j.hint===W.hint&&j.locking===W.locking&&j.manualShutter===W.manualShutter&&tn(j.card,W.card)?j:W)},"present"),xt=[h.on("state",M),h.on("feedback",l=>H({feedback:l})),h.on("gate",l=>H({gate:l})),h.on("scan",l=>{l.captured.length===0&&Ue.current>0&&Oe(ne.current),Ue.current=l.captured.length,oe.current=(oe.current??l.captured).filter(b=>l.captured.includes(b)),B(l),H({scan:l})}),h.on("captured",l=>{gt(b=>b+1),X(b=>({...b,[qt(l.side,A,b)]:l.previewDataUrl})),l.photo!==void 0&&Le(b=>({...b,[l.photo]:l.previewDataUrl})),Pe(l.previewDataUrl),yt(nn(c))}),h.on("error",l=>{E(l);let b=v.current;b!==null&&je(b,We("document",l,Math.max(0,m.current)))}),h.on("mrz",l=>{l.state==="mismatch"?vt({format:l.format??null,at:ne.current}):($e(l),H({mrz:l}))})];return m.current+=1,h.start().catch(()=>{}),()=>{oe.current=null;for(let l of xt)l();h.destroy(),N.current=null}},[e.issuer,e.documentType]);let P=w?.phase??"framing",R=P==="reading"||P==="result",ae=P==="flipCue"||P==="reaskRecto",K=x.locking,Ee=w?.captured.length??0;U(()=>{K&&He(c=>c+1)},[K]),U(()=>{Ee>0&&He(c=>c+1)},[Ee]);let kt=w?.expected??null;U(()=>{$e(null)},[kt]);let ye=ae||R||e.documentType==="drivers_license"?null:At(he,A),Ae=s(c=>t.strings[c]??Ot[t.locale][c],"liveText"),wt=s(c=>c.startsWith("dcv3.")?Ae(c):u(c),"copy"),ve=ye!==null?Ae(ye):u(P==="flipCue"?"doc.flip":P==="reaskRecto"?"doc.reaskRecto":R?"native.scan.reading":P==="locking"||P==="capturing"||K?"native.scan.holdStill":A?"doc.showPage":"doc.showSide"),se=e.browserCheck??null,ge=se!==null&&R,ie=xe(e),Ke=s(c=>({key:u(c),action:de(t,e.attemptsRemaining,e.attemptsExhausted),blocking:e.reason!==void 0&&pt.has(e.reason)}),"reasonProblem"),Be=Bt(e.documentType),bt=he?.state==="expired"&&!ae&&!R?{key:u("native.scan.expired"),action:null,blocking:!0}:fe!==null&&te<=fe.at+1?{key:u(fe.format==="TD3"?"native.scan.seenPassport":"native.scan.seenCard"),action:Be===null?null:u(Be),blocking:!0}:w?.notice==="same_face"?{key:u("doc.sameFace"),action:null,blocking:!1}:w?.notice==="reread"?ie!==null?Ke(ie):{key:u("doc.reread"),action:null,blocking:!1}:w?.notice==="technical"?{key:u("native.scan.retry"),action:null,blocking:!1}:w?.notice==="blurry"?{key:u("native.scan.blurry"),action:null,blocking:!1}:ie!==null&&te===St?Ke(ie):null,_t=x.hint===null?null:wt(Xt[x.hint]??`dcv2.${x.hint}`),Ve=Qt(bt,_t,K||P==="capturing"||R,te),Y=x.card,z=i;if(!K&&Y!==null&&Y.fill>=.45&&Y.fill<=1.25&&!Wt()){let c=i.w*Y.fill,h=c/re,p=i.x+i.w/2+i.w*Math.max(-.25,Math.min(.25,Y.offsetX)),T=i.y+i.h/2+i.h*Math.max(-.25,Math.min(.25,Y.offsetY));z={x:p-c/2,y:T-h/2,w:c,h}}let ce=i.w*.045,Se=28,Ye=Math.min(ce,Se*.6),Ct=[[z.x,z.y,1,1],[z.x+z.w,z.y,-1,1],[z.x,z.y+z.h,1,-1],[z.x+z.w,z.y+z.h,-1,-1]],Dt=K?"is-locked":Ve!==null?"is-coaching":"",Nt=A?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],zt=i.y+i.h+16,ke={insetInlineStart:i.x,insetBlockStart:i.y,inlineSize:i.w,blockSize:i.h,borderRadius:ce};return n("section",{className:"sekyro-lm","aria-label":ve,"data-testid":"sekyro-document",children:d("div",{ref:S,className:`sekyro-lm-stage${R?" is-reading":""}${ae?" is-flip":""}`,style:{"--sekyro-guide-w":`${i.w}px`},children:[n("video",{ref:_,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:c=>{let h=c.currentTarget,p=h.getBoundingClientRect(),T=Math.max(p.width/(h.videoWidth||1),p.height/(h.videoHeight||1)),D=h.videoWidth*T,H=h.videoHeight*T;D>0&&H>0&&N.current?.focusAt((c.clientX-p.left+(D-p.width)/2)/D,(c.clientY-p.top+(H-p.height)/2)/H)}}),g.w>0?d(Ne,{children:[R&&Re!==null?n("img",{className:"sekyro-lm-scene",src:Re,alt:""}):null,R&&Me!==null?n("img",{className:"sekyro-lm-frozen",src:Me,alt:"",style:ke}):null,d("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${g.w} ${g.h}`,"aria-hidden":"true",focusable:"false",children:[d("defs",{children:[d("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[n("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),n("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),d("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[n("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),n("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),n("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${g.w}V${g.h}H0Z${en(i,ce)}`}),n("rect",{width:g.w,height:Math.max(0,i.y),fill:"url(#sekyro-lm-top)"}),n("rect",{y:i.y+i.h,width:g.w,height:Math.max(0,g.h-i.y-i.h),fill:"url(#sekyro-lm-bottom)"}),n("g",{className:`sekyro-lm-brackets ${Dt}`,children:Ct.map(([c,h,p,T],D)=>n("path",{style:{transform:`translate(${c}px, ${h}px) scale(${p}, ${T})`},d:`M0 ${Se}V${Ye}Q0 0 ${Ye} 0H${Se}`},D))}),K?n("rect",{className:"sekyro-lm-trace",x:i.x,y:i.y,width:i.w,height:i.h,rx:ce,pathLength:"1",style:{animationDuration:`${It}ms`}}):null]}),n("div",{className:"sekyro-lm-slot",style:ke,"aria-hidden":"true",children:R?n("span",{className:"sekyro-lm-read is-repeating"}):Ie>0?n("span",{className:"sekyro-lm-read"},Ie):null})]}):null,ye!==null?n("div",{className:"sekyro-lm-slot",style:ke,"aria-hidden":"true",children:n("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${A?" is-page":""}${he?.state==="valid"?" is-valid":""}`})}):null,n("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:i.y-64},children:n("div",{role:"status","aria-live":"polite","data-testid":"sekyro-scan-instruction",children:ge?null:n(et,{swapKey:ve,className:"sekyro-lm-line",children:ve})})}),d("div",{className:"sekyro-lm-below",style:{insetBlockStart:zt,inlineSize:i.w,insetInlineStart:i.x},children:[n(Zt,{band:Ve}),ge?null:R?d("p",{className:"sekyro-lm-note",children:[n("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),u("native.scan.putDown")]}):ae?n("div",{className:`sekyro-lm-flip${P==="reaskRecto"?" is-toFront":""}`,"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:d("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(re)},children:[n("span",{className:"sekyro-lm-flip-front"}),n("span",{className:"sekyro-lm-flip-back"})]})}):null]}),d("div",{className:"sekyro-lm-controls",children:[d("div",{className:"sekyro-lm-bar",children:[n("button",{type:"button",className:"sekyro-glass","aria-label":t.t("native.close"),onClick:a,children:n(O,{name:"close"})}),w?.torchAvailable?n("button",{type:"button",className:`sekyro-glass${w.torch?" is-on":""}`,"aria-label":t.t("doc.torchOn"),"aria-pressed":w.torch,onClick:()=>N.current?.setTorch(!w.torch),children:n(me,{name:"flashlight"})}):null]}),I!==null?d("div",{className:"sekyro-lm-error",role:"alert",children:[n("p",{children:t.t("doc.cameraBlocked")}),n("p",{children:t.t(I.kind==="permission"?"doc.cameraBlockedHint":Ge(I.kind))}),n($,{onClick:()=>{E(null),m.current+=1,N.current?.retry()},children:t.t("doc.retryCamera")})]}):null,se!==null&&I===null?d("div",{className:"sekyro-lm-error",role:"alert","data-testid":"sekyro-doc-browser-check",children:[n("p",{children:t.t(se.code==="clock_wrong"?"errors.device_clock":"errors.attestation_invalid")}),n($,{onClick:se.retry,children:t.t("common.retry")})]}):null,x.manualShutter?n("button",{type:"button",className:"sekyro-shutter","aria-label":t.t("doc.shutter"),onClick:()=>N.current?.shutter()}):null,n("ol",{className:"sekyro-lm-tray",children:Nt.map(({side:c,label:h})=>{let p=w?.captured.includes(c)??!1,T=Jt(c,w,ee,V);return d("li",{className:p?"is-done":void 0,"aria-current":!p&&(A||w?.expected===c)?"step":void 0,children:[p?d("span",{className:"sekyro-lm-thumb",children:[T!==void 0?n("img",{src:T,alt:""}):n(O,{name:"card"}),n("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:n("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,u(h),p&&T===void 0&&oe.current?.includes(c)?n("span",{className:"sekyro-lm-received",children:u("doc.sideReceived")}):null]},c)})}),f!==void 0?n("button",{type:"button",className:"sekyro-lm-upload",onClick:f,children:G(t).t("doc.uploadInstead")}):null,C==="uploading"||C==="checking"?null:n(qe,{onStop:a})]}),!ge&&(C==="uploading"||C==="checking")?n("span",{className:"sekyro-visually-hidden",role:"status",children:C==="uploading"?t.t("doc.uploading"):u("native.scan.reading")}):null]})})}s(jt,"LumiereScan");function Qt(e,t,o,r){let a=L(null);a.current??(a.current=new ue);let[m,f]=k(null),u=L({problem:e,hint:t,busy:o,photos:r});u.current={problem:e,hint:t,busy:o,photos:r};let y=e===null?null:`${e.blocking}|${e.key}|${e.action??""}`;return U(()=>{let v=s(()=>{let{problem:_,hint:N,busy:C,photos:M}=u.current;f(a.current?.present(_,N,C,performance.now(),M)??null)},"run");v();let S=setInterval(v,250);return()=>clearInterval(S)},[y,t,o,r]),m}s(Qt,"useNoticeBand");function Zt({band:e}){let[t,o]=k(e);U(()=>{e!==null&&o(e)},[e]);let r=e??t;return n("div",{className:`sekyro-lm-band${e!==null?" is-open":""}`,"data-testid":"sekyro-scan-notice",children:n("div",{role:"status","aria-live":"polite","aria-atomic":"true",children:r!==null?d("div",{className:"sekyro-notice sekyro-notice--warning","data-kind":r.kind,"aria-hidden":e===null||void 0,children:[n("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:n(O,{name:"warning"})}),d("div",{className:"sekyro-notice__body",children:[n("span",{children:r.key}),r.action!==null&&r.action!==""?n("span",{children:r.action}):null]})]}):null})})}s(Zt,"NoticeBandView");function Jt(e,t,o,r){if(t?.photos===void 0)return r[e];let a=t.photos[e];return a===void 0?void 0:o[a]}s(Jt,"thumbOf");function qt(e,t,o){return t?"single":e==="recto"||e==="verso"?e:o.recto===void 0?"recto":"verso"}s(qt,"slotOf");function en({x:e,y:t,w:o,h:r},a){return`M${e+a} ${t}H${e+o-a}Q${e+o} ${t} ${e+o} ${t+a}V${t+r-a}Q${e+o} ${t+r} ${e+o-a} ${t+r}H${e+a}Q${e} ${t+r} ${e} ${t+r-a}V${t+a}Q${e} ${t} ${e+a} ${t}Z`}s(en,"roundedRect");var De=.004;function tn(e,t){return e===null||t===null?e===t:Math.abs(e.fill-t.fill)<De&&Math.abs(e.offsetX-t.offsetX)<De&&Math.abs(e.offsetY-t.offsetY)<De}s(tn,"sameCard");function nn(e){let t=Math.round(e.videoWidth/4),o=Math.round(e.videoHeight/4);if(t===0||o===0||typeof document>"u")return null;try{let r=document.createElement("canvas");r.width=t,r.height=o;let a=r.getContext("2d");return a===null?null:(a.drawImage(e,0,0,t,o),r.toDataURL("image/jpeg",.7))}catch{return null}}s(nn,"sceneSnapshot");export{Vn as DocumentCaptureView,It as LOCK_TRACE_MS,Et as UPLOAD_ACCEPT,dt as guideRect,$t as introCopy,Kt as mrzHint,At as mrzInstruction,tn as sameCard,Bt as showInsteadKey,qt as slotOf,Jt as thumbOf};
2
+ import{a as nt}from"./chunk-HJDSATKF.js";import{d as tt}from"./chunk-NZKIRHZR.js";import"./chunk-WIHBHY2K.js";import{a as Xe,b as We,c as je}from"./chunk-7MMT5M4E.js";import{d as Qe}from"./chunk-V3BQZTXH.js";import{a as O,b as we,d as be,k as Ze,l as Je,m as qe,o as et,q as le,r as de}from"./chunk-OLU5EOHP.js";import"./chunk-TLYACCNO.js";import{a as $,m as Ge,o as Fe}from"./chunk-MDXA7C7O.js";import{a as s}from"./chunk-2KED7D2Q.js";import{acceptedTypesFor as Mt}from"@sekyro/web";import{useContext as ut,useEffect as U,useLayoutEffect as Pt,useRef as L,useState as k}from"react";var ot={image:'<path d="M2 12C2 7.29 2 4.93 3.46 3.46C4.93 2 7.29 2 12 2C16.71 2 19.07 2 20.54 3.46C22 4.93 22 7.29 22 12C22 16.71 22 19.07 20.54 20.54C19.07 22 16.71 22 12 22C7.29 22 4.93 22 3.46 20.54C2 19.07 2 16.71 2 12Z" stroke="currentColor"/><path d="M14 8A2 2 0 1 0 18 8A2 2 0 1 0 14 8Z" stroke="currentColor"/><path d="M2 12.5L3.75 10.97C4.66 10.17 6.04 10.22 6.89 11.07L11.18 15.36C11.87 16.05 12.95 16.14 13.75 15.58L14.04 15.37C15.19 14.57 16.74 14.66 17.78 15.6L21 18.5" stroke="currentColor" stroke-linecap="round"/>',flashlight:'<path d="M9 11.66V19C9 19.93 9 20.4 9.15 20.77C9.36 21.26 9.74 21.64 10.23 21.85C10.6 22 11.07 22 12 22C12.93 22 13.4 22 13.77 21.85C14.26 21.64 14.64 21.26 14.85 20.77C15 20.4 15 19.93 15 19V11.66C15 10.84 15 10.43 15.15 10.06C15.3 9.7 15.59 9.41 16.17 8.83L16.17 8.83L19.41 5.59C19.7 5.3 19.85 5.15 19.92 4.97C20 4.78 20 4.58 20 4.17V4C20 3.06 20 2.59 19.71 2.29C19.41 2 18.94 2 18 2H6C5.06 2 4.59 2 4.29 2.29C4 2.59 4 3.06 4 4V4.17C4 4.58 4 4.78 4.08 4.97C4.15 5.15 4.3 5.3 4.59 5.59L7.83 8.83C8.41 9.41 8.7 9.7 8.85 10.06C9 10.43 9 10.84 9 11.66Z" stroke="currentColor" stroke-linecap="round"/><path d="M15 10H9" stroke="currentColor" stroke-linecap="round"/><path d="M12 13V15" stroke="currentColor" stroke-linecap="round"/><path d="M4.5 5H19.5" stroke="currentColor" stroke-linecap="round"/>'};var rt={"dcv3.mrz.searching":"ضع صفحة جواز السفر كاملة داخل الإطار","dcv3.mrz.showMrzSide":"اعرض الوجه الذي يحتوي على سطرين أو ثلاثة أسطر من الحروف","dcv3.mrz.reading":"جارٍ قراءة الوثيقة… ثبّتها","dcv3.mrz.moveCloser":"اقترب حتى تملأ أسطر الحروف الإطار","dcv3.mrz.turnSideways":"أدر هاتفك أفقيًا لقراءة أسطر الحروف","dcv3.mrz.glare":"أمِل الوثيقة لإزالة الانعكاس","dcv3.mrz.holdStill":"لا تتحرك","dcv3.mrz.valid":"تمت قراءة الوثيقة. جارٍ التقاط الصورة","dcv3.mrz.looksLikePassport":"يبدو أن هذا جواز سفر","dcv3.mrz.looksLikeCard":"يبدو أن هذه بطاقة تعريف أو بطاقة إقامة"};var Q={"dcv3.mrz.searching":"Fit the whole passport page in the frame","dcv3.mrz.showMrzSide":"Show the side with the two or three lines of characters","dcv3.mrz.reading":"Reading the document… hold it steady","dcv3.mrz.moveCloser":"Move closer so the lines of characters fill the frame","dcv3.mrz.turnSideways":"Turn your phone sideways to read the lines of characters","dcv3.mrz.glare":"Tilt the document to remove the reflection","dcv3.mrz.holdStill":"Hold still","dcv3.mrz.valid":"Document read. Taking the photo","dcv3.mrz.looksLikePassport":"This looks like a passport","dcv3.mrz.looksLikeCard":"This looks like an identity card or residence permit"};var at={"dcv3.mrz.searching":"Cadrez toute la page du passeport","dcv3.mrz.showMrzSide":"Montrez la face avec les deux ou trois lignes de caractères","dcv3.mrz.reading":"Lecture du document… tenez-le immobile","dcv3.mrz.moveCloser":"Rapprochez-vous pour que les lignes de caractères remplissent le cadre","dcv3.mrz.turnSideways":"Tournez votre téléphone à l’horizontale pour lire les lignes de caractères","dcv3.mrz.glare":"Inclinez le document pour supprimer le reflet","dcv3.mrz.holdStill":"Ne bougez plus","dcv3.mrz.valid":"Document lu. Prise de la photo","dcv3.mrz.looksLikePassport":"Ceci ressemble à un passeport","dcv3.mrz.looksLikeCard":"Ceci ressemble à une carte d’identité ou un titre de séjour"};var st={"doc.uploadInstead":"رفع صورة بدلًا من ذلك","doc.uploadTitle":"ارفع صورة لوثيقتك","doc.uploadHint":"صورة واضحة للوثيقة كاملة، ملتقطة بكاميرا.","doc.uploadUnsupported":"اختر صورة للوثيقة بصيغة JPEG أو PNG أو HEIC.","doc.uploadFailed":"تعذّر إرسال هذه الصورة. أعد المحاولة.","doc.source.title":"كيف تريد إضافة وثيقتك؟","doc.source.description":"التقط صورة بالكاميرا، أو ارفع صورة للوثيقة من هذا الجهاز.","doc.source.camera":"التقاط صورة","doc.source.upload":"رفع صورة"};var Z={"doc.uploadInstead":"Upload a photo instead","doc.uploadTitle":"Upload a photo of your document","doc.uploadHint":"A clear photo of the whole document, taken with a camera.","doc.uploadUnsupported":"Choose a JPEG, PNG or HEIC photo of the document.","doc.uploadFailed":"We could not send this photo. Try again.","doc.source.title":"How do you want to add your document?","doc.source.description":"Take a photo with the camera, or upload a photo of the document from this device.","doc.source.camera":"Take a photo","doc.source.upload":"Upload a photo"};var it={"doc.uploadInstead":"Téléverser une photo à la place","doc.uploadTitle":"Téléversez une photo de votre document","doc.uploadHint":"Une photo nette du document entier, prise avec un appareil photo.","doc.uploadUnsupported":"Choisissez une photo JPEG, PNG ou HEIC du document.","doc.uploadFailed":"Nous n'avons pas pu envoyer cette photo. Réessayez.","doc.source.title":"Comment voulez-vous ajouter votre document ?","doc.source.description":"Prenez une photo avec la caméra, ou importez une photo du document depuis cet appareil.","doc.source.camera":"Prendre une photo","doc.source.upload":"Importer une photo"};var ct={"native.doc.introTitle":"سنلتقط صورة لوثيقتك","native.doc.introLead":"تُلتقط الصورة تلقائيًا عندما تكون الوثيقة داخل الإطار.","native.doc.tip.flat":"ضع الوثيقة مسطحة على سطح داكن.","native.doc.tip.glare":"تجنّب انعكاسات الضوء.","native.doc.tip.frame":"أبقِ الوثيقة كاملة داخل الإطار.","native.doc.openCamera":"افتح الكاميرا","native.doc.changeDocument":"تغيير الوثيقة","native.doc.titleOf.carte_identite":"صوّر بطاقة هويتك","native.doc.titleOf.passport":"صوّر جواز سفرك","native.doc.titleOf.residence_permit":"صوّر بطاقة إقامتك","native.doc.titleOf.drivers_license":"صوّر رخصة قيادتك","native.doc.onlyType.carte_identite":"{country}: تُقبل بطاقة الهوية فقط هنا.","native.doc.onlyType.passport":"{country}: يُقبل جواز السفر فقط هنا.","native.doc.onlyType.residence_permit":"{country}: تُقبل بطاقة الإقامة فقط هنا.","native.doc.onlyType.drivers_license":"{country}: تُقبل رخصة القيادة فقط هنا.","native.scan.closer":"اقترب قليلًا","native.scan.farther":"ابتعد قليلًا","native.scan.glare":"أمِل البطاقة قليلًا","native.scan.dark":"الإضاءة ضعيفة. شغّل المصباح.","native.scan.blurry":"الصورة غير واضحة. ثبّت الهاتف.","native.scan.holdStill":"لا تتحرك","native.scan.reading":"جارٍ التحقق من وثيقتك…","native.scan.putDown":"يمكنك وضع وثيقتك جانبًا.","native.scan.retry":"لنحاول مرة أخرى","native.scan.seenPassport":"يبدو أن هذا جواز سفر","native.scan.seenCard":"يبدو أن هذه بطاقة هوية أو بطاقة إقامة","native.scan.showInstead.carte_identite":"أظهر بطاقة هويتك بدلًا منها","native.scan.showInstead.passport":"أظهر صفحة الصورة في جواز سفرك بدلًا منها","native.scan.showInstead.residence_permit":"أظهر بطاقة إقامتك بدلًا منها","native.scan.showInstead.drivers_license":"أظهر رخصة قيادتك بدلًا منها","native.scan.expired":"انتهت صلاحية هذه الوثيقة. امسح وثيقة سارية."};var J={"native.doc.introTitle":"Photograph your document","native.doc.introLead":"The photo is taken by itself once the document is in the frame.","native.doc.tip.flat":"Lay it flat on a dark surface.","native.doc.tip.glare":"Avoid glare from lights.","native.doc.tip.frame":"Keep all of it in the frame.","native.doc.openCamera":"Open the camera","native.doc.changeDocument":"Change document","native.doc.titleOf.carte_identite":"Photograph your identity card","native.doc.titleOf.passport":"Photograph your passport","native.doc.titleOf.residence_permit":"Photograph your residence permit","native.doc.titleOf.drivers_license":"Photograph your driver's license","native.doc.onlyType.carte_identite":"{country}: only an identity card is accepted here.","native.doc.onlyType.passport":"{country}: only a passport is accepted here.","native.doc.onlyType.residence_permit":"{country}: only a residence permit is accepted here.","native.doc.onlyType.drivers_license":"{country}: only a driver's license is accepted here.","native.scan.closer":"Move a little closer","native.scan.farther":"Move back a little","native.scan.glare":"Tilt the card a little","native.scan.dark":"Too dark. Turn on the light.","native.scan.blurry":"Blurry image. Hold the phone still.","native.scan.holdStill":"Hold still","native.scan.reading":"Checking your document…","native.scan.putDown":"You can put your document down.","native.scan.retry":"Let's try that again","native.scan.seenPassport":"This looks like a passport","native.scan.seenCard":"This looks like an identity card or residence permit","native.scan.showInstead.carte_identite":"Show your identity card instead","native.scan.showInstead.passport":"Show the photo page of your passport instead","native.scan.showInstead.residence_permit":"Show your residence permit instead","native.scan.showInstead.drivers_license":"Show your driver's license instead","native.scan.expired":"This document has expired. Scan a valid document."};var lt={"native.doc.introTitle":"Photographiez votre pièce","native.doc.introLead":"La photo se prend toute seule quand la pièce est bien cadrée.","native.doc.tip.flat":"Posez la pièce à plat sur fond sombre.","native.doc.tip.glare":"Évitez les reflets de lumière.","native.doc.tip.frame":"Gardez toute la pièce dans le cadre.","native.doc.openCamera":"Ouvrir la caméra","native.doc.changeDocument":"Changer de document","native.doc.titleOf.carte_identite":"Photographiez votre carte d'identité","native.doc.titleOf.passport":"Photographiez votre passeport","native.doc.titleOf.residence_permit":"Photographiez votre titre de séjour","native.doc.titleOf.drivers_license":"Photographiez votre permis de conduire","native.doc.onlyType.carte_identite":"{country} : seule la carte d'identité est acceptée ici.","native.doc.onlyType.passport":"{country} : seul le passeport est accepté ici.","native.doc.onlyType.residence_permit":"{country} : seul le titre de séjour est accepté ici.","native.doc.onlyType.drivers_license":"{country} : seul le permis de conduire est accepté ici.","native.scan.closer":"Approchez un peu","native.scan.farther":"Reculez un peu","native.scan.glare":"Inclinez un peu la carte","native.scan.dark":"Trop sombre. Allumez la lampe.","native.scan.blurry":"Image floue. Tenez le téléphone immobile.","native.scan.holdStill":"Ne bougez plus","native.scan.reading":"Vérification de votre document…","native.scan.putDown":"Vous pouvez poser votre pièce.","native.scan.retry":"Réessayons","native.scan.seenPassport":"Ceci ressemble à un passeport","native.scan.seenCard":"Ceci ressemble à une carte d'identité ou un titre de séjour","native.scan.showInstead.carte_identite":"Montrez plutôt votre carte d'identité","native.scan.showInstead.passport":"Montrez plutôt la page photo de votre passeport","native.scan.showInstead.residence_permit":"Montrez plutôt votre titre de séjour","native.scan.showInstead.drivers_license":"Montrez plutôt votre permis de conduire","native.scan.expired":"Ce document a expiré. Scannez un document valide."};var _e=class _e{constructor(){this.shown=null;this.shownAt=0;this.yielded=null;this.shownPhotos=0}present(t,o,r,a,m=0){(t===null||t.key!==this.yielded)&&(this.yielded=null);let f=this.shown;return t!==null&&this.yielded===null?f?.kind==="problem"&&f.key===t.key&&f.action===t.action?(this.shownPhotos=m,!t.blocking&&o!==null&&a-this.shownAt>=3e3?(this.yielded=t.key,this.show({kind:"hint",key:o,action:null},a,m)):f):this.show({kind:"problem",key:t.key,action:t.action},a,m):f?.kind==="problem"&&t===null&&m===this.shownPhotos&&(r||a-this.shownAt<3e3)?f:o===null?this.show(null,a):f?.kind==="hint"&&f.key===o?f:this.show({kind:"hint",key:o,action:null},a)}show(t,o,r=this.shownPhotos){return this.shown=t,this.shownAt=o,this.shownPhotos=r,t}};s(_e,"NoticeBand");var ue=_e;var Lt=["locking","capturing"],Ce=class Ce{constructor(){this.shown={hint:null,locking:!1,card:null,manualShutter:!1};this.candidate=null;this.candidateSince=0;this.hintShownAt=0;this.lockLostAt=null;this.detectedSince=null;this.lostSince=null;this.shutterSince=null}present(t,o){return this.presentHint(t,o),this.presentLock(t,o),this.presentCard(t,o),this.shutterSince=t.manualShutter?this.shutterSince??o:null,this.shown={...this.shown,manualShutter:this.shutterSince!==null&&o-this.shutterSince>=1e3},this.shown}presentHint(t,o){let r=t.phase==="framing"&&!(t.hint==="blurry"&&t.card===null)?t.hint:null;if(t.phase!=="framing"){this.shown={...this.shown,hint:null},this.candidate=null;return}if(r!==this.candidate&&(this.candidate=r,this.candidateSince=o),r===this.shown.hint)return;let a=o-this.candidateSince>=(r===null?0:350),m=this.shown.hint===null||o-this.hintShownAt>=2500;a&&m&&(this.shown={...this.shown,hint:r},this.hintShownAt=o)}presentLock(t,o){if(Lt.includes(t.phase)){this.shown={...this.shown,locking:!0},this.lockLostAt=null;return}if(this.shown.locking){if(t.phase!=="framing"){this.shown={...this.shown,locking:!1},this.lockLostAt=null;return}this.lockLostAt??(this.lockLostAt=o),o-this.lockLostAt>=300&&(this.shown={...this.shown,locking:!1},this.lockLostAt=null)}}presentCard(t,o){let r=t.card;if(r===null||t.phase!=="framing"){if(t.phase!=="framing"){this.shown={...this.shown,card:null},this.detectedSince=null,this.lostSince=null;return}this.detectedSince=null,this.lostSince??(this.lostSince=o),o-this.lostSince>=300&&(this.shown={...this.shown,card:null});return}if(this.lostSince=null,this.detectedSince??(this.detectedSince=o),o-this.detectedSince<250)return;let a=this.shown.card;if(a===null){this.shown={...this.shown,card:{...r}};return}let m=.35;this.shown={...this.shown,card:{fill:a.fill+(r.fill-a.fill)*m,offsetX:a.offsetX+(r.offsetX-a.offsetX)*m,offsetY:a.offsetY+(r.offsetY-a.offsetY)*m}}}};s(Ce,"ScanPresenter");var pe=Ce;import{Fragment as Ne,jsx as n,jsxs as d}from"react/jsx-runtime";var Rt={en:J,fr:lt,ar:ct,es:J,pt:J,de:J},It=450,ze=s(e=>(t,o)=>Qe(e.strings[t]??Rt[e.locale][t]??"",o),"useScanCopy");function Ht(e,t){try{return new Intl.DisplayNames([t],{type:"region"}).of(e)??e}catch{return e}}s(Ht,"regionName");function $t(e){let t=e.documentType,o=t===null?"native.doc.introTitle":`native.doc.titleOf.${t}`,r=t!==null&&e.issuer!==null&&Mt(e.documents,e.issuer).length===1;return{titleKey:o,onlyKey:r?`native.doc.onlyType.${t}`:null}}s($t,"introCopy");function me({name:e}){return n("svg",{className:"sekyro-glyph",viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",focusable:"false",dangerouslySetInnerHTML:{__html:ot[e]}})}s(me,"ScanGlyph");var Ot={en:Q,fr:at,ar:rt,es:Q,pt:Q,de:Q},Ut={en:Z,fr:it,ar:st,es:Z,pt:Z,de:Z},Et="image/jpeg,image/png,image/heic,image/heif";function G(e){let t=e.strings,o=s(r=>t[r]??Ut[e.locale][r],"text");return{t:s(r=>o(r)??"","t")}}s(G,"uploadCopy");function At(e,t){return e===null||e.state==="fallback"||e.state==="mismatch"||e.state==="expired"?null:e.state==="searching"?t?"dcv3.mrz.searching":"dcv3.mrz.showMrzSide":e.state==="valid"?"dcv3.mrz.valid":e.coach==="holdStill"?"dcv3.mrz.holdStill":"dcv3.mrz.reading"}s(At,"mrzInstruction");function Kt(e){return e?.state==="reading"&&e.coach!==void 0&&e.coach!=="holdStill"?`mrz:${e.coach}`:null}s(Kt,"mrzHint");function Bt(e){return e==="carte_identite"||e==="passport"||e==="residence_permit"||e==="drivers_license"?`native.scan.showInstead.${e}`:null}s(Bt,"showInsteadKey");var Vt={document_type_mismatch:"doc.reason_document_type_mismatch",document_number_invalid:"doc.reason_document_number_invalid",provider_unavailable:"doc.reason_provider_unavailable",document_type_not_supported:"doc.reason_document_type_not_supported",document_sides_mismatch:"doc.reason_document_sides_mismatch",document_side_not_read:"doc.reason_document_side_not_read"};function xe(e){if(e.reason==="unreadable")return"doc.reason_unreadable";let t=e.reason!==void 0?Vt[e.reason]:void 0;return t!==void 0?t:e.reason==="tester_document_mismatch"?"reasons.tester_document_mismatch":e.reason!==void 0&&e.reason!=="side_missing"?Fe(e.reason):null}s(xe,"reasonOf");var pt=new Set(["document_type_not_accepted","tester_document_mismatch","document_type_mismatch","provider_unavailable","document_type_not_supported","document_sides_mismatch","document_side_not_read"]);function Vn({step:e,i18n:t,liveMrz:o,barcodeAssetBaseUrl:r,ageLead:a,...m}){let[f,u]=k(!1),y=L(-1),[v,S]=k("idle"),_=L(null),N=typeof e.uploadDocument=="function",C=N?e.photo?.source??"camera":"camera",M=N&&C!=="camera"&&e.photo?.uploadOffered===!0,[w,B]=k(null),I=C==="upload"?"upload":C==="choice"?w??e.photo?.pick??"source":"camera",E=v==="sending"?void 0:()=>_.current?.click(),g=s(async V=>{let X=V.currentTarget.files?.[0];if(V.currentTarget.value="",X!==void 0){u(!1),S("sending");try{await e.uploadDocument(X),S("idle")}catch(ee){S(ee instanceof TypeError&&ee.message==="unsupported_file"?"unsupported":"failed")}}},"onFile"),q=M?n("input",{ref:_,type:"file",accept:Et,hidden:!0,"data-testid":"sekyro-doc-upload","aria-label":G(t).t("doc.uploadTitle"),onChange:V=>{g(V)}}):null,x=G(t),F=e.photo?.cameraOnPhone===!0;return I==="camera"&&F?n(tt,{i18n:t,lead:t.t("handoff.lead.document"),refresh:e.refresh,actions:n($,{kind:"ghost",full:!0,onClick:()=>B("upload"),children:x.t("doc.source.upload")})}):I==="source"?n(nt,{testId:"sekyro-doc-source",title:x.t("doc.source.title"),lead:x.t("doc.source.description"),cameraLabel:F?t.t("capture.source.phone"):x.t("doc.source.camera"),onPhone:F,uploadLabel:x.t("doc.source.upload"),notice:n(Te,{step:e,i18n:t}),onCamera:()=>B("camera"),onUpload:()=>B("upload")}):I==="upload"?d(Ne,{children:[n(Ft,{step:e,i18n:t,ageLead:a===!0,upload:v,offered:M,onPick:()=>_.current?.click(),...C==="choice"?{onCamera:s(()=>B("camera"),"onCamera")}:{},...m}),q]}):d(Ne,{children:[f?n(jt,{step:e,i18n:t,attempts:y,...o!==void 0?{liveMrz:o}:{},...r!==void 0?{barcodeAssetBaseUrl:r}:{},...M&&E!==void 0?{onUpload:E}:{},onClose:()=>u(!1)}):n(Gt,{step:e,i18n:t,ageLead:a===!0,onOpen:()=>u(!0),upload:v,...M&&E!==void 0?{onUpload:E}:{},...m}),q]})}s(Vn,"DocumentCaptureView");function mt({passport:e}){let o=Math.round(228/(e?1.42:1.586));return d("svg",{className:`sekyro-mark sekyro-mark--card${e?" sekyro-mark--passport":""}`,viewBox:`-12 ${e?-22:-12} 252 ${o+(e?34:24)}`,"aria-hidden":"true",focusable:"false",children:[n("defs",{children:n("clipPath",{id:"sekyro-card-clip",children:n("rect",{width:228,height:o,rx:"12.5"})})}),e?n("rect",{className:"sekyro-mark__page",x:"10",y:"-14",width:208,height:o,rx:"10"}):null,n("rect",{className:"sekyro-mark__card",width:228,height:o,rx:"12.5"}),n("rect",{className:"sekyro-mark__photo",x:"17",y:"17",width:"55",height:o*(e?.5:.62),rx:"6"}),[0,1,2].map(r=>n("rect",{className:"sekyro-mark__text",x:"88",y:23+r*o*.12,width:100-r*20,height:"6",rx:"3"},r)),e?[0,1].map(r=>n("line",{className:"sekyro-mark__code",x1:"17",x2:211,y1:o*.75+r*11,y2:o*.75+r*11},r)):n("rect",{className:"sekyro-mark__text",x:"88",y:23+3*o*.12,width:"60",height:"6",rx:"3"}),n("g",{clipPath:"url(#sekyro-card-clip)",children:n("g",{className:"sekyro-mark__read",style:{"--sekyro-read-w":"228px"},children:n("rect",{x:"-1",width:"2",height:o,className:"sekyro-mark__beam"})})}),n("path",{className:"sekyro-mark__brackets",d:Yt(-10,-10,248,o+20,16,30)})]})}s(mt,"ScanMark");function Yt(e,t,o,r,a,m){let f=Math.min(a,m*.6);return[[e,t,1,1],[e+o,t,-1,1],[e,t+r,1,-1],[e+o,t+r,-1,-1]].map(([y,v,S,_])=>`M${y} ${v+_*m}V${v+_*f}Q${y} ${v} ${y+S*f} ${v}H${y+S*m}`).join("")}s(Yt,"brackets");function Gt({step:e,i18n:t,ageLead:o,onOpen:r,onChangeCountry:a,onChangeDocument:m,upload:f,onUpload:u}){let y=ze(t),v=G(t),S=e.documentType==="passport",_=$t(e),N=xe(e),C=f==="sending",M=ut(Je)?.busy===!0;return d("section",{className:"sekyro-step sekyro-step--doc-intro","data-testid":"sekyro-document",children:[n(mt,{passport:S}),n(we,{title:y(_.titleKey)||y("native.doc.introTitle"),lead:o?t.t("doc.ageStepUp"):y("native.doc.introLead")}),_.onlyKey!==null&&e.issuer!==null?n("p",{className:"sekyro-text-muted sekyro-doc-only",children:y(_.onlyKey,{country:Ht(e.issuer,t.locale)})}):null,n(Te,{step:e,i18n:t}),e.reason!==void 0&&pt.has(e.reason)?null:d("ul",{className:"sekyro-tiprows",children:[d("li",{children:[n(O,{name:S?"passport":"card"}),y("native.doc.tip.flat")]}),d("li",{children:[n(O,{name:"light"}),y("native.doc.tip.glare")]}),d("li",{children:[n(me,{name:"image"}),y("native.doc.tip.frame")]})]}),n(ht,{i18n:t,...m!==void 0?{onChangeDocument:m}:{},...a!==void 0?{onChangeCountry:a}:{}}),n(ft,{i18n:t,upload:f}),C?n("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):u!==void 0?n("p",{className:"sekyro-text-muted",children:v.t("doc.uploadHint")}):null,d(be,{children:[d($,{full:!0,onClick:r,disabled:C||M,children:[n(O,{name:"camera"}),y("native.doc.openCamera")]}),u!==void 0?d($,{full:!0,kind:"ghost",onClick:u,children:[n(me,{name:"image"}),v.t("doc.uploadInstead")]}):null]})]})}s(Gt,"DocumentIntro");function Te({step:e,i18n:t}){let o=xe(e);return o===null&&e.reasonHidden===!0?n(le,{tone:"info",children:n("span",{children:de(t,e.attemptsRemaining,e.attemptsExhausted)})}):o===null?null:d(le,{tone:"warning",children:[n("span",{children:t.t(o)}),n("span",{children:de(t,e.attemptsRemaining,e.attemptsExhausted)})]})}s(Te,"ReasonNotice");function ht({i18n:e,onChangeCountry:t,onChangeDocument:o}){let r=ze(e);return o===void 0&&t===void 0?null:d("div",{className:"sekyro-links",children:[o!==void 0?n("button",{type:"button",className:"sekyro-link",onClick:o,children:r("native.doc.changeDocument")}):null,t!==void 0?n("button",{type:"button",className:"sekyro-link",onClick:t,children:e.t("native.doc.changeCountry")}):null]})}s(ht,"ChangeLinks");function ft({i18n:e,upload:t}){return t!=="unsupported"&&t!=="failed"?null:n(le,{tone:"warning",children:n("span",{children:G(e).t(t==="unsupported"?"doc.uploadUnsupported":"doc.uploadFailed")})})}s(ft,"UploadNotice");function Ft({step:e,i18n:t,ageLead:o,upload:r,offered:a,onPick:m,onCamera:f,onChangeCountry:u,onChangeDocument:y}){let v=G(t),S=r==="sending";return d("section",{className:"sekyro-step","data-testid":"sekyro-doc-upload-screen",children:[n(mt,{passport:e.documentType==="passport"}),n(we,{title:v.t("doc.uploadTitle"),lead:o?t.t("doc.ageStepUp"):v.t("doc.uploadHint")}),o?n("p",{className:"sekyro-text-muted",children:v.t("doc.uploadHint")}):null,n(Te,{step:e,i18n:t}),n(ht,{i18n:t,...y!==void 0?{onChangeDocument:y}:{},...u!==void 0?{onChangeCountry:u}:{}}),n(ft,{i18n:t,upload:r}),S?n("p",{className:"sekyro-text-muted",role:"status",children:t.t("doc.uploading")}):null,d(be,{children:[d($,{full:!0,onClick:m,disabled:S||!a||e.attemptsExhausted,children:[n(me,{name:"image"}),v.t("doc.source.upload")]}),f!==void 0?d($,{full:!0,kind:"ghost",onClick:f,disabled:S,children:[n(O,{name:"camera"}),v.t("doc.source.camera")]}):null]})]})}s(Ft,"DocumentUploadScreen");function dt(e,t,o){let r=e*.88,a=r/o;return{x:(e-r)/2,y:t*.42-a/2,w:r,h:a}}s(dt,"guideRect");var Xt={"mrz:moveCloser":"dcv3.mrz.moveCloser","mrz:turnSideways":"dcv3.mrz.turnSideways","mrz:glare":"dcv3.mrz.glare",too_far:"native.scan.closer",too_close:"native.scan.farther",focus_far:"native.scan.farther",glare:"native.scan.glare",too_bright:"native.scan.glare",too_dark:"native.scan.dark",blurry:"native.scan.blurry"},Wt=s(()=>typeof window<"u"&&window.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0,"reduceMotion");function jt({step:e,i18n:t,liveMrz:o,barcodeAssetBaseUrl:r,onClose:a,attempts:m,onUpload:f}){let u=ze(t),y=ut(Xe),v=L(y);v.current=y;let S=L(null),_=L(null),N=L(null),[C,M]=k("idle"),[w,B]=k(null),[I,E]=k(null),[g,q]=k({w:0,h:0}),[x,F]=k({hint:null,locking:!1,card:null,manualShutter:!1}),[V,X]=k({}),[ee,Le]=k({}),[Me,Pe]=k(null),[Re,yt]=k(null),[Ie,He]=k(0),[he,$e]=k(null),[fe,vt]=k(null),[te,gt]=k(0),ne=L(0);ne.current=te;let[St,Oe]=k(0),Ue=L(0),oe=L(null);U(()=>{Oe(ne.current)},[e.reason,e.attemptsRemaining]);let A=e.documentType==="passport",re=A?1.42:1.586;Ze(!0),Pt(()=>{let c=S.current;if(c===null)return;let h=s(()=>q({w:c.clientWidth,h:c.clientHeight}),"measure");if(h(),typeof ResizeObserver>"u")return;let p=new ResizeObserver(h);return p.observe(c),()=>p.disconnect()},[]);let i=dt(g.w,g.h,re);U(()=>{g.w===0||g.h===0||N.current?.setGuide?.({viewAspect:g.w/g.h,rect:{x:i.x/g.w,y:i.y/g.h,width:i.w/g.w,height:i.h/g.h}})},[g.w,g.h,i.x,i.y,i.w,i.h]),U(()=>{let c=_.current;if(c===null)return;let h=e.capture({video:c,...o!==void 0?{liveMrz:o}:{},...r!==void 0?{barcodeAssetBaseUrl:r}:{}});N.current=h,X({}),Le({}),Pe(null);let p=S.current;if(p!==null&&p.clientWidth>0&&p.clientHeight>0){let l=dt(p.clientWidth,p.clientHeight,re);h.setGuide?.({viewAspect:p.clientWidth/p.clientHeight,rect:{x:l.x/p.clientWidth,y:l.y/p.clientHeight,width:l.w/p.clientWidth,height:l.h/p.clientHeight}})}let T=new pe,D={scan:null,feedback:null,gate:null,mrz:null},H=s(l=>{D={...D,...l};let b=D.gate?.guide,Tt={phase:D.scan?.phase??"framing",hint:D.feedback?.reticle==="coaching"?D.feedback.key:e.documentType==="drivers_license"?null:Kt(D.mrz),card:b?.detected?{fill:b.fill,offsetX:b.offsetX,offsetY:b.offsetY}:null,manualShutter:D.scan?.manualShutter??!1},W=T.present(Tt,performance.now());F(j=>j.hint===W.hint&&j.locking===W.locking&&j.manualShutter===W.manualShutter&&tn(j.card,W.card)?j:W)},"present"),xt=[h.on("state",M),h.on("feedback",l=>H({feedback:l})),h.on("gate",l=>H({gate:l})),h.on("scan",l=>{l.captured.length===0&&Ue.current>0&&Oe(ne.current),Ue.current=l.captured.length,oe.current=(oe.current??l.captured).filter(b=>l.captured.includes(b)),B(l),H({scan:l})}),h.on("captured",l=>{gt(b=>b+1),X(b=>({...b,[qt(l.side,A,b)]:l.previewDataUrl})),l.photo!==void 0&&Le(b=>({...b,[l.photo]:l.previewDataUrl})),Pe(l.previewDataUrl),yt(nn(c))}),h.on("error",l=>{E(l);let b=v.current;b!==null&&je(b,We("document",l,Math.max(0,m.current)))}),h.on("mrz",l=>{l.state==="mismatch"?vt({format:l.format??null,at:ne.current}):($e(l),H({mrz:l}))})];return m.current+=1,h.start().catch(()=>{}),()=>{oe.current=null;for(let l of xt)l();h.destroy(),N.current=null}},[e.issuer,e.documentType]);let P=w?.phase??"framing",R=P==="reading"||P==="result",ae=P==="flipCue"||P==="reaskRecto",K=x.locking,Ee=w?.captured.length??0;U(()=>{K&&He(c=>c+1)},[K]),U(()=>{Ee>0&&He(c=>c+1)},[Ee]);let kt=w?.expected??null;U(()=>{$e(null)},[kt]);let ye=ae||R||e.documentType==="drivers_license"?null:At(he,A),Ae=s(c=>t.strings[c]??Ot[t.locale][c],"liveText"),wt=s(c=>c.startsWith("dcv3.")?Ae(c):u(c),"copy"),ve=ye!==null?Ae(ye):u(P==="flipCue"?"doc.flip":P==="reaskRecto"?"doc.reaskRecto":R?"native.scan.reading":P==="locking"||P==="capturing"||K?"native.scan.holdStill":A?"doc.showPage":"doc.showSide"),se=e.browserCheck??null,ge=se!==null&&R,ie=xe(e),Ke=s(c=>({key:u(c),action:de(t,e.attemptsRemaining,e.attemptsExhausted),blocking:e.reason!==void 0&&pt.has(e.reason)}),"reasonProblem"),Be=Bt(e.documentType),bt=he?.state==="expired"&&!ae&&!R?{key:u("native.scan.expired"),action:null,blocking:!0}:fe!==null&&te<=fe.at+1?{key:u(fe.format==="TD3"?"native.scan.seenPassport":"native.scan.seenCard"),action:Be===null?null:u(Be),blocking:!0}:w?.notice==="same_face"?{key:u("doc.sameFace"),action:null,blocking:!1}:w?.notice==="reread"?ie!==null?Ke(ie):{key:u("doc.reread"),action:null,blocking:!1}:w?.notice==="technical"?{key:u("native.scan.retry"),action:null,blocking:!1}:w?.notice==="blurry"?{key:u("native.scan.blurry"),action:null,blocking:!1}:ie!==null&&te===St?Ke(ie):null,_t=x.hint===null?null:wt(Xt[x.hint]??`dcv2.${x.hint}`),Ve=Qt(bt,_t,K||P==="capturing"||R,te),Y=x.card,z=i;if(!K&&Y!==null&&Y.fill>=.45&&Y.fill<=1.25&&!Wt()){let c=i.w*Y.fill,h=c/re,p=i.x+i.w/2+i.w*Math.max(-.25,Math.min(.25,Y.offsetX)),T=i.y+i.h/2+i.h*Math.max(-.25,Math.min(.25,Y.offsetY));z={x:p-c/2,y:T-h/2,w:c,h}}let ce=i.w*.045,Se=28,Ye=Math.min(ce,Se*.6),Ct=[[z.x,z.y,1,1],[z.x+z.w,z.y,-1,1],[z.x,z.y+z.h,1,-1],[z.x+z.w,z.y+z.h,-1,-1]],Dt=K?"is-locked":Ve!==null?"is-coaching":"",Nt=A?[{side:"single",label:"doc.progressPage"}]:[{side:"recto",label:"doc.progressFront"},{side:"verso",label:"doc.progressBack"}],zt=i.y+i.h+16,ke={insetInlineStart:i.x,insetBlockStart:i.y,inlineSize:i.w,blockSize:i.h,borderRadius:ce};return n("section",{className:"sekyro-lm","aria-label":ve,"data-testid":"sekyro-document",children:d("div",{ref:S,className:`sekyro-lm-stage${R?" is-reading":""}${ae?" is-flip":""}`,style:{"--sekyro-guide-w":`${i.w}px`},children:[n("video",{ref:_,className:"sekyro-lm-video",playsInline:!0,muted:!0,autoPlay:!0,"aria-hidden":"true",onPointerUp:c=>{let h=c.currentTarget,p=h.getBoundingClientRect(),T=Math.max(p.width/(h.videoWidth||1),p.height/(h.videoHeight||1)),D=h.videoWidth*T,H=h.videoHeight*T;D>0&&H>0&&N.current?.focusAt((c.clientX-p.left+(D-p.width)/2)/D,(c.clientY-p.top+(H-p.height)/2)/H)}}),g.w>0?d(Ne,{children:[R&&Re!==null?n("img",{className:"sekyro-lm-scene",src:Re,alt:""}):null,R&&Me!==null?n("img",{className:"sekyro-lm-frozen",src:Me,alt:"",style:ke}):null,d("svg",{className:"sekyro-lm-overlay",viewBox:`0 0 ${g.w} ${g.h}`,"aria-hidden":"true",focusable:"false",children:[d("defs",{children:[d("linearGradient",{id:"sekyro-lm-top",x1:"0",y1:"0",x2:"0",y2:"1",children:[n("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0.85"}),n("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0"})]}),d("linearGradient",{id:"sekyro-lm-bottom",x1:"0",y1:"0",x2:"0",y2:"1",children:[n("stop",{offset:"0",className:"sekyro-lm-ink",stopOpacity:"0"}),n("stop",{offset:"1",className:"sekyro-lm-ink",stopOpacity:"0.9"})]})]}),n("path",{className:"sekyro-lm-scrim",fillRule:"evenodd",d:`M0 0H${g.w}V${g.h}H0Z${en(i,ce)}`}),n("rect",{width:g.w,height:Math.max(0,i.y),fill:"url(#sekyro-lm-top)"}),n("rect",{y:i.y+i.h,width:g.w,height:Math.max(0,g.h-i.y-i.h),fill:"url(#sekyro-lm-bottom)"}),n("g",{className:`sekyro-lm-brackets ${Dt}`,children:Ct.map(([c,h,p,T],D)=>n("path",{style:{transform:`translate(${c}px, ${h}px) scale(${p}, ${T})`},d:`M0 ${Se}V${Ye}Q0 0 ${Ye} 0H${Se}`},D))}),K?n("rect",{className:"sekyro-lm-trace",x:i.x,y:i.y,width:i.w,height:i.h,rx:ce,pathLength:"1",style:{animationDuration:`${It}ms`}}):null]}),n("div",{className:"sekyro-lm-slot",style:ke,"aria-hidden":"true",children:R?n("span",{className:"sekyro-lm-read is-repeating"}):Ie>0?n("span",{className:"sekyro-lm-read"},Ie):null})]}):null,ye!==null?n("div",{className:"sekyro-lm-slot",style:ke,"aria-hidden":"true",children:n("span",{"data-testid":"sekyro-mrz-strip",className:`sekyro-lm-mrz${A?" is-page":""}${he?.state==="valid"?" is-valid":""}`})}):null,n("div",{className:"sekyro-lm-instruction",style:{insetBlockStart:i.y-64},children:n("div",{role:"status","aria-live":"polite","data-testid":"sekyro-scan-instruction",children:ge?null:n(et,{swapKey:ve,className:"sekyro-lm-line",children:ve})})}),d("div",{className:"sekyro-lm-below",style:{insetBlockStart:zt,inlineSize:i.w,insetInlineStart:i.x},children:[n(Zt,{band:Ve}),ge?null:R?d("p",{className:"sekyro-lm-note",children:[n("span",{className:"sekyro-lm-spinner","aria-hidden":"true"}),u("native.scan.putDown")]}):ae?n("div",{className:`sekyro-lm-flip${P==="reaskRecto"?" is-toFront":""}`,"data-testid":"sekyro-flip-cue","aria-hidden":"true",children:d("span",{className:"sekyro-lm-flip-card",style:{aspectRatio:String(re)},children:[n("span",{className:"sekyro-lm-flip-front"}),n("span",{className:"sekyro-lm-flip-back"})]})}):null]}),d("div",{className:"sekyro-lm-controls",children:[d("div",{className:"sekyro-lm-bar",children:[n("button",{type:"button",className:"sekyro-glass","aria-label":t.t("native.close"),onClick:a,children:n(O,{name:"close"})}),w?.torchAvailable?n("button",{type:"button",className:`sekyro-glass${w.torch?" is-on":""}`,"aria-label":t.t("doc.torchOn"),"aria-pressed":w.torch,onClick:()=>N.current?.setTorch(!w.torch),children:n(me,{name:"flashlight"})}):null]}),I!==null?d("div",{className:"sekyro-lm-error",role:"alert",children:[n("p",{children:t.t("doc.cameraBlocked")}),n("p",{children:t.t(I.kind==="permission"?"doc.cameraBlockedHint":Ge(I.kind))}),n($,{onClick:()=>{E(null),m.current+=1,N.current?.retry()},children:t.t("doc.retryCamera")})]}):null,se!==null&&I===null?d("div",{className:"sekyro-lm-error",role:"alert","data-testid":"sekyro-doc-browser-check",children:[n("p",{children:t.t(se.code==="clock_wrong"?"errors.device_clock":"errors.attestation_invalid")}),n($,{onClick:se.retry,children:t.t("common.retry")})]}):null,x.manualShutter?n("button",{type:"button",className:"sekyro-shutter","aria-label":t.t("doc.shutter"),onClick:()=>N.current?.shutter()}):null,n("ol",{className:"sekyro-lm-tray",children:Nt.map(({side:c,label:h})=>{let p=w?.captured.includes(c)??!1,T=Jt(c,w,ee,V);return d("li",{className:p?"is-done":void 0,"aria-current":!p&&(A||w?.expected===c)?"step":void 0,children:[p?d("span",{className:"sekyro-lm-thumb",children:[T!==void 0?n("img",{src:T,alt:""}):n(O,{name:"card"}),n("svg",{className:"sekyro-lm-check",viewBox:"0 0 18 18","aria-hidden":"true",children:n("path",{d:"M5 9.2l2.6 2.6L13 6.4"})})]}):null,u(h),p&&T===void 0&&oe.current?.includes(c)?n("span",{className:"sekyro-lm-received",children:u("doc.sideReceived")}):null]},c)})}),f!==void 0?n("button",{type:"button",className:"sekyro-lm-upload",onClick:f,children:G(t).t("doc.uploadInstead")}):null,C==="uploading"||C==="checking"?null:n(qe,{onStop:a})]}),!ge&&(C==="uploading"||C==="checking")?n("span",{className:"sekyro-visually-hidden",role:"status",children:C==="uploading"?t.t("doc.uploading"):u("native.scan.reading")}):null]})})}s(jt,"LumiereScan");function Qt(e,t,o,r){let a=L(null);a.current??(a.current=new ue);let[m,f]=k(null),u=L({problem:e,hint:t,busy:o,photos:r});u.current={problem:e,hint:t,busy:o,photos:r};let y=e===null?null:`${e.blocking}|${e.key}|${e.action??""}`;return U(()=>{let v=s(()=>{let{problem:_,hint:N,busy:C,photos:M}=u.current;f(a.current?.present(_,N,C,performance.now(),M)??null)},"run");v();let S=setInterval(v,250);return()=>clearInterval(S)},[y,t,o,r]),m}s(Qt,"useNoticeBand");function Zt({band:e}){let[t,o]=k(e);U(()=>{e!==null&&o(e)},[e]);let r=e??t;return n("div",{className:`sekyro-lm-band${e!==null?" is-open":""}`,"data-testid":"sekyro-scan-notice",children:n("div",{role:"status","aria-live":"polite","aria-atomic":"true",children:r!==null?d("div",{className:"sekyro-notice sekyro-notice--warning","data-kind":r.kind,"aria-hidden":e===null||void 0,children:[n("span",{className:"sekyro-notice__icon","aria-hidden":"true",children:n(O,{name:"warning"})}),d("div",{className:"sekyro-notice__body",children:[n("span",{children:r.key}),r.action!==null&&r.action!==""?n("span",{children:r.action}):null]})]}):null})})}s(Zt,"NoticeBandView");function Jt(e,t,o,r){if(t?.photos===void 0)return r[e];let a=t.photos[e];return a===void 0?void 0:o[a]}s(Jt,"thumbOf");function qt(e,t,o){return t?"single":e==="recto"||e==="verso"?e:o.recto===void 0?"recto":"verso"}s(qt,"slotOf");function en({x:e,y:t,w:o,h:r},a){return`M${e+a} ${t}H${e+o-a}Q${e+o} ${t} ${e+o} ${t+a}V${t+r-a}Q${e+o} ${t+r} ${e+o-a} ${t+r}H${e+a}Q${e} ${t+r} ${e} ${t+r-a}V${t+a}Q${e} ${t} ${e+a} ${t}Z`}s(en,"roundedRect");var De=.004;function tn(e,t){return e===null||t===null?e===t:Math.abs(e.fill-t.fill)<De&&Math.abs(e.offsetX-t.offsetX)<De&&Math.abs(e.offsetY-t.offsetY)<De}s(tn,"sameCard");function nn(e){let t=Math.round(e.videoWidth/4),o=Math.round(e.videoHeight/4);if(t===0||o===0||typeof document>"u")return null;try{let r=document.createElement("canvas");r.width=t,r.height=o;let a=r.getContext("2d");return a===null?null:(a.drawImage(e,0,0,t,o),r.toDataURL("image/jpeg",.7))}catch{return null}}s(nn,"sceneSnapshot");export{Vn as DocumentCaptureView,It as LOCK_TRACE_MS,Et as UPLOAD_ACCEPT,dt as guideRect,$t as introCopy,Kt as mrzHint,At as mrzInstruction,tn as sameCard,Bt as showInsteadKey,qt as slotOf,Jt as thumbOf};