=8?t.readCode(e,r,8):t.readCode(e,r,n)<<8-n},t.convertBoolArrayToByteArray=function(e){for(var r=new Uint8Array((e.length+7)/8),n=0;n=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")},ce=function(t){function e(){var e=t.call(this)||this;return e.decodeMiddleCounters=new Int32Array(4),e}return ue(e,t),e.prototype.decodeMiddle=function(t,r,n){var o,i,a=this.decodeMiddleCounters.map((function(t){return t}));a[0]=0,a[1]=0,a[2]=0,a[3]=0;for(var u=t.getSize(),s=r[1],c=0,f=0;f<6&&s=10&&(c|=1<<5-f)}return e.determineNumSysAndCheckDigit(new k(n),c),s},e.prototype.decodeEnd=function(t,r){return e.findGuardPatternWithoutCounters(t,r,!0,e.MIDDLE_END_PATTERN)},e.prototype.checkChecksum=function(t){return Jt.checkChecksum(e.convertUPCEtoUPCA(t))},e.determineNumSysAndCheckDigit=function(t,e){for(var r=0;r<=1;r++)for(var n=0;n<10;n++)if(e===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[r][n])return t.insert(0,\"0\"+r),void t.append(\"0\"+n);throw U.getNotFoundInstance()},e.prototype.getBarcodeFormat=function(){return nt.UPC_E},e.convertUPCEtoUPCA=function(t){var e=t.slice(1,7).split(\"\").map((function(t){return t.charCodeAt(0)})),r=new k;r.append(t.charAt(0));var n=e[5];switch(n){case 0:case 1:case 2:r.appendChars(e,0,2),r.append(n),r.append(\"0000\"),r.appendChars(e,2,3);break;case 3:r.appendChars(e,0,3),r.append(\"00000\"),r.appendChars(e,3,2);break;case 4:r.appendChars(e,0,4),r.append(\"00000\"),r.append(e[4]);break;default:r.appendChars(e,0,5),r.append(\"0000\"),r.append(n)}return t.length>=8&&r.append(t.charAt(7)),r.toString()},e.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),e.NUMSYS_AND_CHECK_DIGIT_PATTERNS=[Int32Array.from([56,52,50,49,44,38,35,42,41,37]),Int32Array.from([7,11,13,14,19,25,28,21,22,1])],e}(Jt),fe=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),he=function(t){var e=\"function\"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&\"number\"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")},le=function(t){function e(e){var r=t.call(this)||this,n=null==e?null:e.get(T.POSSIBLE_FORMATS),o=[];return null!=n&&(n.indexOf(nt.EAN_13)>-1?o.push(new ee):n.indexOf(nt.UPC_A)>-1&&o.push(new ae),n.indexOf(nt.EAN_8)>-1&&o.push(new oe),n.indexOf(nt.UPC_E)>-1&&o.push(new ce)),0===o.length&&(o.push(new ee),o.push(new oe),o.push(new ce)),r.readers=o,r}return fe(e,t),e.prototype.decodeRow=function(t,e,r){var n,o;try{for(var i=he(this.readers),a=i.next();!a.done;a=i.next()){var u=a.value;try{var s=u.decodeRow(t,e,r),c=s.getBarcodeFormat()===nt.EAN_13&&\"0\"===s.getText().charAt(0),f=null==r?null:r.get(T.POSSIBLE_FORMATS),h=null==f||f.includes(nt.UPC_A);if(c&&h){var l=s.getRawBytes(),d=new et(s.getText().substring(1),l,l.length,s.getResultPoints(),nt.UPC_A);return d.putAllMetadata(s.getResultMetadata()),d}return s}catch(t){}}}catch(t){n={error:t}}finally{try{a&&!a.done&&(o=i.return)&&o.call(i)}finally{if(n)throw n.error}}throw new U},e.prototype.reset=function(){var t,e;try{for(var r=he(this.readers),n=r.next();!n.done;n=r.next()){n.value.reset()}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}},e}(Lt),de=function(){var t=function(e,r){return t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},t(e,r)};return function(e,r){function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),pe=function(t){var e=\"function\"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&\"number\"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")},ge=function(t){function e(){var e=t.call(this)||this;return e.decodeFinderCounters=new Int32Array(4),e.dataCharacterCounters=new Int32Array(8),e.oddRoundingErrors=new Array(4),e.evenRoundingErrors=new Array(4),e.oddCounts=new Array(e.dataCharacterCounters.length/2),e.evenCounts=new Array(e.dataCharacterCounters.length/2),e}return de(e,t),e.prototype.getDecodeFinderCounters=function(){return this.decodeFinderCounters},e.prototype.getDataCharacterCounters=function(){return this.dataCharacterCounters},e.prototype.getOddRoundingErrors=function(){return this.oddRoundingErrors},e.prototype.getEvenRoundingErrors=function(){return this.evenRoundingErrors},e.prototype.getOddCounts=function(){return this.oddCounts},e.prototype.getEvenCounts=function(){return this.evenCounts},e.prototype.parseFinderValue=function(t,r){for(var n=0;n=0;--s)0!=(c&1<10||n<0||n>10)throw new R;return o.firstDigit=r,o.secondDigit=n,o}return Te(e,t),e.prototype.getFirstDigit=function(){return this.firstDigit},e.prototype.getSecondDigit=function(){return this.secondDigit},e.prototype.getValue=function(){return 10*this.firstDigit+this.secondDigit},e.prototype.isFirstDigitFNC1=function(){return this.firstDigit===e.FNC1},e.prototype.isSecondDigitFNC1=function(){return this.secondDigit===e.FNC1},e.prototype.isAnyFNC1=function(){return this.firstDigit===e.FNC1||this.secondDigit===e.FNC1},e.FNC1=10,e}(Ee),Re=function(t){var e=\"function\"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&\"number\"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")},Ne=function(){function t(){}return t.parseFieldsInGeneralPurpose=function(e){var r,n,o,i,a,u,s,c;if(!e)return null;if(e.length<2)throw new U;var f=e.substring(0,2);try{for(var h=Re(t.TWO_DIGIT_DATA_LENGTH),l=h.next();!l.done;l=h.next()){if((A=l.value)[0]===f)return A[1]===t.VARIABLE_LENGTH?t.processVariableAI(2,A[2],e):t.processFixedAI(2,A[1],e)}}catch(t){r={error:t}}finally{try{l&&!l.done&&(n=h.return)&&n.call(h)}finally{if(r)throw r.error}}if(e.length<3)throw new U;var d=e.substring(0,3);try{for(var p=Re(t.THREE_DIGIT_DATA_LENGTH),g=p.next();!g.done;g=p.next()){if((A=g.value)[0]===d)return A[1]===t.VARIABLE_LENGTH?t.processVariableAI(3,A[2],e):t.processFixedAI(3,A[1],e)}}catch(t){o={error:t}}finally{try{g&&!g.done&&(i=p.return)&&i.call(p)}finally{if(o)throw o.error}}try{for(var y=Re(t.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH),w=y.next();!w.done;w=y.next()){if((A=w.value)[0]===d)return A[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,A[2],e):t.processFixedAI(4,A[1],e)}}catch(t){a={error:t}}finally{try{w&&!w.done&&(u=y.return)&&u.call(y)}finally{if(a)throw a.error}}if(e.length<4)throw new U;var _=e.substring(0,4);try{for(var v=Re(t.FOUR_DIGIT_DATA_LENGTH),m=v.next();!m.done;m=v.next()){var A;if((A=m.value)[0]===_)return A[1]===t.VARIABLE_LENGTH?t.processVariableAI(4,A[2],e):t.processFixedAI(4,A[1],e)}}catch(t){s={error:t}}finally{try{m&&!m.done&&(c=v.return)&&c.call(v)}finally{if(s)throw s.error}}throw new U},t.processFixedAI=function(e,r,n){if(n.length>s,r+=t}}return this.bitOffset=r,this.byteOffset=n,e},t.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},t}();!function(t){t[t.PAD_ENCODE=0]=\"PAD_ENCODE\",t[t.ASCII_ENCODE=1]=\"ASCII_ENCODE\",t[t.C40_ENCODE=2]=\"C40_ENCODE\",t[t.TEXT_ENCODE=3]=\"TEXT_ENCODE\",t[t.ANSIX12_ENCODE=4]=\"ANSIX12_ENCODE\",t[t.EDIFACT_ENCODE=5]=\"EDIFACT_ENCODE\",t[t.BASE256_ENCODE=6]=\"BASE256_ENCODE\"}(lr||(lr={}));var Ar,Er=function(){function t(){}return t.decode=function(t){var e=new mr(t),r=new k,n=new k,o=new Array,i=lr.ASCII_ENCODE;do{if(i===lr.ASCII_ENCODE)i=this.decodeAsciiSegment(e,r,n);else{switch(i){case lr.C40_ENCODE:this.decodeC40Segment(e,r);break;case lr.TEXT_ENCODE:this.decodeTextSegment(e,r);break;case lr.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,r);break;case lr.EDIFACT_ENCODE:this.decodeEdifactSegment(e,r);break;case lr.BASE256_ENCODE:this.decodeBase256Segment(e,r,o);break;default:throw new R}i=lr.ASCII_ENCODE}}while(i!==lr.PAD_ENCODE&&e.available()>0);return n.length()>0&&r.append(n.toString()),new at(t,r.toString(),0===o.length?null:o,null)},t.decodeAsciiSegment=function(t,e,r){var n=!1;do{var o=t.readBits(8);if(0===o)throw new R;if(o<=128)return n&&(o+=128),e.append(String.fromCharCode(o-1)),lr.ASCII_ENCODE;if(129===o)return lr.PAD_ENCODE;if(o<=229){var i=o-130;i<10&&e.append(\"0\"),e.append(\"\"+i)}else switch(o){case 230:return lr.C40_ENCODE;case 231:return lr.BASE256_ENCODE;case 232:e.append(String.fromCharCode(29));break;case 233:case 234:case 241:break;case 235:n=!0;break;case 236:e.append(\"[)>\u001e05\u001d\"),r.insert(0,\"\u001e\u0004\");break;case 237:e.append(\"[)>\u001e06\u001d\"),r.insert(0,\"\u001e\u0004\");break;case 238:return lr.ANSIX12_ENCODE;case 239:return lr.TEXT_ENCODE;case 240:return lr.EDIFACT_ENCODE;default:if(254!==o||0!==t.available())throw new R}}while(t.available()>0);return lr.ASCII_ENCODE},t.decodeC40Segment=function(t,e){var r=!1,n=[],o=0;do{if(8===t.available())return;var i=t.readBits(8);if(254===i)return;this.parseTwoBytes(i,t.readBits(8),n);for(var a=0;a<3;a++){var u=n[a];switch(o){case 0:if(u<3)o=u+1;else{if(!(u=t.FOR_BITS.size)throw new l;return t.FOR_BITS.get(e)},t.FOR_BITS=new Map,t.FOR_VALUE=new Map,t.L=new t(Ar.L,\"L\",1),t.M=new t(Ar.M,\"M\",0),t.Q=new t(Ar.Q,\"Q\",3),t.H=new t(Ar.H,\"H\",2),t}(),Nr=function(t){var e=\"function\"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&\"number\"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")},Dr=function(){function t(t){this.errorCorrectionLevel=Rr.forBits(t>>3&3),this.dataMask=7&t}return t.numBitsDiffering=function(t,e){return I.bitCount(t^e)},t.decodeFormatInformation=function(e,r){var n=t.doDecodeFormatInformation(e,r);return null!==n?n:t.doDecodeFormatInformation(e^t.FORMAT_INFO_MASK_QR,r^t.FORMAT_INFO_MASK_QR)},t.doDecodeFormatInformation=function(e,r){var n,o,i=Number.MAX_SAFE_INTEGER,a=0;try{for(var u=Nr(t.FORMAT_INFO_DECODE_LOOKUP),s=u.next();!s.done;s=u.next()){var c=s.value,f=c[0];if(f===e||f===r)return new t(c[1]);var h=t.numBitsDiffering(e,f);h=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?\"Object is not iterable.\":\"Symbol.iterator is not defined.\")},Mr=function(){function t(t){for(var e=[],r=1;r=s||r+a>=c)return!1;for(;e+a=s||r+a>=c||i[3]>=n)return!1;for(;e+a=n)return!1;var f=i[0]+i[1]+i[2]+i[3]+i[4];return Math.abs(f-o)<2*o&&t.foundPatternCross(i)},t.prototype.crossCheckVertical=function(e,r,n,o){for(var i=this.image,a=i.getHeight(),u=this.getCrossCheckStateCount(),s=e;s>=0&&i.get(r,s);)u[2]++,s--;if(s<0)return NaN;for(;s>=0&&!i.get(r,s)&&u[1]<=n;)u[1]++,s--;if(s<0||u[1]>n)return NaN;for(;s>=0&&i.get(r,s)&&u[0]<=n;)u[0]++,s--;if(u[0]>n)return NaN;for(s=e+1;s=n)return NaN;for(;s=n)return NaN;var c=u[0]+u[1]+u[2]+u[3]+u[4];return 5*Math.abs(c-o)>=2*o?NaN:t.foundPatternCross(u)?t.centerFromEnd(u,s):NaN},t.prototype.crossCheckHorizontal=function(e,r,n,o){for(var i=this.image,a=i.getWidth(),u=this.getCrossCheckStateCount(),s=e;s>=0&&i.get(s,r);)u[2]++,s--;if(s<0)return NaN;for(;s>=0&&!i.get(s,r)&&u[1]<=n;)u[1]++,s--;if(s<0||u[1]>n)return NaN;for(;s>=0&&i.get(s,r)&&u[0]<=n;)u[0]++,s--;if(u[0]>n)return NaN;for(s=e+1;s=n)return NaN;for(;s=n)return NaN;var c=u[0]+u[1]+u[2]+u[3]+u[4];return 5*Math.abs(c-o)>=o?NaN:t.foundPatternCross(u)?t.centerFromEnd(u,s):NaN},t.prototype.handlePossibleCenter=function(e,r,n,o){var i=e[0]+e[1]+e[2]+e[3]+e[4],a=t.centerFromEnd(e,n),u=this.crossCheckVertical(r,Math.floor(a),e[2],i);if(!isNaN(u)&&(a=this.crossCheckHorizontal(Math.floor(a),Math.floor(u),e[2],i),!isNaN(a)&&(!o||this.crossCheckDiagonal(Math.floor(u),Math.floor(a),e[2],i)))){for(var s=i/7,c=!1,f=this.possibleCenters,h=0,l=f.length;h