var i=class{constructor(e,r,t){this.barcodeAr=null;this.coreEngine=e,this.Module=r,this.workerFunctions=t;}async forSettings(e){var t;(t=this.barcodeAr)==null||t.delete(),this.barcodeAr=new this.Module.BarcodeAr(this.coreEngine.context,JSON.stringify(e));let r=this.Module.BarcodeArListener.extend("BarcodeArListener",{didUpdateSession:(s,o,a)=>{let n=this.coreEngine.convertToLoadableFrameData(a);this.workerFunctions.postMessage({type:"barcodeArDidUpdateSession",payload:{session:JSON.parse(o.toJson()),frameData:n}}),s.delete(),o.delete(),a.delete();}});this.barcodeAr.addListener(new r,1),this.Module.addBarcodeArToContext(this.coreEngine.context,this.barcodeAr);}start(){var e;(e=this.barcodeAr)==null||e.start();}pause(){var e;(e=this.barcodeAr)==null||e.pause();}stop(){var e;(e=this.barcodeAr)==null||e.stop();}setEnabled(e){var r;(r=this.barcodeAr)==null||r.setEnabled(e);}async removeMode(){this.barcodeAr!=null&&this.Module.removeBarcodeArFromContext(this.coreEngine.context,this.barcodeAr);}applySettings(e){var r;(r=this.barcodeAr)==null||r.applySettings(JSON.stringify(e));}};export{i as a};