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

dynamsoft-core

Package Overview
Dependencies
Maintainers
0
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.4.21-beta-202410220132 to 3.4.21-beta-202411040411

2

dist/core.esm.js

@@ -11,2 +11,2 @@ /*!

*/
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",_[_.IPF_BINARY_8_INVERTED=15]="IPF_BINARY_8_INVERTED"}(I||(I={}));const r="undefined"==typeof self,s=(()=>{if(!r&&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"./"})(),n=_=>{if(null==_&&(_="./"),r);else{let E=document.createElement("a");E.href=_,_=E.href}return _.endsWith("/")||(_+="/"),_},C=_=>Object.prototype.toString.call(_),i=_=>Array.isArray?Array.isArray(_):"[object Array]"===C(_),o=_=>"[object Boolean]"===C(_),A=_=>"number"==typeof _&&!Number.isNaN(_),N=_=>null!==_&&"object"==typeof _&&!Array.isArray(_),a=_=>!!N(_)&&(!!A(_.x)&&(!!A(_.y)&&(!!A(_.radius)&&(!(_.radius<0)&&(!!A(_.startAngle)&&!!A(_.endAngle)))))),T=_=>!!N(_)&&(!!i(_.points)&&(0!=_.points.length&&!_.points.some((_=>!c(_))))),R=_=>!!N(_)&&(_.bytes instanceof Uint8Array&&(!!A(_.width)&&(!(_.width<=0)&&(!!A(_.height)&&(!(_.height<=0)&&(!!A(_.stride)&&(!(_.stride<=0)&&("format"in _&&!("tag"in _&&!D(_.tag)))))))))),L=_=>!!N(_)&&(!!A(_.left)&&(!(_.left<0)&&(!!A(_.top)&&(!(_.top<0)&&(!!A(_.right)&&(!(_.right<0)&&(!!A(_.bottom)&&(!(_.bottom<0)&&(!(_.left>=_.right)&&(!(_.top>=_.bottom)&&!!o(_.isMeasuredInPercentage))))))))))),D=_=>!!N(_)&&(!!A(_.imageId)&&"type"in _),O=_=>!!N(_)&&(!!c(_.startPoint)&&(!!c(_.endPoint)&&(_.startPoint.x!=_.endPoint.x||_.startPoint.y!=_.endPoint.y))),c=_=>!!N(_)&&(!!A(_.x)&&!!A(_.y)),S=_=>!!N(_)&&(!!i(_.points)&&(0!=_.points.length&&!_.points.some((_=>!c(_))))),l=_=>!!N(_)&&(!!i(_.points)&&(0!=_.points.length&&4==_.points.length&&!_.points.some((_=>!c(_))))),f=_=>!!N(_)&&(!!A(_.x)&&(!!A(_.y)&&(!!A(_.width)&&(!(_.width<0)&&(!!A(_.height)&&(!(_.height<0)&&!("isMeasuredInPercentage"in _&&!o(_.isMeasuredInPercentage))))))));async function h(_,E){return await new Promise(((e,t)=>{let I=new XMLHttpRequest;I.open("GET",_,!0),I.responseType=E,I.send(),I.onloadend=async()=>{I.status<200||I.status>=300?t(_+" "+I.status):e(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}}))}function d(_){return/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)|^[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/.test(_)}const P=(_,E)=>{let e=_.split("."),t=E.split(".");for(let _=0;_<e.length&&_<t.length;++_){let E=e[_],I=t[_];if(E===I)continue;let r=parseInt(e[_]),s=parseInt(t[_]);return r===s||Number.isNaN(r)&&Number.isNaN(s)?E<I?-1:1:r<s||Number.isNaN(r)&&Number.isInteger(s)?-1:1}return e.length===t.length?0:e.length<t.length?-1:1},g=(_,E)=>{const e={};for(let t in E){const I=t;let r=_[I];r&&"string"!=typeof r&&r.path&&(r=r.path),_.rootDirectory&&!_.rootDirectory.endsWith("/")&&(_.rootDirectory=_.rootDirectory+"/"),void 0===r?_.rootDirectory?r=`${_.rootDirectory}${M[I]}@${E[I].version}/dist/`:(r=E[I].path,r||(r=E[I])):r.startsWith("@engineRootDirectory/")&&(r=r.replace("@engineRootDirectory/",_.rootDirectory)),e[I]=n(r)}return e},M={std:"dynamsoft-capture-vision-std",dip:"dynamsoft-image-processing",core:"dynamsoft-core",dnn:"dynamsoft-capture-vision-dnn",license:"dynamsoft-license",utility:"dynamsoft-utility",cvr:"dynamsoft-capture-vision-router",dbr:"dynamsoft-barcode-reader",dlr:"dynamsoft-label-recognizer",ddn:"dynamsoft-document-normalizer",dcp:"dynamsoft-code-parser",dcpd:"dynamsoft-code-parser",dlrData:"dynamsoft-label-recognizer-data",dce:"dynamsoft-camera-enhancer"},u=async(_,E,e)=>await new Promise((async(t,I)=>{try{const I=E.split(".");let r=I[I.length-1];const s=await U(`image/${r}`,_);I.length<=1&&(r="png");const n=new File([s],E,{type:`image/${r}`});if(e){const _=URL.createObjectURL(n),e=document.createElement("a");e.href=_,e.download=E,e.click()}return t(n)}catch(_){return I()}})),F=_=>{R(_)&&(_=B(_));const E=document.createElement("canvas");E.width=_.width,E.height=_.height;return E.getContext("2d",{willReadFrequently:!0}).putImageData(_,0,0),E},G=(_,E)=>{R(E)&&(E=B(E));const e=F(E);let t=new Image,I=e.toDataURL(_);return t.src=I,t},U=async(_,E)=>{R(E)&&(E=B(E));const e=F(E);return new Promise(((E,t)=>{e.toBlob((_=>E(_)),_)}))},B=_=>{let E,e=_.bytes;if(!(e&&e instanceof Uint8Array))throw Error("Parameter type error");if(Number(_.format)===I.IPF_BGR_888){const _=e.length/3;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;++t)E[4*t]=e[3*t],E[4*t+1]=e[3*t+1],E[4*t+2]=e[3*t+2],E[4*t+3]=255}else if(Number(_.format)===I.IPF_RGB_888){const _=e.length/3;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;++t)E[4*t]=e[3*t+2],E[4*t+1]=e[3*t+1],E[4*t+2]=e[3*t],E[4*t+3]=255}else if(Number(_.format)===I.IPF_GRAYSCALED){const _=e.length;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;t++)E[4*t]=E[4*t+1]=E[4*t+2]=e[t],E[4*t+3]=255}else if(Number(_.format)===I.IPF_BINARY_8){const t=e.length,I=_.width,r=_.height,s=_.stride;E=new Uint8ClampedArray(I*r*4);for(let _=0;_<t;_++){let t=e[_],r=_%s,n=Math.floor(_/s);for(let _=0;_<8;_++){let e=r+_,s=4*(n*I+e);if(e>=I)break;E[s]=E[s+1]=E[s+2]=(128&t)/128*255,E[s+3]=255,t<<=1}}}else if(Number(_.format)===I.IPF_ABGR_8888){const _=e.length/4;E=new Uint8ClampedArray(e.length);for(let t=0;t<_;++t)E[4*t]=e[4*t],E[4*t+1]=e[4*t+1],E[4*t+2]=e[4*t+2],E[4*t+3]=e[4*t+3]}else if(Number(_.format)===I.IPF_ARGB_8888){const _=e.length/4;E=new Uint8ClampedArray(e.length);for(let t=0;t<_;++t)E[4*t]=e[4*t+2],E[4*t+1]=e[4*t+1],E[4*t+2]=e[4*t],E[4*t+3]=e[4*t+3]}return new ImageData(E,_.width,_.height)};var p,m,y,w,V,b,v,Y;class H{get _isFetchingStarted(){return _(this,V,"f")}constructor(){p.add(this),m.set(this,[]),y.set(this,1),w.set(this,e.BOPM_BLOCK),V.set(this,!1),b.set(this,void 0),v.set(this,t.CCUT_AUTO)}setErrorListener(_){}addImageToBuffer(E){var t;if(!R(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,m,"f").length>=_(this,y,"f"))switch(_(this,w,"f")){case e.BOPM_BLOCK:break;case e.BOPM_UPDATE:if(_(this,m,"f").push(E),N(_(this,b,"f"))&&A(_(this,b,"f").imageId)&&1==_(this,b,"f").keepInBuffer)for(;_(this,m,"f").length>_(this,y,"f");){const E=_(this,m,"f").findIndex((E=>{var e;return(null===(e=E.tag)||void 0===e?void 0:e.imageId)!==_(this,b,"f").imageId}));_(this,m,"f").splice(E,1)}else _(this,m,"f").splice(0,_(this,m,"f").length-_(this,y,"f"))}else _(this,m,"f").push(E)}getImage(){if(0===_(this,m,"f").length)return null;let E;if(_(this,b,"f")&&A(_(this,b,"f").imageId)){const e=_(this,p,"m",Y).call(this,_(this,b,"f").imageId);if(e<0)throw new Error(`Image with id ${_(this,b,"f").imageId} doesn't exist.`);E=_(this,m,"f").slice(e,e+1)[0]}else E=_(this,m,"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,v,"f")===t.CCUT_RGB_R_CHANNEL_ONLY){H._onLog&&H._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,v,"f")===t.CCUT_RGB_G_CHANNEL_ONLY){H._onLog&&H._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,v,"f")===t.CCUT_RGB_B_CHANNEL_ONLY){H._onLog&&H._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)&&H._onLog&&H._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&&!o(e))throw new TypeError("Invalid 'keepInBuffer'.");E(this,b,{imageId:_,keepInBuffer:e},"f")}_resetNextReturnedImage(){E(this,b,null,"f")}hasImage(E){return _(this,p,"m",Y).call(this,E)>=0}startFetching(){E(this,V,!0,"f")}stopFetching(){E(this,V,!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,y,e,"f");_(this,m,"f")&&_(this,m,"f").length>e;)_(this,m,"f").shift()}getMaxImageCount(){return _(this,y,"f")}getImageCount(){return _(this,m,"f").length}clearBuffer(){_(this,m,"f").length=0}isBufferEmpty(){return 0===_(this,m,"f").length}setBufferOverflowProtectionMode(_){E(this,w,_,"f")}getBufferOverflowProtectionMode(){return _(this,w,"f")}setColourChannelUsageType(_){E(this,v,_,"f")}getColourChannelUsageType(){return _(this,v,"f")}}m=new WeakMap,y=new WeakMap,w=new WeakMap,V=new WeakMap,b=new WeakMap,v=new WeakMap,p=new WeakSet,Y=function(E){if("number"!=typeof E)throw new TypeError("Invalid 'imageId'.");return _(this,m,"f").findIndex((_=>{var e;return(null===(e=_.tag)||void 0===e?void 0:e.imageId)===E}))};const k=_=>_&&"object"==typeof _&&"function"==typeof _.then;class X extends Promise{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=_,k(_)?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}constructor(_){let E,e;super(((_,t)=>{E=_,e=t})),this._s="pending",this.resolve=_=>{this.isPending&&(k(_)?this.task=_:(this._s="fulfilled",E(_)))},this.reject=_=>{this.isPending&&(this._s="rejected",e(_))},this.task=_}}let Z,W,x,K,j;"undefined"!=typeof navigator&&(Z=navigator,W=Z.userAgent,x=Z.platform,K=Z.mediaDevices),function(){if(!r){const _={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:Z.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:x,search:"Win"},Mac:{str:x},Linux:{str:x}};let e="unknownBrowser",t=0,I="unknownOS";for(let E in _){const I=_[E]||{};let r=I.str||W,s=I.search||E,n=I.verStr||W,C=I.verSearch||E;if(C instanceof Array||(C=[C]),-1!=r.indexOf(s)){e=E;for(let _ of C){let E=n.indexOf(_);if(-1!=E){t=parseFloat(n.substring(E+_.length+1));break}}break}}for(let _ in E){const e=E[_]||{};let t=e.str||W,r=e.search||_;if(-1!=t.indexOf(r)){I=_;break}}"Linux"==I&&-1!=W.indexOf("Windows NT")&&(I="HarmonyOS"),j={browser:e,version:t,OS:I}}r&&(j={browser:"ssr",version:0,OS:"ssr"})}();const J="undefined"!=typeof WebAssembly&&W&&!(/Safari/.test(W)&&!/Chrome/.test(W)&&/\(.+\s11_2_([2-6]).*\)/.test(W)),Q=!("undefined"==typeof Worker),$=!(!K||!K.getUserMedia),z=async()=>{let _=!1;if($)try{(await K.getUserMedia({video:!0})).getTracks().forEach((_=>{_.stop()})),_=!0}catch(_){}return _};"Chrome"===j.browser&&j.version>66||"Safari"===j.browser&&j.version>13||"OPR"===j.browser&&j.version>43||"Edge"===j.browser&&j.version;const q={},__=async _=>{let E="string"==typeof _?[_]:_,e=[];for(let _ of E)e.push(q[_]=q[_]||new X);await Promise.all(e)},E_=async(_,E)=>{let e,t="string"==typeof _?[_]:_,I=[];for(let _ of t){let t;I.push(t=q[_]=q[_]||new X(e=e||E())),t.isEmpty&&(t.task=e=e||E())}await Promise.all(I)};let e_,t_=0;const I_=()=>t_++,r_={};let s_;const n_=_=>{s_=_,e_&&e_.postMessage({type:"setBLog",body:{value:!!_}})};let C_=!1;const i_=_=>{C_=_,e_&&e_.postMessage({type:"setBDebug",body:{value:!!_}})},o_={},A_={},N_={std:{version:"1.4.10",path:n(s+"../../dynamsoft-capture-vision-std@1.4.10/dist/")},core:{version:"3.4.21-beta-202410220132",path:s}},a_={dip:{wasm:!0}},T_={},R_=async _=>{let E;_ instanceof Array||(_=_?[_]:[]);let e=q.core;E=!e||e.isEmpty;let t=new Map;const I=_=>{if("std"==(_=_.toLowerCase())||"core"==_)return;if(!a_[_])throw Error("The '"+_+"' module cannot be found.");let E=a_[_].deps;if(null==E?void 0:E.length)for(let _ of E)I(_);let e=q[_];t.has(_)||t.set(_,!e||e.isEmpty)};for(let E of _)I(E);let r=[];E&&r.push("core"),r.push(...t.keys());const s=[...t.entries()].filter((_=>!_[1])).map((_=>_[0]));await E_(r,(async()=>{const _=[...t.entries()].filter((_=>_[1])).map((_=>_[0]));await __(s);const e=g(T_,N_),I={};for(let E of _)I[E]=a_[E];const r={engineResourcePaths:e,autoResources:I,names:_};let n=new X;if(E){r.needLoadCore=!0;let _=e.core+L_._workerName;_.startsWith(location.origin)||(_=await fetch(_).then((_=>_.blob())).then((_=>URL.createObjectURL(_)))),e_=new Worker(_),e_.onerror=_=>{let E=new Error(_.message);n.reject(E)},e_.addEventListener("message",(_=>{let E=_.data?_.data:_,e=E.type,t=E.id,I=E.body;switch(e){case"log":s_&&s_(E.message);break;case"task":try{r_[t](I),delete r_[t]}catch(_){throw delete r_[t],_}break;case"event":try{r_[t](I)}catch(_){throw _}break;default:console.log(_)}})),r.bLog=!!s_,r.bd=C_,r.dm=location.origin.startsWith("http")?location.origin:"https://localhost"}else await __("core");let C=t_++;r_[C]=_=>{if(_.success)Object.assign(o_,_.versions),"{}"!==JSON.stringify(_.versions)&&(L_._versions=_.versions),n.resolve(void 0);else{const E=Error(_.message);_.stack&&(E.stack=_.stack),n.reject(E)}},e_.postMessage({type:"loadWasm",body:r,id:C}),await n}))};class L_{static get engineResourcePaths(){return T_}static set engineResourcePaths(_){Object.assign(T_,_)}static get bSupportDce4Module(){return this._bSupportDce4Module}static get bSupportIRTModule(){return this._bSupportIRTModule}static get versions(){return this._versions}static get _onLog(){return s_}static set _onLog(_){n_(_)}static get _bDebug(){return C_}static set _bDebug(_){i_(_)}static isModuleLoaded(_){return _=(_=_||"core").toLowerCase(),!!q[_]&&q[_].isFulfilled}static async loadWasm(_){return await R_(_)}static async detectEnvironment(){return await(async()=>({wasm:J,worker:Q,getUserMedia:$,camera:await z(),browser:j.browser,version:j.version,OS:j.OS}))()}static async getModuleVersion(){return await new Promise(((_,E)=>{let e=I_();r_[e]=async e=>{if(e.success)return _(e.versions);{let _=new Error(e.message);return _.stack=e.stack+"\n"+_.stack,E(_)}},e_.postMessage({type:"getModuleVersion",id:e})}))}static getVersion(){const _=o_.core&&o_.core.worker,E=o_.core&&o_.core.wasm;return`3.4.21-beta-202410220132(Worker: ${_||"Not Loaded"}, Wasm: ${E||"Not Loaded"})`}static enableLogging(){H._onLog=console.log,L_._onLog=console.log}static disableLogging(){H._onLog=null,L_._onLog=null}static async cfd(_){return await new Promise(((E,e)=>{let t=I_();r_[t]=async _=>{if(_.success)return E();{let E=new Error(_.message);return E.stack=_.stack+"\n"+E.stack,e(E)}},e_.postMessage({type:"cfd",id:t,body:{count:_}})}))}}var D_,O_,c_,S_,l_,f_,h_,d_;L_._bSupportDce4Module=-1,L_._bSupportIRTModule=-1,L_._versions=null,L_._workerName="core.worker.js",L_.browserInfo=j,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"}(D_||(D_={})),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"}(O_||(O_={})),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_IMGAE_DATA_INVALID=-10069]="EC_IMGAE_DATA_INVALID",_[_.EC_IMAGE_SIZE_NOT_MATCH=-10070]="EC_IMAGE_SIZE_NOT_MATCH",_[_.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH=-10071]="EC_IMAGE_PIXEL_FORMAT_NOT_MATCH",_[_.EC_SECTION_LEVEL_RESULT_IRREPLACEABLE=-10072]="EC_SECTION_LEVEL_RESULT_IRREPLACEABLE",_[_.EC_AXIS_DEFINITION_INCORRECT=-10073]="EC_AXIS_DEFINITION_INCORRECT",_[_.EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE=-10074]="EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE",_[_.EC_PDF_LIBRARY_LOAD_FAILED=-10075]="EC_PDF_LIBRARY_LOAD_FAILED",_[_.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_LICENSE_INIT_SEQUENCE_FAILED=-20009]="EC_LICENSE_INIT_SEQUENCE_FAILED",_[_.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",_[_.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",_[_.EC_LICENSE_CACHE_USED=-20012]="EC_LICENSE_CACHE_USED",_[_.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_TEXT_LINE_GROUP_LAYOUT_CONFLICT=-40101]="EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT",_[_.EC_TEXT_LINE_GROUP_REGEX_CONFLICT=-40102]="EC_TEXT_LINE_GROUP_REGEX_CONFLICT",_[_.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",_[_.EC_LICENSE_WARNING=-10076]="EC_LICENSE_WARNING",_[_.EC_BARCODE_READER_LICENSE_NOT_FOUND=-30063]="EC_BARCODE_READER_LICENSE_NOT_FOUND",_[_.EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND=-40103]="EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND",_[_.EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND=-50058]="EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND",_[_.EC_CODE_PARSER_LICENSE_NOT_FOUND=-90012]="EC_CODE_PARSER_LICENSE_NOT_FOUND"}(c_||(c_={})),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"}(S_||(S_={})),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"}(l_||(l_={})),function(_){_[_.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",_[_.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME"}(f_||(f_={})),function(_){_[_.PDFRM_VECTOR=1]="PDFRM_VECTOR",_[_.PDFRM_RASTER=2]="PDFRM_RASTER",_[_.PDFRM_REV=-2147483648]="PDFRM_REV"}(h_||(h_={})),function(_){_[_.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",_[_.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES"}(d_||(d_={}));const P_={IRUT_NULL:BigInt(0),IRUT_COLOUR_IMAGE:BigInt(1),IRUT_SCALED_DOWN_COLOUR_IMAGE:BigInt(2),IRUT_GRAYSCALE_IMAGE:BigInt(4),IRUT_TRANSOFORMED_GRAYSCALE_IMAGE:BigInt(8),IRUT_ENHANCED_GRAYSCALE_IMAGE:BigInt(16),IRUT_PREDETECTED_REGIONS:BigInt(32),IRUT_BINARY_IMAGE:BigInt(64),IRUT_TEXTURE_DETECTION_RESULT:BigInt(128),IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE:BigInt(256),IRUT_TEXTURE_REMOVED_BINARY_IMAGE:BigInt(512),IRUT_CONTOURS:BigInt(1024),IRUT_LINE_SEGMENTS:BigInt(2048),IRUT_TEXT_ZONES:BigInt(4096),IRUT_TEXT_REMOVED_BINARY_IMAGE:BigInt(8192),IRUT_CANDIDATE_BARCODE_ZONES:BigInt(16384),IRUT_LOCALIZED_BARCODES:BigInt(32768),IRUT_SCALED_UP_BARCODE_IMAGE:BigInt(65536),IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE:BigInt(1<<17),IRUT_COMPLEMENTED_BARCODE_IMAGE:BigInt(1<<18),IRUT_DECODED_BARCODES:BigInt(1<<19),IRUT_LONG_LINES:BigInt(1<<20),IRUT_CORNERS:BigInt(1<<21),IRUT_CANDIDATE_QUAD_EDGES:BigInt(1<<22),IRUT_DETECTED_QUADS:BigInt(1<<23),IRUT_LOCALIZED_TEXT_LINES:BigInt(1<<24),IRUT_RECOGNIZED_TEXT_LINES:BigInt(1<<25),IRUT_NORMALIZED_IMAGES:BigInt(1<<26),IRUT_SHORT_LINES:BigInt(1<<27),IRUT_RAW_TEXT_LINES:BigInt(1<<28),IRUT_ALL:BigInt("0xFFFFFFFFFFFFFFFF")};var g_,M_;!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"}(g_||(g_={})),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{L_ as CoreModule,e as EnumBufferOverflowProtectionMode,D_ as EnumCapturedResultItemType,t as EnumColourChannelUsageType,O_ as EnumCornerType,c_ as EnumErrorCode,S_ as EnumGrayscaleEnhancementMode,l_ as EnumGrayscaleTransformationMode,I as EnumImagePixelFormat,f_ as EnumImageTagType,P_ as EnumIntermediateResultUnitType,h_ as EnumPDFReadingMode,d_ as EnumRasterDataSource,g_ as EnumRegionObjectElementType,M_ as EnumSectionType,H as ImageSourceAdapter,B as _getNorImageData,a as _isArc,T as _isContour,R as _isDSImageData,L as _isDSRect,D as _isImageTag,O as _isLineSegment,c as _isPoint,S as _isPolygon,l as _isQuad,f as _isRect,u as _saveToFile,U as _toBlob,F as _toCanvas,G as _toImage,N_ as autoDiscoveryPaths,C_ as bDebug,d as checkIsLink,P as compareVersion,E_ as doOrWaitAsyncDependency,I_ as getNextTaskID,g as handleEngineResourcePaths,o_ as innerVersions,a as isArc,T as isContour,R as isDSImageData,L as isDSRect,D as isImageTag,O as isLineSegment,N as isObject,c as isPoint,S as isPolygon,l as isQuad,f as isRect,R_ as loadWasm,q as mapAsyncDependency,A_ as mapPackageRegister,r_ as mapTaskCallBack,s_ as onLog,h as requestResource,i_ as setBDebug,n_ as setOnLog,__ as waitAsyncDependency,e_ as worker,a_ 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",_[_.IPF_BINARY_8_INVERTED=15]="IPF_BINARY_8_INVERTED"}(I||(I={}));const r="undefined"==typeof self,s=(()=>{if(!r&&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"./"})(),n=_=>{if(null==_&&(_="./"),r);else{let E=document.createElement("a");E.href=_,_=E.href}return _.endsWith("/")||(_+="/"),_},C=_=>Object.prototype.toString.call(_),i=_=>Array.isArray?Array.isArray(_):"[object Array]"===C(_),o=_=>"[object Boolean]"===C(_),A=_=>"number"==typeof _&&!Number.isNaN(_),N=_=>null!==_&&"object"==typeof _&&!Array.isArray(_),a=_=>!!N(_)&&(!!A(_.x)&&(!!A(_.y)&&(!!A(_.radius)&&(!(_.radius<0)&&(!!A(_.startAngle)&&!!A(_.endAngle)))))),T=_=>!!N(_)&&(!!i(_.points)&&(0!=_.points.length&&!_.points.some((_=>!c(_))))),R=_=>!!N(_)&&(_.bytes instanceof Uint8Array&&(!!A(_.width)&&(!(_.width<=0)&&(!!A(_.height)&&(!(_.height<=0)&&(!!A(_.stride)&&(!(_.stride<=0)&&("format"in _&&!("tag"in _&&!D(_.tag)))))))))),L=_=>!!N(_)&&(!!A(_.left)&&(!(_.left<0)&&(!!A(_.top)&&(!(_.top<0)&&(!!A(_.right)&&(!(_.right<0)&&(!!A(_.bottom)&&(!(_.bottom<0)&&(!(_.left>=_.right)&&(!(_.top>=_.bottom)&&!!o(_.isMeasuredInPercentage))))))))))),D=_=>!!N(_)&&(!!A(_.imageId)&&"type"in _),O=_=>!!N(_)&&(!!c(_.startPoint)&&(!!c(_.endPoint)&&(_.startPoint.x!=_.endPoint.x||_.startPoint.y!=_.endPoint.y))),c=_=>!!N(_)&&(!!A(_.x)&&!!A(_.y)),S=_=>!!N(_)&&(!!i(_.points)&&(0!=_.points.length&&!_.points.some((_=>!c(_))))),l=_=>!!N(_)&&(!!i(_.points)&&(0!=_.points.length&&4==_.points.length&&!_.points.some((_=>!c(_))))),f=_=>!!N(_)&&(!!A(_.x)&&(!!A(_.y)&&(!!A(_.width)&&(!(_.width<0)&&(!!A(_.height)&&(!(_.height<0)&&!("isMeasuredInPercentage"in _&&!o(_.isMeasuredInPercentage))))))));async function h(_,E){return await new Promise(((e,t)=>{let I=new XMLHttpRequest;I.open("GET",_,!0),I.responseType=E,I.send(),I.onloadend=async()=>{I.status<200||I.status>=300?t(_+" "+I.status):e(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}}))}function d(_){return/^(https:\/\/www\.|http:\/\/www\.|https:\/\/|http:\/\/)|^[a-zA-Z0-9]{2,}(\.[a-zA-Z0-9]{2,})(\.[a-zA-Z0-9]{2,})?/.test(_)}const P=(_,E)=>{let e=_.split("."),t=E.split(".");for(let _=0;_<e.length&&_<t.length;++_){let E=e[_],I=t[_];if(E===I)continue;let r=parseInt(e[_]),s=parseInt(t[_]);return r===s||Number.isNaN(r)&&Number.isNaN(s)?E<I?-1:1:r<s||Number.isNaN(r)&&Number.isInteger(s)?-1:1}return e.length===t.length?0:e.length<t.length?-1:1},g=(_,E)=>{const e={};for(let t in E){const I=t;let r=_[I];r&&"string"!=typeof r&&r.path&&(r=r.path),_.rootDirectory&&!_.rootDirectory.endsWith("/")&&(_.rootDirectory=_.rootDirectory+"/"),void 0===r?_.rootDirectory?r=`${_.rootDirectory}${M[I]}@${E[I].version}/dist/`:(r=E[I].path,r||(r=E[I])):r.startsWith("@engineRootDirectory/")&&(r=r.replace("@engineRootDirectory/",_.rootDirectory)),e[I]=n(r)}return e},M={std:"dynamsoft-capture-vision-std",dip:"dynamsoft-image-processing",core:"dynamsoft-core",dnn:"dynamsoft-capture-vision-dnn",license:"dynamsoft-license",utility:"dynamsoft-utility",cvr:"dynamsoft-capture-vision-router",dbr:"dynamsoft-barcode-reader",dlr:"dynamsoft-label-recognizer",ddn:"dynamsoft-document-normalizer",dcp:"dynamsoft-code-parser",dcpd:"dynamsoft-code-parser",dlrData:"dynamsoft-label-recognizer-data",dce:"dynamsoft-camera-enhancer"},u=async(_,E,e)=>await new Promise((async(t,I)=>{try{const I=E.split(".");let r=I[I.length-1];const s=await U(`image/${r}`,_);I.length<=1&&(r="png");const n=new File([s],E,{type:`image/${r}`});if(e){const _=URL.createObjectURL(n),e=document.createElement("a");e.href=_,e.download=E,e.click()}return t(n)}catch(_){return I()}})),F=_=>{R(_)&&(_=B(_));const E=document.createElement("canvas");E.width=_.width,E.height=_.height;return E.getContext("2d",{willReadFrequently:!0}).putImageData(_,0,0),E},G=(_,E)=>{R(E)&&(E=B(E));const e=F(E);let t=new Image,I=e.toDataURL(_);return t.src=I,t},U=async(_,E)=>{R(E)&&(E=B(E));const e=F(E);return new Promise(((E,t)=>{e.toBlob((_=>E(_)),_)}))},B=_=>{let E,e=_.bytes;if(!(e&&e instanceof Uint8Array))throw Error("Parameter type error");if(Number(_.format)===I.IPF_BGR_888){const _=e.length/3;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;++t)E[4*t]=e[3*t],E[4*t+1]=e[3*t+1],E[4*t+2]=e[3*t+2],E[4*t+3]=255}else if(Number(_.format)===I.IPF_RGB_888){const _=e.length/3;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;++t)E[4*t]=e[3*t+2],E[4*t+1]=e[3*t+1],E[4*t+2]=e[3*t],E[4*t+3]=255}else if(Number(_.format)===I.IPF_GRAYSCALED){const _=e.length;E=new Uint8ClampedArray(4*_);for(let t=0;t<_;t++)E[4*t]=E[4*t+1]=E[4*t+2]=e[t],E[4*t+3]=255}else if(Number(_.format)===I.IPF_BINARY_8){const t=e.length,I=_.width,r=_.height,s=_.stride;E=new Uint8ClampedArray(I*r*4);for(let _=0;_<t;_++){let t=e[_],r=_%s,n=Math.floor(_/s);for(let _=0;_<8;_++){let e=r+_,s=4*(n*I+e);if(e>=I)break;E[s]=E[s+1]=E[s+2]=(128&t)/128*255,E[s+3]=255,t<<=1}}}else if(Number(_.format)===I.IPF_ABGR_8888){const _=e.length/4;E=new Uint8ClampedArray(e.length);for(let t=0;t<_;++t)E[4*t]=e[4*t],E[4*t+1]=e[4*t+1],E[4*t+2]=e[4*t+2],E[4*t+3]=e[4*t+3]}else if(Number(_.format)===I.IPF_ARGB_8888){const _=e.length/4;E=new Uint8ClampedArray(e.length);for(let t=0;t<_;++t)E[4*t]=e[4*t+2],E[4*t+1]=e[4*t+1],E[4*t+2]=e[4*t],E[4*t+3]=e[4*t+3]}return new ImageData(E,_.width,_.height)};var p,m,y,w,V,b,v,Y;class H{get _isFetchingStarted(){return _(this,V,"f")}constructor(){p.add(this),m.set(this,[]),y.set(this,1),w.set(this,e.BOPM_BLOCK),V.set(this,!1),b.set(this,void 0),v.set(this,t.CCUT_AUTO)}setErrorListener(_){}addImageToBuffer(E){var t;if(!R(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,m,"f").length>=_(this,y,"f"))switch(_(this,w,"f")){case e.BOPM_BLOCK:break;case e.BOPM_UPDATE:if(_(this,m,"f").push(E),N(_(this,b,"f"))&&A(_(this,b,"f").imageId)&&1==_(this,b,"f").keepInBuffer)for(;_(this,m,"f").length>_(this,y,"f");){const E=_(this,m,"f").findIndex((E=>{var e;return(null===(e=E.tag)||void 0===e?void 0:e.imageId)!==_(this,b,"f").imageId}));_(this,m,"f").splice(E,1)}else _(this,m,"f").splice(0,_(this,m,"f").length-_(this,y,"f"))}else _(this,m,"f").push(E)}getImage(){if(0===_(this,m,"f").length)return null;let E;if(_(this,b,"f")&&A(_(this,b,"f").imageId)){const e=_(this,p,"m",Y).call(this,_(this,b,"f").imageId);if(e<0)throw new Error(`Image with id ${_(this,b,"f").imageId} doesn't exist.`);E=_(this,m,"f").slice(e,e+1)[0]}else E=_(this,m,"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,v,"f")===t.CCUT_RGB_R_CHANNEL_ONLY){H._onLog&&H._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,v,"f")===t.CCUT_RGB_G_CHANNEL_ONLY){H._onLog&&H._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,v,"f")===t.CCUT_RGB_B_CHANNEL_ONLY){H._onLog&&H._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)&&H._onLog&&H._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&&!o(e))throw new TypeError("Invalid 'keepInBuffer'.");E(this,b,{imageId:_,keepInBuffer:e},"f")}_resetNextReturnedImage(){E(this,b,null,"f")}hasImage(E){return _(this,p,"m",Y).call(this,E)>=0}startFetching(){E(this,V,!0,"f")}stopFetching(){E(this,V,!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,y,e,"f");_(this,m,"f")&&_(this,m,"f").length>e;)_(this,m,"f").shift()}getMaxImageCount(){return _(this,y,"f")}getImageCount(){return _(this,m,"f").length}clearBuffer(){_(this,m,"f").length=0}isBufferEmpty(){return 0===_(this,m,"f").length}setBufferOverflowProtectionMode(_){E(this,w,_,"f")}getBufferOverflowProtectionMode(){return _(this,w,"f")}setColourChannelUsageType(_){E(this,v,_,"f")}getColourChannelUsageType(){return _(this,v,"f")}}m=new WeakMap,y=new WeakMap,w=new WeakMap,V=new WeakMap,b=new WeakMap,v=new WeakMap,p=new WeakSet,Y=function(E){if("number"!=typeof E)throw new TypeError("Invalid 'imageId'.");return _(this,m,"f").findIndex((_=>{var e;return(null===(e=_.tag)||void 0===e?void 0:e.imageId)===E}))};const k=_=>_&&"object"==typeof _&&"function"==typeof _.then;class X extends Promise{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=_,k(_)?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}constructor(_){let E,e;super(((_,t)=>{E=_,e=t})),this._s="pending",this.resolve=_=>{this.isPending&&(k(_)?this.task=_:(this._s="fulfilled",E(_)))},this.reject=_=>{this.isPending&&(this._s="rejected",e(_))},this.task=_}}let Z,W,x,K,j;"undefined"!=typeof navigator&&(Z=navigator,W=Z.userAgent,x=Z.platform,K=Z.mediaDevices),function(){if(!r){const _={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:Z.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:x,search:"Win"},Mac:{str:x},Linux:{str:x}};let e="unknownBrowser",t=0,I="unknownOS";for(let E in _){const I=_[E]||{};let r=I.str||W,s=I.search||E,n=I.verStr||W,C=I.verSearch||E;if(C instanceof Array||(C=[C]),-1!=r.indexOf(s)){e=E;for(let _ of C){let E=n.indexOf(_);if(-1!=E){t=parseFloat(n.substring(E+_.length+1));break}}break}}for(let _ in E){const e=E[_]||{};let t=e.str||W,r=e.search||_;if(-1!=t.indexOf(r)){I=_;break}}"Linux"==I&&-1!=W.indexOf("Windows NT")&&(I="HarmonyOS"),j={browser:e,version:t,OS:I}}r&&(j={browser:"ssr",version:0,OS:"ssr"})}();const J="undefined"!=typeof WebAssembly&&W&&!(/Safari/.test(W)&&!/Chrome/.test(W)&&/\(.+\s11_2_([2-6]).*\)/.test(W)),Q=!("undefined"==typeof Worker),$=!(!K||!K.getUserMedia),z=async()=>{let _=!1;if($)try{(await K.getUserMedia({video:!0})).getTracks().forEach((_=>{_.stop()})),_=!0}catch(_){}return _};"Chrome"===j.browser&&j.version>66||"Safari"===j.browser&&j.version>13||"OPR"===j.browser&&j.version>43||"Edge"===j.browser&&j.version;const q={},__=async _=>{let E="string"==typeof _?[_]:_,e=[];for(let _ of E)e.push(q[_]=q[_]||new X);await Promise.all(e)},E_=async(_,E)=>{let e,t="string"==typeof _?[_]:_,I=[];for(let _ of t){let t;I.push(t=q[_]=q[_]||new X(e=e||E())),t.isEmpty&&(t.task=e=e||E())}await Promise.all(I)};let e_,t_=0;const I_=()=>t_++,r_={};let s_;const n_=_=>{s_=_,e_&&e_.postMessage({type:"setBLog",body:{value:!!_}})};let C_=!1;const i_=_=>{C_=_,e_&&e_.postMessage({type:"setBDebug",body:{value:!!_}})},o_={},A_={},N_={std:{version:"1.4.10",path:n(s+"../../dynamsoft-capture-vision-std@1.4.10/dist/")},core:{version:"3.4.21-beta-202411040411",path:s}},a_={dip:{wasm:!0}},T_={},R_=async _=>{let E;_ instanceof Array||(_=_?[_]:[]);let e=q.core;E=!e||e.isEmpty;let t=new Map;const I=_=>{if("std"==(_=_.toLowerCase())||"core"==_)return;if(!a_[_])throw Error("The '"+_+"' module cannot be found.");let E=a_[_].deps;if(null==E?void 0:E.length)for(let _ of E)I(_);let e=q[_];t.has(_)||t.set(_,!e||e.isEmpty)};for(let E of _)I(E);let r=[];E&&r.push("core"),r.push(...t.keys());const s=[...t.entries()].filter((_=>!_[1])).map((_=>_[0]));await E_(r,(async()=>{const _=[...t.entries()].filter((_=>_[1])).map((_=>_[0]));await __(s);const e=g(T_,N_),I={};for(let E of _)I[E]=a_[E];const r={engineResourcePaths:e,autoResources:I,names:_};let n=new X;if(E){r.needLoadCore=!0;let _=e.core+L_._workerName;_.startsWith(location.origin)||(_=await fetch(_).then((_=>_.blob())).then((_=>URL.createObjectURL(_)))),e_=new Worker(_),e_.onerror=_=>{let E=new Error(_.message);n.reject(E)},e_.addEventListener("message",(_=>{let E=_.data?_.data:_,e=E.type,t=E.id,I=E.body;switch(e){case"log":s_&&s_(E.message);break;case"task":try{r_[t](I),delete r_[t]}catch(_){throw delete r_[t],_}break;case"event":try{r_[t](I)}catch(_){throw _}break;default:console.log(_)}})),r.bLog=!!s_,r.bd=C_,r.dm=location.origin.startsWith("http")?location.origin:"https://localhost"}else await __("core");let C=t_++;r_[C]=_=>{if(_.success)Object.assign(o_,_.versions),"{}"!==JSON.stringify(_.versions)&&(L_._versions=_.versions),n.resolve(void 0);else{const E=Error(_.message);_.stack&&(E.stack=_.stack),n.reject(E)}},e_.postMessage({type:"loadWasm",body:r,id:C}),await n}))};class L_{static get engineResourcePaths(){return T_}static set engineResourcePaths(_){Object.assign(T_,_)}static get bSupportDce4Module(){return this._bSupportDce4Module}static get bSupportIRTModule(){return this._bSupportIRTModule}static get versions(){return this._versions}static get _onLog(){return s_}static set _onLog(_){n_(_)}static get _bDebug(){return C_}static set _bDebug(_){i_(_)}static isModuleLoaded(_){return _=(_=_||"core").toLowerCase(),!!q[_]&&q[_].isFulfilled}static async loadWasm(_){return await R_(_)}static async detectEnvironment(){return await(async()=>({wasm:J,worker:Q,getUserMedia:$,camera:await z(),browser:j.browser,version:j.version,OS:j.OS}))()}static async getModuleVersion(){return await new Promise(((_,E)=>{let e=I_();r_[e]=async e=>{if(e.success)return _(e.versions);{let _=new Error(e.message);return _.stack=e.stack+"\n"+_.stack,E(_)}},e_.postMessage({type:"getModuleVersion",id:e})}))}static getVersion(){const _=o_.core&&o_.core.worker,E=o_.core&&o_.core.wasm;return`3.4.21-beta-202411040411(Worker: ${_||"Not Loaded"}, Wasm: ${E||"Not Loaded"})`}static enableLogging(){H._onLog=console.log,L_._onLog=console.log}static disableLogging(){H._onLog=null,L_._onLog=null}static async cfd(_){return await new Promise(((E,e)=>{let t=I_();r_[t]=async _=>{if(_.success)return E();{let E=new Error(_.message);return E.stack=_.stack+"\n"+E.stack,e(E)}},e_.postMessage({type:"cfd",id:t,body:{count:_}})}))}}var D_,O_,c_,S_,l_,f_,h_,d_;L_._bSupportDce4Module=-1,L_._bSupportIRTModule=-1,L_._versions=null,L_._workerName="core.worker.js",L_.browserInfo=j,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"}(D_||(D_={})),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"}(O_||(O_={})),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_IMGAE_DATA_INVALID=-10069]="EC_IMGAE_DATA_INVALID",_[_.EC_IMAGE_SIZE_NOT_MATCH=-10070]="EC_IMAGE_SIZE_NOT_MATCH",_[_.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH=-10071]="EC_IMAGE_PIXEL_FORMAT_NOT_MATCH",_[_.EC_SECTION_LEVEL_RESULT_IRREPLACEABLE=-10072]="EC_SECTION_LEVEL_RESULT_IRREPLACEABLE",_[_.EC_AXIS_DEFINITION_INCORRECT=-10073]="EC_AXIS_DEFINITION_INCORRECT",_[_.EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE=-10074]="EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE",_[_.EC_PDF_LIBRARY_LOAD_FAILED=-10075]="EC_PDF_LIBRARY_LOAD_FAILED",_[_.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_LICENSE_INIT_SEQUENCE_FAILED=-20009]="EC_LICENSE_INIT_SEQUENCE_FAILED",_[_.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",_[_.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",_[_.EC_LICENSE_CACHE_USED=-20012]="EC_LICENSE_CACHE_USED",_[_.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_TEXT_LINE_GROUP_LAYOUT_CONFLICT=-40101]="EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT",_[_.EC_TEXT_LINE_GROUP_REGEX_CONFLICT=-40102]="EC_TEXT_LINE_GROUP_REGEX_CONFLICT",_[_.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",_[_.EC_LICENSE_WARNING=-10076]="EC_LICENSE_WARNING",_[_.EC_BARCODE_READER_LICENSE_NOT_FOUND=-30063]="EC_BARCODE_READER_LICENSE_NOT_FOUND",_[_.EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND=-40103]="EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND",_[_.EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND=-50058]="EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND",_[_.EC_CODE_PARSER_LICENSE_NOT_FOUND=-90012]="EC_CODE_PARSER_LICENSE_NOT_FOUND"}(c_||(c_={})),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"}(S_||(S_={})),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"}(l_||(l_={})),function(_){_[_.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",_[_.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME"}(f_||(f_={})),function(_){_[_.PDFRM_VECTOR=1]="PDFRM_VECTOR",_[_.PDFRM_RASTER=2]="PDFRM_RASTER",_[_.PDFRM_REV=-2147483648]="PDFRM_REV"}(h_||(h_={})),function(_){_[_.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",_[_.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES"}(d_||(d_={}));const P_={IRUT_NULL:BigInt(0),IRUT_COLOUR_IMAGE:BigInt(1),IRUT_SCALED_DOWN_COLOUR_IMAGE:BigInt(2),IRUT_GRAYSCALE_IMAGE:BigInt(4),IRUT_TRANSOFORMED_GRAYSCALE_IMAGE:BigInt(8),IRUT_ENHANCED_GRAYSCALE_IMAGE:BigInt(16),IRUT_PREDETECTED_REGIONS:BigInt(32),IRUT_BINARY_IMAGE:BigInt(64),IRUT_TEXTURE_DETECTION_RESULT:BigInt(128),IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE:BigInt(256),IRUT_TEXTURE_REMOVED_BINARY_IMAGE:BigInt(512),IRUT_CONTOURS:BigInt(1024),IRUT_LINE_SEGMENTS:BigInt(2048),IRUT_TEXT_ZONES:BigInt(4096),IRUT_TEXT_REMOVED_BINARY_IMAGE:BigInt(8192),IRUT_CANDIDATE_BARCODE_ZONES:BigInt(16384),IRUT_LOCALIZED_BARCODES:BigInt(32768),IRUT_SCALED_UP_BARCODE_IMAGE:BigInt(65536),IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE:BigInt(1<<17),IRUT_COMPLEMENTED_BARCODE_IMAGE:BigInt(1<<18),IRUT_DECODED_BARCODES:BigInt(1<<19),IRUT_LONG_LINES:BigInt(1<<20),IRUT_CORNERS:BigInt(1<<21),IRUT_CANDIDATE_QUAD_EDGES:BigInt(1<<22),IRUT_DETECTED_QUADS:BigInt(1<<23),IRUT_LOCALIZED_TEXT_LINES:BigInt(1<<24),IRUT_RECOGNIZED_TEXT_LINES:BigInt(1<<25),IRUT_NORMALIZED_IMAGES:BigInt(1<<26),IRUT_SHORT_LINES:BigInt(1<<27),IRUT_RAW_TEXT_LINES:BigInt(1<<28),IRUT_ALL:BigInt("0xFFFFFFFFFFFFFFFF")};var g_,M_;!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"}(g_||(g_={})),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{L_ as CoreModule,e as EnumBufferOverflowProtectionMode,D_ as EnumCapturedResultItemType,t as EnumColourChannelUsageType,O_ as EnumCornerType,c_ as EnumErrorCode,S_ as EnumGrayscaleEnhancementMode,l_ as EnumGrayscaleTransformationMode,I as EnumImagePixelFormat,f_ as EnumImageTagType,P_ as EnumIntermediateResultUnitType,h_ as EnumPDFReadingMode,d_ as EnumRasterDataSource,g_ as EnumRegionObjectElementType,M_ as EnumSectionType,H as ImageSourceAdapter,B as _getNorImageData,a as _isArc,T as _isContour,R as _isDSImageData,L as _isDSRect,D as _isImageTag,O as _isLineSegment,c as _isPoint,S as _isPolygon,l as _isQuad,f as _isRect,u as _saveToFile,U as _toBlob,F as _toCanvas,G as _toImage,N_ as autoDiscoveryPaths,C_ as bDebug,d as checkIsLink,P as compareVersion,E_ as doOrWaitAsyncDependency,I_ as getNextTaskID,g as handleEngineResourcePaths,o_ as innerVersions,a as isArc,T as isContour,R as isDSImageData,L as isDSRect,D as isImageTag,O as isLineSegment,N as isObject,c as isPoint,S as isPolygon,l as isQuad,f as isRect,R_ as loadWasm,q as mapAsyncDependency,A_ as mapPackageRegister,r_ as mapTaskCallBack,s_ as onLog,h as requestResource,i_ as setBDebug,n_ as setOnLog,__ as waitAsyncDependency,e_ as worker,a_ as workerAutoResources};

@@ -11,2 +11,2 @@ /*!

*/
!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",r[r.IPF_BINARY_8_INVERTED=15]="IPF_BINARY_8_INVERTED";const n="undefined"==typeof self,o=(()=>{if(!n&&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"./"})(),a=e=>{if(null==e&&(e="./"),n);else{let E=document.createElement("a");E.href=e,e=E.href}return e.endsWith("/")||(e+="/"),e},s=e=>Object.prototype.toString.call(e),i=e=>Array.isArray?Array.isArray(e):"[object Array]"===s(e),C=e=>"[object Boolean]"===s(e),A=e=>"number"==typeof e&&!Number.isNaN(e),T=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),N=e=>!!T(e)&&(!!A(e.x)&&(!!A(e.y)&&(!!A(e.radius)&&(!(e.radius<0)&&(!!A(e.startAngle)&&!!A(e.endAngle)))))),R=e=>!!T(e)&&(!!i(e.points)&&(0!=e.points.length&&!e.points.some((e=>!m(e))))),L=e=>!!T(e)&&(e.bytes instanceof Uint8Array&&(!!A(e.width)&&(!(e.width<=0)&&(!!A(e.height)&&(!(e.height<=0)&&(!!A(e.stride)&&(!(e.stride<=0)&&("format"in e&&!("tag"in e&&!O(e.tag)))))))))),D=e=>!!T(e)&&(!!A(e.left)&&(!(e.left<0)&&(!!A(e.top)&&(!(e.top<0)&&(!!A(e.right)&&(!(e.right<0)&&(!!A(e.bottom)&&(!(e.bottom<0)&&(!(e.left>=e.right)&&(!(e.top>=e.bottom)&&!!C(e.isMeasuredInPercentage))))))))))),O=e=>!!T(e)&&(!!A(e.imageId)&&"type"in e),l=e=>!!T(e)&&(!!m(e.startPoint)&&(!!m(e.endPoint)&&(e.startPoint.x!=e.endPoint.x||e.startPoint.y!=e.endPoint.y))),m=e=>!!T(e)&&(!!A(e.x)&&!!A(e.y)),c=e=>!!T(e)&&(!!i(e.points)&&(0!=e.points.length&&!e.points.some((e=>!m(e))))),u=e=>!!T(e)&&(!!i(e.points)&&(0!=e.points.length&&4==e.points.length&&!e.points.some((e=>!m(e))))),g=e=>!!T(e)&&(!!A(e.x)&&(!!A(e.y)&&(!!A(e.width)&&(!(e.width<0)&&(!!A(e.height)&&(!(e.height<0)&&!("isMeasuredInPercentage"in e&&!C(e.isMeasuredInPercentage))))))));const S=(e,E)=>{const _={};for(let t in E){const I=t;let r=e[I];r&&"string"!=typeof r&&r.path&&(r=r.path),e.rootDirectory&&!e.rootDirectory.endsWith("/")&&(e.rootDirectory=e.rootDirectory+"/"),void 0===r?e.rootDirectory?r=`${e.rootDirectory}${P[I]}@${E[I].version}/dist/`:(r=E[I].path,r||(r=E[I])):r.startsWith("@engineRootDirectory/")&&(r=r.replace("@engineRootDirectory/",e.rootDirectory)),_[I]=a(r)}return _},P={std:"dynamsoft-capture-vision-std",dip:"dynamsoft-image-processing",core:"dynamsoft-core",dnn:"dynamsoft-capture-vision-dnn",license:"dynamsoft-license",utility:"dynamsoft-utility",cvr:"dynamsoft-capture-vision-router",dbr:"dynamsoft-barcode-reader",dlr:"dynamsoft-label-recognizer",ddn:"dynamsoft-document-normalizer",dcp:"dynamsoft-code-parser",dcpd:"dynamsoft-code-parser",dlrData:"dynamsoft-label-recognizer-data",dce:"dynamsoft-camera-enhancer"},d=e=>{L(e)&&(e=F(e));const E=document.createElement("canvas");E.width=e.width,E.height=e.height;return E.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),E},f=async(e,E)=>{L(E)&&(E=F(E));const _=d(E);return new Promise(((E,t)=>{_.toBlob((e=>E(e)),e)}))},F=E=>{let _,t=E.bytes;if(!(t&&t instanceof Uint8Array))throw Error("Parameter type error");if(Number(E.format)===e.EnumImagePixelFormat.IPF_BGR_888){const e=t.length/3;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;++E)_[4*E]=t[3*E],_[4*E+1]=t[3*E+1],_[4*E+2]=t[3*E+2],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_RGB_888){const e=t.length/3;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;++E)_[4*E]=t[3*E+2],_[4*E+1]=t[3*E+1],_[4*E+2]=t[3*E],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_GRAYSCALED){const e=t.length;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;E++)_[4*E]=_[4*E+1]=_[4*E+2]=t[E],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_BINARY_8){const e=t.length,I=E.width,r=E.height,n=E.stride;_=new Uint8ClampedArray(I*r*4);for(let E=0;E<e;E++){let e=t[E],r=E%n,o=Math.floor(E/n);for(let E=0;E<8;E++){let t=r+E,n=4*(o*I+t);if(t>=I)break;_[n]=_[n+1]=_[n+2]=(128&e)/128*255,_[n+3]=255,e<<=1}}}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_ABGR_8888){const e=t.length/4;_=new Uint8ClampedArray(t.length);for(let E=0;E<e;++E)_[4*E]=t[4*E],_[4*E+1]=t[4*E+1],_[4*E+2]=t[4*E+2],_[4*E+3]=t[4*E+3]}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_ARGB_8888){const e=t.length/4;_=new Uint8ClampedArray(t.length);for(let E=0;E<e;++E)_[4*E]=t[4*E+2],_[4*E+1]=t[4*E+1],_[4*E+2]=t[4*E],_[4*E+3]=t[4*E+3]}return new ImageData(_,E.width,E.height)};var h,M,G,U,p,y,B,w;class V{get _isFetchingStarted(){return E(this,p,"f")}constructor(){h.add(this),M.set(this,[]),G.set(this,1),U.set(this,e.EnumBufferOverflowProtectionMode.BOPM_BLOCK),p.set(this,!1),y.set(this,void 0),B.set(this,e.EnumColourChannelUsageType.CCUT_AUTO)}setErrorListener(e){}addImageToBuffer(_){var t;if(!L(_))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,M,"f").length>=E(this,G,"f"))switch(E(this,U,"f")){case e.EnumBufferOverflowProtectionMode.BOPM_BLOCK:break;case e.EnumBufferOverflowProtectionMode.BOPM_UPDATE:if(E(this,M,"f").push(_),T(E(this,y,"f"))&&A(E(this,y,"f").imageId)&&1==E(this,y,"f").keepInBuffer)for(;E(this,M,"f").length>E(this,G,"f");){const e=E(this,M,"f").findIndex((e=>{var _;return(null===(_=e.tag)||void 0===_?void 0:_.imageId)!==E(this,y,"f").imageId}));E(this,M,"f").splice(e,1)}else E(this,M,"f").splice(0,E(this,M,"f").length-E(this,G,"f"))}else E(this,M,"f").push(_)}getImage(){if(0===E(this,M,"f").length)return null;let _;if(E(this,y,"f")&&A(E(this,y,"f").imageId)){const e=E(this,h,"m",w).call(this,E(this,y,"f").imageId);if(e<0)throw new Error(`Image with id ${E(this,y,"f").imageId} doesn't exist.`);_=E(this,M,"f").slice(e,e+1)[0]}else _=E(this,M,"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,B,"f")===e.EnumColourChannelUsageType.CCUT_RGB_R_CHANNEL_ONLY){V._onLog&&V._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,B,"f")===e.EnumColourChannelUsageType.CCUT_RGB_G_CHANNEL_ONLY){V._onLog&&V._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,B,"f")===e.EnumColourChannelUsageType.CCUT_RGB_B_CHANNEL_ONLY){V._onLog&&V._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)&&V._onLog&&V._onLog("NV21 or NV12 is not supported.");return _}setNextImageToReturn(e,E){if(!((...e)=>0!==e.length&&e.every((e=>A(e))))(e))throw new TypeError("Invalid 'imageId'.");if(void 0!==E&&!C(E))throw new TypeError("Invalid 'keepInBuffer'.");_(this,y,{imageId:e,keepInBuffer:E},"f")}_resetNextReturnedImage(){_(this,y,null,"f")}hasImage(e){return E(this,h,"m",w).call(this,e)>=0}startFetching(){_(this,p,!0,"f")}stopFetching(){_(this,p,!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,G,e,"f");E(this,M,"f")&&E(this,M,"f").length>e;)E(this,M,"f").shift()}getMaxImageCount(){return E(this,G,"f")}getImageCount(){return E(this,M,"f").length}clearBuffer(){E(this,M,"f").length=0}isBufferEmpty(){return 0===E(this,M,"f").length}setBufferOverflowProtectionMode(e){_(this,U,e,"f")}getBufferOverflowProtectionMode(){return E(this,U,"f")}setColourChannelUsageType(e){_(this,B,e,"f")}getColourChannelUsageType(){return E(this,B,"f")}}M=new WeakMap,G=new WeakMap,U=new WeakMap,p=new WeakMap,y=new WeakMap,B=new WeakMap,h=new WeakSet,w=function(e){if("number"!=typeof e)throw new TypeError("Invalid 'imageId'.");return E(this,M,"f").findIndex((E=>{var _;return(null===(_=E.tag)||void 0===_?void 0:_.imageId)===e}))};const b=e=>e&&"object"==typeof e&&"function"==typeof e.then;class v extends Promise{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}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}}let x,k,Y,H,X;"undefined"!=typeof navigator&&(x=navigator,k=x.userAgent,Y=x.platform,H=x.mediaDevices),function(){if(!n){const e={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:x.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 _="unknownBrowser",t=0,I="unknownOS";for(let E in e){const I=e[E]||{};let r=I.str||k,n=I.search||E,o=I.verStr||k,a=I.verSearch||E;if(a instanceof Array||(a=[a]),-1!=r.indexOf(n)){_=E;for(let e of a){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||k,r=_.search||e;if(-1!=t.indexOf(r)){I=e;break}}"Linux"==I&&-1!=k.indexOf("Windows NT")&&(I="HarmonyOS"),X={browser:_,version:t,OS:I}}n&&(X={browser:"ssr",version:0,OS:"ssr"})}();const Z="undefined"!=typeof WebAssembly&&k&&!(/Safari/.test(k)&&!/Chrome/.test(k)&&/\(.+\s11_2_([2-6]).*\)/.test(k)),W=!("undefined"==typeof Worker),j=!(!H||!H.getUserMedia),K=async()=>{let e=!1;if(j)try{(await H.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e=!0}catch(e){}return e};"Chrome"===X.browser&&X.version>66||"Safari"===X.browser&&X.version>13||"OPR"===X.browser&&X.version>43||"Edge"===X.browser&&X.version;const Q={},J=async e=>{let E="string"==typeof e?[e]:e,_=[];for(let e of E)_.push(Q[e]=Q[e]||new v);await Promise.all(_)},$=async(e,E)=>{let _,t="string"==typeof e?[e]:e,I=[];for(let e of t){let t;I.push(t=Q[e]=Q[e]||new v(_=_||E())),t.isEmpty&&(t.task=_=_||E())}await Promise.all(I)};e.worker=void 0;let z=0;const q=()=>z++,ee={};e.onLog=void 0;const Ee=E=>{e.onLog=E,e.worker&&e.worker.postMessage({type:"setBLog",body:{value:!!E}})};e.bDebug=!1;const _e=E=>{e.bDebug=E,e.worker&&e.worker.postMessage({type:"setBDebug",body:{value:!!E}})},te={},Ie={std:{version:"1.4.10",path:a(o+"../../dynamsoft-capture-vision-std@1.4.10/dist/")},core:{version:"3.4.21-beta-202410220132",path:o}},re={dip:{wasm:!0}},ne={},oe=async E=>{let _;E instanceof Array||(E=E?[E]:[]);let t=Q.core;_=!t||t.isEmpty;let I=new Map;const r=e=>{if("std"==(e=e.toLowerCase())||"core"==e)return;if(!re[e])throw Error("The '"+e+"' module cannot be found.");let E=re[e].deps;if(null==E?void 0:E.length)for(let e of E)r(e);let _=Q[e];I.has(e)||I.set(e,!_||_.isEmpty)};for(let e of E)r(e);let n=[];_&&n.push("core"),n.push(...I.keys());const o=[...I.entries()].filter((e=>!e[1])).map((e=>e[0]));await $(n,(async()=>{const E=[...I.entries()].filter((e=>e[1])).map((e=>e[0]));await J(o);const t=S(ne,Ie),r={};for(let e of E)r[e]=re[e];const n={engineResourcePaths:t,autoResources:r,names:E};let a=new v;if(_){n.needLoadCore=!0;let E=t.core+ae._workerName;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);a.reject(E)},e.worker.addEventListener("message",(E=>{let _=E.data?E.data:E,t=_.type,I=_.id,r=_.body;switch(t){case"log":e.onLog&&e.onLog(_.message);break;case"task":try{ee[I](r),delete ee[I]}catch(e){throw delete ee[I],e}break;case"event":try{ee[I](r)}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"}else await J("core");let s=z++;ee[s]=e=>{if(e.success)Object.assign(te,e.versions),"{}"!==JSON.stringify(e.versions)&&(ae._versions=e.versions),a.resolve(void 0);else{const E=Error(e.message);e.stack&&(E.stack=e.stack),a.reject(E)}},e.worker.postMessage({type:"loadWasm",body:n,id:s}),await a}))};class ae{static get engineResourcePaths(){return ne}static set engineResourcePaths(e){Object.assign(ne,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){Ee(e)}static get _bDebug(){return e.bDebug}static set _bDebug(e){_e(e)}static isModuleLoaded(e){return e=(e=e||"core").toLowerCase(),!!Q[e]&&Q[e].isFulfilled}static async loadWasm(e){return await oe(e)}static async detectEnvironment(){return await(async()=>({wasm:Z,worker:W,getUserMedia:j,camera:await K(),browser:X.browser,version:X.version,OS:X.OS}))()}static async getModuleVersion(){return await new Promise(((E,_)=>{let t=q();ee[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=te.core&&te.core.worker,E=te.core&&te.core.wasm;return`3.4.21-beta-202410220132(Worker: ${e||"Not Loaded"}, Wasm: ${E||"Not Loaded"})`}static enableLogging(){V._onLog=console.log,ae._onLog=console.log}static disableLogging(){V._onLog=null,ae._onLog=null}static async cfd(E){return await new Promise(((_,t)=>{let I=q();ee[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 se,ie,Ce,Ae,Te,Ne,Re,Le;ae._bSupportDce4Module=-1,ae._bSupportIRTModule=-1,ae._versions=null,ae._workerName="core.worker.js",ae.browserInfo=X,e.EnumCapturedResultItemType=void 0,(se=e.EnumCapturedResultItemType||(e.EnumCapturedResultItemType={}))[se.CRIT_ORIGINAL_IMAGE=1]="CRIT_ORIGINAL_IMAGE",se[se.CRIT_BARCODE=2]="CRIT_BARCODE",se[se.CRIT_TEXT_LINE=4]="CRIT_TEXT_LINE",se[se.CRIT_DETECTED_QUAD=8]="CRIT_DETECTED_QUAD",se[se.CRIT_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",se[se.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT",e.EnumCornerType=void 0,(ie=e.EnumCornerType||(e.EnumCornerType={}))[ie.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",ie[ie.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",ie[ie.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",ie[ie.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED",e.EnumErrorCode=void 0,(Ce=e.EnumErrorCode||(e.EnumErrorCode={}))[Ce.EC_OK=0]="EC_OK",Ce[Ce.EC_UNKNOWN=-1e4]="EC_UNKNOWN",Ce[Ce.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",Ce[Ce.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",Ce[Ce.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",Ce[Ce.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",Ce[Ce.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",Ce[Ce.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",Ce[Ce.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",Ce[Ce.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",Ce[Ce.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",Ce[Ce.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",Ce[Ce.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",Ce[Ce.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",Ce[Ce.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",Ce[Ce.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",Ce[Ce.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",Ce[Ce.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",Ce[Ce.EC_TIMEOUT=-10026]="EC_TIMEOUT",Ce[Ce.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",Ce[Ce.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",Ce[Ce.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",Ce[Ce.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",Ce[Ce.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",Ce[Ce.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",Ce[Ce.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",Ce[Ce.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",Ce[Ce.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",Ce[Ce.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",Ce[Ce.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",Ce[Ce.EC_LICENSE_KEY_NOT_MATCH=-10043]="EC_LICENSE_KEY_NOT_MATCH",Ce[Ce.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",Ce[Ce.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",Ce[Ce.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",Ce[Ce.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",Ce[Ce.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",Ce[Ce.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",Ce[Ce.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",Ce[Ce.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",Ce[Ce.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",Ce[Ce.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",Ce[Ce.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",Ce[Ce.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",Ce[Ce.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",Ce[Ce.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",Ce[Ce.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",Ce[Ce.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",Ce[Ce.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",Ce[Ce.EC_FILE_ALREADY_EXISTS=-10067]="EC_FILE_ALREADY_EXISTS",Ce[Ce.EC_CREATE_FILE_FAILED=-10068]="EC_CREATE_FILE_FAILED",Ce[Ce.EC_IMGAE_DATA_INVALID=-10069]="EC_IMGAE_DATA_INVALID",Ce[Ce.EC_IMAGE_SIZE_NOT_MATCH=-10070]="EC_IMAGE_SIZE_NOT_MATCH",Ce[Ce.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH=-10071]="EC_IMAGE_PIXEL_FORMAT_NOT_MATCH",Ce[Ce.EC_SECTION_LEVEL_RESULT_IRREPLACEABLE=-10072]="EC_SECTION_LEVEL_RESULT_IRREPLACEABLE",Ce[Ce.EC_AXIS_DEFINITION_INCORRECT=-10073]="EC_AXIS_DEFINITION_INCORRECT",Ce[Ce.EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE=-10074]="EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE",Ce[Ce.EC_PDF_LIBRARY_LOAD_FAILED=-10075]="EC_PDF_LIBRARY_LOAD_FAILED",Ce[Ce.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",Ce[Ce.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",Ce[Ce.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",Ce[Ce.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",Ce[Ce.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",Ce[Ce.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",Ce[Ce.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",Ce[Ce.EC_LICENSE_INIT_SEQUENCE_FAILED=-20009]="EC_LICENSE_INIT_SEQUENCE_FAILED",Ce[Ce.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",Ce[Ce.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",Ce[Ce.EC_LICENSE_CACHE_USED=-20012]="EC_LICENSE_CACHE_USED",Ce[Ce.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",Ce[Ce.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",Ce[Ce.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",Ce[Ce.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",Ce[Ce.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",Ce[Ce.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",Ce[Ce.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",Ce[Ce.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",Ce[Ce.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",Ce[Ce.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",Ce[Ce.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",Ce[Ce.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",Ce[Ce.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",Ce[Ce.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",Ce[Ce.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",Ce[Ce.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",Ce[Ce.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",Ce[Ce.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",Ce[Ce.EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT=-40101]="EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT",Ce[Ce.EC_TEXT_LINE_GROUP_REGEX_CONFLICT=-40102]="EC_TEXT_LINE_GROUP_REGEX_CONFLICT",Ce[Ce.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",Ce[Ce.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",Ce[Ce.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",Ce[Ce.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",Ce[Ce.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",Ce[Ce.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",Ce[Ce.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",Ce[Ce.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",Ce[Ce.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",Ce[Ce.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",Ce[Ce.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",Ce[Ce.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",Ce[Ce.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID",Ce[Ce.EC_LICENSE_WARNING=-10076]="EC_LICENSE_WARNING",Ce[Ce.EC_BARCODE_READER_LICENSE_NOT_FOUND=-30063]="EC_BARCODE_READER_LICENSE_NOT_FOUND",Ce[Ce.EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND=-40103]="EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND",Ce[Ce.EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND=-50058]="EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND",Ce[Ce.EC_CODE_PARSER_LICENSE_NOT_FOUND=-90012]="EC_CODE_PARSER_LICENSE_NOT_FOUND",e.EnumGrayscaleEnhancementMode=void 0,(Ae=e.EnumGrayscaleEnhancementMode||(e.EnumGrayscaleEnhancementMode={}))[Ae.GEM_SKIP=0]="GEM_SKIP",Ae[Ae.GEM_AUTO=1]="GEM_AUTO",Ae[Ae.GEM_GENERAL=2]="GEM_GENERAL",Ae[Ae.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",Ae[Ae.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",Ae[Ae.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",Ae[Ae.GEM_REV=-2147483648]="GEM_REV",e.EnumGrayscaleTransformationMode=void 0,(Te=e.EnumGrayscaleTransformationMode||(e.EnumGrayscaleTransformationMode={}))[Te.GTM_SKIP=0]="GTM_SKIP",Te[Te.GTM_INVERTED=1]="GTM_INVERTED",Te[Te.GTM_ORIGINAL=2]="GTM_ORIGINAL",Te[Te.GTM_AUTO=4]="GTM_AUTO",Te[Te.GTM_REV=-2147483648]="GTM_REV",e.EnumImageTagType=void 0,(Ne=e.EnumImageTagType||(e.EnumImageTagType={}))[Ne.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",Ne[Ne.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME",e.EnumPDFReadingMode=void 0,(Re=e.EnumPDFReadingMode||(e.EnumPDFReadingMode={}))[Re.PDFRM_VECTOR=1]="PDFRM_VECTOR",Re[Re.PDFRM_RASTER=2]="PDFRM_RASTER",Re[Re.PDFRM_REV=-2147483648]="PDFRM_REV",e.EnumRasterDataSource=void 0,(Le=e.EnumRasterDataSource||(e.EnumRasterDataSource={}))[Le.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",Le[Le.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES";const De={IRUT_NULL:BigInt(0),IRUT_COLOUR_IMAGE:BigInt(1),IRUT_SCALED_DOWN_COLOUR_IMAGE:BigInt(2),IRUT_GRAYSCALE_IMAGE:BigInt(4),IRUT_TRANSOFORMED_GRAYSCALE_IMAGE:BigInt(8),IRUT_ENHANCED_GRAYSCALE_IMAGE:BigInt(16),IRUT_PREDETECTED_REGIONS:BigInt(32),IRUT_BINARY_IMAGE:BigInt(64),IRUT_TEXTURE_DETECTION_RESULT:BigInt(128),IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE:BigInt(256),IRUT_TEXTURE_REMOVED_BINARY_IMAGE:BigInt(512),IRUT_CONTOURS:BigInt(1024),IRUT_LINE_SEGMENTS:BigInt(2048),IRUT_TEXT_ZONES:BigInt(4096),IRUT_TEXT_REMOVED_BINARY_IMAGE:BigInt(8192),IRUT_CANDIDATE_BARCODE_ZONES:BigInt(16384),IRUT_LOCALIZED_BARCODES:BigInt(32768),IRUT_SCALED_UP_BARCODE_IMAGE:BigInt(65536),IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE:BigInt(1<<17),IRUT_COMPLEMENTED_BARCODE_IMAGE:BigInt(1<<18),IRUT_DECODED_BARCODES:BigInt(1<<19),IRUT_LONG_LINES:BigInt(1<<20),IRUT_CORNERS:BigInt(1<<21),IRUT_CANDIDATE_QUAD_EDGES:BigInt(1<<22),IRUT_DETECTED_QUADS:BigInt(1<<23),IRUT_LOCALIZED_TEXT_LINES:BigInt(1<<24),IRUT_RECOGNIZED_TEXT_LINES:BigInt(1<<25),IRUT_NORMALIZED_IMAGES:BigInt(1<<26),IRUT_SHORT_LINES:BigInt(1<<27),IRUT_RAW_TEXT_LINES:BigInt(1<<28),IRUT_ALL:BigInt("0xFFFFFFFFFFFFFFFF")};var Oe,le;e.EnumRegionObjectElementType=void 0,(Oe=e.EnumRegionObjectElementType||(e.EnumRegionObjectElementType={}))[Oe.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",Oe[Oe.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",Oe[Oe.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",Oe[Oe.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",Oe[Oe.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",Oe[Oe.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",Oe[Oe.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE",Oe[Oe.ROET_SOURCE_IMAGE=7]="ROET_SOURCE_IMAGE",Oe[Oe.ROET_TARGET_ROI=8]="ROET_TARGET_ROI",e.EnumSectionType=void 0,(le=e.EnumSectionType||(e.EnumSectionType={}))[le.ST_NULL=0]="ST_NULL",le[le.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",le[le.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",le[le.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",le[le.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",le[le.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",le[le.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",le[le.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION",e.CoreModule=ae,e.EnumIntermediateResultUnitType=De,e.ImageSourceAdapter=V,e._getNorImageData=F,e._isArc=N,e._isContour=R,e._isDSImageData=L,e._isDSRect=D,e._isImageTag=O,e._isLineSegment=l,e._isPoint=m,e._isPolygon=c,e._isQuad=u,e._isRect=g,e._saveToFile=async(e,E,_)=>await new Promise((async(t,I)=>{try{const I=E.split(".");let r=I[I.length-1];const n=await f(`image/${r}`,e);I.length<=1&&(r="png");const o=new File([n],E,{type:`image/${r}`});if(_){const e=URL.createObjectURL(o),_=document.createElement("a");_.href=e,_.download=E,_.click()}return t(o)}catch(e){return I()}})),e._toBlob=f,e._toCanvas=d,e._toImage=(e,E)=>{L(E)&&(E=F(E));const _=d(E);let t=new Image,I=_.toDataURL(e);return t.src=I,t},e.autoDiscoveryPaths=Ie,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.doOrWaitAsyncDependency=$,e.getNextTaskID=q,e.handleEngineResourcePaths=S,e.innerVersions=te,e.isArc=N,e.isContour=R,e.isDSImageData=L,e.isDSRect=D,e.isImageTag=O,e.isLineSegment=l,e.isObject=T,e.isPoint=m,e.isPolygon=c,e.isQuad=u,e.isRect=g,e.loadWasm=oe,e.mapAsyncDependency=Q,e.mapPackageRegister={},e.mapTaskCallBack=ee,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.status<200||I.status>=300?t(e+" "+I.status):_(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}}))},e.setBDebug=_e,e.setOnLog=Ee,e.waitAsyncDependency=J,e.workerAutoResources=re}));
!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",r[r.IPF_BINARY_8_INVERTED=15]="IPF_BINARY_8_INVERTED";const n="undefined"==typeof self,o=(()=>{if(!n&&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"./"})(),a=e=>{if(null==e&&(e="./"),n);else{let E=document.createElement("a");E.href=e,e=E.href}return e.endsWith("/")||(e+="/"),e},s=e=>Object.prototype.toString.call(e),i=e=>Array.isArray?Array.isArray(e):"[object Array]"===s(e),C=e=>"[object Boolean]"===s(e),A=e=>"number"==typeof e&&!Number.isNaN(e),T=e=>null!==e&&"object"==typeof e&&!Array.isArray(e),N=e=>!!T(e)&&(!!A(e.x)&&(!!A(e.y)&&(!!A(e.radius)&&(!(e.radius<0)&&(!!A(e.startAngle)&&!!A(e.endAngle)))))),R=e=>!!T(e)&&(!!i(e.points)&&(0!=e.points.length&&!e.points.some((e=>!m(e))))),L=e=>!!T(e)&&(e.bytes instanceof Uint8Array&&(!!A(e.width)&&(!(e.width<=0)&&(!!A(e.height)&&(!(e.height<=0)&&(!!A(e.stride)&&(!(e.stride<=0)&&("format"in e&&!("tag"in e&&!O(e.tag)))))))))),D=e=>!!T(e)&&(!!A(e.left)&&(!(e.left<0)&&(!!A(e.top)&&(!(e.top<0)&&(!!A(e.right)&&(!(e.right<0)&&(!!A(e.bottom)&&(!(e.bottom<0)&&(!(e.left>=e.right)&&(!(e.top>=e.bottom)&&!!C(e.isMeasuredInPercentage))))))))))),O=e=>!!T(e)&&(!!A(e.imageId)&&"type"in e),l=e=>!!T(e)&&(!!m(e.startPoint)&&(!!m(e.endPoint)&&(e.startPoint.x!=e.endPoint.x||e.startPoint.y!=e.endPoint.y))),m=e=>!!T(e)&&(!!A(e.x)&&!!A(e.y)),c=e=>!!T(e)&&(!!i(e.points)&&(0!=e.points.length&&!e.points.some((e=>!m(e))))),u=e=>!!T(e)&&(!!i(e.points)&&(0!=e.points.length&&4==e.points.length&&!e.points.some((e=>!m(e))))),g=e=>!!T(e)&&(!!A(e.x)&&(!!A(e.y)&&(!!A(e.width)&&(!(e.width<0)&&(!!A(e.height)&&(!(e.height<0)&&!("isMeasuredInPercentage"in e&&!C(e.isMeasuredInPercentage))))))));const S=(e,E)=>{const _={};for(let t in E){const I=t;let r=e[I];r&&"string"!=typeof r&&r.path&&(r=r.path),e.rootDirectory&&!e.rootDirectory.endsWith("/")&&(e.rootDirectory=e.rootDirectory+"/"),void 0===r?e.rootDirectory?r=`${e.rootDirectory}${P[I]}@${E[I].version}/dist/`:(r=E[I].path,r||(r=E[I])):r.startsWith("@engineRootDirectory/")&&(r=r.replace("@engineRootDirectory/",e.rootDirectory)),_[I]=a(r)}return _},P={std:"dynamsoft-capture-vision-std",dip:"dynamsoft-image-processing",core:"dynamsoft-core",dnn:"dynamsoft-capture-vision-dnn",license:"dynamsoft-license",utility:"dynamsoft-utility",cvr:"dynamsoft-capture-vision-router",dbr:"dynamsoft-barcode-reader",dlr:"dynamsoft-label-recognizer",ddn:"dynamsoft-document-normalizer",dcp:"dynamsoft-code-parser",dcpd:"dynamsoft-code-parser",dlrData:"dynamsoft-label-recognizer-data",dce:"dynamsoft-camera-enhancer"},d=e=>{L(e)&&(e=F(e));const E=document.createElement("canvas");E.width=e.width,E.height=e.height;return E.getContext("2d",{willReadFrequently:!0}).putImageData(e,0,0),E},f=async(e,E)=>{L(E)&&(E=F(E));const _=d(E);return new Promise(((E,t)=>{_.toBlob((e=>E(e)),e)}))},F=E=>{let _,t=E.bytes;if(!(t&&t instanceof Uint8Array))throw Error("Parameter type error");if(Number(E.format)===e.EnumImagePixelFormat.IPF_BGR_888){const e=t.length/3;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;++E)_[4*E]=t[3*E],_[4*E+1]=t[3*E+1],_[4*E+2]=t[3*E+2],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_RGB_888){const e=t.length/3;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;++E)_[4*E]=t[3*E+2],_[4*E+1]=t[3*E+1],_[4*E+2]=t[3*E],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_GRAYSCALED){const e=t.length;_=new Uint8ClampedArray(4*e);for(let E=0;E<e;E++)_[4*E]=_[4*E+1]=_[4*E+2]=t[E],_[4*E+3]=255}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_BINARY_8){const e=t.length,I=E.width,r=E.height,n=E.stride;_=new Uint8ClampedArray(I*r*4);for(let E=0;E<e;E++){let e=t[E],r=E%n,o=Math.floor(E/n);for(let E=0;E<8;E++){let t=r+E,n=4*(o*I+t);if(t>=I)break;_[n]=_[n+1]=_[n+2]=(128&e)/128*255,_[n+3]=255,e<<=1}}}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_ABGR_8888){const e=t.length/4;_=new Uint8ClampedArray(t.length);for(let E=0;E<e;++E)_[4*E]=t[4*E],_[4*E+1]=t[4*E+1],_[4*E+2]=t[4*E+2],_[4*E+3]=t[4*E+3]}else if(Number(E.format)===e.EnumImagePixelFormat.IPF_ARGB_8888){const e=t.length/4;_=new Uint8ClampedArray(t.length);for(let E=0;E<e;++E)_[4*E]=t[4*E+2],_[4*E+1]=t[4*E+1],_[4*E+2]=t[4*E],_[4*E+3]=t[4*E+3]}return new ImageData(_,E.width,E.height)};var h,M,G,U,p,y,B,w;class V{get _isFetchingStarted(){return E(this,p,"f")}constructor(){h.add(this),M.set(this,[]),G.set(this,1),U.set(this,e.EnumBufferOverflowProtectionMode.BOPM_BLOCK),p.set(this,!1),y.set(this,void 0),B.set(this,e.EnumColourChannelUsageType.CCUT_AUTO)}setErrorListener(e){}addImageToBuffer(_){var t;if(!L(_))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,M,"f").length>=E(this,G,"f"))switch(E(this,U,"f")){case e.EnumBufferOverflowProtectionMode.BOPM_BLOCK:break;case e.EnumBufferOverflowProtectionMode.BOPM_UPDATE:if(E(this,M,"f").push(_),T(E(this,y,"f"))&&A(E(this,y,"f").imageId)&&1==E(this,y,"f").keepInBuffer)for(;E(this,M,"f").length>E(this,G,"f");){const e=E(this,M,"f").findIndex((e=>{var _;return(null===(_=e.tag)||void 0===_?void 0:_.imageId)!==E(this,y,"f").imageId}));E(this,M,"f").splice(e,1)}else E(this,M,"f").splice(0,E(this,M,"f").length-E(this,G,"f"))}else E(this,M,"f").push(_)}getImage(){if(0===E(this,M,"f").length)return null;let _;if(E(this,y,"f")&&A(E(this,y,"f").imageId)){const e=E(this,h,"m",w).call(this,E(this,y,"f").imageId);if(e<0)throw new Error(`Image with id ${E(this,y,"f").imageId} doesn't exist.`);_=E(this,M,"f").slice(e,e+1)[0]}else _=E(this,M,"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,B,"f")===e.EnumColourChannelUsageType.CCUT_RGB_R_CHANNEL_ONLY){V._onLog&&V._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,B,"f")===e.EnumColourChannelUsageType.CCUT_RGB_G_CHANNEL_ONLY){V._onLog&&V._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,B,"f")===e.EnumColourChannelUsageType.CCUT_RGB_B_CHANNEL_ONLY){V._onLog&&V._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)&&V._onLog&&V._onLog("NV21 or NV12 is not supported.");return _}setNextImageToReturn(e,E){if(!((...e)=>0!==e.length&&e.every((e=>A(e))))(e))throw new TypeError("Invalid 'imageId'.");if(void 0!==E&&!C(E))throw new TypeError("Invalid 'keepInBuffer'.");_(this,y,{imageId:e,keepInBuffer:E},"f")}_resetNextReturnedImage(){_(this,y,null,"f")}hasImage(e){return E(this,h,"m",w).call(this,e)>=0}startFetching(){_(this,p,!0,"f")}stopFetching(){_(this,p,!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,G,e,"f");E(this,M,"f")&&E(this,M,"f").length>e;)E(this,M,"f").shift()}getMaxImageCount(){return E(this,G,"f")}getImageCount(){return E(this,M,"f").length}clearBuffer(){E(this,M,"f").length=0}isBufferEmpty(){return 0===E(this,M,"f").length}setBufferOverflowProtectionMode(e){_(this,U,e,"f")}getBufferOverflowProtectionMode(){return E(this,U,"f")}setColourChannelUsageType(e){_(this,B,e,"f")}getColourChannelUsageType(){return E(this,B,"f")}}M=new WeakMap,G=new WeakMap,U=new WeakMap,p=new WeakMap,y=new WeakMap,B=new WeakMap,h=new WeakSet,w=function(e){if("number"!=typeof e)throw new TypeError("Invalid 'imageId'.");return E(this,M,"f").findIndex((E=>{var _;return(null===(_=E.tag)||void 0===_?void 0:_.imageId)===e}))};const b=e=>e&&"object"==typeof e&&"function"==typeof e.then;class v extends Promise{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}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}}let x,k,Y,H,X;"undefined"!=typeof navigator&&(x=navigator,k=x.userAgent,Y=x.platform,H=x.mediaDevices),function(){if(!n){const e={Edge:{search:"Edg",verSearch:"Edg"},OPR:null,Chrome:null,Safari:{str:x.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 _="unknownBrowser",t=0,I="unknownOS";for(let E in e){const I=e[E]||{};let r=I.str||k,n=I.search||E,o=I.verStr||k,a=I.verSearch||E;if(a instanceof Array||(a=[a]),-1!=r.indexOf(n)){_=E;for(let e of a){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||k,r=_.search||e;if(-1!=t.indexOf(r)){I=e;break}}"Linux"==I&&-1!=k.indexOf("Windows NT")&&(I="HarmonyOS"),X={browser:_,version:t,OS:I}}n&&(X={browser:"ssr",version:0,OS:"ssr"})}();const Z="undefined"!=typeof WebAssembly&&k&&!(/Safari/.test(k)&&!/Chrome/.test(k)&&/\(.+\s11_2_([2-6]).*\)/.test(k)),W=!("undefined"==typeof Worker),j=!(!H||!H.getUserMedia),K=async()=>{let e=!1;if(j)try{(await H.getUserMedia({video:!0})).getTracks().forEach((e=>{e.stop()})),e=!0}catch(e){}return e};"Chrome"===X.browser&&X.version>66||"Safari"===X.browser&&X.version>13||"OPR"===X.browser&&X.version>43||"Edge"===X.browser&&X.version;const Q={},J=async e=>{let E="string"==typeof e?[e]:e,_=[];for(let e of E)_.push(Q[e]=Q[e]||new v);await Promise.all(_)},$=async(e,E)=>{let _,t="string"==typeof e?[e]:e,I=[];for(let e of t){let t;I.push(t=Q[e]=Q[e]||new v(_=_||E())),t.isEmpty&&(t.task=_=_||E())}await Promise.all(I)};e.worker=void 0;let z=0;const q=()=>z++,ee={};e.onLog=void 0;const Ee=E=>{e.onLog=E,e.worker&&e.worker.postMessage({type:"setBLog",body:{value:!!E}})};e.bDebug=!1;const _e=E=>{e.bDebug=E,e.worker&&e.worker.postMessage({type:"setBDebug",body:{value:!!E}})},te={},Ie={std:{version:"1.4.10",path:a(o+"../../dynamsoft-capture-vision-std@1.4.10/dist/")},core:{version:"3.4.21-beta-202411040411",path:o}},re={dip:{wasm:!0}},ne={},oe=async E=>{let _;E instanceof Array||(E=E?[E]:[]);let t=Q.core;_=!t||t.isEmpty;let I=new Map;const r=e=>{if("std"==(e=e.toLowerCase())||"core"==e)return;if(!re[e])throw Error("The '"+e+"' module cannot be found.");let E=re[e].deps;if(null==E?void 0:E.length)for(let e of E)r(e);let _=Q[e];I.has(e)||I.set(e,!_||_.isEmpty)};for(let e of E)r(e);let n=[];_&&n.push("core"),n.push(...I.keys());const o=[...I.entries()].filter((e=>!e[1])).map((e=>e[0]));await $(n,(async()=>{const E=[...I.entries()].filter((e=>e[1])).map((e=>e[0]));await J(o);const t=S(ne,Ie),r={};for(let e of E)r[e]=re[e];const n={engineResourcePaths:t,autoResources:r,names:E};let a=new v;if(_){n.needLoadCore=!0;let E=t.core+ae._workerName;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);a.reject(E)},e.worker.addEventListener("message",(E=>{let _=E.data?E.data:E,t=_.type,I=_.id,r=_.body;switch(t){case"log":e.onLog&&e.onLog(_.message);break;case"task":try{ee[I](r),delete ee[I]}catch(e){throw delete ee[I],e}break;case"event":try{ee[I](r)}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"}else await J("core");let s=z++;ee[s]=e=>{if(e.success)Object.assign(te,e.versions),"{}"!==JSON.stringify(e.versions)&&(ae._versions=e.versions),a.resolve(void 0);else{const E=Error(e.message);e.stack&&(E.stack=e.stack),a.reject(E)}},e.worker.postMessage({type:"loadWasm",body:n,id:s}),await a}))};class ae{static get engineResourcePaths(){return ne}static set engineResourcePaths(e){Object.assign(ne,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){Ee(e)}static get _bDebug(){return e.bDebug}static set _bDebug(e){_e(e)}static isModuleLoaded(e){return e=(e=e||"core").toLowerCase(),!!Q[e]&&Q[e].isFulfilled}static async loadWasm(e){return await oe(e)}static async detectEnvironment(){return await(async()=>({wasm:Z,worker:W,getUserMedia:j,camera:await K(),browser:X.browser,version:X.version,OS:X.OS}))()}static async getModuleVersion(){return await new Promise(((E,_)=>{let t=q();ee[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=te.core&&te.core.worker,E=te.core&&te.core.wasm;return`3.4.21-beta-202411040411(Worker: ${e||"Not Loaded"}, Wasm: ${E||"Not Loaded"})`}static enableLogging(){V._onLog=console.log,ae._onLog=console.log}static disableLogging(){V._onLog=null,ae._onLog=null}static async cfd(E){return await new Promise(((_,t)=>{let I=q();ee[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 se,ie,Ce,Ae,Te,Ne,Re,Le;ae._bSupportDce4Module=-1,ae._bSupportIRTModule=-1,ae._versions=null,ae._workerName="core.worker.js",ae.browserInfo=X,e.EnumCapturedResultItemType=void 0,(se=e.EnumCapturedResultItemType||(e.EnumCapturedResultItemType={}))[se.CRIT_ORIGINAL_IMAGE=1]="CRIT_ORIGINAL_IMAGE",se[se.CRIT_BARCODE=2]="CRIT_BARCODE",se[se.CRIT_TEXT_LINE=4]="CRIT_TEXT_LINE",se[se.CRIT_DETECTED_QUAD=8]="CRIT_DETECTED_QUAD",se[se.CRIT_NORMALIZED_IMAGE=16]="CRIT_NORMALIZED_IMAGE",se[se.CRIT_PARSED_RESULT=32]="CRIT_PARSED_RESULT",e.EnumCornerType=void 0,(ie=e.EnumCornerType||(e.EnumCornerType={}))[ie.CT_NORMAL_INTERSECTED=0]="CT_NORMAL_INTERSECTED",ie[ie.CT_T_INTERSECTED=1]="CT_T_INTERSECTED",ie[ie.CT_CROSS_INTERSECTED=2]="CT_CROSS_INTERSECTED",ie[ie.CT_NOT_INTERSECTED=3]="CT_NOT_INTERSECTED",e.EnumErrorCode=void 0,(Ce=e.EnumErrorCode||(e.EnumErrorCode={}))[Ce.EC_OK=0]="EC_OK",Ce[Ce.EC_UNKNOWN=-1e4]="EC_UNKNOWN",Ce[Ce.EC_NO_MEMORY=-10001]="EC_NO_MEMORY",Ce[Ce.EC_NULL_POINTER=-10002]="EC_NULL_POINTER",Ce[Ce.EC_LICENSE_INVALID=-10003]="EC_LICENSE_INVALID",Ce[Ce.EC_LICENSE_EXPIRED=-10004]="EC_LICENSE_EXPIRED",Ce[Ce.EC_FILE_NOT_FOUND=-10005]="EC_FILE_NOT_FOUND",Ce[Ce.EC_FILE_TYPE_NOT_SUPPORTED=-10006]="EC_FILE_TYPE_NOT_SUPPORTED",Ce[Ce.EC_BPP_NOT_SUPPORTED=-10007]="EC_BPP_NOT_SUPPORTED",Ce[Ce.EC_INDEX_INVALID=-10008]="EC_INDEX_INVALID",Ce[Ce.EC_CUSTOM_REGION_INVALID=-10010]="EC_CUSTOM_REGION_INVALID",Ce[Ce.EC_IMAGE_READ_FAILED=-10012]="EC_IMAGE_READ_FAILED",Ce[Ce.EC_TIFF_READ_FAILED=-10013]="EC_TIFF_READ_FAILED",Ce[Ce.EC_DIB_BUFFER_INVALID=-10018]="EC_DIB_BUFFER_INVALID",Ce[Ce.EC_PDF_READ_FAILED=-10021]="EC_PDF_READ_FAILED",Ce[Ce.EC_PDF_DLL_MISSING=-10022]="EC_PDF_DLL_MISSING",Ce[Ce.EC_PAGE_NUMBER_INVALID=-10023]="EC_PAGE_NUMBER_INVALID",Ce[Ce.EC_CUSTOM_SIZE_INVALID=-10024]="EC_CUSTOM_SIZE_INVALID",Ce[Ce.EC_TIMEOUT=-10026]="EC_TIMEOUT",Ce[Ce.EC_JSON_PARSE_FAILED=-10030]="EC_JSON_PARSE_FAILED",Ce[Ce.EC_JSON_TYPE_INVALID=-10031]="EC_JSON_TYPE_INVALID",Ce[Ce.EC_JSON_KEY_INVALID=-10032]="EC_JSON_KEY_INVALID",Ce[Ce.EC_JSON_VALUE_INVALID=-10033]="EC_JSON_VALUE_INVALID",Ce[Ce.EC_JSON_NAME_KEY_MISSING=-10034]="EC_JSON_NAME_KEY_MISSING",Ce[Ce.EC_JSON_NAME_VALUE_DUPLICATED=-10035]="EC_JSON_NAME_VALUE_DUPLICATED",Ce[Ce.EC_TEMPLATE_NAME_INVALID=-10036]="EC_TEMPLATE_NAME_INVALID",Ce[Ce.EC_JSON_NAME_REFERENCE_INVALID=-10037]="EC_JSON_NAME_REFERENCE_INVALID",Ce[Ce.EC_PARAMETER_VALUE_INVALID=-10038]="EC_PARAMETER_VALUE_INVALID",Ce[Ce.EC_DOMAIN_NOT_MATCH=-10039]="EC_DOMAIN_NOT_MATCH",Ce[Ce.EC_RESERVED_INFO_NOT_MATCH=-10040]="EC_RESERVED_INFO_NOT_MATCH",Ce[Ce.EC_LICENSE_KEY_NOT_MATCH=-10043]="EC_LICENSE_KEY_NOT_MATCH",Ce[Ce.EC_REQUEST_FAILED=-10044]="EC_REQUEST_FAILED",Ce[Ce.EC_LICENSE_INIT_FAILED=-10045]="EC_LICENSE_INIT_FAILED",Ce[Ce.EC_SET_MODE_ARGUMENT_ERROR=-10051]="EC_SET_MODE_ARGUMENT_ERROR",Ce[Ce.EC_LICENSE_CONTENT_INVALID=-10052]="EC_LICENSE_CONTENT_INVALID",Ce[Ce.EC_LICENSE_KEY_INVALID=-10053]="EC_LICENSE_KEY_INVALID",Ce[Ce.EC_LICENSE_DEVICE_RUNS_OUT=-10054]="EC_LICENSE_DEVICE_RUNS_OUT",Ce[Ce.EC_GET_MODE_ARGUMENT_ERROR=-10055]="EC_GET_MODE_ARGUMENT_ERROR",Ce[Ce.EC_IRT_LICENSE_INVALID=-10056]="EC_IRT_LICENSE_INVALID",Ce[Ce.EC_FILE_SAVE_FAILED=-10058]="EC_FILE_SAVE_FAILED",Ce[Ce.EC_STAGE_TYPE_INVALID=-10059]="EC_STAGE_TYPE_INVALID",Ce[Ce.EC_IMAGE_ORIENTATION_INVALID=-10060]="EC_IMAGE_ORIENTATION_INVALID",Ce[Ce.EC_CONVERT_COMPLEX_TEMPLATE_ERROR=-10061]="EC_CONVERT_COMPLEX_TEMPLATE_ERROR",Ce[Ce.EC_CALL_REJECTED_WHEN_CAPTURING=-10062]="EC_CALL_REJECTED_WHEN_CAPTURING",Ce[Ce.EC_NO_IMAGE_SOURCE=-10063]="EC_NO_IMAGE_SOURCE",Ce[Ce.EC_READ_DIRECTORY_FAILED=-10064]="EC_READ_DIRECTORY_FAILED",Ce[Ce.EC_MODULE_NOT_FOUND=-10065]="EC_MODULE_NOT_FOUND",Ce[Ce.EC_MULTI_PAGES_NOT_SUPPORTED=-10066]="EC_MULTI_PAGES_NOT_SUPPORTED",Ce[Ce.EC_FILE_ALREADY_EXISTS=-10067]="EC_FILE_ALREADY_EXISTS",Ce[Ce.EC_CREATE_FILE_FAILED=-10068]="EC_CREATE_FILE_FAILED",Ce[Ce.EC_IMGAE_DATA_INVALID=-10069]="EC_IMGAE_DATA_INVALID",Ce[Ce.EC_IMAGE_SIZE_NOT_MATCH=-10070]="EC_IMAGE_SIZE_NOT_MATCH",Ce[Ce.EC_IMAGE_PIXEL_FORMAT_NOT_MATCH=-10071]="EC_IMAGE_PIXEL_FORMAT_NOT_MATCH",Ce[Ce.EC_SECTION_LEVEL_RESULT_IRREPLACEABLE=-10072]="EC_SECTION_LEVEL_RESULT_IRREPLACEABLE",Ce[Ce.EC_AXIS_DEFINITION_INCORRECT=-10073]="EC_AXIS_DEFINITION_INCORRECT",Ce[Ce.EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE=-10074]="EC_RESULT_TYPE_MISMATCH_IRREPLACEABLE",Ce[Ce.EC_PDF_LIBRARY_LOAD_FAILED=-10075]="EC_PDF_LIBRARY_LOAD_FAILED",Ce[Ce.EC_NO_LICENSE=-2e4]="EC_NO_LICENSE",Ce[Ce.EC_HANDSHAKE_CODE_INVALID=-20001]="EC_HANDSHAKE_CODE_INVALID",Ce[Ce.EC_LICENSE_BUFFER_FAILED=-20002]="EC_LICENSE_BUFFER_FAILED",Ce[Ce.EC_LICENSE_SYNC_FAILED=-20003]="EC_LICENSE_SYNC_FAILED",Ce[Ce.EC_DEVICE_NOT_MATCH=-20004]="EC_DEVICE_NOT_MATCH",Ce[Ce.EC_BIND_DEVICE_FAILED=-20005]="EC_BIND_DEVICE_FAILED",Ce[Ce.EC_INSTANCE_COUNT_OVER_LIMIT=-20008]="EC_INSTANCE_COUNT_OVER_LIMIT",Ce[Ce.EC_LICENSE_INIT_SEQUENCE_FAILED=-20009]="EC_LICENSE_INIT_SEQUENCE_FAILED",Ce[Ce.EC_TRIAL_LICENSE=-20010]="EC_TRIAL_LICENSE",Ce[Ce.EC_FAILED_TO_REACH_DLS=-20200]="EC_FAILED_TO_REACH_DLS",Ce[Ce.EC_LICENSE_CACHE_USED=-20012]="EC_LICENSE_CACHE_USED",Ce[Ce.EC_BARCODE_FORMAT_INVALID=-30009]="EC_BARCODE_FORMAT_INVALID",Ce[Ce.EC_QR_LICENSE_INVALID=-30016]="EC_QR_LICENSE_INVALID",Ce[Ce.EC_1D_LICENSE_INVALID=-30017]="EC_1D_LICENSE_INVALID",Ce[Ce.EC_PDF417_LICENSE_INVALID=-30019]="EC_PDF417_LICENSE_INVALID",Ce[Ce.EC_DATAMATRIX_LICENSE_INVALID=-30020]="EC_DATAMATRIX_LICENSE_INVALID",Ce[Ce.EC_CUSTOM_MODULESIZE_INVALID=-30025]="EC_CUSTOM_MODULESIZE_INVALID",Ce[Ce.EC_AZTEC_LICENSE_INVALID=-30041]="EC_AZTEC_LICENSE_INVALID",Ce[Ce.EC_PATCHCODE_LICENSE_INVALID=-30046]="EC_PATCHCODE_LICENSE_INVALID",Ce[Ce.EC_POSTALCODE_LICENSE_INVALID=-30047]="EC_POSTALCODE_LICENSE_INVALID",Ce[Ce.EC_DPM_LICENSE_INVALID=-30048]="EC_DPM_LICENSE_INVALID",Ce[Ce.EC_FRAME_DECODING_THREAD_EXISTS=-30049]="EC_FRAME_DECODING_THREAD_EXISTS",Ce[Ce.EC_STOP_DECODING_THREAD_FAILED=-30050]="EC_STOP_DECODING_THREAD_FAILED",Ce[Ce.EC_MAXICODE_LICENSE_INVALID=-30057]="EC_MAXICODE_LICENSE_INVALID",Ce[Ce.EC_GS1_DATABAR_LICENSE_INVALID=-30058]="EC_GS1_DATABAR_LICENSE_INVALID",Ce[Ce.EC_GS1_COMPOSITE_LICENSE_INVALID=-30059]="EC_GS1_COMPOSITE_LICENSE_INVALID",Ce[Ce.EC_DOTCODE_LICENSE_INVALID=-30061]="EC_DOTCODE_LICENSE_INVALID",Ce[Ce.EC_PHARMACODE_LICENSE_INVALID=-30062]="EC_PHARMACODE_LICENSE_INVALID",Ce[Ce.EC_CHARACTER_MODEL_FILE_NOT_FOUND=-40100]="EC_CHARACTER_MODEL_FILE_NOT_FOUND",Ce[Ce.EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT=-40101]="EC_TEXT_LINE_GROUP_LAYOUT_CONFLICT",Ce[Ce.EC_TEXT_LINE_GROUP_REGEX_CONFLICT=-40102]="EC_TEXT_LINE_GROUP_REGEX_CONFLICT",Ce[Ce.EC_QUADRILATERAL_INVALID=-50057]="EC_QUADRILATERAL_INVALID",Ce[Ce.EC_PANORAMA_LICENSE_INVALID=-70060]="EC_PANORAMA_LICENSE_INVALID",Ce[Ce.EC_RESOURCE_PATH_NOT_EXIST=-90001]="EC_RESOURCE_PATH_NOT_EXIST",Ce[Ce.EC_RESOURCE_LOAD_FAILED=-90002]="EC_RESOURCE_LOAD_FAILED",Ce[Ce.EC_CODE_SPECIFICATION_NOT_FOUND=-90003]="EC_CODE_SPECIFICATION_NOT_FOUND",Ce[Ce.EC_FULL_CODE_EMPTY=-90004]="EC_FULL_CODE_EMPTY",Ce[Ce.EC_FULL_CODE_PREPROCESS_FAILED=-90005]="EC_FULL_CODE_PREPROCESS_FAILED",Ce[Ce.EC_ZA_DL_LICENSE_INVALID=-90006]="EC_ZA_DL_LICENSE_INVALID",Ce[Ce.EC_AAMVA_DL_ID_LICENSE_INVALID=-90007]="EC_AAMVA_DL_ID_LICENSE_INVALID",Ce[Ce.EC_AADHAAR_LICENSE_INVALID=-90008]="EC_AADHAAR_LICENSE_INVALID",Ce[Ce.EC_MRTD_LICENSE_INVALID=-90009]="EC_MRTD_LICENSE_INVALID",Ce[Ce.EC_VIN_LICENSE_INVALID=-90010]="EC_VIN_LICENSE_INVALID",Ce[Ce.EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID=-90011]="EC_CUSTOMIZED_CODE_TYPE_LICENSE_INVALID",Ce[Ce.EC_LICENSE_WARNING=-10076]="EC_LICENSE_WARNING",Ce[Ce.EC_BARCODE_READER_LICENSE_NOT_FOUND=-30063]="EC_BARCODE_READER_LICENSE_NOT_FOUND",Ce[Ce.EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND=-40103]="EC_LABEL_RECOGNIZER_LICENSE_NOT_FOUND",Ce[Ce.EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND=-50058]="EC_DOCUMENT_NORMALIZER_LICENSE_NOT_FOUND",Ce[Ce.EC_CODE_PARSER_LICENSE_NOT_FOUND=-90012]="EC_CODE_PARSER_LICENSE_NOT_FOUND",e.EnumGrayscaleEnhancementMode=void 0,(Ae=e.EnumGrayscaleEnhancementMode||(e.EnumGrayscaleEnhancementMode={}))[Ae.GEM_SKIP=0]="GEM_SKIP",Ae[Ae.GEM_AUTO=1]="GEM_AUTO",Ae[Ae.GEM_GENERAL=2]="GEM_GENERAL",Ae[Ae.GEM_GRAY_EQUALIZE=4]="GEM_GRAY_EQUALIZE",Ae[Ae.GEM_GRAY_SMOOTH=8]="GEM_GRAY_SMOOTH",Ae[Ae.GEM_SHARPEN_SMOOTH=16]="GEM_SHARPEN_SMOOTH",Ae[Ae.GEM_REV=-2147483648]="GEM_REV",e.EnumGrayscaleTransformationMode=void 0,(Te=e.EnumGrayscaleTransformationMode||(e.EnumGrayscaleTransformationMode={}))[Te.GTM_SKIP=0]="GTM_SKIP",Te[Te.GTM_INVERTED=1]="GTM_INVERTED",Te[Te.GTM_ORIGINAL=2]="GTM_ORIGINAL",Te[Te.GTM_AUTO=4]="GTM_AUTO",Te[Te.GTM_REV=-2147483648]="GTM_REV",e.EnumImageTagType=void 0,(Ne=e.EnumImageTagType||(e.EnumImageTagType={}))[Ne.ITT_FILE_IMAGE=0]="ITT_FILE_IMAGE",Ne[Ne.ITT_VIDEO_FRAME=1]="ITT_VIDEO_FRAME",e.EnumPDFReadingMode=void 0,(Re=e.EnumPDFReadingMode||(e.EnumPDFReadingMode={}))[Re.PDFRM_VECTOR=1]="PDFRM_VECTOR",Re[Re.PDFRM_RASTER=2]="PDFRM_RASTER",Re[Re.PDFRM_REV=-2147483648]="PDFRM_REV",e.EnumRasterDataSource=void 0,(Le=e.EnumRasterDataSource||(e.EnumRasterDataSource={}))[Le.RDS_RASTERIZED_PAGES=0]="RDS_RASTERIZED_PAGES",Le[Le.RDS_EXTRACTED_IMAGES=1]="RDS_EXTRACTED_IMAGES";const De={IRUT_NULL:BigInt(0),IRUT_COLOUR_IMAGE:BigInt(1),IRUT_SCALED_DOWN_COLOUR_IMAGE:BigInt(2),IRUT_GRAYSCALE_IMAGE:BigInt(4),IRUT_TRANSOFORMED_GRAYSCALE_IMAGE:BigInt(8),IRUT_ENHANCED_GRAYSCALE_IMAGE:BigInt(16),IRUT_PREDETECTED_REGIONS:BigInt(32),IRUT_BINARY_IMAGE:BigInt(64),IRUT_TEXTURE_DETECTION_RESULT:BigInt(128),IRUT_TEXTURE_REMOVED_GRAYSCALE_IMAGE:BigInt(256),IRUT_TEXTURE_REMOVED_BINARY_IMAGE:BigInt(512),IRUT_CONTOURS:BigInt(1024),IRUT_LINE_SEGMENTS:BigInt(2048),IRUT_TEXT_ZONES:BigInt(4096),IRUT_TEXT_REMOVED_BINARY_IMAGE:BigInt(8192),IRUT_CANDIDATE_BARCODE_ZONES:BigInt(16384),IRUT_LOCALIZED_BARCODES:BigInt(32768),IRUT_SCALED_UP_BARCODE_IMAGE:BigInt(65536),IRUT_DEFORMATION_RESISTED_BARCODE_IMAGE:BigInt(1<<17),IRUT_COMPLEMENTED_BARCODE_IMAGE:BigInt(1<<18),IRUT_DECODED_BARCODES:BigInt(1<<19),IRUT_LONG_LINES:BigInt(1<<20),IRUT_CORNERS:BigInt(1<<21),IRUT_CANDIDATE_QUAD_EDGES:BigInt(1<<22),IRUT_DETECTED_QUADS:BigInt(1<<23),IRUT_LOCALIZED_TEXT_LINES:BigInt(1<<24),IRUT_RECOGNIZED_TEXT_LINES:BigInt(1<<25),IRUT_NORMALIZED_IMAGES:BigInt(1<<26),IRUT_SHORT_LINES:BigInt(1<<27),IRUT_RAW_TEXT_LINES:BigInt(1<<28),IRUT_ALL:BigInt("0xFFFFFFFFFFFFFFFF")};var Oe,le;e.EnumRegionObjectElementType=void 0,(Oe=e.EnumRegionObjectElementType||(e.EnumRegionObjectElementType={}))[Oe.ROET_PREDETECTED_REGION=0]="ROET_PREDETECTED_REGION",Oe[Oe.ROET_LOCALIZED_BARCODE=1]="ROET_LOCALIZED_BARCODE",Oe[Oe.ROET_DECODED_BARCODE=2]="ROET_DECODED_BARCODE",Oe[Oe.ROET_LOCALIZED_TEXT_LINE=3]="ROET_LOCALIZED_TEXT_LINE",Oe[Oe.ROET_RECOGNIZED_TEXT_LINE=4]="ROET_RECOGNIZED_TEXT_LINE",Oe[Oe.ROET_DETECTED_QUAD=5]="ROET_DETECTED_QUAD",Oe[Oe.ROET_NORMALIZED_IMAGE=6]="ROET_NORMALIZED_IMAGE",Oe[Oe.ROET_SOURCE_IMAGE=7]="ROET_SOURCE_IMAGE",Oe[Oe.ROET_TARGET_ROI=8]="ROET_TARGET_ROI",e.EnumSectionType=void 0,(le=e.EnumSectionType||(e.EnumSectionType={}))[le.ST_NULL=0]="ST_NULL",le[le.ST_REGION_PREDETECTION=1]="ST_REGION_PREDETECTION",le[le.ST_BARCODE_LOCALIZATION=2]="ST_BARCODE_LOCALIZATION",le[le.ST_BARCODE_DECODING=3]="ST_BARCODE_DECODING",le[le.ST_TEXT_LINE_LOCALIZATION=4]="ST_TEXT_LINE_LOCALIZATION",le[le.ST_TEXT_LINE_RECOGNITION=5]="ST_TEXT_LINE_RECOGNITION",le[le.ST_DOCUMENT_DETECTION=6]="ST_DOCUMENT_DETECTION",le[le.ST_DOCUMENT_NORMALIZATION=7]="ST_DOCUMENT_NORMALIZATION",e.CoreModule=ae,e.EnumIntermediateResultUnitType=De,e.ImageSourceAdapter=V,e._getNorImageData=F,e._isArc=N,e._isContour=R,e._isDSImageData=L,e._isDSRect=D,e._isImageTag=O,e._isLineSegment=l,e._isPoint=m,e._isPolygon=c,e._isQuad=u,e._isRect=g,e._saveToFile=async(e,E,_)=>await new Promise((async(t,I)=>{try{const I=E.split(".");let r=I[I.length-1];const n=await f(`image/${r}`,e);I.length<=1&&(r="png");const o=new File([n],E,{type:`image/${r}`});if(_){const e=URL.createObjectURL(o),_=document.createElement("a");_.href=e,_.download=E,_.click()}return t(o)}catch(e){return I()}})),e._toBlob=f,e._toCanvas=d,e._toImage=(e,E)=>{L(E)&&(E=F(E));const _=d(E);let t=new Image,I=_.toDataURL(e);return t.src=I,t},e.autoDiscoveryPaths=Ie,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.doOrWaitAsyncDependency=$,e.getNextTaskID=q,e.handleEngineResourcePaths=S,e.innerVersions=te,e.isArc=N,e.isContour=R,e.isDSImageData=L,e.isDSRect=D,e.isImageTag=O,e.isLineSegment=l,e.isObject=T,e.isPoint=m,e.isPolygon=c,e.isQuad=u,e.isRect=g,e.loadWasm=oe,e.mapAsyncDependency=Q,e.mapPackageRegister={},e.mapTaskCallBack=ee,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.status<200||I.status>=300?t(e+" "+I.status):_(I.response)},I.onerror=()=>{t(new Error("Network Error: "+I.statusText))}}))},e.setBDebug=_e,e.setOnLog=Ee,e.waitAsyncDependency=J,e.workerAutoResources=re}));

@@ -11,2 +11,2 @@ /*!

*/
!function(){"use strict";const e=e=>e&&"object"==typeof e&&"function"==typeof e.then;class t extends Promise{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 s;this._task=t,e(t)?s=t:"function"==typeof t&&(s=new Promise(t)),s&&(async()=>{try{const e=await s;t===this._task&&this.resolve(e)}catch(e){t===this._task&&this.reject(e)}})()}get isEmpty(){return null==this._task}constructor(t){let s,r;super(((e,t)=>{s=e,r=t})),this._s="pending",this.resolve=t=>{this.isPending&&(e(t)?this.task=t:(this._s="fulfilled",s(t)))},this.reject=e=>{this.isPending&&(this._s="rejected",r(e))},this.task=t}}const s=self,r={};s.coreWorkerVersion="3.4.21-beta-202410220132",s.versions=r;const o={},a=s.waitAsyncDependency=async e=>{let s="string"==typeof e?[e]:e,r=[];for(let e of s)r.push(o[e]=o[e]||new t);await Promise.all(r)},i=async(e,s)=>{let r,a="string"==typeof e?[e]:e,i=[];for(let e of a){let a;i.push(a=o[e]=o[e]||new t(r=r||s())),a.isEmpty&&(a.task=r=r||s())}await Promise.all(i)},n=[];s.setBufferIntoWasm=(e,t=0,s=0,r=0)=>{s&&(e=r?e.subarray(s,r):e.subarray(s));let o=n[t]=n[t]||{ptr:0,size:0,maxSize:0};return e.length>o.maxSize&&(o.ptr&&p._free(o.ptr),o.ptr=p._malloc(e.length),o.maxSize=e.length),p.HEAPU8.set(e,o.ptr),o.size=e.length,o.ptr};const l={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(l.needed){for(let e=0;e<l.temps.length;e++)p._free(l.temps[e]);l.temps.length=0,p._free(l.buffer),l.buffer=0,l.size+=l.needed,l.needed=0}l.buffer||(l.size+=128,l.buffer=p._malloc(l.size),assert(l.buffer)),l.pos=0},alloc:function(e,t){assert(l.buffer);let s,r=t.BYTES_PER_ELEMENT,o=e.length*r;return o=o+7&-8,l.pos+o>=l.size?(assert(o>0),l.needed+=o,s=p._malloc(o),l.temps.push(s)):(s=l.buffer+l.pos,l.pos+=o),s},copy:function(e,t,s){switch(s>>>=0,t.BYTES_PER_ELEMENT){case 2:s>>>=1;break;case 4:s>>>=2;break;case 8:s>>>=3}for(let r=0;r<e.length;r++)t[s+r]=e[r]}},c=s.ep=l.prepare;s.bDebug=!1,s.bLog=!1,s.strDomain=void 0;const d=s.es=e=>{let t=intArrayFromString(e),s=l.alloc(t,p.HEAP8);return l.copy(t,p.HEAP8,s),s},p=s.Module={print:e=>{s.bLog&&h(e)},printErr:e=>{s.bLog&&h(e)},locateFile:(e,t)=>{if(["std.wasm","core.wasm"].includes(e)){return m[e.split(".")[0]]+e}return e}},m=s.engineResourcePaths={},u=s.loadCore=async()=>{const e="core";await i(e,(async()=>{let t=s.bLog&&(h(e+" loading..."),Date.now())||0,r=new Promise((r=>{p.onRuntimeInitialized=()=>{s.bLog&&h(e+" initialized, cost "+(Date.now()-t)+" ms"),r(void 0)}})),o=m.std+"std.js";importScripts(o),await r}))},f=s.loadSideModule=async(e,{js:t,wasm:o})=>{await i(e,(async()=>{await a("core");let i=s.bLog&&(h(e+" loading..."),Date.now())||0;if(t instanceof Array)for(let s of t){let t=m[e]+s;importScripts(t)}else if(t){let t=m[e]+e+".worker.js";importScripts(t)}if(o instanceof Array)for(let t of o){let s=m[e]+t;try{await loadDynamicLibrary(s,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e}}else if(o){let t=m[e]+e+".wasm";try{await loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e}}wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist&&(c(),wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist(d(e.toUpperCase()))),wasmImports.emscripten_bind_CvrWasm_SetModuleExist&&(c(),wasmImports.emscripten_bind_CvrWasm_SetModuleExist(d(e.toUpperCase())));const n=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0())),l=s[`${e}WorkerVersion`];r[e]={worker:`${l||"No Worker"}`,wasm:n[e.toUpperCase()]},s.bLog&&h(e+" initialized, cost "+(Date.now()-i)+" ms")}))},g=s.mapController={loadWasm:async(e,t)=>{try{Object.assign(m,e.engineResourcePaths),e.needLoadCore&&(e.bLog&&(s.bLog=!0),e.dm&&(s.strDomain=e.dm),e.bd&&(s.bDebug=!0),await u());for(let t of e.names)await f(t,e.autoResources[t]);if(e.needLoadCore){const e=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0()));r.core={worker:s.coreWorkerVersion,wasm:e.CORE}}b(t,{versions:r})}catch(e){console.log(e),_(t,e)}},setBLog:e=>{s.bLog=e.value},setBDebug:e=>{s.bDebug=e.value},getModuleVersion:async(e,t)=>{try{let e=UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0());b(t,{versions:JSON.parse(e)})}catch(e){_(t,e)}},cfd:async(e,t)=>{try{wasmImports.emscripten_bind_CoreWasm_static_CFD_1(e.count),b(t,{})}catch(e){_(t,e)}}};addEventListener("message",(e=>{const t=e.data?e.data:e,s=t.body,r=t.id,o=t.instanceID,a=g[t.type];if(!a)throw new Error("Unmatched task: "+t.type);a(s,r,o)}));const b=s.handleTaskRes=(e,t)=>{postMessage({type:"task",id:e,body:Object.assign({success:!0},t)})},_=s.handleTaskErr=(e,t)=>{postMessage({type:"task",id:e,body:{success:!1,message:(null==t?void 0:t.message)||t,stack:s.bDebug&&(null==t?void 0:t.stack)||t}})},h=s.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{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 s;this._task=t,e(t)?s=t:"function"==typeof t&&(s=new Promise(t)),s&&(async()=>{try{const e=await s;t===this._task&&this.resolve(e)}catch(e){t===this._task&&this.reject(e)}})()}get isEmpty(){return null==this._task}constructor(t){let s,r;super(((e,t)=>{s=e,r=t})),this._s="pending",this.resolve=t=>{this.isPending&&(e(t)?this.task=t:(this._s="fulfilled",s(t)))},this.reject=e=>{this.isPending&&(this._s="rejected",r(e))},this.task=t}}const s=self,r={};s.coreWorkerVersion="3.4.21-beta-202411040411",s.versions=r;const o={},a=s.waitAsyncDependency=async e=>{let s="string"==typeof e?[e]:e,r=[];for(let e of s)r.push(o[e]=o[e]||new t);await Promise.all(r)},i=async(e,s)=>{let r,a="string"==typeof e?[e]:e,i=[];for(let e of a){let a;i.push(a=o[e]=o[e]||new t(r=r||s())),a.isEmpty&&(a.task=r=r||s())}await Promise.all(i)},n=[];s.setBufferIntoWasm=(e,t=0,s=0,r=0)=>{s&&(e=r?e.subarray(s,r):e.subarray(s));let o=n[t]=n[t]||{ptr:0,size:0,maxSize:0};return e.length>o.maxSize&&(o.ptr&&p._free(o.ptr),o.ptr=p._malloc(e.length),o.maxSize=e.length),p.HEAPU8.set(e,o.ptr),o.size=e.length,o.ptr};const l={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(l.needed){for(let e=0;e<l.temps.length;e++)p._free(l.temps[e]);l.temps.length=0,p._free(l.buffer),l.buffer=0,l.size+=l.needed,l.needed=0}l.buffer||(l.size+=128,l.buffer=p._malloc(l.size),assert(l.buffer)),l.pos=0},alloc:function(e,t){assert(l.buffer);let s,r=t.BYTES_PER_ELEMENT,o=e.length*r;return o=o+7&-8,l.pos+o>=l.size?(assert(o>0),l.needed+=o,s=p._malloc(o),l.temps.push(s)):(s=l.buffer+l.pos,l.pos+=o),s},copy:function(e,t,s){switch(s>>>=0,t.BYTES_PER_ELEMENT){case 2:s>>>=1;break;case 4:s>>>=2;break;case 8:s>>>=3}for(let r=0;r<e.length;r++)t[s+r]=e[r]}},c=s.ep=l.prepare;s.bDebug=!1,s.bLog=!1,s.strDomain=void 0;const d=s.es=e=>{let t=intArrayFromString(e),s=l.alloc(t,p.HEAP8);return l.copy(t,p.HEAP8,s),s},p=s.Module={print:e=>{s.bLog&&h(e)},printErr:e=>{s.bLog&&h(e)},locateFile:(e,t)=>{if(["std.wasm","core.wasm"].includes(e)){return m[e.split(".")[0]]+e}return e}},m=s.engineResourcePaths={},u=s.loadCore=async()=>{const e="core";await i(e,(async()=>{let t=s.bLog&&(h(e+" loading..."),Date.now())||0,r=new Promise((r=>{p.onRuntimeInitialized=()=>{s.bLog&&h(e+" initialized, cost "+(Date.now()-t)+" ms"),r(void 0)}})),o=m.std+"std.js";importScripts(o),await r}))},f=s.loadSideModule=async(e,{js:t,wasm:o})=>{await i(e,(async()=>{await a("core");let i=s.bLog&&(h(e+" loading..."),Date.now())||0;if(t instanceof Array)for(let s of t){let t=m[e]+s;importScripts(t)}else if(t){let t=m[e]+e+".worker.js";importScripts(t)}if(o instanceof Array)for(let t of o){let s=m[e]+t;try{await loadDynamicLibrary(s,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e}}else if(o){let t=m[e]+e+".wasm";try{await loadDynamicLibrary(t,{loadAsync:!0,global:!0,nodelete:!0,allowUndefined:!0})}catch(e){throw e}}wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist&&(c(),wasmImports.emscripten_bind_CoreWasm_PreSetModuleExist(d(e.toUpperCase()))),wasmImports.emscripten_bind_CvrWasm_SetModuleExist&&(c(),wasmImports.emscripten_bind_CvrWasm_SetModuleExist(d(e.toUpperCase())));const n=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0())),l=s[`${e}WorkerVersion`];r[e]={worker:`${l||"No Worker"}`,wasm:n[e.toUpperCase()]},s.bLog&&h(e+" initialized, cost "+(Date.now()-i)+" ms")}))},g=s.mapController={loadWasm:async(e,t)=>{try{Object.assign(m,e.engineResourcePaths),e.needLoadCore&&(e.bLog&&(s.bLog=!0),e.dm&&(s.strDomain=e.dm),e.bd&&(s.bDebug=!0),await u());for(let t of e.names)await f(t,e.autoResources[t]);if(e.needLoadCore){const e=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0()));r.core={worker:s.coreWorkerVersion,wasm:e.CORE}}b(t,{versions:r})}catch(e){console.log(e),_(t,e)}},setBLog:e=>{s.bLog=e.value},setBDebug:e=>{s.bDebug=e.value},getModuleVersion:async(e,t)=>{try{let e=UTF8ToString(wasmImports.emscripten_bind_CoreWasm_GetModuleVersion_0());b(t,{versions:JSON.parse(e)})}catch(e){_(t,e)}},cfd:async(e,t)=>{try{wasmImports.emscripten_bind_CoreWasm_static_CFD_1(e.count),b(t,{})}catch(e){_(t,e)}}};addEventListener("message",(e=>{const t=e.data?e.data:e,s=t.body,r=t.id,o=t.instanceID,a=g[t.type];if(!a)throw new Error("Unmatched task: "+t.type);a(s,r,o)}));const b=s.handleTaskRes=(e,t)=>{postMessage({type:"task",id:e,body:Object.assign({success:!0},t)})},_=s.handleTaskErr=(e,t)=>{postMessage({type:"task",id:e,body:{success:!1,message:(null==t?void 0:t.message)||t,stack:s.bDebug&&(null==t?void 0:t.stack)||t}})},h=s.log=e=>{postMessage({type:"log",message:e})}}();
{
"name": "dynamsoft-core",
"version": "3.4.21-beta-202410220132",
"version": "3.4.21-beta-202411040411",
"description": "The Dynamsoft Core module builds the foundation upon which Dynamsoft SDKs implement their functionality.",

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

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