@scandit/web-datacapture-barcode 7.1.2 → 7.1.3
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/BarcodeBatchAdvancedOverlay.d.ts +0 -1
- package/build/js/BarcodeBatchAdvancedOverlay.js +1 -1
- package/build/js/PrivateBarcodeBatchAdvancedOverlayListener.d.ts +0 -1
- package/build/js/TrackedBarcodeView.d.ts +0 -2
- package/build/js/TrackedBarcodeView.js +1 -1
- 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-M3PUKRYC.js → chunk-6IIWY3TZ.js} +1 -1
- package/build/js/chunks/{chunk-RORHP4JF.js → chunk-7XQQOTKV.js} +1 -1
- package/build/js/chunks/chunk-AUPK7PJ7.js +1 -0
- package/build/js/chunks/{chunk-3S7HHSDC.js → chunk-DM2SS7IS.js} +1 -1
- package/build/js/chunks/chunk-EAKSSH2V.js +2 -0
- package/build/js/chunks/{chunk-G3S34TXR.js → chunk-IIWUJSB4.js} +1 -1
- package/build/js/chunks/{chunk-FY762RPS.js → chunk-IUEREHXT.js} +1 -1
- package/build/js/chunks/chunk-IUPY57Z5.js +1 -0
- package/build/js/chunks/{chunk-A2XIM537.js → chunk-KTN55PI7.js} +1 -1
- package/build/js/chunks/chunk-QBMLA2J7.js +1 -0
- package/build/js/chunks/{chunk-UTBXWCDE.js → chunk-RTSR7CHA.js} +1 -1
- package/build/js/chunks/{chunk-BLIIWVVV.js → chunk-RTZD7OUT.js} +1 -1
- package/build/js/chunks/chunk-VSL4PNMP.js +1 -0
- package/build/js/chunks/{chunk-3LECU4D7.js → chunk-X2BLJV42.js} +1 -1
- package/build/js/chunks/{chunk-DMQV3ORB.js → chunk-YZNV3KI4.js} +1 -1
- package/build/js/index.d.ts +0 -1
- package/build/js/index.js +1 -1
- package/build/js/moduleLoader.js +1 -1
- package/build/js/private/symbols.d.ts +1 -5
- package/build/js/private/symbols.js +0 -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/SparkScanViewPresenter.js +1 -1
- package/build/js/spark/ui/SparkScanViewTriggerButton.js +1 -1
- package/build/js/spark/ui/constants/constants.d.ts +2 -1
- package/build/js/spark/ui/constants/constants.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-2XDE4EHA.js +0 -1
- package/build/js/chunks/chunk-HNWVLPRV.js +0 -1
- package/build/js/chunks/chunk-WF7OHN7I.js +0 -1
- package/build/js/chunks/chunk-WP4LTUDY.js +0 -1
- package/build/js/chunks/chunk-WTBGDD52.js +0 -2
- package/build/js/chunks/chunk-Y5ZY6264.js +0 -1
- /package/build/js/chunks/{chunk-Y6TRQARM.js → chunk-PW52T3XN.js} +0 -0
|
@@ -9,7 +9,6 @@ import './Barcode.js';
|
|
|
9
9
|
import './EncodingRange.js';
|
|
10
10
|
import './StructuredAppendData.js';
|
|
11
11
|
import './SymbologySettings.js';
|
|
12
|
-
import './private/symbols.js';
|
|
13
12
|
|
|
14
13
|
interface BarcodeBatchAdvancedOverlayListener {
|
|
15
14
|
viewForTrackedBarcode?(overlay: BarcodeBatchAdvancedOverlay, trackedBarcode: TrackedBarcode): Promise<TrackedBarcodeView | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeBatchAdvancedOverlay}from'./chunks/chunk-
|
|
1
|
+
export{a as BarcodeBatchAdvancedOverlay}from'./chunks/chunk-QBMLA2J7.js';
|
|
@@ -10,7 +10,6 @@ import './StructuredAppendData.js';
|
|
|
10
10
|
import './SymbologySettings.js';
|
|
11
11
|
import './TrackedBarcode.js';
|
|
12
12
|
import './TrackedBarcodeView.js';
|
|
13
|
-
import './private/symbols.js';
|
|
14
13
|
|
|
15
14
|
declare class PrivateBarcodeBatchAdvancedOverlayListener implements BarcodeBatchListener {
|
|
16
15
|
private readonly advancedOverlay;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Size, SizeJSON } from '@scandit/web-datacapture-core';
|
|
2
2
|
import { Serializable } from '@scandit/web-datacapture-core/build/js/private/Serializable';
|
|
3
|
-
import { stripImages } from './private/symbols.js';
|
|
4
3
|
|
|
5
4
|
interface PrivateTrackedBarcodeView {
|
|
6
5
|
data: string;
|
|
@@ -23,7 +22,6 @@ interface TrackedBarcodeViewJSON {
|
|
|
23
22
|
options: TrackedBarcodeViewOptionsJSON;
|
|
24
23
|
}
|
|
25
24
|
declare class TrackedBarcodeView implements Serializable<TrackedBarcodeViewJSON> {
|
|
26
|
-
private static [stripImages];
|
|
27
25
|
private readonly data;
|
|
28
26
|
private readonly options;
|
|
29
27
|
private constructor();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as TrackedBarcodeView}from'./chunks/chunk-
|
|
1
|
+
export{a as TrackedBarcodeView}from'./chunks/chunk-EAKSSH2V.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheck}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheck}from'../chunks/chunk-RTZD7OUT.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheckFeedback}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheckFeedback}from'../chunks/chunk-PW52T3XN.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheckPresenter}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheckPresenter}from'../chunks/chunk-7XQQOTKV.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCheckView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeCheckView}from'../chunks/chunk-X2BLJV42.js';
|
|
@@ -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-AUPK7PJ7.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?"fde583770ac22d35c3f158a28f44b1082d5a9c6bedbf80625fcb93599bf232c9":"7cccb206ae471b0a9db4ed58688c097c543971a2c7f035e5fd76a8ed619911e6":e?"7eaaa4966a7593f992c676e7133632df015e4c63317e3703047c971f26829033":"e4429af075b1ec870800c9697f32fbdd7938a7c6a9a6aec74f07a82cb492e4c7"}getWasmMetadata(){return a$5}};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-PW52T3XN.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var c={"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:6742325},"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:6799434},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6619333},"scandit-datacapture-sdk-barcode.wasm":{bytes:6677024}};export{c 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">
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {a}from'./chunk-WMUD7V77.js';import {Size}from'@scandit/web-datacapture-core';import {Deferred}from'@scandit/web-datacapture-core/build/js/private/utils/deferred.js';var c=class s{constructor(e,t){var a;this.options={scale:(a=t.scale)!=null?a:1,size:t.size},this.data=e;}static async withHTMLElement(e,t){let a=e.cloneNode(!0);return s.getEncodedImageData(a).then(({data:i,size:r})=>new s(i,{size:r,...t}))}static async withBase64EncodedData(e,t){let a=new Deferred,i=new Image;i.addEventListener("error",a.reject,{once:!0}),i.src=e,await i.decode();let r=s.getSize(i);return a.resolve(new s(e,{size:r,...t})),a.promise}static async getEncodedImageData(e){let t=await s.getSVGDataForElement(e);return s.getBase64DataFromDataURL(t)}static getSize(e){let t=document.body.contains(e);t||document.body.append(e);let a=e.getBoundingClientRect();return t||e.remove(),new Size(a.width,a.height)}static async getSVGDataForElement(e){"customElements"in window&&customElements.get(e.tagName.toLowerCase())!==void 0&&await customElements.whenDefined(e.tagName.toLowerCase());let t=s.getSize(e),a$1="http://www.w3.org/2000/svg",i=document.createElementNS(a$1,"svg"),r=document.createElementNS(a$1,"foreignObject");return i.setAttribute("width",`${t.width}`),i.setAttribute("height",`${t.height}`),i.setAttribute("viewBox",`0 0 ${t.width} ${t.height}`),r.setAttribute("width","100%"),r.setAttribute("height","100%"),r.setAttribute("x","0"),r.setAttribute("y","0"),r.setAttribute("externalResourcesRequired","true"),i.append(r),r.append(e),{data:await a(i),size:t}}static getCanvasWithSize(e){let t=document.createElement("canvas");return t.width=e.width,t.height=e.height,t}static async getBase64DataFromDataURL(e){var r;let t=new Deferred,a=new Image;a.addEventListener("error",t.reject,{once:!0}),a.src=e.data,await a.decode();let i=s.getCanvasWithSize(e.size);return (r=i.getContext("2d"))==null||r.drawImage(a,0,0),t.resolve({data:i.toDataURL("image/png",1),size:e.size}),t.promise}toJSONObject(){return {data:this.data,options:{size:this.options.size.toJSONObject(),scale:this.options.scale}}}};
|
|
2
|
+
export{c 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:6799434},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:6742325},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6619336},"scandit-datacapture-sdk-barcode.wasm":{bytes:6677027}};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.2"}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?"0db7094a6a6f8447e68cc77baa2531202e94f1a34032c3a3ffcb155a68b6371d":"cb1f34f622e55cf94ed3f354f8e55d8f4c4b9245de4753c1fa9459bd93a028f5":e?"17867a67aa5ced67eeb5ae4917258cd57ab2ff04906dae64bda39a0b7f34cf3c":""}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?"0db7094a6a6f8447e68cc77baa2531202e94f1a34032c3a3ffcb155a68b6371d":"cb1f34f622e55cf94ed3f354f8e55d8f4c4b9245de4753c1fa9459bd93a028f5":e?"17867a67aa5ced67eeb5ae4917258cd57ab2ff04906dae64bda39a0b7f34cf3c":"eb43be4be49255cfa232032f7e25ca71804efec5d67000f7cc531f6dcef7f6f3"}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-simd-pthreads.wasm":{bytes:6742325},"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:6799434},"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6619333},"scandit-datacapture-sdk-barcode.wasm":{bytes:6677024}};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={}));function Ie(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 Te(t){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(t);return e?e[0]:null}function re(t,e,r){let a=e,i=Ie(a);if(i.result){let n=Te(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 P=class ae extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,ae.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var L=Promise.resolve(),G=!1,$=!1,k,j={writableDataPath:""};async function ie(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 se(t){return $||(G?($=!0,L=L.then(async()=>($=!1,ie(t)))):L=ie(t)),L}async function ne(t){j=t,k=FS.syncfs,FS.syncfs=(e,r)=>{let a=r,i=s=>{a(s)};se(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),se(!0)}var q=(t,e)=>(e=Symbol[t])?e:Symbol.for("Symbol."+t);var K=function(t,e){this[0]=t,this[1]=e},oe=(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},de=(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 ce={};function We(t){return[...new Uint8Array(t)].map(e=>{let r=e.toString(16);return r.length===1?`0${r}`:r}).join("")}function Ee(t){return oe(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 Ae(t){let e=[],r=0,a=0;try{for(var i=de(Ee(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 Re=(t=>(t.VALID="VALID",t.INVALID="INVALID",t.NOT_VERIFIABLE="NOT_VERIFIABLE",t))(Re||{});async function Ne(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=We(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 He(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 _e(t){var e,r;if(t==null)return 0;let a=(e=He(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 ze(t){let{pathname:e}=new URL(t);for(let[r,a]of Object.entries(ce))if(e.endsWith(r))return a.bytes;return 0}function le(t){ce=t}var Ve=(t,e)=>{let r=_e(e);return r===0?ze(t):r};function Je(t,e,r,{onProgress:a,onError:i,onComplete:s}){if(!e.body)return[e];let n=Ve(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]=Je(t,o,r,{onProgress:a,onError:s,onComplete:i});return d!=null&&Ne(Ae(d),e,t),c}function ue({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 pe(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}}var I;(t=>{function e(){return"7.1.3"}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),le(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?"fde583770ac22d35c3f158a28f44b1082d5a9c6bedbf80625fcb93599bf232c9":"7cccb206ae471b0a9db4ed58688c097c543971a2c7f035e5fd76a8ed619911e6":e?"7eaaa4966a7593f992c676e7133632df015e4c63317e3703047c971f26829033":""}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=re(w,e,f),{jsURI:U,wasmURI:te}=O,Be={instantiateWasm:(S,Pe)=>(ue({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 ne({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 pe(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?"fde583770ac22d35c3f158a28f44b1082d5a9c6bedbf80625fcb93599bf232c9":"7cccb206ae471b0a9db4ed58688c097c543971a2c7f035e5fd76a8ed619911e6":e?"7eaaa4966a7593f992c676e7133632df015e4c63317e3703047c971f26829033":"e4429af075b1ec870800c9697f32fbdd7938a7c6a9a6aec74f07a82cb492e4c7"}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,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">
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a as a$2}from'./chunk-OTZPCIBD.js';import {a as a$3}from'./chunk-PFYODZHW.js';import {a}from'./chunk-QCD3RIT4.js';import {b}from'./chunk-JMUNN3HX.js';import {a as a$1,c,b as b$1}from'./chunk-GKYQONEA.js';import {a as a$5}from'./chunk-Q6DVAVA5.js';import {b as b$2,c as c$1}from'./chunk-SZUPDKV5.js';import {a as a$4}from'./chunk-ZY3JZELC.js';import {b as b$3}from'./chunk-3I3FVXFK.js';import {DataCaptureView,Anchor,LogoStyle,CameraAccess,Camera,isCameraFrameSource,FrameSourceState,Color,TorchState,Logger,NumberWithUnit,RadiusLocationSelection,CameraPosition}from'@scandit/web-datacapture-core';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';var O=class R{constructor(a$4,e,t,i){this.cameras=[];this.preferenceManager=new a(localStorage);this.defaultSuccessBrush=a$1.defaultSuccessBrush();this.defaultErrorBrush=a$1.defaultErrorBrush();this.sparkScanView=a$4,this.context=e,this.sparkScan=t,this.sparkScanViewSettings=i,this.stateManager=new a$2(this.sparkScanViewSettings,this.preferenceManager),this.feedbackManager=a$3.withDefaults(i.soundEnabled,i.hapticEnabled),this.analyticsManager=b.forContext(e),this.triggerButtonCollapseTimeout=new Timeout(this.sparkScanViewSettings.triggerButtonCollapseTimeout,async()=>{this.stateManager.state!=="idle"&&await this.switchToIdleState({sessionStopReason:"timeout"});}),this.inactiveStateTimeout=new Timeout(i.inactiveStateTimeout,async()=>{this.stateManager.state!=="inactive"&&!this.stateManager.holdingToScan&&await this.switchToInactiveState({sessionStopReason:"timeout"});}),this.switchToIdleState();}get portraitOrientationTriggerButtonTranslateX(){var a;return (a=this.stateManager.portraitOrientationTriggerButtonTranslateX)!=null?a:this.defaultTriggerButtonTranslateX}get portraitOrientationTriggerButtonTranslateY(){var a;return (a=this.stateManager.portraitOrientationTriggerButtonTranslateY)!=null?a:this.defaultTriggerButtonTranslateY}get landscapeOrientationTriggerButtonTranslateX(){var a;return (a=this.stateManager.landscapeOrientationTriggerButtonTranslateX)!=null?a:this.defaultTriggerButtonTranslateX}get landscapeOrientationTriggerButtonTranslateY(){var a;return (a=this.stateManager.landscapeOrientationTriggerButtonTranslateY)!=null?a:this.defaultTriggerButtonTranslateY}get portraitOrientationMiniPreviewTranslateX(){var a;return (a=this.stateManager.portraitOrientationMiniPreviewTranslateX)!=null?a:this.defaultMiniPreviewTranslateX}get portraitOrientationMiniPreviewTranslateY(){var a;return (a=this.stateManager.portraitOrientationMiniPreviewTranslateY)!=null?a:this.defaultMiniPreviewTranslateY}get landscapeOrientationMiniPreviewTranslateX(){var a;return (a=this.stateManager.landscapeOrientationMiniPreviewTranslateX)!=null?a:this.defaultMiniPreviewTranslateX}get landscapeOrientationMiniPreviewTranslateY(){var a;return (a=this.stateManager.landscapeOrientationMiniPreviewTranslateY)!=null?a:this.defaultMiniPreviewTranslateY}get defaultTriggerButtonTranslateX(){return window.innerWidth-Math.min(window.innerWidth/3,110)-90/2}get defaultTriggerButtonTranslateY(){return window.innerHeight-Math.min(window.innerHeight/3,250)-90/2}get defaultMiniPreviewTranslateX(){return window.innerWidth-225-16}get defaultMiniPreviewTranslateY(){return 16}static forView(a,e,t,i){return new R(a,e,t,i)}async prepareScanning(a){var i;this.context.addListener(this),this.dataCaptureView=await DataCaptureView.forContext(this.context),this.dataCaptureView.logoAnchor=Anchor.BottomCenter,this.dataCaptureView.logoStyle=LogoStyle.Minimal,this.dataCaptureView.setHiddenProperty("stopVideoTracksOnVisibilityChange",!1),this.dataCaptureView.setHiddenProperty("freezeFrameWhenStoppingFrameSource",!1),this.dataCaptureView.connectToElement(a);let e=await CameraAccess.getCameras();this.cameras=e.map(r=>Camera.fromDeviceCamera(r)),this.camera=isCameraFrameSource(this.context.frameSource)?this.context.frameSource:(i=this.cameras.find(r=>r.position===this.sparkScanViewSettings.defaultCameraPosition))!=null?i:Camera.default,await this.camera.applySettings(a$4.recommendedCameraSettings),await this.context.setFrameSource(this.camera),await this.camera.switchToDesiredState(FrameSourceState.Standby);let t=await this.camera.isTorchAvailable();this.sparkScanView.setTorchAvailable(t),this.sparkScanView.setZoomAvailable(this.camera.isZoomAvailable()),this.sparkScanView.cameraSwitchButtonTapped(t,this.camera.position),await this.context.addMode(this.sparkScan),this.sparkScan.addListener(this),this.sparkScanOverlay=await a$5.withSparkScanForView(this.sparkScan,this.dataCaptureView),await this.sparkScanOverlay.setShouldRemoveLocationsAfterScan(this.stateManager.scanningBehavior==="continuous"),this.analyticsManager.startSession({cameraPosition:this.camera.position,handMode:"right",hapticEnabled:this.sparkScanViewSettings.hapticEnabled,scanningMode:this.stateManager.scanningMode,soundEnabled:this.sparkScanViewSettings.soundEnabled,torchState:this.camera.getDesiredTorchState()}),await this.applyPreferences();}async startScanning(){await this.switchToActiveState();}async pauseScanning(){await this.switchToInactiveState({sessionStopReason:"user"});}async stopScanning(a){var e;await this.sparkScan.setEnabled(!1),this.sparkScan.removeListener(this),await((e=this.camera)==null?void 0:e.switchToDesiredState(FrameSourceState.Off)),await this.context.dispose(),this.dataCaptureView.detachFromElement(),this.context.removeListener(this),await this.context.dispose(),this.analyticsManager.setSessionStopReason(a.sessionStopReason);}async onTriggerButtonPointerDown(){await this.sparkScan.setResultSuppressionEnabled(!0);}async onTriggerButtonTap(){switch(await this.sparkScan.setResultSuppressionEnabled(!1),this.stateManager.state){case"Initial":return;case"idle":case"inactive":case"error":{await this.switchToActiveState({barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)});return}case"active":await(this.stateManager.continuousModeEnabled?this.switchToInactiveState({sessionStopReason:"user",barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)}):this.switchToActiveState({barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)}));}}async onTriggerButtonLongPressStart(){var a;await this.sparkScan.setResultSuppressionEnabled(!1),this.sparkScanViewSettings.holdToScanEnabled&&(this.scanningBehaviorCache=this.stateManager.scanningBehavior,this.stateManager.scanningBehavior="continuous",this.stateManager.holdingToScan=!0,await((a=this.sparkScanOverlay)==null?void 0:a.setShouldRemoveLocationsAfterScan(!0)),await this.switchToActiveState({barcodeFeedback:new c(Color.fromRGBA(0,0,0,0),this.defaultSuccessBrush,this.feedbackManager.tapFeedback)}));}async onTriggerButtonLongPressEnd(){var a,e;this.sparkScanViewSettings.holdToScanEnabled&&this.stateManager.state!=="error"&&(this.stateManager.scanningBehavior=(a=this.scanningBehaviorCache)!=null?a:"single",this.stateManager.holdingToScan=!1,await((e=this.sparkScanOverlay)==null?void 0:e.setShouldRemoveLocationsAfterScan(this.stateManager.continuousModeEnabled)),await this.switchToInactiveState({sessionStopReason:"user",barcodeFeedback:new b$1("",0,Color.fromRGBA(0,0,0,0),this.defaultErrorBrush,this.feedbackManager.noFeedback)}));}async onClickOutside(){this.stateManager.idleState||await this.switchToIdleState();}async onVisibilityChange(){await this.switchToIdleState();}async onTargetModeButtonTap(a,e=this.feedbackManager.tapFeedback,t=!0){var c,h,p;let i=String(a),r={true:a&&this.stateManager.scanningMode instanceof b$2,false:!a&&this.stateManager.scanningMode instanceof c$1}[i];r&&(this.stateManager.scanningMode=this.stateManager.scanningMode.changeMode()),this.enableTargetMode(a,this.stateManager.zoomFactor),await((c=this.sparkScanOverlay)==null?void 0:c.setShouldDrawViewfinder(a)),e.emit(),this.stateManager.state!=="idle"&&this.stateManager.state!=="error"&&(this.triggerButtonCollapseTimeout.start(),this.inactiveStateTimeout.start()),this.sparkScanView.targetModeButtonTapped(a,t),r&&((p=(h=this.listener)==null?void 0:h.didChangeScanningMode)==null||p.call(h,this.stateManager.scanningMode),this.analyticsManager.setScanningMode(this.stateManager.scanningMode));}async onScanningBehaviorButtonTap(a,e=this.feedbackManager.tapFeedback,t=!0){var i;e.emit(),this.stateManager.scanningMode=this.stateManager.scanningMode.copyWith(a?"continuous":"single"),await((i=this.sparkScanOverlay)==null?void 0:i.setShouldRemoveLocationsAfterScan(a)),this.stateManager.state!=="idle"&&this.stateManager.state!=="error"&&(this.triggerButtonCollapseTimeout.start(),this.inactiveStateTimeout.start()),this.sparkScanView.scanningBehaviorButtonTapped(a,t),this.analyticsManager.setScanningMode(this.stateManager.scanningMode);}async onBarcodeFindButtonTap(){var a,e;await this.switchToIdleState({sessionStopReason:"user"}),(e=(a=this.listener)==null?void 0:a.didTapBarcodeFindButton)==null||e.call(a,this.sparkScanView),this.restartTimeouts();}async onCameraSwitchButtonTap(){if(this.feedbackManager.emitTapFeedback(),this.restartTimeouts(),!this.camera||this.stateManager.state==="error")return;let a={[CameraPosition.WorldFacing]:CameraPosition.UserFacing,[CameraPosition.UserFacing]:CameraPosition.WorldFacing}[this.camera.position],e=this.cameras.find(t=>t.position===a);e&&(await this.camera.switchToDesiredState(FrameSourceState.Off),await e.applySettings(this.camera.settings),await this.context.setFrameSource(e),await e.switchToDesiredState(FrameSourceState.On),this.sparkScanView.cameraSwitchButtonTapped(await e.isTorchAvailable(),a),this.analyticsManager.setCameraPosition(a),this.camera=e);}async onTorchButtonTap(a,e=this.feedbackManager.tapFeedback,t=!0){var i;e.emit(),this.stateManager.torchState=a?TorchState.On:TorchState.Off,((i=this.camera)==null?void 0:i.getCurrentState())===FrameSourceState.On&&await this.camera.setDesiredTorchState(this.stateManager.torchState),this.stateManager.state!=="idle"&&this.stateManager.state!=="error"&&(this.triggerButtonCollapseTimeout.start(),this.inactiveStateTimeout.start()),this.sparkScanView.torchButtonTapped(a,t),this.analyticsManager.setTorchState(this.stateManager.torchState);}restartTimeouts(){for(let a of [this.triggerButtonCollapseTimeout,this.inactiveStateTimeout,this.resumeCapturingTimeout])(a==null?void 0:a.running)===!0&&a.start();}async onMiniPreviewCloseButtonTap(){await this.switchToIdleState({sessionStopReason:"user"});}onMiniPreviewResizeButtonTap(){this.stateManager.state!=="idle"&&this.stateManager.state!=="error"&&(this.feedbackManager.emitTapFeedback(),this.triggerButtonCollapseTimeout.start(),this.inactiveStateTimeout.start());}async onMiniPreviewZoomButtonTap(a){this.feedbackManager.emitTapFeedback(),this.stateManager.zoomFactor=a,this.camera&&(this.camera.settings.zoomFactor=a,await this.camera.applySettings(this.camera.settings)),this.stateManager.state!=="idle"&&this.stateManager.state!=="error"&&(this.triggerButtonCollapseTimeout.start(),this.inactiveStateTimeout.start()),this.enableTargetModeHiddenProperties(this.stateManager.targetModeEnabled,a);}async onMiniPreviewDrag(a,e){switch(this.stateManager.state==="active"&&await this.sparkScan.setEnabled(!1),e){case"landscape-primary":case"landscape-secondary":{this.stateManager.landscapeOrientationMiniPreviewTranslateX=a.x,this.stateManager.landscapeOrientationMiniPreviewTranslateY=a.y;break}case"portrait-primary":case"portrait-secondary":{this.stateManager.portraitOrientationMiniPreviewTranslateX=a.x,this.stateManager.portraitOrientationMiniPreviewTranslateY=a.y;break}}this.restartTimeouts();}onMiniPreviewPointerMove(){this.restartTimeouts();}async onMiniPreviewPointerUp(){await this.switchToActiveState();}async onMiniPreviewDragEnd(){this.stateManager.state==="active"&&await this.sparkScan.setEnabled(!0);}onTriggerButtonDrag(a,e){switch(e){case"landscape-primary":case"landscape-secondary":{this.stateManager.landscapeOrientationTriggerButtonTranslateX=a.x,this.stateManager.landscapeOrientationTriggerButtonTranslateY=a.y;break}case"portrait-primary":case"portrait-secondary":{this.stateManager.portraitOrientationTriggerButtonTranslateX=a.x,this.stateManager.portraitOrientationTriggerButtonTranslateY=a.y;break}}}async onOrientationChange(){this.stateManager.state==="error"&&await this.switchToInactiveState({sessionStopReason:"user"});}async didScan(a,e){if(!e.newlyRecognizedBarcode)return;let t=this.sparkScanView.feedbackDelegate.getFeedbackForBarcode(e.newlyRecognizedBarcode);t instanceof b$1?await this.switchToErrorState({barcodeFeedback:t}):t instanceof c&&await(this.stateManager.continuousModeEnabled?this.switchToActiveState({barcodeFeedback:t}):this.switchToInactiveState({sessionStopReason:"user",barcodeFeedback:t})),this.restartTimeouts();}didChangeFrameSource(a,e){var t;if(isCameraFrameSource(e))this.camera=e;else {let i=(t=e==null?void 0:e.toJSONObject().type)!=null?t:"unknown";Logger.log(Logger.Level.Warn,`SparkScanView instances require a camera frame source to work, but a frame source of type "${i}" was found.`);}}setListener(a){this.listener=a;}brushForFeedback(a){return a.brush}async switchToIdleState(a={}){var e,t,i;this.feedbackManager.emitTapFeedback(),await((e=this.sparkScanOverlay)==null?void 0:e.overlayReadyForDraw()),this.setState("idle"),await this.sparkScan.setEnabled(!1),await((t=this.camera)==null?void 0:t.switchToDesiredState(FrameSourceState.Standby)),this.triggerButtonCollapseTimeout.stop(),this.inactiveStateTimeout.stop(),(i=this.resumeCapturingTimeout)==null||i.stop(),this.sparkScanView.switchToIdleState(),a.sessionStopReason!=null&&this.analyticsManager.setSessionStopReason(a.sessionStopReason);}async switchToActiveState(a={}){var t,i,r,n,c$1,h,p;let e=this.stateManager.state;this.setState("active"),await((t=this.camera)==null?void 0:t.switchToDesiredState(FrameSourceState.On)),await((i=this.camera)==null?void 0:i.setDesiredTorchState(this.stateManager.torchState)),await this.sparkScan.setEnabled(!0),a.barcodeFeedback&&await((r=this.sparkScanOverlay)==null?void 0:r.setBrush(this.brushForFeedback(a.barcodeFeedback))),await((n=this.sparkScanOverlay)==null?void 0:n.setShouldRemoveLocationsAfterScan(this.stateManager.continuousModeEnabled)),await((c$1=this.sparkScanOverlay)==null?void 0:c$1.overlayReadyForDraw()),this.feedbackManager.emitBarcodeFeedback(a.barcodeFeedback),this.stateManager.holdingToScan||this.inactiveStateTimeout.start(),this.triggerButtonCollapseTimeout.stop(),(h=this.resumeCapturingTimeout)==null||h.stop(),await this.sparkScanView.switchToActiveState(this.sparkScanViewSettings.visualFeedbackEnabled&&a.barcodeFeedback instanceof c,this.stateManager.scanningBehavior,(p=a.barcodeFeedback)==null?void 0:p.visualFeedbackColor,this.stateManager.zoomedIn&&e!=="active");}async switchToInactiveState(a){var e,t,i,r,n,c$1;this.setState("inactive"),a.barcodeFeedback&&await((e=this.sparkScanOverlay)==null?void 0:e.setBrush(this.brushForFeedback(a.barcodeFeedback))),await this.sparkScan.setEnabled(!1),await(a.barcodeFeedback instanceof c&&this.stateManager.scanningMode.previewBehavior==="persistent"?(t=this.sparkScanOverlay)==null?void 0:t.setShouldRemoveLocationsAfterScan(!0):(i=this.camera)==null?void 0:i.switchToDesiredState(FrameSourceState.Standby)),this.feedbackManager.emitBarcodeFeedback(a.barcodeFeedback),await((r=this.sparkScanOverlay)==null?void 0:r.overlayReadyForDraw()),this.triggerButtonCollapseTimeout.start(),this.inactiveStateTimeout.stop(),(n=this.resumeCapturingTimeout)==null||n.stop(),await this.sparkScanView.switchToInactiveState(this.sparkScanViewSettings.visualFeedbackEnabled&&a.barcodeFeedback instanceof c,this.stateManager.scanningBehavior,this.stateManager.previewBehavior,(c$1=a.barcodeFeedback)==null?void 0:c$1.visualFeedbackColor),this.analyticsManager.setSessionStopReason(a.sessionStopReason);}async switchToErrorState(a){var t,i,r,n;let e=a.barcodeFeedback.resumeCapturingDelay>0;e&&(this.setState("error"),this.stateManager.scanningBehavior="single",await this.sparkScan.setEnabled(!1),await((t=this.camera)==null?void 0:t.switchToDesiredState(FrameSourceState.Standby)),this.resumeCapturingTimeout=new Timeout(a.barcodeFeedback.resumeCapturingDelay,async()=>{this.stateManager.state!=="active"&&await this.switchToActiveState();}),this.resumeCapturingTimeout.start()),await((i=this.sparkScanOverlay)==null?void 0:i.setErrorBrush(a.barcodeFeedback.brush)),await((r=this.sparkScanOverlay)==null?void 0:r.overlayReadyForDraw()),await((n=this.sparkScanOverlay)==null?void 0:n.setShouldRemoveLocationsAfterScan(a.barcodeFeedback.resumeCapturingDelay===0)),await this.sparkScan.workerCommand("sparkScanEmitErrorFeedback",{shouldRemoveBrush:!e}),this.feedbackManager.emitBarcodeFeedback(a.barcodeFeedback),this.triggerButtonCollapseTimeout.stop(),this.inactiveStateTimeout.stop(),await this.sparkScanView.switchToErrorState(a.barcodeFeedback,this.sparkScanViewSettings.visualFeedbackEnabled);}enableTargetModeLocationSelection(a){var r;let e=a?b$3.SparkScan.SparkScanSettings.targetModeLocationSelection.radius:b$3.SparkScan.SparkScanSettings.locationSelection.radius,t=a?b$3.SparkScan.SparkScanSettings.targetModeLocationSelection.unit:b$3.SparkScan.SparkScanSettings.locationSelection.unit,i=new NumberWithUnit(e,t);this.sparkScan.settings.locationSelection=new RadiusLocationSelection(i),(r=this.sparkScanOverlay)==null||r.setRadius(i);}enableTargetModeScanIntention(a){this.sparkScan.settings.setScanIntentionForTargetMode(a);}enableTargetModeHiddenProperties(a,e){a?this.sparkScan.settings.enableTargetModeHiddenProperties(e===this.sparkScanViewSettings.zoomFactorOut?1:2):this.sparkScan.settings.disableTargetModeHiddenProperties();}enableTargetMode(a,e){this.enableTargetModeLocationSelection(a),this.enableTargetModeScanIntention(a),this.enableTargetModeHiddenProperties(a,e);}async applyPreferences(){await this.onTargetModeButtonTap(this.stateManager.targetModeEnabled,this.feedbackManager.noFeedback,!1),await this.onScanningBehaviorButtonTap(this.stateManager.continuousModeEnabled,this.feedbackManager.noFeedback,!1),await this.onTorchButtonTap(this.stateManager.torchEnabled,this.feedbackManager.noFeedback,!1);}setState(a){var e,t;a!==this.stateManager.state&&(this.stateManager.state=a,(t=(e=this.listener)==null?void 0:e.didChangeViewState)==null||t.call(e,a));}};export{O as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-IIWUJSB4.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
|
+
import {a}from'./chunk-C52THG7K.js';import {NumberWithUnit,MeasureUnit,PointWithUnit,Anchor}from'@scandit/web-datacapture-core';var f=new NumberWithUnit(0,MeasureUnit.Pixel),F=new PointWithUnit(f,f),m=Anchor.Center,p=class v{constructor(){this.listener=null;this.type="barcodeTrackingAdvanced";this._shouldShowScanAreaGuides=!1;this._viewForBarcode=new Map;this._anchorForBarcode=new Map;this._offsetForBarcode=new Map;this._viewForBarcodeFromListener=new Map;this._anchorForBarcodeFromListener=new Map;this._offsetForBarcodeFromListener=new Map;this._anchorPositions=new Map;this._barcodeForId=new Map;}get shouldShowScanAreaGuides(){return this._shouldShowScanAreaGuides}set shouldShowScanAreaGuides(a){this._shouldShowScanAreaGuides=a,this.barcodeBatch.notifyContext();}static async withBarcodeBatchForView(a$1,r){let e=new v;return e.barcodeBatch=a$1,r&&(await r.addOverlay(e),e.view=r,e.privateListener=new a(e),a$1.addPrivateListener(e.privateListener),e.view.setDidTapCustomLocationsViewListener({didTapView:n=>{var t,d;let o=e.getTrackedBarcodeForIdentifier(n);o&&((d=(t=e.listener)==null?void 0:t.didTapViewForTrackedBarcode)==null||d.call(t,e,o));}})),e}async setViewForTrackedBarcode(a,r){if(a==null){this._viewForBarcode.set(r.identifier,null);return}let e=await a;e!=null&&this._viewForBarcode.set(r.identifier,e),this.barcodeBatch.isEnabled()||this.update();}setAnchorForTrackedBarcode(a,r){this._anchorForBarcode.set(r.identifier,a),this.barcodeBatch.isEnabled()||this.update();}setOffsetForTrackedBarcode(a,r){this._offsetForBarcode.set(r.identifier,a),this.barcodeBatch.isEnabled()||this.update();}clearTrackedBarcodeViews(){this._viewForBarcode.clear(),this.barcodeBatch.isEnabled()||this.update();}toJSONObject(){return {type:this.type,shouldShowScanAreaGuides:this._shouldShowScanAreaGuides}}getTrackedBarcodeForIdentifier(a){return this._barcodeForId.get(a)}async setViewForTrackedBarcodeFromListener(a,r){if(a==null){this._viewForBarcodeFromListener.set(r.identifier,null);return}let e=await a;e!=null&&this._viewForBarcodeFromListener.set(r.identifier,e);}processRemovedBarcodes(a){for(let r of a){let e=Number.parseInt(r,10);this._viewForBarcode.delete(e),this._anchorForBarcode.delete(e),this._offsetForBarcode.delete(e),this._anchorPositions.delete(e),this._viewForBarcodeFromListener.delete(e),this._anchorForBarcodeFromListener.delete(e),this._offsetForBarcodeFromListener.delete(e);}}processAddedBarcodes(a){var r,e,n,o,t,d,h;for(let i of a){if(this._anchorPositions.set(i.identifier,i.anchorPositions),this._barcodeForId.set(i.identifier,i),!this._viewForBarcodeFromListener.has(i.identifier)){let c=(n=(e=(r=this.listener)==null?void 0:r.viewForTrackedBarcode)==null?void 0:e.call(r,this,i))!=null?n:Promise.resolve(null);this.setViewForTrackedBarcodeFromListener(c,i);}if(!this._offsetForBarcodeFromListener.has(i.identifier)){let c=(t=(o=this.listener)==null?void 0:o.offsetForTrackedBarcode)==null?void 0:t.call(o,this,i);c!=null&&this._offsetForBarcodeFromListener.set(i.identifier,c);}if(!this._anchorForBarcodeFromListener.has(i.identifier)){let c=(h=(d=this.listener)==null?void 0:d.anchorForTrackedBarcode)==null?void 0:h.call(d,this,i);c!=null&&this._anchorForBarcodeFromListener.set(i.identifier,c);}}}processUpdatedTrackedBarcodes(a){for(let r of a)this._anchorPositions.set(r.identifier,r.anchorPositions),this._barcodeForId.set(r.identifier,r);}update(a){var n,o,t,d,h,i;a!=null&&(this.lastSession=a);let r=this.view;if(r===null)return;this.processRemovedBarcodes(this.lastSession.removedTrackedBarcodes),this.processAddedBarcodes(this.lastSession.addedTrackedBarcodes),this.processUpdatedTrackedBarcodes(this.lastSession.updatedTrackedBarcodes);let e={removedIds:this.lastSession.removedTrackedBarcodes,elements:[]};for(let c of Object.keys(this.lastSession.trackedBarcodes)){let s=Number.parseInt(c,10),B=(o=(n=this._viewForBarcode.get(s))!=null?n:this._viewForBarcodeFromListener.get(s))==null?void 0:o.toJSONObject();B!=null&&e.elements.push({view:B,identifier:s,anchor:(d=(t=this._anchorForBarcode.get(s))!=null?t:this._anchorForBarcodeFromListener.get(s))!=null?d:m,offset:(i=(h=this._offsetForBarcode.get(s))!=null?h:this._offsetForBarcodeFromListener.get(s))!=null?i:F,anchorPositions:this._anchorPositions.get(s)});}r.renderCustomLocationsView(e);}};export{p as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-6IIWY3TZ.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 +1 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-FRG4ACMI.js';import {b}from'./chunk-LXROKZUG.js';import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$2}from'./chunk-FRG4ACMI.js';import {b}from'./chunk-LXROKZUG.js';import {a as a$1}from'./chunk-PW52T3XN.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=500,t=16,o=32,n=400,r=90;export{e as a,t as b,o as c,n as d,r as e};
|