@41devs/naya-id-js 0.1.0 → 0.3.0
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/README.md +117 -208
- package/dist/naya-id.cjs +422 -207
- package/dist/naya-id.cjs.map +1 -1
- package/dist/naya-id.d.cts +233 -81
- package/dist/naya-id.d.ts +233 -81
- package/dist/naya-id.min.js +422 -207
- package/dist/naya-id.min.js.map +1 -1
- package/dist/naya-id.mjs +422 -207
- package/dist/naya-id.mjs.map +1 -1
- package/package.json +36 -4
package/dist/naya-id.cjs
CHANGED
|
@@ -1,222 +1,385 @@
|
|
|
1
|
-
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var
|
|
2
|
-
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var B=[{code:"BJ",label:"B\xE9nin"},{code:"CI",label:"C\xF4te d'Ivoire"},{code:"SN",label:"S\xE9n\xE9gal"},{code:"ML",label:"Mali"},{code:"BF",label:"Burkina Faso"},{code:"TG",label:"Togo"}],Q=["cni","passeport","permis"],_e=["fr","en","pt"];function xe(a){return B.find(e=>e.code===a)?.label??a}function X(a){return a==="cni"}var De="#172062",Oe="#E6950A",Re="https://api.naya.41devs.com/v1",gt="'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif";function He(){let e=(typeof navigator<"u"&&navigator.language||"").slice(0,2).toLowerCase();return _e.includes(e)?e:"fr"}function J(a={}){let e=a.consent===false?false:{policyUrl:(typeof a.consent=="object"?a.consent.policyUrl:void 0)??"",version:(typeof a.consent=="object"?a.consent.version:void 0)??"2026-09"},t=typeof a.handoff=="boolean"?{enabled:a.handoff,baseUrl:""}:{enabled:a.handoff?.enabled??true,baseUrl:a.handoff?.baseUrl??""};return {country:a.country,documentTypes:a.documentTypes??Q,countries:a.countries??B.map(n=>n.code),locale:a.locale??He(),callbackUrl:a.callbackUrl,maxAttempts:a.maxAttempts??2,theme:{primaryColor:a.theme?.primaryColor??De,accentColor:a.theme?.accentColor??Oe,fontFamily:a.theme?.fontFamily??gt,radius:a.theme?.radius??"soft",mode:a.theme?.mode??"auto"},clientLogoUrl:a.clientLogoUrl,baseUrl:(a.baseUrl??Re).replace(/\/+$/,""),livenessAssets:a.livenessAssets??{},container:a.container??null,consent:e,confirmOcr:a.confirmOcr==="display"||a.confirmOcr==="edit"?a.confirmOcr:a.confirmOcr===true?"edit":false,capture:{autoCapture:a.capture?.autoCapture??true,maxDimension:a.capture?.maxDimension??1600,fileUpload:a.capture?.fileUpload??"auto"},liveness:{timeoutMs:a.liveness?.timeoutMs??45e3,allowPassive:a.liveness?.allowPassive??true,preload:a.liveness?.preload??true},handoff:t,eagerSession:a.eagerSession??false,telemetry:a.telemetry??true,debug:a.debug??false,haptics:a.haptics??true,strings:a.strings??{},onEvent:a.onEvent}}var vt={bg:"#FBFBFE",surface:"#FFFFFF",surface2:"#EEF0F7",line:"#D9DCEC",text:"#0A1160",text2:"#5B6185",success:"#0E9C85",successSoft:"#D6F7F0",warning:"#C27C05",warningSoft:"#FCF0D2",error:"#E0354C",errorSoft:"#FDE3E7",dark:"#0F1650"},bt={bg:"#0B1030",surface:"#141A46",surface2:"#1C2358",line:"#2B357F",text:"#F1F3FC",text2:"#B7BEE8",success:"#17C3A6",successSoft:"#0E3D36",warning:"#F3C77A",warningSoft:"#3D2E0A",error:"#FF7A8A",errorSoft:"#4A1A22",dark:"#060A20"},xt={sharp:{card:"6px",input:"4px",button:"8px"},soft:{card:"14px",input:"10px",button:"14px"},round:{card:"20px",input:"12px",button:"999px"}};function Fe(a){let e=a.trim().match(/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i);if(!e)return null;let t=e[1];t.length===3&&(t=t.split("").map(r=>r+r).join(""));let n=r=>{let s=parseInt(t.slice(r,r+2),16)/255;return s<=.03928?s/12.92:Math.pow((s+.055)/1.055,2.4)};return .2126*n(0)+.7152*n(2)+.0722*n(4)}function Ie(a,e){let t=Fe(a),n=Fe(e);if(t==null||n==null)return null;let[r,s]=t>n?[t,n]:[n,t];return (r+.05)/(s+.05)}function Pe(a,e="#FFFFFF",t="#0A1160"){let n=Ie(a,e)??0;return (Ie(a,t)??0)>=n?t:e}function we(a){if(a.theme.mode!=="auto")return a.theme.mode;try{return typeof matchMedia=="function"&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}catch{return "light"}}function $e(a,e=we(a)){let t=e==="dark"?bt:vt,n=xt[a.theme.radius],r=a.theme.primaryColor,s=a.theme.accentColor;return {"--naya-primary":r,"--naya-on-primary":Pe(r),"--naya-accent":s,"--naya-on-accent":Pe(s,"#FFFFFF",r),"--naya-success":t.success,"--naya-success-soft":t.successSoft,"--naya-warning":t.warning,"--naya-warning-soft":t.warningSoft,"--naya-error":t.error,"--naya-error-soft":t.errorSoft,"--naya-bg":t.bg,"--naya-surface":t.surface,"--naya-surface-2":t.surface2,"--naya-text":t.text,"--naya-text-2":t.text2,"--naya-line":t.line,"--naya-dark":t.dark,"--naya-font":a.theme.fontFamily,"--naya-r-card":n.card,"--naya-r-input":n.input,"--naya-r-button":n.button}}var Be=`
|
|
2
|
+
:host, .naya-host { all: initial; }
|
|
3
3
|
.naya-host {
|
|
4
|
-
position: fixed; inset: 0; z-index: 2147483000;
|
|
4
|
+
position: fixed; inset: 0; z-index: 2147483000;
|
|
5
|
+
display: flex; align-items: center; justify-content: center;
|
|
6
|
+
font-family: var(--naya-font); color: var(--naya-text);
|
|
7
|
+
background: rgba(10, 17, 96, .55);
|
|
8
|
+
-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
|
|
9
|
+
-webkit-text-size-adjust: 100%; text-size-adjust: 100%;
|
|
10
|
+
-webkit-font-smoothing: antialiased;
|
|
11
|
+
}
|
|
12
|
+
.naya-host.n-inline {
|
|
13
|
+
position: relative; inset: auto; z-index: auto; height: 100%; min-height: 560px;
|
|
14
|
+
background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
|
|
15
|
+
}
|
|
16
|
+
.naya-host *, .naya-host *::before, .naya-host *::after { box-sizing: border-box; }
|
|
17
|
+
.n-frame {
|
|
18
|
+
position: relative; width: 100%; height: 100%; overflow: hidden;
|
|
5
19
|
background: var(--naya-bg); color: var(--naya-text);
|
|
6
|
-
|
|
7
|
-
|
|
20
|
+
display: flex; flex-direction: column;
|
|
21
|
+
}
|
|
22
|
+
/* Ordinateur et tablette : carte centr\xE9e au format t\xE9l\xE9phone. La hauteur
|
|
23
|
+
suit la fen\xEAtre (fen\xEAtres basses, zoom 125 %) sans jamais retomber sur le
|
|
24
|
+
plein \xE9cran mobile, qui \xE9tirerait boutons et textes sur toute la largeur. */
|
|
25
|
+
@media (min-width: 720px) {
|
|
26
|
+
.naya-host:not(.n-inline) .n-frame {
|
|
27
|
+
width: min(480px, 100% - 32px); height: min(860px, 100% - 32px);
|
|
28
|
+
border-radius: 24px; box-shadow: 0 30px 80px rgba(4, 17, 136, .35);
|
|
29
|
+
}
|
|
8
30
|
}
|
|
9
|
-
.
|
|
10
|
-
.naya-host button { font-family: inherit; }
|
|
11
|
-
.naya-host h1, .naya-host p, .naya-host ul, .naya-host li { margin: 0; padding: 0; }
|
|
12
|
-
.naya-host img { max-width: 100%; }
|
|
13
|
-
.n-icon { display: inline-flex; line-height: 0; flex: 0 0 auto; }
|
|
14
|
-
@keyframes naya-spin { to { transform: rotate(360deg); } }
|
|
31
|
+
.n-inline .n-frame { border-radius: var(--naya-r-card); border: 1px solid var(--naya-line); }
|
|
15
32
|
|
|
16
|
-
/* \u2500\u2500 Gabarit
|
|
17
|
-
.n-shell { display: flex; flex-direction: column;
|
|
33
|
+
/* \u2500\u2500 Gabarit \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
34
|
+
.n-shell { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--naya-bg); color: var(--naya-text); }
|
|
18
35
|
.n-shell.n-dark { background: var(--naya-dark); color: #fff; }
|
|
19
|
-
.n-
|
|
20
|
-
.n-
|
|
36
|
+
.n-enter { animation: n-in .22s ease both; }
|
|
37
|
+
.n-enter-back { animation: n-in-back .22s ease both; }
|
|
38
|
+
.n-leave { animation: n-out .16s ease both; pointer-events: none; }
|
|
39
|
+
@keyframes n-in { from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: none; } }
|
|
40
|
+
@keyframes n-in-back { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: none; } }
|
|
41
|
+
@keyframes n-out { from { opacity: 1; } to { opacity: 0; } }
|
|
42
|
+
|
|
43
|
+
.n-bar {
|
|
44
|
+
display: flex; align-items: center; justify-content: space-between;
|
|
45
|
+
padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 4px;
|
|
46
|
+
min-height: 56px; flex: none;
|
|
47
|
+
}
|
|
21
48
|
.n-round {
|
|
22
|
-
width: 40px; height: 40px;
|
|
23
|
-
|
|
24
|
-
background:
|
|
49
|
+
width: 40px; height: 40px; border-radius: 50%; border: none; cursor: pointer;
|
|
50
|
+
display: inline-flex; align-items: center; justify-content: center;
|
|
51
|
+
background: var(--naya-surface-2); color: var(--naya-text);
|
|
52
|
+
transition: background .15s ease, transform .1s ease;
|
|
25
53
|
}
|
|
26
|
-
.n-
|
|
27
|
-
.n-round:
|
|
54
|
+
.n-round:hover { background: var(--naya-line); }
|
|
55
|
+
.n-round:active { transform: scale(.94); }
|
|
28
56
|
.n-round:focus-visible { outline: 2px solid var(--naya-accent); outline-offset: 2px; }
|
|
29
|
-
.n-
|
|
30
|
-
.n-
|
|
31
|
-
.n-dark .n-powered { color: rgba(255,255,255,.38); }
|
|
57
|
+
.n-dark .n-round { background: rgba(255,255,255,.14); color: #fff; }
|
|
58
|
+
.n-spacer { width: 40px; height: 40px; }
|
|
32
59
|
|
|
33
|
-
|
|
34
|
-
.n-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
60
|
+
.n-content { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
|
|
61
|
+
.n-powered {
|
|
62
|
+
flex: none; display: flex; align-items: center; justify-content: center; gap: 10px;
|
|
63
|
+
padding: 10px 16px calc(12px + env(safe-area-inset-bottom, 0px));
|
|
64
|
+
font-size: 11px; letter-spacing: .02em; color: var(--naya-text-2);
|
|
38
65
|
}
|
|
39
|
-
.n-
|
|
66
|
+
.n-dark .n-powered { color: rgba(255,255,255,.6); }
|
|
67
|
+
.n-client-logo { height: 18px; width: auto; max-width: 96px; object-fit: contain; }
|
|
68
|
+
|
|
69
|
+
.pad { display: flex; flex-direction: column; gap: 14px; min-height: 100%; padding: 4px 24px 24px; width: 100%; max-width: 560px; margin: 0 auto; }
|
|
70
|
+
.pad.center { align-items: center; text-align: center; justify-content: center; }
|
|
71
|
+
.spacer { flex: 1; min-height: 8px; }
|
|
72
|
+
.title { margin: 0; font-size: 26px; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; }
|
|
73
|
+
.title:focus { outline: none; }
|
|
74
|
+
.body { margin: 0; font-size: 15px; line-height: 1.5; color: var(--naya-text-2); }
|
|
75
|
+
.n-dark .body { color: rgba(255,255,255,.75); }
|
|
76
|
+
.sub { margin: 0; font-size: 14px; color: var(--naya-text-2); }
|
|
77
|
+
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
|
|
78
|
+
.n-ico { flex: none; }
|
|
79
|
+
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
|
|
40
80
|
|
|
41
|
-
|
|
42
|
-
.n-btn
|
|
81
|
+
/* \u2500\u2500 Boutons \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
82
|
+
.n-btn {
|
|
83
|
+
width: 100%; min-height: 52px; cursor: pointer; font: inherit; font-size: 15px; font-weight: 700;
|
|
43
84
|
display: inline-flex; align-items: center; justify-content: center; gap: 8px;
|
|
44
|
-
border
|
|
45
|
-
|
|
85
|
+
border-radius: var(--naya-r-button); padding: 0 18px;
|
|
86
|
+
transition: filter .15s ease, transform .1s ease, background .15s ease;
|
|
46
87
|
}
|
|
47
|
-
.n-btn
|
|
48
|
-
.n-btn
|
|
88
|
+
.n-btn:active:not(:disabled) { transform: scale(.985); }
|
|
89
|
+
.n-btn:disabled { opacity: .45; cursor: not-allowed; }
|
|
90
|
+
.n-btn-primary { border: none; background: var(--naya-accent); color: var(--naya-on-accent); font-weight: 800; }
|
|
91
|
+
.n-btn-primary:hover:not(:disabled) { filter: brightness(1.05); }
|
|
49
92
|
.n-btn-primary:focus-visible { outline: 2px solid var(--naya-primary); outline-offset: 2px; }
|
|
50
|
-
.n-btn-secondary {
|
|
51
|
-
|
|
52
|
-
background: transparent; color: var(--naya-primary); font-size: 15px; font-weight: 800;
|
|
53
|
-
}
|
|
54
|
-
.n-btn-secondary:hover { background: color-mix(in srgb, var(--naya-primary) 6%, transparent); }
|
|
93
|
+
.n-btn-secondary { background: transparent; border: 2px solid var(--naya-line); color: var(--naya-text); }
|
|
94
|
+
.n-btn-secondary:hover:not(:disabled) { background: var(--naya-surface-2); }
|
|
55
95
|
.n-btn-secondary:focus-visible { outline: 2px solid var(--naya-accent); outline-offset: 2px; }
|
|
96
|
+
.n-dark .n-btn-secondary { border-color: rgba(255,255,255,.35); color: #fff; }
|
|
97
|
+
.n-btn-ghost { background: transparent; border: none; color: var(--naya-primary); min-height: 44px; font-weight: 700; }
|
|
98
|
+
.n-btn-ghost:focus-visible { outline: 2px solid var(--naya-accent); outline-offset: 2px; }
|
|
99
|
+
.n-dark .n-btn-ghost { color: #fff; }
|
|
100
|
+
.cta { width: 100%; display: flex; flex-direction: column; gap: 10px; }
|
|
101
|
+
.gap { height: 4px; }
|
|
56
102
|
|
|
57
|
-
|
|
58
|
-
.n-
|
|
59
|
-
.n-
|
|
60
|
-
.n-
|
|
61
|
-
.n-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
.n-
|
|
65
|
-
.n-
|
|
66
|
-
.n-
|
|
67
|
-
.n-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
display: flex; align-items: center; justify-content: center; background: var(--naya-primary); color: var(--naya-accent);
|
|
72
|
-
}
|
|
73
|
-
.n-welcome .title {
|
|
74
|
-
margin: 28px 0 10px; text-align: center; text-wrap: balance;
|
|
75
|
-
font-size: 23px; font-weight: 800; line-height: 1.25; letter-spacing: -0.2px; color: var(--naya-primary);
|
|
103
|
+
/* \u2500\u2500 Alertes, champs \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
104
|
+
.n-alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--naya-r-card); font-size: 14px; line-height: 1.45; }
|
|
105
|
+
.n-alert .n-ico { margin-top: 2px; }
|
|
106
|
+
.n-alert-info { background: var(--naya-surface-2); color: var(--naya-text); }
|
|
107
|
+
.n-alert-warning { background: var(--naya-warning-soft); color: var(--naya-text); }
|
|
108
|
+
.n-alert-error { background: var(--naya-error-soft); color: var(--naya-text); }
|
|
109
|
+
.n-alert-success { background: var(--naya-success-soft); color: var(--naya-text); }
|
|
110
|
+
.n-field { display: flex; flex-direction: column; gap: 6px; }
|
|
111
|
+
.n-field label { font-size: 13px; font-weight: 700; }
|
|
112
|
+
.n-field .req { color: var(--naya-error); }
|
|
113
|
+
.n-field input {
|
|
114
|
+
font: inherit; font-size: 16px; min-height: 48px; padding: 0 14px;
|
|
115
|
+
border: 2px solid var(--naya-line); border-radius: var(--naya-r-input);
|
|
116
|
+
background: var(--naya-surface); color: var(--naya-text);
|
|
76
117
|
}
|
|
77
|
-
.n-
|
|
78
|
-
.n-
|
|
79
|
-
.n-
|
|
118
|
+
.n-field input:focus { outline: none; border-color: var(--naya-primary); }
|
|
119
|
+
.n-field.invalid input { border-color: var(--naya-error); }
|
|
120
|
+
.n-field-msg { margin: 0; min-height: 16px; font-size: 12px; color: var(--naya-text-2); }
|
|
121
|
+
.n-field.invalid .n-field-msg { color: var(--naya-error); font-weight: 600; }
|
|
80
122
|
|
|
81
|
-
/* \u2500\u2500
|
|
82
|
-
.n-
|
|
83
|
-
.n-
|
|
84
|
-
.n-
|
|
85
|
-
.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
123
|
+
/* \u2500\u2500 Marque, \xE9tapes \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
124
|
+
.n-brand { display: inline-flex; align-items: center; color: var(--naya-text); line-height: 0; }
|
|
125
|
+
.n-dark .n-brand { color: #fff; }
|
|
126
|
+
.n-logo { display: block; width: auto; }
|
|
127
|
+
.brandRow { display: flex; align-items: center; justify-content: center; gap: 12px; }
|
|
128
|
+
/* \xC9crans informatifs : titres et textes centr\xE9s, lecture plus directe ;
|
|
129
|
+
listes et formulaires restent align\xE9s \xE0 gauche (lisibilit\xE9). */
|
|
130
|
+
.n-welcome .title, .n-welcome .body, .n-select .title, .n-select .body, .n-tips .title,
|
|
131
|
+
.n-consent .title, .n-consent .body, .n-handoff .title, .n-handoff .body,
|
|
132
|
+
.n-liveness .title, .n-liveness .sub { text-align: center; }
|
|
133
|
+
.n-tips .list { align-self: center; width: 100%; max-width: 400px; }
|
|
134
|
+
/* Carte bureau : le contenu se r\xE9partit dans la hauteur au lieu de rester
|
|
135
|
+
coll\xE9 en haut ; le bouton principal garde le bas de la carte. */
|
|
136
|
+
@media (min-width: 720px) {
|
|
137
|
+
.naya-host:not(.n-inline) .n-content:not(.n-capture):not(.n-liveness):not(.n-ocr) .pad:not(.center)::before { content: ''; flex: 0.6 1 0; min-height: 0; }
|
|
90
138
|
}
|
|
91
|
-
.
|
|
139
|
+
.brandRow .sep { width: 1px; height: 22px; background: var(--naya-line); }
|
|
140
|
+
.brandRow .clientLogo { height: 26px; max-width: 120px; object-fit: contain; }
|
|
141
|
+
.n-dots { display: flex; justify-content: space-between; gap: 8px; margin: 0 8px; }
|
|
142
|
+
.n-step { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; font-size: 12px; color: var(--naya-text-2); }
|
|
143
|
+
.n-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--naya-line); }
|
|
144
|
+
.n-dot.on { background: var(--naya-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--naya-accent) 25%, transparent); }
|
|
145
|
+
|
|
146
|
+
/* \u2500\u2500 Accueil \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
147
|
+
.n-welcome .n-dots { margin-top: 16px; }
|
|
148
|
+
.n-welcome .hero { align-self: center; width: 112px; height: 112px; border-radius: 32px; display: flex; align-items: center; justify-content: center; background: var(--naya-surface-2); color: var(--naya-primary); }
|
|
149
|
+
.n-welcome .secure { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 12px; color: var(--naya-text-2); }
|
|
150
|
+
|
|
151
|
+
/* \u2500\u2500 Non pris en charge \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
152
|
+
.n-unsupported .hero { width: 96px; height: 96px; border-radius: 28px; background: var(--naya-warning-soft); color: var(--naya-warning); display: flex; align-items: center; justify-content: center; }
|
|
153
|
+
.n-unsupported .link { width: 100%; display: flex; gap: 8px; align-items: center; padding: 10px 12px; border-radius: var(--naya-r-input); background: var(--naya-surface-2); font-size: 13px; }
|
|
154
|
+
.n-unsupported .link code { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
155
|
+
|
|
156
|
+
/* \u2500\u2500 Consentement \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
157
|
+
.n-consent .check { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border: 2px solid var(--naya-line); border-radius: var(--naya-r-card); cursor: pointer; font-size: 14px; line-height: 1.45; }
|
|
158
|
+
.n-consent .check.on { border-color: var(--naya-primary); background: var(--naya-surface); }
|
|
159
|
+
.n-consent .check input { width: 22px; height: 22px; margin: 1px 0 0; accent-color: var(--naya-primary); flex: none; }
|
|
160
|
+
.n-consent .policy { font-size: 13px; color: var(--naya-primary); font-weight: 700; text-decoration: underline; }
|
|
161
|
+
.n-consent .bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
|
|
162
|
+
.n-consent .bullets li { display: flex; gap: 10px; align-items: flex-start; color: var(--naya-text-2); }
|
|
163
|
+
.n-consent .bullets .n-ico { color: var(--naya-success); margin-top: 2px; }
|
|
164
|
+
|
|
165
|
+
/* \u2500\u2500 Relais QR \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
166
|
+
.n-handoff .qr { align-self: center; width: 220px; height: 220px; padding: 12px; background: #fff; border-radius: var(--naya-r-card); border: 1px solid var(--naya-line); }
|
|
167
|
+
.n-handoff .qr svg { width: 100%; height: 100%; display: block; }
|
|
168
|
+
.n-handoff .wait { display: flex; align-items: center; gap: 10px; justify-content: center; font-size: 14px; color: var(--naya-text-2); }
|
|
169
|
+
.n-handoff .qr.loading { display: flex; align-items: center; justify-content: center; }
|
|
170
|
+
|
|
171
|
+
/* \u2500\u2500 S\xE9lection \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
172
|
+
.n-select .chips { display: flex; flex-wrap: wrap; gap: 8px; }
|
|
173
|
+
.n-select .chip { font: inherit; font-size: 13px; font-weight: 700; padding: 8px 14px; border-radius: 999px; border: 2px solid var(--naya-line); background: var(--naya-surface); color: var(--naya-text); cursor: pointer; }
|
|
174
|
+
.n-select .chip.on { border-color: var(--naya-primary); background: var(--naya-primary); color: var(--naya-on-primary); }
|
|
92
175
|
.n-select .chip:focus-visible { outline: 2px solid var(--naya-accent); outline-offset: 2px; }
|
|
93
176
|
.n-select .cards { display: flex; flex-direction: column; gap: 10px; }
|
|
94
|
-
.n-select .card {
|
|
95
|
-
|
|
96
|
-
background: var(--naya-surface); border: 1px solid var(--naya-line); border-radius: var(--naya-r-card);
|
|
97
|
-
}
|
|
98
|
-
.n-select .card.on { border: 1.8px solid var(--naya-accent); background: #FFF9EE; }
|
|
177
|
+
.n-select .card { font: inherit; display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: var(--naya-r-card); border: 2px solid var(--naya-line); background: var(--naya-surface); color: var(--naya-text); cursor: pointer; text-align: left; font-size: 15px; font-weight: 700; }
|
|
178
|
+
.n-select .card.on { border-color: var(--naya-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--naya-primary) 18%, transparent); }
|
|
99
179
|
.n-select .card:focus-visible { outline: 2px solid var(--naya-accent); outline-offset: 2px; }
|
|
100
|
-
.n-select .ico { width:
|
|
101
|
-
.n-select .lbl { flex: 1;
|
|
102
|
-
|
|
103
|
-
|
|
180
|
+
.n-select .card .ico { width: 40px; height: 40px; border-radius: 12px; background: var(--naya-surface-2); color: var(--naya-primary); display: inline-flex; align-items: center; justify-content: center; }
|
|
181
|
+
.n-select .card .lbl { flex: 1; }
|
|
182
|
+
|
|
183
|
+
/* \u2500\u2500 Conseils \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
184
|
+
.n-tips .list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 12px; }
|
|
185
|
+
.n-tips .list li { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.45; }
|
|
186
|
+
.n-tips .list .num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--naya-surface-2); color: var(--naya-primary); font-size: 13px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
|
|
187
|
+
.n-illu { position: relative; align-self: center; width: 220px; height: 150px; border-radius: 20px; background: var(--naya-surface-2); overflow: hidden; }
|
|
188
|
+
.n-illu-doc .tbl { position: absolute; left: 0; right: 0; bottom: 0; height: 46%; background: var(--naya-dark); opacity: .85; }
|
|
189
|
+
.n-illu-doc .card { position: absolute; left: 50%; top: 46%; width: 128px; height: 82px; margin-left: -64px; border-radius: 8px; background: #fff; box-shadow: 0 6px 18px rgba(0,0,0,.25); animation: n-card 3s ease-in-out infinite; }
|
|
190
|
+
.n-illu-doc .card .ph { position: absolute; left: 10px; top: 12px; width: 28px; height: 34px; border-radius: 4px; background: var(--naya-line); }
|
|
191
|
+
.n-illu-doc .card .ln { position: absolute; left: 46px; height: 6px; border-radius: 3px; background: var(--naya-line); }
|
|
192
|
+
.n-illu-doc .card .ln.a { top: 14px; width: 66px; } .n-illu-doc .card .ln.b { top: 28px; width: 50px; } .n-illu-doc .card .ln.c { top: 42px; width: 60px; }
|
|
193
|
+
.n-illu-doc .glow { position: absolute; left: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.9), transparent 70%); animation: n-glow 3s ease-in-out infinite; }
|
|
194
|
+
@keyframes n-card { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-4px) rotate(0deg); } }
|
|
195
|
+
@keyframes n-glow { 0%, 100% { opacity: .2; } 50% { opacity: .7; } }
|
|
196
|
+
.n-illu-face .oval { position: absolute; left: 50%; top: 50%; width: 90px; height: 118px; margin: -59px 0 0 -45px; border-radius: 50%; border: 3px solid var(--naya-accent); }
|
|
197
|
+
.n-illu-face .head { position: absolute; inset: 10px; border-radius: 50%; background: #F3C77A; animation: n-head 4s ease-in-out infinite; }
|
|
198
|
+
.n-illu-face .eye { position: absolute; top: 40%; width: 10px; height: 10px; border-radius: 50%; background: var(--naya-dark); animation: n-blink 4s ease-in-out infinite; }
|
|
199
|
+
.n-illu-face .eye.l { left: 26%; } .n-illu-face .eye.r { right: 26%; }
|
|
200
|
+
.n-illu-face .mouth { position: absolute; left: 50%; top: 66%; width: 28px; height: 12px; margin-left: -14px; border-radius: 0 0 20px 20px; border: 3px solid var(--naya-dark); border-top: 0; }
|
|
201
|
+
.n-illu-face .light { position: absolute; right: 14px; top: 12px; width: 34px; height: 34px; border-radius: 50%; background: radial-gradient(circle, #fff, var(--naya-accent)); box-shadow: 0 0 24px rgba(230,149,10,.8); }
|
|
202
|
+
@keyframes n-head { 0%, 35%, 100% { transform: rotateY(0deg); } 55%, 75% { transform: rotateY(28deg); } }
|
|
203
|
+
@keyframes n-blink { 0%, 18%, 24%, 100% { transform: scaleY(1); } 21% { transform: scaleY(.1); } }
|
|
104
204
|
|
|
105
|
-
/* \u2500\u2500
|
|
106
|
-
.n-capture .
|
|
107
|
-
.n-capture .
|
|
108
|
-
.n-capture .
|
|
109
|
-
.n-capture .card {
|
|
205
|
+
/* \u2500\u2500 Capture \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
206
|
+
.n-capture .instruction { margin: 0; font-size: 15px; font-weight: 700; text-align: center; }
|
|
207
|
+
.n-capture .cardWrap { position: relative; width: 100%; }
|
|
208
|
+
.n-capture .card { position: relative; width: 100%; aspect-ratio: 1.586; border-radius: 14px; overflow: hidden; background: #000; }
|
|
209
|
+
.n-capture .card.ready { box-shadow: 0 0 0 3px var(--naya-success); }
|
|
110
210
|
.n-capture .preview { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
111
|
-
.n-capture .
|
|
112
|
-
.n-capture .corners {
|
|
113
|
-
.n-capture .card.ready .corners { stroke: var(--naya-success); }
|
|
114
|
-
.n-capture .
|
|
115
|
-
.n-capture .
|
|
116
|
-
.n-capture .
|
|
117
|
-
.n-capture .
|
|
118
|
-
.n-capture .
|
|
119
|
-
.n-capture .
|
|
211
|
+
.n-capture .corners { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
|
|
212
|
+
.n-capture .corners path { fill: none; stroke: rgba(255,255,255,.9); stroke-width: 2.2; stroke-linecap: round; transition: stroke .2s ease; }
|
|
213
|
+
.n-capture .card.ready .corners path { stroke: var(--naya-success); }
|
|
214
|
+
.n-capture .countdown { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 64px; font-weight: 900; color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,.6); pointer-events: none; }
|
|
215
|
+
.n-capture .banner { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 40px; padding: 8px 14px; border-radius: 12px; background: rgba(255,255,255,.12); font-size: 14px; font-weight: 600; text-align: center; }
|
|
216
|
+
.n-capture .banner.good { background: color-mix(in srgb, var(--naya-success) 30%, transparent); }
|
|
217
|
+
.n-capture .pills { display: flex; gap: 8px; justify-content: center; }
|
|
218
|
+
.n-capture .pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.12); font-size: 12px; font-weight: 700; }
|
|
219
|
+
.n-capture .pill.ok { background: color-mix(in srgb, var(--naya-success) 35%, transparent); }
|
|
220
|
+
.n-capture .tools { display: flex; align-items: center; justify-content: center; gap: 22px; }
|
|
221
|
+
.n-capture .tool { font: inherit; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; background: none; border: none; color: #fff; font-size: 11px; cursor: pointer; opacity: .85; }
|
|
222
|
+
.n-capture .tool.on { color: var(--naya-accent); opacity: 1; }
|
|
223
|
+
.n-capture .tool:focus-visible { outline: 2px solid #fff; outline-offset: 2px; border-radius: 8px; }
|
|
224
|
+
.n-capture .shutter { align-self: center; width: 76px; height: 76px; border-radius: 50%; border: 5px solid rgba(255,255,255,.6); background: #fff; cursor: pointer; transition: transform .1s ease, border-color .2s ease; }
|
|
225
|
+
.n-capture .shutter.ready { border-color: var(--naya-success); }
|
|
226
|
+
.n-capture .shutter:active:not(:disabled) { transform: scale(.94); }
|
|
227
|
+
.n-capture .shutter:disabled { opacity: .5; cursor: not-allowed; }
|
|
120
228
|
.n-capture .shutter:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
|
|
121
|
-
.n-capture .hint { margin:
|
|
122
|
-
.n-capture .hint.ready { color: var(--naya-success); font-weight: 700; }
|
|
123
|
-
.n-capture .
|
|
124
|
-
.n-capture .
|
|
229
|
+
.n-capture .hint { margin: 0; text-align: center; font-size: 13px; opacity: .8; }
|
|
230
|
+
.n-capture .hint.ready { opacity: 1; color: var(--naya-success); font-weight: 700; }
|
|
231
|
+
.n-capture .camMsg, .n-liveness .camMsg { position: absolute; inset: 0; display: flex; flex-direction: column; gap: 10px; align-items: center; justify-content: center; padding: 20px; text-align: center; font-size: 14px; background: rgba(0,0,0,.55); color: #fff; }
|
|
232
|
+
.n-capture .camMsg[hidden], .n-liveness .camMsg[hidden] { display: none; }
|
|
233
|
+
.loader { width: 28px; height: 28px; border-radius: 50%; border: 3px solid rgba(255,255,255,.3); border-top-color: #fff; animation: n-spin .8s linear infinite; }
|
|
234
|
+
.loader.sm { width: 18px; height: 18px; border-width: 2px; }
|
|
235
|
+
@keyframes n-spin { to { transform: rotate(360deg); } }
|
|
125
236
|
|
|
126
|
-
/* \u2500\u2500
|
|
127
|
-
.n-liveness .
|
|
128
|
-
.n-liveness .
|
|
129
|
-
.n-liveness .sub { margin: 6px 0 18px; font-size: 15px; color: var(--naya-text-2); text-align: center; }
|
|
130
|
-
.n-liveness .ovalWrap { position: relative; width: min(230px, 62vw); aspect-ratio: 210 / 270; margin: 4px 0; }
|
|
131
|
-
.n-liveness .oval { position: absolute; inset: 7px; border-radius: 50%; overflow: hidden; background: rgba(0,0,0,.04); display: flex; align-items: center; justify-content: center; }
|
|
237
|
+
/* \u2500\u2500 Vivacit\xE9 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
238
|
+
.n-liveness .ovalWrap { position: relative; align-self: center; width: 210px; height: 270px; }
|
|
239
|
+
.n-liveness .oval { position: absolute; inset: 4px; border-radius: 50%; overflow: hidden; background: #000; }
|
|
132
240
|
.n-liveness .preview { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
|
|
133
|
-
.n-liveness .
|
|
134
|
-
.n-liveness .ring {
|
|
135
|
-
.n-liveness .ring .
|
|
136
|
-
.n-liveness .ring .prog { stroke: var(--naya-
|
|
137
|
-
.n-liveness .instruction { display:
|
|
138
|
-
.n-liveness .instruction
|
|
139
|
-
.n-liveness .
|
|
140
|
-
.n-liveness .
|
|
141
|
-
.n-liveness .
|
|
142
|
-
.n-liveness .cdot
|
|
143
|
-
.n-liveness .cdot.
|
|
144
|
-
.n-liveness .
|
|
145
|
-
.n-liveness .
|
|
146
|
-
.n-liveness .
|
|
147
|
-
|
|
241
|
+
.n-liveness .ring { position: absolute; inset: 0; width: 100%; height: 100%; }
|
|
242
|
+
.n-liveness .ring .track { fill: none; stroke: var(--naya-line); stroke-width: 4; }
|
|
243
|
+
.n-liveness .ring .prog { fill: none; stroke: var(--naya-accent); stroke-width: 4; stroke-linecap: round; transition: stroke-dashoffset .4s ease; }
|
|
244
|
+
.n-liveness .ring.done .prog { stroke: var(--naya-success); }
|
|
245
|
+
.n-liveness .instruction { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 10px 16px; border-radius: 14px; background: var(--naya-surface-2); font-size: 16px; font-weight: 700; text-align: center; }
|
|
246
|
+
.n-liveness .instruction.ok { background: var(--naya-success-soft); color: var(--naya-success); }
|
|
247
|
+
.n-liveness .instruction.guide { background: var(--naya-warning-soft); }
|
|
248
|
+
.n-liveness .steps { display: flex; justify-content: center; gap: 18px; }
|
|
249
|
+
.n-liveness .cstep { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 12px; color: var(--naya-text-2); min-width: 64px; }
|
|
250
|
+
.n-liveness .cdot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--naya-line); display: inline-flex; align-items: center; justify-content: center; color: #fff; }
|
|
251
|
+
.n-liveness .cdot.active { border-color: var(--naya-accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--naya-accent) 25%, transparent); }
|
|
252
|
+
.n-liveness .cdot.done { background: var(--naya-success); border-color: var(--naya-success); }
|
|
253
|
+
.n-liveness .privacy { margin: 0; padding-top: 4px; text-align: center; font-size: 12px; line-height: 1.4; color: var(--naya-text-2); }
|
|
254
|
+
.n-liveness .toast { position: absolute; left: 50%; top: -6px; transform: translateX(-50%); padding: 6px 12px; border-radius: 999px; background: var(--naya-success); color: #fff; font-size: 12px; font-weight: 800; display: flex; gap: 6px; align-items: center; animation: n-pop .5s ease both; }
|
|
255
|
+
@keyframes n-pop { 0% { transform: translate(-50%, 8px) scale(.8); opacity: 0; } 60% { transform: translate(-50%, -2px) scale(1.05); opacity: 1; } 100% { transform: translate(-50%, 0) scale(1); } }
|
|
148
256
|
|
|
149
|
-
/* \u2500\u2500
|
|
150
|
-
.n-
|
|
151
|
-
.n-
|
|
152
|
-
.n-
|
|
153
|
-
.n-
|
|
154
|
-
.n-
|
|
155
|
-
.n-
|
|
156
|
-
.n-
|
|
157
|
-
.n-
|
|
158
|
-
.n-
|
|
159
|
-
.n-
|
|
160
|
-
.n-
|
|
161
|
-
.n-
|
|
162
|
-
.n-processing .dot.active { border: 2.5px solid var(--naya-accent); border-top-color: transparent; animation: naya-spin .8s linear infinite; }
|
|
163
|
-
.n-processing .lbl { font-size: 15px; font-weight: 600; color: var(--naya-text); }
|
|
164
|
-
.n-processing .lbl.dim { color: var(--naya-text-2); font-weight: 500; }
|
|
165
|
-
.n-processing .wait { font-size: 13px; color: var(--naya-text-2); margin: 0; }
|
|
257
|
+
/* \u2500\u2500 Confirmation OCR \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
258
|
+
.n-ocr .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 10px; }
|
|
259
|
+
.n-ocr .dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
|
|
260
|
+
.n-ocr .dl > div { padding: 10px 12px; border-radius: var(--naya-r-input); background: var(--naya-surface-2); min-width: 0; }
|
|
261
|
+
.n-ocr .dl > div.wide { grid-column: 1 / -1; }
|
|
262
|
+
.n-ocr .dl dt { margin: 0; font-size: 11px; letter-spacing: .02em; text-transform: uppercase; color: var(--naya-text-2); }
|
|
263
|
+
.n-ocr .dl dd { margin: 2px 0 0; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
|
|
264
|
+
.n-ocr .dl dd.empty { font-weight: 500; color: var(--naya-text-2); font-style: italic; }
|
|
265
|
+
.n-ocr .question { margin: 4px 0 0; text-align: center; font-size: 15px; font-weight: 700; }
|
|
266
|
+
.n-ocr .cta { display: flex; flex-direction: column; gap: 10px; }
|
|
267
|
+
.n-ocr .grid .wide { grid-column: 1 / -1; }
|
|
268
|
+
.n-ocr .waiting { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--naya-text-2); }
|
|
269
|
+
.n-ocr .waiting .loader { border-color: var(--naya-line); border-top-color: var(--naya-primary); }
|
|
166
270
|
|
|
167
|
-
/* \u2500\u2500
|
|
168
|
-
.n-
|
|
169
|
-
.n-
|
|
170
|
-
.n-
|
|
171
|
-
.n-
|
|
172
|
-
.n-
|
|
173
|
-
.n-
|
|
174
|
-
.n-
|
|
175
|
-
.n-
|
|
176
|
-
|
|
177
|
-
.n-result .v.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; }
|
|
178
|
-
.n-result .bullets { list-style: none; margin: 20px 0 0; padding: 0; align-self: stretch; }
|
|
179
|
-
.n-result .bullets li { display: flex; align-items: center; gap: 9px; padding: 4px 0; font-size: 13px; color: var(--naya-text); }
|
|
180
|
-
.n-result .pip { width: 6px; height: 6px; border-radius: 50%; background: var(--naya-warning); flex: 0 0 auto; }
|
|
181
|
-
.n-result .gap { height: 10px; }
|
|
271
|
+
/* \u2500\u2500 Traitement \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
272
|
+
.n-processing .spin { align-self: center; width: 54px; height: 54px; border-radius: 50%; border: 4px solid var(--naya-line); border-top-color: var(--naya-accent); animation: n-spin .9s linear infinite; }
|
|
273
|
+
.n-processing .steps { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
|
|
274
|
+
.n-processing .row { display: flex; align-items: center; gap: 12px; font-size: 15px; }
|
|
275
|
+
.n-processing .dot { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--naya-line); display: inline-flex; align-items: center; justify-content: center; color: #fff; flex: none; }
|
|
276
|
+
.n-processing .dot.active { border-color: var(--naya-accent); animation: n-pulse 1.2s ease-in-out infinite; }
|
|
277
|
+
.n-processing .dot.done { background: var(--naya-success); border-color: var(--naya-success); }
|
|
278
|
+
.n-processing .lbl.dim { color: var(--naya-text-2); }
|
|
279
|
+
.n-processing .wait { margin: 0; text-align: center; font-size: 13px; color: var(--naya-text-2); }
|
|
280
|
+
@keyframes n-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--naya-accent) 40%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
|
|
182
281
|
|
|
282
|
+
/* \u2500\u2500 R\xE9sultat \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
283
|
+
.n-result .badge { align-self: center; width: 96px; height: 96px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; animation: n-badge .5s cubic-bezier(.2, .9, .3, 1.3) both; }
|
|
284
|
+
@keyframes n-badge { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
|
|
285
|
+
.n-result .title { text-align: center; }
|
|
286
|
+
.n-result .body { text-align: center; }
|
|
287
|
+
.n-result .summary { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: var(--naya-r-card); background: var(--naya-surface-2); }
|
|
288
|
+
.n-result .srow { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
|
|
289
|
+
.n-result .srow .k { color: var(--naya-text-2); }
|
|
290
|
+
.n-result .srow .v { font-weight: 700; text-align: right; }
|
|
291
|
+
.n-result .bullets, .n-result .reasons { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; font-size: 14px; line-height: 1.45; }
|
|
292
|
+
.n-result .bullets li, .n-result .reasons li { display: flex; gap: 10px; align-items: flex-start; }
|
|
293
|
+
.n-result .pip { flex: none; width: 8px; height: 8px; margin-top: 7px; border-radius: 50%; background: var(--naya-accent); }
|
|
294
|
+
.n-result .reasons .n-ico { flex: none; margin-top: 1px; color: var(--naya-error); }
|
|
295
|
+
|
|
296
|
+
/* \u2500\u2500 Pr\xE9f\xE9rences syst\xE8me \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
|
|
183
297
|
@media (prefers-reduced-motion: reduce) {
|
|
184
|
-
.n-
|
|
298
|
+
.n-enter, .n-enter-back, .n-leave, .n-result .badge, .n-liveness .toast { animation: none; }
|
|
299
|
+
.n-illu *, .n-processing .dot.active, .loader, .n-processing .spin { animation: none; }
|
|
185
300
|
.n-liveness .ring .prog { transition: none; }
|
|
186
|
-
.n-processing .spin { animation-duration: 2s; }
|
|
187
|
-
.n-processing .dot.active { animation-duration: 1.6s; }
|
|
188
301
|
}
|
|
189
|
-
|
|
302
|
+
@media (prefers-contrast: more) {
|
|
303
|
+
.n-btn-secondary, .n-select .card, .n-select .chip, .n-field input, .n-consent .check { border-width: 3px; }
|
|
304
|
+
.body, .sub, .n-powered { color: var(--naya-text); }
|
|
305
|
+
}
|
|
306
|
+
`;var qe=["lastName","firstName","dateOfBirth","placeOfBirth","nationality","expirationDate","documentNumber","npi","issuingCountry","issuingAuthority","gender"];function Z(a){if(!a||typeof a!="object")return;let e=a,t={};for(let n of qe){let r=e[n];typeof r=="string"&&r.length>0&&(t[n]=r);}return Object.keys(t).length?t:void 0}function wt(a){let e={};for(let t of qe){let n=a[t];n&&(e[t]=n);}return e}function Et(a){return {status:"cancelled",verificationId:a}}function q(a,e,t={}){return {status:"error",errorMessage:a,verificationId:e,errorCode:t.errorCode??"unknown",statusCode:t.statusCode,requestId:t.requestId}}var U="0.3.0";var L=class extends Error{constructor(e,t,n={}){super(e),this.name="NayaApiError",this.code=t,this.statusCode=n.statusCode,this.requestId=n.requestId,this.retryable=n.retryable??false;}},H=1e3,St=800,Ct=2;function Ue(a,e){let t=e.toLowerCase();return a===401?t.includes("expired")?{code:"session_expired",retryable:false}:t.includes("session closed")?{code:"session_closed",retryable:false}:{code:"unauthorized",retryable:false}:a===403?t.includes("origin")?{code:"origin_not_allowed",retryable:false}:t.includes("kyb")?{code:"kyb_pending",retryable:false}:{code:"unauthorized",retryable:false}:a===402?{code:"quota",retryable:false}:a===429?t.includes("upload limit")?{code:"upload_limit",retryable:false}:{code:"rate_limited",retryable:true}:a>=500?{code:"server",retryable:a===502||a===503||a===504}:a>=400?{code:"bad_request",retryable:false}:{code:"unknown",retryable:false}}function z(a){return typeof a=="number"&&!Number.isNaN(a)?a:void 0}function kt(a){if(!a||typeof a!="object")return;let e={};for(let[t,n]of Object.entries(a))typeof n=="string"&&(e[t]=n);return Object.keys(e).length?e:void 0}function V(a){return Array.isArray(a)?a.filter(e=>typeof e=="string"):[]}var ee=class{constructor(e,t){this.auth=e;this.baseUrl=t;}get canAuthenticate(){return !!(this.auth.sessionToken||this.auth.apiKey)}useSession(e){this.auth.sessionToken=e;}headers(){let e={"Content-Type":"application/json","X-Naya-SDK":`js/${U}`};return this.auth.sessionToken?e.Authorization=`Bearer ${this.auth.sessionToken}`:this.auth.apiKey&&(e["X-API-Key"]=this.auth.apiKey),e}async request(e,t,n,r={}){let s=r.timeoutMs??30*H,o=r.retries??Ct,l=0;for(;;)try{return await this.once(e,t,n,s,r.keepalive)}catch(d){let c=d;if(!(c instanceof L)||!c.retryable||l>=o)throw d;let p=c.retryAfterMs??St*2**l+Math.random()*300;l+=1,await new Promise(m=>setTimeout(m,p));}}async once(e,t,n,r,s){let o=new AbortController,l=setTimeout(()=>o.abort(),r),d;try{d=await fetch(`${this.baseUrl}${t}`,{method:e,headers:this.headers(),body:n===void 0?void 0:JSON.stringify(n),signal:o.signal,keepalive:s});}catch(p){let m=p instanceof DOMException&&p.name==="AbortError";throw new L(m?"D\xE9lai d\xE9pass\xE9.":"Service injoignable (r\xE9seau, pare-feu ou origine non autoris\xE9e).",m?"timeout":"network",{retryable:true})}finally{clearTimeout(l);}let c=d.headers.get("x-request-id")??void 0,u=null;try{u=await d.json();}catch{if(d.ok)return {};let p=Ue(d.status,"");throw new L("R\xE9ponse illisible du serveur.",p.code,{statusCode:d.status,requestId:c,retryable:p.retryable})}if(d.status>=400||u?.success!==true){let p=(u?.error&&typeof u.error=="object"?u.error.message:void 0)??"Erreur inconnue.",m=Ue(d.status,p),y=new L(p,m.code,{statusCode:d.status,requestId:u?.error?.requestId??c,retryable:m.retryable}),v=d.headers.get("retry-after");throw v&&/^\d+$/.test(v)&&(y.retryAfterMs=Math.min(3e4,parseInt(v,10)*1e3)),y}return u.data??{}}async start(e){let t=await this.request("POST","/verifications/start",{documentType:e.documentType,country:e.country,device:e.device,...e.callbackUrl?{callbackUrl:e.callbackUrl}:{},...e.simulate?{simulate:e.simulate}:{}},{retries:1});return {verificationId:String(t.verificationId??""),sessionToken:String(t.sessionToken??""),challenge:V(t.challenge)}}async getVerification(e){let t=await this.request("GET",`/verifications/${e}`,void 0,{timeoutMs:15*H}),n=t.verification??t;return {status:String(n.status??"pending"),decision:typeof n.decision=="string"?n.decision:null,documentType:typeof n.documentType=="string"?n.documentType:null,country:typeof n.country=="string"?n.country:null,challenge:V(n.challenge),consentAt:typeof n.consentAt=="string"?n.consentAt:null,processingStage:typeof n.processingStage=="string"?n.processingStage:null,reasonCodes:V(n.reasonCodes),hasDocument:!!n.hasDocument,hasSelfie:!!n.hasSelfie}}async consent(e,t){await this.request("POST",`/verifications/${e}/consent`,{granted:true,...t?{version:t}:{}});}async uploadDocument(e,t){let n=await this.request("POST",`/verifications/${e}/document`,{imageBase64Recto:t.rectoBase64,...t.versoBase64?{imageBase64Verso:t.versoBase64}:{}},{timeoutMs:120*H,retries:1});return Z(n.ocrData)}async submitLiveness(e,t){let r=(await this.request("POST",`/verifications/${e}/liveness`,{selfieBase64:t.selfieBase64,livenessMode:t.livenessMode,...t.challengeProof?{challengeProof:t.challengeProof}:{},...t.frames?.length?{frames:t.frames}:{},...t.clientScore!=null?{livenessScore:t.clientScore}:{},matchScore:0},{timeoutMs:60*H,retries:1})).challengeValid;return {challengeValid:typeof r=="boolean"?r:null}}async submit(e,t,n=false){let r={};t&&Object.keys(t).length&&(r.declaredData=t),n&&(r.dataDisputed=true);let s=await this.request("POST",`/verifications/${e}/submit`,r,{timeoutMs:180*H,retries:1});return {status:String(s.status??"review"),decision:typeof s.decision=="string"?s.decision:void 0,reasonCodes:V(s.reasonCodes),riskScore:z(s.riskScore),matchScore:z(s.matchScore),authenticityScore:z(s.authenticityScore),livenessScore:z(s.livenessScore),ocrConfidence:z(s.ocrConfidence),ocrData:Z(s.ocrData),declaredData:kt(s.declaredData),dataMismatches:V(s.dataMismatches),dataDisputed:s.dataDisputed===true,note:typeof s.note=="string"?s.note:void 0,replayed:s.replayed===true}}async handoff(e,t){let n=t?`?baseUrl=${encodeURIComponent(t)}`:"",r=await this.request("GET",`/verifications/${e}/handoff${n}`,void 0,{timeoutMs:15*H});return {url:String(r.url??""),qrSvg:String(r.qrSvg??""),expiresAt:String(r.expiresAt??"")}}async sendEvents(e,t,n){await this.request("POST","/sdk/events",{sdk:"js",version:U,device:t,events:e},{timeoutMs:10*H,retries:0,keepalive:n});}};var ze={poweredBy:["Propuls\xE9 par 41Devs","Powered by 41Devs","Desenvolvido por 41Devs"],continue:["Continuer","Continue","Continuar"],back:["Retour","Back","Voltar"],close:["Fermer","Close","Fechar"],cancel:["Annuler","Cancel","Cancelar"],retry:["R\xE9essayer","Try again","Tentar novamente"],backToApp:["Retourner \xE0 l'application","Back to the app","Voltar \xE0 aplica\xE7\xE3o"],understood:["J'ai compris","Got it","Entendi"],confirm:["Confirmer","Confirm","Confirmar"],copyLink:["Copier le lien","Copy link","Copiar liga\xE7\xE3o"],copied:["Lien copi\xE9","Link copied","Liga\xE7\xE3o copiada"],loading:["Chargement\u2026","Loading\u2026","A carregar\u2026"],dialogLabel:["V\xE9rification d'identit\xE9 Naya ID","Naya ID identity verification","Verifica\xE7\xE3o de identidade Naya ID"],welcomeTitle:["V\xE9rifiez votre identit\xE9","Verify your identity","Verifique a sua identidade"],welcomeSubtitle:[`Pr\xEAt en moins de 60 secondes.
|
|
190
307
|
Munissez-vous de votre pi\xE8ce d'identit\xE9.`,`Ready in under 60 seconds.
|
|
191
|
-
Have your ID document at hand
|
|
308
|
+
Have your ID document at hand.`,`Pronto em menos de 60 segundos.
|
|
309
|
+
Tenha o seu documento de identidade \xE0 m\xE3o.`],welcomeCta:["Commencer","Get started","Come\xE7ar"],welcomeOnMobile:["Continuer sur mon t\xE9l\xE9phone","Continue on my phone","Continuar no meu telem\xF3vel"],welcomeSecurity:["Vos donn\xE9es sont chiffr\xE9es et transmises de fa\xE7on s\xE9curis\xE9e","Your data is encrypted and transmitted securely","Os seus dados s\xE3o cifrados e transmitidos com seguran\xE7a"],stepDocument:["Document","Document","Documento"],stepSelfie:["Selfie","Selfie","Selfie"],stepResult:["R\xE9sultat","Result","Resultado"],unsupportedTitle:["Ouvrez cette page dans votre navigateur","Open this page in your browser","Abra esta p\xE1gina no seu navegador"],unsupportedInApp:["L'application {name} n'autorise pas l'acc\xE8s \xE0 la cam\xE9ra. Copiez le lien et ouvrez-le dans Chrome ou Safari.","The {name} app does not allow camera access. Copy the link and open it in Chrome or Safari.","A aplica\xE7\xE3o {name} n\xE3o permite o acesso \xE0 c\xE2mara. Copie a liga\xE7\xE3o e abra-a no Chrome ou no Safari."],unsupportedBrowserTitle:["Navigateur non pris en charge","Unsupported browser","Navegador n\xE3o suportado"],unsupportedBrowser:["Ce navigateur ne permet pas la capture vid\xE9o n\xE9cessaire \xE0 la v\xE9rification. Utilisez une version r\xE9cente de Chrome, Safari, Firefox ou Edge.","This browser cannot capture video, which the verification requires. Use a recent version of Chrome, Safari, Firefox or Edge.","Este navegador n\xE3o permite a captura de v\xEDdeo necess\xE1ria \xE0 verifica\xE7\xE3o. Utilize uma vers\xE3o recente do Chrome, Safari, Firefox ou Edge."],unsupportedInsecure:["La cam\xE9ra exige une page s\xE9curis\xE9e (https). Contactez le service qui vous a envoy\xE9 ce lien.","The camera requires a secure page (https). Contact the service that sent you this link.","A c\xE2mara exige uma p\xE1gina segura (https). Contacte o servi\xE7o que lhe enviou esta liga\xE7\xE3o."],consentTitle:["Votre accord","Your consent","O seu consentimento"],consentBody:["Pour v\xE9rifier votre identit\xE9, nous allons photographier votre pi\xE8ce d'identit\xE9 et votre visage, puis les comparer. Ces donn\xE9es biom\xE9triques sont trait\xE9es par Naya ID pour le compte de {org}, uniquement \xE0 cette fin, et conserv\xE9es selon sa politique de confidentialit\xE9.","To verify your identity we will photograph your ID document and your face, then compare them. This biometric data is processed by Naya ID on behalf of {org}, for this purpose only, and kept according to its privacy policy.","Para verificar a sua identidade, vamos fotografar o seu documento de identidade e o seu rosto, e depois compar\xE1-los. Estes dados biom\xE9tricos s\xE3o tratados pela Naya ID em nome de {org}, apenas para este fim, e conservados segundo a sua pol\xEDtica de privacidade."],consentCheckbox:["J'accepte le traitement de mes donn\xE9es biom\xE9triques pour v\xE9rifier mon identit\xE9.","I agree to the processing of my biometric data to verify my identity.","Aceito o tratamento dos meus dados biom\xE9tricos para verificar a minha identidade."],consentPolicy:["Politique de confidentialit\xE9","Privacy policy","Pol\xEDtica de privacidade"],consentCta:["J'accepte et je continue","I agree and continue","Aceito e continuo"],consentOrg:["ce service","this service","este servi\xE7o"],handoffTitle:["Continuez sur votre t\xE9l\xE9phone","Continue on your phone","Continue no seu telem\xF3vel"],handoffBody:["Scannez ce code avec l'appareil photo de votre t\xE9l\xE9phone : la v\xE9rification s'y poursuit, avec une meilleure cam\xE9ra. Cette page se mettra \xE0 jour toute seule.","Scan this code with your phone camera: the verification continues there, with a better camera. This page will update by itself.","Leia este c\xF3digo com a c\xE2mara do seu telem\xF3vel: a verifica\xE7\xE3o continua a\xED, com uma c\xE2mara melhor. Esta p\xE1gina atualiza-se sozinha."],handoffWaiting:["En attente du t\xE9l\xE9phone\u2026","Waiting for the phone\u2026","\xC0 espera do telem\xF3vel\u2026"],handoffProgress:["V\xE9rification en cours sur le t\xE9l\xE9phone","Verification in progress on the phone","Verifica\xE7\xE3o em curso no telem\xF3vel"],handoffOrHere:["Ou continuer sur cet appareil","Or continue on this device","Ou continuar neste dispositivo"],handoffExpired:["Le code a expir\xE9. Relancez la v\xE9rification.","The code has expired. Start the verification again.","O c\xF3digo expirou. Reinicie a verifica\xE7\xE3o."],handoffQrLabel:["QR code \xE0 scanner avec un t\xE9l\xE9phone","QR code to scan with a phone","C\xF3digo QR para ler com um telem\xF3vel"],docSelectTitle:[`Quel document
|
|
192
310
|
avez-vous ?`,`Which document
|
|
193
|
-
do you have
|
|
194
|
-
la photo n'est envoy\xE9e qu'\xE0 la fin du d\xE9fi`,`Analysis runs on your device \u2014
|
|
195
|
-
the photo is only sent once the challenge is done`)}get processingDocument(){return this.t("Document analys\xE9","Document analyzed")}get processingFace(){return this.t("Visage compar\xE9","Face compared")}get processingCompliance(){return this.t("Contr\xF4les de conformit\xE9","Compliance checks")}get processingDecision(){return this.t("D\xE9cision","Decision")}get processingWait(){return this.t("Ne fermez pas la fen\xEAtre","Don't close the window")}get resultApprovedTitle(){return this.t("Identit\xE9 v\xE9rifi\xE9e !","Identity verified!")}get resultApprovedSubtitle(){return this.t("Votre v\xE9rification a \xE9t\xE9 transmise avec succ\xE8s.","Your verification was submitted successfully.")}get resultReference(){return this.t("R\xE9f\xE9rence","Reference")}get resultName(){return this.t("Nom complet","Full name")}get resultReviewTitle(){return this.t("V\xE9rification en cours d'examen","Verification under review")}get resultReviewSubtitle(){return this.t("Un analyste examine votre dossier.","An analyst is reviewing your file.")}get resultReviewB1(){return this.t("R\xE9ponse g\xE9n\xE9ralement sous 24 h","Usually answered within 24 h")}get resultReviewB2(){return this.t("Vous serez notifi\xE9 par l'application","The app will notify you")}get resultReviewB3(){return this.t("Aucune action requise de votre part","No action needed from you")}get resultRejectedTitle(){return this.t("V\xE9rification non aboutie","Verification unsuccessful")}get resultRejectedReason(){return this.t("Motif","Reason")}get retry(){return this.t("R\xE9essayer","Try again")}get errorTitle(){return this.t("Une erreur est survenue","Something went wrong")}get errorNetwork(){return this.t("V\xE9rifiez votre connexion internet puis r\xE9essayez.","Check your internet connection and try again.")}get errorCamera(){return this.t("Impossible d'acc\xE9der \xE0 la cam\xE9ra. V\xE9rifiez les autorisations du navigateur.","Cannot access the camera. Check the browser permissions.")}};var B=class{constructor(e,t,n){this.onStep=()=>{};this.step="welcome";this.session=null;this.country=null;this.document=null;this.rectoBase64=null;this.versoBase64=null;this.livenessScore=0;this.selfieBase64=null;this.attemptsUsed=0;this.submitResponse=null;this.stepHistory=[];this.documentUpload=null;this.finished=false;this.config=t,this.finishCb=n,this.api=new D(e,t.baseUrl),this.strings=new H(t.locale),this.country=t.country??null;}go(e){this.stepHistory.push(this.step),this.setStep(e);}replace(e){this.setStep(e);}get canGoBack(){return this.stepHistory.length>0}back(){let e=this.stepHistory.pop();e&&this.setStep(e);}setStep(e){this.step=e,this.onStep(e);}get client(){return this.api}get needsVerso(){return this.document==="cni"}get canRetry(){return this.attemptsUsed<this.config.maxAttempts}async ensureSession(){if(this.session)return this.session;let e=await this.api.start({documentType:this.document,country:this.country,callbackUrl:this.config.callbackUrl});return this.session=e,e}startDocumentUpload(){if(this.documentUpload)return;let e=this.uploadDocument();this.documentUpload=e,e.catch(()=>{});}ensureDocumentUploaded(){return this.documentUpload??(this.documentUpload=this.uploadDocument())}async uploadDocument(){try{let e=await this.ensureSession();await this.api.uploadDocument(e.verificationId,{rectoBase64:this.rectoBase64,versoBase64:this.versoBase64??void 0});}catch(e){throw this.documentUpload=null,e}}resetForRetry(){this.attemptsUsed+=1,this.session=null,this.rectoBase64=null,this.versoBase64=null,this.livenessScore=0,this.selfieBase64=null,this.submitResponse=null,this.documentUpload=null,this.stepHistory=[];}documentTypeNeedsVerso(e){return K(e)}complete(e){this.finished||(this.finished=true,this.finishCb({...e,verificationId:e.verificationId??this.session?.verificationId}));}cancel(){this.complete({status:"cancelled"});}};function i(s){return s.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}var me={shield:'<path d="M12 3l7 3v5c0 4.5-3 8.3-7 10-4-1.7-7-5.5-7-10V6l7-3z"/><path d="M9 12l2 2 4-4"/>',lock:'<rect x="5" y="11" width="14" height="9" rx="2"/><path d="M8 11V8a4 4 0 0 1 8 0v3"/>',fingerprint:'<path d="M12 11a2 2 0 0 1 2 2v1a5 5 0 0 1-.5 2.2"/><path d="M8 13a4 4 0 0 1 8 0v1a8 8 0 0 1-.8 3.5"/><path d="M5.5 15A7 7 0 0 1 5 12a7 7 0 0 1 12-5"/><path d="M12 20v-7"/>',close:'<path d="M6 6l12 12M18 6L6 18"/>',back:'<path d="M15 5l-7 7 7 7"/>',chevron:'<path d="M9 6l6 6-6 6"/>',check:'<path d="M5 12l5 5L20 7"/>',clock:'<circle cx="12" cy="12" r="8"/><path d="M12 8v4l3 2"/>',"wifi-off":'<path d="M3 3l18 18"/><path d="M5 12a11 11 0 0 1 4-2.5"/><path d="M8.5 16.5A5 5 0 0 1 12 15a5 5 0 0 1 2 .4"/><path d="M12 20h.01"/>',refresh:'<path d="M4 12a8 8 0 0 1 13.7-5.7L20 8"/><path d="M20 4v4h-4"/><path d="M20 12a8 8 0 0 1-13.7 5.7L4 16"/><path d="M4 20v-4h4"/>',"id-card":'<rect x="3" y="5" width="18" height="14" rx="2"/><circle cx="8.5" cy="11" r="2"/><path d="M13 10h5M13 14h5M5.5 15a3 3 0 0 1 6 0"/>',passport:'<rect x="5" y="3" width="14" height="18" rx="2"/><circle cx="12" cy="10" r="3"/><path d="M9 16h6"/>',car:'<path d="M5 16l1.5-5A2 2 0 0 1 8.4 10h7.2a2 2 0 0 1 1.9 1l1.5 5"/><rect x="3" y="16" width="18" height="4" rx="1"/><circle cx="7.5" cy="20" r="1"/><circle cx="16.5" cy="20" r="1"/>',sun:'<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M2 12h2M20 12h2M5 5l1.5 1.5M17.5 17.5L19 19M19 5l-1.5 1.5M6.5 17.5L5 19"/>',focus:'<path d="M4 8V6a2 2 0 0 1 2-2h2M16 4h2a2 2 0 0 1 2 2v2M20 16v2a2 2 0 0 1-2 2h-2M8 20H6a2 2 0 0 1-2-2v-2"/><circle cx="12" cy="12" r="2.5"/>',eye:'<path d="M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7-10-7-10-7z"/><circle cx="12" cy="12" r="3"/>',rotate:'<path d="M12 4a8 8 0 1 1-7.5 5.3"/><path d="M4 4v5h5"/>',hourglass:'<path d="M7 3h10M7 21h10M8 3c0 4 8 5 8 9s-8 5-8 9M16 3c0 4-8 5-8 9s8 5 8 9"/>'};function p(s,e=20,t=2){return `<svg class="n-icon" width="${e}" height="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${t}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">${me[s]}</svg>`}function F(){return `<span class="n-brand"><span class="n-mark">${p("fingerprint",17)}</span><span class="n-name">Naya ID</span></span>`}function oe(s,e){return `<div class="n-dots">${s.map((n,a)=>`<div class="n-step"><span class="n-dot${a<=e?" on":""}"></span><span class="n-dotlbl">${i(n)}</span></div>`).join("")}</div>`}function k(s,e={}){return `<button type="button" class="n-btn n-btn-primary" data-act="${e.act??"primary"}"${e.disabled?" disabled":""}>${e.icon?p(e.icon,18):""}<span>${i(s)}</span></button>`}function le(s,e="secondary"){return `<button type="button" class="n-btn n-btn-secondary" data-act="${e}">${i(s)}</button>`}function v(s){let e=s.canClose!==false,t=document.createElement("div");t.className="n-shell"+(s.dark?" n-dark":""),t.innerHTML='<header class="n-bar">'+(s.canBack?`<button type="button" class="n-round" data-nav="back" aria-label="Retour">${p("back",20)}</button>`:'<span class="n-spacer"></span>')+(e?`<button type="button" class="n-round" data-nav="close" aria-label="Fermer">${p("close",20)}</button>`:'<span class="n-spacer"></span>')+`</header><main class="n-content ${s.screenClass}"></main><footer class="n-powered">${i(s.poweredBy)}</footer>`,t.querySelector('[data-nav="back"]')?.addEventListener("click",()=>s.onBack?.()),t.querySelector('[data-nav="close"]')?.addEventListener("click",()=>s.onClose?.());let n=t.querySelector(".n-content");return {root:t,content:n}}var O=class{constructor(e){this.flow=e;let t=e.strings,n=e.config,{root:a,content:r}=v({poweredBy:t.poweredBy,screenClass:"n-welcome",onClose:()=>e.cancel()});this.el=a;let o=[t.stepDocument,t.stepSelfie,t.stepResult],c=n.clientLogoUrl?`<span class="sep"></span><img class="clientLogo" src="${i(n.clientLogoUrl)}" alt="">`:"";r.innerHTML=`
|
|
311
|
+
do you have?`,`Que documento
|
|
312
|
+
tem consigo?`],docSelectSubtitle:["Choisissez votre pays et votre pi\xE8ce.","Choose your country and your document.","Escolha o seu pa\xEDs e o seu documento."],countryLabel:["Pays","Country","Pa\xEDs"],docCni:["Carte nationale d'identit\xE9","National ID card","Cart\xE3o nacional de identidade"],docPasseport:["Passeport","Passport","Passaporte"],docPermis:["Permis de conduire","Driver's licence","Carta de condu\xE7\xE3o"],tipsDocTitle:["Avant de photographier","Before you take the photo","Antes de fotografar"],tipsDoc1:["Posez le document \xE0 plat sur une surface sombre et unie.","Lay the document flat on a dark, plain surface.","Coloque o documento sobre uma superf\xEDcie escura e lisa."],tipsDoc2:["\xC9vitez les reflets : pas de flash, pas de lumi\xE8re directe.","Avoid glare: no flash, no direct light.","Evite reflexos: sem flash, sem luz direta."],tipsDoc3:["Retirez la pochette plastique, cadrez les quatre coins.","Remove the plastic sleeve and frame all four corners.","Retire a capa de pl\xE1stico e enquadre os quatro cantos."],tipsSelfieTitle:["Pour le selfie","For the selfie","Para a selfie"],tipsSelfie1:["Placez-vous face \xE0 une source de lumi\xE8re, pas dos \xE0 une fen\xEAtre.","Face a light source, not a window behind you.","Fique de frente para a luz, n\xE3o de costas para uma janela."],tipsSelfie2:["Retirez lunettes de soleil, casquette et masque.","Remove sunglasses, cap and mask.","Retire \xF3culos de sol, bon\xE9 e m\xE1scara."],tipsSelfie3:["Suivez les consignes \xE0 l'\xE9cran : elles changent \xE0 chaque fois.","Follow the on-screen prompts: they change every time.","Siga as instru\xE7\xF5es no ecr\xE3: mudam de cada vez."],captureRectoInstruction:["Placez le recto de votre document dans le cadre","Place the front of your document within the frame","Coloque a frente do documento dentro da moldura"],captureVersoInstruction:["Retournez le document : le verso maintenant","Flip the document: now the back","Vire o documento: agora o verso"],captureHint:["Alignez le document, la photo se prend toute seule","Align the document, the photo is taken automatically","Alinhe o documento, a foto \xE9 tirada automaticamente"],captureManualHint:["Alignez le document puis appuyez sur le d\xE9clencheur","Align the document then press the shutter","Alinhe o documento e prima o bot\xE3o"],captureReady:["Ne bougez plus\u2026","Hold still\u2026","N\xE3o se mexa\u2026"],captureAuto:["Capture dans {n}","Capturing in {n}","Captura em {n}"],qualityLight:["Lumi\xE8re","Light","Luz"],qualitySharpness:["Nettet\xE9","Sharpness","Nitidez"],guideTooDark:["Trop sombre : rapprochez-vous d'une lumi\xE8re","Too dark: move closer to a light","Demasiado escuro: aproxime-se de uma luz"],guideTooBright:["Trop de lumi\xE8re : \xE9loignez-vous de la source","Too bright: move away from the light","Demasiada luz: afaste-se da fonte"],guideGlare:["Reflet d\xE9tect\xE9 : inclinez l\xE9g\xE8rement le document","Glare detected: tilt the document slightly","Reflexo detetado: incline ligeiramente o documento"],guideBlurry:["Image floue : stabilisez et faites la mise au point","Blurry: hold steady and let the camera focus","Imagem desfocada: estabilize e deixe focar"],guideHoldSteady:["Tenez l'appareil immobile","Hold the device still","Mantenha o dispositivo im\xF3vel"],guideGood:["Parfait, ne bougez plus","Perfect, hold still","Perfeito, n\xE3o se mexa"],importPhoto:["Importer une photo","Import a photo","Importar uma foto"],switchCamera:["Changer de cam\xE9ra","Switch camera","Mudar de c\xE2mara"],torch:["Lampe","Torch","Lanterna"],shutterLabel:["Prendre la photo","Take the photo","Tirar a foto"],fileInvalid:["Ce fichier n'est pas une image lisible.","This file is not a readable image.","Este ficheiro n\xE3o \xE9 uma imagem leg\xEDvel."],cameraDenied:["Acc\xE8s \xE0 la cam\xE9ra refus\xE9. Autorisez la cam\xE9ra dans les r\xE9glages du navigateur, puis r\xE9essayez.","Camera access denied. Allow the camera in your browser settings, then try again.","Acesso \xE0 c\xE2mara recusado. Autorize a c\xE2mara nas defini\xE7\xF5es do navegador e tente novamente."],cameraUnavailable:["Aucune cam\xE9ra d\xE9tect\xE9e sur cet appareil.","No camera detected on this device.","Nenhuma c\xE2mara detetada neste dispositivo."],cameraBusy:["La cam\xE9ra est utilis\xE9e par une autre application. Fermez-la puis r\xE9essayez.","The camera is in use by another app. Close it and try again.","A c\xE2mara est\xE1 a ser usada por outra aplica\xE7\xE3o. Feche-a e tente novamente."],cameraGeneric:["Impossible de d\xE9marrer la cam\xE9ra.","Unable to start the camera.","N\xE3o foi poss\xEDvel iniciar a c\xE2mara."],livenessTitle:["\xC0 vous maintenant","Your turn now","Agora \xE9 a sua vez"],livenessSubtitle:["Placez votre visage dans l'ovale et suivez les consignes.","Place your face in the oval and follow the prompts.","Coloque o rosto na oval e siga as instru\xE7\xF5es."],livenessLoading:["Pr\xE9paration de la cam\xE9ra\u2026","Preparing the camera\u2026","A preparar a c\xE2mara\u2026"],livenessLookStraight:["Regardez droit devant vous","Look straight ahead","Olhe em frente"],livenessBlink:["Clignez des yeux","Blink your eyes","Pisque os olhos"],livenessTurnLeft:["Tournez la t\xEAte vers la gauche","Turn your head to the left","Vire a cabe\xE7a para a esquerda"],livenessTurnRight:["Tournez la t\xEAte vers la droite","Turn your head to the right","Vire a cabe\xE7a para a direita"],livenessSmile:["Souriez","Smile","Sorria"],livenessHold:["Ne bougez plus\u2026","Hold still\u2026","N\xE3o se mexa\u2026"],livenessStraighten:["Redressez la t\xEAte et regardez l\u2019objectif","Straighten your head and look at the camera","Endireite a cabe\xE7a e olhe para a c\xE2mara"],livenessEyesOpen:["Gardez les yeux ouverts","Keep your eyes open","Mantenha os olhos abertos"],livenessDetected:["D\xE9tect\xE9","Detected","Detetado"],livenessStepFace:["Visage","Face","Rosto"],livenessCenter:["Centrez votre visage dans l'ovale","Centre your face in the oval","Centre o rosto na oval"],livenessCloser:["Rapprochez-vous","Move closer","Aproxime-se"],livenessFarther:["\xC9loignez-vous un peu","Move back a little","Afaste-se um pouco"],livenessOneFace:["Une seule personne dans le cadre","Only one person in the frame","Apenas uma pessoa no enquadramento"],livenessPrivacy:["Analyse effectu\xE9e sur votre appareil. Seule la photo finale est transmise.","Analysis runs on your device. Only the final photo is sent.","A an\xE1lise \xE9 feita no seu dispositivo. S\xF3 a foto final \xE9 enviada."],livenessTimeoutTitle:["On recommence ?","Shall we try again?","Tentamos de novo?"],livenessTimeoutBody:["Le geste n'a pas \xE9t\xE9 reconnu. Placez-vous face \xE0 la lumi\xE8re, retirez lunettes et casquette, et gardez le visage dans l'ovale.","The gesture was not recognised. Face the light, remove glasses and cap, and keep your face in the oval.","O gesto n\xE3o foi reconhecido. Fique de frente para a luz, retire \xF3culos e bon\xE9, e mantenha o rosto na oval."],livenessPassiveCta:["Je ne peux pas faire ce geste","I can't make this gesture","N\xE3o consigo fazer este gesto"],livenessPassiveNote:["Sans le geste, votre dossier sera examin\xE9 par une personne : cela peut prendre plus de temps.","Without the gesture, a person will review your file: this may take longer.","Sem o gesto, o seu processo ser\xE1 analisado por uma pessoa: pode demorar mais."],livenessAssetsError:["Impossible de charger le module de d\xE9tection. V\xE9rifiez votre connexion puis r\xE9essayez.","Unable to load the detection module. Check your connection and try again.","N\xE3o foi poss\xEDvel carregar o m\xF3dulo de dete\xE7\xE3o. Verifique a sua liga\xE7\xE3o e tente novamente."],ocrTitle:["V\xE9rifiez vos informations","Check your details","Verifique os seus dados"],ocrSubtitle:["Corrigez ce qui a \xE9t\xE9 mal lu sur le document.","Correct anything misread from the document.","Corrija o que foi mal lido no documento."],ocrReadSubtitle:["Voici ce que nous avons lu sur votre document.","Here is what we read on your document.","Eis o que lemos no seu documento."],ocrQuestion:["Ces informations sont-elles exactes ?","Is this information correct?","Estas informa\xE7\xF5es est\xE3o corretas?"],ocrYes:["Oui, c\u2019est exact","Yes, it is correct","Sim, est\xE1 correto"],ocrNo:["Non, il y a une erreur","No, there is a mistake","N\xE3o, h\xE1 um erro"],ocrEmptyValue:["Non lu","Not read","N\xE3o lido"],ocrWaiting:["Lecture du document en cours\u2026","Reading the document\u2026","A ler o documento\u2026"],ocrNone:["Nous n'avons pas pu lire le document. Renseignez vos informations.","We could not read the document. Enter your details.","N\xE3o conseguimos ler o documento. Introduza os seus dados."],ocrLastName:["Nom","Last name","Apelido"],ocrFirstName:["Pr\xE9nom(s)","First name(s)","Nome(s) pr\xF3prio(s)"],ocrDateOfBirth:["Date de naissance","Date of birth","Data de nascimento"],ocrPlaceOfBirth:["Lieu de naissance","Place of birth","Local de nascimento"],ocrDocumentNumber:["Num\xE9ro du document","Document number","N\xFAmero do documento"],ocrExpirationDate:["Date d'expiration","Expiry date","Data de validade"],ocrNationality:["Nationalit\xE9","Nationality","Nacionalidade"],ocrGender:["Sexe","Sex","Sexo"],ocrGenderM:["Masculin","Male","Masculino"],ocrGenderF:["F\xE9minin","Female","Feminino"],ocrDateFormat:["Format attendu : AAAA-MM-JJ","Expected format: YYYY-MM-DD","Formato esperado: AAAA-MM-DD"],ocrExpired:["Ce document est expir\xE9 : la v\xE9rification sera refus\xE9e.","This document has expired: the verification will be refused.","Este documento est\xE1 expirado: a verifica\xE7\xE3o ser\xE1 recusada."],ocrDobInvalid:["Date de naissance invalide.","Invalid date of birth.","Data de nascimento inv\xE1lida."],ocrRequired:["Champ requis","Required","Obrigat\xF3rio"],processingDocument:["Analyse du document","Document analysis","An\xE1lise do documento"],processingFace:["Comparaison du visage","Face comparison","Compara\xE7\xE3o do rosto"],processingCompliance:["Contr\xF4les de conformit\xE9","Compliance checks","Controlos de conformidade"],processingDecision:["D\xE9cision","Decision","Decis\xE3o"],processingWait:["Cela prend g\xE9n\xE9ralement moins d'une minute.","This usually takes under a minute.","Normalmente demora menos de um minuto."],processingLong:["Cela prend un peu plus de temps que pr\xE9vu, merci de patienter.","This is taking a little longer than expected, please wait.","Est\xE1 a demorar um pouco mais do que o previsto, aguarde."],resultApprovedTitle:["Identit\xE9 v\xE9rifi\xE9e","Identity verified","Identidade verificada"],resultApprovedSubtitle:["Merci, tout est en ordre.","Thank you, everything is in order.","Obrigado, est\xE1 tudo em ordem."],resultReviewTitle:["V\xE9rification en cours d'examen","Verification under review","Verifica\xE7\xE3o em an\xE1lise"],resultReviewSubtitle:["Une personne va examiner votre dossier.","A person will review your file.","Uma pessoa vai analisar o seu processo."],resultReviewB1:["Vous n'avez rien d'autre \xE0 faire.","There is nothing else for you to do.","N\xE3o tem mais nada a fazer."],resultReviewB2:["Le service qui vous a envoy\xE9 ici vous pr\xE9viendra.","The service that sent you here will let you know.","O servi\xE7o que o enviou aqui ir\xE1 avis\xE1-lo."],resultReviewB3:["D\xE9lai habituel : moins d'un jour ouvr\xE9.","Usual delay: under one working day.","Prazo habitual: menos de um dia \xFAtil."],resultRejectedTitle:["V\xE9rification refus\xE9e","Verification refused","Verifica\xE7\xE3o recusada"],resultRejectedReason:["Motif","Reason","Motivo"],resultName:["Nom","Name","Nome"],resultReference:["R\xE9f\xE9rence","Reference","Refer\xEAncia"],resultWhatNext:["Que faire ?","What now?","O que fazer?"],reason_DOC_EXPIRED:["Votre pi\xE8ce d'identit\xE9 est expir\xE9e. Recommencez avec un document valide.","Your ID document has expired. Try again with a valid document.","O seu documento de identidade est\xE1 expirado. Tente novamente com um documento v\xE1lido."],reason_DOC_INCONSISTENT:["Le document n'a pas pu \xEAtre lu correctement. Recommencez avec une photo nette, sans reflet.","The document could not be read properly. Try again with a sharp, glare-free photo.","O documento n\xE3o p\xF4de ser lido corretamente. Tente novamente com uma foto n\xEDtida, sem reflexos."],reason_FACE_MISMATCH:["Le selfie ne correspond pas \xE0 la photo du document.","The selfie does not match the photo on the document.","A selfie n\xE3o corresponde \xE0 foto do documento."],reason_FACE_LOW_CONFIDENCE:["La ressemblance avec la photo du document n'est pas assez nette pour d\xE9cider automatiquement.","The likeness to the document photo is not clear enough to decide automatically.","A semelhan\xE7a com a foto do documento n\xE3o \xE9 suficiente para decidir automaticamente."],reason_FACE_NOT_COMPARED:["Le visage du document n'a pas pu \xEAtre compar\xE9 au selfie.","The face on the document could not be compared with the selfie.","O rosto do documento n\xE3o p\xF4de ser comparado com a selfie."],reason_LIVENESS_NOT_EVALUATED:["La vivacit\xE9 n'a pas pu \xEAtre \xE9valu\xE9e automatiquement.","Liveness could not be evaluated automatically.","A vivacidade n\xE3o p\xF4de ser avaliada automaticamente."],reason_LIVENESS_LOW:["Le selfie ressemble \xE0 une photo d'\xE9cran ou d'impression.","The selfie looks like a photo of a screen or a print.","A selfie parece uma foto de um ecr\xE3 ou de uma impress\xE3o."],reason_LIVENESS_PASSIVE:["Le parcours a \xE9t\xE9 fait sans le geste de vivacit\xE9.","The flow was completed without the liveness gesture.","O percurso foi feito sem o gesto de vivacidade."],reason_LIVENESS_CHALLENGE_INVALID:["Les gestes demand\xE9s n'ont pas \xE9t\xE9 reconnus dans le bon ordre.","The requested gestures were not recognised in the right order.","Os gestos pedidos n\xE3o foram reconhecidos pela ordem certa."],reason_AML_SANCTION:["Un contr\xF4le r\xE9glementaire compl\xE9mentaire est n\xE9cessaire.","An additional regulatory check is required.","\xC9 necess\xE1rio um controlo regulamentar adicional."],reason_AML_PEP:["Un contr\xF4le r\xE9glementaire compl\xE9mentaire est n\xE9cessaire.","An additional regulatory check is required.","\xC9 necess\xE1rio um controlo regulamentar adicional."],reason_SCORE_BELOW_THRESHOLD:["La qualit\xE9 globale des \xE9l\xE9ments est insuffisante pour une d\xE9cision automatique.","The overall quality of the evidence is insufficient for an automatic decision.","A qualidade global dos elementos \xE9 insuficiente para uma decis\xE3o autom\xE1tica."],reason_DECLARED_MISMATCH:["Les informations d\xE9clar\xE9es diff\xE8rent de celles lues sur le document.","The declared information differs from what was read on the document.","As informa\xE7\xF5es declaradas diferem das lidas no documento."],reason_DATA_DISPUTED:["Vous avez signal\xE9 une erreur dans les informations lues.","You reported an error in the information read.","Assinalou um erro nas informa\xE7\xF5es lidas."],reason_AUTO_APPROVED:["Approbation automatique.","Automatic approval.","Aprova\xE7\xE3o autom\xE1tica."],reason_SIMULATED:["R\xE9sultat simul\xE9 (cl\xE9 de test).","Simulated result (test key).","Resultado simulado (chave de teste)."],errorTitle:["Une erreur est survenue","Something went wrong","Ocorreu um erro"],errorRef:["R\xE9f\xE9rence : {id}","Reference: {id}","Refer\xEAncia: {id}"],error_network:["Impossible de joindre le service de v\xE9rification. V\xE9rifiez votre connexion, ou que votre r\xE9seau n'en bloque pas l'acc\xE8s.","Unable to reach the verification service. Check your connection, or whether your network blocks it.","N\xE3o foi poss\xEDvel contactar o servi\xE7o de verifica\xE7\xE3o. Verifique a sua liga\xE7\xE3o ou se a rede o bloqueia."],error_timeout:["Le serveur met trop de temps \xE0 r\xE9pondre. R\xE9essayez.","The server is taking too long to respond. Try again.","O servidor est\xE1 a demorar demasiado a responder. Tente novamente."],error_unauthorized:["Acc\xE8s refus\xE9 : cl\xE9 ou session invalide.","Access denied: invalid key or session.","Acesso recusado: chave ou sess\xE3o inv\xE1lida."],error_origin_not_allowed:["Cette page n'est pas autoris\xE9e \xE0 utiliser ce service.","This page is not allowed to use this service.","Esta p\xE1gina n\xE3o est\xE1 autorizada a utilizar este servi\xE7o."],error_session_expired:["La session a expir\xE9. Relancez la v\xE9rification.","The session has expired. Start the verification again.","A sess\xE3o expirou. Reinicie a verifica\xE7\xE3o."],error_session_closed:["Cette v\xE9rification est d\xE9j\xE0 termin\xE9e.","This verification is already complete.","Esta verifica\xE7\xE3o j\xE1 est\xE1 conclu\xEDda."],error_quota:["Le service est temporairement indisponible pour cet organisme.","The service is temporarily unavailable for this organisation.","O servi\xE7o est\xE1 temporariamente indispon\xEDvel para esta organiza\xE7\xE3o."],error_kyb_pending:["Le service n'est pas encore activ\xE9 pour cet organisme.","The service is not yet enabled for this organisation.","O servi\xE7o ainda n\xE3o est\xE1 ativo para esta organiza\xE7\xE3o."],error_rate_limited:["Trop de tentatives. Patientez une minute puis r\xE9essayez.","Too many attempts. Wait a minute and try again.","Demasiadas tentativas. Aguarde um minuto e tente novamente."],error_upload_limit:["Nombre maximal d'essais atteint pour cette v\xE9rification.","Maximum number of attempts reached for this verification.","N\xFAmero m\xE1ximo de tentativas atingido para esta verifica\xE7\xE3o."],error_bad_request:["Requ\xEAte invalide.","Invalid request.","Pedido inv\xE1lido."],error_server:["Le service rencontre un probl\xE8me. R\xE9essayez dans un instant.","The service is having a problem. Try again shortly.","O servi\xE7o est\xE1 com um problema. Tente novamente daqui a pouco."],error_camera_denied:["Acc\xE8s \xE0 la cam\xE9ra refus\xE9.","Camera access denied.","Acesso \xE0 c\xE2mara recusado."],error_camera_unavailable:["Aucune cam\xE9ra disponible.","No camera available.","Nenhuma c\xE2mara dispon\xEDvel."],error_camera_busy:["Cam\xE9ra d\xE9j\xE0 utilis\xE9e par une autre application.","Camera already in use by another app.","C\xE2mara j\xE1 em uso por outra aplica\xE7\xE3o."],error_liveness_assets:["Module de d\xE9tection indisponible.","Detection module unavailable.","M\xF3dulo de dete\xE7\xE3o indispon\xEDvel."],error_unsupported_browser:["Navigateur non pris en charge.","Unsupported browser.","Navegador n\xE3o suportado."],error_in_app_browser:["Ouvrez cette page dans votre navigateur.","Open this page in your browser.","Abra esta p\xE1gina no seu navegador."],error_insecure_context:["Cette page doit \xEAtre servie en https.","This page must be served over https.","Esta p\xE1gina deve ser servida em https."],error_invalid_params:["Configuration du SDK invalide.","Invalid SDK configuration.","Configura\xE7\xE3o do SDK inv\xE1lida."],error_unknown:["Erreur inconnue.","Unknown error.","Erro desconhecido."]},Tt={fr:0,en:1,pt:2},te=class{constructor(e,t={}){this.locale=e;this.overrides=t;}t(e,t){let n=this.overrides[e]??ze[e][Tt[this.locale]];if(t)for(let[r,s]of Object.entries(t))n=n.split(`{${r}}`).join(String(s));return n}has(e){return Object.prototype.hasOwnProperty.call(ze,e)}docLabel(e){return this.t(e==="cni"?"docCni":e==="passeport"?"docPasseport":"docPermis")}reason(e){let t=`reason_${e}`;return this.has(t)?this.t(t):null}errorMessage(e){let t=`error_${e}`;return this.has(t)?this.t(t):this.t("error_unknown")}challengeInstruction(e){switch(e){case "blink":return this.t("livenessBlink");case "turn-left":return this.t("livenessTurnLeft");case "turn-right":return this.t("livenessTurnRight");case "smile":return this.t("livenessSmile");default:return this.t("livenessLookStraight")}}};var Nt=[[/FBAN|FBAV|FB_IAB|FB4A|FBIOS/i,"Facebook"],[/Instagram/i,"Instagram"],[/Messenger|FBMD/i,"Messenger"],[/WhatsApp/i,"WhatsApp"],[/Twitter|TwitterAndroid/i,"X"],[/LinkedInApp/i,"LinkedIn"],[/Snapchat/i,"Snapchat"],[/TikTok|musical_ly|BytedanceWebview/i,"TikTok"],[/Line\//i,"LINE"],[/MicroMessenger/i,"WeChat"],[/GSA\//i,"Google"]];function Lt(a){for(let[e,t]of Nt)if(e.test(a))return t;return /; wv\)/.test(a)&&/Android/i.test(a)?"WebView":null}function ne(a=typeof navigator<"u"?navigator.userAgent:""){let e=typeof window<"u",t=e?window.isSecureContext!==false:false,n=typeof navigator<"u"&&!!navigator.mediaDevices?.getUserMedia,r=typeof WebAssembly=="object"&&typeof WebAssembly.instantiate=="function",s=false;try{if(typeof document<"u"){let m=document.createElement("canvas");s=!!(m.getContext("webgl2")||m.getContext("webgl"));}}catch{s=false;}let o=/iPhone|iPad|iPod/i.test(a)||typeof navigator<"u"&&navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1,l=/Android/i.test(a),d=/iPad|Tablet|(Android(?!.*Mobile))/i.test(a)||o&&!/iPhone|iPod/i.test(a),c=o||l||/Mobile|webOS|BlackBerry|Opera Mini/i.test(a),u=Lt(a),p={secureContext:t,mediaDevices:n,webAssembly:r,webGL:s,inAppBrowser:!!u,inAppBrowserName:u,mobile:c,ios:o,android:l,deviceClass:d?"tablet":c?"mobile":"desktop"};return !e||typeof document>"u"?{...p,ok:false,code:"unsupported_browser",reason:"no-dom"}:t?u?{...p,ok:false,code:"in_app_browser",reason:u}:n?r?{...p,ok:true}:{...p,ok:false,code:"unsupported_browser",reason:"no-webassembly"}:{...p,ok:false,code:"unsupported_browser",reason:"no-getusermedia"}:{...p,ok:false,code:"insecure_context",reason:"insecure-context"}}async function Ve(){try{if(!navigator.mediaDevices?.enumerateDevices)return null;let e=(await navigator.mediaDevices.enumerateDevices()).filter(t=>t.kind==="videoinput");return e.length===0?!1:e.some(t=>/back|rear|environment|arrière/i.test(t.label))?!0:e.every(t=>!t.label)?null:!1}catch{return null}}var ae=class{constructor(e,t,n,r){this.client=e;this.enabled=t;this.device=n;this.log=r;this.queue=[];this.timer=null;this.startedAt=performance.now();this.stepStartedAt=performance.now();}track(e,t){this.enabled&&(this.queue.push({event:e,at:new Date().toISOString(),data:t}),this.queue.length>=50?this.flush():this.timer||(this.timer=setTimeout(()=>{this.flush();},5e3)));}stepDuration(){let e=performance.now(),t=Math.round(e-this.stepStartedAt);return this.stepStartedAt=e,t}elapsed(){return Math.round(performance.now()-this.startedAt)}async flush(e=false){if(this.timer&&(clearTimeout(this.timer),this.timer=null),!this.enabled||this.queue.length===0||!this.client.canAuthenticate)return;let t=this.queue.splice(0,50);try{await this.client.sendEvents(t,this.device,e);}catch(n){this.log.debug("telemetry dropped",n);}}};var I="[NayaId]";function je(a){let e=()=>{};return a?{debug:(t,n)=>n===void 0?console.debug(I,t):console.debug(I,t,n),warn:(t,n)=>n===void 0?console.warn(I,t):console.warn(I,t,n),error:(t,n)=>n===void 0?console.error(I,t):console.error(I,t,n)}:{debug:e,warn:e,error:e}}var Mt={tap:12,success:[18,40,18],error:[60,40,60]};function Ye(a,e=true){if(e)try{typeof navigator<"u"&&typeof navigator.vibrate=="function"&&navigator.vibrate(Mt[a]);}catch{}}function We(){let a=typeof navigator<"u"?navigator.connection??navigator.mozConnection??navigator.webkitConnection:null,e=a?.effectiveType??null,t=!!a?.saveData;return {effectiveType:e,saveData:t,slow:t||e==="slow-2g"||e==="2g"}}var ke="1.0.1",At="https://sdk.naya.41devs.com/mediapipe",_t="face_landmarker.task",Dt="64184e229b263107bc2b804c6625db1341ff2bb731874b0bcc2fe6544e0bc9ff",Ot=`https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@${ke}/vision_bundle.mjs`,Rt=`https://cdn.jsdelivr.net/npm/@mediapipe/tasks-vision@${ke}/wasm`,Ht="https://storage.googleapis.com/mediapipe-models/face_landmarker/face_landmarker/float16/1/face_landmarker.task",Ft=1,It=234,Pt=454,$t=33,Bt=263;function Ge(a={}){let e=a.fallbackToPublicCdn??true,t=`${At}/${ke}`,n=(r,s,o)=>{let l=[r??s];return e&&!l.includes(o)&&l.push(o),l};return {esm:n(a.esmUrl,`${t}/vision_bundle.mjs`,Ot),wasm:n(a.wasmBaseUrl,`${t}/wasm`,Rt),model:n(a.modelUrl,`${t}/${_t}`,Ht),modelSha256:a.modelSha256===void 0?a.modelUrl?null:Dt:a.modelSha256}}async function P(a,e){let t;for(let n of a)try{return await e(n)}catch(r){t=r;}throw t??new Error("no-asset-url")}async function qt(a){try{if(!globalThis.crypto?.subtle)return null;let e=await crypto.subtle.digest("SHA-256",a);return Array.from(new Uint8Array(e)).map(t=>t.toString(16).padStart(2,"0")).join("")}catch{return null}}var Ee=new Map,Se=new Map,Ce=new Map;function Ke(a){let e=Ee.get(a);return e||(e=import(a),e.catch(()=>Ee.delete(a)),Ee.set(a,e)),e}function Qe(a,e){let t=Se.get(a);return t||(t=(async()=>{let n=await fetch(a,{cache:"force-cache"});if(!n.ok)throw new Error(`model:${n.status}`);let r=await n.arrayBuffer();if(e){let s=await qt(r);if(s&&s!==e)throw new Error("model:integrity")}return new Uint8Array(r)})(),t.catch(()=>Se.delete(a)),Se.set(a,t)),t}function Xe(a,e){let t=Ce.get(e);return t||(t=a.FilesetResolver.forVisionTasks(e),t.catch(()=>Ce.delete(e)),Ce.set(e,t)),t}function Ut(a){if(!a||a.rows!==4||a.columns!==4||a.data.length!==16)return null;let e=a.data,t=Math.abs(e[12])+Math.abs(e[13])+Math.abs(e[14])<1e-6,n=(u,p)=>t?e[u*4+p]:e[p*4+u],r=n(0,0),s=n(0,2),o=n(1,0),l=n(1,2),d=n(2,2);if(![r,s,o,l,d].every(Number.isFinite))return null;let c=u=>u*180/Math.PI;return {yaw:c(Math.atan2(s,d)),pitch:c(Math.atan2(-l,d)),roll:c(Math.atan2(o,r))}}function zt(a,e=1){let t=a[$t],n=a[Bt];if(!t||!n)return null;let r=(n.x-t.x)*e,s=n.y-t.y;return Math.abs(r)<1e-4?null:Math.atan2(s,r)*180/Math.PI}function Vt(a){let e=a[Ft],t=a[It],n=a[Pt];if(!e||!t||!n)return null;let r=n.x-t.x;return Math.abs(r)<1e-4?null:((e.x-t.x)/r-.5)*160}var $=class{constructor(){this.landmarker=null;this.vision=null;this.delegate=null;}static async preload(e={}){let t=Ge(e),n=await P(t.esm,Ke);await Promise.all([P(t.wasm,r=>Xe(n,r)),P(t.model,r=>Qe(r,t.modelSha256))]);}async init(e={}){let t=Ge(e);this.vision=await P(t.esm,Ke);let{FaceLandmarker:n}=this.vision,[r,s]=await Promise.all([P(t.wasm,l=>Xe(this.vision,l)),P(t.model,l=>Qe(l,t.modelSha256))]),o=l=>n.createFromOptions(r,{baseOptions:{modelAssetBuffer:s,delegate:l},runningMode:"VIDEO",numFaces:2,outputFaceBlendshapes:true,outputFacialTransformationMatrixes:true});try{this.landmarker=await o("GPU"),this.delegate="GPU";}catch{this.landmarker=await o("CPU"),this.delegate="CPU";}}get ready(){return !!this.landmarker}get activeDelegate(){return this.delegate}detect(e,t){let n={faceCount:0,leftEyeOpen:null,rightEyeOpen:null,yawDegrees:null,rollDegrees:null,pitchDegrees:null,smile:null,box:null};if(!this.landmarker||e.videoWidth<8)return n;let r=this.landmarker.detectForVideo(e,t),s=r.faceLandmarks??[],o=s.length;if(o!==1)return {...n,faceCount:o};let l=s[0],d=null,c=null,u=null,p=null,m=r.faceBlendshapes?.[0]?.categories;if(m)for(let b of m)switch(b.categoryName){case "eyeBlinkLeft":d=1-b.score;break;case "eyeBlinkRight":c=1-b.score;break;case "mouthSmileLeft":u=b.score;break;case "mouthSmileRight":p=b.score;break}let y=u!=null&&p!=null?(u+p)/2:null,v=Vt(l),C=Ut(r.facialTransformationMatrixes?.[0]),g=C?.yaw??null,w=v;g!=null&&v!=null&&(w=(v===0?Math.sign(g)||1:Math.sign(v))*Math.abs(g));let D=e.videoHeight>0?e.videoWidth/e.videoHeight:1,A=C?.roll??zt(l,D),O=C?.pitch??null,S=1,f=1,T=0,N=0;for(let b of l)b.x<S&&(S=b.x),b.y<f&&(f=b.y),b.x>T&&(T=b.x),b.y>N&&(N=b.y);let k=T>S&&N>f?{x:S,y:f,w:T-S,h:N-f}:null;return {faceCount:1,leftEyeOpen:d,rightEyeOpen:c,yawDegrees:w,rollDegrees:A,pitchDegrees:O,smile:y,box:k}}close(){this.landmarker?.close?.(),this.landmarker=null;}};var jt=["blink","turn-left","turn-right","smile"],Te=["blink","turn-left","smile"];function Yt(a){return typeof a=="string"&&jt.includes(a)}function Y(a){let e=(a??[]).filter(Yt);return e.length?e:[...Te]}function Je(a){let e=a.yawDegrees==null?0:Math.abs(a.yawDegrees),t=a.rollDegrees==null?0:Math.abs(a.rollDegrees),n=a.pitchDegrees==null?0:Math.abs(a.pitchDegrees);if(e>8||t>8||n>12)return "tilted";let r=a.leftEyeOpen??1,s=a.rightEyeOpen??1;return r<.6||s<.6?"eyes-closed":null}var j=class{constructor(e=Te,t=()=>performance.now()){this.now=t;this.phase="searching-face";this.index=0;this.framesWithFace=0;this.framesWithoutFace=0;this.eyesOpenFrames=0;this.eyesClosedSince=null;this.lockedAt=null;this.neutralCaptured=false;this.settleFrames=0;this.lastBlinkMs=null;this.holdSince=null;this.forcedDone=false;this.proofSteps=[];this.steps=e.length?[...e]:[...Te];}get isDone(){return this.phase==="done"}get currentStep(){return this.phase==="searching-face"||this.phase==="done"||this.phase==="hold"?null:this.phase}get progress(){let e=this.steps.length+1,t=this.phase==="searching-face"?0:this.phase==="done"||this.phase==="hold"?e:1+this.index;return Math.min(1,t/e)}get completedCount(){return this.proofSteps.length}get holdElapsed(){return this.holdSince==null?0:Math.max(0,this.now()-this.holdSince)}get settled(){return this.isDone&&!this.forcedDone}forceDone(){this.phase==="hold"&&(this.forcedDone=true,this.phase="done");}get proof(){return this.proofSteps.map(e=>({...e}))}elapsed(){return this.lockedAt==null?0:Math.max(0,Math.round(this.now()-this.lockedAt))}guidanceFor(e){if(e.faceCount===0)return "no-face";if(e.faceCount>1)return "multiple-faces";let t=e.box;if(!t)return null;if(t.w<.22)return "too-small";if(t.w>.7)return "too-large";let n=t.x+t.w/2,r=t.y+t.h/2;return Math.abs(n-.5)>.18||Math.abs(r-.5)>.18+.06?"off-center":null}onFrame(e){let t=this.phase,n=this.guidanceFor(e);if(e.faceCount!==1)return this.framesWithoutFace++,this.framesWithoutFace>12&&this.phase!=="done"&&(this.phase="searching-face",this.framesWithFace=0),{changed:this.phase!==t,guidance:n};this.framesWithoutFace=0,this.framesWithFace++;let r,s;{let{leftEyeOpen:o,rightEyeOpen:l,yawDegrees:d}=e;(d==null||Math.abs(d)<=20)&&o!=null&&l!=null&&o>.6&&l>.6&&this.eyesOpenFrames++;}switch(this.phase){case "searching-face":this.framesWithFace>=6&&n===null&&(this.lockedAt==null&&(this.lockedAt=this.now()),!this.neutralCaptured&&Je(e)===null&&(this.neutralCaptured=true,s="neutral"),this.phase=this.index<this.steps.length?this.steps[this.index]:"hold",this.phase==="hold"&&(this.holdSince=this.now()));break;case "blink":{let{leftEyeOpen:o,rightEyeOpen:l}=e;if(o==null||l==null)break;if(e.yawDegrees!=null&&Math.abs(e.yawDegrees)>20){this.eyesOpenFrames=0,this.eyesClosedSince=null;break}let c=(o+l)/2<.35&&o<.5&&l<.5,u=o>.6&&l>.6;if(c){if(this.eyesOpenFrames<2)break;this.eyesClosedSince==null?(this.eyesClosedSince=this.now(),s="eyes-closed"):this.now()-this.eyesClosedSince>700&&(this.eyesClosedSince=null,this.eyesOpenFrames=0);}else if(u&&this.eyesClosedSince!=null){let p=Math.round(this.now()-this.eyesClosedSince);this.eyesClosedSince=null,p<=700&&(r="blink",this.lastBlinkMs=p);}break}case "turn-left":case "turn-right":{let o=e.yawDegrees;if(o==null)break;(this.phase==="turn-left"?o>16:o<-16)&&(r=this.phase,s="turned");break}case "smile":{e.smile!=null&&e.smile>.55&&(r="smile",s="smile");break}case "hold":{let o=n??Je(e);return o===null?(this.settleFrames++,this.settleFrames>=4&&(this.phase="done")):this.settleFrames=0,{changed:this.phase!==t,guidance:o}}}if(r){let o={step:r,at:this.elapsed()};r==="blink"&&this.lastBlinkMs!=null&&(o.durationMs=this.lastBlinkMs),this.proofSteps.push(o),this.index+=1,this.eyesOpenFrames=0,this.eyesClosedSince=null,this.lastBlinkMs=null,this.phase=this.index<this.steps.length?this.steps[this.index]:"hold",this.phase==="hold"&&(this.holdSince=this.now());}return {changed:this.phase!==t,completed:r,capture:s,guidance:n}}score(){if(!this.isDone){let t=20;return this.framesWithFace>=6&&(t+=15),t+=Math.min(40,this.proofSteps.length*15),t}return 90+Math.min(8,Math.round(this.framesWithFace/30))}};var re=class{constructor(e,t,n){this.onStep=()=>{};this.step="welcome";this.session=null;this.challenge=[];this.rectoBase64=null;this.versoBase64=null;this.selfieBase64=null;this.livenessFrames=[];this.livenessProof=[];this.livenessMode="active";this.livenessScore=0;this.livenessDelegate=null;this.dataDisputed=false;this.submitResponse=null;this.attemptsUsed=0;this.captureAttempts=0;this.consentGranted=false;this.consentAlreadyOnServer=false;this.tipsShown={document:false,selfie:false};this.pendingHandoff=false;this.handoffInfo=null;this.stepHistory=[];this.documentUpload=null;this.finished=false;this.preparation=null;this.sessionPromise=null;this.consentSent=false;this.livenessPreload=null;this.config=t,this.finishCb=n,this.strings=new te(t.locale,t.strings),this.support=ne(),this.log=je(t.debug),this.slowNetwork=We().slow,this.api=new ee({...e},t.baseUrl);let r=this.support.ios?"ios":this.support.android?"android":"other";this.telemetry=new ae(this.api,t.telemetry,`${this.support.deviceClass}/${r}`,this.log),this.country=t.country??null,this.document=t.documentTypes.length===1?t.documentTypes[0]:null,this.resumed=!!(e.sessionToken&&e.verificationId),this.resumed&&(this.session={verificationId:e.verificationId,sessionToken:e.sessionToken,challenge:[]}),this.support.ok||(this.step="unsupported"),this.log.debug("flow created",{resumed:this.resumed,support:this.support,slowNetwork:this.slowNetwork});}get client(){return this.api}emit(e,t){let n={type:e,at:performance.now(),step:this.step,data:t};try{this.config.onEvent?.(n);}catch(r){this.log.warn("onEvent handler threw",r);}}haptic(e){Ye(e,this.config.haptics&&this.support.mobile);}go(e){this.stepHistory.push(this.step),this.setStep(e,"forward");}replace(e){this.setStep(e,"replace");}get canGoBack(){return this.stepHistory.length>0}back(){let e=this.stepHistory.pop();e&&this.setStep(e,"back");}setStep(e,t){let n=this.step;this.telemetry.track("step_completed",{step:n,durationMs:this.telemetry.stepDuration(),next:e}),this.step=e,this.telemetry.track("step_started",{step:e}),this.emit("step",{from:n,to:e,direction:t}),this.onStep(e,t);}get consentRequired(){return this.config.consent!==false&&!this.consentAlreadyOnServer&&!this.consentGranted}get handoffAvailable(){return this.config.handoff.enabled&&!this.support.mobile&&this.config.container===null}get selectionComplete(){return !!this.country&&!!this.document}nextAfterWelcome(){return this.consentRequired?"consent":this.nextAfterConsent()}nextAfterConsent(){return this.pendingHandoff&&this.selectionComplete?"handoff":this.selectionComplete?this.nextAfterSelect():"select"}nextAfterSelect(){return this.pendingHandoff?"handoff":(this.config.eagerSession&&!this.session&&this.ensureSession().catch(()=>{}),this.tipsShown.document?"capture-recto":"tips-document")}nextAfterCapture(e){return e==="recto"&&this.needsVerso?"capture-verso":this.tipsShown.selfie?"liveness":"tips-selfie"}nextAfterLiveness(){return this.config.confirmOcr?"ocr-confirm":"processing"}prepare(){return this.preparation??(this.preparation=this.loadResumedSession())}async loadResumedSession(){if(!(!this.resumed||!this.session))try{let e=await this.api.getVerification(this.session.verificationId),t=Q.find(r=>r===e.documentType),n=B.find(r=>r.code===e.country)?.code;t&&(this.document=t),n&&(this.country=n),this.challenge=Y(e.challenge),this.session.challenge=this.challenge,this.consentAlreadyOnServer=!!e.consentAt,this.emit("session",{verificationId:this.session.verificationId,resumed:!0}),this.log.debug("resumed session",e);}catch(e){let t=this.config.documentTypes.length===1?this.config.documentTypes[0]:null;if(this.config.country&&t){this.country=this.config.country,this.document=t,this.challenge=Y(null);return}throw e}}ensureSession(){return this.session&&this.challenge.length?this.maybeSendConsent().then(()=>this.session):this.sessionPromise??(this.sessionPromise=this.createSession().finally(()=>{this.sessionPromise=null;}))}async createSession(){if(this.session)return this.challenge.length||await this.prepare(),await this.maybeSendConsent(),this.session;if(!this.document||!this.country)throw new L("Document et pays requis.","invalid_params");let e=await this.api.start({documentType:this.document,country:this.country,callbackUrl:this.config.callbackUrl,device:this.support.deviceClass==="desktop"?"Web":this.support.deviceClass==="tablet"?"Tablette":"Mobile"});return this.session=e,this.challenge=Y(e.challenge),e.sessionToken&&this.api.useSession(e.sessionToken),this.emit("session",{verificationId:e.verificationId,resumed:false}),this.telemetry.track("session_opened",{resumed:false}),await this.maybeSendConsent(),e}async maybeSendConsent(){if(!this.session||this.consentSent||this.consentAlreadyOnServer||!this.consentGranted)return;this.consentSent=true;let e=this.config.consent===false?void 0:this.config.consent.version;try{await this.api.consent(this.session.verificationId,e),this.emit("consent",{verificationId:this.session.verificationId});}catch(t){this.consentSent=false,this.log.warn("consent not recorded",t);}}grantConsent(){this.consentGranted=true,this.telemetry.track("consent_granted"),this.session&&this.maybeSendConsent();}startDocumentUpload(){if(this.documentUpload)return;let e=this.uploadDocument();this.documentUpload=e,e.catch(()=>{});}ensureDocumentUploaded(){return this.documentUpload??(this.documentUpload=this.uploadDocument())}get documentUploadInFlight(){return this.documentUpload!==null&&this.ocrData===void 0&&!!this.rectoBase64}async uploadDocument(){try{let e=await this.ensureSession(),t=await this.api.uploadDocument(e.verificationId,{rectoBase64:this.rectoBase64,versoBase64:this.versoBase64??void 0});return this.ocrData=t,this.telemetry.track("document_uploaded",{hasOcr:!!t,fields:t?Object.keys(t).length:0}),t}catch(e){throw this.documentUpload=null,e}}get imageMaxDimension(){return this.slowNetwork?Math.min(1200,this.config.capture.maxDimension):this.config.capture.maxDimension}get wantsFileUpload(){let e=this.config.capture.fileUpload;return e==="always"||e==="auto"&&!this.support.mobile}preloadLiveness(){!this.config.liveness.preload||this.livenessPreload||(this.livenessPreload=$.preload(this.config.livenessAssets).catch(e=>{this.log.warn("liveness preload failed",e),this.livenessPreload=null;}));}get challengeSteps(){return this.challenge.length?this.challenge:Y(null)}async requestHandoff(){let e=await this.ensureSession();return this.handoffInfo=await this.api.handoff(e.verificationId,this.config.handoff.baseUrl||void 0),this.emit("handoff_shown",{verificationId:e.verificationId}),this.telemetry.track("handoff_shown"),this.handoffInfo}get canRetry(){return !this.resumed&&this.attemptsUsed<this.config.maxAttempts}resetForRetry(){this.attemptsUsed+=1,this.session=null,this.challenge=[],this.rectoBase64=null,this.versoBase64=null,this.selfieBase64=null,this.livenessFrames=[],this.livenessProof=[],this.livenessMode="active",this.livenessScore=0,this.ocrData=void 0,this.declaredData=void 0,this.dataDisputed=false,this.submitResponse=null,this.documentUpload=null,this.consentSent=false,this.stepHistory=[],this.telemetry.track("retry",{attempt:this.attemptsUsed});}get needsVerso(){return !!this.document&&X(this.document)}documentTypeNeedsVerso(e){return X(e)}normalizeError(e,t="unknown"){if(e instanceof L)return {message:e.code==="network"||e.code==="timeout"?this.strings.errorMessage(e.code):e.message,code:e.code,statusCode:e.statusCode,requestId:e.requestId};if(e instanceof DOMException||e&&typeof e=="object"&&"name"in e){let r=String(e.name);if(r==="NotAllowedError"||r==="SecurityError")return {message:this.strings.t("cameraDenied"),code:"camera_denied"};if(r==="NotFoundError"||r==="OverconstrainedError")return {message:this.strings.t("cameraUnavailable"),code:"camera_unavailable"};if(r==="NotReadableError"||r==="AbortError")return {message:this.strings.t("cameraBusy"),code:"camera_busy"}}return {message:e instanceof Error&&e.message?e.message:this.strings.errorMessage(t),code:t}}complete(e){if(this.finished)return;this.finished=true;let t={...e,verificationId:e.verificationId??this.session?.verificationId};this.telemetry.track("result",{status:t.status,code:t.errorCode??null,reasons:t.reasonCodes?.length??0,elapsedMs:this.telemetry.elapsed()}),this.emit(t.status==="error"?"error":t.status==="cancelled"?"cancelled":"result",{...t}),this.rectoBase64=this.versoBase64=this.selfieBase64=null,this.livenessFrames=[],this.telemetry.flush(true),this.finishCb(t);}fail(e,t="unknown"){let n=this.normalizeError(e,t);this.log.error("flow failed",n),this.telemetry.track("error",{code:n.code,status:n.statusCode??null,step:this.step}),this.complete(q(n.message,this.session?.verificationId,{errorCode:n.code,statusCode:n.statusCode,requestId:n.requestId}));}cancel(){this.haptic("tap"),this.complete({status:"cancelled"});}};var Ze='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function et(a){let e=t=>{if(t.key!=="Tab")return;let n=Array.from(a.querySelectorAll(Ze)).filter(l=>!l.hidden&&l.offsetParent!==null);if(n.length===0)return;let r=n[0],s=n[n.length-1],o=a.activeElement??document.activeElement;t.shiftKey&&(o===r||!a.contains(o))?(t.preventDefault(),s.focus()):!t.shiftKey&&o===s&&(t.preventDefault(),r.focus());};return document.addEventListener("keydown",e,true),()=>document.removeEventListener("keydown",e,true)}function tt(a){(a.querySelector("[data-autofocus]")??a.querySelector('h1[tabindex="-1"]')??a.querySelector(Ze))?.focus({preventScroll:true});}function i(a){return a.replace(/[&<>"']/g,e=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[e])}function se(a){return i(a).replace(/\n/g,"<br>")}async function oe(a){try{return await navigator.clipboard.writeText(a),!0}catch{try{let e=document.createElement("textarea");e.value=a,e.setAttribute("readonly",""),e.style.position="fixed",e.style.opacity="0",document.body.appendChild(e),e.select();let t=document.execCommand("copy");return e.remove(),t}catch{return false}}}var Wt={back:'<path d="M15 18l-6-6 6-6"/>',close:'<path d="M18 6L6 18M6 6l12 12"/>',check:'<path d="M20 6L9 17l-5-5"/>',chevron:'<path d="M9 18l6-6-6-6"/>',shield:'<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"/><path d="M9 12l2 2 4-4"/>',lock:'<rect x="4" y="11" width="16" height="10" rx="2"/><path d="M8 11V7a4 4 0 018 0v4"/>',fingerprint:'<path d="M12 10a2 2 0 00-2 2c0 1.5.5 3 1 4.5"/><path d="M8.5 8.5A5 5 0 0117 12c0 2-.3 4-1 6"/><path d="M6 10.5A7 7 0 0119 12c0 1.4-.1 2.8-.4 4"/><path d="M5 15a10 10 0 01-.3-3"/><path d="M12 14c0 2 .5 4 1.5 6"/>',"id-card":'<rect x="3" y="5" width="18" height="14" rx="2"/><circle cx="8.5" cy="11" r="2"/><path d="M5.5 16c.6-1.5 1.7-2 3-2s2.4.5 3 2"/><path d="M14 9h4M14 12h4M14 15h3"/>',passport:'<rect x="5" y="3" width="14" height="18" rx="2"/><circle cx="12" cy="10" r="3"/><path d="M8 17h8"/>',car:'<path d="M5 17h14M6 17l1.5-6h9L18 17"/><path d="M4 12h16"/><circle cx="7.5" cy="17" r="1.5"/><circle cx="16.5" cy="17" r="1.5"/>',sun:'<circle cx="12" cy="12" r="4"/><path d="M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"/>',focus:'<path d="M4 8V6a2 2 0 012-2h2M16 4h2a2 2 0 012 2v2M20 16v2a2 2 0 01-2 2h-2M8 20H6a2 2 0 01-2-2v-2"/><circle cx="12" cy="12" r="3"/>',eye:'<path d="M2 12s3.5-6 10-6 10 6 10 6-3.5 6-10 6S2 12 2 12z"/><circle cx="12" cy="12" r="3"/>',"rotate-left":'<path d="M3 12a9 9 0 109-9"/><path d="M3 4v5h5"/>',"rotate-right":'<path d="M21 12a9 9 0 11-9-9"/><path d="M21 4v5h-5"/>',smile:'<circle cx="12" cy="12" r="9"/><path d="M8 14s1.5 2 4 2 4-2 4-2"/><path d="M9 9h.01M15 9h.01"/>',hourglass:'<path d="M6 2h12M6 22h12M7 2v5l5 5 5-5V2M7 22v-5l5-5 5 5v5"/>',clock:'<circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/>',"wifi-off":'<path d="M2 2l20 20"/><path d="M8.5 16.5a5 5 0 017 0"/><path d="M5 12.5a10 10 0 015.5-2.8M16.5 10.5c1 .5 1.9 1.1 2.7 1.9"/><path d="M2 8.8a15 15 0 015.2-2.7M15 6.3c2.5.7 4.9 2 7 3.8"/><circle cx="12" cy="20" r="1"/>',refresh:'<path d="M21 12a9 9 0 11-2.6-6.4"/><path d="M21 3v6h-6"/>',upload:'<path d="M12 16V4M6 10l6-6 6 6"/><path d="M4 20h16"/>',flip:'<path d="M4 7h11l-3-3M20 17H9l3 3"/>',flash:'<path d="M13 2L4 14h7l-1 8 9-12h-7l1-8z"/>',qr:'<rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><path d="M14 14h3v3h-3zM20 14v3M17 20h3M14 20h.01"/>',phone:'<rect x="7" y="2" width="10" height="20" rx="2"/><path d="M11 18h2"/>',alert:'<path d="M12 3l10 18H2L12 3z"/><path d="M12 10v4M12 17h.01"/>',info:'<circle cx="12" cy="12" r="9"/><path d="M12 11v5M12 8h.01"/>',user:'<circle cx="12" cy="8" r="4"/><path d="M4 21c0-4 3.6-7 8-7s8 3 8 7"/>',copy:'<rect x="9" y="9" width="12" height="12" rx="2"/><path d="M5 15V5a2 2 0 012-2h10"/>',external:'<path d="M14 4h6v6M20 4l-9 9"/><path d="M19 14v5a1 1 0 01-1 1H5a1 1 0 01-1-1V6a1 1 0 011-1h5"/>',camera:'<path d="M4 8h3l2-3h6l2 3h3v11H4z"/><circle cx="12" cy="13" r="3.5"/>',sparkle:'<path d="M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z"/>',hand:'<path d="M8 13V5a1.5 1.5 0 013 0v6M11 11V4a1.5 1.5 0 013 0v7M14 11V5.5a1.5 1.5 0 013 0V13"/><path d="M17 13v2a6 6 0 01-6 6h-1a6 6 0 01-5-2.7L3.6 14A1.6 1.6 0 016 12.5L8 15"/>'};function h(a,e=20,t=2){return `<svg class="n-ico" width="${e}" height="${e}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="${t}" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false">${Wt[a]}</svg>`}var Gt="0 0 838 240",Kt='<path fill="var(--naya-brand-accent, #E6950A)" d="M713.96 23.28C748.32 29.10 776.61 40.61 797.04 56.24C817.48 71.87 830.83 92.31 832.56 115.36C834.32 138.61 824.00 161.01 804.17 179.75C784.49 198.35 754.92 213.98 715.67 225.15L706.15 195.27C742.32 184.98 767.56 170.30 782.34 156.33C796.97 142.51 801.61 129.07 800.76 117.79C799.89 106.31 793.08 93.53 777.75 81.81C762.42 70.09 739.34 60.14 708.67 54.95L713.96 23.28Z"/><path fill="var(--naya-brand-accent, #E6950A)" d="M686.03 61.99C683.68 73.95 677.15 101.86 677.68 125.45C677.95 137.56 680.10 145.18 682.78 148.84C683.82 150.26 684.83 150.94 686.08 151.34C687.52 151.80 690.43 152.20 695.60 151.04L702.55 182.38C693.47 184.43 684.65 184.55 676.52 181.98C668.18 179.34 661.75 174.24 657.09 167.87C648.37 155.94 646.10 139.90 645.79 126.18C645.16 98.13 652.78 65.72 654.73 55.77L686.03 61.99Z"/><path fill="var(--naya-brand-accent, #E6950A)" d="M714.79 18.35C749.73 24.27 778.84 36.03 800.08 52.26C821.32 68.50 835.68 90.15 837.55 114.98C839.44 140.08 828.25 163.87 807.60 183.38C787.16 202.71 756.78 218.65 717.03 229.96L712.37 231.28L699.82 191.87L704.79 190.46C740.39 180.33 764.86 165.98 778.91 152.70C792.71 139.65 796.48 127.61 795.77 118.17C795.04 108.46 789.23 96.88 774.72 85.79C760.19 74.68 737.92 64.98 707.83 59.88L702.92 59.05L709.85 17.52L714.79 18.35ZM708.67 54.95C739.34 60.14 762.42 70.09 777.75 81.81C793.08 93.53 799.89 106.31 800.76 117.79C801.61 129.07 796.97 142.51 782.34 156.33C767.56 170.30 742.32 184.98 706.15 195.27L715.67 225.15C754.31 214.16 783.56 198.83 803.24 180.62L804.17 179.75C823.69 161.30 833.99 139.31 832.64 116.45L832.56 115.36C830.85 92.67 817.90 72.50 797.99 56.97L797.04 56.24C776.61 40.61 748.32 29.10 713.96 23.28L708.67 54.95ZM691.89 58.06L690.93 62.96C688.53 75.23 682.16 102.44 682.68 125.34C682.95 137.21 685.08 143.51 686.82 145.89C687.11 146.29 687.28 146.42 687.32 146.46C687.36 146.48 687.41 146.52 687.59 146.57C687.98 146.70 689.95 147.19 694.50 146.16L699.4 145.06L708.51 186.17L703.65 187.26C693.95 189.44 684.20 189.65 675.01 186.75C665.56 183.76 658.27 177.96 653.05 170.82C643.39 157.61 641.11 140.26 640.79 126.30C640.14 97.56 647.94 64.46 649.83 54.81L650.79 49.89L691.89 58.06ZM654.73 55.77C652.78 65.72 645.16 98.13 645.79 126.18C646.10 139.90 648.37 155.94 657.09 167.87C661.75 174.24 668.18 179.34 676.52 181.98C684.65 184.55 693.47 184.43 702.55 182.38L695.60 151.04C690.75 152.13 687.89 151.84 686.37 151.42L686.08 151.34C684.91 150.97 683.95 150.35 682.98 149.10L682.78 148.84C680.19 145.29 678.09 138.04 677.71 126.58L677.68 125.45C677.15 101.86 683.68 73.95 686.03 61.99L654.73 55.77Z"/><path fill="currentColor" d="M694.67 11.50C701.03 22.50 697.26 36.57 686.26 42.92C675.25 49.27 661.19 45.50 654.84 34.50C648.49 23.50 652.25 9.43 663.26 3.08C674.26 -3.26 688.32 0.50 694.67 11.50Z"/><path fill="currentColor" d="M88.65 115.93C88.65 101.41 76.87 89.64 62.35 89.64H36.06V187.30H0V53.58H62.35C96.79 53.58 124.71 81.49 124.71 115.93V187.30H88.65V115.93Z"/><path fill="currentColor" d="M443.45 123.55C443.45 111.30 446.31 100.04 452.02 89.76C457.90 79.47 465.74 71.39 475.53 65.51C485.33 59.47 496.02 56.45 507.61 56.45C514.79 56.45 521.32 57.60 527.20 59.88C533.24 62.17 538.62 65.43 543.36 69.68V58.66H578.86V188.44H543.36V177.66C538.62 181.75 533.24 184.93 527.20 187.21C521.32 189.34 514.79 190.40 507.61 190.40C496.18 190.40 485.49 187.38 475.53 181.34C465.74 175.13 457.90 166.97 452.02 156.85C446.31 146.57 443.45 135.47 443.45 123.55ZM476.51 123.55C476.51 129.75 477.98 135.55 480.92 140.93C484.02 146.16 488.18 150.40 493.41 153.67C498.63 156.77 504.51 158.32 511.04 158.32C517.24 158.32 522.95 156.77 528.18 153.67C533.56 150.40 537.81 146.08 540.91 140.69C544.17 135.30 545.81 129.59 545.81 123.55C545.81 117.51 544.17 111.79 540.91 106.41C537.81 101.02 533.56 96.69 528.18 93.43C522.95 90.16 517.24 88.53 511.04 88.53C504.67 88.53 498.79 90.16 493.41 93.43C488.18 96.53 484.02 100.78 480.92 106.16C477.98 111.55 476.51 117.34 476.51 123.55Z"/><path fill="currentColor" d="M289.55 58.66H327.26L361.05 146.08L393.13 58.66H430.84L359.09 239.86H322.36L342.93 187.70L289.55 58.66Z"/><path fill="currentColor" d="M138.33 123.55C138.33 111.30 141.18 100.04 146.90 89.76C152.77 79.47 160.61 71.39 170.40 65.51C180.20 59.47 190.89 56.45 202.48 56.45C209.66 56.45 216.19 57.60 222.07 59.88C228.11 62.17 233.50 65.43 238.23 69.68V58.66H273.74V188.44H238.23V177.66C233.50 181.75 228.11 184.93 222.07 187.21C216.19 189.34 209.66 190.40 202.48 190.40C191.05 190.40 180.36 187.38 170.40 181.34C160.61 175.13 152.77 166.97 146.90 156.85C141.18 146.57 138.33 135.47 138.33 123.55ZM171.38 123.55C171.38 129.75 172.85 135.55 175.79 140.93C178.89 146.16 183.05 150.40 188.28 153.67C193.50 156.77 199.38 158.32 205.91 158.32C212.11 158.32 217.83 156.77 223.05 153.67C228.44 150.40 232.68 146.08 235.78 140.69C239.05 135.30 240.68 129.59 240.68 123.55C240.68 117.51 239.05 111.79 235.78 106.41C232.68 101.02 228.44 96.69 223.05 93.43C217.83 90.16 212.11 88.53 205.91 88.53C199.54 88.53 193.67 90.16 188.28 93.43C183.05 96.53 178.89 100.78 175.79 106.16C172.85 111.55 171.38 117.34 171.38 123.55Z"/>';function nt(a=28,e="Naya ID"){let t=Math.round(a*838/240);return `<svg class="n-logo" viewBox="${Gt}" width="${t}" height="${a}" role="img" aria-label="${e}" focusable="false">${Kt}</svg>`}function ie(a=28){return `<span class="n-brand">${nt(a)}</span>`}function at(a,e){return `<div class="n-dots" aria-hidden="true">${a.map((n,r)=>`<div class="n-step"><span class="n-dot${r<=e?" on":""}"></span><span class="n-dotlbl">${i(n)}</span></div>`).join("")}</div>`}function E(a,e={}){return `<button type="button" class="n-btn n-btn-primary" data-act="${e.act??"primary"}"${e.disabled?" disabled":""}${e.autofocus?" data-autofocus":""}>${e.icon?h(e.icon,18):""}<span>${i(a)}</span></button>`}function M(a,e="secondary",t){return `<button type="button" class="n-btn n-btn-secondary" data-act="${e}">${t?h(t,18):""}<span>${i(a)}</span></button>`}function W(a,e,t){return `<button type="button" class="n-btn n-btn-ghost" data-act="${e}">${t?h(t,16):""}<span>${i(a)}</span></button>`}function _(a,e,t){return `<div class="n-alert n-alert-${a}" role="${a==="error"?"alert":"status"}">${h((a==="error"?"alert":a==="success"?"check":a==="warning"?"alert":"info"),18)}<div>${e}</div></div>`}function rt(a){return `<div class="n-field" data-field="${a.id}"><label for="n-f-${a.id}">${i(a.label)}${a.required?' <span class="req" aria-hidden="true">*</span>':""}</label><input id="n-f-${a.id}" name="${a.id}" type="${a.type??"text"}" value="${i(a.value??"")}"${a.placeholder?` placeholder="${i(a.placeholder)}"`:""}${a.autocomplete?` autocomplete="${a.autocomplete}"`:' autocomplete="off"'}${a.inputmode?` inputmode="${a.inputmode}"`:""}${a.maxlength?` maxlength="${a.maxlength}"`:""}${a.required?' required aria-required="true"':""} aria-describedby="n-f-${a.id}-msg"><p class="n-field-msg" id="n-f-${a.id}-msg">${a.help?i(a.help):""}</p></div>`}function x(a){let e=a.canClose!==false,t=document.createElement("div");t.className="n-shell"+(a.dark?" n-dark":"");let n=a.clientLogoUrl?`<img class="n-client-logo" src="${i(a.clientLogoUrl)}" alt="">`:"";t.innerHTML='<header class="n-bar">'+(a.canBack?`<button type="button" class="n-round" data-nav="back" aria-label="${i(a.backLabel)}">${h("back",20)}</button>`:'<span class="n-spacer"></span>')+(e?`<button type="button" class="n-round" data-nav="close" aria-label="${i(a.closeLabel)}">${h("close",20)}</button>`:'<span class="n-spacer"></span>')+`</header><main class="n-content ${a.screenClass}"></main><footer class="n-powered">${n}<span>${i(a.poweredBy)}</span></footer>`,t.querySelector('[data-nav="back"]')?.addEventListener("click",()=>a.onBack?.()),t.querySelector('[data-nav="close"]')?.addEventListener("click",()=>a.onClose?.());let r=t.querySelector(".n-content");return {root:t,content:r}}function st(a){return a==="document"?'<div class="n-illu n-illu-doc" aria-hidden="true"><div class="tbl"></div><div class="card"><span class="ph"></span><span class="ln a"></span><span class="ln b"></span><span class="ln c"></span></div><div class="glow"></div></div>':'<div class="n-illu n-illu-face" aria-hidden="true"><div class="oval"><div class="head"><span class="eye l"></span><span class="eye r"></span><span class="mouth"></span></div></div><div class="light"></div></div>'}var le=class{constructor(e){this.flow=e;this.busy=false;let t=e.strings,n=e.config,{root:r,content:s}=x({poweredBy:t.t("poweredBy"),backLabel:t.t("back"),closeLabel:t.t("close"),screenClass:"n-welcome",onClose:()=>e.cancel()});this.el=r;let o=[t.t("stepDocument"),t.t("stepSelfie"),t.t("stepResult")],l=n.clientLogoUrl?`<span class="sep"></span><img class="clientLogo" src="${i(n.clientLogoUrl)}" alt="">`:"";s.innerHTML=`
|
|
196
313
|
<div class="pad">
|
|
197
|
-
<div class="brandRow">${
|
|
314
|
+
<div class="brandRow">${ie()}${l}</div>
|
|
315
|
+
<div class="spacer"></div>
|
|
316
|
+
<div class="hero">${h("shield",56,1.6)}</div>
|
|
317
|
+
<h1 class="title">${i(t.t("welcomeTitle"))}</h1>
|
|
318
|
+
<p class="body">${se(t.t("welcomeSubtitle"))}</p>
|
|
319
|
+
<div class="steps">${at(o,0)}</div>
|
|
320
|
+
<div class="spacer"></div>
|
|
321
|
+
<div class="cta">
|
|
322
|
+
${E(t.t("welcomeCta"),{act:"start",autofocus:true})}
|
|
323
|
+
${e.handoffAvailable?M(t.t("welcomeOnMobile"),"handoff","phone"):""}
|
|
324
|
+
</div>
|
|
325
|
+
<div class="secure">${h("lock",13,2)}<span>${i(t.t("welcomeSecurity"))}</span></div>
|
|
326
|
+
</div>`,s.querySelector('[data-act="start"]')?.addEventListener("click",()=>{this.start(false);}),s.querySelector('[data-act="handoff"]')?.addEventListener("click",()=>{this.start(true);});}dispose(){}async start(e){if(this.busy)return;this.busy=true;let t=this.flow;t.haptic("tap");try{if(t.resumed)try{await t.prepare();}catch{return}t.pendingHandoff=e,t.go(t.nextAfterWelcome());}finally{this.busy=false;}}};var ce=class{constructor(e){this.flow=e;let t=e.strings,n=e.support,{root:r,content:s}=x({poweredBy:t.t("poweredBy"),backLabel:t.t("back"),closeLabel:t.t("close"),screenClass:"n-unsupported",onClose:()=>e.cancel(),clientLogoUrl:e.config.clientLogoUrl});this.el=r;let o=n.code==="in_app_browser"?t.t("unsupportedTitle"):t.t("unsupportedBrowserTitle"),l=n.code==="in_app_browser"?t.t("unsupportedInApp",{name:n.inAppBrowserName??"app"}):n.code==="insecure_context"?t.t("unsupportedInsecure"):t.t("unsupportedBrowser"),d=typeof location<"u"?location.href:"";s.innerHTML=`
|
|
327
|
+
<div class="pad center">
|
|
198
328
|
<div class="spacer"></div>
|
|
199
|
-
<div class="hero">${
|
|
200
|
-
<h1 class="title">${i(
|
|
201
|
-
<p class="body">${i(
|
|
202
|
-
|
|
329
|
+
<div class="hero">${h("external",44,1.8)}</div>
|
|
330
|
+
<h1 class="title">${i(o)}</h1>
|
|
331
|
+
<p class="body">${i(l)}</p>
|
|
332
|
+
${d?`<div class="link">${h("external",16)}<code>${i(d)}</code></div>`:""}
|
|
203
333
|
<div class="spacer"></div>
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
334
|
+
<div class="cta">
|
|
335
|
+
${d?E(t.t("copyLink"),{icon:"copy",act:"copy",autofocus:true}):""}
|
|
336
|
+
${M(t.t("backToApp"),"done")}
|
|
337
|
+
</div>
|
|
338
|
+
</div>`,s.querySelector('[data-act="copy"]')?.addEventListener("click",async c=>{let u=await oe(d),p=c.currentTarget;u&&(p.querySelector("span").textContent=t.t("copied"));}),s.querySelector('[data-act="done"]')?.addEventListener("click",()=>{e.fail(new Error(l),n.code??"unsupported_browser");}),e.telemetry.track("unsupported",{code:n.code??null,reason:n.reason??null});}dispose(){}};var de=class{constructor(e){this.flow=e;let t=e.strings,n=e.config.consent===false?null:e.config.consent,{root:r,content:s}=x({poweredBy:t.t("poweredBy"),backLabel:t.t("back"),closeLabel:t.t("close"),screenClass:"n-consent",canBack:e.canGoBack,onBack:()=>e.back(),onClose:()=>e.cancel()});this.el=r;let o=[t.t("welcomeSecurity"),t.t("livenessPrivacy")].map(p=>`<li>${h("check",16,2.5)}<span>${i(p)}</span></li>`).join(""),l=n?.policyUrl?`<a class="policy" href="${i(n.policyUrl)}" target="_blank" rel="noopener noreferrer">${i(t.t("consentPolicy"))} ${h("external",12)}</a>`:"";s.innerHTML=`
|
|
339
|
+
<div class="pad">
|
|
340
|
+
<h1 class="title">${i(t.t("consentTitle"))}</h1>
|
|
341
|
+
<p class="body">${i(t.t("consentBody",{org:t.t("consentOrg")}))}</p>
|
|
342
|
+
<ul class="bullets">${o}</ul>
|
|
343
|
+
${l}
|
|
344
|
+
<div class="spacer"></div>
|
|
345
|
+
<label class="check" data-check>
|
|
346
|
+
<input type="checkbox" data-consent aria-describedby="n-consent-note">
|
|
347
|
+
<span id="n-consent-note">${i(t.t("consentCheckbox"))}</span>
|
|
348
|
+
</label>
|
|
349
|
+
${E(t.t("consentCta"),{act:"accept",disabled:true})}
|
|
350
|
+
</div>`;let d=s.querySelector("[data-consent]"),c=s.querySelector("[data-check]"),u=s.querySelector('[data-act="accept"]');d.addEventListener("change",()=>{c.classList.toggle("on",d.checked),u.disabled=!d.checked;}),u.addEventListener("click",()=>{d.checked&&(e.haptic("tap"),e.grantConsent(),e.go(e.nextAfterConsent()));});}dispose(){}};var Qt=3e3,ue=class{constructor(e){this.flow=e;this.timer=null;this.disposed=false;this.url="";let t=e.strings,{root:n,content:r}=x({poweredBy:t.t("poweredBy"),backLabel:t.t("back"),closeLabel:t.t("close"),screenClass:"n-handoff",canBack:e.canGoBack,onBack:()=>{e.pendingHandoff=false,e.back();},onClose:()=>e.cancel()});this.el=n,this.content=r,r.innerHTML=`
|
|
351
|
+
<div class="pad">
|
|
352
|
+
<h1 class="title">${i(t.t("handoffTitle"))}</h1>
|
|
353
|
+
<p class="body">${i(t.t("handoffBody"))}</p>
|
|
354
|
+
<div class="qr loading" data-qr role="img" aria-label="${i(t.t("handoffQrLabel"))}"><span class="loader"></span></div>
|
|
355
|
+
<div class="wait" data-wait aria-live="polite"><span class="loader sm"></span><span>${i(t.t("handoffWaiting"))}</span></div>
|
|
356
|
+
<div data-msg></div>
|
|
357
|
+
<div class="spacer"></div>
|
|
358
|
+
<div class="cta">
|
|
359
|
+
${W(t.t("copyLink"),"copy","copy")}
|
|
360
|
+
${W(t.t("handoffOrHere"),"here","camera")}
|
|
361
|
+
</div>
|
|
362
|
+
</div>`,r.querySelector('[data-act="here"]')?.addEventListener("click",()=>{e.pendingHandoff=false,e.replace(e.nextAfterSelect());}),r.querySelector('[data-act="copy"]')?.addEventListener("click",async s=>{if(!this.url)return;await oe(this.url)&&(s.currentTarget.querySelector("span").textContent=t.t("copied"));}),this.load();}dispose(){this.disposed=true,this.timer&&clearTimeout(this.timer);}async load(){let e=this.flow;try{let t=await e.requestHandoff();if(this.disposed)return;this.url=t.url;let n=this.content.querySelector("[data-qr]");n.classList.remove("loading"),n.innerHTML=t.qrSvg,this.poll();}catch(t){if(this.disposed)return;let n=e.normalizeError(t);this.content.querySelector("[data-msg]").innerHTML=_("error",i(n.message)),this.content.querySelector("[data-wait]").hidden=true;}}poll(){this.disposed||(this.timer=setTimeout(async()=>{let e=this.flow,t=e.session?.verificationId;if(t){try{let n=await e.client.getVerification(t);if(this.disposed)return;let r=this.content.querySelector("[data-wait] span:last-child");if((n.hasDocument||n.hasSelfie||n.status==="processing")&&(r.textContent=e.strings.t("handoffProgress")),n.status==="approved"||n.status==="review"||n.status==="rejected"){e.submitResponse={status:n.status,decision:n.decision??void 0,reasonCodes:n.reasonCodes},e.telemetry.track("handoff_completed",{status:n.status}),e.replace("result");return}if(e.handoffInfo&&Date.parse(e.handoffInfo.expiresAt)<Date.now()){this.content.querySelector("[data-msg]").innerHTML=_("warning",i(e.strings.t("handoffExpired")));return}}catch(n){let r=e.normalizeError(n);if(r.code==="session_expired"||r.code==="unauthorized"){this.content.querySelector("[data-msg]").innerHTML=_("warning",i(e.strings.t("handoffExpired")));return}}this.poll();}},Qt));}};function Xt(a){switch(a){case "cni":return "id-card";case "passeport":return "passport";case "permis":return "car"}}var pe=class{constructor(e){this.flow=e;let t=e.strings,n=e.config,r=!!n.country;this.country=e.country??n.country??n.countries[0],this.document=e.document??(n.documentTypes.length===1?n.documentTypes[0]:null);let{root:s,content:o}=x({poweredBy:t.t("poweredBy"),backLabel:t.t("back"),closeLabel:t.t("close"),screenClass:"n-select",canBack:e.canGoBack,onBack:()=>e.back(),onClose:()=>e.cancel()});this.el=s,this.content=o;let l=r?"":`<div class="chips" role="listbox" aria-label="${i(t.t("countryLabel"))}">${n.countries.map(c=>`<button type="button" class="chip${c===this.country?" on":""}" role="option" data-country="${c}" aria-selected="${c===this.country}">${i(xe(c))}</button>`).join("")}</div>`,d=n.documentTypes.map(c=>`<button type="button" class="card${c===this.document?" on":""}" data-doc="${c}" aria-pressed="${c===this.document}"><span class="ico">${h(Xt(c),20)}</span><span class="lbl">${i(t.docLabel(c))}</span>${h("chevron",20,2)}</button>`).join("");o.innerHTML=`
|
|
207
363
|
<div class="pad">
|
|
208
|
-
<h1 class="title">${
|
|
209
|
-
<p class="body">${i(t.docSelectSubtitle)}</p>
|
|
210
|
-
${
|
|
364
|
+
<h1 class="title">${se(t.t("docSelectTitle"))}</h1>
|
|
365
|
+
<p class="body">${i(t.t("docSelectSubtitle"))}</p>
|
|
366
|
+
${l}
|
|
211
367
|
<div class="cards">${d}</div>
|
|
212
368
|
<div class="spacer"></div>
|
|
213
|
-
${
|
|
214
|
-
</div>`,o.querySelectorAll("[data-country]").forEach(
|
|
369
|
+
${E(t.t("continue"),{disabled:!this.document,act:"next"})}
|
|
370
|
+
</div>`,o.querySelectorAll("[data-country]").forEach(c=>c.addEventListener("click",()=>this.selectCountry(c))),o.querySelectorAll("[data-doc]").forEach(c=>c.addEventListener("click",()=>this.selectDoc(c))),o.querySelector('[data-act="next"]')?.addEventListener("click",()=>this.next());}dispose(){}selectCountry(e){this.country=e.getAttribute("data-country"),this.content.querySelectorAll(".chip").forEach(t=>{let n=t===e;t.classList.toggle("on",n),t.setAttribute("aria-selected",String(n));});}selectDoc(e){this.document=e.getAttribute("data-doc"),this.content.querySelectorAll(".card").forEach(n=>{let r=n===e;n.classList.toggle("on",r),n.setAttribute("aria-pressed",String(r));});let t=this.content.querySelector('[data-act="next"]');t&&(t.disabled=false),this.flow.haptic("tap");}next(){this.document&&(this.flow.country=this.country,this.flow.document=this.document,this.flow.go(this.flow.nextAfterSelect()));}};var G=class{constructor(e,t){this.flow=e;this.kind=t;let n=e.strings,{root:r,content:s}=x({poweredBy:n.t("poweredBy"),backLabel:n.t("back"),closeLabel:n.t("close"),screenClass:"n-tips",canBack:e.canGoBack,onBack:()=>e.back(),onClose:()=>e.cancel()});this.el=r;let o=t==="document"?n.t("tipsDocTitle"):n.t("tipsSelfieTitle"),l=t==="document"?[n.t("tipsDoc1"),n.t("tipsDoc2"),n.t("tipsDoc3")]:[n.t("tipsSelfie1"),n.t("tipsSelfie2"),n.t("tipsSelfie3")];s.innerHTML=`
|
|
371
|
+
<div class="pad">
|
|
372
|
+
${st(t)}
|
|
373
|
+
<h1 class="title">${i(o)}</h1>
|
|
374
|
+
<ol class="list">${l.map((d,c)=>`<li><span class="num">${c+1}</span><span>${i(d)}</span></li>`).join("")}</ol>
|
|
375
|
+
<div class="spacer"></div>
|
|
376
|
+
${E(n.t("understood"),{act:"ok",autofocus:true})}
|
|
377
|
+
</div>`,t==="document"&&e.preloadLiveness(),s.querySelector('[data-act="ok"]')?.addEventListener("click",()=>{e.tipsShown[t]=true,e.haptic("tap"),e.replace(t==="document"?"capture-recto":"liveness");});}dispose(){}};var Ne={x:.08,y:.22,w:.84,h:.56};function Jt(a,e,t,n){let r=e*t,s=new Float32Array(r),o=0,l=0;for(let S=0,f=0;S<a.length;S+=4,f++){let T=a[S],N=a[S+1],k=a[S+2],b=.299*T+.587*N+.114*k;s[f]=b,o+=b,T>250&&N>250&&k>250&&l++;}let d=r?o/r:0,c=r?l/r:0,u=0,p=0,m=0;for(let S=1;S<t-1;S++)for(let f=1;f<e-1;f++){let T=S*e+f,N=4*s[T]-s[T-1]-s[T+1]-s[T-e]-s[T+e];u+=N,p+=N*N,m++;}let y=m?u/m:0,v=m?p/m-y*y:0,C=0;if(n&&n.length===r){let S=0;for(let f=0;f<r;f++)S+=Math.abs(s[f]-n[f]);C=S/r;}let g=d>=60&&d<=235,w=v>=60,D=c<=.035,A=!n||C<=14,O=d<60?"dark":d>235?"bright":D?A?w?null:"blur":"motion":"glare";return {luminance:d,sharpness:v,glare:c,motion:C,lightOk:g,sharpOk:w,glareOk:D,steady:A,ok:O===null,issue:O,luma:s}}function ot(a,e,t={previous:null},n=Ne,r=240){let s=a.videoWidth,o=a.videoHeight,l={luminance:0,sharpness:0,glare:0,motion:0,lightOk:false,sharpOk:false,glareOk:true,steady:true,ok:false,issue:"dark"};if(s<8||o<8)return l;let d=Math.floor(s*n.x),c=Math.floor(o*n.y),u=Math.floor(s*n.w),p=Math.floor(o*n.h),m=Math.min(1,r/u),y=Math.max(8,Math.round(u*m)),v=Math.max(8,Math.round(p*m));e.width=y,e.height=v;let C=e.getContext("2d",{willReadFrequently:true});if(!C)return l;C.drawImage(a,d,c,u,p,0,0,y,v);let{data:g}=C.getImageData(0,0,y,v),w=Jt(g,y,v,t.previous);t.previous=w.luma;let{luma:D,...A}=w;return A}function F(a,e=1600,t=.85,n){let r=a instanceof HTMLVideoElement?a.videoWidth:a instanceof HTMLImageElement?a.naturalWidth:a.width,s=a instanceof HTMLVideoElement?a.videoHeight:a instanceof HTMLImageElement?a.naturalHeight:a.height,o=n?Math.floor(r*n.x):0,l=n?Math.floor(s*n.y):0,d=n?Math.floor(r*n.w):r,c=n?Math.floor(s*n.h):s,u=Math.min(1,e/Math.max(d,c)),p=Math.max(1,Math.round(d*u)),m=Math.max(1,Math.round(c*u)),y=document.createElement("canvas");y.width=p,y.height=m;let v=y.getContext("2d");return v?(v.drawImage(a,o,l,d,c,0,0,p,m),y.toDataURL("image/jpeg",t)):""}async function it(a,e=1600,t=.85){if(!a.type.startsWith("image/"))throw new Error("not-an-image");if(typeof createImageBitmap=="function")try{let r=await createImageBitmap(a,{imageOrientation:"from-image"}),s=F(r,e,t);if(r.close(),s)return s}catch{}let n=URL.createObjectURL(a);try{let r=await new Promise((s,o)=>{let l=new Image;l.onload=()=>s(l),l.onerror=()=>o(new Error("not-an-image")),l.src=n;});return F(r,e,t)}finally{URL.revokeObjectURL(n);}}var Le=1.586,Zt=300,en=3,tn=450;function lt(a,e,t=Le,n=0){if(a<=0||e<=0)return Ne;let r=a/e,s=0,o=0,l=1,d=1;return r>t?(l=t/r,s=(1-l)/2):(d=r/t,o=(1-d)/2),{x:s+l*n,y:o+d*n,w:l*(1-2*n),h:d*(1-2*n)}}var K=class{constructor(e,t){this.flow=e;this.side=t;this.scratch=document.createElement("canvas");this.qualityState={previous:null};this.video=null;this.stream=null;this.facing="environment";this.torchOn=false;this.qualityTimer=null;this.countdownTimer=null;this.stableCount=0;this.lastQuality=null;this.streaming=false;this.capturing=false;this.disposed=false;this.hidden=false;let n=e.strings,{root:r,content:s}=x({poweredBy:n.t("poweredBy"),backLabel:n.t("back"),closeLabel:n.t("close"),screenClass:"n-capture",dark:true,canBack:e.canGoBack,onBack:()=>e.back(),onClose:()=>e.cancel()});this.el=r,this.content=s;let o=t==="recto"?n.t("captureRectoInstruction"):n.t("captureVersoInstruction"),l=e.config.capture.autoCapture;s.innerHTML=`
|
|
215
378
|
<div class="pad">
|
|
216
|
-
<p class="instruction">${i(o)}</p>
|
|
379
|
+
<p class="instruction" id="n-cap-instr">${i(o)}</p>
|
|
217
380
|
<div class="cardWrap">
|
|
218
381
|
<div class="card" data-card>
|
|
219
|
-
<video class="preview" playsinline muted autoplay></video>
|
|
382
|
+
<video class="preview" playsinline muted autoplay aria-describedby="n-cap-instr"></video>
|
|
220
383
|
<div class="camMsg" data-loading><span class="loader"></span></div>
|
|
221
384
|
<svg class="corners" viewBox="0 0 100 63" preserveAspectRatio="none" aria-hidden="true">
|
|
222
385
|
<path d="M2,14 L2,6 Q2,2 6,2 L16,2"/>
|
|
@@ -224,57 +387,109 @@ the photo is only sent once the challenge is done`)}get processingDocument(){ret
|
|
|
224
387
|
<path d="M98,49 L98,57 Q98,61 94,61 L84,61"/>
|
|
225
388
|
<path d="M16,61 L6,61 Q2,61 2,57 L2,49"/>
|
|
226
389
|
</svg>
|
|
390
|
+
<div class="countdown" data-countdown hidden></div>
|
|
227
391
|
</div>
|
|
228
392
|
</div>
|
|
393
|
+
<div class="banner" data-banner role="status" aria-live="polite">${i(l?n.t("captureHint"):n.t("captureManualHint"))}</div>
|
|
229
394
|
<div class="pills">
|
|
230
|
-
<span class="pill" data-pill="light"><span class="pico" data-ico>${
|
|
231
|
-
<span class="pill" data-pill="sharp"><span class="pico" data-ico>${
|
|
395
|
+
<span class="pill" data-pill="light"><span class="pico" data-ico>${h("sun",15,2.4)}</span><span>${i(n.t("qualityLight"))}</span></span>
|
|
396
|
+
<span class="pill" data-pill="sharp"><span class="pico" data-ico>${h("focus",15,2.4)}</span><span>${i(n.t("qualitySharpness"))}</span></span>
|
|
397
|
+
</div>
|
|
398
|
+
<div class="tools">
|
|
399
|
+
<button type="button" class="tool" data-act="import" hidden>${h("upload",22)}<span>${i(n.t("importPhoto"))}</span></button>
|
|
400
|
+
<button type="button" class="tool" data-act="flip" hidden>${h("flip",22)}<span>${i(n.t("switchCamera"))}</span></button>
|
|
401
|
+
<button type="button" class="tool" data-act="torch" hidden aria-pressed="false">${h("flash",22)}<span>${i(n.t("torch"))}</span></button>
|
|
232
402
|
</div>
|
|
233
|
-
<button type="button" class="shutter" data-act="capture" disabled aria-label="${i(n.
|
|
234
|
-
<p class="hint">${i(n.captureHint)}</p>
|
|
235
|
-
|
|
403
|
+
<button type="button" class="shutter" data-act="capture" disabled aria-label="${i(n.t("shutterLabel"))}"></button>
|
|
404
|
+
<p class="hint">${i(l?n.t("captureHint"):n.t("captureManualHint"))}</p>
|
|
405
|
+
<input type="file" accept="image/*" data-file hidden aria-hidden="true">
|
|
406
|
+
</div>`,this.video=s.querySelector(".preview"),this.cardEl=s.querySelector("[data-card]"),this.shutterEl=s.querySelector('[data-act="capture"]'),this.hintEl=s.querySelector(".hint"),this.bannerEl=s.querySelector("[data-banner]"),this.countdownEl=s.querySelector("[data-countdown]"),this.loadingEl=s.querySelector("[data-loading]"),this.lightPill=s.querySelector('[data-pill="light"]'),this.sharpPill=s.querySelector('[data-pill="sharp"]'),this.fileInput=s.querySelector("[data-file]"),this.shutterEl.addEventListener("click",()=>{this.capture();}),s.querySelector('[data-act="import"]').addEventListener("click",()=>this.fileInput.click()),s.querySelector('[data-act="flip"]').addEventListener("click",()=>{this.flipCamera();}),s.querySelector('[data-act="torch"]').addEventListener("click",()=>{this.toggleTorch();}),this.fileInput.addEventListener("change",()=>{this.importFile();}),e.wantsFileUpload&&this.showTool("import"),e.preloadLiveness(),this.startCamera();}dispose(){this.disposed=true,this.stopCamera();}onVisibility(e){this.hidden=!e,e||this.cancelCountdown();}showTool(e,t=true){let n=this.content.querySelector(`[data-act="${e}"]`);n&&(n.hidden=!t);}async startCamera(){if(!navigator.mediaDevices?.getUserMedia){this.showCameraError(new DOMException("no-mediadevices","NotFoundError"));return}try{let e=await navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:this.facing},width:{ideal:1920}},audio:!1});if(this.disposed||!this.video){e.getTracks().forEach(t=>t.stop());return}this.stream=e,this.video.srcObject=e,await this.video.play().catch(()=>{}),this.loadingEl.hidden=!0,this.streaming=!0,this.updateReady(),this.startQualityLoop(),this.detectTools(e);}catch(e){this.showCameraError(e);}}async detectTools(e){(e.getVideoTracks()[0]?.getCapabilities?.()??{}).torch&&this.showTool("torch");let r=await Ve();if(!this.disposed){r===false&&this.showTool("import");try{(await navigator.mediaDevices.enumerateDevices()).filter(o=>o.kind==="videoinput").length>1&&this.showTool("flip");}catch{}}}async flipCamera(){this.facing=this.facing==="environment"?"user":"environment",this.torchOn=false,this.stopCamera(),this.loadingEl.hidden=false,this.loadingEl.innerHTML='<span class="loader"></span>',this.video&&(this.video.hidden=false),await this.startCamera();}async toggleTorch(){let e=this.stream?.getVideoTracks()[0];if(e){this.torchOn=!this.torchOn;try{await e.applyConstraints({advanced:[{torch:this.torchOn}]});let t=this.content.querySelector('[data-act="torch"]');t.classList.toggle("on",this.torchOn),t.setAttribute("aria-pressed",String(this.torchOn));}catch{this.torchOn=false;}}}showCameraError(e){if(this.disposed)return;let t=this.flow.normalizeError(e,"camera_unavailable");this.flow.telemetry.track("camera_error",{code:t.code,side:this.side}),this.video&&(this.video.hidden=true),this.loadingEl.hidden=false,this.loadingEl.innerHTML=`<span>${i(t.message)}</span><button type="button" class="n-btn n-btn-secondary" data-act="retry-cam" style="width:auto;min-height:40px">${i(this.flow.strings.t("retry"))}</button>`,this.loadingEl.querySelector('[data-act="retry-cam"]')?.addEventListener("click",()=>{this.loadingEl.innerHTML='<span class="loader"></span>',this.video&&(this.video.hidden=false),this.startCamera();}),this.showTool("import");}stopCamera(){this.qualityTimer&&clearInterval(this.qualityTimer),this.qualityTimer=null,this.cancelCountdown(),this.stream?.getTracks().forEach(e=>e.stop()),this.stream=null,this.streaming=false;}startQualityLoop(){this.qualityTimer=setInterval(()=>{if(this.capturing||this.hidden||!this.video||this.video.videoWidth<8)return;let e=lt(this.video.videoWidth,this.video.videoHeight,Le,.06),t=ot(this.video,this.scratch,this.qualityState,e);this.lastQuality=t,this.render(t),this.flow.config.capture.autoCapture&&this.autoCapture(t);},Zt);}render(e){let t=this.flow.strings;this.lightPill.classList.toggle("ok",e.lightOk&&e.glareOk),this.lightPill.querySelector("[data-ico]").innerHTML=h(e.lightOk&&e.glareOk?"check":"sun",15,2.4),this.sharpPill.classList.toggle("ok",e.sharpOk&&e.steady),this.sharpPill.querySelector("[data-ico]").innerHTML=h(e.sharpOk&&e.steady?"check":"focus",15,2.4);let n=e.issue==="dark"?t.t("guideTooDark"):e.issue==="bright"?t.t("guideTooBright"):e.issue==="glare"?t.t("guideGlare"):e.issue==="motion"?t.t("guideHoldSteady"):e.issue==="blur"?t.t("guideBlurry"):t.t("guideGood");this.bannerEl.textContent!==n&&(this.bannerEl.textContent=n),this.bannerEl.classList.toggle("good",e.ok),this.cardEl.classList.toggle("ready",e.ok),this.shutterEl.classList.toggle("ready",e.ok),this.hintEl.classList.toggle("ready",e.ok),this.updateReady();}autoCapture(e){e.ok?(this.stableCount+=1,this.stableCount===en&&!this.countdownTimer&&this.countdown(2)):(this.stableCount=0,this.cancelCountdown());}countdown(e){let t=this.flow.strings;this.countdownEl.hidden=false,this.countdownEl.textContent=String(e),this.bannerEl.textContent=t.t("captureAuto",{n:e}),this.countdownTimer=setTimeout(()=>{if(this.countdownTimer=null,this.disposed||!this.lastQuality?.ok){this.cancelCountdown();return}e>1?this.countdown(e-1):this.capture();},tn);}cancelCountdown(){this.countdownTimer&&clearTimeout(this.countdownTimer),this.countdownTimer=null,this.countdownEl.hidden=true,this.stableCount=0;}updateReady(){this.shutterEl.disabled=!this.streaming||this.capturing;}async capture(){if(!(!this.video||this.capturing||!this.streaming)){this.capturing=true,this.cancelCountdown(),this.shutterEl.innerHTML='<span class="loader sm"></span>',this.updateReady();try{let e=lt(this.video.videoWidth,this.video.videoHeight,Le,.01),t=F(this.video,this.flow.imageMaxDimension,.85,e);this.flow.telemetry.track("capture_quality",{side:this.side,source:"camera",auto:this.flow.config.capture.autoCapture,luminance:Math.round(this.lastQuality?.luminance??0),sharpness:Math.round(this.lastQuality?.sharpness??0),glare:Number((this.lastQuality?.glare??0).toFixed(3)),facing:this.facing,delegate:null}),this.stopCamera(),this.accept(t);}catch(e){this.flow.log.warn("capture failed",e),this.capturing=false,this.shutterEl.innerHTML="",this.updateReady();}}}async importFile(){let e=this.fileInput.files?.[0];if(this.fileInput.value="",!(!e||this.capturing)){this.capturing=true;try{let t=await it(e,this.flow.imageMaxDimension);this.flow.telemetry.track("capture_quality",{side:this.side,source:"file",sizeKb:Math.round(e.size/1024)}),this.stopCamera(),this.accept(t);}catch{this.capturing=false,this.bannerEl.textContent=this.flow.strings.t("fileInvalid"),this.bannerEl.classList.remove("good");}}}accept(e){let t=this.flow;t.haptic("tap"),t.captureAttempts+=1,this.side==="recto"?t.rectoBase64=e:t.versoBase64=e,t.emit("document_captured",{side:this.side});let n=t.nextAfterCapture(this.side);n!=="capture-verso"&&t.startDocumentUpload(),this.capturing=false,t.go(n);}};var ct="M105,4 A101,131 0 0 1 105,266 A101,131 0 0 1 105,4 Z",nn=66,an=640,rn=2,sn=6e3;function on(a){switch(a){case "blink":return "eye";case "turn-left":return "rotate-left";case "turn-right":return "rotate-right";case "smile":return "smile"}}var he=class{constructor(e){this.flow=e;this.video=null;this.stepEls=[];this.tracker=new $;this.stream=null;this.rafId=0;this.lastDetect=0;this.phase="searching-face";this.guidance=null;this.frames=new Map;this.streaming=false;this.finishing=false;this.disposed=false;this.hidden=false;this.watchdog=null;this.timeouts=0;this.loop=()=>{if(!this.video||this.finishing||this.disposed||this.hidden)return;let e=performance.now();if(e-this.lastDetect>=nn&&this.tracker.ready&&this.video.videoWidth>8){this.lastDetect=e;try{let t=this.tracker.detect(this.video,e),n=this.challenge.onFrame(t);if(n.capture&&this.captureKeyFrame(n.capture),n.completed&&this.onCompleted(n.completed),this.challenge.phase==="hold"&&this.challenge.holdElapsed>sn&&(this.flow.telemetry.track("liveness_hold_timeout",{guidance:n.guidance}),this.challenge.forceDone()),(n.changed||n.guidance!==this.guidance)&&(this.guidance=n.guidance,this.render(this.challenge.phase,n.guidance)),this.challenge.isDone){this.finish("active");return}}catch{}}this.rafId=requestAnimationFrame(this.loop);};let t=e.strings;this.challenge=new j(e.challengeSteps);let{root:n,content:r}=x({poweredBy:t.t("poweredBy"),backLabel:t.t("back"),closeLabel:t.t("close"),screenClass:"n-liveness",onClose:()=>e.cancel()});this.el=n,this.content=r;let s=[t.t("livenessStepFace"),...this.challenge.steps.map(o=>t.challengeInstruction(o))].map((o,l)=>`<div class="cstep"><span class="cdot" data-cdot>${l===0?h("user",13,2.5):""}</span><span class="clbl">${i(o)}</span></div>`).join("");r.innerHTML=`
|
|
236
407
|
<div class="pad">
|
|
237
|
-
<h1 class="title">${i(t.livenessTitle)}</h1>
|
|
238
|
-
<p class="sub">${i(t.livenessSubtitle)}</p>
|
|
239
|
-
<div class="ovalWrap">
|
|
408
|
+
<h1 class="title">${i(t.t("livenessTitle"))}</h1>
|
|
409
|
+
<p class="sub">${i(t.t("livenessSubtitle"))}</p>
|
|
410
|
+
<div class="ovalWrap" data-oval>
|
|
240
411
|
<div class="oval">
|
|
241
412
|
<video class="preview" playsinline muted autoplay></video>
|
|
242
|
-
<div class="camMsg" data-loading><span class="loader"></span></div>
|
|
413
|
+
<div class="camMsg" data-loading><span class="loader"></span><span>${i(t.t("livenessLoading"))}</span></div>
|
|
243
414
|
</div>
|
|
244
|
-
<svg class="ring" viewBox="0 0 210 270" aria-hidden="true">
|
|
245
|
-
<path class="track" d="${
|
|
246
|
-
<path class="prog" data-prog d="${
|
|
415
|
+
<svg class="ring" viewBox="0 0 210 270" aria-hidden="true" data-ring>
|
|
416
|
+
<path class="track" d="${ct}"/>
|
|
417
|
+
<path class="prog" data-prog d="${ct}" pathLength="100" stroke-dasharray="100" stroke-dashoffset="100"/>
|
|
247
418
|
</svg>
|
|
248
419
|
</div>
|
|
249
|
-
<div class="instruction">
|
|
250
|
-
<span data-instr-ico>${
|
|
251
|
-
<span data-instr-text>${i(t.livenessLookStraight)}</span>
|
|
420
|
+
<div class="instruction" data-instr role="status" aria-live="assertive">
|
|
421
|
+
<span data-instr-ico>${h("focus",22,2)}</span>
|
|
422
|
+
<span data-instr-text>${i(t.t("livenessLookStraight"))}</span>
|
|
252
423
|
</div>
|
|
253
|
-
<div class="steps">${
|
|
424
|
+
<div class="steps">${s}</div>
|
|
425
|
+
<div data-panel></div>
|
|
426
|
+
<div class="spacer"></div>
|
|
427
|
+
<p class="privacy">${i(t.t("livenessPrivacy"))}</p>
|
|
428
|
+
</div>`,this.video=r.querySelector(".preview"),this.progEl=r.querySelector("[data-prog]"),this.ringEl=r.querySelector("[data-ring]"),this.instrEl=r.querySelector("[data-instr]"),this.instrIcon=r.querySelector("[data-instr-ico]"),this.instrText=r.querySelector("[data-instr-text]"),this.loadingEl=r.querySelector("[data-loading]"),this.panelEl=r.querySelector("[data-panel]"),this.ovalWrap=r.querySelector("[data-oval]"),this.stepEls=Array.from(r.querySelectorAll("[data-cdot]")),this.start();}dispose(){this.disposed=true,this.teardown();}onVisibility(e){this.hidden=!e,e&&this.streaming&&!this.finishing&&this.loop();}async start(){let e=this.flow.strings;if(!navigator.mediaDevices?.getUserMedia){this.showError(e.t("cameraUnavailable"),"camera_unavailable");return}try{await this.tracker.init(this.flow.config.livenessAssets),this.flow.livenessDelegate=this.tracker.activeDelegate;}catch(t){this.flow.log.error("liveness assets",t),this.flow.telemetry.track("liveness_assets_error"),this.showError(e.t("livenessAssetsError"),"liveness_assets",true);return}if(!this.disposed)try{let t=await navigator.mediaDevices.getUserMedia({video:{facingMode:{ideal:"user"},width:{ideal:1280}},audio:!1});if(this.disposed||!this.video){t.getTracks().forEach(n=>n.stop());return}this.stream=t,this.video.srcObject=t,await this.video.play().catch(()=>{}),this.loadingEl.hidden=!0,this.streaming=!0,this.armWatchdog(),this.loop();}catch(t){let n=this.flow.normalizeError(t,"camera_unavailable");this.flow.telemetry.track("camera_error",{code:n.code,side:"selfie"}),this.showError(n.message,n.code,true);}}captureKeyFrame(e){if(!(!this.video||this.frames.has(e)))try{this.frames.set(e,F(this.video,an,.75));}catch{}}onCompleted(e){let t=this.flow.strings;this.flow.haptic("success");let n=this.challenge.proof;this.flow.telemetry.track("liveness_step",{step:e,at:n[n.length-1]?.at??0}),this.flow.emit("liveness_step",{step:e});let r=document.createElement("div");r.className="toast",r.innerHTML=`${h("check",12,3)}<span>${i(t.t("livenessDetected"))}</span>`,this.ovalWrap.appendChild(r),setTimeout(()=>r.remove(),900),this.armWatchdog();}render(e,t){this.phase=e;let n=this.flow.strings;this.progEl.setAttribute("stroke-dashoffset",String(100*(1-this.challenge.progress))),this.ringEl.classList.toggle("done",this.challenge.isDone);let r="focus",s=n.t("livenessLookStraight"),o="";t&&e!=="done"?(o="guide",s=t==="multiple-faces"?n.t("livenessOneFace"):t==="too-small"?n.t("livenessCloser"):t==="too-large"?n.t("livenessFarther"):t==="off-center"?n.t("livenessCenter"):t==="tilted"?n.t("livenessStraighten"):t==="eyes-closed"?n.t("livenessEyesOpen"):n.t("livenessLookStraight"),r=t==="multiple-faces"?"user":t==="eyes-closed"?"eye":"focus"):e==="done"||e==="hold"?(o="ok",r="hourglass",s=n.t("livenessHold")):e!=="searching-face"&&(r=on(e),s=n.challengeInstruction(e)),this.instrIcon.innerHTML=h(r,22,2),this.instrText.textContent!==s&&(this.instrText.textContent=s),this.instrEl.className=`instruction ${o}`.trim();let l=e==="done"||e==="hold"?this.stepEls.length:e==="searching-face"?0:1+this.challenge.completedCount;this.stepEls.forEach((d,c)=>{let u=c<l,p=c===l&&e!=="done"&&e!=="hold";d.classList.toggle("done",u),d.classList.toggle("active",p),c>0&&(d.innerHTML=u?h("check",13,3):"");});}armWatchdog(){this.watchdog&&clearTimeout(this.watchdog),this.watchdog=setTimeout(()=>this.onTimeout(),this.flow.config.liveness.timeoutMs);}onTimeout(){if(this.disposed||this.finishing||this.challenge.isDone)return;this.timeouts+=1,this.flow.telemetry.track("liveness_timeout",{count:this.timeouts,phase:this.phase,completed:this.challenge.completedCount}),cancelAnimationFrame(this.rafId);let e=this.flow.strings,t=this.flow.config.liveness.allowPassive&&this.timeouts>=Math.min(rn,2);this.panelEl.innerHTML=`
|
|
429
|
+
<div class="n-alert n-alert-warning" role="alert"><div><strong>${i(e.t("livenessTimeoutTitle"))}</strong><br>${i(e.t("livenessTimeoutBody"))}</div></div>
|
|
430
|
+
<div class="cta" style="margin-top:10px">
|
|
431
|
+
${E(e.t("retry"),{act:"retry",icon:"refresh"})}
|
|
432
|
+
${t?W(e.t("livenessPassiveCta"),"passive","hand"):""}
|
|
433
|
+
</div>
|
|
434
|
+
${t?`<p class="privacy" style="margin-top:6px">${i(e.t("livenessPassiveNote"))}</p>`:""}`,this.panelEl.querySelector('[data-act="retry"]')?.addEventListener("click",()=>this.restart()),this.panelEl.querySelector('[data-act="passive"]')?.addEventListener("click",()=>{this.finish("passive");});}restart(){this.panelEl.innerHTML="",this.challenge=new j(this.flow.challengeSteps),this.frames.clear(),this.guidance=null,this.render("searching-face",null),this.armWatchdog(),this.loop();}async finish(e){if(!this.finishing){this.finishing=true,cancelAnimationFrame(this.rafId),this.watchdog&&clearTimeout(this.watchdog),this.panelEl.innerHTML="",e==="active"&&this.render("done",null),this.tracker.close();try{if(await this.waitFrames(3),await new Promise(n=>setTimeout(n,300)),this.disposed)return;let t=this.flow;if(this.video&&this.video.videoWidth>8){t.selfieBase64=F(this.video,1080,.85),t.livenessMode=e,t.livenessScore=e==="active"?this.challenge.score():0,t.livenessProof=e==="active"?this.challenge.proof:[];let n=["neutral","eyes-closed","turned","smile"];t.livenessFrames=e==="active"?n.map(r=>this.frames.get(r)).filter(r=>!!r):[];}this.stopStream(),t.telemetry.track("liveness_done",{mode:e,delegate:t.livenessDelegate,steps:this.challenge.completedCount,timeouts:this.timeouts,settled:e==="active"?this.challenge.settled:null}),t.emit("liveness_done",{mode:e}),t.haptic("success"),t.replace(t.nextAfterLiveness());}catch{this.finishing=false,this.stopStream(),this.showError(this.flow.strings.t("cameraGeneric"),"camera_busy",true);}}}waitFrames(e){return new Promise(t=>{let n=0,r=()=>{++n>=e?t():requestAnimationFrame(r);};requestAnimationFrame(r);})}showError(e,t,n=false){this.disposed||(this.video&&(this.video.hidden=true),this.loadingEl.hidden=false,this.loadingEl.innerHTML=`<span>${i(e)}</span>${n?`<button type="button" class="n-btn n-btn-secondary" data-act="retry-cam" style="width:auto;min-height:40px;color:#fff;border-color:#fff">${i(this.flow.strings.t("retry"))}</button>`:""}`,this.loadingEl.querySelector('[data-act="retry-cam"]')?.addEventListener("click",()=>{this.loadingEl.innerHTML='<span class="loader"></span>',this.video&&(this.video.hidden=false),this.teardown(),this.finishing=false,this.start();}),this.flow.log.warn("liveness error",{code:t,msg:e}));}stopStream(){this.stream?.getTracks().forEach(e=>e.stop()),this.stream=null,this.streaming=false;}teardown(){cancelAnimationFrame(this.rafId),this.watchdog&&clearTimeout(this.watchdog),this.tracker.close(),this.stopStream();}};var ln=/^(\d{4})-(\d{2})-(\d{2})$/;function me(a){if(!a)return null;let e=a.trim().match(ln);if(!e)return null;let t=Number(e[1]),n=Number(e[2]),r=Number(e[3]);if(n<1||n>12||r<1||r>31)return null;let s=new Date(Date.UTC(t,n-1,r));return s.getUTCMonth()!==n-1||s.getUTCDate()!==r?null:s}function dt(a){let e=a.trim();if(me(e))return e;let t=e.match(/^(\d{1,2})[\/.\-](\d{1,2})[\/.\-](\d{4})$/);if(!t)return null;let n=`${t[3]}-${t[2].padStart(2,"0")}-${t[1].padStart(2,"0")}`;return me(n)?n:null}function ut(a,e=new Date){let t=me(a);if(!t)return false;let n=Date.UTC(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate());return t.getTime()<n}function pt(a,e=new Date){let t=me(a);if(!t)return false;let n=(e.getTime()-t.getTime())/(365.25*24*3600*1e3);return n>=0&&n<=120}var Me=[{key:"lastName",label:"ocrLastName",required:true,autocomplete:"family-name"},{key:"firstName",label:"ocrFirstName",required:true,autocomplete:"given-name"},{key:"dateOfBirth",label:"ocrDateOfBirth",date:true,required:true,autocomplete:"bday"},{key:"placeOfBirth",label:"ocrPlaceOfBirth"},{key:"documentNumber",label:"ocrDocumentNumber"},{key:"expirationDate",label:"ocrExpirationDate",date:true},{key:"nationality",label:"ocrNationality"},{key:"gender",label:"ocrGender"}],fe=class{constructor(e){this.flow=e;this.disposed=false;let t=e.strings,{root:n,content:r}=x({poweredBy:t.t("poweredBy"),backLabel:t.t("back"),closeLabel:t.t("close"),screenClass:"n-ocr",onClose:()=>e.cancel()});this.el=n,this.content=r,this.renderWaiting(),this.load();}dispose(){this.disposed=true;}renderWaiting(){let e=this.flow.strings;this.content.innerHTML=`
|
|
435
|
+
<div class="pad">
|
|
436
|
+
<h1 class="title">${i(e.t("ocrTitle"))}</h1>
|
|
437
|
+
<p class="body">${i(e.t("ocrSubtitle"))}</p>
|
|
438
|
+
<div class="waiting" role="status" aria-live="polite"><span class="loader sm"></span><span>${i(e.t("ocrWaiting"))}</span></div>
|
|
439
|
+
</div>`;}async load(){let e=this.flow,t;try{t=await e.ensureDocumentUploaded();}catch(r){if(this.disposed)return;let s=e.normalizeError(r);if(s.code==="upload_limit"||s.code==="session_closed"||s.code==="session_expired"||s.code==="origin_not_allowed"||s.code==="quota"){e.fail(r);return}this.renderError(s.message,s.requestId);return}if(this.disposed)return;let n=t??e.ocrData;e.config.confirmOcr==="display"?this.renderDisplay(n):this.renderForm(n);}renderDisplay(e){let t=this.flow.strings,n=Me.map(s=>{let o=e?.[s.key]??"",l=s.key==="lastName"||s.key==="firstName"||s.key==="placeOfBirth",d=o?s.key==="gender"?t.t(o.toUpperCase().startsWith("F")?"ocrGenderF":"ocrGenderM"):o:t.t("ocrEmptyValue");return `<div${l?' class="wide"':""}><dt>${i(t.t(s.label))}</dt><dd${o?"":' class="empty"'}>${i(d)}</dd></div>`}).join("");this.content.innerHTML=`
|
|
440
|
+
<div class="pad">
|
|
441
|
+
<h1 class="title">${i(t.t("ocrTitle"))}</h1>
|
|
442
|
+
<p class="body">${i(t.t("ocrReadSubtitle"))}</p>
|
|
443
|
+
${e?"":_("warning",i(t.t("ocrNone")))}
|
|
444
|
+
<dl class="dl">${n}</dl>
|
|
254
445
|
<div class="spacer"></div>
|
|
255
|
-
<p class="
|
|
256
|
-
|
|
446
|
+
<p class="question" id="n-ocr-q">${i(t.t("ocrQuestion"))}</p>
|
|
447
|
+
<div class="cta" role="group" aria-labelledby="n-ocr-q">
|
|
448
|
+
${E(t.t("ocrYes"),{act:"yes",icon:"check"})}
|
|
449
|
+
${M(t.t("ocrNo"),"no","alert")}
|
|
450
|
+
</div>
|
|
451
|
+
</div>`;let r=s=>{let o=this.flow;o.declaredData=void 0,o.dataDisputed=s,o.telemetry.track("ocr_reviewed",{hasOcr:!!e,disputed:s}),o.haptic(s?"error":"tap"),o.replace("processing");};this.content.querySelector('[data-act="yes"]')?.addEventListener("click",()=>r(false)),this.content.querySelector('[data-act="no"]')?.addEventListener("click",()=>r(true)),this.flow.telemetry.track("ocr_confirm_shown",{mode:"display",hasOcr:!!e,fields:e?Object.keys(e).length:0});}renderError(e,t){let n=this.flow.strings;this.content.innerHTML=`
|
|
257
452
|
<div class="pad">
|
|
258
|
-
|
|
453
|
+
<h1 class="title">${i(n.t("errorTitle"))}</h1>
|
|
454
|
+
${_("error",`${i(e)}${t?`<br><small class="mono">${i(n.t("errorRef",{id:t}))}</small>`:""}`)}
|
|
455
|
+
<div class="spacer"></div>
|
|
456
|
+
<div class="cta">${E(n.t("retry"),{act:"retry",icon:"refresh"})}${M(n.t("backToApp"),"quit")}</div>
|
|
457
|
+
</div>`,this.content.querySelector('[data-act="retry"]')?.addEventListener("click",()=>{this.renderWaiting(),this.load();}),this.content.querySelector('[data-act="quit"]')?.addEventListener("click",()=>this.flow.fail(new Error(e),"network"));}renderForm(e){let t=this.flow.strings,n=Me.map(s=>`<div class="${s.wide||s.key==="lastName"||s.key==="firstName"||s.key==="placeOfBirth"?"wide":""}">${rt({id:s.key,label:t.t(s.label),value:e?.[s.key]??"",required:s.required,placeholder:s.date?"AAAA-MM-JJ":void 0,help:s.date?t.t("ocrDateFormat"):void 0,autocomplete:s.autocomplete,inputmode:s.date?"numeric":void 0,maxlength:80})}</div>`).join("");this.content.innerHTML=`
|
|
458
|
+
<div class="pad">
|
|
459
|
+
<h1 class="title">${i(t.t("ocrTitle"))}</h1>
|
|
460
|
+
<p class="body">${i(t.t("ocrSubtitle"))}</p>
|
|
461
|
+
${e?"":_("warning",i(t.t("ocrNone")))}
|
|
462
|
+
<form class="grid" novalidate data-form>${n}</form>
|
|
463
|
+
<div data-msg></div>
|
|
464
|
+
<div class="spacer"></div>
|
|
465
|
+
${E(t.t("confirm"),{act:"confirm"})}
|
|
466
|
+
</div>`,this.content.querySelector("[data-form]").addEventListener("submit",s=>{s.preventDefault(),this.confirm();}),this.content.querySelector('[data-act="confirm"]')?.addEventListener("click",()=>this.confirm()),this.flow.telemetry.track("ocr_confirm_shown",{mode:"edit",hasOcr:!!e,fields:e?Object.keys(e).length:0});}setFieldState(e,t){let n=this.content.querySelector(`[data-field="${e}"]`);if(!n)return;n.classList.toggle("invalid",!!t);let r=n.querySelector(".n-field-msg");r&&(r.textContent=t??(e==="dateOfBirth"||e==="expirationDate"?this.flow.strings.t("ocrDateFormat"):""));}confirm(){let e=this.flow.strings,t=this.flow,n={},r=true,s=null,o=[];for(let c of Me){let u=this.content.querySelector(`#n-f-${c.key}`);if(!u)continue;let p=u.value.trim(),m=null;if(c.date&&p){let y=dt(p);y?(p=y,u.value=y,c.key==="dateOfBirth"&&!pt(y)&&(m=e.t("ocrDobInvalid")),c.key==="expirationDate"&&ut(y)&&o.push(e.t("ocrExpired"))):m=e.t("ocrDateFormat");}c.required&&!p&&(m=e.t("ocrRequired")),this.setFieldState(c.key,m),m&&(r=false,s??(s=u)),p&&(n[c.key]=p);}let l=this.content.querySelector("[data-msg]");if(l.innerHTML=o.map(c=>_("warning",i(c))).join(""),!r){s?.focus(),t.haptic("error");return}let d={};for(let[c,u]of Object.entries(n))(t.ocrData?.[c]??"")!==u&&(d[c]=u);t.declaredData=Object.keys(d).length?d:void 0,t.dataDisputed=false,t.telemetry.track("ocr_confirmed",{corrected:Object.keys(d).length,expiredWarning:o.length>0}),t.haptic("tap"),t.replace("processing");}};var ht=["ocr","face","aml","decision"],cn=2500,dn=6e4,ye=class{constructor(e){this.flow=e;this.canClose=false;this.stageIndex=-1;this.pollTimer=null;this.longTimer=null;this.disposed=false;let t=e.strings,{root:n,content:r}=x({poweredBy:t.t("poweredBy"),backLabel:t.t("back"),closeLabel:t.t("close"),screenClass:"n-processing",canClose:false,onClose:()=>e.cancel()});this.el=n,this.content=r,this.closeBtn=n.querySelector('[data-nav="close"]'),this.steps=[{label:t.t("processingDocument"),index:0},{label:t.t("processingFace"),index:1},{label:t.t("processingCompliance"),index:2},{label:t.t("processingDecision"),index:3}],this.renderProgress(),this.run();}dispose(){this.disposed=true,this.stopTimers();}stopTimers(){this.pollTimer&&clearTimeout(this.pollTimer),this.longTimer&&clearTimeout(this.longTimer),this.pollTimer=this.longTimer=null;}renderProgress(){let e=this.flow.strings,t=this.steps.map(n=>`<li class="row" data-row="${n.index}"><span class="dot idle"></span><span class="lbl">${i(n.label)}</span></li>`).join("");this.content.innerHTML=`
|
|
467
|
+
<div class="pad">
|
|
468
|
+
${ie()}
|
|
259
469
|
<div class="spacer"></div>
|
|
260
470
|
<span class="spin" aria-hidden="true"></span>
|
|
261
|
-
<
|
|
471
|
+
<h1 class="title sr-only">${i(e.t("processingDecision"))}</h1>
|
|
472
|
+
<ul class="steps" aria-live="polite">${t}</ul>
|
|
262
473
|
<div class="spacer"></div>
|
|
263
|
-
<p class="wait">${i(e.processingWait)}</p>
|
|
264
|
-
</div>`,this.closeBtn&&(this.closeBtn.hidden=true),this.updateSteps();}updateSteps(){let e=this.
|
|
474
|
+
<p class="wait" data-wait>${i(e.t("processingWait"))}</p>
|
|
475
|
+
</div>`,this.closeBtn&&(this.closeBtn.hidden=true),this.stageIndex=-1,this.updateSteps(),this.longTimer=setTimeout(()=>{let n=this.content.querySelector("[data-wait]");n&&(n.textContent=e.t("processingLong"));},dn);}updateSteps(){let e=this.stageIndex;this.steps.forEach(t=>{let n=this.content.querySelector(`[data-row="${t.index}"]`);if(!n)return;let r=n.querySelector(".dot"),s=n.querySelector(".lbl");t.index<e?(r.className="dot done",r.innerHTML=h("check",12,3)):t.index===e?(r.className="dot active",r.innerHTML=""):(r.className="dot idle",r.innerHTML=""),s.classList.toggle("dim",t.index>e);});}setStage(e){let t=e==="done"?ht.length:ht.indexOf(e);t>this.stageIndex&&(this.stageIndex=t,this.updateSteps());}poll(){this.disposed||(this.pollTimer=setTimeout(async()=>{let e=this.flow.session?.verificationId;if(!(!e||this.disposed)){try{let t=await this.flow.client.getVerification(e);this.disposed||this.setStage(t.processingStage);}catch{}this.poll();}},cn));}async run(){let e=this.flow;try{this.setStage("ocr"),await e.ensureDocumentUploaded();let t=await e.ensureSession();if(this.disposed)return;if(!e.selfieBase64)throw new L("Selfie manquant.","invalid_params");if(await e.client.submitLiveness(t.verificationId,{selfieBase64:e.selfieBase64,livenessMode:e.livenessMode,challengeProof:e.livenessMode==="active"?e.livenessProof:void 0,frames:e.livenessFrames,clientScore:e.livenessScore}),this.disposed)return;this.poll();let n=await e.client.submit(t.verificationId,e.declaredData,e.dataDisputed);if(this.stopTimers(),this.disposed)return;this.setStage("done"),e.submitResponse=n,e.emit("submitted",{status:n.status,reasonCodes:n.reasonCodes}),e.telemetry.track("submitted",{status:n.status,reasons:n.reasonCodes.length,replayed:!!n.replayed}),e.haptic(n.status==="rejected"?"error":"success"),e.replace("result");}catch(t){if(this.stopTimers(),this.disposed)return;let n=e.normalizeError(t,"server");if(e.telemetry.track("error",{code:n.code,status:n.statusCode??null,step:"processing"}),n.code==="upload_limit"||n.code==="session_closed"||n.code==="session_expired"||n.code==="origin_not_allowed"||n.code==="quota"||n.code==="kyb_pending"||n.code==="unauthorized"||n.code==="invalid_params"){e.fail(t,n.code);return}this.renderError(n.message,n.requestId);}}renderError(e,t){let n=this.flow.strings;this.closeBtn&&(this.closeBtn.hidden=false),this.content.innerHTML=`
|
|
265
476
|
<div class="pad center">
|
|
266
|
-
${
|
|
267
|
-
<h1 class="title">${i(t
|
|
477
|
+
${h("wifi-off",48,1.8)}
|
|
478
|
+
<h1 class="title">${i(n.t("errorTitle"))}</h1>
|
|
268
479
|
<p class="body">${i(e)}</p>
|
|
269
|
-
|
|
270
|
-
|
|
480
|
+
${t?`<p class="sub mono">${i(n.t("errorRef",{id:t}))}</p>`:""}
|
|
481
|
+
<div class="cta">
|
|
482
|
+
${E(n.t("retry"),{act:"retry",icon:"refresh",autofocus:true})}
|
|
483
|
+
${M(n.t("backToApp"),"quit")}
|
|
484
|
+
</div>
|
|
485
|
+
</div>`,this.content.querySelector('[data-act="retry"]')?.addEventListener("click",()=>{this.renderProgress(),this.run();}),this.content.querySelector('[data-act="quit"]')?.addEventListener("click",()=>this.flow.fail(new L(e,"server",{requestId:t}),"server"));}};var ge=class{constructor(e){this.flow=e;this.canClose=false;let t=e.strings,n=e.submitResponse,r=n?.status==="approved"?"approved":n?.status==="rejected"?"rejected":"review",s=this.viewFor(r),o=[n?.ocrData?.firstName??e.declaredData?.firstName,n?.ocrData?.lastName??e.declaredData?.lastName].filter(g=>g&&g.length).join(" "),l=e.session?.verificationId,d=l?l.split("-")[0].toUpperCase():"\u2014",u=(n?.reasonCodes??[]).filter(g=>g!=="AUTO_APPROVED"&&g!=="SCORE_BELOW_THRESHOLD"||r!=="approved").map(g=>t.reason(g)).filter(g=>!!g);r==="rejected"&&u.length===0&&n?.note&&u.push(n.note);let p="";r==="approved"?p=`<div class="summary">${o?`<div class="srow"><span class="k">${i(t.t("resultName"))}</span><span class="v">${i(o)}</span></div>`:""}<div class="srow"><span class="k">${i(t.t("resultReference"))}</span><span class="v mono">${i(d)}</span></div></div>`:r==="review"?p=`<ul class="bullets">${[t.t("resultReviewB1"),t.t("resultReviewB2"),t.t("resultReviewB3")].map(w=>`<li><span class="pip"></span><span>${i(w)}</span></li>`).join("")}</ul>`:u.length&&(p=`<p class="sub"><strong>${i(t.t("resultRejectedReason"))}</strong></p><ul class="reasons">${u.map(g=>`<li>${h("alert",16,2.2)}<span>${i(g)}</span></li>`).join("")}</ul>`);let y=r==="rejected"&&e.canRetry?`${E(t.t("retry"),{icon:"refresh",act:"retry",autofocus:true})}<div class="gap"></div>${M(t.t("backToApp"),"done")}`:E(t.t(n?.ocrData?"continue":"backToApp"),{act:"done",autofocus:true}),{root:v,content:C}=x({poweredBy:t.t("poweredBy"),backLabel:t.t("back"),closeLabel:t.t("close"),screenClass:"n-result",canClose:false,clientLogoUrl:e.config.clientLogoUrl});this.el=v,C.innerHTML=`
|
|
271
486
|
<div class="pad">
|
|
272
487
|
<div class="spacer"></div>
|
|
273
|
-
<span class="badge" style="background:${
|
|
274
|
-
<h1 class="title">${i(
|
|
275
|
-
${
|
|
276
|
-
${
|
|
488
|
+
<span class="badge" style="background:${s.color}">${h(s.icon,44,3)}</span>
|
|
489
|
+
<h1 class="title">${i(s.title)}</h1>
|
|
490
|
+
${s.subtitle?`<p class="body">${i(s.subtitle)}</p>`:""}
|
|
491
|
+
${p}
|
|
277
492
|
<div class="spacer"></div>
|
|
278
|
-
|
|
279
|
-
</div>`,
|
|
493
|
+
<div class="cta">${y}</div>
|
|
494
|
+
</div>`,C.querySelector('[data-act="retry"]')?.addEventListener("click",()=>this.retry()),C.querySelector('[data-act="done"]')?.addEventListener("click",()=>this.done(r));}dispose(){}viewFor(e){let t=this.flow.strings;switch(e){case "approved":return {icon:"check",color:"var(--naya-success)",title:t.t("resultApprovedTitle"),subtitle:t.t("resultApprovedSubtitle")};case "rejected":return {icon:"close",color:"var(--naya-error)",title:t.t("resultRejectedTitle"),subtitle:""};default:return {icon:"clock",color:"var(--naya-warning)",title:t.t("resultReviewTitle"),subtitle:t.t("resultReviewSubtitle")}}}retry(){this.flow.resetForRetry(),this.flow.replace(this.flow.tipsShown.document?"capture-recto":"tips-document");}done(e){let t=this.flow.submitResponse;this.flow.complete({status:e,verificationId:this.flow.session?.verificationId,reasonCodes:t?.reasonCodes??[],livenessMode:this.flow.livenessMode,riskScore:t?.riskScore,matchScore:t?.matchScore,authenticityScore:t?.authenticityScore,livenessScore:t?.livenessScore,ocrConfidence:t?.ocrConfidence,ocrData:t?.ocrData,declaredData:t?.declaredData,dataMismatches:t?.dataMismatches,dataDisputed:t?.dataDisputed,note:t?.note});}};function un(a,e){switch(a){case "unsupported":return new ce(e);case "welcome":return new le(e);case "consent":return new de(e);case "handoff":return new ue(e);case "select":return new pe(e);case "tips-document":return new G(e,"document");case "tips-selfie":return new G(e,"selfie");case "capture-recto":return new K(e,"recto");case "capture-verso":return new K(e,"verso");case "liveness":return new he(e);case "ocr-confirm":return new fe(e);case "processing":return new ye(e);case "result":return new ge(e)}}var pn=new Set(["liveness","ocr-confirm","processing"]);function Ae(a,e){if(typeof document>"u")return {result:Promise.resolve(q("Le SDK Naya n\xE9cessite un environnement navigateur.",void 0,{errorCode:"unsupported_browser"})),flow:null,close:()=>{}};let t=()=>{},n;return {result:new Promise(s=>{let o=!!e.container,l=document.createElement("div");l.setAttribute("data-naya-id",""),o&&(l.style.cssText="display:block;height:100%;");let d=l.attachShadow({mode:"open"}),c=document.createElement("style");c.textContent=Be,d.appendChild(c);let u=document.createElement("div");u.className="naya-host"+(o?" n-inline":""),u.setAttribute("role","dialog"),u.setAttribute("aria-modal",o?"false":"true"),d.appendChild(u);let p=document.createElement("div");p.className="n-frame",u.appendChild(p);let m=()=>{let k=$e(e);for(let[b,R]of Object.entries(k))u.style.setProperty(b,R);u.style.colorScheme=we(e);};m();let y=null;e.theme.mode==="auto"&&typeof matchMedia=="function"&&(y=matchMedia("(prefers-color-scheme: dark)"),y.addEventListener?.("change",m));let v=document.body.style.overflow,C=document.activeElement,g=false,w=null,D=()=>{},A=k=>{(pn.has(f.step)||f.documentUploadInFlight)&&(k.preventDefault(),k.returnValue="");},O=()=>w?.onVisibility?.(document.visibilityState==="visible"),S=k=>{if(!g){g=true,w?.dispose(),document.removeEventListener("keydown",N),document.removeEventListener("visibilitychange",O),window.removeEventListener("beforeunload",A),D(),y?.removeEventListener?.("change",m),o||(document.body.style.overflow=v),l.remove();try{C?.focus?.({preventScroll:!0});}catch{}s(k);}},f=new re(a,e,S);n=f,u.setAttribute("aria-label",f.strings.t("dialogLabel"));let T=(k,b)=>{let R=w;if(w=un(k,f),w.el.classList.add(b==="back"?"n-enter-back":"n-enter"),R){R.dispose(),R.el.classList.add("n-leave"),R.el.setAttribute("aria-hidden","true"),p.appendChild(w.el);let yt=R.el;setTimeout(()=>yt.remove(),180);}else p.replaceChildren(w.el);let be=w.el.querySelector("h1");be&&!be.hasAttribute("tabindex")&&be.setAttribute("tabindex","-1"),tt(w.el);};f.onStep=T;let N=k=>{k.key==="Escape"&&w?.canClose!==false&&f.cancel();};document.addEventListener("keydown",N),document.addEventListener("visibilitychange",O),window.addEventListener("beforeunload",A),o?e.container.replaceChildren(l):(document.body.appendChild(l),document.body.style.overflow="hidden",D=et(d)),t=()=>f.cancel(),T(f.step,"replace"),f.emit("ready",{resumed:f.resumed,support:f.support.ok}),f.resumed&&f.support.ok&&f.prepare().catch(k=>f.fail(k,"session_expired"));}),flow:n,close:()=>t()}}var ve=class{constructor(){this.listeners=new Map;}on(e,t){let n=this.listeners.get(e);return n||(n=new Set,this.listeners.set(e,n)),n.add(t),()=>n.delete(t)}emit(e,t){let n=this.listeners.get(e);if(n)for(let r of Array.from(n))try{r(t);}catch{}}clear(){this.listeners.clear();}};function mt(a){let e=a.auth??{apiKey:a.apiKey,sessionToken:a.sessionToken,verificationId:a.verificationId};return e.sessionToken&&!e.verificationId?{auth:e,error:{status:"error",errorCode:"invalid_params",errorMessage:"sessionToken doit \xEAtre accompagn\xE9 du verificationId rendu par POST /verifications/start."}}:e.verificationId&&!e.sessionToken?{auth:e,error:{status:"error",errorCode:"invalid_params",errorMessage:"verificationId doit \xEAtre accompagn\xE9 de son sessionToken.",verificationId:e.verificationId}}:!e.apiKey&&!e.sessionToken?{auth:e,error:{status:"error",errorCode:"invalid_params",errorMessage:"Authentification manquante : fournissez apiKey, ou verificationId + sessionToken."}}:{auth:e}}async function hn(a){let{auth:e,error:t}=mt(a);return t||Ae(e,J(a.config)).result}function mn(){return ne()}function ft(a){let e=new ve,t=null,n=false;return {async open(){if(n)throw new Error("NayaId: le parcours est d\xE9j\xE0 ouvert.");let{auth:s,error:o}=mt(a);if(o)return e.emit("result",o),o;n=true;let l=a.config?.onEvent,d=J({...a.config,onEvent:c=>{e.emit(c.type,c),l?.(c);}});t=Ae(s,d);try{let c=await t.result;return e.emit("result",c),c}finally{n=false,t=null;}},close(){t?.close();},on(s,o){return e.on(s,o)},destroy(){t?.close(),e.clear();},get isOpen(){return n}}}var fn="naya-id-verification";function yn(a=fn){if(typeof customElements>"u"||customElements.get(a))return;class e extends HTMLElement{constructor(){super(...arguments);this.verification=null;}connectedCallback(){this.hasAttribute("auto")&&this.start();}disconnectedCallback(){this.verification?.destroy(),this.verification=null;}params(){let r=l=>this.getAttribute(l)??void 0,s=r("document-types")?.split(",").map(l=>l.trim()).filter(Boolean),o={locale:r("locale"),country:r("country"),documentTypes:s&&s.length?s:void 0,callbackUrl:r("callback-url"),container:this.hasAttribute("inline")?this:null,theme:{primaryColor:r("theme-primary"),accentColor:r("theme-accent"),mode:r("theme-mode")},onEvent:l=>this.dispatchEvent(new CustomEvent("naya-event",{detail:l,bubbles:true}))};return {apiKey:r("api-key"),sessionToken:r("session-token"),verificationId:r("verification-id"),config:o}}async start(){this.verification?.destroy(),this.verification=ft(this.params());let r=await this.verification.open();return this.dispatchEvent(new CustomEvent("naya-result",{detail:r,bubbles:true})),r}close(){this.verification?.close();}}customElements.define(a,e);}var gn=U,vn={startVerification:hn,create:ft,isSupported:mn,defineElement:yn,version:gn},wr=vn;exports.NAYA_COUNTRIES=B;exports.NAYA_DEFAULT_ACCENT=Oe;exports.NAYA_DEFAULT_BASE_URL=Re;exports.NAYA_DEFAULT_PRIMARY=De;exports.NAYA_DOCUMENT_TYPES=Q;exports.NAYA_LOCALES=_e;exports.NayaApiError=L;exports.cancelledResult=Et;exports.countryLabel=xe;exports.create=ft;exports.default=wr;exports.defineElement=yn;exports.detectLocale=He;exports.documentNeedsVerso=X;exports.errorResult=q;exports.isSupported=mn;exports.ocrToDeclaredData=wt;exports.parseOcrData=Z;exports.resolveConfig=J;exports.startVerification=hn;exports.version=gn;//# sourceMappingURL=naya-id.cjs.map
|
|
280
495
|
//# sourceMappingURL=naya-id.cjs.map
|