@scandit/web-datacapture-barcode 7.1.0 → 7.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/check/BarcodeCheck.js +1 -1
- package/build/js/check/BarcodeCheckFeedback.js +1 -1
- package/build/js/check/BarcodeCheckPresenter.js +1 -1
- package/build/js/check/BarcodeCheckView.js +1 -1
- package/build/js/chunks/{chunk-JFJU2O2C.js → chunk-3C4HMC5F.js} +1 -1
- package/build/js/chunks/{chunk-3S7HHSDC.js → chunk-7AIAIG5T.js} +1 -1
- package/build/js/chunks/{chunk-7OLJ6R22.js → chunk-ATSBKHNK.js} +1 -1
- package/build/js/chunks/{chunk-5KGWFDDE.js → chunk-ENVM4L4Z.js} +1 -1
- package/build/js/chunks/{chunk-ZZZNJSAC.js → chunk-FUS5WQC4.js} +1 -1
- package/build/js/chunks/{chunk-FY762RPS.js → chunk-HDL4B7UY.js} +1 -1
- package/build/js/chunks/{chunk-QHK2ZGUV.js → chunk-NTBYC47J.js} +1 -1
- package/build/js/chunks/chunk-PL47B3H5.js +1 -0
- package/build/js/chunks/{chunk-SGAO2QOE.js → chunk-Q6IBYUJQ.js} +1 -1
- package/build/js/chunks/{chunk-BQDC6XI3.js → chunk-QQUMOT3B.js} +1 -1
- package/build/js/chunks/{chunk-HCDON6SX.js → chunk-TCMZMAI3.js} +1 -1
- package/build/js/chunks/{chunk-IBNNXNR6.js → chunk-YAFD2FYD.js} +1 -1
- package/build/js/find/BarcodeFindView.js +1 -1
- package/build/js/find/index.js +1 -1
- package/build/js/index.js +1 -1
- package/build/js/moduleLoader.js +1 -1
- package/build/js/spark/index.js +1 -1
- package/build/js/spark/ui/SparkScanView.js +1 -1
- package/build/js/spark/ui/SparkScanViewMiniPreview.js +1 -1
- package/build/js/spark/ui/SparkScanViewTriggerButton.js +1 -1
- package/build/js/spark/ui/index.js +1 -1
- package/build/js/worker/BarcodeCaptureWorkerManager.js +1 -1
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/dataCapture.inlineWorker.js +1 -1
- package/build/js/worker/dataCaptureEngine.js +1 -1
- package/package.json +2 -2
- package/sdc-lib/scandit-datacapture-sdk-barcode-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode-simd.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-barcode.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-barcode.wasm +0 -0
- package/build/js/chunks/chunk-NVFF7ZI4.js +0 -1
- /package/build/js/chunks/{chunk-EK5TS63E.js → chunk-B6TRFCTV.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheck}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheck}from'../chunks/chunk-QQUMOT3B.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheckFeedback}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheckFeedback}from'../chunks/chunk-B6TRFCTV.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheckPresenter}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheckPresenter}from'../chunks/chunk-YAFD2FYD.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheckView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheckView}from'../chunks/chunk-ATSBKHNK.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-3S7HHSDC.js';import {a as a$2}from'./chunk-TBXQSBKX.js';import {b}from'./chunk-FY762RPS.js';import {a as a$6}from'./chunk-FJ4SOETD.js';import {a as a$5,c,e,f,g,h,i,j,k,b as b$1,d as d$2}from'./chunk-DVHTYKDX.js';import {m,j as j$1,i as i$1,d as d$1,c as c$1,k as k$1,l,f as f$1,b as b$2,e as e$1,g as g$1}from'./chunk-Y6DC25EF.js';import {d}from'./chunk-YBD5JYCX.js';import {a as a$3}from'./chunk-EB3IYU5V.js';import {a as a$4}from'./chunk-N7VOTJDF.js';import {a}from'./chunk-GKYQONEA.js';import {Point,CameraPosition,Color}from'@scandit/web-datacapture-core';import {OrientationObserver,orientationChangeEvent}from'@scandit/web-datacapture-core/build/js/private/OrientationObserver.js';import {ScanditHTMLElement,Timeout,defineCustomElements,css,clamp}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var $=class v extends ScanditHTMLElement{constructor(){super(...arguments);this.targetModeButtonVisible=!1;this.scanningBehaviorButtonVisible=!1;this.torchControlVisible=!0;this.zoomSwitchControlVisible=!0;this.previewSizeControlVisible=!0;this.barcodeFindButtonVisible=!1;this.cameraSwitchButtonVisible=!1;this.previewCloseControlVisible=!0;this.triggerButtonVisible=!0;this.feedbackDelegate={getFeedbackForBarcode:()=>a.success()};this.torchButtonVisible=!0;this.handModeButtonVisible=!1;this.miniPreview=b.create();this.triggerButton=a$1.create();this.visualFeedback=a$2.create();this.miniPreviewTimeout=new Timeout(500,this.onMiniPreviewTimeoutFinished.bind(this));this.orientationObserver=new OrientationObserver;this.miniPreviewPointerUpListener=this.onMiniPreviewPointerUp.bind(this);this.miniPreviewPointerMoveListener=this.onMiniPreviewPointerMove.bind(this);this.miniPreviewButtonTapListener=this.onMiniPreviewButtonTap.bind(this);this.miniPreviewDragListener=this.onMiniPreviewDrag.bind(this);this.miniPreviewDragEndListener=this.onMiniPreviewDragEnd.bind(this);this.triggerButtonPointerDownListener=this.onTriggerButtonPointerDown.bind(this);this.triggerButtonTapListener=this.onTriggerButtonTap.bind(this);this.triggerButtonLongPressStartListener=this.onTriggerButtonLongPressStart.bind(this);this.triggerButtonLongPressEndListener=this.onTriggerButtonLongPressEnd.bind(this);this.triggerButtonDragListener=this.onTriggerButtonDrag.bind(this);this.toolbarButtonTapListener=this.onToolbarButtonTap.bind(this);this.clickOutsideListener=this.onClickOutside.bind(this);this.visibilityChangeListener=this.onVisibilityChange.bind(this);this.orientationChangeListener=this.onOrientationChange.bind(this);this.holdingToScan=!1;}get _targetModeEnabledMessage(){var e;return (e=this.settings.toastSettings.targetModeEnabledMessage)!=null?e:"Aimer on"}get _targetModeDisabledMessage(){var e;return (e=this.settings.toastSettings.targetModeDisabledMessage)!=null?e:"Aimer off"}get _continuousModeEnabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeEnabledMessage)!=null?e:"Continuous mode on"}get _continuousModeDisabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeDisabledMessage)!=null?e:"Continuous mode off"}get _scanPausedMessage(){var e;return (e=this.settings.toastSettings.scanPausedMessage)!=null?e:"Scan paused"}get _torchEnabledMessage(){var e;return (e=this.settings.toastSettings.torchEnabledMessage)!=null?e:"Torch on"}get _torchDisabledMessage(){var e;return (e=this.settings.toastSettings.torchDisabledMessage)!=null?e:"Torch off"}get _zoomedInMessage(){var e;return (e=this.settings.toastSettings.zoomedInMessage)!=null?e:"2x zoom"}get _zoomedOutMessage(){var e;return (e=this.settings.toastSettings.zoomedOutMessage)!=null?e:"1x zoom"}static forElement(e,i,t,r){let n=v.create();return n.presenter=a$3.forView(n,i,t,r!=null?r:new a$4),n.settings=n.presenter.sparkScanViewSettings,n.append(n.miniPreview,n.triggerButton,n.visualFeedback,v.createStyleElement().cloneNode(!0)),n.hidden=!0,e.append(n),n}static create(){return defineCustomElements({[d]:v}),document.createElement("spark-scan-view")}static createStyleElement(){return css`:root{${a$5}:#12161966;${c}:#12161966;${e}:#5b707f4d;${f}:#fff;${g}:#121619cc;${h}:#fbc02c;${i}:#fff;${j}:#2ec1ce;${k}:#fa4446}`}async prepareScanning(){this.mount(),this.hidden=!1,await this.presenter.prepareScanning(this.miniPreview.host);}async startScanning(){await this.presenter.startScanning();}async pauseScanning(){await this.presenter.pauseScanning();}async stopScanning(){await this.presenter.stopScanning({sessionStopReason:"user"});}showToast(e){this.miniPreview.showToast("info",e,1e3);}setListener(e){this.presenter.setListener(e);}setTriggerButtonImage(e){this.triggerButton.setImage(e);}mount(){this.unmount(),this.miniPreview[m]=this.previewCloseControlVisible,this.miniPreview[j$1]=this.previewSizeControlVisible,this.miniPreview[i$1]=this.zoomSwitchControlVisible,this.miniPreview.size=this.settings.defaultMiniPreviewSize,this.miniPreview.toolbar&&(this.miniPreview.toolbar[d$1]=this.targetModeButtonVisible,this.miniPreview.toolbar[c$1]=this.scanningBehaviorButtonVisible,this.miniPreview.toolbar[k$1]=this.barcodeFindButtonVisible,this.miniPreview.toolbar[l]=this.cameraSwitchButtonVisible),this.triggerButton.visible=this.triggerButtonVisible;for(let[e$1,i$1]of [[this.triggerButtonCollapsedColor,a$5],[this.triggerButtonExpandedColor,c],[this.triggerButtonAnimationColor,e],[this.triggerButtonTintColor,f],[this.toolbarBackgroundColor,g],[this.toolbarIconActiveTintColor,h],[this.toolbarIconInactiveTintColor,i]])e$1&&this.style.setProperty(i$1,`#${e$1.toJSON()}`);this.setTriggerButtonPressedColor("triggerButtonCollapsedColor",a$5,b$1),this.setTriggerButtonPressedColor("triggerButtonExpandedColor",c,d$2),this.miniPreview.addEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.addEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.addEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.addEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.addEventListener("drag",this.miniPreviewDragListener),this.miniPreview.addEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.addEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.addEventListener("tap",this.triggerButtonTapListener),this.triggerButton.addEventListener("longpressstart",this.triggerButtonLongPressStartListener),this.triggerButton.addEventListener("longpressend",this.triggerButtonLongPressEndListener),this.triggerButton.addEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.register(),this.orientationObserver.addEventListener(orientationChangeEvent,this.orientationChangeListener),this.orientationObserver.dispatchOrientationChangeEvent(this.orientationObserver.orientation),document.addEventListener("pointerup",this.clickOutsideListener),document.addEventListener("visibilitychange",this.visibilityChangeListener);}unmount(){this.miniPreview.removeEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.removeEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.removeEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.removeEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.removeEventListener("drag",this.miniPreviewDragListener),this.miniPreview.removeEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.removeEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.removeEventListener("tap",this.triggerButtonTapListener),this.triggerButton.removeEventListener("holdstart",this.triggerButtonLongPressStartListener),this.triggerButton.removeEventListener("holdend",this.triggerButtonLongPressEndListener),this.triggerButton.removeEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(orientationChangeEvent,this.orientationChangeListener),document.removeEventListener("pointerup",this.clickOutsideListener),document.removeEventListener("visibilitychange",this.visibilityChangeListener),this.miniPreviewTimeout.stop();}connectedCallback(){this.mount();}disconnectedCallback(){this.unmount();}setTorchAvailable(e){this.miniPreview.toolbar&&(this.miniPreview[f$1]=this.torchControlVisible&&e);}setZoomAvailable(e){this.miniPreview[i$1]=this.zoomSwitchControlVisible&&e;}switchToIdleState(){this.miniPreview.darkened=!1,this.miniPreview.visible=!1,this.miniPreview.hideToast(),this.triggerButton.expanded=!1,this.triggerButton.stopPulsating();}async switchToActiveState(e,i,t,r){this.miniPreviewTimeout.stop(),this.miniPreview.hideToast(),this.miniPreview.cancelFadeOut(),this.miniPreview.darkened=!1,this.miniPreview.visible=!0,this.triggerButton.expanded=!0,this.triggerButton.startPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=i),e&&(t&&this.style.setProperty(j,`#${t.toJSON()}`),await this.visualFeedback.emitSuccessFeedback()),r===!0&&this.miniPreview.showToast("warning",this._zoomedInMessage,1e3);}async switchToInactiveState(e,i,t,r){this.miniPreview.darkened=e||t==="persistent",this.miniPreview.visible=e||t==="persistent",this.triggerButton.expanded=!0,this.triggerButton.stopPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=i),e&&(r&&this.style.setProperty(j,`#${r.toJSON()}`),await this.visualFeedback.emitSuccessFeedback(),t==="default"&&this.miniPreviewTimeout.start()),t==="persistent"&&this.miniPreview.showToast("warning",this._scanPausedMessage,Number.POSITIVE_INFINITY);}async switchToErrorState(e,i){e.resumeCapturingDelay>0&&(this.triggerButton.stopPulsating(),this.miniPreview.showToast("error",e.message,e.resumeCapturingDelay)),i&&(this.style.setProperty(k,`#${e.visualFeedbackColor.toJSON()}`),await this.visualFeedback.emitErrorFeedback());}async onMiniPreviewPointerUp(){await this.presenter.onMiniPreviewPointerUp();}onMiniPreviewPointerMove(){this.presenter.onMiniPreviewPointerMove();}async onMiniPreviewButtonTap(e){switch(e.detail.tapped){case"torchButton":{await this.presenter.onTorchButtonTap(e.detail.enabled);break}case"closeButton":{await this.presenter.onMiniPreviewCloseButtonTap();break}case"resizeButton":{this.presenter.onMiniPreviewResizeButtonTap();break}case"zoomButton":{await this.presenter.onMiniPreviewZoomButtonTap(e.detail.zoomFactor);break}}this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}async onMiniPreviewDrag(e){e instanceof a$6&&await this.presenter.onMiniPreviewDrag(e.point,this.orientationObserver.orientation.type);}async onMiniPreviewDragEnd(e){e instanceof a$6&&await this.presenter.onMiniPreviewDragEnd();}async onTriggerButtonPointerDown(){await this.presenter.onTriggerButtonPointerDown();}async onTriggerButtonTap(){await this.presenter.onTriggerButtonTap();}async onTriggerButtonLongPressStart(){this.holdingToScan||(this.holdingToScan=!0,await this.presenter.onTriggerButtonLongPressStart());}async onTriggerButtonLongPressEnd(){this.holdingToScan&&(this.holdingToScan=!1,await this.presenter.onTriggerButtonLongPressEnd());}onTriggerButtonDrag(e){e instanceof a$6&&this.presenter.onTriggerButtonDrag(e.point,this.orientationObserver.orientation.type);}async onToolbarButtonTap(e){switch(this.miniPreview.rewindAnimation(),e.detail.tapped){case"targetModeButton":{await this.onTargetModeButtonTap(e);return}case"scanningBehaviorButton":{await this.onScanningBehaviorButtonTap(e);return}case"barcodeFindButton":{await this.onBarcodeFindButtonTap();return}case"cameraSwitchButton":await this.onCameraSwitchButtonTap();}}async onClickOutside(e){e.composedPath().includes(this)||await this.presenter.onClickOutside();}async onVisibilityChange(){document.visibilityState==="hidden"&&await this.presenter.onVisibilityChange();}async onTargetModeButtonTap(e){await this.presenter.onTargetModeButtonTap(e.detail.enabled);}async onScanningBehaviorButtonTap(e){await this.presenter.onScanningBehaviorButtonTap(e.detail.enabled);}async onBarcodeFindButtonTap(){await this.presenter.onBarcodeFindButtonTap();}async onCameraSwitchButtonTap(){this.miniPreview[f$1]=!1,await this.presenter.onCameraSwitchButtonTap();}async onTorchButtonTap(e){await this.presenter.onTorchButtonTap(e.detail.enabled);}async onMiniPreviewTimeoutFinished(){await this.miniPreview.fadeOut();}async onOrientationChange(e){this.miniPreview.orientation=e.detail.type;let i,t,r,n;switch(e.detail.type){case"landscape-primary":case"landscape-secondary":{i=this.presenter.landscapeOrientationTriggerButtonTranslateX,t=this.presenter.landscapeOrientationTriggerButtonTranslateY,r=this.presenter.landscapeOrientationMiniPreviewTranslateX,n=this.presenter.landscapeOrientationMiniPreviewTranslateY;break}case"portrait-primary":case"portrait-secondary":{i=this.presenter.portraitOrientationTriggerButtonTranslateX,t=this.presenter.portraitOrientationTriggerButtonTranslateY,r=this.presenter.portraitOrientationMiniPreviewTranslateX,n=this.presenter.portraitOrientationMiniPreviewTranslateY;break}}this.triggerButton.translateTo(new Point(i,t)),this.miniPreview.translateTo(new Point(r,n)),await this.presenter.onOrientationChange();}targetModeButtonTapped(e,i=!0){if(i){let t=e?"warning":"info",r=e?this._targetModeEnabledMessage:this._targetModeDisabledMessage;this.miniPreview.showToast(t,r,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[e$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}scanningBehaviorButtonTapped(e,i=!0){if(i){let t=e?"warning":"info",r=e?this._continuousModeEnabledMessage:this._continuousModeDisabledMessage;this.miniPreview.showToast(t,r,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=e?"continuous":"single"),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}torchButtonTapped(e,i=!0){if(i){let t=e?"warning":"info",r=e?this._torchEnabledMessage:this._torchDisabledMessage;this.miniPreview.showToast(t,r,1e3);}this.miniPreview.toolbar&&(this.miniPreview[g$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}cameraSwitchButtonTapped(e,i){var t;this.miniPreview[f$1]=this.torchControlVisible&&e,(t=this.miniPreview.toolbar)==null||t.enableCameraSwitchButton(i===CameraPosition.UserFacing);}getDefaultCssVariableValue(e){return window.getComputedStyle(this).getPropertyValue(e)}setTriggerButtonPressedColor(e,i,t){var P;let r=(P=this[e])!=null?P:Color.fromHex(this.getDefaultCssVariableValue(i)),n=clamp(r.alpha+r.alpha*.25,r.alpha,255),U=r.withAlpha(n);this.style.setProperty(t,`#${U.toJSON()}`);}};export{$ as a};
|
|
1
|
+
import {a as a$1}from'./chunk-7AIAIG5T.js';import {a as a$2}from'./chunk-TBXQSBKX.js';import {b}from'./chunk-HDL4B7UY.js';import {a as a$6}from'./chunk-FJ4SOETD.js';import {a as a$5,c,e,f,g,h,i,j,k,b as b$1,d as d$2}from'./chunk-DVHTYKDX.js';import {m,j as j$1,i as i$1,d as d$1,c as c$1,k as k$1,l,f as f$1,b as b$2,e as e$1,g as g$1}from'./chunk-Y6DC25EF.js';import {d}from'./chunk-YBD5JYCX.js';import {a as a$3}from'./chunk-EB3IYU5V.js';import {a as a$4}from'./chunk-N7VOTJDF.js';import {a}from'./chunk-GKYQONEA.js';import {Point,CameraPosition,Color}from'@scandit/web-datacapture-core';import {OrientationObserver,orientationChangeEvent}from'@scandit/web-datacapture-core/build/js/private/OrientationObserver.js';import {ScanditHTMLElement,Timeout,defineCustomElements,css,clamp}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var $=class v extends ScanditHTMLElement{constructor(){super(...arguments);this.targetModeButtonVisible=!1;this.scanningBehaviorButtonVisible=!1;this.torchControlVisible=!0;this.zoomSwitchControlVisible=!0;this.previewSizeControlVisible=!0;this.barcodeFindButtonVisible=!1;this.cameraSwitchButtonVisible=!1;this.previewCloseControlVisible=!0;this.triggerButtonVisible=!0;this.feedbackDelegate={getFeedbackForBarcode:()=>a.success()};this.torchButtonVisible=!0;this.handModeButtonVisible=!1;this.miniPreview=b.create();this.triggerButton=a$1.create();this.visualFeedback=a$2.create();this.miniPreviewTimeout=new Timeout(500,this.onMiniPreviewTimeoutFinished.bind(this));this.orientationObserver=new OrientationObserver;this.miniPreviewPointerUpListener=this.onMiniPreviewPointerUp.bind(this);this.miniPreviewPointerMoveListener=this.onMiniPreviewPointerMove.bind(this);this.miniPreviewButtonTapListener=this.onMiniPreviewButtonTap.bind(this);this.miniPreviewDragListener=this.onMiniPreviewDrag.bind(this);this.miniPreviewDragEndListener=this.onMiniPreviewDragEnd.bind(this);this.triggerButtonPointerDownListener=this.onTriggerButtonPointerDown.bind(this);this.triggerButtonTapListener=this.onTriggerButtonTap.bind(this);this.triggerButtonLongPressStartListener=this.onTriggerButtonLongPressStart.bind(this);this.triggerButtonLongPressEndListener=this.onTriggerButtonLongPressEnd.bind(this);this.triggerButtonDragListener=this.onTriggerButtonDrag.bind(this);this.toolbarButtonTapListener=this.onToolbarButtonTap.bind(this);this.clickOutsideListener=this.onClickOutside.bind(this);this.visibilityChangeListener=this.onVisibilityChange.bind(this);this.orientationChangeListener=this.onOrientationChange.bind(this);this.holdingToScan=!1;}get _targetModeEnabledMessage(){var e;return (e=this.settings.toastSettings.targetModeEnabledMessage)!=null?e:"Aimer on"}get _targetModeDisabledMessage(){var e;return (e=this.settings.toastSettings.targetModeDisabledMessage)!=null?e:"Aimer off"}get _continuousModeEnabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeEnabledMessage)!=null?e:"Continuous mode on"}get _continuousModeDisabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeDisabledMessage)!=null?e:"Continuous mode off"}get _scanPausedMessage(){var e;return (e=this.settings.toastSettings.scanPausedMessage)!=null?e:"Scan paused"}get _torchEnabledMessage(){var e;return (e=this.settings.toastSettings.torchEnabledMessage)!=null?e:"Torch on"}get _torchDisabledMessage(){var e;return (e=this.settings.toastSettings.torchDisabledMessage)!=null?e:"Torch off"}get _zoomedInMessage(){var e;return (e=this.settings.toastSettings.zoomedInMessage)!=null?e:"2x zoom"}get _zoomedOutMessage(){var e;return (e=this.settings.toastSettings.zoomedOutMessage)!=null?e:"1x zoom"}static forElement(e,i,t,r){let n=v.create();return n.presenter=a$3.forView(n,i,t,r!=null?r:new a$4),n.settings=n.presenter.sparkScanViewSettings,n.append(n.miniPreview,n.triggerButton,n.visualFeedback,v.createStyleElement().cloneNode(!0)),n.hidden=!0,e.append(n),n}static create(){return defineCustomElements({[d]:v}),document.createElement("spark-scan-view")}static createStyleElement(){return css`:root{${a$5}:#12161966;${c}:#12161966;${e}:#5b707f4d;${f}:#fff;${g}:#121619cc;${h}:#fbc02c;${i}:#fff;${j}:#2ec1ce;${k}:#fa4446}`}async prepareScanning(){this.mount(),this.hidden=!1,await this.presenter.prepareScanning(this.miniPreview.host);}async startScanning(){await this.presenter.startScanning();}async pauseScanning(){await this.presenter.pauseScanning();}async stopScanning(){await this.presenter.stopScanning({sessionStopReason:"user"});}showToast(e){this.miniPreview.showToast("info",e,1e3);}setListener(e){this.presenter.setListener(e);}setTriggerButtonImage(e){this.triggerButton.setImage(e);}mount(){this.unmount(),this.miniPreview[m]=this.previewCloseControlVisible,this.miniPreview[j$1]=this.previewSizeControlVisible,this.miniPreview[i$1]=this.zoomSwitchControlVisible,this.miniPreview.size=this.settings.defaultMiniPreviewSize,this.miniPreview.toolbar&&(this.miniPreview.toolbar[d$1]=this.targetModeButtonVisible,this.miniPreview.toolbar[c$1]=this.scanningBehaviorButtonVisible,this.miniPreview.toolbar[k$1]=this.barcodeFindButtonVisible,this.miniPreview.toolbar[l]=this.cameraSwitchButtonVisible),this.triggerButton.visible=this.triggerButtonVisible;for(let[e$1,i$1]of [[this.triggerButtonCollapsedColor,a$5],[this.triggerButtonExpandedColor,c],[this.triggerButtonAnimationColor,e],[this.triggerButtonTintColor,f],[this.toolbarBackgroundColor,g],[this.toolbarIconActiveTintColor,h],[this.toolbarIconInactiveTintColor,i]])e$1&&this.style.setProperty(i$1,`#${e$1.toJSON()}`);this.setTriggerButtonPressedColor("triggerButtonCollapsedColor",a$5,b$1),this.setTriggerButtonPressedColor("triggerButtonExpandedColor",c,d$2),this.miniPreview.addEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.addEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.addEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.addEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.addEventListener("drag",this.miniPreviewDragListener),this.miniPreview.addEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.addEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.addEventListener("tap",this.triggerButtonTapListener),this.triggerButton.addEventListener("longpressstart",this.triggerButtonLongPressStartListener),this.triggerButton.addEventListener("longpressend",this.triggerButtonLongPressEndListener),this.triggerButton.addEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.register(),this.orientationObserver.addEventListener(orientationChangeEvent,this.orientationChangeListener),this.orientationObserver.dispatchOrientationChangeEvent(this.orientationObserver.orientation),document.addEventListener("pointerup",this.clickOutsideListener),document.addEventListener("visibilitychange",this.visibilityChangeListener);}unmount(){this.miniPreview.removeEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.removeEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.removeEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.removeEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.removeEventListener("drag",this.miniPreviewDragListener),this.miniPreview.removeEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.removeEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.removeEventListener("tap",this.triggerButtonTapListener),this.triggerButton.removeEventListener("holdstart",this.triggerButtonLongPressStartListener),this.triggerButton.removeEventListener("holdend",this.triggerButtonLongPressEndListener),this.triggerButton.removeEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(orientationChangeEvent,this.orientationChangeListener),document.removeEventListener("pointerup",this.clickOutsideListener),document.removeEventListener("visibilitychange",this.visibilityChangeListener),this.miniPreviewTimeout.stop();}connectedCallback(){this.mount();}disconnectedCallback(){this.unmount();}setTorchAvailable(e){this.miniPreview.toolbar&&(this.miniPreview[f$1]=this.torchControlVisible&&e);}setZoomAvailable(e){this.miniPreview[i$1]=this.zoomSwitchControlVisible&&e;}switchToIdleState(){this.miniPreview.darkened=!1,this.miniPreview.visible=!1,this.miniPreview.hideToast(),this.triggerButton.expanded=!1,this.triggerButton.stopPulsating();}async switchToActiveState(e,i,t,r){this.miniPreviewTimeout.stop(),this.miniPreview.hideToast(),this.miniPreview.cancelFadeOut(),this.miniPreview.darkened=!1,this.miniPreview.visible=!0,this.triggerButton.expanded=!0,this.triggerButton.startPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=i),e&&(t&&this.style.setProperty(j,`#${t.toJSON()}`),await this.visualFeedback.emitSuccessFeedback()),r===!0&&this.miniPreview.showToast("warning",this._zoomedInMessage,1e3);}async switchToInactiveState(e,i,t,r){this.miniPreview.darkened=e||t==="persistent",this.miniPreview.visible=e||t==="persistent",this.triggerButton.expanded=!0,this.triggerButton.stopPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=i),e&&(r&&this.style.setProperty(j,`#${r.toJSON()}`),await this.visualFeedback.emitSuccessFeedback(),t==="default"&&this.miniPreviewTimeout.start()),t==="persistent"&&this.miniPreview.showToast("warning",this._scanPausedMessage,Number.POSITIVE_INFINITY);}async switchToErrorState(e,i){e.resumeCapturingDelay>0&&(this.triggerButton.stopPulsating(),this.miniPreview.showToast("error",e.message,e.resumeCapturingDelay)),i&&(this.style.setProperty(k,`#${e.visualFeedbackColor.toJSON()}`),await this.visualFeedback.emitErrorFeedback());}async onMiniPreviewPointerUp(){await this.presenter.onMiniPreviewPointerUp();}onMiniPreviewPointerMove(){this.presenter.onMiniPreviewPointerMove();}async onMiniPreviewButtonTap(e){switch(e.detail.tapped){case"torchButton":{await this.presenter.onTorchButtonTap(e.detail.enabled);break}case"closeButton":{await this.presenter.onMiniPreviewCloseButtonTap();break}case"resizeButton":{this.presenter.onMiniPreviewResizeButtonTap();break}case"zoomButton":{await this.presenter.onMiniPreviewZoomButtonTap(e.detail.zoomFactor);break}}this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}async onMiniPreviewDrag(e){e instanceof a$6&&await this.presenter.onMiniPreviewDrag(e.point,this.orientationObserver.orientation.type);}async onMiniPreviewDragEnd(e){e instanceof a$6&&await this.presenter.onMiniPreviewDragEnd();}async onTriggerButtonPointerDown(){await this.presenter.onTriggerButtonPointerDown();}async onTriggerButtonTap(){await this.presenter.onTriggerButtonTap();}async onTriggerButtonLongPressStart(){this.holdingToScan||(this.holdingToScan=!0,await this.presenter.onTriggerButtonLongPressStart());}async onTriggerButtonLongPressEnd(){this.holdingToScan&&(this.holdingToScan=!1,await this.presenter.onTriggerButtonLongPressEnd());}onTriggerButtonDrag(e){e instanceof a$6&&this.presenter.onTriggerButtonDrag(e.point,this.orientationObserver.orientation.type);}async onToolbarButtonTap(e){switch(this.miniPreview.rewindAnimation(),e.detail.tapped){case"targetModeButton":{await this.onTargetModeButtonTap(e);return}case"scanningBehaviorButton":{await this.onScanningBehaviorButtonTap(e);return}case"barcodeFindButton":{await this.onBarcodeFindButtonTap();return}case"cameraSwitchButton":await this.onCameraSwitchButtonTap();}}async onClickOutside(e){e.composedPath().includes(this)||await this.presenter.onClickOutside();}async onVisibilityChange(){document.visibilityState==="hidden"&&await this.presenter.onVisibilityChange();}async onTargetModeButtonTap(e){await this.presenter.onTargetModeButtonTap(e.detail.enabled);}async onScanningBehaviorButtonTap(e){await this.presenter.onScanningBehaviorButtonTap(e.detail.enabled);}async onBarcodeFindButtonTap(){await this.presenter.onBarcodeFindButtonTap();}async onCameraSwitchButtonTap(){this.miniPreview[f$1]=!1,await this.presenter.onCameraSwitchButtonTap();}async onTorchButtonTap(e){await this.presenter.onTorchButtonTap(e.detail.enabled);}async onMiniPreviewTimeoutFinished(){await this.miniPreview.fadeOut();}async onOrientationChange(e){this.miniPreview.orientation=e.detail.type;let i,t,r,n;switch(e.detail.type){case"landscape-primary":case"landscape-secondary":{i=this.presenter.landscapeOrientationTriggerButtonTranslateX,t=this.presenter.landscapeOrientationTriggerButtonTranslateY,r=this.presenter.landscapeOrientationMiniPreviewTranslateX,n=this.presenter.landscapeOrientationMiniPreviewTranslateY;break}case"portrait-primary":case"portrait-secondary":{i=this.presenter.portraitOrientationTriggerButtonTranslateX,t=this.presenter.portraitOrientationTriggerButtonTranslateY,r=this.presenter.portraitOrientationMiniPreviewTranslateX,n=this.presenter.portraitOrientationMiniPreviewTranslateY;break}}this.triggerButton.translateTo(new Point(i,t)),this.miniPreview.translateTo(new Point(r,n)),await this.presenter.onOrientationChange();}targetModeButtonTapped(e,i=!0){if(i){let t=e?"warning":"info",r=e?this._targetModeEnabledMessage:this._targetModeDisabledMessage;this.miniPreview.showToast(t,r,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[e$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}scanningBehaviorButtonTapped(e,i=!0){if(i){let t=e?"warning":"info",r=e?this._continuousModeEnabledMessage:this._continuousModeDisabledMessage;this.miniPreview.showToast(t,r,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=e?"continuous":"single"),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}torchButtonTapped(e,i=!0){if(i){let t=e?"warning":"info",r=e?this._torchEnabledMessage:this._torchDisabledMessage;this.miniPreview.showToast(t,r,1e3);}this.miniPreview.toolbar&&(this.miniPreview[g$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}cameraSwitchButtonTapped(e,i){var t;this.miniPreview[f$1]=this.torchControlVisible&&e,(t=this.miniPreview.toolbar)==null||t.enableCameraSwitchButton(i===CameraPosition.UserFacing);}getDefaultCssVariableValue(e){return window.getComputedStyle(this).getPropertyValue(e)}setTriggerButtonPressedColor(e,i,t){var P;let r=(P=this[e])!=null?P:Color.fromHex(this.getDefaultCssVariableValue(i)),n=clamp(r.alpha+r.alpha*.25,r.alpha,255),U=r.withAlpha(n);this.style.setProperty(t,`#${U.toJSON()}`);}};export{$ as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a}from'./chunk-OHSTP7TM.js';import {b as b$
|
|
1
|
+
import {a}from'./chunk-OHSTP7TM.js';import {a as a$2,b as b$3}from'./chunk-OPL5NVVM.js';import {b as b$1}from'./chunk-FJ4SOETD.js';import {b as b$2}from'./chunk-5DP5VNWQ.js';import {a as a$3}from'./chunk-T2Y2C76P.js';import {e,f as f$1,a as a$1,b as b$4,d,c}from'./chunk-DVHTYKDX.js';import {f}from'./chunk-YBD5JYCX.js';import {Point}from'@scandit/web-datacapture-core';import {ScanditHTMLElement,defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var b=class f$2 extends ScanditHTMLElement{constructor(){super(...arguments);this._pointerDownListener=this.onPointerDown.bind(this);this._pointerUpListener=this.onPointerUp.bind(this);this._dragController=new b$1(this);this._longPressController=new b$2(this);this._longPressStartListener=this.onLongPressStart.bind(this);}get minimized(){return !this.hasAttribute("expanded")}set minimized(t){this.toggleAttribute("minimized",!t);}get expanded(){return this.hasAttribute("expanded")}set expanded(t){this.toggleAttribute("expanded",t),this._dragController.margin=t?new Point(-65,-65):new Point(0,0),this._dragController.repositionIfOutOfBounds();}get pressed(){return this.hasAttribute("pressed")}set pressed(t){this.toggleAttribute("pressed",t);}get visible(){return this.hasAttribute("visible")}set visible(t){this.toggleAttribute("visible",t);}static create(){return defineCustomElements({[f]:f$2}),document.createElement(f)}connectedCallback(){this.append(this.render()),this.addEventListener("pointerdown",this._pointerDownListener),this.addEventListener("pointerup",this._pointerUpListener),this.addEventListener("longpressstart",this._longPressStartListener),this._dragController.connect(),this._longPressController.connect(),this._longPressController.elementsAllowedToTriggerLongPressEvents.add(this),this._pulse=this.querySelector(".pulse"),this._pulseAnimation=new Animation(new KeyframeEffect(this._pulse,[{background:"rgba(0, 0, 0, 0)"},{background:`var(${e})`,transform:"translate(-50%, -50%) scale(1.1)"},{background:"rgba(0, 0, 0, 0)"}],{duration:1100,easing:"ease-out",iterations:Number.POSITIVE_INFINITY}));}disconnectedCallback(){this.removeEventListener("pointerdown",this._pointerDownListener),this.removeEventListener("pointerup",this._pointerUpListener),this.removeEventListener("longpressstart",this._longPressStartListener),this._dragController.disconnect(),this._longPressController.disconnect();}translateTo(t){this._dragController.translateTo(t,!1);}setImage(t){var n;let r=this.querySelector("div");(n=r.firstElementChild)==null||n.remove(),t&&r.append(t);}startPulsating(){var t;(t=this._pulseAnimation)==null||t.play();}stopPulsating(){this._pulseAnimation&&(this._pulseAnimation.cancel(),this._pulseAnimation.currentTime=0);}render(){return a`
|
|
2
2
|
<div>
|
|
3
3
|
<div class="pulse"></div>
|
|
4
4
|
<svg width="49" height="26" viewBox="0 0 49 26" fill="none" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-FOZL6AM4.js';import {a as a$8}from'./chunk-MSQTG4HE.js';import {a as a$5}from'./chunk-BBJPGTUG.js';import {a as a$6}from'./chunk-WL3PKWFT.js';import {c as c$1,b,a as a$9,d}from'./chunk-A2FMQ67Y.js';import {a as a$a}from'./chunk-QPUY23QD.js';import {a as a$c}from'./chunk-Y2XISTOT.js';import {a as a$4}from'./chunk-YLCNLTYD.js';import {a as a$b}from'./chunk-PWPSTL4C.js';import {a as a$2}from'./chunk-IBNNXNR6.js';import {a as a$7}from'./chunk-FCUTPMMU.js';import {a as a$1}from'./chunk-I53W7VSB.js';import {a as a$3}from'./chunk-BQDC6XI3.js';import {Anchor,DataCaptureView,Point,Size}from'@scandit/web-datacapture-core';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {css}from'@scandit/web-datacapture-core/build/js/private/utils/css.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {calculateWidth,calculateHeight}from'@scandit/web-datacapture-core/build/js/private/utils/quadrilateralUtils.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';var M={async highlightForBarcode(L,A){let t=a$c.create(L);A(t);}},c=class c extends ScanditHTMLElement{constructor(){super(...arguments);this.torchIconButton=null;this.cameraSwitchButton=null;this.zoomButton=null;this.onTorchButtonClickHandler=this.onTorchButtonClick.bind(this);this.onCameraSwitchButtonHandler=this.onCameraSwitchButtonClick.bind(this);this.onZoomButtonHandler=this.onZoomButtonClick.bind(this);this.onLayoutPointerDownHandler=this.onLayoutPointerDown.bind(this);this.onInfoAnnotationTapHandler=this.onInfoAnnotationTap.bind(this);this.onEdgesIntersectionObserverHandler=this.onEdgesIntersectionObserver.bind(this);this.pendingDeletionTimeout=null;}set shouldShowZoomControl(t){this.zoomButton&&(this.zoomButton.hidden=!t);}get shouldShowZoomControl(){return this.zoomButton===null?!1:!this.zoomButton.hidden}set shouldShowCameraSwitchControl(t){this.cameraSwitchButton&&(this.cameraSwitchButton.hidden=!t);}get shouldShowCameraSwitchControl(){return this.cameraSwitchButton===null?!1:!this.cameraSwitchButton.hidden}set shouldShowTorchControl(t){this.torchIconButton!==null&&(this.torchIconButton.hidden=!t);}get shouldShowTorchControl(){return this.torchIconButton===null?!1:!this.torchIconButton.hidden}set torchControlPosition(t){var e;(e=this.torchIconButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopLeft:t}`);}get torchControlPosition(){var e,o;let t=(o=(e=this.torchIconButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopLeft:t.replace("controls-","")}set zoomControlPosition(t){var e;(e=this.zoomButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.BottomRight:t}`);}get zoomControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.BottomRight:t.replace("controls-","")}set cameraSwitchControlPosition(t){var e;(e=this.cameraSwitchButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopRight:t}`);}get cameraSwitchControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopRight:t.replace("controls-","")}static async createWithSettings(t,e,o,i,n){c.register();let r=document.createElement(c.tag);return r.barcodeCheckViewSettings=i,r.layout=a.create(),r.append(r.layout),a$1(t)?(r.dataCaptureView=t,r.dataCaptureView.containerElement.prepend(r),await t.setContext(e)):(r.dataCaptureView=await DataCaptureView.forContext(e),r.dataCaptureView.connectToElement(t),r.dataCaptureView.containerElement.prepend(r)),r.presenter=new a$2(r,e,o,i,n!=null?n:a$3.createRecommendedCameraSettings()),await r.presenter.prepare(),r}static async create(t,e,o){return c.createWithSettings(t,e,o,new a$4)}static register(){defineCustomElements({[a.tag]:a,[a$5.tag]:a$5,[a$6.tag]:a$6,[a$7.tag]:a$7,[c.tag]:c,[a$8.tag]:a$8});}static createStyleElement(){return css`[data-could-be-deleted=true]{display:none!important}[data-on-foreground=true]{z-index:3}${c.tag}{inset:0;position:absolute;z-index:1}`}async start(){return this.presenter.startSearching()}async stop(){return this.presenter.stopSearching()}async pause(){return this.presenter.pauseSearching()}reset(){this.deletePendingViews(),this.deleteAllViews();}toggleTorchIcon(t){this.torchIconButton!==null&&(this.torchIconButton.state=t);}onTorchButtonClick(){this.presenter.onTorchButtonClicked();}onCameraSwitchButtonClick(){this.presenter.onCameraSwitchButtonClicked();}onZoomButtonClick(){this.presenter.onZoomButtonClicked();}changeZoomButtonIcon(t){this.zoomButton&&(this.zoomButton.zoom=`${t}x`);}isValidIntersectionEntry(t){return t.rootBounds!=null&&!t.target.hidden}edgeObserverLandscapeLogic(t,e){t.direction="horizontal",(!t.anchor||c$1(t.anchor))&&(t.anchor=e.left?"left-center":"right-center"),e.left?t.anchor="left-center":e.right&&(t.anchor="right-center");}edgeObserverPortraitLogic(t,e){let o=e.bottom||e.top,i=e.left||e.right;o?(t.direction="vertical",t.anchor=e.bottom?"bottom-center":"top-center"):i&&(t.anchor!=null&&b(t.direction)&&c$1(t.anchor)?(t.anchor=e.left?"left-center":"right-center",t.direction="horizontal"):t.anchor!=null&&a$9(t.direction)&&d(t.anchor)&&(e.left&&t.anchor==="left-center"||e.right&&t.anchor==="right-center"||(t.anchor="top-center",t.direction="vertical")));}onEdgesIntersectionObserver(t){for(let e of t){let o=e.target;if(!this.isPopoverAnnotation(o)||!this.isValidIntersectionEntry(e))continue;let{boundingClientRect:i,rootBounds:n}=e,r=this.getTouchedEdges(i,n);!!(n!=null&&n.width&&(n!=null&&n.height)&&(n==null?void 0:n.width)>(n==null?void 0:n.height))?this.edgeObserverLandscapeLogic(o,r):this.edgeObserverPortraitLogic(o,r);}}connectedCallback(){this.torchIconButton=a$7.create(),this.torchIconButton.slot=`controls-${this.torchControlPosition}`,this.torchIconButton.hidden=!0,this.torchIconButton.addEventListener("pointerdown",this.onTorchButtonClickHandler),this.cameraSwitchButton=a$5.create(),this.cameraSwitchButton.slot=`controls-${this.cameraSwitchControlPosition}`,this.cameraSwitchButton.hidden=!0,this.cameraSwitchButton.addEventListener("pointerdown",this.onCameraSwitchButtonHandler),this.zoomButton=a$6.create(),this.zoomButton.slot=`controls-${this.zoomControlPosition}`,this.zoomButton.hidden=!0,this.zoomButton.addEventListener("pointerdown",this.onZoomButtonHandler),this.layout.append(this.torchIconButton,this.cameraSwitchButton,this.zoomButton),this.layout.addEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.addEventListener("BarcodeCheckInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.backdrop=a$8.create(),this.layout.append(this.backdrop),this.edgesObserver=new IntersectionObserver(this.onEdgesIntersectionObserverHandler,{root:this,threshold:[1,.75,.5,.25,0],rootMargin:"0px"}),this.pendingDeletionTimeout=new Timeout(1e3,()=>{this.deletePendingViews();}),this.prepend(c.createStyleElement());}disconnectedCallback(){var t,e,o;this.deleteAllViews(),(t=this.torchIconButton)==null||t.removeEventListener("pointerdown",this.onTorchButtonClickHandler),(e=this.cameraSwitchButton)==null||e.removeEventListener("pointerdown",this.onCameraSwitchButtonHandler),(o=this.zoomButton)==null||o.removeEventListener("pointerdown",this.onZoomButtonHandler),this.layout.removeEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.removeEventListener("BarcodeCheckInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.edgesObserver.disconnect();}isPopoverAnnotation(t){return t instanceof a$a}areMultiplePopoverAllowed(){for(let t of this.layout.querySelectorAll(`${a$a.tag}`))if(t&&this.isPopoverAnnotation(t)&&t.annotationTrigger==="highlightAndBarcodeScan")return !0;return !1}async onLayoutPointerDown(t){let e=t.target,o=e==null?void 0:e.closest("[data-identifier$='-highlight']"),i=e==null?void 0:e.closest(a$a.tag);if((o==null?void 0:o.dataset.id)!=null){await this.handleHighlightClick(o);return}if((i==null?void 0:i.dataset.id)!=null){await this.handleAnnotationClick(i);return}await this.handleClickOutside();}async handleHighlightClick(t){this.presenter.emitTappedFeedback();let e=this.queryAnnotationByDataIdentifier(t.dataset.identifier.replace("-highlight",""));e&&(e instanceof a$a?await this.handlePopoverHighlightClick(e,t):e.hidden=!e.hidden);}async handlePopoverHighlightClick(t,e){var o;if(!this.areMultiplePopoverAllowed()){let i=this.layout.querySelector(`${a$a.tag}[data-on-foreground="true"]`),n=(o=i==null?void 0:i.dataset.identifier)==null?void 0:o.replace("-annotation","-highlight"),r=this.layout.querySelector(`[data-identifier="${n}"]`);i!=null&&r!=null&&await this.hideBarcodeCheckPopover(i,r,!1);}await this.toggleBarcodeCheckPopover(t,e),this.edgesObserver.unobserve(t),this.edgesObserver.observe(t);}async handleAnnotationClick(t){var i;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.toggleBarcodeCheckPopover(t,o);}async handleClickOutside(){var i;if(this.areMultiplePopoverAllowed())return;let t=this.layout.querySelector(`${a$a.tag}[data-on-foreground="true"]`);if(!t)return;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.hideBarcodeCheckPopover(t,o);}onInfoAnnotationTap(){this.presenter.emitTappedFeedback();}async showBarcodeCheckPopover(t,e){t.dataset.onForeground="true",t.hidden=!1,e.dataset.onForeground="true",this.backdrop.open=!0;}async hideBarcodeCheckPopover(t,e,o=!0){t.dataset.onForeground="false",t.hidden=!0,e&&(e.dataset.onForeground="false"),o&&this.hideBackdropIfNoPopovers();}hideBackdropIfNoPopovers(){[...this.layout.querySelectorAll(`${a$a.tag}`)].every(e=>e.hidden)&&(this.backdrop.open=!1);}async toggleBarcodeCheckPopover(t,e){t.hidden?await this.showBarcodeCheckPopover(t,e):await this.hideBarcodeCheckPopover(t,e);}deleteAllViews(){for(let t of this.layout.querySelectorAll("[data-identifier]"))this.edgesObserver.unobserve(t),t.remove();}deletePendingViews(){for(let t of this.layout.querySelectorAll("[data-could-be-deleted='true']"))t.remove();this.hideBackdropIfNoPopovers();}identifierForHighlight(t){return `${t}-highlight`}identifierForAnnotation(t){return `${t}-annotation`}async onHighlightsOrAnnotationForTrackedBarcode(t){var e,o,i;await((o=(e=this.highlightProvider)!=null?e:M)==null?void 0:o.highlightForBarcode(t.barcode,async n=>this.onHighlight(t,n))),await((i=this.annotationProvider)==null?void 0:i.annotationForBarcode(t.barcode,async n=>this.onAnnotation(t,n)));}async onAnnotation(t,e){let o=e,i=a$b(t),n=this.queryAnnotationByDataId(i);if(n)n.dataset.couldBeDeleted="false";else {if(o.dataset.id=i,o.dataset.identifier=this.identifierForAnnotation(t.identifier),o.hidden=!0,this.layout.append(o),this.isPopoverAnnotation(o)){if(o.direction="vertical",o.anchor="top-center",this.edgesObserver.observe(o),this.areMultiplePopoverAllowed()||o.annotationTrigger==="highlightAndBarcodeScan"){let r=this.queryHighlightByDataId(i);if(!r)return;this.showBarcodeCheckPopover(o,r);}}else {let r=o;r.hidden=r.annotationTrigger==="highlightTap";}this.updateAnnotationPosition(t,o);}}async onHighlight(t,e){let o=a$b(t),i=this.queryHighlightByDataId(o);i?i.dataset.couldBeDeleted="false":(e.dataset.id=o,e.dataset.identifier=this.identifierForHighlight(t.identifier),this.updateHighlightPosition(t,e),this.layout.append(e));}queryHighlightByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-highlight"]`)}queryAnnotationByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-annotation"]`)}queryHighlightByDataId(t){return this.layout.querySelector(`[data-identifier$="-highlight"][data-id="${t}"]`)}queryAnnotationByDataId(t){return this.layout.querySelector(`[data-identifier$="-annotation"][data-id="${t}"]`)}updateRemovedTrackedBarcodes(t){var i,n,r,p,u;let e=this.querySelectorAll("[data-identifier]");if(Object.keys(t.allTrackedBarcodes).length===0){for(let l of e)l.dataset.couldBeDeleted="true";(i=this.pendingDeletionTimeout)!=null&&i.running||(n=this.pendingDeletionTimeout)==null||n.start();return}let o=new Set(t.removedTrackedBarcodes);for(let l of e){let a=(r=l.dataset.identifier)==null?void 0:r.replace("-highlight","").replace("-annotation","");a!=null&&o.has(a)&&(l.dataset.couldBeDeleted="true");}(p=this.pendingDeletionTimeout)!=null&&p.running||(u=this.pendingDeletionTimeout)==null||u.start();}render(t){for(let[e,o]of Object.entries(t.allTrackedBarcodes)){t.addedTrackedBarcodes[e]!=null&&this.onHighlightsOrAnnotationForTrackedBarcode(o);let i=a$b(o),n=this.queryAnnotationByDataId(i),r=this.queryHighlightByDataId(i);r&&(r.type==="rectangle"&&this.updateBrushSize(r,o),this.updateHighlightPosition(o,r)),n&&r&&this.updateAnnotationPosition(o,n,r);}this.updateRemovedTrackedBarcodes(t);}updateHighlightPosition(t,e,o="center"){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions),n=this.normalizedViewPointFromFrameAnchorPositions(i,o);this.setPosition(e,n,{x:-50,y:-50},this.calculateRotationAngle(i.topLeft,i.topRight));}updateBrushSize(t,e){let o=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(e.anchorPositions),i=Math.round(calculateWidth(o)),n=Math.round(calculateHeight(o));t.type==="rectangle"&&(t.width!==i&&(t.width=i),t.height!==n&&(t.height=n));}getTransformOrigin(t){return {"top-center":{x:-50,y:0},"bottom-center":{x:-50,y:-100},"left-center":{x:0,y:-50},"right-center":{x:-100,y:-50}}[t]}calculateAnnotationPosition(t,e,o){var l;let n=t.orderVerticesByPosition(),r=this.normalizedViewPointFromFrameAnchorPositions(t,"center"),u={"bottom-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"topCenter");return new Point(a.x,a.y-7)},"top-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"bottomCenter");return new Point(a.x,a.y+7)},"right-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"centerLeft");return new Point(a.x-7,a.y)},"left-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"centerRight");return new Point(a.x+7,a.y)}}[e]();return (o==null?void 0:o.type)==="circle"&&(l={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?l:u}updateAnnotationPosition(t,e,o){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions);e.anchor||(e.anchor="top-center");let n=this.getTransformOrigin(e.anchor),r=this.calculateAnnotationPosition(i,e.anchor,o);this.setPosition(e,r,n);}setPosition(t,e,o,i=0){t.style.position="absolute",t.style.willChange="transform",t.style.transform=`translate3d(calc(${Math.round(e.x)}px + ${o.x}%), calc(${Math.round(e.y)}px + ${o.y}%), 0px) rotate(${i}deg)`;}getTouchedEdges(t,e){let o=t.top<=e.top,i=t.bottom>=e.bottom,n=t.left<=e.left,r=t.right>=e.right;return {top:o,bottom:i,left:n,right:r}}normalizedViewPointFromFrameAnchorPositions(t,e="center"){let o=this.presenter.currentCamera.getMirrorImageEnabled(),i=new Size(this.dataCaptureView.width,this.dataCaptureView.height);if(o){let r=t[{centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"}[e]];return Point.mirrorX(r,i)}return t[e]}calculateRotationAngle(t,e){let o=e.x-t.x,i=-(e.y-t.y),n=Math.atan2(i,o);return Math.round(n*(180/Math.PI))}};c.tag="scandit-barcode-check-view";var E=c;export{E as a};
|
|
1
|
+
import {a}from'./chunk-FOZL6AM4.js';import {a as a$8}from'./chunk-MSQTG4HE.js';import {a as a$5}from'./chunk-BBJPGTUG.js';import {a as a$6}from'./chunk-WL3PKWFT.js';import {c as c$1,b,a as a$9,d}from'./chunk-A2FMQ67Y.js';import {a as a$c}from'./chunk-Y2XISTOT.js';import {a as a$a}from'./chunk-QPUY23QD.js';import {a as a$7}from'./chunk-FCUTPMMU.js';import {a as a$2}from'./chunk-YAFD2FYD.js';import {a as a$4}from'./chunk-YLCNLTYD.js';import {a as a$b}from'./chunk-PWPSTL4C.js';import {a as a$1}from'./chunk-I53W7VSB.js';import {a as a$3}from'./chunk-QQUMOT3B.js';import {Anchor,DataCaptureView,Point,Size}from'@scandit/web-datacapture-core';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {css}from'@scandit/web-datacapture-core/build/js/private/utils/css.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {calculateWidth,calculateHeight}from'@scandit/web-datacapture-core/build/js/private/utils/quadrilateralUtils.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';var M={async highlightForBarcode(L,A){let t=a$c.create(L);A(t);}},c=class c extends ScanditHTMLElement{constructor(){super(...arguments);this.torchIconButton=null;this.cameraSwitchButton=null;this.zoomButton=null;this.onTorchButtonClickHandler=this.onTorchButtonClick.bind(this);this.onCameraSwitchButtonHandler=this.onCameraSwitchButtonClick.bind(this);this.onZoomButtonHandler=this.onZoomButtonClick.bind(this);this.onLayoutPointerDownHandler=this.onLayoutPointerDown.bind(this);this.onInfoAnnotationTapHandler=this.onInfoAnnotationTap.bind(this);this.onEdgesIntersectionObserverHandler=this.onEdgesIntersectionObserver.bind(this);this.pendingDeletionTimeout=null;}set shouldShowZoomControl(t){this.zoomButton&&(this.zoomButton.hidden=!t);}get shouldShowZoomControl(){return this.zoomButton===null?!1:!this.zoomButton.hidden}set shouldShowCameraSwitchControl(t){this.cameraSwitchButton&&(this.cameraSwitchButton.hidden=!t);}get shouldShowCameraSwitchControl(){return this.cameraSwitchButton===null?!1:!this.cameraSwitchButton.hidden}set shouldShowTorchControl(t){this.torchIconButton!==null&&(this.torchIconButton.hidden=!t);}get shouldShowTorchControl(){return this.torchIconButton===null?!1:!this.torchIconButton.hidden}set torchControlPosition(t){var e;(e=this.torchIconButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopLeft:t}`);}get torchControlPosition(){var e,o;let t=(o=(e=this.torchIconButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopLeft:t.replace("controls-","")}set zoomControlPosition(t){var e;(e=this.zoomButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.BottomRight:t}`);}get zoomControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.BottomRight:t.replace("controls-","")}set cameraSwitchControlPosition(t){var e;(e=this.cameraSwitchButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopRight:t}`);}get cameraSwitchControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopRight:t.replace("controls-","")}static async createWithSettings(t,e,o,i,n){c.register();let r=document.createElement(c.tag);return r.barcodeCheckViewSettings=i,r.layout=a.create(),r.append(r.layout),a$1(t)?(r.dataCaptureView=t,r.dataCaptureView.containerElement.prepend(r),await t.setContext(e)):(r.dataCaptureView=await DataCaptureView.forContext(e),r.dataCaptureView.connectToElement(t),r.dataCaptureView.containerElement.prepend(r)),r.presenter=new a$2(r,e,o,i,n!=null?n:a$3.createRecommendedCameraSettings()),await r.presenter.prepare(),r}static async create(t,e,o){return c.createWithSettings(t,e,o,new a$4)}static register(){defineCustomElements({[a.tag]:a,[a$5.tag]:a$5,[a$6.tag]:a$6,[a$7.tag]:a$7,[c.tag]:c,[a$8.tag]:a$8});}static createStyleElement(){return css`[data-could-be-deleted=true]{display:none!important}[data-on-foreground=true]{z-index:3}${c.tag}{inset:0;position:absolute;z-index:1}`}async start(){return this.presenter.startSearching()}async stop(){return this.presenter.stopSearching()}async pause(){return this.presenter.pauseSearching()}reset(){this.deletePendingViews(),this.deleteAllViews();}toggleTorchIcon(t){this.torchIconButton!==null&&(this.torchIconButton.state=t);}onTorchButtonClick(){this.presenter.onTorchButtonClicked();}onCameraSwitchButtonClick(){this.presenter.onCameraSwitchButtonClicked();}onZoomButtonClick(){this.presenter.onZoomButtonClicked();}changeZoomButtonIcon(t){this.zoomButton&&(this.zoomButton.zoom=`${t}x`);}isValidIntersectionEntry(t){return t.rootBounds!=null&&!t.target.hidden}edgeObserverLandscapeLogic(t,e){t.direction="horizontal",(!t.anchor||c$1(t.anchor))&&(t.anchor=e.left?"left-center":"right-center"),e.left?t.anchor="left-center":e.right&&(t.anchor="right-center");}edgeObserverPortraitLogic(t,e){let o=e.bottom||e.top,i=e.left||e.right;o?(t.direction="vertical",t.anchor=e.bottom?"bottom-center":"top-center"):i&&(t.anchor!=null&&b(t.direction)&&c$1(t.anchor)?(t.anchor=e.left?"left-center":"right-center",t.direction="horizontal"):t.anchor!=null&&a$9(t.direction)&&d(t.anchor)&&(e.left&&t.anchor==="left-center"||e.right&&t.anchor==="right-center"||(t.anchor="top-center",t.direction="vertical")));}onEdgesIntersectionObserver(t){for(let e of t){let o=e.target;if(!this.isPopoverAnnotation(o)||!this.isValidIntersectionEntry(e))continue;let{boundingClientRect:i,rootBounds:n}=e,r=this.getTouchedEdges(i,n);!!(n!=null&&n.width&&(n!=null&&n.height)&&(n==null?void 0:n.width)>(n==null?void 0:n.height))?this.edgeObserverLandscapeLogic(o,r):this.edgeObserverPortraitLogic(o,r);}}connectedCallback(){this.torchIconButton=a$7.create(),this.torchIconButton.slot=`controls-${this.torchControlPosition}`,this.torchIconButton.hidden=!0,this.torchIconButton.addEventListener("pointerdown",this.onTorchButtonClickHandler),this.cameraSwitchButton=a$5.create(),this.cameraSwitchButton.slot=`controls-${this.cameraSwitchControlPosition}`,this.cameraSwitchButton.hidden=!0,this.cameraSwitchButton.addEventListener("pointerdown",this.onCameraSwitchButtonHandler),this.zoomButton=a$6.create(),this.zoomButton.slot=`controls-${this.zoomControlPosition}`,this.zoomButton.hidden=!0,this.zoomButton.addEventListener("pointerdown",this.onZoomButtonHandler),this.layout.append(this.torchIconButton,this.cameraSwitchButton,this.zoomButton),this.layout.addEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.addEventListener("BarcodeCheckInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.backdrop=a$8.create(),this.layout.append(this.backdrop),this.edgesObserver=new IntersectionObserver(this.onEdgesIntersectionObserverHandler,{root:this,threshold:[1,.75,.5,.25,0],rootMargin:"0px"}),this.pendingDeletionTimeout=new Timeout(1e3,()=>{this.deletePendingViews();}),this.prepend(c.createStyleElement());}disconnectedCallback(){var t,e,o;this.deleteAllViews(),(t=this.torchIconButton)==null||t.removeEventListener("pointerdown",this.onTorchButtonClickHandler),(e=this.cameraSwitchButton)==null||e.removeEventListener("pointerdown",this.onCameraSwitchButtonHandler),(o=this.zoomButton)==null||o.removeEventListener("pointerdown",this.onZoomButtonHandler),this.layout.removeEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.removeEventListener("BarcodeCheckInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.edgesObserver.disconnect();}isPopoverAnnotation(t){return t instanceof a$a}areMultiplePopoverAllowed(){for(let t of this.layout.querySelectorAll(`${a$a.tag}`))if(t&&this.isPopoverAnnotation(t)&&t.annotationTrigger==="highlightAndBarcodeScan")return !0;return !1}async onLayoutPointerDown(t){let e=t.target,o=e==null?void 0:e.closest("[data-identifier$='-highlight']"),i=e==null?void 0:e.closest(a$a.tag);if((o==null?void 0:o.dataset.id)!=null){await this.handleHighlightClick(o);return}if((i==null?void 0:i.dataset.id)!=null){await this.handleAnnotationClick(i);return}await this.handleClickOutside();}async handleHighlightClick(t){this.presenter.emitTappedFeedback();let e=this.queryAnnotationByDataIdentifier(t.dataset.identifier.replace("-highlight",""));e&&(e instanceof a$a?await this.handlePopoverHighlightClick(e,t):e.hidden=!e.hidden);}async handlePopoverHighlightClick(t,e){var o;if(!this.areMultiplePopoverAllowed()){let i=this.layout.querySelector(`${a$a.tag}[data-on-foreground="true"]`),n=(o=i==null?void 0:i.dataset.identifier)==null?void 0:o.replace("-annotation","-highlight"),r=this.layout.querySelector(`[data-identifier="${n}"]`);i!=null&&r!=null&&await this.hideBarcodeCheckPopover(i,r,!1);}await this.toggleBarcodeCheckPopover(t,e),this.edgesObserver.unobserve(t),this.edgesObserver.observe(t);}async handleAnnotationClick(t){var i;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.toggleBarcodeCheckPopover(t,o);}async handleClickOutside(){var i;if(this.areMultiplePopoverAllowed())return;let t=this.layout.querySelector(`${a$a.tag}[data-on-foreground="true"]`);if(!t)return;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.hideBarcodeCheckPopover(t,o);}onInfoAnnotationTap(){this.presenter.emitTappedFeedback();}async showBarcodeCheckPopover(t,e){t.dataset.onForeground="true",t.hidden=!1,e.dataset.onForeground="true",this.backdrop.open=!0;}async hideBarcodeCheckPopover(t,e,o=!0){t.dataset.onForeground="false",t.hidden=!0,e&&(e.dataset.onForeground="false"),o&&this.hideBackdropIfNoPopovers();}hideBackdropIfNoPopovers(){[...this.layout.querySelectorAll(`${a$a.tag}`)].every(e=>e.hidden)&&(this.backdrop.open=!1);}async toggleBarcodeCheckPopover(t,e){t.hidden?await this.showBarcodeCheckPopover(t,e):await this.hideBarcodeCheckPopover(t,e);}deleteAllViews(){for(let t of this.layout.querySelectorAll("[data-identifier]"))this.edgesObserver.unobserve(t),t.remove();}deletePendingViews(){for(let t of this.layout.querySelectorAll("[data-could-be-deleted='true']"))t.remove();this.hideBackdropIfNoPopovers();}identifierForHighlight(t){return `${t}-highlight`}identifierForAnnotation(t){return `${t}-annotation`}async onHighlightsOrAnnotationForTrackedBarcode(t){var e,o,i;await((o=(e=this.highlightProvider)!=null?e:M)==null?void 0:o.highlightForBarcode(t.barcode,async n=>this.onHighlight(t,n))),await((i=this.annotationProvider)==null?void 0:i.annotationForBarcode(t.barcode,async n=>this.onAnnotation(t,n)));}async onAnnotation(t,e){let o=e,i=a$b(t),n=this.queryAnnotationByDataId(i);if(n)n.dataset.couldBeDeleted="false";else {if(o.dataset.id=i,o.dataset.identifier=this.identifierForAnnotation(t.identifier),o.hidden=!0,this.layout.append(o),this.isPopoverAnnotation(o)){if(o.direction="vertical",o.anchor="top-center",this.edgesObserver.observe(o),this.areMultiplePopoverAllowed()||o.annotationTrigger==="highlightAndBarcodeScan"){let r=this.queryHighlightByDataId(i);if(!r)return;this.showBarcodeCheckPopover(o,r);}}else {let r=o;r.hidden=r.annotationTrigger==="highlightTap";}this.updateAnnotationPosition(t,o);}}async onHighlight(t,e){let o=a$b(t),i=this.queryHighlightByDataId(o);i?i.dataset.couldBeDeleted="false":(e.dataset.id=o,e.dataset.identifier=this.identifierForHighlight(t.identifier),this.updateHighlightPosition(t,e),this.layout.append(e));}queryHighlightByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-highlight"]`)}queryAnnotationByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-annotation"]`)}queryHighlightByDataId(t){return this.layout.querySelector(`[data-identifier$="-highlight"][data-id="${t}"]`)}queryAnnotationByDataId(t){return this.layout.querySelector(`[data-identifier$="-annotation"][data-id="${t}"]`)}updateRemovedTrackedBarcodes(t){var i,n,r,p,u;let e=this.querySelectorAll("[data-identifier]");if(Object.keys(t.allTrackedBarcodes).length===0){for(let l of e)l.dataset.couldBeDeleted="true";(i=this.pendingDeletionTimeout)!=null&&i.running||(n=this.pendingDeletionTimeout)==null||n.start();return}let o=new Set(t.removedTrackedBarcodes);for(let l of e){let a=(r=l.dataset.identifier)==null?void 0:r.replace("-highlight","").replace("-annotation","");a!=null&&o.has(a)&&(l.dataset.couldBeDeleted="true");}(p=this.pendingDeletionTimeout)!=null&&p.running||(u=this.pendingDeletionTimeout)==null||u.start();}render(t){for(let[e,o]of Object.entries(t.allTrackedBarcodes)){t.addedTrackedBarcodes[e]!=null&&this.onHighlightsOrAnnotationForTrackedBarcode(o);let i=a$b(o),n=this.queryAnnotationByDataId(i),r=this.queryHighlightByDataId(i);r&&(r.type==="rectangle"&&this.updateBrushSize(r,o),this.updateHighlightPosition(o,r)),n&&r&&this.updateAnnotationPosition(o,n,r);}this.updateRemovedTrackedBarcodes(t);}updateHighlightPosition(t,e,o="center"){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions),n=this.normalizedViewPointFromFrameAnchorPositions(i,o);this.setPosition(e,n,{x:-50,y:-50},this.calculateRotationAngle(i.topLeft,i.topRight));}updateBrushSize(t,e){let o=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(e.anchorPositions),i=Math.round(calculateWidth(o)),n=Math.round(calculateHeight(o));t.type==="rectangle"&&(t.width!==i&&(t.width=i),t.height!==n&&(t.height=n));}getTransformOrigin(t){return {"top-center":{x:-50,y:0},"bottom-center":{x:-50,y:-100},"left-center":{x:0,y:-50},"right-center":{x:-100,y:-50}}[t]}calculateAnnotationPosition(t,e,o){var l;let n=t.orderVerticesByPosition(),r=this.normalizedViewPointFromFrameAnchorPositions(t,"center"),u={"bottom-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"topCenter");return new Point(a.x,a.y-7)},"top-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"bottomCenter");return new Point(a.x,a.y+7)},"right-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"centerLeft");return new Point(a.x-7,a.y)},"left-center":()=>{let a=this.normalizedViewPointFromFrameAnchorPositions(n,"centerRight");return new Point(a.x+7,a.y)}}[e]();return (o==null?void 0:o.type)==="circle"&&(l={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?l:u}updateAnnotationPosition(t,e,o){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions);e.anchor||(e.anchor="top-center");let n=this.getTransformOrigin(e.anchor),r=this.calculateAnnotationPosition(i,e.anchor,o);this.setPosition(e,r,n);}setPosition(t,e,o,i=0){t.style.position="absolute",t.style.willChange="transform",t.style.transform=`translate3d(calc(${Math.round(e.x)}px + ${o.x}%), calc(${Math.round(e.y)}px + ${o.y}%), 0px) rotate(${i}deg)`;}getTouchedEdges(t,e){let o=t.top<=e.top,i=t.bottom>=e.bottom,n=t.left<=e.left,r=t.right>=e.right;return {top:o,bottom:i,left:n,right:r}}normalizedViewPointFromFrameAnchorPositions(t,e="center"){let o=this.presenter.currentCamera.getMirrorImageEnabled(),i=new Size(this.dataCaptureView.width,this.dataCaptureView.height);if(o){let r=t[{centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"}[e]];return Point.mirrorX(r,i)}return t[e]}calculateRotationAngle(t,e){let o=e.x-t.x,i=-(e.y-t.y),n=Math.atan2(i,o);return Math.round(n*(180/Math.PI))}};c.tag="scandit-barcode-check-view";var E=c;export{E as a};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {DataCaptureLoader,Logger}from'@scandit/web-datacapture-core';function n(r){let s=URL.createObjectURL(new Blob(['"use strict";(()=>{var p={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:6799911},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:6742943},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6618716},"scandit-datacapture-sdk-barcode.wasm":{bytes:6676270}};function M(t){return typeof t=="object"&&t!=null}function F(t){if(typeof t=="string")return t;if(M(t)){if(typeof t.message=="string")return t.message}else if(typeof t?.toString=="function")return t.toString();return"unknown error"}var l;(t=>{(d=>(d.Debug="debug",d.Info="info",d.Warn="warn",d.Error="error",d.Quiet="quiet"))(t.Level||(t.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),r="debug";function a(d){r=d}t.setLevel=a;function i(d,...h){if(!(e.get(r)>e.get(d)))switch(d){case"debug":{console.debug(...h);break}case"info":{console.log(...h);break}case"warn":{console.warn(...h);break}case"error":{console.error(...h);break}}}t.log=i;function s(...d){i("warn",...d)}t.warn=s;function n(...d){i("debug",...d)}t.debug=n;function o(...d){i("info",...d)}t.info=o;function c(...d){i("error",...d)}t.error=c})(l||(l={}));var P=class re extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,re.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var L=Promise.resolve(),G=!1,$=!1,k,j={writableDataPath:""};async function ae(t){if(k==null)return;G=!0;let e=new Promise((r,a)=>{setTimeout(()=>{a(new P({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((r,a)=>{k?.(t,i=>{if(i!=null){a(i);return}r()})}),e])}finally{G=!1}}async function ie(t){return $||(G?($=!0,L=L.then(async()=>($=!1,ae(t)))):L=ae(t)),L}async function se(t){j=t,k=FS.syncfs,FS.syncfs=(e,r)=>{let a=r,i=s=>{a(s)};ie(e).then(i).catch(i)};try{FS.mkdir(j.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw k=void 0,e}return FS.mount(IDBFS,{},j.writableDataPath),ie(!0)}var q=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var K=function(t,e){this[0]=t,this[1]=e},ne=(t,e,r)=>{var a=(n,o,c,d)=>{try{var h=r[n](o),g=(o=h.value)instanceof K,m=h.done;Promise.resolve(g?o[0]:o).then(b=>g?a(n==="return"?n:"next",o[1]?{done:b.done,value:b.value}:b,c,d):c({value:b,done:m})).catch(b=>a("throw",b,c,d))}catch(b){d(b)}},i=n=>s[n]=o=>new Promise((c,d)=>a(n,o,c,d)),s={};return r=r.apply(t,e),s[q("asyncIterator")]=()=>s,i("next"),i("throw"),i("return"),s},oe=(t,e,r)=>(e=t[q("asyncIterator")])?e.call(t):(t=t[q("iterator")](),e={},r=(a,i)=>(i=t[a])&&(e[a]=s=>new Promise((n,o,c)=>(s=i.call(t,s),c=s.done,Promise.resolve(s.value).then(d=>n({value:d,done:c}),o)))),r("next"),r("return"),e);var de={};function Ie(t){return[...new Uint8Array(t)].map(e=>{let r=e.toString(16);return r.length===1?`0${r}`:r}).join("")}function Te(t){return ne(this,null,function*(){let e=t.getReader();try{for(;;){let{done:r,value:a}=yield new K(e.read());if(r)return;yield a}}finally{e.releaseLock()}})}async function We(t){let e=[],r=0,a=0;try{for(var i=oe(Te(t)),s,n,o;s=!(n=await i.next()).done;s=!1){let d=n.value;e.push(d),r+=d.length}}catch(d){o=[d]}finally{try{s&&(n=i.return)&&await n.call(i)}finally{if(o)throw o[0]}}let c=new Uint8Array(r);for(let d of e)c.set(d,a),a+=d.length;return c.buffer}var Ee=(t=>(t.VALID="VALID",t.INVALID="INVALID",t.NOT_VERIFIABLE="NOT_VERIFIABLE",t))(Ee||{});async function Ae(t,e,r){if(typeof crypto.subtle.digest!="function")return l.log(l.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${r} could not be verified`),"NOT_VERIFIABLE";try{let a=t instanceof Promise?await t:t,i=await crypto.subtle.digest("SHA-256",a),s=Ie(i);return e==null?(l.log(l.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):s===e?(l.log(l.Level.Debug,`Data Capture library WASM integrity found at ${r} has been verified correctly.`),"VALID"):(l.log(l.Level.Warn,`The Scandit Data Capture library WASM file found at ${r} seems invalid: expected file hash doesn\'t match (received: ${s}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(a){return l.log(l.Level.Warn,"Wasm response could not be verified",a),"NOT_VERIFIABLE"}}var X=new Map([["br",4.4],["gzip",2.9],["none",1]]);function Re(t){var e;let r="content-encoding";if(t==null||t.get(r)==null)return X.get("none");let a=new Set(((e=t.get(r))!=null?e:"").split(",").map(i=>i.trim()));for(let[i,s]of X)if(a.has(i))return s;return X.get("none")}function Ne(t){var e,r;if(t==null)return 0;let a=(e=Re(t))!=null?e:1,i=Number.parseInt((r=t.get("content-length"))!=null?r:"0",10);return Number.isNaN(i)?0:Math.floor(i*a*100)/100}function He(t){let{pathname:e}=new URL(t);for(let[r,a]of Object.entries(de))if(e.endsWith(r))return a.bytes;return 0}function ce(t){de=t}var _e=(t,e)=>{let r=Ne(e);return r===0?He(t):r};function ze(t,e,r,{onProgress:a,onError:i,onComplete:s}){if(!e.body)return[e];let n=_e(t,e.headers),o=0,c=0,[d,h]=r?e.body.tee():[e.body],g=d.pipeThrough(new TransformStream({async transform(m,b){try{o+=m.length,c=Number((o/n*100).toFixed(2)),n>0&&m.length>0&&c<100?a?.({percentage:c,loadedBytes:o,privateUri:t}):n===0&&m.length>0&&a?.({percentage:null,loadedBytes:o,privateUri:t}),b.enqueue(m)}catch(v){b.error(v),i?.({error:v})}},flush(m){a?.({percentage:100,loadedBytes:o,privateUri:t}),s?.({percentage:100,loadedBytes:o,privateUri:t}),m.terminate()}}));return[new Response(g,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),h]}async function Y({wasmURI:t,expectedHash:e,verifyResponseHash:r,onProgress:a,onComplete:i,onError:s,referredOrigin:n}){let o=await fetch(t,{referrerPolicy:"origin",referrer:n??""});if(!o.ok)throw new Error(`HTTP status code is not ok: ${o.status}, ${o.statusText}`);let[c,d]=ze(t,o,r,{onProgress:a,onError:s,onComplete:i});return d!=null&&Ae(We(d),e,t),c}function le({wasmURI:t,expectedHash:e,verifyResponseHash:r,progressCallback:a,successCallback:i,importObject:s,referredOrigin:n}){async function o(d){try{let h=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:r,onProgress:a,referredOrigin:n}),g=await(d??h).arrayBuffer(),m=await globalThis.WebAssembly.instantiate(g,s);i(m.instance,m.module)}catch(h){l.log(l.Level.Error,h),l.log(l.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${t}, did you configure the path for it correctly?`)}}async function c(){let d;try{d=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:r,onProgress:a,referredOrigin:n});let h=await globalThis.WebAssembly.instantiateStreaming(d,s);i(h.instance,h.module)}catch(h){l.log(l.Level.Warn,h),l.log(l.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),o(d?.bodyUsed===!0?void 0:d)}}typeof globalThis.WebAssembly.instantiateStreaming=="function"?c():o()}async function Z(t,e,r,a){return new Promise((i,s)=>{t().then(i).catch(n=>{let o=e*2;if(o>r){s(n);return}a(n),globalThis.setTimeout(()=>{Z(t,o,r,a).then(i).catch(s)},e)})})}function Q(t){var e,r;let a="";if((e=t.href)!=null&&e.startsWith("blob:null/"))a="localhost";else{let i=((r=t.pathname)==null?void 0:r.length)>1&&!t.pathname.startsWith("/");a=new URL(i?t.pathname:t.origin).hostname}return a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1)),a}async function ue(t,e){async function r(){return importScripts(t)}try{await Z(r,250,4e3,i=>{l.log(l.Level.Warn,i),l.log(l.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${t}, retrying...`)}),self.Module.mainScriptUrlOrBlob=t;let a=globalThis.SDC_WASM_JS_VERSION;return a!==e&&l.log(l.Level.Warn,`The Scandit Data Capture library JS file found at ${t} seems invalid: expected version doesn\'t match (received: ${a}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(a){return l.log(l.Level.Error,a),!1}}function Ve(t){return/^https?:\\/\\/(?:[^./]*\\.)*cdn.jsdelivr.net\\//.test(t)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\\/\\/(?:[^./]*\\.)*unpkg.com\\//.test(t)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function Je(t){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(t);return e?e[0]:null}function pe(t,e,r){let a=e,i=Ve(a);if(i.result){let n=Je(a);n!=null&&(a=`${i.cdnBaseURL}${n}@${t}/sdc-lib/`)}let s=r.replace(".wasm","");return i.result?{jsURI:`${a}${s}.js`,wasmURI:`${a}${s}.wasm`}:{jsURI:`${a}${s}.js?v=${t}`,wasmURI:`${a}${s}.wasm?v=${t}`}}var I;(t=>{function e(){return"7.1.0"}t.sdkVersion=e})(I||(I={}));var he=class{constructor(){this.promise=new Promise((t,e)=>{this.reject=e,this.resolve=t})}};var Ue=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),$e=()=>(async t=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(t)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));function je(){return typeof crossOriginIsolated>"u"?!1:crossOriginIsolated}function Ge(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer.constructor.name==="SharedArrayBuffer"}catch{return!1}}async function me(){return Ue()}async function qe(){if(!await $e())return!1;let t=null;try{t=new Worker(URL.createObjectURL(new Blob([\'postMessage("Worker" in self);\'],{type:"text/javascript"})),{name:"nestedWorkerTest"})}catch{return!1}return new Promise(e=>{if(t==null){e(!1);return}t.onmessage=r=>{t?.terminate(),e(r.data)}})}async function be(){let t=await qe();return je()&&Ge()&&t}var ge=class fe{constructor(e,r){this.hintPresenterV2=null,this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10,this.redrawInterval=1e3/30,this.redrawRequests=[],this._isDrawLoopRunning=!1,this.frameDataPool=new Map,this.lastFrameCounter=-1,this.poorMansBenchmarkLogs=!1,this.writableDataPathStandard="/scandit_sync_folder",this.resourceFilesSubfolder="resources",this.performanceMetricsReporterTimer=void 0,this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0},this.gestureListener=null,this.webPlatformHintPresenter=null,this.moduleHandler=e,this.workerFunctions=r,this._loadProgressCallback=this._loadProgressCallback.bind(this),ce(this.getWasmMetadata())}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0)}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let r=this.getNextFrameId();this.frameDataPool.set(r,new Uint8ClampedArray(e.getFrameData()));let a=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:r,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:a}}createContext(e){var r,a,i,s,n;let o=this.getModeDeserializers(),c=Q(location);(c==="localhost"||c==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(c+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,c,this.parentDomain,o,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let d=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(d==null){let u=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${u}`)}let h=d.getView();this.context=d.getContext(),d.delete();let g=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(u,f)=>{this.contextDidChangeStatus(JSON.parse(f.toJson())),u.delete()},didStartObservingContext:u=>{this.didStartObservingContext(),u.delete()},didStopObservingContext:u=>{u.delete()}}),m=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:u=>{u.delete()},onObservationStopped:u=>{u.delete()},onFrameProcessingStarted:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),f.delete(),u.delete()},onFrameProcessingFinished:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),f.delete(),u.delete()},onFrameSkipped:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),f.delete(),u.delete()}}),b=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(u,f)=>{var O;(O=this.gestureListener)==null||O.delete(),this.gestureListener=u.clone(),u.delete()}});(r=this.gestureRecognizer)==null||r.delete(),this.gestureRecognizer=new b;let v=new g;this.context.addListener(v),v.delete();let w=new m;this.context.addFrameListener(w),w.delete(),this.setView(h),(a=this.view)==null||a.setGestureRecognizer(this.gestureRecognizer);let C=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:u=>{u.delete()},showToast:u=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(u)})},hideToast:u=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(u)})},showGuidance:u=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(u)})},hideGuidance:u=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(u)})},startUpdateTimer:u=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:u}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(i=this.hintPresenterV2)==null||i.delete(),(s=this.webPlatformHintPresenter)==null||s.delete(),this.webPlatformHintPresenter=new C,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(n=this.view)==null||n.setHintPresenterV2(this.hintPresenterV2)}onTap(e){var r;(r=this.gestureListener)==null||r.onTap(JSON.stringify(e))}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0},1e3))}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}})}deleteFrameData(e){this.frameDataPool.delete(e)}dispose(){var e,r;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(r=this.gestureListener)==null||r.delete(),this.gestureListener=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[fe.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var r;if(this.context==null)return{payload:e,transferables:[e.data.buffer]};let a=e.data,i=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,s=this.Module.allocateUint8Array(a.byteLength);return this.Module.HEAPU8.set(a,s),(r=this.imageFrameSource)==null||r.outputFrame(s,e.width,e.height,i),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus)}requestFrameData(e){let r=this.frameDataPool.get(e);return r==null?{payload:{data:null}}:{payload:{data:r},transferables:[r.buffer]}}scheduleRedraw(e,r){this.addRedrawRequest(r),this.isDrawLoopRunning||this.startDrawLoop(e)}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer])}setFrameSource(e,r){var a;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(a=this.imageFrameSource)==null||a.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,r,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(e){this.isDrawLoopRunning=!0;let r=s=>this.redrawRequests.length>0&&this.redrawRequests[0]<=s,a=s=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=s;)this.redrawRequests.shift()},i=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let s=performance.now();if(r(s)){a(s),e.draw();let n=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(n))}i()},this.redrawInterval)};i()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let r=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(e.context));if(r==null){let i=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${i}`)}this.context.delete(),this.context=r.getContext();let a=r.getView();r.delete(),a!=null&&e.view!=null&&a.setViewSize(e.view.width,e.view.height,e.view.orientation),this.hintPresenterV2!=null&&a?.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&a?.setGestureRecognizer(this.gestureRecognizer),this.setView(a),l.log(l.Level.Debug,"context updated",e)}}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(e){return{payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,r;return{payload:{isDisplayingViewfinder:(r=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?r:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,r){return r?e?"4402bc0a2fb32027794f530103125f476d47037e492a221e378c7f7d1ee83c09":"a6844e6f44f77774ed3d108f4c383876c44768bdb8e45e6c869595ab75e83591":e?"90eba4439066c0dd45efad4d24e20fa683068bb92ed269d919fdbf00551426b3":""}getWasmCoreFileName(e,r){return r?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":""}getWasmMetadata(){return p}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((r,a)=>r-a)}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${Q(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e})}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"})}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])))}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let r=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),a=new r;e.setNeedsRedrawDelegate(a),e.isViewRefreshHandlerSet=!0}setupDataDecoding(){let e=this.moduleHandler.get(),r=e.DataDecoding.extend("DataDecoding",{decode(a,i){try{let s=JSON.parse(i),n=[];for(let o of s){let c=new TextDecoder(o.ianaName,{fatal:!0});n.push(c.decode(a.slice(o.startIndex,o.endIndex)))}return n.join("")}catch{return""}}});e.setDataDecoding(new r)}start(e,r,a){e&&r&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||a())}getWritableDataPath(e){return e!=null?(l.log(l.Level.Debug,`IndexedDB database name override in use to recover from blocked standard database: ${e}`),e):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e,locationPath:r,writableDataPathOverride:a,overrideThreadsSupport:i,overrideSimdSupport:s,verifyResponseHash:n,referredOrigin:o,fixedWasmMemory:c}){var d;let h=!1,g=!1;this.writableDataPath=this.getWritableDataPath(a),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,globalThis.path=r;let{resolve:m,reject:b,promise:v}=new he,w=I.sdkVersion();if(w==="")throw new P({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[C,u]=await Promise.all([me(),be()]);i!=="auto"&&(u=i==="on"),s!=="auto"&&(C=s==="on");let f=this.getWasmCoreFileName(C,u),O=pe(w,e,f),{jsURI:U,wasmURI:te}=O,Be={instantiateWasm:(S,Pe)=>(le({importObject:S,wasmURI:te,expectedHash:this.getWasmCoreExpectedHash(C,u),verifyResponseHash:n,successCallback:Pe,progressCallback:this._loadProgressCallback,referredOrigin:o}),{})},B=c===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(c),maximum:this.numOfMBToPages(c),shared:u});return B!==null&&l.log(l.Level.Debug,"Fixed wasmMemory set",B),this.moduleHandler.set({...B?{wasmMemory:B}:{},mainScriptUrlOrBlob:U,canvas:(d=this.workerFunctions.getOffscreenCanvas())!=null?d:{getContext:()=>null},...Be,dynamicLibraries:this.getWasmDynamicLibraries(te),locateFile:S=>e+S,noInitialRun:!0,preRun:[async()=>{try{await se({writableDataPath:this.writableDataPath})}catch(S){if(S.name==="BlockedIndexedDB"){b(S.toString());return}l.log(l.Level.Debug,"No IndexedDB support, some data will not be persisted:",S)}g=!0,this.start(g,h,m)}],onMainComplete:()=>{if([h,g].includes(!1)){l.log(l.Level.Warn,{runtimeLoaded:h,fileSystemSynced:g},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),b("onMainComplete has been called but runtime or file system was not ready.");return}m()},onRuntimeInitialized:()=>{h=!0,this.start(g,h,m)},print:S=>{l.log(l.Level.Info,S)}}),await ue(U,w)||b(`Couldn\'t retrieve Scandit Data Capture library at ${U}, did you configure the path for it correctly?`),v}};ge.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var D=ge;function ye(t){return typeof t=="object"&&t!=null&&t.document==null&&"addEventListener"in t&&typeof t.importScripts=="function"}function Se(t){console.warn("Reached unexpected case",t)}var ee=class{constructor(t,e){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=t,this.dataCaptureInstance=new D(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),ye(t)&&this.listenToMessages()}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",t=>{l.log(l.Level.Error,t)}),this.workerSelf.addEventListener("messageerror",t=>{l.log(l.Level.Error,t)})}postMessage(t,e){this.workerSelf.postMessage(t,e??[])}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(t){return M(t)&&"payload"in t}hasTransferables(t){return M(t)&&Array.isArray(t.transferables)}async respondWith(t,e,r){let a=null,i;try{i=r(),i instanceof Promise&&(i=await i)}catch(n){i=void 0,a=F(n)}let s={type:"workerTaskId",command:t,id:e,payload:this.hasPayload(i)?i.payload:void 0};a!=null&&(s.error=a),this.postMessage(s,this.hasTransferables(i)?i.transferables:[])}onMessage(t){switch(t.data.command){case"loadLibrary":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}))}break}case"onTap":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point)})}break}case"hintPresenterV2update":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update()})}break}case"createContext":{{let{data:e}=t;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}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource))}break}case"processFrame":{{let{data:e}=t;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}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId))}break}case"deleteFrameData":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId)})}break}case"updateContext":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e))}break}case"dispose":{this.respondWith(t.data.command,t.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.flushAnalytics()});break}case"reportCameraProperties":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e))}break}case"setLogLevel":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{l.setLevel(e.level)})}break}case"extractCentaurusLicense":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey))}break}case"documentVisibility":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state)})}break}case"isFeatureSupported":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature))}break}case"getViewfinderInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}default:return Se(t.data),!1}return!0}};var ve=(t=>(t.Body="body",t.Footnote="footnote",t))(ve||{}),T=(t=>(t.Start="start",t.Center="center",t.End="end",t))(T||{}),we=(t=>(t.Normal="normal",t.Wider="wider",t.FitText="fitText",t))(we||{}),Ce=(t=>(t.Normal="normal",t.Taller="taller",t))(Ce||{}),Me=(t=>(t.Square="square",t.Rounded="rounded",t))(Me||{}),W=(t=>(t.None="none",t.Check="check",t.ExclamationMark="exclamationMark",t))(W||{}),E=(t=>(t.Top="top",t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(E||{}),Fe=(t=>(t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(Fe||{}),ke=(t=>(t.BlackOnWhite="blackOnWhite",t.WhiteOnBlack="whiteOnBlack",t.Transparent="transparent",t))(ke||{}),x=(t=>(t.Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Notification="notification",t))(x||{}),De=(t=>(t[t.Ocr=0]="Ocr",t[t.HideLogo=1]="HideLogo",t[t.ShowTestLicenseMessage=2]="ShowTestLicenseMessage",t[t.AugmentedReality=5]="AugmentedReality",t[t.ActivityPingStatsAddon=8]="ActivityPingStatsAddon",t[t.ActivityPing=9]="ActivityPing",t[t.Registration=10]="Registration",t[t.Parser=11]="Parser",t[t.BarcodeCapture=14]="BarcodeCapture",t[t.Analytics=17]="Analytics",t[t.AnalyticsBatchMode=18]="AnalyticsBatchMode",t[t.AnalyticsScanContent=19]="AnalyticsScanContent",t[t.AnalyticsOnlineVerification=20]="AnalyticsOnlineVerification",t[t.SparkScan=21]="SparkScan",t[t.AamvaIdBarcodeVerification=22]="AamvaIdBarcodeVerification",t[t.MappingForTracking=23]="MappingForTracking",t[t.BarcodeFind=24]="BarcodeFind",t[t.MandatoryRegistration=25]="MandatoryRegistration",t[t.FeatureTracking=26]="FeatureTracking",t[t.IdCaptureViz=27]="IdCaptureViz",t[t.IdCaptureMrz=28]="IdCaptureMrz",t[t.IdCaptureBarcode=29]="IdCaptureBarcode",t[t.BarcodeSelectionAimToScan=30]="BarcodeSelectionAimToScan",t[t.BarcodeSelectionTapToScan=31]="BarcodeSelectionTapToScan",t[t.BarcodeCount=32]="BarcodeCount",t[t.BarcodePick=33]="BarcodePick",t[t.IdVerificationDataComparison=34]="IdVerificationDataComparison",t[t.SmartLabelBarcode=35]="SmartLabelBarcode",t[t.SmartLabelText=36]="SmartLabelText",t[t.VoidedIdDetection=37]="VoidedIdDetection",t[t.BarcodeArFull=38]="BarcodeArFull",t))(De||{});var A=class{constructor(e,r,a){this.trackingListenerSet=!1;this.coreEngine=e,this.Module=r,this.workerFunctions=a,this.setup()}barcodeBatchDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeBatchDidUpdateSession",payload:JSON.parse(e.toJson())})}getBatchDeserializer(){return this.barcodeBatchDeserializer}setup(){let e=this.Module.BarcodeBatchListener.extend("BarcodeTrackingListener",{didUpdateSession:(a,i,s)=>{this.barcodeBatchDidUpdateSession(i),a.delete(),i.delete(),s.delete()},onTrackedBarcodeTapped:(a,i)=>{this.onTrackedBarcodeTapped(i),a.delete(),i.delete()}}),r=this.Module.BarcodeBatchDeserializerListener.extend("BarcodeTrackingDeserializerListener",{onModeDeserializationFinished:(a,i,s)=>{this.trackingListenerSet||(i.addListener(new e,1),this.trackingListenerSet=!0),a.delete(),i.delete(),s.delete()},onModeDeserializationStarted(a,i,s){a.delete(),i.delete(),s.delete()},onSettingsDeserializationStarted(a,i,s){a.delete(),i.delete(),s.delete()},onSettingsDeserializationFinished(a,i,s){a.delete(),i.delete(),s.delete()}});this.barcodeBatchDeserializer=new this.Module.BarcodeBatchDeserializer,this.barcodeBatchDeserializer.setListener(new r)}onTrackedBarcodeTapped(e){this.workerFunctions.postMessage({type:"didTapTrackedBarcode",payload:JSON.parse(e.toJson())})}};var R=class{constructor(e,r,a){this.captureListenerSet=!1;this.coreEngine=e,this.Module=r,this.workerFunctions=a,this.setup()}barcodeCaptureDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeCaptureDidUpdateSession",payload:JSON.parse(e.toJson())})}barcodeBatchDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeBatchDidUpdateSession",payload:JSON.parse(e.toJson())})}getCaptureDeserializer(){return this.barcodeCaptureDeserializer}getTrackingDeserializer(){return this.barcodeBatchDeserializer}setup(){let e=this.Module.BarcodeCaptureListener.extend("BarcodeCaptureListener",{didScan:(n,o,c)=>{this.barcodeCaptureDidScan(o,c),n.delete(),c.delete(),o.delete()},didUpdateSession:(n,o,c)=>{this.barcodeCaptureDidUpdateSession(o),n.delete(),c.delete(),o.delete()}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),a=new e,i=new r,s=this.Module.BarcodeCaptureDeserializerListener.extend("BarcodeCaptureDeserializerListener",{onModeDeserializationFinished:(n,o,c)=>{o.addListener(a,1),o.setSuccessFeedback(i),n.delete(),o.delete(),c.delete()},onModeDeserializationStarted(n,o,c){n.delete(),o.delete(),c.delete()},onSettingsDeserializationStarted(n,o,c){n.delete(),o.delete(),c.delete()},onSettingsDeserializationFinished(n,o,c){n.delete(),o.delete(),c.delete()}});this.barcodeCaptureDeserializer=new this.Module.BarcodeCaptureDeserializer,this.barcodeCaptureDeserializer.setListener(new s)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}barcodeCaptureDidScan(e,r){let a=this.coreEngine.convertToLoadableFrameData(r);this.workerFunctions.postMessage({type:"barcodeCaptureDidScan",payload:{session:JSON.parse(e.toJson()),frameData:a}})}};var N=class{constructor(e,r,a){this.barcodeCheck=null;this.coreEngine=e,this.Module=r,this.workerFunctions=a}async forSettings(e){this.barcodeCheck?.delete(),this.barcodeCheck=new this.Module.BarcodeCheck(this.coreEngine.context,JSON.stringify(e));let r=this.Module.BarcodeCheckListener.extend("BarcodeCheckListener",{didUpdateSession:(a,i,s)=>{let n=this.coreEngine.convertToLoadableFrameData(s);this.workerFunctions.postMessage({type:"barcodeCheckDidUpdateSession",payload:{session:JSON.parse(i.toJson()),frameData:n}}),a.delete(),i.delete(),s.delete()}});this.barcodeCheck.addListener(new r,1),this.Module.addBarcodeCheckToContext(this.coreEngine.context,this.barcodeCheck)}start(){this.barcodeCheck?.start()}pause(){this.barcodeCheck?.pause()}stop(){this.barcodeCheck?.stop()}setEnabled(e){this.barcodeCheck?.setEnabled(e)}async removeMode(){this.barcodeCheck!=null&&this.Module.removeBarcodeCheckFromContext(this.coreEngine.context,this.barcodeCheck)}applySettings(e){return this.barcodeCheck?.applySettings(JSON.stringify(e))}};function Ke(t){return t.charAt(0).toUpperCase()+t.slice(1)}function xe(t){return t}var H=class{constructor(e,r,a){this.barcodeFind=null;this.basicOverlay=null;this.transparentGuidanceHintStyle={backgroundColor:"00000000",cornerRadius:4,fitToText:!1,isAnimatedToView:!1,textAlignment:T.Center,hintIcon:W.None,hintAnchor:E.AboveViewFinder,hintAnchorOffset:-12,horizontalMargin:0,iconColor:"00000000",lineHeight:-1,maxLines:1,maxWidthFraction:.8,textColor:"ffffffff",textSize:15,textWeight:600};this.customerTransformation=xe;this.coreEngine=e,this.Module=r,this.workerFunctions=a}async forSettings(e){this.barcodeFind?.delete(),this.barcodeFind=new this.Module.BarcodeFind(this.coreEngine.context,JSON.stringify(e));let r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.listUpdatedFeedback()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.barcodeFindFeedback()}}),i=this.Module.BarcodeFindTransformer.extend("BarcodeFindTransformer",{transformBarcodeData:n=>this.customerTransformation(n)}),s=this.Module.BarcodeFindListener.extend("BarcodeFindListener",{didUpdateSession:(n,o,c)=>{let d=this.coreEngine.convertToLoadableFrameData(c);this.workerFunctions.postMessage({type:"barcodeFindDidUpdateSession",payload:{session:JSON.parse(o.toJson()),frameData:d}}),n.delete(),o.delete(),c.delete()},onSearchPaused:n=>{let o=[];for(let c=0;c<n.size();c++)o.push(n.get(c));this.workerFunctions.postMessage({type:"barcodeFindSearchPaused",payload:{foundItems:o}})},onSearchStopped:n=>{let o=[];for(let c=0;c<n.size();c++)o.push(n.get(c));this.workerFunctions.postMessage({type:"barcodeFindSearchStopped",payload:{foundItems:o}})},onSearchStarted:()=>{this.workerFunctions.postMessage({type:"barcodeFindSearchStarted",payload:{}})}});this.barcodeFind.setBarcodeFindTransformer(new i),this.barcodeFind.addListener(new s,1),this.barcodeFind.setItemListUpdatedFeedback(new r),this.barcodeFind.setFeedback(new a),this.Module.addBarcodeFindToContext(this.coreEngine.context,this.barcodeFind)}barcodeFindFeedback(){this.workerFunctions.postMessage({type:"barcodeFindFeedback",payload:{}})}start(){this.barcodeFind?.start()}stop(){this.barcodeFind?.stop()}pause(){this.barcodeFind?.pause()}setEnabled(e){this.barcodeFind?.setEnabled(e)}setItemList(e){this.barcodeFind?.setItemList(JSON.stringify(e))}async removeMode(){this.barcodeFind!=null&&this.Module.removeBarcodeFindFromContext(this.coreEngine.context,this.barcodeFind)}addBasicOverlay(){this.basicOverlay?.delete(),this.basicOverlay=null,this.barcodeFind!=null&&(this.basicOverlay=new this.Module.BarcodeFindBasicOverlay(this.barcodeFind)),this.coreEngine.view!=null&&this.basicOverlay!=null&&(this.basicOverlay.setGuidanceHandler(this.createWebFindGuidanceHandler()),this.Module.addBarcodeFindBasicOverlayToView(this.coreEngine.view,this.basicOverlay))}removeBasicOverlay(){this.coreEngine.view!=null&&this.basicOverlay!=null&&this.Module.removeBarcodeFindBasicOverlayFromView(this.coreEngine.view,this.basicOverlay)}async applySettings(e){this.barcodeFind?.applySettings(JSON.stringify(e))}updateBasicOverlay(e){let r=Object.entries(e).filter(([a,i])=>a!=="type");for(let[a,i]of r){let s=`set${Ke(a)}`;this.basicOverlay!=null&&typeof this.basicOverlay[s]=="function"&&i!=null&&this.basicOverlay[s](i)}}setTransformerFunction(e){this.customerTransformation=e??xe}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}listUpdatedFeedback(){this.workerFunctions.postMessage({type:"barcodeFindListUpdatedFeedback",payload:{}})}setToast(e,r){let a=this.coreEngine.hintPresenterV2;e?a?.showToast(JSON.stringify(r)):a?.hideToast(r.tag)}setGuidance(e,r,a){let i={tag:a,text:r,hintStyle:this.transparentGuidanceHintStyle};this.workerFunctions.postMessage({type:e?"showGuidance":"hideGuidance",payload:i})}createWebFindGuidanceHandler(){let e=this.Module.BarcodeFindGuidanceHandler.extend("BarcodeFindGuidanceHandler",{setInitialGuidance:(r,a)=>{this.setGuidance(r,a,"InitialGuidance")},setMoveCloserGuidance:(r,a)=>{this.setGuidance(!1,a,"InitialGuidance"),this.setGuidance(r,a,"MoveCloserGuidance")},setAllItemsFound:(r,a)=>{let i={text:a,toastHintStyle:x.Success,tag:"AllItemsFound"};this.setToast(r,i)},setTapShutterToPause:(r,a)=>{this.setGuidance(!1,a,"InitialGuidance"),this.setGuidance(r,a,"TapShutterToPause")},setTapShutterToResume:(r,a)=>{this.setGuidance(!1,a,"InitialGuidance"),this.setGuidance(r,a,"TapShutterResume")},setItemListUpdated:(r,a)=>{let i={text:a,toastHintStyle:x.Info,tag:"ItemListUpdated"};this.setToast(r,i)}});return new e}};var y=class{constructor(e){this.subscribers=new Set;this.property={key:e,value:null}}addSubscriber(e){this.subscribers.add(e),e.onPropertyChanged?.(this.property)}removeSubscriber(e){this.subscribers.delete(e)}setProperty(e){if(this.property.value!==e.value){this.property={key:this.property.key,value:e.value};for(let r of this.subscribers)r.onPropertyChanged?.(this.property)}}};var Xe={torch_state:new y("torch_state"),scanning_mode:new y("scanning_mode"),sound_enabled:new y("sound_enabled"),haptic_enabled:new y("haptic_enabled"),hand_mode:new y("hand_mode"),session_stop_reason:new y("session_stop_reason"),camera_position:new y("camera_position")},_=class{getBehaviorSubject(e){return Xe[e]}};var z=class{constructor(e,r,a){this.captureListenerSet=!1;this.propertyPushSource=new _;this.coreEngine=e,this.Module=r,this.workerFunctions=a,this.setup()}sparkScanDidUpdateSession(e){this.workerFunctions.postMessage({type:"sparkScanDidUpdateSession",payload:JSON.parse(e.toJson())})}getSparkScanDeserializer(){return this.sparkScanDeserializer}setup(){let e=this.Module.SparkScanListener.extend("SparkScanListener",{didScan:(i,s,n)=>{this.sparkScanDidScan(s,n),i.delete(),s.delete(),n.delete()},didUpdateSession:(i,s,n)=>{this.sparkScanDidUpdateSession(s),i.delete(),s.delete(),n.delete()}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),a=this.Module.SparkScanDeserializerListener.extend("SparkScanDeserializerListener",{onModeDeserializationFinished:(i,s,n)=>{this.captureListenerSet||(s.addListener(new e,1),s.setSuccessFeedback(new r),s.setPropertyPushSource(this.propertyPushSource),this.captureListenerSet=!0),i.delete(),s.delete(),n.delete()},onModeDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onSettingsDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onSettingsDeserializationFinished(i,s,n){i.delete(),s.delete(),n.delete()},onOverlayDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onOverlayDeserializationFinished:(i,s,n)=>{this.sparkScanOverlay?.delete(),this.sparkScanOverlay=s,i.delete(),n.delete()}});this.sparkScanDeserializer=new this.Module.SparkScanDeserializer,this.sparkScanDeserializer.setListener(new a)}emitErrorFeedback(e){this.sparkScanOverlay?.onErrorFeedbackEmitted(e)}overlayReadyForDraw(){this.sparkScanOverlay?.onReadyForNewData()}analyticsManagerPropertyChanged(e){this.propertyPushSource.getBehaviorSubject(e.key).setProperty(e)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}sparkScanDidScan(e,r){let a=this.coreEngine.convertToLoadableFrameData(r);this.workerFunctions.postMessage({type:"sparkScanDidScan",payload:{session:JSON.parse(e.toJson()),frameData:a}})}};var V=class extends D{constructor(e,r){super(e,r)}getModeDeserializers(){this.barcodeCaptureMode=new R(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new A(this,this.Module,this.workerFunctions),this.sparkScanMode=new z(this,this.Module,this.workerFunctions),this.barcodeFindMode=new H(this,this.Module,this.workerFunctions),this.barcodeCheckMode=new N(this,this.Module,this.workerFunctions);let e=super.getModeDeserializers();return e.push_back(this.barcodeCaptureMode.getCaptureDeserializer()),e.push_back(this.barcodeBatchMode.getBatchDeserializer()),e.push_back(this.sparkScanMode.getSparkScanDeserializer()),e}getWasmSideModuleFileName(){return""}getWasmCoreFileName(e,r){return r?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":"scandit-datacapture-sdk-barcode.wasm"}getWasmCoreExpectedHash(e,r){return r?e?"4402bc0a2fb32027794f530103125f476d47037e492a221e378c7f7d1ee83c09":"a6844e6f44f77774ed3d108f4c383876c44768bdb8e45e6c869595ab75e83591":e?"90eba4439066c0dd45efad4d24e20fa683068bb92ed269d919fdbf00551426b3":"c02a4844db620abbceff2381cce9b76f5e209d82e40caff603b5d20a4aee9fb8"}getWasmMetadata(){return p}};function Ye(t){return(r=>/^[$A-Z_a-z][\\w$]*\\s*\\(.*\\)\\s*\\{/.test(r)&&!r.startsWith("function"))(t)?`function ${t}`:t}var Ze=["fetch","XMLHttpRequest","eval","Function","self","globalThis","Module","importScripts","this","console","window","document","import","Worker","ServiceWorker"];function Qe(t){return Ze.map(r=>new RegExp(`\\\\b${r}\\\\b`,"g")).some(r=>r.test(t))}function Oe(t){if(t==null)return null;let e=Ye(t);if(Qe(e))throw new Error("Function should be pure. Shouldn\'t introduce side effects, or rely on global scope");let r=`\'use strict\';\n return (${e});`;try{return new Function(r)()}catch{return null}}var J=class extends ee{constructor(e,r){super(e,r),this.dataCaptureInstance=new V(r,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)})}async respondWith(e,r,a){let i=null,s;try{s=a(),s instanceof Promise&&(s=await s)}catch(o){s=void 0,i=F(o)}let n={type:"workerTaskId",command:e,id:r,payload:this.hasPayload(s)?s.payload:void 0};i!=null&&(n.error=i),this.postMessage(n,this.hasTransferables(s)?s.transferables:[])}onMessage(e){switch(e.data.command){case"sparkScanEmitErrorFeedback":{let{data:r}=e;return this.respondWith(r.command,r.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(r.shouldRemoveBrush)}),!0}case"sparkScanOverlayReadyForDraw":{let{data:r}=e;return this.respondWith(r.command,r.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw()}),!0}case"sparkScanAnalyticsManagerPropertyChanged":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(r.property)}),!0}case"barcodeFindForSettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(r.settings)),!0}case"barcodeFindModeRemove":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeFindMode.removeMode()),!0}case"barcodeFindSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.start()}),!0;case"barcodeFindSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.pause()}),!0;case"barcodeFindSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.stop()}),!0;case"barcodeFindSetItemList":{let{data:r}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(r.itemList)}),!0}case"barcodeFindSetEnabled":{let{data:r}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(r.enabled)}),!0}case"barcodeFindApplySettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(r.settings)),!0}case"barcodeFindAddBasicOverlay":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay()}),!0}case"barcodeFindRemoveBasicOverlay":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay()}),!0}case"barcodeFindUpdateBasicOverlay":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(r.jsonOverlay)}),!0}case"barcodeFindSetTransformerFunction":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{let a=Oe(r.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(a)}),!0}case"barcodeCheckForSettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeCheckMode.forSettings(r.settings)),!0}case"barcodeCheckModeRemove":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeCheckMode.removeMode()),!0}case"barcodeCheckSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.start()}),!0;case"barcodeCheckSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.pause()}),!0;case"barcodeCheckSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.stop()}),!0;case"barcodeCheckSetEnabled":{let{data:r}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.setEnabled(r.enabled)}),!0}case"barcodeCheckApplySettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeCheckMode.applySettings(r.settings)}),!0}default:return super.onMessage(e)}}};var Qr=new J(globalThis,{get:()=>globalThis.Module,set:t=>{globalThis.Module=t}});function ea(t){}})();\n'],{type:"application/javascript"})),e=new Worker(s,r);return URL.revokeObjectURL(s),e}var o=class r extends DataCaptureLoader{constructor(){super(...arguments);this._name="BarcodeCapture";}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=n({name:this.name})),this._dataCaptureWorker}get name(){return this._name}static async create(e){var a;let t=new r(e);return await t.workerCommand("setLogLevel",{level:(a=e.logLevel)!=null?a:Logger.Level.Debug}),await t.load(),t}async workerCommand(e,t,a){return new Promise((d,c)=>{let i=this.workerCommandId++;this.workerTasks.set(i,{resolve:d,reject:c,command:e});let l={...t,command:e,id:i};this.dataCaptureWorker.postMessage(l,a);})}};
|
|
1
|
+
import {DataCaptureLoader,Logger}from'@scandit/web-datacapture-core';function n(r){let s=URL.createObjectURL(new Blob(['"use strict";(()=>{var p={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:6796889},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:6739645},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6616640},"scandit-datacapture-sdk-barcode.wasm":{bytes:6674466}};function M(t){return typeof t=="object"&&t!=null}function F(t){if(typeof t=="string")return t;if(M(t)){if(typeof t.message=="string")return t.message}else if(typeof t?.toString=="function")return t.toString();return"unknown error"}var l;(t=>{(d=>(d.Debug="debug",d.Info="info",d.Warn="warn",d.Error="error",d.Quiet="quiet"))(t.Level||(t.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),r="debug";function a(d){r=d}t.setLevel=a;function i(d,...h){if(!(e.get(r)>e.get(d)))switch(d){case"debug":{console.debug(...h);break}case"info":{console.log(...h);break}case"warn":{console.warn(...h);break}case"error":{console.error(...h);break}}}t.log=i;function s(...d){i("warn",...d)}t.warn=s;function n(...d){i("debug",...d)}t.debug=n;function o(...d){i("info",...d)}t.info=o;function c(...d){i("error",...d)}t.error=c})(l||(l={}));var P=class re extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,re.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var L=Promise.resolve(),G=!1,$=!1,k,j={writableDataPath:""};async function ae(t){if(k==null)return;G=!0;let e=new Promise((r,a)=>{setTimeout(()=>{a(new P({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((r,a)=>{k?.(t,i=>{if(i!=null){a(i);return}r()})}),e])}finally{G=!1}}async function ie(t){return $||(G?($=!0,L=L.then(async()=>($=!1,ae(t)))):L=ae(t)),L}async function se(t){j=t,k=FS.syncfs,FS.syncfs=(e,r)=>{let a=r,i=s=>{a(s)};ie(e).then(i).catch(i)};try{FS.mkdir(j.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw k=void 0,e}return FS.mount(IDBFS,{},j.writableDataPath),ie(!0)}var q=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var K=function(t,e){this[0]=t,this[1]=e},ne=(t,e,r)=>{var a=(n,o,c,d)=>{try{var h=r[n](o),g=(o=h.value)instanceof K,m=h.done;Promise.resolve(g?o[0]:o).then(b=>g?a(n==="return"?n:"next",o[1]?{done:b.done,value:b.value}:b,c,d):c({value:b,done:m})).catch(b=>a("throw",b,c,d))}catch(b){d(b)}},i=n=>s[n]=o=>new Promise((c,d)=>a(n,o,c,d)),s={};return r=r.apply(t,e),s[q("asyncIterator")]=()=>s,i("next"),i("throw"),i("return"),s},oe=(t,e,r)=>(e=t[q("asyncIterator")])?e.call(t):(t=t[q("iterator")](),e={},r=(a,i)=>(i=t[a])&&(e[a]=s=>new Promise((n,o,c)=>(s=i.call(t,s),c=s.done,Promise.resolve(s.value).then(d=>n({value:d,done:c}),o)))),r("next"),r("return"),e);var de={};function Ie(t){return[...new Uint8Array(t)].map(e=>{let r=e.toString(16);return r.length===1?`0${r}`:r}).join("")}function Te(t){return ne(this,null,function*(){let e=t.getReader();try{for(;;){let{done:r,value:a}=yield new K(e.read());if(r)return;yield a}}finally{e.releaseLock()}})}async function We(t){let e=[],r=0,a=0;try{for(var i=oe(Te(t)),s,n,o;s=!(n=await i.next()).done;s=!1){let d=n.value;e.push(d),r+=d.length}}catch(d){o=[d]}finally{try{s&&(n=i.return)&&await n.call(i)}finally{if(o)throw o[0]}}let c=new Uint8Array(r);for(let d of e)c.set(d,a),a+=d.length;return c.buffer}var Ee=(t=>(t.VALID="VALID",t.INVALID="INVALID",t.NOT_VERIFIABLE="NOT_VERIFIABLE",t))(Ee||{});async function Ae(t,e,r){if(typeof crypto.subtle.digest!="function")return l.log(l.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${r} could not be verified`),"NOT_VERIFIABLE";try{let a=t instanceof Promise?await t:t,i=await crypto.subtle.digest("SHA-256",a),s=Ie(i);return e==null?(l.log(l.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):s===e?(l.log(l.Level.Debug,`Data Capture library WASM integrity found at ${r} has been verified correctly.`),"VALID"):(l.log(l.Level.Warn,`The Scandit Data Capture library WASM file found at ${r} seems invalid: expected file hash doesn\'t match (received: ${s}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(a){return l.log(l.Level.Warn,"Wasm response could not be verified",a),"NOT_VERIFIABLE"}}var X=new Map([["br",4.4],["gzip",2.9],["none",1]]);function Re(t){var e;let r="content-encoding";if(t==null||t.get(r)==null)return X.get("none");let a=new Set(((e=t.get(r))!=null?e:"").split(",").map(i=>i.trim()));for(let[i,s]of X)if(a.has(i))return s;return X.get("none")}function Ne(t){var e,r;if(t==null)return 0;let a=(e=Re(t))!=null?e:1,i=Number.parseInt((r=t.get("content-length"))!=null?r:"0",10);return Number.isNaN(i)?0:Math.floor(i*a*100)/100}function He(t){let{pathname:e}=new URL(t);for(let[r,a]of Object.entries(de))if(e.endsWith(r))return a.bytes;return 0}function ce(t){de=t}var _e=(t,e)=>{let r=Ne(e);return r===0?He(t):r};function ze(t,e,r,{onProgress:a,onError:i,onComplete:s}){if(!e.body)return[e];let n=_e(t,e.headers),o=0,c=0,[d,h]=r?e.body.tee():[e.body],g=d.pipeThrough(new TransformStream({async transform(m,b){try{o+=m.length,c=Number((o/n*100).toFixed(2)),n>0&&m.length>0&&c<100?a?.({percentage:c,loadedBytes:o,privateUri:t}):n===0&&m.length>0&&a?.({percentage:null,loadedBytes:o,privateUri:t}),b.enqueue(m)}catch(v){b.error(v),i?.({error:v})}},flush(m){a?.({percentage:100,loadedBytes:o,privateUri:t}),s?.({percentage:100,loadedBytes:o,privateUri:t}),m.terminate()}}));return[new Response(g,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),h]}async function Y({wasmURI:t,expectedHash:e,verifyResponseHash:r,onProgress:a,onComplete:i,onError:s,referredOrigin:n}){let o=await fetch(t,{referrerPolicy:"origin",referrer:n??""});if(!o.ok)throw new Error(`HTTP status code is not ok: ${o.status}, ${o.statusText}`);let[c,d]=ze(t,o,r,{onProgress:a,onError:s,onComplete:i});return d!=null&&Ae(We(d),e,t),c}function le({wasmURI:t,expectedHash:e,verifyResponseHash:r,progressCallback:a,successCallback:i,importObject:s,referredOrigin:n}){async function o(d){try{let h=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:r,onProgress:a,referredOrigin:n}),g=await(d??h).arrayBuffer(),m=await globalThis.WebAssembly.instantiate(g,s);i(m.instance,m.module)}catch(h){l.log(l.Level.Error,h),l.log(l.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${t}, did you configure the path for it correctly?`)}}async function c(){let d;try{d=await Y({wasmURI:t,expectedHash:e,verifyResponseHash:r,onProgress:a,referredOrigin:n});let h=await globalThis.WebAssembly.instantiateStreaming(d,s);i(h.instance,h.module)}catch(h){l.log(l.Level.Warn,h),l.log(l.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),o(d?.bodyUsed===!0?void 0:d)}}typeof globalThis.WebAssembly.instantiateStreaming=="function"?c():o()}async function Z(t,e,r,a){return new Promise((i,s)=>{t().then(i).catch(n=>{let o=e*2;if(o>r){s(n);return}a(n),globalThis.setTimeout(()=>{Z(t,o,r,a).then(i).catch(s)},e)})})}function Q(t){var e,r;let a="";if((e=t.href)!=null&&e.startsWith("blob:null/"))a="localhost";else{let i=((r=t.pathname)==null?void 0:r.length)>1&&!t.pathname.startsWith("/");a=new URL(i?t.pathname:t.origin).hostname}return a.startsWith("[")&&a.endsWith("]")&&(a=a.slice(1,-1)),a}async function ue(t,e){async function r(){return importScripts(t)}try{await Z(r,250,4e3,i=>{l.log(l.Level.Warn,i),l.log(l.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${t}, retrying...`)}),self.Module.mainScriptUrlOrBlob=t;let a=globalThis.SDC_WASM_JS_VERSION;return a!==e&&l.log(l.Level.Warn,`The Scandit Data Capture library JS file found at ${t} seems invalid: expected version doesn\'t match (received: ${a}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(a){return l.log(l.Level.Error,a),!1}}function Ve(t){return/^https?:\\/\\/(?:[^./]*\\.)*cdn.jsdelivr.net\\//.test(t)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\\/\\/(?:[^./]*\\.)*unpkg.com\\//.test(t)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function Je(t){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(t);return e?e[0]:null}function pe(t,e,r){let a=e,i=Ve(a);if(i.result){let n=Je(a);n!=null&&(a=`${i.cdnBaseURL}${n}@${t}/sdc-lib/`)}let s=r.replace(".wasm","");return i.result?{jsURI:`${a}${s}.js`,wasmURI:`${a}${s}.wasm`}:{jsURI:`${a}${s}.js?v=${t}`,wasmURI:`${a}${s}.wasm?v=${t}`}}var I;(t=>{function e(){return"7.1.1"}t.sdkVersion=e})(I||(I={}));var he=class{constructor(){this.promise=new Promise((t,e)=>{this.reject=e,this.resolve=t})}};var Ue=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),$e=()=>(async t=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(t)}catch{return!1}})(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]));function je(){return typeof crossOriginIsolated>"u"?!1:crossOriginIsolated}function Ge(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer.constructor.name==="SharedArrayBuffer"}catch{return!1}}async function me(){return Ue()}async function qe(){if(!await $e())return!1;let t=null;try{t=new Worker(URL.createObjectURL(new Blob([\'postMessage("Worker" in self);\'],{type:"text/javascript"})),{name:"nestedWorkerTest"})}catch{return!1}return new Promise(e=>{if(t==null){e(!1);return}t.onmessage=r=>{t?.terminate(),e(r.data)}})}async function be(){let t=await qe();return je()&&Ge()&&t}var ge=class fe{constructor(e,r){this.hintPresenterV2=null,this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10,this.redrawInterval=1e3/30,this.redrawRequests=[],this._isDrawLoopRunning=!1,this.frameDataPool=new Map,this.lastFrameCounter=-1,this.poorMansBenchmarkLogs=!1,this.writableDataPathStandard="/scandit_sync_folder",this.resourceFilesSubfolder="resources",this.performanceMetricsReporterTimer=void 0,this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0},this.gestureListener=null,this.webPlatformHintPresenter=null,this.moduleHandler=e,this.workerFunctions=r,this._loadProgressCallback=this._loadProgressCallback.bind(this),ce(this.getWasmMetadata())}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0)}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let r=this.getNextFrameId();this.frameDataPool.set(r,new Uint8ClampedArray(e.getFrameData()));let a=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:r,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:a}}createContext(e){var r,a,i,s,n;let o=this.getModeDeserializers(),c=Q(location);(c==="localhost"||c==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(c+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,c,this.parentDomain,o,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let d=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(d==null){let u=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${u}`)}let h=d.getView();this.context=d.getContext(),d.delete();let g=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(u,f)=>{this.contextDidChangeStatus(JSON.parse(f.toJson())),u.delete()},didStartObservingContext:u=>{this.didStartObservingContext(),u.delete()},didStopObservingContext:u=>{u.delete()}}),m=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:u=>{u.delete()},onObservationStopped:u=>{u.delete()},onFrameProcessingStarted:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),f.delete(),u.delete()},onFrameProcessingFinished:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),f.delete(),u.delete()},onFrameSkipped:(u,f)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),f.delete(),u.delete()}}),b=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(u,f)=>{var O;(O=this.gestureListener)==null||O.delete(),this.gestureListener=u.clone(),u.delete()}});(r=this.gestureRecognizer)==null||r.delete(),this.gestureRecognizer=new b;let v=new g;this.context.addListener(v),v.delete();let w=new m;this.context.addFrameListener(w),w.delete(),this.setView(h),(a=this.view)==null||a.setGestureRecognizer(this.gestureRecognizer);let C=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:u=>{u.delete()},showToast:u=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(u)})},hideToast:u=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(u)})},showGuidance:u=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(u)})},hideGuidance:u=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(u)})},startUpdateTimer:u=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:u}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(i=this.hintPresenterV2)==null||i.delete(),(s=this.webPlatformHintPresenter)==null||s.delete(),this.webPlatformHintPresenter=new C,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(n=this.view)==null||n.setHintPresenterV2(this.hintPresenterV2)}onTap(e){var r;(r=this.gestureListener)==null||r.onTap(JSON.stringify(e))}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0},1e3))}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}})}deleteFrameData(e){this.frameDataPool.delete(e)}dispose(){var e,r;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(r=this.gestureListener)==null||r.delete(),this.gestureListener=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[fe.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var r;if(this.context==null)return{payload:e,transferables:[e.data.buffer]};let a=e.data,i=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,s=this.Module.allocateUint8Array(a.byteLength);return this.Module.HEAPU8.set(a,s),(r=this.imageFrameSource)==null||r.outputFrame(s,e.width,e.height,i),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus)}requestFrameData(e){let r=this.frameDataPool.get(e);return r==null?{payload:{data:null}}:{payload:{data:r},transferables:[r.buffer]}}scheduleRedraw(e,r){this.addRedrawRequest(r),this.isDrawLoopRunning||this.startDrawLoop(e)}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer])}setFrameSource(e,r){var a;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(a=this.imageFrameSource)==null||a.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,r,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(e){this.isDrawLoopRunning=!0;let r=s=>this.redrawRequests.length>0&&this.redrawRequests[0]<=s,a=s=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=s;)this.redrawRequests.shift()},i=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let s=performance.now();if(r(s)){a(s),e.draw();let n=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(n))}i()},this.redrawInterval)};i()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let r=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(e.context));if(r==null){let i=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${i}`)}this.context.delete(),this.context=r.getContext();let a=r.getView();r.delete(),a!=null&&e.view!=null&&a.setViewSize(e.view.width,e.view.height,e.view.orientation),this.hintPresenterV2!=null&&a?.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&a?.setGestureRecognizer(this.gestureRecognizer),this.setView(a),l.log(l.Level.Debug,"context updated",e)}}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(e){return{payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,r;return{payload:{isDisplayingViewfinder:(r=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?r:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,r){return r?e?"cfb47d912a19974393e3daedd7799f3e7b219700dbcf830031770af09ba1a116":"d4fcda637ec2b306040f4f36f487e952c07ba2d3bfad31dc0e2d8445cdd85b02":e?"a1dde610d88a06391a5ac7fb07623d3f21c3a1e9e5510d179e2d4174c24295c0":""}getWasmCoreFileName(e,r){return r?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":""}getWasmMetadata(){return p}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((r,a)=>r-a)}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${Q(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e})}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"})}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])))}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let r=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),a=new r;e.setNeedsRedrawDelegate(a),e.isViewRefreshHandlerSet=!0}setupDataDecoding(){let e=this.moduleHandler.get(),r=e.DataDecoding.extend("DataDecoding",{decode(a,i){try{let s=JSON.parse(i),n=[];for(let o of s){let c=new TextDecoder(o.ianaName,{fatal:!0});n.push(c.decode(a.slice(o.startIndex,o.endIndex)))}return n.join("")}catch{return""}}});e.setDataDecoding(new r)}start(e,r,a){e&&r&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||a())}getWritableDataPath(e){return e!=null?(l.log(l.Level.Debug,`IndexedDB database name override in use to recover from blocked standard database: ${e}`),e):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e,locationPath:r,writableDataPathOverride:a,overrideThreadsSupport:i,overrideSimdSupport:s,verifyResponseHash:n,referredOrigin:o,fixedWasmMemory:c}){var d;let h=!1,g=!1;this.writableDataPath=this.getWritableDataPath(a),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,globalThis.path=r;let{resolve:m,reject:b,promise:v}=new he,w=I.sdkVersion();if(w==="")throw new P({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[C,u]=await Promise.all([me(),be()]);i!=="auto"&&(u=i==="on"),s!=="auto"&&(C=s==="on");let f=this.getWasmCoreFileName(C,u),O=pe(w,e,f),{jsURI:U,wasmURI:te}=O,Be={instantiateWasm:(S,Pe)=>(le({importObject:S,wasmURI:te,expectedHash:this.getWasmCoreExpectedHash(C,u),verifyResponseHash:n,successCallback:Pe,progressCallback:this._loadProgressCallback,referredOrigin:o}),{})},B=c===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(c),maximum:this.numOfMBToPages(c),shared:u});return B!==null&&l.log(l.Level.Debug,"Fixed wasmMemory set",B),this.moduleHandler.set({...B?{wasmMemory:B}:{},mainScriptUrlOrBlob:U,canvas:(d=this.workerFunctions.getOffscreenCanvas())!=null?d:{getContext:()=>null},...Be,dynamicLibraries:this.getWasmDynamicLibraries(te),locateFile:S=>e+S,noInitialRun:!0,preRun:[async()=>{try{await se({writableDataPath:this.writableDataPath})}catch(S){if(S.name==="BlockedIndexedDB"){b(S.toString());return}l.log(l.Level.Debug,"No IndexedDB support, some data will not be persisted:",S)}g=!0,this.start(g,h,m)}],onMainComplete:()=>{if([h,g].includes(!1)){l.log(l.Level.Warn,{runtimeLoaded:h,fileSystemSynced:g},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),b("onMainComplete has been called but runtime or file system was not ready.");return}m()},onRuntimeInitialized:()=>{h=!0,this.start(g,h,m)},print:S=>{l.log(l.Level.Info,S)}}),await ue(U,w)||b(`Couldn\'t retrieve Scandit Data Capture library at ${U}, did you configure the path for it correctly?`),v}};ge.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var D=ge;function ye(t){return typeof t=="object"&&t!=null&&t.document==null&&"addEventListener"in t&&typeof t.importScripts=="function"}function Se(t){console.warn("Reached unexpected case",t)}var ee=class{constructor(t,e){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=t,this.dataCaptureInstance=new D(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),ye(t)&&this.listenToMessages()}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",t=>{l.log(l.Level.Error,t)}),this.workerSelf.addEventListener("messageerror",t=>{l.log(l.Level.Error,t)})}postMessage(t,e){this.workerSelf.postMessage(t,e??[])}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(t){return M(t)&&"payload"in t}hasTransferables(t){return M(t)&&Array.isArray(t.transferables)}async respondWith(t,e,r){let a=null,i;try{i=r(),i instanceof Promise&&(i=await i)}catch(n){i=void 0,a=F(n)}let s={type:"workerTaskId",command:t,id:e,payload:this.hasPayload(i)?i.payload:void 0};a!=null&&(s.error=a),this.postMessage(s,this.hasTransferables(i)?i.transferables:[])}onMessage(t){switch(t.data.command){case"loadLibrary":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}))}break}case"onTap":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point)})}break}case"hintPresenterV2update":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update()})}break}case"createContext":{{let{data:e}=t;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}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource))}break}case"processFrame":{{let{data:e}=t;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}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId))}break}case"deleteFrameData":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId)})}break}case"updateContext":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e))}break}case"dispose":{this.respondWith(t.data.command,t.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(t.data.command,t.data.id,()=>{this.dataCaptureInstance.flushAnalytics()});break}case"reportCameraProperties":{{let{data:e}=t;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e))}break}case"setLogLevel":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{l.setLevel(e.level)})}break}case"extractCentaurusLicense":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey))}break}case"documentVisibility":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state)})}break}case"isFeatureSupported":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature))}break}case"getViewfinderInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=t;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}default:return Se(t.data),!1}return!0}};var ve=(t=>(t.Body="body",t.Footnote="footnote",t))(ve||{}),T=(t=>(t.Start="start",t.Center="center",t.End="end",t))(T||{}),we=(t=>(t.Normal="normal",t.Wider="wider",t.FitText="fitText",t))(we||{}),Ce=(t=>(t.Normal="normal",t.Taller="taller",t))(Ce||{}),Me=(t=>(t.Square="square",t.Rounded="rounded",t))(Me||{}),W=(t=>(t.None="none",t.Check="check",t.ExclamationMark="exclamationMark",t))(W||{}),E=(t=>(t.Top="top",t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(E||{}),Fe=(t=>(t.AboveViewFinder="aboveViewFinder",t.BelowViewFinder="belowViewFinder",t))(Fe||{}),ke=(t=>(t.BlackOnWhite="blackOnWhite",t.WhiteOnBlack="whiteOnBlack",t.Transparent="transparent",t))(ke||{}),x=(t=>(t.Success="success",t.Error="error",t.Warning="warning",t.Info="info",t.Notification="notification",t))(x||{}),De=(t=>(t[t.Ocr=0]="Ocr",t[t.HideLogo=1]="HideLogo",t[t.ShowTestLicenseMessage=2]="ShowTestLicenseMessage",t[t.AugmentedReality=5]="AugmentedReality",t[t.ActivityPingStatsAddon=8]="ActivityPingStatsAddon",t[t.ActivityPing=9]="ActivityPing",t[t.Registration=10]="Registration",t[t.Parser=11]="Parser",t[t.BarcodeCapture=14]="BarcodeCapture",t[t.Analytics=17]="Analytics",t[t.AnalyticsBatchMode=18]="AnalyticsBatchMode",t[t.AnalyticsScanContent=19]="AnalyticsScanContent",t[t.AnalyticsOnlineVerification=20]="AnalyticsOnlineVerification",t[t.SparkScan=21]="SparkScan",t[t.AamvaIdBarcodeVerification=22]="AamvaIdBarcodeVerification",t[t.MappingForTracking=23]="MappingForTracking",t[t.BarcodeFind=24]="BarcodeFind",t[t.MandatoryRegistration=25]="MandatoryRegistration",t[t.FeatureTracking=26]="FeatureTracking",t[t.IdCaptureViz=27]="IdCaptureViz",t[t.IdCaptureMrz=28]="IdCaptureMrz",t[t.IdCaptureBarcode=29]="IdCaptureBarcode",t[t.BarcodeSelectionAimToScan=30]="BarcodeSelectionAimToScan",t[t.BarcodeSelectionTapToScan=31]="BarcodeSelectionTapToScan",t[t.BarcodeCount=32]="BarcodeCount",t[t.BarcodePick=33]="BarcodePick",t[t.IdVerificationDataComparison=34]="IdVerificationDataComparison",t[t.SmartLabelBarcode=35]="SmartLabelBarcode",t[t.SmartLabelText=36]="SmartLabelText",t[t.VoidedIdDetection=37]="VoidedIdDetection",t[t.BarcodeArFull=38]="BarcodeArFull",t))(De||{});var A=class{constructor(e,r,a){this.trackingListenerSet=!1;this.coreEngine=e,this.Module=r,this.workerFunctions=a,this.setup()}barcodeBatchDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeBatchDidUpdateSession",payload:JSON.parse(e.toJson())})}getBatchDeserializer(){return this.barcodeBatchDeserializer}setup(){let e=this.Module.BarcodeBatchListener.extend("BarcodeTrackingListener",{didUpdateSession:(a,i,s)=>{this.barcodeBatchDidUpdateSession(i),a.delete(),i.delete(),s.delete()},onTrackedBarcodeTapped:(a,i)=>{this.onTrackedBarcodeTapped(i),a.delete(),i.delete()}}),r=this.Module.BarcodeBatchDeserializerListener.extend("BarcodeTrackingDeserializerListener",{onModeDeserializationFinished:(a,i,s)=>{this.trackingListenerSet||(i.addListener(new e,1),this.trackingListenerSet=!0),a.delete(),i.delete(),s.delete()},onModeDeserializationStarted(a,i,s){a.delete(),i.delete(),s.delete()},onSettingsDeserializationStarted(a,i,s){a.delete(),i.delete(),s.delete()},onSettingsDeserializationFinished(a,i,s){a.delete(),i.delete(),s.delete()}});this.barcodeBatchDeserializer=new this.Module.BarcodeBatchDeserializer,this.barcodeBatchDeserializer.setListener(new r)}onTrackedBarcodeTapped(e){this.workerFunctions.postMessage({type:"didTapTrackedBarcode",payload:JSON.parse(e.toJson())})}};var R=class{constructor(e,r,a){this.captureListenerSet=!1;this.coreEngine=e,this.Module=r,this.workerFunctions=a,this.setup()}barcodeCaptureDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeCaptureDidUpdateSession",payload:JSON.parse(e.toJson())})}barcodeBatchDidUpdateSession(e){this.workerFunctions.postMessage({type:"barcodeBatchDidUpdateSession",payload:JSON.parse(e.toJson())})}getCaptureDeserializer(){return this.barcodeCaptureDeserializer}getTrackingDeserializer(){return this.barcodeBatchDeserializer}setup(){let e=this.Module.BarcodeCaptureListener.extend("BarcodeCaptureListener",{didScan:(n,o,c)=>{this.barcodeCaptureDidScan(o,c),n.delete(),c.delete(),o.delete()},didUpdateSession:(n,o,c)=>{this.barcodeCaptureDidUpdateSession(o),n.delete(),c.delete(),o.delete()}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),a=new e,i=new r,s=this.Module.BarcodeCaptureDeserializerListener.extend("BarcodeCaptureDeserializerListener",{onModeDeserializationFinished:(n,o,c)=>{o.addListener(a,1),o.setSuccessFeedback(i),n.delete(),o.delete(),c.delete()},onModeDeserializationStarted(n,o,c){n.delete(),o.delete(),c.delete()},onSettingsDeserializationStarted(n,o,c){n.delete(),o.delete(),c.delete()},onSettingsDeserializationFinished(n,o,c){n.delete(),o.delete(),c.delete()}});this.barcodeCaptureDeserializer=new this.Module.BarcodeCaptureDeserializer,this.barcodeCaptureDeserializer.setListener(new s)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}barcodeCaptureDidScan(e,r){let a=this.coreEngine.convertToLoadableFrameData(r);this.workerFunctions.postMessage({type:"barcodeCaptureDidScan",payload:{session:JSON.parse(e.toJson()),frameData:a}})}};var N=class{constructor(e,r,a){this.barcodeCheck=null;this.coreEngine=e,this.Module=r,this.workerFunctions=a}async forSettings(e){this.barcodeCheck?.delete(),this.barcodeCheck=new this.Module.BarcodeCheck(this.coreEngine.context,JSON.stringify(e));let r=this.Module.BarcodeCheckListener.extend("BarcodeCheckListener",{didUpdateSession:(a,i,s)=>{let n=this.coreEngine.convertToLoadableFrameData(s);this.workerFunctions.postMessage({type:"barcodeCheckDidUpdateSession",payload:{session:JSON.parse(i.toJson()),frameData:n}}),a.delete(),i.delete(),s.delete()}});this.barcodeCheck.addListener(new r,1),this.Module.addBarcodeCheckToContext(this.coreEngine.context,this.barcodeCheck)}start(){this.barcodeCheck?.start()}pause(){this.barcodeCheck?.pause()}stop(){this.barcodeCheck?.stop()}setEnabled(e){this.barcodeCheck?.setEnabled(e)}async removeMode(){this.barcodeCheck!=null&&this.Module.removeBarcodeCheckFromContext(this.coreEngine.context,this.barcodeCheck)}applySettings(e){return this.barcodeCheck?.applySettings(JSON.stringify(e))}};function Ke(t){return t.charAt(0).toUpperCase()+t.slice(1)}function xe(t){return t}var H=class{constructor(e,r,a){this.barcodeFind=null;this.basicOverlay=null;this.transparentGuidanceHintStyle={backgroundColor:"00000000",cornerRadius:4,fitToText:!1,isAnimatedToView:!1,textAlignment:T.Center,hintIcon:W.None,hintAnchor:E.AboveViewFinder,hintAnchorOffset:-12,horizontalMargin:0,iconColor:"00000000",lineHeight:-1,maxLines:1,maxWidthFraction:.8,textColor:"ffffffff",textSize:15,textWeight:600};this.customerTransformation=xe;this.coreEngine=e,this.Module=r,this.workerFunctions=a}async forSettings(e){this.barcodeFind?.delete(),this.barcodeFind=new this.Module.BarcodeFind(this.coreEngine.context,JSON.stringify(e));let r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.listUpdatedFeedback()}}),a=this.Module.Feedback.extend("Feedback",{emit:()=>{this.barcodeFindFeedback()}}),i=this.Module.BarcodeFindTransformer.extend("BarcodeFindTransformer",{transformBarcodeData:n=>this.customerTransformation(n)}),s=this.Module.BarcodeFindListener.extend("BarcodeFindListener",{didUpdateSession:(n,o,c)=>{let d=this.coreEngine.convertToLoadableFrameData(c);this.workerFunctions.postMessage({type:"barcodeFindDidUpdateSession",payload:{session:JSON.parse(o.toJson()),frameData:d}}),n.delete(),o.delete(),c.delete()},onSearchPaused:n=>{let o=[];for(let c=0;c<n.size();c++)o.push(n.get(c));this.workerFunctions.postMessage({type:"barcodeFindSearchPaused",payload:{foundItems:o}})},onSearchStopped:n=>{let o=[];for(let c=0;c<n.size();c++)o.push(n.get(c));this.workerFunctions.postMessage({type:"barcodeFindSearchStopped",payload:{foundItems:o}})},onSearchStarted:()=>{this.workerFunctions.postMessage({type:"barcodeFindSearchStarted",payload:{}})}});this.barcodeFind.setBarcodeFindTransformer(new i),this.barcodeFind.addListener(new s,1),this.barcodeFind.setItemListUpdatedFeedback(new r),this.barcodeFind.setFeedback(new a),this.Module.addBarcodeFindToContext(this.coreEngine.context,this.barcodeFind)}barcodeFindFeedback(){this.workerFunctions.postMessage({type:"barcodeFindFeedback",payload:{}})}start(){this.barcodeFind?.start()}stop(){this.barcodeFind?.stop()}pause(){this.barcodeFind?.pause()}setEnabled(e){this.barcodeFind?.setEnabled(e)}setItemList(e){this.barcodeFind?.setItemList(JSON.stringify(e))}async removeMode(){this.barcodeFind!=null&&this.Module.removeBarcodeFindFromContext(this.coreEngine.context,this.barcodeFind)}addBasicOverlay(){this.basicOverlay?.delete(),this.basicOverlay=null,this.barcodeFind!=null&&(this.basicOverlay=new this.Module.BarcodeFindBasicOverlay(this.barcodeFind)),this.coreEngine.view!=null&&this.basicOverlay!=null&&(this.basicOverlay.setGuidanceHandler(this.createWebFindGuidanceHandler()),this.Module.addBarcodeFindBasicOverlayToView(this.coreEngine.view,this.basicOverlay))}removeBasicOverlay(){this.coreEngine.view!=null&&this.basicOverlay!=null&&this.Module.removeBarcodeFindBasicOverlayFromView(this.coreEngine.view,this.basicOverlay)}async applySettings(e){this.barcodeFind?.applySettings(JSON.stringify(e))}updateBasicOverlay(e){let r=Object.entries(e).filter(([a,i])=>a!=="type");for(let[a,i]of r){let s=`set${Ke(a)}`;this.basicOverlay!=null&&typeof this.basicOverlay[s]=="function"&&i!=null&&this.basicOverlay[s](i)}}setTransformerFunction(e){this.customerTransformation=e??xe}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}listUpdatedFeedback(){this.workerFunctions.postMessage({type:"barcodeFindListUpdatedFeedback",payload:{}})}setToast(e,r){let a=this.coreEngine.hintPresenterV2;e?a?.showToast(JSON.stringify(r)):a?.hideToast(r.tag)}setGuidance(e,r,a){let i={tag:a,text:r,hintStyle:this.transparentGuidanceHintStyle};this.workerFunctions.postMessage({type:e?"showGuidance":"hideGuidance",payload:i})}createWebFindGuidanceHandler(){let e=this.Module.BarcodeFindGuidanceHandler.extend("BarcodeFindGuidanceHandler",{setInitialGuidance:(r,a)=>{this.setGuidance(r,a,"InitialGuidance")},setMoveCloserGuidance:(r,a)=>{this.setGuidance(!1,a,"InitialGuidance"),this.setGuidance(r,a,"MoveCloserGuidance")},setAllItemsFound:(r,a)=>{let i={text:a,toastHintStyle:x.Success,tag:"AllItemsFound"};this.setToast(r,i)},setTapShutterToPause:(r,a)=>{this.setGuidance(!1,a,"InitialGuidance"),this.setGuidance(r,a,"TapShutterToPause")},setTapShutterToResume:(r,a)=>{this.setGuidance(!1,a,"InitialGuidance"),this.setGuidance(r,a,"TapShutterResume")},setItemListUpdated:(r,a)=>{let i={text:a,toastHintStyle:x.Info,tag:"ItemListUpdated"};this.setToast(r,i)}});return new e}};var y=class{constructor(e){this.subscribers=new Set;this.property={key:e,value:null}}addSubscriber(e){this.subscribers.add(e),e.onPropertyChanged?.(this.property)}removeSubscriber(e){this.subscribers.delete(e)}setProperty(e){if(this.property.value!==e.value){this.property={key:this.property.key,value:e.value};for(let r of this.subscribers)r.onPropertyChanged?.(this.property)}}};var Xe={torch_state:new y("torch_state"),scanning_mode:new y("scanning_mode"),sound_enabled:new y("sound_enabled"),haptic_enabled:new y("haptic_enabled"),hand_mode:new y("hand_mode"),session_stop_reason:new y("session_stop_reason"),camera_position:new y("camera_position")},_=class{getBehaviorSubject(e){return Xe[e]}};var z=class{constructor(e,r,a){this.captureListenerSet=!1;this.propertyPushSource=new _;this.coreEngine=e,this.Module=r,this.workerFunctions=a,this.setup()}sparkScanDidUpdateSession(e){this.workerFunctions.postMessage({type:"sparkScanDidUpdateSession",payload:JSON.parse(e.toJson())})}getSparkScanDeserializer(){return this.sparkScanDeserializer}setup(){let e=this.Module.SparkScanListener.extend("SparkScanListener",{didScan:(i,s,n)=>{this.sparkScanDidScan(s,n),i.delete(),s.delete(),n.delete()},didUpdateSession:(i,s,n)=>{this.sparkScanDidUpdateSession(s),i.delete(),s.delete(),n.delete()}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.successFeedback()}}),a=this.Module.SparkScanDeserializerListener.extend("SparkScanDeserializerListener",{onModeDeserializationFinished:(i,s,n)=>{this.captureListenerSet||(s.addListener(new e,1),s.setSuccessFeedback(new r),s.setPropertyPushSource(this.propertyPushSource),this.captureListenerSet=!0),i.delete(),s.delete(),n.delete()},onModeDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onSettingsDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onSettingsDeserializationFinished(i,s,n){i.delete(),s.delete(),n.delete()},onOverlayDeserializationStarted(i,s,n){i.delete(),s.delete(),n.delete()},onOverlayDeserializationFinished:(i,s,n)=>{this.sparkScanOverlay?.delete(),this.sparkScanOverlay=s,i.delete(),n.delete()}});this.sparkScanDeserializer=new this.Module.SparkScanDeserializer,this.sparkScanDeserializer.setListener(new a)}emitErrorFeedback(e){this.sparkScanOverlay?.onErrorFeedbackEmitted(e)}overlayReadyForDraw(){this.sparkScanOverlay?.onReadyForNewData()}analyticsManagerPropertyChanged(e){this.propertyPushSource.getBehaviorSubject(e.key).setProperty(e)}successFeedback(){this.workerFunctions.postMessage({type:"successFeedback"})}sparkScanDidScan(e,r){let a=this.coreEngine.convertToLoadableFrameData(r);this.workerFunctions.postMessage({type:"sparkScanDidScan",payload:{session:JSON.parse(e.toJson()),frameData:a}})}};var V=class extends D{constructor(e,r){super(e,r)}getModeDeserializers(){this.barcodeCaptureMode=new R(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new A(this,this.Module,this.workerFunctions),this.sparkScanMode=new z(this,this.Module,this.workerFunctions),this.barcodeFindMode=new H(this,this.Module,this.workerFunctions),this.barcodeCheckMode=new N(this,this.Module,this.workerFunctions);let e=super.getModeDeserializers();return e.push_back(this.barcodeCaptureMode.getCaptureDeserializer()),e.push_back(this.barcodeBatchMode.getBatchDeserializer()),e.push_back(this.sparkScanMode.getSparkScanDeserializer()),e}getWasmSideModuleFileName(){return""}getWasmCoreFileName(e,r){return r?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":"scandit-datacapture-sdk-barcode.wasm"}getWasmCoreExpectedHash(e,r){return r?e?"cfb47d912a19974393e3daedd7799f3e7b219700dbcf830031770af09ba1a116":"d4fcda637ec2b306040f4f36f487e952c07ba2d3bfad31dc0e2d8445cdd85b02":e?"a1dde610d88a06391a5ac7fb07623d3f21c3a1e9e5510d179e2d4174c24295c0":"db18616364305f303ebab1150a7d02be193fa6529d7d72201daaedbbffdcd95b"}getWasmMetadata(){return p}};function Ye(t){return(r=>/^[$A-Z_a-z][\\w$]*\\s*\\(.*\\)\\s*\\{/.test(r)&&!r.startsWith("function"))(t)?`function ${t}`:t}var Ze=["fetch","XMLHttpRequest","eval","Function","self","globalThis","Module","importScripts","this","console","window","document","import","Worker","ServiceWorker"];function Qe(t){return Ze.map(r=>new RegExp(`\\\\b${r}\\\\b`,"g")).some(r=>r.test(t))}function Oe(t){if(t==null)return null;let e=Ye(t);if(Qe(e))throw new Error("Function should be pure. Shouldn\'t introduce side effects, or rely on global scope");let r=`\'use strict\';\n return (${e});`;try{return new Function(r)()}catch{return null}}var J=class extends ee{constructor(e,r){super(e,r),this.dataCaptureInstance=new V(r,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)})}async respondWith(e,r,a){let i=null,s;try{s=a(),s instanceof Promise&&(s=await s)}catch(o){s=void 0,i=F(o)}let n={type:"workerTaskId",command:e,id:r,payload:this.hasPayload(s)?s.payload:void 0};i!=null&&(n.error=i),this.postMessage(n,this.hasTransferables(s)?s.transferables:[])}onMessage(e){switch(e.data.command){case"sparkScanEmitErrorFeedback":{let{data:r}=e;return this.respondWith(r.command,r.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(r.shouldRemoveBrush)}),!0}case"sparkScanOverlayReadyForDraw":{let{data:r}=e;return this.respondWith(r.command,r.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw()}),!0}case"sparkScanAnalyticsManagerPropertyChanged":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(r.property)}),!0}case"barcodeFindForSettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(r.settings)),!0}case"barcodeFindModeRemove":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeFindMode.removeMode()),!0}case"barcodeFindSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.start()}),!0;case"barcodeFindSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.pause()}),!0;case"barcodeFindSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.stop()}),!0;case"barcodeFindSetItemList":{let{data:r}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(r.itemList)}),!0}case"barcodeFindSetEnabled":{let{data:r}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(r.enabled)}),!0}case"barcodeFindApplySettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(r.settings)),!0}case"barcodeFindAddBasicOverlay":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay()}),!0}case"barcodeFindRemoveBasicOverlay":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay()}),!0}case"barcodeFindUpdateBasicOverlay":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(r.jsonOverlay)}),!0}case"barcodeFindSetTransformerFunction":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{let a=Oe(r.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(a)}),!0}case"barcodeCheckForSettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeCheckMode.forSettings(r.settings)),!0}case"barcodeCheckModeRemove":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>this.dataCaptureInstance.barcodeCheckMode.removeMode()),!0}case"barcodeCheckSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.start()}),!0;case"barcodeCheckSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.pause()}),!0;case"barcodeCheckSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.stop()}),!0;case"barcodeCheckSetEnabled":{let{data:r}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.setEnabled(r.enabled)}),!0}case"barcodeCheckApplySettings":{let{data:r}=e;return this.respondWith(r.command,r.id,async()=>{this.dataCaptureInstance.barcodeCheckMode.applySettings(r.settings)}),!0}default:return super.onMessage(e)}}};var Qr=new J(globalThis,{get:()=>globalThis.Module,set:t=>{globalThis.Module=t}});function ea(t){}})();\n'],{type:"application/javascript"})),e=new Worker(s,r);return URL.revokeObjectURL(s),e}var o=class r extends DataCaptureLoader{constructor(){super(...arguments);this._name="BarcodeCapture";}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=n({name:this.name})),this._dataCaptureWorker}get name(){return this._name}static async create(e){var a;let t=new r(e);return await t.workerCommand("setLogLevel",{level:(a=e.logLevel)!=null?a:Logger.Level.Debug}),await t.load(),t}async workerCommand(e,t,a){return new Promise((d,c)=>{let i=this.workerCommandId++;this.workerTasks.set(i,{resolve:d,reject:c,command:e});let l={...t,command:e,id:i};this.dataCaptureWorker.postMessage(l,a);})}};
|
|
2
2
|
export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-Q6IBYUJQ.js';import {a as a$1}from'./chunk-KQ3LRAYO.js';import {unknownErrorToString}from'@scandit/web-datacapture-core/build/js/private/utils/unknownErrorToString.js';import {WorkerMain}from'@scandit/web-datacapture-core/build/js/worker/index.js';var i=class extends WorkerMain{constructor(e,a$1){super(e,a$1),this.dataCaptureInstance=new a(a$1,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)});}async respondWith(e,a,r){let d=null,t;try{t=r(),t instanceof Promise&&(t=await t);}catch(c){t=void 0,d=unknownErrorToString(c);}let s={type:"workerTaskId",command:e,id:a,payload:this.hasPayload(t)?t.payload:void 0};d!=null&&(s.error=d),this.postMessage(s,this.hasTransferables(t)?t.transferables:[]);}onMessage(e){switch(e.data.command){case"sparkScanEmitErrorFeedback":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.emitErrorFeedback(a.shouldRemoveBrush);}),!0}case"sparkScanOverlayReadyForDraw":{let{data:a}=e;return this.respondWith(a.command,a.id,()=>{this.dataCaptureInstance.sparkScanMode.overlayReadyForDraw();}),!0}case"sparkScanAnalyticsManagerPropertyChanged":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.sparkScanMode.analyticsManagerPropertyChanged(a.property);}),!0}case"barcodeFindForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.forSettings(a.settings)),!0}case"barcodeFindModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.removeMode()),!0}case"barcodeFindSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.start();}),!0;case"barcodeFindSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.pause();}),!0;case"barcodeFindSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.stop();}),!0;case"barcodeFindSetItemList":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setItemList(a.itemList);}),!0}case"barcodeFindSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeFindMode.setEnabled(a.enabled);}),!0}case"barcodeFindApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeFindMode.applySettings(a.settings)),!0}case"barcodeFindAddBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.addBasicOverlay();}),!0}case"barcodeFindRemoveBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.removeBasicOverlay();}),!0}case"barcodeFindUpdateBasicOverlay":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeFindMode.updateBasicOverlay(a.jsonOverlay);}),!0}case"barcodeFindSetTransformerFunction":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{let r=a$1(a.functionAsString);this.dataCaptureInstance.barcodeFindMode.setTransformerFunction(r);}),!0}case"barcodeCheckForSettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeCheckMode.forSettings(a.settings)),!0}case"barcodeCheckModeRemove":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>this.dataCaptureInstance.barcodeCheckMode.removeMode()),!0}case"barcodeCheckSearchStart":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.start();}),!0;case"barcodeCheckSearchPause":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.pause();}),!0;case"barcodeCheckSearchStop":return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.stop();}),!0;case"barcodeCheckSetEnabled":{let{data:a}=e;return this.respondWith(e.data.command,e.data.id,()=>{this.dataCaptureInstance.barcodeCheckMode.setEnabled(a.enabled);}),!0}case"barcodeCheckApplySettings":{let{data:a}=e;return this.respondWith(a.command,a.id,async()=>{this.dataCaptureInstance.barcodeCheckMode.applySettings(a.settings);}),!0}default:return super.onMessage(e)}}};export{i as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$3}from'./chunk-K4MHNZXA.js';import {a as a$4}from'./chunk-KALGMDTS.js';import {b as b$
|
|
1
|
+
import {a as a$3}from'./chunk-K4MHNZXA.js';import {a as a$4}from'./chunk-KALGMDTS.js';import {a as a$5,b as b$3}from'./chunk-OPL5NVVM.js';import {b,a as a$6}from'./chunk-FJ4SOETD.js';import {b as b$1}from'./chunk-5DP5VNWQ.js';import {g as g$2}from'./chunk-3A6GSH7S.js';import {g as g$1}from'./chunk-DVHTYKDX.js';import {a as a$2}from'./chunk-DTO5ICFV.js';import {j,i,f as f$1,a,g,m}from'./chunk-Y6DC25EF.js';import {b as b$2,a as a$1,e,c}from'./chunk-YBD5JYCX.js';import {Point}from'@scandit/web-datacapture-core';import {ScanditHTMLElement,defineCustomElements,html,Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var M=(n=>(n.ResizeButton="resizeButton",n.ZoomButton="zoomButton",n.TorchButton="torchButton",n.CloseButton="closeButton",n))(M||{}),H=1200,f=class extends ScanditHTMLElement{constructor(){super(...arguments);this.resizeButtonTapListener=this.onResizeButtonTap.bind(this);this.zoomButtonTapListener=this.onZoomButtonTap.bind(this);this.torchButtonTapListener=this.onTorchButtonTap.bind(this);this.closeButtonTapListener=this.onCloseButtonTap.bind(this);this.pointerDownListener=this.onPointerDown.bind(this);this.longPressStartListener=this.onLongPressStart.bind(this);this.toolbarVisibilityChangeListener=this.onToolbarVisibilityChange.bind(this);this.longPressEndListener=this.onLongPressEnd.bind(this);this.dragEndListener=this.onDragEnd.bind(this);this.fadeOutAnimation=new Animation(new KeyframeEffect(this,[{opacity:1},{opacity:0}],{duration:500,fill:"both"}));this.replayFadeOutTimeout=null;this.dragController=new b(this);this.longPressController=new b$1(this);}get visible(){return this.hasAttribute("visible")}set visible(t){this.toggleAttribute("visible",t);}get size(){return this.expanded?"expanded":"regular"}set size(t){this.toggleAttribute("expanded",t==="expanded");let i=this.getNextTranslate();this.dragController.translateTo(i,!1).then(async()=>this.dragController.repositionIfOutOfBounds());}get expanded(){return this.hasAttribute("expanded")}get[a](){var t;return Number((t=this.getAttribute(a))!=null?t:"1")}set[a](t){this.setAttribute(a,String(t));}get darkened(){return this.hasAttribute("darkened")}set darkened(t){this.toggleAttribute("darkened",t);}get orientation(){var t;return (t=this.getAttribute("orientation"))!=null?t:"portrait-primary"}set orientation(t){this.setAttribute("orientation",t);}get[g](){return this.hasAttribute(g)}set[g](t){this.toggleAttribute(g,t);}get[j](){return this.hasAttribute(j)}set[j](t){this.toggleAttribute(j,t);}get[i](){return this.hasAttribute(i)}set[i](t){this.toggleAttribute(i,t);}get[f$1](){return this.hasAttribute(f$1)}set[f$1](t){this.toggleAttribute(f$1,t);}get[m](){return this.hasAttribute(m)}set[m](t){this.toggleAttribute(m,t);}get cover(){return this.hasAttribute("cover")}set cover(t){this.toggleAttribute("cover",t);}get pressed(){return this.hasAttribute("pressed")}set pressed(t){this.toggleAttribute("pressed",t);}static create(){return defineCustomElements({[b$2]:this,[a$1]:a$2,[e]:a$3,[c]:a$4}),document.createElement(b$2)}showToast(t,i,n){this.toast.show(t,i,n);}hideToast(){this.toast.hide();}zoomIn(){this.zoomButton&&(this[a]=2,this.zoomButton.textContent="2x",this.showToast("warning","2x zoom",1e3));}zoomOut(){this.zoomButton&&(this[a]=1,this.zoomButton.textContent="1x",this.showToast("info","1x zoom",1e3));}async fadeOut(){try{this.fadeOutAnimation.play(),await this.fadeOutAnimation.finished,this.visible=!1;}catch(t){}}cancelFadeOut(){var t;(t=this.replayFadeOutTimeout)==null||t.stop(),this.fadeOutAnimation.cancel();}async rewindAnimation(){var t,i;(((t=this.replayFadeOutTimeout)==null?void 0:t.running)===!0||this.fadeOutAnimation.playState!=="idle")&&(this.cancelFadeOut(),(i=this.replayFadeOutTimeout)==null||i.start());}translateTo(t){this.dragController.translateTo(t,!1);}render(){var t,i$1,n,u,c$1,v,B;this.innerHTML=html`
|
|
2
2
|
<spark-scan-view-toast></spark-scan-view-toast>
|
|
3
3
|
<div id="host"></div>
|
|
4
4
|
<div id="controls">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-ENVM4L4Z.js';import {a}from'./chunk-LKZBVQXD.js';import {Localization}from'@scandit/web-datacapture-core';import {normalizeLibraryLocation}from'@scandit/web-datacapture-core/build/js/private/Helper.js';function b(r){return Localization.getInstance().updateIfMissing({...a}),(r==null?void 0:r.libraryLocation)!=null&&(r.libraryLocation=normalizeLibraryLocation(r.libraryLocation)),{moduleName:"BarcodeCapture",load:async n=>{var e,o;let a=n;return await a$1.create({...a,libraryLocation:(e=r==null?void 0:r.libraryLocation)!=null?e:a.libraryLocation,highEndBlurryRecognition:(o=r==null?void 0:r.highEndBlurryRecognition)!=null?o:!1})}}}export{b as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c={"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:6796889},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:6739645},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6616640},"scandit-datacapture-sdk-barcode.wasm":{bytes:6674466}};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$4}from'./chunk-FYHMFCYX.js';import {a as a$3}from'./chunk-NSBGJLIO.js';import {a as a$2}from'./chunk-LTNZJEG4.js';import {a as a$1}from'./chunk-2ZSOWJ2F.js';import {a}from'./chunk-WVIC3JWX.js';import {a as a$5}from'./chunk-
|
|
1
|
+
import {a as a$4}from'./chunk-FYHMFCYX.js';import {a as a$3}from'./chunk-NSBGJLIO.js';import {a as a$2}from'./chunk-LTNZJEG4.js';import {a as a$1}from'./chunk-2ZSOWJ2F.js';import {a}from'./chunk-WVIC3JWX.js';import {a as a$5}from'./chunk-PL47B3H5.js';import {DataCaptureEngine}from'@scandit/web-datacapture-core/build/js/worker/index.js';var c=class extends DataCaptureEngine{constructor(e,r){super(e,r);}getModeDeserializers(){this.barcodeCaptureMode=new a(this,this.Module,this.workerFunctions),this.barcodeBatchMode=new a$1(this,this.Module,this.workerFunctions),this.sparkScanMode=new a$2(this,this.Module,this.workerFunctions),this.barcodeFindMode=new a$3(this,this.Module,this.workerFunctions),this.barcodeCheckMode=new a$4(this,this.Module,this.workerFunctions);let e=super.getModeDeserializers();return e.push_back(this.barcodeCaptureMode.getCaptureDeserializer()),e.push_back(this.barcodeBatchMode.getBatchDeserializer()),e.push_back(this.sparkScanMode.getSparkScanDeserializer()),e}getWasmSideModuleFileName(){return ""}getWasmCoreFileName(e,r){return r?e?"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":"scandit-datacapture-sdk-barcode-pthreads.wasm":e?"scandit-datacapture-sdk-barcode-simd.wasm":"scandit-datacapture-sdk-barcode.wasm"}getWasmCoreExpectedHash(e,r){return r?e?"cfb47d912a19974393e3daedd7799f3e7b219700dbcf830031770af09ba1a116":"d4fcda637ec2b306040f4f36f487e952c07ba2d3bfad31dc0e2d8445cdd85b02":e?"a1dde610d88a06391a5ac7fb07623d3f21c3a1e9e5510d179e2d4174c24295c0":"db18616364305f303ebab1150a7d02be193fa6529d7d72201daaedbbffdcd95b"}getWasmMetadata(){return a$5}};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {a as a$2}from'./chunk-FRG4ACMI.js';import {b}from'./chunk-LXROKZUG.js';import {a as a$1}from'./chunk-B6TRFCTV.js';import {a}from'./chunk-BGXJMGXV.js';import {CameraSettings,convertToPublicFrameData}from'@scandit/web-datacapture-core';var c=class n{constructor(){this.skipSerialization=!0;this.type="barcodeCheck";this._isEnabled=!0;this._context=null;this.listeners=new Set;this.privateListeners=new Set;this.workerMessageListener=this.onWorkerMessage.bind(this);}get context(){return this._context}static createRecommendedCameraSettings(){let e=new CameraSettings(b);return e.setProperty("grayScaleFrameReader",!0),e}set context(e){this._context=e;}get allListeners(){return [...this.privateListeners,...this.listeners]}static async forContext(e,a$2){a();let t=new n;return t.feedback=await a$1.createDefaultBarcodeCheckFeedback(),t.settings=a$2,await(e==null?void 0:e.addMode(t)),t}isEnabled(){return this._isEnabled}addListener(e){this.listeners.add(e);}removeListener(e){this.listeners.delete(e);}set feedback(e){this._feedback=e;}get feedback(){return this._feedback}async setEnabled(e){this._isEnabled=e,await this.workerCommand("barcodeCheckSetEnabled",{enabled:e});}async applySettings(e){this.settings=e,await this.workerCommand("barcodeCheckApplySettings",{settings:e.toJSONObject()});}toJSONObject(){return {type:this.type,enabled:this._isEnabled,settings:this.settings.toJSONObject()}}async attachedToContext(e){this._context=e,this._context.subscribeToWorkerMessages(this.workerMessageListener),await this.workerCommand("barcodeCheckForSettings",{settings:this.settings.toJSONObject()});}async detachedFromContext(){var e;await this.workerCommand("barcodeCheckModeRemove",{}),(e=this._context)==null||e.unsubscribeToWorkerMessages(this.workerMessageListener),this._context=null;}async start(){return this.workerCommand("barcodeCheckSearchStart",{})}async stop(){return this.workerCommand("barcodeCheckSearchStop",{})}async pause(){return this.workerCommand("barcodeCheckSearchPause",{})}async workerCommand(e,a){this.context!=null&&await this.context.workerCommand(e,a);}addPrivateListener(e){this.privateListeners.add(e);}removePrivateListener(e){this.privateListeners.delete(e);}async onWorkerMessage(e){var a;switch(e.type){case"barcodeCheckDidUpdateSession":{if(!this._isEnabled||!this._context)return;for(let t of this.allListeners)(a=t.didUpdateSession)==null||a.call(t,this,a$2.fromJSON(e.payload.session),convertToPublicFrameData(e.payload.frameData,this._context));break}}}};export{c as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {a as a$7}from'./chunk-QPNMXE7H.js';import {b as b$1}from'./chunk-HQL4OJUZ.js';import {a}from'./chunk-X2U6LCRU.js';import {b}from'./chunk-ZDBP2TPZ.js';import {a as a$6}from'./chunk-OXLBBRZT.js';import {a as a$8}from'./chunk-K3EIYQPY.js';import {a as a$2}from'./chunk-VI6FIL4E.js';import {a as a$4}from'./chunk-HRHBXIPB.js';import {a as a$5}from'./chunk-POONUNDO.js';import {b as b$2}from'./chunk-EZI7OJEV.js';import {a as a$1}from'./chunk-FCUTPMMU.js';import {a as a$3}from'./chunk-I53W7VSB.js';import {b as b$3}from'./chunk-3I3FVXFK.js';import {Anchor,Localization,DataCaptureView,Size,Point}from'@scandit/web-datacapture-core';import {ShutterButton}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/ShutterButton.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {html}from'@scandit/web-datacapture-core/build/js/private/utils/html.js';var d={FinishButton:a$2.tag,ShutterButton:ShutterButton.tag,ProgressBarWithLabel:a.tag,CardListContainer:b$1.tag,TorchIconButton:a$1.tag},c=class c extends ScanditHTMLElement{constructor(){super(...arguments);this.shouldShowCarousel=!0;this.shouldShowPauseButton=!0;this.shouldShowFinishButton=!0;this.shouldShowProgressBar=!0;this.shouldShowTorchControl=!1;this.torchControlPosition=Anchor.TopLeft;this.textForItemListUpdatedWhenPausedHint=null;this.textForItemListUpdatedHint=null;this.textForTapShutterToResumeSearchHint=null;this.textForTapShutterToPauseScreenHint=null;this.textForMoveCloserToBarcodesHint=null;this.textForPointAtBarcodesToSearchHint=null;this.textForAllItemsFoundSuccessfullyHint=null;this.textForCollapseCardsButton=Localization.getInstance().get("barcode.find.view.textForCollapseCardsButton");this.barcodeFindViewUiListener=null;this.shutterButton=null;this.finishButton=null;this.progressBar=null;this.cardList=null;this.onShutterButtonClickedHandler=this.onShutterButtonClicked.bind(this);this.onFinishButtonClickedHandler=this.onFinishButtonClicked.bind(this);this.onTorchButtonClickedHandler=this.onTorchButtonClicked.bind(this);this.torchIconButton=null;this.onDotClickHandler=this.onDotClick.bind(this);}get camera(){return this.presenter.context.frameSource}static async createWithSettings(t,o,i,s,r){let e=document.createElement(c.tag);return e.barcodeFindViewSettings=s,e.layout=b.create(),e.layout.innerHTML=html`
|
|
2
2
|
<${a.tag} slot="progress" value="0" max="1" ${e.shouldShowProgressBar?"":"hidden"}></${a.tag}>
|
|
3
3
|
<${a$1.tag} slot="top-controls-left" ${e.shouldShowTorchControl?"":"hidden"}></${a$1.tag}>
|
|
4
4
|
<${b$1.tag} slot="card-list" hidden text-for-collapse-cards-button=${e.textForCollapseCardsButton}></${b$1.tag}>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-B6TRFCTV.js';import {TorchState,isCameraFrameSource,Camera,FrameSourceState,CameraPosition}from'@scandit/web-datacapture-core';var h=class{constructor(e,t,c,n,d){this.torchState=TorchState.Off;this.cameraSupportMap=new Map;this.zoomFactor=1;this.view=e,this.context=t,this.barcodeCheck=c,this.viewSettings=n,this.cameraSettings=d;}get currentCamera(){if(isCameraFrameSource(this.context.frameSource))return this.context.frameSource;throw new Error("The current frame source is not a Camera")}async prepare(){await this.barcodeCheck.setEnabled(!1),this.barcodeCheck.feedback=await a.createWithOptions(!0,!0),this.barcodeCheck.addPrivateListener(this);let e=Camera.atPosition(this.viewSettings.defaultCameraPosition);await this.context.setFrameSource(e),await this.currentCamera.applySettings(this.cameraSettings),await this.currentCamera.switchToDesiredState(FrameSourceState.Standby),this.zoomFactor=this.currentCamera.settings.zoomFactor,this.view.changeZoomButtonIcon(this.zoomFactor);}async dispose(){var e;this.view.deleteAllViews(),await this.context.removeMode(this.barcodeCheck),this.barcodeCheck.removePrivateListener(this),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Off));}async startSearching(){var e;this.view.deleteAllViews(),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.On)),await this.barcodeCheck.setEnabled(!0),await this.barcodeCheck.start();}async stopSearching(){var e;this.view.deleteAllViews(),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Off)),await this.barcodeCheck.setEnabled(!1),await this.barcodeCheck.stop();}async pauseSearching(){var e;this.view.deletePendingViews(),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Standby)),await this.barcodeCheck.setEnabled(!1),await this.barcodeCheck.pause();}emitTappedFeedback(){this.barcodeCheck.feedback.tapped.emit();}didUpdateSession(e,t){Object.keys(t.addedTrackedBarcodes).length>0&&this.barcodeCheck.feedback.scanned.emit(),this.view.render(t);}async onTorchButtonClicked(){var e,t;this.cameraSupportMap.get(this.currentCamera.label)||this.cameraSupportMap.set(this.currentCamera.label,{torch:await this.currentCamera.isTorchAvailable()}),(t=(e=this.cameraSupportMap.get(this.currentCamera.label))==null?void 0:e.torch)!=null&&t&&(await this.currentCamera.setDesiredTorchState(this.torchState===TorchState.Off?TorchState.On:TorchState.Off),this.torchState=this.torchState===TorchState.Off?TorchState.On:TorchState.Off,this.view.toggleTorchIcon(this.torchState));}async onZoomButtonClicked(){var t;if(!this.currentCamera.isZoomAvailable())return;let e=(t={1:2,2:1}[this.zoomFactor])!=null?t:1;this.currentCamera.settings.zoomFactor=e,await this.currentCamera.applySettings(this.currentCamera.settings),this.zoomFactor=e,this.view.changeZoomButtonIcon(e);}async onCameraSwitchButtonClicked(){let e=this.currentCamera.getCurrentState(),t=Camera.atPosition(this.currentCamera.position===CameraPosition.UserFacing?CameraPosition.WorldFacing:CameraPosition.UserFacing);await this.context.setFrameSource(t),await this.currentCamera.switchToDesiredState(e);}};export{h as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeFindView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeFindView}from'../chunks/chunk-TCMZMAI3.js';
|
package/build/js/find/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeFindSettings}from'../chunks/chunk-BDMG75S4.js';export{a as BarcodeFindView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeFindSettings}from'../chunks/chunk-BDMG75S4.js';export{a as BarcodeFindView}from'../chunks/chunk-TCMZMAI3.js';export{a as BarcodeFind}from'../chunks/chunk-HRHBXIPB.js';export{a as BarcodeFindItem,c as BarcodeFindItemContent,b as BarcodeFindItemSearchOptions}from'../chunks/chunk-HTKUJZG2.js';export{a as BarcodeFindViewSettings}from'../chunks/chunk-4PTIOBXM.js';
|