@sekyro/react 0.1.0-rc.15 → 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.
Files changed (57) hide show
  1. package/CHANGELOG.md +57 -0
  2. package/dist/chunk-25KWDPLY.js +2 -0
  3. package/dist/chunk-55NNQK5P.js +2 -0
  4. package/dist/chunk-6I7GU4FS.js +2 -0
  5. package/dist/chunk-7MMT5M4E.js +2 -0
  6. package/dist/chunk-A6UYUVEG.js +2 -0
  7. package/dist/chunk-DY5WQVPE.js +2 -0
  8. package/dist/chunk-GUTF3SPK.js +2 -0
  9. package/dist/chunk-JT7YHK7F.js +2 -0
  10. package/dist/chunk-LPGHMDD4.js +2 -0
  11. package/dist/chunk-NV7HZJM4.js +2 -0
  12. package/dist/chunk-T3PAN4NN.js +2 -0
  13. package/dist/chunk-XTQARDSJ.js +2 -0
  14. package/dist/chunk-YVNQ3UUH.js +2 -0
  15. package/dist/{chunk-TLHEN5T3.js → chunk-Z7US4CLZ.js} +1 -1
  16. package/dist/document-capture-view-WDGHEAUI.js +2 -0
  17. package/dist/eid-view-HQLNWM6A.js +2 -0
  18. package/dist/email-otp-view-LCIDGNZT.js +2 -0
  19. package/dist/flow-views-K3HXMKPU.js +2 -0
  20. package/dist/index.cjs +1 -1
  21. package/dist/index.d.cts +2 -2
  22. package/dist/index.d.ts +2 -2
  23. package/dist/index.js +1 -1
  24. package/dist/overlay-de-YQA44XTY.js +2 -0
  25. package/dist/overlay-es-6KRUPYG4.js +2 -0
  26. package/dist/overlay-pt-QEAE4TDI.js +2 -0
  27. package/dist/portrait-capture-view-I7I6FJQO.js +2 -0
  28. package/dist/portrait-review-view-A5HGZ7ZN.js +2 -0
  29. package/dist/{theme-qTwMxyZM.d.ts → theme-DuvMUYA9.d.cts} +8 -2
  30. package/dist/{theme-qTwMxyZM.d.cts → theme-DuvMUYA9.d.ts} +8 -2
  31. package/dist/verification/index.cjs +1 -1
  32. package/dist/verification/index.d.cts +79 -4
  33. package/dist/verification/index.d.ts +79 -4
  34. package/dist/verification/index.js +1 -1
  35. package/dist/verification.css +210 -70
  36. package/package.json +2 -2
  37. package/sbom.cdx.json +4 -4
  38. package/dist/chunk-6EP4O2CE.js +0 -2
  39. package/dist/chunk-AIBCIUYT.js +0 -2
  40. package/dist/chunk-EZ5TVL6P.js +0 -2
  41. package/dist/chunk-H2KIOYQU.js +0 -2
  42. package/dist/chunk-IJE64ZEN.js +0 -2
  43. package/dist/chunk-JCCXPYU4.js +0 -2
  44. package/dist/chunk-PYAJMHZH.js +0 -2
  45. package/dist/chunk-TS3UFW5B.js +0 -2
  46. package/dist/chunk-UFAOAYQY.js +0 -2
  47. package/dist/chunk-VKSX4KC3.js +0 -2
  48. package/dist/chunk-YY76AMUA.js +0 -2
  49. package/dist/chunk-Z43XZ75N.js +0 -2
  50. package/dist/document-capture-view-6NADWNPQ.js +0 -2
  51. package/dist/eid-view-BKKVB5QT.js +0 -2
  52. package/dist/email-otp-view-56JMHX3M.js +0 -2
  53. package/dist/flow-views-7FMODRP7.js +0 -2
  54. package/dist/overlay-de-PSIG4NLI.js +0 -2
  55. package/dist/overlay-es-36OOIBXG.js +0 -2
  56. package/dist/overlay-pt-NWIPFF4D.js +0 -2
  57. package/dist/portrait-capture-view-JYTBBXFU.js +0 -2
@@ -1,5 +1,5 @@
1
- import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-qTwMxyZM.cjs';
2
- export { k as StringKey, A as retakeHintStringKey } from '../theme-qTwMxyZM.cjs';
1
+ import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-DuvMUYA9.cjs';
2
+ export { k as StringKey, A as retakeHintStringKey } from '../theme-DuvMUYA9.cjs';
3
3
  import * as react from 'react';
4
4
  import { ReactNode } from 'react';
5
5
  import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
@@ -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;
@@ -93,6 +95,10 @@ interface StepStrings {
93
95
  "doc.cameraBlockedHint": string;
94
96
  "doc.retryCamera": string;
95
97
  "doc.holdUpright": string;
98
+ "doc.ageStepUp": string;
99
+ "reasons.underage_estimated": string;
100
+ "reasons.starter_credit_claimed": string;
101
+ "reasons.blocked_by_org": string;
96
102
  "dcv2.sensing": string;
97
103
  "dcv2.too_far": string;
98
104
  "dcv2.too_close": string;
@@ -203,6 +209,20 @@ interface StepStrings {
203
209
  "needsApp.title": string;
204
210
  "needsApp.description": string;
205
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;
206
226
  "population.recheck.title": string;
207
227
  "population.recheck.description": string;
208
228
  "otp.phoneInvalid": string;
@@ -277,6 +297,9 @@ interface StepStrings {
277
297
  "emailOtp.reason_otp_rate_limited"?: string;
278
298
  "emailOtp.reason_email_invalid"?: string;
279
299
  "emailOtp.reason_email_disposable"?: string;
300
+ "emailOtp.changeEmail"?: string;
301
+ "emailOtp.backToCode"?: string;
302
+ "emailOtp.reason_otp_resend_limit"?: string;
280
303
  "eid.identifierTitle"?: string;
281
304
  "eid.identifierTitleGeneric"?: string;
282
305
  "eid.identifierDescription"?: string;
@@ -328,6 +351,43 @@ interface StepStrings {
328
351
  "dcv3.mrz.valid"?: string;
329
352
  "dcv3.mrz.looksLikePassport"?: string;
330
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;
331
391
  "native.doc.introTitle"?: string;
332
392
  "native.doc.introLead"?: string;
333
393
  "native.doc.tip.flat"?: string;
@@ -404,10 +464,11 @@ interface StepStrings {
404
464
  "inApp.copied"?: string;
405
465
  "inApp.copyFailed"?: string;
406
466
  "inApp.continueAnyway"?: string;
467
+ "inApp.openBrowser"?: string;
407
468
  }
408
469
 
409
470
  /**
410
- * Loads the copy of a Human-only locale (es, pt, de); resolves at once for ar/fr/en. The components load it by
471
+ * Loads the copy of an overlay locale (es, pt, de); resolves at once for ar/fr/en. The components load it by
411
472
  * themselves (they render once it is there); call it ahead to have the copy ready on the first render. A failed
412
473
  * download leaves the locale on English.
413
474
  */
@@ -493,10 +554,16 @@ declare function DocumentCapture({ step, locale, strings, className, liveMrz, }:
493
554
  liveMrz?: DocumentLiveMrzOptions;
494
555
  }): react.JSX.Element;
495
556
 
496
- declare function PortraitCapture({ step, locale, strings, className, assetBaseUrl, }: StepComponentProps & {
557
+ declare function PortraitCapture({ step, locale, strings, className, assetBaseUrl, verification, }: StepComponentProps & {
497
558
  step: PortraitStepHandle;
498
559
  /** Self-hosted MediaPipe assets (wasm fileset + `face_landmarker.task`); default `/models-v3`. */
499
560
  assetBaseUrl?: string;
561
+ /**
562
+ * The session's verification: under capture mode `choice` (design 2026-11-04 §4.5) the person picks who films
563
+ * before the camera opens, when the portrait is the first camera step (a pick made at the liveness step holds).
564
+ * Without it the camera follows the step handle (`self` until a pick).
565
+ */
566
+ verification?: Verification;
500
567
  }): react.JSX.Element;
501
568
 
502
569
  /** `system` follows the device (prefers-color-scheme). */
@@ -547,6 +614,14 @@ interface SekyroVerificationProps {
547
614
  * SDKs). Take them back to your page. Without it, neither button is shown.
548
615
  */
549
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";
550
625
  /** Fires before the liveness upload (SDK spec §7.5 shadow hook). */
551
626
  onLivenessCaptured?: (artifacts: CapturedArtifacts) => void;
552
627
  /**
@@ -1,5 +1,5 @@
1
- import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-qTwMxyZM.js';
2
- export { k as StringKey, A as retakeHintStringKey } from '../theme-qTwMxyZM.js';
1
+ import { a as SekyroLocale, S as Strings, g as SekyroTheme, q as VoiceOptions, d as LivenessCaptureProps } from '../theme-DuvMUYA9.js';
2
+ export { k as StringKey, A as retakeHintStringKey } from '../theme-DuvMUYA9.js';
3
3
  import * as react from 'react';
4
4
  import { ReactNode } from 'react';
5
5
  import { Verification, VerificationStep, PhoneOtpStepHandle, EmailOtpStepHandle, EidStepHandle, MethodStepHandle, RegistryStepHandle, DocumentStepHandle, DocumentLiveMrzOptions, PortraitStepHandle, VerificationResult, ResultStepHandle, CapturedArtifacts } from '@sekyro/web';
@@ -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;
@@ -93,6 +95,10 @@ interface StepStrings {
93
95
  "doc.cameraBlockedHint": string;
94
96
  "doc.retryCamera": string;
95
97
  "doc.holdUpright": string;
98
+ "doc.ageStepUp": string;
99
+ "reasons.underage_estimated": string;
100
+ "reasons.starter_credit_claimed": string;
101
+ "reasons.blocked_by_org": string;
96
102
  "dcv2.sensing": string;
97
103
  "dcv2.too_far": string;
98
104
  "dcv2.too_close": string;
@@ -203,6 +209,20 @@ interface StepStrings {
203
209
  "needsApp.title": string;
204
210
  "needsApp.description": string;
205
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;
206
226
  "population.recheck.title": string;
207
227
  "population.recheck.description": string;
208
228
  "otp.phoneInvalid": string;
@@ -277,6 +297,9 @@ interface StepStrings {
277
297
  "emailOtp.reason_otp_rate_limited"?: string;
278
298
  "emailOtp.reason_email_invalid"?: string;
279
299
  "emailOtp.reason_email_disposable"?: string;
300
+ "emailOtp.changeEmail"?: string;
301
+ "emailOtp.backToCode"?: string;
302
+ "emailOtp.reason_otp_resend_limit"?: string;
280
303
  "eid.identifierTitle"?: string;
281
304
  "eid.identifierTitleGeneric"?: string;
282
305
  "eid.identifierDescription"?: string;
@@ -328,6 +351,43 @@ interface StepStrings {
328
351
  "dcv3.mrz.valid"?: string;
329
352
  "dcv3.mrz.looksLikePassport"?: string;
330
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;
331
391
  "native.doc.introTitle"?: string;
332
392
  "native.doc.introLead"?: string;
333
393
  "native.doc.tip.flat"?: string;
@@ -404,10 +464,11 @@ interface StepStrings {
404
464
  "inApp.copied"?: string;
405
465
  "inApp.copyFailed"?: string;
406
466
  "inApp.continueAnyway"?: string;
467
+ "inApp.openBrowser"?: string;
407
468
  }
408
469
 
409
470
  /**
410
- * Loads the copy of a Human-only locale (es, pt, de); resolves at once for ar/fr/en. The components load it by
471
+ * Loads the copy of an overlay locale (es, pt, de); resolves at once for ar/fr/en. The components load it by
411
472
  * themselves (they render once it is there); call it ahead to have the copy ready on the first render. A failed
412
473
  * download leaves the locale on English.
413
474
  */
@@ -493,10 +554,16 @@ declare function DocumentCapture({ step, locale, strings, className, liveMrz, }:
493
554
  liveMrz?: DocumentLiveMrzOptions;
494
555
  }): react.JSX.Element;
495
556
 
496
- declare function PortraitCapture({ step, locale, strings, className, assetBaseUrl, }: StepComponentProps & {
557
+ declare function PortraitCapture({ step, locale, strings, className, assetBaseUrl, verification, }: StepComponentProps & {
497
558
  step: PortraitStepHandle;
498
559
  /** Self-hosted MediaPipe assets (wasm fileset + `face_landmarker.task`); default `/models-v3`. */
499
560
  assetBaseUrl?: string;
561
+ /**
562
+ * The session's verification: under capture mode `choice` (design 2026-11-04 §4.5) the person picks who films
563
+ * before the camera opens, when the portrait is the first camera step (a pick made at the liveness step holds).
564
+ * Without it the camera follows the step handle (`self` until a pick).
565
+ */
566
+ verification?: Verification;
500
567
  }): react.JSX.Element;
501
568
 
502
569
  /** `system` follows the device (prefers-color-scheme). */
@@ -547,6 +614,14 @@ interface SekyroVerificationProps {
547
614
  * SDKs). Take them back to your page. Without it, neither button is shown.
548
615
  */
549
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";
550
625
  /** Fires before the liveness upload (SDK spec §7.5 shadow hook). */
551
626
  onLivenessCaptured?: (artifacts: CapturedArtifacts) => void;
552
627
  /**
@@ -1,2 +1,2 @@
1
1
  "use client";
2
- import{a as zt}from"../chunk-Z43XZ75N.js";import{a as L,d as Ot,e as Ce,f as Le,g as Vt,h as Dt}from"../chunk-TLHEN5T3.js";import{a as Bt}from"../chunk-EZ5TVL6P.js";import{a as $t}from"../chunk-YY76AMUA.js";import{a as Ut,b as Kt,c as Gt,d as Wt}from"../chunk-TS3UFW5B.js";import{a as q}from"../chunk-PYAJMHZH.js";import{b as Mt,c as Rt,e as At,h as Lt}from"../chunk-UFAOAYQY.js";import{b as Tt}from"../chunk-JCCXPYU4.js";import{a as oe,b as ne,c as Oe,d as Ft,g as Ht}from"../chunk-6EP4O2CE.js";import{a as ce}from"../chunk-VRDPGOXM.js";import{a as Oo,b as Vo,c as Do,d as Bo,e as Fo,f as Ne,g as x}from"../chunk-VKSX4KC3.js";import{a as I,b as Ve}from"../chunk-AIBCIUYT.js";import{a as N,c as _t,i as Ao,k as Lo,l as xt,m as It,n as Et,t as Ae,u as le}from"../chunk-IJE64ZEN.js";import{a as s}from"../chunk-2KED7D2Q.js";import{useEffect as Ho,useState as Yt}from"react";function Ge(e){let[t,o]=Yt(()=>e?.currentStep?.()??null),[n,a]=Yt(null);return Ho(()=>{if(e===void 0)return;if(typeof e.run!="function"){a(new Error("The step components need @sekyro/web 0.2 or later (Verification.run)."));return}let i=!0,r=e.on("step",l=>{i&&o(l)});return e.run().then(l=>{i&&o(c=>c??l)},l=>{i&&a(l)}),()=>{i=!1,r()}},[e]),{step:t,error:n}}s(Ge,"useVerificationStep");import{useEffect as eo,useId as Ko,useMemo as Go,useRef as to,useState as ie}from"react";var $o="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",Zt;function qt(e){return Zt??(Zt=new Map($o.split(" ").map(t=>{let[o,n]=t.slice(2).split("/");return[t.slice(0,2),[o,n]]}))),Zt.get(e.toUpperCase())}s(qt,"entryOf");function Jt(e){return qt(e)?.[0]}s(Jt,"dialCodeOf");function Qt(e){return qt(e)?.[1]}s(Qt,"nationalPrefixOf");import{normalizeNni as Uo}from"@sekyro/web";function De(e){let t=Uo(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 o="",n=0;for(let a of t?.formats?.find(i=>new RegExp(`^(?:${i.leading})`).test(e))?.groups??[])n<e.length&&(o+=(n>0?" ":"")+e.slice(n,n+a)),n+=a;return o+e.slice(n)}s(ze,"groupDigits");function Xt(e,t){let o=0;for(let n=t;n>0&&o<e.length;o+=1)e[o]!==" "&&(n-=1);return o}s(Xt,"caretAfter");var Ye=s((e,t)=>t.find(o=>e.startsWith(o.dial)),"countryOfNumber"),jt=s((e,t)=>e.lengths.join(", ").replace(/, (\d+)$/,` ${t} $1`),"lengthsLabel");import{Fragment as io,jsx as g,jsxs as B}from"react/jsx-runtime";var oo=s((e,t)=>{if(e===void 0)return 0;let o=Date.parse(e)-t;return Number.isFinite(o)?Math.max(0,Math.ceil(o/1e3)):0},"secondsUntil"),Wo=s(e=>`${Math.floor(e/60)}:${String(e%60).padStart(2,"0")}`,"mmss"),zo=["whatsapp","sms"],Yo=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 no(e){let t=De(e).replace("+","");return/^\d{8,15}$/.test(t)?`+${t}`:null}s(no,"normalizedPhone");var Zo=s(e=>String.fromCodePoint(...Array.from(e,t=>127397+t.charCodeAt(0))),"flagOf");function qo(e){let t=[];for(let o of e.phoneCountries??["MR"]){let n=e.phoneRules?.find(i=>i.code===o),a=n?.dial??Jt(o);a!==void 0&&!t.some(i=>i.code===o)&&t.push({code:o,dial:`+${a}`,...n!==void 0?{rule:n}:{}})}return t}s(qo,"phoneCountriesOf");function Jo(e,t){if(t===null||!e.startsWith(t.dial))return no(e);let o=e.slice(t.dial.length).replace(/\D/g,""),n=Qt(t.code);return n!==void 0&&o.startsWith(n)&&(o=o.slice(n.length)),no(t.dial+o)}s(Jo,"e164Of");var ro=s((e,t)=>(Ye(e,t)??t[0])?.code??null,"countryFor");function Qo(e){let t=null;try{t=new Intl.DisplayNames([e],{type:"region"})}catch{}return o=>`${t?.of(o.code)??o.code} (${o.dial})`}s(Qo,"countryLabels");var so="other";function Ze({step:e,locale:t,strings:o,className:n,defaultPhone:a,onError:i}){let r=x(t,o),{t:l}=r,c=Go(()=>qo(e),[e.phoneCountries,e.phoneRules]),f=a??c[0]?.dial??"",[k,y]=ie(()=>ro(f,c)),S=c.map(d=>d.code).join(",");eo(()=>{if(k===null||!c.some(d=>d.code===k)){let d=ro(f,c);y(d);let h=E.current,te=c.find(Y=>Y.code===d)?.dial;te!==void 0&&D(Y=>h!==null&&Y.startsWith(h.dial)?te+Y.slice(h.dial.length):Y.startsWith("+")?Y:te)}},[S,f]);let m=c.find(d=>d.code===k)??null,E=to(m);m!==null&&(E.current=m);let[P,D]=ie(f),[w,T]=ie(!1),[K,G]=ie(!1),[b,O]=ie(""),[C,W]=ie(!1),[F,H]=ie(null),J=e.phase==="verify",Ie=$t(J),v=Ko(),he=to(null);eo(()=>{let d=setTimeout(()=>he.current?.focus({preventScroll:!0}),350);return()=>clearTimeout(d)},[J]);let u=s(async d=>{W(!0),H(null);try{await d()}catch(h){H(ce(h,r.strings)),i?.(h)}finally{W(!1)}},"run"),_=zo.filter(d=>(e.channels??[]).includes(d)),Q=e.phoneInternational===!0,ge=w||m===null,X=ge||P.startsWith("+")&&!P.startsWith(m.dial),se=X?void 0:m.rule,yt=X?P:P.replace(m.dial,"").replace(/\D/g,""),j=se?We(yt,se):yt,ht=X&&!ge&&!Q&&e.phoneRules?.length&&!c.some(d=>d.dial.startsWith(P)),He=ht?null:se?se.lengths.includes(j.length)?m.dial+j:null:ge&&!P.startsWith("+")?null:Jo(P,w?null:m),Ee=!e.needsPhone||He!==null,Te=s((d,h=!1)=>{u(()=>e.send({...e.needsPhone&&(!h||P!==f)?{phone:He??P}:{},...d!==void 0?{channel:d}:{}}))},"send"),gt=s(d=>{u(()=>e.verify(d))},"submitCode"),St=s(d=>{d.preventDefault(),J?gt(b):_.length<=1&&Ee&&Te(_[0])},"onSubmit"),Eo=s(d=>{let h=d.target,te=d.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,Ue=ae,Nt=ae;if(G(!1),!ke&&(ge||ae.startsWith("+")))Q&&T(!0);else{let ve=ke??m,Z=ke?ae.slice(ke.dial.length):ae;if(y(ve.code),T(!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),wt=Z.length-Ke.length;be-=wt,Z=wt>0&&!ke&&j.length===Ke.length?j:Ke}Nt=ve.dial+Z,Ue=ze(Z,ve.rule)}D(Nt),h.value=Ue;let Pt=Xt(Ue,be);h.setSelectionRange(Pt,Pt)},"onNumber"),Me=ht?l("otp.reason_otp_destination_not_allowed"):K&&se?l("otp.phoneLengthError",{digits:jt(se,l("otp.or"))}):"",kt=c.length>1||Q,ee=`${v}-phone`,bt=oo(e.codeExpiresAt,Ie),Se=oo(e.resendAvailableAt,Ie),Re=J&&e.codeExpiresAt!==void 0&&bt===0,$e=s(d=>l(d==="whatsapp"?"otp.channelWhatsapp":"otp.channelSms"),"label"),[To,Mo]=l("otp.sentTo",{channel:$e(e.channel)}).split("{number}"),Ro=e.reason==="otp_mismatch"?B(I,{tone:"danger",children:[g("span",{children:l("otp.reason_otp_mismatch")}),g("span",{children:Ve(r,e.attemptsRemaining,e.attemptsExhausted)})]}):e.reason!==void 0&&Yo.has(e.reason)?g(I,{tone:"warning",children:g("span",{children:l(`otp.reason_${e.reason}`)})}):null,vt=B(io,{children:[Ro,F!==null?g(I,{tone:"danger",children:g("span",{children:l(F)})}):null]});if(J){let d=_.length===0;return B("form",{className:`sekyro-step sekyro-otp${n?` ${n}`:""}`,"aria-labelledby":v,onSubmit:St,noValidate:!0,children:[g(oe,{id:v,title:l("otp.verifyTitle"),lead:B(io,{children:[To,g("bdi",{dir:"ltr",className:"sekyro-mono",children:e.sentToMasked}),Mo]})}),vt,B("div",{className:"sekyro-field",children:[g("label",{className:"sekyro-label",htmlFor:`${v}-code`,children:l("otp.codeLabel")}),g(Bt,{id:`${v}-code`,value:b,invalid:e.reason==="otp_mismatch",onChange:h=>{O(h),h.length===6&&b.length!==6&&!C&&!e.attemptsExhausted&&gt(h)}}),g("span",{className:`sekyro-help sekyro-otp-expiry${Re?" is-danger":""}`,"aria-hidden":!Re||void 0,children:Re?l("otp.expired"):l("otp.expiresIn",{time:Wo(bt)})})]}),g("span",{className:"sekyro-visually-hidden",role:"status","aria-live":"polite",children:Re?l("otp.expired"):""}),B(ne,{children:[g(N,{type:"submit",full:!0,disabled:C||b.length!==6||e.attemptsExhausted,"aria-busy":C||void 0,children:l("otp.verify")}),d?g("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:C||Se>0,onClick:()=>Te(void 0,!0),children:Se>0?l("otp.resendIn",{seconds:Se}):l("otp.resend")}):Se>0?g("p",{className:"sekyro-resend is-waiting",children:l("otp.resendIn",{seconds:Se})}):g("div",{className:"sekyro-resend-row",children:_.map(h=>g("button",{type:"button",className:"sekyro-link sekyro-resend",disabled:C,onClick:()=>Te(h,!0),children:l("otp.resendBy",{channel:$e(h)})},h))})]})]})}let Ct=Qo(r.locale);return B("form",{className:`sekyro-step sekyro-otp${n?` ${n}`:""}`,"aria-labelledby":v,onSubmit:St,noValidate:!0,children:[g(oe,{id:v,title:l("otp.sendTitle"),lead:l("otp.sendDescription")}),vt,e.needsPhone?B("div",{className:"sekyro-field",children:[g("label",{className:"sekyro-label",htmlFor:ee,children:l("otp.phoneLabel")}),B("div",{className:"sekyro-phone",dir:"ltr",children:[m===null||X&&!w?null:B("div",{className:"sekyro-phone__lead",children:[kt?B("select",{className:"sekyro-phone__country",dir:r.locale==="ar"?"rtl":"ltr","aria-label":`${l("otp.countryLabel")}: ${w?l("otp.otherCountry"):Ct(m)}`,value:w?so:m.code,onChange:d=>{G(!1);let h=c.find(te=>te.code===d.target.value);T(h===void 0),h!==void 0&&y(h.code),D(h===void 0?"":h.dial+(X?"":j))},children:[c.map(d=>g("option",{value:d.code,children:Ct(d)},d.code)),Q?g("option",{value:so,children:l("otp.otherCountry")}):null]}):null,B("span",{className:"sekyro-phone__dial",id:`${ee}-dial`,"aria-hidden":kt||void 0,children:[g("span",{className:"sekyro-phone__flag","aria-hidden":"true",children:w?"🌐":Zo(m.code)}),w?null:m.dial]})]}),g("input",{ref:he,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:ge?"+":void 0,value:X?P:ze(j,se),onChange:Eo,onKeyDown:d=>{d.key==="Enter"&&!Ee&&G(!0)},onBlur:d=>{d.relatedTarget?.tagName!=="SELECT"&&G(j!==""&&He===null)}})]}),X?null:g("span",{className:"sekyro-help",id:`${ee}-hint`,children:l("otp.phonePlaceholderGeneric")}),Me?g("span",{className:"sekyro-help is-danger",id:`${ee}-error`,role:"alert",children:Me}):null]}):g("p",{className:"sekyro-text-muted",children:l("otp.prefilledNotice")}),g(ne,{children:_.length>0?B("div",{className:"sekyro-actions__group",role:"group","aria-label":l("otp.chooseChannel"),children:[g("p",{className:"sekyro-label","aria-hidden":"true",children:l("otp.chooseChannel")}),_.map((d,h)=>g(N,{kind:h===0?"primary":"ghost",full:!0,disabled:C||!Ee,"aria-busy":h===0&&C||void 0,onClick:()=>Te(d),children:l("otp.sendBy",{channel:$e(d)})},d))]}):g(N,{type:"submit",full:!0,disabled:C||!Ee,"aria-busy":C||void 0,children:l("otp.send")})})]})}s(Ze,"PhoneOtpStep");import{lazy as jo,Suspense as en,useMemo as tn,useState as on}from"react";import{Component as Xo}from"react";var qe=class qe extends Xo{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 rn}from"react/jsx-runtime";var nn={load:s(()=>import("../email-otp-view-56JMHX3M.js"),"load")};function Je({locale:e,strings:t,...o}){let n=x(e,t),[a,i]=on(0),r=tn(()=>jo(()=>nn.load().then(c=>({default:c.EmailOtpView}))),[a]),l=rn(I,{tone:"danger",children:[pe("span",{children:n.t("errors.network_error")}),pe(N,{kind:"ghost",onClick:()=>i(c=>c+1),children:n.t("common.retry")})]});return pe(z,{fallback:l,children:pe(en,{fallback:pe("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:n.t("common.loading")}),children:pe(r,{...o,i18n:n})})},a)}s(Je,"EmailOtpStep");import{lazy as sn,Suspense as an,useMemo as ln,useState as cn}from"react";import{jsx as ue,jsxs as un}from"react/jsx-runtime";var pn={load:s(()=>import("../eid-view-BKKVB5QT.js"),"load")};function Qe({locale:e,strings:t,...o}){let n=x(e,t),[a,i]=cn(0),r=ln(()=>sn(()=>pn.load().then(c=>({default:c.EidView}))),[a]),l=un(I,{tone:"danger",children:[ue("span",{children:n.t("errors.network_error")}),ue(N,{kind:"ghost",onClick:()=>i(c=>c+1),children:n.t("common.retry")})]});return ue(z,{fallback:l,children:ue(an,{fallback:ue("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:n.t("common.loading")}),children:ue(r,{...o,i18n:n})})},a)}s(Qe,"EidStep");import{useMemo as Sn}from"react";import{lazy as dn,Suspense as mn,useMemo as fn,useState as yn}from"react";import{jsx as de,jsxs as gn}from"react/jsx-runtime";var hn={load:s(()=>import("../flow-views-7FMODRP7.js"),"load")};function M({view:e,i18n:t,quiet:o,...n}){let[a,i]=yn(0),r=fn(()=>dn(()=>hn.load().then(c=>({default:c[e]}))),[e,a]),l=gn(I,{tone:"danger",children:[de("span",{children:t.t("errors.network_error")}),de(N,{kind:"ghost",onClick:()=>i(c=>c+1),children:t.t("common.retry")})]});return de(z,{fallback:l,children:de(mn,{fallback:o===!0?null:de("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:t.t("common.loading")}),children:de(r,{...n,i18n:t})})},a)}s(M,"Flow");import{jsx as Xe,jsxs as kn}from"react/jsx-runtime";function je({step:e,locale:t,strings:o,className:n,onError:a}){let i=x(t,o),{busy:r,error:l,run:c}=Gt(i,a),f=Sn(()=>e.choice.options.flatMap(y=>{let S=Kt(y,i),m=Ut[y.service];return S===null?[]:[{id:y.id,label:S,glyph:m&&Xe(q,{name:m})}]}),[e.choice.options,i]),k=e.choice.options.find(y=>y.service==="national_eid");return kn("div",{className:n,children:[Xe(At,{title:i.t("method.title"),description:i.t("method.description"),options:f,busy:r,error:l,focus:!0,testId:"sekyro-method",onChoose:y=>c(()=>e.choose(y))}),k?.nationalEid?.afterPass==="continue"?Xe(M,{view:"EidContinueHint",i18n:i,provider:k.nationalEid.providerName,quiet:!0}):null]})}s(je,"MethodChoice");import{isValidNni as bn,normalizeNni as ao}from"@sekyro/web";import{useId as vn,useState as et}from"react";import{Fragment as wn,jsx as R,jsxs as me}from"react/jsx-runtime";var Cn=new Set(["nni_not_found","registry_record_not_found"]),Nn=new Set(["nni_invalid","id_number_invalid"]);function Be({step:e,locale:t,strings:o,className:n,onError:a}){let i=x(t,o),{t:r}=i,[l,c]=et(""),[f,k]=et(!1),[y,S]=et(null),m=vn(),E=e.attemptsExhausted,P=s(async W=>{k(!0),S(null);try{await W()}catch(F){S(ce(F,i.strings)),a?.(F)}finally{k(!1)}},"run"),D=s(W=>{if(W.preventDefault(),e.source!=="typed"){P(()=>e.confirm());return}let F=ao(l);if(!/^\d{10}$/.test(F))return S("population.invalid");if(!bn(F))return S("population.reason_id_number_invalid");P(()=>typeof e.submitIdNumber=="function"?e.submitIdNumber(F):e.submitNni(F))},"onSubmit"),w=Ve(i,e.attemptsRemaining,E),T=e.reason!==void 0&&Cn.has(e.reason),K=e.reason!==void 0&&Nn.has(e.reason),G=me(wn,{children:[e.reason==="registry_unavailable"?me(I,{tone:"warning",children:[R("span",{children:r("population.reason_registry_unavailable")}),R("span",{children:w})]}):null,T&&e.canUseDocument?me(I,{tone:"warning",children:[R("span",{children:r("population.reason_registry_record_not_found_or_document")}),R("span",{children:w}),R(N,{kind:"ghost",disabled:f,onClick:()=>{P(()=>e.useDocument())},children:r("population.useDocument")})]}):null,T&&!e.canUseDocument||K?me(I,{tone:"danger",children:[R("span",{children:r(T?"population.reason_registry_record_not_found":"population.reason_id_number_invalid")}),R("span",{children:w})]}):null,E&&e.reason===void 0?R(I,{tone:"danger",children:R("span",{children:w})}):null,y!==null?R(I,{tone:"danger",children:R("span",{children:r(y)})}):null]}),[b,O,C]=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${n?` ${n}`:""}`,"aria-labelledby":m,onSubmit:D,noValidate:!0,children:[R(oe,{id:m,title:r(b),lead:r(O)}),G,e.source==="typed"?me("div",{className:"sekyro-field",children:[R("label",{className:"sekyro-label",htmlFor:`${m}-id-number`,children:r("population.label")}),R("input",{id:`${m}-id-number`,className:"sekyro-input sekyro-input--number",dir:"ltr",inputMode:"numeric",autoComplete:"off",placeholder:r("population.placeholder"),value:l,"aria-describedby":`${m}-id-number-help`,"aria-invalid":y==="population.invalid"||y==="population.reason_id_number_invalid"||void 0,onChange:W=>{S(null),c(ao(W.target.value).replace(/\D/g,"").slice(0,10))}}),R("span",{id:`${m}-id-number-help`,className:"sekyro-help",children:r("population.helper")})]}):null,R(ne,{children:E?null:R(N,{type:"submit",full:!0,disabled:f,"aria-busy":f||void 0,children:r(C)})})]})}s(Be,"IdNumberEntry");function Pn(e){return Be(e)}s(Pn,"NniEntry");import{acceptedIssuers as Mn,acceptedTypesFor as Rn,warmDocumentCapture as An}from"@sekyro/web";import{lazy as Ln,Suspense as On,useEffect as Vn,useMemo as Dn,useState as mo}from"react";import{acceptedIssuers as _n,acceptedTypesFor as tt}from"@sekyro/web";import{useEffect as lo,useId as xn,useMemo as co,useState as ot}from"react";import{jsx as A,jsxs as fe}from"react/jsx-runtime";var po=s(e=>e.normalize("NFD").replace(/\p{Diacritic}/gu,"").toLocaleLowerCase(),"fold"),In=s(e=>String.fromCodePoint(...Array.from(e.toUpperCase(),t=>127397+t.charCodeAt(0))),"flag"),En=220;function Tn(e,t,o=[]){let n=null;try{n=new Intl.DisplayNames([e],{type:"region"})}catch{}let a=t.map(l=>({code:l,name:n?.of(l)??l})),i=new Intl.Collator(e),r=s(l=>{let c=o.indexOf(l);return c<0?o.length:c},"rank");return a.sort((l,c)=>r(l.code)-r(c.code)||i.compare(l.name,c.name))}s(Tn,"countryNames");function uo({step:e,i18n:t,issuer:o,onPicked:n}){let{t:a,locale:i}=t,r=co(()=>_n(e.documents),[e.documents]),l=co(()=>Tn(i,r,Object.keys(e.documents.byIssuer??{})),[i,r,e.documents]),c=r.length===1?r[0]:null,[f,k]=ot(o??c),[y,S]=ot(""),[m,E]=ot(null),P=xn(),D=c===null?[]:tt(e.documents,c),w=c!==null&&D.length===1?D[0]:null;lo(()=>{c!==null&&w!==null&&e.selectDocument(c,w)},[c,w]);let T=s((b,O)=>{e.selectDocument(b,O),n?.()},"pick"),K=s(b=>{let O=tt(e.documents,b);O.length===1?T(b,O[0]):k(b)},"chooseIssuer");if(lo(()=>{if(m===null||f===null)return;let b=setTimeout(()=>T(f,m),En);return()=>clearTimeout(b)},[m]),w!==null)return null;if(f===null){let b=po(y.trim()),O=b===""?l:l.filter(C=>po(C.name).includes(b)||C.code.toLowerCase()===b);return fe("section",{className:"sekyro-step",children:[A(oe,{title:a("doc.countryTitle"),lead:a("doc.pickDescription")}),fe("div",{className:"sekyro-field",children:[A("label",{className:"sekyro-label",htmlFor:P,children:a("doc.countryLabel")}),A("input",{id:P,type:"search",className:"sekyro-input",placeholder:a("doc.countrySearch"),value:y,onChange:C=>S(C.target.value)})]}),O.length===0?A("p",{className:"sekyro-text-muted",children:a("doc.noCountryMatch")}):A("ul",{className:"sekyro-rows",children:O.map(C=>A("li",{children:fe("button",{type:"button",className:"sekyro-row-btn",onClick:()=>K(C.code),children:[A("span",{className:"sekyro-row-btn__flag","aria-hidden":"true",children:In(C.code)}),C.name]})},C.code))}),A(ne,{children:null})]})}let G=tt(e.documents,f);return fe("section",{className:"sekyro-step",children:[A(oe,{title:a("doc.pickTitle"),lead:a("native.doc.holdIt")}),A("div",{className:"sekyro-choices",children:G.map(b=>fe("button",{type:"button",className:"sekyro-card","aria-pressed":m===b,disabled:m!==null&&m!==b,onClick:()=>E(b),children:[A(q,{name:b==="passport"?"passport":"card"}),fe("span",{className:"sekyro-card__body",children:[A("span",{className:"sekyro-card__title",children:a(`doc.type.${b}`)}),A("span",{className:"sekyro-card__sub",children:a(`doc.sub.${b}`)})]}),A("span",{className:"sekyro-radio","aria-hidden":"true"})]},b))}),r.length>1?A("button",{type:"button",className:"sekyro-link",onClick:()=>{k(null),E(null)},children:a("native.doc.changeCountry")}):null,A(ne,{children:null})]})}s(uo,"DocumentPicker");import{jsx as re,jsxs as Fn}from"react/jsx-runtime";var Bn={load:s(()=>import("../document-capture-view-6NADWNPQ.js"),"load")};function nt({step:e,locale:t,strings:o,className:n,liveMrz:a}){let i=x(t,o),[r,l]=mo(0),[c,f]=mo(null),k=Mn(e.documents).length>1,y=e.issuer!==null&&Rn(e.documents,e.issuer).length>1,S=Dn(()=>Ln(()=>Bn.load().then(E=>({default:E.DocumentCaptureView}))),[r]);Vn(()=>{An()},[]);let m=Fn(I,{tone:"danger",children:[re("span",{children:i.t("errors.network_error")}),re(N,{kind:"ghost",onClick:()=>l(E=>E+1),children:i.t("doc.retryCamera")})]});return re("div",{className:n,children:e.documentType===null||e.issuer===null||c!==null?re(uo,{step:e,i18n:i,...c==="document"&&e.issuer!==null?{issuer:e.issuer}:{},onPicked:()=>f(null)}):re(z,{fallback:m,children:re(On,{fallback:re("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:i.t("common.loading")}),children:re(S,{step:e,i18n:i,liveMrz:a,...k?{onChangeCountry:s(()=>f("country"),"onChangeCountry")}:{},...y?{onChangeDocument:s(()=>f("document"),"onChangeDocument")}:{}})})},r)})}s(nt,"DocumentCapture");import{warmPortraitCapture as Hn}from"@sekyro/web";import{Component as $n,lazy as Un,Suspense as Kn,useEffect as Gn,useMemo as Wn,useState as zn}from"react";import{jsx as V,jsxs as st}from"react/jsx-runtime";var Yn={load:s(()=>import("../portrait-capture-view-JYTBBXFU.js"),"load")},at=class at extends $n{constructor(){super(...arguments);this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}render(){return this.state.failed?this.props.fallback:this.props.children}};s(at,"LoadBoundary");var rt=at;function Zn({step:e,i18n:t}){let{t:o}=t,n=le();return st("section",{className:"sekyro-stack sekyro-stack--2","data-testid":"sekyro-portrait-match",children:[V("h2",{ref:n,tabIndex:-1,className:"sekyro-text-body",children:o(e.review?"portrait.reviewTitle":"session.steps.portrait.title")}),e.review?V("p",{className:"sekyro-text-muted",children:o("portrait.reviewDescription")}):null,e.uploadFailed?st(I,{tone:"danger",children:[V("span",{children:o("portrait.uploadFailed")}),V(N,{kind:"ghost",onClick:()=>{e.resubmit()},children:o("portrait.sendAgain")})]}):V("p",{role:"status","aria-live":"polite","aria-busy":"true",className:"sekyro-text-muted",children:o("portrait.matching")})]})}s(Zn,"MatchPhase");function it({step:e,locale:t,strings:o,className:n,assetBaseUrl:a}){let i=x(t,o),[r,l]=zn(0),c=Wn(()=>Un(()=>Yn.load().then(k=>({default:k.PortraitCaptureView}))),[r]);if(Gn(()=>{e.phase==="capture"&&Hn()},[e.phase]),e.phase==="match")return V("div",{className:n,children:V(Zn,{step:e,i18n:i})});let f=st(I,{tone:"danger",children:[V("span",{children:i.t("errors.network_error")}),V(N,{kind:"ghost",onClick:()=>l(k=>k+1),children:i.t("portrait.retryCamera")})]});return V("div",{className:n,children:V(rt,{fallback:f,children:V(Kn,{fallback:V("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:i.t("common.loading")}),children:V(c,{step:e,i18n:i,...a!==void 0?{assetBaseUrl:a}:{}})})},r)})}s(it,"PortraitCapture");import{cameraUnavailableCauseOf as dr}from"@sekyro/web";import{useCallback as _e,useEffect as xo,useId as mr,useRef as dt,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"}}},qn=["danger","success","warning","info"];function lt(e){let t=e/255;return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}s(lt,"channel");function fo(e){let t=lt(parseInt(e.slice(1,3),16)),o=lt(parseInt(e.slice(3,5),16)),n=lt(parseInt(e.slice(5,7),16));return .2126*t+.7152*o+.0722*n}s(fo,"luminance");function Jn(e,t){let o=fo(e),n=fo(t),a=Math.max(o,n),i=Math.min(o,n);return(a+.05)/(i+.05)}s(Jn,"contrastRatio");function yo(e,t){return Math.min(...qn.map(o=>Jn(Pe[e][o].fg,t)))}s(yo,"worstAgainst");function ho(e,t,o){return Math.min(yo(e,t),yo(e,o))}s(ho,"worstStatusContrast");function go(e,t){return ho("light",e,t)>=ho("dark",e,t)?"light":"dark"}s(go,"statusSchemeFor");import{useId as Qn,useState as Xn}from"react";import{jsx as Fe,jsxs as So}from"react/jsx-runtime";var jn=["intro","data","processing","sharing","retention"];function ko({i18n:e,purpose:t="identity"}){let{t:o}=e,[n,a]=Xn(!1),i=Qn(),[r,l=""]=o("consent.short").split("{terms}");return So("section",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-consent",children:[So("p",{className:"sekyro-text-muted",children:[r,Fe("button",{type:"button",className:"sekyro-link","aria-expanded":n,"aria-controls":i,onClick:()=>a(c=>!c),children:o("consent.termsLink")}),l]}),Fe("div",{id:i,hidden:!n,className:"sekyro-stack sekyro-stack--1 sekyro-text-muted","data-testid":"sekyro-consent-terms",children:t==="human"?Fe(M,{view:"HumanConsentTerms",i18n:e,quiet:!0}):jn.map(c=>Fe("p",{children:o(`consent.terms.${c}`)},c))})]})}s(ko,"ConsentNotice");function bo(e){let t=e.trim().split(/\s+/).filter(n=>n!=="");return(t.length>=2?[t[0],t[1]].map(n=>Array.from(n??"")[0]??""):Array.from(t[0]??"").slice(0,2)).join("").toUpperCase()}s(bo,"initials");import{useSyncExternalStore as er}from"react";var No=s(e=>({colors:{...e?L.dark:L.light},radius:L.radiusLg,fontFamily:L.font}),"brandTheme"),Pi=No(!1),vo=/^#[0-9a-f]{6}$/i;function ct(e,t,o){if(t)return null;let n=Ce(e).colors,a=o?.colors?.bg??n?.bg,i=o?.colors?.surface??n?.surface;return a===void 0&&i===void 0||a!==void 0&&!vo.test(a)||i!==void 0&&!vo.test(i)?null:go(a??L.light.bg,i??L.light.surface)}s(ct,"partnerStatusScheme");function Po(e,t,o){let n=Ce(e);if(o&&n.colors!==void 0){let{brand:a,brandFg:i}=n.colors;a!==void 0&&rr(a,L.dark.bg)>=3?n.colors={brand:a,ring:a,...i!==void 0?{brandFg:i}:{}}:delete n.colors}if(ct(e,o,t)==="dark"){let a=Pe.dark;n.colors={...n.colors,danger:a.danger.base,success:a.success.base,warning:a.warning.fg}}return Le(No(o),n,Ot(t))}s(Po,"verificationTheme");function wo(e){let t=er(nr,or,()=>!1);return e==="dark"||e==="system"&&t}s(wo,"useDarkScheme");var tr="(prefers-color-scheme: dark)",_o=s(()=>typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia(tr):null,"media"),or=s(()=>_o()?.matches??!1,"prefersDark");function nr(e){let t=_o();return t?.addEventListener("change",e),()=>t?.removeEventListener("change",e)}s(nr,"subscribe");function rr(e,t){let[o,n]=[Co(e),Co(t)];return(Math.max(o,n)+.05)/(Math.min(o,n)+.05)}s(rr,"contrast");function Co(e){let t=[1,3,5].map(o=>{let n=Number.parseInt(e.slice(o,o+2),16)/255;return n<=.03928?n/12.92:((n+.055)/1.055)**2.4});return .2126*(t[0]??0)+.7152*(t[1]??0)+.0722*(t[2]??0)}s(Co,"luminance");import{useEffect as sr,useId as ir,useState as ar}from"react";import{jsx as $,jsxs as we}from"react/jsx-runtime";var lr=new Set(["document_id_number_mismatch","name_mismatch","birth_date_mismatch"]),cr={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 pr({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:cr[e],pathLength:"1",transform:"translate(39 39) scale(2.4167)"})]})}s(pr,"OutcomeMark");function ur({label:e,id:t,copied:o}){let[n,a]=ar(!1);return sr(()=>{if(!n)return;let i=setTimeout(()=>a(!1),1600);return()=>clearTimeout(i)},[n]),we("button",{type:"button",className:`sekyro-reference${n?" is-copied":""}`,onClick:()=>{navigator.clipboard?.writeText(t).then(()=>a(!0),()=>{})},children:[$("span",{"aria-live":"polite",children:n?o:e}),$("bdi",{dir:"ltr",children:t}),$(q,{name:"copy"})]})}s(ur,"ReferenceLine");function pt({step:e,locale:t,strings:o,className:n,onClose:a}){let i=x(t,o),{t:r}=i,l=ir(),c=le(),f=e.context.orgName,k=e.display==="approved"?"approved":e.display==="review"?"review":e.display==="expired"?"expired":"rejected",y;switch(e.display){case"policy_stop":{let S=e.failureReason??"";if(lr.has(_t(S)))y=r("session.result.detailsMismatch",{org:f});else if(S==="device_velocity_exceeded")y=r("session.result.deviceVelocity",{org:f});else if(S==="capture_tampered")y=r("session.result.deviceStop");else if(S==="camera_unavailable")y=r("reasons.camera_unavailable",{org:f});else{let m=It(S);y=m!==null?r(m,{org:f}):r("session.result.rejected.description")}break}case"cooldown":{let S=Et(i.locale,e.retryAfter);y=S!==null?r(S.key,{time:S.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.${k}`,{org:f}):r(`session.result.${k}.description`)}return we("section",{className:`sekyro-result${n?` ${n}`:""}`,"aria-labelledby":l,"data-testid":"sekyro-result",children:[we("div",{className:"sekyro-result__body",children:[$(pr,{outcome:e.display==="cooldown"?"review":k}),we("div",{className:"sekyro-heading",children:[$("h2",{id:l,ref:c,tabIndex:-1,className:"sekyro-text-body",children:r(`session.result.${k}.title`)}),$("p",{className:"sekyro-text-muted",children:y})]}),$(ur,{label:r("result.referenceLabel"),id:e.context.sessionId,copied:r("native.result.copied")})]}),a!==void 0?$("div",{className:"sekyro-actions",children:$(N,{full:!0,onClick:a,children:f!==""?r("native.result.back",{org:f}):r("native.close")})}):null]})}s(pt,"VerificationResultScreen");import{Fragment as ut,jsx as p,jsxs as U}from"react/jsx-runtime";function fr(e,t,o){let n=t?L.dark:L.light,a=t?L.roles.dark:L.roles.light,i=e.colors??{},r={},l=i.fg===n.fg&&i.surface===n.surface;if(i.brand===n.brand&&i.surface===n.surface&&(r["--sekyro-color-brand-soft"]=a.brandSoft),l&&(r["--sekyro-color-line"]=a.line,r["--sekyro-color-line-subtle"]=a.lineSubtle,r["--sekyro-color-line-strong"]=a.lineStrong,r["--sekyro-color-sunken"]=a.sunken),i.fgMuted===n.fgMuted&&i.surface===n.surface&&(r["--sekyro-color-fg-subtle"]=a.fgSubtle),e.fontFamily===L.font&&(r["--sekyro-font-display"]=L.fontDisplay),o!==null){let c=Pe[o];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(fr,"flowRoles");function mt(e){let{verification:t,locale:o,strings:n,onStep:a,onResult:i}=e,{step:r,error:l}=Ge(t);xo(()=>{r!==null&&a?.(r)},[r,a]),xo(()=>i===void 0?void 0:t.on("result",i),[t,i]);let c=wo(e.colorScheme??"light"),f=r?.context.branding,k=Po(f,e.theme,c),[y,S]=xe(!1),m=`sekyro-verification${c?" sekyro-verification--dark":""}${y?" is-immersive":""}${e.className!==void 0?` ${e.className}`:""}`,E=dt(e.onClose);E.current=e.onClose;let P=dt(r);P.current=r;let D=_e(()=>{let w=P.current;E.current?.(w?.kind==="result"?{reason:"finished",result:w.result}:{reason:"cancelled"})},[]);return p(Dt,{theme:k,className:m,children:p(Ne,{locale:o,...n!==void 0?{strings:n}:{},children:p("div",{dir:e.dir??(o==="ar"?"rtl":"ltr"),lang:o,className:"sekyro-flow",style:fr(k,c,ct(f,c,e.theme)),children:p(Ft.Provider,{value:S,children:p(Oe.Provider,{value:e.onClose!==void 0?D:void 0,children:p(gr,{...e,step:r,error:l,immersive:y})})})})})})}s(mt,"SekyroVerification");function yr(e,t){if(t===void 0)return null;let o=e,n=o[`session.processing.${t}.title`],a=o[`session.processing.${t}.description`];return typeof n=="string"&&n!==""&&typeof a=="string"&&a!==""?{title:n,description:a}:null}s(yr,"processingCopyOf");function hr({error:e,retry:t}){let{t:o}=x(),n=le();return U(Ae,{tone:"danger",testId:"sekyro-error-notice",children:[p("span",{children:o(xt(e.kind))}),e.retryable?p(N,{ref:n,kind:"ghost",className:"sekyro-btn--start",onClick:t,children:o("common.retry")}):null]})}s(hr,"CameraErrorNotice");function gr(e){let{step:t,error:o,slots:n,immersive:a}=e,i=x(),{t:r}=i,[l,c]=xe(!1),[f,k]=xe(0),[y,S]=xe(null),m=t?.context.purpose??"identity",E=e.verification,P=m==="human"||t?.context.cameraUnavailableHandled===!0,D=E.reportCameraUnavailable!==void 0&&P?u=>E.reportCameraUnavailable?.(u)??Promise.resolve():void 0,w=t?.kind==="liveness"&&t.mode==="liveness"&&t.reason===void 0&&!t.attemptsExhausted,T=e.handoffUrl,K=_e((u,_)=>D===void 0?void 0:p(M,{view:"NoCameraView",i18n:i,quiet:!0,cause:_,onRetry:u,...w?{onContinue:D}:{},...T!==void 0?{handoffUrl:T}:{}}),[i,E,P,w,T]),G=_e((u,_)=>p(Wt,{start:u,context:_,human:m==="human",extra:_.canChooseFacing&&p(Rt,{value:_.facing,onChange:_.setFacing}),notice:_.permissionSettled&&_.permission==="denied"?K(u,"denied"):void 0}),[m,K]),b=_e((u,_)=>{let Q=dr(u.kind);return(Q!==void 0?K(_,Q):void 0)??U(ut,{children:[p(hr,{error:u,retry:_}),Q!==void 0&&T!==void 0?p(M,{view:"DesktopHandoffView",i18n:i,quiet:!0,url:T}):null]})},[K,T,i]),O=dt(""),C=e.livenessProps?.slots?.stageOverlay,W=_e(u=>(u.guidance!==""&&!u.coached&&(O.current=u.guidance),p(zt,{testId:"sekyro-capture-stage",video:p("video",{ref:u.videoRef,playsInline:!0,muted:!0,className:"sekyro-lm-video sekyro-fc-video","aria-hidden":"true","data-testid":"sekyro-capture-video"}),instruction:u.guidance!==""?u.guidance:O.current,note:u.note,busy:u.settled,progress:u.phase==="seeking"||u.phase==="aligning"?u.progress:1,still:u.still,live:u.live,closeLabel:r("native.close"),overlay:C?.(u.videoRef),ramp:u.ramp?.colour??null,...u.settled?{}:{onClose:s(()=>k(_=>_+1),"onClose")},end:u.switchCamera&&p("button",{type:"button",className:"sekyro-glass",onClick:u.switchCamera,"aria-label":r("capture.switchCamera"),children:p(Tt,{})})})),[r,C]),F=mr();if(o!==null)return p(Ae,{tone:"danger",children:p("span",{children:r(ce(o,i.strings))})});if(t===null)return p("p",{role:"status","aria-busy":"true",className:"sekyro-text-muted",children:r("common.loading")});let{context:H}=t,J=s(u=>{c(!0),u().finally(()=>c(!1))},"refresh"),Ie=n?.header??p(kr,{context:H,headerId:F,end:n?.headerEnd}),v,he=y===t.key&&t.context.switchable!==void 0;if(he)v=p(M,{view:"LaneChoiceView",i18n:i,step:t,onClose:()=>S(null)});else switch(t.kind){case"phone_otp":v=p(Ze,{step:t});break;case"email_otp":v=p(Je,{step:t});break;case"method":v=p(je,{step:t});break;case"registry":v=p(Be,{step:t});break;case"document":v=p(nt,{step:t,...e.documentLiveMrz!==void 0?{liveMrz:e.documentLiveMrz}:{}});break;case"liveness":{let u=e.livenessProps?.slots?.intro,_={...e.livenessProps??{},slots:{...e.livenessProps?.slots,intro:u??G,...u===void 0&&e.livenessProps?.slots?.errorPanel===void 0?{errorPanel:b}:{}},...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};v=p(Mt.Provider,{value:W,children:t.instructions==="icao"||t.livePhoto?.icao===!0?p(M,{view:"LivePhotoLiveness",i18n:i,step:t,livenessProps:_,sekyroIntro:u===void 0},f):p(Lt,{..._},f)});break}case"portrait":v=U(ut,{children:[t.retakeOnly?p(M,{view:"PortraitRetakeNotice",i18n:i,quiet:!0}):null,p(it,{step:t,...e.assetBaseUrl!==void 0?{assetBaseUrl:e.assetBaseUrl}:{}})]});break;case"contact_choice":v=p(M,{view:"ContactChoiceView",i18n:i,step:t});break;case"choice":v=p(M,{view:"GenericChoiceView",i18n:i,step:t});break;case"identity_summary":v=p(M,{view:"IdentitySummaryView",i18n:i,step:t});break;case"mobile_required":v=e.handoffUrl!==void 0?p(M,{view:"HandoffView",i18n:i,url:e.handoffUrl,refresh:t.refresh}):U(Ae,{tone:"info",children:[p("strong",{children:r("handoff.title")}),p("span",{children:r("reasons.mobile_required")}),p(N,{kind:"ghost",disabled:l,onClick:()=>J(t.refresh),children:r("common.refresh")})]});break;case"processing":{let u=yr(i.strings,t.service);v=U("section",{className:"sekyro-stack sekyro-stack--1",role:"status","aria-live":"polite",children:[p("h2",{className:"sekyro-text-body",children:u?.title??r("session.processing.title")}),p("p",{className:"sekyro-text-muted",children:u?.description??r("session.processing.description")}),t.stalled?p(N,{kind:"ghost",disabled:l,onClick:()=>J(t.refresh),children:r("common.refresh")}):null]});break}case"eid":v=p(Qe,{step:t});break;case"unsupported":{let u=t.reason==="platform_unsupported";v=U("section",{className:"sekyro-stack sekyro-stack--1",children:[p("h2",{className:"sekyro-text-body",children:r(u?"needsApp.title":"unsupported.title")}),p("p",{children:u?H.orgName!==""?r("needsApp.description",{org:H.orgName}):r("needsApp.descriptionNoOrg"):r("unsupported.description",{org:H.orgName})})]});break}case"result":v=n?.result?.(t)??p(Sr,{step:t});break;default:{let u=t;v=null}}return U(ut,{children:[a?null:Ie,!a&&t.kind!=="result"&&H.sections.length>1?p(br,{context:H,current:t.section,i18n:i}):null,!a&&!H.consentRecorded&&t.kind!=="result"?p(ko,{i18n:i,purpose:H.purpose}):null,p(Ht,{pageKey:t.key,children:v}),!a&&!he&&t.kind!=="result"&&t.context.switchable!==void 0?p(M,{view:"LaneSwitch",i18n:i,step:t,onOpen:()=>S(t.key),quiet:!0},t.key):null,a?null:n?.footer!==void 0?n.footer:H.branding?.hideAttribution===!0?null:U("a",{className:"sekyro-footer",href:"https://sekyro.ai",target:"_blank",rel:"noopener noreferrer",children:[p(q,{name:"lock"}),r("shell.verifiedBy")]})]})}s(gr,"Body");function Sr({step:e}){return p(Oe.Consumer,{children:t=>p(pt,{step:e,...t!==void 0?{onClose:t}:{}})})}s(Sr,"ResultPage");function kr({context:e,headerId:t,end:o}){let{t:n}=x(),[a,i]=xe(!1),r=a?void 0:e.branding?.logoUrl,l=e.orgName!==""?e.orgName:n(e.returning?"returning.title":"session.title");return U("header",{className:"sekyro-stack sekyro-stack--3","aria-labelledby":t,children:[U("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)}):bo(e.orgName)}),U("div",{className:"sekyro-org__text",children:[p("h1",{id:t,className:"sekyro-org__name",children:l}),p("p",{className:"sekyro-org__sub",children:n(e.purpose==="human"?"shell.subtitleHuman":"shell.subtitle")})]}),o!=null?p("div",{className:"sekyro-org__end",children:o}):null,p(Oe.Consumer,{children:c=>c!==void 0?p("button",{type:"button",className:"sekyro-disc sekyro-org__close","aria-label":n("native.close"),onClick:c,children:p(q,{name:"close"})}):null})]}),e.returning?p("p",{className:"sekyro-text-muted",children:n("returning.description")}):null]})}s(kr,"OrgHeader");function br({context:e,current:t,i18n:o}){let n=t===null?-1:e.sections.indexOf(t),a=e.progress,i=a!==void 0&&a.length===e.sections.length?a:e.sections.map((r,l)=>({id:r,state:l<n?"done":l===n?"current":"upcoming"}));return p("ol",{className:"sekyro-progress__bars","aria-label":o.t("session.progressLabel"),children:i.map(({id:r,state:l})=>p("li",{className:`sekyro-progress__bar${l==="done"?" is-done":l==="current"?" is-current":""}`,...l==="current"?{"aria-current":"step"}:{},children:p("span",{className:"sekyro-visually-hidden",children:o.strings[`section.${r}`]??r})},r))})}s(br,"SectionProgress");import{useEffect as Cr,useState as Io}from"react";var vr=/FBAN|FBAV|FB_IAB|FBIOS|MessengerForiOS|Instagram|WhatsApp|musical_ly|BytedanceWebview|TikTok|Snapchat|\bLine\/|LinkedInApp|Pinterest|MicroMessenger|; wv\)/i;function ft(e){let t=e??(typeof navigator>"u"?"":String(navigator.userAgent??""));return vr.test(t)}s(ft,"isInAppBrowser");import{jsx as ye}from"react/jsx-runtime";function Nr(){return typeof window>"u"?"":window.location.href.split("#")[0]??""}s(Nr,"pageUrl");function Pr({hostedUrl:e,inAppBrowser:t,...o}){let[n,a]=Io(t===!0);Cr(()=>{t===void 0&&ft()&&a(!0)},[t]);let[i,r]=Io(!1),l=o.handoffUrl??e??Nr();return n&&!i?ye(Vt,{theme:Le(Ce(void 0),o.theme),...o.className!==void 0?{className:o.className}:{},children:ye(Ne,{locale:o.locale,...o.strings!==void 0?{strings:o.strings}:{},children:ye("div",{dir:o.dir??(o.locale==="ar"?"rtl":"ltr"),lang:o.locale,className:"sekyro-stack sekyro-stack--4",children:ye(wr,{url:l,onContinue:()=>r(!0)})})})}):ye(mt,{...o,...l!==""?{handoffUrl:l}:{}})}s(Pr,"SekyroFlow");function wr({url:e,onContinue:t}){let o=x();return ye(M,{view:"InAppBrowserPrompt",i18n:o,url:e,onContinue:t})}s(wr,"Prompt");export{nt as DocumentCapture,Qe as EidStep,Je as EmailOtpStep,Be as IdNumberEntry,je as MethodChoice,Pn as NniEntry,Ze as PhoneOtpStep,it as PortraitCapture,Pr as SekyroFlow,mt as SekyroVerification,Ne as StepI18nProvider,pt as VerificationResultScreen,Oo as arSteps,Vo as enSteps,Bo as formatTemplate,Do as frSteps,ft as isInAppBrowser,Ao as loadSekyroLocale,Fo as resolveSekyroStrings,Lo as retakeHintStringKey,x 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};