@idscan/idvc2 2.8.4 → 2.8.6

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.
Files changed (44) hide show
  1. package/README.md +8 -0
  2. package/dist/idvc.js +36085 -1612
  3. package/dist/idvc.js.gzip +0 -0
  4. package/dist/index.html +4 -4
  5. package/dist/js/environment/langs.js +258 -1
  6. package/dist/langs.js.gzip +0 -0
  7. package/dist/networks/Blur-chunk.js +587 -1
  8. package/dist/networks/Bubble-chunk.js +438 -1
  9. package/dist/networks/ClassLocal-chunk.js +535 -1
  10. package/dist/networks/Face-chunk.js +2157 -1
  11. package/dist/networks/MRZ-chunk.js +1419 -1
  12. package/dist/networks/PDF-chunk.js +1007 -1
  13. package/dist/networks/ZXing-chunk.js +351 -1
  14. package/dist/networks/angle03032023.onnx.gzip +0 -0
  15. package/dist/networks/blurWorker.js.gzip +0 -0
  16. package/dist/networks/bubbleWorker.js.gzip +0 -0
  17. package/dist/networks/classLocal03032023.onnx.gzip +0 -0
  18. package/dist/networks/faceDetection03032023.onnx.gzip +0 -0
  19. package/dist/networks/faceLandmark03032023.onnx.gzip +0 -0
  20. package/dist/networks/mrz03032023.onnx.gzip +0 -0
  21. package/dist/networks/mrzWorker.js.gzip +0 -0
  22. package/dist/networks/ort-wasm-simd.wasm.gzip +0 -0
  23. package/dist/networks/ort-wasm.wasm.gzip +0 -0
  24. package/dist/networks/pdfWorker.js.gzip +0 -0
  25. package/dist/types/modules/Config.d.ts +6 -2
  26. package/dist/types/modules/camera/cameraManager.d.ts +6 -2
  27. package/dist/types/modules/gzip.d.ts +3 -0
  28. package/dist/types/modules/uploader.d.ts +8 -8
  29. package/dist/types/neural models/neuralModel.d.ts +1 -1
  30. package/dist/types/types/modules/camera.d.ts +4 -0
  31. package/package.json +5 -1
  32. package/dist/networks/angle03032023.onnx +0 -0
  33. package/dist/networks/blurWorker.js +0 -5
  34. package/dist/networks/bubbleWorker.js +0 -1
  35. package/dist/networks/classLocal03032023.onnx +0 -0
  36. package/dist/networks/faceDetection03032023.onnx +0 -0
  37. package/dist/networks/faceLandmark03032023.onnx +0 -0
  38. package/dist/networks/mrz03032023.onnx +0 -0
  39. package/dist/networks/mrzWorker.js +0 -5
  40. package/dist/networks/ort-wasm-simd-threaded.wasm +0 -0
  41. package/dist/networks/ort-wasm-simd.wasm +0 -0
  42. package/dist/networks/ort-wasm-threaded.wasm +0 -0
  43. package/dist/networks/ort-wasm.wasm +0 -0
  44. package/dist/networks/pdfWorker.js +0 -9
@@ -1 +1,1007 @@
1
- (self.webpackChunk_idscan_idvc2=self.webpackChunk_idscan_idvc2||[]).push([[596],{4550:(e,t,r)=>{function n(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){r(e);return}u.done?t(s):Promise.resolve(s).then(n,o)}function o(e){return function(){var t=this,r=arguments;return new Promise(function(o,i){var a=e.apply(t,r);function u(e){n(a,o,i,u,s,"next",e)}function s(e){n(a,o,i,u,s,"throw",e)}u(void 0)})}}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{},n=Object.keys(r);"function"==typeof Object.getOwnPropertySymbols&&(n=n.concat(Object.getOwnPropertySymbols(r).filter(function(e){return Object.getOwnPropertyDescriptor(r,e).enumerable}))),n.forEach(function(t){i(e,t,r[t])})}return e}function u(e,t){var r,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(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=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=(o=a.trys).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=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}r.d(t,{o:()=>l});var s="application/javascript",c=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=a({skipSameOrigin:!0,useBlob:!0},t);return!e.includes("://")||e.includes(window.location.origin)?Promise.resolve(e):new Promise(function(t,n){return fetch(e).then(function(e){return e.text()}).then(function(n){var o=new URL(e).href.split("/");o.pop();var i="const _importScripts = importScripts;\nconst _fixImports = (url) => new URL(url, '".concat("".concat(o.join("/"),"/"),"').href;\nimportScripts = (...urls) => _importScripts(...urls.map(_fixImports));"),a="data:".concat(s,",").concat(encodeURIComponent(i+n));r.useBlob&&(a=URL.createObjectURL(new Blob(['importScripts("'.concat(a,'")')],{type:s}))),t(a)}).catch(n)})},l=function(){var e=o(function(e){var t;return u(this,function(r){switch(r.label){case 0:return[4,c(e)];case 1:return t=r.sent(),[2,new Worker(t)]}})});return function(t){return e.apply(this,arguments)}}()},8766:(e,t,r)=>{r.r(t),r.d(t,{default:()=>A});var n=r(4328),o=r(6399);function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e){if(Array.isArray(e))return e}function u(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){r(e);return}u.done?t(s):Promise.resolve(s).then(n,o)}function s(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){u(i,n,o,a,s,"next",e)}function s(e){u(i,n,o,a,s,"throw",e)}a(void 0)})}}function c(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function f(e,t,r){return t&&l(e.prototype,t),r&&l(e,r),e}function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}function h(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function y(e,t){return a(e)||d(e,t)||v(e,t)||h()}function v(e,t){if(e){if("string"==typeof e)return i(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(e,t)}}function b(e,t){var r,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(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=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=(o=a.trys).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=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var m=function(){"use strict";function e(t,r,n){var o=this;c(this,e),p(this,"module",void 0),p(this,"handle",null),p(this,"bw",0),p(this,"bh",0),p(this,"src",null),p(this,"out",null),p(this,"isAllocate",!1),p(this,"worker",void 0),p(this,"isProcessing",!1),p(this,"isInitialized",!1),p(this,"successCount",0),p(this,"pdfCapturedCount",0),p(this,"src2",null),p(this,"locations",null),p(this,"pdfCount",0),p(this,"geometry",void 0),p(this,"minPDFframes",1),p(this,"cropSizes",void 0),p(this,"canvasSizes",void 0),p(this,"privateErrorId",0),this.worker=t,this.worker.onmessage=function(e){var t=e.data,r=t.name,n=t.data;"initialization"===r&&(o.isInitialized=n)},this.worker.postMessage({fn:"init",key:r,isNeedToLoadPDFWIthPreprocess:n})}return f(e,[{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,t,r,n){this.geometry=e,this.minPDFframes=t,this.cropSizes=r,this.canvasSizes=n}},{key:"licenseError",value:function(){return{error:!0,errorType:"licenceKeyError",errorVal:this.errorVal}}},{key:"create",value:function(){}},{key:"setSizes",value:function(e,t){this.bw=e,this.bh=t,this.worker.postMessage({fn:"setSizes",bw:e,bh:t})}},{key:"allocate",value:function(){this.worker.postMessage({fn:"allocate"})}},{key:"drawCords",value:function(e){var t=this,r=[];if(e){var n=[];Object.entries(e).forEach(function(e){var r=y(e,2),o=r[0],i=Math.trunc(r[1]),a=o[0],u=+o[1]-1;n[u]||(n[u]={x:0,y:0}),"x"===a?n[u].x=t.canvasSizes.width*i/t.bw:n[u].y=t.canvasSizes.height*i/t.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),c=this.geometry.angleBetweenTwoVectors(a,u);s<=100&&s>=80&&c<=100&&c>=80&&(r=n)}return r}},{key:"processPDF",value:function(e){var t=this;return s(function(){var r,n;return b(this,function(i){switch(i.label){case 0:if(t.isProcessing)return[2,{}];if(r={status:!1,predict:!1,touch:!1,image:null,type:"pdf",error:null,coords:[],trackString:"",pdfSuccessCount:0,pdfCount:0,isSuccessProcess:!1,pdfCapturedCount:0},!t.isInitialized)return[2,r];return t.isProcessing=!0,[4,t.readPDF(e)];case 1:if((n=i.sent()).error)return t.isProcessing=!1,r.error=n,[2,r];return n&&"status"in n&&(n.status.value===o.l.Detected&&(t.pdfCapturedCount+=1),n.status.value===o.l.Detected||n.status.value===o.l.Decoded?(r.coords=t.drawCords(n.location),r.isSuccessProcess=!0):(t.successCount+=1,t.drawCords(null)),n.status.value===o.l.Decoded?(t.pdfCount+=1,t.pdfCount>=t.minPDFframes&&(t.successCount=0,t.pdfCount=0,r.trackString=n.trackString||n.data||"",r.status=!0,r.image=e,r.pdfCapturedCount=0)):t.pdfCount=0),r.pdfSuccessCount=t.successCount,r.pdfCount=t.pdfCount,r.pdfCapturedCount=t.pdfCapturedCount,t.isProcessing=!1,[2,r]}})})()}},{key:"processPDFWithPreProcess",value:function(e){var t=this;return new Promise(function(r){t.worker.onmessage=function(e){var n=e.data,o=n.name,i=n.data;if("result"===o){t.errorId=null==i?void 0:null===(a=i.status)||void 0===a?void 0:a.value;var a,u=(t.errorId?t.licenseError():null)||i;r(u)}else r(i)},t.worker.postMessage({fn:"pdfWithPreProcess",iData:e})})}},{key:"readPDF",value:function(e){var t=this;return s(function(){return b(this,function(r){return[2,new Promise(function(r){t.worker.onmessage=function(e){var n=e.data,o=n.name,i=n.data,a=n.bw,u=n.bh;if("ready"===o)t.worker.postMessage({fn:"process"});else if("result"===o){t.errorId=null==i?void 0:null===(s=i.status)||void 0===s?void 0:s.value;var s,c=(t.errorId?t.licenseError():null)||i;t.bw=a,t.bh=u,r(c)}else r(i)},t.worker.postMessage({fn:"prepare",iData:e})})]})})()}}]),e}(),w=r(7286),g=r(4550);function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function S(e){if(Array.isArray(e))return e}function P(e,t,r,n,o,i,a){try{var u=e[i](a),s=u.value}catch(e){r(e);return}u.done?t(s):Promise.resolve(s).then(n,o)}function C(e){return function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function a(e){P(i,n,o,a,u,"next",e)}function u(e){P(i,n,o,a,u,"throw",e)}a(void 0)})}}function x(e,t){var r,n,o=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(r=o.next()).done)&&(i.push(r.value),!t||i.length!==t);a=!0);}catch(e){u=!0,n=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw n}}return i}}function I(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function j(e,t){return S(e)||x(e,t)||O(e,t)||I()}function O(e,t){if(e){if("string"==typeof e)return k(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(r);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return k(e,t)}}function D(e,t){var r,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(r)throw TypeError("Generator is already executing.");for(;a;)try{if(r=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=(o=a.trys).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=t.call(e,a)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}}var E=function(){var e=C(function(e){var t,r,o,i;return D(this,function(a){switch(a.label){case 0:return t=e.pdf417key,r=!!Object.entries(n.Z.config.documentTypes).find(function(e){var t=j(e,2);return(t[0],t[1]).find(function(e){return("pdf"===e.type||"back"===e.type)&&e.mode.uploader})}),[4,(0,g.o)("".concat(n.Z.chunkPublicPath,"pdfWorker.js"))];case 1:return o=a.sent(),i=new m(o,t,r),w.Z.setModule("module","pdf",i),[2]}})});return function(t){return e.apply(this,arguments)}}();let A=E}}]);
1
+ (self["webpackChunk_idscan_idvc2"] = self["webpackChunk_idscan_idvc2"] || []).push([[596],{
2
+
3
+ /***/ 4550:
4
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5
+
6
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
7
+ /* harmony export */ o: () => (/* binding */ loadWorker)
8
+ /* harmony export */ });
9
+ /* harmony import */ var pako__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(7885);
10
+ /* harmony import */ var _modules_gzip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(7666);
11
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
12
+ try {
13
+ var info = gen[key](arg);
14
+ var value = info.value;
15
+ } catch (error) {
16
+ reject(error);
17
+ return;
18
+ }
19
+ if (info.done) {
20
+ resolve(value);
21
+ } else {
22
+ Promise.resolve(value).then(_next, _throw);
23
+ }
24
+ }
25
+ function _async_to_generator(fn) {
26
+ return function() {
27
+ var self = this, args = arguments;
28
+ return new Promise(function(resolve, reject) {
29
+ var gen = fn.apply(self, args);
30
+ function _next(value) {
31
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
32
+ }
33
+ function _throw(err) {
34
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
35
+ }
36
+ _next(undefined);
37
+ });
38
+ };
39
+ }
40
+ function _ts_generator(thisArg, body) {
41
+ var f, y, t, g, _ = {
42
+ label: 0,
43
+ sent: function() {
44
+ if (t[0] & 1) throw t[1];
45
+ return t[1];
46
+ },
47
+ trys: [],
48
+ ops: []
49
+ };
50
+ return(g = {
51
+ next: verb(0),
52
+ "throw": verb(1),
53
+ "return": verb(2)
54
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
55
+ return this;
56
+ }), g);
57
+ function verb(n) {
58
+ return function(v) {
59
+ return step([
60
+ n,
61
+ v
62
+ ]);
63
+ };
64
+ }
65
+ function step(op) {
66
+ if (f) throw new TypeError("Generator is already executing.");
67
+ while(_)try {
68
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
69
+ if (y = 0, t) op = [
70
+ op[0] & 2,
71
+ t.value
72
+ ];
73
+ switch(op[0]){
74
+ case 0:
75
+ case 1:
76
+ t = op;
77
+ break;
78
+ case 4:
79
+ _.label++;
80
+ return {
81
+ value: op[1],
82
+ done: false
83
+ };
84
+ case 5:
85
+ _.label++;
86
+ y = op[1];
87
+ op = [
88
+ 0
89
+ ];
90
+ continue;
91
+ case 7:
92
+ op = _.ops.pop();
93
+ _.trys.pop();
94
+ continue;
95
+ default:
96
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
97
+ _ = 0;
98
+ continue;
99
+ }
100
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
101
+ _.label = op[1];
102
+ break;
103
+ }
104
+ if (op[0] === 6 && _.label < t[1]) {
105
+ _.label = t[1];
106
+ t = op;
107
+ break;
108
+ }
109
+ if (t && _.label < t[2]) {
110
+ _.label = t[2];
111
+ _.ops.push(op);
112
+ break;
113
+ }
114
+ if (t[2]) _.ops.pop();
115
+ _.trys.pop();
116
+ continue;
117
+ }
118
+ op = body.call(thisArg, _);
119
+ } catch (e) {
120
+ op = [
121
+ 6,
122
+ e
123
+ ];
124
+ y = 0;
125
+ } finally{
126
+ f = t = 0;
127
+ }
128
+ if (op[0] & 5) throw op[1];
129
+ return {
130
+ value: op[0] ? op[1] : void 0,
131
+ done: true
132
+ };
133
+ }
134
+ }
135
+
136
+
137
+ var getCrossOriginWorkerURL = function() {
138
+ var _ref = _async_to_generator(function(originalWorkerUrl) {
139
+ var compressedData, _, decompressedData, blob, error;
140
+ return _ts_generator(this, function(_state) {
141
+ switch(_state.label){
142
+ case 0:
143
+ _state.trys.push([
144
+ 0,
145
+ 2,
146
+ ,
147
+ 3
148
+ ]);
149
+ _ = Uint8Array.bind;
150
+ return [
151
+ 4,
152
+ (0,_modules_gzip__WEBPACK_IMPORTED_MODULE_1__/* .loadFile */ .xl)(originalWorkerUrl)
153
+ ];
154
+ case 1:
155
+ compressedData = new (_.apply(Uint8Array, [
156
+ void 0,
157
+ _state.sent()
158
+ ]));
159
+ decompressedData = (0,pako__WEBPACK_IMPORTED_MODULE_0__/* .ungzip */ .ec)(compressedData);
160
+ blob = new Blob([
161
+ decompressedData.buffer
162
+ ], {
163
+ type: 'application/javascript'
164
+ });
165
+ return [
166
+ 2,
167
+ URL.createObjectURL(blob)
168
+ ];
169
+ case 2:
170
+ error = _state.sent();
171
+ console.error('Error loading and decompressing worker file:', error);
172
+ throw error;
173
+ case 3:
174
+ return [
175
+ 2
176
+ ];
177
+ }
178
+ });
179
+ });
180
+ return function getCrossOriginWorkerURL(originalWorkerUrl) {
181
+ return _ref.apply(this, arguments);
182
+ };
183
+ }();
184
+ var loadWorker = function() {
185
+ var _ref = _async_to_generator(function(workerUrl) {
186
+ var workerURL;
187
+ return _ts_generator(this, function(_state) {
188
+ switch(_state.label){
189
+ case 0:
190
+ return [
191
+ 4,
192
+ getCrossOriginWorkerURL(workerUrl)
193
+ ];
194
+ case 1:
195
+ workerURL = _state.sent();
196
+ return [
197
+ 2,
198
+ new Worker(workerURL)
199
+ ];
200
+ }
201
+ });
202
+ });
203
+ return function loadWorker(workerUrl) {
204
+ return _ref.apply(this, arguments);
205
+ };
206
+ }();
207
+
208
+
209
+ /***/ }),
210
+
211
+ /***/ 8766:
212
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
213
+
214
+ // ESM COMPAT FLAG
215
+ __webpack_require__.r(__webpack_exports__);
216
+
217
+ // EXPORTS
218
+ __webpack_require__.d(__webpack_exports__, {
219
+ "default": () => (/* binding */ loaderPDF)
220
+ });
221
+
222
+ // EXTERNAL MODULE: ./src/context.ts + 6 modules
223
+ var context = __webpack_require__(4328);
224
+ // EXTERNAL MODULE: ./src/types/enums/pdf.ts
225
+ var pdf = __webpack_require__(6399);
226
+ ;// CONCATENATED MODULE: ./src/modules/PdfModule.ts
227
+ function _array_like_to_array(arr, len) {
228
+ if (len == null || len > arr.length) len = arr.length;
229
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
230
+ return arr2;
231
+ }
232
+ function _array_with_holes(arr) {
233
+ if (Array.isArray(arr)) return arr;
234
+ }
235
+ function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
236
+ try {
237
+ var info = gen[key](arg);
238
+ var value = info.value;
239
+ } catch (error) {
240
+ reject(error);
241
+ return;
242
+ }
243
+ if (info.done) {
244
+ resolve(value);
245
+ } else {
246
+ Promise.resolve(value).then(_next, _throw);
247
+ }
248
+ }
249
+ function _async_to_generator(fn) {
250
+ return function() {
251
+ var self = this, args = arguments;
252
+ return new Promise(function(resolve, reject) {
253
+ var gen = fn.apply(self, args);
254
+ function _next(value) {
255
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
256
+ }
257
+ function _throw(err) {
258
+ asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
259
+ }
260
+ _next(undefined);
261
+ });
262
+ };
263
+ }
264
+ function _class_call_check(instance, Constructor) {
265
+ if (!(instance instanceof Constructor)) {
266
+ throw new TypeError("Cannot call a class as a function");
267
+ }
268
+ }
269
+ function _defineProperties(target, props) {
270
+ for(var i = 0; i < props.length; i++){
271
+ var descriptor = props[i];
272
+ descriptor.enumerable = descriptor.enumerable || false;
273
+ descriptor.configurable = true;
274
+ if ("value" in descriptor) descriptor.writable = true;
275
+ Object.defineProperty(target, descriptor.key, descriptor);
276
+ }
277
+ }
278
+ function _create_class(Constructor, protoProps, staticProps) {
279
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
280
+ if (staticProps) _defineProperties(Constructor, staticProps);
281
+ return Constructor;
282
+ }
283
+ function _define_property(obj, key, value) {
284
+ if (key in obj) {
285
+ Object.defineProperty(obj, key, {
286
+ value: value,
287
+ enumerable: true,
288
+ configurable: true,
289
+ writable: true
290
+ });
291
+ } else {
292
+ obj[key] = value;
293
+ }
294
+ return obj;
295
+ }
296
+ function _iterable_to_array_limit(arr, i) {
297
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
298
+ if (_i == null) return;
299
+ var _arr = [];
300
+ var _n = true;
301
+ var _d = false;
302
+ var _s, _e;
303
+ try {
304
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
305
+ _arr.push(_s.value);
306
+ if (i && _arr.length === i) break;
307
+ }
308
+ } catch (err) {
309
+ _d = true;
310
+ _e = err;
311
+ } finally{
312
+ try {
313
+ if (!_n && _i["return"] != null) _i["return"]();
314
+ } finally{
315
+ if (_d) throw _e;
316
+ }
317
+ }
318
+ return _arr;
319
+ }
320
+ function _non_iterable_rest() {
321
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
322
+ }
323
+ function _sliced_to_array(arr, i) {
324
+ return _array_with_holes(arr) || _iterable_to_array_limit(arr, i) || _unsupported_iterable_to_array(arr, i) || _non_iterable_rest();
325
+ }
326
+ function _unsupported_iterable_to_array(o, minLen) {
327
+ if (!o) return;
328
+ if (typeof o === "string") return _array_like_to_array(o, minLen);
329
+ var n = Object.prototype.toString.call(o).slice(8, -1);
330
+ if (n === "Object" && o.constructor) n = o.constructor.name;
331
+ if (n === "Map" || n === "Set") return Array.from(n);
332
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _array_like_to_array(o, minLen);
333
+ }
334
+ function _ts_generator(thisArg, body) {
335
+ var f, y, t, g, _ = {
336
+ label: 0,
337
+ sent: function() {
338
+ if (t[0] & 1) throw t[1];
339
+ return t[1];
340
+ },
341
+ trys: [],
342
+ ops: []
343
+ };
344
+ return g = {
345
+ next: verb(0),
346
+ "throw": verb(1),
347
+ "return": verb(2)
348
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
349
+ return this;
350
+ }), g;
351
+ function verb(n) {
352
+ return function(v) {
353
+ return step([
354
+ n,
355
+ v
356
+ ]);
357
+ };
358
+ }
359
+ function step(op) {
360
+ if (f) throw new TypeError("Generator is already executing.");
361
+ while(_)try {
362
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
363
+ if (y = 0, t) op = [
364
+ op[0] & 2,
365
+ t.value
366
+ ];
367
+ switch(op[0]){
368
+ case 0:
369
+ case 1:
370
+ t = op;
371
+ break;
372
+ case 4:
373
+ _.label++;
374
+ return {
375
+ value: op[1],
376
+ done: false
377
+ };
378
+ case 5:
379
+ _.label++;
380
+ y = op[1];
381
+ op = [
382
+ 0
383
+ ];
384
+ continue;
385
+ case 7:
386
+ op = _.ops.pop();
387
+ _.trys.pop();
388
+ continue;
389
+ default:
390
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
391
+ _ = 0;
392
+ continue;
393
+ }
394
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
395
+ _.label = op[1];
396
+ break;
397
+ }
398
+ if (op[0] === 6 && _.label < t[1]) {
399
+ _.label = t[1];
400
+ t = op;
401
+ break;
402
+ }
403
+ if (t && _.label < t[2]) {
404
+ _.label = t[2];
405
+ _.ops.push(op);
406
+ break;
407
+ }
408
+ if (t[2]) _.ops.pop();
409
+ _.trys.pop();
410
+ continue;
411
+ }
412
+ op = body.call(thisArg, _);
413
+ } catch (e) {
414
+ op = [
415
+ 6,
416
+ e
417
+ ];
418
+ y = 0;
419
+ } finally{
420
+ f = t = 0;
421
+ }
422
+ if (op[0] & 5) throw op[1];
423
+ return {
424
+ value: op[0] ? op[1] : void 0,
425
+ done: true
426
+ };
427
+ }
428
+ }
429
+
430
+ var PdfModule = /*#__PURE__*/ function() {
431
+ "use strict";
432
+ function PdfModule(worker, key, isNeedToLoadPDFWIthPreprocess) {
433
+ var _this = this;
434
+ _class_call_check(this, PdfModule);
435
+ _define_property(this, "module", void 0);
436
+ _define_property(this, "handle", null);
437
+ _define_property(this, "bw", 0);
438
+ _define_property(this, "bh", 0);
439
+ _define_property(this, "src", null);
440
+ _define_property(this, "out", null);
441
+ _define_property(this, "isAllocate", false);
442
+ _define_property(this, "worker", void 0);
443
+ _define_property(this, "isProcessing", false);
444
+ _define_property(this, "isInitialized", false);
445
+ _define_property(this, "successCount", 0);
446
+ _define_property(this, "pdfCapturedCount", 0);
447
+ _define_property(this, "src2", null);
448
+ _define_property(this, "locations", null);
449
+ _define_property(this, "pdfCount", 0);
450
+ _define_property(this, "geometry", void 0);
451
+ _define_property(this, "minPDFframes", 1);
452
+ _define_property(this, "cropSizes", void 0);
453
+ _define_property(this, "canvasSizes", void 0);
454
+ _define_property(this, "privateErrorId", 0);
455
+ this.worker = worker;
456
+ this.worker.onmessage = function(param) {
457
+ var _param_data = param.data, name = _param_data.name, data = _param_data.data;
458
+ if (name === 'initialization') {
459
+ _this.isInitialized = data;
460
+ }
461
+ };
462
+ this.worker.postMessage({
463
+ fn: 'init',
464
+ key: key,
465
+ isNeedToLoadPDFWIthPreprocess: isNeedToLoadPDFWIthPreprocess
466
+ });
467
+ }
468
+ _create_class(PdfModule, [
469
+ {
470
+ key: "errorId",
471
+ get: function get() {
472
+ return this.privateErrorId;
473
+ },
474
+ set: function set(id) {
475
+ this.privateErrorId = [
476
+ pdf/* EResultStatus.Detected */.l.Detected,
477
+ pdf/* EResultStatus.Decoded */.l.Decoded
478
+ ].includes(id) ? 0 : id;
479
+ }
480
+ },
481
+ {
482
+ key: "errorVal",
483
+ get: function get() {
484
+ var errorVal;
485
+ if (this.errorId === pdf/* EResultStatus.LicenseKeyHasExpired */.l.LicenseKeyHasExpired) {
486
+ errorVal = 0; // 'License Key has expired';
487
+ }
488
+ if (this.errorId === pdf/* EResultStatus.InvalidLicenseKey */.l.InvalidLicenseKey) {
489
+ errorVal = 1; // 'Invalid License Key';
490
+ }
491
+ return errorVal;
492
+ }
493
+ },
494
+ {
495
+ /**
496
+ *
497
+ * @param geometry
498
+ * @param {number} minPDFframes - c.config.minPDFframes
499
+ * @param {{width: number, height: number}} cropSize - c.config.cropSize
500
+ * @param {{width: number, height: number}} canvasSizes - ui.borderCanvas
501
+ */ key: "init",
502
+ value: function init(geometry, minPDFframes, cropSize, canvasSizes) {
503
+ this.geometry = geometry;
504
+ this.minPDFframes = minPDFframes;
505
+ this.cropSizes = cropSize;
506
+ this.canvasSizes = canvasSizes;
507
+ }
508
+ },
509
+ {
510
+ key: "licenseError",
511
+ value: function licenseError() {
512
+ return {
513
+ error: true,
514
+ errorType: 'licenceKeyError',
515
+ errorVal: this.errorVal
516
+ };
517
+ }
518
+ },
519
+ {
520
+ // getLocations() {
521
+ // this.module.ccall(
522
+ // 'pdf417_getLocation',
523
+ // ['boolean'],
524
+ // ['number', 'number'],
525
+ // [this.handle, this.locations],
526
+ // );
527
+ // }
528
+ // setResizedData(data) {
529
+ // this.module.HEAPU8.set(data, this.src);
530
+ // }
531
+ //
532
+ // initReader(key) {
533
+ // this.reader = new this.module.PDF417Reader(key);
534
+ // }
535
+ //
536
+ // destroyReader() {
537
+ // this.reader = null;
538
+ // }
539
+ //
540
+ // setPdfData(data) {
541
+ // this.module.HEAPU8.set(data.data, this.src2);
542
+ // }
543
+ //
544
+ // readPdf(): PDFResult {
545
+ // return this.reader.processImage(
546
+ // this.src2,
547
+ // this.bw,
548
+ // this.bh,
549
+ // 4 * this.bw,
550
+ // this.module.EImageFormat.RGBA,
551
+ // );
552
+ // }
553
+ //
554
+ // releasePdf() {
555
+ // this.reader.reset();
556
+ // }
557
+ // eslint-disable-next-line class-methods-use-this
558
+ key: "create",
559
+ value: function create() {}
560
+ },
561
+ {
562
+ // free() {
563
+ // if (this.isAllocate) {
564
+ // // eslint-disable-next-line no-underscore-dangle
565
+ // this.module._free(this.src2);
566
+ // this.isAllocate = false;
567
+ // }
568
+ // }
569
+ key: "setSizes",
570
+ value: function setSizes(bw, bh) {
571
+ this.bw = bw;
572
+ this.bh = bh;
573
+ this.worker.postMessage({
574
+ fn: 'setSizes',
575
+ bw: bw,
576
+ bh: bh
577
+ });
578
+ }
579
+ },
580
+ {
581
+ key: "allocate",
582
+ value: function allocate() {
583
+ this.worker.postMessage({
584
+ fn: 'allocate'
585
+ });
586
+ }
587
+ },
588
+ {
589
+ key: "drawCords",
590
+ value: function drawCords(locations) {
591
+ var _this = this;
592
+ var result = [];
593
+ if (locations) {
594
+ var coords = [];
595
+ // key is string x1, x2, x3, x4, y1, y2, y3, y4
596
+ Object.entries(locations).forEach(function(param) {
597
+ var _param = _sliced_to_array(param, 2), key = _param[0], value = _param[1];
598
+ var val = Math.trunc(value);
599
+ var coordName = key[0];
600
+ var coordPosition = +key[1] - 1;
601
+ if (!coords[coordPosition]) {
602
+ coords[coordPosition] = {
603
+ x: 0,
604
+ y: 0
605
+ };
606
+ }
607
+ if (coordName === 'x') {
608
+ coords[coordPosition].x = _this.canvasSizes.width * val / _this.bw;
609
+ } else {
610
+ coords[coordPosition].y = _this.canvasSizes.height * val / _this.bh;
611
+ }
612
+ });
613
+ var v1 = [
614
+ coords[3].x - coords[0].x,
615
+ coords[3].y - coords[0].y
616
+ ];
617
+ var v2 = [
618
+ coords[1].x - coords[0].x,
619
+ coords[1].y - coords[0].y
620
+ ];
621
+ var v3 = [
622
+ coords[2].x - coords[1].x,
623
+ coords[2].y - coords[1].y
624
+ ];
625
+ var v4 = [
626
+ coords[3].x - coords[2].x,
627
+ coords[3].y - coords[2].y
628
+ ];
629
+ var a1 = this.geometry.angleBetweenTwoVectors(v1, v2);
630
+ var a2 = this.geometry.angleBetweenTwoVectors(v3, v4);
631
+ if (a1 <= 100 && a1 >= 80 && a2 <= 100 && a2 >= 80) {
632
+ result = coords;
633
+ }
634
+ }
635
+ return result;
636
+ }
637
+ },
638
+ {
639
+ key: "processPDF",
640
+ value: function processPDF(data) {
641
+ var _this = this;
642
+ return _async_to_generator(function() {
643
+ var res, pdfData;
644
+ return _ts_generator(this, function(_state) {
645
+ switch(_state.label){
646
+ case 0:
647
+ if (_this.isProcessing) {
648
+ return [
649
+ 2,
650
+ {}
651
+ ];
652
+ }
653
+ res = {
654
+ status: false,
655
+ predict: false,
656
+ touch: false,
657
+ image: null,
658
+ type: 'pdf',
659
+ error: null,
660
+ coords: [],
661
+ trackString: '',
662
+ pdfSuccessCount: 0,
663
+ pdfCount: 0,
664
+ isSuccessProcess: false,
665
+ pdfCapturedCount: 0
666
+ };
667
+ if (!_this.isInitialized) {
668
+ return [
669
+ 2,
670
+ res
671
+ ];
672
+ }
673
+ _this.isProcessing = true;
674
+ return [
675
+ 4,
676
+ _this.readPDF(data)
677
+ ];
678
+ case 1:
679
+ pdfData = _state.sent();
680
+ if (pdfData.error) {
681
+ _this.isProcessing = false;
682
+ res.error = pdfData;
683
+ return [
684
+ 2,
685
+ res
686
+ ];
687
+ }
688
+ if (pdfData && 'status' in pdfData) {
689
+ if (pdfData.status.value === pdf/* EResultStatus.Detected */.l.Detected) {
690
+ _this.pdfCapturedCount += 1;
691
+ }
692
+ if (pdfData.status.value === pdf/* EResultStatus.Detected */.l.Detected || pdfData.status.value === pdf/* EResultStatus.Decoded */.l.Decoded) {
693
+ res.coords = _this.drawCords(pdfData.location);
694
+ res.isSuccessProcess = true;
695
+ } else {
696
+ _this.successCount += 1;
697
+ _this.drawCords(null);
698
+ }
699
+ if (pdfData.status.value === pdf/* EResultStatus.Decoded */.l.Decoded) {
700
+ _this.pdfCount += 1;
701
+ if (_this.pdfCount >= _this.minPDFframes) {
702
+ _this.successCount = 0;
703
+ _this.pdfCount = 0;
704
+ res.trackString = pdfData.trackString || pdfData.data || '';
705
+ res.status = true;
706
+ res.image = data;
707
+ res.pdfCapturedCount = 0;
708
+ }
709
+ } else {
710
+ _this.pdfCount = 0;
711
+ }
712
+ }
713
+ res.pdfSuccessCount = _this.successCount;
714
+ res.pdfCount = _this.pdfCount;
715
+ res.pdfCapturedCount = _this.pdfCapturedCount;
716
+ _this.isProcessing = false;
717
+ return [
718
+ 2,
719
+ res
720
+ ];
721
+ }
722
+ });
723
+ })();
724
+ }
725
+ },
726
+ {
727
+ key: "processPDFWithPreProcess",
728
+ value: function processPDFWithPreProcess(iData) {
729
+ var _this = this;
730
+ return new Promise(function(resolve) {
731
+ _this.worker.onmessage = function(param) {
732
+ var _param_data = param.data, name = _param_data.name, data = _param_data.data;
733
+ if (name === 'result') {
734
+ var _data_status;
735
+ _this.errorId = data === null || data === void 0 ? void 0 : (_data_status = data.status) === null || _data_status === void 0 ? void 0 : _data_status.value;
736
+ var err = _this.errorId ? _this.licenseError() : null;
737
+ var result = err || data;
738
+ resolve(result);
739
+ } else {
740
+ resolve(data);
741
+ }
742
+ };
743
+ _this.worker.postMessage({
744
+ fn: 'pdfWithPreProcess',
745
+ iData: iData
746
+ });
747
+ });
748
+ }
749
+ },
750
+ {
751
+ key: "readPDF",
752
+ value: function readPDF(iData) {
753
+ var _this = this;
754
+ return _async_to_generator(function() {
755
+ return _ts_generator(this, function(_state) {
756
+ return [
757
+ 2,
758
+ new Promise(function(resolve) {
759
+ _this.worker.onmessage = function(param) {
760
+ var _param_data = param.data, name = _param_data.name, data = _param_data.data, bw = _param_data.bw, bh = _param_data.bh;
761
+ if (name === 'ready') {
762
+ _this.worker.postMessage({
763
+ fn: 'process'
764
+ });
765
+ } else if (name === 'result') {
766
+ var _data_status;
767
+ _this.errorId = data === null || data === void 0 ? void 0 : (_data_status = data.status) === null || _data_status === void 0 ? void 0 : _data_status.value;
768
+ var err = _this.errorId ? _this.licenseError() : null;
769
+ var result = err || data;
770
+ _this.bw = bw;
771
+ _this.bh = bh;
772
+ resolve(result);
773
+ } else {
774
+ resolve(data);
775
+ }
776
+ };
777
+ _this.worker.postMessage({
778
+ fn: 'prepare',
779
+ iData: iData
780
+ });
781
+ })
782
+ ];
783
+ });
784
+ })();
785
+ }
786
+ }
787
+ ]);
788
+ return PdfModule;
789
+ }();
790
+ /* harmony default export */ const modules_PdfModule = ((/* unused pure expression or super */ null && (PdfModule)));
791
+
792
+ // EXTERNAL MODULE: ./src/controllers/ModuleController.ts + 1 modules
793
+ var ModuleController = __webpack_require__(7286);
794
+ // EXTERNAL MODULE: ./src/helpers/workers.ts
795
+ var workers = __webpack_require__(4550);
796
+ ;// CONCATENATED MODULE: ./src/loader/loaderPDF.ts
797
+ function loaderPDF_array_like_to_array(arr, len) {
798
+ if (len == null || len > arr.length) len = arr.length;
799
+ for(var i = 0, arr2 = new Array(len); i < len; i++)arr2[i] = arr[i];
800
+ return arr2;
801
+ }
802
+ function loaderPDF_array_with_holes(arr) {
803
+ if (Array.isArray(arr)) return arr;
804
+ }
805
+ function loaderPDF_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
806
+ try {
807
+ var info = gen[key](arg);
808
+ var value = info.value;
809
+ } catch (error) {
810
+ reject(error);
811
+ return;
812
+ }
813
+ if (info.done) {
814
+ resolve(value);
815
+ } else {
816
+ Promise.resolve(value).then(_next, _throw);
817
+ }
818
+ }
819
+ function loaderPDF_async_to_generator(fn) {
820
+ return function() {
821
+ var self = this, args = arguments;
822
+ return new Promise(function(resolve, reject) {
823
+ var gen = fn.apply(self, args);
824
+ function _next(value) {
825
+ loaderPDF_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
826
+ }
827
+ function _throw(err) {
828
+ loaderPDF_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
829
+ }
830
+ _next(undefined);
831
+ });
832
+ };
833
+ }
834
+ function loaderPDF_iterable_to_array_limit(arr, i) {
835
+ var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
836
+ if (_i == null) return;
837
+ var _arr = [];
838
+ var _n = true;
839
+ var _d = false;
840
+ var _s, _e;
841
+ try {
842
+ for(_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true){
843
+ _arr.push(_s.value);
844
+ if (i && _arr.length === i) break;
845
+ }
846
+ } catch (err) {
847
+ _d = true;
848
+ _e = err;
849
+ } finally{
850
+ try {
851
+ if (!_n && _i["return"] != null) _i["return"]();
852
+ } finally{
853
+ if (_d) throw _e;
854
+ }
855
+ }
856
+ return _arr;
857
+ }
858
+ function loaderPDF_non_iterable_rest() {
859
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
860
+ }
861
+ function loaderPDF_sliced_to_array(arr, i) {
862
+ return loaderPDF_array_with_holes(arr) || loaderPDF_iterable_to_array_limit(arr, i) || loaderPDF_unsupported_iterable_to_array(arr, i) || loaderPDF_non_iterable_rest();
863
+ }
864
+ function loaderPDF_unsupported_iterable_to_array(o, minLen) {
865
+ if (!o) return;
866
+ if (typeof o === "string") return loaderPDF_array_like_to_array(o, minLen);
867
+ var n = Object.prototype.toString.call(o).slice(8, -1);
868
+ if (n === "Object" && o.constructor) n = o.constructor.name;
869
+ if (n === "Map" || n === "Set") return Array.from(n);
870
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return loaderPDF_array_like_to_array(o, minLen);
871
+ }
872
+ function loaderPDF_ts_generator(thisArg, body) {
873
+ var f, y, t, g, _ = {
874
+ label: 0,
875
+ sent: function() {
876
+ if (t[0] & 1) throw t[1];
877
+ return t[1];
878
+ },
879
+ trys: [],
880
+ ops: []
881
+ };
882
+ return(g = {
883
+ next: verb(0),
884
+ "throw": verb(1),
885
+ "return": verb(2)
886
+ }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
887
+ return this;
888
+ }), g);
889
+ function verb(n) {
890
+ return function(v) {
891
+ return step([
892
+ n,
893
+ v
894
+ ]);
895
+ };
896
+ }
897
+ function step(op) {
898
+ if (f) throw new TypeError("Generator is already executing.");
899
+ while(_)try {
900
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
901
+ if (y = 0, t) op = [
902
+ op[0] & 2,
903
+ t.value
904
+ ];
905
+ switch(op[0]){
906
+ case 0:
907
+ case 1:
908
+ t = op;
909
+ break;
910
+ case 4:
911
+ _.label++;
912
+ return {
913
+ value: op[1],
914
+ done: false
915
+ };
916
+ case 5:
917
+ _.label++;
918
+ y = op[1];
919
+ op = [
920
+ 0
921
+ ];
922
+ continue;
923
+ case 7:
924
+ op = _.ops.pop();
925
+ _.trys.pop();
926
+ continue;
927
+ default:
928
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
929
+ _ = 0;
930
+ continue;
931
+ }
932
+ if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {
933
+ _.label = op[1];
934
+ break;
935
+ }
936
+ if (op[0] === 6 && _.label < t[1]) {
937
+ _.label = t[1];
938
+ t = op;
939
+ break;
940
+ }
941
+ if (t && _.label < t[2]) {
942
+ _.label = t[2];
943
+ _.ops.push(op);
944
+ break;
945
+ }
946
+ if (t[2]) _.ops.pop();
947
+ _.trys.pop();
948
+ continue;
949
+ }
950
+ op = body.call(thisArg, _);
951
+ } catch (e) {
952
+ op = [
953
+ 6,
954
+ e
955
+ ];
956
+ y = 0;
957
+ } finally{
958
+ f = t = 0;
959
+ }
960
+ if (op[0] & 5) throw op[1];
961
+ return {
962
+ value: op[0] ? op[1] : void 0,
963
+ done: true
964
+ };
965
+ }
966
+ }
967
+
968
+
969
+
970
+
971
+ var load = function() {
972
+ var _ref = loaderPDF_async_to_generator(function(param) {
973
+ var pdf417key, isNeedToLoadPDFWIthPreprocess, worker, pdfMod;
974
+ return loaderPDF_ts_generator(this, function(_state) {
975
+ switch(_state.label){
976
+ case 0:
977
+ pdf417key = param.pdf417key;
978
+ isNeedToLoadPDFWIthPreprocess = !!Object.entries(context/* default.config.documentTypes */.Z.config.documentTypes).find(function(param) {
979
+ var _param = loaderPDF_sliced_to_array(param, 2), _ = _param[0], steps = _param[1];
980
+ return steps.find(function(step) {
981
+ return (step.type === 'pdf' || step.type === 'back') && step.mode.uploader;
982
+ });
983
+ });
984
+ return [
985
+ 4,
986
+ (0,workers/* loadWorker */.o)("".concat(context/* default.chunkPublicPath */.Z.chunkPublicPath, "pdfWorker.js.gzip"))
987
+ ];
988
+ case 1:
989
+ worker = _state.sent();
990
+ pdfMod = new PdfModule(worker, pdf417key, isNeedToLoadPDFWIthPreprocess);
991
+ ModuleController/* default.setModule */.Z.setModule('module', 'pdf', pdfMod);
992
+ return [
993
+ 2
994
+ ];
995
+ }
996
+ });
997
+ });
998
+ return function load(_) {
999
+ return _ref.apply(this, arguments);
1000
+ };
1001
+ }();
1002
+ /* harmony default export */ const loaderPDF = (load);
1003
+
1004
+
1005
+ /***/ })
1006
+
1007
+ }])