@scandit/web-datacapture-parser 8.0.0-beta.2 → 8.0.1

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.
Files changed (27) hide show
  1. package/LICENSE +1 -1
  2. package/THIRD_PARTY.txt +201 -71
  3. package/build/js/chunks/{chunk-5S2W5QUV.js → chunk-BPESVUYM.js} +1 -1
  4. package/build/js/chunks/{chunk-QKT2OK3K.js → chunk-GXWHUZH4.js} +1 -1
  5. package/build/js/chunks/chunk-M25LBFN7.js +2 -0
  6. package/build/js/chunks/{chunk-E4U457WT.js → chunk-NEGBKIFV.js} +1 -1
  7. package/build/js/chunks/{chunk-SE3EA2O5.js → chunk-RWIG3REQ.js} +1 -1
  8. package/build/js/chunks/{chunk-FKYO7NV2.js → chunk-XDTUDCET.js} +1 -1
  9. package/build/js/index.js +1 -1
  10. package/build/js/moduleLoader.js +1 -1
  11. package/build/js/parser/Parser.js +1 -1
  12. package/build/js/parser/index.js +1 -1
  13. package/build/js/parser/private/ParserInterfaceProxy.js +1 -1
  14. package/build/js/parser/private/ParserLoader.js +1 -1
  15. package/build/js/worker/ParserComponent.js +1 -1
  16. package/build/js/worker/parser.inlineWorker.js +1 -1
  17. package/package.json +2 -2
  18. package/sdc-lib/resources/models/barcode_label_localization_mslc_model_s.77afd87bb1ae.model +0 -0
  19. package/sdc-lib/scandit-datacapture-sdk-parser-pthreads.js +1 -1
  20. package/sdc-lib/scandit-datacapture-sdk-parser-pthreads.wasm +0 -0
  21. package/sdc-lib/scandit-datacapture-sdk-parser-simd-pthreads.js +1 -1
  22. package/sdc-lib/scandit-datacapture-sdk-parser-simd-pthreads.wasm +0 -0
  23. package/sdc-lib/scandit-datacapture-sdk-parser-simd.js +1 -1
  24. package/sdc-lib/scandit-datacapture-sdk-parser-simd.wasm +0 -0
  25. package/sdc-lib/scandit-datacapture-sdk-parser.js +1 -1
  26. package/sdc-lib/scandit-datacapture-sdk-parser.wasm +0 -0
  27. package/build/js/chunks/chunk-VW6JMWA6.js +0 -2
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright © 2025 Scandit AG. All Rights Reserved.
1
+ Copyright © 2026 Scandit AG. All Rights Reserved.
2
2
 
3
3
  The use of this software is governed by the Scandit Terms and Conditions.
4
4
  https://ssl.scandit.com/terms/terms.pdf
package/THIRD_PARTY.txt CHANGED
@@ -1,73 +1,203 @@
1
- Apache License, Version 2.0 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/
2
1
 
3
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
4
2
 
5
- 1. Definitions.
6
-
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.
3
+ Apache License
4
+ Version 2.0, January 2004
5
+ http://www.apache.org/licenses/
6
+
7
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
8
+
9
+ 1. Definitions.
10
+
11
+ "License" shall mean the terms and conditions for use, reproduction,
12
+ and distribution as defined by Sections 1 through 9 of this document.
13
+
14
+ "Licensor" shall mean the copyright owner or entity authorized by
15
+ the copyright owner that is granting the License.
16
+
17
+ "Legal Entity" shall mean the union of the acting entity and all
18
+ other entities that control, are controlled by, or are under common
19
+ control with that entity. For the purposes of this definition,
20
+ "control" means (i) the power, direct or indirect, to cause the
21
+ direction or management of such entity, whether by contract or
22
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
23
+ outstanding shares, or (iii) beneficial ownership of such entity.
24
+
25
+ "You" (or "Your") shall mean an individual or Legal Entity
26
+ exercising permissions granted by this License.
27
+
28
+ "Source" form shall mean the preferred form for making modifications,
29
+ including but not limited to software source code, documentation
30
+ source, and configuration files.
31
+
32
+ "Object" form shall mean any form resulting from mechanical
33
+ transformation or translation of a Source form, including but
34
+ not limited to compiled object code, generated documentation,
35
+ and conversions to other media types.
36
+
37
+ "Work" shall mean the work of authorship, whether in Source or
38
+ Object form, made available under the License, as indicated by a
39
+ copyright notice that is included in or attached to the work
40
+ (an example is provided in the Appendix below).
41
+
42
+ "Derivative Works" shall mean any work, whether in Source or Object
43
+ form, that is based on (or derived from) the Work and for which the
44
+ editorial revisions, annotations, elaborations, or other modifications
45
+ represent, as a whole, an original work of authorship. For the purposes
46
+ of this License, Derivative Works shall not include works that remain
47
+ separable from, or merely link (or bind by name) to the interfaces of,
48
+ the Work and Derivative Works thereof.
49
+
50
+ "Contribution" shall mean any work of authorship, including
51
+ the original version of the Work and any modifications or additions
52
+ to that Work or Derivative Works thereof, that is intentionally
53
+ submitted to Licensor for inclusion in the Work by the copyright owner
54
+ or by an individual or Legal Entity authorized to submit on behalf of
55
+ the copyright owner. For the purposes of this definition, "submitted"
56
+ means any form of electronic, verbal, or written communication sent
57
+ to the Licensor or its representatives, including but not limited to
58
+ communication on electronic mailing lists, source code control systems,
59
+ and issue tracking systems that are managed by, or on behalf of, the
60
+ Licensor for the purpose of discussing and improving the Work, but
61
+ excluding communication that is conspicuously marked or otherwise
62
+ designated in writing by the copyright owner as "Not a Contribution."
63
+
64
+ "Contributor" shall mean Licensor and any individual or Legal Entity
65
+ on behalf of whom a Contribution has been received by Licensor and
66
+ subsequently incorporated within the Work.
67
+
68
+ 2. Grant of Copyright License. Subject to the terms and conditions of
69
+ this License, each Contributor hereby grants to You a perpetual,
70
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
71
+ copyright license to reproduce, prepare Derivative Works of,
72
+ publicly display, publicly perform, sublicense, and distribute the
73
+ Work and such Derivative Works in Source or Object form.
74
+
75
+ 3. Grant of Patent License. Subject to the terms and conditions of
76
+ this License, each Contributor hereby grants to You a perpetual,
77
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
78
+ (except as stated in this section) patent license to make, have made,
79
+ use, offer to sell, sell, import, and otherwise transfer the Work,
80
+ where such license applies only to those patent claims licensable
81
+ by such Contributor that are necessarily infringed by their
82
+ Contribution(s) alone or by combination of their Contribution(s)
83
+ with the Work to which such Contribution(s) was submitted. If You
84
+ institute patent litigation against any entity (including a
85
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
86
+ or a Contribution incorporated within the Work constitutes direct
87
+ or contributory patent infringement, then any patent licenses
88
+ granted to You under this License for that Work shall terminate
89
+ as of the date such litigation is filed.
90
+
91
+ 4. Redistribution. You may reproduce and distribute copies of the
92
+ Work or Derivative Works thereof in any medium, with or without
93
+ modifications, and in Source or Object form, provided that You
94
+ meet the following conditions:
95
+
96
+ (a) You must give any other recipients of the Work or
97
+ Derivative Works a copy of this License; and
98
+
99
+ (b) You must cause any modified files to carry prominent notices
100
+ stating that You changed the files; and
101
+
102
+ (c) You must retain, in the Source form of any Derivative Works
103
+ that You distribute, all copyright, patent, trademark, and
104
+ attribution notices from the Source form of the Work,
105
+ excluding those notices that do not pertain to any part of
106
+ the Derivative Works; and
107
+
108
+ (d) If the Work includes a "NOTICE" text file as part of its
109
+ distribution, then any Derivative Works that You distribute must
110
+ include a readable copy of the attribution notices contained
111
+ within such NOTICE file, excluding those notices that do not
112
+ pertain to any part of the Derivative Works, in at least one
113
+ of the following places: within a NOTICE text file distributed
114
+ as part of the Derivative Works; within the Source form or
115
+ documentation, if provided along with the Derivative Works; or,
116
+ within a display generated by the Derivative Works, if and
117
+ wherever such third-party notices normally appear. The contents
118
+ of the NOTICE file are for informational purposes only and
119
+ do not modify the License. You may add Your own attribution
120
+ notices within Derivative Works that You distribute, alongside
121
+ or as an addendum to the NOTICE text from the Work, provided
122
+ that such additional attribution notices cannot be construed
123
+ as modifying the License.
124
+
125
+ You may add Your own copyright statement to Your modifications and
126
+ may provide additional or different license terms and conditions
127
+ for use, reproduction, or distribution of Your modifications, or
128
+ for any such Derivative Works as a whole, provided Your use,
129
+ reproduction, and distribution of the Work otherwise complies with
130
+ the conditions stated in this License.
131
+
132
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
133
+ any Contribution intentionally submitted for inclusion in the Work
134
+ by You to the Licensor shall be under the terms and conditions of
135
+ this License, without any additional terms or conditions.
136
+ Notwithstanding the above, nothing herein shall supersede or modify
137
+ the terms of any separate license agreement you may have executed
138
+ with Licensor regarding such Contributions.
139
+
140
+ 6. Trademarks. This License does not grant permission to use the trade
141
+ names, trademarks, service marks, or product names of the Licensor,
142
+ except as required for reasonable and customary use in describing the
143
+ origin of the Work and reproducing the content of the NOTICE file.
144
+
145
+ 7. Disclaimer of Warranty. Unless required by applicable law or
146
+ agreed to in writing, Licensor provides the Work (and each
147
+ Contributor provides its Contributions) on an "AS IS" BASIS,
148
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
149
+ implied, including, without limitation, any warranties or conditions
150
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
151
+ PARTICULAR PURPOSE. You are solely responsible for determining the
152
+ appropriateness of using or redistributing the Work and assume any
153
+ risks associated with Your exercise of permissions under this License.
154
+
155
+ 8. Limitation of Liability. In no event and under no legal theory,
156
+ whether in tort (including negligence), contract, or otherwise,
157
+ unless required by applicable law (such as deliberate and grossly
158
+ negligent acts) or agreed to in writing, shall any Contributor be
159
+ liable to You for damages, including any direct, indirect, special,
160
+ incidental, or consequential damages of any character arising as a
161
+ result of this License or out of the use or inability to use the
162
+ Work (including but not limited to damages for loss of goodwill,
163
+ work stoppage, computer failure or malfunction, or any and all
164
+ other commercial damages or losses), even if such Contributor
165
+ has been advised of the possibility of such damages.
166
+
167
+ 9. Accepting Warranty or Additional Liability. While redistributing
168
+ the Work or Derivative Works thereof, You may choose to offer,
169
+ and charge a fee for, acceptance of support, warranty, indemnity,
170
+ or other liability obligations and/or rights consistent with this
171
+ License. However, in accepting such obligations, You may act only
172
+ on Your own behalf and on Your sole responsibility, not on behalf
173
+ of any other Contributor, and only if You agree to indemnify,
174
+ defend, and hold each Contributor harmless for any liability
175
+ incurred by, or claims asserted against, such Contributor by reason
176
+ of your accepting any such warranty or additional liability.
177
+
178
+ END OF TERMS AND CONDITIONS
179
+
180
+ APPENDIX: How to apply the Apache License to your work.
181
+
182
+ To apply the Apache License to your work, attach the following
183
+ boilerplate notice, with the fields enclosed by brackets "[]"
184
+ replaced with your own identifying information. (Don't include
185
+ the brackets!) The text should be enclosed in the appropriate
186
+ comment syntax for the file format. We also recommend that a
187
+ file or class name and description of purpose be included on the
188
+ same "printed page" as the copyright notice for easier
189
+ identification within third-party archives.
190
+
191
+ Copyright [yyyy] [name of copyright owner]
192
+
193
+ Licensed under the Apache License, Version 2.0 (the "License");
194
+ you may not use this file except in compliance with the License.
195
+ You may obtain a copy of the License at
196
+
197
+ http://www.apache.org/licenses/LICENSE-2.0
198
+
199
+ Unless required by applicable law or agreed to in writing, software
200
+ distributed under the License is distributed on an "AS IS" BASIS,
201
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
202
+ See the License for the specific language governing permissions and
203
+ limitations under the License.
@@ -1 +1 @@
1
- var c=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var b=(p,s,d,t)=>{for(var a=t>1?void 0:t?i(s,d):s,e=p.length-1,r;e>=0;e--)(r=p[e])&&(a=(t?r(s,d,a):r(a))||a);return t&&a&&c(s,d,a),a};var u={"scandit-datacapture-sdk-parser-pthreads.wasm":{bytes:7504089},"scandit-datacapture-sdk-parser-simd-pthreads.wasm":{bytes:7439362},"scandit-datacapture-sdk-parser.wasm":{bytes:7409801},"scandit-datacapture-sdk-parser-simd.wasm":{bytes:7344566}};export{b as a,u as b};
1
+ var c=Object.defineProperty;var i=Object.getOwnPropertyDescriptor;var b=(p,s,d,t)=>{for(var a=t>1?void 0:t?i(s,d):s,e=p.length-1,r;e>=0;e--)(r=p[e])&&(a=(t?r(s,d,a):r(a))||a);return t&&a&&c(s,d,a),a};var u={"scandit-datacapture-sdk-parser-pthreads.wasm":{bytes:7511455},"scandit-datacapture-sdk-parser-simd.wasm":{bytes:7351678},"scandit-datacapture-sdk-parser-simd-pthreads.wasm":{bytes:7446918},"scandit-datacapture-sdk-parser.wasm":{bytes:7416697}};export{b as a,u as b};
@@ -1 +1 @@
1
- import {a as a$2}from'./chunk-K74I4SRW.js';import {a as a$1,b}from'./chunk-TQGBSFHQ.js';import {a as a$3}from'./chunk-VW6JMWA6.js';import {a}from'./chunk-5S2W5QUV.js';var r=class extends a$2{constructor(){super(...arguments);this.command="djinniAction";}get worker(){return a$3.worker}async parseStringToJson(t){return {}}async setOptions(t){return false}getId(){return `${this.dataFormat}`}async create(t){return this.dataFormat=t,""}};a([a$1()],r.prototype,"parseStringToJson",1),a([a$1({argumentsSerializer:t=>[JSON.stringify(t[0])]})],r.prototype,"setOptions",1),a([a$1()],r.prototype,"create",1),r=a([b("ParserInterface")],r);export{r as a};
1
+ import {a as a$2}from'./chunk-K74I4SRW.js';import {a as a$1,b}from'./chunk-TQGBSFHQ.js';import {a as a$3}from'./chunk-M25LBFN7.js';import {a}from'./chunk-BPESVUYM.js';var r=class extends a$2{constructor(){super(...arguments);this.command="djinniAction";}get worker(){return a$3.worker}async parseStringToJson(t){return {}}async setOptions(t){return false}getId(){return `${this.dataFormat}`}async create(t){return this.dataFormat=t,""}};a([a$1()],r.prototype,"parseStringToJson",1),a([a$1({argumentsSerializer:t=>[JSON.stringify(t[0])]})],r.prototype,"setOptions",1),a([a$1()],r.prototype,"create",1),r=a([b("ParserInterface")],r);export{r as a};
@@ -0,0 +1,2 @@
1
+ import {a}from'./chunk-2APDEN7H.js';import {Deferred}from'@scandit/web-datacapture-core/build/js/private/utils/deferred.js';function o(t){let e=URL.createObjectURL(new Blob(['"use strict";(()=>{var G=(r,e)=>()=>(r&&(e=r(r=0)),e);var p,s=G(()=>{p={"scandit-datacapture-sdk-parser-pthreads.wasm":{bytes:7511455},"scandit-datacapture-sdk-parser-simd.wasm":{bytes:7351678},"scandit-datacapture-sdk-parser-simd-pthreads.wasm":{bytes:7446918},"scandit-datacapture-sdk-parser.wasm":{bytes:7416697}}});s();s();s();s();function O(){if(typeof self=="object")return!1;let r=(()=>{if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;if(typeof self<"u")return self;throw new Error("No global object found")})();return Object.defineProperty(r,"globalThis",{value:r,writable:!0,configurable:!0}),!0}s();var o;(r=>{(l=>(l.Debug="debug",l.Info="info",l.Warn="warn",l.Error="error",l.Quiet="quiet"))(r.Level||(r.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),t="debug";function a(l){t=l}r.setLevel=a;function n(l,...d){if(!(e.get(t)>e.get(l)))switch(l){case"debug":{console.debug(...d);break}case"info":{console.log(...d);break}case"warn":{console.warn(...d);break}case"error":{console.error(...d);break}}}r.log=n;function i(...l){n("warn",...l)}r.warn=i;function u(...l){n("debug",...l)}r.debug=u;function c(...l){n("info",...l)}r.info=c;function m(...l){n("error",...l)}r.error=m})(o||(o={}));s();var M=class _ extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,_.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};s();s();s();var U={};function Z(r){return[...new Uint8Array(r)].map(e=>{let t=e.toString(16);return t.length===1?`0${t}`:t}).join("")}async function*X(r){let e=r.getReader();try{for(;;){let{done:t,value:a}=await e.read();if(t)return;yield a}}finally{e.releaseLock()}}async function Y(r){let e=[],t=0,a=0;for await(let i of X(r))e.push(i),t+=i.length;let n=new Uint8Array(t);for(let i of e)n.set(i,a),a+=i.length;return n.buffer}var F=(r=>(r.VALID="VALID",r.INVALID="INVALID",r.NOT_VERIFIABLE="NOT_VERIFIABLE",r))(F||{});async function $(r,e,t){if(typeof crypto.subtle.digest!="function")return o.log(o.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${t} could not be verified`),"NOT_VERIFIABLE";try{let a=r instanceof Promise?await r:r,n=await crypto.subtle.digest("SHA-256",a),i=Z(n);return e==null?(o.log(o.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):i===e?(o.log(o.Level.Debug,`Data Capture library WASM integrity found at ${t} has been verified correctly.`),"VALID"):(o.log(o.Level.Warn,`The Scandit Data Capture library WASM file found at ${t} seems invalid: expected file hash doesn\'t match (received: ${i}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(a){return o.log(o.Level.Warn,"Wasm response could not be verified",a),"NOT_VERIFIABLE"}}var A=new Map([["br",4.4],["gzip",2.9],["none",1]]);function ee(r){var e;let t="content-encoding";if(r==null||r.get(t)==null)return A.get("none");let a=new Set(((e=r.get(t))!=null?e:"").split(",").map(n=>n.trim()));for(let[n,i]of A)if(a.has(n))return i;return A.get("none")}function re(r){var e,t;if(r==null)return 0;let a=(e=ee(r))!=null?e:1,n=Number.parseInt((t=r.get("content-length"))!=null?t:"0",10);return Number.isNaN(n)?0:Math.floor(n*a*100)/100}function te(r){let{pathname:e}=new URL(r);for(let[t,a]of Object.entries(U))if(e.endsWith(t))return a.bytes;return 0}function x(r){U=r}var H=(r,e)=>{let t=re(e);return t===0?te(r):t};function V(r,e,t,{onProgress:a,onError:n,onComplete:i}){if(!e.body)return[e];let u=H(r,e.headers),c=0,m=0;if(typeof TransformStream>"u")return o.warn("TransformStream is not supported in this environment. Progress tracking will be disabled."),[e];let[l,d]=t?e.body.tee():[e.body],f=l.pipeThrough(new TransformStream({async transform(g,h){try{c+=g.length,m=Number((c/u*100).toFixed(2)),u>0&&g.length>0&&m<100?a==null||a({percentage:m,loadedBytes:c,privateUri:r}):u===0&&g.length>0&&(a==null||a({percentage:null,loadedBytes:c,privateUri:r})),h.enqueue(g)}catch(w){h.error(w),n==null||n({error:w})}},flush(g){a==null||a({percentage:100,loadedBytes:c,privateUri:r}),i==null||i({percentage:100,loadedBytes:c,privateUri:r}),g.terminate()}}));return[new Response(f,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),d]}async function L({wasmURI:r,expectedHash:e,verifyResponseHash:t,onProgress:a,onComplete:n,onError:i,referredOrigin:u}){let c=await fetch(r,{referrerPolicy:"origin",referrer:u!=null?u:""});if(!c.ok)throw new Error(`HTTP status code is not ok: ${c.status}, ${c.statusText}`);let[m,l]=V(r,c,t,{onProgress:a,onError:i,onComplete:n});return l!=null&&$(Y(l),e,r),m}function I({wasmURI:r,expectedHash:e,verifyResponseHash:t,progressCallback:a,successCallback:n,errorCallback:i,importObject:u,referredOrigin:c}){async function m(d){try{let f=await L({wasmURI:r,expectedHash:e,verifyResponseHash:t,onProgress:a,referredOrigin:c}),g=await(d!=null?d:f).arrayBuffer(),h=await self.WebAssembly.instantiate(g,u);n(h.instance,h.module)}catch(f){o.log(o.Level.Error,f),o.log(o.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${r}, did you configure the path for it correctly?`),i==null||i(f)}}async function l(){let d;try{d=await L({wasmURI:r,expectedHash:e,verifyResponseHash:t,onProgress:a,referredOrigin:c});let f=await self.WebAssembly.instantiateStreaming(d,u);n(f.instance,f.module)}catch(f){o.log(o.Level.Warn,f),o.log(o.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),m((d==null?void 0:d.bodyUsed)===!0?void 0:d)}}typeof self.WebAssembly.instantiateStreaming=="function"?l():m()}async function P(r,e,t,a){return new Promise((n,i)=>{r().then(n).catch(u=>{let c=e*2;if(c>t){i(u);return}a(u),self.setTimeout(()=>{P(r,c,t,a).then(n).catch(i)},e)})})}async function W(r,e){async function t(){return importScripts(r)}try{await P(t,250,4e3,n=>{o.log(o.Level.Warn,n),o.log(o.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${r}, retrying...`)}),self.Module.mainScriptUrlOrBlob=r;let a=self.SDC_WASM_JS_VERSION;return a!==e&&o.log(o.Level.Warn,`The Scandit Data Capture library JS file found at ${r} seems invalid: expected version doesn\'t match (received: ${a}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(a){return o.log(o.Level.Error,a),!1}}s();var E=class{constructor(){this.promise=new Promise((r,e)=>{this.reject=e,this.resolve=r})}};s();var v;(r=>{function e(){return"8.0.1"}r.sdkVersion=e})(v||(v={}));s();function j(r){return/^https?:\\/\\/(?:[^./]*\\.)*cdn.jsdelivr.net\\//.test(r)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\\/\\/(?:[^./]*\\.)*unpkg.com\\//.test(r)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function B(r){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(r);return e?e[0]:null}function k(r,e,t){let a=e,n=j(a);if(n.result){let u=B(a);u!=null&&(a=`${n.cdnBaseURL}${u}@${r}/sdc-lib/`)}let i=t.replace(".wasm","");return n.result?{jsURI:`${a}${i}.js`,wasmURI:`${a}${i}.wasm`}:{jsURI:`${a}${i}.js?v=${r}`,wasmURI:`${a}${i}.wasm?v=${r}`}}s();var ae=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),se=()=>(async r=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(r)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));function z(){return typeof crossOriginIsolated>"u"?!1:crossOriginIsolated}function q(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer.constructor.name==="SharedArrayBuffer"}catch{return!1}}async function T(){return ae()}async function J(){if(!await se())return!1;let r=null;try{r=new Worker(URL.createObjectURL(new Blob([\'postMessage("Worker" in self);\'],{type:"text/javascript"})),{name:"nestedWorkerTest"})}catch{return!1}return new Promise(e=>{if(r==null){e(!1);return}r.onmessage=t=>{r==null||r.terminate(),e(t.data)}})}async function C(){let r=await J();return z()&&q()&&r}s();function D(r){return typeof r=="object"&&r!=null&&r.document==null&&"addEventListener"in r&&typeof r.importScripts=="function"}s();var b=(r=>(r.Auto="auto",r.Off="off",r.On="on",r))(b||{});O();s();s();s();s();s();s();s();s();var oe=r=>r.result!=null&&r.error==null;function y(r,e){return{type:"djinniResult",payload:{id:r.id,className:r.className,methodName:r.methodName,instanceId:r.instanceId,result:e}}}function N(r,e){return{type:"parserLoaderResult",payload:{id:r.id,className:r.className,methodName:r.methodName,result:e}}}function ne(r){try{return{type:"result",result:JSON.parse(r)}}catch(e){return{type:"error",error:e}}}var R=class{constructor(e,t){this.parsers=new Map;this.onMessageListener=this.onMessage.bind(this);this.setupPromise=null;this.workerSelf=e,this.moduleHandler=t,D(e)&&(this.workerFunctions={postMessage:this.workerSelf.postMessage.bind(this.workerSelf)},this.listenToMessages()),x(p)}get Module(){return this.moduleHandler.get()}setLogLevel(e){o.setLevel(e.args[0]),this.workerFunctions.postMessage(N(e,{type:"result",result:!0}))}async load(e){try{await this.setup(e.args[0]),this.workerFunctions.postMessage(N(e,{type:"result",result:!0}))}catch(t){this.workerFunctions.postMessage(N(e,{type:"error",error:t}))}}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",e=>{o.log(o.Level.Error,e)}),this.workerSelf.addEventListener("messageerror",e=>{o.log(o.Level.Error,e)})}onMessage(e){return e.data.className==="ParserLoader"&&e.data.methodName==="load"&&this.load(e.data),e.data.className==="ParserLoader"&&e.data.methodName==="setLogLevel"&&this.setLogLevel(e.data),e.data.className==="ParserInterface"&&this.performDjinniAction(e.data),!0}async performDjinniAction(e){var i,u;let t;if(o.log(o.Level.Debug,`${e.className}::${e.methodName}(`,e.args,")"),e.methodName==="create"){let c=e.args[0].toString();if(this.parsers.has(c)){this.workerFunctions.postMessage(y(e,{type:"result",result:c}));return}t=this.createParser(e),o.log(o.Level.Debug,t),this.workerFunctions.postMessage(t);return}let a=this.parsers.get((i=e.instanceId)!=null?i:"");if(a==null){this.workerFunctions.postMessage(y(e,{type:"error",error:`parser is not defined: try to access instance with id ${(u=e.instanceId)!=null?u:""}`}));return}let n=a[e.methodName](...e.args);oe(n)?(e.methodName.endsWith("ToJson")&&typeof n.result=="string"&&(n=ne(n.result)),t=y(e,n)):t=y(e,{type:"error",error:n.error}),this.workerFunctions.postMessage(t)}async setup({libraryLocation:e,overrideThreadsSupport:t,overrideSimdSupport:a,verifyResponseHash:n,referredOrigin:i}){if(this.setupPromise!=null)return this.setupPromise;let{resolve:u,reject:c,promise:m}=new E;this.setupPromise=m;let l=v.sdkVersion();if(l==="")throw new M({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[d,f]=await Promise.all([T(),C()]);t!==b.Auto&&(f=t===b.On),a!==b.Auto&&(d=a===b.On);let g=k(l,e,this.getWasmParserFileName(d,f)),{jsURI:h,wasmURI:w}=g;return this.moduleHandler.set({mainScriptUrlOrBlob:h,locateFile:S=>e+S,onMainComplete:()=>{},onRuntimeInitialized:()=>{u()},print:S=>{o.log(o.Level.Info,S)},instantiateWasm:(S,Q)=>(I({importObject:S,wasmURI:w,expectedHash:this.getWasmParserExpectedHash(d,f),verifyResponseHash:n,successCallback:Q,progressCallback:()=>{},referredOrigin:i}),{})}),await W(h,l)||c(`Couldn\'t retrieve Parser library at ${h}, did you configure the path for it correctly?`),m}createParser(e){var i,u;let t=this.Module.ParserInterface.create(e.args[0]);if(o.log(o.Level.Debug,`Parser:create returns ${t.type}`,t),t.type==="error")return y(e,t);let a=(u=(i=e.args[0])==null?void 0:i.toString())!=null?u:"",n=y(e,{type:"result",result:a});return this.parsers.set(a,t.result),n}getWasmParserExpectedHash(e,t){return t?e?"6b46bb9c73303e19622025955860b0d432cd341a3ecf4afd8af98f6eb811531b":"8ef450b765ffd24ce1c0ee75327ad5d302442bdefe9020abcd308a32158d8273":e?"88f53bd9601861b049571dcf427e37dc093aed07c15cedb3c877215e1ffa9bce":"592017ce4d6bb4cf62153047e5da11e90a523643f5e24c568356206954f9193a"}getWasmParserFileName(e,t){return t?e?"scandit-datacapture-sdk-parser-simd-pthreads.wasm":"scandit-datacapture-sdk-parser-pthreads.wasm":e?"scandit-datacapture-sdk-parser-simd.wasm":"scandit-datacapture-sdk-parser.wasm"}};var Er=new R(self,{get:()=>self.Module,set:r=>{self.Module=r}});function kr(r){}})();\n'],{type:"application/javascript"})),r=new Worker(e,t);return URL.revokeObjectURL(e),r}var i=class t{constructor(e){this.moduleName="Parser";this.id=0;this.loadingOptions=e;}static get worker(){var r;let e=(r=a.get("ParserWorker"))!=null?r:o({name:"ParserWorker"});return a.has("ParserWorker")||a.set("ParserWorker",e),e}static create(e){return new t(e)}async load(){var e;await this.sendMessage({id:this.id++,methodName:"load",className:"ParserLoader",args:[{libraryLocation:this.loadingOptions.libraryLocation,overrideSimdSupport:this.loadingOptions.overrideSimdSupport,overrideThreadsSupport:this.loadingOptions.overrideThreadsSupport,verifyResponseHash:this.loadingOptions.verifyResponseHash,referredOrigin:(e=this.loadingOptions.referredOrigin)!=null?e:""}]});}async setLogLevel(e){await this.sendMessage({id:this.id++,methodName:"setLogLevel",className:"ParserLoader",args:[e]});}async sendMessage(e){let r=new Deferred,n=l=>{let{data:a}=l;e.id===a.payload.id&&(a.payload.result.type==="result"?r.resolve(a.payload.result.result):r.reject(a.payload.result.error),t.worker.removeEventListener("message",n));};return t.worker.addEventListener("message",n),t.worker.postMessage(e),r.promise}};
2
+ export{i as a};
@@ -1 +1 @@
1
- import {a}from'./chunk-VW6JMWA6.js';import {Logger}from'@scandit/web-datacapture-core';import {normalizeLibraryLocation}from'@scandit/web-datacapture-core/build/js/private/Helper.js';function p(r){return r!=null&&r.libraryLocation&&(r.libraryLocation=normalizeLibraryLocation(r.libraryLocation)),{moduleName:"Parser",load:async a$1=>{var i,d;let e=a$1,o=a.create({libraryLocation:(i=r==null?void 0:r.libraryLocation)!=null?i:e.libraryLocation,overrideSimdSupport:e.overrideSimdSupport,overrideThreadsSupport:e.overrideThreadsSupport,verifyResponseHash:true,referredOrigin:globalThis.location.origin});await o.setLogLevel((d=a$1.logLevel)!=null?d:Logger.Level.Debug),await o.load();}}}export{p as a};
1
+ import {a}from'./chunk-M25LBFN7.js';import {Logger}from'@scandit/web-datacapture-core';import {normalizeLibraryLocation}from'@scandit/web-datacapture-core/build/js/private/Helper.js';function p(r){return r!=null&&r.libraryLocation&&(r.libraryLocation=normalizeLibraryLocation(r.libraryLocation)),{moduleName:"Parser",load:async a$1=>{var i,d;let e=a$1,o=a.create({libraryLocation:(i=r==null?void 0:r.libraryLocation)!=null?i:e.libraryLocation,overrideSimdSupport:e.overrideSimdSupport,overrideThreadsSupport:e.overrideThreadsSupport,verifyResponseHash:true,referredOrigin:globalThis.location.origin});await o.setLogLevel((d=a$1.logLevel)!=null?d:Logger.Level.Debug),await o.load();}}}export{p as a};
@@ -1 +1 @@
1
- import {b}from'./chunk-5S2W5QUV.js';import {Logger,DataCaptureVersion,DataCaptureError}from'@scandit/web-datacapture-core';import {getLibraryLocationURIs}from'@scandit/web-datacapture-core/build/js/private/Helper.js';import {hasSIMDSupport,checkFullMultithreadingSupport}from'@scandit/web-datacapture-core/build/js/private/multithreadSimdHelper.js';import {Deferred}from'@scandit/web-datacapture-core/build/js/private/utils/deferred.js';import {isWorkerScope}from'@scandit/web-datacapture-core/build/js/private/utils/isWorkerScope.js';import {OverrideState}from'@scandit/web-datacapture-core/build/js/worker/OverrideState.js';import {instantiateWebAssembly}from'@scandit/web-datacapture-core/build/js/worker/helper.js';import {setWasmMetadata}from'@scandit/web-datacapture-core/build/js/worker/helperFetch.js';import {importWasmScript}from'@scandit/web-datacapture-core/build/js/worker/importWasmScript.js';var N=s=>s.result!=null&&s.error==null;function l(s,e){return {type:"djinniResult",payload:{id:s.id,className:s.className,methodName:s.methodName,instanceId:s.instanceId,result:e}}}function P(s,e){return {type:"parserLoaderResult",payload:{id:s.id,className:s.className,methodName:s.methodName,result:e}}}function D(s){try{return {type:"result",result:JSON.parse(s)}}catch(e){return {type:"error",error:e}}}var S=class{constructor(e,r){this.parsers=new Map;this.onMessageListener=this.onMessage.bind(this);this.setupPromise=null;this.workerSelf=e,this.moduleHandler=r,isWorkerScope(e)&&(this.workerFunctions={postMessage:this.workerSelf.postMessage.bind(this.workerSelf)},this.listenToMessages()),setWasmMetadata(b);}get Module(){return this.moduleHandler.get()}setLogLevel(e){Logger.setLevel(e.args[0]),this.workerFunctions.postMessage(P(e,{type:"result",result:true}));}async load(e){try{await this.setup(e.args[0]),this.workerFunctions.postMessage(P(e,{type:"result",result:true}));}catch(r){this.workerFunctions.postMessage(P(e,{type:"error",error:r}));}}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",e=>{Logger.log(Logger.Level.Error,e);}),this.workerSelf.addEventListener("messageerror",e=>{Logger.log(Logger.Level.Error,e);});}onMessage(e){return e.data.className==="ParserLoader"&&e.data.methodName==="load"&&this.load(e.data),e.data.className==="ParserLoader"&&e.data.methodName==="setLogLevel"&&this.setLogLevel(e.data),e.data.className==="ParserInterface"&&this.performDjinniAction(e.data),true}async performDjinniAction(e){var i,n;let r;if(Logger.log(Logger.Level.Debug,`${e.className}::${e.methodName}(`,e.args,")"),e.methodName==="create"){let d=e.args[0].toString();if(this.parsers.has(d)){this.workerFunctions.postMessage(l(e,{type:"result",result:d}));return}r=this.createParser(e),Logger.log(Logger.Level.Debug,r),this.workerFunctions.postMessage(r);return}let o=this.parsers.get((i=e.instanceId)!=null?i:"");if(o==null){this.workerFunctions.postMessage(l(e,{type:"error",error:`parser is not defined: try to access instance with id ${(n=e.instanceId)!=null?n:""}`}));return}let a=o[e.methodName](...e.args);N(a)?(e.methodName.endsWith("ToJson")&&typeof a.result=="string"&&(a=D(a.result)),r=l(e,a)):r=l(e,{type:"error",error:a.error}),this.workerFunctions.postMessage(r);}async setup({libraryLocation:e,overrideThreadsSupport:r,overrideSimdSupport:o,verifyResponseHash:a,referredOrigin:i}){if(this.setupPromise!=null)return this.setupPromise;let{resolve:n,reject:d,promise:M}=new Deferred;this.setupPromise=M;let c=DataCaptureVersion.sdkVersion();if(c==="")throw new DataCaptureError({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[m,g]=await Promise.all([hasSIMDSupport(),checkFullMultithreadingSupport()]);r!==OverrideState.Auto&&(g=r===OverrideState.On),o!==OverrideState.Auto&&(m=o===OverrideState.On);let R=getLibraryLocationURIs(c,e,this.getWasmParserFileName(m,g)),{jsURI:f,wasmURI:A}=R;return this.moduleHandler.set({mainScriptUrlOrBlob:f,locateFile:u=>e+u,onMainComplete:()=>{},onRuntimeInitialized:()=>{n();},print:u=>{Logger.log(Logger.Level.Info,u);},instantiateWasm:(u,L)=>(instantiateWebAssembly({importObject:u,wasmURI:A,expectedHash:this.getWasmParserExpectedHash(m,g),verifyResponseHash:a,successCallback:L,progressCallback:()=>{},referredOrigin:i}),{})}),await importWasmScript(f,c)||d(`Couldn't retrieve Parser library at ${f}, did you configure the path for it correctly?`),M}createParser(e){var i,n;let r=this.Module.ParserInterface.create(e.args[0]);if(Logger.log(Logger.Level.Debug,`Parser:create returns ${r.type}`,r),r.type==="error")return l(e,r);let o=(n=(i=e.args[0])==null?void 0:i.toString())!=null?n:"",a=l(e,{type:"result",result:o});return this.parsers.set(o,r.result),a}getWasmParserExpectedHash(e,r){return r?e?"d99d17ffe0c1badae0622cfc4050bc9d3f3e297331ebf2b37188f63e435cd267":"a9e18b5fcf4fff1533c6f7349aa510d6cf9b82c1b0c0a456e953da167ed98cca":e?"5190e97f791823af57a8648d1023d6c012721803780045d493675ce19ea5a1ca":"df4a6cbbbea587d8c494601f72424f84320f453e1ae1ce1b5763a29dc2bd1df9"}getWasmParserFileName(e,r){return r?e?"scandit-datacapture-sdk-parser-simd-pthreads.wasm":"scandit-datacapture-sdk-parser-pthreads.wasm":e?"scandit-datacapture-sdk-parser-simd.wasm":"scandit-datacapture-sdk-parser.wasm"}};export{S as a};
1
+ import {b}from'./chunk-BPESVUYM.js';import {Logger,DataCaptureVersion,DataCaptureError}from'@scandit/web-datacapture-core';import {getLibraryLocationURIs}from'@scandit/web-datacapture-core/build/js/private/Helper.js';import {hasSIMDSupport,checkFullMultithreadingSupport}from'@scandit/web-datacapture-core/build/js/private/multithreadSimdHelper.js';import {Deferred}from'@scandit/web-datacapture-core/build/js/private/utils/deferred.js';import {isWorkerScope}from'@scandit/web-datacapture-core/build/js/private/utils/isWorkerScope.js';import {OverrideState}from'@scandit/web-datacapture-core/build/js/worker/OverrideState.js';import {instantiateWebAssembly}from'@scandit/web-datacapture-core/build/js/worker/helper.js';import {setWasmMetadata}from'@scandit/web-datacapture-core/build/js/worker/helperFetch.js';import {importWasmScript}from'@scandit/web-datacapture-core/build/js/worker/importWasmScript.js';var N=s=>s.result!=null&&s.error==null;function l(s,e){return {type:"djinniResult",payload:{id:s.id,className:s.className,methodName:s.methodName,instanceId:s.instanceId,result:e}}}function P(s,e){return {type:"parserLoaderResult",payload:{id:s.id,className:s.className,methodName:s.methodName,result:e}}}function D(s){try{return {type:"result",result:JSON.parse(s)}}catch(e){return {type:"error",error:e}}}var S=class{constructor(e,r){this.parsers=new Map;this.onMessageListener=this.onMessage.bind(this);this.setupPromise=null;this.workerSelf=e,this.moduleHandler=r,isWorkerScope(e)&&(this.workerFunctions={postMessage:this.workerSelf.postMessage.bind(this.workerSelf)},this.listenToMessages()),setWasmMetadata(b);}get Module(){return this.moduleHandler.get()}setLogLevel(e){Logger.setLevel(e.args[0]),this.workerFunctions.postMessage(P(e,{type:"result",result:true}));}async load(e){try{await this.setup(e.args[0]),this.workerFunctions.postMessage(P(e,{type:"result",result:true}));}catch(r){this.workerFunctions.postMessage(P(e,{type:"error",error:r}));}}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",e=>{Logger.log(Logger.Level.Error,e);}),this.workerSelf.addEventListener("messageerror",e=>{Logger.log(Logger.Level.Error,e);});}onMessage(e){return e.data.className==="ParserLoader"&&e.data.methodName==="load"&&this.load(e.data),e.data.className==="ParserLoader"&&e.data.methodName==="setLogLevel"&&this.setLogLevel(e.data),e.data.className==="ParserInterface"&&this.performDjinniAction(e.data),true}async performDjinniAction(e){var i,n;let r;if(Logger.log(Logger.Level.Debug,`${e.className}::${e.methodName}(`,e.args,")"),e.methodName==="create"){let d=e.args[0].toString();if(this.parsers.has(d)){this.workerFunctions.postMessage(l(e,{type:"result",result:d}));return}r=this.createParser(e),Logger.log(Logger.Level.Debug,r),this.workerFunctions.postMessage(r);return}let o=this.parsers.get((i=e.instanceId)!=null?i:"");if(o==null){this.workerFunctions.postMessage(l(e,{type:"error",error:`parser is not defined: try to access instance with id ${(n=e.instanceId)!=null?n:""}`}));return}let a=o[e.methodName](...e.args);N(a)?(e.methodName.endsWith("ToJson")&&typeof a.result=="string"&&(a=D(a.result)),r=l(e,a)):r=l(e,{type:"error",error:a.error}),this.workerFunctions.postMessage(r);}async setup({libraryLocation:e,overrideThreadsSupport:r,overrideSimdSupport:o,verifyResponseHash:a,referredOrigin:i}){if(this.setupPromise!=null)return this.setupPromise;let{resolve:n,reject:d,promise:M}=new Deferred;this.setupPromise=M;let c=DataCaptureVersion.sdkVersion();if(c==="")throw new DataCaptureError({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[m,g]=await Promise.all([hasSIMDSupport(),checkFullMultithreadingSupport()]);r!==OverrideState.Auto&&(g=r===OverrideState.On),o!==OverrideState.Auto&&(m=o===OverrideState.On);let R=getLibraryLocationURIs(c,e,this.getWasmParserFileName(m,g)),{jsURI:f,wasmURI:A}=R;return this.moduleHandler.set({mainScriptUrlOrBlob:f,locateFile:u=>e+u,onMainComplete:()=>{},onRuntimeInitialized:()=>{n();},print:u=>{Logger.log(Logger.Level.Info,u);},instantiateWasm:(u,L)=>(instantiateWebAssembly({importObject:u,wasmURI:A,expectedHash:this.getWasmParserExpectedHash(m,g),verifyResponseHash:a,successCallback:L,progressCallback:()=>{},referredOrigin:i}),{})}),await importWasmScript(f,c)||d(`Couldn't retrieve Parser library at ${f}, did you configure the path for it correctly?`),M}createParser(e){var i,n;let r=this.Module.ParserInterface.create(e.args[0]);if(Logger.log(Logger.Level.Debug,`Parser:create returns ${r.type}`,r),r.type==="error")return l(e,r);let o=(n=(i=e.args[0])==null?void 0:i.toString())!=null?n:"",a=l(e,{type:"result",result:o});return this.parsers.set(o,r.result),a}getWasmParserExpectedHash(e,r){return r?e?"6b46bb9c73303e19622025955860b0d432cd341a3ecf4afd8af98f6eb811531b":"8ef450b765ffd24ce1c0ee75327ad5d302442bdefe9020abcd308a32158d8273":e?"88f53bd9601861b049571dcf427e37dc093aed07c15cedb3c877215e1ffa9bce":"592017ce4d6bb4cf62153047e5da11e90a523643f5e24c568356206954f9193a"}getWasmParserFileName(e,r){return r?e?"scandit-datacapture-sdk-parser-simd-pthreads.wasm":"scandit-datacapture-sdk-parser-pthreads.wasm":e?"scandit-datacapture-sdk-parser-simd.wasm":"scandit-datacapture-sdk-parser.wasm"}};export{S as a};
@@ -1 +1 @@
1
- import {a as a$1}from'./chunk-QKT2OK3K.js';import {a}from'./chunk-XO2EOL4N.js';import {LicensedFeature}from'@scandit/web-datacapture-core/build/js/worker/index.js';var o=class n{constructor(t){this.type="parser";this.settings=new a;this.settings.dataFormat=t;}get id(){return `${this.settings.dataFormat}`}static async forFormat(t,e){let i=t,r=new n(e);if(r.parserProxy=new a$1,!await i.isFeatureSupported(LicensedFeature.Parser))throw new Error("Parser not supported by the current license");return await r.parserProxy.create(e),r}async parseStringToJson(t){return this.parserProxy.parseStringToJson(t)}async setOptions(t){return this.parserProxy.setOptions(t)}toJSONObject(){return {type:this.type,settings:this.settings.toJSONObject()}}};export{o as a};
1
+ import {a as a$1}from'./chunk-GXWHUZH4.js';import {a}from'./chunk-XO2EOL4N.js';import {LicensedFeature}from'@scandit/web-datacapture-core/build/js/worker/index.js';var o=class n{constructor(t){this.type="parser";this.settings=new a;this.settings.dataFormat=t;}get id(){return `${this.settings.dataFormat}`}static async forFormat(t,e){let i=t,r=new n(e);if(r.parserProxy=new a$1,!await i.isFeatureSupported(LicensedFeature.Parser))throw new Error("Parser not supported by the current license");return await r.parserProxy.create(e),r}async parseStringToJson(t){return this.parserProxy.parseStringToJson(t)}async setOptions(t){return this.parserProxy.setOptions(t)}toJSONObject(){return {type:this.type,settings:this.settings.toJSONObject()}}};export{o as a};
package/build/js/index.js CHANGED
@@ -1 +1 @@
1
- export{a as parserLoader}from'./chunks/chunk-E4U457WT.js';export{a as ParserIssueCode}from'./chunks/chunk-U5ZZ3UCW.js';export{a as Parser}from'./chunks/chunk-FKYO7NV2.js';export{a as ParserDataFormat}from'./chunks/chunk-IJVANPAQ.js';
1
+ export{a as parserLoader}from'./chunks/chunk-NEGBKIFV.js';export{a as ParserIssueCode}from'./chunks/chunk-U5ZZ3UCW.js';export{a as Parser}from'./chunks/chunk-XDTUDCET.js';export{a as ParserDataFormat}from'./chunks/chunk-IJVANPAQ.js';
@@ -1 +1 @@
1
- export{a as parserLoader}from'./chunks/chunk-E4U457WT.js';
1
+ export{a as parserLoader}from'./chunks/chunk-NEGBKIFV.js';
@@ -1 +1 @@
1
- export{a as Parser}from'../chunks/chunk-FKYO7NV2.js';
1
+ export{a as Parser}from'../chunks/chunk-XDTUDCET.js';
@@ -1 +1 @@
1
- export{a as ParserIssueCode}from'../chunks/chunk-U5ZZ3UCW.js';export{a as Parser}from'../chunks/chunk-FKYO7NV2.js';export{a as ParserDataFormat}from'../chunks/chunk-IJVANPAQ.js';
1
+ export{a as ParserIssueCode}from'../chunks/chunk-U5ZZ3UCW.js';export{a as Parser}from'../chunks/chunk-XDTUDCET.js';export{a as ParserDataFormat}from'../chunks/chunk-IJVANPAQ.js';
@@ -1 +1 @@
1
- export{a as ParserInterfaceProxy}from'../../chunks/chunk-QKT2OK3K.js';
1
+ export{a as ParserInterfaceProxy}from'../../chunks/chunk-GXWHUZH4.js';
@@ -1 +1 @@
1
- export{a as ParserLoader}from'../../chunks/chunk-VW6JMWA6.js';
1
+ export{a as ParserLoader}from'../../chunks/chunk-M25LBFN7.js';
@@ -1 +1 @@
1
- export{a as ParserComponent}from'../chunks/chunk-SE3EA2O5.js';
1
+ export{a as ParserComponent}from'../chunks/chunk-RWIG3REQ.js';
@@ -1 +1 @@
1
- import {a}from'../chunks/chunk-SE3EA2O5.js';new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function s(e){}export{s as InlineWorker};
1
+ import {a}from'../chunks/chunk-RWIG3REQ.js';new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function s(e){}export{s as InlineWorker};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scandit/web-datacapture-parser",
3
- "version": "8.0.0-beta.2",
3
+ "version": "8.0.1",
4
4
  "description": "Scandit Data Capture SDK for the Web",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "sideEffects": false,
@@ -94,7 +94,7 @@
94
94
  },
95
95
  "peerDependencies": {
96
96
  "@scandit/web-datacapture-barcode": "*",
97
- "@scandit/web-datacapture-core": "8.0.0-beta.2"
97
+ "@scandit/web-datacapture-core": "8.0.1"
98
98
  },
99
99
  "dependencies": {
100
100
  "@types/emscripten": "1.40.1"