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

dynamsoft-label-recognizer

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dynamsoft-label-recognizer - npm Package Compare versions

Comparing version 3.4.20-beta-202409230244 to 3.4.20

4

dist/dlr.esm.js

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

* @author Dynamsoft
* @version 3.4.20-beta-202409230244
* @version 3.4.20
* @fileoverview Dynamsoft JavaScript Library for Barcode Reader
* More info on dlr JS: https://www.dynamsoft.com/label-recognition/docs/web/programming/javascript/
*/
import{autoDiscoveryPaths as t,workerAutoResources as e,compareVersion as r,mapPackageRegister as a,innerVersions as s,loadWasm as c,getNextTaskID as n,mapTaskCallBack as o,handleEngineResourcePaths as i,CoreModule as l,worker as h}from"dynamsoft-core";const u="undefined"==typeof self,d=(()=>{if(!u&&document.currentScript){let t=document.currentScript.src,e=t.indexOf("?");if(-1!=e)t=t.substring(0,e);else{let e=t.indexOf("#");-1!=e&&(t=t.substring(0,e))}return t.substring(0,t.lastIndexOf("/")+1)}return"./"})(),R=t=>{if(null==t&&(t="./"),u);else{let e=document.createElement("a");e.href=t,t=e.href}return t.endsWith("/")||(t+="/"),t};t.dlr={version:"3.4.20-beta-202409230244",path:d},null==t.dlrData&&(t.dlrData={version:"1.0.11",path:R(d+"../../dynamsoft-label-recognizer-data@1.0.11/dist/")}),e.dlr={js:!0,wasm:!0,deps:["license","dip","dnn"]},e.dnn={wasm:!0,deps:["dip"]};const p="1.4.10";"string"!=typeof t.std&&r(t.std.version,p)<0&&(t.std={version:p,path:R(d+`../../dynamsoft-capture-vision-std@${p}/dist/`)});const f="2.4.20";(!t.dip||"string"!=typeof t.dip&&r(t.dip.version,f)<0)&&(t.dip={version:f,path:R(d+`../../dynamsoft-image-processing@${f}/dist/`)});const g="1.0.20";(!t.dnn||"string"!=typeof t.dnn&&r(t.dnn.version,g)<0)&&(t.dnn={version:g,path:R(d+`../../dynamsoft-capture-vision-dnn@${g}/dist/`)});let x=!1;class C{static getVersion(){const t=s.dlr&&s.dlr.wasm,e=s.dlr&&s.dlr.worker;return`3.4.20-beta-202409230244(Worker: ${e||"Not Loaded"}, Wasm: ${t||"Not Loaded"})`}static async loadRecognitionData(e,r){return await c("dlr"),await new Promise(((a,s)=>{let c=n();o[c]=async t=>{if(t.success){const e=t.result;if(0!==e.exception){let t=new Error(e.description);return t.errorCode=e.exception,s(t)}return e.bModel||(x=!0),a(e)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,s(e)}},r&&!r.endsWith("/")&&(r+="/");const u=i(l.engineResourcePaths,t);r||"ConfusableChars"!==e||(r=u.dlr),h.postMessage({type:"dlr_loadData",id:c,body:{dataName:e,dataPath:r||u.dlrData}})}))}}a.dlr={loadRecognitionData:C.loadRecognitionData,get bLoadConfusableCharsData(){return x}};const S={filterVINResult:function(t){let e="";if(18===t.characterResults.length){let e=t.characterResults[9].location.points[0].x-t.characterResults[8].location.points[1].x;e<2&&(e=2);let r=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,a=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,s=2===e?3:e;if(r-e>=s&&a-e<s)t.characterResults.shift();else if(a-e>=s&&r-e<s)t.characterResults.pop();else{t.characterResults[0].characterHConfidence>t.characterResults[17].characterHConfidence?t.characterResults.pop():t.characterResults.shift()}}else if(19===t.characterResults.length){let e=t.characterResults[10].location.points[0].x-t.characterResults[9].location.points[1].x;e<2&&(e=2);let r,a,s,c=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,n=t.characterResults[18].location.points[0].x-t.characterResults[17].location.points[1].x,o=t.characterResults[2].location.points[0].x-t.characterResults[1].location.points[1].x,i=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,l=2===e?3:e;if("1"===t.characterResults[1].characterH||"1"===t.characterResults[2].characterH||"1"===t.characterResults[16].characterH||"1"===t.characterResults[17].characterH){for(let e=9;e<t.characterResults.length;e++)if("1"!==t.characterResults[e].characterH){s=t.characterResults[e].location.points[1].x-t.characterResults[e].location.points[0].x;break}"1"===t.characterResults[1].characterH&&(r=s-(t.characterResults[1].location.points[1].x-t.characterResults[1].location.points[0].x)+3),"1"===t.characterResults[2].characterH&&(r=s-(t.characterResults[2].location.points[1].x-t.characterResults[2].location.points[0].x)+3),"1"===t.characterResults[16].characterH&&(a=s-(t.characterResults[16].location.points[1].x-t.characterResults[16].location.points[0].x)+3),"1"===t.characterResults[17].characterH&&(a=s-(t.characterResults[17].location.points[1].x-t.characterResults[17].location.points[0].x)+3)}if(o-e>=(r||l)&&i-e<(a||l))t.characterResults.splice(0,2);else if(i-e>=(a||l)&&o-e<(r||l))t.characterResults.splice(17,2);else if(c>e&&n>e)t.characterResults.pop(),t.characterResults.shift();else{let e=t.characterResults[0].characterHConfidence+t.characterResults[1].characterHConfidence,r=t.characterResults[17].characterHConfidence+t.characterResults[18].characterHConfidence,a=t.characterResults[0].characterHConfidence+t.characterResults[18].characterHConfidence,s=Math.min(e,r,a);s===e?t.characterResults.splice(0,2):s===r?t.characterResults.splice(17,2):s===a&&(t.characterResults.pop(),t.characterResults.shift())}}for(let r of t.characterResults)e+=r.characterH;return e},checkValidVIN:function(t){if(!t||17!=t.length)return!1;return(t=>{const e=new Map([["A",1],["B",2],["C",3],["D",4],["E",5],["F",6],["G",7],["H",8],["J",1],["K",2],["L",3],["M",4],["N",5],["P",7],["R",9],["S",2],["T",3],["U",4],["V",5],["W",6],["X",7],["Y",8],["Z",9],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9]]),r=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];let a=0;for(let s=0;s<t.length;s++){let c=e.get(t[s]);c&&(a+=c*r[s])}return a%11})(t).toString()===t[8]},checkValidMRP:function(t){if(!t||44!=t.length)return!1;const e=(t,e,r)=>{const a=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),s=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=a.get(t[n]);e&&(c+=e*s[o%3]),o++}return c%10},r=t.slice(0,10)+t.slice(13,20)+t.slice(21,43),a=e(t,0,8).toString(),s=e(t,13,18).toString(),c=e(t,21,26).toString(),n=e(t,28,41).toString(),o=e(r,0,r.length).toString();return a===t[9]&&s===t[19]&&c===t[27]&&n===t[42]&&o===t[43]},checkValidMRV:function(t){if(!t||44!=t.length&&36!=t.length)return!1;const e=(t,e,r)=>{const a=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),s=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=a.get(t[n]);e&&(c+=e*s[o%3]),o++}return c%10},r=e(t,0,8).toString(),a=e(t,13,18).toString(),s=e(t,21,26).toString();return r===t[9]&&a===t[19]&&s===t[27]},checkValidIDCard:function(t,e){if(!t||30!=t.length&&36!=t.length)return!1;const r=(t,e,r)=>{const a=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),s=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=a.get(t[n]);e&&(c+=e*s[o%3]),o++}return c%10};if(30===t.length){if(e&&t===e){return r(t,5,13).toString()===t[14]}if(e&&t!==e){const a=`${e.substring(5,30)}${t.substring(0,7)}${t.substring(8,15)}${t.substring(18,29)}`;return r(a,0,a.length-1).toString()===t[29]}}else if(36===t.length){const e=r(t,0,8).toString(),a=r(t,13,18).toString(),s=r(t,21,26).toString(),c=`${t.substring(0,10)}${t.substring(13,20)}${t.substring(21,28)}`,n=r(c,0,c.length-1).toString();return e===t[9]&&a===t[19]&&s===t[27]&&n===t[35]}}};var D;!function(t){t[t.RTLS_LOCALIZED=0]="RTLS_LOCALIZED",t[t.RTLS_RECOGNITION_FAILED=1]="RTLS_RECOGNITION_FAILED",t[t.RTLS_RECOGNITION_SUCCEEDED=2]="RTLS_RECOGNITION_SUCCEEDED"}(D||(D={})),o[-1]=async t=>{C.onDataLoadProgressChanged&&C.onDataLoadProgressChanged(t.resourcesPath,t.tag,{loaded:t.loaded,total:t.total})};export{D as EnumRawTextLineStatus,C as LabelRecognizerModule,S as utilsFuncs};
import{autoDiscoveryPaths as t,workerAutoResources as e,compareVersion as r,mapPackageRegister as a,innerVersions as s,loadWasm as c,getNextTaskID as n,mapTaskCallBack as o,handleEngineResourcePaths as i,CoreModule as l,worker as h}from"dynamsoft-core";const u="undefined"==typeof self,d=(()=>{if(!u&&document.currentScript){let t=document.currentScript.src,e=t.indexOf("?");if(-1!=e)t=t.substring(0,e);else{let e=t.indexOf("#");-1!=e&&(t=t.substring(0,e))}return t.substring(0,t.lastIndexOf("/")+1)}return"./"})(),R=t=>{if(null==t&&(t="./"),u);else{let e=document.createElement("a");e.href=t,t=e.href}return t.endsWith("/")||(t+="/"),t};t.dlr={version:"3.4.20",path:d},null==t.dlrData&&(t.dlrData={version:"1.0.11",path:R(d+"../../dynamsoft-label-recognizer-data@1.0.11/dist/")}),e.dlr={js:!0,wasm:!0,deps:["license","dip","dnn"]},e.dnn={wasm:!0,deps:["dip"]};const p="1.4.10";"string"!=typeof t.std&&r(t.std.version,p)<0&&(t.std={version:p,path:R(d+`../../dynamsoft-capture-vision-std@${p}/dist/`)});const f="2.4.20";(!t.dip||"string"!=typeof t.dip&&r(t.dip.version,f)<0)&&(t.dip={version:f,path:R(d+`../../dynamsoft-image-processing@${f}/dist/`)});const g="1.0.20";(!t.dnn||"string"!=typeof t.dnn&&r(t.dnn.version,g)<0)&&(t.dnn={version:g,path:R(d+`../../dynamsoft-capture-vision-dnn@${g}/dist/`)});let x=!1;class C{static getVersion(){const t=s.dlr&&s.dlr.wasm,e=s.dlr&&s.dlr.worker;return`3.4.20(Worker: ${e||"Not Loaded"}, Wasm: ${t||"Not Loaded"})`}static async loadRecognitionData(e,r){return await c("dlr"),await new Promise(((a,s)=>{let c=n();o[c]=async t=>{if(t.success){const e=t.result;if(0!==e.exception){let t=new Error(e.description);return t.errorCode=e.exception,s(t)}return e.bModel||(x=!0),a(e)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,s(e)}},r&&!r.endsWith("/")&&(r+="/");const u=i(l.engineResourcePaths,t);r||"ConfusableChars"!==e||(r=u.dlr),h.postMessage({type:"dlr_loadData",id:c,body:{dataName:e,dataPath:r||u.dlrData}})}))}}a.dlr={loadRecognitionData:C.loadRecognitionData,get bLoadConfusableCharsData(){return x}};const S={filterVINResult:function(t){let e="";if(18===t.characterResults.length){let e=t.characterResults[9].location.points[0].x-t.characterResults[8].location.points[1].x;e<2&&(e=2);let r=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,a=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,s=2===e?3:e;if(r-e>=s&&a-e<s)t.characterResults.shift();else if(a-e>=s&&r-e<s)t.characterResults.pop();else{t.characterResults[0].characterHConfidence>t.characterResults[17].characterHConfidence?t.characterResults.pop():t.characterResults.shift()}}else if(19===t.characterResults.length){let e=t.characterResults[10].location.points[0].x-t.characterResults[9].location.points[1].x;e<2&&(e=2);let r,a,s,c=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,n=t.characterResults[18].location.points[0].x-t.characterResults[17].location.points[1].x,o=t.characterResults[2].location.points[0].x-t.characterResults[1].location.points[1].x,i=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,l=2===e?3:e;if("1"===t.characterResults[1].characterH||"1"===t.characterResults[2].characterH||"1"===t.characterResults[16].characterH||"1"===t.characterResults[17].characterH){for(let e=9;e<t.characterResults.length;e++)if("1"!==t.characterResults[e].characterH){s=t.characterResults[e].location.points[1].x-t.characterResults[e].location.points[0].x;break}"1"===t.characterResults[1].characterH&&(r=s-(t.characterResults[1].location.points[1].x-t.characterResults[1].location.points[0].x)+3),"1"===t.characterResults[2].characterH&&(r=s-(t.characterResults[2].location.points[1].x-t.characterResults[2].location.points[0].x)+3),"1"===t.characterResults[16].characterH&&(a=s-(t.characterResults[16].location.points[1].x-t.characterResults[16].location.points[0].x)+3),"1"===t.characterResults[17].characterH&&(a=s-(t.characterResults[17].location.points[1].x-t.characterResults[17].location.points[0].x)+3)}if(o-e>=(r||l)&&i-e<(a||l))t.characterResults.splice(0,2);else if(i-e>=(a||l)&&o-e<(r||l))t.characterResults.splice(17,2);else if(c>e&&n>e)t.characterResults.pop(),t.characterResults.shift();else{let e=t.characterResults[0].characterHConfidence+t.characterResults[1].characterHConfidence,r=t.characterResults[17].characterHConfidence+t.characterResults[18].characterHConfidence,a=t.characterResults[0].characterHConfidence+t.characterResults[18].characterHConfidence,s=Math.min(e,r,a);s===e?t.characterResults.splice(0,2):s===r?t.characterResults.splice(17,2):s===a&&(t.characterResults.pop(),t.characterResults.shift())}}for(let r of t.characterResults)e+=r.characterH;return e},checkValidVIN:function(t){if(!t||17!=t.length)return!1;return(t=>{const e=new Map([["A",1],["B",2],["C",3],["D",4],["E",5],["F",6],["G",7],["H",8],["J",1],["K",2],["L",3],["M",4],["N",5],["P",7],["R",9],["S",2],["T",3],["U",4],["V",5],["W",6],["X",7],["Y",8],["Z",9],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9]]),r=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];let a=0;for(let s=0;s<t.length;s++){let c=e.get(t[s]);c&&(a+=c*r[s])}return a%11})(t).toString()===t[8]},checkValidMRP:function(t){if(!t||44!=t.length)return!1;const e=(t,e,r)=>{const a=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),s=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=a.get(t[n]);e&&(c+=e*s[o%3]),o++}return c%10},r=t.slice(0,10)+t.slice(13,20)+t.slice(21,43),a=e(t,0,8).toString(),s=e(t,13,18).toString(),c=e(t,21,26).toString(),n=e(t,28,41).toString(),o=e(r,0,r.length).toString();return a===t[9]&&s===t[19]&&c===t[27]&&n===t[42]&&o===t[43]},checkValidMRV:function(t){if(!t||44!=t.length&&36!=t.length)return!1;const e=(t,e,r)=>{const a=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),s=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=a.get(t[n]);e&&(c+=e*s[o%3]),o++}return c%10},r=e(t,0,8).toString(),a=e(t,13,18).toString(),s=e(t,21,26).toString();return r===t[9]&&a===t[19]&&s===t[27]},checkValidIDCard:function(t,e){if(!t||30!=t.length&&36!=t.length)return!1;const r=(t,e,r)=>{const a=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),s=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=a.get(t[n]);e&&(c+=e*s[o%3]),o++}return c%10};if(30===t.length){if(e&&t===e){return r(t,5,13).toString()===t[14]}if(e&&t!==e){const a=`${e.substring(5,30)}${t.substring(0,7)}${t.substring(8,15)}${t.substring(18,29)}`;return r(a,0,a.length-1).toString()===t[29]}}else if(36===t.length){const e=r(t,0,8).toString(),a=r(t,13,18).toString(),s=r(t,21,26).toString(),c=`${t.substring(0,10)}${t.substring(13,20)}${t.substring(21,28)}`,n=r(c,0,c.length-1).toString();return e===t[9]&&a===t[19]&&s===t[27]&&n===t[35]}}};var D;!function(t){t[t.RTLS_LOCALIZED=0]="RTLS_LOCALIZED",t[t.RTLS_RECOGNITION_FAILED=1]="RTLS_RECOGNITION_FAILED",t[t.RTLS_RECOGNITION_SUCCEEDED=2]="RTLS_RECOGNITION_SUCCEEDED"}(D||(D={})),o[-1]=async t=>{C.onDataLoadProgressChanged&&C.onDataLoadProgressChanged(t.resourcesPath,t.tag,{loaded:t.loaded,total:t.total})};export{D as EnumRawTextLineStatus,C as LabelRecognizerModule,S as utilsFuncs};

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

* @author Dynamsoft
* @version 3.4.20-beta-202409230244
* @version 3.4.20
* @fileoverview Dynamsoft JavaScript Library for Barcode Reader
* More info on dlr JS: https://www.dynamsoft.com/label-recognition/docs/web/programming/javascript/
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("dynamsoft-core")):"function"==typeof define&&define.amd?define(["exports","dynamsoft-core"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).Dynamsoft=t.Dynamsoft||{},t.Dynamsoft.DLR={}),t.Dynamsoft.Core)}(this,(function(t,e){"use strict";const r="undefined"==typeof self,s=(()=>{if(!r&&document.currentScript){let t=document.currentScript.src,e=t.indexOf("?");if(-1!=e)t=t.substring(0,e);else{let e=t.indexOf("#");-1!=e&&(t=t.substring(0,e))}return t.substring(0,t.lastIndexOf("/")+1)}return"./"})(),a=t=>{if(null==t&&(t="./"),r);else{let e=document.createElement("a");e.href=t,t=e.href}return t.endsWith("/")||(t+="/"),t};e.autoDiscoveryPaths.dlr={version:"3.4.20-beta-202409230244",path:s},null==e.autoDiscoveryPaths.dlrData&&(e.autoDiscoveryPaths.dlrData={version:"1.0.11",path:a(s+"../../dynamsoft-label-recognizer-data@1.0.11/dist/")}),e.workerAutoResources.dlr={js:!0,wasm:!0,deps:["license","dip","dnn"]},e.workerAutoResources.dnn={wasm:!0,deps:["dip"]};const c="1.4.10";"string"!=typeof e.autoDiscoveryPaths.std&&e.compareVersion(e.autoDiscoveryPaths.std.version,c)<0&&(e.autoDiscoveryPaths.std={version:c,path:a(s+`../../dynamsoft-capture-vision-std@${c}/dist/`)});const n="2.4.20";(!e.autoDiscoveryPaths.dip||"string"!=typeof e.autoDiscoveryPaths.dip&&e.compareVersion(e.autoDiscoveryPaths.dip.version,n)<0)&&(e.autoDiscoveryPaths.dip={version:n,path:a(s+`../../dynamsoft-image-processing@${n}/dist/`)});const o="1.0.20";(!e.autoDiscoveryPaths.dnn||"string"!=typeof e.autoDiscoveryPaths.dnn&&e.compareVersion(e.autoDiscoveryPaths.dnn.version,o)<0)&&(e.autoDiscoveryPaths.dnn={version:o,path:a(s+`../../dynamsoft-capture-vision-dnn@${o}/dist/`)});let i=!1;class l{static getVersion(){const t=e.innerVersions.dlr&&e.innerVersions.dlr.wasm,r=e.innerVersions.dlr&&e.innerVersions.dlr.worker;return`3.4.20-beta-202409230244(Worker: ${r||"Not Loaded"}, Wasm: ${t||"Not Loaded"})`}static async loadRecognitionData(t,r){return await e.loadWasm("dlr"),await new Promise(((s,a)=>{let c=e.getNextTaskID();e.mapTaskCallBack[c]=async t=>{if(t.success){const e=t.result;if(0!==e.exception){let t=new Error(e.description);return t.errorCode=e.exception,a(t)}return e.bModel||(i=!0),s(e)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,a(e)}},r&&!r.endsWith("/")&&(r+="/");const n=e.handleEngineResourcePaths(e.CoreModule.engineResourcePaths,e.autoDiscoveryPaths);r||"ConfusableChars"!==t||(r=n.dlr),e.worker.postMessage({type:"dlr_loadData",id:c,body:{dataName:t,dataPath:r||n.dlrData}})}))}}e.mapPackageRegister.dlr={loadRecognitionData:l.loadRecognitionData,get bLoadConfusableCharsData(){return i}};const u={filterVINResult:function(t){let e="";if(18===t.characterResults.length){let e=t.characterResults[9].location.points[0].x-t.characterResults[8].location.points[1].x;e<2&&(e=2);let r=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,s=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,a=2===e?3:e;if(r-e>=a&&s-e<a)t.characterResults.shift();else if(s-e>=a&&r-e<a)t.characterResults.pop();else{t.characterResults[0].characterHConfidence>t.characterResults[17].characterHConfidence?t.characterResults.pop():t.characterResults.shift()}}else if(19===t.characterResults.length){let e=t.characterResults[10].location.points[0].x-t.characterResults[9].location.points[1].x;e<2&&(e=2);let r,s,a,c=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,n=t.characterResults[18].location.points[0].x-t.characterResults[17].location.points[1].x,o=t.characterResults[2].location.points[0].x-t.characterResults[1].location.points[1].x,i=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,l=2===e?3:e;if("1"===t.characterResults[1].characterH||"1"===t.characterResults[2].characterH||"1"===t.characterResults[16].characterH||"1"===t.characterResults[17].characterH){for(let e=9;e<t.characterResults.length;e++)if("1"!==t.characterResults[e].characterH){a=t.characterResults[e].location.points[1].x-t.characterResults[e].location.points[0].x;break}"1"===t.characterResults[1].characterH&&(r=a-(t.characterResults[1].location.points[1].x-t.characterResults[1].location.points[0].x)+3),"1"===t.characterResults[2].characterH&&(r=a-(t.characterResults[2].location.points[1].x-t.characterResults[2].location.points[0].x)+3),"1"===t.characterResults[16].characterH&&(s=a-(t.characterResults[16].location.points[1].x-t.characterResults[16].location.points[0].x)+3),"1"===t.characterResults[17].characterH&&(s=a-(t.characterResults[17].location.points[1].x-t.characterResults[17].location.points[0].x)+3)}if(o-e>=(r||l)&&i-e<(s||l))t.characterResults.splice(0,2);else if(i-e>=(s||l)&&o-e<(r||l))t.characterResults.splice(17,2);else if(c>e&&n>e)t.characterResults.pop(),t.characterResults.shift();else{let e=t.characterResults[0].characterHConfidence+t.characterResults[1].characterHConfidence,r=t.characterResults[17].characterHConfidence+t.characterResults[18].characterHConfidence,s=t.characterResults[0].characterHConfidence+t.characterResults[18].characterHConfidence,a=Math.min(e,r,s);a===e?t.characterResults.splice(0,2):a===r?t.characterResults.splice(17,2):a===s&&(t.characterResults.pop(),t.characterResults.shift())}}for(let r of t.characterResults)e+=r.characterH;return e},checkValidVIN:function(t){if(!t||17!=t.length)return!1;return(t=>{const e=new Map([["A",1],["B",2],["C",3],["D",4],["E",5],["F",6],["G",7],["H",8],["J",1],["K",2],["L",3],["M",4],["N",5],["P",7],["R",9],["S",2],["T",3],["U",4],["V",5],["W",6],["X",7],["Y",8],["Z",9],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9]]),r=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];let s=0;for(let a=0;a<t.length;a++){let c=e.get(t[a]);c&&(s+=c*r[a])}return s%11})(t).toString()===t[8]},checkValidMRP:function(t){if(!t||44!=t.length)return!1;const e=(t,e,r)=>{const s=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),a=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=s.get(t[n]);e&&(c+=e*a[o%3]),o++}return c%10},r=t.slice(0,10)+t.slice(13,20)+t.slice(21,43),s=e(t,0,8).toString(),a=e(t,13,18).toString(),c=e(t,21,26).toString(),n=e(t,28,41).toString(),o=e(r,0,r.length).toString();return s===t[9]&&a===t[19]&&c===t[27]&&n===t[42]&&o===t[43]},checkValidMRV:function(t){if(!t||44!=t.length&&36!=t.length)return!1;const e=(t,e,r)=>{const s=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),a=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=s.get(t[n]);e&&(c+=e*a[o%3]),o++}return c%10},r=e(t,0,8).toString(),s=e(t,13,18).toString(),a=e(t,21,26).toString();return r===t[9]&&s===t[19]&&a===t[27]},checkValidIDCard:function(t,e){if(!t||30!=t.length&&36!=t.length)return!1;const r=(t,e,r)=>{const s=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),a=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=s.get(t[n]);e&&(c+=e*a[o%3]),o++}return c%10};if(30===t.length){if(e&&t===e){return r(t,5,13).toString()===t[14]}if(e&&t!==e){const s=`${e.substring(5,30)}${t.substring(0,7)}${t.substring(8,15)}${t.substring(18,29)}`;return r(s,0,s.length-1).toString()===t[29]}}else if(36===t.length){const e=r(t,0,8).toString(),s=r(t,13,18).toString(),a=r(t,21,26).toString(),c=`${t.substring(0,10)}${t.substring(13,20)}${t.substring(21,28)}`,n=r(c,0,c.length-1).toString();return e===t[9]&&s===t[19]&&a===t[27]&&n===t[35]}}};var h;t.EnumRawTextLineStatus=void 0,(h=t.EnumRawTextLineStatus||(t.EnumRawTextLineStatus={}))[h.RTLS_LOCALIZED=0]="RTLS_LOCALIZED",h[h.RTLS_RECOGNITION_FAILED=1]="RTLS_RECOGNITION_FAILED",h[h.RTLS_RECOGNITION_SUCCEEDED=2]="RTLS_RECOGNITION_SUCCEEDED",e.mapTaskCallBack[-1]=async t=>{l.onDataLoadProgressChanged&&l.onDataLoadProgressChanged(t.resourcesPath,t.tag,{loaded:t.loaded,total:t.total})},t.LabelRecognizerModule=l,t.utilsFuncs=u}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("dynamsoft-core")):"function"==typeof define&&define.amd?define(["exports","dynamsoft-core"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).Dynamsoft=t.Dynamsoft||{},t.Dynamsoft.DLR={}),t.Dynamsoft.Core)}(this,(function(t,e){"use strict";const r="undefined"==typeof self,s=(()=>{if(!r&&document.currentScript){let t=document.currentScript.src,e=t.indexOf("?");if(-1!=e)t=t.substring(0,e);else{let e=t.indexOf("#");-1!=e&&(t=t.substring(0,e))}return t.substring(0,t.lastIndexOf("/")+1)}return"./"})(),a=t=>{if(null==t&&(t="./"),r);else{let e=document.createElement("a");e.href=t,t=e.href}return t.endsWith("/")||(t+="/"),t};e.autoDiscoveryPaths.dlr={version:"3.4.20",path:s},null==e.autoDiscoveryPaths.dlrData&&(e.autoDiscoveryPaths.dlrData={version:"1.0.11",path:a(s+"../../dynamsoft-label-recognizer-data@1.0.11/dist/")}),e.workerAutoResources.dlr={js:!0,wasm:!0,deps:["license","dip","dnn"]},e.workerAutoResources.dnn={wasm:!0,deps:["dip"]};const c="1.4.10";"string"!=typeof e.autoDiscoveryPaths.std&&e.compareVersion(e.autoDiscoveryPaths.std.version,c)<0&&(e.autoDiscoveryPaths.std={version:c,path:a(s+`../../dynamsoft-capture-vision-std@${c}/dist/`)});const n="2.4.20";(!e.autoDiscoveryPaths.dip||"string"!=typeof e.autoDiscoveryPaths.dip&&e.compareVersion(e.autoDiscoveryPaths.dip.version,n)<0)&&(e.autoDiscoveryPaths.dip={version:n,path:a(s+`../../dynamsoft-image-processing@${n}/dist/`)});const o="1.0.20";(!e.autoDiscoveryPaths.dnn||"string"!=typeof e.autoDiscoveryPaths.dnn&&e.compareVersion(e.autoDiscoveryPaths.dnn.version,o)<0)&&(e.autoDiscoveryPaths.dnn={version:o,path:a(s+`../../dynamsoft-capture-vision-dnn@${o}/dist/`)});let i=!1;class l{static getVersion(){const t=e.innerVersions.dlr&&e.innerVersions.dlr.wasm,r=e.innerVersions.dlr&&e.innerVersions.dlr.worker;return`3.4.20(Worker: ${r||"Not Loaded"}, Wasm: ${t||"Not Loaded"})`}static async loadRecognitionData(t,r){return await e.loadWasm("dlr"),await new Promise(((s,a)=>{let c=e.getNextTaskID();e.mapTaskCallBack[c]=async t=>{if(t.success){const e=t.result;if(0!==e.exception){let t=new Error(e.description);return t.errorCode=e.exception,a(t)}return e.bModel||(i=!0),s(e)}{let e=new Error(t.message);return e.stack=t.stack+"\n"+e.stack,a(e)}},r&&!r.endsWith("/")&&(r+="/");const n=e.handleEngineResourcePaths(e.CoreModule.engineResourcePaths,e.autoDiscoveryPaths);r||"ConfusableChars"!==t||(r=n.dlr),e.worker.postMessage({type:"dlr_loadData",id:c,body:{dataName:t,dataPath:r||n.dlrData}})}))}}e.mapPackageRegister.dlr={loadRecognitionData:l.loadRecognitionData,get bLoadConfusableCharsData(){return i}};const u={filterVINResult:function(t){let e="";if(18===t.characterResults.length){let e=t.characterResults[9].location.points[0].x-t.characterResults[8].location.points[1].x;e<2&&(e=2);let r=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,s=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,a=2===e?3:e;if(r-e>=a&&s-e<a)t.characterResults.shift();else if(s-e>=a&&r-e<a)t.characterResults.pop();else{t.characterResults[0].characterHConfidence>t.characterResults[17].characterHConfidence?t.characterResults.pop():t.characterResults.shift()}}else if(19===t.characterResults.length){let e=t.characterResults[10].location.points[0].x-t.characterResults[9].location.points[1].x;e<2&&(e=2);let r,s,a,c=t.characterResults[1].location.points[0].x-t.characterResults[0].location.points[1].x,n=t.characterResults[18].location.points[0].x-t.characterResults[17].location.points[1].x,o=t.characterResults[2].location.points[0].x-t.characterResults[1].location.points[1].x,i=t.characterResults[17].location.points[0].x-t.characterResults[16].location.points[1].x,l=2===e?3:e;if("1"===t.characterResults[1].characterH||"1"===t.characterResults[2].characterH||"1"===t.characterResults[16].characterH||"1"===t.characterResults[17].characterH){for(let e=9;e<t.characterResults.length;e++)if("1"!==t.characterResults[e].characterH){a=t.characterResults[e].location.points[1].x-t.characterResults[e].location.points[0].x;break}"1"===t.characterResults[1].characterH&&(r=a-(t.characterResults[1].location.points[1].x-t.characterResults[1].location.points[0].x)+3),"1"===t.characterResults[2].characterH&&(r=a-(t.characterResults[2].location.points[1].x-t.characterResults[2].location.points[0].x)+3),"1"===t.characterResults[16].characterH&&(s=a-(t.characterResults[16].location.points[1].x-t.characterResults[16].location.points[0].x)+3),"1"===t.characterResults[17].characterH&&(s=a-(t.characterResults[17].location.points[1].x-t.characterResults[17].location.points[0].x)+3)}if(o-e>=(r||l)&&i-e<(s||l))t.characterResults.splice(0,2);else if(i-e>=(s||l)&&o-e<(r||l))t.characterResults.splice(17,2);else if(c>e&&n>e)t.characterResults.pop(),t.characterResults.shift();else{let e=t.characterResults[0].characterHConfidence+t.characterResults[1].characterHConfidence,r=t.characterResults[17].characterHConfidence+t.characterResults[18].characterHConfidence,s=t.characterResults[0].characterHConfidence+t.characterResults[18].characterHConfidence,a=Math.min(e,r,s);a===e?t.characterResults.splice(0,2):a===r?t.characterResults.splice(17,2):a===s&&(t.characterResults.pop(),t.characterResults.shift())}}for(let r of t.characterResults)e+=r.characterH;return e},checkValidVIN:function(t){if(!t||17!=t.length)return!1;return(t=>{const e=new Map([["A",1],["B",2],["C",3],["D",4],["E",5],["F",6],["G",7],["H",8],["J",1],["K",2],["L",3],["M",4],["N",5],["P",7],["R",9],["S",2],["T",3],["U",4],["V",5],["W",6],["X",7],["Y",8],["Z",9],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9]]),r=[8,7,6,5,4,3,2,10,0,9,8,7,6,5,4,3,2];let s=0;for(let a=0;a<t.length;a++){let c=e.get(t[a]);c&&(s+=c*r[a])}return s%11})(t).toString()===t[8]},checkValidMRP:function(t){if(!t||44!=t.length)return!1;const e=(t,e,r)=>{const s=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),a=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=s.get(t[n]);e&&(c+=e*a[o%3]),o++}return c%10},r=t.slice(0,10)+t.slice(13,20)+t.slice(21,43),s=e(t,0,8).toString(),a=e(t,13,18).toString(),c=e(t,21,26).toString(),n=e(t,28,41).toString(),o=e(r,0,r.length).toString();return s===t[9]&&a===t[19]&&c===t[27]&&n===t[42]&&o===t[43]},checkValidMRV:function(t){if(!t||44!=t.length&&36!=t.length)return!1;const e=(t,e,r)=>{const s=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),a=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=s.get(t[n]);e&&(c+=e*a[o%3]),o++}return c%10},r=e(t,0,8).toString(),s=e(t,13,18).toString(),a=e(t,21,26).toString();return r===t[9]&&s===t[19]&&a===t[27]},checkValidIDCard:function(t,e){if(!t||30!=t.length&&36!=t.length)return!1;const r=(t,e,r)=>{const s=new Map([["<",0],["0",0],["1",1],["2",2],["3",3],["4",4],["5",5],["6",6],["7",7],["8",8],["9",9],["A",10],["B",11],["C",12],["D",13],["E",14],["F",15],["G",16],["H",17],["I",18],["J",19],["K",20],["L",21],["M",22],["N",23],["O",24],["P",25],["Q",26],["R",27],["S",28],["T",29],["U",30],["V",31],["W",32],["X",33],["Y",34],["Z",35]]),a=[7,3,1];let c=0;for(let n=e,o=0;n<=r;n++){let e=s.get(t[n]);e&&(c+=e*a[o%3]),o++}return c%10};if(30===t.length){if(e&&t===e){return r(t,5,13).toString()===t[14]}if(e&&t!==e){const s=`${e.substring(5,30)}${t.substring(0,7)}${t.substring(8,15)}${t.substring(18,29)}`;return r(s,0,s.length-1).toString()===t[29]}}else if(36===t.length){const e=r(t,0,8).toString(),s=r(t,13,18).toString(),a=r(t,21,26).toString(),c=`${t.substring(0,10)}${t.substring(13,20)}${t.substring(21,28)}`,n=r(c,0,c.length-1).toString();return e===t[9]&&s===t[19]&&a===t[27]&&n===t[35]}}};var h;t.EnumRawTextLineStatus=void 0,(h=t.EnumRawTextLineStatus||(t.EnumRawTextLineStatus={}))[h.RTLS_LOCALIZED=0]="RTLS_LOCALIZED",h[h.RTLS_RECOGNITION_FAILED=1]="RTLS_RECOGNITION_FAILED",h[h.RTLS_RECOGNITION_SUCCEEDED=2]="RTLS_RECOGNITION_SUCCEEDED",e.mapTaskCallBack[-1]=async t=>{l.onDataLoadProgressChanged&&l.onDataLoadProgressChanged(t.resourcesPath,t.tag,{loaded:t.loaded,total:t.total})},t.LabelRecognizerModule=l,t.utilsFuncs=u}));

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

* @author Dynamsoft
* @version 3.4.20-beta-202409230244
* @version 3.4.20
* @fileoverview Dynamsoft JavaScript Library for Barcode Reader
* More info on dlr JS: https://www.dynamsoft.com/label-recognition/docs/web/programming/javascript/
*/
!function(){"use strict";let e={};const t=self;t.dlrWorkerVersion="3.4.20-beta-202409230244";const a=t.checkAndAutoLoadCaffeModel=async(t,a)=>{if(!e[t]){let r={Letter:2711347,Number:2626880,NumberLetter:2733480,NumberUppercase:2679209,Uppercase:2659096,MRZ:2681184,VIN:2679232}[t];e[t]=(async()=>{try{let s,o,n;const d=new TextDecoder,l=a+t+".data",c=await new Promise(((e,s)=>{const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onload=()=>{o.status<200||o.status>=300?e({ok:!1,status:o.status}):e({ok:!0,arrayBuffer:()=>o.response})},o.onerror=o.onabort=()=>{s({ok:!1,status:o.status})},o.onloadstart=()=>{postMessage({type:"event",id:-1,body:{loaded:0,total:r||0,tag:"starting",resourcesPath:a+t+".data"}})},o.onloadend=()=>{postMessage({type:"event",id:-1,body:{loaded:r||0,total:r||0,tag:"completed",resourcesPath:a+t+".data"}})};let n=Date.now();o.onprogress=e=>{if(e.lengthComputable&&(r=e.total),r){const t=Date.now();n+500<t&&(postMessage({type:"event",id:-1,body:{total:r,loaded:e.loaded,tag:"in progress",resourcesPath:l}}),n=t)}},o.open("GET",l,!0),o.send()}));if(!c.ok)throw new Error(`Network error. ${l} Status: ${c.status}.`);s=await c.arrayBuffer();const i=d.decode(new Uint8Array(s,0,8));if("DLR_MDL "===i){{let e=0;const t=new Uint8Array(s,8,8);for(let a=7;a>=0;--a)e=256*e+t[a];const a=d.decode(new Uint8Array(s,16,e));o=JSON.parse(a),n=16+e}let a=e=>{const t=o[e];if(!t)throw new Error(`File name '${e}' not found.`);return new Uint8Array(s,n+t[0],t[1])},r=JSON.parse(d.decode(a(t+".config.json")));const l=r.mainModel,c=r.assistModels,i=r.modelFilter;{const e=a(l+".prototxt"),r=a(l+".txt"),s=a(l+".caffemodel");ep(),wasmImports.emscripten_bind_DlrWasm_appendCaffeModelBuffer_7(es(t),setBufferIntoWasm(e,0),e.length,setBufferIntoWasm(r,1),r.length,setBufferIntoWasm(s,2),s.length)}if(c)for(let e of c){const r=t+e,s=l+e,o=a(s+".prototxt"),n=a(s+".txt"),d=a(s+".caffemodel");wasmImports.emscripten_bind_DlrWasm_appendCaffeModelBuffer_7(r,o,o.length,n,n.length,d,d.length)}if(i){const e=a(i+".txt");wasmImports.emscripten_bind_DlrWasm_appendModelFilterFileBuffer_3(t,e,e.length)}e[t]=Promise.resolve({exception:0,description:"Successful.",bModel:!0})}else{if("CDLR_MDL"!==i)throw new Error("Model data type incorrect.");{const a=new Uint8Array(s),r=[68,76,82,95,77,68,76,32];for(let e=0;e<8;e++)a[e]=r[e];let o=t;t.endsWith(".data")||(o+=".data"),ep();let n=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_DlrWasm_AppendConfusableCharactersBuffer_3(es(o),setBufferIntoWasm(a,0),a.length)));e[t]=n}}return e[t]}catch(a){throw delete e[t],a}})()}await e[t]};Object.assign(mapController,{dlr_loadData:async(t,r)=>{try{await a(t.dataName,t.dataPath);let s=await e[t.dataName];handleTaskRes(r,{success:!0,result:s})}catch(e){return void handleTaskErr(r,e)}}})}();
!function(){"use strict";let e={};const t=self;t.dlrWorkerVersion="3.4.20";const a=t.checkAndAutoLoadCaffeModel=async(t,a)=>{if(!e[t]){let r={Letter:2711347,Number:2626880,NumberLetter:2733480,NumberUppercase:2679209,Uppercase:2659096,MRZ:2681184,VIN:2679232}[t];e[t]=(async()=>{try{let s,o,n;const d=new TextDecoder,l=a+t+".data",c=await new Promise(((e,s)=>{const o=new XMLHttpRequest;o.responseType="arraybuffer",o.onload=()=>{o.status<200||o.status>=300?e({ok:!1,status:o.status}):e({ok:!0,arrayBuffer:()=>o.response})},o.onerror=o.onabort=()=>{s({ok:!1,status:o.status})},o.onloadstart=()=>{postMessage({type:"event",id:-1,body:{loaded:0,total:r||0,tag:"starting",resourcesPath:a+t+".data"}})},o.onloadend=()=>{postMessage({type:"event",id:-1,body:{loaded:r||0,total:r||0,tag:"completed",resourcesPath:a+t+".data"}})};let n=Date.now();o.onprogress=e=>{if(e.lengthComputable&&(r=e.total),r){const t=Date.now();n+500<t&&(postMessage({type:"event",id:-1,body:{total:r,loaded:e.loaded,tag:"in progress",resourcesPath:l}}),n=t)}},o.open("GET",l,!0),o.send()}));if(!c.ok)throw new Error(`Network error. ${l} Status: ${c.status}.`);s=await c.arrayBuffer();const i=d.decode(new Uint8Array(s,0,8));if("DLR_MDL "===i){{let e=0;const t=new Uint8Array(s,8,8);for(let a=7;a>=0;--a)e=256*e+t[a];const a=d.decode(new Uint8Array(s,16,e));o=JSON.parse(a),n=16+e}let a=e=>{const t=o[e];if(!t)throw new Error(`File name '${e}' not found.`);return new Uint8Array(s,n+t[0],t[1])},r=JSON.parse(d.decode(a(t+".config.json")));const l=r.mainModel,c=r.assistModels,i=r.modelFilter;{const e=a(l+".prototxt"),r=a(l+".txt"),s=a(l+".caffemodel");ep(),wasmImports.emscripten_bind_DlrWasm_appendCaffeModelBuffer_7(es(t),setBufferIntoWasm(e,0),e.length,setBufferIntoWasm(r,1),r.length,setBufferIntoWasm(s,2),s.length)}if(c)for(let e of c){const r=t+e,s=l+e,o=a(s+".prototxt"),n=a(s+".txt"),d=a(s+".caffemodel");wasmImports.emscripten_bind_DlrWasm_appendCaffeModelBuffer_7(r,o,o.length,n,n.length,d,d.length)}if(i){const e=a(i+".txt");wasmImports.emscripten_bind_DlrWasm_appendModelFilterFileBuffer_3(t,e,e.length)}e[t]=Promise.resolve({exception:0,description:"Successful.",bModel:!0})}else{if("CDLR_MDL"!==i)throw new Error("Model data type incorrect.");{const a=new Uint8Array(s),r=[68,76,82,95,77,68,76,32];for(let e=0;e<8;e++)a[e]=r[e];let o=t;t.endsWith(".data")||(o+=".data"),ep();let n=JSON.parse(UTF8ToString(wasmImports.emscripten_bind_DlrWasm_AppendConfusableCharactersBuffer_3(es(o),setBufferIntoWasm(a,0),a.length)));e[t]=n}}return e[t]}catch(a){throw delete e[t],a}})()}await e[t]};Object.assign(mapController,{dlr_loadData:async(t,r)=>{try{await a(t.dataName,t.dataPath);let s=await e[t.dataName];handleTaskRes(r,{success:!0,result:s})}catch(e){return void handleTaskErr(r,e)}}})}();
{
"name": "dynamsoft-label-recognizer",
"version": "3.4.20-beta-202409230244",
"version": "3.4.20",
"description": "Dynamsoft Label Recognizer (DLR) is an SDK designed to recognize meaningful zonal text or symbols in an image (Label). Common scenarios include price tags in supermarkets, inventory labels in warehouses, VIN codes on car windshields, driver licenses, passports, visas, ID cards, etc.",

@@ -40,3 +40,3 @@ "files": [

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

@@ -43,0 +43,0 @@ "license": "SEE LICENSE IN LICENSE",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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