@exige/web-scanner-sdk 0.2.24 → 0.2.26

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, g as t, h as n, j as r, o as i, s as a } from "./finder-B3kHQ2Jh.js";
3
- import { createContext as o, useCallback as s, useContext as c, useEffect as l, useMemo as u, useRef as d, useState as f } from "react";
4
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
2
+ import { A as e, C as t, I as n, S as r, g as i, h as a, o, s, x as c, y as l } from "./finder-Dcg3mVJM.js";
3
+ import { createContext as u, useCallback as d, useContext as f, useEffect as p, useMemo as ee, useRef as m, useState as h } from "react";
4
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
5
5
  //#region src/sdk/display-quad.ts
6
- function g(e) {
6
+ function y(e) {
7
7
  return [
8
8
  e.topLeft,
9
9
  e.topRight,
@@ -11,7 +11,7 @@ function g(e) {
11
11
  e.bottomLeft
12
12
  ];
13
13
  }
14
- function _(e) {
14
+ function b(e) {
15
15
  let [t, n, r, i] = e;
16
16
  return {
17
17
  topLeft: t,
@@ -38,10 +38,10 @@ function _(e) {
38
38
  }
39
39
  };
40
40
  }
41
- function v(e) {
42
- return _(g(e).map((e) => ({ ...e })));
41
+ function x(e) {
42
+ return b(y(e).map((e) => ({ ...e })));
43
43
  }
44
- var ee = class {
44
+ var te = class {
45
45
  current;
46
46
  target;
47
47
  response;
@@ -50,11 +50,11 @@ var ee = 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 || g(e).some((e, t) => {
54
- let n = g(this.current)[t];
53
+ let r = Math.max(1, Math.hypot(t, n)), i = !this.current || y(e).some((e, t) => {
54
+ let n = y(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 = v(e), i && (this.current = v(e)), {
57
+ return this.target = x(e), i && (this.current = x(e)), {
58
58
  quad: this.current,
59
59
  snapped: i
60
60
  };
@@ -62,8 +62,8 @@ var ee = 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 = _(g(this.current).map((e, n) => {
66
- let r = g(this.target)[n];
65
+ return this.current = b(y(this.current).map((e, n) => {
66
+ let r = y(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,13 +76,13 @@ var ee = class {
76
76
  getCurrent() {
77
77
  return this.current;
78
78
  }
79
- }, y = o(null);
79
+ }, ne = u(null);
80
80
  //#endregion
81
81
  //#region src/react/context.tsx
82
- function b(e) {
82
+ function re(e) {
83
83
  e?.startsWith("blob:") && URL.revokeObjectURL(e);
84
84
  }
85
- function te(e) {
85
+ function ie(e) {
86
86
  try {
87
87
  let t = e.toDataURL("image/jpeg", .92);
88
88
  return t.startsWith("data:image/") ? t : void 0;
@@ -90,272 +90,350 @@ function te(e) {
90
90
  return;
91
91
  }
92
92
  }
93
- function x({ open: n, autoCapture: o = "defaultOn", torch: c = "defaultOff", onCapture: p, onCancel: h, onError: g, onSettings: _, onFinderStatus: v, modelUrl: x, ortWasmPaths: S, detectionIntervalMs: C, apiRef: w, children: T }) {
94
- let E = d(void 0), D = d(void 0), O = d(void 0), k = d(void 0), A = d({}), j = d(new ee()), M = d(!1), N = d({
95
- onCapture: p,
96
- onCancel: h,
97
- onError: g,
98
- onSettings: _,
99
- onFinderStatus: v
100
- }), P = d(null), [F, I] = f(null), [ne, L] = f("starting"), [R, z] = f(), [re, B] = f(), [ie, ae] = f({
93
+ function S({ open: a, autoCapture: u = "defaultOn", captureMode: f = "auto", torch: g = "defaultOff", onCapture: v, onCancel: y, onError: b, onSettings: x, onFinderStatus: S, modelUrl: C, ortWasmPaths: w, detectionIntervalMs: T, apiRef: E, children: ae }) {
94
+ let D = r(f), O = m(void 0), k = m(void 0), A = m(void 0), j = m(void 0), M = m({}), N = m(new te()), P = m(!1), F = m(!1), I = m({
95
+ onCapture: v,
96
+ onCancel: y,
97
+ onError: b,
98
+ onSettings: x,
99
+ onFinderStatus: S
100
+ }), L = m(null), [R, oe] = h(null), [se, z] = h(D ? "ready" : "starting"), [B, V] = h(), [ce, H] = h(), [le, ue] = h({
101
101
  width: 1,
102
102
  height: 1
103
- }), [oe, se] = f(), [ce, V] = f(), [le, H] = f(""), [U, ue] = f(0), [de, W] = f(), [fe, G] = f(), [pe, K] = f("idle"), [me, q] = f(), J = d(void 0), [he, ge] = f({
103
+ }), [de, U] = h(), [fe, W] = h(), [pe, G] = h(""), [K, me] = h(0), [he, q] = h(), [ge, J] = h(), [_e, Y] = h("idle"), [ve, ye] = h(), X = m(void 0), [be, xe] = h({
104
104
  downloading: !1,
105
105
  loaded: 0,
106
106
  total: null
107
- }), Y = s(() => {
108
- b(J.current), J.current = void 0, q(void 0);
109
- }, []), X = s((e, t) => {
110
- let n = te(e);
111
- b(J.current), J.current = n, q(n), t?.pause();
107
+ }), Z = d(() => {
108
+ re(X.current), X.current = void 0, ye(void 0);
109
+ }, []), Q = d((e, t) => {
110
+ let n = ie(e);
111
+ re(X.current), X.current = n, ye(n), t?.pause();
112
112
  }, []);
113
- l(() => {
114
- N.current = {
115
- onCapture: p,
116
- onCancel: h,
117
- onError: g,
118
- onSettings: _,
119
- onFinderStatus: v
113
+ p(() => {
114
+ I.current = {
115
+ onCapture: v,
116
+ onCancel: y,
117
+ onError: b,
118
+ onSettings: x,
119
+ onFinderStatus: S
120
120
  };
121
121
  }, [
122
- p,
123
- h,
124
- g,
125
- _,
126
- v
127
- ]), l(() => r(ge), []);
128
- let _e = s((e) => {
129
- I(e);
122
+ v,
123
+ y,
124
+ b,
125
+ x,
126
+ S
127
+ ]), p(() => n(xe), []);
128
+ let Se = d((e) => {
129
+ oe(e);
130
130
  }, []);
131
- l(() => {
132
- if (!n || !F) return;
131
+ p(() => {
132
+ if (!a || !R) return;
133
133
  let e = () => {
134
- let e = F.getBoundingClientRect();
135
- ae({
134
+ let e = R.getBoundingClientRect();
135
+ ue({
136
136
  width: e.width,
137
137
  height: e.height
138
138
  });
139
139
  };
140
140
  if (e(), typeof ResizeObserver > "u") return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
141
141
  let t = new ResizeObserver(e);
142
- return t.observe(F), () => t.disconnect();
143
- }, [n, F]), l(() => {
144
- if (!n) return;
142
+ return t.observe(R), () => t.disconnect();
143
+ }, [a, R]), p(() => {
144
+ if (!a) return;
145
145
  let e = window.setInterval(() => {
146
- let e = E.current?.getDiagnostics();
147
- e && W(e);
146
+ let e = O.current?.getDiagnostics();
147
+ e && q(e);
148
148
  }, 500);
149
149
  return () => window.clearInterval(e);
150
- }, [n, U]), l(() => {
151
- if (!n) return;
152
- let e = 0, t = performance.now(), r = (n) => {
153
- let i = j.current.step(n - t);
154
- t = n, i && B(i), e = requestAnimationFrame(r);
150
+ }, [a, K]), p(() => {
151
+ if (!a) return;
152
+ let e = 0, t = performance.now(), n = (r) => {
153
+ let i = N.current.step(r - t);
154
+ t = r, i && H(i), e = requestAnimationFrame(n);
155
155
  };
156
- return e = requestAnimationFrame(r), () => cancelAnimationFrame(e);
157
- }, [n]), l(() => {
158
- if (!n || !F) return;
159
- let t = !1, r = () => {
160
- D.current?.stop(), D.current = void 0, E.current?.stop(), E.current = void 0, k.current = void 0, O.current = void 0, A.current = {}, Y();
156
+ return e = requestAnimationFrame(n), () => cancelAnimationFrame(e);
157
+ }, [a]), p(() => {
158
+ if (!a || D || !R) return;
159
+ let e = !1, n = () => {
160
+ k.current?.stop(), k.current = void 0, O.current?.stop(), O.current = void 0, j.current = void 0, A.current = void 0, M.current = {}, Z();
161
161
  };
162
162
  return (async () => {
163
- r(), M.current = !1, L("starting"), H(""), z(void 0), V(void 0), G(void 0), K("idle"), Y();
163
+ n(), P.current = !1, z("starting"), G(""), V(void 0), W(void 0), J(void 0), Y("idle"), Z();
164
164
  try {
165
- let n = await e(F, { torch: c });
166
- if (t) {
165
+ let n = await t(R, { torch: g });
166
+ if (e) {
167
167
  n.stop();
168
168
  return;
169
169
  }
170
- E.current = n;
170
+ O.current = n;
171
171
  let r = n.getSettings();
172
- se(r), N.current.onSettings?.(r), console.info("[ScannerProvider] camera settings", r), D.current = await a({
173
- source: F,
174
- autoCapture: o,
175
- intervalMs: C,
172
+ U(r), I.current.onSettings?.(r), console.info("[ScannerProvider] camera settings", r), k.current = await s({
173
+ source: R,
174
+ autoCapture: u,
175
+ intervalMs: T,
176
176
  detection: {
177
- modelUrl: x,
178
- ortWasmPaths: S
177
+ modelUrl: C,
178
+ ortWasmPaths: w
179
179
  },
180
180
  onStatus: (e) => {
181
- if (O.current = e, z(e), N.current.onFinderStatus?.(e), e.quad && e.sourceWidth && e.sourceHeight) {
182
- let t = j.current.setTarget(e.quad, e.sourceWidth, e.sourceHeight);
183
- B(t.quad);
184
- } else j.current.clear(), B(void 0);
185
- e.state !== "captured" && !M.current && L("ready");
181
+ if (A.current = e, V(e), I.current.onFinderStatus?.(e), e.quad && e.sourceWidth && e.sourceHeight) {
182
+ let t = N.current.setTarget(e.quad, e.sourceWidth, e.sourceHeight);
183
+ H(t.quad);
184
+ } else N.current.clear(), H(void 0);
185
+ e.state !== "captured" && !P.current && z("ready");
186
186
  },
187
187
  captureFrame: async () => {
188
- L("capturing"), A.current = {
189
- quad: j.current.getCurrent(),
190
- sourceWidth: O.current?.sourceWidth,
191
- sourceHeight: O.current?.sourceHeight
188
+ z("capturing"), M.current = {
189
+ quad: N.current.getCurrent(),
190
+ sourceWidth: A.current?.sourceWidth,
191
+ sourceHeight: A.current?.sourceHeight
192
192
  };
193
193
  let e = await n.capturePhoto();
194
- if (k.current = e, V(e.method), G(e.diagnostics), W(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.`);
195
- return X(e.frame, F), L("captured"), e.frame;
194
+ if (j.current = e, W(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.`);
195
+ return Q(e.frame, R), z("captured"), e.frame;
196
196
  },
197
197
  onCaptureError: (e) => {
198
- M.current = !0, L("error"), H(e.message);
199
- let t = E.current?.getDiagnostics();
200
- t && W(t), N.current.onError?.(e);
198
+ P.current = !0, z("error"), G(e.message);
199
+ let t = O.current?.getDiagnostics();
200
+ t && q(t), I.current.onError?.(e);
201
201
  },
202
202
  onCapture: async (e) => {
203
- let t = k.current;
204
- await new Promise((e) => window.setTimeout(e, 140)), await N.current.onCapture({
203
+ let t = j.current;
204
+ await new Promise((e) => window.setTimeout(e, 140)), await I.current.onCapture({
205
205
  ...e,
206
206
  method: t?.method ?? "video-frame",
207
207
  settings: t?.settings ?? n.getSettings(),
208
208
  fallbackReason: t?.fallbackReason,
209
209
  luminance: t?.luminance,
210
210
  diagnostics: t?.diagnostics,
211
- displayedQuad: A.current.quad,
212
- displaySourceWidth: A.current.sourceWidth,
213
- displaySourceHeight: A.current.sourceHeight
211
+ displayedQuad: M.current.quad,
212
+ displaySourceWidth: M.current.sourceWidth,
213
+ displaySourceHeight: M.current.sourceHeight
214
214
  });
215
215
  }
216
216
  });
217
- } catch (e) {
218
- if (t) return;
219
- r();
220
- let n = e instanceof Error ? e : /* @__PURE__ */ Error("Camera access failed.");
221
- H(n.message), L("error"), N.current.onError?.(n);
217
+ } catch (t) {
218
+ if (e) return;
219
+ n();
220
+ let r = t instanceof Error ? t : /* @__PURE__ */ Error("Camera access failed.");
221
+ G(r.message), z("error"), I.current.onError?.(r);
222
222
  }
223
223
  })(), () => {
224
- t = !0, r();
224
+ e = !0, n();
225
225
  };
226
226
  }, [
227
- n,
228
- F,
229
- o,
230
- c,
231
- x,
232
- S,
227
+ a,
228
+ R,
229
+ D,
230
+ u,
231
+ g,
233
232
  C,
234
- U,
235
- Y,
236
- X
233
+ w,
234
+ T,
235
+ K,
236
+ Z,
237
+ Q
238
+ ]), p(() => {
239
+ a && D && (P.current = !1, F.current = !1, z("ready"), G(""), V(void 0), W(void 0), J(void 0), Y("idle"), U(void 0), H(void 0), N.current.clear(), Z());
240
+ }, [
241
+ a,
242
+ D,
243
+ K,
244
+ Z
237
245
  ]);
238
- let Z = {
239
- open: n,
240
- phase: ne,
241
- autoCapture: o,
242
- finderStatus: R,
243
- displayQuad: re,
244
- previewSize: ie,
245
- settings: oe,
246
- captureMethod: ce,
247
- error: le,
248
- diagnostics: de,
249
- shutterDiagnostics: fe,
250
- copyState: pe,
251
- guidanceHint: R ? i(R.guidance, R.lighting) : void 0,
252
- detectorStatus: R?.modelStatus === "failed" ? `ML failed${R.modelError ? `: ${R.modelError}` : ""}` : R?.detector === "ml" ? `ML ${R.modelProvider ?? ""}`.trim() : "ML loading",
253
- modelDownload: he,
254
- frozenPreviewUrl: me
246
+ let Ce = {
247
+ open: a,
248
+ phase: se,
249
+ autoCapture: u,
250
+ captureMode: f,
251
+ usingSystemCamera: D,
252
+ finderStatus: B,
253
+ displayQuad: ce,
254
+ previewSize: le,
255
+ settings: de,
256
+ captureMethod: fe,
257
+ error: pe,
258
+ diagnostics: he,
259
+ shutterDiagnostics: ge,
260
+ copyState: _e,
261
+ guidanceHint: B ? o(B.guidance, B.lighting) : void 0,
262
+ detectorStatus: B?.modelStatus === "failed" ? `ML failed${B.modelError ? `: ${B.modelError}` : ""}` : B?.detector === "ml" ? `ML ${B.modelProvider ?? ""}`.trim() : "ML loading",
263
+ modelDownload: be,
264
+ frozenPreviewUrl: ve
255
265
  };
256
- l(() => {
257
- P.current = Z;
266
+ p(() => {
267
+ L.current = Ce;
258
268
  });
259
- let ve = s(() => {
260
- N.current.onCancel();
261
- }, []), ye = s(async () => {
269
+ let we = d(() => {
270
+ I.current.onCancel();
271
+ }, []), $ = d(async () => {
272
+ if (!F.current) {
273
+ F.current = !0, P.current = !1, G(""), H(void 0), N.current.clear(), z("capturing");
274
+ try {
275
+ let t = await c();
276
+ Q(t);
277
+ let n = {
278
+ width: t.width,
279
+ height: t.height
280
+ };
281
+ U(n), I.current.onSettings?.(n), W("system-camera");
282
+ let r;
283
+ try {
284
+ let e = t.getContext("2d", { willReadFrequently: !0 })?.getImageData(0, 0, t.width, t.height).data;
285
+ e && (r = l(e));
286
+ } catch {
287
+ r = void 0;
288
+ }
289
+ let i = await e(t, {
290
+ modelUrl: C,
291
+ ortWasmPaths: w
292
+ });
293
+ if (i.status !== "success" || !i.corners || !i.quad) {
294
+ P.current = !0, z("error"), G(i.message), I.current.onError?.(Error(i.message));
295
+ return;
296
+ }
297
+ M.current = {
298
+ quad: i.quad,
299
+ sourceWidth: i.sourceWidth,
300
+ sourceHeight: i.sourceHeight
301
+ }, H(i.quad), z("captured"), await I.current.onCapture({
302
+ frame: t,
303
+ detection: i,
304
+ reason: "manual",
305
+ method: "system-camera",
306
+ settings: n,
307
+ luminance: r,
308
+ displayedQuad: i.quad,
309
+ displaySourceWidth: i.sourceWidth,
310
+ displaySourceHeight: i.sourceHeight
311
+ });
312
+ } catch (e) {
313
+ let t = e instanceof Error ? e : /* @__PURE__ */ Error("Could not take a photo.");
314
+ if (t.message === "No photo was selected.") {
315
+ z("ready");
316
+ return;
317
+ }
318
+ P.current = !0, G(t.message), z("error"), I.current.onError?.(t);
319
+ } finally {
320
+ F.current = !1;
321
+ }
322
+ }
323
+ }, [
324
+ Q,
325
+ C,
326
+ w
327
+ ]), Te = d(async () => {
328
+ if (D) {
329
+ await $();
330
+ return;
331
+ }
262
332
  try {
263
- await D.current?.capture();
333
+ await k.current?.capture();
264
334
  } catch (e) {
265
335
  let t = e instanceof Error ? e : /* @__PURE__ */ Error("Could not capture the camera frame.");
266
- M.current = !0, H(t.message);
267
- let n = E.current?.getDiagnostics();
268
- n && W(n), k.current?.diagnostics && G(k.current.diagnostics), L("error"), N.current.onError?.(t);
336
+ P.current = !0, G(t.message);
337
+ let n = O.current?.getDiagnostics();
338
+ n && q(n), j.current?.diagnostics && J(j.current.diagnostics), z("error"), I.current.onError?.(t);
269
339
  }
270
- }, []), be = s(() => {
271
- M.current = !1, H(""), G(void 0), K("idle"), Y();
272
- let e = E.current;
273
- F?.paused && F.play(), L(e ? "ready" : "starting"), e || ue((e) => e + 1);
274
- }, [Y, F]), xe = s(async (e) => {
275
- let t = E.current;
276
- t && (await t.setTorch(e), W(t.getDiagnostics()));
277
- }, []), Se = s((e) => {
278
- D.current?.setAutoCapture(e);
279
- }, []), Ce = s(async () => {
280
- let e = P.current, n = E.current?.getDiagnostics() ?? e.diagnostics, r = e.finderStatus, i = t({
340
+ }, [$, D]), Ee = d(() => {
341
+ if (P.current = !1, G(""), J(void 0), Y("idle"), Z(), H(void 0), N.current.clear(), D) {
342
+ z("ready"), $();
343
+ return;
344
+ }
345
+ let e = O.current;
346
+ R?.paused && R.play(), z(e ? "ready" : "starting"), e || me((e) => e + 1);
347
+ }, [
348
+ $,
349
+ Z,
350
+ R,
351
+ D
352
+ ]), De = d(async (e) => {
353
+ let t = O.current;
354
+ t && (await t.setTorch(e), q(t.getDiagnostics()));
355
+ }, []), Oe = d((e) => {
356
+ k.current?.setAutoCapture(e);
357
+ }, []), ke = d(async () => {
358
+ let e = L.current, t = O.current?.getDiagnostics() ?? e.diagnostics, n = e.finderStatus, r = i({
281
359
  error: e.error || void 0,
282
360
  captureMethod: e.captureMethod,
283
- luminance: k.current?.luminance,
284
- fallbackReason: k.current?.fallbackReason,
285
- shutter: e.shutterDiagnostics ?? k.current?.diagnostics,
286
- live: n,
287
- finder: r ? {
288
- state: r.state,
289
- confidence: r.confidence,
290
- stableFrames: r.stableFrames,
291
- requiredStableFrames: r.requiredStableFrames,
292
- detector: r.detector,
293
- modelStatus: r.modelStatus,
294
- modelError: r.modelError,
295
- modelProvider: r.modelProvider,
296
- modelNote: r.modelNote,
297
- inferenceMs: r.inferenceMs,
298
- sourceWidth: r.sourceWidth,
299
- sourceHeight: r.sourceHeight
361
+ luminance: j.current?.luminance,
362
+ fallbackReason: j.current?.fallbackReason,
363
+ shutter: e.shutterDiagnostics ?? j.current?.diagnostics,
364
+ live: t,
365
+ finder: n ? {
366
+ state: n.state,
367
+ confidence: n.confidence,
368
+ stableFrames: n.stableFrames,
369
+ requiredStableFrames: n.requiredStableFrames,
370
+ detector: n.detector,
371
+ modelStatus: n.modelStatus,
372
+ modelError: n.modelError,
373
+ modelProvider: n.modelProvider,
374
+ modelNote: n.modelNote,
375
+ inferenceMs: n.inferenceMs,
376
+ sourceWidth: n.sourceWidth,
377
+ sourceHeight: n.sourceHeight
300
378
  } : void 0
301
379
  });
302
380
  try {
303
- if (navigator.clipboard?.writeText) await navigator.clipboard.writeText(i);
381
+ if (navigator.clipboard?.writeText) await navigator.clipboard.writeText(r);
304
382
  else {
305
383
  let e = document.createElement("textarea");
306
- e.value = i, e.setAttribute("readonly", ""), e.style.position = "fixed", e.style.left = "-9999px", document.body.append(e), e.select();
384
+ e.value = r, e.setAttribute("readonly", ""), e.style.position = "fixed", e.style.left = "-9999px", document.body.append(e), e.select();
307
385
  let t = document.execCommand("copy");
308
386
  if (e.remove(), !t) throw Error("Clipboard copy is unavailable.");
309
387
  }
310
- K("copied");
388
+ Y("copied");
311
389
  } catch {
312
- K("failed");
390
+ Y("failed");
313
391
  }
314
- }, []), Q = s(() => P.current, []), $ = u(() => ({
315
- capture: ye,
316
- cancel: ve,
317
- retry: be,
318
- setTorch: xe,
319
- setAutoCapture: Se,
320
- copyReport: Ce,
321
- getState: Q
392
+ }, []), Ae = d(() => L.current, []), je = ee(() => ({
393
+ capture: Te,
394
+ cancel: we,
395
+ retry: Ee,
396
+ setTorch: De,
397
+ setAutoCapture: Oe,
398
+ copyReport: ke,
399
+ getState: Ae
322
400
  }), [
323
- ye,
324
- ve,
325
- be,
326
- xe,
327
- Se,
328
- Ce,
329
- Q
401
+ Te,
402
+ we,
403
+ Ee,
404
+ De,
405
+ Oe,
406
+ ke,
407
+ Ae
330
408
  ]);
331
- l(() => {
332
- if (w) return w.current = $, () => {
333
- w.current = null;
409
+ p(() => {
410
+ if (E) return E.current = je, () => {
411
+ E.current = null;
334
412
  };
335
- }, [$, w]);
336
- let we = {
337
- ...Z,
338
- ...$,
339
- bindPreview: _e
413
+ }, [je, E]);
414
+ let Me = {
415
+ ...Ce,
416
+ ...je,
417
+ bindPreview: Se
340
418
  };
341
- return /* @__PURE__ */ m(y.Provider, {
342
- value: we,
343
- children: T
419
+ return /* @__PURE__ */ _(ne.Provider, {
420
+ value: Me,
421
+ children: ae
344
422
  });
345
423
  }
346
424
  //#endregion
347
425
  //#region src/react/hooks.ts
348
- function S() {
349
- return d(null);
350
- }
351
426
  function C() {
352
- let e = c(y);
427
+ return m(null);
428
+ }
429
+ function w() {
430
+ let e = f(ne);
353
431
  if (!e) throw Error("useScanner must be used within ScannerProvider.");
354
432
  return e;
355
433
  }
356
434
  //#endregion
357
435
  //#region src/live-overlay-geometry.ts
358
- function w(e, t, n, r, i) {
436
+ function T(e, t, n, r, i) {
359
437
  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;
360
438
  if (i === "contain") return {
361
439
  viewBox: `0 0 ${a} ${o}`,
@@ -364,9 +442,9 @@ function w(e, t, n, r, i) {
364
442
  offsetX: f,
365
443
  offsetY: p
366
444
  };
367
- let m = s / d, h = c / d;
445
+ let ee = s / d, m = c / d;
368
446
  return {
369
- viewBox: `${-f / d} ${-p / d} ${m} ${h}`,
447
+ viewBox: `${-f / d} ${-p / d} ${ee} ${m}`,
370
448
  preserveAspectRatio: "none",
371
449
  scale: d,
372
450
  offsetX: f,
@@ -375,10 +453,10 @@ function w(e, t, n, r, i) {
375
453
  }
376
454
  //#endregion
377
455
  //#region src/components/ModelDownloadRing.tsx
378
- function T({ snapshot: e }) {
456
+ function E({ snapshot: e }) {
379
457
  if (!e.downloading) return null;
380
458
  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;
381
- return /* @__PURE__ */ h("div", {
459
+ return /* @__PURE__ */ v("div", {
382
460
  className: `model-download-ring${t === null ? " is-indeterminate" : ""}`,
383
461
  role: "progressbar",
384
462
  "aria-label": "Model download",
@@ -387,15 +465,15 @@ function T({ snapshot: e }) {
387
465
  "aria-valuenow": n ?? void 0,
388
466
  "data-loaded": e.loaded,
389
467
  "data-total": e.total ?? "",
390
- children: [/* @__PURE__ */ h("svg", {
468
+ children: [/* @__PURE__ */ v("svg", {
391
469
  viewBox: "0 0 72 72",
392
470
  "aria-hidden": "true",
393
- children: [/* @__PURE__ */ m("circle", {
471
+ children: [/* @__PURE__ */ _("circle", {
394
472
  className: "track",
395
473
  cx: "36",
396
474
  cy: "36",
397
475
  r: 28
398
- }), /* @__PURE__ */ m("circle", {
476
+ }), /* @__PURE__ */ _("circle", {
399
477
  className: "value",
400
478
  cx: "36",
401
479
  cy: "36",
@@ -403,15 +481,15 @@ function T({ snapshot: e }) {
403
481
  strokeDasharray: t === null ? void 0 : `${r} ${r}`,
404
482
  strokeDashoffset: t === null ? void 0 : r * (1 - t)
405
483
  })]
406
- }), n === null ? /* @__PURE__ */ m("strong", {
484
+ }), n === null ? /* @__PURE__ */ _("strong", {
407
485
  className: "model-download-ring__pending",
408
486
  children: "…"
409
- }) : /* @__PURE__ */ h("strong", { children: [n, "%"] })]
487
+ }) : /* @__PURE__ */ v("strong", { children: [n, "%"] })]
410
488
  });
411
489
  }
412
490
  //#endregion
413
491
  //#region src/react/parts.tsx
414
- var E = {
492
+ var ae = {
415
493
  primaryColorHex: "--scanner-overlay-primary",
416
494
  seekingColorHex: "--scanner-overlay-seeking",
417
495
  detectingColorHex: "--scanner-overlay-detecting",
@@ -422,36 +500,44 @@ var E = {
422
500
  function D(e) {
423
501
  if (!e) return;
424
502
  let t = {};
425
- for (let [n, r] of Object.entries(E)) {
503
+ for (let [n, r] of Object.entries(ae)) {
426
504
  let i = e[n]?.trim();
427
505
  i && (t[r] = i);
428
506
  }
429
507
  return Object.keys(t).length > 0 ? t : void 0;
430
508
  }
431
509
  function O({ theme: e, style: t, title: n = "Scan a document", children: r }) {
432
- let i = C();
510
+ let i = w();
433
511
  if (!i.open) return null;
434
512
  let a = D(e), o = a ? {
435
513
  ...t,
436
514
  ...a
437
515
  } : t;
438
- return /* @__PURE__ */ h("div", {
439
- className: `scanner-camera-overlay ${i.finderStatus?.state === "captured" ? "is-captured" : ""}`.trim(),
516
+ return /* @__PURE__ */ v("div", {
517
+ className: `scanner-camera-overlay ${i.phase === "captured" || i.finderStatus?.state === "captured" ? "is-captured" : ""} ${i.usingSystemCamera ? "is-system-camera" : ""}`.trim(),
440
518
  style: o,
441
519
  role: "dialog",
442
520
  "aria-modal": "true",
443
521
  "aria-label": n,
444
- children: [r, /* @__PURE__ */ m(I, {})]
522
+ children: [r, /* @__PURE__ */ _(I, {})]
445
523
  });
446
524
  }
447
525
  function k() {
448
- let { bindPreview: e, frozenPreviewUrl: t } = C(), n = d(null), r = s((t) => {
449
- n.current = t, e(t);
526
+ let { bindPreview: e, frozenPreviewUrl: t, usingSystemCamera: n } = w(), r = m(null), i = d((t) => {
527
+ r.current = t, e(t);
450
528
  }, [e]);
451
- return l(() => {
452
- t && n.current?.pause();
453
- }, [t]), /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("video", {
454
- ref: r,
529
+ return p(() => {
530
+ t && r.current?.pause();
531
+ }, [t]), n ? t ? /* @__PURE__ */ _("img", {
532
+ src: t,
533
+ className: "scanner-camera-overlay__video scanner-camera-overlay__still",
534
+ alt: "",
535
+ "aria-label": "Captured document"
536
+ }) : /* @__PURE__ */ _("div", {
537
+ className: "scanner-camera-overlay__video",
538
+ "aria-hidden": "true"
539
+ }) : /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("video", {
540
+ ref: i,
455
541
  className: "scanner-camera-overlay__video",
456
542
  muted: !0,
457
543
  autoPlay: !0,
@@ -459,7 +545,7 @@ function k() {
459
545
  style: { objectFit: "cover" },
460
546
  "aria-hidden": !!t,
461
547
  "aria-label": "Rear camera preview"
462
- }), t ? /* @__PURE__ */ m("img", {
548
+ }), t ? /* @__PURE__ */ _("img", {
463
549
  src: t,
464
550
  className: "scanner-camera-overlay__video scanner-camera-overlay__still",
465
551
  alt: "",
@@ -467,31 +553,37 @@ function k() {
467
553
  }) : null] });
468
554
  }
469
555
  function A() {
470
- let { finderStatus: e, displayQuad: t, previewSize: n } = C();
556
+ let { finderStatus: e, displayQuad: t, previewSize: n } = w();
471
557
  if (!t || !e?.sourceWidth || !e.sourceHeight) return null;
472
- let r = w(e.sourceWidth, e.sourceHeight, n.width, n.height, "cover");
473
- return /* @__PURE__ */ m("svg", {
558
+ let r = T(e.sourceWidth, e.sourceHeight, n.width, n.height, "cover");
559
+ return /* @__PURE__ */ _("svg", {
474
560
  className: `scanner-camera-overlay__quad ${e.state}`,
475
561
  viewBox: r.viewBox,
476
562
  preserveAspectRatio: r.preserveAspectRatio,
477
563
  "aria-label": `${e.state} document boundary`,
478
- children: /* @__PURE__ */ m("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}` })
564
+ children: /* @__PURE__ */ _("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}` })
479
565
  });
480
566
  }
481
567
  function j({ title: e = "Scan a document" }) {
482
- let { phase: t, guidanceHint: n, cancel: r } = C();
483
- return /* @__PURE__ */ h("div", {
568
+ let { phase: t, guidanceHint: n, cancel: r, usingSystemCamera: i } = w();
569
+ return /* @__PURE__ */ v("div", {
484
570
  className: "scanner-camera-overlay__topbar",
485
- children: [/* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("strong", { children: e }), /* @__PURE__ */ h("span", {
571
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("strong", { children: e }), /* @__PURE__ */ _("span", {
486
572
  "aria-live": "polite",
487
- children: [
573
+ children: i ? /* @__PURE__ */ v(g, { children: [
574
+ t === "starting" && "Preparing the system camera…",
575
+ t === "ready" && "Take a photo. There is no live document guide.",
576
+ t === "capturing" && "Looking for a document…",
577
+ t === "captured" && "Document captured",
578
+ t === "error" && "No document found"
579
+ ] }) : /* @__PURE__ */ v(g, { children: [
488
580
  t === "starting" && "Starting rear camera…",
489
581
  t === "ready" && (n ?? "Place the document in the frame"),
490
582
  t === "capturing" && "Capturing full resolution…",
491
583
  t === "captured" && "Document captured",
492
584
  t === "error" && "Camera unavailable"
493
- ]
494
- })] }), /* @__PURE__ */ m("button", {
585
+ ] })
586
+ })] }), /* @__PURE__ */ _("button", {
495
587
  type: "button",
496
588
  onClick: r,
497
589
  "aria-label": "Close camera",
@@ -500,115 +592,130 @@ function j({ title: e = "Scan a document" }) {
500
592
  });
501
593
  }
502
594
  function M() {
503
- let { phase: e, error: t, diagnostics: n, copyState: r, retry: i, copyReport: a, cancel: o } = C();
504
- return e === "error" ? /* @__PURE__ */ h("div", {
595
+ let { phase: e, error: t, diagnostics: n, copyState: r, retry: i, copyReport: a, cancel: o, usingSystemCamera: s, frozenPreviewUrl: c } = w();
596
+ return e === "error" ? /* @__PURE__ */ v("div", {
505
597
  className: "scanner-camera-overlay__message",
506
598
  role: "alert",
507
599
  children: [
508
- /* @__PURE__ */ m("strong", { children: n ? "Capture failed" : "Could not open the camera" }),
509
- /* @__PURE__ */ m("p", { children: t }),
510
- /* @__PURE__ */ h("div", { children: [
511
- /* @__PURE__ */ m("button", {
600
+ /* @__PURE__ */ _("strong", { children: s ? c ? "No document found" : "Could not take a photo" : n ? "Capture failed" : "Could not open the camera" }),
601
+ /* @__PURE__ */ _("p", { children: t }),
602
+ /* @__PURE__ */ v("div", { children: [
603
+ /* @__PURE__ */ _("button", {
512
604
  type: "button",
513
605
  onClick: i,
514
606
  children: "Try again"
515
607
  }),
516
- /* @__PURE__ */ m("button", {
608
+ /* @__PURE__ */ _("button", {
517
609
  type: "button",
518
610
  onClick: () => void a(),
519
611
  children: r === "copied" ? "Copied" : r === "failed" ? "Copy failed" : "Copy report"
520
612
  }),
521
- /* @__PURE__ */ m("button", {
613
+ /* @__PURE__ */ _("button", {
522
614
  type: "button",
523
615
  onClick: o,
524
616
  children: "Cancel"
525
617
  })
526
618
  ] })
527
619
  ]
528
- }) : e === "starting" ? /* @__PURE__ */ h("div", {
620
+ }) : s && e === "ready" && !c ? /* @__PURE__ */ v("div", {
621
+ className: "scanner-camera-overlay__message",
622
+ "aria-live": "polite",
623
+ children: [/* @__PURE__ */ _("strong", { children: "System camera" }), /* @__PURE__ */ _("p", { children: "Chrome cannot match Camera-app quality in a live preview. Take a photo, then we find the page in that JPEG. There is no live document guide." })]
624
+ }) : e === "starting" && !s ? /* @__PURE__ */ v("div", {
529
625
  className: "scanner-camera-overlay__message",
530
626
  "aria-live": "polite",
531
627
  children: [
532
- /* @__PURE__ */ m("span", { className: "scanner-camera-overlay__spinner" }),
533
- /* @__PURE__ */ m("strong", { children: "Requesting the highest practical resolution" }),
534
- /* @__PURE__ */ m("p", { children: "Allow camera access to continue." })
628
+ /* @__PURE__ */ _("span", { className: "scanner-camera-overlay__spinner" }),
629
+ /* @__PURE__ */ _("strong", { children: "Requesting the highest practical resolution" }),
630
+ /* @__PURE__ */ _("p", { children: "Allow camera access to continue." })
535
631
  ]
536
632
  }) : null;
537
633
  }
538
634
  function N() {
539
- let { finderStatus: e, detectorStatus: t, settings: n } = C(), r = n?.width, i = n?.height;
540
- return /* @__PURE__ */ m("div", {
635
+ let { finderStatus: e, detectorStatus: t, settings: n, usingSystemCamera: r, captureMethod: i, phase: a } = w(), o = n?.width, s = n?.height;
636
+ return r ? /* @__PURE__ */ _("div", {
637
+ className: "scanner-camera-overlay__status",
638
+ "aria-live": "polite",
639
+ children: /* @__PURE__ */ v("div", {
640
+ className: "scanner-camera-overlay__status-line",
641
+ children: [
642
+ /* @__PURE__ */ _("span", { className: a === "captured" ? "ready" : a === "error" ? "seeking" : "detecting" }),
643
+ i === "system-camera" ? "system camera" : "system camera · waiting",
644
+ o && s ? ` · ${o}×${s}` : ""
645
+ ]
646
+ })
647
+ }) : /* @__PURE__ */ _("div", {
541
648
  className: "scanner-camera-overlay__status",
542
649
  "aria-live": "polite",
543
- children: /* @__PURE__ */ h("div", {
650
+ children: /* @__PURE__ */ v("div", {
544
651
  className: "scanner-camera-overlay__status-line",
545
652
  children: [
546
- /* @__PURE__ */ m("span", { className: e?.state ?? "detecting" }),
653
+ /* @__PURE__ */ _("span", { className: e?.state ?? "detecting" }),
547
654
  e?.state ?? "detecting",
548
655
  e ? ` · ${Math.round(e.confidence * 100)}% · ${e.stableFrames}/${e.requiredStableFrames}` : "",
549
656
  ` · ${t}`,
550
657
  e?.inferenceMs === void 0 ? "" : ` · ${Math.round(e.inferenceMs)}ms`,
551
- r && i ? ` · ${r}×${i}` : ""
658
+ o && s ? ` · ${o}×${s}` : ""
552
659
  ]
553
660
  })
554
661
  });
555
662
  }
556
663
  function P() {
557
- let { diagnostics: e, shutterDiagnostics: t, captureMethod: r, copyState: i, copyReport: a } = C(), o = e?.engine ?? n();
558
- return /* @__PURE__ */ h("dl", {
664
+ let { diagnostics: e, shutterDiagnostics: t, captureMethod: n, copyState: r, copyReport: i } = w(), o = e?.engine ?? a();
665
+ return /* @__PURE__ */ v("dl", {
559
666
  className: "scanner-camera-overlay__diagnostics",
560
667
  "aria-label": "Camera diagnostics",
561
668
  children: [
562
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", { children: "engine" }), /* @__PURE__ */ h("dd", { children: [
669
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("dt", { children: "engine" }), /* @__PURE__ */ v("dd", { children: [
563
670
  o.engine,
564
671
  "/",
565
672
  o.browser,
566
673
  o.iosWebKit ? " ios" : ""
567
674
  ] })] }),
568
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", { children: "video" }), /* @__PURE__ */ m("dd", { children: e ? `${e.videoWidth}×${e.videoHeight} rs${e.readyState}${e.paused ? " paused" : ""}${e.rendered ? "" : " hidden"}` : "starting" })] }),
569
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", { children: "track" }), /* @__PURE__ */ m("dd", { children: e ? `${e.trackReadyState}${e.trackMuted ? " muted" : ""}${e.trackEnabled ? "" : " disabled"}` : "—" })] }),
570
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", { children: "torch" }), /* @__PURE__ */ m("dd", { children: e ? `${e.torch.mode} · ${e.torch.supported ? e.torch.on ? "on" : "off" : "unsupported"}` : "starting" })] }),
571
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", { children: "luma" }), /* @__PURE__ */ m("dd", { children: e ? `live ${e.liveLuminance.toFixed(1)} · mirror ${e.mirrorLuminance.toFixed(1)}${Number.isFinite(e.mirrorAgeMs) ? ` (${Math.round(e.mirrorAgeMs)}ms)` : " (none)"}` : "—" })] }),
572
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", { children: "path" }), /* @__PURE__ */ m("dd", { children: r ?? "video-frame / live-mirror" })] }),
573
- t ? /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", { children: "shutter" }), /* @__PURE__ */ m("dd", { children: `live ${t.liveLuminance.toFixed(1)} · mirror ${t.mirrorLuminance.toFixed(1)}${Number.isFinite(t.mirrorAgeMs) ? ` (${Math.round(t.mirrorAgeMs)}ms)` : " (none)"}` })] }) : null,
574
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("dt", { children: "share" }), /* @__PURE__ */ m("dd", { children: /* @__PURE__ */ m("button", {
675
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("dt", { children: "video" }), /* @__PURE__ */ _("dd", { children: e ? `${e.videoWidth}×${e.videoHeight} rs${e.readyState}${e.paused ? " paused" : ""}${e.rendered ? "" : " hidden"}` : "starting" })] }),
676
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("dt", { children: "track" }), /* @__PURE__ */ _("dd", { children: e ? `${e.trackReadyState}${e.trackMuted ? " muted" : ""}${e.trackEnabled ? "" : " disabled"}` : "—" })] }),
677
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("dt", { children: "torch" }), /* @__PURE__ */ _("dd", { children: e ? `${e.torch.mode} · ${e.torch.supported ? e.torch.on ? "on" : "off" : "unsupported"}` : "starting" })] }),
678
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("dt", { children: "luma" }), /* @__PURE__ */ _("dd", { children: e ? `live ${e.liveLuminance.toFixed(1)} · mirror ${e.mirrorLuminance.toFixed(1)}${Number.isFinite(e.mirrorAgeMs) ? ` (${Math.round(e.mirrorAgeMs)}ms)` : " (none)"}` : "—" })] }),
679
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("dt", { children: "path" }), /* @__PURE__ */ _("dd", { children: n ?? "video-frame / live-mirror" })] }),
680
+ t ? /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("dt", { children: "shutter" }), /* @__PURE__ */ _("dd", { children: `live ${t.liveLuminance.toFixed(1)} · mirror ${t.mirrorLuminance.toFixed(1)}${Number.isFinite(t.mirrorAgeMs) ? ` (${Math.round(t.mirrorAgeMs)}ms)` : " (none)"}` })] }) : null,
681
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("dt", { children: "share" }), /* @__PURE__ */ _("dd", { children: /* @__PURE__ */ _("button", {
575
682
  type: "button",
576
683
  className: "scanner-camera-overlay__copy",
577
- onClick: () => void a(),
578
- children: i === "copied" ? "Copied report" : i === "failed" ? "Copy failed" : "Copy report"
684
+ onClick: () => void i(),
685
+ children: r === "copied" ? "Copied report" : r === "failed" ? "Copy failed" : "Copy report"
579
686
  }) })] })
580
687
  ]
581
688
  });
582
689
  }
583
690
  function F() {
584
- let { autoCapture: e, phase: t, finderStatus: n, diagnostics: r, captureMethod: i, settings: a, cancel: o, capture: s, setAutoCapture: c, setTorch: l } = C(), u = a?.width, d = a?.height;
585
- return /* @__PURE__ */ h("div", {
691
+ let { autoCapture: e, phase: t, finderStatus: n, diagnostics: r, captureMethod: i, settings: a, cancel: o, capture: s, setAutoCapture: c, setTorch: l, usingSystemCamera: u } = w(), d = a?.width, f = a?.height;
692
+ return /* @__PURE__ */ v("div", {
586
693
  className: "scanner-camera-overlay__controls",
587
694
  children: [
588
- /* @__PURE__ */ m("button", {
695
+ /* @__PURE__ */ _("button", {
589
696
  type: "button",
590
697
  className: "scanner-camera-overlay__cancel",
591
698
  onClick: o,
592
699
  children: "Cancel"
593
700
  }),
594
- /* @__PURE__ */ h("div", {
701
+ /* @__PURE__ */ v("div", {
595
702
  className: "scanner-camera-overlay__capture",
596
- children: [e !== "only" && /* @__PURE__ */ m("button", {
703
+ children: [(u || e !== "only") && /* @__PURE__ */ _("button", {
597
704
  type: "button",
598
705
  className: "scanner-camera-overlay__shutter",
599
706
  onClick: () => void s(),
600
707
  disabled: t !== "ready",
601
- "aria-label": "Capture full-resolution photo",
602
- children: /* @__PURE__ */ m("span", {})
603
- }), /* @__PURE__ */ h("div", {
708
+ "aria-label": u ? "Take a photo with the system camera" : "Capture full-resolution photo",
709
+ children: /* @__PURE__ */ _("span", {})
710
+ }), !u && /* @__PURE__ */ v("div", {
604
711
  className: "scanner-camera-overlay__toggles",
605
- children: [n?.autoCapture.visible && /* @__PURE__ */ h("label", { children: [/* @__PURE__ */ m("input", {
712
+ children: [n?.autoCapture.visible && /* @__PURE__ */ v("label", { children: [/* @__PURE__ */ _("input", {
606
713
  type: "checkbox",
607
714
  checked: n.autoCapture.checked,
608
715
  onChange: (e) => c(e.target.checked)
609
- }), "Auto-capture"] }), r?.torch.visible && /* @__PURE__ */ h("label", {
716
+ }), "Auto-capture"] }), r?.torch.visible && /* @__PURE__ */ v("label", {
610
717
  title: r.torch.automatic ? "Torch is controlled automatically from scene brightness" : void 0,
611
- children: [/* @__PURE__ */ m("input", {
718
+ children: [/* @__PURE__ */ _("input", {
612
719
  type: "checkbox",
613
720
  checked: r.torch.on,
614
721
  disabled: !r.torch.mutable,
@@ -617,18 +724,18 @@ function F() {
617
724
  })]
618
725
  })]
619
726
  }),
620
- /* @__PURE__ */ h("div", {
727
+ /* @__PURE__ */ v("div", {
621
728
  className: "scanner-camera-overlay__quality",
622
- children: [/* @__PURE__ */ m("span", { children: i === "live-mirror" ? "Mirror" : "Camera" }), /* @__PURE__ */ m("strong", { children: u && d ? `${u} × ${d}` : "Measuring…" })]
729
+ children: [/* @__PURE__ */ _("span", { children: u ? "System camera" : i === "live-mirror" ? "Mirror" : "Camera" }), /* @__PURE__ */ _("strong", { children: d && f ? `${d} × ${f}` : u ? "Tap to photograph" : "Measuring…" })]
623
730
  })
624
731
  ]
625
732
  });
626
733
  }
627
734
  function I({ snapshot: e }) {
628
- let { modelDownload: t } = C();
629
- return /* @__PURE__ */ m(T, { snapshot: e ?? t });
735
+ let { modelDownload: t } = w();
736
+ return /* @__PURE__ */ _(E, { snapshot: e ?? t });
630
737
  }
631
738
  //#endregion
632
- export { F as ScannerControls, P as ScannerDiagnostics, O as ScannerFrame, I as ScannerModelDownload, M as ScannerNotice, k as ScannerPreview, x as ScannerProvider, A as ScannerQuad, N as ScannerStatus, j as ScannerTopBar, C as useScanner, S as useScannerRef };
739
+ export { F as ScannerControls, P as ScannerDiagnostics, O as ScannerFrame, I as ScannerModelDownload, M as ScannerNotice, k as ScannerPreview, S as ScannerProvider, A as ScannerQuad, N as ScannerStatus, j as ScannerTopBar, w as useScanner, C as useScannerRef };
633
740
 
634
741
  //# sourceMappingURL=react.js.map