Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dynamsoft-core

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamsoft-core - npm Package Compare versions

Comparing version 3.0.30 to 3.0.31-beta-202401171755

4

dist/core.esm.js

@@ -7,6 +7,6 @@ /*!

* @author Dynamsoft
* @version 3.0.30
* @version 3.0.31
* @fileoverview Dynamsoft JavaScript Library for Core
* More info on Dynamsoft Core JS: https://www.dynamsoft.com/core/docs/programming/javascript/?ver=latest
*/
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",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(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};
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(_),R=_=>!!T(_)&&(!!A(_.x)&&(!!A(_.y)&&(!!A(_.radius)&&(!(_.radius<0)&&(!!A(_.startAngle)&&!!A(_.endAngle)))))),n=_=>!!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 V="undefined"==typeof self,B=(()=>{if(!V&&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"./"})(),p=_=>{if(null==_&&(_="./"),V);else{let E=document.createElement("a");E.href=_,_=E.href}return _.endsWith("/")||(_+="/"),_};let w,y,m,b,v;"undefined"!=typeof navigator&&(w=navigator,y=w.userAgent,m=w.platform,b=w.mediaDevices),function(){if(!V){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:m,search:"Win"},Mac:{str:m},Linux:{str:m}};let e="unknownBrowser",t=0,I="unknownOS";for(let E in _){const I=_[E]||{};let s=I.str||y,C=I.search||E,r=I.verStr||y,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||y,s=e.search||_;if(-1!=t.indexOf(s)){I=_;break}}"Linux"==I&&-1!=y.indexOf("Windows NT")&&(I="HarmonyOS"),v={browser:e,version:t,OS:I}}V&&(v={browser:"ssr",version:0,OS:"ssr"})}();const Y="undefined"!=typeof WebAssembly&&y&&!(/Safari/.test(y)&&!/Chrome/.test(y)&&/\(.+\s11_2_([2-6]).*\)/.test(y)),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"===_?p(B+"../../dynamsoft-capture-vision-std@1.0.0/dist/"):"dip"===_?p(B+"../../dynamsoft-image-processing@2.0.30/dist/"):"dcm"===_?p(B+"../../dynamsoft-label-recognizer-data@1.0.0/dist/"):void 0,C_={std:{version:"1.0.0",path:s_("std")},core:{version:"3.0.31-beta-202401171755",path:B},dip:{version:"2.0.30",path:s_("dip")},dcm:s_("dcm")},r_=new Proxy(C_,{get(_,E,e){let t=Reflect.get(_,E,e);return t&&t.path&&(t=t.path),t}}),A_={core:{js:!0,wasm:!0},dip:{wasm:!0}},T_=async _=>{_ instanceof Array||(_=_?[_]:[]),_=_.map((_=>_.toLowerCase())).filter((_=>"core"!=_&&"std"!=_));for(let E of _)if(!A_[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]=A_[E]}if(0==e.length)return;const I={};for(let _ in r_){if("rootDirectory"==_)continue;let E=r_[_];r_.rootDirectory&&(E=r_.rootDirectory+"/"+E),I[_]=p(E)}const s={engineResourcePaths:I,autoResources:t,names:_};if(E){s.needLoadCore=!0;let _=I.core+R_._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)&&(R_._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 R_{static get engineResourcePaths(){return r_}static set engineResourcePaths(_){Object.assign(C_,_)}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 T_(_)}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.31-beta-202401171755(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_,N_,i_,o_,D_,L_,a_,O_,S_,c_,M_;R_._bSupportDce4Module=-1,R_._bSupportIRTModule=-1,R_._versions=null,R_._workerName="core.worker.js",R_.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"}(N_||(N_={})),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"}(i_||(i_={})),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"}(o_||(o_={})),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"}(D_||(D_={})),function(_){_[_.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",_[_.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME"}(L_||(L_={})),function(_){_[_.PDFRM_VECTOR=1]="PDFRM_VECTOR",_[_.PDFRM_RASTER=2]="PDFRM_RASTER",_[_.PDFRM_REV=-2147483648]="PDFRM_REV"}(a_||(a_={})),function(_){_[_.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",_[_.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES"}(O_||(O_={})),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"}(S_||(S_={})),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"}(c_||(c_={})),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"}(M_||(M_={}));export{R_ as CoreModule,e as EnumBufferOverflowProtectionMode,n_ as EnumCapturedResultItemType,t as EnumColourChannelUsageType,N_ as EnumCornerType,i_ as EnumErrorCode,o_ as EnumGrayscaleEnhancementMode,D_ as EnumGrayscaleTransformationMode,I as EnumImagePixelFormat,L_ as EnumImageTagType,S_ as EnumIntermediateResultUnitType,a_ as EnumPDFReadingMode,O_ as EnumRasterDataSource,c_ as EnumRegionObjectElementType,M_ as EnumSectionType,F as ImageSourceAdapter,R as _isArc,n 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,C_ as engineResourcePaths,z as getNextTaskID,t_ as innerVersions,T_ 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,A_ as workerAutoResources};

@@ -7,6 +7,6 @@ /*!

* @author Dynamsoft
* @version 3.0.30
* @version 3.0.31
* @fileoverview Dynamsoft JavaScript Library for Core
* More info on Dynamsoft Core JS: https://www.dynamsoft.com/core/docs/programming/javascript/?ver=latest
*/
!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",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(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})}));
!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,_,e,t){if("a"===e&&!t)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof _?E!==_||!t:!_.has(E))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===e?t:"a"===e?t.call(E):t?t.value:_.get(E)}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!==_||!I:!_.has(E))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===t?I.call(E,e):I?I.value=e:_.set(E,e),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,S,m;class l{get _isFetchingStarted(){return _(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),S.set(this,E.EnumColourChannelUsageType.CCUT_AUTO)}setErrorListener(E){}addImageToBuffer(e){var t;if(!i(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,N,"f").length>=_(this,D,"f"))switch(_(this,L,"f")){case E.EnumBufferOverflowProtectionMode.BOPM_BLOCK:break;case E.EnumBufferOverflowProtectionMode.BOPM_UPDATE:if(_(this,N,"f").push(e),a(_(this,u,"f"))&&C(_(this,u,"f").imageId)&&1==_(this,u,"f").keepInBuffer)for(;_(this,N,"f").length>_(this,D,"f");){const E=_(this,N,"f").findIndex((E=>{var e;return(null===(e=E.tag)||void 0===e?void 0:e.imageId)!==_(this,u,"f").imageId}));_(this,N,"f").splice(E,1)}else _(this,N,"f").splice(0,_(this,N,"f").length-_(this,D,"f"))}else _(this,N,"f").push(e)}getImage(){if(0===_(this,N,"f").length)return null;let e;if(_(this,u,"f")&&C(_(this,u,"f").imageId)){const E=_(this,R,"m",m).call(this,_(this,u,"f").imageId);if(E<0)throw new Error(`Image with id ${_(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(e.format)){if(_(this,S,"f")===E.EnumColourChannelUsageType.CCUT_RGB_R_CHANNEL_ONLY){l._onLog&&l._onLog("only get R channel data.");const _=new Uint8Array(e.width*e.height);for(let t=0;t<_.length;t++)switch(e.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:_[t]=e.bytes[3*t+2];break;case E.EnumImagePixelFormat.IPF_ARGB_8888:case E.EnumImagePixelFormat.IPF_ARGB_16161616:_[t]=e.bytes[4*t+2];break;case E.EnumImagePixelFormat.IPF_BGR_888:_[t]=e.bytes[3*t];break;case E.EnumImagePixelFormat.IPF_ABGR_8888:case E.EnumImagePixelFormat.IPF_ABGR_16161616:_[t]=e.bytes[4*t]}e.bytes=_,e.stride=e.width,e.format=E.EnumImagePixelFormat.IPF_GRAYSCALED}else if(_(this,S,"f")===E.EnumColourChannelUsageType.CCUT_RGB_G_CHANNEL_ONLY){l._onLog&&l._onLog("only get G channel data.");const _=new Uint8Array(e.width*e.height);for(let t=0;t<_.length;t++)switch(e.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:_[t]=e.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:_[t]=e.bytes[4*t+1]}e.bytes=_,e.stride=e.width,e.format=E.EnumImagePixelFormat.IPF_GRAYSCALED}else if(_(this,S,"f")===E.EnumColourChannelUsageType.CCUT_RGB_B_CHANNEL_ONLY){l._onLog&&l._onLog("only get B channel data.");const _=new Uint8Array(e.width*e.height);for(let t=0;t<_.length;t++)switch(e.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:_[t]=e.bytes[3*t];break;case E.EnumImagePixelFormat.IPF_ARGB_8888:case E.EnumImagePixelFormat.IPF_ARGB_16161616:_[t]=e.bytes[4*t];break;case E.EnumImagePixelFormat.IPF_BGR_888:_[t]=e.bytes[3*t+2];break;case E.EnumImagePixelFormat.IPF_ABGR_8888:case E.EnumImagePixelFormat.IPF_ABGR_16161616:_[t]=e.bytes[4*t+2]}e.bytes=_,e.stride=e.width,e.format=E.EnumImagePixelFormat.IPF_GRAYSCALED}}else[E.EnumImagePixelFormat.IPF_NV21,E.EnumImagePixelFormat.IPF_NV12].includes(e.format)&&l._onLog&&l._onLog("NV21 or NV12 is not supported.");return e}setNextImageToReturn(E,_){if(!((...E)=>0!==E.length&&E.every((E=>C(E))))(E))throw new TypeError("Invalid 'imageId'.");if(void 0!==_&&!s(_))throw new TypeError("Invalid 'keepInBuffer'.");e(this,u,{imageId:E,keepInBuffer:_},"f")}_resetNextReturnedImage(){e(this,u,null,"f")}hasImage(E){return _(this,R,"m",m).call(this,E)>=0}startFetching(){e(this,O,!0,"f")}stopFetching(){e(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(e(this,D,E,"f");_(this,N,"f")&&_(this,N,"f").length>E;)_(this,N,"f").shift()}getMaxImageCount(){return _(this,D,"f")}getImageCount(){return _(this,N,"f").length}clearBuffer(){_(this,N,"f").length=0}isBufferEmpty(){return 0===_(this,N,"f").length}setBufferOverflowProtectionMode(E){e(this,L,E,"f")}getBufferOverflowProtectionMode(){return _(this,L,"f")}setColourChannelUsageType(E){e(this,S,E,"f")}getColourChannelUsageType(){return _(this,S,"f")}}N=new WeakMap,D=new WeakMap,L=new WeakMap,O=new WeakMap,u=new WeakMap,S=new WeakMap,R=new WeakSet,m=function(E){if("number"!=typeof E)throw new TypeError("Invalid 'imageId'.");return _(this,N,"f").findIndex((_=>{var e;return(null===(e=_.tag)||void 0===e?void 0:e.imageId)===E}))};const c="undefined"==typeof self,d=(()=>{if(!c&&document.currentScript){let E=document.currentScript.src,_=E.indexOf("?");if(-1!=_)E=E.substring(0,_);else{let _=E.indexOf("#");-1!=_&&(E=E.substring(0,_))}return E.substring(0,E.lastIndexOf("/")+1)}return"./"})(),P=E=>{if(null==E&&(E="./"),c);else{let _=document.createElement("a");_.href=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"}},_={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:f,search:"Win"},Mac:{str:f},Linux:{str:f}};let e="unknownBrowser",t=0,I="unknownOS";for(let _ in E){const I=E[_]||{};let r=I.str||M,n=I.search||_,o=I.verStr||M,s=I.verSearch||_;if(s instanceof Array||(s=[s]),-1!=r.indexOf(n)){e=_;for(let E of s){let _=o.indexOf(E);if(-1!=_){t=parseFloat(o.substring(_+E.length+1));break}}break}}for(let E in _){const e=_[E]||{};let t=e.str||M,r=e.search||E;if(-1!=t.indexOf(r)){I=E;break}}"Linux"==I&&-1!=M.indexOf("Windows NT")&&(I="HarmonyOS"),F={browser:e,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)))},this.reject=E=>{this.isPending&&(this._s="rejected",e(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 _;this._task=E,B(E)?_=E:"function"==typeof E&&(_=new Promise(E)),_&&(async()=>{try{const e=await _;E===this._task&&this.resolve(e)}catch(_){E===this._task&&this.reject(_)}})()}get isEmpty(){return null==this._task}}const w={},b=E=>{let _=w[E],e=!1;return _?_.isEmpty?_.task=()=>{}:e=!0:_=w[E]=new V((()=>{})),{p:_,justWait:e}};E.worker=void 0;let v=0;const x=()=>v++,k={};E.onLog=void 0;const Y=_=>{E.onLog=_,E.worker&&E.worker.postMessage({type:"setBLog",body:{value:!!_}})};E.bDebug=!1;const H=_=>{E.bDebug=_,E.worker&&E.worker.postMessage({type:"setBDebug",body:{value:!!_}})},Z={},X=E=>"std"===E?P(d+"../../dynamsoft-capture-vision-std@1.0.0/dist/"):"dip"===E?P(d+"../../dynamsoft-image-processing@2.0.30/dist/"):"dcm"===E?P(d+"../../dynamsoft-label-recognizer-data@1.0.0/dist/"):void 0,W={std:{version:"1.0.0",path:X("std")},core:{version:"3.0.31-beta-202401171755",path:d},dip:{version:"2.0.30",path:X("dip")},dcm:X("dcm")},j=new Proxy(W,{get(E,_,e){let t=Reflect.get(E,_,e);return t&&t.path&&(t=t.path),t}}),K={core:{js:!0,wasm:!0},dip:{wasm:!0}},J=async _=>{_ instanceof Array||(_=_?[_]:[]),_=_.map((E=>E.toLowerCase())).filter((E=>"core"!=E&&"std"!=E));for(let E of _)if(!K[E]&&"dedicator"!==E)throw Error("Module '"+E+"' not existed.");_.some((E=>["dbr","dlr","ddn"].includes(E)))&&(_.unshift("dip"),_=[...new Set(_)]);let e=!1;const t=[];{const{p:E,justWait:_}=b("core");_?await E:(t.push(E),e=!0)}const I={};for(let E of _){const{p:_,justWait:e}=b(E);e?await _:t.push(_),I[E]=K[E]}if(0==t.length)return;const r={};for(let E in j){if("rootDirectory"==E)continue;let _=j[E];j.rootDirectory&&(_=j.rootDirectory+"/"+_),r[E]=P(_)}const n={engineResourcePaths:r,autoResources:I,names:_};if(e){n.needLoadCore=!0;let _=r.core+Q._workerName;r.rootDirectory&&(_=r.rootDirectory+_),_.startsWith(location.origin)||(_=await fetch(_).then((E=>E.blob())).then((E=>URL.createObjectURL(E)))),E.worker=new Worker(_),E.worker.onerror=E=>{let _=new Error(E.message);for(let E of t)E.reject(_)},E.worker.addEventListener("message",(_=>{let e=_.data?_.data:_;switch(e.type){case"log":E.onLog&&E.onLog(e.message);break;case"task":{let E=e.id,_=e.body;try{k[E](_),delete k[E]}catch(_){throw delete k[E],_}break}case"event":{let E=e.id,_=e.body;try{k[E](_)}catch(E){throw E}break}default:console.log(_)}})),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)&&(Q._versions=E.versions);for(let E of t)E.resolve(void 0)}else{const _=Error(E.message);E.stack&&(_.stack=E.stack);for(let E of t)E.reject(_)}},E.worker.postMessage({type:"loadWasm",body:n,id:o}),t[0]};class Q{static get engineResourcePaths(){return j}static set engineResourcePaths(E){Object.assign(W,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 J(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.versions);{let _=new Error(E.message);return _.stack=E.stack+"\n"+_.stack,e(_)}},E.worker.postMessage({type:"getModuleVersion",id:t})}))}static getVersion(){const E=Z.core&&Z.core.worker,_=Z.core&&Z.core.wasm;return`3.0.31-beta-202401171755(Worker: ${E||"Not Loaded"}, Wasm: ${_||"Not Loaded"})`}static enableLogging(){l._onLog=console.log}static disableLogging(){l._onLog=null}static async cfd(_){return await new Promise(((e,t)=>{let I=x();k[I]=async E=>{if(E.success)return e();{let _=new Error(E.message);return _.stack=E.stack+"\n"+_.stack,t(_)}},E.worker.postMessage({type:"cfd",id:I,body:{count:_}})}))}}var z,$,q,EE,_E,eE,tE,IE,rE,nE,oE;Q._bSupportDce4Module=-1,Q._bSupportIRTModule=-1,Q._versions=null,Q._workerName="core.worker.js",Q.browserInfo=F,E.EnumCapturedResultItemType=void 0,(z=E.EnumCapturedResultItemType||(E.EnumCapturedResultItemType={}))[z.CRIT_ORIGINAL_IMAGE=1]="CRIT_ORIGINAL_IMAGE",z[z.CRIT_BARCODE=2]="CRIT_BARCODE",z[z.CRIT_TEXT_LINE=4]="CRIT_TEXT_LINE",z[z.CRIT_DETECTED_QUAD=8]="CRIT_DETECTED_QUAD",z[z.CRIT_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",z[z.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT",E.EnumCornerType=void 0,($=E.EnumCornerType||(E.EnumCornerType={}))[$.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",E.EnumErrorCode=void 0,(q=E.EnumErrorCode||(E.EnumErrorCode={}))[q.EC_OK=0]="EC_OK",q[q.EC_UNKNOWN=-1e4]="EC_UNKNOWN",q[q.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",q[q.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",q[q.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",q[q.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",q[q.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",q[q.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",q[q.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",q[q.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",q[q.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",q[q.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",q[q.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",q[q.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",q[q.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",q[q.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",q[q.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",q[q.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",q[q.EC_TIMEOUT=-10026]="EC_TIMEOUT",q[q.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",q[q.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",q[q.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",q[q.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",q[q.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",q[q.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",q[q.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",q[q.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",q[q.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",q[q.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",q[q.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",q[q.EC_LICENSE_KEY_NOT_MATCH=-10043]="EC_LICENSE_KEY_NOT_MATCH",q[q.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",q[q.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",q[q.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",q[q.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",q[q.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",q[q.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",q[q.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",q[q.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",q[q.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",q[q.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",q[q.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",q[q.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",q[q.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",q[q.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",q[q.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",q[q.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",q[q.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",q[q.EC_FILE_ALREADY_EXISTS=-10067]="EC_FILE_ALREADY_EXISTS",q[q.EC_CREATE_FILE_FAILED=-10068]="EC_CREATE_FILE_FAILED",q[q.EC_IMAGE_DATA_INVALID=-10069]="EC_IMAGE_DATA_INVALID",q[q.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",q[q.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",q[q.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",q[q.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",q[q.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",q[q.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",q[q.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",q[q.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",q[q.EC_LICENSE_VERSION_NOT_MATCH=-20011]="EC_LICENSE_VERSION_NOT_MATCH",q[q.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",q[q.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",q[q.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",q[q.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",q[q.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",q[q.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",q[q.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",q[q.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",q[q.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",q[q.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",q[q.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",q[q.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",q[q.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",q[q.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",q[q.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",q[q.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",q[q.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",q[q.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",q[q.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",q[q.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",q[q.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",q[q.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",q[q.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",q[q.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",q[q.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",q[q.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",q[q.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",q[q.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",q[q.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",q[q.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",q[q.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",q[q.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID",E.EnumGrayscaleEnhancementMode=void 0,(EE=E.EnumGrayscaleEnhancementMode||(E.EnumGrayscaleEnhancementMode={}))[EE.GEM_SKIP=0]="GEM_SKIP",EE[EE.GEM_AUTO=1]="GEM_AUTO",EE[EE.GEM_GENERAL=2]="GEM_GENERAL",EE[EE.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",EE[EE.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",EE[EE.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",EE[EE.GEM_REV=-2147483648]="GEM_REV",E.EnumGrayscaleTransformationMode=void 0,(_E=E.EnumGrayscaleTransformationMode||(E.EnumGrayscaleTransformationMode={}))[_E.GTM_SKIP=0]="GTM_SKIP",_E[_E.GTM_INVERTED=1]="GTM_INVERTED",_E[_E.GTM_ORIGINAL=2]="GTM_ORIGINAL",_E[_E.GTM_AUTO=4]="GTM_AUTO",_E[_E.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,(tE=E.EnumPDFReadingMode||(E.EnumPDFReadingMode={}))[tE.PDFRM_VECTOR=1]="PDFRM_VECTOR",tE[tE.PDFRM_RASTER=2]="PDFRM_RASTER",tE[tE.PDFRM_REV=-2147483648]="PDFRM_REV",E.EnumRasterDataSource=void 0,(IE=E.EnumRasterDataSource||(E.EnumRasterDataSource={}))[IE.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",IE[IE.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES",E.EnumIntermediateResultUnitType=void 0,(rE=E.EnumIntermediateResultUnitType||(E.EnumIntermediateResultUnitType={}))[rE.IRUT_NULL=0]="IRUT_NULL",rE[rE.IRUT_COLOUR_IMAGE=1]="IRUT_COLOUR_IMAGE",rE[rE.IRUT_SCALED_DOWN_COLOUR_IMAGE=2]="IRUT_SCALED_DOWN_COLOUR_IMAGE",rE[rE.IRUT_GRAYSCALE_IMAGE=4]="IRUT_GRAYSCALE_IMAGE",rE[rE.IRUT_TRANSOFORMED_GRAYSCALE_IMAGE=8]="IRUT_TRANSOFORMED_GRAYSCALE_IMAGE",rE[rE.IRUT_ENHANCED_GRAYSCALE_IMAGE=16]="IRUT_ENHANCED_GRAYSCALE_IMAGE",rE[rE.IRUT_PREDETECTED_REGIONS=32]="IRUT_PREDETECTED_REGIONS",rE[rE.IRUT_BINARY_IMAGE=64]="IRUT_BINARY_IMAGE",rE[rE.IRUT_TEXTURE_DETECTION_RESULT=128]="IRUT_TEXTURE_DETECTION_RESULT",rE[rE.IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE=256]="IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE",rE[rE.IRUT_TEXTURE_REMOVED_BINARY_IMAGE=512]="IRUT_TEXTURE_REMOVED_BINARY_IMAGE",rE[rE.IRUT_CONTOURS=1024]="IRUT_CONTOURS",rE[rE.IRUT_LINE_SEGMENTS=2048]="IRUT_LINE_SEGMENTS",rE[rE.IRUT_TEXT_ZONES=4096]="IRUT_TEXT_ZONES",rE[rE.IRUT_TEXT_REMOVED_BINARY_IMAGE=8192]="IRUT_TEXT_REMOVED_BINARY_IMAGE",rE[rE.IRUT_CANDIDATE_BARCODE_ZONES=16384]="IRUT_CANDIDATE_BARCODE_ZONES",rE[rE.IRUT_LOCALIZED_BARCODES=32768]="IRUT_LOCALIZED_BARCODES",rE[rE.IRUT_SCALED_UP_BARCODE_IMAGE=65536]="IRUT_SCALED_UP_BARCODE_IMAGE",rE[rE.IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE=131072]="IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE",rE[rE.IRUT_COMPLEMENTED_BARCODE_IMAGE=262144]="IRUT_COMPLEMENTED_BARCODE_IMAGE",rE[rE.IRUT_DECODED_BARCODES=524288]="IRUT_DECODED_BARCODES",rE[rE.IRUT_LONG_LINES=1048576]="IRUT_LONG_LINES",rE[rE.IRUT_CORNERS=2097152]="IRUT_CORNERS",rE[rE.IRUT_CANDIDATE_QUAD_EDGES=4194304]="IRUT_CANDIDATE_QUAD_EDGES",rE[rE.IRUT_DETECTED_QUADS=8388608]="IRUT_DETECTED_QUADS",rE[rE.IRUT_LOCALIZED_TEXT_LINES=16777216]="IRUT_LOCALIZED_TEXT_LINES",rE[rE.IRUT_RECOGNIZED_TEXT_LINES=33554432]="IRUT_RECOGNIZED_TEXT_LINES",rE[rE.IRUT_NORMALIZED_IMAGES=67108864]="IRUT_NORMALIZED_IMAGES",rE[rE.IRUT_ALL=134217727]="IRUT_ALL",E.EnumRegionObjectElementType=void 0,(nE=E.EnumRegionObjectElementType||(E.EnumRegionObjectElementType={}))[nE.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",nE[nE.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",nE[nE.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",nE[nE.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",nE[nE.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",nE[nE.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",nE[nE.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE",nE[nE.ROET_SOURCE_IMAGE=7]="ROET_SOURCE_IMAGE",nE[nE.ROET_TARGET_ROI=8]="ROET_TARGET_ROI",E.EnumSectionType=void 0,(oE=E.EnumSectionType||(E.EnumSectionType={}))[oE.ST_NULL=0]="ST_NULL",oE[oE.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",oE[oE.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",oE[oE.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",oE[oE.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",oE[oE.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",oE[oE.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",oE[oE.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION",E.CoreModule=Q,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,_)=>{let e=E.split("."),t=_.split(".");for(let E=0;E<e.length&&E<t.length;++E){let _=e[E],I=t[E];if(_===I)continue;let r=parseInt(e[E]),n=parseInt(t[E]);return r===n||Number.isNaN(r)&&Number.isNaN(n)?_<I?-1:1:r<n||Number.isNaN(r)&&Number.isInteger(n)?-1:1}return e.length===t.length?0:e.length<t.length?-1:1},E.engineResourcePaths=W,E.getNextTaskID=x,E.innerVersions=Z,E.loadWasm=J,E.mapAsyncDependency=w,E.mapPackageRegister={},E.mapTaskCallBack=k,E.newAsyncDependency=b,E.requestResource=async function(E,_){return await new Promise(((e,t)=>{let I=new XMLHttpRequest;I.open("GET",E,!0),I.responseType=_,I.send(),I.onloadend=async()=>{e(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=K,Object.defineProperty(E,"__esModule",{value:!0})}));

@@ -7,6 +7,6 @@ /*!

* @author Dynamsoft
* @version 3.0.30
* @version 3.0.31
* @fileoverview Dynamsoft JavaScript Library for Core
* More info on Dynamsoft Core JS: https://www.dynamsoft.com/core/docs/programming/javascript/?ver=latest
*/
!function(){"use strict";const e=e=>e&&"object"==typeof e&&"function"==typeof e.then;class t extends Promise{constructor(t){let r,n;super(((e,t)=>{r=e,n=t})),this._s="pending",this.resolve=t=>{this.isPending&&(e(t)?this.task=t:(this._s="fulfilled",r(t)))},this.reject=e=>{this.isPending&&(this._s="rejected",n(e))},this.task=t}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(t){let r;this._task=t,e(t)?r=t:"function"==typeof t&&(r=new Promise(t)),r&&(async()=>{try{const e=await r;t===this._task&&this.resolve(e)}catch(e){t===this._task&&this.reject(e)}})()}get isEmpty(){return null==this._task}}const r="undefined"==typeof self,n=r?{}:self;let o,i,a,s,c;"undefined"!=typeof navigator&&(o=navigator,i=o.userAgent,a=o.platform,s=o.mediaDevices),function(){if(!r){const e={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:o.vendor,search:"Apple",verSearch:["Version","iPhone OS","CPU OS"]},Firefox:null,Explorer:{search:"MSIE",verSearch:"MSIE"}},t={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:a,search:"Win"},Mac:{str:a},Linux:{str:a}};let r="unknownBrowser",n=0,s="unknownOS";for(let t in e){const o=e[t]||{};let a=o.str||i,s=o.search||t,c=o.verStr||i,l=o.verSearch||t;if(l instanceof Array||(l=[l]),-1!=a.indexOf(s)){r=t;for(let e of l){let t=c.indexOf(e);if(-1!=t){n=parseFloat(c.substring(t+e.length+1));break}}break}}for(let e in t){const r=t[e]||{};let n=r.str||i,o=r.search||e;if(-1!=n.indexOf(o)){s=e;break}}"Linux"==s&&-1!=i.indexOf("Windows NT")&&(s="HarmonyOS"),c={browser:r,version:n,OS:s}}r&&(c={browser:"ssr",version:0,OS:"ssr"})}(),"undefined"!=typeof WebAssembly&&i&&(!/Safari/.test(i)||/Chrome/.test(i)||/\(.+\s11_2_([2-6]).*\)/.test(i)),s&&s.getUserMedia;const l="Chrome"===c.browser&&c.version>66||"Safari"===c.browser&&c.version>13||"OPR"===c.browser&&c.version>43||"Edge"===c.browser&&c.version>15;var d=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function u(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}function f(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function m(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function h(e){return"string"!=typeof e&&(console.warn(`${e} used as a key, but it is not a string.`),e=String(e)),e}function p(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}const y="local-forage-detect-blob-support";let g;const b={},v=Object.prototype.toString,w="readonly",_="readwrite";function S(e){return"boolean"==typeof g?Promise.resolve(g):function(e){return new Promise((function(t){var r=e.transaction(y,_),n=u([""]);r.objectStore(y).put(n,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return g=e,g}))}function I(e){var t=b[e.name],r={};r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function k(e){var t=b[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function C(e,t){var r=b[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function x(e,t){return new Promise((function(r,n){if(b[e.name]=b[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(e.db);I(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var i=d.open.apply(d,o);t&&(i.onupgradeneeded=function(t){var r=i.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(y)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),i.onerror=function(e){e.preventDefault(),n(i.error)},i.onsuccess=function(){var t=i.result;t.onversionchange=function(e){e.target.close()},r(t),k(e)}}))}function P(e){return x(e,!1)}function E(e){return x(e,!0)}function D(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,o=e.version>e.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||r){if(r){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function T(e){var t=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),o=0;o<t;o++)n[o]=e.charCodeAt(o);return r}(atob(e.data));return u([t],{type:e.type})}function N(e){var t=this,r=t._initReady().then((function(){var e=b[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return m(r,e,e),r}function M(e,t,r,n){void 0===n&&(n=1);try{var o=e.db.transaction(e.storeName,t);r(null,o)}catch(o){if(n>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return Promise.resolve().then((()=>{if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),E(e)})).then((()=>function(e){I(e);for(var t=b[e.name],r=t.forages,n=0;n<r.length;n++){const e=r[n];e._dbInfo.db&&(e._dbInfo.db.close(),e._dbInfo.db=null)}return e.db=null,P(e).then((t=>(e.db=t,D(e)?E(e):t))).then((n=>{e.db=t.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n})).catch((t=>{throw C(e,t),t}))}(e).then((function(){M(e,t,r,n-1)})))).catch(r);r(o)}}var O={_driver:"asyncStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var o=b[r.name];o||(o={forages:[],db:null,dbReady:null,deferredOperations:[]},b[r.name]=o),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=N);var i=[];function a(){return Promise.resolve()}for(var s=0;s<o.forages.length;s++){var c=o.forages[s];c!==t&&i.push(c._initReady().catch(a))}var l=o.forages.slice(0);return Promise.all(i).then((function(){return r.db=o.db,P(r)})).then((function(e){return r.db=e,D(r,t._defaultConfig.version)?E(r):e})).then((function(e){r.db=o.db=e,t._dbInfo=r;for(var n=0;n<l.length;n++){var i=l[n];i!==t&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}}))},_support:function(){try{if(!d||!d.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),getItem:function(e,t){var r=this;e=h(e);var n=new Promise((function(t,n){r.ready().then((function(){M(r._dbInfo,w,(function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),function(e){return e&&e.__local_forage_encoded_blob}(e)&&(e=T(e)),t(e)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return f(n,t),n},setItem:function(e,t,r){var n=this;e=h(e);var o=new Promise((function(r,o){var i;n.ready().then((function(){return i=n._dbInfo,"[object Blob]"===v.call(t)?S(i.db).then((function(e){return e?t:(r=t,new Promise((function(e,t){var n=new FileReader;n.onerror=t,n.onloadend=function(t){var n=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:r.type})},n.readAsBinaryString(r)})));var r})):t})).then((function(t){M(n._dbInfo,_,(function(i,a){if(i)return o(i);try{var s=a.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var c=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),r(t)},a.onabort=a.onerror=function(){var e=c.error?c.error:c.transaction.error;o(e)}}catch(e){o(e)}}))})).catch(o)}));return f(o,r),o},removeItem:function(e,t){var r=this;e=h(e);var n=new Promise((function(t,n){r.ready().then((function(){M(r._dbInfo,_,(function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).delete(e);i.oncomplete=function(){t()},i.onerror=function(){n(a.error)},i.onabort=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return f(n,t),n},clear:function(e){var t=this,r=new Promise((function(e,r){t.ready().then((function(){M(t._dbInfo,_,(function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){var e=i.error?i.error:i.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return f(r,e),r},length:function(e){var t=this,r=new Promise((function(e,r){t.ready().then((function(){M(t._dbInfo,w,(function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).count();i.onsuccess=function(){e(i.result)},i.onerror=function(){r(i.error)}}catch(e){r(e)}}))})).catch(r)}));return f(r,e),r},keys:function(e){var t=this,r=new Promise((function(e,r){t.ready().then((function(){M(t._dbInfo,w,(function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var t=i.result;t?(a.push(t.key),t.continue()):e(a)},i.onerror=function(){r(i.error)}}catch(e){r(e)}}))})).catch(r)}));return f(r,e),r},dropInstance:function(e,t){t=p.apply(this,arguments);var r,n=this.config();if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName),e.name){const t=e.name===n.name&&this._dbInfo.db?Promise.resolve(this._dbInfo.db):P(e).then((t=>{const r=b[e.name],n=r.forages;r.db=t;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=t;return t}));r=e.storeName?t.then((t=>{if(!t.objectStoreNames.contains(e.storeName))return;const r=t.version+1;I(e);const n=b[e.name],o=n.forages;t.close();for(let e=0;e<o.length;e++){const t=o[e];t._dbInfo.db=null,t._dbInfo.version=r}const i=new Promise(((t,n)=>{const o=d.open(e.name,r);o.onerror=e=>{o.result.close(),n(e)},o.onupgradeneeded=()=>{o.result.deleteObjectStore(e.storeName)},o.onsuccess=()=>{const e=o.result;e.close(),t(e)}}));return i.then((e=>{n.db=e;for(let t=0;t<o.length;t++){const r=o[t];r._dbInfo.db=e,k(r._dbInfo)}})).catch((t=>{throw(C(e,t)||Promise.resolve()).catch((()=>{})),t}))})):t.then((t=>{I(e);const r=b[e.name],n=r.forages;t.close();for(var o=0;o<n.length;o++){n[o]._dbInfo.db=null}const i=new Promise(((t,r)=>{var n=d.deleteDatabase(e.name);n.onerror=()=>{const e=n.result;e&&e.close(),r(n.error)},n.onblocked=()=>{console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},n.onsuccess=()=>{const e=n.result;e&&e.close(),t(e)}}));return i.then((e=>{r.db=e;for(var t=0;t<n.length;t++){k(n[t]._dbInfo)}})).catch((t=>{throw(C(e,t)||Promise.resolve()).catch((()=>{})),t}))}))}else r=Promise.reject("Invalid arguments");return f(r,t),r}};const j=new Map;function R(e,t){let r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}var A={_driver:"tempStorageWrapper",_initStorage:async function(e){const t={};if(e)for(let r in e)t[r]=e[r];const r=t.keyPrefix=R(e,this._defaultConfig);this._dbInfo=t,j.has(r)||j.set(r,new Map)},getItem:function(e,t){e=h(e);const r=this.ready().then((()=>j.get(this._dbInfo.keyPrefix).get(e)));return f(r,t),r},setItem:function(e,t,r){e=h(e);const n=this.ready().then((()=>(void 0===t&&(t=null),j.get(this._dbInfo.keyPrefix).set(e,t),t)));return f(n,r),n},removeItem:function(e,t){e=h(e);const r=this.ready().then((()=>{j.get(this._dbInfo.keyPrefix).delete(e)}));return f(r,t),r},clear:function(e){const t=this.ready().then((()=>{const e=this._dbInfo.keyPrefix;j.has(e)&&j.delete(e)}));return f(t,e),t},length:function(e){const t=this.ready().then((()=>j.get(this._dbInfo.keyPrefix).size));return f(t,e),t},keys:function(e){const t=this.ready().then((()=>[...j.get(this._dbInfo.keyPrefix).keys()]));return f(t,e),t},dropInstance:function(e,t){if(t=p.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){const t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}let r;return r=e.name?new Promise((t=>{e.storeName?t(R(e,this._defaultConfig)):t(`${e.name}/`)})).then((e=>{j.delete(e)})):Promise.reject("Invalid arguments"),f(r,t),r}};const U=(e,t)=>{const r=e.length;let n=0;for(;n<r;){if((o=e[n])===(i=t)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0;n++}var o,i;return!1},B=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},W={},F={},L={INDEXEDDB:O,TEMPSTORAGE:A},z=[L.INDEXEDDB._driver,L.TEMPSTORAGE._driver],H=["dropInstance"],J=["clear","getItem","keys","length","removeItem","setItem"].concat(H),V={description:"",driver:z.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function $(e,t){e[t]=function(){const r=arguments;return e.ready().then((function(){return e[t].apply(e,r)}))}}function G(){for(let e=1;e<arguments.length;e++){const t=arguments[e];if(t)for(let e in t)t.hasOwnProperty(e)&&(B(t[e])?arguments[0][e]=t[e].slice():arguments[0][e]=t[e])}return arguments[0]}class Z{constructor(e){for(let e in L)if(L.hasOwnProperty(e)){const t=L[e],r=t._driver;this[e]=r,W[r]||this.defineDriver(t)}this._defaultConfig=G({},V),this._config=G({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((()=>{}))}config(e){if("object"==typeof e){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(let t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config}defineDriver(e,t,r){const n=new Promise((function(t,r){try{const n=e._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(o);const i=J.concat("_initStorage");for(let t=0,n=i.length;t<n;t++){const n=i[t];if((!U(H,n)||e[n])&&"function"!=typeof e[n])return void r(o)}const a=function(){const t=function(e){return function(){const t=new Error(`Method ${e} is not implemented by the current driver`),r=Promise.reject(t);return f(r,arguments[arguments.length-1]),r}};for(let r=0,n=H.length;r<n;r++){const n=H[r];e[n]||(e[n]=t(n))}};a();const s=function(r){W[n]&&console.info(`Redefining LocalForage driver: ${n}`),W[n]=e,F[n]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(s,r):s(!!e._support):s(!0)}catch(e){r(e)}}));return m(n,t,r),n}driver(){return this._driver||null}getDriver(e,t,r){const n=W[e]?Promise.resolve(W[e]):Promise.reject(new Error("Driver not found."));return m(n,t,r),n}ready(e){const t=this,r=t._driverSet.then((()=>(null===t._ready&&(t._ready=t._initDriver()),t._ready)));return m(r,e,e),r}setDriver(e,t,r){const n=this;B(e)||(e=[e]);const o=this._getSupportedDrivers(e);function i(){n._config.driver=n.driver()}function a(e){return n._extend(e),i(),n._ready=n._initStorage(n._config),n._ready}const s=null!==this._driverSet?this._driverSet.catch((()=>Promise.resolve())):Promise.resolve();return this._driverSet=s.then((()=>{const e=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then((e=>{n._driver=e._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=function(e){return function(){let t=0;return function r(){for(;t<e.length;){let o=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(a).catch(r)}i();const o=new Error("No available storage method found.");return n._driverSet=Promise.reject(o),n._driverSet}()}}(o)}))})).catch((()=>{i();const e=new Error("No available storage method found.");return n._driverSet=Promise.reject(e),n._driverSet})),m(this._driverSet,t,r),this._driverSet}supports(e){return!!F[e]}_extend(e){G(this,e)}_getSupportedDrivers(e){const t=[];for(let r=0,n=e.length;r<n;r++){const n=e[r];this.supports(n)&&t.push(n)}return t}_wrapLibraryMethodsWithReady(){for(let e=0,t=J.length;e<t;e++)$(this,J[e])}createInstance(e){return new Z(e)}}var Y=new Z;Date.prototype.kUtilFormat=function(e){const t={"M+":this.getUTCMonth()+1,"d+":this.getUTCDate(),"H+":this.getUTCHours(),"h+":this.getUTCHours()%12||12,"m+":this.getUTCMinutes(),"s+":this.getUTCSeconds(),"q+":Math.floor((this.getUTCMonth()+3)/3),"S+":this.getUTCMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getUTCFullYear()+"").substr(4-RegExp.$1.length)));for(let r in t)new RegExp("("+r+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[r]:("000"+t[r]).substr(("000"+t[r]).length-RegExp.$1.length)));return e};let K=e=>{let r,o,i,a,s,c,d,u,f,m=n.btoa,h=n.atob,p=e.bd,y=e.dm;const g=["https://mlts.dynamsoft.com/","https://slts.dynamsoft.com/"];let b,v,w,_,S,I,k,C,x,P,E,D,T,N,M,O=g,j=!1,R=Promise.resolve(),A=e.log&&((...t)=>{try{e.log.apply(null,t)}catch(e){setTimeout((()=>{throw e}),0)}})||(()=>{}),U=p&&A||(()=>{}),B=e=>e.join(""),W={a:[80,88,27,82,145,164,199,211],b:[187,87,89,128,150,44,190,213],c:[89,51,74,53,99,72,82,118],d:[99,181,118,158,215,103,76,117],e:[99,51,86,105,100,71,120,108],f:[97,87,49,119,98,51,74,48,83,50,86,53],g:[81,85,86,84,76,85,100,68,84,81,32,32],h:[90,87,53,106,99,110,108,119,100,65,32,32],i:[90,71,86,106,99,110,108,119,100,65,32,32],j:[97,88,89,32],k:[29,83,122,137,5,180,157,114],l:[100,71,70,110,84,71,86,117,90,51,82,111]},F=()=>n[B(W.c)][B(W.e)][B(W.f)]("raw",new Uint8Array(W.a.concat(W.b,W.d,W.k)),B(W.g),!0,[B(W.h),B(W.i)]),L=async e=>{if(n[B(W.c)]&&n[B(W.c)][B(W.e)]&&n[B(W.c)][B(W.e)][B(W.f)]){let t=h(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;++e)r[e]=t.charCodeAt(e);let o=r.subarray(0,12),i=r.subarray(o.length);M||(M=await F());let a=await n[B(W.c)][B(W.e)][B(W.i)]({name:B(W.g),[B(W.j)]:o,[B(W.l)]:128},M,i);return String.fromCharCode.apply(null,new Uint8Array(a))}},z=e=>h(h(e.replace(/\n/g,"+").replace(/\s/g,"=")).substring(1)),H=e=>m(String.fromCharCode(97+25*Math.random())+m(e)).replace(/\+/g,"\n").replace(/=/g," "),J=()=>{if(n.crypto){let e=new Uint8Array(36);n.crypto.getRandomValues(e);let t="";for(let r=0;r<36;++r){let n=e[r]%36;t+=n<10?n:String.fromCharCode(n+87)}return t}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))};const V="Failed to connect to the Dynamsoft License Server: ",$={dlsErrorAndCacheExpire:V+"The cached license has expired. Please get connected to the network as soon as possible or contact the site administrator for more information.",publicTrialNetworkTimeout:V+"network timed out. Check your Internet connection or [contact Dynamsoft](https://www.dynamsoft.com/company/contact/) for more information.",networkTimeout:V+"network timed out. Check your Internet connection or contact the site administrator for more information.",publicTrialFailConnect:V+"network connection error. Check your Internet connection or [contact Dynamsoft](https://www.dynamsoft.com/company/contact/) for more information.",failConnect:V+"network connection error. Check your Internet connection or contact the site administrator for more information.",checkLocalTime:"Your system date and time appear to have been changed, causing the license to fail. Please correct the system data and time and try again.",idbTimeout:"Failed to open indexedDB: Timeout.",dlsOfflineLicenseExpired:"The DLS2 Offline license has expired. Please contact the site administrator for more information."};let G,Z,K,X,q=async()=>{if(G)return G;G=new t,await(async()=>{k||(k=Y)})(),await Promise.race([(async()=>{let e=await k.createInstance({name:"dynamjssdkhello"});await e.setItem("dynamjssdkhello","available")})(),new Promise(((e,t)=>{setTimeout((()=>t(new Error($.idbTimeout))),5e3)}))]),x=await k.createInstance({name:"dynamdlsinfo"}),P=m(m("v2")+String.fromCharCode(y.charCodeAt(y.length/2)+1)+m(y));try{let e=await x.getItem(P);if(!e){let t=await k.createInstance({name:"dynamltsinfo"});e=await t.getItem(P),e&&await x.setItem(P,e)}e&&([d,S]=JSON.parse(await z(e)))}catch(e){}try{null==d&&(d=J(),x.setItem(P,await H(JSON.stringify([d,null]))))}catch(e){}G.resolve()},Q=async e=>{if(K=Date.now(),Z)return Z;Z=new t;try{let t={pd:r,vm:i,v:o,dt:c||"browser",ed:"javascript",cu:d,ad:y,os:u,fn:f};w&&(t.rmk=w),a&&(-1!=a.indexOf("-")?t.hs=a:t.og=a);let n={};if(S){let e=await x.getItem(P);e&&([d,S]=JSON.parse(await z(e))),n["lts-time"]=S}v&&(t.sp=v);let l=await Promise.race([(async()=>{let r,o=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ");S&&(x.setItem(P,await H(JSON.stringify([d,o]))),S=o);let i="auth/?ext="+encodeURIComponent(m(JSON.stringify(t)));_&&(i+="&"+encodeURIComponent(_));let a,c=!1,l=!1,u=async e=>{if(e&&!e.ok)try{let t=await e.text();if(t){let e=JSON.parse(t);e.errorCode&&(a=e,e.errorCode>100&&e.errorCode<200&&(s=null,c=!0,l=!0))}}catch(e){}};try{r=await Promise.race([fetch(O[0]+i,{headers:n,cache:e?"reload":"default",mode:"cors"}),new Promise(((e,t)=>setTimeout(t,1e4)))]),await u(r)}catch(e){}if(!(s||r&&r.ok||c))try{r=await Promise.race([fetch(O[1]+i,{headers:n,mode:"cors"}),new Promise(((e,t)=>setTimeout(t,3e4)))]),await u(r)}catch(e){}if(!(s||r&&r.ok||c))try{r=await Promise.race([fetch(O[0]+i,{headers:n,mode:"cors"}),new Promise(((e,t)=>setTimeout(t,3e4)))]),await u(r)}catch(e){}a&&151==a.errorCode&&(x.removeItem(P),x.removeItem(E),d=J(),t.cu=d,S=void 0,i="auth/?ext="+encodeURIComponent(m(JSON.stringify(t))),r=await Promise.race([fetch(O[0]+i,{headers:n,mode:"cors"}),new Promise(((e,t)=>setTimeout(t,3e4)))]),await u(r)),(()=>{if(!r||!r.ok){let e;l&&x.setItem(E,""),a?111==a.errorCode?e=a.message:(e=a.message.trim(),e.endsWith(".")||(e+="."),e=b?`An error occurred during authorization: ${e} [Contact Dynamsoft](https://www.dynamsoft.com/company/contact/) for more information.`:`An error occurred during authorization: ${e} Contact the site administrator for more information.`):e=b?$.publicTrialFailConnect:$.failConnect;let t=Error(e);throw a&&a.errorCode&&(t.ltsErrorCode=a.errorCode),t}})();let f=await r.text();try{S||(x.setItem(P,await H(JSON.stringify([d,o]))),S=o),x.setItem(E,f)}catch(e){}return f})(),new Promise(((e,t)=>{let r;r=b?$.publicTrialNetworkTimeout:$.networkTimeout,setTimeout((()=>t(new Error(r))),s?3e3:15e3)}))]);s=l}catch(e){p&&console.error(e),I=e}Z.resolve(),Z=null},ee=async()=>{X||(X=(async()=>{if(U(d),!s){if(!j)throw A(I.message),I;return}let e={dm:y};p&&(e.bd=!0),e.brtk=!0,e.ls=O[0],a&&(-1!=a.indexOf("-")?e.hs=a:e.og=a),e.cu=d,f&&(e.fn=f),r&&(e.pd=r),o&&(e.v=o),c&&(e.dt=c),u&&(e.os=u),w&&(e.rmk=w),U(s);try{let t=JSON.parse(await L(s));t.pv&&(e.pv=JSON.stringify(t.pv)),t.ba&&(e.ba=t.ba),t.usu&&(e.usu=t.usu),t.trial&&(e.trial=t.trial),t.its&&(e.its=t.its),1==e.trial&&t.msg?e.msg=t.msg:I?e.msg=I.message||I:t.msg&&(e.msg=t.msg),e.ar=t.in,e.bafc=!!I}catch(e){}U(e);try{await D(e)}catch(e){U("error updl")}await te(),j||(j=!0),X=null})()),await X},te=async()=>{let e=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ"),t=await N();if(U(t),t&&t<e)throw I?new Error($.dlsErrorAndCacheExpire):new Error($.checkLocalTime)};const re=new t;let ne=null,oe=async(e,t)=>(R=R.then((async()=>{try{let r=await C.keys();if(t||(re.isFulfilled?e&&(r=r.filter((t=>t<e))):e&&r.includes(e)?r=[e]:(r=[],U("Unexpected null key"))),!r.length)return;for(let e=0;e<r.length/1e3;++e){let t=r.slice(1e3*e,1e3*(e+1)),n=[];for(let e=0;e<t.length;++e)n.push(await C.getItem(t[e]));S=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ");{let e=await x.getItem(P);e&&([d]=JSON.parse(await z(e))),x.setItem(P,await H(JSON.stringify([d,S])))}try{let e,r,o=O[0]+"verify/v2";S&&(o+="?ltstime="+encodeURIComponent(S));try{e=fetch(o,{method:"POST",body:n.join(";"),keepalive:!0})}finally{!re.isFulfilled&&l&&re.resolve()}try{r=await e}finally{re.isFulfilled||re.resolve()}if(!r.ok)throw new Error("verify failed. Status Code: "+r.status);for(let e=0;e<t.length;++e)await C.removeItem(t[e])}catch(e){throw re.isFulfilled||re.resolve(),e}}}catch(e){}})),await R);return{i:async e=>{r=e.pd,o=e.v,i=o.split(".")[0],e.dt&&(c=e.dt),a=e.l||"",u="string"!=typeof e.os?JSON.stringify(e.os):e.os,f=e.fn,"string"==typeof f&&(f=f.substring(0,255)),e.ls&&e.ls.length&&(O=e.ls,1==O.length&&O.push(O[0])),b=g===O&&(!a||"200001"===a||a.startsWith("200001-")),v=e.sp,w=e.rmk,"string"==typeof w&&(w=w.substring(0,255)),e.cv&&(_=""+e.cv),D=e.updl,T=e.mnet,N=e.mxet,await q(),await(async()=>{E=m(String.fromCharCode(a.charCodeAt(0)+10)+m(r)+m(a)+i+m(""+c)),C=await k.createInstance({name:"dynamdlsuns"+m(m("v2"))+m(String.fromCharCode(a.charCodeAt(0)+10)+m(r)+m(a)+i+m(""+c))});try{s=await x.getItem(E)}catch(e){}B=e=>h(String.fromCharCode.apply(null,e).replace(/\n/g,"+").replace(/\s/g,"="))})(),await Q(),await ee(),(!I||I.ltsErrorCode>=102&&I.ltsErrorCode<=120)&&oe(null,!0)},i2:async({updl:e,mxet:t,strDLC2:r})=>{D=e,N=t,await q(),B=e=>h(String.fromCharCode.apply(null,e).replace(/\n/g,"+").replace(/\s/g,"="));let n={pk:r,dm:y};p&&(n.bd=!0),n.cu=d;try{s=r.substring(4);let e=JSON.parse(await L(s));e.pv&&(n.pv=JSON.stringify(e.pv)),e.ba&&(n.ba=e.ba),n.ar=e.in}catch(e){}U(n);try{await D(n)}catch(e){U("error updl")}let o=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ"),i=await N();if(i&&i<o)throw new Error($.dlsOfflineLicenseExpired)},c:async()=>{let e=new Date;if(e.getTime()<K+36e4)return;let t=e.kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ"),r=await T(),n=await N();if(n&&n<t)await Q(!0),await ee();else if(r&&r<t){let t=new Date(e.getTime());t.setMinutes(e.getMinutes()-6);let r=t.kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ");S<r&&Q().then((()=>ee()))}},s:async(e,t,r,o)=>{try{let e;e=t.startsWith("{")&&t.endsWith("}")?await(async e=>{if(n[B(W.c)]&&n[B(W.c)][B(W.e)]&&n[B(W.c)][B(W.e)][B(W.f)]){let t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r);let r=n.crypto.getRandomValues(new Uint8Array(12));M||(M=await F());let o=await n[B(W.c)][B(W.e)][B(W.h)]({name:B(W.g),[B(W.j)]:r,[B(W.l)]:128},M,t),i=new Uint8Array(o),a=new Uint8Array(r.length+i.length);return a.set(r),a.set(i,r.length),m(String.fromCharCode.apply(null,a))}})(t):t,e?(U("bs "+r),await C.setItem(r,e),U("ss "+r)):U("ept ecpt")}catch(e){}o&&(U("bd "+r),await oe(r,2==o),U("sd "+r)),ne&&clearTimeout(ne),ne=setTimeout((async()=>{await oe()}),36e4)},p:re,u:async()=>(await q(),d),ar:()=>s,pt:()=>b,ae:()=>I}};const X=self,q={};X.coreWorkerVersion="3.0.30";const Q={cvr:"cvrWorkerVersion",dbr:"dbrWorkerVersion",dlr:"dlrWorkerVersion",ddn:"ddnWorkerVersion",dcp:"dcpWorkerVersion",license:"licenseWorkerVersion"};let ee,te,re,ne,oe,ie=!1;const ae={},se=e=>{let r=ae[e],n=!1;return r?r.isEmpty?r.task=()=>{}:n=!0:r=ae[e]=new t((()=>{})),{p:r,justWait:n}},ce=e=>ae[e]=ae[e]||new t,le=[];X.setBufferIntoWasm=(e,t=0,r=0,n=0)=>{r&&(e=n?e.subarray(r,n):e.subarray(r));let o=le[t]=le[t]||{ptr:0,size:0,maxSize:0};return e.length>o.maxSize&&(o.ptr&&me._free(o.ptr),o.ptr=me._malloc(e.length),o.maxSize=e.length),me.HEAPU8.set(e,o.ptr),o.size=e.length,o.ptr};const de={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(de.needed){for(let e=0;e<de.temps.length;e++)me._free(de.temps[e]);de.temps.length=0,me._free(de.buffer),de.buffer=0,de.size+=de.needed,de.needed=0}de.buffer||(de.size+=128,de.buffer=me._malloc(de.size),assert(de.buffer)),de.pos=0},alloc:function(e,t){assert(de.buffer);let r,n=t.BYTES_PER_ELEMENT,o=e.length*n;return o=o+7&-8,de.pos+o>=de.size?(assert(o>0),de.needed+=o,r=me._malloc(o),de.temps.push(r)):(r=de.buffer+de.pos,de.pos+=o),r},copy:function(e,t,r){switch(r>>>=0,t.BYTES_PER_ELEMENT){case 2:r>>>=1;break;case 4:r>>>=2;break;case 8:r>>>=3}for(let n=0;n<e.length;n++)t[r+n]=e[n]}},ue=X.ep=de.prepare,fe=X.es=e=>{let t=intArrayFromString(e),r=de.alloc(t,me.HEAP8);return de.copy(t,me.HEAP8,r),r},me=X.Module={print:e=>{ee&&Ie(e)},printErr:e=>{ee&&Ie(e)},locateFile:(e,t)=>{if(["std.wasm","core.wasm"].includes(e)){return ge[e.split(".")[0]]+e}return e}},he=async e=>{await ce("core"),te=e.trial,ne=e.msg,ue(),wasmImports.emscripten_bind_CoreWasm_static_init_1(fe(JSON.stringify(e)))},pe=()=>{let e=me.getMinExpireTime;return e?e():null},ye=()=>{let e=me.getMaxExpireTime;return e?e():null};X.checkAndReauth=async()=>{};const ge=X.engineResourcePaths={},be=X.loadCore=async()=>{const e="core";let{p:t,justWait:r}=se(e);if(r)return t;let n=ee&&(Ie(e+" loading..."),Date.now())||0;me.onRuntimeInitialized=()=>{ee&&Ie(e+" initialized, cost "+(Date.now()-n)+" ms"),t.resolve(void 0)};let o=ge.std+"std.js";importScripts(o),await t},ve=X.loadSideModule=async(e,{js:t,wasm:r})=>{let{p:n,justWait:o}=se(e);if(o)return n;await ce("core");let i=ee&&(Ie(e+" loading..."),Date.now())||0;if(t instanceof Array)for(let r of t){let t=ge[e]+r;importScripts(t)}else if(t){let t=ge[e]+e+".worker.js";importScripts(t)}if(r instanceof Array)for(let t of r){let r=ge[e]+t;try{await loadDynamicLibrary(r,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e=Error("Fail To load "+r)}}else if(r){let t=ge[e]+e+".wasm";"dedicator"===e&&(t=ge.dcp+"dedicator.wasm");try{await loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e=Error("Fail To load "+t)}}wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist&&(ue(),wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist(fe(e.toUpperCase()))),wasmImports.emscripten_bind_CvrWasm_SetModuleExist&&(ue(),wasmImports.emscripten_bind_CvrWasm_SetModuleExist(fe(e.toUpperCase())));const a=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0())),s=X[Q[e]];q[e]={worker:`${s||"No Worker"}`,wasm:a[e.toUpperCase()]},ee&&Ie(e+" initialized, cost "+(Date.now()-i)+" ms"),n.resolve(void 0)},we=X.mapController={loadWasm:async(e,t)=>{try{Object.assign(ge,e.engineResourcePaths),e.needLoadCore&&(e.bLog&&(ee=!0),e.dm&&(re=e.dm),e.bd&&(ie=!0),await be());for(let t of e.names)"dedicator"===t&&(e.autoResources.dedicator={js:!1,wasm:!0}),await ve(t,e.autoResources[t]);if(e.needLoadCore){const e=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0()));q.std={worker:"No Wroker",wasm:"1.0.0"},q.core={worker:X.coreWorkerVersion,wasm:e.CORE}}_e(t,{versions:q})}catch(e){Se(t,e)}},dynamsoft:async(e,t)=>{try{let r,n=e.l,o=e.brtk,i=e.bptk,a=async()=>{try{oe=oe||K({dm:re,log:Ie,bd:ie}),X.scsd=oe.s,e.pd="",e.v="0."+e.v,e.updl=he,e.mnet=pe,e.mxet=ye,await oe.i(e)}catch(e){if(!i)throw e;o=!1,await s(),r=e.ltsErrorCode,ne=e.message||e}},s=async()=>{if(n.startsWith("DLC2"))oe=oe||K({dm:re,log:Ie,bd:ie}),await oe.i2({updl:he,mxet:ye,strDLC2:n});else{let e={pk:n,dm:re};ie&&(e.bd=!0),await he(e)}};o?await a():await s(),_e(t,{trial:te,ltsErrorCode:r,message:ne,bSupportDce4Module:wasmImports.emscripten_bind_CoreWasm_static_GetIsSupportDceModule_0(),bSupportIRTModule:wasmImports.emscripten_bind_CoreWasm_static_GetIsSupportIRTModule_0()})}catch(e){Se(t,e)}},setBLog:e=>{ee=e.value},setBDebug:e=>{ie=e.value},getDeviceUUID:async(e,t)=>{try{oe=oe||K({dm:re,log:Ie,bd:ie});let e=await oe.u();_e(t,{uuid:e})}catch(e){Se(t,e)}},getAR:async(e,t)=>{try{if(oe){let e={u:await oe.u(),pt:oe.pt()},r=oe.ar();r&&(e.ar=r);let n=oe.ae();n&&(e.lem=n.message,e.lec=n.ltsErrorCode),_e(t,e)}else _e(t,null)}catch(e){Se(t,e)}},getModuleVersion:async(e,t)=>{try{let e=UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0());_e(t,{versions:JSON.parse(e)})}catch(e){Se(t,e)}},cfd:async(e,t)=>{try{wasmImports.emscripten_bind_CoreWasm_static_CFD_1(e.count),_e(t,{})}catch(e){Se(t,e)}}};addEventListener("message",(e=>{const t=e.data?e.data:e,r=t.body,n=t.id,o=t.instanceID,i=we[t.type];if(!i)throw new Error("Unmatched task: "+t.type);i(r,n,o)}));const _e=X.handleTaskRes=(e,t)=>{postMessage({type:"task",id:e,body:Object.assign({success:!0},t)})},Se=X.handleTaskErr=(e,t)=>{postMessage({type:"task",id:e,body:{success:!1,message:(null==t?void 0:t.message)||void 0,stack:ie&&(null==t?void 0:t.stack)||void 0}})},Ie=X.log=e=>{postMessage({type:"log",message:e})}}();
!function(){"use strict";const e=e=>e&&"object"==typeof e&&"function"==typeof e.then;class t extends Promise{constructor(t){let r,n;super(((e,t)=>{r=e,n=t})),this._s="pending",this.resolve=t=>{this.isPending&&(e(t)?this.task=t:(this._s="fulfilled",r(t)))},this.reject=e=>{this.isPending&&(this._s="rejected",n(e))},this.task=t}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(t){let r;this._task=t,e(t)?r=t:"function"==typeof t&&(r=new Promise(t)),r&&(async()=>{try{const e=await r;t===this._task&&this.resolve(e)}catch(e){t===this._task&&this.reject(e)}})()}get isEmpty(){return null==this._task}}const r="undefined"==typeof self,n=r?{}:self;let o,i,a,s,c;"undefined"!=typeof navigator&&(o=navigator,i=o.userAgent,a=o.platform,s=o.mediaDevices),function(){if(!r){const e={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:o.vendor,search:"Apple",verSearch:["Version","iPhone OS","CPU OS"]},Firefox:null,Explorer:{search:"MSIE",verSearch:"MSIE"}},t={HarmonyOS:null,Android:null,iPhone:null,iPad:null,Windows:{str:a,search:"Win"},Mac:{str:a},Linux:{str:a}};let r="unknownBrowser",n=0,s="unknownOS";for(let t in e){const o=e[t]||{};let a=o.str||i,s=o.search||t,c=o.verStr||i,l=o.verSearch||t;if(l instanceof Array||(l=[l]),-1!=a.indexOf(s)){r=t;for(let e of l){let t=c.indexOf(e);if(-1!=t){n=parseFloat(c.substring(t+e.length+1));break}}break}}for(let e in t){const r=t[e]||{};let n=r.str||i,o=r.search||e;if(-1!=n.indexOf(o)){s=e;break}}"Linux"==s&&-1!=i.indexOf("Windows NT")&&(s="HarmonyOS"),c={browser:r,version:n,OS:s}}r&&(c={browser:"ssr",version:0,OS:"ssr"})}(),"undefined"!=typeof WebAssembly&&i&&(!/Safari/.test(i)||/Chrome/.test(i)||/\(.+\s11_2_([2-6]).*\)/.test(i)),s&&s.getUserMedia;const l="Chrome"===c.browser&&c.version>66||"Safari"===c.browser&&c.version>13||"OPR"===c.browser&&c.version>43||"Edge"===c.browser&&c.version>15;var d=function(){try{if("undefined"!=typeof indexedDB)return indexedDB;if("undefined"!=typeof webkitIndexedDB)return webkitIndexedDB;if("undefined"!=typeof mozIndexedDB)return mozIndexedDB;if("undefined"!=typeof OIndexedDB)return OIndexedDB;if("undefined"!=typeof msIndexedDB)return msIndexedDB}catch(e){return}}();function u(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(o){if("TypeError"!==o.name)throw o;for(var r=new("undefined"!=typeof BlobBuilder?BlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}function f(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function m(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function h(e){return"string"!=typeof e&&(console.warn(`${e} used as a key, but it is not a string.`),e=String(e)),e}function p(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}const y="local-forage-detect-blob-support";let g;const b={},v=Object.prototype.toString,w="readonly",_="readwrite";function S(e){return"boolean"==typeof g?Promise.resolve(g):function(e){return new Promise((function(t){var r=e.transaction(y,_),n=u([""]);r.objectStore(y).put(n,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return g=e,g}))}function I(e){var t=b[e.name],r={};r.promise=new Promise((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function k(e){var t=b[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function C(e,t){var r=b[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function x(e,t){return new Promise((function(r,n){if(b[e.name]=b[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(e.db);I(e),e.db.close()}var o=[e.name];t&&o.push(e.version);var i=d.open.apply(d,o);t&&(i.onupgradeneeded=function(t){var r=i.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(y)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),i.onerror=function(e){e.preventDefault(),n(i.error)},i.onsuccess=function(){var t=i.result;t.onversionchange=function(e){e.target.close()},r(t),k(e)}}))}function P(e){return x(e,!1)}function E(e){return x(e,!0)}function D(e,t){if(!e.db)return!0;var r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,o=e.version>e.db.version;if(n&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),o||r){if(r){var i=e.db.version+1;i>e.version&&(e.version=i)}return!0}return!1}function T(e){var t=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),o=0;o<t;o++)n[o]=e.charCodeAt(o);return r}(atob(e.data));return u([t],{type:e.type})}function N(e){var t=this,r=t._initReady().then((function(){var e=b[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return m(r,e,e),r}function M(e,t,r,n){void 0===n&&(n=1);try{var o=e.db.transaction(e.storeName,t);r(null,o)}catch(o){if(n>0&&(!e.db||"InvalidStateError"===o.name||"NotFoundError"===o.name))return Promise.resolve().then((()=>{if(!e.db||"NotFoundError"===o.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),E(e)})).then((()=>function(e){I(e);for(var t=b[e.name],r=t.forages,n=0;n<r.length;n++){const e=r[n];e._dbInfo.db&&(e._dbInfo.db.close(),e._dbInfo.db=null)}return e.db=null,P(e).then((t=>(e.db=t,D(e)?E(e):t))).then((n=>{e.db=t.db=n;for(var o=0;o<r.length;o++)r[o]._dbInfo.db=n})).catch((t=>{throw C(e,t),t}))}(e).then((function(){M(e,t,r,n-1)})))).catch(r);r(o)}}var O={_driver:"asyncStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var o=b[r.name];o||(o={forages:[],db:null,dbReady:null,deferredOperations:[]},b[r.name]=o),o.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=N);var i=[];function a(){return Promise.resolve()}for(var s=0;s<o.forages.length;s++){var c=o.forages[s];c!==t&&i.push(c._initReady().catch(a))}var l=o.forages.slice(0);return Promise.all(i).then((function(){return r.db=o.db,P(r)})).then((function(e){return r.db=e,D(r,t._defaultConfig.version)?E(r):e})).then((function(e){r.db=o.db=e,t._dbInfo=r;for(var n=0;n<l.length;n++){var i=l[n];i!==t&&(i._dbInfo.db=r.db,i._dbInfo.version=r.version)}}))},_support:function(){try{if(!d||!d.open)return!1;var e="undefined"!=typeof openDatabase&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&"undefined"!=typeof indexedDB&&"undefined"!=typeof IDBKeyRange}catch(e){return!1}}(),getItem:function(e,t){var r=this;e=h(e);var n=new Promise((function(t,n){r.ready().then((function(){M(r._dbInfo,w,(function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).get(e);a.onsuccess=function(){var e=a.result;void 0===e&&(e=null),function(e){return e&&e.__local_forage_encoded_blob}(e)&&(e=T(e)),t(e)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return f(n,t),n},setItem:function(e,t,r){var n=this;e=h(e);var o=new Promise((function(r,o){var i;n.ready().then((function(){return i=n._dbInfo,"[object Blob]"===v.call(t)?S(i.db).then((function(e){return e?t:(r=t,new Promise((function(e,t){var n=new FileReader;n.onerror=t,n.onloadend=function(t){var n=btoa(t.target.result||"");e({__local_forage_encoded_blob:!0,data:n,type:r.type})},n.readAsBinaryString(r)})));var r})):t})).then((function(t){M(n._dbInfo,_,(function(i,a){if(i)return o(i);try{var s=a.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var c=s.put(t,e);a.oncomplete=function(){void 0===t&&(t=null),r(t)},a.onabort=a.onerror=function(){var e=c.error?c.error:c.transaction.error;o(e)}}catch(e){o(e)}}))})).catch(o)}));return f(o,r),o},removeItem:function(e,t){var r=this;e=h(e);var n=new Promise((function(t,n){r.ready().then((function(){M(r._dbInfo,_,(function(o,i){if(o)return n(o);try{var a=i.objectStore(r._dbInfo.storeName).delete(e);i.oncomplete=function(){t()},i.onerror=function(){n(a.error)},i.onabort=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return f(n,t),n},clear:function(e){var t=this,r=new Promise((function(e,r){t.ready().then((function(){M(t._dbInfo,_,(function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).clear();o.oncomplete=function(){e()},o.onabort=o.onerror=function(){var e=i.error?i.error:i.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return f(r,e),r},length:function(e){var t=this,r=new Promise((function(e,r){t.ready().then((function(){M(t._dbInfo,w,(function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).count();i.onsuccess=function(){e(i.result)},i.onerror=function(){r(i.error)}}catch(e){r(e)}}))})).catch(r)}));return f(r,e),r},keys:function(e){var t=this,r=new Promise((function(e,r){t.ready().then((function(){M(t._dbInfo,w,(function(n,o){if(n)return r(n);try{var i=o.objectStore(t._dbInfo.storeName).openKeyCursor(),a=[];i.onsuccess=function(){var t=i.result;t?(a.push(t.key),t.continue()):e(a)},i.onerror=function(){r(i.error)}}catch(e){r(e)}}))})).catch(r)}));return f(r,e),r},dropInstance:function(e,t){t=p.apply(this,arguments);var r,n=this.config();if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName),e.name){const t=e.name===n.name&&this._dbInfo.db?Promise.resolve(this._dbInfo.db):P(e).then((t=>{const r=b[e.name],n=r.forages;r.db=t;for(var o=0;o<n.length;o++)n[o]._dbInfo.db=t;return t}));r=e.storeName?t.then((t=>{if(!t.objectStoreNames.contains(e.storeName))return;const r=t.version+1;I(e);const n=b[e.name],o=n.forages;t.close();for(let e=0;e<o.length;e++){const t=o[e];t._dbInfo.db=null,t._dbInfo.version=r}const i=new Promise(((t,n)=>{const o=d.open(e.name,r);o.onerror=e=>{o.result.close(),n(e)},o.onupgradeneeded=()=>{o.result.deleteObjectStore(e.storeName)},o.onsuccess=()=>{const e=o.result;e.close(),t(e)}}));return i.then((e=>{n.db=e;for(let t=0;t<o.length;t++){const r=o[t];r._dbInfo.db=e,k(r._dbInfo)}})).catch((t=>{throw(C(e,t)||Promise.resolve()).catch((()=>{})),t}))})):t.then((t=>{I(e);const r=b[e.name],n=r.forages;t.close();for(var o=0;o<n.length;o++){n[o]._dbInfo.db=null}const i=new Promise(((t,r)=>{var n=d.deleteDatabase(e.name);n.onerror=()=>{const e=n.result;e&&e.close(),r(n.error)},n.onblocked=()=>{console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},n.onsuccess=()=>{const e=n.result;e&&e.close(),t(e)}}));return i.then((e=>{r.db=e;for(var t=0;t<n.length;t++){k(n[t]._dbInfo)}})).catch((t=>{throw(C(e,t)||Promise.resolve()).catch((()=>{})),t}))}))}else r=Promise.reject("Invalid arguments");return f(r,t),r}};const j=new Map;function R(e,t){let r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}var A={_driver:"tempStorageWrapper",_initStorage:async function(e){const t={};if(e)for(let r in e)t[r]=e[r];const r=t.keyPrefix=R(e,this._defaultConfig);this._dbInfo=t,j.has(r)||j.set(r,new Map)},getItem:function(e,t){e=h(e);const r=this.ready().then((()=>j.get(this._dbInfo.keyPrefix).get(e)));return f(r,t),r},setItem:function(e,t,r){e=h(e);const n=this.ready().then((()=>(void 0===t&&(t=null),j.get(this._dbInfo.keyPrefix).set(e,t),t)));return f(n,r),n},removeItem:function(e,t){e=h(e);const r=this.ready().then((()=>{j.get(this._dbInfo.keyPrefix).delete(e)}));return f(r,t),r},clear:function(e){const t=this.ready().then((()=>{const e=this._dbInfo.keyPrefix;j.has(e)&&j.delete(e)}));return f(t,e),t},length:function(e){const t=this.ready().then((()=>j.get(this._dbInfo.keyPrefix).size));return f(t,e),t},keys:function(e){const t=this.ready().then((()=>[...j.get(this._dbInfo.keyPrefix).keys()]));return f(t,e),t},dropInstance:function(e,t){if(t=p.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){const t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}let r;return r=e.name?new Promise((t=>{e.storeName?t(R(e,this._defaultConfig)):t(`${e.name}/`)})).then((e=>{j.delete(e)})):Promise.reject("Invalid arguments"),f(r,t),r}};const U=(e,t)=>{const r=e.length;let n=0;for(;n<r;){if((o=e[n])===(i=t)||"number"==typeof o&&"number"==typeof i&&isNaN(o)&&isNaN(i))return!0;n++}var o,i;return!1},B=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},W={},F={},L={INDEXEDDB:O,TEMPSTORAGE:A},z=[L.INDEXEDDB._driver,L.TEMPSTORAGE._driver],H=["dropInstance"],J=["clear","getItem","keys","length","removeItem","setItem"].concat(H),V={description:"",driver:z.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function $(e,t){e[t]=function(){const r=arguments;return e.ready().then((function(){return e[t].apply(e,r)}))}}function G(){for(let e=1;e<arguments.length;e++){const t=arguments[e];if(t)for(let e in t)t.hasOwnProperty(e)&&(B(t[e])?arguments[0][e]=t[e].slice():arguments[0][e]=t[e])}return arguments[0]}class Z{constructor(e){for(let e in L)if(L.hasOwnProperty(e)){const t=L[e],r=t._driver;this[e]=r,W[r]||this.defineDriver(t)}this._defaultConfig=G({},V),this._config=G({},this._defaultConfig,e),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((()=>{}))}config(e){if("object"==typeof e){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(let t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config}defineDriver(e,t,r){const n=new Promise((function(t,r){try{const n=e._driver,o=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(o);const i=J.concat("_initStorage");for(let t=0,n=i.length;t<n;t++){const n=i[t];if((!U(H,n)||e[n])&&"function"!=typeof e[n])return void r(o)}const a=function(){const t=function(e){return function(){const t=new Error(`Method ${e} is not implemented by the current driver`),r=Promise.reject(t);return f(r,arguments[arguments.length-1]),r}};for(let r=0,n=H.length;r<n;r++){const n=H[r];e[n]||(e[n]=t(n))}};a();const s=function(r){W[n]&&console.info(`Redefining LocalForage driver: ${n}`),W[n]=e,F[n]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(s,r):s(!!e._support):s(!0)}catch(e){r(e)}}));return m(n,t,r),n}driver(){return this._driver||null}getDriver(e,t,r){const n=W[e]?Promise.resolve(W[e]):Promise.reject(new Error("Driver not found."));return m(n,t,r),n}ready(e){const t=this,r=t._driverSet.then((()=>(null===t._ready&&(t._ready=t._initDriver()),t._ready)));return m(r,e,e),r}setDriver(e,t,r){const n=this;B(e)||(e=[e]);const o=this._getSupportedDrivers(e);function i(){n._config.driver=n.driver()}function a(e){return n._extend(e),i(),n._ready=n._initStorage(n._config),n._ready}const s=null!==this._driverSet?this._driverSet.catch((()=>Promise.resolve())):Promise.resolve();return this._driverSet=s.then((()=>{const e=o[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then((e=>{n._driver=e._driver,i(),n._wrapLibraryMethodsWithReady(),n._initDriver=function(e){return function(){let t=0;return function r(){for(;t<e.length;){let o=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(o).then(a).catch(r)}i();const o=new Error("No available storage method found.");return n._driverSet=Promise.reject(o),n._driverSet}()}}(o)}))})).catch((()=>{i();const e=new Error("No available storage method found.");return n._driverSet=Promise.reject(e),n._driverSet})),m(this._driverSet,t,r),this._driverSet}supports(e){return!!F[e]}_extend(e){G(this,e)}_getSupportedDrivers(e){const t=[];for(let r=0,n=e.length;r<n;r++){const n=e[r];this.supports(n)&&t.push(n)}return t}_wrapLibraryMethodsWithReady(){for(let e=0,t=J.length;e<t;e++)$(this,J[e])}createInstance(e){return new Z(e)}}var Y=new Z;Date.prototype.kUtilFormat=function(e){const t={"M+":this.getUTCMonth()+1,"d+":this.getUTCDate(),"H+":this.getUTCHours(),"h+":this.getUTCHours()%12||12,"m+":this.getUTCMinutes(),"s+":this.getUTCSeconds(),"q+":Math.floor((this.getUTCMonth()+3)/3),"S+":this.getUTCMilliseconds()};/(y+)/.test(e)&&(e=e.replace(RegExp.$1,(this.getUTCFullYear()+"").substr(4-RegExp.$1.length)));for(let r in t)new RegExp("("+r+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?t[r]:("000"+t[r]).substr(("000"+t[r]).length-RegExp.$1.length)));return e};let K=e=>{let r,o,i,a,s,c,d,u,f,m=n.btoa,h=n.atob,p=e.bd,y=e.dm;const g=["https://mlts.dynamsoft.com/","https://slts.dynamsoft.com/"];let b,v,w,_,S,I,k,C,x,P,E,D,T,N,M,O=g,j=!1,R=Promise.resolve(),A=e.log&&((...t)=>{try{e.log.apply(null,t)}catch(e){setTimeout((()=>{throw e}),0)}})||(()=>{}),U=p&&A||(()=>{}),B=e=>e.join(""),W={a:[80,88,27,82,145,164,199,211],b:[187,87,89,128,150,44,190,213],c:[89,51,74,53,99,72,82,118],d:[99,181,118,158,215,103,76,117],e:[99,51,86,105,100,71,120,108],f:[97,87,49,119,98,51,74,48,83,50,86,53],g:[81,85,86,84,76,85,100,68,84,81,32,32],h:[90,87,53,106,99,110,108,119,100,65,32,32],i:[90,71,86,106,99,110,108,119,100,65,32,32],j:[97,88,89,32],k:[29,83,122,137,5,180,157,114],l:[100,71,70,110,84,71,86,117,90,51,82,111]},F=()=>n[B(W.c)][B(W.e)][B(W.f)]("raw",new Uint8Array(W.a.concat(W.b,W.d,W.k)),B(W.g),!0,[B(W.h),B(W.i)]),L=async e=>{if(n[B(W.c)]&&n[B(W.c)][B(W.e)]&&n[B(W.c)][B(W.e)][B(W.f)]){let t=h(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;++e)r[e]=t.charCodeAt(e);let o=r.subarray(0,12),i=r.subarray(o.length);M||(M=await F());let a=await n[B(W.c)][B(W.e)][B(W.i)]({name:B(W.g),[B(W.j)]:o,[B(W.l)]:128},M,i);return String.fromCharCode.apply(null,new Uint8Array(a))}},z=e=>h(h(e.replace(/\n/g,"+").replace(/\s/g,"=")).substring(1)),H=e=>m(String.fromCharCode(97+25*Math.random())+m(e)).replace(/\+/g,"\n").replace(/=/g," "),J=()=>{if(n.crypto){let e=new Uint8Array(36);n.crypto.getRandomValues(e);let t="";for(let r=0;r<36;++r){let n=e[r]%36;t+=n<10?n:String.fromCharCode(n+87)}return t}return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))};const V="Failed to connect to the Dynamsoft License Server: ",$={dlsErrorAndCacheExpire:V+"The cached license has expired. Please get connected to the network as soon as possible or contact the site administrator for more information.",publicTrialNetworkTimeout:V+"network timed out. Check your Internet connection or [contact Dynamsoft](https://www.dynamsoft.com/company/contact/) for more information.",networkTimeout:V+"network timed out. Check your Internet connection or contact the site administrator for more information.",publicTrialFailConnect:V+"network connection error. Check your Internet connection or [contact Dynamsoft](https://www.dynamsoft.com/company/contact/) for more information.",failConnect:V+"network connection error. Check your Internet connection or contact the site administrator for more information.",checkLocalTime:"Your system date and time appear to have been changed, causing the license to fail. Please correct the system data and time and try again.",idbTimeout:"Failed to open indexedDB: Timeout.",dlsOfflineLicenseExpired:"The DLS2 Offline license has expired. Please contact the site administrator for more information."};let G,Z,K,X,q=async()=>{if(G)return G;G=new t,await(async()=>{k||(k=Y)})(),await Promise.race([(async()=>{let e=await k.createInstance({name:"dynamjssdkhello"});await e.setItem("dynamjssdkhello","available")})(),new Promise(((e,t)=>{setTimeout((()=>t(new Error($.idbTimeout))),5e3)}))]),x=await k.createInstance({name:"dynamdlsinfo"}),P=m(m("v2")+String.fromCharCode(y.charCodeAt(y.length/2)+1)+m(y));try{let e=await x.getItem(P);if(!e){let t=await k.createInstance({name:"dynamltsinfo"});e=await t.getItem(P),e&&await x.setItem(P,e)}e&&([d,S]=JSON.parse(await z(e)))}catch(e){}try{null==d&&(d=J(),x.setItem(P,await H(JSON.stringify([d,null]))))}catch(e){}G.resolve()},Q=async e=>{if(K=Date.now(),Z)return Z;Z=new t;try{let t={pd:r,vm:i,v:o,dt:c||"browser",ed:"javascript",cu:d,ad:y,os:u,fn:f};w&&(t.rmk=w),a&&(-1!=a.indexOf("-")?t.hs=a:t.og=a);let n={};if(S){let e=await x.getItem(P);e&&([d,S]=JSON.parse(await z(e))),n["lts-time"]=S}v&&(t.sp=v);let l=await Promise.race([(async()=>{let r,o=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ");S&&(x.setItem(P,await H(JSON.stringify([d,o]))),S=o);let i="auth/?ext="+encodeURIComponent(m(JSON.stringify(t)));_&&(i+="&"+encodeURIComponent(_));let a,c=!1,l=!1,u=async e=>{if(e&&!e.ok)try{let t=await e.text();if(t){let e=JSON.parse(t);e.errorCode&&(a=e,e.errorCode>100&&e.errorCode<200&&(s=null,c=!0,l=!0))}}catch(e){}};try{r=await Promise.race([fetch(O[0]+i,{headers:n,cache:e?"reload":"default",mode:"cors"}),new Promise(((e,t)=>setTimeout(t,1e4)))]),await u(r)}catch(e){}if(!(s||r&&r.ok||c))try{r=await Promise.race([fetch(O[1]+i,{headers:n,mode:"cors"}),new Promise(((e,t)=>setTimeout(t,3e4)))]),await u(r)}catch(e){}if(!(s||r&&r.ok||c))try{r=await Promise.race([fetch(O[0]+i,{headers:n,mode:"cors"}),new Promise(((e,t)=>setTimeout(t,3e4)))]),await u(r)}catch(e){}a&&151==a.errorCode&&(x.removeItem(P),x.removeItem(E),d=J(),t.cu=d,S=void 0,i="auth/?ext="+encodeURIComponent(m(JSON.stringify(t))),r=await Promise.race([fetch(O[0]+i,{headers:n,mode:"cors"}),new Promise(((e,t)=>setTimeout(t,3e4)))]),await u(r)),(()=>{if(!r||!r.ok){let e;l&&x.setItem(E,""),a?111==a.errorCode?e=a.message:(e=a.message.trim(),e.endsWith(".")||(e+="."),e=b?`An error occurred during authorization: ${e} [Contact Dynamsoft](https://www.dynamsoft.com/company/contact/) for more information.`:`An error occurred during authorization: ${e} Contact the site administrator for more information.`):e=b?$.publicTrialFailConnect:$.failConnect;let t=Error(e);throw a&&a.errorCode&&(t.ltsErrorCode=a.errorCode),t}})();let f=await r.text();try{S||(x.setItem(P,await H(JSON.stringify([d,o]))),S=o),x.setItem(E,f)}catch(e){}return f})(),new Promise(((e,t)=>{let r;r=b?$.publicTrialNetworkTimeout:$.networkTimeout,setTimeout((()=>t(new Error(r))),s?3e3:15e3)}))]);s=l}catch(e){p&&console.error(e),I=e}Z.resolve(),Z=null},ee=async()=>{X||(X=(async()=>{if(U(d),!s){if(!j)throw A(I.message),I;return}let e={dm:y};p&&(e.bd=!0),e.brtk=!0,e.ls=O[0],a&&(-1!=a.indexOf("-")?e.hs=a:e.og=a),e.cu=d,f&&(e.fn=f),r&&(e.pd=r),o&&(e.v=o),c&&(e.dt=c),u&&(e.os=u),w&&(e.rmk=w),U(s);try{let t=JSON.parse(await L(s));t.pv&&(e.pv=JSON.stringify(t.pv)),t.ba&&(e.ba=t.ba),t.usu&&(e.usu=t.usu),t.trial&&(e.trial=t.trial),t.its&&(e.its=t.its),1==e.trial&&t.msg?e.msg=t.msg:I?e.msg=I.message||I:t.msg&&(e.msg=t.msg),e.ar=t.in,e.bafc=!!I}catch(e){}U(e);try{await D(e)}catch(e){U("error updl")}await te(),j||(j=!0),X=null})()),await X},te=async()=>{let e=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ"),t=await N();if(U(t),t&&t<e)throw I?new Error($.dlsErrorAndCacheExpire):new Error($.checkLocalTime)};const re=new t;let ne=null,oe=async(e,t)=>(R=R.then((async()=>{try{let r=await C.keys();if(t||(re.isFulfilled?e&&(r=r.filter((t=>t<e))):e&&r.includes(e)?r=[e]:(r=[],U("Unexpected null key"))),!r.length)return;for(let e=0;e<r.length/1e3;++e){let t=r.slice(1e3*e,1e3*(e+1)),n=[];for(let e=0;e<t.length;++e)n.push(await C.getItem(t[e]));S=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ");{let e=await x.getItem(P);e&&([d]=JSON.parse(await z(e))),x.setItem(P,await H(JSON.stringify([d,S])))}try{let e,r,o=O[0]+"verify/v2";S&&(o+="?ltstime="+encodeURIComponent(S));try{e=fetch(o,{method:"POST",body:n.join(";"),keepalive:!0})}finally{!re.isFulfilled&&l&&re.resolve()}try{r=await e}finally{re.isFulfilled||re.resolve()}if(!r.ok)throw new Error("verify failed. Status Code: "+r.status);for(let e=0;e<t.length;++e)await C.removeItem(t[e])}catch(e){throw re.isFulfilled||re.resolve(),e}}}catch(e){}})),await R);return{i:async e=>{r=e.pd,o=e.v,i=o.split(".")[0],e.dt&&(c=e.dt),a=e.l||"",u="string"!=typeof e.os?JSON.stringify(e.os):e.os,f=e.fn,"string"==typeof f&&(f=f.substring(0,255)),e.ls&&e.ls.length&&(O=e.ls,1==O.length&&O.push(O[0])),b=g===O&&(!a||"200001"===a||a.startsWith("200001-")),v=e.sp,w=e.rmk,"string"==typeof w&&(w=w.substring(0,255)),e.cv&&(_=""+e.cv),D=e.updl,T=e.mnet,N=e.mxet,await q(),await(async()=>{E=m(String.fromCharCode(a.charCodeAt(0)+10)+m(r)+m(a)+i+m(""+c)),C=await k.createInstance({name:"dynamdlsuns"+m(m("v2"))+m(String.fromCharCode(a.charCodeAt(0)+10)+m(r)+m(a)+i+m(""+c))});try{s=await x.getItem(E)}catch(e){}B=e=>h(String.fromCharCode.apply(null,e).replace(/\n/g,"+").replace(/\s/g,"="))})(),await Q(),await ee(),(!I||I.ltsErrorCode>=102&&I.ltsErrorCode<=120)&&oe(null,!0)},i2:async({updl:e,mxet:t,strDLC2:r})=>{D=e,N=t,await q(),B=e=>h(String.fromCharCode.apply(null,e).replace(/\n/g,"+").replace(/\s/g,"="));let n={pk:r,dm:y};p&&(n.bd=!0),n.cu=d;try{s=r.substring(4);let e=JSON.parse(await L(s));e.pv&&(n.pv=JSON.stringify(e.pv)),e.ba&&(n.ba=e.ba),n.ar=e.in}catch(e){}U(n);try{await D(n)}catch(e){U("error updl")}let o=(new Date).kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ"),i=await N();if(i&&i<o)throw new Error($.dlsOfflineLicenseExpired)},c:async()=>{let e=new Date;if(e.getTime()<K+36e4)return;let t=e.kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ"),r=await T(),n=await N();if(n&&n<t)await Q(!0),await ee();else if(r&&r<t){let t=new Date(e.getTime());t.setMinutes(e.getMinutes()-6);let r=t.kUtilFormat("yyyy-MM-ddTHH:mm:ss.SSSZ");S<r&&Q().then((()=>ee()))}},s:async(e,t,r,o)=>{try{let e;e=t.startsWith("{")&&t.endsWith("}")?await(async e=>{if(n[B(W.c)]&&n[B(W.c)][B(W.e)]&&n[B(W.c)][B(W.e)][B(W.f)]){let t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r);let r=n.crypto.getRandomValues(new Uint8Array(12));M||(M=await F());let o=await n[B(W.c)][B(W.e)][B(W.h)]({name:B(W.g),[B(W.j)]:r,[B(W.l)]:128},M,t),i=new Uint8Array(o),a=new Uint8Array(r.length+i.length);return a.set(r),a.set(i,r.length),m(String.fromCharCode.apply(null,a))}})(t):t,e?(U("bs "+r),await C.setItem(r,e),U("ss "+r)):U("ept ecpt")}catch(e){}o&&(U("bd "+r),await oe(r,2==o),U("sd "+r)),ne&&clearTimeout(ne),ne=setTimeout((async()=>{await oe()}),36e4)},p:re,u:async()=>(await q(),d),ar:()=>s,pt:()=>b,ae:()=>I}};const X=self,q={};X.coreWorkerVersion="3.0.31-beta-202401171755";const Q={cvr:"cvrWorkerVersion",dbr:"dbrWorkerVersion",dlr:"dlrWorkerVersion",ddn:"ddnWorkerVersion",dcp:"dcpWorkerVersion",license:"licenseWorkerVersion"};let ee,te,re,ne,oe,ie=!1;const ae={},se=e=>{let r=ae[e],n=!1;return r?r.isEmpty?r.task=()=>{}:n=!0:r=ae[e]=new t((()=>{})),{p:r,justWait:n}},ce=e=>ae[e]=ae[e]||new t,le=[];X.setBufferIntoWasm=(e,t=0,r=0,n=0)=>{r&&(e=n?e.subarray(r,n):e.subarray(r));let o=le[t]=le[t]||{ptr:0,size:0,maxSize:0};return e.length>o.maxSize&&(o.ptr&&me._free(o.ptr),o.ptr=me._malloc(e.length),o.maxSize=e.length),me.HEAPU8.set(e,o.ptr),o.size=e.length,o.ptr};const de={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(de.needed){for(let e=0;e<de.temps.length;e++)me._free(de.temps[e]);de.temps.length=0,me._free(de.buffer),de.buffer=0,de.size+=de.needed,de.needed=0}de.buffer||(de.size+=128,de.buffer=me._malloc(de.size),assert(de.buffer)),de.pos=0},alloc:function(e,t){assert(de.buffer);let r,n=t.BYTES_PER_ELEMENT,o=e.length*n;return o=o+7&-8,de.pos+o>=de.size?(assert(o>0),de.needed+=o,r=me._malloc(o),de.temps.push(r)):(r=de.buffer+de.pos,de.pos+=o),r},copy:function(e,t,r){switch(r>>>=0,t.BYTES_PER_ELEMENT){case 2:r>>>=1;break;case 4:r>>>=2;break;case 8:r>>>=3}for(let n=0;n<e.length;n++)t[r+n]=e[n]}},ue=X.ep=de.prepare,fe=X.es=e=>{let t=intArrayFromString(e),r=de.alloc(t,me.HEAP8);return de.copy(t,me.HEAP8,r),r},me=X.Module={print:e=>{ee&&Ie(e)},printErr:e=>{ee&&Ie(e)},locateFile:(e,t)=>{if(["std.wasm","core.wasm"].includes(e)){return ge[e.split(".")[0]]+e}return e}},he=async e=>{await ce("core"),te=e.trial,ne=e.msg,ue(),wasmImports.emscripten_bind_CoreWasm_static_init_1(fe(JSON.stringify(e)))},pe=()=>{let e=me.getMinExpireTime;return e?e():null},ye=()=>{let e=me.getMaxExpireTime;return e?e():null};X.checkAndReauth=async()=>{};const ge=X.engineResourcePaths={},be=X.loadCore=async()=>{const e="core";let{p:t,justWait:r}=se(e);if(r)return t;let n=ee&&(Ie(e+" loading..."),Date.now())||0;me.onRuntimeInitialized=()=>{ee&&Ie(e+" initialized, cost "+(Date.now()-n)+" ms"),t.resolve(void 0)};let o=ge.std+"std.js";importScripts(o),await t},ve=X.loadSideModule=async(e,{js:t,wasm:r})=>{let{p:n,justWait:o}=se(e);if(o)return n;await ce("core");let i=ee&&(Ie(e+" loading..."),Date.now())||0;if(t instanceof Array)for(let r of t){let t=ge[e]+r;importScripts(t)}else if(t){let t=ge[e]+e+".worker.js";importScripts(t)}if(r instanceof Array)for(let t of r){let r=ge[e]+t;try{await loadDynamicLibrary(r,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e=Error("Fail To load "+r)}}else if(r){let t=ge[e]+e+".wasm";"dedicator"===e&&(t=ge.dcp+"dedicator.wasm");try{await loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e=Error("Fail To load "+t)}}wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist&&(ue(),wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist(fe(e.toUpperCase()))),wasmImports.emscripten_bind_CvrWasm_SetModuleExist&&(ue(),wasmImports.emscripten_bind_CvrWasm_SetModuleExist(fe(e.toUpperCase())));const a=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0())),s=X[Q[e]];q[e]={worker:`${s||"No Worker"}`,wasm:a[e.toUpperCase()]},ee&&Ie(e+" initialized, cost "+(Date.now()-i)+" ms"),n.resolve(void 0)},we=X.mapController={loadWasm:async(e,t)=>{try{Object.assign(ge,e.engineResourcePaths),e.needLoadCore&&(e.bLog&&(ee=!0),e.dm&&(re=e.dm),e.bd&&(ie=!0),await be());for(let t of e.names)"dedicator"===t&&(e.autoResources.dedicator={js:!1,wasm:!0}),await ve(t,e.autoResources[t]);if(e.needLoadCore){const e=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0()));q.std={worker:"No Wroker",wasm:"1.0.0"},q.core={worker:X.coreWorkerVersion,wasm:e.CORE}}_e(t,{versions:q})}catch(e){Se(t,e)}},dynamsoft:async(e,t)=>{try{let r,n=e.l,o=e.brtk,i=e.bptk,a=async()=>{try{oe=oe||K({dm:re,log:Ie,bd:ie}),X.scsd=oe.s,e.pd="",e.v="0."+e.v,e.updl=he,e.mnet=pe,e.mxet=ye,await oe.i(e)}catch(e){if(!i)throw e;o=!1,await s(),r=e.ltsErrorCode,ne=e.message||e}},s=async()=>{if(n.startsWith("DLC2"))oe=oe||K({dm:re,log:Ie,bd:ie}),await oe.i2({updl:he,mxet:ye,strDLC2:n});else{let e={pk:n,dm:re};ie&&(e.bd=!0),await he(e)}};o?await a():await s(),_e(t,{trial:te,ltsErrorCode:r,message:ne,bSupportDce4Module:wasmImports.emscripten_bind_CoreWasm_static_GetIsSupportDceModule_0(),bSupportIRTModule:wasmImports.emscripten_bind_CoreWasm_static_GetIsSupportIRTModule_0()})}catch(e){Se(t,e)}},setBLog:e=>{ee=e.value},setBDebug:e=>{ie=e.value},getDeviceUUID:async(e,t)=>{try{oe=oe||K({dm:re,log:Ie,bd:ie});let e=await oe.u();_e(t,{uuid:e})}catch(e){Se(t,e)}},getAR:async(e,t)=>{try{if(oe){let e={u:await oe.u(),pt:oe.pt()},r=oe.ar();r&&(e.ar=r);let n=oe.ae();n&&(e.lem=n.message,e.lec=n.ltsErrorCode),_e(t,e)}else _e(t,null)}catch(e){Se(t,e)}},getModuleVersion:async(e,t)=>{try{let e=UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0());_e(t,{versions:JSON.parse(e)})}catch(e){Se(t,e)}},cfd:async(e,t)=>{try{wasmImports.emscripten_bind_CoreWasm_static_CFD_1(e.count),_e(t,{})}catch(e){Se(t,e)}}};addEventListener("message",(e=>{const t=e.data?e.data:e,r=t.body,n=t.id,o=t.instanceID,i=we[t.type];if(!i)throw new Error("Unmatched task: "+t.type);i(r,n,o)}));const _e=X.handleTaskRes=(e,t)=>{postMessage({type:"task",id:e,body:Object.assign({success:!0},t)})},Se=X.handleTaskErr=(e,t)=>{postMessage({type:"task",id:e,body:{success:!1,message:(null==t?void 0:t.message)||void 0,stack:ie&&(null==t?void 0:t.stack)||void 0}})},Ie=X.log=e=>{postMessage({type:"log",message:e})}}();

@@ -119,2 +119,1 @@ export declare const mapAsyncDependency: {

export {};
//# sourceMappingURL=CoreModule.d.ts.map

@@ -55,2 +55,1 @@ import { DSImageData } from "../interface/DSImageData";

}
//# sourceMappingURL=ImageSourceAdapter.d.ts.map

@@ -7,2 +7,1 @@ export declare enum EnumBufferOverflowProtectionMode {

}
//# sourceMappingURL=EnumBufferOverflowProtectionMode.d.ts.map

@@ -9,2 +9,1 @@ export declare enum EnumCapturedResultItemType {

}
//# sourceMappingURL=EnumCapturedResultItemType.d.ts.map

@@ -9,2 +9,1 @@ export declare enum EnumColourChannelUsageType {

}
//# sourceMappingURL=EnumColourChannelUsageType.d.ts.map

@@ -7,2 +7,1 @@ export declare enum EnumCornerType {

}
//# sourceMappingURL=EnumCornerType.d.ts.map

@@ -191,2 +191,1 @@ export declare enum EnumErrorCode {

}
//# sourceMappingURL=EnumErrorCode.d.ts.map

@@ -17,2 +17,1 @@ export declare enum EnumGrayscaleEnhancementMode {

}
//# sourceMappingURL=EnumGrayscaleEnhancementMode.d.ts.map

@@ -13,2 +13,1 @@ export declare enum EnumGrayscaleTransformationMode {

}
//# sourceMappingURL=EnumGrayscaleTransformationMode.d.ts.map

@@ -5,2 +5,1 @@ export interface EnumImageCaptureDistanceMode {

}
//# sourceMappingURL=EnumImageCaptureDistanceMode.d.ts.map

@@ -18,2 +18,1 @@ export declare enum EnumImagePixelFormat {

}
//# sourceMappingURL=EnumImagePixelFormat.d.ts.map

@@ -5,2 +5,1 @@ export declare enum EnumImageTagType {

}
//# sourceMappingURL=EnumImageTagType.d.ts.map

@@ -32,2 +32,1 @@ export declare enum EnumIntermediateResultUnitType {

}
//# sourceMappingURL=EnumIntermediateResultUnitType.d.ts.map

@@ -12,2 +12,1 @@ export declare enum EnumPDFReadingMode {

}
//# sourceMappingURL=EnumPDFReadingMode.d.ts.map

@@ -6,2 +6,1 @@ export declare enum EnumRasterDataSource {

}
//# sourceMappingURL=EnumRasterDataSource.d.ts.map

@@ -12,2 +12,1 @@ export declare enum EnumRegionObjectElementType {

}
//# sourceMappingURL=EnumRegionObjectElementType.d.ts.map

@@ -11,2 +11,1 @@ export declare enum EnumSectionType {

}
//# sourceMappingURL=EnumSectionType.d.ts.map

@@ -5,2 +5,1 @@ export declare enum EnumTransformMatrixType {

}
//# sourceMappingURL=EnumTransformMatrixType.d.ts.map

@@ -15,2 +15,1 @@ export * from "./EnumBufferOverflowProtectionMode";

export * from "./EnumSectionType";
//# sourceMappingURL=index.d.ts.map

@@ -8,2 +8,1 @@ import ImageSourceAdapter from "./class/ImageSourceAdapter";

export { CoreModule, ImageSourceAdapter, };
//# sourceMappingURL=index.d.ts.map

@@ -8,2 +8,1 @@ export interface Arc {

}
//# sourceMappingURL=Arc.d.ts.map

@@ -6,2 +6,1 @@ import { DSImageData } from "./DSImageData";

}
//# sourceMappingURL=BinaryImageUnit.d.ts.map

@@ -10,2 +10,1 @@ import { CapturedResultItem } from "./CapturedResultItem";

}
//# sourceMappingURL=CapturedResult.d.ts.map

@@ -6,2 +6,1 @@ import { EnumCapturedResultItemType } from "../enum/EnumCapturedResultItemType";

}
//# sourceMappingURL=CapturedResultItem.d.ts.map

@@ -6,2 +6,1 @@ import { DSImageData } from "./DSImageData";

}
//# sourceMappingURL=ColourImageUnit.d.ts.map

@@ -5,2 +5,1 @@ import { Point } from "./Point";

}
//# sourceMappingURL=Contour.d.ts.map

@@ -6,2 +6,1 @@ import { Contour } from "./Contour";

}
//# sourceMappingURL=ContoursUnit.d.ts.map

@@ -10,2 +10,1 @@ import { EnumCornerType } from "../enum";

}
//# sourceMappingURL=Corner.d.ts.map
export interface DSFile extends File {
download: () => void;
}
//# sourceMappingURL=DSFile.d.ts.map

@@ -11,2 +11,1 @@ import { ImageTag } from "./ImageTag";

}
//# sourceMappingURL=DSImageData.d.ts.map

@@ -8,2 +8,1 @@ export interface DSRect {

}
//# sourceMappingURL=DSRect.d.ts.map

@@ -6,2 +6,1 @@ import { Corner } from "./Corner";

}
//# sourceMappingURL=Edge.d.ts.map

@@ -6,2 +6,1 @@ import { DSImageData } from "./DSImageData";

}
//# sourceMappingURL=EnhancedGrayscaleImageUnit.d.ts.map

@@ -7,2 +7,1 @@ import { ImageTag } from "./ImageTag";

}
//# sourceMappingURL=FileImageTag.d.ts.map

@@ -6,2 +6,1 @@ import { DSImageData } from "./DSImageData";

}
//# sourceMappingURL=GrayscaleImageUnit.d.ts.map

@@ -12,2 +12,1 @@ import { EnumErrorCode } from "../enum";

}
//# sourceMappingURL=ImageSourceErrorListener.d.ts.map

@@ -6,2 +6,1 @@ import { EnumImageTagType } from "../enum/EnumImageTagType";

}
//# sourceMappingURL=ImageTag.d.ts.map

@@ -40,2 +40,1 @@ export * from "./CapturedResult";

export * from "./TransformedGrayscaleImageUnit";
//# sourceMappingURL=index.d.ts.map

@@ -5,2 +5,1 @@ import { IntermediateResultUnit } from "./IntermediateResultUnit";

}
//# sourceMappingURL=IntermediateResult.d.ts.map

@@ -8,2 +8,1 @@ import { EnumSectionType } from "../enum";

}
//# sourceMappingURL=IntermediateResultExtraInfo.d.ts.map

@@ -15,2 +15,1 @@ import { EnumIntermediateResultUnitType } from "../enum/EnumIntermediateResultUnitType";

}
//# sourceMappingURL=IntermediateResultUnit.d.ts.map

@@ -6,2 +6,1 @@ import { Point } from "./Point";

}
//# sourceMappingURL=LineSegment.d.ts.map

@@ -6,2 +6,1 @@ import { IntermediateResultUnit } from "./IntermediateResultUnit";

}
//# sourceMappingURL=LineSegmentsUnit.d.ts.map

@@ -6,2 +6,1 @@ import { CapturedResultItem } from "./CapturedResultItem";

}
//# sourceMappingURL=OriginalImageResultItem.d.ts.map

@@ -7,2 +7,1 @@ import { EnumPDFReadingMode, EnumRasterDataSource } from "../enum";

}
//# sourceMappingURL=PDFReadingParameter.d.ts.map

@@ -5,2 +5,1 @@ export interface Point {

}
//# sourceMappingURL=Point.d.ts.map

@@ -5,2 +5,1 @@ import { Point } from "./Point";

}
//# sourceMappingURL=Polygon.d.ts.map

@@ -5,2 +5,1 @@ import { RegionObjectElement } from "./RegionObjectElement";

}
//# sourceMappingURL=PredetectedRegionElement.d.ts.map

@@ -6,2 +6,1 @@ import { IntermediateResultUnit } from "./IntermediateResultUnit";

}
//# sourceMappingURL=PredetectedRegionsUnit.d.ts.map

@@ -5,2 +5,1 @@ import { Point } from "./Point";

}
//# sourceMappingURL=Quadrilateral.d.ts.map

@@ -8,2 +8,1 @@ export interface Rect {

}
//# sourceMappingURL=Rect.d.ts.map

@@ -14,2 +14,1 @@ import { EnumRegionObjectElementType } from "../enum/EnumRegionObjectElementType";

}
//# sourceMappingURL=RegionObjectElement.d.ts.map

@@ -6,2 +6,1 @@ import { DSImageData } from "./DSImageData";

}
//# sourceMappingURL=ScaledDownColourImageUnit.d.ts.map

@@ -6,2 +6,1 @@ import { DSImageData } from "./DSImageData";

}
//# sourceMappingURL=TextRemovedBinaryImageUnit.d.ts.map

@@ -6,2 +6,1 @@ import { IntermediateResultUnit } from "./IntermediateResultUnit";

}
//# sourceMappingURL=TextureDetectionResultUnit.d.ts.map

@@ -6,2 +6,1 @@ import { DSImageData } from "./DSImageData";

}
//# sourceMappingURL=TextureRemovedBinaryImageUnit.d.ts.map

@@ -6,2 +6,1 @@ import { DSImageData } from "./DSImageData";

}
//# sourceMappingURL=TextureRemovedGrayscaleImageUnit.d.ts.map

@@ -6,2 +6,1 @@ import { IntermediateResultUnit } from "./IntermediateResultUnit";

}
//# sourceMappingURL=TextZonesUnit.d.ts.map

@@ -6,2 +6,1 @@ import { DSImageData } from "./DSImageData";

}
//# sourceMappingURL=TransformedGrayscaleImageUnit.d.ts.map

@@ -5,2 +5,1 @@ export interface Warning {

}
//# sourceMappingURL=Warning.d.ts.map

@@ -7,2 +7,1 @@ export * from "./TypeCheck";

export { bSupportBigInt };
//# sourceMappingURL=index.d.ts.map

@@ -78,2 +78,1 @@ import { Arc, Contour, DSImageData, DSRect, ImageTag, LineSegment, Point, Polygon, Quadrilateral, Rect } from "../interface";

export declare const isRect: (value: any) => value is Rect;
//# sourceMappingURL=TypeCheck.d.ts.map

@@ -0,1 +1,5 @@

===================================================================================
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> dynamsoft-core <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
===================================================================================
Legal Notices:

@@ -2,0 +6,0 @@

{
"name": "dynamsoft-core",
"version": "3.0.30",
"version": "3.0.31-beta-202401171755",
"description": "The Dynamsoft Core module builds the foundation upon which Dynamsoft SDKs implement their functionality.",

@@ -22,3 +22,3 @@ "homepage": "https://dynamsoft.com/capture-vision/docs/web/programming/javascript/?ver=latest",

"registry": "https://registry.npmjs.org/",
"tag": "latest"
"tag": "beta"
},

@@ -25,0 +25,0 @@ "author": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc