@twintag/twintag-core 0.2.194 → 0.2.195
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/cjs/twintag-scanner.cjs.entry.js +7 -9
- package/dist/collection/components/twintag-scanner/twintag-scanner.js +9 -11
- package/dist/collection/version.js +1 -1
- package/dist/esm/twintag-scanner.entry.js +7 -9
- package/dist/stencil-web-components/{p-4d494cc9.entry.js → p-730b57e2.entry.js} +1 -1
- package/dist/stencil-web-components/stencil-web-components.esm.js +1 -1
- package/dist/types/components/twintag-scanner/twintag-scanner.d.ts +0 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
|
@@ -37835,7 +37835,6 @@ let TwintagScanner = class {
|
|
|
37835
37835
|
// 2. Fake cropping zoom
|
|
37836
37836
|
// 3. Resolution scale
|
|
37837
37837
|
this.realZoom = 1;
|
|
37838
|
-
this.aspectRatio = 0;
|
|
37839
37838
|
this.stageWidth = 0;
|
|
37840
37839
|
this.stageHeight = 0;
|
|
37841
37840
|
this.videoHeight = 0;
|
|
@@ -37898,7 +37897,7 @@ let TwintagScanner = class {
|
|
|
37898
37897
|
return `${value}`;
|
|
37899
37898
|
}
|
|
37900
37899
|
render() {
|
|
37901
|
-
return (index.h("div", { class: "scanner-container" }, this.noPermission ? index.h("div", null, this.errorText) : null, this.customCheckIcon ? (index.h("img", { class: "check-icon", src: this.customCheckIcon, ref:
|
|
37900
|
+
return (index.h("div", { class: "scanner-container" }, this.noPermission ? index.h("div", null, this.errorText) : null, this.customCheckIcon ? (index.h("img", { class: "check-icon", src: this.customCheckIcon, ref: el => (this.successIcon = el) })) : (index.h("svg", { class: "check-icon", ref: el => (this.successIcon = el), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 150 150", width: "150px", height: "150px" }, index.h("g", null, index.h("path", { style: {
|
|
37902
37901
|
stroke: 'none',
|
|
37903
37902
|
fillRule: 'nonzero',
|
|
37904
37903
|
fill: 'rgb(23.529412%,54.901963%,98.039216%)',
|
|
@@ -37910,7 +37909,7 @@ let TwintagScanner = class {
|
|
|
37910
37909
|
fill: 'rgb(23.529412%,54.901963%,98.039216%)',
|
|
37911
37910
|
fillOpacity: '1',
|
|
37912
37911
|
transform: 'translateX(-10%)',
|
|
37913
|
-
}, d: "M 125.8125 25.875 C 123.820312 25.945312 121.992188 27 120.9375 28.6875 L 64.5 115.03125 L 27.9375 83.4375 C 26.367188 81.808594 24.011719 81.199219 21.84375 81.878906 C 19.6875 82.546875 18.082031 84.375 17.707031 86.601562 C 17.332031 88.839844 18.234375 91.089844 20.0625 92.4375 L 61.875 128.625 C 63.1875 129.738281 64.921875 130.230469 66.621094 129.984375 C 68.332031 129.726562 69.84375 128.753906 70.78125 127.3125 L 131.0625 35.25 C 132.351562 33.363281 132.457031 30.925781 131.34375 28.933594 C 130.230469 26.953125 128.085938 25.769531 125.8125 25.875 Z M 125.8125 25.875 " })))), index.h("div", { class: "video-container", ref:
|
|
37912
|
+
}, d: "M 125.8125 25.875 C 123.820312 25.945312 121.992188 27 120.9375 28.6875 L 64.5 115.03125 L 27.9375 83.4375 C 26.367188 81.808594 24.011719 81.199219 21.84375 81.878906 C 19.6875 82.546875 18.082031 84.375 17.707031 86.601562 C 17.332031 88.839844 18.234375 91.089844 20.0625 92.4375 L 61.875 128.625 C 63.1875 129.738281 64.921875 130.230469 66.621094 129.984375 C 68.332031 129.726562 69.84375 128.753906 70.78125 127.3125 L 131.0625 35.25 C 132.351562 33.363281 132.457031 30.925781 131.34375 28.933594 C 130.230469 26.953125 128.085938 25.769531 125.8125 25.875 Z M 125.8125 25.875 " })))), index.h("div", { class: "video-container", ref: el => (this.videoContainerRef = el) }, index.h("video", { crossOrigin: "Anonymous", autoplay: true, playsinline: true, ref: el => (this.videoElement = el) }))));
|
|
37914
37913
|
}
|
|
37915
37914
|
getMedia() {
|
|
37916
37915
|
let VideoFacingModeEnum;
|
|
@@ -37954,9 +37953,7 @@ let TwintagScanner = class {
|
|
|
37954
37953
|
const maxRealZoom = Math.min(zoomMax, this.zoom);
|
|
37955
37954
|
const maxZoomValue = zoomRangeMin * maxRealZoom;
|
|
37956
37955
|
// Round the zoom based on the zoom steps
|
|
37957
|
-
const realZoomValue = zoomRangeMin +
|
|
37958
|
-
Math.floor((maxZoomValue - zoomRangeMin) / zoomRangeStep) *
|
|
37959
|
-
zoomRangeStep;
|
|
37956
|
+
const realZoomValue = zoomRangeMin + Math.floor((maxZoomValue - zoomRangeMin) / zoomRangeStep) * zoomRangeStep;
|
|
37960
37957
|
this.realZoom = realZoomValue / zoomRangeMin;
|
|
37961
37958
|
// console.log(realZoomValue)
|
|
37962
37959
|
// Set the real zoom
|
|
@@ -37981,7 +37978,7 @@ let TwintagScanner = class {
|
|
|
37981
37978
|
this.available = true;
|
|
37982
37979
|
this.initRenderer();
|
|
37983
37980
|
}))
|
|
37984
|
-
.catch(
|
|
37981
|
+
.catch(error => {
|
|
37985
37982
|
if (error.name === this.NOT_ALLOWED_ERROR) {
|
|
37986
37983
|
this.noPermission = true;
|
|
37987
37984
|
this.errorText = 'Camera Permission Denied ...';
|
|
@@ -37999,7 +37996,8 @@ let TwintagScanner = class {
|
|
|
37999
37996
|
let height = video.videoHeight;
|
|
38000
37997
|
let sx = width * 0.5 - this.cropX * width * 0.5;
|
|
38001
37998
|
let sy = height * 0.5 - this.cropY * height * 0.5;
|
|
38002
|
-
|
|
37999
|
+
let sWidth = width - sx;
|
|
38000
|
+
let sHeight = height - sy;
|
|
38003
38001
|
if (this.videoHeight != height || this.videoWidth != width) {
|
|
38004
38002
|
this.osCanvas.width = width * this.cropX;
|
|
38005
38003
|
this.osCanvas.height = height * this.cropY;
|
|
@@ -38012,7 +38010,7 @@ let TwintagScanner = class {
|
|
|
38012
38010
|
}
|
|
38013
38011
|
if (!this.scanning) {
|
|
38014
38012
|
this.scanning = true;
|
|
38015
|
-
this.osContext.drawImage(video, sx, sy,
|
|
38013
|
+
this.osContext.drawImage(video, sx, sy, sWidth, sHeight, 0, 0, sWidth, sHeight);
|
|
38016
38014
|
this.scan();
|
|
38017
38015
|
}
|
|
38018
38016
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { __awaiter } from "tslib";
|
|
2
|
-
import { Component, h, Prop, Event, Listen, Element, State
|
|
2
|
+
import { Component, h, Prop, Event, Listen, Element, State } from '@stencil/core';
|
|
3
3
|
import { Renderer } from './renderer';
|
|
4
4
|
import { XZingReader } from './reader-xzing';
|
|
5
5
|
import gsap from 'gsap';
|
|
@@ -15,7 +15,6 @@ export class TwintagScanner {
|
|
|
15
15
|
// 2. Fake cropping zoom
|
|
16
16
|
// 3. Resolution scale
|
|
17
17
|
this.realZoom = 1;
|
|
18
|
-
this.aspectRatio = 0;
|
|
19
18
|
this.stageWidth = 0;
|
|
20
19
|
this.stageHeight = 0;
|
|
21
20
|
this.videoHeight = 0;
|
|
@@ -80,7 +79,7 @@ export class TwintagScanner {
|
|
|
80
79
|
render() {
|
|
81
80
|
return (h("div", { class: "scanner-container" },
|
|
82
81
|
this.noPermission ? h("div", null, this.errorText) : null,
|
|
83
|
-
this.customCheckIcon ? (h("img", { class: "check-icon", src: this.customCheckIcon, ref:
|
|
82
|
+
this.customCheckIcon ? (h("img", { class: "check-icon", src: this.customCheckIcon, ref: el => (this.successIcon = el) })) : (h("svg", { class: "check-icon", ref: el => (this.successIcon = el), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 150 150", width: "150px", height: "150px" },
|
|
84
83
|
h("g", null,
|
|
85
84
|
h("path", { style: {
|
|
86
85
|
stroke: 'none',
|
|
@@ -96,8 +95,8 @@ export class TwintagScanner {
|
|
|
96
95
|
fillOpacity: '1',
|
|
97
96
|
transform: 'translateX(-10%)',
|
|
98
97
|
}, d: "M 125.8125 25.875 C 123.820312 25.945312 121.992188 27 120.9375 28.6875 L 64.5 115.03125 L 27.9375 83.4375 C 26.367188 81.808594 24.011719 81.199219 21.84375 81.878906 C 19.6875 82.546875 18.082031 84.375 17.707031 86.601562 C 17.332031 88.839844 18.234375 91.089844 20.0625 92.4375 L 61.875 128.625 C 63.1875 129.738281 64.921875 130.230469 66.621094 129.984375 C 68.332031 129.726562 69.84375 128.753906 70.78125 127.3125 L 131.0625 35.25 C 132.351562 33.363281 132.457031 30.925781 131.34375 28.933594 C 130.230469 26.953125 128.085938 25.769531 125.8125 25.875 Z M 125.8125 25.875 " })))),
|
|
99
|
-
h("div", { class: "video-container", ref:
|
|
100
|
-
h("video", { autoplay: true, playsinline: true, ref:
|
|
98
|
+
h("div", { class: "video-container", ref: el => (this.videoContainerRef = el) },
|
|
99
|
+
h("video", { crossOrigin: "Anonymous", autoplay: true, playsinline: true, ref: el => (this.videoElement = el) }))));
|
|
101
100
|
}
|
|
102
101
|
getMedia() {
|
|
103
102
|
let VideoFacingModeEnum;
|
|
@@ -141,9 +140,7 @@ export class TwintagScanner {
|
|
|
141
140
|
const maxRealZoom = Math.min(zoomMax, this.zoom);
|
|
142
141
|
const maxZoomValue = zoomRangeMin * maxRealZoom;
|
|
143
142
|
// Round the zoom based on the zoom steps
|
|
144
|
-
const realZoomValue = zoomRangeMin +
|
|
145
|
-
Math.floor((maxZoomValue - zoomRangeMin) / zoomRangeStep) *
|
|
146
|
-
zoomRangeStep;
|
|
143
|
+
const realZoomValue = zoomRangeMin + Math.floor((maxZoomValue - zoomRangeMin) / zoomRangeStep) * zoomRangeStep;
|
|
147
144
|
this.realZoom = realZoomValue / zoomRangeMin;
|
|
148
145
|
// console.log(realZoomValue)
|
|
149
146
|
// Set the real zoom
|
|
@@ -168,7 +165,7 @@ export class TwintagScanner {
|
|
|
168
165
|
this.available = true;
|
|
169
166
|
this.initRenderer();
|
|
170
167
|
}))
|
|
171
|
-
.catch(
|
|
168
|
+
.catch(error => {
|
|
172
169
|
if (error.name === this.NOT_ALLOWED_ERROR) {
|
|
173
170
|
this.noPermission = true;
|
|
174
171
|
this.errorText = 'Camera Permission Denied ...';
|
|
@@ -186,7 +183,8 @@ export class TwintagScanner {
|
|
|
186
183
|
let height = video.videoHeight;
|
|
187
184
|
let sx = width * 0.5 - this.cropX * width * 0.5;
|
|
188
185
|
let sy = height * 0.5 - this.cropY * height * 0.5;
|
|
189
|
-
|
|
186
|
+
let sWidth = width - sx;
|
|
187
|
+
let sHeight = height - sy;
|
|
190
188
|
if (this.videoHeight != height || this.videoWidth != width) {
|
|
191
189
|
this.osCanvas.width = width * this.cropX;
|
|
192
190
|
this.osCanvas.height = height * this.cropY;
|
|
@@ -199,7 +197,7 @@ export class TwintagScanner {
|
|
|
199
197
|
}
|
|
200
198
|
if (!this.scanning) {
|
|
201
199
|
this.scanning = true;
|
|
202
|
-
this.osContext.drawImage(video, sx, sy,
|
|
200
|
+
this.osContext.drawImage(video, sx, sy, sWidth, sHeight, 0, 0, sWidth, sHeight);
|
|
203
201
|
this.scan();
|
|
204
202
|
}
|
|
205
203
|
}
|
|
@@ -37831,7 +37831,6 @@ let TwintagScanner = class {
|
|
|
37831
37831
|
// 2. Fake cropping zoom
|
|
37832
37832
|
// 3. Resolution scale
|
|
37833
37833
|
this.realZoom = 1;
|
|
37834
|
-
this.aspectRatio = 0;
|
|
37835
37834
|
this.stageWidth = 0;
|
|
37836
37835
|
this.stageHeight = 0;
|
|
37837
37836
|
this.videoHeight = 0;
|
|
@@ -37894,7 +37893,7 @@ let TwintagScanner = class {
|
|
|
37894
37893
|
return `${value}`;
|
|
37895
37894
|
}
|
|
37896
37895
|
render() {
|
|
37897
|
-
return (h("div", { class: "scanner-container" }, this.noPermission ? h("div", null, this.errorText) : null, this.customCheckIcon ? (h("img", { class: "check-icon", src: this.customCheckIcon, ref:
|
|
37896
|
+
return (h("div", { class: "scanner-container" }, this.noPermission ? h("div", null, this.errorText) : null, this.customCheckIcon ? (h("img", { class: "check-icon", src: this.customCheckIcon, ref: el => (this.successIcon = el) })) : (h("svg", { class: "check-icon", ref: el => (this.successIcon = el), xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 150 150", width: "150px", height: "150px" }, h("g", null, h("path", { style: {
|
|
37898
37897
|
stroke: 'none',
|
|
37899
37898
|
fillRule: 'nonzero',
|
|
37900
37899
|
fill: 'rgb(23.529412%,54.901963%,98.039216%)',
|
|
@@ -37906,7 +37905,7 @@ let TwintagScanner = class {
|
|
|
37906
37905
|
fill: 'rgb(23.529412%,54.901963%,98.039216%)',
|
|
37907
37906
|
fillOpacity: '1',
|
|
37908
37907
|
transform: 'translateX(-10%)',
|
|
37909
|
-
}, d: "M 125.8125 25.875 C 123.820312 25.945312 121.992188 27 120.9375 28.6875 L 64.5 115.03125 L 27.9375 83.4375 C 26.367188 81.808594 24.011719 81.199219 21.84375 81.878906 C 19.6875 82.546875 18.082031 84.375 17.707031 86.601562 C 17.332031 88.839844 18.234375 91.089844 20.0625 92.4375 L 61.875 128.625 C 63.1875 129.738281 64.921875 130.230469 66.621094 129.984375 C 68.332031 129.726562 69.84375 128.753906 70.78125 127.3125 L 131.0625 35.25 C 132.351562 33.363281 132.457031 30.925781 131.34375 28.933594 C 130.230469 26.953125 128.085938 25.769531 125.8125 25.875 Z M 125.8125 25.875 " })))), h("div", { class: "video-container", ref:
|
|
37908
|
+
}, d: "M 125.8125 25.875 C 123.820312 25.945312 121.992188 27 120.9375 28.6875 L 64.5 115.03125 L 27.9375 83.4375 C 26.367188 81.808594 24.011719 81.199219 21.84375 81.878906 C 19.6875 82.546875 18.082031 84.375 17.707031 86.601562 C 17.332031 88.839844 18.234375 91.089844 20.0625 92.4375 L 61.875 128.625 C 63.1875 129.738281 64.921875 130.230469 66.621094 129.984375 C 68.332031 129.726562 69.84375 128.753906 70.78125 127.3125 L 131.0625 35.25 C 132.351562 33.363281 132.457031 30.925781 131.34375 28.933594 C 130.230469 26.953125 128.085938 25.769531 125.8125 25.875 Z M 125.8125 25.875 " })))), h("div", { class: "video-container", ref: el => (this.videoContainerRef = el) }, h("video", { crossOrigin: "Anonymous", autoplay: true, playsinline: true, ref: el => (this.videoElement = el) }))));
|
|
37910
37909
|
}
|
|
37911
37910
|
getMedia() {
|
|
37912
37911
|
let VideoFacingModeEnum;
|
|
@@ -37950,9 +37949,7 @@ let TwintagScanner = class {
|
|
|
37950
37949
|
const maxRealZoom = Math.min(zoomMax, this.zoom);
|
|
37951
37950
|
const maxZoomValue = zoomRangeMin * maxRealZoom;
|
|
37952
37951
|
// Round the zoom based on the zoom steps
|
|
37953
|
-
const realZoomValue = zoomRangeMin +
|
|
37954
|
-
Math.floor((maxZoomValue - zoomRangeMin) / zoomRangeStep) *
|
|
37955
|
-
zoomRangeStep;
|
|
37952
|
+
const realZoomValue = zoomRangeMin + Math.floor((maxZoomValue - zoomRangeMin) / zoomRangeStep) * zoomRangeStep;
|
|
37956
37953
|
this.realZoom = realZoomValue / zoomRangeMin;
|
|
37957
37954
|
// console.log(realZoomValue)
|
|
37958
37955
|
// Set the real zoom
|
|
@@ -37977,7 +37974,7 @@ let TwintagScanner = class {
|
|
|
37977
37974
|
this.available = true;
|
|
37978
37975
|
this.initRenderer();
|
|
37979
37976
|
}))
|
|
37980
|
-
.catch(
|
|
37977
|
+
.catch(error => {
|
|
37981
37978
|
if (error.name === this.NOT_ALLOWED_ERROR) {
|
|
37982
37979
|
this.noPermission = true;
|
|
37983
37980
|
this.errorText = 'Camera Permission Denied ...';
|
|
@@ -37995,7 +37992,8 @@ let TwintagScanner = class {
|
|
|
37995
37992
|
let height = video.videoHeight;
|
|
37996
37993
|
let sx = width * 0.5 - this.cropX * width * 0.5;
|
|
37997
37994
|
let sy = height * 0.5 - this.cropY * height * 0.5;
|
|
37998
|
-
|
|
37995
|
+
let sWidth = width - sx;
|
|
37996
|
+
let sHeight = height - sy;
|
|
37999
37997
|
if (this.videoHeight != height || this.videoWidth != width) {
|
|
38000
37998
|
this.osCanvas.width = width * this.cropX;
|
|
38001
37999
|
this.osCanvas.height = height * this.cropY;
|
|
@@ -38008,7 +38006,7 @@ let TwintagScanner = class {
|
|
|
38008
38006
|
}
|
|
38009
38007
|
if (!this.scanning) {
|
|
38010
38008
|
this.scanning = true;
|
|
38011
|
-
this.osContext.drawImage(video, sx, sy,
|
|
38009
|
+
this.osContext.drawImage(video, sx, sy, sWidth, sHeight, 0, 0, sWidth, sHeight);
|
|
38012
38010
|
this.scan();
|
|
38013
38011
|
}
|
|
38014
38012
|
}
|
|
@@ -17,4 +17,4 @@ import{r as t,c as n,h as r,g as i}from"./p-71890127.js";import{_ as e}from"./p-
|
|
|
17
17
|
* Club GreenSock members, the agreement issued with that membership.
|
|
18
18
|
* @author: Jack Doyle, jack@greensock.com
|
|
19
19
|
*/
|
|
20
|
-
var fs,hs,cs,ls,ws,vs,ys,ds={},bs=180/Math.PI,ps=Math.PI/180,As=Math.atan2,ms=/([A-Z])/g,Is=/(left|right|width|margin|padding|x)/i,gs=/[\s,\(]\S/,Ss={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_s=function(t,n){return n.set(n.t,n.p,Math.round(1e4*(n.s+n.c*t))/1e4+n.u,n)},Ms=function(t,n){return n.set(n.t,n.p,1===t?n.e:Math.round(1e4*(n.s+n.c*t))/1e4+n.u,n)},Os=function(t,n){return n.set(n.t,n.p,t?Math.round(1e4*(n.s+n.c*t))/1e4+n.u:n.b,n)},Es=function(t,n){var r=n.s+n.c*t;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},ks=function(t,n){return n.set(n.t,n.p,t?n.e:n.b,n)},Cs=function(t,n){return n.set(n.t,n.p,1!==t?n.b:n.e,n)},js=function(t,n,r){return t.style[n]=r},Ts=function(t,n,r){return t.style.setProperty(n,r)},xs=function(t,n,r){return t._gsap[n]=r},Rs=function(t,n,r){return t._gsap.scaleX=t._gsap.scaleY=r},Ns=function(t,n,r,i,e){var o=t._gsap;o.scaleX=o.scaleY=r,o.renderTransform(e,o)},Ps=function(t,n,r,i,e){var o=t._gsap;o[n]=r,o.renderTransform(e,o)},Ds="transform",Ls=Ds+"Origin",Fs=function(t,n){var r=hs.createElementNS?hs.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):hs.createElement(t);return r.style?r:hs.createElement(t)},Us=function t(n,r,i){var e=getComputedStyle(n);return e[r]||e.getPropertyValue(r.replace(ms,"-$1").toLowerCase())||e.getPropertyValue(r)||!i&&t(n,Gs(r)||r,1)||""},Bs="O,Moz,ms,Ms,Webkit".split(","),Gs=function(t,n,r){var i=(n||ws).style,e=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);e--&&!(Bs[e]+t in i););return e<0?null:(3===e?"ms":e>=0?Bs[e]:"")+t},zs=function(){"undefined"!=typeof window&&window.document&&(fs=window,cs=(hs=fs.document).documentElement,ws=Fs("div")||{style:{}},Fs("div"),Ds=Gs(Ds),Ls=Ds+"Origin",ws.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",ys=!!Gs("perspective"),ls=1)},Hs=function t(n){var r,i=Fs("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),e=this.parentNode,o=this.nextSibling,u=this.style.cssText;if(cs.appendChild(i),i.appendChild(this),this.style.display="block",n)try{r=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=t}catch(t){}else this._gsapBBox&&(r=this._gsapBBox());return e&&(o?e.insertBefore(this,o):e.appendChild(this)),cs.removeChild(i),this.style.cssText=u,r},Qs=function(t,n){for(var r=n.length;r--;)if(t.hasAttribute(n[r]))return t.getAttribute(n[r])},Vs=function(t){var n;try{n=t.getBBox()}catch(r){n=Hs.call(t,!0)}return n&&(n.width||n.height)||t.getBBox===Hs||(n=Hs.call(t,!0)),!n||n.width||n.x||n.y?n:{x:+Qs(t,["x","cx","x1"])||0,y:+Qs(t,["y","cy","y1"])||0,width:0,height:0}},Ws=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Vs(t))},Ys=function(t,n){if(n){var r=t.style;n in ds&&n!==Ls&&(n=Ds),r.removeProperty?("ms"!==n.substr(0,2)&&"webkit"!==n.substr(0,6)||(n="-"+n),r.removeProperty(n.replace(ms,"-$1").toLowerCase())):r.removeAttribute(n)}},Ks=function(t,n,r,i,e,o){var u=new es(t._pt,n,r,0,1,o?Cs:ks);return t._pt=u,u.b=i,u.e=e,t._props.push(r),u},Xs={deg:1,rad:1,turn:1},$s=function t(n,r,i,e){var o,u,a,s,f=parseFloat(i)||0,h=(i+"").trim().substr((f+"").length)||"px",c=ws.style,l=Is.test(r),w="svg"===n.tagName.toLowerCase(),v=(w?"client":"offset")+(l?"Width":"Height"),y=100,d="px"===e,b="%"===e;return e===h||!f||Xs[e]||Xs[h]?f:("px"!==h&&!d&&(f=t(n,r,i,"px")),s=n.getCTM&&Ws(n),!b&&"%"!==h||!ds[r]&&!~r.indexOf("adius")?(c[l?"width":"height"]=y+(d?h:e),u=~r.indexOf("adius")||"em"===e&&n.appendChild&&!w?n:n.parentNode,s&&(u=(n.ownerSVGElement||{}).parentNode),u&&u!==hs&&u.appendChild||(u=hs.body),(a=u._gsap)&&b&&a.width&&l&&a.time===pa.time?cu(f/a.width*y):((b||"%"===h)&&(c.position=Us(n,"position")),u===n&&(c.position="static"),u.appendChild(ws),o=ws[v],u.removeChild(ws),c.position="absolute",l&&b&&((a=su(u)).time=pa.time,a.width=u[v]),cu(d?o*f/y:o&&f?y/o*f:0))):(o=s?n.getBBox()[l?"width":"height"]:n[v],cu(b?f/o*y:f/100*o)))},qs=function(t,n,r,i){var e;return ls||zs(),n in Ss&&"transform"!==n&&~(n=Ss[n]).indexOf(",")&&(n=n.split(",")[0]),ds[n]&&"transform"!==n?(e=ff(t,i),e="transformOrigin"!==n?e[n]:e.svg?e.origin:hf(Us(t,Ls))+" "+e.zOrigin+"px"):(!(e=t.style[n])||"auto"===e||i||~(e+"").indexOf("calc("))&&(e=nf[n]&&nf[n](t,n,r)||Us(t,n)||fu(t,n)||("opacity"===n?1:0)),r&&!~(e+"").trim().indexOf(" ")?$s(t,n,e,r)+r:e},Zs=function(t,n,r,i){if(!r||"none"===r){var e=Gs(n,t,1),o=e&&Us(t,e,1);o&&o!==r?(n=e,r=o):"borderColor"===n&&(r=Us(t,"borderTopColor"))}var u,a,s,f,h,c,l,w,v,y,d,b=new es(this._pt,t.style,n,0,1,Za),p=0,A=0;if(b.b=r,b.e=i,r+="","auto"==(i+="")&&(t.style[n]=i,i=Us(t,n)||i,t.style[n]=r),ba(u=[r,i]),i=u[1],s=(r=u[0]).match(Go)||[],(i.match(Go)||[]).length){for(;a=Go.exec(i);)l=a[0],v=i.substring(p,a.index),h?h=(h+1)%5:"rgba("!==v.substr(-5)&&"hsla("!==v.substr(-5)||(h=1),l!==(c=s[A++]||"")&&(f=parseFloat(c)||0,d=c.substr((f+"").length),"="===l.charAt(1)&&(l=wu(f,l)+d),w=parseFloat(l),y=l.substr((w+"").length),p=Go.lastIndex-y.length,y||(y=y||Io.units[n]||d,p===i.length&&(i+=y,b.e+=y)),d!==y&&(f=$s(t,n,c,y)||0),b._pt={_next:b._pt,p:v||1===A?v:",",s:f,c:w-f,m:h&&h<4||"zIndex"===n?Math.round:0});b.c=p<i.length?i.substring(p,i.length):""}else b.r="display"===n&&"none"===i?Cs:ks;return Ho.test(i)&&(b.e=0),this._pt=b,b},Js={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},tf=function(t,n){if(n.tween&&n.tween._time===n.tween._dur){var r,i,e,o=n.t,u=n.u,a=o._gsap;if("all"===u||!0===u)o.style.cssText="",i=1;else for(e=(u=u.split(",")).length;--e>-1;)ds[r=u[e]]&&(i=1,r="transformOrigin"===r?Ls:Ds),Ys(o,r);i&&(Ys(o,Ds),a&&(a.svg&&o.removeAttribute("transform"),ff(o,1),a.uncache=1))}},nf={clearProps:function(t,n,r,i,e){if("isFromStart"!==e.data){var o=t._pt=new es(t._pt,n,r,0,0,tf);return o.u=i,o.pr=-10,o.tween=e,t._props.push(r),1}}},rf=[1,0,0,1,0,0],ef={},of=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},uf=function(t){var n=Us(t,Ds);return of(n)?rf:n.substr(7).match(Bo).map(cu)},af=function(t,n){var r,i,e,o,u=t._gsap||su(t),a=t.style,s=uf(t);return u.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(s=[(e=t.transform.baseVal.consolidate().matrix).a,e.b,e.c,e.d,e.e,e.f]).join(",")?rf:s:(s!==rf||t.offsetParent||t===cs||u.svg||(e=a.display,a.display="block",(r=t.parentNode)&&t.offsetParent||(o=1,i=t.nextSibling,cs.appendChild(t)),s=uf(t),e?a.display=e:Ys(t,"display"),o&&(i?r.insertBefore(t,i):r?r.appendChild(t):cs.removeChild(t))),n&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},sf=function(t,n,r,i,e,o){var u,a,s,f=t._gsap,h=e||af(t,!0),c=f.xOrigin||0,l=f.yOrigin||0,w=f.xOffset||0,v=f.yOffset||0,y=h[0],d=h[1],b=h[2],p=h[3],A=h[4],m=h[5],I=n.split(" "),g=parseFloat(I[0])||0,S=parseFloat(I[1])||0;r?h!==rf&&(a=y*p-d*b)&&(s=g*(-d/a)+S*(y/a)-(y*m-d*A)/a,g=g*(p/a)+S*(-b/a)+(b*m-p*A)/a,S=s):(g=(u=Vs(t)).x+(~I[0].indexOf("%")?g/100*u.width:g),S=u.y+(~(I[1]||I[0]).indexOf("%")?S/100*u.height:S)),i||!1!==i&&f.smooth?(f.xOffset=w+((A=g-c)*y+(m=S-l)*b)-A,f.yOffset=v+(A*d+m*p)-m):f.xOffset=f.yOffset=0,f.xOrigin=g,f.yOrigin=S,f.smooth=!!i,f.origin=n,f.originIsAbsolute=!!r,t.style[Ls]="0px 0px",o&&(Ks(o,f,"xOrigin",c,g),Ks(o,f,"yOrigin",l,S),Ks(o,f,"xOffset",w,f.xOffset),Ks(o,f,"yOffset",v,f.yOffset)),t.setAttribute("data-svg-origin",g+" "+S)},ff=function(t,n){var r=t._gsap||new Ta(t);if("x"in r&&!n&&!r.uncache)return r;var i,e,o,u,a,s,f,h,c,l,w,v,y,d,b,p,A,m,I,g,S,_,M,O,E,k,C,j,T,x,R,N,P=t.style,D=r.scaleX<0,L="px",F="deg",U=Us(t,Ls)||"0";return i=e=o=s=f=h=c=l=w=0,u=a=1,r.svg=!(!t.getCTM||!Ws(t)),d=af(t,r.svg),r.svg&&(O=(!r.uncache||"0px 0px"===U)&&!n&&t.getAttribute("data-svg-origin"),sf(t,O||U,!!O||r.originIsAbsolute,!1!==r.smooth,d)),v=r.xOrigin||0,y=r.yOrigin||0,d!==rf&&(m=d[0],I=d[1],g=d[2],S=d[3],i=_=d[4],e=M=d[5],6===d.length?(u=Math.sqrt(m*m+I*I),a=Math.sqrt(S*S+g*g),s=m||I?As(I,m)*bs:0,(c=g||S?As(g,S)*bs+s:0)&&(a*=Math.abs(Math.cos(c*ps))),r.svg&&(i-=v-(v*m+y*g),e-=y-(v*I+y*S))):(x=d[7],C=d[8],j=d[9],R=d[11],i=d[12],e=d[13],o=d[14],f=(b=As(N=d[6],T=d[10]))*bs,b&&(O=_*(p=Math.cos(-b))+C*(A=Math.sin(-b)),E=M*p+j*A,k=N*p+T*A,C=_*-A+C*p,j=M*-A+j*p,T=N*-A+T*p,R=x*-A+R*p,_=O,M=E,N=k),h=(b=As(-g,T))*bs,b&&(p=Math.cos(-b),R=S*(A=Math.sin(-b))+R*p,m=O=m*p-C*A,I=E=I*p-j*A,g=k=g*p-T*A),s=(b=As(I,m))*bs,b&&(O=m*(p=Math.cos(b))+I*(A=Math.sin(b)),E=_*p+M*A,I=I*p-m*A,M=M*p-_*A,m=O,_=E),f&&Math.abs(f)+Math.abs(s)>359.9&&(f=s=0,h=180-h),u=cu(Math.sqrt(m*m+I*I+g*g)),a=cu(Math.sqrt(M*M+N*N)),b=As(_,M),c=Math.abs(b)>2e-4?b*bs:0,w=R?1/(R<0?-R:R):0),r.svg&&(O=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!of(Us(t,Ds)),O&&t.setAttribute("transform",O))),Math.abs(c)>90&&Math.abs(c)<270&&(D?(u*=-1,c+=s<=0?180:-180,s+=s<=0?180:-180):(a*=-1,c+=c<=0?180:-180)),n=n||r.uncache,r.x=i-((r.xPercent=i&&(!n&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-i)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+L,r.y=e-((r.yPercent=e&&(!n&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-e)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+L,r.z=o+L,r.scaleX=cu(u),r.scaleY=cu(a),r.rotation=cu(s)+F,r.rotationX=cu(f)+F,r.rotationY=cu(h)+F,r.skewX=c+F,r.skewY=l+F,r.transformPerspective=w+L,(r.zOrigin=parseFloat(U.split(" ")[2])||0)&&(P[Ls]=hf(U)),r.xOffset=r.yOffset=0,r.force3D=Io.force3D,r.renderTransform=r.svg?vf:ys?wf:lf,r.uncache=0,r},hf=function(t){return(t=t.split(" "))[0]+" "+t[1]},cf=function(t,n,r){var i=Ku(n);return cu(parseFloat(n)+parseFloat($s(t,"x",r+"px",i)))+i},lf=function(t,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,wf(t,n)},wf=function(t,n){var r=n||this,i=r.xPercent,e=r.yPercent,o=r.x,u=r.y,a=r.z,s=r.rotation,f=r.rotationY,h=r.rotationX,c=r.skewX,l=r.skewY,w=r.scaleX,v=r.scaleY,y=r.transformPerspective,d=r.force3D,b=r.target,p=r.zOrigin,A="",m="auto"===d&&t&&1!==t||!0===d;if(p&&("0deg"!==h||"0deg"!==f)){var I,g=parseFloat(f)*ps,S=Math.sin(g),_=Math.cos(g);g=parseFloat(h)*ps,I=Math.cos(g),o=cf(b,o,S*I*-p),u=cf(b,u,-Math.sin(g)*-p),a=cf(b,a,_*I*-p+p)}"0px"!==y&&(A+="perspective("+y+") "),(i||e)&&(A+="translate("+i+"%, "+e+"%) "),(m||"0px"!==o||"0px"!==u||"0px"!==a)&&(A+="0px"!==a||m?"translate3d("+o+", "+u+", "+a+") ":"translate("+o+", "+u+") "),"0deg"!==s&&(A+="rotate("+s+") "),"0deg"!==f&&(A+="rotateY("+f+") "),"0deg"!==h&&(A+="rotateX("+h+") "),"0deg"===c&&"0deg"===l||(A+="skew("+c+", "+l+") "),1===w&&1===v||(A+="scale("+w+", "+v+") "),b.style[Ds]=A||"translate(0, 0)"},vf=function(t,n){var r,i,e,o,u,a=n||this,s=a.xPercent,f=a.yPercent,h=a.x,c=a.y,l=a.rotation,w=a.skewX,v=a.skewY,y=a.scaleX,d=a.scaleY,b=a.target,p=a.xOrigin,A=a.yOrigin,m=a.xOffset,I=a.yOffset,g=a.forceCSS,S=parseFloat(h),_=parseFloat(c);l=parseFloat(l),w=parseFloat(w),(v=parseFloat(v))&&(w+=v=parseFloat(v),l+=v),l||w?(l*=ps,w*=ps,r=Math.cos(l)*y,i=Math.sin(l)*y,e=Math.sin(l-w)*-d,o=Math.cos(l-w)*d,w&&(v*=ps,u=Math.tan(w-v),e*=u=Math.sqrt(1+u*u),o*=u,v&&(u=Math.tan(v),r*=u=Math.sqrt(1+u*u),i*=u)),r=cu(r),i=cu(i),e=cu(e),o=cu(o)):(r=y,o=d,i=e=0),(S&&!~(h+"").indexOf("px")||_&&!~(c+"").indexOf("px"))&&(S=$s(b,"x",h,"px"),_=$s(b,"y",c,"px")),(p||A||m||I)&&(S=cu(S+p-(p*r+A*e)+m),_=cu(_+A-(p*i+A*o)+I)),(s||f)&&(u=b.getBBox(),S=cu(S+s/100*u.width),_=cu(_+f/100*u.height)),b.setAttribute("transform",u="matrix("+r+","+i+","+e+","+o+","+S+","+_+")"),g&&(b.style[Ds]=u)},yf=function(t,n,r,i,e){var o,u,a=360,s=Co(e),f=parseFloat(e)*(s&&~e.indexOf("rad")?bs:1)-i,h=i+f+"deg";return s&&("short"===(o=e.split("_")[1])&&(f%=a)!=f%180&&(f+=f<0?a:-360),"cw"===o&&f<0?f=(f+36e9)%a-~~(f/a)*a:"ccw"===o&&f>0&&(f=(f-36e9)%a-~~(f/a)*a)),t._pt=u=new es(t._pt,n,r,i,f,Ms),u.e=h,u.u="deg",t._props.push(r),u},df=function(t,n){for(var r in n)t[r]=n[r];return t},bf=function(t,n,r){var i,e,o,u,a,s,f,h=df({},r._gsap),c=r.style;for(e in h.svg?(o=r.getAttribute("transform"),r.setAttribute("transform",""),c[Ds]=n,i=ff(r,1),Ys(r,Ds),r.setAttribute("transform",o)):(o=getComputedStyle(r)[Ds],c[Ds]=n,i=ff(r,1),c[Ds]=o),ds)(o=h[e])!==(u=i[e])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(e)<0&&(a=Ku(o)!==(f=Ku(u))?$s(r,e,o,f):parseFloat(o),s=parseFloat(u),t._pt=new es(t._pt,i,e,a,s-a,_s),t._pt.u=f||0,t._props.push(e));df(i,h)};hu("padding,margin,Width,Radius",(function(t,n){var r="Top",i="Right",e="Bottom",o="Left",u=(n<3?[r,i,e,o]:[r+o,r+i,e+i,e+o]).map((function(r){return n<2?t+r:"border"+r+t}));nf[n>1?"border"+t:t]=function(t,n,r,i,e){var o,a;if(arguments.length<4)return o=u.map((function(n){return qs(t,n,r)})),5===(a=o.join(" ")).split(o[0]).length?o[0]:a;o=(i+"").split(" "),a={},u.forEach((function(t,n){return a[t]=o[n]=o[n]||o[(n-1)/2|0]})),t.init(n,a,e)}}));var pf,Af,mf={name:"css",register:zs,targetTest:function(t){return t.style&&t.nodeType},init:function(t,n,r,i,e){var o,u,a,s,f,h,c,l,w,v,y,d,b,p,A,m,I,g,S,_=this._props,M=t.style,O=r.vars.startAt;for(c in ls||zs(),n)if("autoRound"!==c&&(u=n[c],!ru[c]||!Fa(c,n,r,i,t,e)))if(h=nf[c],"function"==(f=typeof u)&&(f=typeof(u=u.call(r,i,t,e))),"string"===f&&~u.indexOf("random(")&&(u=ea(u)),h)h(this,t,c,u,r)&&(A=1);else if("--"===c.substr(0,2))o=(getComputedStyle(t).getPropertyValue(c)+"").trim(),u+="",ya.lastIndex=0,ya.test(o)||(l=Ku(o),w=Ku(u)),w?l!==w&&(o=$s(t,c,o,w)+w):l&&(u+=l),this.add(M,"setProperty",o,u,i,e,0,0,c),_.push(c);else if("undefined"!==f){if(O&&c in O?(o="function"==typeof O[c]?O[c].call(r,i,t,e):O[c],Co(o)&&~o.indexOf("random(")&&(o=ea(o)),Ku(o+"")||(o+=Io.units[c]||Ku(qs(t,c))||""),"="===(o+"").charAt(1)&&(o=qs(t,c))):o=qs(t,c),s=parseFloat(o),(v="string"===f&&"="===u.charAt(1)&&u.substr(0,2))&&(u=u.substr(2)),a=parseFloat(u),c in Ss&&("autoAlpha"===c&&(1===s&&"hidden"===qs(t,"visibility")&&a&&(s=0),Ks(this,M,"visibility",s?"inherit":"hidden",a?"inherit":"hidden",!a)),"scale"!==c&&"transform"!==c&&~(c=Ss[c]).indexOf(",")&&(c=c.split(",")[0])),y=c in ds)if(d||((b=t._gsap).renderTransform&&!n.parseTransform||ff(t,n.parseTransform),p=!1!==n.smoothOrigin&&b.smooth,(d=this._pt=new es(this._pt,M,Ds,0,1,b.renderTransform,b,0,-1)).dep=1),"scale"===c)this._pt=new es(this._pt,b,"scaleY",b.scaleY,(v?wu(b.scaleY,v+a):a)-b.scaleY||0),_.push("scaleY",c),c+="X";else{if("transformOrigin"===c){I=void 0,g=void 0,S=void 0,S=(I=(m=u).split(" "))[1]||"50%","top"!==(g=I[0])&&"bottom"!==g&&"left"!==S&&"right"!==S||(m=g,g=S,S=m),I[0]=Js[g]||g,I[1]=Js[S]||S,u=I.join(" "),b.svg?sf(t,u,0,p,0,this):((w=parseFloat(u.split(" ")[2])||0)!==b.zOrigin&&Ks(this,b,"zOrigin",b.zOrigin,w),Ks(this,M,c,hf(o),hf(u)));continue}if("svgOrigin"===c){sf(t,u,1,p,0,this);continue}if(c in ef){yf(this,b,c,s,v?wu(s,v+u):u);continue}if("smoothOrigin"===c){Ks(this,b,"smooth",b.smooth,u);continue}if("force3D"===c){b[c]=u;continue}if("transform"===c){bf(this,u,t);continue}}else c in M||(c=Gs(c)||c);if(y||(a||0===a)&&(s||0===s)&&!gs.test(u)&&c in M)a||(a=0),(l=(o+"").substr((s+"").length))!==(w=Ku(u)||(c in Io.units?Io.units[c]:l))&&(s=$s(t,c,o,w)),this._pt=new es(this._pt,y?b:M,c,s,(v?wu(s,v+a):a)-s,y||"px"!==w&&"zIndex"!==c||!1===n.autoRound?_s:Es),this._pt.u=w||0,l!==w&&"%"!==w&&(this._pt.b=o,this._pt.r=Os);else if(c in M)Zs.call(this,t,c,o,v?v+u:u);else{if(!(c in t)){Xo(c,u);continue}this.add(t,c,o||t[c],v?v+u:u,i,e)}_.push(c)}A&&is(this)},get:qs,aliases:Ss,getSetter:function(t,n,r){var i=Ss[n];return i&&i.indexOf(",")<0&&(n=i),n in ds&&n!==Ls&&(t._gsap.x||qs(t,"x"))?r&&vs===r?"scale"===n?Rs:xs:(vs=r||{})&&("scale"===n?Ns:Ps):t.style&&!xo(t.style[n])?js:~n.indexOf("-")?Ts:Xa(t,n)},core:{_removeProperty:Ys,_getMatrix:af}};ss.utils.checkPrefix=Gs,Af=hu("x,y,z,scale,scaleX,scaleY,xPercent,yPercent"+","+(pf="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){ds[t]=1})),hu(pf,(function(t){Io.units[t]="deg",ef[t]=1})),Ss[Af[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+pf,hu("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var n=t.split(":");Ss[n[1]]=Af[n[0]]})),hu("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){Io.units[t]="px"})),ss.registerPlugin(mf);var If=ss.registerPlugin(mf)||ss;o((function(t){var n=function(t){var n,r=Object.prototype,i=r.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",u=e.asyncIterator||"@@asyncIterator",a=e.toStringTag||"@@toStringTag";function s(t,n,r){return Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{s({},"")}catch(t){s=function(t,n,r){return t[n]=r}}function f(t,n,r,i){var e=Object.create((n&&n.prototype instanceof d?n:d).prototype),o=new k(i||[]);return e._invoke=function(t,n,r){var i=c;return function(e,o){if(i===w)throw new Error("Generator is already running");if(i===v){if("throw"===e)throw o;return j()}for(r.method=e,r.arg=o;;){var u=r.delegate;if(u){var a=M(u,r);if(a){if(a===y)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===c)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=w;var s=h(t,n,r);if("normal"===s.type){if(i=r.done?v:l,s.arg===y)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(i=v,r.method="throw",r.arg=s.arg)}}}(t,r,o),e}function h(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var c="suspendedStart",l="suspendedYield",w="executing",v="completed",y={};function d(){}function b(){}function p(){}var A={};A[o]=function(){return this};var m=Object.getPrototypeOf,I=m&&m(m(C([])));I&&I!==r&&i.call(I,o)&&(A=I);var g=p.prototype=d.prototype=Object.create(A);function S(t){["next","throw","return"].forEach((function(n){s(t,n,(function(t){return this._invoke(n,t)}))}))}function _(t,n){function r(e,o,u,a){var s=h(t[e],t,o);if("throw"!==s.type){var f=s.arg,c=f.value;return c&&"object"==typeof c&&i.call(c,"__await")?n.resolve(c.__await).then((function(t){r("next",t,u,a)}),(function(t){r("throw",t,u,a)})):n.resolve(c).then((function(t){f.value=t,u(f)}),(function(t){return r("throw",t,u,a)}))}a(s.arg)}var e;this._invoke=function(t,i){function o(){return new n((function(n,e){r(t,i,n,e)}))}return e=e?e.then(o,o):o()}}function M(t,r){var i=t.iterator[r.method];if(i===n){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=n,M(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var e=h(i,t.iterator,r.arg);if("throw"===e.type)return r.method="throw",r.arg=e.arg,r.delegate=null,y;var o=e.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=n),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function E(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function C(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,u=function r(){for(;++e<t.length;)if(i.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=n,r.done=!0,r};return u.next=u}}return{next:j}}function j(){return{value:n,done:!0}}return b.prototype=g.constructor=p,p.constructor=b,b.displayName=s(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===b||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},S(_.prototype),_.prototype[u]=function(){return this},t.AsyncIterator=_,t.async=function(n,r,i,e,o){void 0===o&&(o=Promise);var u=new _(f(n,r,i,e),o);return t.isGeneratorFunction(r)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},S(g),s(g,a,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var n=[];for(var r in t)n.push(r);return n.reverse(),function r(){for(;n.length;){var i=n.pop();if(i in t)return r.value=i,r.done=!1,r}return r.done=!0,r}},t.values=C,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(E),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function e(i,e){return a.type="throw",a.arg=t,r.next=i,e&&(r.method="next",r.arg=n),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return e("end");if(u.tryLoc<=this.prev){var s=i.call(u,"catchLoc"),f=i.call(u,"finallyLoc");if(s&&f){if(this.prev<u.catchLoc)return e(u.catchLoc,!0);if(this.prev<u.finallyLoc)return e(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return e(u.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return e(u.finallyLoc)}}}},abrupt:function(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc<=this.prev&&i.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var o=e;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=n&&n<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=t,u.arg=n,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(u)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),y},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),y}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var e=i.arg;E(r)}return e}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,i){return this.delegate={iterator:C(t),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=n),y}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}}));var gf=(t,n)=>`${t}-${n}-${Math.random().toString(16).slice(3,8)}`;let Sf=0;var _f=({id:t,action:n,payload:r={}})=>{let i=t;return void 0===i&&(i=gf("Job",Sf),Sf+=1),{id:i,action:n,payload:r}};let Mf=!1;var Of={logging:Mf,setLogging:t=>{Mf=t},log:(...t)=>Mf?console.log.apply(void 0,t):null};const{log:Ef}=Of;let kf=0;var Cf=o((function(t){t.exports=function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var n=document.createElement("base");if(n.href=arguments[0],1===t)return n.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(n,r.firstChild);for(var i,e=document.createElement("a"),o=1;o<t;o++)e.href=arguments[o],n.href=i=e.href;return r.removeChild(n),i}}));const jf="browser"===(()=>{const t={};return"undefined"!=typeof WorkerGlobalScope?t.type="webworker":"undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&process.versions.electron||"object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0?t.type="electron":"object"==typeof window?t.type="browser":"object"==typeof process&&"function"==typeof u&&(t.type="node"),t.type})()?Cf:t=>t;var Tf={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3},xf={defaultOEM:Tf.DEFAULT};const{version:Rf,dependencies:Nf}={_args:[["tesseract.js@2.1.5","/drone/src"]],_from:"tesseract.js@2.1.5",_id:"tesseract.js@2.1.5",_inBundle:!1,_integrity:"sha512-7CIS3SWr7TXpeaH9+HS7iUtVbCfPFYOO3p6rkRAkdtsOtrbz6496x59na6SCbFAIaZulQxy8BjwSu3qL3AoDRg==",_location:"/tesseract.js",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"tesseract.js@2.1.5",name:"tesseract.js",escapedName:"tesseract.js",rawSpec:"2.1.5",saveSpec:null,fetchSpec:"2.1.5"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/tesseract.js/-/tesseract.js-2.1.5.tgz",_spec:"2.1.5",_where:"/drone/src",author:"",browser:{"./src/worker/node/index.js":"./src/worker/browser/index.js"},bugs:{url:"https://github.com/naptha/tesseract.js/issues"},collective:{type:"opencollective",url:"https://opencollective.com/tesseractjs"},contributors:[{name:"jeromewu"}],dependencies:{"blueimp-load-image":"^3.0.0","bmp-js":"^0.1.0","file-type":"^12.4.1","idb-keyval":"^3.2.0","is-electron":"^2.2.0","is-url":"^1.2.4","jpeg-autorotate":"^7.1.1","node-fetch":"^2.6.0","opencollective-postinstall":"^2.0.2","regenerator-runtime":"^0.13.3","resolve-url":"^0.2.1","tesseract.js-core":"^2.2.0",zlibjs:"^0.3.1"},description:"Pure Javascript Multilingual OCR",devDependencies:{"@babel/core":"^7.7.7","@babel/preset-env":"^7.7.7",acorn:"^6.4.0","babel-loader":"^8.1.0",cors:"^2.8.5",eslint:"^7.2.0","eslint-config-airbnb-base":"^14.2.0","eslint-plugin-import":"^2.22.1","expect.js":"^0.3.1",express:"^4.17.1",mocha:"^8.1.3","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5",nyc:"^15.1.0",rimraf:"^2.7.1","wait-on":"^3.3.0",webpack:"^4.44.2","webpack-bundle-analyzer":"^3.6.0","webpack-cli":"^3.3.12","webpack-dev-middleware":"^3.7.2"},homepage:"https://github.com/naptha/tesseract.js",jsdelivr:"dist/tesseract.min.js",license:"Apache-2.0",main:"src/index.js",name:"tesseract.js",repository:{type:"git",url:"git+https://github.com/naptha/tesseract.js.git"},scripts:{build:"rimraf dist && webpack --config scripts/webpack.config.prod.js",lint:"eslint src","lint:fix":"eslint --fix src",postinstall:"opencollective-postinstall || true",prepublishOnly:"npm run build","profile:tesseract":"webpack-bundle-analyzer dist/tesseract-stats.json","profile:worker":"webpack-bundle-analyzer dist/worker-stats.json",start:"node scripts/server.js",test:"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:* test:node:all","test:browser-tpl":"mocha-headless-chrome -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:FS":"npm run test:browser-tpl -- -f ./tests/FS.test.html","test:browser:detect":"npm run test:browser-tpl -- -f ./tests/detect.test.html","test:browser:recognize":"npm run test:browser-tpl -- -f ./tests/recognize.test.html","test:browser:scheduler":"npm run test:browser-tpl -- -f ./tests/scheduler.test.html","test:node":"nyc mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js",wait:"rimraf dist && wait-on http://localhost:3000/dist/tesseract.dev.js"},types:"src/index.d.ts",unpkg:"dist/tesseract.min.js",version:"2.1.5"};var Pf={langPath:"https://tessdata.projectnaptha.com/4.0.0",workerBlobURL:!0,logger:()=>{},workerPath:"undefined"!=typeof process&&"development"===process.env.TESS_ENV?Cf(`/dist/worker.dev.js?nocache=${Math.random().toString(36).slice(3)}`):`https://unpkg.com/tesseract.js@v${Rf}/dist/worker.min.js`,corePath:`https://unpkg.com/tesseract.js-core@v${Nf["tesseract.js-core"].substring(1)}/tesseract-core.${"object"==typeof WebAssembly?"wasm":"asm"}.js`},Df=o((function(t){!function(n){function r(t,n,i){var e,o=document.createElement("img");function u(n,u){u&&console.log(u),n&&r.isInstanceOf("Blob",n)?e=r.createObjectURL(t=n):(e=t,i&&i.crossOrigin&&(o.crossOrigin=i.crossOrigin)),o.src=e}return o.onerror=function(u){return r.onerror(o,u,t,e,n,i)},o.onload=function(u){return r.onload(o,u,t,e,n,i)},"string"==typeof t?(r.hasMetaOption(i)?r.fetchBlob(t,u,i):u(),o):r.isInstanceOf("Blob",t)||r.isInstanceOf("File",t)?(e=r.createObjectURL(t))?(o.src=e,o):r.readFile(t,(function(t){var r=t.target;r&&r.result?o.src=r.result:n&&n(t)})):void 0}var i=n.createObjectURL&&n||n.URL&&URL.revokeObjectURL&&URL||n.webkitURL&&webkitURL;function e(t,n){!t||"blob:"!==t.slice(0,5)||n&&n.noRevoke||r.revokeObjectURL(t)}r.hasMetaOption=function(t){return t&&t.meta},r.fetchBlob=function(t,n){n()},r.isInstanceOf=function(t,n){return Object.prototype.toString.call(n)==="[object "+t+"]"},r.transform=function(t,n,r,i,e){r(t,e)},r.onerror=function(t,n,r,i,o,u){e(i,u),o&&o.call(t,n)},r.onload=function(t,n,i,o,u,a){e(o,a),u&&r.transform(t,a,u,i,{originalWidth:t.naturalWidth||t.width,originalHeight:t.naturalHeight||t.height})},r.createObjectURL=function(t){return!!i&&i.createObjectURL(t)},r.revokeObjectURL=function(t){return!!i&&i.revokeObjectURL(t)},r.readFile=function(t,r,i){if(n.FileReader){var e=new FileReader;if(e.onload=e.onerror=r,e[i=i||"readAsDataURL"])return e[i](t),e}return!1},t.exports?t.exports=r:n.loadImage=r}("undefined"!=typeof window&&window||a)}));o((function(t){!function(t){var n=t.transform;t.transform=function(r,i,e,o,u){n.call(t,t.scale(r,i,u),i,e,o,u)},t.transformCoordinates=function(){},t.getTransformedOptions=function(t,n){var r,i,e,o,u=n.aspectRatio;if(!u)return n;for(i in r={},n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);return r.crop=!0,(e=t.naturalWidth||t.width)/(o=t.naturalHeight||t.height)>u?(r.maxWidth=o*u,r.maxHeight=o):(r.maxWidth=e,r.maxHeight=e/u),r},t.renderImageToCanvas=function(t,n,r,i,e,o,u,a,s,f,h){var c=t.getContext("2d");return!1===h.imageSmoothingEnabled?c.imageSmoothingEnabled=!1:h.imageSmoothingQuality&&(c.imageSmoothingQuality=h.imageSmoothingQuality),c.drawImage(n,r,i,e,o,u,a,s,f),t},t.hasCanvasOption=function(t){return t.canvas||t.crop||!!t.aspectRatio},t.scale=function(n,r,i){r=r||{};var e,o,u,a,s,f,h,c,l,w,v,y=document.createElement("canvas"),d=n.getContext||t.hasCanvasOption(r)&&y.getContext,b=n.naturalWidth||n.width,p=n.naturalHeight||n.height,A=b,m=p;function I(){var t=Math.max((u||A)/A,(a||m)/m);t>1&&(A*=t,m*=t)}function g(){var t=Math.min((e||A)/A,(o||m)/m);t<1&&(A*=t,m*=t)}if(d&&(h=(r=t.getTransformedOptions(n,r,i)).left||0,c=r.top||0,r.sourceWidth?(s=r.sourceWidth,void 0!==r.right&&void 0===r.left&&(h=b-s-r.right)):s=b-h-(r.right||0),r.sourceHeight?(f=r.sourceHeight,void 0!==r.bottom&&void 0===r.top&&(c=p-f-r.bottom)):f=p-c-(r.bottom||0),A=s,m=f),e=r.maxWidth,o=r.maxHeight,u=r.minWidth,a=r.minHeight,d&&e&&o&&r.crop?(A=e,m=o,(v=s/f-e/o)<0?(f=o*s/e,void 0===r.top&&void 0===r.bottom&&(c=(p-f)/2)):v>0&&(s=e*f/o,void 0===r.left&&void 0===r.right&&(h=(b-s)/2))):((r.contain||r.cover)&&(u=e=e||u,a=o=o||a),r.cover?(g(),I()):(I(),g())),d){if((l=r.pixelRatio)>1&&(y.style.width=A+"px",y.style.height=m+"px",A*=l,m*=l,y.getContext("2d").scale(l,l)),(w=r.downsamplingRatio)>0&&w<1&&A<s&&m<f)for(;s*w>A;)y.width=s*w,y.height=f*w,t.renderImageToCanvas(y,n,h,c,s,f,0,0,y.width,y.height,r),h=0,c=0,s=y.width,f=y.height,(n=document.createElement("canvas")).width=s,n.height=f,t.renderImageToCanvas(n,y,0,0,s,f,0,0,s,f,r);return y.width=A,y.height=m,t.transformCoordinates(y,r),t.renderImageToCanvas(y,n,h,c,s,f,0,0,A,m,r)}return n.width=A,n.height=m,n}}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){var n="undefined"!=typeof Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);t.blobSlice=n&&function(){var t=this.slice||this.webkitSlice||this.mozSlice;return t.apply(this,arguments)},t.metaDataParsers={jpeg:{65505:[],65517:[]}},t.parseMetaData=function(n,r,i,e){i=i||{},e=e||{};var o=this;"undefined"!=typeof DataView&&n&&n.size>=12&&"image/jpeg"===n.type&&t.blobSlice&&t.readFile(t.blobSlice.call(n,0,i.maxMetaDataSize||262144),(function(n){if(n.target.error)return console.log(n.target.error),void r(e);var u,a,s,f,h=n.target.result,c=new DataView(h),l=2,w=c.byteLength-4,v=l;if(65496===c.getUint16(0)){for(;l<w&&((u=c.getUint16(l))>=65504&&u<=65519||65534===u);){if(l+(a=c.getUint16(l+2)+2)>c.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if((s=t.metaDataParsers.jpeg[u])&&!i.disableMetaDataParsers)for(f=0;f<s.length;f+=1)s[f].call(o,c,l,a,e,i);v=l+=a}!i.disableImageHead&&v>6&&(e.imageHead=h.slice?h.slice(0,v):new Uint8Array(h).subarray(0,v))}else console.log("Invalid JPEG file: Missing JPEG marker.");r(e)}),"readAsArrayBuffer")||r(e)},t.replaceHead=function(n,r,i){t.parseMetaData(n,(function(e){i(new Blob([r,t.blobSlice.call(n,e.imageHead.byteLength)],{type:"image/jpeg"}))}),{maxMetaDataSize:256,disableMetaDataParsers:!0})};var r=t.transform;t.transform=function(n,i,e,o,u){t.hasMetaOption(i)?t.parseMetaData(o,(function(u){r.call(t,n,i,e,o,u)}),i,u):r.apply(t,arguments)}}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){"undefined"!=typeof fetch&&"undefined"!=typeof Request?t.fetchBlob=function(t,n,r){fetch(new Request(t,r)).then((function(t){return t.blob()})).then(n).catch((function(t){n(null,t)}))}:"undefined"!=typeof XMLHttpRequest&&"undefined"!=typeof ProgressEvent&&(t.fetchBlob=function(t,n,r){r=r||{};var i=new XMLHttpRequest;i.open(r.method||"GET",t),r.headers&&Object.keys(r.headers).forEach((function(t){i.setRequestHeader(t,r.headers[t])})),i.withCredentials="include"===r.credentials,i.responseType="blob",i.onload=function(){n(i.response)},i.onerror=i.onabort=i.ontimeout=function(t){n(null,t)},i.send(r.body)})}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){function n(t){t&&(Object.defineProperty(this,"map",{value:this.privateIFDs[t].map}),Object.defineProperty(this,"tags",{value:this.tags&&this.tags[t]||{}}))}n.prototype.map={Orientation:274,Thumbnail:513,Exif:34665,GPSInfo:34853,Interoperability:40965},n.prototype.privateIFDs={34665:{name:"Exif",map:{}},34853:{name:"GPSInfo",map:{}},40965:{name:"Interoperability",map:{}}},n.prototype.get=function(t){return this[t]||this[this.map[t]]};var r={1:{getValue:function(t,n){return t.getUint8(n)},size:1},2:{getValue:function(t,n){return String.fromCharCode(t.getUint8(n))},size:1,ascii:!0},3:{getValue:function(t,n,r){return t.getUint16(n,r)},size:2},4:{getValue:function(t,n,r){return t.getUint32(n,r)},size:4},5:{getValue:function(t,n,r){return t.getUint32(n,r)/t.getUint32(n+4,r)},size:8},9:{getValue:function(t,n,r){return t.getInt32(n,r)},size:4},10:{getValue:function(t,n,r){return t.getInt32(n,r)/t.getInt32(n+4,r)},size:8}};function i(t,n,i,e,o,u){var a,s,f,h,c,l,w=r[e];if(w){if(!((s=(a=w.size*o)>4?n+t.getUint32(i+8,u):i+8)+a>t.byteLength)){if(1===o)return w.getValue(t,s,u);for(f=[],h=0;h<o;h+=1)f[h]=w.getValue(t,s+h*w.size,u);if(w.ascii){for(c="",h=0;h<f.length&&"\0"!==(l=f[h]);h+=1)c+=l;return c}return f}console.log("Invalid Exif data: Invalid data offset.")}else console.log("Invalid Exif data: Invalid tag type.")}function e(t,n,r,e,o,u,a,s){var f,h,c,l,w,v;if(r+6>t.byteLength)console.log("Invalid Exif data: Invalid directory offset.");else{if(!((h=r+2+12*(f=t.getUint16(r,e)))+4>t.byteLength)){for(c=0;c<f;c+=1)w=t.getUint16(l=r+2+12*c,e),a&&!a[w]||s&&!0===s[w]||(v=i(t,n,l,t.getUint16(l+2,e),t.getUint32(l+4,e),e),o[w]=v,u&&(u[w]=l));return t.getUint32(h,e)}console.log("Invalid Exif data: Invalid directory size.")}}r[7]=r[1],t.parseExifData=function(t,r,i,o,u){if(!u.disableExif){var a,s,f=u.includeExifTags,h=u.excludeExifTags||{34665:{37500:!0}},c=r+10;if(1165519206===t.getUint32(r+4))if(c+8>t.byteLength)console.log("Invalid Exif data: Invalid segment size.");else if(0===t.getUint16(r+8)){switch(t.getUint16(c)){case 18761:a=!0;break;case 19789:a=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}42===t.getUint16(c+2,a)?(s=t.getUint32(c+4,a),o.exif=new n,u.disableExifOffsets||(o.exifOffsets=new n,o.exifTiffOffset=c,o.exifLittleEndian=a),(s=e(t,c,c+s,a,o.exif,o.exifOffsets,f,h))&&!u.disableExifThumbnail&&(s=e(t,c,c+s,a,o.exif,o.exifOffsets,f,h),o.exif[513]&&o.exif[514]&&(o.exif[513]=function(t,n,r){if(r&&!(n+r>t.byteLength))return new Blob([t.buffer.slice(n,n+r)],{type:"image/jpeg"});console.log("Invalid Exif data: Invalid thumbnail data.")}(t,c+o.exif[513],o.exif[514]))),Object.keys(o.exif.privateIFDs).forEach((function(r){!function(t,r,i,o,u,a,s){var f=t.exif[r];f&&(t.exif[r]=new n(r),t.exifOffsets&&(t.exifOffsets[r]=new n(r)),e(i,o,o+f,u,t.exif[r],t.exifOffsets&&t.exifOffsets[r],a&&a[r],s&&s[r]))}(o,r,t,c,a,f,h)}))):console.log("Invalid Exif data: Missing TIFF marker.")}else console.log("Invalid Exif data: Missing byte alignment offset.")}},t.metaDataParsers.jpeg[65505].push(t.parseExifData),t.exifWriters={274:function(t,n,r){return new DataView(t,n.exifOffsets[274]+8,2).setUint16(0,r,n.exifLittleEndian),t}},t.writeExifData=function(n,r,i,e){t.exifWriters[r.exif.map[i]](n,r,e)},t.ExifMap=n}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){var n=t.ExifMap.prototype;n.tags={256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",34665:{36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber"},34853:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},40965:{1:"InteroperabilityIndex"}},n.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}},n.getText=function(t){var n=this.get(t);switch(t){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":case"Orientation":return this.stringValues[t][n];case"ExifVersion":case"FlashpixVersion":if(!n)return;return String.fromCharCode(n[0],n[1],n[2],n[3]);case"ComponentsConfiguration":if(!n)return;return this.stringValues[t][n[0]]+this.stringValues[t][n[1]]+this.stringValues[t][n[2]]+this.stringValues[t][n[3]];case"GPSVersionID":if(!n)return;return n[0]+"."+n[1]+"."+n[2]+"."+n[3]}return String(n)},n.getAll=function(){var t,n,r,i={};for(t in this)Object.prototype.hasOwnProperty.call(this,t)&&((n=this[t])&&n.getAll?i[this.privateIFDs[t].name]=n.getAll():(r=this.tags[t])&&(i[r]=this.getText(r)));return i},n.getName=function(t){var n=this.tags[t];return"object"==typeof n?this.privateIFDs[t].name:n},function(){var t,r,i,e=n.tags;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))if(r=n.privateIFDs[t])for(t in i=e[t])Object.prototype.hasOwnProperty.call(i,t)&&(r.map[i[t]]=Number(t));else n.map[e[t]]=Number(t)}()}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){function n(){}function r(t,n,r,i,e){return"binary"===n.types[t]?new Blob([r.buffer.slice(i,i+e)]):"Uint16"===n.types[t]?r.getUint16(i):function(t,n,r){for(var i="",e=n+r,o=n;o<e;o+=1)i+=String.fromCharCode(t.getUint8(o));return i}(r,i,e)}function i(t,n){return void 0===t?n:t instanceof Array?(t.push(n),t):[t,n]}function e(t,n,e,o,u,a){for(var s,f,h,c=n+e,l=n;l<c;)28===t.getUint8(l)&&2===t.getUint8(l+1)&&(h=t.getUint8(l+2),u&&!u[h]||a&&a[h]||(f=t.getInt16(l+3),s=r(h,o.iptc,t,l+5,f),o.iptc[h]=i(o.iptc[h],s),o.iptcOffsets&&(o.iptcOffsets[h]=l))),l+=1}function o(t,n){return 943868237===t.getUint32(n)&&1028===t.getUint16(n+4)}function u(t,n){var r=t.getUint8(n+7);return r%2!=0&&(r+=1),0===r&&(r=4),r}n.prototype.map={ObjectName:5},n.prototype.types={0:"Uint16",200:"Uint16",201:"Uint16",202:"binary"},n.prototype.get=function(t){return this[t]||this[this.map[t]]},t.parseIptcData=function(t,r,i,a,s){if(!s.disableIptc)for(var f=r+i;r+8<f;){if(o(t,r)){var h=u(t,r),c=r+8+h;if(c>f){console.log("Invalid IPTC data: Invalid segment offset.");break}var l=t.getUint16(r+6+h);if(r+l>f){console.log("Invalid IPTC data: Invalid segment size.");break}return a.iptc=new n,s.disableIptcOffsets||(a.iptcOffsets=new n),void e(t,c,l,a,s.includeIptcTags,s.excludeIptcTags||{202:!0})}r+=1}},t.metaDataParsers.jpeg[65517].push(t.parseIptcData),t.IptcMap=n}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){var n=t.IptcMap.prototype;n.tags={0:"ApplicationRecordVersion",3:"ObjectTypeReference",4:"ObjectAttributeReference",5:"ObjectName",7:"EditStatus",8:"EditorialUpdate",10:"Urgency",12:"SubjectReference",15:"Category",20:"SupplementalCategories",22:"FixtureIdentifier",25:"Keywords",26:"ContentLocationCode",27:"ContentLocationName",30:"ReleaseDate",35:"ReleaseTime",37:"ExpirationDate",38:"ExpirationTime",40:"SpecialInstructions",42:"ActionAdvised",45:"ReferenceService",47:"ReferenceDate",50:"ReferenceNumber",55:"DateCreated",60:"TimeCreated",62:"DigitalCreationDate",63:"DigitalCreationTime",65:"OriginatingProgram",70:"ProgramVersion",75:"ObjectCycle",80:"Byline",85:"BylineTitle",90:"City",92:"Sublocation",95:"State",100:"CountryCode",101:"Country",103:"OriginalTransmissionReference",105:"Headline",110:"Credit",115:"Source",116:"CopyrightNotice",118:"Contact",120:"Caption",121:"LocalCaption",122:"Writer",125:"RasterizedCaption",130:"ImageType",131:"ImageOrientation",135:"LanguageIdentifier",150:"AudioType",151:"AudioSamplingRate",152:"AudioSamplingResolution",153:"AudioDuration",154:"AudioOutcue",184:"JobID",185:"MasterDocumentID",186:"ShortDocumentID",187:"UniqueDocumentID",188:"OwnerID",200:"ObjectPreviewFileFormat",201:"ObjectPreviewFileVersion",202:"ObjectPreviewData",221:"Prefs",225:"ClassifyState",228:"SimilarityIndex",230:"DocumentNotes",231:"DocumentHistory",232:"ExifCameraInfo",255:"CatalogSets"},n.stringValues={10:{0:"0 (reserved)",1:"1 (most urgent)",2:"2",3:"3",4:"4",5:"5 (normal urgency)",6:"6",7:"7",8:"8 (least urgent)",9:"9 (user-defined priority)"},75:{a:"Morning",b:"Both Morning and Evening",p:"Evening"},131:{L:"Landscape",P:"Portrait",S:"Square"}},n.getText=function(t){var n=this.get(t),r=this.stringValues[this.map[t]];return r?r[n]:String(n)},n.getAll=function(){var t,n,r={};for(t in this)Object.prototype.hasOwnProperty.call(this,t)&&(n=this.tags[t])&&(r[n]=this.getText(n));return r},n.getName=function(t){return this.tags[t]},function(){var t,r=n.tags,i=n.map||{};for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&(i[r[t]]=Number(t))}()}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){var n,r=t.hasCanvasOption,i=t.hasMetaOption,e=t.transformCoordinates,o=t.getTransformedOptions;(n=document.createElement("img")).onload=function(){t.orientation=1===n.width&&2===n.height},n.src="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==",t.hasCanvasOption=function(n){return 1==!!n.orientation&&!t.orientation||n.orientation>1&&n.orientation<9||r.call(t,n)},t.hasMetaOption=function(n){return n&&!0===n.orientation&&!t.orientation||i.call(t,n)},t.transformCoordinates=function(n,r){e.call(t,n,r);var i=n.getContext("2d"),o=n.width,u=n.height,a=n.style.width,s=n.style.height,f=r.orientation;if(f>1&&f<9)switch(f>4&&(n.width=u,n.height=o,n.style.width=s,n.style.height=a),f){case 2:i.translate(o,0),i.scale(-1,1);break;case 3:i.translate(o,u),i.rotate(Math.PI);break;case 4:i.translate(0,u),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-u);break;case 7:i.rotate(.5*Math.PI),i.translate(o,-u),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-o,0)}},t.getTransformedOptions=function(n,r,i){var e,u,a=o.call(t,n,r),s=a.orientation;if(!0===s){if(t.orientation)return a;s=i&&i.exif&&i.exif.get("Orientation")}if(!(s>1&&s<9))return a;for(u in e={},a)Object.prototype.hasOwnProperty.call(a,u)&&(e[u]=a[u]);switch(e.orientation=s,s){case 2:e.left=a.right,e.right=a.left;break;case 3:e.left=a.right,e.top=a.bottom,e.right=a.left,e.bottom=a.top;break;case 4:e.top=a.bottom,e.bottom=a.top;break;case 5:e.left=a.top,e.top=a.left,e.right=a.bottom,e.bottom=a.right;break;case 6:e.left=a.top,e.top=a.right,e.right=a.bottom,e.bottom=a.left;break;case 7:e.left=a.bottom,e.top=a.right,e.right=a.top,e.bottom=a.left;break;case 8:e.left=a.bottom,e.top=a.left,e.right=a.top,e.bottom=a.right}return e.orientation>4&&(e.maxWidth=a.maxHeight,e.maxHeight=a.maxWidth,e.minWidth=a.minHeight,e.minHeight=a.minWidth,e.sourceWidth=a.sourceHeight,e.sourceHeight=a.sourceWidth),e}}(t.exports?Df:window.loadImage)}));var Lf=Df;const Ff=t=>new Promise(((n,r)=>{const i=new FileReader;i.onload=()=>{n(i.result)},i.onerror=({target:{error:{code:t}}})=>{r(Error(`File could not be read! Code=${t}`))},i.readAsArrayBuffer(t)})),Uf=t=>new Promise((n=>{Lf(t,(t=>t.toBlob(n)),{orientation:!0,canvas:!0})})),Bf=async t=>{let n=t;if(void 0===t)return"undefined";if("string"==typeof t)if(t.endsWith(".pbm")){const r=await fetch(Cf(t));n=await r.arrayBuffer()}else{let r=t;/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(t)||(r=Cf(t)),n=await Ff(await Uf(r))}else if(t instanceof HTMLElement)"IMG"===t.tagName&&(n=await Bf(t.src)),"VIDEO"===t.tagName&&(n=await Bf(t.poster)),"CANVAS"===t.tagName&&await new Promise((r=>{t.toBlob((async t=>{n=await Ff(t),r()}))}));else if(t instanceof File||t instanceof Blob){let r=t;t.name.endsWith(".pbm")||(r=await Uf(r)),n=await Ff(r)}return new Uint8Array(n)};var Gf={defaultOptions:Pf,spawnWorker:({workerPath:t,workerBlobURL:n})=>{let r;if(Blob&&URL&&n){const n=new Blob([`importScripts("${t}");`],{type:"application/javascript"});r=new Worker(URL.createObjectURL(n))}else r=new Worker(t);return r},terminateWorker:t=>{t.terminate()},onMessage:(t,n)=>{t.onmessage=({data:t})=>{n(t)}},send:async(t,n)=>{t.postMessage(n)},loadImage:Bf};const{log:zf}=Of,{defaultOEM:Hf}=xf,{defaultOptions:Qf,spawnWorker:Vf,terminateWorker:Wf,onMessage:Yf,loadImage:Kf,send:Xf}=Gf;let $f=0;var qf=(t={})=>{const n=gf("Worker",$f),{logger:r,errorHandler:i,...e}=(t=>{const n={...t};return["corePath","workerPath","langPath"].forEach((r=>{void 0!==t[r]&&(n[r]=jf(n[r]))})),n})({...Qf,...t}),o={},u={};let a=Vf(e);$f+=1;const s=(t,n)=>{o[t]=n},f=(t,n)=>{u[t]=n},h=({id:t,action:r,payload:i})=>new Promise(((e,o)=>{zf(`[${n}]: Start ${t}, action=${r}`),s(r,e),f(r,o),Xf(a,{workerId:n,jobId:t,action:r,payload:i})}));return Yf(a,(({workerId:t,jobId:n,status:e,action:a,data:s})=>{if("resolve"===e){zf(`[${t}]: Complete ${n}`);let r=s;"recognize"===a?r=(t=>{const n=[],r=[],i=[],e=[],o=[];return t.blocks.forEach((u=>{u.paragraphs.forEach((n=>{n.lines.forEach((r=>{r.words.forEach((i=>{i.symbols.forEach((e=>{o.push({...e,page:t,block:u,paragraph:n,line:r,word:i})})),e.push({...i,page:t,block:u,paragraph:n,line:r})})),i.push({...r,page:t,block:u,paragraph:n})})),r.push({...n,page:t,block:u})})),n.push({...u,page:t})})),{...t,blocks:n,paragraphs:r,lines:i,words:e,symbols:o}})(s):"getPDF"===a&&(r=Array.from({...s,length:Object.keys(s).length})),o[a]({jobId:n,data:r})}else if("reject"===e){if(u[a](s),!i)throw Error(s);i(s)}else"progress"===e&&r({...s,userJobId:n})})),{id:n,worker:a,setResolve:s,setReject:f,load:t=>h(_f({id:t,action:"load",payload:{options:e}})),writeText:(t,n,r)=>h(_f({id:r,action:"FS",payload:{method:"writeFile",args:[t,n]}})),readText:(t,n)=>h(_f({id:n,action:"FS",payload:{method:"readFile",args:[t,{encoding:"utf8"}]}})),removeFile:(t,n)=>h(_f({id:n,action:"FS",payload:{method:"unlink",args:[t]}})),FS:(t,n,r)=>h(_f({id:r,action:"FS",payload:{method:t,args:n}})),loadLanguage:(t="eng",n)=>h(_f({id:n,action:"loadLanguage",payload:{langs:t,options:e}})),initialize:(t="eng",n=Hf,r)=>h(_f({id:r,action:"initialize",payload:{langs:t,oem:n}})),setParameters:(t={},n)=>h(_f({id:n,action:"setParameters",payload:{params:t}})),recognize:async(t,n={},r)=>h(_f({id:r,action:"recognize",payload:{image:await Kf(t),options:n}})),getPDF:(t="Tesseract OCR Result",n=!1,r)=>h(_f({id:r,action:"getPDF",payload:{title:t,textonly:n}})),detect:async(t,n)=>h(_f({id:n,action:"detect",payload:{image:await Kf(t)}})),terminate:async()=>(null!==a&&(Wf(a),a=null),Promise.resolve())}},Zf={recognize:async(t,n,r)=>{const i=qf(r);return await i.load(),await i.loadLanguage(n),await i.initialize(n),i.recognize(t).finally((async()=>{await i.terminate()}))},detect:async(t,n)=>{const r=qf(n);return await r.load(),await r.loadLanguage("osd"),await r.initialize("osd"),r.detect(t).finally((async()=>{await r.terminate()}))}};const{setLogging:Jf}=Of;var th={languages:{AFR:"afr",AMH:"amh",ARA:"ara",ASM:"asm",AZE:"aze",AZE_CYRL:"aze_cyrl",BEL:"bel",BEN:"ben",BOD:"bod",BOS:"bos",BUL:"bul",CAT:"cat",CEB:"ceb",CES:"ces",CHI_SIM:"chi_sim",CHI_TRA:"chi_tra",CHR:"chr",CYM:"cym",DAN:"dan",DEU:"deu",DZO:"dzo",ELL:"ell",ENG:"eng",ENM:"enm",EPO:"epo",EST:"est",EUS:"eus",FAS:"fas",FIN:"fin",FRA:"fra",FRK:"frk",FRM:"frm",GLE:"gle",GLG:"glg",GRC:"grc",GUJ:"guj",HAT:"hat",HEB:"heb",HIN:"hin",HRV:"hrv",HUN:"hun",IKU:"iku",IND:"ind",ISL:"isl",ITA:"ita",ITA_OLD:"ita_old",JAV:"jav",JPN:"jpn",KAN:"kan",KAT:"kat",KAT_OLD:"kat_old",KAZ:"kaz",KHM:"khm",KIR:"kir",KOR:"kor",KUR:"kur",LAO:"lao",LAT:"lat",LAV:"lav",LIT:"lit",MAL:"mal",MAR:"mar",MKD:"mkd",MLT:"mlt",MSA:"msa",MYA:"mya",NEP:"nep",NLD:"nld",NOR:"nor",ORI:"ori",PAN:"pan",POL:"pol",POR:"por",PUS:"pus",RON:"ron",RUS:"rus",SAN:"san",SIN:"sin",SLK:"slk",SLV:"slv",SPA:"spa",SPA_OLD:"spa_old",SQI:"sqi",SRP:"srp",SRP_LATN:"srp_latn",SWA:"swa",SWE:"swe",SYR:"syr",TAM:"tam",TEL:"tel",TGK:"tgk",TGL:"tgl",THA:"tha",TIR:"tir",TUR:"tur",UIG:"uig",UKR:"ukr",URD:"urd",UZB:"uzb",UZB_CYRL:"uzb_cyrl",VIE:"vie",YID:"yid"},OEM:Tf,PSM:{OSD_ONLY:"0",AUTO_OSD:"1",AUTO_ONLY:"2",AUTO:"3",SINGLE_COLUMN:"4",SINGLE_BLOCK_VERT_TEXT:"5",SINGLE_BLOCK:"6",SINGLE_LINE:"7",SINGLE_WORD:"8",CIRCLE_WORD:"9",SINGLE_CHAR:"10",SPARSE_TEXT:"11",SPARSE_TEXT_OSD:"12"},createScheduler:()=>{const t=gf("Scheduler",kf),n={},r={};let i=[];kf+=1;const e=()=>Object.keys(n).length,o=()=>{if(0!==i.length){const t=Object.keys(n);for(let e=0;e<t.length;e+=1)if(void 0===r[t[e]]){i[0](n[t[e]]);break}}};return{addWorker:r=>(n[r.id]=r,Ef(`[${t}]: Add ${r.id}`),Ef(`[${t}]: Number of workers=${e()}`),o(),r.id),addJob:async(n,...u)=>{if(0===e())throw Error(`[${t}]: You need to have at least one worker before adding jobs`);return((n,e)=>new Promise(((u,a)=>{const s=_f({action:n,payload:e});i.push((async t=>{i.shift(),r[t.id]=s;try{u(await t[n].apply(void 0,[...e,s.id]))}catch(t){a(t)}finally{delete r[t.id],o()}})),Ef(`[${t}]: Add ${s.id} to JobQueue`),Ef(`[${t}]: JobQueue length=${i.length}`),o()})))(n,u)},terminate:async()=>{Object.keys(n).forEach((async t=>{await n[t].terminate()})),i=[]},getQueueLen:()=>i.length,getNumWorkers:e}},createWorker:qf,setLogging:Jf,...Zf};let nh=class{constructor(r){t(this,r),this.onSymbol=n(this,"onSymbol",7),this.MODE_SINGLE="Single",this.MODE_STREAMING="Streaming",this.NOT_ALLOWED_ERROR="NotAllowedError",this.errorText="",this.realZoom=1,this.aspectRatio=0,this.stageWidth=0,this.stageHeight=0,this.videoHeight=0,this.videoWidth=0,this.sampleX=0,this.sampleY=0,this.sampleWidth=0,this.sampleHeight=0,this.scanWidth=0,this.scanHeight=0,this.available=!1,this.targetVideoSize=1920,this.targetFrameRate=60,this.zoom=0,this.cropX=1,this.cropY=1,this.ocrScanner=!1,this.ocrIsScanning=!1,this.errorText="",this.noPermission=!1}ocrHandler(){this.ocrScanner&&(this.ocrIsScanning=!this.ocrIsScanning)}openCameraHandler(){this.available=!1,this.twintagScannerRef&&(this.twintagScannerRef.style.display="block"),this.ocrScanner&&(this.ocrIsScanning=!1),this.getMedia()}closeHandler(){this.available&&(console.log(this.available),this.twintagScannerRef&&(this.twintagScannerRef.style.display="none"),this.stopStream())}componentWillLoad(){this.codeReader=new He}componentDidLoad(){this.video=this.videoElement,this.osCanvas=document.createElement("canvas"),this.osContext=this.osCanvas.getContext("2d"),this.getMedia(),this.videoContainerRef.style.setProperty("--xCrop",this.setLength(this.cropX)),this.videoContainerRef.style.setProperty("--yCrop",this.setLength(this.cropY))}setLength(t){return""+50*(1-t)}render(){return r("div",{class:"scanner-container"},this.noPermission?r("div",null,this.errorText):null,this.customCheckIcon?r("img",{class:"check-icon",src:this.customCheckIcon,ref:t=>this.successIcon=t}):r("svg",{class:"check-icon",ref:t=>this.successIcon=t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 150 150",width:"150px",height:"150px"},r("g",null,r("path",{style:{stroke:"none",fillRule:"nonzero",fill:"rgb(23.529412%,54.901963%,98.039216%)",fillOpacity:"1",transform:"translateX(10%)"},d:"M 125.8125 25.875 C 123.820312 25.945312 121.992188 27 120.9375 28.6875 L 64.5 115.03125 L 27.9375 83.4375 C 26.367188 81.808594 24.011719 81.199219 21.84375 81.878906 C 19.6875 82.546875 18.082031 84.375 17.707031 86.601562 C 17.332031 88.839844 18.234375 91.089844 20.0625 92.4375 L 61.875 128.625 C 63.1875 129.738281 64.921875 130.230469 66.621094 129.984375 C 68.332031 129.726562 69.84375 128.753906 70.78125 127.3125 L 131.0625 35.25 C 132.351562 33.363281 132.457031 30.925781 131.34375 28.933594 C 130.230469 26.953125 128.085938 25.769531 125.8125 25.875 Z M 125.8125 25.875 "}),r("path",{style:{stroke:"none",fillRule:"nonzero",fill:"rgb(23.529412%,54.901963%,98.039216%)",fillOpacity:"1",transform:"translateX(-10%)"},d:"M 125.8125 25.875 C 123.820312 25.945312 121.992188 27 120.9375 28.6875 L 64.5 115.03125 L 27.9375 83.4375 C 26.367188 81.808594 24.011719 81.199219 21.84375 81.878906 C 19.6875 82.546875 18.082031 84.375 17.707031 86.601562 C 17.332031 88.839844 18.234375 91.089844 20.0625 92.4375 L 61.875 128.625 C 63.1875 129.738281 64.921875 130.230469 66.621094 129.984375 C 68.332031 129.726562 69.84375 128.753906 70.78125 127.3125 L 131.0625 35.25 C 132.351562 33.363281 132.457031 30.925781 131.34375 28.933594 C 130.230469 26.953125 128.085938 25.769531 125.8125 25.875 Z M 125.8125 25.875 "}))),r("div",{class:"video-container",ref:t=>this.videoContainerRef=t},r("video",{autoplay:!0,playsinline:!0,ref:t=>this.videoElement=t})))}getMedia(){let t,n;!function(t){t[t.user=0]="user",t[t.environment=1]="environment",t[t.left=2]="left",t[t.right=3]="right"}(t||(t={})),function(t){t[t.none=0]="none",t[t["crop-and-scale"]=1]="crop-and-scale"}(n||(n={})),navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:t[t.environment],width:{ideal:this.targetVideoSize},height:{ideal:this.targetVideoSize},frameRate:{ideal:this.targetFrameRate},resizeMode:n[n.none],zoom:!0}}).then((t=>e(this,void 0,void 0,(function*(){window.localStream=t;const[n]=t.getVideoTracks();if(void 0!==n.getCapabilities){const t=n.getCapabilities();if("zoom"in n.getSettings()){const r=t.zoom.min,i=t.zoom.step,e=Math.min((t.zoom.max-r)/r,this.zoom),o=r+Math.floor((r*e-r)/i)*i;this.realZoom=o/r,n.applyConstraints({advanced:[{zoom:o}]})}}this.video.srcObject=t,yield this.video.play(),If.to(this.videoContainerRef,{duration:.2,opacity:1}),(()=>{e(this,void 0,void 0,(function*(){this.ocrScanner&&(this.worker=th.createWorker(),yield this.worker.load(),yield this.worker.loadLanguage("eng"),yield this.worker.initialize("eng"))}))})(),this.available=!0,this.initRenderer()})))).catch((t=>{t.name===this.NOT_ALLOWED_ERROR?(this.noPermission=!0,this.errorText="Camera Permission Denied ..."):this.errorText=t.message}))}tick(){return e(this,void 0,void 0,(function*(){const t=this.video;if(this.video.readyState===t.HAVE_ENOUGH_DATA){let n=t.videoWidth,r=t.videoHeight,i=.5*n-this.cropX*n*.5,e=.5*r-this.cropY*r*.5;this.aspectRatio=n/r,this.videoHeight==r&&this.videoWidth==n||(this.osCanvas.width=n*this.cropX,this.osCanvas.height=r*this.cropY,this.videoWidth=n,this.videoHeight=r,console.log("video",n,r),console.log("sample",n,r,i,e),console.log("scan",n,r),this.resize()),this.scanning||(this.scanning=!0,this.osContext.drawImage(t,i,e,n,r,0,0,n,r),this.scan())}this.animateFrames()}))}initRenderer(){this.stageWidth=this.video.videoWidth,this.stageHeight=this.video.videoHeight,this.app=new s({height:this.stageHeight,width:this.stageWidth,view:this.video}),this.animateFrames(),window.addEventListener("resize",(()=>this.resize()))}animateFrames(){null!==this.video.srcObject&&(this.animationFrameRequest=requestAnimationFrame((()=>{this.tick()})))}scan(){return e(this,void 0,void 0,(function*(){yield this._scan(),this.scanning=!1}))}_scan(){var t;return e(this,void 0,void 0,(function*(){let n=[];try{if(this.ocrScanner||(n=yield this.codeReader.readFromCanvas(this.osCanvas)),this.ocrIsScanning){const{data:{text:t}}=yield this.worker.recognize(this.osCanvas),r=/[a-zA-Z0-9@#\/)(+=._-]/gi;n=[{Text:t&&t.match(r)&&t.match(r).filter((t=>t)).join(""),Format:"String"}]}}catch(t){return void(this.errorText="something went wrong.")}let r=!1;for(const i of n)i.Text!=(null===(t=this.lastScan)||void 0===t?void 0:t.Text)&&(this.lastScan=i,this.emitResult(i),r=!0);r&&(this.showProcessedCheck(),this.stopStream())}))}showProcessedCheck(){const t=If.timeline();t.to(this.successIcon,{duration:.3,opacity:1}),setTimeout((()=>{t.to(this.successIcon,{duration:.2,opacity:0}),this.twintagScannerRef&&t.to(this.twintagScannerRef,{duration:.2,display:"none"})}),600)}stopStream(){return e(this,void 0,void 0,(function*(){window.localStream.getTracks().forEach((t=>{this.video.srcObject=null,this.osContext.clearRect(0,0,this.osContext.canvas.width,this.osContext.canvas.height),t.stop()})),If.to(this.videoContainerRef,{duration:.1,opacity:0}),this.ocrScanner&&(yield this.worker.terminate()),this.lastScan=null}))}emitResult(t){this.frameCapture=this.osCanvas.toDataURL(),this.onSymbol.emit({Text:t.Text,Format:t.Format,Frame:this.frameCapture})}resize(){this.stageWidth=this.video.videoWidth,this.stageHeight=this.video.videoHeight;const t=this.videoWidth/this.videoHeight;let n=0;this.stageWidth/this.stageHeight>t?(this.app.resize(this.stageWidth,this.stageWidth/t),this.app.position(0)):(n=this.stageHeight/this.videoHeight,this.app.position(-(this.stageWidth*n-this.stageWidth)/2),this.app.resize(this.stageHeight*t,this.stageHeight))}get twintagScannerRef(){return i(this)}};nh.style=':host{display:block;position:absolute;inset:0}.check-icon{position:absolute;opacity:0;z-index:2222}.hidden-video{display:block;width:0;height:0}.scanner-container{display:grid;place-items:center;position:relative;top:50%;width:100%;transform:translateY(-50%)}.scanner-container .video-container{--xCrop:0;--yCrop:0;display:grid;position:relative;opacity:0}.scanner-container .video-container::after{content:"";position:absolute;top:50%;left:50%;width:100%;height:100%;background:rgba(0, 0, 0, 0.75);transform:translate(-50%, -50%);-webkit-clip-path:polygon(0% 0%, 0% 100%, calc(var(--xCrop) * 1%) 100%, calc(var(--xCrop) * 1%) calc(var(--yCrop) * 1%), calc(calc(100 - var(--xCrop)) * 1%) calc(var(--yCrop) * 1%), calc(calc(100 - var(--xCrop)) * 1%) calc(calc(100 - var(--yCrop)) * 1%), calc(var(--xCrop) * 1%) calc(calc(100 - var(--yCrop)) * 1%), calc(var(--xCrop) * 1%) 100%, 100% 100%, 100% 0%);clip-path:polygon(0% 0%, 0% 100%, calc(var(--xCrop) * 1%) 100%, calc(var(--xCrop) * 1%) calc(var(--yCrop) * 1%), calc(calc(100 - var(--xCrop)) * 1%) calc(var(--yCrop) * 1%), calc(calc(100 - var(--xCrop)) * 1%) calc(calc(100 - var(--yCrop)) * 1%), calc(var(--xCrop) * 1%) calc(calc(100 - var(--yCrop)) * 1%), calc(var(--xCrop) * 1%) 100%, 100% 100%, 100% 0%)}.scanner-container .video-container video{width:100% !important;height:100% !important}';export{nh as twintag_scanner}
|
|
20
|
+
var fs,hs,cs,ls,ws,vs,ys,ds={},bs=180/Math.PI,ps=Math.PI/180,As=Math.atan2,ms=/([A-Z])/g,Is=/(left|right|width|margin|padding|x)/i,gs=/[\s,\(]\S/,Ss={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},_s=function(t,n){return n.set(n.t,n.p,Math.round(1e4*(n.s+n.c*t))/1e4+n.u,n)},Ms=function(t,n){return n.set(n.t,n.p,1===t?n.e:Math.round(1e4*(n.s+n.c*t))/1e4+n.u,n)},Os=function(t,n){return n.set(n.t,n.p,t?Math.round(1e4*(n.s+n.c*t))/1e4+n.u:n.b,n)},Es=function(t,n){var r=n.s+n.c*t;n.set(n.t,n.p,~~(r+(r<0?-.5:.5))+n.u,n)},ks=function(t,n){return n.set(n.t,n.p,t?n.e:n.b,n)},Cs=function(t,n){return n.set(n.t,n.p,1!==t?n.b:n.e,n)},js=function(t,n,r){return t.style[n]=r},Ts=function(t,n,r){return t.style.setProperty(n,r)},xs=function(t,n,r){return t._gsap[n]=r},Rs=function(t,n,r){return t._gsap.scaleX=t._gsap.scaleY=r},Ns=function(t,n,r,i,e){var o=t._gsap;o.scaleX=o.scaleY=r,o.renderTransform(e,o)},Ps=function(t,n,r,i,e){var o=t._gsap;o[n]=r,o.renderTransform(e,o)},Ds="transform",Ls=Ds+"Origin",Fs=function(t,n){var r=hs.createElementNS?hs.createElementNS((n||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),t):hs.createElement(t);return r.style?r:hs.createElement(t)},Us=function t(n,r,i){var e=getComputedStyle(n);return e[r]||e.getPropertyValue(r.replace(ms,"-$1").toLowerCase())||e.getPropertyValue(r)||!i&&t(n,Gs(r)||r,1)||""},Bs="O,Moz,ms,Ms,Webkit".split(","),Gs=function(t,n,r){var i=(n||ws).style,e=5;if(t in i&&!r)return t;for(t=t.charAt(0).toUpperCase()+t.substr(1);e--&&!(Bs[e]+t in i););return e<0?null:(3===e?"ms":e>=0?Bs[e]:"")+t},zs=function(){"undefined"!=typeof window&&window.document&&(fs=window,cs=(hs=fs.document).documentElement,ws=Fs("div")||{style:{}},Fs("div"),Ds=Gs(Ds),Ls=Ds+"Origin",ws.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",ys=!!Gs("perspective"),ls=1)},Hs=function t(n){var r,i=Fs("svg",this.ownerSVGElement&&this.ownerSVGElement.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),e=this.parentNode,o=this.nextSibling,u=this.style.cssText;if(cs.appendChild(i),i.appendChild(this),this.style.display="block",n)try{r=this.getBBox(),this._gsapBBox=this.getBBox,this.getBBox=t}catch(t){}else this._gsapBBox&&(r=this._gsapBBox());return e&&(o?e.insertBefore(this,o):e.appendChild(this)),cs.removeChild(i),this.style.cssText=u,r},Qs=function(t,n){for(var r=n.length;r--;)if(t.hasAttribute(n[r]))return t.getAttribute(n[r])},Vs=function(t){var n;try{n=t.getBBox()}catch(r){n=Hs.call(t,!0)}return n&&(n.width||n.height)||t.getBBox===Hs||(n=Hs.call(t,!0)),!n||n.width||n.x||n.y?n:{x:+Qs(t,["x","cx","x1"])||0,y:+Qs(t,["y","cy","y1"])||0,width:0,height:0}},Ws=function(t){return!(!t.getCTM||t.parentNode&&!t.ownerSVGElement||!Vs(t))},Ys=function(t,n){if(n){var r=t.style;n in ds&&n!==Ls&&(n=Ds),r.removeProperty?("ms"!==n.substr(0,2)&&"webkit"!==n.substr(0,6)||(n="-"+n),r.removeProperty(n.replace(ms,"-$1").toLowerCase())):r.removeAttribute(n)}},Ks=function(t,n,r,i,e,o){var u=new es(t._pt,n,r,0,1,o?Cs:ks);return t._pt=u,u.b=i,u.e=e,t._props.push(r),u},Xs={deg:1,rad:1,turn:1},$s=function t(n,r,i,e){var o,u,a,s,f=parseFloat(i)||0,h=(i+"").trim().substr((f+"").length)||"px",c=ws.style,l=Is.test(r),w="svg"===n.tagName.toLowerCase(),v=(w?"client":"offset")+(l?"Width":"Height"),y=100,d="px"===e,b="%"===e;return e===h||!f||Xs[e]||Xs[h]?f:("px"!==h&&!d&&(f=t(n,r,i,"px")),s=n.getCTM&&Ws(n),!b&&"%"!==h||!ds[r]&&!~r.indexOf("adius")?(c[l?"width":"height"]=y+(d?h:e),u=~r.indexOf("adius")||"em"===e&&n.appendChild&&!w?n:n.parentNode,s&&(u=(n.ownerSVGElement||{}).parentNode),u&&u!==hs&&u.appendChild||(u=hs.body),(a=u._gsap)&&b&&a.width&&l&&a.time===pa.time?cu(f/a.width*y):((b||"%"===h)&&(c.position=Us(n,"position")),u===n&&(c.position="static"),u.appendChild(ws),o=ws[v],u.removeChild(ws),c.position="absolute",l&&b&&((a=su(u)).time=pa.time,a.width=u[v]),cu(d?o*f/y:o&&f?y/o*f:0))):(o=s?n.getBBox()[l?"width":"height"]:n[v],cu(b?f/o*y:f/100*o)))},qs=function(t,n,r,i){var e;return ls||zs(),n in Ss&&"transform"!==n&&~(n=Ss[n]).indexOf(",")&&(n=n.split(",")[0]),ds[n]&&"transform"!==n?(e=ff(t,i),e="transformOrigin"!==n?e[n]:e.svg?e.origin:hf(Us(t,Ls))+" "+e.zOrigin+"px"):(!(e=t.style[n])||"auto"===e||i||~(e+"").indexOf("calc("))&&(e=nf[n]&&nf[n](t,n,r)||Us(t,n)||fu(t,n)||("opacity"===n?1:0)),r&&!~(e+"").trim().indexOf(" ")?$s(t,n,e,r)+r:e},Zs=function(t,n,r,i){if(!r||"none"===r){var e=Gs(n,t,1),o=e&&Us(t,e,1);o&&o!==r?(n=e,r=o):"borderColor"===n&&(r=Us(t,"borderTopColor"))}var u,a,s,f,h,c,l,w,v,y,d,b=new es(this._pt,t.style,n,0,1,Za),p=0,A=0;if(b.b=r,b.e=i,r+="","auto"==(i+="")&&(t.style[n]=i,i=Us(t,n)||i,t.style[n]=r),ba(u=[r,i]),i=u[1],s=(r=u[0]).match(Go)||[],(i.match(Go)||[]).length){for(;a=Go.exec(i);)l=a[0],v=i.substring(p,a.index),h?h=(h+1)%5:"rgba("!==v.substr(-5)&&"hsla("!==v.substr(-5)||(h=1),l!==(c=s[A++]||"")&&(f=parseFloat(c)||0,d=c.substr((f+"").length),"="===l.charAt(1)&&(l=wu(f,l)+d),w=parseFloat(l),y=l.substr((w+"").length),p=Go.lastIndex-y.length,y||(y=y||Io.units[n]||d,p===i.length&&(i+=y,b.e+=y)),d!==y&&(f=$s(t,n,c,y)||0),b._pt={_next:b._pt,p:v||1===A?v:",",s:f,c:w-f,m:h&&h<4||"zIndex"===n?Math.round:0});b.c=p<i.length?i.substring(p,i.length):""}else b.r="display"===n&&"none"===i?Cs:ks;return Ho.test(i)&&(b.e=0),this._pt=b,b},Js={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},tf=function(t,n){if(n.tween&&n.tween._time===n.tween._dur){var r,i,e,o=n.t,u=n.u,a=o._gsap;if("all"===u||!0===u)o.style.cssText="",i=1;else for(e=(u=u.split(",")).length;--e>-1;)ds[r=u[e]]&&(i=1,r="transformOrigin"===r?Ls:Ds),Ys(o,r);i&&(Ys(o,Ds),a&&(a.svg&&o.removeAttribute("transform"),ff(o,1),a.uncache=1))}},nf={clearProps:function(t,n,r,i,e){if("isFromStart"!==e.data){var o=t._pt=new es(t._pt,n,r,0,0,tf);return o.u=i,o.pr=-10,o.tween=e,t._props.push(r),1}}},rf=[1,0,0,1,0,0],ef={},of=function(t){return"matrix(1, 0, 0, 1, 0, 0)"===t||"none"===t||!t},uf=function(t){var n=Us(t,Ds);return of(n)?rf:n.substr(7).match(Bo).map(cu)},af=function(t,n){var r,i,e,o,u=t._gsap||su(t),a=t.style,s=uf(t);return u.svg&&t.getAttribute("transform")?"1,0,0,1,0,0"===(s=[(e=t.transform.baseVal.consolidate().matrix).a,e.b,e.c,e.d,e.e,e.f]).join(",")?rf:s:(s!==rf||t.offsetParent||t===cs||u.svg||(e=a.display,a.display="block",(r=t.parentNode)&&t.offsetParent||(o=1,i=t.nextSibling,cs.appendChild(t)),s=uf(t),e?a.display=e:Ys(t,"display"),o&&(i?r.insertBefore(t,i):r?r.appendChild(t):cs.removeChild(t))),n&&s.length>6?[s[0],s[1],s[4],s[5],s[12],s[13]]:s)},sf=function(t,n,r,i,e,o){var u,a,s,f=t._gsap,h=e||af(t,!0),c=f.xOrigin||0,l=f.yOrigin||0,w=f.xOffset||0,v=f.yOffset||0,y=h[0],d=h[1],b=h[2],p=h[3],A=h[4],m=h[5],I=n.split(" "),g=parseFloat(I[0])||0,S=parseFloat(I[1])||0;r?h!==rf&&(a=y*p-d*b)&&(s=g*(-d/a)+S*(y/a)-(y*m-d*A)/a,g=g*(p/a)+S*(-b/a)+(b*m-p*A)/a,S=s):(g=(u=Vs(t)).x+(~I[0].indexOf("%")?g/100*u.width:g),S=u.y+(~(I[1]||I[0]).indexOf("%")?S/100*u.height:S)),i||!1!==i&&f.smooth?(f.xOffset=w+((A=g-c)*y+(m=S-l)*b)-A,f.yOffset=v+(A*d+m*p)-m):f.xOffset=f.yOffset=0,f.xOrigin=g,f.yOrigin=S,f.smooth=!!i,f.origin=n,f.originIsAbsolute=!!r,t.style[Ls]="0px 0px",o&&(Ks(o,f,"xOrigin",c,g),Ks(o,f,"yOrigin",l,S),Ks(o,f,"xOffset",w,f.xOffset),Ks(o,f,"yOffset",v,f.yOffset)),t.setAttribute("data-svg-origin",g+" "+S)},ff=function(t,n){var r=t._gsap||new Ta(t);if("x"in r&&!n&&!r.uncache)return r;var i,e,o,u,a,s,f,h,c,l,w,v,y,d,b,p,A,m,I,g,S,_,M,O,E,k,C,j,T,x,R,N,P=t.style,D=r.scaleX<0,L="px",F="deg",U=Us(t,Ls)||"0";return i=e=o=s=f=h=c=l=w=0,u=a=1,r.svg=!(!t.getCTM||!Ws(t)),d=af(t,r.svg),r.svg&&(O=(!r.uncache||"0px 0px"===U)&&!n&&t.getAttribute("data-svg-origin"),sf(t,O||U,!!O||r.originIsAbsolute,!1!==r.smooth,d)),v=r.xOrigin||0,y=r.yOrigin||0,d!==rf&&(m=d[0],I=d[1],g=d[2],S=d[3],i=_=d[4],e=M=d[5],6===d.length?(u=Math.sqrt(m*m+I*I),a=Math.sqrt(S*S+g*g),s=m||I?As(I,m)*bs:0,(c=g||S?As(g,S)*bs+s:0)&&(a*=Math.abs(Math.cos(c*ps))),r.svg&&(i-=v-(v*m+y*g),e-=y-(v*I+y*S))):(x=d[7],C=d[8],j=d[9],R=d[11],i=d[12],e=d[13],o=d[14],f=(b=As(N=d[6],T=d[10]))*bs,b&&(O=_*(p=Math.cos(-b))+C*(A=Math.sin(-b)),E=M*p+j*A,k=N*p+T*A,C=_*-A+C*p,j=M*-A+j*p,T=N*-A+T*p,R=x*-A+R*p,_=O,M=E,N=k),h=(b=As(-g,T))*bs,b&&(p=Math.cos(-b),R=S*(A=Math.sin(-b))+R*p,m=O=m*p-C*A,I=E=I*p-j*A,g=k=g*p-T*A),s=(b=As(I,m))*bs,b&&(O=m*(p=Math.cos(b))+I*(A=Math.sin(b)),E=_*p+M*A,I=I*p-m*A,M=M*p-_*A,m=O,_=E),f&&Math.abs(f)+Math.abs(s)>359.9&&(f=s=0,h=180-h),u=cu(Math.sqrt(m*m+I*I+g*g)),a=cu(Math.sqrt(M*M+N*N)),b=As(_,M),c=Math.abs(b)>2e-4?b*bs:0,w=R?1/(R<0?-R:R):0),r.svg&&(O=t.getAttribute("transform"),r.forceCSS=t.setAttribute("transform","")||!of(Us(t,Ds)),O&&t.setAttribute("transform",O))),Math.abs(c)>90&&Math.abs(c)<270&&(D?(u*=-1,c+=s<=0?180:-180,s+=s<=0?180:-180):(a*=-1,c+=c<=0?180:-180)),n=n||r.uncache,r.x=i-((r.xPercent=i&&(!n&&r.xPercent||(Math.round(t.offsetWidth/2)===Math.round(-i)?-50:0)))?t.offsetWidth*r.xPercent/100:0)+L,r.y=e-((r.yPercent=e&&(!n&&r.yPercent||(Math.round(t.offsetHeight/2)===Math.round(-e)?-50:0)))?t.offsetHeight*r.yPercent/100:0)+L,r.z=o+L,r.scaleX=cu(u),r.scaleY=cu(a),r.rotation=cu(s)+F,r.rotationX=cu(f)+F,r.rotationY=cu(h)+F,r.skewX=c+F,r.skewY=l+F,r.transformPerspective=w+L,(r.zOrigin=parseFloat(U.split(" ")[2])||0)&&(P[Ls]=hf(U)),r.xOffset=r.yOffset=0,r.force3D=Io.force3D,r.renderTransform=r.svg?vf:ys?wf:lf,r.uncache=0,r},hf=function(t){return(t=t.split(" "))[0]+" "+t[1]},cf=function(t,n,r){var i=Ku(n);return cu(parseFloat(n)+parseFloat($s(t,"x",r+"px",i)))+i},lf=function(t,n){n.z="0px",n.rotationY=n.rotationX="0deg",n.force3D=0,wf(t,n)},wf=function(t,n){var r=n||this,i=r.xPercent,e=r.yPercent,o=r.x,u=r.y,a=r.z,s=r.rotation,f=r.rotationY,h=r.rotationX,c=r.skewX,l=r.skewY,w=r.scaleX,v=r.scaleY,y=r.transformPerspective,d=r.force3D,b=r.target,p=r.zOrigin,A="",m="auto"===d&&t&&1!==t||!0===d;if(p&&("0deg"!==h||"0deg"!==f)){var I,g=parseFloat(f)*ps,S=Math.sin(g),_=Math.cos(g);g=parseFloat(h)*ps,I=Math.cos(g),o=cf(b,o,S*I*-p),u=cf(b,u,-Math.sin(g)*-p),a=cf(b,a,_*I*-p+p)}"0px"!==y&&(A+="perspective("+y+") "),(i||e)&&(A+="translate("+i+"%, "+e+"%) "),(m||"0px"!==o||"0px"!==u||"0px"!==a)&&(A+="0px"!==a||m?"translate3d("+o+", "+u+", "+a+") ":"translate("+o+", "+u+") "),"0deg"!==s&&(A+="rotate("+s+") "),"0deg"!==f&&(A+="rotateY("+f+") "),"0deg"!==h&&(A+="rotateX("+h+") "),"0deg"===c&&"0deg"===l||(A+="skew("+c+", "+l+") "),1===w&&1===v||(A+="scale("+w+", "+v+") "),b.style[Ds]=A||"translate(0, 0)"},vf=function(t,n){var r,i,e,o,u,a=n||this,s=a.xPercent,f=a.yPercent,h=a.x,c=a.y,l=a.rotation,w=a.skewX,v=a.skewY,y=a.scaleX,d=a.scaleY,b=a.target,p=a.xOrigin,A=a.yOrigin,m=a.xOffset,I=a.yOffset,g=a.forceCSS,S=parseFloat(h),_=parseFloat(c);l=parseFloat(l),w=parseFloat(w),(v=parseFloat(v))&&(w+=v=parseFloat(v),l+=v),l||w?(l*=ps,w*=ps,r=Math.cos(l)*y,i=Math.sin(l)*y,e=Math.sin(l-w)*-d,o=Math.cos(l-w)*d,w&&(v*=ps,u=Math.tan(w-v),e*=u=Math.sqrt(1+u*u),o*=u,v&&(u=Math.tan(v),r*=u=Math.sqrt(1+u*u),i*=u)),r=cu(r),i=cu(i),e=cu(e),o=cu(o)):(r=y,o=d,i=e=0),(S&&!~(h+"").indexOf("px")||_&&!~(c+"").indexOf("px"))&&(S=$s(b,"x",h,"px"),_=$s(b,"y",c,"px")),(p||A||m||I)&&(S=cu(S+p-(p*r+A*e)+m),_=cu(_+A-(p*i+A*o)+I)),(s||f)&&(u=b.getBBox(),S=cu(S+s/100*u.width),_=cu(_+f/100*u.height)),b.setAttribute("transform",u="matrix("+r+","+i+","+e+","+o+","+S+","+_+")"),g&&(b.style[Ds]=u)},yf=function(t,n,r,i,e){var o,u,a=360,s=Co(e),f=parseFloat(e)*(s&&~e.indexOf("rad")?bs:1)-i,h=i+f+"deg";return s&&("short"===(o=e.split("_")[1])&&(f%=a)!=f%180&&(f+=f<0?a:-360),"cw"===o&&f<0?f=(f+36e9)%a-~~(f/a)*a:"ccw"===o&&f>0&&(f=(f-36e9)%a-~~(f/a)*a)),t._pt=u=new es(t._pt,n,r,i,f,Ms),u.e=h,u.u="deg",t._props.push(r),u},df=function(t,n){for(var r in n)t[r]=n[r];return t},bf=function(t,n,r){var i,e,o,u,a,s,f,h=df({},r._gsap),c=r.style;for(e in h.svg?(o=r.getAttribute("transform"),r.setAttribute("transform",""),c[Ds]=n,i=ff(r,1),Ys(r,Ds),r.setAttribute("transform",o)):(o=getComputedStyle(r)[Ds],c[Ds]=n,i=ff(r,1),c[Ds]=o),ds)(o=h[e])!==(u=i[e])&&"perspective,force3D,transformOrigin,svgOrigin".indexOf(e)<0&&(a=Ku(o)!==(f=Ku(u))?$s(r,e,o,f):parseFloat(o),s=parseFloat(u),t._pt=new es(t._pt,i,e,a,s-a,_s),t._pt.u=f||0,t._props.push(e));df(i,h)};hu("padding,margin,Width,Radius",(function(t,n){var r="Top",i="Right",e="Bottom",o="Left",u=(n<3?[r,i,e,o]:[r+o,r+i,e+i,e+o]).map((function(r){return n<2?t+r:"border"+r+t}));nf[n>1?"border"+t:t]=function(t,n,r,i,e){var o,a;if(arguments.length<4)return o=u.map((function(n){return qs(t,n,r)})),5===(a=o.join(" ")).split(o[0]).length?o[0]:a;o=(i+"").split(" "),a={},u.forEach((function(t,n){return a[t]=o[n]=o[n]||o[(n-1)/2|0]})),t.init(n,a,e)}}));var pf,Af,mf={name:"css",register:zs,targetTest:function(t){return t.style&&t.nodeType},init:function(t,n,r,i,e){var o,u,a,s,f,h,c,l,w,v,y,d,b,p,A,m,I,g,S,_=this._props,M=t.style,O=r.vars.startAt;for(c in ls||zs(),n)if("autoRound"!==c&&(u=n[c],!ru[c]||!Fa(c,n,r,i,t,e)))if(h=nf[c],"function"==(f=typeof u)&&(f=typeof(u=u.call(r,i,t,e))),"string"===f&&~u.indexOf("random(")&&(u=ea(u)),h)h(this,t,c,u,r)&&(A=1);else if("--"===c.substr(0,2))o=(getComputedStyle(t).getPropertyValue(c)+"").trim(),u+="",ya.lastIndex=0,ya.test(o)||(l=Ku(o),w=Ku(u)),w?l!==w&&(o=$s(t,c,o,w)+w):l&&(u+=l),this.add(M,"setProperty",o,u,i,e,0,0,c),_.push(c);else if("undefined"!==f){if(O&&c in O?(o="function"==typeof O[c]?O[c].call(r,i,t,e):O[c],Co(o)&&~o.indexOf("random(")&&(o=ea(o)),Ku(o+"")||(o+=Io.units[c]||Ku(qs(t,c))||""),"="===(o+"").charAt(1)&&(o=qs(t,c))):o=qs(t,c),s=parseFloat(o),(v="string"===f&&"="===u.charAt(1)&&u.substr(0,2))&&(u=u.substr(2)),a=parseFloat(u),c in Ss&&("autoAlpha"===c&&(1===s&&"hidden"===qs(t,"visibility")&&a&&(s=0),Ks(this,M,"visibility",s?"inherit":"hidden",a?"inherit":"hidden",!a)),"scale"!==c&&"transform"!==c&&~(c=Ss[c]).indexOf(",")&&(c=c.split(",")[0])),y=c in ds)if(d||((b=t._gsap).renderTransform&&!n.parseTransform||ff(t,n.parseTransform),p=!1!==n.smoothOrigin&&b.smooth,(d=this._pt=new es(this._pt,M,Ds,0,1,b.renderTransform,b,0,-1)).dep=1),"scale"===c)this._pt=new es(this._pt,b,"scaleY",b.scaleY,(v?wu(b.scaleY,v+a):a)-b.scaleY||0),_.push("scaleY",c),c+="X";else{if("transformOrigin"===c){I=void 0,g=void 0,S=void 0,S=(I=(m=u).split(" "))[1]||"50%","top"!==(g=I[0])&&"bottom"!==g&&"left"!==S&&"right"!==S||(m=g,g=S,S=m),I[0]=Js[g]||g,I[1]=Js[S]||S,u=I.join(" "),b.svg?sf(t,u,0,p,0,this):((w=parseFloat(u.split(" ")[2])||0)!==b.zOrigin&&Ks(this,b,"zOrigin",b.zOrigin,w),Ks(this,M,c,hf(o),hf(u)));continue}if("svgOrigin"===c){sf(t,u,1,p,0,this);continue}if(c in ef){yf(this,b,c,s,v?wu(s,v+u):u);continue}if("smoothOrigin"===c){Ks(this,b,"smooth",b.smooth,u);continue}if("force3D"===c){b[c]=u;continue}if("transform"===c){bf(this,u,t);continue}}else c in M||(c=Gs(c)||c);if(y||(a||0===a)&&(s||0===s)&&!gs.test(u)&&c in M)a||(a=0),(l=(o+"").substr((s+"").length))!==(w=Ku(u)||(c in Io.units?Io.units[c]:l))&&(s=$s(t,c,o,w)),this._pt=new es(this._pt,y?b:M,c,s,(v?wu(s,v+a):a)-s,y||"px"!==w&&"zIndex"!==c||!1===n.autoRound?_s:Es),this._pt.u=w||0,l!==w&&"%"!==w&&(this._pt.b=o,this._pt.r=Os);else if(c in M)Zs.call(this,t,c,o,v?v+u:u);else{if(!(c in t)){Xo(c,u);continue}this.add(t,c,o||t[c],v?v+u:u,i,e)}_.push(c)}A&&is(this)},get:qs,aliases:Ss,getSetter:function(t,n,r){var i=Ss[n];return i&&i.indexOf(",")<0&&(n=i),n in ds&&n!==Ls&&(t._gsap.x||qs(t,"x"))?r&&vs===r?"scale"===n?Rs:xs:(vs=r||{})&&("scale"===n?Ns:Ps):t.style&&!xo(t.style[n])?js:~n.indexOf("-")?Ts:Xa(t,n)},core:{_removeProperty:Ys,_getMatrix:af}};ss.utils.checkPrefix=Gs,Af=hu("x,y,z,scale,scaleX,scaleY,xPercent,yPercent"+","+(pf="rotation,rotationX,rotationY,skewX,skewY")+",transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective",(function(t){ds[t]=1})),hu(pf,(function(t){Io.units[t]="deg",ef[t]=1})),Ss[Af[13]]="x,y,z,scale,scaleX,scaleY,xPercent,yPercent,"+pf,hu("0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY",(function(t){var n=t.split(":");Ss[n[1]]=Af[n[0]]})),hu("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",(function(t){Io.units[t]="px"})),ss.registerPlugin(mf);var If=ss.registerPlugin(mf)||ss;o((function(t){var n=function(t){var n,r=Object.prototype,i=r.hasOwnProperty,e="function"==typeof Symbol?Symbol:{},o=e.iterator||"@@iterator",u=e.asyncIterator||"@@asyncIterator",a=e.toStringTag||"@@toStringTag";function s(t,n,r){return Object.defineProperty(t,n,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[n]}try{s({},"")}catch(t){s=function(t,n,r){return t[n]=r}}function f(t,n,r,i){var e=Object.create((n&&n.prototype instanceof d?n:d).prototype),o=new k(i||[]);return e._invoke=function(t,n,r){var i=c;return function(e,o){if(i===w)throw new Error("Generator is already running");if(i===v){if("throw"===e)throw o;return j()}for(r.method=e,r.arg=o;;){var u=r.delegate;if(u){var a=M(u,r);if(a){if(a===y)continue;return a}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(i===c)throw i=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);i=w;var s=h(t,n,r);if("normal"===s.type){if(i=r.done?v:l,s.arg===y)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(i=v,r.method="throw",r.arg=s.arg)}}}(t,r,o),e}function h(t,n,r){try{return{type:"normal",arg:t.call(n,r)}}catch(t){return{type:"throw",arg:t}}}t.wrap=f;var c="suspendedStart",l="suspendedYield",w="executing",v="completed",y={};function d(){}function b(){}function p(){}var A={};A[o]=function(){return this};var m=Object.getPrototypeOf,I=m&&m(m(C([])));I&&I!==r&&i.call(I,o)&&(A=I);var g=p.prototype=d.prototype=Object.create(A);function S(t){["next","throw","return"].forEach((function(n){s(t,n,(function(t){return this._invoke(n,t)}))}))}function _(t,n){function r(e,o,u,a){var s=h(t[e],t,o);if("throw"!==s.type){var f=s.arg,c=f.value;return c&&"object"==typeof c&&i.call(c,"__await")?n.resolve(c.__await).then((function(t){r("next",t,u,a)}),(function(t){r("throw",t,u,a)})):n.resolve(c).then((function(t){f.value=t,u(f)}),(function(t){return r("throw",t,u,a)}))}a(s.arg)}var e;this._invoke=function(t,i){function o(){return new n((function(n,e){r(t,i,n,e)}))}return e=e?e.then(o,o):o()}}function M(t,r){var i=t.iterator[r.method];if(i===n){if(r.delegate=null,"throw"===r.method){if(t.iterator.return&&(r.method="return",r.arg=n,M(t,r),"throw"===r.method))return y;r.method="throw",r.arg=new TypeError("The iterator does not provide a 'throw' method")}return y}var e=h(i,t.iterator,r.arg);if("throw"===e.type)return r.method="throw",r.arg=e.arg,r.delegate=null,y;var o=e.arg;return o?o.done?(r[t.resultName]=o.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=n),r.delegate=null,y):o:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,y)}function O(t){var n={tryLoc:t[0]};1 in t&&(n.catchLoc=t[1]),2 in t&&(n.finallyLoc=t[2],n.afterLoc=t[3]),this.tryEntries.push(n)}function E(t){var n=t.completion||{};n.type="normal",delete n.arg,t.completion=n}function k(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function C(t){if(t){var r=t[o];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var e=-1,u=function r(){for(;++e<t.length;)if(i.call(t,e))return r.value=t[e],r.done=!1,r;return r.value=n,r.done=!0,r};return u.next=u}}return{next:j}}function j(){return{value:n,done:!0}}return b.prototype=g.constructor=p,p.constructor=b,b.displayName=s(p,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var n="function"==typeof t&&t.constructor;return!!n&&(n===b||"GeneratorFunction"===(n.displayName||n.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,p):(t.__proto__=p,s(t,a,"GeneratorFunction")),t.prototype=Object.create(g),t},t.awrap=function(t){return{__await:t}},S(_.prototype),_.prototype[u]=function(){return this},t.AsyncIterator=_,t.async=function(n,r,i,e,o){void 0===o&&(o=Promise);var u=new _(f(n,r,i,e),o);return t.isGeneratorFunction(r)?u:u.next().then((function(t){return t.done?t.value:u.next()}))},S(g),s(g,a,"Generator"),g[o]=function(){return this},g.toString=function(){return"[object Generator]"},t.keys=function(t){var n=[];for(var r in t)n.push(r);return n.reverse(),function r(){for(;n.length;){var i=n.pop();if(i in t)return r.value=i,r.done=!1,r}return r.done=!0,r}},t.values=C,k.prototype={constructor:k,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(E),!t)for(var r in this)"t"===r.charAt(0)&&i.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var r=this;function e(i,e){return a.type="throw",a.arg=t,r.next=i,e&&(r.method="next",r.arg=n),!!e}for(var o=this.tryEntries.length-1;o>=0;--o){var u=this.tryEntries[o],a=u.completion;if("root"===u.tryLoc)return e("end");if(u.tryLoc<=this.prev){var s=i.call(u,"catchLoc"),f=i.call(u,"finallyLoc");if(s&&f){if(this.prev<u.catchLoc)return e(u.catchLoc,!0);if(this.prev<u.finallyLoc)return e(u.finallyLoc)}else if(s){if(this.prev<u.catchLoc)return e(u.catchLoc,!0)}else{if(!f)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return e(u.finallyLoc)}}}},abrupt:function(t,n){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc<=this.prev&&i.call(e,"finallyLoc")&&this.prev<e.finallyLoc){var o=e;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=n&&n<=o.finallyLoc&&(o=null);var u=o?o.completion:{};return u.type=t,u.arg=n,o?(this.method="next",this.next=o.finallyLoc,y):this.complete(u)},complete:function(t,n){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&n&&(this.next=n),y},finish:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),E(r),y}},catch:function(t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc===t){var i=r.completion;if("throw"===i.type){var e=i.arg;E(r)}return e}}throw new Error("illegal catch attempt")},delegateYield:function(t,r,i){return this.delegate={iterator:C(t),resultName:r,nextLoc:i},"next"===this.method&&(this.arg=n),y}},t}(t.exports);try{regeneratorRuntime=n}catch(t){Function("r","regeneratorRuntime = r")(n)}}));var gf=(t,n)=>`${t}-${n}-${Math.random().toString(16).slice(3,8)}`;let Sf=0;var _f=({id:t,action:n,payload:r={}})=>{let i=t;return void 0===i&&(i=gf("Job",Sf),Sf+=1),{id:i,action:n,payload:r}};let Mf=!1;var Of={logging:Mf,setLogging:t=>{Mf=t},log:(...t)=>Mf?console.log.apply(void 0,t):null};const{log:Ef}=Of;let kf=0;var Cf=o((function(t){t.exports=function(){var t=arguments.length;if(0===t)throw new Error("resolveUrl requires at least one argument; got none.");var n=document.createElement("base");if(n.href=arguments[0],1===t)return n.href;var r=document.getElementsByTagName("head")[0];r.insertBefore(n,r.firstChild);for(var i,e=document.createElement("a"),o=1;o<t;o++)e.href=arguments[o],n.href=i=e.href;return r.removeChild(n),i}}));const jf="browser"===(()=>{const t={};return"undefined"!=typeof WorkerGlobalScope?t.type="webworker":"undefined"!=typeof window&&"object"==typeof window.process&&"renderer"===window.process.type||"undefined"!=typeof process&&"object"==typeof process.versions&&process.versions.electron||"object"==typeof navigator&&"string"==typeof navigator.userAgent&&navigator.userAgent.indexOf("Electron")>=0?t.type="electron":"object"==typeof window?t.type="browser":"object"==typeof process&&"function"==typeof u&&(t.type="node"),t.type})()?Cf:t=>t;var Tf={TESSERACT_ONLY:0,LSTM_ONLY:1,TESSERACT_LSTM_COMBINED:2,DEFAULT:3},xf={defaultOEM:Tf.DEFAULT};const{version:Rf,dependencies:Nf}={_args:[["tesseract.js@2.1.5","/drone/src"]],_from:"tesseract.js@2.1.5",_id:"tesseract.js@2.1.5",_inBundle:!1,_integrity:"sha512-7CIS3SWr7TXpeaH9+HS7iUtVbCfPFYOO3p6rkRAkdtsOtrbz6496x59na6SCbFAIaZulQxy8BjwSu3qL3AoDRg==",_location:"/tesseract.js",_phantomChildren:{},_requested:{type:"version",registry:!0,raw:"tesseract.js@2.1.5",name:"tesseract.js",escapedName:"tesseract.js",rawSpec:"2.1.5",saveSpec:null,fetchSpec:"2.1.5"},_requiredBy:["/"],_resolved:"https://registry.npmjs.org/tesseract.js/-/tesseract.js-2.1.5.tgz",_spec:"2.1.5",_where:"/drone/src",author:"",browser:{"./src/worker/node/index.js":"./src/worker/browser/index.js"},bugs:{url:"https://github.com/naptha/tesseract.js/issues"},collective:{type:"opencollective",url:"https://opencollective.com/tesseractjs"},contributors:[{name:"jeromewu"}],dependencies:{"blueimp-load-image":"^3.0.0","bmp-js":"^0.1.0","file-type":"^12.4.1","idb-keyval":"^3.2.0","is-electron":"^2.2.0","is-url":"^1.2.4","jpeg-autorotate":"^7.1.1","node-fetch":"^2.6.0","opencollective-postinstall":"^2.0.2","regenerator-runtime":"^0.13.3","resolve-url":"^0.2.1","tesseract.js-core":"^2.2.0",zlibjs:"^0.3.1"},description:"Pure Javascript Multilingual OCR",devDependencies:{"@babel/core":"^7.7.7","@babel/preset-env":"^7.7.7",acorn:"^6.4.0","babel-loader":"^8.1.0",cors:"^2.8.5",eslint:"^7.2.0","eslint-config-airbnb-base":"^14.2.0","eslint-plugin-import":"^2.22.1","expect.js":"^0.3.1",express:"^4.17.1",mocha:"^8.1.3","mocha-headless-chrome":"^2.0.3","npm-run-all":"^4.1.5",nyc:"^15.1.0",rimraf:"^2.7.1","wait-on":"^3.3.0",webpack:"^4.44.2","webpack-bundle-analyzer":"^3.6.0","webpack-cli":"^3.3.12","webpack-dev-middleware":"^3.7.2"},homepage:"https://github.com/naptha/tesseract.js",jsdelivr:"dist/tesseract.min.js",license:"Apache-2.0",main:"src/index.js",name:"tesseract.js",repository:{type:"git",url:"git+https://github.com/naptha/tesseract.js.git"},scripts:{build:"rimraf dist && webpack --config scripts/webpack.config.prod.js",lint:"eslint src","lint:fix":"eslint --fix src",postinstall:"opencollective-postinstall || true",prepublishOnly:"npm run build","profile:tesseract":"webpack-bundle-analyzer dist/tesseract-stats.json","profile:worker":"webpack-bundle-analyzer dist/worker-stats.json",start:"node scripts/server.js",test:"npm-run-all -p -r start test:all","test:all":"npm-run-all wait test:browser:* test:node:all","test:browser-tpl":"mocha-headless-chrome -a incognito -a no-sandbox -a disable-setuid-sandbox -a disable-logging -t 300000","test:browser:FS":"npm run test:browser-tpl -- -f ./tests/FS.test.html","test:browser:detect":"npm run test:browser-tpl -- -f ./tests/detect.test.html","test:browser:recognize":"npm run test:browser-tpl -- -f ./tests/recognize.test.html","test:browser:scheduler":"npm run test:browser-tpl -- -f ./tests/scheduler.test.html","test:node":"nyc mocha --exit --bail --require ./scripts/test-helper.js","test:node:all":"npm run test:node -- ./tests/*.test.js",wait:"rimraf dist && wait-on http://localhost:3000/dist/tesseract.dev.js"},types:"src/index.d.ts",unpkg:"dist/tesseract.min.js",version:"2.1.5"};var Pf={langPath:"https://tessdata.projectnaptha.com/4.0.0",workerBlobURL:!0,logger:()=>{},workerPath:"undefined"!=typeof process&&"development"===process.env.TESS_ENV?Cf(`/dist/worker.dev.js?nocache=${Math.random().toString(36).slice(3)}`):`https://unpkg.com/tesseract.js@v${Rf}/dist/worker.min.js`,corePath:`https://unpkg.com/tesseract.js-core@v${Nf["tesseract.js-core"].substring(1)}/tesseract-core.${"object"==typeof WebAssembly?"wasm":"asm"}.js`},Df=o((function(t){!function(n){function r(t,n,i){var e,o=document.createElement("img");function u(n,u){u&&console.log(u),n&&r.isInstanceOf("Blob",n)?e=r.createObjectURL(t=n):(e=t,i&&i.crossOrigin&&(o.crossOrigin=i.crossOrigin)),o.src=e}return o.onerror=function(u){return r.onerror(o,u,t,e,n,i)},o.onload=function(u){return r.onload(o,u,t,e,n,i)},"string"==typeof t?(r.hasMetaOption(i)?r.fetchBlob(t,u,i):u(),o):r.isInstanceOf("Blob",t)||r.isInstanceOf("File",t)?(e=r.createObjectURL(t))?(o.src=e,o):r.readFile(t,(function(t){var r=t.target;r&&r.result?o.src=r.result:n&&n(t)})):void 0}var i=n.createObjectURL&&n||n.URL&&URL.revokeObjectURL&&URL||n.webkitURL&&webkitURL;function e(t,n){!t||"blob:"!==t.slice(0,5)||n&&n.noRevoke||r.revokeObjectURL(t)}r.hasMetaOption=function(t){return t&&t.meta},r.fetchBlob=function(t,n){n()},r.isInstanceOf=function(t,n){return Object.prototype.toString.call(n)==="[object "+t+"]"},r.transform=function(t,n,r,i,e){r(t,e)},r.onerror=function(t,n,r,i,o,u){e(i,u),o&&o.call(t,n)},r.onload=function(t,n,i,o,u,a){e(o,a),u&&r.transform(t,a,u,i,{originalWidth:t.naturalWidth||t.width,originalHeight:t.naturalHeight||t.height})},r.createObjectURL=function(t){return!!i&&i.createObjectURL(t)},r.revokeObjectURL=function(t){return!!i&&i.revokeObjectURL(t)},r.readFile=function(t,r,i){if(n.FileReader){var e=new FileReader;if(e.onload=e.onerror=r,e[i=i||"readAsDataURL"])return e[i](t),e}return!1},t.exports?t.exports=r:n.loadImage=r}("undefined"!=typeof window&&window||a)}));o((function(t){!function(t){var n=t.transform;t.transform=function(r,i,e,o,u){n.call(t,t.scale(r,i,u),i,e,o,u)},t.transformCoordinates=function(){},t.getTransformedOptions=function(t,n){var r,i,e,o,u=n.aspectRatio;if(!u)return n;for(i in r={},n)Object.prototype.hasOwnProperty.call(n,i)&&(r[i]=n[i]);return r.crop=!0,(e=t.naturalWidth||t.width)/(o=t.naturalHeight||t.height)>u?(r.maxWidth=o*u,r.maxHeight=o):(r.maxWidth=e,r.maxHeight=e/u),r},t.renderImageToCanvas=function(t,n,r,i,e,o,u,a,s,f,h){var c=t.getContext("2d");return!1===h.imageSmoothingEnabled?c.imageSmoothingEnabled=!1:h.imageSmoothingQuality&&(c.imageSmoothingQuality=h.imageSmoothingQuality),c.drawImage(n,r,i,e,o,u,a,s,f),t},t.hasCanvasOption=function(t){return t.canvas||t.crop||!!t.aspectRatio},t.scale=function(n,r,i){r=r||{};var e,o,u,a,s,f,h,c,l,w,v,y=document.createElement("canvas"),d=n.getContext||t.hasCanvasOption(r)&&y.getContext,b=n.naturalWidth||n.width,p=n.naturalHeight||n.height,A=b,m=p;function I(){var t=Math.max((u||A)/A,(a||m)/m);t>1&&(A*=t,m*=t)}function g(){var t=Math.min((e||A)/A,(o||m)/m);t<1&&(A*=t,m*=t)}if(d&&(h=(r=t.getTransformedOptions(n,r,i)).left||0,c=r.top||0,r.sourceWidth?(s=r.sourceWidth,void 0!==r.right&&void 0===r.left&&(h=b-s-r.right)):s=b-h-(r.right||0),r.sourceHeight?(f=r.sourceHeight,void 0!==r.bottom&&void 0===r.top&&(c=p-f-r.bottom)):f=p-c-(r.bottom||0),A=s,m=f),e=r.maxWidth,o=r.maxHeight,u=r.minWidth,a=r.minHeight,d&&e&&o&&r.crop?(A=e,m=o,(v=s/f-e/o)<0?(f=o*s/e,void 0===r.top&&void 0===r.bottom&&(c=(p-f)/2)):v>0&&(s=e*f/o,void 0===r.left&&void 0===r.right&&(h=(b-s)/2))):((r.contain||r.cover)&&(u=e=e||u,a=o=o||a),r.cover?(g(),I()):(I(),g())),d){if((l=r.pixelRatio)>1&&(y.style.width=A+"px",y.style.height=m+"px",A*=l,m*=l,y.getContext("2d").scale(l,l)),(w=r.downsamplingRatio)>0&&w<1&&A<s&&m<f)for(;s*w>A;)y.width=s*w,y.height=f*w,t.renderImageToCanvas(y,n,h,c,s,f,0,0,y.width,y.height,r),h=0,c=0,s=y.width,f=y.height,(n=document.createElement("canvas")).width=s,n.height=f,t.renderImageToCanvas(n,y,0,0,s,f,0,0,s,f,r);return y.width=A,y.height=m,t.transformCoordinates(y,r),t.renderImageToCanvas(y,n,h,c,s,f,0,0,A,m,r)}return n.width=A,n.height=m,n}}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){var n="undefined"!=typeof Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice);t.blobSlice=n&&function(){var t=this.slice||this.webkitSlice||this.mozSlice;return t.apply(this,arguments)},t.metaDataParsers={jpeg:{65505:[],65517:[]}},t.parseMetaData=function(n,r,i,e){i=i||{},e=e||{};var o=this;"undefined"!=typeof DataView&&n&&n.size>=12&&"image/jpeg"===n.type&&t.blobSlice&&t.readFile(t.blobSlice.call(n,0,i.maxMetaDataSize||262144),(function(n){if(n.target.error)return console.log(n.target.error),void r(e);var u,a,s,f,h=n.target.result,c=new DataView(h),l=2,w=c.byteLength-4,v=l;if(65496===c.getUint16(0)){for(;l<w&&((u=c.getUint16(l))>=65504&&u<=65519||65534===u);){if(l+(a=c.getUint16(l+2)+2)>c.byteLength){console.log("Invalid meta data: Invalid segment size.");break}if((s=t.metaDataParsers.jpeg[u])&&!i.disableMetaDataParsers)for(f=0;f<s.length;f+=1)s[f].call(o,c,l,a,e,i);v=l+=a}!i.disableImageHead&&v>6&&(e.imageHead=h.slice?h.slice(0,v):new Uint8Array(h).subarray(0,v))}else console.log("Invalid JPEG file: Missing JPEG marker.");r(e)}),"readAsArrayBuffer")||r(e)},t.replaceHead=function(n,r,i){t.parseMetaData(n,(function(e){i(new Blob([r,t.blobSlice.call(n,e.imageHead.byteLength)],{type:"image/jpeg"}))}),{maxMetaDataSize:256,disableMetaDataParsers:!0})};var r=t.transform;t.transform=function(n,i,e,o,u){t.hasMetaOption(i)?t.parseMetaData(o,(function(u){r.call(t,n,i,e,o,u)}),i,u):r.apply(t,arguments)}}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){"undefined"!=typeof fetch&&"undefined"!=typeof Request?t.fetchBlob=function(t,n,r){fetch(new Request(t,r)).then((function(t){return t.blob()})).then(n).catch((function(t){n(null,t)}))}:"undefined"!=typeof XMLHttpRequest&&"undefined"!=typeof ProgressEvent&&(t.fetchBlob=function(t,n,r){r=r||{};var i=new XMLHttpRequest;i.open(r.method||"GET",t),r.headers&&Object.keys(r.headers).forEach((function(t){i.setRequestHeader(t,r.headers[t])})),i.withCredentials="include"===r.credentials,i.responseType="blob",i.onload=function(){n(i.response)},i.onerror=i.onabort=i.ontimeout=function(t){n(null,t)},i.send(r.body)})}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){function n(t){t&&(Object.defineProperty(this,"map",{value:this.privateIFDs[t].map}),Object.defineProperty(this,"tags",{value:this.tags&&this.tags[t]||{}}))}n.prototype.map={Orientation:274,Thumbnail:513,Exif:34665,GPSInfo:34853,Interoperability:40965},n.prototype.privateIFDs={34665:{name:"Exif",map:{}},34853:{name:"GPSInfo",map:{}},40965:{name:"Interoperability",map:{}}},n.prototype.get=function(t){return this[t]||this[this.map[t]]};var r={1:{getValue:function(t,n){return t.getUint8(n)},size:1},2:{getValue:function(t,n){return String.fromCharCode(t.getUint8(n))},size:1,ascii:!0},3:{getValue:function(t,n,r){return t.getUint16(n,r)},size:2},4:{getValue:function(t,n,r){return t.getUint32(n,r)},size:4},5:{getValue:function(t,n,r){return t.getUint32(n,r)/t.getUint32(n+4,r)},size:8},9:{getValue:function(t,n,r){return t.getInt32(n,r)},size:4},10:{getValue:function(t,n,r){return t.getInt32(n,r)/t.getInt32(n+4,r)},size:8}};function i(t,n,i,e,o,u){var a,s,f,h,c,l,w=r[e];if(w){if(!((s=(a=w.size*o)>4?n+t.getUint32(i+8,u):i+8)+a>t.byteLength)){if(1===o)return w.getValue(t,s,u);for(f=[],h=0;h<o;h+=1)f[h]=w.getValue(t,s+h*w.size,u);if(w.ascii){for(c="",h=0;h<f.length&&"\0"!==(l=f[h]);h+=1)c+=l;return c}return f}console.log("Invalid Exif data: Invalid data offset.")}else console.log("Invalid Exif data: Invalid tag type.")}function e(t,n,r,e,o,u,a,s){var f,h,c,l,w,v;if(r+6>t.byteLength)console.log("Invalid Exif data: Invalid directory offset.");else{if(!((h=r+2+12*(f=t.getUint16(r,e)))+4>t.byteLength)){for(c=0;c<f;c+=1)w=t.getUint16(l=r+2+12*c,e),a&&!a[w]||s&&!0===s[w]||(v=i(t,n,l,t.getUint16(l+2,e),t.getUint32(l+4,e),e),o[w]=v,u&&(u[w]=l));return t.getUint32(h,e)}console.log("Invalid Exif data: Invalid directory size.")}}r[7]=r[1],t.parseExifData=function(t,r,i,o,u){if(!u.disableExif){var a,s,f=u.includeExifTags,h=u.excludeExifTags||{34665:{37500:!0}},c=r+10;if(1165519206===t.getUint32(r+4))if(c+8>t.byteLength)console.log("Invalid Exif data: Invalid segment size.");else if(0===t.getUint16(r+8)){switch(t.getUint16(c)){case 18761:a=!0;break;case 19789:a=!1;break;default:return void console.log("Invalid Exif data: Invalid byte alignment marker.")}42===t.getUint16(c+2,a)?(s=t.getUint32(c+4,a),o.exif=new n,u.disableExifOffsets||(o.exifOffsets=new n,o.exifTiffOffset=c,o.exifLittleEndian=a),(s=e(t,c,c+s,a,o.exif,o.exifOffsets,f,h))&&!u.disableExifThumbnail&&(s=e(t,c,c+s,a,o.exif,o.exifOffsets,f,h),o.exif[513]&&o.exif[514]&&(o.exif[513]=function(t,n,r){if(r&&!(n+r>t.byteLength))return new Blob([t.buffer.slice(n,n+r)],{type:"image/jpeg"});console.log("Invalid Exif data: Invalid thumbnail data.")}(t,c+o.exif[513],o.exif[514]))),Object.keys(o.exif.privateIFDs).forEach((function(r){!function(t,r,i,o,u,a,s){var f=t.exif[r];f&&(t.exif[r]=new n(r),t.exifOffsets&&(t.exifOffsets[r]=new n(r)),e(i,o,o+f,u,t.exif[r],t.exifOffsets&&t.exifOffsets[r],a&&a[r],s&&s[r]))}(o,r,t,c,a,f,h)}))):console.log("Invalid Exif data: Missing TIFF marker.")}else console.log("Invalid Exif data: Missing byte alignment offset.")}},t.metaDataParsers.jpeg[65505].push(t.parseExifData),t.exifWriters={274:function(t,n,r){return new DataView(t,n.exifOffsets[274]+8,2).setUint16(0,r,n.exifLittleEndian),t}},t.writeExifData=function(n,r,i,e){t.exifWriters[r.exif.map[i]](n,r,e)},t.ExifMap=n}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){var n=t.ExifMap.prototype;n.tags={256:"ImageWidth",257:"ImageHeight",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",274:"Orientation",277:"SamplesPerPixel",284:"PlanarConfiguration",530:"YCbCrSubSampling",531:"YCbCrPositioning",282:"XResolution",283:"YResolution",296:"ResolutionUnit",273:"StripOffsets",278:"RowsPerStrip",279:"StripByteCounts",513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",301:"TransferFunction",318:"WhitePoint",319:"PrimaryChromaticities",529:"YCbCrCoefficients",532:"ReferenceBlackWhite",306:"DateTime",270:"ImageDescription",271:"Make",272:"Model",305:"Software",315:"Artist",33432:"Copyright",34665:{36864:"ExifVersion",40960:"FlashpixVersion",40961:"ColorSpace",40962:"PixelXDimension",40963:"PixelYDimension",42240:"Gamma",37121:"ComponentsConfiguration",37122:"CompressedBitsPerPixel",37500:"MakerNote",37510:"UserComment",40964:"RelatedSoundFile",36867:"DateTimeOriginal",36868:"DateTimeDigitized",37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",33434:"ExposureTime",33437:"FNumber",34850:"ExposureProgram",34852:"SpectralSensitivity",34855:"PhotographicSensitivity",34856:"OECF",34864:"SensitivityType",34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",37377:"ShutterSpeedValue",37378:"ApertureValue",37379:"BrightnessValue",37380:"ExposureBias",37381:"MaxApertureValue",37382:"SubjectDistance",37383:"MeteringMode",37384:"LightSource",37385:"Flash",37396:"SubjectArea",37386:"FocalLength",41483:"FlashEnergy",41484:"SpatialFrequencyResponse",41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:"FocalPlaneResolutionUnit",41492:"SubjectLocation",41493:"ExposureIndex",41495:"SensingMethod",41728:"FileSource",41729:"SceneType",41730:"CFAPattern",41985:"CustomRendered",41986:"ExposureMode",41987:"WhiteBalance",41988:"DigitalZoomRatio",41989:"FocalLengthIn35mmFilm",41990:"SceneCaptureType",41991:"GainControl",41992:"Contrast",41993:"Saturation",41994:"Sharpness",41995:"DeviceSettingDescription",41996:"SubjectDistanceRange",42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:"LensSpecification",42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber"},34853:{0:"GPSVersionID",1:"GPSLatitudeRef",2:"GPSLatitude",3:"GPSLongitudeRef",4:"GPSLongitude",5:"GPSAltitudeRef",6:"GPSAltitude",7:"GPSTimeStamp",8:"GPSSatellites",9:"GPSStatus",10:"GPSMeasureMode",11:"GPSDOP",12:"GPSSpeedRef",13:"GPSSpeed",14:"GPSTrackRef",15:"GPSTrack",16:"GPSImgDirectionRef",17:"GPSImgDirection",18:"GPSMapDatum",19:"GPSDestLatitudeRef",20:"GPSDestLatitude",21:"GPSDestLongitudeRef",22:"GPSDestLongitude",23:"GPSDestBearingRef",24:"GPSDestBearing",25:"GPSDestDistanceRef",26:"GPSDestDistance",27:"GPSProcessingMethod",28:"GPSAreaInformation",29:"GPSDateStamp",30:"GPSDifferential",31:"GPSHPositioningError"},40965:{1:"InteroperabilityIndex"}},n.stringValues={ExposureProgram:{0:"Undefined",1:"Manual",2:"Normal program",3:"Aperture priority",4:"Shutter priority",5:"Creative program",6:"Action program",7:"Portrait mode",8:"Landscape mode"},MeteringMode:{0:"Unknown",1:"Average",2:"CenterWeightedAverage",3:"Spot",4:"MultiSpot",5:"Pattern",6:"Partial",255:"Other"},LightSource:{0:"Unknown",1:"Daylight",2:"Fluorescent",3:"Tungsten (incandescent light)",4:"Flash",9:"Fine weather",10:"Cloudy weather",11:"Shade",12:"Daylight fluorescent (D 5700 - 7100K)",13:"Day white fluorescent (N 4600 - 5400K)",14:"Cool white fluorescent (W 3900 - 4500K)",15:"White fluorescent (WW 3200 - 3700K)",17:"Standard light A",18:"Standard light B",19:"Standard light C",20:"D55",21:"D65",22:"D75",23:"D50",24:"ISO studio tungsten",255:"Other"},Flash:{0:"Flash did not fire",1:"Flash fired",5:"Strobe return light not detected",7:"Strobe return light detected",9:"Flash fired, compulsory flash mode",13:"Flash fired, compulsory flash mode, return light not detected",15:"Flash fired, compulsory flash mode, return light detected",16:"Flash did not fire, compulsory flash mode",24:"Flash did not fire, auto mode",25:"Flash fired, auto mode",29:"Flash fired, auto mode, return light not detected",31:"Flash fired, auto mode, return light detected",32:"No flash function",65:"Flash fired, red-eye reduction mode",69:"Flash fired, red-eye reduction mode, return light not detected",71:"Flash fired, red-eye reduction mode, return light detected",73:"Flash fired, compulsory flash mode, red-eye reduction mode",77:"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected",79:"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected",89:"Flash fired, auto mode, red-eye reduction mode",93:"Flash fired, auto mode, return light not detected, red-eye reduction mode",95:"Flash fired, auto mode, return light detected, red-eye reduction mode"},SensingMethod:{1:"Undefined",2:"One-chip color area sensor",3:"Two-chip color area sensor",4:"Three-chip color area sensor",5:"Color sequential area sensor",7:"Trilinear sensor",8:"Color sequential linear sensor"},SceneCaptureType:{0:"Standard",1:"Landscape",2:"Portrait",3:"Night scene"},SceneType:{1:"Directly photographed"},CustomRendered:{0:"Normal process",1:"Custom process"},WhiteBalance:{0:"Auto white balance",1:"Manual white balance"},GainControl:{0:"None",1:"Low gain up",2:"High gain up",3:"Low gain down",4:"High gain down"},Contrast:{0:"Normal",1:"Soft",2:"Hard"},Saturation:{0:"Normal",1:"Low saturation",2:"High saturation"},Sharpness:{0:"Normal",1:"Soft",2:"Hard"},SubjectDistanceRange:{0:"Unknown",1:"Macro",2:"Close view",3:"Distant view"},FileSource:{3:"DSC"},ComponentsConfiguration:{0:"",1:"Y",2:"Cb",3:"Cr",4:"R",5:"G",6:"B"},Orientation:{1:"top-left",2:"top-right",3:"bottom-right",4:"bottom-left",5:"left-top",6:"right-top",7:"right-bottom",8:"left-bottom"}},n.getText=function(t){var n=this.get(t);switch(t){case"LightSource":case"Flash":case"MeteringMode":case"ExposureProgram":case"SensingMethod":case"SceneCaptureType":case"SceneType":case"CustomRendered":case"WhiteBalance":case"GainControl":case"Contrast":case"Saturation":case"Sharpness":case"SubjectDistanceRange":case"FileSource":case"Orientation":return this.stringValues[t][n];case"ExifVersion":case"FlashpixVersion":if(!n)return;return String.fromCharCode(n[0],n[1],n[2],n[3]);case"ComponentsConfiguration":if(!n)return;return this.stringValues[t][n[0]]+this.stringValues[t][n[1]]+this.stringValues[t][n[2]]+this.stringValues[t][n[3]];case"GPSVersionID":if(!n)return;return n[0]+"."+n[1]+"."+n[2]+"."+n[3]}return String(n)},n.getAll=function(){var t,n,r,i={};for(t in this)Object.prototype.hasOwnProperty.call(this,t)&&((n=this[t])&&n.getAll?i[this.privateIFDs[t].name]=n.getAll():(r=this.tags[t])&&(i[r]=this.getText(r)));return i},n.getName=function(t){var n=this.tags[t];return"object"==typeof n?this.privateIFDs[t].name:n},function(){var t,r,i,e=n.tags;for(t in e)if(Object.prototype.hasOwnProperty.call(e,t))if(r=n.privateIFDs[t])for(t in i=e[t])Object.prototype.hasOwnProperty.call(i,t)&&(r.map[i[t]]=Number(t));else n.map[e[t]]=Number(t)}()}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){function n(){}function r(t,n,r,i,e){return"binary"===n.types[t]?new Blob([r.buffer.slice(i,i+e)]):"Uint16"===n.types[t]?r.getUint16(i):function(t,n,r){for(var i="",e=n+r,o=n;o<e;o+=1)i+=String.fromCharCode(t.getUint8(o));return i}(r,i,e)}function i(t,n){return void 0===t?n:t instanceof Array?(t.push(n),t):[t,n]}function e(t,n,e,o,u,a){for(var s,f,h,c=n+e,l=n;l<c;)28===t.getUint8(l)&&2===t.getUint8(l+1)&&(h=t.getUint8(l+2),u&&!u[h]||a&&a[h]||(f=t.getInt16(l+3),s=r(h,o.iptc,t,l+5,f),o.iptc[h]=i(o.iptc[h],s),o.iptcOffsets&&(o.iptcOffsets[h]=l))),l+=1}function o(t,n){return 943868237===t.getUint32(n)&&1028===t.getUint16(n+4)}function u(t,n){var r=t.getUint8(n+7);return r%2!=0&&(r+=1),0===r&&(r=4),r}n.prototype.map={ObjectName:5},n.prototype.types={0:"Uint16",200:"Uint16",201:"Uint16",202:"binary"},n.prototype.get=function(t){return this[t]||this[this.map[t]]},t.parseIptcData=function(t,r,i,a,s){if(!s.disableIptc)for(var f=r+i;r+8<f;){if(o(t,r)){var h=u(t,r),c=r+8+h;if(c>f){console.log("Invalid IPTC data: Invalid segment offset.");break}var l=t.getUint16(r+6+h);if(r+l>f){console.log("Invalid IPTC data: Invalid segment size.");break}return a.iptc=new n,s.disableIptcOffsets||(a.iptcOffsets=new n),void e(t,c,l,a,s.includeIptcTags,s.excludeIptcTags||{202:!0})}r+=1}},t.metaDataParsers.jpeg[65517].push(t.parseIptcData),t.IptcMap=n}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){var n=t.IptcMap.prototype;n.tags={0:"ApplicationRecordVersion",3:"ObjectTypeReference",4:"ObjectAttributeReference",5:"ObjectName",7:"EditStatus",8:"EditorialUpdate",10:"Urgency",12:"SubjectReference",15:"Category",20:"SupplementalCategories",22:"FixtureIdentifier",25:"Keywords",26:"ContentLocationCode",27:"ContentLocationName",30:"ReleaseDate",35:"ReleaseTime",37:"ExpirationDate",38:"ExpirationTime",40:"SpecialInstructions",42:"ActionAdvised",45:"ReferenceService",47:"ReferenceDate",50:"ReferenceNumber",55:"DateCreated",60:"TimeCreated",62:"DigitalCreationDate",63:"DigitalCreationTime",65:"OriginatingProgram",70:"ProgramVersion",75:"ObjectCycle",80:"Byline",85:"BylineTitle",90:"City",92:"Sublocation",95:"State",100:"CountryCode",101:"Country",103:"OriginalTransmissionReference",105:"Headline",110:"Credit",115:"Source",116:"CopyrightNotice",118:"Contact",120:"Caption",121:"LocalCaption",122:"Writer",125:"RasterizedCaption",130:"ImageType",131:"ImageOrientation",135:"LanguageIdentifier",150:"AudioType",151:"AudioSamplingRate",152:"AudioSamplingResolution",153:"AudioDuration",154:"AudioOutcue",184:"JobID",185:"MasterDocumentID",186:"ShortDocumentID",187:"UniqueDocumentID",188:"OwnerID",200:"ObjectPreviewFileFormat",201:"ObjectPreviewFileVersion",202:"ObjectPreviewData",221:"Prefs",225:"ClassifyState",228:"SimilarityIndex",230:"DocumentNotes",231:"DocumentHistory",232:"ExifCameraInfo",255:"CatalogSets"},n.stringValues={10:{0:"0 (reserved)",1:"1 (most urgent)",2:"2",3:"3",4:"4",5:"5 (normal urgency)",6:"6",7:"7",8:"8 (least urgent)",9:"9 (user-defined priority)"},75:{a:"Morning",b:"Both Morning and Evening",p:"Evening"},131:{L:"Landscape",P:"Portrait",S:"Square"}},n.getText=function(t){var n=this.get(t),r=this.stringValues[this.map[t]];return r?r[n]:String(n)},n.getAll=function(){var t,n,r={};for(t in this)Object.prototype.hasOwnProperty.call(this,t)&&(n=this.tags[t])&&(r[n]=this.getText(n));return r},n.getName=function(t){return this.tags[t]},function(){var t,r=n.tags,i=n.map||{};for(t in r)Object.prototype.hasOwnProperty.call(r,t)&&(i[r[t]]=Number(t))}()}(t.exports?Df:window.loadImage)})),o((function(t){!function(t){var n,r=t.hasCanvasOption,i=t.hasMetaOption,e=t.transformCoordinates,o=t.getTransformedOptions;(n=document.createElement("img")).onload=function(){t.orientation=1===n.width&&2===n.height},n.src="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==",t.hasCanvasOption=function(n){return 1==!!n.orientation&&!t.orientation||n.orientation>1&&n.orientation<9||r.call(t,n)},t.hasMetaOption=function(n){return n&&!0===n.orientation&&!t.orientation||i.call(t,n)},t.transformCoordinates=function(n,r){e.call(t,n,r);var i=n.getContext("2d"),o=n.width,u=n.height,a=n.style.width,s=n.style.height,f=r.orientation;if(f>1&&f<9)switch(f>4&&(n.width=u,n.height=o,n.style.width=s,n.style.height=a),f){case 2:i.translate(o,0),i.scale(-1,1);break;case 3:i.translate(o,u),i.rotate(Math.PI);break;case 4:i.translate(0,u),i.scale(1,-1);break;case 5:i.rotate(.5*Math.PI),i.scale(1,-1);break;case 6:i.rotate(.5*Math.PI),i.translate(0,-u);break;case 7:i.rotate(.5*Math.PI),i.translate(o,-u),i.scale(-1,1);break;case 8:i.rotate(-.5*Math.PI),i.translate(-o,0)}},t.getTransformedOptions=function(n,r,i){var e,u,a=o.call(t,n,r),s=a.orientation;if(!0===s){if(t.orientation)return a;s=i&&i.exif&&i.exif.get("Orientation")}if(!(s>1&&s<9))return a;for(u in e={},a)Object.prototype.hasOwnProperty.call(a,u)&&(e[u]=a[u]);switch(e.orientation=s,s){case 2:e.left=a.right,e.right=a.left;break;case 3:e.left=a.right,e.top=a.bottom,e.right=a.left,e.bottom=a.top;break;case 4:e.top=a.bottom,e.bottom=a.top;break;case 5:e.left=a.top,e.top=a.left,e.right=a.bottom,e.bottom=a.right;break;case 6:e.left=a.top,e.top=a.right,e.right=a.bottom,e.bottom=a.left;break;case 7:e.left=a.bottom,e.top=a.right,e.right=a.top,e.bottom=a.left;break;case 8:e.left=a.bottom,e.top=a.left,e.right=a.top,e.bottom=a.right}return e.orientation>4&&(e.maxWidth=a.maxHeight,e.maxHeight=a.maxWidth,e.minWidth=a.minHeight,e.minHeight=a.minWidth,e.sourceWidth=a.sourceHeight,e.sourceHeight=a.sourceWidth),e}}(t.exports?Df:window.loadImage)}));var Lf=Df;const Ff=t=>new Promise(((n,r)=>{const i=new FileReader;i.onload=()=>{n(i.result)},i.onerror=({target:{error:{code:t}}})=>{r(Error(`File could not be read! Code=${t}`))},i.readAsArrayBuffer(t)})),Uf=t=>new Promise((n=>{Lf(t,(t=>t.toBlob(n)),{orientation:!0,canvas:!0})})),Bf=async t=>{let n=t;if(void 0===t)return"undefined";if("string"==typeof t)if(t.endsWith(".pbm")){const r=await fetch(Cf(t));n=await r.arrayBuffer()}else{let r=t;/data:image\/([a-zA-Z]*);base64,([^"]*)/.test(t)||(r=Cf(t)),n=await Ff(await Uf(r))}else if(t instanceof HTMLElement)"IMG"===t.tagName&&(n=await Bf(t.src)),"VIDEO"===t.tagName&&(n=await Bf(t.poster)),"CANVAS"===t.tagName&&await new Promise((r=>{t.toBlob((async t=>{n=await Ff(t),r()}))}));else if(t instanceof File||t instanceof Blob){let r=t;t.name.endsWith(".pbm")||(r=await Uf(r)),n=await Ff(r)}return new Uint8Array(n)};var Gf={defaultOptions:Pf,spawnWorker:({workerPath:t,workerBlobURL:n})=>{let r;if(Blob&&URL&&n){const n=new Blob([`importScripts("${t}");`],{type:"application/javascript"});r=new Worker(URL.createObjectURL(n))}else r=new Worker(t);return r},terminateWorker:t=>{t.terminate()},onMessage:(t,n)=>{t.onmessage=({data:t})=>{n(t)}},send:async(t,n)=>{t.postMessage(n)},loadImage:Bf};const{log:zf}=Of,{defaultOEM:Hf}=xf,{defaultOptions:Qf,spawnWorker:Vf,terminateWorker:Wf,onMessage:Yf,loadImage:Kf,send:Xf}=Gf;let $f=0;var qf=(t={})=>{const n=gf("Worker",$f),{logger:r,errorHandler:i,...e}=(t=>{const n={...t};return["corePath","workerPath","langPath"].forEach((r=>{void 0!==t[r]&&(n[r]=jf(n[r]))})),n})({...Qf,...t}),o={},u={};let a=Vf(e);$f+=1;const s=(t,n)=>{o[t]=n},f=(t,n)=>{u[t]=n},h=({id:t,action:r,payload:i})=>new Promise(((e,o)=>{zf(`[${n}]: Start ${t}, action=${r}`),s(r,e),f(r,o),Xf(a,{workerId:n,jobId:t,action:r,payload:i})}));return Yf(a,(({workerId:t,jobId:n,status:e,action:a,data:s})=>{if("resolve"===e){zf(`[${t}]: Complete ${n}`);let r=s;"recognize"===a?r=(t=>{const n=[],r=[],i=[],e=[],o=[];return t.blocks.forEach((u=>{u.paragraphs.forEach((n=>{n.lines.forEach((r=>{r.words.forEach((i=>{i.symbols.forEach((e=>{o.push({...e,page:t,block:u,paragraph:n,line:r,word:i})})),e.push({...i,page:t,block:u,paragraph:n,line:r})})),i.push({...r,page:t,block:u,paragraph:n})})),r.push({...n,page:t,block:u})})),n.push({...u,page:t})})),{...t,blocks:n,paragraphs:r,lines:i,words:e,symbols:o}})(s):"getPDF"===a&&(r=Array.from({...s,length:Object.keys(s).length})),o[a]({jobId:n,data:r})}else if("reject"===e){if(u[a](s),!i)throw Error(s);i(s)}else"progress"===e&&r({...s,userJobId:n})})),{id:n,worker:a,setResolve:s,setReject:f,load:t=>h(_f({id:t,action:"load",payload:{options:e}})),writeText:(t,n,r)=>h(_f({id:r,action:"FS",payload:{method:"writeFile",args:[t,n]}})),readText:(t,n)=>h(_f({id:n,action:"FS",payload:{method:"readFile",args:[t,{encoding:"utf8"}]}})),removeFile:(t,n)=>h(_f({id:n,action:"FS",payload:{method:"unlink",args:[t]}})),FS:(t,n,r)=>h(_f({id:r,action:"FS",payload:{method:t,args:n}})),loadLanguage:(t="eng",n)=>h(_f({id:n,action:"loadLanguage",payload:{langs:t,options:e}})),initialize:(t="eng",n=Hf,r)=>h(_f({id:r,action:"initialize",payload:{langs:t,oem:n}})),setParameters:(t={},n)=>h(_f({id:n,action:"setParameters",payload:{params:t}})),recognize:async(t,n={},r)=>h(_f({id:r,action:"recognize",payload:{image:await Kf(t),options:n}})),getPDF:(t="Tesseract OCR Result",n=!1,r)=>h(_f({id:r,action:"getPDF",payload:{title:t,textonly:n}})),detect:async(t,n)=>h(_f({id:n,action:"detect",payload:{image:await Kf(t)}})),terminate:async()=>(null!==a&&(Wf(a),a=null),Promise.resolve())}},Zf={recognize:async(t,n,r)=>{const i=qf(r);return await i.load(),await i.loadLanguage(n),await i.initialize(n),i.recognize(t).finally((async()=>{await i.terminate()}))},detect:async(t,n)=>{const r=qf(n);return await r.load(),await r.loadLanguage("osd"),await r.initialize("osd"),r.detect(t).finally((async()=>{await r.terminate()}))}};const{setLogging:Jf}=Of;var th={languages:{AFR:"afr",AMH:"amh",ARA:"ara",ASM:"asm",AZE:"aze",AZE_CYRL:"aze_cyrl",BEL:"bel",BEN:"ben",BOD:"bod",BOS:"bos",BUL:"bul",CAT:"cat",CEB:"ceb",CES:"ces",CHI_SIM:"chi_sim",CHI_TRA:"chi_tra",CHR:"chr",CYM:"cym",DAN:"dan",DEU:"deu",DZO:"dzo",ELL:"ell",ENG:"eng",ENM:"enm",EPO:"epo",EST:"est",EUS:"eus",FAS:"fas",FIN:"fin",FRA:"fra",FRK:"frk",FRM:"frm",GLE:"gle",GLG:"glg",GRC:"grc",GUJ:"guj",HAT:"hat",HEB:"heb",HIN:"hin",HRV:"hrv",HUN:"hun",IKU:"iku",IND:"ind",ISL:"isl",ITA:"ita",ITA_OLD:"ita_old",JAV:"jav",JPN:"jpn",KAN:"kan",KAT:"kat",KAT_OLD:"kat_old",KAZ:"kaz",KHM:"khm",KIR:"kir",KOR:"kor",KUR:"kur",LAO:"lao",LAT:"lat",LAV:"lav",LIT:"lit",MAL:"mal",MAR:"mar",MKD:"mkd",MLT:"mlt",MSA:"msa",MYA:"mya",NEP:"nep",NLD:"nld",NOR:"nor",ORI:"ori",PAN:"pan",POL:"pol",POR:"por",PUS:"pus",RON:"ron",RUS:"rus",SAN:"san",SIN:"sin",SLK:"slk",SLV:"slv",SPA:"spa",SPA_OLD:"spa_old",SQI:"sqi",SRP:"srp",SRP_LATN:"srp_latn",SWA:"swa",SWE:"swe",SYR:"syr",TAM:"tam",TEL:"tel",TGK:"tgk",TGL:"tgl",THA:"tha",TIR:"tir",TUR:"tur",UIG:"uig",UKR:"ukr",URD:"urd",UZB:"uzb",UZB_CYRL:"uzb_cyrl",VIE:"vie",YID:"yid"},OEM:Tf,PSM:{OSD_ONLY:"0",AUTO_OSD:"1",AUTO_ONLY:"2",AUTO:"3",SINGLE_COLUMN:"4",SINGLE_BLOCK_VERT_TEXT:"5",SINGLE_BLOCK:"6",SINGLE_LINE:"7",SINGLE_WORD:"8",CIRCLE_WORD:"9",SINGLE_CHAR:"10",SPARSE_TEXT:"11",SPARSE_TEXT_OSD:"12"},createScheduler:()=>{const t=gf("Scheduler",kf),n={},r={};let i=[];kf+=1;const e=()=>Object.keys(n).length,o=()=>{if(0!==i.length){const t=Object.keys(n);for(let e=0;e<t.length;e+=1)if(void 0===r[t[e]]){i[0](n[t[e]]);break}}};return{addWorker:r=>(n[r.id]=r,Ef(`[${t}]: Add ${r.id}`),Ef(`[${t}]: Number of workers=${e()}`),o(),r.id),addJob:async(n,...u)=>{if(0===e())throw Error(`[${t}]: You need to have at least one worker before adding jobs`);return((n,e)=>new Promise(((u,a)=>{const s=_f({action:n,payload:e});i.push((async t=>{i.shift(),r[t.id]=s;try{u(await t[n].apply(void 0,[...e,s.id]))}catch(t){a(t)}finally{delete r[t.id],o()}})),Ef(`[${t}]: Add ${s.id} to JobQueue`),Ef(`[${t}]: JobQueue length=${i.length}`),o()})))(n,u)},terminate:async()=>{Object.keys(n).forEach((async t=>{await n[t].terminate()})),i=[]},getQueueLen:()=>i.length,getNumWorkers:e}},createWorker:qf,setLogging:Jf,...Zf};let nh=class{constructor(r){t(this,r),this.onSymbol=n(this,"onSymbol",7),this.MODE_SINGLE="Single",this.MODE_STREAMING="Streaming",this.NOT_ALLOWED_ERROR="NotAllowedError",this.errorText="",this.realZoom=1,this.stageWidth=0,this.stageHeight=0,this.videoHeight=0,this.videoWidth=0,this.sampleX=0,this.sampleY=0,this.sampleWidth=0,this.sampleHeight=0,this.scanWidth=0,this.scanHeight=0,this.available=!1,this.targetVideoSize=1920,this.targetFrameRate=60,this.zoom=0,this.cropX=1,this.cropY=1,this.ocrScanner=!1,this.ocrIsScanning=!1,this.errorText="",this.noPermission=!1}ocrHandler(){this.ocrScanner&&(this.ocrIsScanning=!this.ocrIsScanning)}openCameraHandler(){this.available=!1,this.twintagScannerRef&&(this.twintagScannerRef.style.display="block"),this.ocrScanner&&(this.ocrIsScanning=!1),this.getMedia()}closeHandler(){this.available&&(console.log(this.available),this.twintagScannerRef&&(this.twintagScannerRef.style.display="none"),this.stopStream())}componentWillLoad(){this.codeReader=new He}componentDidLoad(){this.video=this.videoElement,this.osCanvas=document.createElement("canvas"),this.osContext=this.osCanvas.getContext("2d"),this.getMedia(),this.videoContainerRef.style.setProperty("--xCrop",this.setLength(this.cropX)),this.videoContainerRef.style.setProperty("--yCrop",this.setLength(this.cropY))}setLength(t){return""+50*(1-t)}render(){return r("div",{class:"scanner-container"},this.noPermission?r("div",null,this.errorText):null,this.customCheckIcon?r("img",{class:"check-icon",src:this.customCheckIcon,ref:t=>this.successIcon=t}):r("svg",{class:"check-icon",ref:t=>this.successIcon=t,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 150 150",width:"150px",height:"150px"},r("g",null,r("path",{style:{stroke:"none",fillRule:"nonzero",fill:"rgb(23.529412%,54.901963%,98.039216%)",fillOpacity:"1",transform:"translateX(10%)"},d:"M 125.8125 25.875 C 123.820312 25.945312 121.992188 27 120.9375 28.6875 L 64.5 115.03125 L 27.9375 83.4375 C 26.367188 81.808594 24.011719 81.199219 21.84375 81.878906 C 19.6875 82.546875 18.082031 84.375 17.707031 86.601562 C 17.332031 88.839844 18.234375 91.089844 20.0625 92.4375 L 61.875 128.625 C 63.1875 129.738281 64.921875 130.230469 66.621094 129.984375 C 68.332031 129.726562 69.84375 128.753906 70.78125 127.3125 L 131.0625 35.25 C 132.351562 33.363281 132.457031 30.925781 131.34375 28.933594 C 130.230469 26.953125 128.085938 25.769531 125.8125 25.875 Z M 125.8125 25.875 "}),r("path",{style:{stroke:"none",fillRule:"nonzero",fill:"rgb(23.529412%,54.901963%,98.039216%)",fillOpacity:"1",transform:"translateX(-10%)"},d:"M 125.8125 25.875 C 123.820312 25.945312 121.992188 27 120.9375 28.6875 L 64.5 115.03125 L 27.9375 83.4375 C 26.367188 81.808594 24.011719 81.199219 21.84375 81.878906 C 19.6875 82.546875 18.082031 84.375 17.707031 86.601562 C 17.332031 88.839844 18.234375 91.089844 20.0625 92.4375 L 61.875 128.625 C 63.1875 129.738281 64.921875 130.230469 66.621094 129.984375 C 68.332031 129.726562 69.84375 128.753906 70.78125 127.3125 L 131.0625 35.25 C 132.351562 33.363281 132.457031 30.925781 131.34375 28.933594 C 130.230469 26.953125 128.085938 25.769531 125.8125 25.875 Z M 125.8125 25.875 "}))),r("div",{class:"video-container",ref:t=>this.videoContainerRef=t},r("video",{crossOrigin:"Anonymous",autoplay:!0,playsinline:!0,ref:t=>this.videoElement=t})))}getMedia(){let t,n;!function(t){t[t.user=0]="user",t[t.environment=1]="environment",t[t.left=2]="left",t[t.right=3]="right"}(t||(t={})),function(t){t[t.none=0]="none",t[t["crop-and-scale"]=1]="crop-and-scale"}(n||(n={})),navigator.mediaDevices.getUserMedia({audio:!1,video:{facingMode:t[t.environment],width:{ideal:this.targetVideoSize},height:{ideal:this.targetVideoSize},frameRate:{ideal:this.targetFrameRate},resizeMode:n[n.none],zoom:!0}}).then((t=>e(this,void 0,void 0,(function*(){window.localStream=t;const[n]=t.getVideoTracks();if(void 0!==n.getCapabilities){const t=n.getCapabilities();if("zoom"in n.getSettings()){const r=t.zoom.min,i=t.zoom.step,e=Math.min((t.zoom.max-r)/r,this.zoom),o=r+Math.floor((r*e-r)/i)*i;this.realZoom=o/r,n.applyConstraints({advanced:[{zoom:o}]})}}this.video.srcObject=t,yield this.video.play(),If.to(this.videoContainerRef,{duration:.2,opacity:1}),(()=>{e(this,void 0,void 0,(function*(){this.ocrScanner&&(this.worker=th.createWorker(),yield this.worker.load(),yield this.worker.loadLanguage("eng"),yield this.worker.initialize("eng"))}))})(),this.available=!0,this.initRenderer()})))).catch((t=>{t.name===this.NOT_ALLOWED_ERROR?(this.noPermission=!0,this.errorText="Camera Permission Denied ..."):this.errorText=t.message}))}tick(){return e(this,void 0,void 0,(function*(){const t=this.video;if(this.video.readyState===t.HAVE_ENOUGH_DATA){let n=t.videoWidth,r=t.videoHeight,i=.5*n-this.cropX*n*.5,e=.5*r-this.cropY*r*.5,o=n-i,u=r-e;this.videoHeight==r&&this.videoWidth==n||(this.osCanvas.width=n*this.cropX,this.osCanvas.height=r*this.cropY,this.videoWidth=n,this.videoHeight=r,console.log("video",n,r),console.log("sample",n,r,i,e),console.log("scan",n,r),this.resize()),this.scanning||(this.scanning=!0,this.osContext.drawImage(t,i,e,o,u,0,0,o,u),this.scan())}this.animateFrames()}))}initRenderer(){this.stageWidth=this.video.videoWidth,this.stageHeight=this.video.videoHeight,this.app=new s({height:this.stageHeight,width:this.stageWidth,view:this.video}),this.animateFrames(),window.addEventListener("resize",(()=>this.resize()))}animateFrames(){null!==this.video.srcObject&&(this.animationFrameRequest=requestAnimationFrame((()=>{this.tick()})))}scan(){return e(this,void 0,void 0,(function*(){yield this._scan(),this.scanning=!1}))}_scan(){var t;return e(this,void 0,void 0,(function*(){let n=[];try{if(this.ocrScanner||(n=yield this.codeReader.readFromCanvas(this.osCanvas)),this.ocrIsScanning){const{data:{text:t}}=yield this.worker.recognize(this.osCanvas),r=/[a-zA-Z0-9@#\/)(+=._-]/gi;n=[{Text:t&&t.match(r)&&t.match(r).filter((t=>t)).join(""),Format:"String"}]}}catch(t){return void(this.errorText="something went wrong.")}let r=!1;for(const i of n)i.Text!=(null===(t=this.lastScan)||void 0===t?void 0:t.Text)&&(this.lastScan=i,this.emitResult(i),r=!0);r&&(this.showProcessedCheck(),this.stopStream())}))}showProcessedCheck(){const t=If.timeline();t.to(this.successIcon,{duration:.3,opacity:1}),setTimeout((()=>{t.to(this.successIcon,{duration:.2,opacity:0}),this.twintagScannerRef&&t.to(this.twintagScannerRef,{duration:.2,display:"none"})}),600)}stopStream(){return e(this,void 0,void 0,(function*(){window.localStream.getTracks().forEach((t=>{this.video.srcObject=null,this.osContext.clearRect(0,0,this.osContext.canvas.width,this.osContext.canvas.height),t.stop()})),If.to(this.videoContainerRef,{duration:.1,opacity:0}),this.ocrScanner&&(yield this.worker.terminate()),this.lastScan=null}))}emitResult(t){this.frameCapture=this.osCanvas.toDataURL(),this.onSymbol.emit({Text:t.Text,Format:t.Format,Frame:this.frameCapture})}resize(){this.stageWidth=this.video.videoWidth,this.stageHeight=this.video.videoHeight;const t=this.videoWidth/this.videoHeight;let n=0;this.stageWidth/this.stageHeight>t?(this.app.resize(this.stageWidth,this.stageWidth/t),this.app.position(0)):(n=this.stageHeight/this.videoHeight,this.app.position(-(this.stageWidth*n-this.stageWidth)/2),this.app.resize(this.stageHeight*t,this.stageHeight))}get twintagScannerRef(){return i(this)}};nh.style=':host{display:block;position:absolute;inset:0}.check-icon{position:absolute;opacity:0;z-index:2222}.hidden-video{display:block;width:0;height:0}.scanner-container{display:grid;place-items:center;position:relative;top:50%;width:100%;transform:translateY(-50%)}.scanner-container .video-container{--xCrop:0;--yCrop:0;display:grid;position:relative;opacity:0}.scanner-container .video-container::after{content:"";position:absolute;top:50%;left:50%;width:100%;height:100%;background:rgba(0, 0, 0, 0.75);transform:translate(-50%, -50%);-webkit-clip-path:polygon(0% 0%, 0% 100%, calc(var(--xCrop) * 1%) 100%, calc(var(--xCrop) * 1%) calc(var(--yCrop) * 1%), calc(calc(100 - var(--xCrop)) * 1%) calc(var(--yCrop) * 1%), calc(calc(100 - var(--xCrop)) * 1%) calc(calc(100 - var(--yCrop)) * 1%), calc(var(--xCrop) * 1%) calc(calc(100 - var(--yCrop)) * 1%), calc(var(--xCrop) * 1%) 100%, 100% 100%, 100% 0%);clip-path:polygon(0% 0%, 0% 100%, calc(var(--xCrop) * 1%) 100%, calc(var(--xCrop) * 1%) calc(var(--yCrop) * 1%), calc(calc(100 - var(--xCrop)) * 1%) calc(var(--yCrop) * 1%), calc(calc(100 - var(--xCrop)) * 1%) calc(calc(100 - var(--yCrop)) * 1%), calc(var(--xCrop) * 1%) calc(calc(100 - var(--yCrop)) * 1%), calc(var(--xCrop) * 1%) 100%, 100% 100%, 100% 0%)}.scanner-container .video-container video{width:100% !important;height:100% !important}';export{nh as twintag_scanner}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-71890127.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-36630b76",[[1,"twintag-preview",{item:[1],extension:[1],showButtons:[4,"show-buttons"],previewableItem:[32],type:[32]}]]],["p-58de2b09",[[1,"twintag-auth-callback"]]],["p-20f9644a",[[1,"twintag-auth-logout"]]],["p-e10a31ad",[[1,"twintag-media",{first:[1],middle:[1],last:[1]}]]],["p-
|
|
1
|
+
import{p as e,b as t}from"./p-71890127.js";(()=>{const t=import.meta.url,a={};return""!==t&&(a.resourcesUrl=new URL(".",t).href),e(a)})().then((e=>t([["p-36630b76",[[1,"twintag-preview",{item:[1],extension:[1],showButtons:[4,"show-buttons"],previewableItem:[32],type:[32]}]]],["p-58de2b09",[[1,"twintag-auth-callback"]]],["p-20f9644a",[[1,"twintag-auth-logout"]]],["p-e10a31ad",[[1,"twintag-media",{first:[1],middle:[1],last:[1]}]]],["p-730b57e2",[[1,"twintag-scanner",{customCheckIcon:[1,"custom-check-icon"],targetVideoSize:[2,"target-video-size"],targetFrameRate:[2,"target-frame-rate"],zoom:[2],cropX:[2,"crop-x"],cropY:[2,"crop-y"],ocrScanner:[4,"ocr-scanner"],available:[32],frameCapture:[32],ocrIsScanning:[32]},[[2,"ocr","ocrHandler"],[2,"openCamera","openCameraHandler"],[2,"closeCamera","closeHandler"]]]]],["p-d1aa775b",[[1,"twintag-share",{url:[1],title:[1],subtitle:[1],closeBtn:[1,"close-btn"],copyClipboardBtn:[1,"copy-clipboard-btn"],open:[1540]},[[0,"keydown","handleKeyDown"]]]]],["p-414750f0",[[1,"twintag-spinner",{color:[513],duration:[2],name:[1]}]]],["p-4317e5c6",[[0,"pdf-error",{message:[1]}],[0,"pdf-toolbar",{url:[1],showButtons:[4,"show-buttons"],totalPages:[2,"total-pages"],currentPage:[2,"current-page"],activePage:[32]}]]],["p-af64e927",[[0,"twintag-pdf-viewer",{canvasWidth:[2,"canvas-width"],src:[1],showButtons:[4,"show-buttons"],currentPage:[32],totalPages:[32],error:[32],pdfViewer:[32],pdfContainer:[32]},[[0,"activePageEvent","setActivePage"]]]]]],e)));
|
package/dist/types/version.d.ts
CHANGED