!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("ZXing",[],e):"object"==typeof exports?exports.ZXing=e():t.ZXing=e()}(window,function(){return r={},t.m=e=[function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=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)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var a,i=r(6),u=(o(s,a=i.default),s);function s(){return null!==a&&a.apply(this,arguments)||this}e.default=u},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=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)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var a,i=r(6),u=(o(s,a=i.default),s);function s(){return null!==a&&a.apply(this,arguments)||this}e.default=u},function(t,e,r){"use strict";var n,o;Object.defineProperty(e,"__esModule",{value:!0}),(o=n=n||{})[o.AZTEC=0]="AZTEC",o[o.CODABAR=1]="CODABAR",o[o.CODE_39=2]="CODE_39",o[o.CODE_93=3]="CODE_93",o[o.CODE_128=4]="CODE_128",o[o.DATA_MATRIX=5]="DATA_MATRIX",o[o.EAN_8=6]="EAN_8",o[o.EAN_13=7]="EAN_13",o[o.ITF=8]="ITF",o[o.MAXICODE=9]="MAXICODE",o[o.PDF_417=10]="PDF_417",o[o.QR_CODE=11]="QR_CODE",o[o.RSS_14=12]="RSS_14",o[o.RSS_EXPANDED=13]="RSS_EXPANDED",o[o.UPC_A=14]="UPC_A",o[o.UPC_E=15]="UPC_E",o[o.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION",e.default=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(14),o=r(74),a=(i.prototype.getX=function(){return this.x},i.prototype.getY=function(){return this.y},i.prototype.equals=function(t){if(t instanceof i){var e=t;return this.x===e.x&&this.y===e.y}return!1},i.prototype.hashCode=function(){return 31*o.default.floatToIntBits(this.x)+o.default.floatToIntBits(this.y)},i.prototype.toString=function(){return"("+this.x+","+this.y+")"},i.orderBestPatterns=function(t){var e,r,n,o=this.distance(t[0],t[1]),a=this.distance(t[1],t[2]),i=this.distance(t[0],t[2]);if(n=o<=a&&i<=a?(r=t[0],e=t[1],t[2]):a<=i&&o<=i?(r=t[1],e=t[0],t[2]):(r=t[2],e=t[0],t[1]),this.crossProductZ(e,r,n)<0){var u=e;e=n,n=u}t[0]=e,t[1]=r,t[2]=n},i.distance=function(t,e){return n.default.distance(t.x,t.y,e.x,e.y)},i.crossProductZ=function(t,e,r){var n=e.x,o=e.y;return(r.x-n)*(t.y-o)-(r.y-o)*(t.x-n)},i);function i(t,e){this.x=t,this.y=e}e.default=a},function(t,e,r){"use strict";var n,o;Object.defineProperty(e,"__esModule",{value:!0}),(o=n=n||{})[o.OTHER=0]="OTHER",o[o.PURE_BARCODE=1]="PURE_BARCODE",o[o.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",o[o.TRY_HARDER=3]="TRY_HARDER",o[o.CHARACTER_SET=4]="CHARACTER_SET",o[o.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",o[o.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",o[o.ASSUME_GS1=7]="ASSUME_GS1",o[o.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",o[o.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",o[o.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS",e.default=n},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=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)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var a,i=r(6),u=(o(s,a=i.default),s);function s(){return null!==a&&a.apply(this,arguments)||this}e.default=u},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=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)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var a,i=r(73),u=(o(s,a=i.CustomError),s);function s(t){void 0===t&&(t=void 0);var e=a.call(this,t)||this;return e.message=t,e}e.default=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=(o.arraycopy=function(t,e,r,n,o){for(;o--;)r[n++]=t[e++]},o.currentTimeMillis=function(){return Date.now()},o);function o(){}e.default=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(15),o=r(7),a=r(28),i=r(11),u=r(1),s=(f.parseFromBooleanArray=function(t){for(var e=t.length,r=t[0].length,n=new f(r,e),o=0;o>>(31&t)&1)},f.prototype.set=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]|=1<<(31&t)&4294967295},f.prototype.unset=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]&=~(1<<(31&t)&4294967295)},f.prototype.flip=function(t,e){var r=e*this.rowSize+Math.floor(t/32);this.bits[r]^=1<<(31&t)&4294967295},f.prototype.xor=function(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new u.default("input matrix dimensions do not match");for(var e=new n.default(Math.floor(this.width/32)+1),r=this.rowSize,o=this.bits,a=0,i=this.height;athis.height||o>this.width)throw new u.default("The region must fit inside the matrix");for(var i=this.rowSize,s=this.bits,f=e;f>>l==0;)l--;i<32*f+l&&(i=32*f+l)}}}return i>>i==0;)i--;return o+=i,Int32Array.from([o,n])},f.prototype.getWidth=function(){return this.width},f.prototype.getHeight=function(){return this.height},f.prototype.getRowSize=function(){return this.rowSize},f.prototype.equals=function(t){if(!(t instanceof f))return!1;var e=t;return this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&a.default.equals(this.bits,e.bits)},f.prototype.hashCode=function(){var t=this.width;return 31*(t=31*(t=31*(t=31*t+this.width)+this.height)+this.rowSize)+a.default.hashCode(this.bits)},f.prototype.toString=function(t,e,r){return void 0===t&&(t="x"),void 0===e&&(e=" "),void 0===r&&(r="\n"),this.buildToString(t,e,r)},f.prototype.buildToString=function(t,e,r){var n=new i.default;n.append(r);for(var o=0,a=this.height;o>(l?8:5));r=l?f:15;for(var h=Math.trunc(f/2),p=0;p=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0},o.distance=function(t,e,r,n){var o=t-r,a=e-n;return Math.sqrt(o*o+a*a)},o.sum=function(t){for(var e=0,r=0,n=t.length;r!==n;r++)e+=t[r];return e},o);function o(){}e.default=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(7),o=r(23),a=r(28),i=r(1),u=(s.prototype.getSize=function(){return this.size},s.prototype.getSizeInBytes=function(){return Math.floor((this.size+7)/8)},s.prototype.ensureCapacity=function(t){if(t>32*this.bits.length){var e=s.makeArray(t);n.default.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}},s.prototype.get=function(t){return 0!=(this.bits[Math.floor(t/32)]&1<<(31&t))},s.prototype.set=function(t){this.bits[Math.floor(t/32)]|=1<<(31&t)},s.prototype.flip=function(t){this.bits[Math.floor(t/32)]^=1<<(31&t)},s.prototype.getNextSet=function(t){var e=this.size;if(e<=t)return e;var r=this.bits,n=Math.floor(t/32),a=r[n];a&=~((1<<(31&t))-1);for(var i=r.length;0===a;){if(++n===i)return e;a=r[n]}var u=32*n+o.default.numberOfTrailingZeros(a);return ethis.size)throw new i.default;if(e!==t){e--;for(var r=Math.floor(t/32),n=Math.floor(e/32),o=this.bits,a=r;a<=n;a++){var u=(2<<(athis.size)throw new i.default;if(e===t)return!0;e--;for(var n=Math.floor(t/32),o=Math.floor(e/32),a=this.bits,u=n;u<=o;u++){var s=(2<<(u>r-1&1))},s.prototype.appendBitArray=function(t){var e=t.size;this.ensureCapacity(this.size+e),this.appendBit;for(var r=0;r>1&1431655765|(1431655765&a)<<1)>>2&858993459|(858993459&a)<<2)>>4&252645135|(252645135&a)<<4)>>8&16711935|(16711935&a)<<8)>>16&65535|(65535&a)<<16,t[e-o]=a}if(this.size!==32*r){var i=32*r-this.size,u=t[0]>>>i;for(o=1;o>>i}t[r-1]=u}this.bits=t},s.makeArray=function(t){return new Int32Array(Math.floor((t+31)/32))},s.prototype.equals=function(t){if(!(t instanceof s))return!1;var e=t;return this.size===e.size&&a.default.equals(this.bits,e.bits)},s.prototype.hashCode=function(){return 31*this.size+a.default.hashCode(this.bits)},s.prototype.toString=function(){for(var t="",e=0,r=this.size;eo[0]&&a[1]=e.getSize()||!e.isRange(m,E,!1))throw new h.default;var S=_.toString();if(S.length<8)throw new p.default;if(!v.checkChecksum(S))throw new w.default;var I=(n[1]+n[0])/2,O=(C[1]+C[0])/2,b=this.getBarcodeFormat(),T=[new d.default(I,t),new d.default(O,t)],M=new s.default(S,null,0,T,b,(new Date).getTime()),N=0;try{var R=c.default.decodeRow(t,e,C[1]);M.putMetadata(f.default.UPC_EAN_EXTENSION,R.getText()),M.putAllMetadata(R.getResultMetadata()),M.addResultPoints(R.getResultPoints()),N=R.getText().length}catch(t){}var P=null==r?null:r.get(u.default.ALLOWED_EAN_EXTENSIONS);if(null!=P){var D=!1;for(var B in P)if(N.toString()===B){D=!0;break}if(!D)throw new h.default}return b===i.default.EAN_13||i.default.UPC_A,M},v.checkChecksum=function(t){return v.checkStandardUPCEANChecksum(t)},v.checkStandardUPCEANChecksum=function(t){var e=t.length;if(0===e)return!1;var r=parseInt(t.charAt(e-1),10);return v.getStandardUPCEANChecksum(t.substring(0,e-1))===r},v.getStandardUPCEANChecksum=function(t){for(var e=t.length,r=0,n=e-1;0<=n;n-=2){if((o=t.charAt(n).charCodeAt(0)-"0".charCodeAt(0))<0||9>>31)},o.numberOfLeadingZeros=function(t){if(0===t)return 32;var e=1;return t>>>16==0&&(e+=16,t<<=16),t>>>24==0&&(e+=8,t<<=8),t>>>28==0&&(e+=4,t<<=4),t>>>30==0&&(e+=2,t<<=2),e-(t>>>31)},o.toHexString=function(t){return t.toString(16)},o.bitCount=function(t){return t=(t=(858993459&(t-=t>>>1&1431655765))+(t>>>2&858993459))+(t>>>4)&252645135,63&(t+=t>>>8)+(t>>>16)},o.MIN_VALUE_32_BITS=-2147483648,o);function o(){}e.default=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(16),o=r(7),a=r(1),i=(u.prototype.getCoefficients=function(){return this.coefficients},u.prototype.getDegree=function(){return this.coefficients.length-1},u.prototype.isZero=function(){return 0===this.coefficients[0]},u.prototype.getCoefficient=function(t){return this.coefficients[this.coefficients.length-1-t]},u.prototype.evaluateAt=function(t){if(0===t)return this.getCoefficient(0);var e,r=this.coefficients;if(1===t){for(var o=e=0,a=r.length;o!==a;o++){var i=r[o];e=n.default.addOrSubtract(e,i)}return e}e=r[0];var u=r.length,s=this.field;for(o=1;or.length){var i=e;e=r,r=i}var s=new Int32Array(r.length),f=r.length-e.length;o.default.arraycopy(r,0,s,0,f);for(var d=f;d=t.getDegree()&&!n.isZero();){var u=n.getDegree()-t.getDegree(),s=e.multiply(n.getCoefficient(n.getDegree()),i),f=t.multiplyByMonomial(u,s),d=e.buildMonomial(u,s);r=r.addOrSubtract(d),n=n.addOrSubtract(f)}return[r,n]},u.prototype.toString=function(){for(var t="",e=this.getDegree();0<=e;e--){var r=this.getCoefficient(e);if(0!==r){if(r<0?(t+=" - ",r=-r):0=s.FOR_BITS.size)throw new i.default;return s.FOR_BITS.get(t)},s.FOR_BITS=new Map,s.FOR_VALUE=new Map,s.L=new s(n.L,"L",1),s.M=new s(n.M,"M",0),s.Q=new s(n.Q,"Q",3),s.H=new s(n.H,"H",2),s);function s(t,e,r){this.value=t,this.stringValue=e,this.bits=r,s.FOR_BITS.set(r,this),s.FOR_VALUE.set(t,this)}e.default=u},function(t,e,r){"use strict";var n,o;Object.defineProperty(e,"__esModule",{value:!0}),(o=n=n||{})[o.ERROR_CORRECTION=0]="ERROR_CORRECTION",o[o.CHARACTER_SET=1]="CHARACTER_SET",o[o.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",o[o.MIN_SIZE=3]="MIN_SIZE",o[o.MAX_SIZE=4]="MAX_SIZE",o[o.MARGIN=5]="MARGIN",o[o.PDF417_COMPACT=6]="PDF417_COMPACT",o[o.PDF417_COMPACTION=7]="PDF417_COMPACTION",o[o.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",o[o.AZTEC_LAYERS=9]="AZTEC_LAYERS",o[o.QR_VERSION=10]="QR_VERSION",e.default=n},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=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)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var a,i=r(6),u=(o(s,a=i.default),s);function s(){return null!==a&&a.apply(this,arguments)||this}e.default=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(7),o=(a.equals=function(t,e){if(!t)return!1;if(!e)return!1;if(!t.length)return!1;if(!e.length)return!1;if(t.length!==e.length)return!1;for(var r=0,n=t.length;r>1,u=r(e,t[i]);if(0=(r/2|0);){var l=u,c=f;if(f=d,(u=s).isZero())throw new a.default("r_{i-1} was zero");s=l;for(var h=o.getZero(),p=u.getCoefficient(u.getDegree()),w=o.inverse(p);s.getDegree()>=u.getDegree()&&!s.isZero();){var g=s.getDegree()-u.getDegree(),v=o.multiply(s.getCoefficient(s.getDegree()),w);h=h.addOrSubtract(o.buildMonomial(g,v)),s=s.addOrSubtract(u.multiplyByMonomial(g,v))}if(d=h.multiply(f).addOrSubtract(c),s.getDegree()>=u.getDegree())throw new i.default("Division algorithm failed to reduce polynomial?")}var _=d.getCoefficient(0);if(0===_)throw new a.default("sigmaTilde(0) was zero");var y=o.inverse(_);return[d.multiplyScalar(y),s.multiplyScalar(y)]},s.prototype.findErrorLocations=function(t){var e=t.getDegree();if(1===e)return Int32Array.from([t.getCoefficient(1)]);for(var r=new Int32Array(e),n=0,o=this.field,i=1;ithis.available())throw new n.default(""+t);var e=0,r=this.bitOffset,o=this.byteOffset,a=this.bytes;if(0>8-u<<(f=i-u);e=(a[o]&s)>>f,t-=u,8===(r+=u)&&(r=0,o++)}if(0>(f=8-t)<>f,r+=t)}return this.bitOffset=r,this.byteOffset=o,e},a.prototype.available=function(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset},a);function a(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}e.default=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(29),o=r(22),a=(i.decode=function(t,e){var r=this.encodingName(e);return"undefined"==typeof TextDecoder?this.decodeFallback(t,r):new TextDecoder(r).decode(t)},i.encode=function(t,e){return i.isBrowser()?"undefined"==typeof TextEncoder?this.encodeFallback(t):(new TextEncoder).encode(t):new TextEncoder(this.encodingName(e),{NONSTANDARD_allowLegacyEncoding:!0}).encode(t)},i.isBrowser=function(){return"undefined"!=typeof window&&"[object Window]"==={}.toString.call(window)},i.encodingName=function(t){return"string"==typeof t?t:t.getName()},i.encodingCharacterSet=function(t){return o.default.getCharacterSetECIByName(this.encodingName(t))},i.decodeFallback=function(t,e){var r=this.encodingCharacterSet(e);if(r.equals(o.default.UTF8)||r.equals(o.default.ISO8859_1)||r.equals(o.default.ASCII)){for(var a="",i=0,u=t.length;i=t.getWidth())throw new l.default;var f=Math.round((s-i+1)/n),d=Math.round((a-o+1)/n);if(f<=0||d<=0)throw new l.default;if(d!==f)throw new l.default;var c=Math.floor(n/2);o+=c;var h=(i+=c)+Math.floor((f-1)*n)-s;if(0r)throw new g.default("data bits cannot fit in the QR Code"+e.getSize()+" > "+r);for(var n=0;n<4&&e.getSize()>8)+(255&u);e.appendBits(s,13)}},_.appendECI=function(t,e){e.appendBits(s.default.ECI.getBits(),4),e.appendBits(t.getValue(),8)},_.ALPHANUMERIC_TABLE=Int32Array.from([-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,36,-1,-1,-1,37,38,-1,-1,-1,-1,39,40,-1,41,42,43,0,1,2,3,4,5,6,7,8,9,44,-1,-1,-1,-1,-1,-1,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,-1,-1,-1,-1,-1]),_.DEFAULT_BYTE_MODE_ENCODING=a.default.UTF8.getName(),_);function _(){}e.default=v},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(11),o=(a.prototype.getMode=function(){return this.mode},a.prototype.getECLevel=function(){return this.ecLevel},a.prototype.getVersion=function(){return this.version},a.prototype.getMaskPattern=function(){return this.maskPattern},a.prototype.getMatrix=function(){return this.matrix},a.prototype.toString=function(){var t=new n.default;return t.append("<<\n"),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append("\n ecLevel: "),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append("\n version: "),t.append(this.version?this.version.toString():"null"),t.append("\n maskPattern: "),t.append(this.maskPattern.toString()),this.matrix?(t.append("\n matrix:\n"),t.append(this.matrix.toString())):t.append("\n matrix: null\n"),t.append(">>\n"),t.toString()},a.prototype.setMode=function(t){this.mode=t},a.prototype.setECLevel=function(t){this.ecLevel=t},a.prototype.setVersion=function(t){this.version=t},a.prototype.setMaskPattern=function(t){this.maskPattern=t},a.prototype.setMatrix=function(t){this.matrix=t},a.isValidMaskPattern=function(t){return 0<=t&&t>f.BLOCK_SIZE_POWER;0!=(e&f.BLOCK_SIZE_MASK)&&o++;var i=r>>f.BLOCK_SIZE_POWER;0!=(r&f.BLOCK_SIZE_MASK)&&i++;var s=f.calculateBlackPoints(n,o,i,e,r),d=new u.default(e,r);f.calculateThresholdForBlock(n,o,i,e,r,s,d),this.matrix=d}else this.matrix=a.prototype.getBlackMatrix.call(this);return this.matrix},f.prototype.createBinarizer=function(t){return new f(t)},f.calculateThresholdForBlock=function(t,e,r,n,o,a,i){for(var u=o-f.BLOCK_SIZE,s=n-f.BLOCK_SIZE,d=0;d>2*f.BLOCK_SIZE_POWER;if(w-p<=f.MIN_DYNAMIC_RANGE&&(C=p/2,0>l.LUMINANCE_SHIFT]++;var s=l.estimateBlackPoint(a);if(n<3)for(i=0;i>l.LUMINANCE_SHIFT]++;var c=l.estimateBlackPoint(o),h=t.getMatrix();for(a=0;ao&&(o=t[n=a]),t[a]>r&&(r=t[a]);var i=0,u=0;for(a=0;a>10,n[a]=u}return n},d.prototype.getRow=function(t,e){if(t<0||t>=this.getHeight())throw new s.default("Requested row is outside the image: "+t);var r=this.getWidth(),n=t*r;return null===e?e=this.buffer.slice(n,n+r):(e.length=this.height||this.rightInit>=this.width)throw new a.default}e.default=i},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(4),o=r(2),a=r(39),i=r(30),u=r(31),s=r(0),f=r(67),d=(l.prototype.decode=function(t,e){return this.setHints(e),this.decodeInternal(t)},l.prototype.decodeWithState=function(t){return null!==this.readers&&void 0!==this.readers||this.setHints(null),this.decodeInternal(t)},l.prototype.setHints=function(t){var e=null!=(this.hints=t)&&void 0!==t.get(n.default.TRY_HARDER),r=null==t?null:t.get(n.default.POSSIBLE_FORMATS),s=new Array;if(null!=r){var f=r.some(function(t){return t===o.default.UPC_A||t===o.default.UPC_E||t===o.default.EAN_13||t===o.default.EAN_8||t===o.default.CODABAR||t===o.default.CODE_39||t===o.default.CODE_93||t===o.default.CODE_128||t===o.default.ITF||t===o.default.RSS_14||t===o.default.RSS_EXPANDED});f&&!e&&s.push(new i.default(t)),r.includes(o.default.QR_CODE)&&s.push(new a.default),r.includes(o.default.DATA_MATRIX)&&s.push(new u.default),f&&e&&s.push(new i.default(t))}0===s.length&&(e||s.push(new i.default(t)),s.push(new a.default),s.push(new u.default),e&&s.push(new i.default(t))),this.readers=s},l.prototype.reset=function(){if(null!==this.readers)for(var t=0,e=this.readers;t>3&3),this.dataMask=7&t}e.default=a},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=(o.prototype.isMirrored=function(){return this.mirrored},o.prototype.applyMirroredCorrection=function(t){if(this.mirrored&&null!==t&&!(t.length<3)){var e=t[0];t[0]=t[2],t[2]=e}},o);function o(t){this.mirrored=t}e.default=n},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(4),o=r(22),a=(i.prototype.StringUtils=function(){},i.guessEncoding=function(t,e){if(null!=e&&void 0!==e.get(n.default.CHARACTER_SET))return e.get(n.default.CHARACTER_SET).toString();for(var r=t.length,o=!0,a=!0,u=!0,s=0,f=0,d=0,l=0,c=0,h=0,p=0,w=0,g=0,v=0,_=0,y=3=e.length)for(var r=e[e.length-1],o=this.field,a=e.length;a<=t;a++){var i=r.multiply(new n.default(o,Int32Array.from([1,o.exp(a-1+o.getGeneratorBase())])));e.push(i),r=i}return e[t]},u.prototype.encode=function(t,e){if(0===e)throw new a.default("No error correction bytes");var r=t.length-e;if(r<=0)throw new a.default("No data bytes provided");var i=this.buildGenerator(e),u=new Int32Array(r);o.default.arraycopy(t,0,u,0,r);for(var s=new n.default(this.field,u),f=(s=s.multiplyByMonomial(e,1)).divide(i)[1].getCoefficients(),d=e-f.length,l=0;ln&&(n=e[o],r=o);t[r]++},d.decrement=function(t,e){for(var r=0,n=e[0],o=1;o05"),r.insert(0,"");break;case 237:e.append("[)>06"),r.insert(0,"");break;case 238:return n.ANSIX12_ENCODE;case 239:return n.TEXT_ENCODE;case 240:return n.EDIFACT_ENCODE;case 241:break;default:if(254!==a||0!==t.available())throw new d.default}}while(0");break;case 3:e.append(" ");break;default:if(a<14)e.append(String.fromCharCode(a+44));else{if(!(a<40))throw new d.default;e.append(String.fromCharCode(a+51))}}}}while(0","?","@","[","\\","]","^","_"],h.TEXT_BASIC_SET_CHARS=["*","*","*"," ","0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"],h.TEXT_SHIFT2_SET_CHARS=h.C40_SHIFT2_SET_CHARS,h.TEXT_SHIFT3_SET_CHARS=["`","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","{","|","}","~",String.fromCharCode(127)],h);function h(){}e.default=c},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3),o=r(36),a=r(37),i=r(14),u=r(61),s=r(0),f=(d.prototype.detect=function(){var t=this.rectangleDetector.detect(),e=t[0],r=t[1],a=t[2],i=t[3],u=[];u.push(this.transitionsBetween(e,r)),u.push(this.transitionsBetween(e,a)),u.push(this.transitionsBetween(r,i)),u.push(this.transitionsBetween(a,i)),u.sort(l.resultPointsAndTransitionsComparator);var f=u[0],c=u[1],h=new Map;d.increment(h,f.getFrom()),d.increment(h,f.getTo()),d.increment(h,c.getFrom()),d.increment(h,c.getTo());for(var p=null,w=null,g=null,v=0,_=Array.from(h.entries());v<_.length;v++){var y=_[v],C=y[0];2===y[1]?w=C:null==p?p=C:g=C}if(null==p||null==w||null==g)throw new s.default;var A=[p,w,g];n.default.orderBestPatterns(A);var m=A[0];w=A[1];var E,S=A[2];E=h.has(e)?h.has(r)?h.has(a)?i:a:r:e;var I,O,b=this.transitionsBetween(S,E).getTransitions(),T=this.transitionsBetween(m,E).getTransitions();if(1==(1&b)&&b++,1==(1&T)&&T++,7*(T+=2)<=4*(b+=2)||7*b<=4*T)null==(O=this.correctTopRightRectangular(w,m,S,E,b,T))&&(O=E),1==(1&(b=this.transitionsBetween(S,O).getTransitions()))&&b++,1==(1&(T=this.transitionsBetween(m,O).getTransitions()))&&T++,I=d.sampleGrid(this.image,S,w,m,O,b,T);else{var M=Math.min(T,b);null==(O=this.correctTopRight(w,m,S,E,M))&&(O=E);var N=Math.max(this.transitionsBetween(S,O).getTransitions(),this.transitionsBetween(m,O).getTransitions());1==(1&++N)&&N++,I=d.sampleGrid(this.image,S,w,m,O,N,N)}return new o.default(I,[S,w,m,O])},d.prototype.correctTopRightRectangular=function(t,e,r,o,a,i){var u=d.distance(t,e)/a,s=d.distance(r,o),f=(o.getX()-r.getX())/s,l=(o.getY()-r.getY())/s,c=new n.default(o.getX()+u*f,o.getY()+u*l);u=d.distance(t,r)/i,s=d.distance(e,o),f=(o.getX()-e.getX())/s,l=(o.getY()-e.getY())/s;var h=new n.default(o.getX()+u*f,o.getY()+u*l);return this.isValid(c)?this.isValid(h)?Math.abs(a-this.transitionsBetween(r,c).getTransitions())+Math.abs(i-this.transitionsBetween(e,c).getTransitions())<=Math.abs(a-this.transitionsBetween(r,h).getTransitions())+Math.abs(i-this.transitionsBetween(e,h).getTransitions())?c:h:c:this.isValid(h)?h:null},d.prototype.correctTopRight=function(t,e,r,o,a){var i=d.distance(t,e)/a,u=d.distance(r,o),s=(o.getX()-r.getX())/u,f=(o.getY()-r.getY())/u,l=new n.default(o.getX()+i*s,o.getY()+i*f);i=d.distance(t,r)/a,u=d.distance(e,o),s=(o.getX()-e.getX())/u,f=(o.getY()-e.getY())/u;var c=new n.default(o.getX()+i*s,o.getY()+i*f);return this.isValid(l)?this.isValid(c)?Math.abs(this.transitionsBetween(r,l).getTransitions()-this.transitionsBetween(e,l).getTransitions())<=Math.abs(this.transitionsBetween(r,c).getTransitions()-this.transitionsBetween(e,c).getTransitions())?l:c:l:this.isValid(c)?c:null},d.prototype.isValid=function(t){return 0<=t.getX()&&t.getX()Math.abs(o-r);if(i){var u=r;r=n,n=u,u=o,o=a,a=u}for(var s=Math.abs(o-r),f=Math.abs(a-n),d=-s/2,c=nt.available())throw new d.default;for(var n=new Uint8Array(2*r),o=0;0>8&255,n[o+1]=255&u,o+=2,r--}try{e.append(f.default.decode(n,i.default.GB2312))}catch(t){throw new d.default(t)}},c.decodeKanjiSegment=function(t,e,r){if(13*r>t.available())throw new d.default;for(var n=new Uint8Array(2*r),o=0;0>8,n[o+1]=u,o+=2,r--}try{e.append(f.default.decode(n,i.default.SHIFT_JIS))}catch(t){throw new d.default(t)}},c.decodeByteSegment=function(t,e,r,n,o,a){if(8*r>t.available())throw new d.default;for(var u,s=new Uint8Array(r),l=0;l=c.ALPHANUMERIC_CHARS.length)throw new d.default;return c.ALPHANUMERIC_CHARS[t]},c.decodeAlphanumericSegment=function(t,e,r,n){for(var o=e.length();1=this.image.getWidth()&&(a=(this.image.getWidth()-1-t)/(i-t),i=this.image.getWidth()-1);var u=Math.floor(e-(n-e)*a);return a=1,u<0?(a=e/(e-u),u=0):u>=this.image.getHeight()&&(a=(this.image.getHeight()-1-e)/(u-e),u=this.image.getHeight()-1),i=Math.floor(t+(i-t)*a),(o+=this.sizeOfBlackWhiteBlackRun(t,e,i,u))-1},p.prototype.sizeOfBlackWhiteBlackRun=function(t,e,r,n){var o=Math.abs(n-e)>Math.abs(r-t);if(o){var a=t;t=e,e=a,a=r,r=n,n=a}for(var i=Math.abs(r-t),u=Math.abs(n-e),f=-i/2,d=tc[2]&&(h+=g-c[2]-d,w=s-1)}c[p=0]=0,c[1]=0,c[2]=0,c[3]=0,c[4]=0}else c[0]=c[2],c[1]=c[3],c[2]=c[4],c[3]=1,c[4]=0,p=3;else c[++p]++;else c[p]++;f.foundPatternCross(c)&&!0===this.handlePossibleCenter(c,h,s,r)&&(d=c[0],this.hasSkipped&&(l=this.haveMultiplyConfirmedCenters()))}var v=this.selectBestPatterns();return o.default.orderBestPatterns(v),new i.default(v)},f.centerFromEnd=function(t,e){return e-t[4]-t[3]-t[2]/2},f.foundPatternCross=function(t){for(var e=0,r=0;r<5;r++){var n=t[r];if(0===n)return!1;e+=n}if(e<7)return!1;var o=e/7,a=o/2;return Math.abs(o-t[0])r)return!1;for(;a<=t&&a<=e&&i.get(e-a,t-a)&&o[0]<=r;)o[0]++,a++;if(o[0]>r)return!1;var u=i.getHeight(),s=i.getWidth();for(a=1;t+a=r)return!1;for(;t+a=r)return!1;var d=o[0]+o[1]+o[2]+o[3]+o[4];return Math.abs(d-n)<2*n&&f.foundPatternCross(o)},f.prototype.crossCheckVertical=function(t,e,r,n){for(var o=this.image,a=o.getHeight(),i=this.getCrossCheckStateCount(),u=t;0<=u&&o.get(e,u);)i[2]++,u--;if(u<0)return NaN;for(;0<=u&&!o.get(e,u)&&i[1]<=r;)i[1]++,u--;if(u<0||i[1]>r)return NaN;for(;0<=u&&o.get(e,u)&&i[0]<=r;)i[0]++,u--;if(i[0]>r)return NaN;for(u=t+1;u=r)return NaN;for(;u=r)return NaN;var s=i[0]+i[1]+i[2]+i[3]+i[4];return 5*Math.abs(s-n)>=2*n?NaN:f.foundPatternCross(i)?f.centerFromEnd(i,u):NaN},f.prototype.crossCheckHorizontal=function(t,e,r,n){for(var o=this.image,a=o.getWidth(),i=this.getCrossCheckStateCount(),u=t;0<=u&&o.get(u,e);)i[2]++,u--;if(u<0)return NaN;for(;0<=u&&!o.get(u,e)&&i[1]<=r;)i[1]++,u--;if(u<0||i[1]>r)return NaN;for(;0<=u&&o.get(u,e)&&i[0]<=r;)i[0]++,u--;if(i[0]>r)return NaN;for(u=t+1;u=r)return NaN;for(;u=r)return NaN;var s=i[0]+i[1]+i[2]+i[3]+i[4];return 5*Math.abs(s-n)>=n?NaN:f.foundPatternCross(i)?f.centerFromEnd(i,u):NaN},f.prototype.handlePossibleCenter=function(t,e,r,n){var o=t[0]+t[1]+t[2]+t[3]+t[4],i=f.centerFromEnd(t,r),u=this.crossCheckVertical(e,Math.floor(i),t[2],o);if(isNaN(u)||(i=this.crossCheckHorizontal(Math.floor(i),Math.floor(u),t[2],o),isNaN(i)||n&&!this.crossCheckDiagonal(Math.floor(u),Math.floor(i),t[2],o)))return!1;for(var s=o/7,d=!1,l=this.possibleCenters,c=0,h=l.length;c=f.CENTER_QUORUM){if(null!=t)return this.hasSkipped=!0,Math.floor((Math.abs(t.getX()-n.getX())-Math.abs(t.getY()-n.getY()))/2);t=n}}return 0},f.prototype.haveMultiplyConfirmedCenters=function(){for(var t=0,e=0,r=this.possibleCenters.length,n=0,o=this.possibleCenters;n=f.CENTER_QUORUM&&(t++,e+=d.getEstimatedModuleSize());if(t<3)return!1;for(var a=e/r,i=0,u=0,s=this.possibleCenters;ud&&(r.splice(l,1),l--)}}if(3=r)return!1;return!0},i.prototype.crossCheckVertical=function(t,e,r,n){var o=this.image,a=o.getHeight(),u=this.crossCheckStateCount;u[0]=0,u[1]=0,u[2]=0;for(var s=t;0<=s&&o.get(e,s)&&u[1]<=r;)u[1]++,s--;if(s<0||u[1]>r)return NaN;for(;0<=s&&!o.get(e,s)&&u[0]<=r;)u[0]++,s--;if(u[0]>r)return NaN;for(s=t+1;sr)return NaN;for(;sr)return NaN;var f=u[0]+u[1]+u[2];return 5*Math.abs(f-n)>=2*n?NaN:this.foundPatternCross(u)?i.centerFromEnd(u,s):NaN},i.prototype.handlePossibleCenter=function(t,e,r){var o=t[0]+t[1]+t[2],a=i.centerFromEnd(t,r),u=this.crossCheckVertical(e,a,2*t[1],o);if(!isNaN(u)){for(var s=(t[0]+t[1]+t[2])/3,f=0,d=this.possibleCenters;f=r;)t^=e<=this.getHeight())throw new f.default("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length=this.getHeight())throw new f.default("Requested row is outside the image: "+t);var r=this.getWidth();(null==e||e.length>16&255,w=h>>7&510,g=255&h;l[c]=(p+w+g)/4&255}s.luminances=l}else s.luminances=t;if(void 0===n&&(s.dataWidth=e),void 0===o&&(s.dataHeight=r),void 0===i&&(s.left=0),void 0===u&&(s.top=0),s.left+e>s.dataWidth||s.top+r>s.dataHeight)throw new f.default("Crop rectangle does not fit within image data.");return s}e.default=d}],t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var o in e)t.d(n,o,function(t){return e[t]}.bind(null,o));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t.p="",t(t.s=71);function t(n){if(r[n])return r[n].exports;var o=r[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var e,r});