@sekyro/web 0.1.0-rc.4 → 0.1.0-rc.40
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 +491 -0
- package/LICENSE +25 -16
- package/README.md +158 -62
- package/THIRD-PARTY-NOTICES.txt +154 -0
- package/dist/assets.generated-DpkbvoII.d.cts +249 -0
- package/dist/assets.generated-DpkbvoII.d.ts +249 -0
- package/dist/background-monitor-A7FKJOAG.js +1 -0
- package/dist/barcode-detect-C5IOXMKI.js +1 -0
- package/dist/camera-trait-DELAK3YN.js +1 -0
- package/dist/capture-constraints-CVqpMNGA.d.cts +48 -0
- package/dist/capture-constraints-CVqpMNGA.d.ts +48 -0
- package/dist/capture-session-doc-DFLSX6BB.js +1 -0
- package/dist/{capture-session-v3-uXJr1Wlm.d.ts → capture-session-v3-C-9FB_vX.d.cts} +232 -13
- package/dist/{capture-session-v3-DEInCOUg.d.cts → capture-session-v3-DEpGJ_fI.d.ts} +232 -13
- package/dist/challenge-frame-YBTLAQ5G.js +1 -0
- package/dist/chunk-22AW4NJD.js +1 -0
- package/dist/chunk-33KKMPJ5.js +1 -0
- package/dist/chunk-3WQJI7UL.js +1 -0
- package/dist/chunk-4NO6MQPH.js +1 -0
- package/dist/chunk-53POX7U4.js +1 -0
- package/dist/chunk-7QZWBDI5.js +1 -0
- package/dist/chunk-BD4KIQQD.js +1 -0
- package/dist/chunk-BPAGOPYL.js +1 -0
- package/dist/chunk-BRLQIJYF.js +1 -0
- package/dist/chunk-CJHMFPL6.js +1 -0
- package/dist/chunk-CPUECYAJ.js +1 -0
- package/dist/chunk-FPXL63KZ.js +1 -0
- package/dist/chunk-FSSMUAKC.js +1 -0
- package/dist/chunk-FYU7J2DC.js +1 -0
- package/dist/chunk-GFJATPUR.js +1 -0
- package/dist/chunk-GI3UFGRQ.js +1 -0
- package/dist/chunk-JLVZ35QK.js +2 -0
- package/dist/chunk-L3TNFMQK.js +1 -0
- package/dist/chunk-M3637QGB.js +1 -0
- package/dist/chunk-MQHTFHSN.js +1 -0
- package/dist/chunk-POIQGEZM.js +1 -0
- package/dist/chunk-QB62OPX5.js +1 -0
- package/dist/chunk-QZUFICG3.js +1 -0
- package/dist/chunk-RI3E7GBN.js +1 -0
- package/dist/chunk-SJ5OJ677.js +1 -0
- package/dist/chunk-SMKCBUJL.js +1 -0
- package/dist/chunk-SX7TUC3V.js +1 -0
- package/dist/chunk-TSA6GHUG.js +1 -0
- package/dist/chunk-U5TL63CG.js +1 -0
- package/dist/chunk-VSLJZ7GH.js +1 -0
- package/dist/chunk-VWGKUQ3C.js +1 -0
- package/dist/chunk-W357WDNU.js +1 -0
- package/dist/chunk-WNBEOK5Q.js +1 -0
- package/dist/chunk-Y5GRT27C.js +3 -0
- package/dist/chunk-ZVD6VHM2.js +1 -0
- package/dist/client/index.cjs +1 -357
- package/dist/client/index.d.cts +6 -37
- package/dist/client/index.d.ts +6 -37
- package/dist/client/index.js +1 -15
- package/dist/clip-inspect-DLJXVKV6.js +1 -0
- package/dist/core/index.cjs +1 -1634
- package/dist/core/index.d.cts +5 -4
- package/dist/core/index.d.ts +5 -4
- package/dist/core/index.js +1 -139
- package/dist/core/ocr/worker.bundle.js +41 -0
- package/dist/core/ocr/worker.cjs +41 -0
- package/dist/core/ocr/worker.d.cts +97 -0
- package/dist/core/ocr/worker.d.ts +97 -0
- package/dist/core/ocr/worker.js +40 -0
- package/dist/core/v3/detect-worker.cjs +1 -392
- package/dist/core/v3/detect-worker.d.cts +1 -1
- package/dist/core/v3/detect-worker.d.ts +1 -1
- package/dist/core/v3/detect-worker.js +1 -13
- package/dist/create-document-capture-4ZOSBL3Y.js +1 -0
- package/dist/create-portrait-capture-5VGYZUOK.js +1 -0
- package/dist/create-verification-B8c9xBnz.d.ts +3871 -0
- package/dist/create-verification-BadlGBh3.d.cts +3871 -0
- package/dist/{detect-worker-CKXHlXx9.d.ts → detect-worker-CHqsPJoM.d.cts} +25 -2
- package/dist/{detect-worker-CKXHlXx9.d.cts → detect-worker-CHqsPJoM.d.ts} +25 -2
- package/dist/detector-scanic-P2RTEQUV.js +1 -0
- package/dist/icao-gate-BqXxEAq6.d.cts +610 -0
- package/dist/icao-gate-C7D7Lce7.d.ts +610 -0
- package/dist/icao-gate-T3BTOKFJ.js +1 -0
- package/dist/icao-policy-Bo7TQyTd.d.ts +80 -0
- package/dist/icao-policy-CgSI4oFo.d.cts +80 -0
- package/dist/icao-tuning-4ETMF53W.js +1 -0
- package/dist/index.cjs +3 -2698
- package/dist/index.d.cts +138 -5
- package/dist/index.d.ts +138 -5
- package/dist/index.js +1 -28
- package/dist/internal/index.cjs +3 -4228
- package/dist/internal/index.d.cts +306 -371
- package/dist/internal/index.d.ts +306 -371
- package/dist/internal/index.js +1 -647
- 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-3BLEJWHF.js +1 -0
- package/dist/popup/index.cjs +1 -76
- package/dist/popup/index.d.cts +9 -3
- package/dist/popup/index.d.ts +9 -3
- package/dist/popup/index.js +1 -11
- package/dist/print-DCYX3CZD.js +1 -0
- package/dist/scanic-ml-stub-KW7IZHUT.js +1 -0
- package/dist/segmenter-USLNBX65.js +1 -0
- package/dist/types-BAAj6TOZ.d.cts +2230 -0
- package/dist/types-BAAj6TOZ.d.ts +2230 -0
- package/dist/upload-file-EGXXM6TQ.js +1 -0
- package/package.json +30 -11
- package/sbom.cdx.json +349 -0
- package/dist/capture-constraints-BujkZcfb.d.cts +0 -21
- package/dist/capture-constraints-BujkZcfb.d.ts +0 -21
- package/dist/chunk-EWRNPKTR.js +0 -1123
- package/dist/chunk-EWRNPKTR.js.map +0 -1
- package/dist/chunk-MWNFSNMP.js +0 -52
- package/dist/chunk-MWNFSNMP.js.map +0 -1
- package/dist/chunk-NILNKLK6.js +0 -50
- package/dist/chunk-NILNKLK6.js.map +0 -1
- package/dist/chunk-NWF46H7K.js +0 -359
- package/dist/chunk-NWF46H7K.js.map +0 -1
- package/dist/chunk-TBANUT3X.js +0 -885
- package/dist/chunk-TBANUT3X.js.map +0 -1
- package/dist/chunk-WY6U7AIK.js +0 -193
- package/dist/chunk-WY6U7AIK.js.map +0 -1
- package/dist/chunk-YVFF4Q4G.js +0 -327
- package/dist/chunk-YVFF4Q4G.js.map +0 -1
- package/dist/client/index.cjs.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/v3/detect-worker.cjs.map +0 -1
- package/dist/core/v3/detect-worker.js.map +0 -1
- package/dist/create-verification-Ce1y5kJR.d.ts +0 -371
- package/dist/create-verification-Dkb2tXuY.d.cts +0 -371
- package/dist/detector-scanic-4C6IEW2K.js +0 -787
- package/dist/detector-scanic-4C6IEW2K.js.map +0 -1
- package/dist/hosted-client-DWzCRYJK.d.cts +0 -421
- package/dist/hosted-client-DWzCRYJK.d.ts +0 -421
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal/index.cjs.map +0 -1
- package/dist/internal/index.js.map +0 -1
- package/dist/popup/index.cjs.map +0 -1
- package/dist/popup/index.js.map +0 -1
- package/dist/scanic-ml-stub-S2OZ6HEF.js +0 -10
- package/dist/scanic-ml-stub-S2OZ6HEF.js.map +0 -1
package/dist/core/index.d.cts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { C as CameraErrorKind } from '../capture-session-v3-
|
|
2
|
-
export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as
|
|
3
|
-
export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, I as IN_CIRCLE_FACTOR, b as buildCaptureConstraints, d as detectIsMobile } from '../capture-constraints-
|
|
4
|
-
export { C as CreateDetectorOptions, D as DEFAULT_TIER_ORDER, a as DEFAULT_V3_ASSET_BASE_URL, b as Detector, c as DetectorLadderError, F as FaceObservation, d as createDetector, i as intrinsicSize, t as toStreamPixels } from '../detect-worker-
|
|
1
|
+
import { C as CameraErrorKind } from '../capture-session-v3-C-9FB_vX.cjs';
|
|
2
|
+
export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipRecorderOptions, o as ClipResult, D as DEFAULT_CLIP_MIME, p as DEVICE_PROFILES, q as DeviceClass, r as DeviceProbe, s as DeviceProfile, t as DeviceProfiler, E as ENCODER_TAIL_MS, u as EscalationClipArtifact, v as EscalationHook, F as FRAME_POLL_MS, w as FaceGateV3, x as FrameClock, G as GATE_SNAPSHOT_MS, y as GateBlockEntry, z as GateBlockReason, A as GateBlockStats, B as GateBlockSummary, H as GateChecks, I as HOLD_UPRIGHT_KEY, J as INSPECT_WAIT_MS, K as KEYFRAME_CANDIDATES, L as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, N as MAX_OVERRUN_MS, O as MIME_CANDIDATES, P as PROVENANCE_WAIT_MS, S as SHORT_CLIP_TOLERANCE_MS, Q as STOP_GRACE_MS, T as TIMESLICE_MS, U as UPRIGHT_WATCH_MS, V as V3ChecksPayload, R as V3GateFactor, W as V3GateQuality, X as V3GateThresholds, Y as V3GateTick, Z as V3GateTickInput, _ as V3TelemetryEvent, $ as V3_GATE_DEFAULTS, a0 as VIDEO_BPS, a1 as betterTake, a2 as blockReasonOf, a3 as buildLivenessV2FormData, a4 as cameraPreflight, a5 as classifyDevice, a6 as extForMime, a7 as isClipTooLarge, a8 as isMediaRecorderSupported, a9 as mapGetUserMediaError, aa as needsRetake, ab as pickMimeType, ac as probeDevice } from '../capture-session-v3-C-9FB_vX.cjs';
|
|
3
|
+
export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, P as PHONE_MAX_SHORT_SIDE, b as buildCaptureConstraints, d as detectFormFactor, c as detectIsMobile, t as trackFacingMode } from '../capture-constraints-CVqpMNGA.cjs';
|
|
4
|
+
export { C as CreateDetectorOptions, D as DEFAULT_TIER_ORDER, a as DEFAULT_V3_ASSET_BASE_URL, b as Detector, c as DetectorLadderError, F as FaceObservation, S as SECOND_FACE_AREA_RATIO, d as countExtraFaces, e as createDetector, i as intrinsicSize, t as toStreamPixels } from '../detect-worker-CHqsPJoM.cjs';
|
|
5
|
+
import '../types-BAAj6TOZ.cjs';
|
|
5
6
|
|
|
6
7
|
declare function captureMirroredKeyframe(video: HTMLVideoElement, canvas: HTMLCanvasElement, quality?: number): Promise<Blob>;
|
|
7
8
|
|
package/dist/core/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { C as CameraErrorKind } from '../capture-session-v3-
|
|
2
|
-
export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as
|
|
3
|
-
export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, I as IN_CIRCLE_FACTOR, b as buildCaptureConstraints, d as detectIsMobile } from '../capture-constraints-
|
|
4
|
-
export { C as CreateDetectorOptions, D as DEFAULT_TIER_ORDER, a as DEFAULT_V3_ASSET_BASE_URL, b as Detector, c as DetectorLadderError, F as FaceObservation, d as createDetector, i as intrinsicSize, t as toStreamPixels } from '../detect-worker-
|
|
1
|
+
import { C as CameraErrorKind } from '../capture-session-v3-DEpGJ_fI.js';
|
|
2
|
+
export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipRecorderOptions, o as ClipResult, D as DEFAULT_CLIP_MIME, p as DEVICE_PROFILES, q as DeviceClass, r as DeviceProbe, s as DeviceProfile, t as DeviceProfiler, E as ENCODER_TAIL_MS, u as EscalationClipArtifact, v as EscalationHook, F as FRAME_POLL_MS, w as FaceGateV3, x as FrameClock, G as GATE_SNAPSHOT_MS, y as GateBlockEntry, z as GateBlockReason, A as GateBlockStats, B as GateBlockSummary, H as GateChecks, I as HOLD_UPRIGHT_KEY, J as INSPECT_WAIT_MS, K as KEYFRAME_CANDIDATES, L as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, N as MAX_OVERRUN_MS, O as MIME_CANDIDATES, P as PROVENANCE_WAIT_MS, S as SHORT_CLIP_TOLERANCE_MS, Q as STOP_GRACE_MS, T as TIMESLICE_MS, U as UPRIGHT_WATCH_MS, V as V3ChecksPayload, R as V3GateFactor, W as V3GateQuality, X as V3GateThresholds, Y as V3GateTick, Z as V3GateTickInput, _ as V3TelemetryEvent, $ as V3_GATE_DEFAULTS, a0 as VIDEO_BPS, a1 as betterTake, a2 as blockReasonOf, a3 as buildLivenessV2FormData, a4 as cameraPreflight, a5 as classifyDevice, a6 as extForMime, a7 as isClipTooLarge, a8 as isMediaRecorderSupported, a9 as mapGetUserMediaError, aa as needsRetake, ab as pickMimeType, ac as probeDevice } from '../capture-session-v3-DEpGJ_fI.js';
|
|
3
|
+
export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, F as FormFactor, I as IN_CIRCLE_FACTOR, P as PHONE_MAX_SHORT_SIDE, b as buildCaptureConstraints, d as detectFormFactor, c as detectIsMobile, t as trackFacingMode } from '../capture-constraints-CVqpMNGA.js';
|
|
4
|
+
export { C as CreateDetectorOptions, D as DEFAULT_TIER_ORDER, a as DEFAULT_V3_ASSET_BASE_URL, b as Detector, c as DetectorLadderError, F as FaceObservation, S as SECOND_FACE_AREA_RATIO, d as countExtraFaces, e as createDetector, i as intrinsicSize, t as toStreamPixels } from '../detect-worker-CHqsPJoM.js';
|
|
5
|
+
import '../types-BAAj6TOZ.js';
|
|
5
6
|
|
|
6
7
|
declare function captureMirroredKeyframe(video: HTMLVideoElement, canvas: HTMLCanvasElement, quality?: number): Promise<Blob>;
|
|
7
8
|
|
package/dist/core/index.js
CHANGED
|
@@ -1,139 +1 @@
|
|
|
1
|
-
import {
|
|
2
|
-
CENTERED_FACTOR,
|
|
3
|
-
CIRCLE_RADIUS_FACTOR,
|
|
4
|
-
CLIP_MS,
|
|
5
|
-
CaptureSessionV3,
|
|
6
|
-
ClipError,
|
|
7
|
-
ClipRecorder,
|
|
8
|
-
DEFAULT_CLIP_MIME,
|
|
9
|
-
DEVICE_PROFILES,
|
|
10
|
-
DetectScheduler,
|
|
11
|
-
DeviceProfiler,
|
|
12
|
-
FaceGateV3,
|
|
13
|
-
IN_CIRCLE_FACTOR,
|
|
14
|
-
KEYFRAME_CANDIDATES,
|
|
15
|
-
KEYFRAME_WINDOW_MS,
|
|
16
|
-
MAX_CLIP_BYTES,
|
|
17
|
-
MIME_CANDIDATES,
|
|
18
|
-
STOP_GRACE_MS,
|
|
19
|
-
TIMESLICE_MS,
|
|
20
|
-
V3_GATE_DEFAULTS,
|
|
21
|
-
VIDEO_BPS,
|
|
22
|
-
buildCaptureConstraints,
|
|
23
|
-
buildLivenessV2FormData,
|
|
24
|
-
cameraPreflight,
|
|
25
|
-
captureMirroredKeyframe,
|
|
26
|
-
classifyDevice,
|
|
27
|
-
detectIsMobile,
|
|
28
|
-
extForMime,
|
|
29
|
-
isClipTooLarge,
|
|
30
|
-
isMediaRecorderSupported,
|
|
31
|
-
mapGetUserMediaError,
|
|
32
|
-
pickMimeType,
|
|
33
|
-
probeDevice
|
|
34
|
-
} from "../chunk-EWRNPKTR.js";
|
|
35
|
-
import {
|
|
36
|
-
DEFAULT_TIER_ORDER,
|
|
37
|
-
DEFAULT_V3_ASSET_BASE_URL,
|
|
38
|
-
DetectorLadderError,
|
|
39
|
-
createDetector,
|
|
40
|
-
intrinsicSize,
|
|
41
|
-
toStreamPixels
|
|
42
|
-
} from "../chunk-NWF46H7K.js";
|
|
43
|
-
import {
|
|
44
|
-
EXPOSURE_BAND,
|
|
45
|
-
SHARP_REF,
|
|
46
|
-
exposure,
|
|
47
|
-
meanLuma,
|
|
48
|
-
sharpness
|
|
49
|
-
} from "../chunk-MWNFSNMP.js";
|
|
50
|
-
|
|
51
|
-
// src/core/messages.ts
|
|
52
|
-
var errorCopy = {
|
|
53
|
-
permission: {
|
|
54
|
-
key: "fcv2.err.permission",
|
|
55
|
-
fr: "Autorisez la cam\xE9ra dans les r\xE9glages du navigateur (ic\xF4ne cam\xE9ra dans la barre d\u2019adresse), puis r\xE9essayez."
|
|
56
|
-
},
|
|
57
|
-
notfound: {
|
|
58
|
-
key: "fcv2.err.notfound",
|
|
59
|
-
fr: "Aucune cam\xE9ra d\xE9tect\xE9e. Branchez ou activez une cam\xE9ra, puis r\xE9essayez."
|
|
60
|
-
},
|
|
61
|
-
inuse: {
|
|
62
|
-
key: "fcv2.err.inuse",
|
|
63
|
-
fr: "La cam\xE9ra est utilis\xE9e par une autre application. Fermez-la puis r\xE9essayez."
|
|
64
|
-
},
|
|
65
|
-
overconstrained: {
|
|
66
|
-
key: "fcv2.err.overconstrained",
|
|
67
|
-
fr: "La cam\xE9ra ne prend pas en charge les r\xE9glages demand\xE9s. Nouvel essai en cours\u2026"
|
|
68
|
-
},
|
|
69
|
-
insecure: {
|
|
70
|
-
key: "fcv2.err.insecure",
|
|
71
|
-
fr: "La cam\xE9ra n\xE9cessite une connexion s\xE9curis\xE9e (HTTPS). Ouvrez la page en HTTPS."
|
|
72
|
-
},
|
|
73
|
-
unsupported: {
|
|
74
|
-
key: "fcv2.err.unsupported",
|
|
75
|
-
fr: "Votre navigateur ne prend pas en charge l\u2019enregistrement vid\xE9o. Utilisez un navigateur r\xE9cent."
|
|
76
|
-
},
|
|
77
|
-
generic: {
|
|
78
|
-
key: "fcv2.err.generic",
|
|
79
|
-
fr: "Cam\xE9ra indisponible. R\xE9essayez ou contactez le support."
|
|
80
|
-
}
|
|
81
|
-
};
|
|
82
|
-
var uiCopy = {
|
|
83
|
-
recording: { key: "fcv2.recording", fr: "Enregistrement en cours\u2026" },
|
|
84
|
-
uploading: { key: "fcv2.uploading", fr: "Envoi en cours\u2026" },
|
|
85
|
-
clipTooLarge: {
|
|
86
|
-
key: "fcv2.err.cliptoolarge",
|
|
87
|
-
fr: "La vid\xE9o est trop volumineuse. R\xE9essayez dans un endroit mieux \xE9clair\xE9."
|
|
88
|
-
},
|
|
89
|
-
retry: { key: "fcv2.retry", fr: "R\xE9essayer" },
|
|
90
|
-
listen: { key: "fcv2.listen", fr: "\xC9couter" }
|
|
91
|
-
};
|
|
92
|
-
export {
|
|
93
|
-
CENTERED_FACTOR,
|
|
94
|
-
CIRCLE_RADIUS_FACTOR,
|
|
95
|
-
CLIP_MS,
|
|
96
|
-
CaptureSessionV3,
|
|
97
|
-
ClipError,
|
|
98
|
-
ClipRecorder,
|
|
99
|
-
DEFAULT_CLIP_MIME,
|
|
100
|
-
DEFAULT_TIER_ORDER,
|
|
101
|
-
DEFAULT_V3_ASSET_BASE_URL,
|
|
102
|
-
DEVICE_PROFILES,
|
|
103
|
-
DetectScheduler,
|
|
104
|
-
DetectorLadderError,
|
|
105
|
-
DeviceProfiler,
|
|
106
|
-
EXPOSURE_BAND,
|
|
107
|
-
FaceGateV3,
|
|
108
|
-
IN_CIRCLE_FACTOR,
|
|
109
|
-
KEYFRAME_CANDIDATES,
|
|
110
|
-
KEYFRAME_WINDOW_MS,
|
|
111
|
-
MAX_CLIP_BYTES,
|
|
112
|
-
MIME_CANDIDATES,
|
|
113
|
-
SHARP_REF,
|
|
114
|
-
STOP_GRACE_MS,
|
|
115
|
-
TIMESLICE_MS,
|
|
116
|
-
V3_GATE_DEFAULTS,
|
|
117
|
-
VIDEO_BPS,
|
|
118
|
-
buildCaptureConstraints,
|
|
119
|
-
buildLivenessV2FormData,
|
|
120
|
-
cameraPreflight,
|
|
121
|
-
captureMirroredKeyframe,
|
|
122
|
-
classifyDevice,
|
|
123
|
-
createDetector,
|
|
124
|
-
detectIsMobile,
|
|
125
|
-
errorCopy,
|
|
126
|
-
exposure,
|
|
127
|
-
extForMime,
|
|
128
|
-
intrinsicSize,
|
|
129
|
-
isClipTooLarge,
|
|
130
|
-
isMediaRecorderSupported,
|
|
131
|
-
mapGetUserMediaError,
|
|
132
|
-
meanLuma,
|
|
133
|
-
pickMimeType,
|
|
134
|
-
probeDevice,
|
|
135
|
-
sharpness,
|
|
136
|
-
toStreamPixels,
|
|
137
|
-
uiCopy
|
|
138
|
-
};
|
|
139
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import{A as te,b as x,c as k,d as z,e as C,f as L,g as T,h as E,i as R,j as h,k as b,l as A,m as H,n as K,o as P,p as I,q as Y,r as Z,s as _,t as $,u as ee,v as re,w as oe,x as ne,y as ae,z as se}from"../chunk-FYU7J2DC.js";import"../chunk-SX7TUC3V.js";import"../chunk-W357WDNU.js";import{a as q,b as w,c as D,d as G}from"../chunk-POIQGEZM.js";import{a as c,b as p,c as u,d as f,e as m,f as d,g as l,h as v,i as y,j as g}from"../chunk-CPUECYAJ.js";import{a as J,b as M,c as Q,d as W,e as X}from"../chunk-FPXL63KZ.js";import"../chunk-U5TL63CG.js";import{a as e,b as r,c as o,d as n,e as a,f as s,g as t,h as i}from"../chunk-TSA6GHUG.js";import"../chunk-22AW4NJD.js";import{a as S,b as B,c as F,d as N,e as O,f as U,g as V,h as j}from"../chunk-FSSMUAKC.js";var ie={permission:{key:"fcv2.err.permission",fr:"Autorisez la cam\xE9ra dans les r\xE9glages du navigateur (ic\xF4ne cam\xE9ra dans la barre d\u2019adresse), puis r\xE9essayez."},notfound:{key:"fcv2.err.notfound",fr:"Aucune cam\xE9ra d\xE9tect\xE9e. Branchez ou activez une cam\xE9ra, puis r\xE9essayez."},inuse:{key:"fcv2.err.inuse",fr:"La cam\xE9ra est utilis\xE9e par une autre application. Fermez-la puis r\xE9essayez."},overconstrained:{key:"fcv2.err.overconstrained",fr:"La cam\xE9ra ne prend pas en charge les r\xE9glages demand\xE9s. Nouvel essai en cours\u2026"},insecure:{key:"fcv2.err.insecure",fr:"La cam\xE9ra n\xE9cessite une connexion s\xE9curis\xE9e (HTTPS). Ouvrez la page en HTTPS."},unsupported:{key:"fcv2.err.unsupported",fr:"Votre navigateur ne prend pas en charge l\u2019enregistrement vid\xE9o. Utilisez un navigateur r\xE9cent."},generic:{key:"fcv2.err.generic",fr:"Cam\xE9ra indisponible. R\xE9essayez ou contactez le support."}},ce={recording:{key:"fcv2.recording",fr:"Enregistrement en cours\u2026"},uploading:{key:"fcv2.uploading",fr:"Envoi en cours\u2026"},clipTooLarge:{key:"fcv2.err.cliptoolarge",fr:"La vid\xE9o est trop volumineuse. R\xE9essayez dans un endroit mieux \xE9clair\xE9."},retry:{key:"fcv2.retry",fr:"R\xE9essayer"},listen:{key:"fcv2.listen",fr:"\xC9couter"}};export{i as CENTERED_FACTOR,s as CIRCLE_RADIUS_FACTOR,x as CLIP_MS,te as CaptureSessionV3,h as ClipError,K as ClipRecorder,u as DEFAULT_CLIP_MIME,N as DEFAULT_TIER_ORDER,F as DEFAULT_V3_ASSET_BASE_URL,q as DEVICE_PROFILES,I as DetectScheduler,O as DetectorLadderError,G as DeviceProfiler,L as ENCODER_TAIL_MS,M as EXPOSURE_BAND,E as FRAME_POLL_MS,Z as FaceGateV3,ee as GATE_SNAPSHOT_MS,$ as GateBlockStats,re as HOLD_UPRIGHT_KEY,R as INSPECT_WAIT_MS,t as IN_CIRCLE_FACTOR,ne as KEYFRAME_CANDIDATES,ae as KEYFRAME_WINDOW_MS,l as MAX_CLIP_BYTES,T as MAX_OVERRUN_MS,c as MIME_CANDIDATES,r as PHONE_MAX_SHORT_SIDE,se as PROVENANCE_WAIT_MS,S as SECOND_FACE_AREA_RATIO,J as SHARP_REF,b as SHORT_CLIP_TOLERANCE_MS,z as STOP_GRACE_MS,k as TIMESLICE_MS,oe as UPRIGHT_WATCH_MS,Y as V3_GATE_DEFAULTS,C as VIDEO_BPS,H as betterTake,_ as blockReasonOf,e as buildCaptureConstraints,g as buildLivenessV2FormData,m as cameraPreflight,P as captureMirroredKeyframe,D as classifyDevice,B as countExtraFaces,j as createDetector,o as detectFormFactor,n as detectIsMobile,ie as errorCopy,X as exposure,y as extForMime,U as intrinsicSize,v as isClipTooLarge,d as isMediaRecorderSupported,f as mapGetUserMediaError,Q as meanLuma,A as needsRetake,p as pickMimeType,w as probeDevice,W as sharpness,V as toStreamPixels,a as trackFacingMode,ce as uiCopy};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
var k={fp12:"936b9c4ccc4a",engine:"sekyro-ocr-1",precision:"fp32",files:{"sekyro-ocr.wasm":{bytes:3550687,sha256:"00d6b1a4e42da8146e662ab0283b97485397811acc806299046933ce1943fb09",tier:"live",contentType:"application/wasm"},"sekyro-ocr.mjs":{bytes:4270,sha256:"209a78d96ca53344996a0c2300aed4ff8a5c69e142713216975a2840eec08cac",tier:"bundled",contentType:"text/javascript"},"det.param":{bytes:24252,sha256:"c39ba0b1195e8ad37cfc5bdd7acedcfc1d9cb901e7b8eb1c9c4f6e5a66c04eb3",tier:"live",contentType:"text/plain"},"det.bin":{bytes:4685856,sha256:"652bafe366565109a1a5766caf482bc46f01481f8044d3a785bd9a1be67c63bb",tier:"live",contentType:"application/octet-stream"},"mrz-rec.param":{bytes:3510,sha256:"bc69b1b9683e35f6605b21001fadeb81468063459c00c0fc83c67c139f23df01",tier:"live",contentType:"text/plain"},"mrz-rec.bin":{bytes:494196,sha256:"de93a2aa2f08670cc7dedd17ba378d2f5d7cf6ae409054a9eac863a02c2febae",tier:"live",contentType:"application/octet-stream"},"mrz_dict.txt":{bytes:73,sha256:"b19858a4de2ccbbbdd4b53982188ea2c7664013183bbd1ae9d20ab52c661f97f",tier:"live",contentType:"text/plain"},"v5-latin-fp16.param":{bytes:19800,sha256:"843964335e9863681bb17d876c69e7315844e0850e3c04f91b11a3f0c2a57bc6",tier:"lazy",group:"latin",contentType:"text/plain"},"v5-latin-fp16.bin":{bytes:3995900,sha256:"0516474d30cff75a6365869992699d27fbc03f00fcf3d7274c3eed651ee6ea90",tier:"lazy",group:"latin",contentType:"application/octet-stream"},"latin.dict.txt":{bytes:2615,sha256:"c3ab00106e4a4d151a8575b1129b91901a68a35b79a81fd63faab00418b87d75",tier:"lazy",group:"latin",contentType:"text/plain"},"v5-arabic-fp16.param":{bytes:19791,sha256:"1d1e219d277bb1a76909741573f56cfae465f11b61a9be4ca4c29580758c8760",tier:"lazy",group:"arabic",contentType:"text/plain"},"v5-arabic-fp16.bin":{bytes:3974364,sha256:"4ced47b32ab4e7ad16ddebc074f31594eb42b912465a8ed7458bb2842af9efe1",tier:"lazy",group:"arabic",contentType:"application/octet-stream"},"arabic.dict.txt":{bytes:2368,sha256:"8f239c13f6c8b1bdf15f332a65a05002ddd4d99b9286a4bfaf6f0327c36ebbec",tier:"lazy",group:"arabic",contentType:"text/plain"},"v5-cyrillic-fp16.param":{bytes:19806,sha256:"c87b42bfa343509b319dd193dcca4c0e20bb13b1d07bfbf4925a9f5d045966d4",tier:"lazy",group:"cyrillic",contentType:"text/plain"},"v5-cyrillic-fp16.bin":{bytes:3999288,sha256:"97446e221c0d2d84cb76dca6d4217a850efad4d5ec85e3fadc78db353cf97afa",tier:"lazy",group:"cyrillic",contentType:"application/octet-stream"},"cyrillic.dict.txt":{bytes:2780,sha256:"2de016b31edd687acfc1bf72170f4feff9f0c4893edac87cef30b2c5a82443ec",tier:"lazy",group:"cyrillic",contentType:"text/plain"},"v5-greek-fp16.param":{bytes:19815,sha256:"1cc1d47d3aa3fce86d3dbe901a553fd29412f44934a4919d986c155d23f63207",tier:"lazy",group:"greek",contentType:"text/plain"},"v5-greek-fp16.bin":{bytes:3879256,sha256:"04190cd4ee2b023665346d4cd239ee118965f837812108869d3d9894d30c4db3",tier:"lazy",group:"greek",contentType:"application/octet-stream"},"greek.dict.txt":{bytes:1102,sha256:"60e017885fd98fd0fb5c402da86179f1fe24ae229b374b3b96d313f99a09de59",tier:"lazy",group:"greek",contentType:"text/plain"},"v5-devanagari-fp16.param":{bytes:19807,sha256:"c6540a818cbb46c5b511dc4dd20ebfeae9038ec64e5cf175cd2d25f1b9f95c51",tier:"lazy",group:"devanagari",contentType:"text/plain"},"v5-devanagari-fp16.bin":{bytes:3931044,sha256:"d3086391eb2298c4d4e5a6d20a7fc58a8d0f3ce0a12395c88e9d485c5d595828",tier:"lazy",group:"devanagari",contentType:"application/octet-stream"},"devanagari.dict.txt":{bytes:1942,sha256:"c66d17ef6ced6fbfb4413810e75f0f788cfde37d4192bd17af7923fa190066c8",tier:"lazy",group:"devanagari",contentType:"text/plain"},"v5-thai-fp16.param":{bytes:19786,sha256:"4422df9dcc960e42082166adcca42da2aa6df62abebc75daf0c887e89381c039",tier:"lazy",group:"thai",contentType:"text/plain"},"v5-thai-fp16.bin":{bytes:3920396,sha256:"3458d7c5f0a7f88cb804d084c6596dea3f67c5ea99082654938d71a4eb72a079",tier:"lazy",group:"thai",contentType:"application/octet-stream"},"thai.dict.txt":{bytes:1766,sha256:"e0f32101004cc828ed4505bba80126be06e282700c4c79175ed2b21a4d454dfa",tier:"lazy",group:"thai",contentType:"text/plain"},"v5-hangul-fp16.param":{bytes:19804,sha256:"8daec1a4aa09d3bc92a476438330921c910263b8e61d62334d79e2d1dd14247c",tier:"lazy",group:"hangul",contentType:"text/plain"},"v5-hangul-fp16.bin":{bytes:6684280,sha256:"1d38192b59765cf71c1909ea4b972ee3c8588537a53844e6830f57fbf47976a4",tier:"lazy",group:"hangul",contentType:"application/octet-stream"},"hangul.dict.txt":{bytes:47450,sha256:"a7872c929cd25cf615cdfea08579cf800db1943900fe683468df4dcff6f848bb",tier:"lazy",group:"hangul",contentType:"text/plain"}},scripts:{latin:{classes:838,rtl:!1,param:"v5-latin-fp16.param",bin:"v5-latin-fp16.bin",dict:"latin.dict.txt"},arabic:{classes:749,rtl:!0,param:"v5-arabic-fp16.param",bin:"v5-arabic-fp16.bin",dict:"arabic.dict.txt"},cyrillic:{classes:852,rtl:!1,param:"v5-cyrillic-fp16.param",bin:"v5-cyrillic-fp16.bin",dict:"cyrillic.dict.txt"},greek:{classes:356,rtl:!1,param:"v5-greek-fp16.param",bin:"v5-greek-fp16.bin",dict:"greek.dict.txt"},devanagari:{classes:570,rtl:!1,param:"v5-devanagari-fp16.param",bin:"v5-devanagari-fp16.bin",dict:"devanagari.dict.txt"},thai:{classes:526,rtl:!1,param:"v5-thai-fp16.param",bin:"v5-thai-fp16.bin",dict:"thai.dict.txt"},hangul:{classes:11947,rtl:!1,param:"v5-hangul-fp16.param",bin:"v5-hangul-fp16.bin",dict:"hangul.dict.txt"}}};var bt="sekyro-mrz-1";function gt(e){return Array.from(new Uint8Array(e),t=>t.toString(16).padStart(2,"0")).join("")}async function be(e){return gt(await crypto.subtle.digest("SHA-256",e))}function Ee(e,t){return be(new TextEncoder().encode(`${bt}\0${e}\0${t.join(`
|
|
2
|
+
`)}`))}var z=class extends Error{constructor(t){super(t),this.name="AssetFailure",this.reason=t}},Ce=Object.keys(k.files).filter(e=>k.files[e].tier==="live"),un=Object.keys(k.files).filter(e=>k.files[e].tier==="lazy");function yt(e,t){return`${e.replace(/\/+$/,"")}/${k.fp12}/${t}`}async function ht(e,t,n,r=fetch,i=()=>performance.now()){let s=k.files[t],o=i(),c=async p=>{try{let f=await r(yt(e,t),{cache:p,signal:n,credentials:"omit"});if(!f.ok)throw new z("download");return await f.arrayBuffer()}catch(f){throw f instanceof z?f:new z("download")}},a=async p=>p.byteLength===s.bytes&&await be(p)===s.sha256,d=await c("force-cache");if(!await a(d)&&(d=await c("reload"),!await a(d)))throw new z("integrity");return{bytes:d,ms:i()-o}}async function Oe(e,t,n,r=fetch,i=()=>performance.now()){let s=new AbortController,o=new Map,c=t.reduce((f,g)=>f+k.files[g].bytes,0),a=i(),d=!0,p=0;for(let f of t){let g=await ht(e,f,s.signal,r,i);o.set(f,g.bytes),g.ms>=50&&(d=!1),p+=g.bytes.byteLength;let b=i()-a;if(p<c&&b>0&&b*c/p>n)throw s.abort(),new z("download")}return{files:o,downloadMs:Math.round(i()-a),cached:d}}var T=class extends Error{constructor(t){super(t),this.name="OcrFailure",this.code=t}};function ue(e){return[...e.split(`
|
|
3
|
+
`)," "]}function Le(e,t,n,r,i){if(n<2||e.length===0||e.length!==t.length||r.length<n-1)throw new T("OCR_INFERENCE_FAILED");let s="",o=-1,c=0,a=0;for(let p=0;p<e.length;p++){let f=e[p];if(!Number.isInteger(f)||f<0||f>=n)throw new T("OCR_INFERENCE_FAILED");f!==0&&f!==o&&(s+=r[f-1],c+=Math.fround(t[p]),a++),o=f}return{text:i?Array.from(s).reverse().join(""):s,score:a===0?0:c/a}}var ge="latin",bn=Object.keys(k.scripts);function we(e){return Object.prototype.hasOwnProperty.call(k.scripts,e)}function De(e){let t=k.scripts[e];return{script:e,classes:t.classes,rtl:t.rtl,param:t.param,bin:t.bin,dict:t.dict}}function ve(e,t){let n=ue(e);if(e.endsWith(`
|
|
4
|
+
`)||n.length!==t-1)throw new T("OCR_ASSET_INVALID");return n}var ke=e=>e.reduce((t,n)=>t+n,0)/e.length;function Be(e){let t=e.filter(i=>i.score>=.5);if(t.length===0)return[];if(t.some(i=>i.box.length!==4||!Number.isFinite(i.score)||i.box.some(s=>!Number.isFinite(s.x)||!Number.isFinite(s.y))))throw new T("OCR_INFERENCE_FAILED");let n=ke(t.map(i=>i.box[2].y-i.box[0].y)),r=[];for(let i of t){let s=(i.box[0].y+i.box[2].y)/2,o=r.find(c=>Math.abs((c[0].box[0].y+c[0].box[2].y)/2-s)<n/2);o===void 0?r.push([i]):o.push(i)}for(let i of r)i.sort((s,o)=>s.box[0].x-o.box[0].x);return r.sort((i,s)=>i[0].box[0].y-s[0].box[0].y),r.map(i=>{let s=i[0].box,o=i[i.length-1].box,c=[s[0],o[1],o[2],s[3]];return{text:i.map(a=>a.text).join(" "),x:Math.min(...c.map(a=>a.x)),y:Math.min(...c.map(a=>a.y)),x2:Math.max(...c.map(a=>a.x)),y2:Math.max(...c.map(a=>a.y)),score:ke(i.map(a=>a.score))}})}var j={of(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||t<1||t>12||n<1||n>new Date(Date.UTC(e,t,0)).getUTCDate()?null:{year:e,month:t,day:n}},iso(e){return`${String(e.year).padStart(4,"0")}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")}`},parse(e){let[t,n,r]=e.split("-").map(Number);return{year:t,month:n,day:r}},today(){let e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}}},Ue=30,Ge=36,ze=44,ye="MRT",xt=[7,3,1],At=/^[0-9]{6}$/,xe=/^[0-9]{10}$/,He=e=>e!==void 0&&e.length===1&&e>="0"&&e<="9";function Mt(e){return e>="0"&&e<="9"?e.charCodeAt(0)-48:e>="A"&&e<="Z"?e.charCodeAt(0)-55:0}function fe(e){let t=0;for(let n=0;n<e.length;n++)t+=Mt(e[n])*xt[n%3];return String(t%10)}function v(e,t){return t==="<"?null:He(t)?fe(e)===t:!1}function de(e){return e.trim().toUpperCase().replaceAll(" ","")}function St(e,t){return(de(e)+"<".repeat(t)).slice(0,t)}function B(e){return e.replace(/^<+|<+$/g,"")}var Rt=new Set(`ABW AFG AGO AIA ALA ALB AND ARE ARG ARM ASM ATA ATF ATG AUS AUT AZE BDI BEL BEN BES BFA BGD BGR BHR
|
|
5
|
+
BHS BIH BLM BLR BLZ BMU BOL BRA BRB BRN BTN BVT BWA CAF CAN CCK CHE CHL CHN CIV CMR COD COG COK COL
|
|
6
|
+
COM CPV CRI CUB CUW CXR CYM CYP CZE DEU DJI DMA DNK DOM DZA ECU EGY ERI ESH ESP EST ETH FIN FJI FLK
|
|
7
|
+
FRA FRO FSM GAB GBR GEO GGY GHA GIB GIN GLP GMB GNB GNQ GRC GRD GRL GTM GUF GUM GUY HKG HMD HND HRV
|
|
8
|
+
HTI HUN IDN IMN IND IOT IRL IRN IRQ ISL ISR ITA JAM JEY JOR JPN KAZ KEN KGZ KHM KIR KNA KOR KWT LAO
|
|
9
|
+
LBN LBR LBY LCA LIE LKA LSO LTU LUX LVA MAC MAF MAR MCO MDA MDG MDV MEX MHL MKD MLI MLT MMR MNE MNG
|
|
10
|
+
MNP MOZ MRT MSR MTQ MUS MWI MYS MYT NAM NCL NER NFK NGA NIC NIU NLD NOR NPL NRU NZL OMN PAK PAN PCN
|
|
11
|
+
PER PHL PLW PNG POL PRI PRK PRT PRY PSE PYF QAT REU ROU RUS RWA SAU SDN SEN SGP SGS SHN SJM SLB SLE
|
|
12
|
+
SLV SMR SOM SPM SRB SSD STP SUR SVK SVN SWE SWZ SXM SYC SYR TCA TCD TGO THA TJK TKL TKM TLS TON TTO
|
|
13
|
+
TUN TUR TUV TWN TZA UGA UKR UMI URY USA UZB VAT VCT VEN VGB VIR VNM VUT WLF WSM XKK YEM ZAF ZMB ZWE`.trim().split(/\s+/)),Tt=new Set(`D GBD GBN GBO GBP GBS RKS UNK UNO UNA EUE XBA XIM XCC XCE XCO XDC XEC XES XMP XOM XPO XXA XXB XXC
|
|
14
|
+
XXX ANT NTZ UTO`.trim().split(/\s+/));function It(e){return Rt.has(e)||Tt.has(e)}var Nt="012568",_t="OIZSGB",Et="OQDILZSGB",Ct="000112568";function he(e){let t=Nt.indexOf(e);return e.length!==1||t<0?e:_t[t]}function Ot(e){let t=Et.indexOf(e);return e.length!==1||t<0?e:Ct[t]}var Lt=[["\xAB","<<"],["\u2039","<"],["\uFF1C","<"],["\u3008","<"],["\xD7","X"]],Ke=[`aaccc${"x".repeat(9)}n${"x".repeat(15)}`,`${"n".repeat(7)}x${"n".repeat(7)}ccc${"x".repeat(11)}n`,"a".repeat(30)],We=[`aaccc${"a".repeat(31)}`,`${"x".repeat(9)}nccc${"n".repeat(7)}x${"n".repeat(7)}${"x".repeat(7)}n`],Ve=[`aaccc${"a".repeat(39)}`,`${"x".repeat(9)}nccc${"n".repeat(7)}x${"n".repeat(7)}${"x".repeat(14)}nn`];function wt(e,t){let n="",r=0;for(;r<t.length;){let i=t[r];if(i==="c"){let o=e.substring(r,r+3),c=Array.from(o,he).join("");n+=c!==o&&It(c.replaceAll("<",""))?c:o,r+=3;continue}let s=e[r];n+=i==="a"?he(s):i==="n"?Ot(s):s,r++}return n}function ee(e,t,n){return n.slice(0,e.length).map((r,i)=>{let s=Lt.reduce((o,[c,a])=>o.replaceAll(c,a),de(e[i]));return wt(St(s,t),r)})}function Ye(e,t){let n=e.filter(r=>r.trim().length>0);return t==="TD1"?ee(n.slice(0,3),Ue,Ke):t==="TD2"?ee(n.slice(0,2),Ge,We):ee(n.slice(0,2),ze,Ve)}function Ae(e){let t=`${e.toUpperCase()}<<`.slice(0,2);return t==="AC"?"unknown":t==="IR"||t==="AR"||"ACRT".includes(t[0])?"residence_permit":t[0]==="P"?"passport":t[0]==="I"?"carte_identite":"unknown"}function Dt(e){return xe.test(e)&&Number(e)%97===1}function vt(e,t,n){if(!At.test(e))return null;let r=Number(e.slice(0,2)),i=t?2e3+r:r>n.year%100?1900+r:2e3+r;return j.of(i,Number(e.slice(2,4)),Number(e.slice(4,6)))}function te(e,t,n){let r=vt(e,t,n);return r?j.iso(r):""}function Me(e){let t=e.split("<<").filter(n=>B(n).length>0);return[(t[0]??"").replaceAll("<"," ").trim(),(t[1]??"").replaceAll("<"," ").trim()]}var Se=e=>e==="M"||e==="F"?e:"",kt=e=>e.substring(0,2).replaceAll("<",""),se=e=>e.substring(2,5).replaceAll("<","");function Ze(e,t,n){if(t==="<"&&B(n).length>0){let r=n.indexOf("<"),i=r<0?n:n.slice(0,r);if(i.length>=2){let s=e+i.slice(0,-1);if(v(s,i[i.length-1])===!0)return{value:B(s),ok:!0,warn:null}}return{value:B(e),ok:!1,warn:"docnum_cd_mismatch"}}return{value:B(e),ok:v(e,t),warn:null}}var H=(e,t)=>({success:!1,error:e,fields:{},checkDigits:{},hardCdFail:!1,warns:[],...t===void 0?{}:{linesCount:t}});function Re(e,t,n,r,i,s,o){return{success:!0,documentType:e,format:t,documentCode:kt(n),fields:r,checkDigits:i,hardCdFail:s,warns:o}}function Bt(e,t){if(e.length<3)return H("mrz_incomplete");let[n,r,i]=ee(e.slice(0,3),Ue,Ke),s=se(n)===ye||r.substring(15,18)===ye||Dt(n.substring(15,25)),o=[],c={},a,d,p=!1;if(s){a=B(n.substring(5,14));let x=n[14];He(x)?(d=fe(n.substring(5,14))===x,d||o.push("td1_docnum_cd_mismatch")):d=null}else{let x=Ze(n.substring(5,14),n[14],n.substring(15,30));if(x.ok===null)return H("mrz_incomplete");a=x.value,d=x.ok,p=x.ok===!1&&x.warn===null,x.warn!==null&&o.push(x.warn)}c.document_number=d;let f=v(r.substring(0,6),r[6]),g=v(r.substring(8,14),r[14]);if(c.birth_date=f,c.expiry_date=g,f===null||g===null)return H("mrz_incomplete");let b=v(n.substring(5,30)+r.substring(0,7)+r.substring(8,15)+r.substring(18,29),r[29]);c.composite=b,b===!1&&o.push("composite_cd_mismatch");let l=s?n.substring(15,25):"",[u,S]=Me(i),R=f===!1||g===!1||p;return Re(Ae(n.substring(0,2)),"TD1",n,{issuing_state:se(n),document_number:a,nni:xe.test(l)?l:"",birth_date:te(r.substring(0,6),!1,t),expiry_date:te(r.substring(8,14),!0,t),sex:Se(r[7]),nationality:B(r.substring(15,18)),surname:u,given_names:S},c,R,o)}function Pt(e,t){if(e.length<2)return H("mrz_incomplete");let[n,r]=ee(e.slice(0,2),Ge,We),i=[],s=Ze(r.substring(0,9),r[9],r.substring(28,35));s.warn!==null&&i.push(s.warn);let o=v(r.substring(13,19),r[19]),c=v(r.substring(21,27),r[27]),a={document_number:s.ok,birth_date:o,expiry_date:c};if(s.ok===null||o===null||c===null)return H("mrz_incomplete");let d=v(r.substring(0,10)+r.substring(13,20)+r.substring(21,35),r[35]);a.composite=d,d===!1&&i.push("composite_cd_mismatch");let[p,f]=Me(n.substring(5,36)),g=s.ok===!1&&s.warn===null||o===!1||c===!1;return Re(Ae(n.substring(0,2)),"TD2",n,{issuing_state:se(n),document_number:s.value,nni:"",birth_date:te(r.substring(13,19),!1,t),expiry_date:te(r.substring(21,27),!0,t),sex:Se(r[20]),nationality:B(r.substring(10,13)),surname:p,given_names:f},a,g,i)}function Pe(e,t){if(e.length<2)return H("mrz_incomplete");let[n,r]=ee(e.slice(0,2),ze,Ve),i=se(n)===ye,s=[],o={},c=r.substring(0,9),a=v(c,r[9]),d=v(r.substring(13,19),r[19]),p=v(r.substring(21,27),r[27]);if(o.document_number=a,o.birth_date=d,o.expiry_date=p,a===null||d===null||p===null)return H("mrz_incomplete");let f=r.substring(28,42),g="";if(B(f).length>0){let R=v(f,r[42]);o.personal_number=R;let x=B(f);i&&R!==!1&&xe.test(x)&&(g=x)}let b=v(r.substring(0,10)+r.substring(13,20)+r.substring(21,43),r[43]);o.composite=b,b===!1&&s.push("composite_cd_mismatch");let[l,u]=Me(n.substring(5,44)),S=a===!1||d===!1||p===!1;return Re(Ae(n.substring(0,2)),"TD3",n,{issuing_state:se(n),document_number:B(c),nni_candidate:g,birth_date:te(r.substring(13,19),!1,t),expiry_date:te(r.substring(21,27),!0,t),sex:Se(r[20]),nationality:B(r.substring(10,13)),surname:l,given_names:u},o,S,s)}var Fe=new Set(["A","C","I"]),Ft=new Set(["R","T"]);function Xe(e,t=j.today()){let n=e.filter(i=>i.trim().length>0);if(n.length===0)return H("mrz_unrecognized",0);let r=Array.from(de(n[0]).slice(0,1),he).join("");return n.length===3&&(Fe.has(r)||Ft.has(r))?Bt(n,t):n.length===2&&r==="P"?Pe(n,t):n.length===2&&Fe.has(r)?Math.max(...n.map(i=>de(i).length))>40?Pe(n,t):Pt(n,t):H("mrz_unrecognized",n.length)}var Ut=new Map([...(`ABWAW AFGAF AGOAO AIAAI ALAAX ALBAL ANDAD AREAE ARGAR ARMAM ASMAS ATAAQ
|
|
15
|
+
ATFTF ATGAG AUSAU AUTAT AZEAZ BDIBI BELBE BENBJ BESBQ BFABF BGDBD BGRBG
|
|
16
|
+
BHRBH BHSBS BIHBA BLMBL BLRBY BLZBZ BMUBM BOLBO BRABR BRBBB BRNBN BTNBT
|
|
17
|
+
BVTBV BWABW CAFCF CANCA CCKCC CHECH CHLCL CHNCN CIVCI CMRCM CODCD COGCG
|
|
18
|
+
COKCK COLCO COMKM CPVCV CRICR CUBCU CUWCW CXRCX CYMKY CYPCY CZECZ DEUDE
|
|
19
|
+
DJIDJ DMADM DNKDK DOMDO DZADZ ECUEC EGYEG ERIER ESHEH ESPES ESTEE ETHET
|
|
20
|
+
FINFI FJIFJ FLKFK FRAFR FROFO FSMFM GABGA GBRGB GEOGE GGYGG GHAGH GIBGI
|
|
21
|
+
GINGN GLPGP GMBGM GNBGW GNQGQ GRCGR GRDGD GRLGL GTMGT GUFGF GUMGU GUYGY
|
|
22
|
+
HKGHK HMDHM HNDHN HRVHR HTIHT HUNHU IDNID IMNIM INDIN IOTIO IRLIE IRNIR
|
|
23
|
+
IRQIQ ISLIS ISRIL ITAIT JAMJM JEYJE JORJO JPNJP KAZKZ KENKE KGZKG KHMKH
|
|
24
|
+
KIRKI KNAKN KORKR KWTKW LAOLA LBNLB LBRLR LBYLY LCALC LIELI LKALK LSOLS
|
|
25
|
+
LTULT LUXLU LVALV MACMO MAFMF MARMA MCOMC MDAMD MDGMG MDVMV MEXMX MHLMH
|
|
26
|
+
MKDMK MLIML MLTMT MMRMM MNEME MNGMN MNPMP MOZMZ MRTMR MSRMS MTQMQ MUSMU
|
|
27
|
+
MWIMW MYSMY MYTYT NAMNA NCLNC NERNE NFKNF NGANG NICNI NIUNU NLDNL NORNO
|
|
28
|
+
NPLNP NRUNR NZLNZ OMNOM PAKPK PANPA PCNPN PERPE PHLPH PLWPW PNGPG POLPL
|
|
29
|
+
PRIPR PRKKP PRTPT PRYPY PSEPS PYFPF QATQA REURE ROURO RUSRU RWARW SAUSA
|
|
30
|
+
SDNSD SENSN SGPSG SGSGS SHNSH SJMSJ SLBSB SLESL SLVSV SMRSM SOMSO SPMPM
|
|
31
|
+
SRBRS SSDSS STPST SURSR SVKSK SVNSI SWESE SWZSZ SXMSX SYCSC SYRSY TCATC
|
|
32
|
+
TCDTD TGOTG THATH TJKTJ TKLTK TKMTM TLSTL TONTO TTOTT TUNTN TURTR TUVTV
|
|
33
|
+
TWNTW TZATZ UGAUG UKRUA UMIUM URYUY USAUS UZBUZ VATVA VCTVC VENVE VGBVG
|
|
34
|
+
VIRVI VNMVN VUTVU WLFWF WSMWS YEMYE ZAFZA ZMBZM ZWEZW`.match(/[A-Z]{5}/g)??[]).map(e=>[e.slice(0,3),e.slice(3)]),["D","DE"]]),$e={of(e){return Ut.get(e.replaceAll("<",""))??null}};var Ie=e=>fe(e);function tt(e){return e.slice(0,5e4).split(/\r?\n/).slice(0,200).map(t=>t.toUpperCase().replace(/[«‹〈]/g,"<").replace(/[^A-Z0-9<]/g,"")).filter(t=>t.length>0)}var Je=e=>e.replace(/[OQ]/g,"0").replace(/[IL]/g,"1").replaceAll("Z","2").replaceAll("S","5").replaceAll("B","8");function je(e,t){let n=Je(e),r=Je(t);if(!/^\d{6}$/.test(n)||Ie(n)!==r)return null;let i=2e3+Number(n.slice(0,2)),s=Number(n.slice(2,4)),o=Number(n.slice(4,6));return s>=1&&s<=12&&o>=1&&o<=new Date(Date.UTC(i,s,0)).getUTCDate()?n:null}function Te(e,t){let n=e.replace(/<+$/,"");return/^[A-Z0-9]+$/.test(n)&&Ie(e)===t?n:null}function Gt(e){if(e.length<15)return null;if(e[14]!=="<")return Te(e.substring(5,14),e[14]);let t=/^([A-Z0-9]+)</.exec(e.substring(15,Math.min(30,e.length)))?.[1];return t===void 0||t.length<2?null:Te(e.substring(5,14)+t.slice(0,-1),t[t.length-1])}var A=(e,t,n)=>t>=e.length?"":e.substring(t,Math.min(n,e.length)),Z=(e,t)=>t<e.length?e[t]:"",Qe=/^[IAC][A-Z<][A-Z<]{3}/,zt=/^P[A-Z<][A-Z<]{3}/,nt=/^[PIAC][A-Z<][A-Z<]{3}/;function Ht(e){let t=tt(e),n=[],r=[];for(let s=0;s<t.length;s++){let o="",c=0;for(;c<6&&s+c<t.length&&(o+=t[s+c],!(o.length>300));)r.push(o),c++}let i=(s,o,c)=>{if(o.length<(c?15:28))return;let a=new Map,d=c?Gt(s):Te(A(o,0,9),Z(o,9)),p=je(c?A(o,0,6):A(o,13,19),c?Z(o,6):Z(o,19)),f=je(c?A(o,8,14):A(o,21,27),c?Z(o,14):Z(o,27));d!==null&&a.set("docNumber",d),p!==null&&a.set("dob6",p),f!==null&&a.set("expiry6",f),a.size>0&&n.push({fields:a,country:$e.of(A(s,2,5))})};for(let s of r)Qe.test(s)&&(s.length>=45&&i(s.substring(0,30),s.substring(30),!0),s.length>=64&&i(s.substring(0,36),s.substring(36),!1)),zt.test(s)&&s.length>=72&&i(s.substring(0,44),s.substring(44),!1);for(let s=0;s<t.length-1;s++){let o=t[s],c=t[s+1];Qe.test(o)&&o.length>=15&&o.length<=30&&i(o,c,!0),nt.test(o)&&o.length>=5&&o.length<=44&&i(o,c,!1)}return n}function Kt(e){let t=Ht(e);if(t.length===0)return{};let n=Math.max(...t.map(s=>s.fields.size)),r=t.filter(s=>s.fields.size===n),i={};for(let s of["docNumber","dob6","expiry6"]){let o=new Set(r.map(c=>c.fields.get(s)).filter(c=>c!==void 0));o.size===1&&r.every(c=>c.fields.has(s))&&(i[s]=[...o][0])}return i}function Wt(e){let t=Kt(e),n=t.docNumber,r=t.dob6,i=t.expiry6;return n!==void 0&&r!==void 0&&i!==void 0?{docNumber:n,dob6:r,expiry6:i}:null}function rt(e){let t=Yt(e);return t.length===1?t[0]:null}var Vt=e=>JSON.stringify([e.documentNumber,e.nationality,e.dob,e.sex,e.expiry,e.primaryIdentifier,e.secondaryIdentifier,e.optional]);function Yt(e){let t=tt(e),n=[];for(let i=0;i<t.length;i++){let s=t[i];if(!nt.test(s))continue;let o=s.startsWith("P")?[44]:[30,36];for(let c of o){let a=c===30?3:2,d=t.slice(i,Math.min(t.length,i+a));d.length===a&&d.every(g=>g.length<=c)&&n.push(d.map(g=>g.padEnd(c,"<")).join(`
|
|
35
|
+
`));let p="",f=0;for(;f<6&&i+f<t.length&&(p+=t[i+f],p.length===c*a&&n.push(p),!(p.length>=c*a));)f++}}let r=new Map;for(let i of n){let s=Wt(i);if(s===null)continue;let o=i.includes(`
|
|
36
|
+
`)?i.split(`
|
|
37
|
+
`):i.match(i.length===90?/.{30}/g:i.length===88?/.{44}/g:/.{36}/g)??[],c=o[0]??"",a=o[1]??"",d=o.length===3,p=d?A(c,5,30)+A(a,0,7)+A(a,8,15)+A(a,18,29):A(a,0,10)+A(a,13,20)+A(a,21,a.length-1),f=d?Z(a,29):Z(a,a.length-1);if(!/^[0-9]$/.test(f)||Ie(p)!==f)continue;let g=Zt(i);if(g===null||g.primaryIdentifier.length===0&&g.secondaryIdentifier.length===0||!/^[MFX]?$/.test(g.sex))continue;let b={...g,documentNumber:s.docNumber,dob:s.dob6,expiry:s.expiry6};r.set(Vt(b),{fields:b,mrzLines:o})}return[...r.values()]}var U=e=>e.replaceAll("<"," ").replace(/\s+/g," ").trim();function qe(e){let t=e.split("<<");return[U(t[0]??""),U(t.slice(1).join("<<"))]}var et=e=>e.length===0?null:e;function Zt(e){let t=e.split(/\r?\n/).map(r=>r.replace(/\s+$/,"")).filter(r=>r.length>0),n=e.replace(/[\r\n]/g,"");if(t.length===1&&(n.length===90?t=[n.substring(0,30),n.substring(30,60),n.substring(60,90)]:n.length===72?t=[n.substring(0,36),n.substring(36,72)]:n.length===88&&(t=[n.substring(0,44),n.substring(44,88)])),t.length===3){let[r,i,s]=t,o=Z(r,14)==="<"?/^([A-Z0-9]+)</.exec(A(r,15,30))?.[1]:void 0,c=U(A(r,5,14)+(o!==void 0&&o.length>1?o.slice(0,-1):"")),[a,d]=qe(s),p=U(`${A(r,15,30)}<${A(i,18,29)}`);return{documentNumber:c,nationality:U(A(i,15,18)),dob:A(i,0,6),sex:U(A(i,7,8)),expiry:A(i,8,14),primaryIdentifier:a,secondaryIdentifier:d,optional:et(p)}}if(t.length===2){let[r,i]=t,s=r.length>=44,[o,c]=qe(A(r,5,s?44:36));return{documentNumber:U(A(i,0,9)),nationality:U(A(i,10,13)),dob:A(i,13,19),sex:U(A(i,20,21)),expiry:A(i,21,27),primaryIdentifier:o,secondaryIdentifier:c,optional:et(U(s?A(i,28,42):A(i,28,35)))}}return null}function it(e,t=j.today()){let n=Xe(e,t),r=n.format??null,i=r==="TD1"||r==="TD2"||r==="TD3"?Ye(e,r):[...e];return{format:r,documentCode:n.documentCode??null,lines:i,valid:n.success&&!n.hardCdFail}}var Xt=/^[A-Z0-9<]{25,}$/;function $t(e){return e.toUpperCase().replaceAll(" ","").replaceAll("\xAB","<").replaceAll("\u2039","<")}var Ne=(e,t,n)=>e.length>=t&&e.length<=n;function st(e){let t=e.map($t).filter(n=>Xt.test(n));for(let n=0;n+3<=t.length;n++){let r=t.slice(n,n+3);if(r.every(i=>Ne(i,28,32))&&"IAC".includes(r[0][0]))return r}for(let n=0;n+2<=t.length;n++){let r=t.slice(n,n+2);if(r.every(i=>Ne(i,40,46))&&r[0].startsWith("P")||r.every(i=>Ne(i,34,38))&&"IACPV".includes(r[0][0]))return r}return[]}var ne={SIZE:80,SCRIPT:64,OFFSET:68,STEPS:72},E={DETECTOR:0,LATIN:1,ARABIC:2},F={NONE:0,LATIN:1,ARABIC:2,BOTH:3},oe=3;var X=e=>Math.round(Math.min(1,Math.max(0,e))*1e4)/1e4;async function at(e,t,n,r,i){let s=i.now??(()=>performance.now()),o=s(),a=e.read(t,n,r,i.region??[0,0,1,1],1,oe,F.LATIN,i.detectorLimit).map(u=>({text:u.latin.text,score:u.latin.score,box:[0,1,2,3].map(S=>({x:u.box[2*S],y:u.box[2*S+1]}))})),d=Be([...a].reverse()),p=d.map(u=>u.text),f=[...rt(p.join(`
|
|
38
|
+
`))?.mrzLines??st(p)],g=d.map(u=>[X(u.x/n),X(u.y/r),X((u.x2-u.x)/n),X((u.y2-u.y)/r)]),b={kind:"band",ms:0,lineBoxes:g,lineCount:f.length,valid:!1},l=jt(d.map(u=>u.text),g,f);if(l!==null&&(b.mrzBox=l),f.length>0){let u=it(f,i.today??j.today());u.format&&(b.format=u.format),u.documentCode&&/^[A-Z<]{1,2}$/.test(u.documentCode)&&(b.documentCode=u.documentCode),u.valid&&(b.valid=!0,b.digest=await Ee(i.salt,u.lines))}return b.ms=Math.round(s()-o),b}var ot=e=>e.toUpperCase().replace(/\s+/g,"");function Jt(e,t){let n=Math.max(e.length,t.length);if(n===0)return 0;let r=0;for(let i=0;i<Math.min(e.length,t.length);i++)e[i]===t[i]&&r++;return r/n}function jt(e,t,n){if(n.length===0||e.length===0)return null;let r=new Set,i=[];for(let d of n){let p=-1,f=.5;if(e.forEach((g,b)=>{let l=r.has(b)?0:Jt(ot(g),ot(d));l>f&&(f=l,p=b)}),p<0)return null;r.add(p),i.push(t[p])}let s=Math.min(...i.map(d=>d[0])),o=Math.min(...i.map(d=>d[1])),c=Math.max(...i.map(d=>d[0]+d[2])),a=Math.max(...i.map(d=>d[1]+d[3]));return[X(s),X(o),X(c-s),X(a-o)]}var Dn=Object.freeze({minLines:4,fillMin:.55,fillMax:.98,offsetMax:.12,steadyFillDelta:.04,steadyOffsetDelta:.03,layoutShiftMax:.025,lineCountDelta:1,lockMs:600,steadyMs:900,minFrames:3});function ct(e,t,n){let r=i=>Math.round(Math.min(1,Math.max(0,i))*1e4)/1e4;return e.map(i=>{let s=[i[0],i[2],i[4],i[6]],o=[i[1],i[3],i[5],i[7]],c=Math.min(...s),a=Math.min(...o);return[r(c/t),r(a/n),r((Math.max(...s)-c)/t),r((Math.max(...o)-a)/n)]}).sort((i,s)=>i[1]-s[1]||i[0]-s[0])}async function Qt(e={}){var t,n=e,r=import.meta.url,i="",s,o;try{i=new URL(".",r).href}catch{}o=m=>{var h=new XMLHttpRequest;return h.open("GET",m,!1),h.responseType="arraybuffer",h.send(null),new Uint8Array(h.response)},s=async m=>{if(m=await fetch(m,{credentials:"same-origin"}),m.ok)return m.arrayBuffer();throw Error(m.status+" : "+m.url)};var c=console.log.bind(console),a=console.error.bind(console),d=!1,p,f,g,b,l,u=!1;function S(){var m=ce.buffer;new Int8Array(m),new Int16Array(m),n.HEAPU8=g=new Uint8Array(m),new Uint16Array(m),new Int32Array(m),b=new Uint32Array(m),new Float32Array(m),new Float64Array(m),l=new BigInt64Array(m),new BigUint64Array(m)}function R(m){throw m="Aborted("+m+")",a(m),d=!0,m+=". Build with -sASSERTIONS for more info.",u&&Q(),m=new WebAssembly.RuntimeError(m),f?.(m),m}var x;async function L(m){try{var h=await s(m);return new Uint8Array(h)}catch{}if(o)m=o(m);else throw"both async and sync fetching of the wasm failed";return m}async function w(m,h){try{var y=await L(m);return await WebAssembly.instantiate(y,h)}catch(I){a(`failed to asynchronously prepare wasm: ${I}`),R(I)}}async function K(m){var h=x;try{var y=fetch(h,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(y,m)}catch(I){a(`wasm streaming compile failed: ${I}`),a("falling back to ArrayBuffer instantiation")}return w(h,m)}var W={},V=()=>{if(!$){var m={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:"./this.program"},h;for(h in W)W[h]===void 0?delete m[h]:m[h]=W[h];var y=[];for(h in m)y.push(`${h}=${m[h]}`);$=y}return $},$,J=[null,[],[]],ae=globalThis.TextDecoder&&new TextDecoder,Q,ce,pt={i:()=>R(""),b:function(m,h,y){return 0<=m&&3>=m?(l[y>>3]=BigInt(Math.round(1e6*(m===0?Date.now():performance.now()))),0):28},d:()=>1073741824,c:m=>{var h=g.length;if(m>>>=0,1073741824<m)return!1;for(var y=1;4>=y;y*=2){var I=h*(1+.2/y);I=Math.min(I,m+100663296);e:{I=(Math.min(1073741824,65536*Math.ceil(Math.max(m,I)/65536))-ce.buffer.byteLength+65535)/65536|0;try{ce.grow(I),S();var C=1;break e}catch{}C=void 0}if(C)return!0}return!1},f:(m,h)=>{var y=0,I=0,C;for(C of V()){var M=h+y;b[m+I>>2]=M;for(var q=C,D=g,re=M,G=M+1/0-1,N=0;N<q.length;++N){var _=q.codePointAt(N);if(127>=_){if(M>=G)break;D[M++]=_}else if(2047>=_){if(M+1>=G)break;D[M++]=192|_>>6,D[M++]=128|_&63}else if(65535>=_){if(M+2>=G)break;D[M++]=224|_>>12,D[M++]=128|_>>6&63,D[M++]=128|_&63}else{if(M+3>=G)break;D[M++]=240|_>>18,D[M++]=128|_>>12&63,D[M++]=128|_>>6&63,D[M++]=128|_&63,N++}}D[M]=0,q=M-re,y+=q+1,I+=4}return 0},g:(m,h)=>{var y=V();b[m>>2]=y.length,m=0;for(var I of y){for(var C=y=0;C<I.length;++C){var M=I.charCodeAt(C);127>=M?y++:2047>=M?y+=2:55296<=M&&57343>=M?(y+=4,++C):y+=3}m+=y+1}return b[h>>2]=m,0},j:()=>52,h:()=>52,e:function(){return 70},a:(m,h,y,I)=>{for(var C=0,M=0;M<y;M++){var q=b[h>>2],D=b[h+4>>2];h+=8;for(var re=0;re<D;re++){var G=m,N=g[q+re],_=J[G];if(N===0||N===10){G=G===1?c:a,N=_;for(var Y=0,ie=N,P=Y,O=P+void 0;ie[P]&&!(P>=O);)++P;if(ie=P,16<ie-Y&&N.buffer&&ae)N=ae.decode(N.subarray(Y,ie));else{for(P="";Y<ie;)if(O=N[Y++],O&128){var pe=N[Y++]&63;if((O&224)==192)P+=String.fromCharCode((O&31)<<6|pe);else{var _e=N[Y++]&63;O=(O&240)==224?(O&15)<<12|pe<<6|_e:(O&7)<<18|pe<<12|_e<<6|N[Y++]&63,65536>O?P+=String.fromCharCode(O):(O-=65536,P+=String.fromCharCode(55296|O>>10,56320|O&1023))}}else P+=String.fromCharCode(O);N=P}G(N),_.length=0}else _.push(N)}C+=D}return b[I>>2]=C,0}},le;return le=await(async function(){function m(y){return y=le=y.exports,n._skw_engine_id=y.m,n._skw_load=y.n,n._skw_unload=y.o,n._skw_set_detector_limit=y.p,n._skw_read=y.q,n._skw_line_count=y.r,n._skw_lines=y.s,n._skw_best=y.t,n._skw_values=y.u,n._skw_sharpness=y.v,n._free=y.w,n._malloc=y.x,Q=y.y,ce=y.k,S(),le}var h={a:pt};return n.instantiateWasm?new Promise(y=>{n.instantiateWasm(h,(I,C)=>{y(m(I,C))})}):(x??(x=n.locateFile?n.locateFile?n.locateFile("sekyro-ocr.wasm",i):i+"sekyro-ocr.wasm":new URL("sekyro-ocr.wasm",import.meta.url).href),m((await K(h)).instance))})(),n.calledRun=!0,d||(u=!0,le.l(),p?.(n)),u?t=n:t=new Promise((m,h)=>{p=m,f=h}),t}var lt=Qt;function ut(e){return e===1||e===5?new T("OCR_IMAGE_INVALID"):e===2?new T("OCR_ASSET_INVALID"):e===4?new T("OCR_CANCELLED"):e===6?new T("OCR_BUSY"):e===7?new T("OCR_UNAVAILABLE"):new T("OCR_INFERENCE_FAILED")}var me=class{constructor(t){this.m=t;this.px=0;this.pxBytes=0;this.dicts=[null,null,null];this.classes=[0,0,0];this.held=[[],[],[]];this.latinKind="latin";this.scripts=[null,null,null]}engineId(){let t=this.m._skw_engine_id(),n="";for(let r=t;this.m.HEAPU8[r]!==0&&r<t+64;r++)n+=String.fromCharCode(this.m.HEAPU8[r]);return n}put(t){let n=this.m._malloc(t.length);if(!n)throw new T("OCR_UNAVAILABLE");return this.m.HEAPU8.set(t,n),n}load(t,n,r,i,s={}){this.unload(t);let o=new Uint8Array(n),c=new Uint8Array(o.byteLength+1);c.set(o);let a=null,d=0,p=null;if(s.mrz===!0){if(t!==E.LATIN||i===void 0||!tn(i)||s.script!==void 0)throw new T("OCR_ASSET_INVALID");a=ue(i),d=dt(i)}else if(t!==E.DETECTOR){if(p=s.script??(t===E.LATIN?ge:"arabic"),i===void 0||!we(p)||t===E.LATIN!=(p===ge))throw new T("OCR_ASSET_INVALID");d=De(p).classes,a=ve(i,d)}else if(i!==void 0||s.script!==void 0)throw new T("OCR_ASSET_INVALID");let f=new Uint8Array(r),g=this.put(c),b=this.put(f);this.held[t]=[g,b];let l=this.m._skw_load(t,g,c.length,b,f.byteLength,d);if(l!==0)throw this.unload(t),ut(l);this.dicts[t]=a,this.classes[t]=d,this.scripts[t]=p,t===E.LATIN&&(this.latinKind=s.mrz===!0?"mrz":"latin")}recognizer(){return this.loaded(E.LATIN)?this.latinKind:null}secondScript(){return this.loaded(E.ARABIC)?this.scripts[E.ARABIC]:null}unload(t){this.held[t].length&&this.m._skw_unload(t);for(let n of this.held[t])this.m._free(n);this.held[t]=[],this.dicts[t]=null,this.scripts[t]=null}loaded(t){return this.held[t].length>0}pixels(t){if(t.length>this.pxBytes){if(this.px&&this.m._free(this.px),this.px=this.m._malloc(t.length),!this.px)throw new T("OCR_UNAVAILABLE");this.pxBytes=t.length}return this.m.HEAPU8.set(t,this.px),this.px}sharpness(t,n,r){let i=this.m._skw_sharpness(this.pixels(t),n,r);return i>=0&&Number.isFinite(i)?i:null}read(t,n,r,i,s,o,c,a){if(!qt(c))throw new T("OCR_IMAGE_INVALID");if(c&F.LATIN&&!this.dicts[E.LATIN]||c&F.ARABIC&&!this.dicts[E.ARABIC]||!this.loaded(0))throw new T("OCR_UNAVAILABLE");let d=this.pixels(t);this.m._skw_set_detector_limit(a);let p=this.m._skw_read(d,n,r,i[0],i[1],i[2],i[3],s,o,c);if(p!==0)throw ut(p);let f=this.m._skw_line_count(),g=this.m.HEAPU8.buffer,b=new DataView(g,this.m._skw_lines(),f*ne.SIZE),l=new Int32Array(g,this.m._skw_best()),u=new Float32Array(g,this.m._skw_values()),S=[];for(let R=0;R<f;R++){let x=R*ne.SIZE,L=b.getInt32(x+ne.SCRIPT,!0),w=b.getInt32(x+ne.OFFSET,!0),K=b.getInt32(x+ne.STEPS,!0);if(c===F.NONE){S.push({box:Array.from({length:8},(ae,Q)=>b.getFloat64(x+8*Q,!0))});continue}let W=this.dicts[L];if(!W)throw new T("OCR_INFERENCE_FAILED");let V=Le(l.subarray(w,w+K),u.subarray(w,w+K),this.classes[L],W,!1),$=Array.from({length:8},(ae,Q)=>b.getFloat64(x+8*Q,!0)),J=S[S.length-1];L===E.ARABIC&&J&&J.arabic===void 0&&J.latin!==void 0&&en(J.box,$)?J.arabic=V:S.push(L===E.ARABIC?{box:$,arabic:V}:{box:$,latin:V})}return S}heapBytes(){return this.m.HEAPU8.length}dispose(){for(let t of[0,1,2])this.unload(t);this.px&&this.m._free(this.px),this.px=0,this.pxBytes=0}};function dt(e){return(e.endsWith(`
|
|
39
|
+
`)?e.slice(0,-1):e).split(`
|
|
40
|
+
`).length+2}var qt=e=>Number.isInteger(e)&&e>=F.NONE&&e<=F.BOTH,en=(e,t)=>e.every((n,r)=>n===t[r]);function tn(e){let t=e.split(`
|
|
41
|
+
`);return t.length===37&&new Set(t).size===37&&t.every(n=>/^[0-9A-Z<]$/.test(n))&&dt(e)===39}async function ft(e){let t=await lt({instantiateWasm:(n,r)=>(WebAssembly.instantiate(e,n).then(i=>r(i,e)),{})});return new me(t)}var Kn=Object.freeze({low:Object.freeze({stride:1,bandWidthPx:960}),mid:Object.freeze({stride:2,bandWidthPx:1280}),high:Object.freeze({stride:1,bandWidthPx:1280})});function mt(){let n=new Uint8Array(1228800).fill(255),r=24301,i=()=>(r=r*1103515245+12345&2147483647,r/2147483647),s=(d,p)=>{let f=(p*960+d)*4;n[f]=20,n[f+1]=20,n[f+2]=20},o=20,c=14,a=28;for(let d of[110,190])for(let p=0;p<44;p++){let f=40+p*o;if(i()<.25){for(let b=0;b<c/2;b++)for(let l=0;l<2;l++)s(f+c/2-b,d+a/2-b+l),s(f+c/2-b,d+a/2+b+l);continue}let g=Math.floor(i()*(c-3));for(let b=0;b<a;b++)for(let l=0;l<3;l++)s(f+g+l,d+b);for(let b of[0,a/2-1,a-3])if(!(i()<.4))for(let l=0;l<c;l++)for(let u=0;u<3;u++)s(f+l,d+b+u)}return{rgba:n,width:960,height:320}}function nn(){let e=null,t=null;return(n,r)=>{if(typeof OffscreenCanvas!="function"||(e||(e=new OffscreenCanvas(n,r),t=e.getContext("2d",{willReadFrequently:!0})),!t))return null;(e.width!==n||e.height!==r)&&(e.width=n,e.height=r);let i=t;return{draw(s){return i.clearRect(0,0,n,r),i.drawImage(s,0,0),i.getImageData(0,0,n,r).data}}}}function rn(){return{fetch:(...e)=>fetch(...e),now:()=>performance.now(),canvas:nn(),instantiate:ft}}function sn(e,t=rn()){let n=null,r="",i=960,s=0,o=!1,c=Promise.resolve(),a=l=>e.postMessage(l);async function d(l){if(t.canvas(1,1)===null)return a({id:l.id,kind:"failed",reason:"unsupported"});r=l.salt,i=l.detectorLimit;try{let u=await Oe(l.baseUrl,Ce,l.maxDownloadMs,t.fetch,t.now);s=u.downloadMs,o=u.cached;let S=await WebAssembly.compile(u.files.get("sekyro-ocr.wasm")),R=await t.instantiate(S),x=new TextDecoder("utf-8",{fatal:!0}).decode(u.files.get("mrz_dict.txt"));R.load(E.DETECTOR,u.files.get("det.param"),u.files.get("det.bin")),R.load(E.LATIN,u.files.get("mrz-rec.param"),u.files.get("mrz-rec.bin"),x,{mrz:!0}),u.files.clear(),n=R,a({id:l.id,kind:"ready",warmupMs:0,downloadMs:s,cached:o})}catch(u){a({id:l.id,kind:"failed",reason:u instanceof z?u.reason:"error"})}}async function p(l,u,S,R){if(!n)return u.close(),a({id:l,kind:"error",code:"not_ready"});let x=u.width,L=u.height,w=t.canvas(x,L);if(!w)return u.close(),a({id:l,kind:"failed",reason:"unsupported"});let K=w.draw(u);u.close();try{a({id:l,...await at(n,K,x,L,{detectorLimit:R,salt:r,region:S,now:t.now})})}catch{a({id:l,kind:"error",code:"OCR_INFERENCE_FAILED"})}}async function f(l,u,S){if(!n)return u.close(),a({id:l,kind:"error",code:"not_ready"});let R=u.width,x=u.height,L=t.canvas(R,x);if(!L)return u.close(),a({id:l,kind:"failed",reason:"unsupported"});let w=L.draw(u);u.close();try{let K=t.now(),W=n.read(w,R,x,[0,0,1,1],1,oe,F.NONE,S);a({id:l,kind:"layout",ms:Math.round(t.now()-K),lineBoxes:ct(W.map(V=>V.box),R,x)})}catch{a({id:l,kind:"error",code:"OCR_INFERENCE_FAILED"})}}async function g(l){if(!n)return a({id:l,kind:"error",code:"not_ready"});let u=mt(),S=()=>n.read(u.rgba,u.width,u.height,[0,0,1,1],1,oe,F.LATIN,960),R,x;try{let L=t.now();S();let w=t.now();S(),R=Math.round(w-L),x=Math.round(t.now()-w)}catch{return a({id:l,kind:"error",code:"OCR_INFERENCE_FAILED"})}a({id:l,kind:"ready",warmupMs:R,benchMs:x,downloadMs:s,cached:o})}async function b(l){switch(l.kind){case"init":return d(l);case"warmup":return g(l.id);case"band":return p(l.id,l.bitmap,void 0,l.detectorLimit);case"still":return p(l.id,l.bitmap,l.region,l.detectorLimit);case"layout":return f(l.id,l.bitmap,l.detectorLimit);case"dispose":n?.dispose(),n=null,e.close();return}}e.onmessage=l=>{let u=l.data;c=c.then(()=>b(u)).catch(()=>a({id:u.id,kind:"error",code:"OCR_INFERENCE_FAILED"}))}}typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&sn(self);export{rn as defaultDeps,sn as installOcrWorkerHost};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";var be=Object.defineProperty;var xt=Object.getOwnPropertyDescriptor;var At=Object.getOwnPropertyNames;var Mt=Object.prototype.hasOwnProperty;var St=(e,t)=>{for(var n in t)be(e,n,{get:t[n],enumerable:!0})},Rt=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of At(t))!Mt.call(e,i)&&i!==n&&be(e,i,{get:()=>t[i],enumerable:!(r=xt(t,i))||r.enumerable});return e};var Tt=e=>Rt(be({},"__esModule",{value:!0}),e);var pn={};St(pn,{defaultDeps:()=>gt,installOcrWorkerHost:()=>yt});module.exports=Tt(pn);var k={fp12:"936b9c4ccc4a",engine:"sekyro-ocr-1",precision:"fp32",files:{"sekyro-ocr.wasm":{bytes:3550687,sha256:"00d6b1a4e42da8146e662ab0283b97485397811acc806299046933ce1943fb09",tier:"live",contentType:"application/wasm"},"sekyro-ocr.mjs":{bytes:4270,sha256:"209a78d96ca53344996a0c2300aed4ff8a5c69e142713216975a2840eec08cac",tier:"bundled",contentType:"text/javascript"},"det.param":{bytes:24252,sha256:"c39ba0b1195e8ad37cfc5bdd7acedcfc1d9cb901e7b8eb1c9c4f6e5a66c04eb3",tier:"live",contentType:"text/plain"},"det.bin":{bytes:4685856,sha256:"652bafe366565109a1a5766caf482bc46f01481f8044d3a785bd9a1be67c63bb",tier:"live",contentType:"application/octet-stream"},"mrz-rec.param":{bytes:3510,sha256:"bc69b1b9683e35f6605b21001fadeb81468063459c00c0fc83c67c139f23df01",tier:"live",contentType:"text/plain"},"mrz-rec.bin":{bytes:494196,sha256:"de93a2aa2f08670cc7dedd17ba378d2f5d7cf6ae409054a9eac863a02c2febae",tier:"live",contentType:"application/octet-stream"},"mrz_dict.txt":{bytes:73,sha256:"b19858a4de2ccbbbdd4b53982188ea2c7664013183bbd1ae9d20ab52c661f97f",tier:"live",contentType:"text/plain"},"v5-latin-fp16.param":{bytes:19800,sha256:"843964335e9863681bb17d876c69e7315844e0850e3c04f91b11a3f0c2a57bc6",tier:"lazy",group:"latin",contentType:"text/plain"},"v5-latin-fp16.bin":{bytes:3995900,sha256:"0516474d30cff75a6365869992699d27fbc03f00fcf3d7274c3eed651ee6ea90",tier:"lazy",group:"latin",contentType:"application/octet-stream"},"latin.dict.txt":{bytes:2615,sha256:"c3ab00106e4a4d151a8575b1129b91901a68a35b79a81fd63faab00418b87d75",tier:"lazy",group:"latin",contentType:"text/plain"},"v5-arabic-fp16.param":{bytes:19791,sha256:"1d1e219d277bb1a76909741573f56cfae465f11b61a9be4ca4c29580758c8760",tier:"lazy",group:"arabic",contentType:"text/plain"},"v5-arabic-fp16.bin":{bytes:3974364,sha256:"4ced47b32ab4e7ad16ddebc074f31594eb42b912465a8ed7458bb2842af9efe1",tier:"lazy",group:"arabic",contentType:"application/octet-stream"},"arabic.dict.txt":{bytes:2368,sha256:"8f239c13f6c8b1bdf15f332a65a05002ddd4d99b9286a4bfaf6f0327c36ebbec",tier:"lazy",group:"arabic",contentType:"text/plain"},"v5-cyrillic-fp16.param":{bytes:19806,sha256:"c87b42bfa343509b319dd193dcca4c0e20bb13b1d07bfbf4925a9f5d045966d4",tier:"lazy",group:"cyrillic",contentType:"text/plain"},"v5-cyrillic-fp16.bin":{bytes:3999288,sha256:"97446e221c0d2d84cb76dca6d4217a850efad4d5ec85e3fadc78db353cf97afa",tier:"lazy",group:"cyrillic",contentType:"application/octet-stream"},"cyrillic.dict.txt":{bytes:2780,sha256:"2de016b31edd687acfc1bf72170f4feff9f0c4893edac87cef30b2c5a82443ec",tier:"lazy",group:"cyrillic",contentType:"text/plain"},"v5-greek-fp16.param":{bytes:19815,sha256:"1cc1d47d3aa3fce86d3dbe901a553fd29412f44934a4919d986c155d23f63207",tier:"lazy",group:"greek",contentType:"text/plain"},"v5-greek-fp16.bin":{bytes:3879256,sha256:"04190cd4ee2b023665346d4cd239ee118965f837812108869d3d9894d30c4db3",tier:"lazy",group:"greek",contentType:"application/octet-stream"},"greek.dict.txt":{bytes:1102,sha256:"60e017885fd98fd0fb5c402da86179f1fe24ae229b374b3b96d313f99a09de59",tier:"lazy",group:"greek",contentType:"text/plain"},"v5-devanagari-fp16.param":{bytes:19807,sha256:"c6540a818cbb46c5b511dc4dd20ebfeae9038ec64e5cf175cd2d25f1b9f95c51",tier:"lazy",group:"devanagari",contentType:"text/plain"},"v5-devanagari-fp16.bin":{bytes:3931044,sha256:"d3086391eb2298c4d4e5a6d20a7fc58a8d0f3ce0a12395c88e9d485c5d595828",tier:"lazy",group:"devanagari",contentType:"application/octet-stream"},"devanagari.dict.txt":{bytes:1942,sha256:"c66d17ef6ced6fbfb4413810e75f0f788cfde37d4192bd17af7923fa190066c8",tier:"lazy",group:"devanagari",contentType:"text/plain"},"v5-thai-fp16.param":{bytes:19786,sha256:"4422df9dcc960e42082166adcca42da2aa6df62abebc75daf0c887e89381c039",tier:"lazy",group:"thai",contentType:"text/plain"},"v5-thai-fp16.bin":{bytes:3920396,sha256:"3458d7c5f0a7f88cb804d084c6596dea3f67c5ea99082654938d71a4eb72a079",tier:"lazy",group:"thai",contentType:"application/octet-stream"},"thai.dict.txt":{bytes:1766,sha256:"e0f32101004cc828ed4505bba80126be06e282700c4c79175ed2b21a4d454dfa",tier:"lazy",group:"thai",contentType:"text/plain"},"v5-hangul-fp16.param":{bytes:19804,sha256:"8daec1a4aa09d3bc92a476438330921c910263b8e61d62334d79e2d1dd14247c",tier:"lazy",group:"hangul",contentType:"text/plain"},"v5-hangul-fp16.bin":{bytes:6684280,sha256:"1d38192b59765cf71c1909ea4b972ee3c8588537a53844e6830f57fbf47976a4",tier:"lazy",group:"hangul",contentType:"application/octet-stream"},"hangul.dict.txt":{bytes:47450,sha256:"a7872c929cd25cf615cdfea08579cf800db1943900fe683468df4dcff6f848bb",tier:"lazy",group:"hangul",contentType:"text/plain"}},scripts:{latin:{classes:838,rtl:!1,param:"v5-latin-fp16.param",bin:"v5-latin-fp16.bin",dict:"latin.dict.txt"},arabic:{classes:749,rtl:!0,param:"v5-arabic-fp16.param",bin:"v5-arabic-fp16.bin",dict:"arabic.dict.txt"},cyrillic:{classes:852,rtl:!1,param:"v5-cyrillic-fp16.param",bin:"v5-cyrillic-fp16.bin",dict:"cyrillic.dict.txt"},greek:{classes:356,rtl:!1,param:"v5-greek-fp16.param",bin:"v5-greek-fp16.bin",dict:"greek.dict.txt"},devanagari:{classes:570,rtl:!1,param:"v5-devanagari-fp16.param",bin:"v5-devanagari-fp16.bin",dict:"devanagari.dict.txt"},thai:{classes:526,rtl:!1,param:"v5-thai-fp16.param",bin:"v5-thai-fp16.bin",dict:"thai.dict.txt"},hangul:{classes:11947,rtl:!1,param:"v5-hangul-fp16.param",bin:"v5-hangul-fp16.bin",dict:"hangul.dict.txt"}}};var It="sekyro-mrz-1";function Nt(e){return Array.from(new Uint8Array(e),t=>t.toString(16).padStart(2,"0")).join("")}async function ge(e){return Nt(await crypto.subtle.digest("SHA-256",e))}function Ce(e,t){return ge(new TextEncoder().encode(`${It}\0${e}\0${t.join(`
|
|
2
|
+
`)}`))}var z=class extends Error{constructor(t){super(t),this.name="AssetFailure",this.reason=t}},Oe=Object.keys(k.files).filter(e=>k.files[e].tier==="live"),An=Object.keys(k.files).filter(e=>k.files[e].tier==="lazy");function _t(e,t){return`${e.replace(/\/+$/,"")}/${k.fp12}/${t}`}async function Et(e,t,n,r=fetch,i=()=>performance.now()){let s=k.files[t],o=i(),c=async p=>{try{let f=await r(_t(e,t),{cache:p,signal:n,credentials:"omit"});if(!f.ok)throw new z("download");return await f.arrayBuffer()}catch(f){throw f instanceof z?f:new z("download")}},a=async p=>p.byteLength===s.bytes&&await ge(p)===s.sha256,d=await c("force-cache");if(!await a(d)&&(d=await c("reload"),!await a(d)))throw new z("integrity");return{bytes:d,ms:i()-o}}async function Le(e,t,n,r=fetch,i=()=>performance.now()){let s=new AbortController,o=new Map,c=t.reduce((f,g)=>f+k.files[g].bytes,0),a=i(),d=!0,p=0;for(let f of t){let g=await Et(e,f,s.signal,r,i);o.set(f,g.bytes),g.ms>=50&&(d=!1),p+=g.bytes.byteLength;let b=i()-a;if(p<c&&b>0&&b*c/p>n)throw s.abort(),new z("download")}return{files:o,downloadMs:Math.round(i()-a),cached:d}}var T=class extends Error{constructor(t){super(t),this.name="OcrFailure",this.code=t}};function ue(e){return[...e.split(`
|
|
3
|
+
`)," "]}function we(e,t,n,r,i){if(n<2||e.length===0||e.length!==t.length||r.length<n-1)throw new T("OCR_INFERENCE_FAILED");let s="",o=-1,c=0,a=0;for(let p=0;p<e.length;p++){let f=e[p];if(!Number.isInteger(f)||f<0||f>=n)throw new T("OCR_INFERENCE_FAILED");f!==0&&f!==o&&(s+=r[f-1],c+=Math.fround(t[p]),a++),o=f}return{text:i?Array.from(s).reverse().join(""):s,score:a===0?0:c/a}}var ye="latin",In=Object.keys(k.scripts);function De(e){return Object.prototype.hasOwnProperty.call(k.scripts,e)}function ve(e){let t=k.scripts[e];return{script:e,classes:t.classes,rtl:t.rtl,param:t.param,bin:t.bin,dict:t.dict}}function ke(e,t){let n=ue(e);if(e.endsWith(`
|
|
4
|
+
`)||n.length!==t-1)throw new T("OCR_ASSET_INVALID");return n}var Be=e=>e.reduce((t,n)=>t+n,0)/e.length;function Pe(e){let t=e.filter(i=>i.score>=.5);if(t.length===0)return[];if(t.some(i=>i.box.length!==4||!Number.isFinite(i.score)||i.box.some(s=>!Number.isFinite(s.x)||!Number.isFinite(s.y))))throw new T("OCR_INFERENCE_FAILED");let n=Be(t.map(i=>i.box[2].y-i.box[0].y)),r=[];for(let i of t){let s=(i.box[0].y+i.box[2].y)/2,o=r.find(c=>Math.abs((c[0].box[0].y+c[0].box[2].y)/2-s)<n/2);o===void 0?r.push([i]):o.push(i)}for(let i of r)i.sort((s,o)=>s.box[0].x-o.box[0].x);return r.sort((i,s)=>i[0].box[0].y-s[0].box[0].y),r.map(i=>{let s=i[0].box,o=i[i.length-1].box,c=[s[0],o[1],o[2],s[3]];return{text:i.map(a=>a.text).join(" "),x:Math.min(...c.map(a=>a.x)),y:Math.min(...c.map(a=>a.y)),x2:Math.max(...c.map(a=>a.x)),y2:Math.max(...c.map(a=>a.y)),score:Be(i.map(a=>a.score))}})}var j={of(e,t,n){return!Number.isInteger(e)||!Number.isInteger(t)||!Number.isInteger(n)||t<1||t>12||n<1||n>new Date(Date.UTC(e,t,0)).getUTCDate()?null:{year:e,month:t,day:n}},iso(e){return`${String(e.year).padStart(4,"0")}-${String(e.month).padStart(2,"0")}-${String(e.day).padStart(2,"0")}`},parse(e){let[t,n,r]=e.split("-").map(Number);return{year:t,month:n,day:r}},today(){let e=new Date;return{year:e.getFullYear(),month:e.getMonth()+1,day:e.getDate()}}},Ge=30,ze=36,He=44,he="MRT",Ct=[7,3,1],Ot=/^[0-9]{6}$/,Ae=/^[0-9]{10}$/,Ke=e=>e!==void 0&&e.length===1&&e>="0"&&e<="9";function Lt(e){return e>="0"&&e<="9"?e.charCodeAt(0)-48:e>="A"&&e<="Z"?e.charCodeAt(0)-55:0}function fe(e){let t=0;for(let n=0;n<e.length;n++)t+=Lt(e[n])*Ct[n%3];return String(t%10)}function v(e,t){return t==="<"?null:Ke(t)?fe(e)===t:!1}function de(e){return e.trim().toUpperCase().replaceAll(" ","")}function wt(e,t){return(de(e)+"<".repeat(t)).slice(0,t)}function B(e){return e.replace(/^<+|<+$/g,"")}var Dt=new Set(`ABW AFG AGO AIA ALA ALB AND ARE ARG ARM ASM ATA ATF ATG AUS AUT AZE BDI BEL BEN BES BFA BGD BGR BHR
|
|
5
|
+
BHS BIH BLM BLR BLZ BMU BOL BRA BRB BRN BTN BVT BWA CAF CAN CCK CHE CHL CHN CIV CMR COD COG COK COL
|
|
6
|
+
COM CPV CRI CUB CUW CXR CYM CYP CZE DEU DJI DMA DNK DOM DZA ECU EGY ERI ESH ESP EST ETH FIN FJI FLK
|
|
7
|
+
FRA FRO FSM GAB GBR GEO GGY GHA GIB GIN GLP GMB GNB GNQ GRC GRD GRL GTM GUF GUM GUY HKG HMD HND HRV
|
|
8
|
+
HTI HUN IDN IMN IND IOT IRL IRN IRQ ISL ISR ITA JAM JEY JOR JPN KAZ KEN KGZ KHM KIR KNA KOR KWT LAO
|
|
9
|
+
LBN LBR LBY LCA LIE LKA LSO LTU LUX LVA MAC MAF MAR MCO MDA MDG MDV MEX MHL MKD MLI MLT MMR MNE MNG
|
|
10
|
+
MNP MOZ MRT MSR MTQ MUS MWI MYS MYT NAM NCL NER NFK NGA NIC NIU NLD NOR NPL NRU NZL OMN PAK PAN PCN
|
|
11
|
+
PER PHL PLW PNG POL PRI PRK PRT PRY PSE PYF QAT REU ROU RUS RWA SAU SDN SEN SGP SGS SHN SJM SLB SLE
|
|
12
|
+
SLV SMR SOM SPM SRB SSD STP SUR SVK SVN SWE SWZ SXM SYC SYR TCA TCD TGO THA TJK TKL TKM TLS TON TTO
|
|
13
|
+
TUN TUR TUV TWN TZA UGA UKR UMI URY USA UZB VAT VCT VEN VGB VIR VNM VUT WLF WSM XKK YEM ZAF ZMB ZWE`.trim().split(/\s+/)),vt=new Set(`D GBD GBN GBO GBP GBS RKS UNK UNO UNA EUE XBA XIM XCC XCE XCO XDC XEC XES XMP XOM XPO XXA XXB XXC
|
|
14
|
+
XXX ANT NTZ UTO`.trim().split(/\s+/));function kt(e){return Dt.has(e)||vt.has(e)}var Bt="012568",Pt="OIZSGB",Ft="OQDILZSGB",Ut="000112568";function xe(e){let t=Bt.indexOf(e);return e.length!==1||t<0?e:Pt[t]}function Gt(e){let t=Ft.indexOf(e);return e.length!==1||t<0?e:Ut[t]}var zt=[["\xAB","<<"],["\u2039","<"],["\uFF1C","<"],["\u3008","<"],["\xD7","X"]],We=[`aaccc${"x".repeat(9)}n${"x".repeat(15)}`,`${"n".repeat(7)}x${"n".repeat(7)}ccc${"x".repeat(11)}n`,"a".repeat(30)],Ve=[`aaccc${"a".repeat(31)}`,`${"x".repeat(9)}nccc${"n".repeat(7)}x${"n".repeat(7)}${"x".repeat(7)}n`],Ye=[`aaccc${"a".repeat(39)}`,`${"x".repeat(9)}nccc${"n".repeat(7)}x${"n".repeat(7)}${"x".repeat(14)}nn`];function Ht(e,t){let n="",r=0;for(;r<t.length;){let i=t[r];if(i==="c"){let o=e.substring(r,r+3),c=Array.from(o,xe).join("");n+=c!==o&&kt(c.replaceAll("<",""))?c:o,r+=3;continue}let s=e[r];n+=i==="a"?xe(s):i==="n"?Gt(s):s,r++}return n}function ee(e,t,n){return n.slice(0,e.length).map((r,i)=>{let s=zt.reduce((o,[c,a])=>o.replaceAll(c,a),de(e[i]));return Ht(wt(s,t),r)})}function Ze(e,t){let n=e.filter(r=>r.trim().length>0);return t==="TD1"?ee(n.slice(0,3),Ge,We):t==="TD2"?ee(n.slice(0,2),ze,Ve):ee(n.slice(0,2),He,Ye)}function Me(e){let t=`${e.toUpperCase()}<<`.slice(0,2);return t==="AC"?"unknown":t==="IR"||t==="AR"||"ACRT".includes(t[0])?"residence_permit":t[0]==="P"?"passport":t[0]==="I"?"carte_identite":"unknown"}function Kt(e){return Ae.test(e)&&Number(e)%97===1}function Wt(e,t,n){if(!Ot.test(e))return null;let r=Number(e.slice(0,2)),i=t?2e3+r:r>n.year%100?1900+r:2e3+r;return j.of(i,Number(e.slice(2,4)),Number(e.slice(4,6)))}function te(e,t,n){let r=Wt(e,t,n);return r?j.iso(r):""}function Se(e){let t=e.split("<<").filter(n=>B(n).length>0);return[(t[0]??"").replaceAll("<"," ").trim(),(t[1]??"").replaceAll("<"," ").trim()]}var Re=e=>e==="M"||e==="F"?e:"",Vt=e=>e.substring(0,2).replaceAll("<",""),se=e=>e.substring(2,5).replaceAll("<","");function Xe(e,t,n){if(t==="<"&&B(n).length>0){let r=n.indexOf("<"),i=r<0?n:n.slice(0,r);if(i.length>=2){let s=e+i.slice(0,-1);if(v(s,i[i.length-1])===!0)return{value:B(s),ok:!0,warn:null}}return{value:B(e),ok:!1,warn:"docnum_cd_mismatch"}}return{value:B(e),ok:v(e,t),warn:null}}var H=(e,t)=>({success:!1,error:e,fields:{},checkDigits:{},hardCdFail:!1,warns:[],...t===void 0?{}:{linesCount:t}});function Te(e,t,n,r,i,s,o){return{success:!0,documentType:e,format:t,documentCode:Vt(n),fields:r,checkDigits:i,hardCdFail:s,warns:o}}function Yt(e,t){if(e.length<3)return H("mrz_incomplete");let[n,r,i]=ee(e.slice(0,3),Ge,We),s=se(n)===he||r.substring(15,18)===he||Kt(n.substring(15,25)),o=[],c={},a,d,p=!1;if(s){a=B(n.substring(5,14));let x=n[14];Ke(x)?(d=fe(n.substring(5,14))===x,d||o.push("td1_docnum_cd_mismatch")):d=null}else{let x=Xe(n.substring(5,14),n[14],n.substring(15,30));if(x.ok===null)return H("mrz_incomplete");a=x.value,d=x.ok,p=x.ok===!1&&x.warn===null,x.warn!==null&&o.push(x.warn)}c.document_number=d;let f=v(r.substring(0,6),r[6]),g=v(r.substring(8,14),r[14]);if(c.birth_date=f,c.expiry_date=g,f===null||g===null)return H("mrz_incomplete");let b=v(n.substring(5,30)+r.substring(0,7)+r.substring(8,15)+r.substring(18,29),r[29]);c.composite=b,b===!1&&o.push("composite_cd_mismatch");let l=s?n.substring(15,25):"",[u,S]=Se(i),R=f===!1||g===!1||p;return Te(Me(n.substring(0,2)),"TD1",n,{issuing_state:se(n),document_number:a,nni:Ae.test(l)?l:"",birth_date:te(r.substring(0,6),!1,t),expiry_date:te(r.substring(8,14),!0,t),sex:Re(r[7]),nationality:B(r.substring(15,18)),surname:u,given_names:S},c,R,o)}function Zt(e,t){if(e.length<2)return H("mrz_incomplete");let[n,r]=ee(e.slice(0,2),ze,Ve),i=[],s=Xe(r.substring(0,9),r[9],r.substring(28,35));s.warn!==null&&i.push(s.warn);let o=v(r.substring(13,19),r[19]),c=v(r.substring(21,27),r[27]),a={document_number:s.ok,birth_date:o,expiry_date:c};if(s.ok===null||o===null||c===null)return H("mrz_incomplete");let d=v(r.substring(0,10)+r.substring(13,20)+r.substring(21,35),r[35]);a.composite=d,d===!1&&i.push("composite_cd_mismatch");let[p,f]=Se(n.substring(5,36)),g=s.ok===!1&&s.warn===null||o===!1||c===!1;return Te(Me(n.substring(0,2)),"TD2",n,{issuing_state:se(n),document_number:s.value,nni:"",birth_date:te(r.substring(13,19),!1,t),expiry_date:te(r.substring(21,27),!0,t),sex:Re(r[20]),nationality:B(r.substring(10,13)),surname:p,given_names:f},a,g,i)}function Fe(e,t){if(e.length<2)return H("mrz_incomplete");let[n,r]=ee(e.slice(0,2),He,Ye),i=se(n)===he,s=[],o={},c=r.substring(0,9),a=v(c,r[9]),d=v(r.substring(13,19),r[19]),p=v(r.substring(21,27),r[27]);if(o.document_number=a,o.birth_date=d,o.expiry_date=p,a===null||d===null||p===null)return H("mrz_incomplete");let f=r.substring(28,42),g="";if(B(f).length>0){let R=v(f,r[42]);o.personal_number=R;let x=B(f);i&&R!==!1&&Ae.test(x)&&(g=x)}let b=v(r.substring(0,10)+r.substring(13,20)+r.substring(21,43),r[43]);o.composite=b,b===!1&&s.push("composite_cd_mismatch");let[l,u]=Se(n.substring(5,44)),S=a===!1||d===!1||p===!1;return Te(Me(n.substring(0,2)),"TD3",n,{issuing_state:se(n),document_number:B(c),nni_candidate:g,birth_date:te(r.substring(13,19),!1,t),expiry_date:te(r.substring(21,27),!0,t),sex:Re(r[20]),nationality:B(r.substring(10,13)),surname:l,given_names:u},o,S,s)}var Ue=new Set(["A","C","I"]),Xt=new Set(["R","T"]);function $e(e,t=j.today()){let n=e.filter(i=>i.trim().length>0);if(n.length===0)return H("mrz_unrecognized",0);let r=Array.from(de(n[0]).slice(0,1),xe).join("");return n.length===3&&(Ue.has(r)||Xt.has(r))?Yt(n,t):n.length===2&&r==="P"?Fe(n,t):n.length===2&&Ue.has(r)?Math.max(...n.map(i=>de(i).length))>40?Fe(n,t):Zt(n,t):H("mrz_unrecognized",n.length)}var $t=new Map([...(`ABWAW AFGAF AGOAO AIAAI ALAAX ALBAL ANDAD AREAE ARGAR ARMAM ASMAS ATAAQ
|
|
15
|
+
ATFTF ATGAG AUSAU AUTAT AZEAZ BDIBI BELBE BENBJ BESBQ BFABF BGDBD BGRBG
|
|
16
|
+
BHRBH BHSBS BIHBA BLMBL BLRBY BLZBZ BMUBM BOLBO BRABR BRBBB BRNBN BTNBT
|
|
17
|
+
BVTBV BWABW CAFCF CANCA CCKCC CHECH CHLCL CHNCN CIVCI CMRCM CODCD COGCG
|
|
18
|
+
COKCK COLCO COMKM CPVCV CRICR CUBCU CUWCW CXRCX CYMKY CYPCY CZECZ DEUDE
|
|
19
|
+
DJIDJ DMADM DNKDK DOMDO DZADZ ECUEC EGYEG ERIER ESHEH ESPES ESTEE ETHET
|
|
20
|
+
FINFI FJIFJ FLKFK FRAFR FROFO FSMFM GABGA GBRGB GEOGE GGYGG GHAGH GIBGI
|
|
21
|
+
GINGN GLPGP GMBGM GNBGW GNQGQ GRCGR GRDGD GRLGL GTMGT GUFGF GUMGU GUYGY
|
|
22
|
+
HKGHK HMDHM HNDHN HRVHR HTIHT HUNHU IDNID IMNIM INDIN IOTIO IRLIE IRNIR
|
|
23
|
+
IRQIQ ISLIS ISRIL ITAIT JAMJM JEYJE JORJO JPNJP KAZKZ KENKE KGZKG KHMKH
|
|
24
|
+
KIRKI KNAKN KORKR KWTKW LAOLA LBNLB LBRLR LBYLY LCALC LIELI LKALK LSOLS
|
|
25
|
+
LTULT LUXLU LVALV MACMO MAFMF MARMA MCOMC MDAMD MDGMG MDVMV MEXMX MHLMH
|
|
26
|
+
MKDMK MLIML MLTMT MMRMM MNEME MNGMN MNPMP MOZMZ MRTMR MSRMS MTQMQ MUSMU
|
|
27
|
+
MWIMW MYSMY MYTYT NAMNA NCLNC NERNE NFKNF NGANG NICNI NIUNU NLDNL NORNO
|
|
28
|
+
NPLNP NRUNR NZLNZ OMNOM PAKPK PANPA PCNPN PERPE PHLPH PLWPW PNGPG POLPL
|
|
29
|
+
PRIPR PRKKP PRTPT PRYPY PSEPS PYFPF QATQA REURE ROURO RUSRU RWARW SAUSA
|
|
30
|
+
SDNSD SENSN SGPSG SGSGS SHNSH SJMSJ SLBSB SLESL SLVSV SMRSM SOMSO SPMPM
|
|
31
|
+
SRBRS SSDSS STPST SURSR SVKSK SVNSI SWESE SWZSZ SXMSX SYCSC SYRSY TCATC
|
|
32
|
+
TCDTD TGOTG THATH TJKTJ TKLTK TKMTM TLSTL TONTO TTOTT TUNTN TURTR TUVTV
|
|
33
|
+
TWNTW TZATZ UGAUG UKRUA UMIUM URYUY USAUS UZBUZ VATVA VCTVC VENVE VGBVG
|
|
34
|
+
VIRVI VNMVN VUTVU WLFWF WSMWS YEMYE ZAFZA ZMBZM ZWEZW`.match(/[A-Z]{5}/g)??[]).map(e=>[e.slice(0,3),e.slice(3)]),["D","DE"]]),Je={of(e){return $t.get(e.replaceAll("<",""))??null}};var Ne=e=>fe(e);function nt(e){return e.slice(0,5e4).split(/\r?\n/).slice(0,200).map(t=>t.toUpperCase().replace(/[«‹〈]/g,"<").replace(/[^A-Z0-9<]/g,"")).filter(t=>t.length>0)}var je=e=>e.replace(/[OQ]/g,"0").replace(/[IL]/g,"1").replaceAll("Z","2").replaceAll("S","5").replaceAll("B","8");function Qe(e,t){let n=je(e),r=je(t);if(!/^\d{6}$/.test(n)||Ne(n)!==r)return null;let i=2e3+Number(n.slice(0,2)),s=Number(n.slice(2,4)),o=Number(n.slice(4,6));return s>=1&&s<=12&&o>=1&&o<=new Date(Date.UTC(i,s,0)).getUTCDate()?n:null}function Ie(e,t){let n=e.replace(/<+$/,"");return/^[A-Z0-9]+$/.test(n)&&Ne(e)===t?n:null}function Jt(e){if(e.length<15)return null;if(e[14]!=="<")return Ie(e.substring(5,14),e[14]);let t=/^([A-Z0-9]+)</.exec(e.substring(15,Math.min(30,e.length)))?.[1];return t===void 0||t.length<2?null:Ie(e.substring(5,14)+t.slice(0,-1),t[t.length-1])}var A=(e,t,n)=>t>=e.length?"":e.substring(t,Math.min(n,e.length)),Z=(e,t)=>t<e.length?e[t]:"",qe=/^[IAC][A-Z<][A-Z<]{3}/,jt=/^P[A-Z<][A-Z<]{3}/,rt=/^[PIAC][A-Z<][A-Z<]{3}/;function Qt(e){let t=nt(e),n=[],r=[];for(let s=0;s<t.length;s++){let o="",c=0;for(;c<6&&s+c<t.length&&(o+=t[s+c],!(o.length>300));)r.push(o),c++}let i=(s,o,c)=>{if(o.length<(c?15:28))return;let a=new Map,d=c?Jt(s):Ie(A(o,0,9),Z(o,9)),p=Qe(c?A(o,0,6):A(o,13,19),c?Z(o,6):Z(o,19)),f=Qe(c?A(o,8,14):A(o,21,27),c?Z(o,14):Z(o,27));d!==null&&a.set("docNumber",d),p!==null&&a.set("dob6",p),f!==null&&a.set("expiry6",f),a.size>0&&n.push({fields:a,country:Je.of(A(s,2,5))})};for(let s of r)qe.test(s)&&(s.length>=45&&i(s.substring(0,30),s.substring(30),!0),s.length>=64&&i(s.substring(0,36),s.substring(36),!1)),jt.test(s)&&s.length>=72&&i(s.substring(0,44),s.substring(44),!1);for(let s=0;s<t.length-1;s++){let o=t[s],c=t[s+1];qe.test(o)&&o.length>=15&&o.length<=30&&i(o,c,!0),rt.test(o)&&o.length>=5&&o.length<=44&&i(o,c,!1)}return n}function qt(e){let t=Qt(e);if(t.length===0)return{};let n=Math.max(...t.map(s=>s.fields.size)),r=t.filter(s=>s.fields.size===n),i={};for(let s of["docNumber","dob6","expiry6"]){let o=new Set(r.map(c=>c.fields.get(s)).filter(c=>c!==void 0));o.size===1&&r.every(c=>c.fields.has(s))&&(i[s]=[...o][0])}return i}function en(e){let t=qt(e),n=t.docNumber,r=t.dob6,i=t.expiry6;return n!==void 0&&r!==void 0&&i!==void 0?{docNumber:n,dob6:r,expiry6:i}:null}function it(e){let t=nn(e);return t.length===1?t[0]:null}var tn=e=>JSON.stringify([e.documentNumber,e.nationality,e.dob,e.sex,e.expiry,e.primaryIdentifier,e.secondaryIdentifier,e.optional]);function nn(e){let t=nt(e),n=[];for(let i=0;i<t.length;i++){let s=t[i];if(!rt.test(s))continue;let o=s.startsWith("P")?[44]:[30,36];for(let c of o){let a=c===30?3:2,d=t.slice(i,Math.min(t.length,i+a));d.length===a&&d.every(g=>g.length<=c)&&n.push(d.map(g=>g.padEnd(c,"<")).join(`
|
|
35
|
+
`));let p="",f=0;for(;f<6&&i+f<t.length&&(p+=t[i+f],p.length===c*a&&n.push(p),!(p.length>=c*a));)f++}}let r=new Map;for(let i of n){let s=en(i);if(s===null)continue;let o=i.includes(`
|
|
36
|
+
`)?i.split(`
|
|
37
|
+
`):i.match(i.length===90?/.{30}/g:i.length===88?/.{44}/g:/.{36}/g)??[],c=o[0]??"",a=o[1]??"",d=o.length===3,p=d?A(c,5,30)+A(a,0,7)+A(a,8,15)+A(a,18,29):A(a,0,10)+A(a,13,20)+A(a,21,a.length-1),f=d?Z(a,29):Z(a,a.length-1);if(!/^[0-9]$/.test(f)||Ne(p)!==f)continue;let g=rn(i);if(g===null||g.primaryIdentifier.length===0&&g.secondaryIdentifier.length===0||!/^[MFX]?$/.test(g.sex))continue;let b={...g,documentNumber:s.docNumber,dob:s.dob6,expiry:s.expiry6};r.set(tn(b),{fields:b,mrzLines:o})}return[...r.values()]}var U=e=>e.replaceAll("<"," ").replace(/\s+/g," ").trim();function et(e){let t=e.split("<<");return[U(t[0]??""),U(t.slice(1).join("<<"))]}var tt=e=>e.length===0?null:e;function rn(e){let t=e.split(/\r?\n/).map(r=>r.replace(/\s+$/,"")).filter(r=>r.length>0),n=e.replace(/[\r\n]/g,"");if(t.length===1&&(n.length===90?t=[n.substring(0,30),n.substring(30,60),n.substring(60,90)]:n.length===72?t=[n.substring(0,36),n.substring(36,72)]:n.length===88&&(t=[n.substring(0,44),n.substring(44,88)])),t.length===3){let[r,i,s]=t,o=Z(r,14)==="<"?/^([A-Z0-9]+)</.exec(A(r,15,30))?.[1]:void 0,c=U(A(r,5,14)+(o!==void 0&&o.length>1?o.slice(0,-1):"")),[a,d]=et(s),p=U(`${A(r,15,30)}<${A(i,18,29)}`);return{documentNumber:c,nationality:U(A(i,15,18)),dob:A(i,0,6),sex:U(A(i,7,8)),expiry:A(i,8,14),primaryIdentifier:a,secondaryIdentifier:d,optional:tt(p)}}if(t.length===2){let[r,i]=t,s=r.length>=44,[o,c]=et(A(r,5,s?44:36));return{documentNumber:U(A(i,0,9)),nationality:U(A(i,10,13)),dob:A(i,13,19),sex:U(A(i,20,21)),expiry:A(i,21,27),primaryIdentifier:o,secondaryIdentifier:c,optional:tt(U(s?A(i,28,42):A(i,28,35)))}}return null}function st(e,t=j.today()){let n=$e(e,t),r=n.format??null,i=r==="TD1"||r==="TD2"||r==="TD3"?Ze(e,r):[...e];return{format:r,documentCode:n.documentCode??null,lines:i,valid:n.success&&!n.hardCdFail}}var sn=/^[A-Z0-9<]{25,}$/;function on(e){return e.toUpperCase().replaceAll(" ","").replaceAll("\xAB","<").replaceAll("\u2039","<")}var _e=(e,t,n)=>e.length>=t&&e.length<=n;function ot(e){let t=e.map(on).filter(n=>sn.test(n));for(let n=0;n+3<=t.length;n++){let r=t.slice(n,n+3);if(r.every(i=>_e(i,28,32))&&"IAC".includes(r[0][0]))return r}for(let n=0;n+2<=t.length;n++){let r=t.slice(n,n+2);if(r.every(i=>_e(i,40,46))&&r[0].startsWith("P")||r.every(i=>_e(i,34,38))&&"IACPV".includes(r[0][0]))return r}return[]}var ne={SIZE:80,SCRIPT:64,OFFSET:68,STEPS:72},E={DETECTOR:0,LATIN:1,ARABIC:2},F={NONE:0,LATIN:1,ARABIC:2,BOTH:3},oe=3;var X=e=>Math.round(Math.min(1,Math.max(0,e))*1e4)/1e4;async function ct(e,t,n,r,i){let s=i.now??(()=>performance.now()),o=s(),a=e.read(t,n,r,i.region??[0,0,1,1],1,oe,F.LATIN,i.detectorLimit).map(u=>({text:u.latin.text,score:u.latin.score,box:[0,1,2,3].map(S=>({x:u.box[2*S],y:u.box[2*S+1]}))})),d=Pe([...a].reverse()),p=d.map(u=>u.text),f=[...it(p.join(`
|
|
38
|
+
`))?.mrzLines??ot(p)],g=d.map(u=>[X(u.x/n),X(u.y/r),X((u.x2-u.x)/n),X((u.y2-u.y)/r)]),b={kind:"band",ms:0,lineBoxes:g,lineCount:f.length,valid:!1},l=cn(d.map(u=>u.text),g,f);if(l!==null&&(b.mrzBox=l),f.length>0){let u=st(f,i.today??j.today());u.format&&(b.format=u.format),u.documentCode&&/^[A-Z<]{1,2}$/.test(u.documentCode)&&(b.documentCode=u.documentCode),u.valid&&(b.valid=!0,b.digest=await Ce(i.salt,u.lines))}return b.ms=Math.round(s()-o),b}var at=e=>e.toUpperCase().replace(/\s+/g,"");function an(e,t){let n=Math.max(e.length,t.length);if(n===0)return 0;let r=0;for(let i=0;i<Math.min(e.length,t.length);i++)e[i]===t[i]&&r++;return r/n}function cn(e,t,n){if(n.length===0||e.length===0)return null;let r=new Set,i=[];for(let d of n){let p=-1,f=.5;if(e.forEach((g,b)=>{let l=r.has(b)?0:an(at(g),at(d));l>f&&(f=l,p=b)}),p<0)return null;r.add(p),i.push(t[p])}let s=Math.min(...i.map(d=>d[0])),o=Math.min(...i.map(d=>d[1])),c=Math.max(...i.map(d=>d[0]+d[2])),a=Math.max(...i.map(d=>d[1]+d[3]));return[X(s),X(o),X(c-s),X(a-o)]}var Kn=Object.freeze({minLines:4,fillMin:.55,fillMax:.98,offsetMax:.12,steadyFillDelta:.04,steadyOffsetDelta:.03,layoutShiftMax:.025,lineCountDelta:1,lockMs:600,steadyMs:900,minFrames:3});function lt(e,t,n){let r=i=>Math.round(Math.min(1,Math.max(0,i))*1e4)/1e4;return e.map(i=>{let s=[i[0],i[2],i[4],i[6]],o=[i[1],i[3],i[5],i[7]],c=Math.min(...s),a=Math.min(...o);return[r(c/t),r(a/n),r((Math.max(...s)-c)/t),r((Math.max(...o)-a)/n)]}).sort((i,s)=>i[1]-s[1]||i[0]-s[0])}var ut={};async function ln(e={}){var t,n=e,r=ut.url,i="",s,o;try{i=new URL(".",r).href}catch{}o=m=>{var h=new XMLHttpRequest;return h.open("GET",m,!1),h.responseType="arraybuffer",h.send(null),new Uint8Array(h.response)},s=async m=>{if(m=await fetch(m,{credentials:"same-origin"}),m.ok)return m.arrayBuffer();throw Error(m.status+" : "+m.url)};var c=console.log.bind(console),a=console.error.bind(console),d=!1,p,f,g,b,l,u=!1;function S(){var m=ce.buffer;new Int8Array(m),new Int16Array(m),n.HEAPU8=g=new Uint8Array(m),new Uint16Array(m),new Int32Array(m),b=new Uint32Array(m),new Float32Array(m),new Float64Array(m),l=new BigInt64Array(m),new BigUint64Array(m)}function R(m){throw m="Aborted("+m+")",a(m),d=!0,m+=". Build with -sASSERTIONS for more info.",u&&Q(),m=new WebAssembly.RuntimeError(m),f?.(m),m}var x;async function L(m){try{var h=await s(m);return new Uint8Array(h)}catch{}if(o)m=o(m);else throw"both async and sync fetching of the wasm failed";return m}async function w(m,h){try{var y=await L(m);return await WebAssembly.instantiate(y,h)}catch(I){a(`failed to asynchronously prepare wasm: ${I}`),R(I)}}async function K(m){var h=x;try{var y=fetch(h,{credentials:"same-origin"});return await WebAssembly.instantiateStreaming(y,m)}catch(I){a(`wasm streaming compile failed: ${I}`),a("falling back to ArrayBuffer instantiation")}return w(h,m)}var W={},V=()=>{if(!$){var m={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",_:"./this.program"},h;for(h in W)W[h]===void 0?delete m[h]:m[h]=W[h];var y=[];for(h in m)y.push(`${h}=${m[h]}`);$=y}return $},$,J=[null,[],[]],ae=globalThis.TextDecoder&&new TextDecoder,Q,ce,ht={i:()=>R(""),b:function(m,h,y){return 0<=m&&3>=m?(l[y>>3]=BigInt(Math.round(1e6*(m===0?Date.now():performance.now()))),0):28},d:()=>1073741824,c:m=>{var h=g.length;if(m>>>=0,1073741824<m)return!1;for(var y=1;4>=y;y*=2){var I=h*(1+.2/y);I=Math.min(I,m+100663296);e:{I=(Math.min(1073741824,65536*Math.ceil(Math.max(m,I)/65536))-ce.buffer.byteLength+65535)/65536|0;try{ce.grow(I),S();var C=1;break e}catch{}C=void 0}if(C)return!0}return!1},f:(m,h)=>{var y=0,I=0,C;for(C of V()){var M=h+y;b[m+I>>2]=M;for(var q=C,D=g,re=M,G=M+1/0-1,N=0;N<q.length;++N){var _=q.codePointAt(N);if(127>=_){if(M>=G)break;D[M++]=_}else if(2047>=_){if(M+1>=G)break;D[M++]=192|_>>6,D[M++]=128|_&63}else if(65535>=_){if(M+2>=G)break;D[M++]=224|_>>12,D[M++]=128|_>>6&63,D[M++]=128|_&63}else{if(M+3>=G)break;D[M++]=240|_>>18,D[M++]=128|_>>12&63,D[M++]=128|_>>6&63,D[M++]=128|_&63,N++}}D[M]=0,q=M-re,y+=q+1,I+=4}return 0},g:(m,h)=>{var y=V();b[m>>2]=y.length,m=0;for(var I of y){for(var C=y=0;C<I.length;++C){var M=I.charCodeAt(C);127>=M?y++:2047>=M?y+=2:55296<=M&&57343>=M?(y+=4,++C):y+=3}m+=y+1}return b[h>>2]=m,0},j:()=>52,h:()=>52,e:function(){return 70},a:(m,h,y,I)=>{for(var C=0,M=0;M<y;M++){var q=b[h>>2],D=b[h+4>>2];h+=8;for(var re=0;re<D;re++){var G=m,N=g[q+re],_=J[G];if(N===0||N===10){G=G===1?c:a,N=_;for(var Y=0,ie=N,P=Y,O=P+void 0;ie[P]&&!(P>=O);)++P;if(ie=P,16<ie-Y&&N.buffer&&ae)N=ae.decode(N.subarray(Y,ie));else{for(P="";Y<ie;)if(O=N[Y++],O&128){var pe=N[Y++]&63;if((O&224)==192)P+=String.fromCharCode((O&31)<<6|pe);else{var Ee=N[Y++]&63;O=(O&240)==224?(O&15)<<12|pe<<6|Ee:(O&7)<<18|pe<<12|Ee<<6|N[Y++]&63,65536>O?P+=String.fromCharCode(O):(O-=65536,P+=String.fromCharCode(55296|O>>10,56320|O&1023))}}else P+=String.fromCharCode(O);N=P}G(N),_.length=0}else _.push(N)}C+=D}return b[I>>2]=C,0}},le;return le=await(async function(){function m(y){return y=le=y.exports,n._skw_engine_id=y.m,n._skw_load=y.n,n._skw_unload=y.o,n._skw_set_detector_limit=y.p,n._skw_read=y.q,n._skw_line_count=y.r,n._skw_lines=y.s,n._skw_best=y.t,n._skw_values=y.u,n._skw_sharpness=y.v,n._free=y.w,n._malloc=y.x,Q=y.y,ce=y.k,S(),le}var h={a:ht};return n.instantiateWasm?new Promise(y=>{n.instantiateWasm(h,(I,C)=>{y(m(I,C))})}):(x??(x=n.locateFile?n.locateFile?n.locateFile("sekyro-ocr.wasm",i):i+"sekyro-ocr.wasm":new URL("sekyro-ocr.wasm",ut.url).href),m((await K(h)).instance))})(),n.calledRun=!0,d||(u=!0,le.l(),p?.(n)),u?t=n:t=new Promise((m,h)=>{p=m,f=h}),t}var dt=ln;function ft(e){return e===1||e===5?new T("OCR_IMAGE_INVALID"):e===2?new T("OCR_ASSET_INVALID"):e===4?new T("OCR_CANCELLED"):e===6?new T("OCR_BUSY"):e===7?new T("OCR_UNAVAILABLE"):new T("OCR_INFERENCE_FAILED")}var me=class{constructor(t){this.m=t;this.px=0;this.pxBytes=0;this.dicts=[null,null,null];this.classes=[0,0,0];this.held=[[],[],[]];this.latinKind="latin";this.scripts=[null,null,null]}engineId(){let t=this.m._skw_engine_id(),n="";for(let r=t;this.m.HEAPU8[r]!==0&&r<t+64;r++)n+=String.fromCharCode(this.m.HEAPU8[r]);return n}put(t){let n=this.m._malloc(t.length);if(!n)throw new T("OCR_UNAVAILABLE");return this.m.HEAPU8.set(t,n),n}load(t,n,r,i,s={}){this.unload(t);let o=new Uint8Array(n),c=new Uint8Array(o.byteLength+1);c.set(o);let a=null,d=0,p=null;if(s.mrz===!0){if(t!==E.LATIN||i===void 0||!fn(i)||s.script!==void 0)throw new T("OCR_ASSET_INVALID");a=ue(i),d=mt(i)}else if(t!==E.DETECTOR){if(p=s.script??(t===E.LATIN?ye:"arabic"),i===void 0||!De(p)||t===E.LATIN!=(p===ye))throw new T("OCR_ASSET_INVALID");d=ve(p).classes,a=ke(i,d)}else if(i!==void 0||s.script!==void 0)throw new T("OCR_ASSET_INVALID");let f=new Uint8Array(r),g=this.put(c),b=this.put(f);this.held[t]=[g,b];let l=this.m._skw_load(t,g,c.length,b,f.byteLength,d);if(l!==0)throw this.unload(t),ft(l);this.dicts[t]=a,this.classes[t]=d,this.scripts[t]=p,t===E.LATIN&&(this.latinKind=s.mrz===!0?"mrz":"latin")}recognizer(){return this.loaded(E.LATIN)?this.latinKind:null}secondScript(){return this.loaded(E.ARABIC)?this.scripts[E.ARABIC]:null}unload(t){this.held[t].length&&this.m._skw_unload(t);for(let n of this.held[t])this.m._free(n);this.held[t]=[],this.dicts[t]=null,this.scripts[t]=null}loaded(t){return this.held[t].length>0}pixels(t){if(t.length>this.pxBytes){if(this.px&&this.m._free(this.px),this.px=this.m._malloc(t.length),!this.px)throw new T("OCR_UNAVAILABLE");this.pxBytes=t.length}return this.m.HEAPU8.set(t,this.px),this.px}sharpness(t,n,r){let i=this.m._skw_sharpness(this.pixels(t),n,r);return i>=0&&Number.isFinite(i)?i:null}read(t,n,r,i,s,o,c,a){if(!un(c))throw new T("OCR_IMAGE_INVALID");if(c&F.LATIN&&!this.dicts[E.LATIN]||c&F.ARABIC&&!this.dicts[E.ARABIC]||!this.loaded(0))throw new T("OCR_UNAVAILABLE");let d=this.pixels(t);this.m._skw_set_detector_limit(a);let p=this.m._skw_read(d,n,r,i[0],i[1],i[2],i[3],s,o,c);if(p!==0)throw ft(p);let f=this.m._skw_line_count(),g=this.m.HEAPU8.buffer,b=new DataView(g,this.m._skw_lines(),f*ne.SIZE),l=new Int32Array(g,this.m._skw_best()),u=new Float32Array(g,this.m._skw_values()),S=[];for(let R=0;R<f;R++){let x=R*ne.SIZE,L=b.getInt32(x+ne.SCRIPT,!0),w=b.getInt32(x+ne.OFFSET,!0),K=b.getInt32(x+ne.STEPS,!0);if(c===F.NONE){S.push({box:Array.from({length:8},(ae,Q)=>b.getFloat64(x+8*Q,!0))});continue}let W=this.dicts[L];if(!W)throw new T("OCR_INFERENCE_FAILED");let V=we(l.subarray(w,w+K),u.subarray(w,w+K),this.classes[L],W,!1),$=Array.from({length:8},(ae,Q)=>b.getFloat64(x+8*Q,!0)),J=S[S.length-1];L===E.ARABIC&&J&&J.arabic===void 0&&J.latin!==void 0&&dn(J.box,$)?J.arabic=V:S.push(L===E.ARABIC?{box:$,arabic:V}:{box:$,latin:V})}return S}heapBytes(){return this.m.HEAPU8.length}dispose(){for(let t of[0,1,2])this.unload(t);this.px&&this.m._free(this.px),this.px=0,this.pxBytes=0}};function mt(e){return(e.endsWith(`
|
|
39
|
+
`)?e.slice(0,-1):e).split(`
|
|
40
|
+
`).length+2}var un=e=>Number.isInteger(e)&&e>=F.NONE&&e<=F.BOTH,dn=(e,t)=>e.every((n,r)=>n===t[r]);function fn(e){let t=e.split(`
|
|
41
|
+
`);return t.length===37&&new Set(t).size===37&&t.every(n=>/^[0-9A-Z<]$/.test(n))&&mt(e)===39}async function pt(e){let t=await dt({instantiateWasm:(n,r)=>(WebAssembly.instantiate(e,n).then(i=>r(i,e)),{})});return new me(t)}var qn=Object.freeze({low:Object.freeze({stride:1,bandWidthPx:960}),mid:Object.freeze({stride:2,bandWidthPx:1280}),high:Object.freeze({stride:1,bandWidthPx:1280})});function bt(){let n=new Uint8Array(1228800).fill(255),r=24301,i=()=>(r=r*1103515245+12345&2147483647,r/2147483647),s=(d,p)=>{let f=(p*960+d)*4;n[f]=20,n[f+1]=20,n[f+2]=20},o=20,c=14,a=28;for(let d of[110,190])for(let p=0;p<44;p++){let f=40+p*o;if(i()<.25){for(let b=0;b<c/2;b++)for(let l=0;l<2;l++)s(f+c/2-b,d+a/2-b+l),s(f+c/2-b,d+a/2+b+l);continue}let g=Math.floor(i()*(c-3));for(let b=0;b<a;b++)for(let l=0;l<3;l++)s(f+g+l,d+b);for(let b of[0,a/2-1,a-3])if(!(i()<.4))for(let l=0;l<c;l++)for(let u=0;u<3;u++)s(f+l,d+b+u)}return{rgba:n,width:960,height:320}}function mn(){let e=null,t=null;return(n,r)=>{if(typeof OffscreenCanvas!="function"||(e||(e=new OffscreenCanvas(n,r),t=e.getContext("2d",{willReadFrequently:!0})),!t))return null;(e.width!==n||e.height!==r)&&(e.width=n,e.height=r);let i=t;return{draw(s){return i.clearRect(0,0,n,r),i.drawImage(s,0,0),i.getImageData(0,0,n,r).data}}}}function gt(){return{fetch:(...e)=>fetch(...e),now:()=>performance.now(),canvas:mn(),instantiate:pt}}function yt(e,t=gt()){let n=null,r="",i=960,s=0,o=!1,c=Promise.resolve(),a=l=>e.postMessage(l);async function d(l){if(t.canvas(1,1)===null)return a({id:l.id,kind:"failed",reason:"unsupported"});r=l.salt,i=l.detectorLimit;try{let u=await Le(l.baseUrl,Oe,l.maxDownloadMs,t.fetch,t.now);s=u.downloadMs,o=u.cached;let S=await WebAssembly.compile(u.files.get("sekyro-ocr.wasm")),R=await t.instantiate(S),x=new TextDecoder("utf-8",{fatal:!0}).decode(u.files.get("mrz_dict.txt"));R.load(E.DETECTOR,u.files.get("det.param"),u.files.get("det.bin")),R.load(E.LATIN,u.files.get("mrz-rec.param"),u.files.get("mrz-rec.bin"),x,{mrz:!0}),u.files.clear(),n=R,a({id:l.id,kind:"ready",warmupMs:0,downloadMs:s,cached:o})}catch(u){a({id:l.id,kind:"failed",reason:u instanceof z?u.reason:"error"})}}async function p(l,u,S,R){if(!n)return u.close(),a({id:l,kind:"error",code:"not_ready"});let x=u.width,L=u.height,w=t.canvas(x,L);if(!w)return u.close(),a({id:l,kind:"failed",reason:"unsupported"});let K=w.draw(u);u.close();try{a({id:l,...await ct(n,K,x,L,{detectorLimit:R,salt:r,region:S,now:t.now})})}catch{a({id:l,kind:"error",code:"OCR_INFERENCE_FAILED"})}}async function f(l,u,S){if(!n)return u.close(),a({id:l,kind:"error",code:"not_ready"});let R=u.width,x=u.height,L=t.canvas(R,x);if(!L)return u.close(),a({id:l,kind:"failed",reason:"unsupported"});let w=L.draw(u);u.close();try{let K=t.now(),W=n.read(w,R,x,[0,0,1,1],1,oe,F.NONE,S);a({id:l,kind:"layout",ms:Math.round(t.now()-K),lineBoxes:lt(W.map(V=>V.box),R,x)})}catch{a({id:l,kind:"error",code:"OCR_INFERENCE_FAILED"})}}async function g(l){if(!n)return a({id:l,kind:"error",code:"not_ready"});let u=bt(),S=()=>n.read(u.rgba,u.width,u.height,[0,0,1,1],1,oe,F.LATIN,960),R,x;try{let L=t.now();S();let w=t.now();S(),R=Math.round(w-L),x=Math.round(t.now()-w)}catch{return a({id:l,kind:"error",code:"OCR_INFERENCE_FAILED"})}a({id:l,kind:"ready",warmupMs:R,benchMs:x,downloadMs:s,cached:o})}async function b(l){switch(l.kind){case"init":return d(l);case"warmup":return g(l.id);case"band":return p(l.id,l.bitmap,void 0,l.detectorLimit);case"still":return p(l.id,l.bitmap,l.region,l.detectorLimit);case"layout":return f(l.id,l.bitmap,l.detectorLimit);case"dispose":n?.dispose(),n=null,e.close();return}}e.onmessage=l=>{let u=l.data;c=c.then(()=>b(u)).catch(()=>a({id:u.id,kind:"error",code:"OCR_INFERENCE_FAILED"}))}}typeof WorkerGlobalScope<"u"&&typeof self<"u"&&self instanceof WorkerGlobalScope&&yt(self);0&&(module.exports={defaultDeps,installOcrWorkerHost});
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { O as OCR_ASSET_SET } from '../../assets.generated-DpkbvoII.cjs';
|
|
2
|
+
|
|
3
|
+
interface OcrDecoded {
|
|
4
|
+
readonly text: string;
|
|
5
|
+
readonly score: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
type PrintedScript = keyof typeof OCR_ASSET_SET.scripts;
|
|
9
|
+
|
|
10
|
+
/** The Emscripten module surface the binding exports (bindings/exports.json). */
|
|
11
|
+
interface SekyroOcrModule {
|
|
12
|
+
HEAPU8: Uint8Array;
|
|
13
|
+
_malloc(n: number): number;
|
|
14
|
+
_free(p: number): void;
|
|
15
|
+
_skw_engine_id(): number;
|
|
16
|
+
_skw_load(model: number, param: number, paramBytes: number, weights: number, weightBytes: number, classes: number): number;
|
|
17
|
+
_skw_unload(model: number): void;
|
|
18
|
+
_skw_set_detector_limit(limit: number): void;
|
|
19
|
+
_skw_read(px: number, w: number, h: number, x: number, y: number, rw: number, rh: number, scale: number, op: number, scripts: number): number;
|
|
20
|
+
_skw_line_count(): number;
|
|
21
|
+
_skw_lines(): number;
|
|
22
|
+
_skw_best(): number;
|
|
23
|
+
_skw_values(): number;
|
|
24
|
+
_skw_sharpness(px: number, w: number, h: number): number;
|
|
25
|
+
}
|
|
26
|
+
/** One detected line: its source box (x1,y1 … x4,y4, source pixels) and each requested script's decode. */
|
|
27
|
+
interface EngineLine {
|
|
28
|
+
readonly box: readonly number[];
|
|
29
|
+
readonly latin?: OcrDecoded;
|
|
30
|
+
readonly arabic?: OcrDecoded;
|
|
31
|
+
}
|
|
32
|
+
declare class WasmEngine {
|
|
33
|
+
private readonly m;
|
|
34
|
+
private px;
|
|
35
|
+
private pxBytes;
|
|
36
|
+
private dicts;
|
|
37
|
+
private classes;
|
|
38
|
+
private held;
|
|
39
|
+
private latinKind;
|
|
40
|
+
/** The v5 script each recognizer slot holds (slot 1: latin; slot 2: the document's non-Latin script). */
|
|
41
|
+
private scripts;
|
|
42
|
+
constructor(m: SekyroOcrModule);
|
|
43
|
+
engineId(): string;
|
|
44
|
+
private put;
|
|
45
|
+
/**
|
|
46
|
+
* Loads a net; `dict` (UTF-8 text) for a recognizer. The heap copies live until [unload] (ncnn keeps pointers).
|
|
47
|
+
* `mrz`: the MRZ-only recognizer (spec D10; sekyro-mobile/ocr-models/mrz) in the LATIN slot instead of PP-OCR Latin:
|
|
48
|
+
* the same engine read and `recognize` callback, its own 37-symbol dictionary (39 classes with blank + space).
|
|
49
|
+
* Otherwise a PP-OCRv5 printed-text recognizer (spec 2026-11-15 D4, v5-models.ts): `script` `latin` in the LATIN slot
|
|
50
|
+
* (the default there), any other v5 script in slot 2 (the binding's ARABIC slot; `arabic` the default there). Its
|
|
51
|
+
* class count is the script's (838 Latin, 749 Arabic, …) and its dictionary must have exactly classes − 1 entries
|
|
52
|
+
* with no trailing newline; any other shape is the wrong file (OCR_ASSET_INVALID), as on Android.
|
|
53
|
+
*/
|
|
54
|
+
load(model: 0 | 1 | 2, param: ArrayBuffer | Uint8Array, weights: ArrayBuffer | Uint8Array, dict?: string, o?: {
|
|
55
|
+
mrz?: boolean;
|
|
56
|
+
script?: PrintedScript;
|
|
57
|
+
}): void;
|
|
58
|
+
/** Which recognizer the LATIN slot holds (null when none). */
|
|
59
|
+
recognizer(): "latin" | "mrz" | null;
|
|
60
|
+
/** The v5 script slot 2 holds (the document's non-Latin script), null when empty. */
|
|
61
|
+
secondScript(): PrintedScript | null;
|
|
62
|
+
unload(model: 0 | 1 | 2): void;
|
|
63
|
+
loaded(model: 0 | 1 | 2): boolean;
|
|
64
|
+
private pixels;
|
|
65
|
+
/** Blur-gate measure of an RGBA image; null when not measurable (Kotlin `N.s(...).takeIf { it >= 0 }`). */
|
|
66
|
+
sharpness(rgba: Uint8Array | Uint8ClampedArray, w: number, h: number): number | null;
|
|
67
|
+
/**
|
|
68
|
+
* One engine read: `region` normalized [x, y, w, h], `op` the detector operation (3 cover … 9 inkLines), `scripts`
|
|
69
|
+
* SCRIPTS.LATIN | ARABIC | BOTH (or NONE: the detected line boxes only, no recognizer), `limit` the detector input
|
|
70
|
+
* long side.
|
|
71
|
+
*/
|
|
72
|
+
read(rgba: Uint8Array | Uint8ClampedArray, w: number, h: number, region: readonly number[], scale: number, op: number, scripts: number, limit: number): EngineLine[];
|
|
73
|
+
/** Current wasm heap size (it only grows): the memory telemetry of a read profile. */
|
|
74
|
+
heapBytes(): number;
|
|
75
|
+
dispose(): void;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
interface OcrWorkerScope {
|
|
79
|
+
onmessage: ((event: {
|
|
80
|
+
data: unknown;
|
|
81
|
+
}) => void) | null;
|
|
82
|
+
postMessage(data: unknown): void;
|
|
83
|
+
close(): void;
|
|
84
|
+
}
|
|
85
|
+
interface OcrWorkerDeps {
|
|
86
|
+
fetch: typeof fetch;
|
|
87
|
+
now: () => number;
|
|
88
|
+
/** The 2D canvas the worker draws bitmaps on (null = unsupported: OffscreenCanvas 2D missing in this worker). */
|
|
89
|
+
canvas: (w: number, h: number) => {
|
|
90
|
+
draw(bitmap: ImageBitmap): Uint8ClampedArray;
|
|
91
|
+
} | null;
|
|
92
|
+
instantiate: (module: WebAssembly.Module) => Promise<WasmEngine>;
|
|
93
|
+
}
|
|
94
|
+
declare function defaultDeps(): OcrWorkerDeps;
|
|
95
|
+
declare function installOcrWorkerHost(scope: OcrWorkerScope, deps?: OcrWorkerDeps): void;
|
|
96
|
+
|
|
97
|
+
export { type OcrWorkerDeps, type OcrWorkerScope, defaultDeps, installOcrWorkerHost };
|