UNPKG

@scandit/web-datacapture-barcode

Version:

Scandit Data Capture SDK for the Web

1 lines 1.87 kB
import {a as a$1}from'./chunk-LLMMR2TB.js';import {a}from'./chunk-3YNK2VJA.js';import {a as a$2}from'./chunk-DCUKY2F4.js';import {PrivateNoneLocationSelection}from'@scandit/web-datacapture-core';var b=class{constructor(){this.codeDuplicateFilter=a.BarcodeCaptureSettings.codeDuplicateFilter;this.locationSelection=null;this.enabledCompositeTypes=[];this.scanIntention="manual";this.properties={};this.symbologies={};this._arucoDictionary=null;}get enabledSymbologies(){return Object.keys(this.symbologies).filter(o=>{var e;return (e=this.symbologies[o])==null?void 0:e.isEnabled})}get compositeTypeDescriptions(){return a$1.CompositeTypeDescriptions.reduce((o,e)=>(o[e.types[0]]=e,o),{})}settingsForSymbology(o){if(!this.symbologies[o]){let e=a$1.SymbologySettings[o];e._symbology=o,this.symbologies[o]=e;}return this.symbologies[o]}setProperty(o,e){this.properties[o]=e;}getProperty(o){return this.properties[o]}enableSymbologies(o){for(let e of o)this.enableSymbology(e,true);}enableSymbology(o,e){this.settingsForSymbology(o).isEnabled=e,o==="aruco"&&(this._arucoDictionary=a$2.fromPreset("5X5_50"));}enableSymbologiesForCompositeTypes(o){for(let e of o)this.enableSymbologies(this.compositeTypeDescriptions[e].symbologies);}setArucoDictionary(o){this._arucoDictionary=o;}toJSONObject(){var e,i,r,n,s;let o={};return {codeDuplicateFilter:this.codeDuplicateFilter,enabledCompositeTypes:[...this.enabledCompositeTypes],locationSelection:(i=(e=this.locationSelection)==null?void 0:e.toJSONObject())!=null?i:PrivateNoneLocationSelection,properties:{...this.properties},symbologies:Object.keys(this.symbologies).reduce((c,l)=>{var a;let y=(a=this.symbologies[l])==null?void 0:a.toJSONObject();return y&&(c[l]=y),c},o),scanIntention:(r=this.scanIntention)!=null?r:null,arucoDictionary:(s=(n=this._arucoDictionary)==null?void 0:n.toJSONObject())!=null?s:null}}};export{b as a};