dynamsoft-core
Advanced tools
Comparing version 3.0.10 to 3.0.30-beta-202401102201
@@ -5,8 +5,8 @@ /*! | ||
* @website https://www.dynamsoft.com | ||
* @copyright Copyright 2023, Dynamsoft Corporation | ||
* @copyright Copyright 2024, Dynamsoft Corporation | ||
* @author Dynamsoft | ||
* @version 3.0.10 | ||
* @version 3.0.30 | ||
* @fileoverview Dynamsoft JavaScript Library for Core | ||
* More info on DC JS: https://www.dynamsoft.com/core/docs/programming/javascript/?ver=latest | ||
* More info on Dynamsoft Core JS: https://www.dynamsoft.com/core/docs/programming/javascript/?ver=latest | ||
*/ | ||
function _(_,E,I,C){if("a"===I&&!C)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof E?_!==E||!C:!E.has(_))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===I?C:"a"===I?C.call(_):C?C.value:E.get(_)}function E(_,E,I,C,A){if("m"===C)throw new TypeError("Private method is not writable");if("a"===C&&!A)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof E?_!==E||!A:!E.has(_))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===C?A.call(_,I):A?A.value=I:E.set(_,I),I}var I,C,A;"function"==typeof SuppressedError&&SuppressedError,function(_){_[_.BOPM_BLOCK=0]="BOPM_BLOCK",_[_.BOPM_UPDATE=1]="BOPM_UPDATE"}(I||(I={})),function(_){_[_.CCUT_AUTO=0]="CCUT_AUTO",_[_.CCUT_FULL_CHANNEL=1]="CCUT_FULL_CHANNEL",_[_.CCUT_Y_CHANNEL_ONLY=2]="CCUT_Y_CHANNEL_ONLY",_[_.CCUT_RGB_R_CHANNEL_ONLY=3]="CCUT_RGB_R_CHANNEL_ONLY",_[_.CCUT_RGB_G_CHANNEL_ONLY=4]="CCUT_RGB_G_CHANNEL_ONLY",_[_.CCUT_RGB_B_CHANNEL_ONLY=5]="CCUT_RGB_B_CHANNEL_ONLY"}(C||(C={})),function(_){_[_.IPF_BINARY=0]="IPF_BINARY",_[_.IPF_BINARYINVERTED=1]="IPF_BINARYINVERTED",_[_.IPF_GRAYSCALED=2]="IPF_GRAYSCALED",_[_.IPF_NV21=3]="IPF_NV21",_[_.IPF_RGB_565=4]="IPF_RGB_565",_[_.IPF_RGB_555=5]="IPF_RGB_555",_[_.IPF_RGB_888=6]="IPF_RGB_888",_[_.IPF_ARGB_8888=7]="IPF_ARGB_8888",_[_.IPF_RGB_161616=8]="IPF_RGB_161616",_[_.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",_[_.IPF_ABGR_8888=10]="IPF_ABGR_8888",_[_.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",_[_.IPF_BGR_888=12]="IPF_BGR_888",_[_.IPF_BINARY_8=13]="IPF_BINARY_8",_[_.IPF_NV12=14]="IPF_NV12"}(A||(A={}));const T=_=>Object.prototype.toString.call(_),R=_=>Array.isArray?Array.isArray(_):"[object Array]"===T(_),N=_=>"[object Boolean]"===T(_),e=_=>"number"==typeof _&&!Number.isNaN(_),D=_=>null!==_&&"object"==typeof _&&!Array.isArray(_),L=_=>!!D(_)&&(!!e(_.x)&&(!!e(_.y)&&(!!e(_.radius)&&(!(_.radius<0)&&(!!e(_.startAngle)&&!!e(_.endAngle)))))),t=_=>!!D(_)&&(!!R(_.points)&&(0!=_.points.length&&!_.points.some((_=>!r(_))))),O=_=>!!D(_)&&(_.bytes instanceof Uint8Array&&(!!e(_.width)&&(!(_.width<=0)&&(!!e(_.height)&&(!(_.height<=0)&&(!!e(_.stride)&&(!(_.stride<=0)&&("format"in _&&!("tag"in _&&!i(_.tag)))))))))),S=_=>!!D(_)&&(!!e(_.left)&&(!(_.left<0)&&(!!e(_.top)&&(!(_.top<0)&&(!!e(_.right)&&(!(_.right<0)&&(!!e(_.bottom)&&(!(_.bottom<0)&&(!(_.left>=_.right)&&(!(_.top>=_.bottom)&&!!N(_.isMeasuredInPercentage))))))))))),i=_=>!!D(_)&&(!!e(_.imageId)&&"type"in _),s=_=>!!D(_)&&(!!r(_.startPoint)&&(!!r(_.endPoint)&&(_.startPoint.x!=_.endPoint.x||_.startPoint.y!=_.endPoint.y))),r=_=>!!D(_)&&(!!e(_.x)&&!!e(_.y)),n=_=>!!D(_)&&(!!R(_.points)&&(0!=_.points.length&&!_.points.some((_=>!r(_))))),M=_=>!!D(_)&&(!!R(_.points)&&(0!=_.points.length&&4==_.points.length&&!_.points.some((_=>!r(_))))),a=_=>!!D(_)&&(!!e(_.x)&&(!!e(_.y)&&(!!e(_.width)&&(!(_.width<0)&&(!!e(_.height)&&(!(_.height<0)&&!("isMeasuredInPercentage"in _&&!N(_.isMeasuredInPercentage))))))));var G,U,P,o,F,h,f,B,V,c,d,l,u,g,m,Y,w,p,y;class H{constructor(){G.add(this),U.set(this,[]),P.set(this,1),o.set(this,I.BOPM_BLOCK),F.set(this,!1),h.set(this,void 0),f.set(this,C.CCUT_AUTO)}get _isFetchingStarted(){return _(this,F,"f")}addImageToBuffer(E){var C;if(!O(E))throw new TypeError("Invalid 'image'.");if((null===(C=E.tag)||void 0===C?void 0:C.hasOwnProperty("imageId"))&&"number"==typeof E.tag.imageId&&this.hasImage(E.tag.imageId))throw new Error("Existed imageId.");if(_(this,U,"f").length>=_(this,P,"f"))switch(_(this,o,"f")){case I.BOPM_BLOCK:break;case I.BOPM_UPDATE:if(_(this,U,"f").push(E),D(_(this,h,"f"))&&e(_(this,h,"f").imageId)&&1==_(this,h,"f").keepInBuffer)for(;_(this,U,"f").length>_(this,P,"f");){const E=_(this,U,"f").findIndex((E=>{var I;return(null===(I=E.tag)||void 0===I?void 0:I.imageId)!==_(this,h,"f").imageId}));_(this,U,"f").splice(E,1)}else _(this,U,"f").splice(0,_(this,U,"f").length-_(this,P,"f"))}else _(this,U,"f").push(E)}getImage(){if(0===_(this,U,"f").length)return null;let E;if(_(this,h,"f")&&e(_(this,h,"f").imageId)){const I=_(this,G,"m",B).call(this,_(this,h,"f").imageId);if(I<0)throw new Error(`Image with id ${_(this,h,"f").imageId} doesn't exist.`);E=_(this,U,"f").slice(I,I+1)[0]}else E=_(this,U,"f").pop();if([A.IPF_RGB_565,A.IPF_RGB_555,A.IPF_RGB_888,A.IPF_ARGB_8888,A.IPF_RGB_161616,A.IPF_ARGB_16161616,A.IPF_ABGR_8888,A.IPF_ABGR_16161616,A.IPF_BGR_888].includes(E.format)){if(_(this,f,"f")===C.CCUT_RGB_R_CHANNEL_ONLY){const _=new Uint8Array(E.width*E.height);for(let I=0;I<_.length;I++)switch(E.format){case A.IPF_RGB_565:case A.IPF_RGB_555:case A.IPF_RGB_888:case A.IPF_RGB_161616:_[I]=E.bytes[3*I+2];break;case A.IPF_ARGB_8888:case A.IPF_ARGB_16161616:_[I]=E.bytes[4*I+2];break;case A.IPF_BGR_888:_[I]=E.bytes[3*I];break;case A.IPF_ABGR_8888:case A.IPF_ABGR_16161616:_[I]=E.bytes[4*I]}E.bytes=_,E.stride=E.width,E.format=A.IPF_GRAYSCALED}else if(_(this,f,"f")===C.CCUT_RGB_G_CHANNEL_ONLY){const _=new Uint8Array(E.width*E.height);for(let I=0;I<_.length;I++)switch(E.format){case A.IPF_RGB_565:case A.IPF_RGB_555:case A.IPF_RGB_888:case A.IPF_RGB_161616:case A.IPF_BGR_888:_[I]=E.bytes[3*I+1];break;case A.IPF_ARGB_8888:case A.IPF_ARGB_16161616:case A.IPF_ABGR_8888:case A.IPF_ABGR_16161616:_[I]=E.bytes[4*I+1]}E.bytes=_,E.stride=E.width,E.format=A.IPF_GRAYSCALED}else if(_(this,f,"f")===C.CCUT_RGB_B_CHANNEL_ONLY){const _=new Uint8Array(E.width*E.height);for(let I=0;I<_.length;I++)switch(E.format){case A.IPF_RGB_565:case A.IPF_RGB_555:case A.IPF_RGB_888:case A.IPF_RGB_161616:_[I]=E.bytes[3*I];break;case A.IPF_ARGB_8888:case A.IPF_ARGB_16161616:_[I]=E.bytes[4*I];break;case A.IPF_BGR_888:_[I]=E.bytes[3*I+2];break;case A.IPF_ABGR_8888:case A.IPF_ABGR_16161616:_[I]=E.bytes[4*I+2]}E.bytes=_,E.stride=E.width,E.format=A.IPF_GRAYSCALED}}else[A.IPF_NV21,A.IPF_NV12].includes(E.format);return E}setNextImageToReturn(_,I){if(!((..._)=>0!==_.length&&_.every((_=>e(_))))(_))throw new TypeError("Invalid 'imageId'.");if(void 0!==I&&!N(I))throw new TypeError("Invalid 'keepInBuffer'.");E(this,h,{imageId:_,keepInBuffer:I},"f")}_resetNextReturnedImage(){E(this,h,null,"f")}hasImage(E){return _(this,G,"m",B).call(this,E)>=0}startFetching(){E(this,F,!0,"f")}stopFetching(){E(this,F,!1,"f")}setMaximumImageCount(I){if("number"!=typeof I)throw new TypeError("Invalid 'count'.");if(I<1||Math.round(I)!==I)throw new Error("Invalid 'count'.");for(E(this,P,I,"f");_(this,U,"f")&&_(this,U,"f").length>I;)_(this,U,"f").shift()}getMaximumImageCount(){return _(this,P,"f")}getImageCount(){return _(this,U,"f").length}clearBuffer(){_(this,U,"f").length=0}isBufferEmpty(){return 0===_(this,U,"f").length}setBufferOverflowProtectionMode(_){E(this,o,_,"f")}getBufferOverflowProtectionMode(){return _(this,o,"f")}setColourChannelUsageType(_){E(this,f,_,"f")}getColourChannelUsageType(){return _(this,f,"f")}}U=new WeakMap,P=new WeakMap,o=new WeakMap,F=new WeakMap,h=new WeakMap,f=new WeakMap,G=new WeakSet,B=function(E){if("number"!=typeof E)throw new TypeError("Invalid 'imageId'.");return _(this,U,"f").findIndex((_=>{var I;return(null===(I=_.tag)||void 0===I?void 0:I.imageId)===E}))};class X{static getVersion(){return"3.0.10"}}class v{constructor(){this.intermediateResultReceiverSet=new Set}addResultReceiver(_){if("object"!=typeof _)throw new Error("Invalid receiver.");this.intermediateResultReceiverSet.add(_)}removeResultReceiver(_){this.intermediateResultReceiverSet.delete(_)}async getOriginalImage(_){return null}}class Z{constructor(){this.onTaskResultsReceived=null,this.onPredetectedRegionsReceived=null,this.onDecodedBarcodesReceived=null,this.onRecognizedTextLinesReceived=null,this.onDetectedQuadsReceived=null,this.onNormalizedImagesReceived=null}}!function(_){_[_.CRIT_ORIGINAL_IMAGE=1]="CRIT_ORIGINAL_IMAGE",_[_.CRIT_BARCODE=2]="CRIT_BARCODE",_[_.CRIT_TEXT_LINE=4]="CRIT_TEXT_LINE",_[_.CRIT_DETECTED_QUAD=8]="CRIT_DETECTED_QUAD",_[_.CRIT_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",_[_.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT"}(V||(V={})),function(_){_[_.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",_[_.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",_[_.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",_[_.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED"}(c||(c={})),function(_){_[_.EC_OK=0]="EC_OK",_[_.EC_UNKNOWN=-1e4]="EC_UNKNOWN",_[_.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",_[_.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",_[_.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",_[_.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",_[_.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",_[_.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",_[_.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",_[_.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",_[_.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",_[_.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",_[_.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",_[_.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",_[_.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",_[_.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",_[_.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",_[_.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",_[_.EC_TIMEOUT=-10026]="EC_TIMEOUT",_[_.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",_[_.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",_[_.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",_[_.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",_[_.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",_[_.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",_[_.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",_[_.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",_[_.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",_[_.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",_[_.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",_[_.EC_LICENSE_KEY_NOT_MATCHED=-10043]="EC_LICENSE_KEY_NOT_MATCHED",_[_.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",_[_.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",_[_.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",_[_.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",_[_.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",_[_.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",_[_.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",_[_.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",_[_.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",_[_.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",_[_.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",_[_.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",_[_.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",_[_.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",_[_.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",_[_.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",_[_.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",_[_.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",_[_.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",_[_.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",_[_.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",_[_.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",_[_.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",_[_.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",_[_.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",_[_.EC_LICENSE_VERSION_NOT_MATCH=-20011]="EC_LICENSE_VERSION_NOT_MATCH",_[_.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",_[_.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",_[_.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",_[_.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",_[_.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",_[_.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",_[_.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",_[_.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",_[_.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",_[_.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",_[_.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",_[_.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",_[_.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",_[_.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",_[_.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",_[_.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",_[_.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",_[_.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",_[_.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",_[_.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",_[_.EC_CAMERA_MODULE_NOT_EXIST=-60003]="EC_CAMERA_MODULE_NOT_EXIST",_[_.EC_CAMERA_ID_NOT_EXIST=-60006]="EC_CAMERA_ID_NOT_EXIST",_[_.EC_NO_SENSOR=-60045]="EC_NO_SENSOR",_[_.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",_[_.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",_[_.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",_[_.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",_[_.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",_[_.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",_[_.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",_[_.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",_[_.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",_[_.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",_[_.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",_[_.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID"}(d||(d={})),function(_){_[_.GEM_SKIP=0]="GEM_SKIP",_[_.GEM_AUTO=1]="GEM_AUTO",_[_.GEM_GENERAL=2]="GEM_GENERAL",_[_.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",_[_.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",_[_.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",_[_.GEM_REV=-2147483648]="GEM_REV"}(l||(l={})),function(_){_[_.GTM_SKIP=0]="GTM_SKIP",_[_.GTM_INVERTED=1]="GTM_INVERTED",_[_.GTM_ORIGINAL=2]="GTM_ORIGINAL",_[_.GTM_AUTO=4]="GTM_AUTO",_[_.GTM_REV=-2147483648]="GTM_REV"}(u||(u={})),function(_){_[_.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",_[_.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME"}(g||(g={})),function(_){_[_.PDFRM_VECTOR=1]="PDFRM_VECTOR",_[_.PDFRM_RASTER=2]="PDFRM_RASTER",_[_.PDFRM_REV=-2147483648]="PDFRM_REV"}(m||(m={})),function(_){_[_.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",_[_.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES"}(Y||(Y={})),function(_){_[_.IRUT_NULL=0]="IRUT_NULL",_[_.IRUT_COLOUR_IMAGE=1]="IRUT_COLOUR_IMAGE",_[_.IRUT_SCALED_DOWN_COLOUR_IMAGE=2]="IRUT_SCALED_DOWN_COLOUR_IMAGE",_[_.IRUT_GRAYSCALE_IMAGE=4]="IRUT_GRAYSCALE_IMAGE",_[_.IRUT_TRANSOFORMED_GRAYSCALE_IMAGE=8]="IRUT_TRANSOFORMED_GRAYSCALE_IMAGE",_[_.IRUT_ENHANCED_GRAYSCALE_IMAGE=16]="IRUT_ENHANCED_GRAYSCALE_IMAGE",_[_.IRUT_PREDETECTED_REGIONS=32]="IRUT_PREDETECTED_REGIONS",_[_.IRUT_BINARY_IMAGE=64]="IRUT_BINARY_IMAGE",_[_.IRUT_TEXTURE_DETECTION_RESULT=128]="IRUT_TEXTURE_DETECTION_RESULT",_[_.IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE=256]="IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE",_[_.IRUT_TEXTURE_REMOVED_BINARY_IMAGE=512]="IRUT_TEXTURE_REMOVED_BINARY_IMAGE",_[_.IRUT_CONTOURS=1024]="IRUT_CONTOURS",_[_.IRUT_LINE_SEGMENTS=2048]="IRUT_LINE_SEGMENTS",_[_.IRUT_TEXT_ZONES=4096]="IRUT_TEXT_ZONES",_[_.IRUT_TEXT_REMOVED_BINARY_IMAGE=8192]="IRUT_TEXT_REMOVED_BINARY_IMAGE",_[_.IRUT_CANDIDATE_BARCODE_ZONES=16384]="IRUT_CANDIDATE_BARCODE_ZONES",_[_.IRUT_LOCALIZED_BARCODES=32768]="IRUT_LOCALIZED_BARCODES",_[_.IRUT_SCALED_UP_BARCODE_IMAGE=65536]="IRUT_SCALED_UP_BARCODE_IMAGE",_[_.IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE=131072]="IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE",_[_.IRUT_COMPLEMENTED_BARCODE_IMAGE=262144]="IRUT_COMPLEMENTED_BARCODE_IMAGE",_[_.IRUT_DECODED_BARCODES=524288]="IRUT_DECODED_BARCODES",_[_.IRUT_LONG_LINES=1048576]="IRUT_LONG_LINES",_[_.IRUT_CORNERS=2097152]="IRUT_CORNERS",_[_.IRUT_CANDIDATE_QUAD_EDGES=4194304]="IRUT_CANDIDATE_QUAD_EDGES",_[_.IRUT_DETECTED_QUADS=8388608]="IRUT_DETECTED_QUADS",_[_.IRUT_LOCALIZED_TEXT_LINES=16777216]="IRUT_LOCALIZED_TEXT_LINES",_[_.IRUT_RECOGNIZED_TEXT_LINES=33554432]="IRUT_RECOGNIZED_TEXT_LINES",_[_.IRUT_NORMALIZED_IMAGES=67108864]="IRUT_NORMALIZED_IMAGES",_[_.IRUT_ALL=134217727]="IRUT_ALL"}(w||(w={})),function(_){_[_.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",_[_.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",_[_.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",_[_.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",_[_.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",_[_.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",_[_.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE"}(p||(p={})),function(_){_[_.ST_NULL=0]="ST_NULL",_[_.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",_[_.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",_[_.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",_[_.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",_[_.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",_[_.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",_[_.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION"}(y||(y={}));export{X as CoreModule,I as EnumBufferOverflowProtectionMode,V as EnumCapturedResultItemType,C as EnumColourChannelUsageType,c as EnumCornerType,d as EnumErrorCode,l as EnumGrayscaleEnhancementMode,u as EnumGrayscaleTransformationMode,A as EnumImagePixelFormat,g as EnumImageTagType,w as EnumIntermediateResultUnitType,m as EnumPDFReadingMode,Y as EnumRasterDataSource,p as EnumRegionObjectElementType,y as EnumSectionType,H as ImageSourceAdapter,v as IntermediateResultManager,Z as IntermediateResultReceiver,L as _isArc,t as _isContour,O as _isDSImageData,S as _isDSRect,i as _isImageTag,s as _isLineSegment,r as _isPoint,n as _isPolygon,M as _isQuad,a as _isRect}; | ||
function _(_,E,e,t){if("a"===e&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof E?_!==E||!t:!E.has(_))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?t:"a"===e?t.call(_):t?t.value:E.get(_)}function E(_,E,e,t,I){if("m"===t)throw new TypeError("Private method is not writable");if("a"===t&&!I)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof E?_!==E||!I:!E.has(_))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===t?I.call(_,e):I?I.value=e:E.set(_,e),e}var e,t,I;"function"==typeof SuppressedError&&SuppressedError,function(_){_[_.BOPM_BLOCK=0]="BOPM_BLOCK",_[_.BOPM_UPDATE=1]="BOPM_UPDATE"}(e||(e={})),function(_){_[_.CCUT_AUTO=0]="CCUT_AUTO",_[_.CCUT_FULL_CHANNEL=1]="CCUT_FULL_CHANNEL",_[_.CCUT_Y_CHANNEL_ONLY=2]="CCUT_Y_CHANNEL_ONLY",_[_.CCUT_RGB_R_CHANNEL_ONLY=3]="CCUT_RGB_R_CHANNEL_ONLY",_[_.CCUT_RGB_G_CHANNEL_ONLY=4]="CCUT_RGB_G_CHANNEL_ONLY",_[_.CCUT_RGB_B_CHANNEL_ONLY=5]="CCUT_RGB_B_CHANNEL_ONLY"}(t||(t={})),function(_){_[_.IPF_BINARY=0]="IPF_BINARY",_[_.IPF_BINARYINVERTED=1]="IPF_BINARYINVERTED",_[_.IPF_GRAYSCALED=2]="IPF_GRAYSCALED",_[_.IPF_NV21=3]="IPF_NV21",_[_.IPF_RGB_565=4]="IPF_RGB_565",_[_.IPF_RGB_555=5]="IPF_RGB_555",_[_.IPF_RGB_888=6]="IPF_RGB_888",_[_.IPF_ARGB_8888=7]="IPF_ARGB_8888",_[_.IPF_RGB_161616=8]="IPF_RGB_161616",_[_.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",_[_.IPF_ABGR_8888=10]="IPF_ABGR_8888",_[_.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",_[_.IPF_BGR_888=12]="IPF_BGR_888",_[_.IPF_BINARY_8=13]="IPF_BINARY_8",_[_.IPF_NV12=14]="IPF_NV12"}(I||(I={}));const s=_=>Object.prototype.toString.call(_),C=_=>Array.isArray?Array.isArray(_):"[object Array]"===s(_),r=_=>"[object Boolean]"===s(_),A=_=>"number"==typeof _&&!Number.isNaN(_),T=_=>null!==_&&"object"==typeof _&&!Array.isArray(_),n=_=>!!T(_)&&(!!A(_.x)&&(!!A(_.y)&&(!!A(_.radius)&&(!(_.radius<0)&&(!!A(_.startAngle)&&!!A(_.endAngle)))))),R=_=>!!T(_)&&(!!C(_.points)&&(0!=_.points.length&&!_.points.some((_=>!L(_))))),N=_=>!!T(_)&&(_.bytes instanceof Uint8Array&&(!!A(_.width)&&(!(_.width<=0)&&(!!A(_.height)&&(!(_.height<=0)&&(!!A(_.stride)&&(!(_.stride<=0)&&("format"in _&&!("tag"in _&&!o(_.tag)))))))))),i=_=>!!T(_)&&(!!A(_.left)&&(!(_.left<0)&&(!!A(_.top)&&(!(_.top<0)&&(!!A(_.right)&&(!(_.right<0)&&(!!A(_.bottom)&&(!(_.bottom<0)&&(!(_.left>=_.right)&&(!(_.top>=_.bottom)&&!!r(_.isMeasuredInPercentage))))))))))),o=_=>!!T(_)&&(!!A(_.imageId)&&"type"in _),D=_=>!!T(_)&&(!!L(_.startPoint)&&(!!L(_.endPoint)&&(_.startPoint.x!=_.endPoint.x||_.startPoint.y!=_.endPoint.y))),L=_=>!!T(_)&&(!!A(_.x)&&!!A(_.y)),a=_=>!!T(_)&&(!!C(_.points)&&(0!=_.points.length&&!_.points.some((_=>!L(_))))),O=_=>!!T(_)&&(!!C(_.points)&&(0!=_.points.length&&4==_.points.length&&!_.points.some((_=>!L(_))))),S=_=>!!T(_)&&(!!A(_.x)&&(!!A(_.y)&&(!!A(_.width)&&(!(_.width<0)&&(!!A(_.height)&&(!(_.height<0)&&!("isMeasuredInPercentage"in _&&!r(_.isMeasuredInPercentage))))))));async function c(_,E){return await new Promise(((e,t)=>{let I=new XMLHttpRequest;I.open("GET",_,!0),I.responseType=E,I.send(),I.onloadend=async()=>{e(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}}))}function M(_){return/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)|^[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/.test(_)}const l=(_,E)=>{let e=_.split("."),t=E.split(".");for(let _=0;_<e.length&&_<t.length;++_){let E=e[_],I=t[_];if(E===I)continue;let s=parseInt(e[_]),C=parseInt(t[_]);return s===C||Number.isNaN(s)&&Number.isNaN(C)?E<I?-1:1:s<C||Number.isNaN(s)&&Number.isInteger(C)?-1:1}return e.length===t.length?0:e.length<t.length?-1:1};var h,f,P,d,G,U,u,g;class F{get _isFetchingStarted(){return _(this,G,"f")}constructor(){h.add(this),f.set(this,[]),P.set(this,1),d.set(this,e.BOPM_BLOCK),G.set(this,!1),U.set(this,void 0),u.set(this,t.CCUT_AUTO)}setErrorListener(_){}addImageToBuffer(E){var t;if(!N(E))throw new TypeError("Invalid 'image'.");if((null===(t=E.tag)||void 0===t?void 0:t.hasOwnProperty("imageId"))&&"number"==typeof E.tag.imageId&&this.hasImage(E.tag.imageId))throw new Error("Existed imageId.");if(_(this,f,"f").length>=_(this,P,"f"))switch(_(this,d,"f")){case e.BOPM_BLOCK:break;case e.BOPM_UPDATE:if(_(this,f,"f").push(E),T(_(this,U,"f"))&&A(_(this,U,"f").imageId)&&1==_(this,U,"f").keepInBuffer)for(;_(this,f,"f").length>_(this,P,"f");){const E=_(this,f,"f").findIndex((E=>{var e;return(null===(e=E.tag)||void 0===e?void 0:e.imageId)!==_(this,U,"f").imageId}));_(this,f,"f").splice(E,1)}else _(this,f,"f").splice(0,_(this,f,"f").length-_(this,P,"f"))}else _(this,f,"f").push(E)}getImage(){if(0===_(this,f,"f").length)return null;let E;if(_(this,U,"f")&&A(_(this,U,"f").imageId)){const e=_(this,h,"m",g).call(this,_(this,U,"f").imageId);if(e<0)throw new Error(`Image with id ${_(this,U,"f").imageId} doesn't exist.`);E=_(this,f,"f").slice(e,e+1)[0]}else E=_(this,f,"f").pop();if([I.IPF_RGB_565,I.IPF_RGB_555,I.IPF_RGB_888,I.IPF_ARGB_8888,I.IPF_RGB_161616,I.IPF_ARGB_16161616,I.IPF_ABGR_8888,I.IPF_ABGR_16161616,I.IPF_BGR_888].includes(E.format)){if(_(this,u,"f")===t.CCUT_RGB_R_CHANNEL_ONLY){F._onLog&&F._onLog("only get R channel data.");const _=new Uint8Array(E.width*E.height);for(let e=0;e<_.length;e++)switch(E.format){case I.IPF_RGB_565:case I.IPF_RGB_555:case I.IPF_RGB_888:case I.IPF_RGB_161616:_[e]=E.bytes[3*e+2];break;case I.IPF_ARGB_8888:case I.IPF_ARGB_16161616:_[e]=E.bytes[4*e+2];break;case I.IPF_BGR_888:_[e]=E.bytes[3*e];break;case I.IPF_ABGR_8888:case I.IPF_ABGR_16161616:_[e]=E.bytes[4*e]}E.bytes=_,E.stride=E.width,E.format=I.IPF_GRAYSCALED}else if(_(this,u,"f")===t.CCUT_RGB_G_CHANNEL_ONLY){F._onLog&&F._onLog("only get G channel data.");const _=new Uint8Array(E.width*E.height);for(let e=0;e<_.length;e++)switch(E.format){case I.IPF_RGB_565:case I.IPF_RGB_555:case I.IPF_RGB_888:case I.IPF_RGB_161616:case I.IPF_BGR_888:_[e]=E.bytes[3*e+1];break;case I.IPF_ARGB_8888:case I.IPF_ARGB_16161616:case I.IPF_ABGR_8888:case I.IPF_ABGR_16161616:_[e]=E.bytes[4*e+1]}E.bytes=_,E.stride=E.width,E.format=I.IPF_GRAYSCALED}else if(_(this,u,"f")===t.CCUT_RGB_B_CHANNEL_ONLY){F._onLog&&F._onLog("only get B channel data.");const _=new Uint8Array(E.width*E.height);for(let e=0;e<_.length;e++)switch(E.format){case I.IPF_RGB_565:case I.IPF_RGB_555:case I.IPF_RGB_888:case I.IPF_RGB_161616:_[e]=E.bytes[3*e];break;case I.IPF_ARGB_8888:case I.IPF_ARGB_16161616:_[e]=E.bytes[4*e];break;case I.IPF_BGR_888:_[e]=E.bytes[3*e+2];break;case I.IPF_ABGR_8888:case I.IPF_ABGR_16161616:_[e]=E.bytes[4*e+2]}E.bytes=_,E.stride=E.width,E.format=I.IPF_GRAYSCALED}}else[I.IPF_NV21,I.IPF_NV12].includes(E.format)&&F._onLog&&F._onLog("NV21 or NV12 is not supported.");return E}setNextImageToReturn(_,e){if(!((..._)=>0!==_.length&&_.every((_=>A(_))))(_))throw new TypeError("Invalid 'imageId'.");if(void 0!==e&&!r(e))throw new TypeError("Invalid 'keepInBuffer'.");E(this,U,{imageId:_,keepInBuffer:e},"f")}_resetNextReturnedImage(){E(this,U,null,"f")}hasImage(E){return _(this,h,"m",g).call(this,E)>=0}startFetching(){E(this,G,!0,"f")}stopFetching(){E(this,G,!1,"f")}setMaxImageCount(e){if("number"!=typeof e)throw new TypeError("Invalid 'count'.");if(e<1||Math.round(e)!==e)throw new Error("Invalid 'count'.");for(E(this,P,e,"f");_(this,f,"f")&&_(this,f,"f").length>e;)_(this,f,"f").shift()}getMaxImageCount(){return _(this,P,"f")}getImageCount(){return _(this,f,"f").length}clearBuffer(){_(this,f,"f").length=0}isBufferEmpty(){return 0===_(this,f,"f").length}setBufferOverflowProtectionMode(_){E(this,d,_,"f")}getBufferOverflowProtectionMode(){return _(this,d,"f")}setColourChannelUsageType(_){E(this,u,_,"f")}getColourChannelUsageType(){return _(this,u,"f")}}f=new WeakMap,P=new WeakMap,d=new WeakMap,G=new WeakMap,U=new WeakMap,u=new WeakMap,h=new WeakSet,g=function(E){if("number"!=typeof E)throw new TypeError("Invalid 'imageId'.");return _(this,f,"f").findIndex((_=>{var e;return(null===(e=_.tag)||void 0===e?void 0:e.imageId)===E}))};const p="undefined"==typeof self,V=(()=>{if(!p&&document.currentScript){let _=document.currentScript.src,E=_.indexOf("?");if(-1!=E)_=_.substring(0,E);else{let E=_.indexOf("#");-1!=E&&(_=_.substring(0,E))}return _.substring(0,_.lastIndexOf("/")+1)}return"./"})(),B=_=>{if(null==_&&(_="./"),p);else{let E=document.createElement("a");E.href=_,_=E.href}return _.endsWith("/")||(_+="/"),_};let w,m,y,b,v;"undefined"!=typeof navigator&&(w=navigator,m=w.userAgent,y=w.platform,b=w.mediaDevices),function(){if(!p){const _={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:w.vendor,search:"Apple",verSearch:["Version","iPhone OS","CPU OS"]},Firefox:null,Explorer:{search:"MSIE",verSearch:"MSIE"}},E={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:y,search:"Win"},Mac:{str:y},Linux:{str:y}};let e="unknownBrowser",t=0,I="unknownOS";for(let E in _){const I=_[E]||{};let s=I.str||m,C=I.search||E,r=I.verStr||m,A=I.verSearch||E;if(A instanceof Array||(A=[A]),-1!=s.indexOf(C)){e=E;for(let _ of A){let E=r.indexOf(_);if(-1!=E){t=parseFloat(r.substring(E+_.length+1));break}}break}}for(let _ in E){const e=E[_]||{};let t=e.str||m,s=e.search||_;if(-1!=t.indexOf(s)){I=_;break}}"Linux"==I&&-1!=m.indexOf("Windows NT")&&(I="HarmonyOS"),v={browser:e,version:t,OS:I}}p&&(v={browser:"ssr",version:0,OS:"ssr"})}();const Y="undefined"!=typeof WebAssembly&&m&&!(/Safari/.test(m)&&!/Chrome/.test(m)&&/\(.+\s11_2_([2-6]).*\)/.test(m)),k=!("undefined"==typeof Worker),H=!(!b||!b.getUserMedia),Z=async()=>{let _=!1;if(H)try{(await b.getUserMedia({video:!0})).getTracks().forEach((_=>{_.stop()})),_=!0}catch(_){}return _};"Chrome"===v.browser&&v.version>66||"Safari"===v.browser&&v.version>13||"OPR"===v.browser&&v.version>43||"Edge"===v.browser&&v.version;const X=_=>_&&"object"==typeof _&&"function"==typeof _.then;class x extends Promise{constructor(_){let E,e;super(((_,t)=>{E=_,e=t})),this._s="pending",this.resolve=_=>{this.isPending&&(X(_)?this.task=_:(this._s="fulfilled",E(_)))},this.reject=_=>{this.isPending&&(this._s="rejected",e(_))},this.task=_}get status(){return this._s}get isPending(){return"pending"===this._s}get isFulfilled(){return"fulfilled"===this._s}get isRejected(){return"rejected"===this._s}get task(){return this._task}set task(_){let E;this._task=_,X(_)?E=_:"function"==typeof _&&(E=new Promise(_)),E&&(async()=>{try{const e=await E;_===this._task&&this.resolve(e)}catch(E){_===this._task&&this.reject(E)}})()}get isEmpty(){return null==this._task}}const W={},j=_=>{let E=W[_],e=!1;return E?E.isEmpty?E.task=()=>{}:e=!0:E=W[_]=new x((()=>{})),{p:E,justWait:e}},K=_=>W[_]=W[_]||new x;let J,Q=0;const z=()=>Q++,$={};let q;const __=_=>{q=_,J&&J.postMessage({type:"setBLog",body:{value:!!_}})};let E_=!1;const e_=_=>{E_=_,J&&J.postMessage({type:"setBDebug",body:{value:!!_}})},t_={},I_={},s_={std:{version:"1.0.0",path:"https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.0.0/dist/"},core:{version:"3.0.30-beta-202401102201",path:V},dip:{version:"2.0.30",path:"https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.0.30/dist/"},dcm:"https://cdn.jsdelivr.net/npm/dynamsoft-character-mpdels@1.0.0/dist/"},C_=new Proxy(s_,{get(_,E,e){let t=Reflect.get(_,E,e);return t&&t.path&&(t=t.path),t}}),r_={core:{js:!0,wasm:!0},dip:{wasm:!0}},A_=async _=>{_ instanceof Array||(_=_?[_]:[]),_=_.map((_=>_.toLowerCase())).filter((_=>"core"!=_&&"std"!=_));for(let E of _)if(!r_[E]&&"dedicator"!==E)throw Error("Module '"+E+"' not existed.");_.some((_=>["dbr","dlr","ddn"].includes(_)))&&(_.unshift("dip"),_=[...new Set(_)]);let E=!1;const e=[];{const{p:_,justWait:t}=j("core");t?await _:(e.push(_),E=!0)}const t={};for(let E of _){const{p:_,justWait:I}=j(E);I?await _:e.push(_),t[E]=r_[E]}if(0==e.length)return;const I={};for(let _ in C_){if("rootDirectory"==_)continue;let E=C_[_];C_.rootDirectory&&(E=C_.rootDirectory+"/"+E),I[_]=B(E)}const s={engineResourcePaths:I,autoResources:t,names:_};if(E){s.needLoadCore=!0;let _=I.core+T_._workerName;I.rootDirectory&&(_=I.rootDirectory+_),_.startsWith(location.origin)||(_=await fetch(_).then((_=>_.blob())).then((_=>URL.createObjectURL(_)))),J=new Worker(_),J.onerror=_=>{let E=new Error(_.message);for(let _ of e)_.reject(E)},J.addEventListener("message",(_=>{let E=_.data?_.data:_;switch(E.type){case"log":q&&q(E.message);break;case"task":{let _=E.id,e=E.body;try{$[_](e),delete $[_]}catch(E){throw delete $[_],E}break}case"event":{let _=E.id,e=E.body;try{$[_](e)}catch(_){throw _}break}default:console.log(_)}})),s.bLog=!!q,s.bd=E_,s.dm=location.origin.startsWith("http")?location.origin:"https://localhost"}let C=Q++;return $[C]=_=>{if(_.success){Object.assign(t_,_.versions),"{}"!==JSON.stringify(_.versions)&&(T_._versions=_.versions);for(let _ of e)_.resolve(void 0)}else{const E=Error(_.message);_.stack&&(E.stack=_.stack);for(let _ of e)_.reject(E)}},J.postMessage({type:"loadWasm",body:s,id:C}),e[0]};class T_{static get engineResourcePaths(){return C_}static set engineResourcePaths(_){Object.assign(s_,_)}static get bSupportDce4Module(){return this._bSupportDce4Module}static get bSupportIRTModule(){return this._bSupportIRTModule}static get versions(){return this._versions}static get onLog(){return q}static set onLog(_){__(_)}static get _bDebug(){return E_}static set _bDebug(_){e_(_)}static isModuleLoaded(_){return _=(_=_||"core").toLowerCase(),!!W[_]&&W[_].isFulfilled}static async loadWasm(_){return await A_(_)}static async detectEnvironment(){return await(async()=>({wasm:Y,worker:k,getUserMedia:H,camera:await Z(),browser:v.browser,version:v.version,OS:v.OS}))()}static async getModuleVersion(){return await new Promise(((_,E)=>{let e=z();$[e]=async e=>{if(e.success)return _(e.versions);{let _=new Error(e.message);return _.stack=e.stack+"\n"+_.stack,E(_)}},J.postMessage({type:"getModuleVersion",id:e})}))}static getVersion(){const _=t_.core&&t_.core.worker,E=t_.core&&t_.core.wasm;return`3.0.30-beta-202401102201(Worker: ${_||"Not Loaded"}, Wasm: ${E||"Not Loaded"})`}static enableLogging(){F._onLog=console.log}static disableLogging(){F._onLog=null}static async cfd(_){return await new Promise(((E,e)=>{let t=z();$[t]=async _=>{if(_.success)return E();{let E=new Error(_.message);return E.stack=_.stack+"\n"+E.stack,e(E)}},J.postMessage({type:"cfd",id:t,body:{count:_}})}))}}var n_,R_,N_,i_,o_,D_,L_,a_,O_,S_,c_;T_._bSupportDce4Module=-1,T_._bSupportIRTModule=-1,T_._versions=null,T_._workerName="core.worker.js",T_.browserInfo=v,function(_){_[_.CRIT_ORIGINAL_IMAGE=1]="CRIT_ORIGINAL_IMAGE",_[_.CRIT_BARCODE=2]="CRIT_BARCODE",_[_.CRIT_TEXT_LINE=4]="CRIT_TEXT_LINE",_[_.CRIT_DETECTED_QUAD=8]="CRIT_DETECTED_QUAD",_[_.CRIT_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",_[_.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT"}(n_||(n_={})),function(_){_[_.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",_[_.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",_[_.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",_[_.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED"}(R_||(R_={})),function(_){_[_.EC_OK=0]="EC_OK",_[_.EC_UNKNOWN=-1e4]="EC_UNKNOWN",_[_.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",_[_.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",_[_.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",_[_.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",_[_.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",_[_.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",_[_.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",_[_.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",_[_.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",_[_.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",_[_.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",_[_.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",_[_.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",_[_.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",_[_.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",_[_.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",_[_.EC_TIMEOUT=-10026]="EC_TIMEOUT",_[_.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",_[_.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",_[_.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",_[_.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",_[_.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",_[_.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",_[_.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",_[_.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",_[_.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",_[_.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",_[_.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",_[_.EC_LICENSE_KEY_NOT_MATCH=-10043]="EC_LICENSE_KEY_NOT_MATCH",_[_.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",_[_.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",_[_.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",_[_.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",_[_.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",_[_.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",_[_.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",_[_.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",_[_.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",_[_.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",_[_.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",_[_.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",_[_.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",_[_.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",_[_.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",_[_.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",_[_.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",_[_.EC_FILE_ALREADY_EXISTS=-10067]="EC_FILE_ALREADY_EXISTS",_[_.EC_CREATE_FILE_FAILED=-10068]="EC_CREATE_FILE_FAILED",_[_.EC_IMAGE_DATA_INVALID=-10069]="EC_IMAGE_DATA_INVALID",_[_.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",_[_.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",_[_.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",_[_.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",_[_.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",_[_.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",_[_.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",_[_.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",_[_.EC_LICENSE_VERSION_NOT_MATCH=-20011]="EC_LICENSE_VERSION_NOT_MATCH",_[_.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",_[_.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",_[_.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",_[_.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",_[_.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",_[_.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",_[_.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",_[_.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",_[_.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",_[_.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",_[_.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",_[_.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",_[_.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",_[_.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",_[_.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",_[_.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",_[_.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",_[_.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",_[_.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",_[_.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",_[_.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",_[_.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",_[_.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",_[_.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",_[_.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",_[_.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",_[_.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",_[_.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",_[_.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",_[_.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",_[_.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",_[_.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID"}(N_||(N_={})),function(_){_[_.GEM_SKIP=0]="GEM_SKIP",_[_.GEM_AUTO=1]="GEM_AUTO",_[_.GEM_GENERAL=2]="GEM_GENERAL",_[_.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",_[_.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",_[_.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",_[_.GEM_REV=-2147483648]="GEM_REV"}(i_||(i_={})),function(_){_[_.GTM_SKIP=0]="GTM_SKIP",_[_.GTM_INVERTED=1]="GTM_INVERTED",_[_.GTM_ORIGINAL=2]="GTM_ORIGINAL",_[_.GTM_AUTO=4]="GTM_AUTO",_[_.GTM_REV=-2147483648]="GTM_REV"}(o_||(o_={})),function(_){_[_.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",_[_.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME"}(D_||(D_={})),function(_){_[_.PDFRM_VECTOR=1]="PDFRM_VECTOR",_[_.PDFRM_RASTER=2]="PDFRM_RASTER",_[_.PDFRM_REV=-2147483648]="PDFRM_REV"}(L_||(L_={})),function(_){_[_.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",_[_.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES"}(a_||(a_={})),function(_){_[_.IRUT_NULL=0]="IRUT_NULL",_[_.IRUT_COLOUR_IMAGE=1]="IRUT_COLOUR_IMAGE",_[_.IRUT_SCALED_DOWN_COLOUR_IMAGE=2]="IRUT_SCALED_DOWN_COLOUR_IMAGE",_[_.IRUT_GRAYSCALE_IMAGE=4]="IRUT_GRAYSCALE_IMAGE",_[_.IRUT_TRANSOFORMED_GRAYSCALE_IMAGE=8]="IRUT_TRANSOFORMED_GRAYSCALE_IMAGE",_[_.IRUT_ENHANCED_GRAYSCALE_IMAGE=16]="IRUT_ENHANCED_GRAYSCALE_IMAGE",_[_.IRUT_PREDETECTED_REGIONS=32]="IRUT_PREDETECTED_REGIONS",_[_.IRUT_BINARY_IMAGE=64]="IRUT_BINARY_IMAGE",_[_.IRUT_TEXTURE_DETECTION_RESULT=128]="IRUT_TEXTURE_DETECTION_RESULT",_[_.IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE=256]="IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE",_[_.IRUT_TEXTURE_REMOVED_BINARY_IMAGE=512]="IRUT_TEXTURE_REMOVED_BINARY_IMAGE",_[_.IRUT_CONTOURS=1024]="IRUT_CONTOURS",_[_.IRUT_LINE_SEGMENTS=2048]="IRUT_LINE_SEGMENTS",_[_.IRUT_TEXT_ZONES=4096]="IRUT_TEXT_ZONES",_[_.IRUT_TEXT_REMOVED_BINARY_IMAGE=8192]="IRUT_TEXT_REMOVED_BINARY_IMAGE",_[_.IRUT_CANDIDATE_BARCODE_ZONES=16384]="IRUT_CANDIDATE_BARCODE_ZONES",_[_.IRUT_LOCALIZED_BARCODES=32768]="IRUT_LOCALIZED_BARCODES",_[_.IRUT_SCALED_UP_BARCODE_IMAGE=65536]="IRUT_SCALED_UP_BARCODE_IMAGE",_[_.IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE=131072]="IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE",_[_.IRUT_COMPLEMENTED_BARCODE_IMAGE=262144]="IRUT_COMPLEMENTED_BARCODE_IMAGE",_[_.IRUT_DECODED_BARCODES=524288]="IRUT_DECODED_BARCODES",_[_.IRUT_LONG_LINES=1048576]="IRUT_LONG_LINES",_[_.IRUT_CORNERS=2097152]="IRUT_CORNERS",_[_.IRUT_CANDIDATE_QUAD_EDGES=4194304]="IRUT_CANDIDATE_QUAD_EDGES",_[_.IRUT_DETECTED_QUADS=8388608]="IRUT_DETECTED_QUADS",_[_.IRUT_LOCALIZED_TEXT_LINES=16777216]="IRUT_LOCALIZED_TEXT_LINES",_[_.IRUT_RECOGNIZED_TEXT_LINES=33554432]="IRUT_RECOGNIZED_TEXT_LINES",_[_.IRUT_NORMALIZED_IMAGES=67108864]="IRUT_NORMALIZED_IMAGES",_[_.IRUT_ALL=134217727]="IRUT_ALL"}(O_||(O_={})),function(_){_[_.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",_[_.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",_[_.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",_[_.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",_[_.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",_[_.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",_[_.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE",_[_.ROET_SOURCE_IMAGE=7]="ROET_SOURCE_IMAGE",_[_.ROET_TARGET_ROI=8]="ROET_TARGET_ROI"}(S_||(S_={})),function(_){_[_.ST_NULL=0]="ST_NULL",_[_.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",_[_.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",_[_.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",_[_.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",_[_.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",_[_.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",_[_.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION"}(c_||(c_={}));export{T_ as CoreModule,e as EnumBufferOverflowProtectionMode,n_ as EnumCapturedResultItemType,t as EnumColourChannelUsageType,R_ as EnumCornerType,N_ as EnumErrorCode,i_ as EnumGrayscaleEnhancementMode,o_ as EnumGrayscaleTransformationMode,I as EnumImagePixelFormat,D_ as EnumImageTagType,O_ as EnumIntermediateResultUnitType,L_ as EnumPDFReadingMode,a_ as EnumRasterDataSource,S_ as EnumRegionObjectElementType,c_ as EnumSectionType,F as ImageSourceAdapter,n as _isArc,R as _isContour,N as _isDSImageData,i as _isDSRect,o as _isImageTag,D as _isLineSegment,L as _isPoint,a as _isPolygon,O as _isQuad,S as _isRect,E_ as bDebug,M as checkIsLink,l as compareVersion,s_ as engineResourcePaths,z as getNextTaskID,t_ as innerVersions,A_ as loadWasm,W as mapAsyncDependency,I_ as mapPackageRegister,$ as mapTaskCallBack,j as newAsyncDependency,q as onLog,c as requestResource,e_ as setBDebug,__ as setOnLog,K as waitAsyncDependency,J as worker,r_ as workerAutoResources}; |
@@ -5,8 +5,8 @@ /*! | ||
* @website https://www.dynamsoft.com | ||
* @copyright Copyright 2023, Dynamsoft Corporation | ||
* @copyright Copyright 2024, Dynamsoft Corporation | ||
* @author Dynamsoft | ||
* @version 3.0.10 | ||
* @version 3.0.30 | ||
* @fileoverview Dynamsoft JavaScript Library for Core | ||
* More info on DC JS: https://www.dynamsoft.com/core/docs/programming/javascript/?ver=latest | ||
* More info on Dynamsoft Core JS: https://www.dynamsoft.com/core/docs/programming/javascript/?ver=latest | ||
*/ | ||
!function(E,_){"object"==typeof exports&&"undefined"!=typeof module?_(exports):"function"==typeof define&&define.amd?define(["exports"],_):_(((E="undefined"!=typeof globalThis?globalThis:E||self).Dynamsoft=E.Dynamsoft||{},E.Dynamsoft.Core={}))}(this,(function(E){"use strict";function _(E,_,I,e){if("a"===I&&!e)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof _?E!==_||!e:!_.has(E))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===I?e:"a"===I?e.call(E):e?e.value:_.get(E)}function I(E,_,I,e,C){if("m"===e)throw new TypeError("Private method is not writable");if("a"===e&&!C)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof _?E!==_||!C:!_.has(E))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===e?C.call(E,I):C?C.value=I:_.set(E,I),I}var e,C,T;"function"==typeof SuppressedError&&SuppressedError,E.EnumBufferOverflowProtectionMode=void 0,(e=E.EnumBufferOverflowProtectionMode||(E.EnumBufferOverflowProtectionMode={}))[e.BOPM_BLOCK=0]="BOPM_BLOCK",e[e.BOPM_UPDATE=1]="BOPM_UPDATE",E.EnumColourChannelUsageType=void 0,(C=E.EnumColourChannelUsageType||(E.EnumColourChannelUsageType={}))[C.CCUT_AUTO=0]="CCUT_AUTO",C[C.CCUT_FULL_CHANNEL=1]="CCUT_FULL_CHANNEL",C[C.CCUT_Y_CHANNEL_ONLY=2]="CCUT_Y_CHANNEL_ONLY",C[C.CCUT_RGB_R_CHANNEL_ONLY=3]="CCUT_RGB_R_CHANNEL_ONLY",C[C.CCUT_RGB_G_CHANNEL_ONLY=4]="CCUT_RGB_G_CHANNEL_ONLY",C[C.CCUT_RGB_B_CHANNEL_ONLY=5]="CCUT_RGB_B_CHANNEL_ONLY",E.EnumImagePixelFormat=void 0,(T=E.EnumImagePixelFormat||(E.EnumImagePixelFormat={}))[T.IPF_BINARY=0]="IPF_BINARY",T[T.IPF_BINARYINVERTED=1]="IPF_BINARYINVERTED",T[T.IPF_GRAYSCALED=2]="IPF_GRAYSCALED",T[T.IPF_NV21=3]="IPF_NV21",T[T.IPF_RGB_565=4]="IPF_RGB_565",T[T.IPF_RGB_555=5]="IPF_RGB_555",T[T.IPF_RGB_888=6]="IPF_RGB_888",T[T.IPF_ARGB_8888=7]="IPF_ARGB_8888",T[T.IPF_RGB_161616=8]="IPF_RGB_161616",T[T.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",T[T.IPF_ABGR_8888=10]="IPF_ABGR_8888",T[T.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",T[T.IPF_BGR_888=12]="IPF_BGR_888",T[T.IPF_BINARY_8=13]="IPF_BINARY_8",T[T.IPF_NV12=14]="IPF_NV12";const A=E=>Object.prototype.toString.call(E),R=E=>Array.isArray?Array.isArray(E):"[object Array]"===A(E),t=E=>"[object Boolean]"===A(E),N=E=>"number"==typeof E&&!Number.isNaN(E),D=E=>null!==E&&"object"==typeof E&&!Array.isArray(E),L=E=>!!D(E)&&(E.bytes instanceof Uint8Array&&(!!N(E.width)&&(!(E.width<=0)&&(!!N(E.height)&&(!(E.height<=0)&&(!!N(E.stride)&&(!(E.stride<=0)&&("format"in E&&!("tag"in E&&!O(E.tag)))))))))),O=E=>!!D(E)&&(!!N(E.imageId)&&"type"in E),n=E=>!!D(E)&&(!!N(E.x)&&!!N(E.y));var a,i,r,o,S,s,m,P,M,u,F,U,G,l,d,f,h,g,c;i=new WeakMap,r=new WeakMap,o=new WeakMap,S=new WeakMap,s=new WeakMap,m=new WeakMap,a=new WeakSet,P=function(E){if("number"!=typeof E)throw new TypeError("Invalid 'imageId'.");return _(this,i,"f").findIndex((_=>{var I;return(null===(I=_.tag)||void 0===I?void 0:I.imageId)===E}))};E.EnumCapturedResultItemType=void 0,(M=E.EnumCapturedResultItemType||(E.EnumCapturedResultItemType={}))[M.CRIT_ORIGINAL_IMAGE=1]="CRIT_ORIGINAL_IMAGE",M[M.CRIT_BARCODE=2]="CRIT_BARCODE",M[M.CRIT_TEXT_LINE=4]="CRIT_TEXT_LINE",M[M.CRIT_DETECTED_QUAD=8]="CRIT_DETECTED_QUAD",M[M.CRIT_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",M[M.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT",E.EnumCornerType=void 0,(u=E.EnumCornerType||(E.EnumCornerType={}))[u.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",u[u.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",u[u.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",u[u.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED",E.EnumErrorCode=void 0,(F=E.EnumErrorCode||(E.EnumErrorCode={}))[F.EC_OK=0]="EC_OK",F[F.EC_UNKNOWN=-1e4]="EC_UNKNOWN",F[F.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",F[F.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",F[F.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",F[F.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",F[F.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",F[F.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",F[F.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",F[F.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",F[F.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",F[F.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",F[F.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",F[F.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",F[F.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",F[F.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",F[F.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",F[F.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",F[F.EC_TIMEOUT=-10026]="EC_TIMEOUT",F[F.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",F[F.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",F[F.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",F[F.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",F[F.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",F[F.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",F[F.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",F[F.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",F[F.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",F[F.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",F[F.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",F[F.EC_LICENSE_KEY_NOT_MATCHED=-10043]="EC_LICENSE_KEY_NOT_MATCHED",F[F.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",F[F.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",F[F.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",F[F.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",F[F.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",F[F.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",F[F.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",F[F.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",F[F.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",F[F.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",F[F.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",F[F.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",F[F.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",F[F.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",F[F.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",F[F.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",F[F.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",F[F.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",F[F.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",F[F.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",F[F.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",F[F.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",F[F.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",F[F.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",F[F.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",F[F.EC_LICENSE_VERSION_NOT_MATCH=-20011]="EC_LICENSE_VERSION_NOT_MATCH",F[F.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",F[F.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",F[F.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",F[F.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",F[F.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",F[F.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",F[F.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",F[F.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",F[F.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",F[F.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",F[F.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",F[F.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",F[F.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",F[F.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",F[F.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",F[F.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",F[F.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",F[F.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",F[F.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",F[F.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",F[F.EC_CAMERA_MODULE_NOT_EXIST=-60003]="EC_CAMERA_MODULE_NOT_EXIST",F[F.EC_CAMERA_ID_NOT_EXIST=-60006]="EC_CAMERA_ID_NOT_EXIST",F[F.EC_NO_SENSOR=-60045]="EC_NO_SENSOR",F[F.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",F[F.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",F[F.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",F[F.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",F[F.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",F[F.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",F[F.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",F[F.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",F[F.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",F[F.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",F[F.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",F[F.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID",E.EnumGrayscaleEnhancementMode=void 0,(U=E.EnumGrayscaleEnhancementMode||(E.EnumGrayscaleEnhancementMode={}))[U.GEM_SKIP=0]="GEM_SKIP",U[U.GEM_AUTO=1]="GEM_AUTO",U[U.GEM_GENERAL=2]="GEM_GENERAL",U[U.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",U[U.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",U[U.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",U[U.GEM_REV=-2147483648]="GEM_REV",E.EnumGrayscaleTransformationMode=void 0,(G=E.EnumGrayscaleTransformationMode||(E.EnumGrayscaleTransformationMode={}))[G.GTM_SKIP=0]="GTM_SKIP",G[G.GTM_INVERTED=1]="GTM_INVERTED",G[G.GTM_ORIGINAL=2]="GTM_ORIGINAL",G[G.GTM_AUTO=4]="GTM_AUTO",G[G.GTM_REV=-2147483648]="GTM_REV",E.EnumImageTagType=void 0,(l=E.EnumImageTagType||(E.EnumImageTagType={}))[l.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",l[l.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME",E.EnumPDFReadingMode=void 0,(d=E.EnumPDFReadingMode||(E.EnumPDFReadingMode={}))[d.PDFRM_VECTOR=1]="PDFRM_VECTOR",d[d.PDFRM_RASTER=2]="PDFRM_RASTER",d[d.PDFRM_REV=-2147483648]="PDFRM_REV",E.EnumRasterDataSource=void 0,(f=E.EnumRasterDataSource||(E.EnumRasterDataSource={}))[f.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",f[f.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES",E.EnumIntermediateResultUnitType=void 0,(h=E.EnumIntermediateResultUnitType||(E.EnumIntermediateResultUnitType={}))[h.IRUT_NULL=0]="IRUT_NULL",h[h.IRUT_COLOUR_IMAGE=1]="IRUT_COLOUR_IMAGE",h[h.IRUT_SCALED_DOWN_COLOUR_IMAGE=2]="IRUT_SCALED_DOWN_COLOUR_IMAGE",h[h.IRUT_GRAYSCALE_IMAGE=4]="IRUT_GRAYSCALE_IMAGE",h[h.IRUT_TRANSOFORMED_GRAYSCALE_IMAGE=8]="IRUT_TRANSOFORMED_GRAYSCALE_IMAGE",h[h.IRUT_ENHANCED_GRAYSCALE_IMAGE=16]="IRUT_ENHANCED_GRAYSCALE_IMAGE",h[h.IRUT_PREDETECTED_REGIONS=32]="IRUT_PREDETECTED_REGIONS",h[h.IRUT_BINARY_IMAGE=64]="IRUT_BINARY_IMAGE",h[h.IRUT_TEXTURE_DETECTION_RESULT=128]="IRUT_TEXTURE_DETECTION_RESULT",h[h.IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE=256]="IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE",h[h.IRUT_TEXTURE_REMOVED_BINARY_IMAGE=512]="IRUT_TEXTURE_REMOVED_BINARY_IMAGE",h[h.IRUT_CONTOURS=1024]="IRUT_CONTOURS",h[h.IRUT_LINE_SEGMENTS=2048]="IRUT_LINE_SEGMENTS",h[h.IRUT_TEXT_ZONES=4096]="IRUT_TEXT_ZONES",h[h.IRUT_TEXT_REMOVED_BINARY_IMAGE=8192]="IRUT_TEXT_REMOVED_BINARY_IMAGE",h[h.IRUT_CANDIDATE_BARCODE_ZONES=16384]="IRUT_CANDIDATE_BARCODE_ZONES",h[h.IRUT_LOCALIZED_BARCODES=32768]="IRUT_LOCALIZED_BARCODES",h[h.IRUT_SCALED_UP_BARCODE_IMAGE=65536]="IRUT_SCALED_UP_BARCODE_IMAGE",h[h.IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE=131072]="IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE",h[h.IRUT_COMPLEMENTED_BARCODE_IMAGE=262144]="IRUT_COMPLEMENTED_BARCODE_IMAGE",h[h.IRUT_DECODED_BARCODES=524288]="IRUT_DECODED_BARCODES",h[h.IRUT_LONG_LINES=1048576]="IRUT_LONG_LINES",h[h.IRUT_CORNERS=2097152]="IRUT_CORNERS",h[h.IRUT_CANDIDATE_QUAD_EDGES=4194304]="IRUT_CANDIDATE_QUAD_EDGES",h[h.IRUT_DETECTED_QUADS=8388608]="IRUT_DETECTED_QUADS",h[h.IRUT_LOCALIZED_TEXT_LINES=16777216]="IRUT_LOCALIZED_TEXT_LINES",h[h.IRUT_RECOGNIZED_TEXT_LINES=33554432]="IRUT_RECOGNIZED_TEXT_LINES",h[h.IRUT_NORMALIZED_IMAGES=67108864]="IRUT_NORMALIZED_IMAGES",h[h.IRUT_ALL=134217727]="IRUT_ALL",E.EnumRegionObjectElementType=void 0,(g=E.EnumRegionObjectElementType||(E.EnumRegionObjectElementType={}))[g.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",g[g.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",g[g.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",g[g.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",g[g.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",g[g.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",g[g.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE",E.EnumSectionType=void 0,(c=E.EnumSectionType||(E.EnumSectionType={}))[c.ST_NULL=0]="ST_NULL",c[c.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",c[c.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",c[c.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",c[c.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",c[c.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",c[c.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",c[c.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION",E.CoreModule=class{static getVersion(){return"3.0.10"}},E.ImageSourceAdapter=class{constructor(){a.add(this),i.set(this,[]),r.set(this,1),o.set(this,E.EnumBufferOverflowProtectionMode.BOPM_BLOCK),S.set(this,!1),s.set(this,void 0),m.set(this,E.EnumColourChannelUsageType.CCUT_AUTO)}get _isFetchingStarted(){return _(this,S,"f")}addImageToBuffer(I){var e;if(!L(I))throw new TypeError("Invalid 'image'.");if((null===(e=I.tag)||void 0===e?void 0:e.hasOwnProperty("imageId"))&&"number"==typeof I.tag.imageId&&this.hasImage(I.tag.imageId))throw new Error("Existed imageId.");if(_(this,i,"f").length>=_(this,r,"f"))switch(_(this,o,"f")){case E.EnumBufferOverflowProtectionMode.BOPM_BLOCK:break;case E.EnumBufferOverflowProtectionMode.BOPM_UPDATE:if(_(this,i,"f").push(I),D(_(this,s,"f"))&&N(_(this,s,"f").imageId)&&1==_(this,s,"f").keepInBuffer)for(;_(this,i,"f").length>_(this,r,"f");){const E=_(this,i,"f").findIndex((E=>{var I;return(null===(I=E.tag)||void 0===I?void 0:I.imageId)!==_(this,s,"f").imageId}));_(this,i,"f").splice(E,1)}else _(this,i,"f").splice(0,_(this,i,"f").length-_(this,r,"f"))}else _(this,i,"f").push(I)}getImage(){if(0===_(this,i,"f").length)return null;let I;if(_(this,s,"f")&&N(_(this,s,"f").imageId)){const E=_(this,a,"m",P).call(this,_(this,s,"f").imageId);if(E<0)throw new Error(`Image with id ${_(this,s,"f").imageId} doesn't exist.`);I=_(this,i,"f").slice(E,E+1)[0]}else I=_(this,i,"f").pop();if([E.EnumImagePixelFormat.IPF_RGB_565,E.EnumImagePixelFormat.IPF_RGB_555,E.EnumImagePixelFormat.IPF_RGB_888,E.EnumImagePixelFormat.IPF_ARGB_8888,E.EnumImagePixelFormat.IPF_RGB_161616,E.EnumImagePixelFormat.IPF_ARGB_16161616,E.EnumImagePixelFormat.IPF_ABGR_8888,E.EnumImagePixelFormat.IPF_ABGR_16161616,E.EnumImagePixelFormat.IPF_BGR_888].includes(I.format)){if(_(this,m,"f")===E.EnumColourChannelUsageType.CCUT_RGB_R_CHANNEL_ONLY){const _=new Uint8Array(I.width*I.height);for(let e=0;e<_.length;e++)switch(I.format){case E.EnumImagePixelFormat.IPF_RGB_565:case E.EnumImagePixelFormat.IPF_RGB_555:case E.EnumImagePixelFormat.IPF_RGB_888:case E.EnumImagePixelFormat.IPF_RGB_161616:_[e]=I.bytes[3*e+2];break;case E.EnumImagePixelFormat.IPF_ARGB_8888:case E.EnumImagePixelFormat.IPF_ARGB_16161616:_[e]=I.bytes[4*e+2];break;case E.EnumImagePixelFormat.IPF_BGR_888:_[e]=I.bytes[3*e];break;case E.EnumImagePixelFormat.IPF_ABGR_8888:case E.EnumImagePixelFormat.IPF_ABGR_16161616:_[e]=I.bytes[4*e]}I.bytes=_,I.stride=I.width,I.format=E.EnumImagePixelFormat.IPF_GRAYSCALED}else if(_(this,m,"f")===E.EnumColourChannelUsageType.CCUT_RGB_G_CHANNEL_ONLY){const _=new Uint8Array(I.width*I.height);for(let e=0;e<_.length;e++)switch(I.format){case E.EnumImagePixelFormat.IPF_RGB_565:case E.EnumImagePixelFormat.IPF_RGB_555:case E.EnumImagePixelFormat.IPF_RGB_888:case E.EnumImagePixelFormat.IPF_RGB_161616:case E.EnumImagePixelFormat.IPF_BGR_888:_[e]=I.bytes[3*e+1];break;case E.EnumImagePixelFormat.IPF_ARGB_8888:case E.EnumImagePixelFormat.IPF_ARGB_16161616:case E.EnumImagePixelFormat.IPF_ABGR_8888:case E.EnumImagePixelFormat.IPF_ABGR_16161616:_[e]=I.bytes[4*e+1]}I.bytes=_,I.stride=I.width,I.format=E.EnumImagePixelFormat.IPF_GRAYSCALED}else if(_(this,m,"f")===E.EnumColourChannelUsageType.CCUT_RGB_B_CHANNEL_ONLY){const _=new Uint8Array(I.width*I.height);for(let e=0;e<_.length;e++)switch(I.format){case E.EnumImagePixelFormat.IPF_RGB_565:case E.EnumImagePixelFormat.IPF_RGB_555:case E.EnumImagePixelFormat.IPF_RGB_888:case E.EnumImagePixelFormat.IPF_RGB_161616:_[e]=I.bytes[3*e];break;case E.EnumImagePixelFormat.IPF_ARGB_8888:case E.EnumImagePixelFormat.IPF_ARGB_16161616:_[e]=I.bytes[4*e];break;case E.EnumImagePixelFormat.IPF_BGR_888:_[e]=I.bytes[3*e+2];break;case E.EnumImagePixelFormat.IPF_ABGR_8888:case E.EnumImagePixelFormat.IPF_ABGR_16161616:_[e]=I.bytes[4*e+2]}I.bytes=_,I.stride=I.width,I.format=E.EnumImagePixelFormat.IPF_GRAYSCALED}}else[E.EnumImagePixelFormat.IPF_NV21,E.EnumImagePixelFormat.IPF_NV12].includes(I.format);return I}setNextImageToReturn(E,_){if(!((...E)=>0!==E.length&&E.every((E=>N(E))))(E))throw new TypeError("Invalid 'imageId'.");if(void 0!==_&&!t(_))throw new TypeError("Invalid 'keepInBuffer'.");I(this,s,{imageId:E,keepInBuffer:_},"f")}_resetNextReturnedImage(){I(this,s,null,"f")}hasImage(E){return _(this,a,"m",P).call(this,E)>=0}startFetching(){I(this,S,!0,"f")}stopFetching(){I(this,S,!1,"f")}setMaximumImageCount(E){if("number"!=typeof E)throw new TypeError("Invalid 'count'.");if(E<1||Math.round(E)!==E)throw new Error("Invalid 'count'.");for(I(this,r,E,"f");_(this,i,"f")&&_(this,i,"f").length>E;)_(this,i,"f").shift()}getMaximumImageCount(){return _(this,r,"f")}getImageCount(){return _(this,i,"f").length}clearBuffer(){_(this,i,"f").length=0}isBufferEmpty(){return 0===_(this,i,"f").length}setBufferOverflowProtectionMode(E){I(this,o,E,"f")}getBufferOverflowProtectionMode(){return _(this,o,"f")}setColourChannelUsageType(E){I(this,m,E,"f")}getColourChannelUsageType(){return _(this,m,"f")}},E.IntermediateResultManager=class{constructor(){this.intermediateResultReceiverSet=new Set}addResultReceiver(E){if("object"!=typeof E)throw new Error("Invalid receiver.");this.intermediateResultReceiverSet.add(E)}removeResultReceiver(E){this.intermediateResultReceiverSet.delete(E)}async getOriginalImage(E){return null}},E.IntermediateResultReceiver=class{constructor(){this.onTaskResultsReceived=null,this.onPredetectedRegionsReceived=null,this.onDecodedBarcodesReceived=null,this.onRecognizedTextLinesReceived=null,this.onDetectedQuadsReceived=null,this.onNormalizedImagesReceived=null}},E._isArc=E=>!!D(E)&&(!!N(E.x)&&(!!N(E.y)&&(!!N(E.radius)&&(!(E.radius<0)&&(!!N(E.startAngle)&&!!N(E.endAngle)))))),E._isContour=E=>!!D(E)&&(!!R(E.points)&&(0!=E.points.length&&!E.points.some((E=>!n(E))))),E._isDSImageData=L,E._isDSRect=E=>!!D(E)&&(!!N(E.left)&&(!(E.left<0)&&(!!N(E.top)&&(!(E.top<0)&&(!!N(E.right)&&(!(E.right<0)&&(!!N(E.bottom)&&(!(E.bottom<0)&&(!(E.left>=E.right)&&(!(E.top>=E.bottom)&&!!t(E.isMeasuredInPercentage))))))))))),E._isImageTag=O,E._isLineSegment=E=>!!D(E)&&(!!n(E.startPoint)&&(!!n(E.endPoint)&&(E.startPoint.x!=E.endPoint.x||E.startPoint.y!=E.endPoint.y))),E._isPoint=n,E._isPolygon=E=>!!D(E)&&(!!R(E.points)&&(0!=E.points.length&&!E.points.some((E=>!n(E))))),E._isQuad=E=>!!D(E)&&(!!R(E.points)&&(0!=E.points.length&&4==E.points.length&&!E.points.some((E=>!n(E))))),E._isRect=E=>!!D(E)&&(!!N(E.x)&&(!!N(E.y)&&(!!N(E.width)&&(!(E.width<0)&&(!!N(E.height)&&(!(E.height<0)&&!("isMeasuredInPercentage"in E&&!t(E.isMeasuredInPercentage)))))))),Object.defineProperty(E,"__esModule",{value:!0})})); | ||
!function(E,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e(((E="undefined"!=typeof globalThis?globalThis:E||self).Dynamsoft=E.Dynamsoft||{},E.Dynamsoft.Core={}))}(this,(function(E){"use strict";function e(E,e,_,t){if("a"===_&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?E!==e||!t:!e.has(E))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===_?t:"a"===_?t.call(E):t?t.value:e.get(E)}function _(E,e,_,t,I){if("m"===t)throw new TypeError("Private method is not writable");if("a"===t&&!I)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?E!==e||!I:!e.has(E))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===t?I.call(E,_):I?I.value=_:e.set(E,_),_}var t,I,r;"function"==typeof SuppressedError&&SuppressedError,E.EnumBufferOverflowProtectionMode=void 0,(t=E.EnumBufferOverflowProtectionMode||(E.EnumBufferOverflowProtectionMode={}))[t.BOPM_BLOCK=0]="BOPM_BLOCK",t[t.BOPM_UPDATE=1]="BOPM_UPDATE",E.EnumColourChannelUsageType=void 0,(I=E.EnumColourChannelUsageType||(E.EnumColourChannelUsageType={}))[I.CCUT_AUTO=0]="CCUT_AUTO",I[I.CCUT_FULL_CHANNEL=1]="CCUT_FULL_CHANNEL",I[I.CCUT_Y_CHANNEL_ONLY=2]="CCUT_Y_CHANNEL_ONLY",I[I.CCUT_RGB_R_CHANNEL_ONLY=3]="CCUT_RGB_R_CHANNEL_ONLY",I[I.CCUT_RGB_G_CHANNEL_ONLY=4]="CCUT_RGB_G_CHANNEL_ONLY",I[I.CCUT_RGB_B_CHANNEL_ONLY=5]="CCUT_RGB_B_CHANNEL_ONLY",E.EnumImagePixelFormat=void 0,(r=E.EnumImagePixelFormat||(E.EnumImagePixelFormat={}))[r.IPF_BINARY=0]="IPF_BINARY",r[r.IPF_BINARYINVERTED=1]="IPF_BINARYINVERTED",r[r.IPF_GRAYSCALED=2]="IPF_GRAYSCALED",r[r.IPF_NV21=3]="IPF_NV21",r[r.IPF_RGB_565=4]="IPF_RGB_565",r[r.IPF_RGB_555=5]="IPF_RGB_555",r[r.IPF_RGB_888=6]="IPF_RGB_888",r[r.IPF_ARGB_8888=7]="IPF_ARGB_8888",r[r.IPF_RGB_161616=8]="IPF_RGB_161616",r[r.IPF_ARGB_16161616=9]="IPF_ARGB_16161616",r[r.IPF_ABGR_8888=10]="IPF_ABGR_8888",r[r.IPF_ABGR_16161616=11]="IPF_ABGR_16161616",r[r.IPF_BGR_888=12]="IPF_BGR_888",r[r.IPF_BINARY_8=13]="IPF_BINARY_8",r[r.IPF_NV12=14]="IPF_NV12";const n=E=>Object.prototype.toString.call(E),o=E=>Array.isArray?Array.isArray(E):"[object Array]"===n(E),s=E=>"[object Boolean]"===n(E),C=E=>"number"==typeof E&&!Number.isNaN(E),a=E=>null!==E&&"object"==typeof E&&!Array.isArray(E),i=E=>!!a(E)&&(E.bytes instanceof Uint8Array&&(!!C(E.width)&&(!(E.width<=0)&&(!!C(E.height)&&(!(E.height<=0)&&(!!C(E.stride)&&(!(E.stride<=0)&&("format"in E&&!("tag"in E&&!T(E.tag)))))))))),T=E=>!!a(E)&&(!!C(E.imageId)&&"type"in E),A=E=>!!a(E)&&(!!C(E.x)&&!!C(E.y));var R,N,D,L,O,u,m,S;class l{get _isFetchingStarted(){return e(this,O,"f")}constructor(){R.add(this),N.set(this,[]),D.set(this,1),L.set(this,E.EnumBufferOverflowProtectionMode.BOPM_BLOCK),O.set(this,!1),u.set(this,void 0),m.set(this,E.EnumColourChannelUsageType.CCUT_AUTO)}setErrorListener(E){}addImageToBuffer(_){var t;if(!i(_))throw new TypeError("Invalid 'image'.");if((null===(t=_.tag)||void 0===t?void 0:t.hasOwnProperty("imageId"))&&"number"==typeof _.tag.imageId&&this.hasImage(_.tag.imageId))throw new Error("Existed imageId.");if(e(this,N,"f").length>=e(this,D,"f"))switch(e(this,L,"f")){case E.EnumBufferOverflowProtectionMode.BOPM_BLOCK:break;case E.EnumBufferOverflowProtectionMode.BOPM_UPDATE:if(e(this,N,"f").push(_),a(e(this,u,"f"))&&C(e(this,u,"f").imageId)&&1==e(this,u,"f").keepInBuffer)for(;e(this,N,"f").length>e(this,D,"f");){const E=e(this,N,"f").findIndex((E=>{var _;return(null===(_=E.tag)||void 0===_?void 0:_.imageId)!==e(this,u,"f").imageId}));e(this,N,"f").splice(E,1)}else e(this,N,"f").splice(0,e(this,N,"f").length-e(this,D,"f"))}else e(this,N,"f").push(_)}getImage(){if(0===e(this,N,"f").length)return null;let _;if(e(this,u,"f")&&C(e(this,u,"f").imageId)){const E=e(this,R,"m",S).call(this,e(this,u,"f").imageId);if(E<0)throw new Error(`Image with id ${e(this,u,"f").imageId} doesn't exist.`);_=e(this,N,"f").slice(E,E+1)[0]}else _=e(this,N,"f").pop();if([E.EnumImagePixelFormat.IPF_RGB_565,E.EnumImagePixelFormat.IPF_RGB_555,E.EnumImagePixelFormat.IPF_RGB_888,E.EnumImagePixelFormat.IPF_ARGB_8888,E.EnumImagePixelFormat.IPF_RGB_161616,E.EnumImagePixelFormat.IPF_ARGB_16161616,E.EnumImagePixelFormat.IPF_ABGR_8888,E.EnumImagePixelFormat.IPF_ABGR_16161616,E.EnumImagePixelFormat.IPF_BGR_888].includes(_.format)){if(e(this,m,"f")===E.EnumColourChannelUsageType.CCUT_RGB_R_CHANNEL_ONLY){l._onLog&&l._onLog("only get R channel data.");const e=new Uint8Array(_.width*_.height);for(let t=0;t<e.length;t++)switch(_.format){case E.EnumImagePixelFormat.IPF_RGB_565:case E.EnumImagePixelFormat.IPF_RGB_555:case E.EnumImagePixelFormat.IPF_RGB_888:case E.EnumImagePixelFormat.IPF_RGB_161616:e[t]=_.bytes[3*t+2];break;case E.EnumImagePixelFormat.IPF_ARGB_8888:case E.EnumImagePixelFormat.IPF_ARGB_16161616:e[t]=_.bytes[4*t+2];break;case E.EnumImagePixelFormat.IPF_BGR_888:e[t]=_.bytes[3*t];break;case E.EnumImagePixelFormat.IPF_ABGR_8888:case E.EnumImagePixelFormat.IPF_ABGR_16161616:e[t]=_.bytes[4*t]}_.bytes=e,_.stride=_.width,_.format=E.EnumImagePixelFormat.IPF_GRAYSCALED}else if(e(this,m,"f")===E.EnumColourChannelUsageType.CCUT_RGB_G_CHANNEL_ONLY){l._onLog&&l._onLog("only get G channel data.");const e=new Uint8Array(_.width*_.height);for(let t=0;t<e.length;t++)switch(_.format){case E.EnumImagePixelFormat.IPF_RGB_565:case E.EnumImagePixelFormat.IPF_RGB_555:case E.EnumImagePixelFormat.IPF_RGB_888:case E.EnumImagePixelFormat.IPF_RGB_161616:case E.EnumImagePixelFormat.IPF_BGR_888:e[t]=_.bytes[3*t+1];break;case E.EnumImagePixelFormat.IPF_ARGB_8888:case E.EnumImagePixelFormat.IPF_ARGB_16161616:case E.EnumImagePixelFormat.IPF_ABGR_8888:case E.EnumImagePixelFormat.IPF_ABGR_16161616:e[t]=_.bytes[4*t+1]}_.bytes=e,_.stride=_.width,_.format=E.EnumImagePixelFormat.IPF_GRAYSCALED}else if(e(this,m,"f")===E.EnumColourChannelUsageType.CCUT_RGB_B_CHANNEL_ONLY){l._onLog&&l._onLog("only get B channel data.");const e=new Uint8Array(_.width*_.height);for(let t=0;t<e.length;t++)switch(_.format){case E.EnumImagePixelFormat.IPF_RGB_565:case E.EnumImagePixelFormat.IPF_RGB_555:case E.EnumImagePixelFormat.IPF_RGB_888:case E.EnumImagePixelFormat.IPF_RGB_161616:e[t]=_.bytes[3*t];break;case E.EnumImagePixelFormat.IPF_ARGB_8888:case E.EnumImagePixelFormat.IPF_ARGB_16161616:e[t]=_.bytes[4*t];break;case E.EnumImagePixelFormat.IPF_BGR_888:e[t]=_.bytes[3*t+2];break;case E.EnumImagePixelFormat.IPF_ABGR_8888:case E.EnumImagePixelFormat.IPF_ABGR_16161616:e[t]=_.bytes[4*t+2]}_.bytes=e,_.stride=_.width,_.format=E.EnumImagePixelFormat.IPF_GRAYSCALED}}else[E.EnumImagePixelFormat.IPF_NV21,E.EnumImagePixelFormat.IPF_NV12].includes(_.format)&&l._onLog&&l._onLog("NV21 or NV12 is not supported.");return _}setNextImageToReturn(E,e){if(!((...E)=>0!==E.length&&E.every((E=>C(E))))(E))throw new TypeError("Invalid 'imageId'.");if(void 0!==e&&!s(e))throw new TypeError("Invalid 'keepInBuffer'.");_(this,u,{imageId:E,keepInBuffer:e},"f")}_resetNextReturnedImage(){_(this,u,null,"f")}hasImage(E){return e(this,R,"m",S).call(this,E)>=0}startFetching(){_(this,O,!0,"f")}stopFetching(){_(this,O,!1,"f")}setMaxImageCount(E){if("number"!=typeof E)throw new TypeError("Invalid 'count'.");if(E<1||Math.round(E)!==E)throw new Error("Invalid 'count'.");for(_(this,D,E,"f");e(this,N,"f")&&e(this,N,"f").length>E;)e(this,N,"f").shift()}getMaxImageCount(){return e(this,D,"f")}getImageCount(){return e(this,N,"f").length}clearBuffer(){e(this,N,"f").length=0}isBufferEmpty(){return 0===e(this,N,"f").length}setBufferOverflowProtectionMode(E){_(this,L,E,"f")}getBufferOverflowProtectionMode(){return e(this,L,"f")}setColourChannelUsageType(E){_(this,m,E,"f")}getColourChannelUsageType(){return e(this,m,"f")}}N=new WeakMap,D=new WeakMap,L=new WeakMap,O=new WeakMap,u=new WeakMap,m=new WeakMap,R=new WeakSet,S=function(E){if("number"!=typeof E)throw new TypeError("Invalid 'imageId'.");return e(this,N,"f").findIndex((e=>{var _;return(null===(_=e.tag)||void 0===_?void 0:_.imageId)===E}))};const c="undefined"==typeof self,P=(()=>{if(!c&&document.currentScript){let E=document.currentScript.src,e=E.indexOf("?");if(-1!=e)E=E.substring(0,e);else{let e=E.indexOf("#");-1!=e&&(E=E.substring(0,e))}return E.substring(0,E.lastIndexOf("/")+1)}return"./"})(),d=E=>{if(null==E&&(E="./"),c);else{let e=document.createElement("a");e.href=E,E=e.href}return E.endsWith("/")||(E+="/"),E};let g,M,f,h,F;"undefined"!=typeof navigator&&(g=navigator,M=g.userAgent,f=g.platform,h=g.mediaDevices),function(){if(!c){const E={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:g.vendor,search:"Apple",verSearch:["Version","iPhone OS","CPU OS"]},Firefox:null,Explorer:{search:"MSIE",verSearch:"MSIE"}},e={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:f,search:"Win"},Mac:{str:f},Linux:{str:f}};let _="unknownBrowser",t=0,I="unknownOS";for(let e in E){const I=E[e]||{};let r=I.str||M,n=I.search||e,o=I.verStr||M,s=I.verSearch||e;if(s instanceof Array||(s=[s]),-1!=r.indexOf(n)){_=e;for(let E of s){let e=o.indexOf(E);if(-1!=e){t=parseFloat(o.substring(e+E.length+1));break}}break}}for(let E in e){const _=e[E]||{};let t=_.str||M,r=_.search||E;if(-1!=t.indexOf(r)){I=E;break}}"Linux"==I&&-1!=M.indexOf("Windows NT")&&(I="HarmonyOS"),F={browser:_,version:t,OS:I}}c&&(F={browser:"ssr",version:0,OS:"ssr"})}();const U="undefined"!=typeof WebAssembly&&M&&!(/Safari/.test(M)&&!/Chrome/.test(M)&&/\(.+\s11_2_([2-6]).*\)/.test(M)),G=!("undefined"==typeof Worker),p=!(!h||!h.getUserMedia),y=async()=>{let E=!1;if(p)try{(await h.getUserMedia({video:!0})).getTracks().forEach((E=>{E.stop()})),E=!0}catch(E){}return E};"Chrome"===F.browser&&F.version>66||"Safari"===F.browser&&F.version>13||"OPR"===F.browser&&F.version>43||"Edge"===F.browser&&F.version;const B=E=>E&&"object"==typeof E&&"function"==typeof E.then;class V extends Promise{constructor(E){let e,_;super(((E,t)=>{e=E,_=t})),this._s="pending",this.resolve=E=>{this.isPending&&(B(E)?this.task=E:(this._s="fulfilled",e(E)))},this.reject=E=>{this.isPending&&(this._s="rejected",_(E))},this.task=E}get status(){return this._s}get isPending(){return"pending"===this._s}get isFulfilled(){return"fulfilled"===this._s}get isRejected(){return"rejected"===this._s}get task(){return this._task}set task(E){let e;this._task=E,B(E)?e=E:"function"==typeof E&&(e=new Promise(E)),e&&(async()=>{try{const _=await e;E===this._task&&this.resolve(_)}catch(e){E===this._task&&this.reject(e)}})()}get isEmpty(){return null==this._task}}const w={},b=E=>{let e=w[E],_=!1;return e?e.isEmpty?e.task=()=>{}:_=!0:e=w[E]=new V((()=>{})),{p:e,justWait:_}};E.worker=void 0;let v=0;const x=()=>v++,k={};E.onLog=void 0;const Y=e=>{E.onLog=e,E.worker&&E.worker.postMessage({type:"setBLog",body:{value:!!e}})};E.bDebug=!1;const H=e=>{E.bDebug=e,E.worker&&E.worker.postMessage({type:"setBDebug",body:{value:!!e}})},Z={},X={std:{version:"1.0.0",path:"https://cdn.jsdelivr.net/npm/dynamsoft-capture-vision-std@1.0.0/dist/"},core:{version:"3.0.30-beta-202401102201",path:P},dip:{version:"2.0.30",path:"https://cdn.jsdelivr.net/npm/dynamsoft-image-processing@2.0.30/dist/"},dcm:"https://cdn.jsdelivr.net/npm/dynamsoft-character-mpdels@1.0.0/dist/"},j=new Proxy(X,{get(E,e,_){let t=Reflect.get(E,e,_);return t&&t.path&&(t=t.path),t}}),W={core:{js:!0,wasm:!0},dip:{wasm:!0}},K=async e=>{e instanceof Array||(e=e?[e]:[]),e=e.map((E=>E.toLowerCase())).filter((E=>"core"!=E&&"std"!=E));for(let E of e)if(!W[E]&&"dedicator"!==E)throw Error("Module '"+E+"' not existed.");e.some((E=>["dbr","dlr","ddn"].includes(E)))&&(e.unshift("dip"),e=[...new Set(e)]);let _=!1;const t=[];{const{p:E,justWait:e}=b("core");e?await E:(t.push(E),_=!0)}const I={};for(let E of e){const{p:e,justWait:_}=b(E);_?await e:t.push(e),I[E]=W[E]}if(0==t.length)return;const r={};for(let E in j){if("rootDirectory"==E)continue;let e=j[E];j.rootDirectory&&(e=j.rootDirectory+"/"+e),r[E]=d(e)}const n={engineResourcePaths:r,autoResources:I,names:e};if(_){n.needLoadCore=!0;let e=r.core+J._workerName;r.rootDirectory&&(e=r.rootDirectory+e),e.startsWith(location.origin)||(e=await fetch(e).then((E=>E.blob())).then((E=>URL.createObjectURL(E)))),E.worker=new Worker(e),E.worker.onerror=E=>{let e=new Error(E.message);for(let E of t)E.reject(e)},E.worker.addEventListener("message",(e=>{let _=e.data?e.data:e;switch(_.type){case"log":E.onLog&&E.onLog(_.message);break;case"task":{let E=_.id,e=_.body;try{k[E](e),delete k[E]}catch(e){throw delete k[E],e}break}case"event":{let E=_.id,e=_.body;try{k[E](e)}catch(E){throw E}break}default:console.log(e)}})),n.bLog=!!E.onLog,n.bd=E.bDebug,n.dm=location.origin.startsWith("http")?location.origin:"https://localhost"}let o=v++;return k[o]=E=>{if(E.success){Object.assign(Z,E.versions),"{}"!==JSON.stringify(E.versions)&&(J._versions=E.versions);for(let E of t)E.resolve(void 0)}else{const e=Error(E.message);E.stack&&(e.stack=E.stack);for(let E of t)E.reject(e)}},E.worker.postMessage({type:"loadWasm",body:n,id:o}),t[0]};class J{static get engineResourcePaths(){return j}static set engineResourcePaths(E){Object.assign(X,E)}static get bSupportDce4Module(){return this._bSupportDce4Module}static get bSupportIRTModule(){return this._bSupportIRTModule}static get versions(){return this._versions}static get onLog(){return E.onLog}static set onLog(E){Y(E)}static get _bDebug(){return E.bDebug}static set _bDebug(E){H(E)}static isModuleLoaded(E){return E=(E=E||"core").toLowerCase(),!!w[E]&&w[E].isFulfilled}static async loadWasm(E){return await K(E)}static async detectEnvironment(){return await(async()=>({wasm:U,worker:G,getUserMedia:p,camera:await y(),browser:F.browser,version:F.version,OS:F.OS}))()}static async getModuleVersion(){return await new Promise(((e,_)=>{let t=x();k[t]=async E=>{if(E.success)return e(E.versions);{let e=new Error(E.message);return e.stack=E.stack+"\n"+e.stack,_(e)}},E.worker.postMessage({type:"getModuleVersion",id:t})}))}static getVersion(){const E=Z.core&&Z.core.worker,e=Z.core&&Z.core.wasm;return`3.0.30-beta-202401102201(Worker: ${E||"Not Loaded"}, Wasm: ${e||"Not Loaded"})`}static enableLogging(){l._onLog=console.log}static disableLogging(){l._onLog=null}static async cfd(e){return await new Promise(((_,t)=>{let I=x();k[I]=async E=>{if(E.success)return _();{let e=new Error(E.message);return e.stack=E.stack+"\n"+e.stack,t(e)}},E.worker.postMessage({type:"cfd",id:I,body:{count:e}})}))}}var Q,z,$,q,EE,eE,_E,tE,IE,rE,nE;J._bSupportDce4Module=-1,J._bSupportIRTModule=-1,J._versions=null,J._workerName="core.worker.js",J.browserInfo=F,E.EnumCapturedResultItemType=void 0,(Q=E.EnumCapturedResultItemType||(E.EnumCapturedResultItemType={}))[Q.CRIT_ORIGINAL_IMAGE=1]="CRIT_ORIGINAL_IMAGE",Q[Q.CRIT_BARCODE=2]="CRIT_BARCODE",Q[Q.CRIT_TEXT_LINE=4]="CRIT_TEXT_LINE",Q[Q.CRIT_DETECTED_QUAD=8]="CRIT_DETECTED_QUAD",Q[Q.CRIT_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",Q[Q.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT",E.EnumCornerType=void 0,(z=E.EnumCornerType||(E.EnumCornerType={}))[z.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",z[z.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",z[z.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",z[z.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED",E.EnumErrorCode=void 0,($=E.EnumErrorCode||(E.EnumErrorCode={}))[$.EC_OK=0]="EC_OK",$[$.EC_UNKNOWN=-1e4]="EC_UNKNOWN",$[$.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",$[$.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",$[$.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",$[$.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",$[$.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",$[$.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",$[$.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",$[$.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",$[$.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",$[$.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",$[$.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",$[$.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",$[$.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",$[$.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",$[$.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",$[$.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",$[$.EC_TIMEOUT=-10026]="EC_TIMEOUT",$[$.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",$[$.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",$[$.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",$[$.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",$[$.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",$[$.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",$[$.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",$[$.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",$[$.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",$[$.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",$[$.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",$[$.EC_LICENSE_KEY_NOT_MATCH=-10043]="EC_LICENSE_KEY_NOT_MATCH",$[$.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",$[$.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",$[$.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",$[$.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",$[$.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",$[$.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",$[$.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",$[$.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",$[$.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",$[$.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",$[$.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",$[$.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",$[$.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",$[$.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",$[$.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",$[$.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",$[$.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",$[$.EC_FILE_ALREADY_EXISTS=-10067]="EC_FILE_ALREADY_EXISTS",$[$.EC_CREATE_FILE_FAILED=-10068]="EC_CREATE_FILE_FAILED",$[$.EC_IMAGE_DATA_INVALID=-10069]="EC_IMAGE_DATA_INVALID",$[$.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",$[$.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",$[$.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",$[$.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",$[$.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",$[$.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",$[$.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",$[$.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",$[$.EC_LICENSE_VERSION_NOT_MATCH=-20011]="EC_LICENSE_VERSION_NOT_MATCH",$[$.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",$[$.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",$[$.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",$[$.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",$[$.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",$[$.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",$[$.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",$[$.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",$[$.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",$[$.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",$[$.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",$[$.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",$[$.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",$[$.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",$[$.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",$[$.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",$[$.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",$[$.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",$[$.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",$[$.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",$[$.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",$[$.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",$[$.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",$[$.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",$[$.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",$[$.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",$[$.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",$[$.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",$[$.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",$[$.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",$[$.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",$[$.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID",E.EnumGrayscaleEnhancementMode=void 0,(q=E.EnumGrayscaleEnhancementMode||(E.EnumGrayscaleEnhancementMode={}))[q.GEM_SKIP=0]="GEM_SKIP",q[q.GEM_AUTO=1]="GEM_AUTO",q[q.GEM_GENERAL=2]="GEM_GENERAL",q[q.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",q[q.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",q[q.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",q[q.GEM_REV=-2147483648]="GEM_REV",E.EnumGrayscaleTransformationMode=void 0,(EE=E.EnumGrayscaleTransformationMode||(E.EnumGrayscaleTransformationMode={}))[EE.GTM_SKIP=0]="GTM_SKIP",EE[EE.GTM_INVERTED=1]="GTM_INVERTED",EE[EE.GTM_ORIGINAL=2]="GTM_ORIGINAL",EE[EE.GTM_AUTO=4]="GTM_AUTO",EE[EE.GTM_REV=-2147483648]="GTM_REV",E.EnumImageTagType=void 0,(eE=E.EnumImageTagType||(E.EnumImageTagType={}))[eE.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",eE[eE.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME",E.EnumPDFReadingMode=void 0,(_E=E.EnumPDFReadingMode||(E.EnumPDFReadingMode={}))[_E.PDFRM_VECTOR=1]="PDFRM_VECTOR",_E[_E.PDFRM_RASTER=2]="PDFRM_RASTER",_E[_E.PDFRM_REV=-2147483648]="PDFRM_REV",E.EnumRasterDataSource=void 0,(tE=E.EnumRasterDataSource||(E.EnumRasterDataSource={}))[tE.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",tE[tE.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES",E.EnumIntermediateResultUnitType=void 0,(IE=E.EnumIntermediateResultUnitType||(E.EnumIntermediateResultUnitType={}))[IE.IRUT_NULL=0]="IRUT_NULL",IE[IE.IRUT_COLOUR_IMAGE=1]="IRUT_COLOUR_IMAGE",IE[IE.IRUT_SCALED_DOWN_COLOUR_IMAGE=2]="IRUT_SCALED_DOWN_COLOUR_IMAGE",IE[IE.IRUT_GRAYSCALE_IMAGE=4]="IRUT_GRAYSCALE_IMAGE",IE[IE.IRUT_TRANSOFORMED_GRAYSCALE_IMAGE=8]="IRUT_TRANSOFORMED_GRAYSCALE_IMAGE",IE[IE.IRUT_ENHANCED_GRAYSCALE_IMAGE=16]="IRUT_ENHANCED_GRAYSCALE_IMAGE",IE[IE.IRUT_PREDETECTED_REGIONS=32]="IRUT_PREDETECTED_REGIONS",IE[IE.IRUT_BINARY_IMAGE=64]="IRUT_BINARY_IMAGE",IE[IE.IRUT_TEXTURE_DETECTION_RESULT=128]="IRUT_TEXTURE_DETECTION_RESULT",IE[IE.IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE=256]="IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE",IE[IE.IRUT_TEXTURE_REMOVED_BINARY_IMAGE=512]="IRUT_TEXTURE_REMOVED_BINARY_IMAGE",IE[IE.IRUT_CONTOURS=1024]="IRUT_CONTOURS",IE[IE.IRUT_LINE_SEGMENTS=2048]="IRUT_LINE_SEGMENTS",IE[IE.IRUT_TEXT_ZONES=4096]="IRUT_TEXT_ZONES",IE[IE.IRUT_TEXT_REMOVED_BINARY_IMAGE=8192]="IRUT_TEXT_REMOVED_BINARY_IMAGE",IE[IE.IRUT_CANDIDATE_BARCODE_ZONES=16384]="IRUT_CANDIDATE_BARCODE_ZONES",IE[IE.IRUT_LOCALIZED_BARCODES=32768]="IRUT_LOCALIZED_BARCODES",IE[IE.IRUT_SCALED_UP_BARCODE_IMAGE=65536]="IRUT_SCALED_UP_BARCODE_IMAGE",IE[IE.IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE=131072]="IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE",IE[IE.IRUT_COMPLEMENTED_BARCODE_IMAGE=262144]="IRUT_COMPLEMENTED_BARCODE_IMAGE",IE[IE.IRUT_DECODED_BARCODES=524288]="IRUT_DECODED_BARCODES",IE[IE.IRUT_LONG_LINES=1048576]="IRUT_LONG_LINES",IE[IE.IRUT_CORNERS=2097152]="IRUT_CORNERS",IE[IE.IRUT_CANDIDATE_QUAD_EDGES=4194304]="IRUT_CANDIDATE_QUAD_EDGES",IE[IE.IRUT_DETECTED_QUADS=8388608]="IRUT_DETECTED_QUADS",IE[IE.IRUT_LOCALIZED_TEXT_LINES=16777216]="IRUT_LOCALIZED_TEXT_LINES",IE[IE.IRUT_RECOGNIZED_TEXT_LINES=33554432]="IRUT_RECOGNIZED_TEXT_LINES",IE[IE.IRUT_NORMALIZED_IMAGES=67108864]="IRUT_NORMALIZED_IMAGES",IE[IE.IRUT_ALL=134217727]="IRUT_ALL",E.EnumRegionObjectElementType=void 0,(rE=E.EnumRegionObjectElementType||(E.EnumRegionObjectElementType={}))[rE.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",rE[rE.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",rE[rE.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",rE[rE.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",rE[rE.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",rE[rE.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",rE[rE.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE",rE[rE.ROET_SOURCE_IMAGE=7]="ROET_SOURCE_IMAGE",rE[rE.ROET_TARGET_ROI=8]="ROET_TARGET_ROI",E.EnumSectionType=void 0,(nE=E.EnumSectionType||(E.EnumSectionType={}))[nE.ST_NULL=0]="ST_NULL",nE[nE.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",nE[nE.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",nE[nE.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",nE[nE.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",nE[nE.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",nE[nE.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",nE[nE.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION",E.CoreModule=J,E.ImageSourceAdapter=l,E._isArc=E=>!!a(E)&&(!!C(E.x)&&(!!C(E.y)&&(!!C(E.radius)&&(!(E.radius<0)&&(!!C(E.startAngle)&&!!C(E.endAngle)))))),E._isContour=E=>!!a(E)&&(!!o(E.points)&&(0!=E.points.length&&!E.points.some((E=>!A(E))))),E._isDSImageData=i,E._isDSRect=E=>!!a(E)&&(!!C(E.left)&&(!(E.left<0)&&(!!C(E.top)&&(!(E.top<0)&&(!!C(E.right)&&(!(E.right<0)&&(!!C(E.bottom)&&(!(E.bottom<0)&&(!(E.left>=E.right)&&(!(E.top>=E.bottom)&&!!s(E.isMeasuredInPercentage))))))))))),E._isImageTag=T,E._isLineSegment=E=>!!a(E)&&(!!A(E.startPoint)&&(!!A(E.endPoint)&&(E.startPoint.x!=E.endPoint.x||E.startPoint.y!=E.endPoint.y))),E._isPoint=A,E._isPolygon=E=>!!a(E)&&(!!o(E.points)&&(0!=E.points.length&&!E.points.some((E=>!A(E))))),E._isQuad=E=>!!a(E)&&(!!o(E.points)&&(0!=E.points.length&&4==E.points.length&&!E.points.some((E=>!A(E))))),E._isRect=E=>!!a(E)&&(!!C(E.x)&&(!!C(E.y)&&(!!C(E.width)&&(!(E.width<0)&&(!!C(E.height)&&(!(E.height<0)&&!("isMeasuredInPercentage"in E&&!s(E.isMeasuredInPercentage)))))))),E.checkIsLink=function(E){return/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)|^[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/.test(E)},E.compareVersion=(E,e)=>{let _=E.split("."),t=e.split(".");for(let E=0;E<_.length&&E<t.length;++E){let e=_[E],I=t[E];if(e===I)continue;let r=parseInt(_[E]),n=parseInt(t[E]);return r===n||Number.isNaN(r)&&Number.isNaN(n)?e<I?-1:1:r<n||Number.isNaN(r)&&Number.isInteger(n)?-1:1}return _.length===t.length?0:_.length<t.length?-1:1},E.engineResourcePaths=X,E.getNextTaskID=x,E.innerVersions=Z,E.loadWasm=K,E.mapAsyncDependency=w,E.mapPackageRegister={},E.mapTaskCallBack=k,E.newAsyncDependency=b,E.requestResource=async function(E,e){return await new Promise(((_,t)=>{let I=new XMLHttpRequest;I.open("GET",E,!0),I.responseType=e,I.send(),I.onloadend=async()=>{_(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}}))},E.setBDebug=H,E.setOnLog=Y,E.waitAsyncDependency=E=>w[E]=w[E]||new V,E.workerAutoResources=W,Object.defineProperty(E,"__esModule",{value:!0})})); |
@@ -0,4 +1,119 @@ | ||
export declare const mapAsyncDependency: { | ||
[key: string]: any; | ||
}; | ||
export declare const newAsyncDependency: (depName: string) => { | ||
p: any; | ||
justWait: boolean; | ||
}; | ||
export declare const waitAsyncDependency: (depName: string) => any; | ||
export declare let worker: Worker; | ||
export declare const getNextTaskID: () => number; | ||
export declare const mapTaskCallBack: { | ||
[key: string]: Function; | ||
}; | ||
export declare let onLog: (message: any) => void | undefined; | ||
export declare const setOnLog: (value: typeof onLog) => void; | ||
export declare let bDebug: boolean; | ||
export declare const setBDebug: (value: boolean) => void; | ||
export declare const innerVersions: { | ||
[key: string]: { | ||
worker?: string; | ||
wasm?: string; | ||
}; | ||
}; | ||
export declare const mapPackageRegister: { | ||
[key: string]: any; | ||
}; | ||
interface ProxyEngineResourcePaths { | ||
"rootDirectory"?: string; | ||
"std"?: string; | ||
"dip"?: string; | ||
"dnn"?: string; | ||
"core"?: string; | ||
"license"?: string; | ||
"cvr"?: string; | ||
"utility"?: string; | ||
"dbr"?: string; | ||
"dlr"?: string; | ||
"ddn"?: string; | ||
"dcp"?: string; | ||
"dce"?: string; | ||
"dcm"?: string; | ||
[moduleName: string]: string | undefined; | ||
} | ||
export declare const engineResourcePaths: { | ||
"rootDirectory"?: string; | ||
"std"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"dip"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"dnn"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"core"?: string | { | ||
version: string; | ||
path: string; | ||
}; | ||
"license"?: string; | ||
"cvr"?: string; | ||
"utility"?: string; | ||
"dbr"?: string; | ||
"dlr"?: string; | ||
"ddn"?: string; | ||
"dcp"?: string; | ||
"dce"?: string; | ||
"dcm"?: string; | ||
[moduleName: string]: string | { | ||
version: string; | ||
path: string; | ||
} | undefined; | ||
}; | ||
export declare const workerAutoResources: { | ||
[key: string]: { | ||
js?: string[] | boolean; | ||
wasm?: string[] | boolean; | ||
}; | ||
}; | ||
export declare const loadWasm: (names?: string[] | string) => Promise<any>; | ||
export default class CoreModule { | ||
static get engineResourcePaths(): ProxyEngineResourcePaths; | ||
static set engineResourcePaths(value: ProxyEngineResourcePaths); | ||
private static _bSupportDce4Module; | ||
static get bSupportDce4Module(): number; | ||
private static _bSupportIRTModule; | ||
static get bSupportIRTModule(): number; | ||
private static _versions; | ||
static get versions(): any; | ||
static get onLog(): (message: any) => void; | ||
static set onLog(value: (message: any) => void); | ||
static get _bDebug(): boolean; | ||
static set _bDebug(value: boolean); | ||
static _workerName: string; | ||
/** | ||
* Determine if the decoding module has been loaded successfully. | ||
* @category Initialize and Destroy | ||
*/ | ||
static isModuleLoaded(name?: string): boolean; | ||
static loadWasm(names: string[] | string): Promise<any>; | ||
/** | ||
* Detect environment and get a report. | ||
*/ | ||
static detectEnvironment(): Promise<any>; | ||
/** | ||
* modify from https://gist.github.com/2107/5529665 | ||
* @ignore | ||
*/ | ||
static browserInfo: any; | ||
static getModuleVersion(): Promise<any>; | ||
static getVersion(): string; | ||
static enableLogging(): void; | ||
static disableLogging(): void; | ||
static cfd(count: number): Promise<void>; | ||
} | ||
export {}; | ||
//# sourceMappingURL=CoreModule.d.ts.map |
import { DSImageData } from "../interface/DSImageData"; | ||
import { EnumBufferOverflowProtectionMode } from "../enum/EnumBufferOverflowProtectionMode"; | ||
import { EnumColourChannelUsageType } from "../enum/EnumColourChannelUsageType"; | ||
import { ImageSourceErrorListener } from "../interface"; | ||
export default abstract class ImageSourceAdapter { | ||
@@ -9,6 +10,29 @@ #private; | ||
*/ | ||
static _onLog: (message: any) => void; | ||
/** | ||
* @ignore | ||
*/ | ||
get _isFetchingStarted(): boolean; | ||
constructor(); | ||
abstract hasNextImageToFetch(): boolean; | ||
/** | ||
* @brief Sets the error listener for the image source. | ||
* | ||
* This function allows you to set an error listener object that will receive | ||
* notifications when errors occur during image source operations. | ||
* If an error occurs, the error information will be passed to the listener's | ||
* OnErrorReceived method. | ||
* | ||
* @param listener An instance of ImageSourceErrorListener or its | ||
* derived class, which will handle error notifications. | ||
*/ | ||
setErrorListener(listener: ImageSourceErrorListener): void; | ||
/** | ||
* Add images (of the type DSImageData) to the buffer. | ||
*/ | ||
addImageToBuffer(image: DSImageData): void; | ||
getImage(): DSImageData; | ||
/** | ||
* This method can set the processing priority of an image. | ||
*/ | ||
setNextImageToReturn(imageId: number, keepInBuffer?: boolean): void; | ||
@@ -22,4 +46,4 @@ /** | ||
stopFetching(): void; | ||
setMaximumImageCount(count: number): void; | ||
getMaximumImageCount(): number; | ||
setMaxImageCount(count: number): void; | ||
getMaxImageCount(): number; | ||
getImageCount(): number; | ||
@@ -26,0 +50,0 @@ clearBuffer(): void; |
@@ -63,5 +63,4 @@ export declare enum EnumErrorCode { | ||
EC_RESERVED_INFO_NOT_MATCH = -10040, | ||
/**The License DLL is missing.*/ | ||
/**The license key does not match the license content.*/ | ||
EC_LICENSE_KEY_NOT_MATCHED = -10043, | ||
EC_LICENSE_KEY_NOT_MATCH = -10043, | ||
/**Failed to request the license content.*/ | ||
@@ -89,3 +88,3 @@ EC_REQUEST_FAILED = -10044, | ||
EC_IMAGE_ORIENTATION_INVALID = -10060, | ||
/**Complex tempalte can't be converted to simplified settings.*/ | ||
/**Failed to convert complex tempalte to simplified settings.*/ | ||
EC_CONVERT_COMPLEX_TEMPLATE_ERROR = -10061, | ||
@@ -106,2 +105,11 @@ /**Reject function call while capturing in progress.*/ | ||
EC_MULTI_PAGES_NOT_SUPPORTED = -10066, | ||
/**The file already exists but overwriting is disabled.*/ | ||
EC_FILE_ALREADY_EXISTS = -10067, | ||
/**The file path does not exist but cannot be created, or cannot be created for any other reason.*/ | ||
EC_CREATE_FILE_FAILED = -10068, | ||
/**The input ImageData object contains invalid parameter(s).*/ | ||
EC_IMAGE_DATA_INVALID = -10069, | ||
/**The dimensions of the input image do not meet the requirements.*/ | ||
/**The pixel format of the input image do not meet the requirements.*/ | ||
/**The section level result is irreplaceable.*/ | ||
/** -20000~-29999: DLS license error code. */ | ||
@@ -120,7 +128,4 @@ /**No license.*/ | ||
EC_BIND_DEVICE_FAILED = -20005, | ||
/**Interface InitLicenseFromDLS can not be used together with other license initiation interfaces. */ | ||
/**License Client dll is missing.*/ | ||
/**Instance count is over limit.*/ | ||
EC_INSTANCE_COUNT_OVER_LIMIT = -20008, | ||
/**Interface InitLicenseFromDLS has to be called before creating any SDK objects.*/ | ||
/**Trial License*/ | ||
@@ -171,8 +176,4 @@ EC_TRIAL_LICENSE = -20010, | ||
/**-50000~-59999: DDN error code*/ | ||
/**No content has been detected.*/ | ||
EC_QUADRILATERAL_INVALID = -50057, | ||
/**-60000~-69999: DCE error code*/ | ||
EC_CAMERA_MODULE_NOT_EXIST = -60003, | ||
EC_CAMERA_ID_NOT_EXIST = -60006, | ||
EC_NO_SENSOR = -60045, | ||
/**-70000~-79999: Panorama error code*/ | ||
@@ -179,0 +180,0 @@ /**The panorama license is invalid.*/ |
export declare enum EnumGrayscaleEnhancementMode { | ||
/**Skips grayscale transformation. */ | ||
GEM_SKIP = 0, | ||
/**Not supported yet. */ | ||
GEM_AUTO = 1, | ||
/**Takes the unpreprocessed image for following operations. */ | ||
GEM_GENERAL = 2, | ||
/**Preprocesses the image using the gray equalization algorithm. Check @ref IPM for available argument settings.*/ | ||
GEM_GRAY_EQUALIZE = 4, | ||
/**Preprocesses the image using the gray smoothing algorithm. Check @ref IPM for available argument settings.*/ | ||
GEM_GRAY_SMOOTH = 8, | ||
/**Preprocesses the image using the sharpening and smoothing algorithm. Check @ref IPM for available argument settings.*/ | ||
GEM_SHARPEN_SMOOTH = 16, | ||
/**Skips image preprocessing. */ | ||
GEM_REV = -2147483648 | ||
} | ||
//# sourceMappingURL=EnumGrayscaleEnhancementMode.d.ts.map |
export declare enum EnumGrayscaleTransformationMode { | ||
/**Skips grayscale transformation. */ | ||
GTM_SKIP = 0, | ||
/**Transforms to inverted grayscale. Recommended for light on dark images. */ | ||
GTM_INVERTED = 1, | ||
/**Keeps the original grayscale. Recommended for dark on light images. */ | ||
GTM_ORIGINAL = 2, | ||
/**Lets the library choose an algorithm automatically for grayscale transformation.*/ | ||
GTM_AUTO = 4, | ||
/**Reserved setting for grayscale transformation mode.*/ | ||
GTM_REV = -2147483648 | ||
} | ||
//# sourceMappingURL=EnumGrayscaleTransformationMode.d.ts.map |
@@ -8,4 +8,6 @@ export declare enum EnumRegionObjectElementType { | ||
ROET_DETECTED_QUAD = 5, | ||
ROET_NORMALIZED_IMAGE = 6 | ||
ROET_NORMALIZED_IMAGE = 6, | ||
ROET_SOURCE_IMAGE = 7, | ||
ROET_TARGET_ROI = 8 | ||
} | ||
//# sourceMappingURL=EnumRegionObjectElementType.d.ts.map |
import ImageSourceAdapter from "./class/ImageSourceAdapter"; | ||
export * from "./class/CoreModule"; | ||
import CoreModule from "./class/CoreModule"; | ||
import IntermediateResultManager from "./class/IntermediateResultManager"; | ||
import IntermediateResultReceiver from "./class/IntermediateResultReceiver"; | ||
export * from "./interface"; | ||
export * from "./enum"; | ||
export { isArc as _isArc, isContour as _isContour, isDSImageData as _isDSImageData, isDSRect as _isDSRect, isImageTag as _isImageTag, isLineSegment as _isLineSegment, isPoint as _isPoint, isPolygon as _isPolygon, isQuad as _isQuad, isRect as _isRect, } from "./utils"; | ||
export { CoreModule, ImageSourceAdapter, IntermediateResultManager, IntermediateResultReceiver, }; | ||
export { isArc as _isArc, isContour as _isContour, isDSImageData as _isDSImageData, isDSRect as _isDSRect, isImageTag as _isImageTag, isLineSegment as _isLineSegment, isPoint as _isPoint, isPolygon as _isPolygon, isQuad as _isQuad, isRect as _isRect, requestResource, checkIsLink, compareVersion } from "./utils"; | ||
export { CoreModule, ImageSourceAdapter, }; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -5,5 +5,7 @@ import { CapturedResultItem } from "./CapturedResultItem"; | ||
readonly originalImageHashId: string; | ||
originalImageTag: ImageTag; | ||
readonly originalImageTag: ImageTag; | ||
readonly items: Array<CapturedResultItem>; | ||
readonly errorCode: number; | ||
readonly errorString: string; | ||
} | ||
//# sourceMappingURL=CapturedResult.d.ts.map |
@@ -5,3 +5,4 @@ import { ImageTag } from "./ImageTag"; | ||
pageNumber: number; | ||
totalPages: number; | ||
} | ||
//# sourceMappingURL=FileImageTag.d.ts.map |
export * from "./CapturedResult"; | ||
export * from "./OriginalImageResultItem"; | ||
export * from "./CapturedResultFilter"; | ||
export * from "./CapturedResultItem"; | ||
export * from "./CapturedResultReceiver"; | ||
export * from "./Contour"; | ||
@@ -15,2 +13,3 @@ export * from "./Corner"; | ||
export * from "./DSImageData"; | ||
export * from "./ImageSourceErrorListener"; | ||
export * from "./ImageTag"; | ||
@@ -22,2 +21,3 @@ export * from "./LineSegment"; | ||
export * from "./Point"; | ||
export * from "./Warning"; | ||
export * from "./BinaryImageUnit"; | ||
@@ -30,3 +30,2 @@ export * from "./ColourImageUnit"; | ||
export * from "./IntermediateResultExtraInfo"; | ||
export * from "./ObservationParameters"; | ||
export * from "./IntermediateResultUnit"; | ||
@@ -33,0 +32,0 @@ export * from "./LineSegmentsUnit"; |
@@ -1,10 +0,5 @@ | ||
import { DSRect } from "./DSRect"; | ||
import { Point } from "./Point"; | ||
export interface Quadrilateral { | ||
points: [Point, Point, Point, Point]; | ||
contains?: (point: Point) => boolean; | ||
getBoundingRect?: () => DSRect; | ||
getArea?: () => number; | ||
toString?: () => string; | ||
} | ||
//# sourceMappingURL=Quadrilateral.d.ts.map |
import { EnumRegionObjectElementType } from "../enum/EnumRegionObjectElementType"; | ||
import { Quadrilateral } from "./Quadrilateral"; | ||
export interface RegionObjectElement { | ||
/** | ||
* location was readonly before v3.2.0 | ||
* In 3.2.0 onwards, it can be set as well | ||
* When setting, specify the location as well as | ||
* the matrixToOriginalImage | ||
*/ | ||
location: Quadrilateral; | ||
referencedElement: RegionObjectElement; | ||
type: EnumRegionObjectElementType; | ||
elementType: EnumRegionObjectElementType; | ||
} | ||
//# sourceMappingURL=RegionObjectElement.d.ts.map |
export * from "./TypeCheck"; | ||
export declare function requestResource(url: string, type: "text" | "blob" | "arraybuffer"): Promise<any>; | ||
export declare function checkIsLink(str: string): boolean; | ||
export declare const compareVersion: (strV1: string, strV2: string) => number; | ||
declare const bSupportBigInt: boolean; | ||
export { bSupportBigInt }; | ||
//# sourceMappingURL=index.d.ts.map |
303
LEGAL.txt
@@ -6,69 +6,280 @@ Legal Notices: | ||
=================================================================================== | ||
showdown(https://github.com/showdownjs/showdown) | ||
Zlib. | ||
MIT License | ||
Copyright (c) 2018,2021 ShowdownJS | ||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler | ||
This software is provided 'as-is', without any express or implied | ||
warranty. In no event will the authors be held liable for any damages | ||
arising from the use of this software. | ||
Permission is granted to anyone to use this software for any purpose, | ||
including commercial applications, and to alter it and redistribute it | ||
freely, subject to the following restrictions: | ||
1. The origin of this software must not be misrepresented; you must not | ||
claim that you wrote the original software. If you use this software | ||
in a product, an acknowledgment in the product documentation would be | ||
appreciated but is not required. | ||
2. Altered source versions must be plainly marked as such, and must not be | ||
misrepresented as being the original software. | ||
3. This notice may not be removed or altered from any source distribution. | ||
Jean-loup Gailly | ||
Mark Adler | ||
=================================================================================== | ||
=================================================================================== | ||
highlight.js | ||
OpenCV 4.5.2 | ||
BSD 3-Clause License | ||
Copyright (c) 2006, Ivan Sagalaev. | ||
All rights reserved. | ||
Copyright 2022, OpenCV Foundation | ||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
* Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at | ||
* Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
* Neither the name of the copyright holder nor the names of its | ||
contributors may be used to endorse or promote products derived from | ||
this software without specific prior written permission. | ||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. | ||
=================================================================================== | ||
=================================================================================== | ||
markdown-to-html-github-style(https://github.com/KrauseFx/markdown-to-html-github-style) | ||
JsonCpp library | ||
MIT License | ||
The JsonCpp library's source code, including accompanying documentation, | ||
tests and demonstration applications, are licensed under the following | ||
conditions... | ||
Copyright (c) 2019 Felix Krause | ||
The author (Baptiste Lepilleur) explicitly disclaims copyright in all | ||
jurisdictions which recognize such a disclaimer. In such jurisdictions, | ||
this software is released into the Public Domain. | ||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of | ||
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is | ||
released under the terms of the MIT License (see below). | ||
In jurisdictions which recognize Public Domain property, the user of this | ||
software may choose to accept it either as 1) Public Domain, 2) under the | ||
conditions of the MIT License (see below), or 3) under the terms of dual | ||
Public Domain/MIT License conditions described here, as they choose. | ||
The MIT License is about as close to Public Domain as a license can get, and is | ||
described in clear, concise terms at: | ||
http://en.wikipedia.org/wiki/MIT_License | ||
The full text of the MIT License follows: | ||
======================================================================== | ||
Copyright (c) 2007-2010 Baptiste Lepilleur | ||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the "Software"), to deal in the Software without | ||
restriction, including without limitation the rights to use, copy, | ||
modify, merge, publish, distribute, sublicense, and/or sell copies | ||
of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS | ||
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN | ||
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. | ||
======================================================================== | ||
(END LICENSE TEXT) | ||
The MIT license is compatible with both the GPL and commercial | ||
software, affording one all of the rights of Public Domain with the | ||
minor nuisance of being required to keep the above copyright notice | ||
and license text in the source code. Note also that by accepting the | ||
Public Domain "license" you can re-license your copy using whatever | ||
license you like. | ||
=================================================================================== | ||
=================================================================================== | ||
OpenSSL | ||
LICENSE ISSUES | ||
============== | ||
The OpenSSL toolkit stays under a dual license, i.e. both the conditions of | ||
the OpenSSL License and the original SSLeay license apply to the toolkit. | ||
See below for the actual license texts. Actually both licenses are BSD-style | ||
Open Source licenses. In case of any license issues related to OpenSSL | ||
please contact openssl-core@openssl.org. | ||
OpenSSL License | ||
--------------- | ||
/* ==================================================================== | ||
* Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* | ||
* 1. Redistributions of source code must retain the above copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in | ||
* the documentation and/or other materials provided with the | ||
* distribution. | ||
* | ||
* 3. All advertising materials mentioning features or use of this | ||
* software must display the following acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)" | ||
* | ||
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to | ||
* endorse or promote products derived from this software without | ||
* prior written permission. For written permission, please contact | ||
* openssl-core@openssl.org. | ||
* | ||
* 5. Products derived from this software may not be called "OpenSSL" | ||
* nor may "OpenSSL" appear in their names without prior written | ||
* permission of the OpenSSL Project. | ||
* | ||
* 6. Redistributions of any form whatsoever must retain the following | ||
* acknowledgment: | ||
* "This product includes software developed by the OpenSSL Project | ||
* for use in the OpenSSL Toolkit (http://www.openssl.org/)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY | ||
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR | ||
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, | ||
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED | ||
* OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* ==================================================================== | ||
* | ||
* This product includes cryptographic software written by Eric Young | ||
* (eay@cryptsoft.com). This product includes software written by Tim | ||
* Hudson (tjh@cryptsoft.com). | ||
* | ||
*/ | ||
Original SSLeay License | ||
----------------------- | ||
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | ||
* All rights reserved. | ||
* | ||
* This package is an SSL implementation written | ||
* by Eric Young (eay@cryptsoft.com). | ||
* The implementation was written so as to conform with Netscapes SSL. | ||
* | ||
* This library is free for commercial and non-commercial use as long as | ||
* the following conditions are aheared to. The following conditions | ||
* apply to all code found in this distribution, be it the RC4, RSA, | ||
* lhash, DES, etc., code; not just the SSL code. The SSL documentation | ||
* included with this distribution is covered by the same copyright terms | ||
* except that the holder is Tim Hudson (tjh@cryptsoft.com). | ||
* | ||
* Copyright remains Eric Young's, and as such any Copyright notices in | ||
* the code are not to be removed. | ||
* If this package is used in a product, Eric Young should be given attribution | ||
* as the author of the parts of the library used. | ||
* This can be in the form of a textual message at program startup or | ||
* in documentation (online or textual) provided with the package. | ||
* | ||
* Redistribution and use in source and binary forms, with or without | ||
* modification, are permitted provided that the following conditions | ||
* are met: | ||
* 1. Redistributions of source code must retain the copyright | ||
* notice, this list of conditions and the following disclaimer. | ||
* 2. Redistributions in binary form must reproduce the above copyright | ||
* notice, this list of conditions and the following disclaimer in the | ||
* documentation and/or other materials provided with the distribution. | ||
* 3. All advertising materials mentioning features or use of this software | ||
* must display the following acknowledgement: | ||
* "This product includes cryptographic software written by | ||
* Eric Young (eay@cryptsoft.com)" | ||
* The word 'cryptographic' can be left out if the rouines from the library | ||
* being used are not cryptographic related :-). | ||
* 4. If you include any Windows specific code (or a derivative thereof) from | ||
* the apps directory (application code) you must include an acknowledgement: | ||
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" | ||
* | ||
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND | ||
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE | ||
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS | ||
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
* SUCH DAMAGE. | ||
* | ||
* The licence and distribution terms for any publically available version or | ||
* derivative of this code cannot be changed. i.e. this code cannot simply be | ||
* copied and put under another distribution licence | ||
* [including the GNU Public Licence.] | ||
*/ | ||
=================================================================================== | ||
=================================================================================== | ||
Leptonica | ||
/*====================================================================* | ||
- Copyright (C) 2001-2020 Leptonica. All rights reserved. | ||
- | ||
- Redistribution and use in source and binary forms, with or without | ||
- modification, are permitted provided that the following conditions | ||
- are met: | ||
- 1. Redistributions of source code must retain the above copyright | ||
- notice, this list of conditions and the following disclaimer. | ||
- 2. Redistributions in binary form must reproduce the above | ||
- copyright notice, this list of conditions and the following | ||
- disclaimer in the documentation and/or other materials | ||
- provided with the distribution. | ||
- | ||
- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
- ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
- LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
- A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY | ||
- CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
- EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
- PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
- PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY | ||
- OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
- NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
*====================================================================*/ | ||
=================================================================================== | ||
=================================================================================== | ||
localForage | ||
-- Offline Storage, Improved | ||
Version 1.7.3 | ||
https://localforage.github.io/localForage | ||
(c) 2013-2017 Mozilla, Apache License 2.0 | ||
=================================================================================== |
{ | ||
"name": "dynamsoft-core", | ||
"version": "3.0.10", | ||
"description": "Dynamsoft Core encompasses the shared interface and enumeration definitions of the Dynamsoft Capture Vision (DCV) architecture. It is a prerequisite for using the full functionality of DCV.", | ||
"version": "3.0.30-beta-202401102201", | ||
"description": "The Dynamsoft Core module builds the foundation upon which Dynamsoft SDKs implement their functionality.", | ||
"homepage": "https://dynamsoft.com/capture-vision/docs/web/programming/javascript/?ver=latest", | ||
@@ -21,3 +21,4 @@ "main": "dist/core.js", | ||
"publishConfig": { | ||
"registry": "https://registry.npmjs.org/" | ||
"registry": "https://registry.npmjs.org/", | ||
"tag": "beta" | ||
}, | ||
@@ -34,25 +35,45 @@ "author": { | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/Dynamsoft/core-javascript.git" | ||
}, | ||
"files": [ | ||
"/dist/*.js", | ||
"/dist/*.mjs", | ||
"/dist/*.html", | ||
"/dist/*.wasm", | ||
"/dist/**/*.d.ts", | ||
"/API Reference.url", | ||
"/LEGAL.txt" | ||
], | ||
"/dist/*.js", | ||
"/dist/*.mjs", | ||
"/dist/*.html", | ||
"/dist/*.wasm", | ||
"/dist/**/*.d.ts", | ||
"/API Reference.url", | ||
"/LEGAL.txt" | ||
], | ||
"keywords": [ | ||
"dynamsoft", | ||
"core" | ||
"dynamsoft-capture-vision", | ||
"webassembly", | ||
"sdk", | ||
"javascript", | ||
"typescript", | ||
"core", | ||
"imagesourceadapter", | ||
"intermediateresult" | ||
], | ||
"type": "module", | ||
"license": "SEE LICENSE IN LICENSE", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1", | ||
"rollup-dev": "rollup -c --environment BUILD:development", | ||
"rollup": "rollup -c --environment BUILD:production", | ||
"build-dev": "python ./build-dev.py", | ||
"build": "python ./build.py", | ||
"update:readme": "node ./updateReadme.js" | ||
"build": "rollup -c --environment BUILD:production", | ||
"build-kdev": "rollup -c --environment BUILD:development", | ||
"build-dev": "rollup -c --environment BUILD:development && node ./codeChange.js", | ||
"update:readme": "updateReadme --package=dynamsoft-core --version=latest --no-html", | ||
"update:prod": "updatePackage --package=dynamsoft-core --version=auto --env=production --tag=latest", | ||
"update:beta": "updatePackage --package=dynamsoft-core --version=auto --env=beta --tag=beta", | ||
"update:iv": "updatePackage --package=dynamsoft-core --version=auto --env=internalVersion --tag=iv", | ||
"update:dev": "updatePackage --package=dynamsoft-core --version=auto --env=development --tag=latest", | ||
"updateLink:npm": "updateLink --source=npm", | ||
"updateLink:zip": "updateLink --source=zip", | ||
"updateLink:github": "updateLink --source=github", | ||
"easyPublish": "npm run update:dev && npm run build-dev && node ./compressCore.js && npm publish" | ||
}, | ||
"devDependencies": { | ||
"@dynamsoft/rd2-scripts": "^0.1.4", | ||
"@dynamsoft/tools": "^0.0.1", | ||
@@ -63,7 +84,10 @@ "@rollup/plugin-node-resolve": "^15.0.1", | ||
"@rollup/plugin-typescript": "^11.0.0", | ||
"@scannerproxy/browser-info": "^2.0.8", | ||
"@scannerproxy/curscript-path": "^2.0.1", | ||
"@scannerproxy/dlsjs": "^3.0.16", | ||
"@types/node": "^20.4.2", | ||
"detect-browser-node-ssr": "^3.0.2", | ||
"eruda": "^3.0.0", | ||
"highlight.js": "^9.18.5", | ||
"mutable-promise": "^1.1.13", | ||
"rollup": "^2.79.1", | ||
"showdown": "^1.9.1", | ||
"tslib": "^2.5.0", | ||
@@ -70,0 +94,0 @@ "typescript": "^4.9.5" |
# Dynamsoft Core Module | ||
The Dynamsoft Core module builds the foundation upon which Dynamsoft SDKs implements their functionality. It consists of basic classes, interfaces and enumerations shared between all Dynamsoft SDKs. | ||
Some of the major classes and interfaces include: | ||
- [ImageSourceAdapter Class](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/basic-structures/image-source-adapter.html) | ||
- [CapturedResultReceiver Interface](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/basic-structures/captured-result-receiver.html) | ||
- [CapturedResultFilter Interface](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/basic-structures/captured-result-filter.html) | ||
- [CapturedResult Interface](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/basic-structures/captured-result.html) | ||
- [CapturedResultItem Interface](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/basic-structures/captured-result-item.html) | ||
<!--- [IntermediateResultManager Class](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/intermediate-results/intermediate-result-manager.html)--> | ||
Learn more about the module by checking the [official documentation](https://www.dynamsoft.com/capture-vision/docs/web/programming/javascript/api-reference/core/core-module.html). | ||
The Dynamsoft Core module builds the foundation upon which Dynamsoft SDKs implement their functionality. It consists of basic classes, interfaces and enumerations shared by all Dynamsoft SDKs compliant with the [DCV (Dynamsoft Capture Vision) architecture](https://www.dynamsoft.com/capture-vision/docs/core/architecture/index.html). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
479955
1354
0
Yes
16
72
2
4
11