@scandit/web-datacapture-core 8.1.0 → 8.2.0-beta.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 (262) hide show
  1. package/LICENSE +1 -1
  2. package/build/js/Camera.js +1 -1
  3. package/build/js/{DataCaptureContext-fzPdCXUX.d.ts → DataCaptureContext-COl4JuSo.d.ts} +319 -214
  4. package/build/js/DataCaptureContext.d.ts +7 -7
  5. package/build/js/DataCaptureContext.js +1 -1
  6. package/build/js/DataCaptureContextRelated.d.ts +9 -9
  7. package/build/js/DataCaptureVersion.js +1 -1
  8. package/build/js/DataCaptureView.d.ts +7 -7
  9. package/build/js/DataCaptureView.js +1 -1
  10. package/build/js/Feedback.js +1 -1
  11. package/build/js/FrameData.d.ts +8 -8
  12. package/build/js/FrameData.js +1 -1
  13. package/build/js/ImageFrameSource.js +1 -1
  14. package/build/js/NotificationPresenter/index.d.ts +4 -4
  15. package/build/js/NotificationPresenter/private/ConcreteNotificationPresenter.d.ts +4 -4
  16. package/build/js/NotificationPresenter/private/presets.d.ts +8 -8
  17. package/build/js/ScanditIcon.d.ts +1 -1
  18. package/build/js/ScanditIcon.js +1 -1
  19. package/build/js/ScanditIconBuilder.d.ts +2 -1
  20. package/build/js/ScanditIconBuilder.js +1 -1
  21. package/build/js/Vibration.js +1 -1
  22. package/build/js/browserHelper.d.ts +8 -1
  23. package/build/js/browserHelper.js +1 -1
  24. package/build/js/chunks/{chunk-UQVVJP5Z.js → chunk-2OCDIZIS.js} +1 -1
  25. package/build/js/chunks/chunk-3A7LM5JG.js +1 -0
  26. package/build/js/chunks/chunk-3DUIJMFT.js +1 -0
  27. package/build/js/chunks/chunk-3MKSI2DV.js +1 -0
  28. package/build/js/chunks/{chunk-GJBUPJIM.js → chunk-4DNKMVCD.js} +1 -1
  29. package/build/js/chunks/{chunk-X2ZGBI4S.js → chunk-5DYRW7WM.js} +1 -1
  30. package/build/js/chunks/chunk-5JVQUPEF.js +2 -0
  31. package/build/js/chunks/chunk-6DTJIONB.js +1 -0
  32. package/build/js/chunks/chunk-6EEMWSEO.js +1 -0
  33. package/build/js/chunks/{chunk-RL4LGOQS.js → chunk-6IWAI6XT.js} +1 -1
  34. package/build/js/chunks/chunk-6OKFTR6P.js +1 -0
  35. package/build/js/chunks/{chunk-J6LCRGZO.js → chunk-7HYFN4JO.js} +1 -1
  36. package/build/js/chunks/{chunk-O7QIRKOP.js → chunk-7OFC24NE.js} +1 -1
  37. package/build/js/chunks/chunk-AAEQZ45T.js +1 -0
  38. package/build/js/chunks/chunk-BD2C4EUH.js +1 -0
  39. package/build/js/chunks/chunk-CAUB35PV.js +1 -0
  40. package/build/js/chunks/chunk-CGZTKEVQ.js +1 -0
  41. package/build/js/chunks/chunk-CMOH3SZ2.js +1 -0
  42. package/build/js/chunks/chunk-DGIQ3GF7.js +1 -0
  43. package/build/js/chunks/chunk-DJSMVDVM.js +1 -0
  44. package/build/js/chunks/chunk-DN32UPQC.js +1 -0
  45. package/build/js/chunks/chunk-EMLXDXWN.js +1 -0
  46. package/build/js/chunks/chunk-GQ7A6533.js +1 -0
  47. package/build/js/chunks/chunk-HBRR74H7.js +1 -0
  48. package/build/js/chunks/chunk-HQFHOI5U.js +1 -0
  49. package/build/js/chunks/chunk-JIGCOX5J.js +1 -0
  50. package/build/js/chunks/chunk-K57UYTCR.js +6 -0
  51. package/build/js/chunks/chunk-KE4OXEHM.js +1 -0
  52. package/build/js/chunks/{chunk-4F5JUHOJ.js → chunk-KSCFPJAW.js} +1 -1
  53. package/build/js/chunks/{chunk-W6HSMZGZ.js → chunk-KVRNF3VA.js} +1 -1
  54. package/build/js/chunks/chunk-KXAJHLEO.js +1 -0
  55. package/build/js/chunks/chunk-M73IKBDO.js +1 -0
  56. package/build/js/chunks/{chunk-C657OBED.js → chunk-MKOAX27U.js} +1 -1
  57. package/build/js/chunks/{chunk-Q45KFJIS.js → chunk-MUUHAY6N.js} +1 -1
  58. package/build/js/chunks/{chunk-24IG7HUA.js → chunk-O4HDBWKK.js} +1 -1
  59. package/build/js/chunks/chunk-O7EM4VIM.js +1 -0
  60. package/build/js/chunks/chunk-PJDP6LOG.js +35 -0
  61. package/build/js/chunks/chunk-PM5CNTBV.js +1 -0
  62. package/build/js/chunks/chunk-QFSNPY5Y.js +1 -0
  63. package/build/js/chunks/{chunk-3LVMEVOI.js → chunk-QIWPWOQG.js} +1 -1
  64. package/build/js/chunks/{chunk-BIJB4K7G.js → chunk-QUWP3ILW.js} +1 -1
  65. package/build/js/chunks/{chunk-AFCJ24Y3.js → chunk-QYTZLT3L.js} +1 -1
  66. package/build/js/chunks/{chunk-D6JKW7G4.js → chunk-RP4YFAF2.js} +1 -1
  67. package/build/js/chunks/{chunk-BGUY24J4.js → chunk-RZ45ODIK.js} +1 -1
  68. package/build/js/chunks/{chunk-457L5N2F.js → chunk-SAMF6XBX.js} +1 -1
  69. package/build/js/chunks/{chunk-BFLBICOJ.js → chunk-TGOZ2BNY.js} +1 -1
  70. package/build/js/chunks/chunk-TTGJAMI2.js +1 -0
  71. package/build/js/chunks/{chunk-523EQN4Z.js → chunk-U7ETOWGJ.js} +1 -1
  72. package/build/js/chunks/{chunk-L7WVCDGR.js → chunk-UB4YB6TK.js} +1 -1
  73. package/build/js/chunks/chunk-UWVAZAFS.js +2 -0
  74. package/build/js/chunks/{chunk-RHMGLXJ3.js → chunk-V2OKMBZD.js} +1 -1
  75. package/build/js/chunks/{chunk-TXVFFRVY.js → chunk-VJ7ZYB4V.js} +1 -1
  76. package/build/js/chunks/chunk-VSROWPI6.js +1 -0
  77. package/build/js/chunks/chunk-W33RVR5M.js +1 -0
  78. package/build/js/chunks/chunk-X3GOCLVQ.js +1 -0
  79. package/build/js/chunks/{chunk-4JH6EEAE.js → chunk-XIAF6V7E.js} +1 -1
  80. package/build/js/chunks/{chunk-LORGLY2X.js → chunk-YE2GYNRP.js} +1 -1
  81. package/build/js/controls/CameraFOVSwitchControl.d.ts +8 -8
  82. package/build/js/controls/CameraFOVSwitchControl.js +1 -1
  83. package/build/js/controls/CameraSwitchControl.d.ts +8 -8
  84. package/build/js/controls/CameraSwitchControl.js +1 -1
  85. package/build/js/controls/TorchSwitchControl.d.ts +8 -8
  86. package/build/js/controls/TorchSwitchControl.js +1 -1
  87. package/build/js/controls/common.d.ts +8 -8
  88. package/build/js/controls/index.d.ts +8 -8
  89. package/build/js/controls/index.js +1 -1
  90. package/build/js/defaults/DefaultsCamera.d.ts +30 -0
  91. package/build/js/defaults/DefaultsDataCaptureView.js +1 -1
  92. package/build/js/index.d.ts +15 -15
  93. package/build/js/index.js +1 -1
  94. package/build/js/moduleLoader.d.ts +8 -8
  95. package/build/js/private/CameraAccess.js +1 -1
  96. package/build/js/private/CameraManager.d.ts +10 -10
  97. package/build/js/private/CameraManager.js +1 -1
  98. package/build/js/private/CameraPool.d.ts +7 -7
  99. package/build/js/private/CanvasDrawer.d.ts +1 -1
  100. package/build/js/private/CanvasDrawer.js +1 -1
  101. package/build/js/private/CanvasDrawerWithMetrics.d.ts +21 -13
  102. package/build/js/private/CanvasDrawerWithMetrics.js +1 -1
  103. package/build/js/private/CoreModuleLicenseTextProvider.d.ts +8 -8
  104. package/build/js/private/CoreModuleLicenseTextProvider.js +1 -1
  105. package/build/js/private/CustomLocationsView.js +1 -1
  106. package/build/js/private/DataCaptureContextRelated.d.ts +8 -8
  107. package/build/js/private/FrameReaders/FrameReader.d.ts +8 -8
  108. package/build/js/private/FrameReaders/FrameReader.js +1 -1
  109. package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +8 -8
  110. package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +8 -8
  111. package/build/js/private/FrameReaders/GrayScaleFrameReader.js +1 -1
  112. package/build/js/private/FrameReaders/index.d.ts +8 -8
  113. package/build/js/private/FrameReaders/index.js +1 -1
  114. package/build/js/private/GestureRecognizer/GestureRecognizer.js +1 -1
  115. package/build/js/private/GestureRecognizer/PointerEventsDetector.d.ts +1 -1
  116. package/build/js/private/GestureRecognizer/PointerEventsDetector.js +1 -1
  117. package/build/js/private/GestureRecognizer/index.js +1 -1
  118. package/build/js/private/ImageConverterBase.d.ts +2 -1
  119. package/build/js/private/ImageConverterBase.js +1 -1
  120. package/build/js/private/ImageConverterMainThread.js +1 -1
  121. package/build/js/private/NormalizedModuleLoaderOptions.d.ts +8 -8
  122. package/build/js/private/OrientationObserver.js +1 -1
  123. package/build/js/private/SingleImageUploaderView.d.ts +35 -0
  124. package/build/js/private/SingleImageUploaderView.js +1 -1
  125. package/build/js/private/ViewControls+related.js +1 -1
  126. package/build/js/private/ViewControls_related.d.ts +8 -8
  127. package/build/js/private/ViewsRegistry.d.ts +8 -8
  128. package/build/js/private/djinni-types/index.d.ts +10 -1
  129. package/build/js/private/djinni-types/index.js +1 -1
  130. package/build/js/private/hybridDesktopPlatformHelpers.js +1 -1
  131. package/build/js/private/ui/atoms/AimerSvgIcon.js +1 -1
  132. package/build/js/private/ui/atoms/ArrowDownSvgIcon.js +1 -1
  133. package/build/js/private/ui/atoms/ArrowLeftSvgIcon.js +1 -1
  134. package/build/js/private/ui/atoms/ArrowRightSvgIcon.js +1 -1
  135. package/build/js/private/ui/atoms/ArrowUpSvgIcon.js +1 -1
  136. package/build/js/private/ui/atoms/ArrowsUp.js +1 -1
  137. package/build/js/private/ui/atoms/Backdrop.d.ts +1 -1
  138. package/build/js/private/ui/atoms/Backdrop.js +1 -1
  139. package/build/js/private/ui/atoms/CalendarExclamationMarkSvgIcon.js +1 -1
  140. package/build/js/private/ui/atoms/CameraFOVUltrawideSvgIcon.js +1 -1
  141. package/build/js/private/ui/atoms/CameraFOVWideSvgIcon.js +1 -1
  142. package/build/js/private/ui/atoms/CameraSwitchReverseSvgIcon.js +1 -1
  143. package/build/js/private/ui/atoms/CameraSwitchSvgIcon.js +1 -1
  144. package/build/js/private/ui/atoms/Card.js +1 -1
  145. package/build/js/private/ui/atoms/CardList.js +1 -1
  146. package/build/js/private/ui/atoms/CheckSvgIcon.js +1 -1
  147. package/build/js/private/ui/atoms/ChevronDownSvgIcon.js +1 -1
  148. package/build/js/private/ui/atoms/ChevronLeftSvgIcon.js +1 -1
  149. package/build/js/private/ui/atoms/ChevronRightSvgIcon.js +1 -1
  150. package/build/js/private/ui/atoms/ChevronUpSvgIcon.js +1 -1
  151. package/build/js/private/ui/atoms/CrossSvgIcon.js +1 -1
  152. package/build/js/private/ui/atoms/DeleteSvgIcon.js +1 -1
  153. package/build/js/private/ui/atoms/Dot5xSvgIcon.js +1 -1
  154. package/build/js/private/ui/atoms/ExclamationMarkSvgIcon.js +1 -1
  155. package/build/js/private/ui/atoms/GlassSvgIcon.d.ts +1 -1
  156. package/build/js/private/ui/atoms/GlassSvgIcon.js +1 -1
  157. package/build/js/private/ui/atoms/HandLensCheckSvgIcon.js +1 -1
  158. package/build/js/private/ui/atoms/KeyboardSvgIcon.js +1 -1
  159. package/build/js/private/ui/atoms/LowStockSvgIcon.js +1 -1
  160. package/build/js/private/ui/atoms/OnexSvgIcon.js +1 -1
  161. package/build/js/private/ui/atoms/PauseSvgIcon.d.ts +17 -0
  162. package/build/js/private/ui/atoms/PauseSvgIcon.js +1 -0
  163. package/build/js/private/ui/atoms/PrinterSvgIcon.js +1 -1
  164. package/build/js/private/ui/atoms/ProgressBar.js +1 -1
  165. package/build/js/private/ui/atoms/QuestionMarkSvgIcon.d.ts +1 -1
  166. package/build/js/private/ui/atoms/QuestionMarkSvgIcon.js +1 -1
  167. package/build/js/private/ui/atoms/RestartSvgIcon.js +1 -1
  168. package/build/js/private/ui/atoms/RoundedCheckSvgIcon.js +1 -1
  169. package/build/js/private/ui/atoms/RoundedCrossSvgIcon.js +1 -1
  170. package/build/js/private/ui/atoms/RoundedExclamationMarkSvgIcon.js +1 -1
  171. package/build/js/private/ui/atoms/ScanSvgIcon.d.ts +17 -0
  172. package/build/js/private/ui/atoms/ScanSvgIcon.js +1 -0
  173. package/build/js/private/ui/atoms/ShutterButton.js +1 -1
  174. package/build/js/private/ui/atoms/SlashSvgIcon.js +1 -1
  175. package/build/js/private/ui/atoms/StarFilledSvgIcon.js +1 -1
  176. package/build/js/private/ui/atoms/StarHalfFilledSvgIcon.js +1 -1
  177. package/build/js/private/ui/atoms/StarOutlinedSvgIcon.js +1 -1
  178. package/build/js/private/ui/atoms/SvgIcon.d.ts +1 -0
  179. package/build/js/private/ui/atoms/SvgIcon.js +1 -1
  180. package/build/js/private/ui/atoms/ToPickSvgIcon.js +1 -1
  181. package/build/js/private/ui/atoms/Toast.d.ts +9 -14
  182. package/build/js/private/ui/atoms/Toast.js +1 -1
  183. package/build/js/private/ui/atoms/TorchOffSvgIcon.js +1 -1
  184. package/build/js/private/ui/atoms/TorchOnSvgIcon.js +1 -1
  185. package/build/js/private/ui/atoms/TwoxSvgIcon.js +1 -1
  186. package/build/js/private/ui/atoms/WrongItemSvgIcon.js +1 -1
  187. package/build/js/private/ui/colors.d.ts +5 -1
  188. package/build/js/private/ui/colors.js +1 -1
  189. package/build/js/private/ui/molecules/CameraFOVSwitchButton.js +1 -1
  190. package/build/js/private/ui/molecules/CameraSwitchButton.js +1 -1
  191. package/build/js/private/ui/molecules/ControlsLayout.js +1 -1
  192. package/build/js/private/ui/molecules/HintPresenter.d.ts +7 -7
  193. package/build/js/private/ui/molecules/HintPresenter.js +1 -1
  194. package/build/js/private/ui/molecules/LoadingOverlay.js +1 -1
  195. package/build/js/private/ui/molecules/TorchSwitchIconButton.js +1 -1
  196. package/build/js/private/utils/cookieStore.d.ts +18 -0
  197. package/build/js/private/utils/cookieStore.js +1 -0
  198. package/build/js/private/utils/cookieStorePolyfill.d.ts +43 -0
  199. package/build/js/private/utils/cookieStorePolyfill.js +1 -0
  200. package/build/js/private/utils/fromGrayScaleToRgba.d.ts +12 -0
  201. package/build/js/private/utils/fromGrayScaleToRgba.js +1 -0
  202. package/build/js/private/utils/getTimestamp.d.ts +9 -0
  203. package/build/js/private/utils/getTimestamp.js +1 -0
  204. package/build/js/private/utils/globalThisPolyfill.d.ts +2 -2
  205. package/build/js/private/utils/globalThisPolyfill.js +1 -1
  206. package/build/js/private/utils/index.js +1 -1
  207. package/build/js/private/utils/polyfillLoader.d.ts +2 -0
  208. package/build/js/private/utils/polyfillLoader.js +1 -1
  209. package/build/js/private/utils/replaceImagesInViewUtils.d.ts +8 -8
  210. package/build/js/private/utils/safeStorage.d.ts +4 -3
  211. package/build/js/private/utils/safeStorage.js +1 -1
  212. package/build/js/private/utils/warnMultithreadingUnavailable.js +1 -1
  213. package/build/js/worker/ImageConverterForwarder.d.ts +10 -9
  214. package/build/js/worker/ImageConverterForwarder.js +1 -1
  215. package/build/js/worker/ImageConverterWorker.js +1 -1
  216. package/build/js/worker/ViewInfoHelper.d.ts +47 -0
  217. package/build/js/worker/ViewInfoHelper.js +1 -0
  218. package/build/js/worker/WorkerMain.d.ts +8 -8
  219. package/build/js/worker/WorkerMain.js +1 -1
  220. package/build/js/worker/coreCapture.inlineWorker.d.ts +8 -8
  221. package/build/js/worker/coreCapture.inlineWorker.js +1 -1
  222. package/build/js/worker/dataCaptureEngine.d.ts +7 -7
  223. package/build/js/worker/dataCaptureEngine.js +1 -1
  224. package/build/js/worker/dataCaptureLoader.d.ts +9 -9
  225. package/build/js/worker/dataCaptureLoader.js +1 -1
  226. package/build/js/worker/dataCaptureWorkerRelated.d.ts +7 -7
  227. package/build/js/worker/helperFs.js +1 -1
  228. package/build/js/worker/index.d.ts +8 -8
  229. package/build/js/worker/index.js +1 -1
  230. package/package.json +4 -6
  231. package/build/js/chunks/chunk-4GKVQAVF.js +0 -1
  232. package/build/js/chunks/chunk-4ZAHOKYN.js +0 -1
  233. package/build/js/chunks/chunk-5C4OO6CX.js +0 -35
  234. package/build/js/chunks/chunk-5IGOKD23.js +0 -1
  235. package/build/js/chunks/chunk-5JAPQHXF.js +0 -1
  236. package/build/js/chunks/chunk-ADFFBLII.js +0 -1
  237. package/build/js/chunks/chunk-ATTDETQP.js +0 -0
  238. package/build/js/chunks/chunk-AWPUSRYW.js +0 -1
  239. package/build/js/chunks/chunk-BG2MAWWN.js +0 -1
  240. package/build/js/chunks/chunk-C3EY6I75.js +0 -2
  241. package/build/js/chunks/chunk-DMOXDUF6.js +0 -1
  242. package/build/js/chunks/chunk-DQ2IFWM5.js +0 -1
  243. package/build/js/chunks/chunk-DZKZ6RMW.js +0 -1
  244. package/build/js/chunks/chunk-F2IJCZAS.js +0 -1
  245. package/build/js/chunks/chunk-F6TT5US7.js +0 -1
  246. package/build/js/chunks/chunk-GHDJPETZ.js +0 -1
  247. package/build/js/chunks/chunk-MBL5Q2H2.js +0 -1
  248. package/build/js/chunks/chunk-MKTACV3Q.js +0 -1
  249. package/build/js/chunks/chunk-NDQQHCZN.js +0 -1
  250. package/build/js/chunks/chunk-PA2BMEFD.js +0 -1
  251. package/build/js/chunks/chunk-R4KME2DS.js +0 -6
  252. package/build/js/chunks/chunk-SOCEWYYO.js +0 -1
  253. package/build/js/chunks/chunk-SVJ6BU5X.js +0 -1
  254. package/build/js/chunks/chunk-TU44BW74.js +0 -1
  255. package/build/js/chunks/chunk-V6RG452U.js +0 -1
  256. package/build/js/chunks/chunk-VBUDN72N.js +0 -2
  257. package/build/js/chunks/chunk-WL2XKPJD.js +0 -1
  258. package/build/js/chunks/chunk-X4LJRWLI.js +0 -1
  259. package/build/js/chunks/chunk-XINFYUZW.js +0 -1
  260. package/build/js/chunks/chunk-YRQ34YNY.js +0 -1
  261. package/build/js/chunks/chunk-ZEBGTTCX.js +0 -1
  262. /package/build/js/chunks/{chunk-3CXYB36D.js → chunk-6XU4Z34Q.js} +0 -0
@@ -0,0 +1,47 @@
1
+ /// <reference types="emscripten" />
2
+ import { V as ViewInfo } from '../DataCaptureContext-COl4JuSo.js';
3
+ import '../Camera-DhGjpcjv.js';
4
+ import '../commons/Rect.js';
5
+ import '../private/Serializable.js';
6
+ import '../commons/Point.js';
7
+ import '../commons/Size.js';
8
+ import '../private/privateAccess.js';
9
+ import '../DataCaptureContextSettings.js';
10
+ import '../commons/JSONType.js';
11
+ import '../DataCaptureViewPlusRelated.js';
12
+ import '../NotificationPresenter/NotificationPresenter.js';
13
+ import '../NotificationPresenter/NotificationConfiguration.js';
14
+ import '../commons/Color.js';
15
+ import '../ScanditIcon.js';
16
+ import '../private/utils/ScanditHTMLElement.js';
17
+ import '../NotificationPresenter/NotificationStyle.js';
18
+ import '../commons/Anchor.js';
19
+ import '../commons/MarginsWithUnit.js';
20
+ import '../commons/NumberWithUnit.js';
21
+ import '../commons/MeasureUnit.js';
22
+ import '../commons/Orientation.js';
23
+ import '../commons/PointWithUnit.js';
24
+ import '../commons/Quadrilateral.js';
25
+ import '../private/CustomLocationsView.js';
26
+ import '../private/View.js';
27
+ import '../private/AnchorPositions.js';
28
+ import '../private/nativeHandle.js';
29
+ import '../license/OpenSourceSoftwareLicenseInfo.js';
30
+ import '../logger.js';
31
+ import '../private/FrameReaders/ColorType.js';
32
+ import '../LoadingStatus.js';
33
+ import '../private/djinni-types/index.js';
34
+ import '../private/HtmlElementState.js';
35
+ import '../commons/SizeWithUnit.js';
36
+ import '../private/utils/AsyncStateMachine.js';
37
+ import '../tsHelper.js';
38
+
39
+ declare class ViewInfoHelper {
40
+ private viewInfo;
41
+ constructor(viewInfo: ViewInfo | null);
42
+ isSame(other: ViewInfo | null): boolean;
43
+ update(viewInfo: ViewInfo | null): void;
44
+ private cloneViewInfo;
45
+ }
46
+
47
+ export { ViewInfoHelper };
@@ -0,0 +1 @@
1
+ export{a as ViewInfoHelper}from'../chunks/chunk-GQ7A6533.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { J as DataCaptureEngine, K as Module, O as AnyDataCaptureActionMessage, Q as AugmentedWorker, R as ModuleHandler, S as DataCaptureCallbackMessage, T as DataCaptureActionMessageKey, U as EngineWorkerResponse } from '../DataCaptureContext-fzPdCXUX.js';
2
+ import { K as DataCaptureEngine, L as Module, Q as AnyDataCaptureActionMessage, R as AugmentedWorker, S as ModuleHandler, T as DataCaptureCallbackMessage, U as DataCaptureActionMessageKey, X as EngineWorkerResponse } from '../DataCaptureContext-COl4JuSo.js';
3
3
  import '../Camera-DhGjpcjv.js';
4
4
  import '../commons/Rect.js';
5
5
  import '../private/Serializable.js';
@@ -8,13 +8,6 @@ import '../commons/Size.js';
8
8
  import '../private/privateAccess.js';
9
9
  import '../DataCaptureContextSettings.js';
10
10
  import '../commons/JSONType.js';
11
- import '../commons/MarginsWithUnit.js';
12
- import '../commons/NumberWithUnit.js';
13
- import '../commons/MeasureUnit.js';
14
- import '../commons/PointWithUnit.js';
15
- import '../commons/Anchor.js';
16
- import '../commons/Orientation.js';
17
- import '../commons/Quadrilateral.js';
18
11
  import '../DataCaptureViewPlusRelated.js';
19
12
  import '../NotificationPresenter/NotificationPresenter.js';
20
13
  import '../NotificationPresenter/NotificationConfiguration.js';
@@ -22,6 +15,13 @@ import '../commons/Color.js';
22
15
  import '../ScanditIcon.js';
23
16
  import '../private/utils/ScanditHTMLElement.js';
24
17
  import '../NotificationPresenter/NotificationStyle.js';
18
+ import '../commons/Anchor.js';
19
+ import '../commons/MarginsWithUnit.js';
20
+ import '../commons/NumberWithUnit.js';
21
+ import '../commons/MeasureUnit.js';
22
+ import '../commons/Orientation.js';
23
+ import '../commons/PointWithUnit.js';
24
+ import '../commons/Quadrilateral.js';
25
25
  import '../private/CustomLocationsView.js';
26
26
  import '../private/View.js';
27
27
  import '../private/AnchorPositions.js';
@@ -1 +1 @@
1
- export{a as WorkerMain}from'../chunks/chunk-BGUY24J4.js';
1
+ export{a as WorkerMain}from'../chunks/chunk-RZ45ODIK.js';
@@ -1,5 +1,5 @@
1
1
  /// <reference types="emscripten" />
2
- import { J as DataCaptureEngine, K as Module } from '../DataCaptureContext-fzPdCXUX.js';
2
+ import { K as DataCaptureEngine, L as Module } from '../DataCaptureContext-COl4JuSo.js';
3
3
  import { WorkerMain } from './WorkerMain.js';
4
4
  import '../Camera-DhGjpcjv.js';
5
5
  import '../commons/Rect.js';
@@ -9,13 +9,6 @@ import '../commons/Size.js';
9
9
  import '../private/privateAccess.js';
10
10
  import '../DataCaptureContextSettings.js';
11
11
  import '../commons/JSONType.js';
12
- import '../commons/MarginsWithUnit.js';
13
- import '../commons/NumberWithUnit.js';
14
- import '../commons/MeasureUnit.js';
15
- import '../commons/PointWithUnit.js';
16
- import '../commons/Anchor.js';
17
- import '../commons/Orientation.js';
18
- import '../commons/Quadrilateral.js';
19
12
  import '../DataCaptureViewPlusRelated.js';
20
13
  import '../NotificationPresenter/NotificationPresenter.js';
21
14
  import '../NotificationPresenter/NotificationConfiguration.js';
@@ -23,6 +16,13 @@ import '../commons/Color.js';
23
16
  import '../ScanditIcon.js';
24
17
  import '../private/utils/ScanditHTMLElement.js';
25
18
  import '../NotificationPresenter/NotificationStyle.js';
19
+ import '../commons/Anchor.js';
20
+ import '../commons/MarginsWithUnit.js';
21
+ import '../commons/NumberWithUnit.js';
22
+ import '../commons/MeasureUnit.js';
23
+ import '../commons/Orientation.js';
24
+ import '../commons/PointWithUnit.js';
25
+ import '../commons/Quadrilateral.js';
26
26
  import '../private/CustomLocationsView.js';
27
27
  import '../private/View.js';
28
28
  import '../private/AnchorPositions.js';
@@ -1 +1 @@
1
- export{b as InlineWorker,a as workerInstance}from'../chunks/chunk-AWPUSRYW.js';
1
+ export{b as InlineWorker,a as workerInstance}from'../chunks/chunk-KE4OXEHM.js';
@@ -2,7 +2,7 @@
2
2
  import '../LoadingStatus.js';
3
3
  import '../commons/Point.js';
4
4
  import '../commons/Orientation.js';
5
- export { b6 as CreateContextParameters, J as DataCaptureEngine, b5 as LoadLibraryParameters, b9 as ProcessFrameParameters, ba as ReportCameraPropertiesParameters, b8 as SetFrameSourceParameters, b7 as UpdateContextParameters, W as WorkerFunctions } from '../DataCaptureContext-fzPdCXUX.js';
5
+ export { b9 as CreateContextParameters, K as DataCaptureEngine, b8 as LoadLibraryParameters, bc as ProcessFrameParameters, bd as ReportCameraPropertiesParameters, bb as SetFrameSourceParameters, ba as UpdateContextParameters, W as WorkerFunctions } from '../DataCaptureContext-COl4JuSo.js';
6
6
  import '../ScanditIcon.js';
7
7
  import '../private/FrameReaders/ColorType.js';
8
8
  import '../private/djinni-types/index.js';
@@ -13,18 +13,18 @@ import '../commons/Size.js';
13
13
  import '../private/privateAccess.js';
14
14
  import '../DataCaptureContextSettings.js';
15
15
  import '../commons/JSONType.js';
16
- import '../commons/MarginsWithUnit.js';
17
- import '../commons/NumberWithUnit.js';
18
- import '../commons/MeasureUnit.js';
19
- import '../commons/PointWithUnit.js';
20
- import '../commons/Anchor.js';
21
- import '../commons/Quadrilateral.js';
22
16
  import '../DataCaptureViewPlusRelated.js';
23
17
  import '../NotificationPresenter/NotificationPresenter.js';
24
18
  import '../NotificationPresenter/NotificationConfiguration.js';
25
19
  import '../commons/Color.js';
26
20
  import '../NotificationPresenter/NotificationStyle.js';
27
21
  import '../private/utils/ScanditHTMLElement.js';
22
+ import '../commons/Anchor.js';
23
+ import '../commons/MarginsWithUnit.js';
24
+ import '../commons/NumberWithUnit.js';
25
+ import '../commons/MeasureUnit.js';
26
+ import '../commons/PointWithUnit.js';
27
+ import '../commons/Quadrilateral.js';
28
28
  import '../private/CustomLocationsView.js';
29
29
  import '../private/View.js';
30
30
  import '../private/AnchorPositions.js';
@@ -1 +1 @@
1
- export{a as DataCaptureEngine}from'../chunks/chunk-DQ2IFWM5.js';
1
+ export{a as DataCaptureEngine}from'../chunks/chunk-BD2C4EUH.js';
@@ -1,8 +1,8 @@
1
1
  /// <reference types="emscripten" />
2
- export { G as DataCaptureLoader, E as DataCaptureLoaderOptions } from '../DataCaptureContext-fzPdCXUX.js';
2
+ export { G as DataCaptureLoader, E as DataCaptureLoaderOptions } from '../DataCaptureContext-COl4JuSo.js';
3
3
  import '../LoadingStatus.js';
4
- import '../ScanditIcon.js';
5
4
  import '../logger.js';
5
+ import '../ScanditIcon.js';
6
6
  import '../Camera-DhGjpcjv.js';
7
7
  import '../commons/Rect.js';
8
8
  import '../private/Serializable.js';
@@ -11,19 +11,19 @@ import '../commons/Size.js';
11
11
  import '../private/privateAccess.js';
12
12
  import '../DataCaptureContextSettings.js';
13
13
  import '../commons/JSONType.js';
14
- import '../commons/MarginsWithUnit.js';
15
- import '../commons/NumberWithUnit.js';
16
- import '../commons/MeasureUnit.js';
17
- import '../commons/PointWithUnit.js';
18
- import '../commons/Anchor.js';
19
- import '../commons/Orientation.js';
20
- import '../commons/Quadrilateral.js';
21
14
  import '../DataCaptureViewPlusRelated.js';
22
15
  import '../NotificationPresenter/NotificationPresenter.js';
23
16
  import '../NotificationPresenter/NotificationConfiguration.js';
24
17
  import '../commons/Color.js';
25
18
  import '../NotificationPresenter/NotificationStyle.js';
26
19
  import '../private/utils/ScanditHTMLElement.js';
20
+ import '../commons/Anchor.js';
21
+ import '../commons/MarginsWithUnit.js';
22
+ import '../commons/NumberWithUnit.js';
23
+ import '../commons/MeasureUnit.js';
24
+ import '../commons/Orientation.js';
25
+ import '../commons/PointWithUnit.js';
26
+ import '../commons/Quadrilateral.js';
27
27
  import '../private/CustomLocationsView.js';
28
28
  import '../private/View.js';
29
29
  import '../private/AnchorPositions.js';
@@ -1 +1 @@
1
- export{a as DataCaptureLoader}from'../chunks/chunk-MBL5Q2H2.js';
1
+ export{a as DataCaptureLoader}from'../chunks/chunk-HQFHOI5U.js';
@@ -2,7 +2,7 @@
2
2
  import '../commons/Orientation.js';
3
3
  import '../commons/Point.js';
4
4
  import '../commons/Rect.js';
5
- export { aj as AddNativeOverlayAction, O as AnyDataCaptureActionMessage, Q as AugmentedWorker, aN as CaptureModeDeserializerInstance, a1 as ConvertToJPEGResultDataCaptureAction, a2 as CreateContextDataCaptureAction, T as DataCaptureActionMessageKey, S as DataCaptureCallbackMessage, al as DataCaptureCallbackMessageKeys, aF as DataCaptureContext, aM as DataCaptureContextDeserializer, aL as DataCaptureContextDeserializerResult, aG as DataCaptureImageBufferFrameSource, aJ as DataCaptureView, aD as DataCaptureWorker, a6 as DeleteFrameDataDataCaptureAction, as as DidTapTrackedBarcode, aa as DisposeDataCaptureAction, aE as EmscriptenClassHandle, U as EngineWorkerResponse, ae as ExtractCentaurusLicenseDataCaptureAction, V as ExtractCentaurusLicenseResponse, ab as FlushAnalyticsDataCaptureAction, L as GenericHint, aH as GestureListener, aI as GestureRecognizer, ai as GetOpenSourceSoftwareLicenseInfoAction, _ as GetOpenSourceSoftwareLicenseInfoResponse, Z as GetViewfinderInfo, ah as GetViewfinderInfoAction, a$ as GuidanceHint, aZ as GuidanceHintAnchor, a_ as GuidanceHintStyle, az as HideGuidanceMessage, aq as HideHintWorkerMessage, ax as HideToastMessage, aX as HintAnchor, aV as HintCornerStyle, aR as HintFont, aU as HintHeight, aW as HintIcon, b3 as HintPresenterV2, ag as HintPresenterV2updateAction, aY as HintStyle, aS as HintTextAlignment, aT as HintWidth, a8 as IsFeatureSupportedAction, ap as IsFeatureSupportedMessage, Y as IsFeatureSupportedResponse, aK as JSONParseable, b2 as LicensedFeature, a0 as LoadLibraryDataCaptureAction, K as Module, R as ModuleHandler, aO as ModuleMirrorAxis, au as OnFrameProcessingFinishedMessage, at as OnFrameProcessingStartedMessage, av as OnFrameSkippedMessage, af as OnTapAction, aC as PayloadForCommand, I as PerformanceMetrics, ar as PerformanceMetricsReportMessage, b4 as PlatformHintPresenter, a4 as ProcessFrameDataCaptureAction, ak as RemoveNativeOverlayAction, ac as ReportCameraPropertiesDataCaptureAction, a5 as RequestFrameDataDataCaptureAction, X as RequestFrameDataResponse, a3 as SetFrameSourceDataCaptureAction, ad as SetLogLevelDataCaptureAction, ay as ShowGuidanceMessage, an as ShowHintWorkerMessage, aw as ShowToastMessage, aA as StartUpdateTimerMessage, aB as StopUpdateTimerMessage, am as SuccessFeedbackWorkerMessage, b1 as ToastHint, b0 as ToastHintStyle, a9 as UpdateContextDataCaptureAction, ao as UpdateHintWorkerMessage, aP as Vector, a7 as VisibilityChangeAction, aQ as WasmFrameData, $ as WorkerResponse } from '../DataCaptureContext-fzPdCXUX.js';
5
+ export { al as AddNativeOverlayAction, Q as AnyDataCaptureActionMessage, R as AugmentedWorker, aQ as CaptureModeDeserializerInstance, a3 as ConvertToJPEGResultDataCaptureAction, a4 as CreateContextDataCaptureAction, U as DataCaptureActionMessageKey, T as DataCaptureCallbackMessage, an as DataCaptureCallbackMessageKeys, aI as DataCaptureContext, aP as DataCaptureContextDeserializer, aO as DataCaptureContextDeserializerResult, aJ as DataCaptureImageBufferFrameSource, aM as DataCaptureView, aG as DataCaptureWorker, a8 as DeleteFrameDataDataCaptureAction, au as DidTapTrackedBarcode, ac as DisposeDataCaptureAction, aH as EmscriptenClassHandle, X as EngineWorkerResponse, ag as ExtractCentaurusLicenseDataCaptureAction, Y as ExtractCentaurusLicenseResponse, ad as FlushAnalyticsDataCaptureAction, N as GenericHint, aK as GestureListener, aL as GestureRecognizer, ak as GetOpenSourceSoftwareLicenseInfoAction, a0 as GetOpenSourceSoftwareLicenseInfoResponse, aj as GetViewfinderInfoAction, $ as GetViewfinderInfoResponse, b2 as GuidanceHint, b0 as GuidanceHintAnchor, b1 as GuidanceHintStyle, aB as HideGuidanceMessage, as as HideHintWorkerMessage, az as HideToastMessage, a_ as HintAnchor, aY as HintCornerStyle, aU as HintFont, aX as HintHeight, aZ as HintIcon, b6 as HintPresenterV2, ai as HintPresenterV2updateAction, a$ as HintStyle, aV as HintTextAlignment, aW as HintWidth, aa as IsFeatureSupportedAction, ar as IsFeatureSupportedMessage, _ as IsFeatureSupportedResponse, aN as JSONParseable, b5 as LicensedFeature, a2 as LoadLibraryDataCaptureAction, L as Module, S as ModuleHandler, aR as ModuleMirrorAxis, aw as OnFrameProcessingFinishedMessage, av as OnFrameProcessingStartedMessage, ax as OnFrameSkippedMessage, ah as OnTapAction, aF as PayloadForCommand, I as PerformanceMetrics, at as PerformanceMetricsReportMessage, b7 as PlatformHintPresenter, a6 as ProcessFrameDataCaptureAction, am as RemoveNativeOverlayAction, ae as ReportCameraPropertiesDataCaptureAction, a7 as RequestFrameDataDataCaptureAction, Z as RequestFrameDataResponse, a5 as SetFrameSourceDataCaptureAction, af as SetLogLevelDataCaptureAction, aA as ShowGuidanceMessage, ap as ShowHintWorkerMessage, ay as ShowToastMessage, aC as StartUpdateTimerMessage, aD as StopUpdateTimerMessage, ao as SuccessFeedbackWorkerMessage, b4 as ToastHint, b3 as ToastHintStyle, ab as UpdateContextDataCaptureAction, aq as UpdateHintWorkerMessage, aS as Vector, V as ViewInfo, aE as ViewSizeChangedMessage, a9 as VisibilityChangeAction, aT as WasmFrameData, a1 as WorkerResponse } from '../DataCaptureContext-COl4JuSo.js';
6
6
  import '../LoadingStatus.js';
7
7
  import '../logger.js';
8
8
  import '../private/FrameReaders/ColorType.js';
@@ -13,12 +13,6 @@ import '../Camera-DhGjpcjv.js';
13
13
  import '../private/privateAccess.js';
14
14
  import '../DataCaptureContextSettings.js';
15
15
  import '../commons/JSONType.js';
16
- import '../commons/MarginsWithUnit.js';
17
- import '../commons/NumberWithUnit.js';
18
- import '../commons/MeasureUnit.js';
19
- import '../commons/PointWithUnit.js';
20
- import '../commons/Anchor.js';
21
- import '../commons/Quadrilateral.js';
22
16
  import '../DataCaptureViewPlusRelated.js';
23
17
  import '../NotificationPresenter/NotificationPresenter.js';
24
18
  import '../NotificationPresenter/NotificationConfiguration.js';
@@ -26,6 +20,12 @@ import '../commons/Color.js';
26
20
  import '../ScanditIcon.js';
27
21
  import '../private/utils/ScanditHTMLElement.js';
28
22
  import '../NotificationPresenter/NotificationStyle.js';
23
+ import '../commons/Anchor.js';
24
+ import '../commons/MarginsWithUnit.js';
25
+ import '../commons/NumberWithUnit.js';
26
+ import '../commons/MeasureUnit.js';
27
+ import '../commons/PointWithUnit.js';
28
+ import '../commons/Quadrilateral.js';
29
29
  import '../private/CustomLocationsView.js';
30
30
  import '../private/View.js';
31
31
  import '../private/AnchorPositions.js';
@@ -1 +1 @@
1
- export{a as setupFS}from'../chunks/chunk-4ZAHOKYN.js';
1
+ export{a as setupFS}from'../chunks/chunk-X3GOCLVQ.js';
@@ -1,6 +1,6 @@
1
1
  /// <reference types="emscripten" />
2
2
  export { WorkerMain } from './WorkerMain.js';
3
- export { aj as AddNativeOverlayAction, O as AnyDataCaptureActionMessage, Q as AugmentedWorker, aN as CaptureModeDeserializerInstance, a1 as ConvertToJPEGResultDataCaptureAction, a2 as CreateContextDataCaptureAction, b6 as CreateContextParameters, T as DataCaptureActionMessageKey, S as DataCaptureCallbackMessage, al as DataCaptureCallbackMessageKeys, aF as DataCaptureContext, aM as DataCaptureContextDeserializer, aL as DataCaptureContextDeserializerResult, J as DataCaptureEngine, aG as DataCaptureImageBufferFrameSource, G as DataCaptureLoader, E as DataCaptureLoaderOptions, aJ as DataCaptureView, aD as DataCaptureWorker, a6 as DeleteFrameDataDataCaptureAction, as as DidTapTrackedBarcode, aa as DisposeDataCaptureAction, aE as EmscriptenClassHandle, U as EngineWorkerResponse, ae as ExtractCentaurusLicenseDataCaptureAction, V as ExtractCentaurusLicenseResponse, ab as FlushAnalyticsDataCaptureAction, L as GenericHint, aH as GestureListener, aI as GestureRecognizer, ai as GetOpenSourceSoftwareLicenseInfoAction, _ as GetOpenSourceSoftwareLicenseInfoResponse, Z as GetViewfinderInfo, ah as GetViewfinderInfoAction, a$ as GuidanceHint, aZ as GuidanceHintAnchor, a_ as GuidanceHintStyle, az as HideGuidanceMessage, aq as HideHintWorkerMessage, ax as HideToastMessage, aX as HintAnchor, aV as HintCornerStyle, aR as HintFont, aU as HintHeight, aW as HintIcon, b3 as HintPresenterV2, ag as HintPresenterV2updateAction, aY as HintStyle, aS as HintTextAlignment, aT as HintWidth, a8 as IsFeatureSupportedAction, ap as IsFeatureSupportedMessage, Y as IsFeatureSupportedResponse, aK as JSONParseable, b2 as LicensedFeature, a0 as LoadLibraryDataCaptureAction, b5 as LoadLibraryParameters, K as Module, R as ModuleHandler, aO as ModuleMirrorAxis, au as OnFrameProcessingFinishedMessage, at as OnFrameProcessingStartedMessage, av as OnFrameSkippedMessage, af as OnTapAction, aC as PayloadForCommand, I as PerformanceMetrics, ar as PerformanceMetricsReportMessage, b4 as PlatformHintPresenter, a4 as ProcessFrameDataCaptureAction, b9 as ProcessFrameParameters, ak as RemoveNativeOverlayAction, ac as ReportCameraPropertiesDataCaptureAction, ba as ReportCameraPropertiesParameters, a5 as RequestFrameDataDataCaptureAction, X as RequestFrameDataResponse, a3 as SetFrameSourceDataCaptureAction, b8 as SetFrameSourceParameters, ad as SetLogLevelDataCaptureAction, ay as ShowGuidanceMessage, an as ShowHintWorkerMessage, aw as ShowToastMessage, aA as StartUpdateTimerMessage, aB as StopUpdateTimerMessage, am as SuccessFeedbackWorkerMessage, b1 as ToastHint, b0 as ToastHintStyle, a9 as UpdateContextDataCaptureAction, b7 as UpdateContextParameters, ao as UpdateHintWorkerMessage, aP as Vector, a7 as VisibilityChangeAction, aQ as WasmFrameData, W as WorkerFunctions, $ as WorkerResponse } from '../DataCaptureContext-fzPdCXUX.js';
3
+ export { al as AddNativeOverlayAction, Q as AnyDataCaptureActionMessage, R as AugmentedWorker, aQ as CaptureModeDeserializerInstance, a3 as ConvertToJPEGResultDataCaptureAction, a4 as CreateContextDataCaptureAction, b9 as CreateContextParameters, U as DataCaptureActionMessageKey, T as DataCaptureCallbackMessage, an as DataCaptureCallbackMessageKeys, aI as DataCaptureContext, aP as DataCaptureContextDeserializer, aO as DataCaptureContextDeserializerResult, K as DataCaptureEngine, aJ as DataCaptureImageBufferFrameSource, G as DataCaptureLoader, E as DataCaptureLoaderOptions, aM as DataCaptureView, aG as DataCaptureWorker, a8 as DeleteFrameDataDataCaptureAction, au as DidTapTrackedBarcode, ac as DisposeDataCaptureAction, aH as EmscriptenClassHandle, X as EngineWorkerResponse, ag as ExtractCentaurusLicenseDataCaptureAction, Y as ExtractCentaurusLicenseResponse, ad as FlushAnalyticsDataCaptureAction, N as GenericHint, aK as GestureListener, aL as GestureRecognizer, ak as GetOpenSourceSoftwareLicenseInfoAction, a0 as GetOpenSourceSoftwareLicenseInfoResponse, aj as GetViewfinderInfoAction, $ as GetViewfinderInfoResponse, b2 as GuidanceHint, b0 as GuidanceHintAnchor, b1 as GuidanceHintStyle, aB as HideGuidanceMessage, as as HideHintWorkerMessage, az as HideToastMessage, a_ as HintAnchor, aY as HintCornerStyle, aU as HintFont, aX as HintHeight, aZ as HintIcon, b6 as HintPresenterV2, ai as HintPresenterV2updateAction, a$ as HintStyle, aV as HintTextAlignment, aW as HintWidth, aa as IsFeatureSupportedAction, ar as IsFeatureSupportedMessage, _ as IsFeatureSupportedResponse, aN as JSONParseable, b5 as LicensedFeature, a2 as LoadLibraryDataCaptureAction, b8 as LoadLibraryParameters, L as Module, S as ModuleHandler, aR as ModuleMirrorAxis, aw as OnFrameProcessingFinishedMessage, av as OnFrameProcessingStartedMessage, ax as OnFrameSkippedMessage, ah as OnTapAction, aF as PayloadForCommand, I as PerformanceMetrics, at as PerformanceMetricsReportMessage, b7 as PlatformHintPresenter, a6 as ProcessFrameDataCaptureAction, bc as ProcessFrameParameters, am as RemoveNativeOverlayAction, ae as ReportCameraPropertiesDataCaptureAction, bd as ReportCameraPropertiesParameters, a7 as RequestFrameDataDataCaptureAction, Z as RequestFrameDataResponse, a5 as SetFrameSourceDataCaptureAction, bb as SetFrameSourceParameters, af as SetLogLevelDataCaptureAction, aA as ShowGuidanceMessage, ap as ShowHintWorkerMessage, ay as ShowToastMessage, aC as StartUpdateTimerMessage, aD as StopUpdateTimerMessage, ao as SuccessFeedbackWorkerMessage, b4 as ToastHint, b3 as ToastHintStyle, ab as UpdateContextDataCaptureAction, ba as UpdateContextParameters, aq as UpdateHintWorkerMessage, aS as Vector, V as ViewInfo, aE as ViewSizeChangedMessage, a9 as VisibilityChangeAction, aT as WasmFrameData, W as WorkerFunctions, a1 as WorkerResponse } from '../DataCaptureContext-COl4JuSo.js';
4
4
  import '../Camera-DhGjpcjv.js';
5
5
  import '../commons/Rect.js';
6
6
  import '../private/Serializable.js';
@@ -9,13 +9,6 @@ import '../commons/Size.js';
9
9
  import '../private/privateAccess.js';
10
10
  import '../DataCaptureContextSettings.js';
11
11
  import '../commons/JSONType.js';
12
- import '../commons/MarginsWithUnit.js';
13
- import '../commons/NumberWithUnit.js';
14
- import '../commons/MeasureUnit.js';
15
- import '../commons/PointWithUnit.js';
16
- import '../commons/Anchor.js';
17
- import '../commons/Orientation.js';
18
- import '../commons/Quadrilateral.js';
19
12
  import '../DataCaptureViewPlusRelated.js';
20
13
  import '../NotificationPresenter/NotificationPresenter.js';
21
14
  import '../NotificationPresenter/NotificationConfiguration.js';
@@ -23,6 +16,13 @@ import '../commons/Color.js';
23
16
  import '../ScanditIcon.js';
24
17
  import '../private/utils/ScanditHTMLElement.js';
25
18
  import '../NotificationPresenter/NotificationStyle.js';
19
+ import '../commons/Anchor.js';
20
+ import '../commons/MarginsWithUnit.js';
21
+ import '../commons/NumberWithUnit.js';
22
+ import '../commons/MeasureUnit.js';
23
+ import '../commons/Orientation.js';
24
+ import '../commons/PointWithUnit.js';
25
+ import '../commons/Quadrilateral.js';
26
26
  import '../private/CustomLocationsView.js';
27
27
  import '../private/View.js';
28
28
  import '../private/AnchorPositions.js';
@@ -1 +1 @@
1
- export{a as DataCaptureLoader}from'../chunks/chunk-MBL5Q2H2.js';export{a as WorkerMain}from'../chunks/chunk-BGUY24J4.js';export{a as DataCaptureEngine}from'../chunks/chunk-DQ2IFWM5.js';export{h as GuidanceHintAnchor,i as GuidanceHintStyle,g as HintAnchor,e as HintCornerStyle,a as HintFont,d as HintHeight,f as HintIcon,b as HintTextAlignment,c as HintWidth,k as LicensedFeature,j as ToastHintStyle}from'../chunks/chunk-56CY5YB3.js';
1
+ export{a as DataCaptureLoader}from'../chunks/chunk-HQFHOI5U.js';export{a as WorkerMain}from'../chunks/chunk-RZ45ODIK.js';export{a as DataCaptureEngine}from'../chunks/chunk-BD2C4EUH.js';export{h as GuidanceHintAnchor,i as GuidanceHintStyle,g as HintAnchor,e as HintCornerStyle,a as HintFont,d as HintHeight,f as HintIcon,b as HintTextAlignment,c as HintWidth,k as LicensedFeature,j as ToastHintStyle}from'../chunks/chunk-56CY5YB3.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scandit/web-datacapture-core",
3
- "version": "8.1.0",
3
+ "version": "8.2.0-beta.1",
4
4
  "description": "Scandit Data Capture SDK for the Web",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "sideEffects": false,
@@ -113,9 +113,9 @@
113
113
  "build-coverage": "COVERAGE=true npx tsup",
114
114
  "build-dev": "NODE_ENV=debug npx tsup",
115
115
  "build-watch": "NODE_ENV=debug npx tsup --watch",
116
- "postbuild": "node postbuild.js",
117
- "postbuild-coverage": "node postbuild.js",
118
- "postbuild-dev": "node postbuild.js",
116
+ "postbuild": "tsx --tsconfig tsconfig.node.json postbuild.ts",
117
+ "postbuild-coverage": "tsx --tsconfig tsconfig.node.json postbuild.ts",
118
+ "postbuild-dev": "tsx --tsconfig tsconfig.node.json postbuild.ts",
119
119
  "clean": "rm -rf build/* coverage/* .nyc_output/*",
120
120
  "test": "jest",
121
121
  "test-ci": "jest --ci",
@@ -134,12 +134,10 @@
134
134
  "dependencies": {
135
135
  "@types/emscripten": "1.40.1",
136
136
  "@types/howler": "2.2.12",
137
- "@types/js-cookie": "3.0.6",
138
137
  "@types/offscreencanvas": "2019.7.3",
139
138
  "@types/ua-parser-js": "0.7.39",
140
139
  "csstype": "3.1.3",
141
140
  "howler": "2.2.4",
142
- "js-cookie": "3.0.5",
143
141
  "ua-parser-js": "1.0.40",
144
142
  "wasm-feature-detect": "1.8.0"
145
143
  }
@@ -1 +0,0 @@
1
- import {a}from'./chunk-5JAPQHXF.js';import {a as a$1}from'./chunk-3A4KLILV.js';import {a as a$2}from'./chunk-UWBNF47P.js';var e=class e extends a{static create(){return document.createElement(e.tag)}static register(){a$1({[e.tag]:e});}render(){return a$2`<style>${e.tag}{display:flex}</style><svg width="${this.size}" height="${this.heightForViewbox(24,24)}" viewBox="0 0 24 24" fill="none"><path fill-rule="evenodd" clip-rule="evenodd" d="M20 12C20 16.4183 16.4183 20 12 20C7.58172 20 4 16.4183 4 12C4 7.58172 7.58172 4 12 4C16.4183 4 20 7.58172 20 12ZM22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12ZM16.7337 10.4937C17.0888 10.152 17.0888 9.59799 16.7337 9.25628C16.3787 8.91457 15.8031 8.91457 15.4481 9.25628L10.6364 13.8876L8.55192 11.8813C8.19689 11.5396 7.62129 11.5396 7.26627 11.8813C6.91124 12.223 6.91124 12.777 7.26627 13.1187L9.99354 15.7437C10.3486 16.0854 10.9242 16.0854 11.2792 15.7437L16.7337 10.4937Z" fill="${this.fill}"/></svg>`}};e.tag="scandit-rounded-check-icon";var t=e;t.register();export{t as a};
@@ -1 +0,0 @@
1
- import {a as a$1}from'./chunk-QCZSSQAQ.js';var a=Promise.resolve(),c=false,i=false,n,l={writableDataPath:""};async function f(e){if(n==null)return;c=true;let t=new Promise((r,o)=>{setTimeout(()=>{o(new a$1({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}));},1500);});try{await Promise.race([new Promise((r,o)=>{n==null||n(e,s=>{if(s!=null){o(s);return}r();});}),t]);}finally{c=false;}}async function u(e){return i||(c?(i=true,a=a.then(async()=>(i=false,f(e)))):a=f(e)),a}async function p(e){l=e,n=FS.syncfs,FS.syncfs=((t,r)=>{let o=r,s=()=>{o();},S=m=>{o(m);};u(t).then(s).catch(S);});try{FS.mkdir(l.writableDataPath);}catch(t){if(t.code!=="EEXIST")throw n=void 0,t}return FS.mount(IDBFS,{},l.writableDataPath),u(true)}export{p as a};
@@ -1,35 +0,0 @@
1
- import {b,a as a$4}from'./chunk-SK6L34IF.js';import {a as a$2}from'./chunk-DZKZ6RMW.js';import {a}from'./chunk-NQF3GUK2.js';import {a as a$3}from'./chunk-QHBIT2WY.js';import {a as a$1}from'./chunk-XR65N6EG.js';var v=`
2
- attribute vec2 a_position;
3
- varying vec2 v_texcoord;
4
-
5
- void main() {
6
- gl_Position = vec4(a_position, 0, 1);
7
- v_texcoord = a_position * 0.5 + 0.5;
8
- }
9
- `,R=`
10
- precision mediump float;
11
- varying vec2 v_texcoord;
12
- uniform sampler2D u_texture;
13
- uniform float x_spacing; // Uniform for x-spacing between pixels
14
-
15
- // Function to calculate grayscale
16
- float toGray(vec4 color) {
17
- return dot(color.rgb, vec3(0.299, 0.587, 0.114));
18
- }
19
-
20
- void main() {
21
- // Sample adjacent pixels with spacing of 1/width
22
- vec4 a = texture2D(u_texture, v_texcoord + vec2(0.0 * x_spacing, 0.0));
23
- vec4 b = texture2D(u_texture, v_texcoord + vec2(1.0 * x_spacing, 0.0));
24
- vec4 c = texture2D(u_texture, v_texcoord + vec2(2.0 * x_spacing, 0.0));
25
- vec4 d = texture2D(u_texture, v_texcoord + vec2(3.0 * x_spacing, 0.0));
26
-
27
- // Calculate grayscale values
28
- float grayscaleA = toGray(a);
29
- float grayscaleB = toGray(b);
30
- float grayscaleC = toGray(c);
31
- float grayscaleD = toGray(d);
32
-
33
- // Set the final color with grayscale values
34
- gl_FragColor = vec4(grayscaleA, grayscaleB, grayscaleC, grayscaleD);
35
- }`,p=class extends a{constructor(t,e){super(t,e);this.colorType="GRAYSCALE";this._useRgbaFallback=false;this._positions=new Float32Array([-1,-1,-1,1,1,-1,1,-1,-1,1,1,1]);this._canvas=document.createElement("canvas");}get _webglContext(){var t;if(!this._ctx){if(this._ctx=(t=this._canvas)==null?void 0:t.getContext("webgl",{antialias:false}),!this._ctx)throw new Error("Cannot get WebGL context");this.setup();}return this._ctx}readFromSource(t){var c,g;let e=(c=t==null?void 0:t.videoWidth)!=null?c:this._contextWebGL.drawingBufferWidth,i=e%4!==0;if(i!==this._useRgbaFallback&&(i?(a$1.debug("[GrayScaleFrameReader] Video width not divisible by 4, falling back to RGBA reader for better performance",{width:e}),this._rgbaFallbackReader||(this._rgbaFallbackReader=new a$2(this._contextWebGL,{minPoolCapacity:this._minPoolCapacity,maxPoolCapacity:this._maxPoolCapacity}),this._rgbaFallbackReader.setup())):a$1.log(a$1.Level.Info,"[GrayScaleFrameReader] Video width now divisible by 4, using optimized grayscale reader",{width:e}),this._useRgbaFallback=i),this._useRgbaFallback&&this._rgbaFallbackReader)return this._rgbaFallbackReader.readFromSource(t);this.updateCanvasSizeIfNeeded(),this.updateFrameSizeIfNeeded();let{drawingBufferWidth:n,drawingBufferHeight:r,TEXTURE_2D:u,RGBA:s,UNSIGNED_BYTE:h,TRIANGLES:m}=this._webglContext;this._webglContext.viewport(0,0,n,r);let w=this._webglContext.getUniformLocation(this._shaderProgram,"x_spacing"),C=1/e;this._webglContext.uniform1f(w,C),this._webglContext.texImage2D(u,0,s,s,h,t),this._webglContext.drawArrays(m,0,6);let a=(g=this._framePool)==null?void 0:g.pop();if(!a)throw new Error("Frame pool found empty!");let l=n*r*4;return a.length!==l&&(a$1.warn("[GrayScaleFrameReader] Buffer from pool has wrong size, allocating new one",{bufferLength:a.length,requiredSize:l}),a=new Uint8ClampedArray(l)),this._webglContext.readPixels(0,0,n,r,s,h,a),{width:e,height:r,data:new Uint8ClampedArray(a.buffer,0,e*r),colorType:"GRAYSCALE"}}setup(){this.initShaderProgram(),this.initBuffers(),this.initTexture();}dispose(){var t;this._ctx&&(this._shaderProgram&&(this._ctx.deleteProgram(this._shaderProgram),this._shaderProgram=null),this._positionBuffer&&(this._ctx.deleteBuffer(this._positionBuffer),this._positionBuffer=null),this._texture&&(this._ctx.deleteTexture(this._texture),this._texture=null),this._ctx=null),this._rgbaFallbackReader&&(this._rgbaFallbackReader.dispose(),this._rgbaFallbackReader=null),(t=this._framePool)==null||t.empty(),this._canvas=void 0;}updateCanvasSizeIfNeeded(){if(!this._canvas)return;let t=Math.ceil(this._contextWebGL.drawingBufferWidth/4);(this._canvas.width!==t||this._canvas.height!==this._contextWebGL.drawingBufferHeight)&&(this._canvas.width=t,this._canvas.height=this._contextWebGL.drawingBufferHeight);}updateFrameSizeIfNeeded(){let{drawingBufferWidth:t,drawingBufferHeight:e}=this._webglContext,i=t*e*4;this._frameSize!==i&&(this._frameSize=i,this._framePool&&this._framePool.empty(),this._framePool=new a$3({capacity:this._maxPoolCapacity,lowWaterMark:this._minPoolCapacity,createItem:()=>new Uint8ClampedArray(this._frameSize)}));}initShaderProgram(){let t=b(this._webglContext,this._webglContext.VERTEX_SHADER,v),e=b(this._webglContext,this._webglContext.FRAGMENT_SHADER,R);if(!t||!e)throw new Error("Shaders cannot be created");this._shaderProgram=a$4(this._webglContext,t,e),this._webglContext.useProgram(this._shaderProgram);}initBuffers(){this._positionBuffer=this._webglContext.createBuffer(),this._webglContext.bindBuffer(this._webglContext.ARRAY_BUFFER,this._positionBuffer),this._webglContext.bufferData(this._webglContext.ARRAY_BUFFER,this._positions,this._webglContext.STATIC_DRAW);let t=this._webglContext.getAttribLocation(this._shaderProgram,"a_position");this._webglContext.enableVertexAttribArray(t),this._webglContext.bindBuffer(this._webglContext.ARRAY_BUFFER,this._positionBuffer),this._webglContext.vertexAttribPointer(t,2,this._webglContext.FLOAT,false,0,0);}initTexture(){this._texture=this._webglContext.createTexture(),this._webglContext.bindTexture(this._webglContext.TEXTURE_2D,this._texture),this._webglContext.texParameteri(this._webglContext.TEXTURE_2D,this._webglContext.TEXTURE_WRAP_S,this._webglContext.CLAMP_TO_EDGE),this._webglContext.texParameteri(this._webglContext.TEXTURE_2D,this._webglContext.TEXTURE_WRAP_T,this._webglContext.CLAMP_TO_EDGE),this._webglContext.texParameteri(this._webglContext.TEXTURE_2D,this._webglContext.TEXTURE_MIN_FILTER,this._webglContext.LINEAR),this._webglContext.texParameteri(this._webglContext.TEXTURE_2D,this._webglContext.TEXTURE_MAG_FILTER,this._webglContext.LINEAR);let t=this._webglContext.getUniformLocation(this._shaderProgram,"u_texture");this._webglContext.uniform1i(t,0);}};export{p as a};
@@ -1 +0,0 @@
1
- import {b as b$2}from'./chunk-XINFYUZW.js';import {a as a$7}from'./chunk-ZEBGTTCX.js';import {b as b$1,a as a$6}from'./chunk-C657OBED.js';import {a as a$5}from'./chunk-3A4KLILV.js';import {a as a$8}from'./chunk-2LSO6JEZ.js';import {a as a$3}from'./chunk-UWBNF47P.js';import {a as a$1}from'./chunk-EV4OEANA.js';import {a as a$4}from'./chunk-LSZZVJ6B.js';import {a as a$2}from'./chunk-R6E4CT22.js';var a="--view-finder-top",s="--view-finder-bottom",c="--hint-anchor-offset",b="--max-width-fraction",P="--horizontal-margin",h="--max-width-ratio-adjust",S=(l=>(l.Update="hintpresenterupdate",l))(S||{});function O(p,l=100){return typeof p=="string"?p.slice(0,l):""}var n=class n extends a$1{constructor(){super();this.onDidToastHideHandler=this.onDidToastHide.bind(this);this.orientationObserver=new b$1;this.onOrientationChangeHandler=a$2(this.onOrientationChange.bind(this),200);let t=this.attachShadow({mode:"open"});t.innerHTML=a$3`<div id="root"><slot></slot></div>`,t.append(n.createStyleElement().cloneNode(true)),this.root=t.querySelector("#root");}static createStyleElement(){return a$4`:host{pointer-events:none}:host #root{inset:0;position:absolute;width:100%;${a}:0;${s}:0;${h}:1;z-index:1}::slotted(${b$2.tag}){left:50%;max-width:calc(var(${b})*var(${h})*100% - var(${P}));position:absolute;transform:translate3d(-50%,0,0);width:100%}::slotted(${b$2.tag}.${"aboveViewFinder"}){transform:translate3d(-50%,calc(-100% + var(${a}) - var(${c})),0)}::slotted(${b$2.tag}.${"belowViewFinder"}){transform:translate3d(-50%,calc(var(${s}) + var(${c})),0)}::slotted(${b$2.tag}.${"top"}){top:calc(var(${c}))}::slotted(${b$2.tag}.fitToText){width:fit-content}`}static register(){a$5({[n.tag]:n});}static create(){return n.register(),document.createElement(n.tag)}connectedCallback(){this.orientationObserver.addEventListener(a$6,this.onOrientationChangeHandler),this.orientationObserver.register(),this.addEventListener("didhide",this.onDidToastHideHandler),this._viewFinderRect==null&&(this.root.style.setProperty(a,`${this.root.clientHeight/2}px`),this.root.style.setProperty(s,`${this.root.clientHeight/2+1}px`));}disconnectedCallback(){this.removeEventListener("didhide",this.onDidToastHideHandler);}setViewFinderRect(t){if(t===null){this.root.style.removeProperty(a),this.root.style.removeProperty(s);return}this._viewFinderRect=t;let{origin:{y:e},size:{height:i}}=this._viewFinderRect;this.root.style.setProperty(a,`${e}px`),this.root.style.setProperty(s,`${e+i}px`);}async handleMessage(t){let{type:e}=t;switch(e){case "showToast":{await this.showToast(t.payload);break}case "hideToast":{await this.hideToast(t.payload);break}case "showGuidance":{await this.showGuidance(t.payload);break}case "hideGuidance":{await this.hideGuidance(t.payload);break}case "startUpdateTimer":{this.startUpdateTimer(t.payload.duration.value);break}case "stopUpdateTimer":{this.stopUpdateTimer();break}}}setHintStyleToToast(t,e){t.textContent=e.text,t.hintStyle=e.hintStyle,t.className="",t.style.setProperty(c,`${t.hintStyle.hintAnchorOffset/16}rem`),t.style.setProperty(b,e.hintStyle.maxWidthFraction.toString()),t.style.setProperty(P,`${e.hintStyle.horizontalMargin/16}rem`),t.classList.add(e.hintStyle.hintAnchor),t.classList.toggle("fitToText",e.hintStyle.fitToText);}onDidToastHide(t){t.stopPropagation(),t.detail.target.remove();}getToastElementFromIdOrTag({id:t,tag:e}){var i;return (i=this.querySelector(`[data-id="${t}"]`))!=null?i:this.querySelector(`[data-tag="${e}"]`)}async showToast(t){var r;let e=this.idFromHint(t),i=this.getToastElementFromIdOrTag({id:e,tag:(r=t.tag)!=null?r:""});if(i||(i=b$2.create(),i.dataset.id=e,t.tag!==""&&(i.dataset.tag=t.tag),this.append(i)),this.setHintStyleToToast(i,t),t.tag==="MoveCloserGuidance"){let d=a$7.create();d.setAttribute("slot","first-child"),i.append(d),i.setAttribute("direction","column");}return i.show()}showToastWithCustomIcon(t,e){var d;let i=this.idFromHint(t),r=this.getToastElementFromIdOrTag({id:i,tag:(d=t.tag)!=null?d:""});return r||(r=b$2.create(),r.dataset.id=i,t.tag!==""&&(r.dataset.tag=t.tag),this.append(r)),r.customIcon=e,this.setHintStyleToToast(r,t),r.show()}async hideToast(t){var i;let e=this.getToastElementFromIdOrTag({id:this.idFromHint(t),tag:(i=t.tag)!=null?i:""});return e==null?void 0:e.hide()}async showGuidance(t){return this.showToast(t)}async hideGuidance(t){return this.hideToast(t)}startUpdateTimer(t){this.intervalId=setInterval(()=>{this.dispatchEvent(new CustomEvent("hintpresenterupdate"));},t);}stopUpdateTimer(){clearInterval(this.intervalId);}idFromHint(t){var e;return a$8([t.hintStyle.textColor,t.hintStyle.backgroundColor,t.hintStyle.hintAnchor,(e=t.tag)!=null?e:"",O(t.text,30),t.hintStyle.textAlignment],"hint")}onOrientationChange(t){let e=1;e=t.detail.value==="landscapeLeft"||t.detail.value==="landscapeRight"?window.innerHeight/window.innerWidth:1,this.root.style.setProperty(h,e.toString()),this._viewFinderRect==null&&(this.root.style.setProperty(a,`${this.root.clientHeight/2}px`),this.root.style.setProperty(s,`${this.root.clientHeight/2+1}px`));}};n.tag="scandit-hints";var $=n;export{S as a,$ as b};
@@ -1 +0,0 @@
1
- import {a as a$1}from'./chunk-3A4KLILV.js';import {a as a$2}from'./chunk-UWBNF47P.js';import {a}from'./chunk-EV4OEANA.js';var r="inline-style",e=class e extends a{get fill(){var t;return (t=this.getAttribute("fill"))!=null?t:"black"}set fill(t){this.setAttribute("fill",t);}get size(){var t;return Number((t=this.getAttribute("size"))!=null?t:"32")}set size(t){this.setAttribute("size",t.toString());}get[r](){return this.getAttribute(r)}set[r](t){t==null?this.removeAttribute(r):this.setAttribute(r,t);}static create(){return a$1({[e.tag]:e}),document.createElement(e.tag)}render(){return a$2`<div></div>`}heightForViewbox(t,i){return this.size*this.aspectRatioForViewbox(t,i)}aspectRatioForViewbox(t,i){return i/t}connectedCallback(){this.innerHTML=this.render();}attributeChangedCallback(t,i,b){b!==i&&(this.innerHTML=this.render());}};e.tag="scandit-svg-icon",e.observedAttributes=["fill","size"];var u=e;export{u as a};
@@ -1 +0,0 @@
1
- import {a as a$8}from'./chunk-5C4OO6CX.js';import {a as a$7}from'./chunk-DZKZ6RMW.js';import {d}from'./chunk-AFCJ24Y3.js';import {a as a$4}from'./chunk-E4XJ4GKD.js';import {a as a$6}from'./chunk-QOCHMKNY.js';import {a as a$5}from'./chunk-KAFNKP6O.js';import {a as a$1}from'./chunk-ZKROZLQ4.js';import {b as b$1}from'./chunk-FTD535WI.js';import {a}from'./chunk-R6E4CT22.js';import {a as a$9}from'./chunk-4BP7D26M.js';import {b}from'./chunk-VBUDN72N.js';import {a as a$2}from'./chunk-XR65N6EG.js';import {a as a$3}from'./chunk-QCZSSQAQ.js';var P=(a=>(a.CONTINUOUS="continuous",a.MANUAL="manual",a.NONE="none",a.SINGLE_SHOT="single-shot",a))(P||{}),F=(s=>(s[s.ULTRA_HD=0]="ULTRA_HD",s[s.FULL_HD=1]="FULL_HD",s[s.HD=2]="HD",s[s.SD=3]="SD",s[s.NONE=4]="NONE",s))(F||{}),x=(t=>(t.CAMERA_PROPERTIES="cameraProperties",t.CAMERA_ACCESS_ERROR="cameraAccessError",t))(x||{}),o=class o{constructor(){this.constraint=4;this.checkCameraVideoStreamAccessIfVisibleListener=this.checkCameraVideoStreamAccessIfVisible.bind(this);this.handleWebGLContextLostListener=this.handleWebGLContextLost.bind(this);this.listeners=new Map;this.mirrorImageOverrides=new Map;this.postStreamInitializationListener=this.postStreamInitialization.bind(this);this.triggerManualFocusListener=this.triggerManualFocus.bind(this);this.triggerZoomMoveListener=this.triggerZoomMove.bind(this);this.triggerZoomStartListener=this.triggerZoomStart.bind(this);this.videoResizeListener=a(this.handleVideoResize.bind(this),500);this.videoTrackEndedListener=this.videoTrackEndedRecovery.bind(this);this.videoTrackMuteListener=this.videoTrackMuteRecovery.bind(this);this._synchronousFrameHandling=false;this._glFrameReaders={GRAYSCALE:null,RGBA:null};this._frameReaderType="RGBA";this.isVideoStreamPaused=false;this.handleVideoPauseHandler=this.handleVideoPause.bind(this);this.cameraPosition="worldFacing",this.gui={isCameraRecoveryVisible:()=>false,setCameraRecoveryVisible:()=>{}},this.isWebGLSupported=!b.checkBrowserCompatibility().missingFeatures.includes("webGL"),this.videoElement=document.createElement("video"),this.videoElement.autoplay=true,this.videoElement.playsInline=true,this.videoElement.muted=true,this.videoElement.style.opacity="0",this.videoElement.poster=a$1,this.canvas=document.createElement("canvas"),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLostListener);}get mediaStream(){return this._mediaStream}set mediaStream(e){this._mediaStream=e,e&&(this.mediaTrackCapabilitiesPromise=new Promise(t=>{this.mediaTrackCapabilitiesPromiseResolver=t;}));}get synchronousFrameHandling(){return this._synchronousFrameHandling}get canvas2dContext(){return this._canvas2dContext||(this._canvas2dContext=this.canvas.getContext("2d",{willReadFrequently:true}),this._canvas2dContext==null&&a$2.warn("Unable to get 2d canvas context"),this.handleVideoResize()),this._canvas2dContext}get canvasWebGLContext(){var e;if(!this._canvas2dContext&&!this._canvasWebGLContext){if(!this.isWebGLSupported){a$2.warn("WebGL context not supported, falling back to 2d canvas context. This may impact the scanning performance.");return}let t=(e=this.canvas.getContext("webgl",{alpha:false,antialias:false}))!=null?e:this.canvas.getContext("experimental-webgl",{alpha:false,antialias:false});t!=null&&(this._canvasWebGLContext=t,this.handleVideoResize());}return this._canvasWebGLContext}static instance(){return o._instance==null&&(o._instance=new o),o._instance}recycle(e){var t;(t=this.getFrameReader())==null||t.recycle(e);}getCurrentFrame(){var e;return (e=this._glFrameReaders.RGBA)==null?void 0:e.readFromSource(this.videoElement)}requestVideoFrame(e,t=this.videoElement){return "requestVideoFrameCallback"in HTMLVideoElement.prototype?t.requestVideoFrameCallback(e):requestAnimationFrame(e)}cancelVideoFrame(e,t=this.videoElement){if("cancelVideoFrameCallback"in HTMLVideoElement.prototype){t.cancelVideoFrameCallback(e);return}cancelAnimationFrame(e);}addListener(e,t){var a;let i=(a=this.listeners.get(e))!=null?a:[];i.includes(t)||this.listeners.set(e,[...i,t]);}async applyCameraSettings(e){if(this.selectedCameraSettings=e,this.activeCamera==null)throw new a$3(o.noCameraErrorParameters);return this.initializeCameraWithSettings(this.activeCamera,e)}captureImage(){var e;if(((e=this.mediaStream)==null?void 0:e.active)!=null){if(this.canvasWebGLContext!=null)return this.captureImageForWebGLContext();if(this.canvas2dContext!=null)return this.captureImageFor2dContext()}return null}async initializeCameraWithSettings(e,t){if(this.cameraInitializationPromise&&await this.cameraInitializationPromise,e==null)throw new a$3(o.noCameraErrorParameters);return this.setSelectedCamera(e),this.selectedCameraSettings=t,this.activeCameraSettings=t,this.cameraInitializationPromise=this.initializeCameraAndCheckUpdatedSettings(e),this.cameraInitializationPromise}isMirrorImageEnabled(){if(this.selectedCamera&&this.activeCamera){let e=this.mirrorImageOverrides.get(this.activeCamera);return e!=null?e:this.activeCamera.position==="userFacing"}return false}isPinchToZoomEnabled(){return this.pinchToZoomEnabled}isTapToFocusEnabled(){return this.tapToFocusEnabled}async isTorchAvailable(){var e;return this.mediaStream?(await this.waitForCapabilities(),((e=this.mediaTrackCapabilities)==null?void 0:e.torch)===true):false}async playVideo(){return new Promise(e=>{this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height);let t=this.videoElement.play();t==null?e():t.then(e).catch(()=>{e();});})}async reinitializeCamera(){if(this.activeCamera==null)a$2.debug("Camera reinitialization delayed");else {a$2.debug("Reinitialize camera:",this.activeCamera);try{let e=this.activeCamera;await this.stopStream(),await this.initializeCameraWithSettings(e,this.activeCameraSettings);}catch(e){throw a$2.warn("Couldn't access camera:",this.activeCamera,e),this.emit("cameraAccessError",e),e}}}removeListener(e,t){var s;let a=((s=this.listeners.get(e))!=null?s:[]).filter(n=>n!==t);this.listeners.set(e,a);}async setCameraPosition(e){var i;this.setInitialCameraPosition(e);let t=d.getMainCameraForPosition(await d.getCameras(),e);if(t&&t.deviceId!==((i=this.selectedCamera)==null?void 0:i.deviceId))return this.initializeCameraWithSettings(t,this.selectedCameraSettings)}async setExposure(e){var a,s,n,c,d,l,v,p;let t=(s=(a=this.mediaStream)==null?void 0:a.getVideoTracks())!=null?s:[];if(t.length===0||typeof t[0].applyConstraints!="function")return;await this.waitForCapabilities();let i=e.time!=null&&e.time>0?"manual":"continuous";if(((c=(n=this.mediaTrackCapabilities)==null?void 0:n.exposureMode)==null?void 0:c.includes(i))===true){if(await t[0].applyConstraints({advanced:[{exposureMode:i}]}),e.time!=null&&e.time>0&&this.mediaTrackCapabilities.exposureTime){let u=Math.max((d=this.mediaTrackCapabilities.exposureTime.min)!=null?d:.01,Math.min(e.time,(l=this.mediaTrackCapabilities.exposureTime.max)!=null?l:1e5));await t[0].applyConstraints({advanced:[{exposureTime:u}]});}else if(e.compensation!=null&&i==="continuous"&&this.mediaTrackCapabilities.exposureCompensation){let u=Math.max((v=this.mediaTrackCapabilities.exposureCompensation.min)!=null?v:-10,Math.min(e.compensation,(p=this.mediaTrackCapabilities.exposureCompensation.max)!=null?p:10));await t[0].applyConstraints({advanced:[{exposureCompensation:u}]});}}}async setFocus(e){var i,a,s,n,c;if(!this.mediaStream)return;let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function"){await this.waitForCapabilities();let d=e>=0?"manual":"continuous";if(((a=(i=this.mediaTrackCapabilities)==null?void 0:i.focusMode)==null?void 0:a.includes(d))===true&&(await t[0].applyConstraints({advanced:[{focusMode:d}]}),d==="manual"&&this.mediaTrackCapabilities.focusDistance)){let l=Math.max(0,Math.min(e,1))*(((s=this.mediaTrackCapabilities.focusDistance.max)!=null?s:1e3)-((n=this.mediaTrackCapabilities.focusDistance.min)!=null?n:.01))+((c=this.mediaTrackCapabilities.focusDistance.min)!=null?c:.01);await t[0].applyConstraints({advanced:[{focusDistance:l}]});}}}async setFrameRate(e){var t,i,a;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.frameRate)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let n=Math.min((i=this.mediaTrackCapabilities.frameRate.max)!=null?i:240,(a=e.max)!=null?a:240);await s[0].applyConstraints({advanced:[{frameRate:n}]});}}}setInitialCameraPosition(e){this.cameraPosition=e;}setInteractionOptions(e,t,i){this.torchToggleEnabled=e,this.tapToFocusEnabled=t,this.pinchToZoomEnabled=i;}setMirrorImageEnabled(e,t){this.selectedCamera&&(e?(this.videoElement.classList.add(o.MIRRORED_CLASS_NAME),this.canvas.classList.add(o.MIRRORED_CLASS_NAME)):(this.videoElement.classList.remove(o.MIRRORED_CLASS_NAME),this.canvas.classList.remove(o.MIRRORED_CLASS_NAME)),t&&this.mirrorImageOverrides.set(this.selectedCamera,e));}setPinchToZoomEnabled(e){this.pinchToZoomEnabled=e,this.mediaStream&&(this.pinchToZoomEnabled?this.enablePinchToZoomListeners():this.disablePinchToZoomListeners());}setSelectedCamera(e){this.selectedCamera=e;}setSelectedCameraSettings(e){this.selectedCameraSettings=e;}setTapToFocusEnabled(e){this.tapToFocusEnabled=e,this.mediaStream&&(this.tapToFocusEnabled?this.enableTapToFocusListeners():this.disableTapToFocusListeners());}async setTorchEnabled(e){var t;if(this.mediaStream&&((t=this.mediaTrackCapabilities)==null?void 0:t.torch)===true){this.torchEnabled=e;let i=this.mediaStream.getVideoTracks();i.length>0&&typeof i[0].applyConstraints=="function"&&await i[0].applyConstraints({advanced:[{torch:e}]});}}async setZoom(e){var t,i,a;if(this.mediaStream&&(await this.waitForCapabilities(),(t=this.mediaTrackCapabilities)!=null&&t.zoom)){let s=this.mediaStream.getVideoTracks();if(s.length>0&&typeof s[0].applyConstraints=="function"){let n=Math.max((i=this.mediaTrackCapabilities.zoom.min)!=null?i:1,Math.min(e,(a=this.mediaTrackCapabilities.zoom.max)!=null?a:16));await s[0].applyConstraints({advanced:[{zoom:n}]});}}}async setupCameras(){if(this.cameraSetupPromise)return this.cameraSetupPromise;let e=this.isVideoStreamPaused;return this.cameraSetupPromise=this.setupCamerasAndStream(),this.cameraSetupPromise.then(()=>{e||(this.isVideoStreamPaused=false);})}pauseStream(){if(this.mediaStream){for(let e of this.mediaStream.getVideoTracks())e.enabled=false;this.isVideoStreamPaused=true,a$2.debug("Paused camera video stream",this.mediaStream);}}resumeStream(){if(this.mediaStream){for(let e of this.mediaStream.getVideoTracks())e.enabled=true;this.isVideoStreamPaused=false,a$2.debug("Resumed camera video stream",this.mediaStream);}}async stopStream(e=false){this.activeCamera&&(this.activeCamera.currentResolution=void 0),this.activeCamera=void 0,this.torchEnabled=false,this.isVideoStreamPaused=false,this.mediaStream&&(a$2.debug(`Stop camera video stream access${e?" (abort access detection)":""}:`,this.mediaStream),a$2.debug("Stopping camera video stream access",this.mediaStream),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),window.clearTimeout(this.cameraAccessTimeout),window.clearInterval(this.videoMetadataCheckInterval),window.clearTimeout(this.getCapabilitiesTimeout),window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),window.clearInterval(this.autofocusInterval),this.videoElement.pause(),await new Promise(t=>{setTimeout(()=>{var i,a,s;for(let n of (a=(i=this.mediaStream)==null?void 0:i.getVideoTracks())!=null?a:[])n.removeEventListener("ended",this.videoTrackEndedListener),n.stop();this.videoElement.srcObject=null,this._canvas2dContext&&this._canvas2dContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.mediaStream=void 0,this.mediaTrackCapabilities=void 0,this.mediaTrackCapabilitiesPromise=void 0,this.mediaTrackCapabilitiesPromiseResolver=void 0,e||(s=this.abortedCameraInitializationResolveCallback)==null||s.call(this),t();},0);}));}stopVideoTracks(){if(this.mediaStream!=null)for(let e of this.mediaStream.getVideoTracks())e.stop();}async toggleTorch(){this.torchEnabled=!this.torchEnabled,await this.setTorchEnabled(this.torchEnabled);}updateCanvasVideoImage(){this.canvas2dContext.drawImage(this.videoElement,0,0);}async waitForCapabilities(){var e;return (e=this.mediaTrackCapabilitiesPromise)!=null?e:Promise.resolve()}setFrameReaderType(e){e!==this._frameReaderType&&(this._frameReaderType=e,a$2.log(a$2.Level.Debug,`Change frame reader type to ${this._frameReaderType} mode`));}async allowPictureInPicture(e){e?(this.videoElement.disablePictureInPicture=false,this.videoElement.removeAttribute("controlslist"),this.videoElement.removeAttribute("disablepictureinpicture")):(this.videoElement.disablePictureInPicture=true,this.videoElement.setAttribute("controlslist","nodownload"),this.videoElement.setAttribute("disablepictureinpicture","true")),await this.reinitializeCamera();}setFrameHandling(e){var t;this._synchronousFrameHandling=e,this._frameReaderOptions=this.getFrameReaderOptions(e),(t=this._glFrameReaders[this._frameReaderType])==null||t.dispose(),delete this._glFrameReaders[this._frameReaderType];}async setClipArea(e){if(this.activeCamera&&this.isVideoAndContextStateValid()){this.clipArea=e?this.frameRectFromViewRect(e):void 0,await this.initializeStreamForResolution(this.activeCamera,this.constraint,this.isVideoStreamPaused);return}this.clipArea=e;}frameRectFromViewRect(e){let t=this.videoElement.videoWidth/this.videoElement.clientWidth||1,i=this.videoElement.videoHeight/this.videoElement.clientHeight||1;return new a$4(new a$5(e.origin.x*t,e.origin.y*i),new a$6(e.size.width*t,e.size.height*i))}async accessAutoselectedCamera(e){let t=d.sortCamerasForCameraPosition(e,this.cameraPosition),i=t.shift();for(;i;)try{await this.initializeCameraWithSettings(i,this.selectedCameraSettings);return}catch(a){if(this.setSelectedCamera(),t.length>0){a$2.log(a$2.Level.Warn,"Couldn't access camera:",i,a),i=t.shift();continue}throw a}throw new a$3(o.noCameraErrorParameters)}getFrameReaderOptions(e){return e?{minPoolCapacity:0,maxPoolCapacity:1}:b.isDesktopDevice()?{maxPoolCapacity:2,minPoolCapacity:1}:{maxPoolCapacity:10,minPoolCapacity:3}}getFrameReader(){var t;if(this._glFrameReaders[this._frameReaderType])return this._glFrameReaders[this._frameReaderType];if(!this._canvasWebGLContext)return null;let e=(t=this._frameReaderOptions)!=null?t:this.getFrameReaderOptions(this._synchronousFrameHandling);switch(this._frameReaderType){case "GRAYSCALE":{this._glFrameReaders.GRAYSCALE=new a$8(this._canvasWebGLContext,e),this._glFrameReaders.RGBA=new a$7(this._canvasWebGLContext,{minPoolCapacity:1,maxPoolCapacity:2});break}case "RGBA":{this._glFrameReaders.RGBA=new a$7(this._canvasWebGLContext,e);break}default:b$1(this._frameReaderType);}return a$2.debug(`Created frame reader ${this._frameReaderType}`,e),this._glFrameReaders[this._frameReaderType]}async accessInitialCamera(){let e={position:this.cameraPosition,deviceId:"",label:""};try{await this.initializeCameraWithSettings(e,this.selectedCameraSettings);}catch{}finally{this.setSelectedCamera();}return e}recreateCanvas(){this.canvas.removeEventListener("webglcontextlost",this.handleWebGLContextLostListener),this._canvasWebGLContext=void 0,this._canvas2dContext=void 0;for(let t of Object.values(this._glFrameReaders))t==null||t.dispose();let e=document.createElement("canvas");e.addEventListener("webglcontextlost",this.handleWebGLContextLostListener),e.width=this.canvas.width,e.height=this.canvas.height,e.className=this.canvas.className,this.canvas=e;}captureImageFor2dContext(){if(!this.isVideoAndContextStateValid())return null;let{width:e,height:t}=this.canvas;return {colorType:"RGBA",data:this.canvas2dContext.getImageData(0,0,e,t).data,width:e,height:t}}areVideoAndWebGLSizeMismatching(){return this.canvasWebGLContext?this.canvasWebGLContext.drawingBufferWidth!==this.videoElement.videoWidth||this.canvasWebGLContext.drawingBufferHeight!==this.videoElement.videoHeight:true}captureImageForWebGLContext(){if(!this.isVideoAndContextStateValid()||!this.canvasWebGLContext||this.canvasWebGLContext.drawingBufferWidth<=2||this.canvasWebGLContext.drawingBufferHeight<=2||this.areVideoAndWebGLSizeMismatching()||this.getFrameReader()==null)return null;let e=this.getFrameReader().readFromSource(this.videoElement);if(e.data[3]!==255&&e.colorType==="RGBA"){if(a$2.log(a$2.Level.Warn,"Detected incorrect GPU accelerated WebGL image processing, switching to canvas mode"),this.recreateCanvas(),this.canvas2dContext==null)throw new Error("Unable to get 2d canvas context");return this.captureImage()}return e}async checkCameraAccess(e){return new Promise((t,i)=>{this.cameraAccessRejectCallback=a=>{a$2.log(a$2.Level.Debug,"Camera video stream access failure (video data load timeout):",e),this.gui.setCameraRecoveryVisible(true),i(a);},this.setCameraAccessTimeout();})}checkCameraVideoStreamAccessIfVisible(){document.visibilityState==="visible"&&(a$2.debug("Page is visible again, waiting for camera video stream start..."),document.removeEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener),this.setCameraAccessTimeout());}async checkVideoMetadata(e){return new Promise((t,i)=>{this.videoElement.onloadeddata=()=>{if(this.videoElement.onloadeddata=null,window.clearTimeout(this.cameraAccessTimeout),this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.videoElement.currentTime>0){this.updateActiveCameraCurrentResolution(e),a$2.log(a$2.Level.Debug,"Camera video stream access success:",e),t();return}let a=performance.now();window.clearInterval(this.videoMetadataCheckInterval),this.videoMetadataCheckInterval=window.setInterval(async()=>{if(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2||this.videoElement.currentTime===0){if(performance.now()-a>o.videoMetadataCheckTimeoutMs){a$2.log(a$2.Level.Warn,"Camera video stream access failure (valid video metadata timeout):",e),window.clearInterval(this.videoMetadataCheckInterval),await this.stopStream(true),i(new a$3(o.notReadableErrorParameters));return}return}window.clearInterval(this.videoMetadataCheckInterval),this.updateActiveCameraCurrentResolution(e),a$2.log(a$2.Level.Debug,"Camera video stream access success:",e),t();},o.videoMetadataCheckIntervalMs);};})}disablePinchToZoomListeners(){this.videoElement.removeEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.removeEventListener("touchmove",this.triggerZoomMoveListener);}disableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.removeEventListener(e,this.triggerManualFocusListener);}emit(e,t){var a;let i=(a=this.listeners.get(e))!=null?a:[];for(let s of i)s(t);}enablePinchToZoomListeners(){this.videoElement.addEventListener("touchstart",this.triggerZoomStartListener),this.videoElement.addEventListener("touchmove",this.triggerZoomMoveListener);}enableTapToFocusListeners(){for(let e of ["touchend","mousedown"])this.videoElement.addEventListener(e,this.triggerManualFocusListener);}getActiveCamera(e,t,i){return e.length===1?e[0]:e.find(a=>a.deviceId===i||a.label!==""&&a.label===t)}getInitialCameraResolutionConstraint(e){var i;let t;switch((i=this.activeCameraSettings)==null?void 0:i.preferredResolution){case "uhd4k":{t=0;break}case "fullHd":{t=1;break}default:{t=2;break}}return t}async handleCameraInitializationError(e,t,i){if(!["OverconstrainedError","NotReadableError"].includes(i.name)||i.name==="NotReadableError"&&t===4)throw a$2.log(a$2.Level.Debug,"Camera video stream access failure (unrecoverable error)",e,i),i.name!=="NotAllowedError"&&d.markCameraAsInaccessible(e),i;if(i.name==="OverconstrainedError"&&t===4){if(e.deviceId==="")throw a$2.log(a$2.Level.Warn,"Camera video stream access failure (no camera with such type error)",e,i),i;a$2.log(a$2.Level.Warn,"Detected non-existent deviceId error, attempt to find and reaccess updated camera",e,i);let a=e.deviceId;if(await d.getCameras(true),a===e.deviceId)throw a$2.log(a$2.Level.Warn,"Camera video stream access failure (updated camera not found after non-existent deviceId error)",e,i),d.markCameraAsInaccessible(e),i;return a$2.log(a$2.Level.Warn,"Updated camera found (recovered from non-existent deviceId error), attempt to access it",e),this.initializeCameraForResolution(e)}return this.initializeCameraForResolution(e,t+1)}handleVideoResize(){if(!(this.videoElement.videoWidth<=2||this.videoElement.videoHeight<=2)){if(this.activeCamera&&this.updateActiveCameraCurrentResolution(this.activeCamera),this.canvasWebGLContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight,this.canvasWebGLContext.viewport(0,0,this.canvasWebGLContext.drawingBufferWidth,this.canvasWebGLContext.drawingBufferHeight);}else if(this.canvas2dContext!=null){if(this.canvas.width===this.videoElement.videoWidth&&this.canvas.height===this.videoElement.videoHeight)return;this.canvas.width=this.videoElement.videoWidth,this.canvas.height=this.videoElement.videoHeight;}}}handleWebGLContextLost(){a$2.log(a$2.Level.Warn,"WebGL context has been lost, restoring..."),this._canvasWebGLContext=void 0,this.canvasWebGLContext?(this.handleVideoResize(),a$2.log(a$2.Level.Warn,"WebGL context restored")):a$2.log(a$2.Level.Error,"WebGL context restore failed");}async initializeCameraAndCheckUpdatedSettings(e){var t,i,a,s,n;try{if(await this.initializeCameraForResolution(e),this.selectedCameraSettings!==this.activeCameraSettings&&(this.selectedCameraSettings==null||this.activeCameraSettings==null||Object.keys(this.selectedCameraSettings).some(u=>{var b,f;return ((b=this.selectedCameraSettings)==null?void 0:b[u])!==((f=this.activeCameraSettings)==null?void 0:f[u])}))){this.activeCameraSettings=this.selectedCameraSettings,await this.initializeCameraAndCheckUpdatedSettings(e);return}this.activeCameraSettings&&this.activeCameraSettings.zoomFactor>1&&await this.setZoom(this.activeCameraSettings.zoomFactor);let c=(t=this.activeCameraSettings)==null?void 0:t.getProperty("minFrameRate"),d=(i=this.activeCameraSettings)==null?void 0:i.getProperty("maxFrameRate");(c!=null||d!=null)&&await this.setFrameRate({min:c,max:d});let l=(a=this.activeCameraSettings)==null?void 0:a.getProperty("manualLensPosition");l!=null&&await this.setFocus(l);let v=(s=this.activeCameraSettings)==null?void 0:s.getProperty("exposureTargetBias"),p=(n=this.activeCameraSettings)==null?void 0:n.getProperty("exposureDuration");(v!=null||p!=null)&&await this.setExposure({compensation:v,time:p});}finally{this.cameraInitializationPromise=void 0;}}async initializeCameraForResolution(e,t){var i;this.gui.setCameraRecoveryVisible(false),this.constraint=t!=null?t:this.getInitialCameraResolutionConstraint(e),this.mediaStream!=null&&e.deviceId!==""&&((i=this.activeCamera)==null?void 0:i.deviceId)===e.deviceId?await(b.isIPhone()?this.initializeStreamForResolution(e,this.constraint):this.updateStreamForResolution(e,this.constraint)):await this.initializeStreamForResolution(e,this.constraint);}async initializeStreamForResolution(e,t,i=false){var a;await this.stopStream();try{let s=(a=this.activeCameraSettings)==null?void 0:a.getProperty("preferredAspectRatio"),n=await d.accessCameraStream(e,t,s),c=await this.clipMediaStreamIfNeeded(n);if(a$2.log(a$2.Level.Debug,"Camera accessed, waiting for camera video stream start..."),typeof c.getVideoTracks()[0].getSettings=="function"){let d=c.getVideoTracks()[0].getSettings();if(d.width!=null&&d.height!=null&&(d.width===2||d.height===2)){if(a$2.log(a$2.Level.Debug,"Camera video stream access failure (invalid video metadata):",e),t===4)throw new a$3(o.notReadableErrorParameters);return await this.stopStream(),this.initializeStreamForResolution(e,t+1)}}this.mediaStream=c,i&&this.pauseStream();for(let d of this.mediaStream.getVideoTracks())d.addEventListener("ended",this.videoTrackEndedListener),d.addEventListener("mute",this.videoTrackMuteListener),d.addEventListener("unmute",this.videoTrackMuteListener);try{await this.setupCameraStreamVideo(e,c);}catch(d){if(t===4)throw d;return this.initializeStreamForResolution(e,t+1)}}catch(s){return this.handleCameraInitializationError(e,t,s)}}isVideoAndContextStateValid(){return this.videoElement.readyState===4&&this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&this.canvas.width>2&&this.canvas.height>2}postStreamInitialization(){window.clearTimeout(this.getCapabilitiesTimeout),this.getCapabilitiesTimeout=window.setTimeout(()=>{this.storeStreamCapabilities(),this.setupAutofocus();},o.getCapabilitiesTimeoutMs);}async recoverStreamIfNeeded(){var t,i;let e=(t=this.mediaStream)==null?void 0:t.getVideoTracks();((i=e==null?void 0:e[0])==null?void 0:i.readyState)==="ended"&&await this.reinitializeCamera();}reportCameraProperties(e,t,i=true){this.emit("cameraProperties",{deviceId:e,isFrontFacing:t==="userFacing",hasAutofocus:i});}setCameraAccessTimeout(){window.clearTimeout(this.cameraAccessTimeout),this.cameraAccessTimeout=window.setTimeout(async()=>{var e;document.visibilityState==="visible"?(await this.stopStream(true),(e=this.cameraAccessRejectCallback)==null||e.call(this,new a$3(o.notReadableErrorParameters))):(a$2.debug("Page is currently not visible, delay camera video stream access detection"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener));},o.cameraAccessTimeoutMs);}setupAutofocus(){if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),this.mediaStream&&this.mediaTrackCapabilities){let e=this.mediaTrackCapabilities.focusMode;Array.isArray(e)&&!e.includes("continuous")&&e.includes("single-shot")&&(window.clearInterval(this.autofocusInterval),this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),o.autofocusIntervalMs));}}async setupCameraStreamVideo(e,t){this.videoElement.addEventListener("loadedmetadata",this.postStreamInitializationListener),this.videoElement.addEventListener("resize",this.videoResizeListener),this.tapToFocusEnabled&&this.enableTapToFocusListeners(),this.pinchToZoomEnabled&&this.enablePinchToZoomListeners();let i=Promise.race([this.checkCameraAccess(e),this.checkVideoMetadata(e),new Promise(a=>{this.abortedCameraInitializationResolveCallback=a;})]);return this.videoElement.srcObject=t,this.videoElement.load(),await this.playVideo(),this.handleVideoResize(),this.reportCameraProperties(e.deviceId,e.position),i}async setupCamerasAndStream(){var e,t;try{let i;this.selectedCamera==null&&(i=await this.accessInitialCamera());let a=await d.getCameras(false,true),s=(t=(e=this.mediaStream)==null?void 0:e.getVideoTracks()[0])==null?void 0:t.getSettings().deviceId;if(this.mediaStream&&i){let n=this.getActiveCamera(a,i.label,s);if(n){if(d.adjustCameraFromMediaStream(this.mediaStream,n),b.isDesktopDevice()&&(d.setMainCameraForPositionOverridesOnDesktop(this.cameraPosition,n),d.setMainCameraForPositionOverridesOnDesktop(n.position,n)),a.length===1||d.getMainCameraForPosition(a,this.cameraPosition)===n){a$2.debug("Initial camera access was correct (main camera), keep camera:",n),this.setSelectedCamera(n),this.updateActiveCameraCurrentResolution(n),await this.recoverStreamIfNeeded();return}a$2.debug("Initial camera access was incorrect (not main camera), change camera",{...i,deviceId:s});}else a$2.debug("Initial camera access was incorrect (unknown camera), change camera",{...i,deviceId:s});}if(this.selectedCamera==null){await this.accessAutoselectedCamera(a);return}await this.initializeCameraWithSettings(this.selectedCamera,this.selectedCameraSettings);}finally{this.cameraSetupPromise=void 0;}}storeStreamCapabilities(){var e;if(this.mediaStream){let t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getCapabilities=="function"&&(this.mediaTrackCapabilities=t[0].getCapabilities()),this.mediaTrackCapabilitiesPromiseResolver&&this.mediaTrackCapabilitiesPromiseResolver();}this.activeCamera&&this.reportCameraProperties(this.activeCamera.deviceId,this.activeCamera.position,((e=this.mediaTrackCapabilities)==null?void 0:e.focusMode)==null||this.mediaTrackCapabilities.focusMode.includes("continuous"));}async triggerAutoFocus(){await this.triggerFocusMode("single-shot");}async triggerFocusMode(e){if(this.mediaStream){let t=this.mediaStream.getVideoTracks();if(t.length>0&&typeof t[0].applyConstraints=="function")try{await t[0].applyConstraints({advanced:[{focusMode:e}]});}catch{}}}async triggerManualFocus(e){if(e){if(e.preventDefault(),e.type==="touchend"&&e.touches.length>0)return;if(this.pinchToZoomDistance!=null){this.pinchToZoomDistance=void 0;return}}if(window.clearTimeout(this.manualFocusWaitTimeout),window.clearTimeout(this.manualToAutofocusResumeTimeout),!this.mediaStream||!this.mediaTrackCapabilities)return;let t=this.mediaTrackCapabilities.focusMode;Array.isArray(t)&&t.includes("single-shot")&&(t.includes("continuous")&&t.includes("manual")?await this.triggerManualFocusForContinuous():t.includes("continuous")||await this.triggerManualFocusForSingleShot());}async triggerManualFocusForContinuous(){var i;if(!this.mediaStream)return;this.manualToAutofocusResumeTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("continuous");},o.manualToAutofocusResumeTimeoutMs);let e=true,t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getConstraints=="function"&&(e=((i=t[0].getConstraints().advanced)==null?void 0:i.some(a=>a.focusMode==="manual"))===true),e?(await this.triggerFocusMode("continuous"),this.manualFocusWaitTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("manual");},o.manualFocusWaitTimeoutMs)):await this.triggerFocusMode("manual");}async triggerManualFocusForSingleShot(){window.clearInterval(this.autofocusInterval),this.manualToAutofocusResumeTimeout=window.setTimeout(()=>{this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),o.autofocusIntervalMs);},o.manualToAutofocusResumeTimeoutMs);try{await this.triggerFocusMode("single-shot");}catch{}}async triggerZoomMove(e){this.pinchToZoomDistance==null||(e==null?void 0:e.touches.length)!==2||e.preventDefault();}triggerZoomStart(e){var a,s,n,c;if((e==null?void 0:e.touches.length)!==2||(e.preventDefault(),this.pinchToZoomDistance=Math.hypot((e.touches[1].screenX-e.touches[0].screenX)/screen.width,(e.touches[1].screenY-e.touches[0].screenY)/screen.height),!this.mediaStream||!((a=this.mediaTrackCapabilities)!=null&&a.zoom)))return;let t=this.mediaStream.getVideoTracks();if(t.length===0||typeof t[0].getConstraints!="function")return;this.pinchToZoomInitialZoom=(s=this.mediaTrackCapabilities.zoom.min)!=null?s:1;let i=t[0].getConstraints();if(i.advanced){let d=(n=i.advanced.find(l=>"zoom"in l))==null?void 0:n.zoom;d!=null&&(this.pinchToZoomInitialZoom=typeof d=="number"?d:(c=d.ideal)!=null?c:1);}}updateActiveCameraCurrentResolution(e){this.videoElement.videoWidth>2&&this.videoElement.videoHeight>2&&(e.currentResolution={width:this.videoElement.videoWidth,height:this.videoElement.videoHeight}),e.deviceId!==""&&(this.activeCamera=e,this.setMirrorImageEnabled(this.isMirrorImageEnabled(),false));}async updateStreamForResolution(e,t){var i;if(this.mediaStream==null)await this.initializeCameraForResolution(e,t);else try{let a=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio");a$2.debug("Setting new resolution for active camera video stream..."),await this.mediaStream.getVideoTracks()[0].applyConstraints(d.getUserMediaVideoParameters(t,a)),await new Promise(n=>{this.videoElement.addEventListener("timeupdate",()=>{n();},{once:true});});let s=this.mediaStream.getVideoTracks()[0].getSettings();a$2.debug("New active camera video stream resolution set",{width:s.width,height:s.height});}catch(a){if(t===4)throw a;await this.updateStreamForResolution(e,t+1);}}async videoTrackEndedRecovery(){if(document.visibilityState==="visible")try{a$2.debug('Detected video track "ended" event, try to reinitialize camera'),await this.reinitializeCamera();}catch{}else a$2.debug("Page is currently not visible, delay camera reinitialization until visible"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener);}videoTrackMuteRecovery(e){if(this.videoElement.onloadeddata!=null){a$2.debug(`Detected video track "${e.type}" event, delay camera video stream access detection`),this.setCameraAccessTimeout();return}let t=e.type==="mute";t!==this.gui.isCameraRecoveryVisible()&&(a$2.debug(`Detected video track "${e.type}" event, ${t?"enable":"disable"} camera recovery`),this.gui.setCameraRecoveryVisible(t));}async clipMediaStreamIfNeeded(e){if(!this.clipArea)return e;let t=this.videoElement.cloneNode();t.srcObject=e,t.load();let i=document.createElement("canvas");i.width=this.clipArea.size.width,i.height=this.clipArea.size.height;let a=i.getContext("2d",{alpha:false,willReadFrequently:false});return a?(t.addEventListener("play",this.drawClippedFrame.bind(this,this.clipArea,t,a),{once:true}),t.addEventListener("pause",this.cleanupClippedStream.bind(this,t),{once:true}),await t.play(),i.captureStream()):e}drawClippedFrame(e,t,i){i.drawImage(t,e.origin.x,e.origin.y,e.size.width,e.size.height,0,0,e.size.width,e.size.height),this.clippedFrameRequestID=this.requestVideoFrame(this.drawClippedFrame.bind(this,e,t,i),t);}cleanupClippedStream(e){this.clippedFrameRequestID&&(this.cancelVideoFrame(this.clippedFrameRequestID,e),this.clippedFrameRequestID=void 0);}connectedCallback(e){e.replaceWith(this.videoElement),this.canvas.addEventListener("webglcontextlost",this.handleWebGLContextLostListener),this.videoElement.addEventListener("pause",this.handleVideoPauseHandler),this.playVideo();}disconnectedCallback(){this.canvas.removeEventListener("webglcontextlost",this.handleWebGLContextLostListener),this.videoElement.removeEventListener("pause",this.handleVideoPauseHandler),this.videoElement.remove(),this.videoElement.removeAttribute("width"),this.videoElement.removeAttribute("height"),this.videoElement.style.removeProperty("visibility");}getVideoElement(){return this.videoElement}handleVideoPause(){this.playVideo();}};o.autofocusIntervalMs=1500,o.cameraAccessTimeoutMs=4e3,o.getCapabilitiesTimeoutMs=500,o.manualFocusWaitTimeoutMs=400,o.manualToAutofocusResumeTimeoutMs=5e3,o.noCameraErrorParameters={name:"NoCameraAvailableError",message:"No camera available"},o.notReadableErrorParameters={name:"NotReadableError",message:"Could not initialize camera correctly"},o.videoMetadataCheckIntervalMs=50,o.videoMetadataCheckTimeoutMs=4e3,o.MIRRORED_CLASS_NAME=a$9.MIRRORED_CLASS_NAME,o._instance=null;var k=o;export{P as a,F as b,x as c,k as d};
File without changes
@@ -1 +0,0 @@
1
- import {a}from'./chunk-BGUY24J4.js';var t=new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function l(e){}export{t as a,l as b};
@@ -1 +0,0 @@
1
- import {a as a$9}from'./chunk-523EQN4Z.js';import {b as b$2}from'./chunk-5IGOKD23.js';import {a as a$d}from'./chunk-NDQQHCZN.js';import {b,a as a$4}from'./chunk-C657OBED.js';import {a as a$h}from'./chunk-V6RG452U.js';import {a as a$j}from'./chunk-UOQFOEG6.js';import {a as a$a}from'./chunk-TPHGDMKG.js';import {a as a$f}from'./chunk-GPPCTFZF.js';import {a as a$l}from'./chunk-DMOXDUF6.js';import {b as b$1}from'./chunk-457L5N2F.js';import {a as a$e}from'./chunk-W6HSMZGZ.js';import {a as a$g}from'./chunk-4JH6EEAE.js';import {a as a$b}from'./chunk-KYNYQBNF.js';import {a as a$7}from'./chunk-RSQRPDVQ.js';import {a}from'./chunk-UQVVJP5Z.js';import {a as a$6}from'./chunk-IJQG3OU6.js';import {a as a$8}from'./chunk-I6SWF3FQ.js';import {a as a$3}from'./chunk-N5YZEC56.js';import {a as a$2}from'./chunk-VJB527QZ.js';import {a as a$1}from'./chunk-GHTCNOQN.js';import {a as a$c}from'./chunk-UWBNF47P.js';import {d}from'./chunk-ADFFBLII.js';import {a as a$n}from'./chunk-E4XJ4GKD.js';import {a as a$k}from'./chunk-QOCHMKNY.js';import {a as a$5}from'./chunk-KAFNKP6O.js';import {a as a$i}from'./chunk-XR65N6EG.js';import {a as a$m}from'./chunk-WUHKODFA.js';var O="core.camera.recovery",$=class B{constructor(){this.focusGesture=a.focusGesture;this.zoomGesture=a.zoomGesture;this._scanAreaMargins=a.scanAreaMargins;this._pointOfInterest=a.pointOfInterest;this._logoStyle=a.logoStyle;this._logoAnchor=a.logoAnchor;this._logoOffset=a.logoOffset;this._context=null;this.overlays=new Set;this.controls=new Set;this.frameSourceListener={didChangeState:this.onFrameSourceChange.bind(this)};this._previewCamera=null;this.controlsElement=void 0;this.frozenFrameCanvas=document.createElement("canvas");this.listeners=[];this.isVideoElementDetached=false;this.orientation="portrait";this.hiddenProperties={stopVideoTracksOnVisibilityChange:true,freezeFrameWhenStoppingFrameSource:true};this.orientationObserver=new b;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$1.getInstance().updateIfMissing(a$2);}get videoElement(){return d.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$1.getInstance().get(O)}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$1(this.canvasElement),this._canvasDrawer.startObservingCanvasResize()),this._canvasDrawer}get privateContext(){return this._context}static async forContext(e){let t=new B;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,n;this.orientationObserver.register(),this.setupHtmlElement(e),(i=this.canvasDrawer)==null||i.startObservingCanvasResize(),this.htmlElementDidChange(),a$3.add(this),this.orientation=this.orientationObserver.orientation.value,this.orientationObserver.addEventListener(a$4,this.onOrientationChangeListener),(r=this.hintPresenter)==null||r.addEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(a=this.hintPresenter)==null||a.addEventListener("willshow",this.onBeforeShowToastsHandler),this.localizationSubscription=a$1.getInstance().subscribe(s=>{s[O]!=null&&(this.cameraRecoveryElement.textContent=s[O]);}),this._previewCamera=(n=t==null?void 0:t.camera)!=null?n:null,this._previewCamera&&(this._previewCamera.addListener(this.frameSourceListener),this.onFrameSourceChange(this._previewCamera)),this.updateControls();}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$3.delete(this),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(a$4,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.instance().disconnectedCallback(),this._previewCamera&&(this._previewCamera.removeListener(this.frameSourceListener),this._previewCamera=null);for(let m of this.controls)this.removeControl(m);}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,view:this}])));}async removeOverlay(e){var t;this.overlays.has(e)&&(await((t=this.privateContext)==null?void 0:t.update([{type:"removeOverlay",newValue:e,view:this}])),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 u,P,L,D,V,F,R,M;let t={width:(P=(u=this.htmlElementState)==null?void 0:u.width)!=null?P:0,height:(D=(L=this.htmlElementState)==null?void 0:L.height)!=null?D:0},i={width:(F=(V=this.videoElement)==null?void 0:V.videoWidth)!=null?F:0,height:(M=(R=this.videoElement)==null?void 0:R.videoHeight)!=null?M: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$5(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 a$6(t,i,a,r)}addControl(e){this.controls.has(e)||(this.controls.add(e),e.install(this).then(t=>{var i;t&&((i=this.privateContext)==null||i.update([{type:"addControl",newValue:e}]));}));}removeControl(e){var t;this.controls.has(e)&&(e.remove(true),this.controls.delete(e),(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.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),u=this.viewPointForFramePoint(e.center);return new a$7(t,i,a,r,n,h,s,m,u)}setDidTapCustomLocationsViewListener(e){this.customLocationsView&&this.customLocationsView.listener===null&&(this.customLocationsView.listener=e);}renderCustomLocationsView(e){this.customLocationsView!=null&&(this.customLocationsView.setMirrored(d.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$2.tag);if(!t)throw new Error("Notification presenter cannot be found. Please ensure the DataCaptureView is connected.");this.notificationPresenter=new a$8(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$2.register(),a$9.register();let t=a$c`<div class="${a$a.CONTAINER_CLASS_NAME}"><div class="${a$a.PAINTBOARDS_CONTAINER_CLASS_NAME}"><div data-js-id="loading-overlay"></div><div class="${a$a.PAINTBOARD_CLASS_NAME}" data-js-id="camera-paintboard"><div data-js-id="video-container"></div><img class="${a$a.FROZEN_FRAME}" data-js-id="frozen-frame" alt="frozen-frame" hidden /><canvas></canvas><div data-js-id="${a$b.CUSTOM_VIEW_CONTAINER}"></div><${b$2.tag}></${b$2.tag}><${a$9.tag}></${a$9.tag}><div class="${a$a.CAMERA_RECOVERY_CLASS_NAME}" hidden>${this.cameraRecoveryText}</div><div class="${a$a.ERROR_CLASS_NAME}" hidden></div></div><div class="${a$a.PAINTBOARD_CLASS_NAME}" data-js-id="singleimage-paintboard"></div></div></div>`;this.htmlElement.innerHTML=t,d.instance().connectedCallback(this.htmlElement.querySelector('[data-js-id="video-container"]')),this.hintPresenter=this.htmlElement.querySelector(b$2.tag),this.notificationPresenter=this.hintPresenter?new a$8(this.hintPresenter):null,this.loadingOverlay&&this.loadingOverlay.remove(),this.loadingOverlay=a$d.create(),this.loadingOverlay.hide(),(a=this.htmlElement.querySelector('[data-js-id="loading-overlay"]'))==null||a.replaceWith(this.loadingOverlay),this.customLocationsView&&this.customLocationsView.unmount(),this.customLocationsView=new a$e,this.customLocationsView.mount(this.htmlElement.querySelector(`[data-js-id="${a$b.CUSTOM_VIEW_CONTAINER}"]`)),this.customLocationsView.mapViewAnchorPositionsForFramePoint=h=>this.viewAnchorPositionsForFrameAnchorPositions(h),this.containerElement=this.htmlElement.querySelector(`.${a$a.CONTAINER_CLASS_NAME}`),this.cameraPaintboardElement=this.containerElement.querySelector('[data-js-id="camera-paintboard"]'),this.singleImageUploaderPaintboardElement=this.containerElement.querySelector('[data-js-id="singleimage-paintboard"]');let i=this.cameraPaintboardElement.querySelector("canvas");this.canvasElement==null?this.canvasElement=i:i.replaceWith(this.canvasElement);let r=this.cameraPaintboardElement.querySelector('[data-js-id="frozen-frame"]');this.frozenFrame==null?this.frozenFrame=r:r.replaceWith(this.frozenFrame),this.controlsElement=this.cameraPaintboardElement.querySelector(a$9.tag),this.cameraRecoveryElement=this.cameraPaintboardElement.querySelector(`.${a$a.CAMERA_RECOVERY_CLASS_NAME}`),this.errorElement=this.cameraPaintboardElement.querySelector(`.${a$a.ERROR_CLASS_NAME}`),this.lastFrameSourceState!=null&&((s=(n=this._context)==null?void 0:n.frameSource)==null||s.switchToDesiredState(this.lastFrameSourceState)),document.addEventListener("visibilitychange",this.visibilityListener);for(let h of ["touchend","mousedown"])this.cameraRecoveryElement.addEventListener(h,this.cameraRecoveryListener);this.htmlElementState&&this.htmlElementState.removeListeners(),this.htmlElementState=new a$f(this.htmlElement),this.htmlElementState.onStateChanged(this.htmlElementDidChangeHandler),this.htmlElementState.onDisconnected(this.htmlElementDisconnectedHandler),this.gestureRecognizer=new a$g(this.htmlElement),this.gestureRecognizer.addListener({onTap:async h=>{var m;(m=this.privateContext)==null||m.workerCommand("onTap",{point:h.toJSONObject()});}});}setupHtmlElementSingleImageUploader(e){var i;if(this.singleImageUploaderPaintboardElement==null)return;this.singleImageUploaderView&&this.singleImageUploaderView.unmount(),this.singleImageUploaderView=new a$h(e),this.singleImageUploaderView.mount(this.containerElement.querySelector('[data-js-id="singleimage-paintboard"]'));let t=(i=this._context)==null?void 0:i.frameSource;this.singleImageUploaderView.onInputCheck(r=>{t.getCurrentState()!=="starting"&&r.preventDefault();}),this.singleImageUploaderView.onBeforeFileRead(()=>{t._context&&this.singleImageUploaderView&&(this.singleImageUploaderView.canUploadFile=t._context.hasEnabledMode());}),this.singleImageUploaderView.onImageLoadError(()=>{t.currentState="starting",a$i.log(a$i.Level.Error,"Could not load image from selected file");}),this.singleImageUploaderView.onFileReaderError(r=>{var n,s;let a=r.target;t.currentState="starting",a$i.log(a$i.Level.Error,`Error while reading the file: ${(s=(n=a.error)==null?void 0:n.toString())!=null?s:""}`);}),this.singleImageUploaderView.onCaptureReady(async r=>{await t.processUploadedFileCapture(r);}),this.singleImageUploaderView.setButtonState(t.getCurrentState()==="starting"?"enabled":"disabled"),t.addView(this.singleImageUploaderView);}setupHtmlElementVisibility(e){this.cameraPaintboardElement!=null&&(this.cameraPaintboardElement.hidden=e!=="camera"),this.singleImageUploaderPaintboardElement!=null&&(this.singleImageUploaderPaintboardElement.hidden=e!=="singleImageUploader");}createStyles(){if(document.querySelector("style[scandit]")===null){let e=a$j();for(let[t,i]of Object.entries(e))i.setAttribute("scandit",`data-capture-sdk-${t}`),document.head.append(i);}}async onOrientationChange(e){var t,i;this.orientation=e.detail.value,await((i=this.privateContext)==null?void 0:i.update([{type:"viewChange",newValue:{...(t=this.htmlElementState)==null?void 0:t.toJSONObject(),orientation:this.orientation}}]));}htmlElementDidChange(){var i,r;if(!this.htmlElementState)return;let e=this.htmlElementState,t=e.toJSONObject();if(!a$f.areEquivalentJSONStates(this.lastHtmlElementState,t)){this.orientation=this.orientationObserver.orientation.value,(i=this.privateContext)==null||i.update([{type:"viewChange",newValue:{...e.toJSONObject(),orientation:this.orientation}}]),this.lastHtmlElementState=t,(r=this.canvasDrawer)==null||r.updateCanvasSizeAttributes(this.width,this.height),this.handleVideoDisplay(t.visible);for(let a of this.listeners)typeof a.didChangeSize=="function"&&a.didChangeSize(this,new a$k(t.size.width.value,t.size.height.value),this.orientation);}}async htmlElementDisconnected(){var e,t,i,r,a,n;this.isVideoElementDetached=false,d.instance().disconnectedCallback(),this.lastFrameSourceState=(t=(e=this._context)==null?void 0:e.frameSource)==null?void 0:t.getCurrentState(),await((r=(i=this._context)==null?void 0:i.frameSource)==null?void 0:r.switchToDesiredState("off")),await((n=this.privateContext)==null?void 0:n.update([{type:"viewChange",newValue:{...(a=this.htmlElementState)==null?void 0:a.toJSONObject(),orientation:this.orientation}}]));}handleVideoDisplay(e){this.videoElement==null||this.cameraPaintboardElement==null||(!e&&!this.isVideoElementDetached?(this.videoElement.width=0,this.videoElement.height=0,this.videoElement.style.opacity="0",this.videoElement.style.visibility="hidden",document.body.append(this.videoElement),this.isVideoElementDetached=true):e&&this.isVideoElementDetached&&(this.cameraPaintboardElement.insertAdjacentElement("afterbegin",this.videoElement),this.isVideoElementDetached=false,this.videoElement.style.removeProperty("visibility"),this.videoElement.removeAttribute("width"),this.videoElement.removeAttribute("height"),this.videoElement.style.removeProperty("opacity")));}isCanvasDrawerWithMetrics(e){return e instanceof a$l}onWorkerMessage(e){var t,i;switch(e.type){case "draw":{this.drawEngineCommands(e.payload);break}case "performanceMetricsReport":{let r=this._canvasDrawer;r!=null&&this.isCanvasDrawerWithMetrics(r)&&r.setPerformanceMetrics(e.payload);break}case "contextDidChangeStatus":{let r=a$m.fromJSON(e.payload);(t=this.loadingOverlay)==null||t.hide(),r.isValid?(this.clearError(),this.setVideoElementOpacity("1")):this.displayError(r);break}default:{(i=this.hintPresenter)==null||i.handleMessage(e);break}}}async onBeforeShowToasts(){var t,i;let e=await((t=this._context)==null?void 0:t.workerCommand("getViewfinderInfo",{}));if((e==null?void 0:e.rect)!=null){if(e.rect.origin.x===0&&e.rect.origin.y===0&&e.rect.size.width===0&&e.rect.size.height===0)return;(i=this.hintPresenter)==null||i.setViewFinderRect(new a$n(new a$5(e.rect.origin.x,e.rect.origin.y),new a$k(e.rect.size.width,e.rect.size.height)));}}drawEngineCommands(e){var t;(t=this.canvasDrawer)==null||t.draw(e);}displayError(e){this.errorElement.textContent=`Error ${e.code}: ${e.message}`,this.errorElement.hidden=false;}clearError(){this.errorElement.textContent="",this.errorElement.hidden=true;}updateControls(){var e;for(let t of this.controls)(e=t.update)==null||e.call(t,this);}async onFrameSourceChange(e){let t=e==null?void 0:e.type;if(this.setupHtmlElementVisibility(t),t==="camera"){let i=e==null?void 0:e.getCurrentState();i!=null&&await this.onCameraStateChanged(i);}else t==="singleImageUploader"&&this.setupHtmlElementSingleImageUploader(e.settings);}async onCameraStateChanged(e){var t;switch((t=this.cameraPaintboardElement)==null||t.classList.toggle(a$a.PAINTBOARD_CLASS_NAME_STATE_ON,e==="on"),e){case "stopping":{this.hiddenProperties.freezeFrameWhenStoppingFrameSource&&this.freezeFrame(),this.setVideoElementOpacity("0");return}case "starting":case "bootingUp":case "wakingUp":{if(!this.htmlElement){a$i.error("cannot set frame source stream before connecting view to an HTML element");return}this.videoElement&&(d.instance().gui.isCameraRecoveryVisible=this.isCameraRecoveryVisible.bind(this),d.instance().gui.setCameraRecoveryVisible=this.setCameraRecoveryVisible.bind(this),this.setVideoElementOpacity("0"));return}case "off":{this.setVideoElementOpacity("0"),this.updateControls();return}case "on":{await d.instance().waitForCapabilities(),this.updateControls(),this.unfreezeFrame(),this.setVideoElementOpacity("1");break}case "goingToSleep":{this.freezeFrame();break}}}setVideoElementOpacity(e){this.videoElement&&(this.videoElement.style.opacity=e),this.canvasElement&&(this.canvasElement.style.opacity=e);}onSingleImageUploaderSettingsChange(e){this.setupHtmlElementSingleImageUploader(e);}setHiddenProperty(e,t){this.hiddenProperties[e]=t;}async onVisibilityChange(){var t,i;let e=(t=this.videoElement)==null?void 0:t.srcObject;if(this.hiddenProperties.stopVideoTracksOnVisibilityChange&&(document.visibilityState==="hidden"&&d.instance().stopVideoTracks(),document.visibilityState==="visible"&&d.instance().activeCamera!=null&&e!=null))if(!e.active||(i=e.getVideoTracks()[0])!=null&&i.muted)try{a$i.debug('Detected visibility change ("visible") event with inactive video source, try to reinitialize camera'),await d.instance().reinitializeCamera();}catch{}else a$i.debug('Detected visibility change ("visible") event with active video source, replay video'),d.instance().playVideo();}async cameraRecovery(e){e.preventDefault(),d.instance().activeCamera=d.instance().selectedCamera,await d.instance().reinitializeCamera();}freezeFrame(){var i;if(!this.frozenFrame)return;let e=d.instance().getCurrentFrame();if(!e)return;let t=new ImageData(e.data,e.width,e.height);this.frozenFrameCanvas.width=t.width,this.frozenFrameCanvas.height=t.height,this.frozenFrame.width=t.width,this.frozenFrame.height=t.height,(i=this.frozenFrameCanvas.getContext("2d"))==null||i.putImageData(t,0,0),this.frozenFrame.src=this.frozenFrameCanvas.toDataURL("image/jpeg",.4),this.frozenFrame.classList.toggle(a$a.MIRRORED_CLASS_NAME,d.instance().isMirrorImageEnabled()),this.frozenFrame.hidden=false;}unfreezeFrame(){this.frozenFrame&&(this.frozenFrame.src="",this.frozenFrame.hidden=true);}};export{$ as a};
@@ -1,2 +0,0 @@
1
- import {b}from'./chunk-VBUDN72N.js';import {a as a$1}from'./chunk-XR65N6EG.js';async function a(l){if(!b.isAnimationApiSupported()||l)try{l?a$1.debug("Force loading animation polyfill as requested."):a$1.debug("Web Animation API not fully supported, you might need to add https://www.npmjs.com/package/web-animations-js polyfill to see some animations.");let{polyfill:o}=await import('../private/utils/AnimationSimplePolyfill.js');o();}catch(o){a$1.warn("Error importing AnimationSimplePolyfill.js, the Animation API will not be polyfilled. This is not a problem for most browsers, but it might be a problem for older browsers like Chrome 75<",o);}}async function f(l){if(typeof globalThis.structuredClone!="function"||l)try{l?a$1.debug("Force loading structuredClone polyfill as requested."):a$1.debug("structuredClone API not supported, loading polyfill for older browsers.");let{structuredClonePolyfill:o}=await import('../private/utils/structuredClonePolyfill.js');o();}catch(o){a$1.warn("Error importing structuredClonePolyfill.js, the structuredClone API will not be polyfilled. This might cause issues in older browsers.",o);}}async function d(l={}){let{forceAnimationPolyfill:o=false,forceStructuredClonePolyfill:t=false,forceAllPolyfills:i=false}=l,n=i||o,s=i||t;await Promise.all([a(n),f(s)]);}
2
- export{d as a};
@@ -1 +0,0 @@
1
- import {b}from'./chunk-457L5N2F.js';import {a}from'./chunk-XR65N6EG.js';var d={processedFramesCount:{text:"Frames processed by engine",valueSuffix:"/sec"},frameDataPoolSize:{text:"Frame data pool size",valueSuffix:""},redrawRequestsCount:{text:"Engine redraw requests",valueSuffix:"/sec"},actualRedrawsCount:{text:"Actual redraws",valueSuffix:"/sec"},FPS:{text:"Overlay FPS ",valueSuffix:"/sec"}},p=class extends b{constructor(e){var r;super(e);this.drawPerformanceTimer=null;this.drawPerformanceFPSCounter=0;this.lastDrawPerformanceFPSCounter=0;this.performanceCanvasLayer=document.createElement("canvas"),(r=e.parentElement)==null||r.insertBefore(this.performanceCanvasLayer,e);}get performanceLayerContext(){if(!this._performanceLayerContext&&(this._performanceLayerContext=this.performanceCanvasLayer.getContext("2d"),!this._performanceLayerContext))throw new TypeError("CanvasRenderingContext cannot be retrieved.");return this._performanceLayerContext}setupPerformanceLayer(){}setPerformanceMetrics(e){this.performanceMetrics=e,this.drawPerformanceMetrics();}updateCanvasSizeAttributes(e,r,t=window.devicePixelRatio){super.updateCanvasSizeAttributes(e,r,t),this.performanceCanvasLayer.width=this.canvas.width,this.performanceCanvasLayer.height=this.canvas.height,this.performanceLayerContext.scale(t,t);}doDraw(){super.doDraw();}drawPerformanceMetrics(){this.drawPerformanceTimer==null&&(a.log(a.Level.Debug,"Drawing performance monitoring enabled, FPS will be drawn into canvas"),this.drawPerformanceTimer=setInterval(()=>{this.lastDrawPerformanceFPSCounter=this.drawPerformanceFPSCounter,this.drawPerformanceFPSCounter=0;},1e3)),this.drawPerformanceFPSCounter++,this.drawFullPerformanceMetrics();}drawFullPerformanceMetrics(){let e={...this.performanceMetrics,FPS:this.lastDrawPerformanceFPSCounter};this.performanceLayerContext.lineWidth=1,this.performanceLayerContext.fillStyle="white",this.performanceLayerContext.strokeStyle="black";let r=Math.min(Math.max(window.innerWidth/35,13),20),t=1.5*r,s=1.5;this.performanceLayerContext.font=`bold ${r}px sans-serif`;let l=0,n=0,i=[];for(let[a,u]of Object.entries(e)){let c=d[a],f=`${c.text}: ${u}${c.valueSuffix}`;n=Math.max(this.performanceLayerContext.measureText(f).width,n),i.push([f,t,t+r*s*l++]);}this.performanceLayerContext.clearRect(t,t-r,n,Object.values(e).length*r*s);for(let a of i)this.performanceLayerContext.fillText(...a),this.performanceLayerContext.strokeText(...a);}};export{p as a};