@exige/web-scanner-sdk 0.2.39 → 0.2.42

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/dist/react.js CHANGED
@@ -1,9 +1,9 @@
1
1
  "use client";
2
- import { B as e, E as t, G as n, J as r, M as i, R as a, T as o, U as s, Y as c, Z as l, a as u, b as d, m as f, o as p, p as ee, q as te, r as m, s as ne, z as re } from "./driver-license-BmeEh0a_.js";
3
- import { createContext as ie, useCallback as h, useContext as ae, useEffect as g, useLayoutEffect as oe, useMemo as se, useRef as _, useState as v } from "react";
4
- import { Fragment as ce, jsx as y, jsxs as b } from "react/jsx-runtime";
2
+ import { A as e, C as t, G as n, I as r, J as i, K as a, L as o, R as s, U as c, V as l, a as u, d, f, h as p, r as m, v as h, w as ee } from "./driver-license-D9y7PQn4.js";
3
+ import { createContext as g, useCallback as _, useContext as te, useEffect as v, useLayoutEffect as ne, useMemo as re, useRef as y, useState as b } from "react";
4
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
5
5
  //#region src/sdk/display-quad.ts
6
- function x(e) {
6
+ function w(e) {
7
7
  return [
8
8
  e.topLeft,
9
9
  e.topRight,
@@ -11,7 +11,7 @@ function x(e) {
11
11
  e.bottomLeft
12
12
  ];
13
13
  }
14
- function S(e) {
14
+ function T(e) {
15
15
  let [t, n, r, i] = e;
16
16
  return {
17
17
  topLeft: t,
@@ -38,10 +38,10 @@ function S(e) {
38
38
  }
39
39
  };
40
40
  }
41
- function C(e) {
42
- return S(x(e).map((e) => ({ ...e })));
41
+ function ie(e) {
42
+ return T(w(e).map((e) => ({ ...e })));
43
43
  }
44
- var le = class {
44
+ var ae = class {
45
45
  current;
46
46
  target;
47
47
  response;
@@ -50,11 +50,11 @@ var le = class {
50
50
  this.response = e.response ?? 14, this.snapDistance = e.snapDistance ?? .1;
51
51
  }
52
52
  setTarget(e, t, n) {
53
- let r = Math.max(1, Math.hypot(t, n)), i = !this.current || x(e).some((e, t) => {
54
- let n = x(this.current)[t];
53
+ let r = Math.max(1, Math.hypot(t, n)), i = !this.current || w(e).some((e, t) => {
54
+ let n = w(this.current)[t];
55
55
  return Math.hypot(e.x - n.x, e.y - n.y) / r > this.snapDistance;
56
56
  });
57
- return this.target = C(e), i && (this.current = C(e)), {
57
+ return this.target = ie(e), i && (this.current = ie(e)), {
58
58
  quad: this.current,
59
59
  snapped: i
60
60
  };
@@ -62,8 +62,8 @@ var le = class {
62
62
  step(e) {
63
63
  if (!this.current || !this.target) return this.current;
64
64
  let t = 1 - Math.exp(-this.response * Math.max(0, e) / 1e3);
65
- return this.current = S(x(this.current).map((e, n) => {
66
- let r = x(this.target)[n];
65
+ return this.current = T(w(this.current).map((e, n) => {
66
+ let r = w(this.target)[n];
67
67
  return {
68
68
  x: e.x + (r.x - e.x) * t,
69
69
  y: e.y + (r.y - e.y) * t
@@ -76,22 +76,13 @@ var le = class {
76
76
  getCurrent() {
77
77
  return this.current;
78
78
  }
79
- }, ue = ie(null);
79
+ }, oe = g(null);
80
80
  //#endregion
81
81
  //#region src/react/context.tsx
82
- function de(e) {
82
+ function se(e) {
83
83
  e?.startsWith("blob:") && URL.revokeObjectURL(e);
84
84
  }
85
- function fe() {
86
- return new Promise((e) => {
87
- if (typeof requestAnimationFrame == "function") {
88
- requestAnimationFrame(() => requestAnimationFrame(() => e()));
89
- return;
90
- }
91
- setTimeout(e, 0);
92
- });
93
- }
94
- function pe(e) {
85
+ function ce(e) {
95
86
  try {
96
87
  let t = e.toDataURL("image/jpeg", .92);
97
88
  return t.startsWith("data:image/") ? t : void 0;
@@ -99,471 +90,465 @@ function pe(e) {
99
90
  return;
100
91
  }
101
92
  }
102
- function me(e, t) {
93
+ function le(e, t) {
103
94
  if (typeof e == "function") return e(t);
104
95
  }
105
- function he({ open: d, useCase: m = "document", autoCapture: ie = "defaultOn", captureMode: ae = "auto", torch: ce = "defaultOff", onCapture: b, onDriverLicense: x, onCancel: S, onError: C, onSettings: he, onFinderStatus: ge, modelUrl: w, ortWasmPaths: T, detectionIntervalMs: _e, apiRef: E, children: ve }) {
106
- let D = r(ae), O = _(void 0), k = _(void 0), ye = _(void 0), A = _(void 0), j = _({}), M = _(new le()), N = _(!1), be = _(!1), P = _({
107
- onCapture: b,
108
- onDriverLicense: x,
109
- onCancel: S,
110
- onError: C,
111
- onSettings: he,
112
- onFinderStatus: ge,
96
+ function ue({ open: r, useCase: m = "document", autoCapture: h = "defaultOn", captureMode: g = "auto", torch: te = "defaultOff", onCapture: x, onDriverLicense: C, onCancel: w, onError: T, onSettings: ie, onFinderStatus: ue, modelUrl: E, ortWasmPaths: D, detectionIntervalMs: O, apiRef: k, children: de }) {
97
+ let A = n(g), j = y(void 0), M = y(void 0), N = y(void 0), P = y(void 0), F = y({}), I = y(new ae()), L = y(!1), fe = y(!1), R = y({
98
+ onCapture: x,
99
+ onDriverLicense: C,
100
+ onCancel: w,
101
+ onError: T,
102
+ onSettings: ie,
103
+ onFinderStatus: ue,
113
104
  useCase: m
114
- }), xe = _(void 0), Se = _(void 0), F = _(async () => void 0), I = _(!1), L = _(void 0), R = _(void 0), Ce = _(null), [z, we] = v(null), [Te, B] = v(D && d ? "capturing" : D ? "ready" : "starting"), [V, H] = v(), [Ee, U] = v(), [De, W] = v(), [Oe, ke] = v({
105
+ }), pe = y(void 0), z = y(void 0), me = y(async () => void 0), B = y(!1), he = y(void 0), V = y(void 0), H = _((e) => {
106
+ let t = V.current;
107
+ V.current = void 0, t?.reject(e ?? new DOMException("The license flip was cancelled.", "AbortError"));
108
+ }, []), ge = _(() => {
109
+ let e = V.current;
110
+ e && (V.current = void 0, e.resolve());
111
+ }, []), _e = _(() => (H(), new Promise((e, t) => {
112
+ V.current = {
113
+ resolve: e,
114
+ reject: t
115
+ };
116
+ })), [H]), ve = y(null), [U, ye] = b(null), [be, W] = b(A && r ? "capturing" : A ? "ready" : "starting"), [G, K] = b(), [xe, q] = b(), [Se, Ce] = b(), [we, Te] = b(), J = y(!1), [Ee, De] = b({
115
117
  width: 1,
116
118
  height: 1
117
- }), [Ae, je] = v(), [Me, G] = v(), [Ne, K] = v(""), [Pe, Fe] = v(0), [Ie, q] = v(), [Le, J] = v(), [Re, ze] = v("idle"), [Be, Ve] = v(), He = _(void 0), [Ue, We] = v("front"), Y = _("front"), [Ge, Ke] = v(!1), [qe, Je] = v({
119
+ }), [Oe, ke] = b(), [Ae, je] = b(), [Me, Y] = b(""), [Ne, Pe] = b(0), [Fe, X] = b(), [Ie, Le] = b(), [Re, ze] = b("idle"), [Be, Ve] = b(), He = y(void 0), [Ue, We] = b("front"), Ge = y("front"), [Ke, qe] = b(!1), [Je, Ye] = b({
118
120
  downloading: !1,
119
121
  loaded: 0,
120
122
  total: null
121
- }), X = h(() => {
122
- de(He.current), He.current = void 0, Ve(void 0);
123
- }, []), Z = h((e, t) => {
124
- let n = pe(e);
125
- de(He.current), He.current = n, Ve(n), t?.pause();
126
- }, []), Q = h(async (e, t) => {
127
- t && (W({
123
+ }), Z = _(() => {
124
+ se(He.current), He.current = void 0, Ve(void 0);
125
+ }, []), Xe = _((e, t) => {
126
+ let n = ce(e);
127
+ se(He.current), He.current = n, Ve(n), t?.pause();
128
+ }, []), Q = _(() => {
129
+ J.current = !1, Ce(void 0), Te(void 0);
130
+ }, []), Ze = _((e, t) => {
131
+ t && !J.current && (J.current = !0, Ce({
128
132
  width: e.width,
129
133
  height: e.height
130
- }), U(t), await fe(), await new Promise((e) => {
131
- window.setTimeout(e, 280);
132
- }));
133
- }, []);
134
- oe(() => {
135
- P.current = {
136
- onCapture: b,
137
- onDriverLicense: x,
138
- onCancel: S,
139
- onError: C,
140
- onSettings: he,
141
- onFinderStatus: ge,
134
+ }), Te(t));
135
+ }, []), Qe = _(async (e, t, n) => {
136
+ t && q(t), Ze(e, n), (t || n) && await new Promise((e) => {
137
+ window.setTimeout(e, p);
138
+ });
139
+ }, [Ze]);
140
+ ne(() => {
141
+ R.current = {
142
+ onCapture: x,
143
+ onDriverLicense: C,
144
+ onCancel: w,
145
+ onError: T,
146
+ onSettings: ie,
147
+ onFinderStatus: ue,
142
148
  useCase: m
143
149
  };
144
150
  }, [
145
- b,
146
151
  x,
147
- S,
148
152
  C,
149
- he,
150
- ge,
153
+ w,
154
+ T,
155
+ ie,
156
+ ue,
151
157
  m
152
- ]), g(() => l(Je), []), g(() => {
153
- if (!d || m !== "drivers-license") {
154
- R.current?.abort(), R.current = void 0, Se.current = void 0, xe.current = void 0, I.current = !1, Y.current = "front", We("front"), Ke(!1);
158
+ ]), v(() => i(Ye), []), v(() => {
159
+ if (!r || m !== "drivers-license") {
160
+ H(), z.current = void 0, pe.current = void 0, B.current = !1, Ge.current = "front", We("front"), qe(!1);
155
161
  return;
156
162
  }
157
163
  let e = u({ scan: {
158
- modelUrl: w,
159
- ortWasmPaths: T
164
+ modelUrl: E,
165
+ ortWasmPaths: D
160
166
  } });
161
- return Se.current = e, e.then((e) => {
162
- xe.current = e;
167
+ return z.current = e, e.then((e) => {
168
+ pe.current = e;
163
169
  }), () => {
164
- R.current?.abort(), R.current = void 0, e.then((e) => e.cancel()), xe.current &&= void 0, Se.current = void 0;
170
+ H(), e.then((e) => e.cancel()), pe.current &&= void 0, z.current = void 0;
165
171
  };
166
172
  }, [
167
- d,
173
+ r,
168
174
  m,
169
- w,
170
- T
175
+ E,
176
+ D,
177
+ H
171
178
  ]);
172
- let Ye = h((e) => {
173
- we(e);
179
+ let $e = _((e) => {
180
+ ye(e);
174
181
  }, []);
175
- g(() => {
176
- if (!d || !z) return;
182
+ v(() => {
183
+ if (!r || !U) return;
177
184
  let e = () => {
178
- let e = z.getBoundingClientRect();
179
- ke({
185
+ let e = U.getBoundingClientRect();
186
+ De({
180
187
  width: e.width,
181
188
  height: e.height
182
189
  });
183
190
  };
184
191
  if (e(), typeof ResizeObserver > "u") return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
185
192
  let t = new ResizeObserver(e);
186
- return t.observe(z), () => t.disconnect();
187
- }, [d, z]), g(() => {
188
- if (!d) return;
193
+ return t.observe(U), () => t.disconnect();
194
+ }, [r, U]), v(() => {
195
+ if (!r) return;
189
196
  let e = window.setInterval(() => {
190
- let e = O.current?.getDiagnostics();
191
- e && q(e);
197
+ let e = j.current?.getDiagnostics();
198
+ e && X(e);
192
199
  }, 500);
193
200
  return () => window.clearInterval(e);
194
- }, [d, Pe]), g(() => {
195
- if (!d) return;
201
+ }, [r, Ne]), v(() => {
202
+ if (!r) return;
196
203
  let e = 0, t = performance.now(), n = (r) => {
197
- let i = M.current.step(r - t);
198
- t = r, i && U(i), e = requestAnimationFrame(n);
204
+ let i = I.current.step(r - t);
205
+ t = r, i && q(i), e = requestAnimationFrame(n);
199
206
  };
200
207
  return e = requestAnimationFrame(n), () => cancelAnimationFrame(e);
201
- }, [d]), g(() => {
202
- if (!d || D || !z) return;
203
- let e = !1, n = new AbortController();
204
- L.current = n;
205
- let r = () => {
206
- n.abort(), L.current === n && (L.current = void 0), k.current?.stop(), k.current = void 0, O.current?.stop(), O.current = void 0, A.current = void 0, ye.current = void 0, j.current = {}, X();
208
+ }, [r]), v(() => {
209
+ if (!r || A || !U) return;
210
+ let e = !1, t = new AbortController();
211
+ he.current = t;
212
+ let n = () => {
213
+ t.abort(), he.current === t && (he.current = void 0), M.current?.stop(), M.current = void 0, j.current?.stop(), j.current = void 0, P.current = void 0, N.current = void 0, F.current = {}, Z();
207
214
  };
208
215
  return (async () => {
209
- r(), n = new AbortController(), L.current = n, N.current = !1, B("starting"), K(""), H(void 0), G(void 0), J(void 0), ze("idle"), X();
216
+ n(), t = new AbortController(), he.current = t, L.current = !1, W("starting"), Y(""), K(void 0), je(void 0), Le(void 0), ze("idle"), Z();
210
217
  try {
211
- let r = await c(z, { torch: ce });
218
+ let n = await a(U, { torch: te });
212
219
  if (e) {
213
- r.stop();
214
- return;
215
- }
216
- O.current = r;
217
- let i = r.getSettings();
218
- if (je(i), P.current.onSettings?.(i), console.info("[ScannerProvider] camera settings", i), P.current.useCase === "drivers-license" && Y.current === "back") {
219
- H(void 0), U(void 0), W(void 0), M.current.clear(), B("ready"), (async () => {
220
- try {
221
- let t = 0, i = await p(async () => {
222
- t += 1;
223
- let e = a();
224
- if (t % 4 == 0 && te(e, "ImageCapture" in globalThis)) try {
225
- let e = await r.capturePhoto();
226
- if (e.frame && e.luminance > 10) return e.frame;
227
- } catch {}
228
- try {
229
- return await r.captureLiveFrame(ee);
230
- } catch {
231
- return;
232
- }
233
- }, {
234
- intervalMs: _e ?? 140,
235
- signal: n.signal
236
- });
237
- if (e || n.signal.aborted || I.current || (I.current = !0, Z(i.frame, z), G("live-mirror"), B("captured"), await Q(i.frame, i.quad), e || n.signal.aborted)) return;
238
- await F.current({
239
- frame: i.frame,
240
- reason: "auto",
241
- method: "live-mirror",
242
- settings: r.getSettings()
243
- });
244
- } catch (t) {
245
- if (e || n.signal.aborted || t instanceof DOMException && t.name === "AbortError") return;
246
- let r = t instanceof Error ? t : /* @__PURE__ */ Error("Could not read the barcode.");
247
- N.current = !0, K(r.message), B("error"), P.current.onError?.(r);
248
- }
249
- })();
220
+ n.stop();
250
221
  return;
251
222
  }
252
- k.current = await t({
253
- source: z,
254
- autoCapture: ie,
255
- intervalMs: _e,
223
+ j.current = n;
224
+ let r = n.getSettings();
225
+ ke(r), R.current.onSettings?.(r), console.info("[ScannerProvider] camera settings", r);
226
+ let i = R.current.useCase === "drivers-license" && Ge.current === "back";
227
+ M.current = await ee({
228
+ source: U,
229
+ autoCapture: h,
230
+ intervalMs: O,
256
231
  detection: {
257
- modelUrl: w,
258
- ortWasmPaths: T
232
+ modelUrl: E,
233
+ ortWasmPaths: D
259
234
  },
235
+ ...i ? { holdStillReady: () => J.current } : {},
260
236
  onStatus: (e) => {
261
- if (ye.current = e, H(e), P.current.onFinderStatus?.(e), e.quad && e.sourceWidth && e.sourceHeight) {
262
- let t = M.current.setTarget(e.quad, e.sourceWidth, e.sourceHeight);
263
- U(t.quad);
264
- } else M.current.clear(), U(void 0);
265
- e.state !== "captured" && !N.current && B("ready");
237
+ if (N.current = e, K(e), R.current.onFinderStatus?.(e), e.quad && e.sourceWidth && e.sourceHeight) {
238
+ let t = I.current.setTarget(e.quad, e.sourceWidth, e.sourceHeight);
239
+ q(t.quad);
240
+ } else I.current.clear(), q(void 0), i && Q();
241
+ e.state !== "captured" && !L.current && W("ready");
266
242
  },
267
243
  captureFrame: async () => {
268
- B("capturing"), j.current = {
269
- quad: M.current.getCurrent(),
270
- sourceWidth: ye.current?.sourceWidth,
271
- sourceHeight: ye.current?.sourceHeight
244
+ W("capturing"), F.current = {
245
+ quad: I.current.getCurrent(),
246
+ sourceWidth: N.current?.sourceWidth,
247
+ sourceHeight: N.current?.sourceHeight
272
248
  };
273
- let e = await r.capturePhoto();
274
- if (A.current = e, G(e.method), J(e.diagnostics), q(e.diagnostics), e.luminance <= 10) throw Error(`The captured frame was blank (luminance ${e.luminance.toFixed(1)} via ${e.method}). Keep the scanner visible while capturing and retake.`);
275
- return Z(e.frame, z), B("captured"), e.frame;
249
+ let e = await n.capturePhoto();
250
+ if (P.current = e, je(e.method), Le(e.diagnostics), X(e.diagnostics), e.luminance <= 10) throw Error(`The captured frame was blank (luminance ${e.luminance.toFixed(1)} via ${e.method}). Keep the scanner visible while capturing and retake.`);
251
+ if (Xe(e.frame, U), W("captured"), i) {
252
+ let t = await f(e.frame);
253
+ Ze(e.frame, t?.quad);
254
+ }
255
+ return e.frame;
276
256
  },
277
257
  onCaptureError: (e) => {
278
- N.current = !0, B("error"), K(e.message);
279
- let t = O.current?.getDiagnostics();
280
- t && q(t), P.current.onError?.(e);
258
+ L.current = !0, W("error"), Y(e.message);
259
+ let t = j.current?.getDiagnostics();
260
+ t && X(t), R.current.onError?.(e);
281
261
  },
282
262
  onCapture: async (e) => {
283
- let t = A.current;
263
+ let t = P.current;
284
264
  await new Promise((e) => window.setTimeout(e, 140));
285
- let n = {
265
+ let r = {
286
266
  ...e,
287
267
  method: t?.method ?? "video-frame",
288
- settings: t?.settings ?? r.getSettings(),
268
+ settings: t?.settings ?? n.getSettings(),
289
269
  fallbackReason: t?.fallbackReason,
290
270
  luminance: t?.luminance,
291
271
  diagnostics: t?.diagnostics,
292
- displayedQuad: j.current.quad,
293
- displaySourceWidth: j.current.sourceWidth,
294
- displaySourceHeight: j.current.sourceHeight
272
+ displayedQuad: F.current.quad,
273
+ displaySourceWidth: F.current.sourceWidth,
274
+ displaySourceHeight: F.current.sourceHeight
295
275
  };
296
- if (P.current.useCase === "drivers-license") {
297
- await F.current(n);
276
+ if (R.current.useCase === "drivers-license") {
277
+ i && (B.current = !0), await me.current(r);
298
278
  return;
299
279
  }
300
- await me(P.current.onCapture, n);
280
+ await le(R.current.onCapture, r);
301
281
  }
302
- });
282
+ }), i && (async () => {
283
+ for (; !e && !t.signal.aborted && !B.current && !J.current;) {
284
+ try {
285
+ let r = await n.captureLiveFrame(d);
286
+ if (!r) {
287
+ await new Promise((e) => {
288
+ window.setTimeout(e, O ?? 140);
289
+ });
290
+ continue;
291
+ }
292
+ let i = await f(r);
293
+ if (e || t.signal.aborted) return;
294
+ i?.quad && Ze(r, i.quad);
295
+ } catch {}
296
+ await new Promise((e) => {
297
+ window.setTimeout(e, O ?? 140);
298
+ });
299
+ }
300
+ })();
303
301
  } catch (t) {
304
302
  if (e) return;
305
- r();
306
- let n = t instanceof Error ? t : /* @__PURE__ */ Error("Camera access failed.");
307
- K(n.message), B("error"), P.current.onError?.(n);
303
+ n();
304
+ let r = t instanceof Error ? t : /* @__PURE__ */ Error("Camera access failed.");
305
+ Y(r.message), W("error"), R.current.onError?.(r);
308
306
  }
309
307
  })(), () => {
310
- e = !0, r();
308
+ e = !0, n();
311
309
  };
312
310
  }, [
313
- d,
314
- z,
311
+ r,
312
+ U,
313
+ A,
314
+ h,
315
+ te,
316
+ E,
315
317
  D,
316
- ie,
317
- ce,
318
- w,
319
- T,
320
- _e,
321
- Pe,
322
- X,
318
+ O,
319
+ Ne,
323
320
  Z,
324
- Q
321
+ Xe,
322
+ Q,
323
+ Ze
325
324
  ]);
326
- let Xe = {
327
- open: d,
328
- phase: Te,
329
- autoCapture: ie,
330
- captureMode: ae,
331
- usingSystemCamera: D,
332
- finderStatus: V,
333
- displayQuad: Ee,
334
- barcodeOverlay: De,
335
- previewSize: Oe,
336
- settings: Ae,
337
- captureMethod: Me,
338
- error: Ne,
339
- diagnostics: Ie,
340
- shutterDiagnostics: Le,
325
+ let et = G ? t(G.guidance, G.lighting) : void 0, tt = m === "drivers-license" && Ue === "back" && !A, nt = {
326
+ open: r,
327
+ phase: be,
328
+ autoCapture: h,
329
+ captureMode: g,
330
+ usingSystemCamera: A,
331
+ finderStatus: G,
332
+ displayQuad: xe,
333
+ barcodeOverlay: Se,
334
+ barcodeQuad: we,
335
+ previewSize: Ee,
336
+ settings: Oe,
337
+ captureMethod: Ae,
338
+ error: Me,
339
+ diagnostics: Fe,
340
+ shutterDiagnostics: Ie,
341
341
  copyState: Re,
342
- guidanceHint: V ? o(V.guidance, V.lighting) : void 0,
343
- detectorStatus: m === "drivers-license" && Ue === "back" && !D ? "zxing" : V?.modelStatus === "failed" ? `ML failed${V.modelError ? `: ${V.modelError}` : ""}` : V?.detector === "ml" ? `ML ${V.modelProvider ?? ""}`.trim() : "ML loading",
344
- modelDownload: qe,
342
+ guidanceHint: et,
343
+ detectorStatus: G?.modelStatus === "failed" ? `ML failed${G.modelError ? `: ${G.modelError}` : ""}` : [G?.detector === "ml" ? `ML ${G.modelProvider ?? ""}`.trim() : "ML loading", tt ? "zxing" : void 0].filter(Boolean).join(" · "),
344
+ modelDownload: Je,
345
345
  frozenPreviewUrl: Be,
346
346
  useCase: m,
347
347
  licenseSide: m === "drivers-license" ? Ue : void 0,
348
- licenseBusy: m === "drivers-license" ? Ge : void 0
348
+ licenseBusy: m === "drivers-license" ? Ke : void 0
349
349
  };
350
- g(() => {
351
- Ce.current = Xe;
350
+ v(() => {
351
+ ve.current = nt;
352
352
  });
353
- let Ze = h(() => {
354
- P.current.onCancel();
355
- }, []), $ = h(async () => {
356
- if (!be.current) {
357
- be.current = !0, N.current = !1, K(""), U(void 0), W(void 0), M.current.clear(), B("capturing");
353
+ let rt = _(() => {
354
+ R.current.onCancel();
355
+ }, []), $ = _(async () => {
356
+ if (!fe.current) {
357
+ fe.current = !0, L.current = !1, Y(""), q(void 0), Q(), I.current.clear(), W("capturing");
358
358
  try {
359
- let e = await n();
360
- Z(e);
361
- let t = {
362
- width: e.width,
363
- height: e.height
359
+ let t = await c();
360
+ Xe(t);
361
+ let n = {
362
+ width: t.width,
363
+ height: t.height
364
364
  };
365
- je(t), P.current.onSettings?.(t), G("system-camera");
365
+ ke(n), R.current.onSettings?.(n), je("system-camera");
366
366
  let r;
367
367
  try {
368
- let t = e.getContext("2d", { willReadFrequently: !0 })?.getImageData(0, 0, e.width, e.height).data;
369
- t && (r = s(t));
368
+ let e = t.getContext("2d", { willReadFrequently: !0 })?.getImageData(0, 0, t.width, t.height).data;
369
+ e && (r = l(e));
370
370
  } catch {
371
371
  r = void 0;
372
372
  }
373
- if (P.current.useCase === "drivers-license" && Y.current === "back") {
374
- U(void 0), W(void 0), M.current.clear(), j.current = {}, B("captured");
375
- let n = await f(e);
376
- await Q(e, n?.quad), await F.current({
377
- frame: e,
373
+ if (R.current.useCase === "drivers-license" && Ge.current === "back") {
374
+ I.current.clear(), F.current = {};
375
+ let [i, a] = await Promise.all([e(t, {
376
+ modelUrl: E,
377
+ ortWasmPaths: D
378
+ }), f(t)]), o = i.status === "success" ? i.quad : void 0;
379
+ o && (F.current = {
380
+ quad: o,
381
+ sourceWidth: i.sourceWidth,
382
+ sourceHeight: i.sourceHeight
383
+ }), W("captured"), await Qe(t, o, a?.quad), await me.current({
384
+ frame: t,
385
+ detection: o ? i : void 0,
378
386
  reason: "manual",
379
387
  method: "system-camera",
380
- settings: t,
381
- luminance: r
388
+ settings: n,
389
+ luminance: r,
390
+ displayedQuad: o,
391
+ displaySourceWidth: i.sourceWidth,
392
+ displaySourceHeight: i.sourceHeight
382
393
  });
383
394
  return;
384
395
  }
385
- let a = await i(e, {
386
- modelUrl: w,
387
- ortWasmPaths: T
396
+ let i = await e(t, {
397
+ modelUrl: E,
398
+ ortWasmPaths: D
388
399
  });
389
- if (a.status !== "success" || !a.corners || !a.quad) {
390
- N.current = !0, B("error"), K(a.message), P.current.onError?.(Error(a.message));
400
+ if (i.status !== "success" || !i.corners || !i.quad) {
401
+ L.current = !0, W("error"), Y(i.message), R.current.onError?.(Error(i.message));
391
402
  return;
392
403
  }
393
- j.current = {
394
- quad: a.quad,
395
- sourceWidth: a.sourceWidth,
396
- sourceHeight: a.sourceHeight
397
- }, a.quad && U(a.quad), B("captured");
398
- let o = {
399
- frame: e,
400
- detection: a,
404
+ F.current = {
405
+ quad: i.quad,
406
+ sourceWidth: i.sourceWidth,
407
+ sourceHeight: i.sourceHeight
408
+ }, i.quad && q(i.quad), W("captured");
409
+ let a = {
410
+ frame: t,
411
+ detection: i,
401
412
  reason: "manual",
402
413
  method: "system-camera",
403
- settings: t,
414
+ settings: n,
404
415
  luminance: r,
405
- displayedQuad: a.quad,
406
- displaySourceWidth: a.sourceWidth,
407
- displaySourceHeight: a.sourceHeight
416
+ displayedQuad: i.quad,
417
+ displaySourceWidth: i.sourceWidth,
418
+ displaySourceHeight: i.sourceHeight
408
419
  };
409
- if (P.current.useCase === "drivers-license") {
410
- await F.current(o);
420
+ if (R.current.useCase === "drivers-license") {
421
+ await me.current(a);
411
422
  return;
412
423
  }
413
- await me(P.current.onCapture, o);
424
+ await le(R.current.onCapture, a);
414
425
  } catch (e) {
415
426
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Could not take a photo.");
416
427
  if (t.message === "No photo was selected.") {
417
428
  if (He.current) {
418
- B("error");
429
+ W("error");
419
430
  return;
420
431
  }
421
- P.current.onCancel();
432
+ R.current.onCancel();
422
433
  return;
423
434
  }
424
- N.current = !0, K(t.message), B("error"), P.current.onError?.(t);
435
+ L.current = !0, Y(t.message), W("error"), R.current.onError?.(t);
425
436
  } finally {
426
- be.current = !1;
437
+ fe.current = !1;
427
438
  }
428
439
  }
429
440
  }, [
430
- Z,
431
- w,
432
- T,
433
- Q
434
- ]), Qe = h(async (e) => {
435
- let t = await Se.current;
441
+ Q,
442
+ Xe,
443
+ E,
444
+ D,
445
+ Qe
446
+ ]), it = _(async (e) => {
447
+ let t = await z.current;
436
448
  if (t) {
437
- Ke(!0);
449
+ qe(!0);
438
450
  try {
439
451
  let n = await t.submitStill(e.frame, e.detection);
440
452
  if (n.kind === "need-back") {
441
- R.current?.abort();
442
- let e = new AbortController();
443
- R.current = e, k.current?.stop(), k.current = void 0, Y.current = "front", I.current = !1, We("flip"), N.current = !1, K(""), H(void 0), U(void 0), W(void 0), M.current.clear(), B("ready"), Ke(!1);
453
+ M.current?.stop(), M.current = void 0, Ge.current = "front", B.current = !1, We("flip"), L.current = !1, Y(""), K(void 0), q(void 0), Q(), I.current.clear(), W("ready"), qe(!1);
444
454
  try {
445
- await ne(e.signal);
455
+ await _e();
446
456
  } catch {
447
457
  return;
448
458
  }
449
- if (R.current !== e || e.signal.aborted) return;
450
- if (R.current = void 0, Y.current = "back", We("back"), X(), D) {
451
- B("ready");
459
+ if (Ge.current = "back", We("back"), Z(), A) {
460
+ W("ready");
452
461
  return;
453
462
  }
454
- z?.paused && z.play(), B("starting"), Fe((e) => e + 1);
463
+ U?.paused && U.play(), W("starting"), Pe((e) => e + 1);
455
464
  return;
456
465
  }
457
466
  if (n.kind === "retry") {
458
- N.current = !0, K(n.message), B("error");
467
+ L.current = !0, Y(n.message), W("error");
459
468
  return;
460
469
  }
461
- await me(P.current.onDriverLicense, n.result);
470
+ await le(R.current.onDriverLicense, n.result);
462
471
  } catch (e) {
463
472
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Driver’s license scan failed.");
464
- N.current = !0, K(t.message), B("error"), P.current.onError?.(t);
473
+ L.current = !0, Y(t.message), W("error"), R.current.onError?.(t);
465
474
  } finally {
466
- Ke(!1);
475
+ qe(!1);
467
476
  }
468
477
  }
469
478
  }, [
470
- X,
471
- z,
472
- D
479
+ Q,
480
+ Z,
481
+ U,
482
+ A,
483
+ _e
473
484
  ]);
474
- oe(() => {
475
- F.current = Qe;
476
- }, [Qe]);
477
- let $e = h(async () => {
478
- if (D) {
485
+ ne(() => {
486
+ me.current = it;
487
+ }, [it]);
488
+ let at = _(async () => {
489
+ if (A) {
479
490
  await $();
480
491
  return;
481
492
  }
482
- let e = O.current;
483
- if (e && P.current.useCase === "drivers-license" && Y.current === "back") {
484
- try {
485
- let t = await e.capturePhoto(), n = await f(t.frame);
486
- if (!n?.text || I.current) return;
487
- I.current = !0, L.current?.abort(), A.current = t, G(t.method), J(t.diagnostics), q(t.diagnostics), Z(t.frame, z), B("captured"), await Q(t.frame, n.quad), await F.current({
488
- frame: t.frame,
489
- reason: "manual",
490
- method: t.method,
491
- settings: t.settings,
492
- fallbackReason: t.fallbackReason,
493
- luminance: t.luminance,
494
- diagnostics: t.diagnostics
495
- });
496
- } catch (e) {
497
- let t = e instanceof Error ? e : /* @__PURE__ */ Error("Could not capture the camera frame.");
498
- N.current = !0, K(t.message);
499
- let n = O.current?.getDiagnostics();
500
- n && q(n), A.current?.diagnostics && J(A.current.diagnostics), B("error"), P.current.onError?.(t);
501
- }
502
- return;
503
- }
504
493
  try {
505
- await k.current?.capture();
494
+ await M.current?.capture();
506
495
  } catch (e) {
507
496
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Could not capture the camera frame.");
508
- N.current = !0, K(t.message);
509
- let n = O.current?.getDiagnostics();
510
- n && q(n), A.current?.diagnostics && J(A.current.diagnostics), B("error"), P.current.onError?.(t);
497
+ L.current = !0, Y(t.message);
498
+ let n = j.current?.getDiagnostics();
499
+ n && X(n), P.current?.diagnostics && Le(P.current.diagnostics), W("error"), R.current.onError?.(t);
511
500
  }
512
- }, [
513
- $,
514
- Z,
515
- z,
516
- Q,
517
- D
518
- ]), et = _($);
519
- et.current = $;
520
- let tt = _(!1);
521
- oe(() => {
522
- if (!d || !D) {
523
- tt.current = !1;
501
+ }, [$, A]), ot = y($);
502
+ ot.current = $;
503
+ let st = y(!1);
504
+ ne(() => {
505
+ if (!r || !A) {
506
+ st.current = !1;
524
507
  return;
525
508
  }
526
- if (!tt.current) {
527
- if (tt.current = !0, N.current = !1, K(""), H(void 0), G(void 0), J(void 0), ze("idle"), U(void 0), W(void 0), M.current.clear(), X(), !e()) {
528
- B("ready");
509
+ if (!st.current) {
510
+ if (st.current = !0, L.current = !1, Y(""), K(void 0), je(void 0), Le(void 0), ze("idle"), q(void 0), Q(), I.current.clear(), Z(), !s()) {
511
+ W("ready");
529
512
  return;
530
513
  }
531
- et.current();
514
+ ot.current();
532
515
  }
533
516
  }, [
534
- d,
535
- D,
536
- X
517
+ r,
518
+ A,
519
+ Z,
520
+ Q
537
521
  ]);
538
- let nt = h(() => {
539
- if (N.current = !1, I.current = !1, K(""), J(void 0), ze("idle"), H(void 0), U(void 0), W(void 0), M.current.clear(), D) {
522
+ let ct = _(() => {
523
+ if (L.current = !1, B.current = !1, Y(""), Le(void 0), ze("idle"), K(void 0), q(void 0), Q(), I.current.clear(), A) {
540
524
  $();
541
525
  return;
542
526
  }
543
- if (X(), m === "drivers-license") {
544
- B("starting"), Fe((e) => e + 1);
527
+ if (Z(), m === "drivers-license") {
528
+ W("starting"), Pe((e) => e + 1);
545
529
  return;
546
530
  }
547
- let e = O.current;
548
- z?.paused && z.play(), B(e ? "ready" : "starting"), e || Fe((e) => e + 1);
531
+ let e = j.current;
532
+ U?.paused && U.play(), W(e ? "ready" : "starting"), e || Pe((e) => e + 1);
549
533
  }, [
550
534
  $,
551
- X,
552
- z,
535
+ Q,
536
+ Z,
537
+ U,
553
538
  m,
554
- D
555
- ]), rt = h(async (e) => {
556
- let t = O.current;
557
- t && (await t.setTorch(e), q(t.getDiagnostics()));
558
- }, []), it = h((e) => {
559
- k.current?.setAutoCapture(e);
560
- }, []), at = h(async () => {
561
- let e = Ce.current, t = O.current?.getDiagnostics() ?? e.diagnostics, n = e.finderStatus, r = re({
539
+ A
540
+ ]), lt = _(async (e) => {
541
+ let t = j.current;
542
+ t && (await t.setTorch(e), X(t.getDiagnostics()));
543
+ }, []), ut = _((e) => {
544
+ M.current?.setAutoCapture(e);
545
+ }, []), dt = _(async () => {
546
+ let e = ve.current, t = j.current?.getDiagnostics() ?? e.diagnostics, n = e.finderStatus, r = o({
562
547
  error: e.error || void 0,
563
548
  captureMethod: e.captureMethod,
564
- luminance: A.current?.luminance,
565
- fallbackReason: A.current?.fallbackReason,
566
- shutter: e.shutterDiagnostics ?? A.current?.diagnostics,
549
+ luminance: P.current?.luminance,
550
+ fallbackReason: P.current?.fallbackReason,
551
+ shutter: e.shutterDiagnostics ?? P.current?.diagnostics,
567
552
  live: t,
568
553
  finder: n ? {
569
554
  state: n.state,
@@ -592,51 +577,53 @@ function he({ open: d, useCase: m = "document", autoCapture: ie = "defaultOn", c
592
577
  } catch {
593
578
  ze("failed");
594
579
  }
595
- }, []), ot = h(() => Ce.current, []), st = se(() => ({
596
- capture: $e,
597
- cancel: Ze,
598
- retry: nt,
599
- setTorch: rt,
600
- setAutoCapture: it,
601
- copyReport: at,
602
- getState: ot
580
+ }, []), ft = _(() => ve.current, []), pt = re(() => ({
581
+ capture: at,
582
+ cancel: rt,
583
+ retry: ct,
584
+ continueLicenseFlip: ge,
585
+ setTorch: lt,
586
+ setAutoCapture: ut,
587
+ copyReport: dt,
588
+ getState: ft
603
589
  }), [
604
- $e,
605
- Ze,
606
- nt,
607
- rt,
608
- it,
609
590
  at,
610
- ot
591
+ rt,
592
+ ct,
593
+ ge,
594
+ lt,
595
+ ut,
596
+ dt,
597
+ ft
611
598
  ]);
612
- g(() => {
613
- if (E) return E.current = st, () => {
614
- E.current = null;
599
+ v(() => {
600
+ if (k) return k.current = pt, () => {
601
+ k.current = null;
615
602
  };
616
- }, [st, E]);
617
- let ct = {
618
- ...Xe,
619
- ...st,
620
- bindPreview: Ye
603
+ }, [pt, k]);
604
+ let mt = {
605
+ ...nt,
606
+ ...pt,
607
+ bindPreview: $e
621
608
  };
622
- return /* @__PURE__ */ y(ue.Provider, {
623
- value: ct,
624
- children: ve
609
+ return /* @__PURE__ */ S(oe.Provider, {
610
+ value: mt,
611
+ children: de
625
612
  });
626
613
  }
627
614
  //#endregion
628
615
  //#region src/react/hooks.ts
629
- function ge() {
630
- return _(null);
616
+ function E() {
617
+ return y(null);
631
618
  }
632
- function w() {
633
- let e = ae(ue);
619
+ function D() {
620
+ let e = te(oe);
634
621
  if (!e) throw Error("useScanner must be used within ScannerProvider.");
635
622
  return e;
636
623
  }
637
624
  //#endregion
638
625
  //#region src/live-overlay-geometry.ts
639
- function T(e, t, n, r, i) {
626
+ function O(e, t, n, r, i) {
640
627
  let a = Math.max(1, e), o = Math.max(1, t), s = Math.max(1, n), c = Math.max(1, r), l = s / a, u = c / o, d = i === "cover" ? Math.max(l, u) : Math.min(l, u), f = (s - a * d) / 2, p = (c - o * d) / 2;
641
628
  if (i === "contain") return {
642
629
  viewBox: `0 0 ${a} ${o}`,
@@ -645,9 +632,9 @@ function T(e, t, n, r, i) {
645
632
  offsetX: f,
646
633
  offsetY: p
647
634
  };
648
- let ee = s / d, te = c / d;
635
+ let m = s / d, h = c / d;
649
636
  return {
650
- viewBox: `${-f / d} ${-p / d} ${ee} ${te}`,
637
+ viewBox: `${-f / d} ${-p / d} ${m} ${h}`,
651
638
  preserveAspectRatio: "none",
652
639
  scale: d,
653
640
  offsetX: f,
@@ -656,10 +643,10 @@ function T(e, t, n, r, i) {
656
643
  }
657
644
  //#endregion
658
645
  //#region src/components/ModelDownloadRing.tsx
659
- function _e({ snapshot: e }) {
646
+ function k({ snapshot: e }) {
660
647
  if (!e.downloading) return null;
661
648
  let t = e.total && e.total > 0 ? Math.min(1, e.loaded / e.total) : null, n = t === null ? null : Math.round(t * 100), r = 2 * Math.PI * 28;
662
- return /* @__PURE__ */ b("div", {
649
+ return /* @__PURE__ */ C("div", {
663
650
  className: `model-download-ring${t === null ? " is-indeterminate" : ""}`,
664
651
  role: "progressbar",
665
652
  "aria-label": "Model download",
@@ -668,15 +655,15 @@ function _e({ snapshot: e }) {
668
655
  "aria-valuenow": n ?? void 0,
669
656
  "data-loaded": e.loaded,
670
657
  "data-total": e.total ?? "",
671
- children: [/* @__PURE__ */ b("svg", {
658
+ children: [/* @__PURE__ */ C("svg", {
672
659
  viewBox: "0 0 72 72",
673
660
  "aria-hidden": "true",
674
- children: [/* @__PURE__ */ y("circle", {
661
+ children: [/* @__PURE__ */ S("circle", {
675
662
  className: "track",
676
663
  cx: "36",
677
664
  cy: "36",
678
665
  r: 28
679
- }), /* @__PURE__ */ y("circle", {
666
+ }), /* @__PURE__ */ S("circle", {
680
667
  className: "value",
681
668
  cx: "36",
682
669
  cy: "36",
@@ -684,20 +671,20 @@ function _e({ snapshot: e }) {
684
671
  strokeDasharray: t === null ? void 0 : `${r} ${r}`,
685
672
  strokeDashoffset: t === null ? void 0 : r * (1 - t)
686
673
  })]
687
- }), n === null ? /* @__PURE__ */ y("strong", {
674
+ }), n === null ? /* @__PURE__ */ S("strong", {
688
675
  className: "model-download-ring__pending",
689
676
  children: "…"
690
- }) : /* @__PURE__ */ b("strong", { children: [n, "%"] })]
677
+ }) : /* @__PURE__ */ C("strong", { children: [n, "%"] })]
691
678
  });
692
679
  }
693
680
  //#endregion
694
681
  //#region src/react/guidance.ts
695
- function E(e) {
696
- if (!(e.usingSystemCamera || e.licenseBusy) && e.phase !== "error") return e.licenseFlipCue || e.phase === "starting" ? e.licenseHeadline : e.phase === "capturing" ? "Capturing full resolution…" : e.phase === "captured" ? "Document captured" : e.holdStillSeconds && e.holdStillSeconds > 0 ? d(e.holdStillSeconds) : e.guidanceHint && e.guidanceReason && e.guidanceReason !== "place-document" ? e.guidanceHint : e.licenseHeadline ?? e.guidanceHint ?? "Place the document in the frame";
682
+ function de(e) {
683
+ if (!(e.usingSystemCamera || e.licenseBusy) && e.phase !== "error" && !e.licenseFlipCue) return e.phase === "starting" ? e.licenseHeadline : e.phase === "capturing" ? "Capturing full resolution…" : e.phase === "captured" ? "Document captured" : e.holdStillSeconds && e.holdStillSeconds > 0 ? h(e.holdStillSeconds) : e.guidanceHint && e.guidanceReason && e.guidanceReason !== "place-document" ? e.guidanceHint : e.licenseHeadline ?? e.guidanceHint ?? "Place the document in the frame";
697
684
  }
698
685
  //#endregion
699
686
  //#region src/react/parts.tsx
700
- var ve = {
687
+ var A = {
701
688
  primaryColorHex: "--scanner-overlay-primary",
702
689
  seekingColorHex: "--scanner-overlay-seeking",
703
690
  detectingColorHex: "--scanner-overlay-detecting",
@@ -705,46 +692,46 @@ var ve = {
705
692
  readyColorHex: "--scanner-overlay-ready",
706
693
  capturedColorHex: "--scanner-overlay-captured"
707
694
  };
708
- function D(e) {
695
+ function j(e) {
709
696
  if (!e) return;
710
697
  let t = {};
711
- for (let [n, r] of Object.entries(ve)) {
698
+ for (let [n, r] of Object.entries(A)) {
712
699
  let i = e[n]?.trim();
713
700
  i && (t[r] = i);
714
701
  }
715
702
  return Object.keys(t).length > 0 ? t : void 0;
716
703
  }
717
- function O({ theme: e, style: t, title: n, children: r }) {
718
- let i = w();
704
+ function M({ theme: e, style: t, title: n, children: r }) {
705
+ let i = D();
719
706
  if (!i.open) return null;
720
- let a = n ?? (i.useCase === "drivers-license" ? "Scan a driver’s license" : "Scan a document"), o = D(e), s = o ? {
707
+ let a = n ?? (i.useCase === "drivers-license" ? "Scan a driver’s license" : "Scan a document"), o = j(e), s = o ? {
721
708
  ...t,
722
709
  ...o
723
710
  } : t;
724
- return /* @__PURE__ */ b("div", {
711
+ return /* @__PURE__ */ C("div", {
725
712
  className: `scanner-camera-overlay ${i.phase === "captured" || i.finderStatus?.state === "captured" ? "is-captured" : ""} ${i.usingSystemCamera ? "is-system-camera" : ""}`.trim(),
726
713
  style: s,
727
714
  role: "dialog",
728
715
  "aria-modal": "true",
729
716
  "aria-label": a,
730
- children: [r, /* @__PURE__ */ y(P, {})]
717
+ children: [r, /* @__PURE__ */ S(z, {})]
731
718
  });
732
719
  }
733
- function k() {
734
- let { bindPreview: e, frozenPreviewUrl: t, usingSystemCamera: n } = w(), r = _(null), i = h((t) => {
720
+ function N() {
721
+ let { bindPreview: e, frozenPreviewUrl: t, usingSystemCamera: n } = D(), r = y(null), i = _((t) => {
735
722
  r.current = t, e(t);
736
723
  }, [e]);
737
- return g(() => {
724
+ return v(() => {
738
725
  t && r.current?.pause();
739
- }, [t]), n ? t ? /* @__PURE__ */ y("img", {
726
+ }, [t]), n ? t ? /* @__PURE__ */ S("img", {
740
727
  src: t,
741
728
  className: "scanner-camera-overlay__video scanner-camera-overlay__still",
742
729
  alt: "",
743
730
  "aria-label": "Captured document"
744
- }) : /* @__PURE__ */ y("div", {
731
+ }) : /* @__PURE__ */ S("div", {
745
732
  className: "scanner-camera-overlay__video",
746
733
  "aria-hidden": "true"
747
- }) : /* @__PURE__ */ b(ce, { children: [/* @__PURE__ */ y("video", {
734
+ }) : /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("video", {
748
735
  ref: i,
749
736
  className: "scanner-camera-overlay__video",
750
737
  muted: !0,
@@ -753,36 +740,52 @@ function k() {
753
740
  style: { objectFit: "cover" },
754
741
  "aria-hidden": !!t,
755
742
  "aria-label": "Rear camera preview"
756
- }), t ? /* @__PURE__ */ y("img", {
743
+ }), t ? /* @__PURE__ */ S("img", {
757
744
  src: t,
758
745
  className: "scanner-camera-overlay__video scanner-camera-overlay__still",
759
746
  alt: "",
760
747
  "aria-label": "Captured document"
761
748
  }) : null] });
762
749
  }
763
- function ye() {
764
- let { finderStatus: e, displayQuad: t, previewSize: n, barcodeOverlay: r } = w(), i = e?.sourceWidth ?? r?.width, a = e?.sourceHeight ?? r?.height;
765
- if (!t || !i || !a) return null;
766
- let o = T(i, a, n.width, n.height, "cover"), s = r ? "ready" : e?.state;
767
- return /* @__PURE__ */ y("svg", {
768
- className: `scanner-camera-overlay__quad ${s ?? ""}`.trim(),
750
+ function P({ quad: e, sourceWidth: t, sourceHeight: n, previewSize: r, state: i, label: a }) {
751
+ let o = O(t, n, r.width, r.height, "cover");
752
+ return /* @__PURE__ */ S("svg", {
753
+ className: `scanner-camera-overlay__quad ${i ?? ""}`.trim(),
769
754
  viewBox: o.viewBox,
770
755
  preserveAspectRatio: o.preserveAspectRatio,
771
- "aria-label": r ? "PDF417 barcode boundary" : `${e?.state ?? "document"} document boundary`,
772
- children: /* @__PURE__ */ y("polygon", { points: `${t.topLeft.x},${t.topLeft.y} ${t.topRight.x},${t.topRight.y} ${t.bottomRight.x},${t.bottomRight.y} ${t.bottomLeft.x},${t.bottomLeft.y}` })
756
+ "aria-label": a,
757
+ children: /* @__PURE__ */ S("polygon", { points: `${e.topLeft.x},${e.topLeft.y} ${e.topRight.x},${e.topRight.y} ${e.bottomRight.x},${e.bottomRight.y} ${e.bottomLeft.x},${e.bottomLeft.y}` })
773
758
  });
774
759
  }
775
- function A({ title: e }) {
776
- let { phase: t, cancel: n, usingSystemCamera: r, useCase: i, licenseSide: a, licenseBusy: o } = w(), s = i === "drivers-license" ? m(a ?? "front", r) : void 0, c = e ?? s?.title ?? "Scan a document";
777
- return /* @__PURE__ */ b("div", {
760
+ function F() {
761
+ let { finderStatus: e, displayQuad: t, previewSize: n, barcodeOverlay: r, barcodeQuad: i } = D(), a = e?.sourceWidth ?? (t && r ? r.width : void 0), o = e?.sourceHeight ?? (t && r ? r.height : void 0), s = !!e?.holdStillSeconds || e?.state === "ready" || !(!t && !i || e), c = s ? "ready" : e?.state;
762
+ return /* @__PURE__ */ C(x, { children: [t && a && o ? /* @__PURE__ */ S(P, {
763
+ quad: t,
764
+ sourceWidth: a,
765
+ sourceHeight: o,
766
+ previewSize: n,
767
+ state: c,
768
+ label: `${e?.state ?? "document"} document boundary`
769
+ }) : null, i && r ? /* @__PURE__ */ S(P, {
770
+ quad: i,
771
+ sourceWidth: r.width,
772
+ sourceHeight: r.height,
773
+ previewSize: n,
774
+ state: s || e?.state === "ready" ? "ready" : e?.state ?? "ready",
775
+ label: "PDF417 barcode boundary"
776
+ }) : null] });
777
+ }
778
+ function I({ title: e }) {
779
+ let { phase: t, cancel: n, usingSystemCamera: r, useCase: i, licenseSide: a, licenseBusy: o } = D(), s = i === "drivers-license" ? m(a ?? "front", r) : void 0, c = e ?? s?.title ?? "Scan a document";
780
+ return /* @__PURE__ */ C("div", {
778
781
  className: "scanner-camera-overlay__topbar",
779
- children: [/* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("strong", { children: c }), /* @__PURE__ */ b("span", {
782
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("strong", { children: c }), /* @__PURE__ */ C("span", {
780
783
  "aria-live": "polite",
781
784
  children: [
782
785
  o && (a === "back" ? "Reading the barcode…" : "Reading the front…"),
783
786
  !o && s && a === "flip" && "Turn the license over",
784
787
  !o && s && t === "error" && (a === "back" ? "Could not read the back" : "Could not read the front"),
785
- !o && !s && r && /* @__PURE__ */ b(ce, { children: [
788
+ !o && !s && r && /* @__PURE__ */ C(x, { children: [
786
789
  t === "starting" && "Preparing the system camera…",
787
790
  t === "ready" && "Take a photo. There is no live document guide.",
788
791
  t === "capturing" && "Looking for a document…",
@@ -791,7 +794,7 @@ function A({ title: e }) {
791
794
  ] }),
792
795
  !o && !s && !r && t === "error" && "Camera unavailable"
793
796
  ]
794
- })] }), /* @__PURE__ */ y("button", {
797
+ })] }), /* @__PURE__ */ S("button", {
795
798
  type: "button",
796
799
  onClick: n,
797
800
  "aria-label": "Close camera",
@@ -799,90 +802,108 @@ function A({ title: e }) {
799
802
  })]
800
803
  });
801
804
  }
802
- function j() {
803
- let { phase: e, error: t, diagnostics: n, copyState: r, retry: i, copyReport: a, cancel: o, usingSystemCamera: s, frozenPreviewUrl: c, useCase: l, licenseSide: u, licenseBusy: d } = w(), f = l === "drivers-license" ? m(u ?? "front", s) : void 0;
804
- return u === "flip" && f ? s ? /* @__PURE__ */ b("div", {
805
- className: "scanner-camera-overlay__message",
806
- "aria-live": "polite",
807
- children: [/* @__PURE__ */ y("strong", { children: f.headline }), /* @__PURE__ */ y("p", { children: f.detail })]
808
- }) : null : e === "error" ? /* @__PURE__ */ b("div", {
805
+ function L() {
806
+ let { phase: e, error: t, diagnostics: n, copyState: r, retry: i, copyReport: a, cancel: o, usingSystemCamera: s, frozenPreviewUrl: c, useCase: l, licenseSide: u, licenseBusy: d, continueLicenseFlip: f } = D(), p = l === "drivers-license" ? m(u ?? "front", s) : void 0;
807
+ return u === "flip" && p ? /* @__PURE__ */ S("div", {
808
+ className: "scanner-camera-overlay__flip",
809
+ role: "dialog",
810
+ "aria-modal": "true",
811
+ "aria-labelledby": "scanner-license-flip-title",
812
+ "aria-describedby": "scanner-license-flip-detail",
813
+ children: /* @__PURE__ */ C("div", {
814
+ className: "scanner-camera-overlay__message",
815
+ children: [
816
+ /* @__PURE__ */ S("strong", {
817
+ id: "scanner-license-flip-title",
818
+ children: p.headline
819
+ }),
820
+ /* @__PURE__ */ S("p", {
821
+ id: "scanner-license-flip-detail",
822
+ children: p.detail
823
+ }),
824
+ /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S("button", {
825
+ type: "button",
826
+ onClick: f,
827
+ children: "Continue"
828
+ }) })
829
+ ]
830
+ })
831
+ }) : e === "error" ? /* @__PURE__ */ C("div", {
809
832
  className: "scanner-camera-overlay__message",
810
833
  role: "alert",
811
834
  children: [
812
- /* @__PURE__ */ y("strong", { children: f ? u === "back" ? "Could not read the back" : "Could not read the front" : s ? c ? "No document found" : "Could not take a photo" : n ? "Capture failed" : "Could not open the camera" }),
813
- /* @__PURE__ */ y("p", { children: t }),
814
- /* @__PURE__ */ b("div", { children: [
815
- /* @__PURE__ */ y("button", {
835
+ /* @__PURE__ */ S("strong", { children: p ? u === "back" ? "Could not read the back" : "Could not read the front" : s ? c ? "No document found" : "Could not take a photo" : n ? "Capture failed" : "Could not open the camera" }),
836
+ /* @__PURE__ */ S("p", { children: t }),
837
+ /* @__PURE__ */ C("div", { children: [
838
+ /* @__PURE__ */ S("button", {
816
839
  type: "button",
817
840
  onClick: i,
818
841
  children: "Try again"
819
842
  }),
820
- /* @__PURE__ */ y("button", {
843
+ /* @__PURE__ */ S("button", {
821
844
  type: "button",
822
845
  onClick: () => void a(),
823
846
  children: r === "copied" ? "Copied" : r === "failed" ? "Copy failed" : "Copy report"
824
847
  }),
825
- /* @__PURE__ */ y("button", {
848
+ /* @__PURE__ */ S("button", {
826
849
  type: "button",
827
850
  onClick: o,
828
851
  children: "Cancel"
829
852
  })
830
853
  ] })
831
854
  ]
832
- }) : d ? /* @__PURE__ */ b("div", {
855
+ }) : d ? /* @__PURE__ */ C("div", {
833
856
  className: "scanner-camera-overlay__message",
834
857
  "aria-live": "polite",
835
858
  children: [
836
- /* @__PURE__ */ y("span", { className: "scanner-camera-overlay__spinner" }),
837
- /* @__PURE__ */ y("strong", { children: u === "back" ? "Reading the barcode" : "Reading the front" }),
838
- /* @__PURE__ */ y("p", { children: u === "back" ? "Decoding the AAMVA PDF417 on the back." : "Finding the card and reading the front with OCR." })
859
+ /* @__PURE__ */ S("span", { className: "scanner-camera-overlay__spinner" }),
860
+ /* @__PURE__ */ S("strong", { children: u === "back" ? "Reading the barcode" : "Reading the front" }),
861
+ /* @__PURE__ */ S("p", { children: u === "back" ? "Decoding the AAMVA PDF417 on the back." : "Finding the card and reading the front with OCR." })
839
862
  ]
840
- }) : s && e === "capturing" && !c ? /* @__PURE__ */ b("div", {
863
+ }) : s && e === "capturing" && !c ? /* @__PURE__ */ C("div", {
841
864
  className: "scanner-camera-overlay__message",
842
865
  "aria-live": "polite",
843
866
  children: [
844
- /* @__PURE__ */ y("span", { className: "scanner-camera-overlay__spinner" }),
845
- /* @__PURE__ */ y("strong", { children: f ? f.headline : "Opening the system camera" }),
846
- /* @__PURE__ */ y("p", { children: f ? f.detail : "There is no live document guide. We find the page after you take the photo." })
867
+ /* @__PURE__ */ S("span", { className: "scanner-camera-overlay__spinner" }),
868
+ /* @__PURE__ */ S("strong", { children: p ? p.headline : "Opening the system camera" }),
869
+ /* @__PURE__ */ S("p", { children: p ? p.detail : "There is no live document guide. We find the page after you take the photo." })
847
870
  ]
848
- }) : s && e === "ready" && !c ? /* @__PURE__ */ b("div", {
871
+ }) : s && e === "ready" && !c ? /* @__PURE__ */ C("div", {
849
872
  className: "scanner-camera-overlay__message",
850
873
  "aria-live": "polite",
851
- children: [/* @__PURE__ */ y("strong", { children: f ? f.headline : "System camera" }), /* @__PURE__ */ y("p", { children: f ? f.detail : "Tap the shutter to open the Camera app. There is no live document guide." })]
852
- }) : e === "starting" && !s ? /* @__PURE__ */ b("div", {
874
+ children: [/* @__PURE__ */ S("strong", { children: p ? p.headline : "System camera" }), /* @__PURE__ */ S("p", { children: p ? p.detail : "Tap the shutter to open the Camera app. There is no live document guide." })]
875
+ }) : e === "starting" && !s ? /* @__PURE__ */ C("div", {
853
876
  className: "scanner-camera-overlay__message",
854
877
  "aria-live": "polite",
855
878
  children: [
856
- /* @__PURE__ */ y("span", { className: "scanner-camera-overlay__spinner" }),
857
- /* @__PURE__ */ y("strong", { children: "Requesting the highest practical resolution" }),
858
- /* @__PURE__ */ y("p", { children: "Allow camera access to continue." })
879
+ /* @__PURE__ */ S("span", { className: "scanner-camera-overlay__spinner" }),
880
+ /* @__PURE__ */ S("strong", { children: "Requesting the highest practical resolution" }),
881
+ /* @__PURE__ */ S("p", { children: "Allow camera access to continue." })
859
882
  ]
860
883
  }) : null;
861
884
  }
862
- function M() {
863
- let { finderStatus: e, detectorStatus: t, settings: n, usingSystemCamera: r, captureMethod: i, phase: a, useCase: o, licenseSide: s } = w(), c = n?.width, l = n?.height, u = o === "drivers-license" ? ` · ${s === "back" ? "back" : s === "flip" ? "flip" : "front"}` : "";
864
- if (r) return /* @__PURE__ */ y("div", {
885
+ function fe() {
886
+ let { finderStatus: e, detectorStatus: t, settings: n, usingSystemCamera: r, captureMethod: i, phase: a, useCase: o, licenseSide: s } = D(), c = n?.width, l = n?.height, u = o === "drivers-license" ? ` · ${s === "back" ? "back" : s === "flip" ? "flip" : "front"}` : "";
887
+ return r ? /* @__PURE__ */ S("div", {
865
888
  className: "scanner-camera-overlay__status",
866
889
  "aria-live": "polite",
867
- children: /* @__PURE__ */ b("div", {
890
+ children: /* @__PURE__ */ C("div", {
868
891
  className: "scanner-camera-overlay__status-line",
869
892
  children: [
870
- /* @__PURE__ */ y("span", { className: a === "captured" ? "ready" : a === "error" ? "seeking" : "detecting" }),
893
+ /* @__PURE__ */ S("span", { className: a === "captured" ? "ready" : a === "error" ? "seeking" : "detecting" }),
871
894
  i === "system-camera" ? "system camera" : "system camera · waiting",
872
895
  u,
873
896
  c && l ? ` · ${c}×${l}` : ""
874
897
  ]
875
898
  })
876
- });
877
- let d = o === "drivers-license" && s === "back", f = d && !e ? "reading" : e?.state ?? "detecting";
878
- return /* @__PURE__ */ y("div", {
899
+ }) : /* @__PURE__ */ S("div", {
879
900
  className: "scanner-camera-overlay__status",
880
901
  "aria-live": "polite",
881
- children: /* @__PURE__ */ b("div", {
902
+ children: /* @__PURE__ */ C("div", {
882
903
  className: "scanner-camera-overlay__status-line",
883
904
  children: [
884
- /* @__PURE__ */ y("span", { className: d && !e ? "detecting" : e?.state ?? "detecting" }),
885
- f,
905
+ /* @__PURE__ */ S("span", { className: e?.state ?? "detecting" }),
906
+ e?.state ?? "detecting",
886
907
  u,
887
908
  e ? ` · ${Math.round(e.confidence * 100)}% · ${e.stableFrames}/${e.requiredStableFrames}` : "",
888
909
  ` · ${t}`,
@@ -892,78 +913,78 @@ function M() {
892
913
  })
893
914
  });
894
915
  }
895
- function N() {
896
- let { diagnostics: e, shutterDiagnostics: t, captureMethod: n, copyState: r, copyReport: i } = w(), o = e?.engine ?? a();
897
- return /* @__PURE__ */ b("dl", {
916
+ function R() {
917
+ let { diagnostics: e, shutterDiagnostics: t, captureMethod: n, copyState: i, copyReport: a } = D(), o = e?.engine ?? r();
918
+ return /* @__PURE__ */ C("dl", {
898
919
  className: "scanner-camera-overlay__diagnostics",
899
920
  "aria-label": "Camera diagnostics",
900
921
  children: [
901
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "engine" }), /* @__PURE__ */ b("dd", { children: [
922
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "engine" }), /* @__PURE__ */ C("dd", { children: [
902
923
  o.engine,
903
924
  "/",
904
925
  o.browser,
905
926
  o.iosWebKit ? " ios" : ""
906
927
  ] })] }),
907
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "video" }), /* @__PURE__ */ y("dd", { children: e ? `${e.videoWidth}×${e.videoHeight} rs${e.readyState}${e.paused ? " paused" : ""}${e.rendered ? "" : " hidden"}` : "starting" })] }),
908
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "track" }), /* @__PURE__ */ y("dd", { children: e ? `${e.trackReadyState}${e.trackMuted ? " muted" : ""}${e.trackEnabled ? "" : " disabled"}` : "—" })] }),
909
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "torch" }), /* @__PURE__ */ y("dd", { children: e ? `${e.torch.mode} · ${e.torch.supported ? e.torch.on ? "on" : "off" : "unsupported"}` : "starting" })] }),
910
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "luma" }), /* @__PURE__ */ y("dd", { children: e ? `live ${e.liveLuminance.toFixed(1)} · mirror ${e.mirrorLuminance.toFixed(1)}${Number.isFinite(e.mirrorAgeMs) ? ` (${Math.round(e.mirrorAgeMs)}ms)` : " (none)"}` : "—" })] }),
911
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "path" }), /* @__PURE__ */ y("dd", { children: n ?? "video-frame / live-mirror" })] }),
912
- t ? /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "shutter" }), /* @__PURE__ */ y("dd", { children: `live ${t.liveLuminance.toFixed(1)} · mirror ${t.mirrorLuminance.toFixed(1)}${Number.isFinite(t.mirrorAgeMs) ? ` (${Math.round(t.mirrorAgeMs)}ms)` : " (none)"}` })] }) : null,
913
- /* @__PURE__ */ b("div", { children: [/* @__PURE__ */ y("dt", { children: "share" }), /* @__PURE__ */ y("dd", { children: /* @__PURE__ */ y("button", {
928
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "video" }), /* @__PURE__ */ S("dd", { children: e ? `${e.videoWidth}×${e.videoHeight} rs${e.readyState}${e.paused ? " paused" : ""}${e.rendered ? "" : " hidden"}` : "starting" })] }),
929
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "track" }), /* @__PURE__ */ S("dd", { children: e ? `${e.trackReadyState}${e.trackMuted ? " muted" : ""}${e.trackEnabled ? "" : " disabled"}` : "—" })] }),
930
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "torch" }), /* @__PURE__ */ S("dd", { children: e ? `${e.torch.mode} · ${e.torch.supported ? e.torch.on ? "on" : "off" : "unsupported"}` : "starting" })] }),
931
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "luma" }), /* @__PURE__ */ S("dd", { children: e ? `live ${e.liveLuminance.toFixed(1)} · mirror ${e.mirrorLuminance.toFixed(1)}${Number.isFinite(e.mirrorAgeMs) ? ` (${Math.round(e.mirrorAgeMs)}ms)` : " (none)"}` : "—" })] }),
932
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "path" }), /* @__PURE__ */ S("dd", { children: n ?? "video-frame / live-mirror" })] }),
933
+ t ? /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "shutter" }), /* @__PURE__ */ S("dd", { children: `live ${t.liveLuminance.toFixed(1)} · mirror ${t.mirrorLuminance.toFixed(1)}${Number.isFinite(t.mirrorAgeMs) ? ` (${Math.round(t.mirrorAgeMs)}ms)` : " (none)"}` })] }) : null,
934
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("dt", { children: "share" }), /* @__PURE__ */ S("dd", { children: /* @__PURE__ */ S("button", {
914
935
  type: "button",
915
936
  className: "scanner-camera-overlay__copy",
916
- onClick: () => void i(),
917
- children: r === "copied" ? "Copied report" : r === "failed" ? "Copy failed" : "Copy report"
937
+ onClick: () => void a(),
938
+ children: i === "copied" ? "Copied report" : i === "failed" ? "Copy failed" : "Copy report"
918
939
  }) })] })
919
940
  ]
920
941
  });
921
942
  }
922
- function be() {
923
- let { autoCapture: e, phase: t, finderStatus: n, diagnostics: r, captureMethod: i, settings: a, cancel: o, capture: s, setAutoCapture: c, setTorch: l, usingSystemCamera: u, licenseBusy: d, useCase: f, licenseSide: p, guidanceHint: ee } = w(), te = a?.width, ne = a?.height, re = p !== "flip" && (u ? t === "ready" : e !== "only"), ie = f === "drivers-license" ? m(p ?? "front", u) : void 0, h = E({
943
+ function pe() {
944
+ let { autoCapture: e, phase: t, finderStatus: n, diagnostics: r, captureMethod: i, settings: a, cancel: o, capture: s, setAutoCapture: c, setTorch: l, usingSystemCamera: u, licenseBusy: d, useCase: f, licenseSide: p, guidanceHint: h } = D(), ee = a?.width, g = a?.height, _ = p !== "flip" && (u ? t === "ready" : e !== "only"), te = f === "drivers-license" ? m(p ?? "front", u) : void 0, v = de({
924
945
  usingSystemCamera: u,
925
946
  phase: t,
926
947
  licenseBusy: d,
927
948
  holdStillSeconds: n?.holdStillSeconds,
928
- guidanceHint: ee,
949
+ guidanceHint: h,
929
950
  guidanceReason: n?.guidance.reason,
930
- licenseHeadline: ie?.headline,
951
+ licenseHeadline: te?.headline,
931
952
  licenseFlipCue: p === "flip"
932
- }), ae = !!n?.holdStillSeconds;
933
- return /* @__PURE__ */ b("div", {
953
+ }), ne = !!n?.holdStillSeconds;
954
+ return /* @__PURE__ */ C("div", {
934
955
  className: "scanner-camera-overlay__controls",
935
956
  children: [
936
- /* @__PURE__ */ y("button", {
957
+ /* @__PURE__ */ S("button", {
937
958
  type: "button",
938
959
  className: "scanner-camera-overlay__cancel",
939
960
  onClick: o,
940
961
  children: "Cancel"
941
962
  }),
942
- /* @__PURE__ */ b("div", {
963
+ /* @__PURE__ */ C("div", {
943
964
  className: "scanner-camera-overlay__capture",
944
965
  children: [
945
- h && /* @__PURE__ */ y("p", {
946
- className: `scanner-camera-overlay__guidance${ae ? " is-ready" : ""}`,
966
+ v && /* @__PURE__ */ S("p", {
967
+ className: `scanner-camera-overlay__guidance${ne ? " is-ready" : ""}`,
947
968
  "aria-live": "polite",
948
- children: h
969
+ children: v
949
970
  }),
950
- re && /* @__PURE__ */ y("button", {
971
+ _ && /* @__PURE__ */ S("button", {
951
972
  type: "button",
952
973
  className: "scanner-camera-overlay__shutter",
953
974
  onClick: () => void s(),
954
975
  disabled: t !== "ready" || !!d,
955
976
  "aria-label": u ? "Take a photo with the system camera" : "Capture full-resolution photo",
956
- children: /* @__PURE__ */ y("span", {})
977
+ children: /* @__PURE__ */ S("span", {})
957
978
  }),
958
- !u && /* @__PURE__ */ b("div", {
979
+ !u && /* @__PURE__ */ C("div", {
959
980
  className: "scanner-camera-overlay__toggles",
960
- children: [n?.autoCapture.visible && /* @__PURE__ */ b("label", { children: [/* @__PURE__ */ y("input", {
981
+ children: [n?.autoCapture.visible && /* @__PURE__ */ C("label", { children: [/* @__PURE__ */ S("input", {
961
982
  type: "checkbox",
962
983
  checked: n.autoCapture.checked,
963
984
  onChange: (e) => c(e.target.checked)
964
- }), "Auto-capture"] }), r?.torch.visible && /* @__PURE__ */ b("label", {
985
+ }), "Auto-capture"] }), r?.torch.visible && /* @__PURE__ */ C("label", {
965
986
  title: r.torch.automatic ? "Torch is controlled automatically from scene brightness" : void 0,
966
- children: [/* @__PURE__ */ y("input", {
987
+ children: [/* @__PURE__ */ S("input", {
967
988
  type: "checkbox",
968
989
  checked: r.torch.on,
969
990
  disabled: !r.torch.mutable,
@@ -973,18 +994,18 @@ function be() {
973
994
  })
974
995
  ]
975
996
  }),
976
- /* @__PURE__ */ b("div", {
997
+ /* @__PURE__ */ C("div", {
977
998
  className: "scanner-camera-overlay__quality",
978
- children: [/* @__PURE__ */ y("span", { children: u ? "System camera" : i === "live-mirror" ? "Mirror" : "Camera" }), /* @__PURE__ */ y("strong", { children: te && ne ? `${te} × ${ne}` : u ? "Tap to photograph" : "Measuring…" })]
999
+ children: [/* @__PURE__ */ S("span", { children: u ? "System camera" : i === "live-mirror" ? "Mirror" : "Camera" }), /* @__PURE__ */ S("strong", { children: ee && g ? `${ee} × ${g}` : u ? "Tap to photograph" : "Measuring…" })]
979
1000
  })
980
1001
  ]
981
1002
  });
982
1003
  }
983
- function P({ snapshot: e }) {
984
- let { modelDownload: t } = w();
985
- return /* @__PURE__ */ y(_e, { snapshot: e ?? t });
1004
+ function z({ snapshot: e }) {
1005
+ let { modelDownload: t } = D();
1006
+ return /* @__PURE__ */ S(k, { snapshot: e ?? t });
986
1007
  }
987
1008
  //#endregion
988
- export { be as ScannerControls, N as ScannerDiagnostics, O as ScannerFrame, P as ScannerModelDownload, j as ScannerNotice, k as ScannerPreview, he as ScannerProvider, ye as ScannerQuad, M as ScannerStatus, A as ScannerTopBar, w as useScanner, ge as useScannerRef };
1009
+ export { pe as ScannerControls, R as ScannerDiagnostics, M as ScannerFrame, z as ScannerModelDownload, L as ScannerNotice, N as ScannerPreview, ue as ScannerProvider, F as ScannerQuad, fe as ScannerStatus, I as ScannerTopBar, D as useScanner, E as useScannerRef };
989
1010
 
990
1011
  //# sourceMappingURL=react.js.map