@scandit/web-datacapture-core 7.6.4 → 7.6.6
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/LICENSE +1 -1
- package/THIRD_PARTY.txt +331 -70
- package/build/js/Camera.js +1 -1
- package/build/js/DataCaptureContext.js +1 -1
- package/build/js/DataCaptureVersion.js +1 -1
- package/build/js/DataCaptureView.js +1 -1
- package/build/js/LoadingStatus.d.ts +3 -2
- package/build/js/LoadingStatus.js +1 -1
- package/build/js/ScanditIconBuilder.js +1 -1
- package/build/js/chunks/{chunk-KOFOHU5G.js → chunk-6QDI75SI.js} +1 -1
- package/build/js/chunks/{chunk-CKBTO64W.js → chunk-7BQCEIHQ.js} +2 -2
- package/build/js/chunks/{chunk-EWJ2542U.js → chunk-CNQAVSV7.js} +1 -1
- package/build/js/chunks/{chunk-KIT67VAW.js → chunk-CYWUCE5E.js} +1 -1
- package/build/js/chunks/chunk-GNA6ZKV3.js +1 -0
- package/build/js/chunks/chunk-ILEZODKA.js +1 -0
- package/build/js/chunks/chunk-JQDTJGOT.js +1 -0
- package/build/js/chunks/{chunk-5SBW2P36.js → chunk-LBTRRUW4.js} +1 -1
- package/build/js/chunks/{chunk-GYSREBEJ.js → chunk-MCAVCIZT.js} +1 -1
- package/build/js/chunks/chunk-N6BLNZCH.js +2 -0
- package/build/js/chunks/{chunk-TGPSSOJV.js → chunk-VGYV5AKK.js} +1 -1
- package/build/js/chunks/chunk-W27MUZ26.js +1 -0
- package/build/js/chunks/{chunk-UFUD6TK4.js → chunk-YRO2BG2S.js} +1 -1
- package/build/js/index.d.ts +5 -2
- package/build/js/index.js +3 -3
- package/build/js/private/CameraManager.js +1 -1
- package/build/js/private/CoreModuleLicenseTextProvider.js +1 -1
- package/build/js/private/SingleImageUploaderView.js +1 -1
- package/build/js/private/ViewControls+related.js +1 -1
- package/build/js/sdk.d.ts +3 -3
- package/build/js/sdk.js +1 -1
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/coreCapture.inlineWorker.js +1 -1
- package/build/js/worker/dataCaptureEngine.js +1 -1
- package/build/js/worker/index.js +1 -1
- package/package.json +1 -1
- package/build/js/chunks/chunk-34HLD6AY.js +0 -2
- package/build/js/chunks/chunk-6H6FKGVE.js +0 -1
- package/build/js/chunks/chunk-A5FG4NNK.js +0 -1
- package/build/js/chunks/chunk-AO4TFXV3.js +0 -1
- package/build/js/chunks/chunk-NKCR7VPO.js +0 -1
- /package/build/js/chunks/{chunk-W2FVIH2I.js → chunk-6TG3MN7M.js} +0 -0
package/LICENSE
CHANGED
package/THIRD_PARTY.txt
CHANGED
|
@@ -1,73 +1,334 @@
|
|
|
1
|
-
Apache License
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
202
|
+
|
|
203
|
+
|
|
204
|
+
================================================================================
|
|
205
|
+
|
|
206
|
+
|
|
207
|
+
Copyright (c) 2017-2022 Arm Limited
|
|
208
|
+
Copyright (c) 2007-2010 Baptiste Lepilleur
|
|
209
|
+
Copyright (c) 2013-2022 Niels Lohmann
|
|
210
|
+
Copyright (c) 2008-2018 The Khronos Group Inc.
|
|
211
|
+
|
|
212
|
+
Permission is hereby granted, free of charge, to any person
|
|
213
|
+
obtaining a copy of this software and associated documentation
|
|
214
|
+
files (the "Software"), to deal in the Software without
|
|
215
|
+
restriction, including without limitation the rights to use, copy,
|
|
216
|
+
modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
217
|
+
of the Software, and to permit persons to whom the Software is
|
|
218
|
+
furnished to do so, subject to the following conditions:
|
|
219
|
+
|
|
220
|
+
The above copyright notice and this permission notice shall be
|
|
221
|
+
included in all copies or substantial portions of the Software.
|
|
222
|
+
|
|
223
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
224
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
225
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
226
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
227
|
+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
228
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
229
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
230
|
+
SOFTWARE.
|
|
231
|
+
|
|
232
|
+
|
|
233
|
+
================================================================================
|
|
234
|
+
|
|
235
|
+
|
|
236
|
+
Written by: Philip Hazel
|
|
237
|
+
Email local part: Philip.Hazel
|
|
238
|
+
Email domain: gmail.com
|
|
239
|
+
|
|
240
|
+
Retired from University of Cambridge Computing Service,
|
|
241
|
+
Cambridge, England.
|
|
242
|
+
|
|
243
|
+
Copyright (c) 1997-2007 University of Cambridge
|
|
244
|
+
Copyright (c) 2007-2024 Philip Hazel
|
|
245
|
+
All rights reserved.
|
|
246
|
+
|
|
247
|
+
Redistribution and use in source and binary forms, with or without modification,
|
|
248
|
+
are permitted provided that the following conditions are met:
|
|
249
|
+
|
|
250
|
+
* Redistributions of source code must retain the above copyright notice,
|
|
251
|
+
this list of conditions and the following disclaimer.
|
|
252
|
+
|
|
253
|
+
* Redistributions in binary form must reproduce the above copyright notice,
|
|
254
|
+
this list of conditions and the following disclaimer in the documentation
|
|
255
|
+
and/or other materials provided with the distribution.
|
|
256
|
+
|
|
257
|
+
* Neither the names of the copyright holders nor the names of the contributors
|
|
258
|
+
may be used to endorse or promote products derived from this software
|
|
259
|
+
without specific prior written permission.
|
|
260
|
+
|
|
261
|
+
This software is provided by the copyright holders and contributors "as is" and
|
|
262
|
+
any express or implied warranties, including, but not limited to, the implied
|
|
263
|
+
warranties of merchantability and fitness for a particular purpose are disclaimed.
|
|
264
|
+
In no event shall copyright holders or contributors be liable for any direct,
|
|
265
|
+
indirect, incidental, special, exemplary, or consequential damages
|
|
266
|
+
(including, but not limited to, procurement of substitute goods or services;
|
|
267
|
+
loss of use, data, or profits; or business interruption) however caused
|
|
268
|
+
and on any theory of liability, whether in contract, strict liability,
|
|
269
|
+
or tort (including negligence or otherwise) arising in any way out of
|
|
270
|
+
the use of this software, even if advised of the possibility of such damage.
|
|
271
|
+
|
|
272
|
+
The second condition in the BSD licence (covering binary redistributions)
|
|
273
|
+
does not apply all the way down a chain of software. If binary package A
|
|
274
|
+
includes PCRE2, it must respect the condition, but if package B is software
|
|
275
|
+
that includes package A, the condition is not imposed on package B unless
|
|
276
|
+
it uses PCRE2 independently.
|
|
2
277
|
|
|
3
|
-
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
4
278
|
|
|
5
|
-
|
|
279
|
+
================================================================================
|
|
280
|
+
|
|
281
|
+
|
|
282
|
+
Copyright (c) 2017 Ollix
|
|
283
|
+
|
|
284
|
+
Permission is hereby granted, free of charge, to any person
|
|
285
|
+
obtaining a copy of this software and associated documentation
|
|
286
|
+
files (the "Software"), to deal in the Software without
|
|
287
|
+
restriction, including without limitation the rights to use, copy,
|
|
288
|
+
modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
289
|
+
of the Software, and to permit persons to whom the Software is
|
|
290
|
+
furnished to do so, subject to the following conditions:
|
|
291
|
+
|
|
292
|
+
The above copyright notice and this permission notice shall be
|
|
293
|
+
included in all copies or substantial portions of the Software.
|
|
294
|
+
|
|
295
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
296
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
297
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
298
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
299
|
+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
300
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
301
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
302
|
+
SOFTWARE.
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
================================================================================
|
|
306
|
+
|
|
307
|
+
Copyright (c) 2014 Arnout Kazemier
|
|
308
|
+
Copyright (c) 2018 Copyright 2018 Klaus Hartl, Fagner Brack, GitHub Contributors
|
|
309
|
+
Copyright (c) 2013-2020 James Simpson and GoldFire Studios, Inc.
|
|
310
|
+
Copyright (c) 2012-2024 Faisal Salman <f@faisalman.com>
|
|
311
|
+
Copyright (c) 2017-2018 Fredrik Nicol
|
|
312
|
+
Copyright (c) 2005-2014 Rich Felker, et al.
|
|
313
|
+
Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
|
|
314
|
+
|
|
315
|
+
Permission is hereby granted, free of charge, to any person
|
|
316
|
+
obtaining a copy of this software and associated documentation
|
|
317
|
+
files (the "Software"), to deal in the Software without
|
|
318
|
+
restriction, including without limitation the rights to use, copy,
|
|
319
|
+
modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
320
|
+
of the Software, and to permit persons to whom the Software is
|
|
321
|
+
furnished to do so, subject to the following conditions:
|
|
322
|
+
|
|
323
|
+
The above copyright notice and this permission notice shall be
|
|
324
|
+
included in all copies or substantial portions of the Software.
|
|
325
|
+
|
|
326
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
327
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
328
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
329
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
|
330
|
+
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
331
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
332
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
333
|
+
SOFTWARE.
|
|
6
334
|
|
|
7
|
-
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
|
8
|
-
|
|
9
|
-
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
|
10
|
-
|
|
11
|
-
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
|
12
|
-
|
|
13
|
-
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
|
14
|
-
|
|
15
|
-
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
|
16
|
-
|
|
17
|
-
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
|
18
|
-
|
|
19
|
-
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
|
20
|
-
|
|
21
|
-
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
|
22
|
-
|
|
23
|
-
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
|
24
|
-
|
|
25
|
-
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
|
26
|
-
|
|
27
|
-
2. Grant of Copyright License.
|
|
28
|
-
|
|
29
|
-
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
|
30
|
-
|
|
31
|
-
3. Grant of Patent License.
|
|
32
|
-
|
|
33
|
-
Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
|
34
|
-
|
|
35
|
-
4. Redistribution.
|
|
36
|
-
|
|
37
|
-
You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
|
38
|
-
|
|
39
|
-
You must give any other recipients of the Work or Derivative Works a copy of this License; and You must cause any modified files to carry prominent notices stating that You changed the files; and You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
|
40
|
-
|
|
41
|
-
5. Submission of Contributions.
|
|
42
|
-
|
|
43
|
-
Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
|
44
|
-
|
|
45
|
-
6. Trademarks.
|
|
46
|
-
|
|
47
|
-
This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
|
48
|
-
|
|
49
|
-
7. Disclaimer of Warranty.
|
|
50
|
-
|
|
51
|
-
Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
|
52
|
-
|
|
53
|
-
8. Limitation of Liability.
|
|
54
|
-
|
|
55
|
-
In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
|
56
|
-
|
|
57
|
-
9. Accepting Warranty or Additional Liability.
|
|
58
|
-
|
|
59
|
-
While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
|
60
|
-
|
|
61
|
-
END OF TERMS AND CONDITIONS
|
|
62
|
-
|
|
63
|
-
APPENDIX: How to apply the Apache License to your work
|
|
64
|
-
|
|
65
|
-
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
|
66
|
-
|
|
67
|
-
Copyright [yyyy] [name of copyright owner]
|
|
68
|
-
|
|
69
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
|
|
70
|
-
|
|
71
|
-
http://www.apache.org/licenses/LICENSE-2.0
|
|
72
|
-
|
|
73
|
-
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
package/build/js/Camera.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as Camera}from'./chunks/chunk-
|
|
1
|
+
export{a as Camera}from'./chunks/chunk-CYWUCE5E.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as DataCaptureContext}from'./chunks/chunk-
|
|
1
|
+
export{a as DataCaptureContext}from'./chunks/chunk-7BQCEIHQ.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as DataCaptureVersion}from'./chunks/chunk-
|
|
1
|
+
export{a as DataCaptureVersion}from'./chunks/chunk-ILEZODKA.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as DataCaptureView}from'./chunks/chunk-
|
|
1
|
+
export{a as DataCaptureView}from'./chunks/chunk-6QDI75SI.js';
|
|
@@ -13,11 +13,12 @@ interface LoadingStatusSubscriber {
|
|
|
13
13
|
(info: ProgressInfo): void;
|
|
14
14
|
}
|
|
15
15
|
declare class LoadingStatus {
|
|
16
|
+
private static instance;
|
|
17
|
+
static getInstance(): LoadingStatus;
|
|
16
18
|
private readonly subscribers;
|
|
17
19
|
subscribe(subscriber: LoadingStatusSubscriber): void;
|
|
18
20
|
unsubscribe(subscriber: LoadingStatusSubscriber): void;
|
|
19
21
|
private notify;
|
|
20
22
|
}
|
|
21
|
-
declare const loadingStatus: LoadingStatus;
|
|
22
23
|
|
|
23
|
-
export { LoadingStatus, type LoadingStatusSubscriber, type ProgressInfo
|
|
24
|
+
export { LoadingStatus, type LoadingStatusSubscriber, type ProgressInfo };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as LoadingStatus
|
|
1
|
+
export{a as LoadingStatus}from'./chunks/chunk-JQDTJGOT.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{c as ScanditIconBuilder,b as ScanditIconForIconType,a as ScanditIconType}from'./chunks/chunk-
|
|
1
|
+
export{c as ScanditIconBuilder,b as ScanditIconForIconType,a as ScanditIconType}from'./chunks/chunk-6TG3MN7M.js';export{a as ScanditIconShape}from'./chunks/chunk-27Z5CYJL.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {b as b$4}from'./chunk-DUFF6WVD.js';import {a as a$9}from'./chunk-R3XUWVHG.js';import {d as d$2,c,b as b$5}from'./chunk-EWJ2542U.js';import {a as a$f}from'./chunk-MQ6H2ORR.js';import {a as a$2}from'./chunk-N5YZEC56.js';import {a as a$b}from'./chunk-K7MUTJWB.js';import {b as b$1,a as a$3}from'./chunk-5S537AFM.js';import {a as a$d}from'./chunk-GYSREBEJ.js';import {a as a$g}from'./chunk-DMOXDUF6.js';import {a as a$a}from'./chunk-7TQID6JJ.js';import {a as a$c}from'./chunk-2HL2IEE2.js';import {a as a$8}from'./chunk-KYNYQBNF.js';import {a as a$5}from'./chunk-EKOWJS3E.js';import {b as b$2}from'./chunk-457L5N2F.js';import {a as a$6}from'./chunk-3MEGNPVU.js';import {a as a$1}from'./chunk-VJB527QZ.js';import {a as a$7}from'./chunk-UUD3OXOZ.js';import {a}from'./chunk-GHTCNOQN.js';import {d as d$1}from'./chunk-5SBW2P36.js';import {a as a$e}from'./chunk-XR65N6EG.js';import {d}from'./chunk-VW3DMTE7.js';import {a as a$4,b as b$3,i,f}from'./chunk-TPQTY3KB.js';import {a as a$h}from'./chunk-WUHKODFA.js';var b="core.camera.recovery",B=class q{constructor(){this.focusGesture=d.DataCaptureView.focusGesture;this.zoomGesture=d.DataCaptureView.zoomGesture;this._scanAreaMargins=d.DataCaptureView.scanAreaMargins;this._pointOfInterest=d.DataCaptureView.pointOfInterest;this._logoStyle=d.DataCaptureView.logoStyle;this._logoAnchor=d.DataCaptureView.logoAnchor;this._logoOffset=d.DataCaptureView.logoOffset;this._context=null;this.overlays=new Set;this.controls=[];this.controlWidgets=new WeakMap;this.frameSourceListener={didChangeState:this.onFrameSourceChange.bind(this)};this._previewCamera=null;this.frozenFrameCanvas=document.createElement("canvas");this.listeners=[];this.isVideoElementDetached=false;this.orientation="portrait";this.hiddenProperties={stopVideoTracksOnVisibilityChange:true,freezeFrameWhenStoppingFrameSource:true};this.orientationObserver=new b$1;this.onOrientationChangeListener=this.onOrientationChange.bind(this);this.onHintPresenterUpdateHandler=this.onHintPresenterUpdate.bind(this);this.onBeforeShowToastsHandler=this.onBeforeShowToasts.bind(this);this.onWorkerMessageHandler=this.onWorkerMessage.bind(this);this.htmlElementDidChangeHandler=this.htmlElementDidChange.bind(this);this.htmlElementDisconnectedHandler=this.htmlElementDisconnected.bind(this);this.notificationPresenter=null;this.visibilityListener=this.onVisibilityChange.bind(this),this.cameraRecoveryListener=this.cameraRecovery.bind(this),a.getInstance().updateIfMissing(a$1);}get videoElement(){return d$1.instance().getVideoElement()}get scanAreaMargins(){return this._scanAreaMargins}set scanAreaMargins(e){var t;this._scanAreaMargins=e,(t=this.privateContext)==null||t.update();}get pointOfInterest(){return this._pointOfInterest}set pointOfInterest(e){var t;this._pointOfInterest=e,(t=this.privateContext)==null||t.update();}get logoStyle(){return this._logoStyle}set logoStyle(e){var t;this._logoStyle=e,(t=this.privateContext)==null||t.update();}get logoAnchor(){return this._logoAnchor}set logoAnchor(e){var t;this._logoAnchor=e,(t=this.privateContext)==null||t.update();}get logoOffset(){return this._logoOffset}set logoOffset(e){var t;this._logoOffset=e,(t=this.privateContext)==null||t.update();}get cameraRecoveryText(){return a.getInstance().get(b)}get width(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.width)!=null?t:0)}get height(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.height)!=null?t:0)}get canvasDrawer(){return !this._canvasDrawer&&this.canvasElement!=null&&(this._canvasDrawer=new b$2(this.canvasElement),this._canvasDrawer.startObservingCanvasResize()),this._canvasDrawer}get privateContext(){return this._context}static async forContext(e){let t=new q;return await t.setContext(e),t}showProgressBar(){var e;(e=this.loadingOverlay)==null||e.show();}hideProgressBar(){var e;(e=this.loadingOverlay)==null||e.hide();}setProgressBarPercentage(e){this.loadingOverlay&&(this.loadingOverlay.progress=e);}setProgressBarMessage(e){this.loadingOverlay&&(this.loadingOverlay.message=e);}getContext(){return this._context}async setContext(e){var t,i,r;if(this._context=e,e){if(this.overlays.size>0&&!((t=this.privateContext)!=null&&t.hasModes()))throw new Error(["Cannot assign this view to this context. This view has overlays but the context does not have any mode attached matching these overlays.","Remove the overlays first before attaching the view to the context, or add the corresponding mode to the context before attaching this view."].join(" "));await e.setView(this),(i=this.privateContext)==null||i.subscribeToWorkerMessages(this.onWorkerMessageHandler),(r=this._context)!=null&&r.frameSource&&await this.onFrameSourceChange(this._context.frameSource);}}connectToElement(e,t){var i,r,a$1,n;this.orientationObserver.register(),this.setupHtmlElement(e),(i=this.canvasDrawer)==null||i.startObservingCanvasResize(),this.htmlElementDidChange(),a$2.add(this),this.orientation=this.orientationObserver.orientation.value,this.orientationObserver.addEventListener(a$3,this.onOrientationChangeListener),(r=this.hintPresenter)==null||r.addEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(a$1=this.hintPresenter)==null||a$1.addEventListener("willshow",this.onBeforeShowToastsHandler),this.localizationSubscription=a.getInstance().subscribe(s=>{s[b]!=null&&(this.cameraRecoveryElement.textContent=s[b]);}),this._previewCamera=(n=t==null?void 0:t.camera)!=null?n:null,this._previewCamera&&(this._previewCamera.addListener(this.frameSourceListener),this.onFrameSourceChange(this._previewCamera));}detachFromElement(){var e,t,i,r,a,n,s,h;(e=this.htmlElementState)==null||e.removeListeners(),this.removeStyles(),(t=this.canvasDrawer)==null||t.endObservingCanvasResize(),document.removeEventListener("visibilitychange",this.visibilityListener);for(let m of ["touchend","mousedown"])this.cameraRecoveryElement.removeEventListener(m,this.cameraRecoveryListener);(i=this.loadingOverlay)==null||i.remove(),(r=this.customLocationsView)==null||r.unmount(),this.notificationPresenter=null,this.htmlElementDidChange(),(a=this.gestureRecognizer)==null||a.removeAllListeners(),this.clearHtmlElementContent(),a$2.delete(this),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(a$3,this.onOrientationChangeListener),(n=this.hintPresenter)==null||n.removeEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(s=this.hintPresenter)==null||s.removeEventListener("willshow",this.onBeforeShowToastsHandler),(h=this.localizationSubscription)==null||h.cancel(),d$1.instance().disconnectedCallback(),this._previewCamera&&(this._previewCamera.removeListener(this.frameSourceListener),this._previewCamera=null);}async addOverlay(e){var t;this.overlays.has(e)||(this.overlays.add(e),await((t=this.privateContext)==null?void 0:t.update([{type:"addOverlay",newValue:e}])));}async removeOverlay(e){var t;this.overlays.has(e)&&(await((t=this.privateContext)==null?void 0:t.update([{type:"removeOverlay",newValue:e}])),this.overlays.delete(e));}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}viewPointForFramePoint(e){var p,O,P,L,V,D,F,R;let t={width:(O=(p=this.htmlElementState)==null?void 0:p.width)!=null?O:0,height:(L=(P=this.htmlElementState)==null?void 0:P.height)!=null?L:0},i={width:(D=(V=this.videoElement)==null?void 0:V.videoWidth)!=null?D:0,height:(R=(F=this.videoElement)==null?void 0:F.videoHeight)!=null?R:0},r=t.width/t.height,a=i.width/i.height,n=r>a?t.width/i.width:t.height/i.height,s={x:e.x*n,y:e.y*n},h=(i.width*n-t.width)/2,m=(i.height*n-t.height)/2;return new a$4(s.x-h,s.y-m)}viewQuadrilateralForFrameQuadrilateral(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),r=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight);return new b$3(t,i,a,r)}addControl(e){var t;this.controls.includes(e)||(e.view=this,this.controls.push(e),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:"addControl",newValue:e}]));}removeControl(e){var t;if(this.controls.includes(e)){e.view=null;let i=this.controls.splice(this.controls.indexOf(e),1);this.getControlWidget(i[0]).remove(true),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:"removeControl",newValue:e}]);}}toJSONObject(){var e;return {scanAreaMargins:this.scanAreaMargins.toJSONObject(),pointOfInterest:this.pointOfInterest.toJSONObject(),logoAnchor:this.logoAnchor,logoOffset:this.logoOffset.toJSONObject(),logoHidden:(e=this.logoHidden)!=null?e:false,logoStyle:this.logoStyle,overlays:[...this.overlays].map(t=>t.toJSONObject()),controls:this.controls.map(t=>t.toJSONObject()),focusGesture:this.focusGesture?this.focusGesture.toJSONObject():null,zoomGesture:this.zoomGesture?this.zoomGesture.toJSONObject():null}}isCameraRecoveryVisible(){return !this.cameraRecoveryElement.hidden}setCameraRecoveryVisible(e){this.cameraRecoveryElement.hidden=!e;}async allowPictureInPicture(e){await d$1.instance().allowPictureInPicture(e);}viewAnchorPositionsForFrameAnchorPositions(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),r=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight),n=this.viewPointForFramePoint(e.centerLeft),s=this.viewPointForFramePoint(e.centerRight),h=this.viewPointForFramePoint(e.topCenter),m=this.viewPointForFramePoint(e.bottomCenter),p=this.viewPointForFramePoint(e.center);return new a$5(t,i,a,r,n,h,s,m,p)}setDidTapCustomLocationsViewListener(e){this.customLocationsView&&this.customLocationsView.listener===null&&(this.customLocationsView.listener=e);}renderCustomLocationsView(e){this.customLocationsView!=null&&(this.customLocationsView.setMirrored(d$1.instance().isMirrorImageEnabled()),Object.keys(e).includes("removedIds")?this.customLocationsView.render(e):this.customLocationsView.renderDomView(e));}getNotificationPresenter(){var e;if(!this.notificationPresenter){let t=(e=this.htmlElement)==null?void 0:e.querySelector(b$4.tag);if(!t)throw new Error("Notification presenter cannot be found. Please ensure the DataCaptureView is connected.");this.notificationPresenter=new a$6(t);}return this.notificationPresenter}removeStyles(){for(let e of document.querySelectorAll("style[scandit]"))e.remove();}onHintPresenterUpdate(e){var t;(t=this.privateContext)==null||t.workerCommand("hintPresenterV2update",{});}clearHtmlElementContent(){var e;this.htmlElement&&((e=this.canvasDrawer)==null||e.endObservingCanvasResize(),this.htmlElement.innerHTML="",this.cameraPaintboardElement=void 0,this.singleImageUploaderPaintboardElement=void 0,this.htmlElement=void 0);}setupHtmlElement(e){var a,n,s;this.createStyles(),this.htmlElement=e,b$4.register();let t=`
|
|
1
|
+
import {b as b$4}from'./chunk-DUFF6WVD.js';import {a as a$9}from'./chunk-R3XUWVHG.js';import {a as a$d}from'./chunk-MCAVCIZT.js';import {d as d$2,c,b as b$5}from'./chunk-CNQAVSV7.js';import {a as a$f}from'./chunk-MQ6H2ORR.js';import {a as a$2}from'./chunk-N5YZEC56.js';import {a as a$b}from'./chunk-K7MUTJWB.js';import {b as b$1,a as a$3}from'./chunk-5S537AFM.js';import {a as a$g}from'./chunk-DMOXDUF6.js';import {b as b$2}from'./chunk-457L5N2F.js';import {a as a$a}from'./chunk-7TQID6JJ.js';import {a as a$c}from'./chunk-2HL2IEE2.js';import {a as a$8}from'./chunk-KYNYQBNF.js';import {a as a$6}from'./chunk-3MEGNPVU.js';import {a as a$5}from'./chunk-EKOWJS3E.js';import {a as a$1}from'./chunk-VJB527QZ.js';import {a as a$7}from'./chunk-UUD3OXOZ.js';import {a}from'./chunk-GHTCNOQN.js';import {d as d$1}from'./chunk-LBTRRUW4.js';import {a as a$e}from'./chunk-XR65N6EG.js';import {d}from'./chunk-VW3DMTE7.js';import {a as a$4,b as b$3,i,f}from'./chunk-TPQTY3KB.js';import {a as a$h}from'./chunk-WUHKODFA.js';var b="core.camera.recovery",B=class q{constructor(){this.focusGesture=d.DataCaptureView.focusGesture;this.zoomGesture=d.DataCaptureView.zoomGesture;this._scanAreaMargins=d.DataCaptureView.scanAreaMargins;this._pointOfInterest=d.DataCaptureView.pointOfInterest;this._logoStyle=d.DataCaptureView.logoStyle;this._logoAnchor=d.DataCaptureView.logoAnchor;this._logoOffset=d.DataCaptureView.logoOffset;this._context=null;this.overlays=new Set;this.controls=[];this.controlWidgets=new WeakMap;this.frameSourceListener={didChangeState:this.onFrameSourceChange.bind(this)};this._previewCamera=null;this.frozenFrameCanvas=document.createElement("canvas");this.listeners=[];this.isVideoElementDetached=false;this.orientation="portrait";this.hiddenProperties={stopVideoTracksOnVisibilityChange:true,freezeFrameWhenStoppingFrameSource:true};this.orientationObserver=new b$1;this.onOrientationChangeListener=this.onOrientationChange.bind(this);this.onHintPresenterUpdateHandler=this.onHintPresenterUpdate.bind(this);this.onBeforeShowToastsHandler=this.onBeforeShowToasts.bind(this);this.onWorkerMessageHandler=this.onWorkerMessage.bind(this);this.htmlElementDidChangeHandler=this.htmlElementDidChange.bind(this);this.htmlElementDisconnectedHandler=this.htmlElementDisconnected.bind(this);this.notificationPresenter=null;this.visibilityListener=this.onVisibilityChange.bind(this),this.cameraRecoveryListener=this.cameraRecovery.bind(this),a.getInstance().updateIfMissing(a$1);}get videoElement(){return d$1.instance().getVideoElement()}get scanAreaMargins(){return this._scanAreaMargins}set scanAreaMargins(e){var t;this._scanAreaMargins=e,(t=this.privateContext)==null||t.update();}get pointOfInterest(){return this._pointOfInterest}set pointOfInterest(e){var t;this._pointOfInterest=e,(t=this.privateContext)==null||t.update();}get logoStyle(){return this._logoStyle}set logoStyle(e){var t;this._logoStyle=e,(t=this.privateContext)==null||t.update();}get logoAnchor(){return this._logoAnchor}set logoAnchor(e){var t;this._logoAnchor=e,(t=this.privateContext)==null||t.update();}get logoOffset(){return this._logoOffset}set logoOffset(e){var t;this._logoOffset=e,(t=this.privateContext)==null||t.update();}get cameraRecoveryText(){return a.getInstance().get(b)}get width(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.width)!=null?t:0)}get height(){var e,t;return Math.round((t=(e=this.htmlElementState)==null?void 0:e.height)!=null?t:0)}get canvasDrawer(){return !this._canvasDrawer&&this.canvasElement!=null&&(this._canvasDrawer=new b$2(this.canvasElement),this._canvasDrawer.startObservingCanvasResize()),this._canvasDrawer}get privateContext(){return this._context}static async forContext(e){let t=new q;return await t.setContext(e),t}showProgressBar(){var e;(e=this.loadingOverlay)==null||e.show();}hideProgressBar(){var e;(e=this.loadingOverlay)==null||e.hide();}setProgressBarPercentage(e){this.loadingOverlay&&(this.loadingOverlay.progress=e);}setProgressBarMessage(e){this.loadingOverlay&&(this.loadingOverlay.message=e);}getContext(){return this._context}async setContext(e){var t,i,r;if(this._context=e,e){if(this.overlays.size>0&&!((t=this.privateContext)!=null&&t.hasModes()))throw new Error(["Cannot assign this view to this context. This view has overlays but the context does not have any mode attached matching these overlays.","Remove the overlays first before attaching the view to the context, or add the corresponding mode to the context before attaching this view."].join(" "));await e.setView(this),(i=this.privateContext)==null||i.subscribeToWorkerMessages(this.onWorkerMessageHandler),(r=this._context)!=null&&r.frameSource&&await this.onFrameSourceChange(this._context.frameSource);}}connectToElement(e,t){var i,r,a$1,n;this.orientationObserver.register(),this.setupHtmlElement(e),(i=this.canvasDrawer)==null||i.startObservingCanvasResize(),this.htmlElementDidChange(),a$2.add(this),this.orientation=this.orientationObserver.orientation.value,this.orientationObserver.addEventListener(a$3,this.onOrientationChangeListener),(r=this.hintPresenter)==null||r.addEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(a$1=this.hintPresenter)==null||a$1.addEventListener("willshow",this.onBeforeShowToastsHandler),this.localizationSubscription=a.getInstance().subscribe(s=>{s[b]!=null&&(this.cameraRecoveryElement.textContent=s[b]);}),this._previewCamera=(n=t==null?void 0:t.camera)!=null?n:null,this._previewCamera&&(this._previewCamera.addListener(this.frameSourceListener),this.onFrameSourceChange(this._previewCamera));}detachFromElement(){var e,t,i,r,a,n,s,h;(e=this.htmlElementState)==null||e.removeListeners(),this.removeStyles(),(t=this.canvasDrawer)==null||t.endObservingCanvasResize(),document.removeEventListener("visibilitychange",this.visibilityListener);for(let m of ["touchend","mousedown"])this.cameraRecoveryElement.removeEventListener(m,this.cameraRecoveryListener);(i=this.loadingOverlay)==null||i.remove(),(r=this.customLocationsView)==null||r.unmount(),this.notificationPresenter=null,this.htmlElementDidChange(),(a=this.gestureRecognizer)==null||a.removeAllListeners(),this.clearHtmlElementContent(),a$2.delete(this),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(a$3,this.onOrientationChangeListener),(n=this.hintPresenter)==null||n.removeEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(s=this.hintPresenter)==null||s.removeEventListener("willshow",this.onBeforeShowToastsHandler),(h=this.localizationSubscription)==null||h.cancel(),d$1.instance().disconnectedCallback(),this._previewCamera&&(this._previewCamera.removeListener(this.frameSourceListener),this._previewCamera=null);}async addOverlay(e){var t;this.overlays.has(e)||(this.overlays.add(e),await((t=this.privateContext)==null?void 0:t.update([{type:"addOverlay",newValue:e}])));}async removeOverlay(e){var t;this.overlays.has(e)&&(await((t=this.privateContext)==null?void 0:t.update([{type:"removeOverlay",newValue:e}])),this.overlays.delete(e));}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}viewPointForFramePoint(e){var p,O,P,L,V,D,F,R;let t={width:(O=(p=this.htmlElementState)==null?void 0:p.width)!=null?O:0,height:(L=(P=this.htmlElementState)==null?void 0:P.height)!=null?L:0},i={width:(D=(V=this.videoElement)==null?void 0:V.videoWidth)!=null?D:0,height:(R=(F=this.videoElement)==null?void 0:F.videoHeight)!=null?R:0},r=t.width/t.height,a=i.width/i.height,n=r>a?t.width/i.width:t.height/i.height,s={x:e.x*n,y:e.y*n},h=(i.width*n-t.width)/2,m=(i.height*n-t.height)/2;return new a$4(s.x-h,s.y-m)}viewQuadrilateralForFrameQuadrilateral(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),r=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight);return new b$3(t,i,a,r)}addControl(e){var t;this.controls.includes(e)||(e.view=this,this.controls.push(e),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:"addControl",newValue:e}]));}removeControl(e){var t;if(this.controls.includes(e)){e.view=null;let i=this.controls.splice(this.controls.indexOf(e),1);this.getControlWidget(i[0]).remove(true),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:"removeControl",newValue:e}]);}}toJSONObject(){var e;return {scanAreaMargins:this.scanAreaMargins.toJSONObject(),pointOfInterest:this.pointOfInterest.toJSONObject(),logoAnchor:this.logoAnchor,logoOffset:this.logoOffset.toJSONObject(),logoHidden:(e=this.logoHidden)!=null?e:false,logoStyle:this.logoStyle,overlays:[...this.overlays].map(t=>t.toJSONObject()),controls:this.controls.map(t=>t.toJSONObject()),focusGesture:this.focusGesture?this.focusGesture.toJSONObject():null,zoomGesture:this.zoomGesture?this.zoomGesture.toJSONObject():null}}isCameraRecoveryVisible(){return !this.cameraRecoveryElement.hidden}setCameraRecoveryVisible(e){this.cameraRecoveryElement.hidden=!e;}async allowPictureInPicture(e){await d$1.instance().allowPictureInPicture(e);}viewAnchorPositionsForFrameAnchorPositions(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),r=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight),n=this.viewPointForFramePoint(e.centerLeft),s=this.viewPointForFramePoint(e.centerRight),h=this.viewPointForFramePoint(e.topCenter),m=this.viewPointForFramePoint(e.bottomCenter),p=this.viewPointForFramePoint(e.center);return new a$5(t,i,a,r,n,h,s,m,p)}setDidTapCustomLocationsViewListener(e){this.customLocationsView&&this.customLocationsView.listener===null&&(this.customLocationsView.listener=e);}renderCustomLocationsView(e){this.customLocationsView!=null&&(this.customLocationsView.setMirrored(d$1.instance().isMirrorImageEnabled()),Object.keys(e).includes("removedIds")?this.customLocationsView.render(e):this.customLocationsView.renderDomView(e));}getNotificationPresenter(){var e;if(!this.notificationPresenter){let t=(e=this.htmlElement)==null?void 0:e.querySelector(b$4.tag);if(!t)throw new Error("Notification presenter cannot be found. Please ensure the DataCaptureView is connected.");this.notificationPresenter=new a$6(t);}return this.notificationPresenter}removeStyles(){for(let e of document.querySelectorAll("style[scandit]"))e.remove();}onHintPresenterUpdate(e){var t;(t=this.privateContext)==null||t.workerCommand("hintPresenterV2update",{});}clearHtmlElementContent(){var e;this.htmlElement&&((e=this.canvasDrawer)==null||e.endObservingCanvasResize(),this.htmlElement.innerHTML="",this.cameraPaintboardElement=void 0,this.singleImageUploaderPaintboardElement=void 0,this.htmlElement=void 0);}setupHtmlElement(e){var a,n,s;this.createStyles(),this.htmlElement=e,b$4.register();let t=`
|
|
2
2
|
<div class="${a$7.CONTAINER_CLASS_NAME}">
|
|
3
3
|
<div class="${a$7.PAINTBOARDS_CONTAINER_CLASS_NAME}">
|
|
4
4
|
<div data-js-id="loading-overlay"></div>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$
|
|
1
|
+
import {a as a$a}from'./chunk-BA3RP6L2.js';import {a as a$6,b}from'./chunk-LISC6VSM.js';import {a as a$2}from'./chunk-N6BLNZCH.js';import {a as a$5}from'./chunk-JS3T7K2Z.js';import {a as a$3}from'./chunk-GNA6ZKV3.js';import {a as a$4}from'./chunk-7SW2PEHB.js';import {a as a$7}from'./chunk-FGO2SSRS.js';import {d}from'./chunk-LBTRRUW4.js';import {a as a$1}from'./chunk-UCD6YLP3.js';import {a as a$8}from'./chunk-XR65N6EG.js';import {f}from'./chunk-7ELPJFJV.js';import {a as a$9}from'./chunk-WUHKODFA.js';import {c}from'./chunk-TR3NGINC.js';function s(l,e,t){let r=t.value;return t.value=function(...o){let i=a$3.getInstance();return i.configurePhase==="done"&&i.mainDataCaptureLoader!=null?r.apply(this,o):Promise.reject(new Error(`Please await the call to configure() before calling ${String(e)}`))},t}function F(l){return l[a$a]!=null}function g(l){return "skipSerialization"in l||l[a$a]!=null}var N,E,I,a=class a{constructor(){this.framework="web";this.runtimeEnvironment={deviceOS:(N=a$1.getUserAgentInfo().getOS().name)!=null?N:"",browser:(E=a$1.getUserAgentInfo().getBrowser().name)!=null?E:"",browserVersion:(I=a$1.getUserAgentInfo().getBrowser().version)!=null?I:"",get deviceModelName(){let{model:e,vendor:t}=a$1.getUserAgentInfo().getDevice();return (t==null||t==="")&&(t="Unknown"),(e==null||e==="")&&(e="Unknown"),[t,e].join(" ")}};this.settings=new a$4;this._frameSource=null;this._view=null;this.modes=new Set;this.components=[];this.listeners=[];this.updateListeners=new Set;this.cameraPropertiesReportListener=this.reportCameraProperties.bind(this);this.cameraAccessErrorListener=this.onCameraAccessError.bind(this);this.onWorkerMessageListener=this.onWorkerMessage.bind(this);this.onVisibilityChangeListener=this.onVisibilityChange.bind(this);this.pendingWorkerMessageListeners=new Set;this.delayedRegistration=false;this.highEndBlurryRecognition=false;this._frameHandlers=[];this._useSynchronousFrameFlow=false;}static get sharedInstance(){return a._sharedInstance==null&&(a._sharedInstance=new a),a._sharedInstance}async initializeWithOptions(e,t=a$3.getInstance()){var r,o,i,m,f,y,w,S,b;this.licenseKey=(o=(r=e.licenseKey)!=null?r:t.userLicenseKey)!=null?o:"",this.deviceName=(i=e.deviceName)!=null?i:"",this.dataCaptureInstance=(m=e.dataCaptureInstance)!=null?m:t.mainDataCaptureLoader,this.delayedRegistration=(f=e.delayedRegistration)!=null?f:false,e.settings!=null&&(this.settings=e.settings),this.highEndBlurryRecognition=(b=(S=(y=e.dataCaptureInstance)==null?void 0:y.highEndBlurryRecognition)!=null?S:(w=t.mainDataCaptureLoader)==null?void 0:w.highEndBlurryRecognition)!=null?b:false;for(let R of this.pendingWorkerMessageListeners)this.dataCaptureInstance.addWorkerListener(R);this.pendingWorkerMessageListeners.clear(),this.settings!=null&&await this.applySettings(this.settings),await this.createContext();}get frameSource(){return this._frameSource}get workerCommand(){if(this.dataCaptureInstance==null)throw new Error("Cannot call workerCommand before dataCaptureInstance is set");return this.dataCaptureInstance.workerCommand.bind(this.dataCaptureInstance)}static async create(){return a.createWithOptions({})}static async createWithOptions(e){return a._sharedInstance&&await a._sharedInstance.dispose(),await a.sharedInstance.initializeWithOptions(e),a.sharedInstance}static async getOpenSourceSoftwareLicenseInfo(){let e=[];for(let r of a.moduleLicenseTextProviders){let o=await r.getLicenseText();e.push(o);}let t=e.join(`
|
|
2
2
|
|
|
3
|
-
`);return new a$5(t)}async setFrameSource(e){let t=e!==this._frameSource;if(this._frameSource!==null&&(this._frameSource.context=null),this._frameSource=e!=null?e:null,e&&(e.context=this,await this.workerCommand("setFrameSource",{mirrorAxis:this.getMirrorAxisForFrameSource(e),isCameraFrameSource:f(e)})),await this.update([{type:"frameSourceState",newValue:this.frameSource}]),t)for(let r of this.listeners)r.didChangeFrameSource&&r.didChangeFrameSource(this,this._frameSource);}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}async flushAnalytics(){await this.workerCommand("flushAnalytics",{});}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async addMode(e){this.modes.add(e),await e.attachedToContext(this),this.updateCameraFrameFlow(),await this.update([],{updateContext:!g(e)});}async removeMode(e){this.modes.delete(e),await e.detachedFromContext(),this.updateCameraFrameFlow(),await this.update([],{updateContext:!g(e)});}async setMode(e){this.modes.has(e)||(this.modes.clear(),this.modes.add(e),await e.attachedToContext(this),this.updateCameraFrameFlow(),await this.update());}async removeCurrentMode(){for(let e of this.modes)await e.detachedFromContext();this.modes.clear(),await this.update();}async removeAllModes(){for(let e of this.modes)await this.removeMode(e);}async dispose(){d.instance().removeListener("cameraProperties",this.cameraPropertiesReportListener),d.instance().removeListener("cameraAccessError",this.cameraAccessErrorListener),this.unsubscribeToVisibilityChange(this.onVisibilityChangeListener),await this.removeAllModes(),this.dataCaptureInstance&&await this.workerCommand("dispose",{}),this.listeners=[],this.modes.clear(),this.components.length=0,this.updateListeners.clear(),this.pendingWorkerMessageListeners.clear(),this.dataCaptureInstance=void 0,this.delayedRegistration=false,this.highEndBlurryRecognition=false,this._frameHandlers.length=0,this.frameSource&&(this.frameSource.context=null,this._frameSource=null),this._view&&(this._view.setContext(null),this._view=null),this.licenseKey="",this.deviceName="";}async applySettings(e){this.settings=e,await this.update();}toJSONObject(){var e,t;return {licenseKey:this.licenseKey,framework:this.framework,deviceName:this.deviceName,...this.runtimeEnvironment,modes:[...this.modes].filter(r=>!g(r)).map(r=>r.toJSONObject()),components:this.components.map(r=>r.toJSONObject()),frameSource:this.frameSource?this.frameSource.toJSONObject():null,settings:this.settings.toJSONObject(),view:(t=(e=this._view)==null?void 0:e.toJSONObject())!=null?t:null}}getView(){return this._view}async setView(e){return this._view=e,this.update([{type:"viewSet",newValue:e}])}async getAppName(){let e=null;if(a$6()){let t=await b();if((t==null?void 0:t.appName)==null||t.appName==="")throw new Error("Cannot retrieve electron appName. Did you set it up in package.json? https://www.electronjs.org/docs/latest/api/app#appgetname");e=t.appName;}return e}urlToHostname(e){try{return new URL(e!=null?e:"").hostname}catch(t){return ""}}getParentDomain(){var t;let e="";return parent!==window&&(e||(e=this.urlToHostname((t=location.ancestorOrigins)==null?void 0:t[0])),e||(e=this.urlToHostname(document.referrer)),e||(e="")),e.startsWith("[")&&e.endsWith("]")&&(e=e.slice(1,-1)),e}async createContext(e=true){await this.workerCommand("createContext",{context:this.toJSONObject(),deviceId:a.deviceID,delayedRegistration:this.delayedRegistration,highEndBlurryRecognition:this.highEndBlurryRecognition,appName:await this.getAppName(),parentDomain:this.getParentDomain()}),this.subscribeToWorkerMessages(this.onWorkerMessageListener),e&&(this.subscribeToCameraManagerEvents(),this.subscribeToVisibilityChange(this.onVisibilityChangeListener)),this._view!=null&&await this.setView(this._view),this.frameSource!=null&&await this.setFrameSource(this.frameSource);}subscribeToVisibilityChange(e){document.addEventListener("visibilitychange",e);}unsubscribeToVisibilityChange(e){document.removeEventListener("visibilitychange",e);}async requestFrameData(e){return this.workerCommand("requestFrameData",{frameId:e})}performanceMark(e){a$7(globalThis.performance)&&typeof globalThis.performance.mark=="function"&&performance.mark(e);}async sendFrameToProcessor(e){let t=e instanceof ImageData?{data:e.data,width:e.width,height:e.height}:e,r=await this.sendFrameToHandlers(t);return t.data=r.capture.data,r.skip?r.capture:(this.performanceMark("processFrameBeforeSDC"),this.sendFrameToSDC(t))}async sendFrameToHandlers(e){for(let t of this._frameHandlers)if((await t(e)).action==="skip")return {skip:true,capture:e};return {skip:false,capture:e}}async sendFrameToSDC(e){return this.workerCommand("processFrame",e,[e.data.buffer])}registerFrameHandler(e){this._frameHandlers.includes(e)||this._frameHandlers.push(e);}unregisterFrameHandler(e){this._frameHandlers.includes(e)&&this._frameHandlers.splice(this._frameHandlers.indexOf(e),1);}onVisibilityChange(){this.workerCommand("documentVisibility",{state:document.visibilityState});}onWorkerMessage(e){if(e.type==="contextDidChangeStatus"){e.payload.isValid||a$8.error(e.payload);for(let t of this.listeners)t.didChangeStatus&&t.didChangeStatus(this,a$9.fromJSON(e.payload));}if(e.type==="didStartObservingContext")for(let t of this.listeners)t.didStartObservingContext&&t.didStartObservingContext(this);e.type==="onFrameProcessingFinished"&&this.performanceMark("processFrameAfterSDC");}subscribeToCameraManagerEvents(){d.instance().addListener("cameraProperties",this.cameraPropertiesReportListener),d.instance().addListener("cameraAccessError",this.cameraAccessErrorListener);}async reportCameraProperties(e){return this.workerCommand("reportCameraProperties",e)}onCameraAccessError(e){for(let t of this.listeners)t.didChangeStatus&&t.didChangeStatus(this,a$9.fromJSON({code:33794,isValid:true,message:typeof(e==null?void 0:e.toString)=="function"?e.toString():"Unknown error"}));}async update(e=[],{updateContext:t=true}={}){var r,
|
|
3
|
+
`);return new a$5(t)}async setFrameSource(e){let t=e!==this._frameSource;if(this._frameSource!==null&&(this._frameSource.context=null),this._frameSource=e!=null?e:null,e&&(e.context=this,await this.workerCommand("setFrameSource",{mirrorAxis:this.getMirrorAxisForFrameSource(e),isCameraFrameSource:f(e)})),await this.update([{type:"frameSourceState",newValue:this.frameSource}]),t)for(let r of this.listeners)r.didChangeFrameSource&&r.didChangeFrameSource(this,this._frameSource);}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}async flushAnalytics(){await this.workerCommand("flushAnalytics",{});}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async addMode(e){this.modes.add(e),await e.attachedToContext(this),this.updateCameraFrameFlow(),await this.update([],{updateContext:!g(e)});}async removeMode(e){this.modes.delete(e),await e.detachedFromContext(),this.updateCameraFrameFlow(),await this.update([],{updateContext:!g(e)});}async setMode(e){this.modes.has(e)||(this.modes.clear(),this.modes.add(e),await e.attachedToContext(this),this.updateCameraFrameFlow(),await this.update());}async removeCurrentMode(){for(let e of this.modes)await e.detachedFromContext();this.modes.clear(),await this.update();}async removeAllModes(){for(let e of this.modes)await this.removeMode(e);}async dispose(){d.instance().removeListener("cameraProperties",this.cameraPropertiesReportListener),d.instance().removeListener("cameraAccessError",this.cameraAccessErrorListener),this.unsubscribeToVisibilityChange(this.onVisibilityChangeListener),await this.removeAllModes(),this.dataCaptureInstance&&await this.workerCommand("dispose",{}),this.listeners=[],this.modes.clear(),this.components.length=0,this.updateListeners.clear(),this.pendingWorkerMessageListeners.clear(),this.dataCaptureInstance=void 0,this.delayedRegistration=false,this.highEndBlurryRecognition=false,this._frameHandlers.length=0,this.frameSource&&(this.frameSource.context=null,this._frameSource=null),this._view&&(this._view.setContext(null),this._view=null),this.licenseKey="",this.deviceName="";}async applySettings(e){this.settings=e,await this.update();}toJSONObject(){var e,t;return {licenseKey:this.licenseKey,framework:this.framework,deviceName:this.deviceName,...this.runtimeEnvironment,modes:[...this.modes].filter(r=>!g(r)).map(r=>r.toJSONObject()),components:this.components.map(r=>r.toJSONObject()),frameSource:this.frameSource?this.frameSource.toJSONObject():null,settings:this.settings.toJSONObject(),view:(t=(e=this._view)==null?void 0:e.toJSONObject())!=null?t:null}}getView(){return this._view}async setView(e){return this._view=e,this.update([{type:"viewSet",newValue:e}])}async getAppName(){let e=null;if(a$6()){let t=await b();if((t==null?void 0:t.appName)==null||t.appName==="")throw new Error("Cannot retrieve electron appName. Did you set it up in package.json? https://www.electronjs.org/docs/latest/api/app#appgetname");e=t.appName;}return e}urlToHostname(e){try{return new URL(e!=null?e:"").hostname}catch(t){return ""}}getParentDomain(){var t;let e="";return parent!==window&&(e||(e=this.urlToHostname((t=location.ancestorOrigins)==null?void 0:t[0])),e||(e=this.urlToHostname(document.referrer)),e||(e="")),e.startsWith("[")&&e.endsWith("]")&&(e=e.slice(1,-1)),e}async createContext(e=true){await this.workerCommand("createContext",{context:this.toJSONObject(),deviceId:a.deviceID,delayedRegistration:this.delayedRegistration,highEndBlurryRecognition:this.highEndBlurryRecognition,appName:await this.getAppName(),parentDomain:this.getParentDomain()}),this.subscribeToWorkerMessages(this.onWorkerMessageListener),e&&(this.subscribeToCameraManagerEvents(),this.subscribeToVisibilityChange(this.onVisibilityChangeListener)),this._view!=null&&await this.setView(this._view),this.frameSource!=null&&await this.setFrameSource(this.frameSource);}subscribeToVisibilityChange(e){document.addEventListener("visibilitychange",e);}unsubscribeToVisibilityChange(e){document.removeEventListener("visibilitychange",e);}async requestFrameData(e){return this.workerCommand("requestFrameData",{frameId:e})}performanceMark(e){a$7(globalThis.performance)&&typeof globalThis.performance.mark=="function"&&performance.mark(e);}async sendFrameToProcessor(e){let t=e instanceof ImageData?{data:e.data,width:e.width,height:e.height}:e,r=await this.sendFrameToHandlers(t);return t.data=r.capture.data,r.skip?r.capture:(this.performanceMark("processFrameBeforeSDC"),this.sendFrameToSDC(t))}async sendFrameToHandlers(e){for(let t of this._frameHandlers)if((await t(e)).action==="skip")return {skip:true,capture:e};return {skip:false,capture:e}}async sendFrameToSDC(e){return this.workerCommand("processFrame",e,[e.data.buffer])}registerFrameHandler(e){this._frameHandlers.includes(e)||this._frameHandlers.push(e);}unregisterFrameHandler(e){this._frameHandlers.includes(e)&&this._frameHandlers.splice(this._frameHandlers.indexOf(e),1);}onVisibilityChange(){this.workerCommand("documentVisibility",{state:document.visibilityState});}onWorkerMessage(e){if(e.type==="contextDidChangeStatus"){e.payload.isValid||a$8.error(e.payload);for(let t of this.listeners)t.didChangeStatus&&t.didChangeStatus(this,a$9.fromJSON(e.payload));}if(e.type==="didStartObservingContext")for(let t of this.listeners)t.didStartObservingContext&&t.didStartObservingContext(this);e.type==="onFrameProcessingFinished"&&this.performanceMark("processFrameAfterSDC");}subscribeToCameraManagerEvents(){d.instance().addListener("cameraProperties",this.cameraPropertiesReportListener),d.instance().addListener("cameraAccessError",this.cameraAccessErrorListener);}async reportCameraProperties(e){return this.workerCommand("reportCameraProperties",e)}onCameraAccessError(e){for(let t of this.listeners)t.didChangeStatus&&t.didChangeStatus(this,a$9.fromJSON({code:33794,isValid:true,message:typeof(e==null?void 0:e.toString)=="function"?e.toString():"Unknown error"}));}async update(e=[],{updateContext:t=true}={}){var r,o;t&&await this.updateContext();for(let i of e){switch(i.type){case "frameSourceState":{await((r=this._view)==null?void 0:r.onFrameSourceChange(this.frameSource));break}case "singleImageModeUploaderSettings":{(o=this._view)==null||o.onSingleImageUploaderSettingsChange(i.newValue);break}case "addOverlay":{await this.addNativeOverlay(i.newValue);break}case "removeOverlay":{await this.removeNativeOverlay(i.newValue);break}}for(let m of this.updateListeners)m(i);}}async updateContext(){await this.workerCommand("updateContext",{context:this.toJSONObject(),...this.getViewInfo()}).catch(e=>a$8.warn("Error while updating context:",e));}getViewInfo(){return this._view!=null?{view:{width:this._view.width,height:this._view.height,visible:this._view.width>0&&this._view.height>0,orientation:this._view.orientation}}:{view:null}}getMirrorAxisForFrameSource(e){let t="None";return f(e)&&e.getMirrorImageEnabled()&&(t="Y"),t}async addComponent(e){if(!this.components.includes(e))return this.components.push(e),e._context=this,this.update()}async addNativeOverlay(e){if(F(e))return this.workerCommand("addNativeOverlay",{overlayHandle:e[a$a]})}async removeNativeOverlay(e){if(F(e))return this.workerCommand("removeNativeOverlay",{overlayHandle:e[a$a]})}subscribeToWorkerMessages(e){this.dataCaptureInstance?this.dataCaptureInstance.addWorkerListener(e):this.pendingWorkerMessageListeners.add(e);}unsubscribeToWorkerMessages(e){this.dataCaptureInstance&&this.dataCaptureInstance.removeWorkerListener(e),this.pendingWorkerMessageListeners.delete(e);}hasEnabledMode(){return [...this.modes].some(e=>e.isEnabled())}updateCameraFrameFlow(){let e=[...this.modes].some(t=>t._synchronousFrameFlow===true);d.instance().setFrameHandling(e);}async isFeatureSupported(e){return (await this.workerCommand("isFeatureSupported",{feature:e})).supported}};a.deviceID=a$1.getDeviceId(),a.moduleLicenseTextProviders=[new a$2],c([s],a.prototype,"initializeWithOptions",1),c([s],a.prototype,"addMode",1),c([s],a.prototype,"removeMode",1),c([s],a.prototype,"setMode",1),c([s],a.prototype,"removeCurrentMode",1),c([s],a.prototype,"createContext",1),c([s],a.prototype,"addComponent",1),c([s],a.prototype,"addNativeOverlay",1),c([s],a.prototype,"removeNativeOverlay",1),c([s],a.prototype,"isFeatureSupported",1);var L=a;
|
|
4
4
|
export{L as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-CYWUCE5E.js';import {d as d$1}from'./chunk-OQ4XCKFQ.js';import {a as a$2}from'./chunk-UCD6YLP3.js';import {a}from'./chunk-XR65N6EG.js';import {f as f$1,g as g$1}from'./chunk-7ELPJFJV.js';var S=(t=>(t.Idle="idle",t.Pressed="pressed",t))(S||{}),d=class{constructor(e,t){this.state="idle";this.isHover=false;this.controlTypeToAriaLabelMap={"camera-fov":"Switch camera field of view",camera:"Switch camera",torch:"Toggle torch"};this.control=e,this.domHost=t,this.onTouchStartListener=this.onTouchStart.bind(this),this.onMouseEnterListener=this.onMouseEnter.bind(this),this.onMouseLeaveListener=this.onMouseLeave.bind(this),this.onClickListener=this.onClick.bind(this),this.setup();}get frameSource(){var e,t;return (t=(e=this.control.view)==null?void 0:e.getContext())==null?void 0:t.frameSource}get context(){var e;return (e=this.control.view)==null?void 0:e.getContext()}async install(){this.button||this.setup();let e=await this.canShow();return e?(this.updateButtonBackground(this.button,this.getImageFromState()),this.show()):this.hide(),e}remove(e=false){e&&this.button?(this.button.removeEventListener("mouseenter",this.onMouseEnterListener),this.button.removeEventListener("mouseleave",this.onMouseLeaveListener),this.button.removeEventListener("touchstart",this.onTouchStartListener),this.button.removeEventListener("click",this.onClickListener),this.button.remove(),this.isHover=false,this.button=void 0):this.hide();}hide(){this.button&&(this.button.style.display="none");}show(){this.button&&(this.button.style.display="block");}setupButton(){let e=document.createElement("button");e.type="button",e.style.display="none",e.className=`scandit-control-widget scandit-control-widget-${this.control.type}`,this.updateButtonBackground(e,this.getImageFromState()),this.domHost.append(e),e.addEventListener("mouseenter",this.onMouseEnterListener),e.addEventListener("mouseleave",this.onMouseLeaveListener),a$2.isDesktopDevice()||e.addEventListener("touchstart",this.onTouchStartListener),e.addEventListener("click",this.onClickListener),e.setAttribute("aria-pressed",String(this.state==="pressed"));let t=this.control.type,a=this.controlTypeToAriaLabelMap[t];return e.setAttribute("aria-label",a),this.button=e,this.button}setup(){this.setupButton();}onTouchStart(){var e,t;(e=this.button)==null||e.removeEventListener("mouseenter",this.onMouseEnterListener),(t=this.button)==null||t.removeEventListener("mouseleave",this.onMouseLeaveListener);}onMouseEnter(){this.isHover=true,this.updateButtonBackground(this.button,this.getImageFromState());}onMouseLeave(){this.isHover=false,this.updateButtonBackground(this.button,this.getImageFromState());}onClick(){var e;this.state=this.state==="pressed"?"idle":"pressed",this.buttonClicked(),this.updateButtonBackground(this.button,this.getImageFromState()),(e=this.button)==null||e.setAttribute("aria-pressed",String(this.state==="pressed"));}updateButtonBackground(e,t){t!=null&&e!=null&&(e.style.backgroundImage=`url(${JSON.stringify(t)})`);}},C=class extends d{constructor(e,t){super(e,t);}async buttonClicked(){await this.frameSource.setDesiredTorchState(this.retrieveTorchState()==="on"?"off":"on");}async canShow(){return this.isTorchAvailable()}getImageFromState(){return this.retrieveTorchState()==="on"?this.isHover?this.control.torchOnPressedImage:this.control.torchOnImage:this.isHover?this.control.torchOffPressedImage:this.control.torchOffImage}setup(){if(this.control.torchOffImage==null||this.control.torchOnImage==null){a.log(a.Level.Warn,"TorchSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async isTorchAvailable(){return f$1(this.frameSource)?this.frameSource.isTorchAvailable():false}retrieveTorchState(){return f$1(this.frameSource)?this.frameSource.getDesiredTorchState():"off"}},f=class s extends d{constructor(e,t){super(e,t);}static get CameraAccess(){return d$1}static get Camera(){return a$1}async canShow(){return (await s.CameraAccess.getCameras()).length>1}getImageFromState(){return this.isHover?this.control.pressedImage:this.control.idleImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getNextDeviceCamera();e&&await this.switchCameras(e);}setup(){if(this.control.idleImage==null){a.log(a.Level.Warn,"CameraSwitchControl idle icon is not set or is empty, the control will not be rendered.");return}super.setup();}async getNextDeviceCamera(){var o,n;let e=await s.CameraAccess.getCameras(),t=this.frameSource?this.frameSource:null,a=(o=t==null?void 0:t.cameraManager.activeCamera)==null?void 0:o.deviceId,r=e.findIndex(c=>c.deviceId===a);return r>-1?(n=e[r+1])!=null?n:e[0]:e.length>0?e[0]:null}async switchCameras(e){var n,c,u;this.isTransitioning=true;let t=(n=this.context)==null?void 0:n.frameSource,a,r;t!=null&&(a=new g$1(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off"));let o=s.Camera.fromDeviceCamera(e);a!=null&&await o.applySettings(a),await((c=this.context)==null?void 0:c.setFrameSource(o)),await((u=this.context)==null?void 0:u.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=false;}},g=class s extends d{constructor(e,t){super(e,t);}static get Camera(){return a$1}static get CameraAccess(){return d$1}async install(){let e=await super.install();return e&&await this.setInitialCamera(),e}async canShow(){return !a$2.isIOSDeviceWithExtendedCameraAccess()||!f$1(this.frameSource)?false:d$1.isIOSBackDualWideCameraLabel(this.frameSource.label)||d$1.isIOSBackCameraLabel(this.frameSource.label)||d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label)}getImageFromState(){return this.isUltraWideBackCamera()?this.isHover?this.control.cameraFOVUltraWidePressedImage:this.control.cameraFOVUltraWideImage:this.isHover?this.control.cameraFOVWidePressedImage:this.control.cameraFOVWideImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getAlternativeDeviceCamera();e&&await this.switchCameras(e);}setup(){if(this.control.cameraFOVUltraWideImage==null||this.control.cameraFOVWideImage==null){a.log(a.Level.Warn,"CameraFOVSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async setInitialCamera(){var e,t;if(!this.isTransitioning&&!d$1.isIOSBackCameraLabel((t=(e=this.frameSource)==null?void 0:e.label)!=null?t:"")){let r=(await s.CameraAccess.getCameras()).find(o=>d$1.isIOSBackCameraLabel(o.label));r&&await this.switchCameras(r);}}isUltraWideBackCamera(){return f$1(this.frameSource)?d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label):false}async getAlternativeDeviceCamera(){return (await s.CameraAccess.getCameras()).find(t=>this.isUltraWideBackCamera()?d$1.isIOSBackCameraLabel(t.label):d$1.isIOSUltraWideBackCameraLabel(t.label))}async switchCameras(e){var n,c,u;this.isTransitioning=true;let t=(n=this.context)==null?void 0:n.frameSource,a,r;t!=null&&(a=new g$1(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off"));let o=s.Camera.fromDeviceCamera(e);a!=null&&await o.applySettings(a),await((c=this.context)==null?void 0:c.setFrameSource(o)),await((u=this.context)==null?void 0:u.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=false;}};export{S as a,C as b,f as c,g as d};
|