@uziee/document-scanner 1.1.2 → 1.1.3

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/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
- import $e, { useRef as z, useState as Ye, useEffect as vr } from "react";
2
- var he = { exports: {} }, Q = {};
1
+ import Ye, { useRef as X, useState as le, useEffect as vr } from "react";
2
+ var Re = { exports: {} }, re = {};
3
3
  /**
4
4
  * @license React
5
5
  * react-jsx-runtime.production.min.js
@@ -9,25 +9,25 @@ var he = { exports: {} }, Q = {};
9
9
  * This source code is licensed under the MIT license found in the
10
10
  * LICENSE file in the root directory of this source tree.
11
11
  */
12
- var We;
12
+ var $e;
13
13
  function pr() {
14
- if (We)
15
- return Q;
16
- We = 1;
17
- var U = $e, m = Symbol.for("react.element"), V = Symbol.for("react.fragment"), k = Object.prototype.hasOwnProperty, W = U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, B = { key: !0, ref: !0, __self: !0, __source: !0 };
18
- function j(D, v, N) {
19
- var E, M = {}, $ = null, J = null;
20
- N !== void 0 && ($ = "" + N), v.key !== void 0 && ($ = "" + v.key), v.ref !== void 0 && (J = v.ref);
21
- for (E in v)
22
- k.call(v, E) && !B.hasOwnProperty(E) && (M[E] = v[E]);
23
- if (D && D.defaultProps)
24
- for (E in v = D.defaultProps, v)
25
- M[E] === void 0 && (M[E] = v[E]);
26
- return { $$typeof: m, type: D, key: $, ref: J, props: M, _owner: W.current };
14
+ if ($e)
15
+ return re;
16
+ $e = 1;
17
+ var $ = Ye, m = Symbol.for("react.element"), M = Symbol.for("react.fragment"), O = Object.prototype.hasOwnProperty, W = $.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, q = { key: !0, ref: !0, __self: !0, __source: !0 };
18
+ function I(Y, d, V) {
19
+ var x, P = {}, j = null, H = null;
20
+ V !== void 0 && (j = "" + V), d.key !== void 0 && (j = "" + d.key), d.ref !== void 0 && (H = d.ref);
21
+ for (x in d)
22
+ O.call(d, x) && !q.hasOwnProperty(x) && (P[x] = d[x]);
23
+ if (Y && Y.defaultProps)
24
+ for (x in d = Y.defaultProps, d)
25
+ P[x] === void 0 && (P[x] = d[x]);
26
+ return { $$typeof: m, type: Y, key: j, ref: H, props: P, _owner: W.current };
27
27
  }
28
- return Q.Fragment = V, Q.jsx = j, Q.jsxs = j, Q;
28
+ return re.Fragment = M, re.jsx = I, re.jsxs = I, re;
29
29
  }
30
- var ee = {};
30
+ var te = {};
31
31
  /**
32
32
  * @license React
33
33
  * react-jsx-runtime.development.js
@@ -40,88 +40,88 @@ var ee = {};
40
40
  var Me;
41
41
  function hr() {
42
42
  return Me || (Me = 1, {}.NODE_ENV !== "production" && function() {
43
- var U = $e, m = Symbol.for("react.element"), V = Symbol.for("react.portal"), k = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), B = Symbol.for("react.profiler"), j = Symbol.for("react.provider"), D = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), N = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), M = Symbol.for("react.memo"), $ = Symbol.for("react.lazy"), J = Symbol.for("react.offscreen"), a = Symbol.iterator, f = "@@iterator";
44
- function d(e) {
43
+ var $ = Ye, m = Symbol.for("react.element"), M = Symbol.for("react.portal"), O = Symbol.for("react.fragment"), W = Symbol.for("react.strict_mode"), q = Symbol.for("react.profiler"), I = Symbol.for("react.provider"), Y = Symbol.for("react.context"), d = Symbol.for("react.forward_ref"), V = Symbol.for("react.suspense"), x = Symbol.for("react.suspense_list"), P = Symbol.for("react.memo"), j = Symbol.for("react.lazy"), H = Symbol.for("react.offscreen"), ne = Symbol.iterator, ce = "@@iterator";
44
+ function ue(e) {
45
45
  if (e === null || typeof e != "object")
46
46
  return null;
47
- var r = a && e[a] || e[f];
47
+ var r = ne && e[ne] || e[ce];
48
48
  return typeof r == "function" ? r : null;
49
49
  }
50
- var s = U.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
- function l(e) {
50
+ var B = $.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
51
+ function R(e) {
52
52
  {
53
53
  for (var r = arguments.length, t = new Array(r > 1 ? r - 1 : 0), n = 1; n < r; n++)
54
54
  t[n - 1] = arguments[n];
55
- O("error", e, t);
55
+ c("error", e, t);
56
56
  }
57
57
  }
58
- function O(e, r, t) {
58
+ function c(e, r, t) {
59
59
  {
60
- var n = s.ReactDebugCurrentFrame, u = n.getStackAddendum();
61
- u !== "" && (r += "%s", t = t.concat([u]));
62
- var c = t.map(function(i) {
60
+ var n = B.ReactDebugCurrentFrame, o = n.getStackAddendum();
61
+ o !== "" && (r += "%s", t = t.concat([o]));
62
+ var u = t.map(function(i) {
63
63
  return String(i);
64
64
  });
65
- c.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, c);
65
+ u.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, u);
66
66
  }
67
67
  }
68
- var h = !1, y = !1, C = !1, F = !1, Y = !1, P;
69
- P = Symbol.for("react.module.reference");
70
- function A(e) {
71
- return !!(typeof e == "string" || typeof e == "function" || e === k || e === B || Y || e === W || e === N || e === E || F || e === J || h || y || C || typeof e == "object" && e !== null && (e.$$typeof === $ || e.$$typeof === M || e.$$typeof === j || e.$$typeof === D || e.$$typeof === v || // This needs to include all possible module reference object
68
+ var v = !1, l = !1, s = !1, T = !1, k = !1, g;
69
+ g = Symbol.for("react.module.reference");
70
+ function _(e) {
71
+ return !!(typeof e == "string" || typeof e == "function" || e === O || e === q || k || e === W || e === V || e === x || T || e === H || v || l || s || typeof e == "object" && e !== null && (e.$$typeof === j || e.$$typeof === P || e.$$typeof === I || e.$$typeof === Y || e.$$typeof === d || // This needs to include all possible module reference object
72
72
  // types supported by any Flight configuration anywhere since
73
73
  // we don't know which Flight build this will end up being used
74
74
  // with.
75
- e.$$typeof === P || e.getModuleId !== void 0));
75
+ e.$$typeof === g || e.getModuleId !== void 0));
76
76
  }
77
- function _(e, r, t) {
77
+ function E(e, r, t) {
78
78
  var n = e.displayName;
79
79
  if (n)
80
80
  return n;
81
- var u = r.displayName || r.name || "";
82
- return u !== "" ? t + "(" + u + ")" : t;
81
+ var o = r.displayName || r.name || "";
82
+ return o !== "" ? t + "(" + o + ")" : t;
83
83
  }
84
- function R(e) {
84
+ function U(e) {
85
85
  return e.displayName || "Context";
86
86
  }
87
87
  function b(e) {
88
88
  if (e == null)
89
89
  return null;
90
- if (typeof e.tag == "number" && l("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
90
+ if (typeof e.tag == "number" && R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
91
91
  return e.displayName || e.name || null;
92
92
  if (typeof e == "string")
93
93
  return e;
94
94
  switch (e) {
95
- case k:
95
+ case O:
96
96
  return "Fragment";
97
- case V:
97
+ case M:
98
98
  return "Portal";
99
- case B:
99
+ case q:
100
100
  return "Profiler";
101
101
  case W:
102
102
  return "StrictMode";
103
- case N:
103
+ case V:
104
104
  return "Suspense";
105
- case E:
105
+ case x:
106
106
  return "SuspenseList";
107
107
  }
108
108
  if (typeof e == "object")
109
109
  switch (e.$$typeof) {
110
- case D:
110
+ case Y:
111
111
  var r = e;
112
- return R(r) + ".Consumer";
113
- case j:
112
+ return U(r) + ".Consumer";
113
+ case I:
114
114
  var t = e;
115
- return R(t._context) + ".Provider";
116
- case v:
117
- return _(e, e.render, "ForwardRef");
118
- case M:
115
+ return U(t._context) + ".Provider";
116
+ case d:
117
+ return E(e, e.render, "ForwardRef");
118
+ case P:
119
119
  var n = e.displayName || null;
120
120
  return n !== null ? n : b(e.type) || "Memo";
121
- case $: {
122
- var u = e, c = u._payload, i = u._init;
121
+ case j: {
122
+ var o = e, u = o._payload, i = o._init;
123
123
  try {
124
- return b(i(c));
124
+ return b(i(u));
125
125
  } catch {
126
126
  return null;
127
127
  }
@@ -129,14 +129,14 @@ function hr() {
129
129
  }
130
130
  return null;
131
131
  }
132
- var w = Object.assign, L = 0, G, oe, ge, be, me, ye, Re;
132
+ var D = Object.assign, w = 0, p, C, z, L, N, Z, fe;
133
133
  function Ee() {
134
134
  }
135
135
  Ee.__reactDisabledLog = !0;
136
- function Le() {
136
+ function Ue() {
137
137
  {
138
- if (L === 0) {
139
- G = console.log, oe = console.info, ge = console.warn, be = console.error, me = console.group, ye = console.groupCollapsed, Re = console.groupEnd;
138
+ if (w === 0) {
139
+ p = console.log, C = console.info, z = console.warn, L = console.error, N = console.group, Z = console.groupCollapsed, fe = console.groupEnd;
140
140
  var e = {
141
141
  configurable: !0,
142
142
  enumerable: !0,
@@ -153,77 +153,77 @@ function hr() {
153
153
  groupEnd: e
154
154
  });
155
155
  }
156
- L++;
156
+ w++;
157
157
  }
158
158
  }
159
- function Ue() {
159
+ function Le() {
160
160
  {
161
- if (L--, L === 0) {
161
+ if (w--, w === 0) {
162
162
  var e = {
163
163
  configurable: !0,
164
164
  enumerable: !0,
165
165
  writable: !0
166
166
  };
167
167
  Object.defineProperties(console, {
168
- log: w({}, e, {
169
- value: G
168
+ log: D({}, e, {
169
+ value: p
170
170
  }),
171
- info: w({}, e, {
172
- value: oe
171
+ info: D({}, e, {
172
+ value: C
173
173
  }),
174
- warn: w({}, e, {
175
- value: ge
174
+ warn: D({}, e, {
175
+ value: z
176
176
  }),
177
- error: w({}, e, {
178
- value: be
177
+ error: D({}, e, {
178
+ value: L
179
179
  }),
180
- group: w({}, e, {
181
- value: me
180
+ group: D({}, e, {
181
+ value: N
182
182
  }),
183
- groupCollapsed: w({}, e, {
184
- value: ye
183
+ groupCollapsed: D({}, e, {
184
+ value: Z
185
185
  }),
186
- groupEnd: w({}, e, {
187
- value: Re
186
+ groupEnd: D({}, e, {
187
+ value: fe
188
188
  })
189
189
  });
190
190
  }
191
- L < 0 && l("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
191
+ w < 0 && R("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
192
192
  }
193
193
  }
194
- var ie = s.ReactCurrentDispatcher, se;
195
- function re(e, r, t) {
194
+ var de = B.ReactCurrentDispatcher, ve;
195
+ function ae(e, r, t) {
196
196
  {
197
- if (se === void 0)
197
+ if (ve === void 0)
198
198
  try {
199
199
  throw Error();
200
- } catch (u) {
201
- var n = u.stack.trim().match(/\n( *(at )?)/);
202
- se = n && n[1] || "";
200
+ } catch (o) {
201
+ var n = o.stack.trim().match(/\n( *(at )?)/);
202
+ ve = n && n[1] || "";
203
203
  }
204
204
  return `
205
- ` + se + e;
205
+ ` + ve + e;
206
206
  }
207
207
  }
208
- var ue = !1, te;
208
+ var pe = !1, ie;
209
209
  {
210
- var Ve = typeof WeakMap == "function" ? WeakMap : Map;
211
- te = new Ve();
210
+ var Ne = typeof WeakMap == "function" ? WeakMap : Map;
211
+ ie = new Ne();
212
212
  }
213
213
  function _e(e, r) {
214
- if (!e || ue)
214
+ if (!e || pe)
215
215
  return "";
216
216
  {
217
- var t = te.get(e);
217
+ var t = ie.get(e);
218
218
  if (t !== void 0)
219
219
  return t;
220
220
  }
221
221
  var n;
222
- ue = !0;
223
- var u = Error.prepareStackTrace;
222
+ pe = !0;
223
+ var o = Error.prepareStackTrace;
224
224
  Error.prepareStackTrace = void 0;
225
- var c;
226
- c = ie.current, ie.current = null, Le();
225
+ var u;
226
+ u = de.current, de.current = null, Ue();
227
227
  try {
228
228
  if (r) {
229
229
  var i = function() {
@@ -236,147 +236,147 @@ function hr() {
236
236
  }), typeof Reflect == "object" && Reflect.construct) {
237
237
  try {
238
238
  Reflect.construct(i, []);
239
- } catch (T) {
240
- n = T;
239
+ } catch (F) {
240
+ n = F;
241
241
  }
242
242
  Reflect.construct(e, [], i);
243
243
  } else {
244
244
  try {
245
245
  i.call();
246
- } catch (T) {
247
- n = T;
246
+ } catch (F) {
247
+ n = F;
248
248
  }
249
249
  e.call(i.prototype);
250
250
  }
251
251
  } else {
252
252
  try {
253
253
  throw Error();
254
- } catch (T) {
255
- n = T;
254
+ } catch (F) {
255
+ n = F;
256
256
  }
257
257
  e();
258
258
  }
259
- } catch (T) {
260
- if (T && n && typeof T.stack == "string") {
261
- for (var o = T.stack.split(`
262
- `), x = n.stack.split(`
263
- `), p = o.length - 1, g = x.length - 1; p >= 1 && g >= 0 && o[p] !== x[g]; )
264
- g--;
265
- for (; p >= 1 && g >= 0; p--, g--)
266
- if (o[p] !== x[g]) {
267
- if (p !== 1 || g !== 1)
259
+ } catch (F) {
260
+ if (F && n && typeof F.stack == "string") {
261
+ for (var a = F.stack.split(`
262
+ `), S = n.stack.split(`
263
+ `), h = a.length - 1, y = S.length - 1; h >= 1 && y >= 0 && a[h] !== S[y]; )
264
+ y--;
265
+ for (; h >= 1 && y >= 0; h--, y--)
266
+ if (a[h] !== S[y]) {
267
+ if (h !== 1 || y !== 1)
268
268
  do
269
- if (p--, g--, g < 0 || o[p] !== x[g]) {
270
- var I = `
271
- ` + o[p].replace(" at new ", " at ");
272
- return e.displayName && I.includes("<anonymous>") && (I = I.replace("<anonymous>", e.displayName)), typeof e == "function" && te.set(e, I), I;
269
+ if (h--, y--, y < 0 || a[h] !== S[y]) {
270
+ var A = `
271
+ ` + a[h].replace(" at new ", " at ");
272
+ return e.displayName && A.includes("<anonymous>") && (A = A.replace("<anonymous>", e.displayName)), typeof e == "function" && ie.set(e, A), A;
273
273
  }
274
- while (p >= 1 && g >= 0);
274
+ while (h >= 1 && y >= 0);
275
275
  break;
276
276
  }
277
277
  }
278
278
  } finally {
279
- ue = !1, ie.current = c, Ue(), Error.prepareStackTrace = u;
279
+ pe = !1, de.current = u, Le(), Error.prepareStackTrace = o;
280
280
  }
281
- var K = e ? e.displayName || e.name : "", q = K ? re(K) : "";
282
- return typeof e == "function" && te.set(e, q), q;
281
+ var G = e ? e.displayName || e.name : "", J = G ? ae(G) : "";
282
+ return typeof e == "function" && ie.set(e, J), J;
283
283
  }
284
- function Ne(e, r, t) {
284
+ function Ve(e, r, t) {
285
285
  return _e(e, !1);
286
286
  }
287
287
  function Be(e) {
288
288
  var r = e.prototype;
289
289
  return !!(r && r.isReactComponent);
290
290
  }
291
- function ne(e, r, t) {
291
+ function oe(e, r, t) {
292
292
  if (e == null)
293
293
  return "";
294
294
  if (typeof e == "function")
295
295
  return _e(e, Be(e));
296
296
  if (typeof e == "string")
297
- return re(e);
297
+ return ae(e);
298
298
  switch (e) {
299
- case N:
300
- return re("Suspense");
301
- case E:
302
- return re("SuspenseList");
299
+ case V:
300
+ return ae("Suspense");
301
+ case x:
302
+ return ae("SuspenseList");
303
303
  }
304
304
  if (typeof e == "object")
305
305
  switch (e.$$typeof) {
306
- case v:
307
- return Ne(e.render);
308
- case M:
309
- return ne(e.type, r, t);
310
- case $: {
311
- var n = e, u = n._payload, c = n._init;
306
+ case d:
307
+ return Ve(e.render);
308
+ case P:
309
+ return oe(e.type, r, t);
310
+ case j: {
311
+ var n = e, o = n._payload, u = n._init;
312
312
  try {
313
- return ne(c(u), r, t);
313
+ return oe(u(o), r, t);
314
314
  } catch {
315
315
  }
316
316
  }
317
317
  }
318
318
  return "";
319
319
  }
320
- var X = Object.prototype.hasOwnProperty, xe = {}, Ce = s.ReactDebugCurrentFrame;
321
- function ae(e) {
320
+ var Q = Object.prototype.hasOwnProperty, we = {}, Ce = B.ReactDebugCurrentFrame;
321
+ function se(e) {
322
322
  if (e) {
323
- var r = e._owner, t = ne(e.type, e._source, r ? r.type : null);
323
+ var r = e._owner, t = oe(e.type, e._source, r ? r.type : null);
324
324
  Ce.setExtraStackFrame(t);
325
325
  } else
326
326
  Ce.setExtraStackFrame(null);
327
327
  }
328
- function qe(e, r, t, n, u) {
328
+ function ze(e, r, t, n, o) {
329
329
  {
330
- var c = Function.call.bind(X);
330
+ var u = Function.call.bind(Q);
331
331
  for (var i in e)
332
- if (c(e, i)) {
333
- var o = void 0;
332
+ if (u(e, i)) {
333
+ var a = void 0;
334
334
  try {
335
335
  if (typeof e[i] != "function") {
336
- var x = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
- throw x.name = "Invariant Violation", x;
336
+ var S = Error((n || "React class") + ": " + t + " type `" + i + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[i] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
337
+ throw S.name = "Invariant Violation", S;
338
338
  }
339
- o = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
- } catch (p) {
341
- o = p;
339
+ a = e[i](r, i, n, t, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
340
+ } catch (h) {
341
+ a = h;
342
342
  }
343
- o && !(o instanceof Error) && (ae(u), l("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof o), ae(null)), o instanceof Error && !(o.message in xe) && (xe[o.message] = !0, ae(u), l("Failed %s type: %s", t, o.message), ae(null));
343
+ a && !(a instanceof Error) && (se(o), R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", n || "React class", t, i, typeof a), se(null)), a instanceof Error && !(a.message in we) && (we[a.message] = !0, se(o), R("Failed %s type: %s", t, a.message), se(null));
344
344
  }
345
345
  }
346
346
  }
347
- var Je = Array.isArray;
348
- function le(e) {
349
- return Je(e);
347
+ var qe = Array.isArray;
348
+ function he(e) {
349
+ return qe(e);
350
350
  }
351
- function He(e) {
351
+ function Je(e) {
352
352
  {
353
353
  var r = typeof Symbol == "function" && Symbol.toStringTag, t = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
354
354
  return t;
355
355
  }
356
356
  }
357
- function Ke(e) {
357
+ function He(e) {
358
358
  try {
359
- return we(e), !1;
359
+ return je(e), !1;
360
360
  } catch {
361
361
  return !0;
362
362
  }
363
363
  }
364
- function we(e) {
364
+ function je(e) {
365
365
  return "" + e;
366
366
  }
367
367
  function Te(e) {
368
- if (Ke(e))
369
- return l("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", He(e)), we(e);
368
+ if (He(e))
369
+ return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Je(e)), je(e);
370
370
  }
371
- var Z = s.ReactCurrentOwner, ze = {
371
+ var ee = B.ReactCurrentOwner, Ke = {
372
372
  key: !0,
373
373
  ref: !0,
374
374
  __self: !0,
375
375
  __source: !0
376
- }, Se, je, ce;
377
- ce = {};
376
+ }, Se, Oe, ge;
377
+ ge = {};
378
378
  function Ge(e) {
379
- if (X.call(e, "ref")) {
379
+ if (Q.call(e, "ref")) {
380
380
  var r = Object.getOwnPropertyDescriptor(e, "ref").get;
381
381
  if (r && r.isReactWarning)
382
382
  return !1;
@@ -384,7 +384,7 @@ function hr() {
384
384
  return e.ref !== void 0;
385
385
  }
386
386
  function Xe(e) {
387
- if (X.call(e, "key")) {
387
+ if (Q.call(e, "key")) {
388
388
  var r = Object.getOwnPropertyDescriptor(e, "key").get;
389
389
  if (r && r.isReactWarning)
390
390
  return !1;
@@ -392,15 +392,15 @@ function hr() {
392
392
  return e.key !== void 0;
393
393
  }
394
394
  function Ze(e, r) {
395
- if (typeof e.ref == "string" && Z.current && r && Z.current.stateNode !== r) {
396
- var t = b(Z.current.type);
397
- ce[t] || (l('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', b(Z.current.type), e.ref), ce[t] = !0);
395
+ if (typeof e.ref == "string" && ee.current && r && ee.current.stateNode !== r) {
396
+ var t = b(ee.current.type);
397
+ ge[t] || (R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', b(ee.current.type), e.ref), ge[t] = !0);
398
398
  }
399
399
  }
400
400
  function Qe(e, r) {
401
401
  {
402
402
  var t = function() {
403
- Se || (Se = !0, l("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
403
+ Se || (Se = !0, R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
404
404
  };
405
405
  t.isReactWarning = !0, Object.defineProperty(e, "key", {
406
406
  get: t,
@@ -411,7 +411,7 @@ function hr() {
411
411
  function er(e, r) {
412
412
  {
413
413
  var t = function() {
414
- je || (je = !0, l("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
414
+ Oe || (Oe = !0, R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
415
415
  };
416
416
  t.isReactWarning = !0, Object.defineProperty(e, "ref", {
417
417
  get: t,
@@ -419,8 +419,8 @@ function hr() {
419
419
  });
420
420
  }
421
421
  }
422
- var rr = function(e, r, t, n, u, c, i) {
423
- var o = {
422
+ var rr = function(e, r, t, n, o, u, i) {
423
+ var a = {
424
424
  // This tag allows us to uniquely identify this as a React Element
425
425
  $$typeof: m,
426
426
  // Built-in properties that belong on the element
@@ -429,60 +429,60 @@ function hr() {
429
429
  ref: t,
430
430
  props: i,
431
431
  // Record the component responsible for creating this element.
432
- _owner: c
432
+ _owner: u
433
433
  };
434
- return o._store = {}, Object.defineProperty(o._store, "validated", {
434
+ return a._store = {}, Object.defineProperty(a._store, "validated", {
435
435
  configurable: !1,
436
436
  enumerable: !1,
437
437
  writable: !0,
438
438
  value: !1
439
- }), Object.defineProperty(o, "_self", {
439
+ }), Object.defineProperty(a, "_self", {
440
440
  configurable: !1,
441
441
  enumerable: !1,
442
442
  writable: !1,
443
443
  value: n
444
- }), Object.defineProperty(o, "_source", {
444
+ }), Object.defineProperty(a, "_source", {
445
445
  configurable: !1,
446
446
  enumerable: !1,
447
447
  writable: !1,
448
- value: u
449
- }), Object.freeze && (Object.freeze(o.props), Object.freeze(o)), o;
448
+ value: o
449
+ }), Object.freeze && (Object.freeze(a.props), Object.freeze(a)), a;
450
450
  };
451
- function tr(e, r, t, n, u) {
451
+ function tr(e, r, t, n, o) {
452
452
  {
453
- var c, i = {}, o = null, x = null;
454
- t !== void 0 && (Te(t), o = "" + t), Xe(r) && (Te(r.key), o = "" + r.key), Ge(r) && (x = r.ref, Ze(r, u));
455
- for (c in r)
456
- X.call(r, c) && !ze.hasOwnProperty(c) && (i[c] = r[c]);
453
+ var u, i = {}, a = null, S = null;
454
+ t !== void 0 && (Te(t), a = "" + t), Xe(r) && (Te(r.key), a = "" + r.key), Ge(r) && (S = r.ref, Ze(r, o));
455
+ for (u in r)
456
+ Q.call(r, u) && !Ke.hasOwnProperty(u) && (i[u] = r[u]);
457
457
  if (e && e.defaultProps) {
458
- var p = e.defaultProps;
459
- for (c in p)
460
- i[c] === void 0 && (i[c] = p[c]);
458
+ var h = e.defaultProps;
459
+ for (u in h)
460
+ i[u] === void 0 && (i[u] = h[u]);
461
461
  }
462
- if (o || x) {
463
- var g = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
- o && Qe(i, g), x && er(i, g);
462
+ if (a || S) {
463
+ var y = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
464
+ a && Qe(i, y), S && er(i, y);
465
465
  }
466
- return rr(e, o, x, u, n, Z.current, i);
466
+ return rr(e, a, S, o, n, ee.current, i);
467
467
  }
468
468
  }
469
- var fe = s.ReactCurrentOwner, Oe = s.ReactDebugCurrentFrame;
470
- function H(e) {
469
+ var be = B.ReactCurrentOwner, Pe = B.ReactDebugCurrentFrame;
470
+ function K(e) {
471
471
  if (e) {
472
- var r = e._owner, t = ne(e.type, e._source, r ? r.type : null);
473
- Oe.setExtraStackFrame(t);
472
+ var r = e._owner, t = oe(e.type, e._source, r ? r.type : null);
473
+ Pe.setExtraStackFrame(t);
474
474
  } else
475
- Oe.setExtraStackFrame(null);
475
+ Pe.setExtraStackFrame(null);
476
476
  }
477
- var de;
478
- de = !1;
479
- function ve(e) {
477
+ var ye;
478
+ ye = !1;
479
+ function me(e) {
480
480
  return typeof e == "object" && e !== null && e.$$typeof === m;
481
481
  }
482
- function Pe() {
482
+ function ke() {
483
483
  {
484
- if (fe.current) {
485
- var e = b(fe.current.type);
484
+ if (be.current) {
485
+ var e = b(be.current.type);
486
486
  if (e)
487
487
  return `
488
488
 
@@ -502,10 +502,10 @@ Check your code at ` + r + ":" + t + ".";
502
502
  return "";
503
503
  }
504
504
  }
505
- var ke = {};
505
+ var De = {};
506
506
  function ar(e) {
507
507
  {
508
- var r = Pe();
508
+ var r = ke();
509
509
  if (!r) {
510
510
  var t = typeof e == "string" ? e : e.displayName || e.name;
511
511
  t && (r = `
@@ -515,39 +515,39 @@ Check the top-level render call using <` + t + ">.");
515
515
  return r;
516
516
  }
517
517
  }
518
- function De(e, r) {
518
+ function Fe(e, r) {
519
519
  {
520
520
  if (!e._store || e._store.validated || e.key != null)
521
521
  return;
522
522
  e._store.validated = !0;
523
523
  var t = ar(r);
524
- if (ke[t])
524
+ if (De[t])
525
525
  return;
526
- ke[t] = !0;
526
+ De[t] = !0;
527
527
  var n = "";
528
- e && e._owner && e._owner !== fe.current && (n = " It was passed a child from " + b(e._owner.type) + "."), H(e), l('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), H(null);
528
+ e && e._owner && e._owner !== be.current && (n = " It was passed a child from " + b(e._owner.type) + "."), K(e), R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', t, n), K(null);
529
529
  }
530
530
  }
531
- function Fe(e, r) {
531
+ function Ie(e, r) {
532
532
  {
533
533
  if (typeof e != "object")
534
534
  return;
535
- if (le(e))
535
+ if (he(e))
536
536
  for (var t = 0; t < e.length; t++) {
537
537
  var n = e[t];
538
- ve(n) && De(n, r);
538
+ me(n) && Fe(n, r);
539
539
  }
540
- else if (ve(e))
540
+ else if (me(e))
541
541
  e._store && (e._store.validated = !0);
542
542
  else if (e) {
543
- var u = d(e);
544
- if (typeof u == "function" && u !== e.entries)
545
- for (var c = u.call(e), i; !(i = c.next()).done; )
546
- ve(i.value) && De(i.value, r);
543
+ var o = ue(e);
544
+ if (typeof o == "function" && o !== e.entries)
545
+ for (var u = o.call(e), i; !(i = u.next()).done; )
546
+ me(i.value) && Fe(i.value, r);
547
547
  }
548
548
  }
549
549
  }
550
- function or(e) {
550
+ function ir(e) {
551
551
  {
552
552
  var r = e.type;
553
553
  if (r == null || typeof r == "string")
@@ -555,194 +555,253 @@ Check the top-level render call using <` + t + ">.");
555
555
  var t;
556
556
  if (typeof r == "function")
557
557
  t = r.propTypes;
558
- else if (typeof r == "object" && (r.$$typeof === v || // Note: Memo only checks outer props here.
558
+ else if (typeof r == "object" && (r.$$typeof === d || // Note: Memo only checks outer props here.
559
559
  // Inner props are checked in the reconciler.
560
- r.$$typeof === M))
560
+ r.$$typeof === P))
561
561
  t = r.propTypes;
562
562
  else
563
563
  return;
564
564
  if (t) {
565
565
  var n = b(r);
566
- qe(t, e.props, "prop", n, e);
567
- } else if (r.PropTypes !== void 0 && !de) {
568
- de = !0;
569
- var u = b(r);
570
- l("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", u || "Unknown");
566
+ ze(t, e.props, "prop", n, e);
567
+ } else if (r.PropTypes !== void 0 && !ye) {
568
+ ye = !0;
569
+ var o = b(r);
570
+ R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", o || "Unknown");
571
571
  }
572
- typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && l("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
572
+ typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
573
573
  }
574
574
  }
575
- function ir(e) {
575
+ function or(e) {
576
576
  {
577
577
  for (var r = Object.keys(e.props), t = 0; t < r.length; t++) {
578
578
  var n = r[t];
579
579
  if (n !== "children" && n !== "key") {
580
- H(e), l("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), H(null);
580
+ K(e), R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", n), K(null);
581
581
  break;
582
582
  }
583
583
  }
584
- e.ref !== null && (H(e), l("Invalid attribute `ref` supplied to `React.Fragment`."), H(null));
584
+ e.ref !== null && (K(e), R("Invalid attribute `ref` supplied to `React.Fragment`."), K(null));
585
585
  }
586
586
  }
587
587
  var Ae = {};
588
- function Ie(e, r, t, n, u, c) {
588
+ function We(e, r, t, n, o, u) {
589
589
  {
590
- var i = A(e);
590
+ var i = _(e);
591
591
  if (!i) {
592
- var o = "";
593
- (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (o += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
594
- var x = nr(u);
595
- x ? o += x : o += Pe();
596
- var p;
597
- e === null ? p = "null" : le(e) ? p = "array" : e !== void 0 && e.$$typeof === m ? (p = "<" + (b(e.type) || "Unknown") + " />", o = " Did you accidentally export a JSX literal instead of a component?") : p = typeof e, l("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", p, o);
592
+ var a = "";
593
+ (e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (a += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
594
+ var S = nr(o);
595
+ S ? a += S : a += ke();
596
+ var h;
597
+ e === null ? h = "null" : he(e) ? h = "array" : e !== void 0 && e.$$typeof === m ? (h = "<" + (b(e.type) || "Unknown") + " />", a = " Did you accidentally export a JSX literal instead of a component?") : h = typeof e, R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", h, a);
598
598
  }
599
- var g = tr(e, r, t, u, c);
600
- if (g == null)
601
- return g;
599
+ var y = tr(e, r, t, o, u);
600
+ if (y == null)
601
+ return y;
602
602
  if (i) {
603
- var I = r.children;
604
- if (I !== void 0)
603
+ var A = r.children;
604
+ if (A !== void 0)
605
605
  if (n)
606
- if (le(I)) {
607
- for (var K = 0; K < I.length; K++)
608
- Fe(I[K], e);
609
- Object.freeze && Object.freeze(I);
606
+ if (he(A)) {
607
+ for (var G = 0; G < A.length; G++)
608
+ Ie(A[G], e);
609
+ Object.freeze && Object.freeze(A);
610
610
  } else
611
- l("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
611
+ R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
612
612
  else
613
- Fe(I, e);
613
+ Ie(A, e);
614
614
  }
615
- if (X.call(r, "key")) {
616
- var q = b(e), T = Object.keys(r).filter(function(dr) {
615
+ if (Q.call(r, "key")) {
616
+ var J = b(e), F = Object.keys(r).filter(function(dr) {
617
617
  return dr !== "key";
618
- }), pe = T.length > 0 ? "{key: someKey, " + T.join(": ..., ") + ": ...}" : "{key: someKey}";
619
- if (!Ae[q + pe]) {
620
- var fr = T.length > 0 ? "{" + T.join(": ..., ") + ": ...}" : "{}";
621
- l(`A props object containing a "key" prop is being spread into JSX:
618
+ }), xe = F.length > 0 ? "{key: someKey, " + F.join(": ..., ") + ": ...}" : "{key: someKey}";
619
+ if (!Ae[J + xe]) {
620
+ var fr = F.length > 0 ? "{" + F.join(": ..., ") + ": ...}" : "{}";
621
+ R(`A props object containing a "key" prop is being spread into JSX:
622
622
  let props = %s;
623
623
  <%s {...props} />
624
624
  React keys must be passed directly to JSX without using spread:
625
625
  let props = %s;
626
- <%s key={someKey} {...props} />`, pe, q, fr, q), Ae[q + pe] = !0;
626
+ <%s key={someKey} {...props} />`, xe, J, fr, J), Ae[J + xe] = !0;
627
627
  }
628
628
  }
629
- return e === k ? ir(g) : or(g), g;
629
+ return e === O ? or(y) : ir(y), y;
630
630
  }
631
631
  }
632
632
  function sr(e, r, t) {
633
- return Ie(e, r, t, !0);
633
+ return We(e, r, t, !0);
634
634
  }
635
- function ur(e, r, t) {
636
- return Ie(e, r, t, !1);
635
+ function lr(e, r, t) {
636
+ return We(e, r, t, !1);
637
637
  }
638
- var lr = ur, cr = sr;
639
- ee.Fragment = k, ee.jsx = lr, ee.jsxs = cr;
640
- }()), ee;
638
+ var cr = lr, ur = sr;
639
+ te.Fragment = O, te.jsx = cr, te.jsxs = ur;
640
+ }()), te;
641
641
  }
642
- ({}).NODE_ENV === "production" ? he.exports = pr() : he.exports = hr();
643
- var S = he.exports;
644
- const gr = ({ onCapture: U }) => {
645
- const m = z(null), V = z(null), k = z(null), [W, B] = Ye(!1), j = z(null), D = z([]), v = z(0);
642
+ ({}).NODE_ENV === "production" ? Re.exports = pr() : Re.exports = hr();
643
+ var f = Re.exports;
644
+ const gr = ({ onCapture: $ }) => {
645
+ const m = X(null), M = X(null), O = X(null), [W, q] = le(!1), [I, Y] = le(null), [d, V] = le([]), x = X(null), P = X([]), j = X(0);
646
646
  vr(() => {
647
- k.current || (k.current = document.createElement("canvas"));
648
- let a = null;
649
- async function f() {
647
+ O.current || (O.current = document.createElement("canvas"));
648
+ let c = null;
649
+ async function v() {
650
650
  try {
651
651
  const s = await navigator.mediaDevices.getUserMedia({
652
652
  video: { facingMode: "environment", width: { ideal: 1920 } }
653
653
  });
654
- m.current && (m.current.srcObject = s, m.current.play(), a = requestAnimationFrame(d));
654
+ m.current && (m.current.srcObject = s, m.current.play(), c = requestAnimationFrame(l));
655
655
  } catch (s) {
656
656
  console.error("Camera access error:", s);
657
657
  }
658
658
  }
659
- function d() {
659
+ function l() {
660
660
  var s;
661
661
  if (((s = m.current) == null ? void 0 : s.readyState) >= 2) {
662
- const l = m.current, O = V.current, h = O.getContext("2d");
663
- O.width !== l.videoWidth && (O.width = l.videoWidth, O.height = l.videoHeight), h.drawImage(l, 0, 0);
664
- const y = E(l);
665
- y ? (j.current && N(y, j.current) ? v.current = Math.min(15, v.current + 1) : v.current = 0, D.current.push(y), D.current.length > 10 && D.current.shift(), j.current = M(D.current), v.current > 5 && B(!0)) : (v.current = Math.max(0, v.current - 2), v.current === 0 && (j.current = null, B(!1))), W && j.current && $(h, j.current);
662
+ const T = m.current, k = M.current;
663
+ if (!k)
664
+ return;
665
+ const g = k.getContext("2d");
666
+ k.width !== T.videoWidth && (k.width = T.videoWidth, k.height = T.videoHeight), g.drawImage(T, 0, 0);
667
+ const _ = ne(T);
668
+ if (_) {
669
+ x.current && H(_, x.current) ? j.current = Math.min(15, j.current + 1) : j.current = 0, P.current.push(_), P.current.length > 10 && P.current.shift();
670
+ const E = ce(P.current);
671
+ x.current = E, j.current > 5 && (q(!0), Y(E));
672
+ } else
673
+ j.current = Math.max(0, j.current - 2), j.current === 0 && (x.current = null, q(!1), Y(null));
666
674
  }
667
- a = requestAnimationFrame(d);
668
- }
669
- return f(), () => cancelAnimationFrame(a);
670
- }, [W]);
671
- const N = (a, f) => Math.abs(a.tl[0] - f.tl[0]) + Math.abs(a.tl[1] - f.tl[1]) < 50, E = (a) => {
672
- const d = Math.floor(a.videoWidth * 0.15), s = Math.floor(a.videoHeight * 0.15), l = k.current.getContext("2d");
673
- k.current.width = d, k.current.height = s, l.drawImage(a, 0, 0, d, s);
674
- const O = l.getImageData(0, 0, d, s).data;
675
- let h = [d, s], y = [0, s], C = [d, 0], F = [0, 0], Y = 0;
676
- for (let _ = 10; _ < s - 10; _++)
677
- for (let R = 10; R < d - 10; R++) {
678
- const b = (_ * d + R) * 4, w = O[b], L = O[b + 1], G = O[b + 2];
679
- w > 190 && L > 190 && G > 180 && Math.abs(w - L) < 20 && Math.abs(L - G) < 20 && (Y++, R + _ < h[0] + h[1] && (h = [R, _]), R - _ > y[0] - y[1] && (y = [R, _]), R - _ < C[0] - C[1] && (C = [R, _]), R + _ > F[0] + F[1] && (F = [R, _]));
675
+ c = requestAnimationFrame(l);
676
+ }
677
+ return v(), () => cancelAnimationFrame(c);
678
+ }, []);
679
+ const H = (c, v) => Math.abs(c.tl[0] - v.tl[0]) + Math.abs(c.tl[1] - v.tl[1]) < 50, ne = (c) => {
680
+ const l = Math.floor(c.videoWidth * 0.15), s = Math.floor(c.videoHeight * 0.15), T = O.current.getContext("2d");
681
+ O.current.width = l, O.current.height = s, T.drawImage(c, 0, 0, l, s);
682
+ const k = T.getImageData(0, 0, l, s).data;
683
+ let g = [l, s], _ = [0, s], E = [l, 0], U = [0, 0], b = 0;
684
+ for (let p = 10; p < s - 10; p++)
685
+ for (let C = 10; C < l - 10; C++) {
686
+ const z = (p * l + C) * 4, L = k[z], N = k[z + 1], Z = k[z + 2];
687
+ L > 180 && N > 180 && Z > 170 && Math.abs(L - N) < 25 && Math.abs(N - Z) < 25 && (b++, C + p < g[0] + g[1] && (g = [C, p]), C - p > _[0] - _[1] && (_ = [C, p]), C - p < E[0] - E[1] && (E = [C, p]), C + p > U[0] + U[1] && (U = [C, p]));
680
688
  }
681
- const P = y[0] - h[0], A = C[1] - h[1];
682
- return Y < d * s * 0.08 || P < d * 0.3 || A < s * 0.3 ? null : {
683
- tl: [h[0] / 0.15, h[1] / 0.15],
684
- tr: [y[0] / 0.15, y[1] / 0.15],
685
- bl: [C[0] / 0.15, C[1] / 0.15],
686
- br: [F[0] / 0.15, F[1] / 0.15]
689
+ const D = _[0] - g[0], w = E[1] - g[1];
690
+ return b < l * s * 0.08 || D < l * 0.3 || w < s * 0.3 ? null : {
691
+ tl: [g[0] / 0.15, g[1] / 0.15],
692
+ tr: [_[0] / 0.15, _[1] / 0.15],
693
+ bl: [E[0] / 0.15, E[1] / 0.15],
694
+ br: [U[0] / 0.15, U[1] / 0.15]
687
695
  };
688
- }, M = (a) => {
689
- const f = { tl: [0, 0], tr: [0, 0], bl: [0, 0], br: [0, 0] };
690
- return a.forEach((d) => {
696
+ }, ce = (c) => {
697
+ const v = { tl: [0, 0], tr: [0, 0], bl: [0, 0], br: [0, 0] };
698
+ return c.forEach((l) => {
691
699
  ["tl", "tr", "bl", "br"].forEach((s) => {
692
- f[s][0] += d[s][0] / a.length, f[s][1] += d[s][1] / a.length;
700
+ v[s][0] += l[s][0] / c.length, v[s][1] += l[s][1] / c.length;
693
701
  });
694
- }), f;
695
- }, $ = (a, f) => {
696
- a.strokeStyle = "#00FF44", a.lineWidth = 12, a.lineCap = "round", a.shadowBlur = 15, a.shadowColor = "#00FF44", a.beginPath(), a.moveTo(...f.tl), a.lineTo(...f.tr), a.lineTo(...f.br), a.lineTo(...f.bl), a.closePath(), a.stroke(), a.shadowBlur = 0;
697
- }, J = () => {
698
- const a = m.current, f = j.current;
699
- if (!a || !f)
702
+ }), v;
703
+ }, ue = () => {
704
+ const c = m.current, v = x.current;
705
+ if (!c || !v)
700
706
  return;
701
- const d = 1240, s = 1754, l = document.createElement("canvas");
702
- l.width = d, l.height = s;
703
- const O = l.getContext("2d"), h = document.createElement("canvas");
704
- h.width = a.videoWidth, h.height = a.videoHeight, h.getContext("2d").drawImage(a, 0, 0);
705
- const y = h.getContext("2d").getImageData(0, 0, h.width, h.height), C = O.createImageData(d, s);
706
- for (let F = 0; F < s; F++)
707
- for (let Y = 0; Y < d; Y++) {
708
- const P = Y / d, A = F / s, _ = Math.floor((1 - P) * (1 - A) * f.tl[0] + P * (1 - A) * f.tr[0] + (1 - P) * A * f.bl[0] + P * A * f.br[0]), R = Math.floor((1 - P) * (1 - A) * f.tl[1] + P * (1 - A) * f.tr[1] + (1 - P) * A * f.bl[1] + P * A * f.br[1]), b = (F * d + Y) * 4, w = (R * h.width + _) * 4;
709
- C.data[b] = y.data[w], C.data[b + 1] = y.data[w + 1], C.data[b + 2] = y.data[w + 2], C.data[b + 3] = 255;
707
+ const l = 1240, s = 1754, T = document.createElement("canvas");
708
+ T.width = l, T.height = s;
709
+ const k = T.getContext("2d"), g = document.createElement("canvas");
710
+ g.width = c.videoWidth, g.height = c.videoHeight, g.getContext("2d").drawImage(c, 0, 0);
711
+ const _ = g.getContext("2d").getImageData(0, 0, g.width, g.height), E = k.createImageData(l, s);
712
+ for (let b = 0; b < s; b++)
713
+ for (let D = 0; D < l; D++) {
714
+ const w = D / l, p = b / s, C = Math.floor((1 - w) * (1 - p) * v.tl[0] + w * (1 - p) * v.tr[0] + (1 - w) * p * v.bl[0] + w * p * v.br[0]), z = Math.floor((1 - w) * (1 - p) * v.tl[1] + w * (1 - p) * v.tr[1] + (1 - w) * p * v.bl[1] + w * p * v.br[1]), L = (b * l + D) * 4, N = (z * g.width + C) * 4;
715
+ E.data[L] = _.data[N], E.data[L + 1] = _.data[N + 1], E.data[L + 2] = _.data[N + 2], E.data[L + 3] = 255;
710
716
  }
711
- O.putImageData(C, 0, 0), U(l.toDataURL("image/jpeg", 0.92));
717
+ k.putImageData(E, 0, 0);
718
+ const U = T.toDataURL("image/jpeg", 0.92);
719
+ V((b) => [...b, U]);
720
+ }, B = () => {
721
+ d.length > 0 && $(d);
722
+ }, R = () => {
723
+ if (!I || !m.current)
724
+ return "";
725
+ const c = m.current.videoWidth, v = m.current.videoHeight, l = (s) => `${s[0] / c * 100},${s[1] / v * 100}`;
726
+ return `${l(I.tl)} ${l(I.tr)} ${l(I.br)} ${l(I.bl)}`;
712
727
  };
713
- return /* @__PURE__ */ S.jsxs("div", { style: { textAlign: "center", background: "#111", minHeight: "100vh", padding: "20px" }, children: [
714
- /* @__PURE__ */ S.jsxs("div", { style: { position: "relative", borderRadius: "30px", overflow: "hidden", border: "5px solid #333", display: "inline-block" }, children: [
715
- /* @__PURE__ */ S.jsx("video", { ref: m, style: { display: "none" } }),
716
- /* @__PURE__ */ S.jsx("canvas", { ref: V, style: { width: "100%", maxWidth: "500px", display: "block" } }),
717
- W && /* @__PURE__ */ S.jsx("div", { style: { position: "absolute", bottom: "20px", left: "50%", transform: "translateX(-50%)", background: "#00FF44", color: "#000", padding: "8px 20px", borderRadius: "20px", fontWeight: "bold" }, children: "READY TO SCAN" })
718
- ] }),
719
- /* @__PURE__ */ S.jsx("button", { onClick: J, disabled: !W, style: {
720
- display: "block",
721
- margin: "20px auto",
722
- padding: "20px 50px",
723
- borderRadius: "50px",
724
- border: "none",
725
- backgroundColor: W ? "#00FF44" : "#444",
726
- color: W ? "#000" : "#888",
727
- fontSize: "18px",
728
- fontWeight: "bold",
729
- cursor: "pointer"
730
- }, children: "CROP & SAVE DOCUMENT" })
728
+ return /* @__PURE__ */ f.jsxs("div", { style: {
729
+ position: "fixed",
730
+ inset: 0,
731
+ backgroundColor: "#000",
732
+ fontFamily: "system-ui, -apple-system, sans-serif",
733
+ overflow: "hidden"
734
+ }, children: [
735
+ /* @__PURE__ */ f.jsx("video", { ref: m, style: { display: "none" }, playsInline: !0, muted: !0 }),
736
+ /* @__PURE__ */ f.jsx("canvas", { ref: M, style: { width: "100vw", height: "100vh", objectFit: "cover" } }),
737
+ /* @__PURE__ */ f.jsx(
738
+ "svg",
739
+ {
740
+ viewBox: "0 0 100 100",
741
+ preserveAspectRatio: "none",
742
+ style: { position: "absolute", top: 0, left: 0, width: "100%", height: "100%", pointerEvents: "none", zIndex: 10 },
743
+ children: I && /* @__PURE__ */ f.jsx(
744
+ "polygon",
745
+ {
746
+ points: R(),
747
+ fill: "rgba(0, 255, 70, 0.15)",
748
+ stroke: "#00FF46",
749
+ strokeWidth: "0.5",
750
+ style: { transition: "all 0.1s ease-out" }
751
+ }
752
+ )
753
+ }
754
+ ),
755
+ /* @__PURE__ */ f.jsx("div", { style: { position: "absolute", top: 0, width: "100%", padding: "40px 0 20px", background: "linear-gradient(rgba(0,0,0,0.6), transparent)", textAlign: "center", zIndex: 20 }, children: /* @__PURE__ */ f.jsx("div", { style: { display: "inline-block", padding: "6px 16px", borderRadius: "20px", backgroundColor: W ? "#00FF46" : "rgba(255,255,255,0.2)", color: W ? "#000" : "#fff", fontSize: "12px", fontWeight: "bold" }, children: W ? "READY TO SCAN" : "POSITION DOCUMENT" }) }),
756
+ /* @__PURE__ */ f.jsxs("div", { style: { position: "absolute", bottom: 0, width: "100%", height: "160px", background: "linear-gradient(transparent, rgba(0,0,0,0.8))", display: "flex", alignItems: "center", justifyContent: "space-around", zIndex: 20 }, children: [
757
+ /* @__PURE__ */ f.jsxs(
758
+ "div",
759
+ {
760
+ onClick: B,
761
+ style: {
762
+ width: "64px",
763
+ height: "64px",
764
+ position: "relative",
765
+ cursor: d.length > 0 ? "pointer" : "default",
766
+ opacity: d.length > 0 ? 1 : 0.4,
767
+ transition: "transform 0.2s"
768
+ },
769
+ onMouseDown: (c) => d.length > 0 && (c.currentTarget.style.transform = "scale(0.9)"),
770
+ onMouseUp: (c) => c.currentTarget.style.transform = "scale(1)",
771
+ children: [
772
+ d.length > 0 ? /* @__PURE__ */ f.jsxs(f.Fragment, { children: [
773
+ /* @__PURE__ */ f.jsx("img", { src: d[d.length - 1], style: { width: "100%", height: "100%", objectFit: "cover", border: "2px solid #fff", borderRadius: "4px" }, alt: "preview" }),
774
+ /* @__PURE__ */ f.jsx("div", { style: { position: "absolute", top: "-8px", right: "-8px", background: "#00FF46", color: "#000", width: "22px", height: "22px", borderRadius: "50%", fontSize: "12px", fontWeight: "bold", display: "flex", alignItems: "center", justifyContent: "center", border: "2px solid #000" }, children: d.length })
775
+ ] }) : /* @__PURE__ */ f.jsx("div", { style: { width: "100%", height: "100%", borderRadius: "4px", backgroundColor: "rgba(255,255,255,0.1)", border: "1px dashed #555" } }),
776
+ /* @__PURE__ */ f.jsx("span", { style: { fontSize: "10px", display: "block", textAlign: "center", marginTop: "4px", color: "#fff" }, children: "DONE" })
777
+ ]
778
+ }
779
+ ),
780
+ /* @__PURE__ */ f.jsx("button", { onClick: ue, disabled: !W, style: { width: "84px", height: "84px", borderRadius: "50%", border: `4px solid ${W ? "#00FF46" : "#555"}`, backgroundColor: "transparent", cursor: "pointer", display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ f.jsx("div", { style: { width: "68px", height: "68px", borderRadius: "50%", backgroundColor: W ? "#fff" : "#444" } }) }),
781
+ /* @__PURE__ */ f.jsx("div", { style: { width: "64px" } })
782
+ ] })
731
783
  ] });
732
784
  };
733
- function mr() {
734
- const [U, m] = Ye(null);
735
- return /* @__PURE__ */ S.jsxs("div", { style: { textAlign: "center", padding: "20px", fontFamily: "sans-serif" }, children: [
736
- /* @__PURE__ */ S.jsx("h1", { children: "JS Doc Scanner" }),
737
- U ? /* @__PURE__ */ S.jsxs("div", { children: [
738
- /* @__PURE__ */ S.jsx("h3", { children: "Scanned Result:" }),
739
- /* @__PURE__ */ S.jsx("img", { src: U, style: { width: "100%", maxWidth: "400px", border: "2px solid #ccc" } }),
740
- /* @__PURE__ */ S.jsx("br", {}),
741
- /* @__PURE__ */ S.jsx("button", { onClick: () => m(null), children: "Scan Again" })
742
- ] }) : /* @__PURE__ */ S.jsx(gr, { onCapture: (V) => m(V) })
785
+ function yr() {
786
+ const [$, m] = le(null);
787
+ return /* @__PURE__ */ f.jsxs("div", { style: { textAlign: "center", padding: "20px", fontFamily: "sans-serif" }, children: [
788
+ /* @__PURE__ */ f.jsx("h1", { children: "JS Doc Scanner" }),
789
+ $ ? /* @__PURE__ */ f.jsxs("div", { children: [
790
+ /* @__PURE__ */ f.jsx("h3", { children: "Scanned Result:" }),
791
+ $ == null ? void 0 : $.map((M, O) => /* @__PURE__ */ f.jsx(
792
+ "img",
793
+ {
794
+ src: M,
795
+ style: { width: "100%", maxWidth: "400px", border: "2px solid #ccc", margin: "10px" }
796
+ },
797
+ O
798
+ )),
799
+ /* @__PURE__ */ f.jsx("br", {}),
800
+ /* @__PURE__ */ f.jsx("button", { onClick: () => m(null), children: "Scan Again" })
801
+ ] }) : /* @__PURE__ */ f.jsx(gr, { onCapture: (M) => m(M) })
743
802
  ] });
744
803
  }
745
804
  export {
746
- mr as App,
805
+ yr as App,
747
806
  gr as DocumentScanner
748
807
  };