@scandit/web-datacapture-barcode 7.5.0 → 7.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/BarcodeBatch.js +1 -1
- package/build/js/BarcodeBatchBasicOverlay.js +1 -1
- package/build/js/BarcodeBatchSettings.js +1 -1
- package/build/js/BarcodeCapture.js +1 -1
- package/build/js/BarcodeCaptureOverlay.js +1 -1
- package/build/js/BarcodeCaptureSettings.js +1 -1
- package/build/js/Defaults.js +1 -1
- package/build/js/ar/BarcodeAr.js +1 -1
- package/build/js/ar/BarcodeArFeedback.js +1 -1
- package/build/js/ar/BarcodeArPresenter.js +1 -1
- package/build/js/ar/BarcodeArSettings.js +1 -1
- package/build/js/ar/BarcodeArView.js +1 -1
- package/build/js/ar/ui/atoms/BarcodeArInfoAnnotationFooter.js +1 -1
- package/build/js/ar/ui/atoms/BarcodeArInfoAnnotationHeader.js +1 -1
- package/build/js/ar/ui/atoms/private/BarcodeArInfoAnnotationHeaderFooterUtils.js +1 -1
- package/build/js/ar/ui/atoms/private/BarcodeStatusIconContainer.js +1 -1
- package/build/js/ar/ui/atoms/private/CssArrows.js +1 -1
- package/build/js/ar/ui/organisms/BarcodeArInfoAnnotation.js +1 -1
- package/build/js/ar/ui/organisms/BarcodeArPopoverAnnotation.js +1 -1
- package/build/js/ar/ui/organisms/BarcodeArPopoverAnnotationButton.js +1 -1
- package/build/js/ar/ui/organisms/BarcodeArResponsiveAnnotation.js +1 -1
- package/build/js/ar/ui/organisms/BarcodeArStatusIconAnnotation.js +1 -1
- package/build/js/chunks/chunk-2ASAIH4R.js +1 -0
- package/build/js/chunks/{chunk-NW3BYZWA.js → chunk-2FLH3YJS.js} +1 -1
- package/build/js/chunks/{chunk-LN6NHJTD.js → chunk-3UDJKVMP.js} +1 -1
- package/build/js/chunks/{chunk-NAHMBS3A.js → chunk-42Y6V4GC.js} +1 -1
- package/build/js/chunks/{chunk-UKOWYLLZ.js → chunk-4MCMAHRH.js} +1 -1
- package/build/js/chunks/{chunk-GT4V3BBH.js → chunk-5URXITXR.js} +1 -1
- package/build/js/chunks/chunk-6ICCAKOQ.js +1 -0
- package/build/js/chunks/chunk-6KWMOMD7.js +1 -0
- package/build/js/chunks/{chunk-DGF7ODRH.js → chunk-B5IOSUX4.js} +1 -1
- package/build/js/chunks/{chunk-45M2WAHF.js → chunk-DBC7BRFQ.js} +1 -1
- package/build/js/chunks/{chunk-ZI75KHWU.js → chunk-EGQKRCPY.js} +1 -1
- package/build/js/chunks/{chunk-MAA4EROF.js → chunk-EWLALL5J.js} +1 -1
- package/build/js/chunks/chunk-F7NAOKPF.js +1 -0
- package/build/js/chunks/{chunk-XTOFHCOV.js → chunk-FFISQQ67.js} +1 -1
- package/build/js/chunks/{chunk-Q7LPEF5X.js → chunk-GFEJ3EYF.js} +1 -1
- package/build/js/chunks/{chunk-K3NQKPWC.js → chunk-GLJCW3XH.js} +1 -1
- package/build/js/chunks/chunk-HFXWQGKV.js +6 -0
- package/build/js/chunks/{chunk-ZF7YEGPW.js → chunk-HRQFPTLO.js} +1 -1
- package/build/js/chunks/{chunk-KICLFEZA.js → chunk-IYA7GGQL.js} +1 -1
- package/build/js/chunks/{chunk-7MDNYMWU.js → chunk-JFBYWTLE.js} +1 -1
- package/build/js/chunks/{chunk-6BIERYLN.js → chunk-K4D6B66I.js} +1 -1
- package/build/js/chunks/{chunk-VINHRCNE.js → chunk-KCLART6S.js} +1 -1
- package/build/js/chunks/{chunk-O6JPGVIL.js → chunk-LR6JSIOR.js} +1 -1
- package/build/js/chunks/chunk-M7AZ5E5Z.js +1 -0
- package/build/js/chunks/{chunk-6WNR57VU.js → chunk-NZ2T2TMQ.js} +1 -1
- package/build/js/chunks/{chunk-C3BYC73L.js → chunk-O7GNCGRU.js} +1 -1
- package/build/js/chunks/chunk-OCP2OI55.js +2 -0
- package/build/js/chunks/{chunk-2A2DLPAB.js → chunk-OIFWCYQI.js} +1 -1
- package/build/js/chunks/{chunk-P4F5WUAR.js → chunk-ORLJNUNA.js} +1 -1
- package/build/js/chunks/{chunk-YZS4FYM4.js → chunk-PTTL56CB.js} +1 -1
- package/build/js/chunks/{chunk-ISEAB7YQ.js → chunk-Q6AXWSZZ.js} +1 -1
- package/build/js/chunks/{chunk-5CKMOWBK.js → chunk-QCO6TK2S.js} +1 -1
- package/build/js/chunks/{chunk-ZQ3QRLEZ.js → chunk-QD4KRTNG.js} +1 -1
- package/build/js/chunks/{chunk-FRFBKO7R.js → chunk-QHNACUVB.js} +1 -1
- package/build/js/chunks/chunk-QNZA644V.js +1 -0
- package/build/js/chunks/{chunk-I3E2HP2L.js → chunk-QO2O2C3A.js} +1 -1
- package/build/js/chunks/{chunk-WYDK7FDG.js → chunk-QWZ3XB2O.js} +1 -1
- package/build/js/chunks/{chunk-BZWA4BPU.js → chunk-QZGFNS2K.js} +1 -1
- package/build/js/chunks/{chunk-D66HVQKO.js → chunk-R2NJCFWO.js} +1 -1
- package/build/js/chunks/{chunk-EW4BAEBZ.js → chunk-R6OFE5ZZ.js} +1 -1
- package/build/js/chunks/{chunk-VU7W53X2.js → chunk-RLKGZ42F.js} +1 -1
- package/build/js/chunks/{chunk-UZD5DJXU.js → chunk-S7ZLCH67.js} +1 -1
- package/build/js/chunks/{chunk-5HCHOM4R.js → chunk-SZ3AQK6Y.js} +1 -1
- package/build/js/chunks/{chunk-NKRL5HIU.js → chunk-UCHREILA.js} +1 -1
- package/build/js/chunks/{chunk-YWCXI7D5.js → chunk-XGY5EQR4.js} +1 -1
- package/build/js/chunks/{chunk-WXR7X3J5.js → chunk-YCZLNTKQ.js} +2 -2
- package/build/js/chunks/{chunk-NE5ADP4U.js → chunk-YD2VGEB5.js} +1 -1
- package/build/js/chunks/{chunk-ACNWENKW.js → chunk-ZWUKKWEI.js} +1 -1
- package/build/js/find/BarcodeFind.js +1 -1
- package/build/js/find/BarcodeFindFeedback.js +1 -1
- package/build/js/find/BarcodeFindPresenter.js +1 -1
- package/build/js/find/BarcodeFindSettings.js +1 -1
- package/build/js/find/BarcodeFindView.js +1 -1
- package/build/js/find/index.js +1 -1
- package/build/js/find/ui/atoms/CardListButton.js +1 -1
- package/build/js/find/ui/molecules/CardListContainer.js +1 -1
- package/build/js/find/ui/molecules/ImageAndTextCardLayout.js +1 -1
- package/build/js/index.js +1 -1
- package/build/js/moduleLoader.js +1 -1
- package/build/js/spark/SparkScan.js +1 -1
- package/build/js/spark/SparkScanBarcodeFeedback.js +1 -1
- package/build/js/spark/SparkScanOverlay.js +1 -1
- package/build/js/spark/SparkScanSettings.js +1 -1
- package/build/js/spark/SparkScanTargetAimerViewfinder.js +1 -1
- package/build/js/spark/index.js +1 -1
- package/build/js/spark/ui/SparkScanView.js +1 -1
- package/build/js/spark/ui/SparkScanViewFeedbackManager.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/SparkScanViewSettings.js +1 -1
- package/build/js/spark/ui/SparkScanViewTriggerButton.js +1 -1
- package/build/js/spark/ui/SparkScanViewVisualFeedback.js +1 -1
- package/build/js/spark/ui/controllers/DragController.js +1 -1
- package/build/js/spark/ui/index.js +1 -1
- package/build/js/spark/ui/utils/html.js +1 -1
- package/build/js/worker/BarcodeCaptureWorkerManager.js +1 -1
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/barcodeCapture.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-62I36ZHW.js +0 -1
- package/build/js/chunks/chunk-DHCNYKSL.js +0 -1
- package/build/js/chunks/chunk-LAYALN2H.js +0 -1
- package/build/js/chunks/chunk-O2DTDLQ5.js +0 -2
- package/build/js/chunks/chunk-OHSTP7TM.js +0 -1
- package/build/js/chunks/chunk-RWDAYBTQ.js +0 -1
- package/build/js/chunks/chunk-VS7IRHEK.js +0 -1
- package/build/js/chunks/chunk-VZNESTL2.js +0 -6
- /package/build/js/chunks/{chunk-IRAW536A.js → chunk-7GFMLF25.js} +0 -0
package/build/js/BarcodeBatch.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeBatch}from'./chunks/chunk-
|
|
1
|
+
export{a as BarcodeBatch}from'./chunks/chunk-EGQKRCPY.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as BarcodeBatchBasicOverlay,a as BarcodeBatchBasicOverlayStyle}from'./chunks/chunk-
|
|
1
|
+
export{b as BarcodeBatchBasicOverlay,a as BarcodeBatchBasicOverlayStyle}from'./chunks/chunk-KCLART6S.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeBatchSettings}from'./chunks/chunk-
|
|
1
|
+
export{a as BarcodeBatchSettings}from'./chunks/chunk-R2NJCFWO.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCapture}from'./chunks/chunk-
|
|
1
|
+
export{a as BarcodeCapture}from'./chunks/chunk-QWZ3XB2O.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as BarcodeCaptureOverlay,a as BarcodeCaptureOverlayStyle}from'./chunks/chunk-
|
|
1
|
+
export{b as BarcodeCaptureOverlay,a as BarcodeCaptureOverlayStyle}from'./chunks/chunk-SZ3AQK6Y.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeCaptureSettings}from'./chunks/chunk-
|
|
1
|
+
export{a as BarcodeCaptureSettings}from'./chunks/chunk-QO2O2C3A.js';
|
package/build/js/Defaults.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as defaultValues,a as defaultsFromJSON,c as setDefaults}from'./chunks/chunk-
|
|
1
|
+
export{b as defaultValues,a as defaultsFromJSON,c as setDefaults}from'./chunks/chunk-QNZA644V.js';
|
package/build/js/ar/BarcodeAr.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeAr}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeAr}from'../chunks/chunk-IYA7GGQL.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeArFeedback}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeArFeedback}from'../chunks/chunk-7GFMLF25.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeArPresenter}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeArPresenter}from'../chunks/chunk-R6OFE5ZZ.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeArSettings}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeArSettings}from'../chunks/chunk-S7ZLCH67.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeArView}from'../chunks/chunk-
|
|
1
|
+
export{a as BarcodeArView}from'../chunks/chunk-NZ2T2TMQ.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeArInfoAnnotationFooter}from'../../../chunks/chunk-
|
|
1
|
+
export{a as BarcodeArInfoAnnotationFooter}from'../../../chunks/chunk-LR6JSIOR.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeArInfoAnnotationHeader}from'../../../chunks/chunk-
|
|
1
|
+
export{a as BarcodeArInfoAnnotationHeader}from'../../../chunks/chunk-5URXITXR.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as CONTAINER_SELECTOR,b as ICON_TEXT_SELECTOR,c as TEXT_SELECTOR,e as createStyles,d as createTemplate,h as getBackgroundColor,f as getIcon,n as getText,j as getTextColor,l as getTextSize,i as setBackgroundColor,o as setText,k as setTextColor,m as setTextSize,g as updateIcon}from'../../../../chunks/chunk-
|
|
1
|
+
export{a as CONTAINER_SELECTOR,b as ICON_TEXT_SELECTOR,c as TEXT_SELECTOR,e as createStyles,d as createTemplate,h as getBackgroundColor,f as getIcon,n as getText,j as getTextColor,l as getTextSize,i as setBackgroundColor,o as setText,k as setTextColor,m as setTextSize,g as updateIcon}from'../../../../chunks/chunk-HFXWQGKV.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeStatusIconContainer}from'../../../../chunks/chunk-
|
|
1
|
+
export{a as BarcodeStatusIconContainer}from'../../../../chunks/chunk-QZGFNS2K.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as cssArrows}from'../../../../chunks/chunk-
|
|
1
|
+
export{a as cssArrows}from'../../../../chunks/chunk-F7NAOKPF.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{d as BarcodeArInfoAnnotation,a as BarcodeArInfoAnnotationAnchor,c as BarcodeArInfoAnnotationEvent,b as BarcodeArInfoAnnotationWidthPreset}from'../../../chunks/chunk-
|
|
1
|
+
export{d as BarcodeArInfoAnnotation,a as BarcodeArInfoAnnotationAnchor,c as BarcodeArInfoAnnotationEvent,b as BarcodeArInfoAnnotationWidthPreset}from'../../../chunks/chunk-42Y6V4GC.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as BarcodeArPopoverAnnotation,a as BarcodeArPopoverAnnotationAnchor}from'../../../chunks/chunk-
|
|
1
|
+
export{b as BarcodeArPopoverAnnotation,a as BarcodeArPopoverAnnotationAnchor}from'../../../chunks/chunk-B5IOSUX4.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeArPopoverAnnotationButton}from'../../../chunks/chunk-
|
|
1
|
+
export{a as BarcodeArPopoverAnnotationButton}from'../../../chunks/chunk-OIFWCYQI.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{a as BarcodeArResponsiveAnnotation}from'../../../chunks/chunk-
|
|
1
|
+
export{a as BarcodeArResponsiveAnnotation}from'../../../chunks/chunk-RLKGZ42F.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{b as BarcodeArStatusIconAnnotation,a as BarcodeArStatusIconAnnotationAnchor}from'../../../chunks/chunk-
|
|
1
|
+
export{b as BarcodeArStatusIconAnnotation,a as BarcodeArStatusIconAnnotationAnchor}from'../../../chunks/chunk-YD2VGEB5.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {a}from'./chunk-T2Y2C76P.js';import {Point}from'@scandit/web-datacapture-core';import {clamp}from'@scandit/web-datacapture-core/build/js/private/utils/clamp.js';import {safeAwaitAnimation}from'@scandit/web-datacapture-core/build/js/private/utils/safeCancelAnimation.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';var s=class extends Event{constructor(t,e){super(t),this.point=e;}},l=class{constructor(t,e){this.translate=new Point(0,0);this.draggable=false;this.pointerDownListener=this.onPointerDown.bind(this);this.pointerMoveListener=this.onPointerMove.bind(this);this.pointerUpListener=this.onPointerUp.bind(this);this.touchStartListener=this.onTouchStart.bind(this);this.resizeListener=this.onResize.bind(this);this.repositioningTimeout=new Timeout(500,this.repositionIfOutOfBounds.bind(this));this.margin=new Point(0,0);this.element=t,this.boundaryElement=e!=null&&e.clientWidth&&(e!=null&&e.clientHeight)?e:document.body;}get translateWithMargin(){return new Point(this.translate.x+this.margin.x,this.translate.y+this.margin.y)}connect(){this.render(),this.element.addEventListener("pointerdown",this.pointerDownListener),this.element.addEventListener("pointermove",this.pointerMoveListener),this.element.addEventListener("pointerup",this.pointerUpListener),this.element.addEventListener("touchstart",this.touchStartListener),window.addEventListener("resize",this.resizeListener);}disconnect(){this.element.removeEventListener("pointerdown",this.pointerDownListener),this.element.removeEventListener("pointermove",this.pointerMoveListener),this.element.removeEventListener("pointerup",this.pointerUpListener),this.element.removeEventListener("touchstart",this.touchStartListener),window.removeEventListener("resize",this.resizeListener),this.repositioningTimeout.stop();}getBoundedTranslate(){let{width:t,height:e}=this.element.getBoundingClientRect(),n=this.boundaryElement.clientWidth,c=this.boundaryElement.clientHeight,o=clamp(this.translate.x,Math.abs(this.margin.x),n-t-this.margin.x),r=clamp(this.translate.y,Math.abs(this.margin.y),c-e-this.margin.y);if(this.translate.x!==o||this.translate.y!==r)return new Point(o,r)}async translateTo(t,e){if(this.translate=t,e){let n=this.element.animate([{transform:`translate(${this.translate.x}px, ${this.translate.y}px)`}],{duration:200,easing:"ease"});n.play(),await safeAwaitAnimation(n);}this.render(),this.element.dispatchEvent(new s("drag",t));}render(){this.element.style.setProperty("transform",`translate(${this.translate.x}px, ${this.translate.y}px)`);}async repositionIfOutOfBounds(){let t=this.getBoundedTranslate();t&&await this.translateTo(t,true);}onPointerDown(t){t instanceof PointerEvent&&(this.offset=new Point(this.translate.x-t.clientX,this.translate.y-t.clientY),this.pointerDownEvent=t);}onPointerMove(t){t instanceof PointerEvent&&this.offset&&this.draggable&&this.translateTo(new Point(this.offset.x+t.clientX,this.offset.y+t.clientY),false);}async onPointerUp(t){t instanceof PointerEvent&&this.pointerDownEvent&&a(this.pointerDownEvent,t)&&(await this.repositionIfOutOfBounds(),this.offset=void 0,this.draggable=false,this.element.dispatchEvent(new s("dragend",this.translate)));}onTouchStart(t){t.returnValue=false;}onResize(){this.repositioningTimeout.start();}};export{s as a,l as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$
|
|
1
|
+
import {a as a$2}from'./chunk-LTNZJEG4.js';import {a as a$4}from'./chunk-4QSEBPWB.js';import {a as a$1}from'./chunk-2ZSOWJ2F.js';import {a}from'./chunk-WVIC3JWX.js';import {a as a$3}from'./chunk-7O2NHA3I.js';import {a as a$5}from'./chunk-6ICCAKOQ.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.barcodeArMode=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?"09ee02e40ca126413df9d542e4c6afe87c895f9db3c16f4d8edbbee2e6d413f4":"e1c427c8ac9234c0c0a27a1a5690c57c7c01d1515a6d148171a9dfe1c7b46ff1":e?"5ac83a4ea30525ba23545ef188fb9368c531104d797e0c9c2876a23c59a64127":"0b81264268f725fdf38748938a6f1f6cc17c7068d91daca060bcef980c9c2c82"}getWasmMetadata(){return a$5}};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-QNZA644V.js';import {RadiusLocationSelection,NumberWithUnit}from'@scandit/web-datacapture-core';var S=class{constructor(){this.codeDuplicateFilter=b.SparkScan.SparkScanSettings.codeDuplicateFilter;this.scanIntention="manual";this.locationSelection=new RadiusLocationSelection(new NumberWithUnit(b.SparkScan.SparkScanSettings.locationSelection.radius,b.SparkScan.SparkScanSettings.locationSelection.unit));this.properties={};this.symbologies={};}get enabledSymbologies(){return Object.keys(this.symbologies).filter(t=>{var e;return (e=this.symbologies[t])==null?void 0:e.isEnabled})}settingsForSymbology(o){if(!this.symbologies[o]){let t=b.SymbologySettings[o];t._symbology=o,this.symbologies[o]=t;}return this.symbologies[o]}setProperty(o,t){this.properties[o]=t;}getProperty(o){return this.properties[o]}enableSymbologies(o){for(let t of o)this.enableSymbology(t,true);}enableSymbology(o,t){this.settingsForSymbology(o).isEnabled=t;}toJSONObject(){var e;let o={},t=Object.keys(this.symbologies);return {codeDuplicateFilter:this.codeDuplicateFilter,locationSelection:this.locationSelection.toJSONObject(),properties:{...this.properties},symbologies:t.reduce((n,s)=>{var r;let l=(r=this.symbologies[s])==null?void 0:r.toJSONObject();return l&&(n[s]=l),n},o),scanIntention:(e=this.scanIntention)!=null?e:null}}};export{S as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-F7NAOKPF.js';import {a as a$4}from'./chunk-DVLPRWCY.js';import {a as a$2}from'./chunk-LR6JSIOR.js';import {a as a$3}from'./chunk-5URXITXR.js';import {a as a$1}from'./chunk-CYVVGAZ4.js';import {Color,ScanditIcon}from'@scandit/web-datacapture-core';import {ScanditHTMLElement,html,defineCustomElements,css}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var m=(o=>(o[o.Top="top-center"]="Top",o[o.Bottom="bottom-center"]="Bottom",o[o.Left="left-center"]="Left",o[o.Right="right-center"]="Right",o))(m||{}),N=(e=>(e.Small="small",e.Medium="medium",e.Large="large",e))(N||{}),U=(T=>(T.InfoAnnotationTap="BarcodeArInfoAnnotationEventTap",T))(U||{}),p="slot[name='header']",h="slot[name='footer']",v="--arrow-background-color",s=class s extends ScanditHTMLElement{constructor(){super();this.isEntireAnnotationTappable=false;this.annotationTrigger="highlightTapAndBarcodeScan";this.onPointerUpListener=this.onPointerUp.bind(this);this.onSlotChangeListener=this.onSlotChange.bind(this);this.highlightableElementListenerMap=new Map;let t=this.attachShadow({mode:"open"});t.innerHTML=html`<div
|
|
2
2
|
class="container arw-${m.Bottom} ${"small"}"
|
|
3
3
|
>
|
|
4
4
|
<slot name="header"></slot>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-HRQFPTLO.js';import {b}from'./chunk-QNZA644V.js';import {Brush}from'@scandit/web-datacapture-core';var s=class o{constructor(){this.type="sparkScan";this._shouldShowScanAreaGuides=false;this._shouldRemoveLocationsAfterScan=true;this._shouldDrawViewfinder=false;this._style=b.SparkScan.SparkScanOverlay.defaultStyle;this._viewfinder=new a;}get style(){return this._style}static async withSparkScanForView(a,r){let t=new o;return t.sparkScan=a,await t.setBrush(new Brush(b.SparkScan.SparkScanOverlay.DefaultBrush.fillColor,b.SparkScan.SparkScanOverlay.DefaultBrush.strokeColor,b.SparkScan.SparkScanOverlay.DefaultBrush.strokeWidth)),r&&await r.addOverlay(t),t}setRadius(a){this._viewfinder.radius=a;}getBrush(){return this._brush}async setBrush(a){this._brush=a,await this.sparkScan.notifyContext();}async overlayReadyForDraw(){await this.sparkScan.workerCommand("sparkScanOverlayReadyForDraw",{});}async setErrorBrush(a){this._errorBrush=a,await this.sparkScan.notifyContext();}async setShouldShowScanAreaGuides(a){this._shouldShowScanAreaGuides=a,await this.sparkScan.notifyContext();}async setShouldRemoveLocationsAfterScan(a){this._shouldRemoveLocationsAfterScan=a,await this.sparkScan.notifyContext();}async setShouldDrawViewfinder(a){this._shouldDrawViewfinder=a,await this.sparkScan.notifyContext();}shouldShowScanAreaGuides(){return this._shouldShowScanAreaGuides}shouldRemoveLocationsAfterScan(){return this._shouldRemoveLocationsAfterScan}toJSONObject(){var a,r;return {type:this.type,brush:this._brush.toJSONObject(),errorBrush:(r=(a=this._errorBrush)==null?void 0:a.toJSONObject())!=null?r:this._brush.toJSONObject(),shouldShowScanAreaGuides:this._shouldShowScanAreaGuides,shouldRemoveLocationsAfterScan:this._shouldRemoveLocationsAfterScan,viewfinder:this._viewfinder.toJSONObject(),style:this.style,shouldDrawViewfinder:this._shouldDrawViewfinder}}};export{s as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d,e as e$1,a,c,g,f,h,i,n,o,j,k,l,m}from'./chunk-
|
|
1
|
+
import {d,e as e$1,a,c,g,f,h,i,n,o,j,k,l,m}from'./chunk-HFXWQGKV.js';import {Color}from'@scandit/web-datacapture-core';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var e=class e extends ScanditHTMLElement{constructor(){super();this._defaultBackgroundColor=Color.fromHex("#00FFFF");this._defaultTextColor=Color.fromHex("#000000");let t=this.attachShadow({mode:"open"});t.innerHTML=d(),t.append(e$1()),this.containerElement=t.querySelector(a),this.textElement=t.querySelector(c);}static create(){return e.register(),document.createElement(e.tag)}static register(){defineCustomElements({[e.tag]:e});}set icon(t){g(this,t);}get icon(){return f(this)}get backgroundColor(){return h(this,this._defaultBackgroundColor)}set backgroundColor(t){i(this,t);}get text(){return n(this.textElement)}set text(t){o(this.textElement,t);}get textColor(){return j(this,this._defaultTextColor)}set textColor(t){k(this,t);}get textSize(){return l(this)}set textSize(t){m(this,t);}connectedCallback(){this.backgroundColor=this.backgroundColor,this.textColor=this.textColor;}};e.tag="scandit-barcode-ar-info-annotation-header";var x=e;export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var s={"scandit-datacapture-sdk-barcode-simd.wasm":{bytes:6883305},"scandit-datacapture-sdk-barcode-simd-pthreads.wasm":{bytes:6999568},"scandit-datacapture-sdk-barcode-pthreads.wasm":{bytes:7058658},"scandit-datacapture-sdk-barcode.wasm":{bytes:6942671}};export{s as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {j,k}from'./chunk-DVHTYKDX.js';import {g}from'./chunk-YBD5JYCX.js';import {ScanditHTMLElement,css,defineCustomElements,safeAwaitAnimation}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var c=class n extends ScanditHTMLElement{constructor(){super(...arguments);this.styleElement=css`${g}{height:var(--dvh);left:0;opacity:0;pointer-events:none;position:absolute;top:0;user-select:none;width:var(--dvw)}${g}[success]{background:var(${j})}${g}[error]{background:var(${k})}`;}get success(){return this.hasAttribute("success")}set success(e){this.toggleAttribute("error",!e),this.toggleAttribute("success",e);}get error(){return this.hasAttribute("error")}set error(e){this.toggleAttribute("error",e),this.toggleAttribute("success",!e);}static create(){return defineCustomElements({[g]:n}),document.createElement(g)}async fadeIn(e,a){let i=this.animate([{opacity:"0"},{opacity:e}],{duration:a,easing:"linear"});await safeAwaitAnimation(i);}async fadeOut(e,a){let i=this.animate([{opacity:e},{opacity:"0"}],{duration:a,easing:"linear"});await safeAwaitAnimation(i);}async emitSuccessFeedback(){this.success=true,await this.fadeIn("1",200),await this.fadeOut("1",0);}async emitErrorFeedback(){this.error=true,await this.fadeIn("1",100),await this.fadeOut("1",100),await this.fadeIn("0.5",100),await this.fadeOut("0.5",0);}connectedCallback(){this.append(this.styleElement);}};export{c as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-OIFWCYQI.js';import {a}from'./chunk-CYVVGAZ4.js';import {ScanditHTMLElement,html,defineCustomElements,css}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var l=(e=>(e[e.Top="top-center"]="Top",e[e.Bottom="bottom-center"]="Bottom",e[e.Left="left-center"]="Left",e[e.Right="right-center"]="Right",e))(l||{}),r=class r extends ScanditHTMLElement{constructor(){super();this.isEntirePopoverTappable=false;this.annotationTrigger="highlightTap";this.onPointerUpListener=this.onPointerUp.bind(this);this.anchor=l.Bottom;let t=this.attachShadow({mode:"open"});t.innerHTML=html`<div class="container" role="group"><slot></slot></div>`,t.append(r.createStyleElement().cloneNode(true));}updatePosition(t,o,e){a(this,t,o,0);}get barcode(){return this._barcode}set barcode(t){this._barcode=t;}set direction(t){this.setAttribute("direction",t);}get direction(){var t;return (t=this.getAttribute("direction"))!=null?t:"horizontal"}static register(){defineCustomElements({[r.tag]:r});}static create(t){r.register();let o=document.createElement(r.tag);return o.barcode=t,o}static createStyleElement(){return css`:host{background-color:unset;border:none;border-radius:14px;margin:0;overflow:hidden;padding:0}:host([direction=horizontal]) .container{flex-direction:row}:host([direction=vertical]) .container{flex-direction:column}.container{backdrop-filter:blur(16px);background:#ffffffb3;box-shadow:0 6px 10px 4px #12161926;display:flex;gap:14px}`}connectedCallback(){let t=Array.from(this.querySelectorAll(a$1.tag));for(let[o,e]of Object.entries(t))e.setAttribute("data-position",o);this.addEventListener("pointerup",this.onPointerUpListener);}disconnectedCallback(){this.removeEventListener("pointerup",this.onPointerUpListener);}onPointerUp(t){var e,a,p,i,c;if(this.isEntirePopoverTappable){(a=(e=this.listener)==null?void 0:e.onPopoverTapped)==null||a.call(e,this);return}let o=(p=t.target)==null?void 0:p.closest(a$1.tag);o&&((c=(i=this.listener)==null?void 0:i.onPopoverButtonTapped)==null||c.call(i,this,o,Number(o.getAttribute("data-position"))));}};r.tag="scandit-barcode-ar-popover-annotation";var d=r;export{l as a,d as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-OCP2OI55.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&&r.libraryLocation&&(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:false})}}}export{b as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-QNZA644V.js';import {a}from'./chunk-IHTTMWUR.js';import {CameraSettings}from'@scandit/web-datacapture-core';import {warnMultithreadingUnavailable}from'@scandit/web-datacapture-core/build/js/private/utils/warnMultithreadingUnavailable.js';var o=class n{constructor(){this.type="barcodeTracking";this._isEnabled=true;this._context=null;this.listeners=[];this.privateListeners=new Set;this.workerMessageListener=this.onWorkerMessage.bind(this);}static get recommendedCameraSettings(){let e=new CameraSettings(b.BarcodeBatch.RecommendedCameraSettings);return e.setProperty("grayScaleFrameReader",true),e}get context(){return this._context}set context(e){this._context=e;}static async forContext(e,a){warnMultithreadingUnavailable();let t=new n;return t.settings=a,e!=null&&await e.addMode(t),t}isEnabled(){return this._isEnabled}async setEnabled(e){this._isEnabled=e,await this.notifyContext();}async applySettings(e){return this.settings=e,this.notifyContext()}addListener(e){this.listeners.includes(e)||this.listeners.push(e);}removeListener(e){this.listeners.includes(e)&&this.listeners.splice(this.listeners.indexOf(e),1);}toJSONObject(){return {type:this.type,enabled:this._isEnabled,settings:this.settings.toJSONObject()}}attachedToContext(e){this._context=e,this._context.subscribeToWorkerMessages(this.workerMessageListener);}detachedFromContext(){var e;(e=this._context)==null||e.unsubscribeToWorkerMessages(this.workerMessageListener),this._context=null;}addPrivateListener(e){this.privateListeners.add(e);}removePrivateListener(e){this.privateListeners.delete(e);}async onWorkerMessage(e){var a$1;switch(e.type){case "barcodeBatchDidUpdateSession":{{let t=a.fromJSON(e.payload);if(!this._isEnabled)return;for(let r of [...this.privateListeners,...this.listeners])r.didUpdateSession&&r.didUpdateSession(this,t);}break}case "didTapTrackedBarcode":{for(let t of this.privateListeners)(a$1=t.didTapTrackedBarcode)==null||a$1.call(t,e.payload);break}}}async notifyContext(){if(this.context)return this.context.update()}};export{o as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-XGY5EQR4.js';import {ScanditHTMLElement,html,defineCustomElements,css}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';import {Card}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/Card.js';import {CardList,CardListEvents}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/CardList.js';var l="cubic-bezier(0.4, 0, 0.2, 1)",L=(n=>(n.TextForCollapseCardsButton="text-for-collapse-cards-button",n))(L||{}),i=class i extends ScanditHTMLElement{constructor(){super();this.onCarListTapHandler=this.onCarListTap.bind(this);this.onCardListWillExpandHandler=this.onCardListWillExpand.bind(this);this.onCarouselButtonClickHandler=this.onCarouselButtonClick.bind(this);this.textNode=document.createTextNode("");let t=this.attachShadow({mode:"open"});t.append(i.createStyleElement().cloneNode(true));let s=document.createElement("div");s.id="root",s.innerHTML=html`
|
|
2
2
|
<${a.tag} class="hide">
|
|
3
3
|
</${a.tag}>
|
|
4
4
|
<${CardList.tag} collapsed></${CardList.tag}>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import {css}from'@scandit/web-datacapture-core/build/js/private/utils/css.js';function e(){return css`[class*=arw-]:after{border-color:#0000;border-style:solid;content:" ";height:0;pointer-events:none;position:absolute;width:0}.arw-bottom-center:after{border-top-color:var(--arrow-background-color);border-width:var(--arrow-size);left:50%;top:100%;transform:translate(-50%)}.arw-top-center:after{border-bottom-color:var(--arrow-background-color);border-width:var(--arrow-size);left:50%;top:0;transform:translate(-50%,-100%)}.arw-right-center:after{border-left-color:var(--arrow-background-color);border-width:var(--arrow-size);right:0;top:50%;transform:translate(100%,-50%)}.arw-left-center:after{border-right-color:var(--arrow-background-color);border-width:var(--arrow-size);left:0;top:50%;transform:translate(-100%,-50%)}`}export{e as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-XS6RV73B.js';import {b}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-XS6RV73B.js';import {b}from'./chunk-QNZA644V.js';import {CameraSettings,convertToPublicFrameData,Logger}from'@scandit/web-datacapture-core';var p=class c{constructor(){this.type="sparkScan";this._synchronousFrameFlow=false;this._isEnabled=true;this._isSuppressed=false;this._context=null;this.listeners=new Set;this.allowedRemainingWorkerMessages=new Set;this.workerMessageListener=this.onWorkerMessage.bind(this);}static get recommendedCameraSettings(){return new CameraSettings(b.SparkScan.CameraSettings.settings)}get context(){return this._context}static forSettings(e){let a=new c;return a.settings=e,a}isEnabled(){return this._isEnabled&&!this._isSuppressed}async setEnabled(e){this._isEnabled=e,await this.notifyContext();}async setResultSuppressionEnabled(e){this._isSuppressed=e,await this.notifyContext();}async applySettings(e){return this.settings=e,this.notifyContext()}addListener(e){this.listeners.add(e);}removeListener(e){this.listeners.delete(e);}toJSONObject(){return {type:this.type,enabled:this._isEnabled,settings:this.settings.toJSONObject(),isSuppressed:this._isSuppressed}}async workerCommand(e,a){this.context&&await this.context.workerCommand(e,a);}attachedToContext(e){this._context=e,this._context.subscribeToWorkerMessages(this.workerMessageListener);}async detachedFromContext(){var e;(e=this._context)==null||e.unsubscribeToWorkerMessages(this.workerMessageListener),this._context=null;}sendClearFrameDataRequest(e){queueMicrotask(()=>{var a;console.log("sendClearFrameDataRequest: queueMicrotask"),(a=this.context)==null||a.workerCommand("deleteFrameData",{frameId:e});});}async onDidScan(e){if(this.context==null)return;let{frameData:a$1}=e.payload;if(!this._isEnabled){this.sendClearFrameDataRequest(a$1.frameId),this.allowedRemainingWorkerMessages.clear();return}this.allowedRemainingWorkerMessages.add("successFeedback");let t=[],s=a.fromJSON(e.payload.session);for(let r of this.listeners)if(r.didScan)try{let i=r.didScan(this,s,convertToPublicFrameData(a$1,this.context));i instanceof Promise&&await i;}catch(i){t.push(i);}this.sendClearFrameDataRequest(a$1.frameId),this.allowedRemainingWorkerMessages.add("sparkScanDidUpdateSession");for(let r of t)Logger.error(r);}onDidUpdateSession(e){var t;if(!this._isEnabled&&!this.allowedRemainingWorkerMessages.has(e.type))return;this.allowedRemainingWorkerMessages.delete(e.type);let a$1=a.fromJSON(e.payload);for(let s of this.listeners)(t=s.didUpdateSession)==null||t.call(s,this,a$1);}async onWorkerMessage(e){switch(e.type){case "sparkScanDidScan":{this.onDidScan(e);break}case "sparkScanDidUpdateSession":{this.onDidUpdateSession(e);break}}}async notifyContext(){this.context&&await this.context.update();}};export{p as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$4}from'./chunk-ZQ3QRLEZ.js';import {a as a$1}from'./chunk-C3BYC73L.js';import {a as a$2}from'./chunk-62I36ZHW.js';import {b}from'./chunk-WXR7X3J5.js';import {a as a$6}from'./chunk-RWDAYBTQ.js';import {a as a$5,c,e,f,g,h,i,j,k,b as b$1,d as d$2}from'./chunk-DVHTYKDX.js';import {n,j as j$1,i as i$1,d as d$1,c as c$1,k as k$1,l,m,f as f$1,b as b$2,e as e$1,g as g$1}from'./chunk-4JEIREAU.js';import {d}from'./chunk-YBD5JYCX.js';import {a as a$3}from'./chunk-YZS4FYM4.js';import {a}from'./chunk-P4F5WUAR.js';import {Point,CameraPosition,Color}from'@scandit/web-datacapture-core';import {OrientationObserver,orientationChangeEvent}from'@scandit/web-datacapture-core/build/js/private/OrientationObserver.js';import {ScanditHTMLElement,Timeout,defineCustomElements,css,clamp}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var _=class v extends ScanditHTMLElement{constructor(){super(...arguments);this.targetModeButtonVisible=false;this.scanningBehaviorButtonVisible=false;this.torchControlVisible=true;this.zoomSwitchControlVisible=true;this.previewSizeControlVisible=true;this.barcodeFindButtonVisible=false;this.labelCaptureButtonVisible=false;this.cameraSwitchButtonVisible=false;this.previewCloseControlVisible=true;this.triggerButtonVisible=true;this.feedbackDelegate={getFeedbackForBarcode:()=>a.success()};this.torchButtonVisible=true;this.handModeButtonVisible=false;this.resizeObserver=null;this.onResizeHandler=this.onResize.bind(this);this.miniPreview=b.create();this.triggerButton=a$1.create();this.visualFeedback=a$2.create();this.miniPreviewTimeout=new Timeout(500,this.onMiniPreviewTimeoutFinished.bind(this));this.orientationObserver=new OrientationObserver;this.miniPreviewPointerUpListener=this.onMiniPreviewPointerUp.bind(this);this.miniPreviewPointerMoveListener=this.onMiniPreviewPointerMove.bind(this);this.miniPreviewButtonTapListener=this.onMiniPreviewButtonTap.bind(this);this.miniPreviewDragListener=this.onMiniPreviewDrag.bind(this);this.miniPreviewDragEndListener=this.onMiniPreviewDragEnd.bind(this);this.triggerButtonPointerDownListener=this.onTriggerButtonPointerDown.bind(this);this.triggerButtonTapListener=this.onTriggerButtonTap.bind(this);this.triggerButtonLongPressStartListener=this.onTriggerButtonLongPressStart.bind(this);this.triggerButtonLongPressEndListener=this.onTriggerButtonLongPressEnd.bind(this);this.triggerButtonDragListener=this.onTriggerButtonDrag.bind(this);this.toolbarButtonTapListener=this.onToolbarButtonTap.bind(this);this.clickOutsideListener=this.onClickOutside.bind(this);this.visibilityChangeListener=this.onVisibilityChange.bind(this);this.orientationChangeListener=this.onOrientationChange.bind(this);this.holdingToScan=false;}get _targetModeEnabledMessage(){var e;return (e=this.settings.toastSettings.targetModeEnabledMessage)!=null?e:"Aimer on"}get _targetModeDisabledMessage(){var e;return (e=this.settings.toastSettings.targetModeDisabledMessage)!=null?e:"Aimer off"}get _continuousModeEnabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeEnabledMessage)!=null?e:"Continuous mode on"}get _continuousModeDisabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeDisabledMessage)!=null?e:"Continuous mode off"}get _scanPausedMessage(){var e;return (e=this.settings.toastSettings.scanPausedMessage)!=null?e:"Scan paused"}get _torchEnabledMessage(){var e;return (e=this.settings.toastSettings.torchEnabledMessage)!=null?e:"Torch on"}get _torchDisabledMessage(){var e;return (e=this.settings.toastSettings.torchDisabledMessage)!=null?e:"Torch off"}get _zoomedInMessage(){var e;return (e=this.settings.toastSettings.zoomedInMessage)!=null?e:"2x zoom"}get _zoomedOutMessage(){var e;return (e=this.settings.toastSettings.zoomedOutMessage)!=null?e:"1x zoom"}static forElement(e,r,t,i){let n=v.create();return n.presenter=a$3.forView(n,r,t,i!=null?i:new a$4),n.settings=n.presenter.sparkScanViewSettings,n.append(n.miniPreview,n.triggerButton,n.visualFeedback,v.createStyleElement().cloneNode(true)),n.hidden=true,e.append(n),n}static create(){return defineCustomElements({[d]:v}),document.createElement("spark-scan-view")}static createStyleElement(){return css`:root{${a$5}:#12161966;${c}:#12161966;${e}:#5b707f4d;${f}:#fff;${g}:#121619cc;${h}:#fbc02c;${i}:#fff;${j}:#2ec1ce;${k}:#fa4446}${d}{position:relative}`}async prepareScanning(){this.mount(),this.hidden=false,await this.presenter.prepareScanning(this.miniPreview.host);}async startScanning(){await this.presenter.startScanning();}async pauseScanning(){await this.presenter.pauseScanning();}async stopScanning(){await this.presenter.stopScanning({sessionStopReason:"user"});}showToast(e){this.miniPreview.showToast("info",e,1e3);}setListener(e){this.presenter.setListener(e);}setTriggerButtonImage(e){this.triggerButton.setImage(e);}setWidthAndHeightCssStyleProperties(){var t,i;let e=((t=this.parentElement)==null?void 0:t.clientWidth)||document.body.clientWidth,r=((i=this.parentElement)==null?void 0:i.clientHeight)||document.body.clientHeight;this.style.setProperty("--dvw",`${e}px`),this.style.setProperty("--dvh",`${r}px`),this.style.setProperty("--dvw-half","calc(var(--dvw) / 2)"),this.style.setProperty("--dvh-half","calc(var(--dvh) / 2)");}onResize(){this.setWidthAndHeightCssStyleProperties(),this.triggerButton.repositionIfOutOfBounds(),this.miniPreview.repositionIfOutOfBounds();}mount(){this.unmount(),this.resizeObserver=new ResizeObserver(this.onResizeHandler),this.resizeObserver.observe(this.parentElement),this.miniPreview[n]=this.previewCloseControlVisible,this.miniPreview[j$1]=this.previewSizeControlVisible,this.miniPreview[i$1]=this.zoomSwitchControlVisible,this.miniPreview.size=this.settings.defaultMiniPreviewSize,this.miniPreview.toolbar&&(this.miniPreview.toolbar[d$1]=this.targetModeButtonVisible,this.miniPreview.toolbar[c$1]=this.scanningBehaviorButtonVisible,this.miniPreview.toolbar[k$1]=this.barcodeFindButtonVisible,this.miniPreview.toolbar[l]=this.labelCaptureButtonVisible,this.miniPreview.toolbar[m]=this.cameraSwitchButtonVisible),this.triggerButton.visible=this.triggerButtonVisible;for(let[e$1,r]of [[this.triggerButtonCollapsedColor,a$5],[this.triggerButtonExpandedColor,c],[this.triggerButtonAnimationColor,e],[this.triggerButtonTintColor,f],[this.toolbarBackgroundColor,g],[this.toolbarIconActiveTintColor,h],[this.toolbarIconInactiveTintColor,i]])e$1&&this.style.setProperty(r,`#${e$1.toJSON()}`);this.setTriggerButtonPressedColor("triggerButtonCollapsedColor",a$5,b$1),this.setTriggerButtonPressedColor("triggerButtonExpandedColor",c,d$2),this.miniPreview.addEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.addEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.addEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.addEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.addEventListener("drag",this.miniPreviewDragListener),this.miniPreview.addEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.addEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.addEventListener("tap",this.triggerButtonTapListener),this.triggerButton.addEventListener("longpressstart",this.triggerButtonLongPressStartListener),this.triggerButton.addEventListener("longpressend",this.triggerButtonLongPressEndListener),this.triggerButton.addEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.register(),this.orientationObserver.addEventListener(orientationChangeEvent,this.orientationChangeListener),this.orientationObserver.dispatchOrientationChangeEvent(this.orientationObserver.orientation),document.addEventListener("pointerup",this.clickOutsideListener),document.addEventListener("visibilitychange",this.visibilityChangeListener),this.setWidthAndHeightCssStyleProperties();}unmount(){var e;(e=this.resizeObserver)==null||e.disconnect(),this.miniPreview.removeEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.removeEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.removeEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.removeEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.removeEventListener("drag",this.miniPreviewDragListener),this.miniPreview.removeEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.removeEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.removeEventListener("tap",this.triggerButtonTapListener),this.triggerButton.removeEventListener("holdstart",this.triggerButtonLongPressStartListener),this.triggerButton.removeEventListener("holdend",this.triggerButtonLongPressEndListener),this.triggerButton.removeEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(orientationChangeEvent,this.orientationChangeListener),document.removeEventListener("pointerup",this.clickOutsideListener),document.removeEventListener("visibilitychange",this.visibilityChangeListener),this.miniPreviewTimeout.stop();}connectedCallback(){this.mount();}disconnectedCallback(){this.unmount();}setTorchAvailable(e){this.miniPreview.toolbar&&(this.miniPreview[f$1]=this.torchControlVisible&&e);}setZoomAvailable(e){this.miniPreview[i$1]=this.zoomSwitchControlVisible&&e;}switchToIdleState(){this.miniPreview.darkened=false,this.miniPreview.visible=false,this.miniPreview.hideToast(),this.triggerButton.expanded=false,this.triggerButton.stopPulsating();}async switchToActiveState(e,r,t,i){this.miniPreviewTimeout.stop(),this.miniPreview.hideToast(),this.miniPreview.cancelFadeOut(),this.miniPreview.darkened=false,this.miniPreview.visible=true,this.triggerButton.expanded=true,this.triggerButton.startPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=r),e&&(t&&this.style.setProperty(j,`#${t.toJSON()}`),await this.visualFeedback.emitSuccessFeedback()),i===true&&this.miniPreview.showToast("warning",this._zoomedInMessage,1e3);}async switchToInactiveState(e,r,t,i){this.miniPreview.darkened=t==="persistent"||e,this.miniPreview.visible=t==="persistent"||e,this.triggerButton.expanded=true,this.triggerButton.stopPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=r),e&&(i&&this.style.setProperty(j,`#${i.toJSON()}`),await this.visualFeedback.emitSuccessFeedback(),t==="default"&&this.miniPreviewTimeout.start()),t==="persistent"&&this.miniPreview.showToast("warning",this._scanPausedMessage,Number.POSITIVE_INFINITY);}async switchToErrorState(e,r){e.resumeCapturingDelay>0&&(this.triggerButton.stopPulsating(),this.miniPreview.showToast("error",e.message,e.resumeCapturingDelay)),r&&(this.style.setProperty(k,`#${e.visualFeedbackColor.toJSON()}`),await this.visualFeedback.emitErrorFeedback());}async onMiniPreviewPointerUp(){await this.presenter.onMiniPreviewPointerUp();}onMiniPreviewPointerMove(){this.presenter.onMiniPreviewPointerMove();}async onMiniPreviewButtonTap(e){switch(e.detail.tapped){case "torchButton":{await this.presenter.onTorchButtonTap(e.detail.enabled);break}case "closeButton":{await this.presenter.onMiniPreviewCloseButtonTap();break}case "resizeButton":{this.presenter.onMiniPreviewResizeButtonTap();break}case "zoomButton":{await this.presenter.onMiniPreviewZoomButtonTap(e.detail.zoomFactor);break}}this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}async onMiniPreviewDrag(e){e instanceof a$6&&await this.presenter.onMiniPreviewDrag(e.point,this.orientationObserver.orientation.type);}async onMiniPreviewDragEnd(e){e instanceof a$6&&await this.presenter.onMiniPreviewDragEnd();}async onTriggerButtonPointerDown(){await this.presenter.onTriggerButtonPointerDown();}async onTriggerButtonTap(){await this.presenter.onTriggerButtonTap();}async onTriggerButtonLongPressStart(){this.holdingToScan||(this.holdingToScan=true,await this.presenter.onTriggerButtonLongPressStart());}async onTriggerButtonLongPressEnd(){this.holdingToScan&&(this.holdingToScan=false,await this.presenter.onTriggerButtonLongPressEnd());}onTriggerButtonDrag(e){e instanceof a$6&&this.presenter.onTriggerButtonDrag(e.point,this.orientationObserver.orientation.type);}async onToolbarButtonTap(e){switch(this.miniPreview.rewindAnimation(),e.detail.tapped){case "targetModeButton":{await this.onTargetModeButtonTap(e);return}case "scanningBehaviorButton":{await this.onScanningBehaviorButtonTap(e);return}case "barcodeFindButton":{await this.onBarcodeFindButtonTap();return}case "labelCaptureButton":{await this.onLabelCaptureButtonTap();return}case "cameraSwitchButton":await this.onCameraSwitchButtonTap();}}async onClickOutside(e){e.composedPath().includes(this)||await this.presenter.onClickOutside();}async onVisibilityChange(){document.visibilityState==="hidden"&&await this.presenter.onVisibilityChange();}async onTargetModeButtonTap(e){await this.presenter.onTargetModeButtonTap(e.detail.enabled);}async onScanningBehaviorButtonTap(e){await this.presenter.onScanningBehaviorButtonTap(e.detail.enabled);}async onBarcodeFindButtonTap(){await this.presenter.onBarcodeFindButtonTap();}async onLabelCaptureButtonTap(){await this.presenter.onLabelCaptureButtonTap();}async onCameraSwitchButtonTap(){this.miniPreview[f$1]=false,await this.presenter.onCameraSwitchButtonTap();}async onTorchButtonTap(e){await this.presenter.onTorchButtonTap(e.detail.enabled);}async onMiniPreviewTimeoutFinished(){await this.miniPreview.fadeOut();}async onOrientationChange(e){this.setWidthAndHeightCssStyleProperties(),this.miniPreview.orientation=e.detail.type;let r,t,i,n;switch(e.detail.type){case "landscape-primary":case "landscape-secondary":{r=this.presenter.landscapeOrientationTriggerButtonTranslateX,t=this.presenter.landscapeOrientationTriggerButtonTranslateY,i=this.presenter.landscapeOrientationMiniPreviewTranslateX,n=this.presenter.landscapeOrientationMiniPreviewTranslateY;break}case "portrait-primary":case "portrait-secondary":{r=this.presenter.portraitOrientationTriggerButtonTranslateX,t=this.presenter.portraitOrientationTriggerButtonTranslateY,i=this.presenter.portraitOrientationMiniPreviewTranslateX,n=this.presenter.portraitOrientationMiniPreviewTranslateY;break}}this.triggerButton.translateTo(new Point(r,t)),this.miniPreview.translateTo(new Point(i,n)),await this.presenter.onOrientationChange();}targetModeButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._targetModeEnabledMessage:this._targetModeDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[e$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}scanningBehaviorButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._continuousModeEnabledMessage:this._continuousModeDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=e?"continuous":"single"),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}torchButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._torchEnabledMessage:this._torchDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview[g$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}cameraSwitchButtonTapped(e,r){var t;this.miniPreview[f$1]=this.torchControlVisible&&e,(t=this.miniPreview.toolbar)==null||t.enableCameraSwitchButton(r===CameraPosition.UserFacing);}getDefaultCssVariableValue(e){return window.getComputedStyle(this).getPropertyValue(e)}setTriggerButtonPressedColor(e,r,t){var B;let i=(B=this[e])!=null?B:Color.fromHex(this.getDefaultCssVariableValue(r)),n=clamp(i.alpha+i.alpha*.25,i.alpha,255),U=i.withAlpha(n);this.style.setProperty(t,`#${U.toJSON()}`);}};export{_ as a};
|
|
1
|
+
import {a as a$1}from'./chunk-O7GNCGRU.js';import {a as a$2}from'./chunk-6KWMOMD7.js';import {b}from'./chunk-YCZLNTKQ.js';import {a as a$6}from'./chunk-2ASAIH4R.js';import {a as a$5,c,e,f,g,h,i,j,k,b as b$1,d as d$2}from'./chunk-DVHTYKDX.js';import {n,j as j$1,i as i$1,d as d$1,c as c$1,k as k$1,l,m,f as f$1,b as b$2,e as e$1,g as g$1}from'./chunk-4JEIREAU.js';import {d}from'./chunk-YBD5JYCX.js';import {a as a$3}from'./chunk-PTTL56CB.js';import {a as a$4}from'./chunk-QD4KRTNG.js';import {a}from'./chunk-ORLJNUNA.js';import {Point,CameraPosition,Color}from'@scandit/web-datacapture-core';import {OrientationObserver,orientationChangeEvent}from'@scandit/web-datacapture-core/build/js/private/OrientationObserver.js';import {ScanditHTMLElement,Timeout,defineCustomElements,css,clamp}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var _=class v extends ScanditHTMLElement{constructor(){super(...arguments);this.targetModeButtonVisible=false;this.scanningBehaviorButtonVisible=false;this.torchControlVisible=true;this.zoomSwitchControlVisible=true;this.previewSizeControlVisible=true;this.barcodeFindButtonVisible=false;this.labelCaptureButtonVisible=false;this.cameraSwitchButtonVisible=false;this.previewCloseControlVisible=true;this.triggerButtonVisible=true;this.feedbackDelegate={getFeedbackForBarcode:()=>a.success()};this.torchButtonVisible=true;this.handModeButtonVisible=false;this.resizeObserver=null;this.onResizeHandler=this.onResize.bind(this);this.miniPreview=b.create();this.triggerButton=a$1.create();this.visualFeedback=a$2.create();this.miniPreviewTimeout=new Timeout(500,this.onMiniPreviewTimeoutFinished.bind(this));this.orientationObserver=new OrientationObserver;this.miniPreviewPointerUpListener=this.onMiniPreviewPointerUp.bind(this);this.miniPreviewPointerMoveListener=this.onMiniPreviewPointerMove.bind(this);this.miniPreviewButtonTapListener=this.onMiniPreviewButtonTap.bind(this);this.miniPreviewDragListener=this.onMiniPreviewDrag.bind(this);this.miniPreviewDragEndListener=this.onMiniPreviewDragEnd.bind(this);this.triggerButtonPointerDownListener=this.onTriggerButtonPointerDown.bind(this);this.triggerButtonTapListener=this.onTriggerButtonTap.bind(this);this.triggerButtonLongPressStartListener=this.onTriggerButtonLongPressStart.bind(this);this.triggerButtonLongPressEndListener=this.onTriggerButtonLongPressEnd.bind(this);this.triggerButtonDragListener=this.onTriggerButtonDrag.bind(this);this.toolbarButtonTapListener=this.onToolbarButtonTap.bind(this);this.clickOutsideListener=this.onClickOutside.bind(this);this.visibilityChangeListener=this.onVisibilityChange.bind(this);this.orientationChangeListener=this.onOrientationChange.bind(this);this.holdingToScan=false;}get _targetModeEnabledMessage(){var e;return (e=this.settings.toastSettings.targetModeEnabledMessage)!=null?e:"Aimer on"}get _targetModeDisabledMessage(){var e;return (e=this.settings.toastSettings.targetModeDisabledMessage)!=null?e:"Aimer off"}get _continuousModeEnabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeEnabledMessage)!=null?e:"Continuous mode on"}get _continuousModeDisabledMessage(){var e;return (e=this.settings.toastSettings.continuousModeDisabledMessage)!=null?e:"Continuous mode off"}get _scanPausedMessage(){var e;return (e=this.settings.toastSettings.scanPausedMessage)!=null?e:"Scan paused"}get _torchEnabledMessage(){var e;return (e=this.settings.toastSettings.torchEnabledMessage)!=null?e:"Torch on"}get _torchDisabledMessage(){var e;return (e=this.settings.toastSettings.torchDisabledMessage)!=null?e:"Torch off"}get _zoomedInMessage(){var e;return (e=this.settings.toastSettings.zoomedInMessage)!=null?e:"2x zoom"}get _zoomedOutMessage(){var e;return (e=this.settings.toastSettings.zoomedOutMessage)!=null?e:"1x zoom"}static forElement(e,r,t,i){let n=v.create();return n.presenter=a$3.forView(n,r,t,i!=null?i:new a$4),n.settings=n.presenter.sparkScanViewSettings,n.append(n.miniPreview,n.triggerButton,n.visualFeedback,v.createStyleElement().cloneNode(true)),n.hidden=true,e.append(n),n}static create(){return defineCustomElements({[d]:v}),document.createElement("spark-scan-view")}static createStyleElement(){return css`:root{${a$5}:#12161966;${c}:#12161966;${e}:#5b707f4d;${f}:#fff;${g}:#121619cc;${h}:#fbc02c;${i}:#fff;${j}:#2ec1ce;${k}:#fa4446}${d}{position:relative}`}async prepareScanning(){this.mount(),this.hidden=false,await this.presenter.prepareScanning(this.miniPreview.host);}async startScanning(){await this.presenter.startScanning();}async pauseScanning(){await this.presenter.pauseScanning();}async stopScanning(){await this.presenter.stopScanning({sessionStopReason:"user"});}showToast(e){this.miniPreview.showToast("info",e,1e3);}setListener(e){this.presenter.setListener(e);}setTriggerButtonImage(e){this.triggerButton.setImage(e);}setWidthAndHeightCssStyleProperties(){var t,i;let e=((t=this.parentElement)==null?void 0:t.clientWidth)||document.body.clientWidth,r=((i=this.parentElement)==null?void 0:i.clientHeight)||document.body.clientHeight;this.style.setProperty("--dvw",`${e}px`),this.style.setProperty("--dvh",`${r}px`),this.style.setProperty("--dvw-half","calc(var(--dvw) / 2)"),this.style.setProperty("--dvh-half","calc(var(--dvh) / 2)");}onResize(){this.setWidthAndHeightCssStyleProperties(),this.triggerButton.repositionIfOutOfBounds(),this.miniPreview.repositionIfOutOfBounds();}mount(){this.unmount(),this.resizeObserver=new ResizeObserver(this.onResizeHandler),this.resizeObserver.observe(this.parentElement),this.miniPreview[n]=this.previewCloseControlVisible,this.miniPreview[j$1]=this.previewSizeControlVisible,this.miniPreview[i$1]=this.zoomSwitchControlVisible,this.miniPreview.size=this.settings.defaultMiniPreviewSize,this.miniPreview.toolbar&&(this.miniPreview.toolbar[d$1]=this.targetModeButtonVisible,this.miniPreview.toolbar[c$1]=this.scanningBehaviorButtonVisible,this.miniPreview.toolbar[k$1]=this.barcodeFindButtonVisible,this.miniPreview.toolbar[l]=this.labelCaptureButtonVisible,this.miniPreview.toolbar[m]=this.cameraSwitchButtonVisible),this.triggerButton.visible=this.triggerButtonVisible;for(let[e$1,r]of [[this.triggerButtonCollapsedColor,a$5],[this.triggerButtonExpandedColor,c],[this.triggerButtonAnimationColor,e],[this.triggerButtonTintColor,f],[this.toolbarBackgroundColor,g],[this.toolbarIconActiveTintColor,h],[this.toolbarIconInactiveTintColor,i]])e$1&&this.style.setProperty(r,`#${e$1.toJSON()}`);this.setTriggerButtonPressedColor("triggerButtonCollapsedColor",a$5,b$1),this.setTriggerButtonPressedColor("triggerButtonExpandedColor",c,d$2),this.miniPreview.addEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.addEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.addEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.addEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.addEventListener("drag",this.miniPreviewDragListener),this.miniPreview.addEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.addEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.addEventListener("tap",this.triggerButtonTapListener),this.triggerButton.addEventListener("longpressstart",this.triggerButtonLongPressStartListener),this.triggerButton.addEventListener("longpressend",this.triggerButtonLongPressEndListener),this.triggerButton.addEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.register(),this.orientationObserver.addEventListener(orientationChangeEvent,this.orientationChangeListener),this.orientationObserver.dispatchOrientationChangeEvent(this.orientationObserver.orientation),document.addEventListener("pointerup",this.clickOutsideListener),document.addEventListener("visibilitychange",this.visibilityChangeListener),this.setWidthAndHeightCssStyleProperties();}unmount(){var e;(e=this.resizeObserver)==null||e.disconnect(),this.miniPreview.removeEventListener("pointerup",this.miniPreviewPointerUpListener),this.miniPreview.removeEventListener("pointermove",this.miniPreviewPointerMoveListener),this.miniPreview.removeEventListener("minipreviewbuttontap",this.miniPreviewButtonTapListener),this.miniPreview.removeEventListener("toolbarbuttontap",this.toolbarButtonTapListener),this.miniPreview.removeEventListener("drag",this.miniPreviewDragListener),this.miniPreview.removeEventListener("dragend",this.miniPreviewDragEndListener),this.triggerButton.removeEventListener("pointerdown",this.triggerButtonPointerDownListener),this.triggerButton.removeEventListener("tap",this.triggerButtonTapListener),this.triggerButton.removeEventListener("holdstart",this.triggerButtonLongPressStartListener),this.triggerButton.removeEventListener("holdend",this.triggerButtonLongPressEndListener),this.triggerButton.removeEventListener("drag",this.triggerButtonDragListener),this.orientationObserver.unregister(),this.orientationObserver.removeEventListener(orientationChangeEvent,this.orientationChangeListener),document.removeEventListener("pointerup",this.clickOutsideListener),document.removeEventListener("visibilitychange",this.visibilityChangeListener),this.miniPreviewTimeout.stop();}connectedCallback(){this.mount();}disconnectedCallback(){this.unmount();}setTorchAvailable(e){this.miniPreview.toolbar&&(this.miniPreview[f$1]=this.torchControlVisible&&e);}setZoomAvailable(e){this.miniPreview[i$1]=this.zoomSwitchControlVisible&&e;}switchToIdleState(){this.miniPreview.darkened=false,this.miniPreview.visible=false,this.miniPreview.hideToast(),this.triggerButton.expanded=false,this.triggerButton.stopPulsating();}async switchToActiveState(e,r,t,i){this.miniPreviewTimeout.stop(),this.miniPreview.hideToast(),this.miniPreview.cancelFadeOut(),this.miniPreview.darkened=false,this.miniPreview.visible=true,this.triggerButton.expanded=true,this.triggerButton.startPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=r),e&&(t&&this.style.setProperty(j,`#${t.toJSON()}`),await this.visualFeedback.emitSuccessFeedback()),i===true&&this.miniPreview.showToast("warning",this._zoomedInMessage,1e3);}async switchToInactiveState(e,r,t,i){this.miniPreview.darkened=t==="persistent"||e,this.miniPreview.visible=t==="persistent"||e,this.triggerButton.expanded=true,this.triggerButton.stopPulsating(),this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=r),e&&(i&&this.style.setProperty(j,`#${i.toJSON()}`),await this.visualFeedback.emitSuccessFeedback(),t==="default"&&this.miniPreviewTimeout.start()),t==="persistent"&&this.miniPreview.showToast("warning",this._scanPausedMessage,Number.POSITIVE_INFINITY);}async switchToErrorState(e,r){e.resumeCapturingDelay>0&&(this.triggerButton.stopPulsating(),this.miniPreview.showToast("error",e.message,e.resumeCapturingDelay)),r&&(this.style.setProperty(k,`#${e.visualFeedbackColor.toJSON()}`),await this.visualFeedback.emitErrorFeedback());}async onMiniPreviewPointerUp(){await this.presenter.onMiniPreviewPointerUp();}onMiniPreviewPointerMove(){this.presenter.onMiniPreviewPointerMove();}async onMiniPreviewButtonTap(e){switch(e.detail.tapped){case "torchButton":{await this.presenter.onTorchButtonTap(e.detail.enabled);break}case "closeButton":{await this.presenter.onMiniPreviewCloseButtonTap();break}case "resizeButton":{this.presenter.onMiniPreviewResizeButtonTap();break}case "zoomButton":{await this.presenter.onMiniPreviewZoomButtonTap(e.detail.zoomFactor);break}}this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}async onMiniPreviewDrag(e){e instanceof a$6&&await this.presenter.onMiniPreviewDrag(e.point,this.orientationObserver.orientation.type);}async onMiniPreviewDragEnd(e){e instanceof a$6&&await this.presenter.onMiniPreviewDragEnd();}async onTriggerButtonPointerDown(){await this.presenter.onTriggerButtonPointerDown();}async onTriggerButtonTap(){await this.presenter.onTriggerButtonTap();}async onTriggerButtonLongPressStart(){this.holdingToScan||(this.holdingToScan=true,await this.presenter.onTriggerButtonLongPressStart());}async onTriggerButtonLongPressEnd(){this.holdingToScan&&(this.holdingToScan=false,await this.presenter.onTriggerButtonLongPressEnd());}onTriggerButtonDrag(e){e instanceof a$6&&this.presenter.onTriggerButtonDrag(e.point,this.orientationObserver.orientation.type);}async onToolbarButtonTap(e){switch(this.miniPreview.rewindAnimation(),e.detail.tapped){case "targetModeButton":{await this.onTargetModeButtonTap(e);return}case "scanningBehaviorButton":{await this.onScanningBehaviorButtonTap(e);return}case "barcodeFindButton":{await this.onBarcodeFindButtonTap();return}case "labelCaptureButton":{await this.onLabelCaptureButtonTap();return}case "cameraSwitchButton":await this.onCameraSwitchButtonTap();}}async onClickOutside(e){e.composedPath().includes(this)||await this.presenter.onClickOutside();}async onVisibilityChange(){document.visibilityState==="hidden"&&await this.presenter.onVisibilityChange();}async onTargetModeButtonTap(e){await this.presenter.onTargetModeButtonTap(e.detail.enabled);}async onScanningBehaviorButtonTap(e){await this.presenter.onScanningBehaviorButtonTap(e.detail.enabled);}async onBarcodeFindButtonTap(){await this.presenter.onBarcodeFindButtonTap();}async onLabelCaptureButtonTap(){await this.presenter.onLabelCaptureButtonTap();}async onCameraSwitchButtonTap(){this.miniPreview[f$1]=false,await this.presenter.onCameraSwitchButtonTap();}async onTorchButtonTap(e){await this.presenter.onTorchButtonTap(e.detail.enabled);}async onMiniPreviewTimeoutFinished(){await this.miniPreview.fadeOut();}async onOrientationChange(e){this.setWidthAndHeightCssStyleProperties(),this.miniPreview.orientation=e.detail.type;let r,t,i,n;switch(e.detail.type){case "landscape-primary":case "landscape-secondary":{r=this.presenter.landscapeOrientationTriggerButtonTranslateX,t=this.presenter.landscapeOrientationTriggerButtonTranslateY,i=this.presenter.landscapeOrientationMiniPreviewTranslateX,n=this.presenter.landscapeOrientationMiniPreviewTranslateY;break}case "portrait-primary":case "portrait-secondary":{r=this.presenter.portraitOrientationTriggerButtonTranslateX,t=this.presenter.portraitOrientationTriggerButtonTranslateY,i=this.presenter.portraitOrientationMiniPreviewTranslateX,n=this.presenter.portraitOrientationMiniPreviewTranslateY;break}}this.triggerButton.translateTo(new Point(r,t)),this.miniPreview.translateTo(new Point(i,n)),await this.presenter.onOrientationChange();}targetModeButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._targetModeEnabledMessage:this._targetModeDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[e$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}scanningBehaviorButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._continuousModeEnabledMessage:this._continuousModeDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview.toolbar[b$2]=e?"continuous":"single"),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}torchButtonTapped(e,r=true){if(r){let t=e?"warning":"info",i=e?this._torchEnabledMessage:this._torchDisabledMessage;this.miniPreview.showToast(t,i,1e3);}this.miniPreview.toolbar&&(this.miniPreview[g$1]=e),this.miniPreviewTimeout.running&&this.miniPreviewTimeout.start();}cameraSwitchButtonTapped(e,r){var t;this.miniPreview[f$1]=this.torchControlVisible&&e,(t=this.miniPreview.toolbar)==null||t.enableCameraSwitchButton(r===CameraPosition.UserFacing);}getDefaultCssVariableValue(e){return window.getComputedStyle(this).getPropertyValue(e)}setTriggerButtonPressedColor(e,r,t){var B;let i=(B=this[e])!=null?B:Color.fromHex(this.getDefaultCssVariableValue(r)),n=clamp(i.alpha+i.alpha*.25,i.alpha,255),U=i.withAlpha(n);this.style.setProperty(t,`#${U.toJSON()}`);}};export{_ as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a as a$1,b as b$1}from'./chunk-HTKUJZG2.js';import {a
|
|
1
|
+
import {a as a$1,b as b$1}from'./chunk-HTKUJZG2.js';import {a}from'./chunk-ZWUKKWEI.js';import {a as a$2}from'./chunk-7JPCVI74.js';import {b}from'./chunk-QNZA644V.js';import {CameraSettings,convertToPublicFrameData}from'@scandit/web-datacapture-core';import {warnMultithreadingUnavailable}from'@scandit/web-datacapture-core/build/js/private/utils/warnMultithreadingUnavailable.js';var m=class u{constructor(){this.feedback=a.createDefaultFeedback();this.skipSerialization=true;this.type="barcodeFind";this._isEnabled=true;this._context=null;this.listeners=new Set;this.privateListeners=new Set;this.workerMessageListener=this.onWorkerMessage.bind(this);this._transformer=null;}static get recommendedCameraSettings(){let e=new CameraSettings(b.BarcodeFind.CameraSettings.settings);for(let[t,r]of Object.entries(b.BarcodeFind.CameraSettings.hiddenProperties))e.setProperty(t,r);return e}get context(){return this._context}get allListeners(){return [...this.privateListeners,...this.listeners]}static async forSettings(e){warnMultithreadingUnavailable();let t=new u;return t.settings=e,t}isEnabled(){return this._isEnabled}async setEnabled(e){var t;this._isEnabled=e,await this.workerCommand("barcodeFindSetEnabled",{enabled:e}),await((t=this.context)==null?void 0:t.update([{type:"modeEnabled",newValue:e}],{updateContext:false}));}async applySettings(e){this.settings=e,await this.workerCommand("barcodeFindApplySettings",{settings:e.toJSONObject()});}addListener(e){this.listeners.add(e);}removeListener(e){this.listeners.delete(e);}async setItemList(e){var t;for(let r of this.privateListeners)(t=r.onSetItemList)==null||t.call(r,e);return this.workerCommand("barcodeFindSetItemList",{itemList:e.map(r=>r.toJSONObject())})}async setBarcodeTransformer(e){var t;return this._transformer=e,this.workerCommand("barcodeFindSetTransformerFunction",{functionAsString:(t=this._transformer)==null?void 0:t.transformBarcodeData.toString()})}async start(){return this.workerCommand("barcodeFindSearchStart",{})}async stop(){return this.workerCommand("barcodeFindSearchStop",{})}async pause(){return this.workerCommand("barcodeFindSearchPause",{})}toJSONObject(){return {type:this.type,enabled:this.isEnabled(),settings:this.settings.toJSONObject()}}async workerCommand(e,t){this.context!=null&&await this.context.workerCommand(e,t);}async attachedToContext(e){this._context=e,this._context.subscribeToWorkerMessages(this.workerMessageListener),await this.workerCommand("barcodeFindForSettings",{settings:this.settings.toJSONObject()});}async detachedFromContext(){var e;await this.workerCommand("barcodeFindModeRemove",{}),(e=this._context)==null||e.unsubscribeToWorkerMessages(this.workerMessageListener),this._context=null;}async onWorkerMessage(e){var t,r,c;switch(e.type){case "barcodeFindDidUpdateSession":{if(this._context==null)return;for(let a of this.allListeners)(t=a.onDidUpdateSession)==null||t.call(a,this,a$2.fromJSON(e.payload.session),convertToPublicFrameData(e.payload.frameData,this._context));break}case "barcodeFindSearchPaused":{for(let a of this.allListeners){let i=e.payload.foundItems.map(o=>new a$1(new b$1(o),null));a.didPauseSearch(i);}break}case "barcodeFindSearchStarted":{for(let a of this.allListeners)a.didStartSearch();break}case "barcodeFindSearchStopped":{for(let a of this.allListeners){let i=e.payload.foundItems.map(o=>new a$1(new b$1(o),null));a.didStopSearch(i);}break}case "barcodeFindListUpdatedFeedback":{for(let a of this.allListeners)(r=a.onFindListUpdatedFeedback)==null||r.call(a);break}case "barcodeFindFeedback":{for(let a of this.allListeners)(c=a.onFeedback)==null||c.call(a);break}}}addPrivateListener(e){this.privateListeners.add(e);}removePrivateListener(e){this.privateListeners.delete(e);}};export{m as a};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import {Color}from'@scandit/web-datacapture-core';import {html}from'@scandit/web-datacapture-core/build/js/private/utils/html.js';import {css}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var x=".container",u=".icon-text",m=".text";function f(){return html`<div class="container">
|
|
2
|
+
<div class="icon-text">
|
|
3
|
+
<slot name="barcode-icon"></slot>
|
|
4
|
+
<div class="text">Text</div>
|
|
5
|
+
</div>
|
|
6
|
+
</div>`}function g(){return css`:host{--background-color:#0000;--text-color:#000;--top-left-corner-radius:0px;--top-right-corner-radius:0px;--bottom-left-corner-radius:0px;--bottom-right-corner-radius:0px;--text-size:16px}.container{align-items:center;background-color:var(--background-color);border-radius:var(--top-left-corner-radius) var(--top-right-corner-radius) var(--bottom-right-corner-radius) var(--bottom-left-corner-radius);display:flex;flex-direction:row;justify-content:center;overflow:hidden;padding:.75rem;transition:.3s ease}.container.highlighted{opacity:.75}.icon-text{align-items:center;display:flex;gap:.5rem}.text{color:var(--text-color);font-size:var(--text-size);font-weight:600;width:100%}`}var c="[slot='barcode-icon']";function a(e){var t,o;return (o=(t=e.shadowRoot)==null?void 0:t.querySelector(c))==null?void 0:o.assignedElements()[0]}function T(e,t){let o=a(e);o!==t&&(o&&t==null&&o.remove(),t&&(t.slot="barcode-icon",e.append(t)));}function S(e,t){let o=e.style.getPropertyValue("--background-color");return o===""?t:Color.fromHex(o)}function E(e,t){e.style.setProperty("--background-color",`#${t.toJSON()}`);}function y(e,t){let o=e.style.getPropertyValue("--text-color");return o===""?t:Color.fromHex(o)}function C(e,t){e.style.setProperty("--text-color",`#${t.toJSON()}`);}function v(e){return Number.parseFloat(e.style.getPropertyValue("--text-size"))}function b(e,t){e.style.setProperty("--text-size",`${t}px`);}function L(e){var t;return (t=e.textContent)!=null?t:""}function H(e,t){e.textContent=t;}export{x as a,u as b,m as c,f as d,g as e,a as f,T as g,S as h,E as i,y as j,C as k,v as l,b as m,L as n,H as o};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-QNZA644V.js';import {NumberWithUnit}from'@scandit/web-datacapture-core';var i=class{constructor(){this.radius=new NumberWithUnit(b.SparkScan.SparkScanSettings.locationSelection.radius,b.SparkScan.SparkScanSettings.locationSelection.unit);this.type="targetAimer";}toJSONObject(){return {type:this.type,radius:this.radius.toJSONObject()}}};export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a as a$1}from'./chunk-D26TRBZS.js';import {b}from'./chunk-EWNVCDJ6.js';import {a}from'./chunk-7GFMLF25.js';import {CameraSettings,convertToPublicFrameData}from'@scandit/web-datacapture-core';import {warnMultithreadingUnavailable}from'@scandit/web-datacapture-core/build/js/private/utils/warnMultithreadingUnavailable.js';var o=class n{constructor(){this.skipSerialization=true;this.type="barcodeAr";this._isEnabled=true;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",true),e}set context(e){this._context=e;}get allListeners(){return [...this.privateListeners,...this.listeners]}static async forContext(e,t){warnMultithreadingUnavailable();let r=new n;return r.feedback=await a.createDefaultBarcodeArFeedback(),r.settings=t,await(e==null?void 0:e.addMode(r)),r}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){var t;this._isEnabled=e,await this.workerCommand("barcodeArSetEnabled",{enabled:e}),await((t=this.context)==null?void 0:t.update([{type:"modeEnabled",newValue:e}],{updateContext:false}));}async applySettings(e){this.settings=e,await this.workerCommand("barcodeArApplySettings",{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("barcodeArForSettings",{settings:this.settings.toJSONObject()});}async detachedFromContext(){var e;await this.workerCommand("barcodeArModeRemove",{}),(e=this._context)==null||e.unsubscribeToWorkerMessages(this.workerMessageListener),this._context=null;}async start(){return this.workerCommand("barcodeArSearchStart",{})}async stop(){return this.workerCommand("barcodeArSearchStop",{})}async pause(){return this.workerCommand("barcodeArSearchPause",{})}async workerCommand(e,t){this.context!=null&&await this.context.workerCommand(e,t);}addPrivateListener(e){this.privateListeners.add(e);}removePrivateListener(e){this.privateListeners.delete(e);}async onWorkerMessage(e){var t;switch(e.type){case "barcodeArDidUpdateSession":{if(!this._isEnabled||!this._context)return;for(let r of this.allListeners)(t=r.didUpdateSession)==null||t.call(r,this,a$1.fromJSON(e.payload.session),convertToPublicFrameData(e.payload.frameData,this._context));break}}}};export{o as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {b}from'./chunk-
|
|
1
|
+
import {b}from'./chunk-QNZA644V.js';var i=class{constructor(){this.properties={};this.symbologies={};}get enabledSymbologies(){return Object.keys(this.symbologies).filter(e=>this.symbologies[e].isEnabled)}settingsForSymbology(e){if(!this.symbologies[e]){let o=b.SymbologySettings[e];o._symbology=e,this.symbologies[e]=o;}return this.symbologies[e]}setProperty(e,o){this.properties[e]=o;}getProperty(e){return this.properties[e]}enableSymbologies(e){for(let o of e)this.enableSymbology(o,true);}enableSymbology(e,o){this.settingsForSymbology(e).isEnabled=o;}toJSONObject(){return {properties:this.properties,symbologies:Object.keys(this.symbologies).reduce((e,o)=>(e[o]=this.symbologies[o].toJSONObject(),e),{})}}};export{i as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-ZWUKKWEI.js';import {TorchState,Camera,FrameSourceState}from'@scandit/web-datacapture-core';var h=(t=>(t.Started="started",t.Paused="paused",t.Stopped="stopped",t))(h||{}),c=class{constructor(e,i,t,s,o){this.viewState="paused";this.barcodeFindViewUiListener=null;this.torchState=TorchState.Off;this.sessionState=null;this.barcodeFindView=e,this.barcodeFind=t,this.context=i,this.viewSettings=s,this.cameraSettings=o,t.feedback=a.createWithOptions(this.viewSettings.soundEnabled,this.viewSettings.hapticEnabled);}async prepare(){await this.barcodeFind.setEnabled(false),this.barcodeFind.addPrivateListener(this);let e=Camera.default;await this.context.setFrameSource(e),await this.context.frameSource.applySettings(this.cameraSettings),this.isTorchAvailable=await e.isTorchAvailable();}async dispose(){await this.context.removeMode(this.barcodeFind),this.barcodeFind.removePrivateListener(this);}async didPauseSearch(e){this.barcodeFindView.switchToPaused(Object.values(this.customerItemsListState),e);}async didStartSearch(){this.barcodeFindView.switchToStarted();}async didStopSearch(e){var i;(i=this.barcodeFindViewUiListener)==null||i.didTapFinishButton(e);}async onSetItemList(e){this.customerItemsListState=e.reduce((i,t)=>(i[t.searchOptions.barcodeData]=t,i),{}),this.barcodeFind.feedback.itemListUpdated.emit(),this.barcodeFindView.updateProgressBar(0,Object.values(this.customerItemsListState).length);}onDidUpdateSession(e,i,t){this.sessionState=i,this.barcodeFindView.updateProgressBar(this.sessionState.allFoundItems.length),this.barcodeFindView.renderDots(this.sessionState);}async onShutterButtonClicked(){this.viewState==="paused"||this.viewState==="stopped"?await this.startSearching():await this.pauseSearching();}async onTorchButtonClicked(){this.isTorchAvailable&&(await this.context.frameSource.setDesiredTorchState(this.torchState===TorchState.Off?TorchState.On:TorchState.Off),this.torchState=this.torchState===TorchState.Off?TorchState.On:TorchState.Off,this.barcodeFindView.toggleTorchIcon(this.torchState));}onDotClick(e){var t,s;let i=(t=this.sessionState)==null?void 0:t.trackedBarcodes[e];if(i!=null){let o=this.customerItemsListState[(s=i.barcode.data)!=null?s:""];this.barcodeFindView.moveCardOnTheFront(o);}}onFinishButtonClicked(){this.stopSearching();}onFindListUpdatedFeedback(){this.barcodeFind.feedback.itemListUpdated.emit();}onFeedback(){this.barcodeFind.feedback.found.emit(),this.barcodeFindView.setShutterButtonPulse(true);}async pauseSearching(){var e;this.viewState="paused",await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Standby)),await this.barcodeFind.setEnabled(false),await this.barcodeFind.pause(),this.barcodeFindView.setShutterButtonPulse(false);}async startSearching(){var e;this.viewState="started",await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.On)),await this.barcodeFind.setEnabled(true),await this.barcodeFind.start();}async stopSearching(){var e;this.viewState="stopped",await this.barcodeFind.setEnabled(false),await((e=this.context.frameSource)==null?void 0:e.switchToDesiredState(FrameSourceState.Off)),await this.barcodeFind.stop(),this.barcodeFindView.setShutterButtonPulse(false),this.sessionState=null;}};export{h as a,c as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-ZBWUSH2F.js';import {b}from'./chunk-
|
|
1
|
+
import {a}from'./chunk-ZBWUSH2F.js';import {b}from'./chunk-QNZA644V.js';import {Brush}from'@scandit/web-datacapture-core';var h=(a=>(a.Frame="frame",a.Dot="dot",a))(h||{}),o=class c{constructor(){this.type="barcodeTrackingBasic";this._style=b.BarcodeBatch.BarcodeBatchBasicOverlay.defaultStyle;this._shouldShowScanAreaGuides=false;this._brushesForBarcodes=new Map;}get style(){return this._style}get listener(){return this._listener}set listener(e){this._listener=e;}get brush(){return this._brush}static async withBarcodeBatch(e){return c.withBarcodeBatchForView(e,null)}static async withBarcodeBatchForView(e,a){return c.withBarcodeBatchForViewWithStyle(e,a,b.BarcodeBatch.BarcodeBatchBasicOverlay.defaultStyle)}static async withBarcodeBatchForViewWithStyle(e,a$1,s){let r=new c;return r.barcodeBatch=e,r._style=s,r._brush=new Brush(b.BarcodeBatch.BarcodeBatchBasicOverlay.styles[r.style].DefaultBrush.fillColor,b.BarcodeBatch.BarcodeBatchBasicOverlay.styles[r.style].DefaultBrush.strokeColor,b.BarcodeBatch.BarcodeBatchBasicOverlay.styles[r.style].DefaultBrush.strokeWidth),a$1&&await a$1.addOverlay(r),r.privateListener=new a(r),e.addPrivateListener(r.privateListener),r}async setBrush(e){this._brush=e,await this.barcodeBatch.notifyContext();}shouldShowScanAreaGuides(){return this._shouldShowScanAreaGuides}async setShouldShowScanAreaGuides(e){this._shouldShowScanAreaGuides=e,await this.barcodeBatch.notifyContext();}async setBrushForTrackedBarcode(e,a){this._brushesForBarcodes.set(a.identifier,e),await this.barcodeBatch.notifyContext();}async clearTrackedBarcodeBrushes(){this._brushesForBarcodes.clear(),await this.barcodeBatch.notifyContext();}toJSONObject(){return {type:this.type,brush:this._brush.toJSONObject(),shouldShowScanAreaGuides:this._shouldShowScanAreaGuides,style:this._style,brushesForBarcodes:[...this._brushesForBarcodes.entries()].reduce((e,[a,s])=>(e[a]=s.toJSONObject(),e),{})}}};export{h as a,o as b};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {d,e as e$1,a,c,g,f,h,i,n,o,j,k,l,m}from'./chunk-
|
|
1
|
+
import {d,e as e$1,a,c,g,f,h,i,n,o,j,k,l,m}from'./chunk-HFXWQGKV.js';import {Color}from'@scandit/web-datacapture-core';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/index.js';var e=class e extends ScanditHTMLElement{constructor(){super();this._defaultBackgroundColor=Color.fromHex("#000000");this._defaultTextColor=Color.fromHex("#FFFFFF");let t=this.attachShadow({mode:"open"});t.innerHTML=d(),t.append(e$1()),this.containerElement=t.querySelector(a),this.textElement=t.querySelector(c);}static create(){return e.register(),document.createElement(e.tag)}static register(){defineCustomElements({[e.tag]:e});}set icon(t){g(this,t);}get icon(){return f(this)}get backgroundColor(){return h(this,this._defaultBackgroundColor)}set backgroundColor(t){i(this,t);}get text(){return n(this.textElement)}set text(t){o(this.textElement,t);}get textColor(){return j(this,this._defaultTextColor)}set textColor(t){k(this,t);}get textSize(){return l(this)}set textSize(t){m(this,t);}connectedCallback(){this.backgroundColor=this.backgroundColor,this.textColor=this.textColor;}};e.tag="scandit-barcode-ar-info-annotation-footer";var x=e;export{x as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function a(r,...t){let e=document.createElement("template");return e.innerHTML=r.reduce((c,o,n)=>{let m=n<t.length?t[n]:"";return c+o+String(m)},""),e.content}export{a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import {a}from'./chunk-ZZQLFO35.js';import {a as a$8}from'./chunk-ZPCWOA3Y.js';import {a as a$7}from'./chunk-DQVSIMLI.js';import {b}from'./chunk-DGF7ODRH.js';import {a as a$a}from'./chunk-KMEGIFKL.js';import {a as a$5}from'./chunk-VU7W53X2.js';import {b as b$1}from'./chunk-RUJWPCWD.js';import {a as a$6}from'./chunk-JKO4EZPZ.js';import {a as a$9}from'./chunk-NDQSQK6H.js';import {a as a$1}from'./chunk-I53W7VSB.js';import {a as a$2}from'./chunk-EW4BAEBZ.js';import {a as a$4}from'./chunk-LKQMBRKB.js';import {a as a$3}from'./chunk-KICLFEZA.js';import {Anchor,DataCaptureView,Direction,Point,Size}from'@scandit/web-datacapture-core';import {Backdrop}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/Backdrop.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {css}from'@scandit/web-datacapture-core/build/js/private/utils/css.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {calculateArea,calculateWidth,calculateHeight}from'@scandit/web-datacapture-core/build/js/private/utils/quadrilateralUtils.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';var W={async highlightForBarcode(E,T){let t=a$a.create(E);T(t);}},c=class c extends ScanditHTMLElement{constructor(){super(...arguments);this.torchIconButton=null;this.cameraSwitchButton=null;this.zoomButton=null;this.onTorchButtonClickHandler=this.onTorchButtonClick.bind(this);this.onCameraSwitchButtonHandler=this.onCameraSwitchButtonClick.bind(this);this.onZoomButtonHandler=this.onZoomButtonClick.bind(this);this.onLayoutPointerDownHandler=this.onLayoutPointerDown.bind(this);this.onInfoAnnotationTapHandler=this.onInfoAnnotationTap.bind(this);this.pendingDeletionTimeout=null;}set shouldShowZoomControl(t){this.zoomButton&&(this.zoomButton.hidden=!t);}get shouldShowZoomControl(){return this.zoomButton===null?false:!this.zoomButton.hidden}set shouldShowCameraSwitchControl(t){this.cameraSwitchButton&&(this.cameraSwitchButton.hidden=!t);}get shouldShowCameraSwitchControl(){return this.cameraSwitchButton===null?false:!this.cameraSwitchButton.hidden}set shouldShowTorchControl(t){this.torchIconButton!==null&&(this.torchIconButton.hidden=!t);}get shouldShowTorchControl(){return this.torchIconButton===null?false:!this.torchIconButton.hidden}set torchControlPosition(t){var e;(e=this.torchIconButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopLeft:t}`);}get torchControlPosition(){var e,o;let t=(o=(e=this.torchIconButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopLeft:t.replace("controls-","")}set zoomControlPosition(t){var e;(e=this.zoomButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.BottomRight:t}`);}get zoomControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.BottomRight:t.replace("controls-","")}set cameraSwitchControlPosition(t){var e;(e=this.cameraSwitchButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopRight:t}`);}get cameraSwitchControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopRight:t.replace("controls-","")}static async createWithSettings(t,e,o,i,n){c.register();let r=document.createElement(c.tag);return r.barcodeArViewSettings=i,r.layout=a.create(),r.append(r.layout),a$1(t)?(r.dataCaptureView=t,r.dataCaptureView.containerElement.prepend(r),await t.setContext(e)):(r.dataCaptureView=await DataCaptureView.forContext(e),r.dataCaptureView.connectToElement(t),r.dataCaptureView.containerElement.prepend(r)),r.presenter=new a$2(r,e,o,i,n!=null?n:a$3.createRecommendedCameraSettings()),await r.presenter.prepare(),r}static async create(t,e,o){return c.createWithSettings(t,e,o,new a$4)}static register(){defineCustomElements({[a.tag]:a,[a$8.tag]:a$8,[a$7.tag]:a$7,[a$6.tag]:a$6,[c.tag]:c,[Backdrop.tag]:Backdrop,[a$5.tag]:a$5});}static createStyleElement(){return css`[data-could-be-deleted=true]{display:none!important}[data-on-foreground=true]{z-index:3}${c.tag}{inset:0;position:absolute;z-index:1}`}async start(){return this.presenter.startSearching()}async stop(){return this.presenter.stopSearching()}async pause(){return this.presenter.pauseSearching()}reset(){this.deletePendingViews(),this.deleteAllViews();}getNotificationPresenter(){return this.dataCaptureView.getNotificationPresenter()}toggleTorchIcon(t){this.torchIconButton!==null&&(this.torchIconButton.state=t);}onTorchButtonClick(){this.presenter.onTorchButtonClicked();}onCameraSwitchButtonClick(){this.presenter.onCameraSwitchButtonClicked();}onZoomButtonClick(){this.presenter.onZoomButtonClicked();}changeZoomButtonIcon(t){this.zoomButton&&(this.zoomButton.zoom=`${t}x`);}connectedCallback(){this.torchIconButton=a$6.create(),this.torchIconButton.slot=`controls-${this.torchControlPosition}`,this.torchIconButton.hidden=true,this.torchIconButton.addEventListener("pointerdown",this.onTorchButtonClickHandler),this.cameraSwitchButton=a$8.create(),this.cameraSwitchButton.slot=`controls-${this.cameraSwitchControlPosition}`,this.cameraSwitchButton.hidden=true,this.cameraSwitchButton.addEventListener("pointerdown",this.onCameraSwitchButtonHandler),this.zoomButton=a$7.create(),this.zoomButton.slot=`controls-${this.zoomControlPosition}`,this.zoomButton.hidden=true,this.zoomButton.addEventListener("pointerdown",this.onZoomButtonHandler),this.layout.append(this.torchIconButton,this.cameraSwitchButton,this.zoomButton),this.layout.addEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.addEventListener("BarcodeArInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.backdrop=Backdrop.create(),this.layout.append(this.backdrop),this.pendingDeletionTimeout=new Timeout(1e3,()=>{this.deletePendingViews();}),this.prepend(c.createStyleElement());}disconnectedCallback(){var t,e,o;this.deleteAllViews(),(t=this.torchIconButton)==null||t.removeEventListener("pointerdown",this.onTorchButtonClickHandler),(e=this.cameraSwitchButton)==null||e.removeEventListener("pointerdown",this.onCameraSwitchButtonHandler),(o=this.zoomButton)==null||o.removeEventListener("pointerdown",this.onZoomButtonHandler),this.layout.removeEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.removeEventListener("BarcodeArInfoAnnotationEventTap",this.onInfoAnnotationTapHandler);}isPopoverAnnotation(t){return t instanceof b}isAnnotation(t){var e;return ((e=t.dataset)==null?void 0:e.identifier)==null?false:t.dataset.identifier.endsWith("-annotation")}areMultiplePopoverAllowed(){for(let t of this.layout.querySelectorAll("[data-identifier$='-annotation']"))if(t&&this.isPopoverAnnotation(t)&&t.annotationTrigger==="highlightTapAndBarcodeScan")return true;return false}async onLayoutPointerDown(t){let e=t.target,o=e==null?void 0:e.closest("[data-identifier$='-highlight']"),i=e==null?void 0:e.closest(b.tag);if((o==null?void 0:o.dataset.id)!=null){await this.handleHighlightClick(o);return}if((i==null?void 0:i.dataset.id)!=null){await this.handleAnnotationClick(i);return}await this.handleClickOutside();}async handleHighlightClick(t){var o;this.presenter.emitTappedFeedback(),(o=this.listener)==null||o.didTapHighlightForBarcode(this.presenter.barcodeAr,t.barcode,t);let e=this.queryAnnotationByDataIdentifier(t.dataset.identifier.replace("-highlight",""));e&&(this.isPopoverAnnotation(e)?await this.handlePopoverHighlightClick(e,t):e.hidden=!e.hidden);}async handlePopoverHighlightClick(t,e){var o;if(!this.areMultiplePopoverAllowed()){let i=this.layout.querySelector(`${b.tag}[data-on-foreground="true"]`),n=(o=i==null?void 0:i.dataset.identifier)==null?void 0:o.replace("-annotation","-highlight"),r=this.layout.querySelector(`[data-identifier="${n}"]`);i!=null&&r!=null&&await this.hideBarcodeArPopover(i,r,false);}await this.toggleBarcodeArPopover(t,e);}async handleAnnotationClick(t){var i;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.toggleBarcodeArPopover(t,o);}async handleClickOutside(){var i;if(this.areMultiplePopoverAllowed())return;let t=this.layout.querySelector(`${b.tag}[data-on-foreground="true"]`);if(!t)return;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.hideBarcodeArPopover(t,o);}onInfoAnnotationTap(){this.presenter.emitTappedFeedback();}async showBarcodeArPopover(t,e){t.dataset.onForeground="true",t.hidden=false,e.dataset.onForeground="true",this.backdrop.open=true;}async hideBarcodeArPopover(t,e,o=true){t.dataset.onForeground="false",t.hidden=true,e&&(e.dataset.onForeground="false"),o&&this.hideBackdropIfNoPopovers();}hideBackdropIfNoPopovers(){[...this.layout.querySelectorAll(`${b.tag}`)].every(e=>e.hidden)&&(this.backdrop.open=false);}async toggleBarcodeArPopover(t,e){t.hidden?await this.showBarcodeArPopover(t,e):await this.hideBarcodeArPopover(t,e);}deleteAllViews(){for(let t of this.layout.querySelectorAll("[data-identifier]"))t.remove();}deletePendingViews(){for(let t of this.layout.querySelectorAll("[data-could-be-deleted='true']"))t.remove();this.hideBackdropIfNoPopovers();}identifierForHighlight(t){return `${t}-highlight`}identifierForAnnotation(t){return `${t}-annotation`}async onHighlightsOrAnnotationForTrackedBarcode(t){var e,o,i;await((o=(e=this.highlightProvider)!=null?e:W)==null?void 0:o.highlightForBarcode(t.barcode,async n=>this.onHighlight(t,n))),await((i=this.annotationProvider)==null?void 0:i.annotationForBarcode(t.barcode,async n=>this.onAnnotation(t,n)));}async onAnnotation(t,e){let o=e,i=a$9(t);this.updateExistingAnnotation(i)||(await this.setupNewAnnotation(o,i,t),this.updateAnnotationPosition(t,o));}updateExistingAnnotation(t){let e=this.queryAnnotationByDataId(t);return e?(e.dataset.couldBeDeleted="false",true):false}async setupNewAnnotation(t,e,o){if(t.dataset.id=e,t.dataset.identifier=this.identifierForAnnotation(o.identifier),t.hidden=true,this.layout.append(t),this.isPopoverAnnotation(t)){if(t.direction=Direction.Vertical,t.anchor==null&&(t.anchor="bottom-center"),this.areMultiplePopoverAllowed()||t.annotationTrigger==="highlightTapAndBarcodeScan"){let i=this.queryHighlightByDataId(e);i&&await this.showBarcodeArPopover(t,i);}}else t.hidden=t.annotationTrigger==="highlightTap";}getAnnotationVariationForQuad(t,e){let o=Math.max(0,Math.min(1,e)),i=t.anchorPositions,n=calculateArea(i),r=this.dataCaptureView.width,l=this.dataCaptureView.height,d=r*l;if(n<=0||d<=0)return 0;let u=n/d;return Math.max(0,Math.min(1,u))<=o?2:1}async onHighlight(t,e){let o=a$9(t),i=this.queryHighlightByDataId(o);i?i.dataset.couldBeDeleted="false":(e.dataset.id=o,e.dataset.identifier=this.identifierForHighlight(t.identifier),this.updateHighlightPosition(t,e),this.layout.append(e));}queryHighlightByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-highlight"]`)}queryAnnotationByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-annotation"]`)}queryHighlightByDataId(t){return this.layout.querySelector(`[data-identifier$="-highlight"][data-id="${t}"]`)}queryAnnotationByDataId(t){return this.layout.querySelector(`[data-identifier$="-annotation"][data-id="${t}"]`)}updateRemovedTrackedBarcodes(t){var i,n,r,l,d;let e=this.querySelectorAll("[data-identifier]");if(Object.keys(t.allTrackedBarcodes).length===0){for(let u of e)u.dataset.couldBeDeleted="true";(i=this.pendingDeletionTimeout)!=null&&i.running||(n=this.pendingDeletionTimeout)==null||n.start();return}let o=new Set(t.removedTrackedBarcodes);for(let u of e){let p=(r=u.dataset.identifier)==null?void 0:r.replace("-highlight","").replace("-annotation","");p!=null&&o.has(p)&&(u.dataset.couldBeDeleted="true");}(l=this.pendingDeletionTimeout)!=null&&l.running||(d=this.pendingDeletionTimeout)==null||d.start();}render(t){for(let[e,o]of Object.entries(t.allTrackedBarcodes)){t.addedTrackedBarcodes[e]!=null&&this.onHighlightsOrAnnotationForTrackedBarcode(o);let i=a$9(o),n=this.queryAnnotationByDataId(i),r=this.queryHighlightByDataId(i);r&&(this.updateBrushSize(r,o),this.updateHighlightPosition(o,r)),n&&this.updateAnnotationPosition(o,n,r);}this.updateRemovedTrackedBarcodes(t);}updateHighlightPosition(t,e,o="center"){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions),n=this.normalizedViewPointFromFrameAnchorPositions(i,o);e.updatePosition(n,new Point(-50,-50),this.calculateRotationAngle(i.topLeft,i.topRight));}updateBrushSize(t,e){if(t.width==null||t.height==null)return;let o=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(e.anchorPositions),i=Math.round(calculateWidth(o)),n=Math.round(calculateHeight(o));t.width!==i&&(t.width=i),t.height!==n&&(t.height=n);}getTransformOrigin(t){return {"top-center":new Point(-50,0),"bottom-center":new Point(-50,-100),"left-center":new Point(0,-50),"right-center":new Point(-100,-50)}[t]}calculateAnnotationPosition(t,e,o){var p,w;let n=t.orderVerticesByPosition(),r=this.normalizedViewPointFromFrameAnchorPositions(t,"center"),d={"bottom-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"topCenter");return new Point(s.x,s.y-7)},"top-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"bottomCenter");return new Point(s.x,s.y+7)},"right-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"centerLeft");return new Point(s.x-7,s.y)},"left-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"centerRight");return new Point(s.x+7,s.y)}}[e]();return o?o instanceof b$1?(p={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?p:d:(w={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?w:d:d}updateAnnotationPosition(t,e,o){let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions);if(e.anchor||(e.anchor="top-center"),e.annotationVariation!=null){let l=this.getAnnotationVariationForQuad(t,a$5.threshold);e.annotationVariation=l;}let n=this.getTransformOrigin(e.anchor),r=this.calculateAnnotationPosition(i,e.anchor,o);e.updatePosition(r,n,this.calculateRotationAngle(i.topLeft,i.topRight));}normalizedViewPointFromFrameAnchorPositions(t,e="center"){let o=this.presenter.currentCamera.getMirrorImageEnabled(),i=new Size(this.dataCaptureView.width,this.dataCaptureView.height);if(o){let r=t[{centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"}[e]];return Point.mirrorX(r,i)}return t[e]}calculateRotationAngle(t,e){let o=e.x-t.x,i=-(e.y-t.y),n=Math.atan2(i,o);return Math.round(n*(180/Math.PI))}};c.tag="scandit-barcode-ar-view";var k=c;export{k as a};
|
|
1
|
+
import {a}from'./chunk-ZZQLFO35.js';import {a as a$8}from'./chunk-ZPCWOA3Y.js';import {a as a$7}from'./chunk-DQVSIMLI.js';import {b}from'./chunk-B5IOSUX4.js';import {a as a$a}from'./chunk-KMEGIFKL.js';import {a as a$5}from'./chunk-RLKGZ42F.js';import {b as b$1}from'./chunk-RUJWPCWD.js';import {a as a$6}from'./chunk-JKO4EZPZ.js';import {a as a$1}from'./chunk-I53W7VSB.js';import {a as a$9}from'./chunk-NDQSQK6H.js';import {a as a$2}from'./chunk-R6OFE5ZZ.js';import {a as a$4}from'./chunk-LKQMBRKB.js';import {a as a$3}from'./chunk-IYA7GGQL.js';import {Anchor,DataCaptureView,Direction,Point,Size}from'@scandit/web-datacapture-core';import {Backdrop}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/Backdrop.js';import {ScanditHTMLElement}from'@scandit/web-datacapture-core/build/js/private/utils/ScanditHTMLElement.js';import {css}from'@scandit/web-datacapture-core/build/js/private/utils/css.js';import {defineCustomElements}from'@scandit/web-datacapture-core/build/js/private/utils/defineCustomElements.js';import {calculateArea,calculateWidth,calculateHeight}from'@scandit/web-datacapture-core/build/js/private/utils/quadrilateralUtils.js';import {Timeout}from'@scandit/web-datacapture-core/build/js/private/utils/timeout.js';var W={async highlightForBarcode(E,T){let t=a$a.create(E);T(t);}},c=class c extends ScanditHTMLElement{constructor(){super(...arguments);this.torchIconButton=null;this.cameraSwitchButton=null;this.zoomButton=null;this.onTorchButtonClickHandler=this.onTorchButtonClick.bind(this);this.onCameraSwitchButtonHandler=this.onCameraSwitchButtonClick.bind(this);this.onZoomButtonHandler=this.onZoomButtonClick.bind(this);this.onLayoutPointerDownHandler=this.onLayoutPointerDown.bind(this);this.onInfoAnnotationTapHandler=this.onInfoAnnotationTap.bind(this);this.pendingDeletionTimeout=null;}set shouldShowZoomControl(t){this.zoomButton&&(this.zoomButton.hidden=!t);}get shouldShowZoomControl(){return this.zoomButton===null?false:!this.zoomButton.hidden}set shouldShowCameraSwitchControl(t){this.cameraSwitchButton&&(this.cameraSwitchButton.hidden=!t);}get shouldShowCameraSwitchControl(){return this.cameraSwitchButton===null?false:!this.cameraSwitchButton.hidden}set shouldShowTorchControl(t){this.torchIconButton!==null&&(this.torchIconButton.hidden=!t);}get shouldShowTorchControl(){return this.torchIconButton===null?false:!this.torchIconButton.hidden}set torchControlPosition(t){var e;(e=this.torchIconButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopLeft:t}`);}get torchControlPosition(){var e,o;let t=(o=(e=this.torchIconButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopLeft:t.replace("controls-","")}set zoomControlPosition(t){var e;(e=this.zoomButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.BottomRight:t}`);}get zoomControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.BottomRight:t.replace("controls-","")}set cameraSwitchControlPosition(t){var e;(e=this.cameraSwitchButton)==null||e.setAttribute("slot",`controls-${t===Anchor.Center?Anchor.TopRight:t}`);}get cameraSwitchControlPosition(){var e,o;let t=(o=(e=this.zoomButton)==null?void 0:e.getAttribute("slot"))!=null?o:"";return t===""?Anchor.TopRight:t.replace("controls-","")}static async createWithSettings(t,e,o,i,n){c.register();let r=document.createElement(c.tag);return r.barcodeArViewSettings=i,r.layout=a.create(),r.append(r.layout),a$1(t)?(r.dataCaptureView=t,r.dataCaptureView.containerElement.prepend(r),await t.setContext(e)):(r.dataCaptureView=await DataCaptureView.forContext(e),r.dataCaptureView.connectToElement(t),r.dataCaptureView.containerElement.prepend(r)),r.presenter=new a$2(r,e,o,i,n!=null?n:a$3.createRecommendedCameraSettings()),await r.presenter.prepare(),r}static async create(t,e,o){return c.createWithSettings(t,e,o,new a$4)}static register(){defineCustomElements({[a.tag]:a,[a$8.tag]:a$8,[a$7.tag]:a$7,[a$6.tag]:a$6,[c.tag]:c,[Backdrop.tag]:Backdrop,[a$5.tag]:a$5});}static createStyleElement(){return css`[data-could-be-deleted=true]{display:none!important}[data-on-foreground=true]{z-index:3}${c.tag}{inset:0;position:absolute;z-index:1}`}async start(){return this.presenter.startSearching()}async stop(){return this.presenter.stopSearching()}async pause(){return this.presenter.pauseSearching()}reset(){this.deletePendingViews(),this.deleteAllViews();}getNotificationPresenter(){return this.dataCaptureView.getNotificationPresenter()}toggleTorchIcon(t){this.torchIconButton!==null&&(this.torchIconButton.state=t);}onTorchButtonClick(){this.presenter.onTorchButtonClicked();}onCameraSwitchButtonClick(){this.presenter.onCameraSwitchButtonClicked();}onZoomButtonClick(){this.presenter.onZoomButtonClicked();}changeZoomButtonIcon(t){this.zoomButton&&(this.zoomButton.zoom=`${t}x`);}connectedCallback(){this.torchIconButton=a$6.create(),this.torchIconButton.slot=`controls-${this.torchControlPosition}`,this.torchIconButton.hidden=true,this.torchIconButton.addEventListener("pointerdown",this.onTorchButtonClickHandler),this.cameraSwitchButton=a$8.create(),this.cameraSwitchButton.slot=`controls-${this.cameraSwitchControlPosition}`,this.cameraSwitchButton.hidden=true,this.cameraSwitchButton.addEventListener("pointerdown",this.onCameraSwitchButtonHandler),this.zoomButton=a$7.create(),this.zoomButton.slot=`controls-${this.zoomControlPosition}`,this.zoomButton.hidden=true,this.zoomButton.addEventListener("pointerdown",this.onZoomButtonHandler),this.layout.append(this.torchIconButton,this.cameraSwitchButton,this.zoomButton),this.layout.addEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.addEventListener("BarcodeArInfoAnnotationEventTap",this.onInfoAnnotationTapHandler),this.backdrop=Backdrop.create(),this.layout.append(this.backdrop),this.pendingDeletionTimeout=new Timeout(1e3,()=>{this.deletePendingViews();}),this.prepend(c.createStyleElement());}disconnectedCallback(){var t,e,o;this.deleteAllViews(),(t=this.torchIconButton)==null||t.removeEventListener("pointerdown",this.onTorchButtonClickHandler),(e=this.cameraSwitchButton)==null||e.removeEventListener("pointerdown",this.onCameraSwitchButtonHandler),(o=this.zoomButton)==null||o.removeEventListener("pointerdown",this.onZoomButtonHandler),this.layout.removeEventListener("pointerdown",this.onLayoutPointerDownHandler),this.layout.removeEventListener("BarcodeArInfoAnnotationEventTap",this.onInfoAnnotationTapHandler);}isPopoverAnnotation(t){return t instanceof b}isAnnotation(t){var e;return ((e=t.dataset)==null?void 0:e.identifier)==null?false:t.dataset.identifier.endsWith("-annotation")}areMultiplePopoverAllowed(){for(let t of this.layout.querySelectorAll("[data-identifier$='-annotation']"))if(t&&this.isPopoverAnnotation(t)&&t.annotationTrigger==="highlightTapAndBarcodeScan")return true;return false}async onLayoutPointerDown(t){let e=t.target,o=e==null?void 0:e.closest("[data-identifier$='-highlight']"),i=e==null?void 0:e.closest(b.tag);if((o==null?void 0:o.dataset.id)!=null){await this.handleHighlightClick(o);return}if((i==null?void 0:i.dataset.id)!=null){await this.handleAnnotationClick(i);return}await this.handleClickOutside();}async handleHighlightClick(t){var o;this.presenter.emitTappedFeedback(),(o=this.listener)==null||o.didTapHighlightForBarcode(this.presenter.barcodeAr,t.barcode,t);let e=this.queryAnnotationByDataIdentifier(t.dataset.identifier.replace("-highlight",""));e&&(this.isPopoverAnnotation(e)?await this.handlePopoverHighlightClick(e,t):e.hidden=!e.hidden);}async handlePopoverHighlightClick(t,e){var o;if(!this.areMultiplePopoverAllowed()){let i=this.layout.querySelector(`${b.tag}[data-on-foreground="true"]`),n=(o=i==null?void 0:i.dataset.identifier)==null?void 0:o.replace("-annotation","-highlight"),r=this.layout.querySelector(`[data-identifier="${n}"]`);i!=null&&r!=null&&await this.hideBarcodeArPopover(i,r,false);}await this.toggleBarcodeArPopover(t,e);}async handleAnnotationClick(t){var i;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.toggleBarcodeArPopover(t,o);}async handleClickOutside(){var i;if(this.areMultiplePopoverAllowed())return;let t=this.layout.querySelector(`${b.tag}[data-on-foreground="true"]`);if(!t)return;let e=(i=t.dataset.identifier)==null?void 0:i.replace("-annotation","-highlight"),o=this.layout.querySelector(`[data-identifier="${e}"]`);o&&await this.hideBarcodeArPopover(t,o);}onInfoAnnotationTap(){this.presenter.emitTappedFeedback();}async showBarcodeArPopover(t,e){t.dataset.onForeground="true",t.hidden=false,e.dataset.onForeground="true",this.backdrop.open=true;}async hideBarcodeArPopover(t,e,o=true){t.dataset.onForeground="false",t.hidden=true,e&&(e.dataset.onForeground="false"),o&&this.hideBackdropIfNoPopovers();}hideBackdropIfNoPopovers(){[...this.layout.querySelectorAll(`${b.tag}`)].every(e=>e.hidden)&&(this.backdrop.open=false);}async toggleBarcodeArPopover(t,e){t.hidden?await this.showBarcodeArPopover(t,e):await this.hideBarcodeArPopover(t,e);}deleteAllViews(){for(let t of this.layout.querySelectorAll("[data-identifier]"))t.remove();}deletePendingViews(){for(let t of this.layout.querySelectorAll("[data-could-be-deleted='true']"))t.remove();this.hideBackdropIfNoPopovers();}identifierForHighlight(t){return `${t}-highlight`}identifierForAnnotation(t){return `${t}-annotation`}async onHighlightsOrAnnotationForTrackedBarcode(t){var e,o,i;await((o=(e=this.highlightProvider)!=null?e:W)==null?void 0:o.highlightForBarcode(t.barcode,async n=>this.onHighlight(t,n))),await((i=this.annotationProvider)==null?void 0:i.annotationForBarcode(t.barcode,async n=>this.onAnnotation(t,n)));}async onAnnotation(t,e){let o=e,i=a$9(t);this.updateExistingAnnotation(i)||(await this.setupNewAnnotation(o,i,t),this.updateAnnotationPosition(t,o));}updateExistingAnnotation(t){let e=this.queryAnnotationByDataId(t);return e?(e.dataset.couldBeDeleted="false",true):false}async setupNewAnnotation(t,e,o){if(t.dataset.id=e,t.dataset.identifier=this.identifierForAnnotation(o.identifier),t.hidden=true,this.layout.append(t),this.isPopoverAnnotation(t)){if(t.direction=Direction.Vertical,t.anchor==null&&(t.anchor="bottom-center"),this.areMultiplePopoverAllowed()||t.annotationTrigger==="highlightTapAndBarcodeScan"){let i=this.queryHighlightByDataId(e);i&&await this.showBarcodeArPopover(t,i);}}else t.hidden=t.annotationTrigger==="highlightTap";}getAnnotationVariationForQuad(t,e){let o=Math.max(0,Math.min(1,e)),i=t.anchorPositions,n=calculateArea(i),r=this.dataCaptureView.width,l=this.dataCaptureView.height,d=r*l;if(n<=0||d<=0)return 0;let u=n/d;return Math.max(0,Math.min(1,u))<=o?2:1}async onHighlight(t,e){let o=a$9(t),i=this.queryHighlightByDataId(o);i?i.dataset.couldBeDeleted="false":(e.dataset.id=o,e.dataset.identifier=this.identifierForHighlight(t.identifier),this.updateHighlightPosition(t,e),this.layout.append(e));}queryHighlightByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-highlight"]`)}queryAnnotationByDataIdentifier(t){return this.layout.querySelector(`[data-identifier$="${t}-annotation"]`)}queryHighlightByDataId(t){return this.layout.querySelector(`[data-identifier$="-highlight"][data-id="${t}"]`)}queryAnnotationByDataId(t){return this.layout.querySelector(`[data-identifier$="-annotation"][data-id="${t}"]`)}updateRemovedTrackedBarcodes(t){var i,n,r,l,d;let e=this.querySelectorAll("[data-identifier]");if(Object.keys(t.allTrackedBarcodes).length===0){for(let u of e)u.dataset.couldBeDeleted="true";(i=this.pendingDeletionTimeout)!=null&&i.running||(n=this.pendingDeletionTimeout)==null||n.start();return}let o=new Set(t.removedTrackedBarcodes);for(let u of e){let p=(r=u.dataset.identifier)==null?void 0:r.replace("-highlight","").replace("-annotation","");p!=null&&o.has(p)&&(u.dataset.couldBeDeleted="true");}(l=this.pendingDeletionTimeout)!=null&&l.running||(d=this.pendingDeletionTimeout)==null||d.start();}render(t){for(let[e,o]of Object.entries(t.allTrackedBarcodes)){t.addedTrackedBarcodes[e]!=null&&this.onHighlightsOrAnnotationForTrackedBarcode(o);let i=a$9(o),n=this.queryAnnotationByDataId(i),r=this.queryHighlightByDataId(i);r&&(this.updateBrushSize(r,o),this.updateHighlightPosition(o,r)),n&&this.updateAnnotationPosition(o,n,r);}this.updateRemovedTrackedBarcodes(t);}updateHighlightPosition(t,e,o="center"){if(e.hidden)return;let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions),n=this.normalizedViewPointFromFrameAnchorPositions(i,o);e.updatePosition(n,new Point(-50,-50),this.calculateRotationAngle(i.topLeft,i.topRight));}updateBrushSize(t,e){if(t.width==null||t.height==null)return;let o=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(e.anchorPositions),i=Math.round(calculateWidth(o)),n=Math.round(calculateHeight(o));t.width!==i&&(t.width=i),t.height!==n&&(t.height=n);}getTransformOrigin(t){return {"top-center":new Point(-50,0),"bottom-center":new Point(-50,-100),"left-center":new Point(0,-50),"right-center":new Point(-100,-50)}[t]}calculateAnnotationPosition(t,e,o){var p,w;let n=t.orderVerticesByPosition(),r=this.normalizedViewPointFromFrameAnchorPositions(t,"center"),d={"bottom-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"topCenter");return new Point(s.x,s.y-7)},"top-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"bottomCenter");return new Point(s.x,s.y+7)},"right-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"centerLeft");return new Point(s.x-7,s.y)},"left-center":()=>{let s=this.normalizedViewPointFromFrameAnchorPositions(n,"centerRight");return new Point(s.x+7,s.y)}}[e]();return o?o instanceof b$1?(p={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?p:d:(w={"bottom-center":new Point(r.x,r.y-7-o.clientHeight/2),"top-center":new Point(r.x,r.y+7+o.clientHeight/2),"right-center":new Point(r.x-7-o.clientWidth/2,r.y),"left-center":new Point(r.x+7+o.clientWidth/2,r.y)}[e])!=null?w:d:d}updateAnnotationPosition(t,e,o){let i=this.dataCaptureView.viewAnchorPositionsForFrameAnchorPositions(t.anchorPositions);if(e.anchor||(e.anchor="top-center"),e.annotationVariation!=null){let l=this.getAnnotationVariationForQuad(t,a$5.threshold);e.annotationVariation=l;}let n=this.getTransformOrigin(e.anchor),r=this.calculateAnnotationPosition(i,e.anchor,o);e.updatePosition(r,n,this.calculateRotationAngle(i.topLeft,i.topRight));}normalizedViewPointFromFrameAnchorPositions(t,e="center"){let o=this.presenter.currentCamera.getMirrorImageEnabled(),i=new Size(this.dataCaptureView.width,this.dataCaptureView.height);if(o){let r=t[{centerLeft:"centerRight",centerRight:"centerLeft",center:"center",topCenter:"topCenter",bottomCenter:"bottomCenter"}[e]];return Point.mirrorX(r,i)}return t[e]}calculateRotationAngle(t,e){let o=e.x-t.x,i=-(e.y-t.y),n=Math.atan2(i,o);return Math.round(n*(180/Math.PI))}};c.tag="scandit-barcode-ar-view";var k=c;export{k as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {a as a$2}from'./chunk-
|
|
1
|
+
import {a as a$2}from'./chunk-M7AZ5E5Z.js';import {b as b$1}from'./chunk-5DP5VNWQ.js';import {a as a$1,b as b$3}from'./chunk-OPL5NVVM.js';import {b as b$2}from'./chunk-2ASAIH4R.js';import {a as a$3}from'./chunk-T2Y2C76P.js';import {e,f as f$1,a,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,safeCancelAnimation}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._longPressController=new b$1(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&&(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(){var t;this.append(this.render()),this._dragController=new b$2(this,(t=this.parentElement)==null?void 0:t.parentElement),this._dragController.connect(),this.addEventListener("pointerdown",this._pointerDownListener),this.addEventListener("pointerup",this._pointerUpListener),this.addEventListener("longpressstart",this._longPressStartListener),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(){var t;this.removeEventListener("pointerdown",this._pointerDownListener),this.removeEventListener("pointerup",this._pointerUpListener),this.removeEventListener("longpressstart",this._longPressStartListener),(t=this._dragController)==null||t.disconnect(),this._longPressController.disconnect(),this.innerHTML="";}repositionIfOutOfBounds(){var t;(t=this._dragController)==null||t.repositionIfOutOfBounds();}translateTo(t){var i;(i=this._dragController)==null||i.translateTo(t,false);}setImage(t){var n;let i=this.querySelector("div");(n=i.firstElementChild)==null||n.remove(),t&&i.append(t);}startPulsating(){var t;(t=this._pulseAnimation)==null||t.play();}stopPulsating(){this._pulseAnimation&&(safeCancelAnimation(this._pulseAnimation),this._pulseAnimation.currentTime=0);}render(){return a$2`
|
|
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">
|