@sekyro/web 0.1.0-rc.17 → 0.1.0-rc.18

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 (32) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/{capture-session-doc-TATPATSZ.js → capture-session-doc-IE5VPYWC.js} +1 -1
  3. package/dist/{chunk-QBPD7FRF.js → chunk-D42NBRSV.js} +1 -1
  4. package/dist/{chunk-TWB4LTCE.js → chunk-DNB3R4PI.js} +1 -1
  5. package/dist/chunk-G2HL2ZWH.js +1 -0
  6. package/dist/chunk-JDTZK3A7.js +1 -0
  7. package/dist/{chunk-4RS4LP7D.js → chunk-KBKCYDZQ.js} +1 -1
  8. package/dist/{chunk-GYNWLJYW.js → chunk-OG4QAJ3M.js} +1 -1
  9. package/dist/chunk-SVNAHPQU.js +1 -0
  10. package/dist/{chunk-SDWHJJ4W.js → chunk-VCUOPQFA.js} +1 -1
  11. package/dist/{chunk-ULMH32G5.js → chunk-ZMO2ZQAS.js} +1 -1
  12. package/dist/client/index.cjs +1 -1
  13. package/dist/client/index.js +1 -1
  14. package/dist/core/index.cjs +1 -1
  15. package/dist/core/index.js +1 -1
  16. package/dist/{create-document-capture-5FJI57YI.js → create-document-capture-35HFVNC3.js} +1 -1
  17. package/dist/{create-verification-CNCMU1kK.d.ts → create-verification-C_fx3n4A.d.ts} +15 -1
  18. package/dist/{create-verification-CIwl0NIg.d.cts → create-verification-DiH7QRdv.d.cts} +15 -1
  19. package/dist/index.cjs +1 -1
  20. package/dist/index.d.cts +2 -2
  21. package/dist/index.d.ts +2 -2
  22. package/dist/index.js +1 -1
  23. package/dist/internal/index.cjs +1 -1
  24. package/dist/internal/index.d.cts +2 -2
  25. package/dist/internal/index.d.ts +2 -2
  26. package/dist/internal/index.js +1 -1
  27. package/dist/{plan-runner-WRY4FOWW.js → plan-runner-YXTOSPDP.js} +1 -1
  28. package/package.json +1 -1
  29. package/sbom.cdx.json +7 -7
  30. package/dist/chunk-3SL74TFR.js +0 -1
  31. package/dist/chunk-J4NL62VQ.js +0 -1
  32. package/dist/chunk-MMTOOH32.js +0 -1
@@ -1,5 +1,5 @@
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';
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-DiH7QRdv.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-DiH7QRdv.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
4
  import { H as HostedSessionView, e as CheckType, k as CheckReason, ag as PlanStepView } from '../types-CKgMWVnP.cjs';
5
5
  export { av as ICAO_FALLBACK, Y as IcaoCaptureTuning, aw as IcaoProfile, R as ResolvedIcaoTuning, ax as resolveIcaoTuning } from '../types-CKgMWVnP.cjs';
@@ -1,5 +1,5 @@
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';
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-C_fx3n4A.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-C_fx3n4A.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
4
  import { H as HostedSessionView, e as CheckType, k as CheckReason, ag as PlanStepView } from '../types-CKgMWVnP.js';
5
5
  export { av as ICAO_FALLBACK, Y as IcaoCaptureTuning, aw as IcaoProfile, R as ResolvedIcaoTuning, ax as resolveIcaoTuning } from '../types-CKgMWVnP.js';
@@ -1 +1 @@
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
+ import{c as _e,d as Le,e as Re,g as Se,h as Te,i as ce}from"../chunk-G2HL2ZWH.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-D42NBRSV.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-KBKCYDZQ.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-SVNAHPQU.js";import{c as S,i as T,j as c,k as l,l as y,o as f,q as u,r as O,s as A,t as I,u as x,v as C,w as P,x as D}from"../chunk-JDTZK3A7.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-VCUOPQFA.js";import"../chunk-GT2ZLGF7.js";import"../chunk-OG4QAJ3M.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-ZMO2ZQAS.js";import"../chunk-DNB3R4PI.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-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};
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-G2HL2ZWH.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-D42NBRSV.js";import"./chunk-SMKCBUJL.js";import"./chunk-MXWLCDFX.js";import{x as O}from"./chunk-KBKCYDZQ.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,p as I}from"./chunk-JDTZK3A7.js";import"./chunk-VCUOPQFA.js";import"./chunk-GT2ZLGF7.js";import"./chunk-OG4QAJ3M.js";import"./chunk-FUHDOEBP.js";import"./chunk-POIQGEZM.js";import"./chunk-2BFYVMUU.js";import"./chunk-FPXL63KZ.js";import{h as _}from"./chunk-ZMO2ZQAS.js";import{a as M}from"./chunk-DNB3R4PI.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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sekyro/web",
3
- "version": "0.1.0-rc.17",
3
+ "version": "0.1.0-rc.18",
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.17",
101
- "bom-ref": "@sekyro/web@0.1.0-rc.17",
100
+ "version": "0.1.0-rc.18",
101
+ "bom-ref": "@sekyro/web@0.1.0-rc.18",
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.17?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.18?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.17|@mediapipe/tasks-vision@0.10.35",
153
+ "bom-ref": "@sekyro/web@0.1.0-rc.18|@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.17",
186
+ "ref": "@sekyro/web@0.1.0-rc.18",
187
187
  "dependsOn": [
188
- "@sekyro/web@0.1.0-rc.17|@mediapipe/tasks-vision@0.10.35"
188
+ "@sekyro/web@0.1.0-rc.18|@mediapipe/tasks-vision@0.10.35"
189
189
  ]
190
190
  },
191
191
  {
192
- "ref": "@sekyro/web@0.1.0-rc.17|@mediapipe/tasks-vision@0.10.35"
192
+ "ref": "@sekyro/web@0.1.0-rc.18|@mediapipe/tasks-vision@0.10.35"
193
193
  }
194
194
  ]
195
195
  }
@@ -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 O,y as Z}from"./chunk-J4NL62VQ.js";import{c as de,d as ue,e as le}from"./chunk-FPXL63KZ.js";import{c as F,g as $,h as be}from"./chunk-ULMH32G5.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 Fe=["carte_identite","passport","residence_permit"];function Ke(e,t){let i=e.byIssuer?.[t]??e.default;return Fe.filter(s=>i==="*"||i.includes(s))}function xt(e,t=_e){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(s=>Ke(e,s).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 Ze=640,Ye=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),Pe=6,ke=1500,Re={sharpness:1,exposure:1,meanLuma:128},Me=null;function je(e,t){try{Me??(Me=document.createElement("canvas"));let i=Me,s=96/Math.max(1,t.width);i.width=Math.max(1,Math.round(t.width*s)),i.height=Math.max(1,Math.round(t.height*s));let r=i.getContext("2d");if(r===null)return Re;r.drawImage(e,t.x,t.y,t.width,t.height,0,0,i.width,i.height);let c=r.getImageData(0,0,i.width,i.height);return{sharpness:ue(c),exposure:le(c),meanLuma:de(c)}}catch{return Re}}async function We(e,t){let i=e.source;return"convertToBlob"in i?i.convertToBlob({type:"image/jpeg",quality:t}):new Promise((s,r)=>{i.toBlob(c=>c===null?r(new Error("encode failed")):s(c),"image/jpeg",t)})}function Ht(e,t={}){let i=t.now??(()=>performance.now()),s=t.setTimer??((l,n)=>setTimeout(l,n)),r=t.clearTimer??(l=>clearTimeout(l)),c=t.encode??We,p=t.quality??je,d=e.tuningVersion??null,h=new Set,C=!1,b=e.video??null,S=null,y=t.grabFrame??null,k=null,A=1e3/Pe,R=null,E=null,L=!1,w=!1,I=Number.NEGATIVE_INFINITY,M=null,H=0,x=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&&(E=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"}),y??(y=o.defaultGrabber()),k=o.observe,A=1e3/Math.min(Pe,f.cadenceHz);let _=(t.createLandmarker??a.createFaceLandmarker)(e.assetBaseUrl??"/models-v3"),g=await new Promise((m,P)=>{let v=setTimeout(()=>{P(new Error("landmarker init timeout")),_.then(T=>T.close(),()=>{})},a.LANDMARKER_INIT_TIMEOUT_MS);_.then(T=>{clearTimeout(v),m(T)},T=>{clearTimeout(v),P(T)})});C?g.close():R=g}).catch(()=>{L=!0}),Y=l=>{for(let n of h)n({holding:w||L,update:l})},B=()=>{if(M=null,!(C||R===null||S===null||y===null||k===null||b===null)){if(i()-I>ke){Y(null);return}try{let l=y(b,Ze);if(l!==null){let n=Math.max(i(),H+1);H=n;let o=R.detect(l.source,n),a=b.videoWidth||l.width,u=b.videoHeight||l.height,f=k(o,l,a,u);f.geometry!==null&&E!==null&&(f.backgroundCheck=E.measure(l,f.geometry.box,a,u));let _=S.push(f,i());w=_.ready,Y(_)}}catch{}M=s(B,A)}},j=()=>{let l=i()-I>ke;I=i(),l&&(S?.reset(),w=!1,x=null,V=null),M===null&&R!==null&&!C&&(M=s(B,0))},J=()=>{let l=y===null||b===null?null:y(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 c(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 w||L?o:{...o,sharpness:0}},telemetry:l=>{if(l.type!=="fired"||C)return;x=J();let n=W;n!==null&&x.then(o=>o===null?void 0:n(o).catch(()=>{})),w=!1,M!==null&&r(M),M=null,I=Number.NEGATIVE_INFINITY}},decorate:l=>{let n=new WeakMap,o=new Map,a=g=>{let m=n.get(g);return m===void 0&&(m=(async()=>{let P=await ge(l,"image","image/jpeg",g.image.size,{engine:"portrait"});return await l.uploadToSpaces(P.uploadUrl,g.image,"image/jpeg"),(await l.completeMedia(P.key)).key})(),m.catch(()=>n.delete(g)),n.set(g,m)),m};W=a;let u=async g=>{let m;try{m=await a(g)}catch(P){let v=P?.code;if(typeof v=="string"&&Ye.has(v))throw P;return null}return{media:{portrait:m},gate:be(g.gate),...d!==null?{tuningVersion:d}:{}}},f=l.submitCheck.bind(l),_=(async(g,m,P)=>{if(g!=="liveness")return f(g,m,P);let v=P?.idempotencyKey,T=v===void 0?void 0:o.get(v);if(T===void 0){let ae=x;T=ae===null?Promise.resolve(null):ae.then(ce=>ce===null?null:u(ce)),v!==void 0&&(o.set(v,T),T.catch(()=>o.delete(v)))}let z=await T;if(z===null)return f("liveness",m,P);let Ue=await f("liveness",{...m,portraitIcao:z},P);return V=z,Ue});return new Proxy(l,{get(g,m){if(m==="submitCheck")return _;let P=Reflect.get(g,m);return typeof P=="function"?P.bind(g):P}})},onGate:l=>(h.add(l),()=>h.delete(l)),lastPortraitInput:()=>V,destroy:()=>{C=!0,x=null,V=null,M!==null&&r(M),M=null,h.clear(),D.then(()=>{R?.close(),R=null,E?.close(),E=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"}),Qe=new Map(Object.entries(ve)),Ft=new Map(Object.entries(ve).map(([e,t])=>[t,e]));function Te(e){return Qe.get(e)??e}var $e=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"],Ne={identity_method:te,contact:ne},Je=["population_registry","document"],xe="platform_unsupported",ze=new Set(["prefilled","user_entered","prefilled_or_entered"]),Xe={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 N(e){return e.section??Xe[e.checkType]??null}function ie(e,t){let i=e.plan?.choice;if(i===void 0||i.locked)return;let s=i.options.find(r=>r.id!==i.selected&&r.available!==!1&&t.includes(r.service));return s===void 0?void 0:{nodeId:i.nodeId,option:s}}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 s=Ne[i.kind]??[...te,...ne],r=i.options.flatMap(d=>d.available===!1||!s.includes(d.service)?[]:[d.nationalEid!=null?{id:d.id,service:d.service,nationalEid:d.nationalEid}:{id:d.id,service:d.service}]),c=t.steps.find(d=>d.id===t.current)?.service,p=i.selected??r.find(d=>d.service===c)?.id??null;return r.some(d=>d.id!==p)?{nodeId:i.nodeId,kind:i.kind,current:p,options:r}:null}function Le(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}function et(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 s=oe(e);return s!==null&&(i.switchable=s),i}function tt(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 Ve={phone_otp:"phone",email_otp:"email"};function nt(e,t){let i=ie(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return i===void 0?void 0:Ve[i.option.service]}function it(e,t,i,s){let r=t.checkType==="email_otp",c=(r?t.emailOtp:t.otp)??{},p=r?t.emailOtp?.emailSource:t.otp?.numberSource,d=p!==void 0&&ze.has(p)?p:r?"prefilled_or_entered":"user_entered",h=typeof c.sentToMasked=="string"&&c.sentToMasked.length>0,C=nt(e,r?"email_otp":"phone_otp"),b={key:t.checkType,context:i,section:N(t),phase:h?"verify":"send",canSwitch:C!==void 0,...s},S=r?{kind:"email_otp",...b,emailSource:d,needsEmail:d!=="prefilled"}:{kind:"phone_otp",...b,numberSource:d,needsPhone:d!=="prefilled",channels:(t.otp?.channels??[]).filter(y=>y==="whatsapp"||y==="sms")};if(C!==void 0&&(S.switchChannel=C),h&&(S.sentToMasked=c.sentToMasked),!r&&t.otp?.channel!==void 0&&(S.channel=t.otp.channel),!r&&Array.isArray(t.phoneCountries)&&(S.phoneCountries=t.phoneCountries.filter(y=>typeof y=="string"&&/^[A-Z]{2}$/.test(y))),!r&&Array.isArray(t.phoneRules)){let y=S.phoneCountries??[];S.phoneRules=t.phoneRules.flatMap(k=>{let A=st(k);return A!==void 0&&y.includes(A.code)?[A]:[]})}return!r&&t.phoneInternational===!0&&(S.phoneInternational=!0),c.expiresAt!==void 0&&(S.codeExpiresAt=c.expiresAt),c.resendAvailableAt!==void 0&&(S.resendAvailableAt=c.resendAvailableAt),S}var ot=/^[\d[\]\-|()?:^]{1,64}$/;function rt(e){try{return typeof e=="string"&&ot.test(e)&&new RegExp(e)!==null}catch{return!1}}var Oe=e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=15;function st(e){let{code:t,dial:i,trunk:s,lengths:r,formats:c}=e??{};if(typeof t!="string"||typeof i!="string"||!/^\d{1,3}$/.test(i)||s!==void 0&&(typeof s!="string"||!/^\d{1,3}$/.test(s))||!Array.isArray(r)||r.length===0||!r.every(Oe))return;let p={code:t,dial:i,lengths:[...r].sort((d,h)=>d-h)};if(s!==void 0&&(p.trunk=s),c!==void 0){if(!(Array.isArray(c)&&c.length<=8&&c.every(h=>rt(h?.leading)&&Array.isArray(h.groups)&&h.groups.every(Oe)&&r.includes(h.groups.reduce((C,b)=>C+b,0)))))return;p.formats=c.map(h=>({leading:h.leading,groups:[...h.groups]}))}return p}function at(e,t,i,s){let r=Ee(e)===!0?"bound":Ae(t)===!0?"document":"typed",c=r==="typed"&&t.state==="input_required"&&t.reason!==void 0&&Te(t.reason)==="id_number_recheck",p=Le(oe(e)),d=!s.attemptsExhausted&&p.length===1&&p[0]?.service==="document";return{kind:"registry",key:"registry",context:i,section:N(t),state:t.state==="input_required"?"input_required":"pending",source:r,recheck:c,canUseDocument:d,...s}}function ct(e,t,i,s){let r=[...t.acceptedSides??[]];return{kind:"document",key:"document",context:i,section:N(t),side:r.includes("recto")?"verso":"recto",acceptedSides:r,documents:Ce(e),...s}}function dt(e){let t=Q(e,"liveness");return t?.state==="passed"||t?.state==="review"}function we(e,t,i,s,r){let c=t.icao?.report;return{kind:"portrait",key:`portrait:${r}`,context:i,section:N(t),phase:r,report:Array.isArray(c)?c:null,review:t.state==="review",tuning:e.capture?.icao??null,tuningVersion:e.capture?.tuningVersion??null,icao:$(e),retakeOnly:r==="capture"&&t.state==="input_required"&&e.capture?.livePhoto?.oneCapture===!0&&dt(e),...s}}var ee={minLongSidePx:1280,jpegQuality:.95};function ut(e,t){let i=e.capture?.livePhoto;if(i?.oneCapture!==!0)return null;let s=Q(e,"portrait_icao"),r=i.still??ee;return{icao:t==="liveness"&&$(e)!==null&&s!==void 0&&s.state==="pending"&&s.reason===void 0,still:{minLongSidePx:r.minLongSidePx??ee.minLongSidePx,jpegQuality:r.jpegQuality??ee.jpegQuality}}}function lt(e,t,i,s){let r=t.eid,c=N(t);if(r===void 0||r.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:i,section:c,checkType:"eid_auth",reason:"update_required"};let p=Le(oe(e)),d=p.length===1&&Je.includes(p[0]?.service??"")?p[0]:void 0,h=d===void 0?void 0:K[d.service],C=h!==void 0,b={kind:"eid",key:"eid",context:i,section:c,provider:r.provider,providerName:r.providerName,country:r.country,challenge:"app_code",phase:r.awaiting==="code"?"code":"identifier",identifierBound:r.identifierBound===!0,canUseCamera:C,afterPass:r.afterPass==="continue"?"continue":"end",...s};return C&&(b.cameraMethod=h),r.expiresAt!==void 0&&(b.codeExpiresAt=r.expiresAt),r.resendAvailableAt!==void 0&&(b.resendAvailableAt=r.resendAvailableAt),r.resendsRemaining!==void 0&&(b.resendsRemaining=r.resendsRemaining),r.codeAttemptsRemaining!==void 0&&(b.codeAttemptsRemaining=r.codeAttemptsRemaining),b}function pt(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 mt(e){return pe(e).filter(t=>t.state==="failed").pop()?.attemptsExhausted===!0}function ft(e,t){let i=e.failureReason,s;i===xe?s="platform_unsupported":e.status==="expired"?s="expired":e.status==="review_pending"?s="review":e.status==="completed"&&e.outcome==="approved"?s="approved":e.status==="completed"&&e.outcome==="review"?s="review":i==="device_cooldown"?s="cooldown":i!==void 0?s="policy_stop":mt(e)?s="attempts_exhausted":s="rejected";let r=s==="platform_unsupported"?{sessionId:e.sessionId,status:"unavailable"}:Se(e,{autoRetry:!1}),c={kind:"result",key:"result",context:t,section:null,display:s,result:r};return i!==void 0&&(c.failureReason=i),e.retryAfter!==void 0&&(c.retryAfter=e.retryAfter),c}function ht(e,t,i){let s=e.identitySummary;if(s==null)return null;let r={kind:"identity_summary",key:"identity_summary",context:t,section:i??"identity",summaryKind:s.kind==="partial"?"partial":s.kind??"full",source:s.source,portraitAvailable:s.portrait?.available===!0,retakeAvailable:s.retakeAvailable===!0};for(let p of St){let d=s[p];typeof d=="string"&&d!==""&&(r[p]=d)}let c=Ie(s);return c!==void 0&&(r.idNumberMasked=c,r.nniMasked=c),r}var St=["fullName","birthDate","birthYear","nationality","documentType","documentNumberMasked","expiryDate","retakeTarget"];function G(e,t,i,s){return{kind:"unsupported",key:`unsupported:${i}`,context:e,section:t,checkType:i,reason:s}}function gt(e){return e.kind==="contact"?"contact":(e.kind==="identity_method","identity")}function yt(e,t){let i=Ne[e.kind]??[...te,...ne],s=gt(e),r=e.options.flatMap(p=>{if(p.available===!1||!i.includes(p.service))return[];let d={id:p.id,service:p.service};return p.nationalEid!=null&&(d.nationalEid=p.nationalEid),[d]});if(r.length===0){let p=e.options.length>0&&e.options.every(d=>d.service==="nfc");return G(t,s,"choice",p?"platform_unsupported":"update_required")}let c={nodeId:e.nodeId,kind:e.kind,selected:e.selected,options:r};if(e.kind==="identity_method"){let p={kind:"method",key:"method",context:t,section:s,options:r.map(h=>K[h.service]),choice:c},d=r.find(h=>h.nationalEid!==void 0)?.nationalEid;return d!==void 0&&(p.nationalEid=d),p}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:s,options:r.map(p=>Ve[p.service]),selected:null,locked:!1,choice:c}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:s,choice:c}}function q(e,t={}){let i=et(e);if(X(e)||e.failureReason===xe)return ft(e,i);let s=e.plan;if(s===void 0||!Array.isArray(s.sections))return G(i,null,"plan","update_required");let r=fe(e);if(r!==null)return yt(r,i);let c=s.current===null?void 0:s.steps.find(S=>S.id===s.current),p=S=>{let y={kind:"processing",key:"processing",context:i,section:S!==void 0?N(S):s.sections.find(k=>k.state==="current")?.id??null,stalled:!1};return typeof S?.service=="string"&&S.service!==""&&(y.service=S.service),y};if(s.current===null)return p(s.steps.find(S=>S.state==="processing"));if(c===void 0)return G(i,null,"step","update_required");if(!$e.has(c.service))return c.interaction==="server"?p(c):G(i,N(c),c.service,"update_required");if(qe.has(c.service)||!he(c))return p(c);let d=c,h=tt(d),C=d.checkType,b=N(d);switch(C){case"phone_otp":case"email_otp":return it(e,d,i,h);case"population_registry":return at(e,d,i,h);case"eid_auth":return lt(e,d,i,h);case"doc_ocr":return ct(e,d,i,h);case"identity_confirm":return ht(e,i,b)??p(d);case"portrait_icao":return we(e,d,i,h,"capture");case"liveness":case"face_match":{let S=pt(e,d);if(S!==null)return we(e,S,i,h,"match");let y=d.requiresMobile===!0,k=$(e);return y&&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:y,instructions:k===null?"standard":"icao",icao:k,livePhoto:ut(e,C),...h}}case"nfc_chip":return G(i,b,C,"platform_unsupported");default:return G(i,b,C,"update_required")}}var bt=/^[A-Z0-9][A-Z0-9 -]{0,39}$/,_t=Object.freeze({normalize:e=>e.trim().toUpperCase().replace(/\s+/g," "),check:e=>bt.test(e),registrySources:Object.freeze([]),describe:"number must be 1 to 40 letters, digits, spaces or hyphens"});function Ct(e){return typeof e=="string"&&/^\d{10}$/.test(e)&&Number(e)%97===1}var Pt=Object.freeze({normalize:e=>e.trim(),check:e=>Ct(e),registrySources:Object.freeze(["MR.anrpts"]),describe:"number must be the 10-digit Mauritanian national ID number with a valid check digit"}),kt=Object.freeze({"MR:national_id":Pt});function re(e,t){return kt[`${e.toUpperCase()}:${t}`]??_t}var Rt=Object.freeze({MRT:"MR"});function De(e,t){let i=e.trim().toUpperCase();return re(Rt[i]??i,t)}function Ge(e){let t=De(e.issuingCountry,e.type);return t.check(t.normalize(e.number))}function He(e){return re("MR","national_id").check(e)}function se(e){let t="";for(let i of e){let s=i.codePointAt(0)??0;s>=1632&&s<=1641?t+=String(s-1632):s>=1776&&s<=1785?t+=String(s-1776):i!==" "&&i!=="-"&&i!==" "&&(t+=i)}return t}var Mt=[1e3,2e3,4e3,8e3,15e3],Et=3e4,At=/^\+[1-9]\d{6,14}$/,It=/^\d{6}$/,vt=/^\d{6}$/,Tt=/^[^\s@]+@[^\s@]+\.[^\s@]+$/,Be=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"]),Ot=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]);function sn(e){let t=!1,i=null,s="",r=!1,c=!1,p=!1,d={},h={},C=new Set,b=!1,S=null,y="idle",k=new Map,A=new Map,R=(n,o,a)=>{let u=`${n}.${o}`,f=k.get(u);if(f!==void 0)return f;let _=A.get(n),g=(_===void 0?a():_.then(a)).finally(()=>{k.delete(u)});k.set(u,g);let m=g.then(()=>{},()=>{});return A.set(n,m),m.then(()=>{A.get(n)===m&&A.delete(n)}),g},E=async(n,o,a)=>{await e.ensureConsent();let u;try{u=await ye(e.runtime,o)}catch(_){if(_ instanceof F&&Be.has(_.code)){await e.refreshView();return}throw _}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&&Be.has(a.code)){await e.refreshView();return}throw a}e.destroyed()||(o!==void 0&&e.setView!==void 0?e.setView(o):await e.refreshView())},w=(n,o)=>R("choice",`${n}:${o}`,()=>L(a=>a.choose(n,o))),I=(n,o)=>n.options.some(a=>a.id===o)?w(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`)):w(u.nodeId,u.option.id)},H=n=>R("identity",n,()=>L(o=>o.confirmIdentity===void 0?Promise.reject(new Error("identity confirmation is not available in this build")):o.confirmIdentity(n))),x=(n,o)=>{let a=n.kind,u=a==="phone_otp",f=u?"phone":"email",_={action:"send"};if(u?n.needsPhone:n.needsEmail){let g=o[f]??h[a],m=u?g?.replace(/[\s().-]/g,""):g?.trim();if(m===void 0||!(u?At:Tt).test(m))return Promise.reject(u?new O("phone","format"):new Z("email","format"));_[f]=m}if(u){let g=n.channels,m=o.channel??(g.length===1?g[0]:void 0);if(g.length>0){if(m===void 0)return Promise.reject(new Z("channel","required"));if(!g.includes(m))return Promise.reject(new Z("channel","unavailable"))}m!==void 0&&(_.channel=m),_.phoneRules=1}return R(a,"send",()=>E(a,(g,m)=>g.submitCheck(a,_,{idempotencyKey:m}),()=>{d[a]=e.now(),_[f]!==void 0&&(h[a]=_[f])}))},V=(n,o)=>It.test(o)?R(n,"verify",()=>E(n,(a,u)=>a.submitCheck(n,{action:"verify",code:o},{idempotencyKey:u}))):Promise.reject(new O("code","format")),D=(n,o)=>R("eid_auth",n,()=>E("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 O("nni","format"));if(!He(a))return Promise.reject(new O("nni","check_digit"))}else if(a==="")return Promise.reject(new O("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)?Ge({type:"national_id",issuingCountry:"MR",number:u})?R("population_registry","submitIdNumber",()=>E("population_registry",(f,_)=>f.submitCheck("population_registry",{idNumber:u,nni:u},{idempotencyKey:_}),()=>{S=`\u2022\u2022\u2022\u2022\u2022\u2022${u.slice(-4)}`})):Promise.reject(new O(a,"check_digit")):Promise.reject(new O(a,"format"))},j=n=>{switch(n.kind){case"phone_otp":case"email_otp":{let o={...n,send:(u={})=>x(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=d[n.kind];return o.resendAvailableAt===void 0&&a!==void 0&&(o.resendAvailableAt=new Date(a+Et).toISOString()),o}case"eid":return{...n,start:o=>Y(n,o),verify:o=>vt.test(o)?D("verify",{action:"verify",code:o}):Promise.reject(new O("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?I(n.choice,a.id):Promise.reject(new RangeError(`method ${String(o)} is not offered`))},choose:o=>I(n.choice,o)};case"choice":return{...n,choose:o=>I(n.choice,o)};case"registry":return{...n,submitIdNumber:o=>B(n,o,"idNumber"),submitNni:o=>B(n,o,"nni"),confirm:()=>R("population_registry","confirm",()=>E("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?I(n.choice,u.id):Promise.reject(new RangeError(`contact ${String(o)} is not offered`))},choose:o=>I(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()=>{r=!1,await e.refreshView()}};case"unsupported":case"result":return{...n};default:{let o=n;throw new Error(`runner: unhandled step ${JSON.stringify(o)}`)}}},J=async()=>{if(!c){c=!0;try{for(let n of Mt){if(await e.sleep(n),!t||e.destroyed())return;let o=await e.refreshView().catch(()=>null);if(o!==null&&q(o,{isMobile:e.isMobile()}).kind!=="processing")return}r=!0,l()}finally{c=!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(y==="inflight")return o;if(!b||y==="done")return null;let a=e.keptFaceKey?.()??null;return a===null?null:(y="inflight",E("face_match",(u,f)=>u.submitCheck("face_match",{imageKey:a},{idempotencyKey:f}),()=>{y="done"}).then(()=>{y==="inflight"&&(y="done",l())},()=>{y="done",l()}),o)},U=(n,o=!1)=>{if(!t||e.destroyed()||e.chainBusy())return;let a=q(n,{isMobile:e.isMobile()});a.kind==="registry"&&a.recheck&&(b=!0,y="idle"),a=W(a)??a,a.kind==="processing"?a.stalled=r:r=!1;let u=j(a),f=a.kind==="result"?void 0:a.context.switchable,_=f===void 0?u:{...u,chooseOption:m=>I({nodeId:f.nodeId,kind:f.kind,selected:f.current,options:f.options},m)},g=JSON.stringify(_);a.kind==="registry"&&a.source==="document"&&a.state==="pending"&&!C.has("registry")&&(C.add("registry"),_.confirm().catch(m=>{(!(m instanceof F)||Ot.has(m.code))&&C.delete("registry")})),!(!o&&g===s)&&(s=g,i=_,e.emitStep(_),a.kind==="processing"&&!r&&y!=="inflight"&&J(),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(q(n,{isMobile:e.isMobile()}))},current:()=>i,onView:n=>U(n),onChainIdle:()=>{let n=e.currentView();n!==null&&U(n)},republish:l,submit:E}}export{Ke as a,xt as b,Pe as c,ke as d,Ht as e,q as f,Mt as g,Et as h,sn as i};
@@ -1 +0,0 @@
1
- import{c as C,d as V}from"./chunk-ULMH32G5.js";var M=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"}),A=new Map(Object.entries(M)),Y=new Map(Object.entries(M).map(([e,n])=>[n,e]));function ge(e){return A.get(e)??e}function j(e){let n=A.get(e)??Y.get(e);return n===void 0?[e]:[e,n]}function H(e){let n=[];for(let t of e)for(let i of j(t))n.includes(i)||n.push(i);return n}var B=new Set(H(["no_face","media_unreadable","clip_too_short","no_face_source","side_missing","unreadable","registry_unavailable","otp_mismatch","otp_expired","otp_send_failed","document_type_not_accepted","age_unverifiable","nationality_unreadable","liveness_inconclusive","match_inconclusive","document_authenticity","probe_not_from_liveness","capture_back_camera","capture_not_upright","chip_read_failed","chip_access_denied","chip_parse_failed","icao_pose","icao_eyes","icao_mouth","icao_occlusion","icao_lighting","icao_background","icao_resolution","portrait_not_from_liveness","nni_recheck","device_integrity_failed","eid_identifier_invalid","eid_code_invalid","eid_code_expired","eid_unavailable","eid_resend_too_soon"])),z={document:"document_photo",nfc:"document_chip",population_registry:"national_number",national_eid:"national_eid"};function f(e){return e.plan?.steps??[]}function T(e){return Math.max(0,e.attempts.max-e.attempts.used)}function $(e){let n=e.plan?.choice;return n!==void 0&&e.plan?.current===n.nodeId?n:null}function be(e){let n=$(e);if(n?.kind!=="identity_method")return null;let t=n.options.map(o=>z[o.service]).filter(o=>o!==void 0),i=n.options.find(o=>o.nationalEid)?.nationalEid;return i?{available:!0,selected:null,options:t,nationalEid:i}:{available:!0,selected:null,options:t}}var W=new Set(["liveness","face_match"]);function v(e){return e!==void 0&&(e.state==="pending"||e.state==="input_required")}function O(e){return e.status!=="created"&&e.status!=="in_progress"}function E(e){let n=e.plan?.current,t=n==null?void 0:f(e).find(i=>i.id===n);return v(t)?t:void 0}function g(e,n){return f(e).find(t=>t.checkType===n)}function y(e){let n=f(e),t=n.findIndex(i=>i.checkType==="liveness");return n.find((i,o)=>o>t&&i.checkType==="face_match")}function L(e,n){let t=g(n,"liveness")?.state,i=y(n)?.state;return(y(e)?.state??"pending")==="pending"&&(t==="passed"||t==="review")&&i!==void 0&&i!=="pending"&&i!=="skipped"}function x(e,n){let t=new Map(f(e).map(i=>[i.id,i.state]));return f(n).filter(i=>i.checkType==="face_match"&&(t.get(i.id)??"pending")==="pending"&&i.state!=="pending"&&i.state!=="skipped").map(i=>i.id)}function b(e,n){return n===void 0?{sessionId:e,status:"unavailable"}:{sessionId:e,status:"unavailable",reason:n}}function _(e,n,t){return t===void 0?{sessionId:e,status:n}:{sessionId:e,status:n,reason:t}}function we(e,n){let{sessionId:t}=e;switch(e.status){case"completed":case"failed":case"review_pending":return G(e,J(e));case"expired":return b(t);case"created":case"in_progress":break;default:{let i=e.status;throw new Error(`mapSessionResult: unhandled status ${i}`)}}return Z(e,n)}var X=new Set([0,1,2,3]);function G(e,n){return X.has(e.level)&&(n.level=e.level),typeof e.assurance=="string"&&e.assurance.length>0&&(n.assurance=e.assurance),typeof e.subjectId=="string"&&e.subjectId.length>0&&(n.subjectId=e.subjectId),n}function J(e){let{sessionId:n}=e;switch(e.status){case"completed":return e.outcome==="approved"?{sessionId:n,status:"approved"}:e.outcome==="review"?_(n,"review",h(e,"review")):_(n,"rejected",h(e,"failed"));case"failed":{let t=_(n,"rejected",e.failureReason??h(e,"failed"));return e.failureReason==="device_cooldown"&&e.retryAfter!==void 0&&(t.retryAfter=e.retryAfter),t}default:return _(n,"review",h(e,"review"))}}function Q(e,n){if(n===void 0)return!1;let t=f(n).find(i=>i.id===e.id);return t!==void 0&&t.attempts.used===e.attempts.used}function Z(e,n){let{sessionId:t}=e,i=f(e).find(s=>W.has(s.checkType)&&s.state==="input_required"&&s.reason!==void 0);if(i?.reason==="mobile_required")return b(t,"mobile_required");if(i?.reason!==void 0){let s=n.autoRetry&&T(i)>0&&(B.has(i.reason)||Q(i,n.previous)),c={sessionId:t,status:s?"retry":"rejected",reason:i.reason,attemptsRemaining:T(i)};return i.retakeHint!==void 0&&(c.retakeHint=i.retakeHint),c}let o=E(e);return o===void 0&&f(e).some(s=>s.state==="review")?_(t,"review",h(e,"review")):o?.checkType==="portrait_icao"?b(t,"portrait_required"):b(t)}function h(e,n){let t=f(e).filter(i=>i.state===n&&i.reason!==void 0);return t[n==="failed"?t.length-1:0]?.reason}function N(e,n,t,i,o){return e.presignCapture!==void 0?e.presignCapture(n,t,i,o):e.presign(n,t,i)}function F(e){return{engine:e?.engine,durationMs:e?.clipMs}}var ee=["video/webm","video/mp4"],I="image/jpeg",ne=2,te=1e3,ie=1e4,oe=3,se=10,re=30,ae=3,ce=new Set(["network_error","timeout","upload_failed","unknown_error","rate_limit_exceeded"]),de=new Set(["session_not_active","check_not_found","check_already_finalized","check_out_of_order","identity_confirm_required","check_not_active","step_not_on_path"]),S=class extends Error{constructor(){super("verification destroyed"),this.name="FlowCancelledError"}};function ue(e){let n=y(e);return g(e,"portrait_icao")?.state!=="pending"&&(n!==void 0?v(n):e.capture?.livePhoto?.oneCapture===!0)}var R=class extends Error{constructor(n){super(n),this.name="AttestationError"}};async function K(e,n,t={}){let i=e.uuid(),o=!1,s=!1,c=0,d=0;for(;;)try{return await n(e.client,i)}catch(r){if(r instanceof R){if(s)throw r;s=!0,t.onAttestationInvalid?.(),i=e.uuid();continue}if(!(r instanceof C))throw r;if(r.code==="consent_required"&&!o){o=!0,await e.ensureConsent({force:!0}),i=e.uuid();continue}if(r.code==="attestation_invalid"&&!s){s=!0,t.onAttestationInvalid?.(),i=e.uuid();continue}if(r.code==="inference_unavailable"&&d<oe){d+=1;let a=Math.min(r.retryAfterSeconds??se,re);e.onBusy?.({attempt:d,retryAfterSeconds:a}),await e.sleep(a*1e3),t.onAttestationInvalid?.(),i=e.uuid();continue}if(ce.has(r.code)&&c<ne){c+=1;let a=r.retryAfterSeconds!==void 0?r.retryAfterSeconds*1e3:void 0;await e.sleep(a!==void 0?Math.min(a,ie):te);continue}throw r}}var le=new Set(["passed","review","processing","skipped"]);async function xe(e){let{artifacts:n}=e,t=n.clip,i=V(n.clipMime??"");if(n.degraded==="NO_RECORDER"||t===void 0||!ee.includes(i))return{kind:"unavailable",reason:"no_recorder"};e.client.armCapture?.(2);let o=fe(e,n.keyframe),s=pe(e,t,i,o),c=me(e,o),d=!1,r=new Set,a=!0,m=0;for(;;){if(e.isCancelled())return{kind:"cancelled"};let l=e.getView();if(O(l))return{kind:"settled"};let w=E(l),P=w?.checkType,k=P==="liveness"&&!d?"liveness":P==="face_match"&&!r.has(w?.id)&&r.size<2&&a?"face_match":null;if(k===null)return{kind:"settled"};if(k==="liveness"&&n.captureChannel==="desktop"&&g(l,"liveness")?.requiresMobile===!0)return{kind:"unavailable",reason:"mobile_required"};try{if(k==="liveness"){d=!0;let u=await s();if(e.isCancelled())return{kind:"cancelled"};L(l,u)&&r.add(y(u)?.id);for(let U of x(l,u))r.add(U);await e.applySubmit(u,"liveness");let p=g(e.getView(),"liveness")?.state;a=p===void 0||le.has(p)}else{r.add(w?.id);let u=await c();if(e.isCancelled())return{kind:"cancelled"};for(let p of x(l,u))r.add(p);await e.applySubmit(u,"face_match")}}catch(u){if(e.isCancelled()||u instanceof S)return{kind:"cancelled"};let p=ye(u);if(p.kind!=="resync"||m>=ae)return p;m+=1,await e.refreshView()}}}function fe(e,n){let t=null,i=null,o=()=>t!==null?Promise.resolve(t):(i??(i=(async()=>{let s=await N(e.client,"image",I,n.size,F(e.artifacts));return await e.client.uploadToSpaces(s.uploadUrl,n,I),t=(await e.client.completeMedia(s.key)).key,e.onKeyframePromoted?.(t),t})().finally(()=>{i=null})),i);return{ensure:o,attempt:()=>o().catch(()=>null),current:()=>t}}function pe(e,n,t,i){let o=null,s,c=null;return()=>K(e,async(d,r)=>{if(o===null||s===void 0){if(e.isCancelled())throw new S;s===void 0&&!ue(e.getView())&&(s=null),e.onPhase("uploading");let[a,m]=await Promise.all([o!==null?Promise.resolve(o):(async()=>{let l=await N(d,"clip",t,n.size,F(e.artifacts));return await d.uploadToSpaces(l.uploadUrl,n,t),(await d.completeMedia(l.key)).key})(),s!==void 0?Promise.resolve(s===null?null:s.imageKey):i.attempt()]);o=a,s===void 0&&(s=m===null?null:{imageKey:m})}if(c===null)try{c=await e.getAttestation()}catch(a){throw new R(a instanceof Error?a.message:String(a))}return e.onPhase("checking"),d.submitCheck("liveness",{clipKey:o,attestation:c,captureChannel:e.artifacts.captureChannel,capture:_e(e.artifacts),...s!==null?{faceMatch:s}:{}},{idempotencyKey:r})},{onAttestationInvalid:()=>{c=null}})}function me(e,n){return()=>K(e,async(t,i)=>{if(n.current()===null){if(e.isCancelled())throw new S;e.onPhase("uploading")}let o=await n.ensure();return e.onPhase("checking"),t.submitCheck("face_match",{imageKey:o},{idempotencyKey:i})})}function _e(e){let n={width:e.width,height:e.height};for(let t of he)e[t]!==void 0&&(n[t]=e[t]);return n}var he=["engine","facingMode","mode","formFactor","clipMs","cameraReadyMs","faceAcquireMs","captureMs","screenRamp","provenance"];function ye(e){if(e instanceof R)return{kind:"unavailable",reason:"attestation"};if(e instanceof C){if(e.code==="attestation_invalid")return{kind:"unavailable",reason:"attestation"};if(e.code==="inference_unavailable")return{kind:"unavailable",reason:"inference_unavailable"};if(e.code==="mobile_required")return{kind:"unavailable",reason:"mobile_required"};if(de.has(e.code))return{kind:"resync"}}return{kind:"unavailable",reason:"network"}}var q=class extends Error{constructor(n,t){super(`invalid ${n} (${t})`),this.name="InvalidInputError",this.field=n,this.kind=t}},D=class extends Error{constructor(n,t){super(`invalid ${n} (${t})`),this.name="OtpInputError",this.field=n,this.kind=t}};function Me(e){let n=e?.capture;return n?.mode==="assisted"||n?.mode==="self"?n.mode:n?.cameraSwitch===!0?"assisted":"self"}export{Me as a,ge as b,B as c,z as d,f as e,T as f,$ as g,be as h,v as i,O as j,E as k,g as l,b as m,we as n,N as o,ee as p,ne as q,te as r,oe as s,se as t,R as u,K as v,xe as w,q as x,D as y};
@@ -1 +0,0 @@
1
- import{a as X,b as ke,d as V,e as L,f as U,g as Pe,h as E,i as B,j as P,k as F,l as x,m as w,n as D,v as be,w as xe}from"./chunk-J4NL62VQ.js";import{m as Ce}from"./chunk-SDWHJJ4W.js";import{a as ge}from"./chunk-GT2ZLGF7.js";import{d as Q}from"./chunk-FUHDOEBP.js";import{c as j,f as _e,g as G}from"./chunk-ULMH32G5.js";function K(e){return e.idNumberBound??e.nniBound}function H(e){return e===void 0?void 0:e.idNumberFromDocument??e.nniFromDocument}function Re(e){let t=e.idNumberMasked??e.nniMasked;return typeof t=="string"&&t!==""?t:void 0}var We="https://api.sekyro.ai",$e=5e3,Je=1500,Qe=10;function je(e){return new Promise(t=>setTimeout(t,e))}function Xe(){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 Nt(e){return ze(e,{})}function ze(e,t){let i=e.apiOrigin??We,o=e.autoRetry??!0,r=e.rearm??"auto",s=t.client??new _e({apiOrigin:i,sessionToken:e.clientToken,fetch:e.fetch}),u=t.sleep??je,a=t.uuid??Xe,l=t.getTurnstileToken??((n,c)=>import("./turnstile-FATNZ4AG.js").then(p=>p.executeTurnstile(n,c))),S=ge(),h=null,m=null,d=!1,b=new AbortController,f=null,q=null,R=n=>{f=n,S.emit("view",n),h?.onView(n)},_=()=>f!==null?Promise.resolve(f):(q??(q=s.getSession().then(n=>(R(n),n)).finally(()=>{q=null})),q),v=async()=>{let n=await s.getSession();return R(n),n},Y=async(n,c)=>{n.plan!==void 0?R(n):await v()},Z=null,ie=async n=>{let c=await _();if(!n&&c.consentRecorded)return;let p=await s.recordConsent(e.locale);p.plan!==void 0?R(p):f!==null&&R({...f,consentRecorded:!0})},O=n=>n?.force===!0?ie(!0):(Z??(Z=ie(!1).finally(()=>{Z=null})),Z),W={client:s,ensureConsent:n=>O(n),sleep:u,uuid:a,onBusy:n=>{d||S.emit("busy",n)}},oe=!1,re=null,$=n=>{if(n.status==="approved"||n.status==="rejected"||n.status==="review"){if(oe)return;oe=!0}re=JSON.stringify(n),S.emit("result",n)},Ve=n=>{re!==JSON.stringify(n)&&$(n)},se=async n=>{let c=f;n&&(c=await v().catch(()=>f));let p=c===null?null:E(c);return p!==null&&!d&&S.emit("method",p),p!==null},ae=null,ce=!1,ue=!1,de=()=>be(W,(n,c)=>n.submitCheck("population_registry",{},{idempotencyKey:c})),le=n=>K(n)===!0||H(x(n,"population_registry"))===!0,De=async()=>{try{let n=await _();if(P(n)||E(n)!==null||F(n)?.checkType!=="population_registry")return;if(!le(n)&&H(x(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:x(f,"population_registry");if(c?.state==="input_required"&&c.reason==="registry_unavailable"&&U(c)>0){if(await u($e),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&&P(f)&&$(D(f,{autoRetry:o}))},pe=()=>(ae??(ae=De()),ae),He=async()=>{let c=(await _()).turnstileSiteKey;return c===null?{sandbox:!0}:{channel:"hosted_web",siteKey:c,turnstileToken:await l(c,{signal:b.signal})}},k=null,fe=Promise.resolve(),T=0,Ne=async()=>{let n=await _();for(let c=0;c<Qe&&!d&&!P(n)&&F(n)===void 0&&L(n).some(p=>p.state==="processing")&&(await u(Je),!d);c+=1)n=await v();return n},Le=async(n,c,p)=>{let{capture:g}=n,C=()=>d,N=()=>n.alive&&n.attempt===p,Se=y=>{N()&&g.setFlowState(y)},I=y=>{if(!C()&&($(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??"";I(w(y,"no_recorder"));return}Se("uploading");try{if(await pe(),C())return;let y=await _(),ye;if(!P(y)&&E(y)!==null){await se(!1),I(w(y.sessionId,"method_required"));return}if(!P(y)){if(F(y)?.checkType==="population_registry"){I(w(y.sessionId,ue?"nni_unbound":ce?"network":"registry_unavailable"));return}if(await O(),C())return;ye=f??y;let J=await xe({...W,artifacts:c,getAttestation:He,getView:()=>f??y,refreshView:v,applySubmit:Y,onPhase:Se,isCancelled:C,onKeyframePromoted:Ze=>{m=Ze}});if(C())return;if(J.kind==="unavailable"){I(w(y.sessionId,J.reason));return}if(J.kind==="resync"&&await v(),f!==null&&E(f)!==null){await se(!1),I(w(y.sessionId,"method_required"));return}y=await Ne()}I(D(y,{autoRetry:o,previous:ye}))}catch{if(C())return;I(w(f?.sessionId??"","network"))}},Ue=(n,c)=>{let p=n.attempt;T>0&&n.alive&&n.capture.setFlowState("uploading"),T+=1,fe=fe.then(()=>Le(n,c,p)).finally(()=>{T-=1,T===0&&h?.onChainIdle()}).catch(()=>{})},me=n=>{k?.capture.handle.destroy(),k!==null&&(k.alive=!1);let c=Ce(n,h?.captureInternals?.(n)??t.capture,()=>f?.capture?.liveness?.keyframe?.rank===!0,()=>X(f),()=>f?.capture?.liveness?.screenRamp),p={capture:c,alive:!0,attempt:0};k=p,c.handle.on("state",C=>{C==="starting"&&(p.attempt+=1)}),c.handle.on("captured",C=>{Promise.resolve().then(()=>Ue(p,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(()=>{}),!!p.alive)return g.start(C)},retry:()=>g.retry(),switchCamera:()=>g.switchCamera(),destroy:()=>{p.alive=!1,k===p&&(k=null),g.destroy()}}},Be=async()=>{if(d)return null;try{let n=await _();return d?null:E(n)}catch{return null}},Fe=async()=>{if(d)return"self";try{let n=await _();return d?"self":X(n)}catch{return"self"}},Ge=async()=>{if(d)return!1;try{let n=await _();if(d||P(n))return!1;let c=x(n,"liveness");return B(c)&&c?.requiresMobile===!0&&!Q()}catch{return!1}},Ke=async()=>{if(d)return!1;try{let n=await _();return!d&&n.returning===!0}catch{return!1}},qe=async n=>{let c=(await _()).plan?.choice,p=c?.options.find(C=>V[C.service]===n);if(!p)throw new RangeError(`method ${String(n)} is not offered`);let g=await s.choose(c.nodeId,p.id);d||R(g)},he=null,Ye=()=>(he??(he=import("./plan-runner-WRY4FOWW.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:Q,now:t.now??Date.now,keptFaceKey:()=>m,setView:R,baseCapture:t.capture,emitStep:p=>{d||S.emit("step",p)},emitResult:Ve,documentInternals:t.document,portraitInternals:t.portrait,livePhotoInternals:t.livePhoto});return h=c,c})),he);return{consent:()=>O(),startRegistry:pe,methodChoice:Be,selectMethod:qe,reportCameraUnavailable:async n=>{await O();let c=s.reportCameraUnavailable;if(c===void 0)throw new TypeError("this client cannot report a missing camera");let p=await c.call(s,n).catch(g=>{if(g instanceof j&&g.code==="check_out_of_order")return s.getSession();throw g});d||R(p)},mobileRequired:Ge,captureMode:Fe,returning:Ke,liveness:me,run:async()=>{if(d)throw new Error("verification destroyed");return(await Ye()).run()},currentStep:()=>h?.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,b.abort(),h?.destroy(),k!==null&&(k.alive=!1,k.capture.handle.destroy(),k=null),S.clear()}}}var ve=["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 et=["carte_identite","passport","residence_permit"];function tt(e,t){let i=e.byIssuer?.[t]??e.default;return et.filter(o=>i==="*"||i.includes(o))}function Ft(e,t=ve){return[...new Set([...t,...Object.keys(e.byIssuer??{})])].filter(o=>tt(e,o).length>0).sort()}function Ae(e){if(e.acceptedDocuments)return e.acceptedDocuments;let t=e.acceptedDocumentTypes?.length?[...e.acceptedDocumentTypes]:["carte_identite","passport"];return{default:[],byIssuer:{MR:t}}}function Gt(e){return/^[A-Z]{2}$/.test(e)?String.fromCodePoint(...[...e].map(t=>127462+t.charCodeAt(0)-65)):""}var Jt=["national_number","document_photo","national_eid"],nt=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"]),it=new Set(["supplied_identity","aml_screening","face_dedup","age_estimation"]),ee=["document","population_registry","national_eid"],te=["phone_otp","email_otp"],Oe={identity_method:ee,contact:te},ot=["population_registry","document"],Ee="platform_unsupported",rt=new Set(["prefilled","user_entered","prefilled_or_entered"]),st={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 A(e){return e.section??st[e.checkType]??null}function at(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||P(e))return null;let o=Oe[i.kind]??[...ee,...te],r=i.options.flatMap(a=>a.available===!1||!o.includes(a.service)?[]:[a.nationalEid!=null?{id:a.id,service:a.service,nationalEid:a.nationalEid}:{id:a.id,service:a.service}]),s=t.steps.find(a=>a.id===t.current)?.service,u=i.selected??r.find(a=>a.service===s)?.id??null;return r.some(a=>a.id!==u)?{nodeId:i.nodeId,kind:i.kind,current:u,options:r}:null}function Me(e){return e==null?[]:e.options.filter(t=>t.id!==e.current)}function ct(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 ut(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 Te={phone_otp:"phone",email_otp:"email"};function dt(e,t){let i=at(e,[t==="phone_otp"?"email_otp":"phone_otp"]);return i===void 0?void 0:Te[i.option.service]}function lt(e,t,i,o){let r=t.checkType==="email_otp",s=(r?t.emailOtp:t.otp)??{},u=r?t.emailOtp?.emailSource:t.otp?.numberSource,a=u!==void 0&&rt.has(u)?u:r?"prefilled_or_entered":"user_entered",l=typeof s.sentToMasked=="string"&&s.sentToMasked.length>0,S=dt(e,r?"email_otp":"phone_otp"),h={key:t.checkType,context:i,section:A(t),phase:l?"verify":"send",canSwitch:S!==void 0,...o},m=r?{kind:"email_otp",...h,emailSource:a,needsEmail:a!=="prefilled"}:{kind:"phone_otp",...h,numberSource:a,needsPhone:a!=="prefilled",channels:(t.otp?.channels??[]).filter(d=>d==="whatsapp"||d==="sms")};if(S!==void 0&&(m.switchChannel=S),l&&(m.sentToMasked=s.sentToMasked),!r&&t.otp?.channel!==void 0&&(m.channel=t.otp.channel),!r&&Array.isArray(t.phoneCountries)&&(m.phoneCountries=t.phoneCountries.filter(d=>typeof d=="string"&&/^[A-Z]{2}$/.test(d))),!r&&Array.isArray(t.phoneRules)){let d=m.phoneCountries??[];m.phoneRules=t.phoneRules.flatMap(b=>{let f=mt(b);return f!==void 0&&d.includes(f.code)?[f]:[]})}return!r&&t.phoneInternational===!0&&(m.phoneInternational=!0),s.expiresAt!==void 0&&(m.codeExpiresAt=s.expiresAt),s.resendAvailableAt!==void 0&&(m.resendAvailableAt=s.resendAvailableAt),m}var pt=/^[\d[\]\-|()?:^]{1,64}$/;function ft(e){try{return typeof e=="string"&&pt.test(e)&&new RegExp(e)!==null}catch{return!1}}var Ie=e=>typeof e=="number"&&Number.isInteger(e)&&e>=1&&e<=15;function mt(e){let{code:t,dial:i,trunk:o,lengths:r,formats:s}=e??{};if(typeof t!="string"||typeof i!="string"||!/^\d{1,3}$/.test(i)||o!==void 0&&(typeof o!="string"||!/^\d{1,3}$/.test(o))||!Array.isArray(r)||r.length===0||!r.every(Ie))return;let u={code:t,dial:i,lengths:[...r].sort((a,l)=>a-l)};if(o!==void 0&&(u.trunk=o),s!==void 0){if(!(Array.isArray(s)&&s.length<=8&&s.every(l=>ft(l?.leading)&&Array.isArray(l.groups)&&l.groups.every(Ie)&&r.includes(l.groups.reduce((S,h)=>S+h,0)))))return;u.formats=s.map(l=>({leading:l.leading,groups:[...l.groups]}))}return u}function ht(e,t,i,o){let r=K(e)===!0?"bound":H(t)===!0?"document":"typed",s=r==="typed"&&t.state==="input_required"&&t.reason!==void 0&&ke(t.reason)==="id_number_recheck",u=Me(ne(e)),a=!o.attemptsExhausted&&u.length===1&&u[0]?.service==="document";return{kind:"registry",key:"registry",context:i,section:A(t),state:t.state==="input_required"?"input_required":"pending",source:r,recheck:s,canUseDocument:a,...o}}function St(e,t,i,o){let r=[...t.acceptedSides??[]];return{kind:"document",key:"document",context:i,section:A(t),side:r.includes("recto")?"verso":"recto",acceptedSides:r,documents:Ae(e),...o}}function yt(e){let t=x(e,"liveness");return t?.state==="passed"||t?.state==="review"}function we(e,t,i,o,r){let s=t.icao?.report;return{kind:"portrait",key:`portrait:${r}`,context:i,section:A(t),phase:r,report:Array.isArray(s)?s: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&&yt(e),...o}}var z={minLongSidePx:1280,jpegQuality:.95};function gt(e,t){let i=e.capture?.livePhoto;if(i?.oneCapture!==!0)return null;let o=x(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 Ct(e,t,i,o){let r=t.eid,s=A(t);if(r===void 0||r.challenge!=="app_code")return{kind:"unsupported",key:"unsupported:eid_auth",context:i,section:s,checkType:"eid_auth",reason:"update_required"};let u=Me(ne(e)),a=u.length===1&&ot.includes(u[0]?.service??"")?u[0]:void 0,l=a===void 0?void 0:V[a.service],S=l!==void 0,h={kind:"eid",key:"eid",context:i,section:s,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&&(h.cameraMethod=l),r.expiresAt!==void 0&&(h.codeExpiresAt=r.expiresAt),r.resendAvailableAt!==void 0&&(h.resendAvailableAt=r.resendAvailableAt),r.resendsRemaining!==void 0&&(h.resendsRemaining=r.resendsRemaining),r.codeAttemptsRemaining!==void 0&&(h.codeAttemptsRemaining=r.codeAttemptsRemaining),h}function _t(e,t){if(t.checkType!=="face_match"||t.reason!==void 0)return null;let i=x(e,"portrait_icao");return i!==void 0&&(i.state==="passed"||i.state==="review")?i:null}function kt(e){return L(e).filter(t=>t.state==="failed").pop()?.attemptsExhausted===!0}function Pt(e,t){let i=e.failureReason,o;i===Ee?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":kt(e)?o="attempts_exhausted":o="rejected";let r=o==="platform_unsupported"?{sessionId:e.sessionId,status:"unavailable"}:D(e,{autoRetry:!1}),s={kind:"result",key:"result",context:t,section:null,display:o,result:r};return i!==void 0&&(s.failureReason=i),e.retryAfter!==void 0&&(s.retryAfter=e.retryAfter),s}function bt(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 xt){let a=o[u];typeof a=="string"&&a!==""&&(r[u]=a)}let s=Re(o);return s!==void 0&&(r.idNumberMasked=s,r.nniMasked=s),r}var xt=["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 Rt(e){return e.kind==="contact"?"contact":(e.kind==="identity_method","identity")}function vt(e,t){let i=Oe[e.kind]??[...ee,...te],o=Rt(e),r=e.options.flatMap(u=>{if(u.available===!1||!i.includes(u.service))return[];let a={id:u.id,service:u.service};return u.nationalEid!=null&&(a.nationalEid=u.nationalEid),[a]});if(r.length===0){let u=e.options.length>0&&e.options.every(a=>a.service==="nfc");return M(t,o,"choice",u?"platform_unsupported":"update_required")}let s={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(l=>V[l.service]),choice:s},a=r.find(l=>l.nationalEid!==void 0)?.nationalEid;return a!==void 0&&(u.nationalEid=a),u}return e.kind==="contact"?{kind:"contact_choice",key:"contact_choice",context:t,section:o,options:r.map(u=>Te[u.service]),selected:null,locked:!1,choice:s}:{kind:"choice",key:`choice:${e.nodeId}`,context:t,section:o,choice:s}}function Qt(e,t={}){let i=ct(e);if(P(e)||e.failureReason===Ee)return Pt(e,i);let o=e.plan;if(o===void 0||!Array.isArray(o.sections))return M(i,null,"plan","update_required");let r=Pe(e);if(r!==null)return vt(r,i);let s=o.current===null?void 0:o.steps.find(m=>m.id===o.current),u=m=>{let d={kind:"processing",key:"processing",context:i,section:m!==void 0?A(m):o.sections.find(b=>b.state==="current")?.id??null,stalled:!1};return typeof m?.service=="string"&&m.service!==""&&(d.service=m.service),d};if(o.current===null)return u(o.steps.find(m=>m.state==="processing"));if(s===void 0)return M(i,null,"step","update_required");if(!nt.has(s.service))return s.interaction==="server"?u(s):M(i,A(s),s.service,"update_required");if(it.has(s.service)||!B(s))return u(s);let a=s,l=ut(a),S=a.checkType,h=A(a);switch(S){case"phone_otp":case"email_otp":return lt(e,a,i,l);case"population_registry":return ht(e,a,i,l);case"eid_auth":return Ct(e,a,i,l);case"doc_ocr":return St(e,a,i,l);case"identity_confirm":return bt(e,i,h)??u(a);case"portrait_icao":return we(e,a,i,l,"capture");case"liveness":case"face_match":{let m=_t(e,a);if(m!==null)return we(e,m,i,l,"match");let d=a.requiresMobile===!0,b=G(e);return d&&t.isMobile===!1?{kind:"mobile_required",key:"mobile_required",context:i,section:h,checkType:S}:{kind:"liveness",key:"biometric",context:i,section:h,mode:S==="face_match"?"selfie":"liveness",requiresMobile:d,instructions:b===null?"standard":"icao",icao:b,livePhoto:gt(e,S),...l}}case"nfc_chip":return M(i,h,S,"platform_unsupported");default:return M(i,h,S,"update_required")}}export{We as a,$e as b,Je as c,Qe as d,Xe as e,Nt as f,ze as g,ve as h,et as i,tt as j,Ft as k,Ae as l,Gt as m,Jt as n,Ee as o,A as p,ne as q,Me as r,_t as s,Qt as t};