@scandit/web-datacapture-core 7.0.2 → 7.1.0-beta.2

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 (363) hide show
  1. package/build/electron/common.cjs +1 -1
  2. package/build/electron/constants.cjs +1 -1
  3. package/build/electron/main.cjs +1 -1
  4. package/build/electron/preload.cjs +1 -1
  5. package/build/js/AimerViewfinder.js +1 -1
  6. package/build/js/Brush.js +1 -1
  7. package/build/js/{Camera-ZV7WBiWy.d.ts → Camera-CXPOECYt.d.ts} +9 -12
  8. package/build/js/Camera.d.ts +3 -1
  9. package/build/js/Camera.js +1 -1
  10. package/build/js/CameraAccess.d.ts +3 -1
  11. package/build/js/CameraAccess.js +1 -1
  12. package/build/js/CameraRelated.d.ts +3 -1
  13. package/build/js/CameraRelated.js +1 -1
  14. package/build/js/Common.d.ts +1 -0
  15. package/build/js/Common.js +1 -1
  16. package/build/js/DataCaptureContext.d.ts +3 -1
  17. package/build/js/DataCaptureContext.js +1 -1
  18. package/build/js/DataCaptureContextRelated.d.ts +3 -1
  19. package/build/js/DataCaptureContextRelated.js +1 -1
  20. package/build/js/DataCaptureContextSettings.js +1 -1
  21. package/build/js/DataCaptureError.js +1 -1
  22. package/build/js/DataCaptureVersion.js +1 -1
  23. package/build/js/DataCaptureView.d.ts +3 -1
  24. package/build/js/DataCaptureView.js +1 -1
  25. package/build/js/DataCaptureViewPlusRelated.js +1 -1
  26. package/build/js/DefaultViewClassnames.js +1 -1
  27. package/build/js/Defaults.d.ts +3 -1
  28. package/build/js/Defaults.js +1 -1
  29. package/build/js/Feedback.js +1 -1
  30. package/build/js/FrameData.d.ts +3 -1
  31. package/build/js/FrameData.js +1 -1
  32. package/build/js/ImageFrameSource.d.ts +3 -1
  33. package/build/js/ImageFrameSource.js +1 -1
  34. package/build/js/LoadingStatus.js +1 -1
  35. package/build/js/Localization.js +1 -1
  36. package/build/js/LocationSelection.js +1 -1
  37. package/build/js/RectangularViewfinder.js +1 -1
  38. package/build/js/ScanditIcon.d.ts +50 -0
  39. package/build/js/ScanditIcon.js +1 -0
  40. package/build/js/ScanditIconBuilder.d.ts +63 -0
  41. package/build/js/ScanditIconBuilder.js +1 -0
  42. package/build/js/SingleImageUploader.d.ts +3 -1
  43. package/build/js/SingleImageUploader.js +1 -1
  44. package/build/js/SingleImageUploaderSettings.js +1 -1
  45. package/build/js/Sound.js +1 -1
  46. package/build/js/Vibration.js +1 -1
  47. package/build/js/ViewControls.js +1 -1
  48. package/build/js/Viewfinder.js +1 -1
  49. package/build/js/ViewfinderPlusRelated.js +1 -1
  50. package/build/js/assets/beepSound.js +1 -1
  51. package/build/js/assets/folderImage.js +1 -1
  52. package/build/js/assets/index.d.js +0 -1
  53. package/build/js/assets/index.js +1 -1
  54. package/build/js/assets/scanningByScandit.js +1 -1
  55. package/build/js/assets/transparentPixelImage.js +1 -1
  56. package/build/js/browserCompatibility.js +1 -1
  57. package/build/js/browserHelper.js +1 -1
  58. package/build/js/chunks/chunk-2DXPVHBJ.js +0 -1
  59. package/build/js/chunks/chunk-2Q5FZVGV.js +1 -3
  60. package/build/js/chunks/chunk-2WN7BGOB.js +1 -6
  61. package/build/js/chunks/chunk-3A4KLILV.js +1 -3
  62. package/build/js/chunks/chunk-457L5N2F.js +1 -6
  63. package/build/js/chunks/chunk-46WJFV3I.js +1 -8
  64. package/build/js/chunks/chunk-4YVKSEZS.js +1 -0
  65. package/build/js/chunks/chunk-4ZMCJXZS.js +1 -3
  66. package/build/js/chunks/chunk-5DETRQ7Y.js +1 -0
  67. package/build/js/chunks/{chunk-M46MIHI5.js → chunk-5E7ISPKS.js} +2 -8
  68. package/build/js/chunks/chunk-5LIWL2C4.js +1 -3
  69. package/build/js/chunks/chunk-5PHKPYK6.js +1 -0
  70. package/build/js/chunks/chunk-5RW5274G.js +0 -1
  71. package/build/js/chunks/chunk-5S537AFM.js +1 -3
  72. package/build/js/chunks/chunk-5TKCHVG2.js +1 -5
  73. package/build/js/chunks/chunk-64US32RY.js +5 -0
  74. package/build/js/chunks/chunk-6H6FKGVE.js +1 -3
  75. package/build/js/chunks/chunk-6MF4F3EH.js +1 -0
  76. package/build/js/chunks/chunk-6UJOYR5F.js +1 -0
  77. package/build/js/chunks/chunk-6W7FX6LD.js +1 -3
  78. package/build/js/chunks/chunk-72DAONJI.js +1 -5
  79. package/build/js/chunks/{chunk-T7URG4IQ.js → chunk-76CQG6HG.js} +2 -10
  80. package/build/js/chunks/{chunk-GWI2ZHMO.js → chunk-7ALHRD5L.js} +2 -11
  81. package/build/js/chunks/{chunk-TCJPGGHY.js → chunk-7B2VPGLP.js} +2 -8
  82. package/build/js/chunks/chunk-7JX43F4O.js +1 -0
  83. package/build/js/chunks/chunk-7SW2PEHB.js +1 -3
  84. package/build/js/chunks/chunk-7XQ3GHYH.js +1 -3
  85. package/build/js/chunks/chunk-AD3CNBDO.js +1 -0
  86. package/build/js/chunks/chunk-AIRWHLJH.js +1 -5
  87. package/build/js/chunks/chunk-B5JOQVFY.js +2 -6
  88. package/build/js/chunks/chunk-BDLLVGRH.js +1 -3
  89. package/build/js/chunks/chunk-BIGR7VVJ.js +1 -8
  90. package/build/js/chunks/{chunk-TBCW7RDM.js → chunk-BWOCR6MD.js} +2 -12
  91. package/build/js/chunks/chunk-CAIEX6BZ.js +1 -0
  92. package/build/js/chunks/chunk-DMOXDUF6.js +1 -6
  93. package/build/js/chunks/chunk-DVQH5JLR.js +1 -0
  94. package/build/js/chunks/chunk-EHMSDFH7.js +1 -5
  95. package/build/js/chunks/chunk-EP3GI7KA.js +1 -3
  96. package/build/js/chunks/chunk-EQRBQJYM.js +1 -3
  97. package/build/js/chunks/chunk-EV4OEANA.js +1 -3
  98. package/build/js/chunks/{chunk-5IVFVUF4.js → chunk-FFFXM7UY.js} +2 -8
  99. package/build/js/chunks/chunk-FGCJ3ZLG.js +1 -2
  100. package/build/js/chunks/chunk-FGO2SSRS.js +1 -3
  101. package/build/js/chunks/chunk-FNFCPBQI.js +1 -0
  102. package/build/js/chunks/chunk-FTD535WI.js +1 -3
  103. package/build/js/chunks/chunk-G33OCZIN.js +1 -0
  104. package/build/js/chunks/chunk-GAVFMG2G.js +1 -0
  105. package/build/js/chunks/chunk-GE4CBD4E.js +1 -3
  106. package/build/js/chunks/chunk-GPJEB376.js +1 -5
  107. package/build/js/chunks/chunk-GSJH2EXJ.js +2 -6
  108. package/build/js/chunks/chunk-GX4YCYCH.js +1 -3
  109. package/build/js/chunks/chunk-GZ4F55TI.js +1 -0
  110. package/build/js/chunks/chunk-H4TH4342.js +1 -3
  111. package/build/js/chunks/{chunk-3FDT22IX.js → chunk-HC2AMLBI.js} +1 -3
  112. package/build/js/chunks/chunk-HDW5KYJV.js +1 -0
  113. package/build/js/chunks/chunk-IGJQFAQU.js +1 -3
  114. package/build/js/chunks/chunk-IQ5KX55O.js +1 -0
  115. package/build/js/chunks/chunk-J2UL6U3I.js +1 -3
  116. package/build/js/chunks/chunk-JFRSUCMO.js +1 -3
  117. package/build/js/chunks/chunk-JKL2W65E.js +1 -3
  118. package/build/js/chunks/chunk-JO2MKLMM.js +1 -0
  119. package/build/js/chunks/chunk-JRBLEJMD.js +1 -0
  120. package/build/js/chunks/chunk-JS3T7K2Z.js +1 -3
  121. package/build/js/chunks/chunk-JXJQSWYG.js +1 -3
  122. package/build/js/chunks/chunk-KCNXUTBL.js +2 -7
  123. package/build/js/chunks/chunk-KRWPFM7Z.js +1 -0
  124. package/build/js/chunks/chunk-KYNYQBNF.js +1 -3
  125. package/build/js/chunks/chunk-L2STPTEN.js +1 -3
  126. package/build/js/chunks/chunk-L5H6R4AV.js +21 -0
  127. package/build/js/chunks/chunk-LA6TM76R.js +1 -3
  128. package/build/js/chunks/chunk-LDJ53PEJ.js +1 -0
  129. package/build/js/chunks/chunk-MNUHPMUS.js +1 -0
  130. package/build/js/chunks/chunk-MRFUL2AA.js +1 -0
  131. package/build/js/chunks/{chunk-6OQQP3SM.js → chunk-MST2ECFN.js} +2 -9
  132. package/build/js/chunks/chunk-MU4VAJIM.js +2 -6
  133. package/build/js/chunks/chunk-MW5PTAU7.js +1 -3
  134. package/build/js/chunks/chunk-N5YZEC56.js +1 -3
  135. package/build/js/chunks/chunk-NMROJLGQ.js +1 -5
  136. package/build/js/chunks/chunk-NMX4VHW2.js +1 -5
  137. package/build/js/chunks/chunk-NQC64CT7.js +1 -0
  138. package/build/js/chunks/chunk-O7TZTIHO.js +1 -3
  139. package/build/js/chunks/chunk-PWRWWFPG.js +1 -0
  140. package/build/js/chunks/chunk-Q7JWDX4U.js +1 -3
  141. package/build/js/chunks/chunk-Q7NDC6TJ.js +1 -6
  142. package/build/js/chunks/chunk-QBDQQMQ5.js +1 -5
  143. package/build/js/chunks/chunk-QCRFVRSS.js +1 -3
  144. package/build/js/chunks/chunk-QCZSSQAQ.js +1 -3
  145. package/build/js/chunks/chunk-QHBIT2WY.js +1 -3
  146. package/build/js/chunks/{chunk-ARJASUTK.js → chunk-QK3D2DQM.js} +2 -15
  147. package/build/js/chunks/chunk-R2VJDRLZ.js +1 -0
  148. package/build/js/chunks/chunk-R6E4CT22.js +1 -3
  149. package/build/js/chunks/chunk-RIMH6UPR.js +1 -0
  150. package/build/js/chunks/chunk-RQQK6Z5F.js +1 -2
  151. package/build/js/chunks/chunk-SK6L34IF.js +1 -5
  152. package/build/js/chunks/chunk-T3AOBMAS.js +1 -3
  153. package/build/js/chunks/chunk-T5EUB6UG.js +1 -6
  154. package/build/js/chunks/chunk-T5QHKJ2U.js +1 -0
  155. package/build/js/chunks/chunk-TM7QAJVA.js +1 -0
  156. package/build/js/chunks/chunk-U6BTTEV6.js +1 -3
  157. package/build/js/chunks/chunk-UHFABUTI.js +1 -3
  158. package/build/js/chunks/chunk-ULRY4SXF.js +1 -7
  159. package/build/js/chunks/chunk-UZWBB65W.js +1 -3
  160. package/build/js/chunks/chunk-VJB527QZ.js +1 -3
  161. package/build/js/chunks/chunk-WUHKODFA.js +1 -3
  162. package/build/js/chunks/chunk-XR65N6EG.js +1 -3
  163. package/build/js/chunks/chunk-YEMIFGKZ.js +1 -0
  164. package/build/js/chunks/chunk-YGFWA4WG.js +1 -6
  165. package/build/js/chunks/chunk-YRNH7TIR.js +0 -1
  166. package/build/js/chunks/chunk-ZDYFZYVT.js +1 -0
  167. package/build/js/chunks/chunk-ZKROZLQ4.js +1 -2
  168. package/build/js/chunks/chunk-ZVBD3EW5.js +1 -3
  169. package/build/js/global.d.js +0 -1
  170. package/build/js/index.d.ts +7 -3
  171. package/build/js/index.js +3 -51
  172. package/build/js/license/OpenSourceSoftwareLicenseInfo.js +1 -1
  173. package/build/js/logger.js +1 -1
  174. package/build/js/private/AnchorPositions.d.ts +13 -0
  175. package/build/js/private/AnchorPositions.js +1 -1
  176. package/build/js/private/CameraAccess.d.ts +3 -1
  177. package/build/js/private/CameraAccess.js +1 -1
  178. package/build/js/private/CameraManager.d.ts +3 -1
  179. package/build/js/private/CameraManager.js +1 -1
  180. package/build/js/private/CanvasDrawer.js +1 -1
  181. package/build/js/private/CanvasDrawerWithMetrics.d.ts +3 -1
  182. package/build/js/private/CanvasDrawerWithMetrics.js +1 -1
  183. package/build/js/private/CavansDrawerAbstract.js +1 -1
  184. package/build/js/private/CoreModuleLicenseTextProvider.d.ts +3 -1
  185. package/build/js/private/CoreModuleLicenseTextProvider.js +1 -1
  186. package/build/js/private/CustomLocationsView.js +1 -1
  187. package/build/js/private/CustomLocationsViewStyles.js +1 -1
  188. package/build/js/private/DataCaptureContextRelated.d.ts +3 -1
  189. package/build/js/private/DataCaptureContextRelated.js +0 -1
  190. package/build/js/private/DrawCommandBuffer.js +1 -1
  191. package/build/js/private/EventManager.d.ts +1 -1
  192. package/build/js/private/EventManager.js +1 -1
  193. package/build/js/private/FrameReaders/FrameReader.d.ts +3 -1
  194. package/build/js/private/FrameReaders/FrameReader.js +1 -1
  195. package/build/js/private/FrameReaders/FrameReaderAbstract.d.ts +3 -1
  196. package/build/js/private/FrameReaders/FrameReaderAbstract.js +1 -1
  197. package/build/js/private/FrameReaders/GrayScaleFrameReader.d.ts +3 -1
  198. package/build/js/private/FrameReaders/GrayScaleFrameReader.js +1 -1
  199. package/build/js/private/FrameReaders/WatermarkStack.js +1 -1
  200. package/build/js/private/FrameReaders/index.d.ts +3 -1
  201. package/build/js/private/FrameReaders/index.js +1 -2
  202. package/build/js/private/FrameReaders/webglUtilities.js +1 -1
  203. package/build/js/private/GestureRecognizer/GestureRecognizer.js +1 -1
  204. package/build/js/private/GestureRecognizer/PointerEventsDetector.js +1 -1
  205. package/build/js/private/GestureRecognizer/index.js +1 -1
  206. package/build/js/private/Helper.js +1 -1
  207. package/build/js/private/HtmlElementState.js +1 -1
  208. package/build/js/private/ModuleLicenseTextProvider.js +0 -1
  209. package/build/js/private/NormalizedConfigureOptions.d.ts +5 -1
  210. package/build/js/private/NormalizedConfigureOptions.js +0 -1
  211. package/build/js/private/OrientationObserver.js +1 -1
  212. package/build/js/private/Serializable.js +0 -1
  213. package/build/js/private/SingleImageUploaderView.js +1 -1
  214. package/build/js/private/SingleImageUploaderViewStyles.js +1 -1
  215. package/build/js/private/View.js +0 -1
  216. package/build/js/private/ViewClassNames.js +1 -1
  217. package/build/js/private/ViewControls+related.js +1 -1
  218. package/build/js/private/ViewControls_related.d.ts +3 -1
  219. package/build/js/private/ViewStyles.js +1 -1
  220. package/build/js/private/ViewsRegistry.d.ts +3 -1
  221. package/build/js/private/ViewsRegistry.js +1 -1
  222. package/build/js/private/hybridDesktopPlatformHelpers.js +1 -1
  223. package/build/js/private/multithreadSimdHelper.js +1 -1
  224. package/build/js/private/ui/atoms/ArrowDownSvgIcon.d.ts +17 -0
  225. package/build/js/private/ui/atoms/ArrowDownSvgIcon.js +21 -0
  226. package/build/js/private/ui/atoms/ArrowLeftSvgIcon.d.ts +17 -0
  227. package/build/js/private/ui/atoms/ArrowLeftSvgIcon.js +21 -0
  228. package/build/js/private/ui/atoms/ArrowRightSvgIcon.d.ts +17 -0
  229. package/build/js/private/ui/atoms/ArrowRightSvgIcon.js +21 -0
  230. package/build/js/private/ui/atoms/ArrowUpSvgIcon.d.ts +17 -0
  231. package/build/js/private/ui/atoms/ArrowUpSvgIcon.js +21 -0
  232. package/build/js/private/ui/atoms/ArrowsUp.js +1 -1
  233. package/build/js/private/ui/atoms/CalendarExclamationMarkSvgIcon.d.ts +17 -0
  234. package/build/js/private/ui/atoms/CalendarExclamationMarkSvgIcon.js +19 -0
  235. package/build/js/private/ui/atoms/CameraSwitchReverseSvgIcon.d.ts +17 -0
  236. package/build/js/private/ui/atoms/CameraSwitchReverseSvgIcon.js +27 -0
  237. package/build/js/private/ui/atoms/CameraSwitchSvgIcon.d.ts +17 -0
  238. package/build/js/private/ui/atoms/CameraSwitchSvgIcon.js +27 -0
  239. package/build/js/private/ui/atoms/CheckSvgIcon.d.ts +17 -0
  240. package/build/js/private/ui/atoms/CheckSvgIcon.js +15 -0
  241. package/build/js/private/ui/atoms/ChevronDownSvgIcon.d.ts +17 -0
  242. package/build/js/private/ui/atoms/ChevronDownSvgIcon.js +21 -0
  243. package/build/js/private/ui/atoms/ChevronLeftSvgIcon.d.ts +17 -0
  244. package/build/js/private/ui/atoms/ChevronLeftSvgIcon.js +21 -0
  245. package/build/js/private/ui/atoms/ChevronRightSvgIcon.d.ts +17 -0
  246. package/build/js/private/ui/atoms/ChevronRightSvgIcon.js +20 -0
  247. package/build/js/private/ui/atoms/ChevronUpSvgIcon.d.ts +17 -0
  248. package/build/js/private/ui/atoms/ChevronUpSvgIcon.js +21 -0
  249. package/build/js/private/ui/atoms/CrossSvgIcon.d.ts +17 -0
  250. package/build/js/private/ui/atoms/CrossSvgIcon.js +12 -0
  251. package/build/js/private/ui/atoms/Dot5xSvgIcon.d.ts +17 -0
  252. package/build/js/private/ui/atoms/Dot5xSvgIcon.js +21 -0
  253. package/build/js/private/ui/atoms/ExclamationMarkSvgIcon.d.ts +17 -0
  254. package/build/js/private/ui/atoms/ExclamationMarkSvgIcon.js +11 -0
  255. package/build/js/private/ui/atoms/GlassSvgIcon.d.ts +17 -0
  256. package/build/js/private/ui/atoms/GlassSvgIcon.js +15 -0
  257. package/build/js/private/ui/atoms/HandLensCheckSvgIcon.d.ts +17 -0
  258. package/build/js/private/ui/atoms/HandLensCheckSvgIcon.js +16 -0
  259. package/build/js/private/ui/atoms/LowStockSvgIcon.d.ts +17 -0
  260. package/build/js/private/ui/atoms/LowStockSvgIcon.js +12 -0
  261. package/build/js/private/ui/atoms/OnexSvgIcon.d.ts +17 -0
  262. package/build/js/private/ui/atoms/OnexSvgIcon.js +13 -0
  263. package/build/js/private/ui/atoms/PrinterSvgIcon.d.ts +17 -0
  264. package/build/js/private/ui/atoms/PrinterSvgIcon.js +24 -0
  265. package/build/js/private/ui/atoms/ProgressBar.js +1 -1
  266. package/build/js/private/ui/atoms/QuestionMarkSvgIcon.d.ts +17 -0
  267. package/build/js/private/ui/atoms/QuestionMarkSvgIcon.js +13 -0
  268. package/build/js/private/ui/atoms/RoundedCheckSvgIcon.js +1 -1
  269. package/build/js/private/ui/atoms/RoundedExclamationMarkSvgIcon.js +1 -1
  270. package/build/js/private/ui/atoms/ShutterButton.js +2 -9
  271. package/build/js/private/ui/atoms/StarFilledSvgIcon.d.ts +17 -0
  272. package/build/js/private/ui/atoms/StarFilledSvgIcon.js +13 -0
  273. package/build/js/private/ui/atoms/StarHalfFilledSvgIcon.d.ts +17 -0
  274. package/build/js/private/ui/atoms/StarHalfFilledSvgIcon.js +32 -0
  275. package/build/js/private/ui/atoms/StarOutlinedSvgIcon.d.ts +17 -0
  276. package/build/js/private/ui/atoms/StarOutlinedSvgIcon.js +13 -0
  277. package/build/js/private/ui/atoms/SvgIcon.js +1 -1
  278. package/build/js/private/ui/atoms/ToPickSvgIcon.d.ts +17 -0
  279. package/build/js/private/ui/atoms/ToPickSvgIcon.js +12 -0
  280. package/build/js/private/ui/atoms/Toast.d.ts +2 -1
  281. package/build/js/private/ui/atoms/Toast.js +1 -1
  282. package/build/js/private/ui/atoms/TwoxSvgIcon.d.ts +17 -0
  283. package/build/js/private/ui/atoms/TwoxSvgIcon.js +14 -0
  284. package/build/js/private/ui/atoms/WrongItemSvgIcon.d.ts +17 -0
  285. package/build/js/private/ui/atoms/WrongItemSvgIcon.js +15 -0
  286. package/build/js/private/ui/colors.d.ts +2 -1
  287. package/build/js/private/ui/colors.js +1 -1
  288. package/build/js/private/ui/molecules/HintPresenter.d.ts +2 -1
  289. package/build/js/private/ui/molecules/HintPresenter.js +1 -1
  290. package/build/js/private/ui/molecules/LoadingOverlay.js +1 -1
  291. package/build/js/private/unsupportedBrowserError.js +1 -1
  292. package/build/js/private/utils/ScanditHTMLElement.js +1 -1
  293. package/build/js/private/utils/clamp.js +1 -1
  294. package/build/js/private/utils/css.js +1 -1
  295. package/build/js/private/utils/debounce.js +1 -1
  296. package/build/js/private/utils/deferred.js +1 -1
  297. package/build/js/private/utils/defineCustomElements.js +1 -1
  298. package/build/js/private/utils/html.js +1 -1
  299. package/build/js/private/utils/index.js +1 -15
  300. package/build/js/private/utils/isObject.js +1 -1
  301. package/build/js/private/utils/isWorkerScope.js +1 -1
  302. package/build/js/private/utils/match.js +1 -1
  303. package/build/js/private/utils/quadrilateralUtils.d.ts +8 -0
  304. package/build/js/private/utils/quadrilateralUtils.js +1 -0
  305. package/build/js/private/utils/throttle.js +1 -1
  306. package/build/js/private/utils/timeout.js +1 -1
  307. package/build/js/private/utils/unknownErrorToString.js +1 -1
  308. package/build/js/private/utils/wait.js +1 -1
  309. package/build/js/private/utils/waitTransitionEndForElement.js +1 -1
  310. package/build/js/sdk.d.ts +3 -1
  311. package/build/js/sdk.js +1 -1
  312. package/build/js/translations.js +1 -1
  313. package/build/js/tsHelper.js +1 -1
  314. package/build/js/worker/OverrideState.js +1 -1
  315. package/build/js/worker/WorkerMain.d.ts +3 -1
  316. package/build/js/worker/WorkerMain.js +1 -1
  317. package/build/js/worker/dataCapture.inlineWorker.d.ts +3 -1
  318. package/build/js/worker/dataCapture.inlineWorker.js +1 -1
  319. package/build/js/worker/dataCaptureEngine.d.ts +3 -1
  320. package/build/js/worker/dataCaptureEngine.js +1 -1
  321. package/build/js/worker/dataCaptureLoader.d.ts +3 -1
  322. package/build/js/worker/dataCaptureLoader.js +1 -1
  323. package/build/js/worker/dataCaptureWorkerRelated.d.ts +3 -1
  324. package/build/js/worker/dataCaptureWorkerRelated.js +1 -1
  325. package/build/js/worker/helper.js +1 -1
  326. package/build/js/worker/helperFetch.js +1 -1
  327. package/build/js/worker/helperFs.d.ts +0 -2
  328. package/build/js/worker/helperFs.js +1 -1
  329. package/build/js/worker/importWasmScript.js +1 -1
  330. package/build/js/worker/index.d.ts +3 -1
  331. package/build/js/worker/index.js +1 -4
  332. package/build/js/worker/inlineWorker.d.js +0 -1
  333. package/package.json +2 -2
  334. package/build/js/chunks/chunk-2WQHYCZC.js +0 -6
  335. package/build/js/chunks/chunk-34FEFSCI.js +0 -6
  336. package/build/js/chunks/chunk-3V7ZD6JQ.js +0 -14
  337. package/build/js/chunks/chunk-44B7Z6ZZ.js +0 -5
  338. package/build/js/chunks/chunk-6O3B7VJJ.js +0 -6
  339. package/build/js/chunks/chunk-ABRFVD7T.js +0 -5
  340. package/build/js/chunks/chunk-E2VUMNY4.js +0 -16
  341. package/build/js/chunks/chunk-EFJGQ4BT.js +0 -3
  342. package/build/js/chunks/chunk-HNMM5VR6.js +0 -6
  343. package/build/js/chunks/chunk-J6Q5HITP.js +0 -47
  344. package/build/js/chunks/chunk-KAZWF3JC.js +0 -5
  345. package/build/js/chunks/chunk-KW3YSGJX.js +0 -5
  346. package/build/js/chunks/chunk-MAMZS5CH.js +0 -7
  347. package/build/js/chunks/chunk-MKHBE7BB.js +0 -6
  348. package/build/js/chunks/chunk-MOKCZFZV.js +0 -10
  349. package/build/js/chunks/chunk-MSPQDVWJ.js +0 -5
  350. package/build/js/chunks/chunk-N4NOODAT.js +0 -3
  351. package/build/js/chunks/chunk-N5F43TUJ.js +0 -5
  352. package/build/js/chunks/chunk-NNLX5HO4.js +0 -10
  353. package/build/js/chunks/chunk-PXXUQXGB.js +0 -7
  354. package/build/js/chunks/chunk-SKRKDAFC.js +0 -13
  355. package/build/js/chunks/chunk-TVDFY6ME.js +0 -5
  356. package/build/js/chunks/chunk-TWBD6OC5.js +0 -9
  357. package/build/js/chunks/chunk-UPUPKPEP.js +0 -8
  358. package/build/js/chunks/chunk-V76YCTVB.js +0 -5
  359. package/build/js/chunks/chunk-W7LJM2QO.js +0 -5
  360. package/build/js/chunks/chunk-WSG6WSZN.js +0 -6
  361. package/build/js/chunks/chunk-XVLYCDJL.js +0 -7
  362. package/build/js/chunks/chunk-ZSYUKWWL.js +0 -5
  363. /package/{THIRD-PARTY.txt → THIRD_PARTY.txt} +0 -0
@@ -1,47 +0,0 @@
1
- import { b as b$3 } from './chunk-E2VUMNY4.js';
2
- import { a as a$6 } from './chunk-GWI2ZHMO.js';
3
- import { a as a$2 } from './chunk-N5YZEC56.js';
4
- import { b, a as a$3 } from './chunk-5S537AFM.js';
5
- import { a as a$c } from './chunk-46WJFV3I.js';
6
- import { d as d$2, c, b as b$4 } from './chunk-TWBD6OC5.js';
7
- import { a as a$e } from './chunk-WSG6WSZN.js';
8
- import { a as a$a } from './chunk-44B7Z6ZZ.js';
9
- import { a as a$5 } from './chunk-N5F43TUJ.js';
10
- import { a as a$f } from './chunk-DMOXDUF6.js';
11
- import { b as b$1 } from './chunk-457L5N2F.js';
12
- import { a as a$7 } from './chunk-PXXUQXGB.js';
13
- import { a as a$b } from './chunk-XVLYCDJL.js';
14
- import { a as a$8 } from './chunk-KYNYQBNF.js';
15
- import { a as a$h } from './chunk-ZKROZLQ4.js';
16
- import { a as a$1 } from './chunk-VJB527QZ.js';
17
- import { a as a$9 } from './chunk-NMX4VHW2.js';
18
- import { a } from './chunk-7XQ3GHYH.js';
19
- import { d as d$1 } from './chunk-SKRKDAFC.js';
20
- import { a as a$d } from './chunk-XR65N6EG.js';
21
- import { d } from './chunk-UPUPKPEP.js';
22
- import { a as a$4, b as b$2, i, f } from './chunk-N4NOODAT.js';
23
- import { a as a$g } from './chunk-WUHKODFA.js';
24
-
25
- var w="core.camera.recovery",B=class q{constructor(){this.focusGesture=d.DataCaptureView.focusGesture;this.zoomGesture=d.DataCaptureView.zoomGesture;this._scanAreaMargins=d.DataCaptureView.scanAreaMargins;this._pointOfInterest=d.DataCaptureView.pointOfInterest;this._logoStyle=d.DataCaptureView.logoStyle;this._logoAnchor=d.DataCaptureView.logoAnchor;this._logoOffset=d.DataCaptureView.logoOffset;this._context=null;this.overlays=[];this.controls=[];this.controlWidgets=new WeakMap;this.frozenFrameCanvas=document.createElement("canvas");this.listeners=[];this.isVideoElementDetached=!1;this.orientation="portrait";this.hiddenProperties={stopVideoTracksOnVisibilityChange:!0,freezeFrameWhenStoppingFrameSource:!0};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.visibilityListener=this.onVisibilityChange.bind(this),this.cameraRecoveryListener=this.cameraRecovery.bind(this),a.getInstance().updateIfMissing(a$1);}get scanAreaMargins(){return this._scanAreaMargins}set scanAreaMargins(e){var t;this._scanAreaMargins=e,(t=this.privateContext)==null||t.update();}get pointOfInterest(){return this._pointOfInterest}set pointOfInterest(e){var t;this._pointOfInterest=e,(t=this.privateContext)==null||t.update();}get logoStyle(){return this._logoStyle}set logoStyle(e){var t;this._logoStyle=e,(t=this.privateContext)==null||t.update();}get logoAnchor(){return this._logoAnchor}set logoAnchor(e){var t;this._logoAnchor=e,(t=this.privateContext)==null||t.update();}get logoOffset(){return this._logoOffset}set logoOffset(e){var t;this._logoOffset=e,(t=this.privateContext)==null||t.update();}get cameraRecoveryText(){return a.getInstance().get(w)}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 q;return await t.setContext(e),t}showProgressBar(){var e;(e=this.loadingOverlay)==null||e.show();}hideProgressBar(){var e;(e=this.loadingOverlay)==null||e.hide();}setProgressBarPercentage(e){this.loadingOverlay&&(this.loadingOverlay.progress=e);}setProgressBarMessage(e){this.loadingOverlay&&(this.loadingOverlay.message=e);}getContext(){return this._context}async setContext(e){var t,i,n;if(this._context=e,e){if(this.overlays.length>0&&((t=this.privateContext)==null?void 0:t.modes.size)===0)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),(n=this._context)!=null&&n.frameSource&&await this.onFrameSourceChange(this._context.frameSource);}}connectToElement(e){var t,i,n;this.orientationObserver.register(),this.setupHtmlElement(e),(t=this.canvasDrawer)==null||t.startObservingCanvasResize(),this.htmlElementDidChange(),a$2.add(this),this.orientation=this.orientationObserver.orientation.value,this.orientationObserver.addEventListener(a$3,this.onOrientationChangeListener),(i=this.hintPresenter)==null||i.addEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(n=this.hintPresenter)==null||n.addEventListener("willshow",this.onBeforeShowToastsHandler),this.localizationSubscription=a.getInstance().subscribe(a=>{a[w]!=null&&(this.cameraRecoveryElement.textContent=a[w]);});}detachFromElement(){var e,t,i,n,a,o,l,m;(e=this.htmlElementState)==null||e.removeListeners(),this.removeStyles(),(t=this.canvasDrawer)==null||t.endObservingCanvasResize(),document.removeEventListener("visibilitychange",this.visibilityListener);for(let h of ["touchend","mousedown"])this.cameraRecoveryElement.removeEventListener(h,this.cameraRecoveryListener);(i=this.loadingOverlay)==null||i.remove(),(n=this.customLocationsView)==null||n.unmount(),this.htmlElementDidChange(),(a=this.gestureRecognizer)==null||a.removeAllListeners(),this.clearHtmlElementContent(),a$2.delete(this),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(a$3,this.onOrientationChangeListener),(o=this.hintPresenter)==null||o.removeEventListener("hintpresenterupdate",this.onHintPresenterUpdateHandler),(l=this.hintPresenter)==null||l.removeEventListener("willshow",this.onBeforeShowToastsHandler),(m=this.localizationSubscription)==null||m.cancel();}async addOverlay(e){var t;this.overlays.includes(e)||(this.overlays.push(e),await((t=this.privateContext)==null?void 0:t.update([{type:"addOverlay",newValue:e}])));}async removeOverlay(e){var t;this.overlays.includes(e)&&(this.overlays.splice(this.overlays.indexOf(e),1),await((t=this.privateContext)==null?void 0:t.update([{type:"removeOverlay",newValue: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 v,b,O,P,L,V,D,A;let t={width:(b=(v=this.htmlElementState)==null?void 0:v.width)!=null?b:0,height:(P=(O=this.htmlElementState)==null?void 0:O.height)!=null?P:0},i={width:(V=(L=this.videoElement)==null?void 0:L.videoWidth)!=null?V:0,height:(A=(D=this.videoElement)==null?void 0:D.videoHeight)!=null?A:0},n=t.width/t.height,a=i.width/i.height,o=n>a?t.width/i.width:t.height/i.height,l={x:e.x*o,y:e.y*o},m=(i.width*o-t.width)/2,h=(i.height*o-t.height)/2;return new a$4(l.x-m,l.y-h)}viewQuadrilateralForFrameQuadrilateral(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),n=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight);return new b$2(t,i,a,n)}addControl(e){var t;this.controls.includes(e)||(e.view=this,this.controls.push(e),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:"addControl",newValue:e}]));}removeControl(e){var t;if(this.controls.includes(e)){e.view=null;let i=this.controls.splice(this.controls.indexOf(e),1);this.getControlWidget(i[0]).remove(!0),this.controlsUpdated(),(t=this.privateContext)==null||t.update([{type:"removeControl",newValue:e}]);}}toJSONObject(){var e;return {scanAreaMargins:this.scanAreaMargins.toJSONObject(),pointOfInterest:this.pointOfInterest.toJSONObject(),logoAnchor:this.logoAnchor,logoOffset:this.logoOffset.toJSONObject(),logoHidden:(e=this.logoHidden)!=null?e:!1,logoStyle:this.logoStyle,overlays:this.overlays.map(t=>t.toJSONObject()),controls:this.controls.map(t=>t.toJSONObject()),focusGesture:this.focusGesture?this.focusGesture.toJSONObject():null,zoomGesture:this.zoomGesture?this.zoomGesture.toJSONObject():null}}isCameraRecoveryVisible(){return !this.cameraRecoveryElement.hidden}setCameraRecoveryVisible(e){this.cameraRecoveryElement.hidden=!e;}async allowPictureInPicture(e){await d$1.instance().allowPictureInPicture(e);}viewAnchorPositionsForFrameAnchorPositions(e){let t=this.viewPointForFramePoint(e.topLeft),i=this.viewPointForFramePoint(e.topRight),n=this.viewPointForFramePoint(e.bottomLeft),a=this.viewPointForFramePoint(e.bottomRight),o=this.viewPointForFramePoint(e.centerLeft),l=this.viewPointForFramePoint(e.centerRight),m=this.viewPointForFramePoint(e.topCenter),h=this.viewPointForFramePoint(e.bottomCenter),v=this.viewPointForFramePoint(e.center);return new a$5(t,i,a,n,o,m,l,h,v)}setDidTapCustomLocationsViewListener(e){this.customLocationsView&&this.customLocationsView.listener===null&&(this.customLocationsView.listener=e);}renderCustomLocationsView(e){this.customLocationsView!=null&&(this.customLocationsView.setMirrored(d$1.instance().isMirrorImageEnabled()),this.customLocationsView.render(e));}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 o,l,m;this.createStyles(),this.htmlElement=e,b$3.register();let t=`
26
- <div class="${a$9.CONTAINER_CLASS_NAME}">
27
- <div class="${a$9.PAINTBOARDS_CONTAINER_CLASS_NAME}">
28
- <div data-js-id="loading-overlay"></div>
29
- <div class="${a$9.PAINTBOARD_CLASS_NAME}" data-js-id="camera-paintboard">
30
- <video autoplay="autoplay" playsinline="true" muted="muted" poster="${a$h}" style="opacity: 0;"></video>
31
- <img class="${a$9.FROZEN_FRAME}" data-js-id="frozen-frame" alt="frozen-frame" hidden />
32
- <canvas></canvas>
33
- <div data-js-id="${a$8.CUSTOM_VIEW_CONTAINER}"></div>
34
- <div class="${a$9.HINT_CONTAINER_CLASS_NAME}">
35
- <div class="${a$9.HINT_CLASS_NAME}" hidden></div>
36
- </div>
37
- <${b$3.tag}></${b$3.tag}>
38
- <div class="${a$9.CONTROLS_CLASS_NAME}"></div>
39
- <div class="${a$9.CAMERA_RECOVERY_CLASS_NAME}" hidden>${this.cameraRecoveryText}</div>
40
- <div class="${a$9.ERROR_CLASS_NAME}" hidden></div>
41
- </div>
42
- <div class="${a$9.PAINTBOARD_CLASS_NAME}" data-js-id="singleimage-paintboard"></div>
43
- </div>
44
- </div>
45
- `;this.htmlElement.innerHTML=t,this.hintPresenter=this.htmlElement.querySelector(b$3.tag),this.loadingOverlay&&this.loadingOverlay.remove(),this.loadingOverlay=a$6.create(),this.loadingOverlay.hide(),(o=this.htmlElement.querySelector('[data-js-id="loading-overlay"]'))==null||o.replaceWith(this.loadingOverlay),this.customLocationsView&&this.customLocationsView.unmount(),this.customLocationsView=new a$7,this.customLocationsView.mount(this.htmlElement.querySelector(`[data-js-id="${a$8.CUSTOM_VIEW_CONTAINER}"]`)),this.customLocationsView.mapViewAnchorPositionsForFramePoint=h=>this.viewAnchorPositionsForFrameAnchorPositions(h),this.containerElement=this.htmlElement.querySelector(`.${a$9.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 n=this.cameraPaintboardElement.querySelector('[data-js-id="frozen-frame"]');this.frozenFrame==null?this.frozenFrame=n:n.replaceWith(this.frozenFrame),this.controlsElement=this.cameraPaintboardElement.querySelector(`.${a$9.CONTROLS_CLASS_NAME}`),this.cameraRecoveryElement=this.cameraPaintboardElement.querySelector(`.${a$9.CAMERA_RECOVERY_CLASS_NAME}`),this.errorElement=this.cameraPaintboardElement.querySelector(`.${a$9.ERROR_CLASS_NAME}`),this.hintContainerElement=this.cameraPaintboardElement.querySelector(`.${a$9.HINT_CONTAINER_CLASS_NAME}`),this.hintElement=this.cameraPaintboardElement.querySelector(`.${a$9.HINT_CLASS_NAME}`);let a=this.cameraPaintboardElement.querySelector("video");this.videoElement?a.replaceWith(this.videoElement):(this.videoElement=a,this.videoPauseListener=this.handleVideoPause.bind(this),this.videoElement.addEventListener("pause",this.videoPauseListener)),this.lastFrameSourceState!=null&&((m=(l=this._context)==null?void 0:l.frameSource)==null||m.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$a(this.htmlElement),this.htmlElementState.onStateChanged(this.htmlElementDidChange.bind(this)),this.htmlElementState.onDisconnected(this.htmlElementDisconnected.bind(this)),this.gestureRecognizer=new a$b(this.htmlElement),this.gestureRecognizer.addListener({onTap:async h=>{var v;(v=this.privateContext)==null||v.workerCommand("onTap",{point:h.toJSONObject()});}});}setupHtmlElementSingleImageUploader(e){var i;if(this.singleImageUploaderPaintboardElement==null)return;this.singleImageUploaderView&&this.singleImageUploaderView.unmount(),this.singleImageUploaderView=new a$c(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(n=>{t.getCurrentState()!=="starting"&&n.preventDefault();}),this.singleImageUploaderView.onBeforeFileRead(()=>{t._context&&this.singleImageUploaderView&&(this.singleImageUploaderView.canUploadFile=t._context.hasEnabledMode());}),this.singleImageUploaderView.onImageLoadError(()=>{t.currentState="starting",a$d.log(a$d.Level.Error,"Could not load image from selected file");}),this.singleImageUploaderView.onFileReaderError(n=>{var o,l;let a=n.target;t.currentState="starting",a$d.log(a$d.Level.Error,`Error while reading the file: ${(l=(o=a.error)==null?void 0:o.toString())!=null?l:""}`);}),this.singleImageUploaderView.onCaptureReady(async n=>{await t.processUploadedFileCapture(n);}),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$e();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$1,n;if(!this.htmlElementState)return;let e=this.htmlElementState,t=e.toJSONObject();if(!a$a.areEquivalentJSONStates(this.lastHtmlElementState,t)){this.orientation=this.orientationObserver.orientation.value,(i$1=this.privateContext)==null||i$1.update([{type:"viewChange",newValue:{...e.toJSONObject(),orientation:this.orientation}}]),this.lastHtmlElementState=t,(n=this.canvasDrawer)==null||n.updateCanvasSizeAttributes(this.width,this.height),this.handleVideoDisplay(t.visible);for(let a of this.listeners)typeof a.didChangeSize=="function"&&a.didChangeSize(this,new i(t.size.width.value,t.size.height.value),this.orientation);}}async htmlElementDisconnected(){var e,t,i,n,a,o,l;this.isVideoElementDetached=!1,(e=this.videoElement)==null||e.remove(),this.lastFrameSourceState=(i=(t=this._context)==null?void 0:t.frameSource)==null?void 0:i.getCurrentState(),await((a=(n=this._context)==null?void 0:n.frameSource)==null?void 0:a.switchToDesiredState("off")),await((l=this.privateContext)==null?void 0:l.update([{type:"viewChange",newValue:{...(o=this.htmlElementState)==null?void 0:o.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=!0):e&&this.isVideoElementDetached&&(this.cameraPaintboardElement.insertAdjacentElement("afterbegin",this.videoElement),this.isVideoElementDetached=!1,this.videoElement.style.removeProperty("visibility"),this.videoElement.removeAttribute("width"),this.videoElement.removeAttribute("height"),this.videoElement.style.removeProperty("opacity")));}isCanvasDrawerWithMetrics(e){return e instanceof a$f}onWorkerMessage(e){var t,i;switch(e.type){case"draw":{this.drawEngineCommands(e.payload);break}case"performanceMetricsReport":{let n=this._canvasDrawer;n!=null&&this.isCanvasDrawerWithMetrics(n)&&n.setPerformanceMetrics(e.payload);break}case"contextDidChangeStatus":{let n=a$g.fromJSON(e.payload);n.isValid||((t=this.loadingOverlay)==null||t.hide(),this.displayError(n));break}case"showHint":{this.displayHint(e.payload.text,e.payload.style);break}case"updateHint":{this.updateHint(e.payload.style);break}case"hideHint":{this.hideHint();break}default:{(i=this.hintPresenter)==null||i.handleMessage(e);break}}}async onBeforeShowToasts(){var t,i$1;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$1=this.hintPresenter)==null||i$1.setViewFinderRect(new f(new a$4(e.rect.origin.x,e.rect.origin.y),new i(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=!1;}clearError(){this.errorElement.textContent="",this.errorElement.hidden=!0;}displayHint(e,t){this.hintElement.textContent=e,this.hintElement.hidden=!1,this.updateHint(t);}hideHint(){this.hintElement.textContent="",this.hintElement.hidden=!0;}updateHint(e){this.hintElement.style.background=e.backgroundColor,this.hintElement.style.color=e.textColor,this.hintElement.style.fontSize=e.font==="body"?"1.25rem":"1rem",this.hintElement.style.borderRadius=e.hintCornerStyle==="rounded"?"5px":"0px",e.hintHeight==="taller"&&(this.hintElement.style.paddingTop="1.25em",this.hintElement.style.paddingBottom="1.25em"),e.hintWidth==="wider"&&(this.hintElement.style.paddingLeft="1.25em",this.hintElement.style.paddingRight="1.25em"),this.updateAnchor(e);}updateAnchor(e){let t=`${e.verticalOffsetRatio*100}vh`;switch(e.anchor){case"topLeft":{this.hintContainerElement.style.placeContent="start left",this.hintElement.style.transform=`translateY(${t})`;break}case"topCenter":{this.hintContainerElement.style.placeContent="start center",this.hintElement.style.transform=`translateY(${t})`;break}case"topRight":{this.hintContainerElement.style.placeContent="start right",this.hintElement.style.transform=`translateY(${t})`;break}case"centerLeft":{this.hintContainerElement.style.placeContent="center start";break}case"center":{this.hintContainerElement.style.placeContent="center";break}case"centerRight":{this.hintContainerElement.style.placeContent="center end";break}case"bottomLeft":{this.hintContainerElement.style.placeContent="end left";break}case"bottomCenter":{this.hintContainerElement.style.placeContent="end center";break}case"bottomRight":{this.hintContainerElement.style.placeContent="end right";break}}}controlsUpdated(){var e;this.redrawControls(),(e=this.privateContext)==null||e.update();}redrawControls(){var t;let e=(t=this._context)==null?void 0:t.frameSource;for(let i of this.controls){let n=this.getControlWidget(i);e==null||e.desiredState==="off"||e.desiredState==="standby"||e.desiredState==="stopping"?n.remove():n.install();}}registerControlWidget(e,t){let i=new t(e,this.controlsElement);return this.controlWidgets.set(e,i),i}getControlWidget(e){let t=this.controlWidgets.get(e);if(t)return t;let{type:i}=e,n;switch(i){case"torch":{n=new b$4(e,this.controlsElement),this.controlWidgets.set(e,n);break}case"camera":{n=new c(e,this.controlsElement),this.controlWidgets.set(e,n);break}case"camera-fov":{n=new d$2(e,this.controlsElement),this.controlWidgets.set(e,n);break}}return n}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$9.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$d.log(a$d.Level.Error,"cannot set frame source stream before connecting view to an HTML element");return}this.videoElement&&(d$1.instance().videoElement=this.videoElement,d$1.instance().gui.isCameraRecoveryVisible=this.isCameraRecoveryVisible.bind(this),d$1.instance().gui.setCameraRecoveryVisible=this.setCameraRecoveryVisible.bind(this),this.setVideoElementOpacity("0"));return}case"off":{this.setVideoElementOpacity("0"),this.redrawControls();return}case"on":{await d$1.instance().waitForCapabilities(),this.redrawControls(),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);}handleVideoPause(){d$1.instance().playVideo();}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$1.instance().stopVideoTracks(),document.visibilityState==="visible"&&d$1.instance().activeCamera!=null&&e!=null))if(!e.active||(i=e.getVideoTracks()[0])!=null&&i.muted)try{a$d.log(a$d.Level.Debug,'Detected visibility change ("visible") event with inactive video source, try to reinitialize camera'),await d$1.instance().reinitializeCamera();}catch(n){}else a$d.log(a$d.Level.Debug,'Detected visibility change ("visible") event with active video source, replay video'),d$1.instance().playVideo();}async cameraRecovery(e){e.preventDefault(),d$1.instance().activeCamera=d$1.instance().selectedCamera,await d$1.instance().reinitializeCamera();}freezeFrame(){var i;if(!this.frozenFrame)return;let e=d$1.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$9.MIRRORED_CLASS_NAME,d$1.instance().isMirrorImageEnabled()),this.frozenFrame.hidden=!1;}unfreezeFrame(){this.frozenFrame&&(this.frozenFrame.src="",this.frozenFrame.hidden=!0);}};
46
-
47
- export { B as a };
@@ -1,5 +0,0 @@
1
- import { d } from './chunk-UPUPKPEP.js';
2
-
3
- var l=class i{constructor(e){this.iconElement=d.SingleImageUploader.Settings.iconElement;this.informationElement=d.SingleImageUploader.Settings.informationElement;this.buttonElement=d.SingleImageUploader.Settings.buttonElement;this.containerStyle=d.SingleImageUploader.Settings.containerStyle;this.iconStyle=d.SingleImageUploader.Settings.iconStyle;this.informationStyle=d.SingleImageUploader.Settings.informationStyle;this.buttonStyle=d.SingleImageUploader.Settings.buttonStyle;this.onlyCameraCapture=d.SingleImageUploader.Settings.onlyCameraCapture;e!=null&&(this.iconElement=e.iconElement,this.informationElement=e.informationElement,this.buttonElement=e.buttonElement,this.containerStyle=e.containerStyle,this.iconStyle=e.iconStyle,this.informationStyle=e.informationStyle,this.buttonStyle=e.buttonStyle,this.onlyCameraCapture=e.onlyCameraCapture);}static fromJSON(e){let t=new i(null);return t.iconElement=document.createRange().createContextualFragment(e.iconElement).firstElementChild,t.informationElement=document.createRange().createContextualFragment(e.informationElement).firstElementChild,t.buttonElement=document.createRange().createContextualFragment(e.buttonElement).firstElementChild,t.containerStyle=e.containerStyle,t.iconStyle=e.iconStyle,t.informationStyle=e.informationStyle,t.buttonStyle=e.buttonStyle,t.onlyCameraCapture=e.onlyCameraCapture,t}toJSONObject(){return {iconElement:this.iconElement.outerHTML,informationElement:this.informationElement.outerHTML,buttonElement:this.buttonElement.outerHTML,containerStyle:{...this.containerStyle},iconStyle:{...this.iconStyle},informationStyle:{...this.informationStyle},buttonStyle:{...this.buttonStyle},onlyCameraCapture:this.onlyCameraCapture}}};
4
-
5
- export { l as a };
@@ -1,5 +0,0 @@
1
- import { l } from './chunk-N4NOODAT.js';
2
-
3
- var s={type:"none"},o=class{constructor(t){this.type="radius";this._radius=t;}get radius(){return this._radius}toJSONObject(){return {type:this.type,radius:this.radius.toJSONObject()}}},a=class n{constructor(){this.type="rectangular";}get sizeWithUnitAndAspect(){return this._sizeWithUnitAndAspect}static withSize(t){let i=new n;return i._sizeWithUnitAndAspect=l.sizeWithWidthAndHeight(t),i}static withWidthAndAspectRatio(t,i){let e=new n;return e._sizeWithUnitAndAspect=l.sizeWithWidthAndAspectRatio(t,i),e}static withHeightAndAspectRatio(t,i){let e=new n;return e._sizeWithUnitAndAspect=l.sizeWithHeightAndAspectRatio(t,i),e}toJSONObject(){return {type:this.type,size:this.sizeWithUnitAndAspect.toJSONObject()}}};
4
-
5
- export { s as a, o as b, a as c };
@@ -1,7 +0,0 @@
1
- import { a as a$1 } from './chunk-3A4KLILV.js';
2
- import { a as a$2 } from './chunk-U6BTTEV6.js';
3
- import { a } from './chunk-EV4OEANA.js';
4
-
5
- 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;
6
-
7
- export { u as a };
@@ -1,6 +0,0 @@
1
- import { d } from './chunk-UPUPKPEP.js';
2
- import { n } from './chunk-N4NOODAT.js';
3
-
4
- var e=class i{constructor(o=d.Brush.fillColor,r=d.Brush.strokeColor,s=d.Brush.strokeWidth){this.fill={color:o},this.stroke={color:r,width:s};}static get transparent(){let o=n.fromRGBA(255,255,255,0);return new i(o,o,0)}get fillColor(){return this.fill.color}get strokeColor(){return this.stroke.color}get strokeWidth(){return this.stroke.width}static areEquals(o,r){return o==null||r==null?!1:n.areEquals(o.fill.color,r.fill.color)&&n.areEquals(o.stroke.color,r.stroke.color)&&o.stroke.width===r.stroke.width}toJSONObject(){return {fill:{color:this.fillColor.toJSON()},stroke:{width:this.strokeWidth,color:this.strokeColor.toJSON()}}}};
5
-
6
- export { e as a };
@@ -1,10 +0,0 @@
1
- import { a as a$1 } from './chunk-5TKCHVG2.js';
2
- import { d } from './chunk-SKRKDAFC.js';
3
- import { a } from './chunk-XR65N6EG.js';
4
- import { a as a$2 } from './chunk-MU4VAJIM.js';
5
- import { g as g$1 } from './chunk-W7LJM2QO.js';
6
- import { d as d$1 } from './chunk-UPUPKPEP.js';
7
-
8
- var g=class n{constructor(e){this.deviceId="";this.type="camera";this._currentState="off";this._settings=new g$1;this._desiredTorchState="off";this._desiredState="off";this.listeners=[];this._context=null;this.stateTransitionStrategyMap={off:{on:this.transitionFromStateOffToOn.bind(this),standby:this.transitionFromStateOffToStandby.bind(this)},on:{off:this.transitionFromStateOnToOff.bind(this),standby:this.transitionFromStateOnToStandby.bind(this)},standby:{off:this.transitionFromStateStandbyToOff.bind(this),on:this.transitionFromStateStandbyToOn.bind(this)}};this.cameraManager=e!=null?e:d.instance(),this.updateCanvasVideoImage=this.updateCanvasVideoImage.bind(this),this.captureAndSend=this.captureAndSend.bind(this);}static get default(){let e=new n;return e.position="worldFacing",e}get desiredState(){return this._desiredState}get settings(){return this._settings}get currentResolution(){var e;return (e=this._currentResolution)!=null?e:null}get context(){return this._context}set context(e){this._context=e,this._context&&this.currentState==="on"&&this.startSendingCapturesToWorker();}get currentState(){return this._currentState}static atPosition(e){if(d$1.Camera.availablePositions.includes(e)){let t=new n;return t.position=e,t}return a.log(a.Level.Warn,`invalid CameraPosition: "${e}"`),null}static fromDeviceCamera(e){let t=n.atPosition(e.position);return t.deviceId=e.deviceId,t.label=e.label,t}async switchToDesiredState(e){var t,i;return this.currentTransitionStrategyPromise&&await this.currentTransitionStrategyPromise,this.currentTransitionStrategyPromise=(i=(t=this.stateTransitionStrategyMap[this.currentState])==null?void 0:t[e])==null?void 0:i.call(t).catch(r=>{if(r instanceof DOMException&&r.message==="The associated Track is in an invalid state"){a.log(a.Level.Warn,r);return}throw r}),this.currentTransitionStrategyPromise}getDesiredTorchState(){return this._desiredTorchState}async setDesiredTorchState(e){this._desiredTorchState=e,await this.cameraManager.setTorchEnabled(this._desiredTorchState==="on"),await this.notifyContext({type:"torchState",newValue:this._desiredTorchState});}async isTorchAvailable(){return this.cameraManager.isTorchAvailable()}addListener(e){e!=null&&(this.listeners.includes(e)||this.listeners.push(e));}removeListener(e){e!=null&&this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async applySettings(e){var i;this._settings=new g$1(e);let t=this.settings.getProperty("grayScaleFrameReader");if(this.cameraManager.setFrameReaderType(t===!0?"GRAYSCALE":"RGBA"),this.currentState==="on"||this.currentState==="standby"){let r=this.cameraManager.activeCameraSettings;(r==null?void 0:r.preferredResolution)!==this.settings.preferredResolution&&(await this.cameraManager.applyCameraSettings(this.settings),(i=this.cameraManager.activeCamera)!=null&&i.currentResolution&&(this._currentResolution={width:this.cameraManager.activeCamera.currentResolution.width,height:this.cameraManager.activeCamera.currentResolution.height})),await this.cameraManager.setZoom(this.settings.zoomFactor);let o=this.settings.getProperty("minFrameRate"),c=this.settings.getProperty("maxFrameRate");(o!=null||c!=null)&&await this.cameraManager.setFrameRate({min:o,max:c});let m=this.settings.getProperty("manualLensPosition");m!=null&&await this.cameraManager.setFocus(m);let u=this.settings.getProperty("exposureTargetBias"),d=this.settings.getProperty("exposureDuration");(u!=null||d!=null)&&await this.cameraManager.setExposure({compensation:u,time:d});}return this.notifyContext({type:"cameraSettings",newValue:this.settings})}toJSONObject(){return {type:this.type,position:this.position,settings:this.settings.toJSONObject(),desiredState:this.desiredState,desiredTorchState:this._desiredTorchState}}getMirrorImageEnabled(){var e;return (e=this._desiredMirrorImageEnabled)!=null?e:this.cameraManager.isMirrorImageEnabled()}async setMirrorImageEnabled(e){this._desiredMirrorImageEnabled=e,this.cameraManager.setMirrorImageEnabled(e,!0),this.context&&await this.context.setFrameSource(this);}getCurrentState(){return this._currentState}async setCurrentState(e){if(e!==this._currentState){this._currentState=e,this.notifyListeners();try{await this.notifyContext({type:"frameSourceState",newValue:e}),e==="on"&&this.startSendingCapturesToWorker();}catch(t){a.log(a.Level.Warn,"Error while notifying context about new state of Camera");}}}async setupCamera(){if(this.cameraManager.setSelectedCameraSettings(this.settings),this.deviceId==="")this.cameraManager.setSelectedCamera(),this.cameraManager.setInitialCameraPosition(this.position);else {let t=(await a$1.getCameras()).find(i=>i.deviceId===this.deviceId);t&&(this.cameraManager.setInitialCameraPosition(t.position),this.cameraManager.setSelectedCamera(t));}await this.cameraManager.setupCameras(),typeof this._desiredMirrorImageEnabled=="boolean"?this.cameraManager.setMirrorImageEnabled(this._desiredMirrorImageEnabled,!0):this.cameraManager.setMirrorImageEnabled(this.cameraManager.isMirrorImageEnabled(),!1),this.context&&await this.context.setFrameSource(this),this.cameraManager.activeCamera&&(this.label=this.cameraManager.activeCamera.label,this.position=this.cameraManager.activeCamera.position,this.deviceId=this.cameraManager.activeCamera.deviceId,this._currentResolution=this.cameraManager.activeCamera.currentResolution);}async notifyContext(e){if(this.context)return this.context.update([e])}notifyListeners(){for(let e of this.listeners)e.didChangeState&&e.didChangeState(this,this.currentState);}updateCanvasVideoImage(){this.currentState==="on"&&this.context&&(this.cameraManager.updateCanvasVideoImage(),this._lastCanvasVideoPreviewAnimationFrame=this.cameraManager.requestVideoFrame(this.updateCanvasVideoImage));}async captureAndSend(){if(this.currentState!=="on"||!this.context)return;if(!this.context.hasEnabledMode()){this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this.captureAndSend);return}let e=null;try{e=this.cameraManager.captureImage();}catch(t){a.log(a.Level.Warn,t.message);}finally{if(e!=null)if(this.cameraManager.synchronousFrameHandling){let t=await this.context.sendFrameToProcessor(e);this.cameraManager.recycle(t.data);}else this.context.sendFrameToProcessor(e).then(t=>(this.cameraManager.recycle(t.data),null)).catch(t=>{a.warn("error while recycling uint8array",t);});this._lastCaptureRequestAnimationFrame=this.cameraManager.requestVideoFrame(this.captureAndSend);}}startSendingCapturesToWorker(){this.stopSendingCapturesToWorker(),this.captureAndSend();}stopSendingCapturesToWorker(){this._lastCanvasVideoPreviewAnimationFrame!=null&&this.cameraManager.cancelVideoFrame(this._lastCanvasVideoPreviewAnimationFrame),this._lastCaptureRequestAnimationFrame!=null&&this.cameraManager.cancelVideoFrame(this._lastCaptureRequestAnimationFrame);}async transitionFromStateOffToOn(){if(!(this.currentState==="on"||this.currentState==="starting"||this.currentState==="wakingUp")){this._desiredState="on",await this.setCurrentState("starting");try{await this.setupCamera(),await this.setCurrentState("on");}catch(e){throw a.log(a.Level.Error,e),await this.setCurrentState("off"),e}}}async transitionFromStateOffToStandby(){if(!(this.currentState==="standby"||this.currentState==="bootingUp"||this.currentState==="goingToSleep")){if(await this.isAndroidWebView()){a.log(a.Level.Warn,'Warning: "Standby" state does not work inside web views. Falling back to state "On".'),await this.transitionFromStateOffToOn();return}this._desiredState="standby",await this.setCurrentState("bootingUp");try{await this.setupCamera(),this.cameraManager.pauseStream(),await this.setCurrentState("standby");}catch(e){throw a.log(a.Level.Error,e),await this.setCurrentState("off"),e}await this.setCurrentState("standby"),await this.setDesiredTorchState("off");}}async transitionFromStateOnToOff(){this.currentState==="off"||this.currentState==="stopping"||(this._desiredState="off",await this.setCurrentState("stopping"),await this.cameraManager.stopStream(),await this.setCurrentState("off"),await this.setDesiredTorchState("off"));}async transitionFromStateOnToStandby(){if(!(this.currentState==="standby"||this.currentState==="bootingUp"||this.currentState==="goingToSleep")){if(await this.isAndroidWebView()){a.log(a.Level.Warn,'Warning: "Standby" state does not work inside web views. Falling back to state "Off".'),await this.transitionFromStateOnToOff();return}this._desiredState="standby",await this.setCurrentState("goingToSleep"),this.cameraManager.pauseStream(),await this.setCurrentState("standby"),await this.setDesiredTorchState("off");}}async transitionFromStateStandbyToOff(){this.currentState==="off"||this.currentState==="stopping"||(this._desiredState="off",await this.setCurrentState("shuttingDown"),await this.cameraManager.stopStream(),await this.setCurrentState("off"),await this.setDesiredTorchState("off"));}async transitionFromStateStandbyToOn(){this.currentState==="on"||this.currentState==="starting"||this.currentState==="wakingUp"||(this._desiredState="on",await this.setCurrentState("wakingUp"),this.cameraManager.resumeStream(),await this.setCurrentState("on"));}async isAndroidWebView(){return this._isAndroidWebView==null&&(this._isAndroidWebView=await a$2.isAndroidWebView()),this._isAndroidWebView}isZoomAvailable(){var e;return ((e=this.cameraManager.mediaTrackCapabilities)==null?void 0:e.zoom)!=null}};
9
-
10
- export { g as a };
@@ -1,5 +0,0 @@
1
- import { n as n$1 } from './chunk-N4NOODAT.js';
2
-
3
- var e=n$1.fromRGBA(46,193,206,1),n=n$1.fromRGBA(98,209,218,1),t=n$1.fromRGBA(151,224,230,1),c=n$1.fromRGBA(203,240,243,1),a=n$1.fromRGBA(18,22,25,1),m=n$1.fromRGBA(218,225,231,1),p=n$1.fromRGBA(40,211,128,1),G=n$1.fromRGBA(83,220,153,1),R=n$1.fromRGBA(126,229,179,1),f=n$1.fromRGBA(169,237,204,1),s=n$1.fromRGBA(212,246,230,1),x=n$1.fromRGBA(251,192,44,1),y=n$1.fromRGBA(252,205,86,1),A=n$1.fromRGBA(253,217,128,1),B=n$1.fromRGBA(254,230,171,1),d=n$1.fromRGBA(254,242,213,1),S=n$1.fromRGBA(250,68,70,1),g=n$1.fromRGBA(251,105,107,1),i=n$1.fromRGBA(252,143,144,1),l=n$1.fromRGBA(253,180,181,1),O=n$1.fromRGBA(254,218,218,1);
4
-
5
- export { e as a, n as b, t as c, c as d, a as e, m as f, p as g, G as h, R as i, f as j, s as k, x as l, y as m, A as n, B as o, d as p, S as q, g as r, i as s, l as t, O as u };
@@ -1,3 +0,0 @@
1
- var a=class e{constructor(t,i){this._x=t,this._y=i;}get x(){return this._x}get y(){return this._y}static mirrorX(t,i){let r=t.x-i.width;return r*=-1,new e(r,t.y)}static fromJSON(t){return new e(t.x,t.y)}toJSONObject(){return {x:this.x,y:this.y}}},b=class e{constructor(t,i,r,o){this._topLeft=t,this._topRight=i,this._bottomRight=r,this._bottomLeft=o;}get topLeft(){return this._topLeft}get topRight(){return this._topRight}get bottomRight(){return this._bottomRight}get bottomLeft(){return this._bottomLeft}static fromJSON(t){return new e(a.fromJSON(t.topLeft),a.fromJSON(t.topRight),a.fromJSON(t.bottomRight),a.fromJSON(t.bottomLeft))}toJSONObject(){return {topLeft:this.topLeft.toJSONObject(),topRight:this.topRight.toJSONObject(),bottomLeft:this.bottomLeft.toJSONObject(),bottomRight:this.bottomRight.toJSONObject()}}},W=(i=>(i.Pixel="pixel",i.Fraction="fraction",i))(W||{}),n=class e{constructor(t,i){this._value=t,this._unit=i;}get value(){return this._value}get unit(){return this._unit}static fromJSON(t){return new e(t.value,t.unit)}toJSONObject(){return {unit:this.unit,value:this.value}}},S=class e{constructor(t,i){this._x=t,this._y=i;}static get zero(){return new e(new n(0,"pixel"),new n(0,"pixel"))}get x(){return this._x}get y(){return this._y}static fromJSON(t){return new e(n.fromJSON(t.x),n.fromJSON(t.y))}toJSONObject(){return {x:this.x.toJSONObject(),y:this.y.toJSONObject()}}},g=class{constructor(t,i){this._origin=t,this._size=i;}get origin(){return this._origin}get size(){return this._size}toJSONObject(){return {origin:this.origin.toJSONObject(),size:this.size.toJSONObject()}}},N=class{constructor(t,i){this._origin=t,this._size=i;}get origin(){return this._origin}get size(){return this._size}toJSONObject(){return {origin:this._origin.toJSONObject(),size:this._size.toJSONObject()}}},l=class e{constructor(t,i){this._width=t,this._height=i;}get width(){return this._width}get height(){return this._height}static fromJSON(t){return new e(n.fromJSON(t.width),n.fromJSON(t.height))}isSameAs(t){return JSON.stringify(this.toJSONObject())===JSON.stringify(t.toJSONObject())}toJSONObject(){return {width:this.width.toJSONObject(),height:this.height.toJSONObject()}}},d=class e{constructor(t,i){this._width=t,this._height=i;}get width(){return this._width}get height(){return this._height}static fromJSON(t){return new e(t.width,t.height)}toJSONObject(){return {height:this.height,width:this.width}}},p=class{constructor(t,i){this._size=t,this._aspect=i;}get size(){return this._size}get aspect(){return this._aspect}},f=(o=>(o.WidthAndHeight="widthAndHeight",o.WidthAndAspectRatio="widthAndAspectRatio",o.HeightAndAspectRatio="heightAndAspectRatio",o.ShorterDimensionAndAspectRatio="shorterDimensionAndAspectRatio",o))(f||{}),O=class e{constructor(){this._shorterDimensionAndAspectRatio=null;}get widthAndHeight(){return this._widthAndHeight}get widthAndAspectRatio(){return this._widthAndAspectRatio}get heightAndAspectRatio(){return this._heightAndAspectRatio}get shorterDimensionAndAspectRatio(){return this._shorterDimensionAndAspectRatio}get sizingMode(){return this.widthAndAspectRatio?"widthAndAspectRatio":this.heightAndAspectRatio?"heightAndAspectRatio":this.shorterDimensionAndAspectRatio?"shorterDimensionAndAspectRatio":"widthAndHeight"}static sizeWithWidthAndHeight(t){let i=new e;return i._widthAndHeight=t,i}static sizeWithWidthAndAspectRatio(t,i){let r=new e;return r._widthAndAspectRatio=new p(t,i),r}static sizeWithHeightAndAspectRatio(t,i){let r=new e;return r._heightAndAspectRatio=new p(t,i),r}static sizeWithShorterDimensionAndAspectRatio(t,i){let r=new e;return r._shorterDimensionAndAspectRatio=new p(t,i),r}static fromJSON(t){if(t.width&&t.height)return this.sizeWithWidthAndHeight(new l(n.fromJSON(t.width),n.fromJSON(t.height)));if(t.width&&typeof t.aspect=="number")return this.sizeWithWidthAndAspectRatio(n.fromJSON(t.width),t.aspect);if(t.height&&typeof t.aspect=="number")return this.sizeWithHeightAndAspectRatio(n.fromJSON(t.height),t.aspect);if(t.shorterDimension&&typeof t.aspect=="number")return this.sizeWithShorterDimensionAndAspectRatio(n.fromJSON(t.shorterDimension),t.aspect);throw new Error(`SizeWithUnitAndAspectJSON is malformed: ${JSON.stringify(t)}`)}toJSONObject(){var t,i,r,o,s,c,h,m;switch(this.sizingMode){case"widthAndAspectRatio":return {width:(t=this.widthAndAspectRatio)==null?void 0:t.size.toJSONObject(),aspect:(i=this.widthAndAspectRatio)==null?void 0:i.aspect};case"heightAndAspectRatio":return {height:(r=this.heightAndAspectRatio)==null?void 0:r.size.toJSONObject(),aspect:(o=this.heightAndAspectRatio)==null?void 0:o.aspect};case"shorterDimensionAndAspectRatio":return {shorterDimension:(s=this.shorterDimensionAndAspectRatio)==null?void 0:s.size.toJSONObject(),aspect:(c=this.shorterDimensionAndAspectRatio)==null?void 0:c.aspect};default:return {width:(h=this.widthAndHeight)==null?void 0:h.width.toJSONObject(),height:(m=this.widthAndHeight)==null?void 0:m.height.toJSONObject()}}}},J=class e{constructor(t,i,r,o){this._left=t,this._top=i,this._right=r,this._bottom=o;}static get zero(){return new e(new n(0,"pixel"),new n(0,"pixel"),new n(0,"pixel"),new n(0,"pixel"))}get left(){return this._left}get right(){return this._right}get top(){return this._top}get bottom(){return this._bottom}static fromJSON(t){return new e(n.fromJSON(t.left),n.fromJSON(t.top),n.fromJSON(t.right),n.fromJSON(t.bottom))}toJSONObject(){return {left:this.left.toJSONObject(),right:this.right.toJSONObject(),top:this.top.toJSONObject(),bottom:this.bottom.toJSONObject()}}},A=class e{constructor(t){this.hexadecimalString=t;}get redComponent(){return this.hexadecimalString.slice(0,2)}get greenComponent(){return this.hexadecimalString.slice(2,4)}get blueComponent(){return this.hexadecimalString.slice(4,6)}get alphaComponent(){return this.hexadecimalString.slice(6,8)}get red(){return e.hexToNumber(this.redComponent)}get green(){return e.hexToNumber(this.greenComponent)}get blue(){return e.hexToNumber(this.blueComponent)}get alpha(){return e.hexToNumber(this.alphaComponent)}static fromHex(t){return new e(e.normalizeHex(t))}static fromRGBA(t,i,r,o=1){let s=[t,i,r,this.normalizeAlpha(o)].reduce((c,h)=>c+this.numberToHex(h),"");return new e(s)}static areEquals(t,i){return t==null||i==null?!1:t.hexadecimalString===i.hexadecimalString}static hexToNumber(t){return Number.parseInt(t,16)}static fromJSON(t){return e.fromHex(t)}static numberToHex(t){let r=Math.round(t).toString(16);return r.length===1&&(r=`0${r}`),r.toUpperCase()}static normalizeHex(t){let i=t;return i.startsWith("#")&&(i=i.slice(1)),i.length<6&&(i=[...i].map(r=>r+r).join("")),i.length===6&&(i+="FF"),i.toUpperCase()}static normalizeAlpha(t){return t>0&&t<=1?255*t:t}withAlpha(t){let i=this.hexadecimalString.slice(0,6)+e.numberToHex(e.normalizeAlpha(t));return e.fromHex(i)}toJSON(){return this.hexadecimalString}},U=(s=>(s.Unknown="unknown",s.Portrait="portrait",s.PortraitUpsideDown="portraitUpsideDown",s.LandscapeRight="landscapeRight",s.LandscapeLeft="landscapeLeft",s))(U||{}),z=(h=>(h.None="none",h.Horizontal="horizontal",h.LeftToRight="leftToRight",h.RightToLeft="rightToLeft",h.Vertical="vertical",h.TopToBottom="topToBottom",h.BottomToTop="bottomToTop",h))(z||{}),x=(u=>(u.TopLeft="topLeft",u.TopCenter="topCenter",u.TopRight="topRight",u.CenterLeft="centerLeft",u.Center="center",u.CenterRight="centerRight",u.BottomLeft="bottomLeft",u.BottomCenter="bottomCenter",u.BottomRight="bottomRight",u))(x||{});
2
-
3
- export { a, b, W as c, n as d, S as e, g as f, N as g, l as h, d as i, p as j, f as k, O as l, J as m, A as n, U as o, z as p, x as q };
@@ -1,5 +0,0 @@
1
- import { b, a } from './chunk-N4NOODAT.js';
2
-
3
- var m=class h extends b{constructor(e,o,n,r,i,c,s,P,p){super(e,o,n,r),this._centerLeft=i,this._topCenter=c,this._centerRight=s,this._bottomCenter=P,this._center=p;}get centerRight(){return this._centerRight}get center(){return this._center}get centerLeft(){return this._centerLeft}get topCenter(){return this._topCenter}get bottomCenter(){return this._bottomCenter}static fromJSON(e){let{topLeft:o,topRight:n,bottomRight:r,bottomLeft:i,centerLeft:c,topCenter:s,centerRight:P,bottomCenter:p,center:S}=e,b=a.fromJSON(o),a$1=a.fromJSON(n),J=a.fromJSON(r),N=a.fromJSON(i),f=a.fromJSON(c),l=a.fromJSON(s),u=a.fromJSON(P),C=a.fromJSON(p),_=a.fromJSON(S);return new h(b,a$1,J,N,f,l,u,C,_)}toJSONObject(){return {...super.toJSONObject(),center:this._center.toJSONObject(),bottomCenter:this._bottomCenter.toJSONObject(),topCenter:this._topCenter.toJSONObject(),centerLeft:this._centerLeft.toJSONObject(),centerRight:this._centerRight.toJSONObject()}}};
4
-
5
- export { m as a };
@@ -1,10 +0,0 @@
1
- import { a } from './chunk-3V7ZD6JQ.js';
2
- import { a as a$4 } from './chunk-AIRWHLJH.js';
3
- import { a as a$3 } from './chunk-FGO2SSRS.js';
4
- import { a as a$1 } from './chunk-QCRFVRSS.js';
5
- import { b } from './chunk-FTD535WI.js';
6
- import { a as a$2 } from './chunk-XR65N6EG.js';
7
-
8
- var h=class{constructor(a$2,e){this.onMessageListener=this.onMessage.bind(this);this.workerSelf=a$2,this.dataCaptureInstance=new a(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),a$1(a$2)&&this.listenToMessages();}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{a$2.log(a$2.Level.Error,a);}),this.workerSelf.addEventListener("messageerror",a=>{a$2.log(a$2.Level.Error,a);});}postMessage(a,e){this.workerSelf.postMessage(a,e!=null?e:[]);}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(a){return a$3(a)&&"payload"in a}hasTransferables(a){return a$3(a)&&Array.isArray(a.transferables)}async respondWith(a,e,u){let r=null,t;try{t=u(),t instanceof Promise&&(t=await t);}catch(l){t=void 0,r=a$4(l);}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(t)?t.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(t)?t.transferables:[]);}onMessage(a){switch(a.data.command){case"loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,preloadEngine:e.preloadEngine,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}));}break}case"onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point);});}break}case"hintPresenterV2update":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update();});}break}case"createContext":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}));}break}case"setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource));}break}case"processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}));}break}case"requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId));}break}case"deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId);});}break}case"updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e));}break}case"dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics();});break}case"reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e));}break}case"setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{a$2.setLevel(e.level);});}break}case"extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey));}break}case"documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state);});}break}case"isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature));}break}case"getViewfinderInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo());}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo());}break}default:return b(a.data),!1}return !0}};
9
-
10
- export { h as a };
@@ -1,7 +0,0 @@
1
- import { a as a$1 } from './chunk-XVLYCDJL.js';
2
- import { b as b$1, a } from './chunk-KYNYQBNF.js';
3
- import { i, a as a$2 } from './chunk-N4NOODAT.js';
4
-
5
- var b={bottomLeft:"bottomRight",bottomRight:"bottomLeft",topLeft:"topRight",topRight:"topLeft",centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"},s=class s{constructor(){this.listener=null;this._mounted=!1;this._mirrored=!1;this._cachedSize=new i(0,0);this.resizeObserver=null;this.mapViewAnchorPositionsForFramePoint=e=>e;}get size(){return this._cachedSize}setMirrored(e){this._mounted&&(this._mirrored=e);}mount(e){var o;if(this._mounted)return;if(!document.head.querySelector(`[data-component=${s.componentName}]`)){let t=document.createElement("style");t.dataset.component=s.componentName,t.append(document.createTextNode(b$1)),document.head.append(t);}let n=document.createElement("div");n.classList.add(a.CUSTOM_VIEW_CONTAINER),(o=e.parentNode)==null||o.replaceChild(n,e),this._htmlRoot=n,this.gestureRecognizer=new a$1(this._htmlRoot),this.gestureRecognizer.addListener({onTap:(t,r)=>{var l,i;let m=(l=r.target.dataset.identifier)!=null?l:"";m!==""&&((i=this.listener)==null||i.didTapView(Number.parseInt(m,10)));}}),this.resizeObserver=new ResizeObserver(([t])=>{this._cachedSize=new i(t.contentRect.width,t.contentRect.height);}),this.resizeObserver.observe(this._htmlRoot),this._cachedSize=new i(this._htmlRoot.clientWidth,this._htmlRoot.clientHeight),this._mounted=!0;}unmount(){var e,n,o,t;this._mounted&&(this.removeChildren(),(e=this.gestureRecognizer)==null||e.removeAllListeners(),(n=this.resizeObserver)==null||n.disconnect(),(o=this._htmlRoot)==null||o.remove(),this._htmlRoot=null,this.gestureRecognizer=null,(t=document.head.querySelector(`[data-component=${s.componentName}]`))==null||t.remove(),this.listener=null,this._mounted=!1);}render(e){var o,t,r,m,l;if(e.elements.length===0){this.removeChildren();return}for(let i of e.removedIds)(t=(o=this._htmlRoot)==null?void 0:o.querySelector(`#${s.elementSelectorPrefix}${i}`))==null||t.remove();let n=document.createDocumentFragment();for(let i of e.elements){let u=`${s.elementSelectorPrefix}${i.identifier}`,f=(r=this._htmlRoot)==null?void 0:r.querySelector(`#${u}`),a=f;if(f==null&&(a=new Image(i.view.options.size.width,i.view.options.size.height),a.id=u,a.dataset.identifier=String(i.identifier),n.append(a)),a){a.src=i.view.data;let d=this.mapViewAnchorPositionsForFramePoint(i.anchorPositions)[this._mirrored?b[i.anchor]:i.anchor];this._mirrored&&(d=a$2.mirrorX(d,this.size));let{x:S,y:w}=this.adjustCoordinatesWithOffset(d,{elementSize:i.view.options.size,offset:i.offset}),p=(m=i.view.options.scale)!=null?m:1;a.style.scale=`${p}`,a.style.transform=`translate3d(${S/p}px, ${w/p}px, 0px)`;}}(l=this._htmlRoot)==null||l.append(n);}removeChildren(){var e;for(;(e=this._htmlRoot)!=null&&e.firstChild;)this._htmlRoot.firstChild.remove();}adjustCoordinatesWithOffset(e,n){let o=e,{elementSize:t,offset:r}=n,m=e.x-t.width/2,l=e.y-t.height/2;return r.x.unit==="pixel"&&(o=new a$2(m+r.x.value,l+r.y.value)),r.x.unit==="fraction"&&(o=new a$2(m+t.width*r.x.value,l+t.height*r.y.value)),o}};s.componentName="CustomLocationsView",s.elementSelectorPrefix="scandit-view-";var R=s;
6
-
7
- export { R as a };
@@ -1,13 +0,0 @@
1
- import { a as a$1 } from './chunk-R6E4CT22.js';
2
- import { a as a$5 } from './chunk-TCJPGGHY.js';
3
- import { b as b$1 } from './chunk-ULRY4SXF.js';
4
- import { b } from './chunk-FTD535WI.js';
5
- import { a } from './chunk-JKL2W65E.js';
6
- import { d } from './chunk-BIGR7VVJ.js';
7
- import { a as a$3 } from './chunk-XR65N6EG.js';
8
- import { a as a$4 } from './chunk-QCZSSQAQ.js';
9
- import { a as a$2 } from './chunk-MU4VAJIM.js';
10
-
11
- var w=(r=>(r.CONTINUOUS="continuous",r.MANUAL="manual",r.NONE="none",r.SINGLE_SHOT="single-shot",r))(w||{}),R=(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))(R||{}),L=(t=>(t.CAMERA_PROPERTIES="cameraProperties",t.CAMERA_ACCESS_ERROR="cameraAccessError",t))(L||{}),n=class n{constructor(){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$1(this.handleVideoResize.bind(this),500);this.videoTrackEndedListener=this.videoTrackEndedRecovery.bind(this);this.videoTrackMuteListener=this.videoTrackMuteRecovery.bind(this);this._synchronousFrameHandling=!1;this._glFrameReaders={GRAYSCALE:null,RGBA:null};this._frameReaderType="RGBA";this.cameraPosition="worldFacing",this.gui={isCameraRecoveryVisible:()=>!1,setCameraRecoveryVisible:()=>{}},this.isWebGLSupported=!a$2.checkBrowserCompatibility().missingFeatures.includes("webGL"),this.videoElement=document.createElement("video"),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:!0}),this._canvas2dContext==null&&a$3.log(a$3.Level.Warn,"Unable to get 2d canvas context"),this.handleVideoResize()),this._canvas2dContext}get canvasWebGLContext(){var e;if(!this._canvas2dContext&&!this._canvasWebGLContext){if(!this.isWebGLSupported){a$3.log(a$3.Level.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:!1,antialias:!1}))!=null?e:this.canvas.getContext("experimental-webgl",{alpha:!1,antialias:!1});t!=null&&(this._canvasWebGLContext=t,this.handleVideoResize());}return this._canvasWebGLContext}static instance(){return n._instance==null&&(n._instance=new n),n._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){return "requestVideoFrameCallback"in HTMLVideoElement.prototype?this.videoElement.requestVideoFrameCallback(e):requestAnimationFrame(e)}cancelVideoFrame(e){if("cancelVideoFrameCallback"in HTMLVideoElement.prototype){this.videoElement.cancelVideoFrameCallback(e);return}cancelAnimationFrame(e);}addListener(e,t){var r;let i=(r=this.listeners.get(e))!=null?r:[];i.includes(t)||this.listeners.set(e,[...i,t]);}async applyCameraSettings(e){if(this.selectedCameraSettings=e,this.activeCamera==null)throw new a$4(n.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$4(n.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 !1}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)===!0):!1}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$3.log(a$3.Level.Debug,"Camera reinitialization delayed");else {a$3.log(a$3.Level.Debug,"Reinitialize camera:",this.activeCamera);try{let e=this.activeCamera;await this.stopStream(),await this.initializeCameraWithSettings(e,this.activeCameraSettings);}catch(e){throw a$3.log(a$3.Level.Warn,"Couldn't access camera:",this.activeCamera,e),this.emit("cameraAccessError",e),e}}}removeListener(e,t){var s;let r=((s=this.listeners.get(e))!=null?s:[]).filter(o=>o!==t);this.listeners.set(e,r);}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 r,s,o,m,d,l,v,p;let t=(s=(r=this.mediaStream)==null?void 0:r.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(((m=(o=this.mediaTrackCapabilities)==null?void 0:o.exposureMode)==null?void 0:m.includes(i))===!0){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,r,s,o,m;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(((r=(i=this.mediaTrackCapabilities)==null?void 0:i.focusMode)==null?void 0:r.includes(d))===!0&&(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)-((o=this.mediaTrackCapabilities.focusDistance.min)!=null?o:.01))+((m=this.mediaTrackCapabilities.focusDistance.min)!=null?m:.01);await t[0].applyConstraints({advanced:[{focusDistance:l}]});}}}async setFrameRate(e){var t,i,r;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 o=Math.min((i=this.mediaTrackCapabilities.frameRate.max)!=null?i:240,(r=e.max)!=null?r:240);await s[0].applyConstraints({advanced:[{frameRate:o}]});}}}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(n.MIRRORED_CLASS_NAME),this.canvas.classList.add(n.MIRRORED_CLASS_NAME)):(this.videoElement.classList.remove(n.MIRRORED_CLASS_NAME),this.canvas.classList.remove(n.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)===!0){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,r;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 o=Math.max((i=this.mediaTrackCapabilities.zoom.min)!=null?i:1,Math.min(e,(r=this.mediaTrackCapabilities.zoom.max)!=null?r:16));await s[0].applyConstraints({advanced:[{zoom:o}]});}}}async setupCameras(){return this.cameraSetupPromise?this.cameraSetupPromise:(this.cameraSetupPromise=this.setupCamerasAndStream(),this.cameraSetupPromise)}pauseStream(){if(!this.mediaStream)return;let e=this.mediaStream.getVideoTracks()[0];e.enabled=!1,a$3.log(a$3.Level.Debug,"Pause camera video stream",this.mediaStream);}resumeStream(){if(!this.mediaStream)return;let e=this.mediaStream.getVideoTracks()[0];e.enabled=!0,a$3.log(a$3.Level.Debug,"Resume camera video stream",this.mediaStream);}async stopStream(e=!1){this.activeCamera&&(this.activeCamera.currentResolution=void 0),this.activeCamera=void 0,this.torchEnabled=!1,this.mediaStream&&(a$3.log(a$3.Level.Debug,`Stop camera video stream access${e?" (abort access detection)":""}:`,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,r,s;for(let o of (r=(i=this.mediaStream)==null?void 0:i.getVideoTracks())!=null?r:[])o.removeEventListener("ended",this.videoTrackEndedListener),o.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$3.log(a$3.Level.Debug,`Change frame reader type to ${this._frameReaderType} mode`));}async allowPictureInPicture(e){e?(this.videoElement.disablePictureInPicture=!1,this.videoElement.removeAttribute("controlslist"),this.videoElement.removeAttribute("disablepictureinpicture")):(this.videoElement.disablePictureInPicture=!0,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 accessAutoselectedCamera(e){let t=d.sortCamerasForCameraPosition(e,this.cameraPosition),i=t.shift();for(;i;)try{await this.initializeCameraWithSettings(i,this.selectedCameraSettings);return}catch(r){if(this.setSelectedCamera(),t.length>0){a$3.log(a$3.Level.Warn,"Couldn't access camera:",i,r),i=t.shift();continue}throw r}throw new a$4(n.noCameraErrorParameters)}getFrameReaderOptions(e){return e?{minPoolCapacity:0,maxPoolCapacity:1}:a$2.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$5(this._canvasWebGLContext,e),this._glFrameReaders.RGBA=new b$1(this._canvasWebGLContext,{minPoolCapacity:1,maxPoolCapacity:2});break}case"RGBA":{this._glFrameReaders.RGBA=new b$1(this._canvasWebGLContext,e);break}default:b(this._frameReaderType);}return a$3.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(t){}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:!0}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$3.log(a$3.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=r=>{a$3.log(a$3.Level.Debug,"Camera video stream access failure (video data load timeout):",e),this.gui.setCameraRecoveryVisible(!0),i(r);},this.setCameraAccessTimeout();})}checkCameraVideoStreamAccessIfVisible(){document.visibilityState==="visible"&&(a$3.log(a$3.Level.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$3.log(a$3.Level.Debug,"Camera video stream access success:",e),t();return}let r=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()-r>n.videoMetadataCheckTimeoutMs){a$3.log(a$3.Level.Warn,"Camera video stream access failure (valid video metadata timeout):",e),window.clearInterval(this.videoMetadataCheckInterval),await this.stopStream(!0),i(new a$4(n.notReadableErrorParameters));return}return}window.clearInterval(this.videoMetadataCheckInterval),this.updateActiveCameraCurrentResolution(e),a$3.log(a$3.Level.Debug,"Camera video stream access success:",e),t();},n.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 r;let i=(r=this.listeners.get(e))!=null?r:[];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(r=>r.deviceId===i||r.label!==""&&r.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}case"hd":default:{t=2;break}}return t}async handleCameraInitializationError(e,t,i){if(!["OverconstrainedError","NotReadableError"].includes(i.name)||i.name==="NotReadableError"&&t===4)throw a$3.log(a$3.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$3.log(a$3.Level.Warn,"Camera video stream access failure (no camera with such type error)",e,i),i;a$3.log(a$3.Level.Warn,"Detected non-existent deviceId error, attempt to find and reaccess updated camera",e,i);let r=e.deviceId;if(await d.getCameras(!0),r===e.deviceId)throw a$3.log(a$3.Level.Warn,"Camera video stream access failure (updated camera not found after non-existent deviceId error)",e,i),d.markCameraAsInaccessible(e),i;return a$3.log(a$3.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$3.log(a$3.Level.Warn,"WebGL context has been lost, restoring..."),this._canvasWebGLContext=void 0,this.canvasWebGLContext?(this.handleVideoResize(),a$3.log(a$3.Level.Warn,"WebGL context restored")):a$3.log(a$3.Level.Error,"WebGL context restore failed");}async initializeCameraAndCheckUpdatedSettings(e){var t,i,r,s,o;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 m=(t=this.activeCameraSettings)==null?void 0:t.getProperty("minFrameRate"),d=(i=this.activeCameraSettings)==null?void 0:i.getProperty("maxFrameRate");(m!=null||d!=null)&&await this.setFrameRate({min:m,max:d});let l=(r=this.activeCameraSettings)==null?void 0:r.getProperty("manualLensPosition");l!=null&&await this.setFocus(l);let v=(s=this.activeCameraSettings)==null?void 0:s.getProperty("exposureTargetBias"),p=(o=this.activeCameraSettings)==null?void 0:o.getProperty("exposureDuration");(v!=null||p!=null)&&await this.setExposure({compensation:v,time:p});}finally{this.cameraInitializationPromise=void 0;}}async initializeCameraForResolution(e,t){var r;this.gui.setCameraRecoveryVisible(!1);let i=t!=null?t:this.getInitialCameraResolutionConstraint(e);this.mediaStream!=null&&e.deviceId!==""&&((r=this.activeCamera)==null?void 0:r.deviceId)===e.deviceId?await(a$2.isIPhone()?this.initializeStreamForResolution(e,i):this.updateStreamForResolution(e,i)):await this.initializeStreamForResolution(e,i);}async initializeStreamForResolution(e,t){var i;await this.stopStream();try{let r=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio"),s=await d.accessCameraStream(e,t,r);if(a$3.log(a$3.Level.Debug,"Camera accessed, waiting for camera video stream start..."),typeof s.getVideoTracks()[0].getSettings=="function"){let o=s.getVideoTracks()[0].getSettings();if(o.width!=null&&o.height!=null&&(o.width===2||o.height===2)){if(a$3.log(a$3.Level.Debug,"Camera video stream access failure (invalid video metadata):",e),t===4)throw new a$4(n.notReadableErrorParameters);return await this.stopStream(),this.initializeStreamForResolution(e,t+1)}}this.mediaStream=s;for(let o of this.mediaStream.getVideoTracks())o.addEventListener("ended",this.videoTrackEndedListener),o.addEventListener("mute",this.videoTrackMuteListener),o.addEventListener("unmute",this.videoTrackMuteListener);try{await this.setupCameraStreamVideo(e,s);}catch(o){if(t===4)throw o;return this.initializeStreamForResolution(e,t+1)}}catch(r){return this.handleCameraInitializationError(e,t,r)}}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();},n.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=!0){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(!0),(e=this.cameraAccessRejectCallback)==null||e.call(this,new a$4(n.notReadableErrorParameters))):(a$3.log(a$3.Level.Debug,"Page is currently not visible, delay camera video stream access detection"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener));},n.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),n.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(r=>{this.abortedCameraInitializationResolveCallback=r;})]);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 r=await d.getCameras(!1,!0),s=(t=(e=this.mediaStream)==null?void 0:e.getVideoTracks()[0])==null?void 0:t.getSettings().deviceId;if(this.mediaStream&&i){let o=this.getActiveCamera(r,i.label,s);if(o){if(d.adjustCameraFromMediaStream(this.mediaStream,o),a$2.isDesktopDevice()&&(d.setMainCameraForPositionOverridesOnDesktop(this.cameraPosition,o),d.setMainCameraForPositionOverridesOnDesktop(o.position,o)),r.length===1||d.getMainCameraForPosition(r,this.cameraPosition)===o){a$3.log(a$3.Level.Debug,"Initial camera access was correct (main camera), keep camera:",o),this.setSelectedCamera(o),this.updateActiveCameraCurrentResolution(o),await this.recoverStreamIfNeeded();return}a$3.log(a$3.Level.Debug,"Initial camera access was incorrect (not main camera), change camera",{...i,deviceId:s});}else a$3.log(a$3.Level.Debug,"Initial camera access was incorrect (unknown camera), change camera",{...i,deviceId:s});}if(this.selectedCamera==null){await this.accessAutoselectedCamera(r);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(i){}}}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");},n.manualToAutofocusResumeTimeoutMs);let e=!0,t=this.mediaStream.getVideoTracks();t.length>0&&typeof t[0].getConstraints=="function"&&(e=((i=t[0].getConstraints().advanced)==null?void 0:i.some(r=>r.focusMode==="manual"))===!0),e?(await this.triggerFocusMode("continuous"),this.manualFocusWaitTimeout=window.setTimeout(async()=>{await this.triggerFocusMode("manual");},n.manualFocusWaitTimeoutMs)):await this.triggerFocusMode("manual");}async triggerManualFocusForSingleShot(){window.clearInterval(this.autofocusInterval),this.manualToAutofocusResumeTimeout=window.setTimeout(()=>{this.autofocusInterval=window.setInterval(this.triggerAutoFocus.bind(this),n.autofocusIntervalMs);},n.manualToAutofocusResumeTimeoutMs);try{await this.triggerFocusMode("single-shot");}catch(e){}}async triggerZoomMove(e){this.pinchToZoomDistance==null||(e==null?void 0:e.touches.length)!==2||e.preventDefault();}triggerZoomStart(e){var r,s,o,m;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||!((r=this.mediaTrackCapabilities)!=null&&r.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=(o=i.advanced.find(l=>"zoom"in l))==null?void 0:o.zoom;d!=null&&(this.pinchToZoomInitialZoom=typeof d=="number"?d:(m=d.ideal)!=null?m: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(),!1));}async updateStreamForResolution(e,t){var i;if(this.mediaStream==null)await this.initializeCameraForResolution(e,t);else try{let r=(i=this.activeCameraSettings)==null?void 0:i.getProperty("preferredAspectRatio");a$3.log(a$3.Level.Debug,"Setting new resolution for active camera video stream..."),await this.mediaStream.getVideoTracks()[0].applyConstraints(d.getUserMediaVideoParameters(t,r)),await new Promise(o=>{this.videoElement.addEventListener("timeupdate",()=>{o();},{once:!0});});let s=this.mediaStream.getVideoTracks()[0].getSettings();a$3.log(a$3.Level.Debug,"New active camera video stream resolution set",{width:s.width,height:s.height});}catch(r){if(t===4)throw r;await this.updateStreamForResolution(e,t+1);}}async videoTrackEndedRecovery(){if(document.visibilityState==="visible")try{a$3.log(a$3.Level.Debug,'Detected video track "ended" event, try to reinitialize camera'),await this.reinitializeCamera();}catch(e){}else a$3.log(a$3.Level.Debug,"Page is currently not visible, delay camera reinitialization until visible"),document.addEventListener("visibilitychange",this.checkCameraVideoStreamAccessIfVisibleListener);}videoTrackMuteRecovery(e){if(this.videoElement.onloadeddata!=null){a$3.log(a$3.Level.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$3.log(a$3.Level.Debug,`Detected video track "${e.type}" event, ${t?"enable":"disable"} camera recovery`),this.gui.setCameraRecoveryVisible(t));}};n.autofocusIntervalMs=1500,n.cameraAccessTimeoutMs=4e3,n.getCapabilitiesTimeoutMs=500,n.manualFocusWaitTimeoutMs=400,n.manualToAutofocusResumeTimeoutMs=5e3,n.noCameraErrorParameters={name:"NoCameraAvailableError",message:"No camera available"},n.notReadableErrorParameters={name:"NotReadableError",message:"Could not initialize camera correctly"},n.videoMetadataCheckIntervalMs=50,n.videoMetadataCheckTimeoutMs=4e3,n.MIRRORED_CLASS_NAME=a.MIRRORED_CLASS_NAME,n._instance=null;var y=n;
12
-
13
- export { w as a, R as b, L as c, y as d };
@@ -1,5 +0,0 @@
1
- import { d } from './chunk-UPUPKPEP.js';
2
-
3
- var r=class{constructor(){this.frameColor=d.AimerViewfinder.frameColor;this.dotColor=d.AimerViewfinder.dotColor;this.type="aimer";}toJSONObject(){return {type:this.type,frameColor:this.frameColor.toJSON(),dotColor:this.dotColor.toJSON()}}};
4
-
5
- export { r as a };
@@ -1,9 +0,0 @@
1
- import { a as a$1 } from './chunk-MOKCZFZV.js';
2
- import { d as d$1 } from './chunk-BIGR7VVJ.js';
3
- import { a } from './chunk-XR65N6EG.js';
4
- import { a as a$2 } from './chunk-MU4VAJIM.js';
5
- import { f as f$1, g as g$1 } from './chunk-W7LJM2QO.js';
6
-
7
- var S=(t=>(t.Idle="idle",t.Pressed="pressed",t))(S||{}),d=class{constructor(e,t){this.state="idle";this.isHover=!1;this.control=e,this.domHost=t,this.onTouchStartListener=this.onTouchStart.bind(this),this.onMouseEnterListener=this.onMouseEnter.bind(this),this.onMouseLeaveListener=this.onMouseLeave.bind(this),this.onClickListener=this.onClick.bind(this),this.setup();}get frameSource(){var e,t;return (t=(e=this.control.view)==null?void 0:e.getContext())==null?void 0:t.frameSource}get context(){var e;return (e=this.control.view)==null?void 0:e.getContext()}async install(){this.button||this.setup();let e=await this.canShow();return e?(this.updateButtonBackground(this.button,this.getImageFromState()),this.show()):this.hide(),e}remove(e=!1){e&&this.button?(this.button.removeEventListener("mouseenter",this.onMouseEnterListener),this.button.removeEventListener("mouseleave",this.onMouseLeaveListener),this.button.removeEventListener("touchstart",this.onTouchStartListener),this.button.removeEventListener("click",this.onClickListener),this.button.remove(),this.isHover=!1,this.button=void 0):this.hide();}hide(){this.button&&(this.button.style.display="none");}show(){this.button&&(this.button.style.display="block");}setupButton(){let e=document.createElement("button");return e.type="button",e.style.display="none",e.className=`scandit-control-widget scandit-control-widget-${this.control.type}`,this.updateButtonBackground(e,this.getImageFromState()),this.domHost.append(e),e.addEventListener("mouseenter",this.onMouseEnterListener),e.addEventListener("mouseleave",this.onMouseLeaveListener),a$2.isDesktopDevice()||e.addEventListener("touchstart",this.onTouchStartListener),e.addEventListener("click",this.onClickListener),e.setAttribute("aria-pressed",String(this.state==="pressed")),this.button=e,this.button}setup(){this.setupButton();}onTouchStart(){var e,t;(e=this.button)==null||e.removeEventListener("mouseenter",this.onMouseEnterListener),(t=this.button)==null||t.removeEventListener("mouseleave",this.onMouseLeaveListener);}onMouseEnter(){this.isHover=!0,this.updateButtonBackground(this.button,this.getImageFromState());}onMouseLeave(){this.isHover=!1,this.updateButtonBackground(this.button,this.getImageFromState());}onClick(){var e;this.state=this.state==="pressed"?"idle":"pressed",this.buttonClicked(),this.updateButtonBackground(this.button,this.getImageFromState()),(e=this.button)==null||e.setAttribute("aria-pressed",String(this.state==="pressed"));}updateButtonBackground(e,t){t!=null&&e!=null&&(e.style.backgroundImage=`url(${JSON.stringify(t)})`);}},C=class extends d{constructor(e,t){super(e,t);}async buttonClicked(){await this.frameSource.setDesiredTorchState(this.retrieveTorchState()==="on"?"off":"on");}async canShow(){return this.isTorchAvailable()}getImageFromState(){return this.retrieveTorchState()==="on"?this.isHover?this.control.torchOnPressedImage:this.control.torchOnImage:this.isHover?this.control.torchOffPressedImage:this.control.torchOffImage}setup(){if(this.control.torchOffImage==null||this.control.torchOnImage==null){a.log(a.Level.Warn,"TorchSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async isTorchAvailable(){return f$1(this.frameSource)?this.frameSource.isTorchAvailable():!1}retrieveTorchState(){return f$1(this.frameSource)?this.frameSource.getDesiredTorchState():"off"}},f=class o extends d{constructor(e,t){super(e,t);}static get CameraAccess(){return d$1}static get Camera(){return a$1}async canShow(){return (await o.CameraAccess.getCameras()).length>1}getImageFromState(){return this.isHover?this.control.pressedImage:this.control.idleImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getNextDeviceCamera();e&&await this.switchCameras(e);}setup(){if(this.control.idleImage==null){a.log(a.Level.Warn,"CameraSwitchControl idle icon is not set or is empty, the control will not be rendered.");return}super.setup();}async getNextDeviceCamera(){var s,n;let e=await o.CameraAccess.getCameras(),t=this.frameSource?this.frameSource:null,i=(s=t==null?void 0:t.cameraManager.activeCamera)==null?void 0:s.deviceId,r=e.findIndex(c=>c.deviceId===i);return r>-1?(n=e[r+1])!=null?n:e[0]:e.length>0?e[0]:null}async switchCameras(e){var n,c,u;this.isTransitioning=!0;let t=(n=this.context)==null?void 0:n.frameSource,i,r;t!=null&&(i=new g$1(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off"));let s=o.Camera.fromDeviceCamera(e);i!=null&&await s.applySettings(i),await((c=this.context)==null?void 0:c.setFrameSource(s)),await((u=this.context)==null?void 0:u.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=!1;}},g=class o extends d{constructor(e,t){super(e,t);}static get Camera(){return a$1}static get CameraAccess(){return d$1}async install(){let e=await super.install();return e&&await this.setInitialCamera(),e}async canShow(){return !a$2.isIOSDeviceWithExtendedCameraAccess()||!f$1(this.frameSource)?!1:d$1.isIOSBackDualWideCameraLabel(this.frameSource.label)||d$1.isIOSBackCameraLabel(this.frameSource.label)||d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label)}getImageFromState(){return this.isUltraWideBackCamera()?this.isHover?this.control.cameraFOVUltraWidePressedImage:this.control.cameraFOVUltraWideImage:this.isHover?this.control.cameraFOVWidePressedImage:this.control.cameraFOVWideImage}async buttonClicked(){if(this.isTransitioning)return;let e=await this.getAlternativeDeviceCamera();e&&await this.switchCameras(e);}setup(){if(this.control.cameraFOVUltraWideImage==null||this.control.cameraFOVWideImage==null){a.log(a.Level.Warn,"CameraFOVSwitchControl icon is not set or is empty, the control will not be rendered.");return}super.setup();}async setInitialCamera(){var e,t;if(!this.isTransitioning&&!d$1.isIOSBackCameraLabel((t=(e=this.frameSource)==null?void 0:e.label)!=null?t:"")){let r=(await o.CameraAccess.getCameras()).find(s=>d$1.isIOSBackCameraLabel(s.label));r&&await this.switchCameras(r);}}isUltraWideBackCamera(){return f$1(this.frameSource)?d$1.isIOSUltraWideBackCameraLabel(this.frameSource.label):!1}async getAlternativeDeviceCamera(){return (await o.CameraAccess.getCameras()).find(t=>this.isUltraWideBackCamera()?d$1.isIOSBackCameraLabel(t.label):d$1.isIOSUltraWideBackCameraLabel(t.label))}async switchCameras(e){var n,c,u;this.isTransitioning=!0;let t=(n=this.context)==null?void 0:n.frameSource,i,r;t!=null&&(i=new g$1(t.settings),r=t.desiredState),await(t==null?void 0:t.switchToDesiredState("off"));let s=o.Camera.fromDeviceCamera(e);i!=null&&await s.applySettings(i),await((c=this.context)==null?void 0:c.setFrameSource(s)),await((u=this.context)==null?void 0:u.frameSource).switchToDesiredState(r!=null?r:"on"),this.isTransitioning=!1;}};
8
-
9
- export { S as a, C as b, f as c, g as d };
@@ -1,8 +0,0 @@
1
- import { a } from './chunk-BDLLVGRH.js';
2
- import { c as c$1 } from './chunk-J2UL6U3I.js';
3
- import { b, c } from './chunk-GX4YCYCH.js';
4
- import { m, e, l as l$1, n as n$1 } from './chunk-N4NOODAT.js';
5
-
6
- var l=class{static fromJSON(t){return (t==null?void 0:t.type)==="tapToFocus"?new b:null}},s=class{static fromJSON(t){return (t==null?void 0:t.type)==="swipeToZoom"?new c:null}};function n(e){let t="document"in globalThis?globalThis.document:void 0,i=t==null?void 0:t.createRange().createContextualFragment(e);if(i)return i.firstElementChild}function p(e$1){var t;return {Camera:{Settings:{preferredResolution:e$1.Camera.Settings.preferredResolution,zoomFactor:e$1.Camera.Settings.zoomFactor,zoomGestureZoomFactor:e$1.Camera.Settings.zoomGestureZoomFactor,focusGestureStrategy:e$1.Camera.Settings.focusGestureStrategy},defaultPosition:(t=e$1.Camera.defaultPosition)!=null?t:null,availablePositions:e$1.Camera.availablePositions},SingleImageUploader:{Settings:{iconElement:n(e$1.SingleImageUploader.Settings.iconElement),informationElement:n(e$1.SingleImageUploader.Settings.informationElement),buttonElement:n(e$1.SingleImageUploader.Settings.buttonElement),containerStyle:e$1.SingleImageUploader.Settings.containerStyle,iconStyle:e$1.SingleImageUploader.Settings.iconStyle,informationStyle:e$1.SingleImageUploader.Settings.informationStyle,buttonStyle:e$1.SingleImageUploader.Settings.buttonStyle,onlyCameraCapture:e$1.SingleImageUploader.Settings.onlyCameraCapture}},DataCaptureView:{scanAreaMargins:m.fromJSON(JSON.parse(e$1.DataCaptureView.scanAreaMargins)),pointOfInterest:e.fromJSON(JSON.parse(e$1.DataCaptureView.pointOfInterest)),logoStyle:e$1.DataCaptureView.logoStyle,logoAnchor:e$1.DataCaptureView.logoAnchor,logoOffset:e.fromJSON(JSON.parse(e$1.DataCaptureView.logoOffset)),focusGesture:l.fromJSON(JSON.parse(e$1.DataCaptureView.focusGesture)),zoomGesture:s.fromJSON(JSON.parse(e$1.DataCaptureView.zoomGesture)),cameraRecoveryText:e$1.DataCaptureView.cameraRecoveryText},RectangularViewfinder:Object.keys(e$1.RectangularViewfinder.styles).reduce((i,u)=>{let r=e$1.RectangularViewfinder.styles[u];return i.styles[u]={size:l$1.fromJSON(JSON.parse(r.size)),color:n$1.fromJSON(r.color),style:r.style,lineStyle:r.lineStyle,dimming:Number.parseFloat(r.dimming.toString()),animation:c$1.fromJSON(JSON.parse(r.animation))},i},{defaultStyle:e$1.RectangularViewfinder.defaultStyle,styles:{}}),AimerViewfinder:{frameColor:n$1.fromJSON(e$1.AimerViewfinder.frameColor),dotColor:n$1.fromJSON(e$1.AimerViewfinder.dotColor)},Brush:{fillColor:n$1.fromJSON(e$1.Brush.fillColor),strokeColor:n$1.fromJSON(e$1.Brush.strokeColor),strokeWidth:e$1.Brush.strokeWidth},Feedback:{defaultVibrationPattern:e$1.Feedback.defaultVibrationPattern}}}var y=p({DataCaptureView:{focusGesture:"null",zoomGesture:"null",logoAnchor:"bottomRight",logoStyle:"extended",logoOffset:JSON.stringify({x:{value:0,unit:"fraction"},y:{value:0,unit:"fraction"}}),pointOfInterest:JSON.stringify({x:{value:.5,unit:"fraction"},y:{value:.5,unit:"fraction"}}),scanAreaMargins:JSON.stringify({left:{value:0,unit:"fraction"},right:{value:0,unit:"fraction"},top:{value:0,unit:"fraction"},bottom:{value:0,unit:"fraction"}}),cameraRecoveryText:"(This text is updated from translations)"},Camera:{Settings:{preferredResolution:"auto",zoomFactor:1,focusGestureStrategy:"manualUntilCapture",zoomGestureZoomFactor:2},defaultPosition:"worldFacing",availablePositions:["worldFacing","userFacing"]},SingleImageUploader:{Settings:{iconElement:atob(a),informationElement:"<p data-scandit-default>(This text is updated from translations)</p>",buttonElement:"<div data-scandit-default>(This text is updated from translations)</div>",containerStyle:{backgroundColor:"#FFFFFF"},iconStyle:{fill:"#121619"},informationStyle:{color:"#121619",marginBottom:"2em"},buttonStyle:{color:"#FFFFFF",backgroundColor:"#121619",fontWeight:"bold",padding:"1.25em",width:"12em",textAlign:"center",textTransform:"uppercase"},onlyCameraCapture:!1}},AimerViewfinder:{frameColor:"#FFFFFFFF",dotColor:"#FFFFFFCC"},RectangularViewfinder:{defaultStyle:"rounded",styles:{rounded:{size:JSON.stringify({aspect:1,shorterDimension:{unit:"fraction",value:.75}}),color:"#FFFFFFFF",style:"rounded",lineStyle:"light",dimming:0,animation:JSON.stringify({looping:!0})},square:{size:JSON.stringify({aspect:1,shorterDimension:{unit:"fraction",value:.75}}),color:"#FFFFFFFF",style:"square",lineStyle:"light",dimming:0,animation:JSON.stringify({looping:!0})}}},Brush:{fillColor:"#00000000",strokeColor:"#00000000",strokeWidth:0},Feedback:{defaultVibrationPattern:[300]}});function V(e){y=e;}
7
-
8
- export { l as a, s as b, p as c, y as d, V as e };
@@ -1,5 +0,0 @@
1
- import { a } from './chunk-NNLX5HO4.js';
2
-
3
- var t=new a(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e;}});function l(e){}
4
-
5
- export { t as a, l as b };
@@ -1,5 +0,0 @@
1
- import { d } from './chunk-UPUPKPEP.js';
2
-
3
- var u=(o=>(o.On="on",o.Off="off",o.Standby="standby",o.Starting="starting",o.Stopping="stopping",o.BootingUp="bootingUp",o.WakingUp="wakingUp",o.GoingToSleep="goingToSleep",o.ShuttingDown="shuttingDown",o))(u||{}),c=(t=>(t.On="on",t.Off="off",t))(c||{}),m=(t=>(t.WorldFacing="worldFacing",t.UserFacing="userFacing",t))(m||{}),p=(r=>(r.Auto="auto",r.HD="hd",r.FullHD="fullHd",r.UHD4K="uhd4k",r))(p||{}),g=(r=>(r.None="none",r.Manual="manual",r.ManualUntilCapture="manualUntilCapture",r.AutoOnLocation="autoOnLocation",r))(g||{});function f(a){var e;return ((e=a==null?void 0:a.toJSONObject())==null?void 0:e.type)==="camera"}var i=class a{constructor(e){this.preferredResolution=d.Camera.Settings.preferredResolution;this.zoomFactor=d.Camera.Settings.zoomFactor;this.zoomGestureZoomFactor=d.Camera.Settings.zoomGestureZoomFactor;this.focus={focusGestureStrategy:d.Camera.Settings.focusGestureStrategy};if(e!=null)for(let t of Object.getOwnPropertyNames(e))this[t]=e[t];}get focusGestureStrategy(){return this.focus.focusGestureStrategy}set focusGestureStrategy(e){this.focus.focusGestureStrategy=e;}static fromJSON(e){let t=new a;return t.preferredResolution=e.preferredResolution,t.zoomFactor=e.zoomFactor,t.zoomGestureZoomFactor=e.zoomGestureZoomFactor,t.focusGestureStrategy=e.focusGestureStrategy,t}setProperty(e,t){this[e]=t;}getProperty(e){return this[e]}toJSONObject(){let e={preferredResolution:this.preferredResolution,zoomFactor:this.zoomFactor,zoomGestureZoomFactor:this.zoomGestureZoomFactor,focus:{focusGestureStrategy:this.focus.focusGestureStrategy}},t={};for(let n of Object.keys(this))[...Object.keys(e),"focusGestureStrategy"].includes(n)||(t[n]=this[n]);return {...e,...t}}};
4
-
5
- export { u as a, c as b, m as c, p as d, g as e, f, i as g };
@@ -1,6 +0,0 @@
1
- import { a as a$1 } from './chunk-NMX4VHW2.js';
2
- import { a } from './chunk-GE4CBD4E.js';
3
-
4
- function r(){let e=a`@keyframes scandit-rotation{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}.${a$1.CONTAINER_CLASS_NAME}{align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;overflow:hidden;width:100%}.${a$1.CONTAINER_CLASS_NAME}:before{animation:scandit-rotation 1s linear infinite;background-color:#fff;content:" ";height:1px;left:0;opacity:0;pointer-events:none;position:absolute;top:0;width:1px}`,o=a`.${a$1.PAINTBOARDS_CONTAINER_CLASS_NAME}{height:inherit;position:relative;width:100%}.${a$1.PAINTBOARD_CLASS_NAME}{aspect-ratio:16/9;background-color:#000;height:100%;min-height:1px;min-width:1px;position:relative;width:100%}.${a$1.PAINTBOARD_CLASS_NAME}.${a$1.PAINTBOARD_CLASS_NAME_STATE_ON}{aspect-ratio:auto}.${a$1.PAINTBOARD_CLASS_NAME} video{display:block;height:100%;object-fit:cover;transition:opacity .3s;width:100%}.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.MIRRORED_CLASS_NAME}{transform:scaleX(-1)}.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.CAMERA_RECOVERY_CLASS_NAME}{background-color:#000;cursor:pointer;z-index:5}.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.CAMERA_RECOVERY_CLASS_NAME},.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.ERROR_CLASS_NAME}{align-items:center;color:#fff;display:flex;height:100%;justify-content:center;left:0;position:absolute;top:0;width:100%}.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.ERROR_CLASS_NAME}{background-color:rgba(0,0,0,.5);text-align:center;z-index:6}.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.HINT_CONTAINER_CLASS_NAME}{bottom:5vh;display:grid;pointer-events:none;position:absolute;top:5vh;width:100%}.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.HINT_CLASS_NAME}{background-color:#fff;color:#000;padding:10px;width:fit-content}.${a$1.CAMERA_RECOVERY_CLASS_NAME}[hidden],.${a$1.ERROR_CLASS_NAME}[hidden],.${a$1.HINT_CLASS_NAME}[hidden]{display:none}.${a$1.PAINTBOARD_CLASS_NAME} canvas{height:100%;left:0;object-fit:cover;pointer-events:none;position:absolute;top:0;transition:opacity .3s;width:100%}`,i=a`.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.SINGLE_IMAGE_UPLOADER_CONTAINER_CLASS_NAME}{-webkit-tap-highlight-color:rgba(255,255,255,0);align-items:center;display:flex;flex-direction:column;height:100%;justify-content:center;width:100%}.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.SINGLE_IMAGE_UPLOADER_CONTAINER_CLASS_NAME} label{align-items:center;cursor:pointer;display:flex;flex-direction:column;justify-content:center}.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.SINGLE_IMAGE_UPLOADER_CONTAINER_CLASS_NAME} label input[type=file]{position:absolute;top:-9999px}.${a$1.PAINTBOARD_CLASS_NAME}.${a$1.SINGLE_IMAGE_UPLOADER_CONTAINER_CLASS_NAME} label button{pointer-events:none}`,n=a`.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.CONTROLS_CLASS_NAME}{display:flex;height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.CONTROL_WIDGET_CLASS_NAME}-${a$1.TORCH_SWITCH_CONTROL_CLASS_NAME}{left:16px;top:24px}.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.CONTROL_WIDGET_CLASS_NAME}-${a$1.CAMERA_SWITCH_CONTROL_CLASS_NAME}{right:16px;top:24px}.${a$1.PAINTBOARD_CLASS_NAME} .${a$1.CONTROL_WIDGET_CLASS_NAME}-${a$1.CAMERA_FOV_SWITCH_CONTROL_CLASS_NAME}{bottom:24px;right:24px}.${a$1.CONTROL_WIDGET_CLASS_NAME}{background-color:transparent;background-repeat:no-repeat;border:none;cursor:pointer;height:32px;pointer-events:all;position:absolute;width:32px}.${a$1.CONTROL_WIDGET_CLASS_NAME}+.${a$1.CONTROL_WIDGET_CLASS_NAME}{margin-left:16px}`,_=a`.${a$1.FROZEN_FRAME}{height:100%;left:0;object-fit:cover;opacity:1;position:absolute;top:0;width:100%}.${a$1.FROZEN_FRAME}[hidden]{opacity:0;pointer-events:none;visibility:hidden}`;return [e,o,n,i,_]}
5
-
6
- export { r as a };
@@ -1,7 +0,0 @@
1
- import { a as a$1 } from './chunk-IGJQFAQU.js';
2
- import { a } from './chunk-EP3GI7KA.js';
3
- import { a as a$2 } from './chunk-N4NOODAT.js';
4
-
5
- var v=class extends a{constructor(e){super();this._onTouchStart=this.onTouchStart.bind(this);this._onPointerDown=this.onPointerDown.bind(this);a$1.detect(),this.element=e,this.addPointerDownListener();}removeAllListeners(){this.element.removeEventListener("touchend",this._onTouchStart),this.element.removeEventListener("mousedown",this._onPointerDown),this.element.removeEventListener("pointerdown",this._onPointerDown);}addPointerDownListener(){a$1.hasApi?this.element.addEventListener(a$1.prefixIfNeeded("pointerdown"),this._onPointerDown):a$1.hasTouch?this.element.addEventListener("touchstart",this._onTouchStart):this.element.addEventListener("mousedown",this._onPointerDown);}onPointerDown(e){let{clientX:n,clientY:t,button:o,currentTarget:a=this.element}=e;o===0&&this.onTap(this.pointRelativeToElement({clientX:n,clientY:t,rect:a.getBoundingClientRect()}),e);}onTouchStart(e){let[n]=e.touches,{clientX:t,clientY:o}=n;this.onTap(this.pointRelativeToElement({clientX:t,clientY:o,rect:this.element.getBoundingClientRect()}),e);}pointRelativeToElement({clientX:e,clientY:n,rect:t}){return new a$2(e-t.left,n-t.top)}onTap(e,n){var t;for(let o of this.listeners)(t=o.onTap)==null||t.call(o,e,n);}};
6
-
7
- export { v as a };
@@ -1,5 +0,0 @@
1
- import { a as a$1 } from './chunk-KAZWF3JC.js';
2
-
3
- var a=class n{constructor(){this.type="singleImageUploader";this._settings=new a$1(null);this._desiredState="off";this.listeners=[];this._context=null;this._view=void 0;}static get default(){return new n}get desiredState(){return this._desiredState}get settings(){return this._settings}get context(){return this._context}set context(e){this._context=e;}set currentState(e){e!==this._currentState&&(this._currentState=e,this.notifyListeners(),this.notifyContext({type:"frameSourceState",newValue:e}));}get currentState(){return this._currentState}async switchToDesiredState(e){if(e==="on"){if(this.currentState==="on"||this.currentState==="starting")return}else if(this.currentState==="off"||this.currentState==="stopping")return;return this._desiredState=e,this.setCurrentState(e==="on"?"starting":"off")}addListener(e){e!=null&&(this.listeners.includes(e)||this.listeners.push(e));}removeListener(e){e!=null&&this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}async applySettings(e){return this._settings=e,this.notifyContext({type:"singleImageModeUploaderSettings",newValue:this._settings})}toJSONObject(){return {type:this.type,settings:this.settings.toJSONObject(),desiredState:this.desiredState}}getCurrentState(){return this._currentState}async setCurrentState(e){if(e!==this._currentState)return this._currentState=e,this.notifyListeners(),this.notifyContext({type:"frameSourceState",newValue:e})}async notifyContext(e){if(this._context)return this._context.update([e])}notifyListeners(){for(let e of this.listeners)e.didChangeState&&e.didChangeState(this,this.currentState);}async processUploadedFileCapture(e){var t,r;await((t=this._context)==null?void 0:t.sendFrameToProcessor(e)),this.currentState="starting",(r=this._view)==null||r.onAfterImageProcessed();}addView(e){this._view=e;}};
4
-
5
- export { a };
File without changes