@sekyro/web 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 (41) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/{capture-session-doc-5FHM3DSX.js → capture-session-doc-TATPATSZ.js} +1 -1
  3. package/dist/{capture-session-v3-DsHBvxFa.d.ts → capture-session-v3-Dxus1Se9.d.ts} +1 -1
  4. package/dist/{capture-session-v3-DVJvecJq.d.cts → capture-session-v3-DyUA2uCL.d.cts} +1 -1
  5. package/dist/chunk-3SL74TFR.js +1 -0
  6. package/dist/{chunk-M35OBPDV.js → chunk-4RS4LP7D.js} +1 -1
  7. package/dist/{chunk-7SJHXIM3.js → chunk-GYNWLJYW.js} +1 -1
  8. package/dist/{chunk-G7WHAP7L.js → chunk-J4NL62VQ.js} +1 -1
  9. package/dist/chunk-MMTOOH32.js +1 -0
  10. package/dist/{chunk-RBDRJRXB.js → chunk-QBPD7FRF.js} +1 -1
  11. package/dist/{chunk-EIFZSEYD.js → chunk-SDWHJJ4W.js} +1 -1
  12. package/dist/{chunk-RNZ4CQEC.js → chunk-TWB4LTCE.js} +1 -1
  13. package/dist/{chunk-23XZDY52.js → chunk-ULMH32G5.js} +1 -1
  14. package/dist/client/index.cjs +1 -1
  15. package/dist/client/index.d.cts +4 -4
  16. package/dist/client/index.d.ts +4 -4
  17. package/dist/client/index.js +1 -1
  18. package/dist/core/index.cjs +1 -1
  19. package/dist/core/index.d.cts +3 -3
  20. package/dist/core/index.d.ts +3 -3
  21. package/dist/core/index.js +1 -1
  22. package/dist/{create-document-capture-4KABJ5FV.js → create-document-capture-5FJI57YI.js} +1 -1
  23. package/dist/{create-verification-60S1U9Dl.d.cts → create-verification-CIwl0NIg.d.cts} +12 -4
  24. package/dist/{create-verification-2hqtJWN9.d.ts → create-verification-CNCMU1kK.d.ts} +12 -4
  25. package/dist/{icao-gate-B2zgdb5m.d.ts → icao-gate-5FzqyitT.d.ts} +1 -1
  26. package/dist/{icao-gate-sKqrgMTo.d.cts → icao-gate-C-lfjEpH.d.cts} +1 -1
  27. package/dist/index.cjs +1 -1
  28. package/dist/index.d.cts +6 -6
  29. package/dist/index.d.ts +6 -6
  30. package/dist/index.js +1 -1
  31. package/dist/internal/index.cjs +1 -1
  32. package/dist/internal/index.d.cts +6 -6
  33. package/dist/internal/index.d.ts +6 -6
  34. package/dist/internal/index.js +1 -1
  35. package/dist/{plan-runner-FZJ5KVT3.js → plan-runner-WRY4FOWW.js} +1 -1
  36. package/dist/{types-BZXO8xhw.d.cts → types-CKgMWVnP.d.cts} +50 -6
  37. package/dist/{types-BZXO8xhw.d.ts → types-CKgMWVnP.d.ts} +50 -6
  38. package/package.json +1 -1
  39. package/sbom.cdx.json +7 -7
  40. package/dist/chunk-4SQBEKG7.js +0 -1
  41. package/dist/chunk-ZJUA2Y22.js +0 -1
@@ -1,11 +1,11 @@
1
- import { a_ as DocCatalogEntry, a$ as LiveMrzTuning, b0 as TextLockTuning, b1 as OcrEngineClient, b2 as DocAssistReport, b3 as ReadyInfo, b4 as LoadFailure, b5 as OcrEngineOptions, b6 as SubmitRuntime, a1 as LivenessCaptureOptions, a0 as LivenessCaptureHandle, aJ as VerificationStep, aH as VerificationResult, ay as StepSnapshot, Y as LivePhotoGateUpdate, b7 as HostedClientLike } from '../create-verification-60S1U9Dl.cjs';
2
- export { b8 as ANALYSIS_LONG_EDGE, b9 as ASPECT_BANDS, ba as AttestationError, bb as BLUR_REFUSE_SHARPNESS_MAX, bc as BlurStatus, bd as CAPTURE_CANDIDATE_SPACING_MS, be as CAPTURE_EXTRA_CANDIDATES, bf as CLIP_MIME_ALLOWLIST, bg as CaptureEngine, bh as CaptureSessionDoc, bi as CaptureSessionDocEvents, bj as CaptureSessionDocOptions, bk as DOC_ANALYSIS_DEFAULTS, bl as DOC_BLACK_FRAME_LUMA, bm as DOC_BLACK_FRAME_TICKS, bn as DOC_CADENCE_HZ, bo as DOC_CAMERA_TUNING_DEFAULTS, bp as DOC_CATALOG, bq as DOC_DETECT_WIDTH, br as DOC_FEEDBACK_STATES, bs as DOC_FIRST_FRAME_MS, bt as DOC_GATE_V1_DEFAULTS, bu as DOC_SHUTTER_DEFAULTS, bv as DeviceReadHint, bw as DocArtifacts, bx as DocAssist, by as DocAssistEngine, bz as DocAssistTick, bA as DocCameraTuning, bB as DocCaptureReport, bC as DocCaptureVia, bD as DocChecksPayload, bE as DocEngineLike, bF as DocFeedbackAggregator, bG as DocFeedbackKey, bH as DocFeedbackState, bI as DocFormat, bJ as DocFrameAnalysis, bK as DocFrameMeasures, bL as DocGateQuality, bM as DocGateThresholds, bN as DocGateTick, bO as DocGateTickInput, bP as DocGateV1, bQ as DocQuad, bR as DocQuadPoint, bS as DocShutterReason, bT as DocShutterTuning, bU as DocSide, bV as DocumentCaptureController, bW as DocumentCaptureInternals, bX as EMPTY_GUIDE_METRICS, bY as EncodedDocument, bZ as FLIP_FILL_MIN, b_ as FLIP_GAP_MS, b$ as FLIP_TIMEOUT_MS, c0 as FocusCaps, c1 as FramingStatus, c2 as GUIDE_LOCK_DEFAULTS, c3 as GlareStatus, c4 as GrabbedFrame, c5 as GuideBlocker, c6 as GuideLock, c7 as GuideLockTick, c8 as GuideLockTuning, c9 as GuideMetrics, ca as GuideRect, cb as INFERENCE_RETRY_ATTEMPTS, cc as INFERENCE_RETRY_DEFAULT_S, U as ISSUER_CODES, cd as LANDMARKER_MODEL, ce as LENS_STORAGE_KEY, cf as LENS_TRY_MAX, cg as LIVE_MRZ_DEFAULTS, ch as LIVE_PHOTO_IDLE_MS, ci as LIVE_PHOTO_MAX_HZ, cj as LandmarkedFace, ck as LandmarkerLike, cl as LensKind, cm as LensSource, cn as LightingStatus, co as LiveMrzCapture, cp as LiveMrzState, cq as LivePhotoGate, cr as LivePhotoKit, cs as LivePhotoKitInternals, ct as LivePhotoKitOptions, cu as LivePhotoStill, cv as LivenessCaptureInternalHandle, cw as LivenessCaptureInternals, cx as LivenessFlowDeps, cy as LivenessFlowOutcome, cz as MANUAL_SHUTTER_MS, cA as MR_DOC_CATALOG, cB as NO_REPORT_MS, cC as OpenDocCameraDeps, cD as PORTRAIT_JPEG_QUALITY, cE as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cF as PRELOAD_BUDGET_MS, cG as PROCESSING_POLL_DELAY_MS, cH as PROCESSING_POLL_MAX, cI as PortraitCaptureController, cJ as PortraitCaptureInternals, cK as REGISTRY_RETRY_DELAY_MS, cL as ReticleType, cM as SAME_FACE_MAX_DROPS, cN as ScanEvent, cO as ScanLayout, cP as ScanNotice, cQ as ScanPhase, cR as ScanReport, cS as ScanSide, cT as ScanState, cU as SubmitExecutor, cV as TEXT_LOCK_DEFAULTS, cW as TRANSPORT_REPLAY_ATTEMPTS, cX as TRANSPORT_REPLAY_DELAY_MS, cY as VerificationInternals, cZ as analyzeDocFrame, c_ as analyzeGuide, c$ as aspectBand, d0 as aspectFits, d1 as buildDeviceReadHint, d2 as coverPointToVideo, d3 as createDocumentCaptureInternal, d4 as createFaceLandmarker, d5 as createLivePhotoKit, d6 as createLivenessCaptureInternal, d7 as createPortraitCaptureInternal, d8 as createVerificationInternal, d9 as docZoomFor, da as encodeDocumentImage, db as facesOf, dc as feedbackVoteOf, dd as focusOk, de as guideQuad, df as guideRegionInFrame, dg as initialScanState, dh as lensKindOf, di as mapEngineState, dj as mapErrorKind, dk as mapGuidanceHint, dl as nextScanState, dm as observePortraitFrame, dn as openDocCamera, dp as passportBandOf, dq as portraitMatchStep, dr as preloadedDetectorFactory, ds as quadAreaFrac, dt as quadBounds, du as quadIou, dv as quadTiltRatio, dw as randomUuid, dx as rankBackCameras, dy as readStoredLens, dz as resetLivenessAssetsForTests, dA as resolveDocCameraTuning, dB as resolveDocShutterTuning, dC as resolveGuideLockTuning, dD as runLivenessFlow, dE as runSubmission, dF as scannerFormatFor, dG as setPreloadLoaderForTests, dH as settledHint, dI as singleShotFocusAt, dJ as specularFraction, dK as supportsFocusMode, dL as warmDocDetector, dM as writeStoredLens } from '../create-verification-60S1U9Dl.cjs';
1
+ import { a_ as DocCatalogEntry, a$ as LiveMrzTuning, b0 as TextLockTuning, b1 as OcrEngineClient, b2 as DocAssistReport, b3 as ReadyInfo, b4 as LoadFailure, b5 as OcrEngineOptions, b6 as SubmitRuntime, a1 as LivenessCaptureOptions, a0 as LivenessCaptureHandle, aJ as VerificationStep, aH as VerificationResult, ay as StepSnapshot, Y as LivePhotoGateUpdate, b7 as HostedClientLike } from '../create-verification-CIwl0NIg.cjs';
2
+ export { b8 as ANALYSIS_LONG_EDGE, b9 as ASPECT_BANDS, ba as AttestationError, bb as BLUR_REFUSE_SHARPNESS_MAX, bc as BlurStatus, bd as CAPTURE_CANDIDATE_SPACING_MS, be as CAPTURE_EXTRA_CANDIDATES, bf as CLIP_MIME_ALLOWLIST, bg as CaptureEngine, bh as CaptureSessionDoc, bi as CaptureSessionDocEvents, bj as CaptureSessionDocOptions, bk as DOC_ANALYSIS_DEFAULTS, bl as DOC_BLACK_FRAME_LUMA, bm as DOC_BLACK_FRAME_TICKS, bn as DOC_CADENCE_HZ, bo as DOC_CAMERA_TUNING_DEFAULTS, bp as DOC_CATALOG, bq as DOC_DETECT_WIDTH, br as DOC_FEEDBACK_STATES, bs as DOC_FIRST_FRAME_MS, bt as DOC_GATE_V1_DEFAULTS, bu as DOC_SHUTTER_DEFAULTS, bv as DeviceReadHint, bw as DocArtifacts, bx as DocAssist, by as DocAssistEngine, bz as DocAssistTick, bA as DocCameraTuning, bB as DocCaptureReport, bC as DocCaptureVia, bD as DocChecksPayload, bE as DocEngineLike, bF as DocFeedbackAggregator, bG as DocFeedbackKey, bH as DocFeedbackState, bI as DocFormat, bJ as DocFrameAnalysis, bK as DocFrameMeasures, bL as DocGateQuality, bM as DocGateThresholds, bN as DocGateTick, bO as DocGateTickInput, bP as DocGateV1, bQ as DocQuad, bR as DocQuadPoint, bS as DocShutterReason, bT as DocShutterTuning, bU as DocSide, bV as DocumentCaptureController, bW as DocumentCaptureInternals, bX as EMPTY_GUIDE_METRICS, bY as EncodedDocument, bZ as FLIP_FILL_MIN, b_ as FLIP_GAP_MS, b$ as FLIP_TIMEOUT_MS, c0 as FocusCaps, c1 as FramingStatus, c2 as GUIDE_LOCK_DEFAULTS, c3 as GlareStatus, c4 as GrabbedFrame, c5 as GuideBlocker, c6 as GuideLock, c7 as GuideLockTick, c8 as GuideLockTuning, c9 as GuideMetrics, ca as GuideRect, cb as INFERENCE_RETRY_ATTEMPTS, cc as INFERENCE_RETRY_DEFAULT_S, U as ISSUER_CODES, cd as LANDMARKER_MODEL, ce as LENS_STORAGE_KEY, cf as LENS_TRY_MAX, cg as LIVE_MRZ_DEFAULTS, ch as LIVE_PHOTO_IDLE_MS, ci as LIVE_PHOTO_MAX_HZ, cj as LandmarkedFace, ck as LandmarkerLike, cl as LensKind, cm as LensSource, cn as LightingStatus, co as LiveMrzCapture, cp as LiveMrzState, cq as LivePhotoGate, cr as LivePhotoKit, cs as LivePhotoKitInternals, ct as LivePhotoKitOptions, cu as LivePhotoStill, cv as LivenessCaptureInternalHandle, cw as LivenessCaptureInternals, cx as LivenessFlowDeps, cy as LivenessFlowOutcome, cz as MANUAL_SHUTTER_MS, cA as MR_DOC_CATALOG, cB as NO_REPORT_MS, cC as OpenDocCameraDeps, cD as PORTRAIT_JPEG_QUALITY, cE as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cF as PRELOAD_BUDGET_MS, cG as PROCESSING_POLL_DELAY_MS, cH as PROCESSING_POLL_MAX, cI as PortraitCaptureController, cJ as PortraitCaptureInternals, cK as REGISTRY_RETRY_DELAY_MS, cL as ReticleType, cM as SAME_FACE_MAX_DROPS, cN as ScanEvent, cO as ScanLayout, cP as ScanNotice, cQ as ScanPhase, cR as ScanReport, cS as ScanSide, cT as ScanState, cU as SubmitExecutor, cV as TEXT_LOCK_DEFAULTS, cW as TRANSPORT_REPLAY_ATTEMPTS, cX as TRANSPORT_REPLAY_DELAY_MS, cY as VerificationInternals, cZ as analyzeDocFrame, c_ as analyzeGuide, c$ as aspectBand, d0 as aspectFits, d1 as buildDeviceReadHint, d2 as coverPointToVideo, d3 as createDocumentCaptureInternal, d4 as createFaceLandmarker, d5 as createLivePhotoKit, d6 as createLivenessCaptureInternal, d7 as createPortraitCaptureInternal, d8 as createVerificationInternal, d9 as docZoomFor, da as encodeDocumentImage, db as facesOf, dc as feedbackVoteOf, dd as focusOk, de as guideQuad, df as guideRegionInFrame, dg as initialScanState, dh as lensKindOf, di as mapEngineState, dj as mapErrorKind, dk as mapGuidanceHint, dl as nextScanState, dm as observePortraitFrame, dn as openDocCamera, dp as passportBandOf, dq as portraitMatchStep, dr as preloadedDetectorFactory, ds as quadAreaFrac, dt as quadBounds, du as quadIou, dv as quadTiltRatio, dw as randomUuid, dx as rankBackCameras, dy as readStoredLens, dz as resetLivenessAssetsForTests, dA as resolveDocCameraTuning, dB as resolveDocShutterTuning, dC as resolveGuideLockTuning, dD as runLivenessFlow, dE as runSubmission, dF as scannerFormatFor, dG as setPreloadLoaderForTests, dH as settledHint, dI as singleShotFocusAt, dJ as specularFraction, dK as supportsFocusMode, dL as warmDocDetector, dM as writeStoredLens } from '../create-verification-CIwl0NIg.cjs';
3
3
  export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, d as detectFormFactor, c as detectIsMobile } from '../capture-constraints-B5omafmk.cjs';
4
- import { H as HostedSessionView, e as CheckType, k as CheckReason, ae as PlanStepView } from '../types-BZXO8xhw.cjs';
5
- export { at as ICAO_FALLBACK, Y as IcaoCaptureTuning, au as IcaoProfile, R as ResolvedIcaoTuning, av as resolveIcaoTuning } from '../types-BZXO8xhw.cjs';
6
- export { B as BackgroundStats, e as Box, C as CLIPPED_LUMA, F as FaceGeometry, f as FaceLighting, H as HeadPose, g as ICAO_CANVAS, h as ICAO_GATE_CRITERIA, i as ICAO_SHARP_REF, I as IcaoCoachKey, a as IcaoCriterionState, j as IcaoFrameObservation, k as IcaoGate, b as IcaoGateCriterion, l as IcaoGateOptions, c as IcaoGateSummary, d as IcaoGateUpdate, m as IcaoJudgedCriterion, n as IcaoMeasures, o as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, p as backgroundStats, q as createIcaoGate, r as eyeLineRoll, s as eyeOpenness, t as eyeSpecular, u as faceGeometry, v as faceLighting, w as faceSharpness, x as icaoPixelStats, y as icaoWindow, z as judgeIcao, A as lumaPlane, D as percentile, E as portraitCropRegion, G as poseFromMatrix, J as regionStats, K as scoreFrame, M as windowOverflow } from '../icao-gate-sKqrgMTo.cjs';
4
+ import { H as HostedSessionView, e as CheckType, k as CheckReason, ag as PlanStepView } from '../types-CKgMWVnP.cjs';
5
+ export { av as ICAO_FALLBACK, Y as IcaoCaptureTuning, aw as IcaoProfile, R as ResolvedIcaoTuning, ax as resolveIcaoTuning } from '../types-CKgMWVnP.cjs';
6
+ export { B as BackgroundStats, e as Box, C as CLIPPED_LUMA, F as FaceGeometry, f as FaceLighting, H as HeadPose, g as ICAO_CANVAS, h as ICAO_GATE_CRITERIA, i as ICAO_SHARP_REF, I as IcaoCoachKey, a as IcaoCriterionState, j as IcaoFrameObservation, k as IcaoGate, b as IcaoGateCriterion, l as IcaoGateOptions, c as IcaoGateSummary, d as IcaoGateUpdate, m as IcaoJudgedCriterion, n as IcaoMeasures, o as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, p as backgroundStats, q as createIcaoGate, r as eyeLineRoll, s as eyeOpenness, t as eyeSpecular, u as faceGeometry, v as faceLighting, w as faceSharpness, x as icaoPixelStats, y as icaoWindow, z as judgeIcao, A as lumaPlane, D as percentile, E as portraitCropRegion, G as poseFromMatrix, J as regionStats, K as scoreFrame, M as windowOverflow } from '../icao-gate-C-lfjEpH.cjs';
7
7
  import '../detect-worker-DclNxkZT.cjs';
8
- import '../capture-session-v3-DVJvecJq.cjs';
8
+ import '../capture-session-v3-DyUA2uCL.cjs';
9
9
 
10
10
  type DocumentTypeId = DocCatalogEntry["docType"];
11
11
  /** Same shape as the hosted view's `acceptedDocuments`. */
@@ -1,11 +1,11 @@
1
- import { a_ as DocCatalogEntry, a$ as LiveMrzTuning, b0 as TextLockTuning, b1 as OcrEngineClient, b2 as DocAssistReport, b3 as ReadyInfo, b4 as LoadFailure, b5 as OcrEngineOptions, b6 as SubmitRuntime, a1 as LivenessCaptureOptions, a0 as LivenessCaptureHandle, aJ as VerificationStep, aH as VerificationResult, ay as StepSnapshot, Y as LivePhotoGateUpdate, b7 as HostedClientLike } from '../create-verification-2hqtJWN9.js';
2
- export { b8 as ANALYSIS_LONG_EDGE, b9 as ASPECT_BANDS, ba as AttestationError, bb as BLUR_REFUSE_SHARPNESS_MAX, bc as BlurStatus, bd as CAPTURE_CANDIDATE_SPACING_MS, be as CAPTURE_EXTRA_CANDIDATES, bf as CLIP_MIME_ALLOWLIST, bg as CaptureEngine, bh as CaptureSessionDoc, bi as CaptureSessionDocEvents, bj as CaptureSessionDocOptions, bk as DOC_ANALYSIS_DEFAULTS, bl as DOC_BLACK_FRAME_LUMA, bm as DOC_BLACK_FRAME_TICKS, bn as DOC_CADENCE_HZ, bo as DOC_CAMERA_TUNING_DEFAULTS, bp as DOC_CATALOG, bq as DOC_DETECT_WIDTH, br as DOC_FEEDBACK_STATES, bs as DOC_FIRST_FRAME_MS, bt as DOC_GATE_V1_DEFAULTS, bu as DOC_SHUTTER_DEFAULTS, bv as DeviceReadHint, bw as DocArtifacts, bx as DocAssist, by as DocAssistEngine, bz as DocAssistTick, bA as DocCameraTuning, bB as DocCaptureReport, bC as DocCaptureVia, bD as DocChecksPayload, bE as DocEngineLike, bF as DocFeedbackAggregator, bG as DocFeedbackKey, bH as DocFeedbackState, bI as DocFormat, bJ as DocFrameAnalysis, bK as DocFrameMeasures, bL as DocGateQuality, bM as DocGateThresholds, bN as DocGateTick, bO as DocGateTickInput, bP as DocGateV1, bQ as DocQuad, bR as DocQuadPoint, bS as DocShutterReason, bT as DocShutterTuning, bU as DocSide, bV as DocumentCaptureController, bW as DocumentCaptureInternals, bX as EMPTY_GUIDE_METRICS, bY as EncodedDocument, bZ as FLIP_FILL_MIN, b_ as FLIP_GAP_MS, b$ as FLIP_TIMEOUT_MS, c0 as FocusCaps, c1 as FramingStatus, c2 as GUIDE_LOCK_DEFAULTS, c3 as GlareStatus, c4 as GrabbedFrame, c5 as GuideBlocker, c6 as GuideLock, c7 as GuideLockTick, c8 as GuideLockTuning, c9 as GuideMetrics, ca as GuideRect, cb as INFERENCE_RETRY_ATTEMPTS, cc as INFERENCE_RETRY_DEFAULT_S, U as ISSUER_CODES, cd as LANDMARKER_MODEL, ce as LENS_STORAGE_KEY, cf as LENS_TRY_MAX, cg as LIVE_MRZ_DEFAULTS, ch as LIVE_PHOTO_IDLE_MS, ci as LIVE_PHOTO_MAX_HZ, cj as LandmarkedFace, ck as LandmarkerLike, cl as LensKind, cm as LensSource, cn as LightingStatus, co as LiveMrzCapture, cp as LiveMrzState, cq as LivePhotoGate, cr as LivePhotoKit, cs as LivePhotoKitInternals, ct as LivePhotoKitOptions, cu as LivePhotoStill, cv as LivenessCaptureInternalHandle, cw as LivenessCaptureInternals, cx as LivenessFlowDeps, cy as LivenessFlowOutcome, cz as MANUAL_SHUTTER_MS, cA as MR_DOC_CATALOG, cB as NO_REPORT_MS, cC as OpenDocCameraDeps, cD as PORTRAIT_JPEG_QUALITY, cE as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cF as PRELOAD_BUDGET_MS, cG as PROCESSING_POLL_DELAY_MS, cH as PROCESSING_POLL_MAX, cI as PortraitCaptureController, cJ as PortraitCaptureInternals, cK as REGISTRY_RETRY_DELAY_MS, cL as ReticleType, cM as SAME_FACE_MAX_DROPS, cN as ScanEvent, cO as ScanLayout, cP as ScanNotice, cQ as ScanPhase, cR as ScanReport, cS as ScanSide, cT as ScanState, cU as SubmitExecutor, cV as TEXT_LOCK_DEFAULTS, cW as TRANSPORT_REPLAY_ATTEMPTS, cX as TRANSPORT_REPLAY_DELAY_MS, cY as VerificationInternals, cZ as analyzeDocFrame, c_ as analyzeGuide, c$ as aspectBand, d0 as aspectFits, d1 as buildDeviceReadHint, d2 as coverPointToVideo, d3 as createDocumentCaptureInternal, d4 as createFaceLandmarker, d5 as createLivePhotoKit, d6 as createLivenessCaptureInternal, d7 as createPortraitCaptureInternal, d8 as createVerificationInternal, d9 as docZoomFor, da as encodeDocumentImage, db as facesOf, dc as feedbackVoteOf, dd as focusOk, de as guideQuad, df as guideRegionInFrame, dg as initialScanState, dh as lensKindOf, di as mapEngineState, dj as mapErrorKind, dk as mapGuidanceHint, dl as nextScanState, dm as observePortraitFrame, dn as openDocCamera, dp as passportBandOf, dq as portraitMatchStep, dr as preloadedDetectorFactory, ds as quadAreaFrac, dt as quadBounds, du as quadIou, dv as quadTiltRatio, dw as randomUuid, dx as rankBackCameras, dy as readStoredLens, dz as resetLivenessAssetsForTests, dA as resolveDocCameraTuning, dB as resolveDocShutterTuning, dC as resolveGuideLockTuning, dD as runLivenessFlow, dE as runSubmission, dF as scannerFormatFor, dG as setPreloadLoaderForTests, dH as settledHint, dI as singleShotFocusAt, dJ as specularFraction, dK as supportsFocusMode, dL as warmDocDetector, dM as writeStoredLens } from '../create-verification-2hqtJWN9.js';
1
+ import { a_ as DocCatalogEntry, a$ as LiveMrzTuning, b0 as TextLockTuning, b1 as OcrEngineClient, b2 as DocAssistReport, b3 as ReadyInfo, b4 as LoadFailure, b5 as OcrEngineOptions, b6 as SubmitRuntime, a1 as LivenessCaptureOptions, a0 as LivenessCaptureHandle, aJ as VerificationStep, aH as VerificationResult, ay as StepSnapshot, Y as LivePhotoGateUpdate, b7 as HostedClientLike } from '../create-verification-CNCMU1kK.js';
2
+ export { b8 as ANALYSIS_LONG_EDGE, b9 as ASPECT_BANDS, ba as AttestationError, bb as BLUR_REFUSE_SHARPNESS_MAX, bc as BlurStatus, bd as CAPTURE_CANDIDATE_SPACING_MS, be as CAPTURE_EXTRA_CANDIDATES, bf as CLIP_MIME_ALLOWLIST, bg as CaptureEngine, bh as CaptureSessionDoc, bi as CaptureSessionDocEvents, bj as CaptureSessionDocOptions, bk as DOC_ANALYSIS_DEFAULTS, bl as DOC_BLACK_FRAME_LUMA, bm as DOC_BLACK_FRAME_TICKS, bn as DOC_CADENCE_HZ, bo as DOC_CAMERA_TUNING_DEFAULTS, bp as DOC_CATALOG, bq as DOC_DETECT_WIDTH, br as DOC_FEEDBACK_STATES, bs as DOC_FIRST_FRAME_MS, bt as DOC_GATE_V1_DEFAULTS, bu as DOC_SHUTTER_DEFAULTS, bv as DeviceReadHint, bw as DocArtifacts, bx as DocAssist, by as DocAssistEngine, bz as DocAssistTick, bA as DocCameraTuning, bB as DocCaptureReport, bC as DocCaptureVia, bD as DocChecksPayload, bE as DocEngineLike, bF as DocFeedbackAggregator, bG as DocFeedbackKey, bH as DocFeedbackState, bI as DocFormat, bJ as DocFrameAnalysis, bK as DocFrameMeasures, bL as DocGateQuality, bM as DocGateThresholds, bN as DocGateTick, bO as DocGateTickInput, bP as DocGateV1, bQ as DocQuad, bR as DocQuadPoint, bS as DocShutterReason, bT as DocShutterTuning, bU as DocSide, bV as DocumentCaptureController, bW as DocumentCaptureInternals, bX as EMPTY_GUIDE_METRICS, bY as EncodedDocument, bZ as FLIP_FILL_MIN, b_ as FLIP_GAP_MS, b$ as FLIP_TIMEOUT_MS, c0 as FocusCaps, c1 as FramingStatus, c2 as GUIDE_LOCK_DEFAULTS, c3 as GlareStatus, c4 as GrabbedFrame, c5 as GuideBlocker, c6 as GuideLock, c7 as GuideLockTick, c8 as GuideLockTuning, c9 as GuideMetrics, ca as GuideRect, cb as INFERENCE_RETRY_ATTEMPTS, cc as INFERENCE_RETRY_DEFAULT_S, U as ISSUER_CODES, cd as LANDMARKER_MODEL, ce as LENS_STORAGE_KEY, cf as LENS_TRY_MAX, cg as LIVE_MRZ_DEFAULTS, ch as LIVE_PHOTO_IDLE_MS, ci as LIVE_PHOTO_MAX_HZ, cj as LandmarkedFace, ck as LandmarkerLike, cl as LensKind, cm as LensSource, cn as LightingStatus, co as LiveMrzCapture, cp as LiveMrzState, cq as LivePhotoGate, cr as LivePhotoKit, cs as LivePhotoKitInternals, ct as LivePhotoKitOptions, cu as LivePhotoStill, cv as LivenessCaptureInternalHandle, cw as LivenessCaptureInternals, cx as LivenessFlowDeps, cy as LivenessFlowOutcome, cz as MANUAL_SHUTTER_MS, cA as MR_DOC_CATALOG, cB as NO_REPORT_MS, cC as OpenDocCameraDeps, cD as PORTRAIT_JPEG_QUALITY, cE as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cF as PRELOAD_BUDGET_MS, cG as PROCESSING_POLL_DELAY_MS, cH as PROCESSING_POLL_MAX, cI as PortraitCaptureController, cJ as PortraitCaptureInternals, cK as REGISTRY_RETRY_DELAY_MS, cL as ReticleType, cM as SAME_FACE_MAX_DROPS, cN as ScanEvent, cO as ScanLayout, cP as ScanNotice, cQ as ScanPhase, cR as ScanReport, cS as ScanSide, cT as ScanState, cU as SubmitExecutor, cV as TEXT_LOCK_DEFAULTS, cW as TRANSPORT_REPLAY_ATTEMPTS, cX as TRANSPORT_REPLAY_DELAY_MS, cY as VerificationInternals, cZ as analyzeDocFrame, c_ as analyzeGuide, c$ as aspectBand, d0 as aspectFits, d1 as buildDeviceReadHint, d2 as coverPointToVideo, d3 as createDocumentCaptureInternal, d4 as createFaceLandmarker, d5 as createLivePhotoKit, d6 as createLivenessCaptureInternal, d7 as createPortraitCaptureInternal, d8 as createVerificationInternal, d9 as docZoomFor, da as encodeDocumentImage, db as facesOf, dc as feedbackVoteOf, dd as focusOk, de as guideQuad, df as guideRegionInFrame, dg as initialScanState, dh as lensKindOf, di as mapEngineState, dj as mapErrorKind, dk as mapGuidanceHint, dl as nextScanState, dm as observePortraitFrame, dn as openDocCamera, dp as passportBandOf, dq as portraitMatchStep, dr as preloadedDetectorFactory, ds as quadAreaFrac, dt as quadBounds, du as quadIou, dv as quadTiltRatio, dw as randomUuid, dx as rankBackCameras, dy as readStoredLens, dz as resetLivenessAssetsForTests, dA as resolveDocCameraTuning, dB as resolveDocShutterTuning, dC as resolveGuideLockTuning, dD as runLivenessFlow, dE as runSubmission, dF as scannerFormatFor, dG as setPreloadLoaderForTests, dH as settledHint, dI as singleShotFocusAt, dJ as specularFraction, dK as supportsFocusMode, dL as warmDocDetector, dM as writeStoredLens } from '../create-verification-CNCMU1kK.js';
3
3
  export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, d as detectFormFactor, c as detectIsMobile } from '../capture-constraints-B5omafmk.js';
4
- import { H as HostedSessionView, e as CheckType, k as CheckReason, ae as PlanStepView } from '../types-BZXO8xhw.js';
5
- export { at as ICAO_FALLBACK, Y as IcaoCaptureTuning, au as IcaoProfile, R as ResolvedIcaoTuning, av as resolveIcaoTuning } from '../types-BZXO8xhw.js';
6
- export { B as BackgroundStats, e as Box, C as CLIPPED_LUMA, F as FaceGeometry, f as FaceLighting, H as HeadPose, g as ICAO_CANVAS, h as ICAO_GATE_CRITERIA, i as ICAO_SHARP_REF, I as IcaoCoachKey, a as IcaoCriterionState, j as IcaoFrameObservation, k as IcaoGate, b as IcaoGateCriterion, l as IcaoGateOptions, c as IcaoGateSummary, d as IcaoGateUpdate, m as IcaoJudgedCriterion, n as IcaoMeasures, o as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, p as backgroundStats, q as createIcaoGate, r as eyeLineRoll, s as eyeOpenness, t as eyeSpecular, u as faceGeometry, v as faceLighting, w as faceSharpness, x as icaoPixelStats, y as icaoWindow, z as judgeIcao, A as lumaPlane, D as percentile, E as portraitCropRegion, G as poseFromMatrix, J as regionStats, K as scoreFrame, M as windowOverflow } from '../icao-gate-B2zgdb5m.js';
4
+ import { H as HostedSessionView, e as CheckType, k as CheckReason, ag as PlanStepView } from '../types-CKgMWVnP.js';
5
+ export { av as ICAO_FALLBACK, Y as IcaoCaptureTuning, aw as IcaoProfile, R as ResolvedIcaoTuning, ax as resolveIcaoTuning } from '../types-CKgMWVnP.js';
6
+ export { B as BackgroundStats, e as Box, C as CLIPPED_LUMA, F as FaceGeometry, f as FaceLighting, H as HeadPose, g as ICAO_CANVAS, h as ICAO_GATE_CRITERIA, i as ICAO_SHARP_REF, I as IcaoCoachKey, a as IcaoCriterionState, j as IcaoFrameObservation, k as IcaoGate, b as IcaoGateCriterion, l as IcaoGateOptions, c as IcaoGateSummary, d as IcaoGateUpdate, m as IcaoJudgedCriterion, n as IcaoMeasures, o as IcaoPixelStats, L as LumaPlane, P as Point, R as RegionStats, p as backgroundStats, q as createIcaoGate, r as eyeLineRoll, s as eyeOpenness, t as eyeSpecular, u as faceGeometry, v as faceLighting, w as faceSharpness, x as icaoPixelStats, y as icaoWindow, z as judgeIcao, A as lumaPlane, D as percentile, E as portraitCropRegion, G as poseFromMatrix, J as regionStats, K as scoreFrame, M as windowOverflow } from '../icao-gate-5FzqyitT.js';
7
7
  import '../detect-worker-DclNxkZT.js';
8
- import '../capture-session-v3-DsHBvxFa.js';
8
+ import '../capture-session-v3-Dxus1Se9.js';
9
9
 
10
10
  type DocumentTypeId = DocCatalogEntry["docType"];
11
11
  /** Same shape as the hosted view's `acceptedDocuments`. */
@@ -1 +1 @@
1
- import{c as _e,d as Le,e as Re,g as Se,h as Te,i as ce}from"../chunk-ZJUA2Y22.js";import{a as Vt,b as Xt,c as Zt,d as Jt,e as Qt,f as jt,g as qt,h as $t,i as er,j as ae,l as se,n as Ee,o as me}from"../chunk-G6MU3B5V.js";import{b as pe,c as ie,d as ne}from"../chunk-CJHMFPL6.js";import"../chunk-RI3E7GBN.js";import{a as d,b as M,c as F,d as N,e as v}from"../chunk-O5WKNZ2C.js";import{A as yt,B as ft,C as ut,D as Ot,E as At,F as It,G as xt,H as Ct,I as Pt,J as Dt,K as dt,L as Mt,M as Ft,a as We,b as ke,c as Ke,d as Je,e as Qe,f as je,g as qe,h as $e,i as et,j as tt,k as rt,l as ot,m as pt,n as it,o as nt,p as at,q as st,r as Et,s as mt,t as _t,u as Lt,v as Rt,w as St,x as Tt,y as ct,z as lt}from"../chunk-RBDRJRXB.js";import{a as Ye,b as He}from"../chunk-SMKCBUJL.js";import{a as Be,b as we,c as ze,d as Ve,e as Xe,f as Ze}from"../chunk-MXWLCDFX.js";import{a as k,b as Fe,c as Ne,d as ve,e as ge,f as be,g as Ge,h as he,i as Ue,j as K,k as B,l as w,m as Z,n as J,o as Q,p as j,q,r as $,s as ee,t as te,u as re,x as oe}from"../chunk-M35OBPDV.js";import{a as g,b,c as G,d as h,e as U,f as Y,g as H,h as W,i as z,j as V,l as X}from"../chunk-G6LKLN4U.js";import{a as xe,b as Ce,c as Pe,d as De,e as de,f as Me}from"../chunk-TDLIXFDT.js";import{a as Nt,b as vt,c as gt,d as bt,e as Gt,f as ht,g as Ut,h as Yt,i as Ht,j as Wt,k as kt,l as Kt,m as Bt}from"../chunk-7ZCZY3ZP.js";import{a as wt,b as zt}from"../chunk-BPE5NSQ2.js";import"../chunk-GI3UFGRQ.js";import{b as ye,c as fe,d as ue,e as Oe,g as Ae,h as tr,i as rr,j as or,k as pr,l as ir,m as nr,s as Ie}from"../chunk-4SQBEKG7.js";import{c as S,i as T,j as c,k as l,l as y,n as f,p as u,q as O,r as A,s as I,t as x,u as C,v as P,w as D}from"../chunk-G7WHAP7L.js";import{a as i,b as n,c as a,d as s,i as E,j as m,k as _,l as L,m as R}from"../chunk-EIFZSEYD.js";import"../chunk-GT2ZLGF7.js";import"../chunk-7SJHXIM3.js";import{c as e,d as t,f as r,g as o,h as p}from"../chunk-FUHDOEBP.js";import"../chunk-POIQGEZM.js";import"../chunk-2BFYVMUU.js";import"../chunk-FPXL63KZ.js";import"../chunk-23XZDY52.js";import"../chunk-RNZ4CQEC.js";import"../chunk-OKWG3PVH.js";import{a as le}from"../chunk-DFTCAWMP.js";import"../chunk-DK5YPBDQ.js";export{ae as ANALYSIS_LONG_EDGE,xe as ASPECT_BANDS,C as AttestationError,Ge as BLUR_REFUSE_SHARPNESS_MAX,Ft as CAPTURE_CANDIDATE_SPACING_MS,Mt as CAPTURE_EXTRA_CANDIDATES,p as CENTERED_FACTOR,r as CIRCLE_RADIUS_FACTOR,Vt as CLIPPED_LUMA,u as CLIP_MIME_ALLOWLIST,Dt as CaptureSessionDoc,rr as DOCUMENT_TYPE_ORDER,Je as DOC_ANALYSIS_DEFAULTS,At as DOC_BLACK_FRAME_LUMA,It as DOC_BLACK_FRAME_TICKS,xt as DOC_CADENCE_HZ,$e as DOC_CAMERA_TUNING_DEFAULTS,de as DOC_CATALOG,Be as DOC_DETECT_WIDTH,We as DOC_FEEDBACK_STATES,Ot as DOC_FIRST_FRAME_MS,we as DOC_GATE_V1_DEFAULTS,Ct as DOC_SHUTTER_DEFAULTS,X as DocAssist,Ke as DocFeedbackAggregator,Ze as DocGateV1,Rt as EMPTY_GUIDE_METRICS,Ne as FLIP_FILL_MIN,Fe as FLIP_GAP_MS,ve as FLIP_TIMEOUT_MS,lt as GUIDE_LOCK_DEFAULTS,ft as GuideLock,bt as ICAO_CANVAS,wt as ICAO_FALLBACK,Yt as ICAO_GATE_CRITERIA,Xt as ICAO_SHARP_REF,I as INFERENCE_RETRY_ATTEMPTS,x as INFERENCE_RETRY_DEFAULT_S,o as IN_CIRCLE_FACTOR,tr as ISSUER_CODES,pe as LANDMARKER_MODEL,ot as LENS_STORAGE_KEY,_t as LENS_TRY_MAX,V as LIVE_MRZ_DEFAULTS,Le as LIVE_PHOTO_IDLE_MS,_e as LIVE_PHOTO_MAX_HZ,ge as MANUAL_SHUTTER_MS,Ye as MRZ_BAND_DEFAULTS,De as MR_DOC_CATALOG,be as NO_REPORT_MS,le as OCR_ASSET_SET,Te as OTP_RESEND_COOLDOWN_MS,se as PORTRAIT_JPEG_QUALITY,i as PRELOAD_BLAZE_INIT_TIMEOUT_MS,n as PRELOAD_BUDGET_MS,Se as PROCESSING_BACKOFF_MS,fe as PROCESSING_POLL_DELAY_MS,ue as PROCESSING_POLL_MAX,G as REGION_PAD,ye as REGISTRY_RETRY_DELAY_MS,S as RETRYABLE_REASONS,re as SAME_FACE_MAX_DROPS,g as SHARPNESS_LONG_EDGE,z as TEXT_LOCK_DEFAULTS,O as TRANSPORT_REPLAY_ATTEMPTS,A as TRANSPORT_REPLAY_DELAY_MS,M as TURNSTILE_EXECUTE_TIMEOUT_MS,d as TURNSTILE_SCRIPT_SRC,Q as WEB_OCR_ENGINE,pr as acceptedIssuers,or as acceptedTypesFor,qe as analyzeDocFrame,Tt as analyzeGuide,Ce as aspectBand,Pe as aspectFits,qt as backgroundStats,$ as browserFamily,Z as buildDeviceReadHint,B as classifyCardSide,K as classifyCardSideWith,st as coverPointToVideo,oe as createDocumentCaptureInternal,ne as createFaceLandmarker,Bt as createIcaoGate,Re as createLivePhotoKit,R as createLivenessCaptureInternal,me as createPortraitCaptureInternal,ce as createStepRunner,Ae as createVerificationInternal,U as cropImage,e as detectFormFactor,t as detectIsMobile,He as detectMrzBand,Et as docZoomFor,k as encodeDocumentImage,v as executeTurnstile,gt as eyeLineRoll,Wt as eyeOpenness,jt as eyeSpecular,Nt as faceGeometry,Qt as faceLighting,$t as faceSharpness,ie as facesOf,ke as feedbackVoteOf,nr as flagOf,mt as focusOk,te as formatMismatch,l as frontierStep,ct as guideQuad,St as guideRegionInFrame,er as icaoPixelStats,Gt as icaoWindow,he as initialScanState,T as isExecutable,c as isTerminalView,Ht as judgeIcao,tt as lensKindOf,ee as liveMrzWireReport,N as loadTurnstile,Zt as lumaPlane,_ as mapEngineState,L as mapErrorKind,m as mapGuidanceHint,f as mapSessionResult,W as measureBitmapSharpness,H as measureRegionSharpness,Ue as nextScanState,Ee as observePortraitFrame,Lt as openDocCamera,dt as passportBandOf,kt as percentile,b as photoSharpness,Ut as portraitCropRegion,Ie as portraitMatchStep,vt as poseFromMatrix,E as preloadedDetectorFactory,ze as quadAreaFrac,Xe as quadBounds,Ve as quadIou,je as quadTiltRatio,Oe as randomUuid,rt as rankBackCameras,pt as readStoredLens,Jt as regionStats,s as resetLivenessAssetsForTests,F as resetTurnstileForTests,Y as resizeLongEdge,ir as resolveAcceptedDocuments,et as resolveDocCameraTuning,Pt as resolveDocShutterTuning,yt as resolveGuideLockTuning,zt as resolveIcaoTuning,j as resolveWebOcrPlan,D as runLivenessFlow,P as runSubmission,Me as scannerFormatFor,Kt as scoreFrame,a as setPreloadLoaderForTests,J as settledHint,at as singleShotFocusAt,Qe as specularFraction,q as startWebOcr,y as stepOf,h as stillRegionOf,w as stillToImageData,nt as supportsFocusMode,ut as warmDocDetector,ht as windowOverflow,it as writeStoredLens};
1
+ import{c as _e,d as Le,e as Re,g as Se,h as Te,i as ce}from"../chunk-3SL74TFR.js";import{a as Vt,b as Xt,c as Zt,d as Jt,e as Qt,f as jt,g as qt,h as $t,i as er,j as ae,l as se,n as Ee,o as me}from"../chunk-G6MU3B5V.js";import{b as pe,c as ie,d as ne}from"../chunk-CJHMFPL6.js";import"../chunk-RI3E7GBN.js";import{a as d,b as M,c as F,d as N,e as v}from"../chunk-O5WKNZ2C.js";import{A as yt,B as ft,C as ut,D as Ot,E as At,F as It,G as xt,H as Ct,I as Pt,J as Dt,K as dt,L as Mt,M as Ft,a as We,b as ke,c as Ke,d as Je,e as Qe,f as je,g as qe,h as $e,i as et,j as tt,k as rt,l as ot,m as pt,n as it,o as nt,p as at,q as st,r as Et,s as mt,t as _t,u as Lt,v as Rt,w as St,x as Tt,y as ct,z as lt}from"../chunk-QBPD7FRF.js";import{a as Ye,b as He}from"../chunk-SMKCBUJL.js";import{a as Be,b as we,c as ze,d as Ve,e as Xe,f as Ze}from"../chunk-MXWLCDFX.js";import{a as k,b as Fe,c as Ne,d as ve,e as ge,f as be,g as Ge,h as he,i as Ue,j as K,k as B,l as w,m as Z,n as J,o as Q,p as j,q,r as $,s as ee,t as te,u as re,x as oe}from"../chunk-4RS4LP7D.js";import{a as g,b,c as G,d as h,e as U,f as Y,g as H,h as W,i as z,j as V,l as X}from"../chunk-G6LKLN4U.js";import{a as xe,b as Ce,c as Pe,d as De,e as de,f as Me}from"../chunk-TDLIXFDT.js";import{a as Nt,b as vt,c as gt,d as bt,e as Gt,f as ht,g as Ut,h as Yt,i as Ht,j as Wt,k as kt,l as Kt,m as Bt}from"../chunk-7ZCZY3ZP.js";import{a as wt,b as zt}from"../chunk-BPE5NSQ2.js";import"../chunk-GI3UFGRQ.js";import{b as ye,c as fe,d as ue,e as Oe,g as Ae,h as tr,i as rr,j as or,k as pr,l as ir,m as nr,s as Ie}from"../chunk-MMTOOH32.js";import{c as S,i as T,j as c,k as l,l as y,n as f,p as u,q as O,r as A,s as I,t as x,u as C,v as P,w as D}from"../chunk-J4NL62VQ.js";import{a as i,b as n,c as a,d as s,i as E,j as m,k as _,l as L,m as R}from"../chunk-SDWHJJ4W.js";import"../chunk-GT2ZLGF7.js";import"../chunk-GYNWLJYW.js";import{c as e,d as t,f as r,g as o,h as p}from"../chunk-FUHDOEBP.js";import"../chunk-POIQGEZM.js";import"../chunk-2BFYVMUU.js";import"../chunk-FPXL63KZ.js";import"../chunk-ULMH32G5.js";import"../chunk-TWB4LTCE.js";import"../chunk-OKWG3PVH.js";import{a as le}from"../chunk-DFTCAWMP.js";import"../chunk-DK5YPBDQ.js";export{ae as ANALYSIS_LONG_EDGE,xe as ASPECT_BANDS,C as AttestationError,Ge as BLUR_REFUSE_SHARPNESS_MAX,Ft as CAPTURE_CANDIDATE_SPACING_MS,Mt as CAPTURE_EXTRA_CANDIDATES,p as CENTERED_FACTOR,r as CIRCLE_RADIUS_FACTOR,Vt as CLIPPED_LUMA,u as CLIP_MIME_ALLOWLIST,Dt as CaptureSessionDoc,rr as DOCUMENT_TYPE_ORDER,Je as DOC_ANALYSIS_DEFAULTS,At as DOC_BLACK_FRAME_LUMA,It as DOC_BLACK_FRAME_TICKS,xt as DOC_CADENCE_HZ,$e as DOC_CAMERA_TUNING_DEFAULTS,de as DOC_CATALOG,Be as DOC_DETECT_WIDTH,We as DOC_FEEDBACK_STATES,Ot as DOC_FIRST_FRAME_MS,we as DOC_GATE_V1_DEFAULTS,Ct as DOC_SHUTTER_DEFAULTS,X as DocAssist,Ke as DocFeedbackAggregator,Ze as DocGateV1,Rt as EMPTY_GUIDE_METRICS,Ne as FLIP_FILL_MIN,Fe as FLIP_GAP_MS,ve as FLIP_TIMEOUT_MS,lt as GUIDE_LOCK_DEFAULTS,ft as GuideLock,bt as ICAO_CANVAS,wt as ICAO_FALLBACK,Yt as ICAO_GATE_CRITERIA,Xt as ICAO_SHARP_REF,I as INFERENCE_RETRY_ATTEMPTS,x as INFERENCE_RETRY_DEFAULT_S,o as IN_CIRCLE_FACTOR,tr as ISSUER_CODES,pe as LANDMARKER_MODEL,ot as LENS_STORAGE_KEY,_t as LENS_TRY_MAX,V as LIVE_MRZ_DEFAULTS,Le as LIVE_PHOTO_IDLE_MS,_e as LIVE_PHOTO_MAX_HZ,ge as MANUAL_SHUTTER_MS,Ye as MRZ_BAND_DEFAULTS,De as MR_DOC_CATALOG,be as NO_REPORT_MS,le as OCR_ASSET_SET,Te as OTP_RESEND_COOLDOWN_MS,se as PORTRAIT_JPEG_QUALITY,i as PRELOAD_BLAZE_INIT_TIMEOUT_MS,n as PRELOAD_BUDGET_MS,Se as PROCESSING_BACKOFF_MS,fe as PROCESSING_POLL_DELAY_MS,ue as PROCESSING_POLL_MAX,G as REGION_PAD,ye as REGISTRY_RETRY_DELAY_MS,S as RETRYABLE_REASONS,re as SAME_FACE_MAX_DROPS,g as SHARPNESS_LONG_EDGE,z as TEXT_LOCK_DEFAULTS,O as TRANSPORT_REPLAY_ATTEMPTS,A as TRANSPORT_REPLAY_DELAY_MS,M as TURNSTILE_EXECUTE_TIMEOUT_MS,d as TURNSTILE_SCRIPT_SRC,Q as WEB_OCR_ENGINE,pr as acceptedIssuers,or as acceptedTypesFor,qe as analyzeDocFrame,Tt as analyzeGuide,Ce as aspectBand,Pe as aspectFits,qt as backgroundStats,$ as browserFamily,Z as buildDeviceReadHint,B as classifyCardSide,K as classifyCardSideWith,st as coverPointToVideo,oe as createDocumentCaptureInternal,ne as createFaceLandmarker,Bt as createIcaoGate,Re as createLivePhotoKit,R as createLivenessCaptureInternal,me as createPortraitCaptureInternal,ce as createStepRunner,Ae as createVerificationInternal,U as cropImage,e as detectFormFactor,t as detectIsMobile,He as detectMrzBand,Et as docZoomFor,k as encodeDocumentImage,v as executeTurnstile,gt as eyeLineRoll,Wt as eyeOpenness,jt as eyeSpecular,Nt as faceGeometry,Qt as faceLighting,$t as faceSharpness,ie as facesOf,ke as feedbackVoteOf,nr as flagOf,mt as focusOk,te as formatMismatch,l as frontierStep,ct as guideQuad,St as guideRegionInFrame,er as icaoPixelStats,Gt as icaoWindow,he as initialScanState,T as isExecutable,c as isTerminalView,Ht as judgeIcao,tt as lensKindOf,ee as liveMrzWireReport,N as loadTurnstile,Zt as lumaPlane,_ as mapEngineState,L as mapErrorKind,m as mapGuidanceHint,f as mapSessionResult,W as measureBitmapSharpness,H as measureRegionSharpness,Ue as nextScanState,Ee as observePortraitFrame,Lt as openDocCamera,dt as passportBandOf,kt as percentile,b as photoSharpness,Ut as portraitCropRegion,Ie as portraitMatchStep,vt as poseFromMatrix,E as preloadedDetectorFactory,ze as quadAreaFrac,Xe as quadBounds,Ve as quadIou,je as quadTiltRatio,Oe as randomUuid,rt as rankBackCameras,pt as readStoredLens,Jt as regionStats,s as resetLivenessAssetsForTests,F as resetTurnstileForTests,Y as resizeLongEdge,ir as resolveAcceptedDocuments,et as resolveDocCameraTuning,Pt as resolveDocShutterTuning,yt as resolveGuideLockTuning,zt as resolveIcaoTuning,j as resolveWebOcrPlan,D as runLivenessFlow,P as runSubmission,Me as scannerFormatFor,Kt as scoreFrame,a as setPreloadLoaderForTests,J as settledHint,at as singleShotFocusAt,Qe as specularFraction,q as startWebOcr,y as stepOf,h as stillRegionOf,w as stillToImageData,nt as supportsFocusMode,ut as warmDocDetector,ht as windowOverflow,it as writeStoredLens};
@@ -1 +1 @@
1
- import{e as K}from"./chunk-A3FUGHAH.js";import{a as B,b as H,e as F,f as w,i as U}from"./chunk-ZJUA2Y22.js";import{o as A}from"./chunk-G6MU3B5V.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import{A as T,I as V,i as x}from"./chunk-RBDRJRXB.js";import"./chunk-SMKCBUJL.js";import"./chunk-MXWLCDFX.js";import{x as O}from"./chunk-M35OBPDV.js";import"./chunk-G6LKLN4U.js";import"./chunk-TDLIXFDT.js";import"./chunk-7ZCZY3ZP.js";import"./chunk-BPE5NSQ2.js";import"./chunk-GI3UFGRQ.js";import{a as L,o as I}from"./chunk-G7WHAP7L.js";import"./chunk-EIFZSEYD.js";import"./chunk-GT2ZLGF7.js";import"./chunk-7SJHXIM3.js";import"./chunk-FUHDOEBP.js";import"./chunk-POIQGEZM.js";import"./chunk-2BFYVMUU.js";import"./chunk-FPXL63KZ.js";import{h as _}from"./chunk-23XZDY52.js";import{a as M}from"./chunk-RNZ4CQEC.js";import"./chunk-OKWG3PVH.js";import"./chunk-DFTCAWMP.js";import"./chunk-DK5YPBDQ.js";function z(e){let a=null,c=Promise.resolve(),u=!1,g=null,y=null,C=null,k=!1,m=()=>{a?.controller.handle.destroy(),a=null},h=()=>{let i=e.currentView(),l=i===null?null:w(i,{isMobile:e.isMobile()});return l?.kind==="portrait"?l:null},P=async(i,l)=>{if(e.destroyed())return;l.setFlowState("uploading"),u=!1;let d=null;try{await e.runner().submit("portrait_icao",async(n,r)=>{if(d===null){let p=await I(n,"image","image/jpeg",i.image.size,{engine:"portrait"});await n.uploadToSpaces(p.uploadUrl,i.image,"image/jpeg"),d=(await n.completeMedia(p.key)).key}l.setFlowState("checking");let s={media:{portrait:d},gate:_(i.gate),...i.tuningVersion!==void 0?{tuningVersion:i.tuningVersion}:{}};return n.submitCheck("portrait_icao",s,{idempotencyKey:r})},()=>{g=d})}catch{u=!0}if(l.setFlowState("done"),e.destroyed())return;let t=h();(t===null||t.phase!=="capture")&&a?.controller===l&&m(),e.runner().republish()},b=i=>e.runner().submit("face_match",(l,d)=>l.submitCheck("face_match",g!==null?{imageKey:g}:{},{idempotencyKey:d})).then(()=>{},()=>{u=!0,i()});return{bind:(i,l)=>{if(i.phase==="match")return m(),y!==i.attemptsRemaining&&!u&&(y=i.attemptsRemaining,b(l)),{...i,uploadFailed:u,resubmit:()=>(u=!1,y=i.attemptsRemaining,l(),b(l)),capture:()=>{throw new Error("the portrait was already accepted")}};y=null;let d=e.keptPortraitInput?.()??null;return d!==null&&(k||d!==C&&i.report===null&&i.reason===void 0&&!i.retakeOnly)?(k||(C=d,k=!0,e.runner().submit("portrait_icao",(t,n)=>t.submitCheck("portrait_icao",d,{idempotencyKey:n}),()=>{g=d.media.portrait}).catch(()=>{}).finally(()=>{k=!1,l()})),{kind:"processing",key:"processing",context:i.context,section:i.section,stalled:!1,refresh:()=>Promise.resolve()}):{...i,uploadFailed:u,resubmit:()=>Promise.resolve(),capture:t=>{if(a!==null&&a.video===t.video)return a.controller.handle;m(),u=!1;let n=A({video:t.video,tuning:i.tuning,tuningVersion:i.tuningVersion,...i.icao!=null?{policy:i.icao.policy}:{},...t.keepScreenAwake!==void 0?{keepScreenAwake:t.keepScreenAwake}:{},...t.assetBaseUrl!==void 0?{assetBaseUrl:t.assetBaseUrl}:{}},e.internals,()=>e.destroyed()?"self":L(e.currentView()));return a={video:t.video,controller:n},n.handle.on("captured",r=>{c=c.then(()=>P(r,n)).catch(()=>{})}),n.handle}}},destroy:m}}function j(e){let a=e;if(typeof a.apiOrigin!="string"||typeof a.sessionToken!="string")return;let c=`${a.apiOrigin}/api/v2/hosted/capture-reports`,u=a.sessionToken;return g=>{try{fetch(c,{method:"POST",headers:{"content-type":"application/json","x-session-token":u,"x-sekyro-sdk":`@sekyro/web/${M}`},body:JSON.stringify({reports:g}),keepalive:!0}).catch(()=>{})}catch{}}}function G(e){let a=e.apiOrigin;return K("sdk",typeof a=="string"&&/staging|sandbox|localhost/.test(a)?"sandbox":"live")}function le(e){let a=null,c=null,u=null,g=Promise.resolve(),y=()=>{u?.flow.handle.destroy(),u=null},C=async(t,n)=>{if(e.destroyed())return;n.setFlowState("uploading");let r=null,s,p=!1;try{await a.submit("doc_ocr",async(S,E)=>{if(r===null){let R=await I(S,"image","image/jpeg",t.image.size,{engine:"document"});await S.uploadToSpaces(R.uploadUrl,t.image,"image/jpeg"),r=(await S.completeMedia(R.key)).key}return n.setFlowState("checking"),s===void 0&&(s=n.takeDeviceRead(t)),S.submitCheck("doc_ocr",{imageKey:r,side:t.side,...s!==null?{deviceRead:s}:{}},{idempotencyKey:E})})}catch{p=!0}finally{n.setFlowState("done")}if(e.destroyed())return;if(p){n.settle(t.side,{ok:!1,issue:"technical"});return}let v=e.currentView(),o=v===null?null:w(v,{isMobile:e.isMobile()});if(o?.kind!=="document"){n.settle(t.side,{ok:!0}),u?.flow===n?y():n.handle.destroy();return}if(o.reason==="document_type_not_accepted"){c=null,u?.flow===n&&y(),a.republish();return}t.side==="single"||o.acceptedSides.includes(t.side)||o.reason==="side_missing"?(n.settle(t.side,{ok:!0}),c?.documentType!=="passport"&&n.handle.setSide(o.side)):n.settle(t.side,{ok:!1,issue:"reread"})},k=(t,n)=>({...t,issuer:c?.issuer??null,documentType:c?.documentType??null,captureSide:c===null?null:c.documentType==="passport"?"single":t.side,selectDocument:(r,s)=>{if(!H(t.documents).includes(r)||!B(t.documents,r).includes(s))throw new RangeError(`${s} from ${r} is not accepted`);(c?.issuer!==r||c.documentType!==s)&&y(),c={issuer:r,documentType:s},n()},capture:r=>{if(c===null)throw new Error("selectDocument() first");if(u!==null&&u.video===r.video)return u.flow.handle;y();let s=c,p=s.documentType==="passport"?"single":t.acceptedSides.length>0?t.side:void 0,v=O({video:r.video,documentType:s.documentType,issuer:s.issuer,...p!==void 0?{side:p}:{},...r.keepScreenAwake!==void 0?{keepScreenAwake:r.keepScreenAwake}:{},...r.liveMrz!==void 0?{liveMrz:r.liveMrz}:{}},{...e.documentInternals??{},...(()=>{let o=e.currentView()?.capture?.document,f=e.documentInternals?.blurRefuseSharpnessMax??o?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:x(o?.camera),shutter:V(o?.scan),guideLock:T(o?.guide),...e.documentInternals?.engineOptions??{}},...typeof f=="number"&&Number.isFinite(f)&&f>=0&&f<=1?{blurRefuseSharpnessMax:f}:{}}})(),deferRead:!0,...(()=>{let o=e.currentView();if(o===null||e.documentInternals?.webOcr!==void 0)return{};let f=j(e.runtime.client);return{webOcr:{captureDocument:o.capture?.document,salt:o.sessionId,baseUrl:G(e.runtime.client),...f!==void 0?{reports:f}:{}}}})()});return u={video:r.video,flow:v},v.handle.on("captured",o=>{g=g.then(()=>C(o,v)).catch(()=>{})}),v.handle}}),m=null,h=null,P=new Set,b=e.runtime.client;e.runtime.client=new Proxy(b,{get(t,n){if(n==="submitCheck")return(h??t).submitCheck.bind(h??t);let r=Reflect.get(t,n);return typeof r=="function"?r.bind(t):r}});let D=()=>{m?.destroy(),m=null,h=null},i=t=>{let n=e.currentView(),r=n===null?null:w(n,{isMobile:e.isMobile()});if(n===null||r?.kind!=="liveness"||r.livePhoto?.icao!==!0)return;if(m===null){let o=F({tuning:n.capture?.icao??null,tuningVersion:n.capture?.tuningVersion??null,...r.icao!=null?{policy:r.icao.policy}:{},still:r.livePhoto.still,...t.assetBaseUrl!==void 0?{assetBaseUrl:t.assetBaseUrl}:{}},e.livePhotoInternals);m=o,h=o.decorate(b),o.onGate(f=>{for(let S of P)S(f)})}let s=m,p=e.baseCapture??{},v=p.engineOptions?.telemetry;return{...p,engineOptions:{...p.engineOptions??{},measureQuality:s.engineOptions.measureQuality,telemetry:o=>{v?.(o),s.engineOptions.telemetry(o)}}}},l=z({keptPortraitInput:()=>m?.lastPortraitInput()??null,runner:()=>a,currentView:e.currentView,destroyed:e.destroyed,isMobile:e.isMobile,...e.portraitInternals!==void 0?{internals:e.portraitInternals}:{}}),d=U({...e,bindDocument:k,bindPortrait:l.bind,onLivePhoto:t=>(P.add(t),()=>P.delete(t))});return a=d,{...d,captureInternals:i,destroy:()=>{y(),l.destroy(),D(),P.clear()}}}export{le as createPlanRunner,j as reportSink,G as sdkAssetBase};
1
+ import{e as K}from"./chunk-A3FUGHAH.js";import{a as B,b as H,e as F,f as w,i as U}from"./chunk-3SL74TFR.js";import{o as A}from"./chunk-G6MU3B5V.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import{A as T,I as V,i as x}from"./chunk-QBPD7FRF.js";import"./chunk-SMKCBUJL.js";import"./chunk-MXWLCDFX.js";import{x as O}from"./chunk-4RS4LP7D.js";import"./chunk-G6LKLN4U.js";import"./chunk-TDLIXFDT.js";import"./chunk-7ZCZY3ZP.js";import"./chunk-BPE5NSQ2.js";import"./chunk-GI3UFGRQ.js";import{a as L,o as I}from"./chunk-J4NL62VQ.js";import"./chunk-SDWHJJ4W.js";import"./chunk-GT2ZLGF7.js";import"./chunk-GYNWLJYW.js";import"./chunk-FUHDOEBP.js";import"./chunk-POIQGEZM.js";import"./chunk-2BFYVMUU.js";import"./chunk-FPXL63KZ.js";import{h as _}from"./chunk-ULMH32G5.js";import{a as M}from"./chunk-TWB4LTCE.js";import"./chunk-OKWG3PVH.js";import"./chunk-DFTCAWMP.js";import"./chunk-DK5YPBDQ.js";function z(e){let a=null,c=Promise.resolve(),u=!1,g=null,y=null,C=null,k=!1,m=()=>{a?.controller.handle.destroy(),a=null},h=()=>{let i=e.currentView(),l=i===null?null:w(i,{isMobile:e.isMobile()});return l?.kind==="portrait"?l:null},P=async(i,l)=>{if(e.destroyed())return;l.setFlowState("uploading"),u=!1;let d=null;try{await e.runner().submit("portrait_icao",async(n,r)=>{if(d===null){let p=await I(n,"image","image/jpeg",i.image.size,{engine:"portrait"});await n.uploadToSpaces(p.uploadUrl,i.image,"image/jpeg"),d=(await n.completeMedia(p.key)).key}l.setFlowState("checking");let s={media:{portrait:d},gate:_(i.gate),...i.tuningVersion!==void 0?{tuningVersion:i.tuningVersion}:{}};return n.submitCheck("portrait_icao",s,{idempotencyKey:r})},()=>{g=d})}catch{u=!0}if(l.setFlowState("done"),e.destroyed())return;let t=h();(t===null||t.phase!=="capture")&&a?.controller===l&&m(),e.runner().republish()},b=i=>e.runner().submit("face_match",(l,d)=>l.submitCheck("face_match",g!==null?{imageKey:g}:{},{idempotencyKey:d})).then(()=>{},()=>{u=!0,i()});return{bind:(i,l)=>{if(i.phase==="match")return m(),y!==i.attemptsRemaining&&!u&&(y=i.attemptsRemaining,b(l)),{...i,uploadFailed:u,resubmit:()=>(u=!1,y=i.attemptsRemaining,l(),b(l)),capture:()=>{throw new Error("the portrait was already accepted")}};y=null;let d=e.keptPortraitInput?.()??null;return d!==null&&(k||d!==C&&i.report===null&&i.reason===void 0&&!i.retakeOnly)?(k||(C=d,k=!0,e.runner().submit("portrait_icao",(t,n)=>t.submitCheck("portrait_icao",d,{idempotencyKey:n}),()=>{g=d.media.portrait}).catch(()=>{}).finally(()=>{k=!1,l()})),{kind:"processing",key:"processing",context:i.context,section:i.section,stalled:!1,refresh:()=>Promise.resolve()}):{...i,uploadFailed:u,resubmit:()=>Promise.resolve(),capture:t=>{if(a!==null&&a.video===t.video)return a.controller.handle;m(),u=!1;let n=A({video:t.video,tuning:i.tuning,tuningVersion:i.tuningVersion,...i.icao!=null?{policy:i.icao.policy}:{},...t.keepScreenAwake!==void 0?{keepScreenAwake:t.keepScreenAwake}:{},...t.assetBaseUrl!==void 0?{assetBaseUrl:t.assetBaseUrl}:{}},e.internals,()=>e.destroyed()?"self":L(e.currentView()));return a={video:t.video,controller:n},n.handle.on("captured",r=>{c=c.then(()=>P(r,n)).catch(()=>{})}),n.handle}}},destroy:m}}function j(e){let a=e;if(typeof a.apiOrigin!="string"||typeof a.sessionToken!="string")return;let c=`${a.apiOrigin}/api/v2/hosted/capture-reports`,u=a.sessionToken;return g=>{try{fetch(c,{method:"POST",headers:{"content-type":"application/json","x-session-token":u,"x-sekyro-sdk":`@sekyro/web/${M}`},body:JSON.stringify({reports:g}),keepalive:!0}).catch(()=>{})}catch{}}}function G(e){let a=e.apiOrigin;return K("sdk",typeof a=="string"&&/staging|sandbox|localhost/.test(a)?"sandbox":"live")}function le(e){let a=null,c=null,u=null,g=Promise.resolve(),y=()=>{u?.flow.handle.destroy(),u=null},C=async(t,n)=>{if(e.destroyed())return;n.setFlowState("uploading");let r=null,s,p=!1;try{await a.submit("doc_ocr",async(S,E)=>{if(r===null){let R=await I(S,"image","image/jpeg",t.image.size,{engine:"document"});await S.uploadToSpaces(R.uploadUrl,t.image,"image/jpeg"),r=(await S.completeMedia(R.key)).key}return n.setFlowState("checking"),s===void 0&&(s=n.takeDeviceRead(t)),S.submitCheck("doc_ocr",{imageKey:r,side:t.side,...s!==null?{deviceRead:s}:{}},{idempotencyKey:E})})}catch{p=!0}finally{n.setFlowState("done")}if(e.destroyed())return;if(p){n.settle(t.side,{ok:!1,issue:"technical"});return}let v=e.currentView(),o=v===null?null:w(v,{isMobile:e.isMobile()});if(o?.kind!=="document"){n.settle(t.side,{ok:!0}),u?.flow===n?y():n.handle.destroy();return}if(o.reason==="document_type_not_accepted"){c=null,u?.flow===n&&y(),a.republish();return}t.side==="single"||o.acceptedSides.includes(t.side)||o.reason==="side_missing"?(n.settle(t.side,{ok:!0}),c?.documentType!=="passport"&&n.handle.setSide(o.side)):n.settle(t.side,{ok:!1,issue:"reread"})},k=(t,n)=>({...t,issuer:c?.issuer??null,documentType:c?.documentType??null,captureSide:c===null?null:c.documentType==="passport"?"single":t.side,selectDocument:(r,s)=>{if(!H(t.documents).includes(r)||!B(t.documents,r).includes(s))throw new RangeError(`${s} from ${r} is not accepted`);(c?.issuer!==r||c.documentType!==s)&&y(),c={issuer:r,documentType:s},n()},capture:r=>{if(c===null)throw new Error("selectDocument() first");if(u!==null&&u.video===r.video)return u.flow.handle;y();let s=c,p=s.documentType==="passport"?"single":t.acceptedSides.length>0?t.side:void 0,v=O({video:r.video,documentType:s.documentType,issuer:s.issuer,...p!==void 0?{side:p}:{},...r.keepScreenAwake!==void 0?{keepScreenAwake:r.keepScreenAwake}:{},...r.liveMrz!==void 0?{liveMrz:r.liveMrz}:{}},{...e.documentInternals??{},...(()=>{let o=e.currentView()?.capture?.document,f=e.documentInternals?.blurRefuseSharpnessMax??o?.scan?.blurRefuseSharpnessMax;return{engineOptions:{camera:x(o?.camera),shutter:V(o?.scan),guideLock:T(o?.guide),...e.documentInternals?.engineOptions??{}},...typeof f=="number"&&Number.isFinite(f)&&f>=0&&f<=1?{blurRefuseSharpnessMax:f}:{}}})(),deferRead:!0,...(()=>{let o=e.currentView();if(o===null||e.documentInternals?.webOcr!==void 0)return{};let f=j(e.runtime.client);return{webOcr:{captureDocument:o.capture?.document,salt:o.sessionId,baseUrl:G(e.runtime.client),...f!==void 0?{reports:f}:{}}}})()});return u={video:r.video,flow:v},v.handle.on("captured",o=>{g=g.then(()=>C(o,v)).catch(()=>{})}),v.handle}}),m=null,h=null,P=new Set,b=e.runtime.client;e.runtime.client=new Proxy(b,{get(t,n){if(n==="submitCheck")return(h??t).submitCheck.bind(h??t);let r=Reflect.get(t,n);return typeof r=="function"?r.bind(t):r}});let D=()=>{m?.destroy(),m=null,h=null},i=t=>{let n=e.currentView(),r=n===null?null:w(n,{isMobile:e.isMobile()});if(n===null||r?.kind!=="liveness"||r.livePhoto?.icao!==!0)return;if(m===null){let o=F({tuning:n.capture?.icao??null,tuningVersion:n.capture?.tuningVersion??null,...r.icao!=null?{policy:r.icao.policy}:{},still:r.livePhoto.still,...t.assetBaseUrl!==void 0?{assetBaseUrl:t.assetBaseUrl}:{}},e.livePhotoInternals);m=o,h=o.decorate(b),o.onGate(f=>{for(let S of P)S(f)})}let s=m,p=e.baseCapture??{},v=p.engineOptions?.telemetry;return{...p,engineOptions:{...p.engineOptions??{},measureQuality:s.engineOptions.measureQuality,telemetry:o=>{v?.(o),s.engineOptions.telemetry(o)}}}},l=z({keptPortraitInput:()=>m?.lastPortraitInput()??null,runner:()=>a,currentView:e.currentView,destroyed:e.destroyed,isMobile:e.isMobile,...e.portraitInternals!==void 0?{internals:e.portraitInternals}:{}}),d=U({...e,bindDocument:k,bindPortrait:l.bind,onLivePhoto:t=>(P.add(t),()=>P.delete(t))});return a=d,{...d,captureInternals:i,destroy:()=>{y(),l.destroy(),D(),P.clear()}}}export{le as createPlanRunner,j as reportSink,G as sdkAssetBase};
@@ -241,8 +241,13 @@ declare function resolveIcaoTuning(raw: unknown, tuningVersion?: unknown): Resol
241
241
 
242
242
  /** Session lifecycle status (spec §4 two-field status/outcome model). */
243
243
  type SessionStatus = "created" | "in_progress" | "review_pending" | "completed" | "expired" | "failed";
244
- /** Terminal verdict, orthogonal to `status`; `null` until terminal/review. */
245
- type SessionOutcome = "approved" | "review" | "rejected";
244
+ /**
245
+ * Terminal verdict, orthogonal to `status`; `null` until terminal/review.
246
+ * `superseded` (status `completed`): the session waited for a review and a
247
+ * newer attempt of the same person took that review over; its review step
248
+ * failed with `superseded_by_retry`, and the verdict is on the newer session.
249
+ */
250
+ type SessionOutcome = "approved" | "review" | "rejected" | "superseded";
246
251
  /**
247
252
  * What a finished session proved (spec 2026-10-29 §3.2): `1` a live, real
248
253
  * person, `2` that person's identity, `3` an identity corroborated by an
@@ -262,7 +267,7 @@ type CheckState = "pending" | "input_required" | "processing" | "passed" | "fail
262
267
  type CheckType = "liveness" | "face_match" | "doc_ocr" | "population_registry" | "phone_otp" | "nfc_chip" | "email_otp" | "portrait_icao" | "eid_auth";
263
268
  type LivenessReason = "no_face" | "media_unreadable" | "clip_too_short" | "spoof_detected" | "review_band" | "liveness_inconclusive" | "device_integrity_failed" | "mobile_required" | "uncalibrated_capture_channel" | "capture_back_camera" | "capture_not_upright" | "camera_unavailable";
264
269
  type PopulationReason = "registry_record_not_found" | "nni_not_found" | "id_number_invalid" | "nni_invalid" | "registry_unavailable" | "result_from_cache" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "id_number_recheck" | "nni_recheck";
265
- type FaceMatchReason = "no_face_source" | "no_face_reference" | "low_quality_reference" | "below_threshold" | "review_band" | "match_inconclusive" | "subject_revoked" | "probe_not_from_liveness";
270
+ type FaceMatchReason = "no_face_source" | "no_face_reference" | "low_quality_reference" | "below_threshold" | "review_band" | "match_inconclusive" | "subject_revoked" | "probe_not_from_liveness" | "prior_review_approved" | "prior_review_rejected";
266
271
  type DocReason = "side_missing" | "mrz_checksum_failed" | "unreadable" | "expired_document" | "authenticity_review" | "document_authenticity" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "nationality_unreadable" | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch";
267
272
  /**
268
273
  * Profile v2 step 3 matching reasons: a field the partner sent at session
@@ -286,7 +291,7 @@ type DecisionReason = "liveness_inconclusive" | "match_inconclusive" | "document
286
291
  * `otp_expired` (code lapsed or no active send), `otp_send_failed` (the OTP
287
292
  * service was unreachable / a send returned no token).
288
293
  */
289
- type PhoneOtpReason = "otp_mismatch" | "otp_expired" | "otp_send_failed" | "otp_channel_unavailable" | "otp_destination_not_allowed" | "otp_rate_limited" | "otp_destination_unknown" | "otp_daily_cap_reached" | "payment_method_required" | "spend_cap_reached" | "insufficient_balance";
294
+ type PhoneOtpReason = "otp_mismatch" | "otp_expired" | "otp_send_failed" | "otp_channel_unavailable" | "otp_destination_not_allowed" | "otp_rate_limited" | "otp_destination_unknown" | "otp_number_invalid" | "otp_number_not_mobile" | "otp_daily_cap_reached" | "payment_method_required" | "spend_cap_reached" | "insufficient_balance";
290
295
  /**
291
296
  * email_otp reasons (Plan 8, profile v2 §4.6.5). All transient: a wrong or
292
297
  * expired code, a send outage, too many sends, an address that cannot receive
@@ -332,7 +337,14 @@ type CheckReason = LivenessReason | PopulationReason | FaceMatchReason | DocReas
332
337
  * not the bound tester's; `tester_phone_mismatch` (phone_otp) when the
333
338
  * number is not the one the tester enrolled with.
334
339
  */
335
- | "tester_document_mismatch" | "tester_phone_mismatch";
340
+ | "tester_document_mismatch" | "tester_phone_mismatch"
341
+ /**
342
+ * Review outcomes, on any reviewed step: `superseded_by_retry` (a newer
343
+ * attempt of the same person took the review over; the session outcome is
344
+ * `superseded`) and `review_split` (two reviewers disagreed and nobody
345
+ * settled it before the review deadline; the session is rejected).
346
+ */
347
+ | "superseded_by_retry" | "review_split";
336
348
  /**
337
349
  * Session-level failure reasons: the session was stopped by a policy gate,
338
350
  * not by a failed check. All are terminal (no retry on this session):
@@ -726,6 +738,13 @@ interface HostedStepView {
726
738
  * older server: the person types a full international number.
727
739
  */
728
740
  phoneCountries?: string[];
741
+ /**
742
+ * phone_otp only (phone rules spec 2026-11-02 §2.1): one rule per `phoneCountries` entry, same order. Absent
743
+ * from an older server: the field then blocks nothing and groups nothing.
744
+ */
745
+ phoneRules?: PhoneCountryRule[];
746
+ /** phone_otp only (phone rules spec §2.1): numbers from other countries are accepted, through a free international field. */
747
+ phoneInternational?: true;
729
748
  /**
730
749
  * liveness / face_match (profile v2 step 4, decision mode `automatic`): the
731
750
  * capture must come from a phone — the liveness band is calibrated on
@@ -1386,6 +1405,26 @@ interface DocDeviceRead {
1386
1405
  framesToValid: number;
1387
1406
  msToValid: number;
1388
1407
  }
1408
+ /** How the digits of a national number group while typing (phone rules spec 2026-11-02 §2.1). */
1409
+ interface PhoneFormat {
1410
+ /** A pattern over the national digits, matched anchored at the start. */
1411
+ leading: string;
1412
+ /** Digits per block; the sum is one of the rule's `lengths`. */
1413
+ groups: number[];
1414
+ }
1415
+ /** The numbering plan of one accepted country, derived from libphonenumber metadata on the server (spec §2.1). */
1416
+ interface PhoneCountryRule {
1417
+ /** ISO alpha-2, an entry of the step's `phoneCountries`. */
1418
+ code: string;
1419
+ /** The calling code's digits, without `+`. */
1420
+ dial: string;
1421
+ /** National prefix a person may type first and the client drops; absent when the country has none. */
1422
+ trunk?: string;
1423
+ /** The valid national number lengths, ascending. */
1424
+ lengths: number[];
1425
+ /** Digit grouping; absent when the plan has too many formats or none usable. */
1426
+ formats?: PhoneFormat[];
1427
+ }
1389
1428
  /**
1390
1429
  * phone_otp executor input (Task 13): a two-phase check. `send` dispatches (or
1391
1430
  * resends) an OTP — resolving the number from the trusted server-side prefill
@@ -1400,6 +1439,11 @@ interface PhoneOtpInput {
1400
1439
  phone?: string;
1401
1440
  /** The code the user typed — `verify` only. */
1402
1441
  code?: string;
1442
+ /**
1443
+ * Phone rules spec 2026-11-02 §2.3: this client applied the server's rules and understands
1444
+ * `otp_number_invalid` and `otp_number_not_mobile`. `send` only.
1445
+ */
1446
+ phoneRules?: 1;
1403
1447
  /**
1404
1448
  * The channel the person chose for `send`. Must be one of the step's
1405
1449
  * `otp.channels` when the view lists them; a session without channels
@@ -1490,4 +1534,4 @@ interface SubmitCheckBody {
1490
1534
  forceOutcome?: "pass" | "fail" | "age_over" | "age_uncertain" | "age_under" | "age_unavailable";
1491
1535
  }
1492
1536
 
1493
- export { type IdentitySummarySource as $, type AcceptedDocumentType as A, type BackgroundUniformity as B, type ConsentLocale as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchReason as F, type HostedIcaoPolicy as G, type HostedSessionView as H, type IdentityConfirmDecision as I, type HostedIntegrity as J, type HostedLivePhotoTuning as K, type HostedLivenessCaptureTuning as L, type MediaKind as M, type HostedNativeCaptureTuning as N, type HostedOcrTuning as O, type PresignUploadResult as P, type HostedOtpView as Q, type ResolvedIcaoTuning as R, type ScreenRampColour as S, type HostedPlanView as T, type HostedPortraitView as U, type HostedStepView as V, type HostedVoiceLocale as W, type HostedVoiceView as X, type IcaoCaptureTuning as Y, type IcaoReportEntry as Z, type IdentityMethod as _, type HostedConsentView as a, type IdentitySummaryView as a0, type LivenessReason as a1, type MatchReason as a2, type MethodChoiceView as a3, type NationalEidOption as a4, type NfcChipReason as a5, type NfcStepView as a6, type OtpChoiceView as a7, type PhoneOtpReason as a8, type PlanAttempts as a9, type DocDeviceRead as aA, type DocOcrInput as aB, type DocSide as aC, type EmailOtpInput as aD, type FaceMatchInput as aE, type LivenessCaptureInput as aF, type LivenessInput as aG, type PhoneOtpInput as aH, type PopulationInput as aI, type PresignRequest as aJ, type RecordConsentResult as aK, type SessionStepView as aL, type SessionView as aM, type SubmitCheckBody as aN, type PlanChoiceKind as aa, type PlanChoiceOption as ab, type PlanChoiceView as ac, type PlanSectionView as ad, type PlanStepView as ae, type PolicyFailureReason as af, type PopulationReason as ag, type PortraitIcaoInput as ah, type PortraitIcaoReason as ai, type RetakeHint as aj, type ScreenRampChallenge as ak, type ScreenRampRendered as al, type ScreenRampReport as am, type SessionFailureReason as an, type SessionOutcome as ao, type SessionStatus as ap, type StepSection as aq, type VerificationAssurance as ar, type VerificationLevel as as, ICAO_FALLBACK as at, type IcaoProfile as au, resolveIcaoTuning as av, type PersonMask as aw, type AttestationInput as ax, type CaptureNoncesResult as ay, type CaptureProof as az, type CameraUnavailableCause as b, type CaptureContext as c, type CompleteMediaResult as d, type CheckType as e, type CheckInputByType as f, type IcaoCriterion as g, type AgeEstimationReason as h, type CaptureMode as i, type CaptureProvenance as j, type CheckReason as k, type CheckState as l, type ContactChannel as m, type DocReason as n, type EidAuthInput as o, type EidReason as p, type EmailOtpReason as q, type HostedAcceptedDocuments as r, type HostedBranding as s, type HostedBrandingColorKey as t, type HostedCaptureTuning as u, type HostedDocumentCaptureTuning as v, type HostedDocumentScanTuning as w, type HostedEidView as x, type HostedEmailOtpView as y, type HostedFlowRef as z };
1537
+ export { type IdentitySummarySource as $, type AcceptedDocumentType as A, type BackgroundUniformity as B, type ConsentLocale as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchReason as F, type HostedIcaoPolicy as G, type HostedSessionView as H, type IdentityConfirmDecision as I, type HostedIntegrity as J, type HostedLivePhotoTuning as K, type HostedLivenessCaptureTuning as L, type MediaKind as M, type HostedNativeCaptureTuning as N, type HostedOcrTuning as O, type PresignUploadResult as P, type HostedOtpView as Q, type ResolvedIcaoTuning as R, type ScreenRampColour as S, type HostedPlanView as T, type HostedPortraitView as U, type HostedStepView as V, type HostedVoiceLocale as W, type HostedVoiceView as X, type IcaoCaptureTuning as Y, type IcaoReportEntry as Z, type IdentityMethod as _, type HostedConsentView as a, type IdentitySummaryView as a0, type LivenessReason as a1, type MatchReason as a2, type MethodChoiceView as a3, type NationalEidOption as a4, type NfcChipReason as a5, type NfcStepView as a6, type OtpChoiceView as a7, type PhoneCountryRule as a8, type PhoneFormat as a9, type CaptureNoncesResult as aA, type CaptureProof as aB, type DocDeviceRead as aC, type DocOcrInput as aD, type DocSide as aE, type EmailOtpInput as aF, type FaceMatchInput as aG, type LivenessCaptureInput as aH, type LivenessInput as aI, type PhoneOtpInput as aJ, type PopulationInput as aK, type PresignRequest as aL, type RecordConsentResult as aM, type SessionStepView as aN, type SessionView as aO, type SubmitCheckBody as aP, type PhoneOtpReason as aa, type PlanAttempts as ab, type PlanChoiceKind as ac, type PlanChoiceOption as ad, type PlanChoiceView as ae, type PlanSectionView as af, type PlanStepView as ag, type PolicyFailureReason as ah, type PopulationReason as ai, type PortraitIcaoInput as aj, type PortraitIcaoReason as ak, type RetakeHint as al, type ScreenRampChallenge as am, type ScreenRampRendered as an, type ScreenRampReport as ao, type SessionFailureReason as ap, type SessionOutcome as aq, type SessionStatus as ar, type StepSection as as, type VerificationAssurance as at, type VerificationLevel as au, ICAO_FALLBACK as av, type IcaoProfile as aw, resolveIcaoTuning as ax, type PersonMask as ay, type AttestationInput as az, type CameraUnavailableCause as b, type CaptureContext as c, type CompleteMediaResult as d, type CheckType as e, type CheckInputByType as f, type IcaoCriterion as g, type AgeEstimationReason as h, type CaptureMode as i, type CaptureProvenance as j, type CheckReason as k, type CheckState as l, type ContactChannel as m, type DocReason as n, type EidAuthInput as o, type EidReason as p, type EmailOtpReason as q, type HostedAcceptedDocuments as r, type HostedBranding as s, type HostedBrandingColorKey as t, type HostedCaptureTuning as u, type HostedDocumentCaptureTuning as v, type HostedDocumentScanTuning as w, type HostedEidView as x, type HostedEmailOtpView as y, type HostedFlowRef as z };
@@ -241,8 +241,13 @@ declare function resolveIcaoTuning(raw: unknown, tuningVersion?: unknown): Resol
241
241
 
242
242
  /** Session lifecycle status (spec §4 two-field status/outcome model). */
243
243
  type SessionStatus = "created" | "in_progress" | "review_pending" | "completed" | "expired" | "failed";
244
- /** Terminal verdict, orthogonal to `status`; `null` until terminal/review. */
245
- type SessionOutcome = "approved" | "review" | "rejected";
244
+ /**
245
+ * Terminal verdict, orthogonal to `status`; `null` until terminal/review.
246
+ * `superseded` (status `completed`): the session waited for a review and a
247
+ * newer attempt of the same person took that review over; its review step
248
+ * failed with `superseded_by_retry`, and the verdict is on the newer session.
249
+ */
250
+ type SessionOutcome = "approved" | "review" | "rejected" | "superseded";
246
251
  /**
247
252
  * What a finished session proved (spec 2026-10-29 §3.2): `1` a live, real
248
253
  * person, `2` that person's identity, `3` an identity corroborated by an
@@ -262,7 +267,7 @@ type CheckState = "pending" | "input_required" | "processing" | "passed" | "fail
262
267
  type CheckType = "liveness" | "face_match" | "doc_ocr" | "population_registry" | "phone_otp" | "nfc_chip" | "email_otp" | "portrait_icao" | "eid_auth";
263
268
  type LivenessReason = "no_face" | "media_unreadable" | "clip_too_short" | "spoof_detected" | "review_band" | "liveness_inconclusive" | "device_integrity_failed" | "mobile_required" | "uncalibrated_capture_channel" | "capture_back_camera" | "capture_not_upright" | "camera_unavailable";
264
269
  type PopulationReason = "registry_record_not_found" | "nni_not_found" | "id_number_invalid" | "nni_invalid" | "registry_unavailable" | "result_from_cache" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "id_number_recheck" | "nni_recheck";
265
- type FaceMatchReason = "no_face_source" | "no_face_reference" | "low_quality_reference" | "below_threshold" | "review_band" | "match_inconclusive" | "subject_revoked" | "probe_not_from_liveness";
270
+ type FaceMatchReason = "no_face_source" | "no_face_reference" | "low_quality_reference" | "below_threshold" | "review_band" | "match_inconclusive" | "subject_revoked" | "probe_not_from_liveness" | "prior_review_approved" | "prior_review_rejected";
266
271
  type DocReason = "side_missing" | "mrz_checksum_failed" | "unreadable" | "expired_document" | "authenticity_review" | "document_authenticity" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "nationality_unreadable" | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch";
267
272
  /**
268
273
  * Profile v2 step 3 matching reasons: a field the partner sent at session
@@ -286,7 +291,7 @@ type DecisionReason = "liveness_inconclusive" | "match_inconclusive" | "document
286
291
  * `otp_expired` (code lapsed or no active send), `otp_send_failed` (the OTP
287
292
  * service was unreachable / a send returned no token).
288
293
  */
289
- type PhoneOtpReason = "otp_mismatch" | "otp_expired" | "otp_send_failed" | "otp_channel_unavailable" | "otp_destination_not_allowed" | "otp_rate_limited" | "otp_destination_unknown" | "otp_daily_cap_reached" | "payment_method_required" | "spend_cap_reached" | "insufficient_balance";
294
+ type PhoneOtpReason = "otp_mismatch" | "otp_expired" | "otp_send_failed" | "otp_channel_unavailable" | "otp_destination_not_allowed" | "otp_rate_limited" | "otp_destination_unknown" | "otp_number_invalid" | "otp_number_not_mobile" | "otp_daily_cap_reached" | "payment_method_required" | "spend_cap_reached" | "insufficient_balance";
290
295
  /**
291
296
  * email_otp reasons (Plan 8, profile v2 §4.6.5). All transient: a wrong or
292
297
  * expired code, a send outage, too many sends, an address that cannot receive
@@ -332,7 +337,14 @@ type CheckReason = LivenessReason | PopulationReason | FaceMatchReason | DocReas
332
337
  * not the bound tester's; `tester_phone_mismatch` (phone_otp) when the
333
338
  * number is not the one the tester enrolled with.
334
339
  */
335
- | "tester_document_mismatch" | "tester_phone_mismatch";
340
+ | "tester_document_mismatch" | "tester_phone_mismatch"
341
+ /**
342
+ * Review outcomes, on any reviewed step: `superseded_by_retry` (a newer
343
+ * attempt of the same person took the review over; the session outcome is
344
+ * `superseded`) and `review_split` (two reviewers disagreed and nobody
345
+ * settled it before the review deadline; the session is rejected).
346
+ */
347
+ | "superseded_by_retry" | "review_split";
336
348
  /**
337
349
  * Session-level failure reasons: the session was stopped by a policy gate,
338
350
  * not by a failed check. All are terminal (no retry on this session):
@@ -726,6 +738,13 @@ interface HostedStepView {
726
738
  * older server: the person types a full international number.
727
739
  */
728
740
  phoneCountries?: string[];
741
+ /**
742
+ * phone_otp only (phone rules spec 2026-11-02 §2.1): one rule per `phoneCountries` entry, same order. Absent
743
+ * from an older server: the field then blocks nothing and groups nothing.
744
+ */
745
+ phoneRules?: PhoneCountryRule[];
746
+ /** phone_otp only (phone rules spec §2.1): numbers from other countries are accepted, through a free international field. */
747
+ phoneInternational?: true;
729
748
  /**
730
749
  * liveness / face_match (profile v2 step 4, decision mode `automatic`): the
731
750
  * capture must come from a phone — the liveness band is calibrated on
@@ -1386,6 +1405,26 @@ interface DocDeviceRead {
1386
1405
  framesToValid: number;
1387
1406
  msToValid: number;
1388
1407
  }
1408
+ /** How the digits of a national number group while typing (phone rules spec 2026-11-02 §2.1). */
1409
+ interface PhoneFormat {
1410
+ /** A pattern over the national digits, matched anchored at the start. */
1411
+ leading: string;
1412
+ /** Digits per block; the sum is one of the rule's `lengths`. */
1413
+ groups: number[];
1414
+ }
1415
+ /** The numbering plan of one accepted country, derived from libphonenumber metadata on the server (spec §2.1). */
1416
+ interface PhoneCountryRule {
1417
+ /** ISO alpha-2, an entry of the step's `phoneCountries`. */
1418
+ code: string;
1419
+ /** The calling code's digits, without `+`. */
1420
+ dial: string;
1421
+ /** National prefix a person may type first and the client drops; absent when the country has none. */
1422
+ trunk?: string;
1423
+ /** The valid national number lengths, ascending. */
1424
+ lengths: number[];
1425
+ /** Digit grouping; absent when the plan has too many formats or none usable. */
1426
+ formats?: PhoneFormat[];
1427
+ }
1389
1428
  /**
1390
1429
  * phone_otp executor input (Task 13): a two-phase check. `send` dispatches (or
1391
1430
  * resends) an OTP — resolving the number from the trusted server-side prefill
@@ -1400,6 +1439,11 @@ interface PhoneOtpInput {
1400
1439
  phone?: string;
1401
1440
  /** The code the user typed — `verify` only. */
1402
1441
  code?: string;
1442
+ /**
1443
+ * Phone rules spec 2026-11-02 §2.3: this client applied the server's rules and understands
1444
+ * `otp_number_invalid` and `otp_number_not_mobile`. `send` only.
1445
+ */
1446
+ phoneRules?: 1;
1403
1447
  /**
1404
1448
  * The channel the person chose for `send`. Must be one of the step's
1405
1449
  * `otp.channels` when the view lists them; a session without channels
@@ -1490,4 +1534,4 @@ interface SubmitCheckBody {
1490
1534
  forceOutcome?: "pass" | "fail" | "age_over" | "age_uncertain" | "age_under" | "age_unavailable";
1491
1535
  }
1492
1536
 
1493
- export { type IdentitySummarySource as $, type AcceptedDocumentType as A, type BackgroundUniformity as B, type ConsentLocale as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchReason as F, type HostedIcaoPolicy as G, type HostedSessionView as H, type IdentityConfirmDecision as I, type HostedIntegrity as J, type HostedLivePhotoTuning as K, type HostedLivenessCaptureTuning as L, type MediaKind as M, type HostedNativeCaptureTuning as N, type HostedOcrTuning as O, type PresignUploadResult as P, type HostedOtpView as Q, type ResolvedIcaoTuning as R, type ScreenRampColour as S, type HostedPlanView as T, type HostedPortraitView as U, type HostedStepView as V, type HostedVoiceLocale as W, type HostedVoiceView as X, type IcaoCaptureTuning as Y, type IcaoReportEntry as Z, type IdentityMethod as _, type HostedConsentView as a, type IdentitySummaryView as a0, type LivenessReason as a1, type MatchReason as a2, type MethodChoiceView as a3, type NationalEidOption as a4, type NfcChipReason as a5, type NfcStepView as a6, type OtpChoiceView as a7, type PhoneOtpReason as a8, type PlanAttempts as a9, type DocDeviceRead as aA, type DocOcrInput as aB, type DocSide as aC, type EmailOtpInput as aD, type FaceMatchInput as aE, type LivenessCaptureInput as aF, type LivenessInput as aG, type PhoneOtpInput as aH, type PopulationInput as aI, type PresignRequest as aJ, type RecordConsentResult as aK, type SessionStepView as aL, type SessionView as aM, type SubmitCheckBody as aN, type PlanChoiceKind as aa, type PlanChoiceOption as ab, type PlanChoiceView as ac, type PlanSectionView as ad, type PlanStepView as ae, type PolicyFailureReason as af, type PopulationReason as ag, type PortraitIcaoInput as ah, type PortraitIcaoReason as ai, type RetakeHint as aj, type ScreenRampChallenge as ak, type ScreenRampRendered as al, type ScreenRampReport as am, type SessionFailureReason as an, type SessionOutcome as ao, type SessionStatus as ap, type StepSection as aq, type VerificationAssurance as ar, type VerificationLevel as as, ICAO_FALLBACK as at, type IcaoProfile as au, resolveIcaoTuning as av, type PersonMask as aw, type AttestationInput as ax, type CaptureNoncesResult as ay, type CaptureProof as az, type CameraUnavailableCause as b, type CaptureContext as c, type CompleteMediaResult as d, type CheckType as e, type CheckInputByType as f, type IcaoCriterion as g, type AgeEstimationReason as h, type CaptureMode as i, type CaptureProvenance as j, type CheckReason as k, type CheckState as l, type ContactChannel as m, type DocReason as n, type EidAuthInput as o, type EidReason as p, type EmailOtpReason as q, type HostedAcceptedDocuments as r, type HostedBranding as s, type HostedBrandingColorKey as t, type HostedCaptureTuning as u, type HostedDocumentCaptureTuning as v, type HostedDocumentScanTuning as w, type HostedEidView as x, type HostedEmailOtpView as y, type HostedFlowRef as z };
1537
+ export { type IdentitySummarySource as $, type AcceptedDocumentType as A, type BackgroundUniformity as B, type ConsentLocale as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchReason as F, type HostedIcaoPolicy as G, type HostedSessionView as H, type IdentityConfirmDecision as I, type HostedIntegrity as J, type HostedLivePhotoTuning as K, type HostedLivenessCaptureTuning as L, type MediaKind as M, type HostedNativeCaptureTuning as N, type HostedOcrTuning as O, type PresignUploadResult as P, type HostedOtpView as Q, type ResolvedIcaoTuning as R, type ScreenRampColour as S, type HostedPlanView as T, type HostedPortraitView as U, type HostedStepView as V, type HostedVoiceLocale as W, type HostedVoiceView as X, type IcaoCaptureTuning as Y, type IcaoReportEntry as Z, type IdentityMethod as _, type HostedConsentView as a, type IdentitySummaryView as a0, type LivenessReason as a1, type MatchReason as a2, type MethodChoiceView as a3, type NationalEidOption as a4, type NfcChipReason as a5, type NfcStepView as a6, type OtpChoiceView as a7, type PhoneCountryRule as a8, type PhoneFormat as a9, type CaptureNoncesResult as aA, type CaptureProof as aB, type DocDeviceRead as aC, type DocOcrInput as aD, type DocSide as aE, type EmailOtpInput as aF, type FaceMatchInput as aG, type LivenessCaptureInput as aH, type LivenessInput as aI, type PhoneOtpInput as aJ, type PopulationInput as aK, type PresignRequest as aL, type RecordConsentResult as aM, type SessionStepView as aN, type SessionView as aO, type SubmitCheckBody as aP, type PhoneOtpReason as aa, type PlanAttempts as ab, type PlanChoiceKind as ac, type PlanChoiceOption as ad, type PlanChoiceView as ae, type PlanSectionView as af, type PlanStepView as ag, type PolicyFailureReason as ah, type PopulationReason as ai, type PortraitIcaoInput as aj, type PortraitIcaoReason as ak, type RetakeHint as al, type ScreenRampChallenge as am, type ScreenRampRendered as an, type ScreenRampReport as ao, type SessionFailureReason as ap, type SessionOutcome as aq, type SessionStatus as ar, type StepSection as as, type VerificationAssurance as at, type VerificationLevel as au, ICAO_FALLBACK as av, type IcaoProfile as aw, resolveIcaoTuning as ax, type PersonMask as ay, type AttestationInput as az, type CameraUnavailableCause as b, type CaptureContext as c, type CompleteMediaResult as d, type CheckType as e, type CheckInputByType as f, type IcaoCriterion as g, type AgeEstimationReason as h, type CaptureMode as i, type CaptureProvenance as j, type CheckReason as k, type CheckState as l, type ContactChannel as m, type DocReason as n, type EidAuthInput as o, type EidReason as p, type EmailOtpReason as q, type HostedAcceptedDocuments as r, type HostedBranding as s, type HostedBrandingColorKey as t, type HostedCaptureTuning as u, type HostedDocumentCaptureTuning as v, type HostedDocumentScanTuning as w, type HostedEidView as x, type HostedEmailOtpView as y, type HostedFlowRef as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sekyro/web",
3
- "version": "0.1.0-rc.15",
3
+ "version": "0.1.0-rc.17",
4
4
  "description": "Sekyro AI web SDK \u2014 browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {
package/sbom.cdx.json CHANGED
@@ -97,8 +97,8 @@
97
97
  "type": "application",
98
98
  "name": "web",
99
99
  "group": "@sekyro",
100
- "version": "0.1.0-rc.15",
101
- "bom-ref": "@sekyro/web@0.1.0-rc.15",
100
+ "version": "0.1.0-rc.17",
101
+ "bom-ref": "@sekyro/web@0.1.0-rc.17",
102
102
  "description": "Sekyro AI web SDK — browser liveness capture, hosted-verification client and popup embed for Sekyro AI identity verification",
103
103
  "licenses": [
104
104
  {
@@ -108,7 +108,7 @@
108
108
  }
109
109
  }
110
110
  ],
111
- "purl": "pkg:npm/%40sekyro/web@0.1.0-rc.15?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-web",
111
+ "purl": "pkg:npm/%40sekyro/web@0.1.0-rc.17?vcs_url=git%2Bhttps%3A%2F%2Fgithub.com%2FIBTIKAR-Technologies%2Fibtikar-identity.git%23packages%2Fsekyro-web",
112
112
  "externalReferences": [
113
113
  {
114
114
  "url": "https://github.com/IBTIKAR-Technologies/ibtikar-identity/issues",
@@ -150,7 +150,7 @@
150
150
  "name": "tasks-vision",
151
151
  "group": "@mediapipe",
152
152
  "version": "0.10.35",
153
- "bom-ref": "@sekyro/web@0.1.0-rc.15|@mediapipe/tasks-vision@0.10.35",
153
+ "bom-ref": "@sekyro/web@0.1.0-rc.17|@mediapipe/tasks-vision@0.10.35",
154
154
  "licenses": [
155
155
  {
156
156
  "license": {
@@ -183,13 +183,13 @@
183
183
  ],
184
184
  "dependencies": [
185
185
  {
186
- "ref": "@sekyro/web@0.1.0-rc.15",
186
+ "ref": "@sekyro/web@0.1.0-rc.17",
187
187
  "dependsOn": [
188
- "@sekyro/web@0.1.0-rc.15|@mediapipe/tasks-vision@0.10.35"
188
+ "@sekyro/web@0.1.0-rc.17|@mediapipe/tasks-vision@0.10.35"
189
189
  ]
190
190
  },
191
191
  {
192
- "ref": "@sekyro/web@0.1.0-rc.15|@mediapipe/tasks-vision@0.10.35"
192
+ "ref": "@sekyro/web@0.1.0-rc.17|@mediapipe/tasks-vision@0.10.35"
193
193
  }
194
194
  ]
195
195
  }
@@ -1 +0,0 @@
1
- import{a as X,b as ke,d as V,e as L,f as U,g as be,h as E,i as B,j as b,k as F,l as P,m as w,n as D,v as Pe,w as xe}from"./chunk-G7WHAP7L.js";import{m as Ce}from"./chunk-EIFZSEYD.js";import{a as ge}from"./chunk-GT2ZLGF7.js";import{d as $}from"./chunk-FUHDOEBP.js";import{c as j,f as _e,g as G}from"./chunk-23XZDY52.js";function K(e){return e.idNumberBound??e.nniBound}function H(e){return e===void 0?void 0:e.idNumberFromDocument??e.nniFromDocument}function ve(e){let t=e.idNumberMasked??e.nniMasked;return typeof t=="string"&&t!==""?t:void 0}var Ze="https://api.sekyro.ai",We=5e3,Je=1500,Qe=10;function $e(e){return new Promise(t=>setTimeout(t,e))}function je(){let e=globalThis.crypto;if(e!==void 0&&typeof e.randomUUID=="function")return e.randomUUID();let t=new Uint8Array(16);if(e!==void 0&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let o=0;o<16;o+=1)t[o]=Math.floor(Math.random()*256);t[6]=(t[6]??0)&15|64,t[8]=(t[8]??0)&63|128;let i=[...t].map(o=>o.toString(16).padStart(2,"0")).join("");return`${i.slice(0,8)}-${i.slice(8,12)}-${i.slice(12,16)}-${i.slice(16,20)}-${i.slice(20)}`}function Tt(e){return Xe(e,{})}function Xe(e,t){let i=e.apiOrigin??Ze,o=e.autoRetry??!0,r=e.rearm??"auto",a=t.client??new _e({apiOrigin:i,sessionToken:e.clientToken,fetch:e.fetch}),u=t.sleep??$e,s=t.uuid??je,h=t.getTurnstileToken??((n,c)=>import("./turnstile-FATNZ4AG.js").then(l=>l.executeTurnstile(n,c))),S=ge(),m=null,p=null,d=!1,R=new AbortController,f=null,q=null,x=n=>{f=n,S.emit("view",n),m?.onView(n)},_=()=>f!==null?Promise.resolve(f):(q??(q=a.getSession().then(n=>(x(n),n)).finally(()=>{q=null})),q),v=async()=>{let n=await a.getSession();return x(n),n},Y=async(n,c)=>{n.plan!==void 0?x(n):await v()},Z=null,ie=async n=>{let c=await _();if(!n&&c.consentRecorded)return;let l=await a.recordConsent(e.locale);l.plan!==void 0?x(l):f!==null&&x({...f,consentRecorded:!0})},O=n=>n?.force===!0?ie(!0):(Z??(Z=ie(!1).finally(()=>{Z=null})),Z),W={client:a,ensureConsent:n=>O(n),sleep:u,uuid:s,onBusy:n=>{d||S.emit("busy",n)}},oe=!1,re=null,J=n=>{if(n.status==="approved"||n.status==="rejected"||n.status==="review"){if(oe)return;oe=!0}re=JSON.stringify(n),S.emit("result",n)},Te=n=>{re!==JSON.stringify(n)&&J(n)},se=async n=>{let c=f;n&&(c=await v().catch(()=>f));let l=c===null?null:E(c);return l!==null&&!d&&S.emit("method",l),l!==null},ae=null,ce=!1,ue=!1,de=()=>Pe(W,(n,c)=>n.submitCheck("population_registry",{},{idempotencyKey:c})),le=n=>K(n)===!0||H(P(n,"population_registry"))===!0,Ve=async()=>{try{let n=await _();if(b(n)||E(n)!==null||F(n)?.checkType!=="population_registry")return;if(!le(n)&&H(P(n,"population_registry"))===void 0&&(n=await v()),!le(n)){ue=!0;return}await O(),await Y(await de(),"population_registry");let c=f===null?void 0:P(f,"population_registry");if(c?.state==="input_required"&&c.reason==="registry_unavailable"&&U(c)>0){if(await u(We),d)return;await Y(await de(),"population_registry")}}catch(n){if(n instanceof j&&(n.code==="check_not_active"||n.code==="step_not_on_path")){await v().catch(()=>{});return}ce=!0;return}f!==null&&b(f)&&J(D(f,{autoRetry:o}))},pe=()=>(ae??(ae=Ve()),ae),De=async()=>{let c=(await _()).turnstileSiteKey;return c===null?{sandbox:!0}:{channel:"hosted_web",siteKey:c,turnstileToken:await h(c,{signal:R.signal})}},k=null,fe=Promise.resolve(),T=0,He=async()=>{let n=await _();for(let c=0;c<Qe&&!d&&!b(n)&&F(n)===void 0&&L(n).some(l=>l.state==="processing")&&(await u(Je),!d);c+=1)n=await v();return n},Ne=async(n,c,l)=>{let{capture:g}=n,C=()=>d,N=()=>n.alive&&n.attempt===l,he=y=>{N()&&g.setFlowState(y)},A=y=>{if(!C()&&(J(y),!!N())){if(y.status==="retry"&&r==="auto"){g.handle.retry();return}g.setFlowState("done")}};if(c.degraded==="NO_RECORDER"){let y=f?.sessionId??(await _().catch(()=>null))?.sessionId??"";A(w(y,"no_recorder"));return}he("uploading");try{if(await pe(),C())return;let y=await _(),ye;if(!b(y)&&E(y)!==null){await se(!1),A(w(y.sessionId,"method_required"));return}if(!b(y)){if(F(y)?.checkType==="population_registry"){A(w(y.sessionId,ue?"nni_unbound":ce?"network":"registry_unavailable"));return}if(await O(),C())return;ye=f??y;let Q=await xe({...W,artifacts:c,getAttestation:De,getView:()=>f??y,refreshView:v,applySubmit:Y,onPhase:he,isCancelled:C,onKeyframePromoted:Ye=>{p=Ye}});if(C())return;if(Q.kind==="unavailable"){A(w(y.sessionId,Q.reason));return}if(Q.kind==="resync"&&await v(),f!==null&&E(f)!==null){await se(!1),A(w(y.sessionId,"method_required"));return}y=await He()}A(D(y,{autoRetry:o,previous:ye}))}catch{if(C())return;A(w(f?.sessionId??"","network"))}},Le=(n,c)=>{let l=n.attempt;T>0&&n.alive&&n.capture.setFlowState("uploading"),T+=1,fe=fe.then(()=>Ne(n,c,l)).finally(()=>{T-=1,T===0&&m?.onChainIdle()}).catch(()=>{})},me=n=>{k?.capture.handle.destroy(),k!==null&&(k.alive=!1);let c=Ce(n,m?.captureInternals?.(n)??t.capture,()=>f?.capture?.liveness?.keyframe?.rank===!0,()=>X(f),()=>f?.capture?.liveness?.screenRamp),l={capture:c,alive:!0,attempt:0};k=l,c.handle.on("state",C=>{C==="starting"&&(l.attempt+=1)}),c.handle.on("captured",C=>{Promise.resolve().then(()=>Le(l,C))});let g=c.handle;return{get state(){return g.state},get captureMode(){return g.captureMode},get facingMode(){return g.facingMode},on:(C,N)=>g.on(C,N),start:async C=>{if(f===null&&await _().catch(()=>{}),!!l.alive)return g.start(C)},retry:()=>g.retry(),switchCamera:()=>g.switchCamera(),destroy:()=>{l.alive=!1,k===l&&(k=null),g.destroy()}}},Ue=async()=>{if(d)return null;try{let n=await _();return d?null:E(n)}catch{return null}},Be=async()=>{if(d)return"self";try{let n=await _();return d?"self":X(n)}catch{return"self"}},Fe=async()=>{if(d)return!1;try{let n=await _();if(d||b(n))return!1;let c=P(n,"liveness");return B(c)&&c?.requiresMobile===!0&&!$()}catch{return!1}},Ge=async()=>{if(d)return!1;try{let n=await _();return!d&&n.returning===!0}catch{return!1}},Ke=async n=>{let c=(await _()).plan?.choice,l=c?.options.find(C=>V[C.service]===n);if(!l)throw new RangeError(`method ${String(n)} is not offered`);let g=await a.choose(c.nodeId,l.id);d||x(g)},Se=null,qe=()=>(Se??(Se=import("./plan-runner-FZJ5KVT3.js").then(n=>{let c=n.createPlanRunner({runtime:W,currentView:()=>f,ensureView:_,refreshView:v,ensureConsent:()=>O(),liveness:me,chainBusy:()=>T>0,destroyed:()=>d,sleep:u,isMobile:$,now:t.now??Date.now,keptFaceKey:()=>p,setView:x,baseCapture:t.capture,emitStep:l=>{d||S.emit("step",l)},emitResult:Te,documentInternals:t.document,portraitInternals:t.portrait,livePhotoInternals:t.livePhoto});return m=c,c})),Se);return{consent:()=>O(),startRegistry:pe,methodChoice:Ue,selectMethod:Ke,reportCameraUnavailable:async n=>{await O();let c=a.reportCameraUnavailable;if(c===void 0)throw new TypeError("this client cannot report a missing camera");let l=await c.call(a,n).catch(g=>{if(g instanceof j&&g.code==="check_out_of_order")return a.getSession();throw g});d||x(l)},mobileRequired:Fe,captureMode:Be,returning:Ge,liveness:me,run:async()=>{if(d)throw new Error("verification destroyed");return(await qe()).run()},currentStep:()=>m?.current()??null,voiceClips:async()=>{if(d)return null;try{let n=await _();return d?null:n.voice??null}catch{return null}},on:(n,c)=>S.on(n,c),destroy:()=>{d=!0,R.abort(),m?.destroy(),k!==null&&(k.alive=!1,k.capture.handle.destroy(),k=null),S.clear()}}}var Ie=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"];var ze=["carte_identite","passport","residence_permit"];function et(e,t){let i=e.byIssuer?.[t]??e.default;return ze.filter(o=>i==="*"||i.includes(o))}function Nt(e,t=Ie){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(o=>et(e,o).length>0).sort()}function Re(e){if(e.acceptedDocuments)return e.acceptedDocuments;let t=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:t}}}function Lt(e){return/^[A-Z]{2}$/.test(e)?String.fromCodePoint(...[...e].map(t=>127462+t.charCodeAt(0)-65)):""}var Yt=["national_number","document_photo","national_eid"],tt=new Set(["phone_otp","email_otp","national_eid","document","nfc","population_registry","supplied_identity","summary_confirm","liveness","face_match","aml_screening","face_dedup","age_estimation"]),nt=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),ee=["document","population_registry","national_eid"],te=["phone_otp","email_otp"],we={identity_method:ee,contact:te},it=["population_registry","document"],Oe="platform_unsupported",ot=new Set(["prefilled","user_entered","prefilled_or_entered"]),rt={phone_otp:"contact",email_otp:"contact",eid_auth:"identity",doc_ocr:"identity",nfc_chip:"identity",population_registry:"identity",liveness:"live_photo",portrait_icao:"live_photo",face_match:"live_photo"};function I(e){return e.section??rt[e.checkType]??null}function st(e,t){let i=e.plan?.choice;if(i===void 0||i.locked)return;let o=i.options.find(r=>r.id!==i.selected&&r.available!==!1&&t.includes(r.service));return o===void 0?void 0:{nodeId:i.nodeId,option:o}}function ne(e){let t=e.plan,i=t?.choice;if(t===void 0||i===void 0||i.locked||t.current===null||t.current===i.nodeId||b(e))return null;let o=we[i.kind]??[...ee,...te],r=i.options.flatMap(s=>s.available===!1||!o.includes(s.service)?[]:[s.nationalEid!=null?{id:s.id,service:s.service,nationalEid:s.nationalEid}:{id:s.id,service:s.service}]),a=t.steps.find(s=>s.id===t.current)?.service,u=i.selected??r.find(s=>s.service===a)?.id??null;return r.some(s=>s.id!==u)?{nodeId:i.nodeId,kind:i.kind,current:u,options:r}:null}function Ee(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}function at(e){let t=(e.plan?.sections??[]).map(r=>({id:r.id,state:r.state})),i={sessionId:e.sessionId,orgName:e.orgName,returning:e.returning===!0,consentRecorded:e.consentRecorded,expiresAt:e.expiresAt,sections:t.map(r=>r.id),progress:t,purpose:e.purpose??"identity"};e.branding!==void 0&&(i.branding=e.branding),e.cameraUnavailableHandled===!0&&(i.cameraUnavailableHandled=!0);let o=ne(e);return o!==null&&(i.switchable=o),i}function ct(e){let t={attemptsRemaining:U(e),attemptsExhausted:e.attemptsExhausted===!0};return e.reason!==void 0&&(t.reason=e.reason),e.retakeHint!==void 0&&(t.retakeHint=e.retakeHint),t}var Me={phone_otp:"phone",email_otp:"email"};function ut(e,t){let i=st(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return i===void 0?void 0:Me[i.option.service]}function dt(e,t,i,o){let r=t.checkType==="email_otp",a=(r?t.emailOtp:t.otp)??{},u=r?t.emailOtp?.emailSource:t.otp?.numberSource,s=u!==void 0&&ot.has(u)?u:r?"prefilled_or_entered":"user_entered",h=typeof a.sentToMasked=="string"&&a.sentToMasked.length>0,S=ut(e,r?"email_otp":"phone_otp"),m={key:t.checkType,context:i,section:I(t),phase:h?"verify":"send",canSwitch:S!==void 0,...o},p=r?{kind:"email_otp",...m,emailSource:s,needsEmail:s!=="prefilled"}:{kind:"phone_otp",...m,numberSource:s,needsPhone:s!=="prefilled",channels:(t.otp?.channels??[]).filter(d=>d==="whatsapp"||d==="sms")};return S!==void 0&&(p.switchChannel=S),h&&(p.sentToMasked=a.sentToMasked),!r&&t.otp?.channel!==void 0&&(p.channel=t.otp.channel),!r&&Array.isArray(t.phoneCountries)&&(p.phoneCountries=t.phoneCountries.filter(d=>typeof d=="string"&&/^[A-Z]{2}$/.test(d))),a.expiresAt!==void 0&&(p.codeExpiresAt=a.expiresAt),a.resendAvailableAt!==void 0&&(p.resendAvailableAt=a.resendAvailableAt),p}function lt(e,t,i,o){let r=K(e)===!0?"bound":H(t)===!0?"document":"typed",a=r==="typed"&&t.state==="input_required"&&t.reason!==void 0&&ke(t.reason)==="id_number_recheck",u=Ee(ne(e)),s=!o.attemptsExhausted&&u.length===1&&u[0]?.service==="document";return{kind:"registry",key:"registry",context:i,section:I(t),state:t.state==="input_required"?"input_required":"pending",source:r,recheck:a,canUseDocument:s,...o}}function pt(e,t,i,o){let r=[...t.acceptedSides??[]];return{kind:"document",key:"document",context:i,section:I(t),side:r.includes("recto")?"verso":"recto",acceptedSides:r,documents:Re(e),...o}}function ft(e){let t=P(e,"liveness");return t?.state==="passed"||t?.state==="review"}function Ae(e,t,i,o,r){let a=t.icao?.report;return{kind:"portrait",key:`portrait:${r}`,context:i,section:I(t),phase:r,report:Array.isArray(a)?a:null,review:t.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:G(e),retakeOnly:r==="capture"&&t.state==="input_required"&&e.capture?.livePhoto?.oneCapture===!0&&ft(e),...o}}var z={minLongSidePx:1280,jpegQuality:.95};function mt(e,t){let i=e.capture?.livePhoto;if(i?.oneCapture!==!0)return null;let o=P(e,"portrait_icao"),r=i.still??z;return{icao:t==="liveness"&&G(e)!==null&&o!==void 0&&o.state==="pending"&&o.reason===void 0,still:{minLongSidePx:r.minLongSidePx??z.minLongSidePx,jpegQuality:r.jpegQuality??z.jpegQuality}}}function St(e,t,i,o){let r=t.eid,a=I(t);if(r===void 0||r.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:i,section:a,checkType:"eid_auth",reason:"update_required"};let u=Ee(ne(e)),s=u.length===1&&it.includes(u[0]?.service??"")?u[0]:void 0,h=s===void 0?void 0:V[s.service],S=h!==void 0,m={kind:"eid",key:"eid",context:i,section:a,provider:r.provider,providerName:r.providerName,country:r.country,challenge:"app_code",phase:r.awaiting==="code"?"code":"identifier",identifierBound:r.identifierBound===!0,canUseCamera:S,afterPass:r.afterPass==="continue"?"continue":"end",...o};return S&&(m.cameraMethod=h),r.expiresAt!==void 0&&(m.codeExpiresAt=r.expiresAt),r.resendAvailableAt!==void 0&&(m.resendAvailableAt=r.resendAvailableAt),r.resendsRemaining!==void 0&&(m.resendsRemaining=r.resendsRemaining),r.codeAttemptsRemaining!==void 0&&(m.codeAttemptsRemaining=r.codeAttemptsRemaining),m}function ht(e,t){if(t.checkType!=="face_match"||t.reason!==void 0)return null;let i=P(e,"portrait_icao");return i!==void 0&&(i.state==="passed"||i.state==="review")?i:null}function yt(e){return L(e).filter(t=>t.state==="failed").pop()?.attemptsExhausted===!0}function gt(e,t){let i=e.failureReason,o;i===Oe?o="platform_unsupported":e.status==="expired"?o="expired":e.status==="review_pending"?o="review":e.status==="completed"&&e.outcome==="approved"?o="approved":e.status==="completed"&&e.outcome==="review"?o="review":i==="device_cooldown"?o="cooldown":i!==void 0?o="policy_stop":yt(e)?o="attempts_exhausted":o="rejected";let r=o==="platform_unsupported"?{sessionId:e.sessionId,status:"unavailable"}:D(e,{autoRetry:!1}),a={kind:"result",key:"result",context:t,section:null,display:o,result:r};return i!==void 0&&(a.failureReason=i),e.retryAfter!==void 0&&(a.retryAfter=e.retryAfter),a}function Ct(e,t,i){let o=e.identitySummary;if(o==null)return null;let r={kind:"identity_summary",key:"identity_summary",context:t,section:i??"identity",summaryKind:o.kind==="partial"?"partial":o.kind??"full",source:o.source,portraitAvailable:o.portrait?.available===!0,retakeAvailable:o.retakeAvailable===!0};for(let u of _t){let s=o[u];typeof s=="string"&&s!==""&&(r[u]=s)}let a=ve(o);return a!==void 0&&(r.idNumberMasked=a,r.nniMasked=a),r}var _t=["fullName","birthDate","birthYear","nationality","documentType","documentNumberMasked","expiryDate","retakeTarget"];function M(e,t,i,o){return{kind:"unsupported",key:`unsupported:${i}`,context:e,section:t,checkType:i,reason:o}}function kt(e){return e.kind==="contact"?"contact":(e.kind==="identity_method","identity")}function bt(e,t){let i=we[e.kind]??[...ee,...te],o=kt(e),r=e.options.flatMap(u=>{if(u.available===!1||!i.includes(u.service))return[];let s={id:u.id,service:u.service};return u.nationalEid!=null&&(s.nationalEid=u.nationalEid),[s]});if(r.length===0){let u=e.options.length>0&&e.options.every(s=>s.service==="nfc");return M(t,o,"choice",u?"platform_unsupported":"update_required")}let a={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:r};if(e.kind==="identity_method"){let u={kind:"method",key:"method",context:t,section:o,options:r.map(h=>V[h.service]),choice:a},s=r.find(h=>h.nationalEid!==void 0)?.nationalEid;return s!==void 0&&(u.nationalEid=s),u}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:o,options:r.map(u=>Me[u.service]),selected:null,locked:!1,choice:a}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:o,choice:a}}function Zt(e,t={}){let i=at(e);if(b(e)||e.failureReason===Oe)return gt(e,i);let o=e.plan;if(o===void 0||!Array.isArray(o.sections))return M(i,null,"plan","update_required");let r=be(e);if(r!==null)return bt(r,i);let a=o.current===null?void 0:o.steps.find(p=>p.id===o.current),u=p=>{let d={kind:"processing",key:"processing",context:i,section:p!==void 0?I(p):o.sections.find(R=>R.state==="current")?.id??null,stalled:!1};return typeof p?.service=="string"&&p.service!==""&&(d.service=p.service),d};if(o.current===null)return u(o.steps.find(p=>p.state==="processing"));if(a===void 0)return M(i,null,"step","update_required");if(!tt.has(a.service))return a.interaction==="server"?u(a):M(i,I(a),a.service,"update_required");if(nt.has(a.service)||!B(a))return u(a);let s=a,h=ct(s),S=s.checkType,m=I(s);switch(S){case"phone_otp":case"email_otp":return dt(e,s,i,h);case"population_registry":return lt(e,s,i,h);case"eid_auth":return St(e,s,i,h);case"doc_ocr":return pt(e,s,i,h);case"identity_confirm":return Ct(e,i,m)??u(s);case"portrait_icao":return Ae(e,s,i,h,"capture");case"liveness":case"face_match":{let p=ht(e,s);if(p!==null)return Ae(e,p,i,h,"match");let d=s.requiresMobile===!0,R=G(e);return d&&t.isMobile===!1?{kind:"mobile_required",key:"mobile_required",context:i,section:m,checkType:S}:{kind:"liveness",key:"biometric",context:i,section:m,mode:S==="face_match"?"selfie":"liveness",requiresMobile:d,instructions:R===null?"standard":"icao",icao:R,livePhoto:mt(e,S),...h}}case"nfc_chip":return M(i,m,S,"platform_unsupported");default:return M(i,m,S,"update_required")}}export{Ze as a,We as b,Je as c,Qe as d,je as e,Tt as f,Xe as g,Ie as h,ze as i,et as j,Nt as k,Re as l,Lt as m,Yt as n,Oe as o,I as p,ne as q,Ee as r,ht as s,Zt as t};
@@ -1 +0,0 @@
1
- import{d as K,e as pe,f as me,g as fe,i as he,j as X,l as Q,n as Se,o as ge,v as ye,x as T,y as Z}from"./chunk-G7WHAP7L.js";import{c as de,d as ue,e as le}from"./chunk-FPXL63KZ.js";import{c as F,g as q,h as be}from"./chunk-23XZDY52.js";var _e=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","ER","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"];var Ue=["carte_identite","passport","residence_permit"];function Fe(e,t){let i=e.byIssuer?.[t]??e.default;return Ue.filter(r=>i==="*"||i.includes(r))}function Tt(e,t=_e){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(r=>Fe(e,r).length>0).sort()}function Ce(e){if(e.acceptedDocuments)return e.acceptedDocuments;let t=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:t}}}var Ke=640,Ze=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),ke=6,Pe=1500,Me={sharpness:1,exposure:1,meanLuma:128},Re=null;function Ye(e,t){try{Re??(Re=document.createElement("canvas"));let i=Re,r=96/Math.max(1,t.width);i.width=Math.max(1,Math.round(t.width*r)),i.height=Math.max(1,Math.round(t.height*r));let s=i.getContext("2d");if(s===null)return Me;s.drawImage(e,t.x,t.y,t.width,t.height,0,0,i.width,i.height);let d=s.getImageData(0,0,i.width,i.height);return{sharpness:ue(d),exposure:le(d),meanLuma:de(d)}}catch{return Me}}async function je(e,t){let i=e.source;return"convertToBlob"in i?i.convertToBlob({type:"image/jpeg",quality:t}):new Promise((r,s)=>{i.toBlob(d=>d===null?s(new Error("encode failed")):r(d),"image/jpeg",t)})}function Lt(e,t={}){let i=t.now??(()=>performance.now()),r=t.setTimer??((l,n)=>setTimeout(l,n)),s=t.clearTimer??(l=>clearTimeout(l)),d=t.encode??je,p=t.quality??Ye,c=e.tuningVersion??null,_=new Set,C=!1,b=e.video??null,S=null,g=t.grabFrame??null,E=null,x=1e3/ke,P=null,R=null,L=!1,O=!1,A=Number.NEGATIVE_INFINITY,M=null,H=0,N=null,V=null,D=Promise.all([import("./icao-gate-PWBMKRGC.js"),import("./icao-tuning-4GGVX6B4.js"),import("./create-portrait-capture-53XBURNT.js"),import("./landmarker-KB7LVXAU.js"),import("./background-monitor-A7FKJOAG.js")]).then(async([l,n,o,a,u])=>{let f=n.resolveIcaoTuning(e.tuning,e.tuningVersion??void 0);f.background.required&&(R=u.createBackgroundMonitor({tuning:f.backgroundCheck,assetBaseUrl:e.assetBaseUrl??"/models-v3",...t.createSegmenter!==void 0?{createSegmenter:t.createSegmenter}:{},now:i})),S=l.createIcaoGate(f,{policy:e.policy??"reject"}),g??(g=o.defaultGrabber()),E=o.observe,x=1e3/Math.min(ke,f.cadenceHz);let y=(t.createLandmarker??a.createFaceLandmarker)(e.assetBaseUrl??"/models-v3"),h=await new Promise((m,k)=>{let I=setTimeout(()=>{k(new Error("landmarker init timeout")),y.then(v=>v.close(),()=>{})},a.LANDMARKER_INIT_TIMEOUT_MS);y.then(v=>{clearTimeout(I),m(v)},v=>{clearTimeout(I),k(v)})});C?h.close():P=h}).catch(()=>{L=!0}),Y=l=>{for(let n of _)n({holding:O||L,update:l})},B=()=>{if(M=null,!(C||P===null||S===null||g===null||E===null||b===null)){if(i()-A>Pe){Y(null);return}try{let l=g(b,Ke);if(l!==null){let n=Math.max(i(),H+1);H=n;let o=P.detect(l.source,n),a=b.videoWidth||l.width,u=b.videoHeight||l.height,f=E(o,l,a,u);f.geometry!==null&&R!==null&&(f.backgroundCheck=R.measure(l,f.geometry.box,a,u));let y=S.push(f,i());O=y.ready,Y(y)}}catch{}M=r(B,x)}},j=()=>{let l=i()-A>Pe;A=i(),l&&(S?.reset(),O=!1,N=null,V=null),M===null&&P!==null&&!C&&(M=r(B,0))},$=()=>{let l=g===null||b===null?null:g(b,null);if(l===null||S===null||Math.max(l.width,l.height)<e.still.minLongSidePx)return Promise.resolve(null);let n=S.summary();return d(l,e.still.jpegQuality).then(o=>({image:o,width:l.width,height:l.height,gate:n}),()=>null)},W=null;return{engineOptions:{measureQuality:(l,n)=>{b=l,j();let o=p(l,n);return O||L?o:{...o,sharpness:0}},telemetry:l=>{if(l.type!=="fired"||C)return;N=$();let n=W;n!==null&&N.then(o=>o===null?void 0:n(o).catch(()=>{})),O=!1,M!==null&&s(M),M=null,A=Number.NEGATIVE_INFINITY}},decorate:l=>{let n=new WeakMap,o=new Map,a=h=>{let m=n.get(h);return m===void 0&&(m=(async()=>{let k=await ge(l,"image","image/jpeg",h.image.size,{engine:"portrait"});return await l.uploadToSpaces(k.uploadUrl,h.image,"image/jpeg"),(await l.completeMedia(k.key)).key})(),m.catch(()=>n.delete(h)),n.set(h,m)),m};W=a;let u=async h=>{let m;try{m=await a(h)}catch(k){let I=k?.code;if(typeof I=="string"&&Ze.has(I))throw k;return null}return{media:{portrait:m},gate:be(h.gate),...c!==null?{tuningVersion:c}:{}}},f=l.submitCheck.bind(l),y=(async(h,m,k)=>{if(h!=="liveness")return f(h,m,k);let I=k?.idempotencyKey,v=I===void 0?void 0:o.get(I);if(v===void 0){let ae=N;v=ae===null?Promise.resolve(null):ae.then(ce=>ce===null?null:u(ce)),I!==void 0&&(o.set(I,v),v.catch(()=>o.delete(I)))}let z=await v;if(z===null)return f("liveness",m,k);let Be=await f("liveness",{...m,portraitIcao:z},k);return V=z,Be});return new Proxy(l,{get(h,m){if(m==="submitCheck")return y;let k=Reflect.get(h,m);return typeof k=="function"?k.bind(h):k}})},onGate:l=>(_.add(l),()=>_.delete(l)),lastPortraitInput:()=>V,destroy:()=>{C=!0,N=null,V=null,M!==null&&s(M),M=null,_.clear(),D.then(()=>{P?.close(),P=null,R?.close(),R=null})}}}function Ee(e){return e.idNumberBound??e.nniBound}function Ae(e){return e===void 0?void 0:e.idNumberFromDocument??e.nniFromDocument}function Ie(e){let t=e.idNumberMasked??e.nniMasked;return typeof t=="string"&&t!==""?t:void 0}var ve=Object.freeze({nni_invalid:"id_number_invalid",nni_not_found:"registry_record_not_found",nni_recheck:"id_number_recheck",document_nni_mismatch:"document_id_number_mismatch",nni_locked:"id_number_locked",nni_unbound:"id_number_unbound",sandbox_nni_not_seeded:"sandbox_id_number_not_seeded",missing_nni:"missing_id_number",registry_needs_nni_source:"registry_needs_id_number_source"}),We=new Map(Object.entries(ve)),Gt=new Map(Object.entries(ve).map(([e,t])=>[t,e]));function Te(e){return We.get(e)??e}var Qe=new Set(["phone_otp","email_otp","national_eid","document","nfc","population_registry","supplied_identity","summary_confirm","liveness","face_match","aml_screening","face_dedup","age_estimation"]),qe=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),te=["document","population_registry","national_eid"],ne=["phone_otp","email_otp"],we={identity_method:te,contact:ne},Je=["population_registry","document"],xe="platform_unsupported",$e=new Set(["prefilled","user_entered","prefilled_or_entered"]),ze={phone_otp:"contact",email_otp:"contact",eid_auth:"identity",doc_ocr:"identity",nfc_chip:"identity",population_registry:"identity",liveness:"live_photo",portrait_icao:"live_photo",face_match:"live_photo"};function w(e){return e.section??ze[e.checkType]??null}function ie(e,t){let i=e.plan?.choice;if(i===void 0||i.locked)return;let r=i.options.find(s=>s.id!==i.selected&&s.available!==!1&&t.includes(s.service));return r===void 0?void 0:{nodeId:i.nodeId,option:r}}function oe(e){let t=e.plan,i=t?.choice;if(t===void 0||i===void 0||i.locked||t.current===null||t.current===i.nodeId||X(e))return null;let r=we[i.kind]??[...te,...ne],s=i.options.flatMap(c=>c.available===!1||!r.includes(c.service)?[]:[c.nationalEid!=null?{id:c.id,service:c.service,nationalEid:c.nationalEid}:{id:c.id,service:c.service}]),d=t.steps.find(c=>c.id===t.current)?.service,p=i.selected??s.find(c=>c.service===d)?.id??null;return s.some(c=>c.id!==p)?{nodeId:i.nodeId,kind:i.kind,current:p,options:s}:null}function Ne(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}function Xe(e){let t=(e.plan?.sections??[]).map(s=>({id:s.id,state:s.state})),i={sessionId:e.sessionId,orgName:e.orgName,returning:e.returning===!0,consentRecorded:e.consentRecorded,expiresAt:e.expiresAt,sections:t.map(s=>s.id),progress:t,purpose:e.purpose??"identity"};e.branding!==void 0&&(i.branding=e.branding),e.cameraUnavailableHandled===!0&&(i.cameraUnavailableHandled=!0);let r=oe(e);return r!==null&&(i.switchable=r),i}function et(e){let t={attemptsRemaining:me(e),attemptsExhausted:e.attemptsExhausted===!0};return e.reason!==void 0&&(t.reason=e.reason),e.retakeHint!==void 0&&(t.retakeHint=e.retakeHint),t}var Le={phone_otp:"phone",email_otp:"email"};function tt(e,t){let i=ie(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return i===void 0?void 0:Le[i.option.service]}function nt(e,t,i,r){let s=t.checkType==="email_otp",d=(s?t.emailOtp:t.otp)??{},p=s?t.emailOtp?.emailSource:t.otp?.numberSource,c=p!==void 0&&$e.has(p)?p:s?"prefilled_or_entered":"user_entered",_=typeof d.sentToMasked=="string"&&d.sentToMasked.length>0,C=tt(e,s?"email_otp":"phone_otp"),b={key:t.checkType,context:i,section:w(t),phase:_?"verify":"send",canSwitch:C!==void 0,...r},S=s?{kind:"email_otp",...b,emailSource:c,needsEmail:c!=="prefilled"}:{kind:"phone_otp",...b,numberSource:c,needsPhone:c!=="prefilled",channels:(t.otp?.channels??[]).filter(g=>g==="whatsapp"||g==="sms")};return C!==void 0&&(S.switchChannel=C),_&&(S.sentToMasked=d.sentToMasked),!s&&t.otp?.channel!==void 0&&(S.channel=t.otp.channel),!s&&Array.isArray(t.phoneCountries)&&(S.phoneCountries=t.phoneCountries.filter(g=>typeof g=="string"&&/^[A-Z]{2}$/.test(g))),d.expiresAt!==void 0&&(S.codeExpiresAt=d.expiresAt),d.resendAvailableAt!==void 0&&(S.resendAvailableAt=d.resendAvailableAt),S}function it(e,t,i,r){let s=Ee(e)===!0?"bound":Ae(t)===!0?"document":"typed",d=s==="typed"&&t.state==="input_required"&&t.reason!==void 0&&Te(t.reason)==="id_number_recheck",p=Ne(oe(e)),c=!r.attemptsExhausted&&p.length===1&&p[0]?.service==="document";return{kind:"registry",key:"registry",context:i,section:w(t),state:t.state==="input_required"?"input_required":"pending",source:s,recheck:d,canUseDocument:c,...r}}function ot(e,t,i,r){let s=[...t.acceptedSides??[]];return{kind:"document",key:"document",context:i,section:w(t),side:s.includes("recto")?"verso":"recto",acceptedSides:s,documents:Ce(e),...r}}function rt(e){let t=Q(e,"liveness");return t?.state==="passed"||t?.state==="review"}function Oe(e,t,i,r,s){let d=t.icao?.report;return{kind:"portrait",key:`portrait:${s}`,context:i,section:w(t),phase:s,report:Array.isArray(d)?d:null,review:t.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:q(e),retakeOnly:s==="capture"&&t.state==="input_required"&&e.capture?.livePhoto?.oneCapture===!0&&rt(e),...r}}var ee={minLongSidePx:1280,jpegQuality:.95};function st(e,t){let i=e.capture?.livePhoto;if(i?.oneCapture!==!0)return null;let r=Q(e,"portrait_icao"),s=i.still??ee;return{icao:t==="liveness"&&q(e)!==null&&r!==void 0&&r.state==="pending"&&r.reason===void 0,still:{minLongSidePx:s.minLongSidePx??ee.minLongSidePx,jpegQuality:s.jpegQuality??ee.jpegQuality}}}function at(e,t,i,r){let s=t.eid,d=w(t);if(s===void 0||s.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:i,section:d,checkType:"eid_auth",reason:"update_required"};let p=Ne(oe(e)),c=p.length===1&&Je.includes(p[0]?.service??"")?p[0]:void 0,_=c===void 0?void 0:K[c.service],C=_!==void 0,b={kind:"eid",key:"eid",context:i,section:d,provider:s.provider,providerName:s.providerName,country:s.country,challenge:"app_code",phase:s.awaiting==="code"?"code":"identifier",identifierBound:s.identifierBound===!0,canUseCamera:C,afterPass:s.afterPass==="continue"?"continue":"end",...r};return C&&(b.cameraMethod=_),s.expiresAt!==void 0&&(b.codeExpiresAt=s.expiresAt),s.resendAvailableAt!==void 0&&(b.resendAvailableAt=s.resendAvailableAt),s.resendsRemaining!==void 0&&(b.resendsRemaining=s.resendsRemaining),s.codeAttemptsRemaining!==void 0&&(b.codeAttemptsRemaining=s.codeAttemptsRemaining),b}function ct(e,t){if(t.checkType!=="face_match"||t.reason!==void 0)return null;let i=Q(e,"portrait_icao");return i!==void 0&&(i.state==="passed"||i.state==="review")?i:null}function dt(e){return pe(e).filter(t=>t.state==="failed").pop()?.attemptsExhausted===!0}function ut(e,t){let i=e.failureReason,r;i===xe?r="platform_unsupported":e.status==="expired"?r="expired":e.status==="review_pending"?r="review":e.status==="completed"&&e.outcome==="approved"?r="approved":e.status==="completed"&&e.outcome==="review"?r="review":i==="device_cooldown"?r="cooldown":i!==void 0?r="policy_stop":dt(e)?r="attempts_exhausted":r="rejected";let s=r==="platform_unsupported"?{sessionId:e.sessionId,status:"unavailable"}:Se(e,{autoRetry:!1}),d={kind:"result",key:"result",context:t,section:null,display:r,result:s};return i!==void 0&&(d.failureReason=i),e.retryAfter!==void 0&&(d.retryAfter=e.retryAfter),d}function lt(e,t,i){let r=e.identitySummary;if(r==null)return null;let s={kind:"identity_summary",key:"identity_summary",context:t,section:i??"identity",summaryKind:r.kind==="partial"?"partial":r.kind??"full",source:r.source,portraitAvailable:r.portrait?.available===!0,retakeAvailable:r.retakeAvailable===!0};for(let p of pt){let c=r[p];typeof c=="string"&&c!==""&&(s[p]=c)}let d=Ie(r);return d!==void 0&&(s.idNumberMasked=d,s.nniMasked=d),s}var pt=["fullName","birthDate","birthYear","nationality","documentType","documentNumberMasked","expiryDate","retakeTarget"];function G(e,t,i,r){return{kind:"unsupported",key:`unsupported:${i}`,context:e,section:t,checkType:i,reason:r}}function mt(e){return e.kind==="contact"?"contact":(e.kind==="identity_method","identity")}function ft(e,t){let i=we[e.kind]??[...te,...ne],r=mt(e),s=e.options.flatMap(p=>{if(p.available===!1||!i.includes(p.service))return[];let c={id:p.id,service:p.service};return p.nationalEid!=null&&(c.nationalEid=p.nationalEid),[c]});if(s.length===0){let p=e.options.length>0&&e.options.every(c=>c.service==="nfc");return G(t,r,"choice",p?"platform_unsupported":"update_required")}let d={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:s};if(e.kind==="identity_method"){let p={kind:"method",key:"method",context:t,section:r,options:s.map(_=>K[_.service]),choice:d},c=s.find(_=>_.nationalEid!==void 0)?.nationalEid;return c!==void 0&&(p.nationalEid=c),p}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:r,options:s.map(p=>Le[p.service]),selected:null,locked:!1,choice:d}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:r,choice:d}}function J(e,t={}){let i=Xe(e);if(X(e)||e.failureReason===xe)return ut(e,i);let r=e.plan;if(r===void 0||!Array.isArray(r.sections))return G(i,null,"plan","update_required");let s=fe(e);if(s!==null)return ft(s,i);let d=r.current===null?void 0:r.steps.find(S=>S.id===r.current),p=S=>{let g={kind:"processing",key:"processing",context:i,section:S!==void 0?w(S):r.sections.find(E=>E.state==="current")?.id??null,stalled:!1};return typeof S?.service=="string"&&S.service!==""&&(g.service=S.service),g};if(r.current===null)return p(r.steps.find(S=>S.state==="processing"));if(d===void 0)return G(i,null,"step","update_required");if(!Qe.has(d.service))return d.interaction==="server"?p(d):G(i,w(d),d.service,"update_required");if(qe.has(d.service)||!he(d))return p(d);let c=d,_=et(c),C=c.checkType,b=w(c);switch(C){case"phone_otp":case"email_otp":return nt(e,c,i,_);case"population_registry":return it(e,c,i,_);case"eid_auth":return at(e,c,i,_);case"doc_ocr":return ot(e,c,i,_);case"identity_confirm":return lt(e,i,b)??p(c);case"portrait_icao":return Oe(e,c,i,_,"capture");case"liveness":case"face_match":{let S=ct(e,c);if(S!==null)return Oe(e,S,i,_,"match");let g=c.requiresMobile===!0,E=q(e);return g&&t.isMobile===!1?{kind:"mobile_required",key:"mobile_required",context:i,section:b,checkType:C}:{kind:"liveness",key:"biometric",context:i,section:b,mode:C==="face_match"?"selfie":"liveness",requiresMobile:g,instructions:E===null?"standard":"icao",icao:E,livePhoto:st(e,C),..._}}case"nfc_chip":return G(i,b,C,"platform_unsupported");default:return G(i,b,C,"update_required")}}var ht=/^[A-Z0-9][A-Z0-9 -]{0,39}$/,St=Object.freeze({normalize:e=>e.trim().toUpperCase().replace(/\s+/g," "),check:e=>ht.test(e),registrySources:Object.freeze([]),describe:"number must be 1 to 40 letters, digits, spaces or hyphens"});function gt(e){return typeof e=="string"&&/^\d{10}$/.test(e)&&Number(e)%97===1}var yt=Object.freeze({normalize:e=>e.trim(),check:e=>gt(e),registrySources:Object.freeze(["MR.anrpts"]),describe:"number must be the 10-digit Mauritanian national ID number with a valid check digit"}),bt=Object.freeze({"MR:national_id":yt});function re(e,t){return bt[`${e.toUpperCase()}:${t}`]??St}var _t=Object.freeze({MRT:"MR"});function Ve(e,t){let i=e.trim().toUpperCase();return re(_t[i]??i,t)}function De(e){let t=Ve(e.issuingCountry,e.type);return t.check(t.normalize(e.number))}function Ge(e){return re("MR","national_id").check(e)}function se(e){let t="";for(let i of e){let r=i.codePointAt(0)??0;r>=1632&&r<=1641?t+=String(r-1632):r>=1776&&r<=1785?t+=String(r-1776):i!==" "&&i!=="-"&&i!==" "&&(t+=i)}return t}var Ct=[1e3,2e3,4e3,8e3,15e3],kt=3e4,Pt=/^\+[1-9]\d{7,14}$/,Mt=/^\d{6}$/,Rt=/^\d{6}$/,Et=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,He=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","identity_confirm_required","identity_confirm_locked","choice_locked","choice_option_unavailable","choice_not_found","step_not_on_path","check_not_active"]),At=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]);function tn(e){let t=!1,i=null,r="",s=!1,d=!1,p=!1,c={},_={},C=new Set,b=!1,S=null,g="idle",E=new Map,x=new Map,P=(n,o,a)=>{let u=`${n}.${o}`,f=E.get(u);if(f!==void 0)return f;let y=x.get(n),h=(y===void 0?a():y.then(a)).finally(()=>{E.delete(u)});E.set(u,h);let m=h.then(()=>{},()=>{});return x.set(n,m),m.then(()=>{x.get(n)===m&&x.delete(n)}),h},R=async(n,o,a)=>{await e.ensureConsent();let u;try{u=await ye(e.runtime,o)}catch(y){if(y instanceof F&&He.has(y.code)){await e.refreshView();return}throw y}if(a?.(),e.destroyed())return;let f=u;f.plan!==void 0&&e.setView!==void 0?e.setView(f):await e.refreshView()},L=async n=>{await e.ensureConsent();let o;try{try{o=await n(e.runtime.client)}catch(a){if(!(a instanceof F)||a.code!=="consent_required")throw a;await e.runtime.ensureConsent({force:!0}),o=await n(e.runtime.client)}}catch(a){if(a instanceof F&&He.has(a.code)){await e.refreshView();return}throw a}e.destroyed()||(o!==void 0&&e.setView!==void 0?e.setView(o):await e.refreshView())},O=(n,o)=>P("choice",`${n}:${o}`,()=>L(a=>a.choose(n,o))),A=(n,o)=>n.options.some(a=>a.id===o)?O(n.nodeId,o):Promise.reject(new RangeError(`option ${String(o)} is not offered`)),M=(n,o)=>{let a=e.currentView(),u=a===null?void 0:ie(a,n);return u===void 0?Promise.reject(new RangeError(`the ${o} is not offered`)):O(u.nodeId,u.option.id)},H=n=>P("identity",n,()=>L(o=>o.confirmIdentity===void 0?Promise.reject(new Error("identity confirmation is not available in this build")):o.confirmIdentity(n))),N=(n,o)=>{let a=n.kind,u=a==="phone_otp",f=u?"phone":"email",y={action:"send"};if(u?n.needsPhone:n.needsEmail){let h=o[f]??_[a],m=u?h?.replace(/[\s().-]/g,""):h?.trim();if(m===void 0||!(u?Pt:Et).test(m))return Promise.reject(u?new T("phone","format"):new Z("email","format"));y[f]=m}if(u){let h=n.channels,m=o.channel??(h.length===1?h[0]:void 0);if(h.length>0){if(m===void 0)return Promise.reject(new Z("channel","required"));if(!h.includes(m))return Promise.reject(new Z("channel","unavailable"))}m!==void 0&&(y.channel=m)}return P(a,"send",()=>R(a,(h,m)=>h.submitCheck(a,y,{idempotencyKey:m}),()=>{c[a]=e.now(),y[f]!==void 0&&(_[a]=y[f])}))},V=(n,o)=>Mt.test(o)?P(n,"verify",()=>R(n,(a,u)=>a.submitCheck(n,{action:"verify",code:o},{idempotencyKey:u}))):Promise.reject(new T("code","format")),D=(n,o)=>P("eid_auth",n,()=>R("eid_auth",(a,u)=>a.submitCheck("eid_auth",o,{idempotencyKey:u}))),Y=(n,o)=>{if(n.identifierBound)return D("start",{action:"start"});let a=se(o??"");if(n.country==="MR"){if(!/^\d{10}$/.test(a))return Promise.reject(new T("nni","format"));if(!Ge(a))return Promise.reject(new T("nni","check_digit"))}else if(a==="")return Promise.reject(new T("nni","format"));return D("start",{action:"start",identifier:a})},B=(n,o,a)=>{if(n.source!=="typed")return Promise.reject(new RangeError("this session already holds the ID number"));let u=se(o);return/^\d{10}$/.test(u)?De({type:"national_id",issuingCountry:"MR",number:u})?P("population_registry","submitIdNumber",()=>R("population_registry",(f,y)=>f.submitCheck("population_registry",{idNumber:u,nni:u},{idempotencyKey:y}),()=>{S=`\u2022\u2022\u2022\u2022\u2022\u2022${u.slice(-4)}`})):Promise.reject(new T(a,"check_digit")):Promise.reject(new T(a,"format"))},j=n=>{switch(n.kind){case"phone_otp":case"email_otp":{let o={...n,send:(u={})=>N(n,u),verify:u=>V(n.kind,u),switchTo:()=>n.canSwitch&&n.switchChannel!==void 0?M([n.switchChannel==="email"?"email_otp":"phone_otp"],"other contact option"):Promise.reject(new RangeError("this session has no other contact option"))},a=c[n.kind];return o.resendAvailableAt===void 0&&a!==void 0&&(o.resendAvailableAt=new Date(a+kt).toISOString()),o}case"eid":return{...n,start:o=>Y(n,o),verify:o=>Rt.test(o)?D("verify",{action:"verify",code:o}):Promise.reject(new T("code","format")),resend:()=>n.resendsRemaining===0?Promise.reject(new RangeError("no new code can be sent for this session")):D("resend",{action:"resend"}),useCamera:()=>n.canUseCamera&&n.cameraMethod!==void 0?M(n.cameraMethod==="document_photo"?["document"]:["population_registry"],"camera path"):Promise.reject(new RangeError("the camera path is not offered"))};case"method":return{...n,select:o=>{let a=n.choice.options.find(u=>K[u.service]===o);return a!==void 0?A(n.choice,a.id):Promise.reject(new RangeError(`method ${String(o)} is not offered`))},choose:o=>A(n.choice,o)};case"choice":return{...n,choose:o=>A(n.choice,o)};case"registry":return{...n,submitIdNumber:o=>B(n,o,"idNumber"),submitNni:o=>B(n,o,"nni"),confirm:()=>P("population_registry","confirm",()=>R("population_registry",(o,a)=>o.submitCheck("population_registry",{},{idempotencyKey:a}))),useDocument:()=>n.canUseDocument?M(["document"],"document method"):Promise.reject(new RangeError("the document method is not offered"))};case"document":return e.bindDocument!==void 0?e.bindDocument(n,l):{...n,issuer:null,documentType:null,captureSide:null,selectDocument:()=>{throw new Error("document capture is not available in this build")},capture:()=>{throw new Error("document capture is not available in this build")}};case"portrait":return e.bindPortrait!==void 0?e.bindPortrait(n,l):{...n,uploadFailed:!1,resubmit:()=>Promise.resolve(),capture:()=>{throw new Error("portrait capture is not available in this build")}};case"contact_choice":return{...n,select:o=>{let a=o==="phone"?"phone_otp":o==="email"?"email_otp":void 0,u=n.choice.options.find(f=>f.service===a);return u!==void 0?A(n.choice,u.id):Promise.reject(new RangeError(`contact ${String(o)} is not offered`))},choose:o=>A(n.choice,o)};case"identity_summary":return{...n,...n.idNumberMasked===void 0&&n.summaryKind==="partial"&&S!==null?{idNumberMasked:S,nniMasked:S}:{},portrait:async()=>{let o=e.runtime.client;if(!n.portraitAvailable||o.identityPortrait===void 0)return null;try{return await o.identityPortrait()}catch{return null}},confirm:()=>H("confirm"),retake:()=>n.retakeAvailable?H("retake"):Promise.reject(new RangeError("no retake is left"))};case"liveness":return{...n,capture:o=>e.liveness(o),onLivePhoto:o=>n.livePhoto?.icao===!0&&e.onLivePhoto!==void 0?e.onLivePhoto(o):()=>{}};case"mobile_required":case"processing":return{...n,refresh:async()=>{s=!1,await e.refreshView()}};case"unsupported":case"result":return{...n};default:{let o=n;throw new Error(`runner: unhandled step ${JSON.stringify(o)}`)}}},$=async()=>{if(!d){d=!0;try{for(let n of Ct){if(await e.sleep(n),!t||e.destroyed())return;let o=await e.refreshView().catch(()=>null);if(o!==null&&J(o,{isMobile:e.isMobile()}).kind!=="processing")return}s=!0,l()}finally{d=!1}}},W=n=>{if(n.kind!=="liveness"||n.mode!=="selfie")return null;let o={kind:"processing",key:"processing",context:n.context,section:n.section,stalled:!1};if(g==="inflight")return o;if(!b||g==="done")return null;let a=e.keptFaceKey?.()??null;return a===null?null:(g="inflight",R("face_match",(u,f)=>u.submitCheck("face_match",{imageKey:a},{idempotencyKey:f}),()=>{g="done"}).then(()=>{g==="inflight"&&(g="done",l())},()=>{g="done",l()}),o)},U=(n,o=!1)=>{if(!t||e.destroyed()||e.chainBusy())return;let a=J(n,{isMobile:e.isMobile()});a.kind==="registry"&&a.recheck&&(b=!0,g="idle"),a=W(a)??a,a.kind==="processing"?a.stalled=s:s=!1;let u=j(a),f=a.kind==="result"?void 0:a.context.switchable,y=f===void 0?u:{...u,chooseOption:m=>A({nodeId:f.nodeId,kind:f.kind,selected:f.current,options:f.options},m)},h=JSON.stringify(y);a.kind==="registry"&&a.source==="document"&&a.state==="pending"&&!C.has("registry")&&(C.add("registry"),y.confirm().catch(m=>{(!(m instanceof F)||At.has(m.code))&&C.delete("registry")})),!(!o&&h===r)&&(r=h,i=y,e.emitStep(y),a.kind==="processing"&&!s&&g!=="inflight"&&$(),a.kind==="result"&&!p&&(p=!0,e.emitResult(a.result)))};function l(){let n=e.currentView();n!==null&&U(n,!0)}return{run:async()=>{if(e.destroyed())throw new Error("verification destroyed");t=!0;let n=await e.ensureView();return i===null&&U(n),i??j(J(n,{isMobile:e.isMobile()}))},current:()=>i,onView:n=>U(n),onChainIdle:()=>{let n=e.currentView();n!==null&&U(n)},republish:l,submit:R}}export{Fe as a,Tt as b,ke as c,Pe as d,Lt as e,J as f,Ct as g,kt as h,tn as i};