@idscan/idvc2 2.12.2 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/dist/idvc.js +1 -1
- package/dist/idvc.js.gzip +0 -0
- package/dist/index.html +25 -29
- package/dist/js/defaultConfig.ts +1 -10
- package/dist/js/environment/documentTypes.ts +3 -10
- package/dist/js/environment/langs.js +1 -1
- package/dist/js/environment/stepsDescription.ts +1 -9
- package/dist/langs.js.gzip +0 -0
- package/dist/networks/Face-chunk.js +1 -1
- package/dist/networks/PDF-chunk.js +1 -1
- package/dist/types/constatnts/pdf.d.ts +1 -0
- package/dist/types/defaultConfig.d.ts +2 -1
- package/dist/types/environment/documentTypes.d.ts +3 -4
- package/dist/types/environment/langs.d.ts +6 -9
- package/dist/types/environment/stepsDescription.d.ts +1 -9
- package/dist/types/helpers/cornersCapture.d.ts +5 -0
- package/dist/types/modules/App/UI.d.ts +7 -6
- package/dist/types/modules/Config.d.ts +1 -4
- package/dist/types/modules/PdfModule.d.ts +1 -1
- package/dist/types/modules/camera/camera.d.ts +2 -1
- package/dist/types/modules/manualUploadProcessing.d.ts +20 -9
- package/dist/types/modules/step-functions/pdf.d.ts +0 -1
- package/dist/types/modules/step-result-processing/pdf.d.ts +1 -1
- package/dist/types/modules/stepFunctions.d.ts +1 -1
- package/dist/types/modules/stepResultProcessing.d.ts +1 -1
- package/dist/types/modules/ui/DocumentsList/{DocumentsList.d.ts → InitScreen.d.ts} +4 -4
- package/dist/types/modules/ui/MainScreen/MainScreen.d.ts +4 -5
- package/dist/types/modules/ui/MessageBox/MessageBox.d.ts +1 -1
- package/dist/types/modules/ui/SelectDocumentType.d.ts +3 -8
- package/dist/types/modules/ui/StepsList/{StepsList.d.ts → StepsScreen.d.ts} +2 -5
- package/dist/types/modules/ui/Uploader/UploaderUI.d.ts +1 -0
- package/dist/types/modules/ui/VideoWrapper/MaskCapture.d.ts +1 -1
- package/dist/types/modules/ui/VideoWrapper/UIHints.d.ts +2 -1
- package/dist/types/neural models/generalTypeYolo/exits.d.ts +1 -0
- package/dist/types/types/context.d.ts +2 -2
- package/dist/types/types/modules/camera.enum.d.ts +3 -1
- package/dist/types/util.d.ts +5 -18
- package/package.json +1 -1
- /package/dist/types/modules/{Spinner → Loader}/Loader.d.ts +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[596],{4550:(e,r,t)=>{t.d(r,{o:()=>c});var n=t(7885),o=t(7666);function i(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}function a(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function u(e){i(a,n,o,u,s,"next",e)}function s(e){i(a,n,o,u,s,"throw",e)}u(void 0)}))}}function u(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var s,l=(s=a((function(e){var r,t,i,a,s;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),t=Uint8Array.bind,[4,(0,o.xl)(e)];case 1:return r=new(t.apply(Uint8Array,[void 0,u.sent()])),i=(0,n.ec)(r),a=new Blob([i.buffer],{type:"application/javascript"}),[2,URL.createObjectURL(a)];case 2:throw s=u.sent(),console.error("Error loading and decompressing worker file:",s),s;case 3:return[2]}}))})),function(e){return s.apply(this,arguments)}),c=function(){var e=a((function(e){var r;return u(this,(function(t){switch(t.label){case 0:return[4,l(e)];case 1:return r=t.sent(),[2,new Worker(r)]}}))}));return function(r){return e.apply(this,arguments)}}()},8766:(e,r,t)=>{t.r(r),t.d(r,{default:()=>k});var n=t(4328),o=t(6399);function i(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function a(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}function u(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var i=e.apply(r,t);function u(e){a(i,n,o,u,s,"next",e)}function s(e){a(i,n,o,u,s,"throw",e)}u(void 0)}))}}function s(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function c(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i=[],a=!0,u=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(u)throw o}}return i}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return i(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var d=function(){function e(r,t,n){var o=this;!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,"module",void 0),l(this,"handle",null),l(this,"bw",0),l(this,"bh",0),l(this,"src",null),l(this,"out",null),l(this,"isAllocate",!1),l(this,"worker",void 0),l(this,"isProcessing",!1),l(this,"isInitialized",!1),l(this,"successCount",0),l(this,"pdfCapturedCount",0),l(this,"src2",null),l(this,"locations",null),l(this,"pdfCount",0),l(this,"geometry",void 0),l(this,"minPDFframes",1),l(this,"cropSizes",void 0),l(this,"canvasSizes",void 0),l(this,"privateErrorId",0),this.worker=r,this.worker.onmessage=function(e){var r=e.data,t=r.name,n=r.data;"initialization"===t&&(o.isInitialized=n)},this.worker.postMessage({fn:"init",key:t,isNeedToLoadPDFWIthPreprocess:n})}var r,t,n;return r=e,(t=[{key:"errorId",get:function(){return this.privateErrorId},set:function(e){this.privateErrorId=[o.l.Detected,o.l.Decoded].includes(e)?0:e}},{key:"errorVal",get:function(){var e;return this.errorId===o.l.LicenseKeyHasExpired&&(e=0),this.errorId===o.l.InvalidLicenseKey&&(e=1),e}},{key:"init",value:function(e,r,t,n){this.geometry=e,this.minPDFframes=r,this.cropSizes=t,this.canvasSizes=n}},{key:"licenseError",value:function(){return{error:!0,errorType:"licenceKeyError",errorVal:this.errorVal}}},{key:"create",value:function(){}},{key:"setSizes",value:function(e,r){this.bw=e,this.bh=r,this.worker.postMessage({fn:"setSizes",bw:e,bh:r})}},{key:"allocate",value:function(){this.worker.postMessage({fn:"allocate"})}},{key:"drawCords",value:function(e){var r=this,t=[];if(e){var n=[];Object.entries(e).forEach((function(e){var t=c(e,2),o=t[0],i=t[1],a=Math.trunc(i),u=o[0],s=+o[1]-1;n[s]||(n[s]={x:0,y:0}),"x"===u?n[s].x=r.canvasSizes.width*a/r.bw:n[s].y=r.canvasSizes.height*a/r.bh}));var o=[n[3].x-n[0].x,n[3].y-n[0].y],i=[n[1].x-n[0].x,n[1].y-n[0].y],a=[n[2].x-n[1].x,n[2].y-n[1].y],u=[n[3].x-n[2].x,n[3].y-n[2].y],s=this.geometry.angleBetweenTwoVectors(o,i),l=this.geometry.angleBetweenTwoVectors(a,u);s<=100&&s>=80&&l<=100&&l>=80&&(t=n)}return t}},{key:"processPDF",value:function(e){var r=this;return u((function(){var t,n;return f(this,(function(i){switch(i.label){case 0:return r.isProcessing?[2,{}]:(t={status:!1,predict:!1,touch:!1,type:"pdf",error:null,coords:[],trackString:"",pdfSuccessCount:0,pdfCount:0,isSuccessProcess:!1,pdfCapturedCount:0},r.isInitialized?(r.isProcessing=!0,[4,r.readPDF(e)]):[2,t]);case 1:return(n=i.sent()).error?(r.isProcessing=!1,t.error=n,[2,t]):(n&&"status"in n&&(n.status.value===o.l.Detected&&(r.pdfCapturedCount+=1),n.status.value===o.l.Detected||n.status.value===o.l.Decoded?(t.coords=r.drawCords(n.location),t.isSuccessProcess=!0):(r.successCount+=1,r.drawCords(null)),n.status.value===o.l.Decoded?(r.pdfCount+=1,r.pdfCount>=r.minPDFframes&&(r.successCount=0,r.pdfCapturedCount=0,r.pdfCount=0,t.trackString=n.trackString||n.data||"",t.status=!0,t.pdfCapturedCount=0)):r.pdfCount=0),t.pdfSuccessCount=r.successCount,t.pdfCount=r.pdfCount,t.pdfCapturedCount=r.pdfCapturedCount,r.isProcessing=!1,[2,t])}}))}))()}},{key:"processPDFWithPreProcess",value:function(e){var r=this;return new Promise((function(t){r.worker.onmessage=function(e){var n=e.data,o=n.name,i=n.data;if("result"===o){var a;r.errorId=null==i||null===(a=i.status)||void 0===a?void 0:a.value;var u=r.errorId?r.licenseError():null;t(u||i)}else t(i)},r.worker.postMessage({fn:"pdfWithPreProcess",iData:e})}))}},{key:"readPDF",value:function(e){var r=this;return u((function(){return f(this,(function(t){return[2,new Promise((function(t){r.worker.onmessage=function(e){var n=e.data,o=n.name,i=n.data,a=n.bw,u=n.bh;if("ready"===o)r.worker.postMessage({fn:"process"});else if("result"===o){var s;r.errorId=null==i||null===(s=i.status)||void 0===s?void 0:s.value;var l=(r.errorId?r.licenseError():null)||i;r.bw=a,r.bh=u,t(l)}else t(i)},r.worker.postMessage({fn:"prepare",iData:e})}))]}))}))()}}])&&s(r.prototype,t),n&&s(r,n),e}();var p,h,y=t(7286),v=t(4550);function b(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function w(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}function m(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i=[],a=!0,u=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(u)throw o}}return i}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return b(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return b(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}const k=(p=function(e){var r,t,o,i;return g(this,(function(a){switch(a.label){case 0:return r=e.pdf417key,t=!!Object.entries(n.Z.config.documentTypes).find((function(e){var r=m(e,2);return r[0],r[1].find((function(e){return("pdf"===e.type||"back"===e.type)&&e.mode.uploader}))})),[4,(0,v.o)("".concat(n.Z.chunkPublicPath,"pdfWorker.js.gzip"))];case 1:return o=a.sent(),i=new d(o,r,t),y.Z.setModule("module","pdf",i),[2]}}))},h=function(){var e=this,r=arguments;return new Promise((function(t,n){var o=p.apply(e,r);function i(e){w(o,t,n,i,a,"next",e)}function a(e){w(o,t,n,i,a,"throw",e)}i(void 0)}))},function(e){return h.apply(this,arguments)})}}]);
|
|
1
|
+
(self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[596],{4550:(e,r,t)=>{t.d(r,{o:()=>c});var n=t(7885),o=t(7666);function i(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}function a(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var a=e.apply(r,t);function u(e){i(a,n,o,u,s,"next",e)}function s(e){i(a,n,o,u,s,"throw",e)}u(void 0)}))}}function u(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var s,l=(s=a((function(e){var r,t,i,a,s;return u(this,(function(u){switch(u.label){case 0:return u.trys.push([0,2,,3]),t=Uint8Array.bind,[4,(0,o.xl)(e)];case 1:return r=new(t.apply(Uint8Array,[void 0,u.sent()])),i=(0,n.ec)(r),a=new Blob([i.buffer],{type:"application/javascript"}),[2,URL.createObjectURL(a)];case 2:throw s=u.sent(),console.error("Error loading and decompressing worker file:",s),s;case 3:return[2]}}))})),function(e){return s.apply(this,arguments)}),c=function(){var e=a((function(e){var r;return u(this,(function(t){switch(t.label){case 0:return[4,l(e)];case 1:return r=t.sent(),[2,new Worker(r)]}}))}));return function(r){return e.apply(this,arguments)}}()},8766:(e,r,t)=>{t.r(r),t.d(r,{default:()=>k});var n=t(4328),o=t(6399);function i(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function a(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}function u(e){return function(){var r=this,t=arguments;return new Promise((function(n,o){var i=e.apply(r,t);function u(e){a(i,n,o,u,s,"next",e)}function s(e){a(i,n,o,u,s,"throw",e)}u(void 0)}))}}function s(e,r){for(var t=0;t<r.length;t++){var n=r[t];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function l(e,r,t){return r in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function c(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i=[],a=!0,u=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(u)throw o}}return i}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return i(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return i(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var d=function(){function e(r,t,n){var o=this;!function(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}(this,e),l(this,"module",void 0),l(this,"handle",null),l(this,"bw",0),l(this,"bh",0),l(this,"src",null),l(this,"out",null),l(this,"isAllocate",!1),l(this,"worker",void 0),l(this,"isProcessing",!1),l(this,"isInitialized",!1),l(this,"successCount",0),l(this,"pdfCapturedCount",0),l(this,"src2",null),l(this,"locations",null),l(this,"pdfCount",0),l(this,"geometry",void 0),l(this,"minPDFframes",1),l(this,"cropSizes",void 0),l(this,"canvasSizes",void 0),l(this,"privateErrorId",0),this.worker=r,this.worker.onmessage=function(e){var r=e.data,t=r.name,n=r.data;"initialization"===t&&(o.isInitialized=n)},this.worker.postMessage({fn:"init",key:t,isNeedToLoadPDFWIthPreprocess:n})}var r,t,n;return r=e,(t=[{key:"errorId",get:function(){return this.privateErrorId},set:function(e){this.privateErrorId=[o.l.Detected,o.l.Decoded].includes(e)?0:e}},{key:"errorVal",get:function(){var e;return this.errorId===o.l.LicenseKeyHasExpired&&(e=0),this.errorId===o.l.InvalidLicenseKey&&(e=1),e}},{key:"init",value:function(e,r,t,n){this.geometry=e,this.minPDFframes=r,this.cropSizes=t,this.canvasSizes=n}},{key:"licenseError",value:function(){return{error:!0,errorType:"licenceKeyError",errorVal:this.errorVal}}},{key:"create",value:function(){}},{key:"setSizes",value:function(e,r){this.bw=e,this.bh=r,this.worker.postMessage({fn:"setSizes",bw:e,bh:r})}},{key:"allocate",value:function(){this.worker.postMessage({fn:"allocate"})}},{key:"calculateCords",value:function(e){var r=this,t=[];if(e){var n=[];Object.entries(e).forEach((function(e){var t=c(e,2),o=t[0],i=t[1],a=Math.trunc(i),u=o[0],s=+o[1]-1;n[s]||(n[s]={x:0,y:0}),"x"===u?n[s].x=r.canvasSizes.width*a/r.bw:n[s].y=r.canvasSizes.height*a/r.bh}));var o=[n[3].x-n[0].x,n[3].y-n[0].y],i=[n[1].x-n[0].x,n[1].y-n[0].y],a=[n[2].x-n[1].x,n[2].y-n[1].y],u=[n[3].x-n[2].x,n[3].y-n[2].y],s=this.geometry.angleBetweenTwoVectors(o,i),l=this.geometry.angleBetweenTwoVectors(a,u);s<=100&&s>=80&&l<=100&&l>=80&&(t=n)}return t}},{key:"processPDF",value:function(e){var r=this;return u((function(){var t,n;return f(this,(function(i){switch(i.label){case 0:return r.isProcessing?[2,{}]:(t={status:!1,predict:!1,touch:!1,image:null,type:"pdf",error:null,coords:[],trackString:"",pdfSuccessCount:0,pdfCount:0,isSuccessProcess:!1,pdfCapturedCount:0},r.isInitialized?(r.isProcessing=!0,[4,r.readPDF(e)]):[2,t]);case 1:return(n=i.sent()).error?(r.isProcessing=!1,t.error=n,[2,t]):(n&&"status"in n&&(n.status.value===o.l.Detected&&(r.pdfCapturedCount+=1),n.status.value===o.l.Detected||n.status.value===o.l.Decoded?(t.coords=r.calculateCords(n.location),t.isSuccessProcess=!0):(r.successCount+=1,r.calculateCords(null)),n.status.value===o.l.Decoded?(r.pdfCount+=1,r.pdfCount>=r.minPDFframes&&(r.successCount=0,r.pdfCapturedCount=0,r.pdfCount=0,t.trackString=n.trackString||n.data||"",t.status=!0,t.image=e,t.pdfCapturedCount=0)):r.pdfCount=0),t.pdfSuccessCount=r.successCount,t.pdfCount=r.pdfCount,t.pdfCapturedCount=r.pdfCapturedCount,r.isProcessing=!1,[2,t])}}))}))()}},{key:"processPDFWithPreProcess",value:function(e){var r=this;return new Promise((function(t){r.worker.onmessage=function(e){var n=e.data,o=n.name,i=n.data;if("result"===o){var a;r.errorId=null==i||null===(a=i.status)||void 0===a?void 0:a.value;var u=r.errorId?r.licenseError():null;t(u||i)}else t(i)},r.worker.postMessage({fn:"pdfWithPreProcess",iData:e})}))}},{key:"readPDF",value:function(e){var r=this;return u((function(){return f(this,(function(t){return[2,new Promise((function(t){r.worker.onmessage=function(e){var n=e.data,o=n.name,i=n.data,a=n.bw,u=n.bh;if("ready"===o)r.worker.postMessage({fn:"process"});else if("result"===o){var s;r.errorId=null==i||null===(s=i.status)||void 0===s?void 0:s.value;var l=(r.errorId?r.licenseError():null)||i;r.bw=a,r.bh=u,t(l)}else t(i)},r.worker.postMessage({fn:"prepare",iData:e})}))]}))}))()}}])&&s(r.prototype,t),n&&s(r,n),e}();var p,h,y=t(7286),v=t(4550);function b(e,r){(null==r||r>e.length)&&(r=e.length);for(var t=0,n=new Array(r);t<r;t++)n[t]=e[t];return n}function w(e,r,t,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){return void t(e)}u.done?r(s):Promise.resolve(s).then(n,o)}function m(e,r){return function(e){if(Array.isArray(e))return e}(e)||function(e,r){var t=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=t){var n,o,i=[],a=!0,u=!1;try{for(t=t.call(e);!(a=(n=t.next()).done)&&(i.push(n.value),!r||i.length!==r);a=!0);}catch(e){u=!0,o=e}finally{try{a||null==t.return||t.return()}finally{if(u)throw o}}return i}}(e,r)||function(e,r){if(!e)return;if("string"==typeof e)return b(e,r);var t=Object.prototype.toString.call(e).slice(8,-1);"Object"===t&&e.constructor&&(t=e.constructor.name);if("Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return b(e,r)}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,r){var t,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(t)throw new TypeError("Generator is already executing.");for(;a;)try{if(t=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,n=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=r.call(e,a)}catch(e){i=[6,e],n=0}finally{t=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}const k=(p=function(e){var r,t,o,i;return g(this,(function(a){switch(a.label){case 0:return r=e.pdf417key,t=!!Object.entries(n.Z.config.documentTypes).find((function(e){var r=m(e,2);return r[0],r[1].find((function(e){return("pdf"===e.type||"back"===e.type)&&e.mode.uploader}))})),[4,(0,v.o)("".concat(n.Z.chunkPublicPath,"pdfWorker.js.gzip"))];case 1:return o=a.sent(),i=new d(o,r,t),y.Z.setModule("module","pdf",i),[2]}}))},h=function(){var e=this,r=arguments;return new Promise((function(t,n){var o=p.apply(e,r);function i(e){w(o,t,n,i,a,"next",e)}function a(e){w(o,t,n,i,a,"throw",e)}i(void 0)}))},function(e){return h.apply(this,arguments)})}}]);
|
|
@@ -21,6 +21,7 @@ export type StepConfig = {
|
|
|
21
21
|
mode: StepMode;
|
|
22
22
|
autocaptureDelay?: number;
|
|
23
23
|
enableDesktopNotification?: boolean;
|
|
24
|
+
enableFourCornerCapture?: boolean;
|
|
24
25
|
};
|
|
25
26
|
export type DocumentType = {
|
|
26
27
|
type: DocumentTypeName;
|
|
@@ -28,7 +29,7 @@ export type DocumentType = {
|
|
|
28
29
|
mode?: StepMode;
|
|
29
30
|
};
|
|
30
31
|
type ImageURI = 'png' | 'jpeg' | 'webp';
|
|
31
|
-
export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'chunkPublicPath' | 'language' | 'documentTypes' | 'realFaceMode' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'isShowDocumentTypeSelect' | 'useCDN' | 'processingImageFormat' | 'allowSubmitWithWarnings' | 'autoContinue' | 'autoStart' | 'playPreviewAnimations' | 'autocaptureDelay' | 'isShowGuidelinesButton' | 'fixFrontOrientAfterUpload' | 'captureTimeout' | '
|
|
32
|
+
export type DefaultConfigName = 'el' | 'licenseKey' | 'networkUrl' | 'chunkPublicPath' | 'language' | 'documentTypes' | 'realFaceMode' | 'modalPosition' | 'resizeUploadedImage' | 'showSubmitBtn' | 'isShowDocumentTypeSelect' | 'useCDN' | 'processingImageFormat' | 'allowSubmitWithWarnings' | 'autoContinue' | 'autoStart' | 'playPreviewAnimations' | 'autocaptureDelay' | 'isShowGuidelinesButton' | 'fixFrontOrientAfterUpload' | 'captureTimeout' | 'onCaptureTimeout' | 'onChange' | 'onReset' | 'submit' | 'onRetakeHook' | 'onCameraError' | 'onMounted' | 'onReloaded';
|
|
32
33
|
/**
|
|
33
34
|
* IDefaultConfig
|
|
34
35
|
* @param {string} name,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export type DocumentTypeIndex = 1 | 2 | 3 | 6 | 7 |
|
|
2
|
-
export type DocumentTypeName = 'ID' | 'Passport' | 'PassportCard' | 'GreenCard' | 'InternationalId' | '
|
|
3
|
-
export type HumanName = 'Driver\'s License or State Identification Card' | 'Passport' | 'US Passport Card' | 'Green Card' | 'International ID' | '
|
|
1
|
+
export type DocumentTypeIndex = 1 | 2 | 3 | 6 | 7 | 9 | 10 | 11;
|
|
2
|
+
export type DocumentTypeName = 'ID' | 'Passport' | 'PassportCard' | 'GreenCard' | 'InternationalId' | 'Barcode' | 'FaceAuthorization' | 'EmploymentAuthorization';
|
|
3
|
+
export type HumanName = 'Driver\'s License or State Identification Card' | 'Passport' | 'US Passport Card' | 'Green Card' | 'International ID' | '1-D and 2-D Barcodes' | 'Face Authorization' | 'Employment Authorization';
|
|
4
4
|
export type ImageSource = 'video' | 'file';
|
|
5
5
|
export declare enum DocumentTypeIDs {
|
|
6
6
|
'ID' = 1,
|
|
@@ -8,7 +8,6 @@ export declare enum DocumentTypeIDs {
|
|
|
8
8
|
'PassportCard' = 3,
|
|
9
9
|
'GreenCard' = 6,
|
|
10
10
|
'InternationalId' = 7,
|
|
11
|
-
'VIN' = 8,
|
|
12
11
|
'Barcode' = 11,
|
|
13
12
|
'FaceAuthorization' = 10,
|
|
14
13
|
'EmploymentAuthorization' = 9
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CameraNotSupportedReason } from '../types/modules/camera.enum';
|
|
2
|
-
type LabelGroup = 'errorCodes' | 'hintTexts' | 'keyErrors' | 'camera' | 'general' | 'uploaderDescription' | 'documentsTypes' | '
|
|
2
|
+
type LabelGroup = 'errorCodes' | 'hintTexts' | 'keyErrors' | 'camera' | 'general' | 'uploaderDescription' | 'documentsTypes' | 'loaderText';
|
|
3
3
|
type AllTypes = IErrorCodes | IHintTexts | KeyError | ICameraLabels | IGeneral | IDocumentsTypes | IUploaderDescription | ISpinnerText;
|
|
4
4
|
type Label = Record<LabelGroup, AllTypes>;
|
|
5
5
|
type KeyError = string[];
|
|
@@ -10,7 +10,7 @@ type GetTranslation = {
|
|
|
10
10
|
(groupName: 'keyErrors'): KeyError;
|
|
11
11
|
(groupName: 'camera'): ICameraLabels;
|
|
12
12
|
(groupName: 'general'): IGeneral;
|
|
13
|
-
(groupName: '
|
|
13
|
+
(groupName: 'loaderText'): ISpinnerText;
|
|
14
14
|
(groupName: LabelGroup): AllTypes;
|
|
15
15
|
};
|
|
16
16
|
export type ErrorCodeNames = 'mrzNotFound' | 'mrzNotRecognized' | 'barcodeNotFound' | 'barcodeNotRecognized' | 'heic' | 'fileType' | 'fileTypeHeic' | 'faceNotFound' | 'disableStepFileUpload' | 'notAllowedDocument' | 'documentSideLowPerimeter' | 'faceOnFrontNotDetected' | 'frontSideNotDetected' | 'backSideNotDetected' | 'default' | 'lowImageResolution' | 'imageIsBlurred' | 'faceLowArea' | 'disabledManualUpload' | keyof typeof CameraNotSupportedReason;
|
|
@@ -36,6 +36,7 @@ interface IHintTexts {
|
|
|
36
36
|
capture: {
|
|
37
37
|
pdf: string;
|
|
38
38
|
mrz: string;
|
|
39
|
+
back: string;
|
|
39
40
|
};
|
|
40
41
|
dontSee: string;
|
|
41
42
|
dontMove: string;
|
|
@@ -65,7 +66,6 @@ interface IGeneral {
|
|
|
65
66
|
face: string;
|
|
66
67
|
barcode: string;
|
|
67
68
|
back: string;
|
|
68
|
-
photo: string;
|
|
69
69
|
awaiting: string;
|
|
70
70
|
notificationStepSuccess: string;
|
|
71
71
|
notificationStepWarning: string;
|
|
@@ -75,10 +75,7 @@ interface IGeneral {
|
|
|
75
75
|
notificationSubmit: string;
|
|
76
76
|
notificationCaptureHook: string;
|
|
77
77
|
notificationCaptureSide: string;
|
|
78
|
-
|
|
79
|
-
top: string;
|
|
80
|
-
bottom: string;
|
|
81
|
-
};
|
|
78
|
+
idvcVersionPlank: string;
|
|
82
79
|
submitProcessSpinner: {
|
|
83
80
|
top: string;
|
|
84
81
|
bottom: string;
|
|
@@ -102,6 +99,8 @@ interface IGeneral {
|
|
|
102
99
|
};
|
|
103
100
|
messageBox: {
|
|
104
101
|
default: string;
|
|
102
|
+
changeDocumentTypeText: string;
|
|
103
|
+
documentTypeText: string;
|
|
105
104
|
};
|
|
106
105
|
controlButtons: {
|
|
107
106
|
upload: string;
|
|
@@ -121,7 +120,6 @@ interface IGeneral {
|
|
|
121
120
|
};
|
|
122
121
|
documentType: string;
|
|
123
122
|
selectDocumentTypeText: string;
|
|
124
|
-
changeDocumentTypeText: string;
|
|
125
123
|
changeBtn: string;
|
|
126
124
|
correctBtn: string;
|
|
127
125
|
cancelBtn: string;
|
|
@@ -143,7 +141,6 @@ interface IDocumentsTypes {
|
|
|
143
141
|
GreenCard: string;
|
|
144
142
|
EmploymentAuthorization: string;
|
|
145
143
|
InternationalId: string;
|
|
146
|
-
VIN: string;
|
|
147
144
|
Barcode: string;
|
|
148
145
|
FaceAuthorization: string;
|
|
149
146
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type StepType = 'mrz' | 'front' | 'pdf' | 'face' | 'barcode' | '
|
|
1
|
+
export type StepType = 'mrz' | 'front' | 'pdf' | 'face' | 'barcode' | 'back';
|
|
2
2
|
export type StepTypeImageName = StepType | 'mrzFront';
|
|
3
3
|
declare const _default: {
|
|
4
4
|
mrz: {
|
|
@@ -43,14 +43,6 @@ declare const _default: {
|
|
|
43
43
|
core: string[];
|
|
44
44
|
description: string;
|
|
45
45
|
};
|
|
46
|
-
photo: {
|
|
47
|
-
id: number;
|
|
48
|
-
camera: string;
|
|
49
|
-
name: string;
|
|
50
|
-
time: number;
|
|
51
|
-
core: any[];
|
|
52
|
-
description: string;
|
|
53
|
-
};
|
|
54
46
|
back: {
|
|
55
47
|
id: number;
|
|
56
48
|
camera: string;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { StepType } from '../environment/stepsDescription';
|
|
2
|
+
export declare const res: Record<string, any>;
|
|
3
|
+
export declare const dropCapturedState: () => void;
|
|
4
|
+
export declare const captureFrameWithCorners: (isValidDocument: boolean, stepType?: StepType) => Promise<void>;
|
|
5
|
+
export declare const dropCaptureProgress: () => void;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { MainScreen } from '../ui/MainScreen/MainScreen';
|
|
2
2
|
import { Size } from '../../helpers/image';
|
|
3
|
-
import { Loader } from '../
|
|
3
|
+
import { Loader } from '../Loader/Loader';
|
|
4
4
|
import SelectDocumentType from '../ui/SelectDocumentType';
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { InitScreen } from '../ui/DocumentsList/InitScreen';
|
|
6
|
+
import { StepsScreen } from '../ui/StepsList/StepsScreen';
|
|
7
7
|
import { IDVCVersionPlank } from '../ui/IDVCVersionPlank/IDVCVersionPlank';
|
|
8
8
|
import { AnimationSettings, Notification, NotificationState } from '../ui/Notification/Notification';
|
|
9
9
|
import type { Context } from '../../types/context';
|
|
@@ -12,10 +12,11 @@ export declare class WeblibUI {
|
|
|
12
12
|
mainScreen: MainScreen;
|
|
13
13
|
loader: Loader;
|
|
14
14
|
selectDocumentType: SelectDocumentType;
|
|
15
|
-
initScreen:
|
|
16
|
-
stepsScreen:
|
|
15
|
+
initScreen: InitScreen;
|
|
16
|
+
stepsScreen: StepsScreen;
|
|
17
17
|
idvcVersionContainer: IDVCVersionPlank;
|
|
18
18
|
constructor(mountElement: HTMLElement);
|
|
19
|
+
remountUI(): void;
|
|
19
20
|
createNotification(notificationContainer: HTMLElement, { status, message, }: NotificationState, animationSettings: AnimationSettings): Notification;
|
|
20
21
|
updateResetButton({ steps, }: Context): void;
|
|
21
22
|
updateControlButtons({ steps, config, }: Context): void;
|
|
@@ -24,7 +25,7 @@ export declare class WeblibUI {
|
|
|
24
25
|
resizeBorders(): void;
|
|
25
26
|
setResizedCanvasSizes({ width, height }: Size): void;
|
|
26
27
|
showMainScreen(): void;
|
|
27
|
-
|
|
28
|
+
showStepsScreen(): void;
|
|
28
29
|
private setFaceOffsets;
|
|
29
30
|
private setCropFace;
|
|
30
31
|
private initMainScreenComponents;
|
|
@@ -39,7 +39,6 @@ export interface IConfig {
|
|
|
39
39
|
* - PassportCard (3) – with 3 lines MRZ (most European IDs, USA passports/cards)
|
|
40
40
|
* - GreenCard (6) – USA Permanent Resident Cards (only MRZ)
|
|
41
41
|
* - InternationalId (7) – Internationally approved U.S. IDs with 3 lines MRZ
|
|
42
|
-
* - VIN (8) – Vehicle Identification Numbers
|
|
43
42
|
* - Barcode (9) – 1-D and 2-D barcodes
|
|
44
43
|
*
|
|
45
44
|
* Available Step Types
|
|
@@ -49,7 +48,7 @@ export interface IConfig {
|
|
|
49
48
|
* - pdf – detection and capturing of pdf417 of a document
|
|
50
49
|
* - face – detection and capturing of the end user's face using the front camera
|
|
51
50
|
* - barcode – detection and capturing of 1 dimensional (barcodes) or 2 dimensional (qr codes)
|
|
52
|
-
* -
|
|
51
|
+
* - back - capturing the back side of a document
|
|
53
52
|
*
|
|
54
53
|
* Available Capture Mode
|
|
55
54
|
*
|
|
@@ -107,8 +106,6 @@ export interface IConfig {
|
|
|
107
106
|
* This option allows you to set a timer in seconds, how long after the start of video capture the hook 'onCaptureTimeout' will be triggered.
|
|
108
107
|
*/
|
|
109
108
|
captureTimeout?: number;
|
|
110
|
-
/** callback-function which will be called after guidelines button. */
|
|
111
|
-
clickGuidlines?: () => void;
|
|
112
109
|
/**
|
|
113
110
|
* function will be called after the user failed to capture the document from the camera
|
|
114
111
|
* in the time specified by the 'captureTimeout' option
|
|
@@ -47,7 +47,7 @@ export declare class PdfModule {
|
|
|
47
47
|
create(): void;
|
|
48
48
|
setSizes(bw: any, bh: any): void;
|
|
49
49
|
allocate(): void;
|
|
50
|
-
|
|
50
|
+
calculateCords(locations: PDFLocation): Coordinate[];
|
|
51
51
|
processPDF(data: ImageData): Promise<Record<string, any>>;
|
|
52
52
|
processPDFWithPreProcess(iData: ImageData): Promise<unknown>;
|
|
53
53
|
readPDF(iData: any): Promise<unknown>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { CameraError } from '../initErrorHandler';
|
|
1
2
|
import { Size } from '../../helpers/image';
|
|
2
3
|
export declare const stopTrack: () => void;
|
|
3
|
-
export declare const cameraErrorHandling: (err: Error) => Promise<never>;
|
|
4
|
+
export declare const cameraErrorHandling: (err: Error | CameraError) => Promise<never>;
|
|
4
5
|
declare const _default: {
|
|
5
6
|
initUploader: () => Promise<void>;
|
|
6
7
|
stopTrack: () => void;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Base64Image } from '../helpers/image';
|
|
2
|
+
import type { ErrorCodeNames } from '../environment/langs';
|
|
3
|
+
type ProcessingErrorCode = ErrorCodeNames | '';
|
|
2
4
|
type Coordinate = {
|
|
3
5
|
x: number;
|
|
4
6
|
y: number;
|
|
@@ -9,19 +11,28 @@ export type MRZLocation = {
|
|
|
9
11
|
rightBottom: Coordinate;
|
|
10
12
|
leftBottom: Coordinate;
|
|
11
13
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
export declare const pdfProcess: (smallImage:
|
|
14
|
+
export declare const setProcessingErrorCode: (errorCode: ProcessingErrorCode) => void;
|
|
15
|
+
export declare const mrzProcess: (smallImage: ImageData, { side, perimeter, isHasFace }: {
|
|
16
|
+
side: any;
|
|
17
|
+
perimeter: any;
|
|
18
|
+
isHasFace: any;
|
|
19
|
+
}) => Promise<boolean>;
|
|
20
|
+
export declare const pdfProcess: (smallImage: any, { perimeter }: {
|
|
21
|
+
perimeter: any;
|
|
22
|
+
}) => Promise<boolean>;
|
|
19
23
|
/**
|
|
20
24
|
*
|
|
21
25
|
* @param {Base64Image} data - base64 image
|
|
22
26
|
*/
|
|
23
27
|
export declare const barCodeProcess: (data: Base64Image) => Promise<boolean>;
|
|
24
|
-
export declare const frontProcess: (
|
|
28
|
+
export declare const frontProcess: ({ side, perimeter, isHasFace }: {
|
|
29
|
+
side: any;
|
|
30
|
+
perimeter: any;
|
|
31
|
+
isHasFace: any;
|
|
32
|
+
}) => Promise<boolean>;
|
|
25
33
|
export declare const faceProcess: (smallImage: ImageData) => Promise<boolean>;
|
|
26
|
-
export declare const backProcess: (smallImage: ImageData
|
|
34
|
+
export declare const backProcess: (smallImage: ImageData, { side, perimeter }: {
|
|
35
|
+
side: any;
|
|
36
|
+
perimeter: any;
|
|
37
|
+
}) => Promise<boolean>;
|
|
27
38
|
export {};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: (resultObject: any) => void
|
|
1
|
+
declare const _default: (resultObject: any) => Promise<void>;
|
|
2
2
|
export default _default;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
type ModuleNames = 'mrz' | 'pdf' | 'face' | 'front' | 'barcode';
|
|
2
|
-
type FunctionNames = ModuleNames | '
|
|
2
|
+
type FunctionNames = ModuleNames | 'back';
|
|
3
3
|
declare const stepFunctionWrapper: (functionName: FunctionNames, ...args: any[]) => any;
|
|
4
4
|
export declare const isStepFunctionExist: (functionName: FunctionNames) => boolean;
|
|
5
5
|
export default stepFunctionWrapper;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
hasFn: (fnName: string) => boolean;
|
|
3
|
-
pdf: (resultObject: any) => void
|
|
3
|
+
pdf: (resultObject: any) => Promise<void>;
|
|
4
4
|
mrz: (resultObject: any) => void;
|
|
5
5
|
SimpleFace: (resultObject: any) => void;
|
|
6
6
|
VolumeFace: (resultObject: import("../types/modules/realFace").RealFaceResultObject) => void;
|
|
@@ -6,15 +6,15 @@ type DocumentState = {
|
|
|
6
6
|
humanName: HumanName;
|
|
7
7
|
id: 0 | DocumentTypeIndex;
|
|
8
8
|
};
|
|
9
|
-
export type
|
|
9
|
+
export type InitScreenState = {
|
|
10
10
|
documents: DocumentState[];
|
|
11
11
|
isHidden: boolean;
|
|
12
12
|
};
|
|
13
|
-
export type
|
|
13
|
+
export type InitScreenEvents = {
|
|
14
14
|
onDocumentClick?: (res: DocumentSelectEvent) => void;
|
|
15
15
|
};
|
|
16
|
-
export declare class
|
|
17
|
-
constructor(mountElement: any, state:
|
|
16
|
+
export declare class InitScreen extends Component<InitScreenState> {
|
|
17
|
+
constructor(mountElement: any, state: InitScreenState, events?: InitScreenEvents);
|
|
18
18
|
protected addEventListeners(): void;
|
|
19
19
|
private addDocumentClickListener;
|
|
20
20
|
}
|
|
@@ -10,9 +10,8 @@ import { DesktopNotification, DesktopNotificationVisibility } from '../DesktopNo
|
|
|
10
10
|
import { LoaderUI } from '../Spinner/LoaderUI';
|
|
11
11
|
import { Component, StateBase } from '../Component';
|
|
12
12
|
import type { Context } from '../../../types/context';
|
|
13
|
-
import
|
|
13
|
+
import { DocumentTypeIndex, DocumentTypeName } from '../../../environment/documentTypes';
|
|
14
14
|
import { Slider } from '../../Slider';
|
|
15
|
-
import { HintType, MaskType } from '../VideoWrapper/MaskCapture';
|
|
16
15
|
export type MainScreenUIEvents = {
|
|
17
16
|
onSwitch: (event: CustomEvent) => void;
|
|
18
17
|
onCardClick: (event: CustomEvent) => void;
|
|
@@ -58,9 +57,9 @@ export declare class MainScreen {
|
|
|
58
57
|
currentStepType: StepType;
|
|
59
58
|
type: DocumentTypeIndex | 0;
|
|
60
59
|
}): void;
|
|
61
|
-
updateMaskCapture(currentStepType: StepType, type: DocumentTypeIndex,
|
|
62
|
-
changeMaskType(
|
|
63
|
-
showMaskHint(currentStepType: StepType, currentDocument: DocumentTypeIndex,
|
|
60
|
+
updateMaskCapture(currentStepType: StepType, type: DocumentTypeIndex, enableFourCornerCapture: boolean): void;
|
|
61
|
+
changeMaskType(currentStepType: StepType): void;
|
|
62
|
+
showMaskHint(currentStepType: StepType, currentDocument: DocumentTypeIndex, enableFourCornerCapture: boolean): void;
|
|
64
63
|
updateKeyError(licenseKeyError: string): void;
|
|
65
64
|
resetState(): void;
|
|
66
65
|
initSteps(steps: Step[], currentDocument: DocumentTypeName | ''): void;
|
|
@@ -9,7 +9,7 @@ type MessageBoxState = {
|
|
|
9
9
|
text?: string;
|
|
10
10
|
};
|
|
11
11
|
export declare class MessageBox extends Component<MessageBoxState> {
|
|
12
|
-
private
|
|
12
|
+
private clickHandler;
|
|
13
13
|
constructor(mountElement: any, state: MessageBoxState, events?: any);
|
|
14
14
|
get type(): MessageBoxType;
|
|
15
15
|
/**
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import Modal from './Modal';
|
|
2
|
-
import { DocumentRecord,
|
|
2
|
+
import { DocumentRecord, DocumentTypeName } from '../../environment/documentTypes';
|
|
3
3
|
import { ModalPositionKeys } from '../../environment/modalPosition';
|
|
4
|
-
interface DocumentTypeElement {
|
|
5
|
-
name: DocumentTypeName;
|
|
6
|
-
element: HTMLLabelElement;
|
|
7
|
-
id: DocumentTypeIndex;
|
|
8
|
-
nName?: string;
|
|
9
|
-
}
|
|
10
4
|
interface ILoader {
|
|
11
5
|
addState: () => void;
|
|
12
6
|
showLoader: () => void;
|
|
@@ -15,7 +9,8 @@ interface ILoader {
|
|
|
15
9
|
hideLoader: () => void;
|
|
16
10
|
}
|
|
17
11
|
declare class SelectDocumentType extends Modal {
|
|
18
|
-
elementsList
|
|
12
|
+
private elementsList;
|
|
13
|
+
private header;
|
|
19
14
|
private list;
|
|
20
15
|
private loader;
|
|
21
16
|
constructor(componentWrapper: HTMLElement, loader: ILoader, modalPositionClass: ModalPositionKeys);
|
|
@@ -4,17 +4,15 @@ import Step from '../../Step';
|
|
|
4
4
|
import { CallbackHandler, MessageBox } from '../MessageBox/MessageBox';
|
|
5
5
|
import { ControlButton, ControlButtonClickedCustomEvent } from '../ControlButton/ControlButton';
|
|
6
6
|
import { CardStep } from '../CardStep/CardStep';
|
|
7
|
-
import SelectDocumentType from '../SelectDocumentType';
|
|
8
7
|
import { CardState } from '../CardStep/Card';
|
|
9
8
|
import { Context } from '../../../types/context';
|
|
10
|
-
export type
|
|
9
|
+
export type StepsScreenEvents = {
|
|
11
10
|
onResetButtonClick: (event: ControlButtonClickedCustomEvent) => void;
|
|
12
11
|
onSubmitButtonClick: (event: ControlButtonClickedCustomEvent) => void;
|
|
13
12
|
onStartButtonClick: (event: ControlButtonClickedCustomEvent) => void;
|
|
14
13
|
onCardClick: (data: CardState) => void;
|
|
15
14
|
};
|
|
16
|
-
export
|
|
17
|
-
export declare class StepsList {
|
|
15
|
+
export declare class StepsScreen {
|
|
18
16
|
mountElement: HTMLElement;
|
|
19
17
|
events: any;
|
|
20
18
|
UIComponents: Component<StateBase>[];
|
|
@@ -25,7 +23,6 @@ export declare class StepsList {
|
|
|
25
23
|
componentWrapper: HTMLElement;
|
|
26
24
|
notificationContainer: HTMLElement;
|
|
27
25
|
steps: CardStep[];
|
|
28
|
-
selectDocumentType: SelectDocumentType;
|
|
29
26
|
constructor(mountElement: HTMLElement, events: any, context: Context);
|
|
30
27
|
disableScreen(): void;
|
|
31
28
|
setVisibility(isVisible: boolean): void;
|
|
@@ -25,7 +25,7 @@ export declare class MaskCapture {
|
|
|
25
25
|
private get svgSizes();
|
|
26
26
|
private get strokeLength();
|
|
27
27
|
private set borderSizes(value);
|
|
28
|
-
applyMaskCaptureSizes(currentStepType: StepType, type: DocumentTypeIndex | 0): void;
|
|
28
|
+
applyMaskCaptureSizes(currentStepType: StepType, type: DocumentTypeIndex | 0, enableFourCornerCapture: boolean): void;
|
|
29
29
|
showHint(currentStepType: StepType, currentDocument: DocumentTypeIndex, hintType?: HintType): void;
|
|
30
30
|
changeMaskType(maskType: MaskType): void;
|
|
31
31
|
/**
|
|
@@ -7,6 +7,7 @@ export type HoldTextParams = {
|
|
|
7
7
|
steps: Step[];
|
|
8
8
|
currentStep: number;
|
|
9
9
|
currentStepType: StepType;
|
|
10
|
+
currentStepCornersCapture: boolean;
|
|
10
11
|
};
|
|
11
12
|
export declare class UiHints {
|
|
12
13
|
private componentWrapper;
|
|
@@ -18,7 +19,7 @@ export declare class UiHints {
|
|
|
18
19
|
private arrowRightFaceTheCameraContainer;
|
|
19
20
|
private currentArrowContainer;
|
|
20
21
|
constructor(componentWrapper: HTMLElement);
|
|
21
|
-
|
|
22
|
+
updateHintText({ hintFlags, realFaceTurnSide, steps, currentStep, currentStepType, currentStepCornersCapture, }: HoldTextParams, data?: number, isCorrectDirection?: boolean): string;
|
|
22
23
|
private showFaceTheCameraArrows;
|
|
23
24
|
private hideFaceTheCameraArrows;
|
|
24
25
|
private showArrow;
|
|
@@ -3,3 +3,4 @@ export declare const validBackExits: Set<GeneralTypeExitYolo>;
|
|
|
3
3
|
export declare const validFrontExits: Set<GeneralTypeExitYolo>;
|
|
4
4
|
export declare const hasPDF: (side: GeneralTypeExitYolo) => boolean;
|
|
5
5
|
export declare const hasMRZ: (side: GeneralTypeExitYolo) => boolean;
|
|
6
|
+
export declare const backSideToStepMap: (side: GeneralTypeExitYolo) => "mrz" | "pdf" | "back";
|
|
@@ -20,7 +20,7 @@ export type Context = {
|
|
|
20
20
|
running: boolean;
|
|
21
21
|
allowedTypesIds: (DocumentTypeIndex | 0)[];
|
|
22
22
|
type: DocumentTypeIndex | 0;
|
|
23
|
-
capturingMode: 'processImage5'
|
|
23
|
+
capturingMode: 'processImage5';
|
|
24
24
|
isBrowserSupport: boolean;
|
|
25
25
|
resizedData: ImageData | null;
|
|
26
26
|
origData: ImageData | null;
|
|
@@ -29,7 +29,6 @@ export type Context = {
|
|
|
29
29
|
config: Record<string, any>;
|
|
30
30
|
networkUrl: string;
|
|
31
31
|
chunkPublicPath: string;
|
|
32
|
-
showForceCapturingBtn: boolean;
|
|
33
32
|
imageFormat: 'webp' | 'jpeg';
|
|
34
33
|
supabase: ReturnType<typeof InitClient> | null;
|
|
35
34
|
cameraInfo: Record<string, any>;
|
|
@@ -97,6 +96,7 @@ export type Context = {
|
|
|
97
96
|
get currentStepMode(): StepMode;
|
|
98
97
|
get currentDocumentType(): DocumentTypeName | '';
|
|
99
98
|
get currentStepDelay(): number;
|
|
99
|
+
get currentStepCornersCapture(): boolean;
|
|
100
100
|
get hasFrontStep(): boolean;
|
|
101
101
|
calculateIsMirroring(): void;
|
|
102
102
|
dropKeys(): void;
|
|
@@ -16,5 +16,7 @@ export declare enum CameraNotSupportedReason {
|
|
|
16
16
|
/** Camera is currently not available due to a OS or hardware error. */
|
|
17
17
|
CameraNotAvailable = "CameraNotAvailable",
|
|
18
18
|
/** Camera with requested features is not available on current device when needs document verification */
|
|
19
|
-
CameraNotFoundInVerification = "CameraNotFoundInVerification"
|
|
19
|
+
CameraNotFoundInVerification = "CameraNotFoundInVerification",
|
|
20
|
+
/** The camera is not suitable for document capture because of its parameters (dual camera, wide-angle camera, etc.) */
|
|
21
|
+
UnsuitableCamera = "UnsuitableCamera"
|
|
20
22
|
}
|
package/dist/types/util.d.ts
CHANGED
|
@@ -20,21 +20,8 @@ interface IError {
|
|
|
20
20
|
}
|
|
21
21
|
export declare const checkIsTouchScreen: () => boolean;
|
|
22
22
|
export declare const filterWithForbiddenKeysValues: (obj: any, forbiddenKeys: any, forbiddenValues: any) => {};
|
|
23
|
-
declare const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
* @param img
|
|
30
|
-
* @returns {ImageData}
|
|
31
|
-
*/
|
|
32
|
-
imageToImageData(img: HTMLImageElement): ImageData;
|
|
33
|
-
/**
|
|
34
|
-
*
|
|
35
|
-
* @param base64
|
|
36
|
-
* @returns {Promise<ImageData>}
|
|
37
|
-
*/
|
|
38
|
-
base64ToImageData(base64: Base64Image): Promise<ImageData>;
|
|
39
|
-
};
|
|
40
|
-
export default _default;
|
|
23
|
+
export declare const prepareCameraErr: (err: IError) => IError;
|
|
24
|
+
export declare const formDataForSubmit: (steps: IStepCallback[], c: Context, payload?: {}) => IDataForSubmit;
|
|
25
|
+
export declare const imageToImageData: (img: HTMLImageElement) => ImageData;
|
|
26
|
+
export declare const base64ToImageData: (base64: Base64Image) => Promise<ImageData>;
|
|
27
|
+
export {};
|
package/package.json
CHANGED
|
File without changes
|