@sekyro/web 0.0.0-stage → 0.1.0-rc.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +220 -0
- package/LICENSE +29 -0
- package/README.md +136 -2
- package/THIRD-PARTY-NOTICES.txt +154 -0
- package/dist/background-monitor-A7FKJOAG.js +1 -0
- package/dist/capture-constraints-B5omafmk.d.cts +44 -0
- package/dist/capture-constraints-B5omafmk.d.ts +44 -0
- package/dist/capture-session-doc-GK6G7JOI.js +1 -0
- package/dist/capture-session-v3-CmJw_bK0.d.cts +585 -0
- package/dist/capture-session-v3-DGG2stO6.d.ts +585 -0
- package/dist/chunk-3MSUJYBO.js +1 -0
- package/dist/chunk-7ZCZY3ZP.js +1 -0
- package/dist/chunk-A3FUGHAH.js +2 -0
- package/dist/chunk-BAGSM67V.js +1 -0
- package/dist/chunk-BPE5NSQ2.js +1 -0
- package/dist/chunk-CJHMFPL6.js +1 -0
- package/dist/chunk-DFTCAWMP.js +1 -0
- package/dist/chunk-DK5YPBDQ.js +1 -0
- package/dist/chunk-ETY6SAAZ.js +1 -0
- package/dist/chunk-FFDB6LQN.js +1 -0
- package/dist/chunk-FHJ7HO3M.js +1 -0
- package/dist/chunk-FPXL63KZ.js +1 -0
- package/dist/chunk-FUHDOEBP.js +1 -0
- package/dist/chunk-G6LKLN4U.js +1 -0
- package/dist/chunk-GI3UFGRQ.js +1 -0
- package/dist/chunk-HAO6EQTH.js +1 -0
- package/dist/chunk-HWAXEQD5.js +1 -0
- package/dist/chunk-MXWLCDFX.js +1 -0
- package/dist/chunk-O5WKNZ2C.js +1 -0
- package/dist/chunk-OKWG3PVH.js +1 -0
- package/dist/chunk-POIQGEZM.js +1 -0
- package/dist/chunk-RI3E7GBN.js +1 -0
- package/dist/chunk-SEC64KZ3.js +1 -0
- package/dist/chunk-SMKCBUJL.js +1 -0
- package/dist/chunk-SXZCL5NO.js +1 -0
- package/dist/chunk-SZ7YGNUZ.js +1 -0
- package/dist/chunk-TDLIXFDT.js +1 -0
- package/dist/chunk-UGMHAFEY.js +1 -0
- package/dist/chunk-WKJJEPWA.js +1 -0
- package/dist/chunk-XR64UFLK.js +1 -0
- package/dist/client/index.cjs +1 -0
- package/dist/client/index.d.cts +71 -0
- package/dist/client/index.d.ts +71 -0
- package/dist/client/index.js +1 -0
- package/dist/core/index.cjs +1 -0
- package/dist/core/index.d.cts +87 -0
- package/dist/core/index.d.ts +87 -0
- package/dist/core/index.js +1 -0
- package/dist/core/ocr/worker.bundle.js +42 -0
- package/dist/core/ocr/worker.cjs +42 -0
- package/dist/core/ocr/worker.d.cts +84 -0
- package/dist/core/ocr/worker.d.ts +84 -0
- package/dist/core/ocr/worker.js +41 -0
- package/dist/core/v3/detect-worker.cjs +1 -0
- package/dist/core/v3/detect-worker.d.cts +1 -0
- package/dist/core/v3/detect-worker.d.ts +1 -0
- package/dist/core/v3/detect-worker.js +1 -0
- package/dist/create-document-capture-IGUQP2NS.js +1 -0
- package/dist/create-portrait-capture-RJSFY37D.js +1 -0
- package/dist/create-verification-Bb20j6zk.d.ts +2968 -0
- package/dist/create-verification-CtqF4A9W.d.cts +2968 -0
- package/dist/detect-worker-DclNxkZT.d.cts +111 -0
- package/dist/detect-worker-DclNxkZT.d.ts +111 -0
- package/dist/detector-scanic-YCDNLCGV.js +1 -0
- package/dist/icao-gate-PWBMKRGC.js +1 -0
- package/dist/icao-gate-terzKYD7.d.cts +1770 -0
- package/dist/icao-gate-terzKYD7.d.ts +1770 -0
- package/dist/icao-tuning-4GGVX6B4.js +1 -0
- package/dist/index.cjs +1 -0
- package/dist/index.d.cts +74 -0
- package/dist/index.d.ts +74 -0
- package/dist/index.js +1 -0
- package/dist/internal/index.cjs +1 -0
- package/dist/internal/index.d.cts +462 -0
- package/dist/internal/index.d.ts +462 -0
- package/dist/internal/index.js +1 -0
- package/dist/keyframe-rank-YAJLYJYF.js +1 -0
- package/dist/landmarker-KB7LVXAU.js +1 -0
- package/dist/mrz-band-VYHOTDHY.js +1 -0
- package/dist/plan-runner-QCK2SOGS.js +1 -0
- package/dist/popup/index.cjs +1 -0
- package/dist/popup/index.d.cts +66 -0
- package/dist/popup/index.d.ts +66 -0
- package/dist/popup/index.js +1 -0
- package/dist/scanic-ml-stub-KW7IZHUT.js +1 -0
- package/dist/segmenter-USLNBX65.js +1 -0
- package/dist/turnstile-FATNZ4AG.js +1 -0
- package/package.json +133 -4
- package/sbom.cdx.json +195 -0
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
import { aZ as DocCatalogEntry, a_ as LiveMrzTuning, a$ as TextLockTuning, b0 as OcrEngineClient, b1 as DocAssistReport, b2 as ReadyInfo, b3 as LoadFailure, b4 as OcrEngineOptions, b5 as SubmitRuntime, a1 as LivenessCaptureOptions, a0 as LivenessCaptureHandle, aJ as VerificationStep, aH as VerificationResult, ay as StepSnapshot, Y as LivePhotoGateUpdate, b6 as HostedClientLike } from '../create-verification-Bb20j6zk.js';
|
|
2
|
+
export { b7 as ANALYSIS_LONG_EDGE, b8 as ASPECT_BANDS, b9 as AttestationError, ba as BLUR_REFUSE_SHARPNESS_MAX, bb as BlurStatus, bc as CAPTURE_CANDIDATE_SPACING_MS, bd as CAPTURE_EXTRA_CANDIDATES, be as CLIP_MIME_ALLOWLIST, bf as CaptureEngine, bg as CaptureSessionDoc, bh as CaptureSessionDocEvents, bi as CaptureSessionDocOptions, bj as DOC_ANALYSIS_DEFAULTS, bk as DOC_CADENCE_HZ, bl as DOC_CAMERA_TUNING_DEFAULTS, bm as DOC_CATALOG, bn as DOC_DETECT_WIDTH, bo as DOC_FEEDBACK_STATES, bp as DOC_GATE_V1_DEFAULTS, bq as DOC_SHUTTER_DEFAULTS, br as DeviceReadHint, bs as DocArtifacts, bt as DocAssist, bu as DocAssistEngine, bv as DocAssistTick, bw as DocCameraTuning, bx as DocCaptureReport, by as DocCaptureVia, bz as DocChecksPayload, bA as DocEngineLike, bB as DocFeedbackAggregator, bC as DocFeedbackKey, bD as DocFeedbackState, bE as DocFormat, bF as DocFrameAnalysis, bG as DocFrameMeasures, bH as DocGateQuality, bI as DocGateThresholds, bJ as DocGateTick, bK as DocGateTickInput, bL as DocGateV1, bM as DocQuad, bN as DocQuadPoint, bO as DocShutterReason, bP as DocShutterTuning, bQ as DocSide, bR as DocumentCaptureController, bS as DocumentCaptureInternals, bT as EMPTY_GUIDE_METRICS, bU as EncodedDocument, bV as FLIP_FILL_MIN, bW as FLIP_GAP_MS, bX as FLIP_TIMEOUT_MS, bY as FocusCaps, bZ as FramingStatus, b_ as GUIDE_LOCK_DEFAULTS, b$ as GlareStatus, c0 as GrabbedFrame, c1 as GuideBlocker, c2 as GuideLock, c3 as GuideLockTick, c4 as GuideLockTuning, c5 as GuideMetrics, c6 as GuideRect, c7 as INFERENCE_RETRY_ATTEMPTS, c8 as INFERENCE_RETRY_DEFAULT_S, U as ISSUER_CODES, c9 as LANDMARKER_MODEL, ca as LENS_STORAGE_KEY, cb as LENS_TRY_MAX, cc as LIVE_MRZ_DEFAULTS, cd as LIVE_PHOTO_IDLE_MS, ce as LIVE_PHOTO_MAX_HZ, cf as LandmarkedFace, cg as LandmarkerLike, ch as LensKind, ci as LensSource, cj as LightingStatus, ck as LiveMrzCapture, cl as LiveMrzState, cm as LivePhotoGate, cn as LivePhotoKit, co as LivePhotoKitInternals, cp as LivePhotoKitOptions, cq as LivePhotoStill, cr as LivenessCaptureInternalHandle, cs as LivenessCaptureInternals, ct as LivenessFlowDeps, cu as LivenessFlowOutcome, cv as MANUAL_SHUTTER_MS, cw as MR_DOC_CATALOG, cx as NO_REPORT_MS, cy as OpenDocCameraDeps, cz as PORTRAIT_JPEG_QUALITY, cA as PRELOAD_BLAZE_INIT_TIMEOUT_MS, cB as PRELOAD_BUDGET_MS, cC as PROCESSING_POLL_DELAY_MS, cD as PROCESSING_POLL_MAX, cE as PortraitCaptureController, cF as PortraitCaptureInternals, cG as REGISTRY_RETRY_DELAY_MS, cH as ReticleType, cI as SAME_FACE_MAX_DROPS, cJ as ScanEvent, cK as ScanLayout, cL as ScanNotice, cM as ScanPhase, cN as ScanReport, cO as ScanSide, cP as ScanState, cQ as SubmitExecutor, cR as TEXT_LOCK_DEFAULTS, cS as TRANSPORT_REPLAY_ATTEMPTS, cT as TRANSPORT_REPLAY_DELAY_MS, cU as VerificationInternals, cV as analyzeDocFrame, cW as analyzeGuide, cX as aspectBand, cY as aspectFits, cZ as buildDeviceReadHint, c_ as coverPointToVideo, c$ as createDocumentCaptureInternal, d0 as createFaceLandmarker, d1 as createLivePhotoKit, d2 as createLivenessCaptureInternal, d3 as createPortraitCaptureInternal, d4 as createVerificationInternal, d5 as docZoomFor, d6 as encodeDocumentImage, d7 as facesOf, d8 as feedbackVoteOf, d9 as focusOk, da as guideQuad, db as guideRegionInFrame, dc as initialScanState, dd as lensKindOf, de as mapEngineState, df as mapErrorKind, dg as mapGuidanceHint, dh as nextScanState, di as observePortraitFrame, dj as openDocCamera, dk as passportBandOf, dl as portraitMatchStep, dm as preloadedDetectorFactory, dn as quadAreaFrac, dp as quadBounds, dq as quadIou, dr as quadTiltRatio, ds as randomUuid, dt as rankBackCameras, du as readStoredLens, dv as resetLivenessAssetsForTests, dw as resolveDocCameraTuning, dx as resolveDocShutterTuning, dy as resolveGuideLockTuning, dz as runLivenessFlow, dA as runSubmission, dB as scannerFormatFor, dC as setPreloadLoaderForTests, dD as settledHint, dE as singleShotFocusAt, dF as specularFraction, dG as supportsFocusMode, dH as warmDocDetector, dI as writeStoredLens } from '../create-verification-Bb20j6zk.js';
|
|
3
|
+
export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, d as detectFormFactor, c as detectIsMobile } from '../capture-constraints-B5omafmk.js';
|
|
4
|
+
import { B as HostedSessionView, c as CheckType, a as CheckReason, a7 as PlanStepView } from '../icao-gate-terzKYD7.js';
|
|
5
|
+
export { ag as BackgroundStats, ah as Box, ai as CLIPPED_LUMA, aj as FaceGeometry, ak as FaceLighting, H as HeadPose, al as ICAO_CANVAS, am as ICAO_FALLBACK, an as ICAO_GATE_CRITERIA, ao as ICAO_SHARP_REF, K as IcaoCaptureTuning, L as IcaoCoachKey, N as IcaoCriterionState, ap as IcaoFrameObservation, aq as IcaoGate, O as IcaoGateCriterion, ar as IcaoGateOptions, P as IcaoGateSummary, Q as IcaoGateUpdate, as as IcaoJudgedCriterion, at as IcaoMeasures, au as IcaoPixelStats, av as IcaoProfile, aw as LumaPlane, ax as Point, ay as RegionStats, az as ResolvedIcaoTuning, aA as backgroundStats, aB as createIcaoGate, aC as eyeLineRoll, aD as eyeOpenness, aE as eyeSpecular, aF as faceGeometry, aG as faceLighting, aH as faceSharpness, aI as icaoPixelStats, aJ as icaoWindow, aK as judgeIcao, aL as lumaPlane, aM as percentile, aN as portraitCropRegion, aO as poseFromMatrix, aP as regionStats, aQ as resolveIcaoTuning, aR as scoreFrame, aS as windowOverflow } from '../icao-gate-terzKYD7.js';
|
|
6
|
+
import '../detect-worker-DclNxkZT.js';
|
|
7
|
+
import '../capture-session-v3-DGG2stO6.js';
|
|
8
|
+
|
|
9
|
+
type DocumentTypeId = DocCatalogEntry["docType"];
|
|
10
|
+
/** Same shape as the hosted view's `acceptedDocuments`. */
|
|
11
|
+
interface AcceptedDocumentsLike {
|
|
12
|
+
default: "*" | readonly DocumentTypeId[];
|
|
13
|
+
byIssuer?: Readonly<Record<string, readonly DocumentTypeId[]>>;
|
|
14
|
+
}
|
|
15
|
+
/** Picker order. */
|
|
16
|
+
declare const DOCUMENT_TYPE_ORDER: readonly DocumentTypeId[];
|
|
17
|
+
/** Types accepted for documents of `issuer` (ISO alpha-2), in picker order. */
|
|
18
|
+
declare function acceptedTypesFor(accepted: AcceptedDocumentsLike, issuer: string): DocumentTypeId[];
|
|
19
|
+
/** Issuers with at least one accepted type, sorted by code (the UI re-sorts by name). */
|
|
20
|
+
declare function acceptedIssuers(accepted: AcceptedDocumentsLike, codes?: readonly string[]): string[];
|
|
21
|
+
/** `acceptedDocuments`, or — from a server that predates it — MR with the legacy list. */
|
|
22
|
+
declare function resolveAcceptedDocuments(view: {
|
|
23
|
+
acceptedDocuments?: AcceptedDocumentsLike | undefined;
|
|
24
|
+
acceptedDocumentTypes?: readonly DocumentTypeId[] | undefined;
|
|
25
|
+
}): AcceptedDocumentsLike;
|
|
26
|
+
/** 🇲🇷-style flag from an alpha-2 code (regional indicator symbols). */
|
|
27
|
+
declare function flagOf(iso2: string): string;
|
|
28
|
+
|
|
29
|
+
interface MrzBand {
|
|
30
|
+
x: number;
|
|
31
|
+
y: number;
|
|
32
|
+
width: number;
|
|
33
|
+
height: number;
|
|
34
|
+
/** Mean qualifying-row stroke density (diagnostics/telemetry). */
|
|
35
|
+
density: number;
|
|
36
|
+
}
|
|
37
|
+
interface MrzBandThresholds {
|
|
38
|
+
/** Luma step that counts as a text stroke edge. */
|
|
39
|
+
EDGE_LUMA_DELTA: number;
|
|
40
|
+
/** Min fraction of a row's pixels that are stroke edges to qualify. */
|
|
41
|
+
MIN_ROW_DENSITY: number;
|
|
42
|
+
/** Row must have stroke edges spread across ≥ this fraction of 12 columns. */
|
|
43
|
+
MIN_COLUMN_COVERAGE: number;
|
|
44
|
+
/** Band width (stroke x-extent) as a fraction of frame width. */
|
|
45
|
+
MIN_WIDTH_FRAC: number;
|
|
46
|
+
/** Band height bounds as fractions of frame height (2–3 OCR-B lines). */
|
|
47
|
+
MIN_HEIGHT_FRAC: number;
|
|
48
|
+
MAX_HEIGHT_FRAC: number;
|
|
49
|
+
/** Rows this close together merge into one band (inter-line gap). */
|
|
50
|
+
ROW_MERGE_GAP: number;
|
|
51
|
+
}
|
|
52
|
+
/** Frozen defaults (goldens in test/doc/mrz-band.test.ts — retune together). */
|
|
53
|
+
declare const MRZ_BAND_DEFAULTS: Readonly<MrzBandThresholds>;
|
|
54
|
+
/**
|
|
55
|
+
* Detect the MRZ stroke band on a (≤480px) grayscale-able frame. Returns the
|
|
56
|
+
* tight band rect in frame pixels, or null when no qualifying band exists
|
|
57
|
+
* (no MRZ in view, or only a partial/narrow slice of one).
|
|
58
|
+
*/
|
|
59
|
+
declare function detectMrzBand(frame: ImageData, overrides?: Partial<MrzBandThresholds>): MrzBand | null;
|
|
60
|
+
|
|
61
|
+
type CapabilityFailure = "simd" | "worker" | "bitmap" | "memory";
|
|
62
|
+
type Capability = {
|
|
63
|
+
ok: true;
|
|
64
|
+
} | {
|
|
65
|
+
ok: false;
|
|
66
|
+
reason: CapabilityFailure;
|
|
67
|
+
};
|
|
68
|
+
type Probe = {
|
|
69
|
+
WebAssembly?: {
|
|
70
|
+
validate?: (b: BufferSource) => boolean;
|
|
71
|
+
};
|
|
72
|
+
Worker?: unknown;
|
|
73
|
+
createImageBitmap?: unknown;
|
|
74
|
+
navigator?: {
|
|
75
|
+
deviceMemory?: number;
|
|
76
|
+
connection?: {
|
|
77
|
+
saveData?: boolean;
|
|
78
|
+
effectiveType?: string;
|
|
79
|
+
};
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
declare function probeCapabilities(t: {
|
|
83
|
+
minDeviceMemoryGb: number;
|
|
84
|
+
}, g?: Probe): Capability;
|
|
85
|
+
|
|
86
|
+
/** This build's engine (packages/sekyro-ocr-wasm wasm-engine.lock.json `engine`). */
|
|
87
|
+
declare const WEB_OCR_ENGINE = "sekyro-ocr-1";
|
|
88
|
+
interface WebOcrPlan {
|
|
89
|
+
/** Create the engine for this session (some OCR path is live). */
|
|
90
|
+
enabled: boolean;
|
|
91
|
+
liveMrz: (LiveMrzTuning & {
|
|
92
|
+
hint: boolean;
|
|
93
|
+
stillConfirm: boolean;
|
|
94
|
+
}) | null;
|
|
95
|
+
textLock: TextLockTuning | null;
|
|
96
|
+
/** The A/B arm per block (`null`: the block is absent or disabled — no report). */
|
|
97
|
+
liveMrzArm: "live" | "control" | null;
|
|
98
|
+
frontLockArm: "live" | "control" | null;
|
|
99
|
+
load: {
|
|
100
|
+
detectorLimit: number;
|
|
101
|
+
loadTimeoutMs: number;
|
|
102
|
+
maxDownloadMs: number;
|
|
103
|
+
minDeviceMemoryGb: number;
|
|
104
|
+
};
|
|
105
|
+
reportSampleRate: number;
|
|
106
|
+
}
|
|
107
|
+
/** `capture.document` → the plan. `mode: "off"` (the embedded option) turns every OCR path off. */
|
|
108
|
+
declare function resolveWebOcrPlan(document: unknown, o?: {
|
|
109
|
+
mode?: "auto" | "off";
|
|
110
|
+
engine?: string;
|
|
111
|
+
}): WebOcrPlan;
|
|
112
|
+
type WebOcrStart = {
|
|
113
|
+
ok: true;
|
|
114
|
+
engine: OcrEngineClient;
|
|
115
|
+
} | {
|
|
116
|
+
ok: false;
|
|
117
|
+
reason: "unsupported" | "off";
|
|
118
|
+
};
|
|
119
|
+
/**
|
|
120
|
+
* Create the engine when the plan, the device (SIMD, workers, bitmaps, memory) and the network allow; else the reason
|
|
121
|
+
* (`off`: nothing enabled for this session; `unsupported`: the device or a slow / Save-Data connection).
|
|
122
|
+
*/
|
|
123
|
+
declare function startWebOcr(plan: WebOcrPlan, o: Pick<OcrEngineOptions, "baseUrl" | "salt" | "workerUrl" | "createWorker" | "page"> & {
|
|
124
|
+
probe?: typeof probeCapabilities;
|
|
125
|
+
slow?: () => boolean;
|
|
126
|
+
}): WebOcrStart;
|
|
127
|
+
type BrowserFamily = "chrome" | "safari" | "samsung" | "firefox" | "other";
|
|
128
|
+
/** A fixed browser family (spec §10): from UA brands / tokens, never the UA string itself. */
|
|
129
|
+
declare function browserFamily(ua?: string): BrowserFamily;
|
|
130
|
+
/** The `live_mrz` wire report (identity-backend capture-report.schema.ts LiveMrzReportSchema). Enums and integers only. */
|
|
131
|
+
interface LiveMrzWireReport {
|
|
132
|
+
kind: "live_mrz";
|
|
133
|
+
platform: "web";
|
|
134
|
+
engine: string;
|
|
135
|
+
arm: "live" | "control";
|
|
136
|
+
capture: "recto" | "verso" | "single";
|
|
137
|
+
outcome: "valid" | "locked" | "timeout" | "slow" | "unsupported" | "download" | "integrity" | "error" | "off";
|
|
138
|
+
reads: number;
|
|
139
|
+
format?: "TD1" | "TD2" | "TD3";
|
|
140
|
+
framesToValid?: number;
|
|
141
|
+
msToValid?: number;
|
|
142
|
+
framesToLock?: number;
|
|
143
|
+
msToLock?: number;
|
|
144
|
+
msToCapture?: number;
|
|
145
|
+
warmupMs?: number;
|
|
146
|
+
readP50Ms?: number;
|
|
147
|
+
readP90Ms?: number;
|
|
148
|
+
downloadMs?: number;
|
|
149
|
+
cached?: boolean;
|
|
150
|
+
stillConfirmed?: boolean;
|
|
151
|
+
typeMismatch?: boolean;
|
|
152
|
+
deviceClass?: "fast" | "mid" | "slow";
|
|
153
|
+
browser: BrowserFamily;
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* One face's report: from the assist's report when it ran, else the engine's load outcome (`unsupported`, `download`,
|
|
157
|
+
* `integrity`, `error`/`timeout` → error) or `off` (the control arm). `arm` = the block's arm for this face.
|
|
158
|
+
*/
|
|
159
|
+
declare function liveMrzWireReport(i: {
|
|
160
|
+
arm: "live" | "control";
|
|
161
|
+
capture: "recto" | "verso" | "single";
|
|
162
|
+
assist?: DocAssistReport | null;
|
|
163
|
+
load?: ReadyInfo | LoadFailure | "off" | null;
|
|
164
|
+
msToCapture?: number;
|
|
165
|
+
stillConfirmed?: boolean;
|
|
166
|
+
typeMismatch?: boolean;
|
|
167
|
+
browser?: BrowserFamily;
|
|
168
|
+
engine?: string;
|
|
169
|
+
}): LiveMrzWireReport;
|
|
170
|
+
/** A valid live read whose format contradicts the picked document (spec D5 state 4): TD3 on a card, TD1/TD2 on a passport. */
|
|
171
|
+
declare function formatMismatch(format: "TD1" | "TD2" | "TD3" | undefined, picked: "passport" | "card"): boolean;
|
|
172
|
+
|
|
173
|
+
declare const OCR_ASSET_SET: {
|
|
174
|
+
readonly fp12: "08390000c48a";
|
|
175
|
+
readonly engine: "sekyro-ocr-1";
|
|
176
|
+
readonly precision: "fp32";
|
|
177
|
+
readonly files: {
|
|
178
|
+
readonly "sekyro-ocr.wasm": {
|
|
179
|
+
readonly bytes: 3550608;
|
|
180
|
+
readonly sha256: "c15968a6de3d2225e2fdbf36d71a9214c2910419056c6878444fd2d0567bb748";
|
|
181
|
+
readonly tier: "live";
|
|
182
|
+
readonly contentType: "application/wasm";
|
|
183
|
+
};
|
|
184
|
+
readonly "sekyro-ocr.mjs": {
|
|
185
|
+
readonly bytes: 4270;
|
|
186
|
+
readonly sha256: "209a78d96ca53344996a0c2300aed4ff8a5c69e142713216975a2840eec08cac";
|
|
187
|
+
readonly tier: "bundled";
|
|
188
|
+
readonly contentType: "text/javascript";
|
|
189
|
+
};
|
|
190
|
+
readonly "det.param": {
|
|
191
|
+
readonly bytes: 24252;
|
|
192
|
+
readonly sha256: "c39ba0b1195e8ad37cfc5bdd7acedcfc1d9cb901e7b8eb1c9c4f6e5a66c04eb3";
|
|
193
|
+
readonly tier: "live";
|
|
194
|
+
readonly contentType: "text/plain";
|
|
195
|
+
};
|
|
196
|
+
readonly "det.bin": {
|
|
197
|
+
readonly bytes: 4685856;
|
|
198
|
+
readonly sha256: "652bafe366565109a1a5766caf482bc46f01481f8044d3a785bd9a1be67c63bb";
|
|
199
|
+
readonly tier: "live";
|
|
200
|
+
readonly contentType: "application/octet-stream";
|
|
201
|
+
};
|
|
202
|
+
readonly "mrz-rec.param": {
|
|
203
|
+
readonly bytes: 3510;
|
|
204
|
+
readonly sha256: "bc69b1b9683e35f6605b21001fadeb81468063459c00c0fc83c67c139f23df01";
|
|
205
|
+
readonly tier: "live";
|
|
206
|
+
readonly contentType: "text/plain";
|
|
207
|
+
};
|
|
208
|
+
readonly "mrz-rec.bin": {
|
|
209
|
+
readonly bytes: 494196;
|
|
210
|
+
readonly sha256: "de93a2aa2f08670cc7dedd17ba378d2f5d7cf6ae409054a9eac863a02c2febae";
|
|
211
|
+
readonly tier: "live";
|
|
212
|
+
readonly contentType: "application/octet-stream";
|
|
213
|
+
};
|
|
214
|
+
readonly "mrz_dict.txt": {
|
|
215
|
+
readonly bytes: 73;
|
|
216
|
+
readonly sha256: "b19858a4de2ccbbbdd4b53982188ea2c7664013183bbd1ae9d20ab52c661f97f";
|
|
217
|
+
readonly tier: "live";
|
|
218
|
+
readonly contentType: "text/plain";
|
|
219
|
+
};
|
|
220
|
+
readonly "latin-rec.param": {
|
|
221
|
+
readonly bytes: 19602;
|
|
222
|
+
readonly sha256: "2ae30dfdc7ee482c6cbbc0419c16ee125e880e9eaf69053d61953694bb0fcf4c";
|
|
223
|
+
readonly tier: "lazy";
|
|
224
|
+
readonly contentType: "text/plain";
|
|
225
|
+
};
|
|
226
|
+
readonly "latin-rec.bin": {
|
|
227
|
+
readonly bytes: 10750388;
|
|
228
|
+
readonly sha256: "f91ebdcf4d6b58c58a87704160e59d07ae56bc2d5021eae09d095c5a20bf7525";
|
|
229
|
+
readonly tier: "lazy";
|
|
230
|
+
readonly contentType: "application/octet-stream";
|
|
231
|
+
};
|
|
232
|
+
readonly "ppocr_keys_v1.txt": {
|
|
233
|
+
readonly bytes: 26249;
|
|
234
|
+
readonly sha256: "28b2362ad4ab2dc38769aa72feb535e3a9ddb3fd2a7585a05920e6393b1dc7f7";
|
|
235
|
+
readonly tier: "lazy";
|
|
236
|
+
readonly contentType: "text/plain";
|
|
237
|
+
};
|
|
238
|
+
readonly "arabic-rec.param": {
|
|
239
|
+
readonly bytes: 9858;
|
|
240
|
+
readonly sha256: "4e5cc85667dfaaa0c67d3f308400645a578c08bd43f952cab6c55b7bce143ea9";
|
|
241
|
+
readonly tier: "lazy";
|
|
242
|
+
readonly contentType: "text/plain";
|
|
243
|
+
};
|
|
244
|
+
readonly "arabic-rec.bin": {
|
|
245
|
+
readonly bytes: 8853572;
|
|
246
|
+
readonly sha256: "5acc3265a1738dc31316258383830d5dbdfa5e8ebc2e710f9001f832ecfbffb0";
|
|
247
|
+
readonly tier: "lazy";
|
|
248
|
+
readonly contentType: "application/octet-stream";
|
|
249
|
+
};
|
|
250
|
+
readonly "arabic_dict.txt": {
|
|
251
|
+
readonly bytes: 405;
|
|
252
|
+
readonly sha256: "637c27c88512c22089bef927b34ada08f748dc132ac70facd68d8202384c2726";
|
|
253
|
+
readonly tier: "lazy";
|
|
254
|
+
readonly contentType: "text/plain";
|
|
255
|
+
};
|
|
256
|
+
};
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
/** `processing` re-reads (1+2+4+8+15 = 30 s, spec §6.5), then `stalled`. */
|
|
260
|
+
declare const PROCESSING_BACKOFF_MS: readonly number[];
|
|
261
|
+
/** Hosted parity: a resend is offered 30 s after the last send. */
|
|
262
|
+
declare const OTP_RESEND_COOLDOWN_MS = 30000;
|
|
263
|
+
type Executor = (client: HostedClientLike, idempotencyKey: string) => Promise<HostedSessionView>;
|
|
264
|
+
interface RunnerDeps {
|
|
265
|
+
runtime: SubmitRuntime;
|
|
266
|
+
currentView(): HostedSessionView | null;
|
|
267
|
+
ensureView(): Promise<HostedSessionView>;
|
|
268
|
+
refreshView(): Promise<HostedSessionView>;
|
|
269
|
+
ensureConsent(): Promise<void>;
|
|
270
|
+
liveness(options: LivenessCaptureOptions): LivenessCaptureHandle;
|
|
271
|
+
/** A liveness submission chain is in flight (do not flip the UI mid-upload). */
|
|
272
|
+
chainBusy(): boolean;
|
|
273
|
+
destroyed(): boolean;
|
|
274
|
+
sleep(ms: number): Promise<void>;
|
|
275
|
+
isMobile(): boolean;
|
|
276
|
+
now(): number;
|
|
277
|
+
emitStep(step: VerificationStep): void;
|
|
278
|
+
emitResult(result: VerificationResult): void;
|
|
279
|
+
/**
|
|
280
|
+
* The promoted face_match probe key of the last liveness submission (profile
|
|
281
|
+
* v2 §4.4 wrong-number re-entry): after the re-entered NNI passes, the
|
|
282
|
+
* `pending` face_match is resubmitted with it — no new capture. `null` when
|
|
283
|
+
* no liveness was submitted from this page (e.g. after a reload).
|
|
284
|
+
*/
|
|
285
|
+
keptFaceKey?(): string | null;
|
|
286
|
+
/** Task 4: binds the document step (selectDocument + capture). */
|
|
287
|
+
bindDocument?(snapshot: Extract<StepSnapshot, {
|
|
288
|
+
kind: "document";
|
|
289
|
+
}>, republish: () => void): VerificationStep;
|
|
290
|
+
/** SDK spec §4.9: binds the ICAO portrait step (capture + portrait_icao / face_match submissions). */
|
|
291
|
+
bindPortrait?(snapshot: Extract<StepSnapshot, {
|
|
292
|
+
kind: "portrait";
|
|
293
|
+
}>, republish: () => void): VerificationStep;
|
|
294
|
+
/** Commit a view an action answered (flow model 2026-10-23); absent → re-read the view. */
|
|
295
|
+
setView?(view: HostedSessionView): void;
|
|
296
|
+
/** Step 3 one capture: the ICAO coaching of the running live-photo capture. */
|
|
297
|
+
onLivePhoto?(handler: (gate: LivePhotoGateUpdate) => void): () => void;
|
|
298
|
+
}
|
|
299
|
+
interface StepRunner {
|
|
300
|
+
run(): Promise<VerificationStep>;
|
|
301
|
+
current(): VerificationStep | null;
|
|
302
|
+
/** Called by the verification on every view update. */
|
|
303
|
+
onView(view: HostedSessionView): void;
|
|
304
|
+
/** Called when the liveness chain becomes idle. */
|
|
305
|
+
onChainIdle(): void;
|
|
306
|
+
/** Re-derive from the current view and publish even if unchanged (local overlay changed). */
|
|
307
|
+
republish(): void;
|
|
308
|
+
/** Submit one step input (exposed for the document binding, Task 4). */
|
|
309
|
+
submit(checkType: CheckType, executor: Executor, onAccepted?: () => void): Promise<void>;
|
|
310
|
+
}
|
|
311
|
+
declare function createStepRunner(deps: RunnerDeps): StepRunner;
|
|
312
|
+
|
|
313
|
+
/**
|
|
314
|
+
* Reasons the backend parks at `input_required` while attempts remain
|
|
315
|
+
* (identity-backend/src/checks/check-reasons.ts isRetryable tables — the single
|
|
316
|
+
* source of truth; identity-hosted/lib/reason-copy.ts mirrors the same rows).
|
|
317
|
+
*/
|
|
318
|
+
declare const RETRYABLE_REASONS: ReadonlySet<CheckReason>;
|
|
319
|
+
/** A check the browser may still submit. */
|
|
320
|
+
declare function isExecutable(step: Pick<PlanStepView, "state"> | undefined): boolean;
|
|
321
|
+
/** The session accepts no further submissions. */
|
|
322
|
+
declare function isTerminalView(view: Pick<HostedSessionView, "status">): boolean;
|
|
323
|
+
/** The step `plan.current` names while it can still be submitted (the backend's frontier). */
|
|
324
|
+
declare function frontierStep(view: HostedSessionView): PlanStepView | undefined;
|
|
325
|
+
/** The plan step of a check type (check types are unique on a session's path). */
|
|
326
|
+
declare function stepOf(view: HostedSessionView, checkType: CheckType): PlanStepView | undefined;
|
|
327
|
+
/**
|
|
328
|
+
* Map the session view to the public result:
|
|
329
|
+
* - `completed/approved → approved`, `completed/review` or `review_pending → review`,
|
|
330
|
+
* `failed` or `completed/rejected → rejected` (session-policy reason takes
|
|
331
|
+
* precedence on a failed session; otherwise use the deciding step's reason);
|
|
332
|
+
* - `expired → unavailable` (no reason);
|
|
333
|
+
* - in flight: a biometric step parked at `input_required` with a retryable
|
|
334
|
+
* reason → `retry` when `autoRetry` and attempts remain, else `rejected`
|
|
335
|
+
* (`mobile_required` → `unavailable`: only a phone can capture it)
|
|
336
|
+
* (the partner opted out of retries — this capture was refused); a step in
|
|
337
|
+
* `review` with nothing executable left → `review`; otherwise `unavailable`
|
|
338
|
+
* (a non-biometric frontier the SDK cannot drive, or still processing).
|
|
339
|
+
*/
|
|
340
|
+
declare function mapSessionResult(view: HostedSessionView, opts: {
|
|
341
|
+
autoRetry: boolean;
|
|
342
|
+
}): VerificationResult;
|
|
343
|
+
|
|
344
|
+
declare const TURNSTILE_SCRIPT_SRC = "https://challenges.cloudflare.com/turnstile/v0/api.js";
|
|
345
|
+
/** Bound on a single execute round-trip (challenge fetch + solve). */
|
|
346
|
+
declare const TURNSTILE_EXECUTE_TIMEOUT_MS = 30000;
|
|
347
|
+
interface TurnstileRenderParams {
|
|
348
|
+
sitekey: string;
|
|
349
|
+
callback: (token: string) => void;
|
|
350
|
+
"error-callback"?: (code?: string) => void;
|
|
351
|
+
execution?: "render" | "execute";
|
|
352
|
+
appearance?: "always" | "execute" | "interaction-only";
|
|
353
|
+
}
|
|
354
|
+
/** The subset of the Turnstile JS API this module uses. */
|
|
355
|
+
interface TurnstileApi {
|
|
356
|
+
render(container: HTMLElement, params: TurnstileRenderParams): string | undefined;
|
|
357
|
+
execute(widgetId: string): void;
|
|
358
|
+
remove(widgetId: string): void;
|
|
359
|
+
}
|
|
360
|
+
/** Test-only: reset the module singleton between cases. */
|
|
361
|
+
declare function resetTurnstileForTests(): void;
|
|
362
|
+
/** Load the Turnstile script once (singleton; a load failure resets it so a
|
|
363
|
+
* retry can re-attempt). */
|
|
364
|
+
declare function loadTurnstile(): Promise<TurnstileApi>;
|
|
365
|
+
/** Options of {@link executeTurnstile}. */
|
|
366
|
+
interface ExecuteTurnstileOptions {
|
|
367
|
+
/** Bound on the challenge round-trip; default {@link TURNSTILE_EXECUTE_TIMEOUT_MS}. */
|
|
368
|
+
timeoutMs?: number;
|
|
369
|
+
/**
|
|
370
|
+
* Aborts the challenge: the promise rejects and the widget, its container and
|
|
371
|
+
* the timeout are cleaned up at once. `createVerification().destroy()` passes
|
|
372
|
+
* its own signal so a torn-down verification never leaves a widget behind.
|
|
373
|
+
*/
|
|
374
|
+
signal?: AbortSignal;
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Run one invisible execute-mode challenge and resolve its token. Rejects on
|
|
378
|
+
* challenge error, on `signal` abort, or after {@link TURNSTILE_EXECUTE_TIMEOUT_MS}
|
|
379
|
+
* — the verification maps a failure to `result {status:'unavailable',
|
|
380
|
+
* reason:'attestation'}` after one retry.
|
|
381
|
+
*/
|
|
382
|
+
declare function executeTurnstile(siteKey: string, opts?: ExecuteTurnstileOptions): Promise<string>;
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* Face of a decoded still: an MRZ band means the verso. With `cardOnly` (the still is the card itself) the band must
|
|
386
|
+
* sit in its lower half, where a card's MRZ is: the line of print across a recto's top (the issuing state) is not one.
|
|
387
|
+
*/
|
|
388
|
+
declare function classifyCardSideWith(detect: typeof detectMrzBand, still: ImageData, cardOnly?: boolean): "recto" | "verso";
|
|
389
|
+
/** {@link classifyCardSideWith} with the MRZ-band detector loaded on demand. */
|
|
390
|
+
declare function classifyCardSide(still: ImageData, cardOnly?: boolean): Promise<"recto" | "verso">;
|
|
391
|
+
/** Downscale a captured JPEG to a 480 px-wide ImageData for the classifier. */
|
|
392
|
+
declare function stillToImageData(blob: Blob, width?: number): Promise<ImageData | null>;
|
|
393
|
+
|
|
394
|
+
/** Long side the measure runs at (Mattel: about what the recognizer sees of a card). */
|
|
395
|
+
declare const SHARPNESS_LONG_EDGE = 1000;
|
|
396
|
+
/** Inverse-edge-width sharpness of an RGBA image; `-1` for an unusable one (< 16 px). */
|
|
397
|
+
declare function photoSharpness(image: {
|
|
398
|
+
data: ArrayLike<number>;
|
|
399
|
+
width: number;
|
|
400
|
+
height: number;
|
|
401
|
+
}): number;
|
|
402
|
+
/** A rectangle of the full-resolution still, in its pixels. */
|
|
403
|
+
interface StillRegion {
|
|
404
|
+
x: number;
|
|
405
|
+
y: number;
|
|
406
|
+
width: number;
|
|
407
|
+
height: number;
|
|
408
|
+
}
|
|
409
|
+
/** Padding around the card's bounding box, as a fraction of its size per side. */
|
|
410
|
+
declare const REGION_PAD = 0.06;
|
|
411
|
+
/**
|
|
412
|
+
* The card region of the still (Mattel measures the guide region, not the
|
|
413
|
+
* whole photo): the bounding box of the last gate quad — in detect-frame
|
|
414
|
+
* coordinates — scaled to the still, padded by {@link REGION_PAD} and clamped.
|
|
415
|
+
* `null` when there is no usable quad (then the whole still is measured).
|
|
416
|
+
*/
|
|
417
|
+
declare function stillRegionOf(quad: {
|
|
418
|
+
topLeft: {
|
|
419
|
+
x: number;
|
|
420
|
+
y: number;
|
|
421
|
+
};
|
|
422
|
+
topRight: {
|
|
423
|
+
x: number;
|
|
424
|
+
y: number;
|
|
425
|
+
};
|
|
426
|
+
bottomRight: {
|
|
427
|
+
x: number;
|
|
428
|
+
y: number;
|
|
429
|
+
};
|
|
430
|
+
bottomLeft: {
|
|
431
|
+
x: number;
|
|
432
|
+
y: number;
|
|
433
|
+
};
|
|
434
|
+
} | null, frame: {
|
|
435
|
+
width: number;
|
|
436
|
+
height: number;
|
|
437
|
+
}, still: {
|
|
438
|
+
width: number;
|
|
439
|
+
height: number;
|
|
440
|
+
}, pad?: number): StillRegion | null;
|
|
441
|
+
type RawImage = {
|
|
442
|
+
data: ArrayLike<number>;
|
|
443
|
+
width: number;
|
|
444
|
+
height: number;
|
|
445
|
+
};
|
|
446
|
+
/** Crop `region` out of an RGBA image (pure; the canvas path does the same with drawImage). */
|
|
447
|
+
declare function cropImage(image: RawImage, region: StillRegion): {
|
|
448
|
+
data: Uint8ClampedArray;
|
|
449
|
+
width: number;
|
|
450
|
+
height: number;
|
|
451
|
+
};
|
|
452
|
+
/** Area-average downscale so the long side is at most `longEdge` (pure; mirrors cv INTER_AREA). */
|
|
453
|
+
declare function resizeLongEdge(image: RawImage, longEdge?: number): RawImage;
|
|
454
|
+
/** The blur-gate measure of a still: its card region (or the whole still), scaled to ≤ 1000 px. */
|
|
455
|
+
declare function measureRegionSharpness(image: RawImage, region: StillRegion | null): number;
|
|
456
|
+
/**
|
|
457
|
+
* Browser path of {@link measureRegionSharpness} on an already decoded still:
|
|
458
|
+
* one drawImage crops and scales the region; the canvas is released after.
|
|
459
|
+
*/
|
|
460
|
+
declare function measureBitmapSharpness(bitmap: ImageBitmap, region: StillRegion | null): number;
|
|
461
|
+
|
|
462
|
+
export { type AcceptedDocumentsLike, type BrowserFamily, DOCUMENT_TYPE_ORDER, DocAssistReport, DocCatalogEntry, type DocumentTypeId, type ExecuteTurnstileOptions, HostedClientLike, LiveMrzTuning, type LiveMrzWireReport, LoadFailure, MRZ_BAND_DEFAULTS, type MrzBand, type MrzBandThresholds, OCR_ASSET_SET, OTP_RESEND_COOLDOWN_MS, OcrEngineClient, PROCESSING_BACKOFF_MS, REGION_PAD, RETRYABLE_REASONS, ReadyInfo, type RunnerDeps, SHARPNESS_LONG_EDGE, type StepRunner, type StillRegion, SubmitRuntime, TURNSTILE_EXECUTE_TIMEOUT_MS, TURNSTILE_SCRIPT_SRC, TextLockTuning, type TurnstileApi, type TurnstileRenderParams, WEB_OCR_ENGINE, type WebOcrPlan, type WebOcrStart, acceptedIssuers, acceptedTypesFor, browserFamily, classifyCardSide, classifyCardSideWith, createStepRunner, cropImage, detectMrzBand, executeTurnstile, flagOf, formatMismatch, frontierStep, isExecutable, isTerminalView, liveMrzWireReport, loadTurnstile, mapSessionResult, measureBitmapSharpness, measureRegionSharpness, photoSharpness, resetTurnstileForTests, resizeLongEdge, resolveAcceptedDocuments, resolveWebOcrPlan, startWebOcr, stepOf, stillRegionOf, stillToImageData };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as _e,d as Le,e as Re,g as Se,h as Te,i as ce}from"../chunk-WKJJEPWA.js";import{a as Bt,b as wt,c as zt,d as Vt,e as Xt,f as Zt,g as Jt,h as Qt,i as jt,j as ae,l as se,n as Ee,o as me}from"../chunk-SEC64KZ3.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,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-UGMHAFEY.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-FFDB6LQN.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 dt,b as Mt,c as Ft,d as Nt,e as vt,f as gt,g as bt,h as Gt,i as ht,j as Ut,k as Yt,l as Ht,m as Wt}from"../chunk-7ZCZY3ZP.js";import{a as kt,b as Kt}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 qt,i as $t,j as er,k as tr,l as rr,m as or,s as Ie}from"../chunk-3MSUJYBO.js";import{b as S,h as T,i as c,j as l,k as y,m as f,o as u,p as O,q as A,r as I,s as x,t as C,u as P,v as D}from"../chunk-XR64UFLK.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-ETY6SAAZ.js";import"../chunk-HAO6EQTH.js";import"../chunk-SZ7YGNUZ.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-FHJ7HO3M.js";import"../chunk-FPXL63KZ.js";import"../chunk-HWAXEQD5.js";import"../chunk-BAGSM67V.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,Dt as CAPTURE_CANDIDATE_SPACING_MS,Pt as CAPTURE_EXTRA_CANDIDATES,p as CENTERED_FACTOR,r as CIRCLE_RADIUS_FACTOR,Bt as CLIPPED_LUMA,u as CLIP_MIME_ALLOWLIST,xt as CaptureSessionDoc,$t as DOCUMENT_TYPE_ORDER,Je as DOC_ANALYSIS_DEFAULTS,Ot as DOC_CADENCE_HZ,$e as DOC_CAMERA_TUNING_DEFAULTS,de as DOC_CATALOG,Be as DOC_DETECT_WIDTH,We as DOC_FEEDBACK_STATES,we as DOC_GATE_V1_DEFAULTS,At 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,Nt as ICAO_CANVAS,kt as ICAO_FALLBACK,Gt as ICAO_GATE_CRITERIA,wt as ICAO_SHARP_REF,I as INFERENCE_RETRY_ATTEMPTS,x as INFERENCE_RETRY_DEFAULT_S,o as IN_CIRCLE_FACTOR,qt 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,tr as acceptedIssuers,er as acceptedTypesFor,qe as analyzeDocFrame,Tt as analyzeGuide,Ce as aspectBand,Pe as aspectFits,Jt as backgroundStats,$ as browserFamily,Z as buildDeviceReadHint,B as classifyCardSide,K as classifyCardSideWith,st as coverPointToVideo,oe as createDocumentCaptureInternal,ne as createFaceLandmarker,Wt 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,Ft as eyeLineRoll,Ut as eyeOpenness,Zt as eyeSpecular,dt as faceGeometry,Xt as faceLighting,Qt as faceSharpness,ie as facesOf,ke as feedbackVoteOf,or as flagOf,mt as focusOk,te as formatMismatch,l as frontierStep,ct as guideQuad,St as guideRegionInFrame,jt as icaoPixelStats,vt 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,Ct as passportBandOf,Yt as percentile,b as photoSharpness,bt as portraitCropRegion,Ie as portraitMatchStep,Mt 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,Vt as regionStats,s as resetLivenessAssetsForTests,F as resetTurnstileForTests,Y as resizeLongEdge,rr as resolveAcceptedDocuments,et as resolveDocCameraTuning,It as resolveDocShutterTuning,yt as resolveGuideLockTuning,Kt as resolveIcaoTuning,j as resolveWebOcrPlan,D as runLivenessFlow,P as runSubmission,Me as scannerFormatFor,Ht 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,gt as windowOverflow,it as writeStoredLens};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var C=4,P=600,k=.5,W=30,A={frontal:.1,eyes:.1,score:.05},_=e=>e<0?0:e>1?1:e;function w(e){let r=e.eyes;if(r===void 0)return{frontal:1,yaw:null,roll:null};let a=r.right.x-r.left.x,n=r.right.y-r.left.y,t=a*a+n*n;if(t===0)return{frontal:1,yaw:null,roll:null};let s=Math.abs(Math.atan2(n,Math.abs(a))*180/Math.PI),u=_(1-s/30),o=null,l=e.nose;if(l!==void 0){let m=(r.left.x+r.right.x)/2,f=(r.left.y+r.right.y)/2;o=Math.abs(((l.x-m)*a+(l.y-f)*n)/t),u*=_(1-o/.5)}return{frontal:u,yaw:o,roll:s}}function F(e,r){return e===null?{face:!1,frontal:0,yaw:null,roll:null,eyes:null,score:0,sharpness:r}:{face:!0,...w(e),eyes:null,score:e.score,sharpness:r}}function v(e){let r=e.map((t,s)=>s),a=(t,s)=>{let u=Number.NEGATIVE_INFINITY;for(let o of r)u=Math.max(u,t(e[o]));r=r.filter(o=>t(e[o])>=u-s)};a(t=>t.frontal,A.frontal),a(t=>t.eyes??1,A.eyes),a(t=>t.score,A.score);let n=-1;for(let t of r)(n===-1||e[t].sharpness>e[n].sharpness)&&(n=t);return n}var i=e=>Number.isFinite(e)?Math.round(e*1e3)/1e3:0,D=99,S=999999;function T(e){return{face:e.face,frontal:i(e.frontal),...e.yaw!==null?{yaw:Math.min(i(e.yaw),D)}:{},...e.roll!==null?{roll:i(e.roll)}:{},...e.eyes!==null?{eyes:i(e.eyes)}:{},score:i(e.score),sharpness:Math.min(i(e.sharpness),S)}}var g=I;async function I(e,r){let{options:a}=e,n=a.video,t=a.now??(()=>performance.now()),s=a.captureKeyframe??(c=>e.defaultKeyframe(c)),u=600/3,o=[],l=[],m=0;for(let c=0;c<4;c+=1){if(r!==e.attempt)return null;let d=e.detector,E=Promise.resolve(null),p,y=0;try{if(d!==null){let b=e.profiler?.profile.inputWidth??160,R=a.makeSnapshot?.(n,b)??e.defaultSnapshot(n,b);p=s(n).then(K=>(y=t(),K));let N=t();E=d.detect(R,n.videoWidth,n.videoHeight).then(K=>(m+=t()-N,K),()=>null)}else p=s(n).then(b=>(y=t(),b));let[h,O]=await Promise.all([p,E]);o.push(h),l.push(F(O,h.sharpness))}catch{p?.catch(()=>{})}let M=y>0?Math.max(0,t()-y):0;c<3&&await new Promise(h=>setTimeout(h,Math.max(0,u-M)))}if(r!==e.attempt)return null;let f=v(l);if(f===-1)return null;let x=0;l.forEach((c,d)=>{c.sharpness>l[x].sharpness&&(x=d)});try{a.telemetry?.({type:"keyframe",tier:e.detector?.tier??null,chosen:f,sharpest:x,detectMs:Math.round(m),candidates:l.map(T)})}catch{}return o[f]??null}export{C as RANK_CANDIDATES,A as RANK_TOLERANCE,P as RANK_WINDOW_MS,W as ROLL_ZERO_DEG,S as SHARPNESS_REPORT_MAX,D as YAW_REPORT_MAX,k as YAW_ZERO_IOD,I as collectRankedKeyframes,g as default,F as featuresOf,w as frontalOf,v as rankKeyframes};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-CJHMFPL6.js";export{a as LANDMARKER_INIT_TIMEOUT_MS,b as LANDMARKER_MODEL,d as createFaceLandmarker,c as facesOf};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,b}from"./chunk-SMKCBUJL.js";export{a as MRZ_BAND_DEFAULTS,b as detectMrzBand};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{e as _}from"./chunk-A3FUGHAH.js";import{a as O,b as B,e as F,f as w,i as U}from"./chunk-WKJJEPWA.js";import{o as A}from"./chunk-SEC64KZ3.js";import"./chunk-CJHMFPL6.js";import"./chunk-RI3E7GBN.js";import{A as T,F as x,i as L}from"./chunk-UGMHAFEY.js";import"./chunk-SMKCBUJL.js";import"./chunk-MXWLCDFX.js";import{x as V}from"./chunk-FFDB6LQN.js";import"./chunk-G6LKLN4U.js";import"./chunk-TDLIXFDT.js";import"./chunk-7ZCZY3ZP.js";import"./chunk-BPE5NSQ2.js";import"./chunk-GI3UFGRQ.js";import{a as M,n as I}from"./chunk-XR64UFLK.js";import"./chunk-ETY6SAAZ.js";import"./chunk-HAO6EQTH.js";import"./chunk-SZ7YGNUZ.js";import"./chunk-FUHDOEBP.js";import"./chunk-POIQGEZM.js";import"./chunk-FHJ7HO3M.js";import"./chunk-FPXL63KZ.js";import{g as H}from"./chunk-HWAXEQD5.js";import"./chunk-BAGSM67V.js";import"./chunk-OKWG3PVH.js";import"./chunk-DFTCAWMP.js";import"./chunk-DK5YPBDQ.js";function K(e){let a=null,c=Promise.resolve(),u=!1,g=null,y=null,C=null,h=!1,m=()=>{a?.controller.handle.destroy(),a=null},k=()=>{let i=e.currentView(),s=i===null?null:w(i,{isMobile:e.isMobile()});return s?.kind==="portrait"?s:null},P=async(i,s)=>{if(e.destroyed())return;s.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}s.setFlowState("checking");let l={media:{portrait:d},gate:H(i.gate),...i.tuningVersion!==void 0?{tuningVersion:i.tuningVersion}:{}};return n.submitCheck("portrait_icao",l,{idempotencyKey:r})},()=>{g=d})}catch{u=!0}if(s.setFlowState("done"),e.destroyed())return;let t=k();(t===null||t.phase!=="capture")&&a?.controller===s&&m(),e.runner().republish()},b=i=>e.runner().submit("face_match",(s,d)=>s.submitCheck("face_match",g!==null?{imageKey:g}:{},{idempotencyKey:d})).then(()=>{},()=>{u=!0,i()});return{bind:(i,s)=>{if(i.phase==="match")return m(),y!==i.attemptsRemaining&&!u&&(y=i.attemptsRemaining,b(s)),{...i,uploadFailed:u,resubmit:()=>(u=!1,y=i.attemptsRemaining,s(),b(s)),capture:()=>{throw new Error("the portrait was already accepted")}};y=null;let d=e.keptPortraitInput?.()??null;return d!==null&&(h||d!==C&&i.report===null&&i.reason===void 0&&!i.retakeOnly)?(h||(C=d,h=!0,e.runner().submit("portrait_icao",(t,n)=>t.submitCheck("portrait_icao",d,{idempotencyKey:n}),()=>{g=d.media.portrait}).catch(()=>{}).finally(()=>{h=!1,s()})),{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":M(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},body:JSON.stringify({reports:g}),keepalive:!0}).catch(()=>{})}catch{}}}function E(e){let a=e.apiOrigin;return _("sdk",typeof a=="string"&&/staging|sandbox|localhost/.test(a)?"sandbox":"live")}function ue(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,l,p=!1;try{await a.submit("doc_ocr",async(S,z)=>{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"),l===void 0&&(l=n.takeDeviceRead(t)),S.submitCheck("doc_ocr",{imageKey:r,side:t.side,...l!==null?{deviceRead:l}:{}},{idempotencyKey:z})})}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"})},h=(t,n)=>({...t,issuer:c?.issuer??null,documentType:c?.documentType??null,captureSide:c===null?null:c.documentType==="passport"?"single":t.side,selectDocument:(r,l)=>{if(!B(t.documents).includes(r)||!O(t.documents,r).includes(l))throw new RangeError(`${l} from ${r} is not accepted`);(c?.issuer!==r||c.documentType!==l)&&y(),c={issuer:r,documentType:l},n()},capture:r=>{if(c===null)throw new Error("selectDocument() first");if(u!==null&&u.video===r.video)return u.flow.handle;y();let l=c,p=l.documentType==="passport"?"single":t.acceptedSides.length>0?t.side:void 0,v=V({video:r.video,documentType:l.documentType,issuer:l.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:L(o?.camera),shutter:x(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:E(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,k=null,P=new Set,b=e.runtime.client;e.runtime.client=new Proxy(b,{get(t,n){if(n==="submitCheck")return(k??t).submitCheck.bind(k??t);let r=Reflect.get(t,n);return typeof r=="function"?r.bind(t):r}});let D=()=>{m?.destroy(),m=null,k=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,k=o.decorate(b),o.onGate(f=>{for(let S of P)S(f)})}let l=m,p=e.baseCapture??{},v=p.engineOptions?.telemetry;return{...p,engineOptions:{...p.engineOptions??{},measureQuality:l.engineOptions.measureQuality,telemetry:o=>{v?.(o),l.engineOptions.telemetry(o)}}}},s=K({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:h,bindPortrait:s.bind,onLivePhoto:t=>(P.add(t),()=>P.delete(t))});return a=d,{...d,captureInternals:i,destroy:()=>{y(),s.destroy(),D(),P.clear()}}}export{ue as createPlanRunner,E as sdkAssetBase};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var a=Object.getOwnPropertyDescriptor;var E=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var f=(n,e)=>{for(var t in e)s(n,t,{get:e[t],enumerable:!0})},y=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of E(e))!l.call(n,o)&&o!==t&&s(n,o,{get:()=>e[o],enumerable:!(r=a(e,o))||r.enumerable});return n};var k=n=>y(s({},"__esModule",{value:!0}),n);var m={};f(m,{SEKYRO_EVENTS:()=>i,open:()=>p,openHosted:()=>x});module.exports=k(m);var i=["session.completed","session.failed","session.review_pending","session.expired","session.cancelled"],S="sekyro-verify",g="width=480,height=720,noopener=false",w=new Set(i);function O(n){if(n===null||typeof n!="object")return!1;let e=n;return e.source==="sekyro"&&e.version===1&&typeof e.sessionId=="string"&&typeof e.event=="string"&&w.has(e.event)}function p(n){let e=new URL(n.hostedUrl).origin,t=window.open(n.hostedUrl,S,g);if(!t)return{error:"popup_blocked"};let r=o=>{if(o.source!==t||o.origin!==e||!O(o.data))return;let{source:d,version:c,event:v,sessionId:u}=o.data;n.onEvent({source:d,version:c,event:v,sessionId:u})};return window.addEventListener("message",r),{close(){window.removeEventListener("message",r),t.close()}}}function x(n,e){return e.mode==="redirect"?(window.location.assign(n),{close(){}}):p({hostedUrl:n,onEvent:e.onEvent??(()=>{})})}0&&(module.exports={SEKYRO_EVENTS,open,openHosted});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/** The frozen SDK event-name vocabulary, in catalog order. */
|
|
2
|
+
declare const SEKYRO_EVENTS: readonly ["session.completed", "session.failed", "session.review_pending", "session.expired", "session.cancelled"];
|
|
3
|
+
/** One SDK event name — webhook-catalog terminal names + `session.cancelled`. */
|
|
4
|
+
type SekyroEventName = (typeof SEKYRO_EVENTS)[number];
|
|
5
|
+
/** The frozen postMessage payload: event name + sessionId ONLY. */
|
|
6
|
+
interface SekyroEvent {
|
|
7
|
+
source: "sekyro";
|
|
8
|
+
version: 1;
|
|
9
|
+
event: SekyroEventName;
|
|
10
|
+
sessionId: string;
|
|
11
|
+
}
|
|
12
|
+
interface OpenOptions {
|
|
13
|
+
/** The `hosted_url` returned by `POST /api/v2/sessions` (create result). */
|
|
14
|
+
hostedUrl: string;
|
|
15
|
+
/** Called for every allowlist-validated event posted by the hosted page. */
|
|
16
|
+
onEvent: (event: SekyroEvent) => void;
|
|
17
|
+
}
|
|
18
|
+
/** Live popup handle — `close()` detaches the listener and closes the window. */
|
|
19
|
+
interface PopupHandle {
|
|
20
|
+
close(): void;
|
|
21
|
+
}
|
|
22
|
+
/** `window.open` returned null: blocked by the browser (or a popup blocker). */
|
|
23
|
+
interface PopupBlocked {
|
|
24
|
+
error: "popup_blocked";
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Open the hosted verification flow in a popup and subscribe to its lifecycle
|
|
28
|
+
* events. Incoming messages are dropped unless ALL hold:
|
|
29
|
+
* - the sender window (`ev.source`) is THIS popup — closes the spoof path of
|
|
30
|
+
* a same-origin iframe/window posting on the hosted origin's behalf
|
|
31
|
+
* (`ev.source` is identity-stable across popup navigations);
|
|
32
|
+
* - the sender origin is exactly the hosted URL's origin;
|
|
33
|
+
* - the payload matches the frozen {@link SekyroEvent} shape (allowlisted
|
|
34
|
+
* event name, string sessionId).
|
|
35
|
+
*
|
|
36
|
+
* Returns `{error: 'popup_blocked'}` when the browser refuses the popup —
|
|
37
|
+
* callers should fall back to a full redirect to `hostedUrl`.
|
|
38
|
+
*
|
|
39
|
+
* Usage notes:
|
|
40
|
+
* - ONE active popup per page: the window name is shared and every `open()`
|
|
41
|
+
* installs a fresh listener, so `close()` the previous handle before
|
|
42
|
+
* reopening (a reused named window would otherwise feed stale listeners).
|
|
43
|
+
* - Events are at-least-once HINTS, not a system of record: a popup reload
|
|
44
|
+
* mid-flow fires `session.cancelled`, and a reload after a terminal state
|
|
45
|
+
* re-posts the terminal event — partners MUST confirm outcomes server-side
|
|
46
|
+
* via webhooks or the sessions API.
|
|
47
|
+
* - The popup `features` geometry is currently fixed ({@link WINDOW_FEATURES});
|
|
48
|
+
* an options field for it is reserved for a later version.
|
|
49
|
+
*/
|
|
50
|
+
declare function open(opts: OpenOptions): PopupHandle | PopupBlocked;
|
|
51
|
+
interface OpenHostedOptions {
|
|
52
|
+
/** `'popup'` opens a named window (the `open()` embed); `'redirect'` navigates this tab. */
|
|
53
|
+
mode: "popup" | "redirect";
|
|
54
|
+
/** Popup mode only — redirect mode never returns to this page. */
|
|
55
|
+
onEvent?: (event: SekyroEvent) => void;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Spec §3.1 entry: `openHosted(hostedUrl, { mode, onEvent })`. Popup mode is
|
|
59
|
+
* the `open()` embed; a blocked popup returns `{error: 'popup_blocked'}` so the
|
|
60
|
+
* caller can fall back to `mode: 'redirect'` (never done implicitly — leaving
|
|
61
|
+
* the partner page is their call). Redirect mode navigates and returns a
|
|
62
|
+
* no-op handle.
|
|
63
|
+
*/
|
|
64
|
+
declare function openHosted(hostedUrl: string, opts: OpenHostedOptions): PopupHandle | PopupBlocked;
|
|
65
|
+
|
|
66
|
+
export { type OpenHostedOptions, type OpenOptions, type PopupBlocked, type PopupHandle, SEKYRO_EVENTS, type SekyroEvent, type SekyroEventName, open, openHosted };
|