@wemap/camera 14.0.0-1 → 14.0.0
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.js +755 -24
- package/dist/qr-scanner-worker.min-CdBZO1_x-zOsA9GqL-spdHzETc-CdfYQy09-yymxaPor-DcsJbmYs-CbrIyAqr-Cmnj38L_-Bf4ha183.js +2 -0
- package/package.json +1 -1
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-B5PB_bz0-DA0kiTSy-NorQ2854-BMBKUWY9-BoVZZTXJ-CkGuQIJj.js → qr-scanner-worker.min-CdBZO1_x-B5PB_bz0-DA0kiTSy-NorQ2854-BMBKUWY9-BoVZZTXJ-CkGuQIJj-C1xdpcCt.js} +0 -0
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-B6z5WmOC-CssviUfq.js → qr-scanner-worker.min-CdBZO1_x-B6z5WmOC-CssviUfq-WoU50ICk.js} +0 -0
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-BQGmnbPC-DnOUafgV-DWpsR0Js-ZZGQKBrC-DOG-01---DWmsTSae-B_rE_zzG-BqVqc5W7-Hoirdoyc-Dogb-sTf.js → qr-scanner-worker.min-CdBZO1_x-BQGmnbPC-DnOUafgV-DWpsR0Js-ZZGQKBrC-DOG-01---DWmsTSae-B_rE_zzG-BqVqc5W7-Hoirdoyc-Dogb-sTf-zMGKmdcK.js} +0 -0
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-BRbiAMv9-nmIQ9hck-C6vs_IbV-DSY4QR6D.js → qr-scanner-worker.min-CdBZO1_x-BRbiAMv9-nmIQ9hck-C6vs_IbV-DSY4QR6D-CnoDIvXf.js} +0 -0
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-BasYyBmn-Sg4PHYpX-k03AL3XJ-Cgjn176v-CDYp3S06-DEPW_gy0-CqeOxb0L-BxEDkksK-Cp-a8RPF.js → qr-scanner-worker.min-CdBZO1_x-BasYyBmn-Sg4PHYpX-k03AL3XJ-Cgjn176v-CDYp3S06-DEPW_gy0-CqeOxb0L-BxEDkksK-Cp-a8RPF-DW9Q9STO.js} +0 -0
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-Bej9J3jZ-LIy5T9qw-B5AD_dxc-vFmEZ9Jc-C18UJXmQ-ByBto5KP-DEO_S4_W-BWRiSO9N-BBjAeT1B-DH0W8Rxm-D2jL_VRE.js → qr-scanner-worker.min-CdBZO1_x-Bej9J3jZ-LIy5T9qw-B5AD_dxc-vFmEZ9Jc-C18UJXmQ-ByBto5KP-DEO_S4_W-BWRiSO9N-BBjAeT1B-DH0W8Rxm-D2jL_VRE-BZHx-RAo.js} +0 -0
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-CBTRGYa--CBfOUkyb-qo3X-B_9-BkjDc6vN-ypRw_IJJ.js → qr-scanner-worker.min-CdBZO1_x-CBTRGYa--CBfOUkyb-qo3X-B_9-BkjDc6vN-ypRw_IJJ-BRLUJ_Zp.js} +0 -0
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-CYEYInSi-CIq73T7I-Dk6KCulN.js → qr-scanner-worker.min-CdBZO1_x-CYEYInSi-CIq73T7I-Dk6KCulN-CfhhXRKC.js} +0 -0
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-DAbG1qpa-DsmIQ1ZR-D0bKFp24-Bgg9_K2D-CzQjeLnK-Crw_pXOi-CxBZ0nTY-79jwfh5Z.js → qr-scanner-worker.min-CdBZO1_x-DAbG1qpa-DsmIQ1ZR-D0bKFp24-Bgg9_K2D-CzQjeLnK-Crw_pXOi-CxBZ0nTY-79jwfh5Z-k6MMnk2_.js} +0 -0
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-DbljhPN5.js → qr-scanner-worker.min-CdBZO1_x-DbljhPN5-CYU469PN.js} +0 -0
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-j4KIyzGW-CtZ2H-uq-BsxRIRJ2-B58mXfMr-CY7U-8le-BqjFedsp-DkEzaBUL-DmYDsfTA-OFT0YV77-CQI-j0E8-8Zc4Heoq-Bn1EU35u.js → qr-scanner-worker.min-CdBZO1_x-_S92d2eo.js} +0 -0
- /package/dist/{qr-scanner-worker.min-CdBZO1_x-zOsA9GqL-spdHzETc-CdfYQy09-yymxaPor-DcsJbmYs-CbrIyAqr-Cmnj38L_.js → qr-scanner-worker.min-CdBZO1_x-j4KIyzGW-CtZ2H-uq-BsxRIRJ2-B58mXfMr-CY7U-8le-BqjFedsp-DkEzaBUL-DmYDsfTA-OFT0YV77-CQI-j0E8-8Zc4Heoq-Bn1EU35u-Dy4zAK44.js} +0 -0
package/dist/index.js
CHANGED
|
@@ -1,13 +1,744 @@
|
|
|
1
|
-
var __create$
|
|
2
|
-
if (I && typeof I == "object" || typeof I == "function") for (var B = __getOwnPropNames$
|
|
1
|
+
var __create$13 = Object.create, __defProp$36 = Object.defineProperty, __getOwnPropDesc$13 = Object.getOwnPropertyDescriptor, __getOwnPropNames$13 = Object.getOwnPropertyNames, __getProtoOf$13 = Object.getPrototypeOf, __hasOwnProp$13 = Object.prototype.hasOwnProperty, __commonJSMin$13 = (a, N) => () => (N || a((N = { exports: {} }).exports, N), N.exports), __copyProps$13 = (a, I, R, z) => {
|
|
2
|
+
if (I && typeof I == "object" || typeof I == "function") for (var B = __getOwnPropNames$13(I), V = 0, H = B.length, U; V < H; V++) U = B[V], !__hasOwnProp$13.call(a, U) && U !== R && __defProp$36(a, U, {
|
|
3
3
|
get: ((a) => I[a]).bind(null, U),
|
|
4
|
-
enumerable: !(z = __getOwnPropDesc$
|
|
4
|
+
enumerable: !(z = __getOwnPropDesc$13(I, U)) || z.enumerable
|
|
5
5
|
});
|
|
6
6
|
return a;
|
|
7
|
-
}, import_events$
|
|
7
|
+
}, import_events$13 = /* @__PURE__ */ ((P, F, L) => (L = P == null ? {} : __create$13(__getProtoOf$13(P)), __copyProps$13(F || !P || !P.__esModule ? __defProp$36(L, "default", {
|
|
8
8
|
value: P,
|
|
9
9
|
enumerable: !0
|
|
10
|
-
}) : L, P)))((/* @__PURE__ */ __commonJSMin$
|
|
10
|
+
}) : L, P)))((/* @__PURE__ */ __commonJSMin$13(((a, N) => {
|
|
11
|
+
var P = typeof Reflect == "object" ? Reflect : null, F = P && typeof P.apply == "function" ? P.apply : function(a, N, P) {
|
|
12
|
+
return Function.prototype.apply.call(a, N, P);
|
|
13
|
+
}, I = P && typeof P.ownKeys == "function" ? P.ownKeys : Object.getOwnPropertySymbols ? function(a) {
|
|
14
|
+
return Object.getOwnPropertyNames(a).concat(Object.getOwnPropertySymbols(a));
|
|
15
|
+
} : function(a) {
|
|
16
|
+
return Object.getOwnPropertyNames(a);
|
|
17
|
+
};
|
|
18
|
+
function L(a) {
|
|
19
|
+
console && console.warn && console.warn(a);
|
|
20
|
+
}
|
|
21
|
+
var R = Number.isNaN || function(a) {
|
|
22
|
+
return a !== a;
|
|
23
|
+
};
|
|
24
|
+
function z() {
|
|
25
|
+
z.init.call(this);
|
|
26
|
+
}
|
|
27
|
+
N.exports = z, N.exports.once = Z, z.EventEmitter = z, z.prototype._events = void 0, z.prototype._eventsCount = 0, z.prototype._maxListeners = void 0;
|
|
28
|
+
var B = 10;
|
|
29
|
+
function V(a) {
|
|
30
|
+
if (typeof a != "function") throw TypeError("The \"listener\" argument must be of type Function. Received type " + typeof a);
|
|
31
|
+
}
|
|
32
|
+
Object.defineProperty(z, "defaultMaxListeners", {
|
|
33
|
+
enumerable: !0,
|
|
34
|
+
get: function() {
|
|
35
|
+
return B;
|
|
36
|
+
},
|
|
37
|
+
set: function(a) {
|
|
38
|
+
if (typeof a != "number" || a < 0 || R(a)) throw RangeError("The value of \"defaultMaxListeners\" is out of range. It must be a non-negative number. Received " + a + ".");
|
|
39
|
+
B = a;
|
|
40
|
+
}
|
|
41
|
+
}), z.init = function() {
|
|
42
|
+
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
43
|
+
}, z.prototype.setMaxListeners = function(a) {
|
|
44
|
+
if (typeof a != "number" || a < 0 || R(a)) throw RangeError("The value of \"n\" is out of range. It must be a non-negative number. Received " + a + ".");
|
|
45
|
+
return this._maxListeners = a, this;
|
|
46
|
+
};
|
|
47
|
+
function H(a) {
|
|
48
|
+
return a._maxListeners === void 0 ? z.defaultMaxListeners : a._maxListeners;
|
|
49
|
+
}
|
|
50
|
+
z.prototype.getMaxListeners = function() {
|
|
51
|
+
return H(this);
|
|
52
|
+
}, z.prototype.emit = function(a) {
|
|
53
|
+
for (var N = [], P = 1; P < arguments.length; P++) N.push(arguments[P]);
|
|
54
|
+
var I = a === "error", L = this._events;
|
|
55
|
+
if (L !== void 0) I &&= L.error === void 0;
|
|
56
|
+
else if (!I) return !1;
|
|
57
|
+
if (I) {
|
|
58
|
+
var R;
|
|
59
|
+
if (N.length > 0 && (R = N[0]), R instanceof Error) throw R;
|
|
60
|
+
var z = /* @__PURE__ */ Error("Unhandled error." + (R ? " (" + R.message + ")" : ""));
|
|
61
|
+
throw z.context = R, z;
|
|
62
|
+
}
|
|
63
|
+
var B = L[a];
|
|
64
|
+
if (B === void 0) return !1;
|
|
65
|
+
if (typeof B == "function") F(B, this, N);
|
|
66
|
+
else for (var V = B.length, H = J(B, V), P = 0; P < V; ++P) F(H[P], this, N);
|
|
67
|
+
return !0;
|
|
68
|
+
};
|
|
69
|
+
function U(a, N, P, F) {
|
|
70
|
+
var I, R, z;
|
|
71
|
+
if (V(P), R = a._events, R === void 0 ? (R = a._events = Object.create(null), a._eventsCount = 0) : (R.newListener !== void 0 && (a.emit("newListener", N, P.listener ? P.listener : P), R = a._events), z = R[N]), z === void 0) z = R[N] = P, ++a._eventsCount;
|
|
72
|
+
else if (typeof z == "function" ? z = R[N] = F ? [P, z] : [z, P] : F ? z.unshift(P) : z.push(P), I = H(a), I > 0 && z.length > I && !z.warned) {
|
|
73
|
+
z.warned = !0;
|
|
74
|
+
var B = /* @__PURE__ */ Error("Possible EventEmitter memory leak detected. " + z.length + " " + String(N) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
75
|
+
B.name = "MaxListenersExceededWarning", B.emitter = a, B.type = N, B.count = z.length, L(B);
|
|
76
|
+
}
|
|
77
|
+
return a;
|
|
78
|
+
}
|
|
79
|
+
z.prototype.addListener = function(a, N) {
|
|
80
|
+
return U(this, a, N, !1);
|
|
81
|
+
}, z.prototype.on = z.prototype.addListener, z.prototype.prependListener = function(a, N) {
|
|
82
|
+
return U(this, a, N, !0);
|
|
83
|
+
};
|
|
84
|
+
function W() {
|
|
85
|
+
if (!this.fired) return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
|
|
86
|
+
}
|
|
87
|
+
function G(a, N, P) {
|
|
88
|
+
var F = {
|
|
89
|
+
fired: !1,
|
|
90
|
+
wrapFn: void 0,
|
|
91
|
+
target: a,
|
|
92
|
+
type: N,
|
|
93
|
+
listener: P
|
|
94
|
+
}, I = W.bind(F);
|
|
95
|
+
return I.listener = P, F.wrapFn = I, I;
|
|
96
|
+
}
|
|
97
|
+
z.prototype.once = function(a, N) {
|
|
98
|
+
return V(N), this.on(a, G(this, a, N)), this;
|
|
99
|
+
}, z.prototype.prependOnceListener = function(a, N) {
|
|
100
|
+
return V(N), this.prependListener(a, G(this, a, N)), this;
|
|
101
|
+
}, z.prototype.removeListener = function(a, N) {
|
|
102
|
+
var P, F, I, L, R;
|
|
103
|
+
if (V(N), F = this._events, F === void 0 || (P = F[a], P === void 0)) return this;
|
|
104
|
+
if (P === N || P.listener === N) --this._eventsCount === 0 ? this._events = Object.create(null) : (delete F[a], F.removeListener && this.emit("removeListener", a, P.listener || N));
|
|
105
|
+
else if (typeof P != "function") {
|
|
106
|
+
for (I = -1, L = P.length - 1; L >= 0; L--) if (P[L] === N || P[L].listener === N) {
|
|
107
|
+
R = P[L].listener, I = L;
|
|
108
|
+
break;
|
|
109
|
+
}
|
|
110
|
+
if (I < 0) return this;
|
|
111
|
+
I === 0 ? P.shift() : Y(P, I), P.length === 1 && (F[a] = P[0]), F.removeListener !== void 0 && this.emit("removeListener", a, R || N);
|
|
112
|
+
}
|
|
113
|
+
return this;
|
|
114
|
+
}, z.prototype.off = z.prototype.removeListener, z.prototype.removeAllListeners = function(a) {
|
|
115
|
+
var N, P = this._events, F;
|
|
116
|
+
if (P === void 0) return this;
|
|
117
|
+
if (P.removeListener === void 0) return arguments.length === 0 ? (this._events = Object.create(null), this._eventsCount = 0) : P[a] !== void 0 && (--this._eventsCount === 0 ? this._events = Object.create(null) : delete P[a]), this;
|
|
118
|
+
if (arguments.length === 0) {
|
|
119
|
+
var I = Object.keys(P), L;
|
|
120
|
+
for (F = 0; F < I.length; ++F) L = I[F], L !== "removeListener" && this.removeAllListeners(L);
|
|
121
|
+
return this.removeAllListeners("removeListener"), this._events = Object.create(null), this._eventsCount = 0, this;
|
|
122
|
+
}
|
|
123
|
+
if (N = P[a], typeof N == "function") this.removeListener(a, N);
|
|
124
|
+
else if (N !== void 0) for (F = N.length - 1; F >= 0; F--) this.removeListener(a, N[F]);
|
|
125
|
+
return this;
|
|
126
|
+
};
|
|
127
|
+
function K(a, N, P) {
|
|
128
|
+
var F = a._events;
|
|
129
|
+
if (F === void 0) return [];
|
|
130
|
+
var I = F[N];
|
|
131
|
+
return I === void 0 ? [] : typeof I == "function" ? P ? [I.listener || I] : [I] : P ? X(I) : J(I, I.length);
|
|
132
|
+
}
|
|
133
|
+
z.prototype.listeners = function(a) {
|
|
134
|
+
return K(this, a, !0);
|
|
135
|
+
}, z.prototype.rawListeners = function(a) {
|
|
136
|
+
return K(this, a, !1);
|
|
137
|
+
}, z.listenerCount = function(a, N) {
|
|
138
|
+
return typeof a.listenerCount == "function" ? a.listenerCount(N) : q.call(a, N);
|
|
139
|
+
}, z.prototype.listenerCount = q;
|
|
140
|
+
function q(a) {
|
|
141
|
+
var N = this._events;
|
|
142
|
+
if (N !== void 0) {
|
|
143
|
+
var P = N[a];
|
|
144
|
+
if (typeof P == "function") return 1;
|
|
145
|
+
if (P !== void 0) return P.length;
|
|
146
|
+
}
|
|
147
|
+
return 0;
|
|
148
|
+
}
|
|
149
|
+
z.prototype.eventNames = function() {
|
|
150
|
+
return this._eventsCount > 0 ? I(this._events) : [];
|
|
151
|
+
};
|
|
152
|
+
function J(a, N) {
|
|
153
|
+
for (var P = Array(N), F = 0; F < N; ++F) P[F] = a[F];
|
|
154
|
+
return P;
|
|
155
|
+
}
|
|
156
|
+
function Y(a, N) {
|
|
157
|
+
for (; N + 1 < a.length; N++) a[N] = a[N + 1];
|
|
158
|
+
a.pop();
|
|
159
|
+
}
|
|
160
|
+
function X(a) {
|
|
161
|
+
for (var N = Array(a.length), P = 0; P < N.length; ++P) N[P] = a[P].listener || a[P];
|
|
162
|
+
return N;
|
|
163
|
+
}
|
|
164
|
+
function Z(a, N) {
|
|
165
|
+
return new Promise(function(P, F) {
|
|
166
|
+
function I(P) {
|
|
167
|
+
a.removeListener(N, L), F(P);
|
|
168
|
+
}
|
|
169
|
+
function L() {
|
|
170
|
+
typeof a.removeListener == "function" && a.removeListener("error", I), P([].slice.call(arguments));
|
|
171
|
+
}
|
|
172
|
+
$(a, N, L, { once: !0 }), N !== "error" && Q(a, I, { once: !0 });
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
function Q(a, N, P) {
|
|
176
|
+
typeof a.on == "function" && $(a, "error", N, P);
|
|
177
|
+
}
|
|
178
|
+
function $(a, N, P, F) {
|
|
179
|
+
if (typeof a.on == "function") F.once ? a.once(N, P) : a.on(N, P);
|
|
180
|
+
else if (typeof a.addEventListener == "function") a.addEventListener(N, function I(L) {
|
|
181
|
+
F.once && a.removeEventListener(N, I), P(L);
|
|
182
|
+
});
|
|
183
|
+
else throw TypeError("The \"emitter\" argument must be of type EventEmitter. Received type " + typeof a);
|
|
184
|
+
}
|
|
185
|
+
})))(), 1), __defProp$35 = Object.defineProperty, __defNormalProp$22 = (a, N, P) => N in a ? __defProp$35(a, N, {
|
|
186
|
+
enumerable: !0,
|
|
187
|
+
configurable: !0,
|
|
188
|
+
writable: !0,
|
|
189
|
+
value: P
|
|
190
|
+
}) : a[N] = P, __publicField$22 = (a, N, P) => (__defNormalProp$22(a, typeof N == "symbol" ? N : N + "", P), P), LEVELS_ORDER$13 = [
|
|
191
|
+
"error",
|
|
192
|
+
"ok",
|
|
193
|
+
"warn",
|
|
194
|
+
"flux",
|
|
195
|
+
"deprecated",
|
|
196
|
+
"info",
|
|
197
|
+
"log",
|
|
198
|
+
"debug"
|
|
199
|
+
];
|
|
200
|
+
function isWindowWithWemap$13(a) {
|
|
201
|
+
return "wemap" in a;
|
|
202
|
+
}
|
|
203
|
+
var _Logger$13 = class a {
|
|
204
|
+
static enable(N) {
|
|
205
|
+
a.ENABLED = !!N;
|
|
206
|
+
}
|
|
207
|
+
static level(N) {
|
|
208
|
+
return arguments.length && (a.LOG_LEVEL = N), a.LOG_LEVEL;
|
|
209
|
+
}
|
|
210
|
+
static clearHistory() {
|
|
211
|
+
a.HISTORY = [];
|
|
212
|
+
}
|
|
213
|
+
static _canUseLog(N) {
|
|
214
|
+
let P = LEVELS_ORDER$13.indexOf(N), F = LEVELS_ORDER$13.indexOf(a.LOG_LEVEL);
|
|
215
|
+
return F === -1 ? !1 : P <= F;
|
|
216
|
+
}
|
|
217
|
+
static _getColorByType(a) {
|
|
218
|
+
let N = null;
|
|
219
|
+
switch (a) {
|
|
220
|
+
case "flux":
|
|
221
|
+
N = "background-color: #0083E0; color: #FFFFFF;";
|
|
222
|
+
break;
|
|
223
|
+
case "ok":
|
|
224
|
+
N = "background-color: #00FF22; color: #272727;";
|
|
225
|
+
break;
|
|
226
|
+
case "deprecated":
|
|
227
|
+
N = "background-color: #CA0AFA; color: #FFFFFF;";
|
|
228
|
+
break;
|
|
229
|
+
case "error":
|
|
230
|
+
N = "background-color: #CC0000; color: #FFFFFF;";
|
|
231
|
+
break;
|
|
232
|
+
case "warn":
|
|
233
|
+
N = "background-color: #DD7908; color: #FFFFFF;";
|
|
234
|
+
break;
|
|
235
|
+
case "debug":
|
|
236
|
+
N = "background-color: #999999; color: #FFFFFF;";
|
|
237
|
+
break;
|
|
238
|
+
case "info":
|
|
239
|
+
N = "background-color: #DCFF4E; color: #000000;";
|
|
240
|
+
break;
|
|
241
|
+
default:
|
|
242
|
+
N = "background-color: #F4F4F4; color: #999999;";
|
|
243
|
+
break;
|
|
244
|
+
}
|
|
245
|
+
return N;
|
|
246
|
+
}
|
|
247
|
+
static _getOriginByType(a, N) {
|
|
248
|
+
let P = null, F = null, I = N;
|
|
249
|
+
if (arguments.length < 2) return "";
|
|
250
|
+
try {
|
|
251
|
+
for (P = "", F = a.stack && a.stack.length ? a.stack.split("\n").splice(3) : [], (I < 0 || I >= F.length) && (I = F.length); I;) P += "\r\n " + F[0].trim(), F = F.splice(1), I--;
|
|
252
|
+
return P;
|
|
253
|
+
} catch {
|
|
254
|
+
return "";
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
static _log(N, P, F) {
|
|
258
|
+
let I = "color: auto;", L = "color: #6A6A6A;", R = typeof window < "u", z, B = null, V = null, H = null, U = null, K = "", q = !1;
|
|
259
|
+
if (B = N, U = Error(P), R && (V = a._getColorByType(N)), H = a._getOriginByType(U, F), B === "deprecated" && (B = "warn", q = "deprecated"), R && (H = a._COLOR_TOKEN + H), z = (R ? a._COLOR_TOKEN : "") + " " + U.message, K = R ? a._COLOR_TOKEN : "", K += a._TYPE_PREFIX, K += q || N, K += a._TYPE_SUFFIX, typeof window < "u" && isWindowWithWemap$13(window)) {
|
|
260
|
+
let a = performance && performance.now ? performance.now() : (/* @__PURE__ */ new Date()).getTime();
|
|
261
|
+
K += "[" + Math.round(a - window.wemap.startTime) + "ms]";
|
|
262
|
+
}
|
|
263
|
+
return z = K + z, a.SHOW_ORIGIN && (z += H), a.HISTORY.push(z), !this._canUseLog(N) || arguments.length < 2 || !a.ENABLED ? !1 : (R ? console && N !== "ok" && N !== "flux" && N !== "deprecated" && console[N] && LEVELS_ORDER$13.indexOf(N) <= LEVELS_ORDER$13.indexOf("info") ? console[N](z, V, I, L) : console.log(z, V, I, L) : console.log(z), !0);
|
|
264
|
+
}
|
|
265
|
+
static external(a) {
|
|
266
|
+
return console.log("LIVEMAP :: " + a);
|
|
267
|
+
}
|
|
268
|
+
static flux(N) {
|
|
269
|
+
return a._log("flux", N, 0);
|
|
270
|
+
}
|
|
271
|
+
static ok(N) {
|
|
272
|
+
return a._log("ok", N, 1);
|
|
273
|
+
}
|
|
274
|
+
static error(N, P = -1) {
|
|
275
|
+
return a._log("error", N, P);
|
|
276
|
+
}
|
|
277
|
+
static warn(N, P = 2) {
|
|
278
|
+
return a._log("warn", N, P);
|
|
279
|
+
}
|
|
280
|
+
static deprecated(N, P = 2) {
|
|
281
|
+
return a._log("deprecated", N, P);
|
|
282
|
+
}
|
|
283
|
+
static debug(N, P = -1) {
|
|
284
|
+
return a._log("debug", N, P);
|
|
285
|
+
}
|
|
286
|
+
static info(N, P = 0) {
|
|
287
|
+
return a._log("info", N, P);
|
|
288
|
+
}
|
|
289
|
+
static log(N, P = 1) {
|
|
290
|
+
return a._log("log", N, P);
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
__publicField$22(_Logger$13, "LOG_LEVEL", "debug"), __publicField$22(_Logger$13, "SHOW_ORIGIN", !0), __publicField$22(_Logger$13, "ENABLED", !0), __publicField$22(_Logger$13, "HISTORY", []), __publicField$22(_Logger$13, "_COLOR_TOKEN", "%c"), __publicField$22(_Logger$13, "_TYPE_PREFIX", "<<<< "), __publicField$22(_Logger$13, "_TYPE_SUFFIX", " >>>>");
|
|
294
|
+
var Logger$8 = _Logger$13, e$13 = class a {
|
|
295
|
+
constructor(N, P, F, I, L) {
|
|
296
|
+
this._legacyCanvasSize = a.DEFAULT_CANVAS_SIZE, this._preferredCamera = "environment", this._maxScansPerSecond = 25, this._lastScanTimestamp = -1, this._destroyed = this._flashOn = this._paused = this._active = !1, this.$video = N, this.$canvas = document.createElement("canvas"), F && typeof F == "object" ? this._onDecode = P : (F || I || L ? console.warn("You're using a deprecated version of the QrScanner constructor which will be removed in the future") : console.warn("Note that the type of the scan result passed to onDecode will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."), this._legacyOnDecode = P), P = typeof F == "object" ? F : {}, this._onDecodeError = P.onDecodeError || (typeof F == "function" ? F : this._onDecodeError), this._calculateScanRegion = P.calculateScanRegion || (typeof I == "function" ? I : this._calculateScanRegion), this._preferredCamera = P.preferredCamera || L || this._preferredCamera, this._legacyCanvasSize = typeof F == "number" ? F : typeof I == "number" ? I : this._legacyCanvasSize, this._maxScansPerSecond = P.maxScansPerSecond || this._maxScansPerSecond, this._onPlay = this._onPlay.bind(this), this._onLoadedMetaData = this._onLoadedMetaData.bind(this), this._onVisibilityChange = this._onVisibilityChange.bind(this), this._updateOverlay = this._updateOverlay.bind(this), N.disablePictureInPicture = !0, N.playsInline = !0, N.muted = !0;
|
|
297
|
+
let R = !1;
|
|
298
|
+
if (N.hidden && (N.hidden = !1, R = !0), document.body.contains(N) || (document.body.appendChild(N), R = !0), F = N.parentElement, P.highlightScanRegion || P.highlightCodeOutline) {
|
|
299
|
+
if (I = !!P.overlay, this.$overlay = P.overlay || document.createElement("div"), L = this.$overlay.style, L.position = "absolute", L.display = "none", L.pointerEvents = "none", this.$overlay.classList.add("scan-region-highlight"), !I && P.highlightScanRegion) {
|
|
300
|
+
this.$overlay.innerHTML = "<svg class=\"scan-region-highlight-svg\" viewBox=\"0 0 238 238\" preserveAspectRatio=\"none\" style=\"position:absolute;width:100%;height:100%;left:0;top:0;fill:none;stroke:#e9b213;stroke-width:4;stroke-linecap:round;stroke-linejoin:round\"><path d=\"M31 2H10a8 8 0 0 0-8 8v21M207 2h21a8 8 0 0 1 8 8v21m0 176v21a8 8 0 0 1-8 8h-21m-176 0H10a8 8 0 0 1-8-8v-21\"/></svg>";
|
|
301
|
+
try {
|
|
302
|
+
this.$overlay.firstElementChild.animate({ transform: ["scale(.98)", "scale(1.01)"] }, {
|
|
303
|
+
duration: 400,
|
|
304
|
+
iterations: Infinity,
|
|
305
|
+
direction: "alternate",
|
|
306
|
+
easing: "ease-in-out"
|
|
307
|
+
});
|
|
308
|
+
} catch {}
|
|
309
|
+
F.insertBefore(this.$overlay, this.$video.nextSibling);
|
|
310
|
+
}
|
|
311
|
+
P.highlightCodeOutline && (this.$overlay.insertAdjacentHTML("beforeend", "<svg class=\"code-outline-highlight\" preserveAspectRatio=\"none\" style=\"display:none;width:100%;height:100%;fill:none;stroke:#e9b213;stroke-width:5;stroke-dasharray:25;stroke-linecap:round;stroke-linejoin:round\"><polygon/></svg>"), this.$codeOutlineHighlight = this.$overlay.lastElementChild);
|
|
312
|
+
}
|
|
313
|
+
this._scanRegion = this._calculateScanRegion(N), requestAnimationFrame(() => {
|
|
314
|
+
let a = window.getComputedStyle(N);
|
|
315
|
+
a.display === "none" && (N.style.setProperty("display", "block", "important"), R = !0), a.visibility !== "visible" && (N.style.setProperty("visibility", "visible", "important"), R = !0), R && (console.warn("QrScanner has overwritten the video hiding style to avoid Safari stopping the playback."), N.style.opacity = "0", N.style.width = "0", N.style.height = "0", this.$overlay && this.$overlay.parentElement && this.$overlay.parentElement.removeChild(this.$overlay), delete this.$overlay, delete this.$codeOutlineHighlight), this.$overlay && this._updateOverlay();
|
|
316
|
+
}), N.addEventListener("play", this._onPlay), N.addEventListener("loadedmetadata", this._onLoadedMetaData), document.addEventListener("visibilitychange", this._onVisibilityChange), window.addEventListener("resize", this._updateOverlay), this._qrEnginePromise = a.createQrEngine();
|
|
317
|
+
}
|
|
318
|
+
static set WORKER_PATH(a) {
|
|
319
|
+
console.warn("Setting QrScanner.WORKER_PATH is not required and not supported anymore. Have a look at the README for new setup instructions.");
|
|
320
|
+
}
|
|
321
|
+
static async hasCamera() {
|
|
322
|
+
try {
|
|
323
|
+
return !!(await a.listCameras(!1)).length;
|
|
324
|
+
} catch {
|
|
325
|
+
return !1;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
static async listCameras(N = !1) {
|
|
329
|
+
if (!navigator.mediaDevices) return [];
|
|
330
|
+
let P = async () => (await navigator.mediaDevices.enumerateDevices()).filter((a) => a.kind === "videoinput"), F;
|
|
331
|
+
try {
|
|
332
|
+
N && (await P()).every((a) => !a.label) && (F = await navigator.mediaDevices.getUserMedia({
|
|
333
|
+
audio: !1,
|
|
334
|
+
video: !0
|
|
335
|
+
}));
|
|
336
|
+
} catch {}
|
|
337
|
+
try {
|
|
338
|
+
return (await P()).map((a, N) => ({
|
|
339
|
+
id: a.deviceId,
|
|
340
|
+
label: a.label || (N === 0 ? "Default Camera" : `Camera ${N + 1}`)
|
|
341
|
+
}));
|
|
342
|
+
} finally {
|
|
343
|
+
F && (console.warn("Call listCameras after successfully starting a QR scanner to avoid creating a temporary video stream"), a._stopVideoStream(F));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
async hasFlash() {
|
|
347
|
+
let N;
|
|
348
|
+
try {
|
|
349
|
+
if (this.$video.srcObject) {
|
|
350
|
+
if (!(this.$video.srcObject instanceof MediaStream)) return !1;
|
|
351
|
+
N = this.$video.srcObject;
|
|
352
|
+
} else N = (await this._getCameraStream()).stream;
|
|
353
|
+
return "torch" in N.getVideoTracks()[0].getSettings();
|
|
354
|
+
} catch {
|
|
355
|
+
return !1;
|
|
356
|
+
} finally {
|
|
357
|
+
N && N !== this.$video.srcObject && (console.warn("Call hasFlash after successfully starting the scanner to avoid creating a temporary video stream"), a._stopVideoStream(N));
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
isFlashOn() {
|
|
361
|
+
return this._flashOn;
|
|
362
|
+
}
|
|
363
|
+
async toggleFlash() {
|
|
364
|
+
this._flashOn ? await this.turnFlashOff() : await this.turnFlashOn();
|
|
365
|
+
}
|
|
366
|
+
async turnFlashOn() {
|
|
367
|
+
if (!this._flashOn && !this._destroyed && (this._flashOn = !0, this._active && !this._paused)) try {
|
|
368
|
+
if (!await this.hasFlash()) throw "No flash available";
|
|
369
|
+
await this.$video.srcObject.getVideoTracks()[0].applyConstraints({ advanced: [{ torch: !0 }] });
|
|
370
|
+
} catch (a) {
|
|
371
|
+
throw this._flashOn = !1, a;
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
async turnFlashOff() {
|
|
375
|
+
this._flashOn && (this._flashOn = !1, await this._restartVideoStream());
|
|
376
|
+
}
|
|
377
|
+
destroy() {
|
|
378
|
+
this.$video.removeEventListener("loadedmetadata", this._onLoadedMetaData), this.$video.removeEventListener("play", this._onPlay), document.removeEventListener("visibilitychange", this._onVisibilityChange), window.removeEventListener("resize", this._updateOverlay), this._destroyed = !0, this._flashOn = !1, this.stop(), a._postWorkerMessage(this._qrEnginePromise, "close");
|
|
379
|
+
}
|
|
380
|
+
async start() {
|
|
381
|
+
if (this._destroyed) throw Error("The QR scanner can not be started as it had been destroyed.");
|
|
382
|
+
if ((!this._active || this._paused) && (window.location.protocol !== "https:" && console.warn("The camera stream is only accessible if the page is transferred via https."), this._active = !0, !document.hidden)) if (this._paused = !1, this.$video.srcObject) await this.$video.play();
|
|
383
|
+
else try {
|
|
384
|
+
let { stream: N, facingMode: P } = await this._getCameraStream();
|
|
385
|
+
!this._active || this._paused ? a._stopVideoStream(N) : (this._setVideoMirror(P), this.$video.srcObject = N, await this.$video.play(), this._flashOn && (this._flashOn = !1, this.turnFlashOn().catch(() => {})));
|
|
386
|
+
} catch (a) {
|
|
387
|
+
if (!this._paused) throw this._active = !1, a;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
stop() {
|
|
391
|
+
this.pause(), this._active = !1;
|
|
392
|
+
}
|
|
393
|
+
async pause(N = !1) {
|
|
394
|
+
if (this._paused = !0, !this._active) return !0;
|
|
395
|
+
this.$video.pause(), this.$overlay && (this.$overlay.style.display = "none");
|
|
396
|
+
let P = () => {
|
|
397
|
+
this.$video.srcObject instanceof MediaStream && (a._stopVideoStream(this.$video.srcObject), this.$video.srcObject = null);
|
|
398
|
+
};
|
|
399
|
+
return N ? (P(), !0) : (await new Promise((a) => setTimeout(a, 300)), this._paused ? (P(), !0) : !1);
|
|
400
|
+
}
|
|
401
|
+
async setCamera(a) {
|
|
402
|
+
a !== this._preferredCamera && (this._preferredCamera = a, await this._restartVideoStream());
|
|
403
|
+
}
|
|
404
|
+
static async scanImage(N, P, F, I, L = !1, R = !1) {
|
|
405
|
+
let z, B = !1;
|
|
406
|
+
P && ("scanRegion" in P || "qrEngine" in P || "canvas" in P || "disallowCanvasResizing" in P || "alsoTryWithoutScanRegion" in P || "returnDetailedScanResult" in P) ? (z = P.scanRegion, F = P.qrEngine, I = P.canvas, L = P.disallowCanvasResizing || !1, R = P.alsoTryWithoutScanRegion || !1, B = !0) : P || F || I || L || R ? console.warn("You're using a deprecated api for scanImage which will be removed in the future.") : console.warn("Note that the return type of scanImage will change in the future. To already switch to the new api today, you can pass returnDetailedScanResult: true."), P = !!F;
|
|
407
|
+
try {
|
|
408
|
+
let V, H;
|
|
409
|
+
[F, V] = await Promise.all([F || a.createQrEngine(), a._loadImage(N)]), [I, H] = a._drawToCanvas(V, z, I, L);
|
|
410
|
+
let U;
|
|
411
|
+
if (F instanceof Worker) {
|
|
412
|
+
let N = F;
|
|
413
|
+
P || a._postWorkerMessageSync(N, "inversionMode", "both"), U = await new Promise((P, F) => {
|
|
414
|
+
let L, R, B, V = -1;
|
|
415
|
+
R = (I) => {
|
|
416
|
+
I.data.id === V && (N.removeEventListener("message", R), N.removeEventListener("error", B), clearTimeout(L), I.data.data === null ? F(a.NO_QR_CODE_FOUND) : P({
|
|
417
|
+
data: I.data.data,
|
|
418
|
+
cornerPoints: a._convertPoints(I.data.cornerPoints, z)
|
|
419
|
+
}));
|
|
420
|
+
}, B = (a) => {
|
|
421
|
+
N.removeEventListener("message", R), N.removeEventListener("error", B), clearTimeout(L), F("Scanner error: " + (a ? a.message || a : "Unknown Error"));
|
|
422
|
+
}, N.addEventListener("message", R), N.addEventListener("error", B), L = setTimeout(() => B("timeout"), 1e4);
|
|
423
|
+
let U = H.getImageData(0, 0, I.width, I.height);
|
|
424
|
+
V = a._postWorkerMessageSync(N, "decode", U, [U.data.buffer]);
|
|
425
|
+
});
|
|
426
|
+
} else U = await Promise.race([new Promise((a, N) => window.setTimeout(() => N("Scanner error: timeout"), 1e4)), (async () => {
|
|
427
|
+
try {
|
|
428
|
+
var [P] = await F.detect(I);
|
|
429
|
+
if (!P) throw a.NO_QR_CODE_FOUND;
|
|
430
|
+
return {
|
|
431
|
+
data: P.rawValue,
|
|
432
|
+
cornerPoints: a._convertPoints(P.cornerPoints, z)
|
|
433
|
+
};
|
|
434
|
+
} catch (F) {
|
|
435
|
+
if (P = F.message || F, /not implemented|service unavailable/.test(P)) return a._disableBarcodeDetector = !0, a.scanImage(N, {
|
|
436
|
+
scanRegion: z,
|
|
437
|
+
canvas: I,
|
|
438
|
+
disallowCanvasResizing: L,
|
|
439
|
+
alsoTryWithoutScanRegion: R
|
|
440
|
+
});
|
|
441
|
+
throw `Scanner error: ${P}`;
|
|
442
|
+
}
|
|
443
|
+
})()]);
|
|
444
|
+
return B ? U : U.data;
|
|
445
|
+
} catch (P) {
|
|
446
|
+
if (!z || !R) throw P;
|
|
447
|
+
let V = await a.scanImage(N, {
|
|
448
|
+
qrEngine: F,
|
|
449
|
+
canvas: I,
|
|
450
|
+
disallowCanvasResizing: L
|
|
451
|
+
});
|
|
452
|
+
return B ? V : V.data;
|
|
453
|
+
} finally {
|
|
454
|
+
P || a._postWorkerMessage(F, "close");
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
setGrayscaleWeights(N, P, F, I = !0) {
|
|
458
|
+
a._postWorkerMessage(this._qrEnginePromise, "grayscaleWeights", {
|
|
459
|
+
red: N,
|
|
460
|
+
green: P,
|
|
461
|
+
blue: F,
|
|
462
|
+
useIntegerApproximation: I
|
|
463
|
+
});
|
|
464
|
+
}
|
|
465
|
+
setInversionMode(N) {
|
|
466
|
+
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
467
|
+
}
|
|
468
|
+
static async createQrEngine(N) {
|
|
469
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
470
|
+
let P = navigator.userAgentData;
|
|
471
|
+
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
472
|
+
}
|
|
473
|
+
_onPlay() {
|
|
474
|
+
this._scanRegion = this._calculateScanRegion(this.$video), this._updateOverlay(), this.$overlay && (this.$overlay.style.display = ""), this._scanFrame();
|
|
475
|
+
}
|
|
476
|
+
_onLoadedMetaData() {
|
|
477
|
+
this._scanRegion = this._calculateScanRegion(this.$video), this._updateOverlay();
|
|
478
|
+
}
|
|
479
|
+
_onVisibilityChange() {
|
|
480
|
+
document.hidden ? this.pause() : this._active && this.start();
|
|
481
|
+
}
|
|
482
|
+
_calculateScanRegion(a) {
|
|
483
|
+
let N = Math.round(2 / 3 * Math.min(a.videoWidth, a.videoHeight));
|
|
484
|
+
return {
|
|
485
|
+
x: Math.round((a.videoWidth - N) / 2),
|
|
486
|
+
y: Math.round((a.videoHeight - N) / 2),
|
|
487
|
+
width: N,
|
|
488
|
+
height: N,
|
|
489
|
+
downScaledWidth: this._legacyCanvasSize,
|
|
490
|
+
downScaledHeight: this._legacyCanvasSize
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
_updateOverlay() {
|
|
494
|
+
requestAnimationFrame(() => {
|
|
495
|
+
if (this.$overlay) {
|
|
496
|
+
var a = this.$video, N = a.videoWidth, P = a.videoHeight, F = a.offsetWidth, I = a.offsetHeight, L = a.offsetLeft, R = a.offsetTop, z = window.getComputedStyle(a), B = z.objectFit, V = N / P, H = F / I;
|
|
497
|
+
switch (B) {
|
|
498
|
+
case "none":
|
|
499
|
+
var U = N, W = P;
|
|
500
|
+
break;
|
|
501
|
+
case "fill":
|
|
502
|
+
U = F, W = I;
|
|
503
|
+
break;
|
|
504
|
+
default: (B === "cover" ? V > H : V < H) ? (W = I, U = W * V) : (U = F, W = U / V), B === "scale-down" && (U = Math.min(U, N), W = Math.min(W, P));
|
|
505
|
+
}
|
|
506
|
+
var [G, K] = z.objectPosition.split(" ").map((a, N) => {
|
|
507
|
+
let P = parseFloat(a);
|
|
508
|
+
return a.endsWith("%") ? (N ? I - W : F - U) * P / 100 : P;
|
|
509
|
+
});
|
|
510
|
+
z = this._scanRegion.width || N, H = this._scanRegion.height || P, B = this._scanRegion.x || 0;
|
|
511
|
+
var q = this._scanRegion.y || 0;
|
|
512
|
+
V = this.$overlay.style, V.width = `${z / N * U}px`, V.height = `${H / P * W}px`, V.top = `${R + K + q / P * W}px`, P = /scaleX\(-1\)/.test(a.style.transform), V.left = `${L + (P ? F - G - U : G) + (P ? N - B - z : B) / N * U}px`, V.transform = a.style.transform;
|
|
513
|
+
}
|
|
514
|
+
});
|
|
515
|
+
}
|
|
516
|
+
static _convertPoints(a, N) {
|
|
517
|
+
if (!N) return a;
|
|
518
|
+
let P = N.x || 0, F = N.y || 0, I = N.width && N.downScaledWidth ? N.width / N.downScaledWidth : 1;
|
|
519
|
+
N = N.height && N.downScaledHeight ? N.height / N.downScaledHeight : 1;
|
|
520
|
+
for (let L of a) L.x = L.x * I + P, L.y = L.y * N + F;
|
|
521
|
+
return a;
|
|
522
|
+
}
|
|
523
|
+
_scanFrame() {
|
|
524
|
+
!this._active || this.$video.paused || this.$video.ended || ("requestVideoFrameCallback" in this.$video ? this.$video.requestVideoFrameCallback.bind(this.$video) : requestAnimationFrame)(async () => {
|
|
525
|
+
if (!(1 >= this.$video.readyState)) {
|
|
526
|
+
var N = Date.now() - this._lastScanTimestamp, P = 1e3 / this._maxScansPerSecond;
|
|
527
|
+
N < P && await new Promise((a) => setTimeout(a, P - N)), this._lastScanTimestamp = Date.now();
|
|
528
|
+
try {
|
|
529
|
+
var F = await a.scanImage(this.$video, {
|
|
530
|
+
scanRegion: this._scanRegion,
|
|
531
|
+
qrEngine: this._qrEnginePromise,
|
|
532
|
+
canvas: this.$canvas
|
|
533
|
+
});
|
|
534
|
+
} catch (a) {
|
|
535
|
+
if (!this._active) return;
|
|
536
|
+
this._onDecodeError(a);
|
|
537
|
+
}
|
|
538
|
+
!a._disableBarcodeDetector || await this._qrEnginePromise instanceof Worker || (this._qrEnginePromise = a.createQrEngine()), F ? (this._onDecode ? this._onDecode(F) : this._legacyOnDecode && this._legacyOnDecode(F.data), this.$codeOutlineHighlight && (clearTimeout(this._codeOutlineHighlightRemovalTimeout), this._codeOutlineHighlightRemovalTimeout = void 0, this.$codeOutlineHighlight.setAttribute("viewBox", `${this._scanRegion.x || 0} ${this._scanRegion.y || 0} ${this._scanRegion.width || this.$video.videoWidth} ${this._scanRegion.height || this.$video.videoHeight}`), this.$codeOutlineHighlight.firstElementChild.setAttribute("points", F.cornerPoints.map(({ x: a, y: N }) => `${a},${N}`).join(" ")), this.$codeOutlineHighlight.style.display = "")) : this.$codeOutlineHighlight && !this._codeOutlineHighlightRemovalTimeout && (this._codeOutlineHighlightRemovalTimeout = setTimeout(() => this.$codeOutlineHighlight.style.display = "none", 100));
|
|
539
|
+
}
|
|
540
|
+
this._scanFrame();
|
|
541
|
+
});
|
|
542
|
+
}
|
|
543
|
+
_onDecodeError(N) {
|
|
544
|
+
N !== a.NO_QR_CODE_FOUND && console.log(N);
|
|
545
|
+
}
|
|
546
|
+
async _getCameraStream() {
|
|
547
|
+
if (!navigator.mediaDevices) throw "Camera not found.";
|
|
548
|
+
let a = /^(environment|user)$/.test(this._preferredCamera) ? "facingMode" : "deviceId", N = [
|
|
549
|
+
{ width: { min: 1024 } },
|
|
550
|
+
{ width: { min: 768 } },
|
|
551
|
+
{}
|
|
552
|
+
], P = N.map((N) => Object.assign({}, N, { [a]: { exact: this._preferredCamera } }));
|
|
553
|
+
for (let a of [...P, ...N]) try {
|
|
554
|
+
let N = await navigator.mediaDevices.getUserMedia({
|
|
555
|
+
video: a,
|
|
556
|
+
audio: !1
|
|
557
|
+
});
|
|
558
|
+
return {
|
|
559
|
+
stream: N,
|
|
560
|
+
facingMode: this._getFacingMode(N) || (a.facingMode ? this._preferredCamera : this._preferredCamera === "environment" ? "user" : "environment")
|
|
561
|
+
};
|
|
562
|
+
} catch {}
|
|
563
|
+
throw "Camera not found.";
|
|
564
|
+
}
|
|
565
|
+
async _restartVideoStream() {
|
|
566
|
+
let a = this._paused;
|
|
567
|
+
await this.pause(!0) && !a && this._active && await this.start();
|
|
568
|
+
}
|
|
569
|
+
static _stopVideoStream(a) {
|
|
570
|
+
for (let N of a.getTracks()) N.stop(), a.removeTrack(N);
|
|
571
|
+
}
|
|
572
|
+
_setVideoMirror(a) {
|
|
573
|
+
this.$video.style.transform = "scaleX(" + (a === "user" ? -1 : 1) + ")";
|
|
574
|
+
}
|
|
575
|
+
_getFacingMode(a) {
|
|
576
|
+
return (a = a.getVideoTracks()[0]) ? /rear|back|environment/i.test(a.label) ? "environment" : /front|user|face/i.test(a.label) ? "user" : null : null;
|
|
577
|
+
}
|
|
578
|
+
static _drawToCanvas(a, N, P, F = !1) {
|
|
579
|
+
P ||= document.createElement("canvas");
|
|
580
|
+
let I = N && N.x ? N.x : 0, L = N && N.y ? N.y : 0, R = N && N.width ? N.width : a.videoWidth || a.width, z = N && N.height ? N.height : a.videoHeight || a.height;
|
|
581
|
+
return F || (F = N && N.downScaledWidth ? N.downScaledWidth : R, N = N && N.downScaledHeight ? N.downScaledHeight : z, P.width !== F && (P.width = F), P.height !== N && (P.height = N)), N = P.getContext("2d", { alpha: !1 }), N.imageSmoothingEnabled = !1, N.drawImage(a, I, L, R, z, 0, 0, P.width, P.height), [P, N];
|
|
582
|
+
}
|
|
583
|
+
static async _loadImage(N) {
|
|
584
|
+
if (N instanceof Image) return await a._awaitImageLoad(N), N;
|
|
585
|
+
if (N instanceof HTMLVideoElement || N instanceof HTMLCanvasElement || N instanceof SVGImageElement || "OffscreenCanvas" in window && N instanceof OffscreenCanvas || "ImageBitmap" in window && N instanceof ImageBitmap) return N;
|
|
586
|
+
if (N instanceof File || N instanceof Blob || N instanceof URL || typeof N == "string") {
|
|
587
|
+
let P = new Image();
|
|
588
|
+
P.src = N instanceof File || N instanceof Blob ? URL.createObjectURL(N) : N.toString();
|
|
589
|
+
try {
|
|
590
|
+
return await a._awaitImageLoad(P), P;
|
|
591
|
+
} finally {
|
|
592
|
+
(N instanceof File || N instanceof Blob) && URL.revokeObjectURL(P.src);
|
|
593
|
+
}
|
|
594
|
+
} else throw "Unsupported image type.";
|
|
595
|
+
}
|
|
596
|
+
static async _awaitImageLoad(a) {
|
|
597
|
+
a.complete && a.naturalWidth !== 0 || await new Promise((N, P) => {
|
|
598
|
+
let F = (I) => {
|
|
599
|
+
a.removeEventListener("load", F), a.removeEventListener("error", F), I instanceof ErrorEvent ? P("Image load error") : N();
|
|
600
|
+
};
|
|
601
|
+
a.addEventListener("load", F), a.addEventListener("error", F);
|
|
602
|
+
});
|
|
603
|
+
}
|
|
604
|
+
static async _postWorkerMessage(N, P, F, I) {
|
|
605
|
+
return a._postWorkerMessageSync(await N, P, F, I);
|
|
606
|
+
}
|
|
607
|
+
static _postWorkerMessageSync(N, P, F, I) {
|
|
608
|
+
if (!(N instanceof Worker)) return -1;
|
|
609
|
+
let L = a._workerMessageId++;
|
|
610
|
+
return N.postMessage({
|
|
611
|
+
id: L,
|
|
612
|
+
type: P,
|
|
613
|
+
data: F
|
|
614
|
+
}, I), L;
|
|
615
|
+
}
|
|
616
|
+
};
|
|
617
|
+
e$13.DEFAULT_CANVAS_SIZE = 400, e$13.NO_QR_CODE_FOUND = "No QR code found", e$13._disableBarcodeDetector = !1, e$13._workerMessageId = 0;
|
|
618
|
+
var __defProp$34 = Object.defineProperty, __defNormalProp$21 = (a, N, P) => N in a ? __defProp$34(a, N, {
|
|
619
|
+
enumerable: !0,
|
|
620
|
+
configurable: !0,
|
|
621
|
+
writable: !0,
|
|
622
|
+
value: P
|
|
623
|
+
}) : a[N] = P, __publicField$21 = (a, N, P) => (__defNormalProp$21(a, typeof N == "symbol" ? N : N + "", P), P), SharedCameras$1$8 = new class extends import_events$13.default {
|
|
624
|
+
constructor() {
|
|
625
|
+
super(...arguments), __publicField$21(this, "_list", []);
|
|
626
|
+
}
|
|
627
|
+
_add(a, N) {
|
|
628
|
+
let P = {
|
|
629
|
+
camera: a,
|
|
630
|
+
container: N
|
|
631
|
+
};
|
|
632
|
+
this._list.push(P), this.emit("added", P);
|
|
633
|
+
}
|
|
634
|
+
_remove(a) {
|
|
635
|
+
this._list = this._list.filter(({ camera: N }) => N !== a), this.emit("removed", { camera: a });
|
|
636
|
+
}
|
|
637
|
+
get list() {
|
|
638
|
+
return this._list;
|
|
639
|
+
}
|
|
640
|
+
getCameraByContainer(a) {
|
|
641
|
+
return this._list.find((N) => N.container === a)?.camera || null;
|
|
642
|
+
}
|
|
643
|
+
}();
|
|
644
|
+
function convertFov$7(a, N) {
|
|
645
|
+
return 2 * Math.atan(Math.tan(a / 180 * Math.PI / 2) * N) * 180 / Math.PI;
|
|
646
|
+
}
|
|
647
|
+
function calcDisplayedFov$7(a, N, P) {
|
|
648
|
+
let F = N.videoWidth, I = N.videoHeight;
|
|
649
|
+
if (!F || !I) return null;
|
|
650
|
+
let L = a.offsetWidth, R = a.offsetHeight, z = F / I, B = L / R, V = P, H = convertFov$7(V, z);
|
|
651
|
+
return B < z ? H = convertFov$7(V, B) : V = convertFov$7(H, 1 / B), {
|
|
652
|
+
vertical: V,
|
|
653
|
+
horizontal: H
|
|
654
|
+
};
|
|
655
|
+
}
|
|
656
|
+
var _Camera$8 = class a extends import_events$13.default {
|
|
657
|
+
constructor(N, P = {}) {
|
|
658
|
+
super(), __publicField$21(this, "_userMediaConstraints"), __publicField$21(this, "videoStream", null), __publicField$21(this, "videoContainer"), __publicField$21(this, "videoElement"), __publicField$21(this, "fov", null), __publicField$21(this, "_state", "stopped"), __publicField$21(this, "_hardwareVerticalFov", a.GENERIC_HARDWARE_VERTICAL_FOV), __publicField$21(this, "_resizeOnWindowChange"), __publicField$21(this, "notifyContainerSizeChanged", () => {
|
|
659
|
+
this._resizeElement(), this._computeFov();
|
|
660
|
+
}), __publicField$21(this, "_resizeElement", () => {
|
|
661
|
+
if (!this.videoElement) throw Error("No video element found");
|
|
662
|
+
let a = this.videoElement.videoWidth, N = this.videoElement.videoHeight, P = this.videoContainer.offsetWidth, F = this.videoContainer.offsetHeight, I = a / N;
|
|
663
|
+
if (P / F < I) {
|
|
664
|
+
let a = I * F;
|
|
665
|
+
this.videoElement.style.width = a + "px", this.videoElement.style.marginLeft = -(a - P) / 2 + "px", this.videoElement.style.height = F + "px", this.videoElement.style.marginTop = "0px";
|
|
666
|
+
} else {
|
|
667
|
+
let a = 1 / (I / P);
|
|
668
|
+
this.videoElement.style.height = a + "px", this.videoElement.style.marginTop = -(a - F) / 2 + "px", this.videoElement.style.width = P + "px", this.videoElement.style.marginLeft = "0px";
|
|
669
|
+
}
|
|
670
|
+
}), __publicField$21(this, "_computeFov", () => {
|
|
671
|
+
["stopping", "stopped"].includes(this.state) || (this.fov = calcDisplayedFov$7(this.videoContainer, this.videoElement, this._hardwareVerticalFov), this.emit("fov.changed", this.fov));
|
|
672
|
+
}), P = Object.assign({}, a.DEFAULT_OPTIONS, P), SharedCameras$1$8._add(this, N), this.videoContainer = N, this._resizeOnWindowChange = P.resizeOnWindowChange, this._userMediaConstraints = {
|
|
673
|
+
audio: !1,
|
|
674
|
+
video: {
|
|
675
|
+
facingMode: "environment",
|
|
676
|
+
width: { ideal: P.width },
|
|
677
|
+
height: { ideal: P.height },
|
|
678
|
+
resizeMode: "none"
|
|
679
|
+
}
|
|
680
|
+
}, this.videoContainer.style.overflow = "hidden", this.videoElement = document.createElement("video"), this.videoElement.setAttribute("id", "wemap-camera"), this.videoElement.setAttribute("preload", "none"), this.videoElement.setAttribute("muted", ""), this.videoElement.setAttribute("playsinline", ""), this.videoContainer.appendChild(this.videoElement);
|
|
681
|
+
}
|
|
682
|
+
async start(N) {
|
|
683
|
+
if (this._state === "started" || this._state === "starting") throw Error("Camera is already started");
|
|
684
|
+
this._state === "stopping" && await new Promise((a) => this.once("stopped", a)), this._state = "starting", this.emit("starting"), await a.checkAvailability(), typeof N == "object" && Object.assign(this._userMediaConstraints.video, this._userMediaConstraints.video, N);
|
|
685
|
+
let P = await navigator.mediaDevices.getUserMedia(this._userMediaConstraints);
|
|
686
|
+
this.videoElement.oncanplaythrough = () => this.videoElement.play();
|
|
687
|
+
let F = new Promise((a) => this.videoElement.onloadedmetadata = a);
|
|
688
|
+
this.videoElement.srcObject = this.videoStream = P, await F, this._resizeElement(), this._computeFov(), this._resizeOnWindowChange && window.addEventListener("resize", this.notifyContainerSizeChanged), this._state = "started";
|
|
689
|
+
let I = {
|
|
690
|
+
videoElement: this.videoElement,
|
|
691
|
+
stream: P
|
|
692
|
+
};
|
|
693
|
+
return this.emit("started", I), I;
|
|
694
|
+
}
|
|
695
|
+
async stop() {
|
|
696
|
+
if (this._state === "stopped") throw Error("Camera is already stopped");
|
|
697
|
+
this._state === "starting" && await new Promise((a) => this.once("started", a)), this._state = "stopping", this.emit("stopping"), this.videoStream && this.videoStream.getVideoTracks().forEach((a) => a.stop()), this.videoStream = null, this.videoElement.srcObject = null, this._resizeOnWindowChange && window.removeEventListener("resize", this.notifyContainerSizeChanged), this._state = "stopped", this.emit("stopped");
|
|
698
|
+
}
|
|
699
|
+
release() {
|
|
700
|
+
this.videoContainer.removeChild(this.videoElement), SharedCameras$1$8._remove(this);
|
|
701
|
+
}
|
|
702
|
+
static async checkAvailability(a = !1) {
|
|
703
|
+
if (!navigator.mediaDevices) throw Error("navigator.mediaDevices not present in your browser");
|
|
704
|
+
if (!navigator.mediaDevices.enumerateDevices) throw Error("navigator.mediaDevices.enumerateDevices not present in your browser");
|
|
705
|
+
if (!navigator.mediaDevices.getUserMedia) throw Error("navigator.mediaDevices.getUserMedia not present in your browser");
|
|
706
|
+
if (!(await navigator.mediaDevices.enumerateDevices()).find((a) => a.kind === "videoinput")) throw Error("No camera found");
|
|
707
|
+
a && (await navigator.mediaDevices.getUserMedia({
|
|
708
|
+
audio: !1,
|
|
709
|
+
video: { facingMode: "environment" }
|
|
710
|
+
})).getVideoTracks().forEach((a) => a.stop());
|
|
711
|
+
}
|
|
712
|
+
get state() {
|
|
713
|
+
return this._state;
|
|
714
|
+
}
|
|
715
|
+
get hardwareVerticalFov() {
|
|
716
|
+
return this._hardwareVerticalFov;
|
|
717
|
+
}
|
|
718
|
+
set hardwareVerticalFov(a) {
|
|
719
|
+
this._hardwareVerticalFov = a, this._computeFov();
|
|
720
|
+
}
|
|
721
|
+
get currentImage() {
|
|
722
|
+
if (this._state !== "started") return Logger$8.warn("Trying to access image but video is not started"), Promise.resolve(null);
|
|
723
|
+
let { videoWidth: a, videoHeight: N } = this.videoElement, P = document.createElement("canvas"), F = P.getContext("2d");
|
|
724
|
+
return P.width = a, P.height = N, F?.drawImage(this.videoElement, 0, 0, a, N), Promise.resolve(P);
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
__publicField$21(_Camera$8, "DEFAULT_OPTIONS", {
|
|
728
|
+
width: 1024,
|
|
729
|
+
height: 768,
|
|
730
|
+
resizeOnWindowChange: !1
|
|
731
|
+
}), __publicField$21(_Camera$8, "GENERIC_HARDWARE_VERTICAL_FOV", 60);
|
|
732
|
+
var Camera = _Camera$8, __create$12 = Object.create, __defProp$33 = Object.defineProperty, __getOwnPropDesc$12 = Object.getOwnPropertyDescriptor, __getOwnPropNames$12 = Object.getOwnPropertyNames, __getProtoOf$12 = Object.getPrototypeOf, __hasOwnProp$12 = Object.prototype.hasOwnProperty, __commonJSMin$12 = (a, N) => () => (N || a((N = { exports: {} }).exports, N), N.exports), __copyProps$12 = (a, N, P, F) => {
|
|
733
|
+
if (N && typeof N == "object" || typeof N == "function") for (var I = __getOwnPropNames$12(N), L = 0, R = I.length, z; L < R; L++) z = I[L], !__hasOwnProp$12.call(a, z) && z !== P && __defProp$33(a, z, {
|
|
734
|
+
get: ((a) => N[a]).bind(null, z),
|
|
735
|
+
enumerable: !(F = __getOwnPropDesc$12(N, z)) || F.enumerable
|
|
736
|
+
});
|
|
737
|
+
return a;
|
|
738
|
+
}, import_events$12 = /* @__PURE__ */ ((a, N, P) => (P = a == null ? {} : __create$12(__getProtoOf$12(a)), __copyProps$12(N || !a || !a.__esModule ? __defProp$33(P, "default", {
|
|
739
|
+
value: a,
|
|
740
|
+
enumerable: !0
|
|
741
|
+
}) : P, a)))((/* @__PURE__ */ __commonJSMin$12(((a, N) => {
|
|
11
742
|
var P = typeof Reflect == "object" ? Reflect : null, F = P && typeof P.apply == "function" ? P.apply : function(a, N, P) {
|
|
12
743
|
return Function.prototype.apply.call(a, N, P);
|
|
13
744
|
}, I = P && typeof P.ownKeys == "function" ? P.ownKeys : Object.getOwnPropertySymbols ? function(a) {
|
|
@@ -255,12 +986,12 @@ var _Logger$12 = class a {
|
|
|
255
986
|
}
|
|
256
987
|
}
|
|
257
988
|
static _log(N, P, F) {
|
|
258
|
-
let I = "color: auto;", L = "color: #6A6A6A;", R = typeof window < "u", z, B = null, V = null, H = null, U = null,
|
|
259
|
-
if (B = N, U = Error(P), R && (V = a._getColorByType(N)), H = a._getOriginByType(U, F), B === "deprecated" && (B = "warn",
|
|
989
|
+
let I = "color: auto;", L = "color: #6A6A6A;", R = typeof window < "u", z, B = null, V = null, H = null, U = null, W = "", G = !1;
|
|
990
|
+
if (B = N, U = Error(P), R && (V = a._getColorByType(N)), H = a._getOriginByType(U, F), B === "deprecated" && (B = "warn", G = "deprecated"), R && (H = a._COLOR_TOKEN + H), z = (R ? a._COLOR_TOKEN : "") + " " + U.message, W = R ? a._COLOR_TOKEN : "", W += a._TYPE_PREFIX, W += G || N, W += a._TYPE_SUFFIX, typeof window < "u" && isWindowWithWemap$12(window)) {
|
|
260
991
|
let a = performance && performance.now ? performance.now() : (/* @__PURE__ */ new Date()).getTime();
|
|
261
|
-
|
|
992
|
+
W += "[" + Math.round(a - window.wemap.startTime) + "ms]";
|
|
262
993
|
}
|
|
263
|
-
return z =
|
|
994
|
+
return z = W + z, a.SHOW_ORIGIN && (z += H), a.HISTORY.push(z), !this._canUseLog(N) || arguments.length < 2 || !a.ENABLED ? !1 : (R ? console && N !== "ok" && N !== "flux" && N !== "deprecated" && console[N] && LEVELS_ORDER$12.indexOf(N) <= LEVELS_ORDER$12.indexOf("info") ? console[N](z, V, I, L) : console.log(z, V, I, L) : console.log(z), !0);
|
|
264
995
|
}
|
|
265
996
|
static external(a) {
|
|
266
997
|
return console.log("LIVEMAP :: " + a);
|
|
@@ -466,7 +1197,7 @@ var Logger$7 = _Logger$12, e$12 = class a {
|
|
|
466
1197
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
467
1198
|
}
|
|
468
1199
|
static async createQrEngine(N) {
|
|
469
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
1200
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-_S92d2eo.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
470
1201
|
let P = navigator.userAgentData;
|
|
471
1202
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
472
1203
|
}
|
|
@@ -729,7 +1460,7 @@ __publicField$19(_Camera$7, "DEFAULT_OPTIONS", {
|
|
|
729
1460
|
height: 768,
|
|
730
1461
|
resizeOnWindowChange: !1
|
|
731
1462
|
}), __publicField$19(_Camera$7, "GENERIC_HARDWARE_VERTICAL_FOV", 60);
|
|
732
|
-
var Camera = _Camera$7, __create$11 = Object.create, __defProp$30 = Object.defineProperty, __getOwnPropDesc$11 = Object.getOwnPropertyDescriptor, __getOwnPropNames$11 = Object.getOwnPropertyNames, __getProtoOf$11 = Object.getPrototypeOf, __hasOwnProp$11 = Object.prototype.hasOwnProperty, __commonJSMin$11 = (a, N) => () => (N || a((N = { exports: {} }).exports, N), N.exports), __copyProps$11 = (a, N, P, F) => {
|
|
1463
|
+
var Camera$1 = _Camera$7, __create$11 = Object.create, __defProp$30 = Object.defineProperty, __getOwnPropDesc$11 = Object.getOwnPropertyDescriptor, __getOwnPropNames$11 = Object.getOwnPropertyNames, __getProtoOf$11 = Object.getPrototypeOf, __hasOwnProp$11 = Object.prototype.hasOwnProperty, __commonJSMin$11 = (a, N) => () => (N || a((N = { exports: {} }).exports, N), N.exports), __copyProps$11 = (a, N, P, F) => {
|
|
733
1464
|
if (N && typeof N == "object" || typeof N == "function") for (var I = __getOwnPropNames$11(N), L = 0, R = I.length, z; L < R; L++) z = I[L], !__hasOwnProp$11.call(a, z) && z !== P && __defProp$30(a, z, {
|
|
734
1465
|
get: ((a) => N[a]).bind(null, z),
|
|
735
1466
|
enumerable: !(F = __getOwnPropDesc$11(N, z)) || F.enumerable
|
|
@@ -1197,7 +1928,7 @@ var Logger$6 = _Logger$11, e$11 = class a {
|
|
|
1197
1928
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
1198
1929
|
}
|
|
1199
1930
|
static async createQrEngine(N) {
|
|
1200
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-DbljhPN5.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
1931
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-DbljhPN5-CYU469PN.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
1201
1932
|
let P = navigator.userAgentData;
|
|
1202
1933
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
1203
1934
|
}
|
|
@@ -1460,7 +2191,7 @@ __publicField$17(_Camera$6, "DEFAULT_OPTIONS", {
|
|
|
1460
2191
|
height: 768,
|
|
1461
2192
|
resizeOnWindowChange: !1
|
|
1462
2193
|
}), __publicField$17(_Camera$6, "GENERIC_HARDWARE_VERTICAL_FOV", 60);
|
|
1463
|
-
var
|
|
2194
|
+
var __create$10 = Object.create, __defProp$27 = Object.defineProperty, __getOwnPropDesc$10 = Object.getOwnPropertyDescriptor, __getOwnPropNames$10 = Object.getOwnPropertyNames, __getProtoOf$10 = Object.getPrototypeOf, __hasOwnProp$10 = Object.prototype.hasOwnProperty, __commonJSMin$10 = (a, N) => () => (N || a((N = { exports: {} }).exports, N), N.exports), __copyProps$10 = (a, N, P, F) => {
|
|
1464
2195
|
if (N && typeof N == "object" || typeof N == "function") for (var I = __getOwnPropNames$10(N), L = 0, R = I.length, z; L < R; L++) z = I[L], !__hasOwnProp$10.call(a, z) && z !== P && __defProp$27(a, z, {
|
|
1465
2196
|
get: ((a) => N[a]).bind(null, z),
|
|
1466
2197
|
enumerable: !(F = __getOwnPropDesc$10(N, z)) || F.enumerable
|
|
@@ -1928,7 +2659,7 @@ var Logger$5 = _Logger$10, e$10 = class a {
|
|
|
1928
2659
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
1929
2660
|
}
|
|
1930
2661
|
static async createQrEngine(N) {
|
|
1931
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-B6z5WmOC-CssviUfq.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
2662
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-B6z5WmOC-CssviUfq-WoU50ICk.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
1932
2663
|
let P = navigator.userAgentData;
|
|
1933
2664
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
1934
2665
|
}
|
|
@@ -2659,7 +3390,7 @@ var Logger$4 = _Logger$9, e$9 = class a {
|
|
|
2659
3390
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
2660
3391
|
}
|
|
2661
3392
|
static async createQrEngine(N) {
|
|
2662
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-CYEYInSi-CIq73T7I-Dk6KCulN.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
3393
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-CYEYInSi-CIq73T7I-Dk6KCulN-CfhhXRKC.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
2663
3394
|
let P = navigator.userAgentData;
|
|
2664
3395
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
2665
3396
|
}
|
|
@@ -3390,7 +4121,7 @@ var Logger$2 = _Logger$8, e$8 = class a {
|
|
|
3390
4121
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
3391
4122
|
}
|
|
3392
4123
|
static async createQrEngine(N) {
|
|
3393
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-BRbiAMv9-nmIQ9hck-C6vs_IbV-DSY4QR6D.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
4124
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-BRbiAMv9-nmIQ9hck-C6vs_IbV-DSY4QR6D-CnoDIvXf.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
3394
4125
|
let P = navigator.userAgentData;
|
|
3395
4126
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
3396
4127
|
}
|
|
@@ -4121,7 +4852,7 @@ var Logger$1 = _Logger$7, e$7 = class a {
|
|
|
4121
4852
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
4122
4853
|
}
|
|
4123
4854
|
static async createQrEngine(N) {
|
|
4124
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-CBTRGYa--CBfOUkyb-qo3X-B_9-BkjDc6vN-ypRw_IJJ.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
4855
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-CBTRGYa--CBfOUkyb-qo3X-B_9-BkjDc6vN-ypRw_IJJ-BRLUJ_Zp.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
4125
4856
|
let P = navigator.userAgentData;
|
|
4126
4857
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
4127
4858
|
}
|
|
@@ -4852,7 +5583,7 @@ var Logger$3 = _Logger$6, e$6 = class a {
|
|
|
4852
5583
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
4853
5584
|
}
|
|
4854
5585
|
static async createQrEngine(N) {
|
|
4855
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-B5PB_bz0-DA0kiTSy-NorQ2854-BMBKUWY9-BoVZZTXJ-CkGuQIJj.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
5586
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-B5PB_bz0-DA0kiTSy-NorQ2854-BMBKUWY9-BoVZZTXJ-CkGuQIJj-C1xdpcCt.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
4856
5587
|
let P = navigator.userAgentData;
|
|
4857
5588
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
4858
5589
|
}
|
|
@@ -5601,7 +6332,7 @@ var e$5 = class a {
|
|
|
5601
6332
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
5602
6333
|
}
|
|
5603
6334
|
static async createQrEngine(N) {
|
|
5604
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-zOsA9GqL-spdHzETc-CdfYQy09-yymxaPor-DcsJbmYs-CbrIyAqr-Cmnj38L_.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
6335
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-zOsA9GqL-spdHzETc-CdfYQy09-yymxaPor-DcsJbmYs-CbrIyAqr-Cmnj38L_-Bf4ha183.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
5605
6336
|
let P = navigator.userAgentData;
|
|
5606
6337
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
5607
6338
|
}
|
|
@@ -6240,7 +6971,7 @@ var e$4 = class a {
|
|
|
6240
6971
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
6241
6972
|
}
|
|
6242
6973
|
static async createQrEngine(N) {
|
|
6243
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-DAbG1qpa-DsmIQ1ZR-D0bKFp24-Bgg9_K2D-CzQjeLnK-Crw_pXOi-CxBZ0nTY-79jwfh5Z.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
6974
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-DAbG1qpa-DsmIQ1ZR-D0bKFp24-Bgg9_K2D-CzQjeLnK-Crw_pXOi-CxBZ0nTY-79jwfh5Z-k6MMnk2_.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
6244
6975
|
let P = navigator.userAgentData;
|
|
6245
6976
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
6246
6977
|
}
|
|
@@ -6879,7 +7610,7 @@ var e$3 = class a {
|
|
|
6879
7610
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
6880
7611
|
}
|
|
6881
7612
|
static async createQrEngine(N) {
|
|
6882
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-BasYyBmn-Sg4PHYpX-k03AL3XJ-Cgjn176v-CDYp3S06-DEPW_gy0-CqeOxb0L-BxEDkksK-Cp-a8RPF.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
7613
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-BasYyBmn-Sg4PHYpX-k03AL3XJ-Cgjn176v-CDYp3S06-DEPW_gy0-CqeOxb0L-BxEDkksK-Cp-a8RPF-DW9Q9STO.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
6883
7614
|
let P = navigator.userAgentData;
|
|
6884
7615
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
6885
7616
|
}
|
|
@@ -7514,7 +8245,7 @@ var e$2 = class a {
|
|
|
7514
8245
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
7515
8246
|
}
|
|
7516
8247
|
static async createQrEngine(N) {
|
|
7517
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-BQGmnbPC-DnOUafgV-DWpsR0Js-ZZGQKBrC-DOG-01---DWmsTSae-B_rE_zzG-BqVqc5W7-Hoirdoyc-Dogb-sTf.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
8248
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-BQGmnbPC-DnOUafgV-DWpsR0Js-ZZGQKBrC-DOG-01---DWmsTSae-B_rE_zzG-BqVqc5W7-Hoirdoyc-Dogb-sTf-zMGKmdcK.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
7518
8249
|
let P = navigator.userAgentData;
|
|
7519
8250
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
7520
8251
|
}
|
|
@@ -8149,7 +8880,7 @@ var e$1 = class a {
|
|
|
8149
8880
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
8150
8881
|
}
|
|
8151
8882
|
static async createQrEngine(N) {
|
|
8152
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-Bej9J3jZ-LIy5T9qw-B5AD_dxc-vFmEZ9Jc-C18UJXmQ-ByBto5KP-DEO_S4_W-BWRiSO9N-BBjAeT1B-DH0W8Rxm-D2jL_VRE.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
8883
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-Bej9J3jZ-LIy5T9qw-B5AD_dxc-vFmEZ9Jc-C18UJXmQ-ByBto5KP-DEO_S4_W-BWRiSO9N-BBjAeT1B-DH0W8Rxm-D2jL_VRE-BZHx-RAo.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
8153
8884
|
let P = navigator.userAgentData;
|
|
8154
8885
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
8155
8886
|
}
|
|
@@ -8766,7 +9497,7 @@ var Logger = _Logger, e = class a {
|
|
|
8766
9497
|
a._postWorkerMessage(this._qrEnginePromise, "inversionMode", N);
|
|
8767
9498
|
}
|
|
8768
9499
|
static async createQrEngine(N) {
|
|
8769
|
-
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-j4KIyzGW-CtZ2H-uq-BsxRIRJ2-B58mXfMr-CY7U-8le-BqjFedsp-DkEzaBUL-DmYDsfTA-OFT0YV77-CQI-j0E8-8Zc4Heoq-Bn1EU35u.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
9500
|
+
if (N && console.warn("Specifying a worker path is not required and not supported anymore."), N = () => import("./qr-scanner-worker.min-CdBZO1_x-j4KIyzGW-CtZ2H-uq-BsxRIRJ2-B58mXfMr-CY7U-8le-BqjFedsp-DkEzaBUL-DmYDsfTA-OFT0YV77-CQI-j0E8-8Zc4Heoq-Bn1EU35u-Dy4zAK44.js").then((a) => a.createWorker()), !(!a._disableBarcodeDetector && "BarcodeDetector" in window && BarcodeDetector.getSupportedFormats && (await BarcodeDetector.getSupportedFormats()).includes("qr_code"))) return N();
|
|
8770
9501
|
let P = navigator.userAgentData;
|
|
8771
9502
|
return P && P.brands.some(({ brand: a }) => /Chromium/i.test(a)) && /mac ?OS/i.test(P.platform) && await P.getHighEntropyValues(["architecture", "platformVersion"]).then(({ architecture: a, platformVersion: N }) => /arm/i.test(a || "arm") && 13 <= parseInt(N || "13")).catch(() => !0) ? N() : new BarcodeDetector({ formats: ["qr_code"] });
|
|
8772
9503
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var createWorker = () => new Worker(URL.createObjectURL(new Blob(["class x{constructor(a,b){this.width=b;this.height=a.length/b;this.data=a}static createEmpty(a,b){return new x(new Uint8ClampedArray(a*b),a)}get(a,b){return 0>a||a>=this.width||0>b||b>=this.height?!1:!!this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c?1:0}setRegion(a,b,c,d,e){for(let f=b;f<b+d;f++)for(let g=a;g<a+c;g++)this.set(g,f,!!e)}}\nclass A{constructor(a,b,c){this.width=a;a*=b;if(c&&c.length!==a)throw Error(\"Wrong buffer size\");this.data=c||new Uint8ClampedArray(a)}get(a,b){return this.data[b*this.width+a]}set(a,b,c){this.data[b*this.width+a]=c}}\nclass ba{constructor(a){this.bitOffset=this.byteOffset=0;this.bytes=a}readBits(a){if(1>a||32<a||a>this.available())throw Error(\"Cannot read \"+a.toString()+\" bits\");var b=0;if(0<this.bitOffset){b=8-this.bitOffset;var c=a<b?a:b;b-=c;b=(this.bytes[this.byteOffset]&255>>8-c<<b)>>b;a-=c;this.bitOffset+=c;8===this.bitOffset&&(this.bitOffset=0,this.byteOffset++)}if(0<a){for(;8<=a;)b=b<<8|this.bytes[this.byteOffset]&255,this.byteOffset++,a-=8;0<a&&(c=8-a,b=b<<a|(this.bytes[this.byteOffset]&255>>c<<c)>>c,\nthis.bitOffset+=a)}return b}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var B,C=B||(B={});C.Numeric=\"numeric\";C.Alphanumeric=\"alphanumeric\";C.Byte=\"byte\";C.Kanji=\"kanji\";C.ECI=\"eci\";C.StructuredAppend=\"structuredappend\";var D,E=D||(D={});E[E.Terminator=0]=\"Terminator\";E[E.Numeric=1]=\"Numeric\";E[E.Alphanumeric=2]=\"Alphanumeric\";E[E.Byte=4]=\"Byte\";E[E.Kanji=8]=\"Kanji\";E[E.ECI=7]=\"ECI\";E[E.StructuredAppend=3]=\"StructuredAppend\";let F=\"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:\".split(\"\");\nfunction ca(a,b){let c=[],d=\"\";b=a.readBits([8,16,16][b]);for(let e=0;e<b;e++){let f=a.readBits(8);c.push(f)}try{d+=decodeURIComponent(c.map(e=>`%${(\"0\"+e.toString(16)).substr(-2)}`).join(\"\"))}catch(e){}return{bytes:c,text:d}}\nfunction da(a,b){a=new ba(a);let c=9>=b?0:26>=b?1:2;for(b={text:\"\",bytes:[],chunks:[],version:b};4<=a.available();){var d=a.readBits(4);if(d===D.Terminator)return b;if(d===D.ECI)0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(7)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(14)}):0===a.readBits(1)?b.chunks.push({type:B.ECI,assignmentNumber:a.readBits(21)}):b.chunks.push({type:B.ECI,assignmentNumber:-1});else if(d===D.Numeric){var e=a,f=[];d=\"\";for(var g=\ne.readBits([10,12,14][c]);3<=g;){var h=e.readBits(10);if(1E3<=h)throw Error(\"Invalid numeric value above 999\");var k=Math.floor(h/100),m=Math.floor(h/10)%10;h%=10;f.push(48+k,48+m,48+h);d+=k.toString()+m.toString()+h.toString();g-=3}if(2===g){g=e.readBits(7);if(100<=g)throw Error(\"Invalid numeric value above 99\");e=Math.floor(g/10);g%=10;f.push(48+e,48+g);d+=e.toString()+g.toString()}else if(1===g){e=e.readBits(4);if(10<=e)throw Error(\"Invalid numeric value above 9\");f.push(48+e);d+=e.toString()}b.text+=\nd;b.bytes.push(...f);b.chunks.push({type:B.Numeric,text:d})}else if(d===D.Alphanumeric){e=a;f=[];d=\"\";for(g=e.readBits([9,11,13][c]);2<=g;)m=e.readBits(11),k=Math.floor(m/45),m%=45,f.push(F[k].charCodeAt(0),F[m].charCodeAt(0)),d+=F[k]+F[m],g-=2;1===g&&(e=e.readBits(6),f.push(F[e].charCodeAt(0)),d+=F[e]);b.text+=d;b.bytes.push(...f);b.chunks.push({type:B.Alphanumeric,text:d})}else if(d===D.Byte)d=ca(a,c),b.text+=d.text,b.bytes.push(...d.bytes),b.chunks.push({type:B.Byte,bytes:d.bytes,text:d.text});\nelse if(d===D.Kanji){f=a;d=[];e=f.readBits([8,10,12][c]);for(g=0;g<e;g++)k=f.readBits(13),k=Math.floor(k/192)<<8|k%192,k=7936>k?k+33088:k+49472,d.push(k>>8,k&255);f=(new TextDecoder(\"shift-jis\")).decode(Uint8Array.from(d));b.text+=f;b.bytes.push(...d);b.chunks.push({type:B.Kanji,bytes:d,text:f})}else d===D.StructuredAppend&&b.chunks.push({type:B.StructuredAppend,currentSequence:a.readBits(4),totalSequence:a.readBits(4),parity:a.readBits(8)})}if(0===a.available()||0===a.readBits(a.available()))return b}\nclass G{constructor(a,b){if(0===b.length)throw Error(\"No coefficients.\");this.field=a;let c=b.length;if(1<c&&0===b[0]){let d=1;for(;d<c&&0===b[d];)d++;if(d===c)this.coefficients=a.zero.coefficients;else for(this.coefficients=new Uint8ClampedArray(c-d),a=0;a<this.coefficients.length;a++)this.coefficients[a]=b[d+a]}else this.coefficients=b}degree(){return this.coefficients.length-1}isZero(){return 0===this.coefficients[0]}getCoefficient(a){return this.coefficients[this.coefficients.length-1-a]}addOrSubtract(a){if(this.isZero())return a;\nif(a.isZero())return this;let b=this.coefficients;a=a.coefficients;b.length>a.length&&([b,a]=[a,b]);let c=new Uint8ClampedArray(a.length),d=a.length-b.length;for(var e=0;e<d;e++)c[e]=a[e];for(e=d;e<a.length;e++)c[e]=b[e-d]^a[e];return new G(this.field,c)}multiply(a){if(0===a)return this.field.zero;if(1===a)return this;let b=this.coefficients.length,c=new Uint8ClampedArray(b);for(let d=0;d<b;d++)c[d]=this.field.multiply(this.coefficients[d],a);return new G(this.field,c)}multiplyPoly(a){if(this.isZero()||\na.isZero())return this.field.zero;let b=this.coefficients,c=b.length;a=a.coefficients;let d=a.length,e=new Uint8ClampedArray(c+d-1);for(let f=0;f<c;f++){let g=b[f];for(let h=0;h<d;h++)e[f+h]=H(e[f+h],this.field.multiply(g,a[h]))}return new G(this.field,e)}multiplyByMonomial(a,b){if(0>a)throw Error(\"Invalid degree less than 0\");if(0===b)return this.field.zero;let c=this.coefficients.length;a=new Uint8ClampedArray(c+a);for(let d=0;d<c;d++)a[d]=this.field.multiply(this.coefficients[d],b);return new G(this.field,\na)}evaluateAt(a){let b=0;if(0===a)return this.getCoefficient(0);let c=this.coefficients.length;if(1===a)return this.coefficients.forEach(d=>{b^=d}),b;b=this.coefficients[0];for(let d=1;d<c;d++)b=H(this.field.multiply(a,b),this.coefficients[d]);return b}}function H(a,b){return a^b}\nclass ea{constructor(a,b,c){this.primitive=a;this.size=b;this.generatorBase=c;this.expTable=Array(this.size);this.logTable=Array(this.size);a=1;for(b=0;b<this.size;b++)this.expTable[b]=a,a*=2,a>=this.size&&(a=(a^this.primitive)&this.size-1);for(a=0;a<this.size-1;a++)this.logTable[this.expTable[a]]=a;this.zero=new G(this,Uint8ClampedArray.from([0]));this.one=new G(this,Uint8ClampedArray.from([1]))}multiply(a,b){return 0===a||0===b?0:this.expTable[(this.logTable[a]+this.logTable[b])%(this.size-1)]}inverse(a){if(0===\na)throw Error(\"Can't invert 0\");return this.expTable[this.size-this.logTable[a]-1]}buildMonomial(a,b){if(0>a)throw Error(\"Invalid monomial degree less than 0\");if(0===b)return this.zero;a=new Uint8ClampedArray(a+1);a[0]=b;return new G(this,a)}log(a){if(0===a)throw Error(\"Can't take log(0)\");return this.logTable[a]}exp(a){return this.expTable[a]}}\nfunction fa(a,b,c,d){b.degree()<c.degree()&&([b,c]=[c,b]);let e=a.zero;for(var f=a.one;c.degree()>=d/2;){var g=b;let h=e;b=c;e=f;if(b.isZero())return null;c=g;f=a.zero;g=b.getCoefficient(b.degree());for(g=a.inverse(g);c.degree()>=b.degree()&&!c.isZero();){let k=c.degree()-b.degree(),m=a.multiply(c.getCoefficient(c.degree()),g);f=f.addOrSubtract(a.buildMonomial(k,m));c=c.addOrSubtract(b.multiplyByMonomial(k,m))}f=f.multiplyPoly(e).addOrSubtract(h);if(c.degree()>=b.degree())return null}d=f.getCoefficient(0);\nif(0===d)return null;a=a.inverse(d);return[f.multiply(a),c.multiply(a)]}\nfunction ha(a,b){let c=new Uint8ClampedArray(a.length);c.set(a);a=new ea(285,256,0);var d=new G(a,c),e=new Uint8ClampedArray(b),f=!1;for(var g=0;g<b;g++){var h=d.evaluateAt(a.exp(g+a.generatorBase));e[e.length-1-g]=h;0!==h&&(f=!0)}if(!f)return c;d=new G(a,e);d=fa(a,a.buildMonomial(b,1),d,b);if(null===d)return null;b=d[0];g=b.degree();if(1===g)b=[b.getCoefficient(1)];else{e=Array(g);f=0;for(h=1;h<a.size&&f<g;h++)0===b.evaluateAt(h)&&(e[f]=a.inverse(h),f++);b=f!==g?null:e}if(null==b)return null;e=d[1];\nf=b.length;d=Array(f);for(g=0;g<f;g++){h=a.inverse(b[g]);let k=1;for(let m=0;m<f;m++)g!==m&&(k=a.multiply(k,H(1,a.multiply(b[m],h))));d[g]=a.multiply(e.evaluateAt(h),a.inverse(k));0!==a.generatorBase&&(d[g]=a.multiply(d[g],h))}for(e=0;e<b.length;e++){f=c.length-1-a.log(b[e]);if(0>f)return null;c[f]^=d[e]}return c}\nlet I=[{infoBits:null,versionNumber:1,alignmentPatternCenters:[],errorCorrectionLevels:[{ecCodewordsPerBlock:7,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:13,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:13}]},{ecCodewordsPerBlock:17,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:9}]}]},{infoBits:null,versionNumber:2,alignmentPatternCenters:[6,18],errorCorrectionLevels:[{ecCodewordsPerBlock:10,ecBlocks:[{numBlocks:1,\ndataCodewordsPerBlock:34}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:28}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:16}]}]},{infoBits:null,versionNumber:3,alignmentPatternCenters:[6,22],errorCorrectionLevels:[{ecCodewordsPerBlock:15,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:55}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:18,\necBlocks:[{numBlocks:2,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:13}]}]},{infoBits:null,versionNumber:4,alignmentPatternCenters:[6,26],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:80}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:32}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:9}]}]},\n{infoBits:null,versionNumber:5,alignmentPatternCenters:[6,30],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:43}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:11},{numBlocks:2,dataCodewordsPerBlock:12}]}]},{infoBits:null,versionNumber:6,alignmentPatternCenters:[6,\n34],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68}]},{ecCodewordsPerBlock:16,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:27}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:31892,versionNumber:7,alignmentPatternCenters:[6,22,38],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:78}]},{ecCodewordsPerBlock:18,\necBlocks:[{numBlocks:4,dataCodewordsPerBlock:31}]},{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:13},{numBlocks:1,dataCodewordsPerBlock:14}]}]},{infoBits:34236,versionNumber:8,alignmentPatternCenters:[6,24,42],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:97}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:38},\n{numBlocks:2,dataCodewordsPerBlock:39}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:18},{numBlocks:2,dataCodewordsPerBlock:19}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:14},{numBlocks:2,dataCodewordsPerBlock:15}]}]},{infoBits:39577,versionNumber:9,alignmentPatternCenters:[6,26,46],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:36},\n{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:12},{numBlocks:4,dataCodewordsPerBlock:13}]}]},{infoBits:42195,versionNumber:10,alignmentPatternCenters:[6,28,50],errorCorrectionLevels:[{ecCodewordsPerBlock:18,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:68},{numBlocks:2,dataCodewordsPerBlock:69}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,\ndataCodewordsPerBlock:43},{numBlocks:1,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:15},{numBlocks:2,dataCodewordsPerBlock:16}]}]},{infoBits:48118,versionNumber:11,alignmentPatternCenters:[6,30,54],errorCorrectionLevels:[{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:81}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,\ndataCodewordsPerBlock:50},{numBlocks:4,dataCodewordsPerBlock:51}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:22},{numBlocks:4,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:12},{numBlocks:8,dataCodewordsPerBlock:13}]}]},{infoBits:51042,versionNumber:12,alignmentPatternCenters:[6,32,58],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:92},{numBlocks:2,dataCodewordsPerBlock:93}]},\n{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:36},{numBlocks:2,dataCodewordsPerBlock:37}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:20},{numBlocks:6,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:14},{numBlocks:4,dataCodewordsPerBlock:15}]}]},{infoBits:55367,versionNumber:13,alignmentPatternCenters:[6,34,62],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:107}]},\n{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:37},{numBlocks:1,dataCodewordsPerBlock:38}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:20},{numBlocks:4,dataCodewordsPerBlock:21}]},{ecCodewordsPerBlock:22,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:11},{numBlocks:4,dataCodewordsPerBlock:12}]}]},{infoBits:58893,versionNumber:14,alignmentPatternCenters:[6,26,46,66],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:115},\n{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:40},{numBlocks:5,dataCodewordsPerBlock:41}]},{ecCodewordsPerBlock:20,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:16},{numBlocks:5,dataCodewordsPerBlock:17}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:5,dataCodewordsPerBlock:13}]}]},{infoBits:63784,versionNumber:15,alignmentPatternCenters:[6,26,48,70],errorCorrectionLevels:[{ecCodewordsPerBlock:22,\necBlocks:[{numBlocks:5,dataCodewordsPerBlock:87},{numBlocks:1,dataCodewordsPerBlock:88}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:41},{numBlocks:5,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:12},{numBlocks:7,dataCodewordsPerBlock:13}]}]},{infoBits:68472,versionNumber:16,alignmentPatternCenters:[6,26,50,\n74],errorCorrectionLevels:[{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:98},{numBlocks:1,dataCodewordsPerBlock:99}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:19},{numBlocks:2,dataCodewordsPerBlock:20}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:70749,\nversionNumber:17,alignmentPatternCenters:[6,30,54,78],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:1,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:22},{numBlocks:15,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:14},{numBlocks:17,\ndataCodewordsPerBlock:15}]}]},{infoBits:76311,versionNumber:18,alignmentPatternCenters:[6,30,56,82],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:120},{numBlocks:1,dataCodewordsPerBlock:121}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:43},{numBlocks:4,dataCodewordsPerBlock:44}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},{numBlocks:1,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,\ndataCodewordsPerBlock:14},{numBlocks:19,dataCodewordsPerBlock:15}]}]},{infoBits:79154,versionNumber:19,alignmentPatternCenters:[6,30,58,86],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:113},{numBlocks:4,dataCodewordsPerBlock:114}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:44},{numBlocks:11,dataCodewordsPerBlock:45}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:21},{numBlocks:4,dataCodewordsPerBlock:22}]},\n{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:9,dataCodewordsPerBlock:13},{numBlocks:16,dataCodewordsPerBlock:14}]}]},{infoBits:84390,versionNumber:20,alignmentPatternCenters:[6,34,62,90],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:107},{numBlocks:5,dataCodewordsPerBlock:108}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:41},{numBlocks:13,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},\n{numBlocks:5,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:15},{numBlocks:10,dataCodewordsPerBlock:16}]}]},{infoBits:87683,versionNumber:21,alignmentPatternCenters:[6,28,50,72,94],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:116},{numBlocks:4,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:42}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:22},\n{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:16},{numBlocks:6,dataCodewordsPerBlock:17}]}]},{infoBits:92361,versionNumber:22,alignmentPatternCenters:[6,26,50,74,98],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:111},{numBlocks:7,dataCodewordsPerBlock:112}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},\n{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:24,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:13}]}]},{infoBits:96236,versionNumber:23,alignmentPatternCenters:[6,30,54,74,102],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:121},{numBlocks:5,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:47},{numBlocks:14,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},\n{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:16,dataCodewordsPerBlock:15},{numBlocks:14,dataCodewordsPerBlock:16}]}]},{infoBits:102084,versionNumber:24,alignmentPatternCenters:[6,28,54,80,106],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:45},{numBlocks:14,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:11,dataCodewordsPerBlock:24},{numBlocks:16,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:30,dataCodewordsPerBlock:16},{numBlocks:2,dataCodewordsPerBlock:17}]}]},{infoBits:102881,versionNumber:25,alignmentPatternCenters:[6,32,58,84,110],errorCorrectionLevels:[{ecCodewordsPerBlock:26,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:106},{numBlocks:4,dataCodewordsPerBlock:107}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:47},{numBlocks:13,\ndataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:7,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:13,dataCodewordsPerBlock:16}]}]},{infoBits:110507,versionNumber:26,alignmentPatternCenters:[6,30,58,86,114],errorCorrectionLevels:[{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:114},{numBlocks:2,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,\ndataCodewordsPerBlock:46},{numBlocks:4,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:28,dataCodewordsPerBlock:22},{numBlocks:6,dataCodewordsPerBlock:23}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:33,dataCodewordsPerBlock:16},{numBlocks:4,dataCodewordsPerBlock:17}]}]},{infoBits:110734,versionNumber:27,alignmentPatternCenters:[6,34,62,90,118],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:45},{numBlocks:3,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:8,dataCodewordsPerBlock:23},{numBlocks:26,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:15},{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:117786,versionNumber:28,alignmentPatternCenters:[6,26,50,74,98,122],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:117},\n{numBlocks:10,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:3,dataCodewordsPerBlock:45},{numBlocks:23,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,dataCodewordsPerBlock:24},{numBlocks:31,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:31,dataCodewordsPerBlock:16}]}]},{infoBits:119615,versionNumber:29,alignmentPatternCenters:[6,30,54,78,102,126],errorCorrectionLevels:[{ecCodewordsPerBlock:30,\necBlocks:[{numBlocks:7,dataCodewordsPerBlock:116},{numBlocks:7,dataCodewordsPerBlock:117}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:21,dataCodewordsPerBlock:45},{numBlocks:7,dataCodewordsPerBlock:46}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:1,dataCodewordsPerBlock:23},{numBlocks:37,dataCodewordsPerBlock:24}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:15},{numBlocks:26,dataCodewordsPerBlock:16}]}]},{infoBits:126325,versionNumber:30,alignmentPatternCenters:[6,\n26,52,78,104,130],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:5,dataCodewordsPerBlock:115},{numBlocks:10,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:47},{numBlocks:10,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:15,dataCodewordsPerBlock:24},{numBlocks:25,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},{numBlocks:25,dataCodewordsPerBlock:16}]}]},\n{infoBits:127568,versionNumber:31,alignmentPatternCenters:[6,30,56,82,108,134],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:3,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:46},{numBlocks:29,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:24},{numBlocks:1,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:23,dataCodewordsPerBlock:15},\n{numBlocks:28,dataCodewordsPerBlock:16}]}]},{infoBits:133589,versionNumber:32,alignmentPatternCenters:[6,34,60,86,112,138],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:24},{numBlocks:35,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,\ndataCodewordsPerBlock:15},{numBlocks:35,dataCodewordsPerBlock:16}]}]},{infoBits:136944,versionNumber:33,alignmentPatternCenters:[6,30,58,86,114,142],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:115},{numBlocks:1,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:21,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:24},{numBlocks:19,dataCodewordsPerBlock:25}]},\n{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:11,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:141498,versionNumber:34,alignmentPatternCenters:[6,34,62,90,118,146],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:115},{numBlocks:6,dataCodewordsPerBlock:116}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:14,dataCodewordsPerBlock:46},{numBlocks:23,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:44,\ndataCodewordsPerBlock:24},{numBlocks:7,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:59,dataCodewordsPerBlock:16},{numBlocks:1,dataCodewordsPerBlock:17}]}]},{infoBits:145311,versionNumber:35,alignmentPatternCenters:[6,30,54,78,102,126,150],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:121},{numBlocks:7,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:12,dataCodewordsPerBlock:47},{numBlocks:26,dataCodewordsPerBlock:48}]},\n{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:39,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:22,dataCodewordsPerBlock:15},{numBlocks:41,dataCodewordsPerBlock:16}]}]},{infoBits:150283,versionNumber:36,alignmentPatternCenters:[6,24,50,76,102,128,154],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:6,dataCodewordsPerBlock:121},{numBlocks:14,dataCodewordsPerBlock:122}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:6,\ndataCodewordsPerBlock:47},{numBlocks:34,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:46,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:2,dataCodewordsPerBlock:15},{numBlocks:64,dataCodewordsPerBlock:16}]}]},{infoBits:152622,versionNumber:37,alignmentPatternCenters:[6,28,54,80,106,132,158],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:17,dataCodewordsPerBlock:122},{numBlocks:4,dataCodewordsPerBlock:123}]},\n{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:29,dataCodewordsPerBlock:46},{numBlocks:14,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:49,dataCodewordsPerBlock:24},{numBlocks:10,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:24,dataCodewordsPerBlock:15},{numBlocks:46,dataCodewordsPerBlock:16}]}]},{infoBits:158308,versionNumber:38,alignmentPatternCenters:[6,32,58,84,110,136,162],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:4,\ndataCodewordsPerBlock:122},{numBlocks:18,dataCodewordsPerBlock:123}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:13,dataCodewordsPerBlock:46},{numBlocks:32,dataCodewordsPerBlock:47}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:48,dataCodewordsPerBlock:24},{numBlocks:14,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:42,dataCodewordsPerBlock:15},{numBlocks:32,dataCodewordsPerBlock:16}]}]},{infoBits:161089,versionNumber:39,alignmentPatternCenters:[6,26,54,82,110,138,166],\nerrorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:117},{numBlocks:4,dataCodewordsPerBlock:118}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:40,dataCodewordsPerBlock:47},{numBlocks:7,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:43,dataCodewordsPerBlock:24},{numBlocks:22,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:10,dataCodewordsPerBlock:15},{numBlocks:67,dataCodewordsPerBlock:16}]}]},{infoBits:167017,\nversionNumber:40,alignmentPatternCenters:[6,30,58,86,114,142,170],errorCorrectionLevels:[{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:19,dataCodewordsPerBlock:118},{numBlocks:6,dataCodewordsPerBlock:119}]},{ecCodewordsPerBlock:28,ecBlocks:[{numBlocks:18,dataCodewordsPerBlock:47},{numBlocks:31,dataCodewordsPerBlock:48}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:34,dataCodewordsPerBlock:24},{numBlocks:34,dataCodewordsPerBlock:25}]},{ecCodewordsPerBlock:30,ecBlocks:[{numBlocks:20,dataCodewordsPerBlock:15},\n{numBlocks:61,dataCodewordsPerBlock:16}]}]}];function J(a,b){a^=b;for(b=0;a;)b++,a&=a-1;return b}function K(a,b){return b<<1|a}\nlet ia=[{bits:21522,formatInfo:{errorCorrectionLevel:1,dataMask:0}},{bits:20773,formatInfo:{errorCorrectionLevel:1,dataMask:1}},{bits:24188,formatInfo:{errorCorrectionLevel:1,dataMask:2}},{bits:23371,formatInfo:{errorCorrectionLevel:1,dataMask:3}},{bits:17913,formatInfo:{errorCorrectionLevel:1,dataMask:4}},{bits:16590,formatInfo:{errorCorrectionLevel:1,dataMask:5}},{bits:20375,formatInfo:{errorCorrectionLevel:1,dataMask:6}},{bits:19104,formatInfo:{errorCorrectionLevel:1,dataMask:7}},{bits:30660,formatInfo:{errorCorrectionLevel:0,\ndataMask:0}},{bits:29427,formatInfo:{errorCorrectionLevel:0,dataMask:1}},{bits:32170,formatInfo:{errorCorrectionLevel:0,dataMask:2}},{bits:30877,formatInfo:{errorCorrectionLevel:0,dataMask:3}},{bits:26159,formatInfo:{errorCorrectionLevel:0,dataMask:4}},{bits:25368,formatInfo:{errorCorrectionLevel:0,dataMask:5}},{bits:27713,formatInfo:{errorCorrectionLevel:0,dataMask:6}},{bits:26998,formatInfo:{errorCorrectionLevel:0,dataMask:7}},{bits:5769,formatInfo:{errorCorrectionLevel:3,dataMask:0}},{bits:5054,\nformatInfo:{errorCorrectionLevel:3,dataMask:1}},{bits:7399,formatInfo:{errorCorrectionLevel:3,dataMask:2}},{bits:6608,formatInfo:{errorCorrectionLevel:3,dataMask:3}},{bits:1890,formatInfo:{errorCorrectionLevel:3,dataMask:4}},{bits:597,formatInfo:{errorCorrectionLevel:3,dataMask:5}},{bits:3340,formatInfo:{errorCorrectionLevel:3,dataMask:6}},{bits:2107,formatInfo:{errorCorrectionLevel:3,dataMask:7}},{bits:13663,formatInfo:{errorCorrectionLevel:2,dataMask:0}},{bits:12392,formatInfo:{errorCorrectionLevel:2,\ndataMask:1}},{bits:16177,formatInfo:{errorCorrectionLevel:2,dataMask:2}},{bits:14854,formatInfo:{errorCorrectionLevel:2,dataMask:3}},{bits:9396,formatInfo:{errorCorrectionLevel:2,dataMask:4}},{bits:8579,formatInfo:{errorCorrectionLevel:2,dataMask:5}},{bits:11994,formatInfo:{errorCorrectionLevel:2,dataMask:6}},{bits:11245,formatInfo:{errorCorrectionLevel:2,dataMask:7}}],ja=[a=>0===(a.y+a.x)%2,a=>0===a.y%2,a=>0===a.x%3,a=>0===(a.y+a.x)%3,a=>0===(Math.floor(a.y/2)+Math.floor(a.x/3))%2,a=>0===a.x*a.y%\n2+a.x*a.y%3,a=>0===(a.y*a.x%2+a.y*a.x%3)%2,a=>0===((a.y+a.x)%2+a.y*a.x%3)%2];\nfunction ka(a,b,c){c=ja[c.dataMask];let d=a.height;var e=17+4*b.versionNumber;let f=x.createEmpty(e,e);f.setRegion(0,0,9,9,!0);f.setRegion(e-8,0,8,9,!0);f.setRegion(0,e-8,9,8,!0);for(var g of b.alignmentPatternCenters)for(var h of b.alignmentPatternCenters)6===g&&6===h||6===g&&h===e-7||g===e-7&&6===h||f.setRegion(g-2,h-2,5,5,!0);f.setRegion(6,9,1,e-17,!0);f.setRegion(9,6,e-17,1,!0);6<b.versionNumber&&(f.setRegion(e-11,0,3,6,!0),f.setRegion(0,e-11,6,3,!0));b=[];h=g=0;e=!0;for(let k=d-1;0<k;k-=2){6===\nk&&k--;for(let m=0;m<d;m++){let l=e?d-1-m:m;for(let n=0;2>n;n++){let q=k-n;if(!f.get(q,l)){h++;let r=a.get(q,l);c({y:l,x:q})&&(r=!r);g=g<<1|r;8===h&&(b.push(g),g=h=0)}}}e=!e}return b}\nfunction la(a){var b=a.height,c=Math.floor((b-17)/4);if(6>=c)return I[c-1];c=0;for(var d=5;0<=d;d--)for(var e=b-9;e>=b-11;e--)c=K(a.get(e,d),c);d=0;for(e=5;0<=e;e--)for(let g=b-9;g>=b-11;g--)d=K(a.get(e,g),d);a=Infinity;let f;for(let g of I){if(g.infoBits===c||g.infoBits===d)return g;b=J(c,g.infoBits);b<a&&(f=g,a=b);b=J(d,g.infoBits);b<a&&(f=g,a=b)}if(3>=a)return f}\nfunction ma(a){let b=0;for(var c=0;8>=c;c++)6!==c&&(b=K(a.get(c,8),b));for(c=7;0<=c;c--)6!==c&&(b=K(a.get(8,c),b));var d=a.height;c=0;for(var e=d-1;e>=d-7;e--)c=K(a.get(8,e),c);for(e=d-8;e<d;e++)c=K(a.get(e,8),c);a=Infinity;d=null;for(let {bits:f,formatInfo:g}of ia){if(f===b||f===c)return g;e=J(b,f);e<a&&(d=g,a=e);b!==c&&(e=J(c,f),e<a&&(d=g,a=e))}return 3>=a?d:null}\nfunction na(a,b,c){let d=b.errorCorrectionLevels[c],e=[],f=0;d.ecBlocks.forEach(h=>{for(let k=0;k<h.numBlocks;k++)e.push({numDataCodewords:h.dataCodewordsPerBlock,codewords:[]}),f+=h.dataCodewordsPerBlock+d.ecCodewordsPerBlock});if(a.length<f)return null;a=a.slice(0,f);b=d.ecBlocks[0].dataCodewordsPerBlock;for(c=0;c<b;c++)for(var g of e)g.codewords.push(a.shift());if(1<d.ecBlocks.length)for(g=d.ecBlocks[0].numBlocks,b=d.ecBlocks[1].numBlocks,c=0;c<b;c++)e[g+c].codewords.push(a.shift());for(;0<a.length;)for(let h of e)h.codewords.push(a.shift());\nreturn e}function L(a){let b=la(a);if(!b)return null;var c=ma(a);if(!c)return null;a=ka(a,b,c);var d=na(a,b,c.errorCorrectionLevel);if(!d)return null;c=d.reduce((e,f)=>e+f.numDataCodewords,0);c=new Uint8ClampedArray(c);a=0;for(let e of d){d=ha(e.codewords,e.codewords.length-e.numDataCodewords);if(!d)return null;for(let f=0;f<e.numDataCodewords;f++)c[a++]=d[f]}try{return da(c,b.versionNumber)}catch(e){return null}}\nfunction M(a,b,c,d){var e=a.x-b.x+c.x-d.x;let f=a.y-b.y+c.y-d.y;if(0===e&&0===f)return{a11:b.x-a.x,a12:b.y-a.y,a13:0,a21:c.x-b.x,a22:c.y-b.y,a23:0,a31:a.x,a32:a.y,a33:1};let g=b.x-c.x;var h=d.x-c.x;let k=b.y-c.y,m=d.y-c.y;c=g*m-h*k;h=(e*m-h*f)/c;e=(g*f-e*k)/c;return{a11:b.x-a.x+h*b.x,a12:b.y-a.y+h*b.y,a13:h,a21:d.x-a.x+e*d.x,a22:d.y-a.y+e*d.y,a23:e,a31:a.x,a32:a.y,a33:1}}\nfunction oa(a,b,c,d){a=M(a,b,c,d);return{a11:a.a22*a.a33-a.a23*a.a32,a12:a.a13*a.a32-a.a12*a.a33,a13:a.a12*a.a23-a.a13*a.a22,a21:a.a23*a.a31-a.a21*a.a33,a22:a.a11*a.a33-a.a13*a.a31,a23:a.a13*a.a21-a.a11*a.a23,a31:a.a21*a.a32-a.a22*a.a31,a32:a.a12*a.a31-a.a11*a.a32,a33:a.a11*a.a22-a.a12*a.a21}}\nfunction pa(a,b){var c=oa({x:3.5,y:3.5},{x:b.dimension-3.5,y:3.5},{x:b.dimension-6.5,y:b.dimension-6.5},{x:3.5,y:b.dimension-3.5}),d=M(b.topLeft,b.topRight,b.alignmentPattern,b.bottomLeft),e=d.a11*c.a11+d.a21*c.a12+d.a31*c.a13,f=d.a12*c.a11+d.a22*c.a12+d.a32*c.a13,g=d.a13*c.a11+d.a23*c.a12+d.a33*c.a13,h=d.a11*c.a21+d.a21*c.a22+d.a31*c.a23,k=d.a12*c.a21+d.a22*c.a22+d.a32*c.a23,m=d.a13*c.a21+d.a23*c.a22+d.a33*c.a23,l=d.a11*c.a31+d.a21*c.a32+d.a31*c.a33,n=d.a12*c.a31+d.a22*c.a32+d.a32*c.a33,q=d.a13*\nc.a31+d.a23*c.a32+d.a33*c.a33;c=x.createEmpty(b.dimension,b.dimension);d=(r,u)=>{const p=g*r+m*u+q;return{x:(e*r+h*u+l)/p,y:(f*r+k*u+n)/p}};for(let r=0;r<b.dimension;r++)for(let u=0;u<b.dimension;u++){let p=d(u+.5,r+.5);c.set(u,r,a.get(Math.floor(p.x),Math.floor(p.y)))}return{matrix:c,mappingFunction:d}}let N=(a,b)=>Math.sqrt(Math.pow(b.x-a.x,2)+Math.pow(b.y-a.y,2));function O(a){return a.reduce((b,c)=>b+c)}\nfunction qa(a,b,c){let d=N(a,b),e=N(b,c),f=N(a,c),g,h,k;e>=d&&e>=f?[g,h,k]=[b,a,c]:f>=e&&f>=d?[g,h,k]=[a,b,c]:[g,h,k]=[a,c,b];0>(k.x-h.x)*(g.y-h.y)-(k.y-h.y)*(g.x-h.x)&&([g,k]=[k,g]);return{bottomLeft:g,topLeft:h,topRight:k}}\nfunction ra(a,b,c,d){d=(O(P(a,c,d,5))/7+O(P(a,b,d,5))/7+O(P(c,a,d,5))/7+O(P(b,a,d,5))/7)/4;if(1>d)throw Error(\"Invalid module size\");b=Math.round(N(a,b)/d);a=Math.round(N(a,c)/d);a=Math.floor((b+a)/2)+7;switch(a%4){case 0:a++;break;case 2:a--}return{dimension:a,moduleSize:d}}\nfunction Q(a,b,c,d){let e=[{x:Math.floor(a.x),y:Math.floor(a.y)}];var f=Math.abs(b.y-a.y)>Math.abs(b.x-a.x);if(f){var g=Math.floor(a.y);var h=Math.floor(a.x);a=Math.floor(b.y);b=Math.floor(b.x)}else g=Math.floor(a.x),h=Math.floor(a.y),a=Math.floor(b.x),b=Math.floor(b.y);let k=Math.abs(a-g),m=Math.abs(b-h),l=Math.floor(-k/2),n=g<a?1:-1,q=h<b?1:-1,r=!0;for(let u=g,p=h;u!==a+n;u+=n){g=f?p:u;h=f?u:p;if(c.get(g,h)!==r&&(r=!r,e.push({x:g,y:h}),e.length===d+1))break;l+=m;if(0<l){if(p===b)break;p+=q;l-=k}}c=\n[];for(f=0;f<d;f++)e[f]&&e[f+1]?c.push(N(e[f],e[f+1])):c.push(0);return c}function P(a,b,c,d){let e=b.y-a.y,f=b.x-a.x;b=Q(a,b,c,Math.ceil(d/2));a=Q(a,{x:a.x-f,y:a.y-e},c,Math.ceil(d/2));c=b.shift()+a.shift()-1;return a.concat(c).concat(...b)}function R(a,b){let c=O(a)/O(b),d=0;b.forEach((e,f)=>{d+=Math.pow(a[f]-e*c,2)});return{averageSize:c,error:d}}\nfunction S(a,b,c){try{let d=P(a,{x:-1,y:a.y},c,b.length),e=P(a,{x:a.x,y:-1},c,b.length),f=P(a,{x:Math.max(0,a.x-a.y)-1,y:Math.max(0,a.y-a.x)-1},c,b.length),g=P(a,{x:Math.min(c.width,a.x+a.y)+1,y:Math.min(c.height,a.y+a.x)+1},c,b.length),h=R(d,b),k=R(e,b),m=R(f,b),l=R(g,b),n=(h.averageSize+k.averageSize+m.averageSize+l.averageSize)/4;return Math.sqrt(h.error*h.error+k.error*k.error+m.error*m.error+l.error*l.error)+(Math.pow(h.averageSize-n,2)+Math.pow(k.averageSize-n,2)+Math.pow(m.averageSize-n,2)+\nMath.pow(l.averageSize-n,2))/n}catch(d){return Infinity}}function T(a,b){for(var c=Math.round(b.x);a.get(c,Math.round(b.y));)c--;for(var d=Math.round(b.x);a.get(d,Math.round(b.y));)d++;c=(c+d)/2;for(d=Math.round(b.y);a.get(Math.round(c),d);)d--;for(b=Math.round(b.y);a.get(Math.round(c),b);)b++;return{x:c,y:(d+b)/2}}\nfunction sa(a){var b=[],c=[];let d=[];var e=[];for(let p=0;p<=a.height;p++){var f=0,g=!1;let t=[0,0,0,0,0];for(let v=-1;v<=a.width;v++){var h=a.get(v,p);if(h===g)f++;else{t=[t[1],t[2],t[3],t[4],f];f=1;g=h;var k=O(t)/7;k=Math.abs(t[0]-k)<k&&Math.abs(t[1]-k)<k&&Math.abs(t[2]-3*k)<3*k&&Math.abs(t[3]-k)<k&&Math.abs(t[4]-k)<k&&!h;var m=O(t.slice(-3))/3;h=Math.abs(t[2]-m)<m&&Math.abs(t[3]-m)<m&&Math.abs(t[4]-m)<m&&h;if(k){let z=v-t[3]-t[4],y=z-t[2];k={startX:y,endX:z,y:p};m=c.filter(w=>y>=w.bottom.startX&&\ny<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<m.length?m[0].bottom=k:c.push({top:k,bottom:k})}if(h){let z=v-t[4],y=z-t[3];h={startX:y,y:p,endX:z};k=e.filter(w=>y>=w.bottom.startX&&y<=w.bottom.endX||z>=w.bottom.startX&&y<=w.bottom.endX||y<=w.bottom.startX&&z>=w.bottom.endX&&1.5>t[2]/(w.bottom.endX-w.bottom.startX)&&.5<t[2]/(w.bottom.endX-w.bottom.startX));0<k.length?\nk[0].bottom=h:e.push({top:h,bottom:h})}}}b.push(...c.filter(v=>v.bottom.y!==p&&2<=v.bottom.y-v.top.y));c=c.filter(v=>v.bottom.y===p);d.push(...e.filter(v=>v.bottom.y!==p));e=e.filter(v=>v.bottom.y===p)}b.push(...c.filter(p=>2<=p.bottom.y-p.top.y));d.push(...e);c=[];for(var l of b)2>l.bottom.y-l.top.y||(b=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4,e=(l.top.y+l.bottom.y+1)/2,a.get(Math.round(b),Math.round(e))&&(f=[l.top.endX-l.top.startX,l.bottom.endX-l.bottom.startX,l.bottom.y-l.top.y+\n1],f=O(f)/f.length,g=S({x:Math.round(b),y:Math.round(e)},[1,1,3,1,1],a),c.push({score:g,x:b,y:e,size:f})));if(3>c.length)return null;c.sort((p,t)=>p.score-t.score);l=[];for(b=0;b<Math.min(c.length,5);++b){e=c[b];f=[];for(var n of c)n!==e&&f.push(Object.assign(Object.assign({},n),{score:n.score+Math.pow(n.size-e.size,2)/e.size}));f.sort((p,t)=>p.score-t.score);l.push({points:[e,f[0],f[1]],score:e.score+f[0].score+f[1].score})}l.sort((p,t)=>p.score-t.score);let {topRight:q,topLeft:r,bottomLeft:u}=qa(...l[0].points);\nl=U(a,d,q,r,u);n=[];l&&n.push({alignmentPattern:{x:l.alignmentPattern.x,y:l.alignmentPattern.y},bottomLeft:{x:u.x,y:u.y},dimension:l.dimension,topLeft:{x:r.x,y:r.y},topRight:{x:q.x,y:q.y}});l=T(a,q);b=T(a,r);c=T(a,u);(a=U(a,d,l,b,c))&&n.push({alignmentPattern:{x:a.alignmentPattern.x,y:a.alignmentPattern.y},bottomLeft:{x:c.x,y:c.y},topLeft:{x:b.x,y:b.y},topRight:{x:l.x,y:l.y},dimension:a.dimension});return 0===n.length?null:n}\nfunction U(a,b,c,d,e){let f,g;try{({dimension:f,moduleSize:g}=ra(d,c,e,a))}catch(l){return null}var h=c.x-d.x+e.x,k=c.y-d.y+e.y;c=(N(d,e)+N(d,c))/2/g;e=1-3/c;let m={x:d.x+e*(h-d.x),y:d.y+e*(k-d.y)};b=b.map(l=>{const n=(l.top.startX+l.top.endX+l.bottom.startX+l.bottom.endX)/4;l=(l.top.y+l.bottom.y+1)/2;if(a.get(Math.floor(n),Math.floor(l))){var q=S({x:Math.floor(n),y:Math.floor(l)},[1,1,1],a)+N({x:n,y:l},m);return{x:n,y:l,score:q}}}).filter(l=>!!l).sort((l,n)=>l.score-n.score);return{alignmentPattern:15<=\nc&&b.length?b[0]:m,dimension:f}}\nfunction V(a){var b=sa(a);if(!b)return null;for(let e of b){b=pa(a,e);var c=b.matrix;if(null==c)c=null;else{var d=L(c);if(d)c=d;else{for(d=0;d<c.width;d++)for(let f=d+1;f<c.height;f++)c.get(d,f)!==c.get(f,d)&&(c.set(d,f,!c.get(d,f)),c.set(f,d,!c.get(f,d)));c=L(c)}}if(c)return{binaryData:c.bytes,data:c.text,chunks:c.chunks,version:c.version,location:{topRightCorner:b.mappingFunction(e.dimension,0),topLeftCorner:b.mappingFunction(0,0),bottomRightCorner:b.mappingFunction(e.dimension,e.dimension),bottomLeftCorner:b.mappingFunction(0,\ne.dimension),topRightFinderPattern:e.topRight,topLeftFinderPattern:e.topLeft,bottomLeftFinderPattern:e.bottomLeft,bottomRightAlignmentPattern:e.alignmentPattern},matrix:b.matrix}}return null}let ta={inversionAttempts:\"attemptBoth\",greyScaleWeights:{red:.2126,green:.7152,blue:.0722,useIntegerApproximation:!1},canOverwriteImage:!0};function W(a,b){Object.keys(b).forEach(c=>{a[c]=b[c]})}\nfunction X(a,b,c,d={}){let e=Object.create(null);W(e,ta);W(e,d);d=\"onlyInvert\"===e.inversionAttempts||\"invertFirst\"===e.inversionAttempts;var f=\"attemptBoth\"===e.inversionAttempts||d;var g=e.greyScaleWeights,h=e.canOverwriteImage,k=b*c;if(a.length!==4*k)throw Error(\"Malformed data passed to binarizer.\");var m=0;if(h){var l=new Uint8ClampedArray(a.buffer,m,k);m+=k}l=new A(b,c,l);if(g.useIntegerApproximation)for(var n=0;n<c;n++)for(var q=0;q<b;q++){var r=4*(n*b+q);l.set(q,n,g.red*a[r]+g.green*a[r+1]+\ng.blue*a[r+2]+128>>8)}else for(n=0;n<c;n++)for(q=0;q<b;q++)r=4*(n*b+q),l.set(q,n,g.red*a[r]+g.green*a[r+1]+g.blue*a[r+2]);g=Math.ceil(b/8);n=Math.ceil(c/8);q=g*n;if(h){var u=new Uint8ClampedArray(a.buffer,m,q);m+=q}u=new A(g,n,u);for(q=0;q<n;q++)for(r=0;r<g;r++){var p=Infinity,t=0;for(var v=0;8>v;v++)for(let w=0;8>w;w++){let aa=l.get(8*r+w,8*q+v);p=Math.min(p,aa);t=Math.max(t,aa)}v=(p+t)/2;v=Math.min(255,1.11*v);24>=t-p&&(v=p/2,0<q&&0<r&&(t=(u.get(r,q-1)+2*u.get(r-1,q)+u.get(r-1,q-1))/4,p<t&&(v=t)));\nu.set(r,q,v)}h?(q=new Uint8ClampedArray(a.buffer,m,k),m+=k,q=new x(q,b)):q=x.createEmpty(b,c);r=null;f&&(h?(a=new Uint8ClampedArray(a.buffer,m,k),r=new x(a,b)):r=x.createEmpty(b,c));for(b=0;b<n;b++)for(a=0;a<g;a++){c=g-3;c=2>a?2:a>c?c:a;h=n-3;h=2>b?2:b>h?h:b;k=0;for(m=-2;2>=m;m++)for(p=-2;2>=p;p++)k+=u.get(c+m,h+p);c=k/25;for(h=0;8>h;h++)for(k=0;8>k;k++)m=8*a+h,p=8*b+k,t=l.get(m,p),q.set(m,p,t<=c),f&&r.set(m,p,!(t<=c))}f=f?{binarized:q,inverted:r}:{binarized:q};let {binarized:z,inverted:y}=f;(f=V(d?\ny:z))||\"attemptBoth\"!==e.inversionAttempts&&\"invertFirst\"!==e.inversionAttempts||(f=V(d?z:y));return f}X.default=X;let Y=\"dontInvert\",Z={red:77,green:150,blue:29,useIntegerApproximation:!0};\nself.onmessage=a=>{let b=a.data.id,c=a.data.data;switch(a.data.type){case \"decode\":(a=X(c.data,c.width,c.height,{inversionAttempts:Y,greyScaleWeights:Z}))?self.postMessage({id:b,type:\"qrResult\",data:a.data,cornerPoints:[a.location.topLeftCorner,a.location.topRightCorner,a.location.bottomRightCorner,a.location.bottomLeftCorner]}):self.postMessage({id:b,type:\"qrResult\",data:null});break;case \"grayscaleWeights\":Z.red=c.red;Z.green=c.green;Z.blue=c.blue;Z.useIntegerApproximation=c.useIntegerApproximation;\nbreak;case \"inversionMode\":switch(c){case \"original\":Y=\"dontInvert\";break;case \"invert\":Y=\"onlyInvert\";break;case \"both\":Y=\"attemptBoth\";break;default:throw Error(\"Invalid inversion mode\");}break;case \"close\":self.close()}}\n"]), { type: "application/javascript" }));
|
|
2
|
+
export { createWorker };
|
package/package.json
CHANGED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|