scanbot-web-sdk 6.0.0-dev.5 → 6.0.0-dev.6

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.
Files changed (24) hide show
  1. package/bundle/ScanbotSDK.min.js +1 -1
  2. package/bundle/ScanbotSDK.ui2.min.js +1 -1
  3. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  4. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  5. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  6. package/bundle/bin/barcode-scanner/ScanbotSDK.Asm.wasm +0 -0
  7. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  8. package/bundle/bin/barcode-scanner/ScanbotSDK.Core-simd.js +1 -1
  9. package/bundle/bin/barcode-scanner/ScanbotSDK.Core.js +1 -1
  10. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.js +1 -1
  11. package/bundle/bin/complete/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  12. package/bundle/bin/complete/ScanbotSDK.Asm-simd.wasm +0 -0
  13. package/bundle/bin/complete/ScanbotSDK.Asm.wasm +0 -0
  14. package/bundle/bin/complete/ScanbotSDK.Core-simd-threads.js +1 -1
  15. package/bundle/bin/complete/ScanbotSDK.Core-simd.js +1 -1
  16. package/bundle/bin/complete/ScanbotSDK.Core.js +1 -1
  17. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.js +1 -1
  18. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd-threads.wasm +0 -0
  19. package/bundle/bin/document-scanner/ScanbotSDK.Asm-simd.wasm +0 -0
  20. package/bundle/bin/document-scanner/ScanbotSDK.Asm.wasm +0 -0
  21. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd-threads.js +1 -1
  22. package/bundle/bin/document-scanner/ScanbotSDK.Core-simd.js +1 -1
  23. package/bundle/bin/document-scanner/ScanbotSDK.Core.js +1 -1
  24. package/package.json +1 -1
@@ -28,7 +28,7 @@
28
28
  stroke-dashoffset: -120;
29
29
  }
30
30
  }
31
- `;var a=t=>o.default.createElement(r,{viewBox:"0 0 50 50"},o.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:t.color||"black"})),s=n(25),l=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class c{}class u{constructor(){this.videoReady=!1,this.sdkReady=!1}}class d extends o.default.Component{constructor(t){super(t),this.onVideoReady=()=>{this.setState({videoReady:!0},(()=>{const{onSuccess:t}=this.props;t&&t(this)}))},this.onVideoError=t=>{if(!0===this.state.videoReady){const{onError:e}=this.props.configuration;e?e(t):console.error(t)}else{const{onFailure:e}=this.props;e&&e(t),this.dispose()}},this.state=new u,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0})}))}get bridge(){return i.a.instance.bridge}dispose(){const{container:t}=this.props;t&&Object(o.render)(null,t)}componentDidMount(){this.disposed=!1}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}swapCameraFacing(t){this.camera.swapCameraFacing(t)}switchCamera(t,e){return l(this,void 0,void 0,(function*(){this.camera.switchCamera(t,e)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return s.a.INSTANCE.load()}renderSpinner(t){return this.state.videoReady&&this.state.sdkReady?null:o.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},o.default.createElement(a,{color:t}))}setTorchState(t){return this.camera.setTorchState(t)}}d.DEFAULT_DETECTION_RESOLUTION=600,d.DETECTION_RESULTION_4K=3840},function(t,e,n){"use strict";n.r(e),n.d(e,"SingleScanningMode",(function(){return c})),n.d(e,"Resolution",(function(){return u})),n.d(e,"CameraConfiguration",(function(){return d})),n.d(e,"TopBarConfiguration",(function(){return f.a})),n.d(e,"ActionBarConfiguration",(function(){return p})),n.d(e,"BarcodeUseCase",(function(){return h})),n.d(e,"Palette",(function(){return i.f})),n.d(e,"StyledText",(function(){return i.j})),n.d(e,"IconStyle",(function(){return i.e})),n.d(e,"PolygonStyle",(function(){return i.g})),n.d(e,"BackgroundStyle",(function(){return i.a})),n.d(e,"ForegroundStyle",(function(){return i.d})),n.d(e,"RoundButton",(function(){return i.h})),n.d(e,"BadgedButton",(function(){return i.b})),n.d(e,"ButtonConfiguration",(function(){return i.c})),n.d(e,"Sound",(function(){return i.i})),n.d(e,"Vibration",(function(){return i.l})),n.d(e,"Timeouts",(function(){return i.k})),n.d(e,"ViewFinderConfiguration",(function(){return E})),n.d(e,"FinderStyle",(function(){return w})),n.d(e,"FinderCorneredStyle",(function(){return L})),n.d(e,"FinderStrokedStyle",(function(){return _})),n.d(e,"UserGuidanceConfiguration",(function(){return O})),n.d(e,"BarcodeItemErrorState",(function(){return a})),n.d(e,"BarcodeMappedData",(function(){return s})),n.d(e,"BarcodeInfoMapping",(function(){return l})),n.d(e,"ExpectedBarcode",(function(){return C})),n.d(e,"FindAndPickScanningMode",(function(){return S})),n.d(e,"BarcodeTextLocalization",(function(){return T})),n.d(e,"BarcodeRecognizerConfiguration",(function(){return k})),n.d(e,"ArOverlayPolygonConfiguration",(function(){return o.c})),n.d(e,"BarcodeItemConfiguration",(function(){return o.e})),n.d(e,"BadgeStyle",(function(){return o.d})),n.d(e,"ArOverlayGeneralConfiguration",(function(){return o.b})),n.d(e,"FindAndPickArOverlayPolygonConfiguration",(function(){return o.f})),n.d(e,"FindAndPickBadgeConfiguration",(function(){return o.g})),n.d(e,"ArOverlayFindAndPickConfiguration",(function(){return o.a})),n.d(e,"BarcodeScannerConfiguration",(function(){return P})),n.d(e,"BarcodeScannerUIItem",(function(){return F})),n.d(e,"BarcodeScannerUIResult",(function(){return R})),n.d(e,"OcrResult",(function(){return I.OcrResult})),n.d(e,"FieldParsedData",(function(){return I.FieldParsedData})),n.d(e,"FieldType",(function(){return I.FieldType})),n.d(e,"Field",(function(){return I.Field})),n.d(e,"GenericDocumentType",(function(){return I.GenericDocumentType})),n.d(e,"GenericDocument",(function(){return I.GenericDocument})),n.d(e,"Sheet",(function(){return m})),n.d(e,"SwipeToDelete",(function(){return g})),n.d(e,"ManualCountEditDialog",(function(){return v})),n.d(e,"SheetContent",(function(){return A})),n.d(e,"MultipleScanningMode",(function(){return b})),n.d(e,"ScanbotAlertDialog",(function(){return y})),n.d(e,"CameraPermissionScreen",(function(){return D})),n.d(e,"BarcodeItem",(function(){return B.BarcodeItem}));var o=n(8),i=n(1),r=n(7);class a extends r.a{constructor(t={}){super(),this.title=new i.j({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new i.j({text:"There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",color:"?sbColorOnSurfaceVariant"}),this.retryButton=new i.c({}),this.cancelButton=new i.c({}),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.subtitle&&(this.subtitle=new i.j(t.subtitle)),void 0!==t.retryButton&&(this.retryButton=new i.c(t.retryButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton))}}class s extends r.a{constructor(t={}){if(super(),void 0===t.title)throw new Error("title must be present in constructor argument");if(this.title=t.title,void 0===t.subtitle)throw new Error("subtitle must be present in constructor argument");if(this.subtitle=t.subtitle,void 0===t.barcodeImage)throw new Error("barcodeImage must be present in constructor argument");this.barcodeImage=t.barcodeImage}}class l extends r.a{constructor(t={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new i.j({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new a({}),void 0!==t.barcodeItemMapper&&(this.barcodeItemMapper=null!=t.barcodeItemMapper?t.barcodeItemMapper:null),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.loadingMessage&&(this.loadingMessage=new i.j(t.loadingMessage)),void 0!==t.errorState&&(this.errorState=new a(t.errorState))}}class c extends r.a{constructor(t={}){super(),this._type="SingleScanningMode",this.confirmationSheetEnabled=!1,this.barcodeImageVisible=!0,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.barcodeTitle=new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new i.c({visible:!0,text:"?singleModeConfirmationCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new l({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new i.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new i.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new i.c({text:"?barcodeInfoMappingErrorStateCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new o.b({visible:!1,counterBadge:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new o.c({visible:!0,deselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new o.e({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.confirmationSheetEnabled&&(this.confirmationSheetEnabled=t.confirmationSheetEnabled),void 0!==t.barcodeImageVisible&&(this.barcodeImageVisible=t.barcodeImageVisible),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.barcodeTitle&&(this.barcodeTitle=new i.j(t.barcodeTitle)),void 0!==t.barcodeSubtitle&&(this.barcodeSubtitle=new i.j(t.barcodeSubtitle)),void 0!==t.submitButton&&(this.submitButton=new i.c(t.submitButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new l(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new o.b(t.arOverlay))}}class u extends r.a{constructor(t={}){if(super(),void 0===t.width)throw new Error("width must be present in constructor argument");if(this.width=t.width,void 0===t.height)throw new Error("height must be present in constructor argument");this.height=t.height}}class d extends r.a{constructor(t={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new u({width:1920,height:1080}),void 0!==t.cameraModule&&(this.cameraModule=t.cameraModule),void 0!==t.zoomSteps&&(this.zoomSteps=t.zoomSteps.map((t=>t))),void 0!==t.defaultZoomFactor&&(this.defaultZoomFactor=t.defaultZoomFactor),void 0!==t.flashEnabled&&(this.flashEnabled=t.flashEnabled),void 0!==t.idealPreviewResolution&&(this.idealPreviewResolution=new u(t.idealPreviewResolution))}}var h,f=n(30);class p extends r.a{constructor(t={}){super(),this.flashButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==t.flashButton&&(this.flashButton=new i.h(t.flashButton)),void 0!==t.zoomButton&&(this.zoomButton=new i.h(t.zoomButton)),void 0!==t.flipCameraButton&&(this.flipCameraButton=new i.h(t.flipCameraButton))}}class m extends r.a{constructor(t={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new i.b({}),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.collapsedVisibleHeight&&(this.collapsedVisibleHeight=t.collapsedVisibleHeight),void 0!==t.listButton&&(this.listButton=new i.b(t.listButton))}}class g extends r.a{constructor(t={}){super(),this.enabled=!0,this.backgroundColor="?sbColorNegative",this.iconColor="?sbColorOnPrimary",void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.iconColor&&(this.iconColor=t.iconColor)}}class v extends r.a{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new i.j({text:"Update count",color:"?sbColorOnSurface"}),this.info=new i.j({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new i.c({visible:!0,text:"Update",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new i.c({visible:!0,text:"Cancel",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.info&&(this.info=new i.j(t.info)),void 0!==t.updateButton&&(this.updateButton=new i.c(t.updateButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton)),void 0!==t.clearTextButton&&(this.clearTextButton=new i.e(t.clearTextButton))}}class A extends r.a{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new i.j({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new i.c({visible:!0,text:"Clear all",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new i.c({visible:!0,text:"Submit",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new i.c({visible:!0,text:"Start scanning",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new i.j({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new i.j({text:"The barcode list is currently empty. Close this sheet and scan your items to add them.",color:"?sbColorOnSurfaceVariant"}),this.placeholderIconBackground="?sbColorOutline",this.placeholderIcon=new i.e({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new g({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.manualCountChangeEnabled&&(this.manualCountChangeEnabled=t.manualCountChangeEnabled),void 0!==t.manualCountOutlineColor&&(this.manualCountOutlineColor=t.manualCountOutlineColor),void 0!==t.manualCountChangeColor&&(this.manualCountChangeColor=t.manualCountChangeColor),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.clearAllButton&&(this.clearAllButton=new i.c(t.clearAllButton)),void 0!==t.barcodeItemTitle&&(this.barcodeItemTitle=new i.j(t.barcodeItemTitle)),void 0!==t.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new i.j(t.barcodeItemSubtitle)),void 0!==t.barcodeItemImageVisible&&(this.barcodeItemImageVisible=t.barcodeItemImageVisible),void 0!==t.submitButton&&(this.submitButton=new i.c(t.submitButton)),void 0!==t.startScanningButton&&(this.startScanningButton=new i.c(t.startScanningButton)),void 0!==t.placeholderTitle&&(this.placeholderTitle=new i.j(t.placeholderTitle)),void 0!==t.placeholderSubtitle&&(this.placeholderSubtitle=new i.j(t.placeholderSubtitle)),void 0!==t.placeholderIconBackground&&(this.placeholderIconBackground=t.placeholderIconBackground),void 0!==t.placeholderIcon&&(this.placeholderIcon=new i.e(t.placeholderIcon)),void 0!==t.swipeToDelete&&(this.swipeToDelete=new g(t.swipeToDelete))}}class b extends r.a{constructor(t={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.mode="COUNTING",this.sheet=new m({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new i.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new A({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new i.j({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new i.c({visible:!0,text:"?sheetClearAllButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new i.c({visible:!0,text:"?sheetStartScanningButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new i.j({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new i.j({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new i.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new g({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new v({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new i.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new i.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new i.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new l({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new i.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new i.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new o.b({visible:!1,counterBadge:new o.d({visible:!0,background:new i.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new o.c({visible:!0,deselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new o.e({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.countingRepeatDelay&&(this.countingRepeatDelay=t.countingRepeatDelay),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.sheet&&(this.sheet=new m(t.sheet)),void 0!==t.sheetContent&&(this.sheetContent=new A(t.sheetContent)),void 0!==t.manualCountEditDialog&&(this.manualCountEditDialog=new v(t.manualCountEditDialog)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new l(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new o.b(t.arOverlay))}}class y extends r.a{constructor(t={}){if(super(),this.title=new i.j({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new i.j({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.subtitle&&(this.subtitle=new i.j(t.subtitle)),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0===t.okButton)throw new Error("okButton must be present in constructor argument");if(this.okButton=new i.c(t.okButton),void 0===t.cancelButton)throw new Error("cancelButton must be present in constructor argument");this.cancelButton=new i.c(t.cancelButton)}}class C extends r.a{constructor(t={}){if(super(),this.count=1,void 0===t.barcodeValue)throw new Error("barcodeValue must be present in constructor argument");this.barcodeValue=t.barcodeValue,void 0!==t.title&&(this.title=null!=t.title?t.title:null),void 0!==t.image&&(this.image=null!=t.image?t.image:null),void 0!==t.count&&(this.count=t.count)}}class S extends r.a{constructor(t={}){super(),this._type="FindAndPickScanningMode",this.scanningCompletedColor="?sbColorPositive",this.scanningPartiallyColor="?sbColorWarning",this.scanningNotScannedColor="?sbColorOutline",this.allowPartialScan=!1,this.expectedBarcodes=[],this.countingRepeatDelay=1e3,this.sheet=new m({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new i.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new A({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new i.j({visible:!0,text:"?findAndPickSheetTitle",color:"?sbColorOnSurface",useShadow:!1}),clearAllButton:new i.c({visible:!0,text:"?sheetResetButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),barcodeItemSubtitle:new i.j({text:"?findAndPickSheetBarcodeItemSubtitle",color:"?sbColorOnSurfaceVariant"}),barcodeItemImageVisible:!0,submitButton:new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new i.c({visible:!0,text:"?sheetStartScanningButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new i.j({text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface"}),placeholderSubtitle:new i.j({text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant"}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new i.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new g({enabled:!1,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new v({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new i.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new i.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new i.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.arOverlay=new o.a({visible:!1,automaticSelectionEnabled:!0,polygon:new o.f({partiallyScanned:new i.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),rejected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),completed:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),badge:new o.g({partiallyScanned:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),rejected:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorSurface",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),completed:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"})})}),this.partialScannedAlertDialogEnabled=!0,this.partialScannedAlertDialog=new y({title:new i.j({text:"?findAndPickPartialAlertTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?findAndPickPartialAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new i.c({visible:!0,text:"?findAndPickPartialAlertSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?findAndPickPartialAlertCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),this.confirmationAlertDialogEnabled=!1,this.confirmationAlertDialog=new y({title:new i.j({text:"?findAndPickCompleteAlertTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?findAndPickCompleteAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new i.c({visible:!0,text:"?findAndPickCompleteAlertSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?findAndPickCompleteAlertCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),void 0!==t.scanningCompletedColor&&(this.scanningCompletedColor=t.scanningCompletedColor),void 0!==t.scanningPartiallyColor&&(this.scanningPartiallyColor=t.scanningPartiallyColor),void 0!==t.scanningNotScannedColor&&(this.scanningNotScannedColor=t.scanningNotScannedColor),void 0!==t.allowPartialScan&&(this.allowPartialScan=t.allowPartialScan),void 0!==t.expectedBarcodes&&(this.expectedBarcodes=t.expectedBarcodes.map((t=>new C(t)))),void 0!==t.countingRepeatDelay&&(this.countingRepeatDelay=t.countingRepeatDelay),void 0!==t.sheet&&(this.sheet=new m(t.sheet)),void 0!==t.sheetContent&&(this.sheetContent=new A(t.sheetContent)),void 0!==t.manualCountEditDialog&&(this.manualCountEditDialog=new v(t.manualCountEditDialog)),void 0!==t.arOverlay&&(this.arOverlay=new o.a(t.arOverlay)),void 0!==t.partialScannedAlertDialogEnabled&&(this.partialScannedAlertDialogEnabled=t.partialScannedAlertDialogEnabled),void 0!==t.partialScannedAlertDialog&&(this.partialScannedAlertDialog=new y(t.partialScannedAlertDialog)),void 0!==t.confirmationAlertDialogEnabled&&(this.confirmationAlertDialogEnabled=t.confirmationAlertDialogEnabled),void 0!==t.confirmationAlertDialog&&(this.confirmationAlertDialog=new y(t.confirmationAlertDialog))}}(h||(h={})).From=function(t){const e=t._type;switch(e){case"SingleScanningMode":return new c(t);case"MultipleScanningMode":return new b(t);case"FindAndPickScanningMode":return new S(t);default:throw`Unknown child class name: ${e}`}};var w,x=n(20);class E extends r.a{constructor(t={}){super(),this.visible=!0,this.style=new L({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new x.AspectRatio({width:1,height:1}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.style&&(this.style=w.From(t.style)),void 0!==t.overlayColor&&(this.overlayColor=t.overlayColor),void 0!==t.aspectRatio&&(this.aspectRatio=new x.AspectRatio(t.aspectRatio))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"FinderCorneredStyle":return new L(t);case"FinderStrokedStyle":return new _(t);default:throw`Unknown child class name: ${e}`}}}(w||(w={}));class L extends r.a{constructor(t={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class _ extends r.a{constructor(t={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class O extends r.a{constructor(t={}){super(),this.visible=!0,this.title=new i.j({color:"?sbColorOnPrimary"}),this.background=new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.background&&(this.background=new i.a(t.background))}}class T extends r.a{constructor(t={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionCloseButton="Close",this.topBarCancelButton="Cancel",this.topBarTitle="Scan Item",this.userGuidance="Move the finder over a barcode",this.barcodeInfoMappingLoadingMessage="Loading details...",this.barcodeInfoMappingErrorStateTitle="Connection Error!",this.barcodeInfoMappingErrorStateSubtitle="There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",this.barcodeInfoMappingErrorStateRetryButton="Retry",this.barcodeInfoMappingErrorStateCancelButton="Cancel",this.manualCountEditDialogTitle="Update count",this.manualCountEditDialogInfo="Adjust the number of items you scanned.",this.manualCountEditDialogUpdateButton="Update",this.manualCountEditDialogCancelButton="Cancel",this.sheetResetButton="Reset",this.sheetClearAllButton="Clear all",this.sheetSubmitButton="Submit",this.sheetStartScanningButton="Start scanning",this.sheetPlaceholderTitle="No barcodes here!",this.sheetPlaceholderSubtitle="The barcode list is currently empty. Close this sheet and scan your items to add them.",this.singleModeConfirmationCancelButton="Close",this.multipleModeSheetTitle="%d items",this.findAndPickSheetTitle="%d/%d scanned",this.findAndPickSheetBarcodeItemSubtitle="%d/%d added",this.findAndPickPartialAlertTitle="Incomplete scan!",this.findAndPickPartialAlertSubtitle="Some codes are yet to be scanned. Proceed with submission anyway?",this.findAndPickPartialAlertCancelButton="Cancel",this.findAndPickPartialAlertSubmitButton="Yes, Submit",this.findAndPickCompleteAlertTitle="All codes found!",this.findAndPickCompleteAlertSubtitle="You have successfully scanned all codes. Proceed with submission?",this.findAndPickCompleteAlertCancelButton="Dismiss",this.findAndPickCompleteAlertSubmitButton="Submit",void 0!==t.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=t.cameraPermissionEnableCameraTitle),void 0!==t.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=t.cameraPermissionEnableCameraExplanation),void 0!==t.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=t.cameraPermissionCloseButton),void 0!==t.topBarCancelButton&&(this.topBarCancelButton=t.topBarCancelButton),void 0!==t.topBarTitle&&(this.topBarTitle=t.topBarTitle),void 0!==t.userGuidance&&(this.userGuidance=t.userGuidance),void 0!==t.barcodeInfoMappingLoadingMessage&&(this.barcodeInfoMappingLoadingMessage=t.barcodeInfoMappingLoadingMessage),void 0!==t.barcodeInfoMappingErrorStateTitle&&(this.barcodeInfoMappingErrorStateTitle=t.barcodeInfoMappingErrorStateTitle),void 0!==t.barcodeInfoMappingErrorStateSubtitle&&(this.barcodeInfoMappingErrorStateSubtitle=t.barcodeInfoMappingErrorStateSubtitle),void 0!==t.barcodeInfoMappingErrorStateRetryButton&&(this.barcodeInfoMappingErrorStateRetryButton=t.barcodeInfoMappingErrorStateRetryButton),void 0!==t.barcodeInfoMappingErrorStateCancelButton&&(this.barcodeInfoMappingErrorStateCancelButton=t.barcodeInfoMappingErrorStateCancelButton),void 0!==t.manualCountEditDialogTitle&&(this.manualCountEditDialogTitle=t.manualCountEditDialogTitle),void 0!==t.manualCountEditDialogInfo&&(this.manualCountEditDialogInfo=t.manualCountEditDialogInfo),void 0!==t.manualCountEditDialogUpdateButton&&(this.manualCountEditDialogUpdateButton=t.manualCountEditDialogUpdateButton),void 0!==t.manualCountEditDialogCancelButton&&(this.manualCountEditDialogCancelButton=t.manualCountEditDialogCancelButton),void 0!==t.sheetResetButton&&(this.sheetResetButton=t.sheetResetButton),void 0!==t.sheetClearAllButton&&(this.sheetClearAllButton=t.sheetClearAllButton),void 0!==t.sheetSubmitButton&&(this.sheetSubmitButton=t.sheetSubmitButton),void 0!==t.sheetStartScanningButton&&(this.sheetStartScanningButton=t.sheetStartScanningButton),void 0!==t.sheetPlaceholderTitle&&(this.sheetPlaceholderTitle=t.sheetPlaceholderTitle),void 0!==t.sheetPlaceholderSubtitle&&(this.sheetPlaceholderSubtitle=t.sheetPlaceholderSubtitle),void 0!==t.singleModeConfirmationCancelButton&&(this.singleModeConfirmationCancelButton=t.singleModeConfirmationCancelButton),void 0!==t.multipleModeSheetTitle&&(this.multipleModeSheetTitle=t.multipleModeSheetTitle),void 0!==t.findAndPickSheetTitle&&(this.findAndPickSheetTitle=t.findAndPickSheetTitle),void 0!==t.findAndPickSheetBarcodeItemSubtitle&&(this.findAndPickSheetBarcodeItemSubtitle=t.findAndPickSheetBarcodeItemSubtitle),void 0!==t.findAndPickPartialAlertTitle&&(this.findAndPickPartialAlertTitle=t.findAndPickPartialAlertTitle),void 0!==t.findAndPickPartialAlertSubtitle&&(this.findAndPickPartialAlertSubtitle=t.findAndPickPartialAlertSubtitle),void 0!==t.findAndPickPartialAlertCancelButton&&(this.findAndPickPartialAlertCancelButton=t.findAndPickPartialAlertCancelButton),void 0!==t.findAndPickPartialAlertSubmitButton&&(this.findAndPickPartialAlertSubmitButton=t.findAndPickPartialAlertSubmitButton),void 0!==t.findAndPickCompleteAlertTitle&&(this.findAndPickCompleteAlertTitle=t.findAndPickCompleteAlertTitle),void 0!==t.findAndPickCompleteAlertSubtitle&&(this.findAndPickCompleteAlertSubtitle=t.findAndPickCompleteAlertSubtitle),void 0!==t.findAndPickCompleteAlertCancelButton&&(this.findAndPickCompleteAlertCancelButton=t.findAndPickCompleteAlertCancelButton),void 0!==t.findAndPickCompleteAlertSubmitButton&&(this.findAndPickCompleteAlertSubmitButton=t.findAndPickCompleteAlertSubmitButton)}}class k extends r.a{constructor(t={}){super(),this.barcodesRegexFilter="",this.barcodeFormats=[],this.gs1Handling="PARSE",this.engineMode="NEXT_GEN_LOW_POWER",this.maximumRecognizerResolution=600,void 0!==t.barcodesRegexFilter&&(this.barcodesRegexFilter=t.barcodesRegexFilter),void 0!==t.barcodeFormats&&(this.barcodeFormats=t.barcodeFormats.map((t=>t))),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.maximumRecognizerResolution&&(this.maximumRecognizerResolution=t.maximumRecognizerResolution)}}class D extends r.a{constructor(t={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new i.e({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new i.c({text:"Close",background:new i.a({}),foreground:new i.d({})}),this.enableCameraTitle=new i.j({text:"Camera permission denied!",color:"?colorOnSurface"}),this.enableCameraExplanation=new i.j({text:"Please allow the usage of the camera to start the scanning process.",color:"?sbColorOnSurfaceVariant"}),void 0!==t.background&&(this.background=t.background),void 0!==t.iconBackground&&(this.iconBackground=t.iconBackground),void 0!==t.icon&&(this.icon=new i.e(t.icon)),void 0!==t.closeButton&&(this.closeButton=new i.c(t.closeButton)),void 0!==t.enableCameraTitle&&(this.enableCameraTitle=new i.j(t.enableCameraTitle)),void 0!==t.enableCameraExplanation&&(this.enableCameraExplanation=new i.j(t.enableCameraExplanation))}}class P extends r.a{constructor(t={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new i.f({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new T({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new f.a({title:new i.j({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new i.c({visible:!0,text:"?topBarCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new p({flashButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new E({visible:!0,style:new L({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new x.AspectRatio({width:1,height:1})}),this.userGuidance=new O({visible:!0,title:new i.j({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new D({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new i.e({visible:!0,color:"?sbColorOnSurface"}),closeButton:new i.c({visible:!0,text:"?cameraPermissionCloseButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new i.j({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new i.j({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new d({}),this.recognizerConfiguration=new k({}),this.useCase=new c({}),this.sound=new i.i({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new i.l({enabled:!0}),this.timeouts=new i.k({autoCancelTimeout:0,initialScanDelay:0}),void 0!==t.version&&(this.version=t.version),void 0!==t.screen&&(this.screen=t.screen),void 0!==t.palette&&(this.palette=new i.f(t.palette)),void 0!==t.localization&&(this.localization=new T(t.localization)),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.topBar&&(this.topBar=new f.a(t.topBar)),void 0!==t.actionBar&&(this.actionBar=new p(t.actionBar)),void 0!==t.viewFinder&&(this.viewFinder=new E(t.viewFinder)),void 0!==t.userGuidance&&(this.userGuidance=new O(t.userGuidance)),void 0!==t.cameraPermission&&(this.cameraPermission=new D(t.cameraPermission)),void 0!==t.cameraConfiguration&&(this.cameraConfiguration=new d(t.cameraConfiguration)),void 0!==t.recognizerConfiguration&&(this.recognizerConfiguration=new k(t.recognizerConfiguration)),void 0!==t.useCase&&(this.useCase=h.From(t.useCase)),void 0!==t.sound&&(this.sound=new i.i(t.sound)),void 0!==t.vibration&&(this.vibration=new i.l(t.vibration)),void 0!==t.timeouts&&(this.timeouts=new i.k(t.timeouts))}}var B=n(35);class F extends r.a{constructor(t={}){if(super(),void 0===t.barcode)throw new Error("barcode must be present in constructor argument");if(this.barcode=new B.BarcodeItem(t.barcode),void 0===t.count)throw new Error("count must be present in constructor argument");this.count=t.count}}class R extends r.a{constructor(t={}){super(),this.items=[],void 0!==t.items&&(this.items=t.items.map((t=>new F(t))))}}var I=n(19)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(36);class i extends o.a{constructor(t){super(),this.mirrored=!1,this.spinnerColor="black",this.backgroundColor="black",this.videoConstraints={width:{ideal:t.width},height:{ideal:t.height},facingMode:"environment",resizeMode:"none",experimental:{focusMode:"continous",focusDistance:0}}}static mapVideoConstraints(t,e){t.videoConstraints&&this.mapValues(t.videoConstraints,e.videoConstraints)}}i.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},i.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},i.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,i.DEFAULT_ACCEPTED_ANGLE_SCORE=75,i.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class i extends Error{constructor(t,e,n){super(e),this.name="",this.name=t,this.message=e,this.webApiError=n}static mediaDevicesUndefined(){return new i(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? If so, please use a secure context (HTTPS) or use 'localhost' explicitly.")}static enumerateDevicesFailed(){return new i(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? Because we're unable to query query navigator.mediaDevices?.enumerateDevices")}static mediaDeviceNotFound(t){return new i(this.MESSAGE.ENUMERATE_FAILED,"Does your device even have a camera? Because we were unable to query navigator.mediaDevices?.getUserMedia().",t)}static permissionDenied(t){return new i(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",t)}static unknown(t){return new i(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevicess.getUserMedia, \n and unable to determine the reason why. This may be caused by the user to denied the permission prompt. \n Or you may be using an in-app browser that itself has not been granted permission to use the camera.\n Or your users may be using a niche browser that does not support the media API at all!\n ",t)}static tryCheckPermission(){return o(this,void 0,void 0,(function*(){if(!this.permissionState)try{const t=yield navigator.permissions.query({name:"camera"});this.permissionState=t.state}catch(t){this.permissionState=this.PERMISSION_STATE.UNKNOWN}}))}static hasDeniedPermission(){return this.permissionState===this.PERMISSION_STATE.DENIED}static hasCheckedPermission(){return!!this.permissionState}static createFromDOMException(t){return t instanceof DOMException?"NotAllowedError"===t.name?i.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===t.name?i.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."):void 0:i.unknown(null==t?void 0:t.message)}}i.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},i.MESSAGE={DEVICES_UNDEFINED:"MediaError_DevicesUndefined",DEVICE_NOT_FOUND:"MediaError_DeviceNotFound",ENUMERATE_FAILED:"MediaError_EnumerateFailed",PERMISSION_DENIED:"MediaError_PermissionDenied",UNKNOWN:"MediaError_Unknown"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{static initialize(t=!1){this.verbose=t}static debug(t){this.verbose&&console.log("ScanbotSDK:",t)}static debugWarn(t){this.verbose&&console.warn("ScanbotSDK:",t)}}},,,function(t,e,n){"use strict";n.r(e),n.d(e,"OcrResult",(function(){return i})),n.d(e,"FieldParsedData",(function(){return r})),n.d(e,"FieldType",(function(){return a})),n.d(e,"Field",(function(){return s})),n.d(e,"GenericDocumentType",(function(){return l})),n.d(e,"GenericDocument",(function(){return c}));var o=n(4);class i extends o.a{constructor(t={}){if(super(),void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=t.confidence}}class r extends o.a{constructor(t={}){if(super(),void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class a extends o.a{constructor(t={}){if(super(),this.listIndex=null,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=t.fullName,void 0===t.normalizedName)throw new Error("normalizedName must be present in constructor argument");if(this.normalizedName=t.normalizedName,void 0===t.commonType)throw new Error("commonType must be present in constructor argument");this.commonType=null!=t.commonType?t.commonType:null,void 0!==t.listIndex&&(this.listIndex=null!=t.listIndex?t.listIndex:null)}}class s extends o.a{constructor(t={}){if(super(),this.confidenceWeight=1,this.image=null,this.validationStatus="NONE",this.parsedData=[],void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=new a(t.type),void 0===t.value)throw new Error("value must be present in constructor argument");if(this.value=null!=t.value?new i(t.value):null,void 0!==t.confidenceWeight&&(this.confidenceWeight=t.confidenceWeight),void 0!==t.image&&(this.image=null!=t.image?t.image:null),void 0===t.polygonInRoot)throw new Error("polygonInRoot must be present in constructor argument");this.polygonInRoot=t.polygonInRoot.map((t=>({x:t.x,y:t.y}))),void 0!==t.validationStatus&&(this.validationStatus=t.validationStatus),void 0!==t.parsedData&&(this.parsedData=t.parsedData.map((t=>new r(t))))}}class l extends o.a{constructor(t={}){if(super(),this.listIndex=null,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=t.fullName,void 0===t.normalizedName)throw new Error("normalizedName must be present in constructor argument");this.normalizedName=t.normalizedName,void 0!==t.listIndex&&(this.listIndex=null!=t.listIndex?t.listIndex:null)}}class c extends o.a{constructor(t={}){if(super(),this.crop=null,this.confidence=0,this.confidenceWeight=0,void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=new l(t.type),void 0===t.fields)throw new Error("fields must be present in constructor argument");if(this.fields=t.fields.map((t=>new s(t))),void 0===t.children)throw new Error("children must be present in constructor argument");if(this.children=t.children.map((t=>new c(t))),void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=null!=t.quad?t.quad.map((t=>({x:t.x,y:t.y}))):null,void 0===t.quadInRoot)throw new Error("quadInRoot must be present in constructor argument");this.quadInRoot=null!=t.quadInRoot?t.quadInRoot.map((t=>({x:t.x,y:t.y}))):null,void 0!==t.crop&&(this.crop=null!=t.crop?t.crop:null),void 0!==t.confidence&&(this.confidence=t.confidence),void 0!==t.confidenceWeight&&(this.confidenceWeight=t.confidenceWeight)}}},function(t,e,n){"use strict";n.r(e),n.d(e,"LineSegmentInt",(function(){return i})),n.d(e,"LineSegmentFloat",(function(){return r})),n.d(e,"AspectRatio",(function(){return a}));var o=n(4);class i extends o.a{constructor(t={}){if(super(),void 0===t.start)throw new Error("start must be present in constructor argument");if(this.start={x:t.start.x,y:t.start.y},void 0===t.end)throw new Error("end must be present in constructor argument");this.end={x:t.end.x,y:t.end.y}}}class r extends o.a{constructor(t={}){if(super(),void 0===t.start)throw new Error("start must be present in constructor argument");if(this.start={x:t.start.x,y:t.start.y},void 0===t.end)throw new Error("end must be present in constructor argument");this.end={x:t.end.x,y:t.end.y}}}class a extends o.a{constructor(t={}){super(),this.width=1,this.height=1,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(t,e,n,o){this.x=t,this.y=e,this.width=n,this.height=o}scaleDown(t){return new o(this.x/t,this.y/t,this.width/t,this.height/t)}bottom(){return this.y+this.height}static withSize(t,e){return new o(0,0,t,e)}static empty(){return new o(0,0,0,0)}static fromRect(t){return t?new o(t.x,t.y,t.width,t.height):o.empty()}static fromPoint(t,e){return new o(t.x-e/2,t.y-e/2,e,e)}static fromDOMRect(t){return new o(t.x,t.y,t.width,t.height)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(14),i=n(13);class r extends o.a{constructor(t){super(t);const e=new i.BarcodeScannerConfiguration;this.finder=e.viewFinder,this.userGuidance=e.userGuidance}static mapFinderConfiguration(t,e){var n,i;o.a.mapValuesDeep(null!==(n=e.finder)&&void 0!==n?n:{},t.finder),o.a.mapValuesDeep(null!==(i=e.userGuidance)&&void 0!==i?i:{},t.userGuidance)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var o=n(0),i=n(15),r=n(25),a=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class s extends o.default.Component{constructor(t){super(t),this.orientationchangeCallback=this.orientationChanged.bind(this),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(t){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(t){var e,n;return a(this,void 0,void 0,(function*(){const o=this.props.preferredCamera;if(o)try{const e=(yield navigator.mediaDevices.enumerateDevices()).find((t=>t.deviceId===o||t.label===o));if(e)return Object.assign(Object.assign({},t),{deviceId:e.deviceId})}catch(t){throw i.a.enumerateDevicesFailed()}else{const o={user:"front",environment:"back"},i=(null===(e=null==t?void 0:t.facingMode)||void 0===e?void 0:e.ideal)||(null===(n=null==t?void 0:t.facingMode)||void 0===n?void 0:n.exact)||(null==t?void 0:t.facingMode);if("string"==typeof i&&i in o){yield r.a.INSTANCE.load();const e=r.a.INSTANCE.getMainCamera(o[i]);if(e)return Object.assign(Object.assign({},t),{deviceId:e.deviceId})}}return t}))}componentDidMount(){return a(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationchangeCallback),yield this.refreshStream()}))}refreshStream(){var t,e,n,o,r,s,l,c;return a(this,void 0,void 0,(function*(){if(console.log("refreshStream",this),i.a.hasCheckedPermission()||(yield i.a.tryCheckPermission()),i.a.hasDeniedPermission())return void(null===(e=(t=this.props).onError)||void 0===e||e.call(t,i.a.permissionDenied()));const a={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};try{if(!navigator.mediaDevices){const t=i.a.unknown();return null===(o=(n=this.props).onError)||void 0===o||o.call(n,t),void console.log(t)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(a);this.setState({stream:t},(()=>{var e,n,o,i;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(i=(o=this.props).onReady)||void 0===i||i.call(o)}))}catch(t){const e=i.a.mediaDeviceNotFound();return null===(s=(r=this.props).onError)||void 0===s||s.call(r,e),void console.error(e)}}catch(t){const e=i.a.createFromDOMException(t);return null===(c=(l=this.props).onError)||void 0===c||c.call(l,e),void console.error(e)}}))}stopCurrentStreams(){const t=this.state.stream,e=null==t?void 0:t.getTracks();e&&e.forEach((t=>{t.stop()}))}componentWillUnmount(){window.removeEventListener("orientationchange",this.orientationchangeCallback),this.state.stream&&(this.state.stream.getVideoTracks&&this.state.stream.getAudioTracks&&(this.state.stream.getVideoTracks().forEach((t=>t.stop())),this.state.stream.getAudioTracks().forEach((t=>t.stop()))),this.setState({stream:void 0}))}render(){return this.props.children}updateTorch(t){return a(this,void 0,void 0,(function*(){const e=[{torch:t}];yield this.state.stream.getVideoTracks()[0].applyConstraints({advanced:e})}))}getCapabilities(){if(this.state.stream.getVideoTracks){const t=this.getVideoTrack();return s.getMediaTrackCapabilities(t)}}static getMediaTrackCapabilities(t){if(t&&t.getCapabilities)return t.getCapabilities()}getVideoTrack(){const t=this.state.stream.getVideoTracks();if(t.length>0)return t[0]}}var l=n(10),c=n(21),u=n(16),d=n(34);class h{static isSupported(){return!!document.createElement("canvas").getContext("webgl")}constructor(){this._type="WebGL",this.canvas=document.createElement("canvas");const t=this.gl=this.canvas.getContext("webgl",{willReadFrequently:!0}),e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR);const n=t.createShader(t.VERTEX_SHADER);t.shaderSource(n,"attribute vec2 p;void main(){ gl_Position = vec4(p,0,1);}"),t.compileShader(n);const o=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(o,"precision mediump float;uniform sampler2D texture; uniform vec2 scale; uniform vec2 offset; void main() { gl_FragColor=texture2D( texture, gl_FragCoord.xy * scale + offset );}"),t.compileShader(o);const i=this.program=t.createProgram();t.attachShader(i,n),t.attachShader(i,o),t.linkProgram(i),t.useProgram(i),t.uniform1i(t.getUniformLocation(i,"texture"),0),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),t.enableVertexAttribArray(0),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0)}getImageData(t,e,n,o,i,r,a,s){let l,c;if(r=Math.floor(r),a=Math.floor(a),e=Math.floor(e),n=Math.floor(n),o=Math.floor(o),i=Math.floor(i),t instanceof HTMLVideoElement)[c,l]=[t.videoWidth,t.videoHeight];else{if(!(t instanceof HTMLCanvasElement))throw new Error("Unsupported source type");[c,l]=[t.width,t.height]}(c<e+o||l<n+i)&&u.a.debug("Crop region exceeds source video dimensions. This can happen when the screen is resized or rotated and the video has not yet changed its size. Most likely, the frame we analyzed now contains some garbage data. This is not a problem, unless it happens very frequently.");const h=this.gl;this.canvas.width=r,this.canvas.height=a,h.viewport(0,0,r,a);const f=[o/(r*c),i/(a*l)],p=[e/c,n/l];return h.uniform2fv(h.getUniformLocation(this.program,"scale"),f),h.uniform2fv(h.getUniformLocation(this.program,"offset"),p),h.texImage2D(h.TEXTURE_2D,0,h.RGB,h.RGB,h.UNSIGNED_BYTE,t),h.drawArrays(h.TRIANGLES,0,6),(null==s?void 0:s.byteLength)!==r*a*4&&(s=new Uint8ClampedArray(r*a*4),d.a.INSTANCE.values.set("WebGLNumBufferAllocations",(d.a.INSTANCE.values.get("WebGLNumBufferAllocations")||0)+1)),h.readPixels(0,0,r,a,h.RGBA,h.UNSIGNED_BYTE,s),new ImageData(s,r,a)}}class f{constructor(){this._type="TwoD",this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0,alpha:!1}),this.ctx.imageSmoothingEnabled=!1}getImageData(t,e,n,o,i,r,a,s){return this.canvas.width=r,this.canvas.height=a,this.ctx.drawImage(t,e,n,o,i,0,0,r,a),this.ctx.getImageData(0,0,r,a)}}var p=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class m extends o.default.Component{constructor(t){super(t),this.videoLoaded=!1,this.reloadCanvas=!0,this.swapCameraEnabled=!0,this.activeCamera=void 0,this.save=!1,this._reusableImageBuffer=null,this.onStreamChanged=t=>{this.video.srcObject=t,this.updateCameraInfo(t),this.video.addEventListener("resize",(t=>{this.reloadCanvas=!0}),!1),this.video.addEventListener("loadeddata",(t=>{this.videoLoaded=!0,this.didLoadVideo&&this.didLoadVideo()}),!1)},this.state={facingModeBack:"environment"===this.props.videoConstraints.facingMode,mirrored:this.props.mirrored,deviceId:void 0}}videoSize(){const{clientVideoWidth:t,clientVideoHeight:e}=this.calculateClientVideoConstraints();return new l.a(t,e)}saveExtractedData(){this.save=!0}zoom(){var t;return null!==(t=this.props.zoom)&&void 0!==t?t:1}imageCapture(){if(this.capture)return this.capture;const t=this.videoStream.getVideoTrack();return this.capture=new ImageCapture(t),this.capture}set reusableImageBuffer(t){this._reusableImageBuffer=t}createImageData(t=0,e){return p(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;if(e){const t=yield this.imageCapture().takePhoto(),e=yield createImageBitmap(t);u.a.debug("Bitmap size: "+e.width*e.height);const o=this.windowSize(),i=e.height/(o.height+o.y),r=o.width*i,a=o.height*i,s=e.width/2-r/2,l=o.y*i,d=new c.a(s,l,r,a);return u.a.debug("Frame size: "+d.x+"-"+d.y+"-"+d.width+"-"+d.height),n.getImageData(this.video,d.x,d.y,e.width,e.height,d.width,d.height,this._reusableImageBuffer)}let{videoWidth:o,videoHeight:i}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const l=this.finderFrame||new c.a(0,0,r,a),d=this.zoom(),h=(o-r/d)/2,f=(i-a/d)/2,p=l.x/s+h,m=l.y/s+f,g=this.finderFrame?s:d,v=l.width/g,A=l.height/g,b=this.calculateFrameSize(t,v,A);return n.getImageData(this.video,p,m,v,A,b.width,b.height,this._reusableImageBuffer)}))}windowSize(){var t;const e=this.props.configuration,n=null!==(t=e.container)&&void 0!==t?t:document.getElementById(e.containerId);if(!n)throw new Error("Container DOM element is required to calculate window size and snap image.");return c.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:t,videoHeight:e}=this.video,n=this.video.getBoundingClientRect(),o=t,i=e,r=1;return n.width/n.height<=t/e?(r=n.height/e,r>0&&(o=n.width/r)):(r=n.width/t,r>0&&(i=n.height/r)),{clientVideoWidth:o,clientVideoHeight:i,coef:r}}calculateFrameSize(t,e,n){let o=e,i=n;if(t>0&&0!=e&&0!=n){const r=e/n;e>n?(o=e>t?t:e,i=o/r):(i=n>t?t:n,o=i*r)}return new l.a(o,i)}getCanvasRenderingContext(){return this.video?0===this.video.videoWidth?null:(this.canvas&&!this.reloadCanvas||(this.canvas&&this.releaseCanvas(),this.canvas=h.isSupported()?new h:new f,this.reloadCanvas=!1),this.canvas):null}releaseCanvas(){this.canvas&&(this.canvas=null)}componentWillUnmount(){this.releaseCanvas(),this.video=null,this.videoStream=null}style(){var t;const e={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover",backgroundColor:null===(t=this.props.configuration)||void 0===t?void 0:t.backgroundColor};return this.state.mirrored&&(e.transform="scaleX(-1)"),e}zoomMargin(){const t=this.zoom();return 1===t?0:(1-t)/2*100}render(){const{videoConstraints:t,onReady:e,onError:n}=this.props;return o.default.createElement(s,{videoConstraints:t,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:e,onStreamChanged:this.onStreamChanged,onError:n,ref:t=>{this.videoStream=t}},o.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:t=>{this.video=t},style:this.style()}))}setDirection(t){this.props.videoConstraints.facingMode={ideal:t},this.setState({facingModeBack:"environment"===t,mirrored:"user"===t},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}swapCameraFacing(t){if(this.swapCameraEnabled){this.swapCameraEnabled=!1;const e=!this.state.facingModeBack,n=e?"environment":"user";this.props.videoConstraints.facingMode=!0===t?{exact:n}:{ideal:n},this.setState({facingModeBack:e,mirrored:!e},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(t,e){return p(this,void 0,void 0,(function*(){this.swapCameraEnabled&&(this.swapCameraEnabled=!1,this.props.videoConstraints.facingMode=void 0,this.setState({facingModeBack:void 0,mirrored:null!=e?e:this.state.mirrored,deviceId:t},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0})))))}))}updateCameraInfo(t){this.activeCamera=r.a.getCameraInfoFromStream(t)}getActiveCameraInfo(){return this.activeCamera}setTorchState(t){if(this.activeCamera&&this.activeCamera.supportsTorchControl){return this.videoStream.getVideoTrack().applyConstraints({advanced:[{torch:t}]})}return Promise.reject("Torch is not supported for current camera.")}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return Qt})),n.d(e,"b",(function(){return Yt}));var o=n(2),i=(n(46),n(0)),r=n(44),a=n.n(r),s=n(28),l=n(45),c="undefined"!=typeof t&&void 0!==t.env&&(t.env.REACT_APP_SC_ATTR||t.env.SC_ATTR)||"data-styled",u="active",d="data-styled-version",h="6.1.8",f="/*!sc*/\n",p="undefined"!=typeof window&&"HTMLElement"in window,m=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&void 0!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==t.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&t.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&void 0!==t.env.SC_DISABLE_SPEEDY&&""!==t.env.SC_DISABLE_SPEEDY&&("false"!==t.env.SC_DISABLE_SPEEDY&&t.env.SC_DISABLE_SPEEDY)),g=(new Set,Object.freeze([])),v=Object.freeze({});function A(t,e,n){return void 0===n&&(n=v),t.theme!==n.theme&&t.theme||e||n.theme}var b=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),y=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,C=/(^-|-$)/g;function S(t){return t.replace(y,"-").replace(C,"")}var w=/(a)(d)/gi,x=function(t){return String.fromCharCode(t+(t>25?39:97))};function E(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=x(e%52)+n;return(x(e%52)+n).replace(w,"$1-$2")}var L,_=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},O=function(t){return _(5381,t)};function T(t){return E(O(t)>>>0)}function k(t){return t.displayName||t.name||"Component"}function D(t){return"string"==typeof t&&!0}var P="function"==typeof Symbol&&Symbol.for,B=P?Symbol.for("react.memo"):60115,F=P?Symbol.for("react.forward_ref"):60112,R={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},I={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},W={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},M=((L={})[F]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},L[B]=W,L);function j(t){return("type"in(e=t)&&e.type.$$typeof)===B?W:"$$typeof"in t?M[t.$$typeof]:R;var e}var z=Object.defineProperty,N=Object.getOwnPropertyNames,V=Object.getOwnPropertySymbols,U=Object.getOwnPropertyDescriptor,H=Object.getPrototypeOf,G=Object.prototype;function Q(t,e,n){if("string"!=typeof e){if(G){var o=H(e);o&&o!==G&&Q(t,o,n)}var i=N(e);V&&(i=i.concat(V(e)));for(var r=j(t),a=j(e),s=0;s<i.length;++s){var l=i[s];if(!(l in I||n&&n[l]||a&&l in a||r&&l in r)){var c=U(e,l);try{z(t,l,c)}catch(t){}}}}return t}function Y(t){return"function"==typeof t}function Z(t){return"object"==typeof t&&"styledComponentId"in t}function q(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function X(t,e){if(0===t.length)return"";for(var n=t[0],o=1;o<t.length;o++)n+=e?e+t[o]:t[o];return n}function $(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function K(t,e,n){if(void 0===n&&(n=!1),!n&&!$(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var o=0;o<e.length;o++)t[o]=K(t[o],e[o]);else if($(e))for(var o in e)t[o]=K(t[o],e[o]);return t}function J(t,e){Object.defineProperty(t,"toString",{value:e})}function tt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var et=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,i=o;t>=i;)if((i<<=1)<0)throw tt(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var r=o;r<i;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(t+1),s=(r=0,e.length);r<s;r++)this.tag.insertRule(a,e[r])&&(this.groupSizes[t]++,a++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),o=n+e;this.groupSizes[t]=0;for(var i=n;i<o;i++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),i=o+n,r=o;r<i;r++)e+="".concat(this.tag.getRule(r)).concat(f);return e},t}(),nt=new Map,ot=new Map,it=1,rt=function(t){if(nt.has(t))return nt.get(t);for(;ot.has(it);)it++;var e=it++;return nt.set(t,e),ot.set(e,t),e},at=function(t,e){it=e+1,nt.set(t,e),ot.set(e,t)},st="style[".concat(c,"][").concat(d,'="').concat(h,'"]'),lt=new RegExp("^".concat(c,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ct=function(t,e,n){for(var o,i=n.split(","),r=0,a=i.length;r<a;r++)(o=i[r])&&t.registerName(e,o)},ut=function(t,e){for(var n,o=(null!==(n=e.textContent)&&void 0!==n?n:"").split(f),i=[],r=0,a=o.length;r<a;r++){var s=o[r].trim();if(s){var l=s.match(lt);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(at(u,c),ct(t,u,l[3]),t.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}};function dt(){return n.nc}var ht=function(t){var e=document.head,n=t||e,o=document.createElement("style"),i=function(t){var e=Array.from(t.querySelectorAll("style[".concat(c,"]")));return e[e.length-1]}(n),r=void 0!==i?i.nextSibling:null;o.setAttribute(c,u),o.setAttribute(d,h);var a=dt();return a&&o.setAttribute("nonce",a),n.insertBefore(o,r),o},ft=function(){function t(t){this.element=ht(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,o=e.length;n<o;n++){var i=e[n];if(i.ownerNode===t)return i}throw tt(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),pt=function(){function t(t){this.element=ht(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),mt=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),gt=p,vt={isServer:!p,useCSSOMInjection:!m},At=function(){function t(t,e,n){void 0===t&&(t=v),void 0===e&&(e={});var i=this;this.options=Object(o.a)(Object(o.a)({},vt),t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&p&&gt&&(gt=!1,function(t){for(var e=document.querySelectorAll(st),n=0,o=e.length;n<o;n++){var i=e[n];i&&i.getAttribute(c)!==u&&(ut(t,i),i.parentNode&&i.parentNode.removeChild(i))}}(this)),J(this,(function(){return function(t){for(var e=t.getTag(),n=e.length,o="",i=function(n){var i=function(t){return ot.get(t)}(n);if(void 0===i)return"continue";var r=t.names.get(i),a=e.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(c,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==r&&r.forEach((function(t){t.length>0&&(l+="".concat(t,","))})),o+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(f)},r=0;r<n;r++)i(r);return o}(i)}))}return t.registerId=function(t){return rt(t)},t.prototype.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(Object(o.a)(Object(o.a)({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=function(t){var e=t.useCSSOMInjection,n=t.target;return t.isServer?new mt(n):e?new ft(n):new pt(n)}(this.options),new et(t)));var t},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(rt(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},t.prototype.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(rt(t),n)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(rt(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),bt=/&/g,yt=/^\s*\/\/.*$/gm;function Ct(t,e){return t.map((function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map((function(t){return"".concat(e," ").concat(t)}))),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=Ct(t.children,e)),t}))}function St(t){var e,n,o,i=void 0===t?v:t,r=i.options,a=void 0===r?v:r,l=i.plugins,c=void 0===l?g:l,u=function(t,o,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(e):t},d=c.slice();d.push((function(t){t.type===s.a&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(bt,n).replace(o,u))})),a.prefix&&d.push(s.d),d.push(s.g);var h=function(t,i,r,l){void 0===i&&(i=""),void 0===r&&(r=""),void 0===l&&(l="&"),e=l,n=i,o=new RegExp("\\".concat(n,"\\b"),"g");var c=t.replace(yt,""),u=s.b(r||i?"".concat(r," ").concat(i," { ").concat(c," }"):c);a.namespace&&(u=Ct(u,a.namespace));var h=[];return s.f(u,s.c(d.concat(s.e((function(t){return h.push(t)}))))),h};return h.hash=c.length?c.reduce((function(t,e){return e.name||tt(15),_(t,e.name)}),5381).toString():"",h}var wt=new At,xt=St(),Et=i.default.createContext({shouldForwardProp:void 0,styleSheet:wt,stylis:xt}),Lt=(Et.Consumer,i.default.createContext(void 0));function _t(){return Object(i.useContext)(Et)}function Ot(t){var e=Object(i.useState)(t.stylisPlugins),n=e[0],o=e[1],r=_t().styleSheet,s=Object(i.useMemo)((function(){var e=r;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target,r]),l=Object(i.useMemo)((function(){return St({options:{namespace:t.namespace,prefix:t.enableVendorPrefixes},plugins:n})}),[t.enableVendorPrefixes,t.namespace,n]);Object(i.useEffect)((function(){a()(n,t.stylisPlugins)||o(t.stylisPlugins)}),[t.stylisPlugins]);var c=Object(i.useMemo)((function(){return{shouldForwardProp:t.shouldForwardProp,styleSheet:s,stylis:l}}),[t.shouldForwardProp,s,l]);return i.default.createElement(Et.Provider,{value:c},i.default.createElement(Lt.Provider,{value:l},t.children))}var Tt=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=xt);var o=n.name+e.hash;t.hasNameForId(n.id,o)||t.insertRules(n.id,o,e(n.rules,o,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,J(this,(function(){throw tt(12,String(n.name))}))}return t.prototype.getName=function(t){return void 0===t&&(t=xt),this.name+t.hash},t}(),kt=function(t){return t>="A"&&t<="Z"};function Dt(t){for(var e="",n=0;n<t.length;n++){var o=t[n];if(1===n&&"-"===o&&"-"===t[0])return t;kt(o)?e+="-"+o.toLowerCase():e+=o}return e.startsWith("ms-")?"-"+e:e}var Pt=function(t){return null==t||!1===t||""===t},Bt=function(t){var e,n,i=[];for(var r in t){var a=t[r];t.hasOwnProperty(r)&&!Pt(a)&&(Array.isArray(a)&&a.isCss||Y(a)?i.push("".concat(Dt(r),":"),a,";"):$(a)?i.push.apply(i,Object(o.e)(Object(o.e)(["".concat(r," {")],Bt(a),!1),["}"],!1)):i.push("".concat(Dt(r),": ").concat((e=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||e in l.a||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return i};function Ft(t,e,n,o){return Pt(t)?[]:Z(t)?[".".concat(t.styledComponentId)]:Y(t)?!Y(i=t)||i.prototype&&i.prototype.isReactComponent||!e?[t]:Ft(t(e),e,n,o):t instanceof Tt?n?(t.inject(n,o),[t.getName(o)]):[t]:$(t)?Bt(t):Array.isArray(t)?Array.prototype.concat.apply(g,t.map((function(t){return Ft(t,e,n,o)}))):[t.toString()];var i}function Rt(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(Y(n)&&!Z(n))return!1}return!0}var It=O(h),Wt=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Rt(t),this.componentId=e,this.baseHash=_(It,e),this.baseStyle=n,At.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))o=q(o,this.staticRulesId);else{var i=X(Ft(this.rules,t,e,n)),r=E(_(this.baseHash,i)>>>0);if(!e.hasNameForId(this.componentId,r)){var a=n(i,".".concat(r),void 0,this.componentId);e.insertRules(this.componentId,r,a)}o=q(o,r),this.staticRulesId=r}else{for(var s=_(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=X(Ft(u,t,e,n));s=_(s,d+c),l+=d}}if(l){var h=E(s>>>0);e.hasNameForId(this.componentId,h)||e.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),o=q(o,h)}}return o},t}(),Mt=i.default.createContext(void 0);Mt.Consumer;var jt={};new Set;function zt(t,e,n){var r=Z(t),a=t,s=!D(t),l=e.attrs,c=void 0===l?g:l,u=e.componentId,d=void 0===u?function(t,e){var n="string"!=typeof t?"sc":S(t);jt[n]=(jt[n]||0)+1;var o="".concat(n,"-").concat(T(h+n+jt[n]));return e?"".concat(e,"-").concat(o):o}(e.displayName,e.parentComponentId):u,f=e.displayName,p=void 0===f?function(t){return D(t)?"styled.".concat(t):"Styled(".concat(k(t),")")}(t):f,m=e.displayName&&e.componentId?"".concat(S(e.displayName),"-").concat(e.componentId):e.componentId||d,y=r&&a.attrs?a.attrs.concat(c).filter(Boolean):c,C=e.shouldForwardProp;if(r&&a.shouldForwardProp){var w=a.shouldForwardProp;if(e.shouldForwardProp){var x=e.shouldForwardProp;C=function(t,e){return w(t,e)&&x(t,e)}}else C=w}var E=new Wt(n,m,r?a.componentStyle:void 0);function L(t,e){return function(t,e,n){var r=t.attrs,a=t.componentStyle,s=t.defaultProps,l=t.foldedComponentIds,c=t.styledComponentId,u=t.target,d=i.default.useContext(Mt),h=_t(),f=t.shouldForwardProp||h.shouldForwardProp,p=A(e,d,s)||v,m=function(t,e,n){for(var i,r=Object(o.a)(Object(o.a)({},e),{className:void 0,theme:n}),a=0;a<t.length;a+=1){var s=Y(i=t[a])?i(r):i;for(var l in s)r[l]="className"===l?q(r[l],s[l]):"style"===l?Object(o.a)(Object(o.a)({},r[l]),s[l]):s[l]}return e.className&&(r.className=q(r.className,e.className)),r}(r,e,p),g=m.as||u,y={};for(var C in m)void 0===m[C]||"$"===C[0]||"as"===C||"theme"===C&&m.theme===p||("forwardedAs"===C?y.as=m.forwardedAs:f&&!f(C,g)||(y[C]=m[C]));var S=function(t,e){var n=_t();return t.generateAndInjectStyles(e,n.styleSheet,n.stylis)}(a,m),w=q(l,c);return S&&(w+=" "+S),m.className&&(w+=" "+m.className),y[D(g)&&!b.has(g)?"class":"className"]=w,y.ref=n,Object(i.createElement)(g,y)}(_,t,e)}L.displayName=p;var _=i.default.forwardRef(L);return _.attrs=y,_.componentStyle=E,_.displayName=p,_.shouldForwardProp=C,_.foldedComponentIds=r?q(a.foldedComponentIds,a.styledComponentId):"",_.styledComponentId=m,_.target=r?a.target:t,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0,i=e;o<i.length;o++)K(t,i[o],!0);return t}({},a.defaultProps,t):t}}),J(_,(function(){return".".concat(_.styledComponentId)})),s&&Q(_,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function Nt(t,e){for(var n=[t[0]],o=0,i=e.length;o<i;o+=1)n.push(e[o],t[o+1]);return n}var Vt=function(t){return Object.assign(t,{isCss:!0})};function Ut(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Y(t)||$(t))return Vt(Ft(Nt(g,Object(o.e)([t],e,!0))));var i=t;return 0===e.length&&1===i.length&&"string"==typeof i[0]?Ft(i):Vt(Ft(Nt(i,e)))}function Ht(t,e,n){if(void 0===n&&(n=v),!e)throw tt(1,e);var i=function(i){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return t(e,n,Ut.apply(void 0,Object(o.e)([i],r,!1)))};return i.attrs=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i.withConfig=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),i))},i}var Gt=function(t){return Ht(zt,t)},Qt=Gt;b.forEach((function(t){Qt[t]=Gt(t)}));!function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=Rt(t),At.registerId(this.componentId+1)}t.prototype.createStyles=function(t,e,n,o){var i=o(X(Ft(this.rules,e,n,o)),""),r=this.componentId+t;n.insertRules(r,r,i)},t.prototype.removeStyles=function(t,e){e.clearRules(this.componentId+t)},t.prototype.renderStyles=function(t,e,n,o){t>2&&At.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,o)}}();function Yt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=X(Ut.apply(void 0,Object(o.e)([t],e,!1))),r=T(i);return new Tt(r,i)}(function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString(),n=dt(),o=X([n&&'nonce="'.concat(n,'"'),"".concat(c,'="true"'),"".concat(d,'="').concat(h,'"')].filter(Boolean)," ");return"<style ".concat(o,">").concat(e,"</style>")},this.getStyleTags=function(){if(t.sealed)throw tt(2);return t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)throw tt(2);var n=((e={})[c]="",e[d]=h,e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),r=dt();return r&&(n.nonce=r),[i.default.createElement("style",Object(o.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new At({isServer:!0}),this.sealed=!1}t.prototype.collectStyles=function(t){if(this.sealed)throw tt(2);return i.default.createElement(Ot,{sheet:this.instance},t)},t.prototype.interleaveWithNodeStream=function(t){throw tt(3)}})(),"__sc-".concat(c,"__")}).call(this,n(42))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(15),i=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class r{static get INSTANCE(){return r._INSTANCE||(r._INSTANCE=new r),r._INSTANCE}constructor(){this.listOfCameras=[],this.strategy="FAST_DEFERRED"}initialize(t){if(t&&(this.strategy=t),"SLOW"===t||"FAST"===t){const e=t;this.load(e)}}load(t){return i(this,void 0,void 0,(function*(){if(!t)if("SLOW_DEFERRED"===this.strategy||"SLOW"===this.strategy)t="SLOW";else if("FAST_DEFERRED"===this.strategy||"FAST"===this.strategy)t="FAST";else if("NONE"===this.strategy)return this.listOfCameras;let e;if("SLOW"===t)e=this.loadSlow();else{if("FAST"!==t)throw new Error(`Unknown mode ${t}`);e=this.loadFast()}try{return this.listOfCameras=yield e,this.listOfCameras}catch(t){throw this.loadSlowResult=void 0,o.a.createFromDOMException(t)}}))}loadSlow(){return this.loadSlowResult=this.loadSlowResult||(()=>i(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const t=[];for(const e of yield this.getVideoDevices()){let n;try{n=yield this.getUserMedia({video:{deviceId:e.deviceId}}),t.push(r.getCameraInfoFromStream(n))}finally{this.stopStream(n),yield new Promise((t=>setTimeout(t,0)))}}return t})))(),this.loadSlowResult}loadFast(){return this.loadFastResult=this.loadFastResult||(()=>i(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const t=[];for(const e of yield this.getVideoDevices()){const n=r.guessparseCameraLabelFacingMode(e.label),o=r.guessparseCameraLabelMaxNumPixels(e.label);t.push({maxNumPixels:o,facingMode:n,supportsTorchControl:void 0,deviceId:e.deviceId,label:e.label})}return t})))(),this.loadFastResult}getMainCamera(t){var e,n,o,i,r,a;return null!==(a=null===(r=null===(i=null===(o=null===(n=null===(e=this.listOfCameras)||void 0===e?void 0:e.filter((e=>e.facingMode===t)))||void 0===n?void 0:n.map(((t,e)=>({camera:t,index:e}))))||void 0===o?void 0:o.sort(((t,e)=>{var n;return-(+t.camera.supportsTorchControl||0)-(+e.camera.supportsTorchControl||0)||-((t.camera.maxNumPixels||0)-(e.camera.maxNumPixels||0))||(null===(n=t.camera.label)||void 0===n?void 0:n.localeCompare(e.camera.label))||t.index-e.index})))||void 0===i?void 0:i[0])||void 0===r?void 0:r.camera)&&void 0!==a?a:null}getVideoDevices(){return i(this,void 0,void 0,(function*(){let t=yield navigator.mediaDevices.enumerateDevices();if(t=t.filter((t=>"videoinput"===t.kind)),t.some((t=>""===t.label))){let e;try{e=yield this.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1}),t=yield navigator.mediaDevices.enumerateDevices(),t=t.filter((t=>"videoinput"===t.kind))}finally{this.stopStream(e)}}return t}))}stopStream(t){null==t||t.getTracks().forEach((t=>t.stop()))}static guessparseCameraLabelFacingMode(t){return function(t){const e=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"];for(const n of e)if(t.toLowerCase().includes(n.toLowerCase()))return!0;return!1}(t)?"back":"front"}static guessparseCameraLabelMaxNumPixels(t){const e=RegExp(/\b([0-9]+)mp?\b/).exec(t.toLowerCase()),n=e?1e6*parseInt(e[1],10):NaN;return Number.isNaN(n)?void 0:n}assertPermissionsAreOk(){return i(this,void 0,void 0,(function*(){if(o.a.hasCheckedPermission()||(yield o.a.tryCheckPermission()),o.a.hasDeniedPermission())throw o.a.permissionDenied();if(!navigator.mediaDevices)throw o.a.unknown()}))}static getCameraInfoFromStream(t){var e;return null===(e=t.getVideoTracks().map((t=>{var e,n,o,i,r,a;const s=null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t),l=null===(n=t.getSettings)||void 0===n?void 0:n.call(t),c=t.label;let u=function(t){if("user"===(null==t?void 0:t.toLowerCase()))return"front";if("environment"===(null==t?void 0:t.toLowerCase()))return"back";return"unknown"}(null!==(i=null===(o=null==s?void 0:s.facingMode)||void 0===o?void 0:o[0])&&void 0!==i?i:l.facingMode);"unknown"===u&&(u=this.guessparseCameraLabelFacingMode(c));let d=function(t){var e,n;let o=(null===(e=null==t?void 0:t.width)||void 0===e?void 0:e.max)*(null===(n=null==t?void 0:t.height)||void 0===n?void 0:n.max);if(!o||Number.isNaN(o))return;return o}(s);Number.isNaN(d)&&(d=this.guessparseCameraLabelMaxNumPixels(c));return{facingMode:u,maxNumPixels:d,supportsTorchControl:null!==(a=null!==(r=null==s?void 0:s.torch)&&void 0!==r?r:"torch"in l)&&void 0!==a&&a,label:c,deviceId:l.deviceId}})).sort(((t,e)=>e.maxNumPixels-t.maxNumPixels)))||void 0===e?void 0:e[0]}getUserMedia(t){return i(this,void 0,void 0,(function*(){try{return yield navigator.mediaDevices.getUserMedia(t)}catch(t){throw o.a.mediaDeviceNotFound()}}))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o=n(0),i=n(21),r=n(5),a=n(11);class s extends o.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(t){super(t),this.holePosition=i.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=t=>{var e,n,o,i;(null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)===(null===(n=t.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)===(null===(i=t.padding)||void 0===i?void 0:i.minBottomPadding)&&this.props.configuration===t.configuration&&this.props.guidanceConfiguration===t.guidanceConfiguration||this.setState({shouldUpdateCanvas:!0}),this.updateCanvas()},this.updateWindowSize=()=>{this.setState({shouldUpdateCanvas:!0})},this.getVideoSize=()=>{var t;return null!==(t=this.holeCanvas.getBoundingClientRect())&&void 0!==t?t:new DOMRect},this.scaleForRetinaDisplay=t=>{if(window.devicePixelRatio>1){var e=t.width,n=t.height;t.width=e*window.devicePixelRatio,t.height=n*window.devicePixelRatio,t.style.width=e+"px",t.style.height=n+"px",t.getContext("2d").scale(window.devicePixelRatio,window.devicePixelRatio)}},this.updateCanvas=()=>{var t,e,n,o,i;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const r=this.getVideoSize().width,a=this.getVideoSize().height;this.holeCanvas.width=r,this.holeCanvas.height=a,this.crosshairCanvas.width=r,this.crosshairCanvas.height=a,this.scaleForRetinaDisplay(this.crosshairCanvas);const s=r-2*this.props.configuration.style.strokeWidth,l=Math.max(20,(r-s)/2),c=Math.min(s,r-2*l),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=c,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-c/2;const d=(null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)+this.guidanceTextTopPadding||0,h=Math.max(10,null!==(n=null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)&&void 0!==n?n:0),f=a-h-Math.max(10,null!==(i=null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)&&void 0!==i?i:0)-d;this.holePosition.height>f?(this.holePosition.height=f,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=h):this.holePosition.y=h+(f-this.holePosition.height)/1.9;const p=this.holeCanvas.getContext("2d");p.save(),this.drawBackground(p),p.globalCompositeOperation="destination-out",this.drawHole();const m=this.crosshairCanvas.getContext("2d");m.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),p.restore(),m.restore()},this.drawBackground=t=>{const{width:e,height:n}=this.getVideoSize();t.clearRect(0,0,e,n),t.beginPath(),t.rect(0,0,e,n),t.fillStyle=r.b.getColorValue(this.props.configuration.overlayColor),t.fill()},this.drawHole=()=>{const t=this.holeCanvas.getContext("2d"),e=this.cornerRadius(),n=this.holePosition.x,o=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height;t.beginPath(),t.fillStyle="black",t.moveTo(n+e,o),t.arcTo(n+i,o,n+i,o+r,e),t.arcTo(n+i,o+r,n,o+r,e),t.arcTo(n,o+r,n,o,e),t.arcTo(n,o,n+i,o,e),t.closePath(),t.fill()},this.drawCrosshair=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x+this.holePosition.width/2,n=this.holePosition.y+this.holePosition.height/2;t.beginPath(),t.moveTo(e-10,n),t.lineTo(e+10,n),t.moveTo(e,n-10),t.lineTo(e,n+10),t.strokeStyle="white",t.fillStyle="white",t.lineWidth=1,t.stroke()},this.drawHoleCorners=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,a=15,s=this.style.strokeWidth,l=this.cornerRadius();t.beginPath(),t.moveTo(e,n+a),t.arcTo(e,n,e+o,n,l),t.lineTo(e+a,n),t.moveTo(e+o-a,n),t.arcTo(e+o,n,e+o,n+i,l),t.lineTo(e+o,n+a),t.moveTo(e+o,n+i-a),t.arcTo(e+o,n+i,e,n+i,l),t.lineTo(e+o-a,n+i),t.moveTo(e,n+i-a),t.arcTo(e,n+i,e+o,n+i,l),t.lineTo(e+a,n+i),t.strokeStyle=r.b.getColorValue(this.style.strokeColor),t.lineWidth=s,t.stroke()},this.drawHoleOutline=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,a=this.cornerRadius(),s=this.style.strokeWidth;t.beginPath(),t.moveTo(e+a,n),t.arcTo(e+o,n,e+o,n+i,a),t.moveTo(e+o,n+a),t.arcTo(e+o,n+i,e,n+i,a),t.moveTo(e+o-a,n+i),t.arcTo(e,n+i,e,n,a),t.moveTo(e,n+i-a),t.arcTo(e,n,e+o,n,a),t.strokeStyle=r.b.getColorValue(this.style.strokeColor),t.lineWidth=s,t.stroke()},this.guidanceTextTopPadding=20,this.render=()=>o.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",textAlign:"left"},onClick:t=>{const e=this.holePosition;t.clientX>this.holePosition.x&&t.clientX<e.x+e.width&&t.clientY>e.y&&t.clientY<e.y+e.height&&console.log("Clicked inside hole, possibly click events need to be diverted")}},o.default.createElement("canvas",{ref:t=>{this.holeCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),o.default.createElement("canvas",{ref:t=>{this.crosshairCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&o.default.createElement("div",{ref:t=>{this.guidanceText=t},style:{position:"absolute",display:"block",top:this.holePosition.y+this.holePosition.height+this.guidanceTextTopPadding,left:0,width:"100%",textAlign:"center"}},o.default.createElement(a.a,{style:{display:"inline-block",backgroundColor:r.b.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:r.b.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1},config:this.guidance.title}))),this.state={shouldUpdateCanvas:!0}}componentDidMount(){this.updateWindowSize(),this.resizeObserver.observe(this.holeCanvas)}componentWillUnmount(){this.resizeObserver.disconnect()}bottomOfGuidanceText(){var t,e;return this.holeRect.bottom()+(null!==(e=null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)&&void 0!==e?e:0)+this.guidanceTextTopPadding}get guidance(){return this.props.guidanceConfiguration}cornerRadius(){return Math.max(0,Math.min(this.style.cornerRadius,this.holePosition.width/2,this.holePosition.height/2))}}},function(t,e,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e<arguments.length;e++){var o=arguments[e];if(o){var r=typeof o;if("string"===r||"number"===r)t.push(o);else if(Array.isArray(o)){if(o.length){var a=i.apply(null,o);a&&t.push(a)}}else if("object"===r)if(o.toString===Object.prototype.toString)for(var s in o)n.call(o,s)&&o[s]&&t.push(s);else t.push(o.toString())}}return t.join(" ")}t.exports?(i.default=i,t.exports=i):void 0===(o=function(){return i}.apply(e,[]))||(t.exports=o)}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return Q})),n.d(e,"c",(function(){return tt})),n.d(e,"d",(function(){return nt})),n.d(e,"e",(function(){return et})),n.d(e,"f",(function(){return K})),n.d(e,"g",(function(){return J}));var o="-ms-",i="-moz-",r="-webkit-",a="comm",s="rule",l="decl",c="@keyframes",u=Math.abs,d=String.fromCharCode,h=Object.assign;function f(t){return t.trim()}function p(t,e){return(t=e.exec(t))?t[0]:t}function m(t,e,n){return t.replace(e,n)}function g(t,e,n){return t.indexOf(e,n)}function v(t,e){return 0|t.charCodeAt(e)}function A(t,e,n){return t.slice(e,n)}function b(t){return t.length}function y(t){return t.length}function C(t,e){return e.push(t),t}function S(t,e){return t.map(e).join("")}function w(t,e){return t.filter((function(t){return!p(t,e)}))}var x=1,E=1,L=0,_=0,O=0,T="";function k(t,e,n,o,i,r,a,s){return{value:t,root:e,parent:n,type:o,props:i,children:r,line:x,column:E,length:a,return:"",siblings:s}}function D(t,e){return h(k("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function P(t){for(;t.root;)t=D(t.root,{children:[t]});C(t,t.siblings)}function B(){return O=_<L?v(T,_++):0,E++,10===O&&(E=1,x++),O}function F(){return v(T,_)}function R(){return _}function I(t,e){return A(T,t,e)}function W(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function M(t){return x=E=1,L=b(T=t),_=0,[]}function j(t){return T="",t}function z(t){return f(I(_-1,U(91===t?t+2:40===t?t+1:t)))}function N(t){for(;(O=F())&&O<33;)B();return W(t)>2||W(O)>3?"":" "}function V(t,e){for(;--e&&B()&&!(O<48||O>102||O>57&&O<65||O>70&&O<97););return I(t,R()+(e<6&&32==F()&&32==B()))}function U(t){for(;B();)switch(O){case t:return _;case 34:case 39:34!==t&&39!==t&&U(O);break;case 40:41===t&&U(t);break;case 92:B()}return _}function H(t,e){for(;B()&&t+O!==57&&(t+O!==84||47!==F()););return"/*"+I(e,_-1)+"*"+d(47===t?t:B())}function G(t){for(;!W(F());)B();return I(t,_)}function Q(t){return j(Y("",null,null,null,[""],t=M(t),0,[0],t))}function Y(t,e,n,o,i,r,a,s,l){for(var c=0,h=0,f=a,p=0,A=0,y=0,S=1,w=1,L=1,k=0,D="",P=i,I=r,W=o,M=D;w;)switch(y=k,k=B()){case 40:if(108!=y&&58==v(M,f-1)){-1!=g(M+=m(z(k),"&","&\f"),"&\f",u(c?s[c-1]:0))&&(L=-1);break}case 34:case 39:case 91:M+=z(k);break;case 9:case 10:case 13:case 32:M+=N(y);break;case 92:M+=V(R()-1,7);continue;case 47:switch(F()){case 42:case 47:C(q(H(B(),R()),e,n,l),l);break;default:M+="/"}break;case 123*S:s[c++]=b(M)*L;case 125*S:case 59:case 0:switch(k){case 0:case 125:w=0;case 59+h:-1==L&&(M=m(M,/\f/g,"")),A>0&&b(M)-f&&C(A>32?X(M+";",o,n,f-1,l):X(m(M," ","")+";",o,n,f-2,l),l);break;case 59:M+=";";default:if(C(W=Z(M,e,n,c,h,i,s,D,P=[],I=[],f,r),r),123===k)if(0===h)Y(M,e,W,W,P,r,f,s,I);else switch(99===p&&110===v(M,3)?100:p){case 100:case 108:case 109:case 115:Y(t,W,W,o&&C(Z(t,W,W,0,0,i,s,D,i,P=[],f,I),I),i,I,f,s,o?P:I);break;default:Y(M,W,W,W,[""],I,0,s,I)}}c=h=A=0,S=L=1,D=M="",f=a;break;case 58:f=1+b(M),A=y;default:if(S<1)if(123==k)--S;else if(125==k&&0==S++&&125==(O=_>0?v(T,--_):0,E--,10===O&&(E=1,x--),O))continue;switch(M+=d(k),k*S){case 38:L=h>0?1:(M+="\f",-1);break;case 44:s[c++]=(b(M)-1)*L,L=1;break;case 64:45===F()&&(M+=z(B())),p=F(),h=f=b(D=M+=G(R())),k++;break;case 45:45===y&&2==b(M)&&(S=0)}}return r}function Z(t,e,n,o,i,r,a,l,c,d,h,p){for(var g=i-1,v=0===i?r:[""],b=y(v),C=0,S=0,w=0;C<o;++C)for(var x=0,E=A(t,g+1,g=u(S=a[C])),L=t;x<b;++x)(L=f(S>0?v[x]+" "+E:m(E,/&\f/g,v[x])))&&(c[w++]=L);return k(t,e,n,0===i?s:l,c,d,h,p)}function q(t,e,n,o){return k(t,e,n,a,d(O),A(t,2,-2),0,o)}function X(t,e,n,o,i){return k(t,e,n,l,A(t,0,o),A(t,o+1,-1),o,i)}function $(t,e,n){switch(function(t,e){return 45^v(t,0)?(((e<<2^v(t,0))<<2^v(t,1))<<2^v(t,2))<<2^v(t,3):0}(t,e)){case 5103:return r+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return r+t+t;case 4789:return i+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return r+t+i+t+o+t+t;case 5936:switch(v(t,e+11)){case 114:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return r+t+o+t+t;case 6165:return r+t+o+"flex-"+t+t;case 5187:return r+t+m(t,/(\w+).+(:[^]+)/,r+"box-$1$2"+o+"flex-$1$2")+t;case 5443:return r+t+o+"flex-item-"+m(t,/flex-|-self/g,"")+(p(t,/flex-|baseline/)?"":o+"grid-row-"+m(t,/flex-|-self/g,""))+t;case 4675:return r+t+o+"flex-line-pack"+m(t,/align-content|flex-|-self/g,"")+t;case 5548:return r+t+o+m(t,"shrink","negative")+t;case 5292:return r+t+o+m(t,"basis","preferred-size")+t;case 6060:return r+"box-"+m(t,"-grow","")+r+t+o+m(t,"grow","positive")+t;case 4554:return r+m(t,/([^-])(transform)/g,"$1"+r+"$2")+t;case 6187:return m(m(m(t,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),t,"")+t;case 5495:case 3959:return m(t,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return m(m(t,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+o+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+t+t;case 4200:if(!p(t,/flex-|baseline/))return o+"grid-column-align"+A(t,e)+t;break;case 2592:case 3360:return o+m(t,"template-","")+t;case 4384:case 3616:return n&&n.some((function(t,n){return e=n,p(t.props,/grid-\w+-end/)}))?~g(t+(n=n[e].value),"span",0)?t:o+m(t,"-start","")+t+o+"grid-row-span:"+(~g(n,"span",0)?p(n,/\d+/):+p(n,/\d+/)-+p(t,/\d+/))+";":o+m(t,"-start","")+t;case 4896:case 4128:return n&&n.some((function(t){return p(t.props,/grid-\w+-start/)}))?t:o+m(m(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return m(t,/(.+)-inline(.+)/,r+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(b(t)-1-e>6)switch(v(t,e+1)){case 109:if(45!==v(t,e+4))break;case 102:return m(t,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+i+(108==v(t,e+3)?"$3":"$2-$3"))+t;case 115:return~g(t,"stretch",0)?$(m(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return m(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,n,i,r,a,s,l){return o+n+":"+i+l+(r?o+n+"-span:"+(a?s:+s-+i)+l:"")+t}));case 4949:if(121===v(t,e+6))return m(t,":",":"+r)+t;break;case 6444:switch(v(t,45===v(t,14)?18:11)){case 120:return m(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+r+(45===v(t,14)?"inline-":"")+"box$3$1"+r+"$2$3$1"+o+"$2box$3")+t;case 100:return m(t,":",":"+o)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return m(t,"scroll-","scroll-snap-")+t}return t}function K(t,e){for(var n="",o=0;o<t.length;o++)n+=e(t[o],o,t,e)||"";return n}function J(t,e,n,o){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case l:return t.return=t.return||t.value;case a:return"";case c:return t.return=t.value+"{"+K(t.children,o)+"}";case s:if(!b(t.value=t.props.join(",")))return""}return b(n=K(t.children,o))?t.return=t.value+"{"+n+"}":""}function tt(t){var e=y(t);return function(n,o,i,r){for(var a="",s=0;s<e;s++)a+=t[s](n,o,i,r)||"";return a}}function et(t){return function(e){e.root||(e=e.return)&&t(e)}}function nt(t,e,n,i){if(t.length>-1&&!t.return)switch(t.type){case l:return void(t.return=$(t.value,t.length,n));case c:return K([D(t,{value:m(t.value,"@","@"+r)})],i);case s:if(t.length)return S(n=t.props,(function(e){switch(p(e,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":P(D(t,{props:[m(e,/:(read-\w+)/,":-moz-$1")]})),P(D(t,{props:[e]})),h(t,{props:w(n,i)});break;case"::placeholder":P(D(t,{props:[m(e,/:(plac\w+)/,":"+r+"input-$1")]})),P(D(t,{props:[m(e,/:(plac\w+)/,":-moz-$1")]})),P(D(t,{props:[m(e,/:(plac\w+)/,o+"input-$1")]})),P(D(t,{props:[e]})),h(t,{props:w(n,i)})}return""}))}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(1),i=n(7);class r extends i.a{constructor(t={}){super(),this.title=new o.j({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new o.c({text:"Cancel",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.d({color:"?sbColorOnPrimary"})}),void 0!==t.title&&(this.title=new o.j(t.title)),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.cancelButton&&(this.cancelButton=new o.c(t.cancelButton))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}));var o=n(6);function i(t,e,n){return Math.min(Math.max(t,e),n)}function r(t,e,n){return new o.a(i(t.x,-e/2,n.width-e/2),i(t.y,-e/2,n.height-e/2))}},function(t,e,n){"use strict";n.r(e),n.d(e,"BarcodeFormatConfigurationBase",(function(){return o})),n.d(e,"BarcodeFormatOneDConfigurationBase",(function(){return i})),n.d(e,"BarcodeFormatCodabarConfiguration",(function(){return l})),n.d(e,"BarcodeFormatCode11Configuration",(function(){return c})),n.d(e,"BarcodeFormatCode39Configuration",(function(){return u})),n.d(e,"BarcodeFormatCode93Configuration",(function(){return d})),n.d(e,"BarcodeFormatCode128Configuration",(function(){return h})),n.d(e,"BarcodeFormatCode2Of5Configuration",(function(){return f})),n.d(e,"BarcodeFormatDataBarConfiguration",(function(){return p})),n.d(e,"BarcodeFormatDataBarExpandedConfiguration",(function(){return m})),n.d(e,"BarcodeFormatDataBarLimitedConfiguration",(function(){return g})),n.d(e,"BarcodeFormatITFConfiguration",(function(){return v})),n.d(e,"BarcodeFormatMSIPlesseyConfiguration",(function(){return A})),n.d(e,"BarcodeFormatUpcEanConfiguration",(function(){return b})),n.d(e,"BarcodeFormatPharmaCodeConfiguration",(function(){return y})),n.d(e,"BarcodeFormatTwoDConfigurationBase",(function(){return r})),n.d(e,"BarcodeFormatAztecConfiguration",(function(){return C})),n.d(e,"BarcodeFormatQRCodeConfiguration",(function(){return S})),n.d(e,"BarcodeFormatPDF417Configuration",(function(){return w})),n.d(e,"BarcodeFormatMicroPDF417Configuration",(function(){return x})),n.d(e,"BarcodeFormatDataMatrixConfiguration",(function(){return E})),n.d(e,"BarcodeFormatMaxiCodeConfiguration",(function(){return L})),n.d(e,"BarcodeFormatFourStateConfigurationBase",(function(){return a})),n.d(e,"BarcodeFormatAustraliaPostConfiguration",(function(){return _})),n.d(e,"BarcodeFormatJapanPostConfiguration",(function(){return O})),n.d(e,"BarcodeFormatRoyalMailConfiguration",(function(){return T})),n.d(e,"BarcodeFormatRoyalTNTPostConfiguration",(function(){return k})),n.d(e,"BarcodeFormatUSPSIntelligentMailConfiguration",(function(){return D})),n.d(e,"BarcodeFormatPharmaCodeTwoTrackConfiguration",(function(){return P})),n.d(e,"BarcodeFormatGS1CompositeConfiguration",(function(){return B})),n.d(e,"BarcodeFormatCommonOneDConfiguration",(function(){return F})),n.d(e,"BarcodeFormatCommonTwoDConfiguration",(function(){return R})),n.d(e,"BarcodeFormatCommonFourStateConfiguration",(function(){return I})),n.d(e,"BarcodeFormatCommonConfiguration",(function(){return W}));var o,i,r,a,s=n(4);!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatCodabarConfiguration":return new l(t);case"BarcodeFormatCode11Configuration":return new c(t);case"BarcodeFormatCode39Configuration":return new u(t);case"BarcodeFormatCode93Configuration":return new d(t);case"BarcodeFormatCode128Configuration":return new h(t);case"BarcodeFormatCode2Of5Configuration":return new f(t);case"BarcodeFormatDataBarConfiguration":return new p(t);case"BarcodeFormatDataBarExpandedConfiguration":return new m(t);case"BarcodeFormatDataBarLimitedConfiguration":return new g(t);case"BarcodeFormatITFConfiguration":return new v(t);case"BarcodeFormatMSIPlesseyConfiguration":return new A(t);case"BarcodeFormatUpcEanConfiguration":return new b(t);case"BarcodeFormatPharmaCodeConfiguration":return new y(t);case"BarcodeFormatAztecConfiguration":return new C(t);case"BarcodeFormatQRCodeConfiguration":return new S(t);case"BarcodeFormatPDF417Configuration":return new w(t);case"BarcodeFormatMicroPDF417Configuration":return new x(t);case"BarcodeFormatDataMatrixConfiguration":return new E(t);case"BarcodeFormatMaxiCodeConfiguration":return new L(t);case"BarcodeFormatAustraliaPostConfiguration":return new _(t);case"BarcodeFormatJapanPostConfiguration":return new O(t);case"BarcodeFormatRoyalMailConfiguration":return new T(t);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(t);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new D(t);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new P(t);case"BarcodeFormatGS1CompositeConfiguration":return new B(t);case"BarcodeFormatCommonOneDConfiguration":return new F(t);case"BarcodeFormatCommonTwoDConfiguration":return new R(t);case"BarcodeFormatCommonFourStateConfiguration":return new I(t);case"BarcodeFormatCommonConfiguration":return new W(t);default:throw`Unknown child class name: ${e}`}}}(o||(o={})),function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatCodabarConfiguration":return new l(t);case"BarcodeFormatCode11Configuration":return new c(t);case"BarcodeFormatCode39Configuration":return new u(t);case"BarcodeFormatCode93Configuration":return new d(t);case"BarcodeFormatCode128Configuration":return new h(t);case"BarcodeFormatCode2Of5Configuration":return new f(t);case"BarcodeFormatDataBarConfiguration":return new p(t);case"BarcodeFormatDataBarExpandedConfiguration":return new m(t);case"BarcodeFormatDataBarLimitedConfiguration":return new g(t);case"BarcodeFormatITFConfiguration":return new v(t);case"BarcodeFormatMSIPlesseyConfiguration":return new A(t);case"BarcodeFormatUpcEanConfiguration":return new b(t);case"BarcodeFormatPharmaCodeConfiguration":return new y(t);default:throw`Unknown child class name: ${e}`}}}(i||(i={}));class l extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCodabarConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,this.returnStartEnd=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.returnStartEnd&&(this.returnStartEnd=t.returnStartEnd)}}class c extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode11Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksum=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.checksum&&(this.checksum=t.checksum)}}class u extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode39Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn=!0,this.tryCode39ExtendedMode=!1,this.useCode39CheckDigit=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.code32&&(this.code32=t.code32),void 0!==t.code39&&(this.code39=t.code39),void 0!==t.pzn&&(this.pzn=t.pzn),void 0!==t.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=t.tryCode39ExtendedMode),void 0!==t.useCode39CheckDigit&&(this.useCode39CheckDigit=t.useCode39CheckDigit)}}class d extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode93Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class h extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode128Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class f extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode2Of5Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.iata2of5=!0,this.code25=!1,this.industrial2of5=!0,this.useIATA2OF5Checksum=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.iata2of5&&(this.iata2of5=t.iata2of5),void 0!==t.code25&&(this.code25=t.code25),void 0!==t.industrial2of5&&(this.industrial2of5=t.industrial2of5),void 0!==t.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=t.useIATA2OF5Checksum)}}class p extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class m extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarExpandedConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class g extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarLimitedConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class v extends s.a{constructor(t={}){super(),this._type="BarcodeFormatITFConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class A extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMSIPlesseyConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksumAlgorithms=["MOD_10"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.checksumAlgorithms&&(this.checksumAlgorithms=t.checksumAlgorithms.map((t=>t)))}}class b extends s.a{constructor(t={}){super(),this._type="BarcodeFormatUpcEanConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.ean8=!0,this.ean13=!0,this.upca=!0,this.upce=!0,this.extensions="AllowAny",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.ean8&&(this.ean8=t.ean8),void 0!==t.ean13&&(this.ean13=t.ean13),void 0!==t.upca&&(this.upca=t.upca),void 0!==t.upce&&(this.upce=t.upce),void 0!==t.extensions&&(this.extensions=t.extensions)}}class y extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPharmaCodeConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumValue=16,this.allowNarrowBarsOnly=!1,this.allowWideBarsOnly=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumValue&&(this.minimumValue=t.minimumValue),void 0!==t.allowNarrowBarsOnly&&(this.allowNarrowBarsOnly=t.allowNarrowBarsOnly),void 0!==t.allowWideBarsOnly&&(this.allowWideBarsOnly=t.allowWideBarsOnly)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatAztecConfiguration":return new C(t);case"BarcodeFormatQRCodeConfiguration":return new S(t);case"BarcodeFormatPDF417Configuration":return new w(t);case"BarcodeFormatMicroPDF417Configuration":return new x(t);case"BarcodeFormatDataMatrixConfiguration":return new E(t);case"BarcodeFormatMaxiCodeConfiguration":return new L(t);default:throw`Unknown child class name: ${e}`}}}(r||(r={}));class C extends s.a{constructor(t={}){super(),this._type="BarcodeFormatAztecConfiguration",this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class S extends s.a{constructor(t={}){super(),this._type="BarcodeFormatQRCodeConfiguration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.qr=!0,this.microQr=!1,this.rmqr=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.qr&&(this.qr=t.qr),void 0!==t.microQr&&(this.microQr=t.microQr),void 0!==t.rmqr&&(this.rmqr=t.rmqr)}}class w extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPDF417Configuration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class x extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMicroPDF417Configuration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class E extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataMatrixConfiguration",this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class L extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMaxiCodeConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatAustraliaPostConfiguration":return new _(t);case"BarcodeFormatJapanPostConfiguration":return new O(t);case"BarcodeFormatRoyalMailConfiguration":return new T(t);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(t);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new D(t);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new P(t);default:throw`Unknown child class name: ${e}`}}}(a||(a={}));class _ extends s.a{constructor(t={}){super(),this._type="BarcodeFormatAustraliaPostConfiguration",this.regexFilter="",this.australiaPostCustomerFormat="ALPHA_NUMERIC",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=t.australiaPostCustomerFormat)}}class O extends s.a{constructor(t={}){super(),this._type="BarcodeFormatJapanPostConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class T extends s.a{constructor(t={}){super(),this._type="BarcodeFormatRoyalMailConfiguration",this.regexFilter="",this.stripCheckDigits=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits)}}class k extends s.a{constructor(t={}){super(),this._type="BarcodeFormatRoyalTNTPostConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class D extends s.a{constructor(t={}){super(),this._type="BarcodeFormatUSPSIntelligentMailConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class P extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPharmaCodeTwoTrackConfiguration",this.regexFilter="",this.minimumValue=364,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimumValue&&(this.minimumValue=t.minimumValue)}}class B extends s.a{constructor(t={}){super(),this._type="BarcodeFormatGS1CompositeConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class F extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonOneDConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class R extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonTwoDConfiguration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","DATA_MATRIX","MAXICODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class I extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonFourStateConfiguration",this.regexFilter="",this.formats=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class W extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}},function(t,e,n){"use strict";(function(t){function o(t,e=!1){const n=[];if(e)return n;return function t(e){if(e)if(e.constructor===ImageData)n.push(e.data.buffer);else if(e.constructor===ArrayBuffer)n.push(e);else if(ArrayBuffer.isView(e))n.push(e.buffer);else if(Array.isArray(e))for(let n=0;n<e.length;++n)t(e[n]);else if(e.constructor===Object)for(const n in e)e.hasOwnProperty(n)&&t(e[n])}(t),n}function i(t){return t.startsWith("http:")||t.startsWith("https:")}function r(){if("undefined"!=typeof t&&"undefined"!=typeof t.versions&&"undefined"!=typeof t.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(t){return!1}}function a(t){const{allowSimd:e=!0,allowThreads:n=!0}=t||{};let o="";if(e&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))}catch(t){return!1}}()){o+="-simd";n&&r()&&(o+="-threads")}return o}n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return a}))}).call(this,n(42))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(){this.values=new Map}}o.INSTANCE=new o},function(t,e,n){"use strict";n.r(e),n.d(e,"BarcodeItem",(function(){return a})),n.d(e,"BarcodeScannerConfiguration",(function(){return s})),n.d(e,"BarcodeScannerResult",(function(){return l}));var o=n(32),i=n(4),r=n(19);class a extends i.a{constructor(t={}){if(super(),this.format="NONE",this.isUpsideDown=!1,this.sourceImage=null,this.isGS1Message=!1,this.isGS1CompositePart=!1,this.dataBarStackSize=1,void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0!==t.format&&(this.format=t.format),void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=t.quad.map((t=>({x:t.x,y:t.y}))),void 0!==t.isUpsideDown&&(this.isUpsideDown=t.isUpsideDown),void 0!==t.sourceImage&&(this.sourceImage=null!=t.sourceImage?t.sourceImage:null),void 0===t.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=t.rawBytes,void 0===t.upcEanExtension)throw new Error("upcEanExtension must be present in constructor argument");if(this.upcEanExtension=t.upcEanExtension,void 0!==t.isGS1Message&&(this.isGS1Message=t.isGS1Message),void 0!==t.isGS1CompositePart&&(this.isGS1CompositePart=t.isGS1CompositePart),void 0!==t.dataBarStackSize&&(this.dataBarStackSize=t.dataBarStackSize),void 0===t.parsedDocument)throw new Error("parsedDocument must be present in constructor argument");this.parsedDocument=null!=t.parsedDocument?new r.GenericDocument(t.parsedDocument):null}}class s extends i.a{constructor(t={}){super(),this.barcodeFormatConfigurations=[new o.BarcodeFormatCommonConfiguration({})],this.acceptedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.onlyAcceptDocuments=!1,this.returnBarcodeImage=!0,this.engineMode="NEXT_GEN_LOW_POWER",this.live=!0,void 0!==t.barcodeFormatConfigurations&&(this.barcodeFormatConfigurations=t.barcodeFormatConfigurations.map((t=>o.BarcodeFormatConfigurationBase.From(t)))),void 0!==t.acceptedDocumentFormats&&(this.acceptedDocumentFormats=t.acceptedDocumentFormats.map((t=>t))),void 0!==t.onlyAcceptDocuments&&(this.onlyAcceptDocuments=t.onlyAcceptDocuments),void 0!==t.returnBarcodeImage&&(this.returnBarcodeImage=t.returnBarcodeImage),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.live&&(this.live=t.live)}}class l extends i.a{constructor(t={}){if(super(),void 0===t.barcodes)throw new Error("barcodes must be present in constructor argument");if(this.barcodes=t.barcodes.map((t=>new a(t))),void 0===t.success)throw new Error("success must be present in constructor argument");this.success=t.success}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(t,e,n){Object.keys(t).forEach((o=>{(null==n?void 0:n.includes(o))||(e[o]=t[o])}))}static mapValuesDeep(t,e){const n=t=>t&&"object"==typeof t&&!Array.isArray(t);Object.keys(t).forEach((i=>{i in e&&n(t[i])&&n(e[i])?o.mapValuesDeep(t[i],e[i]):e[i]=t[i]}))}static _fromJson(t,e){return this.mapValuesDeep(e,t),t}}},function(t,e,n){"use strict";var o,i=function(){return"undefined"==typeof o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=function(){var t={};return function(e){if("undefined"==typeof t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function s(t){for(var e=-1,n=0;n<a.length;n++)if(a[n].identifier===t){e=n;break}return e}function l(t,e){for(var n={},o=[],i=0;i<t.length;i++){var r=t[i],l=e.base?r[0]+e.base:r[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var d=s(u),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(h)):a.push({identifier:u,updater:g(h,e),references:1}),o.push(u)}return o}function c(t){var e=document.createElement("style"),o=t.attributes||{};if("undefined"==typeof o.nonce){var i=n.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(t){e.setAttribute(t,o[t])})),"function"==typeof t.insert)t.insert(e);else{var a=r(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var u,d=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function h(t,e,n,o){var i=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(t.styleSheet)t.styleSheet.cssText=d(e,i);else{var r=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(r,a[e]):t.appendChild(r)}}function f(t,e,n){var o=n.css,i=n.media,r=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}var p=null,m=0;function g(t,e){var n,o,i;if(e.singleton){var r=m++;n=p||(p=c(e)),o=h.bind(null,n,r,!1),i=h.bind(null,n,r,!0)}else n=c(e),o=f.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var n=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<n.length;o++){var i=s(n[o]);a[i].references--}for(var r=l(t,e),c=0;c<n.length;c++){var u=s(n[c]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,o){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(o)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(i[a]=!0)}for(var s=0;s<t.length;s++){var l=[].concat(t[s]);o&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),e.push(l))}},e}},function(t,e,n){"use strict";var o="6.0.0-dev.5";class i{}i.VERSION=o,i.CDN_PATH="https://cdn.jsdelivr.net/npm/scanbot-web-sdk@6.0.0-dev.5/bundle/",i.DEFAULT_WASM_FOLDER="bin/complete/",i.BUILD_WITH_UI=!1;var r=n(33);class a{constructor(t,e){this.errorInWorker=null,this.createProxy=t=>new Proxy({},{get:(e,n,o)=>(...e)=>this.post(n,e,t)}),this.handleUnrecoverableError=t=>{this.errorInWorker=t;for(const e in this.continuations)this.continuations[e].reject(t),delete this.continuations[e]},this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer");const{requestSuffix:n=""}=e||{},o=Object(r.c)(e),i=`${t}${t.endsWith("/")?"":"/"}ScanbotSDK.Core${o}.js${n}`;if(Object(r.d)(i)){const t=new Blob([`importScripts("${i}")`]);this.instance=new Worker(URL.createObjectURL(t))}else this.instance=new Worker(i);this.continuations={},this.nextTicketId=1,this.instance.onmessage=t=>{const{log:e,logError:n}=t.data;if(e)return void console.log(...e);if(n)return void console.error(...n);const{ticket:o,result:i,recoverableError:r,unrecoverableError:a}=t.data,s=this.continuations[o];if(!s)return;const{resolve:l,reject:c}=s;delete this.continuations[o],a?(c(a),this.handleUnrecoverableError(a)):r?c(r):l(i)},this.instance.onerror=t=>{this.handleUnrecoverableError(t.error)}}post(t,e,n){return this.errorInWorker?Promise.reject(this.errorInWorker):new Promise(((o,i)=>{const a=Object(r.b)(e,"copy"==n),s=this.nextTicketId++;this.continuations[s]={resolve:o,reject:i},this.instance.postMessage({command:t,args:e,ticket:s},a)}))}destroy(){this.instance.terminate()}}var s=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class l extends Error{}class c extends Error{}class u{constructor(t,e,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),t||(t=i.CDN_PATH+i.DEFAULT_WASM_FOLDER),this.core=new a(t,e),this.coreInitializationSuccessful=(()=>s(this,void 0,void 0,(function*(){if(yield this.core.copyArgs.initialize(...n)){let e;try{e=yield this.core.copyArgs.version()}catch(t){e="Error"}const n=i.VERSION;return e!==n?new c(`Version mismatch! \nVersion of ScanbotSDK.(ui2.)min.js is "${n}" \nbut the version of the loaded ScanbotSDK.Core*.js file is "${e}". \nThe ScanbotSDK.Core*.js file was loaded from ${t}.`):"OK"}return new l("WASM not initialized successfully. This can be due to an invalid license or problems loading the WASM file. Please check the console for more information.")})))()}awaitInitialized(){return s(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}createProxy(t){return new Proxy({},{get:(e,n,o)=>(...e)=>s(this,void 0,void 0,(function*(){const o=yield this.getCoreForCommand(n),i="copy"===t?o.copyArgs:o.transferArgs;return yield i[n](...e)}))})}getCoreForCommand(t=""){return s(this,void 0,void 0,(function*(){const e=yield this.coreInitializationSuccessful;if("OK"===e||"getLicenseInfo"===t&&e instanceof l)return this.core;throw e}))}destroy(){this.core.destroy(),this.core=void 0}}class d{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(t){const e=new d;return e.status=t.licenseStatus,e.description=t.description,e}}var h=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class f{constructor(t,e){this._sdk=t,this._pdfOperation=e}addPage(t,e="COPY_IMAGE"){return h(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);yield n.addPageToPdf(this._pdfOperation,t)}))}complete(){return h(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var p=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class m{constructor(t,e){this._sdk=t,this._tiffOperation=e}addPage(t,e={}){return p(this,void 0,void 0,(function*(){const{binarize:n="ENABLED_IF_BINARIZATION_FILTER_SET",consumeImage:o="COPY_IMAGE"}=e,i=this._sdk.getBridge(o);yield i.addPageToTiff(this._tiffOperation,t,n)}))}complete(){return p(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var g=n(21);class v{static toPixelSize(t){return t+"px"}static containsString(t,e){return!!t&&-1!==t.indexOf(e)}static copy(t){return JSON.parse(JSON.stringify(t))}static getProperty(t,e){if(t&&t.hasOwnProperty(e))return t[e]}static uuid(){let t="";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;for(let o=0;o<5;o++)t+=e.charAt(Math.floor(Math.random()*n));return t}}var A=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class b{static toDataUrl(t){return new Promise(((e,n)=>{const o=new Blob([t],{type:"image/jpeg"}),i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>n(i.error),i.readAsDataURL(o)}))}static getObjectFitSize(t,e,n=!0){const o=e.width/e.height,i=t.width/t.height;let r=0,a=0;(n?o>i:o<i)?(r=t.width,a=r/o):(a=t.height,r=a*o);const s=(t.width-r)/2,l=(t.height-a)/2;return new g.a(s,l,r,a)}static loadFromUrl(t){return new Promise(((e,n)=>{const o=document.createElement("img");o.src=t,o.onload=()=>A(this,void 0,void 0,(function*(){const t=document.createElement("canvas");t.width=o.width,t.height=o.height;const n=t.getContext("2d");n.drawImage(o,0,0);const i=n.getImageData(0,0,o.width,o.height);e(i)})),o.onerror=n}))}static saveImageData(t){const e=this.createImageDataCanvas(t),n=" ("+t.width+"x"+t.height+")";e.toBlob((t=>this.saveBlob(t,v.uuid()+n+".png")))}static createImageDataCanvas(t){const e=document.createElement("canvas");return e.className="scanbot-sdk-canvas-element",e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t,0,0),e}static saveBlob(t,e){let n=document.createElement("a");n.setAttribute("download",e);let o=URL.createObjectURL(t);n.setAttribute("href",o),n.click()}static convertImageDataWrapperToImageData(t){if(t)return new ImageData(t.data,t.width,t.height)}static wrapperToBase64(t){return b.createImageDataCanvas(b.convertImageDataWrapperToImageData(t)).toDataURL("image/png")}static toBase64(t){return A(this,void 0,void 0,(function*(){const e=yield new Promise((e=>{const n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(new Blob([t]))}));return e.slice(e.indexOf(",")+1)}))}}class y{saveImageAsJpeg(t,e){if(!t||0===t.length)return void console.log("Data cannot be null or empty");e||(e=v.uuid()+".jpeg");let n=new Blob([t],{type:"image/jpeg"});b.saveBlob(n,e)}isCameraSupported(){return!!navigator.mediaDevices}flash(){let t=this.findFlashElement();t.style.display="block",this.animateFlashOpacity("0.5",(()=>{this.animateFlashOpacity("0.0",(()=>{t.style.opacity="1.0",t.style.display="none"}))}))}findFlashElement(){return this.getOrCreateElement("flash",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","background-color":"#fff",display:"none","z-index":"5000"})}animateFlashOpacity(t,e){const n=this.getElementByClassName("flash");setTimeout((()=>{n.style.opacity=t,e()}),150)}getOrCreateElement(t,e){let n=this.getElementByClassName(t);return n||(this.createElement(t,e),n=this.getElementByClassName(t)),n}createElement(t,e){let n=document.createElement("div");n.className=t,n.style.cssText=this.cssToString(e),document.body.append(n)}cssToString(t){let e="";return Object.keys(t).forEach((n=>{e+=n+":"+t[n]+";"})),e}getElementByClassName(t){const e=document.getElementsByClassName(t);if(0!==e.length)return e[0]}}var C=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class S{constructor(t,e){this._sdk=t,this._mrzRecognizerToken=e}recognize(t,e="COPY_IMAGE"){return C(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.recognizeMRZ(yield this._mrzRecognizerToken,t)}))}recognizeURL(t){return C(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>C(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);e(r||void 0)}))}))}))}release(){return C(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._mrzRecognizerToken)}))}}var w=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class x{constructor(t,e){this._sdk=t,this._OcrEngineToken=e}performOcr(t,e="COPY_IMAGE"){return w(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.performOcr(this._OcrEngineToken,t)}))}recognizeURL(t){return w(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>w(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.performOcr(i);e(r)}))}))}))}release(){return w(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._OcrEngineToken)}))}}var E=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class L{constructor(t,e){this._sdk=t,this._textDataScannerToken=e}recognize(t,e="COPY_IMAGE"){return E(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.recognizeTextLine(yield this._textDataScannerToken,t)}))}cleanRecognitionQueue(){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanTextLineRecognitionQueue(yield this._textDataScannerToken)}))}recognizeURL(t){return E(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>E(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i,"CONSUME_IMAGE");r&&e(r)}))}))}))}release(){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._textDataScannerToken)}))}}var _=n(14),O=n(22),T=n(9);class k extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new T.GenericTextLineScannerTypes.ScannerConfiguration,this.onTextDetected=function(t){},this.finder.aspectRatio=new T.Geometry.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(t){const e=new k;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class D extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new T.GenericTextLineScannerTypes.ScannerConfiguration,this.onTextDetected=function(t){},this.finder.aspectRatio=new T.Geometry.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(t){const e=new D;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class P extends Error{constructor(t){super(t.description),this.name="LicenseError"}}class B{static throwIfMissingBuffer(t){B.throwIfMissing(t,"ImageBuffer may not be null")}static throwIfMissing(t,e){if(!t)throw new Error(e)}}var F=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class R{constructor(t,e){this._sdk=t,this._token=e}analyze(t,e="COPY_IMAGE"){return F(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const n=this._sdk.getBridge(e);return yield n.documentQualityAnalyzerAnalyze(this._token,t)}))}release(){return F(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._token)}))}}var I=n(16),W=n(0),M=n(43),j=n(13),z=n(3),N=n.n(z),V=n(5);const U="var(--1-sb-dvh, 1vh)";function H(){const t=Object(W.useMemo)((()=>{var t,e;return null===(e=null===(t=null===window||void 0===window?void 0:window.CSS)||void 0===t?void 0:t.supports)||void 0===e?void 0:e.call(t,"height: 100dvh")}),[]),e=()=>{var e=t?"1dvh":window.innerHeight/100+"px";document.documentElement.style.setProperty("--1-sb-dvh",e)};return Object(W.useEffect)((()=>{if(e(),!t)return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}})),null}var G=n(30),Q=n(11),Y=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function Z(t){const e=Object(W.useContext)(V.a).getColorValue,{styleConfig:n}=t,o=Y(t,["styleConfig"]),i=Object.assign(Object.assign({},t.style),{backgroundColor:e(n.fillColor),borderColor:e(n.strokeColor),borderWidth:n.strokeWidth,borderRadius:n.cornerRadius,borderStyle:"solid"});return W.default.createElement(z.Box,Object.assign({},o,{style:i}))}function q(t){var e;return t.visible?W.default.createElement(z.Button,{variant:"text",onClick:t.onClick,sx:Object.assign(Object.assign({flex:1},Object(Q.b)(t.foreground)),{textTransform:"none",fontSize:18,"&:hover, &:focus, &:active, &":{outline:"none",backgroundColor:"transparent"},px:0}),disableRipple:!0},W.default.createElement(Z,{styleConfig:Object.assign(Object.assign({},t.background),{cornerRadius:4}),sx:{borderStyle:"solid",px:"8px"}},null!==(e=t.icon)&&void 0!==e?e:null,V.b.getLocalizedBarcodeText(t.text))):W.default.createElement("div",{style:{display:"flex",flex:1}})}G.a;const X=W.default.createContext(null);function $(t){const e=t.mode,n="HIDDEN"===e?0:48;Object(W.useEffect)((()=>{if("HIDDEN"===e)return;const n=document.createElement("meta");return n.name="theme-color",n.content=V.b.getColorValue(t.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[e]);const o="SOLID"===e?0:n,i={height:n,remainingVisibleBodyHeight:"SOLID"===e?`calc(100 * ${U} - ${n}px)`:`calc(100 * ${U})`,minTopPaddingForContent:o,minTopPaddingForViewFinder:10+o},r="SOLID"===e?{backgroundColor:V.b.getColorValue(t.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${V.b.getColorValue(t.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return W.default.createElement(W.default.Fragment,null,"HIDDEN"!==e&&W.default.createElement(z.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},W.default.createElement(z.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},W.default.createElement(z.Box,{sx:{flex:1}},t.cancelButton.visible&&W.default.createElement(W.default.Fragment,null,W.default.createElement(q,Object.assign({onClick:t.onBackPress,icon:t.cancelButton.foreground.iconVisible&&W.default.createElement(N.a,{sx:{fontSize:12,mr:"5px"}})},t.cancelButton)))),W.default.createElement(z.Box,null,W.default.createElement(z.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},W.default.createElement(Q.a,{config:t.title}))),W.default.createElement(z.Box,{sx:{flex:1}}))),W.default.createElement(X.Provider,{value:i},t.children))}function K(t){return{textOverflow:"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`,overflow:"hidden",whiteSpace:t>1?"normal":"nowrap",display:t>1?"-webkit-box":"block"}}function J(t){if(t.loading)return W.default.createElement(z.Skeleton,{variant:"rounded",width:t.imageSize,height:t.imageSize,style:{borderRadius:8}});if(null===t.data.barcodeImage){const e={width:t.imageSize,height:t.imageSize,backgroundColor:"#E0E0E0",borderRadius:3};return W.default.createElement(z.Box,{sx:e})}const e={width:t.imageSize,height:t.imageSize,borderRadius:8};return W.default.createElement("img",{src:t.data.barcodeImage,alt:t.data.title,style:e})}function tt(t){var e,n;const o=(null===(e=t.barcodeMappedData)||void 0===e?void 0:e.state)||"LOADING",i=(null===(n=t.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!t||"LOADED"!==o,a=t.imageSize,s=t.barcodeTitle.visible||t.barcodeSubtitle.visible||t.counterForm,l=t.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:V.b.getColorValue(t.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}};return W.default.createElement(z.Box,{sx:{display:"flex"},"data-sb-barcode-info":"1"},t.barcodeImageVisible&&W.default.createElement(z.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},W.default.createElement(J,{data:i,imageSize:a,loading:r})),s&&W.default.createElement(z.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},t.barcodeTitle.visible&&W.default.createElement(z.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},W.default.createElement(z.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign({},K(t.maxNumberOfTitleLines)),Object(Q.b)(t.barcodeTitle))},r?W.default.createElement(z.Skeleton,{variant:"text"}):i.title),t.displayRightArrow&&!r&&W.default.createElement(N.a,{sx:{fontSize:16,fontWeight:"bold",color:V.b.getColorValue(t.barcodeTitle.color)}})),t.barcodeSubtitle.visible&&W.default.createElement(z.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},K(t.maxNumberOfSubtitleLines)),Object(Q.b)(t.barcodeSubtitle))},r?W.default.createElement(z.Skeleton,{variant:"text"}):i.subtitle),t.counterForm&&W.default.createElement(z.ButtonGroup,{variant:"outlined"},W.default.createElement(z.Button,{disabled:!t.counterForm.removeButtonEnabled,sx:l,style:{opacity:t.counterForm.removeButtonEnabled?1:.3},onClick:()=>t.counterForm.setCounter(t.counterForm.counter-1),disableRipple:!0},W.default.createElement(N.a,{sx:{color:V.b.getColorValue(t.counterForm.manualCountChangeColor)}})),W.default.createElement(z.Button,{sx:Object.assign(Object.assign({},l),{color:V.b.getColorValue(t.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:t.counterForm.onNumberClick,disableRipple:!0},t.counterForm.counter),W.default.createElement(z.Button,{disabled:!t.counterForm.addButtonEnabled,sx:l,style:{opacity:t.counterForm.addButtonEnabled?1:.3},onClick:()=>t.counterForm.setCounter(t.counterForm.counter+1),disableRipple:!0},W.default.createElement(N.a,{sx:{color:V.b.getColorValue(t.counterForm.manualCountChangeColor)}})))))}j.ButtonConfiguration;function et(t){const e=Object(W.useContext)(V.a).getColorValue;return t.visible?W.default.createElement(z.Button,{onClick:t.onClick,type:t.type,sx:Object.assign(Object.assign({},t.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:e(t.background.strokeColor),borderWidth:t.background.strokeWidth,backgroundColor:e(t.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},t.foreground.iconVisible&&t.icon&&W.default.createElement(t.icon,{sx:{color:e(t.foreground.color),pr:2}}),W.default.createElement(Q.a,{config:{visible:!0,text:t.text,color:t.foreground.color,useShadow:t.foreground.useShadow}})):null}var nt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function ot(t){var e,{modalOverlayColor:n}=t,o=nt(t,["modalOverlayColor"]);const i={backdrop:{style:{backgroundColor:V.b.getColorValue(n)}}},r=Object.assign(Object.assign({},o.PaperProps),{sx:Object.assign(Object.assign({},null===(e=o.PaperProps)||void 0===e?void 0:e.sx),{maxWidth:400})});return W.default.createElement(z.Dialog,Object.assign({},o,{componentsProps:i,PaperProps:r}))}function it(t){const e=Object(W.useContext)(V.a).getColorValue,n=!t.barcodeMappedData||"LOADED"!==t.barcodeMappedData.state,o={backgroundColor:e(n?t.sheetColorLoading:t.sheetColorLoaded)},[i,r]=W.default.useState(),a=Object(W.useRef)((()=>{}));Object(W.useEffect)((()=>{t.open&&r(!1)}),[t.open]);const s=()=>{a.current=t.handleCancel,r(!0)};return W.default.createElement(ot,{modalOverlayColor:t.modalOverlayColor,open:t.open&&!i,fullWidth:!0,TransitionProps:{onExited:()=>{i&&a.current()}},onClose:()=>{n||s()}},W.default.createElement(z.DialogContent,{style:o},W.default.createElement(tt,Object.assign({},t,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),W.default.createElement(z.DialogActions,{style:o},W.default.createElement(N.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},W.default.createElement(N.a,{item:!0,xs:12},W.default.createElement(N.a,{color:e(t.dividerColor)})),n?W.default.createElement(N.a,{item:!0,xs:12,sx:{textAlign:"center"}},W.default.createElement(z.Box,null,W.default.createElement(z.CircularProgress,{sx:{color:e(t.loadingMessage.color),verticalAlign:"middle",mr:2}}),W.default.createElement(Q.a,{config:t.loadingMessage}))):W.default.createElement(W.default.Fragment,null,W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},onClick:s},t.cancelButton))),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},onClick:()=>{a.current=t.handleSubmit,r(!0)}},t.submitButton)))))))}var rt=n(1);rt.h;function at(t){if(!1===t.visible)return null;const e={backgroundColor:t.active?V.b.getColorValue(t.activeBackgroundColor):V.b.getColorValue(t.backgroundColor),color:t.active?V.b.getColorValue(t.activeForegroundColor):V.b.getColorValue(t.foregroundColor)};return W.default.createElement(z.IconButton,{sx:Object.assign(Object.assign({},e),{"&:hover, &:focus":Object.assign({outline:"none"},e),width:48,height:48}),onClick:t.onClick},t.text&&W.default.createElement("span",{style:{fontSize:15}},V.b.getLocalizedBarcodeText(t.text)),t.icon&&W.default.createElement(t.icon,{style:{padding:7}}))}var st=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class lt{constructor(){this.audioFile=new Audio}initialize(t){return st(this,void 0,void 0,(function*(){t.successBeepEnabled&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAASCG1kYXQBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQEQfEIQGIQaqctMIv9EpiYforpaDbT80WfPFRSswKfd8cy6kN/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u//EKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaXfViFLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQQpRY6EYNCcKDAqAAEUgC2wFy0kF7JTgecsqIp6pxd/lHO7kUuSCLFK6n2mPOKfj5aKhQPOaRtBEKFS85eIYbr71AGaAPJTSIHeIhXTcpA5i155UICz3nXk0Cz0A8QhxIhoqQIJ2Be9MIEiJ6GpuMa1fPXcJmIoxDUKpZuJozBa6iFmjy7O/genSlwPKL6xaiiL8Y1XtgBDY7ke/CAOoawOqmZm6suSVQPbxzaxZJpWFcWva4RqTil72HqDpc2N4eG3KA0JkU8G58RNabxVq9gSLwysPKIzL1fZVF1FQwllEs4YUKpPtoMw2VtepdbZHqGriAsZ5Lu154uiewW41szI4RHfpWOWSH7s1LAzlv/xClpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl36AhS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vAA6jQEYVEIDEQDEKCAYhAIXMdbaI5q82OvhmYS1FO11cD3Yt4EwZI+aTsqoctJJaN0FKvNqorQmK3SUWpNOtf+uKNIxX3xeTEq8LKb/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u+GEKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpeABMDQD6WqsfRABwAUSib4c3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+EIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS8AAAO4bW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAAfgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAiJ0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAAfgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAH4AAAIAAABAAAAAAGabWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAfQAAAF8BVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABRW1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABCXN0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAAfQAAAAAAAM2VzZHMAAAAAA4CAgCIAAQAEgICAFEAVAAAAAAH0AAAAvXkFgICAAhWIBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAAAUAAAQAAAAAAQAAA8AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAYAAAABAAAAFHN0c3oAAAAAAAADAAAAAAYAAAAUc3RjbwAAAAAAAAABAAAALAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAAGAAAAAQAAASJ1ZHRhAAABGm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAA7Wlsc3QAAAAzqW5hbQAAACtkYXRhAAAAAQAAAAAyNTAgTWlsbGlzZWNvbmRzIG9mIFNpbGVuY2UAAAApqUFSVAAAACFkYXRhAAAAAQAAAABBbmFyIFNvZnR3YXJlIExMQwAAAClhQVJUAAAAIWRhdGEAAAABAAAAAEFuYXIgU29mdHdhcmUgTExDAAAAI6lhbGIAAAAbZGF0YQAAAAEAAAAAQmxhbmsgQXVkaW8AAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjAuMy4xMDAAAAAZY3BpbAAAABFkYXRhAAAAFQAAAAAA",yield this.play(),"MODERN_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAAEcm1kYXQBQCKAo30ghS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDmVAjh8QBrRiUH/88pKh3gJPmPt9t8oIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDsl6UY83aVqFeq3aVmmYyFp70/kJT+A9hdePd7Z7aRSFKZBhCUP6E1rS/9+DhfmhvTknCnQzE+QHVPD6rhSIRpGIAFmBioF1XkxwAQjxKkQMc+qECgXnCAU1IcgpFDnWo02EdihsnrUx/1bJAUo+x6//p8VmoS0iuleHvPnKj9mjjHOoaDGI/s2DHcYI66Grp+5pezZuKJExJOzoyJRdmv6ltO6ibTdTDZ1YqLauKTebYOtpTWnh3/K3kBQmN3NsieqxzHeZKNiFphWuYSWMhaHIZRnRt6O/WzTXYFGrG0wBT54NCQ3wtSpqr5dHbQN2yY0jcckhLUieNtOSjS3u1NuMqWbOx1zHwlHfJKgI349OU9iZEzeN3rCVbBVdrdcAEW9Cm2Ji2FjQNkiFBViV6ofFsNVeVqpKgpsf3/iWtBG6cpMqFHjy2QhyBEnPtwTbWbm9b1u7frF3bnaVykqieEvTKfqnCYL2u4g1CLiQ4Zb8hkkTL9tnGmdMOeqIkUcHZ0zsspzvHOUXJTlssZTRjqcIsp514HJO9YhVRXALKaCRKQkbMEty3CstONNYzuhq57bbccc+/Pq22226ueWXLLbTTw4bFIoQoGWepZBRJWQFh4yui2+evKOqLp+rLKJ4LKcAtQ7XA0aLCyMRVDDOmuoYcnFEmIrpzmRQNQIJ5HWvOesgzjrK071chBhESdztJ0sMqhdAAyjegdEYPNyA4BCDQtLGRRKQQBQIhXYqGZ65Pu1S7XMxxVXEOWtJGMAARETyDKiMN4tsmFfcvmo+sHuHZrY196169rbT/sHFGNK1cnJrBK2vDu7b0AsBd9VaKrsNHL/KxFHm3Yma/+S365yvTF+abktGk7JSrS++mXLBw76AiuijMPpwzPoP4jNzZjI+R/p7zboMSKiFvZkMx8CDIPGB+K2Ee7XaOqAu8z6cWgazCp76DdzIwsmGw2TiczmQMAafEX0U6lQOAA6jQJAfCsBrSxVH+Hw8fPKIpB7JuhzAB/BwAAAw9tb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAATwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACOnRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAATwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAE4AAAgAAAEAAAAAAbJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAVgFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAFdbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEhc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAQAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgABAASAgIAUQBUAAAAAARrvAAEa7wWAgIACEggGgICAAQIAAAAgc3R0cwAAAAAAAAACAAAABQAABAAAAAABAAABgAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAALkAAAC6AAABIAAAAQAAAAC9AAAAGgAAABRzdGNvAAAAAAAAAAEAAAAsAAAAGnNncGQBAAAAcm9sbAAAAAIAAAAB//8AAAAcc2JncAAAAAByb2xsAAAAAQAAAAYAAAABAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMA=="),"CLASSIC_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAAAAE00QSBtcDQyaXNvbQAAAAFtZGF0AAAAAAAACHchIANAaBv6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCFO4v////////gyh+L1JkJB36Cv0yBUdzB8/8/b8vveozPf+/6eH18deTh9kOp11urWAB5ZsMnhMwSjUCF2MQub4hybjxDhHACGof0XiT9tAHVOwt4NPtPOMFr/ndlTpTNXy79GYIfXP7VkPs99ySHNOFkpNrBS1pClU3rRGHp6Dy9FBIlk4KbBNBLGMJRcWQxuVsVJCSMnGw1FuIUrBN2UJLoEMhurMxpIiyGAweBvyfNJy4FbxqDm3WDjCtzP+3yVmOjxhIBDANLYyeG05LNyCZONEOk/c4hCj3Y2XQkgTI7y/39g0a+MuEoAdbRz4gSgRJnjEGB0TnOB0LtiL0XB9kwz2SwCBB0MvIByUSWTPTsRdCA4PvEmwnNdTnJT5/kPGk4swkTgOOuWJBI0EkxFs5mmNIR6wSFql36Hn03/Lf/uHp+6aTmBY0HJ6P6X1atw/Y8vK72LCWpsq0beo5KkrrrMe1eabaDyfZRPYfgPwH4Dv4CHU663VrAA8wchbBRlqQNnYNlYNhYNigNhoTBsTCcTCgLBEQCX+XfNd+3y+piKntTerXdXpDWRpLzsKmJ4iRM4ig+I6R65pDawx8Ry4cxfeifbsbzK/TxNhafR9y2zFVicy8nCVkU6CkmLckGtqbuYvhruBP0TriLNTU1TNhW6tUCdUSyneDUWAox5RTMlF2W1san5MQRlj7Btm2bZhoqoUUAJlpaat54WVuTyOxqwzNVhPenFR9KBpuA3qrUrT+3ShOUdXAkGXmCrMBxH3XmROdVSkS8cccRMOKTN+7OOEIQrMYIcna5hipAqPHk6VSgy0gGXljIk7GR/O606SyhhgglQIZLyxxOa/ZANmzZkyZMlRoqIt/T6xZHaFLcZ6n8jSgTVoOGsK5MvOlIBBkR+AtM5hvkTG2UzEhEAcsA7bZfCZmmZmZjQnqfn/yRwXzQtlZljFYd93mGppQSDDV/oz8HKkKjElN9Pu/inFmh3IHFyXlrJ/dodwM2EUkLZff1jWCO84wYUa3JB52yTMCETuUgA0BWB+I4hDBR1xoligVhgVhgNhYdBcLCcakAb1XLO/eZ9cUtvv6cNzrRYdMWgFvJySSSSscWFxCQElKcwc2dFkyos8dHfXPYFSt0klO2wUeIUxNKf5LiWYGm57bV0dipv7Qpw9uRRu23CuNIbT7++AuwEnyFWIQP0OpdUhc7u2k2fKW3mTZZxCSb+gVCjOzNf7LzxdBpbZxYwuNkcRlqAMdRMhq+tXmbLkMGGph20w4JvwvBm+x4Wtomh4lz0GGBVGQ96+JUXhvqQQAQPRTHtn+e7SwaCKMXnEEWXevaFVrPVEX7wxIBbbcpAHXj2DQz/vO9M0FHzyQFtegQjjn+fM99jgBE2fLJs/PLcErzrmCGJdVHZ19uxTErdmR6viG6cetew2MYQFm5AIDdPmjeXifvbFcjkYQWUsqKoBQJAKMp50hLtJRCKLCTSw2f7e0wzzhr6eGhjlyOQ8blgBiR0fxcjQYM5rBBM/wzuDe972u2f/mN7u8zVqGu7QADPHgAK4PxW8nJJJJLgISwUZaaRYmFRWRBEIwQKfmepncccZoqHnVy0WnFag51Yt48agPiK7D59zNlI+6YR9SHvnKoiJCcRzsskEGDgIrLQoLEgDguNTzeNvuxVpc8wntXmUlTQMa9WLn/geS8F7ku6Vt+I9yiumFP6I5hbEGeXac1BCB3YA3gNA0rLFPwrWq//VvtF6JGKIOVA12lCnpZl8NJojK1yqVsVKp+ZqbDpq0S1duspmvSvCbwmftOnwnfuNqBCnzZfzZF9fkqxTCqlq8GmR3bGK+1uvEcF55cGGx8BNANhkk1438/rWbXeTtPGfukvhUxZBp0M5447+2SFiQW674ySiGSRHgyqcqU0x39tbz3afnWt5BKNHDYj1lzq6sg8dcJlJnSQDUEba4npgEoAqVUkksoqM0UUO3VXDo3Mablwd2GLAoXjgK071swbuWhQJ2AjGYsBx5dtOMYCyPVh+K3jxqA+IuAhTrc+3KVqmDuVmIO5TZmQbDr4vUV+0338fXQ3665PiYnII1REb2klWhUcwjqi/pMe4yYZaDbo9T1ougUKE5h1jUim2NZxM71zBZVa/tWam6wXlmFVVHGuvL76pT3PUGufbO9YwevQzCvXhsabRuJyJjz8A1Haftmewy4gZ0FWlMIO5BoXB49j0TeIiikaxP9ZHcD9oI6x2H4DajNt5WgRXj6/H72V+gj2bgMDVkIZ36j1Tl+wdO6fvFsz56a5V6t9lS+gyWSOvuQP9bqtYgqWlsthXSFkrTfNqni6jSQ5vN9Fp1iYJODbUg8Sg0lYLbNEM7oqvrggxzq13IfO9hGQ0MQVpMIAR0aSGMFWOZzpJmXG1IcjppdZkINTYN2UvrHmGUrVBHvRuueFPuy2GzQoSnMCvkT3WvaR/LoVYw7Voy47wdJee2Va623AFXWNINOpByyoc9SQU4vPQ6X0PMBLQs6GdMlx+RlC3VoMDOryeFFolCTD8B+A/A4AAANKbW9vdgAAAGxtdmhkAAAAANcxfvfXMX73AACsRAAADbEAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAdx0cmFrAAAAXHRraGQAAAAB1zF+99cxfvcAAAABAAAAAAAADbEAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAF4bWRpYQAAACBtZGhkAAAAANcxfvfXMX73AACsRAAAGABVxAAAAAAAMWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABDb3JlIE1lZGlhIEF1ZGlvAAAAAR9taW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAONzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAAABICAgBRAFQAYAAAB9AAAAfQABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAAGAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAAP4AAAF+AAABjwAAAYQAAAFeAAABegAAABRzdGNvAAAAAAAAAAEAAAAsAAAA+nVkdGEAAADybWV0YQAAAAAAAAAiaGRscgAAAAAAAAAAbWRpcgAAAAAAAAAAAAAAAAAAAAAAxGlsc3QAAAC8LS0tLQAAABxtZWFuAAAAAGNvbS5hcHBsZS5pVHVuZXMAAAAUbmFtZQAAAABpVHVuU01QQgAAAIRkYXRhAAAAAQAAAAAgMDAwMDAwMDAgMDAwMDA4NDAgMDAwMDAyMEYgMDAwMDAwMDAwMDAwMERCMSAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMA=="))}))}beep(t){t.successBeepEnabled&&this.play()}play(){return st(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(t){}}))}}lt.INSTANCE=new lt;var ct=lt;class ut{constructor(){this.DURATION=200}vibrate(t){t.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}ut.INSTANCE=new ut;var dt=ut,ht=n(12),ft=n(23),pt=n(26),mt=n(24);class gt extends W.default.Component{constructor(t){super(t),this.state={base64Image:void 0}}render(){const t="x"+this.props.barcode.count;return W.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},W.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},W.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},W.default.createElement("div",{style:{flex:1}},this.props.barcode.text),W.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},t)),W.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}function vt(t,e){return t.format===e.format&&t.text===e.text}function At(t){return t.text+t.format}class bt extends W.default.Component{constructor(t){super(t),this.state={barcodes:this.toUniqueListWithDuplicateCounter(t.barcodes)}}toUniqueListWithDuplicateCounter(t){const e=[];return t.forEach((t=>{const n=e.findIndex((e=>vt(e,t)));-1===n?(t.count=1,e.push(t)):e[n].count++})),e}update(t){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(t)})}render(){return W.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((t,e)=>W.default.createElement(gt,{key:e,barcode:t,onClick:this.props.onClick}))))}}class yt{}yt.ScanbotPrimary="#c8193c",yt.LightGray="#F5F5F5",yt.Gray="#808080",yt.DarkGray="#333333",yt.Orange="#FF5533",yt.White="#FFFFFF",yt.TransparentGreen="rgba(0, 255, 0, 0.5)",yt.TransparentGray="rgba(50, 50, 50, 0.5)",yt.TransparentBlack="rgba(0, 0, 0, 0.3)",yt.SBNegative="#FF3737";var Ct,St=yt;!function(t){t[t.None=0]="None",t[t.PushRight=1]="PushRight",t[t.PushBottom=2]="PushBottom",t[t.Pop=3]="Pop"}(Ct||(Ct={}));class wt extends W.default.Component{constructor(t){super(t),this._isVisible=!1,this.state={animation:{type:Ct.None},elements:[]}}containerStyle(t){return{height:"100%",width:"100%",position:"absolute",top:"0",left:"0",zIndex:101,transform:t,overflow:"scroll"}}render(){var t,e,n;if(this.state.animation.type===Ct.None)return null;const o=this.animation(this.state.animation.type),i=this.to(this.state.animation.type);this.previousDestination=i;const r=this.props.style;return W.default.createElement(o,{style:this.containerStyle(`${i}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:t=>{this.reset()}},W.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:t=>{t.stopPropagation()}},W.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:St.ScanbotPrimary}},W.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},W.default.createElement("div",{style:{backgroundColor:St.White,height:3,width:33,borderRadius:5}})),W.default.createElement("div",{style:{display:"flex",height:50}},W.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:St.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),W.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:St.White,justifyContent:"center",alignItems:"center",fontWeight:500}},(null!==(e=null===(t=this.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)+" Codes"),W.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:St.White,justifyContent:"right",alignItems:"center",paddingRight:10}},W.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:t=>{t.stopPropagation(),this.reset()}},"×")))),W.default.createElement(bt,{ref:t=>{null!==t&&(this.list=t)},barcodes:null!==(n=this.barcodes)&&void 0!==n?n:[]})))}reset(){this.pop()}isVisible(){return this._isVisible}push(t,e){this._isVisible=!0,this.barcodes=e,this.updateAnimationType(t)}update(t){this.barcodes=t,this.forceUpdate()}pop(){this._isVisible=!1,this.updateAnimationType(Ct.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===Ct.Pop&&this.updateAnimationType(Ct.None)}updateAnimationType(t,e){this.setState({animation:{type:t}},e)}animation(t){let e=this.from(t),n=this.to(t);this.previousDestination===n&&(e=this.previousDestination,n=this.previousDestination);const o=mt.b`from {transform: ${e};} to {transform: ${n};}`;return mt.a.div`animation: ${o} 0.5s;`}from(t){if(t===Ct.PushRight)return this.translate("X",100);if(t===Ct.PushBottom)return this.translate("Y",100);if(t===Ct.Pop){const t=this.pushType===Ct.PushRight?"X":"Y";return this.translate(t,0)}}to(t){if(t===Ct.PushRight)return this.translate("X",0);if(t===Ct.PushBottom)return this.translate("Y",0);if(t===Ct.Pop){const t=this.pushType===Ct.PushRight?"X":"Y";return this.translate(t,100)}}translate(t,e){return"translate"+t+"("+e+"%)"}componentWillUnmount(){this._isVisible=!1}}var xt=n(2),Et=function(t){return{isEnabled:function(e){return t.some((function(t){return!!e[t]}))}}},Lt={measureLayout:Et(["layout","layoutId","drag","_layoutResetTransform"]),animation:Et(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:Et(["exit"]),drag:Et(["drag","dragControls"]),focus:Et(["whileFocus"]),hover:Et(["whileHover","onHoverStart","onHoverEnd"]),tap:Et(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Et(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:Et(["layout","layoutId"])};var _t=Object(W.createContext)({strict:!1}),Ot=Object.keys(Lt),Tt=Ot.length;var kt=Object(W.createContext)({transformPagePoint:function(t){return t},isStatic:!1}),Dt=Object(W.createContext)({});var Pt=Object(W.createContext)(null);function Bt(t){var e=Object(W.useRef)(null);return null===e.current&&(e.current=t()),e.current}function Ft(){var t=Object(W.useContext)(Pt);if(null===t)return[!0,null];var e=t.isPresent,n=t.onExitComplete,o=t.register,i=Mt();Object(W.useEffect)((function(){return o(i)}),[]);return!e&&n?[!1,function(){return null==n?void 0:n(i)}]:[!0]}function Rt(t){return null===t||t.isPresent}var It=0,Wt=function(){return It++},Mt=function(){return Bt(Wt)},jt=Object(W.createContext)(null),zt="undefined"!=typeof window,Nt=zt?W.useLayoutEffect:W.useEffect;function Vt(t,e,n,o){var i=Object(W.useContext)(kt),r=Object(W.useContext)(_t),a=Object(W.useContext)(Dt).visualElement,s=Object(W.useContext)(Pt),l=function(t){var e=t.layoutId,n=Object(W.useContext)(jt);return n&&void 0!==e?n+"-"+e:e}(n),c=Object(W.useRef)(void 0);o||(o=r.renderer),!c.current&&o&&(c.current=o(t,{visualState:e,parent:a,props:Object(xt.a)(Object(xt.a)({},n),{layoutId:l}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=c.current;return Nt((function(){u&&(u.setProps(Object(xt.a)(Object(xt.a)(Object(xt.a)({},i),n),{layoutId:l})),u.isPresent=Rt(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(W.useEffect)((function(){var t;u&&(null===(t=u.animationState)||void 0===t||t.animateChanges())})),Nt((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function Ut(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ht(t){return Array.isArray(t)}function Gt(t){return"string"==typeof t||Ht(t)}function Qt(t,e,n,o,i){var r;return void 0===o&&(o={}),void 0===i&&(i={}),"string"==typeof e&&(e=null===(r=t.variants)||void 0===r?void 0:r[e]),"function"==typeof e?e(null!=n?n:t.custom,o,i):e}function Yt(t,e,n){var o=t.getProps();return Qt(o,e,null!=n?n:o.custom,function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.get()})),e}(t),function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.getVelocity()})),e}(t))}function Zt(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||Gt(t.initial)||Gt(t.animate)||Gt(t.whileHover)||Gt(t.whileDrag)||Gt(t.whileTap)||Gt(t.whileFocus)||Gt(t.exit)}function qt(t){return Boolean(Zt(t)||t.variants)}function Xt(t,e){var n=function(t,e){if(Zt(t)){var n=t.initial,o=t.animate;return{initial:!1===n||Gt(n)?n:void 0,animate:Gt(o)?o:void 0}}return!1!==t.inherit?e:{}}(t,Object(W.useContext)(Dt)),o=n.initial,i=n.animate;return Object(W.useMemo)((function(){return{initial:o,animate:i}}),e?[$t(o),$t(i)]:[])}function $t(t){return Array.isArray(t)?t.join(" "):t}function Kt(t){var e=t.preloadedFeatures,n=t.createVisualElement,o=t.useRender,i=t.useVisualState,r=t.Component;return e&&function(t){for(var e in t){var n=t[e];null!==n&&(Lt[e].Component=n)}}(e),Object(W.forwardRef)((function(t,e){var a=Object(W.useContext)(kt).isStatic,s=null,l=Xt(t,a),c=i(t,a);return!a&&zt&&(l.visualElement=Vt(r,c,t,n),s=function(t,e,n){var o=[];if(Object(W.useContext)(_t),!e)return null;for(var i=0;i<Tt;i++){var r=Ot[i],a=Lt[r],s=a.isEnabled,l=a.Component;s(t)&&l&&o.push(W.createElement(l,Object(xt.a)({key:r},t,{visualElement:e})))}return o}(t,l.visualElement)),W.createElement(W.Fragment,null,W.createElement(Dt.Provider,{value:l},o(r,t,function(t,e,n){return Object(W.useCallback)((function(o){var i;o&&(null===(i=t.mount)||void 0===i||i.call(t,o)),e&&(o?e.mount(o):e.unmount()),n&&("function"==typeof n?n(o):Ut(n)&&(n.current=o))}),[e])}(c,l.visualElement,e),c,a)),s)}))}function Jt(t){function e(e,n){return void 0===n&&(n={}),Kt(t(e,n))}var n=new Map;return new Proxy(e,{get:function(t,o){return n.has(o)||n.set(o,e(o)),n.get(o)}})}var te=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function ee(t){return"string"==typeof t&&!t.includes("-")&&!!(te.indexOf(t)>-1||/[A-Z]/.test(t))}var ne={};var oe=["","X","Y","Z"],ie=["transformPerspective","x","y","z"];function re(t,e){return ie.indexOf(t)-ie.indexOf(e)}["translate","scale","rotate","skew"].forEach((function(t){return oe.forEach((function(e){return ie.push(t+e)}))}));var ae=new Set(ie);function se(t){return ae.has(t)}var le=new Set(["originX","originY","originZ"]);function ce(t){return le.has(t)}function ue(t,e){var n=e.layout,o=e.layoutId;return se(t)||ce(t)||(n||void 0!==o)&&(!!ne[t]||"opacity"===t)}var de=function(t){return null!==t&&"object"==typeof t&&t.getVelocity},he={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function fe(t){return t.startsWith("--")}var pe=function(t,e){return e&&"number"==typeof t?e.transform(t):t},me=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},ge=function(t){return t%1?Number(t.toFixed(5)):t},ve=/(-)?([\d]*\.?[\d])+/g,Ae=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,be=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function ye(t){return"string"==typeof t}var Ce=function(t){return{test:function(e){return ye(e)&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},Se=Ce("deg"),we=Ce("%"),xe=Ce("px"),Ee=Ce("vh"),Le=Ce("vw"),_e=Object(xt.a)(Object(xt.a)({},we),{parse:function(t){return we.parse(t)/100},transform:function(t){return we.transform(100*t)}}),Oe={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},Te=Object(xt.a)(Object(xt.a)({},Oe),{transform:me(0,1)}),ke=Object(xt.a)(Object(xt.a)({},Oe),{default:1}),De=Object(xt.a)(Object(xt.a)({},Oe),{transform:Math.round}),Pe={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,size:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,rotate:Se,rotateX:Se,rotateY:Se,rotateZ:Se,scale:ke,scaleX:ke,scaleY:ke,scaleZ:ke,skew:Se,skewX:Se,skewY:Se,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:Te,originX:_e,originY:_e,originZ:xe,zIndex:De,fillOpacity:Te,strokeOpacity:Te,numOctaves:De};function Be(t,e,n,o,i,r,a,s){var l,c=t.style,u=t.vars,d=t.transform,h=t.transformKeys,f=t.transformOrigin;h.length=0;var p=!1,m=!1,g=!0;for(var v in e){var A=e[v];if(fe(v))u[v]=A;else{var b=Pe[v],y=pe(A,b);if(se(v)){if(p=!0,d[v]=y,h.push(v),!g)continue;A!==(null!==(l=b.default)&&void 0!==l?l:0)&&(g=!1)}else if(ce(v))f[v]=y,m=!0;else if((null==n?void 0:n.isHydrated)&&(null==o?void 0:o.isHydrated)&&ne[v]){var C=ne[v].process(A,o,n),S=ne[v].applyTo;if(S)for(var w=S.length,x=0;x<w;x++)c[S[x]]=C;else c[v]=C}else c[v]=y}}o&&n&&a&&s?(c.transform=a(o.deltaFinal,o.treeScale,p?d:void 0),r&&(c.transform=r(d,c.transform)),c.transformOrigin=s(o)):(p&&(c.transform=function(t,e,n,o){var i=t.transform,r=t.transformKeys,a=e.enableHardwareAcceleration,s=void 0===a||a,l=e.allowTransformNone,c=void 0===l||l,u="";r.sort(re);for(var d=!1,h=r.length,f=0;f<h;f++){var p=r[f];u+=(he[p]||p)+"("+i[p]+") ","z"===p&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),o?u=o(i,n?"":u):c&&n&&(u="none"),u}(t,i,g,r)),m&&(c.transformOrigin=function(t){var e=t.originX,n=void 0===e?"50%":e,o=t.originY,i=void 0===o?"50%":o,r=t.originZ;return n+" "+i+" "+(void 0===r?0:r)}(f)))}var Fe=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function Re(t,e,n){for(var o in e)de(e[o])||ue(o,n)||(t[o]=e[o])}function Ie(t,e,n){var o={};return Re(o,t.style||{},t),Object.assign(o,function(t,e,n){var o=t.transformTemplate;return Object(W.useMemo)((function(){var t={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};Be(t,e,void 0,void 0,{enableHardwareAcceleration:!n},o);var i=t.vars,r=t.style;return Object(xt.a)(Object(xt.a)({},i),r)}),[e])}(t,e,n)),t.transformValues&&(o=t.transformValues(o)),o}function We(t,e,n){var o={},i=Ie(t,e,n);return Boolean(t.drag)&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}var Me=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","_layoutResetTransform","onLayoutAnimationComplete","onViewportBoxUpdate","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover"]);function je(t){return Me.has(t)}var ze=function(t){return!je(t)};try{var Ne=n(49).default;ze=function(t){return t.startsWith("on")?!je(t):Ne(t)}}catch(t){}function Ve(t,e,n){return"string"==typeof t?t:xe.transform(e+n*t)}var Ue=function(t,e){return xe.transform(t*e)},He={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ge={offset:"strokeDashoffset",array:"strokeDasharray"};function Qe(t,e,n,o,i,r,a,s){var l=e.attrX,c=e.attrY,u=e.originX,d=e.originY,h=e.pathLength,f=e.pathSpacing,p=void 0===f?1:f,m=e.pathOffset,g=void 0===m?0:m;Be(t,Object(xt.d)(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,o,i,r,a,s),t.attrs=t.style,t.style={};var v=t.attrs,A=t.style,b=t.dimensions,y=t.totalPathLength;v.transform&&(b&&(A.transform=v.transform),delete v.transform),b&&(void 0!==u||void 0!==d||A.transform)&&(A.transformOrigin=function(t,e,n){return Ve(e,t.x,t.width)+" "+Ve(n,t.y,t.height)}(b,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==l&&(v.x=l),void 0!==c&&(v.y=c),void 0!==y&&void 0!==h&&function(t,e,n,o,i,r){void 0===o&&(o=1),void 0===i&&(i=0),void 0===r&&(r=!0);var a=r?He:Ge;t[a.offset]=Ue(-i,e);var s=Ue(n,e),l=Ue(o,e);t[a.array]=s+" "+l}(v,y,h,p,g,!1)}var Ye=function(){return Object(xt.a)(Object(xt.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function Ze(t,e){var n=Object(W.useMemo)((function(){var n=Ye();return Qe(n,e,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),Object(xt.a)(Object(xt.a)({},n.attrs),{style:Object(xt.a)({},n.style)})}),[e]);if(t.style){var o={};Re(o,t.style,t),n.style=Object(xt.a)(Object(xt.a)({},o),n.style)}return n}function qe(t){void 0===t&&(t=!1);return function(e,n,o,i,r){var a=i.latestValues,s=(ee(e)?Ze:We)(n,a,r),l=function(t,e,n){var o={};for(var i in t)(ze(i)||!0===n&&je(i)||!e&&!je(i))&&(o[i]=t[i]);return o}(n,"string"==typeof e,t),c=Object(xt.a)(Object(xt.a)(Object(xt.a)({},l),s),{ref:o});return Object(W.createElement)(e,c)}}var Xe=/([a-z])([A-Z])/g,$e=function(t){return t.replace(Xe,"$1-$2").toLowerCase()};function Ke(t,e){var n=e.style,o=e.vars;for(var i in Object.assign(t.style,n),o)t.style.setProperty(i,o[i])}var Je=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function tn(t,e){for(var n in Ke(t,e),e.attrs)t.setAttribute(Je.has(n)?n:$e(n),e.attrs[n])}function en(t){var e=t.style,n={};for(var o in e)(de(e[o])||ue(o,t))&&(n[o]=e[o]);return n}function nn(t){var e=en(t);for(var n in t){if(de(t[n]))e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function on(t){return"object"==typeof t&&"function"==typeof t.start}var rn=function(t){return Array.isArray(t)};function an(t){var e,n=de(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n}function sn(t,e,n,o){var i=t.scrapeMotionValuesFromProps,r=t.createRenderState,a=t.onMount,s={latestValues:cn(e,n,o,i),renderState:r()};return a&&(s.mount=function(t){return a(e,t,s)}),s}var ln=function(t){return function(e,n){var o=Object(W.useContext)(Dt),i=Object(W.useContext)(Pt);return n?sn(t,e,o,i):Bt((function(){return sn(t,e,o,i)}))}};function cn(t,e,n,o){var i={},r=!1===(null==n?void 0:n.initial),a=o(t);for(var s in a)i[s]=an(a[s]);var l=t.initial,c=t.animate,u=Zt(t),d=qt(t);e&&d&&!u&&!1!==t.inherit&&(null!=l||(l=e.initial),null!=c||(c=e.animate));var h=r||!1===l?c:l;h&&"boolean"!=typeof h&&!on(h)&&(Array.isArray(h)?h:[h]).forEach((function(e){var n=Qt(t,e);if(n){var o=n.transitionEnd;n.transition;var r=Object(xt.d)(n,["transitionEnd","transition"]);for(var a in r)i[a]=r[a];for(var a in o)i[a]=o[a]}}));return i}var un={useVisualState:ln({scrapeMotionValuesFromProps:nn,createRenderState:Ye,onMount:function(t,e,n){var o=n.renderState,i=n.latestValues;try{o.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){o.dimensions={x:0,y:0,width:0,height:0}}"path"===e.tagName&&(o.totalPathLength=e.getTotalLength()),Qe(o,i,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),tn(e,o)}})};var dn,hn={useVisualState:ln({scrapeMotionValuesFromProps:en,createRenderState:Fe})};function fn(t,e,n,o){var i=e.forwardMotionProps,r=void 0!==i&&i,a=ee(t)?un:hn;return Object(xt.a)(Object(xt.a)({},a),{preloadedFeatures:n,useRender:qe(r),createVisualElement:o,Component:t})}function pn(t,e,n,o){return t.addEventListener(e,n,o),function(){return t.removeEventListener(e,n,o)}}function mn(t,e,n,o){Object(W.useEffect)((function(){var i=t.current;if(n&&i)return pn(i,e,n,o)}),[t,e,n,o])}function gn(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function vn(t){return!!t.touches}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.Exit="exit"}(dn||(dn={}));var An={pageX:0,pageY:0};function bn(t,e){void 0===e&&(e="page");var n=t.touches[0]||t.changedTouches[0]||An;return{x:n[e+"X"],y:n[e+"Y"]}}function yn(t,e){return void 0===e&&(e="page"),{x:t[e+"X"],y:t[e+"Y"]}}function Cn(t,e){return void 0===e&&(e="page"),{point:vn(t)?bn(t,e):yn(t,e)}}var Sn=function(t,e){void 0===e&&(e=!1);var n,o=function(e){return t(e,Cn(e))};return e?(n=o,function(t){var e=t instanceof MouseEvent;(!e||e&&0===t.button)&&n(t)}):o},wn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},xn={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function En(t){return zt&&null===window.onpointerdown?t:zt&&null===window.ontouchstart?xn[t]:zt&&null===window.onmousedown?wn[t]:t}function Ln(t,e,n,o){return pn(t,En(e),Sn(n,"pointerdown"===e),o)}function _n(t,e,n,o){return mn(t,En(e),n&&Sn(n,"pointerdown"===e),o)}function On(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var Tn=On("dragHorizontal"),kn=On("dragVertical");function Dn(t){var e=!1;if("y"===t)e=kn();else if("x"===t)e=Tn();else{var n=Tn(),o=kn();n&&o?e=function(){n(),o()}:(n&&n(),o&&o())}return e}function Pn(){var t=Dn(!0);return!t||(t(),!1)}function Bn(t,e,n){return function(o,i){var r;gn(o)&&!Pn()&&(null==n||n(o,i),null===(r=t.animationState)||void 0===r||r.setActive(dn.Hover,e))}}var Fn=function(t,e){return!!e&&(t===e||Fn(t,e.parentElement))};function Rn(t){return Object(W.useEffect)((function(){return function(){return t()}}),[])}var In=function(t,e){return function(n){return e(t(n))}},Wn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(In)};var Mn=function(t){return function(e){return t(e),null}},jn={tap:Mn((function(t){var e=t.onTap,n=t.onTapStart,o=t.onTapCancel,i=t.whileTap,r=t.visualElement,a=e||n||o||i,s=Object(W.useRef)(!1),l=Object(W.useRef)(null);function c(){var t;null===(t=l.current)||void 0===t||t.call(l),l.current=null}function u(){var t;return c(),s.current=!1,null===(t=r.animationState)||void 0===t||t.setActive(dn.Tap,!1),!Pn()}function d(t,n){u()&&(Fn(r.getInstance(),t.target)?null==e||e(t,n):null==o||o(t,n))}function h(t,e){u()&&(null==o||o(t,e))}_n(r,"pointerdown",a?function(t,e){var o;c(),s.current||(s.current=!0,l.current=Wn(Ln(window,"pointerup",d),Ln(window,"pointercancel",h)),null==n||n(t,e),null===(o=r.animationState)||void 0===o||o.setActive(dn.Tap,!0))}:void 0),Rn(c)})),focus:Mn((function(t){var e=t.whileFocus,n=t.visualElement;mn(n,"focus",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(dn.Focus,!0)}:void 0),mn(n,"blur",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(dn.Focus,!1)}:void 0)})),hover:Mn((function(t){var e=t.onHoverStart,n=t.onHoverEnd,o=t.whileHover,i=t.visualElement;_n(i,"pointerenter",e||o?Bn(i,!0,e):void 0),_n(i,"pointerleave",n||o?Bn(i,!1,n):void 0)}))};function zn(t,e){if(!Array.isArray(e))return!1;var n=e.length;if(n!==t.length)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}var Nn=function(t,e,n){return Math.min(Math.max(n,t),e)},Vn=.001;function Un(t){var e,n,o=t.duration,i=void 0===o?800:o,r=t.bounce,a=void 0===r?.25:r,s=t.velocity,l=void 0===s?0:s,c=t.mass,u=void 0===c?1:c,d=1-a;d=Nn(.05,1,d),i=Nn(.01,10,i/1e3),d<1?(e=function(t){var e=t*d,n=e*i,o=e-l,r=Hn(t,d),a=Math.exp(-n);return Vn-o/r*a},n=function(t){var n=t*d*i,o=n*l+l,r=Math.pow(d,2)*Math.pow(t,2)*i,a=Math.exp(-n),s=Hn(Math.pow(t,2),d);return(-e(t)+Vn>0?-1:1)*((o-r)*a)/s}):(e=function(t){return Math.exp(-t*i)*((t-l)*i+1)-.001},n=function(t){return Math.exp(-t*i)*(i*i*(l-t))});var h=function(t,e,n){for(var o=n,i=1;i<12;i++)o-=t(o)/e(o);return o}(e,n,5/i);if(i*=1e3,isNaN(h))return{stiffness:100,damping:10,duration:i};var f=Math.pow(h,2)*u;return{stiffness:f,damping:2*d*Math.sqrt(u*f),duration:i}}function Hn(t,e){return t*Math.sqrt(1-e*e)}var Gn=["duration","bounce"],Qn=["stiffness","damping","mass"];function Yn(t,e){return e.some((function(e){return void 0!==t[e]}))}function Zn(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.restSpeed,a=void 0===r?2:r,s=t.restDelta,l=Object(xt.d)(t,["from","to","restSpeed","restDelta"]),c={done:!1,value:n},u=function(t){var e=Object(xt.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Yn(t,Qn)&&Yn(t,Gn)){var n=Un(t);(e=Object(xt.a)(Object(xt.a)(Object(xt.a)({},e),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return e}(l),d=u.stiffness,h=u.damping,f=u.mass,p=u.velocity,m=u.duration,g=u.isResolvedFromDuration,v=qn,A=qn;function b(){var t=p?-p/1e3:0,e=i-n,o=h/(2*Math.sqrt(d*f)),r=Math.sqrt(d/f)/1e3;if(null!=s||(s=Math.abs(i-n)<=1?.01:.4),o<1){var a=Hn(r,o);v=function(n){var s=Math.exp(-o*r*n);return i-s*((t+o*r*e)/a*Math.sin(a*n)+e*Math.cos(a*n))},A=function(n){var i=Math.exp(-o*r*n);return o*r*i*(Math.sin(a*n)*(t+o*r*e)/a+e*Math.cos(a*n))-i*(Math.cos(a*n)*(t+o*r*e)-a*e*Math.sin(a*n))}}else if(1===o)v=function(n){return i-Math.exp(-r*n)*(e+(t+r*e)*n)};else{var l=r*Math.sqrt(o*o-1);v=function(n){var a=Math.exp(-o*r*n),s=Math.min(l*n,300);return i-a*((t+o*r*e)*Math.sinh(s)+l*e*Math.cosh(s))/l}}}return b(),{next:function(t){var e=v(t);if(g)c.done=t>=m;else{var n=1e3*A(t),o=Math.abs(n)<=a,r=Math.abs(i-e)<=s;c.done=o&&r}return c.value=c.done?i:e,c},flipTarget:function(){var t;p=-p,n=(t=[i,n])[0],i=t[1],b()}}}Zn.needsInterpolation=function(t,e){return"string"==typeof t||"string"==typeof e};var qn=function(t){return 0},Xn=function(t,e,n){var o=e-t;return 0===o?1:(n-t)/o},$n=function(t,e,n){return-n*t+n*e+t},Kn=function(t,e){return function(n){return Boolean(ye(n)&&be.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e))}},Jn=function(t,e,n){return function(o){var i;if(!ye(o))return o;var r=o.match(ve),a=r[0],s=r[1],l=r[2],c=r[3];return(i={})[t]=parseFloat(a),i[e]=parseFloat(s),i[n]=parseFloat(l),i.alpha=void 0!==c?parseFloat(c):1,i}},to=me(0,255),eo=Object(xt.a)(Object(xt.a)({},Oe),{transform:function(t){return Math.round(to(t))}}),no={test:Kn("rgb","red"),parse:Jn("red","green","blue"),transform:function(t){var e=t.red,n=t.green,o=t.blue,i=t.alpha,r=void 0===i?1:i;return"rgba("+eo.transform(e)+", "+eo.transform(n)+", "+eo.transform(o)+", "+ge(Te.transform(r))+")"}};var oo={test:Kn("#"),parse:function(t){var e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:no.transform},io={test:Kn("hsl","hue"),parse:Jn("hue","saturation","lightness"),transform:function(t){var e=t.hue,n=t.saturation,o=t.lightness,i=t.alpha,r=void 0===i?1:i;return"hsla("+Math.round(e)+", "+we.transform(ge(n))+", "+we.transform(ge(o))+", "+ge(Te.transform(r))+")"}},ro=function(t,e,n){var o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},ao=[oo,no,io],so=function(t){return ao.find((function(e){return e.test(t)}))},lo=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},co=function(t,e){var n=so(t),o=so(e);lo(t),lo(e),n.transform,o.transform;var i=n.parse(t),r=o.parse(e),a=Object(xt.a)({},i),s=n===io?$n:ro;return function(t){for(var e in a)"alpha"!==e&&(a[e]=s(i[e],r[e],t));return a.alpha=$n(i.alpha,r.alpha,t),n.transform(a)}},uo={test:function(t){return no.test(t)||oo.test(t)||io.test(t)},parse:function(t){return no.test(t)?no.parse(t):io.test(t)?io.parse(t):oo.parse(t)},transform:function(t){return ye(t)?t:t.hasOwnProperty("red")?no.transform(t):io.transform(t)}},ho="${c}",fo="${n}";function po(t){var e=[],n=0,o=t.match(Ae);o&&(n=o.length,t=t.replace(Ae,ho),e.push.apply(e,o.map(uo.parse)));var i=t.match(ve);return i&&(t=t.replace(ve,fo),e.push.apply(e,i.map(Oe.parse))),{values:e,numColors:n,tokenised:t}}function mo(t){return po(t).values}function go(t){var e=po(t),n=e.values,o=e.numColors,i=e.tokenised,r=n.length;return function(t){for(var e=i,n=0;n<r;n++)e=e.replace(n<o?ho:fo,n<o?uo.transform(t[n]):ge(t[n]));return e}}var vo=function(t){return"number"==typeof t?0:t};var Ao={test:function(t){var e,n,o,i;return isNaN(t)&&ye(t)&&(null!==(n=null===(e=t.match(ve))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(Ae))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:mo,createTransformer:go,getAnimatableNone:function(t){var e=mo(t);return go(t)(e.map(vo))}},bo=function(t){return"number"==typeof t};function yo(t,e){return bo(t)?function(n){return $n(t,e,n)}:uo.test(t)?co(t,e):xo(t,e)}var Co=function(t,e){var n=Object(xt.e)([],t),o=n.length,i=t.map((function(t,n){return yo(t,e[n])}));return function(t){for(var e=0;e<o;e++)n[e]=i[e](t);return n}},So=function(t,e){var n=Object(xt.a)(Object(xt.a)({},t),e),o={};for(var i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=yo(t[i],e[i]));return function(t){for(var e in o)n[e]=o[e](t);return n}};function wo(t){for(var e=Ao.parse(t),n=e.length,o=0,i=0,r=0,a=0;a<n;a++)o||"number"==typeof e[a]?o++:void 0!==e[a].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}var xo=function(t,e){var n=Ao.createTransformer(e),o=wo(t),i=wo(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&(o.numNumbers,i.numNumbers),Wn(Co(o.parsed,i.parsed),n)},Eo=function(t,e){return function(n){return $n(t,e,n)}};function Lo(t,e,n){for(var o,i=[],r=n||("number"==typeof(o=t[0])?Eo:"string"==typeof o?uo.test(o)?co:xo:Array.isArray(o)?Co:"object"==typeof o?So:void 0),a=t.length-1,s=0;s<a;s++){var l=r(t[s],t[s+1]);if(e){var c=Array.isArray(e)?e[s]:e;l=Wn(c,l)}i.push(l)}return i}function _o(t,e,n){var o=void 0===n?{}:n,i=o.clamp,r=void 0===i||i,a=o.ease,s=o.mixer,l=t.length;e.length,!a||!Array.isArray(a)||a.length,t[0]>t[l-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=Lo(e,a,s),u=2===l?function(t,e){var n=t[0],o=t[1],i=e[0];return function(t){return i(Xn(n,o,t))}}(t,c):function(t,e){var n=t.length,o=n-1;return function(i){var r=0,a=!1;if(i<=t[0]?a=!0:i>=t[o]&&(r=o-1,a=!0),!a){for(var s=1;s<n&&!(t[s]>i||s===o);s++);r=s-1}var l=Xn(t[r],t[r+1],i);return e[r](l)}}(t,c);return r?function(e){return u(Nn(t[0],t[l-1],e))}:u}var Oo,To=function(t){return function(e){return 1-t(1-e)}},ko=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},Do=function(t){return function(e){return e*e*((t+1)*e-t)}},Po=function(t){return t},Bo=(Oo=2,function(t){return Math.pow(t,Oo)}),Fo=To(Bo),Ro=ko(Bo),Io=function(t){return 1-Math.sin(Math.acos(t))},Wo=To(Io),Mo=ko(Wo),jo=Do(1.525),zo=To(jo),No=ko(jo),Vo=function(t){var e=Do(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),Uo=function(t){if(1===t||0===t)return t;var e=t*t;return t<.36363636363636365?7.5625*e:t<.7272727272727273?9.075*e-9.9*t+3.4:t<.9?12.066481994459833*e-19.63545706371191*t+8.898060941828255:10.8*t*t-20.52*t+10.72},Ho=To(Uo);function Go(t,e){return t.map((function(){return e||Ro})).splice(0,t.length-1)}function Qo(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.ease,a=t.offset,s=t.duration,l=void 0===s?300:s,c={done:!1,value:n},u=Array.isArray(i)?i:[n,i],d=function(t,e){return t.map((function(t){return t*e}))}(a&&a.length===u.length?a:function(t){var e=t.length;return t.map((function(t,n){return 0!==n?n/(e-1):0}))}(u),l);function h(){return _o(d,u,{ease:Array.isArray(r)?r:Go(u,r)})}var f=h();return{next:function(t){return c.value=f(t),c.done=t>=l,c},flipTarget:function(){u.reverse(),f=h()}}}var Yo={keyframes:Qo,spring:Zn,decay:function(t){var e=t.velocity,n=void 0===e?0:e,o=t.from,i=void 0===o?0:o,r=t.power,a=void 0===r?.8:r,s=t.timeConstant,l=void 0===s?350:s,c=t.restDelta,u=void 0===c?.5:c,d=t.modifyTarget,h={done:!1,value:i},f=a*n,p=i+f,m=void 0===d?p:d(p);return m!==p&&(f=m-i),{next:function(t){var e=-f*Math.exp(-t/l);return h.done=!(e>u||e<-u),h.value=h.done?m:m+e,h},flipTarget:function(){}}}};var Zo=1/60*1e3,qo="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Xo="undefined"!=typeof window?function(t){return window.requestAnimationFrame(t)}:function(t){return setTimeout((function(){return t(qo())}),Zo)};var $o=!0,Ko=!1,Jo=!1,ti={delta:0,timestamp:0},ei=["read","update","preRender","render","postRender"],ni=ei.reduce((function(t,e){return t[e]=function(t){var e=[],n=[],o=0,i=!1,r=new WeakSet,a={schedule:function(t,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var l=s&&i,c=l?e:n;return a&&r.add(t),-1===c.indexOf(t)&&(c.push(t),l&&i&&(o=e.length)),t},cancel:function(t){var e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:function(s){var l;if(i=!0,e=(l=[n,e])[0],(n=l[1]).length=0,o=e.length)for(var c=0;c<o;c++){var u=e[c];u(s),r.has(u)&&(a.schedule(u),t())}i=!1}};return a}((function(){return Ko=!0})),t}),{}),oi=ei.reduce((function(t,e){var n=ni[e];return t[e]=function(t,e,o){return void 0===e&&(e=!1),void 0===o&&(o=!1),Ko||li(),n.schedule(t,e,o)},t}),{}),ii=ei.reduce((function(t,e){return t[e]=ni[e].cancel,t}),{}),ri=ei.reduce((function(t,e){return t[e]=function(){return ni[e].process(ti)},t}),{}),ai=function(t){return ni[t].process(ti)},si=function(t){Ko=!1,ti.delta=$o?Zo:Math.max(Math.min(t-ti.timestamp,40),1),ti.timestamp=t,Jo=!0,ei.forEach(ai),Jo=!1,Ko&&($o=!1,Xo(si))},li=function(){Ko=!0,$o=!0,Jo||Xo(si)},ci=function(){return ti},ui=oi;function di(t,e,n){return void 0===n&&(n=0),t-e-n}var hi=function(t){var e=function(e){var n=e.delta;return t(n)};return{start:function(){return ui.update(e,!0)},stop:function(){return ii.update(e)}}};function fi(t){var e,n,o,i,r,a=t.from,s=t.autoplay,l=void 0===s||s,c=t.driver,u=void 0===c?hi:c,d=t.elapsed,h=void 0===d?0:d,f=t.repeat,p=void 0===f?0:f,m=t.repeatType,g=void 0===m?"loop":m,v=t.repeatDelay,A=void 0===v?0:v,b=t.onPlay,y=t.onStop,C=t.onComplete,S=t.onRepeat,w=t.onUpdate,x=Object(xt.d)(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),E=x.to,L=0,_=x.duration,O=!1,T=!0,k=function(t){if(Array.isArray(t.to))return Qo;if(Yo[t.type])return Yo[t.type];var e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Qo:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Zn:Qo}(x);(null===(n=(e=k).needsInterpolation)||void 0===n?void 0:n.call(e,a,E))&&(r=_o([0,100],[a,E],{clamp:!1}),a=0,E=100);var D=k(Object(xt.a)(Object(xt.a)({},x),{from:a,to:E}));function P(){L++,"reverse"===g?h=function(t,e,n,o){return void 0===n&&(n=0),void 0===o&&(o=!0),o?di(e+-t,e,n):e-(t-e)+n}(h,_,A,T=L%2==0):(h=di(h,_,A),"mirror"===g&&D.flipTarget()),O=!1,S&&S()}function B(t){if(T||(t=-t),h+=t,!O){var e=D.next(Math.max(0,h));i=e.value,r&&(i=r(i)),O=T?e.done:h<=0}null==w||w(i),O&&(0===L&&(null!=_||(_=h)),L<p?function(t,e,n,o){return o?t>=e+n:t<=-n}(h,_,A,T)&&P():(o.stop(),C&&C()))}return l&&(null==b||b(),(o=u(B)).start()),{stop:function(){null==y||y(),o.stop()}}}function pi(t,e){return e?t*(1e3/e):0}var mi=function(t){return 1e3*t},gi=function(t,e){return 1-3*e+3*t},vi=function(t,e){return 3*e-6*t},Ai=function(t){return 3*t},bi=function(t,e,n){return((gi(e,n)*t+vi(e,n))*t+Ai(e))*t},yi=function(t,e,n){return 3*gi(e,n)*t*t+2*vi(e,n)*t+Ai(e)};var Ci=.1;function Si(t,e,n,o){if(t===e&&n===o)return Po;for(var i=new Float32Array(11),r=0;r<11;++r)i[r]=bi(r*Ci,t,n);function a(e){for(var o=0,r=1;10!==r&&i[r]<=e;++r)o+=Ci;--r;var a=o+(e-i[r])/(i[r+1]-i[r])*Ci,s=yi(a,t,n);return s>=.001?function(t,e,n,o){for(var i=0;i<8;++i){var r=yi(e,n,o);if(0===r)return e;e-=(bi(e,n,o)-t)/r}return e}(e,a,t,n):0===s?a:function(t,e,n,o,i){var r,a,s=0;do{(r=bi(a=e+(n-e)/2,o,i)-t)>0?n=a:e=a}while(Math.abs(r)>1e-7&&++s<10);return a}(e,o,o+Ci,t,n)}return function(t){return 0===t||1===t?t:bi(a(t),e,o)}}var wi={linear:Po,easeIn:Bo,easeInOut:Ro,easeOut:Fo,circIn:Io,circInOut:Mo,circOut:Wo,backIn:jo,backInOut:No,backOut:zo,anticipate:Vo,bounceIn:Ho,bounceInOut:function(t){return t<.5?.5*(1-Uo(1-2*t)):.5*Uo(2*t-1)+.5},bounceOut:Uo},xi=function(t){if(Array.isArray(t)){t.length;var e=Object(xt.c)(t,4);return Si(e[0],e[1],e[2],e[3])}return"string"==typeof t?wi[t]:t},Ei=function(t,e){return"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Ao.test(e)||e.startsWith("url(")))},Li=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},_i=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},Oi=function(){return{type:"keyframes",ease:"linear",duration:.3}},Ti=function(t){return{type:"keyframes",duration:.8,values:t}},ki={x:Li,y:Li,z:Li,rotate:Li,rotateX:Li,rotateY:Li,rotateZ:Li,scaleX:_i,scaleY:_i,scale:_i,opacity:Oi,backgroundColor:Oi,color:Oi,default:_i},Di=new Set(["brightness","contrast","saturate","opacity"]);function Pi(t){var e=t.slice(0,-1).split("("),n=e[0],o=e[1];if("drop-shadow"===n)return t;var i=(o.match(ve)||[])[0];if(!i)return t;var r=o.replace(i,""),a=Di.has(n)?1:0;return i!==o&&(a*=100),n+"("+a+r+")"}var Bi=/([a-z-]*)\(.*?\)/g,Fi=Object(xt.a)(Object(xt.a)({},Ao),{getAnimatableNone:function(t){var e=t.match(Bi);return e?e.map(Pi).join(" "):t}}),Ri=Object(xt.a)(Object(xt.a)({},Pe),{color:uo,backgroundColor:uo,outlineColor:uo,fill:uo,stroke:uo,borderColor:uo,borderTopColor:uo,borderRightColor:uo,borderBottomColor:uo,borderLeftColor:uo,filter:Fi,WebkitFilter:Fi}),Ii=function(t){return Ri[t]};function Wi(t,e){var n,o=Ii(t);return o!==Fi&&(o=Ao),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}function Mi(t){var e=t.ease,n=t.times,o=t.yoyo,i=t.flip,r=t.loop,a=Object(xt.d)(t,["ease","times","yoyo","flip","loop"]),s=Object(xt.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=mi(a.duration)),a.repeatDelay&&(s.repeatDelay=mi(a.repeatDelay)),e&&(s.ease=function(t){return Array.isArray(t)&&"number"!=typeof t[0]}(e)?e.map(xi):xi(e)),"tween"===a.type&&(s.type="keyframes"),(o||r||i)&&(!0,o?s.repeatType="reverse":r?s.repeatType="loop":i&&(s.repeatType="mirror"),s.repeat=r||o||i||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function ji(t,e,n){var o,i,r,a;return Array.isArray(e.to)&&(null!==(o=t.duration)&&void 0!==o||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=Object(xt.e)([],Object(xt.c)(t.to)),t.to[0]=t.from)}(e),function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.repeat,t.repeatType,t.repeatDelay,t.from;var e=Object(xt.d)(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=Object(xt.a)(Object(xt.a)({},t),(i=n,r=e.to,a=rn(r)?Ti:ki[i]||ki.default,Object(xt.a)({to:r},a(r))))),Object(xt.a)(Object(xt.a)({},e),Mi(t))}function zi(t,e,n,o,i){var r,a=Ui(o,t),s=null!==(r=a.from)&&void 0!==r?r:e.get(),l=Ei(t,n);"none"===s&&l&&"string"==typeof n?s=Wi(t,n):Ni(s)&&"string"==typeof n?s=Vi(n):!Array.isArray(n)&&Ni(n)&&"string"==typeof s&&(n=Vi(s));var c=Ei(t,s);return c&&l&&!1!==a.type?function(){var o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:function(t){return e.set(t)}};return"inertia"===a.type||"decay"===a.type?function(t){var e,n=t.from,o=void 0===n?0:n,i=t.velocity,r=void 0===i?0:i,a=t.min,s=t.max,l=t.power,c=void 0===l?.8:l,u=t.timeConstant,d=void 0===u?750:u,h=t.bounceStiffness,f=void 0===h?500:h,p=t.bounceDamping,m=void 0===p?10:p,g=t.restDelta,v=void 0===g?1:g,A=t.modifyTarget,b=t.driver,y=t.onUpdate,C=t.onComplete;function S(t){return void 0!==a&&t<a||void 0!==s&&t>s}function w(t){return void 0===a?s:void 0===s||Math.abs(a-t)<Math.abs(s-t)?a:s}function x(t){null==e||e.stop(),e=fi(Object(xt.a)(Object(xt.a)({},t),{driver:b,onUpdate:function(e){var n;null==y||y(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:C}))}function E(t){x(Object(xt.a)({type:"spring",stiffness:f,damping:m,restDelta:v},t))}if(S(o))E({from:o,velocity:r,to:w(o)});else{var L=c*r+o;"undefined"!=typeof A&&(L=A(L));var _,O,T=w(L),k=T===a?-1:1;x({type:"decay",from:o,velocity:r,timeConstant:d,power:c,restDelta:v,modifyTarget:A,onUpdate:S(L)?function(t){_=O,O=t,r=pi(t-_,ci().delta),(1===k&&t>T||-1===k&&t<T)&&E({from:t,to:T,velocity:r})}:void 0})}return{stop:function(){return null==e?void 0:e.stop()}}}(Object(xt.a)(Object(xt.a)({},o),a)):fi(Object(xt.a)(Object(xt.a)({},ji(a,o,t)),{onUpdate:function(t){var e;o.onUpdate(t),null===(e=a.onUpdate)||void 0===e||e.call(a,t)},onComplete:function(){var t;o.onComplete(),null===(t=a.onComplete)||void 0===t||t.call(a)}}))}:function(){var t;return e.set(n),i(),null===(t=null==a?void 0:a.onComplete)||void 0===t||t.call(a),{stop:function(){}}}}function Ni(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Vi(t){return"number"==typeof t?0:Wi("",t)}function Ui(t,e){return t[e]||t.default||t}function Hi(t,e,n,o){return void 0===o&&(o={}),e.start((function(i){var r,a,s=zi(t,e,n,o,i),l=function(t,e){var n;return null!==(n=(Ui(t,e)||{}).delay)&&void 0!==n?n:0}(o,t),c=function(){return a=s()};return l?r=setTimeout(c,mi(l)):c(),function(){clearTimeout(r),null==a||a.stop()}}))}function Gi(t,e){-1===t.indexOf(e)&&t.push(e)}function Qi(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var Yi=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var e=this;return Gi(this.subscriptions,t),function(){return Qi(e.subscriptions,t)}},t.prototype.notify=function(t,e,n){var o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(var i=0;i<o;i++){var r=this.subscriptions[i];r&&r(t,e,n)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),Zi=function(){function t(t){var e,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Yi,this.velocityUpdateSubscribers=new Yi,this.renderSubscribers=new Yi,this.canTrackVelocity=!1,this.updateAndNotify=function(t,e){void 0===e&&(e=!0),n.prev=n.current,n.current=t;var o=ci(),i=o.delta,r=o.timestamp;n.lastUpdated!==r&&(n.timeDelta=i,n.lastUpdated=r,ui.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),e&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return ui.postRender(n.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}return t.prototype.onChange=function(t){return this.updateSubscribers.add(t)},t.prototype.clearListeners=function(){this.updateSubscribers.clear()},t.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,e){void 0===e&&(e=!0),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?pi(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var e=this;return this.stop(),new Promise((function(n){e.hasAnimated=!0,e.stopAnimation=t(n)})).then((function(){return e.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},t}();function qi(t){return new Zi(t)}var Xi=function(t){return function(e){return e.test(t)}},$i=[Oe,xe,we,Se,Le,Ee,{test:function(t){return"auto"===t},parse:function(t){return t}}],Ki=function(t){return $i.find(Xi(t))},Ji=Object(xt.e)(Object(xt.e)([],Object(xt.c)($i)),[uo,Ao]),tr=function(t){return Ji.find(Xi(t))};function er(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,qi(n))}function nr(t,e){var n=Yt(t,e),o=n?t.makeTargetAnimatable(n,!1):{},i=o.transitionEnd,r=void 0===i?{}:i;o.transition;var a,s=Object(xt.d)(o,["transitionEnd","transition"]);for(var l in s=Object(xt.a)(Object(xt.a)({},s),r)){er(t,l,(a=s[l],rn(a)?a[a.length-1]||0:a))}}function or(t,e){if(e)return(e[t]||e.default||e).from}function ir(t,e,n){var o;void 0===n&&(n={});var i=Yt(t,e,n.custom),r=(i||{}).transition,a=void 0===r?t.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=i?function(){return rr(t,i,n)}:function(){return Promise.resolve()},l=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?function(o){void 0===o&&(o=0);var i=a.delayChildren,r=void 0===i?0:i,s=a.staggerChildren,l=a.staggerDirection;return function(t,e,n,o,i,r){void 0===n&&(n=0);void 0===o&&(o=0);void 0===i&&(i=1);var a=[],s=(t.variantChildren.size-1)*o,l=1===i?function(t){return void 0===t&&(t=0),t*o}:function(t){return void 0===t&&(t=0),s-t*o};return Array.from(t.variantChildren).sort(ar).forEach((function(t,o){a.push(ir(t,e,Object(xt.a)(Object(xt.a)({},r),{delay:n+l(o)})).then((function(){return t.notifyAnimationComplete(e)})))})),Promise.all(a)}(t,e,r+o,s,l,n)}:function(){return Promise.resolve()},c=a.when;if(c){var u=Object(xt.c)("beforeChildren"===c?[s,l]:[l,s],2),d=u[0],h=u[1];return d().then(h)}return Promise.all([s(),l(n.delay)])}function rr(t,e,n){var o,i=void 0===n?{}:n,r=i.delay,a=void 0===r?0:r,s=i.transitionOverride,l=i.type,c=t.makeTargetAnimatable(e),u=c.transition,d=void 0===u?t.getDefaultTransition():u,h=c.transitionEnd,f=Object(xt.d)(c,["transition","transitionEnd"]);s&&(d=s);var p=[],m=l&&(null===(o=t.animationState)||void 0===o?void 0:o.getState()[l]);for(var g in f){var v=t.getValue(g),A=f[g];if(!(!v||void 0===A||m&&sr(m,g))){var b=Hi(g,v,A,Object(xt.a)({delay:a},d));p.push(b)}}return Promise.all(p).then((function(){h&&nr(t,h)}))}function ar(t,e){return t.sortNodePosition(e)}function sr(t,e){var n=t.protectedKeys,o=t.needsAnimating,i=n.hasOwnProperty(e)&&!0!==o[e];return o[e]=!1,i}var lr=[dn.Animate,dn.Hover,dn.Tap,dn.Drag,dn.Focus,dn.Exit],cr=Object(xt.e)([],Object(xt.c)(lr)).reverse(),ur=lr.length;function dr(t){return function(e){return Promise.all(e.map((function(e){var n=e.animation,o=e.options;return function(t,e,n){var o;if(void 0===n&&(n={}),t.notifyAnimationStart(),Array.isArray(e)){var i=e.map((function(e){return ir(t,e,n)}));o=Promise.all(i)}else if("string"==typeof e)o=ir(t,e,n);else{var r="function"==typeof e?Yt(t,e,n.custom):e;o=rr(t,r,n)}return o.then((function(){return t.notifyAnimationComplete(e)}))}(t,n,o)})))}}function hr(t){var e,n=dr(t),o=((e={})[dn.Animate]=fr(!0),e[dn.Hover]=fr(),e[dn.Tap]=fr(),e[dn.Drag]=fr(),e[dn.Focus]=fr(),e[dn.Exit]=fr(),e),i={},r=!0,a=function(e,n){var o=Yt(t,n);if(o){o.transition;var i=o.transitionEnd,r=Object(xt.d)(o,["transition","transitionEnd"]);e=Object(xt.a)(Object(xt.a)(Object(xt.a)({},e),r),i)}return e};function s(e,s){for(var l,c=t.getProps(),u=t.getVariantContext(!0)||{},d=[],h=new Set,f={},p=1/0,m=function(n){var i=cr[n],m=o[i],g=null!==(l=c[i])&&void 0!==l?l:u[i],v=Gt(g),A=i===s?m.isActive:null;!1===A&&(p=n);var b=g===u[i]&&g!==c[i]&&v;if(b&&r&&t.manuallyAnimateOnMount&&(b=!1),m.protectedKeys=Object(xt.a)({},f),!m.isActive&&null===A||!g&&!m.prevProp||on(g)||"boolean"==typeof g)return"continue";var y=function(t,e){if("string"==typeof e)return e!==t;if(Ht(e))return!zn(e,t);return!1}(m.prevProp,g)||i===s&&m.isActive&&!b&&v||n>p&&v,C=Array.isArray(g)?g:[g],S=C.reduce(a,{});!1===A&&(S={});var w=m.prevResolvedValues,x=void 0===w?{}:w,E=Object(xt.a)(Object(xt.a)({},x),S),L=function(t){y=!0,h.delete(t),m.needsAnimating[t]=!0};for(var _ in E){var O=S[_],T=x[_];f.hasOwnProperty(_)||(O!==T?rn(O)&&rn(T)?zn(O,T)?m.protectedKeys[_]=!0:L(_):void 0!==O?L(_):h.add(_):void 0!==O&&h.has(_)?L(_):m.protectedKeys[_]=!0)}m.prevProp=g,m.prevResolvedValues=S,m.isActive&&(f=Object(xt.a)(Object(xt.a)({},f),S)),r&&t.blockInitialAnimation&&(y=!1),y&&!b&&d.push.apply(d,Object(xt.e)([],Object(xt.c)(C.map((function(t){return{animation:t,options:Object(xt.a)({type:i},e)}})))))},g=0;g<ur;g++)m(g);if(i=Object(xt.a)({},f),h.size){var v={};h.forEach((function(e){var n=t.getBaseTarget(e);void 0!==n&&(v[e]=n)})),d.push({animation:v})}var A=Boolean(d.length);return r&&!1===c.initial&&!t.manuallyAnimateOnMount&&(A=!1),r=!1,A?n(d):Promise.resolve()}return{isAnimated:function(t){return void 0!==i[t]},animateChanges:s,setActive:function(e,n,i){var r;return o[e].isActive===n?Promise.resolve():(null===(r=t.variantChildren)||void 0===r||r.forEach((function(t){var o;return null===(o=t.animationState)||void 0===o?void 0:o.setActive(e,n)})),o[e].isActive=n,s(i,e))},setAnimateFunction:function(e){n=e(t)},getState:function(){return o}}}function fr(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var pr={animation:Mn((function(t){var e=t.visualElement,n=t.animate;e.animationState||(e.animationState=hr(e)),on(n)&&Object(W.useEffect)((function(){return n.subscribe(e)}),[n])})),exit:Mn((function(t){var e=t.custom,n=t.visualElement,o=Object(xt.c)(Ft(),2),i=o[0],r=o[1],a=Object(W.useContext)(Pt);Object(W.useEffect)((function(){var t,o,s=null===(t=n.animationState)||void 0===t?void 0:t.setActive(dn.Exit,!i,{custom:null!==(o=null==a?void 0:a.custom)&&void 0!==o?o:e});!i&&(null==s||s.then(r))}),[i])}))},mr=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},gr=function(t){return mr(t)&&t.hasOwnProperty("z")},vr=function(t,e){return Math.abs(t-e)};function Ar(t,e){if(bo(t)&&bo(e))return vr(t,e);if(mr(t)&&mr(e)){var n=vr(t.x,e.x),o=vr(t.y,e.y),i=gr(t)&&gr(e)?vr(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}var br=function(){function t(t,e,n){var o=this,i=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(o.lastMoveEvent&&o.lastMoveEventInfo){var t=Sr(o.lastMoveEventInfo,o.history),e=null!==o.startEvent,n=Ar(t.offset,{x:0,y:0})>=3;if(e||n){var i=t.point,r=ci().timestamp;o.history.push(Object(xt.a)(Object(xt.a)({},i),{timestamp:r}));var a=o.handlers,s=a.onStart,l=a.onMove;e||(s&&s(o.lastMoveEvent,t),o.startEvent=o.lastMoveEvent),l&&l(o.lastMoveEvent,t)}}},this.handlePointerMove=function(t,e){o.lastMoveEvent=t,o.lastMoveEventInfo=yr(e,o.transformPagePoint),gn(t)&&0===t.buttons?o.handlePointerUp(t,e):ui.update(o.updatePoint,!0)},this.handlePointerUp=function(t,e){o.end();var n=o.handlers,i=n.onEnd,r=n.onSessionEnd,a=Sr(yr(e,o.transformPagePoint),o.history);o.startEvent&&i&&i(t,a),r&&r(t,a)},!(vn(t)&&t.touches.length>1)){this.handlers=e,this.transformPagePoint=i;var r=yr(Cn(t),this.transformPagePoint),a=r.point,s=ci().timestamp;this.history=[Object(xt.a)(Object(xt.a)({},a),{timestamp:s})];var l=e.onSessionStart;l&&l(t,Sr(r,this.history)),this.removeListeners=Wn(Ln(window,"pointermove",this.handlePointerMove),Ln(window,"pointerup",this.handlePointerUp),Ln(window,"pointercancel",this.handlePointerUp))}}return t.prototype.updateHandlers=function(t){this.handlers=t},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),ii.update(this.updatePoint)},t}();function yr(t,e){return e?{point:e(t.point)}:t}function Cr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Sr(t,e){var n=t.point;return{point:n,delta:Cr(n,xr(e)),offset:Cr(n,wr(e)),velocity:Er(e,.1)}}function wr(t){return t[0]}function xr(t){return t[t.length-1]}function Er(t,e){if(t.length<2)return{x:0,y:0};for(var n=t.length-1,o=null,i=xr(t);n>=0&&(o=t[n],!(i.timestamp-o.timestamp>mi(e)));)n--;if(!o)return{x:0,y:0};var r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Lr(t){return t}function _r(t){var e=t.top;return{x:{min:t.left,max:t.right},y:{min:e,max:t.bottom}}}var Or={translate:0,scale:1,origin:0,originPoint:0};function Tr(){return{x:Object(xt.a)({},Or),y:Object(xt.a)({},Or)}}function kr(t){return[t("x"),t("y")]}function Dr(t,e,n){var o=e.min,i=e.max;return void 0!==o&&t<o?t=n?$n(o,t,n.min):Math.max(t,o):void 0!==i&&t>i&&(t=n?$n(i,t,n.max):Math.min(t,i)),t}function Pr(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Br(t,e){var n,o=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&(o=(n=Object(xt.c)([i,o],2))[0],i=n[1]),{min:t.min+o,max:t.min+i}}function Fr(t,e,n){return{min:Rr(t,e),max:Rr(t,n)}}function Rr(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}function Ir(t,e){return _r(function(t,e){var n=t.top,o=t.left,i=t.bottom,r=t.right;void 0===e&&(e=Lr);var a=e({x:o,y:n}),s=e({x:r,y:i});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}function Wr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=.01),Ar(t,e)<n}function Mr(t){return t.max-t.min}function jr(t,e){var n=.5,o=Mr(t),i=Mr(e);return i>o?n=Xn(e.min,e.max-o,t.min):o>i&&(n=Xn(t.min,t.max-i,e.min)),Nn(0,1,n)}function zr(t,e,n,o){void 0===o&&(o=.5),t.origin=o,t.originPoint=$n(e.min,e.max,t.origin),t.scale=Mr(n)/Mr(e),Wr(t.scale,1,1e-4)&&(t.scale=1),t.translate=$n(n.min,n.max,t.origin)-t.originPoint,Wr(t.translate)&&(t.translate=0)}function Nr(t,e,n,o){zr(t.x,e.x,n.x,Vr(o.originX)),zr(t.y,e.y,n.y,Vr(o.originY))}function Vr(t){return"number"==typeof t?t:.5}function Ur(t,e,n){t.min=n.min+e.min,t.max=t.min+Mr(e)}var Hr=function(t,e){return t.depth-e.depth};function Gr(t){return t.projection.isEnabled||t.shouldResetTransform()}function Qr(t,e){void 0===e&&(e=[]);var n=t.parent;return n&&Qr(n,e),Gr(t)&&e.push(t),e}function Yr(t){if(!t.shouldResetTransform()){var e,n=t.getLayoutState();t.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=t.measureViewportBox(),n.layoutCorrected=(e=n.layout,{x:Object(xt.a)({},e.x),y:Object(xt.a)({},e.y)}),t.notifyLayoutMeasure(n.layout,t.prevViewportBox||n.layout),ui.update((function(){return t.rebaseProjectionTarget()}))}}function Zr(t,e){return{min:e.min-t.min,max:e.max-t.min}}function qr(t,e){return{x:Zr(t.x,e.x),y:Zr(t.y,e.y)}}function Xr(t,e){var n=t.getLayoutId(),o=e.getLayoutId();return n!==o||void 0===o&&t!==e}function $r(t){var e=t.getProps(),n=e.drag,o=e._dragX;return n&&!o}function Kr(t,e){t.min=e.min,t.max=e.max}function Jr(t,e,n){return n+e*(t-n)}function ta(t,e,n,o,i){return void 0!==i&&(t=Jr(t,i,o)),Jr(t,n,o)+e}function ea(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),t.min=ta(t.min,e,n,o,i),t.max=ta(t.max,e,n,o,i)}function na(t,e){var n=e.x,o=e.y;ea(t.x,n.translate,n.scale,n.originPoint),ea(t.y,o.translate,o.scale,o.originPoint)}function oa(t,e,n,o){var i=Object(xt.c)(o,3),r=i[0],a=i[1],s=i[2];t.min=e.min,t.max=e.max;var l=void 0!==n[s]?n[s]:.5,c=$n(e.min,e.max,l);ea(t,n[r],n[a],c,n.scale)}var ia=["x","scaleX","originX"],ra=["y","scaleY","originY"];function aa(t,e,n){oa(t.x,e.x,n,ia),oa(t.y,e.y,n,ra)}function sa(t,e,n,o,i){return t=Jr(t-=e,1/n,o),void 0!==i&&(t=Jr(t,1/i,o)),t}function la(t,e,n){var o=Object(xt.c)(n,3),i=o[0],r=o[1],a=o[2];!function(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),void 0===o&&(o=.5);var r=$n(t.min,t.max,o)-e;t.min=sa(t.min,e,n,r,i),t.max=sa(t.max,e,n,r,i)}(t,e[i],e[r],e[a],e.scale)}function ca(t,e){la(t.x,e,ia),la(t.y,e,ra)}var ua=new Set;function da(t,e,n){t[n]||(t[n]=[]),t[n].push(e)}function ha(t){return ua.add(t),function(){return ua.delete(t)}}function fa(){if(ua.size){var t=0,e=[[]],n=[],o=function(n){return da(e,n,t)},i=function(e){da(n,e,t),t++};ua.forEach((function(e){e(o,i),t=0})),ua.clear();for(var r=n.length,a=0;a<=r;a++)e[a]&&e[a].forEach(ma),n[a]&&n[a].forEach(ma)}}var pa,ma=function(t){return t()},ga=new WeakMap,va=function(){function t(t){var e=t.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=e,this.visualElement.enableLayoutProjection(),ga.set(e,this)}return t.prototype.start=function(t,e){var n=this,o=void 0===e?{}:e,i=o.snapToCursor,r=void 0!==i&&i,a=o.cursorProgress,s=this.props.transformPagePoint;this.panSession=new br(t,{onSessionStart:function(t){var e;n.stopMotion();var o=function(t){return Cn(t,"client")}(t).point;null===(e=n.cancelLayout)||void 0===e||e.call(n),n.cancelLayout=ha((function(t,e){var i=Qr(n.visualElement),s=function(t){var e=[],n=function(t){Gr(t)&&e.push(t),t.children.forEach(n)};return t.children.forEach(n),e.sort(Hr)}(n.visualElement),l=Object(xt.e)(Object(xt.e)([],Object(xt.c)(i)),Object(xt.c)(s)),c=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),e((function(){l.forEach((function(t){return t.resetTransform()}))})),t((function(){Yr(n.visualElement),s.forEach(Yr)})),e((function(){l.forEach((function(t){return t.restoreTransform()})),r&&(c=n.snapToCursor(o))})),t((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var t=n.visualElement.projection;kr((function(e){if(!c){var i=t.target[e],r=i.min,s=i.max;n.cursorProgress[e]=a?a[e]:Xn(r,s,o[e])}var l=n.getAxisMotionValue(e);l&&(n.originPoint[e]=l.get())}))})),e((function(){ri.update(),ri.preRender(),ri.render(),ri.postRender()})),t((function(){return n.resolveDragConstraints()}))}))},onStart:function(t,e){var o,i,r,a=n.props,s=a.drag,l=a.dragPropagation;(!s||l||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Dn(s),n.openGlobalLock))&&(fa(),n.isDragging=!0,n.currentDirection=null,null===(i=(o=n.props).onDragStart)||void 0===i||i.call(o,t,e),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(dn.Drag,!0))},onMove:function(t,e){var o,i,r,a,s=n.props,l=s.dragPropagation,c=s.dragDirectionLock;if(l||n.openGlobalLock){var u=e.offset;if(c&&null===n.currentDirection)return n.currentDirection=function(t,e){void 0===e&&(e=10);var n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(u),void(null!==n.currentDirection&&(null===(i=(o=n.props).onDirectionLock)||void 0===i||i.call(o,n.currentDirection)));n.updateAxis("x",e.point,u),n.updateAxis("y",e.point,u),null===(a=(r=n.props).onDrag)||void 0===a||a.call(r,t,e),pa=t}},onSessionEnd:function(t,e){return n.stop(t,e)}},{transformPagePoint:s})},t.prototype.resolveDragConstraints=function(){var t=this,e=this.props,n=e.dragConstraints,o=e.dragElastic,i=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(Ut(n)?this.resolveRefConstraints(i,n):function(t,e){var n=e.top,o=e.left,i=e.bottom,r=e.right;return{x:Pr(t.x,o,r),y:Pr(t.y,n,i)}}(i,n)),this.elastic=function(t){return!1===t?t=0:!0===t&&(t=.35),{x:Fr(t,"left","right"),y:Fr(t,"top","bottom")}}(o),this.constraints&&!this.hasMutatedConstraints&&kr((function(e){t.getAxisMotionValue(e)&&(t.constraints[e]=function(t,e){var n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i[e],t.constraints[e]))}))},t.prototype.resolveRefConstraints=function(t,e){var n=this.props,o=n.onMeasureDragConstraints,i=n.transformPagePoint,r=e.current;this.constraintsBox=Ir(r,i);var a=function(t,e){return{x:Br(t.x,e.x),y:Br(t.y,e.y)}}(t,this.constraintsBox);if(o){var s=o(function(t){var e=t.x,n=t.y;return{top:n.min,bottom:n.max,left:e.min,right:e.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=_r(s))}return a},t.prototype.cancelDrag=function(){var t,e;this.visualElement.unlockProjectionTarget(),null===(t=this.cancelLayout)||void 0===t||t.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(dn.Drag,!1)},t.prototype.stop=function(t,e){var n,o,i;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var a=e.velocity;this.animateDragEnd(a),null===(i=(o=this.props).onDragEnd)||void 0===i||i.call(o,t,e)}},t.prototype.snapToCursor=function(t){var e=this;return kr((function(n){if(Aa(n,e.props.drag,e.currentDirection)){var o=e.getAxisMotionValue(n);if(!o)return e.cursorProgress[n]=.5,!0;var i=e.visualElement.getLayoutState().layout,r=i[n].max-i[n].min,a=i[n].min+r/2,s=t[n]-a;e.originPoint[n]=t[n],o.set(s)}})).includes(!0)},t.prototype.updateAxis=function(t,e,n){if(Aa(t,this.props.drag,this.currentDirection))return this.getAxisMotionValue(t)?this.updateAxisMotionValue(t,n):this.updateVisualElementAxis(t,e)},t.prototype.updateAxisMotionValue=function(t,e){var n=this.getAxisMotionValue(t);if(e&&n){var o=this.originPoint[t]+e[t],i=this.constraints?Dr(o,this.constraints[t],this.elastic[t]):o;n.set(i)}},t.prototype.updateVisualElementAxis=function(t,e){var n,o=this.visualElement.getLayoutState().layout[t],i=o.max-o.min,r=this.cursorProgress[t],a=function(t,e,n,o,i){var r=t-e*n;return o?Dr(r,o,i):r}(e[t],i,r,null===(n=this.constraints)||void 0===n?void 0:n[t],this.elastic[t]);this.visualElement.setProjectionTargetAxis(t,a,a+i)},t.prototype.setProps=function(t){var e=t.drag,n=void 0!==e&&e,o=t.dragDirectionLock,i=void 0!==o&&o,r=t.dragPropagation,a=void 0!==r&&r,s=t.dragConstraints,l=void 0!==s&&s,c=t.dragElastic,u=void 0===c?.35:c,d=t.dragMomentum,h=void 0===d||d,f=Object(xt.d)(t,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(xt.a)({drag:n,dragDirectionLock:i,dragPropagation:a,dragConstraints:l,dragElastic:u,dragMomentum:h},f)},t.prototype.getAxisMotionValue=function(t){var e=this.props,n=e.layout,o=e.layoutId,i="_drag"+t.toUpperCase();return this.props[i]?this.props[i]:n||void 0!==o?void 0:this.visualElement.getValue(t,0)},t.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},t.prototype.isExternalDrag=function(){var t=this.props,e=t._dragX,n=t._dragY;return e||n},t.prototype.animateDragEnd=function(t){var e=this,n=this.props,o=n.drag,i=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(t,e){void 0===e&&(e=!0);var n,o=t.getProjectionParent();return!!o&&(e?ca(n=qr(o.projection.target,t.projection.target),o.getLatestValues()):n=qr(o.getLayoutState().layout,t.getLayoutState().layout),kr((function(e){return t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),l=this.constraints||{};if(s&&Object.keys(l).length&&this.isLayoutDrag()){var c=this.visualElement.getProjectionParent();if(c){var u=qr(c.projection.targetFinal,l);kr((function(t){var e=u[t],n=e.min,o=e.max;l[t]={min:isNaN(n)?void 0:n,max:isNaN(o)?void 0:o}}))}}var d=kr((function(n){var c;if(Aa(n,o,e.currentDirection)){var u=null!==(c=null==l?void 0:l[n])&&void 0!==c?c:{},d=r?200:1e6,h=r?40:1e7,f=Object(xt.a)(Object(xt.a)({type:"inertia",velocity:i?t[n]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},a),u);return e.getAxisMotionValue(n)?e.startAxisValueAnimation(n,f):e.visualElement.startLayoutAnimation(n,f,s)}}));return Promise.all(d).then((function(){var t,n;null===(n=(t=e.props).onDragTransitionEnd)||void 0===n||n.call(t)}))},t.prototype.stopMotion=function(){var t=this;kr((function(e){var n=t.getAxisMotionValue(e);n?n.stop():t.visualElement.stopLayoutAnimation()}))},t.prototype.startAxisValueAnimation=function(t,e){var n=this.getAxisMotionValue(t);if(n){var o=n.get();return n.set(o),n.set(o),Hi(t,n,0,e)}},t.prototype.scalePoint=function(){var t=this,e=this.props,n=e.drag;if(Ut(e.dragConstraints)&&this.constraintsBox){this.stopMotion();var o={x:0,y:0};kr((function(e){o[e]=jr(t.visualElement.projection.target[e],t.constraintsBox[e])})),this.updateConstraints((function(){kr((function(e){if(Aa(e,n,null)){var i=function(t,e,n){var o=t.max-t.min,i=$n(e.min,e.max-o,n);return{min:i,max:i+o}}(t.visualElement.projection.target[e],t.constraintsBox[e],o[e]),r=i.min,a=i.max;t.visualElement.setProjectionTargetAxis(e,r,a)}}))})),setTimeout(fa,1)}},t.prototype.updateConstraints=function(t){var e=this;this.cancelLayout=ha((function(n,o){var i=Qr(e.visualElement);o((function(){return i.forEach((function(t){return t.resetTransform()}))})),n((function(){return Yr(e.visualElement)})),o((function(){return i.forEach((function(t){return t.restoreTransform()}))})),n((function(){e.resolveDragConstraints()})),t&&o(t)}))},t.prototype.mount=function(t){var e=this,n=Ln(t.getInstance(),"pointerdown",(function(t){var n=e.props,o=n.drag,i=n.dragListener;o&&(void 0===i||i)&&e.start(t)})),o=pn(window,"resize",(function(){e.scalePoint()})),i=t.onLayoutUpdate((function(){e.isDragging&&e.resolveDragConstraints()})),r=t.prevDragCursor;return r&&this.start(pa,{cursorProgress:r}),function(){null==n||n(),null==o||o(),null==i||i(),e.cancelDrag()}},t}();function Aa(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}var ba,ya,Ca={pan:Mn((function(t){var e=t.onPan,n=t.onPanStart,o=t.onPanEnd,i=t.onPanSessionStart,r=t.visualElement,a=e||n||o||i,s=Object(W.useRef)(null),l=Object(W.useContext)(kt).transformPagePoint,c={onSessionStart:i,onStart:n,onMove:e,onEnd:function(t,e){s.current=null,o&&o(t,e)}};Object(W.useEffect)((function(){null!==s.current&&s.current.updateHandlers(c)})),_n(r,"pointerdown",a&&function(t){s.current=new br(t,c,{transformPagePoint:l})}),Rn((function(){return s.current&&s.current.end()}))})),drag:Mn((function(t){var e=t.dragControls,n=t.visualElement,o=Object(W.useContext)(kt).transformPagePoint,i=Bt((function(){return new va({visualElement:n})}));i.setProps(Object(xt.a)(Object(xt.a)({},t),{transformPagePoint:o})),Object(W.useEffect)((function(){return e&&e.subscribe(i)}),[i]),Object(W.useEffect)((function(){return i.mount(n)}),[])}))};function Sa(t){return"string"==typeof t&&t.startsWith("var(--")}!function(t){t[t.Entering=0]="Entering",t[t.Present=1]="Present",t[t.Exiting=2]="Exiting"}(ba||(ba={})),function(t){t[t.Hide=0]="Hide",t[t.Show=1]="Show"}(ya||(ya={}));var wa=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function xa(t,e,n){void 0===n&&(n=1);var o=Object(xt.c)(function(t){var e=wa.exec(t);if(!e)return[,];var n=Object(xt.c)(e,3);return[n[1],n[2]]}(t),2),i=o[0],r=o[1];if(i){var a=window.getComputedStyle(e).getPropertyValue(i);return a?a.trim():Sa(r)?xa(r,e,n+1):r}}function Ea(t,e){return t/(e.max-e.min)*100}var La="_$css";var _a={process:function(t,e,n){var o=n.target;if("string"==typeof t){if(!xe.test(t))return t;t=parseFloat(t)}return Ea(t,o.x)+"% "+Ea(t,o.y)+"%"}},Oa={borderRadius:Object(xt.a)(Object(xt.a)({},_a),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:_a,borderTopRightRadius:_a,borderBottomLeftRadius:_a,borderBottomRightRadius:_a,boxShadow:{process:function(t,e){var n=e.delta,o=e.treeScale,i=t,r=t.includes("var("),a=[];r&&(t=t.replace(wa,(function(t){return a.push(t),La})));var s=Ao.parse(t);if(s.length>5)return i;var l=Ao.createTransformer(t),c="number"!=typeof s[0]?1:0,u=n.x.scale*o.x,d=n.y.scale*o.y;s[0+c]/=u,s[1+c]/=d;var h=$n(u,d,.5);"number"==typeof s[2+c]&&(s[2+c]/=h),"number"==typeof s[3+c]&&(s[3+c]/=h);var f=l(s);if(r){var p=0;f=f.replace(La,(function(){var t=a[p];return p++,t}))}return f}}},Ta=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},e.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},e.isAnimating={x:!1,y:!1},e.stopAxisAnimation={x:void 0,y:void 0},e.isAnimatingTree=!1,e.animate=function(t,n,o){void 0===o&&(o={});var i=o.originBox,r=o.targetBox,a=o.visibilityAction,s=o.shouldStackAnimate,l=o.onComplete,c=o.prevParent,u=Object(xt.d)(o,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=e.props,h=d.visualElement,f=d.layout;if(!1===s)return e.isAnimatingTree=!1,e.safeToRemove();if(!e.isAnimatingTree||!0===s){s&&(e.isAnimatingTree=!0),n=i||n,t=r||t;var p=!1,m=h.getProjectionParent();if(m){var g=m.prevViewportBox,v=m.getLayoutState().layout;c&&(r&&(v=c.getLayoutState().layout),i&&!Xr(c,m)&&c.prevViewportBox&&(g=c.prevViewportBox)),g&&Ra(c,i,r)&&(p=!0,n=qr(g,n),t=qr(v,t))}var A=ka(n,t),b=kr((function(o){var i,r;if("position"===f){var s=t[o].max-t[o].min;n[o].max=n[o].min+s}if(!h.projection.isTargetLocked)return void 0===a?A?e.animateAxis(o,t[o],n[o],Object(xt.a)(Object(xt.a)({},u),{isRelative:p})):(null===(r=(i=e.stopAxisAnimation)[o])||void 0===r||r.call(i),h.setProjectionTargetAxis(o,t[o].min,t[o].max,p)):void h.setVisibility(a===ya.Show)}));return h.syncRender(),Promise.all(b).then((function(){e.isAnimatingTree=!1,l&&l(),h.notifyLayoutAnimationComplete()}))}},e}return Object(xt.b)(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props.visualElement;e.animateMotionValue=Hi,e.enableLayoutProjection(),this.unsubLayoutReady=e.onLayoutUpdate(this.animate),e.layoutSafeToRemove=function(){return t.safeToRemove()},function(t){for(var e in t)ne[e]=t[e]}(Oa)},e.prototype.componentWillUnmount=function(){var t=this;this.unsubLayoutReady(),kr((function(e){var n,o;return null===(o=(n=t.stopAxisAnimation)[e])||void 0===o?void 0:o.call(n)}))},e.prototype.animateAxis=function(t,e,n,o){var i,r,a=this,s=void 0===o?{}:o,l=s.transition,c=s.isRelative;if(!this.isAnimating[t]||!Ba(e,this.currentAnimationTarget[t])){null===(r=(i=this.stopAxisAnimation)[t])||void 0===r||r.call(i),this.isAnimating[t]=!0;var u=this.props.visualElement,d=this.frameTarget[t],h=u.getProjectionAnimationProgress()[t];h.clearListeners(),h.set(0),h.set(0);var f=function(){var o=h.get()/1e3;!function(t,e,n,o){t.min=$n(e.min,n.min,o),t.max=$n(e.max,n.max,o)}(d,n,e,o),u.setProjectionTargetAxis(t,d.min,d.max,c)};f();var p=h.onChange(f);this.stopAxisAnimation[t]=function(){a.isAnimating[t]=!1,h.stop(),p()},this.currentAnimationTarget[t]=e;var m=l||u.getDefaultTransition()||Fa;return Hi("x"===t?"layoutX":"layoutY",h,1e3,m&&Ui(m,"layout")).then(this.stopAxisAnimation[t])}},e.prototype.safeToRemove=function(){var t,e;null===(e=(t=this.props).safeToRemove)||void 0===e||e.call(t)},e.prototype.render=function(){return null},e}(W.Component);function ka(t,e){return!(Pa(t)||Pa(e)||Ba(t.x,e.x)&&Ba(t.y,e.y))}var Da={min:0,max:0};function Pa(t){return Ba(t.x,Da)&&Ba(t.y,Da)}function Ba(t,e){return t.min===e.min&&t.max===e.max}var Fa={duration:.45,ease:[.4,0,.1,1]};function Ra(t,e,n){return t||!t&&!(e||n)}var Ia={layoutReady:function(t){return t.notifyLayoutReady()}};function Wa(){var t=new Set;return{add:function(e){return t.add(e)},flush:function(e){var n=void 0===e?Ia:e,o=n.layoutReady,i=n.parent;ha((function(e,n){var r=Array.from(t).sort(Hr),a=i?Qr(i):[];n((function(){Object(xt.e)(Object(xt.e)([],Object(xt.c)(a)),Object(xt.c)(r)).forEach((function(t){return t.resetTransform()}))})),e((function(){r.forEach(Yr)})),n((function(){a.forEach((function(t){return t.restoreTransform()})),r.forEach(o)})),e((function(){r.forEach((function(t){t.isPresent&&(t.presence=ba.Present)}))})),n((function(){ri.preRender(),ri.render()})),e((function(){ui.postRender((function(){return r.forEach(Ma)})),t.clear()}))})),fa()}}}function Ma(t){t.prevViewportBox=t.projection.target}var ja=Object(W.createContext)(Wa()),za=Object(W.createContext)(Wa());function Na(t){return!!t.forceUpdate}var Va=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(xt.b)(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.syncLayout,n=t.framerSyncLayout,o=t.visualElement;Na(e)&&e.register(o),Na(n)&&n.register(o),o.onUnmount((function(){Na(e)&&e.remove(o),Na(n)&&n.remove(o)}))},e.prototype.getSnapshotBeforeUpdate=function(){var t=this.props,e=t.syncLayout,n=t.visualElement;return Na(e)?e.syncUpdate():(!function(t){t.shouldResetTransform()||(t.prevViewportBox=t.measureViewportBox(!1),t.rebaseProjectionTarget(!1,t.prevViewportBox))}(n),e.add(n)),null},e.prototype.componentDidUpdate=function(){var t=this.props.syncLayout;Na(t)||t.flush()},e.prototype.render=function(){return null},e}(W.default.Component);var Ua={measureLayout:function(t){var e=Object(W.useContext)(ja),n=Object(W.useContext)(za);return W.default.createElement(Va,Object(xt.a)({},t,{syncLayout:e,framerSyncLayout:n}))},layoutAnimation:function(t){var e=Object(xt.c)(Ft(),2)[1];return W.createElement(Ta,Object(xt.a)({},t,{safeToRemove:e}))}};function Ha(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:Tr(),deltaFinal:Tr(),deltaTransform:""}}var Ga=Ha();function Qa(t,e,n){var o=t.x,i=t.y,r="translate3d("+o.translate/e.x+"px, "+i.translate/e.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),l&&(r+="rotateY("+l+") ")}return r+="scale("+o.scale+", "+i.scale+")",n||r!==Za?r:""}function Ya(t){var e=t.deltaFinal;return 100*e.x.origin+"% "+100*e.y.origin+"% 0"}var Za=Qa(Ga.delta,Ga.treeScale,{x:1,y:1}),qa=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Xa(t,e,n,o){var i,r,a=t.delta,s=t.layout,l=t.layoutCorrected,c=t.treeScale,u=e.target;r=s,Kr((i=l).x,r.x),Kr(i.y,r.y),function(t,e,n){var o=n.length;if(o){var i,r;e.x=e.y=1;for(var a=0;a<o;a++)r=(i=n[a]).getLayoutState().delta,e.x*=r.x.scale,e.y*=r.y.scale,na(t,r),$r(i)&&aa(t,t,i.getLatestValues())}}(l,c,n),Nr(a,l,u,o)}var $a=function(){function t(){this.children=[],this.isDirty=!1}return t.prototype.add=function(t){Gi(this.children,t),this.isDirty=!0},t.prototype.remove=function(t){Qi(this.children,t),this.isDirty=!0},t.prototype.forEach=function(t){this.isDirty&&this.children.sort(Hr),this.isDirty=!1,this.children.forEach(t)},t}();var Ka=function(t){var e=t.treeType,n=void 0===e?"":e,o=t.build,i=t.getBaseTarget,r=t.makeTargetAnimatable,a=t.measureViewportBox,s=t.render,l=t.readValueFromInstance,c=t.resetTransform,u=t.restoreTransform,d=t.removeValueFromRenderState,h=t.sortNodePosition,f=t.scrapeMotionValuesFromProps;return function(t,e){var p=t.parent,m=t.props,g=t.presenceId,v=t.blockInitialAnimation,A=t.visualState;void 0===e&&(e={});var b,y,C,S,w,x,E=A.latestValues,L=A.renderState,_=function(){var t=qa.map((function(){return new Yi})),e={},n={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){return qa.forEach((function(o){var i;null===(i=e[o])||void 0===i||i.call(e);var r="on"+o,a=t[r];a&&(e[o]=n[r](a))}))}};return t.forEach((function(t,e){n["on"+qa[e]]=function(e){return t.add(e)},n["notify"+qa[e]]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.notify.apply(t,Object(xt.e)([],Object(xt.c)(e)))}})),n}(),O={isEnabled:!1,isHydrated:!1,isTargetLocked:!1,target:{x:{min:0,max:1},y:{min:0,max:1}},targetFinal:{x:{min:0,max:1},y:{min:0,max:1}}},T=O,k=E,D=Ha(),P=!1,B=new Map,F=new Map,R={},I=Object(xt.a)({},E);function W(){b&&(Q.isProjectionReady()&&(aa(T.targetFinal,T.target,k),Nr(D.deltaFinal,D.layoutCorrected,T.targetFinal,E)),M(),s(b,L))}function M(){var t=E;if(S&&S.isActive()){var n=S.getCrossfadeState(Q);n&&(t=n)}o(Q,L,t,T,D,e,m)}function j(){_.notifyUpdate(E)}function z(){Q.layoutTree.forEach(ts)}var N=f(m);for(var V in N){var U=N[V];void 0!==E[V]&&de(U)&&U.set(E[V],!1)}var H=Zt(m),G=qt(m),Q=Object(xt.a)(Object(xt.a)({treeType:n,current:null,depth:p?p.depth+1:0,parent:p,children:new Set,path:p?Object(xt.e)(Object(xt.e)([],Object(xt.c)(p.path)),[p]):[],layoutTree:p?p.layoutTree:new $a,presenceId:g,projection:O,variantChildren:G?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==p?void 0:p.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(b)},mount:function(t){b=Q.current=t,Q.pointTo(Q),G&&p&&!H&&(x=null==p?void 0:p.addVariantChild(Q)),null==p||p.children.add(Q)},unmount:function(){ii.update(j),ii.render(W),ii.preRender(Q.updateLayoutProjection),F.forEach((function(t){return t()})),Q.stopLayoutAnimation(),Q.layoutTree.remove(Q),null==x||x(),null==p||p.children.delete(Q),null==C||C(),_.clearAllListeners()},addVariantChild:function(t){var e,n=Q.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),function(){return n.variantChildren.delete(t)}},sortNodePosition:function(t){return h&&n===t.treeType?h(Q.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return G?Q:null==p?void 0:p.getClosestVariantNode()},scheduleUpdateLayoutProjection:p?p.scheduleUpdateLayoutProjection:function(){return ui.preRender(Q.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return m.layoutId},getInstance:function(){return b},getStaticValue:function(t){return E[t]},setStaticValue:function(t,e){return E[t]=e},getLatestValues:function(){return E},setVisibility:function(t){Q.isVisible!==t&&(Q.isVisible=t,Q.scheduleRender())},makeTargetAnimatable:function(t,e){return void 0===e&&(e=!0),r(Q,t,m,e)},addValue:function(t,e){Q.hasValue(t)&&Q.removeValue(t),B.set(t,e),E[t]=e.get(),function(t,e){var n=e.onChange((function(e){E[t]=e,m.onUpdate&&ui.update(j,!1,!0)})),o=e.onRenderRequest(Q.scheduleRender);F.set(t,(function(){n(),o()}))}(t,e)},removeValue:function(t){var e;B.delete(t),null===(e=F.get(t))||void 0===e||e(),F.delete(t),delete E[t],d(t,L)},hasValue:function(t){return B.has(t)},getValue:function(t,e){var n=B.get(t);return void 0===n&&void 0!==e&&(n=qi(e),Q.addValue(t,n)),n},forEachValue:function(t){return B.forEach(t)},readValue:function(t){var n;return null!==(n=E[t])&&void 0!==n?n:l(b,t,e)},setBaseTarget:function(t,e){I[t]=e},getBaseTarget:function(t){if(i){var e=i(m,t);if(void 0!==e&&!de(e))return e}return I[t]}},_),{build:function(){return M(),L},scheduleRender:function(){ui.render(W,!1,!0)},syncRender:W,setProps:function(t){m=t,_.updatePropListeners(t),R=function(t,e,n){var o;for(var i in e){var r=e[i],a=n[i];if(de(r))t.addValue(i,r);else if(de(a))t.addValue(i,qi(r));else if(a!==r)if(t.hasValue(i)){var s=t.getValue(i);!s.hasAnimated&&s.set(r)}else t.addValue(i,qi(null!==(o=t.getStaticValue(i))&&void 0!==o?o:r))}for(var i in n)void 0===e[i]&&t.removeValue(i);return e}(Q,f(m),R)},getProps:function(){return m},getVariant:function(t){var e;return null===(e=m.variants)||void 0===e?void 0:e[t]},getDefaultTransition:function(){return m.transition},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==p?void 0:p.getVariantContext();if(!H){var e=(null==p?void 0:p.getVariantContext())||{};return void 0!==m.initial&&(e.initial=m.initial),e}for(var n={},o=0;o<os;o++){var i=ns[o],r=m[i];(Gt(r)||!1===r)&&(n[i]=r)}return n},enableLayoutProjection:function(){O.isEnabled=!0,Q.layoutTree.add(Q)},lockProjectionTarget:function(){O.isTargetLocked=!0},unlockProjectionTarget:function(){Q.stopLayoutAnimation(),O.isTargetLocked=!1},getLayoutState:function(){return D},setCrossfader:function(t){S=t},isProjectionReady:function(){return O.isEnabled&&O.isHydrated&&D.isHydrated},startLayoutAnimation:function(t,e,n){void 0===n&&(n=!1);var o=Q.getProjectionAnimationProgress()[t],i=n?O.relativeTarget[t]:O.target[t],r=i.min,a=i.max-r;return o.clearListeners(),o.set(r),o.set(r),o.onChange((function(e){Q.setProjectionTargetAxis(t,e,e+a,n)})),Q.animateMotionValue(t,o,0,e)},stopLayoutAnimation:function(){kr((function(t){return Q.getProjectionAnimationProgress()[t].stop()}))},measureViewportBox:function(t){void 0===t&&(t=!0);var n=a(b,e);return t||ca(n,E),n},getProjectionAnimationProgress:function(){return w||(w={x:qi(0),y:qi(0)}),w},setProjectionTargetAxis:function(t,e,n,o){var i;void 0===o&&(o=!1),o?(O.relativeTarget||(O.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),i=O.relativeTarget[t]):(O.relativeTarget=void 0,i=O.target[t]),O.isHydrated=!0,i.min=e,i.max=n,P=!0,_.notifySetAxisTarget()},rebaseProjectionTarget:function(t,e){void 0===e&&(e=D.layout);var n=Q.getProjectionAnimationProgress(),o=n.x,i=n.y,r=!(O.relativeTarget||O.isTargetLocked||o.isAnimating()||i.isAnimating());(t||r)&&kr((function(t){var n=e[t],o=n.min,i=n.max;Q.setProjectionTargetAxis(t,o,i)}))},notifyLayoutReady:function(t){!function(t){var e=t.getProjectionParent();if(e){var n=qr(e.getLayoutState().layout,t.getLayoutState().layout);kr((function(e){t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)}))}else t.rebaseProjectionTarget()}(Q),Q.notifyLayoutUpdate(D.layout,Q.prevViewportBox||D.layout,t)},resetTransform:function(){return c(Q,b,m)},restoreTransform:function(){return u(b,L)},updateLayoutProjection:function(){if(Q.isProjectionReady()){var t=D.delta,e=D.treeScale,n=e.x,o=e.y,i=D.deltaTransform;Xa(D,T,Q.path,E),P&&Q.notifyViewportBoxUpdate(T.target,t),P=!1;var r=Qa(t,e);r===i&&n===e.x&&o===e.y||Q.scheduleRender(),D.deltaTransform=r}},updateTreeLayoutProjection:function(){Q.layoutTree.forEach(Ja),ui.preRender(z,!1,!0)},getProjectionParent:function(){if(void 0===y){for(var t=!1,e=Q.path.length-1;e>=0;e--){var n=Q.path[e];if(n.projection.isEnabled){t=n;break}}y=t}return y},resolveRelativeTargetBox:function(){var t=Q.getProjectionParent();if(O.relativeTarget&&t&&(function(t,e){Ur(t.target.x,t.relativeTarget.x,e.target.x),Ur(t.target.y,t.relativeTarget.y,e.target.y)}(O,t.projection),$r(t))){var e=O.target;aa(e,e,t.getLatestValues())}},shouldResetTransform:function(){return Boolean(m._layoutResetTransform)},pointTo:function(t){T=t.projection,k=t.getLatestValues(),null==C||C(),C=Wn(t.onSetAxisTarget(Q.scheduleUpdateLayoutProjection),t.onLayoutAnimationComplete((function(){var t;Q.isPresent?Q.presence=ba.Present:null===(t=Q.layoutSafeToRemove)||void 0===t||t.call(Q)})))},isPresent:!0,presence:ba.Entering});return Q}};function Ja(t){t.resolveRelativeTargetBox()}function ts(t){t.updateLayoutProjection()}var es,ns=Object(xt.e)(["initial"],Object(xt.c)(lr)),os=ns.length,is=new Set(["width","height","top","left","right","bottom","x","y"]),rs=function(t){return is.has(t)},as=function(t,e){t.set(e,!1),t.set(e)},ss=function(t){return t===Oe||t===xe};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(es||(es={}));var ls=function(t,e){return parseFloat(t.split(", ")[e])},cs=function(t,e){return function(n,o){var i=o.transform;if("none"===i||!i)return 0;var r=i.match(/^matrix3d\((.+)\)$/);if(r)return ls(r[1],e);var a=i.match(/^matrix\((.+)\)$/);return a?ls(a[1],t):0}},us=new Set(["x","y","z"]),ds=ie.filter((function(t){return!us.has(t)}));var hs={width:function(t){var e=t.x;return e.max-e.min},height:function(t){var e=t.y;return e.max-e.min},top:function(t,e){var n=e.top;return parseFloat(n)},left:function(t,e){var n=e.left;return parseFloat(n)},bottom:function(t,e){var n=t.y,o=e.top;return parseFloat(o)+(n.max-n.min)},right:function(t,e){var n=t.x,o=e.left;return parseFloat(o)+(n.max-n.min)},x:cs(4,13),y:cs(5,14)},fs=function(t,e,n,o){void 0===n&&(n={}),void 0===o&&(o={}),e=Object(xt.a)({},e),o=Object(xt.a)({},o);var i=Object.keys(e).filter(rs),r=[],a=!1,s=[];if(i.forEach((function(i){var l=t.getValue(i);if(t.hasValue(i)){var c,u=n[i],d=e[i],h=Ki(u);if(rn(d))for(var f=d.length,p=null===d[0]?1:0;p<f;p++)c?Ki(d[p]):(c=Ki(d[p]))===h||ss(h)&&ss(c);else c=Ki(d);if(h!==c)if(ss(h)&&ss(c)){var m=l.get();"string"==typeof m&&l.set(parseFloat(m)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&c===xe&&(e[i]=d.map(parseFloat))}else(null==h?void 0:h.transform)&&(null==c?void 0:c.transform)&&(0===u||0===d)?0===u?l.set(c.transform(u)):e[i]=h.transform(d):(a||(r=function(t){var e=[];return ds.forEach((function(n){var o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))})),e.length&&t.syncRender(),e}(t),a=!0),s.push(i),o[i]=void 0!==o[i]?o[i]:e[i],as(l,d))}})),s.length){var l=function(t,e,n){var o=e.measureViewportBox(),i=e.getInstance(),r=getComputedStyle(i),a=r.display,s={top:r.top,left:r.left,bottom:r.bottom,right:r.right,transform:r.transform};"none"===a&&e.setStaticValue("display",t.display||"block"),e.syncRender();var l=e.measureViewportBox();return n.forEach((function(n){var i=e.getValue(n);as(i,hs[n](o,s)),t[n]=hs[n](l,r)})),t}(e,t,s);return r.length&&r.forEach((function(e){var n=Object(xt.c)(e,2),o=n[0],i=n[1];t.getValue(o).set(i)})),t.syncRender(),{target:l,transitionEnd:o}}return{target:e,transitionEnd:o}};function ps(t,e,n,o){return function(t){return Object.keys(t).some(rs)}(e)?fs(t,e,n,o):{target:e,transitionEnd:o}}var ms=function(t,e,n,o){var i=function(t,e,n){var o,i=Object(xt.d)(e,[]),r=t.getInstance();if(!(r instanceof HTMLElement))return{target:i,transitionEnd:n};for(var a in n&&(n=Object(xt.a)({},n)),t.forEachValue((function(t){var e=t.get();if(Sa(e)){var n=xa(e,r);n&&t.set(n)}})),i){var s=i[a];if(Sa(s)){var l=xa(s,r);l&&(i[a]=l,n&&(null!==(o=n[a])&&void 0!==o||(n[a]=s)))}}return{target:i,transitionEnd:n}}(t,e,o);return ps(t,e=i.target,n,o=i.transitionEnd)};var gs={treeType:"dom",readValueFromInstance:function(t,e){if(se(e)){var n=Ii(e);return n&&n.default||0}var o,i=(o=t,window.getComputedStyle(o));return(fe(e)?i.getPropertyValue(e):i[e])||0},sortNodePosition:function(t,e){return 2&t.compareDocumentPosition(e)?1:-1},getBaseTarget:function(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:function(t,e){return Ir(t,e.transformPagePoint)},resetTransform:function(t,e,n){var o=n.transformTemplate;e.style.transform=o?o({},""):"none",t.scheduleRender()},restoreTransform:function(t,e){t.style.transform=e.style.transform},removeValueFromRenderState:function(t,e){var n=e.vars,o=e.style;delete n[t],delete o[t]},makeTargetAnimatable:function(t,e,n,o){var i=n.transformValues;void 0===o&&(o=!0);var r=e.transition,a=e.transitionEnd,s=Object(xt.d)(e,["transition","transitionEnd"]),l=function(t,e,n){var o,i,r={};for(var a in t)r[a]=null!==(o=or(a,e))&&void 0!==o?o:null===(i=n.getValue(a))||void 0===i?void 0:i.get();return r}(s,r||{},t);if(i&&(a&&(a=i(a)),s&&(s=i(s)),l&&(l=i(l))),o){!function(t,e,n){var o,i,r,a,s=Object.keys(e).filter((function(e){return!t.hasValue(e)})),l=s.length;if(l)for(var c=0;c<l;c++){var u=s[c],d=e[u],h=null;Array.isArray(d)&&(h=d[0]),null===h&&(h=null!==(i=null!==(o=n[u])&&void 0!==o?o:t.readValue(u))&&void 0!==i?i:e[u]),null!=h&&("string"==typeof h&&/^\-?\d*\.?\d+$/.test(h)?h=parseFloat(h):!tr(h)&&Ao.test(d)&&(h=Wi(u,d)),t.addValue(u,qi(h)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=h),t.setBaseTarget(u,h))}}(t,s,l);var c=ms(t,s,l,a);a=c.transitionEnd,s=c.target}return Object(xt.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:en,build:function(t,e,n,o,i,r,a){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden");var s=o.isEnabled&&i.isHydrated;Be(e,n,o,i,r,a.transformTemplate,s?Qa:void 0,s?Ya:void 0)},render:Ke},vs=Ka(gs),As=Ka(Object(xt.a)(Object(xt.a)({},gs),{getBaseTarget:function(t,e){return t[e]},readValueFromInstance:function(t,e){var n;return se(e)?(null===(n=Ii(e))||void 0===n?void 0:n.default)||0:(e=Je.has(e)?e:$e(e),t.getAttribute(e))},scrapeMotionValuesFromProps:nn,build:function(t,e,n,o,i,r,a){var s=o.isEnabled&&i.isHydrated;Qe(e,n,o,i,r,a.transformTemplate,s?Qa:void 0,s?Ya:void 0)},render:tn})),bs=function(t,e){return ee(t)?As(e,{enableHardwareAcceleration:!1}):vs(e,{enableHardwareAcceleration:!0})},ys=Object(xt.a)(Object(xt.a)(Object(xt.a)(Object(xt.a)({},pr),jn),Ca),Ua),Cs=Jt((function(t,e){return fn(t,e,ys,bs)}));class Ss{constructor(t){this.highlighted=!1,this.code=t,this.points=[]}}var ws=n(6);class xs{static now(){return Date.now()}}function Es(t){var e=Bt((function(){return qi(t)}));if(Object(W.useContext)(kt).isStatic){var n=Object(xt.c)(Object(W.useState)(t),2)[1];Object(W.useEffect)((function(){return e.onChange(n)}),[])}return e}var Ls=function(t){return function(t){return"object"==typeof t&&t.mix}(t)?t.mix:void 0};function _s(t,e){var n=Es(e()),o=function(){return n.set(e())};return o(),function(t,e){Object(W.useEffect)((function(){var n=t.map((function(t){return t.onChange(e)}));return function(){return n.forEach((function(t){return t()}))}}))}(t,(function(){return ui.update(o,!1,!0)})),n}function Os(t,e,n,o){var i="function"==typeof e?e:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!Array.isArray(t[0]),o=n?0:-1,i=t[0+o],r=t[1+o],a=t[2+o],s=t[3+o],l=_o(r,a,Object(xt.a)({mixer:Ls(a[0])},s));return n?l(i):l}(e,n,o);return Array.isArray(t)?Ts(t,i):Ts([t],(function(t){var e=Object(xt.c)(t,1)[0];return i(e)}))}function Ts(t,e){var n=Bt((function(){return[]}));return _s(t,(function(){n.length=0;for(var o=t.length,i=0;i<o;i++)n[i]=t[i].get();return e(n)}))}function ks(t,e,n){void 0===n&&(n={});var o=de(t)?t:qi(t);return Hi("",o,e,n),{stop:function(){return o.stop()}}}var Ds=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};class Ps extends W.default.Component{constructor(t){super(t),this.state={element:t.element}}update(t){this.setState({element:t})}style(t){this.customStyle=t,this.forceUpdate()}render(){var t,e,n,o,i,r,a,s,l;const c=this.state.element,u=this.props.configuration.style;!c.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(c);const d=null!==(e=null===(t=this.customStyle)||void 0===t?void 0:t.fillColor)&&void 0!==e?e:c.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,h=null!==(o=null===(n=this.customStyle)||void 0===n?void 0:n.strokeColor)&&void 0!==o?o:c.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,f=null!==(r=null===(i=this.customStyle)||void 0===i?void 0:i.strokeWidth)&&void 0!==r?r:c.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,p=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:c.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,m=null!==(l=this.props.animateToPoints)&&void 0!==l?l:c.points;return W.default.createElement(Bs,{points:m,onClick:()=>{this.props.onClick&&this.props.onClick(c)},fill:d,stroke:h,strokeWidth:f,cornerRadius:p})}}function Bs(t){var{points:e,cornerRadius:n}=t,o=Ds(t,["points","cornerRadius"]);const i=[e[0].x,e[0].y,e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y],r=i.map(Es),a=Os(r,(([t,e,o,i,r,a,s,l])=>{const c=[{x:t,y:e},{x:o,y:i},{x:r,y:a},{x:s,y:l}];return ws.a.toSvgPathStringWithRoundedCorners(c,n)}));return Object(W.useEffect)((()=>{const t=[];for(let e=0;e<i.length;e++)t.push(ks(r[e],i[e]));return()=>{t.forEach((t=>t.stop()))}}),[e]),W.default.createElement(Cs.path,Object.assign({d:a},o))}class Fs extends W.default.Component{constructor(t){super(t),this.state={polygonElements:[]}}update(t,e,n,o){const i=[];(class{static keepOnlyCenterMostDuplicate(t,e){const n=new Map;t.forEach((t=>{const e=At(t),o=n.get(e);o?o.push(t):n.set(e,[t])})),n.forEach(((e,o)=>{e.length<2?n.delete(o):e.forEach(((e,n)=>{t.splice(t.indexOf(e),1)}))})),n.forEach(((n,o)=>{const i=t=>{let e={x:0,y:0};return t.forEach((t=>{e.x+=t.x,e.y+=t.y})),e.x/=t.length,e.y/=t.length,e},r=e.width/2,a=n.reduce(((t,e)=>{const n=i(t.quad),o=i(e.quad);return Math.abs(r-n.x)<Math.abs(r-o.x)?t:e}));t.push(a)}))}}).keepOnlyCenterMostDuplicate(o,n),o.forEach((o=>{const r=new Ss(o);r.points=void 0===t?ws.a.scaleListToHtmlElement(o.quad,n,e.video):o.quad.map((e=>{const o=new ws.a(e.x,e.y);return o.x*=t.width/n.width,o.y*=t.height/n.height,o.y+=t.y,o.x+=t.x,o})),r.points.forEach((t=>{e.state.mirrored&&this.container&&(t.x=this.container.clientWidth-t.x)})),i.push(r)}));const r=[];this.state.polygonElements.forEach((t=>{const e=i.find((e=>vt(e.code,t.element.code)));let n=!1;void 0===e?t.updatedAt+1e3<xs.now()&&(n=!0):(t.element=e,t.polygon=W.default.createElement(Ps,{key:At(t.element.code),ref:e=>t.polygonRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)}),t.label=W.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:At(t.element.code),ref:e=>t.labelRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)})),t.updatedAt=xs.now()),n||r.push(t)})),i.forEach((t=>{if(void 0===this.state.polygonElements.find((e=>vt(e.element.code,t.code)))){let e,n;const o=W.default.createElement(Ps,{key:At(t.code),ref:o=>{e=o,void 0!==n&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)}),i=W.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:At(t.code),ref:o=>{n=o,void 0!==e&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)})),a={element:t,polygon:o,label:i,polygonRef:e,labelRef:n,updatedAt:xs.now()};r.push(a)}})),this.setState({polygonElements:r})}onPolygonClick(t){var e,n,o,i;t.highlighted=!t.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((e=>{var n;const o=e.labelRef,i=e.label.props.element;o&&vt(i.code,t.code)&&(o.update(t),null===(n=e.polygonRef)||void 0===n||n.update(t))})),t.highlighted&&(null===(n=(e=this.props).onPolygonSelected)||void 0===n||n.call(e,t.code)),null===(i=(o=this.props).onPolygonClick)||void 0===i||i.call(o,t.code)}render(){var t,e;return W.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:t=>this.container=t},W.default.createElement(Cs.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%"}},null===(t=this.state.polygonElements)||void 0===t?void 0:t.map((t=>t.polygon))),null===(e=this.state.polygonElements)||void 0===e?void 0:e.map((t=>t.label)))}}var Rs=n(37),Is=n.n(Rs),Ws=n(40),Ms={insert:"head",singleton:!1},js=(Is()(Ws.a,Ms),Ws.a.locals,n(27)),zs=n.n(js);class Ns{constructor(t){this.lastTime=0,this.lastDuration=0,this.t=0,this.element=null,this.animationClass="",this.animationClass=t}setDuration(t){const e=Date.now()/1e3,n=e-this.lastTime;this.lastDuration&&(this.t+=n%this.lastDuration/this.lastDuration,this.t-=0|this.t);const o=-t*this.t;this.element&&(this.element.style.animationDuration=`${t}s`,this.element.style.animationDelay=`${o}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=e,this.lastDuration=t}}class Vs extends W.default.Component{constructor(){super(...arguments),this.inner1=new Ns("scanbot-shutter-rotate"),this.inner2=new Ns("scanbot-shutter-rotate")}render(){return W.default.createElement("div",{className:"scanbot-shutter-button",style:this.props.style,onClick:this.props.onClick},this.captureBackground(),this.captureInnerCircle(),this.captureSearchingInner1(),this.captureSearchingInner2())}updateAnimationSpeed(t){"searching"==t?(this.inner1.setDuration(3),this.inner2.setDuration(2)):(this.inner1.setDuration(1.5),this.inner2.setDuration(.75))}componentDidMount(){this.updateAnimationSpeed(this.props.action)}componentDidUpdate(){this.updateAnimationSpeed(this.props.action)}captureBackground(){return this.svgBase(null,W.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0zm0 3C15.984 3 3 15.984 3 32s12.984 29 29 29 29-12.984 29-29S48.016 3 32 3z")))}captureInnerCircle(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"processing"==t||"manual"==t,"scanbot-shutter-fade-out":"searching"==t||"capturing"==t,"scanbot-shutter-pulse-fast":"processing"==t},W.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},W.default.createElement("circle",{cx:"32",cy:"32",r:"24",fill:this.props.color,fillRule:"nonzero"})))}captureSearchingInner1(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},W.default.createElement("g",{fill:"none",fillOpacity:"0.7",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M44.24 51.476a1 1 0 01-1.066-1.692A20.981 20.981 0 0053 32c0-11.598-9.402-21-21-21a1 1 0 010-2c12.703 0 23 10.297 23 23a22.98 22.98 0 01-10.76 19.476z")),(t=>{this.inner1.element=t}))}captureSearchingInner2(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},W.default.createElement("g",{fill:"none",fillOpacity:"0.4",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M46.624 35.35a1 1 0 01-1.95-.445C44.89 33.96 45 32.988 45 32c0-7.18-5.82-13-13-13a1 1 0 010-2c8.284 0 15 6.716 15 15 0 1.138-.127 2.26-.376 3.35z")),(t=>{this.inner2.element=t}))}path(t){return W.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:t})}svgBase(t,e,n){return W.default.createElement("div",{className:zs()(t),ref:n},W.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},e))}}class Us extends W.default.Component{render(){return W.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},W.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_919_23088)"},W.default.createElement("path",{d:"M9 19V17H21V19H9ZM9 13V11H21V13H9ZM9 7V5H21V7H9ZM5 20C4.45 20 3.97917 19.8042 3.5875 19.4125C3.19583 19.0208 3 18.55 3 18C3 17.45 3.19583 16.9792 3.5875 16.5875C3.97917 16.1958 4.45 16 5 16C5.55 16 6.02083 16.1958 6.4125 16.5875C6.80417 16.9792 7 17.45 7 18C7 18.55 6.80417 19.0208 6.4125 19.4125C6.02083 19.8042 5.55 20 5 20ZM5 14C4.45 14 3.97917 13.8042 3.5875 13.4125C3.19583 13.0208 3 12.55 3 12C3 11.45 3.19583 10.9792 3.5875 10.5875C3.97917 10.1958 4.45 10 5 10C5.55 10 6.02083 10.1958 6.4125 10.5875C6.80417 10.9792 7 11.45 7 12C7 12.55 6.80417 13.0208 6.4125 13.4125C6.02083 13.8042 5.55 14 5 14ZM5 8C4.45 8 3.97917 7.80417 3.5875 7.4125C3.19583 7.02083 3 6.55 3 6C3 5.45 3.19583 4.97917 3.5875 4.5875C3.97917 4.19583 4.45 4 5 4C5.55 4 6.02083 4.19583 6.4125 4.5875C6.80417 4.97917 7 5.45 7 6C7 6.55 6.80417 7.02083 6.4125 7.4125C6.02083 7.80417 5.55 8 5 8Z",fill:"white"})))}}class Hs extends W.default.Component{render(){return W.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},W.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_919_23102)"},W.default.createElement("path",{d:"M12 22C10.75 22 9.57917 21.7625 8.4875 21.2875C7.39583 20.8125 6.44583 20.1708 5.6375 19.3625C4.82917 18.5542 4.1875 17.6042 3.7125 16.5125C3.2375 15.4208 3 14.25 3 13H5C5 14.95 5.67917 16.6042 7.0375 17.9625C8.39583 19.3208 10.05 20 12 20C13.95 20 15.6042 19.3208 16.9625 17.9625C18.3208 16.6042 19 14.95 19 13C19 11.05 18.3208 9.39583 16.9625 8.0375C15.6042 6.67917 13.95 6 12 6H11.85L13.4 7.55L12 9L8 5L12 1L13.4 2.45L11.85 4H12C13.25 4 14.4208 4.2375 15.5125 4.7125C16.6042 5.1875 17.5542 5.82917 18.3625 6.6375C19.1708 7.44583 19.8125 8.39583 20.2875 9.4875C20.7625 10.5792 21 11.75 21 13C21 14.25 20.7625 15.4208 20.2875 16.5125C19.8125 17.6042 19.1708 18.5542 18.3625 19.3625C17.5542 20.1708 16.6042 20.8125 15.5125 21.2875C14.4208 21.7625 13.25 22 12 22Z",fill:"white"})))}}class Gs extends W.default.Component{constructor(t){super(t),this.state={barcodes:void 0}}update(t){this.setState({barcodes:t})}didScan(){return void 0!==this.state.barcodes}render(){var t,e;return W.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:St.ScanbotPrimary}},W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},W.default.createElement(Us,null),W.default.createElement("div",{style:{backgroundColor:St.Orange,color:St.White,width:24,height:24,borderRadius:12,marginLeft:10,fontSize:13,lineHeight:"24px",textAlign:"center"}},null!==(e=null===(t=this.state.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)),W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},W.default.createElement(Vs,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},W.default.createElement("div",{style:{fontSize:13,color:St.White,marginRight:10}},"Scan More"),W.default.createElement(Hs,null)))}}class Qs extends W.default.Component{render(){const t=ws.a.centerOf(this.props.points),e=ws.a.smallerSizeOfQuad(this.props.points)/40;return W.default.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",left:t.x-20,top:t.y-20,transform:`scale(${e})`}},W.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},W.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_910_20901)"},W.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),W.default.createElement("path",{d:"M17.5833 27.6111L29.3611 15.8333L27.3055 13.8055L17.5833 23.5278L12.6666 18.6111L10.6389 20.6389L17.5833 27.6111ZM20 36.6666C17.713 36.6666 15.5555 36.2291 13.5278 35.3541C11.5 34.4791 9.73147 33.287 8.22219 31.7778C6.71294 30.2685 5.52081 28.5 4.64581 26.4722C3.77081 24.4444 3.33331 22.287 3.33331 20C3.33331 17.6944 3.77081 15.5278 4.64581 13.5C5.52081 11.4722 6.71294 9.70831 8.22219 8.20831C9.73147 6.70831 11.5 5.52081 13.5278 4.64581C15.5555 3.77081 17.713 3.33331 20 3.33331C22.3055 3.33331 24.4722 3.77081 26.5 4.64581C28.5278 5.52081 30.2916 6.70831 31.7916 8.20831C33.2916 9.70831 34.4791 11.4722 35.3541 13.5C36.2291 15.5278 36.6666 17.6944 36.6666 20C36.6666 22.287 36.2291 24.4444 35.3541 26.4722C34.4791 28.5 33.2916 30.2685 31.7916 31.7778C30.2916 33.287 28.5278 34.4791 26.5 35.3541C24.4722 36.2291 22.3055 36.6666 20 36.6666Z",fill:"#55BB77"})))}}var Ys=n(10);class Zs extends W.default.Component{constructor(t){super(t),this.state={elements:[],imageSize:Ys.a.empty()}}update(t){const e=[];t.barcodes.forEach((n=>{const o=new Ss(n);o.points=ws.a.scaleListToHtmlElement(n.quad,t.originalImageSize,this.image),e.push(o)})),this.setState({imageSize:Ys.a.fromHtmlElement(this.image),elements:e})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:W.default.createElement("div",{className:"scanned-image-with-overlay",style:{position:"absolute",display:"flex",justifyContent:"center",alignItems:this.state.image?"normal":"center",minHeight:"300px",height:"100%",width:"100%",top:0,left:0}},W.default.createElement("img",{style:{maxWidth:"100%"},ref:t=>this.image=t,src:`${this.props.image}`}),W.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((t,e)=>W.default.createElement(Qs,{key:e,points:t.points})))))}}class qs extends W.default.Component{render(){if(!this.props.visible)return null;const t=mt.a.svg`
31
+ `;var a=t=>o.default.createElement(r,{viewBox:"0 0 50 50"},o.default.createElement("circle",{className:"path",cx:"25",cy:"25",r:"20",fill:"none",strokeWidth:"3",stroke:t.color||"black"})),s=n(25),l=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class c{}class u{constructor(){this.videoReady=!1,this.sdkReady=!1}}class d extends o.default.Component{constructor(t){super(t),this.onVideoReady=()=>{this.setState({videoReady:!0},(()=>{const{onSuccess:t}=this.props;t&&t(this)}))},this.onVideoError=t=>{if(!0===this.state.videoReady){const{onError:e}=this.props.configuration;e?e(t):console.error(t)}else{const{onFailure:e}=this.props;e&&e(t),this.dispose()}},this.state=new u,this.bridge.awaitInitialized().then((()=>{this.setState({sdkReady:!0})}))}get bridge(){return i.a.instance.bridge}dispose(){const{container:t}=this.props;t&&Object(o.render)(null,t)}componentDidMount(){this.disposed=!1}componentWillUnmount(){this.disposed=!0}isSupported(){return"localhost"===location.hostname||"https:"===location.protocol}swapCameraFacing(t){this.camera.swapCameraFacing(t)}switchCamera(t,e){return l(this,void 0,void 0,(function*(){this.camera.switchCamera(t,e)}))}getActiveCameraInfo(){return this.camera.getActiveCameraInfo()}fetchAvailableCameras(){return s.a.INSTANCE.load()}renderSpinner(t){return this.state.videoReady&&this.state.sdkReady?null:o.default.createElement("div",{"data-sb-spinner":"1",style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",zIndex:500}},o.default.createElement(a,{color:t}))}setTorchState(t){return this.camera.setTorchState(t)}}d.DEFAULT_DETECTION_RESOLUTION=600,d.DETECTION_RESULTION_4K=3840},function(t,e,n){"use strict";n.r(e),n.d(e,"SingleScanningMode",(function(){return c})),n.d(e,"Resolution",(function(){return u})),n.d(e,"CameraConfiguration",(function(){return d})),n.d(e,"TopBarConfiguration",(function(){return f.a})),n.d(e,"ActionBarConfiguration",(function(){return p})),n.d(e,"BarcodeUseCase",(function(){return h})),n.d(e,"Palette",(function(){return i.f})),n.d(e,"StyledText",(function(){return i.j})),n.d(e,"IconStyle",(function(){return i.e})),n.d(e,"PolygonStyle",(function(){return i.g})),n.d(e,"BackgroundStyle",(function(){return i.a})),n.d(e,"ForegroundStyle",(function(){return i.d})),n.d(e,"RoundButton",(function(){return i.h})),n.d(e,"BadgedButton",(function(){return i.b})),n.d(e,"ButtonConfiguration",(function(){return i.c})),n.d(e,"Sound",(function(){return i.i})),n.d(e,"Vibration",(function(){return i.l})),n.d(e,"Timeouts",(function(){return i.k})),n.d(e,"ViewFinderConfiguration",(function(){return E})),n.d(e,"FinderStyle",(function(){return w})),n.d(e,"FinderCorneredStyle",(function(){return L})),n.d(e,"FinderStrokedStyle",(function(){return _})),n.d(e,"UserGuidanceConfiguration",(function(){return O})),n.d(e,"BarcodeItemErrorState",(function(){return a})),n.d(e,"BarcodeMappedData",(function(){return s})),n.d(e,"BarcodeInfoMapping",(function(){return l})),n.d(e,"ExpectedBarcode",(function(){return C})),n.d(e,"FindAndPickScanningMode",(function(){return S})),n.d(e,"BarcodeTextLocalization",(function(){return T})),n.d(e,"BarcodeRecognizerConfiguration",(function(){return k})),n.d(e,"ArOverlayPolygonConfiguration",(function(){return o.c})),n.d(e,"BarcodeItemConfiguration",(function(){return o.e})),n.d(e,"BadgeStyle",(function(){return o.d})),n.d(e,"ArOverlayGeneralConfiguration",(function(){return o.b})),n.d(e,"FindAndPickArOverlayPolygonConfiguration",(function(){return o.f})),n.d(e,"FindAndPickBadgeConfiguration",(function(){return o.g})),n.d(e,"ArOverlayFindAndPickConfiguration",(function(){return o.a})),n.d(e,"BarcodeScannerConfiguration",(function(){return P})),n.d(e,"BarcodeScannerUIItem",(function(){return F})),n.d(e,"BarcodeScannerUIResult",(function(){return R})),n.d(e,"OcrResult",(function(){return I.OcrResult})),n.d(e,"FieldParsedData",(function(){return I.FieldParsedData})),n.d(e,"FieldType",(function(){return I.FieldType})),n.d(e,"Field",(function(){return I.Field})),n.d(e,"GenericDocumentType",(function(){return I.GenericDocumentType})),n.d(e,"GenericDocument",(function(){return I.GenericDocument})),n.d(e,"Sheet",(function(){return m})),n.d(e,"SwipeToDelete",(function(){return g})),n.d(e,"ManualCountEditDialog",(function(){return v})),n.d(e,"SheetContent",(function(){return A})),n.d(e,"MultipleScanningMode",(function(){return b})),n.d(e,"ScanbotAlertDialog",(function(){return y})),n.d(e,"CameraPermissionScreen",(function(){return D})),n.d(e,"BarcodeItem",(function(){return B.BarcodeItem}));var o=n(8),i=n(1),r=n(7);class a extends r.a{constructor(t={}){super(),this.title=new i.j({text:"Connection Error!",color:"?sbColorOnSurface"}),this.subtitle=new i.j({text:"There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",color:"?sbColorOnSurfaceVariant"}),this.retryButton=new i.c({}),this.cancelButton=new i.c({}),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.subtitle&&(this.subtitle=new i.j(t.subtitle)),void 0!==t.retryButton&&(this.retryButton=new i.c(t.retryButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton))}}class s extends r.a{constructor(t={}){if(super(),void 0===t.title)throw new Error("title must be present in constructor argument");if(this.title=t.title,void 0===t.subtitle)throw new Error("subtitle must be present in constructor argument");if(this.subtitle=t.subtitle,void 0===t.barcodeImage)throw new Error("barcodeImage must be present in constructor argument");this.barcodeImage=t.barcodeImage}}class l extends r.a{constructor(t={}){super(),this.barcodeItemMapper=null,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.loadingMessage=new i.j({text:"Loading message for barcode info mapping.",color:"?sbColorPrimary"}),this.errorState=new a({}),void 0!==t.barcodeItemMapper&&(this.barcodeItemMapper=null!=t.barcodeItemMapper?t.barcodeItemMapper:null),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.loadingMessage&&(this.loadingMessage=new i.j(t.loadingMessage)),void 0!==t.errorState&&(this.errorState=new a(t.errorState))}}class c extends r.a{constructor(t={}){super(),this._type="SingleScanningMode",this.confirmationSheetEnabled=!1,this.barcodeImageVisible=!0,this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.barcodeTitle=new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),this.barcodeSubtitle=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.submitButton=new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),this.cancelButton=new i.c({visible:!0,text:"?singleModeConfirmationCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary"})}),this.barcodeInfoMapping=new l({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new i.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new i.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary"})}),cancelButton:new i.c({text:"?barcodeInfoMappingErrorStateCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary"})})})}),this.arOverlay=new o.b({visible:!1,counterBadge:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new o.c({visible:!0,deselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new o.e({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),titleDeselected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleDeselected:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.confirmationSheetEnabled&&(this.confirmationSheetEnabled=t.confirmationSheetEnabled),void 0!==t.barcodeImageVisible&&(this.barcodeImageVisible=t.barcodeImageVisible),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.barcodeTitle&&(this.barcodeTitle=new i.j(t.barcodeTitle)),void 0!==t.barcodeSubtitle&&(this.barcodeSubtitle=new i.j(t.barcodeSubtitle)),void 0!==t.submitButton&&(this.submitButton=new i.c(t.submitButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new l(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new o.b(t.arOverlay))}}class u extends r.a{constructor(t={}){if(super(),void 0===t.width)throw new Error("width must be present in constructor argument");if(this.width=t.width,void 0===t.height)throw new Error("height must be present in constructor argument");this.height=t.height}}class d extends r.a{constructor(t={}){super(),this.cameraModule="BACK",this.zoomSteps=[1,2,5],this.defaultZoomFactor=1,this.flashEnabled=!1,this.idealPreviewResolution=new u({width:1920,height:1080}),void 0!==t.cameraModule&&(this.cameraModule=t.cameraModule),void 0!==t.zoomSteps&&(this.zoomSteps=t.zoomSteps.map((t=>t))),void 0!==t.defaultZoomFactor&&(this.defaultZoomFactor=t.defaultZoomFactor),void 0!==t.flashEnabled&&(this.flashEnabled=t.flashEnabled),void 0!==t.idealPreviewResolution&&(this.idealPreviewResolution=new u(t.idealPreviewResolution))}}var h,f=n(30);class p extends r.a{constructor(t={}){super(),this.flashButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),this.zoomButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),this.flipCameraButton=new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),void 0!==t.flashButton&&(this.flashButton=new i.h(t.flashButton)),void 0!==t.zoomButton&&(this.zoomButton=new i.h(t.zoomButton)),void 0!==t.flipCameraButton&&(this.flipCameraButton=new i.h(t.flipCameraButton))}}class m extends r.a{constructor(t={}){super(),this.mode="COLLAPSED_SHEET",this.collapsedVisibleHeight="SMALL",this.listButton=new i.b({}),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.collapsedVisibleHeight&&(this.collapsedVisibleHeight=t.collapsedVisibleHeight),void 0!==t.listButton&&(this.listButton=new i.b(t.listButton))}}class g extends r.a{constructor(t={}){super(),this.enabled=!0,this.backgroundColor="?sbColorNegative",this.iconColor="?sbColorOnPrimary",void 0!==t.enabled&&(this.enabled=t.enabled),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.iconColor&&(this.iconColor=t.iconColor)}}class v extends r.a{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.modalOverlayColor="?sbColorModalOverlay",this.title=new i.j({text:"Update count",color:"?sbColorOnSurface"}),this.info=new i.j({text:"Adjust the number of items you scanned.",color:"?sbColorOnSurfaceVariant"}),this.updateButton=new i.c({visible:!0,text:"Update",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),this.cancelButton=new i.c({visible:!0,text:"Cancel",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),this.clearTextButton=new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.info&&(this.info=new i.j(t.info)),void 0!==t.updateButton&&(this.updateButton=new i.c(t.updateButton)),void 0!==t.cancelButton&&(this.cancelButton=new i.c(t.cancelButton)),void 0!==t.clearTextButton&&(this.clearTextButton=new i.e(t.clearTextButton))}}class A extends r.a{constructor(t={}){super(),this.sheetColor="?sbColorSurface",this.dividerColor="?sbColorOutline",this.manualCountChangeEnabled=!0,this.manualCountOutlineColor="?sbColorOutline",this.manualCountChangeColor="?sbColorPrimary",this.title=new i.j({text:"%d items",color:"?sbColorOnSurface"}),this.clearAllButton=new i.c({visible:!0,text:"Clear all",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.barcodeItemTitle=new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),this.barcodeItemSubtitle=new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),this.barcodeItemImageVisible=!0,this.submitButton=new i.c({visible:!0,text:"Submit",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),this.startScanningButton=new i.c({visible:!0,text:"Start scanning",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),this.placeholderTitle=new i.j({text:"No barcodes here!",color:"?sbColorOnSurface"}),this.placeholderSubtitle=new i.j({text:"The barcode list is currently empty. Close this sheet and scan your items to add them.",color:"?sbColorOnSurfaceVariant"}),this.placeholderIconBackground="?sbColorOutline",this.placeholderIcon=new i.e({visible:!0,color:"?sbColorOnSurface"}),this.swipeToDelete=new g({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"}),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0!==t.manualCountChangeEnabled&&(this.manualCountChangeEnabled=t.manualCountChangeEnabled),void 0!==t.manualCountOutlineColor&&(this.manualCountOutlineColor=t.manualCountOutlineColor),void 0!==t.manualCountChangeColor&&(this.manualCountChangeColor=t.manualCountChangeColor),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.clearAllButton&&(this.clearAllButton=new i.c(t.clearAllButton)),void 0!==t.barcodeItemTitle&&(this.barcodeItemTitle=new i.j(t.barcodeItemTitle)),void 0!==t.barcodeItemSubtitle&&(this.barcodeItemSubtitle=new i.j(t.barcodeItemSubtitle)),void 0!==t.barcodeItemImageVisible&&(this.barcodeItemImageVisible=t.barcodeItemImageVisible),void 0!==t.submitButton&&(this.submitButton=new i.c(t.submitButton)),void 0!==t.startScanningButton&&(this.startScanningButton=new i.c(t.startScanningButton)),void 0!==t.placeholderTitle&&(this.placeholderTitle=new i.j(t.placeholderTitle)),void 0!==t.placeholderSubtitle&&(this.placeholderSubtitle=new i.j(t.placeholderSubtitle)),void 0!==t.placeholderIconBackground&&(this.placeholderIconBackground=t.placeholderIconBackground),void 0!==t.placeholderIcon&&(this.placeholderIcon=new i.e(t.placeholderIcon)),void 0!==t.swipeToDelete&&(this.swipeToDelete=new g(t.swipeToDelete))}}class b extends r.a{constructor(t={}){super(),this._type="MultipleScanningMode",this.countingRepeatDelay=1e3,this.mode="COUNTING",this.sheet=new m({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new i.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new A({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new i.j({text:"?multipleModeSheetTitle",color:"?sbColorOnSurface"}),clearAllButton:new i.c({visible:!0,text:"?sheetClearAllButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),barcodeItemSubtitle:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),barcodeItemImageVisible:!0,submitButton:new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new i.c({visible:!0,text:"?sheetStartScanningButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new i.j({visible:!0,text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface",useShadow:!1}),placeholderSubtitle:new i.j({visible:!0,text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant",useShadow:!1}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new i.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new g({enabled:!0,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new v({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new i.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new i.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new i.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.barcodeInfoMapping=new l({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",loadingMessage:new i.j({text:"?barcodeInfoMappingLoadingMessage",color:"?sbColorPrimary"}),errorState:new a({title:new i.j({text:"?barcodeInfoMappingErrorStateTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?barcodeInfoMappingErrorStateSubtitle",color:"?sbColorOnSurfaceVariant"}),retryButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateRetryButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?barcodeInfoMappingErrorStateCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})})}),this.arOverlay=new o.b({visible:!1,counterBadge:new o.d({visible:!0,background:new i.a({strokeColor:"#FF000000",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),automaticSelectionEnabled:!1,barcodeItemInfoPosition:"BELOW",polygon:new o.c({visible:!0,deselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),selected:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),barcodeItemConfiguration:new o.e({imageVisible:!0,titleSelected:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),subtitleSelected:new i.j({visible:!0,text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant",useShadow:!1}),titleDeselected:new i.j({visible:!0,text:"BARCODE_TITLE",color:"?sbColorOnSurface",useShadow:!1}),subtitleDeselected:new i.j({text:"BARCODE_SUBTITLE",color:"?sbColorOnSurfaceVariant"}),backgroundSelected:new i.g({strokeColor:"?sbColorPositive",fillColor:"?sbColorPositive",strokeWidth:1,cornerRadius:5}),backgroundDeselected:new i.g({strokeColor:"?sbColorSurface",fillColor:"?sbColorSurface",strokeWidth:1,cornerRadius:5})})}),void 0!==t.countingRepeatDelay&&(this.countingRepeatDelay=t.countingRepeatDelay),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.sheet&&(this.sheet=new m(t.sheet)),void 0!==t.sheetContent&&(this.sheetContent=new A(t.sheetContent)),void 0!==t.manualCountEditDialog&&(this.manualCountEditDialog=new v(t.manualCountEditDialog)),void 0!==t.barcodeInfoMapping&&(this.barcodeInfoMapping=new l(t.barcodeInfoMapping)),void 0!==t.arOverlay&&(this.arOverlay=new o.b(t.arOverlay))}}class y extends r.a{constructor(t={}){if(super(),this.title=new i.j({text:"Title",color:"?sbColorOnSurface"}),this.subtitle=new i.j({text:"Standard explanation message text.",color:"?sbColorOnSurfaceVariant"}),this.sheetColor="?sbColorSurface",this.modalOverlayColor="?sbColorModalOverlay",this.dividerColor="?sbColorOutline",void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.subtitle&&(this.subtitle=new i.j(t.subtitle)),void 0!==t.sheetColor&&(this.sheetColor=t.sheetColor),void 0!==t.modalOverlayColor&&(this.modalOverlayColor=t.modalOverlayColor),void 0!==t.dividerColor&&(this.dividerColor=t.dividerColor),void 0===t.okButton)throw new Error("okButton must be present in constructor argument");if(this.okButton=new i.c(t.okButton),void 0===t.cancelButton)throw new Error("cancelButton must be present in constructor argument");this.cancelButton=new i.c(t.cancelButton)}}class C extends r.a{constructor(t={}){if(super(),this.count=1,void 0===t.barcodeValue)throw new Error("barcodeValue must be present in constructor argument");this.barcodeValue=t.barcodeValue,void 0!==t.title&&(this.title=null!=t.title?t.title:null),void 0!==t.image&&(this.image=null!=t.image?t.image:null),void 0!==t.count&&(this.count=t.count)}}class S extends r.a{constructor(t={}){super(),this._type="FindAndPickScanningMode",this.scanningCompletedColor="?sbColorPositive",this.scanningPartiallyColor="?sbColorWarning",this.scanningNotScannedColor="?sbColorOutline",this.allowPartialScan=!1,this.expectedBarcodes=[],this.countingRepeatDelay=1e3,this.sheet=new m({mode:"COLLAPSED_SHEET",collapsedVisibleHeight:"SMALL",listButton:new i.b({badgeBackgroundColor:"?sbColorSurface",badgeForegroundColor:"?sbColorPrimary",visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.sheetContent=new A({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",manualCountChangeEnabled:!0,manualCountOutlineColor:"?sbColorOutline",manualCountChangeColor:"?sbColorPrimary",title:new i.j({visible:!0,text:"?findAndPickSheetTitle",color:"?sbColorOnSurface",useShadow:!1}),clearAllButton:new i.c({visible:!0,text:"?sheetResetButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),barcodeItemTitle:new i.j({text:"BARCODE_TITLE",color:"?sbColorOnSurface"}),barcodeItemSubtitle:new i.j({text:"?findAndPickSheetBarcodeItemSubtitle",color:"?sbColorOnSurfaceVariant"}),barcodeItemImageVisible:!0,submitButton:new i.c({visible:!0,text:"?sheetSubmitButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnSurface",useShadow:!1})}),startScanningButton:new i.c({visible:!0,text:"?sheetStartScanningButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),placeholderTitle:new i.j({text:"?sheetPlaceholderTitle",color:"?sbColorOnSurface"}),placeholderSubtitle:new i.j({text:"?sheetPlaceholderSubtitle",color:"?sbColorOnSurfaceVariant"}),placeholderIconBackground:"?sbColorOutline",placeholderIcon:new i.e({visible:!0,color:"?sbColorOnSurface"}),swipeToDelete:new g({enabled:!1,backgroundColor:"?sbColorNegative",iconColor:"?sbColorOnPrimary"})}),this.manualCountEditDialog=new v({sheetColor:"?sbColorSurface",dividerColor:"?sbColorOutline",modalOverlayColor:"?sbColorModalOverlay",title:new i.j({text:"?manualCountEditDialogTitle",color:"?sbColorOnSurface"}),info:new i.j({text:"?manualCountEditDialogInfo",color:"?sbColorOnSurfaceVariant"}),updateButton:new i.c({visible:!0,text:"?manualCountEditDialogUpdateButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?manualCountEditDialogCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),clearTextButton:new i.e({visible:!0,color:"?sbColorOnSurfaceVariant"})}),this.arOverlay=new o.a({visible:!1,automaticSelectionEnabled:!0,polygon:new o.f({partiallyScanned:new i.g({strokeColor:"?sbColorWarning",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),rejected:new i.g({strokeColor:"?sbColorSurface",fillColor:"#00000000",strokeWidth:3,cornerRadius:5}),completed:new i.g({strokeColor:"?sbColorPositive",fillColor:"#00000000",strokeWidth:3,cornerRadius:5})}),badge:new o.g({partiallyScanned:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorWarning",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),rejected:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorSurface",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"}),completed:new o.d({visible:!0,background:new i.a({strokeColor:"#000000FF",fillColor:"?sbColorPositive",strokeWidth:0}),foregroundColor:"?sbColorOnSurface"})})}),this.partialScannedAlertDialogEnabled=!0,this.partialScannedAlertDialog=new y({title:new i.j({text:"?findAndPickPartialAlertTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?findAndPickPartialAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new i.c({visible:!0,text:"?findAndPickPartialAlertSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?findAndPickPartialAlertCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),this.confirmationAlertDialogEnabled=!1,this.confirmationAlertDialog=new y({title:new i.j({text:"?findAndPickCompleteAlertTitle",color:"?sbColorOnSurface"}),subtitle:new i.j({text:"?findAndPickCompleteAlertSubtitle",color:"?sbColorOnSurfaceVariant"}),sheetColor:"?sbColorSurface",modalOverlayColor:"?sbColorModalOverlay",dividerColor:"?sbColorOutline",okButton:new i.c({visible:!0,text:"?findAndPickCompleteAlertSubmitButton",background:new i.a({strokeColor:"?sbColorPrimary",fillColor:"?sbColorPrimary",strokeWidth:1}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})}),cancelButton:new i.c({visible:!0,text:"?findAndPickCompleteAlertCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:1}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})})}),void 0!==t.scanningCompletedColor&&(this.scanningCompletedColor=t.scanningCompletedColor),void 0!==t.scanningPartiallyColor&&(this.scanningPartiallyColor=t.scanningPartiallyColor),void 0!==t.scanningNotScannedColor&&(this.scanningNotScannedColor=t.scanningNotScannedColor),void 0!==t.allowPartialScan&&(this.allowPartialScan=t.allowPartialScan),void 0!==t.expectedBarcodes&&(this.expectedBarcodes=t.expectedBarcodes.map((t=>new C(t)))),void 0!==t.countingRepeatDelay&&(this.countingRepeatDelay=t.countingRepeatDelay),void 0!==t.sheet&&(this.sheet=new m(t.sheet)),void 0!==t.sheetContent&&(this.sheetContent=new A(t.sheetContent)),void 0!==t.manualCountEditDialog&&(this.manualCountEditDialog=new v(t.manualCountEditDialog)),void 0!==t.arOverlay&&(this.arOverlay=new o.a(t.arOverlay)),void 0!==t.partialScannedAlertDialogEnabled&&(this.partialScannedAlertDialogEnabled=t.partialScannedAlertDialogEnabled),void 0!==t.partialScannedAlertDialog&&(this.partialScannedAlertDialog=new y(t.partialScannedAlertDialog)),void 0!==t.confirmationAlertDialogEnabled&&(this.confirmationAlertDialogEnabled=t.confirmationAlertDialogEnabled),void 0!==t.confirmationAlertDialog&&(this.confirmationAlertDialog=new y(t.confirmationAlertDialog))}}(h||(h={})).From=function(t){const e=t._type;switch(e){case"SingleScanningMode":return new c(t);case"MultipleScanningMode":return new b(t);case"FindAndPickScanningMode":return new S(t);default:throw`Unknown child class name: ${e}`}};var w,x=n(20);class E extends r.a{constructor(t={}){super(),this.visible=!0,this.style=new L({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),this.overlayColor="?sbColorSurfaceLow",this.aspectRatio=new x.AspectRatio({width:1,height:1}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.style&&(this.style=w.From(t.style)),void 0!==t.overlayColor&&(this.overlayColor=t.overlayColor),void 0!==t.aspectRatio&&(this.aspectRatio=new x.AspectRatio(t.aspectRatio))}}!function(t){t.From=function(t){const e=t._type;switch(e){case"FinderCorneredStyle":return new L(t);case"FinderStrokedStyle":return new _(t);default:throw`Unknown child class name: ${e}`}}}(w||(w={}));class L extends r.a{constructor(t={}){super(),this._type="FinderCorneredStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class _ extends r.a{constructor(t={}){super(),this._type="FinderStrokedStyle",this.strokeColor="#FFFFFFFF",this.strokeWidth=3,this.cornerRadius=10,void 0!==t.strokeColor&&(this.strokeColor=t.strokeColor),void 0!==t.strokeWidth&&(this.strokeWidth=t.strokeWidth),void 0!==t.cornerRadius&&(this.cornerRadius=t.cornerRadius)}}class O extends r.a{constructor(t={}){super(),this.visible=!0,this.title=new i.j({color:"?sbColorOnPrimary"}),this.background=new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow"}),void 0!==t.visible&&(this.visible=t.visible),void 0!==t.title&&(this.title=new i.j(t.title)),void 0!==t.background&&(this.background=new i.a(t.background))}}class T extends r.a{constructor(t={}){super(),this.cameraPermissionEnableCameraTitle="Camera permission denied!",this.cameraPermissionEnableCameraExplanation="Please allow the usage of the camera to start the scanning process.",this.cameraPermissionCloseButton="Close",this.topBarCancelButton="Cancel",this.topBarTitle="Scan Item",this.userGuidance="Move the finder over a barcode",this.barcodeInfoMappingLoadingMessage="Loading details...",this.barcodeInfoMappingErrorStateTitle="Connection Error!",this.barcodeInfoMappingErrorStateSubtitle="There was an issue and the data requested was not fetched. You could try again or discard this result to start a new scan.",this.barcodeInfoMappingErrorStateRetryButton="Retry",this.barcodeInfoMappingErrorStateCancelButton="Cancel",this.manualCountEditDialogTitle="Update count",this.manualCountEditDialogInfo="Adjust the number of items you scanned.",this.manualCountEditDialogUpdateButton="Update",this.manualCountEditDialogCancelButton="Cancel",this.sheetResetButton="Reset",this.sheetClearAllButton="Clear all",this.sheetSubmitButton="Submit",this.sheetStartScanningButton="Start scanning",this.sheetPlaceholderTitle="No barcodes here!",this.sheetPlaceholderSubtitle="The barcode list is currently empty. Close this sheet and scan your items to add them.",this.singleModeConfirmationCancelButton="Close",this.multipleModeSheetTitle="%d items",this.findAndPickSheetTitle="%d/%d scanned",this.findAndPickSheetBarcodeItemSubtitle="%d/%d added",this.findAndPickPartialAlertTitle="Incomplete scan!",this.findAndPickPartialAlertSubtitle="Some codes are yet to be scanned. Proceed with submission anyway?",this.findAndPickPartialAlertCancelButton="Cancel",this.findAndPickPartialAlertSubmitButton="Yes, Submit",this.findAndPickCompleteAlertTitle="All codes found!",this.findAndPickCompleteAlertSubtitle="You have successfully scanned all codes. Proceed with submission?",this.findAndPickCompleteAlertCancelButton="Dismiss",this.findAndPickCompleteAlertSubmitButton="Submit",void 0!==t.cameraPermissionEnableCameraTitle&&(this.cameraPermissionEnableCameraTitle=t.cameraPermissionEnableCameraTitle),void 0!==t.cameraPermissionEnableCameraExplanation&&(this.cameraPermissionEnableCameraExplanation=t.cameraPermissionEnableCameraExplanation),void 0!==t.cameraPermissionCloseButton&&(this.cameraPermissionCloseButton=t.cameraPermissionCloseButton),void 0!==t.topBarCancelButton&&(this.topBarCancelButton=t.topBarCancelButton),void 0!==t.topBarTitle&&(this.topBarTitle=t.topBarTitle),void 0!==t.userGuidance&&(this.userGuidance=t.userGuidance),void 0!==t.barcodeInfoMappingLoadingMessage&&(this.barcodeInfoMappingLoadingMessage=t.barcodeInfoMappingLoadingMessage),void 0!==t.barcodeInfoMappingErrorStateTitle&&(this.barcodeInfoMappingErrorStateTitle=t.barcodeInfoMappingErrorStateTitle),void 0!==t.barcodeInfoMappingErrorStateSubtitle&&(this.barcodeInfoMappingErrorStateSubtitle=t.barcodeInfoMappingErrorStateSubtitle),void 0!==t.barcodeInfoMappingErrorStateRetryButton&&(this.barcodeInfoMappingErrorStateRetryButton=t.barcodeInfoMappingErrorStateRetryButton),void 0!==t.barcodeInfoMappingErrorStateCancelButton&&(this.barcodeInfoMappingErrorStateCancelButton=t.barcodeInfoMappingErrorStateCancelButton),void 0!==t.manualCountEditDialogTitle&&(this.manualCountEditDialogTitle=t.manualCountEditDialogTitle),void 0!==t.manualCountEditDialogInfo&&(this.manualCountEditDialogInfo=t.manualCountEditDialogInfo),void 0!==t.manualCountEditDialogUpdateButton&&(this.manualCountEditDialogUpdateButton=t.manualCountEditDialogUpdateButton),void 0!==t.manualCountEditDialogCancelButton&&(this.manualCountEditDialogCancelButton=t.manualCountEditDialogCancelButton),void 0!==t.sheetResetButton&&(this.sheetResetButton=t.sheetResetButton),void 0!==t.sheetClearAllButton&&(this.sheetClearAllButton=t.sheetClearAllButton),void 0!==t.sheetSubmitButton&&(this.sheetSubmitButton=t.sheetSubmitButton),void 0!==t.sheetStartScanningButton&&(this.sheetStartScanningButton=t.sheetStartScanningButton),void 0!==t.sheetPlaceholderTitle&&(this.sheetPlaceholderTitle=t.sheetPlaceholderTitle),void 0!==t.sheetPlaceholderSubtitle&&(this.sheetPlaceholderSubtitle=t.sheetPlaceholderSubtitle),void 0!==t.singleModeConfirmationCancelButton&&(this.singleModeConfirmationCancelButton=t.singleModeConfirmationCancelButton),void 0!==t.multipleModeSheetTitle&&(this.multipleModeSheetTitle=t.multipleModeSheetTitle),void 0!==t.findAndPickSheetTitle&&(this.findAndPickSheetTitle=t.findAndPickSheetTitle),void 0!==t.findAndPickSheetBarcodeItemSubtitle&&(this.findAndPickSheetBarcodeItemSubtitle=t.findAndPickSheetBarcodeItemSubtitle),void 0!==t.findAndPickPartialAlertTitle&&(this.findAndPickPartialAlertTitle=t.findAndPickPartialAlertTitle),void 0!==t.findAndPickPartialAlertSubtitle&&(this.findAndPickPartialAlertSubtitle=t.findAndPickPartialAlertSubtitle),void 0!==t.findAndPickPartialAlertCancelButton&&(this.findAndPickPartialAlertCancelButton=t.findAndPickPartialAlertCancelButton),void 0!==t.findAndPickPartialAlertSubmitButton&&(this.findAndPickPartialAlertSubmitButton=t.findAndPickPartialAlertSubmitButton),void 0!==t.findAndPickCompleteAlertTitle&&(this.findAndPickCompleteAlertTitle=t.findAndPickCompleteAlertTitle),void 0!==t.findAndPickCompleteAlertSubtitle&&(this.findAndPickCompleteAlertSubtitle=t.findAndPickCompleteAlertSubtitle),void 0!==t.findAndPickCompleteAlertCancelButton&&(this.findAndPickCompleteAlertCancelButton=t.findAndPickCompleteAlertCancelButton),void 0!==t.findAndPickCompleteAlertSubmitButton&&(this.findAndPickCompleteAlertSubmitButton=t.findAndPickCompleteAlertSubmitButton)}}class k extends r.a{constructor(t={}){super(),this.barcodesRegexFilter="",this.barcodeFormats=[],this.gs1Handling="PARSE",this.engineMode="NEXT_GEN_LOW_POWER",this.maximumRecognizerResolution=600,void 0!==t.barcodesRegexFilter&&(this.barcodesRegexFilter=t.barcodesRegexFilter),void 0!==t.barcodeFormats&&(this.barcodeFormats=t.barcodeFormats.map((t=>t))),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.maximumRecognizerResolution&&(this.maximumRecognizerResolution=t.maximumRecognizerResolution)}}class D extends r.a{constructor(t={}){super(),this.background="?sbColorSurface",this.iconBackground="?sbColorOutline",this.icon=new i.e({visible:!0,color:"?sbColorOnSurface"}),this.closeButton=new i.c({text:"Close",background:new i.a({}),foreground:new i.d({})}),this.enableCameraTitle=new i.j({text:"Camera permission denied!",color:"?colorOnSurface"}),this.enableCameraExplanation=new i.j({text:"Please allow the usage of the camera to start the scanning process.",color:"?sbColorOnSurfaceVariant"}),void 0!==t.background&&(this.background=t.background),void 0!==t.iconBackground&&(this.iconBackground=t.iconBackground),void 0!==t.icon&&(this.icon=new i.e(t.icon)),void 0!==t.closeButton&&(this.closeButton=new i.c(t.closeButton)),void 0!==t.enableCameraTitle&&(this.enableCameraTitle=new i.j(t.enableCameraTitle)),void 0!==t.enableCameraExplanation&&(this.enableCameraExplanation=new i.j(t.enableCameraExplanation))}}class P extends r.a{constructor(t={}){super(),this.version="1.0",this.screen="BarcodeScanner",this.palette=new i.f({sbColorPrimary:"#C8193C",sbColorPrimaryDisabled:"#F5F5F5",sbColorNegative:"#FF3737",sbColorPositive:"#4EFFB4",sbColorWarning:"#FFCE5C",sbColorSecondary:"#FFEDEE",sbColorSecondaryDisabled:"#F5F5F5",sbColorOnPrimary:"#FFFFFF",sbColorOnSecondary:"#C8193C",sbColorSurface:"#FFFFFF",sbColorOutline:"#EFEFEF",sbColorOnSurfaceVariant:"#707070",sbColorOnSurface:"#000000",sbColorSurfaceLow:"#00000026",sbColorSurfaceHigh:"#0000007A",sbColorModalOverlay:"#000000A3"}),this.localization=new T({}),this.backgroundColor="?sbColorSurfaceLow",this.topBar=new f.a({title:new i.j({text:"?topBarTitle",color:"?sbColorOnPrimary"}),mode:"SOLID",backgroundColor:"?sbColorPrimary",cancelButton:new i.c({visible:!0,text:"?topBarCancelButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({iconVisible:!0,color:"?sbColorOnPrimary",useShadow:!1})})}),this.actionBar=new p({flashButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorWarning",activeForegroundColor:"#1C1B1F"}),zoomButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"}),flipCameraButton:new i.h({visible:!0,backgroundColor:"?sbColorSurfaceHigh",foregroundColor:"?sbColorOnPrimary",activeBackgroundColor:"?sbColorSurfaceHigh",activeForegroundColor:"?sbColorOnPrimary"})}),this.viewFinder=new E({visible:!0,style:new L({strokeColor:"?sbColorSurface",strokeWidth:2,cornerRadius:10}),overlayColor:"?sbColorSurfaceLow",aspectRatio:new x.AspectRatio({width:1,height:1})}),this.userGuidance=new O({visible:!0,title:new i.j({text:"?userGuidance",color:"?sbColorOnPrimary"}),background:new i.a({strokeColor:"#00000000",fillColor:"?sbColorSurfaceLow",strokeWidth:0})}),this.cameraPermission=new D({background:"?sbColorSurface",iconBackground:"?sbColorOutline",icon:new i.e({visible:!0,color:"?sbColorOnSurface"}),closeButton:new i.c({visible:!0,text:"?cameraPermissionCloseButton",background:new i.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new i.d({iconVisible:!1,color:"?sbColorPrimary",useShadow:!1})}),enableCameraTitle:new i.j({text:"?cameraPermissionEnableCameraTitle",color:"?sbColorOnSurface"}),enableCameraExplanation:new i.j({text:"?cameraPermissionEnableCameraExplanation",color:"?sbColorOnSurfaceVariant"})}),this.cameraConfiguration=new d({}),this.recognizerConfiguration=new k({}),this.useCase=new c({}),this.sound=new i.i({successBeepEnabled:!0,soundType:"MODERN_BEEP"}),this.vibration=new i.l({enabled:!0}),this.timeouts=new i.k({autoCancelTimeout:0,initialScanDelay:0}),void 0!==t.version&&(this.version=t.version),void 0!==t.screen&&(this.screen=t.screen),void 0!==t.palette&&(this.palette=new i.f(t.palette)),void 0!==t.localization&&(this.localization=new T(t.localization)),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.topBar&&(this.topBar=new f.a(t.topBar)),void 0!==t.actionBar&&(this.actionBar=new p(t.actionBar)),void 0!==t.viewFinder&&(this.viewFinder=new E(t.viewFinder)),void 0!==t.userGuidance&&(this.userGuidance=new O(t.userGuidance)),void 0!==t.cameraPermission&&(this.cameraPermission=new D(t.cameraPermission)),void 0!==t.cameraConfiguration&&(this.cameraConfiguration=new d(t.cameraConfiguration)),void 0!==t.recognizerConfiguration&&(this.recognizerConfiguration=new k(t.recognizerConfiguration)),void 0!==t.useCase&&(this.useCase=h.From(t.useCase)),void 0!==t.sound&&(this.sound=new i.i(t.sound)),void 0!==t.vibration&&(this.vibration=new i.l(t.vibration)),void 0!==t.timeouts&&(this.timeouts=new i.k(t.timeouts))}}var B=n(35);class F extends r.a{constructor(t={}){if(super(),void 0===t.barcode)throw new Error("barcode must be present in constructor argument");if(this.barcode=new B.BarcodeItem(t.barcode),void 0===t.count)throw new Error("count must be present in constructor argument");this.count=t.count}}class R extends r.a{constructor(t={}){super(),this.items=[],void 0!==t.items&&(this.items=t.items.map((t=>new F(t))))}}var I=n(19)},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=n(36);class i extends o.a{constructor(t){super(),this.mirrored=!1,this.spinnerColor="black",this.backgroundColor="black",this.videoConstraints={width:{ideal:t.width},height:{ideal:t.height},facingMode:"environment",resizeMode:"none",experimental:{focusMode:"continous",focusDistance:0}}}static mapVideoConstraints(t,e){t.videoConstraints&&this.mapValues(t.videoConstraints,e.videoConstraints)}}i.DEFAULT_VIDEO_RESOLUTION_4K={width:3840,height:2160},i.DEFAULT_VIDEO_RESOLUTION_HD={width:1920,height:1080},i.DEFAULT_ACCEPTED_BRIGHTNESS_SCORE=0,i.DEFAULT_ACCEPTED_ANGLE_SCORE=75,i.DEFAULT_ACCEPTED_SIZE_SCORE=75},function(t,e,n){"use strict";n.d(e,"a",(function(){return i}));var o=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class i extends Error{constructor(t,e,n){super(e),this.name="",this.name=t,this.message=e,this.webApiError=n}static mediaDevicesUndefined(){return new i(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? If so, please use a secure context (HTTPS) or use 'localhost' explicitly.")}static enumerateDevicesFailed(){return new i(this.MESSAGE.DEVICES_UNDEFINED,"Does your device even have a camera? Because we're unable to query query navigator.mediaDevices?.enumerateDevices")}static mediaDeviceNotFound(t){return new i(this.MESSAGE.ENUMERATE_FAILED,"Does your device even have a camera? Because we were unable to query navigator.mediaDevices?.getUserMedia().",t)}static permissionDenied(t){return new i(this.MESSAGE.PERMISSION_DENIED,"Camera permission has not been granted. Please prompt your users again to grant permission.",t)}static unknown(t){return new i(this.MESSAGE.UNKNOWN,"\n Unfortunately we were unable to query navigator.mediaDevicess.getUserMedia, \n and unable to determine the reason why. This may be caused by the user to denied the permission prompt. \n Or you may be using an in-app browser that itself has not been granted permission to use the camera.\n Or your users may be using a niche browser that does not support the media API at all!\n ",t)}static tryCheckPermission(){return o(this,void 0,void 0,(function*(){if(!this.permissionState)try{const t=yield navigator.permissions.query({name:"camera"});this.permissionState=t.state}catch(t){this.permissionState=this.PERMISSION_STATE.UNKNOWN}}))}static hasDeniedPermission(){return this.permissionState===this.PERMISSION_STATE.DENIED}static hasCheckedPermission(){return!!this.permissionState}static createFromDOMException(t){return t instanceof DOMException?"NotAllowedError"===t.name?i.permissionDenied("Specifically, the native 'NotAllowedError' was thrown."):"NotFoundError"===t.name?i.mediaDeviceNotFound("Specifically, the native 'NotFoundError' was thrown."):void 0:i.unknown(null==t?void 0:t.message)}}i.PERMISSION_STATE={GRANTED:"granted",DENIED:"denied",PROMPT:"prompt",UNKNOWN:"unknown"},i.MESSAGE={DEVICES_UNDEFINED:"MediaError_DevicesUndefined",DEVICE_NOT_FOUND:"MediaError_DeviceNotFound",ENUMERATE_FAILED:"MediaError_EnumerateFailed",PERMISSION_DENIED:"MediaError_PermissionDenied",UNKNOWN:"MediaError_Unknown"}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{static initialize(t=!1){this.verbose=t}static debug(t){this.verbose&&console.log("ScanbotSDK:",t)}static debugWarn(t){this.verbose&&console.warn("ScanbotSDK:",t)}}},,,function(t,e,n){"use strict";n.r(e),n.d(e,"OcrResult",(function(){return i})),n.d(e,"FieldParsedData",(function(){return r})),n.d(e,"FieldType",(function(){return a})),n.d(e,"Field",(function(){return s})),n.d(e,"GenericDocumentType",(function(){return l})),n.d(e,"GenericDocument",(function(){return c}));var o=n(4);class i extends o.a{constructor(t={}){if(super(),void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0===t.confidence)throw new Error("confidence must be present in constructor argument");this.confidence=t.confidence}}class r extends o.a{constructor(t={}){if(super(),void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=t.type,void 0===t.value)throw new Error("value must be present in constructor argument");this.value=t.value}}class a extends o.a{constructor(t={}){if(super(),this.listIndex=null,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=t.fullName,void 0===t.normalizedName)throw new Error("normalizedName must be present in constructor argument");if(this.normalizedName=t.normalizedName,void 0===t.commonType)throw new Error("commonType must be present in constructor argument");this.commonType=null!=t.commonType?t.commonType:null,void 0!==t.listIndex&&(this.listIndex=null!=t.listIndex?t.listIndex:null)}}class s extends o.a{constructor(t={}){if(super(),this.confidenceWeight=1,this.image=null,this.validationStatus="NONE",this.parsedData=[],void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=new a(t.type),void 0===t.value)throw new Error("value must be present in constructor argument");if(this.value=null!=t.value?new i(t.value):null,void 0!==t.confidenceWeight&&(this.confidenceWeight=t.confidenceWeight),void 0!==t.image&&(this.image=null!=t.image?t.image:null),void 0===t.polygonInRoot)throw new Error("polygonInRoot must be present in constructor argument");this.polygonInRoot=t.polygonInRoot.map((t=>({x:t.x,y:t.y}))),void 0!==t.validationStatus&&(this.validationStatus=t.validationStatus),void 0!==t.parsedData&&(this.parsedData=t.parsedData.map((t=>new r(t))))}}class l extends o.a{constructor(t={}){if(super(),this.listIndex=null,void 0===t.name)throw new Error("name must be present in constructor argument");if(this.name=t.name,void 0===t.fullName)throw new Error("fullName must be present in constructor argument");if(this.fullName=t.fullName,void 0===t.normalizedName)throw new Error("normalizedName must be present in constructor argument");this.normalizedName=t.normalizedName,void 0!==t.listIndex&&(this.listIndex=null!=t.listIndex?t.listIndex:null)}}class c extends o.a{constructor(t={}){if(super(),this.crop=null,this.confidence=0,this.confidenceWeight=0,void 0===t.type)throw new Error("type must be present in constructor argument");if(this.type=new l(t.type),void 0===t.fields)throw new Error("fields must be present in constructor argument");if(this.fields=t.fields.map((t=>new s(t))),void 0===t.children)throw new Error("children must be present in constructor argument");if(this.children=t.children.map((t=>new c(t))),void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=null!=t.quad?t.quad.map((t=>({x:t.x,y:t.y}))):null,void 0===t.quadInRoot)throw new Error("quadInRoot must be present in constructor argument");this.quadInRoot=null!=t.quadInRoot?t.quadInRoot.map((t=>({x:t.x,y:t.y}))):null,void 0!==t.crop&&(this.crop=null!=t.crop?t.crop:null),void 0!==t.confidence&&(this.confidence=t.confidence),void 0!==t.confidenceWeight&&(this.confidenceWeight=t.confidenceWeight)}}},function(t,e,n){"use strict";n.r(e),n.d(e,"LineSegmentInt",(function(){return i})),n.d(e,"LineSegmentFloat",(function(){return r})),n.d(e,"AspectRatio",(function(){return a}));var o=n(4);class i extends o.a{constructor(t={}){if(super(),void 0===t.start)throw new Error("start must be present in constructor argument");if(this.start={x:t.start.x,y:t.start.y},void 0===t.end)throw new Error("end must be present in constructor argument");this.end={x:t.end.x,y:t.end.y}}}class r extends o.a{constructor(t={}){if(super(),void 0===t.start)throw new Error("start must be present in constructor argument");if(this.start={x:t.start.x,y:t.start.y},void 0===t.end)throw new Error("end must be present in constructor argument");this.end={x:t.end.x,y:t.end.y}}}class a extends o.a{constructor(t={}){super(),this.width=1,this.height=1,void 0!==t.width&&(this.width=t.width),void 0!==t.height&&(this.height=t.height)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(t,e,n,o){this.x=t,this.y=e,this.width=n,this.height=o}scaleDown(t){return new o(this.x/t,this.y/t,this.width/t,this.height/t)}bottom(){return this.y+this.height}static withSize(t,e){return new o(0,0,t,e)}static empty(){return new o(0,0,0,0)}static fromRect(t){return t?new o(t.x,t.y,t.width,t.height):o.empty()}static fromPoint(t,e){return new o(t.x-e/2,t.y-e/2,e,e)}static fromDOMRect(t){return new o(t.x,t.y,t.width,t.height)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(14),i=n(13);class r extends o.a{constructor(t){super(t);const e=new i.BarcodeScannerConfiguration;this.finder=e.viewFinder,this.userGuidance=e.userGuidance}static mapFinderConfiguration(t,e){var n,i;o.a.mapValuesDeep(null!==(n=e.finder)&&void 0!==n?n:{},t.finder),o.a.mapValuesDeep(null!==(i=e.userGuidance)&&void 0!==i?i:{},t.userGuidance)}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return m}));var o=n(0),i=n(15),r=n(25),a=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class s extends o.default.Component{constructor(t){super(t),this.orientationchangeCallback=this.orientationChanged.bind(this),this.state={orientation:window.orientation,stream:void 0}}orientationChanged(t){this.setState({orientation:window.orientation})}setDeviceIdInConstraints(t){var e,n;return a(this,void 0,void 0,(function*(){const o=this.props.preferredCamera;if(o)try{const e=(yield navigator.mediaDevices.enumerateDevices()).find((t=>t.deviceId===o||t.label===o));if(e)return Object.assign(Object.assign({},t),{deviceId:e.deviceId})}catch(t){throw i.a.enumerateDevicesFailed()}else{const o={user:"front",environment:"back"},i=(null===(e=null==t?void 0:t.facingMode)||void 0===e?void 0:e.ideal)||(null===(n=null==t?void 0:t.facingMode)||void 0===n?void 0:n.exact)||(null==t?void 0:t.facingMode);if("string"==typeof i&&i in o){yield r.a.INSTANCE.load();const e=r.a.INSTANCE.getMainCamera(o[i]);if(e)return Object.assign(Object.assign({},t),{deviceId:e.deviceId})}}return t}))}componentDidMount(){return a(this,void 0,void 0,(function*(){window.addEventListener("orientationchange",this.orientationchangeCallback),yield this.refreshStream()}))}refreshStream(){var t,e,n,o,r,s,l,c;return a(this,void 0,void 0,(function*(){if(console.log("refreshStream",this),i.a.hasCheckedPermission()||(yield i.a.tryCheckPermission()),i.a.hasDeniedPermission())return void(null===(e=(t=this.props).onError)||void 0===e||e.call(t,i.a.permissionDenied()));const a={video:yield this.setDeviceIdInConstraints(this.props.videoConstraints)};try{if(!navigator.mediaDevices){const t=i.a.unknown();return null===(o=(n=this.props).onError)||void 0===o||o.call(n,t),void console.log(t)}this.stopCurrentStreams();try{const t=yield navigator.mediaDevices.getUserMedia(a);this.setState({stream:t},(()=>{var e,n,o,i;null===(n=(e=this.props).onStreamChanged)||void 0===n||n.call(e,t),null===(i=(o=this.props).onReady)||void 0===i||i.call(o)}))}catch(t){const e=i.a.mediaDeviceNotFound();return null===(s=(r=this.props).onError)||void 0===s||s.call(r,e),void console.error(e)}}catch(t){const e=i.a.createFromDOMException(t);return null===(c=(l=this.props).onError)||void 0===c||c.call(l,e),void console.error(e)}}))}stopCurrentStreams(){const t=this.state.stream,e=null==t?void 0:t.getTracks();e&&e.forEach((t=>{t.stop()}))}componentWillUnmount(){window.removeEventListener("orientationchange",this.orientationchangeCallback),this.state.stream&&(this.state.stream.getVideoTracks&&this.state.stream.getAudioTracks&&(this.state.stream.getVideoTracks().forEach((t=>t.stop())),this.state.stream.getAudioTracks().forEach((t=>t.stop()))),this.setState({stream:void 0}))}render(){return this.props.children}updateTorch(t){return a(this,void 0,void 0,(function*(){const e=[{torch:t}];yield this.state.stream.getVideoTracks()[0].applyConstraints({advanced:e})}))}getCapabilities(){if(this.state.stream.getVideoTracks){const t=this.getVideoTrack();return s.getMediaTrackCapabilities(t)}}static getMediaTrackCapabilities(t){if(t&&t.getCapabilities)return t.getCapabilities()}getVideoTrack(){const t=this.state.stream.getVideoTracks();if(t.length>0)return t[0]}}var l=n(10),c=n(21),u=n(16),d=n(34);class h{static isSupported(){return!!document.createElement("canvas").getContext("webgl")}constructor(){this._type="WebGL",this.canvas=document.createElement("canvas");const t=this.gl=this.canvas.getContext("webgl",{willReadFrequently:!0}),e=t.createTexture();t.activeTexture(t.TEXTURE0),t.bindTexture(t.TEXTURE_2D,e),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR);const n=t.createShader(t.VERTEX_SHADER);t.shaderSource(n,"attribute vec2 p;void main(){ gl_Position = vec4(p,0,1);}"),t.compileShader(n);const o=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(o,"precision mediump float;uniform sampler2D texture; uniform vec2 scale; uniform vec2 offset; void main() { gl_FragColor=texture2D( texture, gl_FragCoord.xy * scale + offset );}"),t.compileShader(o);const i=this.program=t.createProgram();t.attachShader(i,n),t.attachShader(i,o),t.linkProgram(i),t.useProgram(i),t.uniform1i(t.getUniformLocation(i,"texture"),0),t.bindBuffer(t.ARRAY_BUFFER,t.createBuffer()),t.bufferData(t.ARRAY_BUFFER,new Float32Array([-1,-1,1,-1,-1,1,-1,1,1,-1,1,1]),t.STATIC_DRAW),t.enableVertexAttribArray(0),t.vertexAttribPointer(0,2,t.FLOAT,!1,0,0)}getImageData(t,e,n,o,i,r,a,s){let l,c;if(r=Math.floor(r),a=Math.floor(a),e=Math.floor(e),n=Math.floor(n),o=Math.floor(o),i=Math.floor(i),t instanceof HTMLVideoElement)[c,l]=[t.videoWidth,t.videoHeight];else{if(!(t instanceof HTMLCanvasElement))throw new Error("Unsupported source type");[c,l]=[t.width,t.height]}(c<e+o||l<n+i)&&u.a.debug("Crop region exceeds source video dimensions. This can happen when the screen is resized or rotated and the video has not yet changed its size. Most likely, the frame we analyzed now contains some garbage data. This is not a problem, unless it happens very frequently.");const h=this.gl;this.canvas.width=r,this.canvas.height=a,h.viewport(0,0,r,a);const f=[o/(r*c),i/(a*l)],p=[e/c,n/l];return h.uniform2fv(h.getUniformLocation(this.program,"scale"),f),h.uniform2fv(h.getUniformLocation(this.program,"offset"),p),h.texImage2D(h.TEXTURE_2D,0,h.RGB,h.RGB,h.UNSIGNED_BYTE,t),h.drawArrays(h.TRIANGLES,0,6),(null==s?void 0:s.byteLength)!==r*a*4&&(s=new Uint8ClampedArray(r*a*4),d.a.INSTANCE.values.set("WebGLNumBufferAllocations",(d.a.INSTANCE.values.get("WebGLNumBufferAllocations")||0)+1)),h.readPixels(0,0,r,a,h.RGBA,h.UNSIGNED_BYTE,s),new ImageData(s,r,a)}}class f{constructor(){this._type="TwoD",this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d",{willReadFrequently:!0,alpha:!1}),this.ctx.imageSmoothingEnabled=!1}getImageData(t,e,n,o,i,r,a,s){return this.canvas.width=r,this.canvas.height=a,this.ctx.drawImage(t,e,n,o,i,0,0,r,a),this.ctx.getImageData(0,0,r,a)}}var p=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class m extends o.default.Component{constructor(t){super(t),this.videoLoaded=!1,this.reloadCanvas=!0,this.swapCameraEnabled=!0,this.activeCamera=void 0,this.save=!1,this._reusableImageBuffer=null,this.onStreamChanged=t=>{this.video.srcObject=t,this.updateCameraInfo(t),this.video.addEventListener("resize",(t=>{this.reloadCanvas=!0}),!1),this.video.addEventListener("loadeddata",(t=>{this.videoLoaded=!0,this.didLoadVideo&&this.didLoadVideo()}),!1)},this.state={facingModeBack:"environment"===this.props.videoConstraints.facingMode,mirrored:this.props.mirrored,deviceId:void 0}}videoSize(){const{clientVideoWidth:t,clientVideoHeight:e}=this.calculateClientVideoConstraints();return new l.a(t,e)}saveExtractedData(){this.save=!0}zoom(){var t;return null!==(t=this.props.zoom)&&void 0!==t?t:1}imageCapture(){if(this.capture)return this.capture;const t=this.videoStream.getVideoTrack();return this.capture=new ImageCapture(t),this.capture}set reusableImageBuffer(t){this._reusableImageBuffer=t}createImageData(t=0,e){return p(this,void 0,void 0,(function*(){if(!this.video||!this.videoLoaded)return;const n=this.getCanvasRenderingContext();if(!n)return;if(e){const t=yield this.imageCapture().takePhoto(),e=yield createImageBitmap(t);u.a.debug("Bitmap size: "+e.width*e.height);const o=this.windowSize(),i=e.height/(o.height+o.y),r=o.width*i,a=o.height*i,s=e.width/2-r/2,l=o.y*i,d=new c.a(s,l,r,a);return u.a.debug("Frame size: "+d.x+"-"+d.y+"-"+d.width+"-"+d.height),n.getImageData(this.video,d.x,d.y,e.width,e.height,d.width,d.height,this._reusableImageBuffer)}let{videoWidth:o,videoHeight:i}=this.video,{clientVideoWidth:r,clientVideoHeight:a,coef:s}=this.calculateClientVideoConstraints();if(0===s)return;const l=this.finderFrame||new c.a(0,0,r,a),d=this.zoom(),h=(o-r/d)/2,f=(i-a/d)/2,p=l.x/s+h,m=l.y/s+f,g=this.finderFrame?s:d,v=l.width/g,A=l.height/g,b=this.calculateFrameSize(t,v,A);return n.getImageData(this.video,p,m,v,A,b.width,b.height,this._reusableImageBuffer)}))}windowSize(){var t;const e=this.props.configuration,n=null!==(t=e.container)&&void 0!==t?t:document.getElementById(e.containerId);if(!n)throw new Error("Container DOM element is required to calculate window size and snap image.");return c.a.fromDOMRect(n.getBoundingClientRect())}calculateClientVideoConstraints(){let{videoWidth:t,videoHeight:e}=this.video,n=this.video.getBoundingClientRect(),o=t,i=e,r=1;return n.width/n.height<=t/e?(r=n.height/e,r>0&&(o=n.width/r)):(r=n.width/t,r>0&&(i=n.height/r)),{clientVideoWidth:o,clientVideoHeight:i,coef:r}}calculateFrameSize(t,e,n){let o=e,i=n;if(t>0&&0!=e&&0!=n){const r=e/n;e>n?(o=e>t?t:e,i=o/r):(i=n>t?t:n,o=i*r)}return new l.a(o,i)}getCanvasRenderingContext(){return this.video?0===this.video.videoWidth?null:(this.canvas&&!this.reloadCanvas||(this.canvas&&this.releaseCanvas(),this.canvas=h.isSupported()?new h:new f,this.reloadCanvas=!1),this.canvas):null}releaseCanvas(){this.canvas&&(this.canvas=null)}componentWillUnmount(){this.releaseCanvas(),this.video=null,this.videoStream=null}style(){var t;const e={display:"block",width:100*this.zoom()+"%",height:100*this.zoom()+"%",left:`${this.zoomMargin()}%`,top:`${this.zoomMargin()}%`,position:"relative",objectFit:"cover",backgroundColor:null===(t=this.props.configuration)||void 0===t?void 0:t.backgroundColor};return this.state.mirrored&&(e.transform="scaleX(-1)"),e}zoomMargin(){const t=this.zoom();return 1===t?0:(1-t)/2*100}render(){const{videoConstraints:t,onReady:e,onError:n}=this.props;return o.default.createElement(s,{videoConstraints:t,preferredCamera:this.state.deviceId||this.props.preferredCamera,onReady:e,onStreamChanged:this.onStreamChanged,onError:n,ref:t=>{this.videoStream=t}},o.default.createElement("video",{autoPlay:!0,muted:!0,playsInline:!0,className:"scanbot-camera-view",ref:t=>{this.video=t},style:this.style()}))}setDirection(t){this.props.videoConstraints.facingMode={ideal:t},this.setState({facingModeBack:"environment"===t,mirrored:"user"===t},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}swapCameraFacing(t){if(this.swapCameraEnabled){this.swapCameraEnabled=!1;const e=!this.state.facingModeBack,n=e?"environment":"user";this.props.videoConstraints.facingMode=!0===t?{exact:n}:{ideal:n},this.setState({facingModeBack:e,mirrored:!e},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0}))))}}switchCamera(t,e){return p(this,void 0,void 0,(function*(){this.swapCameraEnabled&&(this.swapCameraEnabled=!1,this.props.videoConstraints.facingMode=void 0,this.setState({facingModeBack:void 0,mirrored:null!=e?e:this.state.mirrored,deviceId:t},(()=>p(this,void 0,void 0,(function*(){yield this.videoStream.refreshStream(),this.swapCameraEnabled=!0})))))}))}updateCameraInfo(t){this.activeCamera=r.a.getCameraInfoFromStream(t)}getActiveCameraInfo(){return this.activeCamera}setTorchState(t){if(this.activeCamera&&this.activeCamera.supportsTorchControl){return this.videoStream.getVideoTrack().applyConstraints({advanced:[{torch:t}]})}return Promise.reject("Torch is not supported for current camera.")}}},function(t,e,n){"use strict";(function(t){n.d(e,"a",(function(){return Qt})),n.d(e,"b",(function(){return Yt}));var o=n(2),i=(n(46),n(0)),r=n(44),a=n.n(r),s=n(28),l=n(45),c="undefined"!=typeof t&&void 0!==t.env&&(t.env.REACT_APP_SC_ATTR||t.env.SC_ATTR)||"data-styled",u="active",d="data-styled-version",h="6.1.8",f="/*!sc*/\n",p="undefined"!=typeof window&&"HTMLElement"in window,m=Boolean("boolean"==typeof SC_DISABLE_SPEEDY?SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&void 0!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&""!==t.env.REACT_APP_SC_DISABLE_SPEEDY?"false"!==t.env.REACT_APP_SC_DISABLE_SPEEDY&&t.env.REACT_APP_SC_DISABLE_SPEEDY:"undefined"!=typeof t&&void 0!==t.env&&void 0!==t.env.SC_DISABLE_SPEEDY&&""!==t.env.SC_DISABLE_SPEEDY&&("false"!==t.env.SC_DISABLE_SPEEDY&&t.env.SC_DISABLE_SPEEDY)),g=(new Set,Object.freeze([])),v=Object.freeze({});function A(t,e,n){return void 0===n&&(n=v),t.theme!==n.theme&&t.theme||e||n.theme}var b=new Set(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","track","u","ul","use","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","marker","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"]),y=/[!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~-]+/g,C=/(^-|-$)/g;function S(t){return t.replace(y,"-").replace(C,"")}var w=/(a)(d)/gi,x=function(t){return String.fromCharCode(t+(t>25?39:97))};function E(t){var e,n="";for(e=Math.abs(t);e>52;e=e/52|0)n=x(e%52)+n;return(x(e%52)+n).replace(w,"$1-$2")}var L,_=function(t,e){for(var n=e.length;n;)t=33*t^e.charCodeAt(--n);return t},O=function(t){return _(5381,t)};function T(t){return E(O(t)>>>0)}function k(t){return t.displayName||t.name||"Component"}function D(t){return"string"==typeof t&&!0}var P="function"==typeof Symbol&&Symbol.for,B=P?Symbol.for("react.memo"):60115,F=P?Symbol.for("react.forward_ref"):60112,R={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},I={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},W={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},M=((L={})[F]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},L[B]=W,L);function j(t){return("type"in(e=t)&&e.type.$$typeof)===B?W:"$$typeof"in t?M[t.$$typeof]:R;var e}var z=Object.defineProperty,N=Object.getOwnPropertyNames,V=Object.getOwnPropertySymbols,U=Object.getOwnPropertyDescriptor,H=Object.getPrototypeOf,G=Object.prototype;function Q(t,e,n){if("string"!=typeof e){if(G){var o=H(e);o&&o!==G&&Q(t,o,n)}var i=N(e);V&&(i=i.concat(V(e)));for(var r=j(t),a=j(e),s=0;s<i.length;++s){var l=i[s];if(!(l in I||n&&n[l]||a&&l in a||r&&l in r)){var c=U(e,l);try{z(t,l,c)}catch(t){}}}}return t}function Y(t){return"function"==typeof t}function Z(t){return"object"==typeof t&&"styledComponentId"in t}function q(t,e){return t&&e?"".concat(t," ").concat(e):t||e||""}function X(t,e){if(0===t.length)return"";for(var n=t[0],o=1;o<t.length;o++)n+=e?e+t[o]:t[o];return n}function $(t){return null!==t&&"object"==typeof t&&t.constructor.name===Object.name&&!("props"in t&&t.$$typeof)}function K(t,e,n){if(void 0===n&&(n=!1),!n&&!$(t)&&!Array.isArray(t))return e;if(Array.isArray(e))for(var o=0;o<e.length;o++)t[o]=K(t[o],e[o]);else if($(e))for(var o in e)t[o]=K(t[o],e[o]);return t}function J(t,e){Object.defineProperty(t,"toString",{value:e})}function tt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];return new Error("An error occurred. See https://github.com/styled-components/styled-components/blob/main/packages/styled-components/src/utils/errors.md#".concat(t," for more information.").concat(e.length>0?" Args: ".concat(e.join(", ")):""))}var et=function(){function t(t){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=t}return t.prototype.indexOfGroup=function(t){for(var e=0,n=0;n<t;n++)e+=this.groupSizes[n];return e},t.prototype.insertRules=function(t,e){if(t>=this.groupSizes.length){for(var n=this.groupSizes,o=n.length,i=o;t>=i;)if((i<<=1)<0)throw tt(16,"".concat(t));this.groupSizes=new Uint32Array(i),this.groupSizes.set(n),this.length=i;for(var r=o;r<i;r++)this.groupSizes[r]=0}for(var a=this.indexOfGroup(t+1),s=(r=0,e.length);r<s;r++)this.tag.insertRule(a,e[r])&&(this.groupSizes[t]++,a++)},t.prototype.clearGroup=function(t){if(t<this.length){var e=this.groupSizes[t],n=this.indexOfGroup(t),o=n+e;this.groupSizes[t]=0;for(var i=n;i<o;i++)this.tag.deleteRule(n)}},t.prototype.getGroup=function(t){var e="";if(t>=this.length||0===this.groupSizes[t])return e;for(var n=this.groupSizes[t],o=this.indexOfGroup(t),i=o+n,r=o;r<i;r++)e+="".concat(this.tag.getRule(r)).concat(f);return e},t}(),nt=new Map,ot=new Map,it=1,rt=function(t){if(nt.has(t))return nt.get(t);for(;ot.has(it);)it++;var e=it++;return nt.set(t,e),ot.set(e,t),e},at=function(t,e){it=e+1,nt.set(t,e),ot.set(e,t)},st="style[".concat(c,"][").concat(d,'="').concat(h,'"]'),lt=new RegExp("^".concat(c,'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)')),ct=function(t,e,n){for(var o,i=n.split(","),r=0,a=i.length;r<a;r++)(o=i[r])&&t.registerName(e,o)},ut=function(t,e){for(var n,o=(null!==(n=e.textContent)&&void 0!==n?n:"").split(f),i=[],r=0,a=o.length;r<a;r++){var s=o[r].trim();if(s){var l=s.match(lt);if(l){var c=0|parseInt(l[1],10),u=l[2];0!==c&&(at(u,c),ct(t,u,l[3]),t.getTag().insertRules(c,i)),i.length=0}else i.push(s)}}};function dt(){return n.nc}var ht=function(t){var e=document.head,n=t||e,o=document.createElement("style"),i=function(t){var e=Array.from(t.querySelectorAll("style[".concat(c,"]")));return e[e.length-1]}(n),r=void 0!==i?i.nextSibling:null;o.setAttribute(c,u),o.setAttribute(d,h);var a=dt();return a&&o.setAttribute("nonce",a),n.insertBefore(o,r),o},ft=function(){function t(t){this.element=ht(t),this.element.appendChild(document.createTextNode("")),this.sheet=function(t){if(t.sheet)return t.sheet;for(var e=document.styleSheets,n=0,o=e.length;n<o;n++){var i=e[n];if(i.ownerNode===t)return i}throw tt(17)}(this.element),this.length=0}return t.prototype.insertRule=function(t,e){try{return this.sheet.insertRule(e,t),this.length++,!0}catch(t){return!1}},t.prototype.deleteRule=function(t){this.sheet.deleteRule(t),this.length--},t.prototype.getRule=function(t){var e=this.sheet.cssRules[t];return e&&e.cssText?e.cssText:""},t}(),pt=function(){function t(t){this.element=ht(t),this.nodes=this.element.childNodes,this.length=0}return t.prototype.insertRule=function(t,e){if(t<=this.length&&t>=0){var n=document.createTextNode(e);return this.element.insertBefore(n,this.nodes[t]||null),this.length++,!0}return!1},t.prototype.deleteRule=function(t){this.element.removeChild(this.nodes[t]),this.length--},t.prototype.getRule=function(t){return t<this.length?this.nodes[t].textContent:""},t}(),mt=function(){function t(t){this.rules=[],this.length=0}return t.prototype.insertRule=function(t,e){return t<=this.length&&(this.rules.splice(t,0,e),this.length++,!0)},t.prototype.deleteRule=function(t){this.rules.splice(t,1),this.length--},t.prototype.getRule=function(t){return t<this.length?this.rules[t]:""},t}(),gt=p,vt={isServer:!p,useCSSOMInjection:!m},At=function(){function t(t,e,n){void 0===t&&(t=v),void 0===e&&(e={});var i=this;this.options=Object(o.a)(Object(o.a)({},vt),t),this.gs=e,this.names=new Map(n),this.server=!!t.isServer,!this.server&&p&&gt&&(gt=!1,function(t){for(var e=document.querySelectorAll(st),n=0,o=e.length;n<o;n++){var i=e[n];i&&i.getAttribute(c)!==u&&(ut(t,i),i.parentNode&&i.parentNode.removeChild(i))}}(this)),J(this,(function(){return function(t){for(var e=t.getTag(),n=e.length,o="",i=function(n){var i=function(t){return ot.get(t)}(n);if(void 0===i)return"continue";var r=t.names.get(i),a=e.getGroup(n);if(void 0===r||0===a.length)return"continue";var s="".concat(c,".g").concat(n,'[id="').concat(i,'"]'),l="";void 0!==r&&r.forEach((function(t){t.length>0&&(l+="".concat(t,","))})),o+="".concat(a).concat(s,'{content:"').concat(l,'"}').concat(f)},r=0;r<n;r++)i(r);return o}(i)}))}return t.registerId=function(t){return rt(t)},t.prototype.reconstructWithOptions=function(e,n){return void 0===n&&(n=!0),new t(Object(o.a)(Object(o.a)({},this.options),e),this.gs,n&&this.names||void 0)},t.prototype.allocateGSInstance=function(t){return this.gs[t]=(this.gs[t]||0)+1},t.prototype.getTag=function(){return this.tag||(this.tag=(t=function(t){var e=t.useCSSOMInjection,n=t.target;return t.isServer?new mt(n):e?new ft(n):new pt(n)}(this.options),new et(t)));var t},t.prototype.hasNameForId=function(t,e){return this.names.has(t)&&this.names.get(t).has(e)},t.prototype.registerName=function(t,e){if(rt(t),this.names.has(t))this.names.get(t).add(e);else{var n=new Set;n.add(e),this.names.set(t,n)}},t.prototype.insertRules=function(t,e,n){this.registerName(t,e),this.getTag().insertRules(rt(t),n)},t.prototype.clearNames=function(t){this.names.has(t)&&this.names.get(t).clear()},t.prototype.clearRules=function(t){this.getTag().clearGroup(rt(t)),this.clearNames(t)},t.prototype.clearTag=function(){this.tag=void 0},t}(),bt=/&/g,yt=/^\s*\/\/.*$/gm;function Ct(t,e){return t.map((function(t){return"rule"===t.type&&(t.value="".concat(e," ").concat(t.value),t.value=t.value.replaceAll(",",",".concat(e," ")),t.props=t.props.map((function(t){return"".concat(e," ").concat(t)}))),Array.isArray(t.children)&&"@keyframes"!==t.type&&(t.children=Ct(t.children,e)),t}))}function St(t){var e,n,o,i=void 0===t?v:t,r=i.options,a=void 0===r?v:r,l=i.plugins,c=void 0===l?g:l,u=function(t,o,i){return i.startsWith(n)&&i.endsWith(n)&&i.replaceAll(n,"").length>0?".".concat(e):t},d=c.slice();d.push((function(t){t.type===s.a&&t.value.includes("&")&&(t.props[0]=t.props[0].replace(bt,n).replace(o,u))})),a.prefix&&d.push(s.d),d.push(s.g);var h=function(t,i,r,l){void 0===i&&(i=""),void 0===r&&(r=""),void 0===l&&(l="&"),e=l,n=i,o=new RegExp("\\".concat(n,"\\b"),"g");var c=t.replace(yt,""),u=s.b(r||i?"".concat(r," ").concat(i," { ").concat(c," }"):c);a.namespace&&(u=Ct(u,a.namespace));var h=[];return s.f(u,s.c(d.concat(s.e((function(t){return h.push(t)}))))),h};return h.hash=c.length?c.reduce((function(t,e){return e.name||tt(15),_(t,e.name)}),5381).toString():"",h}var wt=new At,xt=St(),Et=i.default.createContext({shouldForwardProp:void 0,styleSheet:wt,stylis:xt}),Lt=(Et.Consumer,i.default.createContext(void 0));function _t(){return Object(i.useContext)(Et)}function Ot(t){var e=Object(i.useState)(t.stylisPlugins),n=e[0],o=e[1],r=_t().styleSheet,s=Object(i.useMemo)((function(){var e=r;return t.sheet?e=t.sheet:t.target&&(e=e.reconstructWithOptions({target:t.target},!1)),t.disableCSSOMInjection&&(e=e.reconstructWithOptions({useCSSOMInjection:!1})),e}),[t.disableCSSOMInjection,t.sheet,t.target,r]),l=Object(i.useMemo)((function(){return St({options:{namespace:t.namespace,prefix:t.enableVendorPrefixes},plugins:n})}),[t.enableVendorPrefixes,t.namespace,n]);Object(i.useEffect)((function(){a()(n,t.stylisPlugins)||o(t.stylisPlugins)}),[t.stylisPlugins]);var c=Object(i.useMemo)((function(){return{shouldForwardProp:t.shouldForwardProp,styleSheet:s,stylis:l}}),[t.shouldForwardProp,s,l]);return i.default.createElement(Et.Provider,{value:c},i.default.createElement(Lt.Provider,{value:l},t.children))}var Tt=function(){function t(t,e){var n=this;this.inject=function(t,e){void 0===e&&(e=xt);var o=n.name+e.hash;t.hasNameForId(n.id,o)||t.insertRules(n.id,o,e(n.rules,o,"@keyframes"))},this.name=t,this.id="sc-keyframes-".concat(t),this.rules=e,J(this,(function(){throw tt(12,String(n.name))}))}return t.prototype.getName=function(t){return void 0===t&&(t=xt),this.name+t.hash},t}(),kt=function(t){return t>="A"&&t<="Z"};function Dt(t){for(var e="",n=0;n<t.length;n++){var o=t[n];if(1===n&&"-"===o&&"-"===t[0])return t;kt(o)?e+="-"+o.toLowerCase():e+=o}return e.startsWith("ms-")?"-"+e:e}var Pt=function(t){return null==t||!1===t||""===t},Bt=function(t){var e,n,i=[];for(var r in t){var a=t[r];t.hasOwnProperty(r)&&!Pt(a)&&(Array.isArray(a)&&a.isCss||Y(a)?i.push("".concat(Dt(r),":"),a,";"):$(a)?i.push.apply(i,Object(o.e)(Object(o.e)(["".concat(r," {")],Bt(a),!1),["}"],!1)):i.push("".concat(Dt(r),": ").concat((e=r,null==(n=a)||"boolean"==typeof n||""===n?"":"number"!=typeof n||0===n||e in l.a||e.startsWith("--")?String(n).trim():"".concat(n,"px")),";")))}return i};function Ft(t,e,n,o){return Pt(t)?[]:Z(t)?[".".concat(t.styledComponentId)]:Y(t)?!Y(i=t)||i.prototype&&i.prototype.isReactComponent||!e?[t]:Ft(t(e),e,n,o):t instanceof Tt?n?(t.inject(n,o),[t.getName(o)]):[t]:$(t)?Bt(t):Array.isArray(t)?Array.prototype.concat.apply(g,t.map((function(t){return Ft(t,e,n,o)}))):[t.toString()];var i}function Rt(t){for(var e=0;e<t.length;e+=1){var n=t[e];if(Y(n)&&!Z(n))return!1}return!0}var It=O(h),Wt=function(){function t(t,e,n){this.rules=t,this.staticRulesId="",this.isStatic=(void 0===n||n.isStatic)&&Rt(t),this.componentId=e,this.baseHash=_(It,e),this.baseStyle=n,At.registerId(e)}return t.prototype.generateAndInjectStyles=function(t,e,n){var o=this.baseStyle?this.baseStyle.generateAndInjectStyles(t,e,n):"";if(this.isStatic&&!n.hash)if(this.staticRulesId&&e.hasNameForId(this.componentId,this.staticRulesId))o=q(o,this.staticRulesId);else{var i=X(Ft(this.rules,t,e,n)),r=E(_(this.baseHash,i)>>>0);if(!e.hasNameForId(this.componentId,r)){var a=n(i,".".concat(r),void 0,this.componentId);e.insertRules(this.componentId,r,a)}o=q(o,r),this.staticRulesId=r}else{for(var s=_(this.baseHash,n.hash),l="",c=0;c<this.rules.length;c++){var u=this.rules[c];if("string"==typeof u)l+=u;else if(u){var d=X(Ft(u,t,e,n));s=_(s,d+c),l+=d}}if(l){var h=E(s>>>0);e.hasNameForId(this.componentId,h)||e.insertRules(this.componentId,h,n(l,".".concat(h),void 0,this.componentId)),o=q(o,h)}}return o},t}(),Mt=i.default.createContext(void 0);Mt.Consumer;var jt={};new Set;function zt(t,e,n){var r=Z(t),a=t,s=!D(t),l=e.attrs,c=void 0===l?g:l,u=e.componentId,d=void 0===u?function(t,e){var n="string"!=typeof t?"sc":S(t);jt[n]=(jt[n]||0)+1;var o="".concat(n,"-").concat(T(h+n+jt[n]));return e?"".concat(e,"-").concat(o):o}(e.displayName,e.parentComponentId):u,f=e.displayName,p=void 0===f?function(t){return D(t)?"styled.".concat(t):"Styled(".concat(k(t),")")}(t):f,m=e.displayName&&e.componentId?"".concat(S(e.displayName),"-").concat(e.componentId):e.componentId||d,y=r&&a.attrs?a.attrs.concat(c).filter(Boolean):c,C=e.shouldForwardProp;if(r&&a.shouldForwardProp){var w=a.shouldForwardProp;if(e.shouldForwardProp){var x=e.shouldForwardProp;C=function(t,e){return w(t,e)&&x(t,e)}}else C=w}var E=new Wt(n,m,r?a.componentStyle:void 0);function L(t,e){return function(t,e,n){var r=t.attrs,a=t.componentStyle,s=t.defaultProps,l=t.foldedComponentIds,c=t.styledComponentId,u=t.target,d=i.default.useContext(Mt),h=_t(),f=t.shouldForwardProp||h.shouldForwardProp,p=A(e,d,s)||v,m=function(t,e,n){for(var i,r=Object(o.a)(Object(o.a)({},e),{className:void 0,theme:n}),a=0;a<t.length;a+=1){var s=Y(i=t[a])?i(r):i;for(var l in s)r[l]="className"===l?q(r[l],s[l]):"style"===l?Object(o.a)(Object(o.a)({},r[l]),s[l]):s[l]}return e.className&&(r.className=q(r.className,e.className)),r}(r,e,p),g=m.as||u,y={};for(var C in m)void 0===m[C]||"$"===C[0]||"as"===C||"theme"===C&&m.theme===p||("forwardedAs"===C?y.as=m.forwardedAs:f&&!f(C,g)||(y[C]=m[C]));var S=function(t,e){var n=_t();return t.generateAndInjectStyles(e,n.styleSheet,n.stylis)}(a,m),w=q(l,c);return S&&(w+=" "+S),m.className&&(w+=" "+m.className),y[D(g)&&!b.has(g)?"class":"className"]=w,y.ref=n,Object(i.createElement)(g,y)}(_,t,e)}L.displayName=p;var _=i.default.forwardRef(L);return _.attrs=y,_.componentStyle=E,_.displayName=p,_.shouldForwardProp=C,_.foldedComponentIds=r?q(a.foldedComponentIds,a.styledComponentId):"",_.styledComponentId=m,_.target=r?a.target:t,Object.defineProperty(_,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(t){this._foldedDefaultProps=r?function(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];for(var o=0,i=e;o<i.length;o++)K(t,i[o],!0);return t}({},a.defaultProps,t):t}}),J(_,(function(){return".".concat(_.styledComponentId)})),s&&Q(_,t,{attrs:!0,componentStyle:!0,displayName:!0,foldedComponentIds:!0,shouldForwardProp:!0,styledComponentId:!0,target:!0}),_}function Nt(t,e){for(var n=[t[0]],o=0,i=e.length;o<i;o+=1)n.push(e[o],t[o+1]);return n}var Vt=function(t){return Object.assign(t,{isCss:!0})};function Ut(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(Y(t)||$(t))return Vt(Ft(Nt(g,Object(o.e)([t],e,!0))));var i=t;return 0===e.length&&1===i.length&&"string"==typeof i[0]?Ft(i):Vt(Ft(Nt(i,e)))}function Ht(t,e,n){if(void 0===n&&(n=v),!e)throw tt(1,e);var i=function(i){for(var r=[],a=1;a<arguments.length;a++)r[a-1]=arguments[a];return t(e,n,Ut.apply(void 0,Object(o.e)([i],r,!1)))};return i.attrs=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i.withConfig=function(i){return Ht(t,e,Object(o.a)(Object(o.a)({},n),i))},i}var Gt=function(t){return Ht(zt,t)},Qt=Gt;b.forEach((function(t){Qt[t]=Gt(t)}));!function(){function t(t,e){this.rules=t,this.componentId=e,this.isStatic=Rt(t),At.registerId(this.componentId+1)}t.prototype.createStyles=function(t,e,n,o){var i=o(X(Ft(this.rules,e,n,o)),""),r=this.componentId+t;n.insertRules(r,r,i)},t.prototype.removeStyles=function(t,e){e.clearRules(this.componentId+t)},t.prototype.renderStyles=function(t,e,n,o){t>2&&At.registerId(this.componentId+t),this.removeStyles(t,n),this.createStyles(t,e,n,o)}}();function Yt(t){for(var e=[],n=1;n<arguments.length;n++)e[n-1]=arguments[n];var i=X(Ut.apply(void 0,Object(o.e)([t],e,!1))),r=T(i);return new Tt(r,i)}(function(){function t(){var t=this;this._emitSheetCSS=function(){var e=t.instance.toString(),n=dt(),o=X([n&&'nonce="'.concat(n,'"'),"".concat(c,'="true"'),"".concat(d,'="').concat(h,'"')].filter(Boolean)," ");return"<style ".concat(o,">").concat(e,"</style>")},this.getStyleTags=function(){if(t.sealed)throw tt(2);return t._emitSheetCSS()},this.getStyleElement=function(){var e;if(t.sealed)throw tt(2);var n=((e={})[c]="",e[d]=h,e.dangerouslySetInnerHTML={__html:t.instance.toString()},e),r=dt();return r&&(n.nonce=r),[i.default.createElement("style",Object(o.a)({},n,{key:"sc-0-0"}))]},this.seal=function(){t.sealed=!0},this.instance=new At({isServer:!0}),this.sealed=!1}t.prototype.collectStyles=function(t){if(this.sealed)throw tt(2);return i.default.createElement(Ot,{sheet:this.instance},t)},t.prototype.interleaveWithNodeStream=function(t){throw tt(3)}})(),"__sc-".concat(c,"__")}).call(this,n(42))},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(15),i=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class r{static get INSTANCE(){return r._INSTANCE||(r._INSTANCE=new r),r._INSTANCE}constructor(){this.listOfCameras=[],this.strategy="FAST_DEFERRED"}initialize(t){if(t&&(this.strategy=t),"SLOW"===t||"FAST"===t){const e=t;this.load(e)}}load(t){return i(this,void 0,void 0,(function*(){if(!t)if("SLOW_DEFERRED"===this.strategy||"SLOW"===this.strategy)t="SLOW";else if("FAST_DEFERRED"===this.strategy||"FAST"===this.strategy)t="FAST";else if("NONE"===this.strategy)return this.listOfCameras;let e;if("SLOW"===t)e=this.loadSlow();else{if("FAST"!==t)throw new Error(`Unknown mode ${t}`);e=this.loadFast()}try{return this.listOfCameras=yield e,this.listOfCameras}catch(t){throw this.loadSlowResult=void 0,o.a.createFromDOMException(t)}}))}loadSlow(){return this.loadSlowResult=this.loadSlowResult||(()=>i(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const t=[];for(const e of yield this.getVideoDevices()){let n;try{n=yield this.getUserMedia({video:{deviceId:e.deviceId}}),t.push(r.getCameraInfoFromStream(n))}finally{this.stopStream(n),yield new Promise((t=>setTimeout(t,0)))}}return t})))(),this.loadSlowResult}loadFast(){return this.loadFastResult=this.loadFastResult||(()=>i(this,void 0,void 0,(function*(){yield this.assertPermissionsAreOk();const t=[];for(const e of yield this.getVideoDevices()){const n=r.guessparseCameraLabelFacingMode(e.label),o=r.guessparseCameraLabelMaxNumPixels(e.label);t.push({maxNumPixels:o,facingMode:n,supportsTorchControl:void 0,deviceId:e.deviceId,label:e.label})}return t})))(),this.loadFastResult}getMainCamera(t){var e,n,o,i,r,a;return null!==(a=null===(r=null===(i=null===(o=null===(n=null===(e=this.listOfCameras)||void 0===e?void 0:e.filter((e=>e.facingMode===t)))||void 0===n?void 0:n.map(((t,e)=>({camera:t,index:e}))))||void 0===o?void 0:o.sort(((t,e)=>{var n;return-(+t.camera.supportsTorchControl||0)-(+e.camera.supportsTorchControl||0)||-((t.camera.maxNumPixels||0)-(e.camera.maxNumPixels||0))||(null===(n=t.camera.label)||void 0===n?void 0:n.localeCompare(e.camera.label))||t.index-e.index})))||void 0===i?void 0:i[0])||void 0===r?void 0:r.camera)&&void 0!==a?a:null}getVideoDevices(){return i(this,void 0,void 0,(function*(){let t=yield navigator.mediaDevices.enumerateDevices();if(t=t.filter((t=>"videoinput"===t.kind)),t.some((t=>""===t.label))){let e;try{e=yield this.getUserMedia({video:{facingMode:{ideal:"environment"}},audio:!1}),t=yield navigator.mediaDevices.enumerateDevices(),t=t.filter((t=>"videoinput"===t.kind))}finally{this.stopStream(e)}}return t}))}stopStream(t){null==t||t.getTracks().forEach((t=>t.stop()))}static guessparseCameraLabelFacingMode(t){return function(t){const e=["rear","back","rück","arrière","trasera","trás","traseira","posteriore","后面","後面","背面","后置","後置","背置","задней","الخلفية","후","arka","achterzijde","หลัง","baksidan","bagside","sau","bak","tylny","takakamera","belakang","אחורית","πίσω","spate","hátsó","zadní","darrere","zadná","задня","stražnja","belakang","बैक"];for(const n of e)if(t.toLowerCase().includes(n.toLowerCase()))return!0;return!1}(t)?"back":"front"}static guessparseCameraLabelMaxNumPixels(t){const e=RegExp(/\b([0-9]+)mp?\b/).exec(t.toLowerCase()),n=e?1e6*parseInt(e[1],10):NaN;return Number.isNaN(n)?void 0:n}assertPermissionsAreOk(){return i(this,void 0,void 0,(function*(){if(o.a.hasCheckedPermission()||(yield o.a.tryCheckPermission()),o.a.hasDeniedPermission())throw o.a.permissionDenied();if(!navigator.mediaDevices)throw o.a.unknown()}))}static getCameraInfoFromStream(t){var e;return null===(e=t.getVideoTracks().map((t=>{var e,n,o,i,r,a;const s=null===(e=t.getCapabilities)||void 0===e?void 0:e.call(t),l=null===(n=t.getSettings)||void 0===n?void 0:n.call(t),c=t.label;let u=function(t){if("user"===(null==t?void 0:t.toLowerCase()))return"front";if("environment"===(null==t?void 0:t.toLowerCase()))return"back";return"unknown"}(null!==(i=null===(o=null==s?void 0:s.facingMode)||void 0===o?void 0:o[0])&&void 0!==i?i:l.facingMode);"unknown"===u&&(u=this.guessparseCameraLabelFacingMode(c));let d=function(t){var e,n;let o=(null===(e=null==t?void 0:t.width)||void 0===e?void 0:e.max)*(null===(n=null==t?void 0:t.height)||void 0===n?void 0:n.max);if(!o||Number.isNaN(o))return;return o}(s);Number.isNaN(d)&&(d=this.guessparseCameraLabelMaxNumPixels(c));return{facingMode:u,maxNumPixels:d,supportsTorchControl:null!==(a=null!==(r=null==s?void 0:s.torch)&&void 0!==r?r:"torch"in l)&&void 0!==a&&a,label:c,deviceId:l.deviceId}})).sort(((t,e)=>e.maxNumPixels-t.maxNumPixels)))||void 0===e?void 0:e[0]}getUserMedia(t){return i(this,void 0,void 0,(function*(){try{return yield navigator.mediaDevices.getUserMedia(t)}catch(t){throw o.a.mediaDeviceNotFound()}}))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return s}));var o=n(0),i=n(21),r=n(5),a=n(11);class s extends o.default.Component{get style(){return this.props.configuration.style}get holeRect(){return this.holePosition}constructor(t){super(t),this.holePosition=i.a.empty(),this.resizeObserver=new ResizeObserver((()=>{this.updateWindowSize()})),this.componentDidUpdate=t=>{var e,n,o,i;(null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)===(null===(n=t.padding)||void 0===n?void 0:n.minTopPadding)&&(null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)===(null===(i=t.padding)||void 0===i?void 0:i.minBottomPadding)&&this.props.configuration===t.configuration&&this.props.guidanceConfiguration===t.guidanceConfiguration||this.setState({shouldUpdateCanvas:!0}),this.updateCanvas()},this.updateWindowSize=()=>{this.setState({shouldUpdateCanvas:!0})},this.getVideoSize=()=>{var t;return null!==(t=this.holeCanvas.getBoundingClientRect())&&void 0!==t?t:new DOMRect},this.scaleForRetinaDisplay=t=>{if(window.devicePixelRatio>1){var e=t.width,n=t.height;t.width=e*window.devicePixelRatio,t.height=n*window.devicePixelRatio,t.style.width=e+"px",t.style.height=n+"px",t.getContext("2d").scale(window.devicePixelRatio,window.devicePixelRatio)}},this.updateCanvas=()=>{var t,e,n,o,i;if(!this.state.shouldUpdateCanvas)return;this.setState({shouldUpdateCanvas:!1});const r=this.getVideoSize().width,a=this.getVideoSize().height;this.holeCanvas.width=r,this.holeCanvas.height=a,this.crosshairCanvas.width=r,this.crosshairCanvas.height=a,this.scaleForRetinaDisplay(this.crosshairCanvas);const s=r-2*this.props.configuration.style.strokeWidth,l=Math.max(20,(r-s)/2),c=Math.min(s,r-2*l),u=this.props.configuration.aspectRatio.width/this.props.configuration.aspectRatio.height;this.holePosition.width=c,this.holePosition.height=this.holePosition.width/u,this.holePosition.x=r/2-c/2;const d=(null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)+this.guidanceTextTopPadding||0,h=Math.max(10,null!==(n=null===(e=this.props.padding)||void 0===e?void 0:e.minTopPadding)&&void 0!==n?n:0),f=a-h-Math.max(10,null!==(i=null===(o=this.props.padding)||void 0===o?void 0:o.minBottomPadding)&&void 0!==i?i:0)-d;this.holePosition.height>f?(this.holePosition.height=f,this.holePosition.width=this.holePosition.height*u,this.holePosition.x=r/2-this.holePosition.width/2,this.holePosition.y=h):this.holePosition.y=h+(f-this.holePosition.height)/1.9;const p=this.holeCanvas.getContext("2d");p.save(),this.drawBackground(p),p.globalCompositeOperation="destination-out",this.drawHole();const m=this.crosshairCanvas.getContext("2d");m.globalCompositeOperation="source-over","FinderStrokedStyle"===this.props.configuration.style._type?this.drawHoleOutline():"FinderCorneredStyle"===this.props.configuration.style._type&&this.drawHoleCorners(),p.restore(),m.restore()},this.drawBackground=t=>{const{width:e,height:n}=this.getVideoSize();t.clearRect(0,0,e,n),t.beginPath(),t.rect(0,0,e,n),t.fillStyle=r.b.getColorValue(this.props.configuration.overlayColor),t.fill()},this.drawHole=()=>{const t=this.holeCanvas.getContext("2d"),e=this.cornerRadius(),n=this.holePosition.x,o=this.holePosition.y,i=this.holePosition.width,r=this.holePosition.height;t.beginPath(),t.fillStyle="black",t.moveTo(n+e,o),t.arcTo(n+i,o,n+i,o+r,e),t.arcTo(n+i,o+r,n,o+r,e),t.arcTo(n,o+r,n,o,e),t.arcTo(n,o,n+i,o,e),t.closePath(),t.fill()},this.drawCrosshair=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x+this.holePosition.width/2,n=this.holePosition.y+this.holePosition.height/2;t.beginPath(),t.moveTo(e-10,n),t.lineTo(e+10,n),t.moveTo(e,n-10),t.lineTo(e,n+10),t.strokeStyle="white",t.fillStyle="white",t.lineWidth=1,t.stroke()},this.drawHoleCorners=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,a=15,s=this.style.strokeWidth,l=this.cornerRadius();t.beginPath(),t.moveTo(e,n+a),t.arcTo(e,n,e+o,n,l),t.lineTo(e+a,n),t.moveTo(e+o-a,n),t.arcTo(e+o,n,e+o,n+i,l),t.lineTo(e+o,n+a),t.moveTo(e+o,n+i-a),t.arcTo(e+o,n+i,e,n+i,l),t.lineTo(e+o-a,n+i),t.moveTo(e,n+i-a),t.arcTo(e,n+i,e+o,n+i,l),t.lineTo(e+a,n+i),t.strokeStyle=r.b.getColorValue(this.style.strokeColor),t.lineWidth=s,t.stroke()},this.drawHoleOutline=()=>{const t=this.crosshairCanvas.getContext("2d"),e=this.holePosition.x,n=this.holePosition.y,o=this.holePosition.width,i=this.holePosition.height,a=this.cornerRadius(),s=this.style.strokeWidth;t.beginPath(),t.moveTo(e+a,n),t.arcTo(e+o,n,e+o,n+i,a),t.moveTo(e+o,n+a),t.arcTo(e+o,n+i,e,n+i,a),t.moveTo(e+o-a,n+i),t.arcTo(e,n+i,e,n,a),t.moveTo(e,n+i-a),t.arcTo(e,n,e+o,n,a),t.strokeStyle=r.b.getColorValue(this.style.strokeColor),t.lineWidth=s,t.stroke()},this.guidanceTextTopPadding=20,this.render=()=>o.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%",textAlign:"left"},onClick:t=>{const e=this.holePosition;t.clientX>this.holePosition.x&&t.clientX<e.x+e.width&&t.clientY>e.y&&t.clientY<e.y+e.height&&console.log("Clicked inside hole, possibly click events need to be diverted")}},o.default.createElement("canvas",{ref:t=>{this.holeCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),o.default.createElement("canvas",{ref:t=>{this.crosshairCanvas=t},style:{position:"absolute",width:"100%",height:"100%"}}),this.guidance.visible&&o.default.createElement("div",{ref:t=>{this.guidanceText=t},style:{position:"absolute",display:"block",top:this.holePosition.y+this.holePosition.height+this.guidanceTextTopPadding,left:0,width:"100%",textAlign:"center"}},o.default.createElement(a.a,{style:{display:"inline-block",backgroundColor:r.b.getColorValue(this.guidance.background.fillColor),borderStyle:"solid",borderColor:r.b.getColorValue(this.guidance.background.strokeColor),borderWidth:this.style.strokeWidth,borderRadius:4,padding:"4px 8px",flex:1},config:this.guidance.title}))),this.state={shouldUpdateCanvas:!0}}componentDidMount(){this.updateWindowSize(),this.resizeObserver.observe(this.holeCanvas)}componentWillUnmount(){this.resizeObserver.disconnect()}bottomOfGuidanceText(){var t,e;return this.holeRect.bottom()+(null!==(e=null===(t=this.guidanceText)||void 0===t?void 0:t.clientHeight)&&void 0!==e?e:0)+this.guidanceTextTopPadding}get guidance(){return this.props.guidanceConfiguration}cornerRadius(){return Math.max(0,Math.min(this.style.cornerRadius,this.holePosition.width/2,this.holePosition.height/2))}}},function(t,e,n){var o;!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var t=[],e=0;e<arguments.length;e++){var o=arguments[e];if(o){var r=typeof o;if("string"===r||"number"===r)t.push(o);else if(Array.isArray(o)){if(o.length){var a=i.apply(null,o);a&&t.push(a)}}else if("object"===r)if(o.toString===Object.prototype.toString)for(var s in o)n.call(o,s)&&o[s]&&t.push(s);else t.push(o.toString())}}return t.join(" ")}t.exports?(i.default=i,t.exports=i):void 0===(o=function(){return i}.apply(e,[]))||(t.exports=o)}()},function(t,e,n){"use strict";n.d(e,"a",(function(){return s})),n.d(e,"b",(function(){return Q})),n.d(e,"c",(function(){return tt})),n.d(e,"d",(function(){return nt})),n.d(e,"e",(function(){return et})),n.d(e,"f",(function(){return K})),n.d(e,"g",(function(){return J}));var o="-ms-",i="-moz-",r="-webkit-",a="comm",s="rule",l="decl",c="@keyframes",u=Math.abs,d=String.fromCharCode,h=Object.assign;function f(t){return t.trim()}function p(t,e){return(t=e.exec(t))?t[0]:t}function m(t,e,n){return t.replace(e,n)}function g(t,e,n){return t.indexOf(e,n)}function v(t,e){return 0|t.charCodeAt(e)}function A(t,e,n){return t.slice(e,n)}function b(t){return t.length}function y(t){return t.length}function C(t,e){return e.push(t),t}function S(t,e){return t.map(e).join("")}function w(t,e){return t.filter((function(t){return!p(t,e)}))}var x=1,E=1,L=0,_=0,O=0,T="";function k(t,e,n,o,i,r,a,s){return{value:t,root:e,parent:n,type:o,props:i,children:r,line:x,column:E,length:a,return:"",siblings:s}}function D(t,e){return h(k("",null,null,"",null,null,0,t.siblings),t,{length:-t.length},e)}function P(t){for(;t.root;)t=D(t.root,{children:[t]});C(t,t.siblings)}function B(){return O=_<L?v(T,_++):0,E++,10===O&&(E=1,x++),O}function F(){return v(T,_)}function R(){return _}function I(t,e){return A(T,t,e)}function W(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function M(t){return x=E=1,L=b(T=t),_=0,[]}function j(t){return T="",t}function z(t){return f(I(_-1,U(91===t?t+2:40===t?t+1:t)))}function N(t){for(;(O=F())&&O<33;)B();return W(t)>2||W(O)>3?"":" "}function V(t,e){for(;--e&&B()&&!(O<48||O>102||O>57&&O<65||O>70&&O<97););return I(t,R()+(e<6&&32==F()&&32==B()))}function U(t){for(;B();)switch(O){case t:return _;case 34:case 39:34!==t&&39!==t&&U(O);break;case 40:41===t&&U(t);break;case 92:B()}return _}function H(t,e){for(;B()&&t+O!==57&&(t+O!==84||47!==F()););return"/*"+I(e,_-1)+"*"+d(47===t?t:B())}function G(t){for(;!W(F());)B();return I(t,_)}function Q(t){return j(Y("",null,null,null,[""],t=M(t),0,[0],t))}function Y(t,e,n,o,i,r,a,s,l){for(var c=0,h=0,f=a,p=0,A=0,y=0,S=1,w=1,L=1,k=0,D="",P=i,I=r,W=o,M=D;w;)switch(y=k,k=B()){case 40:if(108!=y&&58==v(M,f-1)){-1!=g(M+=m(z(k),"&","&\f"),"&\f",u(c?s[c-1]:0))&&(L=-1);break}case 34:case 39:case 91:M+=z(k);break;case 9:case 10:case 13:case 32:M+=N(y);break;case 92:M+=V(R()-1,7);continue;case 47:switch(F()){case 42:case 47:C(q(H(B(),R()),e,n,l),l);break;default:M+="/"}break;case 123*S:s[c++]=b(M)*L;case 125*S:case 59:case 0:switch(k){case 0:case 125:w=0;case 59+h:-1==L&&(M=m(M,/\f/g,"")),A>0&&b(M)-f&&C(A>32?X(M+";",o,n,f-1,l):X(m(M," ","")+";",o,n,f-2,l),l);break;case 59:M+=";";default:if(C(W=Z(M,e,n,c,h,i,s,D,P=[],I=[],f,r),r),123===k)if(0===h)Y(M,e,W,W,P,r,f,s,I);else switch(99===p&&110===v(M,3)?100:p){case 100:case 108:case 109:case 115:Y(t,W,W,o&&C(Z(t,W,W,0,0,i,s,D,i,P=[],f,I),I),i,I,f,s,o?P:I);break;default:Y(M,W,W,W,[""],I,0,s,I)}}c=h=A=0,S=L=1,D=M="",f=a;break;case 58:f=1+b(M),A=y;default:if(S<1)if(123==k)--S;else if(125==k&&0==S++&&125==(O=_>0?v(T,--_):0,E--,10===O&&(E=1,x--),O))continue;switch(M+=d(k),k*S){case 38:L=h>0?1:(M+="\f",-1);break;case 44:s[c++]=(b(M)-1)*L,L=1;break;case 64:45===F()&&(M+=z(B())),p=F(),h=f=b(D=M+=G(R())),k++;break;case 45:45===y&&2==b(M)&&(S=0)}}return r}function Z(t,e,n,o,i,r,a,l,c,d,h,p){for(var g=i-1,v=0===i?r:[""],b=y(v),C=0,S=0,w=0;C<o;++C)for(var x=0,E=A(t,g+1,g=u(S=a[C])),L=t;x<b;++x)(L=f(S>0?v[x]+" "+E:m(E,/&\f/g,v[x])))&&(c[w++]=L);return k(t,e,n,0===i?s:l,c,d,h,p)}function q(t,e,n,o){return k(t,e,n,a,d(O),A(t,2,-2),0,o)}function X(t,e,n,o,i){return k(t,e,n,l,A(t,0,o),A(t,o+1,-1),o,i)}function $(t,e,n){switch(function(t,e){return 45^v(t,0)?(((e<<2^v(t,0))<<2^v(t,1))<<2^v(t,2))<<2^v(t,3):0}(t,e)){case 5103:return r+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return r+t+t;case 4789:return i+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return r+t+i+t+o+t+t;case 5936:switch(v(t,e+11)){case 114:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return r+t+o+m(t,/[svh]\w+-[tblr]{2}/,"lr")+t}case 6828:case 4268:case 2903:return r+t+o+t+t;case 6165:return r+t+o+"flex-"+t+t;case 5187:return r+t+m(t,/(\w+).+(:[^]+)/,r+"box-$1$2"+o+"flex-$1$2")+t;case 5443:return r+t+o+"flex-item-"+m(t,/flex-|-self/g,"")+(p(t,/flex-|baseline/)?"":o+"grid-row-"+m(t,/flex-|-self/g,""))+t;case 4675:return r+t+o+"flex-line-pack"+m(t,/align-content|flex-|-self/g,"")+t;case 5548:return r+t+o+m(t,"shrink","negative")+t;case 5292:return r+t+o+m(t,"basis","preferred-size")+t;case 6060:return r+"box-"+m(t,"-grow","")+r+t+o+m(t,"grow","positive")+t;case 4554:return r+m(t,/([^-])(transform)/g,"$1"+r+"$2")+t;case 6187:return m(m(m(t,/(zoom-|grab)/,r+"$1"),/(image-set)/,r+"$1"),t,"")+t;case 5495:case 3959:return m(t,/(image-set\([^]*)/,r+"$1$`$1");case 4968:return m(m(t,/(.+:)(flex-)?(.*)/,r+"box-pack:$3"+o+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+r+t+t;case 4200:if(!p(t,/flex-|baseline/))return o+"grid-column-align"+A(t,e)+t;break;case 2592:case 3360:return o+m(t,"template-","")+t;case 4384:case 3616:return n&&n.some((function(t,n){return e=n,p(t.props,/grid-\w+-end/)}))?~g(t+(n=n[e].value),"span",0)?t:o+m(t,"-start","")+t+o+"grid-row-span:"+(~g(n,"span",0)?p(n,/\d+/):+p(n,/\d+/)-+p(t,/\d+/))+";":o+m(t,"-start","")+t;case 4896:case 4128:return n&&n.some((function(t){return p(t.props,/grid-\w+-start/)}))?t:o+m(m(t,"-end","-span"),"span ","")+t;case 4095:case 3583:case 4068:case 2532:return m(t,/(.+)-inline(.+)/,r+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(b(t)-1-e>6)switch(v(t,e+1)){case 109:if(45!==v(t,e+4))break;case 102:return m(t,/(.+:)(.+)-([^]+)/,"$1"+r+"$2-$3$1"+i+(108==v(t,e+3)?"$3":"$2-$3"))+t;case 115:return~g(t,"stretch",0)?$(m(t,"stretch","fill-available"),e,n)+t:t}break;case 5152:case 5920:return m(t,/(.+?):(\d+)(\s*\/\s*(span)?\s*(\d+))?(.*)/,(function(e,n,i,r,a,s,l){return o+n+":"+i+l+(r?o+n+"-span:"+(a?s:+s-+i)+l:"")+t}));case 4949:if(121===v(t,e+6))return m(t,":",":"+r)+t;break;case 6444:switch(v(t,45===v(t,14)?18:11)){case 120:return m(t,/(.+:)([^;\s!]+)(;|(\s+)?!.+)?/,"$1"+r+(45===v(t,14)?"inline-":"")+"box$3$1"+r+"$2$3$1"+o+"$2box$3")+t;case 100:return m(t,":",":"+o)+t}break;case 5719:case 2647:case 2135:case 3927:case 2391:return m(t,"scroll-","scroll-snap-")+t}return t}function K(t,e){for(var n="",o=0;o<t.length;o++)n+=e(t[o],o,t,e)||"";return n}function J(t,e,n,o){switch(t.type){case"@layer":if(t.children.length)break;case"@import":case l:return t.return=t.return||t.value;case a:return"";case c:return t.return=t.value+"{"+K(t.children,o)+"}";case s:if(!b(t.value=t.props.join(",")))return""}return b(n=K(t.children,o))?t.return=t.value+"{"+n+"}":""}function tt(t){var e=y(t);return function(n,o,i,r){for(var a="",s=0;s<e;s++)a+=t[s](n,o,i,r)||"";return a}}function et(t){return function(e){e.root||(e=e.return)&&t(e)}}function nt(t,e,n,i){if(t.length>-1&&!t.return)switch(t.type){case l:return void(t.return=$(t.value,t.length,n));case c:return K([D(t,{value:m(t.value,"@","@"+r)})],i);case s:if(t.length)return S(n=t.props,(function(e){switch(p(e,i=/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":P(D(t,{props:[m(e,/:(read-\w+)/,":-moz-$1")]})),P(D(t,{props:[e]})),h(t,{props:w(n,i)});break;case"::placeholder":P(D(t,{props:[m(e,/:(plac\w+)/,":"+r+"input-$1")]})),P(D(t,{props:[m(e,/:(plac\w+)/,":-moz-$1")]})),P(D(t,{props:[m(e,/:(plac\w+)/,o+"input-$1")]})),P(D(t,{props:[e]})),h(t,{props:w(n,i)})}return""}))}}},,function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var o=n(1),i=n(7);class r extends i.a{constructor(t={}){super(),this.title=new o.j({visible:!1,text:"Scan Item",color:"?sbColorOnPrimary"}),this.mode="SOLID",this.backgroundColor="?sbColorPrimary",this.cancelButton=new o.c({text:"Cancel",background:new o.a({strokeColor:"#00000000",fillColor:"#00000000",strokeWidth:0}),foreground:new o.d({color:"?sbColorOnPrimary"})}),void 0!==t.title&&(this.title=new o.j(t.title)),void 0!==t.mode&&(this.mode=t.mode),void 0!==t.backgroundColor&&(this.backgroundColor=t.backgroundColor),void 0!==t.cancelButton&&(this.cancelButton=new o.c(t.cancelButton))}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return i})),n.d(e,"b",(function(){return r}));var o=n(6);function i(t,e,n){return Math.min(Math.max(t,e),n)}function r(t,e,n){return new o.a(i(t.x,-e/2,n.width-e/2),i(t.y,-e/2,n.height-e/2))}},function(t,e,n){"use strict";n.r(e),n.d(e,"BarcodeFormatConfigurationBase",(function(){return o})),n.d(e,"BarcodeFormatOneDConfigurationBase",(function(){return i})),n.d(e,"BarcodeFormatCodabarConfiguration",(function(){return l})),n.d(e,"BarcodeFormatCode11Configuration",(function(){return c})),n.d(e,"BarcodeFormatCode39Configuration",(function(){return u})),n.d(e,"BarcodeFormatCode93Configuration",(function(){return d})),n.d(e,"BarcodeFormatCode128Configuration",(function(){return h})),n.d(e,"BarcodeFormatCode2Of5Configuration",(function(){return f})),n.d(e,"BarcodeFormatDataBarConfiguration",(function(){return p})),n.d(e,"BarcodeFormatDataBarExpandedConfiguration",(function(){return m})),n.d(e,"BarcodeFormatDataBarLimitedConfiguration",(function(){return g})),n.d(e,"BarcodeFormatITFConfiguration",(function(){return v})),n.d(e,"BarcodeFormatMSIPlesseyConfiguration",(function(){return A})),n.d(e,"BarcodeFormatUpcEanConfiguration",(function(){return b})),n.d(e,"BarcodeFormatPharmaCodeConfiguration",(function(){return y})),n.d(e,"BarcodeFormatTwoDConfigurationBase",(function(){return r})),n.d(e,"BarcodeFormatAztecConfiguration",(function(){return C})),n.d(e,"BarcodeFormatQRCodeConfiguration",(function(){return S})),n.d(e,"BarcodeFormatPDF417Configuration",(function(){return w})),n.d(e,"BarcodeFormatMicroPDF417Configuration",(function(){return x})),n.d(e,"BarcodeFormatDataMatrixConfiguration",(function(){return E})),n.d(e,"BarcodeFormatMaxiCodeConfiguration",(function(){return L})),n.d(e,"BarcodeFormatFourStateConfigurationBase",(function(){return a})),n.d(e,"BarcodeFormatAustraliaPostConfiguration",(function(){return _})),n.d(e,"BarcodeFormatJapanPostConfiguration",(function(){return O})),n.d(e,"BarcodeFormatRoyalMailConfiguration",(function(){return T})),n.d(e,"BarcodeFormatRoyalTNTPostConfiguration",(function(){return k})),n.d(e,"BarcodeFormatUSPSIntelligentMailConfiguration",(function(){return D})),n.d(e,"BarcodeFormatPharmaCodeTwoTrackConfiguration",(function(){return P})),n.d(e,"BarcodeFormatGS1CompositeConfiguration",(function(){return B})),n.d(e,"BarcodeFormatCommonOneDConfiguration",(function(){return F})),n.d(e,"BarcodeFormatCommonTwoDConfiguration",(function(){return R})),n.d(e,"BarcodeFormatCommonFourStateConfiguration",(function(){return I})),n.d(e,"BarcodeFormatCommonConfiguration",(function(){return W}));var o,i,r,a,s=n(4);!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatCodabarConfiguration":return new l(t);case"BarcodeFormatCode11Configuration":return new c(t);case"BarcodeFormatCode39Configuration":return new u(t);case"BarcodeFormatCode93Configuration":return new d(t);case"BarcodeFormatCode128Configuration":return new h(t);case"BarcodeFormatCode2Of5Configuration":return new f(t);case"BarcodeFormatDataBarConfiguration":return new p(t);case"BarcodeFormatDataBarExpandedConfiguration":return new m(t);case"BarcodeFormatDataBarLimitedConfiguration":return new g(t);case"BarcodeFormatITFConfiguration":return new v(t);case"BarcodeFormatMSIPlesseyConfiguration":return new A(t);case"BarcodeFormatUpcEanConfiguration":return new b(t);case"BarcodeFormatPharmaCodeConfiguration":return new y(t);case"BarcodeFormatAztecConfiguration":return new C(t);case"BarcodeFormatQRCodeConfiguration":return new S(t);case"BarcodeFormatPDF417Configuration":return new w(t);case"BarcodeFormatMicroPDF417Configuration":return new x(t);case"BarcodeFormatDataMatrixConfiguration":return new E(t);case"BarcodeFormatMaxiCodeConfiguration":return new L(t);case"BarcodeFormatAustraliaPostConfiguration":return new _(t);case"BarcodeFormatJapanPostConfiguration":return new O(t);case"BarcodeFormatRoyalMailConfiguration":return new T(t);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(t);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new D(t);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new P(t);case"BarcodeFormatGS1CompositeConfiguration":return new B(t);case"BarcodeFormatCommonOneDConfiguration":return new F(t);case"BarcodeFormatCommonTwoDConfiguration":return new R(t);case"BarcodeFormatCommonFourStateConfiguration":return new I(t);case"BarcodeFormatCommonConfiguration":return new W(t);default:throw`Unknown child class name: ${e}`}}}(o||(o={})),function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatCodabarConfiguration":return new l(t);case"BarcodeFormatCode11Configuration":return new c(t);case"BarcodeFormatCode39Configuration":return new u(t);case"BarcodeFormatCode93Configuration":return new d(t);case"BarcodeFormatCode128Configuration":return new h(t);case"BarcodeFormatCode2Of5Configuration":return new f(t);case"BarcodeFormatDataBarConfiguration":return new p(t);case"BarcodeFormatDataBarExpandedConfiguration":return new m(t);case"BarcodeFormatDataBarLimitedConfiguration":return new g(t);case"BarcodeFormatITFConfiguration":return new v(t);case"BarcodeFormatMSIPlesseyConfiguration":return new A(t);case"BarcodeFormatUpcEanConfiguration":return new b(t);case"BarcodeFormatPharmaCodeConfiguration":return new y(t);default:throw`Unknown child class name: ${e}`}}}(i||(i={}));class l extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCodabarConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,this.returnStartEnd=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.returnStartEnd&&(this.returnStartEnd=t.returnStartEnd)}}class c extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode11Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksum=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.checksum&&(this.checksum=t.checksum)}}class u extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode39Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.code32=!1,this.code39=!0,this.pzn=!0,this.tryCode39ExtendedMode=!1,this.useCode39CheckDigit=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.code32&&(this.code32=t.code32),void 0!==t.code39&&(this.code39=t.code39),void 0!==t.pzn&&(this.pzn=t.pzn),void 0!==t.tryCode39ExtendedMode&&(this.tryCode39ExtendedMode=t.tryCode39ExtendedMode),void 0!==t.useCode39CheckDigit&&(this.useCode39CheckDigit=t.useCode39CheckDigit)}}class d extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode93Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class h extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode128Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class f extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCode2Of5Configuration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.iata2of5=!0,this.code25=!1,this.industrial2of5=!0,this.useIATA2OF5Checksum=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.iata2of5&&(this.iata2of5=t.iata2of5),void 0!==t.code25&&(this.code25=t.code25),void 0!==t.industrial2of5&&(this.industrial2of5=t.industrial2of5),void 0!==t.useIATA2OF5Checksum&&(this.useIATA2OF5Checksum=t.useIATA2OF5Checksum)}}class p extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class m extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarExpandedConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class g extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataBarLimitedConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class v extends s.a{constructor(t={}){super(),this._type="BarcodeFormatITFConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumTextLength=0,this.maximumTextLength=0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength)}}class A extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMSIPlesseyConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.checksumAlgorithms=["MOD_10"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.checksumAlgorithms&&(this.checksumAlgorithms=t.checksumAlgorithms.map((t=>t)))}}class b extends s.a{constructor(t={}){super(),this._type="BarcodeFormatUpcEanConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.ean8=!0,this.ean13=!0,this.upca=!0,this.upce=!0,this.extensions="AllowAny",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.ean8&&(this.ean8=t.ean8),void 0!==t.ean13&&(this.ean13=t.ean13),void 0!==t.upca&&(this.upca=t.upca),void 0!==t.upce&&(this.upce=t.upce),void 0!==t.extensions&&(this.extensions=t.extensions)}}class y extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPharmaCodeConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.minimumValue=16,this.allowNarrowBarsOnly=!1,this.allowWideBarsOnly=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.minimumValue&&(this.minimumValue=t.minimumValue),void 0!==t.allowNarrowBarsOnly&&(this.allowNarrowBarsOnly=t.allowNarrowBarsOnly),void 0!==t.allowWideBarsOnly&&(this.allowWideBarsOnly=t.allowWideBarsOnly)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatAztecConfiguration":return new C(t);case"BarcodeFormatQRCodeConfiguration":return new S(t);case"BarcodeFormatPDF417Configuration":return new w(t);case"BarcodeFormatMicroPDF417Configuration":return new x(t);case"BarcodeFormatDataMatrixConfiguration":return new E(t);case"BarcodeFormatMaxiCodeConfiguration":return new L(t);default:throw`Unknown child class name: ${e}`}}}(r||(r={}));class C extends s.a{constructor(t={}){super(),this._type="BarcodeFormatAztecConfiguration",this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class S extends s.a{constructor(t={}){super(),this._type="BarcodeFormatQRCodeConfiguration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.qr=!0,this.microQr=!1,this.rmqr=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.qr&&(this.qr=t.qr),void 0!==t.microQr&&(this.microQr=t.microQr),void 0!==t.rmqr&&(this.rmqr=t.rmqr)}}class w extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPDF417Configuration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class x extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMicroPDF417Configuration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class E extends s.a{constructor(t={}){super(),this._type="BarcodeFormatDataMatrixConfiguration",this.regexFilter="",this.gs1Handling="PARSE",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling)}}class L extends s.a{constructor(t={}){super(),this._type="BarcodeFormatMaxiCodeConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}!function(t){t.From=function(t){const e=t._type;switch(e){case"BarcodeFormatAustraliaPostConfiguration":return new _(t);case"BarcodeFormatJapanPostConfiguration":return new O(t);case"BarcodeFormatRoyalMailConfiguration":return new T(t);case"BarcodeFormatRoyalTNTPostConfiguration":return new k(t);case"BarcodeFormatUSPSIntelligentMailConfiguration":return new D(t);case"BarcodeFormatPharmaCodeTwoTrackConfiguration":return new P(t);default:throw`Unknown child class name: ${e}`}}}(a||(a={}));class _ extends s.a{constructor(t={}){super(),this._type="BarcodeFormatAustraliaPostConfiguration",this.regexFilter="",this.australiaPostCustomerFormat="ALPHA_NUMERIC",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.australiaPostCustomerFormat&&(this.australiaPostCustomerFormat=t.australiaPostCustomerFormat)}}class O extends s.a{constructor(t={}){super(),this._type="BarcodeFormatJapanPostConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class T extends s.a{constructor(t={}){super(),this._type="BarcodeFormatRoyalMailConfiguration",this.regexFilter="",this.stripCheckDigits=!1,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits)}}class k extends s.a{constructor(t={}){super(),this._type="BarcodeFormatRoyalTNTPostConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class D extends s.a{constructor(t={}){super(),this._type="BarcodeFormatUSPSIntelligentMailConfiguration",this.regexFilter="",void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter)}}class P extends s.a{constructor(t={}){super(),this._type="BarcodeFormatPharmaCodeTwoTrackConfiguration",this.regexFilter="",this.minimumValue=364,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimumValue&&(this.minimumValue=t.minimumValue)}}class B extends s.a{constructor(t={}){super(),this._type="BarcodeFormatGS1CompositeConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.gs1Handling="PARSE",this.strictMode=!0,void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode)}}class F extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonOneDConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["CODABAR","CODE_11","CODE_25","CODE_32","CODE_39","CODE_93","CODE_128","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_8","EAN_13","IATA_2_OF_5","INDUSTRIAL_2_OF_5","ITF","MSI_PLESSEY","PHARMA_CODE","PZN","UPC_A","UPC_E"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class R extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonTwoDConfiguration",this.regexFilter="",this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","DATA_MATRIX","MAXICODE","MICRO_QR_CODE","MICRO_PDF_417","PDF_417","QR_CODE","RMQR_CODE"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class I extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonFourStateConfiguration",this.regexFilter="",this.formats=["AUSTRALIA_POST","JAPAN_POST","ROYAL_MAIL","ROYAL_TNT_POST","USPS_INTELLIGENT_MAIL"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}class W extends s.a{constructor(t={}){super(),this._type="BarcodeFormatCommonConfiguration",this.regexFilter="",this.minimum1DQuietZoneSize=6,this.stripCheckDigits=!1,this.minimumTextLength=0,this.maximumTextLength=0,this.gs1Handling="PARSE",this.strictMode=!0,this.formats=["AZTEC","CODABAR","CODE_39","CODE_93","CODE_128","DATA_MATRIX","DATABAR","DATABAR_EXPANDED","DATABAR_LIMITED","EAN_13","EAN_8","ITF","MICRO_QR_CODE","PDF_417","QR_CODE","UPC_A","UPC_E"],void 0!==t.regexFilter&&(this.regexFilter=t.regexFilter),void 0!==t.minimum1DQuietZoneSize&&(this.minimum1DQuietZoneSize=t.minimum1DQuietZoneSize),void 0!==t.stripCheckDigits&&(this.stripCheckDigits=t.stripCheckDigits),void 0!==t.minimumTextLength&&(this.minimumTextLength=t.minimumTextLength),void 0!==t.maximumTextLength&&(this.maximumTextLength=t.maximumTextLength),void 0!==t.gs1Handling&&(this.gs1Handling=t.gs1Handling),void 0!==t.strictMode&&(this.strictMode=t.strictMode),void 0!==t.formats&&(this.formats=t.formats.map((t=>t)))}}},function(t,e,n){"use strict";(function(t){function o(t,e=!1){const n=[];if(e)return n;return function t(e){if(e)if(e.constructor===ImageData)n.push(e.data.buffer);else if(e.constructor===ArrayBuffer)n.push(e);else if(ArrayBuffer.isView(e))n.push(e.buffer);else if(Array.isArray(e))for(let n=0;n<e.length;++n)t(e[n]);else if(e.constructor===Object)for(const n in e)e.hasOwnProperty(n)&&t(e[n])}(t),n}function i(t){return t.startsWith("http:")||t.startsWith("https:")}function r(){if("undefined"!=typeof t&&"undefined"!=typeof t.versions&&"undefined"!=typeof t.versions.node)return!1;if(/(iPad|iPhone|iPod)/g.test(navigator.userAgent))return!1;try{return(new MessageChannel).port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,5,4,1,3,1,1,10,11,1,9,0,65,0,254,16,2,0,26,11]))}catch(t){return!1}}function a(t){const{allowSimd:e=!0,allowThreads:n=!0}=t||{};let o="";if(e&&function(){try{return WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,2,1,0,10,9,1,7,0,65,0,253,15,26,11]))}catch(t){return!1}}()){o+="-simd";n&&r()&&(o+="-threads")}return o}n.d(e,"b",(function(){return o})),n.d(e,"d",(function(){return i})),n.d(e,"a",(function(){return r})),n.d(e,"c",(function(){return a}))}).call(this,n(42))},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(){this.values=new Map}}o.INSTANCE=new o},function(t,e,n){"use strict";n.r(e),n.d(e,"BarcodeItem",(function(){return a})),n.d(e,"BarcodeScannerConfiguration",(function(){return s})),n.d(e,"BarcodeScannerResult",(function(){return l}));var o=n(32),i=n(4),r=n(19);class a extends i.a{constructor(t={}){if(super(),this.format="NONE",this.isUpsideDown=!1,this.sourceImage=null,this.isGS1Message=!1,this.isGS1CompositePart=!1,this.dataBarStackSize=1,void 0===t.text)throw new Error("text must be present in constructor argument");if(this.text=t.text,void 0!==t.format&&(this.format=t.format),void 0===t.quad)throw new Error("quad must be present in constructor argument");if(this.quad=t.quad.map((t=>({x:t.x,y:t.y}))),void 0!==t.isUpsideDown&&(this.isUpsideDown=t.isUpsideDown),void 0!==t.sourceImage&&(this.sourceImage=null!=t.sourceImage?t.sourceImage:null),void 0===t.rawBytes)throw new Error("rawBytes must be present in constructor argument");if(this.rawBytes=t.rawBytes,void 0===t.upcEanExtension)throw new Error("upcEanExtension must be present in constructor argument");if(this.upcEanExtension=t.upcEanExtension,void 0!==t.isGS1Message&&(this.isGS1Message=t.isGS1Message),void 0!==t.isGS1CompositePart&&(this.isGS1CompositePart=t.isGS1CompositePart),void 0!==t.dataBarStackSize&&(this.dataBarStackSize=t.dataBarStackSize),void 0===t.parsedDocument)throw new Error("parsedDocument must be present in constructor argument");this.parsedDocument=null!=t.parsedDocument?new r.GenericDocument(t.parsedDocument):null}}class s extends i.a{constructor(t={}){super(),this.barcodeFormatConfigurations=[new o.BarcodeFormatCommonConfiguration({})],this.acceptedDocumentFormats=["AAMVA","BOARDING_PASS","DE_MEDICAL_PLAN","MEDICAL_CERTIFICATE","ID_CARD_PDF_417","SEPA","SWISS_QR","VCARD","GS1","HIBC"],this.onlyAcceptDocuments=!1,this.returnBarcodeImage=!0,this.engineMode="NEXT_GEN_LOW_POWER",this.live=!0,void 0!==t.barcodeFormatConfigurations&&(this.barcodeFormatConfigurations=t.barcodeFormatConfigurations.map((t=>o.BarcodeFormatConfigurationBase.From(t)))),void 0!==t.acceptedDocumentFormats&&(this.acceptedDocumentFormats=t.acceptedDocumentFormats.map((t=>t))),void 0!==t.onlyAcceptDocuments&&(this.onlyAcceptDocuments=t.onlyAcceptDocuments),void 0!==t.returnBarcodeImage&&(this.returnBarcodeImage=t.returnBarcodeImage),void 0!==t.engineMode&&(this.engineMode=t.engineMode),void 0!==t.live&&(this.live=t.live)}}class l extends i.a{constructor(t={}){if(super(),void 0===t.barcodes)throw new Error("barcodes must be present in constructor argument");if(this.barcodes=t.barcodes.map((t=>new a(t))),void 0===t.success)throw new Error("success must be present in constructor argument");this.success=t.success}}},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));class o{constructor(){this.container=void 0,this.containerId=void 0}static mapValues(t,e,n){Object.keys(t).forEach((o=>{(null==n?void 0:n.includes(o))||(e[o]=t[o])}))}static mapValuesDeep(t,e){const n=t=>t&&"object"==typeof t&&!Array.isArray(t);Object.keys(t).forEach((i=>{i in e&&n(t[i])&&n(e[i])?o.mapValuesDeep(t[i],e[i]):e[i]=t[i]}))}static _fromJson(t,e){return this.mapValuesDeep(e,t),t}}},function(t,e,n){"use strict";var o,i=function(){return"undefined"==typeof o&&(o=Boolean(window&&document&&document.all&&!window.atob)),o},r=function(){var t={};return function(e){if("undefined"==typeof t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}t[e]=n}return t[e]}}(),a=[];function s(t){for(var e=-1,n=0;n<a.length;n++)if(a[n].identifier===t){e=n;break}return e}function l(t,e){for(var n={},o=[],i=0;i<t.length;i++){var r=t[i],l=e.base?r[0]+e.base:r[0],c=n[l]||0,u="".concat(l," ").concat(c);n[l]=c+1;var d=s(u),h={css:r[1],media:r[2],sourceMap:r[3]};-1!==d?(a[d].references++,a[d].updater(h)):a.push({identifier:u,updater:g(h,e),references:1}),o.push(u)}return o}function c(t){var e=document.createElement("style"),o=t.attributes||{};if("undefined"==typeof o.nonce){var i=n.nc;i&&(o.nonce=i)}if(Object.keys(o).forEach((function(t){e.setAttribute(t,o[t])})),"function"==typeof t.insert)t.insert(e);else{var a=r(t.insert||"head");if(!a)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");a.appendChild(e)}return e}var u,d=(u=[],function(t,e){return u[t]=e,u.filter(Boolean).join("\n")});function h(t,e,n,o){var i=n?"":o.media?"@media ".concat(o.media," {").concat(o.css,"}"):o.css;if(t.styleSheet)t.styleSheet.cssText=d(e,i);else{var r=document.createTextNode(i),a=t.childNodes;a[e]&&t.removeChild(a[e]),a.length?t.insertBefore(r,a[e]):t.appendChild(r)}}function f(t,e,n){var o=n.css,i=n.media,r=n.sourceMap;if(i?t.setAttribute("media",i):t.removeAttribute("media"),r&&"undefined"!=typeof btoa&&(o+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(r))))," */")),t.styleSheet)t.styleSheet.cssText=o;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(o))}}var p=null,m=0;function g(t,e){var n,o,i;if(e.singleton){var r=m++;n=p||(p=c(e)),o=h.bind(null,n,r,!1),i=h.bind(null,n,r,!0)}else n=c(e),o=f.bind(null,n,e),i=function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(n)};return o(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap)return;o(t=e)}else i()}}t.exports=function(t,e){(e=e||{}).singleton||"boolean"==typeof e.singleton||(e.singleton=i());var n=l(t=t||[],e);return function(t){if(t=t||[],"[object Array]"===Object.prototype.toString.call(t)){for(var o=0;o<n.length;o++){var i=s(n[o]);a[i].references--}for(var r=l(t,e),c=0;c<n.length;c++){var u=s(n[c]);0===a[u].references&&(a[u].updater(),a.splice(u,1))}n=r}}}},function(t,e,n){"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,o){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(o)for(var r=0;r<this.length;r++){var a=this[r][0];null!=a&&(i[a]=!0)}for(var s=0;s<t.length;s++){var l=[].concat(t[s]);o&&i[l[0]]||(n&&(l[2]?l[2]="".concat(n," and ").concat(l[2]):l[2]=n),e.push(l))}},e}},function(t,e,n){"use strict";var o="6.0.0-dev.6";class i{}i.VERSION=o,i.CDN_PATH="https://cdn.jsdelivr.net/npm/scanbot-web-sdk@6.0.0-dev.6/bundle/",i.DEFAULT_WASM_FOLDER="bin/complete/",i.BUILD_WITH_UI=!1;var r=n(33);class a{constructor(t,e){this.errorInWorker=null,this.createProxy=t=>new Proxy({},{get:(e,n,o)=>(...e)=>this.post(n,e,t)}),this.handleUnrecoverableError=t=>{this.errorInWorker=t;for(const e in this.continuations)this.continuations[e].reject(t),delete this.continuations[e]},this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer");const{requestSuffix:n=""}=e||{},o=Object(r.c)(e),i=`${t}${t.endsWith("/")?"":"/"}ScanbotSDK.Core${o}.js${n}`;if(Object(r.d)(i)){const t=new Blob([`importScripts("${i}")`]);this.instance=new Worker(URL.createObjectURL(t))}else this.instance=new Worker(i);this.continuations={},this.nextTicketId=1,this.instance.onmessage=t=>{const{log:e,logError:n}=t.data;if(e)return void console.log(...e);if(n)return void console.error(...n);const{ticket:o,result:i,recoverableError:r,unrecoverableError:a}=t.data,s=this.continuations[o];if(!s)return;const{resolve:l,reject:c}=s;delete this.continuations[o],a?(c(a),this.handleUnrecoverableError(a)):r?c(r):l(i)},this.instance.onerror=t=>{this.handleUnrecoverableError(t.error)}}post(t,e,n){return this.errorInWorker?Promise.reject(this.errorInWorker):new Promise(((o,i)=>{const a=Object(r.b)(e,"copy"==n),s=this.nextTicketId++;this.continuations[s]={resolve:o,reject:i},this.instance.postMessage({command:t,args:e,ticket:s},a)}))}destroy(){this.instance.terminate()}}var s=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class l extends Error{}class c extends Error{}class u{constructor(t,e,n){this.copyArgs=this.createProxy("copy"),this.transferArgs=this.createProxy("transfer"),t||(t=i.CDN_PATH+i.DEFAULT_WASM_FOLDER),this.core=new a(t,e),this.coreInitializationSuccessful=(()=>s(this,void 0,void 0,(function*(){if(yield this.core.copyArgs.initialize(...n)){let e;try{e=yield this.core.copyArgs.version()}catch(t){e="Error"}const n=i.VERSION;return e!==n?new c(`Version mismatch! \nVersion of ScanbotSDK.(ui2.)min.js is "${n}" \nbut the version of the loaded ScanbotSDK.Core*.js file is "${e}". \nThe ScanbotSDK.Core*.js file was loaded from ${t}.`):"OK"}return new l("WASM not initialized successfully. This can be due to an invalid license or problems loading the WASM file. Please check the console for more information.")})))()}awaitInitialized(){return s(this,void 0,void 0,(function*(){yield this.getCoreForCommand()}))}createProxy(t){return new Proxy({},{get:(e,n,o)=>(...e)=>s(this,void 0,void 0,(function*(){const o=yield this.getCoreForCommand(n),i="copy"===t?o.copyArgs:o.transferArgs;return yield i[n](...e)}))})}getCoreForCommand(t=""){return s(this,void 0,void 0,(function*(){const e=yield this.coreInitializationSuccessful;if("OK"===e||"getLicenseInfo"===t&&e instanceof l)return this.core;throw e}))}destroy(){this.core.destroy(),this.core=void 0}}class d{isValid(){return"Okay"===this.status||"Trial"===this.status}static fromJson(t){const e=new d;return e.status=t.licenseStatus,e.description=t.description,e}}var h=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class f{constructor(t,e){this._sdk=t,this._pdfOperation=e}addPage(t,e="COPY_IMAGE"){return h(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);yield n.addPageToPdf(this._pdfOperation,t)}))}complete(){return h(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completePdf(this._pdfOperation)}))}}var p=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class m{constructor(t,e){this._sdk=t,this._tiffOperation=e}addPage(t,e={}){return p(this,void 0,void 0,(function*(){const{binarize:n="ENABLED_IF_BINARIZATION_FILTER_SET",consumeImage:o="COPY_IMAGE"}=e,i=this._sdk.getBridge(o);yield i.addPageToTiff(this._tiffOperation,t,n)}))}complete(){return p(this,void 0,void 0,(function*(){return yield this._sdk.bridge.copyArgs.completeTiff(this._tiffOperation)}))}}var g=n(21);class v{static toPixelSize(t){return t+"px"}static containsString(t,e){return!!t&&-1!==t.indexOf(e)}static copy(t){return JSON.parse(JSON.stringify(t))}static getProperty(t,e){if(t&&t.hasOwnProperty(e))return t[e]}static uuid(){let t="";const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=e.length;for(let o=0;o<5;o++)t+=e.charAt(Math.floor(Math.random()*n));return t}}var A=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class b{static toDataUrl(t){return new Promise(((e,n)=>{const o=new Blob([t],{type:"image/jpeg"}),i=new FileReader;i.onload=()=>e(i.result),i.onerror=()=>n(i.error),i.readAsDataURL(o)}))}static getObjectFitSize(t,e,n=!0){const o=e.width/e.height,i=t.width/t.height;let r=0,a=0;(n?o>i:o<i)?(r=t.width,a=r/o):(a=t.height,r=a*o);const s=(t.width-r)/2,l=(t.height-a)/2;return new g.a(s,l,r,a)}static loadFromUrl(t){return new Promise(((e,n)=>{const o=document.createElement("img");o.src=t,o.onload=()=>A(this,void 0,void 0,(function*(){const t=document.createElement("canvas");t.width=o.width,t.height=o.height;const n=t.getContext("2d");n.drawImage(o,0,0);const i=n.getImageData(0,0,o.width,o.height);e(i)})),o.onerror=n}))}static saveImageData(t){const e=this.createImageDataCanvas(t),n=" ("+t.width+"x"+t.height+")";e.toBlob((t=>this.saveBlob(t,v.uuid()+n+".png")))}static createImageDataCanvas(t){const e=document.createElement("canvas");return e.className="scanbot-sdk-canvas-element",e.width=t.width,e.height=t.height,e.getContext("2d").putImageData(t,0,0),e}static saveBlob(t,e){let n=document.createElement("a");n.setAttribute("download",e);let o=URL.createObjectURL(t);n.setAttribute("href",o),n.click()}static convertImageDataWrapperToImageData(t){if(t)return new ImageData(t.data,t.width,t.height)}static wrapperToBase64(t){return b.createImageDataCanvas(b.convertImageDataWrapperToImageData(t)).toDataURL("image/png")}static toBase64(t){return A(this,void 0,void 0,(function*(){const e=yield new Promise((e=>{const n=new FileReader;n.onload=()=>e(n.result),n.readAsDataURL(new Blob([t]))}));return e.slice(e.indexOf(",")+1)}))}}class y{saveImageAsJpeg(t,e){if(!t||0===t.length)return void console.log("Data cannot be null or empty");e||(e=v.uuid()+".jpeg");let n=new Blob([t],{type:"image/jpeg"});b.saveBlob(n,e)}isCameraSupported(){return!!navigator.mediaDevices}flash(){let t=this.findFlashElement();t.style.display="block",this.animateFlashOpacity("0.5",(()=>{this.animateFlashOpacity("0.0",(()=>{t.style.opacity="1.0",t.style.display="none"}))}))}findFlashElement(){return this.getOrCreateElement("flash",{position:"fixed",top:"0",left:"0",width:"100%",height:"100%","background-color":"#fff",display:"none","z-index":"5000"})}animateFlashOpacity(t,e){const n=this.getElementByClassName("flash");setTimeout((()=>{n.style.opacity=t,e()}),150)}getOrCreateElement(t,e){let n=this.getElementByClassName(t);return n||(this.createElement(t,e),n=this.getElementByClassName(t)),n}createElement(t,e){let n=document.createElement("div");n.className=t,n.style.cssText=this.cssToString(e),document.body.append(n)}cssToString(t){let e="";return Object.keys(t).forEach((n=>{e+=n+":"+t[n]+";"})),e}getElementByClassName(t){const e=document.getElementsByClassName(t);if(0!==e.length)return e[0]}}var C=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class S{constructor(t,e){this._sdk=t,this._mrzRecognizerToken=e}recognize(t,e="COPY_IMAGE"){return C(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.recognizeMRZ(yield this._mrzRecognizerToken,t)}))}recognizeURL(t){return C(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>C(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i);e(r||void 0)}))}))}))}release(){return C(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._mrzRecognizerToken)}))}}var w=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class x{constructor(t,e){this._sdk=t,this._OcrEngineToken=e}performOcr(t,e="COPY_IMAGE"){return w(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.performOcr(this._OcrEngineToken,t)}))}recognizeURL(t){return w(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>w(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.performOcr(i);e(r)}))}))}))}release(){return w(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._OcrEngineToken)}))}}var E=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class L{constructor(t,e){this._sdk=t,this._textDataScannerToken=e}recognize(t,e="COPY_IMAGE"){return E(this,void 0,void 0,(function*(){const n=this._sdk.getBridge(e);return yield n.recognizeTextLine(yield this._textDataScannerToken,t)}))}cleanRecognitionQueue(){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.cleanTextLineRecognitionQueue(yield this._textDataScannerToken)}))}recognizeURL(t){return E(this,void 0,void 0,(function*(){return new Promise((e=>{const n=document.createElement("canvas"),o=document.createElement("img");o.src=t,o.onload=()=>E(this,void 0,void 0,(function*(){n.width=o.width,n.height=o.height;const t=n.getContext("2d");t.drawImage(o,0,0);const i=t.getImageData(0,0,o.width,o.height),r=yield this.recognize(i,"CONSUME_IMAGE");r&&e(r)}))}))}))}release(){return E(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(yield this._textDataScannerToken)}))}}var _=n(14),O=n(22),T=n(9);class k extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new T.GenericTextLineScannerTypes.ScannerConfiguration,this.onTextDetected=function(t){},this.finder.aspectRatio=new T.Geometry.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the text to start scanning"}static fromJson(t){const e=new k;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class D extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.ocrConfiguration=new T.GenericTextLineScannerTypes.ScannerConfiguration,this.onTextDetected=function(t){},this.finder.aspectRatio=new T.Geometry.AspectRatio({width:6,height:1}),this.userGuidance.title.text="Please hold the device over the vehicle identification number to start scanning"}static fromJson(t){const e=new D;return this.mapFinderConfiguration(e,t),this._fromJson(e,t)}}class P extends Error{constructor(t){super(t.description),this.name="LicenseError"}}class B{static throwIfMissingBuffer(t){B.throwIfMissing(t,"ImageBuffer may not be null")}static throwIfMissing(t,e){if(!t)throw new Error(e)}}var F=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class R{constructor(t,e){this._sdk=t,this._token=e}analyze(t,e="COPY_IMAGE"){return F(this,void 0,void 0,(function*(){B.throwIfMissingBuffer(t);const n=this._sdk.getBridge(e);return yield n.documentQualityAnalyzerAnalyze(this._token,t)}))}release(){return F(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._token)}))}}var I=n(16),W=n(0),M=n(43),j=n(13),z=n(3),N=n.n(z),V=n(5);const U="var(--1-sb-dvh, 1vh)";function H(){const t=Object(W.useMemo)((()=>{var t,e;return null===(e=null===(t=null===window||void 0===window?void 0:window.CSS)||void 0===t?void 0:t.supports)||void 0===e?void 0:e.call(t,"height: 100dvh")}),[]),e=()=>{var e=t?"1dvh":window.innerHeight/100+"px";document.documentElement.style.setProperty("--1-sb-dvh",e)};return Object(W.useEffect)((()=>{if(e(),!t)return window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}})),null}var G=n(30),Q=n(11),Y=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function Z(t){const e=Object(W.useContext)(V.a).getColorValue,{styleConfig:n}=t,o=Y(t,["styleConfig"]),i=Object.assign(Object.assign({},t.style),{backgroundColor:e(n.fillColor),borderColor:e(n.strokeColor),borderWidth:n.strokeWidth,borderRadius:n.cornerRadius,borderStyle:"solid"});return W.default.createElement(z.Box,Object.assign({},o,{style:i}))}function q(t){var e;return t.visible?W.default.createElement(z.Button,{variant:"text",onClick:t.onClick,sx:Object.assign(Object.assign({flex:1},Object(Q.b)(t.foreground)),{textTransform:"none",fontSize:18,"&:hover, &:focus, &:active, &":{outline:"none",backgroundColor:"transparent"},px:0}),disableRipple:!0},W.default.createElement(Z,{styleConfig:Object.assign(Object.assign({},t.background),{cornerRadius:4}),sx:{borderStyle:"solid",px:"8px"}},null!==(e=t.icon)&&void 0!==e?e:null,V.b.getLocalizedBarcodeText(t.text))):W.default.createElement("div",{style:{display:"flex",flex:1}})}G.a;const X=W.default.createContext(null);function $(t){const e=t.mode,n="HIDDEN"===e?0:48;Object(W.useEffect)((()=>{if("HIDDEN"===e)return;const n=document.createElement("meta");return n.name="theme-color",n.content=V.b.getColorValue(t.backgroundColor),document.head.appendChild(n),()=>{document.head.removeChild(n)}}),[e]);const o="SOLID"===e?0:n,i={height:n,remainingVisibleBodyHeight:"SOLID"===e?`calc(100 * ${U} - ${n}px)`:`calc(100 * ${U})`,minTopPaddingForContent:o,minTopPaddingForViewFinder:10+o},r="SOLID"===e?{backgroundColor:V.b.getColorValue(t.backgroundColor)}:{backgroundImage:`linear-gradient(to bottom, ${V.b.getColorValue(t.backgroundColor)}, #00000000)`,position:"absolute",backgroundColor:"transparent"};return W.default.createElement(W.default.Fragment,null,"HIDDEN"!==e&&W.default.createElement(z.AppBar,{position:"static",elevation:0,sx:Object.assign({zIndex:1e5,height:n,minHeight:n},r)},W.default.createElement(z.Toolbar,{variant:"dense",sx:{height:n,minHeight:n}},W.default.createElement(z.Box,{sx:{flex:1}},t.cancelButton.visible&&W.default.createElement(W.default.Fragment,null,W.default.createElement(q,Object.assign({onClick:t.onBackPress,icon:t.cancelButton.foreground.iconVisible&&W.default.createElement(N.a,{sx:{fontSize:12,mr:"5px"}})},t.cancelButton)))),W.default.createElement(z.Box,null,W.default.createElement(z.Typography,{variant:"h6",noWrap:!0,component:"div",fontSize:18,fontWeight:600},W.default.createElement(Q.a,{config:t.title}))),W.default.createElement(z.Box,{sx:{flex:1}}))),W.default.createElement(X.Provider,{value:i},t.children))}function K(t){return{textOverflow:"ellipsis","-webkit-box-orient":"vertical","-webkit-line-clamp":`${t}`,overflow:"hidden",whiteSpace:t>1?"normal":"nowrap",display:t>1?"-webkit-box":"block"}}function J(t){if(t.loading)return W.default.createElement(z.Skeleton,{variant:"rounded",width:t.imageSize,height:t.imageSize,style:{borderRadius:8}});if(null===t.data.barcodeImage){const e={width:t.imageSize,height:t.imageSize,backgroundColor:"#E0E0E0",borderRadius:3};return W.default.createElement(z.Box,{sx:e})}const e={width:t.imageSize,height:t.imageSize,borderRadius:8};return W.default.createElement("img",{src:t.data.barcodeImage,alt:t.data.title,style:e})}function tt(t){var e,n;const o=(null===(e=t.barcodeMappedData)||void 0===e?void 0:e.state)||"LOADING",i=(null===(n=t.barcodeMappedData)||void 0===n?void 0:n.value)||{title:"",subtitle:"",barcodeImage:""},r=!t||"LOADED"!==o,a=t.imageSize,s=t.barcodeTitle.visible||t.barcodeSubtitle.visible||t.counterForm,l=t.counterForm&&{"&:hover, &:focus, &:active, &":{borderColor:V.b.getColorValue(t.counterForm.manualCountOutlineColor),backgroundColor:"transparent"}};return W.default.createElement(z.Box,{sx:{display:"flex"},"data-sb-barcode-info":"1"},t.barcodeImageVisible&&W.default.createElement(z.Box,{sx:{pr:s?"16px":0,display:"flex",alignItems:"center",justifyContent:"center"}},W.default.createElement(J,{data:i,imageSize:a,loading:r})),s&&W.default.createElement(z.Box,{sx:{flex:1,display:"flex",flexDirection:"column",verticalAlign:"middle",justifyContent:"center",m:0,p:0,minWidth:0}},t.barcodeTitle.visible&&W.default.createElement(z.Box,{display:r?"block":"flex",sx:{alignItems:"center"}},W.default.createElement(z.Typography,{fontSize:16,fontWeight:"bold",sx:Object.assign(Object.assign({},K(t.maxNumberOfTitleLines)),Object(Q.b)(t.barcodeTitle))},r?W.default.createElement(z.Skeleton,{variant:"text"}):i.title),t.displayRightArrow&&!r&&W.default.createElement(N.a,{sx:{fontSize:16,fontWeight:"bold",color:V.b.getColorValue(t.barcodeTitle.color)}})),t.barcodeSubtitle.visible&&W.default.createElement(z.Typography,{fontSize:14,fontWeight:400,sx:Object.assign(Object.assign({},K(t.maxNumberOfSubtitleLines)),Object(Q.b)(t.barcodeSubtitle))},r?W.default.createElement(z.Skeleton,{variant:"text"}):i.subtitle),t.counterForm&&W.default.createElement(z.ButtonGroup,{variant:"outlined"},W.default.createElement(z.Button,{disabled:!t.counterForm.removeButtonEnabled,sx:l,style:{opacity:t.counterForm.removeButtonEnabled?1:.3},onClick:()=>t.counterForm.setCounter(t.counterForm.counter-1),disableRipple:!0},W.default.createElement(N.a,{sx:{color:V.b.getColorValue(t.counterForm.manualCountChangeColor)}})),W.default.createElement(z.Button,{sx:Object.assign(Object.assign({},l),{color:V.b.getColorValue(t.counterForm.manualCountChangeColor),fontWeight:"bold",fontSize:16}),onClick:t.counterForm.onNumberClick,disableRipple:!0},t.counterForm.counter),W.default.createElement(z.Button,{disabled:!t.counterForm.addButtonEnabled,sx:l,style:{opacity:t.counterForm.addButtonEnabled?1:.3},onClick:()=>t.counterForm.setCounter(t.counterForm.counter+1),disableRipple:!0},W.default.createElement(N.a,{sx:{color:V.b.getColorValue(t.counterForm.manualCountChangeColor)}})))))}j.ButtonConfiguration;function et(t){const e=Object(W.useContext)(V.a).getColorValue;return t.visible?W.default.createElement(z.Button,{onClick:t.onClick,type:t.type,sx:Object.assign(Object.assign({},t.style),{"&:hover, &:focus, &:active, &":{borderStyle:"solid",borderColor:e(t.background.strokeColor),borderWidth:t.background.strokeWidth,backgroundColor:e(t.background.fillColor),textTransform:"none",outline:"none"}}),disableRipple:!0},t.foreground.iconVisible&&t.icon&&W.default.createElement(t.icon,{sx:{color:e(t.foreground.color),pr:2}}),W.default.createElement(Q.a,{config:{visible:!0,text:t.text,color:t.foreground.color,useShadow:t.foreground.useShadow}})):null}var nt=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function ot(t){var e,{modalOverlayColor:n}=t,o=nt(t,["modalOverlayColor"]);const i={backdrop:{style:{backgroundColor:V.b.getColorValue(n)}}},r=Object.assign(Object.assign({},o.PaperProps),{sx:Object.assign(Object.assign({},null===(e=o.PaperProps)||void 0===e?void 0:e.sx),{maxWidth:400})});return W.default.createElement(z.Dialog,Object.assign({},o,{componentsProps:i,PaperProps:r}))}function it(t){const e=Object(W.useContext)(V.a).getColorValue,n=!t.barcodeMappedData||"LOADED"!==t.barcodeMappedData.state,o={backgroundColor:e(n?t.sheetColorLoading:t.sheetColorLoaded)},[i,r]=W.default.useState(),a=Object(W.useRef)((()=>{}));Object(W.useEffect)((()=>{t.open&&r(!1)}),[t.open]);const s=()=>{a.current=t.handleCancel,r(!0)};return W.default.createElement(ot,{modalOverlayColor:t.modalOverlayColor,open:t.open&&!i,fullWidth:!0,TransitionProps:{onExited:()=>{i&&a.current()}},onClose:()=>{n||s()}},W.default.createElement(z.DialogContent,{style:o},W.default.createElement(tt,Object.assign({},t,{maxNumberOfTitleLines:2,maxNumberOfSubtitleLines:1,imageSize:68}))),W.default.createElement(z.DialogActions,{style:o},W.default.createElement(N.a,{container:!0,spacing:2,sx:{overflow:"hidden"}},W.default.createElement(N.a,{item:!0,xs:12},W.default.createElement(N.a,{color:e(t.dividerColor)})),n?W.default.createElement(N.a,{item:!0,xs:12,sx:{textAlign:"center"}},W.default.createElement(z.Box,null,W.default.createElement(z.CircularProgress,{sx:{color:e(t.loadingMessage.color),verticalAlign:"middle",mr:2}}),W.default.createElement(Q.a,{config:t.loadingMessage}))):W.default.createElement(W.default.Fragment,null,W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},onClick:s},t.cancelButton))),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},onClick:()=>{a.current=t.handleSubmit,r(!0)}},t.submitButton)))))))}var rt=n(1);rt.h;function at(t){if(!1===t.visible)return null;const e={backgroundColor:t.active?V.b.getColorValue(t.activeBackgroundColor):V.b.getColorValue(t.backgroundColor),color:t.active?V.b.getColorValue(t.activeForegroundColor):V.b.getColorValue(t.foregroundColor)};return W.default.createElement(z.IconButton,{sx:Object.assign(Object.assign({},e),{"&:hover, &:focus":Object.assign({outline:"none"},e),width:48,height:48}),onClick:t.onClick},t.text&&W.default.createElement("span",{style:{fontSize:15}},V.b.getLocalizedBarcodeText(t.text)),t.icon&&W.default.createElement(t.icon,{style:{padding:7}}))}var st=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class lt{constructor(){this.audioFile=new Audio}initialize(t){return st(this,void 0,void 0,(function*(){t.successBeepEnabled&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAASCG1kYXQBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwBQCKAo3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+aIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQEQfEIQGIQaqctMIv9EpiYforpaDbT80WfPFRSswKfd8cy6kN/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u//EKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaXfViFLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwA6jQQpRY6EYNCcKDAqAAEUgC2wFy0kF7JTgecsqIp6pxd/lHO7kUuSCLFK6n2mPOKfj5aKhQPOaRtBEKFS85eIYbr71AGaAPJTSIHeIhXTcpA5i155UICz3nXk0Cz0A8QhxIhoqQIJ2Be9MIEiJ6GpuMa1fPXcJmIoxDUKpZuJozBa6iFmjy7O/genSlwPKL6xaiiL8Y1XtgBDY7ke/CAOoawOqmZm6suSVQPbxzaxZJpWFcWva4RqTil72HqDpc2N4eG3KA0JkU8G58RNabxVq9gSLwysPKIzL1fZVF1FQwllEs4YUKpPtoMw2VtepdbZHqGriAsZ5Lu154uiewW41szI4RHfpWOWSH7s1LAzlv/xClpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWl36AhS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0vAA6jQEYVEIDEQDEKCAYhAIXMdbaI5q82OvhmYS1FO11cD3Yt4EwZI+aTsqoctJJaN0FKvNqorQmK3SUWpNOtf+uKNIxX3xeTEq8LKb/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd/+IUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u+GEKWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpeABMDQD6WqsfRABwAUSib4c3/4hS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS7/8QpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpaWlpd+EIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS8AAAO4bW9vdgAAAGxtdmhkAAAAAAAAAAAAAAAAAAAD6AAAAfgAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAiJ0cmFrAAAAXHRraGQAAAADAAAAAAAAAAAAAAABAAAAAAAAAfgAAAAAAAAAAAAAAAEBAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAkZWR0cwAAABxlbHN0AAAAAAAAAAEAAAH4AAAIAAABAAAAAAGabWRpYQAAACBtZGhkAAAAAAAAAAAAAAAAAAAfQAAAF8BVxAAAAAAALWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABTb3VuZEhhbmRsZXIAAAABRW1pbmYAAAAQc21oZAAAAAAAAAAAAAAAJGRpbmYAAAAcZHJlZgAAAAAAAAABAAAADHVybCAAAAABAAABCXN0YmwAAABnc3RzZAAAAAAAAAABAAAAV21wNGEAAAAAAAAAAQAAAAAAAAAAAAEAEAAAAAAfQAAAAAAAM2VzZHMAAAAAA4CAgCIAAQAEgICAFEAVAAAAAAH0AAAAvXkFgICAAhWIBoCAgAECAAAAIHN0dHMAAAAAAAAAAgAAAAUAAAQAAAAAAQAAA8AAAAAcc3RzYwAAAAAAAAABAAAAAQAAAAYAAAABAAAAFHN0c3oAAAAAAAADAAAAAAYAAAAUc3RjbwAAAAAAAAABAAAALAAAABpzZ3BkAQAAAHJvbGwAAAACAAAAAf//AAAAHHNiZ3AAAAAAcm9sbAAAAAEAAAAGAAAAAQAAASJ1ZHRhAAABGm1ldGEAAAAAAAAAIWhkbHIAAAAAAAAAAG1kaXJhcHBsAAAAAAAAAAAAAAAA7Wlsc3QAAAAzqW5hbQAAACtkYXRhAAAAAQAAAAAyNTAgTWlsbGlzZWNvbmRzIG9mIFNpbGVuY2UAAAApqUFSVAAAACFkYXRhAAAAAQAAAABBbmFyIFNvZnR3YXJlIExMQwAAAClhQVJUAAAAIWRhdGEAAAABAAAAAEFuYXIgU29mdHdhcmUgTExDAAAAI6lhbGIAAAAbZGF0YQAAAAEAAAAAQmxhbmsgQXVkaW8AAAAkqXRvbwAAABxkYXRhAAAAAQAAAABMYXZmNjAuMy4xMDAAAAAZY3BpbAAAABFkYXRhAAAAFQAAAAAA",yield this.play(),"MODERN_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAACAE00QSBpc29taXNvMgAAAAhmcmVlAAAEcm1kYXQBQCKAo30ghS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDmVAjh8QBrRiUH/88pKh3gJPmPt9t8oIUtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLwDsl6UY83aVqFeq3aVmmYyFp70/kJT+A9hdePd7Z7aRSFKZBhCUP6E1rS/9+DhfmhvTknCnQzE+QHVPD6rhSIRpGIAFmBioF1XkxwAQjxKkQMc+qECgXnCAU1IcgpFDnWo02EdihsnrUx/1bJAUo+x6//p8VmoS0iuleHvPnKj9mjjHOoaDGI/s2DHcYI66Grp+5pezZuKJExJOzoyJRdmv6ltO6ibTdTDZ1YqLauKTebYOtpTWnh3/K3kBQmN3NsieqxzHeZKNiFphWuYSWMhaHIZRnRt6O/WzTXYFGrG0wBT54NCQ3wtSpqr5dHbQN2yY0jcckhLUieNtOSjS3u1NuMqWbOx1zHwlHfJKgI349OU9iZEzeN3rCVbBVdrdcAEW9Cm2Ji2FjQNkiFBViV6ofFsNVeVqpKgpsf3/iWtBG6cpMqFHjy2QhyBEnPtwTbWbm9b1u7frF3bnaVykqieEvTKfqnCYL2u4g1CLiQ4Zb8hkkTL9tnGmdMOeqIkUcHZ0zsspzvHOUXJTlssZTRjqcIsp514HJO9YhVRXALKaCRKQkbMEty3CstONNYzuhq57bbccc+/Pq22226ueWXLLbTTw4bFIoQoGWepZBRJWQFh4yui2+evKOqLp+rLKJ4LKcAtQ7XA0aLCyMRVDDOmuoYcnFEmIrpzmRQNQIJ5HWvOesgzjrK071chBhESdztJ0sMqhdAAyjegdEYPNyA4BCDQtLGRRKQQBQIhXYqGZ65Pu1S7XMxxVXEOWtJGMAARETyDKiMN4tsmFfcvmo+sHuHZrY196169rbT/sHFGNK1cnJrBK2vDu7b0AsBd9VaKrsNHL/KxFHm3Yma/+S365yvTF+abktGk7JSrS++mXLBw76AiuijMPpwzPoP4jNzZjI+R/p7zboMSKiFvZkMx8CDIPGB+K2Ee7XaOqAu8z6cWgazCp76DdzIwsmGw2TiczmQMAafEX0U6lQOAA6jQJAfCsBrSxVH+Hw8fPKIpB7JuhzAB/BwAAAw9tb292AAAAbG12aGQAAAAAAAAAAAAAAAAAAAPoAAAATwABAAABAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAACOnRyYWsAAABcdGtoZAAAAAMAAAAAAAAAAAAAAAEAAAAAAAAATwAAAAAAAAAAAAAAAQEAAAAAAQAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAACRlZHRzAAAAHGVsc3QAAAAAAAAAAQAAAE4AAAgAAAEAAAAAAbJtZGlhAAAAIG1kaGQAAAAAAAAAAAAAAAAAAKxEAAAVgFXEAAAAAAAtaGRscgAAAAAAAAAAc291bgAAAAAAAAAAAAAAAFNvdW5kSGFuZGxlcgAAAAFdbWluZgAAABBzbWhkAAAAAAAAAAAAAAAkZGluZgAAABxkcmVmAAAAAAAAAAEAAAAMdXJsIAAAAAEAAAEhc3RibAAAAGdzdHNkAAAAAAAAAAEAAABXbXA0YQAAAAAAAAABAAAAAAAAAAAAAQAQAAAAAKxEAAAAAAAzZXNkcwAAAAADgICAIgABAASAgIAUQBUAAAAAARrvAAEa7wWAgIACEggGgICAAQIAAAAgc3R0cwAAAAAAAAACAAAABQAABAAAAAABAAABgAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAALkAAAC6AAABIAAAAQAAAAC9AAAAGgAAABRzdGNvAAAAAAAAAAEAAAAsAAAAGnNncGQBAAAAcm9sbAAAAAIAAAAB//8AAAAcc2JncAAAAAByb2xsAAAAAQAAAAYAAAABAAAAYXVkdGEAAABZbWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAsaWxzdAAAACSpdG9vAAAAHGRhdGEAAAABAAAAAExhdmY2MC4zLjEwMA=="),"CLASSIC_BEEP"===t.soundType&&(this.audioFile.src="data:audio/mp4;base64,AAAAHGZ0eXBNNEEgAAAAAE00QSBtcDQyaXNvbQAAAAFtZGF0AAAAAAAACHchIANAaBv6AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAOCFO4v////////gyh+L1JkJB36Cv0yBUdzB8/8/b8vveozPf+/6eH18deTh9kOp11urWAB5ZsMnhMwSjUCF2MQub4hybjxDhHACGof0XiT9tAHVOwt4NPtPOMFr/ndlTpTNXy79GYIfXP7VkPs99ySHNOFkpNrBS1pClU3rRGHp6Dy9FBIlk4KbBNBLGMJRcWQxuVsVJCSMnGw1FuIUrBN2UJLoEMhurMxpIiyGAweBvyfNJy4FbxqDm3WDjCtzP+3yVmOjxhIBDANLYyeG05LNyCZONEOk/c4hCj3Y2XQkgTI7y/39g0a+MuEoAdbRz4gSgRJnjEGB0TnOB0LtiL0XB9kwz2SwCBB0MvIByUSWTPTsRdCA4PvEmwnNdTnJT5/kPGk4swkTgOOuWJBI0EkxFs5mmNIR6wSFql36Hn03/Lf/uHp+6aTmBY0HJ6P6X1atw/Y8vK72LCWpsq0beo5KkrrrMe1eabaDyfZRPYfgPwH4Dv4CHU663VrAA8wchbBRlqQNnYNlYNhYNigNhoTBsTCcTCgLBEQCX+XfNd+3y+piKntTerXdXpDWRpLzsKmJ4iRM4ig+I6R65pDawx8Ry4cxfeifbsbzK/TxNhafR9y2zFVicy8nCVkU6CkmLckGtqbuYvhruBP0TriLNTU1TNhW6tUCdUSyneDUWAox5RTMlF2W1san5MQRlj7Btm2bZhoqoUUAJlpaat54WVuTyOxqwzNVhPenFR9KBpuA3qrUrT+3ShOUdXAkGXmCrMBxH3XmROdVSkS8cccRMOKTN+7OOEIQrMYIcna5hipAqPHk6VSgy0gGXljIk7GR/O606SyhhgglQIZLyxxOa/ZANmzZkyZMlRoqIt/T6xZHaFLcZ6n8jSgTVoOGsK5MvOlIBBkR+AtM5hvkTG2UzEhEAcsA7bZfCZmmZmZjQnqfn/yRwXzQtlZljFYd93mGppQSDDV/oz8HKkKjElN9Pu/inFmh3IHFyXlrJ/dodwM2EUkLZff1jWCO84wYUa3JB52yTMCETuUgA0BWB+I4hDBR1xoligVhgVhgNhYdBcLCcakAb1XLO/eZ9cUtvv6cNzrRYdMWgFvJySSSSscWFxCQElKcwc2dFkyos8dHfXPYFSt0klO2wUeIUxNKf5LiWYGm57bV0dipv7Qpw9uRRu23CuNIbT7++AuwEnyFWIQP0OpdUhc7u2k2fKW3mTZZxCSb+gVCjOzNf7LzxdBpbZxYwuNkcRlqAMdRMhq+tXmbLkMGGph20w4JvwvBm+x4Wtomh4lz0GGBVGQ96+JUXhvqQQAQPRTHtn+e7SwaCKMXnEEWXevaFVrPVEX7wxIBbbcpAHXj2DQz/vO9M0FHzyQFtegQjjn+fM99jgBE2fLJs/PLcErzrmCGJdVHZ19uxTErdmR6viG6cetew2MYQFm5AIDdPmjeXifvbFcjkYQWUsqKoBQJAKMp50hLtJRCKLCTSw2f7e0wzzhr6eGhjlyOQ8blgBiR0fxcjQYM5rBBM/wzuDe972u2f/mN7u8zVqGu7QADPHgAK4PxW8nJJJJLgISwUZaaRYmFRWRBEIwQKfmepncccZoqHnVy0WnFag51Yt48agPiK7D59zNlI+6YR9SHvnKoiJCcRzsskEGDgIrLQoLEgDguNTzeNvuxVpc8wntXmUlTQMa9WLn/geS8F7ku6Vt+I9yiumFP6I5hbEGeXac1BCB3YA3gNA0rLFPwrWq//VvtF6JGKIOVA12lCnpZl8NJojK1yqVsVKp+ZqbDpq0S1duspmvSvCbwmftOnwnfuNqBCnzZfzZF9fkqxTCqlq8GmR3bGK+1uvEcF55cGGx8BNANhkk1438/rWbXeTtPGfukvhUxZBp0M5447+2SFiQW674ySiGSRHgyqcqU0x39tbz3afnWt5BKNHDYj1lzq6sg8dcJlJnSQDUEba4npgEoAqVUkksoqM0UUO3VXDo3Mablwd2GLAoXjgK071swbuWhQJ2AjGYsBx5dtOMYCyPVh+K3jxqA+IuAhTrc+3KVqmDuVmIO5TZmQbDr4vUV+0338fXQ3665PiYnII1REb2klWhUcwjqi/pMe4yYZaDbo9T1ougUKE5h1jUim2NZxM71zBZVa/tWam6wXlmFVVHGuvL76pT3PUGufbO9YwevQzCvXhsabRuJyJjz8A1Haftmewy4gZ0FWlMIO5BoXB49j0TeIiikaxP9ZHcD9oI6x2H4DajNt5WgRXj6/H72V+gj2bgMDVkIZ36j1Tl+wdO6fvFsz56a5V6t9lS+gyWSOvuQP9bqtYgqWlsthXSFkrTfNqni6jSQ5vN9Fp1iYJODbUg8Sg0lYLbNEM7oqvrggxzq13IfO9hGQ0MQVpMIAR0aSGMFWOZzpJmXG1IcjppdZkINTYN2UvrHmGUrVBHvRuueFPuy2GzQoSnMCvkT3WvaR/LoVYw7Voy47wdJee2Va623AFXWNINOpByyoc9SQU4vPQ6X0PMBLQs6GdMlx+RlC3VoMDOryeFFolCTD8B+A/A4AAANKbW9vdgAAAGxtdmhkAAAAANcxfvfXMX73AACsRAAADbEAAQAAAQAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAdx0cmFrAAAAXHRraGQAAAAB1zF+99cxfvcAAAABAAAAAAAADbEAAAAAAAAAAAAAAAABAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAABAAAAAAAAAAAAAAAAAAAF4bWRpYQAAACBtZGhkAAAAANcxfvfXMX73AACsRAAAGABVxAAAAAAAMWhkbHIAAAAAAAAAAHNvdW4AAAAAAAAAAAAAAABDb3JlIE1lZGlhIEF1ZGlvAAAAAR9taW5mAAAAEHNtaGQAAAAAAAAAAAAAACRkaW5mAAAAHGRyZWYAAAAAAAAAAQAAAAx1cmwgAAAAAQAAAONzdGJsAAAAZ3N0c2QAAAAAAAAAAQAAAFdtcDRhAAAAAAAAAAEAAAAAAAAAAAACABAAAAAArEQAAAAAADNlc2RzAAAAAAOAgIAiAAAABICAgBRAFQAYAAAB9AAAAfQABYCAgAISEAaAgIABAgAAABhzdHRzAAAAAAAAAAEAAAAGAAAEAAAAABxzdHNjAAAAAAAAAAEAAAABAAAABgAAAAEAAAAsc3RzegAAAAAAAAAAAAAABgAAAP4AAAF+AAABjwAAAYQAAAFeAAABegAAABRzdGNvAAAAAAAAAAEAAAAsAAAA+nVkdGEAAADybWV0YQAAAAAAAAAiaGRscgAAAAAAAAAAbWRpcgAAAAAAAAAAAAAAAAAAAAAAxGlsc3QAAAC8LS0tLQAAABxtZWFuAAAAAGNvbS5hcHBsZS5pVHVuZXMAAAAUbmFtZQAAAABpVHVuU01QQgAAAIRkYXRhAAAAAQAAAAAgMDAwMDAwMDAgMDAwMDA4NDAgMDAwMDAyMEYgMDAwMDAwMDAwMDAwMERCMSAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMCAwMDAwMDAwMA=="))}))}beep(t){t.successBeepEnabled&&this.play()}play(){return st(this,void 0,void 0,(function*(){try{yield this.audioFile.play()}catch(t){}}))}}lt.INSTANCE=new lt;var ct=lt;class ut{constructor(){this.DURATION=200}vibrate(t){t.enabled&&navigator.vibrate&&navigator.vibrate(this.DURATION)}}ut.INSTANCE=new ut;var dt=ut,ht=n(12),ft=n(23),pt=n(26),mt=n(24);class gt extends W.default.Component{constructor(t){super(t),this.state={base64Image:void 0}}render(){const t="x"+this.props.barcode.count;return W.default.createElement("div",{style:{display:"flex",flexDirection:"row",backgroundColor:"white",paddingBottom:5,paddingTop:5,borderBottom:"0.5px solid gray"}},W.default.createElement("div",{style:{display:"flex",flexDirection:"column",justifyContent:"center",width:"100%"}},W.default.createElement("div",{style:{display:"flex",fontSize:15,fontWeight:400,width:"100%"}},W.default.createElement("div",{style:{flex:1}},this.props.barcode.text),W.default.createElement("div",{style:{flex:1,justifyContent:"end",display:"flex"}},t)),W.default.createElement("div",{style:{color:"gray",fontSize:13,fontWeight:300}},this.props.barcode.format)))}}function vt(t,e){return t.format===e.format&&t.text===e.text}function At(t){return t.text+t.format}class bt extends W.default.Component{constructor(t){super(t),this.state={barcodes:this.toUniqueListWithDuplicateCounter(t.barcodes)}}toUniqueListWithDuplicateCounter(t){const e=[];return t.forEach((t=>{const n=e.findIndex((e=>vt(e,t)));-1===n?(t.count=1,e.push(t)):e[n].count++})),e}update(t){this.setState({barcodes:this.toUniqueListWithDuplicateCounter(t)})}render(){return W.default.createElement("div",{style:{display:"flex",flexDirection:"column",backgroundColor:"white",padding:15}},this.state.barcodes.map(((t,e)=>W.default.createElement(gt,{key:e,barcode:t,onClick:this.props.onClick}))))}}class yt{}yt.ScanbotPrimary="#c8193c",yt.LightGray="#F5F5F5",yt.Gray="#808080",yt.DarkGray="#333333",yt.Orange="#FF5533",yt.White="#FFFFFF",yt.TransparentGreen="rgba(0, 255, 0, 0.5)",yt.TransparentGray="rgba(50, 50, 50, 0.5)",yt.TransparentBlack="rgba(0, 0, 0, 0.3)",yt.SBNegative="#FF3737";var Ct,St=yt;!function(t){t[t.None=0]="None",t[t.PushRight=1]="PushRight",t[t.PushBottom=2]="PushBottom",t[t.Pop=3]="Pop"}(Ct||(Ct={}));class wt extends W.default.Component{constructor(t){super(t),this._isVisible=!1,this.state={animation:{type:Ct.None},elements:[]}}containerStyle(t){return{height:"100%",width:"100%",position:"absolute",top:"0",left:"0",zIndex:101,transform:t,overflow:"scroll"}}render(){var t,e,n;if(this.state.animation.type===Ct.None)return null;const o=this.animation(this.state.animation.type),i=this.to(this.state.animation.type);this.previousDestination=i;const r=this.props.style;return W.default.createElement(o,{style:this.containerStyle(`${i}`),onAnimationStart:this.onAnimationStart.bind(this),onAnimationEnd:this.onAnimationEnd.bind(this),onClick:t=>{this.reset()}},W.default.createElement("div",{style:{backgroundColor:"white",height:r.sheetHeight,width:"100%",marginTop:r.sheetTopMargin,borderTopLeftRadius:20,borderTopRightRadius:20},onClick:t=>{t.stopPropagation()}},W.default.createElement("div",{style:{borderTopLeftRadius:20,borderTopRightRadius:20,backgroundColor:St.ScanbotPrimary}},W.default.createElement("div",{style:{display:"flex",justifyContent:"center",alignItems:"end",height:10}},W.default.createElement("div",{style:{backgroundColor:St.White,height:3,width:33,borderRadius:5}})),W.default.createElement("div",{style:{display:"flex",height:50}},W.default.createElement("div",{style:{display:"flex",fontSize:12,flex:1,color:St.White,alignItems:"center",justifyContent:"left",paddingLeft:10,fontWeight:300},onClick:this.props.onDeleteClick},"CLEAR ALL"),W.default.createElement("div",{style:{display:"flex",fontSize:15,flex:1,color:St.White,justifyContent:"center",alignItems:"center",fontWeight:500}},(null!==(e=null===(t=this.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)+" Codes"),W.default.createElement("div",{style:{display:"flex",fontSize:13,flex:1,color:St.White,justifyContent:"right",alignItems:"center",paddingRight:10}},W.default.createElement("div",{style:{fontSize:30,fontWeight:100},onClick:t=>{t.stopPropagation(),this.reset()}},"×")))),W.default.createElement(bt,{ref:t=>{null!==t&&(this.list=t)},barcodes:null!==(n=this.barcodes)&&void 0!==n?n:[]})))}reset(){this.pop()}isVisible(){return this._isVisible}push(t,e){this._isVisible=!0,this.barcodes=e,this.updateAnimationType(t)}update(t){this.barcodes=t,this.forceUpdate()}pop(){this._isVisible=!1,this.updateAnimationType(Ct.Pop)}onAnimationStart(){}onAnimationEnd(){this.state.animation.type===Ct.Pop&&this.updateAnimationType(Ct.None)}updateAnimationType(t,e){this.setState({animation:{type:t}},e)}animation(t){let e=this.from(t),n=this.to(t);this.previousDestination===n&&(e=this.previousDestination,n=this.previousDestination);const o=mt.b`from {transform: ${e};} to {transform: ${n};}`;return mt.a.div`animation: ${o} 0.5s;`}from(t){if(t===Ct.PushRight)return this.translate("X",100);if(t===Ct.PushBottom)return this.translate("Y",100);if(t===Ct.Pop){const t=this.pushType===Ct.PushRight?"X":"Y";return this.translate(t,0)}}to(t){if(t===Ct.PushRight)return this.translate("X",0);if(t===Ct.PushBottom)return this.translate("Y",0);if(t===Ct.Pop){const t=this.pushType===Ct.PushRight?"X":"Y";return this.translate(t,100)}}translate(t,e){return"translate"+t+"("+e+"%)"}componentWillUnmount(){this._isVisible=!1}}var xt=n(2),Et=function(t){return{isEnabled:function(e){return t.some((function(t){return!!e[t]}))}}},Lt={measureLayout:Et(["layout","layoutId","drag","_layoutResetTransform"]),animation:Et(["animate","exit","variants","whileHover","whileTap","whileFocus","whileDrag"]),exit:Et(["exit"]),drag:Et(["drag","dragControls"]),focus:Et(["whileFocus"]),hover:Et(["whileHover","onHoverStart","onHoverEnd"]),tap:Et(["whileTap","onTap","onTapStart","onTapCancel"]),pan:Et(["onPan","onPanStart","onPanSessionStart","onPanEnd"]),layoutAnimation:Et(["layout","layoutId"])};var _t=Object(W.createContext)({strict:!1}),Ot=Object.keys(Lt),Tt=Ot.length;var kt=Object(W.createContext)({transformPagePoint:function(t){return t},isStatic:!1}),Dt=Object(W.createContext)({});var Pt=Object(W.createContext)(null);function Bt(t){var e=Object(W.useRef)(null);return null===e.current&&(e.current=t()),e.current}function Ft(){var t=Object(W.useContext)(Pt);if(null===t)return[!0,null];var e=t.isPresent,n=t.onExitComplete,o=t.register,i=Mt();Object(W.useEffect)((function(){return o(i)}),[]);return!e&&n?[!1,function(){return null==n?void 0:n(i)}]:[!0]}function Rt(t){return null===t||t.isPresent}var It=0,Wt=function(){return It++},Mt=function(){return Bt(Wt)},jt=Object(W.createContext)(null),zt="undefined"!=typeof window,Nt=zt?W.useLayoutEffect:W.useEffect;function Vt(t,e,n,o){var i=Object(W.useContext)(kt),r=Object(W.useContext)(_t),a=Object(W.useContext)(Dt).visualElement,s=Object(W.useContext)(Pt),l=function(t){var e=t.layoutId,n=Object(W.useContext)(jt);return n&&void 0!==e?n+"-"+e:e}(n),c=Object(W.useRef)(void 0);o||(o=r.renderer),!c.current&&o&&(c.current=o(t,{visualState:e,parent:a,props:Object(xt.a)(Object(xt.a)({},n),{layoutId:l}),presenceId:null==s?void 0:s.id,blockInitialAnimation:!1===(null==s?void 0:s.initial)}));var u=c.current;return Nt((function(){u&&(u.setProps(Object(xt.a)(Object(xt.a)(Object(xt.a)({},i),n),{layoutId:l})),u.isPresent=Rt(s),u.isPresenceRoot=!a||a.presenceId!==(null==s?void 0:s.id),u.syncRender())})),Object(W.useEffect)((function(){var t;u&&(null===(t=u.animationState)||void 0===t||t.animateChanges())})),Nt((function(){return function(){return null==u?void 0:u.notifyUnmount()}}),[]),u}function Ut(t){return"object"==typeof t&&Object.prototype.hasOwnProperty.call(t,"current")}function Ht(t){return Array.isArray(t)}function Gt(t){return"string"==typeof t||Ht(t)}function Qt(t,e,n,o,i){var r;return void 0===o&&(o={}),void 0===i&&(i={}),"string"==typeof e&&(e=null===(r=t.variants)||void 0===r?void 0:r[e]),"function"==typeof e?e(null!=n?n:t.custom,o,i):e}function Yt(t,e,n){var o=t.getProps();return Qt(o,e,null!=n?n:o.custom,function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.get()})),e}(t),function(t){var e={};return t.forEachValue((function(t,n){return e[n]=t.getVelocity()})),e}(t))}function Zt(t){var e;return"function"==typeof(null===(e=t.animate)||void 0===e?void 0:e.start)||Gt(t.initial)||Gt(t.animate)||Gt(t.whileHover)||Gt(t.whileDrag)||Gt(t.whileTap)||Gt(t.whileFocus)||Gt(t.exit)}function qt(t){return Boolean(Zt(t)||t.variants)}function Xt(t,e){var n=function(t,e){if(Zt(t)){var n=t.initial,o=t.animate;return{initial:!1===n||Gt(n)?n:void 0,animate:Gt(o)?o:void 0}}return!1!==t.inherit?e:{}}(t,Object(W.useContext)(Dt)),o=n.initial,i=n.animate;return Object(W.useMemo)((function(){return{initial:o,animate:i}}),e?[$t(o),$t(i)]:[])}function $t(t){return Array.isArray(t)?t.join(" "):t}function Kt(t){var e=t.preloadedFeatures,n=t.createVisualElement,o=t.useRender,i=t.useVisualState,r=t.Component;return e&&function(t){for(var e in t){var n=t[e];null!==n&&(Lt[e].Component=n)}}(e),Object(W.forwardRef)((function(t,e){var a=Object(W.useContext)(kt).isStatic,s=null,l=Xt(t,a),c=i(t,a);return!a&&zt&&(l.visualElement=Vt(r,c,t,n),s=function(t,e,n){var o=[];if(Object(W.useContext)(_t),!e)return null;for(var i=0;i<Tt;i++){var r=Ot[i],a=Lt[r],s=a.isEnabled,l=a.Component;s(t)&&l&&o.push(W.createElement(l,Object(xt.a)({key:r},t,{visualElement:e})))}return o}(t,l.visualElement)),W.createElement(W.Fragment,null,W.createElement(Dt.Provider,{value:l},o(r,t,function(t,e,n){return Object(W.useCallback)((function(o){var i;o&&(null===(i=t.mount)||void 0===i||i.call(t,o)),e&&(o?e.mount(o):e.unmount()),n&&("function"==typeof n?n(o):Ut(n)&&(n.current=o))}),[e])}(c,l.visualElement,e),c,a)),s)}))}function Jt(t){function e(e,n){return void 0===n&&(n={}),Kt(t(e,n))}var n=new Map;return new Proxy(e,{get:function(t,o){return n.has(o)||n.set(o,e(o)),n.get(o)}})}var te=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","svg","switch","symbol","text","tspan","use","view"];function ee(t){return"string"==typeof t&&!t.includes("-")&&!!(te.indexOf(t)>-1||/[A-Z]/.test(t))}var ne={};var oe=["","X","Y","Z"],ie=["transformPerspective","x","y","z"];function re(t,e){return ie.indexOf(t)-ie.indexOf(e)}["translate","scale","rotate","skew"].forEach((function(t){return oe.forEach((function(e){return ie.push(t+e)}))}));var ae=new Set(ie);function se(t){return ae.has(t)}var le=new Set(["originX","originY","originZ"]);function ce(t){return le.has(t)}function ue(t,e){var n=e.layout,o=e.layoutId;return se(t)||ce(t)||(n||void 0!==o)&&(!!ne[t]||"opacity"===t)}var de=function(t){return null!==t&&"object"==typeof t&&t.getVelocity},he={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function fe(t){return t.startsWith("--")}var pe=function(t,e){return e&&"number"==typeof t?e.transform(t):t},me=function(t,e){return function(n){return Math.max(Math.min(n,e),t)}},ge=function(t){return t%1?Number(t.toFixed(5)):t},ve=/(-)?([\d]*\.?[\d])+/g,Ae=/(#[0-9a-f]{6}|#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))/gi,be=/^(#[0-9a-f]{3}|#(?:[0-9a-f]{2}){2,4}|(rgb|hsl)a?\((-?[\d\.]+%?[,\s]+){2,3}\s*\/*\s*[\d\.]+%?\))$/i;function ye(t){return"string"==typeof t}var Ce=function(t){return{test:function(e){return ye(e)&&e.endsWith(t)&&1===e.split(" ").length},parse:parseFloat,transform:function(e){return""+e+t}}},Se=Ce("deg"),we=Ce("%"),xe=Ce("px"),Ee=Ce("vh"),Le=Ce("vw"),_e=Object(xt.a)(Object(xt.a)({},we),{parse:function(t){return we.parse(t)/100},transform:function(t){return we.transform(100*t)}}),Oe={test:function(t){return"number"==typeof t},parse:parseFloat,transform:function(t){return t}},Te=Object(xt.a)(Object(xt.a)({},Oe),{transform:me(0,1)}),ke=Object(xt.a)(Object(xt.a)({},Oe),{default:1}),De=Object(xt.a)(Object(xt.a)({},Oe),{transform:Math.round}),Pe={borderWidth:xe,borderTopWidth:xe,borderRightWidth:xe,borderBottomWidth:xe,borderLeftWidth:xe,borderRadius:xe,radius:xe,borderTopLeftRadius:xe,borderTopRightRadius:xe,borderBottomRightRadius:xe,borderBottomLeftRadius:xe,width:xe,maxWidth:xe,height:xe,maxHeight:xe,size:xe,top:xe,right:xe,bottom:xe,left:xe,padding:xe,paddingTop:xe,paddingRight:xe,paddingBottom:xe,paddingLeft:xe,margin:xe,marginTop:xe,marginRight:xe,marginBottom:xe,marginLeft:xe,rotate:Se,rotateX:Se,rotateY:Se,rotateZ:Se,scale:ke,scaleX:ke,scaleY:ke,scaleZ:ke,skew:Se,skewX:Se,skewY:Se,distance:xe,translateX:xe,translateY:xe,translateZ:xe,x:xe,y:xe,z:xe,perspective:xe,transformPerspective:xe,opacity:Te,originX:_e,originY:_e,originZ:xe,zIndex:De,fillOpacity:Te,strokeOpacity:Te,numOctaves:De};function Be(t,e,n,o,i,r,a,s){var l,c=t.style,u=t.vars,d=t.transform,h=t.transformKeys,f=t.transformOrigin;h.length=0;var p=!1,m=!1,g=!0;for(var v in e){var A=e[v];if(fe(v))u[v]=A;else{var b=Pe[v],y=pe(A,b);if(se(v)){if(p=!0,d[v]=y,h.push(v),!g)continue;A!==(null!==(l=b.default)&&void 0!==l?l:0)&&(g=!1)}else if(ce(v))f[v]=y,m=!0;else if((null==n?void 0:n.isHydrated)&&(null==o?void 0:o.isHydrated)&&ne[v]){var C=ne[v].process(A,o,n),S=ne[v].applyTo;if(S)for(var w=S.length,x=0;x<w;x++)c[S[x]]=C;else c[v]=C}else c[v]=y}}o&&n&&a&&s?(c.transform=a(o.deltaFinal,o.treeScale,p?d:void 0),r&&(c.transform=r(d,c.transform)),c.transformOrigin=s(o)):(p&&(c.transform=function(t,e,n,o){var i=t.transform,r=t.transformKeys,a=e.enableHardwareAcceleration,s=void 0===a||a,l=e.allowTransformNone,c=void 0===l||l,u="";r.sort(re);for(var d=!1,h=r.length,f=0;f<h;f++){var p=r[f];u+=(he[p]||p)+"("+i[p]+") ","z"===p&&(d=!0)}return!d&&s?u+="translateZ(0)":u=u.trim(),o?u=o(i,n?"":u):c&&n&&(u="none"),u}(t,i,g,r)),m&&(c.transformOrigin=function(t){var e=t.originX,n=void 0===e?"50%":e,o=t.originY,i=void 0===o?"50%":o,r=t.originZ;return n+" "+i+" "+(void 0===r?0:r)}(f)))}var Fe=function(){return{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}};function Re(t,e,n){for(var o in e)de(e[o])||ue(o,n)||(t[o]=e[o])}function Ie(t,e,n){var o={};return Re(o,t.style||{},t),Object.assign(o,function(t,e,n){var o=t.transformTemplate;return Object(W.useMemo)((function(){var t={style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}};Be(t,e,void 0,void 0,{enableHardwareAcceleration:!n},o);var i=t.vars,r=t.style;return Object(xt.a)(Object(xt.a)({},i),r)}),[e])}(t,e,n)),t.transformValues&&(o=t.transformValues(o)),o}function We(t,e,n){var o={},i=Ie(t,e,n);return Boolean(t.drag)&&(o.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=!0===t.drag?"none":"pan-"+("x"===t.drag?"y":"x")),o.style=i,o}var Me=new Set(["initial","animate","exit","style","variants","transition","transformTemplate","transformValues","custom","inherit","layout","layoutId","_layoutResetTransform","onLayoutAnimationComplete","onViewportBoxUpdate","onLayoutMeasure","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","drag","dragControls","dragListener","dragConstraints","dragDirectionLock","_dragX","_dragY","dragElastic","dragMomentum","dragPropagation","dragTransition","whileDrag","onPan","onPanStart","onPanEnd","onPanSessionStart","onTap","onTapStart","onTapCancel","onHoverStart","onHoverEnd","whileFocus","whileTap","whileHover"]);function je(t){return Me.has(t)}var ze=function(t){return!je(t)};try{var Ne=n(49).default;ze=function(t){return t.startsWith("on")?!je(t):Ne(t)}}catch(t){}function Ve(t,e,n){return"string"==typeof t?t:xe.transform(e+n*t)}var Ue=function(t,e){return xe.transform(t*e)},He={offset:"stroke-dashoffset",array:"stroke-dasharray"},Ge={offset:"strokeDashoffset",array:"strokeDasharray"};function Qe(t,e,n,o,i,r,a,s){var l=e.attrX,c=e.attrY,u=e.originX,d=e.originY,h=e.pathLength,f=e.pathSpacing,p=void 0===f?1:f,m=e.pathOffset,g=void 0===m?0:m;Be(t,Object(xt.d)(e,["attrX","attrY","originX","originY","pathLength","pathSpacing","pathOffset"]),n,o,i,r,a,s),t.attrs=t.style,t.style={};var v=t.attrs,A=t.style,b=t.dimensions,y=t.totalPathLength;v.transform&&(b&&(A.transform=v.transform),delete v.transform),b&&(void 0!==u||void 0!==d||A.transform)&&(A.transformOrigin=function(t,e,n){return Ve(e,t.x,t.width)+" "+Ve(n,t.y,t.height)}(b,void 0!==u?u:.5,void 0!==d?d:.5)),void 0!==l&&(v.x=l),void 0!==c&&(v.y=c),void 0!==y&&void 0!==h&&function(t,e,n,o,i,r){void 0===o&&(o=1),void 0===i&&(i=0),void 0===r&&(r=!0);var a=r?He:Ge;t[a.offset]=Ue(-i,e);var s=Ue(n,e),l=Ue(o,e);t[a.array]=s+" "+l}(v,y,h,p,g,!1)}var Ye=function(){return Object(xt.a)(Object(xt.a)({},{style:{},transform:{},transformKeys:[],transformOrigin:{},vars:{}}),{attrs:{}})};function Ze(t,e){var n=Object(W.useMemo)((function(){var n=Ye();return Qe(n,e,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),Object(xt.a)(Object(xt.a)({},n.attrs),{style:Object(xt.a)({},n.style)})}),[e]);if(t.style){var o={};Re(o,t.style,t),n.style=Object(xt.a)(Object(xt.a)({},o),n.style)}return n}function qe(t){void 0===t&&(t=!1);return function(e,n,o,i,r){var a=i.latestValues,s=(ee(e)?Ze:We)(n,a,r),l=function(t,e,n){var o={};for(var i in t)(ze(i)||!0===n&&je(i)||!e&&!je(i))&&(o[i]=t[i]);return o}(n,"string"==typeof e,t),c=Object(xt.a)(Object(xt.a)(Object(xt.a)({},l),s),{ref:o});return Object(W.createElement)(e,c)}}var Xe=/([a-z])([A-Z])/g,$e=function(t){return t.replace(Xe,"$1-$2").toLowerCase()};function Ke(t,e){var n=e.style,o=e.vars;for(var i in Object.assign(t.style,n),o)t.style.setProperty(i,o[i])}var Je=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform"]);function tn(t,e){for(var n in Ke(t,e),e.attrs)t.setAttribute(Je.has(n)?n:$e(n),e.attrs[n])}function en(t){var e=t.style,n={};for(var o in e)(de(e[o])||ue(o,t))&&(n[o]=e[o]);return n}function nn(t){var e=en(t);for(var n in t){if(de(t[n]))e["x"===n||"y"===n?"attr"+n.toUpperCase():n]=t[n]}return e}function on(t){return"object"==typeof t&&"function"==typeof t.start}var rn=function(t){return Array.isArray(t)};function an(t){var e,n=de(t)?t.get():t;return e=n,Boolean(e&&"object"==typeof e&&e.mix&&e.toValue)?n.toValue():n}function sn(t,e,n,o){var i=t.scrapeMotionValuesFromProps,r=t.createRenderState,a=t.onMount,s={latestValues:cn(e,n,o,i),renderState:r()};return a&&(s.mount=function(t){return a(e,t,s)}),s}var ln=function(t){return function(e,n){var o=Object(W.useContext)(Dt),i=Object(W.useContext)(Pt);return n?sn(t,e,o,i):Bt((function(){return sn(t,e,o,i)}))}};function cn(t,e,n,o){var i={},r=!1===(null==n?void 0:n.initial),a=o(t);for(var s in a)i[s]=an(a[s]);var l=t.initial,c=t.animate,u=Zt(t),d=qt(t);e&&d&&!u&&!1!==t.inherit&&(null!=l||(l=e.initial),null!=c||(c=e.animate));var h=r||!1===l?c:l;h&&"boolean"!=typeof h&&!on(h)&&(Array.isArray(h)?h:[h]).forEach((function(e){var n=Qt(t,e);if(n){var o=n.transitionEnd;n.transition;var r=Object(xt.d)(n,["transitionEnd","transition"]);for(var a in r)i[a]=r[a];for(var a in o)i[a]=o[a]}}));return i}var un={useVisualState:ln({scrapeMotionValuesFromProps:nn,createRenderState:Ye,onMount:function(t,e,n){var o=n.renderState,i=n.latestValues;try{o.dimensions="function"==typeof e.getBBox?e.getBBox():e.getBoundingClientRect()}catch(t){o.dimensions={x:0,y:0,width:0,height:0}}"path"===e.tagName&&(o.totalPathLength=e.getTotalLength()),Qe(o,i,void 0,void 0,{enableHardwareAcceleration:!1},t.transformTemplate),tn(e,o)}})};var dn,hn={useVisualState:ln({scrapeMotionValuesFromProps:en,createRenderState:Fe})};function fn(t,e,n,o){var i=e.forwardMotionProps,r=void 0!==i&&i,a=ee(t)?un:hn;return Object(xt.a)(Object(xt.a)({},a),{preloadedFeatures:n,useRender:qe(r),createVisualElement:o,Component:t})}function pn(t,e,n,o){return t.addEventListener(e,n,o),function(){return t.removeEventListener(e,n,o)}}function mn(t,e,n,o){Object(W.useEffect)((function(){var i=t.current;if(n&&i)return pn(i,e,n,o)}),[t,e,n,o])}function gn(t){return"undefined"!=typeof PointerEvent&&t instanceof PointerEvent?!("mouse"!==t.pointerType):t instanceof MouseEvent}function vn(t){return!!t.touches}!function(t){t.Animate="animate",t.Hover="whileHover",t.Tap="whileTap",t.Drag="whileDrag",t.Focus="whileFocus",t.Exit="exit"}(dn||(dn={}));var An={pageX:0,pageY:0};function bn(t,e){void 0===e&&(e="page");var n=t.touches[0]||t.changedTouches[0]||An;return{x:n[e+"X"],y:n[e+"Y"]}}function yn(t,e){return void 0===e&&(e="page"),{x:t[e+"X"],y:t[e+"Y"]}}function Cn(t,e){return void 0===e&&(e="page"),{point:vn(t)?bn(t,e):yn(t,e)}}var Sn=function(t,e){void 0===e&&(e=!1);var n,o=function(e){return t(e,Cn(e))};return e?(n=o,function(t){var e=t instanceof MouseEvent;(!e||e&&0===t.button)&&n(t)}):o},wn={pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointercancel:"mousecancel",pointerover:"mouseover",pointerout:"mouseout",pointerenter:"mouseenter",pointerleave:"mouseleave"},xn={pointerdown:"touchstart",pointermove:"touchmove",pointerup:"touchend",pointercancel:"touchcancel"};function En(t){return zt&&null===window.onpointerdown?t:zt&&null===window.ontouchstart?xn[t]:zt&&null===window.onmousedown?wn[t]:t}function Ln(t,e,n,o){return pn(t,En(e),Sn(n,"pointerdown"===e),o)}function _n(t,e,n,o){return mn(t,En(e),n&&Sn(n,"pointerdown"===e),o)}function On(t){var e=null;return function(){return null===e&&(e=t,function(){e=null})}}var Tn=On("dragHorizontal"),kn=On("dragVertical");function Dn(t){var e=!1;if("y"===t)e=kn();else if("x"===t)e=Tn();else{var n=Tn(),o=kn();n&&o?e=function(){n(),o()}:(n&&n(),o&&o())}return e}function Pn(){var t=Dn(!0);return!t||(t(),!1)}function Bn(t,e,n){return function(o,i){var r;gn(o)&&!Pn()&&(null==n||n(o,i),null===(r=t.animationState)||void 0===r||r.setActive(dn.Hover,e))}}var Fn=function(t,e){return!!e&&(t===e||Fn(t,e.parentElement))};function Rn(t){return Object(W.useEffect)((function(){return function(){return t()}}),[])}var In=function(t,e){return function(n){return e(t(n))}},Wn=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return t.reduce(In)};var Mn=function(t){return function(e){return t(e),null}},jn={tap:Mn((function(t){var e=t.onTap,n=t.onTapStart,o=t.onTapCancel,i=t.whileTap,r=t.visualElement,a=e||n||o||i,s=Object(W.useRef)(!1),l=Object(W.useRef)(null);function c(){var t;null===(t=l.current)||void 0===t||t.call(l),l.current=null}function u(){var t;return c(),s.current=!1,null===(t=r.animationState)||void 0===t||t.setActive(dn.Tap,!1),!Pn()}function d(t,n){u()&&(Fn(r.getInstance(),t.target)?null==e||e(t,n):null==o||o(t,n))}function h(t,e){u()&&(null==o||o(t,e))}_n(r,"pointerdown",a?function(t,e){var o;c(),s.current||(s.current=!0,l.current=Wn(Ln(window,"pointerup",d),Ln(window,"pointercancel",h)),null==n||n(t,e),null===(o=r.animationState)||void 0===o||o.setActive(dn.Tap,!0))}:void 0),Rn(c)})),focus:Mn((function(t){var e=t.whileFocus,n=t.visualElement;mn(n,"focus",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(dn.Focus,!0)}:void 0),mn(n,"blur",e?function(){var t;null===(t=n.animationState)||void 0===t||t.setActive(dn.Focus,!1)}:void 0)})),hover:Mn((function(t){var e=t.onHoverStart,n=t.onHoverEnd,o=t.whileHover,i=t.visualElement;_n(i,"pointerenter",e||o?Bn(i,!0,e):void 0),_n(i,"pointerleave",n||o?Bn(i,!1,n):void 0)}))};function zn(t,e){if(!Array.isArray(e))return!1;var n=e.length;if(n!==t.length)return!1;for(var o=0;o<n;o++)if(e[o]!==t[o])return!1;return!0}var Nn=function(t,e,n){return Math.min(Math.max(n,t),e)},Vn=.001;function Un(t){var e,n,o=t.duration,i=void 0===o?800:o,r=t.bounce,a=void 0===r?.25:r,s=t.velocity,l=void 0===s?0:s,c=t.mass,u=void 0===c?1:c,d=1-a;d=Nn(.05,1,d),i=Nn(.01,10,i/1e3),d<1?(e=function(t){var e=t*d,n=e*i,o=e-l,r=Hn(t,d),a=Math.exp(-n);return Vn-o/r*a},n=function(t){var n=t*d*i,o=n*l+l,r=Math.pow(d,2)*Math.pow(t,2)*i,a=Math.exp(-n),s=Hn(Math.pow(t,2),d);return(-e(t)+Vn>0?-1:1)*((o-r)*a)/s}):(e=function(t){return Math.exp(-t*i)*((t-l)*i+1)-.001},n=function(t){return Math.exp(-t*i)*(i*i*(l-t))});var h=function(t,e,n){for(var o=n,i=1;i<12;i++)o-=t(o)/e(o);return o}(e,n,5/i);if(i*=1e3,isNaN(h))return{stiffness:100,damping:10,duration:i};var f=Math.pow(h,2)*u;return{stiffness:f,damping:2*d*Math.sqrt(u*f),duration:i}}function Hn(t,e){return t*Math.sqrt(1-e*e)}var Gn=["duration","bounce"],Qn=["stiffness","damping","mass"];function Yn(t,e){return e.some((function(e){return void 0!==t[e]}))}function Zn(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.restSpeed,a=void 0===r?2:r,s=t.restDelta,l=Object(xt.d)(t,["from","to","restSpeed","restDelta"]),c={done:!1,value:n},u=function(t){var e=Object(xt.a)({velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1},t);if(!Yn(t,Qn)&&Yn(t,Gn)){var n=Un(t);(e=Object(xt.a)(Object(xt.a)(Object(xt.a)({},e),n),{velocity:0,mass:1})).isResolvedFromDuration=!0}return e}(l),d=u.stiffness,h=u.damping,f=u.mass,p=u.velocity,m=u.duration,g=u.isResolvedFromDuration,v=qn,A=qn;function b(){var t=p?-p/1e3:0,e=i-n,o=h/(2*Math.sqrt(d*f)),r=Math.sqrt(d/f)/1e3;if(null!=s||(s=Math.abs(i-n)<=1?.01:.4),o<1){var a=Hn(r,o);v=function(n){var s=Math.exp(-o*r*n);return i-s*((t+o*r*e)/a*Math.sin(a*n)+e*Math.cos(a*n))},A=function(n){var i=Math.exp(-o*r*n);return o*r*i*(Math.sin(a*n)*(t+o*r*e)/a+e*Math.cos(a*n))-i*(Math.cos(a*n)*(t+o*r*e)-a*e*Math.sin(a*n))}}else if(1===o)v=function(n){return i-Math.exp(-r*n)*(e+(t+r*e)*n)};else{var l=r*Math.sqrt(o*o-1);v=function(n){var a=Math.exp(-o*r*n),s=Math.min(l*n,300);return i-a*((t+o*r*e)*Math.sinh(s)+l*e*Math.cosh(s))/l}}}return b(),{next:function(t){var e=v(t);if(g)c.done=t>=m;else{var n=1e3*A(t),o=Math.abs(n)<=a,r=Math.abs(i-e)<=s;c.done=o&&r}return c.value=c.done?i:e,c},flipTarget:function(){var t;p=-p,n=(t=[i,n])[0],i=t[1],b()}}}Zn.needsInterpolation=function(t,e){return"string"==typeof t||"string"==typeof e};var qn=function(t){return 0},Xn=function(t,e,n){var o=e-t;return 0===o?1:(n-t)/o},$n=function(t,e,n){return-n*t+n*e+t},Kn=function(t,e){return function(n){return Boolean(ye(n)&&be.test(n)&&n.startsWith(t)||e&&Object.prototype.hasOwnProperty.call(n,e))}},Jn=function(t,e,n){return function(o){var i;if(!ye(o))return o;var r=o.match(ve),a=r[0],s=r[1],l=r[2],c=r[3];return(i={})[t]=parseFloat(a),i[e]=parseFloat(s),i[n]=parseFloat(l),i.alpha=void 0!==c?parseFloat(c):1,i}},to=me(0,255),eo=Object(xt.a)(Object(xt.a)({},Oe),{transform:function(t){return Math.round(to(t))}}),no={test:Kn("rgb","red"),parse:Jn("red","green","blue"),transform:function(t){var e=t.red,n=t.green,o=t.blue,i=t.alpha,r=void 0===i?1:i;return"rgba("+eo.transform(e)+", "+eo.transform(n)+", "+eo.transform(o)+", "+ge(Te.transform(r))+")"}};var oo={test:Kn("#"),parse:function(t){var e="",n="",o="",i="";return t.length>5?(e=t.substr(1,2),n=t.substr(3,2),o=t.substr(5,2),i=t.substr(7,2)):(e=t.substr(1,1),n=t.substr(2,1),o=t.substr(3,1),i=t.substr(4,1),e+=e,n+=n,o+=o,i+=i),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(o,16),alpha:i?parseInt(i,16)/255:1}},transform:no.transform},io={test:Kn("hsl","hue"),parse:Jn("hue","saturation","lightness"),transform:function(t){var e=t.hue,n=t.saturation,o=t.lightness,i=t.alpha,r=void 0===i?1:i;return"hsla("+Math.round(e)+", "+we.transform(ge(n))+", "+we.transform(ge(o))+", "+ge(Te.transform(r))+")"}},ro=function(t,e,n){var o=t*t,i=e*e;return Math.sqrt(Math.max(0,n*(i-o)+o))},ao=[oo,no,io],so=function(t){return ao.find((function(e){return e.test(t)}))},lo=function(t){return"'"+t+"' is not an animatable color. Use the equivalent color code instead."},co=function(t,e){var n=so(t),o=so(e);lo(t),lo(e),n.transform,o.transform;var i=n.parse(t),r=o.parse(e),a=Object(xt.a)({},i),s=n===io?$n:ro;return function(t){for(var e in a)"alpha"!==e&&(a[e]=s(i[e],r[e],t));return a.alpha=$n(i.alpha,r.alpha,t),n.transform(a)}},uo={test:function(t){return no.test(t)||oo.test(t)||io.test(t)},parse:function(t){return no.test(t)?no.parse(t):io.test(t)?io.parse(t):oo.parse(t)},transform:function(t){return ye(t)?t:t.hasOwnProperty("red")?no.transform(t):io.transform(t)}},ho="${c}",fo="${n}";function po(t){var e=[],n=0,o=t.match(Ae);o&&(n=o.length,t=t.replace(Ae,ho),e.push.apply(e,o.map(uo.parse)));var i=t.match(ve);return i&&(t=t.replace(ve,fo),e.push.apply(e,i.map(Oe.parse))),{values:e,numColors:n,tokenised:t}}function mo(t){return po(t).values}function go(t){var e=po(t),n=e.values,o=e.numColors,i=e.tokenised,r=n.length;return function(t){for(var e=i,n=0;n<r;n++)e=e.replace(n<o?ho:fo,n<o?uo.transform(t[n]):ge(t[n]));return e}}var vo=function(t){return"number"==typeof t?0:t};var Ao={test:function(t){var e,n,o,i;return isNaN(t)&&ye(t)&&(null!==(n=null===(e=t.match(ve))||void 0===e?void 0:e.length)&&void 0!==n?n:0)+(null!==(i=null===(o=t.match(Ae))||void 0===o?void 0:o.length)&&void 0!==i?i:0)>0},parse:mo,createTransformer:go,getAnimatableNone:function(t){var e=mo(t);return go(t)(e.map(vo))}},bo=function(t){return"number"==typeof t};function yo(t,e){return bo(t)?function(n){return $n(t,e,n)}:uo.test(t)?co(t,e):xo(t,e)}var Co=function(t,e){var n=Object(xt.e)([],t),o=n.length,i=t.map((function(t,n){return yo(t,e[n])}));return function(t){for(var e=0;e<o;e++)n[e]=i[e](t);return n}},So=function(t,e){var n=Object(xt.a)(Object(xt.a)({},t),e),o={};for(var i in n)void 0!==t[i]&&void 0!==e[i]&&(o[i]=yo(t[i],e[i]));return function(t){for(var e in o)n[e]=o[e](t);return n}};function wo(t){for(var e=Ao.parse(t),n=e.length,o=0,i=0,r=0,a=0;a<n;a++)o||"number"==typeof e[a]?o++:void 0!==e[a].hue?r++:i++;return{parsed:e,numNumbers:o,numRGB:i,numHSL:r}}var xo=function(t,e){var n=Ao.createTransformer(e),o=wo(t),i=wo(e);return o.numHSL===i.numHSL&&o.numRGB===i.numRGB&&(o.numNumbers,i.numNumbers),Wn(Co(o.parsed,i.parsed),n)},Eo=function(t,e){return function(n){return $n(t,e,n)}};function Lo(t,e,n){for(var o,i=[],r=n||("number"==typeof(o=t[0])?Eo:"string"==typeof o?uo.test(o)?co:xo:Array.isArray(o)?Co:"object"==typeof o?So:void 0),a=t.length-1,s=0;s<a;s++){var l=r(t[s],t[s+1]);if(e){var c=Array.isArray(e)?e[s]:e;l=Wn(c,l)}i.push(l)}return i}function _o(t,e,n){var o=void 0===n?{}:n,i=o.clamp,r=void 0===i||i,a=o.ease,s=o.mixer,l=t.length;e.length,!a||!Array.isArray(a)||a.length,t[0]>t[l-1]&&(t=[].concat(t),e=[].concat(e),t.reverse(),e.reverse());var c=Lo(e,a,s),u=2===l?function(t,e){var n=t[0],o=t[1],i=e[0];return function(t){return i(Xn(n,o,t))}}(t,c):function(t,e){var n=t.length,o=n-1;return function(i){var r=0,a=!1;if(i<=t[0]?a=!0:i>=t[o]&&(r=o-1,a=!0),!a){for(var s=1;s<n&&!(t[s]>i||s===o);s++);r=s-1}var l=Xn(t[r],t[r+1],i);return e[r](l)}}(t,c);return r?function(e){return u(Nn(t[0],t[l-1],e))}:u}var Oo,To=function(t){return function(e){return 1-t(1-e)}},ko=function(t){return function(e){return e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2}},Do=function(t){return function(e){return e*e*((t+1)*e-t)}},Po=function(t){return t},Bo=(Oo=2,function(t){return Math.pow(t,Oo)}),Fo=To(Bo),Ro=ko(Bo),Io=function(t){return 1-Math.sin(Math.acos(t))},Wo=To(Io),Mo=ko(Wo),jo=Do(1.525),zo=To(jo),No=ko(jo),Vo=function(t){var e=Do(t);return function(t){return(t*=2)<1?.5*e(t):.5*(2-Math.pow(2,-10*(t-1)))}}(1.525),Uo=function(t){if(1===t||0===t)return t;var e=t*t;return t<.36363636363636365?7.5625*e:t<.7272727272727273?9.075*e-9.9*t+3.4:t<.9?12.066481994459833*e-19.63545706371191*t+8.898060941828255:10.8*t*t-20.52*t+10.72},Ho=To(Uo);function Go(t,e){return t.map((function(){return e||Ro})).splice(0,t.length-1)}function Qo(t){var e=t.from,n=void 0===e?0:e,o=t.to,i=void 0===o?1:o,r=t.ease,a=t.offset,s=t.duration,l=void 0===s?300:s,c={done:!1,value:n},u=Array.isArray(i)?i:[n,i],d=function(t,e){return t.map((function(t){return t*e}))}(a&&a.length===u.length?a:function(t){var e=t.length;return t.map((function(t,n){return 0!==n?n/(e-1):0}))}(u),l);function h(){return _o(d,u,{ease:Array.isArray(r)?r:Go(u,r)})}var f=h();return{next:function(t){return c.value=f(t),c.done=t>=l,c},flipTarget:function(){u.reverse(),f=h()}}}var Yo={keyframes:Qo,spring:Zn,decay:function(t){var e=t.velocity,n=void 0===e?0:e,o=t.from,i=void 0===o?0:o,r=t.power,a=void 0===r?.8:r,s=t.timeConstant,l=void 0===s?350:s,c=t.restDelta,u=void 0===c?.5:c,d=t.modifyTarget,h={done:!1,value:i},f=a*n,p=i+f,m=void 0===d?p:d(p);return m!==p&&(f=m-i),{next:function(t){var e=-f*Math.exp(-t/l);return h.done=!(e>u||e<-u),h.value=h.done?m:m+e,h},flipTarget:function(){}}}};var Zo=1/60*1e3,qo="undefined"!=typeof performance?function(){return performance.now()}:function(){return Date.now()},Xo="undefined"!=typeof window?function(t){return window.requestAnimationFrame(t)}:function(t){return setTimeout((function(){return t(qo())}),Zo)};var $o=!0,Ko=!1,Jo=!1,ti={delta:0,timestamp:0},ei=["read","update","preRender","render","postRender"],ni=ei.reduce((function(t,e){return t[e]=function(t){var e=[],n=[],o=0,i=!1,r=new WeakSet,a={schedule:function(t,a,s){void 0===a&&(a=!1),void 0===s&&(s=!1);var l=s&&i,c=l?e:n;return a&&r.add(t),-1===c.indexOf(t)&&(c.push(t),l&&i&&(o=e.length)),t},cancel:function(t){var e=n.indexOf(t);-1!==e&&n.splice(e,1),r.delete(t)},process:function(s){var l;if(i=!0,e=(l=[n,e])[0],(n=l[1]).length=0,o=e.length)for(var c=0;c<o;c++){var u=e[c];u(s),r.has(u)&&(a.schedule(u),t())}i=!1}};return a}((function(){return Ko=!0})),t}),{}),oi=ei.reduce((function(t,e){var n=ni[e];return t[e]=function(t,e,o){return void 0===e&&(e=!1),void 0===o&&(o=!1),Ko||li(),n.schedule(t,e,o)},t}),{}),ii=ei.reduce((function(t,e){return t[e]=ni[e].cancel,t}),{}),ri=ei.reduce((function(t,e){return t[e]=function(){return ni[e].process(ti)},t}),{}),ai=function(t){return ni[t].process(ti)},si=function(t){Ko=!1,ti.delta=$o?Zo:Math.max(Math.min(t-ti.timestamp,40),1),ti.timestamp=t,Jo=!0,ei.forEach(ai),Jo=!1,Ko&&($o=!1,Xo(si))},li=function(){Ko=!0,$o=!0,Jo||Xo(si)},ci=function(){return ti},ui=oi;function di(t,e,n){return void 0===n&&(n=0),t-e-n}var hi=function(t){var e=function(e){var n=e.delta;return t(n)};return{start:function(){return ui.update(e,!0)},stop:function(){return ii.update(e)}}};function fi(t){var e,n,o,i,r,a=t.from,s=t.autoplay,l=void 0===s||s,c=t.driver,u=void 0===c?hi:c,d=t.elapsed,h=void 0===d?0:d,f=t.repeat,p=void 0===f?0:f,m=t.repeatType,g=void 0===m?"loop":m,v=t.repeatDelay,A=void 0===v?0:v,b=t.onPlay,y=t.onStop,C=t.onComplete,S=t.onRepeat,w=t.onUpdate,x=Object(xt.d)(t,["from","autoplay","driver","elapsed","repeat","repeatType","repeatDelay","onPlay","onStop","onComplete","onRepeat","onUpdate"]),E=x.to,L=0,_=x.duration,O=!1,T=!0,k=function(t){if(Array.isArray(t.to))return Qo;if(Yo[t.type])return Yo[t.type];var e=new Set(Object.keys(t));return e.has("ease")||e.has("duration")&&!e.has("dampingRatio")?Qo:e.has("dampingRatio")||e.has("stiffness")||e.has("mass")||e.has("damping")||e.has("restSpeed")||e.has("restDelta")?Zn:Qo}(x);(null===(n=(e=k).needsInterpolation)||void 0===n?void 0:n.call(e,a,E))&&(r=_o([0,100],[a,E],{clamp:!1}),a=0,E=100);var D=k(Object(xt.a)(Object(xt.a)({},x),{from:a,to:E}));function P(){L++,"reverse"===g?h=function(t,e,n,o){return void 0===n&&(n=0),void 0===o&&(o=!0),o?di(e+-t,e,n):e-(t-e)+n}(h,_,A,T=L%2==0):(h=di(h,_,A),"mirror"===g&&D.flipTarget()),O=!1,S&&S()}function B(t){if(T||(t=-t),h+=t,!O){var e=D.next(Math.max(0,h));i=e.value,r&&(i=r(i)),O=T?e.done:h<=0}null==w||w(i),O&&(0===L&&(null!=_||(_=h)),L<p?function(t,e,n,o){return o?t>=e+n:t<=-n}(h,_,A,T)&&P():(o.stop(),C&&C()))}return l&&(null==b||b(),(o=u(B)).start()),{stop:function(){null==y||y(),o.stop()}}}function pi(t,e){return e?t*(1e3/e):0}var mi=function(t){return 1e3*t},gi=function(t,e){return 1-3*e+3*t},vi=function(t,e){return 3*e-6*t},Ai=function(t){return 3*t},bi=function(t,e,n){return((gi(e,n)*t+vi(e,n))*t+Ai(e))*t},yi=function(t,e,n){return 3*gi(e,n)*t*t+2*vi(e,n)*t+Ai(e)};var Ci=.1;function Si(t,e,n,o){if(t===e&&n===o)return Po;for(var i=new Float32Array(11),r=0;r<11;++r)i[r]=bi(r*Ci,t,n);function a(e){for(var o=0,r=1;10!==r&&i[r]<=e;++r)o+=Ci;--r;var a=o+(e-i[r])/(i[r+1]-i[r])*Ci,s=yi(a,t,n);return s>=.001?function(t,e,n,o){for(var i=0;i<8;++i){var r=yi(e,n,o);if(0===r)return e;e-=(bi(e,n,o)-t)/r}return e}(e,a,t,n):0===s?a:function(t,e,n,o,i){var r,a,s=0;do{(r=bi(a=e+(n-e)/2,o,i)-t)>0?n=a:e=a}while(Math.abs(r)>1e-7&&++s<10);return a}(e,o,o+Ci,t,n)}return function(t){return 0===t||1===t?t:bi(a(t),e,o)}}var wi={linear:Po,easeIn:Bo,easeInOut:Ro,easeOut:Fo,circIn:Io,circInOut:Mo,circOut:Wo,backIn:jo,backInOut:No,backOut:zo,anticipate:Vo,bounceIn:Ho,bounceInOut:function(t){return t<.5?.5*(1-Uo(1-2*t)):.5*Uo(2*t-1)+.5},bounceOut:Uo},xi=function(t){if(Array.isArray(t)){t.length;var e=Object(xt.c)(t,4);return Si(e[0],e[1],e[2],e[3])}return"string"==typeof t?wi[t]:t},Ei=function(t,e){return"zIndex"!==t&&(!("number"!=typeof e&&!Array.isArray(e))||!("string"!=typeof e||!Ao.test(e)||e.startsWith("url(")))},Li=function(){return{type:"spring",stiffness:500,damping:25,restDelta:.5,restSpeed:10}},_i=function(t){return{type:"spring",stiffness:550,damping:0===t?2*Math.sqrt(550):30,restDelta:.01,restSpeed:10}},Oi=function(){return{type:"keyframes",ease:"linear",duration:.3}},Ti=function(t){return{type:"keyframes",duration:.8,values:t}},ki={x:Li,y:Li,z:Li,rotate:Li,rotateX:Li,rotateY:Li,rotateZ:Li,scaleX:_i,scaleY:_i,scale:_i,opacity:Oi,backgroundColor:Oi,color:Oi,default:_i},Di=new Set(["brightness","contrast","saturate","opacity"]);function Pi(t){var e=t.slice(0,-1).split("("),n=e[0],o=e[1];if("drop-shadow"===n)return t;var i=(o.match(ve)||[])[0];if(!i)return t;var r=o.replace(i,""),a=Di.has(n)?1:0;return i!==o&&(a*=100),n+"("+a+r+")"}var Bi=/([a-z-]*)\(.*?\)/g,Fi=Object(xt.a)(Object(xt.a)({},Ao),{getAnimatableNone:function(t){var e=t.match(Bi);return e?e.map(Pi).join(" "):t}}),Ri=Object(xt.a)(Object(xt.a)({},Pe),{color:uo,backgroundColor:uo,outlineColor:uo,fill:uo,stroke:uo,borderColor:uo,borderTopColor:uo,borderRightColor:uo,borderBottomColor:uo,borderLeftColor:uo,filter:Fi,WebkitFilter:Fi}),Ii=function(t){return Ri[t]};function Wi(t,e){var n,o=Ii(t);return o!==Fi&&(o=Ao),null===(n=o.getAnimatableNone)||void 0===n?void 0:n.call(o,e)}function Mi(t){var e=t.ease,n=t.times,o=t.yoyo,i=t.flip,r=t.loop,a=Object(xt.d)(t,["ease","times","yoyo","flip","loop"]),s=Object(xt.a)({},a);return n&&(s.offset=n),a.duration&&(s.duration=mi(a.duration)),a.repeatDelay&&(s.repeatDelay=mi(a.repeatDelay)),e&&(s.ease=function(t){return Array.isArray(t)&&"number"!=typeof t[0]}(e)?e.map(xi):xi(e)),"tween"===a.type&&(s.type="keyframes"),(o||r||i)&&(!0,o?s.repeatType="reverse":r?s.repeatType="loop":i&&(s.repeatType="mirror"),s.repeat=r||o||i||a.repeat),"spring"!==a.type&&(s.type="keyframes"),s}function ji(t,e,n){var o,i,r,a;return Array.isArray(e.to)&&(null!==(o=t.duration)&&void 0!==o||(t.duration=.8)),function(t){Array.isArray(t.to)&&null===t.to[0]&&(t.to=Object(xt.e)([],Object(xt.c)(t.to)),t.to[0]=t.from)}(e),function(t){t.when,t.delay,t.delayChildren,t.staggerChildren,t.staggerDirection,t.repeat,t.repeatType,t.repeatDelay,t.from;var e=Object(xt.d)(t,["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from"]);return!!Object.keys(e).length}(t)||(t=Object(xt.a)(Object(xt.a)({},t),(i=n,r=e.to,a=rn(r)?Ti:ki[i]||ki.default,Object(xt.a)({to:r},a(r))))),Object(xt.a)(Object(xt.a)({},e),Mi(t))}function zi(t,e,n,o,i){var r,a=Ui(o,t),s=null!==(r=a.from)&&void 0!==r?r:e.get(),l=Ei(t,n);"none"===s&&l&&"string"==typeof n?s=Wi(t,n):Ni(s)&&"string"==typeof n?s=Vi(n):!Array.isArray(n)&&Ni(n)&&"string"==typeof s&&(n=Vi(s));var c=Ei(t,s);return c&&l&&!1!==a.type?function(){var o={from:s,to:n,velocity:e.getVelocity(),onComplete:i,onUpdate:function(t){return e.set(t)}};return"inertia"===a.type||"decay"===a.type?function(t){var e,n=t.from,o=void 0===n?0:n,i=t.velocity,r=void 0===i?0:i,a=t.min,s=t.max,l=t.power,c=void 0===l?.8:l,u=t.timeConstant,d=void 0===u?750:u,h=t.bounceStiffness,f=void 0===h?500:h,p=t.bounceDamping,m=void 0===p?10:p,g=t.restDelta,v=void 0===g?1:g,A=t.modifyTarget,b=t.driver,y=t.onUpdate,C=t.onComplete;function S(t){return void 0!==a&&t<a||void 0!==s&&t>s}function w(t){return void 0===a?s:void 0===s||Math.abs(a-t)<Math.abs(s-t)?a:s}function x(t){null==e||e.stop(),e=fi(Object(xt.a)(Object(xt.a)({},t),{driver:b,onUpdate:function(e){var n;null==y||y(e),null===(n=t.onUpdate)||void 0===n||n.call(t,e)},onComplete:C}))}function E(t){x(Object(xt.a)({type:"spring",stiffness:f,damping:m,restDelta:v},t))}if(S(o))E({from:o,velocity:r,to:w(o)});else{var L=c*r+o;"undefined"!=typeof A&&(L=A(L));var _,O,T=w(L),k=T===a?-1:1;x({type:"decay",from:o,velocity:r,timeConstant:d,power:c,restDelta:v,modifyTarget:A,onUpdate:S(L)?function(t){_=O,O=t,r=pi(t-_,ci().delta),(1===k&&t>T||-1===k&&t<T)&&E({from:t,to:T,velocity:r})}:void 0})}return{stop:function(){return null==e?void 0:e.stop()}}}(Object(xt.a)(Object(xt.a)({},o),a)):fi(Object(xt.a)(Object(xt.a)({},ji(a,o,t)),{onUpdate:function(t){var e;o.onUpdate(t),null===(e=a.onUpdate)||void 0===e||e.call(a,t)},onComplete:function(){var t;o.onComplete(),null===(t=a.onComplete)||void 0===t||t.call(a)}}))}:function(){var t;return e.set(n),i(),null===(t=null==a?void 0:a.onComplete)||void 0===t||t.call(a),{stop:function(){}}}}function Ni(t){return 0===t||"string"==typeof t&&0===parseFloat(t)&&-1===t.indexOf(" ")}function Vi(t){return"number"==typeof t?0:Wi("",t)}function Ui(t,e){return t[e]||t.default||t}function Hi(t,e,n,o){return void 0===o&&(o={}),e.start((function(i){var r,a,s=zi(t,e,n,o,i),l=function(t,e){var n;return null!==(n=(Ui(t,e)||{}).delay)&&void 0!==n?n:0}(o,t),c=function(){return a=s()};return l?r=setTimeout(c,mi(l)):c(),function(){clearTimeout(r),null==a||a.stop()}}))}function Gi(t,e){-1===t.indexOf(e)&&t.push(e)}function Qi(t,e){var n=t.indexOf(e);n>-1&&t.splice(n,1)}var Yi=function(){function t(){this.subscriptions=[]}return t.prototype.add=function(t){var e=this;return Gi(this.subscriptions,t),function(){return Qi(e.subscriptions,t)}},t.prototype.notify=function(t,e,n){var o=this.subscriptions.length;if(o)if(1===o)this.subscriptions[0](t,e,n);else for(var i=0;i<o;i++){var r=this.subscriptions[i];r&&r(t,e,n)}},t.prototype.getSize=function(){return this.subscriptions.length},t.prototype.clear=function(){this.subscriptions.length=0},t}(),Zi=function(){function t(t){var e,n=this;this.timeDelta=0,this.lastUpdated=0,this.updateSubscribers=new Yi,this.velocityUpdateSubscribers=new Yi,this.renderSubscribers=new Yi,this.canTrackVelocity=!1,this.updateAndNotify=function(t,e){void 0===e&&(e=!0),n.prev=n.current,n.current=t;var o=ci(),i=o.delta,r=o.timestamp;n.lastUpdated!==r&&(n.timeDelta=i,n.lastUpdated=r,ui.postRender(n.scheduleVelocityCheck)),n.prev!==n.current&&n.updateSubscribers.notify(n.current),n.velocityUpdateSubscribers.getSize()&&n.velocityUpdateSubscribers.notify(n.getVelocity()),e&&n.renderSubscribers.notify(n.current)},this.scheduleVelocityCheck=function(){return ui.postRender(n.velocityCheck)},this.velocityCheck=function(t){t.timestamp!==n.lastUpdated&&(n.prev=n.current,n.velocityUpdateSubscribers.notify(n.getVelocity()))},this.hasAnimated=!1,this.prev=this.current=t,this.canTrackVelocity=(e=this.current,!isNaN(parseFloat(e)))}return t.prototype.onChange=function(t){return this.updateSubscribers.add(t)},t.prototype.clearListeners=function(){this.updateSubscribers.clear()},t.prototype.onRenderRequest=function(t){return t(this.get()),this.renderSubscribers.add(t)},t.prototype.attach=function(t){this.passiveEffect=t},t.prototype.set=function(t,e){void 0===e&&(e=!0),e&&this.passiveEffect?this.passiveEffect(t,this.updateAndNotify):this.updateAndNotify(t,e)},t.prototype.get=function(){return this.current},t.prototype.getPrevious=function(){return this.prev},t.prototype.getVelocity=function(){return this.canTrackVelocity?pi(parseFloat(this.current)-parseFloat(this.prev),this.timeDelta):0},t.prototype.start=function(t){var e=this;return this.stop(),new Promise((function(n){e.hasAnimated=!0,e.stopAnimation=t(n)})).then((function(){return e.clearAnimation()}))},t.prototype.stop=function(){this.stopAnimation&&this.stopAnimation(),this.clearAnimation()},t.prototype.isAnimating=function(){return!!this.stopAnimation},t.prototype.clearAnimation=function(){this.stopAnimation=null},t.prototype.destroy=function(){this.updateSubscribers.clear(),this.renderSubscribers.clear(),this.stop()},t}();function qi(t){return new Zi(t)}var Xi=function(t){return function(e){return e.test(t)}},$i=[Oe,xe,we,Se,Le,Ee,{test:function(t){return"auto"===t},parse:function(t){return t}}],Ki=function(t){return $i.find(Xi(t))},Ji=Object(xt.e)(Object(xt.e)([],Object(xt.c)($i)),[uo,Ao]),tr=function(t){return Ji.find(Xi(t))};function er(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,qi(n))}function nr(t,e){var n=Yt(t,e),o=n?t.makeTargetAnimatable(n,!1):{},i=o.transitionEnd,r=void 0===i?{}:i;o.transition;var a,s=Object(xt.d)(o,["transitionEnd","transition"]);for(var l in s=Object(xt.a)(Object(xt.a)({},s),r)){er(t,l,(a=s[l],rn(a)?a[a.length-1]||0:a))}}function or(t,e){if(e)return(e[t]||e.default||e).from}function ir(t,e,n){var o;void 0===n&&(n={});var i=Yt(t,e,n.custom),r=(i||{}).transition,a=void 0===r?t.getDefaultTransition()||{}:r;n.transitionOverride&&(a=n.transitionOverride);var s=i?function(){return rr(t,i,n)}:function(){return Promise.resolve()},l=(null===(o=t.variantChildren)||void 0===o?void 0:o.size)?function(o){void 0===o&&(o=0);var i=a.delayChildren,r=void 0===i?0:i,s=a.staggerChildren,l=a.staggerDirection;return function(t,e,n,o,i,r){void 0===n&&(n=0);void 0===o&&(o=0);void 0===i&&(i=1);var a=[],s=(t.variantChildren.size-1)*o,l=1===i?function(t){return void 0===t&&(t=0),t*o}:function(t){return void 0===t&&(t=0),s-t*o};return Array.from(t.variantChildren).sort(ar).forEach((function(t,o){a.push(ir(t,e,Object(xt.a)(Object(xt.a)({},r),{delay:n+l(o)})).then((function(){return t.notifyAnimationComplete(e)})))})),Promise.all(a)}(t,e,r+o,s,l,n)}:function(){return Promise.resolve()},c=a.when;if(c){var u=Object(xt.c)("beforeChildren"===c?[s,l]:[l,s],2),d=u[0],h=u[1];return d().then(h)}return Promise.all([s(),l(n.delay)])}function rr(t,e,n){var o,i=void 0===n?{}:n,r=i.delay,a=void 0===r?0:r,s=i.transitionOverride,l=i.type,c=t.makeTargetAnimatable(e),u=c.transition,d=void 0===u?t.getDefaultTransition():u,h=c.transitionEnd,f=Object(xt.d)(c,["transition","transitionEnd"]);s&&(d=s);var p=[],m=l&&(null===(o=t.animationState)||void 0===o?void 0:o.getState()[l]);for(var g in f){var v=t.getValue(g),A=f[g];if(!(!v||void 0===A||m&&sr(m,g))){var b=Hi(g,v,A,Object(xt.a)({delay:a},d));p.push(b)}}return Promise.all(p).then((function(){h&&nr(t,h)}))}function ar(t,e){return t.sortNodePosition(e)}function sr(t,e){var n=t.protectedKeys,o=t.needsAnimating,i=n.hasOwnProperty(e)&&!0!==o[e];return o[e]=!1,i}var lr=[dn.Animate,dn.Hover,dn.Tap,dn.Drag,dn.Focus,dn.Exit],cr=Object(xt.e)([],Object(xt.c)(lr)).reverse(),ur=lr.length;function dr(t){return function(e){return Promise.all(e.map((function(e){var n=e.animation,o=e.options;return function(t,e,n){var o;if(void 0===n&&(n={}),t.notifyAnimationStart(),Array.isArray(e)){var i=e.map((function(e){return ir(t,e,n)}));o=Promise.all(i)}else if("string"==typeof e)o=ir(t,e,n);else{var r="function"==typeof e?Yt(t,e,n.custom):e;o=rr(t,r,n)}return o.then((function(){return t.notifyAnimationComplete(e)}))}(t,n,o)})))}}function hr(t){var e,n=dr(t),o=((e={})[dn.Animate]=fr(!0),e[dn.Hover]=fr(),e[dn.Tap]=fr(),e[dn.Drag]=fr(),e[dn.Focus]=fr(),e[dn.Exit]=fr(),e),i={},r=!0,a=function(e,n){var o=Yt(t,n);if(o){o.transition;var i=o.transitionEnd,r=Object(xt.d)(o,["transition","transitionEnd"]);e=Object(xt.a)(Object(xt.a)(Object(xt.a)({},e),r),i)}return e};function s(e,s){for(var l,c=t.getProps(),u=t.getVariantContext(!0)||{},d=[],h=new Set,f={},p=1/0,m=function(n){var i=cr[n],m=o[i],g=null!==(l=c[i])&&void 0!==l?l:u[i],v=Gt(g),A=i===s?m.isActive:null;!1===A&&(p=n);var b=g===u[i]&&g!==c[i]&&v;if(b&&r&&t.manuallyAnimateOnMount&&(b=!1),m.protectedKeys=Object(xt.a)({},f),!m.isActive&&null===A||!g&&!m.prevProp||on(g)||"boolean"==typeof g)return"continue";var y=function(t,e){if("string"==typeof e)return e!==t;if(Ht(e))return!zn(e,t);return!1}(m.prevProp,g)||i===s&&m.isActive&&!b&&v||n>p&&v,C=Array.isArray(g)?g:[g],S=C.reduce(a,{});!1===A&&(S={});var w=m.prevResolvedValues,x=void 0===w?{}:w,E=Object(xt.a)(Object(xt.a)({},x),S),L=function(t){y=!0,h.delete(t),m.needsAnimating[t]=!0};for(var _ in E){var O=S[_],T=x[_];f.hasOwnProperty(_)||(O!==T?rn(O)&&rn(T)?zn(O,T)?m.protectedKeys[_]=!0:L(_):void 0!==O?L(_):h.add(_):void 0!==O&&h.has(_)?L(_):m.protectedKeys[_]=!0)}m.prevProp=g,m.prevResolvedValues=S,m.isActive&&(f=Object(xt.a)(Object(xt.a)({},f),S)),r&&t.blockInitialAnimation&&(y=!1),y&&!b&&d.push.apply(d,Object(xt.e)([],Object(xt.c)(C.map((function(t){return{animation:t,options:Object(xt.a)({type:i},e)}})))))},g=0;g<ur;g++)m(g);if(i=Object(xt.a)({},f),h.size){var v={};h.forEach((function(e){var n=t.getBaseTarget(e);void 0!==n&&(v[e]=n)})),d.push({animation:v})}var A=Boolean(d.length);return r&&!1===c.initial&&!t.manuallyAnimateOnMount&&(A=!1),r=!1,A?n(d):Promise.resolve()}return{isAnimated:function(t){return void 0!==i[t]},animateChanges:s,setActive:function(e,n,i){var r;return o[e].isActive===n?Promise.resolve():(null===(r=t.variantChildren)||void 0===r||r.forEach((function(t){var o;return null===(o=t.animationState)||void 0===o?void 0:o.setActive(e,n)})),o[e].isActive=n,s(i,e))},setAnimateFunction:function(e){n=e(t)},getState:function(){return o}}}function fr(t){return void 0===t&&(t=!1),{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}var pr={animation:Mn((function(t){var e=t.visualElement,n=t.animate;e.animationState||(e.animationState=hr(e)),on(n)&&Object(W.useEffect)((function(){return n.subscribe(e)}),[n])})),exit:Mn((function(t){var e=t.custom,n=t.visualElement,o=Object(xt.c)(Ft(),2),i=o[0],r=o[1],a=Object(W.useContext)(Pt);Object(W.useEffect)((function(){var t,o,s=null===(t=n.animationState)||void 0===t?void 0:t.setActive(dn.Exit,!i,{custom:null!==(o=null==a?void 0:a.custom)&&void 0!==o?o:e});!i&&(null==s||s.then(r))}),[i])}))},mr=function(t){return t.hasOwnProperty("x")&&t.hasOwnProperty("y")},gr=function(t){return mr(t)&&t.hasOwnProperty("z")},vr=function(t,e){return Math.abs(t-e)};function Ar(t,e){if(bo(t)&&bo(e))return vr(t,e);if(mr(t)&&mr(e)){var n=vr(t.x,e.x),o=vr(t.y,e.y),i=gr(t)&&gr(e)?vr(t.z,e.z):0;return Math.sqrt(Math.pow(n,2)+Math.pow(o,2)+Math.pow(i,2))}}var br=function(){function t(t,e,n){var o=this,i=(void 0===n?{}:n).transformPagePoint;if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.updatePoint=function(){if(o.lastMoveEvent&&o.lastMoveEventInfo){var t=Sr(o.lastMoveEventInfo,o.history),e=null!==o.startEvent,n=Ar(t.offset,{x:0,y:0})>=3;if(e||n){var i=t.point,r=ci().timestamp;o.history.push(Object(xt.a)(Object(xt.a)({},i),{timestamp:r}));var a=o.handlers,s=a.onStart,l=a.onMove;e||(s&&s(o.lastMoveEvent,t),o.startEvent=o.lastMoveEvent),l&&l(o.lastMoveEvent,t)}}},this.handlePointerMove=function(t,e){o.lastMoveEvent=t,o.lastMoveEventInfo=yr(e,o.transformPagePoint),gn(t)&&0===t.buttons?o.handlePointerUp(t,e):ui.update(o.updatePoint,!0)},this.handlePointerUp=function(t,e){o.end();var n=o.handlers,i=n.onEnd,r=n.onSessionEnd,a=Sr(yr(e,o.transformPagePoint),o.history);o.startEvent&&i&&i(t,a),r&&r(t,a)},!(vn(t)&&t.touches.length>1)){this.handlers=e,this.transformPagePoint=i;var r=yr(Cn(t),this.transformPagePoint),a=r.point,s=ci().timestamp;this.history=[Object(xt.a)(Object(xt.a)({},a),{timestamp:s})];var l=e.onSessionStart;l&&l(t,Sr(r,this.history)),this.removeListeners=Wn(Ln(window,"pointermove",this.handlePointerMove),Ln(window,"pointerup",this.handlePointerUp),Ln(window,"pointercancel",this.handlePointerUp))}}return t.prototype.updateHandlers=function(t){this.handlers=t},t.prototype.end=function(){this.removeListeners&&this.removeListeners(),ii.update(this.updatePoint)},t}();function yr(t,e){return e?{point:e(t.point)}:t}function Cr(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Sr(t,e){var n=t.point;return{point:n,delta:Cr(n,xr(e)),offset:Cr(n,wr(e)),velocity:Er(e,.1)}}function wr(t){return t[0]}function xr(t){return t[t.length-1]}function Er(t,e){if(t.length<2)return{x:0,y:0};for(var n=t.length-1,o=null,i=xr(t);n>=0&&(o=t[n],!(i.timestamp-o.timestamp>mi(e)));)n--;if(!o)return{x:0,y:0};var r=(i.timestamp-o.timestamp)/1e3;if(0===r)return{x:0,y:0};var a={x:(i.x-o.x)/r,y:(i.y-o.y)/r};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}function Lr(t){return t}function _r(t){var e=t.top;return{x:{min:t.left,max:t.right},y:{min:e,max:t.bottom}}}var Or={translate:0,scale:1,origin:0,originPoint:0};function Tr(){return{x:Object(xt.a)({},Or),y:Object(xt.a)({},Or)}}function kr(t){return[t("x"),t("y")]}function Dr(t,e,n){var o=e.min,i=e.max;return void 0!==o&&t<o?t=n?$n(o,t,n.min):Math.max(t,o):void 0!==i&&t>i&&(t=n?$n(i,t,n.max):Math.min(t,i)),t}function Pr(t,e,n){return{min:void 0!==e?t.min+e:void 0,max:void 0!==n?t.max+n-(t.max-t.min):void 0}}function Br(t,e){var n,o=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&(o=(n=Object(xt.c)([i,o],2))[0],i=n[1]),{min:t.min+o,max:t.min+i}}function Fr(t,e,n){return{min:Rr(t,e),max:Rr(t,n)}}function Rr(t,e){var n;return"number"==typeof t?t:null!==(n=t[e])&&void 0!==n?n:0}function Ir(t,e){return _r(function(t,e){var n=t.top,o=t.left,i=t.bottom,r=t.right;void 0===e&&(e=Lr);var a=e({x:o,y:n}),s=e({x:r,y:i});return{top:a.y,left:a.x,bottom:s.y,right:s.x}}(t.getBoundingClientRect(),e))}function Wr(t,e,n){return void 0===e&&(e=0),void 0===n&&(n=.01),Ar(t,e)<n}function Mr(t){return t.max-t.min}function jr(t,e){var n=.5,o=Mr(t),i=Mr(e);return i>o?n=Xn(e.min,e.max-o,t.min):o>i&&(n=Xn(t.min,t.max-i,e.min)),Nn(0,1,n)}function zr(t,e,n,o){void 0===o&&(o=.5),t.origin=o,t.originPoint=$n(e.min,e.max,t.origin),t.scale=Mr(n)/Mr(e),Wr(t.scale,1,1e-4)&&(t.scale=1),t.translate=$n(n.min,n.max,t.origin)-t.originPoint,Wr(t.translate)&&(t.translate=0)}function Nr(t,e,n,o){zr(t.x,e.x,n.x,Vr(o.originX)),zr(t.y,e.y,n.y,Vr(o.originY))}function Vr(t){return"number"==typeof t?t:.5}function Ur(t,e,n){t.min=n.min+e.min,t.max=t.min+Mr(e)}var Hr=function(t,e){return t.depth-e.depth};function Gr(t){return t.projection.isEnabled||t.shouldResetTransform()}function Qr(t,e){void 0===e&&(e=[]);var n=t.parent;return n&&Qr(n,e),Gr(t)&&e.push(t),e}function Yr(t){if(!t.shouldResetTransform()){var e,n=t.getLayoutState();t.notifyBeforeLayoutMeasure(n.layout),n.isHydrated=!0,n.layout=t.measureViewportBox(),n.layoutCorrected=(e=n.layout,{x:Object(xt.a)({},e.x),y:Object(xt.a)({},e.y)}),t.notifyLayoutMeasure(n.layout,t.prevViewportBox||n.layout),ui.update((function(){return t.rebaseProjectionTarget()}))}}function Zr(t,e){return{min:e.min-t.min,max:e.max-t.min}}function qr(t,e){return{x:Zr(t.x,e.x),y:Zr(t.y,e.y)}}function Xr(t,e){var n=t.getLayoutId(),o=e.getLayoutId();return n!==o||void 0===o&&t!==e}function $r(t){var e=t.getProps(),n=e.drag,o=e._dragX;return n&&!o}function Kr(t,e){t.min=e.min,t.max=e.max}function Jr(t,e,n){return n+e*(t-n)}function ta(t,e,n,o,i){return void 0!==i&&(t=Jr(t,i,o)),Jr(t,n,o)+e}function ea(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),t.min=ta(t.min,e,n,o,i),t.max=ta(t.max,e,n,o,i)}function na(t,e){var n=e.x,o=e.y;ea(t.x,n.translate,n.scale,n.originPoint),ea(t.y,o.translate,o.scale,o.originPoint)}function oa(t,e,n,o){var i=Object(xt.c)(o,3),r=i[0],a=i[1],s=i[2];t.min=e.min,t.max=e.max;var l=void 0!==n[s]?n[s]:.5,c=$n(e.min,e.max,l);ea(t,n[r],n[a],c,n.scale)}var ia=["x","scaleX","originX"],ra=["y","scaleY","originY"];function aa(t,e,n){oa(t.x,e.x,n,ia),oa(t.y,e.y,n,ra)}function sa(t,e,n,o,i){return t=Jr(t-=e,1/n,o),void 0!==i&&(t=Jr(t,1/i,o)),t}function la(t,e,n){var o=Object(xt.c)(n,3),i=o[0],r=o[1],a=o[2];!function(t,e,n,o,i){void 0===e&&(e=0),void 0===n&&(n=1),void 0===o&&(o=.5);var r=$n(t.min,t.max,o)-e;t.min=sa(t.min,e,n,r,i),t.max=sa(t.max,e,n,r,i)}(t,e[i],e[r],e[a],e.scale)}function ca(t,e){la(t.x,e,ia),la(t.y,e,ra)}var ua=new Set;function da(t,e,n){t[n]||(t[n]=[]),t[n].push(e)}function ha(t){return ua.add(t),function(){return ua.delete(t)}}function fa(){if(ua.size){var t=0,e=[[]],n=[],o=function(n){return da(e,n,t)},i=function(e){da(n,e,t),t++};ua.forEach((function(e){e(o,i),t=0})),ua.clear();for(var r=n.length,a=0;a<=r;a++)e[a]&&e[a].forEach(ma),n[a]&&n[a].forEach(ma)}}var pa,ma=function(t){return t()},ga=new WeakMap,va=function(){function t(t){var e=t.visualElement;this.isDragging=!1,this.currentDirection=null,this.constraints=!1,this.elastic={x:{min:0,max:1},y:{min:0,max:1}},this.props={},this.hasMutatedConstraints=!1,this.cursorProgress={x:.5,y:.5},this.originPoint={},this.openGlobalLock=null,this.panSession=null,this.visualElement=e,this.visualElement.enableLayoutProjection(),ga.set(e,this)}return t.prototype.start=function(t,e){var n=this,o=void 0===e?{}:e,i=o.snapToCursor,r=void 0!==i&&i,a=o.cursorProgress,s=this.props.transformPagePoint;this.panSession=new br(t,{onSessionStart:function(t){var e;n.stopMotion();var o=function(t){return Cn(t,"client")}(t).point;null===(e=n.cancelLayout)||void 0===e||e.call(n),n.cancelLayout=ha((function(t,e){var i=Qr(n.visualElement),s=function(t){var e=[],n=function(t){Gr(t)&&e.push(t),t.children.forEach(n)};return t.children.forEach(n),e.sort(Hr)}(n.visualElement),l=Object(xt.e)(Object(xt.e)([],Object(xt.c)(i)),Object(xt.c)(s)),c=!1;n.isLayoutDrag()&&n.visualElement.lockProjectionTarget(),e((function(){l.forEach((function(t){return t.resetTransform()}))})),t((function(){Yr(n.visualElement),s.forEach(Yr)})),e((function(){l.forEach((function(t){return t.restoreTransform()})),r&&(c=n.snapToCursor(o))})),t((function(){Boolean(n.getAxisMotionValue("x")&&!n.isExternalDrag())||n.visualElement.rebaseProjectionTarget(!0,n.visualElement.measureViewportBox(!1)),n.visualElement.scheduleUpdateLayoutProjection();var t=n.visualElement.projection;kr((function(e){if(!c){var i=t.target[e],r=i.min,s=i.max;n.cursorProgress[e]=a?a[e]:Xn(r,s,o[e])}var l=n.getAxisMotionValue(e);l&&(n.originPoint[e]=l.get())}))})),e((function(){ri.update(),ri.preRender(),ri.render(),ri.postRender()})),t((function(){return n.resolveDragConstraints()}))}))},onStart:function(t,e){var o,i,r,a=n.props,s=a.drag,l=a.dragPropagation;(!s||l||(n.openGlobalLock&&n.openGlobalLock(),n.openGlobalLock=Dn(s),n.openGlobalLock))&&(fa(),n.isDragging=!0,n.currentDirection=null,null===(i=(o=n.props).onDragStart)||void 0===i||i.call(o,t,e),null===(r=n.visualElement.animationState)||void 0===r||r.setActive(dn.Drag,!0))},onMove:function(t,e){var o,i,r,a,s=n.props,l=s.dragPropagation,c=s.dragDirectionLock;if(l||n.openGlobalLock){var u=e.offset;if(c&&null===n.currentDirection)return n.currentDirection=function(t,e){void 0===e&&(e=10);var n=null;Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x");return n}(u),void(null!==n.currentDirection&&(null===(i=(o=n.props).onDirectionLock)||void 0===i||i.call(o,n.currentDirection)));n.updateAxis("x",e.point,u),n.updateAxis("y",e.point,u),null===(a=(r=n.props).onDrag)||void 0===a||a.call(r,t,e),pa=t}},onSessionEnd:function(t,e){return n.stop(t,e)}},{transformPagePoint:s})},t.prototype.resolveDragConstraints=function(){var t=this,e=this.props,n=e.dragConstraints,o=e.dragElastic,i=this.visualElement.getLayoutState().layoutCorrected;this.constraints=!!n&&(Ut(n)?this.resolveRefConstraints(i,n):function(t,e){var n=e.top,o=e.left,i=e.bottom,r=e.right;return{x:Pr(t.x,o,r),y:Pr(t.y,n,i)}}(i,n)),this.elastic=function(t){return!1===t?t=0:!0===t&&(t=.35),{x:Fr(t,"left","right"),y:Fr(t,"top","bottom")}}(o),this.constraints&&!this.hasMutatedConstraints&&kr((function(e){t.getAxisMotionValue(e)&&(t.constraints[e]=function(t,e){var n={};return void 0!==e.min&&(n.min=e.min-t.min),void 0!==e.max&&(n.max=e.max-t.min),n}(i[e],t.constraints[e]))}))},t.prototype.resolveRefConstraints=function(t,e){var n=this.props,o=n.onMeasureDragConstraints,i=n.transformPagePoint,r=e.current;this.constraintsBox=Ir(r,i);var a=function(t,e){return{x:Br(t.x,e.x),y:Br(t.y,e.y)}}(t,this.constraintsBox);if(o){var s=o(function(t){var e=t.x,n=t.y;return{top:n.min,bottom:n.max,left:e.min,right:e.max}}(a));this.hasMutatedConstraints=!!s,s&&(a=_r(s))}return a},t.prototype.cancelDrag=function(){var t,e;this.visualElement.unlockProjectionTarget(),null===(t=this.cancelLayout)||void 0===t||t.call(this),this.isDragging=!1,this.panSession&&this.panSession.end(),this.panSession=null,!this.props.dragPropagation&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),null===(e=this.visualElement.animationState)||void 0===e||e.setActive(dn.Drag,!1)},t.prototype.stop=function(t,e){var n,o,i;null===(n=this.panSession)||void 0===n||n.end(),this.panSession=null;var r=this.isDragging;if(this.cancelDrag(),r){var a=e.velocity;this.animateDragEnd(a),null===(i=(o=this.props).onDragEnd)||void 0===i||i.call(o,t,e)}},t.prototype.snapToCursor=function(t){var e=this;return kr((function(n){if(Aa(n,e.props.drag,e.currentDirection)){var o=e.getAxisMotionValue(n);if(!o)return e.cursorProgress[n]=.5,!0;var i=e.visualElement.getLayoutState().layout,r=i[n].max-i[n].min,a=i[n].min+r/2,s=t[n]-a;e.originPoint[n]=t[n],o.set(s)}})).includes(!0)},t.prototype.updateAxis=function(t,e,n){if(Aa(t,this.props.drag,this.currentDirection))return this.getAxisMotionValue(t)?this.updateAxisMotionValue(t,n):this.updateVisualElementAxis(t,e)},t.prototype.updateAxisMotionValue=function(t,e){var n=this.getAxisMotionValue(t);if(e&&n){var o=this.originPoint[t]+e[t],i=this.constraints?Dr(o,this.constraints[t],this.elastic[t]):o;n.set(i)}},t.prototype.updateVisualElementAxis=function(t,e){var n,o=this.visualElement.getLayoutState().layout[t],i=o.max-o.min,r=this.cursorProgress[t],a=function(t,e,n,o,i){var r=t-e*n;return o?Dr(r,o,i):r}(e[t],i,r,null===(n=this.constraints)||void 0===n?void 0:n[t],this.elastic[t]);this.visualElement.setProjectionTargetAxis(t,a,a+i)},t.prototype.setProps=function(t){var e=t.drag,n=void 0!==e&&e,o=t.dragDirectionLock,i=void 0!==o&&o,r=t.dragPropagation,a=void 0!==r&&r,s=t.dragConstraints,l=void 0!==s&&s,c=t.dragElastic,u=void 0===c?.35:c,d=t.dragMomentum,h=void 0===d||d,f=Object(xt.d)(t,["drag","dragDirectionLock","dragPropagation","dragConstraints","dragElastic","dragMomentum"]);this.props=Object(xt.a)({drag:n,dragDirectionLock:i,dragPropagation:a,dragConstraints:l,dragElastic:u,dragMomentum:h},f)},t.prototype.getAxisMotionValue=function(t){var e=this.props,n=e.layout,o=e.layoutId,i="_drag"+t.toUpperCase();return this.props[i]?this.props[i]:n||void 0!==o?void 0:this.visualElement.getValue(t,0)},t.prototype.isLayoutDrag=function(){return!this.getAxisMotionValue("x")},t.prototype.isExternalDrag=function(){var t=this.props,e=t._dragX,n=t._dragY;return e||n},t.prototype.animateDragEnd=function(t){var e=this,n=this.props,o=n.drag,i=n.dragMomentum,r=n.dragElastic,a=n.dragTransition,s=function(t,e){void 0===e&&(e=!0);var n,o=t.getProjectionParent();return!!o&&(e?ca(n=qr(o.projection.target,t.projection.target),o.getLatestValues()):n=qr(o.getLayoutState().layout,t.getLayoutState().layout),kr((function(e){return t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)})),!0)}(this.visualElement,this.isLayoutDrag()&&!this.isExternalDrag()),l=this.constraints||{};if(s&&Object.keys(l).length&&this.isLayoutDrag()){var c=this.visualElement.getProjectionParent();if(c){var u=qr(c.projection.targetFinal,l);kr((function(t){var e=u[t],n=e.min,o=e.max;l[t]={min:isNaN(n)?void 0:n,max:isNaN(o)?void 0:o}}))}}var d=kr((function(n){var c;if(Aa(n,o,e.currentDirection)){var u=null!==(c=null==l?void 0:l[n])&&void 0!==c?c:{},d=r?200:1e6,h=r?40:1e7,f=Object(xt.a)(Object(xt.a)({type:"inertia",velocity:i?t[n]:0,bounceStiffness:d,bounceDamping:h,timeConstant:750,restDelta:1,restSpeed:10},a),u);return e.getAxisMotionValue(n)?e.startAxisValueAnimation(n,f):e.visualElement.startLayoutAnimation(n,f,s)}}));return Promise.all(d).then((function(){var t,n;null===(n=(t=e.props).onDragTransitionEnd)||void 0===n||n.call(t)}))},t.prototype.stopMotion=function(){var t=this;kr((function(e){var n=t.getAxisMotionValue(e);n?n.stop():t.visualElement.stopLayoutAnimation()}))},t.prototype.startAxisValueAnimation=function(t,e){var n=this.getAxisMotionValue(t);if(n){var o=n.get();return n.set(o),n.set(o),Hi(t,n,0,e)}},t.prototype.scalePoint=function(){var t=this,e=this.props,n=e.drag;if(Ut(e.dragConstraints)&&this.constraintsBox){this.stopMotion();var o={x:0,y:0};kr((function(e){o[e]=jr(t.visualElement.projection.target[e],t.constraintsBox[e])})),this.updateConstraints((function(){kr((function(e){if(Aa(e,n,null)){var i=function(t,e,n){var o=t.max-t.min,i=$n(e.min,e.max-o,n);return{min:i,max:i+o}}(t.visualElement.projection.target[e],t.constraintsBox[e],o[e]),r=i.min,a=i.max;t.visualElement.setProjectionTargetAxis(e,r,a)}}))})),setTimeout(fa,1)}},t.prototype.updateConstraints=function(t){var e=this;this.cancelLayout=ha((function(n,o){var i=Qr(e.visualElement);o((function(){return i.forEach((function(t){return t.resetTransform()}))})),n((function(){return Yr(e.visualElement)})),o((function(){return i.forEach((function(t){return t.restoreTransform()}))})),n((function(){e.resolveDragConstraints()})),t&&o(t)}))},t.prototype.mount=function(t){var e=this,n=Ln(t.getInstance(),"pointerdown",(function(t){var n=e.props,o=n.drag,i=n.dragListener;o&&(void 0===i||i)&&e.start(t)})),o=pn(window,"resize",(function(){e.scalePoint()})),i=t.onLayoutUpdate((function(){e.isDragging&&e.resolveDragConstraints()})),r=t.prevDragCursor;return r&&this.start(pa,{cursorProgress:r}),function(){null==n||n(),null==o||o(),null==i||i(),e.cancelDrag()}},t}();function Aa(t,e,n){return!(!0!==e&&e!==t||null!==n&&n!==t)}var ba,ya,Ca={pan:Mn((function(t){var e=t.onPan,n=t.onPanStart,o=t.onPanEnd,i=t.onPanSessionStart,r=t.visualElement,a=e||n||o||i,s=Object(W.useRef)(null),l=Object(W.useContext)(kt).transformPagePoint,c={onSessionStart:i,onStart:n,onMove:e,onEnd:function(t,e){s.current=null,o&&o(t,e)}};Object(W.useEffect)((function(){null!==s.current&&s.current.updateHandlers(c)})),_n(r,"pointerdown",a&&function(t){s.current=new br(t,c,{transformPagePoint:l})}),Rn((function(){return s.current&&s.current.end()}))})),drag:Mn((function(t){var e=t.dragControls,n=t.visualElement,o=Object(W.useContext)(kt).transformPagePoint,i=Bt((function(){return new va({visualElement:n})}));i.setProps(Object(xt.a)(Object(xt.a)({},t),{transformPagePoint:o})),Object(W.useEffect)((function(){return e&&e.subscribe(i)}),[i]),Object(W.useEffect)((function(){return i.mount(n)}),[])}))};function Sa(t){return"string"==typeof t&&t.startsWith("var(--")}!function(t){t[t.Entering=0]="Entering",t[t.Present=1]="Present",t[t.Exiting=2]="Exiting"}(ba||(ba={})),function(t){t[t.Hide=0]="Hide",t[t.Show=1]="Show"}(ya||(ya={}));var wa=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/;function xa(t,e,n){void 0===n&&(n=1);var o=Object(xt.c)(function(t){var e=wa.exec(t);if(!e)return[,];var n=Object(xt.c)(e,3);return[n[1],n[2]]}(t),2),i=o[0],r=o[1];if(i){var a=window.getComputedStyle(e).getPropertyValue(i);return a?a.trim():Sa(r)?xa(r,e,n+1):r}}function Ea(t,e){return t/(e.max-e.min)*100}var La="_$css";var _a={process:function(t,e,n){var o=n.target;if("string"==typeof t){if(!xe.test(t))return t;t=parseFloat(t)}return Ea(t,o.x)+"% "+Ea(t,o.y)+"%"}},Oa={borderRadius:Object(xt.a)(Object(xt.a)({},_a),{applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]}),borderTopLeftRadius:_a,borderTopRightRadius:_a,borderBottomLeftRadius:_a,borderBottomRightRadius:_a,boxShadow:{process:function(t,e){var n=e.delta,o=e.treeScale,i=t,r=t.includes("var("),a=[];r&&(t=t.replace(wa,(function(t){return a.push(t),La})));var s=Ao.parse(t);if(s.length>5)return i;var l=Ao.createTransformer(t),c="number"!=typeof s[0]?1:0,u=n.x.scale*o.x,d=n.y.scale*o.y;s[0+c]/=u,s[1+c]/=d;var h=$n(u,d,.5);"number"==typeof s[2+c]&&(s[2+c]/=h),"number"==typeof s[3+c]&&(s[3+c]/=h);var f=l(s);if(r){var p=0;f=f.replace(La,(function(){var t=a[p];return p++,t}))}return f}}},Ta=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.frameTarget={x:{min:0,max:1},y:{min:0,max:1}},e.currentAnimationTarget={x:{min:0,max:1},y:{min:0,max:1}},e.isAnimating={x:!1,y:!1},e.stopAxisAnimation={x:void 0,y:void 0},e.isAnimatingTree=!1,e.animate=function(t,n,o){void 0===o&&(o={});var i=o.originBox,r=o.targetBox,a=o.visibilityAction,s=o.shouldStackAnimate,l=o.onComplete,c=o.prevParent,u=Object(xt.d)(o,["originBox","targetBox","visibilityAction","shouldStackAnimate","onComplete","prevParent"]),d=e.props,h=d.visualElement,f=d.layout;if(!1===s)return e.isAnimatingTree=!1,e.safeToRemove();if(!e.isAnimatingTree||!0===s){s&&(e.isAnimatingTree=!0),n=i||n,t=r||t;var p=!1,m=h.getProjectionParent();if(m){var g=m.prevViewportBox,v=m.getLayoutState().layout;c&&(r&&(v=c.getLayoutState().layout),i&&!Xr(c,m)&&c.prevViewportBox&&(g=c.prevViewportBox)),g&&Ra(c,i,r)&&(p=!0,n=qr(g,n),t=qr(v,t))}var A=ka(n,t),b=kr((function(o){var i,r;if("position"===f){var s=t[o].max-t[o].min;n[o].max=n[o].min+s}if(!h.projection.isTargetLocked)return void 0===a?A?e.animateAxis(o,t[o],n[o],Object(xt.a)(Object(xt.a)({},u),{isRelative:p})):(null===(r=(i=e.stopAxisAnimation)[o])||void 0===r||r.call(i),h.setProjectionTargetAxis(o,t[o].min,t[o].max,p)):void h.setVisibility(a===ya.Show)}));return h.syncRender(),Promise.all(b).then((function(){e.isAnimatingTree=!1,l&&l(),h.notifyLayoutAnimationComplete()}))}},e}return Object(xt.b)(e,t),e.prototype.componentDidMount=function(){var t=this,e=this.props.visualElement;e.animateMotionValue=Hi,e.enableLayoutProjection(),this.unsubLayoutReady=e.onLayoutUpdate(this.animate),e.layoutSafeToRemove=function(){return t.safeToRemove()},function(t){for(var e in t)ne[e]=t[e]}(Oa)},e.prototype.componentWillUnmount=function(){var t=this;this.unsubLayoutReady(),kr((function(e){var n,o;return null===(o=(n=t.stopAxisAnimation)[e])||void 0===o?void 0:o.call(n)}))},e.prototype.animateAxis=function(t,e,n,o){var i,r,a=this,s=void 0===o?{}:o,l=s.transition,c=s.isRelative;if(!this.isAnimating[t]||!Ba(e,this.currentAnimationTarget[t])){null===(r=(i=this.stopAxisAnimation)[t])||void 0===r||r.call(i),this.isAnimating[t]=!0;var u=this.props.visualElement,d=this.frameTarget[t],h=u.getProjectionAnimationProgress()[t];h.clearListeners(),h.set(0),h.set(0);var f=function(){var o=h.get()/1e3;!function(t,e,n,o){t.min=$n(e.min,n.min,o),t.max=$n(e.max,n.max,o)}(d,n,e,o),u.setProjectionTargetAxis(t,d.min,d.max,c)};f();var p=h.onChange(f);this.stopAxisAnimation[t]=function(){a.isAnimating[t]=!1,h.stop(),p()},this.currentAnimationTarget[t]=e;var m=l||u.getDefaultTransition()||Fa;return Hi("x"===t?"layoutX":"layoutY",h,1e3,m&&Ui(m,"layout")).then(this.stopAxisAnimation[t])}},e.prototype.safeToRemove=function(){var t,e;null===(e=(t=this.props).safeToRemove)||void 0===e||e.call(t)},e.prototype.render=function(){return null},e}(W.Component);function ka(t,e){return!(Pa(t)||Pa(e)||Ba(t.x,e.x)&&Ba(t.y,e.y))}var Da={min:0,max:0};function Pa(t){return Ba(t.x,Da)&&Ba(t.y,Da)}function Ba(t,e){return t.min===e.min&&t.max===e.max}var Fa={duration:.45,ease:[.4,0,.1,1]};function Ra(t,e,n){return t||!t&&!(e||n)}var Ia={layoutReady:function(t){return t.notifyLayoutReady()}};function Wa(){var t=new Set;return{add:function(e){return t.add(e)},flush:function(e){var n=void 0===e?Ia:e,o=n.layoutReady,i=n.parent;ha((function(e,n){var r=Array.from(t).sort(Hr),a=i?Qr(i):[];n((function(){Object(xt.e)(Object(xt.e)([],Object(xt.c)(a)),Object(xt.c)(r)).forEach((function(t){return t.resetTransform()}))})),e((function(){r.forEach(Yr)})),n((function(){a.forEach((function(t){return t.restoreTransform()})),r.forEach(o)})),e((function(){r.forEach((function(t){t.isPresent&&(t.presence=ba.Present)}))})),n((function(){ri.preRender(),ri.render()})),e((function(){ui.postRender((function(){return r.forEach(Ma)})),t.clear()}))})),fa()}}}function Ma(t){t.prevViewportBox=t.projection.target}var ja=Object(W.createContext)(Wa()),za=Object(W.createContext)(Wa());function Na(t){return!!t.forceUpdate}var Va=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(xt.b)(e,t),e.prototype.componentDidMount=function(){var t=this.props,e=t.syncLayout,n=t.framerSyncLayout,o=t.visualElement;Na(e)&&e.register(o),Na(n)&&n.register(o),o.onUnmount((function(){Na(e)&&e.remove(o),Na(n)&&n.remove(o)}))},e.prototype.getSnapshotBeforeUpdate=function(){var t=this.props,e=t.syncLayout,n=t.visualElement;return Na(e)?e.syncUpdate():(!function(t){t.shouldResetTransform()||(t.prevViewportBox=t.measureViewportBox(!1),t.rebaseProjectionTarget(!1,t.prevViewportBox))}(n),e.add(n)),null},e.prototype.componentDidUpdate=function(){var t=this.props.syncLayout;Na(t)||t.flush()},e.prototype.render=function(){return null},e}(W.default.Component);var Ua={measureLayout:function(t){var e=Object(W.useContext)(ja),n=Object(W.useContext)(za);return W.default.createElement(Va,Object(xt.a)({},t,{syncLayout:e,framerSyncLayout:n}))},layoutAnimation:function(t){var e=Object(xt.c)(Ft(),2)[1];return W.createElement(Ta,Object(xt.a)({},t,{safeToRemove:e}))}};function Ha(){return{isHydrated:!1,layout:{x:{min:0,max:1},y:{min:0,max:1}},layoutCorrected:{x:{min:0,max:1},y:{min:0,max:1}},treeScale:{x:1,y:1},delta:Tr(),deltaFinal:Tr(),deltaTransform:""}}var Ga=Ha();function Qa(t,e,n){var o=t.x,i=t.y,r="translate3d("+o.translate/e.x+"px, "+i.translate/e.y+"px, 0) ";if(n){var a=n.rotate,s=n.rotateX,l=n.rotateY;a&&(r+="rotate("+a+") "),s&&(r+="rotateX("+s+") "),l&&(r+="rotateY("+l+") ")}return r+="scale("+o.scale+", "+i.scale+")",n||r!==Za?r:""}function Ya(t){var e=t.deltaFinal;return 100*e.x.origin+"% "+100*e.y.origin+"% 0"}var Za=Qa(Ga.delta,Ga.treeScale,{x:1,y:1}),qa=["LayoutMeasure","BeforeLayoutMeasure","LayoutUpdate","ViewportBoxUpdate","Update","Render","AnimationComplete","LayoutAnimationComplete","AnimationStart","SetAxisTarget","Unmount"];function Xa(t,e,n,o){var i,r,a=t.delta,s=t.layout,l=t.layoutCorrected,c=t.treeScale,u=e.target;r=s,Kr((i=l).x,r.x),Kr(i.y,r.y),function(t,e,n){var o=n.length;if(o){var i,r;e.x=e.y=1;for(var a=0;a<o;a++)r=(i=n[a]).getLayoutState().delta,e.x*=r.x.scale,e.y*=r.y.scale,na(t,r),$r(i)&&aa(t,t,i.getLatestValues())}}(l,c,n),Nr(a,l,u,o)}var $a=function(){function t(){this.children=[],this.isDirty=!1}return t.prototype.add=function(t){Gi(this.children,t),this.isDirty=!0},t.prototype.remove=function(t){Qi(this.children,t),this.isDirty=!0},t.prototype.forEach=function(t){this.isDirty&&this.children.sort(Hr),this.isDirty=!1,this.children.forEach(t)},t}();var Ka=function(t){var e=t.treeType,n=void 0===e?"":e,o=t.build,i=t.getBaseTarget,r=t.makeTargetAnimatable,a=t.measureViewportBox,s=t.render,l=t.readValueFromInstance,c=t.resetTransform,u=t.restoreTransform,d=t.removeValueFromRenderState,h=t.sortNodePosition,f=t.scrapeMotionValuesFromProps;return function(t,e){var p=t.parent,m=t.props,g=t.presenceId,v=t.blockInitialAnimation,A=t.visualState;void 0===e&&(e={});var b,y,C,S,w,x,E=A.latestValues,L=A.renderState,_=function(){var t=qa.map((function(){return new Yi})),e={},n={clearAllListeners:function(){return t.forEach((function(t){return t.clear()}))},updatePropListeners:function(t){return qa.forEach((function(o){var i;null===(i=e[o])||void 0===i||i.call(e);var r="on"+o,a=t[r];a&&(e[o]=n[r](a))}))}};return t.forEach((function(t,e){n["on"+qa[e]]=function(e){return t.add(e)},n["notify"+qa[e]]=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.notify.apply(t,Object(xt.e)([],Object(xt.c)(e)))}})),n}(),O={isEnabled:!1,isHydrated:!1,isTargetLocked:!1,target:{x:{min:0,max:1},y:{min:0,max:1}},targetFinal:{x:{min:0,max:1},y:{min:0,max:1}}},T=O,k=E,D=Ha(),P=!1,B=new Map,F=new Map,R={},I=Object(xt.a)({},E);function W(){b&&(Q.isProjectionReady()&&(aa(T.targetFinal,T.target,k),Nr(D.deltaFinal,D.layoutCorrected,T.targetFinal,E)),M(),s(b,L))}function M(){var t=E;if(S&&S.isActive()){var n=S.getCrossfadeState(Q);n&&(t=n)}o(Q,L,t,T,D,e,m)}function j(){_.notifyUpdate(E)}function z(){Q.layoutTree.forEach(ts)}var N=f(m);for(var V in N){var U=N[V];void 0!==E[V]&&de(U)&&U.set(E[V],!1)}var H=Zt(m),G=qt(m),Q=Object(xt.a)(Object(xt.a)({treeType:n,current:null,depth:p?p.depth+1:0,parent:p,children:new Set,path:p?Object(xt.e)(Object(xt.e)([],Object(xt.c)(p.path)),[p]):[],layoutTree:p?p.layoutTree:new $a,presenceId:g,projection:O,variantChildren:G?new Set:void 0,isVisible:void 0,manuallyAnimateOnMount:Boolean(null==p?void 0:p.isMounted()),blockInitialAnimation:v,isMounted:function(){return Boolean(b)},mount:function(t){b=Q.current=t,Q.pointTo(Q),G&&p&&!H&&(x=null==p?void 0:p.addVariantChild(Q)),null==p||p.children.add(Q)},unmount:function(){ii.update(j),ii.render(W),ii.preRender(Q.updateLayoutProjection),F.forEach((function(t){return t()})),Q.stopLayoutAnimation(),Q.layoutTree.remove(Q),null==x||x(),null==p||p.children.delete(Q),null==C||C(),_.clearAllListeners()},addVariantChild:function(t){var e,n=Q.getClosestVariantNode();if(n)return null===(e=n.variantChildren)||void 0===e||e.add(t),function(){return n.variantChildren.delete(t)}},sortNodePosition:function(t){return h&&n===t.treeType?h(Q.getInstance(),t.getInstance()):0},getClosestVariantNode:function(){return G?Q:null==p?void 0:p.getClosestVariantNode()},scheduleUpdateLayoutProjection:p?p.scheduleUpdateLayoutProjection:function(){return ui.preRender(Q.updateTreeLayoutProjection,!1,!0)},getLayoutId:function(){return m.layoutId},getInstance:function(){return b},getStaticValue:function(t){return E[t]},setStaticValue:function(t,e){return E[t]=e},getLatestValues:function(){return E},setVisibility:function(t){Q.isVisible!==t&&(Q.isVisible=t,Q.scheduleRender())},makeTargetAnimatable:function(t,e){return void 0===e&&(e=!0),r(Q,t,m,e)},addValue:function(t,e){Q.hasValue(t)&&Q.removeValue(t),B.set(t,e),E[t]=e.get(),function(t,e){var n=e.onChange((function(e){E[t]=e,m.onUpdate&&ui.update(j,!1,!0)})),o=e.onRenderRequest(Q.scheduleRender);F.set(t,(function(){n(),o()}))}(t,e)},removeValue:function(t){var e;B.delete(t),null===(e=F.get(t))||void 0===e||e(),F.delete(t),delete E[t],d(t,L)},hasValue:function(t){return B.has(t)},getValue:function(t,e){var n=B.get(t);return void 0===n&&void 0!==e&&(n=qi(e),Q.addValue(t,n)),n},forEachValue:function(t){return B.forEach(t)},readValue:function(t){var n;return null!==(n=E[t])&&void 0!==n?n:l(b,t,e)},setBaseTarget:function(t,e){I[t]=e},getBaseTarget:function(t){if(i){var e=i(m,t);if(void 0!==e&&!de(e))return e}return I[t]}},_),{build:function(){return M(),L},scheduleRender:function(){ui.render(W,!1,!0)},syncRender:W,setProps:function(t){m=t,_.updatePropListeners(t),R=function(t,e,n){var o;for(var i in e){var r=e[i],a=n[i];if(de(r))t.addValue(i,r);else if(de(a))t.addValue(i,qi(r));else if(a!==r)if(t.hasValue(i)){var s=t.getValue(i);!s.hasAnimated&&s.set(r)}else t.addValue(i,qi(null!==(o=t.getStaticValue(i))&&void 0!==o?o:r))}for(var i in n)void 0===e[i]&&t.removeValue(i);return e}(Q,f(m),R)},getProps:function(){return m},getVariant:function(t){var e;return null===(e=m.variants)||void 0===e?void 0:e[t]},getDefaultTransition:function(){return m.transition},getVariantContext:function(t){if(void 0===t&&(t=!1),t)return null==p?void 0:p.getVariantContext();if(!H){var e=(null==p?void 0:p.getVariantContext())||{};return void 0!==m.initial&&(e.initial=m.initial),e}for(var n={},o=0;o<os;o++){var i=ns[o],r=m[i];(Gt(r)||!1===r)&&(n[i]=r)}return n},enableLayoutProjection:function(){O.isEnabled=!0,Q.layoutTree.add(Q)},lockProjectionTarget:function(){O.isTargetLocked=!0},unlockProjectionTarget:function(){Q.stopLayoutAnimation(),O.isTargetLocked=!1},getLayoutState:function(){return D},setCrossfader:function(t){S=t},isProjectionReady:function(){return O.isEnabled&&O.isHydrated&&D.isHydrated},startLayoutAnimation:function(t,e,n){void 0===n&&(n=!1);var o=Q.getProjectionAnimationProgress()[t],i=n?O.relativeTarget[t]:O.target[t],r=i.min,a=i.max-r;return o.clearListeners(),o.set(r),o.set(r),o.onChange((function(e){Q.setProjectionTargetAxis(t,e,e+a,n)})),Q.animateMotionValue(t,o,0,e)},stopLayoutAnimation:function(){kr((function(t){return Q.getProjectionAnimationProgress()[t].stop()}))},measureViewportBox:function(t){void 0===t&&(t=!0);var n=a(b,e);return t||ca(n,E),n},getProjectionAnimationProgress:function(){return w||(w={x:qi(0),y:qi(0)}),w},setProjectionTargetAxis:function(t,e,n,o){var i;void 0===o&&(o=!1),o?(O.relativeTarget||(O.relativeTarget={x:{min:0,max:1},y:{min:0,max:1}}),i=O.relativeTarget[t]):(O.relativeTarget=void 0,i=O.target[t]),O.isHydrated=!0,i.min=e,i.max=n,P=!0,_.notifySetAxisTarget()},rebaseProjectionTarget:function(t,e){void 0===e&&(e=D.layout);var n=Q.getProjectionAnimationProgress(),o=n.x,i=n.y,r=!(O.relativeTarget||O.isTargetLocked||o.isAnimating()||i.isAnimating());(t||r)&&kr((function(t){var n=e[t],o=n.min,i=n.max;Q.setProjectionTargetAxis(t,o,i)}))},notifyLayoutReady:function(t){!function(t){var e=t.getProjectionParent();if(e){var n=qr(e.getLayoutState().layout,t.getLayoutState().layout);kr((function(e){t.setProjectionTargetAxis(e,n[e].min,n[e].max,!0)}))}else t.rebaseProjectionTarget()}(Q),Q.notifyLayoutUpdate(D.layout,Q.prevViewportBox||D.layout,t)},resetTransform:function(){return c(Q,b,m)},restoreTransform:function(){return u(b,L)},updateLayoutProjection:function(){if(Q.isProjectionReady()){var t=D.delta,e=D.treeScale,n=e.x,o=e.y,i=D.deltaTransform;Xa(D,T,Q.path,E),P&&Q.notifyViewportBoxUpdate(T.target,t),P=!1;var r=Qa(t,e);r===i&&n===e.x&&o===e.y||Q.scheduleRender(),D.deltaTransform=r}},updateTreeLayoutProjection:function(){Q.layoutTree.forEach(Ja),ui.preRender(z,!1,!0)},getProjectionParent:function(){if(void 0===y){for(var t=!1,e=Q.path.length-1;e>=0;e--){var n=Q.path[e];if(n.projection.isEnabled){t=n;break}}y=t}return y},resolveRelativeTargetBox:function(){var t=Q.getProjectionParent();if(O.relativeTarget&&t&&(function(t,e){Ur(t.target.x,t.relativeTarget.x,e.target.x),Ur(t.target.y,t.relativeTarget.y,e.target.y)}(O,t.projection),$r(t))){var e=O.target;aa(e,e,t.getLatestValues())}},shouldResetTransform:function(){return Boolean(m._layoutResetTransform)},pointTo:function(t){T=t.projection,k=t.getLatestValues(),null==C||C(),C=Wn(t.onSetAxisTarget(Q.scheduleUpdateLayoutProjection),t.onLayoutAnimationComplete((function(){var t;Q.isPresent?Q.presence=ba.Present:null===(t=Q.layoutSafeToRemove)||void 0===t||t.call(Q)})))},isPresent:!0,presence:ba.Entering});return Q}};function Ja(t){t.resolveRelativeTargetBox()}function ts(t){t.updateLayoutProjection()}var es,ns=Object(xt.e)(["initial"],Object(xt.c)(lr)),os=ns.length,is=new Set(["width","height","top","left","right","bottom","x","y"]),rs=function(t){return is.has(t)},as=function(t,e){t.set(e,!1),t.set(e)},ss=function(t){return t===Oe||t===xe};!function(t){t.width="width",t.height="height",t.left="left",t.right="right",t.top="top",t.bottom="bottom"}(es||(es={}));var ls=function(t,e){return parseFloat(t.split(", ")[e])},cs=function(t,e){return function(n,o){var i=o.transform;if("none"===i||!i)return 0;var r=i.match(/^matrix3d\((.+)\)$/);if(r)return ls(r[1],e);var a=i.match(/^matrix\((.+)\)$/);return a?ls(a[1],t):0}},us=new Set(["x","y","z"]),ds=ie.filter((function(t){return!us.has(t)}));var hs={width:function(t){var e=t.x;return e.max-e.min},height:function(t){var e=t.y;return e.max-e.min},top:function(t,e){var n=e.top;return parseFloat(n)},left:function(t,e){var n=e.left;return parseFloat(n)},bottom:function(t,e){var n=t.y,o=e.top;return parseFloat(o)+(n.max-n.min)},right:function(t,e){var n=t.x,o=e.left;return parseFloat(o)+(n.max-n.min)},x:cs(4,13),y:cs(5,14)},fs=function(t,e,n,o){void 0===n&&(n={}),void 0===o&&(o={}),e=Object(xt.a)({},e),o=Object(xt.a)({},o);var i=Object.keys(e).filter(rs),r=[],a=!1,s=[];if(i.forEach((function(i){var l=t.getValue(i);if(t.hasValue(i)){var c,u=n[i],d=e[i],h=Ki(u);if(rn(d))for(var f=d.length,p=null===d[0]?1:0;p<f;p++)c?Ki(d[p]):(c=Ki(d[p]))===h||ss(h)&&ss(c);else c=Ki(d);if(h!==c)if(ss(h)&&ss(c)){var m=l.get();"string"==typeof m&&l.set(parseFloat(m)),"string"==typeof d?e[i]=parseFloat(d):Array.isArray(d)&&c===xe&&(e[i]=d.map(parseFloat))}else(null==h?void 0:h.transform)&&(null==c?void 0:c.transform)&&(0===u||0===d)?0===u?l.set(c.transform(u)):e[i]=h.transform(d):(a||(r=function(t){var e=[];return ds.forEach((function(n){var o=t.getValue(n);void 0!==o&&(e.push([n,o.get()]),o.set(n.startsWith("scale")?1:0))})),e.length&&t.syncRender(),e}(t),a=!0),s.push(i),o[i]=void 0!==o[i]?o[i]:e[i],as(l,d))}})),s.length){var l=function(t,e,n){var o=e.measureViewportBox(),i=e.getInstance(),r=getComputedStyle(i),a=r.display,s={top:r.top,left:r.left,bottom:r.bottom,right:r.right,transform:r.transform};"none"===a&&e.setStaticValue("display",t.display||"block"),e.syncRender();var l=e.measureViewportBox();return n.forEach((function(n){var i=e.getValue(n);as(i,hs[n](o,s)),t[n]=hs[n](l,r)})),t}(e,t,s);return r.length&&r.forEach((function(e){var n=Object(xt.c)(e,2),o=n[0],i=n[1];t.getValue(o).set(i)})),t.syncRender(),{target:l,transitionEnd:o}}return{target:e,transitionEnd:o}};function ps(t,e,n,o){return function(t){return Object.keys(t).some(rs)}(e)?fs(t,e,n,o):{target:e,transitionEnd:o}}var ms=function(t,e,n,o){var i=function(t,e,n){var o,i=Object(xt.d)(e,[]),r=t.getInstance();if(!(r instanceof HTMLElement))return{target:i,transitionEnd:n};for(var a in n&&(n=Object(xt.a)({},n)),t.forEachValue((function(t){var e=t.get();if(Sa(e)){var n=xa(e,r);n&&t.set(n)}})),i){var s=i[a];if(Sa(s)){var l=xa(s,r);l&&(i[a]=l,n&&(null!==(o=n[a])&&void 0!==o||(n[a]=s)))}}return{target:i,transitionEnd:n}}(t,e,o);return ps(t,e=i.target,n,o=i.transitionEnd)};var gs={treeType:"dom",readValueFromInstance:function(t,e){if(se(e)){var n=Ii(e);return n&&n.default||0}var o,i=(o=t,window.getComputedStyle(o));return(fe(e)?i.getPropertyValue(e):i[e])||0},sortNodePosition:function(t,e){return 2&t.compareDocumentPosition(e)?1:-1},getBaseTarget:function(t,e){var n;return null===(n=t.style)||void 0===n?void 0:n[e]},measureViewportBox:function(t,e){return Ir(t,e.transformPagePoint)},resetTransform:function(t,e,n){var o=n.transformTemplate;e.style.transform=o?o({},""):"none",t.scheduleRender()},restoreTransform:function(t,e){t.style.transform=e.style.transform},removeValueFromRenderState:function(t,e){var n=e.vars,o=e.style;delete n[t],delete o[t]},makeTargetAnimatable:function(t,e,n,o){var i=n.transformValues;void 0===o&&(o=!0);var r=e.transition,a=e.transitionEnd,s=Object(xt.d)(e,["transition","transitionEnd"]),l=function(t,e,n){var o,i,r={};for(var a in t)r[a]=null!==(o=or(a,e))&&void 0!==o?o:null===(i=n.getValue(a))||void 0===i?void 0:i.get();return r}(s,r||{},t);if(i&&(a&&(a=i(a)),s&&(s=i(s)),l&&(l=i(l))),o){!function(t,e,n){var o,i,r,a,s=Object.keys(e).filter((function(e){return!t.hasValue(e)})),l=s.length;if(l)for(var c=0;c<l;c++){var u=s[c],d=e[u],h=null;Array.isArray(d)&&(h=d[0]),null===h&&(h=null!==(i=null!==(o=n[u])&&void 0!==o?o:t.readValue(u))&&void 0!==i?i:e[u]),null!=h&&("string"==typeof h&&/^\-?\d*\.?\d+$/.test(h)?h=parseFloat(h):!tr(h)&&Ao.test(d)&&(h=Wi(u,d)),t.addValue(u,qi(h)),null!==(r=(a=n)[u])&&void 0!==r||(a[u]=h),t.setBaseTarget(u,h))}}(t,s,l);var c=ms(t,s,l,a);a=c.transitionEnd,s=c.target}return Object(xt.a)({transition:r,transitionEnd:a},s)},scrapeMotionValuesFromProps:en,build:function(t,e,n,o,i,r,a){void 0!==t.isVisible&&(e.style.visibility=t.isVisible?"visible":"hidden");var s=o.isEnabled&&i.isHydrated;Be(e,n,o,i,r,a.transformTemplate,s?Qa:void 0,s?Ya:void 0)},render:Ke},vs=Ka(gs),As=Ka(Object(xt.a)(Object(xt.a)({},gs),{getBaseTarget:function(t,e){return t[e]},readValueFromInstance:function(t,e){var n;return se(e)?(null===(n=Ii(e))||void 0===n?void 0:n.default)||0:(e=Je.has(e)?e:$e(e),t.getAttribute(e))},scrapeMotionValuesFromProps:nn,build:function(t,e,n,o,i,r,a){var s=o.isEnabled&&i.isHydrated;Qe(e,n,o,i,r,a.transformTemplate,s?Qa:void 0,s?Ya:void 0)},render:tn})),bs=function(t,e){return ee(t)?As(e,{enableHardwareAcceleration:!1}):vs(e,{enableHardwareAcceleration:!0})},ys=Object(xt.a)(Object(xt.a)(Object(xt.a)(Object(xt.a)({},pr),jn),Ca),Ua),Cs=Jt((function(t,e){return fn(t,e,ys,bs)}));class Ss{constructor(t){this.highlighted=!1,this.code=t,this.points=[]}}var ws=n(6);class xs{static now(){return Date.now()}}function Es(t){var e=Bt((function(){return qi(t)}));if(Object(W.useContext)(kt).isStatic){var n=Object(xt.c)(Object(W.useState)(t),2)[1];Object(W.useEffect)((function(){return e.onChange(n)}),[])}return e}var Ls=function(t){return function(t){return"object"==typeof t&&t.mix}(t)?t.mix:void 0};function _s(t,e){var n=Es(e()),o=function(){return n.set(e())};return o(),function(t,e){Object(W.useEffect)((function(){var n=t.map((function(t){return t.onChange(e)}));return function(){return n.forEach((function(t){return t()}))}}))}(t,(function(){return ui.update(o,!1,!0)})),n}function Os(t,e,n,o){var i="function"==typeof e?e:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=!Array.isArray(t[0]),o=n?0:-1,i=t[0+o],r=t[1+o],a=t[2+o],s=t[3+o],l=_o(r,a,Object(xt.a)({mixer:Ls(a[0])},s));return n?l(i):l}(e,n,o);return Array.isArray(t)?Ts(t,i):Ts([t],(function(t){var e=Object(xt.c)(t,1)[0];return i(e)}))}function Ts(t,e){var n=Bt((function(){return[]}));return _s(t,(function(){n.length=0;for(var o=t.length,i=0;i<o;i++)n[i]=t[i].get();return e(n)}))}function ks(t,e,n){void 0===n&&(n={});var o=de(t)?t:qi(t);return Hi("",o,e,n),{stop:function(){return o.stop()}}}var Ds=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};class Ps extends W.default.Component{constructor(t){super(t),this.state={element:t.element}}update(t){this.setState({element:t})}style(t){this.customStyle=t,this.forceUpdate()}render(){var t,e,n,o,i,r,a,s,l;const c=this.state.element,u=this.props.configuration.style;!c.highlighted&&this.props.configuration.automaticSelectionEnabled&&this.props.onClick(c);const d=null!==(e=null===(t=this.customStyle)||void 0===t?void 0:t.fillColor)&&void 0!==e?e:c.highlighted?u.highlightedPolygonFillColor:u.polygonFillColor,h=null!==(o=null===(n=this.customStyle)||void 0===n?void 0:n.strokeColor)&&void 0!==o?o:c.highlighted?u.highlightedPolygonStrokeColor:u.polygonStrokeColor,f=null!==(r=null===(i=this.customStyle)||void 0===i?void 0:i.strokeWidth)&&void 0!==r?r:c.highlighted?u.highlightedPolygonStrokeWidth:u.polygonStrokeWidth,p=null!==(s=null===(a=this.customStyle)||void 0===a?void 0:a.cornerRadius)&&void 0!==s?s:c.highlighted?u.highlightedPolygonCornerRadius:u.polygonCornerRadius,m=null!==(l=this.props.animateToPoints)&&void 0!==l?l:c.points;return W.default.createElement(Bs,{points:m,onClick:()=>{this.props.onClick&&this.props.onClick(c)},fill:d,stroke:h,strokeWidth:f,cornerRadius:p})}}function Bs(t){var{points:e,cornerRadius:n}=t,o=Ds(t,["points","cornerRadius"]);const i=[e[0].x,e[0].y,e[1].x,e[1].y,e[2].x,e[2].y,e[3].x,e[3].y],r=i.map(Es),a=Os(r,(([t,e,o,i,r,a,s,l])=>{const c=[{x:t,y:e},{x:o,y:i},{x:r,y:a},{x:s,y:l}];return ws.a.toSvgPathStringWithRoundedCorners(c,n)}));return Object(W.useEffect)((()=>{const t=[];for(let e=0;e<i.length;e++)t.push(ks(r[e],i[e]));return()=>{t.forEach((t=>t.stop()))}}),[e]),W.default.createElement(Cs.path,Object.assign({d:a},o))}class Fs extends W.default.Component{constructor(t){super(t),this.state={polygonElements:[]}}update(t,e,n,o){const i=[];(class{static keepOnlyCenterMostDuplicate(t,e){const n=new Map;t.forEach((t=>{const e=At(t),o=n.get(e);o?o.push(t):n.set(e,[t])})),n.forEach(((e,o)=>{e.length<2?n.delete(o):e.forEach(((e,n)=>{t.splice(t.indexOf(e),1)}))})),n.forEach(((n,o)=>{const i=t=>{let e={x:0,y:0};return t.forEach((t=>{e.x+=t.x,e.y+=t.y})),e.x/=t.length,e.y/=t.length,e},r=e.width/2,a=n.reduce(((t,e)=>{const n=i(t.quad),o=i(e.quad);return Math.abs(r-n.x)<Math.abs(r-o.x)?t:e}));t.push(a)}))}}).keepOnlyCenterMostDuplicate(o,n),o.forEach((o=>{const r=new Ss(o);r.points=void 0===t?ws.a.scaleListToHtmlElement(o.quad,n,e.video):o.quad.map((e=>{const o=new ws.a(e.x,e.y);return o.x*=t.width/n.width,o.y*=t.height/n.height,o.y+=t.y,o.x+=t.x,o})),r.points.forEach((t=>{e.state.mirrored&&this.container&&(t.x=this.container.clientWidth-t.x)})),i.push(r)}));const r=[];this.state.polygonElements.forEach((t=>{const e=i.find((e=>vt(e.code,t.element.code)));let n=!1;void 0===e?t.updatedAt+1e3<xs.now()&&(n=!0):(t.element=e,t.polygon=W.default.createElement(Ps,{key:At(t.element.code),ref:e=>t.polygonRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)}),t.label=W.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:At(t.element.code),ref:e=>t.labelRef=e,configuration:this.props.configuration,element:t.element,animateToPoints:e.points,onClick:this.onPolygonClick.bind(this)})),t.updatedAt=xs.now()),n||r.push(t)})),i.forEach((t=>{if(void 0===this.state.polygonElements.find((e=>vt(e.element.code,t.code)))){let e,n;const o=W.default.createElement(Ps,{key:At(t.code),ref:o=>{e=o,void 0!==n&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)}),i=W.default.createElement(this.props.LabelComponent,Object.assign({},this.props.labelComponentConfig,{key:At(t.code),ref:o=>{n=o,void 0!==e&&this.props.onBarcodeFound(t.code,e,n)},configuration:this.props.configuration,element:t,onClick:this.onPolygonClick.bind(this)})),a={element:t,polygon:o,label:i,polygonRef:e,labelRef:n,updatedAt:xs.now()};r.push(a)}})),this.setState({polygonElements:r})}onPolygonClick(t){var e,n,o,i;t.highlighted=!t.highlighted,this.forceUpdate(),this.state.polygonElements.forEach((e=>{var n;const o=e.labelRef,i=e.label.props.element;o&&vt(i.code,t.code)&&(o.update(t),null===(n=e.polygonRef)||void 0===n||n.update(t))})),t.highlighted&&(null===(n=(e=this.props).onPolygonSelected)||void 0===n||n.call(e,t.code)),null===(i=(o=this.props).onPolygonClick)||void 0===i||i.call(o,t.code)}render(){var t,e;return W.default.createElement("div",{style:Object.assign({width:"100%",height:"100%",position:"absolute"},this.props.style),ref:t=>this.container=t},W.default.createElement(Cs.svg,{style:{position:"absolute",maxWidth:"100%",width:"100%",height:"100%"}},null===(t=this.state.polygonElements)||void 0===t?void 0:t.map((t=>t.polygon))),null===(e=this.state.polygonElements)||void 0===e?void 0:e.map((t=>t.label)))}}var Rs=n(37),Is=n.n(Rs),Ws=n(40),Ms={insert:"head",singleton:!1},js=(Is()(Ws.a,Ms),Ws.a.locals,n(27)),zs=n.n(js);class Ns{constructor(t){this.lastTime=0,this.lastDuration=0,this.t=0,this.element=null,this.animationClass="",this.animationClass=t}setDuration(t){const e=Date.now()/1e3,n=e-this.lastTime;this.lastDuration&&(this.t+=n%this.lastDuration/this.lastDuration,this.t-=0|this.t);const o=-t*this.t;this.element&&(this.element.style.animationDuration=`${t}s`,this.element.style.animationDelay=`${o}s`,this.element.classList.remove(this.animationClass),this.element.offsetHeight,this.element.classList.add(this.animationClass)),this.lastTime=e,this.lastDuration=t}}class Vs extends W.default.Component{constructor(){super(...arguments),this.inner1=new Ns("scanbot-shutter-rotate"),this.inner2=new Ns("scanbot-shutter-rotate")}render(){return W.default.createElement("div",{className:"scanbot-shutter-button",style:this.props.style,onClick:this.props.onClick},this.captureBackground(),this.captureInnerCircle(),this.captureSearchingInner1(),this.captureSearchingInner2())}updateAnimationSpeed(t){"searching"==t?(this.inner1.setDuration(3),this.inner2.setDuration(2)):(this.inner1.setDuration(1.5),this.inner2.setDuration(.75))}componentDidMount(){this.updateAnimationSpeed(this.props.action)}componentDidUpdate(){this.updateAnimationSpeed(this.props.action)}captureBackground(){return this.svgBase(null,W.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M32 0c17.673 0 32 14.327 32 32 0 17.673-14.327 32-32 32C14.327 64 0 49.673 0 32 0 14.327 14.327 0 32 0zm0 3C15.984 3 3 15.984 3 32s12.984 29 29 29 29-12.984 29-29S48.016 3 32 3z")))}captureInnerCircle(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"processing"==t||"manual"==t,"scanbot-shutter-fade-out":"searching"==t||"capturing"==t,"scanbot-shutter-pulse-fast":"processing"==t},W.default.createElement("g",{fill:"none",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},W.default.createElement("circle",{cx:"32",cy:"32",r:"24",fill:this.props.color,fillRule:"nonzero"})))}captureSearchingInner1(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},W.default.createElement("g",{fill:"none",fillOpacity:"0.7",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M44.24 51.476a1 1 0 01-1.066-1.692A20.981 20.981 0 0053 32c0-11.598-9.402-21-21-21a1 1 0 010-2c12.703 0 23 10.297 23 23a22.98 22.98 0 01-10.76 19.476z")),(t=>{this.inner1.element=t}))}captureSearchingInner2(){const{action:t}=this.props;return this.svgBase({"scanbot-shutter-button-part":!0,"scanbot-shutter-fade-in":"searching"==t||"capturing"==t,"scanbot-shutter-fade-out":"processing"==t||"manual"==t},W.default.createElement("g",{fill:"none",fillOpacity:"0.4",fillRule:"evenodd",stroke:"none",strokeWidth:"1"},this.path("M46.624 35.35a1 1 0 01-1.95-.445C44.89 33.96 45 32.988 45 32c0-7.18-5.82-13-13-13a1 1 0 010-2c8.284 0 15 6.716 15 15 0 1.138-.127 2.26-.376 3.35z")),(t=>{this.inner2.element=t}))}path(t){return W.default.createElement("path",{fill:this.props.color,fillRule:"nonzero",d:t})}svgBase(t,e,n){return W.default.createElement("div",{className:zs()(t),ref:n},W.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"64",height:"64",viewBox:"0 0 64 64"},e))}}class Us extends W.default.Component{render(){return W.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W.default.createElement("mask",{id:"mask0_919_23088",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},W.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_919_23088)"},W.default.createElement("path",{d:"M9 19V17H21V19H9ZM9 13V11H21V13H9ZM9 7V5H21V7H9ZM5 20C4.45 20 3.97917 19.8042 3.5875 19.4125C3.19583 19.0208 3 18.55 3 18C3 17.45 3.19583 16.9792 3.5875 16.5875C3.97917 16.1958 4.45 16 5 16C5.55 16 6.02083 16.1958 6.4125 16.5875C6.80417 16.9792 7 17.45 7 18C7 18.55 6.80417 19.0208 6.4125 19.4125C6.02083 19.8042 5.55 20 5 20ZM5 14C4.45 14 3.97917 13.8042 3.5875 13.4125C3.19583 13.0208 3 12.55 3 12C3 11.45 3.19583 10.9792 3.5875 10.5875C3.97917 10.1958 4.45 10 5 10C5.55 10 6.02083 10.1958 6.4125 10.5875C6.80417 10.9792 7 11.45 7 12C7 12.55 6.80417 13.0208 6.4125 13.4125C6.02083 13.8042 5.55 14 5 14ZM5 8C4.45 8 3.97917 7.80417 3.5875 7.4125C3.19583 7.02083 3 6.55 3 6C3 5.45 3.19583 4.97917 3.5875 4.5875C3.97917 4.19583 4.45 4 5 4C5.55 4 6.02083 4.19583 6.4125 4.5875C6.80417 4.97917 7 5.45 7 6C7 6.55 6.80417 7.02083 6.4125 7.4125C6.02083 7.80417 5.55 8 5 8Z",fill:"white"})))}}class Hs extends W.default.Component{render(){return W.default.createElement("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W.default.createElement("mask",{id:"mask0_919_23102",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"24",height:"24"},W.default.createElement("rect",{width:"24",height:"24",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_919_23102)"},W.default.createElement("path",{d:"M12 22C10.75 22 9.57917 21.7625 8.4875 21.2875C7.39583 20.8125 6.44583 20.1708 5.6375 19.3625C4.82917 18.5542 4.1875 17.6042 3.7125 16.5125C3.2375 15.4208 3 14.25 3 13H5C5 14.95 5.67917 16.6042 7.0375 17.9625C8.39583 19.3208 10.05 20 12 20C13.95 20 15.6042 19.3208 16.9625 17.9625C18.3208 16.6042 19 14.95 19 13C19 11.05 18.3208 9.39583 16.9625 8.0375C15.6042 6.67917 13.95 6 12 6H11.85L13.4 7.55L12 9L8 5L12 1L13.4 2.45L11.85 4H12C13.25 4 14.4208 4.2375 15.5125 4.7125C16.6042 5.1875 17.5542 5.82917 18.3625 6.6375C19.1708 7.44583 19.8125 8.39583 20.2875 9.4875C20.7625 10.5792 21 11.75 21 13C21 14.25 20.7625 15.4208 20.2875 16.5125C19.8125 17.6042 19.1708 18.5542 18.3625 19.3625C17.5542 20.1708 16.6042 20.8125 15.5125 21.2875C14.4208 21.7625 13.25 22 12 22Z",fill:"white"})))}}class Gs extends W.default.Component{constructor(t){super(t),this.state={barcodes:void 0}}update(t){this.setState({barcodes:t})}didScan(){return void 0!==this.state.barcodes}render(){var t,e;return W.default.createElement("div",{style:{position:"absolute",bottom:0,width:"100%",height:76,display:"flex",alignItems:"center",backgroundColor:St.ScanbotPrimary}},W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onBurgerClick},W.default.createElement(Us,null),W.default.createElement("div",{style:{backgroundColor:St.Orange,color:St.White,width:24,height:24,borderRadius:12,marginLeft:10,fontSize:13,lineHeight:"24px",textAlign:"center"}},null!==(e=null===(t=this.state.barcodes)||void 0===t?void 0:t.length)&&void 0!==e?e:0)),W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",opacity:this.props.isShowingImage?.5:1}},W.default.createElement(Vs,{style:{left:0,bottom:0,transform:"none"},color:"#FFF",action:this.props.action,onClick:!this.props.isShowingImage&&this.props.onShutterButtonClick})),W.default.createElement("div",{style:{display:"flex",flex:1,justifyContent:"center",alignItems:"center",opacity:this.didScan()?1:.5},onClick:this.didScan()&&this.props.onScanMoreClick},W.default.createElement("div",{style:{fontSize:13,color:St.White,marginRight:10}},"Scan More"),W.default.createElement(Hs,null)))}}class Qs extends W.default.Component{render(){const t=ws.a.centerOf(this.props.points),e=ws.a.smallerSizeOfQuad(this.props.points)/40;return W.default.createElement("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{position:"absolute",left:t.x-20,top:t.y-20,transform:`scale(${e})`}},W.default.createElement("mask",{id:"mask0_910_20901",style:"mask-type:alpha",maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"40",height:"40"},W.default.createElement("rect",{width:"40",height:"40",fill:"#D9D9D9"})),W.default.createElement("g",{mask:"url(#mask0_910_20901)"},W.default.createElement("rect",{x:"7",y:"13",width:"26",height:"16",fill:"white"}),W.default.createElement("path",{d:"M17.5833 27.6111L29.3611 15.8333L27.3055 13.8055L17.5833 23.5278L12.6666 18.6111L10.6389 20.6389L17.5833 27.6111ZM20 36.6666C17.713 36.6666 15.5555 36.2291 13.5278 35.3541C11.5 34.4791 9.73147 33.287 8.22219 31.7778C6.71294 30.2685 5.52081 28.5 4.64581 26.4722C3.77081 24.4444 3.33331 22.287 3.33331 20C3.33331 17.6944 3.77081 15.5278 4.64581 13.5C5.52081 11.4722 6.71294 9.70831 8.22219 8.20831C9.73147 6.70831 11.5 5.52081 13.5278 4.64581C15.5555 3.77081 17.713 3.33331 20 3.33331C22.3055 3.33331 24.4722 3.77081 26.5 4.64581C28.5278 5.52081 30.2916 6.70831 31.7916 8.20831C33.2916 9.70831 34.4791 11.4722 35.3541 13.5C36.2291 15.5278 36.6666 17.6944 36.6666 20C36.6666 22.287 36.2291 24.4444 35.3541 26.4722C34.4791 28.5 33.2916 30.2685 31.7916 31.7778C30.2916 33.287 28.5278 34.4791 26.5 35.3541C24.4722 36.2291 22.3055 36.6666 20 36.6666Z",fill:"#55BB77"})))}}var Ys=n(10);class Zs extends W.default.Component{constructor(t){super(t),this.state={elements:[],imageSize:Ys.a.empty()}}update(t){const e=[];t.barcodes.forEach((n=>{const o=new Ss(n);o.points=ws.a.scaleListToHtmlElement(n.quad,t.originalImageSize,this.image),e.push(o)})),this.setState({imageSize:Ys.a.fromHtmlElement(this.image),elements:e})}reset(){this.setState({elements:[]})}render(){return void 0===this.props.image||null===this.props.image?null:W.default.createElement("div",{className:"scanned-image-with-overlay",style:{position:"absolute",display:"flex",justifyContent:"center",alignItems:this.state.image?"normal":"center",minHeight:"300px",height:"100%",width:"100%",top:0,left:0}},W.default.createElement("img",{style:{maxWidth:"100%"},ref:t=>this.image=t,src:`${this.props.image}`}),W.default.createElement("div",{style:{position:"absolute",maxWidth:"100%",width:this.state.imageSize.width,height:this.state.imageSize.height}},this.state.elements.map(((t,e)=>W.default.createElement(Qs,{key:e,points:t.points})))))}}class qs extends W.default.Component{render(){if(!this.props.visible)return null;const t=mt.a.svg`
32
32
  animation: rotate 2s linear infinite;
33
33
  @keyframes rotate { 100% { transform: rotate(360deg); } }
34
34
  `;return W.default.createElement("div",{style:{top:0,left:0,width:"100%",height:"100%",position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100}},W.default.createElement(t,{width:"101",height:"100",viewBox:"0 0 101 100",fill:"none",xmlns:"http://www.w3.org/2000/svg"},W.default.createElement("circle",{cx:"50.5",cy:"50",r:"50",fill:"#3E3E3E","fill-opacity":"0.35"}),W.default.createElement("path",{d:"M90.5153 49.6094C91.715 49.6094 92.6933 50.5827 92.6321 51.7808C92.1218 61.7815 88.0988 71.3096 81.2342 78.6635C73.8743 86.548 63.7963 91.3454 53.036 92.0868C42.2757 92.8282 31.6351 89.4582 23.2634 82.6576C15.455 76.3147 10.1633 67.4283 8.28624 57.5922C8.06135 56.4138 8.89694 55.3155 10.0853 55.1509C11.2737 54.9864 12.3642 55.8183 12.5959 56.9954C14.3176 65.7412 19.0487 73.6367 26.0026 79.2856C33.5201 85.3922 43.0751 88.4183 52.7374 87.7526C62.3998 87.0869 71.4494 82.7789 78.0584 75.699C84.1719 69.1497 87.7754 60.68 88.2814 51.7807C88.3495 50.5829 89.3156 49.6094 90.5153 49.6094Z",fill:"white"}),W.default.createElement("path",{d:"M40.7013 23.4514C40.2751 22.2667 40.8885 20.9518 42.1022 20.6166C45.5928 19.6526 49.2351 19.3251 52.8537 19.6567C57.2305 20.0577 61.4662 21.4131 65.2628 23.6273C69.0594 25.8416 72.3246 28.861 74.8286 32.4731C77.3326 36.0851 79.0146 40.2021 79.7562 44.5341C80.4978 48.8662 80.281 53.3082 79.121 57.5475C77.9611 61.7868 75.8862 65.7204 73.0423 69.0714C70.1985 72.4225 66.6548 75.1095 62.6606 76.9436C59.3583 78.4599 55.8145 79.3627 52.202 79.6146C50.9459 79.7022 49.9301 78.6662 49.9379 77.4072C49.9457 76.1481 50.9746 75.1443 52.2293 75.0398C55.1749 74.7942 58.0613 74.0382 60.758 72.8C64.1467 71.244 67.1532 68.9642 69.5659 66.1212C71.9787 63.2781 73.7391 59.9408 74.7232 56.3442C75.7073 52.7475 75.8912 48.9789 75.262 45.3035C74.6328 41.6281 73.2058 38.1353 71.0814 35.0708C68.957 32.0062 66.1867 29.4445 62.9657 27.5659C59.7446 25.6873 56.151 24.5374 52.4377 24.1972C49.4828 23.9265 46.5092 24.1737 43.6497 24.9219C42.4316 25.2406 41.1274 24.6362 40.7013 23.4514Z",fill:"white"}),W.default.createElement("path",{d:"M39.9232 61.6554C39.1643 62.5529 37.8105 62.673 37.0094 61.813C35.7171 60.4259 34.6502 58.8388 33.8523 57.1092C32.7564 54.7336 32.1944 52.1468 32.206 49.5307C32.2175 46.9146 32.8022 44.3328 33.9189 41.967C35.0356 39.6011 36.6573 37.5088 38.6697 35.8372C40.6822 34.1656 43.0365 32.9554 45.567 32.2916C48.0975 31.6279 50.7428 31.5268 53.3166 31.9954C55.8904 32.464 58.3303 33.4911 60.4644 35.0042C62.0183 36.1059 63.3827 37.4458 64.5093 38.9707C65.2077 39.916 64.8412 41.2247 63.8197 41.8061C62.7982 42.3875 61.5108 42.0174 60.7778 41.0986C59.9824 40.1015 59.0489 39.2181 58.0027 38.4763C56.3759 37.3229 54.5161 36.5401 52.5541 36.1828C50.5922 35.8256 48.5758 35.9027 46.6469 36.4086C44.7179 36.9146 42.9233 37.8371 41.3893 39.1113C39.8553 40.3855 38.6192 41.9804 37.7679 43.7838C36.9167 45.5872 36.471 47.5552 36.4622 49.5494C36.4534 51.5436 36.8818 53.5154 37.7172 55.3262C38.2544 56.4908 38.9515 57.5705 39.7858 58.5353C40.5545 59.4244 40.6821 60.7579 39.9232 61.6554Z",fill:"white"})))}}class Xs extends W.default.Component{render(){return this.props.text?W.default.createElement("div",{style:{position:"absolute",top:this.props.top,bottom:this.props.bottom,display:"flex",width:"100%",justifyContent:"center"}},W.default.createElement("div",{style:{padding:"5px 10px",borderRadius:5,backgroundColor:St.TransparentGray,color:St.White,fontWeight:500,fontSize:13}},this.props.text)):null}}class $s extends W.default.Component{constructor(t){super(t),this.state={element:t.element}}style(t){this.customStyle=t,this.forceUpdate()}update(t){this.setState({element:t})}formatText(t,e){if("None"!==e)return"Text"===e?t.text:t.format+" ("+t.text+")"}render(){var t,e,n,o,i;const r=this.state.element,a=this.props.configuration.style,s=this.formatText(r.code,this.props.configuration.textFormat),l=ws.a.width(null!==(t=this.props.animateToPoints)&&void 0!==t?t:r.points);if(!s)return null;if(!r.points)return null;const c=null!==(n=null===(e=this.customStyle)||void 0===e?void 0:e.backgroundColor)&&void 0!==n?n:r.highlighted?a.highlightedTextBackgroundColor:a.textBackgroundColor,u=null!==(i=null===(o=this.customStyle)||void 0===o?void 0:o.textColor)&&void 0!==i?i:r.highlighted?a.highlightedTextColor:a.textColor;return W.default.createElement(Cs.div,{ref:t=>this.label=t,onClick:()=>{this.props.onClick&&this.props.onClick(r)},style:{x:ws.a.lowestX(r.points),y:ws.a.highestY(r.points)+3,backgroundColor:c,fontSize:12,width:l,overflow:"hidden",color:u,borderRadius:5,position:"absolute",padding:"3px 7px",textAlign:"center",maxHeight:50,lineBreak:"anywhere",lineHeight:"22px",WebkitLineClamp:2,display:"-webkit-box",WebkitBoxOrient:"vertical"},animate:this.props.animateToPoints?{x:ws.a.lowestX(this.props.animateToPoints),y:ws.a.highestY(this.props.animateToPoints)+30}:{}},s)}}class Ks{constructor(){this.defaultFillColor="rgba(255, 0, 0, 0.3)",this.defaultHighlightedFillColor="rgba(0, 255, 0, 0.3)",this.polygonStrokeColor="rgba(255, 0, 0, 1)",this.polygonFillColor=this.defaultFillColor,this.polygonStrokeWidth=1,this.polygonCornerRadius=0,this.highlightedPolygonStrokeColor="rgba(0, 255, 0, 1)",this.highlightedPolygonFillColor=this.defaultHighlightedFillColor,this.highlightedPolygonStrokeWidth=2,this.highlightedPolygonCornerRadius=0,this.textColor="white",this.textBackgroundColor="rgba(255, 0, 0, 0.9)",this.highlightedTextColor="white",this.highlightedTextBackgroundColor="rgba(0, 255, 0, 0.9)"}}class Js{constructor(){this.visible=!1,this.textFormat="Text",this.automaticSelectionEnabled=!1,this.style=new Ks}}class tl{constructor(){this.topLabelTop=20,this.sheetHeight="95%",this.sheetTopMargin="10%"}}class el{constructor(){this.enabled=!1,this.style=new tl}}class nl extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.captureDelay=1e3,this.overlay=new Js,this.detectionParameters=new T.BarcodeScannerTypes.BarcodeScannerConfiguration,this.scanAndCount=new el,this.onBarcodesDetected=function(t){}}static fromJson(t){const e=new nl;return this.mapValues(t,e,["style","videoConstraints","overlay","scanAndCount","finder","userGuidance"]),this.mapFinderConfiguration(e,t),t.overlay&&(this.mapValues(t.overlay,e.overlay,["style"]),t.overlay.style&&this.mapValues(t.overlay.style,e.overlay.style)),t.scanAndCount&&(this.mapValues(t.scanAndCount,e.scanAndCount,["style"]),t.scanAndCount.style&&this.mapValues(t.scanAndCount.style,e.scanAndCount.style)),this.mapVideoConstraints(t,e),e}}class ol{constructor(t){this.coreResult=t,this.barcodes=[],this.originalImageSize=null,this.barcodes=t.barcodes,t.originalImage&&(this.originalImageSize=new Ys.a(t.originalImage.width,t.originalImage.height))}isEmpty(){return 0===this.barcodes.length}}class il{static warn(t){console.warn("[ScanbotSDK]",t)}}class rl{static convertLinesToViewportLines(t,e){if(e&&t)return e.map((e=>({start:new ws.a(e.start.x*t.width,e.start.y*t.height),end:new ws.a(e.end.x*t.width,e.end.y*t.height)})))}static convertToViewportPointsFromParentSize(t,e){return e?Ys.a.isEmpty(t)?void 0:e.map((e=>ws.a.scaleUpTo(e,t))):Ys.a.toPolygon(t)}static calculateScale(t){let e,n=0,o=0;return 1>t.width/t.height?(e=t.height/1,n=(1-t.width/e)/2):(e=t.width/1,o=(1-t.height/e)/2),{x:n,y:o,containerScale:e}}static findScale(t,e){let n,o=0,i=0;return e.ratio(!0)>t.ratio(!0)?(n=t.width/e.width,i=(e.height-t.height/n)/2):(n=t.height/e.height,o=(e.width-t.width/n)/2),{x:o,y:i,scale:n}}static preventDefaultCallback(t){t.preventDefault()}static disableScreenMovement(){document.addEventListener("touchmove",rl.preventDefaultCallback,{passive:!1}),document.body.scrollTop=document.documentElement.scrollTop=0,document.documentElement.style.overflow="hidden"}static enableScreenMovement(){document.removeEventListener("touchmove",rl.preventDefaultCallback),document.documentElement.style.overflow="auto"}static findContainerOrThrow(t){var e;const n=null!==(e=t.container)&&void 0!==e?e:document.getElementById(t.containerId);if(!n)throw Error("Unable to initialize scanner: Cannot find container element either from 'container' property or with the containerId property provided.");return n}}var al=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};ht.a;ht.b;class sl extends ht.c{constructor(t){var e;super(t),this.shouldComputeSize=!0,this.paused=!1,this.barcodeRecognizerHandle=null,this.barcodes=[],this.detectionRunning=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),this.backendurl=void 0,this.desiredRecognitionResolution=void 0,this.desiredRecognitionResolution=this.configuration.desiredRecognitionResolution,Object.assign(this.state,{isFinderVisible:null===(e=this.configuration.finder.visible)||void 0===e||e,zoom:void 0,action:"manual",image:void 0,bottomHintText:void 0})}get configuration(){return this._configuration||(this._configuration=nl.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t){return al(this,void 0,void 0,(function*(){const e=rl.findContainerOrThrow(t);return new Promise(((n,o)=>{Object(W.render)(W.default.createElement(sl,{container:e,configuration:t,onSuccess:n,onFailure:o}),e)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return al(this,void 0,void 0,(function*(){il.warn("Barcode detection resumed"),yield this.resume()}))}pauseDetection(){il.warn("Barcode detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return al(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),window.removeEventListener("resize",this.updateDimensionsCallback),this.barcodeRecognizerHandle&&this.bridge.copyArgs.releaseObject(this.barcodeRecognizerHandle).catch((t=>{var e,n;return null===(n=(e=this.props.configuration).onError)||void 0===n?void 0:n.call(e,t)}))}updateDimensions(){return al(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return al(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var t,e,n,o,i;return al(this,void 0,void 0,(function*(){if(!this.enabled)return;if(this.paused)return;if(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)return;if(this.detectionRunning)return;let r=!1;try{this.detectionRunning=!0;const t=yield this.recognizeBarcodes(!0,this.shouldComputeSize);if(this.shouldComputeSize=!1,!t)return;const a=new ol(t);a.isEmpty()?this.configuration._onDetectionFailed&&(null===(e=this.configuration)||void 0===e||e._onDetectionFailed(t.originalImage)):(r=!0,this.configuration.overlay.visible||this.configuration.onBarcodesDetected(a)),null===(n=this.overlay)||void 0===n||n.update(null===(o=this.finder)||void 0===o?void 0:o.holeRect,this.camera,a.originalImageSize,a.barcodes)}catch(t){console.log(t)}finally{this.detectionRunning=!1;const t=()=>requestAnimationFrame((()=>this.detect())),e=(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)?0:this.configuration.captureDelay;r&&0!=e?setTimeout(t,e):t()}}))}setUseBackendService(t){console.log("Now using backend service for recognition: ",t),this.backendurl=t}recognizeBarcodes(t,e){var n,o,i,r,a,s,l,c;return al(this,void 0,void 0,(function*(){try{window&&window.__SB_DEBUG_BARCODESCANNER_FORCE_DETERMINISTIC_MODE&&(t=!1);const l=t?ht.c.DEFAULT_DETECTION_RESOLUTION:ht.c.DETECTION_RESULTION_4K,c=null!==(n=this.desiredRecognitionResolution)&&void 0!==n?n:l;this.camera.finderFrame=null===(o=this.finder)||void 0===o?void 0:o.holeRect;const u=yield null===(i=this.camera)||void 0===i?void 0:i.createImageData(c,!1);if(!u)return;e&&this.forceUpdate(),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&(this.setState({image:b.wrapperToBase64(u)}),void 0!==this.desiredRecognitionResolution?console.log("Recognizing barcodes with custom resolution:",this.desiredRecognitionResolution):console.log("Recognizing barcodes with max resolution:",ht.c.DETECTION_RESULTION_4K,"(the actual resolution depends on your device and may be lower)"));new Ys.a(u.width,u.height);this.barcodeRecognizerHandle||(this.barcodeRecognizerHandle=yield this.bridge.copyArgs.createBarcodeRecognizer(new T.BarcodeScannerTypes.BarcodeScannerConfiguration(Object.assign(Object.assign({},this.configuration.detectionParameters),{live:t}))));const d=yield this.bridge.transferArgs.recognizeBarcodes(this.barcodeRecognizerHandle,u);if(!this.enabled)return;return null===d?void(null===(s=(a=this.props).onLicenseError)||void 0===s||s.call(a)):(this.camera.reusableImageBuffer=d.originalImage.data,d)}catch(t){return void(null===(c=(l=this.props.configuration).onError)||void 0===c||c.call(l,t))}}))}setRecognitionResolution(t){this.desiredRecognitionResolution=t}getResolution(){return al(this,void 0,void 0,(function*(){return new Promise(((t,e)=>{const n=this.camera.videoSize();n.width>0&&n.height>0?t(Ys.a.fromJson(n)):this.camera.didLoadVideo=()=>{const e=this.camera.videoSize();t(Ys.a.fromJson(e))}}))}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}setZoom(t){this.setState({zoom:t})}setCameraDirection(t){this.camera.setDirection(t)}updateTorch(t){this.camera.videoStream.updateTorch(t)}getCapabilities(){return this.camera.videoStream.getCapabilities()}render(){var t,e,n,o,i,r,a;const s=(null===(t=this.configuration.scanAndCount)||void 0===t?void 0:t.enabled)?"Tap the shutter button to scan":void 0;return W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",backgroundColor:"black",minHeight:"100px"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),W.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},W.default.createElement(ft.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,zoom:null!==(n=this.state.zoom)&&void 0!==n?n:this.configuration.zoom,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),W.default.createElement(Xs,{top:null===(o=this.configuration.scanAndCount)||void 0===o?void 0:o.style.topLabelTop,text:s}),W.default.createElement(Zs,{ref:t=>this.scannedImage=t,image:this.state.image}),this.state.isFinderVisible&&W.default.createElement(pt.a,{ref:t=>{this.finder=t},padding:this.props.viewFinderPadding,guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}),W.default.createElement(Xs,{bottom:100,text:this.state.bottomHintText}),W.default.createElement(qs,{visible:"processing"===this.state.action}),(null===(i=this.configuration.overlay)||void 0===i?void 0:i.visible)&&W.default.createElement(Fs,{ref:t=>{t&&(this.overlay=t)},configuration:this.configuration.overlay,onPolygonSelected:t=>{const e=new ol({barcodes:[t]});this.configuration.onBarcodesDetected(e)},onBarcodeFound:(t,e,n)=>{var o;(null===(o=this.configuration.overlay)||void 0===o?void 0:o.onBarcodeFound)&&this.configuration.overlay.onBarcodeFound(t,e,n)},LabelComponent:$s,labelComponentConfig:{}}),(null===(r=this.configuration.scanAndCount)||void 0===r?void 0:r.enabled)&&W.default.createElement(Gs,{ref:t=>this.bottomActionBar=t,action:this.state.action,isShowingImage:void 0!==this.state.image,onBurgerClick:()=>{this.popup.push(Ct.PushBottom,this.barcodes)},onShutterButtonClick:()=>al(this,void 0,void 0,(function*(){(new y).flash(),this.setState({action:"processing"});const t=(new Date).getTime();let e=yield this.recognizeBarcodes(!1,!1);const n=new ol(null!=e?e:{barcodes:[]});console.log("Recognition took:",((new Date).getTime()-t)/1e3);const o=this.countLabelText(n.barcodes);this.setState({action:"manual",bottomHintText:o}),this.scannedImage.update(n),this.barcodes.push(...n.barcodes),this.bottomActionBar.update(this.barcodes),n.barcodes.length>0&&this.configuration.onBarcodesDetected(n)})),onScanMoreClick:()=>{this.resetCountImage()}}),W.default.createElement(wt,{ref:t=>this.popup=t,style:null===(a=this.configuration.scanAndCount)||void 0===a?void 0:a.style,onDeleteClick:()=>{if(confirm("Are you sure you want to delete all scanned barcodes?")){for(;this.barcodes.length>0;)this.barcodes.pop();console.log("Cleared barcodes",this.barcodes.length),this.popup.update(this.barcodes),this.bottomActionBar.update(void 0),this.resetCountImage(),this.popup.reset()}}}))}resetCountImage(){this.scannedImage.reset(),this.setState({image:void 0,bottomHintText:void 0})}countLabelText(t){return 0==t.length?"No codes scanned. Try again?":1==t.length?"1 Code Scanned":`${t.length} Codes Scanned`}}function ll(t,e){return t&&(t.hasFacingOptions&&e.flipCameraButton.visible||t.isTorchAvailable&&e.flashButton.visible)||e.zoomButton.visible}function cl(t){const e=t.zoomSteps.findIndex((e=>e==t.defaultZoomFactor)),[n,o]=Object(W.useState)(t.torchEnabledInitially),[i,r]=Object(W.useState)(e),a=t.zoomSteps[i],[s,l]=Object(W.useState)("BACK"==t.initialCameraModule?"environment":"user"),c=function(t){var e,n;const o=null===(n=null===(e=null==t?void 0:t.camera)||void 0===e?void 0:e.video)||void 0===n?void 0:n.parentElement,i=()=>o?o.getBoundingClientRect():null,[r,a]=Object(W.useState)(i());return Object(W.useEffect)((()=>{if(o){const t=()=>a(i());t();const e=new ResizeObserver(t);return e.observe(o),()=>{e.disconnect()}}}),[o]),r}(t.scanner),u=!!c;if(Object(W.useEffect)((()=>{var e;(null===(e=t.capabilities)||void 0===e?void 0:e.isTorchAvailable)&&u&&t.scanner.setTorchState(n)}),[t.capabilities,u,n]),Object(W.useEffect)((()=>{var e;u&&(null===(e=t.scanner)||void 0===e||e.setZoom(a))}),[u,a]),!t.capabilities||!c)return null;if(!ll(t.capabilities,t.config))return null;const d=c.height-t.bottomPadding-48;return W.default.createElement(z.Box,{style:{position:"absolute",marginTop:d,marginLeft:c.width/2,transform:"translateX(-50%)",display:"flex",justifyContent:"center",zIndex:1e3}},W.default.createElement(at,Object.assign({},t.config.flashButton,{visible:t.capabilities.isTorchAvailable&&t.config.flashButton.visible,icon:n?z.FlashlightOn:z.FlashlightOff,active:n,onClick:()=>o(!n)})),W.default.createElement("div",{style:{width:20}}),W.default.createElement(at,Object.assign({},t.config.zoomButton,{text:`${a.toFixed(1)}x`,active:i!==e,onClick:()=>r((i+1)%t.zoomSteps.length)})),W.default.createElement("div",{style:{width:20}}),W.default.createElement(at,Object.assign({},t.config.flipCameraButton,{visible:t.capabilities.hasFacingOptions&&t.config.flipCameraButton.visible,active:"user"===s,icon:z.FlipCameraIos,onClick:()=>{var e;const n="environment"===s?"user":"environment";l(n),null===(e=t.scanner)||void 0===e||e.setCameraDirection(n)}})))}const ul=Object(W.createContext)(null);class dl{static compute(t,e,n){const o=(ws.a.lowestY(t)+ws.a.highestY(t))/2,i={badgeY:o,badgeStyle:{transform:"translateX(-50%) translateY(-50%)"}};return"BELOW"===n?Object.assign(Object.assign({},i),{labelY:Math.max(ws.a.highestY(t)+dl.LABEL_AND_BADGE_PADDING,e?o-dl.AR_BADGE_SIZE/2-dl.LABEL_AND_BADGE_PADDING:-1/0),labelStyle:{transform:"translateX(-50%)"}}):"ABOVE"===n?Object.assign(Object.assign({},i),{labelY:Math.min(ws.a.lowestY(t)-dl.LABEL_AND_BADGE_PADDING,e.visible?o+dl.AR_BADGE_SIZE/2+dl.LABEL_AND_BADGE_PADDING:1/0),labelStyle:{transform:"translateX(-50%) translateY(-100%)"}}):"STACKED"===n?{badgeY:o,badgeStyle:{transform:`translateX(-50%) translateY(calc(-100% - ${dl.LABEL_AND_BADGE_PADDING/2}px))`},labelY:o,labelStyle:{transform:e.visible?`translateX(-50%) translateY(${dl.LABEL_AND_BADGE_PADDING/2}px)`:"translateX(-50%) translateY(-50%)"}}:"DISABLED"===n?Object.assign(Object.assign({},i),{labelY:0,labelStyle:{display:"none"}}):void 0}}dl.AR_BADGE_SIZE=48,dl.LABEL_AND_BADGE_PADDING=10;var hl=dl;function fl(t){return t.style.visible?""==t.content?null:W.default.createElement(Cs.div,{style:Object.assign({position:"absolute",display:"flex",justifyContent:"center",alignItems:"center",zIndex:100},t.positionBadge),animate:t.animateToPoints?t.positionBadge:{},transition:t.transition},W.default.createElement(Z,{styleConfig:Object.assign(Object.assign({},t.style.background),{cornerRadius:hl.AR_BADGE_SIZE/2}),style:Object.assign(Object.assign({},t.verticalPositions.badgeStyle),{width:hl.AR_BADGE_SIZE,height:hl.AR_BADGE_SIZE,color:V.b.getColorValue(t.style.foregroundColor),display:"flex",justifyContent:"center",alignItems:"center",zIndex:1500,cursor:"pointer"}),onClick:()=>null==t?void 0:t.onClick()},W.default.createElement(z.Typography,{fontSize:16,fontWeight:"500",style:{display:"flex",justifyContent:"center",alignItems:"center"}},t.content))):null}var pl=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};class ml extends $s{constructor(){super(...arguments),this.count=0,this.setCount=t=>{this.count=t,this.forceUpdate()}}styleBadge(t,e){this.customBadgeStyle=t,this.customBadgeContent=e,this.forceUpdate()}badgeContent(){return this.customBadgeContent?this.customBadgeContent:0===this.count?"":"x"+this.count}render(){var t,e;let{barcodeItemConfiguration:n,barcodeItemInfoPosition:o,counterBadge:i}=this.props;const r=n,a=this.state.element,s=null!==(t=this.props.animateToPoints)&&void 0!==t?t:a.points,l=a.code,c=a.highlighted,u=(ws.a.lowestX(s)+ws.a.highestX(s))/2;void 0===o&&(o="BELOW");const d=hl.compute(s,i,o),h=void 0===r||!1===r.titleDeselected.visible&&!1===r.subtitleDeselected.visible,f={x:u,y:Math.round(d.labelY)},p={x:u,y:Math.round(d.badgeY)},m={duration:.25,easing:"linear"};return W.default.createElement(W.default.Fragment,null,r&&W.default.createElement(Cs.div,{ref:t=>this.label=t,style:Object.assign(Object.assign({},f),{position:"absolute",width:"100%",zIndex:100}),animate:this.props.animateToPoints?f:{},transition:m},W.default.createElement(Z,{sx:Object.assign({p:1,maxWidth:232,cursor:"pointer",display:h?"inline-block":"block",zIndex:1500},d.labelStyle),styleConfig:c?r.backgroundSelected:r.backgroundDeselected,"data-sb-ar-barcode-info":"1",onClick:()=>{var t;return null===(t=this.props)||void 0===t?void 0:t.onClick(a)}},W.default.createElement(gl,{barcode:l,barcodeImageVisible:r.imageVisible,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,imageSize:42,displayRightArrow:!0,barcodeTitle:c?r.titleSelected:r.titleDeselected,barcodeSubtitle:c?r.subtitleSelected:r.subtitleDeselected}))),W.default.createElement(fl,{onClick:()=>{var t;return null===(t=this.props)||void 0===t?void 0:t.onClick(a)},style:null!==(e=this.customBadgeStyle)&&void 0!==e?e:i,positionBadge:p,content:this.badgeContent(),verticalPositions:d,transition:m,animateToPoints:this.props.animateToPoints}))}}function gl(t){var{barcode:e}=t,n=pl(t,["barcode"]);const o=Object(W.useContext)(ul).useBarcodeMappedData(e);return W.default.createElement(tt,Object.assign({barcodeMappedData:o},n))}var vl=n(8);function Al(t){const e=Object(W.useRef)(),n=Object(W.useRef)(null),[o,i]=(Object(W.useContext)(X),Object(W.useState)(void 0)),[r,a]=Object(W.useState)(!1);Object(W.useEffect)((()=>{var n,o;t.scanningPaused?null===(n=e.current)||void 0===n||n.pause():null===(o=e.current)||void 0===o||o.resume()}),[t.scanningPaused]);const s=function(t){const e=new Js;e.visible=t.visible;const n=t.polygon instanceof vl.c,o=t.polygon,i=t,r=n?o.selected:i.polygon.partiallyScanned,a=n?o.deselected:i.polygon.partiallyScanned;return t.polygon.visible?(e.style.highlightedPolygonFillColor=V.b.getColorValue(r.fillColor),e.style.highlightedPolygonStrokeColor=V.b.getColorValue(r.strokeColor),e.style.highlightedPolygonStrokeWidth=r.strokeWidth,e.style.highlightedPolygonCornerRadius=r.cornerRadius,e.style.polygonFillColor=V.b.getColorValue(a.fillColor),e.style.polygonStrokeColor=V.b.getColorValue(a.strokeColor),e.style.polygonStrokeWidth=a.strokeWidth,e.style.polygonCornerRadius=a.cornerRadius):(e.style.highlightedPolygonFillColor="transparent",e.style.highlightedPolygonStrokeColor="transparent",e.style.polygonFillColor="transparent",e.style.polygonStrokeColor="transparent"),e.automaticSelectionEnabled=!1,e}(t.arOverlay),l=Object.assign(Object.assign({},t.barcodeScannerViewConfig),{onBarcodesDetected:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.update(null===(a=null===(r=e.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=e.current)||void 0===s?void 0:s.camera,o.originalImageSize,o.barcodes),null===(c=(l=t.barcodeScannerViewConfig).onBarcodesDetected)||void 0===c||c.call(l,o)},_onDetectionFailed:o=>{var i,r,a,s,l,c;null===(i=n.current)||void 0===i||i.update(null===(a=null===(r=e.current)||void 0===r?void 0:r.finder)||void 0===a?void 0:a.holeRect,null===(s=e.current)||void 0===s?void 0:s.camera,new Ys.a(o.width,o.height),[]),null===(c=(l=t.barcodeScannerViewConfig)._onDetectionFailed)||void 0===c||c.call(l,o)}});return Object(W.useEffect)((()=>{const e=ll(o,t.actionBarConfig);t.setActionButtonsVisible(e),a(e)}),[o,t.actionBarConfig]),W.default.createElement(W.default.Fragment,null,t.arOverlay.visible&&W.default.createElement(Fs,{style:{zIndex:1e3,position:"absolute"},ref:n,LabelComponent:ml,labelComponentConfig:t.arOverlay,onBarcodeFound:t.arOnBarcodeEnter,onPolygonClick:t.arOnBarcodeClick,configuration:s}),W.default.createElement(cl,{config:t.actionBarConfig,scanner:e.current,capabilities:o,bottomPadding:t.actionBarBottomPadding,torchEnabledInitially:t.cameraConfiguration.flashEnabled,zoomSteps:t.cameraConfiguration.zoomSteps,defaultZoomFactor:t.cameraConfiguration.defaultZoomFactor,initialCameraModule:t.cameraConfiguration.cameraModule}),W.default.createElement(sl,{ref:e,viewFinderPadding:t.viewFinderPadding,configuration:l,onSuccess:()=>class{static setFromScanner(t,e){var n;if(!t.current)return;const o=t.current.getCapabilities();e({hasFacingOptions:(null==o?void 0:o.facingMode)&&o.facingMode.length>0,isTorchAvailable:null!==(n=t.current.getActiveCameraInfo().supportsTorchControl)&&void 0!==n&&n})}}.setFromScanner(e,i),onFailure:t.onCameraPermissionDenied,onLicenseError:t.onLicenseError}))}function bl(t){return Object(W.useMemo)((()=>{const e=(new nl).videoConstraints;return e.width.ideal=t.cameraConfiguration.idealPreviewResolution.width,e.height.ideal=t.cameraConfiguration.idealPreviewResolution.height,e.facingMode="FRONT"===t.cameraConfiguration.cameraModule?"user":"environment",{videoConstraints:e,backgroundColor:V.b.getColorValue(t.backgroundColor),userGuidance:t.userGuidance,finder:t.viewFinder,detectionParameters:new T.BarcodeScannerTypes.BarcodeScannerConfiguration({live:!0,engineMode:t.recognizerConfiguration.engineMode,barcodeFormatConfigurations:[new T.BarcodeConfigs.BarcodeFormatCommonConfiguration({formats:t.recognizerConfiguration.barcodeFormats.length>0?t.recognizerConfiguration.barcodeFormats:void 0,regexFilter:t.recognizerConfiguration.barcodesRegexFilter,gs1Handling:t.recognizerConfiguration.gs1Handling})]}),desiredRecognitionResolution:t.recognizerConfiguration.maximumRecognizerResolution}}),[t])}var yl=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};function Cl(t){const[e,n]=Object(W.useState)(null),[o,i]=Object(W.useState)(!0),r=Object(W.useMemo)((()=>"__sb_"+Math.random()),[]),a=t.barcodeMapper,s=t.configuration.useCase,l=Object.assign(Object.assign({},bl(t.configuration)),{onBarcodesDetected:e=>{e.barcodes.length>0&&!s.arOverlay.visible&&t.scanningEnabled.current&&n(e.barcodes[0])},onError:t.onError,containerId:r,captureDelay:0}),c=n=>yl(this,void 0,void 0,(function*(){let o;o=null===e?[]:[new j.BarcodeScannerUIItem({count:1,barcode:n})];const i={items:o};t.onSubmit(i)}));Object(W.useEffect)((()=>{e&&(ct.INSTANCE.beep(t.configuration.sound),dt.INSTANCE.vibrate(t.configuration.vibration))}),[e]),Object(W.useEffect)((()=>{null===e||s.confirmationSheetEnabled||c(e)}),[e,s.confirmationSheetEnabled]);const u=a.useBarcodeMappedData(e);Object(W.useEffect)((()=>{"FAILED"===(null==u?void 0:u.state)&&n(null)}),[null==u?void 0:u.state]);const d=Object(W.useContext)(X);return W.default.createElement(W.default.Fragment,null,W.default.createElement(ul.Provider,{value:t.barcodeMapper},W.default.createElement(it,Object.assign({open:!!u&&["LOADED","LOADING"].includes(u.state)&&s.confirmationSheetEnabled,handleCancel:()=>{n(null)},handleSubmit:()=>{c(e)},barcodeMappedData:u},{sheetColorLoaded:(h=s).sheetColor,sheetColorLoading:h.barcodeInfoMapping.sheetColor,barcodeImageVisible:h.barcodeImageVisible,barcodeTitle:h.barcodeTitle,barcodeSubtitle:h.barcodeSubtitle,cancelButton:h.cancelButton,submitButton:h.submitButton,dividerColor:h.dividerColor,loadingMessage:h.barcodeInfoMapping.loadingMessage},{displayRightArrow:!1,modalOverlayColor:s.modalOverlayColor})),W.default.createElement(z.Box,{id:r,sx:{width:"100%",height:d.remainingVisibleBodyHeight}},W.default.createElement(Al,{cameraConfiguration:t.configuration.cameraConfiguration,scanningPaused:null!==e,setActionButtonsVisible:i,viewFinderPadding:{minTopPadding:d.minTopPaddingForViewFinder,minBottomPadding:o?80:0},barcodeScannerViewConfig:l,arOnBarcodeClick:t=>n(t),arOnBarcodeEnter:e=>{s.arOverlay.automaticSelectionEnabled&&t.scanningEnabled.current&&n(e)},arOverlay:Object.assign(Object.assign({},s.arOverlay),{counterBadge:Object.assign(Object.assign({},s.arOverlay.counterBadge),{visible:!1})}),containerId:r,actionBarConfig:t.configuration.actionBar,actionBarBottomPadding:16,onCameraPermissionDenied:t.onCameraPermissionDenied,onLicenseError:t.onError}))));var h}function Sl(t){const e=Object.assign(Object.assign({},t.title),{text:V.b.getLocalizedBarcodeText(t.title.text,t.textReplacementArgs)});return W.default.createElement(W.default.Fragment,null,W.default.createElement(q,Object.assign({},t.leftButton)),W.default.createElement(z.Typography,{sx:{flex:2,textAlign:"center",fontWeight:600,fontSize:18}},W.default.createElement(Q.a,{config:e})),W.default.createElement(q,Object.assign({},t.rightButton)))}function wl(){return W.default.createElement("div",{style:{width:30,height:6,backgroundColor:z.grey[300],borderRadius:3,position:"absolute",top:8,left:"calc(50% - 15px)"},"data-sb-drawer-puller":"1"})}function xl(t){return W.default.createElement(z.Box,Object.assign({sx:{display:"flex",width:"100%",alignItems:"center",justifyContent:"center",paddingTop:2,paddingBottom:1,touchAction:"none"},ref:t.innerRef},t.dragProps),W.default.createElement(wl,null),W.default.createElement(Sl,Object.assign({},t.drawerHeaderContentProps)))}function El(t){return W.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"41",height:"38",viewBox:"0 0 41 38",fill:"none"},W.default.createElement("path",{d:"M4.09514 37.0902V10.6304L0.019043 1.87823L3.18969 0.348877L7.76144 10.6304H32.6886L37.2484 0.348877L40.419 1.87823L36.3549 10.6304V37.0902H4.09514ZM15.994 22.013H24.494C24.9461 22.013 25.3211 21.8632 25.619 21.5637C25.9169 21.2641 26.0658 20.8871 26.0658 20.4325C26.0658 19.9779 25.9169 19.6038 25.619 19.3101C25.3211 19.0164 24.9461 18.8695 24.494 18.8695H15.994C15.5419 18.8695 15.167 19.0193 14.8691 19.3189C14.5712 19.6184 14.4223 19.9955 14.4223 20.45C14.4223 20.9046 14.5712 21.2788 14.8691 21.5725C15.167 21.8662 15.5419 22.013 15.994 22.013ZM7.50164 33.6837H32.9364V14.0489H7.50164V33.6837Z",fill:t.color}))}function Ll(t){return t.isVisible?W.default.createElement("div",{style:{display:"flex",alignItems:"center",flexDirection:"column",marginTop:"auto",marginBottom:"auto",overflowY:"scroll"}},t.style.placeholderIcon.visible&&W.default.createElement(z.Avatar,{style:{backgroundColor:V.b.getColorValue(t.style.placeholderIconBackground),width:100,height:100}},W.default.createElement(El,{color:V.b.getColorValue(t.style.placeholderIcon.color)})),W.default.createElement(z.Typography,{style:{marginTop:20},variant:"h6"},W.default.createElement(Q.a,{config:t.style.placeholderTitle})),W.default.createElement(z.Typography,{style:{marginTop:20,paddingLeft:"10%",paddingRight:"10%",maxWidth:400,textAlign:"center"},variant:"body2"},W.default.createElement(Q.a,{config:t.style.placeholderSubtitle})),t.onStartClick&&t.style.startScanningButton.visible&&W.default.createElement(et,Object.assign({style:{width:"60%",marginTop:20}},t.style.startScanningButton,{visible:!0,onClick:t.onStartClick}))):null}function _l(t,e,n){const o=Object(W.useRef)(),i=Object(W.useRef)(null),[r,a]=Object(W.useState)(),[s,l]=Object(W.useState)(!1),c=Object(W.useRef)([]),u=t=>{let n="none";if(c.current.length>0){const e=200,o=((t,e)=>{let n=t[0],o=Math.abs(n.time-e);for(let i=1;i<t.length;i++){const r=Math.abs(t[i].time-e);r<o&&(n=t[i],o=r)}return n})(c.current,t.timeStamp-e),i=o.y-t.clientY,r=100;i>r?n="up":i<-r&&(n="down")}c.current.splice(0,c.current.length),e(new ws.a(t.clientX,t.clientY),n)},d={onPointerDown:t=>{t.target.setPointerCapture(t.pointerId),l(!0),i.current=new ws.a(t.clientX,t.clientY),a(ws.a.empty()),t.stopPropagation()},onPointerMove:e=>{if(!s)return;const n=new ws.a(e.clientX,e.clientY);o.current=e,a(n),t(n),c.current.push({x:e.clientX,y:e.clientY,time:e.timeStamp})},onPointerUp:t=>{t.target.releasePointerCapture(t.pointerId),l(!1),u(t)},onPointerCancel:t=>{t.target.releasePointerCapture(t.pointerId),l(!1),n()}};return{startPoint:i,currentPoint:r,props:d,stop:()=>{o.current.stopPropagation()},dragOngoing:s}}var Ol=n(31);function Tl(t){const[e,n]=Object(W.useState)(0),[o,i]=Object(W.useState)(!1),r=Object(W.useRef)(null),a=Object(W.useContext)(X).height,s=t=>{n(t),i(!0),setTimeout((()=>{i(!1)}),500)},l=e=>{const n=e-c.startPoint.current.y;return Object(Ol.a)((t.isOpen?100:0)-100*n/(window.innerHeight-a-t.closedSheetVisibleHeight),0,100)},c=_l((t=>{n(l(t.y))}),((e,n)=>{if(e.y===c.startPoint.current.y)return;let o;o=l(e.y)<50?"swipe-to-close":"swipe-to-open","up"===n&&(o="swipe-to-open"),"down"===n&&(o="swipe-to-close"),t.onSwipe(o)}),(()=>{}));return Object(W.useEffect)((()=>{o||c.dragOngoing||!r||(t.isOpen||0===e?t.isOpen&&100!==e&&s(100):s(0))}),[t.isOpen,e,c.dragOngoing]),W.createElement("div",null,W.createElement(N.a,{variant:"persistent",anchor:"bottom",open:!0,onClose:()=>{},onOpen:()=>{},swipeAreaWidth:56,disableSwipeToOpen:!1,ModalProps:{keepMounted:!0},PaperProps:{style:{height:`calc((100 * ${U} - ${a}px - ${t.closedSheetVisibleHeight}px) * ${e} / 100 + ${t.closedSheetVisibleHeight}px)`,overflow:"hidden",borderRadius:10,borderBottomLeftRadius:0,borderBottomRightRadius:0,transition:o?"height 500ms":void 0,backgroundColor:V.b.getColorValue(t.contentStyle.sheetColor)},elevation:24}},W.createElement(xl,{innerRef:t=>{r.current=t},drawerHeaderContentProps:t.drawerHeaderContentProps,dragProps:c.props}),t.children,W.createElement(Ll,{isVisible:t.isPlaceholderVisible,style:t.contentStyle,onStartClick:()=>t.onSwipe("swipe-to-close")})))}var kl=function(t,e){var n={};for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&e.indexOf(o)<0&&(n[o]=t[o]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(o=Object.getOwnPropertySymbols(t);i<o.length;i++)e.indexOf(o[i])<0&&Object.prototype.propertyIsEnumerable.call(t,o[i])&&(n[o[i]]=t[o[i]])}return n};function Dl(t){var{inputRef:e}=t,n=kl(t,["inputRef"]);const o=Object.assign(Object.assign({},n),{style:Object.assign(Object.assign({},n.style||{}),{border:"none",display:"block",outlineWidth:0,width:"100%"})});return W.default.createElement("input",Object.assign({},o,{ref:e}))}function Pl(t){const e=!!t.barcode,[n,o]=W.default.useState(""),i=W.default.useRef(null),r={backgroundColor:V.b.getColorValue(t.dialogStyling.sheetColor)};return Object(W.useEffect)((()=>{e&&o(String(t.barcode.count))}),[e]),W.default.createElement(W.default.Fragment,null,W.default.createElement(ot,{open:e,modalOverlayColor:t.dialogStyling.modalOverlayColor,TransitionProps:{onEnter:()=>{var t;return null===(t=i.current)||void 0===t?void 0:t.focus()}},onClose:t.onCancel,PaperProps:{component:"form",onSubmit:e=>{e.preventDefault(),t.setCounter(t.barcode.barcode,parseInt(n)||0)}}},W.default.createElement(z.DialogContent,{style:r},W.default.createElement(z.Typography,{fontSize:16,fontWeight:500,textAlign:"center"},W.default.createElement(Q.a,{config:t.dialogStyling.title})),W.default.createElement(z.Typography,{fontSize:14,textAlign:"center"},W.default.createElement(Q.a,{config:t.dialogStyling.info})),W.default.createElement(z.Box,{sx:{display:"flex",border:"2px solid",borderColor:V.b.getColorValue(t.dialogStyling.dividerColor),mh:2,mb:0,p:1,borderRadius:1}},W.default.createElement(Dl,{inputRef:i,value:n,onChange:t=>{const e=parseInt(t.target.value.replaceAll(/[^0-9]/g,""));o(e>=0?e.toString():"")},type:"text",pattern:"[0-9]*"}),t.dialogStyling.clearTextButton.visible&&W.default.createElement(N.a,{sx:{marginLeft:"auto",paddingLeft:1},onClick:()=>o(""),htmlColor:V.b.getColorValue(t.dialogStyling.clearTextButton.color)}))),W.default.createElement(z.DialogActions,{sx:Object.assign(Object.assign({},r),{pt:0})},W.default.createElement(N.a,{container:!0,spacing:2},W.default.createElement(N.a,{item:!0,xs:12},W.default.createElement(N.a,{color:V.b.getColorValue(t.dialogStyling.dividerColor)})),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},onClick:t.onCancel},t.dialogStyling.cancelButton))),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({icon:z.Replay,style:{width:"100%"},onClick:()=>{},type:"submit"},t.dialogStyling.updateButton)))))))}function Bl(t){return W.default.createElement("div",{style:{top:0,width:"100%",marginTop:"1px",marginLeft:"1px",height:"calc(100% - 2px)",position:"absolute",backgroundColor:V.b.getColorValue(t.config.backgroundColor),display:"flex",alignItems:"right",justifyContent:"right"}},W.default.createElement(N.a,{style:{height:"100%",color:V.b.getColorValue(t.config.iconColor),paddingRight:t.visibleOffset/2,cursor:"pointer"}}))}const Fl=0,Rl=800,Il=1200;function Wl(t){switch(t){case"mobile":return Object(z.useMediaQuery)("(min-width:"+Fl+"px) and (max-width:"+(Rl-1)+"px)");case"tablet":return Object(z.useMediaQuery)("(min-width:"+Rl+"px) and (max-width:"+(Il-1)+"px)");case"desktop":return Object(z.useMediaQuery)("(min-width:"+Il+"px)")}}const Ml=150;function jl(t){const[e,n]=Object(W.useState)(0),[o,i]=Object(W.useState)(!1);let r;const a=_l((t=>{let e=a.startPoint.current.x-t.x;e<0?a.stop():n(-e)}),(e=>{if(e.x===a.startPoint.current.x)return;if(a.startPoint.current.x-e.x>75){const e=t.animateBackAfterDelete?()=>{c(0)}:void 0;c(Ml,e)}else c(0)}),(()=>{c(0)})),s=Object(W.useContext)(ul),l=s.useBarcodeMappedData(t.barcode);Object(W.useEffect)((()=>{const e={barcode:t.barcode,callback:()=>t.onDelete(t.barcode)};return s.addOnEvictionListener(e),()=>{s.removeOnEvictionListener(e)}}),[]);const c=(e,o)=>{const a=e>=Ml,s=-r.getBoundingClientRect().width;n(a?s:0),i(!0),setTimeout((()=>{i(!1),a&&t.onDelete(t.barcode),o&&o()}),200)},u=Wl("desktop")&&t.swipeToDeleteConfig.enabled,d=!u&&t.swipeToDeleteConfig.enabled;return Object(W.useEffect)((()=>{d||c(0)}),[d]),W.default.createElement(z.Box,{sx:{px:2},style:{width:"100%",paddingRight:0},ref:t=>{t&&(r=t)}},W.default.createElement(Bl,{config:t.swipeToDeleteConfig,visibleOffset:Ml}),W.default.createElement(z.Box,Object.assign({sx:{width:"100%",backgroundColor:V.b.getColorValue(t.sheetColor),transform:`translateX(${e}px)`,transition:o?"transform 200ms ease-in-out":void 0,touchAction:"pan-y",display:"flex",alignItems:"center",paddingTop:"16px",paddingBottom:"16px",columnGap:"16px"}},d?a.props:{}),W.default.createElement(tt,Object.assign({barcodeMappedData:l},t)),null!==t.readonlyCount&&W.default.createElement(z.Box,{sx:{fontSize:18,marginTop:"auto",flex:1,textAlign:"right",color:V.b.getColorValue("?sbColorOnSurfaceVariant")}},"x",t.readonlyCount),u&&W.default.createElement(N.a,{sx:{height:"100%",marginLeft:"auto",cursor:"pointer",color:V.b.getColorValue("?sbColorOnSurface")},onClick:()=>t.onDelete(t.barcode)}),W.default.createElement(z.Box,{sx:{width:"0px"}})))}function zl(t){const e=V.b.getColorValue(t.sheetContent.dividerColor),n=t.sheetContent.manualCountChangeEnabled&&"COUNTING"===t.mode,o=(e,n)=>{let o=t.indicatorColor.partial;return n===e.count?o=t.indicatorColor.complete:0===n&&(o=t.indicatorColor.notScanned),V.b.getColorValue(o)};return W.default.createElement(W.default.Fragment,null,W.default.createElement(z.Divider,{style:{borderColor:e}}),t.barcodes.length>0&&W.default.createElement(N.a,{sx:{width:"auto",flex:1,overflowY:"auto",overflowX:"hidden"},role:"presentation"},W.default.createElement(N.a,{sx:{p:0}},t.barcodes.map((({barcode:i,count:r},a)=>{const s=t.expectedBarcodes.find((t=>t.barcodeValue===i.text));return W.default.createElement(N.a,{key:a,sx:{padding:0,borderBottom:`1px solid ${e}`}},t.indicatorColor&&W.default.createElement("div",{style:{display:"flex",width:4,height:"100%",backgroundColor:o(s,r),position:"absolute"}}),W.default.createElement(jl,{barcode:i,animateBackAfterDelete:t.animateBackAfterDelete,onDelete:()=>t.onBarcodeChange({type:"remove",barcode:i}),counterForm:n&&{counter:r,manualCountChangeColor:t.sheetContent.manualCountChangeColor,manualCountOutlineColor:t.sheetContent.manualCountOutlineColor,addButtonEnabled:void 0===s||s.count>r,removeButtonEnabled:void 0===s||r>0,setCounter:e=>{t.onBarcodeChange({type:"setCount",barcodes:[i],computeNewCount:()=>e})},onNumberClick:()=>t.onNumberClick({barcode:i,count:r})},readonlyCount:"COUNTING"!==t.mode||t.sheetContent.manualCountChangeEnabled?null:r,maxNumberOfTitleLines:1,maxNumberOfSubtitleLines:1,displayRightArrow:!1,imageSize:n?84:40,barcodeImageVisible:t.sheetContent.barcodeItemImageVisible,barcodeTitle:t.sheetContent.barcodeItemTitle,barcodeSubtitle:t.sheetContent.barcodeItemSubtitle,swipeToDeleteConfig:t.sheetContent.swipeToDelete,sheetColor:t.sheetContent.sheetColor}))})))))}function Nl(t){return W.default.createElement(z.Badge,{anchorOrigin:{vertical:"top",horizontal:"left"},badgeContent:t.text,showZero:!0,color:"primary",overlap:"circular",slotProps:{badge:{style:{backgroundColor:t.backgroundColor,color:t.foregroundColor,fontWeight:"bold"}}}},t.children)}function Vl(t){if(!t.buttonStyling.visible)return null;return W.default.createElement(z.Box,{style:t.style},W.default.createElement(Nl,{text:t.text,backgroundColor:V.b.getColorValue(t.buttonStyling.badgeBackgroundColor),foregroundColor:V.b.getColorValue(t.buttonStyling.badgeForegroundColor)},W.default.createElement(z.IconButton,{sx:{backgroundColor:V.b.getColorValue(t.buttonStyling.backgroundColor),width:60,height:60,"&:hover, &:focus":{backgroundColor:V.b.getColorValue(t.buttonStyling.activeBackgroundColor),outline:"none"}},onClick:t.onClick,disableRipple:!0,disableFocusRipple:!0},W.default.createElement(N.a,{sx:{color:V.b.getColorValue(t.buttonStyling.foregroundColor),fontSize:"24pt","&:hover, &:focus":{color:V.b.getColorValue(t.buttonStyling.activeForegroundColor)}}}))))}const Ul=(t,e)=>(null===t.format||null===e.format||t.format===e.format)&&t.text===e.text,Hl=(t,e)=>t.find((t=>((t,e)=>t.barcodeValue===e.text)(t,e)));class Gl{constructor(t,e){this.expectedCount=t,this.foundCount=e}isFulFilled(){return void 0!==this.expectedCount&&void 0!==this.foundCount&&this.expectedCount===this.foundCount}toString(){return`${this.foundCount}/${this.expectedCount}`}}function Ql(t){const e=Object(W.useContext)(V.a).getColorValue,n={backgroundColor:e(t.sheetColor)};return W.default.createElement(ot,{modalOverlayColor:t.modalOverlayColor,open:t.open},W.default.createElement(z.DialogContent,{sx:Object.assign(Object.assign({},n),{p:2,pb:1,textAlign:"center"})},W.default.createElement(z.Typography,{sx:{fontSize:"16pt",fontWeight:"bold"}},W.default.createElement(Q.a,{config:t.title})),W.default.createElement(z.Typography,{sx:{fontSize:"14pt",lineHeight:"16pt"}},W.default.createElement(Q.a,{config:t.subtitle}))),W.default.createElement(z.DialogActions,{sx:Object.assign(Object.assign({},n),{pt:1})},W.default.createElement(N.a,{container:!0,spacing:2},W.default.createElement(N.a,{item:!0,xs:12},W.default.createElement(N.a,{color:e(t.dividerColor)})),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},icon:t.cancelButton.icon,onClick:t.cancelButton.onClick},t.cancelButton.style))),W.default.createElement(N.a,{item:!0,xs:6},W.default.createElement(et,Object.assign({style:{width:"100%"},icon:t.okButton.icon,onClick:t.okButton.onClick},t.okButton.style))))))}function Yl(t){return t.open?W.default.createElement(Ql,{open:t.open,dividerColor:t.style.dividerColor,modalOverlayColor:t.style.modalOverlayColor,sheetColor:t.style.sheetColor,title:t.style.title,subtitle:t.style.subtitle,cancelButton:{style:t.style.cancelButton,onClick:t.onDismiss},okButton:{style:t.style.okButton,onClick:t.onSubmit}}):null}class Zl{constructor(t,e,n){this.barcodeItemSubtitleText=t,this.foundBarcodes=e,this.expectedBarcodes=n}useBarcodeMappedData(t){var e,n,o;const i=null!==(n=null===(e=this.foundBarcodes.find((e=>Ul(e.barcode,t))))||void 0===e?void 0:e.count.toString())&&void 0!==n?n:"0",r=Hl(this.expectedBarcodes,t);return{state:"LOADED",value:{title:`${null!==(o=r.title)&&void 0!==o?o:t.text}`,subtitle:V.b.getLocalizedBarcodeText(this.barcodeItemSubtitleText,[i,null==r?void 0:r.count.toString()]),barcodeImage:r.image}}}addOnEvictionListener(){}removeOnEvictionListener(){}}function ql(t){const e=Object(W.useContext)(X);return W.default.createElement(N.a,{item:!0,xs:5,component:"div",zIndex:1050,style:{paddingTop:e.minTopPaddingForContent,height:"100%",flexDirection:"column",display:"flex",backgroundColor:V.b.getColorValue(t.sheetContent.sheetColor)}},W.default.createElement(N.a,{sx:{display:"flex",justifyContent:"center",alignItems:"center"},zIndex:50},W.default.createElement(Sl,Object.assign({},t.headerProps))),t.barcodeList,W.default.createElement(Ll,{isVisible:t.isEmptyStateVisible,style:t.sheetContent}))}var Xl=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};function $l(t){const e=Object(W.useRef)(),n=Object(W.useRef)(new Date("2001-01-01")),[o,i]=Object(W.useReducer)(function(t,e,n,o){return(i,r)=>{const a=t.useCase,s="FindAndPickScanningMode"===a._type,l=s?"COUNTING":a.mode,c=s?a.expectedBarcodes:[],u=t=>{let e=[...i];const n=r.barcodes||[r.barcode];for(const o of n){const n=e.findIndex((t=>Ul(t.barcode,o)));if(-1===n)e.push({barcode:o,count:t(0)});else{const o=e[n];e[n]=Object.assign(Object.assign({},o),{count:t(o.count,o)})}}return e},d=(t,n)=>{var i;if(e.current=new Date,!n)return t;const r=null===(i=Hl(c,n.barcode))||void 0===i?void 0:i.count;return void 0===r||r===t?t:(o(),t+1)};switch(r.type){case"onBarcodesDetected":{if((new Date).getTime()-e.current.getTime()<a.countingRepeatDelay||!n.current)return[...i];if(s)return a.arOverlay.automaticSelectionEnabled?u(d):[...i];const t=a.arOverlay;if(!t.visible||t.automaticSelectionEnabled){let t=!1;return u((n=>{let i="COUNTING"===l?n+1:1;return i===n||t||(e.current=new Date,o()),i}))}return u((t=>t))}case"onARCodeClick":return u(((t,e)=>{if(s)return d(t,e);const n="UNIQUE"===l?1-t:t+1;return n>0&&o(),n}));case"onCountEditDialogChange":{let t=()=>r.count||0;if(s){const e=Hl(c,r.barcode);r.count>e.count&&(t=()=>e.count)}return u(t)}case"setCount":return u(r.computeNewCount);case"remove":return i.map((t=>Object.assign(Object.assign({},t),{count:Ul(t.barcode,r.barcode)?0:t.count})));case"clear":return i.map((t=>Object.assign(Object.assign({},t),{count:0})));case"setHtmlElements":let t=!1;const h=i.map((e=>Ul(e.barcode,r.barcode)?(t=!0,Object.assign(Object.assign({},e),{polygonElement:r.polygonElement,labelElement:r.labelElement})):e));return t||h.push({barcode:r.barcode,count:0,labelElement:r.labelElement,polygonElement:r.polygonElement}),h}}}(t.configuration,n,t.scanningEnabled,(()=>{ct.INSTANCE.beep(t.configuration.sound),dt.INSTANCE.vibrate(t.configuration.vibration)})),[]),[r,a]=W.default.useState(null),[s,l]=Object(W.useState)(!1),c=Object(W.useMemo)((()=>"__sb_"+Math.random()),[]),[u,d]=Object(W.useState)(!0),h=t.barcodeMapper,[f,p]=Object(W.useState)(null),m="FindAndPickScanningMode"===t.configuration.useCase._type,g=t.configuration.useCase,v=m?"COUNTING":g.mode,A=Object(W.useRef)(Object.assign(Object.assign({},bl(t.configuration)),{onBarcodesDetected:t=>{i({type:"onBarcodesDetected",barcodes:t.barcodes})},_onDetectionFailed(t){},onError:t.onError,captureDelay:1e3/60}));Object(W.useEffect)((()=>{if(m){const e=C();for(const n of e){const e=[(t=n.barcodeValue,new T.BarcodeScannerTypes.BarcodeItem({text:t,format:null,quad:[],sourceImage:null,rawBytes:null,upcEanExtension:null,parsedDocument:null}))];i({type:"setCount",barcodes:e,computeNewCount:()=>0})}}var t}),[]),Object(W.useEffect)((()=>{A.current.container=e.current}),[e]),Object(W.useEffect)((()=>{if(m)for(const t of o){const e=g.arOverlay,n=t.polygonElement,o=t.labelElement;if(w(t.barcode)){const i=R(t.barcode);let r=t.count+"/"+i.expectedCount;g.arOverlay.automaticSelectionEnabled||0!==t.count||(r=W.default.createElement(z.TouchApp,null)),i.isFulFilled()?(null==n||n.style(V.b.getPolygonColorValues(e.polygon.completed,e.polygon.visible)),null==o||o.styleBadge(e.badge.completed,W.default.createElement(z.Check,null))):(null==n||n.style(V.b.getPolygonColorValues(e.polygon.partiallyScanned,e.polygon.visible)),null==o||o.styleBadge(e.badge.partiallyScanned,r))}else null==n||n.style(V.b.getPolygonColorValues(e.polygon.rejected,e.polygon.visible)),null==o||o.styleBadge(e.badge.rejected,W.default.createElement(z.Close,null))}else for(const t of o){if(t.polygonElement){const e=g.arOverlay.polygon,n=t.count>0?e.selected:e.deselected;t.polygonElement.style(V.b.getPolygonColorValues(n,e.visible))}t.labelElement&&(t.labelElement.update(Object.assign(Object.assign({},t.labelElement.state.element),{highlighted:t.count>0})),t.labelElement.setCount(t.count))}}),[o]);const b=o.reduce(((t,e)=>t+e.count),0),y=()=>C().every((t=>o.some((e=>e.barcode.text===t.barcodeValue&&e.count===t.count)))),C=()=>m?g.expectedBarcodes:[],S=t=>Hl(C(),t),w=t=>!!S(t),x=()=>m?o.filter((t=>w(t.barcode))):o.filter((t=>t.count>0)),E=()=>Xl(this,void 0,void 0,(function*(){const e=x().map((t=>new j.BarcodeScannerUIItem({count:"COUNTING"===v?t.count:1,barcode:t.barcode})));t.onSubmit({items:e})})),L=W.default.createElement(zl,{expectedBarcodes:C(),barcodes:x(),animateBackAfterDelete:m,onBarcodeChange:i,sheetContent:g.sheetContent,onNumberClick:t=>a(t),mode:v,indicatorColor:m&&{partial:g.scanningPartiallyColor,complete:g.scanningCompletedColor,notScanned:g.scanningNotScannedColor}}),_={textReplacementArgs:[b.toString()],leftButton:Object.assign(Object.assign({},g.sheetContent.clearAllButton),{onClick:()=>i({type:"clear"})}),rightButton:Object.assign(Object.assign({},g.sheetContent.submitButton),{onClick:()=>Xl(this,void 0,void 0,(function*(){if(m){const t=g;let e=null;t.partialScannedAlertDialogEnabled&&!y()&&(e=t.partialScannedAlertDialog),t.confirmationAlertDialogEnabled&&y()&&(e=t.confirmationAlertDialog),e?p(e):yield E()}else yield E()}))}),title:g.sheetContent.title},O=Wl("mobile"),k="BUTTON"!==g.sheet.mode&&O?"SMALL"===g.sheet.collapsedVisibleHeight?69:128:0,D=O&&"BUTTON"===g.sheet.mode,P=D?76:0,B=(u?80:0)+P,F=Object(W.useContext)(X),R=t=>{const e=o.find((e=>e.barcode.text===t.text)),n=S(t);return new Gl(null==n?void 0:n.count,null==e?void 0:e.count)},I=C().reduce(((t,e)=>t+e.count),0);m&&_.textReplacementArgs.push(I.toString());const M=m?new Zl(g.sheetContent.barcodeItemSubtitle.text,o,C()):h,U=!m&&0===b;return W.default.createElement(W.default.Fragment,null,W.default.createElement(ul.Provider,{value:M},W.default.createElement(N.a,{container:!0,sx:{display:"flex",flexDirection:O?"column":"row",height:`calc(${F.remainingVisibleBodyHeight} - ${k}px)`},alignItems:"stretch"},W.default.createElement(N.a,{id:c,item:!0,ref:e,component:"div",xs:O?12:7,zIndex:100},D&&W.default.createElement(Vl,{style:{position:"absolute",marginTop:`calc(${F.remainingVisibleBodyHeight} - 60px - 8px)`,width:"100%",display:"flex",justifyContent:"center",zIndex:1100},text:m?`${b}/${I}`:b.toString(),onClick:()=>l(!s),buttonStyling:g.sheet.listButton}),W.default.createElement(Al,{viewFinderPadding:{minTopPadding:F.minTopPaddingForContent,minBottomPadding:B},arOverlay:(()=>{if(m){const t=g.arOverlay;return Object.assign(Object.assign({},t),{counterBadge:Object.assign({},t.badge.partiallyScanned)})}const t=g.arOverlay,e=t.counterBadge;return Object.assign(Object.assign({},t),{counterBadge:Object.assign(Object.assign({},e),{visible:e.visible&&"COUNTING"===v})})})(),containerId:c,barcodeScannerViewConfig:A.current,onCameraPermissionDenied:t.onCameraPermissionDenied,actionBarConfig:t.configuration.actionBar,actionBarBottomPadding:16+P,setActionButtonsVisible:d,arOnBarcodeClick:t=>{i({type:"onARCodeClick",barcode:t})},arOnBarcodeEnter:(t,e,n)=>{if(!n||!e)return;i({type:"setHtmlElements",barcode:t,labelElement:n,polygonElement:e})},scanningPaused:s&&O,cameraConfiguration:t.configuration.cameraConfiguration,onLicenseError:t.onError}),O&&W.default.createElement(Tl,{closedSheetVisibleHeight:k,sheetStyle:g.sheet,contentStyle:g.sheetContent,manualCountEditDialog:g.manualCountEditDialog,isPlaceholderVisible:U,onBarcodeChange:t=>i(t),drawerHeaderContentProps:_,isOpen:s,onSwipe:t=>{l("swipe-to-open"===t)}},L)),function(t){switch(t){case"mobile":return Object(z.useMediaQuery)("(min-width:"+Fl+"px)");case"tablet":return Object(z.useMediaQuery)("(min-width:"+Rl+"px)");case"desktop":return Object(z.useMediaQuery)("(min-width:"+Il+"px)")}}("tablet")&&W.default.createElement(ql,{headerProps:_,sheetContent:g.sheetContent,isEmptyStateVisible:U,barcodeList:L})),W.default.createElement(Pl,{barcode:r,dialogStyling:g.manualCountEditDialog,onCancel:()=>a(null),setCounter:(t,e)=>{i({type:"onCountEditDialogChange",barcode:t,count:e}),a(null)}}),W.default.createElement(Yl,{open:null!==f,style:f,onDismiss:()=>p(null),onSubmit:E})))}const Kl=Object(W.createContext)(null),Jl={didCatch:!1,error:null};class tc extends W.Component{constructor(t){super(t),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=Jl}static getDerivedStateFromError(t){return{didCatch:!0,error:t}}resetErrorBoundary(){const{error:t}=this.state;if(null!==t){for(var e,n,o=arguments.length,i=new Array(o),r=0;r<o;r++)i[r]=arguments[r];null===(e=(n=this.props).onReset)||void 0===e||e.call(n,{args:i,reason:"imperative-api"}),this.setState(Jl)}}componentDidCatch(t,e){var n,o;null===(n=(o=this.props).onError)||void 0===n||n.call(o,t,e)}componentDidUpdate(t,e){const{didCatch:n}=this.state,{resetKeys:o}=this.props;var i,r;n&&null!==e.error&&function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.length!==e.length||t.some(((t,n)=>!Object.is(t,e[n])))}(t.resetKeys,o)&&(null===(i=(r=this.props).onReset)||void 0===i||i.call(r,{next:o,prev:t.resetKeys,reason:"keys"}),this.setState(Jl))}render(){const{children:t,fallbackRender:e,FallbackComponent:n,fallback:o}=this.props,{didCatch:i,error:r}=this.state;let a=t;if(i){const t={error:r,resetErrorBoundary:this.resetErrorBoundary};if("function"==typeof e)a=e(t);else if(n)a=Object(W.createElement)(n,t);else{if(null!==o&&!Object(W.isValidElement)(o))throw r;a=o}}return Object(W.createElement)(Kl.Provider,{value:{didCatch:i,error:r,resetErrorBoundary:this.resetErrorBoundary}},a)}}function ec(t){const e=Object(W.useRef)(!0);Object(W.useEffect)((()=>(e.current=!0,()=>{e.current=!1})));const[,n]=Object(W.useReducer)((t=>t+1),0),o=Object(W.useRef)();return Object(W.useMemo)((()=>{o.current={loading:!0,value:void 0,error:null}}),[t]),function(t,e){Object(W.useMemo)((()=>{t&&t.then((t=>{e({loading:!1,error:null,value:t})})).catch((t=>{e({loading:!1,error:{reason:t},value:void 0})}))}),[t])}(t,(t=>{o.current=t,e.current&&n()})),t?o.current:null}var nc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class oc{constructor(t,e){this.barcodeItemMapper=t,this.onError=e,this.cache=new Map,this.cacheEntryPendingRetries=[],this.hash=t=>At(t),this.onEvictionListeners=new Set}getBarcodeMappedData(t){const e=this.hash(t);if(!this.cache.has(e)){const n=(()=>nc(this,void 0,void 0,(function*(){if(this.barcodeItemMapper){const e=new j.BarcodeScannerUIItem({count:1,barcode:t});return this.barcodeItemMapper(e)}{const e=yield b.toDataUrl(yield mu.instance.imageToJpeg(t.sourceImage));return{title:t.text,subtitle:t.format,barcodeImage:e}}})))();this.cache.set(e,n)}return this.cache.get(e)}useBarcodeMappedData(t){const e=Object(W.useRef)(!1),n=ec(t&&this.getBarcodeMappedData(t));if(Object(W.useEffect)((()=>{n&&n.error&&(e.current=!1,this.cacheEntryPendingRetries.push({barcode:t,retry:()=>{this.cache.delete(this.hash(t)),e.current=!0}}),this.onError((()=>{for(const t of this.cacheEntryPendingRetries)t.retry();this.cacheEntryPendingRetries.length=0}),(()=>{e.current=!0;for(const t of this.cacheEntryPendingRetries)for(const e of this.onEvictionListeners)this.hash(e.barcode)==this.hash(t.barcode)&&e.callback();this.cacheEntryPendingRetries.length=0})))}),[n&&n.error]),!n)return null;let o;return o=n.value?"LOADED":n.error&&!e.current?"RETRY_DIALOG_OPEN":n.error?"FAILED":"LOADING",{value:n.value,state:o}}addOnEvictionListener(t){this.onEvictionListeners.add(t)}removeOnEvictionListener(t){this.onEvictionListeners.delete(t)}}j.BarcodeItemErrorState;function ic(t){return W.default.createElement(Ql,{open:t.open,dividerColor:t.dividerColor,modalOverlayColor:t.modalOverlayColor,sheetColor:t.sheetColor,title:t.title,subtitle:t.subtitle,cancelButton:{style:t.cancelButton,onClick:t.handleCancel},okButton:{style:t.retryButton,icon:z.Replay,onClick:t.handleRetry}})}function rc(t){const e=Object(W.useContext)(X);return W.default.createElement(z.Box,{sx:{paddingTop:e.minTopPaddingForContent+"px",overflowY:"scroll",backgroundColor:V.b.getColorValue(t.config.background)}},W.default.createElement(z.Box,{sx:{height:e.remainingVisibleBodyHeight,marginLeft:"auto",marginRight:"auto",maxWidth:280,display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column"}},t.config.icon.visible&&W.default.createElement(z.Box,null,W.default.createElement(z.Avatar,{sx:{width:100,height:100,backgroundColor:V.b.getColorValue(t.config.iconBackground),margin:"24px"}},W.default.createElement(N.a,{sx:{fontSize:50,color:V.b.getColorValue(t.config.icon.color)}}))),W.default.createElement(z.Typography,{sx:{fontSize:20,textAlign:"center"}},W.default.createElement(Q.a,{config:t.config.enableCameraTitle})),W.default.createElement(z.Typography,{sx:{fontSize:16,textAlign:"center",paddingTop:"12px"}},W.default.createElement(Q.a,{config:t.config.enableCameraExplanation})),W.default.createElement(z.Box,{sx:{paddingTop:"16px"}},W.default.createElement(q,Object.assign({},t.config.closeButton,{onClick:t.onAppClose})))))}function ac(t){const e=Object(W.useRef)(Object(z.createTheme)({palette:{primary:{main:St.ScanbotPrimary},secondary:{main:St.DarkGray}}})),[n,o]=Object(W.useState)(!1),[i,r]=Object(W.useState)(!1),[a,s]=Object(W.useState)(t.configuration.timeouts.initialScanDelay<=0),l=Object(W.useRef)(!1),c=Object(W.useRef)(),u=Object(W.useRef)(),d=t.configuration.useCase,h="FindAndPickScanningMode"===d._type?null:d.barcodeInfoMapping,f=Object(W.useMemo)((()=>new oc(null==h?void 0:h.barcodeItemMapper,((t,e)=>{o(!0),c.current=()=>{o(!1),t()},u.current=()=>{o(!1),e()}}))),[]);let p;if(Object(W.useMemo)((()=>{V.b.setPalette(t.configuration.palette),V.b.setBarcodeTextLocalization(t.configuration.localization)}),[t.configuration]),Object(W.useEffect)((()=>{if(t.configuration.timeouts.autoCancelTimeout>0){const e=setTimeout((()=>{t.onClose()}),t.configuration.timeouts.autoCancelTimeout);return()=>{clearTimeout(e)}}}),[]),Object(W.useEffect)((()=>{if(t.configuration.timeouts.initialScanDelay>0){const e=setTimeout((()=>{s(!0)}),t.configuration.timeouts.initialScanDelay);return()=>{clearTimeout(e)}}}),[]),Object(W.useEffect)((()=>{l.current=!n&&a}),[n,a]),"SingleScanningMode"===d._type)p=W.default.createElement(Cl,{configuration:t.configuration,barcodeMapper:f,onClose:t.onClose,onSubmit:t.onSubmit,onError:t.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l});else{if("MultipleScanningMode"!==d._type&&"FindAndPickScanningMode"!==d._type)throw new Error("Unsupported use case type");p=W.default.createElement($l,{configuration:t.configuration,barcodeMapper:f,onSubmit:t.onSubmit,onError:t.onError,onCameraPermissionDenied:()=>r(!0),scanningEnabled:l})}return W.default.createElement(W.default.Fragment,null,W.default.createElement(H,null),W.default.createElement(tc,{onError:t.onError,fallback:W.default.createElement("div",null,"Error")},W.default.createElement(V.a.Provider,{value:Object(V.c)(t.configuration.palette)},W.default.createElement(z.ThemeProvider,{theme:e.current},h&&W.default.createElement(ic,Object.assign({open:n,handleCancel:u.current,handleRetry:c.current,modalOverlayColor:h.modalOverlayColor,dividerColor:h.dividerColor,sheetColor:h.sheetColor},h.errorState)),W.default.createElement(N.a,{sx:{height:`100 * ${U}`,width:"100vw",backgroundColor:V.b.getColorValue(t.configuration.backgroundColor)}},W.default.createElement($,Object.assign({onBackPress:t.onClose},t.configuration.topBar),!i&&p,i&&W.default.createElement(rc,{onAppClose:t.onClose,config:t.configuration.cameraPermission})))))))}var sc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class lc{static createBarcodeScanner(t){return new Promise(((e,n)=>{ct.INSTANCE.initialize(t.sound);const o=lc.createContainer("barcode-scanner-controller"),i=Object(M.createRoot)(o),r=()=>sc(this,void 0,void 0,(function*(){return new Promise((t=>{window.setTimeout((()=>{i.unmount(),document.body.removeChild(o),t()}),0)}))})),a=t=>sc(this,void 0,void 0,(function*(){yield r(),n(t)}));i.render(W.default.createElement(ac,{configuration:t,onClose:()=>sc(this,void 0,void 0,(function*(){yield r(),e(null)})),onSubmit:t=>sc(this,void 0,void 0,(function*(){yield r(),e(t)})),onError:a})),(()=>{sc(this,void 0,void 0,(function*(){try{const t=yield mu.instance.getLicenseInfo();t.isValid()||(yield a(new P(t)))}catch(t){yield a(t)}}))})()}))}static createContainer(t){const e=document.createElement("div");return e.id=t,e.style.position="fixed",e.style.width="100%",e.style.height="100%",e.style.zIndex="1000",e.style.top="0",e.style.backgroundColor="rgba(0, 0, 0, 0.5)",document.body.appendChild(e),e}}lc.Config=j;var cc=lc,uc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};class dc{constructor(t,e){this._sdk=t,this._recognizer=e}recognize(t,e,n="COPY_IMAGE"){return uc(this,void 0,void 0,(function*(){const o=this._sdk.getBridge(n);return yield o.genericDocumentRecognizerRecognize(this._recognizer,t,new T.GenericDocumentRecognizerTypes.RecognitionParameters(e))}))}release(){return uc(this,void 0,void 0,(function*(){yield this._sdk.bridge.copyArgs.releaseObject(this._recognizer)}))}}const hc={OK:"Capturing your document... Please do not move the camera.",OK_SMALL_SIZE:"The document is too small. Try moving closer.",OK_BAD_ANGLES:"This is a bad camera angle. Hold the device straight over the document.",OK_BAD_ASPECT_RATIO:"Rotate the device sideways, so that the document fits better into the screen.",OK_OFF_CENTER:"Try holding the device at the center of the document.",OK_TOO_DARK:"A document was detected, but it is too dark. Try turning on a light.",OK_ORIENTATION_MISMATCH:"The document seems to be upside down. Please rotate the device or document",ERROR_NOTHING_DETECTED:"Please hold the device over a document to start scanning.",ERROR_TOO_DARK:"It is too dark. Try turning on a light.",ERROR_NOISE:"Please move the document to a clear surface.",NOT_ACQUIRED:"Scanning failed."};class fc{constructor(t){this.hint=t}}class pc{constructor(){this.outline=new mc,this.captureButton=new bc}}class mc{constructor(){this.polygon=new gc,this.path=new vc,this.label=new Ac}}class gc{constructor(){this.strokeCapturing="green",this.strokeSearching="yellow",this.fillCapturing="transparent",this.fillSearching="transparent"}}class vc{constructor(){this.stroke="green",this.strokeWidth=4}}class Ac{}class bc{constructor(){this.color="#FFF"}}class yc extends _.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_4K),this.detectionParameters=new T.DocumentDetectorTypes.DocumentDetectorParameters,this.autoCaptureEnabled=!0,this.autoCaptureSensitivity=.66,this.autoCaptureDelay=1e3,this.ignoreBadAspectRatio=!0,this.useImageCaptureAPI=!1,this.text=new fc(hc),this.style=new pc,this.onDocumentDetected=function(t){}}static fromJson(t){var e;const n=new yc;if(this.mapValues(t,n,["text","style","videoConstraints","detectionParameters"]),n.detectionParameters=new T.DocumentDetectorTypes.DocumentDetectorParameters(null!==(e=t.detectionParameters)&&void 0!==e?e:{}),t.text&&t.text.hint&&this.mapValues(t.text.hint,n.text.hint),t.style){this.mapValues(t.style,n.style,["outline","captureButton"]);const e=t.style.outline;if(e){this.mapValues(e,n.style.outline,["polygon","path","label"]);const t=e.polygon;t&&this.mapValues(t,n.style.outline.polygon);const o=e.path;o&&this.mapValues(o,n.style.outline.path);const i=e.label;i&&this.mapValues(i,n.style.outline.label)}const o=t.style.captureButton;o&&this.mapValues(o,n.style.captureButton)}return this.mapVideoConstraints(t,n),n}}var Cc=n(41),Sc={insert:"head",singleton:!1};Is()(Cc.a,Sc),Cc.a.locals;class wc extends W.default.Component{constructor(){super(...arguments),this.LINE_COUNT=4}render(){return W.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible",fill:this.props.polygonStyle.fill}},this.fill())}fill(){if(!this.props.points||0===this.props.points.length)return null;const t=[];for(let e=0;e<this.LINE_COUNT;e++){const n=this.props.points[e],o=this.props.points[(e+1)%this.LINE_COUNT];t.push(W.default.createElement("line",{key:e,style:this.props.polygonStyle,className:this.props.polygonClasses,x1:n.x,y1:n.y,x2:o.x,y2:o.y}))}return t}setFrame(){window.requestAnimationFrame((()=>this.forceUpdate()))}}wc.CLASSNAME="scanbot-document-outline";class xc extends W.default.Component{constructor(t){super(t),this.state={points:[],animatedPoints:[],isOk:!1,isVisible:!1}}update(t,e,n,o){const i={points:t,animatedPoints:e,isOk:n,isVisible:o};this.setState(i)}pointStringOrLatestValidPoints(t){return t&&t.length>0?ws.a.toSvgString(t):ws.a.toSvgString(this.latestValidPoints)}render(){var t;this.state.points&&(this.latestValidPoints=this.state.points);const e=null!==(t=this.props.style)&&void 0!==t?t:{},n=zs()(wc.CLASSNAME,{[`${wc.CLASSNAME}-ok`]:this.state.isOk},{[`${wc.CLASSNAME}-visible`]:this.state.isVisible},{[`${wc.CLASSNAME}-hidden`]:!this.state.isVisible});return W.default.createElement(Cs.polygon,{ref:t=>this.polygon=t,style:{strokeWidth:e.strokeWidth||2},animate:{points:this.pointStringOrLatestValidPoints(this.state.animatedPoints),opacity:this.state.isVisible?1:0,stroke:this.state.isOk?e.strokeCapturing:e.strokeSearching,fill:this.state.isOk?e.fillCapturing:e.fillSearching},onClick:()=>{},fill:"transparent",className:n})}}var Ec=xc;class Lc extends W.default.Component{constructor(t){super(t),this.state={path:void 0}}render(){var t,e;return this.state.path?W.default.createElement(Cs.path,{pathLength:"1",strokeDasharray:"1 1",initial:{strokeDashoffset:1},animate:{strokeDashoffset:0},transition:{duration:this.props.duration/1e3,ease:"easeInOut",repeat:0,repeatType:"loop",repeatDelay:1},stroke:(null===(t=this.props.style)||void 0===t?void 0:t.stroke)||"white",strokeWidth:(null===(e=this.props.style)||void 0===e?void 0:e.strokeWidth)||2,fill:"none",d:this.state.path,className:`${wc.CLASSNAME}-path`}):null}animate(t){const e="M"+ws.a.toSvgString(t)+"z";this.setState({path:e})}clear(){this.setState({path:void 0})}}class _c extends W.default.Component{render(){return W.default.createElement(Cs.svg,{style:{width:"100%",height:"100%",position:"absolute",overflow:"visible"}},W.default.createElement(Ec,{ref:t=>this.polygon=t,style:this.props.polygonStyle}),W.default.createElement(Lc,{ref:t=>this.path=t,style:this.props.pathStyle,duration:this.props.autoCaptureSensitivity}))}update(t,e,n){var o;const i="processing"!==n&&!!t,r=null!==(o=this.previous)&&void 0!==o?o:t,a=this.previous?t:void 0;this.polygon.update(r,a,e,i),this.previous=t,this.previous&&"capturing"===n?this.animateCapturing():this.clearAnimation()}animateCapturing(){this.path.animate(this.previous)}clearAnimation(){this.path.clear()}}class Oc extends W.default.Component{constructor(){super(...arguments),this.hintLabelClassName="scanbot-document-hint-text",this.state={text:"Initializing...",ok:!1,validPoints:!1}}render(){const{ok:t,text:e,validPoints:n}=this.state,o="searching"===this.props.action||"capturing"===this.props.action,i="processing"!==this.props.action&&n,r=zs()({[this.hintLabelClassName]:!0,[`${this.hintLabelClassName}-visible`]:i,[`${this.hintLabelClassName}-hidden`]:!i});return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",left:0,top:0}},W.default.createElement(_c,{ref:t=>{this.polygon=t},action:this.props.action,style:{width:"100%",height:"100%"},polygonStyle:this.props.style.polygon,pathStyle:this.props.style.path,isOk:t,isVisible:i,autoCaptureSensitivity:this.props.autoCaptureSensitivity}),o&&W.default.createElement("label",{ref:t=>this.label=t,style:this.props.style.label,className:r,dangerouslySetInnerHTML:{__html:e}}))}update(t,e,n){this.polygon.update(e,t,this.props.action),this.label&&(this.label.innerHTML=n)}}class Tc{static isConvex(t){if(t.length<4)return!0;let e=!1,n=t.length;for(let o=0;o<n;o++){const i=t[(o+2)%n].x-t[(o+1)%n].x,r=t[(o+2)%n].y-t[(o+1)%n].y,a=t[o].x-t[(o+1)%n].x,s=i*(t[o].y-t[(o+1)%n].y)-r*a;if(0==o)e=s>0;else if(e!=s>0)return!1}return!0}static distanceBetweenPoints(t,e){return Math.pow(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2),.5)}static intersection(t,e){const n=t[0],o=ws.a.subtract(t[1],n),i=e[0],r=ws.a.subtract(e[1],i);if(0===ws.a.cross(o,r))return;const a=ws.a.cross(ws.a.subtract(i,n),o)/ws.a.cross(o,r);return ws.a.add(i,ws.a.multiply(r,a))}}class kc{constructor(t,e=kc.DEFAULT_SENSITIVITY){this.maxDistance=this.calculateMaxDistance(t),this.sensitivity=e}check(t){let e=!1;if(this.lastPolygon){for(var n=0;n<4;n++)if(this.isPointMoved(t[n],this.lastPolygon[n])){e=!0;break}}else e=!0;return e}reset(){this.lastPolygon=void 0}update(t){this.lastPolygon=t}isPointMoved(t,e){return Tc.distanceBetweenPoints(t,e)/this.maxDistance>this.sensitivity}calculateMaxDistance(t){let e=new ws.a(0,0),n=new ws.a(t.width,t.height);return Tc.distanceBetweenPoints(e,n)}}kc.DEFAULT_SENSITIVITY=.5;var Dc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};ht.b;ht.a;class Pc extends ht.c{constructor(t){if(super(t),this.preventAutoCapture=!1,this.defaultCaptureButtonClick=()=>Dc(this,void 0,void 0,(function*(){const t=yield this.detectAndCrop();this.configuration.onDocumentDetected(t)})),Object.assign(this.state,{action:this.defaultAction}),!this.isSupported()){throw Error("Camera can only be accessed if the content is served via HTTPS, or on localhost. Check DocumentScannerView.isSupported() before creating the scanner.")}if(!mu.instance)throw Error("Initialize the SDK by calling ScanbotSDK.initialize() before using the document scanner.")}get defaultAction(){return this.isAutoCaptureEnabled()?"searching":"manual"}get enabled(){return("searching"==this.state.action||"capturing"==this.state.action||"manual"==this.state.action)&&!this.disposed}get configuration(){return this._configuration||(this._configuration=yc.fromJson(this.props.configuration)),this._configuration}get autoCaptureSensitivity(){return 3e3*(1-this.configuration.autoCaptureSensitivity)}static create(t){return Dc(this,void 0,void 0,(function*(){const e=document.getElementById(t.containerId);if(!e)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((n,o)=>{Object(W.render)(W.default.createElement(Pc,{container:e,configuration:t,onSuccess:n,onFailure:o}),e)}))}))}detectAndCrop(){var t,e,n;return Dc(this,void 0,void 0,(function*(){try{if(this.enabled){this.setState({action:"processing"});const e=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(Pc.DETECT_AND_CROP_RESOLUTION,this.configuration.useImageCaptureAPI);if(!e)return;return I.a.debug("Detect & Crop document of size: "+e.height*e.width),yield this.bridge.transferArgs.detectAndCropDocument(e)}}catch(t){null===(n=(e=this.configuration).onError)||void 0===n||n.call(e,t)}finally{this.setState({action:this.defaultAction})}}))}enableAutoCapture(){this.updateAutoCapture(!0)}disableAutoCapture(){this.updateAutoCapture(!1)}updateAutoCapture(t){this._configuration?this._configuration.autoCaptureEnabled=t:this.props.configuration.autoCaptureEnabled=t,this.setState({action:this.defaultAction})}isAutoCaptureEnabled(){return this._configuration?this._configuration.autoCaptureEnabled:this.props.configuration.autoCaptureEnabled}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Dc(this,void 0,void 0,(function*(){t.componentDidMount.call(this),this.detect(),this.recognizer=this.bridge.copyArgs.createDocumentDetector(new T.DocumentDetectorTypes.DocumentDetectorParameters(this.configuration.detectionParameters)),this.recognizer.catch((t=>{var e,n;return null===(n=(e=this.configuration).onError)||void 0===n?void 0:n.call(e,t)}))}))}componentWillUnmount(){const t=Object.create(null,{componentWillUnmount:{get:()=>super.componentWillUnmount}});return Dc(this,void 0,void 0,(function*(){t.componentWillUnmount.call(this),this.handleAutoCapture(!1),yield mu.instance.release(yield this.recognizer,"Document Scanner")}))}detect(){var t,e;return Dc(this,void 0,void 0,(function*(){try{if(!this.enabled)return;const t=yield this.detectInWebWorker();if(!t||!this.enabled)return;if(!this.outline)return;this.camera.reusableImageBuffer=t.originalImage.data;const e=this.getStatusString(t),n="OK"===e,o=e.startsWith("OK")?this.scalePolygonPointsToPixels(t.pointsNormalized):void 0;this.outline.update(n,o,v.getProperty(this.configuration.text.hint,e)),yield this.handleAutoCapture(n,o)}catch(n){null===(e=(t=this.configuration).onError)||void 0===e||e.call(t,n)}finally{requestAnimationFrame(this.detect.bind(this))}}))}getStatusString(t){return this.configuration.ignoreBadAspectRatio&&"OK_BAD_ASPECT_RATIO"===t.status?"OK":t.status}detectInWebWorker(){var t,e,n;return Dc(this,void 0,void 0,(function*(){try{const e=yield null===(t=this.camera)||void 0===t?void 0:t.createImageData(ht.c.DEFAULT_DETECTION_RESOLUTION,!1);return e&&this.enabled?yield this.bridge.transferArgs.documentDetectorDetect(yield this.recognizer,e):null}catch(t){return null===(n=(e=this.configuration).onError)||void 0===n||n.call(e,t),null}}))}handleAutoCapture(t,e){return Dc(this,void 0,void 0,(function*(){if(this.configuration.autoCaptureEnabled&&!this.preventAutoCapture)if(t&&!this.autoCaptureToken&&e){if(this.updateButton("capturing"),!this.polygonMovementPredicate){const t=this.getCameraFrameSize();this.polygonMovementPredicate=new kc(t)}if(this.runMovementPredicate(e))return this.updateButton("searching"),clearTimeout(this.autoCaptureToken),void(this.autoCaptureToken=void 0);this.autoCaptureToken=setTimeout((()=>Dc(this,void 0,void 0,(function*(){if(this.autoCaptureToken=void 0,!this.enabled)return;if(!this.configuration.autoCaptureEnabled)return;const t=yield this.detectAndCrop();if(null==t?void 0:t.pointsNormalized){const e=this.scalePolygonPointsToPixels(t.pointsNormalized);if(this.runMovementPredicate(e))return}(null==t?void 0:t.status.startsWith("OK"))&&this.configuration.onDocumentDetected&&(this.configuration.onDocumentDetected(t),this.preventAutoCapture=!0,setTimeout((()=>{this.preventAutoCapture=!1}),this.configuration.autoCaptureDelay))}))),this.autoCaptureSensitivity)}else!t&&this.autoCaptureToken&&(this.updateButton("searching"),clearTimeout(this.autoCaptureToken),this.autoCaptureToken=void 0)}))}updateButton(t){this.setState({action:t})}render(){var t,e,n;const{action:o}=this.state,{configuration:i}=this,r=null===(t=i.style)||void 0===t?void 0:t.captureButton;return W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(e=this.configuration)||void 0===e?void 0:e.spinnerColor),W.default.createElement(ft.a,{configuration:this.configuration,videoConstraints:i.videoConstraints,mirrored:i.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}}),W.default.createElement(Oc,{ref:t=>{this.outline=t},style:null===(n=i.style)||void 0===n?void 0:n.outline,action:o,autoCaptureSensitivity:this.autoCaptureSensitivity}),W.default.createElement(Vs,{color:(null==r?void 0:r.color)?r.color:"FFF",action:o,onClick:this.enabled?i.onCaptureButtonClick||this.defaultCaptureButtonClick:()=>{}}))}scalePolygonPointsToPixels(t){if(t){const e=this.getCameraFrameSize(),n=Ys.a.fromHtmlElement(this.camera.video),o=rl.findScale(n,e);t=(t=rl.convertToViewportPointsFromParentSize(e,t)).map((t=>ws.a.scaleToPoint(t,o.x,o.y,o.scale)))}return t}runMovementPredicate(t){const e=this.polygonMovementPredicate.check(t);return this.polygonMovementPredicate.update(t),e}getCameraFrameSize(){return this.camera.calculateFrameSize(ht.c.DEFAULT_DETECTION_RESOLUTION,this.camera.videoSize().width,this.camera.videoSize().height)}}Pc.DETECT_AND_CROP_RESOLUTION=0;var Bc=Pc;class Fc extends O.a{constructor(){super(_.a.DEFAULT_VIDEO_RESOLUTION_HD),this.recognizerConfiguration=new T.MRZTypes.RecognizerConfiguration,this.onMrzDetected=function(t){},this.finder.aspectRatio=new T.Geometry.AspectRatio({width:4,height:1}),this.userGuidance.title.text="Please hold the device over the MRZ code to start scanning"}static fromJson(t){const e=new Fc;return this.mapValues(t,e,["style","videoConstraints","finder","userGuidance"]),this.mapFinderConfiguration(e,t),this.mapVideoConstraints(t,e),e}}var Rc=function(t,e,n,o){return new(n||(n=Promise))((function(i,r){function a(t){try{l(o.next(t))}catch(t){r(t)}}function s(t){try{l(o.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}l((o=o.apply(t,e||[])).next())}))};ht.a;ht.b;class Ic extends ht.c{constructor(t){super(t),this.shouldComputeSize=!0,this.paused=!1,this.updateDimensionsCallback=this.updateDimensions.bind(this),Object.assign(this.state,{isFinderVisible:!0})}get configuration(){return this._configuration||(this._configuration=Fc.fromJson(this.props.configuration)),this._configuration}get enabled(){return!this.disposed}static create(t,e){return Rc(this,void 0,void 0,(function*(){const n=document.getElementById(t.containerId);if(!n)throw Error("Unable to initialize ScanbotSDK: Cannot find container element with the id provided.");return new Promise(((o,i)=>{Object(W.render)(W.default.createElement(Ic,{container:n,configuration:t,onSuccess:o,onFailure:i,mrzRecognizer:e}),n)}))}))}isDetectionPaused(){return this.paused}resumeDetection(){return Rc(this,void 0,void 0,(function*(){il.warn("Mrz detection resumed"),yield this.resume()}))}pauseDetection(){il.warn("Mrz detection paused"),this.pause()}componentDidMount(){const t=Object.create(null,{componentDidMount:{get:()=>super.componentDidMount}});return Rc(this,void 0,void 0,(function*(){t.componentDidMount.call(this),window.addEventListener("resize",this.updateDimensionsCallback),yield this.resume()}))}componentWillUnmount(){super.componentWillUnmount(),this.pause(),this.props.mrzRecognizer.release(),window.removeEventListener("resize",this.updateDimensionsCallback)}updateDimensions(){return Rc(this,void 0,void 0,(function*(){this.shouldComputeSize=!0,this.forceUpdate()}))}resume(){return Rc(this,void 0,void 0,(function*(){this.paused=!1,yield this.detect()}))}pause(){this.paused=!0}detect(){var t,e,n,o,i;return Rc(this,void 0,void 0,(function*(){const r=this.shouldComputeSize;if(!this.enabled)return;if(this.paused)return;let a=!1;try{this.camera.finderFrame=null===(t=this.finder)||void 0===t?void 0:t.holeRect;const o=yield null===(e=this.camera)||void 0===e?void 0:e.createImageData(Ic.FRAME_RESOLUTION);if(!o)return;r&&this.forceUpdate();const i=yield this.props.mrzRecognizer.recognize(o,"CONSUME_IMAGE");if(!this.enabled)return;if(null===i)return;this.camera.reusableImageBuffer=null==i?void 0:i.originalImage.data,i.recognitionSuccessful?(delete i.originalImage,a=!0,this.configuration.onMrzDetected(i)):this.configuration._onDetectionFailed&&(null===(n=this.configuration)||void 0===n||n._onDetectionFailed(i.originalImage))}catch(t){null===(i=(o=this.configuration).onError)||void 0===i||i.call(o,t)}finally{a?setTimeout((()=>{requestAnimationFrame(this.detect.bind(this))}),200):requestAnimationFrame(this.detect.bind(this))}}))}saveExtractedImageData(){this.camera.saveExtractedData()}setFinderVisible(t){this.setState({isFinderVisible:t})}render(){var t;return W.default.createElement("div",{style:{position:"relative",width:"100%",height:"100%"}},this.renderSpinner(null===(t=this.configuration)||void 0===t?void 0:t.spinnerColor),W.default.createElement("div",{style:{position:"absolute",width:"100%",height:"100%"}},W.default.createElement(ft.a,{configuration:this.configuration,videoConstraints:this.configuration.videoConstraints,mirrored:this.configuration.mirrored,preferredCamera:this.configuration.preferredCamera,onReady:this.onVideoReady,onError:this.onVideoError,ref:t=>{this.camera=t}})),this.state.isFinderVisible&&W.default.createElement(pt.a,{ref:t=>{this.finder=t},guidanceConfiguration:this.configuration.userGuidance,configuration:this.configuration.finder}))}}Ic.FRAME_RESOLUTION=1200;var Wc=Ic,Mc=n(36);class jc{constructor(){this.disabled=!1,this.color="transparent"}}class zc{constructor(){this.color="white",this.border="1px solid lightgray",this.size=20}}class Nc{constructor(){this.color="#1ec31e",this.width=4}}class Vc{constructor(){this.padding=10}}class Uc{constructor(){this.margin=15,this.size=100,this.zoom=1.5}}class Hc{constructor(){this.width=2,this.color="white"}}class Gc{constructor(){this.size=20,this.color="white"}}class Qc extends Mc.a{constructor(){super(),this.disableScroll=!0,this.rotations=0,this.style=new Vc,this.style.magneticLines=new jc,this.style.polygon=new Nc,this.style.polygon.handles=new zc,this.style.magnifier=new Uc,this.style.magnifier.border=new Hc,this.style.magnifier.crosshair=new Gc}static fromJson(t){const e=new Qc;return this.mapValues(t,e,["style"]),t.style&&(this.mapValues(t.style,e.style,["polygon","magneticLines","magnifier"]),t.style.polygon&&(this.mapValues(t.style.polygon,e.style.polygon,["handles"]),t.style.polygon.handles&&this.mapValues(t.style.polygon.handles,e.style.polygon.handles)),t.style.magneticLines&&this.mapValues(t.style.magneticLines,e.style.magneticLines,[]),t.style.magnifier&&(this.mapValues(t.style.magnifier,e.style.magnifier,["border","crosshair"]),t.style.magnifier.border&&this.mapValues(t.style.magnifier.border,e.style.magnifier.border,[]),t.style.magnifier.crosshair&&this.mapValues(t.style.magnifier.crosshair,e.style.magnifier.crosshair,[]))),e}}class Yc extends W.default.Component{constructor(){super(...arguments),this.BUFFER=4}fromPoint(t){return W.default.createElement("svg",{style:{width:"100%",height:"100%",position:"absolute"}},W.default.createElement("line",{x1:t.start.x.toString(),y1:t.start.y.toString(),x2:t.end.x.toString(),y2:t.end.y.toString(),style:{stroke:this.props.style.color,strokeWidth:2}}))}componentDidUpdate(t,e,n){this.props.style.disabled||this.snapToClosestIfAnyAreClose()}render(){var t,e,n,o,i,r;return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},null===(n=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.horizontal)||void 0===e?void 0:e.scaled)||void 0===n?void 0:n.map((t=>this.fromPoint(t))),null===(r=null===(i=null===(o=this.props.lines)||void 0===o?void 0:o.vertical)||void 0===i?void 0:i.scaled)||void 0===r?void 0:r.map((t=>this.fromPoint(t))))}snapToClosestIfAnyAreClose(){var t,e,n,o;const i=this.props.movingLine;let r=null===(e=null===(t=this.props.lines)||void 0===t?void 0:t.vertical)||void 0===e?void 0:e.scaled;if(i.isHorizontal&&(r=null===(o=null===(n=this.props.lines)||void 0===n?void 0:n.horizontal)||void 0===o?void 0:o.scaled),!r)return;const a=this.midPoint(i.points[0].coordinates,i.points[1].coordinates),s=r.map((t=>({distance:this.distanceToLine(t,a),mLine:t})));s.sort(((t,e)=>t.distance-e.distance)),s[0].distance<this.BUFFER&&this.props.snapTo({magneticLine:s[0].mLine,polygonLine:i})}distanceToLine(t,e){const n=e.x-t.start.x,o=e.y-t.start.y,i=t.end.x-t.start.x,r=t.end.y-t.start.y,a=i*i+r*r;if(0===a)return 1/0;const s=(n*i+o*r)/a;let l;return l=s<=0?t.start:s>=1?t.end:new ws.a(t.start.x+s*i,t.start.y+s*r),ws.a.distance(e,l)}midPoint(t,e){return new ws.a((t.x+e.x)/2,(t.y+e.y)/2)}}class Zc extends W.default.Component{constructor(){super(...arguments),this.POINT_COUNT=4,this.items=[],this.DRAG_BUFFER=5}get pointSize(){var t,e;return(null===(t=this.props.style)||void 0===t?void 0:t.size)?(null===(e=this.props)||void 0===e?void 0:e.scale)?this.props.style.size/this.props.scale:this.props.style.size:0}get pointStyle(){var t,e;return{width:this.pointSize+"px",height:this.pointSize+"px",border:null===(t=this.props.style)||void 0===t?void 0:t.border,borderRadius:this.pointSize/2+"px",backgroundColor:null===(e=this.props.style)||void 0===e?void 0:e.color,position:"absolute",cursor:"pointer",zIndex:500}}nextIndex(t){return(t+1)%this.POINT_COUNT}previousIndex(t){return(t-1+this.POINT_COUNT)%this.POINT_COUNT}isHorizontal(t){return t%2==0}isOutOfBounds(t,e){return t<-this.DRAG_BUFFER||t>e+this.DRAG_BUFFER}get invisibleHandleStyle(){return{width:"50px",height:"50px",opacity:0,position:"relative",top:this.pointSize/2-25+"px",left:this.pointSize/2-25+"px",borderRadius:"25px"}}}class qc extends Zc{create(){if(!this.props.points||4!==this.props.points.length)return null;const t=[];for(let e=0;e<this.POINT_COUNT;e++){const n=this.props.points[e],o=W.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x-this.pointSize/2+"px",top:n.y-this.pointSize/2+"px"}),key:e.toString(),ref:t=>this.items[e]=t,onPointerDown:t=>this.cornerTouchStart(t,e),onPointerUp:t=>this.cornerTouchEnd(t),onPointerMove:t=>this.cornerTouchMove(t,e),"data-sb-cropping-corner":e},W.default.createElement("div",{style:Object.assign({},this.invisibleHandleStyle)}));t.push(o)}return t}cornerTouchStart(t,e){t.target.setPointerCapture(t.pointerId);const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.items[e],i=ws.a.fromHtmlElement(o);this.parentOffset=new ws.a(n.x-i.x,n.y-i.y),this.props.cornerMoveStart({index:e,point:this.props.points[e]})}cornerTouchMove(t,e){if(!this.parentOffset)return;const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),{x:o,y:i}=Object(Ol.b)({x:n.x-this.parentOffset.x,y:n.y-this.parentOffset.y},this.pointSize,this.props.containerSize),r=this.pointSize/2,a=this.props.points[e];this.props.points[e]=new ws.a(o+r,i+r),Tc.isConvex(this.props.points)?this.props.cornerMoved({index:e,point:this.props.points[e]}):this.props.points[e]=a}cornerTouchEnd(t){t.target.releasePointerCapture(t.pointerId),this.parentOffset=null,this.props.cornerMoveEnd()}render(){return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute",cursor:"pointer",zIndex:500,userSelect:"none",msUserSelect:"none",MozUserSelect:"none",WebkitUserSelect:"none"}},this.create())}}class Xc extends Zc{create(){if(!this.props.points||4!==this.props.points.length)return null;const t=[];for(let e=0;e<this.POINT_COUNT;e++){const n=this.props.points[e];let o=this.props.points[this.nextIndex(e)];const i=W.default.createElement("div",{style:Object.assign(Object.assign({},this.pointStyle),{left:n.x+(o.x-n.x)/2-this.pointSize/2+"px",top:n.y+(o.y-n.y)/2-this.pointSize/2+"px"}),key:e.toString(),ref:t=>this.items[e]=t,onPointerDown:t=>this.lineTouchStart(t,e),onPointerMove:t=>this.lineTouchMove(t,e),onPointerUp:t=>this.lineTouchEnd(t),"data-sb-cropping-side":e},W.default.createElement("div",{style:this.invisibleHandleStyle}));t.push(i)}return t}lineTouchStart(t,e){t.target.setPointerCapture(t.pointerId);const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.items[e],i=ws.a.fromHtmlElement(o),r=this.props.points[e],a=this.props.points[this.nextIndex(e)];this.point0Start=v.copy(this.props.points[this.previousIndex(e)]),this.point1Start=v.copy(r),this.point2Start=v.copy(a),this.point3Start=v.copy(this.props.points[this.nextIndex(this.nextIndex(e))]),this.point1Offset=new ws.a(r.x-i.x,r.y-i.y),this.point2Offset=new ws.a(a.x-i.x,a.y-i.y),this.parentOffset=new ws.a(n.x-i.x,n.y-i.y)}lineTouchMove(t,e){if(!this.parentOffset)return;const n=ws.a.fromCoordinates(t.clientX,t.clientY,this.props.rotations,this.props.scale),o=this.props.points[this.previousIndex(e)];let i=new ws.a(null,null),r=new ws.a(null,null);const a=this.props.points[this.nextIndex(e+1)],s=n.x-this.parentOffset.x,l=n.y-this.parentOffset.y;if(this.isHorizontal(e)){const t=l+this.point1Offset.y,e=l+this.point2Offset.y,n=t-this.point1Start.y;i.x=this.point1Start.x+(this.point1Start.x-this.point0Start.x)*(n/(this.point1Start.y-this.point0Start.y)),r.x=this.point2Start.x+(this.point2Start.x-this.point3Start.x)*(n/(this.point2Start.y-this.point3Start.y)),i.y=t,r.y=e}else{const t=s+this.point1Offset.x,e=s+this.point2Offset.x,n=t-this.point1Start.x;i.y=this.point1Start.y+(this.point1Start.y-this.point0Start.y)*(n/(this.point1Start.x-this.point0Start.x)),r.y=this.point2Start.y+(this.point2Start.y-this.point3Start.y)*(n/(this.point2Start.x-this.point3Start.x)),i.x=t,r.x=e}i=ws.a.clamp(i,this.props.containerSize),r=ws.a.clamp(r,this.props.containerSize),this.isNearOpposingPoint(this.point1Start,i,o,this.isHorizontal(e)?"y":"x")||this.isNearOpposingPoint(this.point1Start,r,a,this.isHorizontal(e)?"y":"x")||this.areEdgesCrossing(o,i,r,a)||Tc.isConvex([o,i,r,a])&&(this.props.points[e].x=i.x,this.props.points[e].y=i.y,this.props.points[this.nextIndex(e)].x=r.x,this.props.points[this.nextIndex(e)].y=r.y,this.props.lineMoved({points:[{index:e,coordinates:i},{index:this.nextIndex(e),coordinates:r}],previousPoint:o,nextPoint:a,isHorizontal:this.isHorizontal(e)}))}lineTouchEnd(t){t.target.releasePointerCapture(t.pointerId),this.parentOffset=null}isNearOpposingPoint(t,e,n,o){if(t[o]>n[o]){if(e[o]-10<n[o])return!0}else if(e[o]>n[o]-10)return!0;return!1}areEdgesCrossing(t,e,n,o){const i=t.x,r=t.y,a=e.x,s=e.y,l=n.x,c=n.y,u=o.x,d=o.y;return((i-l)*(s-c)-(r-c)*(a-l))*((i-u)*(s-d)-(r-d)*(a-u))<0&&((l-i)*(d-r)-(c-r)*(u-i))*((l-a)*(d-s)-(c-s)*(u-a))<0}render(){return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},this.create())}}class $c extends W.default.Component{render(){return W.default.createElement("div",{style:{width:"100%",height:"100%",position:"absolute"}},W.default.createElement(qc,{ref:t=>this.corners=t,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:this.props.cornerMoved,cornerMoveEnd:this.props.cornerMoveEnd}),W.default.createElement(Xc,{ref:t=>this.lines=t,style:this.props.style,containerSize:this.props.containerSize,scale:this.props.scale,rotations:this.props.rotations,points:this.props.coordinatePoints,lineMoved:this.props.lineMoved}))}setFrame(){for(let t=0;t<this.corners.POINT_COUNT;t++){const e=this.props.coordinatePoints[t];this.corners.items[t]&&(this.corners.items[t].style.left=e.x-this.corners.pointSize/2+"px",this.corners.items[t].style.top=e.y-this.corners.pointSize/2+"px");let n=this.props.coordinatePoints[this.corners.nextIndex(t)];this.lines.items[t]&&(this.lines.items[t].style.left=e.x+(n.x-e.x)/2-this.corners.pointSize/2+"px",this.lines.items[t].style.top=e.y+(n.y-e.y)/2-this.corners.pointSize/2+"px")}}snapTo(t){const e=[t.polygonLine.previousPoint,t.polygonLine.points[0].coordinates],n=[t.polygonLine.points[1].coordinates,t.polygonLine.nextPoint],o=[t.magneticLine.start,t.magneticLine.end];this.props.coordinatePoints[t.polygonLine.points[0].index]=Tc.intersection(e,o),this.props.coordinatePoints[t.polygonLine.points[1].index]=Tc.intersection(n,o),this.props.cornerMoveEnd(),this.setFrame()}}class Kc extends W.default.Component{constructor(t){super(t),this.state={movingLine:void 0}}render(){return W.default.createElement("div",null,W.default.createElement($c,{ref:t=>this.handles=t,containerSize:this.props.size,coordinatePoints:this.props.points,rotations:this.props.rotations,scale:this.props.scale,style:this.props.handleStyle,cornerMoveStart:this.props.cornerMoveStart,cornerMoved:t=>{this.setFrame(),this.props.cornerMoved(t)},cornerMoveEnd:this.props.cornerMoveEnd,lineMoved:t=>{this.setFrame(),this.setState({movingLine:t})}}),W.default.createElement(Yc,{style:this.props.magneticLineStyle,lines:this.props.magneticLines,movingLine:this.state.movingLine,snapTo:t=>{var e,n;null===(e=this.handles)||void 0===e||e.snapTo(t),null===(n=this.polygon)||void 0===n||n.setFrame()}}),W.default.createElement(wc,{size:this.props.size,points:this.props.points,polygonStyle:this.props.polygonStyle,polygonClasses:this.props.polygonClasses,ref:t=>this.polygon=t}))}setFrame(){var t,e;null===(t=this.polygon)||void 0===t||t.setFrame(),null===(e=this.handles)||void 0===e||e.setFrame()}}class Jc extends W.default.Component{render(){return W.default.createElement("img",{ref:t=>this.image=t,style:{width:"100%",height:"100%",objectFit:"cover",position:"absolute"},src:this.props.src,alt:".",onLoad:t=>{t.target&&this.props.onImageLoaded(t.target)}})}}class tu extends W.default.Component{constructor(){super(...arguments),this.animating=!1}width(){return this.container.offsetWidth-2*this.container.offsetLeft}height(){return this.container.offsetHeight-2*this.container.offsetTop}isAnimating(){return this.animating}render(){const{size:t,imageMargin:e,rotations:n,scale:o,duration:i}=this.props,r=90*(n-1),a=90*n;this.previousScale||(this.previousScale=1);const s=mt.b`