@scandit/web-datacapture-id 7.2.3 → 7.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/js/index.js CHANGED
@@ -1,5 +1,5 @@
1
- import {CameraSettings,Color,Feedback,Sound,Logger,Quadrilateral,DataCaptureError,Brush,Localization,OverrideState,DataCaptureContext,BrowserHelper,DataCaptureLoader,assertUnreachable,Point}from'@scandit/web-datacapture-core';import {isObject}from'@scandit/web-datacapture-core/build/js/private/utils/isObject.js';import {match}from'@scandit/web-datacapture-core/build/js/private/utils/match.js';import {ViewClassNames}from'@scandit/web-datacapture-core/build/js/private/ViewClassNames.js';import {ShutterButton}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/ShutterButton.js';var p={"scandit-datacapture-sdk-id-pthreads.wasm":{bytes:8401414},"scandit-datacapture-sdk-id-simd-pthreads.wasm":{bytes:8309140},"scandit-datacapture-sdk-id-simd.wasm":{bytes:8195081},"scandit-datacapture-sdk-id.wasm":{bytes:8287793}};var Na=e=>({IdCapture:{RecommendedCameraSettings:CameraSettings.fromJSON(e.IdCapture.RecommendedCameraSettings),IdCaptureOverlayDefaults:{defaultCapturedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeWidth},defaultLocalizedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeWidth},defaultRejectedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeWidth}}}}),_=Na({IdCapture:{RecommendedCameraSettings:{zoomFactor:1,zoomGestureZoomFactor:2,focusGestureStrategy:"manualUntilCapture",preferredResolution:"fullHd"},IdCaptureOverlayDefaults:{defaultCapturedBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3},defaultLocalizedBrush:{fillColor:"#FFFFFF80",strokeColor:"#FFFFFF00",strokeWidth:0},defaultRejectedBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3}}}});var pe=(o=>(o.Undefined="Undefined",o.RecoveredAfterFailure="RecoveredAfterFailure",o.InvalidLicenseKeyForVIZProcessing="InvalidLicenseKeyForVIZProcessing",o.InvalidSettingsForVIZProcessing="InvalidSettingsForVIZProcessing",o.InvalidLicenseKeyForParser="InvalidLicenseKeyForParser",o))(pe||{}),D=class e extends Error{constructor(){super(...arguments);this._type="Undefined";this._message="";}get type(){return this._type}get message(){return this._message}static create(a){let r=new e;return a&&(r.name=a.type,r._type=a.type,r._message=a.message),r}static fromJSON(a){let r=new e;return r._type=a.type,r._message=a.message,r}};var gt="data:audio/mpeg;base64,SUQzBAAAAAACGFRFTkMAAAALAAADUHJvIFRvb2xzAFRYWFgAAAAjAAADb3JpZ2luYXRvcl9yZWZlcmVuY2UAYWE0RVFOcW9VQk9rAFRJVDIAAAAeAAADMDdfU2NhbmRpdF9TY2FubmVkLVdyb25nSXRlbQBUWFhYAAAASQAAA3VtaWQAMHgwNjBBMkIzNDAxMDEwMTA1MDEwMTBGMTAxMzAwMDAwMDg2RUUzOTA5RUE3QjgwMDBGNjZGQzVERDdBNzc5ODE0AFRYWFgAAAAYAAADdGltZV9yZWZlcmVuY2UAMjY3MDU5MABURFJDAAAADAAAAzIwMjMtMDMtMjQAVFNTRQAAAA8AAANMYXZmNTkuMTcuMTAxAAAAAAAAAAAAAAD/+1QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAABQAAAhAACIiIiIuLi4uLjo6Ojo6RUVFRUVRUVFRUV1dXV1daGhoaGh0dHR0dICAgICAi4uLi4uXl5eXl6KioqKirq6urq66urq6usXFxcXF0dHR0dHd3d3d3ejo6Ojo9PT09PT//////wAAAABMYXZjNTkuMjAAAAAAAAAAAAAAAAAkAsAAAAAAAAAIQBl5jwn/+xRkAAAAVgDUjQBgAAAADSCgAAEDiBduGIGACAAANIMAAAAgP8plFgg7znL+Q4k4B5uo2Rk9c+LQuOexRB4iCTT6t24x+9f7f/ve/OAAwiE0lTn2XHl6PVZxCA5GsdT/+xRkCoPwcwJexxhAAAAADSDgAAEBiAl0oJxAEAAANIAAAAQLpHM6PLpQzOOJP9g5lhihlyb2dlebf8JCDTyRW9i0P7qaz/+QAFBoW4NDEqQuutHr41//tAlwcSVBnm3/+xRkGwPwdwHbgCsQAAAADSAAAAEBlAd5AIhAAAAANIAAAATHiGz+Vc+PkABIAc4KvoFaqtnriqAiChQ15lfsMNqJ+6pCWSiwWiCplZ48GhwdztADJY5zm8nAqeDYITz/+xRkKwPweAReQCYQAAAADSAAAAEB5BF+gYhgKAAANIAAAARCDP8WxCCX+BeBTH3/iEEQWPLf/j9xbSKUgEEVL1p+0zaZlevKU5jbmwnBfkrWVYFOA8ttpVTjnZNQTAj/+xRkOYHwcAJeQCIYAAAADSAAAAEBwAd1AJhAAAAANIAAAAQh4cpNFFitO6uKSSRkaPEOmFCjhCufYvSYAMRykUrsTqSNnkFv2JqLbTWsOJFsnYRXo/r1z8r/7+mDiwH/+xRkSYAAdwLcJSQACAAADSCgAAEEeJFKGKUACAAANIMAAABxOtc6Jp53xlXP35AAcoV0pquMq1q/64ds9sxEh5Gt1gF6lGuqIWmtoDBY0qSi+FDRUEFIX0BPlJEDhYT/+xRkTgPxAxRZhzDAAAAADSDgAAEBlAl5AJhAAAAANIAAAATqelYAwIlAy0/IoV/EKh5Gw6UEDpn9pqpMQU1FqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkVYPweQJfIMkQCAAADSAAAAEBzAlyAJwAAAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkZIPwdAdgoEEYigAADSAAAAEB1AuEgQhAKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkc4PwcAdewMEQoAAADSAAAAEBrAmCgQhgKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkg4fwcgHcIMYICgAADSAAAAEBcA8wrGHgKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRklI/wTgLEAwkACgAADSAAAAEBWBTkBIxiaAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkqA/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkxg/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=";var he=class e{constructor(){this.idCaptured=Feedback.defaultFeedback;this.idRejected=new Feedback(null,null);}static get defaultFeedback(){return new e}static get defaultSuccessSound(){return Sound.defaultSound}static get defaultFailureSound(){return new Sound(gt)}toJSONObject(){return {idCaptured:this.idCaptured.toJSONObject(),idRejected:this.idRejected.toJSONObject()}}};var y=(u=>(u.Passport="passport",u.IdCard="idCard",u.DriverLicense="driverLicense",u.VisaIcao="visaIcao",u.ResidencePermit="residencePermit",u.HealthInsuranceCard="healthInsuranceCard",u.RegionSpecific="regionSpecific",u))(y||{}),g=class{constructor(t){this._region=t;}get region(){return this._region}isPassport(){return this.documentType==="passport"}isIdCard(){return this.documentType==="idCard"}isDriverLicense(){return this.documentType==="driverLicense"}isVisaIcao(){return this.documentType==="visaIcao"}isHealthInsuranceCard(){return this.documentType==="healthInsuranceCard"}isResidencePermit(){return this.documentType==="residencePermit"}isRegionSpecific(){return this.documentType==="regionSpecific"}};var me=class e{constructor(){this.json={};}get errorCorrection(){return this.json.errorCorrection}get moduleCountX(){return this.json.moduleCountX}get moduleCountY(){return this.json.moduleCountY}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {errorCorrection:this.errorCorrection,moduleCountX:this.moduleCountX,moduleCountY:this.moduleCountY}}};var A=class e{constructor(){this.json={};}get day(){return this.json.day}get month(){return this.json.month}get year(){return this.json.year}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {day:this.day,month:this.month,year:this.year}}};var Ae=class e{get dateOfExpiry(){var t;return (t=A.fromJSON(this.json.dateOfExpiry))!=null?t:new A}get codes(){return this.json.codes}static fromJSON(t){if(t===null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {codes:[...this.codes],dateOfExpiry:this.dateOfExpiry.toJSONObject()}}};var Ie=class e{get vehicleCode(){return this.json.vehicleCode}get vehicleRestriction(){return this.json.vehicleRestriction}get dateOfIssue(){var t;return (t=A.fromJSON(this.json.dateOfIssue))!=null?t:new A}static fromJSON(t){if(t===null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {dateOfIssue:this.dateOfIssue.toJSONObject(),vehicleCode:this.vehicleCode,vehicleRestriction:this.vehicleRestriction}}};var Se=class e{get aamvaVersion(){return this.json.aamvaVersion}get aliasFamilyName(){return this.json.aliasFamilyName}get aliasGivenName(){return this.json.aliasGivenName}get aliasSuffixName(){return this.json.aliasSuffixName}get bloodType(){return this.json.bloodType}get branchOfService(){return this.json.branchOfService}get cardInstanceIdentifier(){return this.json.cardInstanceIdentifier}get cardRevisionDate(){return A.fromJSON(this.json.cardRevisionDate)}get categories(){return this.json.categories!=null?this.json.categories:[]}get champusEffectiveDate(){return A.fromJSON(this.json.champusEffectiveDate)}get champusExpiryDate(){return A.fromJSON(this.json.champusExpiryDate)}get citizenshipStatus(){return this.json.citizenshipStatus}get civilianHealthCareFlagCode(){return this.json.civilianHealthCareFlagCode}get civilianHealthCareFlagDescription(){return this.json.civilianHealthCareFlagDescription}get commissaryFlagCode(){return this.json.commissaryFlagCode}get commissaryFlagDescription(){return this.json.commissaryFlagDescription}get countryOfBirth(){return this.json.countryOfBirth}get countryOfBirthIso(){return this.json.countryOfBirthIso}get deersDependentSuffixCode(){return this.json.deersDependentSuffixCode}get deersDependentSuffixDescription(){return this.json.deersDependentSuffixDescription}get directCareFlagCode(){return this.json.directCareFlagCode}get directCareFlagDescription(){return this.json.directCareFlagDescription}get documentCopy(){return this.json.documentCopy}get documentDiscriminatorNumber(){return this.json.documentDiscriminatorNumber}get driverNamePrefix(){return this.json.driverNamePrefix}get driverNameSuffix(){return this.json.driverNameSuffix}get driverRestrictionCodes(){return this.json.driverRestrictionCodes!=null?this.json.driverRestrictionCodes:[]}get ediPersonIdentifier(){return this.json.ediPersonIdentifier}get endorsementsCode(){return this.json.endorsementsCode}get exchangeFlagCode(){return this.json.exchangeFlagCode}get exchangeFlagDescription(){return this.json.exchangeFlagDescription}get eyeColor(){return this.json.eyeColor}get familySequenceNumber(){return this.json.familySequenceNumber}get firstNameTruncation(){return this.json.firstNameTruncation}get firstNameWithoutMiddleName(){return this.json.firstNameWithoutMiddleName}get formNumber(){return this.json.formNumber}get genevaConventionCategory(){return this.json.genevaConventionCategory}get hairColor(){return this.json.hairColor}get heightCm(){return this.json.heightCm}get heightInch(){return this.json.heightInch}get IIN(){return this.json.iin}get identificationType(){return this.json.identificationType}get issuingJurisdiction(){return this.json.issuingJurisdiction}get issuingJurisdictionIso(){return this.json.issuingJurisdictionIso}get barcodeMetadata(){return me.fromJSON(this.json.barcodeMetadata)}get jpegData(){return this.json.jpegData}get jurisdictionVersion(){return this.json.jurisdictionVersion}get lastNameTruncation(){return this.json.lastNameTruncation}get licenseCountryOfIssue(){return this.json.licenseCountryOfIssue}get middleName(){return this.json.middleName}get middleNameTruncation(){return this.json.middleNameTruncation}get mwrFlagCode(){return this.json.mwrFlagCode}get mwrFlagDescription(){return this.json.mwrFlagDescription}get payGrade(){return this.json.payGrade}get payPlanCode(){return this.json.payPlanCode}get payPlanGradeCode(){return this.json.payPlanGradeCode}get personDesignatorDocument(){return this.json.personDesignatorDocument}get personDesignatorTypeCode(){return this.json.personDesignatorTypeCode}get personMiddleInitial(){return this.json.personMiddleInitial}get personalIdNumber(){return this.json.personalIdNumber}get personalIdNumberType(){return this.json.personalIdNumberType}get personnelCategoryCode(){return this.json.personnelCategoryCode}get personnelEntitlementConditionType(){return this.json.personnelEntitlementConditionType}get placeOfBirth(){return this.json.placeOfBirth}get professionalDrivingPermit(){return this.json.professionalDrivingPermit!=null?Ae.fromJSON(this.json.professionalDrivingPermit):null}get race(){return this.json.race}get rank(){return this.json.rank}get rawData(){return this.json.rawData}get relationshipCode(){return this.json.relationshipCode}get relationshipDescription(){return this.json.relationshipDescription}get restrictionsCode(){return this.json.restrictionsCode}get securityCode(){return this.json.securityCode}get serviceCode(){return this.json.serviceCode}get sponsorFlag(){return this.json.sponsorFlag}get sponsorName(){return this.json.sponsorName}get sponsorPersonDesignatorIdentifier(){return this.json.sponsorPersonDesignatorIdentifier}get statusCode(){return this.json.statusCode}get statusCodeDescription(){return this.json.statusCodeDescription}get vehicleClass(){return this.json.vehicleClass}get vehicleRestrictions(){return this.json.vehicleRestrictions!=null?this.json.vehicleRestrictions.map(t=>Ie.fromJSON(t)).filter(t=>t!=null):[]}get version(){return this.json.version}get weightKg(){return this.json.weightKg}get weightLbs(){return this.json.weightLbs}get isRealId(){return this.json.isRealId}get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get fullName(){return this.json.fullName}get sex(){return this.json.sex}get dateOfBirth(){return A.fromJSON(this.json.dateOfBirth)}get nationality(){return this.json.nationality}get address(){return this.json.address}get documentNumber(){return this.json.documentNumber}get dateOfExpiry(){return A.fromJSON(this.json.dateOfExpiry)}get dateOfIssue(){return A.fromJSON(this.json.dateOfIssue)}get barcodeDataElements(){return this.json.dictionary}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){var t,a,r,s,o,c;return {firstName:this.firstName,lastName:this.lastName,secondaryLastName:this.json.secondaryLastName,fullName:this.fullName,sex:this.sex,nationality:this.nationality,address:this.address,issuingCountry:this.json.issuingCountry,issuingCountryIso:this.json.issuingCountryIso,barcodeMetadata:this.barcodeMetadata?this.barcodeMetadata.toJSONObject():null,documentNumber:this.documentNumber,documentType:this.json.documentType,documentSubtype:this.json.documentSubtype,documentAdditionalNumber:this.json.documentAdditionalNumber,dateOfBirth:(a=(t=this.dateOfBirth)==null?void 0:t.toJSONObject())!=null?a:null,dateOfExpiry:(s=(r=this.dateOfExpiry)==null?void 0:r.toJSONObject())!=null?s:null,dateOfIssue:(c=(o=this.dateOfIssue)==null?void 0:o.toJSONObject())!=null?c:null,aamvaVersion:this.aamvaVersion,aliasFamilyName:this.aliasFamilyName,aliasGivenName:this.aliasGivenName,aliasSuffixName:this.aliasSuffixName,bloodType:this.bloodType,branchOfService:this.branchOfService,cardInstanceIdentifier:this.cardInstanceIdentifier,cardRevisionDate:this.cardRevisionDate?this.cardRevisionDate.toJSONObject():null,categories:[...this.categories],champusEffectiveDate:this.champusEffectiveDate?this.champusEffectiveDate.toJSONObject():null,champusExpiryDate:this.champusExpiryDate?this.champusExpiryDate.toJSONObject():null,citizenshipStatus:this.citizenshipStatus,civilianHealthCareFlagCode:this.civilianHealthCareFlagCode,civilianHealthCareFlagDescription:this.civilianHealthCareFlagDescription,commissaryFlagCode:this.commissaryFlagCode,commissaryFlagDescription:this.commissaryFlagDescription,countryOfBirth:this.countryOfBirth,countryOfBirthIso:this.countryOfBirthIso,deersDependentSuffixCode:this.deersDependentSuffixCode,deersDependentSuffixDescription:this.deersDependentSuffixDescription,directCareFlagCode:this.directCareFlagCode,directCareFlagDescription:this.directCareFlagDescription,documentCopy:this.documentCopy,documentDiscriminatorNumber:this.documentDiscriminatorNumber,driverNamePrefix:this.driverNamePrefix,driverNameSuffix:this.driverNameSuffix,driverRestrictionCodes:[...this.driverRestrictionCodes],ediPersonIdentifier:this.ediPersonIdentifier,endorsementsCode:this.endorsementsCode,exchangeFlagCode:this.exchangeFlagCode,exchangeFlagDescription:this.exchangeFlagDescription,eyeColor:this.eyeColor,familySequenceNumber:this.familySequenceNumber,firstNameTruncation:this.firstNameTruncation,firstNameWithoutMiddleName:this.firstNameWithoutMiddleName,formNumber:this.formNumber,genevaConventionCategory:this.genevaConventionCategory,hairColor:this.hairColor,heightCm:this.heightCm,heightInch:this.heightInch,iin:this.IIN,identificationType:this.identificationType,issuingJurisdiction:this.issuingJurisdiction,issuingJurisdictionIso:this.issuingJurisdictionIso,jpegData:this.jpegData,jurisdictionVersion:this.jurisdictionVersion,lastNameTruncation:this.lastNameTruncation,licenseCountryOfIssue:this.licenseCountryOfIssue,middleName:this.middleName,middleNameTruncation:this.middleNameTruncation,mwrFlagCode:this.mwrFlagCode,mwrFlagDescription:this.mwrFlagDescription,payGrade:this.payGrade,payPlanCode:this.payPlanCode,payPlanGradeCode:this.payPlanGradeCode,personDesignatorDocument:this.personDesignatorDocument,personDesignatorTypeCode:this.personDesignatorTypeCode,personMiddleInitial:this.personMiddleInitial,personalIdNumber:this.personalIdNumber,personalIdNumberType:this.personalIdNumberType,personnelCategoryCode:this.personnelCategoryCode,personnelEntitlementConditionType:this.personnelEntitlementConditionType,placeOfBirth:this.placeOfBirth,professionalDrivingPermit:this.professionalDrivingPermit?this.professionalDrivingPermit.toJSONObject():null,race:this.race,rank:this.rank,rawData:this.rawData,relationshipCode:this.relationshipCode,relationshipDescription:this.relationshipDescription,restrictionsCode:this.restrictionsCode,securityCode:this.securityCode,serviceCode:this.serviceCode,sponsorFlag:this.sponsorFlag,sponsorName:this.sponsorName,sponsorPersonDesignatorIdentifier:this.sponsorPersonDesignatorIdentifier,statusCode:this.statusCode,statusCodeDescription:this.statusCodeDescription,vehicleClass:this.vehicleClass,vehicleRestrictions:this.vehicleRestrictions.map(u=>u.toJSONObject()),version:this.version,weightKg:this.weightKg,weightLbs:this.weightLbs,isRealId:this.isRealId,dictionary:{...this.barcodeDataElements}}}};var Et=(a=>(a.FrontOnly="frontOnly",a.FrontAndBack="frontAndBack",a))(Et||{}),nt=(r=>(r.Face="face",r.CroppedDocument="croppedDocument",r.Frame="frame",r))(nt||{}),fa=(a=>(a.Front="front",a.Back="back",a))(fa||{}),Dt=(s=>(s.None="none",s.FieldsOnly="fieldsOnly",s.ImagesOnly="imagesOnly",s.FieldsAndImages="fieldsAndImages",s))(Dt||{}),bt=(a=>(a.Auto="auto",a.ButtonTap="buttonTap",a))(bt||{}),Ca=(a=>(a.Rounded="rounded",a.Square="square",a))(Ca||{}),ga=(a=>(a.Light="light",a.Bold="bold",a))(ga||{}),Ra=(r=>(r.NotAvailable="notAvailable",r.NotRealIdCompliant="notRealIdCompliant",r.RealIdCompliant="realIdCompliant",r))(Ra||{}),Oa=(r=>(r.Female="female",r.Male="male",r.Unspecified="unspecified",r))(Oa||{});var Ne=class e{constructor(){this.json=null;}get face(){var t,a;return (a=(t=this.json)==null?void 0:t.front.face)!=null?a:null}get frame(){var t,a,r,s;return (s=(r=(t=this.json)==null?void 0:t.front.frame)!=null?r:(a=this.json)==null?void 0:a.back.frame)!=null?s:null}static fromJSON(t){let a=new e;return t!=null&&(a.json=t),a}getFrame(t){var a,r,s,o;switch(t){case"front":return (r=(a=this.json)==null?void 0:a.front.frame)!=null?r:null;case"back":return (o=(s=this.json)==null?void 0:s.back.frame)!=null?o:null}return null}getCroppedDocument(t){var a,r,s,o;switch(t){case"front":return (r=(a=this.json)==null?void 0:a.front.croppedDocument)!=null?r:null;case"back":return (o=(s=this.json)==null?void 0:s.back.croppedDocument)!=null?o:null}return null}toJSONObject(){return {front:{face:this.face,croppedDocument:this.getCroppedDocument("front"),frame:this.getFrame("front")},back:{face:null,croppedDocument:this.getCroppedDocument("back"),frame:this.getFrame("back")}}}};var fe=class e{get documentCode(){return this.json.documentCode}get namesAreTruncated(){return this.json.namesAreTruncated}get optional(){return this.json.optional}get optional1(){return this.json.optional1}get capturedMrz(){return this.json.capturedMrz}get personalIdNumber(){return this.json.personalIdNumber}get renewalTimes(){return this.json.renewalTimes}get fullNameSimplifiedChinese(){return this.json.fullNameSimplifiedChinese}get omittedCharacterCountInGbkName(){return this.json.omittedCharacterCountInGbkName}get omittedNameCount(){return this.json.omittedNameCount}get issuingAuthorityCode(){return this.json.issuingAuthorityCode}get passportIssuerIso(){return this.json.passportIssuerIso}get passportNumber(){return this.json.passportNumber}get passportDateOfExpiry(){return A.fromJSON(this.json.passportDateOfExpiry)}get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get fullName(){return this.json.fullName}get sex(){return this.json.sex}get dateOfBirth(){return A.fromJSON(this.json.dateOfBirth)}get nationality(){return this.json.nationality}get address(){return this.json.address}get documentNumber(){return this.json.documentNumber}get dateOfExpiry(){return A.fromJSON(this.json.dateOfExpiry)}get dateOfIssue(){return A.fromJSON(this.json.dateOfIssue)}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){var t,a,r,s;return {...this.json,documentCode:this.documentCode,namesAreTruncated:this.namesAreTruncated,optional:this.optional,optional1:this.optional1,capturedMrz:this.capturedMrz,personalIdNumber:this.personalIdNumber,renewalTimes:this.renewalTimes,fullNameSimplifiedChinese:this.fullNameSimplifiedChinese,omittedCharacterCountInGbkName:this.omittedCharacterCountInGbkName,omittedNameCount:this.omittedNameCount,issuingAuthorityCode:this.issuingAuthorityCode,passportIssuerIso:this.passportIssuerIso,passportNumber:this.passportNumber,passportDateOfExpiry:this.passportDateOfExpiry?this.passportDateOfExpiry.toJSONObject():null,firstName:this.firstName,lastName:this.lastName,fullName:this.fullName,sex:this.sex,dateOfBirth:this.dateOfBirth?this.dateOfBirth.toJSONObject():null,nationality:this.nationality,address:this.address,documentNumber:this.documentNumber,dateOfExpiry:(a=(t=this.dateOfExpiry)==null?void 0:t.toJSONObject())!=null?a:null,dateOfIssue:(s=(r=this.dateOfIssue)==null?void 0:r.toJSONObject())!=null?s:null}}};var Ce=class e{constructor(){this.json={};}get code(){return this.json.code}get dateOfIssue(){return A.fromJSON(this.json.dateOfIssue)}get dateOfExpiry(){return A.fromJSON(this.json.dateOfExpiry)}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {code:this.code,dateOfIssue:this.dateOfIssue?this.dateOfIssue.toJSONObject():null,dateOfExpiry:this.dateOfExpiry?this.dateOfExpiry.toJSONObject():null}}};var z=class e{constructor(){this.json={};}get drivingLicenseCategories(){return this.json.drivingLicenseCategories.map(t=>Ce.fromJSON(t)).filter(t=>t!=null)}get restrictions(){return this.json.restrictions}get endorsements(){return this.json.endorsements}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {drivingLicenseCategories:this.drivingLicenseCategories.map(t=>t.toJSONObject()),restrictions:this.restrictions,endorsements:this.endorsements}}};var ge=class e{get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get secondaryLastName(){return this.json.secondaryLastName}get fullName(){return this.json.fullName}get additionalAddressInformation(){return this.json.additionalAddressInformation}get additionalNameInformation(){return this.json.additionalNameInformation}get documentAdditionalNumber(){return this.json.documentAdditionalNumber}get employer(){return this.json.employer}get issuingAuthority(){return this.json.issuingAuthority}get issuingJurisdiction(){return this.json.issuingJurisdiction}get issuingJurisdictionIso(){return this.json.issuingJurisdictionIso}get maritalStatus(){return this.json.maritalStatus}get personalIdNumber(){return this.json.personalIdNumber}get placeOfBirth(){return this.json.placeOfBirth}get profession(){return this.json.profession}get race(){return this.json.race}get religion(){return this.json.religion}get residentialStatus(){return this.json.residentialStatus}get mothersName(){return this.json.mothersName}get fathersName(){return this.json.fathersName}get capturedSides(){return this.json.capturedSides}get isBackSideCaptureSupported(){return this.json.isBackSideCaptureSupported}get drivingLicenseDetails(){return z.fromJSON(this.json.drivingLicenseDetails)}get bloodType(){return this.json.bloodType}get sponsor(){return this.json.sponsor}get visaNumber(){return this.json.visaNumber}get passportNumber(){return this.json.passportNumber}get sex(){return this.json.sex}get dateOfBirth(){return A.fromJSON(this.json.dateOfBirth)}get nationality(){return this.json.nationality}get address(){return this.json.address}get documentNumber(){return this.json.documentNumber}get dateOfExpiry(){return A.fromJSON(this.json.dateOfExpiry)}get dateOfIssue(){return A.fromJSON(this.json.dateOfIssue)}get vehicleOwner(){return this.json.vehicleOwner}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){var t,a,r,s,o,c;return {...this.json,firstName:this.firstName,lastName:this.lastName,secondaryLastName:this.secondaryLastName,fullName:this.fullName,additionalAddressInformation:this.additionalAddressInformation,additionalNameInformation:this.additionalNameInformation,documentAdditionalNumber:this.documentAdditionalNumber,employer:this.employer,issuingAuthority:this.issuingAuthority,issuingJurisdiction:this.issuingJurisdiction,issuingJurisdictionIso:this.issuingJurisdictionIso,maritalStatus:this.maritalStatus,personalIdNumber:this.personalIdNumber,placeOfBirth:this.placeOfBirth,profession:this.profession,race:this.race,religion:this.religion,residentialStatus:this.residentialStatus,mothersName:this.mothersName,fathersName:this.fathersName,capturedSides:this.capturedSides,isBackSideCaptureSupported:this.isBackSideCaptureSupported,drivingLicenseDetails:this.drivingLicenseDetails?this.drivingLicenseDetails.toJSONObject():null,bloodType:this.bloodType,sponsor:this.sponsor,passportNumber:this.passportNumber,visaNumber:this.visaNumber,sex:this.sex,dateOfBirth:(a=(t=this.dateOfBirth)==null?void 0:t.toJSONObject())!=null?a:null,nationality:this.nationality,address:this.address,documentNumber:this.documentNumber,dateOfExpiry:(s=(r=this.dateOfExpiry)==null?void 0:r.toJSONObject())!=null?s:null,dateOfIssue:(c=(o=this.dateOfIssue)==null?void 0:o.toJSONObject())!=null?c:null,vehicleOwner:this.vehicleOwner}}};var J=class e{constructor(){this.json={};}get allChecksPassed(){return this.json.allChecksPassed}get failedChecks(){return this.json.failedChecks}get skippedChecks(){return this.json.skippedChecks}get passedChecks(){return this.json.passedChecks}static fromJSON(t){let a=new e;return a.json=t,a}async frontReviewImage(){let t=this.json.frontFieldLocations,a=t!=null&&Object.keys(t).length>0;if(!this.allChecksPassed){let r=this.json.frontImage;if(r!=null)try{if(a)return await this.highlightImage(r,t)}catch(s){Logger.log(Logger.Level.Warn,"Failed to create image with mismatching fields.",s);}}return ""}toJSONObject(){return {...this.json}}pushQuadForKey(t,a,r){let s=t[r];return s!=null?(a.push(Quadrilateral.fromJSON(s)),!0):!1}pushQuadsForKeys(t,a,r,s=[]){if(!this.pushQuadForKey(t,a,r))for(let o of s)this.pushQuadForKey(t,a,o);}getMismatchedQuads(t){let a=[];return t!=null&&(this.failedChecks.includes("documentNumberComparison")&&this.pushQuadsForKeys(t,a,"documentNumber"),this.failedChecks.includes("fullNameComparison")&&this.pushQuadsForKeys(t,a,"fullName",["firstName","lastName"]),this.failedChecks.includes("dateOfBirthComparison")&&this.pushQuadsForKeys(t,a,"dateOfBirth"),this.failedChecks.includes("dateOfExpiryComparison")&&this.pushQuadsForKeys(t,a,"dateOfExpiry"),this.failedChecks.includes("dateOfIssueComparison")&&this.pushQuadsForKeys(t,a,"dateOfIssue")),a}async highlightImage(t,a){let r=new Image;r.src=`data:image/png;base64,${t}`,await r.decode();let s=document.createElement("canvas");s.width=r.width,s.height=r.height;let o=s.getContext("2d");o.drawImage(r,0,0);let c=this.getMismatchedQuads(a);if(c.length===0)return "";o.beginPath(),o.rect(0,0,r.width,r.height);for(let u of c)o.moveTo(u.topLeft.x,u.topLeft.y),o.lineTo(u.topLeft.x,u.bottomRight.y),o.lineTo(u.bottomRight.x,u.bottomRight.y),o.lineTo(u.bottomRight.x,u.topLeft.y),o.lineTo(u.topLeft.x,u.topLeft.y);o.fillStyle="rgba(0, 0, 0, 0.30)",o.fill(),o.lineWidth=3,o.strokeStyle="red",o.beginPath();for(let u of c)o.rect(u.topLeft.x,u.topLeft.y,u.bottomRight.x-u.topLeft.x,u.bottomRight.y-u.topLeft.y);return o.stroke(),s.toDataURL("image/jpeg",1)}};var se=class e{get dataConsistency(){let t=this.json.rejectsInconsistentData;return this.json.dataConsistencyResult!=null&&t?J.fromJSON(this.json.dataConsistencyResult):null}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){return {...this.json}}};var K=class extends g{constructor(a){super(a);this.documentType="driverLicense";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Z=class extends g{constructor(a){super(a);this.documentType="healthInsuranceCard";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Y=class extends g{constructor(a){super(a);this.documentType="idCard";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Q=class extends g{constructor(a){super(a);this.documentType="passport";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Da=(i=>(i.Any="any",i.EuAndSchengen="euAndSchengen",i.Aruba="aruba",i.Afghanistan="afghanistan",i.Angola="angola",i.Anguilla="anguilla",i.AlandIslands="alandIslands",i.Albania="albania",i.Andorra="andorra",i.Uae="uae",i.Argentina="argentina",i.Armenia="armenia",i.AmericanSamoa="americanSamoa",i.Antarctica="antarctica",i.FrenchSouthernTerritories="frenchSouthernTerritories",i.AntiguaAndBarbuda="antiguaAndBarbuda",i.Australia="australia",i.Austria="austria",i.Azerbaijan="azerbaijan",i.Burundi="burundi",i.Belgium="belgium",i.Benin="benin",i.BonaireSintEustatiusAndSaba="bonaireSintEustatiusAndSaba",i.BurkinaFaso="burkinaFaso",i.Bangladesh="bangladesh",i.Bulgaria="bulgaria",i.Bahrain="bahrain",i.Bahamas="bahamas",i.BosniaHerzegovina="bosniaHerzegovina",i.SaintBarthelemy="saintBarthelemy",i.Belarus="belarus",i.Belize="belize",i.Bermuda="bermuda",i.Bolivia="bolivia",i.Brazil="brazil",i.Barbados="barbados",i.BruneiDarussalam="bruneiDarussalam",i.Bhutan="bhutan",i.BouvetIsland="bouvetIsland",i.Botswana="botswana",i.Car="car",i.Canada="canada",i.CocosIslands="cocosIslands",i.Switzerland="switzerland",i.Chile="chile",i.China="china",i.CoteIvoire="coteIvoire",i.Cameroon="cameroon",i.DemocraticRepublicOfCongo="democraticRepublicOfCongo",i.Congo="congo",i.CookIslands="cookIslands",i.Colombia="colombia",i.Comoros="comoros",i.CaboVerde="caboVerde",i.CostaRica="costaRica",i.Cuba="cuba",i.Curacao="curacao",i.ChristmasIsland="christmasIsland",i.CaymanIslands="caymanIslands",i.Cyprus="cyprus",i.Czechia="czechia",i.Germany="germany",i.Djibouti="djibouti",i.Dominica="dominica",i.Denmark="denmark",i.DominicanRepublic="dominicanRepublic",i.Algeria="algeria",i.Ecuador="ecuador",i.Egypt="egypt",i.Eritrea="eritrea",i.WesternSahara="westernSahara",i.Spain="spain",i.Estonia="estonia",i.Ethiopia="ethiopia",i.Finland="finland",i.Fiji="fiji",i.FalklandIslands="falklandIslands",i.France="france",i.FaroeIslands="faroeIslands",i.Micronesia="micronesia",i.Gabon="gabon",i.Uk="uk",i.Georgia="georgia",i.Guernsey="guernsey",i.Ghana="ghana",i.Gibraltar="gibraltar",i.Guinea="guinea",i.Guadeloupe="guadeloupe",i.Gambia="gambia",i.GuineaBissau="guineaBissau",i.EquatorialGuinea="equatorialGuinea",i.Greece="greece",i.Grenada="grenada",i.Greenland="greenland",i.Guatemala="guatemala",i.FrenchGuiana="frenchGuiana",i.Guam="guam",i.Guyana="guyana",i.HongKong="hongKong",i.HeardIslandAndMcDonaldIslands="heardIslandAndMcDonaldIslands",i.Honduras="honduras",i.Croatia="croatia",i.Haiti="haiti",i.Hungary="hungary",i.Indonesia="indonesia",i.IsleOfMan="isleOfMan",i.India="india",i.BritishIndianOceanTerritory="britishIndianOceanTerritory",i.Ireland="ireland",i.Iran="iran",i.Iraq="iraq",i.Iceland="iceland",i.Israel="israel",i.Italy="italy",i.Jamaica="jamaica",i.Jersey="jersey",i.Jordan="jordan",i.Japan="japan",i.Kazakhstan="kazakhstan",i.Kenya="kenya",i.Kyrgyzstan="kyrgyzstan",i.Cambodia="cambodia",i.Kiribati="kiribati",i.SaintKittsAndNevis="saintKittsAndNevis",i.SouthKorea="southKorea",i.Kuwait="kuwait",i.Lao="lao",i.Lebanon="lebanon",i.Liberia="liberia",i.Libya="libya",i.SaintLucia="saintLucia",i.Liechtenstein="liechtenstein",i.SriLanka="sriLanka",i.Lesotho="lesotho",i.Lithuania="lithuania",i.Luxembourg="luxembourg",i.Latvia="latvia",i.Macao="macao",i.FrenchSaintMartin="frenchSaintMartin",i.Morocco="morocco",i.Monaco="monaco",i.Moldova="moldova",i.Madagascar="madagascar",i.Maldives="maldives",i.Mexico="mexico",i.MarshallIslands="marshallIslands",i.NorthMacedonia="northMacedonia",i.Mali="mali",i.Malta="malta",i.Myanmar="myanmar",i.Montenegro="montenegro",i.Mongolia="mongolia",i.NorthernMarianaIslands="northernMarianaIslands",i.Mozambique="mozambique",i.Mauritania="mauritania",i.Montserrat="montserrat",i.Martinique="martinique",i.Mauritius="mauritius",i.Malawi="malawi",i.Malaysia="malaysia",i.Mayotte="mayotte",i.Namibia="namibia",i.NewCaledonia="newCaledonia",i.Niger="niger",i.NorfolkIsland="norfolkIsland",i.Nigeria="nigeria",i.Nicaragua="nicaragua",i.Niue="niue",i.Netherlands="netherlands",i.Norway="norway",i.Nepal="nepal",i.Nauru="nauru",i.NewZealand="newZealand",i.Oman="oman",i.Pakistan="pakistan",i.Panama="panama",i.Pitcairn="pitcairn",i.Peru="peru",i.Philippines="philippines",i.Palau="palau",i.PapuaNewGuinea="papuaNewGuinea",i.Poland="poland",i.PuertoRico="puertoRico",i.NorthKorea="northKorea",i.Portugal="portugal",i.Paraguay="paraguay",i.Palestine="palestine",i.FrenchPolynesia="frenchPolynesia",i.Qatar="qatar",i.Reunion="reunion",i.Romania="romania",i.Russia="russia",i.Rwanda="rwanda",i.SaudiArabia="saudiArabia",i.Sudan="sudan",i.Senegal="senegal",i.Singapore="singapore",i.SouthGeorgiaAndTheSouthSandwichIslands="southGeorgiaAndTheSouthSandwichIslands",i.SaintHelena="saintHelena",i.SvalbardAndJanMayen="svalbardAndJanMayen",i.SolomonIslands="solomonIslands",i.SierraLeone="sierraLeone",i.ElSalvador="elSalvador",i.SanMarino="sanMarino",i.Somalia="somalia",i.SaintPierreAndMiquelon="saintPierreAndMiquelon",i.Serbia="serbia",i.SouthSudan="southSudan",i.SaoTomeAndPrincipe="saoTomeAndPrincipe",i.Suriname="suriname",i.Slovakia="slovakia",i.Slovenia="slovenia",i.Sweden="sweden",i.Eswatini="eswatini",i.DutchSintMaarten="dutchSintMaarten",i.Seychelles="seychelles",i.Syria="syria",i.TurksAndCaicosIslands="turksAndCaicosIslands",i.Chad="chad",i.Togo="togo",i.Thailand="thailand",i.Tajikistan="tajikistan",i.Tokelau="tokelau",i.Turkmenistan="turkmenistan",i.TimorLeste="timorLeste",i.Tonga="tonga",i.TrinidadAndTobago="trinidadAndTobago",i.Tunisia="tunisia",i.Turkey="turkey",i.Tuvalu="tuvalu",i.Taiwan="taiwan",i.Tanzania="tanzania",i.Uganda="uganda",i.Ukraine="ukraine",i.UsMinorOutlyingIslands="usMinorOutlyingIslands",i.Uruguay="uruguay",i.Us="us",i.Uzbekistan="uzbekistan",i.HolySee="holySee",i.SaintVincentAndTheGrenadines="saintVincentAndTheGrenadines",i.Venezuela="venezuela",i.BritishVirginIslands="britishVirginIslands",i.UsVirginIslands="usVirginIslands",i.Vietnam="vietnam",i.Vanuatu="vanuatu",i.WallisAndFutuna="wallisAndFutuna",i.Samoa="samoa",i.Kosovo="kosovo",i.Yemen="yemen",i.SouthAfrica="southAfrica",i.Zambia="zambia",i.Zimbabwe="zimbabwe",i))(Da||{});var X=class extends g{constructor(a){super("any");this.documentType="regionSpecific";this.subtype=a;}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType,documentSubtype:this.subtype}}};var $=class extends g{constructor(a){super(a);this.documentType="residencePermit";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var ee=class extends g{constructor(a){super(a);this.documentType="visaIcao";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var ne=class e{get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get secondaryLastName(){return this.json.secondaryLastName}get fullName(){return this.json.fullName}get sexType(){return this.json.sex}get sex(){return this.json.sex}get dateOfBirth(){return A.fromJSON(this.json.dateOfBirth)}get age(){return this.json.age}get nationality(){return this.json.nationality}get address(){return this.json.address}get document(){if(this.json.documentType!=null){let t=this.json.documentType,a=this.json.documentSubtype,r=this.issuingCountry;switch(t){case"passport":return new Q(r);case"idCard":return new Y(r);case"driverLicense":return new K(r);case"visaIcao":return new ee(r);case"residencePermit":return new $(r);case"healthInsuranceCard":return new Z(r);case"regionSpecific":return new X(a);}}return null}get issuingCountryIso(){return this.json.issuingCountryIso}get issuingCountry(){return this.json.issuingCountry}get documentNumber(){return this.json.documentNumber}get documentAdditionalNumber(){return this.json.documentAdditionalNumber}get dateOfExpiry(){return A.fromJSON(this.json.dateOfExpiry)}get isExpired(){return this.json.isExpired}get dateOfIssue(){return A.fromJSON(this.json.dateOfIssue)}get usRealIdStatus(){var t,a;if(((t=this.json.vizResult)==null?void 0:t.usRealIdStatus)!=null&&this.json.vizResult.usRealIdStatus!=="notAvailable")return this.json.vizResult.usRealIdStatus;switch((a=this.barcode)==null?void 0:a.isRealId){case!0:return "realIdCompliant";case!1:return "notRealIdCompliant";default:return "notAvailable"}}get barcode(){var t;return this._barcodeResult==null&&this.json.barcodeResult!=null&&(this._barcodeResult=Se.fromJSON(this.json.barcodeResult)),(t=this._barcodeResult)!=null?t:null}get mrzResult(){var t;return this._mrzResult==null&&this.json.mrzResult!=null&&(this._mrzResult=fe.fromJSON(this.json.mrzResult)),(t=this._mrzResult)!=null?t:null}get vizResult(){var t;return this._vizResult==null&&this.json.vizResult!=null&&(this._vizResult=ge.fromJSON(this.json.vizResult)),(t=this._vizResult)!=null?t:null}get verificationResult(){var t;return this._verificationResult==null&&this.json.verificationResult!=null&&(this._verificationResult=se.fromJSON(this.json.verificationResult)),(t=this._verificationResult)!=null?t:new se}get images(){return Ne.fromJSON(this.json.imageInfo)}get barcodeResultsJSON(){var t,a;return {barcodeResult:(a=(t=this.barcode)==null?void 0:t.toJSONObject())!=null?a:null}}get mrzResultsJSON(){return {mrzResult:this.mrzResult?this.mrzResult.toJSONObject():null}}static fromJSON(t){let a=new e;return a.json=t,a}isIdCard(){var t,a;return (a=(t=this.document)==null?void 0:t.isIdCard())!=null?a:!1}isDriverLicense(){var t,a;return (a=(t=this.document)==null?void 0:t.isDriverLicense())!=null?a:!1}isPassport(){var t,a;return (a=(t=this.document)==null?void 0:t.isPassport())!=null?a:!1}isVisaIcao(){var t,a;return (a=(t=this.document)==null?void 0:t.isVisaIcao())!=null?a:!1}isRegionSpecific(t){return this.document?this.document.isRegionSpecific()&&this.document.subtype===t:!1}isResidencePermit(){var t,a;return (a=(t=this.document)==null?void 0:t.isResidencePermit())!=null?a:!1}isHealthInsuranceCard(){var t,a;return (a=(t=this.document)==null?void 0:t.isHealthInsuranceCard())!=null?a:!1}toJSONObject(){var t;return {firstName:this.firstName,lastName:this.lastName,secondaryLastName:this.secondaryLastName,fullName:this.fullName,sex:this.sex,nationality:this.nationality,address:this.address,issuingCountry:this.issuingCountry,issuingCountryIso:this.issuingCountryIso,documentNumber:this.documentNumber,documentAdditionalNumber:this.documentAdditionalNumber,dateOfBirth:this.dateOfBirth?this.dateOfBirth.toJSONObject():null,age:this.age,dateOfExpiry:this.dateOfExpiry?this.dateOfExpiry.toJSONObject():null,isExpired:this.isExpired,dateOfIssue:this.dateOfIssue?this.dateOfIssue.toJSONObject():null,documentType:this.document?this.document.documentType:null,documentSubtype:((t=this.document)==null?void 0:t.isRegionSpecific())==null?null:this.document.subtype,imageInfo:this.images.toJSONObject(),verificationResult:this.verificationResult?this.verificationResult.toJSONObject():null,vizResult:this.vizResult?this.vizResult.toJSONObject():null,idVerificationDataComparisonAvailable:this.json.idVerificationDataComparisonAvailable,usRealIdStatus:this.usRealIdStatus,...this.barcodeResultsJSON,...this.mrzResultsJSON}}};var ot=0;function ba(){let e=ot;return ot=ot+1,e}var O=class{constructor(t){this.action=t,this.messageID=ba();}},Re=class e extends O{constructor(t,a){super(e.action),this.wasmModuleName=t.wasmModuleName,this.licenseKey=t.licenseKey,this.userId=a,this.registerLoadCallback=t.loadProgressCallback!==null,this.allowHelloMessage=t.allowHelloMessage,this.engineLocation=t.engineLocation,this.wasmType=t.wasmType,this.initialMemory=t.initialMemory,this.blinkIDVariant=t.blinkIdVariant,this.numberOfWorkers=t.numberOfWorkers;}};Re.action="init";var te;(function(e){e[e.Any=0]="Any",e[e.Recognizer=1]="Recognizer",e[e.RecognizerSettings=2]="RecognizerSettings",e[e.Callback=3]="Callback";})(te||(te={}));var Oe=class e extends O{constructor(t,a){super(e.action),this.className=t,this.params=a;}};Oe.action="createNewNativeObject";var Ee=class e extends O{constructor(t,a,r){super(e.action),this.recognizerHandles=t,this.allowMultipleResults=a,this.registeredMetadataCallbacks=r;}};Ee.action="createRecognizerRunner";var De=class e extends O{constructor(t,a){super(e.action),this.recognizerHandles=t,this.allowMultipleResults=a;}};De.action="reconfigureRecognizerRunner";var be=class e extends O{constructor(){super(e.action);}};be.action="deleteRecognizerRunner";var q=class e extends O{constructor(t,a,r){super(e.action),this.objectHandle=t,this.methodName=a,this.params=r;}};q.action="invokeObject";var _e=class e extends O{constructor(t){super(e.action),this.frame=t;}getTransferrables(){return [this.frame.imageData.data.buffer]}};_e.action="processImage";var Te=class e extends O{constructor(t){super(e.action),this.hardReset=t;}};Te.action="resetRecognizers";var lt=class{constructor(){this.onDebugText=!1,this.onDetectionFailed=!1,this.onQuadDetection=!1,this.onPointsDetection=!1,this.onFirstSideResult=!1;}},Le=class e extends O{constructor(t){super(e.action),this.registeredMetadataCallbacks=t;}};Le.action="registerMetadataCallbacks";var ve=class e extends O{constructor(t){super(e.action),this.detectionOnlyMode=t;}};ve.action="setDetectionOnly";var Me=class e extends O{constructor(t){super(e.action),this.cameraPreviewMirrored=t;}};Me.action="setCameraPreviewMirrored";var we=class e extends O{constructor(t){super(e.action),this.userId=t;}};we.action="getProductIntegrationInfo";var Pe=class e extends O{constructor(t){super(e.action),this.pingProxyUrl=t;}};Pe.action="setPingProxyUrl";var ye=class e extends O{constructor(t){super(e.action),this.data=t;}};ye.action="setPingData";var M;(function(e){e[e.onDebugText=0]="onDebugText",e[e.onDetectionFailed=1]="onDetectionFailed",e[e.onQuadDetection=2]="onQuadDetection",e[e.onPointsDetection=3]="onPointsDetection",e[e.onFirstSideResult=4]="onFirstSideResult",e[e.recognizerCallback=5]="recognizerCallback";})(M||(M={}));var k;(function(e){e.Basic="BASIC",e.Advanced="ADVANCED",e.AdvancedWithThreads="ADVANCED_WITH_THREADS";})(k||(k={}));var _a=atob("Q2VudGF1cnVz"),R=class extends Error{constructor(t,a){if(super(),!t.code||!t.message)throw new Error("Instance of SDKError is required to have code and message.");if(this.message=t.message,this.code=t.code,"details"in t){if("message"in t.details){let r=new Error(t.details.message);"stack"in t.details&&(r.stack=t.details.stack),this.details=r;}}else this.details=a;}};function Ta(e){return /^https:\/\/[^\/]+(?::\d+)?\/?$/.test(e)}var h;(function(e){e.WORKER_WASM_LOAD_FAILURE="WORKER_WASM_LOAD_FAILURE",e.WORKER_WASM_INIT_MISSING="WORKER_WASM_INIT_MISSING",e.WORKER_FUNCTION_INVOKE_FAILURE="WORKER_FUNCTION_INVOKE_FAILURE",e.WORKER_RECOGNIZER_CREATION_FAILURE="WORKER_RECOGNIZER_CREATION_FAILURE",e.WORKER_RUNNER_EXISTS="WORKER_RUNNER_EXISTS",e.WORKER_RUNNER_CREATION_FAILURE="WORKER_RUNNER_CREATION_FAILURE",e.WORKER_RUNNER_MISSING="WORKER_RUNNER_MISSING",e.WORKER_RUNNER_RECONFIGURE_FAILURE="WORKER_RUNNER_RECONFIGURE_FAILURE",e.WORKER_RUNNER_DELETED="WORKER_RUNNER_DELETED",e.WORKER_RUNNER_DELETE_FAILURE="WORKER_RUNNER_DELETE_FAILURE",e.WORKER_OBJECT_INVOKE_FAILURE="WORKER_OBJECT_INVOKE_FAILURE",e.WORKER_IMAGE_PROCESS_FAILURE="WORKER_IMAGE_PROCESS_FAILURE",e.WORKER_HANDLE_UNDEFINED="WORKER_HANDLE_UNDEFINED",e.WORKER_MESSAGE_ACTION_UNKNOWN="WORKER_MESSAGE_ACTION_UNKNOWN",e.WORKER_LICENSE_UNLOCK_ERROR="WORKER_LICENSE_UNLOCK_ERROR",e.WORKER_INTEGRATION_INFO_FAILURE="WORKER_INTEGRATION_INFO_FAILURE",e.LOCAL_SDK_RUNNER_MISSING="LOCAL_SDK_RUNNER_MISSING",e.LOCAL_SDK_RUNNER_EMPTY="LOCAL_SDK_RUNNER_EMPTY",e.LICENSE_UNLOCK_ERROR="LICENSE_UNLOCK_ERROR",e.FRAME_CAPTURE_SVG_UNSUPPORTED="FRAME_CAPTURE_SVG_UNSUPPORTED",e.FRAME_CAPTURE_CANVAS_MISSING="FRAME_CAPTURE_CANVAS_MISSING",e.SDK_WASM_SETTINGS_MISSING="SDK_WASM_SETTINGS_MISSING",e.SDK_LICENSE_KEY_MISSING="SDK_LICENSE_KEY_MISSING",e.SDK_WASM_MODULE_NAME_MISSING="SDK_WASM_MODULE_NAME_MISSING",e.SDK_ENGINE_LOCATION_INVALID="SDK_ENGINE_LOCATION_INVALID",e.SDK_WORKER_LOCATION_INVALID="SDK_WORKER_LOCATION_INVALID",e.SDK_MISSING="SDK_MISSING",e.SDK_RECOGNIZERS_MISSING="SDK_RECOGNIZERS_MISSING",e.VIDEO_RECOGNIZER_ELEMENT_MISSING="VIDEO_RECOGNIZER_ELEMENT_MISSING",e.VIDEO_RECOGNIZER_CAMERA_MISSING="VIDEO_RECOGNIZER_CAMERA_MISSING",e.VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED="VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED",e.VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE="VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE",e.VIDEO_RECOGNIZER_CAMERA_IN_USE="VIDEO_RECOGNIZER_CAMERA_IN_USE",e.VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED="VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED",e.VIDEO_RECOGNIZER_FEED_RELEASED="VIDEO_RECOGNIZER_FEED_RELEASED",e.VIDEO_RECOGNIZER_FEED_NOT_PAUSED="VIDEO_RECOGNIZER_FEED_NOT_PAUSED",e.VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED="VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED",e.VIDEO_RECOGNIZER_FEED_PAUSED="VIDEO_RECOGNIZER_FEED_PAUSED",e.VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE="VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE",e.VIDEO_RECOGNIZER_FEED_MISSING="VIDEO_RECOGNIZER_FEED_MISSING",e.INVALID_PING_PROXY_URL="INVALID_PROXY_URL",e.PING_PROXY_PERMISSION_NOT_GRANTED="PING_PROXY_PERMISSION_NOT_GRANTED",e.PING_DATA_KEYS_AMOUNT_EXCEEDED="PING_DATA_KEYS_AMOUNT_EXCEEDED",e.PING_DATA_KEY_LENGTH_EXCEEDED="PING_DATA_KEY_LENGTH_EXCEEDED",e.PING_DATA_VALUE_LENGTH_EXCEEDED="PING_DATA_VALUE_LENGTH_EXCEEDED";})(h||(h={}));var m;(function(e){e.WORKER_HANDLE_UNDEFINED="Cannot find object with handle: undefined",e.WORKER_WASM_LOAD_FAILURE="Failed to load WASM in web worker!",e.WORKER_WASM_INIT_MISSING="WASM module is not initialized!",e.WORKER_FUNCTION_INVOKE_FAILURE="Failed to invoke function!",e.WORKER_RECOGNIZER_CREATION_FAILURE="Failed to create new recognizer!",e.WORKER_RUNNER_EXISTS="Recognizer runner is already created! Multiple instances are not allowed!",e.WORKER_RUNNER_CREATION_FAILURE="Failed to create new recognizer runner!",e.WORKER_RUNNER_MISSING="Recognizer runner is not created! There is nothing to reconfigure!",e.WORKER_RUNNER_RECONFIGURE_FAILURE="Failed to reconfigure recognizer runner!",e.WORKER_RUNNER_DELETED="Recognizer runner is already deleted!",e.WORKER_RUNNER_DELETE_FAILURE="Failed to delete recognizer runner!",e.WORKER_OBJECT_INVOKE_FAILURE="Failed to invoke object!",e.WORKER_IMAGE_PROCESS_FAILURE="Recognizer runner is not initialized! Cannot process image!",e.WORKER_INTEGRATION_INFO_FAILURE="Failed to get product integration info!",e.LOCAL_SDK_RUNNER_MISSING="Property nativeRecognizerRunner is not available!",e.LOCAL_SDK_RUNNER_EMPTY="Native RecognizerRunner cannot be empty!",e.LICENSE_TOKEN_STATE_INCORRECT="Internal error (Incorrect token state)",e.LICENSE_PAYLOAD_VERIFICATION_FAILED="Failed to verify server permission's digital signature!",e.LICENSE_PAYLOAD_CORRUPTED="Server permission payload is corrupted!",e.LICENSE_PERMISSION_EXPIRED="Internal error (server permission expired)",e.LICENSE_REMOTE_LOCKED="Provided license key has been remotely locked. Please contact support for more information!",e.FRAME_CAPTURE_SVG_UNSUPPORTED="Recognition of SVG elements not supported!",e.FRAME_CAPTURE_CANVAS_MISSING="Could not get canvas 2d context!",e.SDK_WASM_SETTINGS_MISSING="Missing WASM load settings!",e.SDK_LICENSE_KEY_MISSING="Missing license key!",e.SDK_WASM_MODULE_NAME_MISSING="Missing WASM module name!",e.SDK_ENGINE_LOCATION_INVALID="Setting property 'engineLocation' must be a string!",e.SDK_WORKER_LOCATION_INVALID="Setting property 'workerLocation' must be a string!",e.SDK_MISSING="SDK is not provided!",e.SDK_RECOGNIZERS_MISSING="To create RecognizerRunner at least 1 recognizer is required.",e.VIDEO_RECOGNIZER_ELEMENT_MISSING="Video element, i.e. camera feed is not provided!",e.VIDEO_RECOGNIZER_CAMERA_MISSING="Camera not found!",e.VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED="Camera not allowed!",e.VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE="Camera not available!",e.VIDEO_RECOGNIZER_CAMERA_IN_USE="Camera in use!",e.VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED="Media devices not supported by browser.",e.VIDEO_RECOGNIZER_FEED_RELEASED="The associated video feed has been released!",e.VIDEO_RECOGNIZER_FEED_NOT_PAUSED="The associated video feed is not paused. Use resumeRecognition instead!",e.VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED="The play() request was interrupted or prevented by browser security rules!",e.VIDEO_RECOGNIZER_FEED_PAUSED="Cannot resume recognition while video feed is paused! Use recognize or startRecognition",e.VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE="Could not reset recognizers!",e.VIDEO_RECOGNIZER_FEED_MISSING="Missing video feed!",e.INVALID_PING_PROXY_URL="Provided ping proxy URL is not a valid secure URL in format 'https://{host}:{port?}'.",e.PING_PROXY_PERMISSION_NOT_GRANTED="Allow ping proxy permission not found in license.",e.PING_DATA_KEYS_AMOUNT_EXCEEDED="Maximum number of ping data keys exceeded.",e.PING_DATA_KEY_LENGTH_EXCEEDED="Ping data key is too long.",e.PING_DATA_VALUE_LENGTH_EXCEEDED="Ping data value is too long.";})(m||(m={}));var U={wasmSettingsMissing:{message:m.SDK_WASM_SETTINGS_MISSING,code:h.SDK_WASM_SETTINGS_MISSING},licenseKeyMissing:{message:m.SDK_LICENSE_KEY_MISSING,code:h.SDK_LICENSE_KEY_MISSING},wasmModuleNameMissing:{message:m.SDK_WASM_MODULE_NAME_MISSING,code:h.SDK_WASM_MODULE_NAME_MISSING},engineLocationInvalid:{message:m.SDK_ENGINE_LOCATION_INVALID,code:h.SDK_ENGINE_LOCATION_INVALID},workerLocationInvalid:{message:m.SDK_WORKER_LOCATION_INVALID,code:h.SDK_WORKER_LOCATION_INVALID},missing:{message:m.SDK_MISSING,code:h.SDK_MISSING},recognizersMissing:{message:m.SDK_RECOGNIZERS_MISSING,code:h.SDK_RECOGNIZERS_MISSING}},La={invalidProxyUrl:{message:m.INVALID_PING_PROXY_URL,code:h.INVALID_PING_PROXY_URL},permissionNotGranted:{message:m.PING_PROXY_PERMISSION_NOT_GRANTED,code:h.PING_PROXY_PERMISSION_NOT_GRANTED},dataKeysAmountExceeded:{message:m.PING_DATA_KEYS_AMOUNT_EXCEEDED,code:h.PING_DATA_KEYS_AMOUNT_EXCEEDED},dataKeyLengthExceeded:{message:m.PING_DATA_KEY_LENGTH_EXCEEDED,code:h.PING_DATA_KEY_LENGTH_EXCEEDED},dataValueLengthExceeded:{message:m.PING_DATA_VALUE_LENGTH_EXCEEDED,code:h.PING_DATA_VALUE_LENGTH_EXCEEDED}};function L(e,t){return a=>{let r=a;r.success?e():typeof r.error=="string"||r.error===null?t(r.error):t(new R(r.error));}}function W(e,t){return a=>{let r=a;r.success?e(a):typeof r.error=="string"||r.error===null?t(r.error):t(new R(r.error));}}function va(e){let t=[];for(let a of e){let r=te.Any;a instanceof qe&&(r=te.Recognizer,a=a.getRemoteObjectHandle()),t.push({parameter:a,type:r});}return t}var qe=class{constructor(t,a,r){this.wasmSDKWorker=t,this.objectHandle=r,this.recognizerName=a,this.callbacks=new Map;}getRemoteObjectHandle(){return this.objectHandle}currentSettings(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"currentSettings",[]),s=W(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}toSignedJSON(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"toSignedJSON",[]),s=W(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}clearAllCallbacks(){this.callbacks.clear(),this.wasmSDKWorker.unregisterRecognizerCallbacks(this.objectHandle);}removeFunctions(t){this.clearAllCallbacks();let a=Object.keys(t),r=!1;for(let s of a){let o=t[s];if(typeof o=="function"){this.callbacks.set(s,o);let c={parameter:{recognizerHandle:this.objectHandle,callbackName:s},type:te.Callback};t[s]=c,r=!0;}}return r&&this.wasmSDKWorker.registerRecognizerCallbacks(this.objectHandle,this),t}updateSettings(t){return new Promise((a,r)=>{if(this.objectHandle<0){r("Invalid object handle: "+this.objectHandle.toString());return}let s=new q(this.objectHandle,"updateSettings",[{parameter:this.removeFunctions(t),type:te.RecognizerSettings}]),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}invokeCallback(t,a){let r=this.callbacks.get(t);r!==void 0?r(...a):console.warn("Cannot find callback",t);}getResult(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"getResult",[]),s=W(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}delete(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}this.clearAllCallbacks();let r=new q(this.objectHandle,"delete",[]),s=L(()=>{this.objectHandle=-1,t();},a);this.wasmSDKWorker.postMessage(r,s);})}};function zt(e){let t=new lt;return t.onDebugText=!!e.onDebugText,t.onDetectionFailed=!!e.onDetectionFailed,t.onPointsDetection=!!e.onPointsDetection,t.onQuadDetection=!!e.onQuadDetection,t.onFirstSideResult=!!e.onFirstSideResult,t}var ut=class{constructor(t,a){this.deleted=!1,this.wasmSDKWorker=t,this.recognizers=a;}processImage(t){return new Promise((a,r)=>{if(this.deleted){r("Recognizer runner is deleted. It cannot be used anymore!");return}let s=new _e(t),o=W(c=>{let u=c.recognitionState;a(u);},r);this.wasmSDKWorker.postTransferrableMessage(s,o);})}reconfigureRecognizers(t,a){return new Promise((r,s)=>{if(this.deleted){s("Recognizer runner is deleted. It cannot be used anymore!");return}let o=Jt(t),c=new De(o,a),u=L(r,s);this.wasmSDKWorker.postMessage(c,u),this.recognizers=t;})}setMetadataCallbacks(t){return new Promise((a,r)=>{let s=new Le(zt(t)),o=L(a,r);this.wasmSDKWorker.postMessageAndRegisterCallbacks(s,t,o);})}resetRecognizers(t){return new Promise((a,r)=>{let s=new Te(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setDetectionOnlyMode(t){return new Promise((a,r)=>{let s=new ve(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setPingProxyUrl(t){if(!Ta(t))throw new R(La.invalidProxyUrl);return new Promise((a,r)=>{let s=new Pe(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setPingData(t){return new Promise((a,r)=>{let s=new ye(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setCameraPreviewMirrored(t){return new Promise((a,r)=>{let s=new Me(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}delete(){return this.deleted?Promise.reject("Recognizer runner is already deleted."):new Promise((t,a)=>{let r=new be,s=L(()=>{this.deleted=!0,t();},a);this.wasmSDKWorker.postMessage(r,s);})}};function Jt(e){let t=[];for(let a of e)t.push(a.getRemoteObjectHandle());return t}var ct=class{constructor(t){this.wasmSDKWorker=t;}createRecognizerRunner(t,a=!1,r={}){return new Promise((s,o)=>{let c=Jt(t),u=new Ee(c,a,zt(r)),I=L(()=>{s(new ut(this.wasmSDKWorker,t));},o);this.wasmSDKWorker.postMessageAndRegisterCallbacks(u,r,I);})}newRecognizer(t,...a){return new Promise((r,s)=>{let o=new Oe(t,va(a)),c=W(u=>{let I=new qe(this.wasmSDKWorker,t,u.objectHandle);r(I);},s);this.wasmSDKWorker.postMessage(o,c);})}},dt=class e{constructor(t,a,r,s){this.eventHandlers={},this.metadataCallbacks={},this.loadedWasmType=k.Basic,this.mbWasmWorker=t,this.mbWasmWorker.onmessage=o=>{this.handleWorkerEvent(o);},this.mbWasmWorker.onerror=()=>{s("Problem during initialization of worker file!");},this.mbWasmModule=new ct(this),this.loadCallback=a,this.recognizersWithCallbacks=new Map,this.userId=r,this.showOverlay=!1;}postMessage(t,a){this.eventHandlers[t.messageID]=a,this.mbWasmWorker.postMessage(t);}postTransferrableMessage(t,a){this.eventHandlers[t.messageID]=a,this.mbWasmWorker.postMessage(t,t.getTransferrables());}postMessageAndRegisterCallbacks(t,a,r){this.eventHandlers[t.messageID]=r,this.metadataCallbacks=a,this.mbWasmWorker.postMessage(t);}registerRecognizerCallbacks(t,a){this.recognizersWithCallbacks.set(t,a);}unregisterRecognizerCallbacks(t){this.recognizersWithCallbacks.delete(t);}delete(){this.mbWasmWorker.terminate();}getProductIntegrationInfo(){return new Promise((t,a)=>{let r=new we(this.userId),s=W(o=>{t(o.result);},a);this.postMessage(r,s);})}handleWorkerEvent(t){if("isCallbackMessage"in t.data){let a=t.data;switch(a.callbackType){case M.onDebugText:typeof this.metadataCallbacks.onDebugText=="function"&&this.metadataCallbacks.onDebugText(a.callbackParameters[0]);break;case M.onDetectionFailed:typeof this.metadataCallbacks.onDetectionFailed=="function"&&this.metadataCallbacks.onDetectionFailed();break;case M.onPointsDetection:typeof this.metadataCallbacks.onPointsDetection=="function"&&this.metadataCallbacks.onPointsDetection(a.callbackParameters[0]);break;case M.onQuadDetection:typeof this.metadataCallbacks.onQuadDetection=="function"&&this.metadataCallbacks.onQuadDetection(a.callbackParameters[0]);break;case M.onFirstSideResult:typeof this.metadataCallbacks.onFirstSideResult=="function"&&this.metadataCallbacks.onFirstSideResult();break;case M.recognizerCallback:{let r=a.callbackParameters.shift(),s=this.recognizersWithCallbacks.get(r.recognizerHandle);s!==void 0?s.invokeCallback(r.callbackName,a.callbackParameters):console.warn("Cannot find recognizer to deliver callback message. Maybe it's destroyed?",r);break}default:throw new Error(`Unknown callback type: ${M[a.callbackType]}`)}}else if("isLoadProgressMessage"in t.data){let a=t.data;typeof this.loadCallback=="function"&&this.loadCallback(a.progress);}else {let a=t.data,r=this.eventHandlers[a.messageID];delete this.eventHandlers[a.messageID],r(a);}}static async createWasmWorker(t,a,r){return new Promise((s,o)=>{let c=new e(t,a.loadProgressCallback,r,o),u=new Re(a,r),I=W(N=>{let C=N;c.showOverlay=C.showOverlay,c.loadedWasmType=C.wasmType,s(c);},N=>{c&&typeof c.delete=="function"&&c.delete(),o(N);});c.postMessage(u,I);})}},Tt;(function(e){e[e.BackFacingCamera=0]="BackFacingCamera",e[e.FrontFacingCamera=1]="FrontFacingCamera";})(Tt||(Tt={}));var Ue;(function(e){e[e.RotatedLeft90=0]="RotatedLeft90",e[e.NoRotation=1]="NoRotation",e[e.RotatedRight90=2]="RotatedRight90",e[e.Rotated180=3]="Rotated180";})(Ue||(Ue={}));var b;(function(e){e[e.Empty=0]="Empty",e[e.Uncertain=1]="Uncertain",e[e.Valid=2]="Valid",e[e.StageValid=3]="StageValid";})(b||(b={}));var Lt;(function(e){e[e.Front=0]="Front",e[e.Back=1]="Back";})(Lt||(Lt={}));var ke=class{constructor(t,a,r){let s={data:t.data,width:t.width,height:t.height,colorSpace:t.colorSpace};this.imageData=s,this.orientation=a,this.videoFrame=r;}};var vt;(function(e){e[e.Invalid=0]="Invalid",e[e.RequiresServerPermission=1]="RequiresServerPermission",e[e.Valid=2]="Valid";})(vt||(vt={}));var Mt;(function(e){e.LicenseTokenStateInvalid="LICENSE_TOKEN_STATE_INVALID",e.NetworkError="NETWORK_ERROR",e.RemoteLock="REMOTE_LOCK",e.PermissionExpired="PERMISSION_EXPIRED",e.PayloadCorrupted="PAYLOAD_CORRUPTED",e.PayloadSignatureVerificationFailed="PAYLOAD_SIGNATURE_VERIFICATION_FAILED",e.IncorrectTokenState="INCORRECT_TOKEN_STATE";})(Mt||(Mt={}));var wt;(function(e){e[e.Ok=0]="Ok",e[e.NetworkError=1]="NetworkError",e[e.RemoteLock=2]="RemoteLock",e[e.PermissionExpired=3]="PermissionExpired",e[e.PayloadCorrupted=4]="PayloadCorrupted",e[e.PayloadSignatureVerificationFailed=5]="PayloadSignatureVerificationFailed",e[e.IncorrectTokenState=6]="IncorrectTokenState";})(wt||(wt={}));var w;(function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.CameraTooFar=2]="CameraTooFar",e[e.CameraTooClose=3]="CameraTooClose",e[e.CameraAngleTooSteep=4]="CameraAngleTooSteep",e[e.DocumentTooCloseToCameraEdge=5]="DocumentTooCloseToCameraEdge",e[e.DocumentPartiallyVisible=6]="DocumentPartiallyVisible",e[e.FallbackSuccess=7]="FallbackSuccess";})(w||(w={}));var pt=class extends Error{constructor(){super("Throttled function aborted"),this.name="AbortError";}};function Ma({limit:e,interval:t,strict:a}){if(!Number.isFinite(e))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(t))throw new TypeError("Expected `interval` to be a finite number");let r=new Map,s=0,o=0;function c(){let C=Date.now();return C-s>t?(o=1,s=C,0):(o<e?o++:(s+=t,o=1),s-C)}let u=[];function I(){let C=Date.now();if(u.length<e)return u.push(C),0;let f=u.shift()+t;return C>=f?(u.push(C),0):(u.push(f),f-C)}let N=a?I:c;return C=>{let f=function(...P){if(!f.isEnabled)return (async()=>C.apply(this,P))();let j;return new Promise((ce,de)=>{j=setTimeout(()=>{ce(C.apply(this,P)),r.delete(j);},N()),r.set(j,de);})};return f.abort=()=>{for(let P of r.keys())clearTimeout(P),r.get(P)(new pt);r.clear(),u.splice(0,u.length);},f.isEnabled=!0,Object.defineProperty(f,"queueSize",{get(){return r.size}}),f}}var wa=15;Ma({limit:1,interval:Math.round(1/wa*1e3),strict:!0});var Pt;(function(e){e[e.Recognition=0]="Recognition",e[e.RecognitionTest=1]="RecognitionTest",e[e.DetectionTest=2]="DetectionTest";})(Pt||(Pt={}));var xe=class{constructor(t){if(this.allowHelloMessage=!0,this.engineLocation="",this.workerLocation="",this.wasmType=null,this.numberOfWorkers=null,this.loadProgressCallback=null,this.wasmModuleName=_a,!t)throw new R(U.licenseKeyMissing);this.licenseKey=t;}};function yt(){return ("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function Pa(){try{let e=localStorage.getItem("mb-user-id");return e===null&&(e=yt(),localStorage.setItem("mb-user-id",e)),e}catch(e){return yt()}}async function Kt(e){return new Promise((t,a)=>{if(!e||typeof e!="object"){a(new R(U.wasmSettingsMissing));return}if(typeof e.licenseKey!="string"){a(new R(U.licenseKeyMissing));return}if(!e.wasmModuleName){a(new R(U.wasmModuleNameMissing));return}if(typeof e.engineLocation!="string"){a(new R(U.engineLocationInvalid));return}if(typeof e.workerLocation!="string"){a(new R(U.workerLocationInvalid));return}let r=Pa();try{let s=`/resources/${e.wasmModuleName}.worker.min.js`,o=window.location.origin+s,c=e.workerLocation||o;e.allowHelloMessage&&console.log("Worker location is:",c);let u=new Worker(c);dt.createWasmWorker(u,e,r).then(I=>{t(I);},a);}catch(s){a(s);}})}async function Zt(e,t,a=!1,r={}){if(typeof e!="object")throw new R(U.missing);if(typeof t!="object"||t.length<1)throw new R(U.recognizersMissing);return e.mbWasmModule.createRecognizerRunner(t,a,r)}var qt;(function(e){e[e.NONE=0]="NONE",e[e.QR_CODE=1]="QR_CODE",e[e.DATA_MATRIX=2]="DATA_MATRIX",e[e.UPC_E=3]="UPC_E",e[e.UPC_A=4]="UPC_A",e[e.EAN_8=5]="EAN_8",e[e.EAN_13=6]="EAN_13",e[e.CODE_128=7]="CODE_128",e[e.CODE_39=8]="CODE_39",e[e.ITF=9]="ITF",e[e.AZTEC_BARCODE=10]="AZTEC_BARCODE",e[e.PDF417_BARCODE=11]="PDF417_BARCODE";})(qt||(qt={}));var B;(function(e){e[e.None=0]="None",e[e.ImageOnly=1]="ImageOnly",e[e.ResultFieldsOnly=2]="ResultFieldsOnly",e[e.FullResult=3]="FullResult";})(B||(B={}));var Fe=class{constructor(){this.enableMrzId=!0,this.enableMrzPassport=!0,this.enableMrzVisa=!0,this.enablePhotoId=!0,this.enableBarcodeId=!0,this.enableFullDocumentRecognition=!0;}},Ut;(function(e){e[e.Strict=0]="Strict",e[e.Normal=1]="Normal",e[e.Relaxed=2]="Relaxed";})(Ut||(Ut={}));var kt;(function(e){e[e.Latin=0]="Latin",e[e.Arabic=1]="Arabic",e[e.Cyrillic=2]="Cyrillic",e[e.Greek=3]="Greek",e[e.Count=4]="Count";})(kt||(kt={}));var xt;(function(e){e[e.DocumentType=0]="DocumentType",e[e.StandardVersionNumber=1]="StandardVersionNumber",e[e.CustomerFamilyName=2]="CustomerFamilyName",e[e.CustomerFirstName=3]="CustomerFirstName",e[e.CustomerFullName=4]="CustomerFullName",e[e.DateOfBirth=5]="DateOfBirth",e[e.Sex=6]="Sex",e[e.EyeColor=7]="EyeColor",e[e.AddressStreet=8]="AddressStreet",e[e.AddressCity=9]="AddressCity",e[e.AddressJurisdictionCode=10]="AddressJurisdictionCode",e[e.AddressPostalCode=11]="AddressPostalCode",e[e.FullAddress=12]="FullAddress",e[e.Height=13]="Height",e[e.HeightIn=14]="HeightIn",e[e.HeightCm=15]="HeightCm",e[e.CustomerMiddleName=16]="CustomerMiddleName",e[e.HairColor=17]="HairColor",e[e.NameSuffix=18]="NameSuffix",e[e.AKAFullName=19]="AKAFullName",e[e.AKAFamilyName=20]="AKAFamilyName",e[e.AKAGivenName=21]="AKAGivenName",e[e.AKASuffixName=22]="AKASuffixName",e[e.WeightRange=23]="WeightRange",e[e.WeightPounds=24]="WeightPounds",e[e.WeightKilograms=25]="WeightKilograms",e[e.CustomerIdNumber=26]="CustomerIdNumber",e[e.FamilyNameTruncation=27]="FamilyNameTruncation",e[e.FirstNameTruncation=28]="FirstNameTruncation",e[e.MiddleNameTruncation=29]="MiddleNameTruncation",e[e.PlaceOfBirth=30]="PlaceOfBirth",e[e.AddressStreet2=31]="AddressStreet2",e[e.RaceEthnicity=32]="RaceEthnicity",e[e.NamePrefix=33]="NamePrefix",e[e.CountryIdentification=34]="CountryIdentification",e[e.ResidenceStreetAddress=35]="ResidenceStreetAddress",e[e.ResidenceStreetAddress2=36]="ResidenceStreetAddress2",e[e.ResidenceCity=37]="ResidenceCity",e[e.ResidenceJurisdictionCode=38]="ResidenceJurisdictionCode",e[e.ResidencePostalCode=39]="ResidencePostalCode",e[e.ResidenceFullAddress=40]="ResidenceFullAddress",e[e.Under18=41]="Under18",e[e.Under19=42]="Under19",e[e.Under21=43]="Under21",e[e.SocialSecurityNumber=44]="SocialSecurityNumber",e[e.AKASocialSecurityNumber=45]="AKASocialSecurityNumber",e[e.AKAMiddleName=46]="AKAMiddleName",e[e.AKAPrefixName=47]="AKAPrefixName",e[e.OrganDonor=48]="OrganDonor",e[e.Veteran=49]="Veteran",e[e.AKADateOfBirth=50]="AKADateOfBirth",e[e.IssuerIdentificationNumber=51]="IssuerIdentificationNumber",e[e.DocumentExpirationDate=52]="DocumentExpirationDate",e[e.JurisdictionVersionNumber=53]="JurisdictionVersionNumber",e[e.JurisdictionVehicleClass=54]="JurisdictionVehicleClass",e[e.JurisdictionRestrictionCodes=55]="JurisdictionRestrictionCodes",e[e.JurisdictionEndorsementCodes=56]="JurisdictionEndorsementCodes",e[e.DocumentIssueDate=57]="DocumentIssueDate",e[e.FederalCommercialVehicleCodes=58]="FederalCommercialVehicleCodes",e[e.IssuingJurisdiction=59]="IssuingJurisdiction",e[e.StandardVehicleClassification=60]="StandardVehicleClassification",e[e.IssuingJurisdictionName=61]="IssuingJurisdictionName",e[e.StandardEndorsementCode=62]="StandardEndorsementCode",e[e.StandardRestrictionCode=63]="StandardRestrictionCode",e[e.JurisdictionVehicleClassificationDescription=64]="JurisdictionVehicleClassificationDescription",e[e.JurisdictionEndorsmentCodeDescription=65]="JurisdictionEndorsmentCodeDescription",e[e.JurisdictionRestrictionCodeDescription=66]="JurisdictionRestrictionCodeDescription",e[e.InventoryControlNumber=67]="InventoryControlNumber",e[e.CardRevisionDate=68]="CardRevisionDate",e[e.DocumentDiscriminator=69]="DocumentDiscriminator",e[e.LimitedDurationDocument=70]="LimitedDurationDocument",e[e.AuditInformation=71]="AuditInformation",e[e.ComplianceType=72]="ComplianceType",e[e.IssueTimestamp=73]="IssueTimestamp",e[e.PermitExpirationDate=74]="PermitExpirationDate",e[e.PermitIdentifier=75]="PermitIdentifier",e[e.PermitIssueDate=76]="PermitIssueDate",e[e.NumberOfDuplicates=77]="NumberOfDuplicates",e[e.HAZMATExpirationDate=78]="HAZMATExpirationDate",e[e.MedicalIndicator=79]="MedicalIndicator",e[e.NonResident=80]="NonResident",e[e.UniqueCustomerId=81]="UniqueCustomerId",e[e.DataDiscriminator=82]="DataDiscriminator",e[e.DocumentExpirationMonth=83]="DocumentExpirationMonth",e[e.DocumentNonexpiring=84]="DocumentNonexpiring",e[e.SecurityVersion=85]="SecurityVersion",e[e.Count=86]="Count";})(xt||(xt={}));var S;(function(e){e[e.NONE=0]="NONE",e[e.ALBANIA=1]="ALBANIA",e[e.ALGERIA=2]="ALGERIA",e[e.ARGENTINA=3]="ARGENTINA",e[e.AUSTRALIA=4]="AUSTRALIA",e[e.AUSTRIA=5]="AUSTRIA",e[e.AZERBAIJAN=6]="AZERBAIJAN",e[e.BAHRAIN=7]="BAHRAIN",e[e.BANGLADESH=8]="BANGLADESH",e[e.BELGIUM=9]="BELGIUM",e[e.BOSNIA_AND_HERZEGOVINA=10]="BOSNIA_AND_HERZEGOVINA",e[e.BRUNEI=11]="BRUNEI",e[e.BULGARIA=12]="BULGARIA",e[e.CAMBODIA=13]="CAMBODIA",e[e.CANADA=14]="CANADA",e[e.CHILE=15]="CHILE",e[e.COLOMBIA=16]="COLOMBIA",e[e.COSTA_RICA=17]="COSTA_RICA",e[e.CROATIA=18]="CROATIA",e[e.CYPRUS=19]="CYPRUS",e[e.CZECHIA=20]="CZECHIA",e[e.DENMARK=21]="DENMARK",e[e.DOMINICAN_REPUBLIC=22]="DOMINICAN_REPUBLIC",e[e.EGYPT=23]="EGYPT",e[e.ESTONIA=24]="ESTONIA",e[e.FINLAND=25]="FINLAND",e[e.FRANCE=26]="FRANCE",e[e.GEORGIA=27]="GEORGIA",e[e.GERMANY=28]="GERMANY",e[e.GHANA=29]="GHANA",e[e.GREECE=30]="GREECE",e[e.GUATEMALA=31]="GUATEMALA",e[e.HONG_KONG=32]="HONG_KONG",e[e.HUNGARY=33]="HUNGARY",e[e.INDIA=34]="INDIA",e[e.INDONESIA=35]="INDONESIA",e[e.IRELAND=36]="IRELAND",e[e.ISRAEL=37]="ISRAEL",e[e.ITALY=38]="ITALY",e[e.JORDAN=39]="JORDAN",e[e.KAZAKHSTAN=40]="KAZAKHSTAN",e[e.KENYA=41]="KENYA",e[e.KOSOVO=42]="KOSOVO",e[e.KUWAIT=43]="KUWAIT",e[e.LATVIA=44]="LATVIA",e[e.LITHUANIA=45]="LITHUANIA",e[e.MALAYSIA=46]="MALAYSIA",e[e.MALDIVES=47]="MALDIVES",e[e.MALTA=48]="MALTA",e[e.MAURITIUS=49]="MAURITIUS",e[e.MEXICO=50]="MEXICO",e[e.MOROCCO=51]="MOROCCO",e[e.NETHERLANDS=52]="NETHERLANDS",e[e.NEW_ZEALAND=53]="NEW_ZEALAND",e[e.NIGERIA=54]="NIGERIA",e[e.PAKISTAN=55]="PAKISTAN",e[e.PANAMA=56]="PANAMA",e[e.PARAGUAY=57]="PARAGUAY",e[e.PHILIPPINES=58]="PHILIPPINES",e[e.POLAND=59]="POLAND",e[e.PORTUGAL=60]="PORTUGAL",e[e.PUERTO_RICO=61]="PUERTO_RICO",e[e.QATAR=62]="QATAR",e[e.ROMANIA=63]="ROMANIA",e[e.RUSSIA=64]="RUSSIA",e[e.SAUDI_ARABIA=65]="SAUDI_ARABIA",e[e.SERBIA=66]="SERBIA",e[e.SINGAPORE=67]="SINGAPORE",e[e.SLOVAKIA=68]="SLOVAKIA",e[e.SLOVENIA=69]="SLOVENIA",e[e.SOUTH_AFRICA=70]="SOUTH_AFRICA",e[e.SPAIN=71]="SPAIN",e[e.SWEDEN=72]="SWEDEN",e[e.SWITZERLAND=73]="SWITZERLAND",e[e.TAIWAN=74]="TAIWAN",e[e.THAILAND=75]="THAILAND",e[e.TUNISIA=76]="TUNISIA",e[e.TURKEY=77]="TURKEY",e[e.UAE=78]="UAE",e[e.UGANDA=79]="UGANDA",e[e.UK=80]="UK",e[e.UKRAINE=81]="UKRAINE",e[e.USA=82]="USA",e[e.VIETNAM=83]="VIETNAM",e[e.BRAZIL=84]="BRAZIL",e[e.NORWAY=85]="NORWAY",e[e.OMAN=86]="OMAN",e[e.ECUADOR=87]="ECUADOR",e[e.EL_SALVADOR=88]="EL_SALVADOR",e[e.SRI_LANKA=89]="SRI_LANKA",e[e.PERU=90]="PERU",e[e.URUGUAY=91]="URUGUAY",e[e.BAHAMAS=92]="BAHAMAS",e[e.BERMUDA=93]="BERMUDA",e[e.BOLIVIA=94]="BOLIVIA",e[e.CHINA=95]="CHINA",e[e.EUROPEAN_UNION=96]="EUROPEAN_UNION",e[e.HAITI=97]="HAITI",e[e.HONDURAS=98]="HONDURAS",e[e.ICELAND=99]="ICELAND",e[e.JAPAN=100]="JAPAN",e[e.LUXEMBOURG=101]="LUXEMBOURG",e[e.MONTENEGRO=102]="MONTENEGRO",e[e.NICARAGUA=103]="NICARAGUA",e[e.SOUTH_KOREA=104]="SOUTH_KOREA",e[e.VENEZUELA=105]="VENEZUELA",e[e.AFGHANISTAN=106]="AFGHANISTAN",e[e.ALAND_ISLANDS=107]="ALAND_ISLANDS",e[e.AMERICAN_SAMOA=108]="AMERICAN_SAMOA",e[e.ANDORRA=109]="ANDORRA",e[e.ANGOLA=110]="ANGOLA",e[e.ANGUILLA=111]="ANGUILLA",e[e.ANTARCTICA=112]="ANTARCTICA",e[e.ANTIGUA_AND_BARBUDA=113]="ANTIGUA_AND_BARBUDA",e[e.ARMENIA=114]="ARMENIA",e[e.ARUBA=115]="ARUBA",e[e.BAILIWICK_OF_GUERNSEY=116]="BAILIWICK_OF_GUERNSEY",e[e.BAILIWICK_OF_JERSEY=117]="BAILIWICK_OF_JERSEY",e[e.BARBADOS=118]="BARBADOS",e[e.BELARUS=119]="BELARUS",e[e.BELIZE=120]="BELIZE",e[e.BENIN=121]="BENIN",e[e.BHUTAN=122]="BHUTAN",e[e.BONAIRE_SAINT_EUSTATIUS_AND_SABA=123]="BONAIRE_SAINT_EUSTATIUS_AND_SABA",e[e.BOTSWANA=124]="BOTSWANA",e[e.BOUVET_ISLAND=125]="BOUVET_ISLAND",e[e.BRITISH_INDIAN_OCEAN_TERRITORY=126]="BRITISH_INDIAN_OCEAN_TERRITORY",e[e.BURKINA_FASO=127]="BURKINA_FASO",e[e.BURUNDI=128]="BURUNDI",e[e.CAMEROON=129]="CAMEROON",e[e.CAPE_VERDE=130]="CAPE_VERDE",e[e.CARIBBEAN_NETHERLANDS=131]="CARIBBEAN_NETHERLANDS",e[e.CAYMAN_ISLANDS=132]="CAYMAN_ISLANDS",e[e.CENTRAL_AFRICAN_REPUBLIC=133]="CENTRAL_AFRICAN_REPUBLIC",e[e.CHAD=134]="CHAD",e[e.CHRISTMAS_ISLAND=135]="CHRISTMAS_ISLAND",e[e.COCOS_ISLANDS=136]="COCOS_ISLANDS",e[e.COMOROS=137]="COMOROS",e[e.CONGO=138]="CONGO",e[e.COOK_ISLANDS=139]="COOK_ISLANDS",e[e.CUBA=140]="CUBA",e[e.CURACAO=141]="CURACAO",e[e.DEMOCRATIC_REPUBLIC_OF_THE_CONGO=142]="DEMOCRATIC_REPUBLIC_OF_THE_CONGO",e[e.DJIBOUTI=143]="DJIBOUTI",e[e.DOMINICA=144]="DOMINICA",e[e.EAST_TIMOR=145]="EAST_TIMOR",e[e.EQUATORIAL_GUINEA=146]="EQUATORIAL_GUINEA",e[e.ERITREA=147]="ERITREA",e[e.ETHIOPIA=148]="ETHIOPIA",e[e.FALKLAND_ISLANDS=149]="FALKLAND_ISLANDS",e[e.FAROE_ISLANDS=150]="FAROE_ISLANDS",e[e.FEDERATED_STATES_OF_MICRONESIA=151]="FEDERATED_STATES_OF_MICRONESIA",e[e.FIJI=152]="FIJI",e[e.FRENCH_GUIANA=153]="FRENCH_GUIANA",e[e.FRENCH_POLYNESIA=154]="FRENCH_POLYNESIA",e[e.FRENCH_SOUTHERN_TERRITORIES=155]="FRENCH_SOUTHERN_TERRITORIES",e[e.GABON=156]="GABON",e[e.GAMBIA=157]="GAMBIA",e[e.GIBRALTAR=158]="GIBRALTAR",e[e.GREENLAND=159]="GREENLAND",e[e.GRENADA=160]="GRENADA",e[e.GUADELOUPE=161]="GUADELOUPE",e[e.GUAM=162]="GUAM",e[e.GUINEA=163]="GUINEA",e[e.GUINEA_BISSAU=164]="GUINEA_BISSAU",e[e.GUYANA=165]="GUYANA",e[e.HEARD_ISLAND_AND_MCDONALD_ISLANDS=166]="HEARD_ISLAND_AND_MCDONALD_ISLANDS",e[e.IRAN=167]="IRAN",e[e.IRAQ=168]="IRAQ",e[e.ISLE_OF_MAN=169]="ISLE_OF_MAN",e[e.IVORY_COAST=170]="IVORY_COAST",e[e.JAMAICA=171]="JAMAICA",e[e.KIRIBATI=172]="KIRIBATI",e[e.KYRGYZSTAN=173]="KYRGYZSTAN",e[e.LAOS=174]="LAOS",e[e.LEBANON=175]="LEBANON",e[e.LESOTHO=176]="LESOTHO",e[e.LIBERIA=177]="LIBERIA",e[e.LIBYA=178]="LIBYA",e[e.LIECHTENSTEIN=179]="LIECHTENSTEIN",e[e.MACAU=180]="MACAU",e[e.MADAGASCAR=181]="MADAGASCAR",e[e.MALAWI=182]="MALAWI",e[e.MALI=183]="MALI",e[e.MARSHALL_ISLANDS=184]="MARSHALL_ISLANDS",e[e.MARTINIQUE=185]="MARTINIQUE",e[e.MAURITANIA=186]="MAURITANIA",e[e.MAYOTTE=187]="MAYOTTE",e[e.MOLDOVA=188]="MOLDOVA",e[e.MONACO=189]="MONACO",e[e.MONGOLIA=190]="MONGOLIA",e[e.MONTSERRAT=191]="MONTSERRAT",e[e.MOZAMBIQUE=192]="MOZAMBIQUE",e[e.MYANMAR=193]="MYANMAR",e[e.NAMIBIA=194]="NAMIBIA",e[e.NAURU=195]="NAURU",e[e.NEPAL=196]="NEPAL",e[e.NEW_CALEDONIA=197]="NEW_CALEDONIA",e[e.NIGER=198]="NIGER",e[e.NIUE=199]="NIUE",e[e.NORFOLK_ISLAND=200]="NORFOLK_ISLAND",e[e.NORTHERN_CYPRUS=201]="NORTHERN_CYPRUS",e[e.NORTHERN_MARIANA_ISLANDS=202]="NORTHERN_MARIANA_ISLANDS",e[e.NORTH_KOREA=203]="NORTH_KOREA",e[e.NORTH_MACEDONIA=204]="NORTH_MACEDONIA",e[e.PALAU=205]="PALAU",e[e.PALESTINE=206]="PALESTINE",e[e.PAPUA_NEW_GUINEA=207]="PAPUA_NEW_GUINEA",e[e.PITCAIRN=208]="PITCAIRN",e[e.REUNION=209]="REUNION",e[e.RWANDA=210]="RWANDA",e[e.SAINT_BARTHELEMY=211]="SAINT_BARTHELEMY",e[e.SAINT_HELENA_ASCENSION_AND_TRISTIAN_DA_CUNHA=212]="SAINT_HELENA_ASCENSION_AND_TRISTIAN_DA_CUNHA",e[e.SAINT_KITTS_AND_NEVIS=213]="SAINT_KITTS_AND_NEVIS",e[e.SAINT_LUCIA=214]="SAINT_LUCIA",e[e.SAINT_MARTIN=215]="SAINT_MARTIN",e[e.SAINT_PIERRE_AND_MIQUELON=216]="SAINT_PIERRE_AND_MIQUELON",e[e.SAINT_VINCENT_AND_THE_GRENADINES=217]="SAINT_VINCENT_AND_THE_GRENADINES",e[e.SAMOA=218]="SAMOA",e[e.SAN_MARINO=219]="SAN_MARINO",e[e.SAO_TOME_AND_PRINCIPE=220]="SAO_TOME_AND_PRINCIPE",e[e.SENEGAL=221]="SENEGAL",e[e.SEYCHELLES=222]="SEYCHELLES",e[e.SIERRA_LEONE=223]="SIERRA_LEONE",e[e.SINT_MAARTEN=224]="SINT_MAARTEN",e[e.SOLOMON_ISLANDS=225]="SOLOMON_ISLANDS",e[e.SOMALIA=226]="SOMALIA",e[e.SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS=227]="SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS",e[e.SOUTH_SUDAN=228]="SOUTH_SUDAN",e[e.SUDAN=229]="SUDAN",e[e.SURINAME=230]="SURINAME",e[e.SVALBARD_AND_JAN_MAYEN=231]="SVALBARD_AND_JAN_MAYEN",e[e.ESWATINI=232]="ESWATINI",e[e.SYRIA=233]="SYRIA",e[e.TAJIKISTAN=234]="TAJIKISTAN",e[e.TANZANIA=235]="TANZANIA",e[e.TOGO=236]="TOGO",e[e.TOKELAU=237]="TOKELAU",e[e.TONGA=238]="TONGA",e[e.TRINIDAD_AND_TOBAGO=239]="TRINIDAD_AND_TOBAGO",e[e.TURKMENISTAN=240]="TURKMENISTAN",e[e.TURKS_AND_CAICOS_ISLANDS=241]="TURKS_AND_CAICOS_ISLANDS",e[e.TUVALU=242]="TUVALU",e[e.UNITED_STATES_MINOR_OUTLYING_ISLANDS=243]="UNITED_STATES_MINOR_OUTLYING_ISLANDS",e[e.UZBEKISTAN=244]="UZBEKISTAN",e[e.VANUATU=245]="VANUATU",e[e.VATICAN_CITY=246]="VATICAN_CITY",e[e.VIRGIN_ISLANDS_BRITISH=247]="VIRGIN_ISLANDS_BRITISH",e[e.VIRGIN_ISLANDS_US=248]="VIRGIN_ISLANDS_US",e[e.WALLIS_AND_FUTUNA=249]="WALLIS_AND_FUTUNA",e[e.WESTERN_SAHARA=250]="WESTERN_SAHARA",e[e.YEMEN=251]="YEMEN",e[e.YUGOSLAVIA=252]="YUGOSLAVIA",e[e.ZAMBIA=253]="ZAMBIA",e[e.ZIMBABWE=254]="ZIMBABWE",e[e.SCHENGEN_AREA=255]="SCHENGEN_AREA",e[e.COUNT=256]="COUNT";})(S||(S={}));var n;(function(e){e[e.NONE=0]="NONE",e[e.ALABAMA=1]="ALABAMA",e[e.ALASKA=2]="ALASKA",e[e.ALBERTA=3]="ALBERTA",e[e.ARIZONA=4]="ARIZONA",e[e.ARKANSAS=5]="ARKANSAS",e[e.AUSTRALIAN_CAPITAL_TERRITORY=6]="AUSTRALIAN_CAPITAL_TERRITORY",e[e.BRITISH_COLUMBIA=7]="BRITISH_COLUMBIA",e[e.CALIFORNIA=8]="CALIFORNIA",e[e.COLORADO=9]="COLORADO",e[e.CONNECTICUT=10]="CONNECTICUT",e[e.DELAWARE=11]="DELAWARE",e[e.DISTRICT_OF_COLUMBIA=12]="DISTRICT_OF_COLUMBIA",e[e.FLORIDA=13]="FLORIDA",e[e.GEORGIA=14]="GEORGIA",e[e.HAWAII=15]="HAWAII",e[e.IDAHO=16]="IDAHO",e[e.ILLINOIS=17]="ILLINOIS",e[e.INDIANA=18]="INDIANA",e[e.IOWA=19]="IOWA",e[e.KANSAS=20]="KANSAS",e[e.KENTUCKY=21]="KENTUCKY",e[e.LOUISIANA=22]="LOUISIANA",e[e.MAINE=23]="MAINE",e[e.MANITOBA=24]="MANITOBA",e[e.MARYLAND=25]="MARYLAND",e[e.MASSACHUSETTS=26]="MASSACHUSETTS",e[e.MICHIGAN=27]="MICHIGAN",e[e.MINNESOTA=28]="MINNESOTA",e[e.MISSISSIPPI=29]="MISSISSIPPI",e[e.MISSOURI=30]="MISSOURI",e[e.MONTANA=31]="MONTANA",e[e.NEBRASKA=32]="NEBRASKA",e[e.NEVADA=33]="NEVADA",e[e.NEW_BRUNSWICK=34]="NEW_BRUNSWICK",e[e.NEW_HAMPSHIRE=35]="NEW_HAMPSHIRE",e[e.NEW_JERSEY=36]="NEW_JERSEY",e[e.NEW_MEXICO=37]="NEW_MEXICO",e[e.NEW_SOUTH_WALES=38]="NEW_SOUTH_WALES",e[e.NEW_YORK=39]="NEW_YORK",e[e.NORTHERN_TERRITORY=40]="NORTHERN_TERRITORY",e[e.NORTH_CAROLINA=41]="NORTH_CAROLINA",e[e.NORTH_DAKOTA=42]="NORTH_DAKOTA",e[e.NOVA_SCOTIA=43]="NOVA_SCOTIA",e[e.OHIO=44]="OHIO",e[e.OKLAHOMA=45]="OKLAHOMA",e[e.ONTARIO=46]="ONTARIO",e[e.OREGON=47]="OREGON",e[e.PENNSYLVANIA=48]="PENNSYLVANIA",e[e.QUEBEC=49]="QUEBEC",e[e.QUEENSLAND=50]="QUEENSLAND",e[e.RHODE_ISLAND=51]="RHODE_ISLAND",e[e.SASKATCHEWAN=52]="SASKATCHEWAN",e[e.SOUTH_AUSTRALIA=53]="SOUTH_AUSTRALIA",e[e.SOUTH_CAROLINA=54]="SOUTH_CAROLINA",e[e.SOUTH_DAKOTA=55]="SOUTH_DAKOTA",e[e.TASMANIA=56]="TASMANIA",e[e.TENNESSEE=57]="TENNESSEE",e[e.TEXAS=58]="TEXAS",e[e.UTAH=59]="UTAH",e[e.VERMONT=60]="VERMONT",e[e.VICTORIA=61]="VICTORIA",e[e.VIRGINIA=62]="VIRGINIA",e[e.WASHINGTON=63]="WASHINGTON",e[e.WESTERN_AUSTRALIA=64]="WESTERN_AUSTRALIA",e[e.WEST_VIRGINIA=65]="WEST_VIRGINIA",e[e.WISCONSIN=66]="WISCONSIN",e[e.WYOMING=67]="WYOMING",e[e.YUKON=68]="YUKON",e[e.CIUDAD_DE_MEXICO=69]="CIUDAD_DE_MEXICO",e[e.JALISCO=70]="JALISCO",e[e.NEWFOUNDLAND_AND_LABRADOR=71]="NEWFOUNDLAND_AND_LABRADOR",e[e.NUEVO_LEON=72]="NUEVO_LEON",e[e.BAJA_CALIFORNIA=73]="BAJA_CALIFORNIA",e[e.CHIHUAHUA=74]="CHIHUAHUA",e[e.GUANAJUATO=75]="GUANAJUATO",e[e.GUERRERO=76]="GUERRERO",e[e.MEXICO=77]="MEXICO",e[e.MICHOACAN=78]="MICHOACAN",e[e.NEW_YORK_CITY=79]="NEW_YORK_CITY",e[e.TAMAULIPAS=80]="TAMAULIPAS",e[e.VERACRUZ=81]="VERACRUZ",e[e.CHIAPAS=82]="CHIAPAS",e[e.COAHUILA=83]="COAHUILA",e[e.DURANGO=84]="DURANGO",e[e.GUERRERO_COCULA=85]="GUERRERO_COCULA",e[e.GUERRERO_JUCHITAN=86]="GUERRERO_JUCHITAN",e[e.GUERRERO_TEPECOACUILCO=87]="GUERRERO_TEPECOACUILCO",e[e.GUERRERO_TLACOAPA=88]="GUERRERO_TLACOAPA",e[e.GUJARAT=89]="GUJARAT",e[e.HIDALGO=90]="HIDALGO",e[e.KARNATAKA=91]="KARNATAKA",e[e.KERALA=92]="KERALA",e[e.KHYBER_PAKHTUNKHWA=93]="KHYBER_PAKHTUNKHWA",e[e.MADHYA_PRADESH=94]="MADHYA_PRADESH",e[e.MAHARASHTRA=95]="MAHARASHTRA",e[e.MORELOS=96]="MORELOS",e[e.NAYARIT=97]="NAYARIT",e[e.OAXACA=98]="OAXACA",e[e.PUEBLA=99]="PUEBLA",e[e.PUNJAB=100]="PUNJAB",e[e.QUERETARO=101]="QUERETARO",e[e.SAN_LUIS_POTOSI=102]="SAN_LUIS_POTOSI",e[e.SINALOA=103]="SINALOA",e[e.SONORA=104]="SONORA",e[e.TABASCO=105]="TABASCO",e[e.TAMIL_NADU=106]="TAMIL_NADU",e[e.YUCATAN=107]="YUCATAN",e[e.ZACATECAS=108]="ZACATECAS",e[e.AGUASCALIENTES=109]="AGUASCALIENTES",e[e.BAJA_CALIFORNIA_SUR=110]="BAJA_CALIFORNIA_SUR",e[e.CAMPECHE=111]="CAMPECHE",e[e.COLIMA=112]="COLIMA",e[e.QUINTANA_ROO_BENITO_JUAREZ=113]="QUINTANA_ROO_BENITO_JUAREZ",e[e.UINTANA_ROO=114]="UINTANA_ROO",e[e.QUINTANA_ROO_SOLIDARIDAD=115]="QUINTANA_ROO_SOLIDARIDAD",e[e.TLAXCALA=116]="TLAXCALA",e[e.QUINTANA_ROO_COZUMEL=117]="QUINTANA_ROO_COZUMEL",e[e.SAO_PAOLO=118]="SAO_PAOLO",e[e.RIO_DE_JANEIRO=119]="RIO_DE_JANEIRO",e[e.RIO_GRANDE_DO_SUL=120]="RIO_GRANDE_DO_SUL",e[e.NORTHWEST_TERRITORIES=121]="NORTHWEST_TERRITORIES",e[e.NUNAVUT=122]="NUNAVUT",e[e.PRINCE_EDWARD_ISLAND=123]="PRINCE_EDWARD_ISLAND",e[e.DISTRITO_FEDERAL=124]="DISTRITO_FEDERAL",e[e.MARANHAO=125]="MARANHAO",e[e.MATO_GROSSO=126]="MATO_GROSSO",e[e.MINAS_GERAIS=127]="MINAS_GERAIS",e[e.PARA=128]="PARA",e[e.PARANA=129]="PARANA",e[e.PERNAMBUCO=130]="PERNAMBUCO",e[e.SANTA_CATARINA=131]="SANTA_CATARINA",e[e.ANDHRA_PRADESH=132]="ANDHRA_PRADESH",e[e.CEARA=133]="CEARA",e[e.GOIAS=134]="GOIAS",e[e.GUERRERO_ACAPULCO_DE_JUAREZ=135]="GUERRERO_ACAPULCO_DE_JUAREZ",e[e.HARYANA=136]="HARYANA",e[e.SERGIPE=137]="SERGIPE",e[e.ALAGOAS=138]="ALAGOAS",e[e.BANGSAMORO=139]="BANGSAMORO",e[e.COUNT=140]="COUNT";})(n||(n={}));var l;(function(e){e[e.NONE=0]="NONE",e[e.CONSULAR_ID=1]="CONSULAR_ID",e[e.DL=2]="DL",e[e.DL_PUBLIC_SERVICES_CARD=3]="DL_PUBLIC_SERVICES_CARD",e[e.EMPLOYMENT_PASS=4]="EMPLOYMENT_PASS",e[e.FIN_CARD=5]="FIN_CARD",e[e.ID=6]="ID",e[e.MULTIPURPOSE_ID=7]="MULTIPURPOSE_ID",e[e.MYKAD=8]="MYKAD",e[e.MYKID=9]="MYKID",e[e.MYPR=10]="MYPR",e[e.MYTENTERA=11]="MYTENTERA",e[e.PAN_CARD=12]="PAN_CARD",e[e.PROFESSIONAL_ID=13]="PROFESSIONAL_ID",e[e.PUBLIC_SERVICES_CARD=14]="PUBLIC_SERVICES_CARD",e[e.RESIDENCE_PERMIT=15]="RESIDENCE_PERMIT",e[e.RESIDENT_ID=16]="RESIDENT_ID",e[e.TEMPORARY_RESIDENCE_PERMIT=17]="TEMPORARY_RESIDENCE_PERMIT",e[e.VOTER_ID=18]="VOTER_ID",e[e.WORK_PERMIT=19]="WORK_PERMIT",e[e.IKAD=20]="IKAD",e[e.MILITARY_ID=21]="MILITARY_ID",e[e.MYKAS=22]="MYKAS",e[e.SOCIAL_SECURITY_CARD=23]="SOCIAL_SECURITY_CARD",e[e.HEALTH_INSURANCE_CARD=24]="HEALTH_INSURANCE_CARD",e[e.PASSPORT=25]="PASSPORT",e[e.S_PASS=26]="S_PASS",e[e.ADDRESS_CARD=27]="ADDRESS_CARD",e[e.ALIEN_ID=28]="ALIEN_ID",e[e.ALIEN_PASSPORT=29]="ALIEN_PASSPORT",e[e.GREEN_CARD=30]="GREEN_CARD",e[e.MINORS_ID=31]="MINORS_ID",e[e.POSTAL_ID=32]="POSTAL_ID",e[e.PROFESSIONAL_DL=33]="PROFESSIONAL_DL",e[e.TAX_ID=34]="TAX_ID",e[e.WEAPON_PERMIT=35]="WEAPON_PERMIT",e[e.VISA=36]="VISA",e[e.BORDER_CROSSING_CARD=37]="BORDER_CROSSING_CARD",e[e.DRIVER_CARD=38]="DRIVER_CARD",e[e.GLOBAL_ENTRY_CARD=39]="GLOBAL_ENTRY_CARD",e[e.MYPOLIS=40]="MYPOLIS",e[e.NEXUS_CARD=41]="NEXUS_CARD",e[e.PASSPORT_CARD=42]="PASSPORT_CARD",e[e.PROOF_OF_AGE_CARD=43]="PROOF_OF_AGE_CARD",e[e.REFUGEE_ID=44]="REFUGEE_ID",e[e.TRIBAL_ID=45]="TRIBAL_ID",e[e.VETERAN_ID=46]="VETERAN_ID",e[e.CITIZENSHIP_CERTIFICATE=47]="CITIZENSHIP_CERTIFICATE",e[e.MY_NUMBER_CARD=48]="MY_NUMBER_CARD",e[e.CONSULAR_PASSPORT=49]="CONSULAR_PASSPORT",e[e.MINORS_PASSPORT=50]="MINORS_PASSPORT",e[e.MINORS_PUBLIC_SERVICES_CARD=51]="MINORS_PUBLIC_SERVICES_CARD",e[e.DRIVING_PRIVILEGE_CARD=52]="DRIVING_PRIVILEGE_CARD",e[e.ASYLUM_REQUEST=53]="ASYLUM_REQUEST",e[e.DRIVER_QUALIFICATION_CARD=54]="DRIVER_QUALIFICATION_CARD",e[e.PROVISIONAL_DL=55]="PROVISIONAL_DL",e[e.REFUGEE_PASSPORT=56]="REFUGEE_PASSPORT",e[e.SPECIAL_ID=57]="SPECIAL_ID",e[e.UNIFORMED_SERVICES_ID=58]="UNIFORMED_SERVICES_ID",e[e.IMMIGRANT_VISA=59]="IMMIGRANT_VISA",e[e.CONSULAR_VOTER_ID=60]="CONSULAR_VOTER_ID",e[e.TWIC_CARD=61]="TWIC_CARD",e[e.EXIT_ENTRY_PERMIT=62]="EXIT_ENTRY_PERMIT",e[e.MAINLAND_TRAVEL_PERMIT_TAIWAN=63]="MAINLAND_TRAVEL_PERMIT_TAIWAN",e[e.NBI_CLEARANCE=64]="NBI_CLEARANCE",e[e.PROOF_OF_REGISTRATION=65]="PROOF_OF_REGISTRATION",e[e.TEMPORARY_PROTECTION_PERMIT=66]="TEMPORARY_PROTECTION_PERMIT",e[e.AFGHAN_CITIZEN_CARD=67]="AFGHAN_CITIZEN_CARD",e[e.EID=68]="EID",e[e.PASS=69]="PASS",e[e.SIS_ID=70]="SIS_ID",e[e.ASIC_CARD=71]="ASIC_CARD",e[e.BIDOON_CARD=72]="BIDOON_CARD",e[e.INTERIM_HEALTH_INSURANCE_CARD=73]="INTERIM_HEALTH_INSURANCE_CARD",e[e.NON_VOTER_ID=74]="NON_VOTER_ID",e[e.RECIPROCAL_HEALTH_INSURANCE_CARD=75]="RECIPROCAL_HEALTH_INSURANCE_CARD",e[e.VEHICLE_REGISTRATION=76]="VEHICLE_REGISTRATION",e[e.ESAAD_CARD=77]="ESAAD_CARD",e[e.COUNT=78]="COUNT";})(l||(l={}));var Ft;(function(e){e[e.AdditionalAddressInformation=0]="AdditionalAddressInformation",e[e.AdditionalNameInformation=1]="AdditionalNameInformation",e[e.AdditionalOptionalAddressInformation=2]="AdditionalOptionalAddressInformation",e[e.AdditionalPersonalIdNumber=3]="AdditionalPersonalIdNumber",e[e.Address=4]="Address",e[e.ClassEffectiveDate=5]="ClassEffectiveDate",e[e.ClassExpiryDate=6]="ClassExpiryDate",e[e.Conditions=7]="Conditions",e[e.DateOfBirth=8]="DateOfBirth",e[e.DateOfExpiry=9]="DateOfExpiry",e[e.DateOfIssue=10]="DateOfIssue",e[e.DocumentAdditionalNumber=11]="DocumentAdditionalNumber",e[e.DocumentOptionalAdditionalNumber=12]="DocumentOptionalAdditionalNumber",e[e.DocumentNumber=13]="DocumentNumber",e[e.Employer=14]="Employer",e[e.Endorsements=15]="Endorsements",e[e.FathersName=16]="FathersName",e[e.FirstName=17]="FirstName",e[e.FullName=18]="FullName",e[e.IssuingAuthority=19]="IssuingAuthority",e[e.LastName=20]="LastName",e[e.LicenceType=21]="LicenceType",e[e.LocalizedName=22]="LocalizedName",e[e.MaritalStatus=23]="MaritalStatus",e[e.MothersName=24]="MothersName",e[e.Mrz=25]="Mrz",e[e.Nationality=26]="Nationality",e[e.PersonalIdNumber=27]="PersonalIdNumber",e[e.PlaceOfBirth=28]="PlaceOfBirth",e[e.Profession=29]="Profession",e[e.Race=30]="Race",e[e.Religion=31]="Religion",e[e.ResidentialStatus=32]="ResidentialStatus",e[e.Restrictions=33]="Restrictions",e[e.Sex=34]="Sex",e[e.VehicleClass=35]="VehicleClass",e[e.BloodType=36]="BloodType",e[e.Sponsor=37]="Sponsor",e[e.VisaType=38]="VisaType",e[e.DocumentSubtype=39]="DocumentSubtype",e[e.Remarks=40]="Remarks",e[e.ResidencePermitType=41]="ResidencePermitType",e[e.ManufacturingYear=42]="ManufacturingYear",e[e.VehicleType=43]="VehicleType",e[e.DependentDateOfBirth=44]="DependentDateOfBirth",e[e.DependentSex=45]="DependentSex",e[e.DependentDocumentNumber=46]="DependentDocumentNumber",e[e.DependentFullName=47]="DependentFullName",e[e.EligibilityCategory=48]="EligibilityCategory",e[e.SpecificDocumentValidity=49]="SpecificDocumentValidity",e[e.VehicleOwner=50]="VehicleOwner",e[e.Count=51]="Count";})(Ft||(Ft={}));var Wt;(function(e){e[e.FullDocument=0]="FullDocument",e[e.Face=1]="Face",e[e.Signature=2]="Signature";})(Wt||(Wt={}));var Bt;(function(e){e[e.NotAvailable=0]="NotAvailable",e[e.BlackAndWhite=1]="BlackAndWhite",e[e.Color=2]="Color";})(Bt||(Bt={}));var ae;(function(e){e[e.NotAvailable=0]="NotAvailable",e[e.NotDetected=1]="NotDetected",e[e.Detected=2]="Detected";})(ae||(ae={}));var Gt;(function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.NotAvailable=2]="NotAvailable";})(Gt||(Gt={}));var Vt;(function(e){e[e.None=0]="None",e[e.Clockwise90=1]="Clockwise90",e[e.CounterClockwise90=2]="CounterClockwise90",e[e.UpsideDown=3]="UpsideDown";})(Vt||(Vt={}));var We;(function(e){e[e.Success=0]="Success",e[e.DetectionFailed=1]="DetectionFailed",e[e.ImagePreprocessingFailed=2]="ImagePreprocessingFailed",e[e.StabilityTestFailed=3]="StabilityTestFailed",e[e.ScanningWrongSide=4]="ScanningWrongSide",e[e.FieldIdentificationFailed=5]="FieldIdentificationFailed",e[e.MandatoryFieldMissing=6]="MandatoryFieldMissing",e[e.InvalidCharactersFound=7]="InvalidCharactersFound",e[e.ImageReturnFailed=8]="ImageReturnFailed",e[e.BarcodeRecognitionFailed=9]="BarcodeRecognitionFailed",e[e.MrzParsingFailed=10]="MrzParsingFailed",e[e.ClassFiltered=11]="ClassFiltered",e[e.UnsupportedClass=12]="UnsupportedClass",e[e.UnsupportedByLicense=13]="UnsupportedByLicense",e[e.AwaitingOtherSide=14]="AwaitingOtherSide",e[e.NotScanned=15]="NotScanned",e[e.BarcodeDetectionFailed=16]="BarcodeDetectionFailed",e[e.Count=17]="Count";})(We||(We={}));var jt;(function(e){e[e.None=0]="None",e[e.MrzId=1]="MrzId",e[e.MrzVisa=2]="MrzVisa",e[e.MrzPassport=3]="MrzPassport",e[e.PhotoId=4]="PhotoId",e[e.FullRecognition=5]="FullRecognition",e[e.BarcodeId=6]="BarcodeId",e[e.Count=7]="Count";})(jt||(jt={}));async function Yt(e){return e.mbWasmModule.newRecognizer(atob("QmxpbmtJZFNpbmdsZVNpZGVSZWNvZ25pemVy"))}async function Qt(e){return e.mbWasmModule.newRecognizer(atob("QmxpbmtJZE11bHRpU2lkZVJlY29nbml6ZXI="))}var Ht;(function(e){e[e.None=0]="None",e[e.AAMVACompliant=1]="AAMVACompliant",e[e.ArgentinaID=2]="ArgentinaID",e[e.ArgentinaAlienID=3]="ArgentinaAlienID",e[e.ArgentinaDL=4]="ArgentinaDL",e[e.ColombiaID=5]="ColombiaID",e[e.ColombiaDL=6]="ColombiaDL",e[e.NigeriaVoterID=7]="NigeriaVoterID",e[e.NigeriaDL=8]="NigeriaDL",e[e.PanamaID=9]="PanamaID",e[e.SouthAfricaID=10]="SouthAfricaID";})(Ht||(Ht={}));var Be=class e{get location(){return this._location}static fromJSON(t){let a=new e;return t.location!=null&&(a._location=Quadrilateral.fromJSON(t.location)),a}toJSONObject(){return {location:this.location.toJSONObject()}}};var qa={[n.NONE]:null,[n.COUNT]:null,[n.AUSTRALIAN_CAPITAL_TERRITORY]:"Australian Capital Territory",[n.NEW_SOUTH_WALES]:"New South Wales",[n.NORTHERN_TERRITORY]:"Northern Territory",[n.QUEENSLAND]:"Queensland",[n.SOUTH_AUSTRALIA]:"South Australia",[n.TASMANIA]:"Tasmania",[n.WESTERN_AUSTRALIA]:"Western Australia",[n.VICTORIA]:"Victoria",[n.ALBERTA]:"Alberta",[n.BRITISH_COLUMBIA]:"British Columbia",[n.MANITOBA]:"Manitoba",[n.NEW_BRUNSWICK]:"New Brunswick",[n.NEWFOUNDLAND_AND_LABRADOR]:"Newfoundland and Labrador",[n.NORTHWEST_TERRITORIES]:"Northwest Territories",[n.NOVA_SCOTIA]:"Nova Scotia",[n.NUNAVUT]:"Nunavut",[n.PRINCE_EDWARD_ISLAND]:"Prince Edward Island",[n.QUEBEC]:"Quebec",[n.SASKATCHEWAN]:"Saskatchewan",[n.ANDHRA_PRADESH]:"Andhra Pradesh",[n.GUJARAT]:"Gujarat",[n.HARYANA]:"Haryana",[n.KARNATAKA]:"Karnataka",[n.KERALA]:"Kerala",[n.MADHYA_PRADESH]:"Madhya Pradesh",[n.MAHARASHTRA]:"Maharashtra",[n.PUNJAB]:"Punjab",[n.TAMIL_NADU]:"Tamil Nadu",[n.AGUASCALIENTES]:"Aguascalientes",[n.BAJA_CALIFORNIA]:"Baja California",[n.BAJA_CALIFORNIA_SUR]:"Baja California Sur",[n.CAMPECHE]:"Campeche",[n.CHIAPAS]:"Chiapas",[n.CHIHUAHUA]:"Chihuahua",[n.CIUDAD_DE_MEXICO]:"Mexico City",[n.COAHUILA]:"Coahuila",[n.COLIMA]:"Colima",[n.DURANGO]:"Durango",[n.GUANAJUATO]:"Guanajuato",[n.GUERRERO]:"Guerrero",[n.GUERRERO_ACAPULCO_DE_JUAREZ]:"Acapulco de Ju\xE1rez, Guerrero",[n.GUERRERO_COCULA]:"Cocula, Guerrero",[n.GUERRERO_JUCHITAN]:"Juchit\xE1n, Guerrero",[n.GUERRERO_TEPECOACUILCO]:"Tepecoacuilco de Trujano, Guerrero",[n.GUERRERO_TLACOAPA]:"Tlacoapa, Guerrero",[n.HIDALGO]:"Hidalgo",[n.JALISCO]:"Jalisco",[n.MEXICO]:"M\xE9xico",[n.MICHOACAN]:"Michoac\xE1n",[n.MORELOS]:"Morelos",[n.NAYARIT]:"Nayarit",[n.NUEVO_LEON]:"Nuevo Le\xF3n",[n.OAXACA]:"Oaxaca",[n.PUEBLA]:"Puebla",[n.UINTANA_ROO]:"Quintana Roo",[n.QUINTANA_ROO_BENITO_JUAREZ]:"Benito Ju\xE1rez, Quintana Roo",[n.QUINTANA_ROO_SOLIDARIDAD]:"Solidaridad, Quintana Roo",[n.QUINTANA_ROO_COZUMEL]:"Cozumel, Quintana Roo",[n.QUERETARO]:"Quer\xE9taro",[n.SAN_LUIS_POTOSI]:"San Luis Potos\xED",[n.SINALOA]:"Sinaloa",[n.SONORA]:"Sonora",[n.TABASCO]:"Tabasco",[n.TAMAULIPAS]:"Tamaulipas",[n.TLAXCALA]:"Tlaxcala",[n.VERACRUZ]:"Veracruz",[n.YUCATAN]:"Yucatan",[n.ZACATECAS]:"Zacatecas",[n.KHYBER_PAKHTUNKHWA]:"Khyber Pakhtunkhwa",[n.ALABAMA]:"Alabama",[n.ALASKA]:"Alaska",[n.ARIZONA]:"Arizona",[n.ARKANSAS]:"Arkansas",[n.CALIFORNIA]:"California",[n.COLORADO]:"Colorado",[n.CONNECTICUT]:"Connecticut",[n.DELAWARE]:"Delaware",[n.DISTRICT_OF_COLUMBIA]:"District of Columbia",[n.FLORIDA]:"Florida",[n.GEORGIA]:"Georgia",[n.HAWAII]:"Hawaii",[n.IDAHO]:"Idaho",[n.ILLINOIS]:"Illinois",[n.INDIANA]:"Indiana",[n.IOWA]:"Iowa",[n.KANSAS]:"Kansas",[n.KENTUCKY]:"Kentucky",[n.LOUISIANA]:"Louisiana",[n.MAINE]:"Maine",[n.MARYLAND]:"Maryland",[n.MASSACHUSETTS]:"Massachusetts",[n.MICHIGAN]:"Michigan",[n.MINNESOTA]:"Minnesota",[n.MISSISSIPPI]:"Mississippi",[n.MISSOURI]:"Missouri",[n.MONTANA]:"Montana",[n.NEBRASKA]:"Nebraska",[n.NEVADA]:"Nevada",[n.NEW_HAMPSHIRE]:"New Hampshire",[n.NEW_JERSEY]:"New Jersey",[n.NEW_MEXICO]:"New Mexico",[n.NEW_YORK]:"New York",[n.NEW_YORK_CITY]:"New York City",[n.NORTH_CAROLINA]:"North Carolina",[n.NORTH_DAKOTA]:"North Dakota",[n.OHIO]:"Ohio",[n.OKLAHOMA]:"Oklahoma",[n.ONTARIO]:"Ontario",[n.OREGON]:"Oregon",[n.PENNSYLVANIA]:"Pennsylvania",[n.RHODE_ISLAND]:"Rhode Island",[n.SOUTH_CAROLINA]:"South Carolina",[n.SOUTH_DAKOTA]:"South Dakota",[n.TENNESSEE]:"Tennessee",[n.TEXAS]:"Texas",[n.UTAH]:"Utah",[n.VERMONT]:"Vermont",[n.VIRGINIA]:"Virginia",[n.WASHINGTON]:"Washington",[n.WEST_VIRGINIA]:"West Virginia",[n.WISCONSIN]:"Wisconsin",[n.WYOMING]:"Wyoming",[n.YUKON]:"Yukon",[n.CEARA]:"Cear\xE1",[n.DISTRITO_FEDERAL]:"Federal District",[n.GOIAS]:"Goi\xE1s",[n.MARANHAO]:"Maranh\xE3o",[n.MATO_GROSSO]:"Mato Grosso",[n.MINAS_GERAIS]:"Minas Gerais",[n.PARA]:"Par\xE1",[n.PARANA]:"Paran\xE1",[n.PERNAMBUCO]:"Pernambuco",[n.RIO_DE_JANEIRO]:"Rio de Janeiro",[n.RIO_GRANDE_DO_SUL]:"Rio Grand do Sul",[n.SANTA_CATARINA]:"Santa Catarina",[n.SAO_PAOLO]:"Sao Paolo",[n.SERGIPE]:"Sergipe",[n.ALAGOAS]:"Alagoas",[n.BANGSAMORO]:"Bangsamoro"};function Xt(e){return qa[e]}var Ge=class e{constructor(t){this.workerCall=t;}static create(t){return new e(t)}async createDrivingLicenseDetailsFromBlinkIdData(t,a,r){let s=await this.workerCall("idCaptureDrivingLicenseDetailsCreateWithBlinkIdData",{details:{vehicleClass:t,restrictions:a,endorsements:r}});return z.fromJSON(s.result)}};var $t={ABW:"aruba",AFG:"afghanistan",AGO:"angola",AIA:"anguilla",ALA:"alandIslands",ALB:"albania",AND:"andorra",ARE:"uae",ARG:"argentina",ARM:"armenia",ASM:"americanSamoa",ATA:"antarctica",ATF:"frenchSouthernTerritories",ATG:"antiguaAndBarbuda",AUS:"australia",AUT:"austria",AZE:"azerbaijan",BDI:"burundi",BEL:"belgium",BEN:"benin",BES:"bonaireSintEustatiusAndSaba",BFA:"burkinaFaso",BGD:"bangladesh",BGR:"bulgaria",BHR:"bahrain",BHS:"bahamas",BIH:"bosniaHerzegovina",BLM:"saintBarthelemy",BLR:"belarus",BLZ:"belize",BMU:"bermuda",BOL:"bolivia",BRA:"brazil",BRB:"barbados",BRN:"bruneiDarussalam",BTN:"bhutan",BVT:"bouvetIsland",BWA:"botswana",CAF:"car",CAN:"canada",CCK:"cocosIslands",CHE:"switzerland",CHL:"chile",CHN:"china",CIV:"coteIvoire",CMR:"cameroon",COD:"democraticRepublicOfCongo",COG:"congo",COK:"cookIslands",COL:"colombia",COM:"comoros",CPV:"caboVerde",CRI:"costaRica",CUB:"cuba",CUW:"curacao",CXR:"christmasIsland",CYM:"caymanIslands",CYP:"cyprus",CZE:"czechia",DEU:"germany",DJI:"djibouti",DMA:"dominica",DNK:"denmark",DOM:"dominicanRepublic",DZA:"algeria",ECU:"ecuador",EGY:"egypt",ERI:"eritrea",ESH:"westernSahara",ESP:"spain",EST:"estonia",ETH:"ethiopia",FIN:"finland",FJI:"fiji",FLK:"falklandIslands",FRA:"france",FRO:"faroeIslands",FSM:"micronesia",GAB:"gabon",GBR:"uk",GEO:"georgia",GGY:"guernsey",GHA:"ghana",GIB:"gibraltar",GIN:"guinea",GLP:"guadeloupe",GMB:"gambia",GNB:"guineaBissau",GNQ:"equatorialGuinea",GRC:"greece",GRD:"grenada",GRL:"greenland",GTM:"guatemala",GUF:"frenchGuiana",GUM:"guam",GUY:"guyana",HKG:"hongKong",HMD:"heardIslandAndMcDonaldIslands",HND:"honduras",HRV:"croatia",HTI:"haiti",HUN:"hungary",IDN:"indonesia",IMN:"isleOfMan",IND:"india",IOT:"britishIndianOceanTerritory",IRL:"ireland",IRN:"iran",IRQ:"iraq",ISL:"iceland",ISR:"israel",ITA:"italy",JAM:"jamaica",JEY:"jersey",JOR:"jordan",JPN:"japan",KAZ:"kazakhstan",KEN:"kenya",KGZ:"kyrgyzstan",KHM:"cambodia",KIR:"kiribati",KNA:"saintKittsAndNevis",KOR:"southKorea",KWT:"kuwait",LAO:"lao",LBN:"lebanon",LBR:"liberia",LBY:"libya",LCA:"saintLucia",LIE:"liechtenstein",LKA:"sriLanka",LSO:"lesotho",LTU:"lithuania",LUX:"luxembourg",LVA:"latvia",MAC:"macao",MAF:"frenchSaintMartin",MAR:"morocco",MCO:"monaco",MDA:"moldova",MDG:"madagascar",MDV:"maldives",MEX:"mexico",MHL:"marshallIslands",MKD:"northMacedonia",MLI:"mali",MLT:"malta",MMR:"myanmar",MNE:"montenegro",MNG:"mongolia",MNP:"northernMarianaIslands",MOZ:"mozambique",MRT:"mauritania",MSR:"montserrat",MTQ:"martinique",MUS:"mauritius",MWI:"malawi",MYS:"malaysia",MYT:"mayotte",NAM:"namibia",NCL:"newCaledonia",NER:"niger",NFK:"norfolkIsland",NGA:"nigeria",NIC:"nicaragua",NIU:"niue",NLD:"netherlands",NOR:"norway",NPL:"nepal",NRU:"nauru",NZL:"newZealand",OMN:"oman",PAK:"pakistan",PAN:"panama",PCN:"pitcairn",PER:"peru",PHL:"philippines",PLW:"palau",PNG:"papuaNewGuinea",POL:"poland",PRI:"puertoRico",PRK:"northKorea",PRT:"portugal",PRY:"paraguay",PSE:"palestine",PYF:"frenchPolynesia",QAT:"qatar",REU:"reunion",ROU:"romania",RUS:"russia",RWA:"rwanda",SAU:"saudiArabia",SDN:"sudan",SEN:"senegal",SGP:"singapore",SGS:"southGeorgiaAndTheSouthSandwichIslands",SHN:"saintHelena",SJM:"svalbardAndJanMayen",SLB:"solomonIslands",SLE:"sierraLeone",SLV:"elSalvador",SMR:"sanMarino",SOM:"somalia",SPM:"saintPierreAndMiquelon",SRB:"serbia",SSD:"southSudan",STP:"saoTomeAndPrincipe",SUR:"suriname",SVK:"slovakia",SVN:"slovenia",SWE:"sweden",SWZ:"eswatini",SXM:"dutchSintMaarten",SYC:"seychelles",SYR:"syria",TCA:"turksAndCaicosIslands",TCD:"chad",TGO:"togo",THA:"thailand",TJK:"tajikistan",TKL:"tokelau",TKM:"turkmenistan",TLS:"timorLeste",TON:"tonga",TTO:"trinidadAndTobago",TUN:"tunisia",TUR:"turkey",TUV:"tuvalu",TWN:"taiwan",TZA:"tanzania",UGA:"uganda",UKR:"ukraine",UMI:"usMinorOutlyingIslands",URY:"uruguay",USA:"us",UZB:"uzbekistan",VAT:"holySee",VCT:"saintVincentAndTheGrenadines",VEN:"venezuela",VGB:"britishVirginIslands",VIR:"usVirginIslands",VNM:"vietnam",VUT:"vanuatu",WLF:"wallisAndFutuna",WSM:"samoa",XKX:"kosovo",YEM:"yemen",ZAF:"southAfrica",ZMB:"zambia",ZWE:"zimbabwe"};var Ua=(d=>(d.UsBorderCrossingCard="usBorderCrossingCard",d.ChinaExitEntryPermit="chinaExitEntryPermit",d.UsGlobalEntryCard="usGlobalEntryCard",d.ChinaMainlandTravelPermitTaiwan="chinaMainlandTravelPermitTaiwan",d.UsNexusCard="usNexusCard",d.ChinaMainlandTravelPermitHongKongMacau="chinaMainlandTravelPermitHongKongMacau",d.ApecBusinessTravelCard="apecBusinessTravelCard",d.PakistanAfghanCitizenCard="pakistanAfghanCitizenCard",d.SingaporeFinCard="singaporeFinCard",d.UsGreenCard="usGreenCard",d.MalaysiaIkad="malaysiaIkad",d.MalaysiaMykad="malaysiaMykad",d.MalaysiaMypr="malaysiaMypr",d.MexicoConsularVoterId="mexicoConsularVoterId",d.GermanyEid="germanyEid",d.UsCommonAccessCard="usCommonAccessCard",d.PhilippinesMultipurposeId="philippinesMultipurposeId",d.MalaysiaMykas="malaysiaMykas",d.MalaysiaMykid="malaysiaMykid",d.MalaysiaMytentera="malaysiaMytentera",d.MexicoProfessionalId="mexicoProfessionalId",d.MalaysiaRefugeeId="malaysiaRefugeeId",d.CanadaTribalId="canadaTribalId",d.UsUniformedServicesId="usUniformedServicesId",d.UsVeteranId="usVeteranId",d.PhilippinesWorkPermit="philippinesWorkPermit",d.SingaporeWorkPermit="singaporeWorkPermit",d.UsWorkPermit="usWorkPermit",d.PhilippinesSocialSecurityCard="philippinesSocialSecurityCard",d.SwedenSocialSecurityCard="swedenSocialSecurityCard",d.CanadaSocialSecurityCard="canadaSocialSecurityCard",d.UsSocialSecurityCard="usSocialSecurityCard",d.BelgiumMinorsId="belgiumMinorsId",d.ColombiaMinorsId="colombiaMinorsId",d.PeruMinorsId="peruMinorsId",d.BoliviaMinorsId="boliviaMinorsId",d.HungaryAddressCard="hungaryAddressCard",d.UkAsylumRequest="ukAsylumRequest",d.CanadaCitizenshipCertificate="canadaCitizenshipCertificate",d.SingaporeEmploymentPass="singaporeEmploymentPass",d.CanadaMinorsPublicServicesCard="canadaMinorsPublicServicesCard",d.MalaysiaMypolis="malaysiaMypolis",d.PhilippinesNbiClearance="philippinesNbiClearance",d.IndiaPanCard="indiaPanCard",d.PhilippinesPostalId="philippinesPostalId",d.PakistanProofOfRegistration="pakistanProofOfRegistration",d.SingaporeSPass="singaporeSPass",d.SwedenSisId="swedenSisId",d.ColombiaTemporaryProtectionPermit="colombiaTemporaryProtectionPermit",d.UsTwicCard="usTwicCard",d.UsWeaponPermit="usWeaponPermit",d.CanadaWeaponPermit="canadaWeaponPermit",d.IrelandPublicServicesCard="irelandPublicServicesCard",d.CanadaPublicServicesCard="canadaPublicServicesCard",d.PakistanConsularId="pakistanConsularId",d.GuatemalaConsularId="guatemalaConsularId",d.MexicoConsularId="mexicoConsularId",d.PhilippinesTaxId="philippinesTaxId",d.MexicoTaxId="mexicoTaxId",d.ChinaOneWayPermit="chinaOneWayPermit",d.UsMedicalMarijuanaCard="usMedicalMarijuanaCard",d.UsMunicipalId="usMunicipalId",d.AustraliaAsicCard="australiaAsicCard",d.UaeVehicleRegistrationCard="uaeVehicleRegistrationCard",d.UaeEsaadCard="uaeEsaadCard",d))(Ua||{});function ta(e){return e.state===b.StageValid&&e.scanningFirstSideDone||!e.backViz.empty}function xa(e){return ta(e)||e.backProcessingStatus===We.Success?e.state===b.Valid&&e.scanningFirstSideDone?"frontAndBack":"frontOnly":"frontOnly"}function Fa(e){return "backViz"in e&&!e.backViz.empty}function Wa(e){switch(e){case S.PAKISTAN:return ["regionSpecific","pakistanConsularId"];case S.GUATEMALA:return ["regionSpecific","guatemalaConsularId"];case S.MEXICO:return ["regionSpecific","mexicoConsularId"];default:return ["regionSpecific",null]}}function Ba(e){switch(e){case S.IRELAND:return ["regionSpecific","irelandPublicServicesCard"];case S.CANADA:return ["regionSpecific","canadaPublicServicesCard"];default:return ["regionSpecific",null]}}function Ga(e){switch(e){case S.PHILIPPINES:return ["regionSpecific","philippinesWorkPermit"];case S.SINGAPORE:return ["regionSpecific","singaporeWorkPermit"];case S.USA:return ["regionSpecific","usWorkPermit"];default:return ["regionSpecific",null]}}function Va(e){switch(e){case S.PHILIPPINES:return ["regionSpecific","philippinesSocialSecurityCard"];case S.SWEDEN:return ["regionSpecific","swedenSocialSecurityCard"];case S.CANADA:return ["regionSpecific","canadaSocialSecurityCard"];case S.USA:return ["regionSpecific","usSocialSecurityCard"];default:return ["regionSpecific",null]}}function ja(e){switch(e){case S.BELGIUM:return ["regionSpecific","belgiumMinorsId"];case S.COLOMBIA:return ["regionSpecific","colombiaMinorsId"];case S.PERU:return ["regionSpecific","peruMinorsId"];case S.BOLIVIA:return ["regionSpecific","boliviaMinorsId"];default:return ["regionSpecific",null]}}function Ha(e){switch(e){case S.PHILIPPINES:return ["regionSpecific","philippinesTaxId"];case S.MEXICO:return ["regionSpecific","mexicoTaxId"];default:return ["regionSpecific",null]}}function za(e){switch(e){case S.USA:return ["regionSpecific","usWeaponPermit"];case S.CANADA:return ["regionSpecific","canadaWeaponPermit"];default:return ["regionSpecific",null]}}var oe=class e{constructor(t,a,r){this.alreadyReturnedStageValid=!1;this.recognizer=t,this.workerCallProvider=a,this.capturedSides=r;}reset(){this.alreadyReturnedStageValid=!1;}static concatenateReducer(t,a){return t+String.fromCodePoint(a)}static stringFromMultiScriptResult(t){return typeof t.latin=="string"&&t.latin.length>0?t.latin:typeof t.arabic=="string"&&t.arabic.length>0?t.arabic:typeof t.cyrillic=="string"&&t.cyrillic.length>0?t.cyrillic:""}static isCentaurusDateResult(t){return Object.prototype.hasOwnProperty.call(t,"originalString")}static isCentaurusStringResult(t){return !e.isCentaurusDateResult(t)}async processResult(t){var r,s;if(t===b.Uncertain)return {result:null,requiresReset:this.capturedSides==="frontOnly"?"hard":"soft"};let a=this.capturedSides==="frontOnly"?await this.processSingleSideResult(t):await this.processDoubleSideResult(t);return ((r=a.result)==null?void 0:r.vizResult.documentType)==null?{result:null,requiresReset:(s=a.requiresReset)!=null?s:"soft"}:a}centaurusDocumentTypeToIdCaptureDocumentType(t,a){switch(t){case l.NONE:case l.COUNT:return null;case l.ID:case l.VOTER_ID:case l.PASSPORT_CARD:case l.PROOF_OF_REGISTRATION:case l.NON_VOTER_ID:case l.PROOF_OF_AGE_CARD:return ["idCard",null];case l.DL:case l.DL_PUBLIC_SERVICES_CARD:case l.PROFESSIONAL_DL:case l.DRIVER_CARD:case l.DRIVING_PRIVILEGE_CARD:case l.DRIVER_QUALIFICATION_CARD:case l.PROVISIONAL_DL:return ["driverLicense",null];case l.PASSPORT:case l.ALIEN_PASSPORT:case l.CONSULAR_PASSPORT:case l.MINORS_PASSPORT:case l.REFUGEE_PASSPORT:return ["passport",null];case l.RESIDENCE_PERMIT:case l.RESIDENT_ID:case l.TEMPORARY_RESIDENCE_PERMIT:case l.ALIEN_ID:case l.SPECIAL_ID:return ["residencePermit",null];case l.VISA:case l.IMMIGRANT_VISA:return ["visaIcao",null];case l.HEALTH_INSURANCE_CARD:case l.INTERIM_HEALTH_INSURANCE_CARD:case l.RECIPROCAL_HEALTH_INSURANCE_CARD:return ["healthInsuranceCard",null];case l.CONSULAR_ID:return Wa(a);case l.EMPLOYMENT_PASS:return ["regionSpecific","singaporeEmploymentPass"];case l.FIN_CARD:return ["regionSpecific","singaporeFinCard"];case l.MULTIPURPOSE_ID:return ["regionSpecific","philippinesMultipurposeId"];case l.MYKAD:return ["regionSpecific","malaysiaMykad"];case l.MYKID:return ["regionSpecific","malaysiaMykid"];case l.MYPR:return ["regionSpecific","malaysiaMypr"];case l.MYTENTERA:return ["regionSpecific","malaysiaMytentera"];case l.PAN_CARD:return ["regionSpecific","indiaPanCard"];case l.PROFESSIONAL_ID:return ["regionSpecific","mexicoProfessionalId"];case l.PUBLIC_SERVICES_CARD:return Ba(a);case l.WORK_PERMIT:return Ga(a);case l.IKAD:return ["regionSpecific","malaysiaIkad"];case l.MILITARY_ID:return ["regionSpecific","usCommonAccessCard"];case l.MYKAS:return ["regionSpecific","malaysiaMykas"];case l.SOCIAL_SECURITY_CARD:return Va(a);case l.S_PASS:return ["regionSpecific","singaporeSPass"];case l.ADDRESS_CARD:return ["regionSpecific","hungaryAddressCard"];case l.GREEN_CARD:return ["regionSpecific","usGreenCard"];case l.MINORS_ID:return ja(a);case l.POSTAL_ID:return ["regionSpecific","philippinesPostalId"];case l.TAX_ID:return Ha(a);case l.WEAPON_PERMIT:return za(a);case l.BORDER_CROSSING_CARD:return ["regionSpecific","usBorderCrossingCard"];case l.GLOBAL_ENTRY_CARD:return ["regionSpecific","usGlobalEntryCard"];case l.MYPOLIS:return ["regionSpecific","malaysiaMypolis"];case l.NEXUS_CARD:return ["regionSpecific","usNexusCard"];case l.REFUGEE_ID:return ["regionSpecific","malaysiaRefugeeId"];case l.TRIBAL_ID:return ["regionSpecific","canadaTribalId"];case l.VETERAN_ID:return ["regionSpecific","usVeteranId"];case l.CITIZENSHIP_CERTIFICATE:return ["regionSpecific","canadaCitizenshipCertificate"];case l.MINORS_PUBLIC_SERVICES_CARD:return ["regionSpecific","canadaMinorsPublicServicesCard"];case l.ASYLUM_REQUEST:return ["regionSpecific","ukAsylumRequest"];case l.UNIFORMED_SERVICES_ID:return ["regionSpecific","usUniformedServicesId"];case l.CONSULAR_VOTER_ID:return ["regionSpecific","mexicoConsularVoterId"];case l.TWIC_CARD:return ["regionSpecific","usTwicCard"];case l.NBI_CLEARANCE:return ["regionSpecific","philippinesNbiClearance"];case l.TEMPORARY_PROTECTION_PERMIT:return ["regionSpecific","colombiaTemporaryProtectionPermit"];case l.AFGHAN_CITIZEN_CARD:return ["regionSpecific","pakistanAfghanCitizenCard"];case l.EID:return ["regionSpecific","germanyEid"];case l.SIS_ID:return ["regionSpecific","swedenSisId"];case l.ASIC_CARD:return ["regionSpecific","australiaAsicCard"];case l.VEHICLE_REGISTRATION:return ["regionSpecific","uaeVehicleRegistrationCard"];case l.ESAAD_CARD:return ["regionSpecific","uaeEsaadCard"];case l.EXIT_ENTRY_PERMIT:case l.MAINLAND_TRAVEL_PERMIT_TAIWAN:case l.BIDOON_CARD:case l.PASS:case l.MY_NUMBER_CARD:return null;default:assertUnreachable(t);}return null}convertDate(t){if(t.successfullyParsed===!0&&t.empty===!1){let a=t;return {day:a.day,month:a.month,year:a.year}}return null}async convertResult(t){if(t.state===b.Empty)return {result:null};if(this.isSingleSideResult(t)){if(t.viz.empty)return !t.barcode.empty||t.mrz.rawMRZString.length>0?{result:null,requiresReset:"hard"}:{result:null}}else if(t.frontViz.empty&&t.backViz.empty)return {result:null,requiresReset:"hard"};return this.alreadyReturnedStageValid=t.state===b.StageValid,{result:{mrzResult:null,vizResult:await this.getVizData(t),barcodeResult:null,imageInfo:this.getImageData(t),verificationResult:null}}}shouldExtractRecognizerResultData(t){return t.country===S.GERMANY&&t.documentType===l.ID}optionallyExtractRecognizerResultData(t,a){if(!this.shouldExtractRecognizerResultData(t.classInfo))return;let r=e.stringFromMultiScriptResult;t.firstName&&(a.firstName=r(t.firstName)),t.lastName&&(a.lastName=r(t.lastName)),t.additionalNameInformation&&(a.additionalNameInformation=r(t.additionalNameInformation));}async extractVizData(t,a,r){var P,j,ce,de;let s=e.stringFromMultiScriptResult,o=s(a.vehicleClass),c=s(a.restrictions),u=s(a.endorsements),I=this.workerCallProvider(),N=null;I&&(o.length>0||c.length>0||u.length>0)&&(N=await Ge.create(I).createDrivingLicenseDetailsFromBlinkIdData(o,c,u));let[C,f]=(P=this.centaurusDocumentTypeToIdCaptureDocumentType(t.documentType,t.country))!=null?P:[null,null];return {firstName:s(r.firstName),lastName:s(r.lastName),secondaryLastName:null,fullName:s(r.fullName),sex:s(r.sex),dateOfBirth:this.convertDate(r.dateOfBirth),nationality:s(r.nationality),address:s(r.address),documentType:C,documentSubtype:f,issuingCountryIso:(j=t.isoAlpha3CountryCode)!=null?j:null,issuingCountry:(de=$t[(ce=t.isoAlpha3CountryCode)!=null?ce:""])!=null?de:null,documentNumber:s(r.documentNumber),dateOfExpiry:this.convertDate(r.dateOfExpiry),dateOfIssue:this.convertDate(r.dateOfIssue),additionalAddressInformation:s(r.additionalAddressInformation),additionalNameInformation:s(r.additionalNameInformation),documentAdditionalNumber:s(r.documentAdditionalNumber),employer:s(r.employer),issuingAuthority:s(r.issuingAuthority),maritalStatus:s(r.maritalStatus),personalIdNumber:s(r.personalIdNumber),placeOfBirth:s(r.placeOfBirth),profession:s(r.profession),race:s(r.race),religion:s(r.religion),residentialStatus:s(r.residentialStatus),mothersName:s(r.mothersName),fathersName:s(r.fathersName),issuingJurisdiction:Xt(t.region),issuingJurisdictionIso:null,drivingLicenseDetails:N?N.toJSONObject():null,bloodType:s(r.bloodType),sponsor:s(r.sponsor),passportNumber:null,visaNumber:null,vehicleOwner:s(r.vehicleOwner)}}getFieldLocations(t){var r,s;let a={};for(let o of Object.keys(t)){let c=o,u=t[c];if(typeof u=="object"){if(u.hasOwnProperty("latinLocation")&&((r=u.latinLocation)==null?void 0:r.topLeft)!=null){let{topLeft:I,bottomRight:N}=u.latinLocation;a[c]=new Quadrilateral(new Point(I.x,I.y),new Point(N.x,I.y),new Point(N.x,N.y),new Point(I.x,N.y)).toJSONObject();}else if(u.hasOwnProperty("originalString")){let I=u;if(((s=I.originalString)==null?void 0:s.hasOwnProperty("latinLocation"))===!0&&I.originalString.latinLocation!==void 0){let{topLeft:N,bottomRight:C}=I.originalString.latinLocation;a[c]=new Quadrilateral(new Point(N.x,N.y),new Point(C.x,N.y),new Point(C.x,C.y),new Point(N.x,C.y)).toJSONObject();}}}}return a}getImageBase64String(t){return t?btoa(t.reduce((a,r)=>e.concatenateReducer(a,r),"")):null}getImageData(t){let a={face:this.getImageBase64String(t.faceImage.encodedImage)};return this.isSingleSideResult(t)?{front:{...a,croppedDocument:this.getImageBase64String(t.fullDocumentImage.encodedImage),frame:null},back:{face:null,croppedDocument:null,frame:null}}:{front:{...a,croppedDocument:this.getImageBase64String(t.fullDocumentFrontImage.encodedImage),frame:null},back:{face:null,croppedDocument:this.getImageBase64String(t.fullDocumentBackImage.encodedImage),frame:null}}}getRealIdStatus(t){switch(this.isSingleSideResult(t)?t.imageAnalysisResult.realIDDetectionStatus:t.frontImageAnalysisResult.realIDDetectionStatus){case ae.NotAvailable:return "notAvailable";case ae.NotDetected:return "notRealIdCompliant";case ae.Detected:return "realIdCompliant";default:return "notAvailable"}}async getVizData(t){let a=this.getRealIdStatus(t);if(this.isSingleSideResult(t)){let u={...await this.extractVizData(t.classInfo,t.driverLicenseDetailedInfo,t.viz),usRealIdStatus:a,capturedSides:"frontOnly",isBackSideCaptureSupported:!1,frontFieldLocations:this.getFieldLocations(t.viz)};return this.optionallyExtractRecognizerResultData(t,u),u}let r=xa(t),s={...await this.extractVizData(t.classInfo,t.driverLicenseDetailedInfo,t.frontViz),usRealIdStatus:a,capturedSides:r,isBackSideCaptureSupported:ta(t),frontFieldLocations:this.getFieldLocations(t.frontViz)};if(this.optionallyExtractRecognizerResultData(t,s),!Fa(t))return s;let o=["address","dateOfBirth","dateOfExpiry","dateOfIssue","documentNumber","firstName","fullName","lastName","nationality","sex","additionalAddressInformation","additionalNameInformation","documentAdditionalNumber","employer","issuingAuthority","maritalStatus","personalIdNumber","placeOfBirth","profession","race","religion","residentialStatus","mothersName","fathersName"],{backViz:c}=t;for(let u of o)if(s[u]==null||s[u]===""){let N=c[u];this.handleEmptyFrontValue(s,u,N);}return s}handleEmptyFrontValue(t,a,r){if(e.isCentaurusStringResult(r)){let s=e.stringFromMultiScriptResult(r);s.length>0&&(t[a]=s);}else if(e.isCentaurusDateResult(r)){let s=this.convertDate(r);s&&(t[a]=s);}}isSingleSideResult(t){return this.capturedSides==="frontOnly"}hasResult(t){return t===b.Valid||t===b.StageValid&&!this.alreadyReturnedStageValid}async processDoubleSideResult(t){if(this.hasResult(t)){let a=await this.recognizer.getResult();return this.convertResult(a)}return {result:null}}async processSingleSideResult(t){if(t===b.Valid){let a=await this.recognizer.getResult();return this.convertResult(a)}return {result:null}}};var T=class{static isSingleSideScanner(t){return !t._isFull}static isFullDocumentScanner(t){return t._isFull}};var je=class e{constructor(t,a,r){this._settingsCapturedSides=null;this.isProcessing=!1;this._lastError=null;this._lastResult=null;this._lastLocalization=null;this._currentDetectionOnlyMode=!1;this.idCapture=t,this.centaurusWasmSDK=a,this._workerCallProvider=r;}static hasRecognizerRunnerCrashed(t){return t instanceof R&&t.code===h.WORKER_IMAGE_PROCESS_FAILURE}static updatePassedRecognizerSettings(t,a,r={}){a.returnFullDocumentImage=t.getShouldPassImageTypeToResult("croppedDocument"),a.returnEncodedFullDocumentImage=t.getShouldPassImageTypeToResult("croppedDocument"),a.returnFaceImage=t.getShouldPassImageTypeToResult("face"),a.returnEncodedFaceImage=t.getShouldPassImageTypeToResult("face");let s=new Fe;switch(s.enableMrzId=!0,s.enableMrzPassport=!0,s.enableMrzVisa=!0,s.enableBarcodeId=!0,s.enablePhotoId=!1,s.enableFullDocumentRecognition=!0,a.recognitionModeFilter=s,t.getProperty("anonymizeCapturedData")===!1&&(t.anonymizationMode="none"),t.anonymizationMode){case"none":{a.anonymizationMode=B.None;break}case"fieldsOnly":{a.anonymizationMode=B.None;break}case"imagesOnly":{a.anonymizationMode=B.ImageOnly;break}case"fieldsAndImages":{a.anonymizationMode=B.ImageOnly;break}}a.scanCroppedDocumentImage=typeof r.scanCroppedDocumentImage=="boolean"?r.scanCroppedDocumentImage:!1;}async init(t){if(e.recognizerRunner!=null)throw new DataCaptureError({name:"MULTIPLE_RECOGNIZER_RUNNER",message:"A RecognizerRunner already exists, but it must be a singleton"});this.idCaptureSettings=t;let{scannerType:a}=t;this._settingsCapturedSides=T.isSingleSideScanner(a)?"frontOnly":"frontAndBack";let r=await this.getConfiguredRecognizer(this.idCaptureSettings);if(!r)throw new DataCaptureError({name:"RECOGNIZER_CREATION_FAILURE",message:"Recognizer instance could not be created."});this.recognizer=r,await this.createRunner(),await this.setDetectionOnlyMode(t.captureTrigger==="buttonTap"),this.resultProcessor=new oe(this.recognizer,this._workerCallProvider,this._settingsCapturedSides);}async applySettings(t){let a=T.isSingleSideScanner(t.scannerType)?"frontOnly":"frontAndBack",r=this._settingsCapturedSides!==a;if(this.idCaptureSettings=t,this._settingsCapturedSides=a,r&&e.recognizerRunner){await e.recognizerRunner.reconfigureRecognizers([],!1),await this.recognizer.delete();let s=await this.getConfiguredRecognizer(this.idCaptureSettings);if(s==null)throw new DataCaptureError({name:"RECOGNIZER_CREATION_FAILURE",message:"applySettings: recognizer instance could not be created."});this.recognizer=s,await e.recognizerRunner.reconfigureRecognizers([this.recognizer],!1),this.resultProcessor=new oe(this.recognizer,this._workerCallProvider,this._settingsCapturedSides);}else await this.reconfigureRecognizer(t);}async processFrame(t,a){if(this.isProcessing||e.recognizerRunner==null)return !1;this.isProcessing=!0,await this.configuringRecognizersPromise,(a==null?void 0:a.scanCroppedDocumentImage)===!0&&await this.reconfigureRecognizer(this.idCaptureSettings,{scanCroppedDocumentImage:!0});try{await this.recognize(t);}finally{(a==null?void 0:a.scanCroppedDocumentImage)===!0&&await this.reconfigureRecognizer(this.idCaptureSettings,{scanCroppedDocumentImage:!1}),this.isProcessing=!1;}return this.getLastResult()!=null}onQuadDetection(t){this._lastLocalization=t.detectionStatus===w.Success?Quadrilateral.fromJSON(t):null,this.reportLastLocalizedDocument(this._lastLocalization),this.reportLastDetectionIssue(t);}async dispose(){var t;await((t=e.recognizerRunner)==null?void 0:t.delete()),e.recognizerRunner=void 0,await this.recognizer.delete();}async reset(t=!0){var a;await((a=e.recognizerRunner)==null?void 0:a.resetRecognizers(t)),this._lastResult=null,this._lastError=null,t&&this.resultProcessor.reset();}async setDetectionOnlyMode(t){if(this._currentDetectionOnlyMode!==t){if(e.recognizerRunner==null)throw new D("Cannot set detection mode, IdCapture has not initialized yet.");this._currentDetectionOnlyMode=t,await e.recognizerRunner.setDetectionOnlyMode(t);}}displayDetectionStatusInUI(t){let a=window,r=a.centaurusDetectionStatus;r==null&&(r=document.createElement("div"),r.className="centaurusDetectionStatus",r.style.position="absolute",r.style.zIndex="1000",r.style.top="10px",r.style.left="10px",r.style.padding="0 1rem",r.style.backgroundColor="white",document.body.append(r),a.centaurusDetectionStatus=r),r.textContent=`LocalizedStatus: ${w[t.detectionStatus]}`;}reportLastLocalizedDocument(t){if(t==null)this.idCapture.reportLastLocalizedId(null);else {let a=Be.fromJSON({location:t});this.idCapture.reportLastLocalizedId(a);}}reportLastDetectionIssue(t){let a=null;switch(t.detectionStatus){case w.CameraTooFar:{a="DocumentTooFar";break}case w.CameraTooClose:case w.DocumentTooCloseToCameraEdge:case w.DocumentPartiallyVisible:{a="DocumentTooClose";break}default:a=null;}this.idCapture.reportLastDetectionIssue(a);}getLastResult(){return this._lastResult}async setLastResult(t){return this._lastResult=t,this.idCapture.reportLastResult(t)}getLastError(){return this._lastError}async setLastError(t){if(t!==this._lastError)return this.idCapture.reportLastError(t);this._lastError=t;}async createRunner(){e.recognizerRunner=await Zt(this.centaurusWasmSDK,[this.recognizer],!1,this);}async getConfiguredRecognizer(t){let{centaurusWasmSDK:a}=this,r=T.isFullDocumentScanner(t.scannerType),s;try{if(r){s=await Qt(a);let o=await s.currentSettings();e.updatePassedRecognizerSettings(t,o),await s.updateSettings(o);}else {s=await Yt(a);let o=await s.currentSettings();e.updatePassedRecognizerSettings(t,o),await s.updateSettings(o);}}catch(o){Logger.log(Logger.Level.Warn,"Error while applying new settings on recognizer object, some features might not work.",o);}return s}getRecognizerErrorMessage(t){return t instanceof R?`Processing frame failed: ${t.message} (code=${t.code})`:`Processing frame failed: ${t instanceof Error?t.message:"unknown error"}`}async recognize(t){let a=new ke({...t,colorSpace:"srgb"},Ue.NoRotation,!1),r;try{await this.setLastResult(null),await this.setLastError(null),r=await e.recognizerRunner.processImage(a);}catch(c){if(e.hasRecognizerRunnerCrashed(c)){await this.resetRecognizerRunner(),this.notifyRecoveryAfterError();return}let u=this.getRecognizerErrorMessage(c);throw await this.setLastError({type:"Undefined",message:u}),D.create({type:"Undefined",message:u})}let{result:s,requiresReset:o}=await this.resultProcessor.processResult(r);typeof o=="string"&&await this.reset(o==="hard"),!(s!=null&&!this.checkImagesPresence(s,r))&&(s!=null&&this._lastLocalization!=null&&this.addLocationInformationToResult(s,this._lastLocalization),await this.setLastResult(s));}checkImagesPresence(t,a){if(!(t.vizResult.capturedSides==="frontAndBack")||a!==b.Valid)return !0;let s=Object.values(nt).filter(c=>c!=="frame");return !s.some(c=>this.isImageRequiredButEmpty(t.imageInfo,c))}addLocationInformationToResult(t,a){let r=["barcodeResult","mrzResult","vizResult"];for(let s of r)t[s]!=null&&(t[s].location=a.toJSONObject());}async reconfigureRecognizer(t,a={}){if(e.recognizerRunner){await e.recognizerRunner.reconfigureRecognizers([],!1);let r=await this.recognizer.currentSettings();e.updatePassedRecognizerSettings(t,r,a),await this.recognizer.updateSettings(r),await e.recognizerRunner.reconfigureRecognizers([this.recognizer],!1);}}async resetRecognizerRunner(){var t;return await((t=e.recognizerRunner)==null?void 0:t.delete()),await this.recognizer.delete(),e.recognizerRunner=void 0,Logger.log(Logger.Level.Debug,"Recreating Centaurus recognizer"),this.init(this.idCaptureSettings)}notifyRecoveryAfterError(){this.idCapture.notifyRecoveryAfterCrash();}isImageRequiredButEmpty(t,a){var s,o,c;return this.idCaptureSettings.getShouldPassImageTypeToResult(a)?a==="face"?((s=t==null?void 0:t.front.face)!=null?s:"")==="":a==="croppedDocument"?((o=t==null?void 0:t.front.croppedDocument)!=null?o:"")===""||((c=t==null?void 0:t.back.croppedDocument)!=null?c:"")==="":!1:!1}};var Ka=(f=>(f.NotAcceptedDocumentType="notAcceptedDocumentType",f.InvalidFormat="invalidFormat",f.DocumentVoided="documentVoided",f.Timeout="timeout",f.SingleImageNotRecognized="singleImageNotRecognized",f.DocumentExpired="documentExpired",f.DocumentExpiresSoon="documentExpiresSoon",f.NotRealIdCompliant="notRealIdCompliant",f.HolderUnderage="holderUnderage",f.ForgedAamvaBarcode="forgedAamvaBarcode",f.InconsistentData="inconsistentData",f))(Ka||{});var He="reloadDetector",Je=class Je{constructor(t,a=Je.DEFAULT_WRITE_INTERVAL_MS){this._lastWrite=0;this._storage=t,this._writeIntervalMs=a;}hasDataAlreadyWritten(){return this._storage.getItem(He)!==null}write(t){return this._pendingData={...t},this.scheduleWrite(),t}read(){var a;if(this._pendingData)return this._pendingData;let t=(a=this._storage.getItem(He))!=null?a:"{}";return JSON.parse(t)}clear(){this._storage.removeItem(He),this._pendingData=void 0,this._lastWrite=0,clearTimeout(this._writeTimer);}scheduleWrite(){clearTimeout(this._writeTimer);let t=performance.now()-this._lastWrite;t>this._writeIntervalMs?(this._storage.setItem(He,JSON.stringify(this._pendingData)),this._pendingData=void 0,this._lastWrite=performance.now()):this._writeTimer=setTimeout(this.scheduleWrite.bind(this),this._writeIntervalMs-t);}};Je.DEFAULT_WRITE_INTERVAL_MS=500;var ze=Je;var le=class{constructor(t){this.onUnload=()=>{this._storage.clear();};this._onPageAbruptlyReloaded=t,this._storage=new ze(this.getStorage());}static isSafari(){return BrowserHelper.isSafari()}install(){if(BrowserHelper.isSafari()){if(window.addEventListener("unload",this.onUnload,{once:!0}),!this._storage.hasDataAlreadyWritten()){this._storage.write({});return}this._onPageAbruptlyReloaded();}}updateData(t){this._storage.write(t);}get data(){return this._storage.read()}uninstall(){window.removeEventListener("unload",this.onUnload);}getStorage(){return sessionStorage}};var Ze=class Ze{constructor(t){this._framesProcessedCount=0;this._didCaptureCount=0;this._didRejectCount=0;this._applySettingsCount=1;this._videoResolution="";this._upTimeMs=0;this._upTimeTimer=null;this._detector=t;}destroy(){this._upTimeTimer&&(clearInterval(this._upTimeTimer),this._upTimeTimer=null);}get framesProcessedCount(){return this._framesProcessedCount}get didCaptureCount(){return this._didCaptureCount}get didRejectCount(){return this._didRejectCount}get applySettingsCount(){return this._applySettingsCount}get videoResolution(){return this._videoResolution}set framesProcessedCount(t){this._framesProcessedCount=t,this._upTimeTimer==null&&(this._firstFrameProcessedTime=performance.now(),this._upTimeTimer=setInterval(this.updateUpTime.bind(this),Ze.UP_TIME_UPDATE_INTERVAL_MS)),this._detector.updateData(this.data);}set didCaptureCount(t){this._didCaptureCount=t,this._detector.updateData(this.data);}set didRejectCount(t){this._didRejectCount=t,this._detector.updateData(this.data);}set applySettingsCount(t){this._applySettingsCount=t,this._detector.updateData(this.data);}set videoResolution(t){this._videoResolution=t,this._detector.updateData(this.data);}get data(){return {framesProcessedCount:this._framesProcessedCount,didCaptureCount:this._didCaptureCount,didRejectCount:this._didRejectCount,applySettingsCount:this._applySettingsCount,upTime:Math.round(this._upTimeMs/100)/10,videoResolution:this._videoResolution}}updateUpTime(){this._firstFrameProcessedTime&&(this._upTimeMs=performance.now()-this._firstFrameProcessedTime,this._detector.updateData(this.data));}};Ze.UP_TIME_UPDATE_INTERVAL_MS=500;var Ke=Ze;var E={Available:"Available",ProcessingFrame:"ProcessingFrame",ProcessingQueue:"ProcessingQueue"},Ye=class e{constructor(){this.type="idCapture";this._synchronousFrameFlow=!0;this.state=E.Available;this._isEnabled=!0;this._context=null;this.listeners=[];this.overlayListeners=new Set;this._endOfCycleTasks=[];this._feedback=he.defaultFeedback;this._onProcessFrameListener=this.onProcessFrame.bind(this);this.workerMessageListener=this.onWorkerMessage.bind(this);e._centaurusLoader!=null&&(this._centaurusConnector=new je(this,e._centaurusLoader.wasmSDK,()=>{var t;return (t=this.privateContext)==null?void 0:t.workerCommand})),this.contextListener={didChangeFrameSource:this.didChangeFrameSource.bind(this)};}static get recommendedCameraSettings(){return new CameraSettings(_.IdCapture.RecommendedCameraSettings)}get context(){return this._context}get feedback(){return this._feedback}get privateContext(){return this.context}static setCentaurusLoader(t){e._centaurusLoader=t;}static async forContext(t,a){let r=new e;if(r.settings=a,r._centaurusConnector)try{await r._centaurusConnector.init(r.settings);}catch(s){throw s instanceof DataCaptureError&&s.name==="MULTIPLE_RECOGNIZER_RUNNER"&&Logger.log(Logger.Level.Error,"The newly created IdCapture mode is invalid, an existing IdCapture mode is still attached to the context and must be removed first."),s}else r.checkCaptureSettingsAgainstSDKConfiguration(a);return t&&await t.addMode(r),r}async setFeedback(t){return this._feedback=t,this.didChange()}addListener(t){this.listeners.includes(t)||this.listeners.push(t);}removeListener(t){this.listeners.includes(t)&&this.listeners.splice(this.listeners.indexOf(t),1);}isEnabled(){return this._isEnabled}async setEnabled(t){this._isEnabled!==t&&(this._isEnabled=t,this.enqueueTask(async()=>this.didChange([{type:"modeEnabled",newValue:t}])),this.state===E.Available&&this.moveToState(E.ProcessingQueue));}async reset(){this.enqueueTask(async()=>this.doReset()),this.state===E.Available&&this.moveToState(E.ProcessingQueue);}async applySettings(t){this.enqueueTask(async()=>this.doApplySettings(t)),this.state===E.Available&&this.moveToState(E.ProcessingQueue);}async parse(t){if(this.context){let a=await this.context.workerCommand("idCaptureParse",{code:t});if((a==null?void 0:a.result)!=null){let r=a.result;if((r==null?void 0:r.status)==="error")throw D.create({type:"InvalidLicenseKeyForParser",message:r.error});if((r==null?void 0:r.status)==="success"){let s=this.convertRawImagesToBase64(r.capturedId.rawImageInfo);return ne.fromJSON({...r.capturedId,imageInfo:s})}}}return null}toJSONObject(){var t,a;return {enabled:this._isEnabled,type:this.type,settings:{...this.settings.toJSONObject(),licensee:"",licenseKey:(a=(t=e._centaurusLoader)==null?void 0:t.licenseKey)!=null?a:""}}}didChangeFrameSource(){this.moveToState(E.ProcessingQueue);}moveToState(t){this.state=t,t===E.ProcessingQueue&&this.processQueue();}async doReset(){var t;await((t=this.privateContext)==null?void 0:t.workerCommand("idCaptureReset",{}));}async doApplySettings(t){var a,r,s;this.context&&(this.settings=t,this.checkCaptureSettingsAgainstSDKConfiguration(t),await Promise.all([this.settingsIncludeVIZDocuments(t)?(a=this._centaurusConnector)==null?void 0:a.applySettings(t):Promise.resolve(),(r=this.privateContext)==null?void 0:r.workerCommand("idCaptureApplySettings",{settings:t.toJSONObject()}),(s=this.privateContext)==null?void 0:s.update()]),this._safariOOMStatsCollector&&this._safariOOMStatsCollector.applySettingsCount++);}addOverlayListener(t){this.overlayListeners.add(t);}removeOverlayListener(t){this.overlayListeners.delete(t);}checkCaptureSettingsAgainstSDKConfiguration(t){if(!this._centaurusConnector&&this.settingsIncludeVIZDocuments(t))throw D.create({type:"InvalidSettingsForVIZProcessing",message:"Invalid IdCapture configuration or settings: supported documents contain some VIZ documents, but VIZ scanning is disabled."})}async onProcessFrame(t){var a,r;return this.state!==E.Available?"skip":((a=this.privateContext)==null||a.performanceMark("processFrameBeforeCentaurus"),this.moveToState(E.ProcessingFrame),await this.doProcessFrame(t),(r=this.privateContext)==null||r.performanceMark("processFrameAfterCentaurus"),"continue")}async doProcessFrame(t){var a;if(this._isEnabled&&this.settingsIncludeVIZDocuments(this.settings)){let r=new Uint8ClampedArray(t.data),s=(a=this.context)==null?void 0:a.frameSource;!await this.processFrameWithCentaurus({data:r,width:t.width,height:t.height})&&(s==null?void 0:s.type)==="singleImageUploader"&&(r=new Uint8ClampedArray(t.data),await this.processFrameWithCentaurus({data:r,width:t.width,height:t.height},{scanCroppedDocumentImage:!0}));}}async onAfterProcessFrame(){var t,a;if(this._safariOOMStatsCollector){this._safariOOMStatsCollector.framesProcessedCount++;let r=(a=(t=this.context)==null?void 0:t.frameSource)==null?void 0:a.currentResolution;r?this._safariOOMStatsCollector.videoResolution=`${r.width}x${r.height}`:this._safariOOMStatsCollector.videoResolution="";}this.moveToState(E.ProcessingQueue);}logPerformance(){let t=performance.getEntriesByName("processFrameBeforeCentaurus").length>0?performance.measure("Centaurus","processFrameBeforeCentaurus","processFrameAfterCentaurus").duration:0,a=performance.measure("SDC","processFrameBeforeSDC","processFrameAfterSDC").duration,r=`${(t+a).toFixed(2)}ms`;console.log(`centaurus: ${t.toFixed(2)}`,`sdc: ${a.toFixed(2)}`,`total: ${r}`),performance.clearMarks();}enqueueTask(t){this._endOfCycleTasks.push(t);}async processQueue(){if(this._endOfCycleTasks.length===0){this.moveToState(E.Available);return}for(;this._endOfCycleTasks.length>0;){let t=this._endOfCycleTasks.shift();await(t==null?void 0:t());}this.moveToState(E.Available);}settingsIncludeVIZDocuments(t){let{scannerType:a}=t;return T.isFullDocumentScanner(a)?!0:a.visualInspectionZone}attachedToContext(t){this._context=t,this._context.subscribeToWorkerMessages(this.workerMessageListener),this._context.registerFrameHandler(this._onProcessFrameListener),le.isSafari()&&(this._safariOOMDetector=new le(this.onPageAbruptlyReloaded.bind(this)),this._safariOOMDetector.install(),this._safariOOMStatsCollector=new Ke(this._safariOOMDetector)),this._context.addListener(this.contextListener);}async detachedFromContext(){var t,a,r,s,o;return (t=this._context)==null||t.unsubscribeToWorkerMessages(this.workerMessageListener),(a=this._context)==null||a.unregisterFrameHandler(this._onProcessFrameListener),(r=this._context)==null||r.removeListener(this.contextListener),(s=this._safariOOMDetector)==null||s.uninstall(),this._safariOOMDetector=void 0,(o=this._safariOOMStatsCollector)==null||o.destroy(),this._safariOOMStatsCollector=void 0,this._context=null,this.dispose()}async dispose(){var t;this.listeners=[],await((t=this._centaurusConnector)==null?void 0:t.dispose()),this._centaurusConnector=void 0;}async didChange(t){if(this.context)return this.context.update(t)}async onWorkerMessage(t){switch(t.type){case"idCaptureDidCaptureId":{this.triggerListenersForResult("didCaptureId",t.payload);break}case"idCaptureDidRejectId":{await this.triggerListenersForResult("didRejectId",t.payload),t.payload.rejectionReason==="singleImageNotRecognized"&&await this.reset();break}case"idCaptureDidShutterButtonPositionChanged":{for(let a of this.overlayListeners)a.onShutterPositionUpdate(t.payload.position);break}case"idCaptureDidShutterButtonStateChanged":{for(let a of this.overlayListeners)a.onShutterButtonStateChanged(t.payload.state);break}case"idCaptureIdCapturedFeedback":{this._feedback.idCaptured.emit();break}case"idCaptureIdRejectedFeedback":{this._feedback.idRejected.emit();break}case"idCaptureBackendReset":{this.enqueueTask(async()=>{var a;return (a=this._centaurusConnector)==null?void 0:a.reset(t.payload.hardReset)});break}case"idCaptureDetectionOnlyMode":{this.enqueueTask(async()=>{var a;return (a=this._centaurusConnector)==null?void 0:a.setDetectionOnlyMode(t.payload.detectionOnlyMode)}),this.state===E.Available&&this.moveToState(E.ProcessingQueue);break}case"onFrameProcessingStarted":break;case"onFrameProcessingFinished":{this.onAfterProcessFrame();break}case"onFrameSkipped":{this.onAfterProcessFrame();break}}}async processFrameWithCentaurus(t,a){try{return await this._centaurusConnector.processFrame(t,a)}catch(r){return r instanceof D?(Logger.log(Logger.Level.Debug,r.message),this.triggerErrorListener(r)):(Logger.log(Logger.Level.Debug,"Error while processing incoming frame from SDC",r),this.triggerErrorListener(D.create({type:"Undefined",message:"Error while processing a frame"}))),!1}}uint8ArrayImageToBase64(t,a,r){let s=document.createElement("canvas");s.width=a,s.height=r;let o=s.getContext("2d");if(!o)throw new Error("Could not get 2d context from an HTMLCanvasElement");o.putImageData(new ImageData(t,a,r,{colorSpace:"srgb"}),0,0);let c=o.canvas.toDataURL("image/png",1).replace("data:image/png;base64,","");return o=null,s=null,c}convertRawImagesToBase64(t){return {front:{...t.front,frame:t.front.frame.data==null?null:this.uint8ArrayImageToBase64(t.front.frame.data,t.front.frame.width,t.front.frame.height)},back:{...t.back,frame:t.back.frame.data==null?null:this.uint8ArrayImageToBase64(t.back.frame.data,t.back.frame.width,t.back.frame.height)}}}async triggerListenersForResult(t,a){if(!this.context||!this._isEnabled)return;t==="didCaptureId"?this._safariOOMStatsCollector&&this._safariOOMStatsCollector.didCaptureCount++:t==="didRejectId"&&this._safariOOMStatsCollector&&this._safariOOMStatsCollector.didRejectCount++;let r=null;if(a.capturedId){let s=this.convertRawImagesToBase64(a.capturedId.rawImageInfo);r=ne.fromJSON({...a.capturedId,imageInfo:s});}for(let s of this.listeners)if(typeof s[t]=="function"){let o=[r];t==="didRejectId"&&typeof a.rejectionReason=="string"&&o.push(a.rejectionReason);let c=s[t].apply(null,o);c instanceof Promise&&await c;}}notifyRecoveryAfterCrash(){if(!this._isEnabled)return;let t=!1;for(let a of this.listeners)typeof a.didFailWithError=="function"&&(a.didFailWithError(this,D.create({type:"RecoveredAfterFailure",message:"Last image processing failed but SDK could recover. Please reset scanning process."})),t=!0);!t&&this.settings.scannerType._isFull&&Logger.log(Logger.Level.Warn,`A process responsible to scan images malfunctioned and was restarted. No listener for "didFailWithError" was
1
+ import {CameraSettings,Color,Feedback,Sound,Logger,Quadrilateral,DataCaptureError,Brush,Localization,OverrideState,DataCaptureContext,BrowserHelper,DataCaptureLoader,assertUnreachable,Point}from'@scandit/web-datacapture-core';import {isObject}from'@scandit/web-datacapture-core/build/js/private/utils/isObject.js';import {match}from'@scandit/web-datacapture-core/build/js/private/utils/match.js';import {ViewClassNames}from'@scandit/web-datacapture-core/build/js/private/ViewClassNames.js';import {ShutterButton}from'@scandit/web-datacapture-core/build/js/private/ui/atoms/ShutterButton.js';var p={"scandit-datacapture-sdk-id-pthreads.wasm":{bytes:8401414},"scandit-datacapture-sdk-id-simd.wasm":{bytes:8195094},"scandit-datacapture-sdk-id-simd-pthreads.wasm":{bytes:8309156},"scandit-datacapture-sdk-id.wasm":{bytes:8287796}};var Na=e=>({IdCapture:{RecommendedCameraSettings:CameraSettings.fromJSON(e.IdCapture.RecommendedCameraSettings),IdCaptureOverlayDefaults:{defaultCapturedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeWidth},defaultLocalizedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeWidth},defaultRejectedBrush:{fillColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.fillColor),strokeColor:Color.fromJSON(e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeColor),strokeWidth:e.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeWidth}}}}),_=Na({IdCapture:{RecommendedCameraSettings:{zoomFactor:1,zoomGestureZoomFactor:2,focusGestureStrategy:"manualUntilCapture",preferredResolution:"fullHd"},IdCaptureOverlayDefaults:{defaultCapturedBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3},defaultLocalizedBrush:{fillColor:"#FFFFFF80",strokeColor:"#FFFFFF00",strokeWidth:0},defaultRejectedBrush:{fillColor:"#00000000",strokeColor:"#FFFFFFFF",strokeWidth:3}}}});var pe=(o=>(o.Undefined="Undefined",o.RecoveredAfterFailure="RecoveredAfterFailure",o.InvalidLicenseKeyForVIZProcessing="InvalidLicenseKeyForVIZProcessing",o.InvalidSettingsForVIZProcessing="InvalidSettingsForVIZProcessing",o.InvalidLicenseKeyForParser="InvalidLicenseKeyForParser",o))(pe||{}),D=class e extends Error{constructor(){super(...arguments);this._type="Undefined";this._message="";}get type(){return this._type}get message(){return this._message}static create(a){let r=new e;return a&&(r.name=a.type,r._type=a.type,r._message=a.message),r}static fromJSON(a){let r=new e;return r._type=a.type,r._message=a.message,r}};var gt="data:audio/mpeg;base64,SUQzBAAAAAACGFRFTkMAAAALAAADUHJvIFRvb2xzAFRYWFgAAAAjAAADb3JpZ2luYXRvcl9yZWZlcmVuY2UAYWE0RVFOcW9VQk9rAFRJVDIAAAAeAAADMDdfU2NhbmRpdF9TY2FubmVkLVdyb25nSXRlbQBUWFhYAAAASQAAA3VtaWQAMHgwNjBBMkIzNDAxMDEwMTA1MDEwMTBGMTAxMzAwMDAwMDg2RUUzOTA5RUE3QjgwMDBGNjZGQzVERDdBNzc5ODE0AFRYWFgAAAAYAAADdGltZV9yZWZlcmVuY2UAMjY3MDU5MABURFJDAAAADAAAAzIwMjMtMDMtMjQAVFNTRQAAAA8AAANMYXZmNTkuMTcuMTAxAAAAAAAAAAAAAAD/+1QAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABJbmZvAAAADwAAABQAAAhAACIiIiIuLi4uLjo6Ojo6RUVFRUVRUVFRUV1dXV1daGhoaGh0dHR0dICAgICAi4uLi4uXl5eXl6KioqKirq6urq66urq6usXFxcXF0dHR0dHd3d3d3ejo6Ojo9PT09PT//////wAAAABMYXZjNTkuMjAAAAAAAAAAAAAAAAAkAsAAAAAAAAAIQBl5jwn/+xRkAAAAVgDUjQBgAAAADSCgAAEDiBduGIGACAAANIMAAAAgP8plFgg7znL+Q4k4B5uo2Rk9c+LQuOexRB4iCTT6t24x+9f7f/ve/OAAwiE0lTn2XHl6PVZxCA5GsdT/+xRkCoPwcwJexxhAAAAADSDgAAEBiAl0oJxAEAAANIAAAAQLpHM6PLpQzOOJP9g5lhihlyb2dlebf8JCDTyRW9i0P7qaz/+QAFBoW4NDEqQuutHr41//tAlwcSVBnm3/+xRkGwPwdwHbgCsQAAAADSAAAAEBlAd5AIhAAAAANIAAAATHiGz+Vc+PkABIAc4KvoFaqtnriqAiChQ15lfsMNqJ+6pCWSiwWiCplZ48GhwdztADJY5zm8nAqeDYITz/+xRkKwPweAReQCYQAAAADSAAAAEB5BF+gYhgKAAANIAAAARCDP8WxCCX+BeBTH3/iEEQWPLf/j9xbSKUgEEVL1p+0zaZlevKU5jbmwnBfkrWVYFOA8ttpVTjnZNQTAj/+xRkOYHwcAJeQCIYAAAADSAAAAEBwAd1AJhAAAAANIAAAAQh4cpNFFitO6uKSSRkaPEOmFCjhCufYvSYAMRykUrsTqSNnkFv2JqLbTWsOJFsnYRXo/r1z8r/7+mDiwH/+xRkSYAAdwLcJSQACAAADSCgAAEEeJFKGKUACAAANIMAAABxOtc6Jp53xlXP35AAcoV0pquMq1q/64ds9sxEh5Gt1gF6lGuqIWmtoDBY0qSi+FDRUEFIX0BPlJEDhYT/+xRkTgPxAxRZhzDAAAAADSDgAAEBlAl5AJhAAAAANIAAAATqelYAwIlAy0/IoV/EKh5Gw6UEDpn9pqpMQU1FqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkVYPweQJfIMkQCAAADSAAAAEBzAlyAJwAAAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkZIPwdAdgoEEYigAADSAAAAEB1AuEgQhAKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkc4PwcAdewMEQoAAADSAAAAEBrAmCgQhgKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkg4fwcgHcIMYICgAADSAAAAEBcA8wrGHgKAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRklI/wTgLEAwkACgAADSAAAAEBWBTkBIxiaAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkxBTUUzLjk5LjWqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkqA/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRkxg/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqr/+xRk4Y/wAABpAAAACAAADSAAAAEAAAGkAAAAIAAANIAAAASqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqo=";var he=class e{constructor(){this.idCaptured=Feedback.defaultFeedback;this.idRejected=new Feedback(null,null);}static get defaultFeedback(){return new e}static get defaultSuccessSound(){return Sound.defaultSound}static get defaultFailureSound(){return new Sound(gt)}toJSONObject(){return {idCaptured:this.idCaptured.toJSONObject(),idRejected:this.idRejected.toJSONObject()}}};var y=(u=>(u.Passport="passport",u.IdCard="idCard",u.DriverLicense="driverLicense",u.VisaIcao="visaIcao",u.ResidencePermit="residencePermit",u.HealthInsuranceCard="healthInsuranceCard",u.RegionSpecific="regionSpecific",u))(y||{}),g=class{constructor(t){this._region=t;}get region(){return this._region}isPassport(){return this.documentType==="passport"}isIdCard(){return this.documentType==="idCard"}isDriverLicense(){return this.documentType==="driverLicense"}isVisaIcao(){return this.documentType==="visaIcao"}isHealthInsuranceCard(){return this.documentType==="healthInsuranceCard"}isResidencePermit(){return this.documentType==="residencePermit"}isRegionSpecific(){return this.documentType==="regionSpecific"}};var me=class e{constructor(){this.json={};}get errorCorrection(){return this.json.errorCorrection}get moduleCountX(){return this.json.moduleCountX}get moduleCountY(){return this.json.moduleCountY}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {errorCorrection:this.errorCorrection,moduleCountX:this.moduleCountX,moduleCountY:this.moduleCountY}}};var A=class e{constructor(){this.json={};}get day(){return this.json.day}get month(){return this.json.month}get year(){return this.json.year}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {day:this.day,month:this.month,year:this.year}}};var Ae=class e{get dateOfExpiry(){var t;return (t=A.fromJSON(this.json.dateOfExpiry))!=null?t:new A}get codes(){return this.json.codes}static fromJSON(t){if(t===null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {codes:[...this.codes],dateOfExpiry:this.dateOfExpiry.toJSONObject()}}};var Ie=class e{get vehicleCode(){return this.json.vehicleCode}get vehicleRestriction(){return this.json.vehicleRestriction}get dateOfIssue(){var t;return (t=A.fromJSON(this.json.dateOfIssue))!=null?t:new A}static fromJSON(t){if(t===null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {dateOfIssue:this.dateOfIssue.toJSONObject(),vehicleCode:this.vehicleCode,vehicleRestriction:this.vehicleRestriction}}};var Se=class e{get aamvaVersion(){return this.json.aamvaVersion}get aliasFamilyName(){return this.json.aliasFamilyName}get aliasGivenName(){return this.json.aliasGivenName}get aliasSuffixName(){return this.json.aliasSuffixName}get bloodType(){return this.json.bloodType}get branchOfService(){return this.json.branchOfService}get cardInstanceIdentifier(){return this.json.cardInstanceIdentifier}get cardRevisionDate(){return A.fromJSON(this.json.cardRevisionDate)}get categories(){return this.json.categories!=null?this.json.categories:[]}get champusEffectiveDate(){return A.fromJSON(this.json.champusEffectiveDate)}get champusExpiryDate(){return A.fromJSON(this.json.champusExpiryDate)}get citizenshipStatus(){return this.json.citizenshipStatus}get civilianHealthCareFlagCode(){return this.json.civilianHealthCareFlagCode}get civilianHealthCareFlagDescription(){return this.json.civilianHealthCareFlagDescription}get commissaryFlagCode(){return this.json.commissaryFlagCode}get commissaryFlagDescription(){return this.json.commissaryFlagDescription}get countryOfBirth(){return this.json.countryOfBirth}get countryOfBirthIso(){return this.json.countryOfBirthIso}get deersDependentSuffixCode(){return this.json.deersDependentSuffixCode}get deersDependentSuffixDescription(){return this.json.deersDependentSuffixDescription}get directCareFlagCode(){return this.json.directCareFlagCode}get directCareFlagDescription(){return this.json.directCareFlagDescription}get documentCopy(){return this.json.documentCopy}get documentDiscriminatorNumber(){return this.json.documentDiscriminatorNumber}get driverNamePrefix(){return this.json.driverNamePrefix}get driverNameSuffix(){return this.json.driverNameSuffix}get driverRestrictionCodes(){return this.json.driverRestrictionCodes!=null?this.json.driverRestrictionCodes:[]}get ediPersonIdentifier(){return this.json.ediPersonIdentifier}get endorsementsCode(){return this.json.endorsementsCode}get exchangeFlagCode(){return this.json.exchangeFlagCode}get exchangeFlagDescription(){return this.json.exchangeFlagDescription}get eyeColor(){return this.json.eyeColor}get familySequenceNumber(){return this.json.familySequenceNumber}get firstNameTruncation(){return this.json.firstNameTruncation}get firstNameWithoutMiddleName(){return this.json.firstNameWithoutMiddleName}get formNumber(){return this.json.formNumber}get genevaConventionCategory(){return this.json.genevaConventionCategory}get hairColor(){return this.json.hairColor}get heightCm(){return this.json.heightCm}get heightInch(){return this.json.heightInch}get IIN(){return this.json.iin}get identificationType(){return this.json.identificationType}get issuingJurisdiction(){return this.json.issuingJurisdiction}get issuingJurisdictionIso(){return this.json.issuingJurisdictionIso}get barcodeMetadata(){return me.fromJSON(this.json.barcodeMetadata)}get jpegData(){return this.json.jpegData}get jurisdictionVersion(){return this.json.jurisdictionVersion}get lastNameTruncation(){return this.json.lastNameTruncation}get licenseCountryOfIssue(){return this.json.licenseCountryOfIssue}get middleName(){return this.json.middleName}get middleNameTruncation(){return this.json.middleNameTruncation}get mwrFlagCode(){return this.json.mwrFlagCode}get mwrFlagDescription(){return this.json.mwrFlagDescription}get payGrade(){return this.json.payGrade}get payPlanCode(){return this.json.payPlanCode}get payPlanGradeCode(){return this.json.payPlanGradeCode}get personDesignatorDocument(){return this.json.personDesignatorDocument}get personDesignatorTypeCode(){return this.json.personDesignatorTypeCode}get personMiddleInitial(){return this.json.personMiddleInitial}get personalIdNumber(){return this.json.personalIdNumber}get personalIdNumberType(){return this.json.personalIdNumberType}get personnelCategoryCode(){return this.json.personnelCategoryCode}get personnelEntitlementConditionType(){return this.json.personnelEntitlementConditionType}get placeOfBirth(){return this.json.placeOfBirth}get professionalDrivingPermit(){return this.json.professionalDrivingPermit!=null?Ae.fromJSON(this.json.professionalDrivingPermit):null}get race(){return this.json.race}get rank(){return this.json.rank}get rawData(){return this.json.rawData}get relationshipCode(){return this.json.relationshipCode}get relationshipDescription(){return this.json.relationshipDescription}get restrictionsCode(){return this.json.restrictionsCode}get securityCode(){return this.json.securityCode}get serviceCode(){return this.json.serviceCode}get sponsorFlag(){return this.json.sponsorFlag}get sponsorName(){return this.json.sponsorName}get sponsorPersonDesignatorIdentifier(){return this.json.sponsorPersonDesignatorIdentifier}get statusCode(){return this.json.statusCode}get statusCodeDescription(){return this.json.statusCodeDescription}get vehicleClass(){return this.json.vehicleClass}get vehicleRestrictions(){return this.json.vehicleRestrictions!=null?this.json.vehicleRestrictions.map(t=>Ie.fromJSON(t)).filter(t=>t!=null):[]}get version(){return this.json.version}get weightKg(){return this.json.weightKg}get weightLbs(){return this.json.weightLbs}get isRealId(){return this.json.isRealId}get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get fullName(){return this.json.fullName}get sex(){return this.json.sex}get dateOfBirth(){return A.fromJSON(this.json.dateOfBirth)}get nationality(){return this.json.nationality}get address(){return this.json.address}get documentNumber(){return this.json.documentNumber}get dateOfExpiry(){return A.fromJSON(this.json.dateOfExpiry)}get dateOfIssue(){return A.fromJSON(this.json.dateOfIssue)}get barcodeDataElements(){return this.json.dictionary}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){var t,a,r,s,o,c;return {firstName:this.firstName,lastName:this.lastName,secondaryLastName:this.json.secondaryLastName,fullName:this.fullName,sex:this.sex,nationality:this.nationality,address:this.address,issuingCountry:this.json.issuingCountry,issuingCountryIso:this.json.issuingCountryIso,barcodeMetadata:this.barcodeMetadata?this.barcodeMetadata.toJSONObject():null,documentNumber:this.documentNumber,documentType:this.json.documentType,documentSubtype:this.json.documentSubtype,documentAdditionalNumber:this.json.documentAdditionalNumber,dateOfBirth:(a=(t=this.dateOfBirth)==null?void 0:t.toJSONObject())!=null?a:null,dateOfExpiry:(s=(r=this.dateOfExpiry)==null?void 0:r.toJSONObject())!=null?s:null,dateOfIssue:(c=(o=this.dateOfIssue)==null?void 0:o.toJSONObject())!=null?c:null,aamvaVersion:this.aamvaVersion,aliasFamilyName:this.aliasFamilyName,aliasGivenName:this.aliasGivenName,aliasSuffixName:this.aliasSuffixName,bloodType:this.bloodType,branchOfService:this.branchOfService,cardInstanceIdentifier:this.cardInstanceIdentifier,cardRevisionDate:this.cardRevisionDate?this.cardRevisionDate.toJSONObject():null,categories:[...this.categories],champusEffectiveDate:this.champusEffectiveDate?this.champusEffectiveDate.toJSONObject():null,champusExpiryDate:this.champusExpiryDate?this.champusExpiryDate.toJSONObject():null,citizenshipStatus:this.citizenshipStatus,civilianHealthCareFlagCode:this.civilianHealthCareFlagCode,civilianHealthCareFlagDescription:this.civilianHealthCareFlagDescription,commissaryFlagCode:this.commissaryFlagCode,commissaryFlagDescription:this.commissaryFlagDescription,countryOfBirth:this.countryOfBirth,countryOfBirthIso:this.countryOfBirthIso,deersDependentSuffixCode:this.deersDependentSuffixCode,deersDependentSuffixDescription:this.deersDependentSuffixDescription,directCareFlagCode:this.directCareFlagCode,directCareFlagDescription:this.directCareFlagDescription,documentCopy:this.documentCopy,documentDiscriminatorNumber:this.documentDiscriminatorNumber,driverNamePrefix:this.driverNamePrefix,driverNameSuffix:this.driverNameSuffix,driverRestrictionCodes:[...this.driverRestrictionCodes],ediPersonIdentifier:this.ediPersonIdentifier,endorsementsCode:this.endorsementsCode,exchangeFlagCode:this.exchangeFlagCode,exchangeFlagDescription:this.exchangeFlagDescription,eyeColor:this.eyeColor,familySequenceNumber:this.familySequenceNumber,firstNameTruncation:this.firstNameTruncation,firstNameWithoutMiddleName:this.firstNameWithoutMiddleName,formNumber:this.formNumber,genevaConventionCategory:this.genevaConventionCategory,hairColor:this.hairColor,heightCm:this.heightCm,heightInch:this.heightInch,iin:this.IIN,identificationType:this.identificationType,issuingJurisdiction:this.issuingJurisdiction,issuingJurisdictionIso:this.issuingJurisdictionIso,jpegData:this.jpegData,jurisdictionVersion:this.jurisdictionVersion,lastNameTruncation:this.lastNameTruncation,licenseCountryOfIssue:this.licenseCountryOfIssue,middleName:this.middleName,middleNameTruncation:this.middleNameTruncation,mwrFlagCode:this.mwrFlagCode,mwrFlagDescription:this.mwrFlagDescription,payGrade:this.payGrade,payPlanCode:this.payPlanCode,payPlanGradeCode:this.payPlanGradeCode,personDesignatorDocument:this.personDesignatorDocument,personDesignatorTypeCode:this.personDesignatorTypeCode,personMiddleInitial:this.personMiddleInitial,personalIdNumber:this.personalIdNumber,personalIdNumberType:this.personalIdNumberType,personnelCategoryCode:this.personnelCategoryCode,personnelEntitlementConditionType:this.personnelEntitlementConditionType,placeOfBirth:this.placeOfBirth,professionalDrivingPermit:this.professionalDrivingPermit?this.professionalDrivingPermit.toJSONObject():null,race:this.race,rank:this.rank,rawData:this.rawData,relationshipCode:this.relationshipCode,relationshipDescription:this.relationshipDescription,restrictionsCode:this.restrictionsCode,securityCode:this.securityCode,serviceCode:this.serviceCode,sponsorFlag:this.sponsorFlag,sponsorName:this.sponsorName,sponsorPersonDesignatorIdentifier:this.sponsorPersonDesignatorIdentifier,statusCode:this.statusCode,statusCodeDescription:this.statusCodeDescription,vehicleClass:this.vehicleClass,vehicleRestrictions:this.vehicleRestrictions.map(u=>u.toJSONObject()),version:this.version,weightKg:this.weightKg,weightLbs:this.weightLbs,isRealId:this.isRealId,dictionary:{...this.barcodeDataElements}}}};var Et=(a=>(a.FrontOnly="frontOnly",a.FrontAndBack="frontAndBack",a))(Et||{}),nt=(r=>(r.Face="face",r.CroppedDocument="croppedDocument",r.Frame="frame",r))(nt||{}),fa=(a=>(a.Front="front",a.Back="back",a))(fa||{}),Dt=(s=>(s.None="none",s.FieldsOnly="fieldsOnly",s.ImagesOnly="imagesOnly",s.FieldsAndImages="fieldsAndImages",s))(Dt||{}),bt=(a=>(a.Auto="auto",a.ButtonTap="buttonTap",a))(bt||{}),Ca=(a=>(a.Rounded="rounded",a.Square="square",a))(Ca||{}),ga=(a=>(a.Light="light",a.Bold="bold",a))(ga||{}),Ra=(r=>(r.NotAvailable="notAvailable",r.NotRealIdCompliant="notRealIdCompliant",r.RealIdCompliant="realIdCompliant",r))(Ra||{}),Oa=(r=>(r.Female="female",r.Male="male",r.Unspecified="unspecified",r))(Oa||{});var Ne=class e{constructor(){this.json=null;}get face(){var t,a;return (a=(t=this.json)==null?void 0:t.front.face)!=null?a:null}get frame(){var t,a,r,s;return (s=(r=(t=this.json)==null?void 0:t.front.frame)!=null?r:(a=this.json)==null?void 0:a.back.frame)!=null?s:null}static fromJSON(t){let a=new e;return t!=null&&(a.json=t),a}getFrame(t){var a,r,s,o;switch(t){case"front":return (r=(a=this.json)==null?void 0:a.front.frame)!=null?r:null;case"back":return (o=(s=this.json)==null?void 0:s.back.frame)!=null?o:null}return null}getCroppedDocument(t){var a,r,s,o;switch(t){case"front":return (r=(a=this.json)==null?void 0:a.front.croppedDocument)!=null?r:null;case"back":return (o=(s=this.json)==null?void 0:s.back.croppedDocument)!=null?o:null}return null}toJSONObject(){return {front:{face:this.face,croppedDocument:this.getCroppedDocument("front"),frame:this.getFrame("front")},back:{face:null,croppedDocument:this.getCroppedDocument("back"),frame:this.getFrame("back")}}}};var fe=class e{get documentCode(){return this.json.documentCode}get namesAreTruncated(){return this.json.namesAreTruncated}get optional(){return this.json.optional}get optional1(){return this.json.optional1}get capturedMrz(){return this.json.capturedMrz}get personalIdNumber(){return this.json.personalIdNumber}get renewalTimes(){return this.json.renewalTimes}get fullNameSimplifiedChinese(){return this.json.fullNameSimplifiedChinese}get omittedCharacterCountInGbkName(){return this.json.omittedCharacterCountInGbkName}get omittedNameCount(){return this.json.omittedNameCount}get issuingAuthorityCode(){return this.json.issuingAuthorityCode}get passportIssuerIso(){return this.json.passportIssuerIso}get passportNumber(){return this.json.passportNumber}get passportDateOfExpiry(){return A.fromJSON(this.json.passportDateOfExpiry)}get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get fullName(){return this.json.fullName}get sex(){return this.json.sex}get dateOfBirth(){return A.fromJSON(this.json.dateOfBirth)}get nationality(){return this.json.nationality}get address(){return this.json.address}get documentNumber(){return this.json.documentNumber}get dateOfExpiry(){return A.fromJSON(this.json.dateOfExpiry)}get dateOfIssue(){return A.fromJSON(this.json.dateOfIssue)}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){var t,a,r,s;return {...this.json,documentCode:this.documentCode,namesAreTruncated:this.namesAreTruncated,optional:this.optional,optional1:this.optional1,capturedMrz:this.capturedMrz,personalIdNumber:this.personalIdNumber,renewalTimes:this.renewalTimes,fullNameSimplifiedChinese:this.fullNameSimplifiedChinese,omittedCharacterCountInGbkName:this.omittedCharacterCountInGbkName,omittedNameCount:this.omittedNameCount,issuingAuthorityCode:this.issuingAuthorityCode,passportIssuerIso:this.passportIssuerIso,passportNumber:this.passportNumber,passportDateOfExpiry:this.passportDateOfExpiry?this.passportDateOfExpiry.toJSONObject():null,firstName:this.firstName,lastName:this.lastName,fullName:this.fullName,sex:this.sex,dateOfBirth:this.dateOfBirth?this.dateOfBirth.toJSONObject():null,nationality:this.nationality,address:this.address,documentNumber:this.documentNumber,dateOfExpiry:(a=(t=this.dateOfExpiry)==null?void 0:t.toJSONObject())!=null?a:null,dateOfIssue:(s=(r=this.dateOfIssue)==null?void 0:r.toJSONObject())!=null?s:null}}};var Ce=class e{constructor(){this.json={};}get code(){return this.json.code}get dateOfIssue(){return A.fromJSON(this.json.dateOfIssue)}get dateOfExpiry(){return A.fromJSON(this.json.dateOfExpiry)}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {code:this.code,dateOfIssue:this.dateOfIssue?this.dateOfIssue.toJSONObject():null,dateOfExpiry:this.dateOfExpiry?this.dateOfExpiry.toJSONObject():null}}};var z=class e{constructor(){this.json={};}get drivingLicenseCategories(){return this.json.drivingLicenseCategories.map(t=>Ce.fromJSON(t)).filter(t=>t!=null)}get restrictions(){return this.json.restrictions}get endorsements(){return this.json.endorsements}static fromJSON(t){if(t==null)return null;let a=new e;return a.json=t,a}toJSONObject(){return {drivingLicenseCategories:this.drivingLicenseCategories.map(t=>t.toJSONObject()),restrictions:this.restrictions,endorsements:this.endorsements}}};var ge=class e{get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get secondaryLastName(){return this.json.secondaryLastName}get fullName(){return this.json.fullName}get additionalAddressInformation(){return this.json.additionalAddressInformation}get additionalNameInformation(){return this.json.additionalNameInformation}get documentAdditionalNumber(){return this.json.documentAdditionalNumber}get employer(){return this.json.employer}get issuingAuthority(){return this.json.issuingAuthority}get issuingJurisdiction(){return this.json.issuingJurisdiction}get issuingJurisdictionIso(){return this.json.issuingJurisdictionIso}get maritalStatus(){return this.json.maritalStatus}get personalIdNumber(){return this.json.personalIdNumber}get placeOfBirth(){return this.json.placeOfBirth}get profession(){return this.json.profession}get race(){return this.json.race}get religion(){return this.json.religion}get residentialStatus(){return this.json.residentialStatus}get mothersName(){return this.json.mothersName}get fathersName(){return this.json.fathersName}get capturedSides(){return this.json.capturedSides}get isBackSideCaptureSupported(){return this.json.isBackSideCaptureSupported}get drivingLicenseDetails(){return z.fromJSON(this.json.drivingLicenseDetails)}get bloodType(){return this.json.bloodType}get sponsor(){return this.json.sponsor}get visaNumber(){return this.json.visaNumber}get passportNumber(){return this.json.passportNumber}get sex(){return this.json.sex}get dateOfBirth(){return A.fromJSON(this.json.dateOfBirth)}get nationality(){return this.json.nationality}get address(){return this.json.address}get documentNumber(){return this.json.documentNumber}get dateOfExpiry(){return A.fromJSON(this.json.dateOfExpiry)}get dateOfIssue(){return A.fromJSON(this.json.dateOfIssue)}get vehicleOwner(){return this.json.vehicleOwner}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){var t,a,r,s,o,c;return {...this.json,firstName:this.firstName,lastName:this.lastName,secondaryLastName:this.secondaryLastName,fullName:this.fullName,additionalAddressInformation:this.additionalAddressInformation,additionalNameInformation:this.additionalNameInformation,documentAdditionalNumber:this.documentAdditionalNumber,employer:this.employer,issuingAuthority:this.issuingAuthority,issuingJurisdiction:this.issuingJurisdiction,issuingJurisdictionIso:this.issuingJurisdictionIso,maritalStatus:this.maritalStatus,personalIdNumber:this.personalIdNumber,placeOfBirth:this.placeOfBirth,profession:this.profession,race:this.race,religion:this.religion,residentialStatus:this.residentialStatus,mothersName:this.mothersName,fathersName:this.fathersName,capturedSides:this.capturedSides,isBackSideCaptureSupported:this.isBackSideCaptureSupported,drivingLicenseDetails:this.drivingLicenseDetails?this.drivingLicenseDetails.toJSONObject():null,bloodType:this.bloodType,sponsor:this.sponsor,passportNumber:this.passportNumber,visaNumber:this.visaNumber,sex:this.sex,dateOfBirth:(a=(t=this.dateOfBirth)==null?void 0:t.toJSONObject())!=null?a:null,nationality:this.nationality,address:this.address,documentNumber:this.documentNumber,dateOfExpiry:(s=(r=this.dateOfExpiry)==null?void 0:r.toJSONObject())!=null?s:null,dateOfIssue:(c=(o=this.dateOfIssue)==null?void 0:o.toJSONObject())!=null?c:null,vehicleOwner:this.vehicleOwner}}};var J=class e{constructor(){this.json={};}get allChecksPassed(){return this.json.allChecksPassed}get failedChecks(){return this.json.failedChecks}get skippedChecks(){return this.json.skippedChecks}get passedChecks(){return this.json.passedChecks}static fromJSON(t){let a=new e;return a.json=t,a}async frontReviewImage(){let t=this.json.frontFieldLocations,a=t!=null&&Object.keys(t).length>0;if(!this.allChecksPassed){let r=this.json.frontImage;if(r!=null)try{if(a)return await this.highlightImage(r,t)}catch(s){Logger.log(Logger.Level.Warn,"Failed to create image with mismatching fields.",s);}}return ""}toJSONObject(){return {...this.json}}pushQuadForKey(t,a,r){let s=t[r];return s!=null?(a.push(Quadrilateral.fromJSON(s)),!0):!1}pushQuadsForKeys(t,a,r,s=[]){if(!this.pushQuadForKey(t,a,r))for(let o of s)this.pushQuadForKey(t,a,o);}getMismatchedQuads(t){let a=[];return t!=null&&(this.failedChecks.includes("documentNumberComparison")&&this.pushQuadsForKeys(t,a,"documentNumber"),this.failedChecks.includes("fullNameComparison")&&this.pushQuadsForKeys(t,a,"fullName",["firstName","lastName"]),this.failedChecks.includes("dateOfBirthComparison")&&this.pushQuadsForKeys(t,a,"dateOfBirth"),this.failedChecks.includes("dateOfExpiryComparison")&&this.pushQuadsForKeys(t,a,"dateOfExpiry"),this.failedChecks.includes("dateOfIssueComparison")&&this.pushQuadsForKeys(t,a,"dateOfIssue")),a}async highlightImage(t,a){let r=new Image;r.src=`data:image/png;base64,${t}`,await r.decode();let s=document.createElement("canvas");s.width=r.width,s.height=r.height;let o=s.getContext("2d");o.drawImage(r,0,0);let c=this.getMismatchedQuads(a);if(c.length===0)return "";o.beginPath(),o.rect(0,0,r.width,r.height);for(let u of c)o.moveTo(u.topLeft.x,u.topLeft.y),o.lineTo(u.topLeft.x,u.bottomRight.y),o.lineTo(u.bottomRight.x,u.bottomRight.y),o.lineTo(u.bottomRight.x,u.topLeft.y),o.lineTo(u.topLeft.x,u.topLeft.y);o.fillStyle="rgba(0, 0, 0, 0.30)",o.fill(),o.lineWidth=3,o.strokeStyle="red",o.beginPath();for(let u of c)o.rect(u.topLeft.x,u.topLeft.y,u.bottomRight.x-u.topLeft.x,u.bottomRight.y-u.topLeft.y);return o.stroke(),s.toDataURL("image/jpeg",1)}};var se=class e{get dataConsistency(){let t=this.json.rejectsInconsistentData;return this.json.dataConsistencyResult!=null&&t?J.fromJSON(this.json.dataConsistencyResult):null}static fromJSON(t){let a=new e;return a.json=t,a}toJSONObject(){return {...this.json}}};var K=class extends g{constructor(a){super(a);this.documentType="driverLicense";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Z=class extends g{constructor(a){super(a);this.documentType="healthInsuranceCard";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Y=class extends g{constructor(a){super(a);this.documentType="idCard";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Q=class extends g{constructor(a){super(a);this.documentType="passport";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var Da=(i=>(i.Any="any",i.EuAndSchengen="euAndSchengen",i.Aruba="aruba",i.Afghanistan="afghanistan",i.Angola="angola",i.Anguilla="anguilla",i.AlandIslands="alandIslands",i.Albania="albania",i.Andorra="andorra",i.Uae="uae",i.Argentina="argentina",i.Armenia="armenia",i.AmericanSamoa="americanSamoa",i.Antarctica="antarctica",i.FrenchSouthernTerritories="frenchSouthernTerritories",i.AntiguaAndBarbuda="antiguaAndBarbuda",i.Australia="australia",i.Austria="austria",i.Azerbaijan="azerbaijan",i.Burundi="burundi",i.Belgium="belgium",i.Benin="benin",i.BonaireSintEustatiusAndSaba="bonaireSintEustatiusAndSaba",i.BurkinaFaso="burkinaFaso",i.Bangladesh="bangladesh",i.Bulgaria="bulgaria",i.Bahrain="bahrain",i.Bahamas="bahamas",i.BosniaHerzegovina="bosniaHerzegovina",i.SaintBarthelemy="saintBarthelemy",i.Belarus="belarus",i.Belize="belize",i.Bermuda="bermuda",i.Bolivia="bolivia",i.Brazil="brazil",i.Barbados="barbados",i.BruneiDarussalam="bruneiDarussalam",i.Bhutan="bhutan",i.BouvetIsland="bouvetIsland",i.Botswana="botswana",i.Car="car",i.Canada="canada",i.CocosIslands="cocosIslands",i.Switzerland="switzerland",i.Chile="chile",i.China="china",i.CoteIvoire="coteIvoire",i.Cameroon="cameroon",i.DemocraticRepublicOfCongo="democraticRepublicOfCongo",i.Congo="congo",i.CookIslands="cookIslands",i.Colombia="colombia",i.Comoros="comoros",i.CaboVerde="caboVerde",i.CostaRica="costaRica",i.Cuba="cuba",i.Curacao="curacao",i.ChristmasIsland="christmasIsland",i.CaymanIslands="caymanIslands",i.Cyprus="cyprus",i.Czechia="czechia",i.Germany="germany",i.Djibouti="djibouti",i.Dominica="dominica",i.Denmark="denmark",i.DominicanRepublic="dominicanRepublic",i.Algeria="algeria",i.Ecuador="ecuador",i.Egypt="egypt",i.Eritrea="eritrea",i.WesternSahara="westernSahara",i.Spain="spain",i.Estonia="estonia",i.Ethiopia="ethiopia",i.Finland="finland",i.Fiji="fiji",i.FalklandIslands="falklandIslands",i.France="france",i.FaroeIslands="faroeIslands",i.Micronesia="micronesia",i.Gabon="gabon",i.Uk="uk",i.Georgia="georgia",i.Guernsey="guernsey",i.Ghana="ghana",i.Gibraltar="gibraltar",i.Guinea="guinea",i.Guadeloupe="guadeloupe",i.Gambia="gambia",i.GuineaBissau="guineaBissau",i.EquatorialGuinea="equatorialGuinea",i.Greece="greece",i.Grenada="grenada",i.Greenland="greenland",i.Guatemala="guatemala",i.FrenchGuiana="frenchGuiana",i.Guam="guam",i.Guyana="guyana",i.HongKong="hongKong",i.HeardIslandAndMcDonaldIslands="heardIslandAndMcDonaldIslands",i.Honduras="honduras",i.Croatia="croatia",i.Haiti="haiti",i.Hungary="hungary",i.Indonesia="indonesia",i.IsleOfMan="isleOfMan",i.India="india",i.BritishIndianOceanTerritory="britishIndianOceanTerritory",i.Ireland="ireland",i.Iran="iran",i.Iraq="iraq",i.Iceland="iceland",i.Israel="israel",i.Italy="italy",i.Jamaica="jamaica",i.Jersey="jersey",i.Jordan="jordan",i.Japan="japan",i.Kazakhstan="kazakhstan",i.Kenya="kenya",i.Kyrgyzstan="kyrgyzstan",i.Cambodia="cambodia",i.Kiribati="kiribati",i.SaintKittsAndNevis="saintKittsAndNevis",i.SouthKorea="southKorea",i.Kuwait="kuwait",i.Lao="lao",i.Lebanon="lebanon",i.Liberia="liberia",i.Libya="libya",i.SaintLucia="saintLucia",i.Liechtenstein="liechtenstein",i.SriLanka="sriLanka",i.Lesotho="lesotho",i.Lithuania="lithuania",i.Luxembourg="luxembourg",i.Latvia="latvia",i.Macao="macao",i.FrenchSaintMartin="frenchSaintMartin",i.Morocco="morocco",i.Monaco="monaco",i.Moldova="moldova",i.Madagascar="madagascar",i.Maldives="maldives",i.Mexico="mexico",i.MarshallIslands="marshallIslands",i.NorthMacedonia="northMacedonia",i.Mali="mali",i.Malta="malta",i.Myanmar="myanmar",i.Montenegro="montenegro",i.Mongolia="mongolia",i.NorthernMarianaIslands="northernMarianaIslands",i.Mozambique="mozambique",i.Mauritania="mauritania",i.Montserrat="montserrat",i.Martinique="martinique",i.Mauritius="mauritius",i.Malawi="malawi",i.Malaysia="malaysia",i.Mayotte="mayotte",i.Namibia="namibia",i.NewCaledonia="newCaledonia",i.Niger="niger",i.NorfolkIsland="norfolkIsland",i.Nigeria="nigeria",i.Nicaragua="nicaragua",i.Niue="niue",i.Netherlands="netherlands",i.Norway="norway",i.Nepal="nepal",i.Nauru="nauru",i.NewZealand="newZealand",i.Oman="oman",i.Pakistan="pakistan",i.Panama="panama",i.Pitcairn="pitcairn",i.Peru="peru",i.Philippines="philippines",i.Palau="palau",i.PapuaNewGuinea="papuaNewGuinea",i.Poland="poland",i.PuertoRico="puertoRico",i.NorthKorea="northKorea",i.Portugal="portugal",i.Paraguay="paraguay",i.Palestine="palestine",i.FrenchPolynesia="frenchPolynesia",i.Qatar="qatar",i.Reunion="reunion",i.Romania="romania",i.Russia="russia",i.Rwanda="rwanda",i.SaudiArabia="saudiArabia",i.Sudan="sudan",i.Senegal="senegal",i.Singapore="singapore",i.SouthGeorgiaAndTheSouthSandwichIslands="southGeorgiaAndTheSouthSandwichIslands",i.SaintHelena="saintHelena",i.SvalbardAndJanMayen="svalbardAndJanMayen",i.SolomonIslands="solomonIslands",i.SierraLeone="sierraLeone",i.ElSalvador="elSalvador",i.SanMarino="sanMarino",i.Somalia="somalia",i.SaintPierreAndMiquelon="saintPierreAndMiquelon",i.Serbia="serbia",i.SouthSudan="southSudan",i.SaoTomeAndPrincipe="saoTomeAndPrincipe",i.Suriname="suriname",i.Slovakia="slovakia",i.Slovenia="slovenia",i.Sweden="sweden",i.Eswatini="eswatini",i.DutchSintMaarten="dutchSintMaarten",i.Seychelles="seychelles",i.Syria="syria",i.TurksAndCaicosIslands="turksAndCaicosIslands",i.Chad="chad",i.Togo="togo",i.Thailand="thailand",i.Tajikistan="tajikistan",i.Tokelau="tokelau",i.Turkmenistan="turkmenistan",i.TimorLeste="timorLeste",i.Tonga="tonga",i.TrinidadAndTobago="trinidadAndTobago",i.Tunisia="tunisia",i.Turkey="turkey",i.Tuvalu="tuvalu",i.Taiwan="taiwan",i.Tanzania="tanzania",i.Uganda="uganda",i.Ukraine="ukraine",i.UsMinorOutlyingIslands="usMinorOutlyingIslands",i.Uruguay="uruguay",i.Us="us",i.Uzbekistan="uzbekistan",i.HolySee="holySee",i.SaintVincentAndTheGrenadines="saintVincentAndTheGrenadines",i.Venezuela="venezuela",i.BritishVirginIslands="britishVirginIslands",i.UsVirginIslands="usVirginIslands",i.Vietnam="vietnam",i.Vanuatu="vanuatu",i.WallisAndFutuna="wallisAndFutuna",i.Samoa="samoa",i.Kosovo="kosovo",i.Yemen="yemen",i.SouthAfrica="southAfrica",i.Zambia="zambia",i.Zimbabwe="zimbabwe",i))(Da||{});var X=class extends g{constructor(a){super("any");this.documentType="regionSpecific";this.subtype=a;}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType,documentSubtype:this.subtype}}};var $=class extends g{constructor(a){super(a);this.documentType="residencePermit";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var ee=class extends g{constructor(a){super(a);this.documentType="visaIcao";}get region(){return this._region}toJSONObject(){return {region:this.region,documentType:this.documentType}}};var ne=class e{get firstName(){return this.json.firstName}get lastName(){return this.json.lastName}get secondaryLastName(){return this.json.secondaryLastName}get fullName(){return this.json.fullName}get sexType(){return this.json.sex}get sex(){return this.json.sex}get dateOfBirth(){return A.fromJSON(this.json.dateOfBirth)}get age(){return this.json.age}get nationality(){return this.json.nationality}get address(){return this.json.address}get document(){if(this.json.documentType!=null){let t=this.json.documentType,a=this.json.documentSubtype,r=this.issuingCountry;switch(t){case"passport":return new Q(r);case"idCard":return new Y(r);case"driverLicense":return new K(r);case"visaIcao":return new ee(r);case"residencePermit":return new $(r);case"healthInsuranceCard":return new Z(r);case"regionSpecific":return new X(a);}}return null}get issuingCountryIso(){return this.json.issuingCountryIso}get issuingCountry(){return this.json.issuingCountry}get documentNumber(){return this.json.documentNumber}get documentAdditionalNumber(){return this.json.documentAdditionalNumber}get dateOfExpiry(){return A.fromJSON(this.json.dateOfExpiry)}get isExpired(){return this.json.isExpired}get dateOfIssue(){return A.fromJSON(this.json.dateOfIssue)}get usRealIdStatus(){var t,a;if(((t=this.json.vizResult)==null?void 0:t.usRealIdStatus)!=null&&this.json.vizResult.usRealIdStatus!=="notAvailable")return this.json.vizResult.usRealIdStatus;switch((a=this.barcode)==null?void 0:a.isRealId){case!0:return "realIdCompliant";case!1:return "notRealIdCompliant";default:return "notAvailable"}}get barcode(){var t;return this._barcodeResult==null&&this.json.barcodeResult!=null&&(this._barcodeResult=Se.fromJSON(this.json.barcodeResult)),(t=this._barcodeResult)!=null?t:null}get mrzResult(){var t;return this._mrzResult==null&&this.json.mrzResult!=null&&(this._mrzResult=fe.fromJSON(this.json.mrzResult)),(t=this._mrzResult)!=null?t:null}get vizResult(){var t;return this._vizResult==null&&this.json.vizResult!=null&&(this._vizResult=ge.fromJSON(this.json.vizResult)),(t=this._vizResult)!=null?t:null}get verificationResult(){var t;return this._verificationResult==null&&this.json.verificationResult!=null&&(this._verificationResult=se.fromJSON(this.json.verificationResult)),(t=this._verificationResult)!=null?t:new se}get images(){return Ne.fromJSON(this.json.imageInfo)}get barcodeResultsJSON(){var t,a;return {barcodeResult:(a=(t=this.barcode)==null?void 0:t.toJSONObject())!=null?a:null}}get mrzResultsJSON(){return {mrzResult:this.mrzResult?this.mrzResult.toJSONObject():null}}static fromJSON(t){let a=new e;return a.json=t,a}isIdCard(){var t,a;return (a=(t=this.document)==null?void 0:t.isIdCard())!=null?a:!1}isDriverLicense(){var t,a;return (a=(t=this.document)==null?void 0:t.isDriverLicense())!=null?a:!1}isPassport(){var t,a;return (a=(t=this.document)==null?void 0:t.isPassport())!=null?a:!1}isVisaIcao(){var t,a;return (a=(t=this.document)==null?void 0:t.isVisaIcao())!=null?a:!1}isRegionSpecific(t){return this.document?this.document.isRegionSpecific()&&this.document.subtype===t:!1}isResidencePermit(){var t,a;return (a=(t=this.document)==null?void 0:t.isResidencePermit())!=null?a:!1}isHealthInsuranceCard(){var t,a;return (a=(t=this.document)==null?void 0:t.isHealthInsuranceCard())!=null?a:!1}toJSONObject(){var t;return {firstName:this.firstName,lastName:this.lastName,secondaryLastName:this.secondaryLastName,fullName:this.fullName,sex:this.sex,nationality:this.nationality,address:this.address,issuingCountry:this.issuingCountry,issuingCountryIso:this.issuingCountryIso,documentNumber:this.documentNumber,documentAdditionalNumber:this.documentAdditionalNumber,dateOfBirth:this.dateOfBirth?this.dateOfBirth.toJSONObject():null,age:this.age,dateOfExpiry:this.dateOfExpiry?this.dateOfExpiry.toJSONObject():null,isExpired:this.isExpired,dateOfIssue:this.dateOfIssue?this.dateOfIssue.toJSONObject():null,documentType:this.document?this.document.documentType:null,documentSubtype:((t=this.document)==null?void 0:t.isRegionSpecific())==null?null:this.document.subtype,imageInfo:this.images.toJSONObject(),verificationResult:this.verificationResult?this.verificationResult.toJSONObject():null,vizResult:this.vizResult?this.vizResult.toJSONObject():null,idVerificationDataComparisonAvailable:this.json.idVerificationDataComparisonAvailable,usRealIdStatus:this.usRealIdStatus,...this.barcodeResultsJSON,...this.mrzResultsJSON}}};var ot=0;function ba(){let e=ot;return ot=ot+1,e}var O=class{constructor(t){this.action=t,this.messageID=ba();}},Re=class e extends O{constructor(t,a){super(e.action),this.wasmModuleName=t.wasmModuleName,this.licenseKey=t.licenseKey,this.userId=a,this.registerLoadCallback=t.loadProgressCallback!==null,this.allowHelloMessage=t.allowHelloMessage,this.engineLocation=t.engineLocation,this.wasmType=t.wasmType,this.initialMemory=t.initialMemory,this.blinkIDVariant=t.blinkIdVariant,this.numberOfWorkers=t.numberOfWorkers;}};Re.action="init";var te;(function(e){e[e.Any=0]="Any",e[e.Recognizer=1]="Recognizer",e[e.RecognizerSettings=2]="RecognizerSettings",e[e.Callback=3]="Callback";})(te||(te={}));var Oe=class e extends O{constructor(t,a){super(e.action),this.className=t,this.params=a;}};Oe.action="createNewNativeObject";var Ee=class e extends O{constructor(t,a,r){super(e.action),this.recognizerHandles=t,this.allowMultipleResults=a,this.registeredMetadataCallbacks=r;}};Ee.action="createRecognizerRunner";var De=class e extends O{constructor(t,a){super(e.action),this.recognizerHandles=t,this.allowMultipleResults=a;}};De.action="reconfigureRecognizerRunner";var be=class e extends O{constructor(){super(e.action);}};be.action="deleteRecognizerRunner";var q=class e extends O{constructor(t,a,r){super(e.action),this.objectHandle=t,this.methodName=a,this.params=r;}};q.action="invokeObject";var _e=class e extends O{constructor(t){super(e.action),this.frame=t;}getTransferrables(){return [this.frame.imageData.data.buffer]}};_e.action="processImage";var Te=class e extends O{constructor(t){super(e.action),this.hardReset=t;}};Te.action="resetRecognizers";var lt=class{constructor(){this.onDebugText=!1,this.onDetectionFailed=!1,this.onQuadDetection=!1,this.onPointsDetection=!1,this.onFirstSideResult=!1;}},Le=class e extends O{constructor(t){super(e.action),this.registeredMetadataCallbacks=t;}};Le.action="registerMetadataCallbacks";var ve=class e extends O{constructor(t){super(e.action),this.detectionOnlyMode=t;}};ve.action="setDetectionOnly";var Me=class e extends O{constructor(t){super(e.action),this.cameraPreviewMirrored=t;}};Me.action="setCameraPreviewMirrored";var we=class e extends O{constructor(t){super(e.action),this.userId=t;}};we.action="getProductIntegrationInfo";var Pe=class e extends O{constructor(t){super(e.action),this.pingProxyUrl=t;}};Pe.action="setPingProxyUrl";var ye=class e extends O{constructor(t){super(e.action),this.data=t;}};ye.action="setPingData";var M;(function(e){e[e.onDebugText=0]="onDebugText",e[e.onDetectionFailed=1]="onDetectionFailed",e[e.onQuadDetection=2]="onQuadDetection",e[e.onPointsDetection=3]="onPointsDetection",e[e.onFirstSideResult=4]="onFirstSideResult",e[e.recognizerCallback=5]="recognizerCallback";})(M||(M={}));var k;(function(e){e.Basic="BASIC",e.Advanced="ADVANCED",e.AdvancedWithThreads="ADVANCED_WITH_THREADS";})(k||(k={}));var _a=atob("Q2VudGF1cnVz"),R=class extends Error{constructor(t,a){if(super(),!t.code||!t.message)throw new Error("Instance of SDKError is required to have code and message.");if(this.message=t.message,this.code=t.code,"details"in t){if("message"in t.details){let r=new Error(t.details.message);"stack"in t.details&&(r.stack=t.details.stack),this.details=r;}}else this.details=a;}};function Ta(e){return /^https:\/\/[^\/]+(?::\d+)?\/?$/.test(e)}var h;(function(e){e.WORKER_WASM_LOAD_FAILURE="WORKER_WASM_LOAD_FAILURE",e.WORKER_WASM_INIT_MISSING="WORKER_WASM_INIT_MISSING",e.WORKER_FUNCTION_INVOKE_FAILURE="WORKER_FUNCTION_INVOKE_FAILURE",e.WORKER_RECOGNIZER_CREATION_FAILURE="WORKER_RECOGNIZER_CREATION_FAILURE",e.WORKER_RUNNER_EXISTS="WORKER_RUNNER_EXISTS",e.WORKER_RUNNER_CREATION_FAILURE="WORKER_RUNNER_CREATION_FAILURE",e.WORKER_RUNNER_MISSING="WORKER_RUNNER_MISSING",e.WORKER_RUNNER_RECONFIGURE_FAILURE="WORKER_RUNNER_RECONFIGURE_FAILURE",e.WORKER_RUNNER_DELETED="WORKER_RUNNER_DELETED",e.WORKER_RUNNER_DELETE_FAILURE="WORKER_RUNNER_DELETE_FAILURE",e.WORKER_OBJECT_INVOKE_FAILURE="WORKER_OBJECT_INVOKE_FAILURE",e.WORKER_IMAGE_PROCESS_FAILURE="WORKER_IMAGE_PROCESS_FAILURE",e.WORKER_HANDLE_UNDEFINED="WORKER_HANDLE_UNDEFINED",e.WORKER_MESSAGE_ACTION_UNKNOWN="WORKER_MESSAGE_ACTION_UNKNOWN",e.WORKER_LICENSE_UNLOCK_ERROR="WORKER_LICENSE_UNLOCK_ERROR",e.WORKER_INTEGRATION_INFO_FAILURE="WORKER_INTEGRATION_INFO_FAILURE",e.LOCAL_SDK_RUNNER_MISSING="LOCAL_SDK_RUNNER_MISSING",e.LOCAL_SDK_RUNNER_EMPTY="LOCAL_SDK_RUNNER_EMPTY",e.LICENSE_UNLOCK_ERROR="LICENSE_UNLOCK_ERROR",e.FRAME_CAPTURE_SVG_UNSUPPORTED="FRAME_CAPTURE_SVG_UNSUPPORTED",e.FRAME_CAPTURE_CANVAS_MISSING="FRAME_CAPTURE_CANVAS_MISSING",e.SDK_WASM_SETTINGS_MISSING="SDK_WASM_SETTINGS_MISSING",e.SDK_LICENSE_KEY_MISSING="SDK_LICENSE_KEY_MISSING",e.SDK_WASM_MODULE_NAME_MISSING="SDK_WASM_MODULE_NAME_MISSING",e.SDK_ENGINE_LOCATION_INVALID="SDK_ENGINE_LOCATION_INVALID",e.SDK_WORKER_LOCATION_INVALID="SDK_WORKER_LOCATION_INVALID",e.SDK_MISSING="SDK_MISSING",e.SDK_RECOGNIZERS_MISSING="SDK_RECOGNIZERS_MISSING",e.VIDEO_RECOGNIZER_ELEMENT_MISSING="VIDEO_RECOGNIZER_ELEMENT_MISSING",e.VIDEO_RECOGNIZER_CAMERA_MISSING="VIDEO_RECOGNIZER_CAMERA_MISSING",e.VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED="VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED",e.VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE="VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE",e.VIDEO_RECOGNIZER_CAMERA_IN_USE="VIDEO_RECOGNIZER_CAMERA_IN_USE",e.VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED="VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED",e.VIDEO_RECOGNIZER_FEED_RELEASED="VIDEO_RECOGNIZER_FEED_RELEASED",e.VIDEO_RECOGNIZER_FEED_NOT_PAUSED="VIDEO_RECOGNIZER_FEED_NOT_PAUSED",e.VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED="VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED",e.VIDEO_RECOGNIZER_FEED_PAUSED="VIDEO_RECOGNIZER_FEED_PAUSED",e.VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE="VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE",e.VIDEO_RECOGNIZER_FEED_MISSING="VIDEO_RECOGNIZER_FEED_MISSING",e.INVALID_PING_PROXY_URL="INVALID_PROXY_URL",e.PING_PROXY_PERMISSION_NOT_GRANTED="PING_PROXY_PERMISSION_NOT_GRANTED",e.PING_DATA_KEYS_AMOUNT_EXCEEDED="PING_DATA_KEYS_AMOUNT_EXCEEDED",e.PING_DATA_KEY_LENGTH_EXCEEDED="PING_DATA_KEY_LENGTH_EXCEEDED",e.PING_DATA_VALUE_LENGTH_EXCEEDED="PING_DATA_VALUE_LENGTH_EXCEEDED";})(h||(h={}));var m;(function(e){e.WORKER_HANDLE_UNDEFINED="Cannot find object with handle: undefined",e.WORKER_WASM_LOAD_FAILURE="Failed to load WASM in web worker!",e.WORKER_WASM_INIT_MISSING="WASM module is not initialized!",e.WORKER_FUNCTION_INVOKE_FAILURE="Failed to invoke function!",e.WORKER_RECOGNIZER_CREATION_FAILURE="Failed to create new recognizer!",e.WORKER_RUNNER_EXISTS="Recognizer runner is already created! Multiple instances are not allowed!",e.WORKER_RUNNER_CREATION_FAILURE="Failed to create new recognizer runner!",e.WORKER_RUNNER_MISSING="Recognizer runner is not created! There is nothing to reconfigure!",e.WORKER_RUNNER_RECONFIGURE_FAILURE="Failed to reconfigure recognizer runner!",e.WORKER_RUNNER_DELETED="Recognizer runner is already deleted!",e.WORKER_RUNNER_DELETE_FAILURE="Failed to delete recognizer runner!",e.WORKER_OBJECT_INVOKE_FAILURE="Failed to invoke object!",e.WORKER_IMAGE_PROCESS_FAILURE="Recognizer runner is not initialized! Cannot process image!",e.WORKER_INTEGRATION_INFO_FAILURE="Failed to get product integration info!",e.LOCAL_SDK_RUNNER_MISSING="Property nativeRecognizerRunner is not available!",e.LOCAL_SDK_RUNNER_EMPTY="Native RecognizerRunner cannot be empty!",e.LICENSE_TOKEN_STATE_INCORRECT="Internal error (Incorrect token state)",e.LICENSE_PAYLOAD_VERIFICATION_FAILED="Failed to verify server permission's digital signature!",e.LICENSE_PAYLOAD_CORRUPTED="Server permission payload is corrupted!",e.LICENSE_PERMISSION_EXPIRED="Internal error (server permission expired)",e.LICENSE_REMOTE_LOCKED="Provided license key has been remotely locked. Please contact support for more information!",e.FRAME_CAPTURE_SVG_UNSUPPORTED="Recognition of SVG elements not supported!",e.FRAME_CAPTURE_CANVAS_MISSING="Could not get canvas 2d context!",e.SDK_WASM_SETTINGS_MISSING="Missing WASM load settings!",e.SDK_LICENSE_KEY_MISSING="Missing license key!",e.SDK_WASM_MODULE_NAME_MISSING="Missing WASM module name!",e.SDK_ENGINE_LOCATION_INVALID="Setting property 'engineLocation' must be a string!",e.SDK_WORKER_LOCATION_INVALID="Setting property 'workerLocation' must be a string!",e.SDK_MISSING="SDK is not provided!",e.SDK_RECOGNIZERS_MISSING="To create RecognizerRunner at least 1 recognizer is required.",e.VIDEO_RECOGNIZER_ELEMENT_MISSING="Video element, i.e. camera feed is not provided!",e.VIDEO_RECOGNIZER_CAMERA_MISSING="Camera not found!",e.VIDEO_RECOGNIZER_CAMERA_NOT_ALLOWED="Camera not allowed!",e.VIDEO_RECOGNIZER_CAMERA_UNAVAILABLE="Camera not available!",e.VIDEO_RECOGNIZER_CAMERA_IN_USE="Camera in use!",e.VIDEO_RECOGNIZER_MEDIA_DEVICES_UNSUPPORTED="Media devices not supported by browser.",e.VIDEO_RECOGNIZER_FEED_RELEASED="The associated video feed has been released!",e.VIDEO_RECOGNIZER_FEED_NOT_PAUSED="The associated video feed is not paused. Use resumeRecognition instead!",e.VIDEO_RECOGNIZER_PLAY_REQUEST_INTERRUPTED="The play() request was interrupted or prevented by browser security rules!",e.VIDEO_RECOGNIZER_FEED_PAUSED="Cannot resume recognition while video feed is paused! Use recognize or startRecognition",e.VIDEO_RECOGNIZER_RECOGNIZERS_RESET_FAILURE="Could not reset recognizers!",e.VIDEO_RECOGNIZER_FEED_MISSING="Missing video feed!",e.INVALID_PING_PROXY_URL="Provided ping proxy URL is not a valid secure URL in format 'https://{host}:{port?}'.",e.PING_PROXY_PERMISSION_NOT_GRANTED="Allow ping proxy permission not found in license.",e.PING_DATA_KEYS_AMOUNT_EXCEEDED="Maximum number of ping data keys exceeded.",e.PING_DATA_KEY_LENGTH_EXCEEDED="Ping data key is too long.",e.PING_DATA_VALUE_LENGTH_EXCEEDED="Ping data value is too long.";})(m||(m={}));var U={wasmSettingsMissing:{message:m.SDK_WASM_SETTINGS_MISSING,code:h.SDK_WASM_SETTINGS_MISSING},licenseKeyMissing:{message:m.SDK_LICENSE_KEY_MISSING,code:h.SDK_LICENSE_KEY_MISSING},wasmModuleNameMissing:{message:m.SDK_WASM_MODULE_NAME_MISSING,code:h.SDK_WASM_MODULE_NAME_MISSING},engineLocationInvalid:{message:m.SDK_ENGINE_LOCATION_INVALID,code:h.SDK_ENGINE_LOCATION_INVALID},workerLocationInvalid:{message:m.SDK_WORKER_LOCATION_INVALID,code:h.SDK_WORKER_LOCATION_INVALID},missing:{message:m.SDK_MISSING,code:h.SDK_MISSING},recognizersMissing:{message:m.SDK_RECOGNIZERS_MISSING,code:h.SDK_RECOGNIZERS_MISSING}},La={invalidProxyUrl:{message:m.INVALID_PING_PROXY_URL,code:h.INVALID_PING_PROXY_URL},permissionNotGranted:{message:m.PING_PROXY_PERMISSION_NOT_GRANTED,code:h.PING_PROXY_PERMISSION_NOT_GRANTED},dataKeysAmountExceeded:{message:m.PING_DATA_KEYS_AMOUNT_EXCEEDED,code:h.PING_DATA_KEYS_AMOUNT_EXCEEDED},dataKeyLengthExceeded:{message:m.PING_DATA_KEY_LENGTH_EXCEEDED,code:h.PING_DATA_KEY_LENGTH_EXCEEDED},dataValueLengthExceeded:{message:m.PING_DATA_VALUE_LENGTH_EXCEEDED,code:h.PING_DATA_VALUE_LENGTH_EXCEEDED}};function L(e,t){return a=>{let r=a;r.success?e():typeof r.error=="string"||r.error===null?t(r.error):t(new R(r.error));}}function W(e,t){return a=>{let r=a;r.success?e(a):typeof r.error=="string"||r.error===null?t(r.error):t(new R(r.error));}}function va(e){let t=[];for(let a of e){let r=te.Any;a instanceof qe&&(r=te.Recognizer,a=a.getRemoteObjectHandle()),t.push({parameter:a,type:r});}return t}var qe=class{constructor(t,a,r){this.wasmSDKWorker=t,this.objectHandle=r,this.recognizerName=a,this.callbacks=new Map;}getRemoteObjectHandle(){return this.objectHandle}currentSettings(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"currentSettings",[]),s=W(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}toSignedJSON(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"toSignedJSON",[]),s=W(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}clearAllCallbacks(){this.callbacks.clear(),this.wasmSDKWorker.unregisterRecognizerCallbacks(this.objectHandle);}removeFunctions(t){this.clearAllCallbacks();let a=Object.keys(t),r=!1;for(let s of a){let o=t[s];if(typeof o=="function"){this.callbacks.set(s,o);let c={parameter:{recognizerHandle:this.objectHandle,callbackName:s},type:te.Callback};t[s]=c,r=!0;}}return r&&this.wasmSDKWorker.registerRecognizerCallbacks(this.objectHandle,this),t}updateSettings(t){return new Promise((a,r)=>{if(this.objectHandle<0){r("Invalid object handle: "+this.objectHandle.toString());return}let s=new q(this.objectHandle,"updateSettings",[{parameter:this.removeFunctions(t),type:te.RecognizerSettings}]),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}invokeCallback(t,a){let r=this.callbacks.get(t);r!==void 0?r(...a):console.warn("Cannot find callback",t);}getResult(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}let r=new q(this.objectHandle,"getResult",[]),s=W(o=>{t(o.result);},a);this.wasmSDKWorker.postMessage(r,s);})}delete(){return new Promise((t,a)=>{if(this.objectHandle<0){a("Invalid object handle: "+this.objectHandle.toString());return}this.clearAllCallbacks();let r=new q(this.objectHandle,"delete",[]),s=L(()=>{this.objectHandle=-1,t();},a);this.wasmSDKWorker.postMessage(r,s);})}};function zt(e){let t=new lt;return t.onDebugText=!!e.onDebugText,t.onDetectionFailed=!!e.onDetectionFailed,t.onPointsDetection=!!e.onPointsDetection,t.onQuadDetection=!!e.onQuadDetection,t.onFirstSideResult=!!e.onFirstSideResult,t}var ut=class{constructor(t,a){this.deleted=!1,this.wasmSDKWorker=t,this.recognizers=a;}processImage(t){return new Promise((a,r)=>{if(this.deleted){r("Recognizer runner is deleted. It cannot be used anymore!");return}let s=new _e(t),o=W(c=>{let u=c.recognitionState;a(u);},r);this.wasmSDKWorker.postTransferrableMessage(s,o);})}reconfigureRecognizers(t,a){return new Promise((r,s)=>{if(this.deleted){s("Recognizer runner is deleted. It cannot be used anymore!");return}let o=Jt(t),c=new De(o,a),u=L(r,s);this.wasmSDKWorker.postMessage(c,u),this.recognizers=t;})}setMetadataCallbacks(t){return new Promise((a,r)=>{let s=new Le(zt(t)),o=L(a,r);this.wasmSDKWorker.postMessageAndRegisterCallbacks(s,t,o);})}resetRecognizers(t){return new Promise((a,r)=>{let s=new Te(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setDetectionOnlyMode(t){return new Promise((a,r)=>{let s=new ve(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setPingProxyUrl(t){if(!Ta(t))throw new R(La.invalidProxyUrl);return new Promise((a,r)=>{let s=new Pe(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setPingData(t){return new Promise((a,r)=>{let s=new ye(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}setCameraPreviewMirrored(t){return new Promise((a,r)=>{let s=new Me(t),o=L(a,r);this.wasmSDKWorker.postMessage(s,o);})}delete(){return this.deleted?Promise.reject("Recognizer runner is already deleted."):new Promise((t,a)=>{let r=new be,s=L(()=>{this.deleted=!0,t();},a);this.wasmSDKWorker.postMessage(r,s);})}};function Jt(e){let t=[];for(let a of e)t.push(a.getRemoteObjectHandle());return t}var ct=class{constructor(t){this.wasmSDKWorker=t;}createRecognizerRunner(t,a=!1,r={}){return new Promise((s,o)=>{let c=Jt(t),u=new Ee(c,a,zt(r)),I=L(()=>{s(new ut(this.wasmSDKWorker,t));},o);this.wasmSDKWorker.postMessageAndRegisterCallbacks(u,r,I);})}newRecognizer(t,...a){return new Promise((r,s)=>{let o=new Oe(t,va(a)),c=W(u=>{let I=new qe(this.wasmSDKWorker,t,u.objectHandle);r(I);},s);this.wasmSDKWorker.postMessage(o,c);})}},dt=class e{constructor(t,a,r,s){this.eventHandlers={},this.metadataCallbacks={},this.loadedWasmType=k.Basic,this.mbWasmWorker=t,this.mbWasmWorker.onmessage=o=>{this.handleWorkerEvent(o);},this.mbWasmWorker.onerror=()=>{s("Problem during initialization of worker file!");},this.mbWasmModule=new ct(this),this.loadCallback=a,this.recognizersWithCallbacks=new Map,this.userId=r,this.showOverlay=!1;}postMessage(t,a){this.eventHandlers[t.messageID]=a,this.mbWasmWorker.postMessage(t);}postTransferrableMessage(t,a){this.eventHandlers[t.messageID]=a,this.mbWasmWorker.postMessage(t,t.getTransferrables());}postMessageAndRegisterCallbacks(t,a,r){this.eventHandlers[t.messageID]=r,this.metadataCallbacks=a,this.mbWasmWorker.postMessage(t);}registerRecognizerCallbacks(t,a){this.recognizersWithCallbacks.set(t,a);}unregisterRecognizerCallbacks(t){this.recognizersWithCallbacks.delete(t);}delete(){this.mbWasmWorker.terminate();}getProductIntegrationInfo(){return new Promise((t,a)=>{let r=new we(this.userId),s=W(o=>{t(o.result);},a);this.postMessage(r,s);})}handleWorkerEvent(t){if("isCallbackMessage"in t.data){let a=t.data;switch(a.callbackType){case M.onDebugText:typeof this.metadataCallbacks.onDebugText=="function"&&this.metadataCallbacks.onDebugText(a.callbackParameters[0]);break;case M.onDetectionFailed:typeof this.metadataCallbacks.onDetectionFailed=="function"&&this.metadataCallbacks.onDetectionFailed();break;case M.onPointsDetection:typeof this.metadataCallbacks.onPointsDetection=="function"&&this.metadataCallbacks.onPointsDetection(a.callbackParameters[0]);break;case M.onQuadDetection:typeof this.metadataCallbacks.onQuadDetection=="function"&&this.metadataCallbacks.onQuadDetection(a.callbackParameters[0]);break;case M.onFirstSideResult:typeof this.metadataCallbacks.onFirstSideResult=="function"&&this.metadataCallbacks.onFirstSideResult();break;case M.recognizerCallback:{let r=a.callbackParameters.shift(),s=this.recognizersWithCallbacks.get(r.recognizerHandle);s!==void 0?s.invokeCallback(r.callbackName,a.callbackParameters):console.warn("Cannot find recognizer to deliver callback message. Maybe it's destroyed?",r);break}default:throw new Error(`Unknown callback type: ${M[a.callbackType]}`)}}else if("isLoadProgressMessage"in t.data){let a=t.data;typeof this.loadCallback=="function"&&this.loadCallback(a.progress);}else {let a=t.data,r=this.eventHandlers[a.messageID];delete this.eventHandlers[a.messageID],r(a);}}static async createWasmWorker(t,a,r){return new Promise((s,o)=>{let c=new e(t,a.loadProgressCallback,r,o),u=new Re(a,r),I=W(N=>{let C=N;c.showOverlay=C.showOverlay,c.loadedWasmType=C.wasmType,s(c);},N=>{c&&typeof c.delete=="function"&&c.delete(),o(N);});c.postMessage(u,I);})}},Tt;(function(e){e[e.BackFacingCamera=0]="BackFacingCamera",e[e.FrontFacingCamera=1]="FrontFacingCamera";})(Tt||(Tt={}));var Ue;(function(e){e[e.RotatedLeft90=0]="RotatedLeft90",e[e.NoRotation=1]="NoRotation",e[e.RotatedRight90=2]="RotatedRight90",e[e.Rotated180=3]="Rotated180";})(Ue||(Ue={}));var b;(function(e){e[e.Empty=0]="Empty",e[e.Uncertain=1]="Uncertain",e[e.Valid=2]="Valid",e[e.StageValid=3]="StageValid";})(b||(b={}));var Lt;(function(e){e[e.Front=0]="Front",e[e.Back=1]="Back";})(Lt||(Lt={}));var ke=class{constructor(t,a,r){let s={data:t.data,width:t.width,height:t.height,colorSpace:t.colorSpace};this.imageData=s,this.orientation=a,this.videoFrame=r;}};var vt;(function(e){e[e.Invalid=0]="Invalid",e[e.RequiresServerPermission=1]="RequiresServerPermission",e[e.Valid=2]="Valid";})(vt||(vt={}));var Mt;(function(e){e.LicenseTokenStateInvalid="LICENSE_TOKEN_STATE_INVALID",e.NetworkError="NETWORK_ERROR",e.RemoteLock="REMOTE_LOCK",e.PermissionExpired="PERMISSION_EXPIRED",e.PayloadCorrupted="PAYLOAD_CORRUPTED",e.PayloadSignatureVerificationFailed="PAYLOAD_SIGNATURE_VERIFICATION_FAILED",e.IncorrectTokenState="INCORRECT_TOKEN_STATE";})(Mt||(Mt={}));var wt;(function(e){e[e.Ok=0]="Ok",e[e.NetworkError=1]="NetworkError",e[e.RemoteLock=2]="RemoteLock",e[e.PermissionExpired=3]="PermissionExpired",e[e.PayloadCorrupted=4]="PayloadCorrupted",e[e.PayloadSignatureVerificationFailed=5]="PayloadSignatureVerificationFailed",e[e.IncorrectTokenState=6]="IncorrectTokenState";})(wt||(wt={}));var w;(function(e){e[e.Failed=0]="Failed",e[e.Success=1]="Success",e[e.CameraTooFar=2]="CameraTooFar",e[e.CameraTooClose=3]="CameraTooClose",e[e.CameraAngleTooSteep=4]="CameraAngleTooSteep",e[e.DocumentTooCloseToCameraEdge=5]="DocumentTooCloseToCameraEdge",e[e.DocumentPartiallyVisible=6]="DocumentPartiallyVisible",e[e.FallbackSuccess=7]="FallbackSuccess";})(w||(w={}));var pt=class extends Error{constructor(){super("Throttled function aborted"),this.name="AbortError";}};function Ma({limit:e,interval:t,strict:a}){if(!Number.isFinite(e))throw new TypeError("Expected `limit` to be a finite number");if(!Number.isFinite(t))throw new TypeError("Expected `interval` to be a finite number");let r=new Map,s=0,o=0;function c(){let C=Date.now();return C-s>t?(o=1,s=C,0):(o<e?o++:(s+=t,o=1),s-C)}let u=[];function I(){let C=Date.now();if(u.length<e)return u.push(C),0;let f=u.shift()+t;return C>=f?(u.push(C),0):(u.push(f),f-C)}let N=a?I:c;return C=>{let f=function(...P){if(!f.isEnabled)return (async()=>C.apply(this,P))();let j;return new Promise((ce,de)=>{j=setTimeout(()=>{ce(C.apply(this,P)),r.delete(j);},N()),r.set(j,de);})};return f.abort=()=>{for(let P of r.keys())clearTimeout(P),r.get(P)(new pt);r.clear(),u.splice(0,u.length);},f.isEnabled=!0,Object.defineProperty(f,"queueSize",{get(){return r.size}}),f}}var wa=15;Ma({limit:1,interval:Math.round(1/wa*1e3),strict:!0});var Pt;(function(e){e[e.Recognition=0]="Recognition",e[e.RecognitionTest=1]="RecognitionTest",e[e.DetectionTest=2]="DetectionTest";})(Pt||(Pt={}));var xe=class{constructor(t){if(this.allowHelloMessage=!0,this.engineLocation="",this.workerLocation="",this.wasmType=null,this.numberOfWorkers=null,this.loadProgressCallback=null,this.wasmModuleName=_a,!t)throw new R(U.licenseKeyMissing);this.licenseKey=t;}};function yt(){return ("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,e=>(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16))}function Pa(){try{let e=localStorage.getItem("mb-user-id");return e===null&&(e=yt(),localStorage.setItem("mb-user-id",e)),e}catch(e){return yt()}}async function Kt(e){return new Promise((t,a)=>{if(!e||typeof e!="object"){a(new R(U.wasmSettingsMissing));return}if(typeof e.licenseKey!="string"){a(new R(U.licenseKeyMissing));return}if(!e.wasmModuleName){a(new R(U.wasmModuleNameMissing));return}if(typeof e.engineLocation!="string"){a(new R(U.engineLocationInvalid));return}if(typeof e.workerLocation!="string"){a(new R(U.workerLocationInvalid));return}let r=Pa();try{let s=`/resources/${e.wasmModuleName}.worker.min.js`,o=window.location.origin+s,c=e.workerLocation||o;e.allowHelloMessage&&console.log("Worker location is:",c);let u=new Worker(c);dt.createWasmWorker(u,e,r).then(I=>{t(I);},a);}catch(s){a(s);}})}async function Zt(e,t,a=!1,r={}){if(typeof e!="object")throw new R(U.missing);if(typeof t!="object"||t.length<1)throw new R(U.recognizersMissing);return e.mbWasmModule.createRecognizerRunner(t,a,r)}var qt;(function(e){e[e.NONE=0]="NONE",e[e.QR_CODE=1]="QR_CODE",e[e.DATA_MATRIX=2]="DATA_MATRIX",e[e.UPC_E=3]="UPC_E",e[e.UPC_A=4]="UPC_A",e[e.EAN_8=5]="EAN_8",e[e.EAN_13=6]="EAN_13",e[e.CODE_128=7]="CODE_128",e[e.CODE_39=8]="CODE_39",e[e.ITF=9]="ITF",e[e.AZTEC_BARCODE=10]="AZTEC_BARCODE",e[e.PDF417_BARCODE=11]="PDF417_BARCODE";})(qt||(qt={}));var B;(function(e){e[e.None=0]="None",e[e.ImageOnly=1]="ImageOnly",e[e.ResultFieldsOnly=2]="ResultFieldsOnly",e[e.FullResult=3]="FullResult";})(B||(B={}));var Fe=class{constructor(){this.enableMrzId=!0,this.enableMrzPassport=!0,this.enableMrzVisa=!0,this.enablePhotoId=!0,this.enableBarcodeId=!0,this.enableFullDocumentRecognition=!0;}},Ut;(function(e){e[e.Strict=0]="Strict",e[e.Normal=1]="Normal",e[e.Relaxed=2]="Relaxed";})(Ut||(Ut={}));var kt;(function(e){e[e.Latin=0]="Latin",e[e.Arabic=1]="Arabic",e[e.Cyrillic=2]="Cyrillic",e[e.Greek=3]="Greek",e[e.Count=4]="Count";})(kt||(kt={}));var xt;(function(e){e[e.DocumentType=0]="DocumentType",e[e.StandardVersionNumber=1]="StandardVersionNumber",e[e.CustomerFamilyName=2]="CustomerFamilyName",e[e.CustomerFirstName=3]="CustomerFirstName",e[e.CustomerFullName=4]="CustomerFullName",e[e.DateOfBirth=5]="DateOfBirth",e[e.Sex=6]="Sex",e[e.EyeColor=7]="EyeColor",e[e.AddressStreet=8]="AddressStreet",e[e.AddressCity=9]="AddressCity",e[e.AddressJurisdictionCode=10]="AddressJurisdictionCode",e[e.AddressPostalCode=11]="AddressPostalCode",e[e.FullAddress=12]="FullAddress",e[e.Height=13]="Height",e[e.HeightIn=14]="HeightIn",e[e.HeightCm=15]="HeightCm",e[e.CustomerMiddleName=16]="CustomerMiddleName",e[e.HairColor=17]="HairColor",e[e.NameSuffix=18]="NameSuffix",e[e.AKAFullName=19]="AKAFullName",e[e.AKAFamilyName=20]="AKAFamilyName",e[e.AKAGivenName=21]="AKAGivenName",e[e.AKASuffixName=22]="AKASuffixName",e[e.WeightRange=23]="WeightRange",e[e.WeightPounds=24]="WeightPounds",e[e.WeightKilograms=25]="WeightKilograms",e[e.CustomerIdNumber=26]="CustomerIdNumber",e[e.FamilyNameTruncation=27]="FamilyNameTruncation",e[e.FirstNameTruncation=28]="FirstNameTruncation",e[e.MiddleNameTruncation=29]="MiddleNameTruncation",e[e.PlaceOfBirth=30]="PlaceOfBirth",e[e.AddressStreet2=31]="AddressStreet2",e[e.RaceEthnicity=32]="RaceEthnicity",e[e.NamePrefix=33]="NamePrefix",e[e.CountryIdentification=34]="CountryIdentification",e[e.ResidenceStreetAddress=35]="ResidenceStreetAddress",e[e.ResidenceStreetAddress2=36]="ResidenceStreetAddress2",e[e.ResidenceCity=37]="ResidenceCity",e[e.ResidenceJurisdictionCode=38]="ResidenceJurisdictionCode",e[e.ResidencePostalCode=39]="ResidencePostalCode",e[e.ResidenceFullAddress=40]="ResidenceFullAddress",e[e.Under18=41]="Under18",e[e.Under19=42]="Under19",e[e.Under21=43]="Under21",e[e.SocialSecurityNumber=44]="SocialSecurityNumber",e[e.AKASocialSecurityNumber=45]="AKASocialSecurityNumber",e[e.AKAMiddleName=46]="AKAMiddleName",e[e.AKAPrefixName=47]="AKAPrefixName",e[e.OrganDonor=48]="OrganDonor",e[e.Veteran=49]="Veteran",e[e.AKADateOfBirth=50]="AKADateOfBirth",e[e.IssuerIdentificationNumber=51]="IssuerIdentificationNumber",e[e.DocumentExpirationDate=52]="DocumentExpirationDate",e[e.JurisdictionVersionNumber=53]="JurisdictionVersionNumber",e[e.JurisdictionVehicleClass=54]="JurisdictionVehicleClass",e[e.JurisdictionRestrictionCodes=55]="JurisdictionRestrictionCodes",e[e.JurisdictionEndorsementCodes=56]="JurisdictionEndorsementCodes",e[e.DocumentIssueDate=57]="DocumentIssueDate",e[e.FederalCommercialVehicleCodes=58]="FederalCommercialVehicleCodes",e[e.IssuingJurisdiction=59]="IssuingJurisdiction",e[e.StandardVehicleClassification=60]="StandardVehicleClassification",e[e.IssuingJurisdictionName=61]="IssuingJurisdictionName",e[e.StandardEndorsementCode=62]="StandardEndorsementCode",e[e.StandardRestrictionCode=63]="StandardRestrictionCode",e[e.JurisdictionVehicleClassificationDescription=64]="JurisdictionVehicleClassificationDescription",e[e.JurisdictionEndorsmentCodeDescription=65]="JurisdictionEndorsmentCodeDescription",e[e.JurisdictionRestrictionCodeDescription=66]="JurisdictionRestrictionCodeDescription",e[e.InventoryControlNumber=67]="InventoryControlNumber",e[e.CardRevisionDate=68]="CardRevisionDate",e[e.DocumentDiscriminator=69]="DocumentDiscriminator",e[e.LimitedDurationDocument=70]="LimitedDurationDocument",e[e.AuditInformation=71]="AuditInformation",e[e.ComplianceType=72]="ComplianceType",e[e.IssueTimestamp=73]="IssueTimestamp",e[e.PermitExpirationDate=74]="PermitExpirationDate",e[e.PermitIdentifier=75]="PermitIdentifier",e[e.PermitIssueDate=76]="PermitIssueDate",e[e.NumberOfDuplicates=77]="NumberOfDuplicates",e[e.HAZMATExpirationDate=78]="HAZMATExpirationDate",e[e.MedicalIndicator=79]="MedicalIndicator",e[e.NonResident=80]="NonResident",e[e.UniqueCustomerId=81]="UniqueCustomerId",e[e.DataDiscriminator=82]="DataDiscriminator",e[e.DocumentExpirationMonth=83]="DocumentExpirationMonth",e[e.DocumentNonexpiring=84]="DocumentNonexpiring",e[e.SecurityVersion=85]="SecurityVersion",e[e.Count=86]="Count";})(xt||(xt={}));var S;(function(e){e[e.NONE=0]="NONE",e[e.ALBANIA=1]="ALBANIA",e[e.ALGERIA=2]="ALGERIA",e[e.ARGENTINA=3]="ARGENTINA",e[e.AUSTRALIA=4]="AUSTRALIA",e[e.AUSTRIA=5]="AUSTRIA",e[e.AZERBAIJAN=6]="AZERBAIJAN",e[e.BAHRAIN=7]="BAHRAIN",e[e.BANGLADESH=8]="BANGLADESH",e[e.BELGIUM=9]="BELGIUM",e[e.BOSNIA_AND_HERZEGOVINA=10]="BOSNIA_AND_HERZEGOVINA",e[e.BRUNEI=11]="BRUNEI",e[e.BULGARIA=12]="BULGARIA",e[e.CAMBODIA=13]="CAMBODIA",e[e.CANADA=14]="CANADA",e[e.CHILE=15]="CHILE",e[e.COLOMBIA=16]="COLOMBIA",e[e.COSTA_RICA=17]="COSTA_RICA",e[e.CROATIA=18]="CROATIA",e[e.CYPRUS=19]="CYPRUS",e[e.CZECHIA=20]="CZECHIA",e[e.DENMARK=21]="DENMARK",e[e.DOMINICAN_REPUBLIC=22]="DOMINICAN_REPUBLIC",e[e.EGYPT=23]="EGYPT",e[e.ESTONIA=24]="ESTONIA",e[e.FINLAND=25]="FINLAND",e[e.FRANCE=26]="FRANCE",e[e.GEORGIA=27]="GEORGIA",e[e.GERMANY=28]="GERMANY",e[e.GHANA=29]="GHANA",e[e.GREECE=30]="GREECE",e[e.GUATEMALA=31]="GUATEMALA",e[e.HONG_KONG=32]="HONG_KONG",e[e.HUNGARY=33]="HUNGARY",e[e.INDIA=34]="INDIA",e[e.INDONESIA=35]="INDONESIA",e[e.IRELAND=36]="IRELAND",e[e.ISRAEL=37]="ISRAEL",e[e.ITALY=38]="ITALY",e[e.JORDAN=39]="JORDAN",e[e.KAZAKHSTAN=40]="KAZAKHSTAN",e[e.KENYA=41]="KENYA",e[e.KOSOVO=42]="KOSOVO",e[e.KUWAIT=43]="KUWAIT",e[e.LATVIA=44]="LATVIA",e[e.LITHUANIA=45]="LITHUANIA",e[e.MALAYSIA=46]="MALAYSIA",e[e.MALDIVES=47]="MALDIVES",e[e.MALTA=48]="MALTA",e[e.MAURITIUS=49]="MAURITIUS",e[e.MEXICO=50]="MEXICO",e[e.MOROCCO=51]="MOROCCO",e[e.NETHERLANDS=52]="NETHERLANDS",e[e.NEW_ZEALAND=53]="NEW_ZEALAND",e[e.NIGERIA=54]="NIGERIA",e[e.PAKISTAN=55]="PAKISTAN",e[e.PANAMA=56]="PANAMA",e[e.PARAGUAY=57]="PARAGUAY",e[e.PHILIPPINES=58]="PHILIPPINES",e[e.POLAND=59]="POLAND",e[e.PORTUGAL=60]="PORTUGAL",e[e.PUERTO_RICO=61]="PUERTO_RICO",e[e.QATAR=62]="QATAR",e[e.ROMANIA=63]="ROMANIA",e[e.RUSSIA=64]="RUSSIA",e[e.SAUDI_ARABIA=65]="SAUDI_ARABIA",e[e.SERBIA=66]="SERBIA",e[e.SINGAPORE=67]="SINGAPORE",e[e.SLOVAKIA=68]="SLOVAKIA",e[e.SLOVENIA=69]="SLOVENIA",e[e.SOUTH_AFRICA=70]="SOUTH_AFRICA",e[e.SPAIN=71]="SPAIN",e[e.SWEDEN=72]="SWEDEN",e[e.SWITZERLAND=73]="SWITZERLAND",e[e.TAIWAN=74]="TAIWAN",e[e.THAILAND=75]="THAILAND",e[e.TUNISIA=76]="TUNISIA",e[e.TURKEY=77]="TURKEY",e[e.UAE=78]="UAE",e[e.UGANDA=79]="UGANDA",e[e.UK=80]="UK",e[e.UKRAINE=81]="UKRAINE",e[e.USA=82]="USA",e[e.VIETNAM=83]="VIETNAM",e[e.BRAZIL=84]="BRAZIL",e[e.NORWAY=85]="NORWAY",e[e.OMAN=86]="OMAN",e[e.ECUADOR=87]="ECUADOR",e[e.EL_SALVADOR=88]="EL_SALVADOR",e[e.SRI_LANKA=89]="SRI_LANKA",e[e.PERU=90]="PERU",e[e.URUGUAY=91]="URUGUAY",e[e.BAHAMAS=92]="BAHAMAS",e[e.BERMUDA=93]="BERMUDA",e[e.BOLIVIA=94]="BOLIVIA",e[e.CHINA=95]="CHINA",e[e.EUROPEAN_UNION=96]="EUROPEAN_UNION",e[e.HAITI=97]="HAITI",e[e.HONDURAS=98]="HONDURAS",e[e.ICELAND=99]="ICELAND",e[e.JAPAN=100]="JAPAN",e[e.LUXEMBOURG=101]="LUXEMBOURG",e[e.MONTENEGRO=102]="MONTENEGRO",e[e.NICARAGUA=103]="NICARAGUA",e[e.SOUTH_KOREA=104]="SOUTH_KOREA",e[e.VENEZUELA=105]="VENEZUELA",e[e.AFGHANISTAN=106]="AFGHANISTAN",e[e.ALAND_ISLANDS=107]="ALAND_ISLANDS",e[e.AMERICAN_SAMOA=108]="AMERICAN_SAMOA",e[e.ANDORRA=109]="ANDORRA",e[e.ANGOLA=110]="ANGOLA",e[e.ANGUILLA=111]="ANGUILLA",e[e.ANTARCTICA=112]="ANTARCTICA",e[e.ANTIGUA_AND_BARBUDA=113]="ANTIGUA_AND_BARBUDA",e[e.ARMENIA=114]="ARMENIA",e[e.ARUBA=115]="ARUBA",e[e.BAILIWICK_OF_GUERNSEY=116]="BAILIWICK_OF_GUERNSEY",e[e.BAILIWICK_OF_JERSEY=117]="BAILIWICK_OF_JERSEY",e[e.BARBADOS=118]="BARBADOS",e[e.BELARUS=119]="BELARUS",e[e.BELIZE=120]="BELIZE",e[e.BENIN=121]="BENIN",e[e.BHUTAN=122]="BHUTAN",e[e.BONAIRE_SAINT_EUSTATIUS_AND_SABA=123]="BONAIRE_SAINT_EUSTATIUS_AND_SABA",e[e.BOTSWANA=124]="BOTSWANA",e[e.BOUVET_ISLAND=125]="BOUVET_ISLAND",e[e.BRITISH_INDIAN_OCEAN_TERRITORY=126]="BRITISH_INDIAN_OCEAN_TERRITORY",e[e.BURKINA_FASO=127]="BURKINA_FASO",e[e.BURUNDI=128]="BURUNDI",e[e.CAMEROON=129]="CAMEROON",e[e.CAPE_VERDE=130]="CAPE_VERDE",e[e.CARIBBEAN_NETHERLANDS=131]="CARIBBEAN_NETHERLANDS",e[e.CAYMAN_ISLANDS=132]="CAYMAN_ISLANDS",e[e.CENTRAL_AFRICAN_REPUBLIC=133]="CENTRAL_AFRICAN_REPUBLIC",e[e.CHAD=134]="CHAD",e[e.CHRISTMAS_ISLAND=135]="CHRISTMAS_ISLAND",e[e.COCOS_ISLANDS=136]="COCOS_ISLANDS",e[e.COMOROS=137]="COMOROS",e[e.CONGO=138]="CONGO",e[e.COOK_ISLANDS=139]="COOK_ISLANDS",e[e.CUBA=140]="CUBA",e[e.CURACAO=141]="CURACAO",e[e.DEMOCRATIC_REPUBLIC_OF_THE_CONGO=142]="DEMOCRATIC_REPUBLIC_OF_THE_CONGO",e[e.DJIBOUTI=143]="DJIBOUTI",e[e.DOMINICA=144]="DOMINICA",e[e.EAST_TIMOR=145]="EAST_TIMOR",e[e.EQUATORIAL_GUINEA=146]="EQUATORIAL_GUINEA",e[e.ERITREA=147]="ERITREA",e[e.ETHIOPIA=148]="ETHIOPIA",e[e.FALKLAND_ISLANDS=149]="FALKLAND_ISLANDS",e[e.FAROE_ISLANDS=150]="FAROE_ISLANDS",e[e.FEDERATED_STATES_OF_MICRONESIA=151]="FEDERATED_STATES_OF_MICRONESIA",e[e.FIJI=152]="FIJI",e[e.FRENCH_GUIANA=153]="FRENCH_GUIANA",e[e.FRENCH_POLYNESIA=154]="FRENCH_POLYNESIA",e[e.FRENCH_SOUTHERN_TERRITORIES=155]="FRENCH_SOUTHERN_TERRITORIES",e[e.GABON=156]="GABON",e[e.GAMBIA=157]="GAMBIA",e[e.GIBRALTAR=158]="GIBRALTAR",e[e.GREENLAND=159]="GREENLAND",e[e.GRENADA=160]="GRENADA",e[e.GUADELOUPE=161]="GUADELOUPE",e[e.GUAM=162]="GUAM",e[e.GUINEA=163]="GUINEA",e[e.GUINEA_BISSAU=164]="GUINEA_BISSAU",e[e.GUYANA=165]="GUYANA",e[e.HEARD_ISLAND_AND_MCDONALD_ISLANDS=166]="HEARD_ISLAND_AND_MCDONALD_ISLANDS",e[e.IRAN=167]="IRAN",e[e.IRAQ=168]="IRAQ",e[e.ISLE_OF_MAN=169]="ISLE_OF_MAN",e[e.IVORY_COAST=170]="IVORY_COAST",e[e.JAMAICA=171]="JAMAICA",e[e.KIRIBATI=172]="KIRIBATI",e[e.KYRGYZSTAN=173]="KYRGYZSTAN",e[e.LAOS=174]="LAOS",e[e.LEBANON=175]="LEBANON",e[e.LESOTHO=176]="LESOTHO",e[e.LIBERIA=177]="LIBERIA",e[e.LIBYA=178]="LIBYA",e[e.LIECHTENSTEIN=179]="LIECHTENSTEIN",e[e.MACAU=180]="MACAU",e[e.MADAGASCAR=181]="MADAGASCAR",e[e.MALAWI=182]="MALAWI",e[e.MALI=183]="MALI",e[e.MARSHALL_ISLANDS=184]="MARSHALL_ISLANDS",e[e.MARTINIQUE=185]="MARTINIQUE",e[e.MAURITANIA=186]="MAURITANIA",e[e.MAYOTTE=187]="MAYOTTE",e[e.MOLDOVA=188]="MOLDOVA",e[e.MONACO=189]="MONACO",e[e.MONGOLIA=190]="MONGOLIA",e[e.MONTSERRAT=191]="MONTSERRAT",e[e.MOZAMBIQUE=192]="MOZAMBIQUE",e[e.MYANMAR=193]="MYANMAR",e[e.NAMIBIA=194]="NAMIBIA",e[e.NAURU=195]="NAURU",e[e.NEPAL=196]="NEPAL",e[e.NEW_CALEDONIA=197]="NEW_CALEDONIA",e[e.NIGER=198]="NIGER",e[e.NIUE=199]="NIUE",e[e.NORFOLK_ISLAND=200]="NORFOLK_ISLAND",e[e.NORTHERN_CYPRUS=201]="NORTHERN_CYPRUS",e[e.NORTHERN_MARIANA_ISLANDS=202]="NORTHERN_MARIANA_ISLANDS",e[e.NORTH_KOREA=203]="NORTH_KOREA",e[e.NORTH_MACEDONIA=204]="NORTH_MACEDONIA",e[e.PALAU=205]="PALAU",e[e.PALESTINE=206]="PALESTINE",e[e.PAPUA_NEW_GUINEA=207]="PAPUA_NEW_GUINEA",e[e.PITCAIRN=208]="PITCAIRN",e[e.REUNION=209]="REUNION",e[e.RWANDA=210]="RWANDA",e[e.SAINT_BARTHELEMY=211]="SAINT_BARTHELEMY",e[e.SAINT_HELENA_ASCENSION_AND_TRISTIAN_DA_CUNHA=212]="SAINT_HELENA_ASCENSION_AND_TRISTIAN_DA_CUNHA",e[e.SAINT_KITTS_AND_NEVIS=213]="SAINT_KITTS_AND_NEVIS",e[e.SAINT_LUCIA=214]="SAINT_LUCIA",e[e.SAINT_MARTIN=215]="SAINT_MARTIN",e[e.SAINT_PIERRE_AND_MIQUELON=216]="SAINT_PIERRE_AND_MIQUELON",e[e.SAINT_VINCENT_AND_THE_GRENADINES=217]="SAINT_VINCENT_AND_THE_GRENADINES",e[e.SAMOA=218]="SAMOA",e[e.SAN_MARINO=219]="SAN_MARINO",e[e.SAO_TOME_AND_PRINCIPE=220]="SAO_TOME_AND_PRINCIPE",e[e.SENEGAL=221]="SENEGAL",e[e.SEYCHELLES=222]="SEYCHELLES",e[e.SIERRA_LEONE=223]="SIERRA_LEONE",e[e.SINT_MAARTEN=224]="SINT_MAARTEN",e[e.SOLOMON_ISLANDS=225]="SOLOMON_ISLANDS",e[e.SOMALIA=226]="SOMALIA",e[e.SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS=227]="SOUTH_GEORGIA_AND_THE_SOUTH_SANDWICH_ISLANDS",e[e.SOUTH_SUDAN=228]="SOUTH_SUDAN",e[e.SUDAN=229]="SUDAN",e[e.SURINAME=230]="SURINAME",e[e.SVALBARD_AND_JAN_MAYEN=231]="SVALBARD_AND_JAN_MAYEN",e[e.ESWATINI=232]="ESWATINI",e[e.SYRIA=233]="SYRIA",e[e.TAJIKISTAN=234]="TAJIKISTAN",e[e.TANZANIA=235]="TANZANIA",e[e.TOGO=236]="TOGO",e[e.TOKELAU=237]="TOKELAU",e[e.TONGA=238]="TONGA",e[e.TRINIDAD_AND_TOBAGO=239]="TRINIDAD_AND_TOBAGO",e[e.TURKMENISTAN=240]="TURKMENISTAN",e[e.TURKS_AND_CAICOS_ISLANDS=241]="TURKS_AND_CAICOS_ISLANDS",e[e.TUVALU=242]="TUVALU",e[e.UNITED_STATES_MINOR_OUTLYING_ISLANDS=243]="UNITED_STATES_MINOR_OUTLYING_ISLANDS",e[e.UZBEKISTAN=244]="UZBEKISTAN",e[e.VANUATU=245]="VANUATU",e[e.VATICAN_CITY=246]="VATICAN_CITY",e[e.VIRGIN_ISLANDS_BRITISH=247]="VIRGIN_ISLANDS_BRITISH",e[e.VIRGIN_ISLANDS_US=248]="VIRGIN_ISLANDS_US",e[e.WALLIS_AND_FUTUNA=249]="WALLIS_AND_FUTUNA",e[e.WESTERN_SAHARA=250]="WESTERN_SAHARA",e[e.YEMEN=251]="YEMEN",e[e.YUGOSLAVIA=252]="YUGOSLAVIA",e[e.ZAMBIA=253]="ZAMBIA",e[e.ZIMBABWE=254]="ZIMBABWE",e[e.SCHENGEN_AREA=255]="SCHENGEN_AREA",e[e.COUNT=256]="COUNT";})(S||(S={}));var n;(function(e){e[e.NONE=0]="NONE",e[e.ALABAMA=1]="ALABAMA",e[e.ALASKA=2]="ALASKA",e[e.ALBERTA=3]="ALBERTA",e[e.ARIZONA=4]="ARIZONA",e[e.ARKANSAS=5]="ARKANSAS",e[e.AUSTRALIAN_CAPITAL_TERRITORY=6]="AUSTRALIAN_CAPITAL_TERRITORY",e[e.BRITISH_COLUMBIA=7]="BRITISH_COLUMBIA",e[e.CALIFORNIA=8]="CALIFORNIA",e[e.COLORADO=9]="COLORADO",e[e.CONNECTICUT=10]="CONNECTICUT",e[e.DELAWARE=11]="DELAWARE",e[e.DISTRICT_OF_COLUMBIA=12]="DISTRICT_OF_COLUMBIA",e[e.FLORIDA=13]="FLORIDA",e[e.GEORGIA=14]="GEORGIA",e[e.HAWAII=15]="HAWAII",e[e.IDAHO=16]="IDAHO",e[e.ILLINOIS=17]="ILLINOIS",e[e.INDIANA=18]="INDIANA",e[e.IOWA=19]="IOWA",e[e.KANSAS=20]="KANSAS",e[e.KENTUCKY=21]="KENTUCKY",e[e.LOUISIANA=22]="LOUISIANA",e[e.MAINE=23]="MAINE",e[e.MANITOBA=24]="MANITOBA",e[e.MARYLAND=25]="MARYLAND",e[e.MASSACHUSETTS=26]="MASSACHUSETTS",e[e.MICHIGAN=27]="MICHIGAN",e[e.MINNESOTA=28]="MINNESOTA",e[e.MISSISSIPPI=29]="MISSISSIPPI",e[e.MISSOURI=30]="MISSOURI",e[e.MONTANA=31]="MONTANA",e[e.NEBRASKA=32]="NEBRASKA",e[e.NEVADA=33]="NEVADA",e[e.NEW_BRUNSWICK=34]="NEW_BRUNSWICK",e[e.NEW_HAMPSHIRE=35]="NEW_HAMPSHIRE",e[e.NEW_JERSEY=36]="NEW_JERSEY",e[e.NEW_MEXICO=37]="NEW_MEXICO",e[e.NEW_SOUTH_WALES=38]="NEW_SOUTH_WALES",e[e.NEW_YORK=39]="NEW_YORK",e[e.NORTHERN_TERRITORY=40]="NORTHERN_TERRITORY",e[e.NORTH_CAROLINA=41]="NORTH_CAROLINA",e[e.NORTH_DAKOTA=42]="NORTH_DAKOTA",e[e.NOVA_SCOTIA=43]="NOVA_SCOTIA",e[e.OHIO=44]="OHIO",e[e.OKLAHOMA=45]="OKLAHOMA",e[e.ONTARIO=46]="ONTARIO",e[e.OREGON=47]="OREGON",e[e.PENNSYLVANIA=48]="PENNSYLVANIA",e[e.QUEBEC=49]="QUEBEC",e[e.QUEENSLAND=50]="QUEENSLAND",e[e.RHODE_ISLAND=51]="RHODE_ISLAND",e[e.SASKATCHEWAN=52]="SASKATCHEWAN",e[e.SOUTH_AUSTRALIA=53]="SOUTH_AUSTRALIA",e[e.SOUTH_CAROLINA=54]="SOUTH_CAROLINA",e[e.SOUTH_DAKOTA=55]="SOUTH_DAKOTA",e[e.TASMANIA=56]="TASMANIA",e[e.TENNESSEE=57]="TENNESSEE",e[e.TEXAS=58]="TEXAS",e[e.UTAH=59]="UTAH",e[e.VERMONT=60]="VERMONT",e[e.VICTORIA=61]="VICTORIA",e[e.VIRGINIA=62]="VIRGINIA",e[e.WASHINGTON=63]="WASHINGTON",e[e.WESTERN_AUSTRALIA=64]="WESTERN_AUSTRALIA",e[e.WEST_VIRGINIA=65]="WEST_VIRGINIA",e[e.WISCONSIN=66]="WISCONSIN",e[e.WYOMING=67]="WYOMING",e[e.YUKON=68]="YUKON",e[e.CIUDAD_DE_MEXICO=69]="CIUDAD_DE_MEXICO",e[e.JALISCO=70]="JALISCO",e[e.NEWFOUNDLAND_AND_LABRADOR=71]="NEWFOUNDLAND_AND_LABRADOR",e[e.NUEVO_LEON=72]="NUEVO_LEON",e[e.BAJA_CALIFORNIA=73]="BAJA_CALIFORNIA",e[e.CHIHUAHUA=74]="CHIHUAHUA",e[e.GUANAJUATO=75]="GUANAJUATO",e[e.GUERRERO=76]="GUERRERO",e[e.MEXICO=77]="MEXICO",e[e.MICHOACAN=78]="MICHOACAN",e[e.NEW_YORK_CITY=79]="NEW_YORK_CITY",e[e.TAMAULIPAS=80]="TAMAULIPAS",e[e.VERACRUZ=81]="VERACRUZ",e[e.CHIAPAS=82]="CHIAPAS",e[e.COAHUILA=83]="COAHUILA",e[e.DURANGO=84]="DURANGO",e[e.GUERRERO_COCULA=85]="GUERRERO_COCULA",e[e.GUERRERO_JUCHITAN=86]="GUERRERO_JUCHITAN",e[e.GUERRERO_TEPECOACUILCO=87]="GUERRERO_TEPECOACUILCO",e[e.GUERRERO_TLACOAPA=88]="GUERRERO_TLACOAPA",e[e.GUJARAT=89]="GUJARAT",e[e.HIDALGO=90]="HIDALGO",e[e.KARNATAKA=91]="KARNATAKA",e[e.KERALA=92]="KERALA",e[e.KHYBER_PAKHTUNKHWA=93]="KHYBER_PAKHTUNKHWA",e[e.MADHYA_PRADESH=94]="MADHYA_PRADESH",e[e.MAHARASHTRA=95]="MAHARASHTRA",e[e.MORELOS=96]="MORELOS",e[e.NAYARIT=97]="NAYARIT",e[e.OAXACA=98]="OAXACA",e[e.PUEBLA=99]="PUEBLA",e[e.PUNJAB=100]="PUNJAB",e[e.QUERETARO=101]="QUERETARO",e[e.SAN_LUIS_POTOSI=102]="SAN_LUIS_POTOSI",e[e.SINALOA=103]="SINALOA",e[e.SONORA=104]="SONORA",e[e.TABASCO=105]="TABASCO",e[e.TAMIL_NADU=106]="TAMIL_NADU",e[e.YUCATAN=107]="YUCATAN",e[e.ZACATECAS=108]="ZACATECAS",e[e.AGUASCALIENTES=109]="AGUASCALIENTES",e[e.BAJA_CALIFORNIA_SUR=110]="BAJA_CALIFORNIA_SUR",e[e.CAMPECHE=111]="CAMPECHE",e[e.COLIMA=112]="COLIMA",e[e.QUINTANA_ROO_BENITO_JUAREZ=113]="QUINTANA_ROO_BENITO_JUAREZ",e[e.UINTANA_ROO=114]="UINTANA_ROO",e[e.QUINTANA_ROO_SOLIDARIDAD=115]="QUINTANA_ROO_SOLIDARIDAD",e[e.TLAXCALA=116]="TLAXCALA",e[e.QUINTANA_ROO_COZUMEL=117]="QUINTANA_ROO_COZUMEL",e[e.SAO_PAOLO=118]="SAO_PAOLO",e[e.RIO_DE_JANEIRO=119]="RIO_DE_JANEIRO",e[e.RIO_GRANDE_DO_SUL=120]="RIO_GRANDE_DO_SUL",e[e.NORTHWEST_TERRITORIES=121]="NORTHWEST_TERRITORIES",e[e.NUNAVUT=122]="NUNAVUT",e[e.PRINCE_EDWARD_ISLAND=123]="PRINCE_EDWARD_ISLAND",e[e.DISTRITO_FEDERAL=124]="DISTRITO_FEDERAL",e[e.MARANHAO=125]="MARANHAO",e[e.MATO_GROSSO=126]="MATO_GROSSO",e[e.MINAS_GERAIS=127]="MINAS_GERAIS",e[e.PARA=128]="PARA",e[e.PARANA=129]="PARANA",e[e.PERNAMBUCO=130]="PERNAMBUCO",e[e.SANTA_CATARINA=131]="SANTA_CATARINA",e[e.ANDHRA_PRADESH=132]="ANDHRA_PRADESH",e[e.CEARA=133]="CEARA",e[e.GOIAS=134]="GOIAS",e[e.GUERRERO_ACAPULCO_DE_JUAREZ=135]="GUERRERO_ACAPULCO_DE_JUAREZ",e[e.HARYANA=136]="HARYANA",e[e.SERGIPE=137]="SERGIPE",e[e.ALAGOAS=138]="ALAGOAS",e[e.BANGSAMORO=139]="BANGSAMORO",e[e.COUNT=140]="COUNT";})(n||(n={}));var l;(function(e){e[e.NONE=0]="NONE",e[e.CONSULAR_ID=1]="CONSULAR_ID",e[e.DL=2]="DL",e[e.DL_PUBLIC_SERVICES_CARD=3]="DL_PUBLIC_SERVICES_CARD",e[e.EMPLOYMENT_PASS=4]="EMPLOYMENT_PASS",e[e.FIN_CARD=5]="FIN_CARD",e[e.ID=6]="ID",e[e.MULTIPURPOSE_ID=7]="MULTIPURPOSE_ID",e[e.MYKAD=8]="MYKAD",e[e.MYKID=9]="MYKID",e[e.MYPR=10]="MYPR",e[e.MYTENTERA=11]="MYTENTERA",e[e.PAN_CARD=12]="PAN_CARD",e[e.PROFESSIONAL_ID=13]="PROFESSIONAL_ID",e[e.PUBLIC_SERVICES_CARD=14]="PUBLIC_SERVICES_CARD",e[e.RESIDENCE_PERMIT=15]="RESIDENCE_PERMIT",e[e.RESIDENT_ID=16]="RESIDENT_ID",e[e.TEMPORARY_RESIDENCE_PERMIT=17]="TEMPORARY_RESIDENCE_PERMIT",e[e.VOTER_ID=18]="VOTER_ID",e[e.WORK_PERMIT=19]="WORK_PERMIT",e[e.IKAD=20]="IKAD",e[e.MILITARY_ID=21]="MILITARY_ID",e[e.MYKAS=22]="MYKAS",e[e.SOCIAL_SECURITY_CARD=23]="SOCIAL_SECURITY_CARD",e[e.HEALTH_INSURANCE_CARD=24]="HEALTH_INSURANCE_CARD",e[e.PASSPORT=25]="PASSPORT",e[e.S_PASS=26]="S_PASS",e[e.ADDRESS_CARD=27]="ADDRESS_CARD",e[e.ALIEN_ID=28]="ALIEN_ID",e[e.ALIEN_PASSPORT=29]="ALIEN_PASSPORT",e[e.GREEN_CARD=30]="GREEN_CARD",e[e.MINORS_ID=31]="MINORS_ID",e[e.POSTAL_ID=32]="POSTAL_ID",e[e.PROFESSIONAL_DL=33]="PROFESSIONAL_DL",e[e.TAX_ID=34]="TAX_ID",e[e.WEAPON_PERMIT=35]="WEAPON_PERMIT",e[e.VISA=36]="VISA",e[e.BORDER_CROSSING_CARD=37]="BORDER_CROSSING_CARD",e[e.DRIVER_CARD=38]="DRIVER_CARD",e[e.GLOBAL_ENTRY_CARD=39]="GLOBAL_ENTRY_CARD",e[e.MYPOLIS=40]="MYPOLIS",e[e.NEXUS_CARD=41]="NEXUS_CARD",e[e.PASSPORT_CARD=42]="PASSPORT_CARD",e[e.PROOF_OF_AGE_CARD=43]="PROOF_OF_AGE_CARD",e[e.REFUGEE_ID=44]="REFUGEE_ID",e[e.TRIBAL_ID=45]="TRIBAL_ID",e[e.VETERAN_ID=46]="VETERAN_ID",e[e.CITIZENSHIP_CERTIFICATE=47]="CITIZENSHIP_CERTIFICATE",e[e.MY_NUMBER_CARD=48]="MY_NUMBER_CARD",e[e.CONSULAR_PASSPORT=49]="CONSULAR_PASSPORT",e[e.MINORS_PASSPORT=50]="MINORS_PASSPORT",e[e.MINORS_PUBLIC_SERVICES_CARD=51]="MINORS_PUBLIC_SERVICES_CARD",e[e.DRIVING_PRIVILEGE_CARD=52]="DRIVING_PRIVILEGE_CARD",e[e.ASYLUM_REQUEST=53]="ASYLUM_REQUEST",e[e.DRIVER_QUALIFICATION_CARD=54]="DRIVER_QUALIFICATION_CARD",e[e.PROVISIONAL_DL=55]="PROVISIONAL_DL",e[e.REFUGEE_PASSPORT=56]="REFUGEE_PASSPORT",e[e.SPECIAL_ID=57]="SPECIAL_ID",e[e.UNIFORMED_SERVICES_ID=58]="UNIFORMED_SERVICES_ID",e[e.IMMIGRANT_VISA=59]="IMMIGRANT_VISA",e[e.CONSULAR_VOTER_ID=60]="CONSULAR_VOTER_ID",e[e.TWIC_CARD=61]="TWIC_CARD",e[e.EXIT_ENTRY_PERMIT=62]="EXIT_ENTRY_PERMIT",e[e.MAINLAND_TRAVEL_PERMIT_TAIWAN=63]="MAINLAND_TRAVEL_PERMIT_TAIWAN",e[e.NBI_CLEARANCE=64]="NBI_CLEARANCE",e[e.PROOF_OF_REGISTRATION=65]="PROOF_OF_REGISTRATION",e[e.TEMPORARY_PROTECTION_PERMIT=66]="TEMPORARY_PROTECTION_PERMIT",e[e.AFGHAN_CITIZEN_CARD=67]="AFGHAN_CITIZEN_CARD",e[e.EID=68]="EID",e[e.PASS=69]="PASS",e[e.SIS_ID=70]="SIS_ID",e[e.ASIC_CARD=71]="ASIC_CARD",e[e.BIDOON_CARD=72]="BIDOON_CARD",e[e.INTERIM_HEALTH_INSURANCE_CARD=73]="INTERIM_HEALTH_INSURANCE_CARD",e[e.NON_VOTER_ID=74]="NON_VOTER_ID",e[e.RECIPROCAL_HEALTH_INSURANCE_CARD=75]="RECIPROCAL_HEALTH_INSURANCE_CARD",e[e.VEHICLE_REGISTRATION=76]="VEHICLE_REGISTRATION",e[e.ESAAD_CARD=77]="ESAAD_CARD",e[e.COUNT=78]="COUNT";})(l||(l={}));var Ft;(function(e){e[e.AdditionalAddressInformation=0]="AdditionalAddressInformation",e[e.AdditionalNameInformation=1]="AdditionalNameInformation",e[e.AdditionalOptionalAddressInformation=2]="AdditionalOptionalAddressInformation",e[e.AdditionalPersonalIdNumber=3]="AdditionalPersonalIdNumber",e[e.Address=4]="Address",e[e.ClassEffectiveDate=5]="ClassEffectiveDate",e[e.ClassExpiryDate=6]="ClassExpiryDate",e[e.Conditions=7]="Conditions",e[e.DateOfBirth=8]="DateOfBirth",e[e.DateOfExpiry=9]="DateOfExpiry",e[e.DateOfIssue=10]="DateOfIssue",e[e.DocumentAdditionalNumber=11]="DocumentAdditionalNumber",e[e.DocumentOptionalAdditionalNumber=12]="DocumentOptionalAdditionalNumber",e[e.DocumentNumber=13]="DocumentNumber",e[e.Employer=14]="Employer",e[e.Endorsements=15]="Endorsements",e[e.FathersName=16]="FathersName",e[e.FirstName=17]="FirstName",e[e.FullName=18]="FullName",e[e.IssuingAuthority=19]="IssuingAuthority",e[e.LastName=20]="LastName",e[e.LicenceType=21]="LicenceType",e[e.LocalizedName=22]="LocalizedName",e[e.MaritalStatus=23]="MaritalStatus",e[e.MothersName=24]="MothersName",e[e.Mrz=25]="Mrz",e[e.Nationality=26]="Nationality",e[e.PersonalIdNumber=27]="PersonalIdNumber",e[e.PlaceOfBirth=28]="PlaceOfBirth",e[e.Profession=29]="Profession",e[e.Race=30]="Race",e[e.Religion=31]="Religion",e[e.ResidentialStatus=32]="ResidentialStatus",e[e.Restrictions=33]="Restrictions",e[e.Sex=34]="Sex",e[e.VehicleClass=35]="VehicleClass",e[e.BloodType=36]="BloodType",e[e.Sponsor=37]="Sponsor",e[e.VisaType=38]="VisaType",e[e.DocumentSubtype=39]="DocumentSubtype",e[e.Remarks=40]="Remarks",e[e.ResidencePermitType=41]="ResidencePermitType",e[e.ManufacturingYear=42]="ManufacturingYear",e[e.VehicleType=43]="VehicleType",e[e.DependentDateOfBirth=44]="DependentDateOfBirth",e[e.DependentSex=45]="DependentSex",e[e.DependentDocumentNumber=46]="DependentDocumentNumber",e[e.DependentFullName=47]="DependentFullName",e[e.EligibilityCategory=48]="EligibilityCategory",e[e.SpecificDocumentValidity=49]="SpecificDocumentValidity",e[e.VehicleOwner=50]="VehicleOwner",e[e.Count=51]="Count";})(Ft||(Ft={}));var Wt;(function(e){e[e.FullDocument=0]="FullDocument",e[e.Face=1]="Face",e[e.Signature=2]="Signature";})(Wt||(Wt={}));var Bt;(function(e){e[e.NotAvailable=0]="NotAvailable",e[e.BlackAndWhite=1]="BlackAndWhite",e[e.Color=2]="Color";})(Bt||(Bt={}));var ae;(function(e){e[e.NotAvailable=0]="NotAvailable",e[e.NotDetected=1]="NotDetected",e[e.Detected=2]="Detected";})(ae||(ae={}));var Gt;(function(e){e[e.Horizontal=0]="Horizontal",e[e.Vertical=1]="Vertical",e[e.NotAvailable=2]="NotAvailable";})(Gt||(Gt={}));var Vt;(function(e){e[e.None=0]="None",e[e.Clockwise90=1]="Clockwise90",e[e.CounterClockwise90=2]="CounterClockwise90",e[e.UpsideDown=3]="UpsideDown";})(Vt||(Vt={}));var We;(function(e){e[e.Success=0]="Success",e[e.DetectionFailed=1]="DetectionFailed",e[e.ImagePreprocessingFailed=2]="ImagePreprocessingFailed",e[e.StabilityTestFailed=3]="StabilityTestFailed",e[e.ScanningWrongSide=4]="ScanningWrongSide",e[e.FieldIdentificationFailed=5]="FieldIdentificationFailed",e[e.MandatoryFieldMissing=6]="MandatoryFieldMissing",e[e.InvalidCharactersFound=7]="InvalidCharactersFound",e[e.ImageReturnFailed=8]="ImageReturnFailed",e[e.BarcodeRecognitionFailed=9]="BarcodeRecognitionFailed",e[e.MrzParsingFailed=10]="MrzParsingFailed",e[e.ClassFiltered=11]="ClassFiltered",e[e.UnsupportedClass=12]="UnsupportedClass",e[e.UnsupportedByLicense=13]="UnsupportedByLicense",e[e.AwaitingOtherSide=14]="AwaitingOtherSide",e[e.NotScanned=15]="NotScanned",e[e.BarcodeDetectionFailed=16]="BarcodeDetectionFailed",e[e.Count=17]="Count";})(We||(We={}));var jt;(function(e){e[e.None=0]="None",e[e.MrzId=1]="MrzId",e[e.MrzVisa=2]="MrzVisa",e[e.MrzPassport=3]="MrzPassport",e[e.PhotoId=4]="PhotoId",e[e.FullRecognition=5]="FullRecognition",e[e.BarcodeId=6]="BarcodeId",e[e.Count=7]="Count";})(jt||(jt={}));async function Yt(e){return e.mbWasmModule.newRecognizer(atob("QmxpbmtJZFNpbmdsZVNpZGVSZWNvZ25pemVy"))}async function Qt(e){return e.mbWasmModule.newRecognizer(atob("QmxpbmtJZE11bHRpU2lkZVJlY29nbml6ZXI="))}var Ht;(function(e){e[e.None=0]="None",e[e.AAMVACompliant=1]="AAMVACompliant",e[e.ArgentinaID=2]="ArgentinaID",e[e.ArgentinaAlienID=3]="ArgentinaAlienID",e[e.ArgentinaDL=4]="ArgentinaDL",e[e.ColombiaID=5]="ColombiaID",e[e.ColombiaDL=6]="ColombiaDL",e[e.NigeriaVoterID=7]="NigeriaVoterID",e[e.NigeriaDL=8]="NigeriaDL",e[e.PanamaID=9]="PanamaID",e[e.SouthAfricaID=10]="SouthAfricaID";})(Ht||(Ht={}));var Be=class e{get location(){return this._location}static fromJSON(t){let a=new e;return t.location!=null&&(a._location=Quadrilateral.fromJSON(t.location)),a}toJSONObject(){return {location:this.location.toJSONObject()}}};var qa={[n.NONE]:null,[n.COUNT]:null,[n.AUSTRALIAN_CAPITAL_TERRITORY]:"Australian Capital Territory",[n.NEW_SOUTH_WALES]:"New South Wales",[n.NORTHERN_TERRITORY]:"Northern Territory",[n.QUEENSLAND]:"Queensland",[n.SOUTH_AUSTRALIA]:"South Australia",[n.TASMANIA]:"Tasmania",[n.WESTERN_AUSTRALIA]:"Western Australia",[n.VICTORIA]:"Victoria",[n.ALBERTA]:"Alberta",[n.BRITISH_COLUMBIA]:"British Columbia",[n.MANITOBA]:"Manitoba",[n.NEW_BRUNSWICK]:"New Brunswick",[n.NEWFOUNDLAND_AND_LABRADOR]:"Newfoundland and Labrador",[n.NORTHWEST_TERRITORIES]:"Northwest Territories",[n.NOVA_SCOTIA]:"Nova Scotia",[n.NUNAVUT]:"Nunavut",[n.PRINCE_EDWARD_ISLAND]:"Prince Edward Island",[n.QUEBEC]:"Quebec",[n.SASKATCHEWAN]:"Saskatchewan",[n.ANDHRA_PRADESH]:"Andhra Pradesh",[n.GUJARAT]:"Gujarat",[n.HARYANA]:"Haryana",[n.KARNATAKA]:"Karnataka",[n.KERALA]:"Kerala",[n.MADHYA_PRADESH]:"Madhya Pradesh",[n.MAHARASHTRA]:"Maharashtra",[n.PUNJAB]:"Punjab",[n.TAMIL_NADU]:"Tamil Nadu",[n.AGUASCALIENTES]:"Aguascalientes",[n.BAJA_CALIFORNIA]:"Baja California",[n.BAJA_CALIFORNIA_SUR]:"Baja California Sur",[n.CAMPECHE]:"Campeche",[n.CHIAPAS]:"Chiapas",[n.CHIHUAHUA]:"Chihuahua",[n.CIUDAD_DE_MEXICO]:"Mexico City",[n.COAHUILA]:"Coahuila",[n.COLIMA]:"Colima",[n.DURANGO]:"Durango",[n.GUANAJUATO]:"Guanajuato",[n.GUERRERO]:"Guerrero",[n.GUERRERO_ACAPULCO_DE_JUAREZ]:"Acapulco de Ju\xE1rez, Guerrero",[n.GUERRERO_COCULA]:"Cocula, Guerrero",[n.GUERRERO_JUCHITAN]:"Juchit\xE1n, Guerrero",[n.GUERRERO_TEPECOACUILCO]:"Tepecoacuilco de Trujano, Guerrero",[n.GUERRERO_TLACOAPA]:"Tlacoapa, Guerrero",[n.HIDALGO]:"Hidalgo",[n.JALISCO]:"Jalisco",[n.MEXICO]:"M\xE9xico",[n.MICHOACAN]:"Michoac\xE1n",[n.MORELOS]:"Morelos",[n.NAYARIT]:"Nayarit",[n.NUEVO_LEON]:"Nuevo Le\xF3n",[n.OAXACA]:"Oaxaca",[n.PUEBLA]:"Puebla",[n.UINTANA_ROO]:"Quintana Roo",[n.QUINTANA_ROO_BENITO_JUAREZ]:"Benito Ju\xE1rez, Quintana Roo",[n.QUINTANA_ROO_SOLIDARIDAD]:"Solidaridad, Quintana Roo",[n.QUINTANA_ROO_COZUMEL]:"Cozumel, Quintana Roo",[n.QUERETARO]:"Quer\xE9taro",[n.SAN_LUIS_POTOSI]:"San Luis Potos\xED",[n.SINALOA]:"Sinaloa",[n.SONORA]:"Sonora",[n.TABASCO]:"Tabasco",[n.TAMAULIPAS]:"Tamaulipas",[n.TLAXCALA]:"Tlaxcala",[n.VERACRUZ]:"Veracruz",[n.YUCATAN]:"Yucatan",[n.ZACATECAS]:"Zacatecas",[n.KHYBER_PAKHTUNKHWA]:"Khyber Pakhtunkhwa",[n.ALABAMA]:"Alabama",[n.ALASKA]:"Alaska",[n.ARIZONA]:"Arizona",[n.ARKANSAS]:"Arkansas",[n.CALIFORNIA]:"California",[n.COLORADO]:"Colorado",[n.CONNECTICUT]:"Connecticut",[n.DELAWARE]:"Delaware",[n.DISTRICT_OF_COLUMBIA]:"District of Columbia",[n.FLORIDA]:"Florida",[n.GEORGIA]:"Georgia",[n.HAWAII]:"Hawaii",[n.IDAHO]:"Idaho",[n.ILLINOIS]:"Illinois",[n.INDIANA]:"Indiana",[n.IOWA]:"Iowa",[n.KANSAS]:"Kansas",[n.KENTUCKY]:"Kentucky",[n.LOUISIANA]:"Louisiana",[n.MAINE]:"Maine",[n.MARYLAND]:"Maryland",[n.MASSACHUSETTS]:"Massachusetts",[n.MICHIGAN]:"Michigan",[n.MINNESOTA]:"Minnesota",[n.MISSISSIPPI]:"Mississippi",[n.MISSOURI]:"Missouri",[n.MONTANA]:"Montana",[n.NEBRASKA]:"Nebraska",[n.NEVADA]:"Nevada",[n.NEW_HAMPSHIRE]:"New Hampshire",[n.NEW_JERSEY]:"New Jersey",[n.NEW_MEXICO]:"New Mexico",[n.NEW_YORK]:"New York",[n.NEW_YORK_CITY]:"New York City",[n.NORTH_CAROLINA]:"North Carolina",[n.NORTH_DAKOTA]:"North Dakota",[n.OHIO]:"Ohio",[n.OKLAHOMA]:"Oklahoma",[n.ONTARIO]:"Ontario",[n.OREGON]:"Oregon",[n.PENNSYLVANIA]:"Pennsylvania",[n.RHODE_ISLAND]:"Rhode Island",[n.SOUTH_CAROLINA]:"South Carolina",[n.SOUTH_DAKOTA]:"South Dakota",[n.TENNESSEE]:"Tennessee",[n.TEXAS]:"Texas",[n.UTAH]:"Utah",[n.VERMONT]:"Vermont",[n.VIRGINIA]:"Virginia",[n.WASHINGTON]:"Washington",[n.WEST_VIRGINIA]:"West Virginia",[n.WISCONSIN]:"Wisconsin",[n.WYOMING]:"Wyoming",[n.YUKON]:"Yukon",[n.CEARA]:"Cear\xE1",[n.DISTRITO_FEDERAL]:"Federal District",[n.GOIAS]:"Goi\xE1s",[n.MARANHAO]:"Maranh\xE3o",[n.MATO_GROSSO]:"Mato Grosso",[n.MINAS_GERAIS]:"Minas Gerais",[n.PARA]:"Par\xE1",[n.PARANA]:"Paran\xE1",[n.PERNAMBUCO]:"Pernambuco",[n.RIO_DE_JANEIRO]:"Rio de Janeiro",[n.RIO_GRANDE_DO_SUL]:"Rio Grand do Sul",[n.SANTA_CATARINA]:"Santa Catarina",[n.SAO_PAOLO]:"Sao Paolo",[n.SERGIPE]:"Sergipe",[n.ALAGOAS]:"Alagoas",[n.BANGSAMORO]:"Bangsamoro"};function Xt(e){return qa[e]}var Ge=class e{constructor(t){this.workerCall=t;}static create(t){return new e(t)}async createDrivingLicenseDetailsFromBlinkIdData(t,a,r){let s=await this.workerCall("idCaptureDrivingLicenseDetailsCreateWithBlinkIdData",{details:{vehicleClass:t,restrictions:a,endorsements:r}});return z.fromJSON(s.result)}};var $t={ABW:"aruba",AFG:"afghanistan",AGO:"angola",AIA:"anguilla",ALA:"alandIslands",ALB:"albania",AND:"andorra",ARE:"uae",ARG:"argentina",ARM:"armenia",ASM:"americanSamoa",ATA:"antarctica",ATF:"frenchSouthernTerritories",ATG:"antiguaAndBarbuda",AUS:"australia",AUT:"austria",AZE:"azerbaijan",BDI:"burundi",BEL:"belgium",BEN:"benin",BES:"bonaireSintEustatiusAndSaba",BFA:"burkinaFaso",BGD:"bangladesh",BGR:"bulgaria",BHR:"bahrain",BHS:"bahamas",BIH:"bosniaHerzegovina",BLM:"saintBarthelemy",BLR:"belarus",BLZ:"belize",BMU:"bermuda",BOL:"bolivia",BRA:"brazil",BRB:"barbados",BRN:"bruneiDarussalam",BTN:"bhutan",BVT:"bouvetIsland",BWA:"botswana",CAF:"car",CAN:"canada",CCK:"cocosIslands",CHE:"switzerland",CHL:"chile",CHN:"china",CIV:"coteIvoire",CMR:"cameroon",COD:"democraticRepublicOfCongo",COG:"congo",COK:"cookIslands",COL:"colombia",COM:"comoros",CPV:"caboVerde",CRI:"costaRica",CUB:"cuba",CUW:"curacao",CXR:"christmasIsland",CYM:"caymanIslands",CYP:"cyprus",CZE:"czechia",DEU:"germany",DJI:"djibouti",DMA:"dominica",DNK:"denmark",DOM:"dominicanRepublic",DZA:"algeria",ECU:"ecuador",EGY:"egypt",ERI:"eritrea",ESH:"westernSahara",ESP:"spain",EST:"estonia",ETH:"ethiopia",FIN:"finland",FJI:"fiji",FLK:"falklandIslands",FRA:"france",FRO:"faroeIslands",FSM:"micronesia",GAB:"gabon",GBR:"uk",GEO:"georgia",GGY:"guernsey",GHA:"ghana",GIB:"gibraltar",GIN:"guinea",GLP:"guadeloupe",GMB:"gambia",GNB:"guineaBissau",GNQ:"equatorialGuinea",GRC:"greece",GRD:"grenada",GRL:"greenland",GTM:"guatemala",GUF:"frenchGuiana",GUM:"guam",GUY:"guyana",HKG:"hongKong",HMD:"heardIslandAndMcDonaldIslands",HND:"honduras",HRV:"croatia",HTI:"haiti",HUN:"hungary",IDN:"indonesia",IMN:"isleOfMan",IND:"india",IOT:"britishIndianOceanTerritory",IRL:"ireland",IRN:"iran",IRQ:"iraq",ISL:"iceland",ISR:"israel",ITA:"italy",JAM:"jamaica",JEY:"jersey",JOR:"jordan",JPN:"japan",KAZ:"kazakhstan",KEN:"kenya",KGZ:"kyrgyzstan",KHM:"cambodia",KIR:"kiribati",KNA:"saintKittsAndNevis",KOR:"southKorea",KWT:"kuwait",LAO:"lao",LBN:"lebanon",LBR:"liberia",LBY:"libya",LCA:"saintLucia",LIE:"liechtenstein",LKA:"sriLanka",LSO:"lesotho",LTU:"lithuania",LUX:"luxembourg",LVA:"latvia",MAC:"macao",MAF:"frenchSaintMartin",MAR:"morocco",MCO:"monaco",MDA:"moldova",MDG:"madagascar",MDV:"maldives",MEX:"mexico",MHL:"marshallIslands",MKD:"northMacedonia",MLI:"mali",MLT:"malta",MMR:"myanmar",MNE:"montenegro",MNG:"mongolia",MNP:"northernMarianaIslands",MOZ:"mozambique",MRT:"mauritania",MSR:"montserrat",MTQ:"martinique",MUS:"mauritius",MWI:"malawi",MYS:"malaysia",MYT:"mayotte",NAM:"namibia",NCL:"newCaledonia",NER:"niger",NFK:"norfolkIsland",NGA:"nigeria",NIC:"nicaragua",NIU:"niue",NLD:"netherlands",NOR:"norway",NPL:"nepal",NRU:"nauru",NZL:"newZealand",OMN:"oman",PAK:"pakistan",PAN:"panama",PCN:"pitcairn",PER:"peru",PHL:"philippines",PLW:"palau",PNG:"papuaNewGuinea",POL:"poland",PRI:"puertoRico",PRK:"northKorea",PRT:"portugal",PRY:"paraguay",PSE:"palestine",PYF:"frenchPolynesia",QAT:"qatar",REU:"reunion",ROU:"romania",RUS:"russia",RWA:"rwanda",SAU:"saudiArabia",SDN:"sudan",SEN:"senegal",SGP:"singapore",SGS:"southGeorgiaAndTheSouthSandwichIslands",SHN:"saintHelena",SJM:"svalbardAndJanMayen",SLB:"solomonIslands",SLE:"sierraLeone",SLV:"elSalvador",SMR:"sanMarino",SOM:"somalia",SPM:"saintPierreAndMiquelon",SRB:"serbia",SSD:"southSudan",STP:"saoTomeAndPrincipe",SUR:"suriname",SVK:"slovakia",SVN:"slovenia",SWE:"sweden",SWZ:"eswatini",SXM:"dutchSintMaarten",SYC:"seychelles",SYR:"syria",TCA:"turksAndCaicosIslands",TCD:"chad",TGO:"togo",THA:"thailand",TJK:"tajikistan",TKL:"tokelau",TKM:"turkmenistan",TLS:"timorLeste",TON:"tonga",TTO:"trinidadAndTobago",TUN:"tunisia",TUR:"turkey",TUV:"tuvalu",TWN:"taiwan",TZA:"tanzania",UGA:"uganda",UKR:"ukraine",UMI:"usMinorOutlyingIslands",URY:"uruguay",USA:"us",UZB:"uzbekistan",VAT:"holySee",VCT:"saintVincentAndTheGrenadines",VEN:"venezuela",VGB:"britishVirginIslands",VIR:"usVirginIslands",VNM:"vietnam",VUT:"vanuatu",WLF:"wallisAndFutuna",WSM:"samoa",XKX:"kosovo",YEM:"yemen",ZAF:"southAfrica",ZMB:"zambia",ZWE:"zimbabwe"};var Ua=(d=>(d.UsBorderCrossingCard="usBorderCrossingCard",d.ChinaExitEntryPermit="chinaExitEntryPermit",d.UsGlobalEntryCard="usGlobalEntryCard",d.ChinaMainlandTravelPermitTaiwan="chinaMainlandTravelPermitTaiwan",d.UsNexusCard="usNexusCard",d.ChinaMainlandTravelPermitHongKongMacau="chinaMainlandTravelPermitHongKongMacau",d.ApecBusinessTravelCard="apecBusinessTravelCard",d.PakistanAfghanCitizenCard="pakistanAfghanCitizenCard",d.SingaporeFinCard="singaporeFinCard",d.UsGreenCard="usGreenCard",d.MalaysiaIkad="malaysiaIkad",d.MalaysiaMykad="malaysiaMykad",d.MalaysiaMypr="malaysiaMypr",d.MexicoConsularVoterId="mexicoConsularVoterId",d.GermanyEid="germanyEid",d.UsCommonAccessCard="usCommonAccessCard",d.PhilippinesMultipurposeId="philippinesMultipurposeId",d.MalaysiaMykas="malaysiaMykas",d.MalaysiaMykid="malaysiaMykid",d.MalaysiaMytentera="malaysiaMytentera",d.MexicoProfessionalId="mexicoProfessionalId",d.MalaysiaRefugeeId="malaysiaRefugeeId",d.CanadaTribalId="canadaTribalId",d.UsUniformedServicesId="usUniformedServicesId",d.UsVeteranId="usVeteranId",d.PhilippinesWorkPermit="philippinesWorkPermit",d.SingaporeWorkPermit="singaporeWorkPermit",d.UsWorkPermit="usWorkPermit",d.PhilippinesSocialSecurityCard="philippinesSocialSecurityCard",d.SwedenSocialSecurityCard="swedenSocialSecurityCard",d.CanadaSocialSecurityCard="canadaSocialSecurityCard",d.UsSocialSecurityCard="usSocialSecurityCard",d.BelgiumMinorsId="belgiumMinorsId",d.ColombiaMinorsId="colombiaMinorsId",d.PeruMinorsId="peruMinorsId",d.BoliviaMinorsId="boliviaMinorsId",d.HungaryAddressCard="hungaryAddressCard",d.UkAsylumRequest="ukAsylumRequest",d.CanadaCitizenshipCertificate="canadaCitizenshipCertificate",d.SingaporeEmploymentPass="singaporeEmploymentPass",d.CanadaMinorsPublicServicesCard="canadaMinorsPublicServicesCard",d.MalaysiaMypolis="malaysiaMypolis",d.PhilippinesNbiClearance="philippinesNbiClearance",d.IndiaPanCard="indiaPanCard",d.PhilippinesPostalId="philippinesPostalId",d.PakistanProofOfRegistration="pakistanProofOfRegistration",d.SingaporeSPass="singaporeSPass",d.SwedenSisId="swedenSisId",d.ColombiaTemporaryProtectionPermit="colombiaTemporaryProtectionPermit",d.UsTwicCard="usTwicCard",d.UsWeaponPermit="usWeaponPermit",d.CanadaWeaponPermit="canadaWeaponPermit",d.IrelandPublicServicesCard="irelandPublicServicesCard",d.CanadaPublicServicesCard="canadaPublicServicesCard",d.PakistanConsularId="pakistanConsularId",d.GuatemalaConsularId="guatemalaConsularId",d.MexicoConsularId="mexicoConsularId",d.PhilippinesTaxId="philippinesTaxId",d.MexicoTaxId="mexicoTaxId",d.ChinaOneWayPermit="chinaOneWayPermit",d.UsMedicalMarijuanaCard="usMedicalMarijuanaCard",d.UsMunicipalId="usMunicipalId",d.AustraliaAsicCard="australiaAsicCard",d.UaeVehicleRegistrationCard="uaeVehicleRegistrationCard",d.UaeEsaadCard="uaeEsaadCard",d))(Ua||{});function ta(e){return e.state===b.StageValid&&e.scanningFirstSideDone||!e.backViz.empty}function xa(e){return ta(e)||e.backProcessingStatus===We.Success?e.state===b.Valid&&e.scanningFirstSideDone?"frontAndBack":"frontOnly":"frontOnly"}function Fa(e){return "backViz"in e&&!e.backViz.empty}function Wa(e){switch(e){case S.PAKISTAN:return ["regionSpecific","pakistanConsularId"];case S.GUATEMALA:return ["regionSpecific","guatemalaConsularId"];case S.MEXICO:return ["regionSpecific","mexicoConsularId"];default:return ["regionSpecific",null]}}function Ba(e){switch(e){case S.IRELAND:return ["regionSpecific","irelandPublicServicesCard"];case S.CANADA:return ["regionSpecific","canadaPublicServicesCard"];default:return ["regionSpecific",null]}}function Ga(e){switch(e){case S.PHILIPPINES:return ["regionSpecific","philippinesWorkPermit"];case S.SINGAPORE:return ["regionSpecific","singaporeWorkPermit"];case S.USA:return ["regionSpecific","usWorkPermit"];default:return ["regionSpecific",null]}}function Va(e){switch(e){case S.PHILIPPINES:return ["regionSpecific","philippinesSocialSecurityCard"];case S.SWEDEN:return ["regionSpecific","swedenSocialSecurityCard"];case S.CANADA:return ["regionSpecific","canadaSocialSecurityCard"];case S.USA:return ["regionSpecific","usSocialSecurityCard"];default:return ["regionSpecific",null]}}function ja(e){switch(e){case S.BELGIUM:return ["regionSpecific","belgiumMinorsId"];case S.COLOMBIA:return ["regionSpecific","colombiaMinorsId"];case S.PERU:return ["regionSpecific","peruMinorsId"];case S.BOLIVIA:return ["regionSpecific","boliviaMinorsId"];default:return ["regionSpecific",null]}}function Ha(e){switch(e){case S.PHILIPPINES:return ["regionSpecific","philippinesTaxId"];case S.MEXICO:return ["regionSpecific","mexicoTaxId"];default:return ["regionSpecific",null]}}function za(e){switch(e){case S.USA:return ["regionSpecific","usWeaponPermit"];case S.CANADA:return ["regionSpecific","canadaWeaponPermit"];default:return ["regionSpecific",null]}}var oe=class e{constructor(t,a,r){this.alreadyReturnedStageValid=!1;this.recognizer=t,this.workerCallProvider=a,this.capturedSides=r;}reset(){this.alreadyReturnedStageValid=!1;}static concatenateReducer(t,a){return t+String.fromCodePoint(a)}static stringFromMultiScriptResult(t){return typeof t.latin=="string"&&t.latin.length>0?t.latin:typeof t.arabic=="string"&&t.arabic.length>0?t.arabic:typeof t.cyrillic=="string"&&t.cyrillic.length>0?t.cyrillic:""}static isCentaurusDateResult(t){return Object.prototype.hasOwnProperty.call(t,"originalString")}static isCentaurusStringResult(t){return !e.isCentaurusDateResult(t)}async processResult(t){var r,s;if(t===b.Uncertain)return {result:null,requiresReset:this.capturedSides==="frontOnly"?"hard":"soft"};let a=this.capturedSides==="frontOnly"?await this.processSingleSideResult(t):await this.processDoubleSideResult(t);return ((r=a.result)==null?void 0:r.vizResult.documentType)==null?{result:null,requiresReset:(s=a.requiresReset)!=null?s:"soft"}:a}centaurusDocumentTypeToIdCaptureDocumentType(t,a){switch(t){case l.NONE:case l.COUNT:return null;case l.ID:case l.VOTER_ID:case l.PASSPORT_CARD:case l.PROOF_OF_REGISTRATION:case l.NON_VOTER_ID:case l.PROOF_OF_AGE_CARD:return ["idCard",null];case l.DL:case l.DL_PUBLIC_SERVICES_CARD:case l.PROFESSIONAL_DL:case l.DRIVER_CARD:case l.DRIVING_PRIVILEGE_CARD:case l.DRIVER_QUALIFICATION_CARD:case l.PROVISIONAL_DL:return ["driverLicense",null];case l.PASSPORT:case l.ALIEN_PASSPORT:case l.CONSULAR_PASSPORT:case l.MINORS_PASSPORT:case l.REFUGEE_PASSPORT:return ["passport",null];case l.RESIDENCE_PERMIT:case l.RESIDENT_ID:case l.TEMPORARY_RESIDENCE_PERMIT:case l.ALIEN_ID:case l.SPECIAL_ID:return ["residencePermit",null];case l.VISA:case l.IMMIGRANT_VISA:return ["visaIcao",null];case l.HEALTH_INSURANCE_CARD:case l.INTERIM_HEALTH_INSURANCE_CARD:case l.RECIPROCAL_HEALTH_INSURANCE_CARD:return ["healthInsuranceCard",null];case l.CONSULAR_ID:return Wa(a);case l.EMPLOYMENT_PASS:return ["regionSpecific","singaporeEmploymentPass"];case l.FIN_CARD:return ["regionSpecific","singaporeFinCard"];case l.MULTIPURPOSE_ID:return ["regionSpecific","philippinesMultipurposeId"];case l.MYKAD:return ["regionSpecific","malaysiaMykad"];case l.MYKID:return ["regionSpecific","malaysiaMykid"];case l.MYPR:return ["regionSpecific","malaysiaMypr"];case l.MYTENTERA:return ["regionSpecific","malaysiaMytentera"];case l.PAN_CARD:return ["regionSpecific","indiaPanCard"];case l.PROFESSIONAL_ID:return ["regionSpecific","mexicoProfessionalId"];case l.PUBLIC_SERVICES_CARD:return Ba(a);case l.WORK_PERMIT:return Ga(a);case l.IKAD:return ["regionSpecific","malaysiaIkad"];case l.MILITARY_ID:return ["regionSpecific","usCommonAccessCard"];case l.MYKAS:return ["regionSpecific","malaysiaMykas"];case l.SOCIAL_SECURITY_CARD:return Va(a);case l.S_PASS:return ["regionSpecific","singaporeSPass"];case l.ADDRESS_CARD:return ["regionSpecific","hungaryAddressCard"];case l.GREEN_CARD:return ["regionSpecific","usGreenCard"];case l.MINORS_ID:return ja(a);case l.POSTAL_ID:return ["regionSpecific","philippinesPostalId"];case l.TAX_ID:return Ha(a);case l.WEAPON_PERMIT:return za(a);case l.BORDER_CROSSING_CARD:return ["regionSpecific","usBorderCrossingCard"];case l.GLOBAL_ENTRY_CARD:return ["regionSpecific","usGlobalEntryCard"];case l.MYPOLIS:return ["regionSpecific","malaysiaMypolis"];case l.NEXUS_CARD:return ["regionSpecific","usNexusCard"];case l.REFUGEE_ID:return ["regionSpecific","malaysiaRefugeeId"];case l.TRIBAL_ID:return ["regionSpecific","canadaTribalId"];case l.VETERAN_ID:return ["regionSpecific","usVeteranId"];case l.CITIZENSHIP_CERTIFICATE:return ["regionSpecific","canadaCitizenshipCertificate"];case l.MINORS_PUBLIC_SERVICES_CARD:return ["regionSpecific","canadaMinorsPublicServicesCard"];case l.ASYLUM_REQUEST:return ["regionSpecific","ukAsylumRequest"];case l.UNIFORMED_SERVICES_ID:return ["regionSpecific","usUniformedServicesId"];case l.CONSULAR_VOTER_ID:return ["regionSpecific","mexicoConsularVoterId"];case l.TWIC_CARD:return ["regionSpecific","usTwicCard"];case l.NBI_CLEARANCE:return ["regionSpecific","philippinesNbiClearance"];case l.TEMPORARY_PROTECTION_PERMIT:return ["regionSpecific","colombiaTemporaryProtectionPermit"];case l.AFGHAN_CITIZEN_CARD:return ["regionSpecific","pakistanAfghanCitizenCard"];case l.EID:return ["regionSpecific","germanyEid"];case l.SIS_ID:return ["regionSpecific","swedenSisId"];case l.ASIC_CARD:return ["regionSpecific","australiaAsicCard"];case l.VEHICLE_REGISTRATION:return ["regionSpecific","uaeVehicleRegistrationCard"];case l.ESAAD_CARD:return ["regionSpecific","uaeEsaadCard"];case l.EXIT_ENTRY_PERMIT:case l.MAINLAND_TRAVEL_PERMIT_TAIWAN:case l.BIDOON_CARD:case l.PASS:case l.MY_NUMBER_CARD:return null;default:assertUnreachable(t);}return null}convertDate(t){if(t.successfullyParsed===!0&&t.empty===!1){let a=t;return {day:a.day,month:a.month,year:a.year}}return null}async convertResult(t){if(t.state===b.Empty)return {result:null};if(this.isSingleSideResult(t)){if(t.viz.empty)return !t.barcode.empty||t.mrz.rawMRZString.length>0?{result:null,requiresReset:"hard"}:{result:null}}else if(t.frontViz.empty&&t.backViz.empty)return {result:null,requiresReset:"hard"};return this.alreadyReturnedStageValid=t.state===b.StageValid,{result:{mrzResult:null,vizResult:await this.getVizData(t),barcodeResult:null,imageInfo:this.getImageData(t),verificationResult:null}}}shouldExtractRecognizerResultData(t){return t.country===S.GERMANY&&t.documentType===l.ID}optionallyExtractRecognizerResultData(t,a){if(!this.shouldExtractRecognizerResultData(t.classInfo))return;let r=e.stringFromMultiScriptResult;t.firstName&&(a.firstName=r(t.firstName)),t.lastName&&(a.lastName=r(t.lastName)),t.additionalNameInformation&&(a.additionalNameInformation=r(t.additionalNameInformation));}async extractVizData(t,a,r){var P,j,ce,de;let s=e.stringFromMultiScriptResult,o=s(a.vehicleClass),c=s(a.restrictions),u=s(a.endorsements),I=this.workerCallProvider(),N=null;I&&(o.length>0||c.length>0||u.length>0)&&(N=await Ge.create(I).createDrivingLicenseDetailsFromBlinkIdData(o,c,u));let[C,f]=(P=this.centaurusDocumentTypeToIdCaptureDocumentType(t.documentType,t.country))!=null?P:[null,null];return {firstName:s(r.firstName),lastName:s(r.lastName),secondaryLastName:null,fullName:s(r.fullName),sex:s(r.sex),dateOfBirth:this.convertDate(r.dateOfBirth),nationality:s(r.nationality),address:s(r.address),documentType:C,documentSubtype:f,issuingCountryIso:(j=t.isoAlpha3CountryCode)!=null?j:null,issuingCountry:(de=$t[(ce=t.isoAlpha3CountryCode)!=null?ce:""])!=null?de:null,documentNumber:s(r.documentNumber),dateOfExpiry:this.convertDate(r.dateOfExpiry),dateOfIssue:this.convertDate(r.dateOfIssue),additionalAddressInformation:s(r.additionalAddressInformation),additionalNameInformation:s(r.additionalNameInformation),documentAdditionalNumber:s(r.documentAdditionalNumber),employer:s(r.employer),issuingAuthority:s(r.issuingAuthority),maritalStatus:s(r.maritalStatus),personalIdNumber:s(r.personalIdNumber),placeOfBirth:s(r.placeOfBirth),profession:s(r.profession),race:s(r.race),religion:s(r.religion),residentialStatus:s(r.residentialStatus),mothersName:s(r.mothersName),fathersName:s(r.fathersName),issuingJurisdiction:Xt(t.region),issuingJurisdictionIso:null,drivingLicenseDetails:N?N.toJSONObject():null,bloodType:s(r.bloodType),sponsor:s(r.sponsor),passportNumber:null,visaNumber:null,vehicleOwner:s(r.vehicleOwner)}}getFieldLocations(t){var r,s;let a={};for(let o of Object.keys(t)){let c=o,u=t[c];if(typeof u=="object"){if(u.hasOwnProperty("latinLocation")&&((r=u.latinLocation)==null?void 0:r.topLeft)!=null){let{topLeft:I,bottomRight:N}=u.latinLocation;a[c]=new Quadrilateral(new Point(I.x,I.y),new Point(N.x,I.y),new Point(N.x,N.y),new Point(I.x,N.y)).toJSONObject();}else if(u.hasOwnProperty("originalString")){let I=u;if(((s=I.originalString)==null?void 0:s.hasOwnProperty("latinLocation"))===!0&&I.originalString.latinLocation!==void 0){let{topLeft:N,bottomRight:C}=I.originalString.latinLocation;a[c]=new Quadrilateral(new Point(N.x,N.y),new Point(C.x,N.y),new Point(C.x,C.y),new Point(N.x,C.y)).toJSONObject();}}}}return a}getImageBase64String(t){return t?btoa(t.reduce((a,r)=>e.concatenateReducer(a,r),"")):null}getImageData(t){let a={face:this.getImageBase64String(t.faceImage.encodedImage)};return this.isSingleSideResult(t)?{front:{...a,croppedDocument:this.getImageBase64String(t.fullDocumentImage.encodedImage),frame:null},back:{face:null,croppedDocument:null,frame:null}}:{front:{...a,croppedDocument:this.getImageBase64String(t.fullDocumentFrontImage.encodedImage),frame:null},back:{face:null,croppedDocument:this.getImageBase64String(t.fullDocumentBackImage.encodedImage),frame:null}}}getRealIdStatus(t){switch(this.isSingleSideResult(t)?t.imageAnalysisResult.realIDDetectionStatus:t.frontImageAnalysisResult.realIDDetectionStatus){case ae.NotAvailable:return "notAvailable";case ae.NotDetected:return "notRealIdCompliant";case ae.Detected:return "realIdCompliant";default:return "notAvailable"}}async getVizData(t){let a=this.getRealIdStatus(t);if(this.isSingleSideResult(t)){let u={...await this.extractVizData(t.classInfo,t.driverLicenseDetailedInfo,t.viz),usRealIdStatus:a,capturedSides:"frontOnly",isBackSideCaptureSupported:!1,frontFieldLocations:this.getFieldLocations(t.viz)};return this.optionallyExtractRecognizerResultData(t,u),u}let r=xa(t),s={...await this.extractVizData(t.classInfo,t.driverLicenseDetailedInfo,t.frontViz),usRealIdStatus:a,capturedSides:r,isBackSideCaptureSupported:ta(t),frontFieldLocations:this.getFieldLocations(t.frontViz)};if(this.optionallyExtractRecognizerResultData(t,s),!Fa(t))return s;let o=["address","dateOfBirth","dateOfExpiry","dateOfIssue","documentNumber","firstName","fullName","lastName","nationality","sex","additionalAddressInformation","additionalNameInformation","documentAdditionalNumber","employer","issuingAuthority","maritalStatus","personalIdNumber","placeOfBirth","profession","race","religion","residentialStatus","mothersName","fathersName"],{backViz:c}=t;for(let u of o)if(s[u]==null||s[u]===""){let N=c[u];this.handleEmptyFrontValue(s,u,N);}return s}handleEmptyFrontValue(t,a,r){if(e.isCentaurusStringResult(r)){let s=e.stringFromMultiScriptResult(r);s.length>0&&(t[a]=s);}else if(e.isCentaurusDateResult(r)){let s=this.convertDate(r);s&&(t[a]=s);}}isSingleSideResult(t){return this.capturedSides==="frontOnly"}hasResult(t){return t===b.Valid||t===b.StageValid&&!this.alreadyReturnedStageValid}async processDoubleSideResult(t){if(this.hasResult(t)){let a=await this.recognizer.getResult();return this.convertResult(a)}return {result:null}}async processSingleSideResult(t){if(t===b.Valid){let a=await this.recognizer.getResult();return this.convertResult(a)}return {result:null}}};var T=class{static isSingleSideScanner(t){return !t._isFull}static isFullDocumentScanner(t){return t._isFull}};var je=class e{constructor(t,a,r){this._settingsCapturedSides=null;this.isProcessing=!1;this._lastError=null;this._lastResult=null;this._lastLocalization=null;this._currentDetectionOnlyMode=!1;this.idCapture=t,this.centaurusWasmSDK=a,this._workerCallProvider=r;}static hasRecognizerRunnerCrashed(t){return t instanceof R&&t.code===h.WORKER_IMAGE_PROCESS_FAILURE}static updatePassedRecognizerSettings(t,a,r={}){a.returnFullDocumentImage=t.getShouldPassImageTypeToResult("croppedDocument"),a.returnEncodedFullDocumentImage=t.getShouldPassImageTypeToResult("croppedDocument"),a.returnFaceImage=t.getShouldPassImageTypeToResult("face"),a.returnEncodedFaceImage=t.getShouldPassImageTypeToResult("face");let s=new Fe;switch(s.enableMrzId=!0,s.enableMrzPassport=!0,s.enableMrzVisa=!0,s.enableBarcodeId=!0,s.enablePhotoId=!1,s.enableFullDocumentRecognition=!0,a.recognitionModeFilter=s,t.getProperty("anonymizeCapturedData")===!1&&(t.anonymizationMode="none"),t.anonymizationMode){case"none":{a.anonymizationMode=B.None;break}case"fieldsOnly":{a.anonymizationMode=B.None;break}case"imagesOnly":{a.anonymizationMode=B.ImageOnly;break}case"fieldsAndImages":{a.anonymizationMode=B.ImageOnly;break}}a.scanCroppedDocumentImage=typeof r.scanCroppedDocumentImage=="boolean"?r.scanCroppedDocumentImage:!1;}async init(t){if(e.recognizerRunner!=null)throw new DataCaptureError({name:"MULTIPLE_RECOGNIZER_RUNNER",message:"A RecognizerRunner already exists, but it must be a singleton"});this.idCaptureSettings=t;let{scannerType:a}=t;this._settingsCapturedSides=T.isSingleSideScanner(a)?"frontOnly":"frontAndBack";let r=await this.getConfiguredRecognizer(this.idCaptureSettings);if(!r)throw new DataCaptureError({name:"RECOGNIZER_CREATION_FAILURE",message:"Recognizer instance could not be created."});this.recognizer=r,await this.createRunner(),await this.setDetectionOnlyMode(t.captureTrigger==="buttonTap"),this.resultProcessor=new oe(this.recognizer,this._workerCallProvider,this._settingsCapturedSides);}async applySettings(t){let a=T.isSingleSideScanner(t.scannerType)?"frontOnly":"frontAndBack",r=this._settingsCapturedSides!==a;if(this.idCaptureSettings=t,this._settingsCapturedSides=a,r&&e.recognizerRunner){await e.recognizerRunner.reconfigureRecognizers([],!1),await this.recognizer.delete();let s=await this.getConfiguredRecognizer(this.idCaptureSettings);if(s==null)throw new DataCaptureError({name:"RECOGNIZER_CREATION_FAILURE",message:"applySettings: recognizer instance could not be created."});this.recognizer=s,await e.recognizerRunner.reconfigureRecognizers([this.recognizer],!1),this.resultProcessor=new oe(this.recognizer,this._workerCallProvider,this._settingsCapturedSides);}else await this.reconfigureRecognizer(t);}async processFrame(t,a){if(this.isProcessing||e.recognizerRunner==null)return !1;this.isProcessing=!0,await this.configuringRecognizersPromise,(a==null?void 0:a.scanCroppedDocumentImage)===!0&&await this.reconfigureRecognizer(this.idCaptureSettings,{scanCroppedDocumentImage:!0});try{await this.recognize(t);}finally{(a==null?void 0:a.scanCroppedDocumentImage)===!0&&await this.reconfigureRecognizer(this.idCaptureSettings,{scanCroppedDocumentImage:!1}),this.isProcessing=!1;}return this.getLastResult()!=null}onQuadDetection(t){this._lastLocalization=t.detectionStatus===w.Success?Quadrilateral.fromJSON(t):null,this.reportLastLocalizedDocument(this._lastLocalization),this.reportLastDetectionIssue(t);}async dispose(){var t;await((t=e.recognizerRunner)==null?void 0:t.delete()),e.recognizerRunner=void 0,await this.recognizer.delete();}async reset(t=!0){var a;await((a=e.recognizerRunner)==null?void 0:a.resetRecognizers(t)),this._lastResult=null,this._lastError=null,t&&this.resultProcessor.reset();}async setDetectionOnlyMode(t){if(this._currentDetectionOnlyMode!==t){if(e.recognizerRunner==null)throw new D("Cannot set detection mode, IdCapture has not initialized yet.");this._currentDetectionOnlyMode=t,await e.recognizerRunner.setDetectionOnlyMode(t);}}displayDetectionStatusInUI(t){let a=window,r=a.centaurusDetectionStatus;r==null&&(r=document.createElement("div"),r.className="centaurusDetectionStatus",r.style.position="absolute",r.style.zIndex="1000",r.style.top="10px",r.style.left="10px",r.style.padding="0 1rem",r.style.backgroundColor="white",document.body.append(r),a.centaurusDetectionStatus=r),r.textContent=`LocalizedStatus: ${w[t.detectionStatus]}`;}reportLastLocalizedDocument(t){if(t==null)this.idCapture.reportLastLocalizedId(null);else {let a=Be.fromJSON({location:t});this.idCapture.reportLastLocalizedId(a);}}reportLastDetectionIssue(t){let a=null;switch(t.detectionStatus){case w.CameraTooFar:{a="DocumentTooFar";break}case w.CameraTooClose:case w.DocumentTooCloseToCameraEdge:case w.DocumentPartiallyVisible:{a="DocumentTooClose";break}default:a=null;}this.idCapture.reportLastDetectionIssue(a);}getLastResult(){return this._lastResult}async setLastResult(t){return this._lastResult=t,this.idCapture.reportLastResult(t)}getLastError(){return this._lastError}async setLastError(t){if(t!==this._lastError)return this.idCapture.reportLastError(t);this._lastError=t;}async createRunner(){e.recognizerRunner=await Zt(this.centaurusWasmSDK,[this.recognizer],!1,this);}async getConfiguredRecognizer(t){let{centaurusWasmSDK:a}=this,r=T.isFullDocumentScanner(t.scannerType),s;try{if(r){s=await Qt(a);let o=await s.currentSettings();e.updatePassedRecognizerSettings(t,o),await s.updateSettings(o);}else {s=await Yt(a);let o=await s.currentSettings();e.updatePassedRecognizerSettings(t,o),await s.updateSettings(o);}}catch(o){Logger.log(Logger.Level.Warn,"Error while applying new settings on recognizer object, some features might not work.",o);}return s}getRecognizerErrorMessage(t){return t instanceof R?`Processing frame failed: ${t.message} (code=${t.code})`:`Processing frame failed: ${t instanceof Error?t.message:"unknown error"}`}async recognize(t){let a=new ke({...t,colorSpace:"srgb"},Ue.NoRotation,!1),r;try{await this.setLastResult(null),await this.setLastError(null),r=await e.recognizerRunner.processImage(a);}catch(c){if(e.hasRecognizerRunnerCrashed(c)){await this.resetRecognizerRunner(),this.notifyRecoveryAfterError();return}let u=this.getRecognizerErrorMessage(c);throw await this.setLastError({type:"Undefined",message:u}),D.create({type:"Undefined",message:u})}let{result:s,requiresReset:o}=await this.resultProcessor.processResult(r);typeof o=="string"&&await this.reset(o==="hard"),!(s!=null&&!this.checkImagesPresence(s,r))&&(s!=null&&this._lastLocalization!=null&&this.addLocationInformationToResult(s,this._lastLocalization),await this.setLastResult(s));}checkImagesPresence(t,a){if(!(t.vizResult.capturedSides==="frontAndBack")||a!==b.Valid)return !0;let s=Object.values(nt).filter(c=>c!=="frame");return !s.some(c=>this.isImageRequiredButEmpty(t.imageInfo,c))}addLocationInformationToResult(t,a){let r=["barcodeResult","mrzResult","vizResult"];for(let s of r)t[s]!=null&&(t[s].location=a.toJSONObject());}async reconfigureRecognizer(t,a={}){if(e.recognizerRunner){await e.recognizerRunner.reconfigureRecognizers([],!1);let r=await this.recognizer.currentSettings();e.updatePassedRecognizerSettings(t,r,a),await this.recognizer.updateSettings(r),await e.recognizerRunner.reconfigureRecognizers([this.recognizer],!1);}}async resetRecognizerRunner(){var t;return await((t=e.recognizerRunner)==null?void 0:t.delete()),await this.recognizer.delete(),e.recognizerRunner=void 0,Logger.log(Logger.Level.Debug,"Recreating Centaurus recognizer"),this.init(this.idCaptureSettings)}notifyRecoveryAfterError(){this.idCapture.notifyRecoveryAfterCrash();}isImageRequiredButEmpty(t,a){var s,o,c;return this.idCaptureSettings.getShouldPassImageTypeToResult(a)?a==="face"?((s=t==null?void 0:t.front.face)!=null?s:"")==="":a==="croppedDocument"?((o=t==null?void 0:t.front.croppedDocument)!=null?o:"")===""||((c=t==null?void 0:t.back.croppedDocument)!=null?c:"")==="":!1:!1}};var Ka=(f=>(f.NotAcceptedDocumentType="notAcceptedDocumentType",f.InvalidFormat="invalidFormat",f.DocumentVoided="documentVoided",f.Timeout="timeout",f.SingleImageNotRecognized="singleImageNotRecognized",f.DocumentExpired="documentExpired",f.DocumentExpiresSoon="documentExpiresSoon",f.NotRealIdCompliant="notRealIdCompliant",f.HolderUnderage="holderUnderage",f.ForgedAamvaBarcode="forgedAamvaBarcode",f.InconsistentData="inconsistentData",f))(Ka||{});var He="reloadDetector",Je=class Je{constructor(t,a=Je.DEFAULT_WRITE_INTERVAL_MS){this._lastWrite=0;this._storage=t,this._writeIntervalMs=a;}hasDataAlreadyWritten(){return this._storage.getItem(He)!==null}write(t){return this._pendingData={...t},this.scheduleWrite(),t}read(){var a;if(this._pendingData)return this._pendingData;let t=(a=this._storage.getItem(He))!=null?a:"{}";return JSON.parse(t)}clear(){this._storage.removeItem(He),this._pendingData=void 0,this._lastWrite=0,clearTimeout(this._writeTimer);}scheduleWrite(){clearTimeout(this._writeTimer);let t=performance.now()-this._lastWrite;t>this._writeIntervalMs?(this._storage.setItem(He,JSON.stringify(this._pendingData)),this._pendingData=void 0,this._lastWrite=performance.now()):this._writeTimer=setTimeout(this.scheduleWrite.bind(this),this._writeIntervalMs-t);}};Je.DEFAULT_WRITE_INTERVAL_MS=500;var ze=Je;var le=class{constructor(t){this.onUnload=()=>{this._storage.clear();};this._onPageAbruptlyReloaded=t,this._storage=new ze(this.getStorage());}static isSafari(){return BrowserHelper.isSafari()}install(){if(BrowserHelper.isSafari()){if(window.addEventListener("unload",this.onUnload,{once:!0}),!this._storage.hasDataAlreadyWritten()){this._storage.write({});return}this._onPageAbruptlyReloaded();}}updateData(t){this._storage.write(t);}get data(){return this._storage.read()}uninstall(){window.removeEventListener("unload",this.onUnload);}getStorage(){return sessionStorage}};var Ze=class Ze{constructor(t){this._framesProcessedCount=0;this._didCaptureCount=0;this._didRejectCount=0;this._applySettingsCount=1;this._videoResolution="";this._upTimeMs=0;this._upTimeTimer=null;this._detector=t;}destroy(){this._upTimeTimer&&(clearInterval(this._upTimeTimer),this._upTimeTimer=null);}get framesProcessedCount(){return this._framesProcessedCount}get didCaptureCount(){return this._didCaptureCount}get didRejectCount(){return this._didRejectCount}get applySettingsCount(){return this._applySettingsCount}get videoResolution(){return this._videoResolution}set framesProcessedCount(t){this._framesProcessedCount=t,this._upTimeTimer==null&&(this._firstFrameProcessedTime=performance.now(),this._upTimeTimer=setInterval(this.updateUpTime.bind(this),Ze.UP_TIME_UPDATE_INTERVAL_MS)),this._detector.updateData(this.data);}set didCaptureCount(t){this._didCaptureCount=t,this._detector.updateData(this.data);}set didRejectCount(t){this._didRejectCount=t,this._detector.updateData(this.data);}set applySettingsCount(t){this._applySettingsCount=t,this._detector.updateData(this.data);}set videoResolution(t){this._videoResolution=t,this._detector.updateData(this.data);}get data(){return {framesProcessedCount:this._framesProcessedCount,didCaptureCount:this._didCaptureCount,didRejectCount:this._didRejectCount,applySettingsCount:this._applySettingsCount,upTime:Math.round(this._upTimeMs/100)/10,videoResolution:this._videoResolution}}updateUpTime(){this._firstFrameProcessedTime&&(this._upTimeMs=performance.now()-this._firstFrameProcessedTime,this._detector.updateData(this.data));}};Ze.UP_TIME_UPDATE_INTERVAL_MS=500;var Ke=Ze;var E={Available:"Available",ProcessingFrame:"ProcessingFrame",ProcessingQueue:"ProcessingQueue"},Ye=class e{constructor(){this.type="idCapture";this._synchronousFrameFlow=!0;this.state=E.Available;this._isEnabled=!0;this._context=null;this.listeners=[];this.overlayListeners=new Set;this._endOfCycleTasks=[];this._feedback=he.defaultFeedback;this._onProcessFrameListener=this.onProcessFrame.bind(this);this.workerMessageListener=this.onWorkerMessage.bind(this);e._centaurusLoader!=null&&(this._centaurusConnector=new je(this,e._centaurusLoader.wasmSDK,()=>{var t;return (t=this.privateContext)==null?void 0:t.workerCommand})),this.contextListener={didChangeFrameSource:this.didChangeFrameSource.bind(this)};}static get recommendedCameraSettings(){return new CameraSettings(_.IdCapture.RecommendedCameraSettings)}get context(){return this._context}get feedback(){return this._feedback}get privateContext(){return this.context}static setCentaurusLoader(t){e._centaurusLoader=t;}static async forContext(t,a){let r=new e;if(r.settings=a,r._centaurusConnector)try{await r._centaurusConnector.init(r.settings);}catch(s){throw s instanceof DataCaptureError&&s.name==="MULTIPLE_RECOGNIZER_RUNNER"&&Logger.log(Logger.Level.Error,"The newly created IdCapture mode is invalid, an existing IdCapture mode is still attached to the context and must be removed first."),s}else r.checkCaptureSettingsAgainstSDKConfiguration(a);return t&&await t.addMode(r),r}async setFeedback(t){return this._feedback=t,this.didChange()}addListener(t){this.listeners.includes(t)||this.listeners.push(t);}removeListener(t){this.listeners.includes(t)&&this.listeners.splice(this.listeners.indexOf(t),1);}isEnabled(){return this._isEnabled}async setEnabled(t){this._isEnabled!==t&&(this._isEnabled=t,this.enqueueTask(async()=>this.didChange([{type:"modeEnabled",newValue:t}])),this.state===E.Available&&this.moveToState(E.ProcessingQueue));}async reset(){this.enqueueTask(async()=>this.doReset()),this.state===E.Available&&this.moveToState(E.ProcessingQueue);}async applySettings(t){this.enqueueTask(async()=>this.doApplySettings(t)),this.state===E.Available&&this.moveToState(E.ProcessingQueue);}async parse(t){if(this.context){let a=await this.context.workerCommand("idCaptureParse",{code:t});if((a==null?void 0:a.result)!=null){let r=a.result;if((r==null?void 0:r.status)==="error")throw D.create({type:"InvalidLicenseKeyForParser",message:r.error});if((r==null?void 0:r.status)==="success"){let s=this.convertRawImagesToBase64(r.capturedId.rawImageInfo);return ne.fromJSON({...r.capturedId,imageInfo:s})}}}return null}toJSONObject(){var t,a;return {enabled:this._isEnabled,type:this.type,settings:{...this.settings.toJSONObject(),licensee:"",licenseKey:(a=(t=e._centaurusLoader)==null?void 0:t.licenseKey)!=null?a:""}}}didChangeFrameSource(){this.moveToState(E.ProcessingQueue);}moveToState(t){this.state=t,t===E.ProcessingQueue&&this.processQueue();}async doReset(){var t;await((t=this.privateContext)==null?void 0:t.workerCommand("idCaptureReset",{}));}async doApplySettings(t){var a,r,s;this.context&&(this.settings=t,this.checkCaptureSettingsAgainstSDKConfiguration(t),await Promise.all([this.settingsIncludeVIZDocuments(t)?(a=this._centaurusConnector)==null?void 0:a.applySettings(t):Promise.resolve(),(r=this.privateContext)==null?void 0:r.workerCommand("idCaptureApplySettings",{settings:t.toJSONObject()}),(s=this.privateContext)==null?void 0:s.update()]),this._safariOOMStatsCollector&&this._safariOOMStatsCollector.applySettingsCount++);}addOverlayListener(t){this.overlayListeners.add(t);}removeOverlayListener(t){this.overlayListeners.delete(t);}checkCaptureSettingsAgainstSDKConfiguration(t){if(!this._centaurusConnector&&this.settingsIncludeVIZDocuments(t))throw D.create({type:"InvalidSettingsForVIZProcessing",message:"Invalid IdCapture configuration or settings: supported documents contain some VIZ documents, but VIZ scanning is disabled."})}async onProcessFrame(t){var a,r;return this.state!==E.Available?"skip":((a=this.privateContext)==null||a.performanceMark("processFrameBeforeCentaurus"),this.moveToState(E.ProcessingFrame),await this.doProcessFrame(t),(r=this.privateContext)==null||r.performanceMark("processFrameAfterCentaurus"),"continue")}async doProcessFrame(t){var a;if(this._isEnabled&&this.settingsIncludeVIZDocuments(this.settings)){let r=new Uint8ClampedArray(t.data),s=(a=this.context)==null?void 0:a.frameSource;!await this.processFrameWithCentaurus({data:r,width:t.width,height:t.height})&&(s==null?void 0:s.type)==="singleImageUploader"&&(r=new Uint8ClampedArray(t.data),await this.processFrameWithCentaurus({data:r,width:t.width,height:t.height},{scanCroppedDocumentImage:!0}));}}async onAfterProcessFrame(){var t,a;if(this._safariOOMStatsCollector){this._safariOOMStatsCollector.framesProcessedCount++;let r=(a=(t=this.context)==null?void 0:t.frameSource)==null?void 0:a.currentResolution;r?this._safariOOMStatsCollector.videoResolution=`${r.width}x${r.height}`:this._safariOOMStatsCollector.videoResolution="";}this.moveToState(E.ProcessingQueue);}logPerformance(){let t=performance.getEntriesByName("processFrameBeforeCentaurus").length>0?performance.measure("Centaurus","processFrameBeforeCentaurus","processFrameAfterCentaurus").duration:0,a=performance.measure("SDC","processFrameBeforeSDC","processFrameAfterSDC").duration,r=`${(t+a).toFixed(2)}ms`;console.log(`centaurus: ${t.toFixed(2)}`,`sdc: ${a.toFixed(2)}`,`total: ${r}`),performance.clearMarks();}enqueueTask(t){this._endOfCycleTasks.push(t);}async processQueue(){if(this._endOfCycleTasks.length===0){this.moveToState(E.Available);return}for(;this._endOfCycleTasks.length>0;){let t=this._endOfCycleTasks.shift();await(t==null?void 0:t());}this.moveToState(E.Available);}settingsIncludeVIZDocuments(t){let{scannerType:a}=t;return T.isFullDocumentScanner(a)?!0:a.visualInspectionZone}attachedToContext(t){this._context=t,this._context.subscribeToWorkerMessages(this.workerMessageListener),this._context.registerFrameHandler(this._onProcessFrameListener),le.isSafari()&&(this._safariOOMDetector=new le(this.onPageAbruptlyReloaded.bind(this)),this._safariOOMDetector.install(),this._safariOOMStatsCollector=new Ke(this._safariOOMDetector)),this._context.addListener(this.contextListener);}async detachedFromContext(){var t,a,r,s,o;return (t=this._context)==null||t.unsubscribeToWorkerMessages(this.workerMessageListener),(a=this._context)==null||a.unregisterFrameHandler(this._onProcessFrameListener),(r=this._context)==null||r.removeListener(this.contextListener),(s=this._safariOOMDetector)==null||s.uninstall(),this._safariOOMDetector=void 0,(o=this._safariOOMStatsCollector)==null||o.destroy(),this._safariOOMStatsCollector=void 0,this._context=null,this.dispose()}async dispose(){var t;this.listeners=[],await((t=this._centaurusConnector)==null?void 0:t.dispose()),this._centaurusConnector=void 0;}async didChange(t){if(this.context)return this.context.update(t)}async onWorkerMessage(t){switch(t.type){case"idCaptureDidCaptureId":{this.triggerListenersForResult("didCaptureId",t.payload);break}case"idCaptureDidRejectId":{await this.triggerListenersForResult("didRejectId",t.payload),t.payload.rejectionReason==="singleImageNotRecognized"&&await this.reset();break}case"idCaptureDidShutterButtonPositionChanged":{for(let a of this.overlayListeners)a.onShutterPositionUpdate(t.payload.position);break}case"idCaptureDidShutterButtonStateChanged":{for(let a of this.overlayListeners)a.onShutterButtonStateChanged(t.payload.state);break}case"idCaptureIdCapturedFeedback":{this._feedback.idCaptured.emit();break}case"idCaptureIdRejectedFeedback":{this._feedback.idRejected.emit();break}case"idCaptureBackendReset":{this.enqueueTask(async()=>{var a;return (a=this._centaurusConnector)==null?void 0:a.reset(t.payload.hardReset)});break}case"idCaptureDetectionOnlyMode":{this.enqueueTask(async()=>{var a;return (a=this._centaurusConnector)==null?void 0:a.setDetectionOnlyMode(t.payload.detectionOnlyMode)}),this.state===E.Available&&this.moveToState(E.ProcessingQueue);break}case"onFrameProcessingStarted":break;case"onFrameProcessingFinished":{this.onAfterProcessFrame();break}case"onFrameSkipped":{this.onAfterProcessFrame();break}}}async processFrameWithCentaurus(t,a){try{return await this._centaurusConnector.processFrame(t,a)}catch(r){return r instanceof D?(Logger.log(Logger.Level.Debug,r.message),this.triggerErrorListener(r)):(Logger.log(Logger.Level.Debug,"Error while processing incoming frame from SDC",r),this.triggerErrorListener(D.create({type:"Undefined",message:"Error while processing a frame"}))),!1}}uint8ArrayImageToBase64(t,a,r){let s=document.createElement("canvas");s.width=a,s.height=r;let o=s.getContext("2d");if(!o)throw new Error("Could not get 2d context from an HTMLCanvasElement");o.putImageData(new ImageData(t,a,r,{colorSpace:"srgb"}),0,0);let c=o.canvas.toDataURL("image/png",1).replace("data:image/png;base64,","");return o=null,s=null,c}convertRawImagesToBase64(t){return {front:{...t.front,frame:t.front.frame.data==null?null:this.uint8ArrayImageToBase64(t.front.frame.data,t.front.frame.width,t.front.frame.height)},back:{...t.back,frame:t.back.frame.data==null?null:this.uint8ArrayImageToBase64(t.back.frame.data,t.back.frame.width,t.back.frame.height)}}}async triggerListenersForResult(t,a){if(!this.context||!this._isEnabled)return;t==="didCaptureId"?this._safariOOMStatsCollector&&this._safariOOMStatsCollector.didCaptureCount++:t==="didRejectId"&&this._safariOOMStatsCollector&&this._safariOOMStatsCollector.didRejectCount++;let r=null;if(a.capturedId){let s=this.convertRawImagesToBase64(a.capturedId.rawImageInfo);r=ne.fromJSON({...a.capturedId,imageInfo:s});}for(let s of this.listeners)if(typeof s[t]=="function"){let o=[r];t==="didRejectId"&&typeof a.rejectionReason=="string"&&o.push(a.rejectionReason);let c=s[t].apply(null,o);c instanceof Promise&&await c;}}notifyRecoveryAfterCrash(){if(!this._isEnabled)return;let t=!1;for(let a of this.listeners)typeof a.didFailWithError=="function"&&(a.didFailWithError(this,D.create({type:"RecoveredAfterFailure",message:"Last image processing failed but SDK could recover. Please reset scanning process."})),t=!0);!t&&this.settings.scannerType._isFull&&Logger.log(Logger.Level.Warn,`A process responsible to scan images malfunctioned and was restarted. No listener for "didFailWithError" was
2
2
  found: this may result in unexpected behaviour in your application. Please define the listener
3
3
  "didFailWithError" and handle the error "IdCaptureErrorCode.RecoveredAfterFailure". Informing the user to
4
- start over and calling "idCapture.reset()" in this case is recommended.`);}triggerErrorListener(t){if(this._isEnabled)for(let a of this.listeners)typeof a.didFailWithError=="function"&&a.didFailWithError(this,t);}async reportLastResult(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastResult",{result:t==null?"":JSON.stringify(t)})}async reportLastError(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastError",{error:t==null?"":JSON.stringify(t)})}async reportLastLocalizedId(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastLocalizedId",{localizedId:t==null?"":JSON.stringify(t.toJSONObject())})}async reportLastDetectionIssue(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastDetectionIssue",{issue:JSON.stringify({issue:t!=null?t:""})})}async onPageAbruptlyReloaded(){var r,s;if(Logger.debug("Detected abrupt page reload"),this.context==null||this._safariOOMDetector==null)return;function t(o){if(o==null)return null;try{return new URL(o).hostname}catch(c){return null}}let a={...this._safariOOMDetector.data,parentDomain:(r=t(document.referrer))!=null?r:void 0,centaurusEnabled:e._centaurusLoader!=null};Logger.debug("Abrupt page reload environment data",a),(s=this.privateContext)==null||s.workerCommand("idCaptureReportSafariAbruptReload",{environmentData:a});}};var Qe=class{constructor(t){this.idCaptureWorkerManager=t;}get workerCommand(){return this.idCaptureWorkerManager.workerCommand.bind(this.idCaptureWorkerManager)}async getLicenseText(){return (await this.workerCommand("getIdOpenSourceSoftwareLicenseInfo",{})).licenseText}};var ra={"id.idCaptureOverlay.scanFrontSideHint":"","id.idCaptureOverlay.scanBackSideHint":"","id.idCaptureOverlay.moveCloseTextHint":"","id.idCaptureOverlay.moveFurtherAwayTextHint":"","id.idCaptureOverlay.tapShutterToScan":"","id.idCaptureOverlay.lookingForDocument":"","id.idCaptureOverlay.holdStill":""};function ia(e){let t=URL.createObjectURL(new Blob(['"use strict";(()=>{var ye=(a,e)=>()=>(a&&(e=a(a=0)),e);var g,c=ye(()=>{g={"scandit-datacapture-sdk-id-pthreads.wasm":{bytes:8401414},"scandit-datacapture-sdk-id-simd-pthreads.wasm":{bytes:8309140},"scandit-datacapture-sdk-id-simd.wasm":{bytes:8195081},"scandit-datacapture-sdk-id.wasm":{bytes:8287793}}});c();c();c();c();var d;(a=>{(n=>(n.Debug="debug",n.Info="info",n.Warn="warn",n.Error="error",n.Quiet="quiet"))(a.Level||(a.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),t="debug";function r(n){t=n}a.setLevel=r;function s(n,...u){if(!(e.get(t)>e.get(n)))switch(n){case"debug":{console.debug(...u);break}case"info":{console.log(...u);break}case"warn":{console.warn(...u);break}case"error":{console.error(...u);break}}}a.log=s;function i(...n){s("warn",...n)}a.warn=i;function o(...n){s("debug",...n)}a.debug=o;function l(...n){s("info",...n)}a.info=l;function m(...n){s("error",...n)}a.error=m})(d||(d={}));c();c();c();c();var A=class q extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,q.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var O=Promise.resolve(),H=!1,N=!1,M,T={writableDataPath:""};async function X(a){if(M==null)return;H=!0;let e=new Promise((t,r)=>{setTimeout(()=>{r(new A({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((t,r)=>{M?.(a,s=>{if(s!=null){r(s);return}t()})}),e])}finally{H=!1}}async function Y(a){return N||(H?(N=!0,O=O.then(async()=>(N=!1,X(a)))):O=X(a)),O}async function Z(a){T=a,M=FS.syncfs,FS.syncfs=(e,t)=>{let r=t,s=()=>{r()},i=o=>{r(o)};Y(e).then(s).catch(i)};try{FS.mkdir(T.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw M=void 0,e}return FS.mount(IDBFS,{},T.writableDataPath),Y(!0)}c();c();c();c();var B=(a,e)=>(e=Symbol[a])?e:Symbol.for("Symbol."+a);var V=function(a,e){this[0]=a,this[1]=e},Q=(a,e,t)=>{var r=(o,l,m,n)=>{try{var u=t[o](l),h=(l=u.value)instanceof V,C=u.done;Promise.resolve(h?l[0]:l).then(y=>h?r(o==="return"?o:"next",l[1]?{done:y.done,value:y.value}:y,m,n):m({value:y,done:C})).catch(y=>r("throw",y,m,n))}catch(y){n(y)}},s=o=>i[o]=l=>new Promise((m,n)=>r(o,l,m,n)),i={};return t=t.apply(a,e),i[B("asyncIterator")]=()=>i,s("next"),s("throw"),s("return"),i},ee=(a,e,t)=>(e=a[B("asyncIterator")])?e.call(a):(a=a[B("iterator")](),e={},t=(r,s)=>(s=a[r])&&(e[r]=i=>new Promise((o,l,m)=>(i=s.call(a,i),m=i.done,Promise.resolve(i.value).then(n=>o({value:n,done:m}),l)))),t("next"),t("return"),e);var te={};function Ie(a){return[...new Uint8Array(a)].map(e=>{let t=e.toString(16);return t.length===1?`0${t}`:t}).join("")}function be(a){return Q(this,null,function*(){let e=a.getReader();try{for(;;){let{done:t,value:r}=yield new V(e.read());if(t)return;yield r}}finally{e.releaseLock()}})}async function De(a){let e=[],t=0,r=0;try{for(var s=ee(be(a)),i,o,l;i=!(o=await s.next()).done;i=!1){let n=o.value;e.push(n),t+=n.length}}catch(n){l=[n]}finally{try{i&&(o=s.return)&&await o.call(s)}finally{if(l)throw l[0]}}let m=new Uint8Array(t);for(let n of e)m.set(n,r),r+=n.length;return m.buffer}var ve=(a=>(a.VALID="VALID",a.INVALID="INVALID",a.NOT_VERIFIABLE="NOT_VERIFIABLE",a))(ve||{});async function Me(a,e,t){if(typeof crypto.subtle.digest!="function")return d.log(d.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${t} could not be verified`),"NOT_VERIFIABLE";try{let r=a instanceof Promise?await a:a,s=await crypto.subtle.digest("SHA-256",r),i=Ie(s);return e==null?(d.log(d.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):i===e?(d.log(d.Level.Debug,`Data Capture library WASM integrity found at ${t} has been verified correctly.`),"VALID"):(d.log(d.Level.Warn,`The Scandit Data Capture library WASM file found at ${t} seems invalid: expected file hash doesn\'t match (received: ${i}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(r){return d.log(d.Level.Warn,"Wasm response could not be verified",r),"NOT_VERIFIABLE"}}var _=new Map([["br",4.4],["gzip",2.9],["none",1]]);function we(a){var e;let t="content-encoding";if(a==null||a.get(t)==null)return _.get("none");let r=new Set(((e=a.get(t))!=null?e:"").split(",").map(s=>s.trim()));for(let[s,i]of _)if(r.has(s))return i;return _.get("none")}function xe(a){var e,t;if(a==null)return 0;let r=(e=we(a))!=null?e:1,s=Number.parseInt((t=a.get("content-length"))!=null?t:"0",10);return Number.isNaN(s)?0:Math.floor(s*r*100)/100}function Re(a){let{pathname:e}=new URL(a);for(let[t,r]of Object.entries(te))if(e.endsWith(t))return r.bytes;return 0}function ae(a){te=a}var Le=(a,e)=>{let t=xe(e);return t===0?Re(a):t};function ke(a,e,t,{onProgress:r,onError:s,onComplete:i}){if(!e.body)return[e];let o=Le(a,e.headers),l=0,m=0,[n,u]=t?e.body.tee():[e.body],h=n.pipeThrough(new TransformStream({async transform(C,y){try{l+=C.length,m=Number((l/o*100).toFixed(2)),o>0&&C.length>0&&m<100?r?.({percentage:m,loadedBytes:l,privateUri:a}):o===0&&C.length>0&&r?.({percentage:null,loadedBytes:l,privateUri:a}),y.enqueue(C)}catch(b){y.error(b),s?.({error:b})}},flush(C){r?.({percentage:100,loadedBytes:l,privateUri:a}),i?.({percentage:100,loadedBytes:l,privateUri:a}),C.terminate()}}));return[new Response(h,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),u]}async function z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,onComplete:s,onError:i,referredOrigin:o}){let l=await fetch(a,{referrerPolicy:"origin",referrer:o??""});if(!l.ok)throw new Error(`HTTP status code is not ok: ${l.status}, ${l.statusText}`);let[m,n]=ke(a,l,t,{onProgress:r,onError:i,onComplete:s});return n!=null&&Me(De(n),e,a),m}function re({wasmURI:a,expectedHash:e,verifyResponseHash:t,progressCallback:r,successCallback:s,importObject:i,referredOrigin:o}){async function l(n){try{let u=await z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,referredOrigin:o}),h=await(n??u).arrayBuffer(),C=await globalThis.WebAssembly.instantiate(h,i);s(C.instance,C.module)}catch(u){d.log(d.Level.Error,u),d.log(d.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${a}, did you configure the path for it correctly?`)}}async function m(){let n;try{n=await z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,referredOrigin:o});let u=await globalThis.WebAssembly.instantiateStreaming(n,i);s(u.instance,u.module)}catch(u){d.log(d.Level.Warn,u),d.log(d.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),l(n?.bodyUsed===!0?void 0:n)}}typeof globalThis.WebAssembly.instantiateStreaming=="function"?m():l()}async function J(a,e,t,r){return new Promise((s,i)=>{a().then(s).catch(o=>{let l=e*2;if(l>t){i(o);return}r(o),globalThis.setTimeout(()=>{J(a,l,t,r).then(s).catch(i)},e)})})}function U(a){var e,t;let r="";if((e=a.href)!=null&&e.startsWith("blob:null/"))r="localhost";else{let s=((t=a.pathname)==null?void 0:t.length)>1&&!a.pathname.startsWith("/");r=new URL(s?a.pathname:a.origin).hostname}return r.startsWith("[")&&r.endsWith("]")&&(r=r.slice(1,-1)),r}async function se(a,e){async function t(){return importScripts(a)}try{await J(t,250,4e3,s=>{d.log(d.Level.Warn,s),d.log(d.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${a}, retrying...`)}),self.Module.mainScriptUrlOrBlob=a;let r=globalThis.SDC_WASM_JS_VERSION;return r!==e&&d.log(d.Level.Warn,`The Scandit Data Capture library JS file found at ${a} seems invalid: expected version doesn\'t match (received: ${r}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(r){return d.log(d.Level.Error,r),!1}}c();function Ae(a){return/^https?:\\/\\/(?:[^./]*\\.)*cdn.jsdelivr.net\\//.test(a)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\\/\\/(?:[^./]*\\.)*unpkg.com\\//.test(a)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function Oe(a){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(a);return e?e[0]:null}function ie(a,e,t){let r=e,s=Ae(r);if(s.result){let o=Oe(r);o!=null&&(r=`${s.cdnBaseURL}${o}@${a}/sdc-lib/`)}let i=t.replace(".wasm","");return s.result?{jsURI:`${r}${i}.js`,wasmURI:`${r}${i}.wasm`}:{jsURI:`${r}${i}.js?v=${a}`,wasmURI:`${r}${i}.wasm?v=${a}`}}c();var F;(a=>{function e(){return"7.2.3"}a.sdkVersion=e})(F||(F={}));c();var ne=class{constructor(){this.promise=new Promise((a,e)=>{this.reject=e,this.resolve=a})}};c();var Fe=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),Ee=()=>(async a=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(a)}catch{return!1}})(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]));function Pe(){return typeof crossOriginIsolated>"u"?!1:crossOriginIsolated}function We(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer.constructor.name==="SharedArrayBuffer"}catch{return!1}}async function oe(){return Fe()}async function Ne(){if(!await Ee())return!1;let a=null;try{a=new Worker(URL.createObjectURL(new Blob([\'postMessage("Worker" in self);\'],{type:"text/javascript"})),{name:"nestedWorkerTest"})}catch{return!1}return new Promise(e=>{if(a==null){e(!1);return}a.onmessage=t=>{a?.terminate(),e(t.data)}})}async function de(){let a=await Ne();return Pe()&&We()&&a}var le=class ue{constructor(e,t){this.hintPresenterV2=null,this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10,this.redrawInterval=1e3/30,this.redrawRequests=[],this._isDrawLoopRunning=!1,this.frameDataPool=new Map,this.lastFrameCounter=-1,this.poorMansBenchmarkLogs=!1,this.writableDataPathStandard="/scandit_sync_folder",this.resourceFilesSubfolder="resources",this.performanceMetricsReporterTimer=void 0,this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0},this.gestureListener=null,this.webPlatformHintPresenter=null,this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),ae(this.getWasmMetadata())}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0)}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let t=this.getNextFrameId();this.frameDataPool.set(t,new Uint8ClampedArray(e.getFrameData()));let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r}}createContext(e){var t,r,s,i,o;let l=this.getModeDeserializers(),m=U(location);(m==="localhost"||m==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(m+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,m,this.parentDomain,l,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let n=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(n==null){let p=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${p}`)}let u=n.getView();this.context=n.getContext(),n.delete();let h=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(p,S)=>{this.contextDidChangeStatus(JSON.parse(S.toJson())),p.delete()},didStartObservingContext:p=>{this.didStartObservingContext(),p.delete()},didStopObservingContext:p=>{p.delete()}}),C=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:p=>{p.delete()},onObservationStopped:p=>{p.delete()},onFrameProcessingStarted:(p,S)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),S.delete(),p.delete()},onFrameProcessingFinished:(p,S)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),S.delete(),p.delete()},onFrameSkipped:(p,S)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),S.delete(),p.delete()}}),y=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(p,S)=>{var L;(L=this.gestureListener)==null||L.delete(),this.gestureListener=p.clone(),p.delete()}});(t=this.gestureRecognizer)==null||t.delete(),this.gestureRecognizer=new y;let b=new h;this.context.addListener(b),b.delete();let D=new C;this.context.addFrameListener(D),D.delete(),this.setView(u),(r=this.view)==null||r.setGestureRecognizer(this.gestureRecognizer);let v=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:p=>{p.delete()},showToast:p=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(p)})},hideToast:p=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(p)})},showGuidance:p=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(p)})},hideGuidance:p=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(p)})},startUpdateTimer:p=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:p}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(s=this.hintPresenterV2)==null||s.delete(),(i=this.webPlatformHintPresenter)==null||i.delete(),this.webPlatformHintPresenter=new v,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(o=this.view)==null||o.setHintPresenterV2(this.hintPresenterV2)}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e))}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0},1e3))}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}})}deleteFrameData(e){this.frameDataPool.delete(e)}dispose(){var e,t;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[ue.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var t;if(this.context==null)return{payload:e,transferables:[e.data.buffer]};let r=e.data,s=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,i=this.Module.allocateUint8Array(r.byteLength);return this.Module.HEAPU8.set(r,i),(t=this.imageFrameSource)==null||t.outputFrame(i,e.width,e.height,s),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus)}requestFrameData(e){let t=this.frameDataPool.get(e);return t==null?{payload:{data:null}}:{payload:{data:t},transferables:[t.buffer]}}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e)}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer])}setFrameSource(e,t){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(e){this.isDrawLoopRunning=!0;let t=i=>this.redrawRequests.length>0&&this.redrawRequests[0]<=i,r=i=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=i;)this.redrawRequests.shift()},s=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let i=performance.now();if(t(i)){r(i),e.draw();let o=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(o))}s()},this.redrawInterval)};s()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.onBeforeUpdateContextHook(e),r=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(t.context));if(r==null){let i=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${i}`)}this.context.delete(),this.context=r.getContext();let s=r.getView();r.delete(),s!=null&&t.view!=null&&s.setViewSize(t.view.width,t.view.height,t.view.orientation),this.hintPresenterV2!=null&&s?.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&s?.setGestureRecognizer(this.gestureRecognizer),this.setView(s),d.debug("context updated",t)}}onBeforeUpdateContextHook(e){return e}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(e){return{payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,t;return{payload:{isDisplayingViewfinder:(t=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?t:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?"b266ac31fb656d7a4f98427461f899b34c895e1d098e513eab3fb406b913b938":"66c480d2fb07b65b412b7723086bc31e7d08b2e862e6f80c6bcf15da3a058d17":e?"8a6d0eec0fc2ff78f80881eed0f2496b2bc89d84cefb0777eb46c32fbe13e86a":""}getWasmCoreFileName(e,t){return t?e?"scandit-datacapture-sdk-id-simd-pthreads.wasm":"scandit-datacapture-sdk-id-pthreads.wasm":e?"scandit-datacapture-sdk-id-simd.wasm":""}getWasmMetadata(){return g}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,r)=>t-r)}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${U(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e})}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"})}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])))}addNativeOverlay(e){d.warn("addNativeOverlay has not been implemented for this module",e)}removeNativeOverlay(e){d.warn("removeNativeOverlay has not been implemented for this module",e)}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new t;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(r,s){try{let i=JSON.parse(s),o=[];for(let l of i){let m=new TextDecoder(l.ianaName,{fatal:!0});o.push(m.decode(r.slice(l.startIndex,l.endIndex)))}return o.join("")}catch{return""}}});e.setDataDecoding(new t)}start(e,t,r){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||r())}getWritableDataPath(e){return e!=null?(d.debug(`IndexedDB database name override in use to recover from blocked standard database: ${e}`),e):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e,locationPath:t,writableDataPathOverride:r,overrideThreadsSupport:s,overrideSimdSupport:i,verifyResponseHash:o,referredOrigin:l,fixedWasmMemory:m}){var n;let u=!1,h=!1;this.writableDataPath=this.getWritableDataPath(r),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:C,reject:y,promise:b}=new ne,D=F.sdkVersion();if(D==="")throw new A({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[v,p]=await Promise.all([oe(),de()]);s!=="auto"&&(p=s==="on"),i!=="auto"&&(v=i==="on");let S=this.getWasmCoreFileName(v,p),L=ie(D,e,S),{jsURI:W,wasmURI:G}=L,Ce={instantiateWasm:(I,fe)=>(re({importObject:I,wasmURI:G,expectedHash:this.getWasmCoreExpectedHash(v,p),verifyResponseHash:o,successCallback:fe,progressCallback:this._loadProgressCallback,referredOrigin:l}),{})},k=m===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(m),maximum:this.numOfMBToPages(300),shared:p});return k!==null&&d.log(d.Level.Debug,"Fixed wasmMemory set",k),this.moduleHandler.set({...k?{wasmMemory:k}:{},mainScriptUrlOrBlob:W,canvas:(n=this.workerFunctions.getOffscreenCanvas())!=null?n:{getContext:()=>null},...Ce,dynamicLibraries:this.getWasmDynamicLibraries(G),locateFile:I=>e+I,noInitialRun:!0,preRun:[async()=>{try{await Z({writableDataPath:this.writableDataPath})}catch(I){if(I.name==="BlockedIndexedDB"){y(I.toString());return}d.log(d.Level.Debug,"No IndexedDB support, some data will not be persisted:",I)}h=!0,this.start(h,u,C)}],onMainComplete:()=>{if([u,h].includes(!1)){d.log(d.Level.Warn,{runtimeLoaded:u,fileSystemSynced:h},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),y("onMainComplete has been called but runtime or file system was not ready.");return}C()},onRuntimeInitialized:()=>{u=!0,this.start(h,u,C)},print:I=>{d.log(d.Level.Info,I)}}),await se(W,D)||y(`Couldn\'t retrieve Scandit Data Capture library at ${W}, did you configure the path for it correctly?`),b}};le.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var w=le;c();c();function x(a){return typeof a=="object"&&a!=null}function R(a){if(typeof a=="string")return a;if(x(a)){if(typeof a.message=="string")return a.message}else if(typeof a?.toString=="function")return a.toString();return"unknown error"}c();function ce(a){return typeof a=="object"&&a!=null&&a.document==null&&"addEventListener"in a&&typeof a.importScripts=="function"}c();function pe(a){console.warn("Reached unexpected case",a)}var $=class{constructor(a,e){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=a,this.dataCaptureInstance=new w(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),ce(a)&&this.listenToMessages()}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{d.log(d.Level.Error,a)}),this.workerSelf.addEventListener("messageerror",a=>{d.log(d.Level.Error,a)})}postMessage(a,e){this.workerSelf.postMessage(a,e??[])}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(a){return x(a)&&"payload"in a}hasTransferables(a){return x(a)&&Array.isArray(a.transferables)}async respondWith(a,e,t){let r=null,s;try{s=t(),s instanceof Promise&&(s=await s)}catch(o){s=void 0,r=R(o)}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(s)?s.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(s)?s.transferables:[])}onMessage(a){switch(a.data.command){case"loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}))}break}case"onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point)})}break}case"hintPresenterV2update":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update()})}break}case"createContext":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}))}break}case"setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource))}break}case"processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}))}break}case"requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId))}break}case"deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId)})}break}case"updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e))}break}case"dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics()});break}case"reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e))}break}case"setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{d.setLevel(e.level)})}break}case"extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey))}break}case"documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state)})}break}case"isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature))}break}case"getViewfinderInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}case"addNativeOverlay":this.dataCaptureInstance.addNativeOverlay(a);break;case"removeNativeOverlay":this.dataCaptureInstance.removeNativeOverlay(a);break;default:return pe(a.data),!1}return!0}};c();c();c();c();function me(a){return a.ok()}function he(a,e){return me(a)?a.value():e}function ge(a,e){return me(a)?e:a.error()}function f(a,e){return a===void 0?e:a}function j(a){if(typeof a=="string")try{return JSON.parse(a)}catch{return null}return null}var E=class extends w{constructor(t,r){super(t,r);this.lastIdCaptureModeSerializedSettings=""}processFrame(t){return this.idCaptureMode.isReadyToProcessFrame()?super.processFrame(t):{payload:t,transferables:[t.data.buffer]}}updateContext(t){super.updateContext(t),this.idCaptureMode.start()}idCaptureSetLastResult(t){this.idCaptureMode.setLastResult(t)}idCaptureSetLastError(t){this.idCaptureMode.setLastError(t)}idCaptureSetLastLocalizedId(t){this.idCaptureMode.setLastLocalizedId(t)}idCaptureSetLastDetectionIssue(t){this.idCaptureMode.setLastDetectionIssue(t)}async idCaptureReset(){this.idCaptureMode.reset()}async idCaptureApplySettings(t){return this.idCaptureMode.applySettings(t)}async idCaptureParse(t){return{payload:{result:this.idCaptureMode.parse(t)}}}async idCaptureBarcodeVerifyAamvaCapture(t,r){return{payload:{result:await this.idCaptureMode.idCaptureBarcodeVerifyAamvaCapture(t,r)}}}idCaptureDataConsistencyVerifyCapture(t){return{payload:{result:this.idCaptureMode.idCaptureDataConsistencyVerifyCapture(t)}}}idCaptureDrivingLicenseDetailsCreateWithBlinkIdData(t,r,s){let i=this.Module.DrivingLicenseDetails.createWithBlinkIdData(t,r,s);return{payload:{result:JSON.parse(i)}}}getIdOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.IdOpenSourceSoftwareLicenseInfo.getLicenseText()}}}idCaptureReportSafariAbruptReload(t){this.idCaptureMode.reportSafariAbruptReload(t)}getModeDeserializers(){this.idCaptureMode=new K(this,this.Module,this.workerFunctions),this.idCaptureMode.start();let t=super.getModeDeserializers();return t.push_back(this.idCaptureMode.getDeserializer()),t}getWasmSideModuleFileName(){return""}getWasmCoreFileName(t,r){return r?t?"scandit-datacapture-sdk-id-simd-pthreads.wasm":"scandit-datacapture-sdk-id-pthreads.wasm":t?"scandit-datacapture-sdk-id-simd.wasm":"scandit-datacapture-sdk-id.wasm"}getWasmCoreExpectedHash(t,r){return r?t?"b266ac31fb656d7a4f98427461f899b34c895e1d098e513eab3fb406b913b938":"66c480d2fb07b65b412b7723086bc31e7d08b2e862e6f80c6bcf15da3a058d17":t?"8a6d0eec0fc2ff78f80881eed0f2496b2bc89d84cefb0777eb46c32fbe13e86a":"61c587efba532e8928aec499aa19dd6f9c40fd5c4c02753113b4294e6e179c8d"}getWasmMetadata(){return g}},K=class{constructor(e,t,r){this.SDCIdCaptureMode=null;this.listenerSet=!1;this.lastResult="";this.lastError="";this.lastLocalizedId="";this.lastDetectionIssue="";this._state="initial";this.coreEngine=e,this.Module=t,this.workerFunctions=r,this.state="created"}get state(){return this._state}set state(e){this._state=e}isReadyToProcessFrame(){return this.state==="started"}setLastResult(e){this.lastResult=e}setLastError(e){this.lastError=e}setLastLocalizedId(e){this.lastLocalizedId=e}setLastDetectionIssue(e){this.lastDetectionIssue=e}async applySettings(e){this.SDCIdCaptureMode?.applySettings(JSON.stringify(e))}reset(){this.SDCIdCaptureMode?.reset()}parse(e){if(this.SDCIdCaptureMode){let t=this.SDCIdCaptureMode.parse(e);if(t.ok()){let r=he(t,null);if(r!=null){let s=this.extractCaptureId(r);if(s!=null)return{status:"success",capturedId:s}}}else return{status:"error",error:ge(t,"Undefined error")}}return null}idCaptureDataConsistencyVerifyCapture(e){let r=new this.Module.DataConsistencyVerifier(this.coreEngine.context).verify(JSON.stringify(e));if(r==null)return null;let s=JSON.parse(r.toJson());return r.delete(),s}async idCaptureBarcodeVerifyAamvaCapture(e,t){return new Promise(r=>{let s=this.Module.AamvaBarcodeVerifier.extend("AamvaBarcodeVerifier",{retriggerVerificationIn(o){setTimeout(()=>{i.startVerification(JSON.stringify(e))},o)},verificationEnded(){let o=i.getBarcodeVerificationResponse();r({isSuccess:o.isSuccess,error:o.error,allChecksPassed:o.allChecksPassed,serverResponseJSON:o.serverResponseJson})}}),i=new s;i.initialize(this.coreEngine.context,t??""),i.startVerification(JSON.stringify(e))})}start(){if(this.initHintPresenterIfNotInitialized(),this.state==="started")return;let e=this.Module.IdCaptureListener.extend("IdCaptureListener",{onSessionUpdated:(n,u)=>{n.delete(),u.delete()},onIdCaptured:(n,u)=>{this.onIdCapturedCallback(u),n.delete(),u.delete()},onIdRejected:(n,u,h)=>{this.onIdRejectedCallback(u,h),n.delete(),u.delete()},onShutterButtonPositionChanged:n=>{this.onShutterButtonPositionChangedCallback(n)},onShutterButtonStateChanged:n=>{this.onShutterButtonStateChangedCallback(n)}}),t=this.Module.Feedback.extend("Feedback",{emit:()=>{this.workerFunctions.postMessage({type:"idCaptureIdCapturedFeedback"})}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.workerFunctions.postMessage({type:"idCaptureIdRejectedFeedback"})}}),s=this.Module.IdCaptureDeserializerListener.extend("IdCaptureDeserializerListener",{onModeDeserializationFinished:(n,u,h)=>{if(!this.listenerSet){let C=new e;u.addListener(C),C.delete(),this.listenerSet=!0,u.setFeedbacks(new t,new r)}n.delete(),u.delete(),h.delete()},onModeDeserializationStarted(n,u,h){n.delete(),u.delete(),h.delete()},onSettingsDeserializationStarted(n,u,h){n.delete(),u.delete(),h.delete()},onSettingsDeserializationFinished(n,u,h){n.delete(),u.delete(),h.delete()}}),i=this.Module.IdCaptureBackend.extend("IdCaptureBackend",{getLastError:()=>this.lastError,getLastResult:()=>this.lastResult,getLocalizedOnlyId:()=>this.lastLocalizedId,getLastIssue:()=>this.lastDetectionIssue,processFrame:(n,u,h,C)=>{},reset:this.onResetFromSDC.bind(this),setDetectionOnlyMode:this.setDetectionOnlyMode.bind(this)}),o=this.Module.IdCaptureDeserializerHelper.extend("IdCaptureDeserializerHelper",{createMode:(n,u)=>{this.SDCIdCaptureMode!=null&&this.SDCIdCaptureMode.delete();let h=new i;return this.SDCIdCaptureMode=new this.Module.IdCapture(n,h,u,null),h.delete(),n.delete(),u.delete(),this.SDCIdCaptureMode}}),l=new o;this.idCaptureDeserializer=new this.Module.IdCaptureDeserializer(l),l.delete();let m=new s;this.idCaptureDeserializer.setListener(m),m.delete(),this.state="started"}onResetFromSDC(e){this.workerFunctions.postMessage({type:"idCaptureBackendReset",payload:{hardReset:e}}),this.lastError="",this.lastResult="",this.lastLocalizedId=""}setDetectionOnlyMode(e){this.workerFunctions.postMessage({type:"idCaptureDetectionOnlyMode",payload:{detectionOnlyMode:e}})}onIdCapturedCallback(e){let t=this.extractCaptureId(e);t&&this.workerFunctions.postMessage({type:"idCaptureDidCaptureId",payload:{capturedId:t}},this.extractImageTransferablesFromCapturedId(t))}onIdRejectedCallback(e,t){let r=this.extractCaptureId(e);this.workerFunctions.postMessage({type:"idCaptureDidRejectId",payload:{capturedId:r,rejectionReason:t}},r?this.extractImageTransferablesFromCapturedId(r):[])}extractCaptureId(e){if(e==null)return null;let t=e.getImages(),r=t.getFrameFront(),s=t.getFrameBack(),i=f(t.getFace(),null),o=f(t.getCroppedDocumentFront(),null),l=f(t.getCroppedDocumentBack(),null),m={front:{face:i,croppedDocument:o,frame:{data:r?new Uint8ClampedArray(r.getFrameData()):null,width:r?.getWidth()??0,height:r?.getHeight()??0,mirrorAxis:r?.getMirrorAxis().value??0,orientation:r?.getOrientation()??0}},back:{face:null,croppedDocument:l,frame:{data:s?new Uint8ClampedArray(s.getFrameData()):null,width:s?.getWidth()??0,height:s?.getHeight()??0,mirrorAxis:s?.getMirrorAxis().value??0,orientation:s?.getOrientation()??0}}};r?.delete(),s?.delete(),t.delete();let n=JSON.parse(e.toJson());return{...{firstName:f(e.getFirstName(),""),lastName:f(e.getLastName(),""),secondaryLastName:f(e.getSecondaryLastName(),""),fullName:e.getFullName(),sex:f(e.getSex(),""),age:f(e.getAge(),null),isExpired:f(e.isExpired(),null),nationality:f(e.getNationality(),""),address:f(e.getAddress(),""),issuingCountry:f(e.getIssuingCountry(),""),issuingCountryIso:f(e.getIssuingCountryIso(),""),documentNumber:f(e.getDocumentNumber(),""),documentAdditionalNumber:f(e.getDocumentAdditionalNumber(),""),dateOfBirth:j(f(e.getDateOfBirth(),null)),dateOfExpiry:j(f(e.getDateOfExpiry(),null)),dateOfIssue:j(f(e.getDateOfIssue(),null)),documentType:f(e.getDocumentType(),null),documentSubtype:f(e.getDocumentSubtype(),null)},...n,imageInfo:null,rawImageInfo:m}}onShutterButtonPositionChangedCallback(e){this.workerFunctions.postMessage({type:"idCaptureDidShutterButtonPositionChanged",payload:{position:JSON.parse(e)}})}onShutterButtonStateChangedCallback(e){this.workerFunctions.postMessage({type:"idCaptureDidShutterButtonStateChanged",payload:{state:e}})}async reportSafariAbruptReload(e){let t=new this.Module.OutOfMemoryAnalyticsData(e.framesProcessedCount,e.didCaptureCount,e.didRejectCount,e.applySettingsCount,e.upTime,e.videoResolution,e.parentDomain,e.centaurusEnabled);this.Module.OutOfMemoryAnalyticsHelper.storeAnalyticsEvent(this.coreEngine.context,t),t.delete()}parseIdCaptureSession(e){return JSON.parse(e.toJson())}getDeserializer(){return this.idCaptureDeserializer}dispose(){this.state==="started"&&(this.idCaptureDeserializer.delete(),this.lastError="",this.lastLocalizedId="",this.lastResult="",this.listenerSet=!1,this.state="disposed")}restart(){this.dispose(),this.start()}extractImageTransferablesFromCapturedId(e){let t=[];return e.rawImageInfo.front.frame.data&&e.rawImageInfo.front.frame.data.length>0&&t.push(e.rawImageInfo.front.frame.data.buffer),e.rawImageInfo.back.frame.data&&e.rawImageInfo.back.frame.data.length>0&&t.push(e.rawImageInfo.back.frame.data.buffer),t}isReadyToDisplayHints(){return this.coreEngine.view?this.coreEngine.view.hintPresenterInitialized():!1}initHintPresenterIfNotInitialized(){if(this.isReadyToDisplayHints())return;let e=this.Module.HintPresenter.extend("HintPresenter",{showHint:(t,r)=>{this.workerFunctions.postMessage({type:"showHint",payload:{text:t,style:JSON.parse(r)}})},updateHint:t=>{this.workerFunctions.postMessage({type:"updateHint",payload:{style:JSON.parse(t)}})},hideHint:()=>{this.workerFunctions.postMessage({type:"hideHint",payload:{}})}});this.coreEngine.view?.setHintPresenter(new e)}};var P=class extends ${constructor(e,t){super(e,t),this.dataCaptureInstance=new E(t,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)})}async respondWith(e,t,r){let s=null,i;try{i=r(),i instanceof Promise&&(i=await i)}catch(l){d.log(d.Level.Debug,l),i=void 0,s=R(l)}let o={type:"workerTaskId",command:e,id:t,payload:this.hasPayload(i)?i.payload:void 0};s!=null&&(o.error=s),this.postMessage(o,this.hasTransferables(i)?i.transferables:[])}onMessage(e){switch(e.data.command){case"idCaptureSetLastResult":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastResult(t.result)}),!0}case"idCaptureSetLastError":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastError(t.error)}),!0}case"idCaptureSetLastLocalizedId":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastLocalizedId(t.localizedId)}),!0}case"idCaptureSetLastDetectionIssue":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastDetectionIssue(t.issue)}),!0}case"idCaptureReset":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureReset()),!0}case"idCaptureApplySettings":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureApplySettings(t.settings)),!0}case"idCaptureParse":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureParse(t.code)),!0}case"idCaptureBarcodeVerifyAamvaCapture":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureBarcodeVerifyAamvaCapture(t.capturedId,t.endpoint)),!0}case"idCaptureDataConsistencyVerifyCapture":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureDataConsistencyVerifyCapture(t.capturedId)),!0}case"idCaptureDrivingLicenseDetailsCreateWithBlinkIdData":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureDrivingLicenseDetailsCreateWithBlinkIdData(t.details.vehicleClass,t.details.restrictions,t.details.endorsements)),!0}case"getIdOpenSourceSoftwareLicenseInfo":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>this.dataCaptureInstance.getIdOpenSourceSoftwareLicenseInfo()),!0}case"idCaptureReportSafariAbruptReload":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>this.dataCaptureInstance.idCaptureReportSafariAbruptReload(t.environmentData)),!0}default:return super.onMessage(e)}}};var ha=new P(globalThis,{get:()=>globalThis.Module,set:a=>{globalThis.Module=a}});function ga(a){}})();\n'],{type:"application/javascript"})),a=new Worker(t,e);return URL.revokeObjectURL(t),a}var Xe=class e extends DataCaptureLoader{constructor(){super(...arguments);this._name="IdCapture";}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=ia({name:this.name})),this._dataCaptureWorker}get name(){return this._name}get fixedWasmMemory(){return BrowserHelper.isIPhone()&&BrowserHelper.isSafari()?256:null}static async create(a){var s;let r=new e(a);return r.workerCommand("setLogLevel",{level:(s=a.logLevel)!=null?s:Logger.Level.Debug}),await r.load(),r}async workerCommand(...a){let[r,s,o]=a;return new Promise((c,u)=>{let I=this.workerCommandId++;this.workerTasks.set(I,{resolve:c,reject:u,command:r});let N={...s,command:r,id:I};this.dataCaptureWorker.postMessage(N,o);})}};function $a(e){return isObject(e)&&Object.prototype.hasOwnProperty.call(e,"code")&&Object.values(h).includes(e.code)}function er(e){return /^This license is invalid for version .+\. It is valid only for licensee '.+', for product '.+' on platform '.+' up to version .+\. Please contact support for more information\.$/.test(e.message)}var It=new Map;It.set([77,105,99,114,111,98,108,105,110,107],"Scandit");It.set([66,108,105,110,107,73,68],"ID Capture");var St="Centaurus",et=class e{static async load(t){let a=new e;try{await a.initCentaurus(t);}catch(r){if($a(r)){if(er(r))throw new DataCaptureError({message:"Invalid embedded license version.",name:"IdCaptureLoadingError"});if(r.code===h.LICENSE_UNLOCK_ERROR)throw new DataCaptureError({message:"Invalid license key. Platform or domain may be incorrect.",name:"IdCaptureLoadingError"});if(r.code===h.SDK_LICENSE_KEY_MISSING)throw new DataCaptureError({message:"Invalid license key (sub-part is missing).",name:"IdCaptureLoadingError"})}throw new DataCaptureError({message:e.replaceCentaurusMentions(isObject(r)?r.message:"(no message)",It),name:"IdCaptureLoadingError"})}return a}static replaceCentaurusMentions(t,a){return typeof t=="string"?[...a.entries()].reduce((r,[s,o])=>{let c=s.map(u=>String.fromCodePoint(u)).join("");return r.replace(new RegExp(c,"gi"),o)},t):"(no message)"}static async getWasmType(){let[t,a]=await Promise.all([BrowserHelper.hasSIMDSupport(),BrowserHelper.hasThreadsSupport()]);return t?a?BrowserHelper.isDesktopDevice()?k.AdvancedWithThreads:k.Advanced:k.Advanced:k.Basic}async initCentaurus(t){this.licenseKey=t.licenseKey;let a=new xe(t.licenseKey);a.engineLocation=t.libraryLocation;let r=new URL("Centaurus.worker.min.js",t.libraryLocation).toString(),s=new Blob([`importScripts("${r}");`],{type:"text/javascript"});a.workerLocation=URL.createObjectURL(s),a.initialMemory=500,a.allowHelloMessage=!1,a.wasmModuleName=St,a.wasmType=await e.getWasmType(),a.blinkIdVariant="lightweight";let o=0;a.loadProgressCallback=c=>{var u;c>=o&&((u=t.loadProgressNotifier)==null||u.call(t,{percentage:c,privateUri:new URL(`${a.wasmModuleName}.wasm`,t.libraryLocation).toString()})),o=c;},this.wasmSDK=await Kt(a);}};var Nt=43,ar=100-Nt,oa={condition:e=>Object.keys(p).some(t=>e.pathname.endsWith(t)),do:e=>(e.info.percentage==null||(e.info.percentage=Nt*e.info.percentage/100),e.info)},la={condition:e=>e.pathname.endsWith(`${St}.wasm`),do:e=>(e.info.percentage==null||(e.info.percentage=Nt+ar*e.info.percentage/100),e.info)};function rr(e){if(typeof e=="function")return function(a){if(a.percentage==null){e(a);return}let{pathname:r}=new URL(a.privateUri,document.baseURI),s=match({pathname:r,info:a}).when(oa.condition,oa.do).when(la.condition,la.do).otherwise(o=>o.info).run();e(s);}}var ua=rr;var G=class{constructor(){this.type="shutter";this.view=null;}toJSONObject(){return {type:this.type}}};G.CLASS_NAME=ViewClassNames.SHUTTER_BUTTON_CONTROL_CLASS_NAME;var at={standby:"standby",active:"active",scanning:"scanning"},tt=class{constructor(t,a){this.control=t,this.controlsElement=a;}async install(){return this.shutterButton||(ShutterButton.register(),this.shutterButton=ShutterButton.create(),this.shutterButton.classList.add("scandit-control-widget"),this.shutterButton.classList.add(`scandit-control-widget-${G.CLASS_NAME}`),this.shutterButton.style.margin="0",this.lastPositionReceived&&this.applyPositioning(this.lastPositionReceived)),this.appendShutterButton(),!0}updatePosition(t){if(t.size.width===0&&t.size.height===0&&this.shutterButton){this.remove();return}this.lastPositionReceived=structuredClone(t),this.applyPositioning(t),this.appendShutterButton();}updateState(t){if(this.shutterButton)switch(t){case"scanning":{this.shutterButton.rotating=!0,this.shutterButton.pulse=!1;break}case"standby":{this.shutterButton.rotating=!1,this.shutterButton.pulse=!1;break}case"active":{this.shutterButton.rotating=!1,this.shutterButton.pulse=!0;break}}}remove(t){var a;(a=this.shutterButton)==null||a.remove(),t===!0&&(this.shutterButton=void 0);}appendShutterButton(){this.shutterButton&&!this.controlsElement.contains(this.shutterButton)&&this.controlsElement.append(this.shutterButton);}applyPositioning(t){this.shutterButton&&(this.shutterButton.style.position="absolute",this.shutterButton.style.left=`${t.origin.x}px`,this.shutterButton.style.top=`${t.origin.y}px`,this.shutterButton.style.width=`${t.size.width}px`,this.shutterButton.style.height=`${t.size.height}px`);}};var da=class e{constructor(){this.type="idCapture";this._idLayoutStyle="rounded";this._defaultCapturedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeWidth);this._defaultLocalizedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeWidth);this._defaultRejectedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeWidth);this._capturedBrush=this._defaultCapturedBrush;this._localizedBrush=this._defaultLocalizedBrush;this._rejectedBrush=this._defaultRejectedBrush;this._idLayoutLineStyle="light";this._showTextHints=!0;this._frontSideTextHint=Localization.getInstance().get("id.idCaptureOverlay.scanFrontSideHint");this._backSideTextHint=Localization.getInstance().get("id.idCaptureOverlay.scanBackSideHint");this._moveCloserTextHint=Localization.getInstance().get("id.idCaptureOverlay.moveCloseTextHint");this._moveFurtherAwayTextHint=Localization.getInstance().get("id.idCaptureOverlay.moveFurtherAwayTextHint");this._tapShutterToScanTextHint=Localization.getInstance().get("id.idCaptureOverlay.tapShutterToScan");this._lookingForDocumentTextHint=Localization.getInstance().get("id.idCaptureOverlay.lookingForDocument");this._holdStillTextHint=Localization.getInstance().get("id.idCaptureOverlay.holdStill");this.onShutterPositionUpdateListener=this.onShutterPositionUpdate.bind(this);this.onShutterButtonStateChangedListener=this.onShutterButtonStateChanged.bind(this);this.onContextUpdatedListener=this.onContextUpdated.bind(this);this.overlayListener={onShutterPositionUpdate:this.onShutterPositionUpdateListener,onShutterButtonStateChanged:this.onShutterButtonStateChangedListener};}get idLayoutStyle(){return this._idLayoutStyle}set idLayoutStyle(t){this._idLayoutStyle=t,this.idCapture.didChange();}get idLayoutLineStyle(){return this._idLayoutLineStyle}set idLayoutLineStyle(t){this._idLayoutLineStyle=t,this.idCapture.didChange();}get showTextHints(){return this._showTextHints}set showTextHints(t){this._showTextHints=t,this.idCapture.didChange();}get defaultCapturedBrush(){return this._defaultCapturedBrush}get defaultLocalizedBrush(){return this._defaultLocalizedBrush}get defaultRejectedBrush(){return this._defaultRejectedBrush}static async withIdCapture(t){return e.withIdCaptureForView(t,null)}static async withIdCaptureForView(t,a){var s;let r=new e;return r.idCapture=t,await r.setCapturedBrush(r.defaultCapturedBrush),await r.setLocalizedBrush(r.defaultLocalizedBrush),await r.setRejectedBrush(r.defaultRejectedBrush),a&&(r.view=a,await a.addOverlay(r),await r.installShutterButton()),t.addOverlayListener(r.overlayListener),(s=t.context)==null||s.updateListeners.add(r.onContextUpdatedListener),r}async setFrontSideTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setFrontSideTextHint. Use the Localization API instead."),this._frontSideTextHint=t,await this.idCapture.didChange();}async setBackSideTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setBackSideTextHint. Use the Localization API instead."),this._backSideTextHint=t,await this.idCapture.didChange();}async setMoveCloserTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setMoveCloserTextHint. Use the Localization API instead."),this._moveCloserTextHint=t,await this.idCapture.didChange();}async setMoveFurtherAwayTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setMoveFurtherAwayTextHint. Use the Localization API instead."),this._moveFurtherAwayTextHint=t,await this.idCapture.didChange();}getCapturedBrush(){return this._capturedBrush}async setCapturedBrush(t){this._capturedBrush=t,await this.idCapture.didChange();}getLocalizedBrush(){return this._localizedBrush}async setLocalizedBrush(t){this._localizedBrush=t,await this.idCapture.didChange();}getRejectedBrush(){return this._rejectedBrush}async setRejectedBrush(t){this._rejectedBrush=t,await this.idCapture.didChange();}toJSONObject(){return {type:this.type,idLayoutStyle:this.idLayoutStyle,idLayoutLineStyle:this.idLayoutLineStyle,showTextHints:this._showTextHints,capturedBrush:this._capturedBrush.toJSONObject(),localizedBrush:this._localizedBrush.toJSONObject(),rejectedBrush:this._rejectedBrush.toJSONObject(),frontSideTextHint:this._frontSideTextHint,backSideTextHint:this._backSideTextHint,moveCloserTextHint:this._moveCloserTextHint,moveFurtherAwayTextHint:this._moveFurtherAwayTextHint,tapShutterToScanTextHint:this._tapShutterToScanTextHint,lookingForDocumentTextHint:this._lookingForDocumentTextHint,holdStillTextHint:this._holdStillTextHint}}async installShutterButton(){if(this.view&&this.idCapture.settings.captureTrigger==="buttonTap")if(this.shutterWidget)await this.shutterWidget.install();else {let t=new G;this.shutterWidget=this.view.registerControlWidget(t,tt),this.view.addControl(t);}}onContextUpdated(t){var s,o,c,u;if(t.type==="modeEnabled"&&!t.newValue){(s=this.shutterWidget)==null||s.remove();return}t.type==="removeOverlay"&&t.newValue===this&&(this.idCapture.removeOverlayListener(this.overlayListener),(o=this.idCapture.context)==null||o.updateListeners.delete(this.onContextUpdatedListener));let a=(c=this.idCapture.context)==null?void 0:c.toJSONObject().modes,r=a==null?void 0:a.find(I=>I.type==="idCapture");r&&r.settings.captureTrigger==="auto"&&this.shutterWidget?(u=this.view)==null||u.removeControl(this.shutterWidget.control):this.installShutterButton();}onShutterPositionUpdate(t){var a,r,s;(a=this.shutterWidget)==null||a.updatePosition(t),t.size.width===0&&t.size.height===0&&((r=this.shutterWidget)!=null&&r.control)&&((s=this.view)==null||s.removeControl(this.shutterWidget.control));}onShutterButtonStateChanged(t){var a,r,s;switch(t){case"untapped":{(a=this.shutterWidget)==null||a.updateState(at.standby);break}case"untappedLocalized":{(r=this.shutterWidget)==null||r.updateState(at.active);break}case"tapped":{(s=this.shutterWidget)==null||s.updateState(at.scanning);break}}}};var rt=class{constructor(t,a,r){this._days=t,this._months=a,this._years=r;}get days(){return this._days}get months(){return this._months}get years(){return this._years}toJSONObject(){return {days:this.days,months:this.months,years:this.years}}};var it=class extends T{constructor(){super();this._isFull=!0;}toJSONObject(){return {isFull:this._isFull,options:{barcode:!0,machineReadableZone:!0,visualInspectionZone:!0}}}};var ue=class extends T{constructor(a,r,s){super();this._isFull=!1;this._barcode=a,this._machineReadableZone=r,this._visualInspectionZone=s;}get barcode(){return this._barcode}get machineReadableZone(){return this._machineReadableZone}get visualInspectionZone(){return this._visualInspectionZone}toJSONObject(){return {isFull:this._isFull,options:{barcode:this.barcode,machineReadableZone:this.machineReadableZone,visualInspectionZone:this.visualInspectionZone}}}};var pa=class e{constructor(){this.acceptedDocuments=[];this.rejectedDocuments=[];this.anonymizationMode="fieldsOnly";this.captureTrigger="auto";this.rejectVoidedIds=!1;this.decodeBackOfEuropeanDrivingLicense=!1;this.rejectExpiredIds=!1;this.rejectNotRealIdCompliant=!1;this.rejectInconsistentData=!1;this.rejectHolderBelowAge=null;this.rejectIdsExpiringIn=null;this.properties={};this.imageToResult={};this.scannerType=new ue(!1,!1,!1);}setProperty(t,a){this.properties[t]=a;}getProperty(t){return this.properties[t]}setShouldPassImageTypeToResult(t,a){this.imageToResult[t]=a;}getShouldPassImageTypeToResult(t){var a;return (a=this.imageToResult[t])!=null?a:!1}toJSONObject(){return {acceptedDocuments:this.acceptedDocuments.map(t=>t.toJSONObject()),rejectedDocuments:this.rejectedDocuments.map(t=>t.toJSONObject()),scannerType:this.scannerType.toJSONObject(),imageToResult:{face:this.imageToResult.face,croppedDocument:this.imageToResult.croppedDocument,frame:this.imageToResult.frame},properties:{...this.properties},anonymizationMode:this.anonymizationMode,captureTrigger:this.captureTrigger,rejectVoidedIds:this.rejectVoidedIds,decodeBackOfEuropeanDrivingLicense:this.decodeBackOfEuropeanDrivingLicense,rejectExpiredIds:this.rejectExpiredIds,rejectNotRealIdCompliant:this.rejectNotRealIdCompliant,rejectInconsistentData:this.rejectInconsistentData,rejectHolderBelowAge:this.rejectHolderBelowAge,rejectIdsExpiringIn:this.rejectIdsExpiringIn?this.rejectIdsExpiringIn.toJSONObject():null}}static fromJSON(t){let a=new e;a.acceptedDocuments=t.acceptedDocuments.map(o=>e.createDocumentFromJSON(o)),a.rejectedDocuments=t.rejectedDocuments.map(o=>e.createDocumentFromJSON(o));let r=t.scannerType;a.scannerType=t.scannerType.isFull?new it:new ue(r.options.barcode,r.options.machineReadableZone,r.options.visualInspectionZone),a.anonymizationMode=t.anonymizationMode,a.decodeBackOfEuropeanDrivingLicense=t.decodeBackOfEuropeanDrivingLicense,a.captureTrigger=t.captureTrigger,a.rejectVoidedIds=t.rejectVoidedIds,a.rejectExpiredIds=t.rejectExpiredIds,a.rejectNotRealIdCompliant=t.rejectNotRealIdCompliant,a.rejectInconsistentData=t.rejectInconsistentData,a.rejectHolderBelowAge=t.rejectHolderBelowAge;let s=t.rejectIdsExpiringIn;return a.rejectIdsExpiringIn=s?new rt(s.days,s.months,s.years):null,a.imageToResult={...t.imageToResult},a.properties={...t.properties},a}static createDocumentFromJSON(t){let a=t.documentType,r=t.region;switch(a){case"driverLicense":return new K(r);case"healthInsuranceCard":return new Z(r);case"idCard":return new Y(r);case"passport":return new Q(r);case"residencePermit":return new $(r);case"visaIcao":return new ee(r);case"regionSpecific":{let s=t;return new X(s.documentSubtype)}}}};var st=class e{get allChecksPassed(){return this.json.allChecksPassed}get error(){return typeof this.json.error=="string"&&this.json.error!==""?this.json.error:null}static fromJSON(t){let a=new e;return a.json=t,a}};var ma=class e{constructor(t,a=null){this._context=t,this._endpoint=a;}static async create(t){return new e(t)}async verify(t){let a=await this._context.workerCommand("idCaptureBarcodeVerifyAamvaCapture",{capturedId:t.toJSONObject(),endpoint:this._endpoint});return a.result.isSuccess||Logger.log(Logger.Level.Warn,"Error during Aamva verification:",a.result.error),st.fromJSON(a.result)}};var Aa=class e{constructor(t){this._context=t;}static create(t){return new e(t)}async verify(t){let a=await this._context.workerCommand("idCaptureDataConsistencyVerifyCapture",{capturedId:t.toJSONObject()});return a.result==null?null:J.fromJSON(a.result)}};var Ct,ie;function mo(e){Localization.getInstance().updateIfMissing({...ra});let t=typeof(e==null?void 0:e.enableVIZDocuments)=="boolean"?e.enableVIZDocuments:!1;return {moduleName:"IdCapture",load:async a=>{if(a.loadProgressNotifier=t?ua(a.loadProgressNotifier):a.loadProgressNotifier,a.overrideThreadsSupport=OverrideState.Off,a.verifyResponseHash=!0,ie=await Xe.create(a),DataCaptureContext.moduleLicenseTextProviders.push(new Qe(ie)),!t)return Logger.log(Logger.Level.Info,"VIZ scanning is disabled (enableVIZDocuments option was not passed to idCaptureLoader, or its value was false)"),ie;let o=(await ie.workerCommand("extractCentaurusLicense",{licenseKey:a.licenseKey})).centaurus.licenseKey;if(o.length===0)throw Logger.log(Logger.Level.Error,"Invalid license key: VIZ scanning is enabled in the options but the license key has no VIZ scanning enabled. Update the license key or disable VIZ scanning when calling idCaptureloader."),D.create({type:"InvalidLicenseKeyForVIZProcessing",message:"Invalid license key for VIZ scanning. Update license key or disable VIZ scanning."});return Logger.log(Logger.Level.Info,"VIZ scanning is enabled, VIZ processor will be initialized"),Ct=await et.load({libraryLocation:`${a.libraryLocation}idcapture/`,licenseKey:o,logLevel:a.logLevel,loadProgressNotifier:a.loadProgressNotifier}),Ye.setCentaurusLoader(Ct),ie}}}function Ao(e){ie=e;}function Io(e){Ct=e;}
4
+ start over and calling "idCapture.reset()" in this case is recommended.`);}triggerErrorListener(t){if(this._isEnabled)for(let a of this.listeners)typeof a.didFailWithError=="function"&&a.didFailWithError(this,t);}async reportLastResult(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastResult",{result:t==null?"":JSON.stringify(t)})}async reportLastError(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastError",{error:t==null?"":JSON.stringify(t)})}async reportLastLocalizedId(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastLocalizedId",{localizedId:t==null?"":JSON.stringify(t.toJSONObject())})}async reportLastDetectionIssue(t){var a;if(this.context)return (a=this.privateContext)==null?void 0:a.workerCommand("idCaptureSetLastDetectionIssue",{issue:JSON.stringify({issue:t!=null?t:""})})}async onPageAbruptlyReloaded(){var r,s;if(Logger.debug("Detected abrupt page reload"),this.context==null||this._safariOOMDetector==null)return;function t(o){if(o==null)return null;try{return new URL(o).hostname}catch(c){return null}}let a={...this._safariOOMDetector.data,parentDomain:(r=t(document.referrer))!=null?r:void 0,centaurusEnabled:e._centaurusLoader!=null};Logger.debug("Abrupt page reload environment data",a),(s=this.privateContext)==null||s.workerCommand("idCaptureReportSafariAbruptReload",{environmentData:a});}};var Qe=class{constructor(t){this.idCaptureWorkerManager=t;}get workerCommand(){return this.idCaptureWorkerManager.workerCommand.bind(this.idCaptureWorkerManager)}async getLicenseText(){return (await this.workerCommand("getIdOpenSourceSoftwareLicenseInfo",{})).licenseText}};var ra={"id.idCaptureOverlay.scanFrontSideHint":"","id.idCaptureOverlay.scanBackSideHint":"","id.idCaptureOverlay.moveCloseTextHint":"","id.idCaptureOverlay.moveFurtherAwayTextHint":"","id.idCaptureOverlay.tapShutterToScan":"","id.idCaptureOverlay.lookingForDocument":"","id.idCaptureOverlay.holdStill":""};function ia(e){let t=URL.createObjectURL(new Blob(['"use strict";(()=>{var ye=(a,e)=>()=>(a&&(e=a(a=0)),e);var g,c=ye(()=>{g={"scandit-datacapture-sdk-id-pthreads.wasm":{bytes:8401414},"scandit-datacapture-sdk-id-simd.wasm":{bytes:8195094},"scandit-datacapture-sdk-id-simd-pthreads.wasm":{bytes:8309156},"scandit-datacapture-sdk-id.wasm":{bytes:8287796}}});c();c();c();c();var d;(a=>{(n=>(n.Debug="debug",n.Info="info",n.Warn="warn",n.Error="error",n.Quiet="quiet"))(a.Level||(a.Level={}));let e=new Map([["debug",1],["info",2],["warn",3],["error",4],["quiet",5]]),t="debug";function r(n){t=n}a.setLevel=r;function s(n,...u){if(!(e.get(t)>e.get(n)))switch(n){case"debug":{console.debug(...u);break}case"info":{console.log(...u);break}case"warn":{console.warn(...u);break}case"error":{console.error(...u);break}}}a.log=s;function i(...n){s("warn",...n)}a.warn=i;function o(...n){s("debug",...n)}a.debug=o;function l(...n){s("info",...n)}a.info=l;function m(...n){s("error",...n)}a.error=m})(d||(d={}));c();c();c();c();var A=class q extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,q.prototype),this.name=e.name}toString(){return`${this.name}: ${this.message}`}};var O=Promise.resolve(),H=!1,N=!1,M,T={writableDataPath:""};async function X(a){if(M==null)return;H=!0;let e=new Promise((t,r)=>{setTimeout(()=>{r(new A({name:"BlockedIndexedDB",message:"IndexedDB database is blocked"}))},1500)});try{await Promise.race([new Promise((t,r)=>{M?.(a,s=>{if(s!=null){r(s);return}t()})}),e])}finally{H=!1}}async function Y(a){return N||(H?(N=!0,O=O.then(async()=>(N=!1,X(a)))):O=X(a)),O}async function Z(a){T=a,M=FS.syncfs,FS.syncfs=(e,t)=>{let r=t,s=()=>{r()},i=o=>{r(o)};Y(e).then(s).catch(i)};try{FS.mkdir(T.writableDataPath)}catch(e){if(e.code!=="EEXIST")throw M=void 0,e}return FS.mount(IDBFS,{},T.writableDataPath),Y(!0)}c();c();c();c();var B=(a,e)=>(e=Symbol[a])?e:Symbol.for("Symbol."+a);var V=function(a,e){this[0]=a,this[1]=e},Q=(a,e,t)=>{var r=(o,l,m,n)=>{try{var u=t[o](l),h=(l=u.value)instanceof V,C=u.done;Promise.resolve(h?l[0]:l).then(y=>h?r(o==="return"?o:"next",l[1]?{done:y.done,value:y.value}:y,m,n):m({value:y,done:C})).catch(y=>r("throw",y,m,n))}catch(y){n(y)}},s=o=>i[o]=l=>new Promise((m,n)=>r(o,l,m,n)),i={};return t=t.apply(a,e),i[B("asyncIterator")]=()=>i,s("next"),s("throw"),s("return"),i},ee=(a,e,t)=>(e=a[B("asyncIterator")])?e.call(a):(a=a[B("iterator")](),e={},t=(r,s)=>(s=a[r])&&(e[r]=i=>new Promise((o,l,m)=>(i=s.call(a,i),m=i.done,Promise.resolve(i.value).then(n=>o({value:n,done:m}),l)))),t("next"),t("return"),e);var te={};function Ie(a){return[...new Uint8Array(a)].map(e=>{let t=e.toString(16);return t.length===1?`0${t}`:t}).join("")}function be(a){return Q(this,null,function*(){let e=a.getReader();try{for(;;){let{done:t,value:r}=yield new V(e.read());if(t)return;yield r}}finally{e.releaseLock()}})}async function De(a){let e=[],t=0,r=0;try{for(var s=ee(be(a)),i,o,l;i=!(o=await s.next()).done;i=!1){let n=o.value;e.push(n),t+=n.length}}catch(n){l=[n]}finally{try{i&&(o=s.return)&&await o.call(s)}finally{if(l)throw l[0]}}let m=new Uint8Array(t);for(let n of e)m.set(n,r),r+=n.length;return m.buffer}var ve=(a=>(a.VALID="VALID",a.INVALID="INVALID",a.NOT_VERIFIABLE="NOT_VERIFIABLE",a))(ve||{});async function Me(a,e,t){if(typeof crypto.subtle.digest!="function")return d.log(d.Level.Warn,`Insecure context (see https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts): The hash of the Scandit Data Capture library WASM file found at ${t} could not be verified`),"NOT_VERIFIABLE";try{let r=a instanceof Promise?await a:a,s=await crypto.subtle.digest("SHA-256",r),i=Ie(s);return e==null?(d.log(d.Level.Warn,"The library hash is not defined or empty, cannot correctly verify integrity."),"NOT_VERIFIABLE"):i===e?(d.log(d.Level.Debug,`Data Capture library WASM integrity found at ${t} has been verified correctly.`),"VALID"):(d.log(d.Level.Warn,`The Scandit Data Capture library WASM file found at ${t} seems invalid: expected file hash doesn\'t match (received: ${i}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),"INVALID")}catch(r){return d.log(d.Level.Warn,"Wasm response could not be verified",r),"NOT_VERIFIABLE"}}var _=new Map([["br",4.4],["gzip",2.9],["none",1]]);function we(a){var e;let t="content-encoding";if(a==null||a.get(t)==null)return _.get("none");let r=new Set(((e=a.get(t))!=null?e:"").split(",").map(s=>s.trim()));for(let[s,i]of _)if(r.has(s))return i;return _.get("none")}function xe(a){var e,t;if(a==null)return 0;let r=(e=we(a))!=null?e:1,s=Number.parseInt((t=a.get("content-length"))!=null?t:"0",10);return Number.isNaN(s)?0:Math.floor(s*r*100)/100}function Re(a){let{pathname:e}=new URL(a);for(let[t,r]of Object.entries(te))if(e.endsWith(t))return r.bytes;return 0}function ae(a){te=a}var Le=(a,e)=>{let t=xe(e);return t===0?Re(a):t};function ke(a,e,t,{onProgress:r,onError:s,onComplete:i}){if(!e.body)return[e];let o=Le(a,e.headers),l=0,m=0,[n,u]=t?e.body.tee():[e.body],h=n.pipeThrough(new TransformStream({async transform(C,y){try{l+=C.length,m=Number((l/o*100).toFixed(2)),o>0&&C.length>0&&m<100?r?.({percentage:m,loadedBytes:l,privateUri:a}):o===0&&C.length>0&&r?.({percentage:null,loadedBytes:l,privateUri:a}),y.enqueue(C)}catch(b){y.error(b),s?.({error:b})}},flush(C){r?.({percentage:100,loadedBytes:l,privateUri:a}),i?.({percentage:100,loadedBytes:l,privateUri:a}),C.terminate()}}));return[new Response(h,{headers:new Headers(e.headers),status:e.status,statusText:e.statusText}),u]}async function z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,onComplete:s,onError:i,referredOrigin:o}){let l=await fetch(a,{referrerPolicy:"origin",referrer:o??""});if(!l.ok)throw new Error(`HTTP status code is not ok: ${l.status}, ${l.statusText}`);let[m,n]=ke(a,l,t,{onProgress:r,onError:i,onComplete:s});return n!=null&&Me(De(n),e,a),m}function re({wasmURI:a,expectedHash:e,verifyResponseHash:t,progressCallback:r,successCallback:s,importObject:i,referredOrigin:o}){async function l(n){try{let u=await z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,referredOrigin:o}),h=await(n??u).arrayBuffer(),C=await globalThis.WebAssembly.instantiate(h,i);s(C.instance,C.module)}catch(u){d.log(d.Level.Error,u),d.log(d.Level.Error,`Couldn\'t instantiate Scandit SDK DataCapture library at ${a}, did you configure the path for it correctly?`)}}async function m(){let n;try{n=await z({wasmURI:a,expectedHash:e,verifyResponseHash:t,onProgress:r,referredOrigin:o});let u=await globalThis.WebAssembly.instantiateStreaming(n,i);s(u.instance,u.module)}catch(u){d.log(d.Level.Warn,u),d.log(d.Level.Warn,"WebAssembly streaming compile failed. Falling back to ArrayBuffer instantiation (this will make things slower)"),l(n?.bodyUsed===!0?void 0:n)}}typeof globalThis.WebAssembly.instantiateStreaming=="function"?m():l()}async function J(a,e,t,r){return new Promise((s,i)=>{a().then(s).catch(o=>{let l=e*2;if(l>t){i(o);return}r(o),globalThis.setTimeout(()=>{J(a,l,t,r).then(s).catch(i)},e)})})}function U(a){var e,t;let r="";if((e=a.href)!=null&&e.startsWith("blob:null/"))r="localhost";else{let s=((t=a.pathname)==null?void 0:t.length)>1&&!a.pathname.startsWith("/");r=new URL(s?a.pathname:a.origin).hostname}return r.startsWith("[")&&r.endsWith("]")&&(r=r.slice(1,-1)),r}async function se(a,e){async function t(){return importScripts(a)}try{await J(t,250,4e3,s=>{d.log(d.Level.Warn,s),d.log(d.Level.Warn,`Couldn\'t retrieve Scandit Data Capture library at ${a}, retrying...`)}),self.Module.mainScriptUrlOrBlob=a;let r=globalThis.SDC_WASM_JS_VERSION;return r!==e&&d.log(d.Level.Warn,`The Scandit Data Capture library JS file found at ${a} seems invalid: expected version doesn\'t match (received: ${r}, expected: ${e}). Please ensure the correct Scandit Data Capture file (with correct version) is retrieved.`),!0}catch(r){return d.log(d.Level.Error,r),!1}}c();function Ae(a){return/^https?:\\/\\/(?:[^./]*\\.)*cdn.jsdelivr.net\\//.test(a)?{result:!0,cdnBaseURL:"https://cdn.jsdelivr.net/npm/"}:/^https?:\\/\\/(?:[^./]*\\.)*unpkg.com\\//.test(a)?{result:!0,cdnBaseURL:"https://unpkg.com/"}:{result:!1,cdnBaseURL:""}}function Oe(a){let e=/@scandit\\/web-datacapture-[a-z]+/i.exec(a);return e?e[0]:null}function ie(a,e,t){let r=e,s=Ae(r);if(s.result){let o=Oe(r);o!=null&&(r=`${s.cdnBaseURL}${o}@${a}/sdc-lib/`)}let i=t.replace(".wasm","");return s.result?{jsURI:`${r}${i}.js`,wasmURI:`${r}${i}.wasm`}:{jsURI:`${r}${i}.js?v=${a}`,wasmURI:`${r}${i}.wasm?v=${a}`}}c();var F;(a=>{function e(){return"7.2.4"}a.sdkVersion=e})(F||(F={}));c();var ne=class{constructor(){this.promise=new Promise((a,e)=>{this.reject=e,this.resolve=a})}};c();var Fe=async()=>WebAssembly.validate(new Uint8Array([0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11])),Ee=()=>(async a=>{try{return typeof MessageChannel<"u"&&new MessageChannel().port1.postMessage(new SharedArrayBuffer(1)),WebAssembly.validate(a)}catch{return!1}})(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]));function Pe(){return typeof crossOriginIsolated>"u"?!1:crossOriginIsolated}function We(){try{return new WebAssembly.Memory({initial:1,maximum:1,shared:!0}).buffer.constructor.name==="SharedArrayBuffer"}catch{return!1}}async function oe(){return Fe()}async function Ne(){if(!await Ee())return!1;let a=null;try{a=new Worker(URL.createObjectURL(new Blob([\'postMessage("Worker" in self);\'],{type:"text/javascript"})),{name:"nestedWorkerTest"})}catch{return!1}return new Promise(e=>{if(a==null){e(!1);return}a.onmessage=t=>{a?.terminate(),e(t.data)}})}async function de(){let a=await Ne();return Pe()&&We()&&a}var le=class ue{constructor(e,t){this.hintPresenterV2=null,this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL=10,this.redrawInterval=1e3/30,this.redrawRequests=[],this._isDrawLoopRunning=!1,this.frameDataPool=new Map,this.lastFrameCounter=-1,this.poorMansBenchmarkLogs=!1,this.writableDataPathStandard="/scandit_sync_folder",this.resourceFilesSubfolder="resources",this.performanceMetricsReporterTimer=void 0,this.performanceMetrics={frameDataPoolSize:0,processedFramesCount:0,redrawRequestsCount:0,actualRedrawsCount:0},this.gestureListener=null,this.webPlatformHintPresenter=null,this.moduleHandler=e,this.workerFunctions=t,this._loadProgressCallback=this._loadProgressCallback.bind(this),ae(this.getWasmMetadata())}get Module(){return this.moduleHandler.get()}set isDrawLoopRunning(e){this._isDrawLoopRunning=e,!e&&typeof this.loopTimeoutId=="number"&&(clearTimeout(this.loopTimeoutId),this.loopTimeoutId=void 0)}get isDrawLoopRunning(){return this._isDrawLoopRunning}convertToLoadableFrameData(e){let t=this.getNextFrameId();this.frameDataPool.set(t,new Uint8ClampedArray(e.getFrameData()));let r=this.lastUsedModuleMirrorAxis==null?!1:this.lastUsedModuleMirrorAxis!==this.Module.Axis.None;return{frameId:t,width:e.getWidth(),height:e.getHeight(),isFrameSourceMirrored:r}}createContext(e){var t,r,s,i,o;let l=this.getModeDeserializers(),m=U(location);(m==="localhost"||m==="127.0.0.1")&&navigator.userAgent.includes("Electron")&&e.appName!=null&&(m+=`-${e.appName}`),this.parentDomain=e.parentDomain,this.contextDeserializer=new this.Module.DataCaptureContextDeserializer(this.writableDataPath,e.deviceId,e.context.deviceModelName,m,this.parentDomain,l,e.delayedRegistration,e.highEndBlurryRecognition,this.resourcePath);let n=this.contextDeserializer.contextFromJson(JSON.stringify(e.context));if(n==null){let p=this.contextDeserializer.getLastError();throw new Error(`Could not create the context: ${p}`)}let u=n.getView();this.context=n.getContext(),n.delete();let h=this.Module.DataCaptureContextListener.extend("DataCaptureContextListener",{didChangeStatus:(p,S)=>{this.contextDidChangeStatus(JSON.parse(S.toJson())),p.delete()},didStartObservingContext:p=>{this.didStartObservingContext(),p.delete()},didStopObservingContext:p=>{p.delete()}}),C=this.Module.DataCaptureContextFrameListener.extend("DataCaptureContextFrameListener",{onObservationStarted:p=>{p.delete()},onObservationStopped:p=>{p.delete()},onFrameProcessingStarted:(p,S)=>{this.workerFunctions.postMessage({type:"onFrameProcessingStarted"}),S.delete(),p.delete()},onFrameProcessingFinished:(p,S)=>{this.workerFunctions.postMessage({type:"onFrameProcessingFinished"}),S.delete(),p.delete()},onFrameSkipped:(p,S)=>{this.workerFunctions.postMessage({type:"onFrameSkipped"}),S.delete(),p.delete()}}),y=this.Module.GestureRecognizer.extend("GestureRecognizer",{setGestureListener:(p,S)=>{var L;(L=this.gestureListener)==null||L.delete(),this.gestureListener=p.clone(),p.delete()}});(t=this.gestureRecognizer)==null||t.delete(),this.gestureRecognizer=new y;let b=new h;this.context.addListener(b),b.delete();let D=new C;this.context.addFrameListener(D),D.delete(),this.setView(u),(r=this.view)==null||r.setGestureRecognizer(this.gestureRecognizer);let v=this.Module.PlatformHintPresenter.extend("PlatformHintPresenter",{setHintPresenter:p=>{p.delete()},showToast:p=>{this.workerFunctions.postMessage({type:"showToast",payload:JSON.parse(p)})},hideToast:p=>{this.workerFunctions.postMessage({type:"hideToast",payload:JSON.parse(p)})},showGuidance:p=>{this.workerFunctions.postMessage({type:"showGuidance",payload:JSON.parse(p)})},hideGuidance:p=>{this.workerFunctions.postMessage({type:"hideGuidance",payload:JSON.parse(p)})},startUpdateTimer:p=>{this.workerFunctions.postMessage({type:"startUpdateTimer",payload:{duration:{unit:"ms",value:p}}})},stopUpdateTimer:()=>{this.workerFunctions.postMessage({type:"stopUpdateTimer"})}});(s=this.hintPresenterV2)==null||s.delete(),(i=this.webPlatformHintPresenter)==null||i.delete(),this.webPlatformHintPresenter=new v,this.hintPresenterV2=new this.Module.HintPresenterV2(this.webPlatformHintPresenter),(o=this.view)==null||o.setHintPresenterV2(this.hintPresenterV2)}onTap(e){var t;(t=this.gestureListener)==null||t.onTap(JSON.stringify(e))}hintPresenterV2Update(){var e;(e=this.hintPresenterV2)==null||e.update()}startReportingPerformanceMetrics(){this.performanceMetricsReporterTimer==null&&(this.performanceMetricsReporterTimer=setInterval(()=>{this.reportPerformanceMetrics();for(let e of Object.keys(this.performanceMetrics))this.performanceMetrics[e]=0},1e3))}async reportPerformanceMetrics(){this.workerFunctions.postMessage({type:"performanceMetricsReport",payload:{...this.performanceMetrics}})}deleteFrameData(e){this.frameDataPool.delete(e)}dispose(){var e,t;this.context.dispose(),this.frameDataPool.clear(),this.isDrawLoopRunning=!1,this.lastFrameCounter=-1,(e=this.gestureRecognizer)==null||e.delete(),this.gestureRecognizer=null,(t=this.gestureListener)==null||t.delete(),this.gestureListener=null}flushAnalytics(){this.context.flushAnalytics()}extractCentaurusLicense(e){return{payload:{centaurus:{licenseKey:this.Module.LicenseUtils[ue.get3dPartyLicenseKeyMethodName](e)}}}}getModeDeserializers(){return new this.Module.VectorDataCaptureModeDeserializer}loadLibrary(e){return this.libraryLoadingPromise!=null?this.libraryLoadingPromise:(this.libraryLoadingPromise=this.setup(e),this.libraryLoadingPromise)}processFrame(e){var t;if(this.context==null)return{payload:e,transferables:[e.data.buffer]};let r=e.data,s=e.colorType==="GRAYSCALE"?this.Module.ImageBufferFormat.Grayscale8:this.Module.ImageBufferFormat.Rgba8888,i=this.Module.allocateUint8Array(r.byteLength);return this.Module.HEAPU8.set(r,i),(t=this.imageFrameSource)==null||t.outputFrame(i,e.width,e.height,s),{payload:e,transferables:[e.data.buffer]}}reportCameraProperties(e){this.context.setCameraProperties(e.deviceId,e.isFrontFacing,e.hasAutofocus)}requestFrameData(e){let t=this.frameDataPool.get(e);return t==null?{payload:{data:null}}:{payload:{data:t},transferables:[t.buffer]}}scheduleRedraw(e,t){this.addRedrawRequest(t),this.isDrawLoopRunning||this.startDrawLoop(e)}sendViewRefreshCommands(e){this.workerFunctions.postMessage({type:"draw",payload:e},[e.buffer])}setFrameSource(e,t){var r;this.lastUsedModuleMirrorAxis=this.mapMirrorAxisOnModule(e),(r=this.imageFrameSource)==null||r.delete(),this.imageFrameSource=new this.Module.ImageBufferFrameSource(this.lastUsedModuleMirrorAxis,t,0),this.context.setFrameSource(this.imageFrameSource)}startDrawLoop(e){this.isDrawLoopRunning=!0;let t=i=>this.redrawRequests.length>0&&this.redrawRequests[0]<=i,r=i=>{for(;this.redrawRequests.length>0&&this.redrawRequests[0]<=i;)this.redrawRequests.shift()},s=()=>{this.loopTimeoutId=setTimeout(()=>{if(!this.isDrawLoopRunning)return;let i=performance.now();if(t(i)){r(i),e.draw();let o=e.getDrawCommands();this.sendViewRefreshCommands(new Uint8Array(o))}s()},this.redrawInterval)};s()}updateContext(e){if(this.context!=null&&this.contextDeserializer!=null){e.view!=null&&!e.view.visible&&this.context.flushAnalytics();let t=this.onBeforeUpdateContextHook(e),r=this.contextDeserializer.updateContextFromJson(this.context,this.view,JSON.stringify(t.context));if(r==null){let i=this.contextDeserializer.getLastError();throw new Error(`Could not update the context: ${i}`)}this.context.delete(),this.context=r.getContext();let s=r.getView();r.delete(),s!=null&&t.view!=null&&s.setViewSize(t.view.width,t.view.height,t.view.orientation),this.hintPresenterV2!=null&&s?.setHintPresenterV2(this.hintPresenterV2),this.gestureRecognizer!=null&&s?.setGestureRecognizer(this.gestureRecognizer),this.setView(s),d.debug("context updated",t)}}onBeforeUpdateContextHook(e){return e}onDocumentVisibilityChange(e){e==="hidden"&&this.context.flushAnalytics()}isFeatureSupported(e){return{payload:{supported:this.context.isFeatureSupported(e)}}}getViewfinderInfo(){var e,t;return{payload:{isDisplayingViewfinder:(t=(e=this.view)==null?void 0:e.isDisplayingViewfinder())!=null?t:!1,rect:JSON.parse(this.view.getViewfinderRect())}}}getOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.OpenSourceSoftwareLicenseInfo.getLicenseText()}}}getNextFrameId(){return this.lastFrameCounter++,this.lastFrameCounter>=this.MAX_NUMBER_OF_IMAGES_IN_FRAME_DATA_POOL&&(this.lastFrameCounter=0),this.lastFrameCounter}getWasmDynamicLibraries(e){return this.getWasmSideModuleFileName()==null?[]:[`${e.replace(/\\/[^/]*$/,"/")}${this.getWasmSideModuleFileName()}`]}getWasmCoreExpectedHash(e,t){return t?e?"bc70b7cb2f663d117b16e552b40255e2adf6246306c9272d02179d2f38384fe5":"d165c9dac32b9743646b0a2a320fa40e37df75e77aa28aabdb119f4893562740":e?"e63c048d917f9504cbc8a4669db3f5ed3593b8a0f3a6240651c38cc14d4924e0":""}getWasmCoreFileName(e,t){return t?e?"scandit-datacapture-sdk-id-simd-pthreads.wasm":"scandit-datacapture-sdk-id-pthreads.wasm":e?"scandit-datacapture-sdk-id-simd.wasm":""}getWasmMetadata(){return g}getWasmSideModuleFileName(){return""}_loadProgressCallback(e){this.workerFunctions.postMessage({type:"loadLibraryProgress",payload:e})}addRedrawRequest(e){this.redrawRequests.push(Math.round(performance.now())+e),this.redrawRequests.sort((t,r)=>t-r)}contextDidChangeStatus(e){e.code===260?e.message=e.message.replace("domain name",`domain name (${U(location)})`):e.code===265&&(e.message=e.message.replace("domain name",`domain name (${this.parentDomain})`)),this.workerFunctions.postMessage({type:"contextDidChangeStatus",payload:e})}didStartObservingContext(){this.workerFunctions.postMessage({type:"didStartObservingContext"})}mapMirrorAxisOnModule(e){switch(e){case"None":return this.Module.Axis.None;case"X":return this.Module.Axis.X;case"Y":return this.Module.Axis.Y;default:return this.Module.Axis.None}}setView(e){this.view=e,this.setViewRefreshHandler(e),e==null&&(this.isDrawLoopRunning=!1,this.sendViewRefreshCommands(new Uint8Array([])))}addNativeOverlay(e){d.warn("addNativeOverlay has not been implemented for this module",e)}removeNativeOverlay(e){d.warn("removeNativeOverlay has not been implemented for this module",e)}setViewRefreshHandler(e){if(e==null||e.isViewRefreshHandlerSet)return;let t=this.Module.NeedsRedrawDelegate.extend("NeedsRedrawDelegate",{setNeedsRedrawIn:this.scheduleRedraw.bind(this,e)}),r=new t;e.setNeedsRedrawDelegate(r),e.isViewRefreshHandlerSet=!0}setupDataDecoding(){let e=this.moduleHandler.get(),t=e.DataDecoding.extend("DataDecoding",{decode(r,s){try{let i=JSON.parse(s),o=[];for(let l of i){let m=new TextDecoder(l.ianaName,{fatal:!0});o.push(m.decode(r.slice(l.startIndex,l.endIndex)))}return o.join("")}catch{return""}}});e.setDataDecoding(new t)}start(e,t,r){e&&t&&(this.setupDataDecoding(),this.moduleHandler.get().callMain(),this.moduleHandler.get().__emscripten_proxy_main!==void 0||r())}getWritableDataPath(e){return e!=null?(d.debug(`IndexedDB database name override in use to recover from blocked standard database: ${e}`),e):this.writableDataPathStandard}numOfMBToPages(e){return Math.ceil(1024*e*1024/64/1024)}async setup({libraryLocation:e,locationPath:t,writableDataPathOverride:r,overrideThreadsSupport:s,overrideSimdSupport:i,verifyResponseHash:o,referredOrigin:l,fixedWasmMemory:m}){var n;let u=!1,h=!1;this.writableDataPath=this.getWritableDataPath(r),this.resourcePath=`${e}${this.resourceFilesSubfolder}/`,globalThis.path=t;let{resolve:C,reject:y,promise:b}=new ne,D=F.sdkVersion();if(D==="")throw new A({name:"Invalid library version",message:"Library version is not defined or empty, cannot generate proper path to library files."});let[v,p]=await Promise.all([oe(),de()]);s!=="auto"&&(p=s==="on"),i!=="auto"&&(v=i==="on");let S=this.getWasmCoreFileName(v,p),L=ie(D,e,S),{jsURI:W,wasmURI:G}=L,Ce={instantiateWasm:(I,fe)=>(re({importObject:I,wasmURI:G,expectedHash:this.getWasmCoreExpectedHash(v,p),verifyResponseHash:o,successCallback:fe,progressCallback:this._loadProgressCallback,referredOrigin:l}),{})},k=m===null?null:new WebAssembly.Memory({initial:this.numOfMBToPages(m),maximum:this.numOfMBToPages(300),shared:p});return k!==null&&d.log(d.Level.Debug,"Fixed wasmMemory set",k),this.moduleHandler.set({...k?{wasmMemory:k}:{},mainScriptUrlOrBlob:W,canvas:(n=this.workerFunctions.getOffscreenCanvas())!=null?n:{getContext:()=>null},...Ce,dynamicLibraries:this.getWasmDynamicLibraries(G),locateFile:I=>e+I,noInitialRun:!0,preRun:[async()=>{try{await Z({writableDataPath:this.writableDataPath})}catch(I){if(I.name==="BlockedIndexedDB"){y(I.toString());return}d.log(d.Level.Debug,"No IndexedDB support, some data will not be persisted:",I)}h=!0,this.start(h,u,C)}],onMainComplete:()=>{if([u,h].includes(!1)){d.log(d.Level.Warn,{runtimeLoaded:u,fileSystemSynced:h},"Both runtimeLoaded and fileSystemSynced should be true when calling onMainComplete"),y("onMainComplete has been called but runtime or file system was not ready.");return}C()},onRuntimeInitialized:()=>{u=!0,this.start(h,u,C)},print:I=>{d.log(d.Level.Info,I)}}),await se(W,D)||y(`Couldn\'t retrieve Scandit Data Capture library at ${W}, did you configure the path for it correctly?`),b}};le.get3dPartyLicenseKeyMethodName=atob("Z2V0QmxpbmtJZExpY2Vuc2VLZXk=");var w=le;c();c();function x(a){return typeof a=="object"&&a!=null}function R(a){if(typeof a=="string")return a;if(x(a)){if(typeof a.message=="string")return a.message}else if(typeof a?.toString=="function")return a.toString();return"unknown error"}c();function ce(a){return typeof a=="object"&&a!=null&&a.document==null&&"addEventListener"in a&&typeof a.importScripts=="function"}c();function pe(a){console.warn("Reached unexpected case",a)}var $=class{constructor(a,e){this.onMessageListener=this.onMessage.bind(this),this.workerSelf=a,this.dataCaptureInstance=new w(e,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)}),ce(a)&&this.listenToMessages()}listenToMessages(){this.workerSelf.addEventListener("message",this.onMessageListener),this.workerSelf.addEventListener("error",a=>{d.log(d.Level.Error,a)}),this.workerSelf.addEventListener("messageerror",a=>{d.log(d.Level.Error,a)})}postMessage(a,e){this.workerSelf.postMessage(a,e??[])}getOffscreenCanvas(){if(typeof this.workerSelf.OffscreenCanvas=="function")return new this.workerSelf.OffscreenCanvas(32,32)}hasPayload(a){return x(a)&&"payload"in a}hasTransferables(a){return x(a)&&Array.isArray(a.transferables)}async respondWith(a,e,t){let r=null,s;try{s=t(),s instanceof Promise&&(s=await s)}catch(o){s=void 0,r=R(o)}let i={type:"workerTaskId",command:a,id:e,payload:this.hasPayload(s)?s.payload:void 0};r!=null&&(i.error=r),this.postMessage(i,this.hasTransferables(s)?s.transferables:[])}onMessage(a){switch(a.data.command){case"loadLibrary":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.loadLibrary({libraryLocation:e.libraryLocation,locationPath:e.locationPath,referredOrigin:e.referredOrigin,writableDataPathOverride:e.writableDataPathOverride,overrideThreadsSupport:e.overrideThreadsSupport,overrideSimdSupport:e.overrideSimdSupport,verifyResponseHash:e.verifyResponseHash,fixedWasmMemory:e.fixedWasmMemory}))}break}case"onTap":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.onTap(e.point)})}break}case"hintPresenterV2update":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>{this.dataCaptureInstance.hintPresenterV2Update()})}break}case"createContext":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.createContext({context:e.context,deviceId:e.deviceId,delayedRegistration:e.delayedRegistration,highEndBlurryRecognition:e.highEndBlurryRecognition,appName:e.appName,parentDomain:e.parentDomain}))}break}case"setFrameSource":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.setFrameSource(e.mirrorAxis,e.isCameraFrameSource))}break}case"processFrame":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.processFrame({data:e.data,width:e.width,height:e.height,colorType:e.colorType}))}break}case"requestFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.requestFrameData(e.frameId))}break}case"deleteFrameData":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.deleteFrameData(e.frameId)})}break}case"updateContext":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.updateContext(e))}break}case"dispose":{this.respondWith(a.data.command,a.data.id,()=>this.dataCaptureInstance.dispose());break}case"flushAnalytics":{this.respondWith(a.data.command,a.data.id,()=>{this.dataCaptureInstance.flushAnalytics()});break}case"reportCameraProperties":{{let{data:e}=a;this.respondWith(e.command,e.id,async()=>this.dataCaptureInstance.reportCameraProperties(e))}break}case"setLogLevel":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{d.setLevel(e.level)})}break}case"extractCentaurusLicense":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.extractCentaurusLicense(e.licenseKey))}break}case"documentVisibility":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>{this.dataCaptureInstance.onDocumentVisibilityChange(e.state)})}break}case"isFeatureSupported":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.isFeatureSupported(e.feature))}break}case"getViewfinderInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getViewfinderInfo())}break}case"getOpenSourceSoftwareLicenseInfo":{{let{data:e}=a;this.respondWith(e.command,e.id,()=>this.dataCaptureInstance.getOpenSourceSoftwareLicenseInfo())}break}case"addNativeOverlay":this.dataCaptureInstance.addNativeOverlay(a);break;case"removeNativeOverlay":this.dataCaptureInstance.removeNativeOverlay(a);break;default:return pe(a.data),!1}return!0}};c();c();c();c();function me(a){return a.ok()}function he(a,e){return me(a)?a.value():e}function ge(a,e){return me(a)?e:a.error()}function f(a,e){return a===void 0?e:a}function j(a){if(typeof a=="string")try{return JSON.parse(a)}catch{return null}return null}var E=class extends w{constructor(t,r){super(t,r);this.lastIdCaptureModeSerializedSettings=""}processFrame(t){return this.idCaptureMode.isReadyToProcessFrame()?super.processFrame(t):{payload:t,transferables:[t.data.buffer]}}updateContext(t){super.updateContext(t),this.idCaptureMode.start()}idCaptureSetLastResult(t){this.idCaptureMode.setLastResult(t)}idCaptureSetLastError(t){this.idCaptureMode.setLastError(t)}idCaptureSetLastLocalizedId(t){this.idCaptureMode.setLastLocalizedId(t)}idCaptureSetLastDetectionIssue(t){this.idCaptureMode.setLastDetectionIssue(t)}async idCaptureReset(){this.idCaptureMode.reset()}async idCaptureApplySettings(t){return this.idCaptureMode.applySettings(t)}async idCaptureParse(t){return{payload:{result:this.idCaptureMode.parse(t)}}}async idCaptureBarcodeVerifyAamvaCapture(t,r){return{payload:{result:await this.idCaptureMode.idCaptureBarcodeVerifyAamvaCapture(t,r)}}}idCaptureDataConsistencyVerifyCapture(t){return{payload:{result:this.idCaptureMode.idCaptureDataConsistencyVerifyCapture(t)}}}idCaptureDrivingLicenseDetailsCreateWithBlinkIdData(t,r,s){let i=this.Module.DrivingLicenseDetails.createWithBlinkIdData(t,r,s);return{payload:{result:JSON.parse(i)}}}getIdOpenSourceSoftwareLicenseInfo(){return{payload:{licenseText:this.Module.IdOpenSourceSoftwareLicenseInfo.getLicenseText()}}}idCaptureReportSafariAbruptReload(t){this.idCaptureMode.reportSafariAbruptReload(t)}getModeDeserializers(){this.idCaptureMode=new K(this,this.Module,this.workerFunctions),this.idCaptureMode.start();let t=super.getModeDeserializers();return t.push_back(this.idCaptureMode.getDeserializer()),t}getWasmSideModuleFileName(){return""}getWasmCoreFileName(t,r){return r?t?"scandit-datacapture-sdk-id-simd-pthreads.wasm":"scandit-datacapture-sdk-id-pthreads.wasm":t?"scandit-datacapture-sdk-id-simd.wasm":"scandit-datacapture-sdk-id.wasm"}getWasmCoreExpectedHash(t,r){return r?t?"bc70b7cb2f663d117b16e552b40255e2adf6246306c9272d02179d2f38384fe5":"d165c9dac32b9743646b0a2a320fa40e37df75e77aa28aabdb119f4893562740":t?"e63c048d917f9504cbc8a4669db3f5ed3593b8a0f3a6240651c38cc14d4924e0":"daaac562a2e3f8862cb505090fcf48bf5205c4269d1e867f1dc11350e9d692dd"}getWasmMetadata(){return g}},K=class{constructor(e,t,r){this.SDCIdCaptureMode=null;this.listenerSet=!1;this.lastResult="";this.lastError="";this.lastLocalizedId="";this.lastDetectionIssue="";this._state="initial";this.coreEngine=e,this.Module=t,this.workerFunctions=r,this.state="created"}get state(){return this._state}set state(e){this._state=e}isReadyToProcessFrame(){return this.state==="started"}setLastResult(e){this.lastResult=e}setLastError(e){this.lastError=e}setLastLocalizedId(e){this.lastLocalizedId=e}setLastDetectionIssue(e){this.lastDetectionIssue=e}async applySettings(e){this.SDCIdCaptureMode?.applySettings(JSON.stringify(e))}reset(){this.SDCIdCaptureMode?.reset()}parse(e){if(this.SDCIdCaptureMode){let t=this.SDCIdCaptureMode.parse(e);if(t.ok()){let r=he(t,null);if(r!=null){let s=this.extractCaptureId(r);if(s!=null)return{status:"success",capturedId:s}}}else return{status:"error",error:ge(t,"Undefined error")}}return null}idCaptureDataConsistencyVerifyCapture(e){let r=new this.Module.DataConsistencyVerifier(this.coreEngine.context).verify(JSON.stringify(e));if(r==null)return null;let s=JSON.parse(r.toJson());return r.delete(),s}async idCaptureBarcodeVerifyAamvaCapture(e,t){return new Promise(r=>{let s=this.Module.AamvaBarcodeVerifier.extend("AamvaBarcodeVerifier",{retriggerVerificationIn(o){setTimeout(()=>{i.startVerification(JSON.stringify(e))},o)},verificationEnded(){let o=i.getBarcodeVerificationResponse();r({isSuccess:o.isSuccess,error:o.error,allChecksPassed:o.allChecksPassed,serverResponseJSON:o.serverResponseJson})}}),i=new s;i.initialize(this.coreEngine.context,t??""),i.startVerification(JSON.stringify(e))})}start(){if(this.initHintPresenterIfNotInitialized(),this.state==="started")return;let e=this.Module.IdCaptureListener.extend("IdCaptureListener",{onSessionUpdated:(n,u)=>{n.delete(),u.delete()},onIdCaptured:(n,u)=>{this.onIdCapturedCallback(u),n.delete(),u.delete()},onIdRejected:(n,u,h)=>{this.onIdRejectedCallback(u,h),n.delete(),u.delete()},onShutterButtonPositionChanged:n=>{this.onShutterButtonPositionChangedCallback(n)},onShutterButtonStateChanged:n=>{this.onShutterButtonStateChangedCallback(n)}}),t=this.Module.Feedback.extend("Feedback",{emit:()=>{this.workerFunctions.postMessage({type:"idCaptureIdCapturedFeedback"})}}),r=this.Module.Feedback.extend("Feedback",{emit:()=>{this.workerFunctions.postMessage({type:"idCaptureIdRejectedFeedback"})}}),s=this.Module.IdCaptureDeserializerListener.extend("IdCaptureDeserializerListener",{onModeDeserializationFinished:(n,u,h)=>{if(!this.listenerSet){let C=new e;u.addListener(C),C.delete(),this.listenerSet=!0,u.setFeedbacks(new t,new r)}n.delete(),u.delete(),h.delete()},onModeDeserializationStarted(n,u,h){n.delete(),u.delete(),h.delete()},onSettingsDeserializationStarted(n,u,h){n.delete(),u.delete(),h.delete()},onSettingsDeserializationFinished(n,u,h){n.delete(),u.delete(),h.delete()}}),i=this.Module.IdCaptureBackend.extend("IdCaptureBackend",{getLastError:()=>this.lastError,getLastResult:()=>this.lastResult,getLocalizedOnlyId:()=>this.lastLocalizedId,getLastIssue:()=>this.lastDetectionIssue,processFrame:(n,u,h,C)=>{},reset:this.onResetFromSDC.bind(this),setDetectionOnlyMode:this.setDetectionOnlyMode.bind(this)}),o=this.Module.IdCaptureDeserializerHelper.extend("IdCaptureDeserializerHelper",{createMode:(n,u)=>{this.SDCIdCaptureMode!=null&&this.SDCIdCaptureMode.delete();let h=new i;return this.SDCIdCaptureMode=new this.Module.IdCapture(n,h,u,null),h.delete(),n.delete(),u.delete(),this.SDCIdCaptureMode}}),l=new o;this.idCaptureDeserializer=new this.Module.IdCaptureDeserializer(l),l.delete();let m=new s;this.idCaptureDeserializer.setListener(m),m.delete(),this.state="started"}onResetFromSDC(e){this.workerFunctions.postMessage({type:"idCaptureBackendReset",payload:{hardReset:e}}),this.lastError="",this.lastResult="",this.lastLocalizedId=""}setDetectionOnlyMode(e){this.workerFunctions.postMessage({type:"idCaptureDetectionOnlyMode",payload:{detectionOnlyMode:e}})}onIdCapturedCallback(e){let t=this.extractCaptureId(e);t&&this.workerFunctions.postMessage({type:"idCaptureDidCaptureId",payload:{capturedId:t}},this.extractImageTransferablesFromCapturedId(t))}onIdRejectedCallback(e,t){let r=this.extractCaptureId(e);this.workerFunctions.postMessage({type:"idCaptureDidRejectId",payload:{capturedId:r,rejectionReason:t}},r?this.extractImageTransferablesFromCapturedId(r):[])}extractCaptureId(e){if(e==null)return null;let t=e.getImages(),r=t.getFrameFront(),s=t.getFrameBack(),i=f(t.getFace(),null),o=f(t.getCroppedDocumentFront(),null),l=f(t.getCroppedDocumentBack(),null),m={front:{face:i,croppedDocument:o,frame:{data:r?new Uint8ClampedArray(r.getFrameData()):null,width:r?.getWidth()??0,height:r?.getHeight()??0,mirrorAxis:r?.getMirrorAxis().value??0,orientation:r?.getOrientation()??0}},back:{face:null,croppedDocument:l,frame:{data:s?new Uint8ClampedArray(s.getFrameData()):null,width:s?.getWidth()??0,height:s?.getHeight()??0,mirrorAxis:s?.getMirrorAxis().value??0,orientation:s?.getOrientation()??0}}};r?.delete(),s?.delete(),t.delete();let n=JSON.parse(e.toJson());return{...{firstName:f(e.getFirstName(),""),lastName:f(e.getLastName(),""),secondaryLastName:f(e.getSecondaryLastName(),""),fullName:e.getFullName(),sex:f(e.getSex(),""),age:f(e.getAge(),null),isExpired:f(e.isExpired(),null),nationality:f(e.getNationality(),""),address:f(e.getAddress(),""),issuingCountry:f(e.getIssuingCountry(),""),issuingCountryIso:f(e.getIssuingCountryIso(),""),documentNumber:f(e.getDocumentNumber(),""),documentAdditionalNumber:f(e.getDocumentAdditionalNumber(),""),dateOfBirth:j(f(e.getDateOfBirth(),null)),dateOfExpiry:j(f(e.getDateOfExpiry(),null)),dateOfIssue:j(f(e.getDateOfIssue(),null)),documentType:f(e.getDocumentType(),null),documentSubtype:f(e.getDocumentSubtype(),null)},...n,imageInfo:null,rawImageInfo:m}}onShutterButtonPositionChangedCallback(e){this.workerFunctions.postMessage({type:"idCaptureDidShutterButtonPositionChanged",payload:{position:JSON.parse(e)}})}onShutterButtonStateChangedCallback(e){this.workerFunctions.postMessage({type:"idCaptureDidShutterButtonStateChanged",payload:{state:e}})}async reportSafariAbruptReload(e){let t=new this.Module.OutOfMemoryAnalyticsData(e.framesProcessedCount,e.didCaptureCount,e.didRejectCount,e.applySettingsCount,e.upTime,e.videoResolution,e.parentDomain,e.centaurusEnabled);this.Module.OutOfMemoryAnalyticsHelper.storeAnalyticsEvent(this.coreEngine.context,t),t.delete()}parseIdCaptureSession(e){return JSON.parse(e.toJson())}getDeserializer(){return this.idCaptureDeserializer}dispose(){this.state==="started"&&(this.idCaptureDeserializer.delete(),this.lastError="",this.lastLocalizedId="",this.lastResult="",this.listenerSet=!1,this.state="disposed")}restart(){this.dispose(),this.start()}extractImageTransferablesFromCapturedId(e){let t=[];return e.rawImageInfo.front.frame.data&&e.rawImageInfo.front.frame.data.length>0&&t.push(e.rawImageInfo.front.frame.data.buffer),e.rawImageInfo.back.frame.data&&e.rawImageInfo.back.frame.data.length>0&&t.push(e.rawImageInfo.back.frame.data.buffer),t}isReadyToDisplayHints(){return this.coreEngine.view?this.coreEngine.view.hintPresenterInitialized():!1}initHintPresenterIfNotInitialized(){if(this.isReadyToDisplayHints())return;let e=this.Module.HintPresenter.extend("HintPresenter",{showHint:(t,r)=>{this.workerFunctions.postMessage({type:"showHint",payload:{text:t,style:JSON.parse(r)}})},updateHint:t=>{this.workerFunctions.postMessage({type:"updateHint",payload:{style:JSON.parse(t)}})},hideHint:()=>{this.workerFunctions.postMessage({type:"hideHint",payload:{}})}});this.coreEngine.view?.setHintPresenter(new e)}};var P=class extends ${constructor(e,t){super(e,t),this.dataCaptureInstance=new E(t,{postMessage:this.postMessage.bind(this),getOffscreenCanvas:this.getOffscreenCanvas.bind(this)})}async respondWith(e,t,r){let s=null,i;try{i=r(),i instanceof Promise&&(i=await i)}catch(l){d.log(d.Level.Debug,l),i=void 0,s=R(l)}let o={type:"workerTaskId",command:e,id:t,payload:this.hasPayload(i)?i.payload:void 0};s!=null&&(o.error=s),this.postMessage(o,this.hasTransferables(i)?i.transferables:[])}onMessage(e){switch(e.data.command){case"idCaptureSetLastResult":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastResult(t.result)}),!0}case"idCaptureSetLastError":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastError(t.error)}),!0}case"idCaptureSetLastLocalizedId":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastLocalizedId(t.localizedId)}),!0}case"idCaptureSetLastDetectionIssue":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>{this.dataCaptureInstance.idCaptureSetLastDetectionIssue(t.issue)}),!0}case"idCaptureReset":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureReset()),!0}case"idCaptureApplySettings":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureApplySettings(t.settings)),!0}case"idCaptureParse":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureParse(t.code)),!0}case"idCaptureBarcodeVerifyAamvaCapture":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureBarcodeVerifyAamvaCapture(t.capturedId,t.endpoint)),!0}case"idCaptureDataConsistencyVerifyCapture":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureDataConsistencyVerifyCapture(t.capturedId)),!0}case"idCaptureDrivingLicenseDetailsCreateWithBlinkIdData":{let{data:t}=e;return this.respondWith(t.command,t.id,async()=>this.dataCaptureInstance.idCaptureDrivingLicenseDetailsCreateWithBlinkIdData(t.details.vehicleClass,t.details.restrictions,t.details.endorsements)),!0}case"getIdOpenSourceSoftwareLicenseInfo":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>this.dataCaptureInstance.getIdOpenSourceSoftwareLicenseInfo()),!0}case"idCaptureReportSafariAbruptReload":{let{data:t}=e;return this.respondWith(t.command,t.id,()=>this.dataCaptureInstance.idCaptureReportSafariAbruptReload(t.environmentData)),!0}default:return super.onMessage(e)}}};var ha=new P(globalThis,{get:()=>globalThis.Module,set:a=>{globalThis.Module=a}});function ga(a){}})();\n'],{type:"application/javascript"})),a=new Worker(t,e);return URL.revokeObjectURL(t),a}var Xe=class e extends DataCaptureLoader{constructor(){super(...arguments);this._name="IdCapture";}get dataCaptureWorker(){return (this._dataCaptureWorker)!=null||(this._dataCaptureWorker=ia({name:this.name})),this._dataCaptureWorker}get name(){return this._name}get fixedWasmMemory(){return BrowserHelper.isIPhone()&&BrowserHelper.isSafari()?256:null}static async create(a){var s;let r=new e(a);return r.workerCommand("setLogLevel",{level:(s=a.logLevel)!=null?s:Logger.Level.Debug}),await r.load(),r}async workerCommand(...a){let[r,s,o]=a;return new Promise((c,u)=>{let I=this.workerCommandId++;this.workerTasks.set(I,{resolve:c,reject:u,command:r});let N={...s,command:r,id:I};this.dataCaptureWorker.postMessage(N,o);})}};function $a(e){return isObject(e)&&Object.prototype.hasOwnProperty.call(e,"code")&&Object.values(h).includes(e.code)}function er(e){return /^This license is invalid for version .+\. It is valid only for licensee '.+', for product '.+' on platform '.+' up to version .+\. Please contact support for more information\.$/.test(e.message)}var It=new Map;It.set([77,105,99,114,111,98,108,105,110,107],"Scandit");It.set([66,108,105,110,107,73,68],"ID Capture");var St="Centaurus",et=class e{static async load(t){let a=new e;try{await a.initCentaurus(t);}catch(r){if($a(r)){if(er(r))throw new DataCaptureError({message:"Invalid embedded license version.",name:"IdCaptureLoadingError"});if(r.code===h.LICENSE_UNLOCK_ERROR)throw new DataCaptureError({message:"Invalid license key. Platform or domain may be incorrect.",name:"IdCaptureLoadingError"});if(r.code===h.SDK_LICENSE_KEY_MISSING)throw new DataCaptureError({message:"Invalid license key (sub-part is missing).",name:"IdCaptureLoadingError"})}throw new DataCaptureError({message:e.replaceCentaurusMentions(isObject(r)?r.message:"(no message)",It),name:"IdCaptureLoadingError"})}return a}static replaceCentaurusMentions(t,a){return typeof t=="string"?[...a.entries()].reduce((r,[s,o])=>{let c=s.map(u=>String.fromCodePoint(u)).join("");return r.replace(new RegExp(c,"gi"),o)},t):"(no message)"}static async getWasmType(){let[t,a]=await Promise.all([BrowserHelper.hasSIMDSupport(),BrowserHelper.hasThreadsSupport()]);return t?a?BrowserHelper.isDesktopDevice()?k.AdvancedWithThreads:k.Advanced:k.Advanced:k.Basic}async initCentaurus(t){this.licenseKey=t.licenseKey;let a=new xe(t.licenseKey);a.engineLocation=t.libraryLocation;let r=new URL("Centaurus.worker.min.js",t.libraryLocation).toString(),s=new Blob([`importScripts("${r}");`],{type:"text/javascript"});a.workerLocation=URL.createObjectURL(s),a.initialMemory=500,a.allowHelloMessage=!1,a.wasmModuleName=St,a.wasmType=await e.getWasmType(),a.blinkIdVariant="lightweight";let o=0;a.loadProgressCallback=c=>{var u;c>=o&&((u=t.loadProgressNotifier)==null||u.call(t,{percentage:c,privateUri:new URL(`${a.wasmModuleName}.wasm`,t.libraryLocation).toString()})),o=c;},this.wasmSDK=await Kt(a);}};var Nt=43,ar=100-Nt,oa={condition:e=>Object.keys(p).some(t=>e.pathname.endsWith(t)),do:e=>(e.info.percentage==null||(e.info.percentage=Nt*e.info.percentage/100),e.info)},la={condition:e=>e.pathname.endsWith(`${St}.wasm`),do:e=>(e.info.percentage==null||(e.info.percentage=Nt+ar*e.info.percentage/100),e.info)};function rr(e){if(typeof e=="function")return function(a){if(a.percentage==null){e(a);return}let{pathname:r}=new URL(a.privateUri,document.baseURI),s=match({pathname:r,info:a}).when(oa.condition,oa.do).when(la.condition,la.do).otherwise(o=>o.info).run();e(s);}}var ua=rr;var G=class{constructor(){this.type="shutter";this.view=null;}toJSONObject(){return {type:this.type}}};G.CLASS_NAME=ViewClassNames.SHUTTER_BUTTON_CONTROL_CLASS_NAME;var at={standby:"standby",active:"active",scanning:"scanning"},tt=class{constructor(t,a){this.control=t,this.controlsElement=a;}async install(){return this.shutterButton||(ShutterButton.register(),this.shutterButton=ShutterButton.create(),this.shutterButton.classList.add("scandit-control-widget"),this.shutterButton.classList.add(`scandit-control-widget-${G.CLASS_NAME}`),this.shutterButton.style.margin="0",this.lastPositionReceived&&this.applyPositioning(this.lastPositionReceived)),this.appendShutterButton(),!0}updatePosition(t){if(t.size.width===0&&t.size.height===0&&this.shutterButton){this.remove();return}this.lastPositionReceived=structuredClone(t),this.applyPositioning(t),this.appendShutterButton();}updateState(t){if(this.shutterButton)switch(t){case"scanning":{this.shutterButton.rotating=!0,this.shutterButton.pulse=!1;break}case"standby":{this.shutterButton.rotating=!1,this.shutterButton.pulse=!1;break}case"active":{this.shutterButton.rotating=!1,this.shutterButton.pulse=!0;break}}}remove(t){var a;(a=this.shutterButton)==null||a.remove(),t===!0&&(this.shutterButton=void 0);}appendShutterButton(){this.shutterButton&&!this.controlsElement.contains(this.shutterButton)&&this.controlsElement.append(this.shutterButton);}applyPositioning(t){this.shutterButton&&(this.shutterButton.style.position="absolute",this.shutterButton.style.left=`${t.origin.x}px`,this.shutterButton.style.top=`${t.origin.y}px`,this.shutterButton.style.width=`${t.size.width}px`,this.shutterButton.style.height=`${t.size.height}px`);}};var da=class e{constructor(){this.type="idCapture";this._idLayoutStyle="rounded";this._defaultCapturedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultCapturedBrush.strokeWidth);this._defaultLocalizedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultLocalizedBrush.strokeWidth);this._defaultRejectedBrush=new Brush(_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.fillColor,_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeColor,_.IdCapture.IdCaptureOverlayDefaults.defaultRejectedBrush.strokeWidth);this._capturedBrush=this._defaultCapturedBrush;this._localizedBrush=this._defaultLocalizedBrush;this._rejectedBrush=this._defaultRejectedBrush;this._idLayoutLineStyle="light";this._showTextHints=!0;this._frontSideTextHint=Localization.getInstance().get("id.idCaptureOverlay.scanFrontSideHint");this._backSideTextHint=Localization.getInstance().get("id.idCaptureOverlay.scanBackSideHint");this._moveCloserTextHint=Localization.getInstance().get("id.idCaptureOverlay.moveCloseTextHint");this._moveFurtherAwayTextHint=Localization.getInstance().get("id.idCaptureOverlay.moveFurtherAwayTextHint");this._tapShutterToScanTextHint=Localization.getInstance().get("id.idCaptureOverlay.tapShutterToScan");this._lookingForDocumentTextHint=Localization.getInstance().get("id.idCaptureOverlay.lookingForDocument");this._holdStillTextHint=Localization.getInstance().get("id.idCaptureOverlay.holdStill");this.onShutterPositionUpdateListener=this.onShutterPositionUpdate.bind(this);this.onShutterButtonStateChangedListener=this.onShutterButtonStateChanged.bind(this);this.onContextUpdatedListener=this.onContextUpdated.bind(this);this.overlayListener={onShutterPositionUpdate:this.onShutterPositionUpdateListener,onShutterButtonStateChanged:this.onShutterButtonStateChangedListener};}get idLayoutStyle(){return this._idLayoutStyle}set idLayoutStyle(t){this._idLayoutStyle=t,this.idCapture.didChange();}get idLayoutLineStyle(){return this._idLayoutLineStyle}set idLayoutLineStyle(t){this._idLayoutLineStyle=t,this.idCapture.didChange();}get showTextHints(){return this._showTextHints}set showTextHints(t){this._showTextHints=t,this.idCapture.didChange();}get defaultCapturedBrush(){return this._defaultCapturedBrush}get defaultLocalizedBrush(){return this._defaultLocalizedBrush}get defaultRejectedBrush(){return this._defaultRejectedBrush}static async withIdCapture(t){return e.withIdCaptureForView(t,null)}static async withIdCaptureForView(t,a){var s;let r=new e;return r.idCapture=t,await r.setCapturedBrush(r.defaultCapturedBrush),await r.setLocalizedBrush(r.defaultLocalizedBrush),await r.setRejectedBrush(r.defaultRejectedBrush),a&&(r.view=a,await a.addOverlay(r),await r.installShutterButton()),t.addOverlayListener(r.overlayListener),(s=t.context)==null||s.updateListeners.add(r.onContextUpdatedListener),r}async setFrontSideTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setFrontSideTextHint. Use the Localization API instead."),this._frontSideTextHint=t,await this.idCapture.didChange();}async setBackSideTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setBackSideTextHint. Use the Localization API instead."),this._backSideTextHint=t,await this.idCapture.didChange();}async setMoveCloserTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setMoveCloserTextHint. Use the Localization API instead."),this._moveCloserTextHint=t,await this.idCapture.didChange();}async setMoveFurtherAwayTextHint(t){Logger.log(Logger.Level.Debug,"DEPRECATED: IdCaptureOverlay.setMoveFurtherAwayTextHint. Use the Localization API instead."),this._moveFurtherAwayTextHint=t,await this.idCapture.didChange();}getCapturedBrush(){return this._capturedBrush}async setCapturedBrush(t){this._capturedBrush=t,await this.idCapture.didChange();}getLocalizedBrush(){return this._localizedBrush}async setLocalizedBrush(t){this._localizedBrush=t,await this.idCapture.didChange();}getRejectedBrush(){return this._rejectedBrush}async setRejectedBrush(t){this._rejectedBrush=t,await this.idCapture.didChange();}toJSONObject(){return {type:this.type,idLayoutStyle:this.idLayoutStyle,idLayoutLineStyle:this.idLayoutLineStyle,showTextHints:this._showTextHints,capturedBrush:this._capturedBrush.toJSONObject(),localizedBrush:this._localizedBrush.toJSONObject(),rejectedBrush:this._rejectedBrush.toJSONObject(),frontSideTextHint:this._frontSideTextHint,backSideTextHint:this._backSideTextHint,moveCloserTextHint:this._moveCloserTextHint,moveFurtherAwayTextHint:this._moveFurtherAwayTextHint,tapShutterToScanTextHint:this._tapShutterToScanTextHint,lookingForDocumentTextHint:this._lookingForDocumentTextHint,holdStillTextHint:this._holdStillTextHint}}async installShutterButton(){if(this.view&&this.idCapture.settings.captureTrigger==="buttonTap")if(this.shutterWidget)await this.shutterWidget.install();else {let t=new G;this.shutterWidget=this.view.registerControlWidget(t,tt),this.view.addControl(t);}}onContextUpdated(t){var s,o,c,u;if(t.type==="modeEnabled"&&!t.newValue){(s=this.shutterWidget)==null||s.remove();return}t.type==="removeOverlay"&&t.newValue===this&&(this.idCapture.removeOverlayListener(this.overlayListener),(o=this.idCapture.context)==null||o.updateListeners.delete(this.onContextUpdatedListener));let a=(c=this.idCapture.context)==null?void 0:c.toJSONObject().modes,r=a==null?void 0:a.find(I=>I.type==="idCapture");r&&r.settings.captureTrigger==="auto"&&this.shutterWidget?(u=this.view)==null||u.removeControl(this.shutterWidget.control):this.installShutterButton();}onShutterPositionUpdate(t){var a,r,s;(a=this.shutterWidget)==null||a.updatePosition(t),t.size.width===0&&t.size.height===0&&((r=this.shutterWidget)!=null&&r.control)&&((s=this.view)==null||s.removeControl(this.shutterWidget.control));}onShutterButtonStateChanged(t){var a,r,s;switch(t){case"untapped":{(a=this.shutterWidget)==null||a.updateState(at.standby);break}case"untappedLocalized":{(r=this.shutterWidget)==null||r.updateState(at.active);break}case"tapped":{(s=this.shutterWidget)==null||s.updateState(at.scanning);break}}}};var rt=class{constructor(t,a,r){this._days=t,this._months=a,this._years=r;}get days(){return this._days}get months(){return this._months}get years(){return this._years}toJSONObject(){return {days:this.days,months:this.months,years:this.years}}};var it=class extends T{constructor(){super();this._isFull=!0;}toJSONObject(){return {isFull:this._isFull,options:{barcode:!0,machineReadableZone:!0,visualInspectionZone:!0}}}};var ue=class extends T{constructor(a,r,s){super();this._isFull=!1;this._barcode=a,this._machineReadableZone=r,this._visualInspectionZone=s;}get barcode(){return this._barcode}get machineReadableZone(){return this._machineReadableZone}get visualInspectionZone(){return this._visualInspectionZone}toJSONObject(){return {isFull:this._isFull,options:{barcode:this.barcode,machineReadableZone:this.machineReadableZone,visualInspectionZone:this.visualInspectionZone}}}};var pa=class e{constructor(){this.acceptedDocuments=[];this.rejectedDocuments=[];this.anonymizationMode="fieldsOnly";this.captureTrigger="auto";this.rejectVoidedIds=!1;this.decodeBackOfEuropeanDrivingLicense=!1;this.rejectExpiredIds=!1;this.rejectNotRealIdCompliant=!1;this.rejectInconsistentData=!1;this.rejectHolderBelowAge=null;this.rejectIdsExpiringIn=null;this.properties={};this.imageToResult={};this.scannerType=new ue(!1,!1,!1);}setProperty(t,a){this.properties[t]=a;}getProperty(t){return this.properties[t]}setShouldPassImageTypeToResult(t,a){this.imageToResult[t]=a;}getShouldPassImageTypeToResult(t){var a;return (a=this.imageToResult[t])!=null?a:!1}toJSONObject(){return {acceptedDocuments:this.acceptedDocuments.map(t=>t.toJSONObject()),rejectedDocuments:this.rejectedDocuments.map(t=>t.toJSONObject()),scannerType:this.scannerType.toJSONObject(),imageToResult:{face:this.imageToResult.face,croppedDocument:this.imageToResult.croppedDocument,frame:this.imageToResult.frame},properties:{...this.properties},anonymizationMode:this.anonymizationMode,captureTrigger:this.captureTrigger,rejectVoidedIds:this.rejectVoidedIds,decodeBackOfEuropeanDrivingLicense:this.decodeBackOfEuropeanDrivingLicense,rejectExpiredIds:this.rejectExpiredIds,rejectNotRealIdCompliant:this.rejectNotRealIdCompliant,rejectInconsistentData:this.rejectInconsistentData,rejectHolderBelowAge:this.rejectHolderBelowAge,rejectIdsExpiringIn:this.rejectIdsExpiringIn?this.rejectIdsExpiringIn.toJSONObject():null}}static fromJSON(t){let a=new e;a.acceptedDocuments=t.acceptedDocuments.map(o=>e.createDocumentFromJSON(o)),a.rejectedDocuments=t.rejectedDocuments.map(o=>e.createDocumentFromJSON(o));let r=t.scannerType;a.scannerType=t.scannerType.isFull?new it:new ue(r.options.barcode,r.options.machineReadableZone,r.options.visualInspectionZone),a.anonymizationMode=t.anonymizationMode,a.decodeBackOfEuropeanDrivingLicense=t.decodeBackOfEuropeanDrivingLicense,a.captureTrigger=t.captureTrigger,a.rejectVoidedIds=t.rejectVoidedIds,a.rejectExpiredIds=t.rejectExpiredIds,a.rejectNotRealIdCompliant=t.rejectNotRealIdCompliant,a.rejectInconsistentData=t.rejectInconsistentData,a.rejectHolderBelowAge=t.rejectHolderBelowAge;let s=t.rejectIdsExpiringIn;return a.rejectIdsExpiringIn=s?new rt(s.days,s.months,s.years):null,a.imageToResult={...t.imageToResult},a.properties={...t.properties},a}static createDocumentFromJSON(t){let a=t.documentType,r=t.region;switch(a){case"driverLicense":return new K(r);case"healthInsuranceCard":return new Z(r);case"idCard":return new Y(r);case"passport":return new Q(r);case"residencePermit":return new $(r);case"visaIcao":return new ee(r);case"regionSpecific":{let s=t;return new X(s.documentSubtype)}}}};var st=class e{get allChecksPassed(){return this.json.allChecksPassed}get error(){return typeof this.json.error=="string"&&this.json.error!==""?this.json.error:null}static fromJSON(t){let a=new e;return a.json=t,a}};var ma=class e{constructor(t,a=null){this._context=t,this._endpoint=a;}static async create(t){return new e(t)}async verify(t){let a=await this._context.workerCommand("idCaptureBarcodeVerifyAamvaCapture",{capturedId:t.toJSONObject(),endpoint:this._endpoint});return a.result.isSuccess||Logger.log(Logger.Level.Warn,"Error during Aamva verification:",a.result.error),st.fromJSON(a.result)}};var Aa=class e{constructor(t){this._context=t;}static create(t){return new e(t)}async verify(t){let a=await this._context.workerCommand("idCaptureDataConsistencyVerifyCapture",{capturedId:t.toJSONObject()});return a.result==null?null:J.fromJSON(a.result)}};var Ct,ie;function mo(e){Localization.getInstance().updateIfMissing({...ra});let t=typeof(e==null?void 0:e.enableVIZDocuments)=="boolean"?e.enableVIZDocuments:!1;return {moduleName:"IdCapture",load:async a=>{if(a.loadProgressNotifier=t?ua(a.loadProgressNotifier):a.loadProgressNotifier,a.overrideThreadsSupport=OverrideState.Off,a.verifyResponseHash=!0,ie=await Xe.create(a),DataCaptureContext.moduleLicenseTextProviders.push(new Qe(ie)),!t)return Logger.log(Logger.Level.Info,"VIZ scanning is disabled (enableVIZDocuments option was not passed to idCaptureLoader, or its value was false)"),ie;let o=(await ie.workerCommand("extractCentaurusLicense",{licenseKey:a.licenseKey})).centaurus.licenseKey;if(o.length===0)throw Logger.log(Logger.Level.Error,"Invalid license key: VIZ scanning is enabled in the options but the license key has no VIZ scanning enabled. Update the license key or disable VIZ scanning when calling idCaptureloader."),D.create({type:"InvalidLicenseKeyForVIZProcessing",message:"Invalid license key for VIZ scanning. Update license key or disable VIZ scanning."});return Logger.log(Logger.Level.Info,"VIZ scanning is enabled, VIZ processor will be initialized"),Ct=await et.load({libraryLocation:`${a.libraryLocation}idcapture/`,licenseKey:o,logLevel:a.logLevel,loadProgressNotifier:a.loadProgressNotifier}),Ye.setCentaurusLoader(Ct),ie}}}function Ao(e){ie=e;}function Io(e){Ct=e;}
5
5
  export{st as AamvaBarcodeVerificationResult,ma as AamvaBarcodeVerifier,Se as BarcodeResult,ne as CapturedId,Et as CapturedSides,J as DataConsistencyResult,Aa as DataConsistencyVerifier,A as DateResult,K as DriverLicense,Ce as DrivingLicenseCategory,z as DrivingLicenseDetails,rt as Duration,it as FullDocumentScanner,Z as HealthInsuranceCard,Dt as IdAnonymizationMode,Ye as IdCapture,g as IdCaptureDocument,y as IdCaptureDocumentType,D as IdCaptureError,pe as IdCaptureErrorCode,he as IdCaptureFeedback,da as IdCaptureOverlay,T as IdCaptureScanner,pa as IdCaptureSettings,bt as IdCaptureTrigger,Y as IdCard,nt as IdImageType,ga as IdLayoutLineStyle,Ca as IdLayoutStyle,fa as IdSide,Be as LocalizedOnlyId,fe as MRZResult,Q as Passport,Ae as ProfessionalDrivingPermit,Da as Region,X as RegionSpecific,Ua as RegionSpecificSubtype,Ka as RejectionReason,$ as ResidencePermit,E as STATE,Oa as Sex,ue as SingleSideScanner,Ra as UsRealIdStatus,ge as VIZResult,Ie as VehicleRestriction,ee as VisaIcao,Ct as centaurusLoader,mo as idCaptureLoader,ie as mainDataCaptureLoader,Io as setCentaurusLoader,Ao as setMainDataCaptureLoader};