@sekyro/react 0.1.0-rc.16 → 0.1.0-rc.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +38 -0
- package/dist/{chunk-IUQTOOBI.js → chunk-25KWDPLY.js} +1 -1
- package/dist/chunk-55NNQK5P.js +2 -0
- package/dist/chunk-6I7GU4FS.js +2 -0
- package/dist/chunk-A6UYUVEG.js +2 -0
- package/dist/chunk-DY5WQVPE.js +2 -0
- package/dist/chunk-GUTF3SPK.js +2 -0
- package/dist/chunk-JT7YHK7F.js +2 -0
- package/dist/chunk-LPGHMDD4.js +2 -0
- package/dist/chunk-NV7HZJM4.js +2 -0
- package/dist/chunk-T3PAN4NN.js +2 -0
- package/dist/chunk-XTQARDSJ.js +2 -0
- package/dist/chunk-YVNQ3UUH.js +2 -0
- package/dist/{chunk-IT66PZDO.js → chunk-Z7US4CLZ.js} +1 -1
- package/dist/document-capture-view-WDGHEAUI.js +2 -0
- package/dist/eid-view-HQLNWM6A.js +2 -0
- package/dist/email-otp-view-LCIDGNZT.js +2 -0
- package/dist/flow-views-K3HXMKPU.js +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/overlay-de-YQA44XTY.js +2 -0
- package/dist/overlay-es-6KRUPYG4.js +2 -0
- package/dist/overlay-pt-QEAE4TDI.js +2 -0
- package/dist/portrait-capture-view-I7I6FJQO.js +2 -0
- package/dist/portrait-review-view-A5HGZ7ZN.js +2 -0
- package/dist/verification/index.cjs +1 -1
- package/dist/verification/index.d.cts +66 -2
- package/dist/verification/index.d.ts +66 -2
- package/dist/verification/index.js +1 -1
- package/dist/verification.css +210 -70
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/chunk-5TOBG5R2.js +0 -2
- package/dist/chunk-EZ5TVL6P.js +0 -2
- package/dist/chunk-FNBG3472.js +0 -2
- package/dist/chunk-GGTRTUW3.js +0 -2
- package/dist/chunk-H2KIOYQU.js +0 -2
- package/dist/chunk-KHBM3P4C.js +0 -2
- package/dist/chunk-NXVTUTKS.js +0 -2
- package/dist/chunk-OUG465K6.js +0 -2
- package/dist/chunk-PYAJMHZH.js +0 -2
- package/dist/chunk-XDPCJAYO.js +0 -2
- package/dist/chunk-YY76AMUA.js +0 -2
- package/dist/document-capture-view-PUGWMQAP.js +0 -2
- package/dist/eid-view-IMKKBPQV.js +0 -2
- package/dist/email-otp-view-YLMRRLC3.js +0 -2
- package/dist/flow-views-HFQJ45NS.js +0 -2
- package/dist/overlay-de-ZICWH4MW.js +0 -2
- package/dist/overlay-es-2ETCIRV4.js +0 -2
- package/dist/overlay-pt-2DX57E2U.js +0 -2
- package/dist/portrait-capture-view-M5OLPMMO.js +0 -2
|
@@ -16,6 +16,8 @@ interface StepStrings {
|
|
|
16
16
|
"consent.terms.processing": string;
|
|
17
17
|
"consent.terms.sharing": string;
|
|
18
18
|
"consent.terms.retention": string;
|
|
19
|
+
"capture.modePicker.legendPhoto": string;
|
|
20
|
+
"capture.modePicker.helpPhoto": string;
|
|
19
21
|
"reasons.camera_unavailable": string;
|
|
20
22
|
"otp.sendTitle": string;
|
|
21
23
|
"otp.sendDescription": string;
|
|
@@ -96,6 +98,7 @@ interface StepStrings {
|
|
|
96
98
|
"doc.ageStepUp": string;
|
|
97
99
|
"reasons.underage_estimated": string;
|
|
98
100
|
"reasons.starter_credit_claimed": string;
|
|
101
|
+
"reasons.blocked_by_org": string;
|
|
99
102
|
"dcv2.sensing": string;
|
|
100
103
|
"dcv2.too_far": string;
|
|
101
104
|
"dcv2.too_close": string;
|
|
@@ -116,8 +119,6 @@ interface StepStrings {
|
|
|
116
119
|
"handoff.title": string;
|
|
117
120
|
"session.processing.age_estimation.title": string;
|
|
118
121
|
"session.processing.age_estimation.description": string;
|
|
119
|
-
"session.processing.aml_screening.title": string;
|
|
120
|
-
"session.processing.aml_screening.description": string;
|
|
121
122
|
"session.result.approved.title": string;
|
|
122
123
|
"session.result.approved.description": string;
|
|
123
124
|
"session.result.review.title": string;
|
|
@@ -208,6 +209,20 @@ interface StepStrings {
|
|
|
208
209
|
"needsApp.title": string;
|
|
209
210
|
"needsApp.description": string;
|
|
210
211
|
"needsApp.descriptionNoOrg": string;
|
|
212
|
+
"consent.termsTitle": string;
|
|
213
|
+
"leave.title": string;
|
|
214
|
+
"leave.body": string;
|
|
215
|
+
"leave.confirm": string;
|
|
216
|
+
"leave.stay": string;
|
|
217
|
+
"otp.changeNumber": string;
|
|
218
|
+
"otp.backToCode": string;
|
|
219
|
+
"otp.reason_otp_resend_limit": string;
|
|
220
|
+
"reasons.otp_resend_limit": string;
|
|
221
|
+
"common.back": string;
|
|
222
|
+
"capture.assisted.heading": string;
|
|
223
|
+
"returning.heading": string;
|
|
224
|
+
"capture.checkingTitle": string;
|
|
225
|
+
"method.heading": string;
|
|
211
226
|
"population.recheck.title": string;
|
|
212
227
|
"population.recheck.description": string;
|
|
213
228
|
"otp.phoneInvalid": string;
|
|
@@ -282,6 +297,9 @@ interface StepStrings {
|
|
|
282
297
|
"emailOtp.reason_otp_rate_limited"?: string;
|
|
283
298
|
"emailOtp.reason_email_invalid"?: string;
|
|
284
299
|
"emailOtp.reason_email_disposable"?: string;
|
|
300
|
+
"emailOtp.changeEmail"?: string;
|
|
301
|
+
"emailOtp.backToCode"?: string;
|
|
302
|
+
"emailOtp.reason_otp_resend_limit"?: string;
|
|
285
303
|
"eid.identifierTitle"?: string;
|
|
286
304
|
"eid.identifierTitleGeneric"?: string;
|
|
287
305
|
"eid.identifierDescription"?: string;
|
|
@@ -333,6 +351,43 @@ interface StepStrings {
|
|
|
333
351
|
"dcv3.mrz.valid"?: string;
|
|
334
352
|
"dcv3.mrz.looksLikePassport"?: string;
|
|
335
353
|
"dcv3.mrz.looksLikeCard"?: string;
|
|
354
|
+
"portrait.source.title"?: string;
|
|
355
|
+
"portrait.source.description"?: string;
|
|
356
|
+
"portrait.source.camera"?: string;
|
|
357
|
+
"portrait.source.upload"?: string;
|
|
358
|
+
"portrait.source.uploadInstead"?: string;
|
|
359
|
+
"portrait.upload.title"?: string;
|
|
360
|
+
"portrait.upload.hint"?: string;
|
|
361
|
+
"portrait.upload.choose"?: string;
|
|
362
|
+
"portrait.upload.unsupported"?: string;
|
|
363
|
+
"portrait.upload.failed"?: string;
|
|
364
|
+
"portrait.review.title"?: string;
|
|
365
|
+
"portrait.review.description"?: string;
|
|
366
|
+
"portrait.review.original"?: string;
|
|
367
|
+
"portrait.review.fixed"?: string;
|
|
368
|
+
"portrait.review.fixesTitle"?: string;
|
|
369
|
+
"portrait.review.accept"?: string;
|
|
370
|
+
"portrait.review.retake"?: string;
|
|
371
|
+
"portrait.review.uploadAnother"?: string;
|
|
372
|
+
"portrait.fixes.crop"?: string;
|
|
373
|
+
"portrait.fixes.scale"?: string;
|
|
374
|
+
"portrait.fixes.straighten"?: string;
|
|
375
|
+
"portrait.fixes.background"?: string;
|
|
376
|
+
"portrait.fixes.exposure"?: string;
|
|
377
|
+
"portrait.fixes.white_balance"?: string;
|
|
378
|
+
"reasons.portrait_recaptured"?: string;
|
|
379
|
+
"reasons.portrait_morph_suspected"?: string;
|
|
380
|
+
"reasons.portrait_reference_mismatch"?: string;
|
|
381
|
+
"reasons.portrait_declined_fix"?: string;
|
|
382
|
+
"doc.uploadInstead"?: string;
|
|
383
|
+
"doc.uploadTitle"?: string;
|
|
384
|
+
"doc.uploadHint"?: string;
|
|
385
|
+
"doc.uploadUnsupported"?: string;
|
|
386
|
+
"doc.uploadFailed"?: string;
|
|
387
|
+
"doc.source.title"?: string;
|
|
388
|
+
"doc.source.description"?: string;
|
|
389
|
+
"doc.source.camera"?: string;
|
|
390
|
+
"doc.source.upload"?: string;
|
|
336
391
|
"native.doc.introTitle"?: string;
|
|
337
392
|
"native.doc.introLead"?: string;
|
|
338
393
|
"native.doc.tip.flat"?: string;
|
|
@@ -409,6 +464,7 @@ interface StepStrings {
|
|
|
409
464
|
"inApp.copied"?: string;
|
|
410
465
|
"inApp.copyFailed"?: string;
|
|
411
466
|
"inApp.continueAnyway"?: string;
|
|
467
|
+
"inApp.openBrowser"?: string;
|
|
412
468
|
}
|
|
413
469
|
|
|
414
470
|
/**
|
|
@@ -558,6 +614,14 @@ interface SekyroVerificationProps {
|
|
|
558
614
|
* SDKs). Take them back to your page. Without it, neither button is shown.
|
|
559
615
|
*/
|
|
560
616
|
onClose?: (event: SekyroCloseEvent) => void;
|
|
617
|
+
/**
|
|
618
|
+
* The browser's back button (UX refresh 2026-11-05 decision 2). `history`: the flow
|
|
619
|
+
* keeps one history entry of its own, so back goes one screen back where the screen has a way back (the camera to
|
|
620
|
+
* its intro, the code to the number), else asks "Leave verification?" once anything was sent, and leaves when
|
|
621
|
+
* nothing was. `none` (the default, of `<SekyroFlow>` too): the flow never touches the page's history. The hosted
|
|
622
|
+
* page passes `history`; a partner page passes it only when the flow owns the page's back button.
|
|
623
|
+
*/
|
|
624
|
+
backNavigation?: "history" | "none";
|
|
561
625
|
/** Fires before the liveness upload (SDK spec §7.5 shadow hook). */
|
|
562
626
|
onLivenessCaptured?: (artifacts: CapturedArtifacts) => void;
|
|
563
627
|
/**
|
|
@@ -16,6 +16,8 @@ interface StepStrings {
|
|
|
16
16
|
"consent.terms.processing": string;
|
|
17
17
|
"consent.terms.sharing": string;
|
|
18
18
|
"consent.terms.retention": string;
|
|
19
|
+
"capture.modePicker.legendPhoto": string;
|
|
20
|
+
"capture.modePicker.helpPhoto": string;
|
|
19
21
|
"reasons.camera_unavailable": string;
|
|
20
22
|
"otp.sendTitle": string;
|
|
21
23
|
"otp.sendDescription": string;
|
|
@@ -96,6 +98,7 @@ interface StepStrings {
|
|
|
96
98
|
"doc.ageStepUp": string;
|
|
97
99
|
"reasons.underage_estimated": string;
|
|
98
100
|
"reasons.starter_credit_claimed": string;
|
|
101
|
+
"reasons.blocked_by_org": string;
|
|
99
102
|
"dcv2.sensing": string;
|
|
100
103
|
"dcv2.too_far": string;
|
|
101
104
|
"dcv2.too_close": string;
|
|
@@ -116,8 +119,6 @@ interface StepStrings {
|
|
|
116
119
|
"handoff.title": string;
|
|
117
120
|
"session.processing.age_estimation.title": string;
|
|
118
121
|
"session.processing.age_estimation.description": string;
|
|
119
|
-
"session.processing.aml_screening.title": string;
|
|
120
|
-
"session.processing.aml_screening.description": string;
|
|
121
122
|
"session.result.approved.title": string;
|
|
122
123
|
"session.result.approved.description": string;
|
|
123
124
|
"session.result.review.title": string;
|
|
@@ -208,6 +209,20 @@ interface StepStrings {
|
|
|
208
209
|
"needsApp.title": string;
|
|
209
210
|
"needsApp.description": string;
|
|
210
211
|
"needsApp.descriptionNoOrg": string;
|
|
212
|
+
"consent.termsTitle": string;
|
|
213
|
+
"leave.title": string;
|
|
214
|
+
"leave.body": string;
|
|
215
|
+
"leave.confirm": string;
|
|
216
|
+
"leave.stay": string;
|
|
217
|
+
"otp.changeNumber": string;
|
|
218
|
+
"otp.backToCode": string;
|
|
219
|
+
"otp.reason_otp_resend_limit": string;
|
|
220
|
+
"reasons.otp_resend_limit": string;
|
|
221
|
+
"common.back": string;
|
|
222
|
+
"capture.assisted.heading": string;
|
|
223
|
+
"returning.heading": string;
|
|
224
|
+
"capture.checkingTitle": string;
|
|
225
|
+
"method.heading": string;
|
|
211
226
|
"population.recheck.title": string;
|
|
212
227
|
"population.recheck.description": string;
|
|
213
228
|
"otp.phoneInvalid": string;
|
|
@@ -282,6 +297,9 @@ interface StepStrings {
|
|
|
282
297
|
"emailOtp.reason_otp_rate_limited"?: string;
|
|
283
298
|
"emailOtp.reason_email_invalid"?: string;
|
|
284
299
|
"emailOtp.reason_email_disposable"?: string;
|
|
300
|
+
"emailOtp.changeEmail"?: string;
|
|
301
|
+
"emailOtp.backToCode"?: string;
|
|
302
|
+
"emailOtp.reason_otp_resend_limit"?: string;
|
|
285
303
|
"eid.identifierTitle"?: string;
|
|
286
304
|
"eid.identifierTitleGeneric"?: string;
|
|
287
305
|
"eid.identifierDescription"?: string;
|
|
@@ -333,6 +351,43 @@ interface StepStrings {
|
|
|
333
351
|
"dcv3.mrz.valid"?: string;
|
|
334
352
|
"dcv3.mrz.looksLikePassport"?: string;
|
|
335
353
|
"dcv3.mrz.looksLikeCard"?: string;
|
|
354
|
+
"portrait.source.title"?: string;
|
|
355
|
+
"portrait.source.description"?: string;
|
|
356
|
+
"portrait.source.camera"?: string;
|
|
357
|
+
"portrait.source.upload"?: string;
|
|
358
|
+
"portrait.source.uploadInstead"?: string;
|
|
359
|
+
"portrait.upload.title"?: string;
|
|
360
|
+
"portrait.upload.hint"?: string;
|
|
361
|
+
"portrait.upload.choose"?: string;
|
|
362
|
+
"portrait.upload.unsupported"?: string;
|
|
363
|
+
"portrait.upload.failed"?: string;
|
|
364
|
+
"portrait.review.title"?: string;
|
|
365
|
+
"portrait.review.description"?: string;
|
|
366
|
+
"portrait.review.original"?: string;
|
|
367
|
+
"portrait.review.fixed"?: string;
|
|
368
|
+
"portrait.review.fixesTitle"?: string;
|
|
369
|
+
"portrait.review.accept"?: string;
|
|
370
|
+
"portrait.review.retake"?: string;
|
|
371
|
+
"portrait.review.uploadAnother"?: string;
|
|
372
|
+
"portrait.fixes.crop"?: string;
|
|
373
|
+
"portrait.fixes.scale"?: string;
|
|
374
|
+
"portrait.fixes.straighten"?: string;
|
|
375
|
+
"portrait.fixes.background"?: string;
|
|
376
|
+
"portrait.fixes.exposure"?: string;
|
|
377
|
+
"portrait.fixes.white_balance"?: string;
|
|
378
|
+
"reasons.portrait_recaptured"?: string;
|
|
379
|
+
"reasons.portrait_morph_suspected"?: string;
|
|
380
|
+
"reasons.portrait_reference_mismatch"?: string;
|
|
381
|
+
"reasons.portrait_declined_fix"?: string;
|
|
382
|
+
"doc.uploadInstead"?: string;
|
|
383
|
+
"doc.uploadTitle"?: string;
|
|
384
|
+
"doc.uploadHint"?: string;
|
|
385
|
+
"doc.uploadUnsupported"?: string;
|
|
386
|
+
"doc.uploadFailed"?: string;
|
|
387
|
+
"doc.source.title"?: string;
|
|
388
|
+
"doc.source.description"?: string;
|
|
389
|
+
"doc.source.camera"?: string;
|
|
390
|
+
"doc.source.upload"?: string;
|
|
336
391
|
"native.doc.introTitle"?: string;
|
|
337
392
|
"native.doc.introLead"?: string;
|
|
338
393
|
"native.doc.tip.flat"?: string;
|
|
@@ -409,6 +464,7 @@ interface StepStrings {
|
|
|
409
464
|
"inApp.copied"?: string;
|
|
410
465
|
"inApp.copyFailed"?: string;
|
|
411
466
|
"inApp.continueAnyway"?: string;
|
|
467
|
+
"inApp.openBrowser"?: string;
|
|
412
468
|
}
|
|
413
469
|
|
|
414
470
|
/**
|
|
@@ -558,6 +614,14 @@ interface SekyroVerificationProps {
|
|
|
558
614
|
* SDKs). Take them back to your page. Without it, neither button is shown.
|
|
559
615
|
*/
|
|
560
616
|
onClose?: (event: SekyroCloseEvent) => void;
|
|
617
|
+
/**
|
|
618
|
+
* The browser's back button (UX refresh 2026-11-05 decision 2). `history`: the flow
|
|
619
|
+
* keeps one history entry of its own, so back goes one screen back where the screen has a way back (the camera to
|
|
620
|
+
* its intro, the code to the number), else asks "Leave verification?" once anything was sent, and leaves when
|
|
621
|
+
* nothing was. `none` (the default, of `<SekyroFlow>` too): the flow never touches the page's history. The hosted
|
|
622
|
+
* page passes `history`; a partner page passes it only when the flow owns the page's back button.
|
|
623
|
+
*/
|
|
624
|
+
backNavigation?: "history" | "none";
|
|
561
625
|
/** Fires before the liveness upload (SDK spec §7.5 shadow hook). */
|
|
562
626
|
onLivenessCaptured?: (artifacts: CapturedArtifacts) => void;
|
|
563
627
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{a as Qt}from"../chunk-OUG465K6.js";import{a as B,d as Ht,e as Ce,f as Le,g as Ut,h as $t}from"../chunk-IT66PZDO.js";import{a as Kt}from"../chunk-EZ5TVL6P.js";import{a as zt}from"../chunk-YY76AMUA.js";import{a as Yt,b as Zt,c as qt,d as Jt}from"../chunk-FNBG3472.js";import{a as q}from"../chunk-PYAJMHZH.js";import{b as Lt,c as Ot,d as Vt,f as Dt,g as Bt,j as Ft}from"../chunk-5TOBG5R2.js";import{a as At}from"../chunk-7MMT5M4E.js";import{b as Rt}from"../chunk-KHBM3P4C.js";import{a as oe,b as ne,c as Oe,d as Gt,g as Wt}from"../chunk-NXVTUTKS.js";import{a as ce}from"../chunk-VRDPGOXM.js";import{a as Ho,b as Uo,c as $o,d as Ko,e as Go,f as Ne,g as _}from"../chunk-GGTRTUW3.js";import{a as T,b as Ve}from"../chunk-XDPCJAYO.js";import{a as P,c as xt,i as Bo,k as Fo,l as It,m as Et,n as Tt,r as Mt,t as Ae,u as le}from"../chunk-IUQTOOBI.js";import{a as s}from"../chunk-2KED7D2Q.js";import{useEffect as Wo,useState as Xt}from"react";function Ge(e){let[t,n]=Xt(()=>e?.currentStep?.()??null),[o,l]=Xt(null);return Wo(()=>{if(e===void 0)return;if(typeof e.run!="function"){l(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let i=!0,r=e.on("step",a=>{i&&n(a)});return e.run().then(a=>{i&&n(c=>c??a)},a=>{i&&l(a)}),()=>{i=!1,r()}},[e]),{step:t,error:o}}s(Ge,"useVerificationStep");import{useEffect as so,useId as Zo,useMemo as qo,useRef as io,useState as ie}from"react";var zo="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",jt;function eo(e){return jt??(jt=new Map(zo.split(" ").map(t=>{let[n,o]=t.slice(2).split("/");return[t.slice(0,2),[n,o]]}))),jt.get(e.toUpperCase())}s(eo,"entryOf");function to(e){return eo(e)?.[0]}s(to,"dialCodeOf");function oo(e){return eo(e)?.[1]}s(oo,"nationalPrefixOf");import{normalizeNni as Yo}from"@sekyro/web";function De(e){let t=Yo(e).replace(/\D/g,"");return/^\D*\+/.test(e)?`+${t}`:t.startsWith("00")?`+${t.slice(2)}`:t}s(De,"digitsOf");var We=s((e,t)=>(t.trunk!==void 0&&e.startsWith(t.trunk)?e.slice(t.trunk.length):e).slice(0,Math.max(...t.lengths)),"fitDigits");function ze(e,t){let n="",o=0;for(let l of t?.formats?.find(i=>new RegExp(`^(?:${i.leading})`).test(e))?.groups??[])o<e.length&&(n+=(o>0?" ":"")+e.slice(o,o+l)),o+=l;return n+e.slice(o)}s(ze,"groupDigits");function no(e,t){let n=0;for(let o=t;o>0&&n<e.length;n+=1)e[n]!==" "&&(o-=1);return n}s(no,"caretAfter");var Ye=s((e,t)=>t.find(n=>e.startsWith(n.dial)),"countryOfNumber"),ro=s((e,t)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${t} $1`),"lengthsLabel");import{Fragment as uo,jsx as k,jsxs as F}from"react/jsx-runtime";var ao=s((e,t)=>{if(e===void 0)return 0;let n=Date.parse(e)-t;return Number.isFinite(n)?Math.max(0,Math.ceil(n/1e3)):0},"secondsUntil"),Jo=s(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Qo=["whatsapp","sms"],Xo=new Set(["otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited","otp_number_invalid","otp_number_not_mobile"]);function lo(e){let t=De(e).replace("+","");return/^\d{8,15}$/.test(t)?`+${t}`:null}s(lo,"normalizedPhone");var jo=s(e=>String.fromCodePoint(...Array.from(e,t=>127397+t.charCodeAt(0))),"flagOf");function en(e){let t=[];for(let n of e.phoneCountries??["MR"]){let o=e.phoneRules?.find(i=>i.code===n),l=o?.dial??to(n);l!==void 0&&!t.some(i=>i.code===n)&&t.push({code:n,dial:`+${l}`,...o!==void 0?{rule:o}:{}})}return t}s(en,"phoneCountriesOf");function tn(e,t){if(t===null||!e.startsWith(t.dial))return lo(e);let n=e.slice(t.dial.length).replace(/\D/g,""),o=oo(t.code);return o!==void 0&&n.startsWith(o)&&(n=n.slice(o.length)),lo(t.dial+n)}s(tn,"e164Of");var co=s((e,t)=>(Ye(e,t)??t[0])?.code??null,"countryFor");function on(e){let t=null;try{t=new Intl.DisplayNames([e],{type:"region"})}catch{}return n=>`${t?.of(n.code)??n.code} (${n.dial})`}s(on,"countryLabels");var po="other";function Ze({step:e,locale:t,strings:n,className:o,defaultPhone:l,onError:i}){let r=_(t,n),{t:a}=r,c=qo(()=>en(e),[e.phoneCountries,e.phoneRules]),f=l??c[0]?.dial??"",[S,y]=ie(()=>co(f,c)),g=c.map(m=>m.code).join(",");so(()=>{if(S===null||!c.some(m=>m.code===S)){let m=co(f,c);y(m);let h=x.current,te=c.find(Y=>Y.code===m)?.dial;te!==void 0&&O(Y=>h!==null&&Y.startsWith(h.dial)?te+Y.slice(h.dial.length):Y.startsWith("+")?Y:te)}},[g,f]);let u=c.find(m=>m.code===S)??null,x=io(u);u!==null&&(x.current=u);let[b,O]=ie(f),[I,v]=ie(!1),[D,G]=ie(!1),[W,C]=ie(""),[E,M]=ie(!1),[H,U]=ie(null),J=e.phase==="verify",Ie=zt(J),N=Zo(),ge=io(null);so(()=>{let m=setTimeout(()=>ge.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(m)},[J]);let d=s(async m=>{M(!0),U(null);try{await m()}catch(h){U(ce(h,r.strings)),i?.(h)}finally{M(!1)}},"run"),w=Qo.filter(m=>(e.channels??[]).includes(m)),Q=e.phoneInternational===!0,he=I||u===null,X=he||b.startsWith("+")&&!b.startsWith(u.dial),se=X?void 0:u.rule,gt=X?b:b.replace(u.dial,"").replace(/\D/g,""),j=se?We(gt,se):gt,ht=X&&!he&&!Q&&e.phoneRules?.length&&!c.some(m=>m.dial.startsWith(b)),He=ht?null:se?se.lengths.includes(j.length)?u.dial+j:null:he&&!b.startsWith("+")?null:tn(b,I?null:u),Ee=!e.needsPhone||He!==null,Te=s((m,h=!1)=>{d(()=>e.send({...e.needsPhone&&(!h||b!==f)?{phone:He??b}:{},...m!==void 0?{channel:m}:{}}))},"send"),St=s(m=>{d(()=>e.verify(m))},"submitCode"),kt=s(m=>{m.preventDefault(),J?St(W):w.length<=1&&Ee&&Te(w[0])},"onSubmit"),Lo=s(m=>{let h=m.target,te=m.nativeEvent.inputType,Y=Math.max(0,h.value.lastIndexOf("+")),ae=De(h.value.slice(Y)),ke=Ye(ae,c),be=De(h.value.slice(Y,h.selectionStart)).length,$e=ae,Pt=ae;if(G(!1),!ke&&(he||ae.startsWith("+")))Q&&v(!0);else{let ve=ke??u,Z=ke?ae.slice(ke.dial.length):ae;if(y(ve.code),v(!1),Z===j&&te?.startsWith("delete")&&(te.endsWith("Forward")||(be-=1),Z=Z.slice(0,be)+Z.slice(be+1)),ve.rule){let Ke=We(Z,ve.rule),_t=Z.length-Ke.length;be-=_t,Z=_t>0&&!ke&&j.length===Ke.length?j:Ke}Pt=ve.dial+Z,$e=ze(Z,ve.rule)}O(Pt),h.value=$e;let wt=no($e,be);h.setSelectionRange(wt,wt)},"onNumber"),Me=ht?a("otp.reason_otp_destination_not_allowed"):D&&se?a("otp.phoneLengthError",{digits:ro(se,a("otp.or"))}):"",bt=c.length>1||Q,ee=`${N}-phone`,vt=ao(e.codeExpiresAt,Ie),Se=ao(e.resendAvailableAt,Ie),Re=J&&e.codeExpiresAt!==void 0&&vt===0,Ue=s(m=>a(m==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[Oo,Vo]=a("otp.sentTo",{channel:Ue(e.channel)}).split("{number}"),Do=e.reason==="otp_mismatch"?F(T,{tone:"danger",children:[k("span",{children:a("otp.reason_otp_mismatch")}),k("span",{children:Ve(r,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Xo.has(e.reason)?k(T,{tone:"warning",children:k("span",{children:a(`otp.reason_${e.reason}`)})}):null,Ct=F(uo,{children:[Do,H!==null?k(T,{tone:"danger",children:k("span",{children:a(H)})}):null]});if(J){let m=w.length===0;return F("form",{className:`sekyro-step sekyro-otp${o?` ${o}`:""}`,"aria-labelledby":N,onSubmit:kt,noValidate:!0,children:[k(oe,{id:N,title:a("otp.verifyTitle"),lead:F(uo,{children:[Oo,k("bdi",{dir:"ltr",className:"sekyro-mono",children:e.sentToMasked}),Vo]})}),Ct,F("div",{className:"sekyro-field",children:[k("label",{className:"sekyro-label",htmlFor:`${N}-code`,children:a("otp.codeLabel")}),k(Kt,{id:`${N}-code`,value:W,invalid:e.reason==="otp_mismatch",onChange:h=>{C(h),h.length===6&&W.length!==6&&!E&&!e.attemptsExhausted&&St(h)}}),k("span",{className:`sekyro-help sekyro-otp-expiry${Re?" is-danger":""}`,"aria-hidden":!Re||void 0,children:Re?a("otp.expired"):a("otp.expiresIn",{time:Jo(vt)})})]}),k("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:Re?a("otp.expired"):""}),F(ne,{children:[k(P,{type:"submit",full:!0,disabled:E||W.length!==6||e.attemptsExhausted,"aria-busy":E||void 0,children:a("otp.verify")}),m?k("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:E||Se>0,onClick:()=>Te(void 0,!0),children:Se>0?a("otp.resendIn",{seconds:Se}):a("otp.resend")}):Se>0?k("p",{className:"sekyro-resend is-waiting",children:a("otp.resendIn",{seconds:Se})}):k("div",{className:"sekyro-resend-row",children:w.map(h=>k("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:E,onClick:()=>Te(h,!0),children:a("otp.resendBy",{channel:Ue(h)})},h))})]})]})}let Nt=on(r.locale);return F("form",{className:`sekyro-step sekyro-otp${o?` ${o}`:""}`,"aria-labelledby":N,onSubmit:kt,noValidate:!0,children:[k(oe,{id:N,title:a("otp.sendTitle"),lead:a("otp.sendDescription")}),Ct,e.needsPhone?F("div",{className:"sekyro-field",children:[k("label",{className:"sekyro-label",htmlFor:ee,children:a("otp.phoneLabel")}),F("div",{className:"sekyro-phone",dir:"ltr",children:[u===null||X&&!I?null:F("div",{className:"sekyro-phone__lead",children:[bt?F("select",{className:"sekyro-phone__country",dir:r.locale==="ar"?"rtl":"ltr","aria-label":`${a("otp.countryLabel")}: ${I?a("otp.otherCountry"):Nt(u)}`,value:I?po:u.code,onChange:m=>{G(!1);let h=c.find(te=>te.code===m.target.value);v(h===void 0),h!==void 0&&y(h.code),O(h===void 0?"":h.dial+(X?"":j))},children:[c.map(m=>k("option",{value:m.code,children:Nt(m)},m.code)),Q?k("option",{value:po,children:a("otp.otherCountry")}):null]}):null,F("span",{className:"sekyro-phone__dial",id:`${ee}-dial`,"aria-hidden":bt||void 0,children:[k("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:I?"🌐":jo(u.code)}),I?null:u.dial]})]}),k("input",{ref:ge,id:ee,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel","aria-describedby":`${X?"":`${ee}-dial ${ee}-hint `}${Me?`${ee}-error`:""}`.trim()||void 0,"aria-invalid":!!Me||void 0,placeholder:he?"+":void 0,value:X?b:ze(j,se),onChange:Lo,onKeyDown:m=>{m.key==="Enter"&&!Ee&&G(!0)},onBlur:m=>{m.relatedTarget?.tagName!=="SELECT"&&G(j!==""&&He===null)}})]}),X?null:k("span",{className:"sekyro-help",id:`${ee}-hint`,children:a("otp.phonePlaceholderGeneric")}),Me?k("span",{className:"sekyro-help is-danger",id:`${ee}-error`,role:"alert",children:Me}):null]}):k("p",{className:"sekyro-text-muted",children:a("otp.prefilledNotice")}),k(ne,{children:w.length>0?F("div",{className:"sekyro-actions__group",role:"group","aria-label":a("otp.chooseChannel"),children:[k("p",{className:"sekyro-label","aria-hidden":"true",children:a("otp.chooseChannel")}),w.map((m,h)=>k(P,{kind:h===0?"primary":"ghost",full:!0,disabled:E||!Ee,"aria-busy":h===0&&E||void 0,onClick:()=>Te(m),children:a("otp.sendBy",{channel:Ue(m)})},m))]}):k(P,{type:"submit",full:!0,disabled:E||!Ee,"aria-busy":E||void 0,children:a("otp.send")})})]})}s(Ze,"PhoneOtpStep");import{lazy as rn,Suspense as sn,useMemo as an,useState as ln}from"react";import{Component as nn}from"react";var qe=class qe extends nn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(qe,"LoadBoundary");var z=qe;import{jsx as pe,jsxs as pn}from"react/jsx-runtime";var cn={load:s(()=>import("../email-otp-view-YLMRRLC3.js"),"load")};function Je({locale:e,strings:t,...n}){let o=_(e,t),[l,i]=ln(0),r=an(()=>rn(()=>cn.load().then(c=>({default:c.EmailOtpView}))),[l]),a=pn(T,{tone:"danger",children:[pe("span",{children:o.t("errors.network_error")}),pe(P,{kind:"ghost",onClick:()=>i(c=>c+1),children:o.t("common.retry")})]});return pe(z,{fallback:a,children:pe(sn,{fallback:pe("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:pe(r,{...n,i18n:o})})},l)}s(Je,"EmailOtpStep");import{lazy as un,Suspense as dn,useMemo as mn,useState as fn}from"react";import{jsx as ue,jsxs as gn}from"react/jsx-runtime";var yn={load:s(()=>import("../eid-view-IMKKBPQV.js"),"load")};function Qe({locale:e,strings:t,...n}){let o=_(e,t),[l,i]=fn(0),r=mn(()=>un(()=>yn.load().then(c=>({default:c.EidView}))),[l]),a=gn(T,{tone:"danger",children:[ue("span",{children:o.t("errors.network_error")}),ue(P,{kind:"ghost",onClick:()=>i(c=>c+1),children:o.t("common.retry")})]});return ue(z,{fallback:a,children:ue(dn,{fallback:ue("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:ue(r,{...n,i18n:o})})},l)}s(Qe,"EidStep");import{useMemo as Nn}from"react";import{lazy as hn,Suspense as Sn,useMemo as kn,useState as bn}from"react";import{jsx as de,jsxs as Cn}from"react/jsx-runtime";var vn={load:s(()=>import("../flow-views-HFQJ45NS.js"),"load")};function A({view:e,i18n:t,quiet:n,...o}){let[l,i]=bn(0),r=kn(()=>hn(()=>vn.load().then(c=>({default:c[e]}))),[e,l]),a=Cn(T,{tone:"danger",children:[de("span",{children:t.t("errors.network_error")}),de(P,{kind:"ghost",onClick:()=>i(c=>c+1),children:t.t("common.retry")})]});return de(z,{fallback:a,children:de(Sn,{fallback:n===!0?null:de("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:de(r,{...o,i18n:t})})},l)}s(A,"Flow");import{jsx as Xe,jsxs as Pn}from"react/jsx-runtime";function je({step:e,locale:t,strings:n,className:o,onError:l}){let i=_(t,n),{busy:r,error:a,run:c}=qt(i,l),f=Nn(()=>e.choice.options.flatMap(y=>{let g=Zt(y,i),u=Yt[y.service];return g===null?[]:[{id:y.id,label:g,glyph:u&&Xe(q,{name:u})}]}),[e.choice.options,i]),S=e.choice.options.find(y=>y.service==="national_eid");return Pn("div",{className:o,children:[Xe(Dt,{title:i.t("method.title"),description:i.t("method.description"),options:f,busy:r,error:a,focus:!0,testId:"sekyro-method",onChoose:y=>c(()=>e.choose(y))}),S?.nationalEid?.afterPass==="continue"?Xe(A,{view:"EidContinueHint",i18n:i,provider:S.nationalEid.providerName,quiet:!0}):null]})}s(je,"MethodChoice");import{isValidNni as wn,normalizeNni as mo}from"@sekyro/web";import{useId as _n,useState as et}from"react";import{Fragment as Tn,jsx as L,jsxs as me}from"react/jsx-runtime";var xn=new Set(["nni_not_found","registry_record_not_found"]),In=new Set(["nni_invalid","id_number_invalid"]);function Be({step:e,locale:t,strings:n,className:o,onError:l}){let i=_(t,n),{t:r}=i,[a,c]=et(""),[f,S]=et(!1),[y,g]=et(null),u=_n(),x=e.attemptsExhausted,b=s(async M=>{S(!0),g(null);try{await M()}catch(H){g(ce(H,i.strings)),l?.(H)}finally{S(!1)}},"run"),O=s(M=>{if(M.preventDefault(),e.source!=="typed"){b(()=>e.confirm());return}let H=mo(a);if(!/^\d{10}$/.test(H))return g("population.invalid");if(!wn(H))return g("population.reason_id_number_invalid");b(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(H):e.submitNni(H))},"onSubmit"),I=Ve(i,e.attemptsRemaining,x),v=e.reason!==void 0&&xn.has(e.reason),D=e.reason!==void 0&&In.has(e.reason),G=me(Tn,{children:[e.reason==="registry_unavailable"?me(T,{tone:"warning",children:[L("span",{children:r("population.reason_registry_unavailable")}),L("span",{children:I})]}):null,v&&e.canUseDocument?me(T,{tone:"warning",children:[L("span",{children:r("population.reason_registry_record_not_found_or_document")}),L("span",{children:I}),L(P,{kind:"ghost",disabled:f,onClick:()=>{b(()=>e.useDocument())},children:r("population.useDocument")})]}):null,v&&!e.canUseDocument||D?me(T,{tone:"danger",children:[L("span",{children:r(v?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),L("span",{children:I})]}):null,x&&e.reason===void 0?L(T,{tone:"danger",children:L("span",{children:I})}):null,y!==null?L(T,{tone:"danger",children:L("span",{children:r(y)})}):null]}),[W,C,E]=e.source==="document"?["population.fromDocument.title","population.fromDocument.description","population.fromDocument.continue"]:e.source==="bound"?["session.steps.population.title","population.bound.description","population.bound.confirm"]:e.recheck?["population.recheck.title","population.recheck.description","population.submit"]:["session.steps.population.title","session.steps.population.description","population.submit"];return me("form",{className:`sekyro-step${o?` ${o}`:""}`,"aria-labelledby":u,onSubmit:O,noValidate:!0,children:[L(oe,{id:u,title:r(W),lead:r(C)}),G,e.source==="typed"?me("div",{className:"sekyro-field",children:[L("label",{className:"sekyro-label",htmlFor:`${u}-id-number`,children:r("population.label")}),L("input",{id:`${u}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:r("population.placeholder"),value:a,"aria-describedby":`${u}-id-number-help`,"aria-invalid":y==="population.invalid"||y==="population.reason_id_number_invalid"||void 0,onChange:M=>{g(null),c(mo(M.target.value).replace(/\D/g,"").slice(0,10))}}),L("span",{id:`${u}-id-number-help`,className:"sekyro-help",children:r("population.helper")})]}):null,L(ne,{children:x?null:L(P,{type:"submit",full:!0,disabled:f,"aria-busy":f||void 0,children:r(E)})})]})}s(Be,"IdNumberEntry");function En(e){return Be(e)}s(En,"NniEntry");import{acceptedIssuers as Vn,acceptedTypesFor as So,warmDocumentCapture as Dn}from"@sekyro/web";import{lazy as Bn,Suspense as Fn,useEffect as Hn,useMemo as Un,useState as nt}from"react";import{acceptedIssuers as Mn,acceptedTypesFor as tt}from"@sekyro/web";import{useEffect as fo,useId as Rn,useMemo as yo,useState as ot}from"react";import{jsx as V,jsxs as fe}from"react/jsx-runtime";var go=s(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),An=s(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),Ln=220;function On(e,t,n=[]){let o=null;try{o=new Intl.DisplayNames([e],{type:"region"})}catch{}let l=t.map(a=>({code:a,name:o?.of(a)??a})),i=new Intl.Collator(e),r=s(a=>{let c=n.indexOf(a);return c<0?n.length:c},"rank");return l.sort((a,c)=>r(a.code)-r(c.code)||i.compare(a.name,c.name))}s(On,"countryNames");function ho({step:e,i18n:t,issuer:n,onPicked:o,ageStepUp:l=!1}){let{t:i,locale:r}=t,a=yo(()=>Mn(e.documents),[e.documents]),c=yo(()=>On(r,a,Object.keys(e.documents.byIssuer??{})),[r,a,e.documents]),f=a.length===1?a[0]:null,[S,y]=ot(n??f),[g,u]=ot(""),[x,b]=ot(null),O=Rn(),I=f===null?[]:tt(e.documents,f),v=f!==null&&I.length===1?I[0]:null;fo(()=>{f!==null&&v!==null&&e.selectDocument(f,v)},[f,v]);let D=s((C,E)=>{e.selectDocument(C,E),o?.()},"pick"),G=s(C=>{let E=tt(e.documents,C);E.length===1?D(C,E[0]):y(C)},"chooseIssuer");if(fo(()=>{if(x===null||S===null)return;let C=setTimeout(()=>D(S,x),Ln);return()=>clearTimeout(C)},[x]),v!==null)return null;if(S===null){let C=go(g.trim()),E=C===""?c:c.filter(M=>go(M.name).includes(C)||M.code.toLowerCase()===C);return fe("section",{className:"sekyro-step",children:[V(oe,{title:i("doc.countryTitle"),lead:i(l?"doc.ageStepUp":"doc.pickDescription")}),fe("div",{className:"sekyro-field",children:[V("label",{className:"sekyro-label",htmlFor:O,children:i("doc.countryLabel")}),V("input",{id:O,type:"search",className:"sekyro-input",placeholder:i("doc.countrySearch"),value:g,onChange:M=>u(M.target.value)})]}),E.length===0?V("p",{className:"sekyro-text-muted",children:i("doc.noCountryMatch")}):V("ul",{className:"sekyro-rows",children:E.map(M=>V("li",{children:fe("button",{type:"button",className:"sekyro-row-btn",onClick:()=>G(M.code),children:[V("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:An(M.code)}),M.name]})},M.code))}),V(ne,{children:null})]})}let W=tt(e.documents,S);return fe("section",{className:"sekyro-step",children:[V(oe,{title:i("doc.pickTitle"),lead:i(l&&f!==null?"doc.ageStepUp":"native.doc.holdIt")}),V("div",{className:"sekyro-choices",children:W.map(C=>fe("button",{type:"button",className:"sekyro-card","aria-pressed":x===C,disabled:x!==null&&x!==C,onClick:()=>b(C),children:[V(q,{name:C==="passport"?"passport":"card"}),fe("span",{className:"sekyro-card__body",children:[V("span",{className:"sekyro-card__title",children:i(`doc.type.${C}`)}),V("span",{className:"sekyro-card__sub",children:i(`doc.sub.${C}`)})]}),V("span",{className:"sekyro-radio","aria-hidden":"true"})]},C))}),a.length>1?V("button",{type:"button",className:"sekyro-link",onClick:()=>{y(null),b(null)},children:i("native.doc.changeCountry")}):null,V(ne,{children:null})]})}s(ho,"DocumentPicker");import{jsx as re,jsxs as Kn}from"react/jsx-runtime";var $n={load:s(()=>import("../document-capture-view-PUGWMQAP.js"),"load")};function rt({step:e,locale:t,strings:n,className:o,liveMrz:l}){let i=_(t,n),[r,a]=nt(0),[c,f]=nt(null),S=Vn(e.documents),y=S.length>1,g=e.issuer!==null&&So(e.documents,e.issuer).length>1,u=e.documentType===null||e.issuer===null||c!==null,x=S.length===1&&So(e.documents,S[0]).length===1,[b]=nt(()=>u&&!x),O=e.ageStepUp===!0,I=Un(()=>Bn(()=>$n.load().then(D=>({default:D.DocumentCaptureView}))),[r]);Hn(()=>{Dn()},[]);let v=Kn(T,{tone:"danger",children:[re("span",{children:i.t("errors.network_error")}),re(P,{kind:"ghost",onClick:()=>a(D=>D+1),children:i.t("doc.retryCamera")})]});return re("div",{className:o,children:u?re(ho,{step:e,i18n:i,ageStepUp:O&&c===null&&b,...c==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>f(null)}):re(z,{fallback:v,children:re(Fn,{fallback:re("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:i.t("common.loading")}),children:re(I,{step:e,i18n:i,ageLead:O&&!b,liveMrz:l,...y?{onChangeCountry:s(()=>f("country"),"onChangeCountry")}:{},...g?{onChangeDocument:s(()=>f("document"),"onChangeDocument")}:{}})})},r)})}s(rt,"DocumentCapture");import{warmPortraitCapture as Gn}from"@sekyro/web";import{Component as Wn,lazy as zn,Suspense as Yn,useEffect as Zn,useMemo as qn,useState as Jn}from"react";import{jsx as R,jsxs as it}from"react/jsx-runtime";var Qn={load:s(()=>import("../portrait-capture-view-M5OLPMMO.js"),"load")},lt=class lt extends Wn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(lt,"LoadBoundary");var st=lt;function Xn({step:e,i18n:t}){let{t:n}=t,o=le();return it("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[R("h2",{ref:o,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?R("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?it(T,{tone:"danger",children:[R("span",{children:n("portrait.uploadFailed")}),R(P,{kind:"ghost",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):R("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}s(Xn,"MatchPhase");function at({step:e,locale:t,strings:n,className:o,assetBaseUrl:l,verification:i}){let r=_(t,n),a=Bt(i),[c,f]=Jn(0),S=qn(()=>zn(()=>Qn.load().then(u=>({default:u.PortraitCaptureView}))),[c]);if(Zn(()=>{e.phase==="capture"&&Gn()},[e.phase]),e.phase==="match")return R("div",{className:o,children:R(Xn,{step:e,i18n:r})});let y=R("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")});if(!a.settled)return R("div",{className:o,children:y});if(a.session==="choice"&&a.choice===null)return R("div",{className:o,children:R(Mt,{value:u=>r.t(u),children:R(Ot,{onChoose:a.choose})})});let g=it(T,{tone:"danger",children:[R("span",{children:r.t("errors.network_error")}),R(P,{kind:"ghost",onClick:()=>f(u=>u+1),children:r.t("portrait.retryCamera")})]});return R("div",{className:o,children:R(st,{fallback:g,children:R(Yn,{fallback:y,children:R(S,{step:e,i18n:r,...l!==void 0?{assetBaseUrl:l}:{}})})},c)})}s(at,"PortraitCapture");import{cameraUnavailableCauseOf as gr}from"@sekyro/web";import{useCallback as _e,useEffect as Ro,useId as hr,useMemo as Sr,useRef as mt,useState as xe}from"react";var Pe={light:{danger:{base:"#ca0f07",soft:"#ffdada",fg:"#ca0f07",on:"#ffffff"},success:{base:"#007a5e",soft:"#d5f0e8",fg:"#005341",on:"#ffffff"},warning:{base:"#ffab00",soft:"#fff7e6",fg:"#735003",on:"#191a1b"},info:{base:"#0563d4",soft:"#d3e5ff",fg:"#064da5",on:"#ffffff"}},dark:{danger:{base:"#ff7c7c",soft:"#9c1008",fg:"#ffbbbb",on:"#030303"},success:{base:"#00c897",soft:"#002c23",fg:"#53ffd4",on:"#030303"},warning:{base:"#ffbb2e",soft:"#463102",fg:"#ffd98a",on:"#030303"},info:{base:"#5da9ff",soft:"#063778",fg:"#acd0ff",on:"#030303"}}},jn=["danger","success","warning","info"];function ct(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}s(ct,"channel");function ko(e){let t=ct(parseInt(e.slice(1,3),16)),n=ct(parseInt(e.slice(3,5),16)),o=ct(parseInt(e.slice(5,7),16));return .2126*t+.7152*n+.0722*o}s(ko,"luminance");function er(e,t){let n=ko(e),o=ko(t),l=Math.max(n,o),i=Math.min(n,o);return(l+.05)/(i+.05)}s(er,"contrastRatio");function bo(e,t){return Math.min(...jn.map(n=>er(Pe[e][n].fg,t)))}s(bo,"worstAgainst");function vo(e,t,n){return Math.min(bo(e,t),bo(e,n))}s(vo,"worstStatusContrast");function Co(e,t){return vo("light",e,t)>=vo("dark",e,t)?"light":"dark"}s(Co,"statusSchemeFor");import{useId as tr,useState as or}from"react";import{jsx as Fe,jsxs as No}from"react/jsx-runtime";var nr=["intro","data","processing","sharing","retention"];function Po({i18n:e,purpose:t="identity"}){let{t:n}=e,[o,l]=or(!1),i=tr(),[r,a=""]=n("consent.short").split("{terms}");return No("section",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-consent",children:[No("p",{className:"sekyro-text-muted",children:[r,Fe("button",{type:"button",className:"sekyro-link","aria-expanded":o,"aria-controls":i,onClick:()=>l(c=>!c),children:n("consent.termsLink")}),a]}),Fe("div",{id:i,hidden:!o,className:"sekyro-stack sekyro-stack--1 sekyro-text-muted","data-testid":"sekyro-consent-terms",children:t==="human"?Fe(A,{view:"HumanConsentTerms",i18n:e,quiet:!0}):nr.map(c=>Fe("p",{children:n(`consent.terms.${c}`)},c))})]})}s(Po,"ConsentNotice");function wo(e){let t=e.trim().split(/\s+/).filter(o=>o!=="");return(t.length>=2?[t[0],t[1]].map(o=>Array.from(o??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}s(wo,"initials");import{useSyncExternalStore as rr}from"react";var Io=s(e=>({colors:{...e?B.dark:B.light},radius:B.radiusLg,fontFamily:B.font}),"brandTheme"),Ri=Io(!1),_o=/^#[0-9a-f]{6}$/i;function pt(e,t,n){if(t)return null;let o=Ce(e).colors,l=n?.colors?.bg??o?.bg,i=n?.colors?.surface??o?.surface;return l===void 0&&i===void 0||l!==void 0&&!_o.test(l)||i!==void 0&&!_o.test(i)?null:Co(l??B.light.bg,i??B.light.surface)}s(pt,"partnerStatusScheme");function Eo(e,t,n){let o=Ce(e);if(n&&o.colors!==void 0){let{brand:l,brandFg:i}=o.colors;l!==void 0&&lr(l,B.dark.bg)>=3?o.colors={brand:l,ring:l,...i!==void 0?{brandFg:i}:{}}:delete o.colors}if(pt(e,n,t)==="dark"){let l=Pe.dark;o.colors={...o.colors,danger:l.danger.base,success:l.success.base,warning:l.warning.fg}}return Le(Io(n),o,Ht(t))}s(Eo,"verificationTheme");function To(e){let t=rr(ar,ir,()=>!1);return e==="dark"||e==="system"&&t}s(To,"useDarkScheme");var sr="(prefers-color-scheme: dark)",Mo=s(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(sr):null,"media"),ir=s(()=>Mo()?.matches??!1,"prefersDark");function ar(e){let t=Mo();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}s(ar,"subscribe");function lr(e,t){let[n,o]=[xo(e),xo(t)];return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}s(lr,"contrast");function xo(e){let t=[1,3,5].map(n=>{let o=Number.parseInt(e.slice(n,n+2),16)/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}s(xo,"luminance");import{useEffect as cr,useId as pr,useState as ur}from"react";import{jsx as $,jsxs as we}from"react/jsx-runtime";var dr=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),mr={approved:"M6.5 12.5l3.6 3.6 7.4-8.2",review:"M12 7v5l3.2 2",expired:"M8 5h8M8 19h8M9 5c0 4 6 5 6 7s-6 3-6 7M15 5c0 4-6 5-6 7s6 3 6 7",rejected:"M8 8l8 8M16 8l-8 8"};function fr({outcome:e}){return we("svg",{className:`sekyro-outcome sekyro-outcome--${e}`,viewBox:"0 0 136 136","aria-hidden":"true",focusable:"false",children:[$("circle",{className:"sekyro-outcome__ring",cx:"68",cy:"68",r:"57",pathLength:"1"}),$("circle",{className:"sekyro-outcome__disc",cx:"68",cy:"68",r:"48"}),$("path",{className:"sekyro-outcome__glyph",d:mr[e],pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]})}s(fr,"OutcomeMark");function yr({label:e,id:t,copied:n}){let[o,l]=ur(!1);return cr(()=>{if(!o)return;let i=setTimeout(()=>l(!1),1600);return()=>clearTimeout(i)},[o]),we("button",{type:"button",className:`sekyro-reference${o?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>l(!0),()=>{})},children:[$("span",{"aria-live":"polite",children:o?n:e}),$("bdi",{dir:"ltr",children:t}),$(q,{name:"copy"})]})}s(yr,"ReferenceLine");function ut({step:e,locale:t,strings:n,className:o,onClose:l}){let i=_(t,n),{t:r}=i,a=pr(),c=le(),f=e.context.orgName,S=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",y;switch(e.display){case"policy_stop":{let g=e.failureReason??"";if(dr.has(xt(g)))y=r("session.result.detailsMismatch",{org:f});else if(g==="device_velocity_exceeded")y=r("session.result.deviceVelocity",{org:f});else if(g==="capture_tampered")y=r("session.result.deviceStop");else if(g==="camera_unavailable")y=r("reasons.camera_unavailable",{org:f});else if(g==="underage_estimated")y=r("reasons.underage_estimated");else if(g==="starter_credit_claimed")y=r("reasons.starter_credit_claimed");else{let u=Et(g);y=u!==null?r(u,{org:f}):r("session.result.rejected.description")}break}case"cooldown":{let g=Tt(i.locale,e.retryAfter);y=g!==null?r(g.key,{time:g.time}):r("reasons.device_cooldown");break}case"platform_unsupported":y=r("result.platform_unsupported");break;case"attempts_exhausted":y=r("common.noAttemptsLeft");break;default:y=f!==""?r(`native.result.${S}`,{org:f}):r(`session.result.${S}.description`)}return we("section",{className:`sekyro-result${o?` ${o}`:""}`,"aria-labelledby":a,"data-testid":"sekyro-result",children:[we("div",{className:"sekyro-result__body",children:[$(fr,{outcome:e.display==="cooldown"?"review":S}),we("div",{className:"sekyro-heading",children:[$("h2",{id:a,ref:c,tabIndex:-1,className:"sekyro-text-body",children:r(`session.result.${S}.title`)}),$("p",{className:"sekyro-text-muted",children:y})]}),$(yr,{label:r("result.referenceLabel"),id:e.context.sessionId,copied:r("native.result.copied")})]}),l!==void 0?$("div",{className:"sekyro-actions",children:$(P,{full:!0,onClick:l,children:f!==""?r("native.result.back",{org:f}):r("native.close")})}):null]})}s(ut,"VerificationResultScreen");import{Fragment as dt,jsx as p,jsxs as K}from"react/jsx-runtime";function kr(e,t,n){let o=t?B.dark:B.light,l=t?B.roles.dark:B.roles.light,i=e.colors??{},r={},a=i.fg===o.fg&&i.surface===o.surface;if(i.brand===o.brand&&i.surface===o.surface&&(r["--sekyro-color-brand-soft"]=l.brandSoft),a&&(r["--sekyro-color-line"]=l.line,r["--sekyro-color-line-subtle"]=l.lineSubtle,r["--sekyro-color-line-strong"]=l.lineStrong,r["--sekyro-color-sunken"]=l.sunken),i.fgMuted===o.fgMuted&&i.surface===o.surface&&(r["--sekyro-color-fg-subtle"]=l.fgSubtle),e.fontFamily===B.font&&(r["--sekyro-font-display"]=B.fontDisplay),n!==null){let c=Pe[n];r["--sekyro-color-danger-soft"]=c.danger.soft,r["--sekyro-color-success-soft"]=c.success.soft,r["--sekyro-color-warning-soft"]=c.warning.soft}return r}s(kr,"flowRoles");function ft(e){let{verification:t,locale:n,strings:o,onStep:l,onResult:i}=e,{step:r,error:a}=Ge(t);Ro(()=>{r!==null&&l?.(r)},[r,l]),Ro(()=>i===void 0?void 0:t.on("result",i),[t,i]);let c=To(e.colorScheme??"light"),f=r?.context.branding,S=Eo(f,e.theme,c),[y,g]=xe(!1),u=`sekyro-verification${c?" sekyro-verification--dark":""}${y?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,x=mt(e.onClose);x.current=e.onClose;let b=mt(r);b.current=r;let O=_e(()=>{let v=b.current;x.current?.(v?.kind==="result"?{reason:"finished",result:v.result}:{reason:"cancelled"})},[]),I=Sr(()=>t.reportCaptureIssue===void 0?null:v=>t.reportCaptureIssue?.(v),[t]);return p($t,{theme:S,className:u,children:p(Ne,{locale:n,...o!==void 0?{strings:o}:{},children:p("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:kr(S,c,pt(f,c,e.theme)),children:p(Gt.Provider,{value:g,children:p(Oe.Provider,{value:e.onClose!==void 0?O:void 0,children:p(At.Provider,{value:I,children:p(Cr,{...e,step:r,error:a,immersive:y})})})})})})})}s(ft,"SekyroVerification");function br(e,t){if(t===void 0)return null;let n=e,o=n[`session.processing.${t}.title`],l=n[`session.processing.${t}.description`];return typeof o=="string"&&o!==""&&typeof l=="string"&&l!==""?{title:o,description:l}:null}s(br,"processingCopyOf");function vr({error:e,retry:t}){let{t:n}=_(),o=le();return K(Ae,{tone:"danger",testId:"sekyro-error-notice",children:[p("span",{children:n(It(e.kind))}),e.retryable?p(P,{ref:o,kind:"ghost",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}s(vr,"CameraErrorNotice");function Cr(e){let{step:t,error:n,slots:o,immersive:l}=e,i=_(),{t:r}=i,[a,c]=xe(!1),[f,S]=xe(0),[y,g]=xe(null),u=t?.context.purpose??"identity",x=e.verification,b=u==="human"||t?.context.cameraUnavailableHandled===!0,O=x.reportCameraUnavailable!==void 0&&b?d=>x.reportCameraUnavailable?.(d)??Promise.resolve():void 0,I=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,v=e.handoffUrl,D=_e((d,w)=>O===void 0?void 0:p(A,{view:"NoCameraView",i18n:i,quiet:!0,cause:w,onRetry:d,...I?{onContinue:O}:{},...v!==void 0?{handoffUrl:v}:{}}),[i,x,b,I,v]),G=_e((d,w)=>p(Jt,{start:d,context:w,human:u==="human",extra:w.canChooseFacing&&p(Vt,{value:w.facing,onChange:w.setFacing}),notice:w.permissionSettled&&w.permission==="denied"?D(d,"denied"):void 0}),[u,D]),W=_e((d,w)=>{let Q=gr(d.kind);return(Q!==void 0?D(w,Q):void 0)??K(dt,{children:[p(vr,{error:d,retry:w}),Q!==void 0&&v!==void 0?p(A,{view:"DesktopHandoffView",i18n:i,quiet:!0,url:v}):null]})},[D,v,i]),C=mt(""),E=e.livenessProps?.slots?.stageOverlay,M=_e(d=>(d.guidance!==""&&!d.coached&&(C.current=d.guidance),p(Qt,{testId:"sekyro-capture-stage",video:p("video",{ref:d.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:d.guidance!==""?d.guidance:C.current,note:d.note,busy:d.settled,progress:d.phase==="seeking"||d.phase==="aligning"?d.progress:1,still:d.still,live:d.live,closeLabel:r("native.close"),overlay:E?.(d.videoRef),ramp:d.ramp?.colour??null,...d.settled?{}:{onClose:s(()=>S(w=>w+1),"onClose")},end:d.switchCamera&&p("button",{type:"button",className:"sekyro-glass",onClick:d.switchCamera,"aria-label":r("capture.switchCamera"),children:p(Rt,{})})})),[r,E]),H=hr();if(n!==null)return p(Ae,{tone:"danger",children:p("span",{children:r(ce(n,i.strings))})});if(t===null)return p("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r("common.loading")});let{context:U}=t,J=s(d=>{c(!0),d().finally(()=>c(!1))},"refresh"),Ie=o?.header??p(Pr,{context:U,headerId:H,end:o?.headerEnd}),N,ge=y===t.key&&t.context.switchable!==void 0;if(ge)N=p(A,{view:"LaneChoiceView",i18n:i,step:t,onClose:()=>g(null)});else switch(t.kind){case"phone_otp":N=p(Ze,{step:t});break;case"email_otp":N=p(Je,{step:t});break;case"method":N=p(je,{step:t});break;case"registry":N=p(Be,{step:t});break;case"document":N=p(rt,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let d=e.livenessProps?.slots?.intro,w={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:d??G,...d===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:W}:{}},...f>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:i.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};N=p(Lt.Provider,{value:M,children:t.instructions==="icao"||t.livePhoto?.icao===!0?p(A,{view:"LivePhotoLiveness",i18n:i,step:t,livenessProps:w,sekyroIntro:d===void 0},f):p(Ft,{...w},f)});break}case"portrait":N=K(dt,{children:[t.retakeOnly?p(A,{view:"PortraitRetakeNotice",i18n:i,quiet:!0}):null,p(at,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":N=p(A,{view:"ContactChoiceView",i18n:i,step:t});break;case"choice":N=p(A,{view:"GenericChoiceView",i18n:i,step:t});break;case"identity_summary":N=p(A,{view:"IdentitySummaryView",i18n:i,step:t});break;case"mobile_required":N=e.handoffUrl!==void 0?p(A,{view:"HandoffView",i18n:i,url:e.handoffUrl,refresh:t.refresh}):K(Ae,{tone:"info",children:[p("strong",{children:r("handoff.title")}),p("span",{children:r("reasons.mobile_required")}),p(P,{kind:"ghost",disabled:a,onClick:()=>J(t.refresh),children:r("common.refresh")})]});break;case"processing":{let d=br(i.strings,t.service);N=K("section",{className:"sekyro-stack sekyro-stack--1",role:"status","aria-live":"polite",children:[p("h2",{className:"sekyro-text-body",children:d?.title??r("session.processing.title")}),p("p",{className:"sekyro-text-muted",children:d?.description??r("session.processing.description")}),t.stalled?p(P,{kind:"ghost",disabled:a,onClick:()=>J(t.refresh),children:r("common.refresh")}):null]});break}case"eid":N=p(Qe,{step:t});break;case"unsupported":{let d=t.reason==="platform_unsupported";N=K("section",{className:"sekyro-stack sekyro-stack--1",children:[p("h2",{className:"sekyro-text-body",children:r(d?"needsApp.title":"unsupported.title")}),p("p",{children:d?U.orgName!==""?r("needsApp.description",{org:U.orgName}):r("needsApp.descriptionNoOrg"):r("unsupported.description",{org:U.orgName})})]});break}case"result":N=o?.result?.(t)??p(Nr,{step:t});break;default:{let d=t;N=null}}return K(dt,{children:[l?null:Ie,!l&&t.kind!=="result"&&U.sections.length>1?p(wr,{context:U,current:t.section,i18n:i}):null,!l&&!U.consentRecorded&&t.kind!=="result"?p(Po,{i18n:i,purpose:U.purpose}):null,p(Wt,{pageKey:t.key,children:N}),!l&&!ge&&t.kind!=="result"&&t.context.switchable!==void 0?p(A,{view:"LaneSwitch",i18n:i,step:t,onOpen:()=>g(t.key),quiet:!0},t.key):null,l?null:o?.footer!==void 0?o.footer:U.branding?.hideAttribution===!0?null:K("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[p(q,{name:"lock"}),r("shell.verifiedBy")]})]})}s(Cr,"Body");function Nr({step:e}){return p(Oe.Consumer,{children:t=>p(ut,{step:e,...t!==void 0?{onClose:t}:{}})})}s(Nr,"ResultPage");function Pr({context:e,headerId:t,end:n}){let{t:o}=_(),[l,i]=xe(!1),r=l?void 0:e.branding?.logoUrl,a=e.orgName!==""?e.orgName:o(e.returning?"returning.title":"session.title");return K("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:[K("div",{className:"sekyro-org",children:[p("span",{className:"sekyro-org__tile","aria-hidden":"true",children:r!==void 0?p("img",{className:"sekyro-org__logo",src:r,alt:"",onError:()=>i(!0)}):wo(e.orgName)}),K("div",{className:"sekyro-org__text",children:[p("h1",{id:t,className:"sekyro-org__name",children:a}),p("p",{className:"sekyro-org__sub",children:o(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),n!=null?p("div",{className:"sekyro-org__end",children:n}):null,p(Oe.Consumer,{children:c=>c!==void 0?p("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":o("native.close"),onClick:c,children:p(q,{name:"close"})}):null})]}),e.returning?p("p",{className:"sekyro-text-muted",children:o("returning.description")}):null]})}s(Pr,"OrgHeader");function wr({context:e,current:t,i18n:n}){let o=t===null?-1:e.sections.indexOf(t),l=e.progress,i=l!==void 0&&l.length===e.sections.length?l:e.sections.map((r,a)=>({id:r,state:a<o?"done":a===o?"current":"upcoming"}));return p("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:i.map(({id:r,state:a})=>p("li",{className:`sekyro-progress__bar${a==="done"?" is-done":a==="current"?" is-current":""}`,...a==="current"?{"aria-current":"step"}:{},children:p("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${r}`]??r})},r))})}s(wr,"SectionProgress");import{useEffect as xr,useState as Ao}from"react";var _r=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function yt(e){let t=e??(typeof navigator>"u"?"":String(navigator.userAgent??""));return _r.test(t)}s(yt,"isInAppBrowser");import{jsx as ye}from"react/jsx-runtime";function Ir(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}s(Ir,"pageUrl");function Er({hostedUrl:e,inAppBrowser:t,...n}){let[o,l]=Ao(t===!0);xr(()=>{t===void 0&&yt()&&l(!0)},[t]);let[i,r]=Ao(!1),a=n.handoffUrl??e??Ir();return o&&!i?ye(Ut,{theme:Le(Ce(void 0),n.theme),...n.className!==void 0?{className:n.className}:{},children:ye(Ne,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:ye("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-stack sekyro-stack--4",children:ye(Tr,{url:a,onContinue:()=>r(!0)})})})}):ye(ft,{...n,...a!==""?{handoffUrl:a}:{}})}s(Er,"SekyroFlow");function Tr({url:e,onContinue:t}){let n=_();return ye(A,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}s(Tr,"Prompt");export{rt as DocumentCapture,Qe as EidStep,Je as EmailOtpStep,Be as IdNumberEntry,je as MethodChoice,En as NniEntry,Ze as PhoneOtpStep,at as PortraitCapture,Er as SekyroFlow,ft as SekyroVerification,Ne as StepI18nProvider,ut as VerificationResultScreen,Ho as arSteps,Uo as enSteps,Ko as formatTemplate,$o as frSteps,yt as isInAppBrowser,Bo as loadSekyroLocale,Go as resolveSekyroStrings,Fo as retakeHintStringKey,_ as useStepI18n,Ge as useVerificationStep};
|
|
2
|
+
import{a as xo}from"../chunk-LPGHMDD4.js";import{a as K,d as fo,e as ut,f as qe,g as mo,h as yo}from"../chunk-Z7US4CLZ.js";import{a as go,b as ho,c as Co}from"../chunk-GUTF3SPK.js";import{a as No,b as wo,c as Po,d as _o,e as pt,g as Xe}from"../chunk-JT7YHK7F.js";import{b as so,c as io,d as ao,e as lo,f as co,h as uo,k as po}from"../chunk-DY5WQVPE.js";import{b as no}from"../chunk-6I7GU4FS.js";import{a as ro}from"../chunk-7MMT5M4E.js";import{a as ke}from"../chunk-VRDPGOXM.js";import{a as bn,b as vn,c as Cn,d as Nn,e as wn,f as Ae,g as I}from"../chunk-XTQARDSJ.js";import{a as F,b as re,c as ko,d as se,e as So,f as Ze,g as Je,h as dt,i as bo,l as vo,m as O,n as Qe}from"../chunk-NV7HZJM4.js";import{c as oo}from"../chunk-A6UYUVEG.js";import{a as w,c as Xt,j as kn,l as Sn,m as jt,n as eo,o as to,q as ct,r as he}from"../chunk-25KWDPLY.js";import{a as s}from"../chunk-2KED7D2Q.js";import{useEffect as Pn,useState as Eo}from"react";function ft(e){let[t,n]=Eo(()=>e?.currentStep?.()??null),[o,l]=Eo(null);return Pn(()=>{if(e===void 0)return;if(typeof e.run!="function"){l(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let i=!0,r=e.on("step",a=>{i&&n(a)});return e.run().then(a=>{i&&n(u=>u??a)},a=>{i&&l(a)}),()=>{i=!1,r()}},[e]),{step:t,error:o}}s(ft,"useVerificationStep");import{useEffect as gt,useId as En,useMemo as In,useRef as ht,useState as oe}from"react";var _n="AC247 AD376 AE971/0 AF93/0 AG1/1 AI1/1 AL355/0 AM374/0 AO244 AR54/0 AS1/1 AT43/0 AU61/0 AW297 AX358/0 AZ994/0 BA387/0 BB1/1 BD880/0 BE32/0 BF226 BG359/0 BH973 BI257 BJ229 BL590/0 BM1/1 BN673 BO591/0 BQ599 BR55/0 BS1/1 BT975 BW267 BY375/8 BZ501 CA1/1 CC61/0 CD243/0 CF236 CG242 CH41/0 CI225 CK682 CL56 CM237 CN86/0 CO57/0 CR506 CU53/0 CV238 CW599 CX61/0 CY357 CZ420 DE49/0 DJ253 DK45 DM1/1 DO1/1 DZ213/0 EC593/0 EE372 EG20/0 EH212/0 ER291/0 ES34 ET251/0 FI358/0 FJ679 FK500 FM691 FO298 FR33/0 GA241 GB44/0 GD1/1 GE995/0 GF594/0 GG44/0 GH233/0 GI350 GL299 GM220 GN224 GP590/0 GQ240 GR30 GT502 GU1/1 GW245 GY592 HK852 HN504 HR385/0 HT509 HU36/06 ID62/0 IE353/0 IL972/0 IM44/0 IN91/0 IO246 IQ964/0 IR98/0 IS354 IT39 JE44/0 JM1/1 JO962/0 JP81/0 KE254/0 KG996/0 KH855/0 KI686/0 KM269 KN1/1 KP850/0 KR82/0 KW965 KY1/1 KZ7/8 LA856/0 LB961/0 LC1/1 LI423/0 LK94/0 LR231/0 LS266 LT370/0 LU352 LV371 LY218/0 MA212/0 MC377/0 MD373/0 ME382/0 MF590/0 MG261/0 MH692/1 MK389/0 ML223 MM95/0 MN976/0 MO853 MP1/1 MQ596/0 MR222 MS1/1 MT356 MU230 MV960 MW265/0 MX52 MY60/0 MZ258 NA264/0 NC687 NE227 NF672 NG234/0 NI505 NL31/0 NO47 NP977/0 NR674 NU683 NZ64/0 OM968 PA507 PE51/0 PF689 PG675 PH63/0 PK92/0 PL48 PM508/0 PR1/1 PS970/0 PT351 PW680 PY595/0 QA974 RE262/0 RO40/0 RS381/0 RU7/8 RW250/0 SA966/0 SB677 SC248 SD249/0 SE46/0 SG65 SH290 SI386/0 SJ47 SK421/0 SL232/0 SM378 SN221 SO252/0 SR597 SS211/0 ST239 SV503 SX1/1 SY963/0 SZ268 TA290 TC1/1 TD235 TG228 TH66/0 TJ992 TK690 TL670 TM993/8 TN216 TO676 TR90/0 TT1/1 TV688 TW886/0 TZ255/0 UA380/0 UG256/0 US1/1 UY598/0 UZ998 VA39 VC1/1 VE58/0 VG1/1 VI1/1 VN84/0 VU678 WF681 WS685 XK383/0 YE967/0 YT262/0 ZA27/0 ZM260/0 ZW263/0",Io;function To(e){return Io??(Io=new Map(_n.split(" ").map(t=>{let[n,o]=t.slice(2).split("/");return[t.slice(0,2),[n,o]]}))),Io.get(e.toUpperCase())}s(To,"entryOf");function Ro(e){return To(e)?.[0]}s(Ro,"dialCodeOf");function Lo(e){return To(e)?.[1]}s(Lo,"nationalPrefixOf");import{normalizeNni as xn}from"@sekyro/web";function je(e){let t=xn(e).replace(/\D/g,"");return/^\D*\+/.test(e)?`+${t}`:t.startsWith("00")?`+${t.slice(2)}`:t}s(je,"digitsOf");var mt=s((e,t)=>(t.trunk!==void 0&&e.startsWith(t.trunk)?e.slice(t.trunk.length):e).slice(0,Math.max(...t.lengths)),"fitDigits");function et(e,t){let n="",o=0;for(let l of t?.formats?.find(i=>new RegExp(`^(?:${i.leading})`).test(e))?.groups??[])o<e.length&&(n+=(o>0?" ":"")+e.slice(o,o+l)),o+=l;return n+e.slice(o)}s(et,"groupDigits");function Mo(e,t){let n=0;for(let o=t;o>0&&n<e.length;n+=1)e[n]!==" "&&(o-=1);return n}s(Mo,"caretAfter");var yt=s((e,t)=>t.find(n=>e.startsWith(n.dial)),"countryOfNumber"),Oo=s((e,t)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${t} $1`),"lengthsLabel");import{Fragment as Ho,jsx as v,jsxs as $}from"react/jsx-runtime";var Do=s((e,t,n)=>{if(e===void 0)return 0;let o=Date.parse(e)-t;return Number.isFinite(o)?Math.min(n,Math.max(0,Math.ceil(o/1e3))):0},"secondsUntil"),Tn=600,Rn=30,Ln=s(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),Mn=["whatsapp","sms"],Ao=new Set(["otp_daily_cap_reached","payment_method_required","spend_cap_reached","insufficient_balance","otp_expired","otp_send_failed","otp_channel_unavailable","otp_destination_not_allowed","otp_destination_unknown","otp_rate_limited","otp_resend_limit","otp_number_invalid","otp_number_not_mobile"]);function Fo(e){let t=je(e).replace("+","");return/^\d{8,15}$/.test(t)?`+${t}`:null}s(Fo,"normalizedPhone");var On=s(e=>String.fromCodePoint(...Array.from(e,t=>127397+t.charCodeAt(0))),"flagOf");function Dn(e){let t=[];for(let n of e.phoneCountries??["MR"]){let o=e.phoneRules?.find(i=>i.code===n),l=o?.dial??Ro(n);l!==void 0&&!t.some(i=>i.code===n)&&t.push({code:n,dial:`+${l}`,...o!==void 0?{rule:o}:{}})}return t}s(Dn,"phoneCountriesOf");function An(e,t){if(t===null||!e.startsWith(t.dial))return Fo(e);let n=e.slice(t.dial.length).replace(/\D/g,""),o=Lo(t.code);return o!==void 0&&n.startsWith(o)&&(n=n.slice(o.length)),Fo(t.dial+n)}s(An,"e164Of");var Bo=s((e,t)=>(yt(e,t)??t[0])?.code??null,"countryFor");function Fn(e){let t=null;try{t=new Intl.DisplayNames([e],{type:"region"})}catch{}return n=>`${t?.of(n.code)??n.code} (${n.dial})`}s(Fn,"countryLabels");var Vo="other";function kt({step:e,locale:t,strings:n,className:o,defaultPhone:l,onError:i}){let r=I(t,n),{t:a}=r,u=In(()=>Dn(e),[e.phoneCountries,e.phoneRules]),f=l??u[0]?.dial??"",[g,m]=oe(()=>Bo(f,u)),h=u.map(y=>y.code).join(",");gt(()=>{if(g===null||!u.some(y=>y.code===g)){let y=Bo(f,u);m(y);let N=x.current,q=u.find(Q=>Q.code===y)?.dial;q!==void 0&&L(Q=>N!==null&&Q.startsWith(N.dial)?q+Q.slice(N.dial.length):Q.startsWith("+")?Q:q)}},[h,f]);let d=u.find(y=>y.code===g)??null,x=ht(d);d!==null&&(x.current=d);let[k,L]=oe(f),[E,C]=oe(!1),[D,U]=oe(!1),[S,P]=oe(""),[_,M]=oe(!1),[A,ce]=oe(null),[xe,ue]=oe(!1),[Ee,He]=oe(null),de=ht(null),pe=e.phase==="verify"&&!xe,$e=e.phase==="verify",Ie=Co($e),[me,Ue]=go(e.reason==="otp_mismatch",e.attemptsRemaining,()=>P("")),X=En(),fe=ht(null);gt(()=>{let y=setTimeout(()=>fe.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(y)},[pe]);let Te=e.phase==="verify"?e.codeExpiresAt??"sent":null;gt(()=>{Te!==null&&(ue(!1),de.current!==null&&!Ao.has(e.reason??"")&&He(de.current),de.current=null)},[Te]);let W=s(async y=>{M(!0),ce(null);try{await y()}catch(N){ce(ke(N,r.strings)),i?.(N)}finally{M(!1)}},"run"),Z=Mn.filter(y=>(e.channels??[]).includes(y)),ye=e.phoneInternational===!0,T=E||d===null,z=T||k.startsWith("+")&&!k.startsWith(d.dial),Y=z?void 0:d.rule,p=z?k:k.replace(d.dial,"").replace(/\D/g,""),b=Y?mt(p,Y):p,J=z&&!T&&!ye&&e.phoneRules?.length&&!u.some(y=>y.dial.startsWith(k)),Ke=J?null:Y?Y.lengths.includes(b.length)?d.dial+b:null:T&&!k.startsWith("+")?null:An(k,E?null:d),Re=!e.needsPhone||Ke!==null,Ge=s((y,N=!1)=>{let q=e.needsPhone?N?Ee:{number:Ke??k,shown:z||d===null?Ke??k:`${d.dial} ${et(b,Y)}`}:null;de.current=q,W(async()=>{try{await e.send({...q!==null?{phone:q.number}:{},...y!==void 0?{channel:y}:{}})}catch(Q){throw de.current=null,Q}})},"send"),$t=s(y=>{W(()=>e.verify(y))},"submitCode"),Ut=s(y=>{y.preventDefault(),pe?$t(S):Z.length<=1&&Re&&Ge(Z[0])},"onSubmit"),mn=s(y=>{let N=y.target,q=y.nativeEvent.inputType,Q=Math.max(0,N.value.lastIndexOf("+")),ge=je(N.value.slice(Q)),Me=yt(ge,u),Oe=je(N.value.slice(Q,N.selectionStart)).length,at=ge,Zt=ge;if(U(!1),!Me&&(T||ge.startsWith("+")))ye&&C(!0);else{let De=Me??d,te=Me?ge.slice(Me.dial.length):ge;if(m(De.code),C(!1),te===b&&q?.startsWith("delete")&&(q.endsWith("Forward")||(Oe-=1),te=te.slice(0,Oe)+te.slice(Oe+1)),De.rule){let lt=mt(te,De.rule),Qt=te.length-lt.length;Oe-=Qt,te=Qt>0&&!Me&&b.length===lt.length?b:lt}Zt=De.dial+te,at=et(te,De.rule)}L(Zt),N.value=at;let Jt=Mo(at,Oe);N.setSelectionRange(Jt,Jt)},"onNumber"),We=J?a("otp.reason_otp_destination_not_allowed"):D&&Y?a("otp.phoneLengthError",{digits:Oo(Y,a("otp.or"))}):"",Kt=u.length>1||ye,ne=`${X}-phone`,it=Do(e.codeExpiresAt,Ie,Tn),Le=Do(e.resendAvailableAt,Ie,Rn),ze=pe&&e.codeExpiresAt!==void 0&&it===0,Gt=e.needsPhone&&!e.attemptsExhausted,Wt=$e&&(e.codeExpiresAt===void 0||it>0),zt=pe&&Gt?()=>ue(!0):xe&&Wt?()=>ue(!1):null;Ze(zt===null?null:_?()=>{}:zt);let Ye=s(y=>a(y==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[yn,gn]=a("otp.sentTo",{channel:Ye(e.channel)}).split("{number}"),hn=e.reason==="otp_mismatch"?$(O,{tone:"danger",children:[v("span",{children:a("otp.reason_otp_mismatch")}),v("span",{children:Qe(r,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Ao.has(e.reason)?v(O,{tone:"warning",children:v("span",{children:a(`otp.reason_${e.reason}`)})}):null,Yt=$(Ho,{children:[hn,A!==null?v(O,{tone:"danger",children:v("span",{children:a(A)})}):null]});if(pe){let y=Z.length===0;return $("form",{className:`sekyro-step sekyro-otp${o?` ${o}`:""}`,"aria-labelledby":X,onSubmit:Ut,noValidate:!0,children:[v(re,{id:X,title:a("otp.verifyTitle"),lead:$(Ho,{children:[yn,v("bdi",{dir:"ltr",className:"sekyro-mono",children:Ee?.shown??e.sentToMasked}),gn]})}),Yt,$("div",{className:"sekyro-field",children:[v("label",{className:"sekyro-label",htmlFor:`${X}-code`,children:a("otp.codeLabel")}),v(ho,{id:`${X}-code`,value:S,invalid:me,onChange:N=>{N!==""&&Ue(),P(N),N.length===6&&S.length!==6&&!_&&!e.attemptsExhausted&&$t(N)}}),v("span",{className:`sekyro-help sekyro-otp-expiry${ze?" is-danger":""}`,"aria-hidden":!ze||void 0,children:ze?a("otp.expired"):a("otp.expiresIn",{time:Ln(it)})})]}),v("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:ze?a("otp.expired"):""}),$(se,{children:[v(w,{type:"submit",full:!0,disabled:_||S.length!==6||e.attemptsExhausted,"aria-busy":_||void 0,children:a("otp.verify")}),$("div",{className:"sekyro-resend-row",children:[y?v("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:_||Le>0,onClick:()=>Ge(void 0,!0),children:Le>0?a("otp.resendIn",{seconds:Le}):a("otp.resend")}):Le>0?v("p",{className:"sekyro-resend is-waiting",children:a("otp.resendIn",{seconds:Le})}):Z.map(N=>v("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:_,onClick:()=>Ge(N,!0),children:a("otp.resendBy",{channel:Ye(N)})},N)),Gt?v("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:_,onClick:()=>ue(!0),"data-testid":"sekyro-otp-change",children:a("otp.changeNumber")}):null]})]})]})}let qt=Fn(r.locale);return $("form",{className:`sekyro-step sekyro-otp${o?` ${o}`:""}`,"aria-labelledby":X,onSubmit:Ut,noValidate:!0,children:[v(re,{id:X,title:a("otp.sendTitle"),lead:a("otp.sendDescription")}),Yt,e.needsPhone?$("div",{className:"sekyro-field",children:[v("label",{className:"sekyro-label",htmlFor:ne,children:a("otp.phoneLabel")}),$("div",{className:"sekyro-phone",dir:"ltr",children:[d===null||z&&!E?null:$("div",{className:"sekyro-phone__lead",children:[Kt?$("select",{className:"sekyro-phone__country",dir:r.locale==="ar"?"rtl":"ltr","aria-label":`${a("otp.countryLabel")}: ${E?a("otp.otherCountry"):qt(d)}`,value:E?Vo:d.code,onChange:y=>{U(!1);let N=u.find(q=>q.code===y.target.value);C(N===void 0),N!==void 0&&m(N.code),L(N===void 0?"":N.dial+(z?"":b))},children:[u.map(y=>v("option",{value:y.code,children:qt(y)},y.code)),ye?v("option",{value:Vo,children:a("otp.otherCountry")}):null]}):null,$("span",{className:"sekyro-phone__dial",id:`${ne}-dial`,"aria-hidden":Kt||void 0,children:[v("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:E?"🌐":On(d.code)}),E?null:d.dial]})]}),v("input",{ref:fe,id:ne,className:"sekyro-phone__input",type:"tel",dir:"ltr",inputMode:"tel",autoComplete:"tel","aria-describedby":`${z?"":`${ne}-dial ${ne}-hint `}${We?`${ne}-error`:""}`.trim()||void 0,"aria-invalid":!!We||void 0,placeholder:T?"+":void 0,value:z?k:et(b,Y),onChange:mn,onKeyDown:y=>{y.key==="Enter"&&!Re&&U(!0)},onBlur:y=>{y.relatedTarget?.tagName!=="SELECT"&&U(b!==""&&Ke===null)}})]}),z?null:v("span",{className:"sekyro-help",id:`${ne}-hint`,children:a("otp.phonePlaceholderGeneric")}),We?v("span",{className:"sekyro-help is-danger",id:`${ne}-error`,role:"alert",children:We}):null]}):v("p",{className:"sekyro-text-muted",children:a("otp.prefilledNotice")}),$(se,{children:[Z.length===1?v(w,{type:"submit",full:!0,disabled:_||!Re,"aria-busy":_||void 0,children:a("otp.sendBy",{channel:Ye(Z[0])})}):Z.length>1?$("div",{className:"sekyro-actions__group",role:"group","aria-label":a("otp.chooseChannel"),children:[v("p",{className:"sekyro-label","aria-hidden":"true",children:a("otp.chooseChannel")}),v("div",{className:"sekyro-channel-row",children:Z.map(y=>$(w,{kind:"primary",disabled:_||!Re,"aria-busy":_||void 0,onClick:()=>Ge(y),children:[v(F,{name:y}),Ye(y)]},y))})]}):v(w,{type:"submit",full:!0,disabled:_||!Re,"aria-busy":_||void 0,children:a("otp.send")}),xe&&Wt?v("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:_,onClick:()=>ue(!1),"data-testid":"sekyro-otp-back-to-code",children:a("otp.backToCode")}):null]})]})}s(kt,"PhoneOtpStep");import{lazy as Vn,Suspense as Hn,useMemo as $n,useState as Un}from"react";import{Component as Bn}from"react";var St=class St extends Bn{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(St,"LoadBoundary");var j=St;import{jsx as Se,jsxs as Gn}from"react/jsx-runtime";var Kn={load:s(()=>import("../email-otp-view-LCIDGNZT.js"),"load")};function bt({locale:e,strings:t,...n}){let o=I(e,t),[l,i]=Un(0),r=$n(()=>Vn(()=>Kn.load().then(u=>({default:u.EmailOtpView}))),[l]),a=Gn(O,{tone:"danger",children:[Se("span",{children:o.t("errors.network_error")}),Se(w,{kind:"secondary",onClick:()=>i(u=>u+1),children:o.t("common.retry")})]});return Se(j,{fallback:a,children:Se(Hn,{fallback:Se("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:Se(r,{...n,i18n:o})})},l)}s(bt,"EmailOtpStep");import{lazy as Wn,Suspense as zn,useMemo as Yn,useState as qn}from"react";import{jsx as be,jsxs as Jn}from"react/jsx-runtime";var Zn={load:s(()=>import("../eid-view-HQLNWM6A.js"),"load")};function vt({locale:e,strings:t,...n}){let o=I(e,t),[l,i]=qn(0),r=Yn(()=>Wn(()=>Zn.load().then(u=>({default:u.EidView}))),[l]),a=Jn(O,{tone:"danger",children:[be("span",{children:o.t("errors.network_error")}),be(w,{kind:"secondary",onClick:()=>i(u=>u+1),children:o.t("common.retry")})]});return be(j,{fallback:a,children:be(zn,{fallback:be("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:o.t("common.loading")}),children:be(r,{...n,i18n:o})})},l)}s(vt,"EidStep");import{useMemo as nr}from"react";import{lazy as Qn,Suspense as Xn,useMemo as jn,useState as er}from"react";import{jsx as ve,jsxs as or}from"react/jsx-runtime";var tr={load:s(()=>import("../flow-views-K3HXMKPU.js"),"load")};function B({view:e,i18n:t,quiet:n,...o}){let[l,i]=er(0),r=jn(()=>Qn(()=>tr.load().then(u=>({default:u[e]}))),[e,l]),a=or(O,{tone:"danger",children:[ve("span",{children:t.t("errors.network_error")}),ve(w,{kind:"secondary",onClick:()=>i(u=>u+1),children:t.t("common.retry")})]});return ve(j,{fallback:a,children:ve(Xn,{fallback:n===!0?null:ve("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:ve(r,{...o,i18n:t})})},l)}s(B,"Flow");import{jsx as Ct,jsxs as rr}from"react/jsx-runtime";function Nt({step:e,locale:t,strings:n,className:o,onError:l}){let i=I(t,n),{busy:r,error:a,run:u}=Po(i,l),f=nr(()=>e.choice.options.flatMap(m=>{let h=wo(m,i),d=No[m.service];return h===null?[]:[{id:m.id,label:h,glyph:d&&Ct(F,{name:d})}]}),[e.choice.options,i]),g=e.choice.options.find(m=>m.service==="national_eid");return rr("div",{className:o,children:[Ct(ao,{title:i.t("method.heading"),description:i.t("method.description"),options:f,busy:r,error:a,focus:!0,testId:"sekyro-method",onChoose:m=>u(()=>e.choose(m))}),g?.nationalEid?.afterPass==="continue"?Ct(B,{view:"EidContinueHint",i18n:i,provider:g.nationalEid.providerName,quiet:!0}):null]})}s(Nt,"MethodChoice");import{isValidNni as sr,normalizeNni as $o}from"@sekyro/web";import{useId as ir,useState as wt}from"react";import{Fragment as ur,jsx as V,jsxs as Ce}from"react/jsx-runtime";var ar=new Set(["nni_not_found","registry_record_not_found"]),lr=new Set(["nni_invalid","id_number_invalid"]);function tt({step:e,locale:t,strings:n,className:o,onError:l}){let i=I(t,n),{t:r}=i,[a,u]=wt(""),[f,g]=wt(!1),[m,h]=wt(null),d=ir(),x=e.attemptsExhausted,k=s(async M=>{g(!0),h(null);try{await M()}catch(A){h(ke(A,i.strings)),l?.(A)}finally{g(!1)}},"run"),L=s(M=>{if(M.preventDefault(),e.source!=="typed"){k(()=>e.confirm());return}let A=$o(a);if(!/^\d{10}$/.test(A))return h("population.invalid");if(!sr(A))return h("population.reason_id_number_invalid");k(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(A):e.submitNni(A))},"onSubmit"),E=Qe(i,e.attemptsRemaining,x),C=e.reason!==void 0&&ar.has(e.reason),D=e.reason!==void 0&&lr.has(e.reason),U=Ce(ur,{children:[e.reason==="registry_unavailable"?Ce(O,{tone:"warning",children:[V("span",{children:r("population.reason_registry_unavailable")}),V("span",{children:E})]}):null,C&&e.canUseDocument?Ce(O,{tone:"warning",children:[V("span",{children:r("population.reason_registry_record_not_found_or_document")}),V("span",{children:E}),V(w,{kind:"secondary",disabled:f,onClick:()=>{k(()=>e.useDocument())},children:r("population.useDocument")})]}):null,C&&!e.canUseDocument||D?Ce(O,{tone:"danger",children:[V("span",{children:r(C?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),V("span",{children:E})]}):null,x&&e.reason===void 0?V(O,{tone:"danger",children:V("span",{children:E})}):null,m!==null?V(O,{tone:"danger",children:V("span",{children:r(m)})}):null]}),[S,P,_]=e.source==="document"?["population.fromDocument.title","population.fromDocument.description","population.fromDocument.continue"]:e.source==="bound"?["session.steps.population.title","population.bound.description","population.bound.confirm"]:e.recheck?["population.recheck.title","population.recheck.description","population.submit"]:["session.steps.population.title","session.steps.population.description","population.submit"];return Ce("form",{className:`sekyro-step${o?` ${o}`:""}`,"aria-labelledby":d,onSubmit:L,noValidate:!0,children:[V(re,{id:d,title:r(S),lead:r(P)}),U,e.source==="typed"?Ce("div",{className:"sekyro-field",children:[V("label",{className:"sekyro-label",htmlFor:`${d}-id-number`,children:r("population.label")}),V("input",{id:`${d}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:r("population.placeholder"),value:a,"aria-describedby":`${d}-id-number-help`,"aria-invalid":m==="population.invalid"||m==="population.reason_id_number_invalid"||void 0,onChange:M=>{h(null),u($o(M.target.value).replace(/\D/g,"").slice(0,10))}}),V("span",{id:`${d}-id-number-help`,className:"sekyro-help",children:r("population.helper")})]}):null,V(se,{children:x?null:V(w,{type:"submit",full:!0,disabled:f,"aria-busy":f||void 0,children:r(_)})})]})}s(tt,"IdNumberEntry");function cr(e){return tt(e)}s(cr,"NniEntry");import{acceptedIssuers as gr,acceptedTypesFor as zo,warmDocumentCapture as hr}from"@sekyro/web";import{lazy as kr,Suspense as Sr,useEffect as br,useMemo as vr,useState as xt}from"react";import{acceptedIssuers as dr,acceptedTypesFor as Pt}from"@sekyro/web";import{useEffect as Uo,useId as pr,useMemo as Ko,useState as _t}from"react";import{jsx as H,jsxs as Ne}from"react/jsx-runtime";var Go=s(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),fr=s(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),mr=220;function yr(e,t,n=[]){let o=null;try{o=new Intl.DisplayNames([e],{type:"region"})}catch{}let l=t.map(a=>({code:a,name:o?.of(a)??a})),i=new Intl.Collator(e),r=s(a=>{let u=n.indexOf(a);return u<0?n.length:u},"rank");return l.sort((a,u)=>r(a.code)-r(u.code)||i.compare(a.name,u.name))}s(yr,"countryNames");function Wo({step:e,i18n:t,issuer:n,onPicked:o,ageStepUp:l=!1}){let{t:i,locale:r}=t,a=Ko(()=>dr(e.documents),[e.documents]),u=Ko(()=>yr(r,a,Object.keys(e.documents.byIssuer??{})),[r,a,e.documents]),f=a.length===1?a[0]:null,[g,m]=_t(n??f),[h,d]=_t(""),[x,k]=_t(null),L=pr(),E=f===null?[]:Pt(e.documents,f),C=f!==null&&E.length===1?E[0]:null;Uo(()=>{f!==null&&C!==null&&e.selectDocument(f,C)},[f,C]);let D=s((P,_)=>{e.selectDocument(P,_),o?.()},"pick"),U=s(P=>{let _=Pt(e.documents,P);_.length===1?D(P,_[0]):m(P)},"chooseIssuer");if(Uo(()=>{if(x===null||g===null)return;let P=setTimeout(()=>D(g,x),mr);return()=>clearTimeout(P)},[x]),Ze(g!==null&&a.length>1&&n===void 0?()=>{m(null),k(null)}:null),C!==null)return null;if(g===null){let P=Go(h.trim()),_=P===""?u:u.filter(M=>Go(M.name).includes(P)||M.code.toLowerCase()===P);return Ne("section",{className:"sekyro-step",children:[H(re,{title:i("doc.countryTitle"),lead:i(l?"doc.ageStepUp":"doc.pickDescription")}),Ne("div",{className:"sekyro-field",children:[H("label",{className:"sekyro-label",htmlFor:L,children:i("doc.countryLabel")}),H("input",{id:L,type:"search",className:"sekyro-input",placeholder:i("doc.countrySearch"),value:h,onChange:M=>d(M.target.value)})]}),_.length===0?H("p",{className:"sekyro-text-muted",children:i("doc.noCountryMatch")}):H("ul",{className:"sekyro-rows",children:_.map(M=>H("li",{children:Ne("button",{type:"button",className:"sekyro-row-btn",onClick:()=>U(M.code),children:[H("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:fr(M.code)}),M.name]})},M.code))}),H(se,{children:null})]})}let S=Pt(e.documents,g);return Ne("section",{className:"sekyro-step",children:[H(re,{title:i("doc.pickTitle"),lead:i(l&&f!==null?"doc.ageStepUp":"native.doc.holdIt")}),H("div",{className:"sekyro-choices",children:S.map(P=>Ne("button",{type:"button",className:"sekyro-card","aria-pressed":x===P,disabled:x!==null&&x!==P,onClick:()=>k(P),children:[H("span",{className:"sekyro-card__tile",children:H(F,{name:P==="passport"?"passport":"card"})}),Ne("span",{className:"sekyro-card__body",children:[H("span",{className:"sekyro-card__title",children:i(`doc.type.${P}`)}),H("span",{className:"sekyro-card__sub",children:i(`doc.sub.${P}`)})]}),H("span",{className:"sekyro-radio","aria-hidden":"true"})]},P))}),a.length>1?H("button",{type:"button",className:"sekyro-link",onClick:()=>{m(null),k(null)},children:i("native.doc.changeCountry")}):null,H(se,{children:null})]})}s(Wo,"DocumentPicker");import{jsx as ie,jsxs as Nr}from"react/jsx-runtime";var Cr={load:s(()=>import("../document-capture-view-WDGHEAUI.js"),"load")};function Et({step:e,locale:t,strings:n,className:o,liveMrz:l}){let i=I(t,n),[r,a]=xt(0),[u,f]=xt(null),g=gr(e.documents),m=g.length>1,h=e.issuer!==null&&zo(e.documents,e.issuer).length>1,d=e.documentType===null||e.issuer===null||u!==null,x=g.length===1&&zo(e.documents,g[0]).length===1,[k]=xt(()=>d&&!x),L=e.ageStepUp===!0,E=vr(()=>kr(()=>Cr.load().then(D=>({default:D.DocumentCaptureView}))),[r]);br(()=>{hr()},[]);let C=Nr(O,{tone:"danger",children:[ie("span",{children:i.t("errors.network_error")}),ie(w,{kind:"secondary",onClick:()=>a(D=>D+1),children:i.t("doc.retryCamera")})]});return ie("div",{className:o,children:d?ie(Wo,{step:e,i18n:i,ageStepUp:L&&u===null&&k,...u==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>f(null)}):ie(j,{fallback:C,children:ie(Sr,{fallback:ie("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:i.t("common.loading")}),children:ie(E,{step:e,i18n:i,ageLead:L&&!k,liveMrz:l,...m?{onChangeCountry:s(()=>f("country"),"onChangeCountry")}:{},...h?{onChangeDocument:s(()=>f("document"),"onChangeDocument")}:{}})})},r)})}s(Et,"DocumentCapture");import{warmPortraitCapture as wr}from"@sekyro/web";import{Component as Pr,lazy as Yo,Suspense as qo,useEffect as _r,useMemo as Zo,useState as Jo}from"react";import{jsx as R,jsxs as It}from"react/jsx-runtime";var xr={load:s(()=>import("../portrait-capture-view-I7I6FJQO.js"),"load")},Er={load:s(()=>import("../portrait-review-view-A5HGZ7ZN.js"),"load")},Rt=class Rt extends Pr{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(Rt,"LoadBoundary");var ot=Rt;function Ir({step:e,i18n:t}){let{t:n}=t,o=he();return It("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[R("h2",{ref:o,tabIndex:-1,className:"sekyro-text-body",children:n(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?R("p",{className:"sekyro-text-muted",children:n("portrait.reviewDescription")}):null,e.uploadFailed?It(O,{tone:"danger",children:[R("span",{children:n("portrait.uploadFailed")}),R(w,{kind:"secondary",onClick:()=>{e.resubmit()},children:n("portrait.sendAgain")})]}):R("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:n("portrait.matching")})]})}s(Ir,"MatchPhase");function Tt({step:e,locale:t,strings:n,className:o,assetBaseUrl:l,verification:i}){let r=I(t,n),a=uo(i),[u,f]=Jo(0),[g,m]=Jo(null),h=Zo(()=>Yo(()=>xr.load().then(S=>({default:S.PortraitCaptureView}))),[u]),d=Zo(()=>Yo(()=>Er.load().then(S=>({default:S.PortraitScreens}))),[u]),x=typeof e.uploadPortrait=="function",k=x?e.photo?.source??"camera":"camera",L=x&&k!=="camera"&&e.photo?.uploadOffered===!0,E=k!=="upload",C=k==="upload"?"upload":k==="choice"?g??e.photo?.pick??"source":"camera";if(_r(()=>{e.phase==="capture"&&C==="camera"&&wr()},[e.phase,C]),e.phase==="match")return R("div",{className:o,children:R(Ir,{step:e,i18n:r})});let D=R("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r.t("common.loading")});if(e.phase==="review"||C!=="camera")return R("div",{className:o,children:R(ot,{fallback:R(w,{kind:"ghost",onClick:()=>f(S=>S+1),children:r.t("common.retry")}),children:R(qo,{fallback:D,children:R(d,{screen:e.phase==="review"||C==="camera"?"review":C,step:e,i18n:r,...E?{onCamera:s(()=>m("camera"),"onCamera")}:{},onUpload:()=>m("upload"),onDeclined:()=>m(null)})})},u)});if(!a.settled)return R("div",{className:o,children:D});if((e.captureMode??a.session)==="choice"&&a.choice===null)return R("div",{className:o,children:R(oo,{value:S=>r.t(S),children:R(lo,{onChoose:a.choose,legend:r.t("capture.modePicker.legendPhoto"),help:r.t("capture.modePicker.helpPhoto")})})});let U=It(O,{tone:"danger",children:[R("span",{children:r.t("errors.network_error")}),R(w,{kind:"secondary",onClick:()=>f(S=>S+1),children:r.t("portrait.retryCamera")})]});return R("div",{className:o,children:R(ot,{fallback:U,children:R(qo,{fallback:D,children:R(h,{step:e,i18n:r,...l!==void 0?{assetBaseUrl:l}:{},...L?{onUpload:s(()=>m("upload"),"onUpload")}:{}})})},u)})}s(Tt,"PortraitCapture");import{cameraUnavailableCauseOf as qr}from"@sekyro/web";import{useCallback as ae,useContext as Zr,useEffect as Ft,useId as Jr,useMemo as Qr,useRef as Pe,useState as le}from"react";var Lt={light:{lineBrand:"#0d3b66",successSoft:"#d5f0e8",successFg:"#005341",onSuccess:"#ffffff",warningSoft:"#fff7e6",warningFg:"#735003",onWarning:"#191a1b",dangerSoft:"#ffdada",dangerFg:"#ca0f07",onDanger:"#ffffff",info:"#0563d4",infoSoft:"#d3e5ff",infoFg:"#064da5",onInfo:"#ffffff"},dark:{lineBrand:"#3f80bf",successSoft:"#002c23",successFg:"#53ffd4",onSuccess:"#030303",warningSoft:"#463102",warningFg:"#ffd98a",onWarning:"#030303",dangerSoft:"#9c1008",dangerFg:"#ffbbbb",onDanger:"#030303",info:"#5da9ff",infoSoft:"#063778",infoFg:"#acd0ff",onInfo:"#030303"},sizes:{buttonHeight:"52px",controlRadius:"10px",cardRadius:"16px",fieldRadius:"10px",iconTile:"56px",iconTileRadius:"16px",headerTile:"40px",choiceTile:"40px",tileRadius:"10px",resultDisc:"64px",resultRing:"8px",progressHeight:"4px",focusRing:"2px",focusRingOffset:"2px",otpBox:"60px",choiceMinHeight:"76px",stepGap:"32px",headingGap:"12px"},motion:{page:"320ms",easeOut:"cubic-bezier(0.16, 1, 0.3, 1)"}};var Fe={light:{danger:{base:"#ca0f07",soft:"#ffdada",fg:"#ca0f07",on:"#ffffff"},success:{base:"#007a5e",soft:"#d5f0e8",fg:"#005341",on:"#ffffff"},warning:{base:"#ffab00",soft:"#fff7e6",fg:"#735003",on:"#191a1b"},info:{base:"#0563d4",soft:"#d3e5ff",fg:"#064da5",on:"#ffffff"}},dark:{danger:{base:"#ff7c7c",soft:"#9c1008",fg:"#ffbbbb",on:"#030303"},success:{base:"#00c897",soft:"#002c23",fg:"#53ffd4",on:"#030303"},warning:{base:"#ffbb2e",soft:"#463102",fg:"#ffd98a",on:"#030303"},info:{base:"#5da9ff",soft:"#063778",fg:"#acd0ff",on:"#030303"}}},Tr=["danger","success","warning","info"];function Mt(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}s(Mt,"channel");function Qo(e){let t=Mt(parseInt(e.slice(1,3),16)),n=Mt(parseInt(e.slice(3,5),16)),o=Mt(parseInt(e.slice(5,7),16));return .2126*t+.7152*n+.0722*o}s(Qo,"luminance");function Rr(e,t){let n=Qo(e),o=Qo(t),l=Math.max(n,o),i=Math.min(n,o);return(l+.05)/(i+.05)}s(Rr,"contrastRatio");function Xo(e,t){return Math.min(...Tr.map(n=>Rr(Fe[e][n].fg,t)))}s(Xo,"worstAgainst");function jo(e,t,n){return Math.min(Xo(e,t),Xo(e,n))}s(jo,"worstStatusContrast");function en(e,t){return jo("light",e,t)>=jo("dark",e,t)?"light":"dark"}s(en,"statusSchemeFor");import{useRef as Or,useState as Dr}from"react";import{useEffect as Lr,useId as Mr,useRef as Ot}from"react";import{jsx as we,jsxs as tn}from"react/jsx-runtime";function nt({open:e,title:t,closeLabel:n,onClose:o,children:l,actions:i,role:r,testId:a,returnFocus:u}){let f=Ot(null),g=Ot(null),m=Ot(!1),h=Mr();return Lr(()=>{let d=f.current;if(d!==null){if(e&&!d.open?(g.current=typeof document>"u"?null:document.activeElement,typeof d.showModal=="function"?d.showModal():d.setAttribute("open","")):!e&&d.open&&(typeof d.close=="function"?d.close():d.removeAttribute("open")),!e&&m.current){let x=u?.current??(g.current instanceof HTMLElement?g.current:null);g.current=null,x?.focus()}m.current=e}},[e,u]),we("dialog",{ref:f,className:"sekyro-dialog","aria-labelledby":h,...r==="alertdialog"?{role:r}:{},"data-testid":a,onCancel:d=>{d.preventDefault(),o()},onClick:d=>{d.target===d.currentTarget&&o()},children:tn("div",{className:"sekyro-dialog__panel",children:[tn("div",{className:"sekyro-dialog__head",children:[we("h2",{id:h,className:"sekyro-dialog__title",children:t}),n!==void 0?we("button",{type:"button",className:"sekyro-disc sekyro-dialog__close","aria-label":n,onClick:o,children:we(F,{name:"close"})}):null]}),l!==void 0?we("div",{className:"sekyro-dialog__body",children:l}):null,i!==void 0?we("div",{className:"sekyro-dialog__actions",children:i}):null]})})}s(nt,"FlowDialog");import{jsx as Be,jsxs as on}from"react/jsx-runtime";var Ar=["intro","data","processing","sharing","retention"];function nn({i18n:e,purpose:t="identity"}){let{t:n}=e,[o,l]=Dr(!1),i=Or(null),[r,a=""]=n("consent.short").split("{terms}");return on("div",{className:"sekyro-consent","data-testid":"sekyro-consent",children:[on("p",{className:"sekyro-consent__line",children:[r,Be("button",{ref:i,type:"button",className:"sekyro-link sekyro-link--inline","aria-haspopup":"dialog",onClick:()=>l(!0),children:n("consent.termsLink")}),a]}),Be(nt,{open:o,title:n("consent.termsTitle"),closeLabel:n("native.close"),onClose:()=>l(!1),returnFocus:i,testId:"sekyro-consent-terms",children:Be("div",{className:"sekyro-stack sekyro-stack--3",children:t==="human"?Be(B,{view:"HumanConsentTerms",i18n:e,quiet:!0}):Ar.map(u=>Be("p",{children:n(`consent.terms.${u}`)},u))})})]})}s(nn,"ConsentNotice");function rn(e){let t=e.trim().split(/\s+/).filter(o=>o!=="");return(t.length>=2?[t[0],t[1]].map(o=>Array.from(o??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}s(rn,"initials");import{useSyncExternalStore as Fr}from"react";var ln=s(e=>({colors:{...e?K.dark:K.light},radius:K.radius,fontFamily:K.font}),"brandTheme"),va=ln(!1),sn=/^#[0-9a-f]{6}$/i;function Dt(e,t,n){if(t)return null;let o=ut(e).colors,l=n?.colors?.bg??o?.bg,i=n?.colors?.surface??o?.surface;return l===void 0&&i===void 0||l!==void 0&&!sn.test(l)||i!==void 0&&!sn.test(i)?null:en(l??K.light.bg,i??K.light.surface)}s(Dt,"partnerStatusScheme");function rt(e,t,n){let o=ut(e);if(n&&o.colors!==void 0){let{brand:l,brandFg:i}=o.colors;l!==void 0&&$r(l,K.dark.bg)>=3?o.colors={brand:l,ring:l,...i!==void 0?{brandFg:i}:{}}:delete o.colors}if(Dt(e,n,t)==="dark"){let l=Fe.dark;o.colors={...o.colors,danger:l.danger.base,success:l.success.base,warning:l.warning.fg}}return qe(ln(n),o,fo(t))}s(rt,"verificationTheme");function st(e){let t=Fr(Hr,Vr,()=>!1);return e==="dark"||e==="system"&&t}s(st,"useDarkScheme");var Br="(prefers-color-scheme: dark)",cn=s(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(Br):null,"media"),Vr=s(()=>cn()?.matches??!1,"prefersDark");function Hr(e){let t=cn();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}s(Hr,"subscribe");function $r(e,t){let[n,o]=[an(e),an(t)];return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}s($r,"contrast");function an(e){let t=[1,3,5].map(n=>{let o=Number.parseInt(e.slice(n,n+2),16)/255;return o<=.03928?o/12.92:((o+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}s(an,"luminance");import{useEffect as Ur,useId as Kr,useState as Gr}from"react";import{jsx as G,jsxs as Ve}from"react/jsx-runtime";var Wr=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]);function zr({outcome:e}){return e==="approved"?Ve("svg",{className:"sekyro-outcome sekyro-outcome--approved",viewBox:"0 0 80 80","aria-hidden":"true",focusable:"false",children:[G("circle",{className:"sekyro-outcome__ring",cx:"40",cy:"40",r:"40"}),G("circle",{className:"sekyro-outcome__disc",cx:"40",cy:"40",r:"32"}),G("path",{className:"sekyro-outcome__glyph",d:"M6.5 12.5l3.6 3.6 7.4-8.2",pathLength:"1",transform:"translate(22 22) scale(1.5)"})]}):G("span",{className:`sekyro-tile sekyro-tile--${e==="review"?"info":"neutral"} sekyro-outcome-tile`,"aria-hidden":"true",children:G(F,{name:e==="review"?"pending":e==="expired"?"timer":"close"})})}s(zr,"OutcomeMark");function Yr({label:e,id:t,copied:n}){let[o,l]=Gr(!1);return Ur(()=>{if(!o)return;let i=setTimeout(()=>l(!1),1600);return()=>clearTimeout(i)},[o]),Ve("button",{type:"button",className:`sekyro-reference${o?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>l(!0),()=>{})},children:[G("span",{"aria-live":"polite",children:o?n:e}),G("bdi",{dir:"ltr",children:t}),G(F,{name:"copy"})]})}s(Yr,"ReferenceLine");function At({step:e,locale:t,strings:n,className:o,onClose:l}){let i=I(t,n),{t:r}=i,a=Kr(),u=he(),f=e.context.orgName,g=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",m;switch(e.display){case"policy_stop":{let h=e.failureReason??"";if(Wr.has(Xt(h)))m=r("session.result.detailsMismatch",{org:f});else if(h==="device_velocity_exceeded")m=r("session.result.deviceVelocity",{org:f});else if(h==="capture_tampered")m=r("session.result.deviceStop");else if(h==="camera_unavailable")m=r("reasons.camera_unavailable",{org:f});else if(h==="underage_estimated")m=r("reasons.underage_estimated");else if(h==="starter_credit_claimed")m=r("reasons.starter_credit_claimed");else if(h==="blocked_by_org")m=r("reasons.blocked_by_org");else{let d=eo(h);m=d!==null?r(d,{org:f}):r("session.result.rejected.description")}break}case"cooldown":{let h=to(i.locale,e.retryAfter);m=h!==null?r(h.key,{time:h.time}):r("reasons.device_cooldown");break}case"platform_unsupported":m=r("result.platform_unsupported");break;case"attempts_exhausted":m=r("common.noAttemptsLeft");break;default:m=f!==""?r(`native.result.${g}`,{org:f}):r(`session.result.${g}.description`)}return Ve("section",{className:`sekyro-result${o?` ${o}`:""}`,"aria-labelledby":a,"data-testid":"sekyro-result",children:[Ve("div",{className:"sekyro-result__body",children:[G(zr,{outcome:e.display==="cooldown"?"review":g}),Ve("div",{className:"sekyro-heading",children:[G("h2",{id:a,ref:u,tabIndex:-1,className:"sekyro-text-body",children:r(`session.result.${g}.title`)}),G("p",{className:"sekyro-text-muted",children:m})]}),G(Yr,{label:r("result.referenceLabel"),id:e.context.sessionId,copied:r("native.result.copied")})]}),l!==void 0?G("div",{className:"sekyro-actions",children:G(w,{full:!0,onClick:l,children:f!==""?r("native.result.back",{org:f}):r("native.close")})}):null]})}s(At,"VerificationResultScreen");import{Fragment as Vt,jsx as c,jsxs as ee}from"react/jsx-runtime";function Xr(e,t,n){let o=t?K.dark:K.light,l=t?K.roles.dark:K.roles.light,i=e.colors??{},r={},a=i.fg===o.fg&&i.surface===o.surface;i.brand===o.brand&&i.surface===o.surface&&(r["--sekyro-color-brand-soft"]=l.brandSoft),a&&(r["--sekyro-color-line"]=l.line,r["--sekyro-color-line-subtle"]=l.lineSubtle,r["--sekyro-color-line-strong"]=l.lineStrong,r["--sekyro-color-sunken"]=l.sunken),i.fgMuted===o.fgMuted&&i.surface===o.surface&&(r["--sekyro-color-fg-subtle"]=l.fgSubtle),e.fontFamily===K.font&&(r["--sekyro-font-display"]=K.fontDisplay);let u=t?Lt.dark:Lt.light;if(r["--sekyro-color-success-soft"]=u.successSoft,r["--sekyro-color-success-fg"]=u.successFg,r["--sekyro-color-on-success"]=u.onSuccess,r["--sekyro-color-warning-soft"]=u.warningSoft,r["--sekyro-color-warning-fg"]=u.warningFg,r["--sekyro-color-danger-soft"]=u.dangerSoft,r["--sekyro-color-danger-fg"]=u.dangerFg,r["--sekyro-color-on-danger"]=u.onDanger,r["--sekyro-color-info-soft"]=u.infoSoft,r["--sekyro-color-info-fg"]=u.infoFg,i.brand===o.brand&&(r["--sekyro-color-line-brand"]=u.lineBrand),n!==null){let f=Fe[n];for(let g of["danger","success","warning","info"])r[`--sekyro-color-${g}-soft`]=f[g].soft,r[`--sekyro-color-${g}-fg`]=f[g].fg;r["--sekyro-color-on-success"]=f.success.on,r["--sekyro-color-on-danger"]=f.danger.on}return r}s(Xr,"flowRoles");function Ht(e){let{verification:t,locale:n,strings:o,onStep:l,onResult:i}=e,{step:r,error:a}=ft(t);Ft(()=>{r!==null&&l?.(r)},[r,l]),Ft(()=>i===void 0?void 0:t.on("result",i),[t,i]);let u=st(e.colorScheme??"light"),f=r?.context.branding,g=rt(f,e.theme,u),[m,h]=le(!1),d=`sekyro-verification${u?" sekyro-verification--dark":""}${m?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,x=Pe(e.onClose);x.current=e.onClose;let k=Pe(r);k.current=r;let L=ae(()=>{let S=k.current;x.current?.(S?.kind==="result"?{reason:"finished",result:S.result}:{reason:"cancelled"})},[]),[E,C]=le(null),D=ae(()=>{let S=k.current;S!==null&&S.kind!=="result"&&S.context.consentRecorded?C("close"):L()},[L]),U=Qr(()=>t.reportCaptureIssue===void 0?null:S=>t.reportCaptureIssue?.(S),[t]);return c(yo,{theme:g,className:d,children:c(Ae,{locale:n,...o!==void 0?{strings:o}:{},children:c("div",{dir:e.dir??(n==="ar"?"rtl":"ltr"),lang:n,className:"sekyro-flow",style:Xr(g,u,Dt(f,u,e.theme)),children:c(bo.Provider,{value:h,children:c(dt.Provider,{value:e.onClose!==void 0?L:void 0,children:c(Je.Provider,{value:e.onClose!==void 0?D:void 0,children:c(ro.Provider,{value:U,children:ee(io.Provider,{value:jr,children:[c(ns,{...e,step:r,error:a,immersive:m,onLeaveAsk:()=>C("history"),onClosed:L}),c(os,{open:E!==null,onStay:()=>{E==="history"&&Bt(),C(null)},onLeave:()=>{let S=E;C(null),S==="close"||e.onClose!==void 0?L():typeof window<"u"&&pn()}})]})})})})})})})})}s(Ht,"SekyroVerification");var jr={self:c(F,{name:"face"}),assisted:c(F,{name:"camera"})};function es(e,t){if(t===void 0||t==="aml_screening")return null;let n=e,o=n[`session.processing.${t}.title`],l=n[`session.processing.${t}.description`];return typeof o=="string"&&o!==""&&typeof l=="string"&&l!==""?{title:o,description:l}:null}s(es,"processingCopyOf");function ts({error:e,retry:t}){let{t:n}=I(),o=he();return ee(ct,{tone:"danger",testId:"sekyro-error-notice",children:[c("span",{children:n(jt(e.kind))}),e.retryable?c(w,{ref:o,kind:"secondary",className:"sekyro-btn--start",onClick:t,children:n("common.retry")}):null]})}s(ts,"CameraErrorNotice");var un="sekyroFlow";function dn(){let e=window.history.state;return typeof e=="object"&&e!==null&&e[un]===!0}s(dn,"onGuard");function Bt(){if(typeof window>"u"||dn())return;let e=window.history.state;window.history.pushState({...typeof e=="object"&&e!==null?e:{},[un]:!0},"")}s(Bt,"pushGuard");function pn(){window.history.back()}s(pn,"leaveHistory");function os({open:e,onStay:t,onLeave:n}){let{t:o}=I();return c(nt,{open:e,role:"alertdialog",title:o("leave.title"),onClose:t,testId:"sekyro-leave",actions:ee(Vt,{children:[c(w,{full:!0,onClick:t,children:o("leave.stay")}),c(w,{full:!0,kind:"danger",onClick:n,children:o("leave.confirm")})]}),children:c("p",{className:"sekyro-text-muted",children:o("leave.body")})})}s(os,"LeaveDialog");function ns(e){let{step:t,error:n,slots:o,immersive:l}=e,i=I(),{t:r}=i,[a,u]=le(!1),[f,g]=le([]),m=ae(p=>(g(b=>[...b,p]),()=>g(b=>b.filter(J=>J!==p))),[]),[h,d]=le(null),x=ae(p=>d(()=>p),[]),[k,L]=le(0),[E,C]=le(null),D=t?.context.purpose??"identity",U=t?.context.returning===!0,S=e.verification,P=D==="human"||t?.context.cameraUnavailableHandled===!0,_=S.reportCameraUnavailable!==void 0&&P?p=>S.reportCameraUnavailable?.(p)??Promise.resolve():void 0,M=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,A=e.handoffUrl,ce=ae((p,b)=>_===void 0?void 0:c(B,{view:"NoCameraView",i18n:i,quiet:!0,cause:b,onRetry:p,...M?{onContinue:_}:{},...A!==void 0?{handoffUrl:A}:{}}),[i,S,P,M,A]),xe=ae((p,b)=>c(_o,{start:p,context:b,human:D==="human",returning:U,extra:b.canChooseFacing&&c(co,{value:b.facing,onChange:b.setFacing}),notice:b.permissionSettled&&b.permission==="denied"?ce(p,"denied"):void 0}),[D,U,ce]),ue=ae((p,b)=>{let J=qr(p.kind);return(J!==void 0?ce(b,J):void 0)??ee(Vt,{children:[c(ts,{error:p,retry:b}),J!==void 0&&A!==void 0?c(B,{view:"DesktopHandoffView",i18n:i,quiet:!0,url:A}):null]})},[ce,A,i]),Ee=Pe(""),He=e.livenessProps?.slots?.stageOverlay,de=ae(p=>(p.guidance!==""&&!p.coached&&(Ee.current=p.guidance),c(xo,{testId:"sekyro-capture-stage",video:c("video",{ref:p.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:p.settled?r("capture.checkingTitle"):p.guidance!==""?p.guidance:Ee.current,note:p.note,busy:p.settled,progress:p.phase==="seeking"||p.phase==="aligning"?p.progress:1,still:p.still,live:p.live,closeLabel:r("native.close"),overlay:He?.(p.videoRef),ramp:p.ramp?.colour??null,...p.settled?{}:{onClose:s(()=>L(b=>b+1),"onClose")},end:p.switchCamera&&c("button",{type:"button",className:"sekyro-glass",onClick:p.switchCamera,"aria-label":r("capture.switchCamera"),children:c(no,{})})})),[r,He]),pe=Jr(),$e=t,Ie=t!==null&&E===t.key&&t.context.switchable!==void 0,me=h??(t===null||t.kind==="result"?null:Ie?()=>C(null):t.context.switchable!==void 0&&typeof $e?.chooseOption=="function"?()=>C(t.key):null),Ue=Pe(me);Ue.current=me;let X=Pe(t);X.current=t;let fe=Pe({ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0});fe.current={ask:e.onLeaveAsk,closed:e.onClosed,hostClose:e.onClose!==void 0};let Te=e.backNavigation==="history";if(Ft(()=>{if(!Te||typeof window>"u")return;Bt();let p=s(()=>{if(dn())return;let b=X.current,J=Ue.current;J!==null?(J(),Bt()):b?.kind!=="result"&&b?.context.consentRecorded===!0?fe.current.ask():fe.current.hostClose?fe.current.closed():pn()},"onPop");return window.addEventListener("popstate",p),()=>window.removeEventListener("popstate",p)},[Te]),n!==null)return c(ct,{tone:"danger",children:c("span",{children:r(ke(n,i.strings))})});if(t===null)return ee("div",{className:"sekyro-skeleton",role:"status","aria-busy":"true",children:[c("span",{className:"sekyro-visually-hidden",children:r("common.loading")}),c("span",{className:"sekyro-skeleton__bar is-title"}),c("span",{className:"sekyro-skeleton__bar"}),c("span",{className:"sekyro-skeleton__bar is-short"}),c("span",{className:"sekyro-skeleton__bar is-block"})]});let{context:W}=t,Z=s(p=>{u(!0),p().finally(()=>u(!1))},"refresh"),ye=o?.header??c(is,{context:W,headerId:pe,end:o?.headerEnd,...me!==null?{onBack:me}:{}}),T,z=Ie;if(z)T=c(B,{view:"LaneChoiceView",i18n:i,step:t,onClose:()=>C(null)});else switch(t.kind){case"phone_otp":T=c(kt,{step:t});break;case"email_otp":T=c(bt,{step:t});break;case"method":T=c(Nt,{step:t});break;case"registry":T=c(tt,{step:t});break;case"document":T=c(Et,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let p=e.livenessProps?.slots?.intro,b={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:p??xe,...p===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:ue}:{}},...k>0?{autoStart:!1}:{},verification:e.verification,locale:e.locale,dir:e.dir,strings:i.strings,assetBaseUrl:e.assetBaseUrl,voice:e.voice,onCaptured:e.onLivenessCaptured};T=c(so.Provider,{value:de,children:t.instructions==="icao"||t.livePhoto?.icao===!0?c(B,{view:"LivePhotoLiveness",i18n:i,step:t,livenessProps:b,sekyroIntro:p===void 0},k):c(po,{...b},k)});break}case"portrait":T=ee(Vt,{children:[t.retakeOnly?c(B,{view:"PortraitRetakeNotice",i18n:i,quiet:!0}):null,c(Tt,{step:t,verification:e.verification,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":T=c(B,{view:"ContactChoiceView",i18n:i,step:t});break;case"choice":T=c(B,{view:"GenericChoiceView",i18n:i,step:t});break;case"identity_summary":T=c(B,{view:"IdentitySummaryView",i18n:i,step:t});break;case"mobile_required":T=e.handoffUrl!==void 0?c(B,{view:"HandoffView",i18n:i,url:e.handoffUrl,refresh:t.refresh}):c(Xe,{tone:"brand",icon:"smartphone",title:r("handoff.title"),actions:c(w,{kind:"secondary",full:!0,disabled:a,onClick:()=>Z(t.refresh),children:r("common.refresh")}),children:c("p",{children:r("reasons.mobile_required")})});break;case"processing":{let p=es(i.strings,t.service);T=c(Xe,{tone:"brand",icon:"pending",busy:!t.stalled,live:!0,title:p?.title??r("session.processing.title"),actions:t.stalled?c(w,{kind:"secondary",full:!0,disabled:a,onClick:()=>Z(t.refresh),children:r("common.refresh")}):null,children:c("p",{children:p?.description??r("session.processing.description")})});break}case"eid":T=c(vt,{step:t});break;case"unsupported":{let p=t.reason==="platform_unsupported";T=c(Xe,{tone:"neutral",icon:"smartphone",title:r(p?"needsApp.title":"unsupported.title"),actions:c(rs,{org:W.orgName}),children:c("p",{children:p?W.orgName!==""?r("needsApp.description",{org:W.orgName}):r("needsApp.descriptionNoOrg"):r("unsupported.description",{org:W.orgName})})});break}case"result":T=o?.result?.(t)??c(ss,{step:t});break;default:{let p=t;T=null}}let Y=!l&&!W.consentRecorded&&t.kind!=="result"?c(nn,{i18n:i,purpose:W.purpose}):null;return c(So.Provider,{value:x,children:ee(ko.Provider,{value:Y===null?null:{node:Y,owner:f[0]??null,claim:m},children:[l?null:ye,!l&&t.kind!=="result"&&W.sections.length>1?c(as,{context:W,current:t.section,i18n:i}):null,c(vo,{pageKey:t.key,children:T}),!l&&!z&&t.kind!=="result"&&t.context.switchable!==void 0?c(B,{view:"LaneSwitch",i18n:i,step:t,onOpen:()=>C(t.key),quiet:!0},t.key):null,f.length===0?Y:null,l?null:o?.footer!==void 0?o.footer:W.branding?.hideAttribution===!0?null:ee("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[c(F,{name:"lock"}),r("shell.verifiedBy")]})]})})}s(ns,"Body");function rs({org:e}){let{t}=I(),n=Zr(dt);return n===void 0?null:c(w,{full:!0,onClick:n,children:e!==""?t("native.result.back",{org:e}):t("native.close")})}s(rs,"BackToOrg");function ss({step:e}){return c(Je.Consumer,{children:t=>c(At,{step:e,...t!==void 0?{onClose:t}:{}})})}s(ss,"ResultPage");function is({context:e,headerId:t,end:n,onBack:o}){let{t:l}=I(),[i,r]=le(!1),a=i?void 0:e.branding?.logoUrl,u=e.orgName!==""?e.orgName:l(e.returning?"returning.heading":"session.title");return c("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:ee("div",{className:"sekyro-org",children:[o!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__back","aria-label":l("common.back"),onClick:o,"data-testid":"sekyro-back",children:c(F,{name:"back"})}):null,c("span",{className:"sekyro-org__tile","aria-hidden":"true",children:a!==void 0?c("img",{className:"sekyro-org__logo",src:a,alt:"",onError:()=>r(!0)}):rn(e.orgName)}),ee("div",{className:"sekyro-org__text",children:[c("h1",{id:t,className:"sekyro-org__name",children:u}),c("p",{className:"sekyro-org__sub",children:l(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),n!=null?c("div",{className:"sekyro-org__end",children:n}):null,c(Je.Consumer,{children:f=>f!==void 0?c("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":l("native.close"),onClick:f,children:c(F,{name:"close"})}):null})]})})}s(is,"OrgHeader");function as({context:e,current:t,i18n:n}){let o=t===null?-1:e.sections.indexOf(t),l=e.progress,i=l!==void 0&&l.length===e.sections.length?l:e.sections.map((r,a)=>({id:r,state:a<o?"done":a===o?"current":"upcoming"}));return c("ol",{className:"sekyro-progress__bars","aria-label":n.t("session.progressLabel"),children:i.map(({id:r,state:a})=>c("li",{className:`sekyro-progress__bar${a==="done"?" is-done":a==="current"?" is-current":""}`,...a==="current"?{"aria-current":"step"}:{},children:c("span",{className:"sekyro-visually-hidden",children:n.strings[`section.${r}`]??r})},r))})}s(as,"SectionProgress");import{useEffect as ls,useState as fn}from"react";import{jsx as _e}from"react/jsx-runtime";function cs(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}s(cs,"pageUrl");function us({hostedUrl:e,inAppBrowser:t,...n}){let[o,l]=fn(t===!0);ls(()=>{t===void 0&&pt()&&l(!0)},[t]);let[i,r]=fn(!1),a=st(n.colorScheme??"light"),u=n.handoffUrl??e??cs();return o&&!i?_e(mo,{theme:qe(rt(void 0,void 0,a),n.theme),className:`sekyro-verification${a?" sekyro-verification--dark":""}${n.className!==void 0?` ${n.className}`:""}`,children:_e(Ae,{locale:n.locale,...n.strings!==void 0?{strings:n.strings}:{},children:_e("div",{dir:n.dir??(n.locale==="ar"?"rtl":"ltr"),lang:n.locale,className:"sekyro-flow",children:_e(ds,{url:u,onContinue:()=>r(!0)})})})}):_e(Ht,{...n,...u!==""?{handoffUrl:u}:{}})}s(us,"SekyroFlow");function ds({url:e,onContinue:t}){let n=I();return _e(B,{view:"InAppBrowserPrompt",i18n:n,url:e,onContinue:t})}s(ds,"Prompt");export{Et as DocumentCapture,vt as EidStep,bt as EmailOtpStep,tt as IdNumberEntry,Nt as MethodChoice,cr as NniEntry,kt as PhoneOtpStep,Tt as PortraitCapture,us as SekyroFlow,Ht as SekyroVerification,Ae as StepI18nProvider,At as VerificationResultScreen,bn as arSteps,vn as enSteps,Nn as formatTemplate,Cn as frSteps,pt as isInAppBrowser,kn as loadSekyroLocale,wn as resolveSekyroStrings,Sn as retakeHintStringKey,I as useStepI18n,ft as useVerificationStep};
|