@scandit/web-datacapture-label 8.5.2 → 8.6.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/js/{AdaptiveRecognitionResult-Clnk-SP8.d.ts → AdaptiveRecognitionResult-y66P3VQQ.d.ts} +224 -27
- package/build/js/{BarcodeField-CWg5Ve8v.d.ts → BarcodeField-DJn7-z-m.d.ts} +1 -2
- package/build/js/{BarcodeFieldBuilder-CSsj0EXY.d.ts → BarcodeFieldBuilder-C3ORgzp_.d.ts} +3 -4
- package/build/js/{Button-Ou77FlfL.d.ts → Button-BQw0QTaa.d.ts} +3 -2
- package/build/js/{CapturedLabel-PjFfeqht.d.ts → CapturedLabel-CxiHZPCl.d.ts} +1 -2
- package/build/js/Carrier-CjlU3MQ0.d.ts +38 -0
- package/build/js/{CustomBarcode-B9b3T3wr.d.ts → CustomBarcode-CDxDEuLW.d.ts} +2 -3
- package/build/js/{CustomBarcodeBuilder-DdWG8iCR.d.ts → CustomBarcodeBuilder-BbJ6y6wo.d.ts} +3 -4
- package/build/js/{CustomText-Cl2GuEWp.d.ts → CustomText-41Rtf4e7.d.ts} +3 -4
- package/build/js/{CustomTextBuilder-0AbdOASa.d.ts → CustomTextBuilder-Cx446FQo.d.ts} +3 -4
- package/build/js/{DateText-qQtIgcnZ.d.ts → DateText-wfiiLxGb.d.ts} +3 -4
- package/build/js/{DateTextBuilder-D4LModbR.d.ts → DateTextBuilder-hglQSv2l.d.ts} +3 -4
- package/build/js/{ExpiryDateText-DkTHW-n-.d.ts → ExpiryDateText-BtUI1uAf.d.ts} +3 -4
- package/build/js/{ExpiryDateTextBuilder-BGrTAbAB.d.ts → ExpiryDateTextBuilder-CGrQ7Hea.d.ts} +3 -4
- package/build/js/FieldId-BMwA9rgx.d.ts +32 -0
- package/build/js/{ImeiOneBarcode-d4T3iiT8.d.ts → ImeiOneBarcode-dhXCZMVi.d.ts} +1 -2
- package/build/js/{ImeiOneBarcodeBuilder-B9onIT76.d.ts → ImeiOneBarcodeBuilder-Bj3CjnCv.d.ts} +2 -3
- package/build/js/{ImeiTwoBarcode-DhmyWFV3.d.ts → ImeiTwoBarcode-Bm5fuVb-.d.ts} +1 -2
- package/build/js/{ImeiTwoBarcodeBuilder-JChbnrgN.d.ts → ImeiTwoBarcodeBuilder-CugRqyC8.d.ts} +2 -3
- package/build/js/{LabelCapture-BZi-QVCO.d.ts → LabelCapture-BsBYp-Tr.d.ts} +3 -4
- package/build/js/{LabelCaptureAdvancedOverlay-e09i_aoX.d.ts → LabelCaptureAdvancedOverlay-Bpt5QkPC.d.ts} +6 -6
- package/build/js/{LabelCaptureBasicOverlay-BZl1LJkD.d.ts → LabelCaptureBasicOverlay-CF4h_JL9.d.ts} +6 -7
- package/build/js/{LabelCaptureFeedback-Bc-zIaL_.d.ts → LabelCaptureFeedback-sBwE9pgJ.d.ts} +0 -1
- package/build/js/{LabelCaptureOverlayJSON-B6X3-JDh.d.ts → LabelCaptureOverlayJSON-B-Vo-158.d.ts} +1 -2
- package/build/js/{LabelCaptureSession-Dc8YZO9H.d.ts → LabelCaptureSession-lVHLczXv.d.ts} +1 -2
- package/build/js/{LabelCaptureSettings-D4GHiKnt.d.ts → LabelCaptureSettings-076qXEg4.d.ts} +1 -2
- package/build/js/LabelCaptureWorkerManager-AJWX-5XC.js +1 -0
- package/build/js/{LabelDateFormat-C9T5qNMc.d.ts → LabelDateFormat-2KViYUuq.d.ts} +1 -2
- package/build/js/{LabelDefinition-CAZoQj1a.d.ts → LabelDefinition-DEROTlBM.d.ts} +26 -27
- package/build/js/{LabelField-BAO35-Eb.d.ts → LabelField-b2ukZfup.d.ts} +6 -5
- package/build/js/{LabelFieldDefinitionBuilder-rN0LybgZ.d.ts → LabelFieldDefinitionBuilder-D-yf34AO.d.ts} +1 -2
- package/build/js/{LabelFieldLocation-DDqgTh17.d.ts → LabelFieldLocation-eoZD3v4d.d.ts} +0 -1
- package/build/js/{PackingDateText-DH3NkY_K.d.ts → PackingDateText-BxwiZ4HS.d.ts} +3 -4
- package/build/js/{PackingDateTextBuilder-Cay2b3Se.d.ts → PackingDateTextBuilder-CgWv_e2L.d.ts} +3 -4
- package/build/js/{PartNumberBarcode-Dzx1zF4O.d.ts → PartNumberBarcode-D2mysndM.d.ts} +1 -2
- package/build/js/{PartNumberBarcodeBuilder-Bwg9UTcy.d.ts → PartNumberBarcodeBuilder-CU5oArvT.d.ts} +2 -3
- package/build/js/{SerialNumberBarcode-DWBGJVoz.d.ts → SerialNumberBarcode-Ck2AEyxm.d.ts} +1 -2
- package/build/js/{SerialNumberBarcodeBuilder-oSUDdRsf.d.ts → SerialNumberBarcodeBuilder-BZRf4Jyp.d.ts} +2 -3
- package/build/js/{TextField-CTCb88lU.d.ts → TextField-B5ize0NE.d.ts} +1 -2
- package/build/js/{TextFieldBuilder-biW0vkn0.d.ts → TextFieldBuilder-CaffaBBH.d.ts} +1 -2
- package/build/js/{TotalPriceText-BydB0NCL.d.ts → TotalPriceText-CiOJFnt4.d.ts} +2 -3
- package/build/js/{TotalPriceTextBuilder-B8MK5Xjy.d.ts → TotalPriceTextBuilder-CDwYNGhA.d.ts} +2 -3
- package/build/js/{UnitPriceText-C7EwC-Go.d.ts → UnitPriceText-DMdoMIGG.d.ts} +2 -3
- package/build/js/{UnitPriceTextBuilder-Bc7dIZF4.d.ts → UnitPriceTextBuilder-B7fFpVja.d.ts} +2 -3
- package/build/js/{ValidationFlowField-DL7FdqPM.d.ts → ValidationFlowField-B8BG6AoW.d.ts} +1 -2
- package/build/js/{WeightText-DrWQ9nBI.d.ts → WeightText-xC0IyyPL.d.ts} +2 -3
- package/build/js/{WeightTextBuilder-BzG1seYF.d.ts → WeightTextBuilder-Bm1dmTp5.d.ts} +2 -3
- package/build/js/api/AdaptiveRecognitionMode.d.ts +1 -1
- package/build/js/api/AdaptiveRecognitionResult.d.ts +1 -1
- package/build/js/api/BarcodeField.d.ts +1 -1
- package/build/js/api/BarcodeFieldBuilder.d.ts +1 -1
- package/build/js/api/BarcodeFieldBuilder.js +1 -1
- package/build/js/api/CapturedLabel.d.ts +1 -1
- package/build/js/api/Carrier.d.ts +2 -0
- package/build/js/api/Carrier.js +1 -0
- package/build/js/api/CustomBarcode.d.ts +1 -1
- package/build/js/api/CustomBarcodeBuilder.d.ts +1 -1
- package/build/js/api/CustomText.d.ts +1 -1
- package/build/js/api/CustomTextBuilder.d.ts +1 -1
- package/build/js/api/DateText.d.ts +1 -1
- package/build/js/api/DateTextBuilder.d.ts +1 -1
- package/build/js/api/ExpiryDateText.d.ts +1 -1
- package/build/js/api/ExpiryDateTextBuilder.d.ts +1 -1
- package/build/js/api/ImeiOneBarcode.d.ts +1 -1
- package/build/js/api/ImeiOneBarcodeBuilder.d.ts +1 -1
- package/build/js/api/ImeiTwoBarcode.d.ts +1 -1
- package/build/js/api/ImeiTwoBarcodeBuilder.d.ts +1 -1
- package/build/js/api/LabelCapture.d.ts +1 -1
- package/build/js/api/LabelCapture.js +1 -1
- package/build/js/api/LabelCaptureAdaptiveRecognitionOverlay.d.ts +5 -5
- package/build/js/api/LabelCaptureAdaptiveRecognitionOverlay.js +1 -1
- package/build/js/api/LabelCaptureAdaptiveRecognitionSettings.d.ts +1 -1
- package/build/js/api/LabelCaptureAdaptiveRecognitionSettings.js +1 -1
- package/build/js/api/LabelCaptureAdvancedOverlay.d.ts +1 -1
- package/build/js/api/LabelCaptureAdvancedOverlay.js +1 -1
- package/build/js/api/LabelCaptureAdvancedOverlayListener.d.ts +1 -1
- package/build/js/api/LabelCaptureBasicOverlay.d.ts +1 -1
- package/build/js/api/LabelCaptureBasicOverlay.js +1 -1
- package/build/js/api/LabelCaptureBasicOverlayListener.d.ts +1 -1
- package/build/js/api/LabelCaptureFeedback.d.ts +1 -1
- package/build/js/api/LabelCaptureListener.d.ts +1 -1
- package/build/js/api/LabelCaptureOverlayJSON.d.ts +1 -1
- package/build/js/api/LabelCaptureSession.d.ts +1 -1
- package/build/js/api/LabelCaptureSettings.d.ts +1 -1
- package/build/js/api/LabelCaptureValidationFlow/LabelCaptureValidationFlowOverlay.d.ts +3 -4
- package/build/js/api/LabelCaptureValidationFlow/LabelCaptureValidationFlowOverlay.js +1 -1
- package/build/js/api/LabelCaptureValidationFlow/private/FieldId.d.ts +2 -0
- package/build/js/api/LabelCaptureValidationFlow/private/FieldId.js +1 -0
- package/build/js/api/LabelCaptureValidationFlow/private/ValidationFlowPresenter.d.ts +4 -5
- package/build/js/api/LabelCaptureValidationFlow/private/ValidationFlowPresenter.js +1 -1
- package/build/js/api/LabelCaptureValidationFlow/private/ValidationFlowStateManager.d.ts +14 -23
- package/build/js/api/LabelCaptureValidationFlow/private/ValidationFlowStateManager.js +1 -1
- package/build/js/api/LabelCaptureValidationFlow/private/ValidationFlowView.d.ts +2 -2
- package/build/js/api/LabelCaptureValidationFlow/private/ValidationFlowView.js +1 -1
- package/build/js/api/LabelCaptureValidationFlowFeedback.d.ts +0 -1
- package/build/js/api/LabelCaptureValidationFlowSettings.d.ts +0 -1
- package/build/js/api/LabelCaptureValidationFlowSettings.js +1 -1
- package/build/js/api/LabelDateComponentFormat.d.ts +1 -1
- package/build/js/api/LabelDateComponentFormat.js +1 -1
- package/build/js/api/LabelDateFormat.d.ts +1 -1
- package/build/js/api/LabelDateResult.d.ts +1 -1
- package/build/js/api/LabelDefinition.d.ts +1 -1
- package/build/js/api/LabelField.d.ts +1 -1
- package/build/js/api/LabelField.js +1 -1
- package/build/js/api/LabelFieldDefinition.d.ts +1 -1
- package/build/js/api/LabelFieldDefinitionBuilder.d.ts +1 -1
- package/build/js/api/LabelFieldLocation.d.ts +1 -1
- package/build/js/api/LabelFieldLocation.js +1 -1
- package/build/js/api/LabelFieldLocationType.js +1 -1
- package/build/js/api/LabelFieldState.d.ts +1 -1
- package/build/js/api/LabelFieldState.js +1 -1
- package/build/js/api/LabelFieldType.d.ts +1 -1
- package/build/js/api/LabelFieldType.js +1 -1
- package/build/js/api/LabelFieldValueType.d.ts +1 -1
- package/build/js/api/LabelFieldValueType.js +1 -1
- package/build/js/api/LabelResultUpdateType.js +1 -1
- package/build/js/api/PackingDateText.d.ts +1 -1
- package/build/js/api/PackingDateTextBuilder.d.ts +1 -1
- package/build/js/api/PartNumberBarcode.d.ts +1 -1
- package/build/js/api/PartNumberBarcodeBuilder.d.ts +1 -1
- package/build/js/api/PrivateReceiptScanningHandler.d.ts +6 -3
- package/build/js/api/PrivateReceiptScanningHandler.js +1 -1
- package/build/js/api/PrivateReceiptScanningListener.d.ts +12 -4
- package/build/js/api/PrivateValidationFlowHandler.d.ts +5 -6
- package/build/js/api/PrivateValidationFlowHandler.js +1 -1
- package/build/js/api/ReceiptScanningLineItem.d.ts +1 -1
- package/build/js/api/ReceiptScanningResult.d.ts +1 -1
- package/build/js/api/SerialNumberBarcode.d.ts +1 -1
- package/build/js/api/SerialNumberBarcodeBuilder.d.ts +1 -1
- package/build/js/api/ShippingLabelScanningResult.d.ts +2 -0
- package/build/js/api/ShippingLabelScanningResult.js +1 -0
- package/build/js/api/TextField.d.ts +1 -1
- package/build/js/api/TextFieldBuilder.d.ts +1 -1
- package/build/js/api/TotalPriceText.d.ts +1 -1
- package/build/js/api/TotalPriceTextBuilder.d.ts +1 -1
- package/build/js/api/UnitPriceText.d.ts +1 -1
- package/build/js/api/UnitPriceTextBuilder.d.ts +1 -1
- package/build/js/api/ValidationFlowField.d.ts +1 -1
- package/build/js/api/ValidationFlowField.js +1 -1
- package/build/js/api/WeightText.d.ts +1 -1
- package/build/js/api/WeightTextBuilder.d.ts +1 -1
- package/build/js/{dataCaptureEngine-CqE4l_uy.d.ts → dataCaptureEngine-Qn62h3C8.d.ts} +1 -2
- package/build/js/global.d.ts +5 -3
- package/build/js/index.d.ts +49 -48
- package/build/js/index.js +1 -1
- package/build/js/moduleLoader.d.ts +0 -1
- package/build/js/moduleLoader.js +1 -1
- package/build/js/{nativeCall-q32Awp0L.d.ts → nativeCall-BACigfoX.d.ts} +2 -3
- package/build/js/private/PrivateLabelFieldDefinition.d.ts +2 -3
- package/build/js/private/PrivateRectangularLocationSelectionJSON.d.ts +0 -1
- package/build/js/private/adaptiveRecognitionModeTranslator.d.ts +2 -3
- package/build/js/private/adaptiveRecognitionModeTranslator.js +1 -1
- package/build/js/private/brushTranslator.d.ts +2 -3
- package/build/js/private/carrierTranslator.d.ts +6 -0
- package/build/js/private/carrierTranslator.js +1 -0
- package/build/js/private/createProxiedViewFinder.d.ts +1 -2
- package/build/js/private/fromWrappedFutureToPromise.d.ts +1 -2
- package/build/js/private/labelFieldLocationTypeTranslator.d.ts +1 -2
- package/build/js/private/labelFieldLocationTypeTranslator.js +1 -1
- package/build/js/private/measureTranslator.d.ts +1 -2
- package/build/js/private/measureTranslator.js +1 -1
- package/build/js/private/numberTranslator.d.ts +1 -2
- package/build/js/private/numberTranslator.js +1 -1
- package/build/js/private/resultTypeTranslator.d.ts +6 -0
- package/build/js/private/resultTypeTranslator.js +1 -0
- package/build/js/private/scrollIntoView/compute.d.ts +1 -1
- package/build/js/private/scrollIntoView/index.d.ts +0 -1
- package/build/js/private/scrollIntoView/index.js +1 -1
- package/build/js/private/symbologiesTranslator.d.ts +1 -2
- package/build/js/private/symbologiesTranslator.js +1 -1
- package/build/js/private/viewfinderTranslator.d.ts +1 -2
- package/build/js/private/viewfinderTranslator.js +1 -1
- package/build/js/{sdcBarcodeData-DOuUPRUb.d.ts → sdcBarcodeData-CXuQyyJf.d.ts} +2 -3
- package/build/js/{sdcCoreCommonGeometry-Bxvlllkc.d.ts → sdcCoreCommonGeometry-CS1rDunH.d.ts} +2 -13
- package/build/js/{sdcCoreInternalSdkCommonAsync-8G3-3n53.d.ts → sdcCoreInternalSdkCommonAsync-DNIa_gEu.d.ts} +2 -3
- package/build/js/sdcCoreInternalSdkCommonGeometry-DfRpk9ff.d.ts +41 -0
- package/build/js/sdcCoreInternalSdkCommonGraphics-Br9oizuP.d.ts +9 -0
- package/build/js/sdcCoreInternalSdkUiStyle-DrsrRbqR.d.ts +9 -0
- package/build/js/{sdcCoreInternalSdkUiViewfinder-BoG0LyRj.d.ts → sdcCoreInternalSdkUiViewfinder-CS6t26-R.d.ts} +5 -18
- package/build/js/{sdcLabelData-CHLquvuG.d.ts → sdcLabelData-BitL7YVQ.d.ts} +2 -3
- package/build/js/{sdcLabelInternalModuleCapture-B6-1Wjzn.d.ts → sdcLabelInternalModuleCapture-LDFRDPMF.d.ts} +165 -54
- package/build/js/sdcLabelInternalModuleData-sZpfq0Gd.d.ts +149 -0
- package/build/js/symbologiesTranslator-kd0DbiBX.js +1 -0
- package/build/js/ui/atoms/AdaptiveRecognitionOverlay.d.ts +0 -1
- package/build/js/ui/atoms/Button.d.ts +1 -1
- package/build/js/ui/atoms/Button.js +1 -1
- package/build/js/ui/atoms/TextInput.d.ts +0 -1
- package/build/js/ui/atoms/TextInput.js +1 -1
- package/build/js/ui/controllers/KeyboardVisibilityController.d.ts +0 -1
- package/build/js/ui/organisms/LabelCaptureValidationFlowLayout.d.ts +3 -3
- package/build/js/umd/index.js +1 -0
- package/build/js/viewfinderTranslator-C6Uufw4a.js +1 -0
- package/build/js/vite-env.d.ts +1 -1
- package/build/js/worker/LabelCaptureWorkerManager.d.ts +2 -3
- package/build/js/worker/LabelCaptureWorkerManager.js +1 -1
- package/build/js/worker/NativeImplementationRegistry.d.ts +1 -2
- package/build/js/worker/WorkerMain.d.ts +4 -5
- package/build/js/worker/WorkerMain.js +1 -1
- package/build/js/worker/WorkerRegistry.d.ts +0 -1
- package/build/js/worker/dataCaptureEngine.d.ts +1 -1
- package/build/js/worker/dataCaptureEngine.js +1 -1
- package/build/js/worker/dataCaptureWorkerRelated.d.ts +2 -2
- package/build/js/worker/handlers/{ReceiptScanningHandler.d.ts → AdaptiveRecognitionHandler.d.ts} +5 -6
- package/build/js/worker/handlers/AdaptiveRecognitionHandler.js +1 -0
- package/build/js/worker/handlers/FieldBuilderHandler.d.ts +1 -2
- package/build/js/worker/handlers/FieldBuilderHandler.js +1 -1
- package/build/js/worker/handlers/LabelCaptureBasicOverlayHandler.d.ts +6 -4
- package/build/js/worker/handlers/LabelCaptureBasicOverlayHandler.js +1 -1
- package/build/js/worker/handlers/SettingsHandler.d.ts +1 -2
- package/build/js/worker/handlers/SettingsHandler.js +1 -1
- package/build/js/worker/handlers/ValidationFlowHandler.d.ts +1 -2
- package/build/js/worker/handlers/ValidationFlowHandler.js +1 -1
- package/build/js/worker/labelWorkerHandler.d.ts +0 -1
- package/build/js/worker/nativeCall.d.ts +1 -1
- package/build/js/worker/nativeDispatch.d.ts +1 -1
- package/build/js/worker/proxies/AdaptiveRecognitionHandlerProxy.d.ts +15 -0
- package/build/js/worker/proxies/AdaptiveRecognitionHandlerProxy.js +1 -0
- package/build/js/worker/proxies/AimerViewfinderProxy.d.ts +3 -4
- package/build/js/worker/proxies/AimerViewfinderProxy.js +1 -1
- package/build/js/worker/proxies/CapturedLabelProxy.d.ts +2 -3
- package/build/js/worker/proxies/CapturedLabelProxy.js +1 -1
- package/build/js/worker/proxies/LabelCaptureBasicOverlayProxy.d.ts +6 -8
- package/build/js/worker/proxies/LabelCaptureBasicOverlayProxy.js +1 -1
- package/build/js/worker/proxies/LabelCaptureSessionProxy.d.ts +2 -3
- package/build/js/worker/proxies/LabelCaptureSessionProxy.js +1 -1
- package/build/js/worker/proxies/LabelCaptureSettingsProxy.d.ts +2 -4
- package/build/js/worker/proxies/LabelCaptureSettingsProxy.js +1 -1
- package/build/js/worker/proxies/LabelDefinitionProxy.d.ts +3 -4
- package/build/js/worker/proxies/LabelDefinitionProxy.js +1 -1
- package/build/js/worker/proxies/LabelFieldDefinitionProxy.d.ts +2 -3
- package/build/js/worker/proxies/LabelFieldDefinitionProxy.js +1 -1
- package/build/js/worker/proxies/LabelFieldProxy.d.ts +3 -4
- package/build/js/worker/proxies/LabelFieldProxy.js +1 -1
- package/build/js/worker/proxies/NativeProxy.d.ts +1 -1
- package/build/js/worker/proxies/NativeProxy.js +1 -1
- package/build/js/worker/proxies/NoViewfinderProxy.d.ts +2 -3
- package/build/js/worker/proxies/NoViewfinderProxy.js +1 -1
- package/build/js/worker/proxies/RectangularViewfinderAnimationProxy.d.ts +2 -3
- package/build/js/worker/proxies/RectangularViewfinderAnimationProxy.js +1 -1
- package/build/js/worker/proxies/RectangularViewfinderProxy.d.ts +5 -6
- package/build/js/worker/proxies/RectangularViewfinderProxy.js +1 -1
- package/build/js/worker/proxies/ValidationFlowListenerProxy.d.ts +1 -3
- package/build/js/worker/proxies/base/BarcodeFieldProxyBase.d.ts +2 -4
- package/build/js/worker/proxies/base/LabelFieldDefinitionBaseProxy.d.ts +2 -3
- package/build/js/worker/proxies/base/LabelFieldDefinitionBaseProxy.js +1 -1
- package/build/js/worker/workerHandles.d.ts +1 -1
- package/package.json +12 -8
- package/sdc-lib/label-worker-8.6.0-beta.1.js +1 -0
- package/sdc-lib/resources/models/aus_mdl_keypoint_detection.1b3529e0e8a3.model +0 -0
- package/sdc-lib/resources/models/barcode_classification_default.5afae5235672.model +0 -0
- package/sdc-lib/resources/models/barcode_keypoints_oned.963fc43efda2.model +0 -0
- package/sdc-lib/resources/models/barcode_keypoints_twod.90548e549497.model +0 -0
- package/sdc-lib/resources/models/barcode_label_localization_mslc_model_s.cf4be2418f6d.model +0 -0
- package/sdc-lib/resources/models/barcode_label_localization_mslc_model_smartphone.d37117f6a058.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_clutter_aware.40a9ddd42447.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_default.67ae150de2e5.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_dpm_default.96d5335f10a1.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_generic_postal_code_default.3aff51b79974.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_oned_default.ca3e3afb3c45.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_twod_default.62d5ab2b650d.model +0 -0
- package/sdc-lib/resources/models/id_outline_localization_model_kpts.376104335628.model +0 -0
- package/sdc-lib/resources/models/mqr_model_1.f74eb91b2d3b.model +0 -0
- package/sdc-lib/resources/models/mqr_model_2.300660c7d3db.model +0 -0
- package/sdc-lib/resources/models/mrz_line_localization.6598e20b3c9e.model +0 -0
- package/sdc-lib/resources/models/mrz_localization.07beaad40bbd.model +0 -0
- package/sdc-lib/resources/models/ocr_attention.61cf55c1930f.model +0 -0
- package/sdc-lib/resources/models/ocr_attention_big.81959e2e4ef4.model +0 -0
- package/sdc-lib/resources/models/price_localization_in_whole_label.ef6641ccf26f.model +0 -0
- package/sdc-lib/resources/models/qr_model_1.d46cc8f45676.model +0 -0
- package/sdc-lib/resources/models/via_id_template_database.948ef137372d.model +0 -0
- package/sdc-lib/scandit-datacapture-sdk-label-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-label-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-label-simd-pthreads.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-label-simd-pthreads.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-label-simd.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-label-simd.wasm +0 -0
- package/sdc-lib/scandit-datacapture-sdk-label.js +1 -1
- package/sdc-lib/scandit-datacapture-sdk-label.wasm +0 -0
- package/build/js/LabelCaptureWorkerManager-Jxe1KSMt.js +0 -1
- package/build/js/djinni-types/sdcAnalyticsModule.d.ts +0 -24
- package/build/js/djinni-types/sdcAnalyticsModule.js +0 -0
- package/build/js/djinni-types/sdcBarcodeData.d.ts +0 -2
- package/build/js/djinni-types/sdcBarcodeData.js +0 -1
- package/build/js/djinni-types/sdcBarcodeInternalSdkData.d.ts +0 -2
- package/build/js/djinni-types/sdcBarcodeInternalSdkData.js +0 -0
- package/build/js/djinni-types/sdcCoreCommon.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreCommon.js +0 -1
- package/build/js/djinni-types/sdcCoreCommonBuffer.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreCommonBuffer.js +0 -0
- package/build/js/djinni-types/sdcCoreCommonGeometry.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreCommonGeometry.js +0 -1
- package/build/js/djinni-types/sdcCoreCommonGraphic.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreCommonGraphic.js +0 -1
- package/build/js/djinni-types/sdcCoreInternalSdkArea.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreInternalSdkArea.js +0 -0
- package/build/js/djinni-types/sdcCoreInternalSdkCapture.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreInternalSdkCapture.js +0 -1
- package/build/js/djinni-types/sdcCoreInternalSdkCommonAsync.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreInternalSdkCommonAsync.js +0 -0
- package/build/js/djinni-types/sdcCoreInternalSdkCommonGeometry.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreInternalSdkCommonGeometry.js +0 -1
- package/build/js/djinni-types/sdcCoreInternalSdkCommonGraphics.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreInternalSdkCommonGraphics.js +0 -0
- package/build/js/djinni-types/sdcCoreInternalSdkOcr.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreInternalSdkOcr.js +0 -0
- package/build/js/djinni-types/sdcCoreInternalSdkUiStyle.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreInternalSdkUiStyle.js +0 -0
- package/build/js/djinni-types/sdcCoreInternalSdkUiViewfinder.d.ts +0 -2
- package/build/js/djinni-types/sdcCoreInternalSdkUiViewfinder.js +0 -1
- package/build/js/djinni-types/sdcLabelData.d.ts +0 -2
- package/build/js/djinni-types/sdcLabelData.js +0 -1
- package/build/js/djinni-types/sdcLabelInternalModuleCapture.d.ts +0 -2
- package/build/js/djinni-types/sdcLabelInternalModuleCapture.js +0 -1
- package/build/js/djinni-types/sdcLabelInternalModuleData.d.ts +0 -2
- package/build/js/djinni-types/sdcLabelInternalModuleData.js +0 -1
- package/build/js/djinni-types/sdcLabelInternalModuleUiOverlay.d.ts +0 -2
- package/build/js/djinni-types/sdcLabelInternalModuleUiOverlay.js +0 -0
- package/build/js/djinni-types/sdcSymbologySettings.d.ts +0 -2
- package/build/js/djinni-types/sdcSymbologySettings.js +0 -0
- package/build/js/sdcBarcodeInternalSdkData-CJZsjs8c.d.ts +0 -36
- package/build/js/sdcCoreCommon-kHUoe_GV.d.ts +0 -13
- package/build/js/sdcCoreCommonBuffer-DjQM-W5x.d.ts +0 -11
- package/build/js/sdcCoreCommonGraphic-hFLsxC6K.d.ts +0 -22
- package/build/js/sdcCoreInternalSdkArea-BDbnSRls.d.ts +0 -38
- package/build/js/sdcCoreInternalSdkCapture-CcabgRl6.d.ts +0 -9
- package/build/js/sdcCoreInternalSdkCommonGeometry-BdkRyMJ5.d.ts +0 -50
- package/build/js/sdcCoreInternalSdkCommonGraphics-DRTWPww6.d.ts +0 -10
- package/build/js/sdcCoreInternalSdkOcr-rkdYyZLs.d.ts +0 -34
- package/build/js/sdcCoreInternalSdkUiStyle-pVbYygcu.d.ts +0 -11
- package/build/js/sdcLabelInternalModuleData-D_O2Y4cu.d.ts +0 -63
- package/build/js/sdcLabelInternalModuleUiOverlay-CGIKcVOW.d.ts +0 -113
- package/build/js/sdcSymbologySettings-CR04eT_a.d.ts +0 -21
- package/build/js/viewfinderTranslator-BSoFZt6m.js +0 -1
- package/build/js/worker/handlers/ReceiptScanningHandler.js +0 -1
- package/build/js/worker/proxies/ReceiptScanningHandlerProxy.d.ts +0 -14
- package/build/js/worker/proxies/ReceiptScanningHandlerProxy.js +0 -1
- package/sdc-lib/label-worker-8.5.2.js +0 -1
- package/sdc-lib/resources/models/aus_mdl_keypoint_detection.17f1b2958a9e.model +0 -0
- package/sdc-lib/resources/models/barcode_classification_default.48685f5fe19b.model +0 -0
- package/sdc-lib/resources/models/barcode_keypoints_oned.c499e5bd6ed4.model +0 -0
- package/sdc-lib/resources/models/barcode_label_localization_mslc_model_s.616a59ec3a8d.model +0 -0
- package/sdc-lib/resources/models/barcode_label_localization_mslc_model_smartphone.29decf3dd9e6.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_clutter_aware.69933853e03e.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_default.59f74a846b63.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_dpm_default.7e4fe5631f81.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_generic_postal_code_default.184ecbeb5b83.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_oned_default.c547484132c1.model +0 -0
- package/sdc-lib/resources/models/barcode_localization_twod_default.4b64523bf755.model +0 -0
- package/sdc-lib/resources/models/id_outline_localization_model_kpts.b74ff5cc58cf.model +0 -0
- package/sdc-lib/resources/models/mrz_line_localization.577844e2ebed.model +0 -0
- package/sdc-lib/resources/models/mrz_localization.77e331c44b52.model +0 -0
- package/sdc-lib/resources/models/ocr_attention.75e86b6ca0ca.model +0 -0
- package/sdc-lib/resources/models/price_localization_in_whole_label.555b33695325.model +0 -0
- package/sdc-lib/resources/models/qr_model_1.e790edc14d39.model +0 -0
- package/sdc-lib/resources/models/via_id_template_database.e54ca9420de3.model +0 -0
- /package/build/js/{AdaptiveRecognitionMode-DBr--JVQ.d.ts → AdaptiveRecognitionMode-Ce7PcDLT.d.ts} +0 -0
- /package/build/js/{LabelDateComponentFormat-BDdyln8r.d.ts → LabelDateComponentFormat-BogF5Duc.d.ts} +0 -0
- /package/build/js/{LabelDateResult-CQ9G5zQl.d.ts → LabelDateResult-CXE4kE4_.d.ts} +0 -0
- /package/build/js/{LabelFieldDefinition-CuGI3QUq.d.ts → LabelFieldDefinition-Dx10zV00.d.ts} +0 -0
- /package/build/js/{LabelFieldState-JJ7Cbn3n.d.ts → LabelFieldState-PNXv3OG0.d.ts} +0 -0
- /package/build/js/{LabelFieldType-DEXmgciU.d.ts → LabelFieldType-DTWF1oEh.d.ts} +0 -0
- /package/build/js/{LabelFieldValueType-C8ZfGaCT.d.ts → LabelFieldValueType-Bpo3SRcL.d.ts} +0 -0
- /package/build/js/{ReceiptScanningLineItem-CZ--bISr.d.ts → ReceiptScanningLineItem-sJWucFWu.d.ts} +0 -0
- /package/build/js/{nativeDispatch-C7kZCRYA.d.ts → nativeDispatch-DihCPqt9.d.ts} +0 -0
- /package/build/js/{workerHandles-DhpaE-4P.d.ts → workerHandles-dyelIcCK.d.ts} +0 -0
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ButtonVariant, i as ButtonType, n as ButtonKind, r as ButtonSize, t as Button } from "../../Button-
|
|
1
|
+
import { a as ButtonVariant, i as ButtonType, n as ButtonKind, r as ButtonSize, t as Button } from "../../Button-BQw0QTaa.js";
|
|
2
2
|
export { Button, ButtonKind, ButtonSize, ButtonType, ButtonVariant };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ScanditIcon as e}from"@scandit/web-datacapture-core";import{ScanditHTMLElement as t,css as n,defineCustomElements as r,html as i}from"@scandit/web-datacapture-core/build/js/private/utils/index.js";import{GestureRecognizer as a}from"@scandit/web-datacapture-core/build/js/private/GestureRecognizer/
|
|
1
|
+
import{ScanditIcon as e}from"@scandit/web-datacapture-core";import{ScanditHTMLElement as t,css as n,defineCustomElements as r,html as i}from"@scandit/web-datacapture-core/build/js/private/utils/index.js";import{GestureRecognizer as a,PressGesturePlugin as o}from"@scandit/web-datacapture-core/build/js/private/GestureRecognizer/index.js";import{grays as s,neutrals as c,reds as l}from"@scandit/web-datacapture-core/build/js/private/ui/colors.js";var u=class u extends t{constructor(){super(),this._variant=`primary`,this._size=`default`,this._kind=`action`,this._disabled=!1,this._type=`button`,this.iconStartSlot=null,this.iconEndSlot=null,this.onIconSlotChangeListener=this.onIconSlotChange.bind(this),this.gestureRecognizer=null,this.associatedForm=null;let e=this.attachShadow({mode:`open`});e.innerHTML=i`<button type="button"><slot name="icon-start"></slot><span class="text"><slot></slot></span><slot name="icon-end"></slot></button>`,e.append(u.createStyleElement().cloneNode(!0)),this.iconStartSlot=e.querySelector(`slot[name="icon-start"]`),this.iconEndSlot=e.querySelector(`slot[name="icon-end"]`)}connectedCallback(){var e,t,n;let r=this.getAttribute(`variant`);(r===`primary`||r===`secondary`||r===`ghost`)&&(this._variant=r);let i=this.getAttribute(`size`);(i==="default"||i===`small`)&&(this._size=i);let s=this.getAttribute(`kind`);(s===`action`||s===`destructive`)&&(this._kind=s);let c=this.getAttribute(`type`);(c===`button`||c===`submit`||c===`reset`)&&(this._type=c);let l=this.getAttribute(`disabled`);this._disabled=l!==null,this.updateAttributes(),this.updateButtonState(),(e=this.iconStartSlot)==null||e.addEventListener(`slotchange`,this.onIconSlotChangeListener),(t=this.iconEndSlot)==null||t.addEventListener(`slotchange`,this.onIconSlotChangeListener),this.updateIconColors();let u=(n=this.shadowRoot)==null?void 0:n.querySelector(`button`);u&&(this.gestureRecognizer=new a(u,[new o]),this.gestureRecognizer.addListener(this))}disconnectedCallback(){var e,t,n;(e=this.iconStartSlot)==null||e.removeEventListener(`slotchange`,this.onIconSlotChangeListener),(t=this.iconEndSlot)==null||t.removeEventListener(`slotchange`,this.onIconSlotChangeListener),(n=this.gestureRecognizer)==null||n.removeAllListeners(),this.gestureRecognizer=null}formAssociatedCallback(e){this.associatedForm=e??null}formDisabledCallback(e){this.disabled=e}onPress(){if(!this._disabled){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(`button`);t==null||t.classList.add(`pressed`)}}onRelease(){this.unpress(),this._type===`submit`&&this.associatedForm&&this.associatedForm.requestSubmit()}onCancel(){this.unpress()}unpress(){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(`button`);t==null||t.classList.remove(`pressed`)}onIconSlotChange(){this.updateIconColors()}updateIconColors(){let e=getComputedStyle(this).getPropertyValue(`--button-text-color`).trim();if(e){if(this.iconStartSlot){let t=this.iconStartSlot.assignedElements();for(let n of t)this.isScanditIcon(n)&&n.setAttribute(`iconcolor`,e)}if(this.iconEndSlot){let t=this.iconEndSlot.assignedElements();for(let n of t)this.isScanditIcon(n)&&n.setAttribute(`iconcolor`,e)}}}isScanditIcon(t){return t.tagName.toLowerCase()===e.tag.toLowerCase()}get variant(){return this._variant}set variant(e){this._variant!==e&&(this._variant=e,this.updateAttributes(),this.updateIconColors())}get size(){return this._size}set size(e){this._size!==e&&(this._size=e,this.updateAttributes())}get kind(){return this._kind}set kind(e){this._kind!==e&&(this._kind=e,this.updateAttributes(),this.updateIconColors())}get disabled(){return this._disabled}set disabled(e){this._disabled!==e&&(this._disabled=e,this.updateButtonState(),this.updateIconColors())}get type(){return this._type}set type(e){this._type!==e&&(this._type=e,this.updateAttributes(),this.updateButtonState())}updateAttributes(){this.setAttribute(`variant`,this._variant),this.setAttribute(`size`,this._size),this.setAttribute(`kind`,this._kind),this.setAttribute(`type`,this._type)}updateButtonState(){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(`button`);t&&(t.type=this._type,this._disabled?(t.setAttribute(`disabled`,``),this.setAttribute(`disabled`,``),t.classList.remove(`pressed`)):(t.removeAttribute(`disabled`),this.removeAttribute(`disabled`)))}static get observedAttributes(){return[`variant`,`size`,`kind`,`disabled`,`type`]}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`variant`:(n===`primary`||n===`secondary`||n===`ghost`)&&(this._variant=n,this.updateIconColors());break;case`size`:(n==="default"||n===`small`)&&(this._size=n);break;case`kind`:(n===`action`||n===`destructive`)&&(this._kind=n,this.updateIconColors());break;case`disabled`:this._disabled=n!==null,this.updateButtonState(),this.updateIconColors();break;case`type`:(n===`button`||n===`submit`||n===`reset`)&&(this._type=n,this.updateButtonState());break}}set text(e){var t;let n=(t=this.shadowRoot)==null?void 0:t.querySelector(`.text`);n&&(n.innerHTML=e)}get text(){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(`.text`);return(t==null?void 0:t.innerHTML)??``}set textContent(e){var t;let n=(t=this.shadowRoot)==null?void 0:t.querySelector(`.text`);n&&(n.textContent=e)}get textContent(){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(`.text`);return(t==null?void 0:t.textContent)??``}static create(){return u.register(),document.createElement(u.tag)}static register(){r({[u.tag]:u})}static createStyleElement(){return n`:host{display:inline-block;--button-text-color:#fff}:host([hidden]){display:none}:host button{align-items:center;border:1px solid #0000;border-radius:.5rem;cursor:pointer;display:flex;font-weight:700;gap:.25rem;justify-content:center;max-width:200px;min-width:140px;position:relative;text-align:center;transition:all .2s ease;width:100%;-webkit-tap-highlight-color:transparent}:host([size=default]) button{font-size:.875rem;padding:.5rem 1rem}:host([size=small]) button{font-size:.75rem;max-width:150px;min-width:auto;padding:.375rem .75rem}:host([variant=primary][kind=action]){--button-text-color:#${c.neutralWhite.toJSON()}}:host([variant=primary][kind=action]) button{background-color:#${s.gray90.toJSON()};color:var(--button-text-color)}:host([variant=primary][kind=action]) button:hover:not(:disabled){background-color:#${s.gray70.toJSON()}}:host([variant=primary][kind=action]) button.pressed:not(:disabled){background-color:#${c.neutralBlack.toJSON()}}:host([variant=primary][kind=destructive]){--button-text-color:#${c.neutralWhite.toJSON()}}:host([variant=primary][kind=destructive]) button{background-color:#${l.red60.toJSON()};color:var(--button-text-color)}:host([variant=primary][kind=destructive]) button:hover:not(:disabled){background-color:#${l.red50.toJSON()}}:host([variant=primary][kind=destructive]) button.pressed:not(:disabled){background-color:#${l.red70.toJSON()}}:host([variant=secondary][kind=action]){--button-text-color:#${c.neutralBlack.toJSON()}}:host([variant=secondary][kind=action]) button{background-color:#${c.neutralWhite.toJSON()};border-color:#${s.gray60.toJSON()};color:var(--button-text-color)}:host([variant=secondary][kind=action]) button:hover:not(:disabled){background-color:#${s.gray5.toJSON()}}:host([variant=secondary][kind=action]) button.pressed:not(:disabled){background-color:#${s.gray10.toJSON()}}:host([variant=secondary][kind=destructive]){--button-text-color:#${l.red60.toJSON()}}:host([variant=secondary][kind=destructive]) button{background-color:#${c.neutralWhite.toJSON()};border-color:#${l.red60.toJSON()};color:var(--button-text-color)}:host([variant=secondary][kind=destructive]) button:hover:not(:disabled){background-color:#${l.red5.toJSON()}}:host([variant=secondary][kind=destructive]) button.pressed:not(:disabled){background-color:#${l.red10.toJSON()};color:var(--button-text-color)}:host([variant=ghost][kind=action]){--button-text-color:#${c.neutralBlack.toJSON()}}:host([variant=ghost][kind=action]) button{background-color:#${c.neutralWhite.toJSON()};border-color:#0000;color:var(--button-text-color)}:host([variant=ghost][kind=action]) button:hover:not(:disabled){background-color:#${s.gray5.toJSON()}}:host([variant=ghost][kind=action]) button.pressed:not(:disabled){background-color:#${s.gray10.toJSON()}}:host([variant=ghost][kind=destructive]){--button-text-color:#${l.red60.toJSON()}}:host([variant=ghost][kind=destructive]) button{background-color:initial;border-color:#0000;color:var(--button-text-color)}:host([variant=ghost][kind=destructive]) button:hover:not(:disabled){background-color:#fedada;color:#fb696b}:host([variant=ghost][kind=destructive]) button.pressed:not(:disabled){background-color:#fc8f90;color:var(--button-text-color)}:host([disabled]),:host([variant][kind][disabled]){--button-text-color:#${s.gray30.toJSON()}}:host([disabled]) button:disabled,:host([variant][kind]) button:disabled{background-color:#${s.gray10.toJSON()};border-color:#0000;cursor:not-allowed;pointer-events:none}:host([variant=ghost][kind]) button:disabled{background-color:initial}:host button .text{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host button ::slotted([name=icon-end]),:host button ::slotted([name=icon-start]){align-items:center;display:inline-flex;flex:1 1 0;min-width:0}:host button ::slotted([name=icon-start]){justify-content:flex-start}:host button ::slotted([name=icon-end]){justify-content:flex-end}`}};u.tag=`scandit-button`,u.formAssociated=!0;export{u as Button};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ScanditHTMLElement } from "@scandit/web-datacapture-core/build/js/private/utils/index.js";
|
|
2
2
|
import { Color } from "@scandit/web-datacapture-core/build/js/commons/Color.js";
|
|
3
|
-
|
|
4
3
|
//#region src/main/ui/atoms/TextInput.d.ts
|
|
5
4
|
type TextInputType = "text" | "number";
|
|
6
5
|
declare const TextInputEvents: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{ScanditHTMLElement as e,css as t,defineCustomElements as n,html as r}from"@scandit/web-datacapture-core/build/js/private/utils/index.js";import{grays as i,reds as a}from"@scandit/web-datacapture-core/build/js/private/ui/colors.js";import{Color as o}from"@scandit/web-datacapture-core/build/js/commons/Color.js";import{CrossSvgIcon as s}from"@scandit/web-datacapture-core/build/js/private/ui/atoms/CrossSvgIcon.js";import{ScanSvgIcon as c}from"@scandit/web-datacapture-core/build/js/private/ui/atoms/ScanSvgIcon.js";const l={Input:`scandit-text-input-input`,Focus:`scandit-text-input-focus`,Blur:`scandit-text-input-blur`,Clear:`scandit-text-input-clear`,Scan:`scandit-text-input-scan`,Keydown:`scandit-text-input-keydown`};var u=class extends CustomEvent{constructor(e){super(l.Scan,{detail:e,bubbles:!0,composed:!0})}},d=class extends CustomEvent{constructor(e){super(l.Clear,{detail:e,bubbles:!0,composed:!0})}},f=class extends CustomEvent{constructor(e){super(l.Focus,{detail:e,bubbles:!0,composed:!0})}},p=class extends CustomEvent{constructor(e){super(l.Blur,{detail:e,bubbles:!0,composed:!0})}},m=class extends CustomEvent{constructor(e){super(l.Input,{detail:e,bubbles:!0,composed:!0})}},h=class extends CustomEvent{constructor(e){super(l.Keydown,{detail:e,bubbles:!0,composed:!0})}};const g=r`<div class="main-wrapper"><label class="label-text"></label><div class="input-container"><input class="input" autocomplete="off" enterkeyhint="done"><div class="icons-container"><div id="icon-left"></div><hr class="icon-divider"><div id="icon-right"></div></div></div><div class="hint-message"></div></div>`;var _=class r extends e{static createStyleElement(){return t`:host{display:block;-webkit-tap-highlight-color:transparent}input{background-color:initial;border:none;font-size:1rem;font-style:normal;font-weight:400;outline:none;padding:0;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;appearance:none;color:#${i.gray60.toJSON()};transition:color .2s ease-in-out;user-select:none;-webkit-user-select:none;width:100%}input::placeholder{color:#${i.gray30.toJSON()};opacity:1}:host([has-value]) input{color:#${i.gray90.toJSON()}}input:focus,input:focus-visible{color:#${i.gray90.toJSON()};outline:none}:host([disabled]) .hint-message,:host([disabled]) .label-text,:host([disabled]) input{color:#${i.gray30.toJSON()}}:host([disabled]) .input-container{border-color:#${i.gray5.toJSON()}}.main-wrapper{cursor:pointer;display:flex;flex-direction:column;flex-grow:1;gap:.25rem;padding:0 1px}.hint-message,.label-text{font-style:normal;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hint-message{font-size:.75rem;min-height:.875rem;transition:opacity .2s ease-in-out}.label-text{color:#${i.gray60.toJSON()};font-size:.875rem}:host(:hover:not([disabled]):not([readonly])) .input-container{background-color:#${i.gray5.toJSON()};border-color:#${i.gray20.toJSON()}}.input-container{background-color:#${i.gray5.toJSON()};border:1px solid #${i.gray10.toJSON()};border-radius:4px;box-shadow:0 0 0 1px #0000;display:flex;flex-direction:row;gap:.5rem;justify-content:space-evenly;min-height:1.5rem;padding:.5rem .75rem;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,box-shadow .2s ease-in-out}.icons-container{align-items:center;display:flex;gap:.5rem;justify-content:center}:host([has-value][focused]) .icons-container .icon-divider{opacity:1}:host ${s.tag}{opacity:0;pointer-events:none;transition:opacity .2s ease-in-out}:host([has-value][focused]) ${s.tag}{opacity:1;pointer-events:auto}:host([hide-scan-icon]) .icons-container .icon-divider,:host([hide-scan-icon]) ${c.tag}{display:none}.icons-container .icon-divider{background-color:#${i.gray20.toJSON()};border:none;height:100%;margin:0;opacity:0;padding:0;transition:opacity .2s ease-in-out;width:1px}:host([disabled]) .icons-container,:host([readonly]) .icons-container{display:none}:host([disabled]),:host([readonly]){cursor:not-allowed;pointer-events:none}:host([focused]:not([disabled]):not([readonly])) .input-container{border-color:#${i.gray90.toJSON()};box-shadow:0 0 0 1px #${i.gray90.toJSON()}}:host([invalid]) .input-container{background-color:#${a.red5.toJSON()};border-color:#${a.red30.toJSON()};box-shadow:0 0 0 1px #${a.red30.toJSON()}}:host([invalid][focused]) .input-container{background-color:#${a.red5.toJSON()}!important;border-color:#${a.red60.toJSON()}!important;box-shadow:0 0 0 1px #${a.red60.toJSON()}!important}:host(:hover[invalid]:not([focused])) .input-container{background-color:#${a.red5.toJSON()}!important;border-color:#${a.red30.toJSON()}!important;box-shadow:0 0 0 1px #${a.red30.toJSON()}!important}:host([invalid]) .hint-message{color:#${a.red60.toJSON()}}:host([loading]) .input{animation:loading-shimmer 2.5s linear infinite;background:linear-gradient(90deg,#0000004d,#000c 40%,#000 50%,#000c 60%,#0000004d);background-clip:text;-webkit-background-clip:text;background-size:200% 100%;color:#000;color:#0000}@keyframes loading-shimmer{0%{background-position-x:-100%}to{background-position-x:100%}}@media (prefers-reduced-motion:reduce){:host([loading]) .input{animation:none;background:#0003;background-clip:unset;-webkit-background-clip:unset;color:#${i.gray60.toJSON()}}}`}constructor(){super(),this._inputElement=null,this._labelElement=null,this._mainWrapper=null,this._inputContainer=null,this._iconContainerElement=null,this._hintMessageElement=null,this._type=`text`,this._value=``,this._label=``,this._placeholder=``,this._required=!1,this._isInitialized=!1,this._handleInput=this._onInput.bind(this),this._handleFocus=this._onFocus.bind(this),this._handleBlur=this._onBlur.bind(this),this._handleKeydown=this._onKeydown.bind(this),this._handleCrossIconPointerDown=this._onCrossIconPointerDown.bind(this),this._handleCrossIconPointerUp=this._onCrossIconPointerUp.bind(this),this._handleCrossIconKeyDown=this._onCrossIconKeyDown.bind(this),this._handleScanIconPointerDown=this._onScanIconPointerDown.bind(this),this._handleScanIconPointerUp=this._onScanIconPointerUp.bind(this),this._handleScanIconKeyDown=this._onScanIconKeyDown.bind(this),this._crossIcon=null,this._scanIcon=null,this._hintMessage=``,this._loadingText=``,this._clearTabIndexTimeout=void 0,this._internals=typeof this.attachInternals==`function`?this.attachInternals():void 0;let e=this.attachShadow({mode:`open`});e.innerHTML=g,e.appendChild(r.createStyleElement()),this._inputElement=e.querySelector(`.input`),this._labelElement=e.querySelector(`.label-text`),this._mainWrapper=e.querySelector(`.main-wrapper`),this._inputContainer=e.querySelector(`.input-container`),this._iconContainerElement=e.querySelector(`.icons-container`),this._hintMessageElement=e.querySelector(`.hint-message`)}get hintMessage(){var e;return((e=this._hintMessageElement)==null?void 0:e.textContent)||``}set hintMessage(e){this.invalid?this._setValidityState({customError:!0},e):(this._hintMessage=e,this._hintMessageElement&&(this._hintMessageElement.textContent=e))}get loading(){return this.hasAttribute(`loading`)}set loading(e){this.toggleAttribute(`loading`,e),this._updateInputDisplay()}get loadingText(){return this._loadingText}set loadingText(e){this._loadingText=e,this._updateInputDisplay()}get value(){return this._value}set value(e){if(this._value=e,this._inputElement){var t;let n=e.length>0;this.toggleAttribute(`has-value`,n),this._updateCrossIconTabIndex(),(t=this._internals)==null||t.setFormValue(e),this._updateInputDisplay(),this._required&&n&&this.invalid&&this._setValidityState({})}}get name(){var e;return this.getAttribute(`name`)||((e=this._inputElement)==null?void 0:e.name)||``}set name(e){if(e?this.setAttribute(`name`,e):this.removeAttribute(`name`),this._inputElement&&this._labelElement){var t;(t=this._labelElement)==null||t.setAttribute(`for`,e),this._inputElement.name=e,this._inputElement.id=e}}get type(){return this._type}set type(e){this._type=e,this._inputElement&&(this._type===`number`?(this._inputElement.type=`number`,this._inputElement.inputMode=`numeric`):this._inputElement.type=`text`)}get label(){return this._label}set label(e){this._label=e,this._labelElement&&(this._labelElement.textContent=e||``),e?this.setAttribute(`aria-label`,e):this.removeAttribute(`aria-label`)}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`),this._inputElement&&(this._inputElement.placeholder=e)}get required(){var e;return((e=this._inputElement)==null?void 0:e.required)??this._required??!1}set required(e){this._required=e,this.toggleAttribute(`required`,e),this._inputElement&&(this._inputElement.required=e,this._inputElement.setAttribute(`aria-required`,String(e))),this._isInitialized&&e&&!this._value&&this._setValidityState({valueMissing:!0},`This field is required`)}get invalid(){return this.hasAttribute(`invalid`)}set invalid(e){e?this._setValidityState({customError:!0},this._hintMessage):this._setValidityState({})}set readOnly(e){this.toggleAttribute(`readonly`,e),this._inputElement&&(this._inputElement.readOnly=e)}get readOnly(){return this.hasAttribute(`readonly`)}set disabled(e){var t;this.toggleAttribute(`disabled`,e),this._inputElement&&(this._inputElement.disabled=e),(t=this._internals)==null||t.setFormValue(this._value)}get disabled(){return this.hasAttribute(`disabled`)}set hideScanIcon(e){this.toggleAttribute(`hide-scan-icon`,e)}get hideScanIcon(){return this.hasAttribute(`hide-scan-icon`)}set backgroundColor(e){this._inputContainer&&(this._inputContainer.style.backgroundColor=e instanceof o?`#${e.toJSON()}`:e)}checkValidity(){return this._inputElement?this._inputElement.validity.valid:!0}reportValidity(){var e;return((e=this._internals)==null?void 0:e.reportValidity())??!0}setValidationState(e,t){var n;if(e)this._setValidityState({});else{let e=t===void 0?``:t;this._setValidityState({customError:!0},e)}(n=this._mainWrapper)==null||n.classList.add(`validation-triggered`)}resetValidation(){var e;this._setValidityState({}),(e=this._mainWrapper)==null||e.classList.remove(`validation-triggered`)}setCustomValidity(e){this._inputElement&&(this._inputElement.setCustomValidity(e),e.length>0?this._setValidityState({customError:!0},e):this._setValidityState({}))}_setValidityState(e,t=``){let n=Object.values(e).some(e=>e===!0);if(this.toggleAttribute(`invalid`,n),n){var r;let n=t||`This field is invalid`;(r=this._internals)==null||r.setValidity(e,n)}else{var i;(i=this._internals)==null||i.setValidity({})}if(this._hintMessage=t,this._hintMessageElement&&(this._hintMessageElement.textContent=t||``),this._inputElement)if(this._inputElement.setAttribute(`aria-invalid`,String(n)),n&&t){var a;let e=`${this._inputElement.id||`text-input`}-hint`;(a=this._hintMessageElement)==null||a.setAttribute(`id`,e),this._inputElement.setAttribute(`aria-describedby`,e)}else this._inputElement.removeAttribute(`aria-describedby`)}_onInput(e){if(!this._inputElement)return;let t=e.target.value,n=t.length>0;this.toggleAttribute(`has-value`,n),this.value=t,this._updateCrossIconTabIndex(),this.invalid&&this.resetValidation(),this.dispatchEvent(new m({target:this,innerInput:this._inputElement,value:this._value}))}_onFocus(e){this.setAttribute(`focused`,``),this._updateCrossIconTabIndex(),this.dispatchEvent(new f({target:this,innerInput:this._inputElement,value:this._value}))}_onBlur(e){this.removeAttribute(`focused`),this._updateCrossIconTabIndex(),typeof document<`u`&&document.body&&this.contains(document.activeElement)&&(clearTimeout(this._clearTabIndexTimeout),document.body.tabIndex=-1,document.body.focus({preventScroll:!0}),this._clearTabIndexTimeout=setTimeout(()=>{document.body.removeAttribute(`tabindex`)},10)),this.dispatchEvent(new p({target:this,innerInput:this._inputElement,value:this._value}))}_onKeydown(e){this.dispatchEvent(new h({target:this,key:e.key,originalEvent:e}))}focus(e){super.focus(e),this._inputElement&&this._inputElement.focus(e)}select(){var e,t;(e=this._inputElement)==null||(t=e.select)==null||t.call(e)}blur(){var e,t;super.blur(),(e=this._inputElement)==null||(t=e.blur)==null||t.call(e)}scrollIntoView(e){var t;(t=this._inputElement)==null||t.scrollIntoView(e),super.scrollIntoView(e)}_initializeIcons(){var e,t;s.register(),c.register();let n=(e=this._iconContainerElement)==null?void 0:e.querySelector(`#icon-left`);n&&(this._crossIcon=s.create(),this._crossIcon.size=20,this._crossIcon.setAttribute(`aria-label`,`Clear input`),this._crossIcon.setAttribute(`role`,`button`),this._updateCrossIconTabIndex(),n.replaceWith(this._crossIcon));let r=(t=this._iconContainerElement)==null?void 0:t.querySelector(`#icon-right`);r&&(this._scanIcon=c.create(),this._scanIcon.size=20,this._scanIcon.setAttribute(`aria-label`,`Scan barcode`),this._scanIcon.setAttribute(`role`,`button`),this._scanIcon.setAttribute(`tabindex`,`0`),r.replaceWith(this._scanIcon))}_updateCrossIconTabIndex(){!this._crossIcon||!this._scanIcon||(this.hasAttribute(`has-value`)?(this._crossIcon.setAttribute(`tabindex`,`0`),this._scanIcon.setAttribute(`tabindex`,`0`)):(this._crossIcon.setAttribute(`tabindex`,`-1`),this._scanIcon.setAttribute(`tabindex`,`0`)))}_updateInputDisplay(){this._inputElement&&(this.loading&&this._loadingText?this._inputElement.value=this._loadingText:this._inputElement.value=this._value)}connectedCallback(){this.setAttribute(`role`,`textbox`),this._initializeAttributesFromElement(),this._initializeIcons(),this._addEventListeners(),this._isInitialized=!0}_initializeAttributesFromElement(){if(this.hasAttribute(`name`)&&(this.name=this.getAttribute(`name`)||``),this.hasAttribute(`label`)&&(this.label=this.getAttribute(`label`)||``),this.hasAttribute(`placeholder`)&&(this.placeholder=this.getAttribute(`placeholder`)||``),this.hasAttribute(`type`)){let e=this.getAttribute(`type`);(e===`text`||e===`number`)&&(this.type=e)}this.hasAttribute(`value`)&&(this.value=this.getAttribute(`value`)||``),this.hasAttribute(`required`)&&(this.required=this.getAttribute(`required`)!==null),this.hasAttribute(`invalid`)&&(this.invalid=this.getAttribute(`invalid`)!==null),this.hasAttribute(`hide-scan-icon`)&&(this.hideScanIcon=this.getAttribute(`hide-scan-icon`)!==null),this._hintMessageElement&&(this.hintMessage=this._hintMessage||``)}disconnectedCallback(){var e,t;this._isInitialized=!1,clearTimeout(this._clearTabIndexTimeout),this._removeEventListeners(),(e=this._crossIcon)==null||e.remove(),(t=this._scanIcon)==null||t.remove()}formAssociatedCallback(e){}formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value=this.getAttribute(`value`)||``,this.resetValidation()}_addEventListeners(){var e,t,n,r,i,a;this._inputElement&&(this._inputElement.addEventListener(`input`,this._handleInput),this._inputElement.addEventListener(`focus`,this._handleFocus),this._inputElement.addEventListener(`blur`,this._handleBlur),this._inputElement.addEventListener(`keydown`,this._handleKeydown),(e=this._crossIcon)==null||e.addEventListener(`pointerdown`,this._handleCrossIconPointerDown,{capture:!0}),(t=this._crossIcon)==null||t.addEventListener(`pointerup`,this._handleCrossIconPointerUp),(n=this._crossIcon)==null||n.addEventListener(`keydown`,this._handleCrossIconKeyDown),(r=this._scanIcon)==null||r.addEventListener(`pointerdown`,this._handleScanIconPointerDown,{capture:!0}),(i=this._scanIcon)==null||i.addEventListener(`pointerup`,this._handleScanIconPointerUp),(a=this._scanIcon)==null||a.addEventListener(`keydown`,this._handleScanIconKeyDown))}_removeEventListeners(){var e,t,n,r,i,a;this._inputElement&&(this._inputElement.removeEventListener(`input`,this._handleInput),this._inputElement.removeEventListener(`focus`,this._handleFocus),this._inputElement.removeEventListener(`blur`,this._handleBlur),this._inputElement.removeEventListener(`keydown`,this._handleKeydown),(e=this._crossIcon)==null||e.removeEventListener(`pointerdown`,this._handleCrossIconPointerDown),(t=this._crossIcon)==null||t.removeEventListener(`pointerup`,this._handleCrossIconPointerUp),(n=this._crossIcon)==null||n.removeEventListener(`keydown`,this._handleCrossIconKeyDown),(r=this._scanIcon)==null||r.removeEventListener(`pointerdown`,this._handleScanIconPointerDown),(i=this._scanIcon)==null||i.removeEventListener(`pointerup`,this._handleScanIconPointerUp),(a=this._scanIcon)==null||a.removeEventListener(`keydown`,this._handleScanIconKeyDown))}_onCrossIconPointerDown(e){e&&e.preventDefault()}_onCrossIconPointerUp(e){!e||!this._crossIcon||(e.preventDefault(),this._triggerClear())}_onCrossIconKeyDown(e){!e||!this._crossIcon||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),this._triggerClear())}_onScanIconPointerDown(e){e&&(e.preventDefault(),e.stopPropagation())}_onScanIconPointerUp(e){!e||!this._scanIcon||(e.preventDefault(),e.stopPropagation(),this._triggerScan())}_triggerClear(){this.dispatchEvent(new d({target:this,innerInput:this._inputElement,value:this._value}))}_onScanIconKeyDown(e){!e||!this._scanIcon||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),this._triggerScan())}_triggerScan(){this.dispatchEvent(new u({target:this,innerInput:this._inputElement,value:this._value}))}static create(){return document.createElement(r.tag)}static register(){n({[r.tag]:r})}};_.tag=`scandit-text-input`,_.formAssociated=!0;export{_ as TextInput,p as TextInputBlurEvent,d as TextInputClearEvent,l as TextInputEvents,f as TextInputFocusEvent,m as TextInputInputEvent,h as TextInputKeydownEvent,u as TextInputScanEvent};
|
|
1
|
+
import{ScanditHTMLElement as e,css as t,defineCustomElements as n,html as r}from"@scandit/web-datacapture-core/build/js/private/utils/index.js";import{grays as i,reds as a}from"@scandit/web-datacapture-core/build/js/private/ui/colors.js";import{Color as o}from"@scandit/web-datacapture-core/build/js/commons/Color.js";import{CrossSvgIcon as s}from"@scandit/web-datacapture-core/build/js/private/ui/atoms/CrossSvgIcon.js";import{ScanSvgIcon as c}from"@scandit/web-datacapture-core/build/js/private/ui/atoms/ScanSvgIcon.js";const l={Input:`scandit-text-input-input`,Focus:`scandit-text-input-focus`,Blur:`scandit-text-input-blur`,Clear:`scandit-text-input-clear`,Scan:`scandit-text-input-scan`,Keydown:`scandit-text-input-keydown`};var u=class extends CustomEvent{constructor(e){super(l.Scan,{detail:e,bubbles:!0,composed:!0})}},d=class extends CustomEvent{constructor(e){super(l.Clear,{detail:e,bubbles:!0,composed:!0})}},f=class extends CustomEvent{constructor(e){super(l.Focus,{detail:e,bubbles:!0,composed:!0})}},p=class extends CustomEvent{constructor(e){super(l.Blur,{detail:e,bubbles:!0,composed:!0})}},m=class extends CustomEvent{constructor(e){super(l.Input,{detail:e,bubbles:!0,composed:!0})}},h=class extends CustomEvent{constructor(e){super(l.Keydown,{detail:e,bubbles:!0,composed:!0})}};const g=r`<div class="main-wrapper"><label class="label-text"></label><div class="input-container"><input class="input" autocomplete="off" enterkeyhint="done"><div class="icons-container"><div id="icon-left"></div><hr class="icon-divider"><div id="icon-right"></div></div></div><div class="hint-message"></div></div>`;var _=class r extends e{static createStyleElement(){return t`:host{display:block;-webkit-tap-highlight-color:transparent}input{background-color:initial;border:none;font-size:1rem;font-style:normal;font-weight:400;outline:none;padding:0;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;appearance:none;color:#${i.gray60.toJSON()};transition:color .2s ease-in-out;user-select:none;-webkit-user-select:none;width:100%}input::placeholder{color:#${i.gray30.toJSON()};opacity:1}:host([has-value]) input{color:#${i.gray90.toJSON()}}input:focus,input:focus-visible{color:#${i.gray90.toJSON()};outline:none}:host([disabled]) .hint-message,:host([disabled]) .label-text,:host([disabled]) input{color:#${i.gray30.toJSON()}}:host([disabled]) .input-container{border-color:#${i.gray5.toJSON()}}.main-wrapper{cursor:pointer;display:flex;flex-direction:column;flex-grow:1;gap:.25rem;padding:0 1px}.hint-message,.label-text{font-style:normal;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hint-message{font-size:.75rem;min-height:.875rem;transition:opacity .2s ease-in-out}.label-text{color:#${i.gray60.toJSON()};font-size:.875rem}:host(:hover:not([disabled]):not([readonly])) .input-container{background-color:#${i.gray5.toJSON()};border-color:#${i.gray20.toJSON()}}.input-container{background-color:#${i.gray5.toJSON()};border:1px solid #${i.gray10.toJSON()};border-radius:4px;box-shadow:0 0 0 1px #0000;display:flex;flex-direction:row;gap:.5rem;justify-content:space-evenly;min-height:1.5rem;padding:.5rem .75rem;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,box-shadow .2s ease-in-out}.icons-container{align-items:center;display:flex;gap:.5rem;justify-content:center}:host([has-value][focused]) .icons-container .icon-divider{opacity:1}:host ${s.tag}{opacity:0;pointer-events:none;transition:opacity .2s ease-in-out}:host([has-value][focused]) ${s.tag}{opacity:1;pointer-events:auto}:host([hide-scan-icon]) .icons-container .icon-divider,:host([hide-scan-icon]) ${c.tag}{display:none}.icons-container .icon-divider{background-color:#${i.gray20.toJSON()};border:none;height:100%;margin:0;opacity:0;padding:0;transition:opacity .2s ease-in-out;width:1px}:host([disabled]) .icons-container,:host([readonly]) .icons-container{display:none}:host([disabled]),:host([readonly]){cursor:not-allowed;pointer-events:none}:host([focused]:not([disabled]):not([readonly])) .input-container{border-color:#${i.gray90.toJSON()};box-shadow:0 0 0 1px #${i.gray90.toJSON()}}:host([invalid]) .input-container{background-color:#${a.red5.toJSON()};border-color:#${a.red30.toJSON()};box-shadow:0 0 0 1px #${a.red30.toJSON()}}:host([invalid][focused]) .input-container{background-color:#${a.red5.toJSON()}!important;border-color:#${a.red60.toJSON()}!important;box-shadow:0 0 0 1px #${a.red60.toJSON()}!important}:host(:hover[invalid]:not([focused])) .input-container{background-color:#${a.red5.toJSON()}!important;border-color:#${a.red30.toJSON()}!important;box-shadow:0 0 0 1px #${a.red30.toJSON()}!important}:host([invalid]) .hint-message{color:#${a.red60.toJSON()}}:host([loading]) .input{animation:loading-shimmer 2.5s linear infinite;background:linear-gradient(90deg,#0000004d,#000c 40%,#000 50%,#000c 60%,#0000004d);background-clip:text;-webkit-background-clip:text;background-size:200% 100%;color:#000;color:#0000}@keyframes loading-shimmer{0%{background-position-x:-100%}to{background-position-x:100%}}@media (prefers-reduced-motion:reduce){:host([loading]) .input{animation:none;background:#0003;background-clip:unset;-webkit-background-clip:unset;color:#${i.gray60.toJSON()}}}`}constructor(){super(),this._inputElement=null,this._labelElement=null,this._mainWrapper=null,this._inputContainer=null,this._iconContainerElement=null,this._hintMessageElement=null,this._type=`text`,this._value=``,this._label=``,this._placeholder=``,this._required=!1,this._isInitialized=!1,this._handleInput=this._onInput.bind(this),this._handleFocus=this._onFocus.bind(this),this._handleBlur=this._onBlur.bind(this),this._handleKeydown=this._onKeydown.bind(this),this._handleCrossIconPointerDown=this._onCrossIconPointerDown.bind(this),this._handleCrossIconPointerUp=this._onCrossIconPointerUp.bind(this),this._handleCrossIconKeyDown=this._onCrossIconKeyDown.bind(this),this._handleScanIconPointerDown=this._onScanIconPointerDown.bind(this),this._handleScanIconPointerUp=this._onScanIconPointerUp.bind(this),this._handleScanIconKeyDown=this._onScanIconKeyDown.bind(this),this._crossIcon=null,this._scanIcon=null,this._hintMessage=``,this._loadingText=``,this._clearTabIndexTimeout=void 0,this._internals=typeof this.attachInternals==`function`?this.attachInternals():void 0;let e=this.attachShadow({mode:`open`});e.innerHTML=g,e.appendChild(r.createStyleElement()),this._inputElement=e.querySelector(`.input`),this._labelElement=e.querySelector(`.label-text`),this._mainWrapper=e.querySelector(`.main-wrapper`),this._inputContainer=e.querySelector(`.input-container`),this._iconContainerElement=e.querySelector(`.icons-container`),this._hintMessageElement=e.querySelector(`.hint-message`)}get hintMessage(){var e;return((e=this._hintMessageElement)==null?void 0:e.textContent)||``}set hintMessage(e){this.invalid?this._setValidityState({customError:!0},e):(this._hintMessage=e,this._hintMessageElement&&(this._hintMessageElement.textContent=e))}get loading(){return this.hasAttribute(`loading`)}set loading(e){this.toggleAttribute(`loading`,e),this._updateInputDisplay()}get loadingText(){return this._loadingText}set loadingText(e){this._loadingText=e,this._updateInputDisplay()}get value(){return this._value}set value(e){if(this._value=e,this._inputElement){var t;let n=e.length>0;this.toggleAttribute(`has-value`,n),this._updateCrossIconTabIndex(),(t=this._internals)==null||t.setFormValue(e),this._updateInputDisplay(),this._required&&n&&this.invalid&&this._setValidityState({})}}get name(){var e;return this.getAttribute(`name`)||((e=this._inputElement)==null?void 0:e.name)||``}set name(e){if(e?this.setAttribute(`name`,e):this.removeAttribute(`name`),this._inputElement&&this._labelElement){var t;(t=this._labelElement)==null||t.setAttribute(`for`,e),this._inputElement.name=e,this._inputElement.id=e}}get type(){return this._type}set type(e){this._type=e,this._inputElement&&(this._type===`number`?(this._inputElement.type=`number`,this._inputElement.inputMode=`numeric`):this._inputElement.type=`text`)}get label(){return this._label}set label(e){this._label=e,this._labelElement&&(this._labelElement.textContent=e||``),e?this.setAttribute(`aria-label`,e):this.removeAttribute(`aria-label`)}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`),this._inputElement&&(this._inputElement.placeholder=e)}get required(){var e;return((e=this._inputElement)==null?void 0:e.required)??this._required??!1}set required(e){this._required=e,this.toggleAttribute(`required`,e),this._inputElement&&(this._inputElement.required=e,this._inputElement.setAttribute(`aria-required`,String(e))),this._isInitialized&&e&&!this._value&&this._setValidityState({valueMissing:!0},`This field is required`)}get invalid(){return this.hasAttribute(`invalid`)}set invalid(e){e?this._setValidityState({customError:!0},this._hintMessage):this._setValidityState({})}set readOnly(e){this.toggleAttribute(`readonly`,e),this._inputElement&&(this._inputElement.readOnly=e)}get readOnly(){return this.hasAttribute(`readonly`)}set disabled(e){var t;this.toggleAttribute(`disabled`,e),this._inputElement&&(this._inputElement.disabled=e),(t=this._internals)==null||t.setFormValue(this._value)}get disabled(){return this.hasAttribute(`disabled`)}set hideScanIcon(e){this.toggleAttribute(`hide-scan-icon`,e)}get hideScanIcon(){return this.hasAttribute(`hide-scan-icon`)}set backgroundColor(e){this._inputContainer&&(this._inputContainer.style.backgroundColor=e instanceof o?`#${e.toJSON()}`:e)}checkValidity(){return!this._inputElement||this._inputElement.validity.valid}reportValidity(){var e;return((e=this._internals)==null?void 0:e.reportValidity())??!0}setValidationState(e,t){var n;if(e)this._setValidityState({});else{let e=t===void 0?``:t;this._setValidityState({customError:!0},e)}(n=this._mainWrapper)==null||n.classList.add(`validation-triggered`)}resetValidation(){var e;this._setValidityState({}),(e=this._mainWrapper)==null||e.classList.remove(`validation-triggered`)}setCustomValidity(e){this._inputElement&&(this._inputElement.setCustomValidity(e),e.length>0?this._setValidityState({customError:!0},e):this._setValidityState({}))}_setValidityState(e,t=``){let n=Object.values(e).some(e=>e===!0);if(this.toggleAttribute(`invalid`,n),n){var r;let n=t||`This field is invalid`;(r=this._internals)==null||r.setValidity(e,n)}else{var i;(i=this._internals)==null||i.setValidity({})}if(this._hintMessage=t,this._hintMessageElement&&(this._hintMessageElement.textContent=t||``),this._inputElement)if(this._inputElement.setAttribute(`aria-invalid`,String(n)),n&&t){var a;let e=`${this._inputElement.id||`text-input`}-hint`;(a=this._hintMessageElement)==null||a.setAttribute(`id`,e),this._inputElement.setAttribute(`aria-describedby`,e)}else this._inputElement.removeAttribute(`aria-describedby`)}_onInput(e){if(!this._inputElement)return;let t=e.target.value,n=t.length>0;this.toggleAttribute(`has-value`,n),this.value=t,this._updateCrossIconTabIndex(),this.invalid&&this.resetValidation(),this.dispatchEvent(new m({target:this,innerInput:this._inputElement,value:this._value}))}_onFocus(e){this.setAttribute(`focused`,``),this._updateCrossIconTabIndex(),this.dispatchEvent(new f({target:this,innerInput:this._inputElement,value:this._value}))}_onBlur(e){this.removeAttribute(`focused`),this._updateCrossIconTabIndex(),typeof document<`u`&&document.body&&this.contains(document.activeElement)&&(clearTimeout(this._clearTabIndexTimeout),document.body.tabIndex=-1,document.body.focus({preventScroll:!0}),this._clearTabIndexTimeout=setTimeout(()=>{document.body.removeAttribute(`tabindex`)},10)),this.dispatchEvent(new p({target:this,innerInput:this._inputElement,value:this._value}))}_onKeydown(e){this.dispatchEvent(new h({target:this,key:e.key,originalEvent:e}))}focus(e){super.focus(e),this._inputElement&&this._inputElement.focus(e)}select(){var e,t;(e=this._inputElement)==null||(t=e.select)==null||t.call(e)}blur(){var e,t;super.blur(),(e=this._inputElement)==null||(t=e.blur)==null||t.call(e)}scrollIntoView(e){var t;(t=this._inputElement)==null||t.scrollIntoView(e),super.scrollIntoView(e)}_initializeIcons(){var e,t;s.register(),c.register();let n=(e=this._iconContainerElement)==null?void 0:e.querySelector(`#icon-left`);n&&(this._crossIcon=s.create(),this._crossIcon.size=20,this._crossIcon.setAttribute(`aria-label`,`Clear input`),this._crossIcon.setAttribute(`role`,`button`),this._updateCrossIconTabIndex(),n.replaceWith(this._crossIcon));let r=(t=this._iconContainerElement)==null?void 0:t.querySelector(`#icon-right`);r&&(this._scanIcon=c.create(),this._scanIcon.size=20,this._scanIcon.setAttribute(`aria-label`,`Scan barcode`),this._scanIcon.setAttribute(`role`,`button`),this._scanIcon.setAttribute(`tabindex`,`0`),r.replaceWith(this._scanIcon))}_updateCrossIconTabIndex(){!this._crossIcon||!this._scanIcon||(this.hasAttribute(`has-value`)?(this._crossIcon.setAttribute(`tabindex`,`0`),this._scanIcon.setAttribute(`tabindex`,`0`)):(this._crossIcon.setAttribute(`tabindex`,`-1`),this._scanIcon.setAttribute(`tabindex`,`0`)))}_updateInputDisplay(){this._inputElement&&(this.loading&&this._loadingText?this._inputElement.value=this._loadingText:this._inputElement.value=this._value)}connectedCallback(){this.setAttribute(`role`,`textbox`),this._initializeAttributesFromElement(),this._initializeIcons(),this._addEventListeners(),this._isInitialized=!0}_initializeAttributesFromElement(){if(this.hasAttribute(`name`)&&(this.name=this.getAttribute(`name`)||``),this.hasAttribute(`label`)&&(this.label=this.getAttribute(`label`)||``),this.hasAttribute(`placeholder`)&&(this.placeholder=this.getAttribute(`placeholder`)||``),this.hasAttribute(`type`)){let e=this.getAttribute(`type`);(e===`text`||e===`number`)&&(this.type=e)}this.hasAttribute(`value`)&&(this.value=this.getAttribute(`value`)||``),this.hasAttribute(`required`)&&(this.required=this.getAttribute(`required`)!==null),this.hasAttribute(`invalid`)&&(this.invalid=this.getAttribute(`invalid`)!==null),this.hasAttribute(`hide-scan-icon`)&&(this.hideScanIcon=this.getAttribute(`hide-scan-icon`)!==null),this._hintMessageElement&&(this.hintMessage=this._hintMessage||``)}disconnectedCallback(){var e,t;this._isInitialized=!1,clearTimeout(this._clearTabIndexTimeout),this._removeEventListeners(),(e=this._crossIcon)==null||e.remove(),(t=this._scanIcon)==null||t.remove()}formAssociatedCallback(e){}formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value=this.getAttribute(`value`)||``,this.resetValidation()}_addEventListeners(){var e,t,n,r,i,a;this._inputElement&&(this._inputElement.addEventListener(`input`,this._handleInput),this._inputElement.addEventListener(`focus`,this._handleFocus),this._inputElement.addEventListener(`blur`,this._handleBlur),this._inputElement.addEventListener(`keydown`,this._handleKeydown),(e=this._crossIcon)==null||e.addEventListener(`pointerdown`,this._handleCrossIconPointerDown,{capture:!0}),(t=this._crossIcon)==null||t.addEventListener(`pointerup`,this._handleCrossIconPointerUp),(n=this._crossIcon)==null||n.addEventListener(`keydown`,this._handleCrossIconKeyDown),(r=this._scanIcon)==null||r.addEventListener(`pointerdown`,this._handleScanIconPointerDown,{capture:!0}),(i=this._scanIcon)==null||i.addEventListener(`pointerup`,this._handleScanIconPointerUp),(a=this._scanIcon)==null||a.addEventListener(`keydown`,this._handleScanIconKeyDown))}_removeEventListeners(){var e,t,n,r,i,a;this._inputElement&&(this._inputElement.removeEventListener(`input`,this._handleInput),this._inputElement.removeEventListener(`focus`,this._handleFocus),this._inputElement.removeEventListener(`blur`,this._handleBlur),this._inputElement.removeEventListener(`keydown`,this._handleKeydown),(e=this._crossIcon)==null||e.removeEventListener(`pointerdown`,this._handleCrossIconPointerDown),(t=this._crossIcon)==null||t.removeEventListener(`pointerup`,this._handleCrossIconPointerUp),(n=this._crossIcon)==null||n.removeEventListener(`keydown`,this._handleCrossIconKeyDown),(r=this._scanIcon)==null||r.removeEventListener(`pointerdown`,this._handleScanIconPointerDown),(i=this._scanIcon)==null||i.removeEventListener(`pointerup`,this._handleScanIconPointerUp),(a=this._scanIcon)==null||a.removeEventListener(`keydown`,this._handleScanIconKeyDown))}_onCrossIconPointerDown(e){e&&e.preventDefault()}_onCrossIconPointerUp(e){!e||!this._crossIcon||(e.preventDefault(),this._triggerClear())}_onCrossIconKeyDown(e){!e||!this._crossIcon||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),this._triggerClear())}_onScanIconPointerDown(e){e&&(e.preventDefault(),e.stopPropagation())}_onScanIconPointerUp(e){!e||!this._scanIcon||(e.preventDefault(),e.stopPropagation(),this._triggerScan())}_triggerClear(){this.dispatchEvent(new d({target:this,innerInput:this._inputElement,value:this._value}))}_onScanIconKeyDown(e){!e||!this._scanIcon||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),this._triggerScan())}_triggerScan(){this.dispatchEvent(new u({target:this,innerInput:this._inputElement,value:this._value}))}static create(){return document.createElement(r.tag)}static register(){n({[r.tag]:r})}};_.tag=`scandit-text-input`,_.formAssociated=!0;export{_ as TextInput,p as TextInputBlurEvent,d as TextInputClearEvent,l as TextInputEvents,f as TextInputFocusEvent,m as TextInputInputEvent,h as TextInputKeydownEvent,u as TextInputScanEvent};
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { t as Button } from "../../Button-
|
|
1
|
+
import { t as Button } from "../../Button-BQw0QTaa.js";
|
|
2
2
|
import { TextInput, TextInputEventMap } from "../atoms/TextInput.js";
|
|
3
3
|
import { Backdrop } from "@scandit/web-datacapture-core/build/js/private/ui/atoms/Backdrop.js";
|
|
4
4
|
import { ScanditHTMLElement } from "@scandit/web-datacapture-core/build/js/private/utils/index.js";
|
|
5
|
-
|
|
6
5
|
//#region src/main/ui/organisms/LabelCaptureValidationFlowLayout.d.ts
|
|
7
6
|
declare const SIDE_PANEL_MAX_WIDTH_PX = 960;
|
|
8
7
|
/**
|
|
@@ -24,7 +23,8 @@ interface LabelCaptureValidationFlowLayoutEventMap extends TextInputEventMap {
|
|
|
24
23
|
formHeight: number;
|
|
25
24
|
formWidth: number;
|
|
26
25
|
buttonsHeight: number;
|
|
27
|
-
isLandscape: boolean;
|
|
26
|
+
isLandscape: boolean;
|
|
27
|
+
/** True only when the side-panel landscape layout is active (landscape + width ≤ 960 px). */
|
|
28
28
|
isPanelOnRightSide: boolean;
|
|
29
29
|
safeAreaInsetBottom: number;
|
|
30
30
|
safeAreaInsetTop: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("@scandit/web-datacapture-core"),require("@scandit/web-datacapture-barcode"),require("@scandit/web-datacapture-core/build/js/private/nativeHandle.js"),require("@scandit/web-datacapture-core/build/js/private/utils/warnMultithreadingUnavailable.js"),require("@scandit/web-datacapture-core/build/js/private/utils/debounce.js"),require("@scandit/web-datacapture-core/build/js/private/utils/AsyncStateMachine.js"),require("@scandit/web-datacapture-core/build/js/private/ui/atoms/Backdrop.js"),require("@scandit/web-datacapture-core/build/js/private/utils/index.js"),require("@scandit/web-datacapture-core/build/js/private/GestureRecognizer/index.js"),require("@scandit/web-datacapture-core/build/js/private/ui/colors.js"),require("@scandit/web-datacapture-core/build/js/commons/Color.js"),require("@scandit/web-datacapture-core/build/js/private/ui/atoms/CrossSvgIcon.js"),require("@scandit/web-datacapture-core/build/js/private/ui/atoms/ScanSvgIcon.js"),require("@scandit/web-datacapture-core/build/js/private/OrientationObserver.js"),require("@scandit/web-datacapture-core/build/js/private/utils/safeRequestAnimationFrame.js")):typeof define==`function`&&define.amd?define([`exports`,`@scandit/web-datacapture-core`,`@scandit/web-datacapture-barcode`,`@scandit/web-datacapture-core/build/js/private/nativeHandle.js`,`@scandit/web-datacapture-core/build/js/private/utils/warnMultithreadingUnavailable.js`,`@scandit/web-datacapture-core/build/js/private/utils/debounce.js`,`@scandit/web-datacapture-core/build/js/private/utils/AsyncStateMachine.js`,`@scandit/web-datacapture-core/build/js/private/ui/atoms/Backdrop.js`,`@scandit/web-datacapture-core/build/js/private/utils/index.js`,`@scandit/web-datacapture-core/build/js/private/GestureRecognizer/index.js`,`@scandit/web-datacapture-core/build/js/private/ui/colors.js`,`@scandit/web-datacapture-core/build/js/commons/Color.js`,`@scandit/web-datacapture-core/build/js/private/ui/atoms/CrossSvgIcon.js`,`@scandit/web-datacapture-core/build/js/private/ui/atoms/ScanSvgIcon.js`,`@scandit/web-datacapture-core/build/js/private/OrientationObserver.js`,`@scandit/web-datacapture-core/build/js/private/utils/safeRequestAnimationFrame.js`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.SDCLabel={},e.SDCCore,e.SDCBarcode,e.SDCCore.Internal.private_nativeHandle,e.SDCCore.Internal.private_utils_warnMultithreadingUnavailable,e.SDCCore.Internal.private_utils_debounce,e.SDCCore.Internal.private_utils_AsyncStateMachine,e.SDCCore.Internal.private_ui_atoms_Backdrop,e.SDCCore.Internal.private_utils_index,e.SDCCore.Internal.private_GestureRecognizer_index,e.SDCCore.Internal.private_ui_colors,e.SDCCore.Internal.commons_Color,e.SDCCore.Internal.private_ui_atoms_CrossSvgIcon,e.SDCCore.Internal.private_ui_atoms_ScanSvgIcon,e.SDCCore.Internal.private_OrientationObserver,e.SDCCore.Internal.private_utils_safeRequestAnimationFrame))})(this,function(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var g=Object.defineProperty,_=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},v=(e,t)=>{let n={};for(var r in e)g(n,r,{get:e[r],enumerable:!0});return t||g(n,Symbol.toStringTag,{value:`Module`}),n};let y=function(e){return e.Off=`off`,e.Auto=`auto`,e.On=`on`,e}({}),b=function(e){return e[e.Captured=0]=`Captured`,e[e.Predicted=1]=`Predicted`,e[e.Unknown=2]=`Unknown`,e}({}),x=function(e){return e[e.Barcode=0]=`Barcode`,e[e.Text=1]=`Text`,e[e.Unknown=3]=`Unknown`,e}({}),S=function(e){return e[e.Date=0]=`Date`,e[e.Price=1]=`Price`,e[e.Weight=2]=`Weight`,e[e.Text=3]=`Text`,e[e.Numeric=4]=`Numeric`,e}({});var C=class e{get day(){return this._day??null}get month(){return this._month??null}get year(){return this._year??null}get dayString(){return this._dayString}get monthString(){return this._monthString}get yearString(){return this._yearString}static fromJSON(t){let n=new e;return n._day=t.day??void 0,n._month=t.month??void 0,n._year=t.year??void 0,n._dayString=t.dayStr,n._monthString=t.monthStr,n._yearString=t.yearStr,n}toJSONObject(){return{day:this._day??null,month:this._month??null,year:this._year??null,dayStr:this._dayString,monthStr:this._monthString,yearStr:this._yearString}}};function w(e){let n=Math.sqrt(e.x*e.x+e.y*e.y);return new t.Point(e.x/n,e.y/n)}function T(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function E(e){return{[x.Barcode]:`barcode`,[x.Text]:`text`,[x.Unknown]:`unknown`}[e]}function D(e){let t={barcode:x.Barcode,text:x.Text,unknown:x.Unknown}[e];if(t==null)throw Error(`Invalid label field type: ${e}`);return t}function O(e){let t={date:S.Date,price:S.Price,weight:S.Weight,text:S.Text,numeric:S.Numeric}[e];if(t==null)throw Error(`Invalid label field value type: ${e}`);return t}function k(e){let t={[S.Date]:`date`,[S.Price]:`price`,[S.Weight]:`weight`,[S.Text]:`text`,[S.Numeric]:`numeric`}[e];if(t==null)throw Error(`Invalid label field value type: ${e}`);return t}function A(e){if(typeof e==`number`){let t={0:b.Captured,1:b.Predicted,2:b.Unknown};if(t[e]==null)throw Error(`Invalid label field state: ${e}`);return t[e]}let t={captured:b.Captured,predicted:b.Predicted,unknown:b.Unknown}[e.toLowerCase()];if(t==null)throw Error(`Invalid label field state: ${e}`);return t}function j(e){let t={[b.Captured]:`captured`,[b.Predicted]:`predicted`,[b.Unknown]:`unknown`}[e];if(t==null)throw Error(`Invalid label field state: ${e}`);return t}var M=class e{constructor(){this._instanceIndex=null}get name(){return this._name}get type(){return this._type}get predictedLocation(){return this._predictedLocation}get state(){return this._state}get isRequired(){return this._isRequired}get barcode(){return this._barcode}get text(){return this._text}get valueType(){return this._valueType}get anchorPositions(){let e=this.predictedLocation,n=new t.Point(e.topRight.x-e.topLeft.x,e.topRight.y-e.topLeft.y),r=new t.Point(e.bottomRight.x-e.topRight.x,e.bottomRight.y-e.topRight.y),i=new t.Point(e.bottomLeft.x-e.bottomRight.x,e.bottomLeft.y-e.bottomRight.y),a=new t.Point(e.topLeft.x-e.bottomLeft.x,e.topLeft.y-e.bottomLeft.y),o=T(n)/2,s=T(r)/2,c=T(i)/2,l=T(a)/2,u=w(n),d=w(r),f=w(i),p=w(a),m={x:e.topLeft.x+u.x*o,y:e.topLeft.y+u.y*o},h={x:e.topRight.x+d.x*s,y:e.topRight.y+d.y*s},g={x:e.bottomRight.x+f.x*c,y:e.bottomRight.y+f.y*c},_={x:e.bottomLeft.x+p.x*l,y:e.bottomLeft.y+p.y*l},v={x:(m.x+h.x+g.x+_.x)/4,y:(m.y+h.y+g.y+_.y)/4};return t.AnchorPositions.fromJSON({center:new t.Point(v.x,v.y).toJSONObject(),topCenter:new t.Point(m.x,m.y).toJSONObject(),bottomCenter:new t.Point(g.x,g.y).toJSONObject(),centerLeft:new t.Point(_.x,_.y).toJSONObject(),centerRight:new t.Point(h.x,h.y).toJSONObject(),topLeft:e.topLeft.toJSONObject(),topRight:e.topRight.toJSONObject(),bottomLeft:e.bottomLeft.toJSONObject(),bottomRight:e.bottomRight.toJSONObject()})}get date(){return this._date}get instanceIndex(){return this._instanceIndex}static fromJSON(r){let i=new e;return i._valueType=O(r.valueType),i._name=r.name,i._type=D(r.type),i._predictedLocation=t.Quadrilateral.fromJSON(r.location),i._state=A(r.state),i._isRequired=r.isRequired,i._barcode=r.barcode?n.Barcode.fromJSON(r.barcode):null,i._text=r.text,i._date=r.date?C.fromJSON(r.date):null,i._instanceIndex=r.instanceIndex??null,i}toJSONObject(){return{name:this._name,type:E(this._type),location:this._predictedLocation.toJSONObject(),state:j(this._state),isRequired:this._isRequired,barcode:this._barcode?this._barcode.toJSONObject():null,text:this._text,date:this._date?this._date.toJSONObject():null,valueType:k(this._valueType),instanceIndex:this._instanceIndex}}},N=class e{get fields(){return this._fields}get name(){return this._name}get isComplete(){return this._isComplete}get predictedBounds(){return this._predictedBounds}get deltaTimeToPrediction(){return this._deltaTimeToPrediction}get trackingId(){return this._trackingId}static fromJSON(n){let r=new e;return r._fields=n.fields.map(e=>M.fromJSON(e)),r._name=n.name,r._isComplete=n.isComplete,r._predictedBounds=t.Quadrilateral.fromJSON(n.predictedBounds),r._deltaTimeToPrediction=n.deltaTimeToPrediction,r._trackingId=n.trackingId,r}toJSONObject(){return{fields:this._fields.map(e=>e.toJSONObject()),name:this._name,isComplete:this._isComplete,predictedBounds:this._predictedBounds.toJSONObject(),deltaTimeToPrediction:this._deltaTimeToPrediction,trackingId:this._trackingId}}},P=class e{constructor(e){this[r.nativeHandle]=e}get name(){return this._name}get anchorRegexes(){return this._anchorRegexes}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get symbologies(){return this._symbologies}get location(){return this._location}get hiddenProperties(){return this._hiddenProperties}static forHandle(t){return new e(t)}};let F=new Map;function I(){let e=F.get(`LabelCapture`);if(!e)throw Error(`No DataCaptureWorker instance found. Make sure you call "configure" first.`);return e}async function L(e,...t){return await I().workerCommand(e,{args:t})}function ee(e){return{[n.Symbology.Aztec]:13,[n.Symbology.Codabar]:8,[n.Symbology.Code11]:6,[n.Symbology.Code128]:5,[n.Symbology.Code25]:7,[n.Symbology.Code32]:24,[n.Symbology.Code39]:3,[n.Symbology.Code93]:4,[n.Symbology.DataMatrix]:12,[n.Symbology.DotCode]:15,[n.Symbology.EAN13UPCA]:0,[n.Symbology.EAN8]:2,[n.Symbology.GS1Databar]:18,[n.Symbology.GS1DatabarExpanded]:19,[n.Symbology.GS1DatabarLimited]:20,[n.Symbology.IATATwoOfFive]:26,[n.Symbology.InterleavedTwoOfFive]:9,[n.Symbology.KIX]:16,[n.Symbology.Lapa4SC]:25,[n.Symbology.MSIPlessey]:10,[n.Symbology.MatrixTwoOfFive]:27,[n.Symbology.MaxiCode]:14,[n.Symbology.MicroPDF417]:22,[n.Symbology.MicroQR]:23,[n.Symbology.PDF417]:21,[n.Symbology.QR]:11,[n.Symbology.RoyalMail4state]:17,[n.Symbology.UPCE]:1,[n.Symbology.USPSIntelligentMail]:28,[n.Symbology.ArUco]:29}[e]}var R=class{constructor(){this._isOptional=!1,this._numberOfMandatoryInstances=null,this.valueRegexes=[],this.hiddenProperties={}}isOptional(e){return this._isOptional=e,this.getThis()}setNumberOfMandatoryInstances(e){return this._numberOfMandatoryInstances=e,this.getThis()}setValueRegexes(e){return this.valueRegexes=e,this.getThis()}setValueRegex(e){return this.valueRegexes=[e],this.getThis()}setHiddenProperty(e,t){return this.hiddenProperties[e]=t,this.getThis()}setHiddenProperties(e){return this.hiddenProperties=e,this.getThis()}resolveName(e){let t=e??this._name;if(t==null)throw Error(`Label field name is required`);return t}async applyCommonFieldSettings(e){let{className:t}=e;Object.keys(this.hiddenProperties).length>0&&await L(`${t}.setHiddenProperties`,e,JSON.stringify(this.hiddenProperties)),await L(`${t}.setOptional`,e,this._isOptional),this.valueRegexes.length>0&&await L(`${t}.setPatterns`,e,this.valueRegexes),this._numberOfMandatoryInstances!=null&&await L(`${t}.setNumberOfMandatoryInstances`,e,this._numberOfMandatoryInstances)}async applyAnchorRegexes(e,t){t!=null&&t.length>0&&await L(`${e.className}.setDataTypePatterns`,e,t)}async applyAnchorRegexesOrReset(e,t,n){let{className:r}=e;n?await L(`${r}.resetDataTypePatterns`,e):t!=null&&t.length>0&&await L(`${r}.setDataTypePatterns`,e,t)}},z=class extends R{constructor(...e){super(...e),this.barcodeCaptureSettings=new n.BarcodeCaptureSettings,this.symbologySettings=[]}get symbologies(){return this.symbologySettings.map(e=>e.symbology)}set symbologies(e){this.symbologySettings=e.map(e=>this.mapSymbologyToSymbologySettings(e))}setSymbology(e){return this.symbologySettings=[this.mapSymbologyToSymbologySettings(e)],this.getThis()}setSymbologies(e){return this.symbologies=e,this.getThis()}mapSymbologyToSymbologySettings(e){return this.barcodeCaptureSettings.settingsForSymbology(e)}async resolveNativeSymbologySettings(){return L(`BarcodeField.defaultSymbologies`,this.symbologies.map(e=>ee(e)))}async applySymbologies(e){let t=await this.resolveNativeSymbologySettings();await L(`${e.className}.setSymbologies`,e,t)}},te=class extends z{constructor(e){super(),this.anchorRegexes=[],this._name=e}setAnchorRegexes(e){return this.anchorRegexes=e,this.getThis()}setAnchorRegex(e){return this.anchorRegexes=[String(e)],this.getThis()}setLocation(e){return this.location=e,this.getThis()}async build(e){let t=this.resolveName(e),n=await L(`CustomBarcode.create`,t,await this.resolveNativeSymbologySettings());await this.applyCommonFieldSettings(n),await this.applyAnchorRegexes(n,this.anchorRegexes),this.location!=null&&await L(`CustomBarcode.setLocation`,n,this.location[r.nativeHandle]);let i=P.forHandle(n);return i._anchorRegexes=this.anchorRegexes,i._isOptional=this._isOptional,i._numberOfMandatoryInstances=this._numberOfMandatoryInstances,i._name=t,i._valueRegexes=this.valueRegexes,i._symbologies=this.symbologySettings,i._location=this.location,i}getThis(){return this}};function ne(e){return new te(e)}var re=class e{constructor(e){this[r.nativeHandle]=e}get name(){return this._name}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get location(){return this._location}get anchorRegexes(){return this._anchorRegexes}get hiddenProperties(){return this._hiddenProperties}static forHandle(t){return new e(t)}},B=class extends R{},ie=class extends B{constructor(e){super(),this.anchorRegexes=[],this.shouldResetAnchorRegexes=!1,this._name=e}setAnchorRegexes(e){return this.anchorRegexes=e,this.getThis()}setAnchorRegex(e){return this.anchorRegexes=[String(e)],this.getThis()}resetAnchorRegexes(){return this.shouldResetAnchorRegexes=!0,this.getThis()}setLocation(e){return this.location=e,this.getThis()}async build(e){let t=this.resolveName(e),n=await L(`CustomText.create`,t);await this.applyCommonFieldSettings(n),await this.applyAnchorRegexesOrReset(n,this.anchorRegexes,this.shouldResetAnchorRegexes),this.location!=null&&await L(`CustomText.setLocation`,n,this.location[r.nativeHandle]);let i=re.forHandle(n);return i._anchorRegexes=this.anchorRegexes,i._isOptional=this._isOptional,i._numberOfMandatoryInstances=this._numberOfMandatoryInstances,i._name=t,i._valueRegexes=this.valueRegexes,i._location=this.location,i}getThis(){return this}};function ae(e){return new ie(e)}var oe=class e{constructor(e){this._anchorRegexes=[],this[r.nativeHandle]=e}get name(){return this._name}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get labelDateFormat(){return this._labelDateFormat??null}get anchorRegexes(){return this._anchorRegexes}static forHandle(t){return new e(t)}};let se=function(e){return e[e.DMY=0]=`DMY`,e[e.MDY=1]=`MDY`,e[e.YMD=2]=`YMD`,e}({});var ce=class{constructor(e,t=!0){this._acceptPartialDates=!0,this._componentFormat=e,this._acceptPartialDates=t}get componentFormat(){return this._componentFormat}get acceptPartialDates(){return this._acceptPartialDates}toJSONObject(){return{componentFormat:this._componentFormat,acceptPartialDates:this._acceptPartialDates}}},le=class e extends B{constructor(t){super(),this.shouldResetAnchorRegexes=!1,this.labelDateFormat=e.defaultLabelDateFormat(),this._name=t}static defaultLabelDateFormat(){return new ce(se.DMY,!1)}setAnchorRegexes(e){return this.anchorRegexes=e,this}setAnchorRegex(e){return this.anchorRegexes=[e],this}resetAnchorRegexes(){return this.shouldResetAnchorRegexes=!0,this}setLabelDateFormat(e){return this.labelDateFormat=e,this}async build(e){let t=this.resolveName(e),n=await L(`DateText.create`,t,this.labelDateFormat.toJSONObject());await this.applyCommonFieldSettings(n),await this.applyAnchorRegexesOrReset(n,this.anchorRegexes,this.shouldResetAnchorRegexes);let r=oe.forHandle(n);return r._isOptional=this._isOptional,r._numberOfMandatoryInstances=this._numberOfMandatoryInstances,r._name=t,r._valueRegexes=this.valueRegexes,r._labelDateFormat=this.labelDateFormat,r._anchorRegexes=this.anchorRegexes??[],r}getThis(){return this}};function ue(e){return new le(e)}var de=class e{constructor(e){this._anchorRegexes=[],this[r.nativeHandle]=e}get name(){return this._name}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get dateFormat(){return this._dateFormat??null}get anchorRegexes(){return this._anchorRegexes}static forHandle(t){return new e(t)}},fe=class extends B{constructor(e){super(),this.shouldResetAnchorRegexes=!1,this._name=e}setAnchorRegexes(e){return this.anchorRegexes=e,this}setAnchorRegex(e){return this.anchorRegexes=[e],this}resetAnchorRegexes(){return this.shouldResetAnchorRegexes=!0,this}setLabelDateFormat(e){return this.labelDateFormat=e,this}async build(e){let t=this.resolveName(e),n=await L(`ExpiryDateText.create`,t);await L(`ExpiryDateText.setOptional`,n,this._isOptional),this.labelDateFormat!=null&&await L(`ExpiryDateText.setLabelDateFormat`,n,this.labelDateFormat.toJSONObject()),this.valueRegexes.length>0&&await L(`ExpiryDateText.setPatterns`,n,this.valueRegexes),await this.applyAnchorRegexesOrReset(n,this.anchorRegexes,this.shouldResetAnchorRegexes),Object.keys(this.hiddenProperties).length>0&&await L(`ExpiryDateText.setHiddenProperties`,n,JSON.stringify(this.hiddenProperties)),this._numberOfMandatoryInstances!=null&&await L(`ExpiryDateText.setNumberOfMandatoryInstances`,n,this._numberOfMandatoryInstances);let r=de.forHandle(n);return r._isOptional=this._isOptional,r._numberOfMandatoryInstances=this._numberOfMandatoryInstances,r._name=t,r._valueRegexes=this.valueRegexes,r._dateFormat=this.labelDateFormat,r._anchorRegexes=this.anchorRegexes??[],r}getThis(){return this}};function pe(e){return new fe(e)}var me=class e{constructor(e){this[r.nativeHandle]=e}get name(){return this._name}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get symbologies(){return this._symbologies}static forHandle(t){return new e(t)}},he=class extends z{constructor(e){super(),this.anchorRegexes=[],this._name=e}setAnchorRegexes(e){return this.anchorRegexes=e,this.getThis()}setAnchorRegex(e){return this.anchorRegexes=[String(e)],this.getThis()}async build(e){let t=this.resolveName(e),n=await L(`ImeiOneBarcode.create`,t);await this.applyCommonFieldSettings(n),await this.applyAnchorRegexes(n,this.anchorRegexes),await this.applySymbologies(n);let r=me.forHandle(n);return r._isOptional=this._isOptional,r._numberOfMandatoryInstances=this._numberOfMandatoryInstances,r._name=t,r._valueRegexes=this.valueRegexes,r._symbologies=this.symbologySettings,r}getThis(){return this}};function ge(e){return new he(e)}var _e=class e{constructor(e){this[r.nativeHandle]=e}get name(){return this._name}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get symbologies(){return this._symbologies}static forHandle(t){return new e(t)}},ve=class extends z{constructor(e){super(),this.anchorRegexes=[],this._name=e}setAnchorRegexes(e){return this.anchorRegexes=e,this.getThis()}setAnchorRegex(e){return this.anchorRegexes=[String(e)],this.getThis()}async build(e){let t=this.resolveName(e),n=await L(`ImeiTwoBarcode.create`,t);await this.applyCommonFieldSettings(n),await this.applyAnchorRegexes(n,this.anchorRegexes),await this.applySymbologies(n);let r=_e.forHandle(n);return r._isOptional=this._isOptional,r._numberOfMandatoryInstances=this._numberOfMandatoryInstances,r._name=t,r._valueRegexes=this.valueRegexes,r._symbologies=this.symbologySettings,r}getThis(){return this}};function ye(e){return new ve(e)}var be=class e{constructor(){this.success=new t.Feedback(t.Feedback.defaultFeedback.vibration,t.Feedback.defaultFeedback.sound)}static get default(){return new e}toJSONObject(){return{success:this.success.toJSONObject()}}},xe=class e{get lastProcessedFrameId(){return this._lastProcessedFrameId}get frameSequenceId(){return this._frameSequenceId}get capturedLabels(){return this._capturedLabels}get canShowLocations(){return this._canShowLocations}static fromJSON(t){let n=new e;return n._canShowLocations=t.canShowLocations,n._lastProcessedFrameId=t.lastFrameId,n._frameSequenceId=t.frameSequenceId,n._capturedLabels=t.labels.map(e=>N.fromJSON(e)),n}};let Se=Symbol(`contextHandle`),Ce=Symbol(`listenerHandle`),we=function(e){return e.Receipt=`receipt`,e.ShippingLabel=`shipping-label`,e}({});var Te=class e{constructor(e){this.resultType=`receipt`,this[r.nativeHandle]=e}async setProcessingHintText(e){await L(`ReceiptScanningSettings.setProcessingHintText`,this[r.nativeHandle],e)}async getProcessingHintText(){return L(`ReceiptScanningSettings.getProcessingHintText`,this[r.nativeHandle])}static async create(t){let n=t??`receipt`,r=await L(`ReceiptScanningSettings.create`),i=new e(r);return i.resultType=n,await i.getProcessingHintText(),i}},Ee=class{constructor(){this.resultType=`receipt`}},De=class e{get name(){return this._name}get unitPrice(){return this._unitPrice??null}get discount(){return this._discount??null}get quantity(){return this._quantity}get totalPrice(){return this._totalPrice??null}static fromJSON(t){let n=new e;return n._name=t.name,n._quantity=t.quantity,n._unitPrice=t.unitPrice??void 0,n._discount=t.discount??void 0,n._totalPrice=t.totalPrice??void 0,n}toJSONObject(){return{name:this._name,unitPrice:this._unitPrice??null,discount:this._discount??null,quantity:this._quantity,totalPrice:this._totalPrice??null}}},Oe=class e extends Ee{constructor(...e){super(...e),this.resultType=`receipt`}get storeName(){return this._storeName??null}get storeCity(){return this._storeCity??null}get storeAddress(){return this._storeAddress??null}get date(){return this._date??null}get time(){return this._time??null}get paymentPreTaxTotal(){return this._paymentPreTaxTotal??null}get paymentTax(){return this._paymentTax??null}get paymentTotal(){return this._paymentTotal??null}get loyaltyNumber(){return this._loyaltyNumber??null}get lineItems(){return this._lineItems}static fromJSON(t){let n=new e;return n._lineItems=t.lineItems.map(e=>De.fromJSON(e)),n._storeName=t.storeName??void 0,n._storeCity=t.storeCity??void 0,n._storeAddress=t.storeAddress??void 0,n._date=t.date??void 0,n._time=t.time??void 0,n._paymentPreTaxTotal=t.paymentPreTaxTotal??void 0,n._paymentTax=t.paymentTax??void 0,n._paymentTotal=t.paymentTotal??void 0,n._loyaltyNumber=t.loyaltyNumber??void 0,n}toJSONObject(){return{storeName:this._storeName??null,storeCity:this._storeCity??null,storeAddress:this._storeAddress??null,date:this._date??null,time:this._time??null,paymentPreTaxTotal:this._paymentPreTaxTotal??null,paymentTax:this._paymentTax??null,paymentTotal:this._paymentTotal??null,loyaltyNumber:this._loyaltyNumber??null,lineItems:this._lineItems.map(e=>e.toJSONObject())}}};let ke=function(e){return e.Fedex=`fedex`,e.Ups=`ups`,e.Usps=`usps`,e.Dhl=`dhl`,e.Dpd=`dpd`,e.Gls=`gls`,e.Tnt=`tnt`,e.AmazonLogistics=`amazon-logistics`,e.Ontrac=`ontrac`,e.RoyalMail=`royal-mail`,e.Parcelforce=`parcelforce`,e.Evri=`evri`,e.Yodel=`yodel`,e.Chronopost=`chronopost`,e.Colissimo=`colissimo`,e.MondialRelay=`mondial-relay`,e.PosteItaliane=`poste-italiane`,e.Brt=`brt`,e.Sda=`sda`,e.Hermes=`hermes`,e.AustrianPost=`austrian-post`,e.SwissPost=`swiss-post`,e.Postnl=`postnl`,e.Bpost=`bpost`,e.Postnord=`postnord`,e.Correos=`correos`,e.Seur=`seur`,e.Inpost=`inpost`,e.Other=`other`,e.NotAvailable=`not-available`,e}({});var Ae=class e extends Ee{constructor(...e){super(...e),this.resultType=`shipping-label`,this._barcodes=[],this._trackingId=``,this._receiverFullName=``,this._receiverStreet=``,this._receiverCity=``,this._receiverPostalCode=``,this._carrier=`not-available`}get barcodes(){return this._barcodes}get trackingId(){return this._trackingId}get receiverFullName(){return this._receiverFullName}get receiverCompany(){return this._receiverCompany??null}get receiverStreet(){return this._receiverStreet}get receiverCity(){return this._receiverCity}get receiverState(){return this._receiverState??null}get receiverPostalCode(){return this._receiverPostalCode}get receiverCountry(){return this._receiverCountry??null}get carrier(){return this._carrier}static fromJSON(t){let r=new e;return r._barcodes=t.barcodes.map(e=>n.Barcode.fromJSON(e)),r._trackingId=t.trackingId,r._receiverFullName=t.receiverFullName,r._receiverCompany=t.receiverCompany??void 0,r._receiverStreet=t.receiverStreet,r._receiverCity=t.receiverCity,r._receiverState=t.receiverState??void 0,r._receiverPostalCode=t.receiverPostalCode,r._receiverCountry=t.receiverCountry??void 0,r._carrier=t.carrier,r}toJSONObject(){return{barcodes:this._barcodes.map(e=>e.toJSONObject()),trackingId:this._trackingId,receiverFullName:this._receiverFullName,receiverCompany:this._receiverCompany??null,receiverStreet:this._receiverStreet,receiverCity:this._receiverCity,receiverState:this._receiverState??null,receiverPostalCode:this._receiverPostalCode,receiverCountry:this._receiverCountry??null,carrier:this._carrier}}},je=class e{constructor(e){this.listeners=new Set,this.onWorkerMessageHandler=this.onWorkerMessage.bind(this),this.labelCaptureHandle=e[r.nativeHandle]}static async create(t){return new e(t)}async startFlow(e=`receipt`){await I().workerCommand(`receiptScanningHandlerStartFlow`,{payload:{labelCaptureHandle:this.labelCaptureHandle,resultType:e}})}async finishFlow(){await I().workerCommand(`receiptScanningHandlerFinishFlow`,{payload:{labelCaptureHandle:this.labelCaptureHandle}})}addListener(e){this.listeners.add(e),this.listeners.size===1&&(I().addWorkerListener(this.onWorkerMessageHandler),I().workerCommand(`receiptScanningHandlerAddListener`,{payload:{labelCaptureHandle:this.labelCaptureHandle}}))}removeListener(e){this.listeners.delete(e),this.listeners.size===0&&(I().removeWorkerListener(this.onWorkerMessageHandler),I().workerCommand(`receiptScanningHandlerRemoveListener`,{payload:{labelCaptureHandle:this.labelCaptureHandle}}))}onWorkerMessage(e){switch(e.type){case`receiptScanningListenerOnReceiptScanned`:this.onReceiptScanned(e.payload.result);break;case`receiptScanningListenerOnReceiptScanningFailed`:this.onReceiptScanningFailed();break;case`receiptScanningListenerOnShippingLabelScanned`:this.onShippingLabelScanned(e.payload.result);break;case`receiptScanningListenerOnShippingLabelScanningFailed`:this.onShippingLabelScanningFailed();break;case`receiptScanningListenerOnProcessingStarted`:this.onProcessingStarted();break}}onReceiptScanned(e){let t=Oe.fromJSON(e);for(let e of this.listeners){var n;(n=e.onReceiptScanned)==null||n.call(e,t)}}onReceiptScanningFailed(){for(let t of this.listeners){var e;(e=t.onReceiptScanningFailed)==null||e.call(t)}}onShippingLabelScanned(e){let t=Ae.fromJSON(e);for(let e of this.listeners){var n;(n=e.onShippingLabelScanned)==null||n.call(e,t)}}onShippingLabelScanningFailed(){for(let t of this.listeners){var e;(e=t.onShippingLabelScanningFailed)==null||e.call(t)}}onProcessingStarted(){for(let t of this.listeners){var e;(e=t.onProcessingStarted)==null||e.call(t)}}},V=class e{constructor(e,t,n){this.labelField=e,this.valid=t,this.processingInCloud=n}getLabelField(){return this.labelField}isValid(){return this.valid}isProcessingInCloud(){return this.processingInCloud}getInstanceIndex(){return this.labelField.instanceIndex}toJSONObject(){return{labelField:this.labelField.toJSONObject(),valid:this.valid,isProcessingInCloud:this.processingInCloud}}static fromJSONObject(t){return new e(M.fromJSON(t.labelField),t.valid,t.isProcessingInCloud)}},Me=class e{constructor(e,t){this.validationFlowListeners=new Set,this.onWorkerMessageHandler=this.onWorkerMessage.bind(this),this[r.nativeHandle]=e,this.labelCaptureWorkerManager=t}static async create(t){let n=I(),i=await n.workerCommand(`validationFlowHandlerCreate`,{payload:{labelCaptureHandle:t[r.nativeHandle]}});return new e(i,n)}async startCompleteLabelScan(e){await this.labelCaptureWorkerManager.workerCommand(`validationFlowHandlerStartCompleteLabelScan`,{payload:{labelCaptureHandle:this[r.nativeHandle],labelName:e}})}async startPartialLabelScan(e){await this.labelCaptureWorkerManager.workerCommand(`validationFlowHandlerStartPartialLabelScan`,{payload:{labelCaptureHandle:this[r.nativeHandle],targets:e}})}async updateFieldValue(e,t){return await this.labelCaptureWorkerManager.workerCommand(`validationFlowHandlerUpdateFieldValue`,{payload:{labelCaptureHandle:this[r.nativeHandle],target:e,value:t}})}async onFinishFlowRequested(){return await this.labelCaptureWorkerManager.workerCommand(`validationFlowHandlerFinishFlow`,{payload:{labelCaptureHandle:this[r.nativeHandle]}})}async pauseScan(){await this.labelCaptureWorkerManager.workerCommand(`validationFlowHandlerPauseScan`,{payload:{labelCaptureHandle:this[r.nativeHandle]}})}async reset(){await this.labelCaptureWorkerManager.workerCommand(`validationFlowHandlerReset`,{payload:{labelCaptureHandle:this[r.nativeHandle]}})}async resumeScan(){await this.labelCaptureWorkerManager.workerCommand(`validationFlowHandlerResumeScan`,{payload:{labelCaptureHandle:this[r.nativeHandle]}})}async validationFlowFields(){return(await this.labelCaptureWorkerManager.workerCommand(`validationFlowHandlerGetValidationFlowFields`,{payload:{labelCaptureHandle:this[r.nativeHandle]}})).map(e=>V.fromJSONObject(e))}async clearAllFields(){await this.labelCaptureWorkerManager.workerCommand(`validationFlowHandlerClearAllFields`,{payload:{labelCaptureHandle:this[r.nativeHandle]}})}async cancelCloudBackupTaskForField(e){await this.labelCaptureWorkerManager.workerCommand(`validationFlowHandlerCancelCloudBackupTaskForField`,{payload:{labelCaptureHandle:this[r.nativeHandle],fieldName:e}})}async uncancelCloudBackupTaskForField(e){await this.labelCaptureWorkerManager.workerCommand(`validationFlowHandlerUncancelCloudBackupTaskForField`,{payload:{labelCaptureHandle:this[r.nativeHandle],fieldName:e}})}addListener(e){this.validationFlowListeners.size===0&&this.labelCaptureWorkerManager.addWorkerListener(this.onWorkerMessageHandler),this.validationFlowListeners.add(e)}removeListener(e){this.validationFlowListeners.delete(e),this.validationFlowListeners.size===0&&this.labelCaptureWorkerManager.removeWorkerListener(this.onWorkerMessageHandler)}async onWorkerMessage(e){if(this.validationFlowListeners.size!==0)switch(e.type){case`validationFlowListenerOnFieldsScanned`:{let n=e.payload.fields.map(e=>V.fromJSONObject(e));for(let e of this.validationFlowListeners){var t;(t=e.onFieldsScanned)==null||t.call(e,n)}break}case`validationFlowListenerOnScanTimeout`:{let e=[];for(let t of this.validationFlowListeners){var n;e.push((n=t.onScanTimeout)==null?void 0:n.call(t))}await Promise.all(e);break}case`validationFlowListenerOnLabelIsMissingRequiredField`:{let t=e.payload.fields.map(e=>V.fromJSONObject(e)),n=[];for(let e of this.validationFlowListeners){var r;n.push((r=e.onLabelIsMissingRequiredField)==null?void 0:r.call(e,t))}await Promise.all(n);break}case`validationFlowListenerOnManualInput`:{let t=V.fromJSONObject(e.payload.field);for(let n of this.validationFlowListeners){var i;(i=n.onManualInput)==null||i.call(n,t,e.payload.oldValue,e.payload.newValue)}break}case`validationFlowListenerOnStateChanged`:{let t=e.payload.state,n=[];for(let e of this.validationFlowListeners){var a;n.push((a=e.onStateChanged)==null?void 0:a.call(e,t))}await Promise.all(n);break}case`validationFlowListenerOnCloudBackupServiceStarted`:{let e=[];for(let t of this.validationFlowListeners){var o;e.push((o=t.onCloudBackupServiceStarted)==null?void 0:o.call(t))}await Promise.all(e);break}case`validationFlowListenerOnCloudBackupServiceStopped`:for(let e of this.validationFlowListeners){var s;(s=e.onCloudBackupServiceStopped)==null||s.call(e)}break;case`validationFlowListenerOnResultUpdate`:{let t=e.payload.updateType,n=e.payload.fields.map(e=>V.fromJSONObject(e));for(let r of this.validationFlowListeners){var c;(c=r.onResultUpdate)==null||c.call(r,t,n,e.payload.data)}break}case`validationFlowFeedbackForCloudBackupEmit`:for(let e of this.validationFlowListeners){var l;(l=e.onCloudBackupFeedbackEmit)==null||l.call(e)}break}}},Ne=class e{constructor(e,t){this.skipSerialization=!0,this.context=null,this.listeners=new Set,this._receiptScanningHandler=null,this.workerListener=this.onWorkerMessage.bind(this),this._isEnabled=!0,this._feedback=be.default,this[r.nativeHandle]=e,this.context=t}toJSONObject(){return{type:`labelCapture`,enabled:this.isEnabled(),settings:{}}}async unsetValidationFlowHandler(){await L(`LabelCapture.unsetValidationFlowHandler`,this[r.nativeHandle])}async validationFlowHandler(){return await Me.create(this)}async receiptScanningHandler(){return this._receiptScanningHandler||=await je.create(this),this._receiptScanningHandler}static createRecommendedCameraSettings(){return t.CameraSettings.fromJSON({preferredResolution:t.VideoResolution.FullHD,zoomFactor:1,zoomGestureZoomFactor:1,focusGestureStrategy:t.FocusGestureStrategy.ManualUntilCapture,grayScaleFrameReader:!0})}static async forContext(t,n){(0,i.warnMultithreadingUnavailable)(),await I().initializeNativeHandles();let a=await L(`LabelCapture.create`,I()[Se],n[r.nativeHandle]),o=new e(a,t);return await t.addMode(o),o}async attachedToContext(e){this.context=e,await L(`LabelCaptureHelper.addLabelCaptureToContext`,this[r.nativeHandle],I()[Se])}async detachedFromContext(){await L(`LabelCaptureHelper.removeLabelCaptureFromContext`,this[r.nativeHandle],I()[Se]),this.context=null}get feedback(){return this._feedback}set feedback(e){this._feedback=e}isEnabled(){return this._isEnabled}async setEnabled(e){this._isEnabled=e;try{var t;await L(`LabelCapture.setEnabled`,this[r.nativeHandle],e),await((t=this.context)==null?void 0:t.update([{type:`modeEnabled`,newValue:e}],{updateContext:!1}))}catch(t){throw this._isEnabled=!e,t}}async applySettings(e){await L(`LabelCapture.applySettingsWrapped`,this[r.nativeHandle],e[r.nativeHandle])}addListener(e){var t;this.listeners.add(e),(t=e.didStartObservingLabelCapture)==null||t.call(e,this),this.listeners.size===1&&(I().addWorkerListener(this.workerListener),L(`LabelCapture.addListenerAsync`,this[r.nativeHandle],I()[Ce],1))}removeListener(e){var t;this.listeners.delete(e),(t=e.didStopObservingLabelCapture)==null||t.call(e,this),this.listeners.size===0&&(I().removeWorkerListener(this.workerListener),L(`LabelCapture.removeListenerAsync`,this[r.nativeHandle],I()[Ce]))}onWorkerMessage(e){switch(e.type){case`labelCaptureOnObservationStarted`:this.didStartObservingLabelCapture();break;case`labelCaptureOnObservationStopped`:this.didStopObservingLabelCapture();break;case`labelCaptureOnSessionUpdated`:this.didUpdateSession(e.payload.session,e.payload.data);break}}didStartObservingLabelCapture(){for(let t of this.listeners){var e;(e=t.didStartObservingLabelCapture)==null||e.call(t,this)}}didStopObservingLabelCapture(){for(let t of this.listeners){var e;(e=t.didStopObservingLabelCapture)==null||e.call(t,this)}}didUpdateSession(e,n){let r=xe.fromJSON(e),i=(0,t.convertToPublicFrameData)(n,this.context);r.capturedLabels.length>0&&this.emitFeedback();for(let e of this.listeners){var a;(a=e.didUpdateSession)==null||a.call(e,this,r,i)}}emitFeedback(){var e;(e=this._feedback)!=null&&e.success&&this._feedback.success.emit()}};function Pe(e,t,n){let i=Object.getOwnPropertyNames(Object.getPrototypeOf(n)).filter(e=>e!==`toJSONObject`),a=Object.getOwnPropertyNames(n);for(let a of i){let i=Object.getOwnPropertyDescriptor(Object.getPrototypeOf(n),a);i&&(i.set?Object.defineProperty(n,a,{...i,set:function(n){i.set&&i.set.call(this,n),t.workerCommand(`labelCaptureBasicOverlayUpdateViewfinder`,{payload:{labelCaptureBasicOverlayHandle:e[r.nativeHandle],viewfinderJSON:this.toJSONObject()}})}}):typeof i.value==`function`&&Object.defineProperty(n,a,{...i,value:function(...n){let a=i.value.apply(this,n);return t.workerCommand(`labelCaptureBasicOverlayUpdateViewfinder`,{payload:{labelCaptureBasicOverlayHandle:e[r.nativeHandle],viewfinderJSON:this.toJSONObject()}}),a}}))}for(let i of a){let a=Object.getOwnPropertyDescriptor(n,i);if(!a)continue;let o=n[i];Object.defineProperty(n,i,{enumerable:a.enumerable,configurable:!0,get:function(){return o},set:function(n){o=n,t.workerCommand(`labelCaptureBasicOverlayUpdateViewfinder`,{payload:{labelCaptureBasicOverlayHandle:e[r.nativeHandle],viewfinderJSON:this.toJSONObject()}})}})}return n}function Fe(e){return e instanceof t.RectangularViewfinder||e instanceof t.AimerViewfinder}var Ie=class e{static async withLabelCapture(t){let n=await I().workerCommand(`labelCaptureBasicOverlayForLabelCapture`,{payload:{labelCaptureHandle:t[r.nativeHandle]}});return new e(n)}static async withLabelCaptureForView(t,n){let i=await I().workerCommand(`labelCaptureBasicOverlayForLabelCapture`,{payload:{labelCaptureHandle:t[r.nativeHandle]}}),a=new e(i);return await n.addOverlay(a),a}constructor(e){this.listeners=new Set,this.onWorkerMessageHandler=this.onWorkerMessage.bind(this),this[r.nativeHandle]=e}toJSONObject(){return{type:this[r.nativeHandle].className,nativeHandle:this[r.nativeHandle]}}async getListener(){return this.listeners.size===0?null:[...this.listeners.values()][0]}async setListener(e){if(!e){this.listeners.clear(),I().removeWorkerListener(this.onWorkerMessageHandler),await I().workerCommand(`labelCaptureBasicOverlaySetListener`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle],value:!1}});return}this.listeners.size===0&&(this.listeners.add(e),I().addWorkerListener(this.onWorkerMessageHandler),await I().workerCommand(`labelCaptureBasicOverlaySetListener`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle],value:!0}}))}async getDefaultFieldBrush(e){return await I().workerCommand(`labelCaptureBasicOverlayGetDefaultFieldBrush`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle],labelFieldState:e}})}async setDefaultFieldBrush(e,t){return await I().workerCommand(`labelCaptureBasicOverlaySetDefaultFieldBrush`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle],labelFieldState:t,brush:e.toJSONObject()}})}async getDefaultLabelBrush(){return await I().workerCommand(`labelCaptureBasicOverlayGetDefaultLabelBrush`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle]}})}async setDefaultLabelBrush(e){return await I().workerCommand(`labelCaptureBasicOverlaySetDefaultLabelBrush`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle],brush:e.toJSONObject()}})}async setBrushForField(e,t,n){return await I().workerCommand(`labelCaptureBasicOverlaySetBrushForField`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle],fieldJSON:t.toJSONObject(),labelJSON:n.toJSONObject(),brush:e.toJSONObject()}})}async setBrushForLabel(e,t){return await I().workerCommand(`labelCaptureBasicOverlaySetBrushForLabel`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle],labelJSON:t.toJSONObject(),brush:e.toJSONObject()}})}async getShouldShowScanAreaGuides(){return await I().workerCommand(`labelCaptureBasicOverlayGetShouldShowScanAreaGuides`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle]}})}async setShouldShowScanAreaGuides(e){return await I().workerCommand(`labelCaptureBasicOverlaySetShouldShowScanAreaGuides`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle],show:e}})}async getViewfinder(){return await I().workerCommand(`labelCaptureBasicOverlayGetViewfinder`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle]}})}async setViewfinder(e){if(!Fe(e)){t.Logger.error(`Supported viewfinder types are RectangularViewfinder and AimerViewfinder`,e);return}return this.proxiedViewFinder=Pe(this,I(),e),await I().workerCommand(`labelCaptureBasicOverlayUpdateViewfinder`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle],viewfinderJSON:e==null?void 0:e.toJSONObject()}})}onWorkerMessage(e){switch(e.type){case`labelCaptureBasicOverlayOnLabelTapped`:for(let n of this.listeners){var t;(t=n.onLabelTapped)==null||t.call(n,this,N.fromJSON(e.payload.labelJSON))}break;case`labelCaptureBasicOverlayBrushForField`:for(let t of this.listeners){var n;let i=M.fromJSON(e.payload.fieldJSON),a=N.fromJSON(e.payload.labelJSON),o=(n=t.brushForField)==null?void 0:n.call(t,this,i,a);o?this.setBrushForField(o,i,a):I().workerCommand(`labelCaptureBasicOverlaySetBrushForField`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle],fieldJSON:i.toJSONObject(),labelJSON:a.toJSONObject(),brush:void 0}})}break;case`labelCaptureBasicOverlayBrushForLabel`:for(let t of this.listeners){var i;let n=N.fromJSON(e.payload.labelJSON),a=(i=t.brushForLabel)==null?void 0:i.call(t,this,n);a?this.setBrushForLabel(a,n):I().workerCommand(`labelCaptureBasicOverlaySetBrushForLabel`,{payload:{labelCaptureBasicOverlayHandle:this[r.nativeHandle],labelJSON:n.toJSONObject(),brush:void 0}})}break;default:break}}};function Le(e){return{off:0,auto:1,on:2}[e]}var Re=class e{constructor(e){this._hiddenProperties={},this._adaptiveRecognitionMode=`off`,this[r.nativeHandle]=e}get name(){return this._name}get fields(){return this._fields}get adaptiveRecognitionMode(){return this._adaptiveRecognitionMode}async setAdaptiveRecognitionMode(e){await L(`LabelDefinition.setAdaptiveRecognitionMode`,this[r.nativeHandle],Le(e)),this._adaptiveRecognitionMode=e}static builder(){return new H}static async createVinLabelDefinition(t,n){let{handle:r,hiddenProperties:i,fields:a}=await I().workerCommand(`labelCaptureBuildVinLabelDefinition`,{payload:{name:t,adaptiveRecognitionMode:n}}),o=e.forHandle(r);return o._hiddenProperties=i,o._name=t,o._fields=a,o._adaptiveRecognitionMode=n??`off`,o}static async createPriceCaptureDefinition(t,n){let{handle:r,hiddenProperties:i,fields:a}=await I().workerCommand(`labelCaptureBuildPriceCaptureDefinition`,{payload:{name:t,adaptiveRecognitionMode:n}}),o=e.forHandle(r);return o._hiddenProperties=i,o._name=t,o._fields=a,o._adaptiveRecognitionMode=n??`off`,o}static forHandle(t){return new e(t)}},H=class{constructor(e){this.fieldDefinitions=[],this.hiddenProperties={},this.adaptiveRecognitionMode_=`off`,this._name=e}addSerialNumberBarcode(e){return this.fieldDefinitions.push(e),this}addPartNumberBarcode(e){return this.fieldDefinitions.push(e),this}addImeiOneBarcode(e){return this.fieldDefinitions.push(e),this}addImeiTwoBarcode(e){return this.fieldDefinitions.push(e),this}addCustomBarcode(e){return this.fieldDefinitions.push(e),this}addUnitPriceText(e){return this.fieldDefinitions.push(e),this}addTotalPriceText(e){return this.fieldDefinitions.push(e),this}addWeightText(e){return this.fieldDefinitions.push(e),this}addPackingDateText(e){return this.fieldDefinitions.push(e),this}addExpiryDateText(e){return this.fieldDefinitions.push(e),this}addDateText(e){return this.fieldDefinitions.push(e),this}addCustomText(e){return this.fieldDefinitions.push(e),this}setHiddenProperty(e,t){return this.hiddenProperties[e]=t,this}setHiddenProperties(e){return this.hiddenProperties=e,this}adaptiveRecognitionMode(e){return this.adaptiveRecognitionMode_=e,this}async build(e){let t=e??this._name;if(t==null)throw Error(`Label definition name is required`);let n=[];for(let e of this.fieldDefinitions)e instanceof R?n.push(await e.build()):n.push(e);let i=await L(`LabelDefinition.create`,t,n.map(e=>e[r.nativeHandle]));Object.keys(this.hiddenProperties).length>0&&await L(`LabelDefinition.setHiddenProperties`,i,JSON.stringify(this.hiddenProperties)),await L(`LabelDefinition.setAdaptiveRecognitionMode`,i,Le(this.adaptiveRecognitionMode_));let a=Re.forHandle(i);return a._fields=n,a._hiddenProperties=this.hiddenProperties,a._adaptiveRecognitionMode=this.adaptiveRecognitionMode_,a._name=t,a}};function ze(e){return new H(e)}var Be=class e{constructor(e){this[r.nativeHandle]=e}static async fromLabelDefinitions(e){let t=new Ve;for(let n of e)t.addLabel(n);return t.build()}static forHandle(t){return new e(t)}async getLocationSelection(){let e=await I().workerCommand(`labelCaptureSettingsGetLocationSelection`,{payload:{settingsHandle:this[r.nativeHandle]}});if(e!=null){if(e.size.width!=null&&e.size.aspect!=null){let n=t.NumberWithUnit.fromJSON(e.size.width);return t.RectangularLocationSelection.withWidthAndAspectRatio(n,e.size.aspect)}if(e.size.height!=null&&e.size.aspect!=null){let n=t.NumberWithUnit.fromJSON(e.size.height);return t.RectangularLocationSelection.withHeightAndAspectRatio(n,e.size.aspect)}if(e.size.width!=null&&e.size.height!=null){let n=t.NumberWithUnit.fromJSON(e.size.width),r=t.NumberWithUnit.fromJSON(e.size.height);return t.RectangularLocationSelection.withSize(new t.SizeWithUnit(n,r))}}}async setLocationSelection(e){e instanceof t.RectangularLocationSelection&&await I().workerCommand(`labelCaptureSettingsSetLocationSelection`,{payload:{settingsHandle:this[r.nativeHandle],locationSelection:e.toJSONObject()}})}async getProperty(e){return e===`licenseKey`?L(`LabelCaptureSettings.getLicenseKey`,this[r.nativeHandle]):e===`licensee`?L(`LabelCaptureSettings.getLicensee`,this[r.nativeHandle]):L(`LabelCaptureSettings.getIntProperty`,this[r.nativeHandle],e)}async setProperty(e,t){e===`licenseKey`&&typeof t==`string`?await L(`LabelCaptureSettings.setLicenseKey`,this[r.nativeHandle],t):e===`licensee`&&typeof t==`string`?await L(`LabelCaptureSettings.setLicensee`,this[r.nativeHandle],t):typeof t==`number`&&Number.isInteger(t)&&await L(`LabelCaptureSettings.setIntProperty`,this[r.nativeHandle],e,t)}async getBlueprintJSON(){let e=await L(`LabelCaptureSettings.getBlueprintJson`,this[r.nativeHandle]);return JSON.parse(e)}},Ve=class{constructor(){this.labelDefinitions=[],this.hiddenProperties={}}addLabel(e){return this.labelDefinitions.push(e),this}setHiddenProperty(e,t){return this.hiddenProperties[e]=t,this}setHiddenProperties(e){return this.hiddenProperties=e,this}setLabelProperties(e){return this.labelProperties=e,this}async build(){let e=[];for(let t of this.labelDefinitions)e.push(t instanceof H?await t.build():t);let t=await L(`LabelCaptureSettings.create`,e.map(e=>e[r.nativeHandle]),JSON.stringify(this.hiddenProperties),this.labelProperties?JSON.stringify(this.labelProperties):``);return Be.forHandle(t)}};function He(){return new Ve}let U=function(e){return e[e.TopLeft=0]=`TopLeft`,e[e.TopRight=1]=`TopRight`,e[e.BottomRight=2]=`BottomRight`,e[e.BottomLeft=3]=`BottomLeft`,e[e.Top=4]=`Top`,e[e.Right=5]=`Right`,e[e.Bottom=6]=`Bottom`,e[e.Left=7]=`Left`,e[e.Center=8]=`Center`,e[e.WholeLabel=9]=`WholeLabel`,e}({});function Ue(e){return{[U.Bottom]:6,[U.BottomLeft]:3,[U.BottomRight]:2,[U.Center]:8,[U.Left]:7,[U.Right]:5,[U.Top]:4,[U.TopLeft]:0,[U.TopRight]:1,[U.WholeLabel]:9}[e]}var We=class e{constructor(e){this[r.nativeHandle]=e}static async of(t){let n=await L(`LabelFieldLocation.createWithRect`,t.toJSONObject());return new e(n)}static async topLeft(){return e.createWithType(U.TopLeft)}static async topRight(){return e.createWithType(U.TopRight)}static async bottomRight(){return e.createWithType(U.BottomRight)}static async bottomLeft(){return e.createWithType(U.BottomLeft)}static async top(){return e.createWithType(U.Top)}static async right(){return e.createWithType(U.Right)}static async bottom(){return e.createWithType(U.Bottom)}static async left(){return e.createWithType(U.Left)}static async center(){return e.createWithType(U.Center)}static async wholeLabel(){return e.createWithType(U.WholeLabel)}static async createWithType(t){let n=await L(`LabelFieldLocation.createWithType`,Ue(t));return new e(n)}};let Ge=function(e){return e[e.Sync=0]=`Sync`,e[e.AsyncStarted=1]=`AsyncStarted`,e[e.AsyncFinished=2]=`AsyncFinished`,e}({});var Ke=class e{constructor(e){this._anchorRegexes=[],this[r.nativeHandle]=e}get name(){return this._name}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get dateFormat(){return this._dateFormat??null}get anchorRegexes(){return this._anchorRegexes}static forHandle(t){return new e(t)}},qe=class extends B{constructor(e){super(),this.shouldResetAnchorRegexes=!1,this._name=e}setAnchorRegexes(e){return this.anchorRegexes=e,this}setAnchorRegex(e){return this.anchorRegexes=[e],this}resetAnchorRegexes(){return this.shouldResetAnchorRegexes=!0,this}setLabelDateFormat(e){return this.labelDateFormat=e,this}async build(e){let t=this.resolveName(e),n=await L(`PackingDateText.create`,t);await L(`PackingDateText.setOptional`,n,this._isOptional),this.labelDateFormat!=null&&await L(`PackingDateText.setLabelDateFormat`,n,this.labelDateFormat.toJSONObject()),this.valueRegexes.length>0&&await L(`PackingDateText.setPatterns`,n,this.valueRegexes),await this.applyAnchorRegexesOrReset(n,this.anchorRegexes,this.shouldResetAnchorRegexes),Object.keys(this.hiddenProperties).length>0&&await L(`PackingDateText.setHiddenProperties`,n,JSON.stringify(this.hiddenProperties)),this._numberOfMandatoryInstances!=null&&await L(`PackingDateText.setNumberOfMandatoryInstances`,n,this._numberOfMandatoryInstances);let r=Ke.forHandle(n);return r._isOptional=this._isOptional,r._numberOfMandatoryInstances=this._numberOfMandatoryInstances,r._name=t,r._valueRegexes=this.valueRegexes,r._dateFormat=this.labelDateFormat,r._anchorRegexes=this.anchorRegexes??[],r}getThis(){return this}};function Je(e){return new qe(e)}var Ye=class e{constructor(e){this[r.nativeHandle]=e}get name(){return this._name}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get symbologies(){return this._symbologies}static forHandle(t){return new e(t)}},Xe=class extends z{constructor(e){super(),this.anchorRegexes=[],this._name=e}setAnchorRegexes(e){return this.anchorRegexes=e,this.getThis()}setAnchorRegex(e){return this.anchorRegexes=[String(e)],this.getThis()}async build(e){let t=this.resolveName(e),n=await L(`PartNumberBarcode.create`,t);await this.applyCommonFieldSettings(n),await this.applyAnchorRegexes(n,this.anchorRegexes),await this.applySymbologies(n);let r=Ye.forHandle(n);return r._isOptional=this._isOptional,r._numberOfMandatoryInstances=this._numberOfMandatoryInstances,r._name=t,r._valueRegexes=this.valueRegexes,r._symbologies=this.symbologySettings,r}getThis(){return this}};function Ze(e){return new Xe(e)}var Qe=class e{constructor(e){this[r.nativeHandle]=e}get name(){return this._name}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get symbologies(){return this._symbologies}static forHandle(t){return new e(t)}},$e=class extends z{constructor(e){super(),this.anchorRegexes=[],this._name=e}setAnchorRegexes(e){return this.anchorRegexes=e,this.getThis()}setAnchorRegex(e){return this.anchorRegexes=[String(e)],this.getThis()}async build(e){let t=this.resolveName(e),n=await L(`SerialNumberBarcode.create`,t);await this.applyCommonFieldSettings(n),await this.applyAnchorRegexes(n,this.anchorRegexes),await this.applySymbologies(n);let r=Qe.forHandle(n);return r._isOptional=this._isOptional,r._numberOfMandatoryInstances=this._numberOfMandatoryInstances,r._name=t,r._valueRegexes=this.valueRegexes,r._symbologies=this.symbologySettings,r}getThis(){return this}};function et(e){return new $e(e)}var tt=class e{constructor(e){this._anchorRegexes=[],this[r.nativeHandle]=e}get name(){return this._name}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get anchorRegexes(){return this._anchorRegexes}static forHandle(t){return new e(t)}},nt=class extends B{constructor(e){super(),this.shouldResetAnchorRegexes=!1,this._name=e}setAnchorRegexes(e){return this.anchorRegexes=e,this}setAnchorRegex(e){return this.anchorRegexes=[e],this}resetAnchorRegexes(){return this.shouldResetAnchorRegexes=!0,this}async build(e){let t=this.resolveName(e),n=await L(`TotalPriceText.create`,t);await this.applyCommonFieldSettings(n),await this.applyAnchorRegexesOrReset(n,this.anchorRegexes,this.shouldResetAnchorRegexes);let r=tt.forHandle(n);return r._isOptional=this._isOptional,r._numberOfMandatoryInstances=this._numberOfMandatoryInstances,r._name=t,r._valueRegexes=this.valueRegexes,r._anchorRegexes=this.anchorRegexes??[],r}getThis(){return this}};function rt(e){return new nt(e)}var it=class e{constructor(e){this._anchorRegexes=[],this[r.nativeHandle]=e}get name(){return this._name}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get anchorRegexes(){return this._anchorRegexes}static forHandle(t){return new e(t)}},at=class extends B{constructor(e){super(),this.shouldResetAnchorRegexes=!1,this._name=e}setAnchorRegexes(e){return this.anchorRegexes=e,this}setAnchorRegex(e){return this.anchorRegexes=[e],this}resetAnchorRegexes(){return this.shouldResetAnchorRegexes=!0,this}async build(e){let t=this.resolveName(e),n=await L(`UnitPriceText.create`,t);await this.applyCommonFieldSettings(n),await this.applyAnchorRegexesOrReset(n,this.anchorRegexes,this.shouldResetAnchorRegexes);let r=it.forHandle(n);return r._isOptional=this._isOptional,r._numberOfMandatoryInstances=this._numberOfMandatoryInstances,r._name=t,r._valueRegexes=this.valueRegexes,r._anchorRegexes=this.anchorRegexes??[],r}getThis(){return this}};function ot(e){return new at(e)}var st=class e{constructor(e){this._anchorRegexes=[],this[r.nativeHandle]=e}get name(){return this._name}get isOptional(){return this._isOptional}get numberOfMandatoryInstances(){return this._numberOfMandatoryInstances}get valueRegexes(){return this._valueRegexes}get anchorRegexes(){return this._anchorRegexes}static forHandle(t){return new e(t)}},ct=class extends B{constructor(e){super(),this.shouldResetAnchorRegexes=!1,this._name=e}setAnchorRegexes(e){return this.anchorRegexes=e,this}setAnchorRegex(e){return this.anchorRegexes=[e],this}resetAnchorRegexes(){return this.shouldResetAnchorRegexes=!0,this}async build(e){let t=this.resolveName(e),n=await L(`WeightText.create`,t);await this.applyCommonFieldSettings(n),await this.applyAnchorRegexesOrReset(n,this.anchorRegexes,this.shouldResetAnchorRegexes);let r=st.forHandle(n);return r._isOptional=this._isOptional,r._numberOfMandatoryInstances=this._numberOfMandatoryInstances,r._name=t,r._valueRegexes=this.valueRegexes,r._anchorRegexes=this.anchorRegexes??[],r}getThis(){return this}};function lt(e){return new ct(e)}var ut=class e{static async withLabelCaptureForView(t,n){let i=await L(`LabelCaptureAdvancedOverlay.create`,t[r.nativeHandle]),a=new e(i);return a._dataCaptureView=n,await n.addOverlay(a),I().addWorkerListener(a.onWorkerMessageHandler),a}constructor(e){this.onWorkerMessageHandler=this.onWorkerMessage.bind(this),this.defaultOffset=new t.PointWithUnit(new t.NumberWithUnit(0,t.MeasureUnit.Pixel),new t.NumberWithUnit(0,t.MeasureUnit.Pixel)),this._viewForCapturedLabelMap=new Map,this._viewForCapturedLabelFieldMap=new Map,this._anchorForCapturedLabelMap=new Map,this._offsetForCapturedLabelMap=new Map,this._offsetForCapturedLabelFieldMap=new Map,this._anchorForCapturedLabelFieldMap=new Map,this.listener=null,this[r.nativeHandle]=e}keyForCapturedLabelField(e,t){return`${e.trackingId}-${e.name}-${t.name}`}async setShouldShowScanAreaGuides(e){await L(`LabelCaptureAdvancedOverlay.setShouldShowScanAreaGuides`,this[r.nativeHandle],e)}async getShouldShowScanAreaGuides(){return L(`LabelCaptureAdvancedOverlay.getShouldShowScanAreaGuides`,this[r.nativeHandle])}setViewForCapturedLabel(e,t){if(t==null){this._viewForCapturedLabelMap.set(e.name,null);return}this._viewForCapturedLabelMap.has(e.name)||this._viewForCapturedLabelMap.set(e.name,t)}setAnchorForCapturedLabel(e,t){this._anchorForCapturedLabelMap.set(e.name,t)}setOffsetForCapturedLabel(e,t){this._offsetForCapturedLabelMap.set(e.name,t)}setViewForCapturedLabelField(e,t,n){let r=this.keyForCapturedLabelField(t,e);if(n==null){this._viewForCapturedLabelFieldMap.set(r,null);return}this._viewForCapturedLabelFieldMap.has(r)||this._viewForCapturedLabelFieldMap.set(r,n)}setAnchorForCapturedLabelField(e,t,n){this._anchorForCapturedLabelFieldMap.set(this.keyForCapturedLabelField(t,e),n)}setOffsetForCapturedLabelField(e,t,n){this._offsetForCapturedLabelFieldMap.set(this.keyForCapturedLabelField(t,e),n)}clearCapturedLabelViews(){this._viewForCapturedLabelMap.clear(),this._viewForCapturedLabelFieldMap.clear(),this._dataCaptureView.renderCustomLocationsView({elements:[]})}onDocumentVisibilityChange(e){e===`hidden`&&this.clearCapturedLabelViews()}onWorkerMessage(e){e.type===`labelCaptureOnSessionUpdated`&&this.update(xe.fromJSON(e.payload.session))}handleUpdateField(e){let n=[];for(let l of e.fields){var r,i,a,o;let u=this.keyForCapturedLabelField(e,l),d=this._viewForCapturedLabelFieldMap.get(u)??((r=this.listener)==null||(i=r.viewForCapturedLabelField)==null?void 0:i.call(r,this,l)),f=this._anchorForCapturedLabelFieldMap.get(u)??((a=this.listener)==null||(o=a.anchorForCapturedLabelField)==null?void 0:o.call(a,this,l)),p=this._offsetForCapturedLabelFieldMap.get(u);if(p==null&&d!=null){var s,c;p=(s=this.listener)==null||(c=s.offsetForCapturedLabelField)==null?void 0:c.call(s,this,l,d)}n.push({identifier:u,anchorPositions:l.anchorPositions,view:d??null,anchor:f??t.Anchor.BottomCenter,offset:p??this.defaultOffset})}return n}update(e){let n=[];for(let l of e.capturedLabels){var r,i,a,o;let e=this._viewForCapturedLabelMap.get(l.name)??((r=this.listener)==null||(i=r.viewForCapturedLabel)==null?void 0:i.call(r,this,l)),u=this._anchorForCapturedLabelMap.get(l.name)??((a=this.listener)==null||(o=a.anchorForCapturedLabel)==null?void 0:o.call(a,this,l)),d=this._offsetForCapturedLabelMap.get(l.name);if(d==null&&e!=null){var s,c;d=(s=this.listener)==null||(c=s.offsetForCapturedLabel)==null?void 0:c.call(s,this,l,e)}l.fields.length>0&&n.push({identifier:`${l.trackingId}-${l.name}`,anchorPositions:l.fields[0].anchorPositions,view:e??null,anchor:u??t.Anchor.BottomCenter,offset:d??this.defaultOffset}),n.push(...this.handleUpdateField(l))}this._dataCaptureView.renderCustomLocationsView({elements:n})}toJSONObject(){return{type:this[r.nativeHandle].className,nativeHandle:this[r.nativeHandle]}}},dt=`label-worker-8.6.0-beta.1.js`;function ft(e){try{var t=e.endsWith(`/`)?e:e+`/`;return new URL(dt,t).href}catch(t){var n=t instanceof Error?t.message:String(t);throw Error(`Invalid worker URL: `+e+`/`+dt+` (`+n+`)`)}}function pt(e){try{return new URL(e).origin===location.origin}catch(n){var t=n instanceof Error?n.message:String(n);return console.warn(`Could not determine origin for worker URL "`+e+`": `+t+`. Defaulting to cross-origin path.`),!1}}function mt(e,t){/javascript|ecmascript/i.test(e.type)||(e=new Blob([e],{type:`application/javascript`}));var n=URL.createObjectURL(e),r=new Worker(n,{name:t});return setTimeout(function(){URL.revokeObjectURL(n)},0),r}async function ht(e){if(!e||!e.libraryLocation)throw Error(`ExternalWorker requires options.libraryLocation`);var t=ft(e.libraryLocation);try{var n=await fetch(t,pt(t)?{}:{mode:`cors`});if(!n.ok)throw Error(`Failed to load worker script: `+t+` (status `+n.status+`)`);var r=await n.blob();return pt(t)?new Worker(t,{name:e.name}):mt(r,e.name)}catch(e){throw e instanceof Error&&e.message.startsWith(`Failed to load worker script:`)?e:Error(`Failed to load worker script: `+t+` (`+(e instanceof Error?e.message:e)+`)`)}}var gt=class e extends t.DataCaptureLoader{constructor(...e){super(...e),this._name=`LabelCapture`}get dataCaptureWorker(){if(!this._dataCaptureWorker)throw Error(`Worker not initialized. Use LabelCaptureWorkerManager.create() to instantiate.`);return this._dataCaptureWorker}get name(){return this._name}async initializeNativeHandles(){return this._handshake??=(async()=>{let e=await this.workerCommand(`initializeNativeHandles`,{});this[Se]=e.contextHandle,this[Ce]=e.listenerHandle})(),this._handshake}async createDataCaptureWorker(){return await ht({name:this.name,libraryLocation:this.libraryLocation})}static async create(t){let n=new e(t);return n._dataCaptureWorker=await n.createDataCaptureWorker(),n.addWorkerMessageListener(),await n.workerCommand(`setLogLevel`,{level:n.logLevel}),await n.load(),n}async workerCommand(e,t,n){return new Promise((r,i)=>{let a=this.workerCommandId++;this.workerTasks.set(a,{resolve:r,reject:i,command:e});let o={...t,command:e,id:a};this.dataCaptureWorker.postMessage(o,n)})}};function _t(){return{moduleName:`LabelCapture`,load:async e=>{let t=e,n=await gt.create({...t,libraryLocation:t.libraryLocation});return F.set(`LabelCapture`,n),n}}}var vt=class{constructor(){this.scan=new t.Feedback(t.Feedback.defaultFeedback.vibration,t.Feedback.defaultFeedback.sound),this.scan.emit=(0,a.debounce)(this.scan.emit.bind(this.scan),100),this.adaptiveRecognitionResult=new t.Feedback(t.Feedback.defaultFeedback.vibration,null),this.adaptiveRecognitionResult.emit=(0,a.debounce)(this.adaptiveRecognitionResult.emit.bind(this.adaptiveRecognitionResult),100)}toJSONObject(){return{scan:this.scan.toJSONObject(),adaptiveRecognitionResult:this.adaptiveRecognitionResult.toJSONObject()}}},yt=class e{async setMissingFieldsHintText(e){await L(`ValidationFlowSettings.setMissingFieldsHintText`,this[r.nativeHandle],e),this.missingFieldsHintText=e}async getMissingFieldsHintText(){let e=await L(`ValidationFlowSettings.getMissingFieldsHintText`,this[r.nativeHandle]);return this.missingFieldsHintText=e,e}async setStandbyHintText(e){await L(`ValidationFlowSettings.setStandbyHintText`,this[r.nativeHandle],e),this.standbyHintText=e}async getStandbyHintText(){let e=await L(`ValidationFlowSettings.getStandbyHintText`,this[r.nativeHandle]);return this.standbyHintText=e,e}async setValidationHintText(e){await L(`ValidationFlowSettings.setValidationHintText`,this[r.nativeHandle],e),this.validationHintText=e}async getValidationHintText(){let e=await L(`ValidationFlowSettings.getValidationHintText`,this[r.nativeHandle]);return this.validationHintText=e,e}async setValidationErrorText(e){await L(`ValidationFlowSettings.setValidationErrorText`,this[r.nativeHandle],e),this.validationErrorText=e}async getValidationErrorText(){let e=await L(`ValidationFlowSettings.getValidationErrorText`,this[r.nativeHandle]);return this.validationErrorText=e,e}async setRequiredFieldErrorText(e){await L(`ValidationFlowSettings.setRequiredFieldErrorText`,this[r.nativeHandle],e),this.requiredFieldErrorText=e}async getRequiredFieldErrorText(){let e=await L(`ValidationFlowSettings.getRequiredFieldErrorText`,this[r.nativeHandle]);return this.requiredFieldErrorText=e,e}async setManualInputButtonText(e){await L(`ValidationFlowSettings.setManualInputButtonText`,this[r.nativeHandle],e),this.manualInputButtonText=e}async getManualInputButtonText(){let e=await L(`ValidationFlowSettings.getManualInputButtonText`,this[r.nativeHandle]);return this.manualInputButtonText=e,e}async setFinishButtonText(e){await L(`ValidationFlowSettings.setValidationFinishButtonText`,this[r.nativeHandle],e),this.finishButtonText=e}async getFinishButtonText(){let e=await L(`ValidationFlowSettings.getValidationFinishButtonText`,this[r.nativeHandle]);return this.finishButtonText=e,e}async setRestartButtonText(e){await L(`ValidationFlowSettings.setValidationRestartButtonText`,this[r.nativeHandle],e),this.restartButtonText=e}async getRestartButtonText(){let e=await L(`ValidationFlowSettings.getValidationRestartButtonText`,this[r.nativeHandle]);return this.restartButtonText=e,e}async setPauseButtonText(e){await L(`ValidationFlowSettings.setValidationPauseButtonText`,this[r.nativeHandle],e),this.pauseButtonText=e}async getPauseButtonText(){let e=await L(`ValidationFlowSettings.getValidationPauseButtonText`,this[r.nativeHandle]);return this.pauseButtonText=e,e}async setAdaptiveScanningText(e){await L(`ValidationFlowSettings.setValidationAdaptiveScanningText`,this[r.nativeHandle],e),this.adaptiveScanningText=e}async getAdaptiveScanningText(){let e=await L(`ValidationFlowSettings.getValidationAdaptiveScanningText`,this[r.nativeHandle]);return this.adaptiveScanningText=e,e}async setScanningText(e){await L(`ValidationFlowSettings.setValidationScanningText`,this[r.nativeHandle],e),this.scanningText=e}async getScanningText(){let e=await L(`ValidationFlowSettings.getValidationScanningText`,this[r.nativeHandle]);return this.scanningText=e,e}async setPlaceholderTextForLabelDefinition(e,t){await L(`ValidationFlowSettings.setPlaceholderTextForLabelDefinition`,this[r.nativeHandle],e,t)}async getPlaceholderTextForLabelDefinition(e){return L(`ValidationFlowSettings.getPlaceholderTextForLabelDefinition`,this[r.nativeHandle],e)}constructor(e){this.missingFieldsHintText=``,this.standbyHintText=``,this.validationHintText=``,this.validationErrorText=``,this.requiredFieldErrorText=``,this.manualInputButtonText=``,this.finishButtonText=``,this.restartButtonText=``,this.pauseButtonText=``,this.adaptiveScanningText=``,this.scanningText=``,this[r.nativeHandle]=e}static async create(){let t=await L(`ValidationFlowSettings.create`),n=new e(t);return await Promise.all([n.getMissingFieldsHintText(),n.getStandbyHintText(),n.getValidationHintText(),n.getRequiredFieldErrorText(),n.getManualInputButtonText(),n.getValidationErrorText(),n.getFinishButtonText(),n.getRestartButtonText(),n.getPauseButtonText(),n.getAdaptiveScanningText(),n.getScanningText()]),n}},bt=class e{constructor(e,t){this.fieldName=e,this.instanceIndex=t}static fromLabelField(t){return new e(t.name,t.instanceIndex)}toKey(){let e=this.fieldName.replace(/%/g,`%25`).replace(/#/g,`%23`);return this.instanceIndex==null?e:`${e}#${this.instanceIndex}`}equals(e){return this.fieldName===e.fieldName&&this.instanceIndex===e.instanceIndex}};function W(e){return bt.fromLabelField(e).toKey()}var xt=class{constructor(){this.validationFlowState=0,this.currentInputName=null,this.cloudBackupFields=new Set,this.fieldStates=new Map,this.fieldInstances=new Map,this.scanResultMap=new Map,this.hasTimeout_=!1,this.pausedFromScanningState_=!1,this.partialScanTargets=[],this.cloudBackupStateMachine=new o.AsyncStateMachine(`idle`,[{from:`idle`,to:`processing`},{from:`processing`,to:`idle`}])}get validationFlowHandlerState(){return this.validationFlowState}set validationFlowHandlerState(e){let t=this.validationFlowState===3;this.validationFlowState=e,t&&e!==3&&(this.hasTimeout_=!1,this.pausedFromScanningState_=!1),(e===2||e===0||e===4)&&(this.partialScanTargets=[])}get isScanning(){return this.validationFlowState===2||this.validationFlowState===1}get isScanningOrCloudBackup(){return this.isCloudBackupProcessing||this.isScanning}get isPaused(){return this.validationFlowState===3}get isFinished(){return this.validationFlowState===4}get isIdle(){return this.validationFlowState===0}get cloudBackupState(){return this.cloudBackupStateMachine.currentState}get isCloudBackupProcessing(){return this.cloudBackupStateMachine.currentState===`processing`}get hasCurrentInputName(){return this.currentInputName!==null}getCurrentInputName(){return this.currentInputName}get hasTimeout(){return this.hasTimeout_}markTimeout(){this.hasTimeout_=!0}get isPausedFromScanningState(){return this.pausedFromScanningState_}markPausedFromScanningState(){this.pausedFromScanningState_=!0}getPartialScanTargets(){return this.partialScanTargets.slice()}setPartialScanTargets(e){this.partialScanTargets=e.slice()}clearPartialScanTargets(){this.partialScanTargets=[]}setCurrentInputName(e){this.currentInputName=e}clearCurrentInputName(){this.currentInputName=null}startCloudBackup(e){this.cloudBackupFields=new Set(e),this.cloudBackupStateMachine.currentState===`idle`&&this.cloudBackupStateMachine.transitionTo(`processing`)}startCloudBackupService(){this.cloudBackupStateMachine.currentState===`idle`&&this.cloudBackupStateMachine.transitionTo(`processing`)}updateCloudBackupFields(e){this.cloudBackupFields=new Set(e.filter(e=>e.isProcessingInCloud()).map(e=>W(e.getLabelField())))}stopCloudBackup(){this.cloudBackupFields.clear(),this.cloudBackupStateMachine.transitionTo(`idle`)}cancelCloudBackupForField(e){this.cloudBackupFields.delete(e),this.cloudBackupFields.size===0&&this.cloudBackupStateMachine.currentState===`processing`&&this.cloudBackupStateMachine.transitionTo(`idle`)}uncancelCloudBackupForField(e){this.cloudBackupFields.add(e),this.cloudBackupStateMachine.currentState===`idle`&&this.cloudBackupStateMachine.transitionTo(`processing`)}isFieldInCloudBackup(e){return this.cloudBackupFields.has(e)}getCloudBackupFields(){return Array.from(this.cloudBackupFields)}onCloudBackupStateChange(e){this.cloudBackupStateMachine.addListener(e)}offCloudBackupStateChange(e){this.cloudBackupStateMachine.removeListener(e)}registerFields(e){for(let t of e)this.fieldStates.has(t)||this.fieldStates.set(t,`initial`)}registerFieldInstances(e){this.fieldInstances.clear();for(let t of e)this.fieldInstances.set(t.toKey(),t)}getFieldInstance(e){return this.fieldInstances.get(e)}clearFields(){this.fieldStates.clear(),this.fieldInstances.clear(),this.scanResultMap.clear(),this.cloudBackupFields.clear(),this.partialScanTargets=[]}setInputState(e,t){let n=this.currentInputName===e&&(t===`scanning`||t===`cloudBackup`)?`initial`:t;this.fieldStates.set(e,n)}getInputState(e){return this.fieldStates.get(e)??`initial`}isCurrentInputName(e){return this.currentInputName===e}setScanResults(e){this.scanResultMap.clear();for(let t of e)this.scanResultMap.set(W(t.getLabelField()),t)}updateScanResults(e){for(let t of e)this.scanResultMap.set(W(t.getLabelField()),t)}deleteScanResult(e){this.scanResultMap.delete(e)}getScanResult(e){return this.scanResultMap.get(e)}clearScanResults(){this.scanResultMap.clear()}};function St(e){return new Map(e.split(`,`).reduce((e,t)=>{let n=t.trim();if(n.length===0)return e;let r=n.indexOf(`=`),i=r===-1?n:n.substring(0,r).trim(),a=r===-1?``:n.substring(r+1).trim();return e.push([i,a]),e},[]))}function Ct(e){return Array.from(e.entries()).map(([e,t])=>t?`${e}=${t}`:e).join(`, `)}var G=class e extends c.ScanditHTMLElement{constructor(){super(),this._show=!1,this._pulseAnimation=null;let t=this.attachShadow({mode:`open`});t.innerHTML=c.html`<div class="wrapper"><div class="animation-container"><div class="border"></div><div class="scan-line scan-line-top"></div><div class="scan-line scan-line-bottom"></div></div></div>`,t.append(e.createStyleElement().cloneNode(!0))}get show(){return this._show}set show(e){this._show=e,this.toggleAttribute(`show`,e)}static get observedAttributes(){return[`show`]}connectedCallback(){var e;this._borderElement=(e=this.shadowRoot)==null?void 0:e.querySelector(`.border`)}disconnectedCallback(){(0,c.safeCancelAnimation)(this._pulseAnimation),this._pulseAnimation=null}async attributeChangedCallback(e,t,n){if(e===`show`){this._show=n!==null;let e=getComputedStyle(this),t=e.getPropertyValue(`--glow-color`).trim(),i=e.getPropertyValue(`--glow-color-peak`).trim(),a=e.getPropertyValue(`--animation-curve`).trim();if(this._show)(0,c.safeCancelAnimation)(this._pulseAnimation),this._pulseAnimation=null,await(0,c.safeAwaitAnimation)(this._borderElement.animate([{boxShadow:`inset 0 0 0px ${t}`},{boxShadow:`inset 0 0 10px ${t}`}],{duration:250,easing:a,fill:`forwards`})),this._pulseAnimation=this._borderElement.animate([{boxShadow:`inset 0 0 10px ${t}`,filter:`blur(0px)`},{boxShadow:`inset 0 0 100px ${i}`,filter:`blur(0.5px)`},{boxShadow:`inset 0 0 10px ${t}`,filter:`blur(0px)`}],{duration:4e3,easing:a,iterations:1/0,direction:`alternate`});else{var r;(r=this._pulseAnimation)==null||r.pause();let e=getComputedStyle(this._borderElement).boxShadow||`inset 0 0 100px ${i}`,n=this._borderElement.animate([{boxShadow:e},{boxShadow:`inset 0 0 0px ${t}`}],{duration:250,easing:a,fill:`forwards`}),o=()=>{this._pulseAnimation=null};n.addEventListener(`finish`,o,{once:!0}),n.addEventListener(`cancel`,o,{once:!0})}}}static create(){return document.createElement(e.tag)}static register(){(0,c.defineCustomElements)({[e.tag]:e})}static createStyleElement(){return c.css`:host{--glow-color:#0ff;--glow-color-peak:#00ffff80;--animation-curve:cubic-bezier(.42,0,.58,1);align-items:center;display:flex;inset:0;justify-content:center;pointer-events:none;position:absolute;z-index:1}.animation-container,.wrapper{height:100%;width:100%}.animation-container{overflow:hidden;position:relative}.border{backdrop-filter:blur(0);-webkit-backdrop-filter:blur(0);border-radius:10px;box-shadow:inset 0 0 0 var(--glow-color);filter:blur(0);inset:0;position:absolute}:host(:not([show])) .scan-line{animation:none;opacity:0}.scan-line{background:#fff;box-shadow:0 0 12px #fffc;height:3px;left:0;position:absolute;width:100%}.scan-line-top{animation:scan-line-top 2s var(--animation-curve) infinite;top:50%}.scan-line-bottom{animation:scan-line-bottom 2s var(--animation-curve) infinite;top:50%}@keyframes scan-line-top{0%{opacity:1;transform:translateY(-50%)}to{opacity:0;transform:translateY(calc(-50% - 50vh))}}@keyframes scan-line-bottom{0%{opacity:1;transform:translateY(-50%)}to{opacity:0;transform:translateY(calc(-50% + 50vh))}}`}};G.tag=`scandit-adaptive-recognition-overlay`;var K=class e extends c.ScanditHTMLElement{constructor(){super(),this._variant=`primary`,this._size=`default`,this._kind=`action`,this._disabled=!1,this._type=`button`,this.iconStartSlot=null,this.iconEndSlot=null,this.onIconSlotChangeListener=this.onIconSlotChange.bind(this),this.gestureRecognizer=null,this.associatedForm=null;let t=this.attachShadow({mode:`open`});t.innerHTML=c.html`<button type="button"><slot name="icon-start"></slot><span class="text"><slot></slot></span><slot name="icon-end"></slot></button>`,t.append(e.createStyleElement().cloneNode(!0)),this.iconStartSlot=t.querySelector(`slot[name="icon-start"]`),this.iconEndSlot=t.querySelector(`slot[name="icon-end"]`)}connectedCallback(){var e,t,n;let r=this.getAttribute(`variant`);(r===`primary`||r===`secondary`||r===`ghost`)&&(this._variant=r);let i=this.getAttribute(`size`);(i==="default"||i===`small`)&&(this._size=i);let a=this.getAttribute(`kind`);(a===`action`||a===`destructive`)&&(this._kind=a);let o=this.getAttribute(`type`);(o===`button`||o===`submit`||o===`reset`)&&(this._type=o);let s=this.getAttribute(`disabled`);this._disabled=s!==null,this.updateAttributes(),this.updateButtonState(),(e=this.iconStartSlot)==null||e.addEventListener(`slotchange`,this.onIconSlotChangeListener),(t=this.iconEndSlot)==null||t.addEventListener(`slotchange`,this.onIconSlotChangeListener),this.updateIconColors();let c=(n=this.shadowRoot)==null?void 0:n.querySelector(`button`);c&&(this.gestureRecognizer=new l.GestureRecognizer(c,[new l.PressGesturePlugin]),this.gestureRecognizer.addListener(this))}disconnectedCallback(){var e,t,n;(e=this.iconStartSlot)==null||e.removeEventListener(`slotchange`,this.onIconSlotChangeListener),(t=this.iconEndSlot)==null||t.removeEventListener(`slotchange`,this.onIconSlotChangeListener),(n=this.gestureRecognizer)==null||n.removeAllListeners(),this.gestureRecognizer=null}formAssociatedCallback(e){this.associatedForm=e??null}formDisabledCallback(e){this.disabled=e}onPress(){if(!this._disabled){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(`button`);t==null||t.classList.add(`pressed`)}}onRelease(){this.unpress(),this._type===`submit`&&this.associatedForm&&this.associatedForm.requestSubmit()}onCancel(){this.unpress()}unpress(){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(`button`);t==null||t.classList.remove(`pressed`)}onIconSlotChange(){this.updateIconColors()}updateIconColors(){let e=getComputedStyle(this).getPropertyValue(`--button-text-color`).trim();if(e){if(this.iconStartSlot){let t=this.iconStartSlot.assignedElements();for(let n of t)this.isScanditIcon(n)&&n.setAttribute(`iconcolor`,e)}if(this.iconEndSlot){let t=this.iconEndSlot.assignedElements();for(let n of t)this.isScanditIcon(n)&&n.setAttribute(`iconcolor`,e)}}}isScanditIcon(e){return e.tagName.toLowerCase()===t.ScanditIcon.tag.toLowerCase()}get variant(){return this._variant}set variant(e){this._variant!==e&&(this._variant=e,this.updateAttributes(),this.updateIconColors())}get size(){return this._size}set size(e){this._size!==e&&(this._size=e,this.updateAttributes())}get kind(){return this._kind}set kind(e){this._kind!==e&&(this._kind=e,this.updateAttributes(),this.updateIconColors())}get disabled(){return this._disabled}set disabled(e){this._disabled!==e&&(this._disabled=e,this.updateButtonState(),this.updateIconColors())}get type(){return this._type}set type(e){this._type!==e&&(this._type=e,this.updateAttributes(),this.updateButtonState())}updateAttributes(){this.setAttribute(`variant`,this._variant),this.setAttribute(`size`,this._size),this.setAttribute(`kind`,this._kind),this.setAttribute(`type`,this._type)}updateButtonState(){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(`button`);t&&(t.type=this._type,this._disabled?(t.setAttribute(`disabled`,``),this.setAttribute(`disabled`,``),t.classList.remove(`pressed`)):(t.removeAttribute(`disabled`),this.removeAttribute(`disabled`)))}static get observedAttributes(){return[`variant`,`size`,`kind`,`disabled`,`type`]}attributeChangedCallback(e,t,n){if(t!==n)switch(e){case`variant`:(n===`primary`||n===`secondary`||n===`ghost`)&&(this._variant=n,this.updateIconColors());break;case`size`:(n==="default"||n===`small`)&&(this._size=n);break;case`kind`:(n===`action`||n===`destructive`)&&(this._kind=n,this.updateIconColors());break;case`disabled`:this._disabled=n!==null,this.updateButtonState(),this.updateIconColors();break;case`type`:(n===`button`||n===`submit`||n===`reset`)&&(this._type=n,this.updateButtonState());break}}set text(e){var t;let n=(t=this.shadowRoot)==null?void 0:t.querySelector(`.text`);n&&(n.innerHTML=e)}get text(){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(`.text`);return(t==null?void 0:t.innerHTML)??``}set textContent(e){var t;let n=(t=this.shadowRoot)==null?void 0:t.querySelector(`.text`);n&&(n.textContent=e)}get textContent(){var e;let t=(e=this.shadowRoot)==null?void 0:e.querySelector(`.text`);return(t==null?void 0:t.textContent)??``}static create(){return e.register(),document.createElement(e.tag)}static register(){(0,c.defineCustomElements)({[e.tag]:e})}static createStyleElement(){return c.css`:host{display:inline-block;--button-text-color:#fff}:host([hidden]){display:none}:host button{align-items:center;border:1px solid #0000;border-radius:.5rem;cursor:pointer;display:flex;font-weight:700;gap:.25rem;justify-content:center;max-width:200px;min-width:140px;position:relative;text-align:center;transition:all .2s ease;width:100%;-webkit-tap-highlight-color:transparent}:host([size=default]) button{font-size:.875rem;padding:.5rem 1rem}:host([size=small]) button{font-size:.75rem;max-width:150px;min-width:auto;padding:.375rem .75rem}:host([variant=primary][kind=action]){--button-text-color:#${u.neutrals.neutralWhite.toJSON()}}:host([variant=primary][kind=action]) button{background-color:#${u.grays.gray90.toJSON()};color:var(--button-text-color)}:host([variant=primary][kind=action]) button:hover:not(:disabled){background-color:#${u.grays.gray70.toJSON()}}:host([variant=primary][kind=action]) button.pressed:not(:disabled){background-color:#${u.neutrals.neutralBlack.toJSON()}}:host([variant=primary][kind=destructive]){--button-text-color:#${u.neutrals.neutralWhite.toJSON()}}:host([variant=primary][kind=destructive]) button{background-color:#${u.reds.red60.toJSON()};color:var(--button-text-color)}:host([variant=primary][kind=destructive]) button:hover:not(:disabled){background-color:#${u.reds.red50.toJSON()}}:host([variant=primary][kind=destructive]) button.pressed:not(:disabled){background-color:#${u.reds.red70.toJSON()}}:host([variant=secondary][kind=action]){--button-text-color:#${u.neutrals.neutralBlack.toJSON()}}:host([variant=secondary][kind=action]) button{background-color:#${u.neutrals.neutralWhite.toJSON()};border-color:#${u.grays.gray60.toJSON()};color:var(--button-text-color)}:host([variant=secondary][kind=action]) button:hover:not(:disabled){background-color:#${u.grays.gray5.toJSON()}}:host([variant=secondary][kind=action]) button.pressed:not(:disabled){background-color:#${u.grays.gray10.toJSON()}}:host([variant=secondary][kind=destructive]){--button-text-color:#${u.reds.red60.toJSON()}}:host([variant=secondary][kind=destructive]) button{background-color:#${u.neutrals.neutralWhite.toJSON()};border-color:#${u.reds.red60.toJSON()};color:var(--button-text-color)}:host([variant=secondary][kind=destructive]) button:hover:not(:disabled){background-color:#${u.reds.red5.toJSON()}}:host([variant=secondary][kind=destructive]) button.pressed:not(:disabled){background-color:#${u.reds.red10.toJSON()};color:var(--button-text-color)}:host([variant=ghost][kind=action]){--button-text-color:#${u.neutrals.neutralBlack.toJSON()}}:host([variant=ghost][kind=action]) button{background-color:#${u.neutrals.neutralWhite.toJSON()};border-color:#0000;color:var(--button-text-color)}:host([variant=ghost][kind=action]) button:hover:not(:disabled){background-color:#${u.grays.gray5.toJSON()}}:host([variant=ghost][kind=action]) button.pressed:not(:disabled){background-color:#${u.grays.gray10.toJSON()}}:host([variant=ghost][kind=destructive]){--button-text-color:#${u.reds.red60.toJSON()}}:host([variant=ghost][kind=destructive]) button{background-color:initial;border-color:#0000;color:var(--button-text-color)}:host([variant=ghost][kind=destructive]) button:hover:not(:disabled){background-color:#fedada;color:#fb696b}:host([variant=ghost][kind=destructive]) button.pressed:not(:disabled){background-color:#fc8f90;color:var(--button-text-color)}:host([disabled]),:host([variant][kind][disabled]){--button-text-color:#${u.grays.gray30.toJSON()}}:host([disabled]) button:disabled,:host([variant][kind]) button:disabled{background-color:#${u.grays.gray10.toJSON()};border-color:#0000;cursor:not-allowed;pointer-events:none}:host([variant=ghost][kind]) button:disabled{background-color:initial}:host button .text{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}:host button ::slotted([name=icon-end]),:host button ::slotted([name=icon-start]){align-items:center;display:inline-flex;flex:1 1 0;min-width:0}:host button ::slotted([name=icon-start]){justify-content:flex-start}:host button ::slotted([name=icon-end]){justify-content:flex-end}`}};K.tag=`scandit-button`,K.formAssociated=!0;let q={Input:`scandit-text-input-input`,Focus:`scandit-text-input-focus`,Blur:`scandit-text-input-blur`,Clear:`scandit-text-input-clear`,Scan:`scandit-text-input-scan`,Keydown:`scandit-text-input-keydown`};var wt=class extends CustomEvent{constructor(e){super(q.Scan,{detail:e,bubbles:!0,composed:!0})}},Tt=class extends CustomEvent{constructor(e){super(q.Clear,{detail:e,bubbles:!0,composed:!0})}},Et=class extends CustomEvent{constructor(e){super(q.Focus,{detail:e,bubbles:!0,composed:!0})}},Dt=class extends CustomEvent{constructor(e){super(q.Blur,{detail:e,bubbles:!0,composed:!0})}},Ot=class extends CustomEvent{constructor(e){super(q.Input,{detail:e,bubbles:!0,composed:!0})}},kt=class extends CustomEvent{constructor(e){super(q.Keydown,{detail:e,bubbles:!0,composed:!0})}};let At=c.html`<div class="main-wrapper"><label class="label-text"></label><div class="input-container"><input class="input" autocomplete="off" enterkeyhint="done"><div class="icons-container"><div id="icon-left"></div><hr class="icon-divider"><div id="icon-right"></div></div></div><div class="hint-message"></div></div>`;var J=class e extends c.ScanditHTMLElement{static createStyleElement(){return c.css`:host{display:block;-webkit-tap-highlight-color:transparent}input{background-color:initial;border:none;font-size:1rem;font-style:normal;font-weight:400;outline:none;padding:0;-webkit-tap-highlight-color:transparent;-webkit-appearance:none;appearance:none;color:#${u.grays.gray60.toJSON()};transition:color .2s ease-in-out;user-select:none;-webkit-user-select:none;width:100%}input::placeholder{color:#${u.grays.gray30.toJSON()};opacity:1}:host([has-value]) input{color:#${u.grays.gray90.toJSON()}}input:focus,input:focus-visible{color:#${u.grays.gray90.toJSON()};outline:none}:host([disabled]) .hint-message,:host([disabled]) .label-text,:host([disabled]) input{color:#${u.grays.gray30.toJSON()}}:host([disabled]) .input-container{border-color:#${u.grays.gray5.toJSON()}}.main-wrapper{cursor:pointer;display:flex;flex-direction:column;flex-grow:1;gap:.25rem;padding:0 1px}.hint-message,.label-text{font-style:normal;font-weight:500;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hint-message{font-size:.75rem;min-height:.875rem;transition:opacity .2s ease-in-out}.label-text{color:#${u.grays.gray60.toJSON()};font-size:.875rem}:host(:hover:not([disabled]):not([readonly])) .input-container{background-color:#${u.grays.gray5.toJSON()};border-color:#${u.grays.gray20.toJSON()}}.input-container{background-color:#${u.grays.gray5.toJSON()};border:1px solid #${u.grays.gray10.toJSON()};border-radius:4px;box-shadow:0 0 0 1px #0000;display:flex;flex-direction:row;gap:.5rem;justify-content:space-evenly;min-height:1.5rem;padding:.5rem .75rem;transition:border-color .2s ease-in-out,background-color .2s ease-in-out,box-shadow .2s ease-in-out}.icons-container{align-items:center;display:flex;gap:.5rem;justify-content:center}:host([has-value][focused]) .icons-container .icon-divider{opacity:1}:host ${f.CrossSvgIcon.tag}{opacity:0;pointer-events:none;transition:opacity .2s ease-in-out}:host([has-value][focused]) ${f.CrossSvgIcon.tag}{opacity:1;pointer-events:auto}:host([hide-scan-icon]) .icons-container .icon-divider,:host([hide-scan-icon]) ${p.ScanSvgIcon.tag}{display:none}.icons-container .icon-divider{background-color:#${u.grays.gray20.toJSON()};border:none;height:100%;margin:0;opacity:0;padding:0;transition:opacity .2s ease-in-out;width:1px}:host([disabled]) .icons-container,:host([readonly]) .icons-container{display:none}:host([disabled]),:host([readonly]){cursor:not-allowed;pointer-events:none}:host([focused]:not([disabled]):not([readonly])) .input-container{border-color:#${u.grays.gray90.toJSON()};box-shadow:0 0 0 1px #${u.grays.gray90.toJSON()}}:host([invalid]) .input-container{background-color:#${u.reds.red5.toJSON()};border-color:#${u.reds.red30.toJSON()};box-shadow:0 0 0 1px #${u.reds.red30.toJSON()}}:host([invalid][focused]) .input-container{background-color:#${u.reds.red5.toJSON()}!important;border-color:#${u.reds.red60.toJSON()}!important;box-shadow:0 0 0 1px #${u.reds.red60.toJSON()}!important}:host(:hover[invalid]:not([focused])) .input-container{background-color:#${u.reds.red5.toJSON()}!important;border-color:#${u.reds.red30.toJSON()}!important;box-shadow:0 0 0 1px #${u.reds.red30.toJSON()}!important}:host([invalid]) .hint-message{color:#${u.reds.red60.toJSON()}}:host([loading]) .input{animation:loading-shimmer 2.5s linear infinite;background:linear-gradient(90deg,#0000004d,#000c 40%,#000 50%,#000c 60%,#0000004d);background-clip:text;-webkit-background-clip:text;background-size:200% 100%;color:#000;color:#0000}@keyframes loading-shimmer{0%{background-position-x:-100%}to{background-position-x:100%}}@media (prefers-reduced-motion:reduce){:host([loading]) .input{animation:none;background:#0003;background-clip:unset;-webkit-background-clip:unset;color:#${u.grays.gray60.toJSON()}}}`}constructor(){super(),this._inputElement=null,this._labelElement=null,this._mainWrapper=null,this._inputContainer=null,this._iconContainerElement=null,this._hintMessageElement=null,this._type=`text`,this._value=``,this._label=``,this._placeholder=``,this._required=!1,this._isInitialized=!1,this._handleInput=this._onInput.bind(this),this._handleFocus=this._onFocus.bind(this),this._handleBlur=this._onBlur.bind(this),this._handleKeydown=this._onKeydown.bind(this),this._handleCrossIconPointerDown=this._onCrossIconPointerDown.bind(this),this._handleCrossIconPointerUp=this._onCrossIconPointerUp.bind(this),this._handleCrossIconKeyDown=this._onCrossIconKeyDown.bind(this),this._handleScanIconPointerDown=this._onScanIconPointerDown.bind(this),this._handleScanIconPointerUp=this._onScanIconPointerUp.bind(this),this._handleScanIconKeyDown=this._onScanIconKeyDown.bind(this),this._crossIcon=null,this._scanIcon=null,this._hintMessage=``,this._loadingText=``,this._clearTabIndexTimeout=void 0,this._internals=typeof this.attachInternals==`function`?this.attachInternals():void 0;let t=this.attachShadow({mode:`open`});t.innerHTML=At,t.appendChild(e.createStyleElement()),this._inputElement=t.querySelector(`.input`),this._labelElement=t.querySelector(`.label-text`),this._mainWrapper=t.querySelector(`.main-wrapper`),this._inputContainer=t.querySelector(`.input-container`),this._iconContainerElement=t.querySelector(`.icons-container`),this._hintMessageElement=t.querySelector(`.hint-message`)}get hintMessage(){var e;return((e=this._hintMessageElement)==null?void 0:e.textContent)||``}set hintMessage(e){this.invalid?this._setValidityState({customError:!0},e):(this._hintMessage=e,this._hintMessageElement&&(this._hintMessageElement.textContent=e))}get loading(){return this.hasAttribute(`loading`)}set loading(e){this.toggleAttribute(`loading`,e),this._updateInputDisplay()}get loadingText(){return this._loadingText}set loadingText(e){this._loadingText=e,this._updateInputDisplay()}get value(){return this._value}set value(e){if(this._value=e,this._inputElement){var t;let n=e.length>0;this.toggleAttribute(`has-value`,n),this._updateCrossIconTabIndex(),(t=this._internals)==null||t.setFormValue(e),this._updateInputDisplay(),this._required&&n&&this.invalid&&this._setValidityState({})}}get name(){var e;return this.getAttribute(`name`)||((e=this._inputElement)==null?void 0:e.name)||``}set name(e){if(e?this.setAttribute(`name`,e):this.removeAttribute(`name`),this._inputElement&&this._labelElement){var t;(t=this._labelElement)==null||t.setAttribute(`for`,e),this._inputElement.name=e,this._inputElement.id=e}}get type(){return this._type}set type(e){this._type=e,this._inputElement&&(this._type===`number`?(this._inputElement.type=`number`,this._inputElement.inputMode=`numeric`):this._inputElement.type=`text`)}get label(){return this._label}set label(e){this._label=e,this._labelElement&&(this._labelElement.textContent=e||``),e?this.setAttribute(`aria-label`,e):this.removeAttribute(`aria-label`)}get placeholder(){return this._placeholder}set placeholder(e){this._placeholder=e,e?this.setAttribute(`placeholder`,e):this.removeAttribute(`placeholder`),this._inputElement&&(this._inputElement.placeholder=e)}get required(){var e;return((e=this._inputElement)==null?void 0:e.required)??this._required??!1}set required(e){this._required=e,this.toggleAttribute(`required`,e),this._inputElement&&(this._inputElement.required=e,this._inputElement.setAttribute(`aria-required`,String(e))),this._isInitialized&&e&&!this._value&&this._setValidityState({valueMissing:!0},`This field is required`)}get invalid(){return this.hasAttribute(`invalid`)}set invalid(e){e?this._setValidityState({customError:!0},this._hintMessage):this._setValidityState({})}set readOnly(e){this.toggleAttribute(`readonly`,e),this._inputElement&&(this._inputElement.readOnly=e)}get readOnly(){return this.hasAttribute(`readonly`)}set disabled(e){var t;this.toggleAttribute(`disabled`,e),this._inputElement&&(this._inputElement.disabled=e),(t=this._internals)==null||t.setFormValue(this._value)}get disabled(){return this.hasAttribute(`disabled`)}set hideScanIcon(e){this.toggleAttribute(`hide-scan-icon`,e)}get hideScanIcon(){return this.hasAttribute(`hide-scan-icon`)}set backgroundColor(e){this._inputContainer&&(this._inputContainer.style.backgroundColor=e instanceof d.Color?`#${e.toJSON()}`:e)}checkValidity(){return!this._inputElement||this._inputElement.validity.valid}reportValidity(){var e;return((e=this._internals)==null?void 0:e.reportValidity())??!0}setValidationState(e,t){var n;if(e)this._setValidityState({});else{let e=t===void 0?``:t;this._setValidityState({customError:!0},e)}(n=this._mainWrapper)==null||n.classList.add(`validation-triggered`)}resetValidation(){var e;this._setValidityState({}),(e=this._mainWrapper)==null||e.classList.remove(`validation-triggered`)}setCustomValidity(e){this._inputElement&&(this._inputElement.setCustomValidity(e),e.length>0?this._setValidityState({customError:!0},e):this._setValidityState({}))}_setValidityState(e,t=``){let n=Object.values(e).some(e=>e===!0);if(this.toggleAttribute(`invalid`,n),n){var r;let n=t||`This field is invalid`;(r=this._internals)==null||r.setValidity(e,n)}else{var i;(i=this._internals)==null||i.setValidity({})}if(this._hintMessage=t,this._hintMessageElement&&(this._hintMessageElement.textContent=t||``),this._inputElement)if(this._inputElement.setAttribute(`aria-invalid`,String(n)),n&&t){var a;let e=`${this._inputElement.id||`text-input`}-hint`;(a=this._hintMessageElement)==null||a.setAttribute(`id`,e),this._inputElement.setAttribute(`aria-describedby`,e)}else this._inputElement.removeAttribute(`aria-describedby`)}_onInput(e){if(!this._inputElement)return;let t=e.target.value,n=t.length>0;this.toggleAttribute(`has-value`,n),this.value=t,this._updateCrossIconTabIndex(),this.invalid&&this.resetValidation(),this.dispatchEvent(new Ot({target:this,innerInput:this._inputElement,value:this._value}))}_onFocus(e){this.setAttribute(`focused`,``),this._updateCrossIconTabIndex(),this.dispatchEvent(new Et({target:this,innerInput:this._inputElement,value:this._value}))}_onBlur(e){this.removeAttribute(`focused`),this._updateCrossIconTabIndex(),typeof document<`u`&&document.body&&this.contains(document.activeElement)&&(clearTimeout(this._clearTabIndexTimeout),document.body.tabIndex=-1,document.body.focus({preventScroll:!0}),this._clearTabIndexTimeout=setTimeout(()=>{document.body.removeAttribute(`tabindex`)},10)),this.dispatchEvent(new Dt({target:this,innerInput:this._inputElement,value:this._value}))}_onKeydown(e){this.dispatchEvent(new kt({target:this,key:e.key,originalEvent:e}))}focus(e){super.focus(e),this._inputElement&&this._inputElement.focus(e)}select(){var e,t;(e=this._inputElement)==null||(t=e.select)==null||t.call(e)}blur(){var e,t;super.blur(),(e=this._inputElement)==null||(t=e.blur)==null||t.call(e)}scrollIntoView(e){var t;(t=this._inputElement)==null||t.scrollIntoView(e),super.scrollIntoView(e)}_initializeIcons(){var e,t;f.CrossSvgIcon.register(),p.ScanSvgIcon.register();let n=(e=this._iconContainerElement)==null?void 0:e.querySelector(`#icon-left`);n&&(this._crossIcon=f.CrossSvgIcon.create(),this._crossIcon.size=20,this._crossIcon.setAttribute(`aria-label`,`Clear input`),this._crossIcon.setAttribute(`role`,`button`),this._updateCrossIconTabIndex(),n.replaceWith(this._crossIcon));let r=(t=this._iconContainerElement)==null?void 0:t.querySelector(`#icon-right`);r&&(this._scanIcon=p.ScanSvgIcon.create(),this._scanIcon.size=20,this._scanIcon.setAttribute(`aria-label`,`Scan barcode`),this._scanIcon.setAttribute(`role`,`button`),this._scanIcon.setAttribute(`tabindex`,`0`),r.replaceWith(this._scanIcon))}_updateCrossIconTabIndex(){!this._crossIcon||!this._scanIcon||(this.hasAttribute(`has-value`)?(this._crossIcon.setAttribute(`tabindex`,`0`),this._scanIcon.setAttribute(`tabindex`,`0`)):(this._crossIcon.setAttribute(`tabindex`,`-1`),this._scanIcon.setAttribute(`tabindex`,`0`)))}_updateInputDisplay(){this._inputElement&&(this.loading&&this._loadingText?this._inputElement.value=this._loadingText:this._inputElement.value=this._value)}connectedCallback(){this.setAttribute(`role`,`textbox`),this._initializeAttributesFromElement(),this._initializeIcons(),this._addEventListeners(),this._isInitialized=!0}_initializeAttributesFromElement(){if(this.hasAttribute(`name`)&&(this.name=this.getAttribute(`name`)||``),this.hasAttribute(`label`)&&(this.label=this.getAttribute(`label`)||``),this.hasAttribute(`placeholder`)&&(this.placeholder=this.getAttribute(`placeholder`)||``),this.hasAttribute(`type`)){let e=this.getAttribute(`type`);(e===`text`||e===`number`)&&(this.type=e)}this.hasAttribute(`value`)&&(this.value=this.getAttribute(`value`)||``),this.hasAttribute(`required`)&&(this.required=this.getAttribute(`required`)!==null),this.hasAttribute(`invalid`)&&(this.invalid=this.getAttribute(`invalid`)!==null),this.hasAttribute(`hide-scan-icon`)&&(this.hideScanIcon=this.getAttribute(`hide-scan-icon`)!==null),this._hintMessageElement&&(this.hintMessage=this._hintMessage||``)}disconnectedCallback(){var e,t;this._isInitialized=!1,clearTimeout(this._clearTabIndexTimeout),this._removeEventListeners(),(e=this._crossIcon)==null||e.remove(),(t=this._scanIcon)==null||t.remove()}formAssociatedCallback(e){}formDisabledCallback(e){this.disabled=e}formResetCallback(){this.value=this.getAttribute(`value`)||``,this.resetValidation()}_addEventListeners(){var e,t,n,r,i,a;this._inputElement&&(this._inputElement.addEventListener(`input`,this._handleInput),this._inputElement.addEventListener(`focus`,this._handleFocus),this._inputElement.addEventListener(`blur`,this._handleBlur),this._inputElement.addEventListener(`keydown`,this._handleKeydown),(e=this._crossIcon)==null||e.addEventListener(`pointerdown`,this._handleCrossIconPointerDown,{capture:!0}),(t=this._crossIcon)==null||t.addEventListener(`pointerup`,this._handleCrossIconPointerUp),(n=this._crossIcon)==null||n.addEventListener(`keydown`,this._handleCrossIconKeyDown),(r=this._scanIcon)==null||r.addEventListener(`pointerdown`,this._handleScanIconPointerDown,{capture:!0}),(i=this._scanIcon)==null||i.addEventListener(`pointerup`,this._handleScanIconPointerUp),(a=this._scanIcon)==null||a.addEventListener(`keydown`,this._handleScanIconKeyDown))}_removeEventListeners(){var e,t,n,r,i,a;this._inputElement&&(this._inputElement.removeEventListener(`input`,this._handleInput),this._inputElement.removeEventListener(`focus`,this._handleFocus),this._inputElement.removeEventListener(`blur`,this._handleBlur),this._inputElement.removeEventListener(`keydown`,this._handleKeydown),(e=this._crossIcon)==null||e.removeEventListener(`pointerdown`,this._handleCrossIconPointerDown),(t=this._crossIcon)==null||t.removeEventListener(`pointerup`,this._handleCrossIconPointerUp),(n=this._crossIcon)==null||n.removeEventListener(`keydown`,this._handleCrossIconKeyDown),(r=this._scanIcon)==null||r.removeEventListener(`pointerdown`,this._handleScanIconPointerDown),(i=this._scanIcon)==null||i.removeEventListener(`pointerup`,this._handleScanIconPointerUp),(a=this._scanIcon)==null||a.removeEventListener(`keydown`,this._handleScanIconKeyDown))}_onCrossIconPointerDown(e){e&&e.preventDefault()}_onCrossIconPointerUp(e){!e||!this._crossIcon||(e.preventDefault(),this._triggerClear())}_onCrossIconKeyDown(e){!e||!this._crossIcon||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),this._triggerClear())}_onScanIconPointerDown(e){e&&(e.preventDefault(),e.stopPropagation())}_onScanIconPointerUp(e){!e||!this._scanIcon||(e.preventDefault(),e.stopPropagation(),this._triggerScan())}_triggerClear(){this.dispatchEvent(new Tt({target:this,innerInput:this._inputElement,value:this._value}))}_onScanIconKeyDown(e){!e||!this._scanIcon||(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),e.stopPropagation(),this._triggerScan())}_triggerScan(){this.dispatchEvent(new wt({target:this,innerInput:this._inputElement,value:this._value}))}static create(){return document.createElement(e.tag)}static register(){(0,c.defineCustomElements)({[e.tag]:e})}};J.tag=`scandit-text-input`,J.formAssociated=!0;async function jt(e,n=null,r=15){let i=new t.ScanditIconBuilder().withIcon(e).withWidth(r).withHeight(r).withIconSize(r);return i.withIconColor(n??t.Color.fromHex(`#000000`)),await i.build()}let Y={slideUp:e=>[{transform:`translateY(0)`},{transform:`translateY(${-e}px)`}],slideDown:e=>[{transform:`translateY(${-e}px)`},{transform:`translateY(0)`}],fadeOut:()=>[{opacity:`1`},{opacity:`0`}],fadeIn:()=>[{opacity:`0`},{opacity:`1`}]},X={duration:300,easing:`ease-in-out`,fill:`forwards`},Z={ClearAllButtonClicked:`scandit-clear-all-button-clicked`,PauseButtonClicked:`scandit-pause-button-clicked`,ClickedOutsideList:`scandit-clicked-outside-list`,ValidationFlowLayoutChange:`scandit-validation-flow-layout-change`};var Mt=class e extends c.ScanditHTMLElement{constructor(){var t,n,r;super(),this.formContainer_=null,this.panel_=null,this.backdrop_=null,this.adaptiveRecognitionOverlay_=null,this.clearButton_=null,this.submitButton_=null,this.pauseButton_=null,this.gridLayoutContainer_=null,this.buttonsContainer_=null,this.resizeObserver_=null,this.viewportMeta=null,this.originalViewportContent=null,this.onClearButtonClickHandler=this.onClearButtonClick.bind(this),this.onPauseButtonClickHandler=this.onPauseButtonClick.bind(this),this.onHostClickHandler=this.onHostClick.bind(this),this.collapseAnimations=new Map,this.focusedInput=null,this.focusedInputOffset=0,this.currentAnimationPromise=null,this.supportsContainerQueries_=!1;let i=this.attachShadow({mode:`open`});i.innerHTML=c.html`<${s.Backdrop.tag}></${s.Backdrop.tag}><${G.tag}></${G.tag}><div class="panel"><div class="buttons-container"></div><div class="container"><div class="grid-layout-container"></div></div></div>`,i.append(e.createStyleElement().cloneNode(!0)),this.panel_=i.querySelector(`.panel`),this.formContainer_=i.querySelector(`.container`),this.gridLayoutContainer_=i.querySelector(`.grid-layout-container`),this.backdrop_=i.querySelector(s.Backdrop.tag),this.adaptiveRecognitionOverlay_=i.querySelector(G.tag),this.buttonsContainer_=i.querySelector(`.buttons-container`),this.clearButton_=K.create(),this.clearButton_.variant=`secondary`,this.clearButton_.kind=`destructive`,this.clearButton_.size=`small`,this.clearButton_.textContent=`Clear All`,this.clearButton_.classList.add(`scandit-button-hidden`),this.clearButton_.setAttribute(`tabindex`,`-1`),this.submitButton_=K.create(),this.submitButton_.variant=`primary`,this.submitButton_.kind=`action`,this.submitButton_.size=`small`,this.submitButton_.type=`button`,this.submitButton_.disabled=!0,this.submitButton_.textContent=`Finish`,this.submitButton_.classList.add(`scandit-button-hidden`),this.submitButton_.setAttribute(`tabindex`,`-1`),this.pauseButton_=K.create(),this.pauseButton_.variant=`secondary`,this.pauseButton_.size=`small`,this.pauseButton_.textContent=`Pause`,this.pauseButton_.classList.add(`scandit-button-hidden`),this.pauseButton_.setAttribute(`tabindex`,`-1`),(t=this.buttonsContainer_)==null||t.append(this.clearButton_,this.pauseButton_,this.submitButton_),(n=this.clearButton_)==null||n.addEventListener(`click`,this.onClearButtonClickHandler),(r=this.pauseButton_)==null||r.addEventListener(`click`,this.onPauseButtonClickHandler),this.addEventListener(`click`,this.onHostClickHandler),this.addButtonIcons()}static createStyleElement(){return c.css`:host{font-family:Roboto,Noto Sans,Open Sans,sans-serif;inset:0;pointer-events:none;position:absolute;--safe-area-inset-top:env(safe-area-inset-top,0px);--safe-area-inset-bottom:env(safe-area-inset-bottom,0px);--safe-area-inset-left:env(safe-area-inset-left,0px);--safe-area-inset-right:env(safe-area-inset-right,0px)}:host([hidden]){display:none}${s.Backdrop.tag}{inset:0;pointer-events:auto;position:absolute}${G.tag}{max-height:calc(100% - var(--form-container-height, 0px))}.panel{inset:0;justify-content:flex-end;pointer-events:none;position:absolute}.container,.panel{display:flex;flex-direction:column}.container{background:#fff;flex-shrink:0;max-height:60%;overflow:hidden;pointer-events:auto}.buttons-container{box-sizing:border-box;display:flex;flex-direction:row;flex-shrink:0;justify-content:space-between;padding:.5rem 1rem;width:100%;z-index:1}.buttons-container>${K.tag}{opacity:1;pointer-events:auto;transition:opacity .3s ease-in-out,visibility .3s ease-in-out;visibility:visible}.buttons-container>${K.tag}.scandit-button-hidden{opacity:0;pointer-events:none;visibility:hidden}.grid-layout-container{align-content:start;box-sizing:border-box;display:grid;gap:1rem;grid-template-columns:repeat(4,1fr);margin:1rem;overflow-y:scroll;position:relative}.grid-layout-container>${J.tag}{grid-column:span 4;opacity:1;transform:translateY(0)}@media (min-width:48rem){.grid-layout-container{grid-template-columns:repeat(8,1fr);margin:2rem}}@media (min-width:68.75rem){.grid-layout-container{grid-template-columns:repeat(16,1fr);margin:2rem}}@supports (container-type:size){:host{container-type:size}@container (orientation: landscape) and (max-width: ${960}px){.panel{top:0}.container{bottom:0;left:auto;max-height:none;position:absolute;right:0;top:0;width:40%}.buttons-container{bottom:0;left:0;position:absolute;width:60%}.grid-layout-container{flex:1;grid-template-columns:repeat(4,1fr);margin:1rem;min-height:0}${G.tag}{max-height:100%;max-width:calc(100% - var(--form-container-width, 0px))}}}@supports not (container-type:size){@media (orientation:landscape) and (max-width:${960}px){.panel{top:0}.container{bottom:0;left:auto;max-height:none;position:absolute;right:0;top:0;width:40%}.buttons-container{bottom:0;left:0;position:absolute;width:60%}.grid-layout-container{flex:1;grid-template-columns:repeat(4,1fr);margin:1rem;min-height:0}${G.tag}{max-height:100%;max-width:calc(100% - var(--form-container-width, 0px))}}}`}static create(){return e.register(),document.createElement(e.tag)}static register(){(0,c.defineCustomElements)({[e.tag]:e}),G.register(),s.Backdrop.register(),K.register(),J.register()}get backdrop(){return this.backdrop_}get clearButton(){return this.clearButton_}get submitButton(){return this.submitButton_}get pauseButton(){return this.pauseButton_}getInputs(){if(!this.gridLayoutContainer_)return[];let e=this.gridLayoutContainer_.querySelectorAll(J.tag);return Array.from(e)}getInputByName(e){if(this.gridLayoutContainer_)return this.gridLayoutContainer_.querySelector(`${J.tag}[name="${e}"]`)??void 0}connectedCallback(){this.supportsContainerQueries_=CSS.supports(`container-type: size`),t.BrowserHelper.isIOS()&&this.disableViewportZoom(),this.resizeObserver_=new ResizeObserver(()=>this.dispatchLayoutChange()),this.resizeObserver_.observe(this),this.formContainer_&&this.resizeObserver_.observe(this.formContainer_)}disconnectedCallback(){var e;this.restoreViewportZoom(),(e=this.resizeObserver_)==null||e.disconnect(),this.resizeObserver_=null,this.resetInputsState(),this.currentAnimationPromise=null,this.gridLayoutContainer_&&(this.gridLayoutContainer_.innerHTML=``)}onClearButtonClick(){let e=this.getInputs();this.dispatchEvent(new CustomEvent(Z.ClearAllButtonClicked,{bubbles:!0,detail:{inputs:e}}))}onPauseButtonClick(){this.dispatchEvent(new CustomEvent(Z.PauseButtonClicked,{bubbles:!0}))}onHostClick(e){this.panel_&&e.composedPath().includes(this.panel_)||this.dispatchEvent(new CustomEvent(Z.ClickedOutsideList,{bubbles:!0}))}async addButtonIcons(){var e,n,r;let[i,a,o]=await Promise.all([jt(t.ScanditIconType.Delete),jt(t.ScanditIconType.Checkmark),jt(t.ScanditIconType.Pause)]);i.slot=`icon-start`,(e=this.clearButton_)==null||e.append(i),a.slot=`icon-start`,(n=this.submitButton_)==null||n.append(a),o.slot=`icon-start`,(r=this.pauseButton_)==null||r.append(o)}dispatchLayoutChange(){var e;if(!this.isConnected||!this.formContainer_)return;let t=this.offsetWidth>this.offsetHeight,n=this.supportsContainerQueries_?this.offsetWidth:globalThis.innerWidth,r=t&&n<=960;this.style.setProperty(`--form-container-height`,`${this.formContainer_.offsetHeight}px`),this.style.setProperty(`--form-container-width`,`${this.formContainer_.offsetWidth}px`);let i=0,a=0,o=0,s=0;if(r){let e=getComputedStyle(this);i=parseInt(e.getPropertyValue(`--safe-area-inset-bottom`).trim(),10)||0,a=parseInt(e.getPropertyValue(`--safe-area-inset-top`).trim(),10)||0,o=parseInt(e.getPropertyValue(`--safe-area-inset-left`).trim(),10)||0,s=parseInt(e.getPropertyValue(`--safe-area-inset-right`).trim(),10)||0}let c={formHeight:this.formSectionHeight,formWidth:this.formSectionWidth,buttonsHeight:((e=this.buttonsContainer_)==null?void 0:e.offsetHeight)??0,isLandscape:t,isPanelOnRightSide:r,safeAreaInsetBottom:i,safeAreaInsetTop:a,safeAreaInsetLeft:o,safeAreaInsetRight:s};this.dispatchEvent(new CustomEvent(Z.ValidationFlowLayoutChange,{bubbles:!0,detail:c}))}disableViewportZoom(){if(this.viewportMeta||=document.querySelector(`meta[name='viewport']`),!this.viewportMeta)return;this.originalViewportContent===null&&(this.originalViewportContent=this.viewportMeta.getAttribute(`content`)??``);let e=St(this.viewportMeta.getAttribute(`content`)??``);e.set(`maximum-scale`,`1`),e.set(`user-scalable`,`no`),this.viewportMeta.setAttribute(`content`,Ct(e))}restoreViewportZoom(){this.viewportMeta&&this.originalViewportContent!==null&&(this.viewportMeta.setAttribute(`content`,this.originalViewportContent),this.originalViewportContent=null)}showButton(e){e&&(e.classList.remove(`scandit-button-hidden`),e.removeAttribute(`tabindex`))}hideButton(e){e&&(e.classList.add(`scandit-button-hidden`),e.setAttribute(`tabindex`,`-1`))}showValidationButtons(){this.showButton(this.clearButton_),this.showButton(this.submitButton_),this.hideButton(this.pauseButton_)}showScanningButtons(){this.hideButton(this.clearButton_),this.hideButton(this.submitButton_),this.showButton(this.pauseButton_)}hideAllButtons(){var e;(e=this.buttonsContainer_)==null||e.querySelectorAll(K.tag).forEach(e=>{this.hideButton(e)})}get formSectionHeight(){var e,t;return this.isConnected?(((e=this.buttonsContainer_)==null?void 0:e.offsetHeight)??0)+(((t=this.formContainer_)==null?void 0:t.offsetHeight)??0):0}get formSectionWidth(){var e;return this.isConnected?((e=this.formContainer_)==null?void 0:e.offsetWidth)??0:0}get finishButtonText(){var e;return((e=this.submitButton_)==null?void 0:e.textContent)??``}set finishButtonText(e){this.submitButton_&&(this.submitButton_.textContent=e)}get restartButtonText(){var e;return((e=this.clearButton_)==null?void 0:e.textContent)??``}set restartButtonText(e){this.clearButton_&&(this.clearButton_.textContent=e)}get pauseButtonText(){var e;return((e=this.pauseButton_)==null?void 0:e.textContent)??``}set pauseButtonText(e){this.pauseButton_&&(this.pauseButton_.textContent=e)}appendInputs(...e){var t;(t=this.gridLayoutContainer_)==null||t.append(...e),(0,c.safeRequestAnimationFrame)(()=>{this.dispatchLayoutChange()})}async waitForAnimations(){this.currentAnimationPromise&&await this.currentAnimationPromise}resetCurrentAnimations(){for(let e of this.getAnimations({subtree:!0}))(0,c.safeCancelAnimation)(e);this.collapseAnimations.clear()}resetInputsState(){if(this.resetCurrentAnimations(),this.focusedInput=null,this.focusedInputOffset=0,this.gridLayoutContainer_)for(let e of this.getInputs())e.style.removeProperty(`pointer-events`)}async moveInputToTop(e){if(!this.gridLayoutContainer_)return;await this.waitForAnimations(),this.resetInputsState();let t=(async()=>{if(!this.gridLayoutContainer_)return;(0,c.safeRequestAnimationFrame)(()=>{this.gridLayoutContainer_&&(this.gridLayoutContainer_.scrollTop=0)});let t=this.getInputs();this.focusedInput=e;let n=this.gridLayoutContainer_.getBoundingClientRect(),r=e.getBoundingClientRect(),i=this.gridLayoutContainer_.scrollTop||0,a=Math.round(r.top-n.top+i);this.focusedInputOffset=a;let o=[],s=e.animate(Y.slideUp(a),X);this.collapseAnimations.set(e,s),o.push((0,c.safeAwaitAnimation)(s));for(let n of t)if(n!==e){n.style.pointerEvents=`none`;let e=n.animate(Y.fadeOut(),X);this.collapseAnimations.set(n,e),o.push((0,c.safeAwaitAnimation)(e))}await Promise.all(o)})();this.currentAnimationPromise=t;try{await t}finally{this.currentAnimationPromise=null}}async restoreInputsPositions(){await this.waitForAnimations();let e=(async()=>{if(!this.focusedInput)return;let e=this.getInputs(),t=[];if(this.focusedInputOffset>0){let e=this.focusedInput.animate(Y.slideDown(this.focusedInputOffset),X);this.collapseAnimations.set(this.focusedInput,e),t.push((0,c.safeAwaitAnimation)(e))}for(let n of e)if(n!==this.focusedInput){let e=n.animate(Y.fadeIn(),X);this.collapseAnimations.set(n,e),t.push((0,c.safeAwaitAnimation)(e).then(()=>{n.style.removeProperty(`pointer-events`)}))}await Promise.all(t),this.focusedInput=null,this.focusedInputOffset=0})();this.currentAnimationPromise=e;try{await e}finally{this.currentAnimationPromise=null,this.resetInputsState()}}showAdaptiveRecognitionOverlay(){this.adaptiveRecognitionOverlay_&&(this.adaptiveRecognitionOverlay_.show=!0)}hideAdaptiveRecognitionOverlay(){this.adaptiveRecognitionOverlay_&&(this.adaptiveRecognitionOverlay_.show=!1)}};Mt.tag=`scandit-label-capture-validation-flow-layout`;var Nt,Pt,Ft,It,Q,$,Lt,Rt,zt,Bt=_((()=>{Nt=e=>typeof e==`object`&&!!e&&e.nodeType===1,Pt=(e,t)=>t&&e===`hidden`?!1:e!==`visible`&&e!==`clip`,Ft=e=>{if(!e.ownerDocument||!e.ownerDocument.defaultView)return null;try{return e.ownerDocument.defaultView.frameElement}catch{return null}},It=e=>{let t=Ft(e);return t?t.clientHeight<e.scrollHeight||t.clientWidth<e.scrollWidth:!1},Q=(e,t)=>{if(e.clientHeight<e.scrollHeight||e.clientWidth<e.scrollWidth){let n=getComputedStyle(e,null);return Pt(n.overflowY,t)||Pt(n.overflowX,t)||It(e)}return!1},$=(e,t,n,r,i,a,o,s)=>a<e&&o>t||a>e&&o<t?0:a<=e&&s<=n||o>=t&&s>=n?a-e-r:o>t&&s<n||a<e&&s>n?o-t+i:0,Lt=e=>e.parentElement??(e.getRootNode().host||null),Rt=e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}},zt=(e,t)=>{var n,r;if(typeof document>`u`)return[];let{scrollMode:i,block:a,inline:o,boundary:s,skipOverflowHiddenElements:c}=t,l=typeof s==`function`?s:e=>e!==s;if(!Nt(e))throw TypeError(`Invalid target`);let u=document.scrollingElement||document.documentElement,d=[],f=e;for(;Nt(f)&&l(f);){if(f=Lt(f),f===u){d.push(f);break}f!=null&&f===document.body&&Q(f)&&!Q(document.documentElement)||f!=null&&Q(f,c)&&d.push(f)}let p=((n=window.visualViewport)==null?void 0:n.width)??innerWidth,m=((r=window.visualViewport)==null?void 0:r.height)??innerHeight,{scrollX:h,scrollY:g}=window,{height:_,width:v,top:y,right:b,bottom:x,left:S}=e.getBoundingClientRect(),{top:C,right:w,bottom:T,left:E}=Rt(e),D=a===`start`||a===`nearest`?y-C:a===`end`?x+T:y+_/2-C+T,O=o===`center`?S+v/2-E+w:o===`end`?b+w:S-E,k=[];for(let e=0;e<d.length;e++){let t=d[e],{height:n,width:r,top:s,right:c,bottom:l,left:f}=t.getBoundingClientRect();if(i===`if-needed`&&y>=0&&S>=0&&x<=m&&b<=p&&(t===u&&!Q(t)||y>=s&&x<=l&&S>=f&&b<=c))return k;let C=getComputedStyle(t),w=parseInt(C.borderLeftWidth,10),T=parseInt(C.borderTopWidth,10),E=parseInt(C.borderRightWidth,10),A=parseInt(C.borderBottomWidth,10),j=0,M=0,N=`offsetWidth`in t?t.offsetWidth-t.clientWidth-w-E:0,P=`offsetHeight`in t?t.offsetHeight-t.clientHeight-T-A:0,F=`offsetWidth`in t?t.offsetWidth===0?0:r/t.offsetWidth:0,I=`offsetHeight`in t?t.offsetHeight===0?0:n/t.offsetHeight:0;if(u===t)j=a===`start`?D:a===`end`?D-m:a===`nearest`?$(g,g+m,m,T,A,g+D,g+D+_,_):D-m/2,M=o===`start`?O:o===`center`?O-p/2:o===`end`?O-p:$(h,h+p,p,w,E,h+O,h+O+v,v),j=Math.max(0,j+g),M=Math.max(0,M+h);else{j=a===`start`?D-s-T:a===`end`?D-l+A+P:a===`nearest`?$(s,l,n,T,A+P,D,D+_,_):D-(s+n/2)+P/2,M=o===`start`?O-f-w:o===`center`?O-(f+r/2)+N/2:o===`end`?O-c+E+N:$(f,c,r,w,E+N,O,O+v,v);let{scrollLeft:e,scrollTop:i}=t;j=I===0?0:Math.max(0,Math.min(i+j/I,t.scrollHeight-n/I+P)),M=F===0?0:Math.max(0,Math.min(e+M/F,t.scrollWidth-r/F+N)),D+=i-j,O+=e-M}k.push({el:t,top:j,left:M})}return k}})),Vt=v({default:()=>Ht});function Ht(e,t){if(!e.isConnected||!qt(e))return;let n=Kt(e);if(Wt(t))return t.behavior(zt(e,t));let r=typeof t==`boolean`||t==null?void 0:t.behavior;for(let{el:i,top:a,left:o}of zt(e,Gt(t))){let e=a-n.top+n.bottom,t=o-n.left+n.right;i.scroll({top:e,left:t,behavior:r})}}var Ut,Wt,Gt,Kt,qt,Jt=_((()=>{Bt(),Ut=e=>e===Object(e)&&Object.keys(e).length!==0,Wt=e=>typeof e==`object`&&typeof e.behavior==`function`,Gt=e=>e===!1?{block:`end`,inline:`nearest`}:Ut(e)?e:{block:`start`,inline:`nearest`},Kt=e=>{let t=window.getComputedStyle(e);return{top:parseFloat(t.scrollMarginTop)||0,right:parseFloat(t.scrollMarginRight)||0,bottom:parseFloat(t.scrollMarginBottom)||0,left:parseFloat(t.scrollMarginLeft)||0}},qt=e=>{let t=e;for(;t!=null&&t.parentNode;)if(t.parentNode===document)return!0;else t=t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode;return!1}})),Yt=class e{static ensureCustomElementsRegistered(){Mt.register(),J.register()}constructor(){this.layout=null,this.scrollIntoView=null,e.ensureCustomElementsRegistered()}getInputs(){var e;return((e=this.layout)==null?void 0:e.getInputs())??[]}getInputByName(e){var t;return((t=this.layout)==null?void 0:t.getInputByName(e))??null}hasInput(e){return this.getInputByName(e)!==null}isInputFocused(e){var t;let n=this.getInputByName(e);return n?n.hasAttribute(`focused`)||((t=document.activeElement)==null?void 0:t.closest(J.tag))===n:!1}isFocusedElementAnTextInput(){var e,t;let n=((e=this.layout)==null||(e=e.shadowRoot)==null?void 0:e.activeElement)??document.activeElement;return(n==null||(t=n.closest(J.tag))==null?void 0:t.tagName.toLowerCase())===J.tag}showScanningButtons(){var e;(e=this.layout)==null||e.showScanningButtons()}showValidationButtons(){var e;(e=this.layout)==null||e.showValidationButtons()}hideAllButtons(){var e;(e=this.layout)==null||e.hideAllButtons()}setSubmitButtonDisabled(e){var t;(t=this.layout)!=null&&t.submitButton&&(this.layout.submitButton.disabled=e)}updateInputVisualState(e,t){let n=this.getInputByName(e);n&&(t.value!==void 0&&(n.value=t.value),t.loading!==void 0&&(n.loading=t.loading),t.loadingText!==void 0&&(n.loadingText=t.loadingText),t.invalid!==void 0&&(t.invalid&&t.hintMessage?n.setValidationState(!1,t.hintMessage):t.invalid||n.resetValidation()),t.backgroundColor!==void 0&&(n.backgroundColor=t.backgroundColor))}resetInputValidation(e){let t=this.getInputByName(e);t&&t.resetValidation()}updateScanIconVisibility(e,t){let n=this.getInputByName(e);n&&(n.hideScanIcon=!t)}updateAllScanIconVisibility(e){let t=this.getInputs();for(let n of t)n.hideScanIcon=!e}updateInputForState(e,t,n,r){switch(t){case`initial`:this.updateInputVisualState(e,{value:n,loading:!1,loadingText:``,invalid:!1,backgroundColor:``});break;case`scanning`:this.updateInputVisualState(e,{value:n,loading:!0,loadingText:r.scanningText||`Scanning`,invalid:!1,backgroundColor:``});break;case`cloudBackup`:this.updateInputVisualState(e,{value:n,loading:!0,loadingText:r.adaptiveScanningText||`Processing, tap to type manually`,invalid:!1,backgroundColor:``});break;case`validated`:this.updateInputVisualState(e,{value:n,loading:!1,invalid:!1,backgroundColor:r.backgroundColor||``});break;case`error`:this.updateInputVisualState(e,{value:n,loading:!1,invalid:!0,hintMessage:r.hintMessage||``,backgroundColor:``});break}r.scanIconVisible!==void 0&&this.updateScanIconVisibility(e,r.scanIconVisible)}showAdaptiveRecognitionOverlay(){var e;(e=this.layout)==null||e.showAdaptiveRecognitionOverlay()}hideAdaptiveRecognitionOverlay(){var e;(e=this.layout)==null||e.hideAdaptiveRecognitionOverlay()}async showBackdrop(){var e;await((e=this.layout)==null||(e=e.backdrop)==null?void 0:e.show())}async hideBackdrop(){var e;await((e=this.layout)==null||(e=e.backdrop)==null?void 0:e.hide())}async moveInputToTop(e){var t;let n=this.getInputByName(e);n&&await((t=this.layout)==null?void 0:t.moveInputToTop(n))}async restoreInputsPositions(){var e;await((e=this.layout)==null?void 0:e.restoreInputsPositions())}updateButtonText(e){this.layout&&(e.finishButtonText!==void 0&&(this.layout.finishButtonText=e.finishButtonText),e.restartButtonText!==void 0&&(this.layout.restartButtonText=e.restartButtonText),e.pauseButtonText!==void 0&&(this.layout.pauseButtonText=e.pauseButtonText))}setInputPlaceholder(e,t){let n=this.getInputByName(e);n&&(n.placeholder=t)}clearInputPlaceholder(e){let t=this.getInputByName(e);t&&(t.placeholder=``)}setInputValue(e,t){let n=this.getInputByName(e);n&&(n.value=t)}getInputValue(e){let t=this.getInputByName(e);return(t==null?void 0:t.value)??``}setInputBackgroundColor(e,t){let n=this.getInputByName(e);n&&(n.backgroundColor=t)}initializeInputs(e){var t;this.clearInputs();let n=[];for(let t of e){let e=J.create();e.type=t.type,e.label=t.label,e.value=t.value,e.required=t.required,e.name=t.fieldId.toKey(),e.loadingText=t.loadingText,n.push(e)}(t=this.layout)==null||t.appendInputs(...n)}appendInputs(...e){var t;(t=this.layout)==null||t.appendInputs(...e)}clearInputs(){for(let e of this.getInputs())e.remove()}focusInput(e){let t=this.getInputByName(e);t==null||t.focus()}blurInput(e){let t=this.getInputByName(e);t==null||t.blur()}scrollInputIntoView(e,n){let r=this.getInputByName(e);if(r){if(t.BrowserHelper.isIOS()){var i;n.detail.orientation===t.Orientation.LandscapeLeft||n.detail.orientation===t.Orientation.LandscapeRight?r.style.scrollMarginBottom=`-20px`:r.style.removeProperty(`scroll-margin-bottom`),(i=this.scrollIntoView)==null||i.call(this,r,{behavior:`smooth`,block:`end`,inline:`nearest`});return}r.scrollIntoView({behavior:`smooth`,block:`end`,inline:`nearest`})}}isInputActiveElement(e){return this.getInputByName(e)===document.activeElement}blurActiveElement(){var e;(e=document.activeElement)==null||e.blur()}addEventListener(e,t){var n;(n=this.layout)==null||n.addEventListener(e,t)}removeEventListener(e,t){var n;(n=this.layout)==null||n.removeEventListener(e,t)}addSubmitButtonListener(e){var t;(t=this.layout)==null||(t=t.submitButton)==null||t.addEventListener(`click`,e)}removeSubmitButtonListener(e){var t;(t=this.layout)==null||(t=t.submitButton)==null||t.removeEventListener(`click`,e)}async mount(e){this.layout||(this.layout=Mt.create(),e[t.INTERNAL_ACCESS].attachAdditionalLayer(this.layout,t.AdditionalLayerPosition.OverlayContainer),t.BrowserHelper.isIOS()&&(this.scrollIntoView=(await Promise.resolve().then(()=>(Jt(),Vt))).default))}async unmount(e){var t;(t=this.layout)==null||t.remove(),this.layout=null,this.scrollIntoView=null}};let Xt=e=>e?e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e.tagName.toLowerCase()===J.tag:!1;var Zt=class extends CustomEvent{constructor(e,t=0,n=0,r){super(`keyboard-visibility-changed`,{detail:{isKeyboardVisible:e,keyboardHeight:t,keyboardTop:n,orientation:r},bubbles:!0,composed:!0})}},Qt=class e extends EventTarget{constructor(t){super(),this._isKeyboardVisible=!1,this._keyboardHeight=0,this._keyboardTop=0,this._isConnected=!1,this._refCount=0,this._initialViewportHeight=0,this._initialViewportWidth=0,this._handleFocusIn=this._onFocusIn.bind(this),this._handleFocusOut=this._onFocusOut.bind(this),this._handleVisualViewportResize=(0,a.debounce)(this._onVisualViewportResize.bind(this),e.VIEWPORT_RESIZE_DEBOUNCE),this._handleOrientationChange=this._onOrientationChange.bind(this),this._orientationObserver=new m.OrientationObserver,this._globals=t}static getInstance(){if(!e._instance){var t;e._instance=new e({document:globalThis.document,window:globalThis.window,visualViewport:((t=globalThis.window)==null?void 0:t.visualViewport)??null})}return e._instance}static create(t){return new e(t)}connect(){if(this._refCount++,this._isConnected){`${this._refCount}`;return}if(`${this._refCount}`,this._isConnected=!0,this._refCount===1&&this._globals.visualViewport){let e=this._globals.window.innerHeight,t=this._globals.window.innerWidth;this._initialViewportHeight=Math.max(e,this._globals.visualViewport.height),this._initialViewportWidth=Math.max(t,this._globals.visualViewport.width),`${this._initialViewportHeight}${this._initialViewportWidth}`}this._setupListeners()}disconnect(){this._refCount--,this._refCount<=0&&(this._refCount=0,this._isConnected=!1,this._removeListeners())}_setupListeners(){this._globals.document.addEventListener(`focusin`,this._handleFocusIn,!0),this._globals.document.addEventListener(`focusout`,this._handleFocusOut,!0),this._orientationObserver.register(),this._orientationObserver.addEventListener(`orientationchange`,this._handleOrientationChange),this._globals.visualViewport&&(this._globals.visualViewport.addEventListener(`resize`,this._handleVisualViewportResize),this._globals.visualViewport.addEventListener(`scroll`,this._handleVisualViewportResize))}_removeListeners(){this._globals.document.removeEventListener(`focusin`,this._handleFocusIn,!0),this._globals.document.removeEventListener(`focusout`,this._handleFocusOut,!0),this._orientationObserver.removeEventListener(`orientationchange`,this._handleOrientationChange),this._orientationObserver.unregister(),this._globals.visualViewport&&(this._globals.visualViewport.removeEventListener(`resize`,this._handleVisualViewportResize),this._globals.visualViewport.removeEventListener(`scroll`,this._handleVisualViewportResize))}_calculateKeyboardHeight(){if(!this._globals.visualViewport)return 0;let n=this._orientationObserver.orientation.value===t.Orientation.LandscapeLeft||this._orientationObserver.orientation.value===t.Orientation.LandscapeRight,r,i;n&&this._initialViewportWidth>0?(r=this._initialViewportWidth,i=`initialViewportWidth (landscape mode)`):(r=this._initialViewportHeight>0?this._initialViewportHeight:this._globals.window.innerHeight,i=this._initialViewportHeight>0?`initialViewportHeight (portrait)`:`window.innerHeight (fallback)`);let a=Math.floor(r-this._globals.visualViewport.height);return`${i}${r}${this._globals.visualViewport.height}${a}${e.KEYBOARD_HEIGHT_THRESHOLD}`,a>=e.KEYBOARD_HEIGHT_THRESHOLD?a:0}_calculateKeyboardTop(){return this._globals.visualViewport?Math.floor(this._globals.visualViewport.offsetTop+this._globals.visualViewport.height):0}_onVisualViewportResize(){if(!this._globals.visualViewport)return;let t=this._calculateKeyboardHeight(),n=this._calculateKeyboardTop(),r=Xt(this._globals.document.activeElement),i=this._isKeyboardVisible!==r;`${e.VIEWPORT_RESIZE_DEBOUNCE}${t}${n}${r}${i}${this._orientationObserver.orientation.value}${this._initialViewportHeight}${this._initialViewportWidth}${this._globals.visualViewport.height}${this._globals.visualViewport.width}`,i?(this._isKeyboardVisible=r,this._keyboardHeight=t,this._keyboardTop=n,this.dispatchEvent(new Zt(r,t,n,this._orientationObserver.orientation.value))):(`${this._isKeyboardVisible}${r}`,r&&(this._keyboardHeight=t,this._keyboardTop=n))}_onOrientationChange(e){var n;e.detail.value===t.Orientation.LandscapeRight||(e.detail.value,t.Orientation.LandscapeLeft),`${e.detail.value}`,`${this._globals.window.innerHeight}${this._globals.window.innerWidth}${(n=this._globals.visualViewport)==null?void 0:n.height}`,`${this._initialViewportHeight}${this._initialViewportWidth}`,this._onVisualViewportResize()}_onFocusIn(e){let t=e.target;Xt(t)?(`${t.tagName}${this._isConnected}`,this._handleVisualViewportResize()):`${t.tagName}${t.className}`}_onFocusOut(e){let t=e.target;Xt(t)?(`${t.tagName}${this._isConnected}`,this._handleVisualViewportResize()):`${t.tagName}${t.className}`}isKeyboardVisible(){return this._isKeyboardVisible}getKeyboardHeight(){return this._keyboardHeight}getKeyboardTop(){return this._keyboardTop}addEventListener(e,t,n){super.addEventListener(e,t,n)}removeEventListener(e,t,n){super.removeEventListener(e,t,n)}reset(t=!1){this._refCount=0,this._initialViewportHeight=0,this._initialViewportWidth=0,this._isConnected&&(this._isConnected=!1,this._removeListeners()),t&&(e._instance=null)}};Qt._instance=null,Qt.KEYBOARD_HEIGHT_THRESHOLD=100,Qt.VIEWPORT_RESIZE_DEBOUNCE=150;function $t(e){return e?`${e.day} - ${e.month} - ${e.year}`:``}function en(e){let t=``;switch(e.type){case x.Text:t=e.text||``;break;case x.Barcode:var n;t=((n=e.barcode)==null?void 0:n.data)||e.text||``;break;default:var r;t=e.text||((r=e.barcode)==null?void 0:r.data)||$t(e.date)||``;break}return t}var tn=class{get view(){return this._view}constructor(e,t,n,r,i,a=new Yt,o=Qt.create({document:globalThis.document,window:globalThis.window,visualViewport:globalThis.window.visualViewport})){this.stateManager=e,this.settings=t,this.validationFlowHandler=n,this.labelCapture=r,this.feedback=i,this.keyboardController=o,this._isAdjustingScanArea=!1,this.dataCaptureView=null,this.onTextInputScanIconClickHandler=this.onTextInputScanIconClick.bind(this),this.onTextInputClearIconClickHandler=this.onTextInputClearIconClick.bind(this),this.onTextInputFocusHandler=this.onTextInputFocus.bind(this),this.onTextInputBlurHandler=this.onTextInputBlur.bind(this),this.onTextInputKeydownHandler=this.onTextInputKeydown.bind(this),this.onClearAllButtonClickedHandler=this.onClearAllButtonClicked.bind(this),this.onSubmitButtonClickedHandler=this.onSubmitButtonClicked.bind(this),this.onPauseButtonClickedHandler=this.onPauseButtonClicked.bind(this),this.onClickedOutsideListHandler=this.onClickedOutsideList.bind(this),this.onValidationFlowLayoutChangeHandler=this.onValidationFlowLayoutChange.bind(this),this.onKeyboardVisibilityChangedHandler=this.onKeyboardVisibilityChanged.bind(this),this._view=a}updateSettings(e){this.settings=e,this._view.updateButtonText({finishButtonText:e.finishButtonText,restartButtonText:e.restartButtonText,pauseButtonText:e.pauseButtonText})}get camera(){var e;return(e=this.labelCapture)!=null&&e.context&&(0,t.isCameraFrameSource)(this.labelCapture.context.frameSource)?this.labelCapture.context.frameSource:null}setExternalListener(e){this.externalListener=e}async goToCompleteScan(){this.stateManager.clearPartialScanTargets(),await this.validationFlowHandler.startCompleteLabelScan(``);let e=await this.validationFlowHandler.validationFlowFields();e.length>0&&(await this.initializeInputs(e),this.stateManager.isScanning||(this.stateManager.validationFlowHandlerState=2),this.stateManager.setScanResults(e),this.syncInputWithState())}async resumeScan(){await this.validationFlowHandler.resumeScan()}async resumePreviousScanMode(){let e=this.stateManager.getPartialScanTargets();if(e.length===0){await this.validationFlowHandler.resumeScan();return}await this.validationFlowHandler.startPartialLabelScan(e.map(e=>({fieldName:e.fieldName,instanceIndex:e.instanceIndex??void 0})))}async initializeInputs(e){let t=e.map(e=>{let t=e.getLabelField(),n=bt.fromLabelField(t),r=t.instanceIndex==null?t.name:`${t.name} (${t.instanceIndex+1})`;return{fieldId:n,type:`text`,label:t.isRequired?r:`${r} (optional)`,loadingText:this.settings.scanningText||`Scanning`,value:t.text??``,required:t.isRequired}});this.stateManager.clearFields(),this.stateManager.registerFields(t.map(e=>e.fieldId.toKey())),this.stateManager.registerFieldInstances(t.map(e=>e.fieldId)),this._view.initializeInputs(t),this.updateAllScanIconsVisibility()}updateScanIconVisibility(e){let t=this._view.isInputFocused(e),n=this._view.getInputValue(e).trim()===``,r=!this.stateManager.isScanningOrCloudBackup&&(t||n);this._view.updateScanIconVisibility(e,r)}updateAllScanIconsVisibility(){for(let e of this._view.getInputs())this.updateScanIconVisibility(e.name)}updateSubmitButtonState(){let e=this._view.getInputs(),t=!0;for(let n of e)if(n.required&&(n.value.trim()===``||n.invalid)){t=!1;break}this._view.setSubmitButtonDisabled(!t)}async updateFieldValueAndState(e){let t=this._view.getInputByName(e);if(!t)return!1;let n=t.value;if(!t.required&&n.trim()===``){let t=await this.callUpdateFieldValue(e,n);return this.applyInputState(e,`initial`,n),this.updateSubmitButtonState(),t}let r=await this.callUpdateFieldValue(e,n),i=r?`initial`:`error`;return this.applyInputState(e,i,n),this.updateSubmitButtonState(),r}async callUpdateFieldValue(e,t){let n=this.stateManager.getFieldInstance(e);return n!=null&&this.validationFlowHandler.updateFieldValue({fieldName:n.fieldName,instanceIndex:n.instanceIndex??void 0},t)}async refocusInputForCorrection(e){this._view.hasInput(e)&&(this._view.isInputActiveElement(e)||this._view.focusInput(e),this.updateScanIconVisibility(e))}async restoreLayout(e){this._view.hasInput(e)&&(this._view.clearInputPlaceholder(e),await this._view.restoreInputsPositions(),this.restoreButtonsBasedOnState(),this.updateAllScanIconsVisibility())}async updateCloudBackupTaskState(e,t){let n=this.stateManager.getFieldInstance(e);if(n==null)return;let r=n.fieldName;if(t===`cancel`)this.stateManager.cancelCloudBackupForField(e),await this.validationFlowHandler.cancelCloudBackupTaskForField(r);else{this.stateManager.uncancelCloudBackupForField(e),await this.validationFlowHandler.uncancelCloudBackupTaskForField(r);let t=await this.validationFlowHandler.validationFlowFields();this.updateCloudBackupFieldsMap(t),this.syncInputWithState()}}updateCloudBackupFieldsMap(e){this.stateManager.updateCloudBackupFields(e)}getInputStateConfig(e){return{scanningText:this.settings.scanningText,adaptiveScanningText:this.settings.adaptiveScanningText,hintMessage:(e==null?void 0:e.hintMessage)??this.settings.validationErrorText,backgroundColor:(e==null?void 0:e.backgroundColor)??``,scanIconVisible:!this.stateManager.isScanningOrCloudBackup}}applyInputState(e,t,n,r){this.stateManager.setInputState(e,t),this._view.updateInputForState(e,this.stateManager.getInputState(e),n,this.getInputStateConfig(r))}async onFieldsScanned(e){!e||e.length===0||(t.Logger.info(`onFieldsScanned`,{fields:e}),this.stateManager.setScanResults(e),this.updateAllScanIconsVisibility(),this.syncInputWithState())}async onLabelIsMissingRequiredField(e){!e||e.length===0||(this.stateManager.setScanResults(e),this.syncInputWithState())}async onScanTimeout(){this.stateManager.markTimeout(),await this.validationFlowHandler.pauseScan()}syncInputWithState(){let e=this.getInputStateConfig(),t=new Set(this.stateManager.getCloudBackupFields());for(let n of this._view.getInputs()){let r=n.value.trim()===``,i,a=n.value,o=this.stateManager.getScanResult(n.name),s=o&&en(o.getLabelField())?o:void 0;if(s){let e=s.getLabelField();a=en(e),i=s.isValid()?`validated`:e.isRequired||a?`error`:`initial`}else i=t.has(n.name)&&r?`cloudBackup`:this.stateManager.isScanning&&r?`scanning`:`initial`;this.stateManager.setInputState(n.name,i),this._view.updateInputForState(n.name,this.stateManager.getInputState(n.name),a,{...e,backgroundColor:``})}this.updateSubmitButtonState(),this.updateAllScanIconsVisibility()}onManualInput(e,t,n){var r;(r=this.externalListener)==null||r.onManualInput(e.getLabelField(),t,n)}restoreButtonsBasedOnState(){switch(!0){case this.stateManager.isScanning:this._view.showScanningButtons();break;case this.stateManager.isPaused:this._view.showValidationButtons();break;default:this._view.hideAllButtons();break}}async onStateChanged(e){switch(this.stateManager.validationFlowHandlerState=e,this.restoreButtonsBasedOnState(),!0){case this.stateManager.isScanning:await this.onScanStateChanged();break;case this.stateManager.isPaused:await this.onPauseStateChanged();break}}async onCloudBackupServiceStarted(){this.stateManager.startCloudBackupService(),this.updateAllScanIconsVisibility(),this._view.showAdaptiveRecognitionOverlay(),this.syncInputWithState()}async onCloudBackupServiceStopped(){this.stateManager.isCloudBackupProcessing&&this.stateManager.stopCloudBackup();let e=await this.validationFlowHandler.validationFlowFields();this.updateCloudBackupFieldsMap(e),this.updateAllScanIconsVisibility(),this._view.hideAdaptiveRecognitionOverlay(),this.syncInputWithState()}async onResultUpdate(e,n,r){var i,a;if((i=this.externalListener)==null||(a=i.onValidationFlowResultUpdate)==null||a.call(i,e,n.map(e=>e.getLabelField()),r&&this.labelCapture.context?(0,t.convertToPublicFrameData)(r,this.labelCapture.context):null),e===Ge.AsyncStarted){this.updateCloudBackupFieldsMap(n),this.syncInputWithState();return}if(this.stateManager.updateScanResults(n),this.syncInputWithState(),e===Ge.Sync){for(let e of n){let t=e.getLabelField(),n=W(t);if(!this._view.hasInput(n)||this.stateManager.isCurrentInputName(n)||!e.isValid())continue;let r=en(t);this.applyInputState(n,`validated`,r,{backgroundColor:u.teals.teal10}),this.updateScanIconVisibility(n)}this.feedback.scan.emit()}}onCloudBackupFeedbackEmit(){this.feedback.adaptiveRecognitionResult.emit()}async standByCamera(){this.camera&&await this.camera.switchToDesiredState(t.FrameSourceState.Standby)}async activateCamera(){this.camera&&await this.camera.switchToDesiredState(t.FrameSourceState.On)}async onTextInputScanIconClick(e){let t=e.detail.target.closest(J.tag),n=t==null?void 0:t.name;if(!n)return;this._view.setInputValue(n,``),this._view.blurInput(n),this.stateManager.clearCurrentInputName(),await this.callUpdateFieldValue(n,``);let r=this.stateManager.getFieldInstance(n);r!=null&&(this.stateManager.setPartialScanTargets([r]),await this.validationFlowHandler.startPartialLabelScan([{fieldName:r.fieldName,instanceIndex:r.instanceIndex??void 0}]))}async onTextInputClearIconClick(e){let t=e.detail.target.closest(J.tag),n=t==null?void 0:t.name;n&&(this.stateManager.deleteScanResult(n),this.applyInputState(n,`initial`,``),await this.validationFlowHandler.pauseScan(),await this.callUpdateFieldValue(n,``))}async onTextInputFocus(e){let t=e.detail.target;if(!t)return;let n=t.name,r=this.stateManager.getFieldInstance(n);if(r==null)return;let i=r.fieldName;this.settings.getPlaceholderTextForLabelDefinition(i).then(e=>{this._view.setInputPlaceholder(n,e??``)}),this.stateManager.getCurrentInputName()!==n&&(this.stateManager.setCurrentInputName(n),this._view.setInputBackgroundColor(n,``),this.stateManager.cancelCloudBackupForField(n),this.validationFlowHandler.cancelCloudBackupTaskForField(i),this.validationFlowHandler.pauseScan(),this.applyInputState(n,`initial`,this._view.getInputValue(n)),this.updateSubmitButtonState(),this.updateAllScanIconsVisibility(),await this._view.moveInputToTop(n),this._view.hideAllButtons())}async onTextInputBlur(e){let t=e.detail.target.name;e.preventDefault(),e.stopPropagation(),await this.runBlurValidation(t)}async runBlurValidation(e){if(!e)return!1;let n=this._view.getInputValue(e).trim()!==``,r=!1,i=!1;try{if(n)r=await this.updateFieldValueAndState(e),r?await this.restoreLayout(e):(await this.refocusInputForCorrection(e),i=!0);else return this.stateManager.clearCurrentInputName(),await this.updateCloudBackupTaskState(e,`uncancel`),await this.restoreLayout(e),r}catch(n){t.Logger.warn(`Validation flow: Failed to validate field`,{fieldName:e,error:n}),await this.restoreLayout(e)}finally{i||this.stateManager.clearCurrentInputName()}return r}async onTextInputKeydown(e){let{target:t,key:n,originalEvent:r}=e.detail;if(n===`Enter`||n===`Escape`){if(r.preventDefault(),r.stopPropagation(),t.value.trim()===``){t.blur();return}await this.runBlurValidation(t.name)&&t.blur();return}}async onKeyboardVisibilityChanged(e){let t=this.stateManager.getCurrentInputName();t&&(e.detail.isKeyboardVisible?this._view.scrollInputIntoView(t,e):!e.detail.isKeyboardVisible&&this._view.isInputActiveElement(t)&&this._view.blurActiveElement())}async onClearAllButtonClicked(e){this.stateManager.clearScanResults(),this.syncInputWithState(),await this.validationFlowHandler.clearAllFields(),await this.cancelAllCloudBackupTasks(),await this.validationFlowHandler.pauseScan(),await this.goToCompleteScan()}async onSubmitButtonClicked(){let e=await this.validationFlowHandler.onFinishFlowRequested();if(e.type===`result`){var t;let n=e.result.map(e=>V.fromJSONObject(e));(t=this.externalListener)==null||t.onValidationFlowLabelCaptured(n.map(e=>e.getLabelField()))}}async onPauseButtonClicked(e){await this.validationFlowHandler.pauseScan(),this.stateManager.markPausedFromScanningState(),this._view.showValidationButtons()}async onClickedOutsideList(e){if(!this.stateManager.isScanning&&!(this.view.isFocusedElementAnTextInput()||this.stateManager.hasCurrentInputName)&&this.stateManager.isPaused){await this.resumePreviousScanMode();return}}onValidationFlowLayoutChange(e){if(!this.dataCaptureView)return;let{left:n,top:r,right:i,bottom:a}=this._latestViewScanAreaMargins;if(this._isAdjustingScanArea=!0,e.detail.isPanelOnRightSide){let o=e.detail.formWidth+e.detail.safeAreaInsetRight,s=i.value>=o?i:new t.NumberWithUnit(o,t.MeasureUnit.Pixel),c=e.detail.buttonsHeight+e.detail.safeAreaInsetBottom,l=a.value>=c?a:new t.NumberWithUnit(c,t.MeasureUnit.Pixel);this.dataCaptureView.scanAreaMargins=new t.MarginsWithUnit(n,r,s,l)}else{let o=e.detail.formHeight+e.detail.safeAreaInsetBottom,s=a.value>=o?a:new t.NumberWithUnit(o,t.MeasureUnit.Pixel);this.dataCaptureView.scanAreaMargins=new t.MarginsWithUnit(n,r,i,s)}}willChangeScanAreaMargins(e,t,n){this._isAdjustingScanArea||(this._latestViewScanAreaMargins=n)}didChangeScanAreaMargins(e,t){this._isAdjustingScanArea=!1}async cancelAllCloudBackupTasks(){let e=[],t=await this.validationFlowHandler.validationFlowFields();for(let n of t)e.push(this.updateCloudBackupTaskState(W(n.getLabelField()),`cancel`));await Promise.all(e)}async onPauseStateChanged(){this._view.showValidationButtons(),await Promise.all([this.syncInputWithState(),this._view.showBackdrop(),this.standByCamera()])}async onScanStateChanged(){this._view.showScanningButtons(),await Promise.all([this.syncInputWithState(),this._view.hideBackdrop(),this.activateCamera()])}async mount(e){this.dataCaptureView=e,e.setProperty(`forceScanAreaMarginsToPixels`,!0),this.validationFlowHandler.addListener(this),await this._view.mount(e),this._view.updateButtonText({finishButtonText:this.settings.finishButtonText,restartButtonText:this.settings.restartButtonText,pauseButtonText:this.settings.pauseButtonText}),this.registerEventListeners(),await new Promise(e=>(0,h.safeRequestAnimationFrame)(()=>e())),e.addListener(this),e.scanAreaMargins=e.scanAreaMargins}async unmount(e){this.stateManager.clearCurrentInputName(),this.stateManager.isCloudBackupProcessing&&this.stateManager.stopCloudBackup(),e.removeListener(this),e.setProperty(`forceScanAreaMarginsToPixels`,!1),e.scanAreaMargins=this._latestViewScanAreaMargins,this.unregisterEventListeners(),await this._view.unmount(e),this.dataCaptureView=null}registerEventListeners(){this._view.addEventListener(q.Scan,this.onTextInputScanIconClickHandler),this._view.addEventListener(q.Clear,this.onTextInputClearIconClickHandler),this._view.addEventListener(q.Focus,this.onTextInputFocusHandler),this._view.addEventListener(q.Blur,this.onTextInputBlurHandler),this._view.addEventListener(q.Keydown,this.onTextInputKeydownHandler),this._view.addEventListener(Z.ClearAllButtonClicked,this.onClearAllButtonClickedHandler),this._view.addSubmitButtonListener(this.onSubmitButtonClickedHandler),this._view.addEventListener(Z.PauseButtonClicked,this.onPauseButtonClickedHandler),this._view.addEventListener(Z.ClickedOutsideList,this.onClickedOutsideListHandler),this._view.addEventListener(Z.ValidationFlowLayoutChange,this.onValidationFlowLayoutChangeHandler),this.keyboardController.connect(),this.keyboardController.addEventListener(`keyboard-visibility-changed`,this.onKeyboardVisibilityChangedHandler)}unregisterEventListeners(){this.keyboardController.removeEventListener(`keyboard-visibility-changed`,this.onKeyboardVisibilityChangedHandler),this.keyboardController.disconnect(),this._view.removeEventListener(q.Scan,this.onTextInputScanIconClickHandler),this._view.removeEventListener(q.Clear,this.onTextInputClearIconClickHandler),this._view.removeEventListener(q.Focus,this.onTextInputFocusHandler),this._view.removeEventListener(q.Blur,this.onTextInputBlurHandler),this._view.removeEventListener(q.Keydown,this.onTextInputKeydownHandler),this._view.removeEventListener(Z.ClearAllButtonClicked,this.onClearAllButtonClickedHandler),this._view.removeSubmitButtonListener(this.onSubmitButtonClickedHandler),this._view.removeEventListener(Z.PauseButtonClicked,this.onPauseButtonClickedHandler),this._view.removeEventListener(Z.ClickedOutsideList,this.onClickedOutsideListHandler),this._view.removeEventListener(Z.ValidationFlowLayoutChange,this.onValidationFlowLayoutChangeHandler),this.validationFlowHandler.removeListener(this)}},nn=class e{static async withLabelCaptureForView(t,n){var i;let a=await L(`ValidationFlowOverlay.create`,t[r.nativeHandle]),o=await yt.create(),s=new e(a,o,t);return s.dataCaptureView=n,(i=t.context)==null||i.updateListeners.add(s.onContextUpdatedListenerHandler),await n.addOverlay(s),s}async applySettings(e){this.settings=e,await L(`ValidationFlowOverlay.applySettings`,this[r.nativeHandle],e[r.nativeHandle]),this.presenter&&this.presenter.updateSettings(e)}constructor(e,t,n){this.listener={onValidationFlowLabelCaptured:e=>{},onManualInput:(e,t,n)=>{},onValidationFlowResultUpdate:(e,t,n)=>{}},this.stateManager=new xt,this.presenter=null,this.onContextUpdatedListenerHandler=this.onContextUpdatedListener.bind(this),this.feedback_=new vt,this.originalLabelCaptureFeedback=null,this[r.nativeHandle]=e,this.labelCapture=n,this.settings=t}toJSONObject(){return{type:`ValidationFlowOverlay`,nativeHandle:this[r.nativeHandle]}}async onAddOverlay(){this.originalLabelCaptureFeedback=this.labelCapture.feedback,this.labelCapture.feedback.success=new t.Feedback(null,null);let e=await this.labelCapture.validationFlowHandler();this.stateManager=new xt,this.presenter=new tn(this.stateManager,this.settings,e,this.labelCapture,this.feedback_),this.presenter.setExternalListener({onManualInput:(e,t,n)=>this.listener.onManualInput(e,t,n),onValidationFlowLabelCaptured:e=>this.listener.onValidationFlowLabelCaptured(e),onValidationFlowResultUpdate:(e,t,n)=>{var r,i;return(r=(i=this.listener).onValidationFlowResultUpdate)==null?void 0:r.call(i,e,t,n)}}),await this.presenter.mount(this.dataCaptureView),await this.applySettings(this.settings)}async onRemoveOverlay(){var e,t,n;this.originalLabelCaptureFeedback&&=(this.labelCapture.feedback=this.originalLabelCaptureFeedback,null),(e=this.labelCapture)==null||(e=e.context)==null||e.updateListeners.delete(this.onContextUpdatedListenerHandler),(t=this.presenter)==null||t.setExternalListener({onManualInput:()=>{},onValidationFlowLabelCaptured:()=>{},onValidationFlowResultUpdate:()=>{}});let r=(n=this.presenter)==null?void 0:n.unmount(this.dataCaptureView);this.presenter=null,await(await this.labelCapture.validationFlowHandler()).reset(),await this.labelCapture.unsetValidationFlowHandler(),await r}async onContextUpdatedListener(e){if(e.type===`removeOverlay`&&e.newValue===this&&await this.onRemoveOverlay(),e.type===`addOverlay`&&e.newValue===this){var n;await this.onAddOverlay(),await((n=this.presenter)==null?void 0:n.goToCompleteScan())}e.type===`modeEnabled`&&e.newValue&&this.presenter&&(this.stateManager.isFinished||this.stateManager.isIdle?(t.Logger.debug(`Validation flow overlay: mode enabled and validation flow is finished or idle, going to complete scan`),await this.presenter.goToCompleteScan()):this.stateManager.isPaused&&(t.Logger.debug(`Validation flow overlay: mode enabled and validation flow is paused, resuming scan`),await this.presenter.resumeScan()))}},rn=class e{constructor(e,n){this.listener=null,this.labelCapture=null,this.receiptScanningHandler=null,this.dataCaptureView=null,this.overlayElement=null,this.onContextUpdatedListenerHandler=this.onContextUpdatedListener.bind(this),this.resultType=`receipt`,this.handlerListener={onProcessingStarted:this.onProcessingStarted.bind(this),onReceiptScanned:this.onScanned.bind(this),onReceiptScanningFailed:this.onScanningFailed.bind(this),onShippingLabelScanned:this.onScanned.bind(this),onShippingLabelScanningFailed:this.onScanningFailed.bind(this)},this.failedNotificationConfiguration=new t.NotificationConfiguration(`A failure occurred`,`AdaptiveRecognitionOverlayError`),this._isProcessing=!1,this[r.nativeHandle]=e,this.labelCapture=n}toJSONObject(){return{type:`AdaptiveRecognitionOverlay`,nativeHandle:this[r.nativeHandle]}}static async withLabelCaptureForView(t,n){var i,a;let o=await L(`AdaptiveRecognitionOverlay.create`,t[r.nativeHandle]),s=new e(o,t);return s.receiptScanningHandler=await t.receiptScanningHandler(),(i=s.receiptScanningHandler)==null||i.addListener(s.handlerListener),(a=t.context)==null||a.updateListeners.add(s.onContextUpdatedListenerHandler),n&&await n.addOverlay(s),s}async onProcessingStarted(){var e,n;this._isProcessing||((e=this.dataCaptureView)==null||(e=e.getNotificationPresenter())==null||e.hideNotification(this.failedNotificationConfiguration),this.showProcessingAnimation(),this._isProcessing=!0,await((n=this.labelCapture)==null||(n=n.context)==null||(n=n.frameSource)==null?void 0:n.switchToDesiredState(t.FrameSourceState.Standby)))}async onScanned(e){var t,n;this.hideProcessingAnimation(),(t=this.listener)==null||(n=t.onRecognized)==null||n.call(t,e),this._isProcessing=!1}async onScanningFailed(){var e,n,r,i,a,o;this.hideProcessingAnimation(),(e=this.listener)==null||(n=e.onFailure)==null||n.call(e),this._isProcessing=!1,await((r=this.dataCaptureView)==null||(r=r.getNotificationPresenter())==null?void 0:r.showNotification(this.failedNotificationConfiguration)),await((i=this.labelCapture)==null?void 0:i.setEnabled(!0)),await((a=this.labelCapture)==null||(a=a.context)==null||(a=a.frameSource)==null||(o=a.switchToDesiredState)==null?void 0:o.call(a,t.FrameSourceState.On))}async applySettings(e){if(this.resultType=e.resultType,await L(`AdaptiveRecognitionOverlay.applySettings`,this[r.nativeHandle],e[r.nativeHandle]),this.dataCaptureView){var t,n;await((t=this.receiptScanningHandler)==null?void 0:t.finishFlow()),await((n=this.receiptScanningHandler)==null?void 0:n.startFlow(this.resultType))}}async mount(e){this.dataCaptureView=e,this.setupUI()}async unmount(){var e,t,n,r;(e=this.receiptScanningHandler)==null||e.removeListener(this.handlerListener),await((t=this.receiptScanningHandler)==null?void 0:t.finishFlow()),(n=this.labelCapture)==null||(n=n.context)==null||n.updateListeners.delete(this.onContextUpdatedListenerHandler),(r=this.overlayElement)==null||r.remove(),this.overlayElement=null,this.dataCaptureView=null,this.labelCapture=null,this.receiptScanningHandler=null,this._isProcessing=!1}async onContextUpdatedListener(e){if(e.type===`removeOverlay`&&e.newValue===this&&await this.unmount(),e.type===`addOverlay`&&e.newValue===this){var n,r;this.mount(e.view),await((n=this.receiptScanningHandler)==null?void 0:n.startFlow(this.resultType)),await((r=this.labelCapture)==null||(r=r.context)==null||(r=r.frameSource)==null?void 0:r.switchToDesiredState(t.FrameSourceState.On))}}setupUI(){if(!this.dataCaptureView)return;G.register();let e=G.create();e.show=!1,this.overlayElement=e;let t=this.dataCaptureView.htmlElement;t&&t.prepend(this.overlayElement)}showProcessingAnimation(){this.overlayElement&&!this.overlayElement.show&&!this._isProcessing&&(this.overlayElement.show=!0)}hideProcessingAnimation(){var e;(e=this.overlayElement)!=null&&e.show&&this._isProcessing&&(this.overlayElement.show=!1)}};e.AdaptiveRecognitionMode=y,e.AdaptiveRecognitionResult=Ee,e.AdaptiveRecognitionResultType=we,e.CapturedLabel=N,e.Carrier=ke,e.CustomBarcode=P,e.CustomBarcodeBuilder=te,e.CustomText=re,e.CustomTextBuilder=ie,e.DateText=oe,e.DateTextBuilder=le,e.ExpiryDateText=de,e.ExpiryDateTextBuilder=fe,e.ImeiOneBarcode=me,e.ImeiOneBarcodeBuilder=he,e.ImeiTwoBarcode=_e,e.ImeiTwoBarcodeBuilder=ve,e.LabelCapture=Ne,e.LabelCaptureAdaptiveRecognitionOverlay=rn,e.LabelCaptureAdaptiveRecognitionSettings=Te,e.LabelCaptureAdvancedOverlay=ut,e.LabelCaptureBasicOverlay=Ie,e.LabelCaptureFeedback=be,e.LabelCaptureSession=xe,e.LabelCaptureSettings=Be,e.LabelCaptureSettingsBuilder=Ve,e.LabelCaptureValidationFlowOverlay=nn,e.LabelCaptureValidationFlowSettings=yt,e.LabelDateComponentFormat=se,e.LabelDateFormat=ce,e.LabelDateResult=C,e.LabelDefinition=Re,e.LabelDefinitionBuilder=H,e.LabelField=M,e.LabelFieldDefinitionBuilder=R,e.LabelFieldLocation=We,e.LabelFieldState=b,e.LabelFieldType=x,e.LabelResultUpdateType=Ge,e.PackingDateText=Ke,e.PackingDateTextBuilder=qe,e.PartNumberBarcode=Ye,e.PartNumberBarcodeBuilder=Xe,e.ReceiptScanningLineItem=De,e.ReceiptScanningResult=Oe,e.SerialNumberBarcode=Qe,e.SerialNumberBarcodeBuilder=$e,e.ShippingLabelScanningResult=Ae,e.TextFieldBuilder=B,e.TotalPriceText=tt,e.TotalPriceTextBuilder=nt,e.UnitPriceText=it,e.UnitPriceTextBuilder=at,e.WeightText=st,e.WeightTextBuilder=ct,e.customBarcode=ne,e.customText=ae,e.dateText=ue,e.expiryDateText=pe,e.imeiOneBarcode=ge,e.imeiTwoBarcode=ye,e.label=ze,e.labelCaptureLoader=_t,e.labelCaptureSettings=He,e.packingDateText=Je,e.partNumberBarcode=Ze,e.serialNumberBarcode=et,e.totalPriceText=rt,e.unitPriceText=ot,e.weightText=lt});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{mapWebAdaptiveRecognitionModeToNativeAdaptiveRecognitionMode as e}from"./private/adaptiveRecognitionModeTranslator.js";import{nativeBrushToWebBrush as t,webBrushToNativeBrush as n,webColorToNativeColor as r}from"./private/brushTranslator.js";import{mapNumberWithUnitToFloatWithUnit as i}from"./private/measureTranslator.js";import{webNumberWithUnitToNativeFloatWithUnit as a}from"./private/numberTranslator.js";import{nativeImplementationRegistry as o}from"./worker/NativeImplementationRegistry.js";import{DataCaptureEngine as s}from"./worker/dataCaptureEngine.js";import{dispatchNativeCall as c,isNativeCallCommand as l}from"./worker/nativeDispatch.js";import{AdaptiveRecognitionHandler as u}from"./worker/handlers/AdaptiveRecognitionHandler.js";import{ValidationFlowHandler as d}from"./worker/handlers/ValidationFlowHandler.js";import{Color as f}from"@scandit/web-datacapture-core";import{unknownErrorToString as p}from"@scandit/web-datacapture-core/build/js/private/utils/unknownErrorToString.js";import{WorkerMain as m}from"@scandit/web-datacapture-core/build/js/worker/index.js";var h=new class extends E{async getName(e){return this.impl(e).getName()}async isOptional(e){return this.impl(e).isOptional()}async setOptional(e,t){throw Error(`This method must be implemented manually.`)}async getValueRegexes(e){return this.impl(e).getPatterns()}async setValueRegexes(e,t){throw Error(`This method must be implemented manually.`)}async getHiddenProperties(e){throw Error(`This method must be implemented manually.`)}async setHiddenProperties(e,t){throw Error(`This method must be implemented manually.`)}async getLocation(e){throw Error(`This method must be implemented manually.`)}async setLocation(e,t){throw Error(`This method must be implemented manually.`)}async getAnchorRegexes(e){throw Error(`This method must be implemented manually.`)}async setAnchorRegexes(e,t){throw Error(`This method must be implemented manually.`)}async getNumberOfMandatoryInstances(e){return this.impl(e).getNumberOfMandatoryInstances()}async setNumberOfMandatoryInstances(e,t){throw Error(`This method must be implemented manually.`)}},g=new class extends E{async create(e,t){let n=this.Module.LabelDefinition.create(e,t.map(e=>h.impl(e)));return o.register(`LabelDefinition`,n)}async getName(e){return this.impl(e).getName()}async getFieldDefinitions(e){return this.impl(e).getFieldDefinitions()}async createVinLabelDefinition(e){let t=this.Module.LabelDefinition.createVinLabelDefinition(e);return o.register(`LabelDefinition`,t)}async createPriceCaptureDefinition(e){let t=this.Module.LabelDefinition.createPriceCaptureDefinition(e);return o.register(`LabelDefinition`,t)}async getHiddenProperties(e){return this.impl(e).getHiddenProperties()}async setHiddenProperties(e,t){this.impl(e).setHiddenProperties(t)}async setAdaptiveRecognitionMode(t,n){let r=this.impl(t),i=e(n);r.setAdaptiveRecognitionMode(i)}},_=class{canHandle(e){return e.startsWith(`labelCaptureBuild`)}async handle(e){let{data:t}=e;switch(t.command){case`labelCaptureBuildVinLabelDefinition`:{let e=await g.createVinLabelDefinition(t.payload.name);t.payload.adaptiveRecognitionMode!==void 0&&await g.setAdaptiveRecognitionMode(e,t.payload.adaptiveRecognitionMode);let n=g.impl(e),r=n.getHiddenProperties(),i=n.getFieldDefinitions().map(e=>({name:e.getName(),patterns:e.getPatterns(),isOptional:e.isOptional(),numberOfMandatoryInstances:e.getNumberOfMandatoryInstances()??null}));return{payload:{handle:e,name:n.getName(),hiddenProperties:r,fields:i}}}case`labelCaptureBuildPriceCaptureDefinition`:{let e=await g.createPriceCaptureDefinition(t.payload.name);t.payload.adaptiveRecognitionMode!==void 0&&await g.setAdaptiveRecognitionMode(e,t.payload.adaptiveRecognitionMode);let n=g.impl(e),r=n.getHiddenProperties(),i=n.getFieldDefinitions().map(e=>({name:e.getName(),patterns:e.getPatterns(),isOptional:e.isOptional(),numberOfMandatoryInstances:e.getNumberOfMandatoryInstances()??null}));return{payload:{handle:e,name:n.getName(),hiddenProperties:r,fields:i}}}}}},v=class extends E{async create(e){let t=o.get(e),n=this.Module.LabelCaptureBasicOverlay.create(t);return o.register(`LabelCaptureBasicOverlay`,n)}async setDefaultFieldBrush(e,t,n){this.impl(e).setDefaultFieldBrush(t,n)}async getDefaultFieldBrush(e,t){return this.impl(e).getDefaultFieldBrush(t)}async setDefaultLabelBrush(e,t){this.impl(e).setDefaultLabelBrush(t)}async getDefaultLabelBrush(e){return this.impl(e).getDefaultLabelBrush()}async setBrushForField(e,t,n,r){this.impl(e).setBrushForField(t,n,r)}async setBrushForLabel(e,t,n){this.impl(e).setBrushForLabel(t,n)}async setListener(e,t){this.impl(e).setListener(t)}async getListener(e){return this.impl(e).getListener()}async setShouldShowScanAreaGuides(e,t){this.impl(e).setShouldShowScanAreaGuides(t)}async getShouldShowScanAreaGuides(e){return this.impl(e).getShouldShowScanAreaGuides()}async getViewfinder(e){return this.impl(e).getViewfinder()}async setViewfinder(e,t){this.impl(e).setViewfinder(t)}async asDataCaptureOverlay(e){return this.impl(e).asDataCaptureOverlay()}},y=new v,b=class{constructor(e){this.workerMain=e,this.labelBrushMap=new Map,this.fieldBrushMap=new Map,this.pendingFieldBrushObjects=new Map,this.pendingLabelBrushObjects=new Map,this.overlayListenerAdded=!1,this.labelCaptureBasicOverlayListener={onLabelTapped:(e,t)=>{this.workerMain.postCallbackMessage({type:`labelCaptureBasicOverlayOnLabelTapped`,payload:{labelJSON:JSON.parse(t.toJson())}})},brushForField:(e,t,n)=>{let r=this.getFieldIdentifier(n,t);return this.pendingFieldBrushObjects.set(r,{field:t,label:n}),this.workerMain.postCallbackMessage({type:`labelCaptureBasicOverlayBrushForField`,payload:{fieldJSON:JSON.parse(t.toJson()),labelJSON:JSON.parse(n.toJson())}}),this.getBrushForField(n,t)},brushForLabel:(e,t)=>{let n=this.getLabelIdentifier(t);return this.pendingLabelBrushObjects.set(n,{label:t}),this.workerMain.postCallbackMessage({type:`labelCaptureBasicOverlayBrushForLabel`,payload:{labelJSON:JSON.parse(t.toJson())}}),this.getBrushForLabel(t)}}}canHandle(e){return e.startsWith(`labelCaptureBasicOverlay`)}async handle(e){let{data:r}=e;switch(r.command){case`labelCaptureBasicOverlayForLabelCapture`:return{payload:await y.create(r.payload.labelCaptureHandle)};case`labelCaptureBasicOverlaySetDefaultFieldBrush`:y.setDefaultFieldBrush(r.payload.labelCaptureBasicOverlayHandle,r.payload.labelFieldState,r.payload.brush?n(r.payload.brush):void 0);break;case`labelCaptureBasicOverlayGetDefaultFieldBrush`:{let e=await y.getDefaultFieldBrush(r.payload.labelCaptureBasicOverlayHandle,r.payload.labelFieldState);return{payload:e?t(e):void 0}}case`labelCaptureBasicOverlaySetDefaultLabelBrush`:y.setDefaultLabelBrush(r.payload.labelCaptureBasicOverlayHandle,r.payload.brush?n(r.payload.brush):void 0);break;case`labelCaptureBasicOverlayGetDefaultLabelBrush`:{let e=await y.getDefaultLabelBrush(r.payload.labelCaptureBasicOverlayHandle);return{payload:e?t(e):void 0}}case`labelCaptureBasicOverlaySetBrushForField`:{let{brush:e,fieldJSON:t,labelCaptureBasicOverlayHandle:i,labelJSON:a}=r.payload;if(this.overlayListenerAdded){let r=this.getFieldIdentifierFromJSON(a,t),i=e?n(e):void 0;i?this.fieldBrushMap.set(r,i):this.fieldBrushMap.delete(r);let o=this.pendingFieldBrushObjects.get(r);o&&this.overlayHandle&&(this.pendingFieldBrushObjects.delete(r),await y.setBrushForField(this.overlayHandle,i,o.field,o.label));break}await y.setBrushForField(i,e?n(e):void 0,t,a);break}case`labelCaptureBasicOverlaySetBrushForLabel`:{let{brush:e,labelCaptureBasicOverlayHandle:t,labelJSON:i}=r.payload;if(this.overlayListenerAdded){let t=this.getLabelIdentifierFromJSON(i),r=e?n(e):void 0;r?this.labelBrushMap.set(t,r):this.labelBrushMap.delete(t);let a=this.pendingLabelBrushObjects.get(t);a&&this.overlayHandle&&(this.pendingLabelBrushObjects.delete(t),await y.setBrushForLabel(this.overlayHandle,r,a.label));break}await y.setBrushForLabel(t,e?n(e):void 0,i);break}case`labelCaptureBasicOverlaySetListener`:this.overlayHandle=r.payload.labelCaptureBasicOverlayHandle,await y.setListener(r.payload.labelCaptureBasicOverlayHandle,this.labelCaptureBasicOverlayListener),this.overlayListenerAdded=!0;break;case`labelCaptureBasicOverlaySetShouldShowScanAreaGuides`:await y.setShouldShowScanAreaGuides(r.payload.labelCaptureBasicOverlayHandle,r.payload.show);break;case`labelCaptureBasicOverlayGetShouldShowScanAreaGuides`:return{payload:await y.getShouldShowScanAreaGuides(r.payload.labelCaptureBasicOverlayHandle)};case`labelCaptureBasicOverlayGetViewfinder`:return{payload:await y.getViewfinder(r.payload.labelCaptureBasicOverlayHandle)};case`labelCaptureBasicOverlayUpdateViewfinder`:{let e=await j(r.payload.viewfinderJSON);await y.setViewfinder(r.payload.labelCaptureBasicOverlayHandle,e);break}}}getBrushForField(e,t){let n=this.getFieldIdentifier(e,t);return this.fieldBrushMap.get(n)}getBrushForLabel(e){let t=this.getLabelIdentifier(e);return this.labelBrushMap.get(t)}getFieldIdentifier(e,t){return`${e.getTrackingId()}-${t.getName()}-${t.getText()??``}`}getFieldIdentifierFromJSON(e,t){return`${e.trackingId}-${t.name}-${t.text??``}`}getLabelIdentifier(e){return e.getTrackingId()}getLabelIdentifierFromJSON(e){return e.trackingId}};const x=e=>e.result!=null&&e.error==null;var S=new class extends E{async loadFromString(e){let t=this.Module.LabelCaptureSettings.loadFromString(e);if(!x(t))throw Error(t.error);let n=t.result;return o.register(`LabelCaptureSettings`,n)}async createFromLabelDefinitions(e){let t=this.Module.LabelCaptureSettings.createFromLabelDefinitions(e.map(e=>g.impl(e)));if(!x(t))throw Error(t.error);let n=t.result;return o.register(`LabelCaptureSettings`,n)}async create(e,t,n){let r=this.Module.LabelCaptureSettings.create(e.map(e=>g.impl(e)),t,n);if(!x(r))throw Error(r.error);let i=r.result;return o.register(`LabelCaptureSettings`,i)}async setLocationSelection(e,t){this.impl(e).setLocationSelection(t)}async getLocationSelection(e){throw Error(`This method must be implemented manually.`)}async getLicenseKey(e){return this.impl(e).getLicenseKey()}async setLicenseKey(e,t){this.impl(e).setLicenseKey(t)}async getLicensee(e){return this.impl(e).getLicensee()}async setLicensee(e,t){this.impl(e).setLicensee(t)}async getIntProperty(e,t){return this.impl(e).getIntProperty(t)}async setIntProperty(e,t,n){this.impl(e).setIntProperty(t,n)}async getBlueprintJson(e){return this.impl(e).getBlueprintJson()}},C=class{constructor(e){this.workerMain=e}canHandle(e){return e.startsWith(`labelCaptureSettings`)}async handle(e){let{data:t}=e;switch(t.command){case`labelCaptureSettingsGetLocationSelection`:{let e=await S.impl(t.payload.settingsHandle).getLocationSelection();return{payload:e?JSON.parse(e.toJson()):void 0}}case`labelCaptureSettingsSetLocationSelection`:if(t.payload.locationSelection.type===`rectangular`){let e=t.payload.locationSelection,n=this.workerMain.Module.RectangularLocationSelection.create();if(e.size.width&&e.size.aspect){let t=i(e.size.width);n.setWidthAndAspectRatio(t,e.size.aspect)}if(e.size.height&&e.size.aspect){let t=i(e.size.height);n.setHeightAndAspectRatio(t,e.size.aspect)}if(e.size.width&&e.size.height){let t=i(e.size.width),r=i(e.size.height);n.setWidthAndHeight(t,r)}S.impl(t.payload.settingsHandle).setLocationSelection(n)}break}}},w=class extends m{constructor(e,t){super(e,t),this.dataCaptureInstance=new s(t,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),this.fieldBuilderHandler=new _,this.settingsHandler=new C(this),this.labelCaptureBasicOverlayHandler=new b(this),this.validationFlowHandler=new d(this),this.adaptiveRecognitionHandler=new u(this)}get Module(){return this.dataCaptureInstance.Module}async respondWith(e,t,n){let r=null,i;try{i=n(),i instanceof Promise&&(i=await i)}catch(e){i=void 0,r=p(e)}let a={type:`workerTaskId`,command:e,id:t,payload:this.hasPayload(i)?i.payload:void 0};r!=null&&(a.error=r),this.postMessage(a,this.hasTransferables(i)?i.transferables:[])}postCallbackMessage(e,t){this.postMessage(e,t)}onMessage(e){let t=e.data.command;if(t==null)return super.onMessage(e);if(l(t)){let n=e;return this.respondWith(t,n.data.id,async()=>({payload:await c(n.data,{module:this.Module})})),!0}return t===`initializeNativeHandles`?(this.respondWith(t,e.data.id,()=>({payload:{contextHandle:o.register(`DataCaptureContext`,this.dataCaptureInstance.context),listenerHandle:o.register(`LabelCaptureListener`,this)}})),!0):this.fieldBuilderHandler.canHandle(t)?(this.respondWith(t,e.data.id,()=>this.fieldBuilderHandler.handle(e)),!0):this.settingsHandler.canHandle(t)?(this.respondWith(t,e.data.id,()=>this.settingsHandler.handle(e)),!0):this.labelCaptureBasicOverlayHandler.canHandle(t)?(this.respondWith(t,e.data.id,()=>this.labelCaptureBasicOverlayHandler.handle(e)),!0):this.validationFlowHandler.canHandle(t)?(this.respondWith(t,e.data.id,()=>this.validationFlowHandler.handle(e)),!0):this.adaptiveRecognitionHandler.canHandle(t)?(this.respondWith(t,e.data.id,()=>this.adaptiveRecognitionHandler.handle(e)),!0):t===`addNativeOverlay`?(this.respondWith(t,e.data.id,async()=>{this.dataCaptureInstance.addNativeOverlay(e)}),!0):t===`removeNativeOverlay`?(this.respondWith(t,e.data.id,async()=>{this.dataCaptureInstance.removeNativeOverlay(e)}),!0):super.onMessage(e)}onObservationStarted(){this.dataCaptureInstance.reportInsufficientMultithreadingIfNeeded(`LabelCapture`),this.postCallbackMessage({type:`labelCaptureOnObservationStarted`})}onObservationStopped(){this.postCallbackMessage({type:`labelCaptureOnObservationStopped`})}onSessionUpdated(e,t,n){this.postCallbackMessage({type:`labelCaptureOnSessionUpdated`,payload:{session:JSON.parse(t.toJson()),data:this.dataCaptureInstance.prepareFrameForListener(n)}}),n.delete()}};const T=new w(globalThis,{get:()=>globalThis.Module,set:e=>{globalThis.Module=e}});var E=class{get Module(){return T.Module}impl(e){return o.get(e)}},D=new class extends E{create(){let e=this.Module.AimerViewfinder.create();return o.register(`AimerViewfinder`,e)}async setFrameColor(e,t){this.impl(e).setFrameColor(t)}async getFrameColor(e){return this.impl(e).getFrameColor()}async setDotColor(e,t){this.impl(e).setDotColor(t)}async getDotColor(e){return this.impl(e).getDotColor()}async getDotColorDefault(){return this.Module.AimerViewfinder.getDotColorDefault()}async getFrameColorDefault(){return this.Module.AimerViewfinder.getFrameColorDefault()}},O=new class extends E{create(){let e=this.Module.NoViewfinder.create();return o.register(`NoViewfinder`,e)}},k=new class extends E{create(e){let t=this.Module.RectangularViewfinderAnimation.create(e);return o.register(`RectangularViewfinderAnimation`,t)}async isLooping(e){return this.impl(e).isLooping()}async toJson(e){return this.impl(e).toJson()}getNativeImplementation(e){return this.impl(e)}},A=new class extends E{create(){let e=this.Module.RectangularViewfinder.create();return o.register(`RectangularViewfinder`,e)}createForStyles(e,t){let n=this.Module.RectangularViewfinder.createForStyles(e,t);return o.register(`RectangularViewfinder`,n)}async setWidthAndHeight(e,t,n){this.impl(e).setWidthAndHeight(t,n)}async setWidthAndAspectRatio(e,t,n){this.impl(e).setWidthAndAspectRatio(t,n)}async setHeightAndAspectRatio(e,t,n){this.impl(e).setHeightAndAspectRatio(t,n)}async setShorterDimensionAndAspectRatio(e,t,n){this.impl(e).setShorterDimensionAndAspectRatio(t,n)}async getSizeWithUnitAndAspect(e){return this.impl(e).getSizeWithUnitAndAspect()}async setColor(e,t){this.impl(e).setColor(t)}async getColor(e){return this.impl(e).getColor()}async setDisabledColor(e,t){this.impl(e).setDisabledColor(t)}async getDisabledColor(e){return this.impl(e).getDisabledColor()}async getStyle(e){return this.impl(e).getStyle()}async setAnimation(e,t){this.impl(e).setAnimation(t)}async getAnimation(e){return this.impl(e).getAnimation()}async setDimming(e,t){this.impl(e).setDimming(t)}async getDimming(e){return this.impl(e).getDimming()}async setDisabledDimming(e,t){this.impl(e).setDisabledDimming(t)}async getDisabledDimming(e){return this.impl(e).getDisabledDimming()}async getLineStyle(e){return this.impl(e).getLineStyle()}};async function j(e){if(e.type===`rectangular`){var t;let n=A.createForStyles(+(e.style===`rounded`),+(e.lineStyle===`light`)),i=[];e.size.width&&e.size.height?i.push(A.setWidthAndHeight(n,a(e.size.width),a(e.size.height))):e.size.width&&e.size.aspect?i.push(A.setWidthAndAspectRatio(n,a(e.size.width),e.size.aspect)):e.size.height&&e.size.aspect&&i.push(A.setHeightAndAspectRatio(n,a(e.size.height),e.size.aspect)),i.push(A.setColor(n,r(f.fromJSON(e.color)))),i.push(A.setDisabledColor(n,r(f.fromJSON(e.disabledColor)))),i.push(A.setDimming(n,e.dimming));let o=k.create(((t=e.animation)==null?void 0:t.looping)??!1);return i.push(A.setAnimation(n,k.getNativeImplementation(o))),await Promise.all(i),A.impl(n)}if(e.type===`aimer`){let t=D.create(),n=[];return n.push(D.setFrameColor(t,r(f.fromJSON(e.frameColor)))),n.push(D.setDotColor(t,r(f.fromJSON(e.dotColor)))),await Promise.all(n),D.impl(t)}return O.impl(O.create())}export{D as a,C as c,v as d,y as f,h,O as i,S as l,g as m,A as n,E as o,_ as p,k as r,w as s,j as t,b as u};
|
package/build/js/vite-env.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {}
|