@sekyro/web 0.1.0-rc.33 → 0.1.0-rc.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (59) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/assets.generated-DpkbvoII.d.cts +249 -0
  3. package/dist/assets.generated-DpkbvoII.d.ts +249 -0
  4. package/dist/{capture-session-doc-FAMDLRRZ.js → capture-session-doc-GCL2FYQH.js} +1 -1
  5. package/dist/{chunk-B5H5ED6O.js → chunk-7KI6HWCZ.js} +1 -1
  6. package/dist/chunk-AJPVHUZR.js +3 -0
  7. package/dist/{chunk-ZKF2XMNX.js → chunk-BD4KIQQD.js} +1 -1
  8. package/dist/{chunk-NO22WG7R.js → chunk-CHWTIUYK.js} +1 -1
  9. package/dist/chunk-DSNJ2ERA.js +1 -0
  10. package/dist/{chunk-G2BD6INN.js → chunk-ERCKQV6V.js} +1 -1
  11. package/dist/chunk-ISMVEF7H.js +1 -0
  12. package/dist/{chunk-HFRU66NW.js → chunk-JFTEP2WJ.js} +1 -1
  13. package/dist/chunk-JULJQOVT.js +1 -0
  14. package/dist/chunk-LTMDEMCV.js +1 -0
  15. package/dist/chunk-M3KW2MY3.js +1 -0
  16. package/dist/{chunk-C4WK5D33.js → chunk-NXNQQXYJ.js} +1 -1
  17. package/dist/chunk-QB62OPX5.js +1 -0
  18. package/dist/{chunk-65YTEYLU.js → chunk-UVZ5R4CI.js} +1 -1
  19. package/dist/chunk-Y5C4YJQT.js +1 -0
  20. package/dist/client/index.cjs +1 -1
  21. package/dist/client/index.d.cts +2 -2
  22. package/dist/client/index.d.ts +2 -2
  23. package/dist/client/index.js +1 -1
  24. package/dist/core/index.cjs +1 -1
  25. package/dist/core/index.js +1 -1
  26. package/dist/core/ocr/worker.bundle.js +13 -14
  27. package/dist/core/ocr/worker.cjs +12 -13
  28. package/dist/core/ocr/worker.d.cts +13 -0
  29. package/dist/core/ocr/worker.d.ts +13 -0
  30. package/dist/core/ocr/worker.js +11 -12
  31. package/dist/create-document-capture-IMDGCTMM.js +1 -0
  32. package/dist/{create-verification-BAoA5Z9o.d.cts → create-verification-DmK48vdr.d.cts} +107 -4
  33. package/dist/{create-verification-C1Svvmup.d.ts → create-verification-YC-R5v_z.d.ts} +107 -4
  34. package/dist/{detector-scanic-S4PB2RNW.js → detector-scanic-QVQVJI3C.js} +1 -1
  35. package/dist/{icao-gate-BBStoG81.d.ts → icao-gate-BGhxz9O2.d.ts} +7 -1
  36. package/dist/{icao-gate-C731iewN.d.cts → icao-gate-Dj4kIwna.d.cts} +7 -1
  37. package/dist/{icao-policy-Dy5Z1vSp.d.ts → icao-policy-D48k64KJ.d.ts} +1 -1
  38. package/dist/{icao-policy-R7Jk5qF_.d.cts → icao-policy-D4QqzA0b.d.cts} +1 -1
  39. package/dist/index.cjs +3 -3
  40. package/dist/index.d.cts +4 -4
  41. package/dist/index.d.ts +4 -4
  42. package/dist/index.js +1 -1
  43. package/dist/internal/index.cjs +3 -3
  44. package/dist/internal/index.d.cts +15 -99
  45. package/dist/internal/index.d.ts +15 -99
  46. package/dist/internal/index.js +1 -1
  47. package/dist/plan-runner-HBUVNDGH.js +1 -0
  48. package/package.json +1 -1
  49. package/sbom.cdx.json +19 -19
  50. package/dist/chunk-DFTCAWMP.js +0 -1
  51. package/dist/chunk-DK5YPBDQ.js +0 -1
  52. package/dist/chunk-G6LKLN4U.js +0 -1
  53. package/dist/chunk-IUNPV67T.js +0 -1
  54. package/dist/chunk-MJKHDXCU.js +0 -1
  55. package/dist/chunk-W6Y2335Q.js +0 -1
  56. package/dist/chunk-YDG77RHN.js +0 -1
  57. package/dist/chunk-YL2B72KC.js +0 -3
  58. package/dist/create-document-capture-WFTNVMCE.js +0 -1
  59. package/dist/plan-runner-LSQTIO6L.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # @sekyro/web
2
2
 
3
+ ## 0.1.0-rc.34
4
+
5
+ ### Patch Changes
6
+
7
+ - e38c7e2: Document capture: on a two-sided document without an MRZ whose barcode is on the back, a photo taken after the front is kept as the back even when the barcode could not be decoded on the device (glare, focus), as the native SDKs do. The server's read still decides.
8
+ - 5c2b1fa: Every hosted API call sends the verification's `locale` in the `sekyro-client-locale` header. The server uses it to show your Form step's questions, intro and consent text in the person's language when the form has that language, even when the form is the first screen. Before, a person saw your text in the form's source language until consent was recorded. `HostedClient` takes the same value as its new `locale` option.
9
+ - 24c87ef: Document capture: the live MRZ reader now runs on low-memory phones too. The engine's warm-up times one read of a built-in MRZ band and, with the phone's memory where the browser reports it, picks a tier: a fast phone reads every frame, a mid phone every second frame, and a slow or low-memory phone reads one band after another at 960 px. Device memory no longer turns the reader off (`capture.document.liveMrz.minDeviceMemoryGb` is ignored); only a browser without WebAssembly SIMD, workers or image bitmaps keeps the server-only read. The server's `bandMaxWidthPx` is capped by the tier and `minIntervalMs` still spaces reads. Reads pause while the page is hidden. On low-end phones with live MRZ on, the camera asks for 2560 × 1440 when the card guide is narrower than 89 % of the width, so the card stays at least 960 px wide in the frames the reader sees. The `live_mrz` capture report gains optional `tier` and `benchMs`. In the device still read, the MRZ recovery passes use the MRZ recognizer (`WasmDocumentOcr` reads script `mrz` on the engine passed as `mrz`).
10
+ - ea2bd51: Document capture: after the person picks a country and a document type, the SDK asks the server for that document's capture facts (`GET /hosted/document-facts`, from the live document catalog) and builds the capture from them, so a catalog correction reaches capture without an SDK update. It waits at most 1.5 s from the pick; with no answer in time, an error or an older server, capture follows the catalog built into the SDK, as before. The capture plan now also names the scripts printed on the picked document.
11
+ - b3a1018: Document capture: the device still read uses the PP-OCRv5 printed-text recognizers. Latin is the base lazy set and each other script with a model (Arabic, Cyrillic, Greek, Devanagari, Thai, Korean) is its own lazy group, fetched only when the picked document prints it. The scripts come from the server's capture facts when they arrive, otherwise from the catalog built into the SDK. These files are fetched only on mid and high tier devices and only when the still read is on (`capture.document.ocr.web.enabledOnline`, off by default; the second script also needs `ocr.web.arabic`). They are never fetched on the low tier. Each file is checked by length and sha256 before it loads, and a failed download only means Latin only, or no device read; capture is never blocked and the server reads the rest. The older `latin-rec` and `arabic-rec` recognizers are gone from the web asset set. The live set is unchanged, but its fingerprint directory changes. No API change.
12
+
3
13
  ## 0.1.0-rc.33
4
14
 
5
15
  ### Patch Changes
@@ -0,0 +1,249 @@
1
+ declare const OCR_ASSET_SET: {
2
+ readonly fp12: "936b9c4ccc4a";
3
+ readonly engine: "sekyro-ocr-1";
4
+ readonly precision: "fp32";
5
+ readonly files: {
6
+ readonly "sekyro-ocr.wasm": {
7
+ readonly bytes: 3550687;
8
+ readonly sha256: "00d6b1a4e42da8146e662ab0283b97485397811acc806299046933ce1943fb09";
9
+ readonly tier: "live";
10
+ readonly contentType: "application/wasm";
11
+ };
12
+ readonly "sekyro-ocr.mjs": {
13
+ readonly bytes: 4270;
14
+ readonly sha256: "209a78d96ca53344996a0c2300aed4ff8a5c69e142713216975a2840eec08cac";
15
+ readonly tier: "bundled";
16
+ readonly contentType: "text/javascript";
17
+ };
18
+ readonly "det.param": {
19
+ readonly bytes: 24252;
20
+ readonly sha256: "c39ba0b1195e8ad37cfc5bdd7acedcfc1d9cb901e7b8eb1c9c4f6e5a66c04eb3";
21
+ readonly tier: "live";
22
+ readonly contentType: "text/plain";
23
+ };
24
+ readonly "det.bin": {
25
+ readonly bytes: 4685856;
26
+ readonly sha256: "652bafe366565109a1a5766caf482bc46f01481f8044d3a785bd9a1be67c63bb";
27
+ readonly tier: "live";
28
+ readonly contentType: "application/octet-stream";
29
+ };
30
+ readonly "mrz-rec.param": {
31
+ readonly bytes: 3510;
32
+ readonly sha256: "bc69b1b9683e35f6605b21001fadeb81468063459c00c0fc83c67c139f23df01";
33
+ readonly tier: "live";
34
+ readonly contentType: "text/plain";
35
+ };
36
+ readonly "mrz-rec.bin": {
37
+ readonly bytes: 494196;
38
+ readonly sha256: "de93a2aa2f08670cc7dedd17ba378d2f5d7cf6ae409054a9eac863a02c2febae";
39
+ readonly tier: "live";
40
+ readonly contentType: "application/octet-stream";
41
+ };
42
+ readonly "mrz_dict.txt": {
43
+ readonly bytes: 73;
44
+ readonly sha256: "b19858a4de2ccbbbdd4b53982188ea2c7664013183bbd1ae9d20ab52c661f97f";
45
+ readonly tier: "live";
46
+ readonly contentType: "text/plain";
47
+ };
48
+ readonly "v5-latin-fp16.param": {
49
+ readonly bytes: 19800;
50
+ readonly sha256: "843964335e9863681bb17d876c69e7315844e0850e3c04f91b11a3f0c2a57bc6";
51
+ readonly tier: "lazy";
52
+ readonly group: "latin";
53
+ readonly contentType: "text/plain";
54
+ };
55
+ readonly "v5-latin-fp16.bin": {
56
+ readonly bytes: 3995900;
57
+ readonly sha256: "0516474d30cff75a6365869992699d27fbc03f00fcf3d7274c3eed651ee6ea90";
58
+ readonly tier: "lazy";
59
+ readonly group: "latin";
60
+ readonly contentType: "application/octet-stream";
61
+ };
62
+ readonly "latin.dict.txt": {
63
+ readonly bytes: 2615;
64
+ readonly sha256: "c3ab00106e4a4d151a8575b1129b91901a68a35b79a81fd63faab00418b87d75";
65
+ readonly tier: "lazy";
66
+ readonly group: "latin";
67
+ readonly contentType: "text/plain";
68
+ };
69
+ readonly "v5-arabic-fp16.param": {
70
+ readonly bytes: 19791;
71
+ readonly sha256: "1d1e219d277bb1a76909741573f56cfae465f11b61a9be4ca4c29580758c8760";
72
+ readonly tier: "lazy";
73
+ readonly group: "arabic";
74
+ readonly contentType: "text/plain";
75
+ };
76
+ readonly "v5-arabic-fp16.bin": {
77
+ readonly bytes: 3974364;
78
+ readonly sha256: "4ced47b32ab4e7ad16ddebc074f31594eb42b912465a8ed7458bb2842af9efe1";
79
+ readonly tier: "lazy";
80
+ readonly group: "arabic";
81
+ readonly contentType: "application/octet-stream";
82
+ };
83
+ readonly "arabic.dict.txt": {
84
+ readonly bytes: 2368;
85
+ readonly sha256: "8f239c13f6c8b1bdf15f332a65a05002ddd4d99b9286a4bfaf6f0327c36ebbec";
86
+ readonly tier: "lazy";
87
+ readonly group: "arabic";
88
+ readonly contentType: "text/plain";
89
+ };
90
+ readonly "v5-cyrillic-fp16.param": {
91
+ readonly bytes: 19806;
92
+ readonly sha256: "c87b42bfa343509b319dd193dcca4c0e20bb13b1d07bfbf4925a9f5d045966d4";
93
+ readonly tier: "lazy";
94
+ readonly group: "cyrillic";
95
+ readonly contentType: "text/plain";
96
+ };
97
+ readonly "v5-cyrillic-fp16.bin": {
98
+ readonly bytes: 3999288;
99
+ readonly sha256: "97446e221c0d2d84cb76dca6d4217a850efad4d5ec85e3fadc78db353cf97afa";
100
+ readonly tier: "lazy";
101
+ readonly group: "cyrillic";
102
+ readonly contentType: "application/octet-stream";
103
+ };
104
+ readonly "cyrillic.dict.txt": {
105
+ readonly bytes: 2780;
106
+ readonly sha256: "2de016b31edd687acfc1bf72170f4feff9f0c4893edac87cef30b2c5a82443ec";
107
+ readonly tier: "lazy";
108
+ readonly group: "cyrillic";
109
+ readonly contentType: "text/plain";
110
+ };
111
+ readonly "v5-greek-fp16.param": {
112
+ readonly bytes: 19815;
113
+ readonly sha256: "1cc1d47d3aa3fce86d3dbe901a553fd29412f44934a4919d986c155d23f63207";
114
+ readonly tier: "lazy";
115
+ readonly group: "greek";
116
+ readonly contentType: "text/plain";
117
+ };
118
+ readonly "v5-greek-fp16.bin": {
119
+ readonly bytes: 3879256;
120
+ readonly sha256: "04190cd4ee2b023665346d4cd239ee118965f837812108869d3d9894d30c4db3";
121
+ readonly tier: "lazy";
122
+ readonly group: "greek";
123
+ readonly contentType: "application/octet-stream";
124
+ };
125
+ readonly "greek.dict.txt": {
126
+ readonly bytes: 1102;
127
+ readonly sha256: "60e017885fd98fd0fb5c402da86179f1fe24ae229b374b3b96d313f99a09de59";
128
+ readonly tier: "lazy";
129
+ readonly group: "greek";
130
+ readonly contentType: "text/plain";
131
+ };
132
+ readonly "v5-devanagari-fp16.param": {
133
+ readonly bytes: 19807;
134
+ readonly sha256: "c6540a818cbb46c5b511dc4dd20ebfeae9038ec64e5cf175cd2d25f1b9f95c51";
135
+ readonly tier: "lazy";
136
+ readonly group: "devanagari";
137
+ readonly contentType: "text/plain";
138
+ };
139
+ readonly "v5-devanagari-fp16.bin": {
140
+ readonly bytes: 3931044;
141
+ readonly sha256: "d3086391eb2298c4d4e5a6d20a7fc58a8d0f3ce0a12395c88e9d485c5d595828";
142
+ readonly tier: "lazy";
143
+ readonly group: "devanagari";
144
+ readonly contentType: "application/octet-stream";
145
+ };
146
+ readonly "devanagari.dict.txt": {
147
+ readonly bytes: 1942;
148
+ readonly sha256: "c66d17ef6ced6fbfb4413810e75f0f788cfde37d4192bd17af7923fa190066c8";
149
+ readonly tier: "lazy";
150
+ readonly group: "devanagari";
151
+ readonly contentType: "text/plain";
152
+ };
153
+ readonly "v5-thai-fp16.param": {
154
+ readonly bytes: 19786;
155
+ readonly sha256: "4422df9dcc960e42082166adcca42da2aa6df62abebc75daf0c887e89381c039";
156
+ readonly tier: "lazy";
157
+ readonly group: "thai";
158
+ readonly contentType: "text/plain";
159
+ };
160
+ readonly "v5-thai-fp16.bin": {
161
+ readonly bytes: 3920396;
162
+ readonly sha256: "3458d7c5f0a7f88cb804d084c6596dea3f67c5ea99082654938d71a4eb72a079";
163
+ readonly tier: "lazy";
164
+ readonly group: "thai";
165
+ readonly contentType: "application/octet-stream";
166
+ };
167
+ readonly "thai.dict.txt": {
168
+ readonly bytes: 1766;
169
+ readonly sha256: "e0f32101004cc828ed4505bba80126be06e282700c4c79175ed2b21a4d454dfa";
170
+ readonly tier: "lazy";
171
+ readonly group: "thai";
172
+ readonly contentType: "text/plain";
173
+ };
174
+ readonly "v5-hangul-fp16.param": {
175
+ readonly bytes: 19804;
176
+ readonly sha256: "8daec1a4aa09d3bc92a476438330921c910263b8e61d62334d79e2d1dd14247c";
177
+ readonly tier: "lazy";
178
+ readonly group: "hangul";
179
+ readonly contentType: "text/plain";
180
+ };
181
+ readonly "v5-hangul-fp16.bin": {
182
+ readonly bytes: 6684280;
183
+ readonly sha256: "1d38192b59765cf71c1909ea4b972ee3c8588537a53844e6830f57fbf47976a4";
184
+ readonly tier: "lazy";
185
+ readonly group: "hangul";
186
+ readonly contentType: "application/octet-stream";
187
+ };
188
+ readonly "hangul.dict.txt": {
189
+ readonly bytes: 47450;
190
+ readonly sha256: "a7872c929cd25cf615cdfea08579cf800db1943900fe683468df4dcff6f848bb";
191
+ readonly tier: "lazy";
192
+ readonly group: "hangul";
193
+ readonly contentType: "text/plain";
194
+ };
195
+ };
196
+ readonly scripts: {
197
+ readonly latin: {
198
+ readonly classes: 838;
199
+ readonly rtl: false;
200
+ readonly param: "v5-latin-fp16.param";
201
+ readonly bin: "v5-latin-fp16.bin";
202
+ readonly dict: "latin.dict.txt";
203
+ };
204
+ readonly arabic: {
205
+ readonly classes: 749;
206
+ readonly rtl: true;
207
+ readonly param: "v5-arabic-fp16.param";
208
+ readonly bin: "v5-arabic-fp16.bin";
209
+ readonly dict: "arabic.dict.txt";
210
+ };
211
+ readonly cyrillic: {
212
+ readonly classes: 852;
213
+ readonly rtl: false;
214
+ readonly param: "v5-cyrillic-fp16.param";
215
+ readonly bin: "v5-cyrillic-fp16.bin";
216
+ readonly dict: "cyrillic.dict.txt";
217
+ };
218
+ readonly greek: {
219
+ readonly classes: 356;
220
+ readonly rtl: false;
221
+ readonly param: "v5-greek-fp16.param";
222
+ readonly bin: "v5-greek-fp16.bin";
223
+ readonly dict: "greek.dict.txt";
224
+ };
225
+ readonly devanagari: {
226
+ readonly classes: 570;
227
+ readonly rtl: false;
228
+ readonly param: "v5-devanagari-fp16.param";
229
+ readonly bin: "v5-devanagari-fp16.bin";
230
+ readonly dict: "devanagari.dict.txt";
231
+ };
232
+ readonly thai: {
233
+ readonly classes: 526;
234
+ readonly rtl: false;
235
+ readonly param: "v5-thai-fp16.param";
236
+ readonly bin: "v5-thai-fp16.bin";
237
+ readonly dict: "thai.dict.txt";
238
+ };
239
+ readonly hangul: {
240
+ readonly classes: 11947;
241
+ readonly rtl: false;
242
+ readonly param: "v5-hangul-fp16.param";
243
+ readonly bin: "v5-hangul-fp16.bin";
244
+ readonly dict: "hangul.dict.txt";
245
+ };
246
+ };
247
+ };
248
+
249
+ export { OCR_ASSET_SET as O };
@@ -0,0 +1,249 @@
1
+ declare const OCR_ASSET_SET: {
2
+ readonly fp12: "936b9c4ccc4a";
3
+ readonly engine: "sekyro-ocr-1";
4
+ readonly precision: "fp32";
5
+ readonly files: {
6
+ readonly "sekyro-ocr.wasm": {
7
+ readonly bytes: 3550687;
8
+ readonly sha256: "00d6b1a4e42da8146e662ab0283b97485397811acc806299046933ce1943fb09";
9
+ readonly tier: "live";
10
+ readonly contentType: "application/wasm";
11
+ };
12
+ readonly "sekyro-ocr.mjs": {
13
+ readonly bytes: 4270;
14
+ readonly sha256: "209a78d96ca53344996a0c2300aed4ff8a5c69e142713216975a2840eec08cac";
15
+ readonly tier: "bundled";
16
+ readonly contentType: "text/javascript";
17
+ };
18
+ readonly "det.param": {
19
+ readonly bytes: 24252;
20
+ readonly sha256: "c39ba0b1195e8ad37cfc5bdd7acedcfc1d9cb901e7b8eb1c9c4f6e5a66c04eb3";
21
+ readonly tier: "live";
22
+ readonly contentType: "text/plain";
23
+ };
24
+ readonly "det.bin": {
25
+ readonly bytes: 4685856;
26
+ readonly sha256: "652bafe366565109a1a5766caf482bc46f01481f8044d3a785bd9a1be67c63bb";
27
+ readonly tier: "live";
28
+ readonly contentType: "application/octet-stream";
29
+ };
30
+ readonly "mrz-rec.param": {
31
+ readonly bytes: 3510;
32
+ readonly sha256: "bc69b1b9683e35f6605b21001fadeb81468063459c00c0fc83c67c139f23df01";
33
+ readonly tier: "live";
34
+ readonly contentType: "text/plain";
35
+ };
36
+ readonly "mrz-rec.bin": {
37
+ readonly bytes: 494196;
38
+ readonly sha256: "de93a2aa2f08670cc7dedd17ba378d2f5d7cf6ae409054a9eac863a02c2febae";
39
+ readonly tier: "live";
40
+ readonly contentType: "application/octet-stream";
41
+ };
42
+ readonly "mrz_dict.txt": {
43
+ readonly bytes: 73;
44
+ readonly sha256: "b19858a4de2ccbbbdd4b53982188ea2c7664013183bbd1ae9d20ab52c661f97f";
45
+ readonly tier: "live";
46
+ readonly contentType: "text/plain";
47
+ };
48
+ readonly "v5-latin-fp16.param": {
49
+ readonly bytes: 19800;
50
+ readonly sha256: "843964335e9863681bb17d876c69e7315844e0850e3c04f91b11a3f0c2a57bc6";
51
+ readonly tier: "lazy";
52
+ readonly group: "latin";
53
+ readonly contentType: "text/plain";
54
+ };
55
+ readonly "v5-latin-fp16.bin": {
56
+ readonly bytes: 3995900;
57
+ readonly sha256: "0516474d30cff75a6365869992699d27fbc03f00fcf3d7274c3eed651ee6ea90";
58
+ readonly tier: "lazy";
59
+ readonly group: "latin";
60
+ readonly contentType: "application/octet-stream";
61
+ };
62
+ readonly "latin.dict.txt": {
63
+ readonly bytes: 2615;
64
+ readonly sha256: "c3ab00106e4a4d151a8575b1129b91901a68a35b79a81fd63faab00418b87d75";
65
+ readonly tier: "lazy";
66
+ readonly group: "latin";
67
+ readonly contentType: "text/plain";
68
+ };
69
+ readonly "v5-arabic-fp16.param": {
70
+ readonly bytes: 19791;
71
+ readonly sha256: "1d1e219d277bb1a76909741573f56cfae465f11b61a9be4ca4c29580758c8760";
72
+ readonly tier: "lazy";
73
+ readonly group: "arabic";
74
+ readonly contentType: "text/plain";
75
+ };
76
+ readonly "v5-arabic-fp16.bin": {
77
+ readonly bytes: 3974364;
78
+ readonly sha256: "4ced47b32ab4e7ad16ddebc074f31594eb42b912465a8ed7458bb2842af9efe1";
79
+ readonly tier: "lazy";
80
+ readonly group: "arabic";
81
+ readonly contentType: "application/octet-stream";
82
+ };
83
+ readonly "arabic.dict.txt": {
84
+ readonly bytes: 2368;
85
+ readonly sha256: "8f239c13f6c8b1bdf15f332a65a05002ddd4d99b9286a4bfaf6f0327c36ebbec";
86
+ readonly tier: "lazy";
87
+ readonly group: "arabic";
88
+ readonly contentType: "text/plain";
89
+ };
90
+ readonly "v5-cyrillic-fp16.param": {
91
+ readonly bytes: 19806;
92
+ readonly sha256: "c87b42bfa343509b319dd193dcca4c0e20bb13b1d07bfbf4925a9f5d045966d4";
93
+ readonly tier: "lazy";
94
+ readonly group: "cyrillic";
95
+ readonly contentType: "text/plain";
96
+ };
97
+ readonly "v5-cyrillic-fp16.bin": {
98
+ readonly bytes: 3999288;
99
+ readonly sha256: "97446e221c0d2d84cb76dca6d4217a850efad4d5ec85e3fadc78db353cf97afa";
100
+ readonly tier: "lazy";
101
+ readonly group: "cyrillic";
102
+ readonly contentType: "application/octet-stream";
103
+ };
104
+ readonly "cyrillic.dict.txt": {
105
+ readonly bytes: 2780;
106
+ readonly sha256: "2de016b31edd687acfc1bf72170f4feff9f0c4893edac87cef30b2c5a82443ec";
107
+ readonly tier: "lazy";
108
+ readonly group: "cyrillic";
109
+ readonly contentType: "text/plain";
110
+ };
111
+ readonly "v5-greek-fp16.param": {
112
+ readonly bytes: 19815;
113
+ readonly sha256: "1cc1d47d3aa3fce86d3dbe901a553fd29412f44934a4919d986c155d23f63207";
114
+ readonly tier: "lazy";
115
+ readonly group: "greek";
116
+ readonly contentType: "text/plain";
117
+ };
118
+ readonly "v5-greek-fp16.bin": {
119
+ readonly bytes: 3879256;
120
+ readonly sha256: "04190cd4ee2b023665346d4cd239ee118965f837812108869d3d9894d30c4db3";
121
+ readonly tier: "lazy";
122
+ readonly group: "greek";
123
+ readonly contentType: "application/octet-stream";
124
+ };
125
+ readonly "greek.dict.txt": {
126
+ readonly bytes: 1102;
127
+ readonly sha256: "60e017885fd98fd0fb5c402da86179f1fe24ae229b374b3b96d313f99a09de59";
128
+ readonly tier: "lazy";
129
+ readonly group: "greek";
130
+ readonly contentType: "text/plain";
131
+ };
132
+ readonly "v5-devanagari-fp16.param": {
133
+ readonly bytes: 19807;
134
+ readonly sha256: "c6540a818cbb46c5b511dc4dd20ebfeae9038ec64e5cf175cd2d25f1b9f95c51";
135
+ readonly tier: "lazy";
136
+ readonly group: "devanagari";
137
+ readonly contentType: "text/plain";
138
+ };
139
+ readonly "v5-devanagari-fp16.bin": {
140
+ readonly bytes: 3931044;
141
+ readonly sha256: "d3086391eb2298c4d4e5a6d20a7fc58a8d0f3ce0a12395c88e9d485c5d595828";
142
+ readonly tier: "lazy";
143
+ readonly group: "devanagari";
144
+ readonly contentType: "application/octet-stream";
145
+ };
146
+ readonly "devanagari.dict.txt": {
147
+ readonly bytes: 1942;
148
+ readonly sha256: "c66d17ef6ced6fbfb4413810e75f0f788cfde37d4192bd17af7923fa190066c8";
149
+ readonly tier: "lazy";
150
+ readonly group: "devanagari";
151
+ readonly contentType: "text/plain";
152
+ };
153
+ readonly "v5-thai-fp16.param": {
154
+ readonly bytes: 19786;
155
+ readonly sha256: "4422df9dcc960e42082166adcca42da2aa6df62abebc75daf0c887e89381c039";
156
+ readonly tier: "lazy";
157
+ readonly group: "thai";
158
+ readonly contentType: "text/plain";
159
+ };
160
+ readonly "v5-thai-fp16.bin": {
161
+ readonly bytes: 3920396;
162
+ readonly sha256: "3458d7c5f0a7f88cb804d084c6596dea3f67c5ea99082654938d71a4eb72a079";
163
+ readonly tier: "lazy";
164
+ readonly group: "thai";
165
+ readonly contentType: "application/octet-stream";
166
+ };
167
+ readonly "thai.dict.txt": {
168
+ readonly bytes: 1766;
169
+ readonly sha256: "e0f32101004cc828ed4505bba80126be06e282700c4c79175ed2b21a4d454dfa";
170
+ readonly tier: "lazy";
171
+ readonly group: "thai";
172
+ readonly contentType: "text/plain";
173
+ };
174
+ readonly "v5-hangul-fp16.param": {
175
+ readonly bytes: 19804;
176
+ readonly sha256: "8daec1a4aa09d3bc92a476438330921c910263b8e61d62334d79e2d1dd14247c";
177
+ readonly tier: "lazy";
178
+ readonly group: "hangul";
179
+ readonly contentType: "text/plain";
180
+ };
181
+ readonly "v5-hangul-fp16.bin": {
182
+ readonly bytes: 6684280;
183
+ readonly sha256: "1d38192b59765cf71c1909ea4b972ee3c8588537a53844e6830f57fbf47976a4";
184
+ readonly tier: "lazy";
185
+ readonly group: "hangul";
186
+ readonly contentType: "application/octet-stream";
187
+ };
188
+ readonly "hangul.dict.txt": {
189
+ readonly bytes: 47450;
190
+ readonly sha256: "a7872c929cd25cf615cdfea08579cf800db1943900fe683468df4dcff6f848bb";
191
+ readonly tier: "lazy";
192
+ readonly group: "hangul";
193
+ readonly contentType: "text/plain";
194
+ };
195
+ };
196
+ readonly scripts: {
197
+ readonly latin: {
198
+ readonly classes: 838;
199
+ readonly rtl: false;
200
+ readonly param: "v5-latin-fp16.param";
201
+ readonly bin: "v5-latin-fp16.bin";
202
+ readonly dict: "latin.dict.txt";
203
+ };
204
+ readonly arabic: {
205
+ readonly classes: 749;
206
+ readonly rtl: true;
207
+ readonly param: "v5-arabic-fp16.param";
208
+ readonly bin: "v5-arabic-fp16.bin";
209
+ readonly dict: "arabic.dict.txt";
210
+ };
211
+ readonly cyrillic: {
212
+ readonly classes: 852;
213
+ readonly rtl: false;
214
+ readonly param: "v5-cyrillic-fp16.param";
215
+ readonly bin: "v5-cyrillic-fp16.bin";
216
+ readonly dict: "cyrillic.dict.txt";
217
+ };
218
+ readonly greek: {
219
+ readonly classes: 356;
220
+ readonly rtl: false;
221
+ readonly param: "v5-greek-fp16.param";
222
+ readonly bin: "v5-greek-fp16.bin";
223
+ readonly dict: "greek.dict.txt";
224
+ };
225
+ readonly devanagari: {
226
+ readonly classes: 570;
227
+ readonly rtl: false;
228
+ readonly param: "v5-devanagari-fp16.param";
229
+ readonly bin: "v5-devanagari-fp16.bin";
230
+ readonly dict: "devanagari.dict.txt";
231
+ };
232
+ readonly thai: {
233
+ readonly classes: 526;
234
+ readonly rtl: false;
235
+ readonly param: "v5-thai-fp16.param";
236
+ readonly bin: "v5-thai-fp16.bin";
237
+ readonly dict: "thai.dict.txt";
238
+ };
239
+ readonly hangul: {
240
+ readonly classes: 11947;
241
+ readonly rtl: false;
242
+ readonly param: "v5-hangul-fp16.param";
243
+ readonly bin: "v5-hangul-fp16.bin";
244
+ readonly dict: "hangul.dict.txt";
245
+ };
246
+ };
247
+ };
248
+
249
+ export { OCR_ASSET_SET as O };
@@ -1 +1 @@
1
- import{A as b,B as c,C as d,D as e,E as f,F as g,G as h,H as i,I as j,J as k,z as a}from"./chunk-IUNPV67T.js";import"./chunk-G6LKLN4U.js";import"./chunk-SMKCBUJL.js";import"./chunk-C4WK5D33.js";import"./chunk-MJKHDXCU.js";import"./chunk-POIQGEZM.js";import"./chunk-CPUECYAJ.js";import"./chunk-FPXL63KZ.js";import"./chunk-NO22WG7R.js";import"./chunk-DK5YPBDQ.js";export{k as CAPTURE_CANDIDATE_SPACING_MS,j as CAPTURE_EXTRA_CANDIDATES,h as CaptureSessionDoc,c as DOC_BLACK_FRAME_LUMA,d as DOC_BLACK_FRAME_TICKS,e as DOC_CADENCE_HZ,b as DOC_FIRST_FRAME_MS,f as DOC_SHUTTER_DEFAULTS,i as passportBandOf,g as resolveDocShutterTuning,a as warmDocDetector};
1
+ import{A as b,B as c,C as d,D as e,E as f,F as g,G as h,H as i,I as j,J as k,z as a}from"./chunk-M3KW2MY3.js";import"./chunk-JULJQOVT.js";import"./chunk-SMKCBUJL.js";import"./chunk-NXNQQXYJ.js";import"./chunk-LTMDEMCV.js";import"./chunk-POIQGEZM.js";import"./chunk-CPUECYAJ.js";import"./chunk-FPXL63KZ.js";import"./chunk-CHWTIUYK.js";import"./chunk-ISMVEF7H.js";export{k as CAPTURE_CANDIDATE_SPACING_MS,j as CAPTURE_EXTRA_CANDIDATES,h as CaptureSessionDoc,c as DOC_BLACK_FRAME_LUMA,d as DOC_BLACK_FRAME_TICKS,e as DOC_CADENCE_HZ,b as DOC_FIRST_FRAME_MS,f as DOC_SHUTTER_DEFAULTS,i as passportBandOf,g as resolveDocShutterTuning,a as warmDocDetector};
@@ -1 +1 @@
1
- import{a as re,d as ne,e as B,f as se,g as oe}from"./chunk-7QZWBDI5.js";import{C as te,a as X}from"./chunk-65YTEYLU.js";import{f as j,l as J}from"./chunk-CPUECYAJ.js";import{c as Z}from"./chunk-TSA6GHUG.js";import{c as ee,h as L}from"./chunk-FSSMUAKC.js";var ve=12e4,ie=13e4,ge=3e3,he=1200,D=Symbol.for("@sekyro/web.preload.v1");function h(){let e=globalThis;return e[D]??(e[D]=new Map),e[D]}function b(e){let r=(e??ee).replace(/\/+$/,"");return r===""?"/":r}function ae(e){let r=h(),n=r.get(e);return n===void 0&&(n={status:"idle",promise:null,scheduled:null,detectorPromise:null,detector:null,listeners:new Set},r.set(e,n)),n}function k(e,r){if(e.status!==r){e.status=r;for(let n of[...e.listeners])n(r)}}var K=e=>L({preferred:["blaze"],v3AssetBaseUrl:e,blazeInitTimeoutMs:ve}),H=K;function Te(e){H=e??K}function Oe(){for(let e of h().values())e.detector?.destroy();h().clear(),H=K}function Ce(){return typeof window<"u"&&typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"}function Se(){return navigator.connection?.saveData===!0}function Ee(e){let r=window;if(typeof r.requestIdleCallback=="function"){let s=r.requestIdleCallback(e,{timeout:ge});return()=>r.cancelIdleCallback?.(s)}let n=setTimeout(e,he);return()=>clearTimeout(n)}function ye(e,r){let n,s=new Promise(d=>{n=d}),m=!1,u=()=>{},c={promise:s,settle:d=>{m||(m=!0,u(),e.scheduled===c&&(e.scheduled=null),n(d))}};return e.scheduled=c,u=Ee(()=>{m||c.settle(U(e,r))}),s}function U(e,r){if((e.status==="loading"||e.status==="ready")&&e.promise!==null)return e.promise;k(e,"loading");let n=new Promise(d=>d(H(r)));e.detectorPromise=n;let s,m=new Promise((d,f)=>{s=setTimeout(()=>{n.then(C=>C.destroy(),()=>{}),f(new Error(`detector preload exceeded ${ie} ms`))},ie)}),c=Promise.race([n,m]).then(d=>e.detectorPromise!==n?(d.destroy(),e.status):(e.detector=d,k(e,"ready"),"ready"),d=>(e.detectorPromise===n&&(e.detectorPromise=null,e.detector=null,k(e,"failed"),console.warn("[@sekyro/web] face-detector preload failed:",d)),e.status)).finally(()=>clearTimeout(s));return e.promise=c,e.scheduled?.settle(c),c}function xe(e={}){if(!Ce())return Promise.resolve("idle");let r=b(e.assetBaseUrl),n=ae(r);return e.respectSaveData===!0&&Se()?Promise.resolve(n.status):(n.status==="loading"||n.status==="ready")&&n.promise!==null?n.promise:e.idle===!0?n.scheduled?.promise??ye(n,r):U(n,r)}function Fe(e){return h().get(b(e))?.status??"idle"}function Ie(e,r){let n=ae(b(r));return n.listeners.add(e),()=>{n.listeners.delete(e)}}function Be(e){let r=h().get(b(e));r!==void 0&&(r.scheduled?.settle("idle"),r.detector?.destroy(),r.detector=null,r.detectorPromise=null,r.promise=null,k(r,"idle"))}function Le(e){return{get tier(){return e.tier},get fallbackReason(){return e.fallbackReason},detect:(...r)=>e.detect(...r),destroy:()=>{}}}function de(e){let r=b(e),n=h().get(r);if(!(n===void 0||n.detector===null&&n.detectorPromise===null&&n.scheduled===null))return async()=>{n.scheduled!==null&&U(n,r);let s=n.promise;for(;n.detector===null&&s!==null&&(await s,n.promise!==s);)s=n.promise;return n.detector!==null?Le(n.detector):L({v3AssetBaseUrl:r})}}var be=new Set(["inuse","overconstrained","notfound"]),Me=[500,1500];function Ae(e){switch(e){case"fcv3.no_face":case"fcv3.center_face":case"fcv3.straighten":return"center";case"fcv3.come_closer":return"closer";case"fcv3.move_back":return"farther";case"fcv3.more_light":case"fcv3.too_bright":return"light";case"fcv3.hold_still":case"fcv3.steady_camera":return"still";case"fcv3.hold_upright":return"upright";case"fcv3.one_face":return"one_face";default:return null}}function Pe(e){switch(e){case"preflight":case"acquiring":return"starting";case"positioning":return"gating";default:return e}}function ue(e){switch(e){case"permission":case"notfound":case"inuse":case"insecure":case"unsupported":return e;case"backcamera":return"notfound";default:{let r=e;return"generic"}}}function we(e,r,n){if(n===void 0)return{kind:ue(e),retryable:r};let s=J(n.name);return{kind:ue(e),retryable:r,detail:{...s!==void 0?{name:s}:{},phase:n.phase,engineKind:e}}}var _e=new Set(["captured","uploading","checking"]);function De(e,r={},n,s=()=>"self",m=()=>{},u){let c=r.now??(()=>performance.now()),d=r.canChooseFacing??ne,f="user",C=se(),p=s(),l=re(),V=!j(),G=r.engineOptions,ce=G?.createDetector===void 0&&G?.createWorker===void 0?{createDetector:()=>{let t=de(e.assetBaseUrl);return t!==void 0?t():L({v3AssetBaseUrl:e.assetBaseUrl})}}:{},z={video:e.video,mode:V?"photo":"clip",rankKeyframes:n,facingMode:void 0,v3AssetBaseUrl:e.assetBaseUrl,screenRamp:()=>p==="self"&&l.count("ramp")>0?m():void 0,...r.engineOptions??{},...ce},a=r.createEngine?.(z)??new te(z),v="idle",M=null,A=0,R=!1,T="full",P=null,w=null,O=0,x=0,W=()=>{e.video.videoWidth>0&&e.video.videoHeight>0&&(O=e.video.videoWidth,x=e.video.videoHeight)},q=oe({enabled:e.keepScreenAwake!==!1}),S=t=>{v=t,q.setActive(t==="starting"||t==="gating"||t==="recording"),l.emit("state",t)},F=()=>l.emit("gate",{progress:A,hint:M,faceDetected:R}),I=()=>{let t=a.animations??"full";t!==T&&(T=t,l.emit("profile",{animations:T}))},g=0,_=null,le=r.schedule??((t,o)=>{let i=setTimeout(t,o);return()=>clearTimeout(i)}),E=()=>{_?.(),_=null},fe=(t,o)=>{if(y||!be.has(t)||o?.phase!=="acquiring")return!1;let i=Me[g];return i===void 0?!1:(g+=1,E(),_=le(()=>{_=null,y||a.retry()},i),!0)},pe=[a.on("statechange",({state:t})=>{if(t==="error")return;let o=Pe(t);o==="gating"&&(g=0),o==="starting"&&v!=="starting"&&(M=null,A=0,R=!1,P=null,w=null,O=0,x=0),S(o),I(),o==="recording"&&(W(),P=c(),M="hold",A=1,F())}),a.on("checks",t=>{W(),A=t.progress,R=t.factors.presence>0,F(),I()}),a.on("guidance",({key:t})=>{M=Ae(t),F()}),a.on("frozen",({previewDataUrl:t})=>{w=c(),l.emit("frozen",{previewDataUrl:t})}),a.on("ramp",t=>l.emit("ramp",t)),a.on("artifacts",t=>{if(v!=="captured")return;let o=Z(),i=t.clipStats,Q=i!==void 0?Math.round(i.durationMs):P!==null&&w!==null?Math.max(0,Math.round(w-P)):void 0,Y=i!==void 0&&i.frames>1&&i.durationMs>0?Math.round(i.frames*1e4/i.durationMs)/10:void 0;l.emit("captured",{keyframe:t.keyframe,...t.clip!==void 0?{clip:t.clip}:{},...t.clipMimeType!==void 0?{clipMime:t.clipMimeType}:{},width:e.video.videoWidth||O,height:e.video.videoHeight||x,...Q!==void 0?{clipMs:Q}:{},...i!==void 0?{clipFrames:i.frames}:{},...Y!==void 0?{fps:Y}:{},...t.clipRetakes!==void 0?{clipRetakes:t.clipRetakes}:{},...t.clipMimeType!==void 0?{codec:X(t.clipMimeType)}:{},captureChannel:o==="desktop"?"desktop":"mobile",formFactor:o,...V?{degraded:"NO_RECORDER"}:{},engine:"v3",facingMode:a.facingMode,mode:p,...t.timing,...t.screenRamp!==void 0?{screenRamp:t.screenRamp}:{},...t.provenance!==void 0?{provenance:t.provenance}:{}})}),a.on("error",({kind:t,retryable:o,detail:i})=>{t==="backcamera"&&me()||fe(t,i)||(S("error"),I(),l.emit("error",we(t,o,i)))})],N=!1;function me(){return y||N||p!=="assisted"||u===void 0||u.session()!=="choice"?!1:(N=!0,u.onModeChange("self"),p="self",f=B("self"),S("mode_switch"),a.restart(f),!0)}let $=async()=>u!==void 0&&u.session()==="choice"&&await d().catch(()=>!1),y=!1;return{handle:{get state(){return v},get captureMode(){return s()},get facingMode(){return a.facingMode??f},on:(t,o)=>l.on(t,o),start:t=>(p=s(),C.facing(p,e.facing),f=C.facing(p,t?.facing),E(),g=0,a.start({facingMode:f})),retry:()=>{E(),g=0,a.retry()},switchCamera:()=>C.refuseSwitch(s()),canSwitchCaptureMode:$,setCaptureMode:async t=>{if(t===s()||!await $()||y||_e.has(v)||u===void 0)return!1;u.onModeChange(t),p=t;let o=B(t);return f=o,v==="idle"||(S("mode_switch"),E(),g=0,a.restart(o)),!0},destroy:()=>{y=!0,E();for(let t of pe)t();q.setActive(!1),a.destroy(),l.clear()}},setFlowState:t=>{v!==t&&S(t)}}}function Ze(e){return De(e).handle}export{ve as a,ie as b,Te as c,Oe as d,xe as e,Fe as f,Ie as g,Be as h,de as i,Ae as j,Pe as k,ue as l,we as m,De as n,Ze as o};
1
+ import{a as re,d as ne,e as B,f as se,g as oe}from"./chunk-7QZWBDI5.js";import{C as te,a as X}from"./chunk-UVZ5R4CI.js";import{f as j,l as J}from"./chunk-CPUECYAJ.js";import{c as Z}from"./chunk-TSA6GHUG.js";import{c as ee,h as L}from"./chunk-FSSMUAKC.js";var ve=12e4,ie=13e4,ge=3e3,he=1200,D=Symbol.for("@sekyro/web.preload.v1");function h(){let e=globalThis;return e[D]??(e[D]=new Map),e[D]}function b(e){let r=(e??ee).replace(/\/+$/,"");return r===""?"/":r}function ae(e){let r=h(),n=r.get(e);return n===void 0&&(n={status:"idle",promise:null,scheduled:null,detectorPromise:null,detector:null,listeners:new Set},r.set(e,n)),n}function k(e,r){if(e.status!==r){e.status=r;for(let n of[...e.listeners])n(r)}}var K=e=>L({preferred:["blaze"],v3AssetBaseUrl:e,blazeInitTimeoutMs:ve}),H=K;function Te(e){H=e??K}function Oe(){for(let e of h().values())e.detector?.destroy();h().clear(),H=K}function Ce(){return typeof window<"u"&&typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"}function Se(){return navigator.connection?.saveData===!0}function Ee(e){let r=window;if(typeof r.requestIdleCallback=="function"){let s=r.requestIdleCallback(e,{timeout:ge});return()=>r.cancelIdleCallback?.(s)}let n=setTimeout(e,he);return()=>clearTimeout(n)}function ye(e,r){let n,s=new Promise(d=>{n=d}),m=!1,u=()=>{},c={promise:s,settle:d=>{m||(m=!0,u(),e.scheduled===c&&(e.scheduled=null),n(d))}};return e.scheduled=c,u=Ee(()=>{m||c.settle(U(e,r))}),s}function U(e,r){if((e.status==="loading"||e.status==="ready")&&e.promise!==null)return e.promise;k(e,"loading");let n=new Promise(d=>d(H(r)));e.detectorPromise=n;let s,m=new Promise((d,f)=>{s=setTimeout(()=>{n.then(C=>C.destroy(),()=>{}),f(new Error(`detector preload exceeded ${ie} ms`))},ie)}),c=Promise.race([n,m]).then(d=>e.detectorPromise!==n?(d.destroy(),e.status):(e.detector=d,k(e,"ready"),"ready"),d=>(e.detectorPromise===n&&(e.detectorPromise=null,e.detector=null,k(e,"failed"),console.warn("[@sekyro/web] face-detector preload failed:",d)),e.status)).finally(()=>clearTimeout(s));return e.promise=c,e.scheduled?.settle(c),c}function xe(e={}){if(!Ce())return Promise.resolve("idle");let r=b(e.assetBaseUrl),n=ae(r);return e.respectSaveData===!0&&Se()?Promise.resolve(n.status):(n.status==="loading"||n.status==="ready")&&n.promise!==null?n.promise:e.idle===!0?n.scheduled?.promise??ye(n,r):U(n,r)}function Fe(e){return h().get(b(e))?.status??"idle"}function Ie(e,r){let n=ae(b(r));return n.listeners.add(e),()=>{n.listeners.delete(e)}}function Be(e){let r=h().get(b(e));r!==void 0&&(r.scheduled?.settle("idle"),r.detector?.destroy(),r.detector=null,r.detectorPromise=null,r.promise=null,k(r,"idle"))}function Le(e){return{get tier(){return e.tier},get fallbackReason(){return e.fallbackReason},detect:(...r)=>e.detect(...r),destroy:()=>{}}}function de(e){let r=b(e),n=h().get(r);if(!(n===void 0||n.detector===null&&n.detectorPromise===null&&n.scheduled===null))return async()=>{n.scheduled!==null&&U(n,r);let s=n.promise;for(;n.detector===null&&s!==null&&(await s,n.promise!==s);)s=n.promise;return n.detector!==null?Le(n.detector):L({v3AssetBaseUrl:r})}}var be=new Set(["inuse","overconstrained","notfound"]),Me=[500,1500];function Ae(e){switch(e){case"fcv3.no_face":case"fcv3.center_face":case"fcv3.straighten":return"center";case"fcv3.come_closer":return"closer";case"fcv3.move_back":return"farther";case"fcv3.more_light":case"fcv3.too_bright":return"light";case"fcv3.hold_still":case"fcv3.steady_camera":return"still";case"fcv3.hold_upright":return"upright";case"fcv3.one_face":return"one_face";default:return null}}function Pe(e){switch(e){case"preflight":case"acquiring":return"starting";case"positioning":return"gating";default:return e}}function ue(e){switch(e){case"permission":case"notfound":case"inuse":case"insecure":case"unsupported":return e;case"backcamera":return"notfound";default:{let r=e;return"generic"}}}function we(e,r,n){if(n===void 0)return{kind:ue(e),retryable:r};let s=J(n.name);return{kind:ue(e),retryable:r,detail:{...s!==void 0?{name:s}:{},phase:n.phase,engineKind:e}}}var _e=new Set(["captured","uploading","checking"]);function De(e,r={},n,s=()=>"self",m=()=>{},u){let c=r.now??(()=>performance.now()),d=r.canChooseFacing??ne,f="user",C=se(),p=s(),l=re(),V=!j(),G=r.engineOptions,ce=G?.createDetector===void 0&&G?.createWorker===void 0?{createDetector:()=>{let t=de(e.assetBaseUrl);return t!==void 0?t():L({v3AssetBaseUrl:e.assetBaseUrl})}}:{},z={video:e.video,mode:V?"photo":"clip",rankKeyframes:n,facingMode:void 0,v3AssetBaseUrl:e.assetBaseUrl,screenRamp:()=>p==="self"&&l.count("ramp")>0?m():void 0,...r.engineOptions??{},...ce},a=r.createEngine?.(z)??new te(z),v="idle",M=null,A=0,R=!1,T="full",P=null,w=null,O=0,x=0,W=()=>{e.video.videoWidth>0&&e.video.videoHeight>0&&(O=e.video.videoWidth,x=e.video.videoHeight)},q=oe({enabled:e.keepScreenAwake!==!1}),S=t=>{v=t,q.setActive(t==="starting"||t==="gating"||t==="recording"),l.emit("state",t)},F=()=>l.emit("gate",{progress:A,hint:M,faceDetected:R}),I=()=>{let t=a.animations??"full";t!==T&&(T=t,l.emit("profile",{animations:T}))},g=0,_=null,le=r.schedule??((t,o)=>{let i=setTimeout(t,o);return()=>clearTimeout(i)}),E=()=>{_?.(),_=null},fe=(t,o)=>{if(y||!be.has(t)||o?.phase!=="acquiring")return!1;let i=Me[g];return i===void 0?!1:(g+=1,E(),_=le(()=>{_=null,y||a.retry()},i),!0)},pe=[a.on("statechange",({state:t})=>{if(t==="error")return;let o=Pe(t);o==="gating"&&(g=0),o==="starting"&&v!=="starting"&&(M=null,A=0,R=!1,P=null,w=null,O=0,x=0),S(o),I(),o==="recording"&&(W(),P=c(),M="hold",A=1,F())}),a.on("checks",t=>{W(),A=t.progress,R=t.factors.presence>0,F(),I()}),a.on("guidance",({key:t})=>{M=Ae(t),F()}),a.on("frozen",({previewDataUrl:t})=>{w=c(),l.emit("frozen",{previewDataUrl:t})}),a.on("ramp",t=>l.emit("ramp",t)),a.on("artifacts",t=>{if(v!=="captured")return;let o=Z(),i=t.clipStats,Q=i!==void 0?Math.round(i.durationMs):P!==null&&w!==null?Math.max(0,Math.round(w-P)):void 0,Y=i!==void 0&&i.frames>1&&i.durationMs>0?Math.round(i.frames*1e4/i.durationMs)/10:void 0;l.emit("captured",{keyframe:t.keyframe,...t.clip!==void 0?{clip:t.clip}:{},...t.clipMimeType!==void 0?{clipMime:t.clipMimeType}:{},width:e.video.videoWidth||O,height:e.video.videoHeight||x,...Q!==void 0?{clipMs:Q}:{},...i!==void 0?{clipFrames:i.frames}:{},...Y!==void 0?{fps:Y}:{},...t.clipRetakes!==void 0?{clipRetakes:t.clipRetakes}:{},...t.clipMimeType!==void 0?{codec:X(t.clipMimeType)}:{},captureChannel:o==="desktop"?"desktop":"mobile",formFactor:o,...V?{degraded:"NO_RECORDER"}:{},engine:"v3",facingMode:a.facingMode,mode:p,...t.timing,...t.screenRamp!==void 0?{screenRamp:t.screenRamp}:{},...t.provenance!==void 0?{provenance:t.provenance}:{}})}),a.on("error",({kind:t,retryable:o,detail:i})=>{t==="backcamera"&&me()||fe(t,i)||(S("error"),I(),l.emit("error",we(t,o,i)))})],N=!1;function me(){return y||N||p!=="assisted"||u===void 0||u.session()!=="choice"?!1:(N=!0,u.onModeChange("self"),p="self",f=B("self"),S("mode_switch"),a.restart(f),!0)}let $=async()=>u!==void 0&&u.session()==="choice"&&await d().catch(()=>!1),y=!1;return{handle:{get state(){return v},get captureMode(){return s()},get facingMode(){return a.facingMode??f},on:(t,o)=>l.on(t,o),start:t=>(p=s(),C.facing(p,e.facing),f=C.facing(p,t?.facing),E(),g=0,a.start({facingMode:f})),retry:()=>{E(),g=0,a.retry()},switchCamera:()=>C.refuseSwitch(s()),canSwitchCaptureMode:$,setCaptureMode:async t=>{if(t===s()||!await $()||y||_e.has(v)||u===void 0)return!1;u.onModeChange(t),p=t;let o=B(t);return f=o,v==="idle"||(S("mode_switch"),E(),g=0,a.restart(o)),!0},destroy:()=>{y=!0,E();for(let t of pe)t();q.setActive(!1),a.destroy(),l.clear()}},setFlowState:t=>{v!==t&&S(t)}}}function Ze(e){return De(e).handle}export{ve as a,ie as b,Te as c,Oe as d,xe as e,Fe as f,Ie as g,Be as h,de as i,Ae as j,Pe as k,ue as l,we as m,De as n,Ze as o};