1function __vite__mapDeps(indexes) { 2 if (!__vite__mapDeps.viteFileDeps) { 3 __vite__mapDeps.viteFileDeps = ["assets/web-Brw6WZih.js","assets/index-TALscxEc.js","assets/mui-CRsYZxVY.js","assets/vendor-Dwao9eNC.js","assets/query-8ViTdhdk.js","assets/datePickers-BIJXYOKG.js","assets/icons-D8aatgQ4.js","assets/lab-DSem1Osk.js","assets/index-TuPg2doO.css"] 4 } 5 return indexes.map((i) => __vite__mapDeps.viteFileDeps[i]) 6} 7import{ea as Ai,b2 as Ei}from"./index-TALscxEc.js";import{e as Ci,g as mi}from"./vendor-Dwao9eNC.js";(function(){try{var w=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};w.SENTRY_RELEASE={id:"2ad85febf9735404429b0670d4acf56a0af5a0a2"}}catch{}})();try{(function(){var w=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},g=new w.Error().stack;g&&(w._sentryDebugIds=w._sentryDebugIds||{},w._sentryDebugIds[g]="f64b3431-678f-4d8e-b586-503ad4c28ac4",w._sentryDebugIdIdentifier="sentry-dbid-f64b3431-678f-4d8e-b586-503ad4c28ac4")})()}catch{}function Ii(w,g){for(var h=0;h<g.length;h++){const I=g[h];if(typeof I!="string"&&!Array.isArray(I)){for(const y in I)if(y!=="default"&&!(y in w)){const A=Object.getOwnPropertyDescriptor(I,y);A&&Object.defineProperty(w,y,A.get?A:{enumerable:!0,get:()=>I[y]})}}}return Object.freeze(Object.defineProperty(w,Symbol.toStringTag,{value:"Module"}))}var G;(function(w){w[w.QR_CODE=0]="QR_CODE",w[w.AZTEC=1]="AZTEC",w[w.CODABAR=2]="CODABAR",w[w.CODE_39=3]="CODE_39",w[w.CODE_93=4]="CODE_93",w[w.CODE_128=5]="CODE_128",w[w.DATA_MATRIX=6]="DATA_MATRIX",w[w.MAXICODE=7]="MAXICODE",w[w.ITF=8]="ITF",w[w.EAN_13=9]="EAN_13",w[w.EAN_8=10]="EAN_8",w[w.PDF_417=11]="PDF_417",w[w.RSS_14=12]="RSS_14",w[w.RSS_EXPANDED=13]="RSS_EXPANDED",w[w.UPC_A=14]="UPC_A",w[w.UPC_E=15]="UPC_E",w[w.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(G||(G={}));var _r=new Map([[G.QR_CODE,"QR_CODE"],[G.AZTEC,"AZTEC"],[G.CODABAR,"CODABAR"],[G.CODE_39,"CODE_39"],[G.CODE_93,"CODE_93"],[G.CODE_128,"CODE_128"],[G.DATA_MATRIX,"DATA_MATRIX"],[G.MAXICODE,"MAXICODE"],[G.ITF,"ITF"],[G.EAN_13,"EAN_13"],[G.EAN_8,"EAN_8"],[G.PDF_417,"PDF_417"],[G.RSS_14,"RSS_14"],[G.RSS_EXPANDED,"RSS_EXPANDED"],[G.UPC_A,"UPC_A"],[G.UPC_E,"UPC_E"],[G.UPC_EAN_EXTENSION,"UPC_EAN_EXTENSION"]]),Or;(function(w){w[w.UNKNOWN=0]="UNKNOWN",w[w.URL=1]="URL"})(Or||(Or={}));function pi(w){return Object.values(G).includes(w)}var On;(function(w){w[w.SCAN_TYPE_CAMERA=0]="SCAN_TYPE_CAMERA",w[w.SCAN_TYPE_FILE=1]="SCAN_TYPE_FILE"})(On||(On={}));var yi=function(){function w(){}return w.GITHUB_PROJECT_URL="https://github.com/mebjas/html5-qrcode",w.SCAN_DEFAULT_FPS=2,w.DEFAULT_DISABLE_FLIP=!1,w.DEFAULT_REMEMBER_LAST_CAMERA_USED=!0,w.DEFAULT_SUPPORTED_SCAN_TYPE=[On.SCAN_TYPE_CAMERA,On.SCAN_TYPE_FILE],w}(),kr=function(){function w(g,h){this.format=g,this.formatName=h}return w.prototype.toString=function(){return this.formatName},w.create=function(g){if(!_r.has(g))throw"".concat(g," not in html5QrcodeSupportedFormatsTextMap");return new w(g,_r.get(g))},w}(),Rr=function(){function w(){}return w.createFromText=function(g){var h={text:g};return{decodedText:g,result:h}},w.createFromQrcodeResult=function(g){return{decodedText:g.text,result:g}},w}(),er;(function(w){w[w.UNKWOWN_ERROR=0]="UNKWOWN_ERROR",w[w.IMPLEMENTATION_ERROR=1]="IMPLEMENTATION_ERROR",w[w.NO_CODE_FOUND_ERROR=2]="NO_CODE_FOUND_ERROR"})(er||(er={}));var Ti=function(){function w(){}return w.createFrom=function(g){return{errorMessage:g,type:er.UNKWOWN_ERROR}},w}(),Si=function(){function w(g){this.verbose=g}return w.prototype.log=function(g){this.verbose&&console.log(g)},w.prototype.warn=function(g){this.verbose&&console.warn(g)},w.prototype.logError=function(g,h){(this.verbose||h===!0)&&console.error(g)},w.prototype.logErrors=function(g){if(g.length===0)throw"Logger#logError called without arguments";this.verbose&&console.error(g)},w}();function Te(w){return typeof w>"u"||w===null}var $e=function(){function w(){}return w.codeParseError=function(g){return"QR code parse error, error = ".concat(g)},w.errorGettingUserMedia=function(g){return"Error getting userMedia, error = ".concat(g)},w.onlyDeviceSupportedError=function(){return"The device doesn't support navigator.mediaDevices , only supported cameraIdOrConfig in this case is deviceId parameter (string)."},w.cameraStreamingNotSupported=function(){return"Camera streaming not supported by the browser."},w.unableToQuerySupportedDevices=function(){return"Unable to query supported devices, unknown error."},w.insecureContextCameraQueryError=function(){return"Camera access is only supported in secure context like https or localhost."},w.scannerPaused=function(){return"Scanner paused"},w}(),Fr=function(){function w(){}return w.isMediaStreamConstraintsValid=function(g,h){if(typeof g!="object"){var I=typeof g;return h.logError("videoConstraints should be of type object, the "+"object passed is of type ".concat(I,"."),!0),!1}for(var y=["autoGainControl","channelCount","echoCancellation","latency","noiseSuppression","sampleRate","sampleSize","volume"],A=new Set(y),R=Object.keys(g),U=0,P=R;U<P.length;U++){var m=P[U];if(A.has(m))return h.logError("".concat(m," is not supported videoConstaints."),!0),!1}return!0},w}(),nr={exports:{}};(function(w,g){(function(h,I){I(g)})(Ci,function(h){function I(u){return u==null}
7var y=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,t){u.__proto__=t}||function(u,t){for(var e in t)t.hasOwnProperty(e)&&(u[e]=t[e])};function A(u,t){y(u,t);function e(){this.constructor=u}u.prototype=t===null?Object.create(t):(e.prototype=t.prototype,new e)}function R(u,t){var e=Object.setPrototypeOf;e?e(u,t):u.__proto__=t}function U(u,t){t===void 0&&(t=u.constructor);var e=Error.captureStackTrace;e&&e(u,t)}var P=function(u){A(t,u);function t(e){var n=this.constructor,r=u.call(this,e)||this;return Object.defineProperty(r,"name",{value:n.name,enumerable:!1}),R(r,n.prototype),U(r),r}return t}(Error);class m extends P{constructor(t=void 0){super(t),this.message=t}getKind(){return this.constructor.kind}}m.kind="Exception";class L extends m{}L.kind="ArgumentException";class D extends m{}D.kind="IllegalArgumentException";class dt{constructor(t){if(this.binarizer=t,t===null)throw new D("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(t,e){return this.binarizer.getBlackRow(t,e)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(t,e,n,r){const i=this.binarizer.getLuminanceSource().crop(t,e,n,r);return new dt(this.binarizer.createBinarizer(i))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){const t=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new dt(this.binarizer.createBinarizer(t))}rotateCounterClockwise45(){const t=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new dt(this.binarizer.createBinarizer(t))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class et extends m{static getChecksumInstance(){return new et}}et.kind="ChecksumException";class Zt{constructor(t){this.source=t}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class rt{static arraycopy(t,e,n,r,i){for(;i--;)n[r++]=t[e++]}static currentTimeMillis(){return Date.now()}}class ge extends m{}ge.kind="IndexOutOfBoundsException";class Se extends ge{constructor(t=void 0,e=void 0){super(e),this.index=t,this.message=e}}Se.kind="ArrayIndexOutOfBoundsException";class It{static fill(t,e){for(let n=0,r=t.length;n<r;n++)t[n]=e}static fillWithin(t,e,n,r){It.rangeCheck(t.length,e,n);for(let i=e;i<n;i++)t[i]=r}static rangeCheck(t,e,n){if(e>n)throw new D("fromIndex("+e+") > toIndex("+n+")");if(e<0)throw new Se(e);if(n>t)throw new Se(n)}static asList(...t){return t}static create(t,e,n){return Array.from({length:t}).map(i=>Array.from({length:e}).fill(n))}static createInt32Array(t,e,n){return Array.from({length:t}).map(i=>Int32Array.from({length:e}).fill(n))}static equals(t,e){if(!t||!e||!t.length||!e.length||t.length!==e.length)return!1;for(let n=0,r=t.length;n<r;n++)if(t[n]!==e[n])return!1;return!0}static hashCode(t){if(t===null)return 0;let e=1;for(const n of t)e=31*e+n;return e}static fillUint8Array(t,e){for(let n=0;n!==t.length;n++)t[n]=e}static copyOf(t,e){return t.slice(0,e)}static copyOfUint8Array(t,e){if(t.length<=e){const n=new Uint8Array(e);return n.set(t),n}return t.slice(0,e)}static copyOfRange(t,e,n){const r=n-e,i=new Int32Array(r);return rt.arraycopy(t,e,i,0,r),i}static binarySearch(t,e,n){n===void 0&&(n=It.numberComparator);let r=0,i=t.length-1;for(;r<=i;){const s=i+r>>1,o=n(e,t[s]);if(o>0)r=s+1;else if(o<0)i=s-1;else return s}return-r-1}static numberComparator(t,e){return t-e}}class j{static numberOfTrailingZeros(t){let e;if(t===0)return 32;let n=31;return e=t<<16,e!==0&&(n-=16,t=e),e=t<<8,e!==0&&(n-=8,t=e),e=t<<4,e!==0&&(n-=4,t=e),e=t<<2,e!==0&&(n-=2,t=e),n-(t<<1>>>31)}static numberOfLeadingZeros(t){if(t===0)return 32;let e=1;return t>>>16||(e+=16,t<<=16),t>>>24||(e+=8,t<<=8),t>>>28||(e+=4,t<<=4),t>>>30||(e+=2,t<<=2),e-=t>>>31,e}static toHexString(t){return t.toString(16)}static toBinaryString(t){return String(parseInt(String(t),2))}static bitCount(t){return t=t-(t>>>1&1431655765),t=(t&858993459)+(t>>>2&858993459),t=t+(t>>>4)&252645135,t=t+(t>>>8),t=t+(t>>>16),t&63}static truncDivision(t,e){return Math.trunc(t/e)}static parseInt(t,e=void 0){return parseInt(t,e)}}
7j.MIN_VALUE_32_BITS=-2147483648,j.MAX_VALUE=Number.MAX_SAFE_INTEGER;class at{constructor(t,e){t===void 0?(this.size=0,this.bits=new Int32Array(1)):(this.size=t,e==null?this.bits=at.makeArray(t):this.bits=e)}getSize(){return this.size}getSizeInBytes(){return Math.floor((this.size+7)/8)}ensureCapacity(t){if(t>this.bits.length*32){const e=at.makeArray(t);rt.arraycopy(this.bits,0,e,0,this.bits.length),this.bits=e}}get(t){return(this.bits[Math.floor(t/32)]&1<<(t&31))!==0}set(t){this.bits[Math.floor(t/32)]|=1<<(t&31)}flip(t){this.bits[Math.floor(t/32)]^=1<<(t&31)}getNextSet(t){const e=this.size;if(t>=e)return e;const n=this.bits;let r=Math.floor(t/32),i=n[r];i&=~((1<<(t&31))-1);const s=n.length;for(;i===0;){if(++r===s)return e;i=n[r]}const o=r*32+j.numberOfTrailingZeros(i);return o>e?e:o}getNextUnset(t){const e=this.size;if(t>=e)return e;const n=this.bits;let r=Math.floor(t/32),i=~n[r];i&=~((1<<(t&31))-1);const s=n.length;for(;i===0;){if(++r===s)return e;i=~n[r]}const o=r*32+j.numberOfTrailingZeros(i);return o>e?e:o}setBulk(t,e){this.bits[Math.floor(t/32)]=e}setRange(t,e){if(e<t||t<0||e>this.size)throw new D;if(e===t)return;e--;const n=Math.floor(t/32),r=Math.floor(e/32),i=this.bits;for(let s=n;s<=r;s++){const o=s>n?0:t&31,l=(2<<(s<r?31:e&31))-(1<<o);i[s]|=l}}clear(){const t=this.bits.length,e=this.bits;for(let n=0;n<t;n++)e[n]=0}isRange(t,e,n){if(e<t||t<0||e>this.size)throw new D;if(e===t)return!0;e--;const r=Math.floor(t/32),i=Math.floor(e/32),s=this.bits;for(let o=r;o<=i;o++){const a=o>r?0:t&31,c=(2<<(o<i?31:e&31))-(1<<a)&4294967295;if((s[o]&c)!==(n?c:0))return!1}return!0}appendBit(t){this.ensureCapacity(this.size+1),t&&(this.bits[Math.floor(this.size/32)]|=1<<(this.size&31)),this.size++}appendBits(t,e){if(e<0||e>32)throw new D("Num bits must be between 0 and 32");this.ensureCapacity(this.size+e);for(let n=e;n>0;n--)this.appendBit((t>>n-1&1)===1)}appendBitArray(t){const e=t.size;this.ensureCapacity(this.size+e);for(let n=0;n<e;n++)this.appendBit(t.get(n))}xor(t){if(this.size!==t.size)throw new D("Sizes don't match");const e=this.bits;for(let n=0,r=e.length;n<r;n++)e[n]^=t.bits[n]}toBytes(t,e,n,r){for(let i=0;i<r;i++){let s=0;for(let o=0;o<8;o++)this.get(t)&&(s|=1<<7-o),t++;e[n+i]=s}}getBitArray(){return this.bits}reverse(){const t=new Int32Array(this.bits.length),e=Math.floor((this.size-1)/32),n=e+1,r=this.bits;for(let i=0;i<n;i++){let s=r[i];s=s>>1&1431655765|(s&1431655765)<<1,s=s>>2&858993459|(s&858993459)<<2,s=s>>4&252645135|(s&252645135)<<4,s=s>>8&16711935|(s&16711935)<<8,s=s>>16&65535|(s&65535)<<16,t[e-i]=s}if(this.size!==n*32){const i=n*32-this.size;let s=t[0]>>>i;for(let o=1;o<n;o++){const a=t[o];s|=a<<32-i,t[o-1]=s,s=a>>>i}t[n-1]=s}this.bits=t}static makeArray(t){return new Int32Array(Math.floor((t+31)/32))}equals(t){if(!(t instanceof at))return!1;const e=t;return this.size===e.size&&It.equals(this.bits,e.bits)}hashCode(){return 31*this.size+It.hashCode(this.bits)}toString(){let t="";for(let e=0,n=this.size;e<n;e++)e&7||(t+=" "),t+=this.get(e)?"X":".";return t}clone(){return new at(this.size,this.bits.slice())}}var Ne;(function(u){u[u.OTHER=0]="OTHER",u[u.PURE_BARCODE=1]="PURE_BARCODE",u[u.POSSIBLE_FORMATS=2]="POSSIBLE_FORMATS",u[u.TRY_HARDER=3]="TRY_HARDER",u[u.CHARACTER_SET=4]="CHARACTER_SET",u[u.ALLOWED_LENGTHS=5]="ALLOWED_LENGTHS",u[u.ASSUME_CODE_39_CHECK_DIGIT=6]="ASSUME_CODE_39_CHECK_DIGIT",u[u.ASSUME_GS1=7]="ASSUME_GS1",u[u.RETURN_CODABAR_START_END=8]="RETURN_CODABAR_START_END",u[u.NEED_RESULT_POINT_CALLBACK=9]="NEED_RESULT_POINT_CALLBACK",u[u.ALLOWED_EAN_EXTENSIONS=10]="ALLOWED_EAN_EXTENSIONS"})(Ne||(Ne={}));var gt=Ne;class x extends m{static getFormatInstance(){return new x}}x.kind="FormatException";var ft;(function(u){u[u.Cp437=0]="Cp437",u[u.ISO8859_1=1]="ISO8859_1",u[u.ISO8859_2=2]="ISO8859_2",u[u.ISO8859_3=3]="ISO8859_3",u[u.ISO8859_4=4]="ISO8859_4",u[u.ISO8859_5=5]="ISO8859_5",u[u.ISO8859_6=6]="ISO8859_6",u[u.ISO8859_7=7]="ISO8859_7",u[u.ISO8859_8=8]="ISO8859_8",u[u.ISO8859_9=9]="ISO8859_9",u[u.ISO8859_10=10]="ISO8859_10",u[u.ISO8859_11=11]="ISO8859_11",u[u.ISO8859_13=12]="ISO8859_13",u[u.ISO8859_14=13]="ISO8859_14",u[u.ISO8859_15=14]="ISO8859_15",u[u.ISO8859_16=15]="ISO8859_16",u[u.SJIS=16]="SJIS",u[u.Cp1250=17]="Cp1250",u[u.Cp1251=18]="Cp1251",u[u.Cp1252=19]="Cp1252",u[u.Cp1256=20]="Cp1256",u[u.UnicodeBigUnmarked=21]="UnicodeBigUnmarked",u[u.UTF8=22]="UTF8",u[u.ASCII=23]="ASCII",u[u.Big5=24]="Big5",u[u.GB18030=25]="GB18030",u[u.EUC_KR=26]="EUC_KR"})(ft||(ft={}));class F{constructor(t,e,n,...r){this.valueIdentifier=t,this.name=n,typeof e=="number"?this.values=Int32Array.from([e]):this.values=e,this.otherEncodingNames=r,F.VALUE_IDENTIFIER_TO_ECI.set(t,this),F.NAME_TO_ECI.set(n,this);const i=this.values;for(let s=0,o=i.length;s!==o;s++){const a=i[s];F.VALUES_TO_ECI.set(a,this)}for(const s of r)F.NAME_TO_ECI.set(s,this)}getValueIdentifier(){return this.valueIdentifier}getName(){return this.name}getValue(){return this.values[0]}static getCharacterSetECIByValue(t){if(t<0||t>=900)throw new x("incorect value");const e=F.VALUES_TO_ECI.get(t);if(e===void 0)throw new x("incorect value");return e}static getCharacterSetECIByName(t){const e=F.NAME_TO_ECI.get(t);if(e===void 0)throw new x("incorect value");return e}equals(t){if(!(t instanceof F))return!1;const e=t;return this.getName()===e.getName()}}F.VALUE_IDENTIFIER_TO_ECI=new Map,F.VALUES_TO_ECI=new Map,F.NAME_TO_ECI=new Map,F.Cp437=new F(ft.Cp437,Int32Array.from([0,2]),"Cp437"),F.ISO8859_1=new F(ft.ISO8859_1,Int32Array.from([1,3]),"ISO-8859-1","ISO88591","ISO8859_1"),F.ISO8859_2=new F(ft.ISO8859_2,4,"ISO-8859-2","ISO88592","ISO8859_2"),F.ISO8859_3=new F(ft.ISO8859_3,5,"ISO-8859-3","ISO88593","ISO8859_3"),F.ISO8859_4
7=new F(ft.ISO8859_4,6,"ISO-8859-4","ISO88594","ISO8859_4"),F.ISO8859_5=new F(ft.ISO8859_5,7,"ISO-8859-5","ISO88595","ISO8859_5"),F.ISO8859_6=new F(ft.ISO8859_6,8,"ISO-8859-6","ISO88596","ISO8859_6"),F.ISO8859_7=new F(ft.ISO8859_7,9,"ISO-8859-7","ISO88597","ISO8859_7"),F.ISO8859_8=new F(ft.ISO8859_8,10,"ISO-8859-8","ISO88598","ISO8859_8"),F.ISO8859_9=new F(ft.ISO8859_9,11,"ISO-8859-9","ISO88599","ISO8859_9"),F.ISO8859_10=new F(ft.ISO8859_10,12,"ISO-8859-10","ISO885910","ISO8859_10"),F.ISO8859_11=new F(ft.ISO8859_11,13,"ISO-8859-11","ISO885911","ISO8859_11"),F.ISO8859_13=new F(ft.ISO8859_13,15,"ISO-8859-13","ISO885913","ISO8859_13"),F.ISO8859_14=new F(ft.ISO8859_14,16,"ISO-8859-14","ISO885914","ISO8859_14"),F.ISO8859_15=new F(ft.ISO8859_15,17,"ISO-8859-15","ISO885915","ISO8859_15"),F.ISO8859_16=new F(ft.ISO8859_16,18,"ISO-8859-16","ISO885916","ISO8859_16"),F.SJIS=new F(ft.SJIS,20,"SJIS","Shift_JIS"),F.Cp1250=new F(ft.Cp1250,21,"Cp1250","windows-1250"),F.Cp1251=new F(ft.Cp1251,22,"Cp1251","windows-1251"),F.Cp1252=new F(ft.Cp1252,23,"Cp1252","windows-1252"),F.Cp1256=new F(ft.Cp1256,24,"Cp1256","windows-1256"),F.UnicodeBigUnmarked=new F(ft.UnicodeBigUnmarked,25,"UnicodeBigUnmarked","UTF-16BE","UnicodeBig"),F.UTF8=new F(ft.UTF8,26,"UTF8","UTF-8"),F.ASCII=new F(ft.ASCII,Int32Array.from([27,170]),"ASCII","US-ASCII"),F.Big5=new F(ft.Big5,28,"Big5"),F.GB18030=new F(ft.GB18030,29,"GB18030","GB2312","EUC_CN","GBK"),F.EUC_KR=new F(ft.EUC_KR,30,"EUC_KR","EUC-KR");class He extends m{}He.kind="UnsupportedOperationException";class Jt{static decode(t,e){const n=this.encodingName(e);return this.customDecoder?this.customDecoder(t,n):typeof TextDecoder>"u"||this.shouldDecodeOnFallback(n)?this.decodeFallback(t,n):new TextDecoder(n).decode(t)}static shouldDecodeOnFallback(t){return!Jt.isBrowser()&&t==="ISO-8859-1"}static encode(t,e){const n=this.encodingName(e);return this.customEncoder?this.customEncoder(t,n):typeof TextEncoder>"u"?this.encodeFallback(t):new TextEncoder().encode(t)}static isBrowser(){return typeof window<"u"&&{}.toString.call(window)==="[object Window]"}static encodingName(t){return typeof t=="string"?t:t.getName()}static encodingCharacterSet(t){return t instanceof F?t:F.getCharacterSetECIByName(t)}static decodeFallback(t,e){const n=this.encodingCharacterSet(e);if(Jt.isDecodeFallbackSupported(n)){let r="";for(let i=0,s=t.length;i<s;i++){let o=t[i].toString(16);o.length<2&&(o="0"+o),r+="%"+o}return decodeURIComponent(r)}if(n.equals(F.UnicodeBigUnmarked))return String.fromCharCode.apply(null,new Uint16Array(t.buffer));throw new He(`Encoding ${this.encodingName(e)} not supported by fallback.`)}static isDecodeFallbackSupported(t){return t.equals(F.UTF8)||t.equals(F.ISO8859_1)||t.equals(F.ASCII)}static encodeFallback(t){const n=btoa(unescape(encodeURIComponent(t))).split(""),r=[];for(let i=0;i<n.length;i++)r.push(n[i].charCodeAt(0));return new Uint8Array(r)}}class q{static castAsNonUtf8Char(t,e=null){const n=e?e.getName():this.ISO88591;return Jt.decode(new Uint8Array([t]),n)}static guessEncoding(t,e){if(e!=null&&e.get(gt.CHARACTER_SET)!==void 0)return e.get(gt.CHARACTER_SET).toString();const n=t.length;let r=!0,i=!0,s=!0,o=0,a=0,l=0,c=0,f=0,d=0,C=0,p=0,T=0,S=0,O=0;const B=t.length>3&&t[0]===239&&t[1]===187&&t[2]===191;for(let k=0;k<n&&(r||i||s);k++){const v=t[k]&255;s&&(o>0?v&128?o--:s=!1:v&128&&(v&64?(o++,v&32?(o++,v&16?(o++,v&8?s=!1:c++):l++):a++):s=!1)),r&&(v>127&&v<160?r=!1:v>159&&(v<192||v===215||v===247)&&O++),i&&(f>0?v<64||v===127||v>252?i=!1:f--:v===128||v===160||v>239?i=!1:v>160&&v<224?(d++,p=0,C++,C>T&&(T=C)):v>127?(f++,C=0,p++,p>S&&(S=p)):(C=0,p=0))}return s&&o>0&&(s=!1),i&&f>0&&(i=!1),s&&(B||a+l+c>0)?q.UTF8:i&&(q.ASSUME_SHIFT_JIS||T>=3||S>=3)?q.SHIFT_JIS:r&&i?T===2&&d===2||O*10>=n?q.SHIFT_JIS:q.ISO88591:r?q.ISO88591:i?q.SHIFT_JIS:s?q.UTF8:q.PLATFORM_DEFAULT_ENCODING}static format(t,...e){let n=-1;function r(s,o,a,l,c,f){if(s==="%%")return"%";if(e[++n]===void 0)return;s=l?parseInt(l.substr(1)):void 0;let d=c?parseInt(c.substr(1)):void 0,C;switch(f){case"s":C=e[n];break;case"c":C=e[n][0];break;case"f":C=parseFloat(e[n]).toFixed(s);break;case"p":C=parseFloat(e[n]).toPrecision(s);break;case"e":C=parseFloat(e[n]).toExponential(s);break;case"x":C=parseInt(e[n]).toString(d||16);break;case"d":C=parseFloat(parseInt(e[n],d||10).toPrecision(s)).toFixed(0);break}C=typeof C=="object"?JSON.stringify(C):(+C).toString(d);let p=parseInt(a),T=a&&a[0]+""=="0"?"0":" ";for(;C.length<p;)C=o!==void 0?C+T:T+C;return C}let i=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(i,r)}static getBytes(t,e){return Jt.encode(t,e)}static getCharCode(t,e=0){return t.charCodeAt(e)}static getCharAt(t){return String.fromCharCode(t)}}q.SHIFT_JIS=F.SJIS.getName(),q.GB2312="GB2312",q.ISO88591=F.ISO8859_1.getName(),q.EUC_JP="EUC_JP",q.UTF8=F.UTF8.getName(),q.PLATFORM_DEFAULT_ENCODING=q.UTF8,q.ASSUME_SHIFT_JIS=!1;class wt{constructor(t=""){this.value=t}enableDecoding(t){return this.encoding=t,this}append(t){return typeof t=="string"?this.value+=t.toString():this.encoding?this.value+=q.castAsNonUtf8Char(t,this.encoding):this.value+=String.fromCharCode(t),this}appendChars(t,e,n){for(let r=e;e<e+n;r++)this.append(t[r]);return this}length(){return this.value.length}charAt(t){return this.value.charAt(t)}deleteCharAt(t){this.value=this.value.substr(0,t)+this.value.substring(t+1)}setCharAt(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+1)}substring(t,e){return this.value.substring(t,e)}setLengthToZero(){this.value=""}toString(){return this.value}insert(t,e){this.value=this.value.substr(0,t)+e+this.value.substr(t+e.length)}}class kt{constructor(t,e,n,r){if(this.width=t,this.height=e,this.rowSize=n,this.bits=r,e==null&&(e=t),this.height=e,t<1||e<1)throw new D("Both dimensions must be greater than 0");n==null&&(n=Math.floor((t+31)/32)),this.rowSize=n,r==null&&(this.bits=new Int32Array(this.rowSize*this.height))}static parseFromBooleanArray(t){const e=t.length,n=t[0].length,r=new kt(n,e);for(let i=0;i<e;i++){const s=t[i];for(let o=0;o<n;o++)s[o]&&r.set(o,i)}return r}static parseFromString(t,e,n){if(t===null)throw new D("stringRepresentation cannot be null");const r=new Array(t.length);let i=0,s=0,o=-1,a=0,l=0;for(;l<t.length;)if(t.charAt(l)===` 8`||t.charAt(l)==="\r"){if(i>s){if(o===-1)o=i-s;else if(i-s!==o)throw new D("row lengths do not match");s=i,a++}l++}else if(t.substring(l,l+e.length)===e)l+=e.length,r[i]=!0,i++;else if(t.substring(l,l+n.length)===n)l+=n.length,r[i]=!1,i++;else throw new D("illegal character encountered: "+t.substring(l));if(i>s){if(o===-1)o=i-s;else if(i-s!==o)throw new D("row lengths do not match");a++}const c=new kt(o,a);for(let f=0;f<i;f++)r[f]&&c.set(Math.floor(f%o),Math.floor(f/o));return c}get(t,e){const n=e*this.rowSize+Math.floor(t/32);return(this.bits[n]>>>(t&31)&1)!==0}set(t,e){const n=e*this.rowSize+Math.floor(t/32);this.bits[n]|=1<<(t&31)&4294967295}unset(t,e){const n=e*this.rowSize+Math.floor(t/32);this.bits[n]&=~(1<<(t&31)&4294967295)}flip(t,e){const n=e*this.rowSize+Math.floor(t/32);this.bits[n]^=1<<(t&31)&4294967295}xor(t){if(this.width!==t.getWidth()||this.height!==t.getHeight()||this.rowSize!==t.getRowSize())throw new D("input matrix dimensions do not match");const e=new at(Math.floor(this.width/32)+1),n=this.rowSize,r=this.bits;for(let i=0,s=this.height;i<s;i++){const o=i*n,a=t.getRow(i,e).getBitArray();for(let l=0;l<n;l++)r[o+l]^=a[l]}}clear(){const t=this.bits,e=t.length;for(let n=0;n<e;n++)t[n]=0}setRegion(t,e,n,r){if(e<0||t<0)throw new D("Left and top must be nonnegative");if(r<1||n<1)throw new D("Height and width must be at least 1");const i=t+n,s=e+r;if(s>this.height||i>this.width)throw new D("The region must fit inside the matrix");const o=this.rowSize,a=this.bits;for(let l=e;l<s;l++){const c=l*o;for(let f=t;f<i;f++)a[c+Math.floor(f/32)]|=1<<(f&31)&4294967295}}getRow(t,e){e==null||e.getSize()<this.width?e=new at(this.width):e.clear();const n=this.rowSize,r=this.bits,i=t*n;for(let s=0;s<n;s++)e.setBulk(s*32,r[i+s]);return e}setRow(t,e){rt.arraycopy(e.getBitArray(),0,this.bits,t*this.rowSize,this.rowSize)}rotate180(){const t=this.getWidth(),e=this.getHeight();let n=new at(t),r=new at(t);for(let i=0,s=Math.floor((e+1)/2);i<s;i++)n=this.getRow(i,n),r=this.getRow(e-1-i,r),n.reverse(),r.reverse(),this.setRow(i,r),this.setRow(e-1-i,n)}getEnclosingRectangle(){const t=this.width,e=this.height,n=this.rowSize,r=this.bits;let i=t,s=e,o=-1,a=-1;for(let l=0;l<e;l++)for(let c=0;c<n;c++){const f=r[l*n+c];if(f!==0){if(l<s&&(s=l),l>a&&(a=l),c*32<i){let d=0;for(;!(f<<31-d&4294967295);)d++;c*32+d<i&&(i=c*32+d)}if(c*32+31>o){let d=31;for(;!(f>>>
8d);)d--;c*32+d>o&&(o=c*32+d)}}}return o<i||a<s?null:Int32Array.from([i,s,o-i+1,a-s+1])}getTopLeftOnBit(){const t=this.rowSize,e=this.bits;let n=0;for(;n<e.length&&e[n]===0;)n++;if(n===e.length)return null;const r=n/t;let i=n%t*32;const s=e[n];let o=0;for(;!(s<<31-o&4294967295);)o++;return i+=o,Int32Array.from([i,r])}getBottomRightOnBit(){const t=this.rowSize,e=this.bits;let n=e.length-1;for(;n>=0&&e[n]===0;)n--;if(n<0)return null;const r=Math.floor(n/t);let i=Math.floor(n%t)*32;const s=e[n];let o=31;for(;!(s>>>o);)o--;return i+=o,Int32Array.from([i,r])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(t){if(!(t instanceof kt))return!1;const e=t;return this.width===e.width&&this.height===e.height&&this.rowSize===e.rowSize&&It.equals(this.bits,e.bits)}hashCode(){let t=this.width;return t=31*t+this.width,t=31*t+this.height,t=31*t+this.rowSize,t=31*t+It.hashCode(this.bits),t}toString(t="X ",e=" ",n=` 9`){return this.buildToString(t,e,n)}buildToString(t,e,n){let r=new wt;for(let i=0,s=this.height;i<s;i++){for(let o=0,a=this.width;o<a;o++)r.append(this.get(o,i)?t:e);r.append(n)}return r.toString()}clone(){return new kt(this.width,this.height,this.rowSize,this.bits.slice())}}class b extends m{static getNotFoundInstance(){return new b}}b.kind="NotFoundException";class Ft extends Zt{constructor(t){super(t),this.luminances=Ft.EMPTY,this.buckets=new Int32Array(Ft.LUMINANCE_BUCKETS)}getBlackRow(t,e){const n=this.getLuminanceSource(),r=n.getWidth();e==null||e.getSize()<r?e=new at(r):e.clear(),this.initArrays(r);const i=n.getRow(t,this.luminances),s=this.buckets;for(let a=0;a<r;a++)s[(i[a]&255)>>Ft.LUMINANCE_SHIFT]++;const o=Ft.estimateBlackPoint(s);if(r<3)for(let a=0;a<r;a++)(i[a]&255)<o&&e.set(a);else{let a=i[0]&255,l=i[1]&255;for(let c=1;c<r-1;c++){const f=i[c+1]&255;(l*4-a-f)/2<o&&e.set(c),a=l,l=f}}return e}getBlackMatrix(){const t=this.getLuminanceSource(),e=t.getWidth(),n=t.getHeight(),r=new kt(e,n);this.initArrays(e);const i=this.buckets;for(let a=1;a<5;a++){const l=Math.floor(n*a/5),c=t.getRow(l,this.luminances),f=Math.floor(e*4/5);for(let d=Math.floor(e/5);d<f;d++){const C=c[d]&255;i[C>>Ft.LUMINANCE_SHIFT]++}}const s=Ft.estimateBlackPoint(i),o=t.getMatrix();for(let a=0;a<n;a++){const l=a*e;for(let c=0;c<e;c++)(o[l+c]&255)<s&&r.set(c,a)}return r}createBinarizer(t){return new Ft(t)}initArrays(t){this.luminances.length<t&&(this.luminances=new Uint8ClampedArray(t));const e=this.buckets;for(let n=0;n<Ft.LUMINANCE_BUCKETS;n++)e[n]=0}static estimateBlackPoint(t){const e=t.length;let n=0,r=0,i=0;for(let c=0;c<e;c++)t[c]>i&&(r=c,i=t[c]),t[c]>n&&(n=t[c]);let s=0,o=0;for(let c=0;c<e;c++){const f=c-r,d=t[c]*f*f;d>o&&(s=c,o=d)}if(r>s){const c=r;r=s,s=c}if(s-r<=e/16)throw new b;let a=s-1,l=-1;for(let c=s-1;c>r;c--){const f=c-r,d=f*f*(s-c)*(n-t[c]);d>l&&(a=c,l=d)}return a<<Ft.LUMINANCE_SHIFT}}Ft.LUMINANCE_BITS=5,Ft.LUMINANCE_SHIFT=8-Ft.LUMINANCE_BITS,Ft.LUMINANCE_BUCKETS=1<<Ft.LUMINANCE_BITS,Ft.EMPTY=Uint8ClampedArray.from([0]);class J extends Ft{constructor(t){super(t),this.matrix=null}getBlackMatrix(){if(this.matrix!==null)return this.matrix;const t=this.getLuminanceSource(),e=t.getWidth(),n=t.getHeight();if(e>=J.MINIMUM_DIMENSION&&n>=J.MINIMUM_DIMENSION){const r=t.getMatrix();let i=e>>J.BLOCK_SIZE_POWER;e&J.BLOCK_SIZE_MASK&&i++;let s=n>>J.BLOCK_SIZE_POWER;n&J.BLOCK_SIZE_MASK&&s++;const o=J.calculateBlackPoints(r,i,s,e,n),a=new kt(e,n);J.calculateThresholdForBlock(r,i,s,e,n,o,a),this.matrix=a}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(t){return new J(t)}static calculateThresholdForBlock(t,e,n,r,i,s,o){const a=i-J.BLOCK_SIZE,l=r-J.BLOCK_SIZE;for(let c=0;c<n;c++){let f=c<<J.BLOCK_SIZE_POWER;f>a&&(f=a);const d=J.cap(c,2,n-3);for(let C=0;C<e;C++){let p=C<<J.BLOCK_SIZE_POWER;p>l&&(p=l);const T=J.cap(C,2,e-3);let S=0;for(let B=-2;B<=2;B++){const k=s[d+B];S+=k[T-2]+k[T-1]+k[T]+k[T+1]+k[T+2]}const O=S/25;J.thresholdBlock(t,p,f,O,r,o)}}}static cap(t,e,n){return t<e?e:t>n?n:t}static thresholdBlock(t,e,n,r,i,s){for(let o=0,a=n*i+e;o<J.BLOCK_SIZE;o++,a+=i)for(let l=0;l<J.BLOCK_SIZE;l++)(t[a+l]&255)<=r&&s.set(e+l,n+o)}static calculateBlackPoints(t,e,n,r,i){const s=i-J.BLOCK_SIZE,o=r-J.BLOCK_SIZE,a=new Array(n);for(let l=0;l<n;l++){a[l]=new Int32Array(e);let c=l<<J.BLOCK_SIZE_POWER;c>s&&(c=s);for(let f=0;f<e;f++){let d=f<<J.BLOCK_SIZE_POWER;d>
9o&&(d=o);let C=0,p=255,T=0;for(let O=0,B=c*r+d;O<J.BLOCK_SIZE;O++,B+=r){for(let k=0;k<J.BLOCK_SIZE;k++){const v=t[B+k]&255;C+=v,v<p&&(p=v),v>T&&(T=v)}if(T-p>J.MIN_DYNAMIC_RANGE)for(O++,B+=r;O<J.BLOCK_SIZE;O++,B+=r)for(let k=0;k<J.BLOCK_SIZE;k++)C+=t[B+k]&255}let S=C>>J.BLOCK_SIZE_POWER*2;if(T-p<=J.MIN_DYNAMIC_RANGE&&(S=p/2,l>0&&f>0)){const O=(a[l-1][f]+2*a[l][f-1]+a[l-1][f-1])/4;p<O&&(S=O)}a[l][f]=S}}return a}}J.BLOCK_SIZE_POWER=3,J.BLOCK_SIZE=1<<J.BLOCK_SIZE_POWER,J.BLOCK_SIZE_MASK=J.BLOCK_SIZE-1,J.MINIMUM_DIMENSION=J.BLOCK_SIZE*5,J.MIN_DYNAMIC_RANGE=24;class tn{constructor(t,e){this.width=t,this.height=e}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(t,e,n,r){throw new He("This luminance source does not support cropping.")}isRotateSupported(){return!1}rotateCounterClockwise(){throw new He("This luminance source does not support rotation by 90 degrees.")}rotateCounterClockwise45(){throw new He("This luminance source does not support rotation by 45 degrees.")}toString(){const t=new Uint8ClampedArray(this.width);let e=new wt;for(let n=0;n<this.height;n++){const r=this.getRow(n,t);for(let i=0;i<this.width;i++){const s=r[i]&255;let o;s<64?o="#":s<128?o="+":s<192?o=".":o=" ",e.append(o)}e.append(` 10`)}return e.toString()}}class _e extends tn{constructor(t){super(t.getWidth(),t.getHeight()),this.delegate=t}getRow(t,e){const n=this.delegate.getRow(t,e),r=this.getWidth();for(let i=0;i<r;i++)n[i]=255-(n[i]&255);return n}getMatrix(){const t=this.delegate.getMatrix(),e=this.getWidth()*this.getHeight(),n=new Uint8ClampedArray(e);for(let r=0;r<e;r++)n[r]=255-(t[r]&255);return n}isCropSupported(){return this.delegate.isCropSupported()}crop(t,e,n,r){return new _e(this.delegate.crop(t,e,n,r))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new _e(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new _e(this.delegate.rotateCounterClockwise45())}}class Oe extends tn{constructor(t){super(t.width,t.height),this.canvas=t,this.tempCanvasElement=null,this.buffer=Oe.makeBufferFromCanvasImageData(t)}static makeBufferFromCanvasImageData(t){const e=t.getContext("2d").getImageData(0,0,t.width,t.height);return Oe.toGrayscaleBuffer(e.data,t.width,t.height)}static toGrayscaleBuffer(t,e,n){const r=new Uint8ClampedArray(e*n);for(let i=0,s=0,o=t.length;i<o;i+=4,s++){let a;if(t[i+3]===0)a=255;else{const c=t[i],f=t[i+1],d=t[i+2];a=306*c+601*f+117*d+512>>10}r[s]=a}return r}getRow(t,e){if(t<0||t>=this.getHeight())throw new D("Requested row is outside the image: "+t);const n=this.getWidth(),r=t*n;return e===null?e=this.buffer.slice(r,r+n):(e.length<n&&(e=new Uint8ClampedArray(n)),e.set(this.buffer.slice(r,r+n))),e}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(t,e,n,r){return super.crop(t,e,n,r),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(this.tempCanvasElement===null){const t=this.canvas.ownerDocument.createElement("canvas");t.width=this.canvas.width,t.height=this.canvas.height,this.tempCanvasElement=t}return this.tempCanvasElement}rotate(t){const e=this.getTempCanvasElement(),n=e.getContext("2d"),r=t*Oe.DEGREE_TO_RADIANS,i=this.canvas.width,s=this.canvas.height,o=Math.ceil(Math.abs(Math.cos(r))*i+Math.abs(Math.sin(r))*s),a=Math.ceil(Math.abs(Math.sin(r))*i+Math.abs(Math.cos(r))*s);return e.width=o,e.height=a,n.translate(o/2,a/2),n.rotate(r),n.drawImage(this.canvas,i/-2,s/-2),this.buffer=Oe.makeBufferFromCanvasImageData(e),this}invert(){return new _e(this)}}Oe.DEGREE_TO_RADIANS=Math.PI/180;class sr{constructor(t,e,n){this.deviceId=t,this.label=e,this.kind="videoinput",this.groupId=n||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var Kt=(globalThis||globalThis||self||window||void 0)&&(globalThis||globalThis||self||window||void 0).__awaiter||function(u,t,e,n){function r(i){return i instanceof e?i:new e(function(s){s(i)})}return new(e||(e=Promise))(function(i,s){function o(c){try{l(n.next(c))}catch(f){s(f)}}function a(c){try{l(n.throw(c))}catch(f){s(f)}}function l(c){c.done?i(c.value):r(c.value).then(o,a)}l((n=n.apply(u,t||[])).next())})};class Le{constructor(t,e=500,n){this.reader=t,this.timeBetweenScansMillis=e,this._hints=n,this._stopContinuousDecode=!1,this._stopAsyncDecode=!1,this._timeBetweenDecodingAttempts=0}get hasNavigator(){return typeof navigator<"u"}get isMediaDevicesSuported(){return this.hasNavigator&&!!navigator.mediaDevices}get canEnumerateDevices(){return!!(this.isMediaDevicesSuported&&navigator.mediaDevices.enumerateDevices)}get timeBetweenDecodingAttempts(){return this._timeBetweenDecodingAttempts}set timeBetweenDecodingAttempts(t){this._timeBetweenDecodingAttempts=t<0?0:t}set hints(t){this._hints=t||null}get hints(){return this._hints}listVideoInputDevices(){return Kt(this,void 0,void 0,function*(){if(!this.hasNavigator)throw new Error("Can't enumerate devices, navigator is not present.");if(!this.canEnumerateDevices)throw new Error("Can't enumerate devices, method not supported.");const t=yield navigator.mediaDevices.enumerateDevices(),e=[];for(const n of t){const r=n.kind==="video"?"videoinput":n.kind;if(r!=="videoinput")continue;const i=n.deviceId||n.id,s=n.label||`Video device ${e.length+1}`,o=n.groupId,a={deviceId:i,label:s,kind:r,groupId:o};e.push(a)}return e})}getVideoInputDevices(){return Kt(this,void 0,void 0,function*(){return(yield this.listVideoInputDevices()).map(e=>new sr(e.deviceId,e.label))})}findDeviceById(t){return Kt(this,void 0,void 0,function*(){const e=yield this.listVideoInputDevices();return e?e.find(n=>n.deviceId===t):null})}decodeFromInputVideoDevice(t,e){return Kt(this,void 0,void 0,function*(){return yield this.decodeOnceFromVideoDevice(t,e)})}decodeOnceFromVideoDevice(t,e){return Kt(this,void 0,void 0,function*(){this.reset();let n;t?n={deviceId:{exact:t}}:n={facingMode:"environment"};const r={video:n};return yield this.decodeOnceFromConstraints(r,e)})}decodeOnceFromConstraints(t,e){return Kt(this,void 0,void 0,function*(){const n=yield navigator.mediaDevices.getUserMedia(t);return yield this.decodeOnceFromStream(n,e)})}decodeOnceFromStream(t,e){return Kt(this,void 0,void 0,function*(){this.reset();const n=yield this.attachStreamToVideo(t,e);return yield this.decodeOnce(n)})}decodeFromInputVideoDeviceContinuously(t,e,n){return Kt(this,void 0,void 0,function*(){return yield this.decodeFromVideoDevice(t,e,n)})}decodeFromVideoDevice(t,e,n){return Kt(this,void 0,void 0,function*(){let r;t?r={deviceId:{exact:t}}:r={facingMode:"environment"};const i={video:r};return yield this.decodeFromConstraints(i,e,n)})}decodeFromConstraints(t,e,n){return Kt(this,void 0,void 0,function*(){const r=yield navigator.mediaDevices.getUserMedia(t);return yield this.decodeFromStream(r,e,n)})}decodeFromStream(t,e,n){return Kt(this,void 0,void 0,function*(){this.reset();const r=yield this.attachStreamToVideo(t,e);return yield this.decodeContinuously(r,n)})}stopAsyncDecode(){this._stopAsyncDecode=!0}stopContinuousDecode(){this._stopContinuousDecode=!0}attachStreamToVideo(t,e){return Kt(this,void 0,void 0,function*(){const n=this.prepareVideoElement(e);return this.addVideoSource(n,t),this.videoElement=n,this.stream=t,yield this.playVideoOnLoadAsync(n),n})}
10playVideoOnLoadAsync(t){return new Promise((e,n)=>this.playVideoOnLoad(t,()=>e()))}playVideoOnLoad(t,e){this.videoEndedListener=()=>this.stopStreams(),this.videoCanPlayListener=()=>this.tryPlayVideo(t),t.addEventListener("ended",this.videoEndedListener),t.addEventListener("canplay",this.videoCanPlayListener),t.addEventListener("playing",e),this.tryPlayVideo(t)}isVideoPlaying(t){return t.currentTime>0&&!t.paused&&!t.ended&&t.readyState>2}tryPlayVideo(t){return Kt(this,void 0,void 0,function*(){if(this.isVideoPlaying(t)){console.warn("Trying to play video that is already playing.");return}try{yield t.play()}catch{console.warn("It was not possible to play the video.")}})}getMediaElement(t,e){const n=document.getElementById(t);if(!n)throw new L(`element with id '${t}' not found`);if(n.nodeName.toLowerCase()!==e.toLowerCase())throw new L(`element with id '${t}' must be an ${e} element`);return n}decodeFromImage(t,e){if(!t&&!e)throw new L("either imageElement with a src set or an url must be provided");return e&&!t?this.decodeFromImageUrl(e):this.decodeFromImageElement(t)}decodeFromVideo(t,e){if(!t&&!e)throw new L("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrl(e):this.decodeFromVideoElement(t)}decodeFromVideoContinuously(t,e,n){if(t===void 0&&e===void 0)throw new L("Either an element with a src set or an URL must be provided");return e&&!t?this.decodeFromVideoUrlContinuously(e,n):this.decodeFromVideoElementContinuously(t,n)}decodeFromImageElement(t){if(!t)throw new L("An image element must be provided.");this.reset();const e=this.prepareImageElement(t);this.imageElement=e;let n;return this.isImageLoaded(e)?n=this.decodeOnce(e,!1,!0):n=this._decodeOnLoadImage(e),n}decodeFromVideoElement(t){const e=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideo(e)}decodeFromVideoElementContinuously(t,e){const n=this._decodeFromVideoElementSetup(t);return this._decodeOnLoadVideoContinuously(n,e)}_decodeFromVideoElementSetup(t){if(!t)throw new L("A video element must be provided.");this.reset();const e=this.prepareVideoElement(t);return this.videoElement=e,e}decodeFromImageUrl(t){if(!t)throw new L("An URL must be provided.");this.reset();const e=this.prepareImageElement();this.imageElement=e;const n=this._decodeOnLoadImage(e);return e.src=t,n}decodeFromVideoUrl(t){if(!t)throw new L("An URL must be provided.");this.reset();const e=this.prepareVideoElement(),n=this.decodeFromVideoElement(e);return e.src=t,n}decodeFromVideoUrlContinuously(t,e){if(!t)throw new L("An URL must be provided.");this.reset();const n=this.prepareVideoElement(),r=this.decodeFromVideoElementContinuously(n,e);return n.src=t,r}_decodeOnLoadImage(t){return new Promise((e,n)=>{this.imageLoadedListener=()=>this.decodeOnce(t,!1,!0).then(e,n),t.addEventListener("load",this.imageLoadedListener)})}_decodeOnLoadVideo(t){return Kt(this,void 0,void 0,function*(){return yield this.playVideoOnLoadAsync(t),yield this.decodeOnce(t)})}_decodeOnLoadVideoContinuously(t,e){return Kt(this,void 0,void 0,function*(){yield this.playVideoOnLoadAsync(t),this.decodeContinuously(t,e)})}isImageLoaded(t){return!(!t.complete||t.naturalWidth===0)}prepareImageElement(t){let e;return typeof t>"u"&&(e=document.createElement("img"),e.width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"img")),t instanceof HTMLImageElement&&(e=t),e}prepareVideoElement(t){let e;return!t&&typeof document<"u"&&(e=document.createElement("video"),e.width=200,e.height=200),typeof t=="string"&&(e=this.getMediaElement(t,"video")),t instanceof HTMLVideoElement&&(e=t),e.setAttribute("autoplay","true"),e.setAttribute("muted","true"),e.setAttribute("playsinline","true"),e}decodeOnce(t,e=!0,n=!0){this._stopAsyncDecode=!1;const r=(i,s)=>{if(this._stopAsyncDecode){s(new b("Video stream has ended before any code could be detected.")),this._stopAsyncDecode=void 0;return}try{const o=this.decode(t);i(o)}catch(o){const a=e&&o instanceof b,c=(o instanceof et||o instanceof x)&&n;if(a||c)return setTimeout(r,this._timeBetweenDecodingAttempts,i,s);s(o)}};return new Promise((i,s)=>r(i,s))}decodeContinuously(t,e){this._stopContinuousDecode=!1;const n=()=>
10{if(this._stopContinuousDecode){this._stopContinuousDecode=void 0;return}try{const r=this.decode(t);e(r,null),setTimeout(n,this.timeBetweenScansMillis)}catch(r){e(null,r);const i=r instanceof et||r instanceof x,s=r instanceof b;(i||s)&&setTimeout(n,this._timeBetweenDecodingAttempts)}};n()}decode(t){const e=this.createBinaryBitmap(t);return this.decodeBitmap(e)}_isHTMLVideoElement(t){return t.videoWidth!==0}drawFrameOnCanvas(t,e,n){e||(e={sx:0,sy:0,sWidth:t.videoWidth,sHeight:t.videoHeight,dx:0,dy:0,dWidth:t.videoWidth,dHeight:t.videoHeight}),n||(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)}drawImageOnCanvas(t,e,n=this.captureCanvasContext){e||(e={sx:0,sy:0,sWidth:t.naturalWidth,sHeight:t.naturalHeight,dx:0,dy:0,dWidth:t.naturalWidth,dHeight:t.naturalHeight}),n||(n=this.captureCanvasContext),n.drawImage(t,e.sx,e.sy,e.sWidth,e.sHeight,e.dx,e.dy,e.dWidth,e.dHeight)}createBinaryBitmap(t){this.getCaptureCanvasContext(t),this._isHTMLVideoElement(t)?this.drawFrameOnCanvas(t):this.drawImageOnCanvas(t);const e=this.getCaptureCanvas(t),n=new Oe(e),r=new J(n);return new dt(r)}getCaptureCanvasContext(t){if(!this.captureCanvasContext){const n=this.getCaptureCanvas(t).getContext("2d");this.captureCanvasContext=n}return this.captureCanvasContext}getCaptureCanvas(t){if(!this.captureCanvas){const e=this.createCaptureCanvas(t);this.captureCanvas=e}return this.captureCanvas}decodeBitmap(t){return this.reader.decode(t,this._hints)}createCaptureCanvas(t){if(typeof document>"u")return this._destroyCaptureCanvas(),null;const e=document.createElement("canvas");let n,r;return typeof t<"u"&&(t instanceof HTMLVideoElement?(n=t.videoWidth,r=t.videoHeight):t instanceof HTMLImageElement&&(n=t.naturalWidth||t.width,r=t.naturalHeight||t.height)),e.style.width=n+"px",e.style.height=r+"px",e.width=n,e.height=r,e}stopStreams(){this.stream&&(this.stream.getVideoTracks().forEach(t=>t.stop()),this.stream=void 0),this._stopAsyncDecode===!1&&this.stopAsyncDecode(),this._stopContinuousDecode===!1&&this.stopContinuousDecode()}reset(){this.stopStreams(),this._destroyVideoElement(),this._destroyImageElement(),this._destroyCaptureCanvas()}_destroyVideoElement(){this.videoElement&&(typeof this.videoEndedListener<"u"&&this.videoElement.removeEventListener("ended",this.videoEndedListener),typeof this.videoPlayingEventListener<"u"&&this.videoElement.removeEventListener("playing",this.videoPlayingEventListener),typeof this.videoCanPlayListener<"u"&&this.videoElement.removeEventListener("loadedmetadata",this.videoCanPlayListener),this.cleanVideoSource(this.videoElement),this.videoElement=void 0)}_destroyImageElement(){this.imageElement&&(this.imageLoadedListener!==void 0&&this.imageElement.removeEventListener("load",this.imageLoadedListener),this.imageElement.src=void 0,this.imageElement.removeAttribute("src"),this.imageElement=void 0)}_destroyCaptureCanvas(){this.captureCanvasContext=void 0,this.captureCanvas=void 0}addVideoSource(t,e){try{t.srcObject=e}catch{t.src=URL.createObjectURL(e)}}cleanVideoSource(t){try{t.srcObject=null}catch{t.src=""}this.videoElement.removeAttribute("src")}}class jt{constructor(t,e,n=e==null?0:8*e.length,r,i,s=rt.currentTimeMillis()){this.text=t,this.rawBytes=e,this.numBits=n,this.resultPoints=r,this.format=i,this.timestamp=s,this.text=t,this.rawBytes=e,n==null?this.numBits=e==null?0:8*e.length:this.numBits=n,this.resultPoints=r,this.format=i,this.resultMetadata=null,s==null?this.timestamp=rt.currentTimeMillis():this.timestamp=s}getText(){return this.text}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}getResultPoints(){return this.resultPoints}getBarcodeFormat(){return this.format}getResultMetadata(){return this.resultMetadata}putMetadata(t,e){this.resultMetadata===null&&(this.resultMetadata=new Map),this.resultMetadata.set(t,e)}putAllMetadata(t){t!==null&&(this.resultMetadata===null?this.resultMetadata=t:this.resultMetadata=new Map(t))}addResultPoints(t){const e=this.resultPoints;if(e===null)this.resultPoints=t;else if(t!==null&&t.length>0){const n=new Array(e.length+t.length);rt.arraycopy(e,0,n,0,e.length),rt.arraycopy(t,0,n,e.length,t.length),this.resultPoints=n}}getTimestamp(){return this.timestamp}toString(){return this.text}}var Bn;
10(function(u){u[u.AZTEC=0]="AZTEC",u[u.CODABAR=1]="CODABAR",u[u.CODE_39=2]="CODE_39",u[u.CODE_93=3]="CODE_93",u[u.CODE_128=4]="CODE_128",u[u.DATA_MATRIX=5]="DATA_MATRIX",u[u.EAN_8=6]="EAN_8",u[u.EAN_13=7]="EAN_13",u[u.ITF=8]="ITF",u[u.MAXICODE=9]="MAXICODE",u[u.PDF_417=10]="PDF_417",u[u.QR_CODE=11]="QR_CODE",u[u.RSS_14=12]="RSS_14",u[u.RSS_EXPANDED=13]="RSS_EXPANDED",u[u.UPC_A=14]="UPC_A",u[u.UPC_E=15]="UPC_E",u[u.UPC_EAN_EXTENSION=16]="UPC_EAN_EXTENSION"})(Bn||(Bn={}));var z=Bn,Pn;(function(u){u[u.OTHER=0]="OTHER",u[u.ORIENTATION=1]="ORIENTATION",u[u.BYTE_SEGMENTS=2]="BYTE_SEGMENTS",u[u.ERROR_CORRECTION_LEVEL=3]="ERROR_CORRECTION_LEVEL",u[u.ISSUE_NUMBER=4]="ISSUE_NUMBER",u[u.SUGGESTED_PRICE=5]="SUGGESTED_PRICE",u[u.POSSIBLE_COUNTRY=6]="POSSIBLE_COUNTRY",u[u.UPC_EAN_EXTENSION=7]="UPC_EAN_EXTENSION",u[u.PDF417_EXTRA_METADATA=8]="PDF417_EXTRA_METADATA",u[u.STRUCTURED_APPEND_SEQUENCE=9]="STRUCTURED_APPEND_SEQUENCE",u[u.STRUCTURED_APPEND_PARITY=10]="STRUCTURED_APPEND_PARITY"})(Pn||(Pn={}));var Ut=Pn;class en{constructor(t,e,n,r,i=-1,s=-1){this.rawBytes=t,this.text=e,this.byteSegments=n,this.ecLevel=r,this.structuredAppendSequenceNumber=i,this.structuredAppendParity=s,this.numBits=t==null?0:8*t.length}getRawBytes(){return this.rawBytes}getNumBits(){return this.numBits}setNumBits(t){this.numBits=t}getText(){return this.text}getByteSegments(){return this.byteSegments}getECLevel(){return this.ecLevel}getErrorsCorrected(){return this.errorsCorrected}setErrorsCorrected(t){this.errorsCorrected=t}getErasures(){return this.erasures}setErasures(t){this.erasures=t}getOther(){return this.other}setOther(t){this.other=t}hasStructuredAppend(){return this.structuredAppendParity>=0&&this.structuredAppendSequenceNumber>=0}getStructuredAppendParity(){return this.structuredAppendParity}getStructuredAppendSequenceNumber(){return this.structuredAppendSequenceNumber}}class nn{exp(t){return this.expTable[t]}log(t){if(t===0)throw new D;return this.logTable[t]}static addOrSubtract(t,e){return t^e}}class $t{constructor(t,e){if(e.length===0)throw new D;this.field=t;const n=e.length;if(n>1&&e[0]===0){let r=1;for(;r<n&&e[r]===0;)r++;r===n?this.coefficients=Int32Array.from([0]):(this.coefficients=new Int32Array(n-r),rt.arraycopy(e,r,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(t){return this.coefficients[this.coefficients.length-1-t]}evaluateAt(t){if(t===0)return this.getCoefficient(0);const e=this.coefficients;let n;if(t===1){n=0;for(let s=0,o=e.length;s!==o;s++){const a=e[s];n=nn.addOrSubtract(n,a)}return n}n=e[0];const r=e.length,i=this.field;for(let s=1;s<r;s++)n=nn.addOrSubtract(i.multiply(t,n),e[s]);return n}addOrSubtract(t){if(!this.field.equals(t.field))throw new D("GenericGFPolys do not have same GenericGF field");if(this.isZero())return t;if(t.isZero())return this;let e=this.coefficients,n=t.coefficients;if(e.length>n.length){const s=e;e=n,n=s}let r=new Int32Array(n.length);const i=n.length-e.length;rt.arraycopy(n,0,r,0,i);for(let s=i;s<n.length;s++)r[s]=nn.addOrSubtract(e[s-i],n[s]);return new $t(this.field,r)}multiply(t){if(!this.field.equals(t.field))throw new D("GenericGFPolys do not have same GenericGF field");if(this.isZero()||t.isZero())return this.field.getZero();const e=this.coefficients,n=e.length,r=t.coefficients,i=r.length,s=new Int32Array(n+i-1),o=this.field;for(let a=0;a<n;a++){const l=e[a];for(let c=0;c<i;c++)s[a+c]=nn.addOrSubtract(s[a+c],o.multiply(l,r[c]))}return new $t(o,s)}multiplyScalar(t){if(t===0)return this.field.getZero();if(t===1)return this;const e=this.coefficients.length,n=this.field,r=new Int32Array(e),i=this.coefficients;for(let s=0;s<e;s++)r[s]=n.multiply(i[s],t);return new $t(n,r)}multiplyByMonomial(t,e){if(t<0)throw new D;if(e===0)return this.field.getZero();const n=this.coefficients,r=n.length,i=new Int32Array(r+t),s=this.field;for(let o=0;o<r;o++)i[o]=s.multiply(n[o],e);return new $t(s,i)}divide(t){if(!this.field.equals(t.field))throw new D("GenericGFPolys do n
10ot have same GenericGF field");if(t.isZero())throw new D("Divide by 0");const e=this.field;let n=e.getZero(),r=this;const i=t.getCoefficient(t.getDegree()),s=e.inverse(i);for(;r.getDegree()>=t.getDegree()&&!r.isZero();){const o=r.getDegree()-t.getDegree(),a=e.multiply(r.getCoefficient(r.getDegree()),s),l=t.multiplyByMonomial(o,a),c=e.buildMonomial(o,a);n=n.addOrSubtract(c),r=r.addOrSubtract(l)}return[n,r]}toString(){let t="";for(let e=this.getDegree();e>=0;e--){let n=this.getCoefficient(e);if(n!==0){if(n<0?(t+=" - ",n=-n):t.length>0&&(t+=" + "),e===0||n!==1){const r=this.field.log(n);r===0?t+="1":r===1?t+="a":(t+="a^",t+=r)}e!==0&&(e===1?t+="x":(t+="x^",t+=e))}}return t}}class gn extends m{}gn.kind="ArithmeticException";class lt extends nn{constructor(t,e,n){super(),this.primitive=t,this.size=e,this.generatorBase=n;const r=new Int32Array(e);let i=1;for(let o=0;o<e;o++)r[o]=i,i*=2,i>=e&&(i^=t,i&=e-1);this.expTable=r;const s=new Int32Array(e);for(let o=0;o<e-1;o++)s[r[o]]=o;this.logTable=s,this.zero=new $t(this,Int32Array.from([0])),this.one=new $t(this,Int32Array.from([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(t,e){if(t<0)throw new D;if(e===0)return this.zero;const n=new Int32Array(t+1);return n[0]=e,new $t(this,n)}inverse(t){if(t===0)throw new gn;return this.expTable[this.size-this.logTable[t]-1]}multiply(t,e){return t===0||e===0?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.size-1)]}getSize(){return this.size}getGeneratorBase(){return this.generatorBase}toString(){return"GF(0x"+j.toHexString(this.primitive)+","+this.size+")"}equals(t){return t===this}}lt.AZTEC_DATA_12=new lt(4201,4096,1),lt.AZTEC_DATA_10=new lt(1033,1024,1),lt.AZTEC_DATA_6=new lt(67,64,1),lt.AZTEC_PARAM=new lt(19,16,1),lt.QR_CODE_FIELD_256=new lt(285,256,0),lt.DATA_MATRIX_FIELD_256=new lt(301,256,1),lt.AZTEC_DATA_8=lt.DATA_MATRIX_FIELD_256,lt.MAXICODE_FIELD_64=lt.AZTEC_DATA_6;class We extends m{}We.kind="ReedSolomonException";class we extends m{}we.kind="IllegalStateException";class rn{constructor(t){this.field=t}decode(t,e){const n=this.field,r=new $t(n,t),i=new Int32Array(e);let s=!0;for(let C=0;C<e;C++){const p=r.evaluateAt(n.exp(C+n.getGeneratorBase()));i[i.length-1-C]=p,p!==0&&(s=!1)}if(s)return;const o=new $t(n,i),a=this.runEuclideanAlgorithm(n.buildMonomial(e,1),o,e),l=a[0],c=a[1],f=this.findErrorLocations(l),d=this.findErrorMagnitudes(c,f);for(let C=0;C<f.length;C++){const p=t.length-1-n.log(f[C]);if(p<0)throw new We("Bad error location");t[p]=lt.addOrSubtract(t[p],d[C])}}runEuclideanAlgorithm(t,e,n){if(t.getDegree()<e.getDegree()){const C=t;t=e,e=C}const r=this.field;let i=t,s=e,o=r.getZero(),a=r.getOne();for(;s.getDegree()>=(n/2|0);){let C=i,p=o;if(i=s,o=a,i.isZero())throw new We("r_{i-1} was zero");s=C;let T=r.getZero();const S=i.getCoefficient(i.getDegree()),O=r.inverse(S);for(;s.getDegree()>=i.getDegree()&&!s.isZero();){const B=s.getDegree()-i.getDegree(),k=r.multiply(s.getCoefficient(s.getDegree()),O);T=T.addOrSubtract(r.buildMonomial(B,k)),s=s.addOrSubtract(i.multiplyByMonomial(B,k))}if(a=T.multiply(o).addOrSubtract(p),s.getDegree()>=i.getDegree())throw new we("Division algorithm failed to reduce polynomial?")}const l=a.getCoefficient(0);if(l===0)throw new We("sigmaTilde(0) was zero");const c=r.inverse(l),f=a.multiplyScalar(c),d=s.multiplyScalar(c);return[f,d]}findErrorLocations(t){const e=t.getDegree();if(e===1)return Int32Array.from([t.getCoefficient(1)]);const n=new Int32Array(e);let r=0;const i=this.field;for(let s=1;s<i.getSize()&&r<e;s++)t.evaluateAt(s)===0&&(n[r]=i.inverse(s),r++);if(r!==e)throw new We("Error locator degree does not match number of roots");return n}findErrorMagnitudes(t,e){const n=e.length,r=new Int32Array(n),i=this.field;for(let s=0;s<n;s++){const o=i.inverse(e[s]);let a=1;for(let l=0;l<n;l++)if(s!==l){const c=i.multiply(e[l],o),f=c&1?c&-2:c|1;a=i.multiply(a,f)}r[s]=i.multiply(t.evaluateAt(o),i.inverse(a)),i.getGeneratorBase()!==0&&(r[s]=i.multiply(r[s],o))}return r}}var Gt;(function(u){u[u.UPPER=0]="UPPER",u[u.LOWER=1]="LOWER",u[u.MIXED=2]="MIXED",u[u.DIGIT=3]="DIGIT",u[u.PUNCT=4]="PUNCT",u[u.BINARY=5]="BINARY"})(Gt||(Gt={}));class pt{decode(t){this.ddata=t;let e=t.getBits(),n=this.extractBits(e),r=this.correctBits(n),i=pt.convertBoolArrayToByteArray(r),s=pt.getEncodedData(r),o=new en(i,s,null,null);return o.setNumBits(r.length),o}static highLevelDecode(t){return this.getEncodedData(t)}static getEncodedData(t){let e=t.length,n=Gt.UPPER,r=Gt.UPPER,i="",s=0;for(;s<e;)if(r===Gt.BINARY){if(e-s<5)break;let o=pt.readCode(t,s,5);if(s+=5,o===0){if(e-s<11)break;o=pt.readCode(t,s,11)+31,s+=11}for(let a=0;a<o;a++){if(e-s<8){s=e;break}const l=pt.readCode(t,s,8);i+=q.castAsNonUtf8Char(l),s+=8}r=n}else{let o=r===Gt.DIGIT?4:5;if(e-s<o)break;let a=pt.readCode(t,s,o);s+=o;let l=pt.getCharacter(r,a);
vendor: 8,271 bytes, lines 10-12
10l.startsWith("CTRL_")?(n=r,r=pt.getTable(l.charAt(5)),l.charAt(6)==="L"&&(n=r)):(i+=l,r=n)}return i}static getTable(t){switch(t){case"L":return Gt.LOWER;case"P":return Gt.PUNCT;case"M":return Gt.MIXED;case"D":return Gt.DIGIT;case"B":return Gt.BINARY;case"U":default:return Gt.UPPER}}static getCharacter(t,e){switch(t){case Gt.UPPER:return pt.UPPER_TABLE[e];case Gt.LOWER:return pt.LOWER_TABLE[e];case Gt.MIXED:return pt.MIXED_TABLE[e];case Gt.PUNCT:return pt.PUNCT_TABLE[e];case Gt.DIGIT:return pt.DIGIT_TABLE[e];default:throw new we("Bad table")}}correctBits(t){let e,n;this.ddata.getNbLayers()<=2?(n=6,e=lt.AZTEC_DATA_6):this.ddata.getNbLayers()<=8?(n=8,e=lt.AZTEC_DATA_8):this.ddata.getNbLayers()<=22?(n=10,e=lt.AZTEC_DATA_10):(n=12,e=lt.AZTEC_DATA_12);let r=this.ddata.getNbDatablocks(),i=t.length/n;if(i<r)throw new x;let s=t.length%n,o=new Int32Array(i);for(let d=0;d<i;d++,s+=n)o[d]=pt.readCode(t,s,n);try{new rn(e).decode(o,i-r)}catch(d){throw new x(d)}let a=(1<<n)-1,l=0;for(let d=0;d<r;d++){let C=o[d];if(C===0||C===a)throw new x;(C===1||C===a-1)&&l++}let c=new Array(r*n-l),f=0;for(let d=0;d<r;d++){let C=o[d];if(C===1||C===a-1)c.fill(C>1,f,f+n-1),f+=n-1;else for(let p=n-1;p>=0;--p)c[f++]=(C&1<<p)!==0}return c}extractBits(t){let e=this.ddata.isCompact(),n=this.ddata.getNbLayers(),r=(e?11:14)+n*4,i=new Int32Array(r),s=new Array(this.totalBitsInLayer(n,e));if(e)for(let o=0;o<i.length;o++)i[o]=o;else{let o=r+1+2*j.truncDivision(j.truncDivision(r,2)-1,15),a=r/2,l=j.truncDivision(o,2);for(let c=0;c<a;c++){let f=c+j.truncDivision(c,15);i[a-c-1]=l-f-1,i[a+c]=l+f+1}}for(let o=0,a=0;o<n;o++){let l=(n-o)*4+(e?9:12),c=o*2,f=r-1-c;for(let d=0;d<l;d++){let C=d*2;for(let p=0;p<2;p++)s[a+C+p]=t.get(i[c+p],i[c+d]),s[a+2*l+C+p]=t.get(i[c+d],i[f-p]),s[a+4*l+C+p]=t.get(i[f-p],i[f-d]),s[a+6*l+C+p]=t.get(i[f-d],i[c+p])}a+=l*8}return s}static readCode(t,e,n){let r=0;for(let i=e;i<e+n;i++)r<<=1,t[i]&&(r|=1);return r}static readByte(t,e){let n=t.length-e;return n>=8?pt.readCode(t,e,8):pt.readCode(t,e,n)<<8-n}static convertBoolArrayToByteArray(t){let e=new Uint8Array((t.length+7)/8);for(let n=0;n<e.length;n++)e[n]=pt.readByte(t,8*n);return e}totalBitsInLayer(t,e){return((e?88:112)+16*t)*t}}pt.UPPER_TABLE=["CTRL_PS"," ","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","CTRL_LL","CTRL_ML","CTRL_DL","CTRL_BS"],pt.LOWER_TABLE=["CTRL_PS"," ","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","CTRL_US","CTRL_ML","CTRL_DL","CTRL_BS"],pt.MIXED_TABLE=["CTRL_PS"," ","\\1","\\2","\\3","\\4","\\5","\\6","\\7","\b"," ",` 11`,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],pt.PUNCT_TABLE=["","\r",`\r 12`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],pt.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class st{constructor(){}static round(t){return t===NaN?0:t<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:t>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:t+(t<0?-.5:.5)|0}static distance(t,e,n,r){const i=t-n,s=e-r;return Math.sqrt(i*i+s*s)}static sum(t){let e=0;for(let n=0,r=t.length;n!==r;n++){const i=t[n];e+=i}return e}}class wn{static floatToIntBits(t){return t}}wn.MAX_VALUE=Number.MAX_SAFE_INTEGER;class W{constructor(t,e){this.x=t,this.y=e}getX(){return this.x}getY(){return this.y}equals(t){if(t instanceof W){const e=t;return this.x===e.x&&this.y===e.y}return!1}hashCode(){return 31*wn.floatToIntBits(this.x)+wn.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(t){const e=this.distance(t[0],t[1]),n=this.distance(t[1],t[2]),r=this.distance(t[0],t[2]);let i,s,o;if(n>=e&&n>=r?(s=t[0],i=t[1],o=t[2]):r>=n&&r>=e?(s=t[1],i=t[0],o=t[2]):(s=t[2],i=t[0],o=t[1]),this.crossProductZ(i,s,o)<0){const a=i;i=o,o=a}t[0]=i,t[1]=s,t[2]=o}static distance(t,e){return st.distance(t.x,t.y,e.x,e.y)}static crossProductZ(t,e,n){const r=e.x,i=e.y;return(n.x-r)*(t.y-i)-(n.y-i)*(t.x-r)}}class An{constructor(t,e){this.bits=t,this.points=e}getBits(){return this.bits}getPoints(){return this.points}}class or extends An{constructor(t,e,n,r,i){super(t,e),this.compact=n,this.nbDatablocks=r,this.nbLayers=i}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class ye{constructor(t,e,n,r){this.image=t,this.height=t.getHeight(),this.width=t.getWidth(),e==null&&(e=ye.INIT_SIZE),n==null&&(n=t.getWidth()/2|0),r==null&&(r=t.getHeight()/2|0);const i=e/2|0;if(this.leftInit=n-i,this.rightInit=n+i,this.upInit=r-i,this.downInit=r+i,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new b}detect(){let t=this.leftInit,e=this.rightInit,n=this.upInit,r=this.downInit,i=!1,s=!0,o=!1,a=!1,l=!1,c=!1,f=!1;const d=this.width,C=this.height;for(;s;){s=!1;let p=!0;for(;(p||!a)&&e<d;)p=this.containsBlackPoint(n,r,e,!1),p?(e++,s=!0,a=!0):a||e++;if(e>=d){i=!0;break}let T=!0;for(;(T||!l)&&r<C;)T=this.containsBlackPoint(t,e,r,!0),T?(r++,s=!0,l=!0):l||r++;if(r>=C){i=!0;break}let S=!0;for(;(S||!c)&&t>=0;)S=this.containsBlackPoint(n,r,t,!1),S?(t--,s=!0,c=!0):c||t--;if(t<0){i=!0;break}let O=!0;for(;(O||!f)&&n>=0;)O=this.containsBlackPoint(t,e,n,!0),O?(n--,s=!0,f=!0):f||n--;if(n<0){i=!0;break}s&&(o=!0)}if(!i&&o){const p=e-t;let T=null;for(let k=1;T===null&&k<p;k++)T=this.getBlackPointOnSegment(t,r-k,t+k,r);if(T==null)throw new b;let S=null;for(let k=1;S===null&&k<p;k++)S=this.getBlackPointOnSegment(t,n+k,t+k,n);if(S==null)throw new b;let O=null;for(let k=1;O===null&&k<p;k++)O=this.getBlackPointOnSegment(e,n+k,e-k,n);if(O==null)throw new b;let B=null;for(let k=1;B===null&&k<p;k++)B=this.getBlackPointOnSegment(e,r-k,e-k,r);if(B==null)throw new b;return this.centerEdges(B,T,O,S)}else throw new b}getBlackPointOnSegment(t,e,n,r){const i=st.round(st.distance(t,e,n,r)),s=(n-t)/i,o=(r-e)/i,a=this.image;for(let l=0;l<i;l++){const c=st.round(t+l*s),f=st.round(e+l*o);if(a.get(c,f))return new W(c,f)}return null}centerEdges(t,e,n,r){const i=t.getX(),s=t.getY(),o=e.getX(),a=e.getY(),l=n.getX(),c=n.getY(),f=r.getX(),d=r.getY(),C=ye.CORR;return i<this.width/2?[new W(f-C,d+C),new W(o+C,a+C),new W(l-C,c-C),new W(i+C,s-C)]:[new W(f+C,d+C),new W(o+C,a-C),new W(l-C,c+C),new W(i-C,s-C)]}containsBlackPoint(t,e,n,r){const i=this.image;if(r){for(let s=t;s<=e;s++)if(i.get(s,n))return!0}else for(let s=t;s<=e;s++)if(i.get(n,s))return!0;return!1}}ye.INIT_SIZE=10,ye.CORR=1;class Ln{static checkAndNudgePoints(t,e){const n=t.getWidth(),r=t.getHeight();let i=!0;for(let s=0;s<e.length&&i;s+=2){const o=Math.floor(e[s]),a=Math.floor(e[s+1]);if(o<-1||o>n||a<-1||a>r)throw new b;i=!1,o===-1?(e[s]=0,i=!0):o===n&&(e[s]=n-1,i=!0),a===-1?(e[s+1]=0,i=!0):a===r&&(e[s+1]=r-1,i=!0)}i=!0;for(let s=e.length-2;s>=0&&i;s-=2){const o=Math.floor(e[s]),a=Math.floor(e[s+1]);if(o<-1||o>n||a<-1||a>r)throw new b;i=!1,o===-1?(e[s]=0,i=!0):o===n&&(e[s]=n-1,i=!0),a===-1?(e[s+1]=0,i=!0):a===r&&(e[s+1]=r-1,i=!0)}}}class ue{constructor(t,e,n,r,i,s,o,a,l){this.a11=t,this.a21=e,this.a31=n,this.a12=r,this.a22=i,this.a32=s,this.a13=o,this.a23=a,this.a33=l}static quadrilateralToQuadrilateral(t,e,n,r,i,s,o,a,l,c,f,d,C,p,T,S){const O=ue.quadrilateralToSquare(t,e,n,r,i,s,o,a);return ue.squareToQuadrilateral(l,c,f,d,C,p,T,S).times(O)}transformPoints(t){const e=t.length,n=this.a11,r=this.a12,i=this.a13,s=this.a21,o=this.a22,a=this.a23,l=this.a31,c=this.a32,f=this.a33;for(let d=0;d<e;d+=2){const C=t[d],p=t[d+1],T=i*C+a*p+f;t[d]=(n*C+s*p+l)/T,t[d+1]=(r*C+o*p+c)/T}}transformPointsWithValues(t,e){const n=this.a11,r=this.a12,i=this.a13,s=this.a21,o=this.a22,a=this.a23,l=this.a31,c=this.a32,f=this.a33,d=t.length;for(let C=0;C<d;C++){const p=t[C],T=e[C],S=i*p+a*T+f;t[C]=(n*p+s*T+l)/S,e[C]=(r*p+o*T+c)/S}}static squareToQuadrilateral(t,e,n,r,i,s,o,a){const l=t-n+i-o,c=e-r+s-a;if(l===0&&c===0)return new ue(n-t,i-n,t,r-e,s-r,e,0,0,1);{const f=n-i,d=o-i,C=r-s,p=a-s,T=f*p-d*C,S=(l*p-d*c)/T,O=(f*c-l*C)/T;return new ue(n-t+S*n,o-t+O*o,t,r-e+S*r,a-e+O*a,e,S,O,1)}}static quadrilateralToSquare(t,e,n,r,i,s,o,a){return ue.squareToQuadrilateral(t,e,n,r,i,s,o,a).buildAdjoint(
12)}buildAdjoint(){return new ue(this.a22*this.a33-this.a23*this.a32,this.a23*this.a31-this.a21*this.a33,this.a21*this.a32-this.a22*this.a31,this.a13*this.a32-this.a12*this.a33,this.a11*this.a33-this.a13*this.a31,this.a12*this.a31-this.a11*this.a32,this.a12*this.a23-this.a13*this.a22,this.a13*this.a21-this.a11*this.a23,this.a11*this.a22-this.a12*this.a21)}times(t){return new ue(this.a11*t.a11+this.a21*t.a12+this.a31*t.a13,this.a11*t.a21+this.a21*t.a22+this.a31*t.a23,this.a11*t.a31+this.a21*t.a32+this.a31*t.a33,this.a12*t.a11+this.a22*t.a12+this.a32*t.a13,this.a12*t.a21+this.a22*t.a22+this.a32*t.a23,this.a12*t.a31+this.a22*t.a32+this.a32*t.a33,this.a13*t.a11+this.a23*t.a12+this.a33*t.a13,this.a13*t.a21+this.a23*t.a22+this.a33*t.a23,this.a13*t.a31+this.a23*t.a32+this.a33*t.a33)}}class ar extends Ln{sampleGrid(t,e,n,r,i,s,o,a,l,c,f,d,C,p,T,S,O,B,k){const v=ue.quadrilateralToQuadrilateral(r,i,s,o,a,l,c,f,d,C,p,T,S,O,B,k);return this.sampleGridWithTransform(t,e,n,v)}sampleGridWithTransform(t,e,n,r){if(e<=0||n<=0)throw new b;const i=new kt(e,n),s=new Float32Array(2*e);for(let o=0;o<n;o++){const a=s.length,l=o+.5;for(let c=0;c<a;c+=2)s[c]=c/2+.5,s[c+1]=l;r.transformPoints(s),Ln.checkAndNudgePoints(t,s);try{for(let c=0;c<a;c+=2)t.get(Math.floor(s[c]),Math.floor(s[c+1]))&&i.set(c/2,o)}catch{throw new b}}return i}}class Re{static setGridSampler(t){Re.gridSampler=t}static getInstance(){return Re.gridSampler}}Re.gridSampler=new ar;class qt{constructor(t,e){this.x=t,this.y=e}toResultPoint(){return new W(this.getX(),this.getY())}getX(){return this.x}getY(){return this.y}}class lr{constructor(t){this.EXPECTED_CORNER_BITS=new Int32Array([3808,476,2107,1799]),this.image=t}detect(){return this.detectMirror(!1)}detectMirror(t){let e=this.getMatrixCenter(),n=this.getBullsEyeCorners(e);if(t){let s=n[0];n[0]=n[2],n[2]=s}this.extractParameters(n);let r=this.sampleGrid(this.image,n[this.shift%4],n[(this.shift+1)%4],n[(this.shift+2)%4],n[(this.shift+3)%4]),i=this.getMatrixCornerPoints(n);return new or(r,i,this.compact,this.nbDataBlocks,this.nbLayers)}extractParameters(t){if(!this.isValidPoint(t[0])||!this.isValidPoint(t[1])||!this.isValidPoint(t[2])||!this.isValidPoint(t[3]))throw new b;let e=2*this.nbCenterLayers,n=new Int32Array([this.sampleLine(t[0],t[1],e),this.sampleLine(t[1],t[2],e),this.sampleLine(t[2],t[3],e),this.sampleLine(t[3],t[0],e)]);this.shift=this.getRotation(n,e);let r=0;for(let s=0;s<4;s++){let o=n[(this.shift+s)%4];this.compact?(r<<=7,r+=o>>1&127):(r<<=10,r+=(o>>2&992)+(o>>1&31))}let i=this.getCorrectedParameterData(r,this.compact);this.compact?(this.nbLayers=(i>>6)+1,this.nbDataBlocks=(i&63)+1):(this.nbLayers=(i>>11)+1,this.nbDataBlocks=(i&2047)+1)}getRotation(t,e){let n=0;t.forEach((r,i,s)=>{let o=(r>>e-2<<1)+(r&1);n=(n<<3)+o}),n=((n&1)<<11)+(n>>1);for(let r=0;r<4;r++)if(j.bitCount(n^this.EXPECTED_CORNER_BITS[r])<=2)return r;throw new b}getCorrectedParameterData(t,e){let n,r;e?(n=7,r=2):(n=10,r=4);let i=n-r,s=new Int32Array(n);for(let a=n-1;a>=0;--a)s[a]=t&15,t>>=4;try{new rn(lt.AZTEC_PARAM).decode(s,i)}catch{throw new b}let o=0;for(let a=0;a<r;a++)o=(o<<4)+s[a];return o}getBullsEyeCorners(t){let e=t,n=t,r=t,i=t,s=!0;for(this.nbCenterLayers=1;this.nbCenterLayers<9;this.nbCenterLayers++){let f=this.getFirstDifferent(e,s,1,-1),d=this.getFirstDifferent(n,s,1,1),C=this.getFirstDifferent(r,s,-1,1),p=this.getFirstDifferent(i,s,-1,-1);if(this.nbCenterLayers>2){let T=this.distancePoint(p,f)*this.nbCenterLayers/(this.distancePoint(i,e)*(this.nbCenterLayers+2));if(T<.75||T>1.25||!this.isWhiteOrBlackRectangle(f,d,C,p))break}e=f,n=d,r=C,i=p,s=!s}if(this.nbCenterLayers!==5&&this.nbCenterLayers!==7)throw new b;this.compact=this.nbCenterLayers===5;let o=new W(e.getX()+.5,e.getY()-.5),a=new W(n.getX()+.5,n.getY()+.5),l=new W(r.getX()-.5,r.getY()+.5),c=new W(i.getX()-.5,i.getY()-.5);return this.expandSquare([o,a,l,c],2*this.nbCenterLayers-3,2*this.nbCenterLayers)}getMatrixCenter(){let t,e,n,r;try{let o=new ye(this.image).detect();t=o[0],e=o[1],n=o[2],r=o[3]}catch{let a=this.image.getWidth()/2,l=this.image.getHeight()/2;t=this.getFirstDifferent(new qt(a+7,l-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new qt(a+7,l+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new qt(a-7,l+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new qt(a-7,l-7),!1,-1,-1).toResultPoint()}let i=st.round((t.getX()+r.getX()+e.getX()+n.getX())/4),s=st.round((t.getY()+r.getY()+e.getY()+n.getY())/4);try{let o=new ye(this.image,15,i,s).detect();t=o[0],e=o[1],n=o[2],r=o[3]}catch{t=this.getFirstDifferent(new qt(i+7,s-7),!1,1,-1).toResultPoint(),e=this.getFirstDifferent(new qt(i+7,s+7),!1,1,1).toResultPoint(),n=this.getFirstDifferent(new qt(i-7,s+7),!1,-1,1).toResultPoint(),r=this.getFirstDifferent(new qt(i-7,s-7
12),!1,-1,-1).toResultPoint()}return i=st.round((t.getX()+r.getX()+e.getX()+n.getX())/4),s=st.round((t.getY()+r.getY()+e.getY()+n.getY())/4),new qt(i,s)}getMatrixCornerPoints(t){return this.expandSquare(t,2*this.nbCenterLayers,this.getDimension())}sampleGrid(t,e,n,r,i){let s=Re.getInstance(),o=this.getDimension(),a=o/2-this.nbCenterLayers,l=o/2+this.nbCenterLayers;return s.sampleGrid(t,o,o,a,a,l,a,l,l,a,l,e.getX(),e.getY(),n.getX(),n.getY(),r.getX(),r.getY(),i.getX(),i.getY())}sampleLine(t,e,n){let r=0,i=this.distanceResultPoint(t,e),s=i/n,o=t.getX(),a=t.getY(),l=s*(e.getX()-t.getX())/i,c=s*(e.getY()-t.getY())/i;for(let f=0;f<n;f++)this.image.get(st.round(o+f*l),st.round(a+f*c))&&(r|=1<<n-f-1);return r}isWhiteOrBlackRectangle(t,e,n,r){let i=3;t=new qt(t.getX()-i,t.getY()+i),e=new qt(e.getX()-i,e.getY()-i),n=new qt(n.getX()+i,n.getY()-i),r=new qt(r.getX()+i,r.getY()+i);let s=this.getColor(r,t);if(s===0)return!1;let o=this.getColor(t,e);return o!==s||(o=this.getColor(e,n),o!==s)?!1:(o=this.getColor(n,r),o===s)}getColor(t,e){let n=this.distancePoint(t,e),r=(e.getX()-t.getX())/n,i=(e.getY()-t.getY())/n,s=0,o=t.getX(),a=t.getY(),l=this.image.get(t.getX(),t.getY()),c=Math.ceil(n);for(let d=0;d<c;d++)o+=r,a+=i,this.image.get(st.round(o),st.round(a))!==l&&s++;let f=s/n;return f>.1&&f<.9?0:f<=.1===l?1:-1}getFirstDifferent(t,e,n,r){let i=t.getX()+n,s=t.getY()+r;for(;this.isValid(i,s)&&this.image.get(i,s)===e;)i+=n,s+=r;for(i-=n,s-=r;this.isValid(i,s)&&this.image.get(i,s)===e;)i+=n;for(i-=n;this.isValid(i,s)&&this.image.get(i,s)===e;)s+=r;return s-=r,new qt(i,s)}expandSquare(t,e,n){let r=n/(2*e),i=t[0].getX()-t[2].getX(),s=t[0].getY()-t[2].getY(),o=(t[0].getX()+t[2].getX())/2,a=(t[0].getY()+t[2].getY())/2,l=new W(o+r*i,a+r*s),c=new W(o-r*i,a-r*s);i=t[1].getX()-t[3].getX(),s=t[1].getY()-t[3].getY(),o=(t[1].getX()+t[3].getX())/2,a=(t[1].getY()+t[3].getY())/2;let f=new W(o+r*i,a+r*s),d=new W(o-r*i,a-r*s);return[l,f,c,d]}isValid(t,e){return t>=0&&t<this.image.getWidth()&&e>0&&e<this.image.getHeight()}isValidPoint(t){let e=st.round(t.getX()),n=st.round(t.getY());return this.isValid(e,n)}distancePoint(t,e){return st.distance(t.getX(),t.getY(),e.getX(),e.getY())}distanceResultPoint(t,e){return st.distance(t.getX(),t.getY(),e.getX(),e.getY())}getDimension(){return this.compact?4*this.nbLayers+11:this.nbLayers<=4?4*this.nbLayers+15:4*this.nbLayers+2*(j.truncDivision(this.nbLayers-4,8)+1)+15}}class En{decode(t,e=null){let n=null,r=new lr(t.getBlackMatrix()),i=null,s=null;try{let c=r.detectMirror(!1);i=c.getPoints(),this.reportFoundResultPoints(e,i),s=new pt().decode(c)}catch(c){n=c}if(s==null)try{let c=r.detectMirror(!0);i=c.getPoints(),this.reportFoundResultPoints(e,i),s=new pt().decode(c)}catch(c){throw n??c}let o=new jt(s.getText(),s.getRawBytes(),s.getNumBits(),i,z.AZTEC,rt.currentTimeMillis()),a=s.getByteSegments();a!=null&&o.putMetadata(Ut.BYTE_SEGMENTS,a);let l=s.getECLevel();return l!=null&&o.putMetadata(Ut.ERROR_CORRECTION_LEVEL,l),o}reportFoundResultPoints(t,e){if(t!=null){let n=t.get(gt.NEED_RESULT_POINT_CALLBACK);n!=null&&e.forEach((r,i,s)=>{n.foundPossibleResultPoint(r)})}}reset(){}}class xr extends Le{constructor(t=500){super(new En,t)}}class vt{decode(t,e){try{return this.doDecode(t,e)}catch{if(e&&e.get(gt.TRY_HARDER)===!0&&t.isRotateSupported()){const i=t.rotateCounterClockwise(),s=this.doDecode(i,e),o=s.getResultMetadata();let a=270;o!==null&&o.get(Ut.ORIENTATION)===!0&&(a=a+o.get(Ut.ORIENTATION)%360),s.putMetadata(Ut.ORIENTATION,a);const l=s.getResultPoints();if(l!==null){const c=i.getHeight();for(let f=0;f<l.length;f++)l[f]=new W(c-l[f].getY()-1,l[f].getX())}return s}else throw new b}}reset(){}doDecode(t,e){const n=t.getWidth(),r=t.getHeight();let i=new at(n);const s=e&&e.get(gt.TRY_HARDER)===!0,o=Math.max(1,r>>(s?8:5));let a;s?a=r:a=15;const l=Math.trunc(r/2);for(let c=0;c<a;c++){const f=Math.trunc((c+1)/2),d=(c&1)===0,C=l+o*(d?f:-f);if(C<0||C>=r)break;try{i=t.getBlackRow(C,i)}catch{continue}for(let p=0;p<2;p++){if(p===1&&(i.reverse(),e&&e.get(gt.NEED_RESULT_POINT_CALLBACK)===!0)){const T=new Map;e.forEach((S,O)=>T.set(O,S)),T.delete(gt.NEED_RESULT_POINT_CALLBACK),e=T}try{const T=this.decodeRow(C,i,e);if(p===1){T.putMetadata(Ut.ORIENTATION,180);const S=T.getResultPoints();
12S!==null&&(S[0]=new W(n-S[0].getX()-1,S[0].getY()),S[1]=new W(n-S[1].getX()-1,S[1].getY()))}return T}catch{}}}throw new b}static recordPattern(t,e,n){const r=n.length;for(let l=0;l<r;l++)n[l]=0;const i=t.getSize();if(e>=i)throw new b;let s=!t.get(e),o=0,a=e;for(;a<i;){if(t.get(a)!==s)n[o]++;else{if(++o===r)break;n[o]=1,s=!s}a++}if(!(o===r||o===r-1&&a===i))throw new b}static recordPatternInReverse(t,e,n){let r=n.length,i=t.get(e);for(;e>0&&r>=0;)t.get(--e)!==i&&(r--,i=!i);if(r>=0)throw new b;vt.recordPattern(t,e+1,n)}static patternMatchVariance(t,e,n){const r=t.length;let i=0,s=0;for(let l=0;l<r;l++)i+=t[l],s+=e[l];if(i<s)return Number.POSITIVE_INFINITY;const o=i/s;n*=o;let a=0;for(let l=0;l<r;l++){const c=t[l],f=e[l]*o,d=c>f?c-f:f-c;if(d>n)return Number.POSITIVE_INFINITY;a+=d}return a/i}}class V extends vt{static findStartPattern(t){const e=t.getSize(),n=t.getNextSet(0);let r=0,i=Int32Array.from([0,0,0,0,0,0]),s=n,o=!1;const a=6;for(let l=n;l<e;l++)if(t.get(l)!==o)i[r]++;else{if(r===a-1){let c=V.MAX_AVG_VARIANCE,f=-1;for(let d=V.CODE_START_A;d<=V.CODE_START_C;d++){const C=vt.patternMatchVariance(i,V.CODE_PATTERNS[d],V.MAX_INDIVIDUAL_VARIANCE);C<c&&(c=C,f=d)}if(f>=0&&t.isRange(Math.max(0,s-(l-s)/2),s,!1))return Int32Array.from([s,l,f]);s+=i[0]+i[1],i=i.slice(2,i.length-1),i[r-1]=0,i[r]=0,r--}else r++;i[r]=1,o=!o}throw new b}static decodeCode(t,e,n){vt.recordPattern(t,n,e);let r=V.MAX_AVG_VARIANCE,i=-1;for(let s=0;s<V.CODE_PATTERNS.length;s++){const o=V.CODE_PATTERNS[s],a=this.patternMatchVariance(e,o,V.MAX_INDIVIDUAL_VARIANCE);a<r&&(r=a,i=s)}if(i>=0)return i;throw new b}decodeRow(t,e,n){const r=n&&n.get(gt.ASSUME_GS1)===!0,i=V.findStartPattern(e),s=i[2];let o=0;const a=new Uint8Array(20);a[o++]=s;let l;switch(s){case V.CODE_START_A:l=V.CODE_CODE_A;break;case V.CODE_START_B:l=V.CODE_CODE_B;break;case V.CODE_START_C:l=V.CODE_CODE_C;break;default:throw new x}let c=!1,f=!1,d="",C=i[0],p=i[1];const T=Int32Array.from([0,0,0,0,0,0]);let S=0,O=0,B=s,k=0,v=!0,nt=!1,Q=!1;for(;!c;){const Je=f;switch(f=!1,S=O,O=V.decodeCode(e,T,p),a[o++]=O,O!==V.CODE_STOP&&(v=!0),O!==V.CODE_STOP&&(k++,B+=k*O),C=p,p+=T.reduce((gi,wi)=>gi+wi,0),O){case V.CODE_START_A:case V.CODE_START_B:case V.CODE_START_C:throw new x}switch(l){case V.CODE_CODE_A:if(O<64)Q===nt?d+=String.fromCharCode(32+O):d+=String.fromCharCode(32+O+128),Q=!1;else if(O<96)Q===nt?d+=String.fromCharCode(O-64):d+=String.fromCharCode(O+64),Q=!1;else switch(O!==V.CODE_STOP&&(v=!1),O){case V.CODE_FNC_1:r&&(d.length===0?d+="]C1":d+="�");break;case V.CODE_FNC_2:case V.CODE_FNC_3:break;case V.CODE_FNC_4_A:!nt&&Q?(nt=!0,Q=!1):nt&&Q?(nt=!1,Q=!1):Q=!0;break;case V.CODE_SHIFT:f=!0,l=V.CODE_CODE_B;break;case V.CODE_CODE_B:l=V.CODE_CODE_B;break;case V.CODE_CODE_C:l=V.CODE_CODE_C;break;case V.CODE_STOP:c=!0;break}break;case V.CODE_CODE_B:if(O<96)Q===nt?d+=String.fromCharCode(32+O):d+=String.fromCharCode(32+O+128),Q=!1;else switch(O!==V.CODE_STOP&&(v=!1),O){case V.CODE_FNC_1:r&&(d.length===0?d+="]C1":d+="�");break;case V.CODE_FNC_2:case V.CODE_FNC_3:break;case V.CODE_FNC_4_B:!nt&&Q?(nt=!0,Q=!1):nt&&Q?(nt=!1,Q=!1):Q=!0;break;case V.CODE_SHIFT:f=!0,l=V.CODE_CODE_A;break;case V.CODE_CODE_A:l=V.CODE_CODE_A;break;case V.CODE_CODE_C:l=V.CODE_CODE_C;break;case V.CODE_STOP:c=!0;break}break;case V.CODE_CODE_C:if(O<100)O<10&&(d+="0"),d+=O;else switch(O!==V.CODE_STOP&&(v=!1),O){case V.CODE_FNC_1:r&&(d.length===0?d+="]C1":d+="�");break;case V.CODE_CODE_A:l=V.CODE_CODE_A;break;case V.CODE_CODE_B:l=V.CODE_CODE_B;break;case V.CODE_STOP:c=!0;break}break}Je&&(l=l===V.CODE_CODE_A?V.CODE_CODE_B:V.CODE_CODE_A)}const re=p-C;if(p=e.getNextUnset(p),!e.isRange(p,Math.min(e.getSize(),p+(p-C)/2),!1))throw new b;if(B-=k*S,B%103!==S)throw new et;const de=d.length;if(de===0)throw new b;de>0&&v&&(l===V.CODE_CODE_C?d=d.substring(0,de-2):d=d.substring(0,de-1));const ie=(i[1]+i[0])/2,mt=C+re/2,Xt=a.length,se=new Uint8Array(Xt);for(let Je=0;Je<Xt;Je++)se[Je]=a[Je];const Qe=[new W(ie,t),new W(mt,t)];return new jt(d,se,0,Qe,z.CODE_128,new Date().getTime())}}V.CODE_PATTERNS=[Int32Array.from([2,1,2,2,2,2]),Int32Array.from([2,2,2,1,2,2]),Int32Array.from([2,2,2,2,2,1]),Int32Array.from([1,2,1,2,2,3]),Int32Array.from([1,2,1,3,2,2]),Int32Array.from([1,3,1,2,2,2]),Int32Array.from([1,2,2,2,1,3]),Int32Array.from([1,2,2,3,1,2]),Int32Array.from([1,3,2,2,1,2]),Int32Array.from([2,2,1,2,1,3]),Int32Array.from([2,2,1,3,1,2]),Int32Array.from([2,3,1,2,1,2]),Int32Array.from([1,1,2,2,3,2]),Int32Array.from([1,2,2,1,3,2]),Int32Array.from([1,2,2,2,3,1]),Int32Array.from([1,1,3,2,2,2]),Int32Array.from([1,2,3,1,2,2]),Int32Array.from([1,2,3,2,2,1]),Int32Array.from([2,2,3,2,1,1]),Int32Array.from([2,2,1,1,3,2]),Int32Array.from([2,2,1,2,3,1]),Int32Array.from([2,1,3,2,1,2]),Int32Array.from([2,2,3,1,1,2]),Int32Array.from([3,1,2,1,3,1]),Int32Array.from([3,1,1,2,2,2]),Int32Array.from([3,2,1,1,2,2]),Int32Array.from([3,2,1,2,2,1]),Int32Array.from([3,1,2,2,1,2]),Int32Array.from([3,2,2,1,1,2]),Int32Array.from([3,2,2,2,1,1]),Int32Array.from([2,1,2,1,2,3]),Int32Array.from([2,1,2,3,2,1]),Int32Array.from([2,3,2,1,2,1]),Int32Array.from([1,1,1,3,2,3]),Int32Array.from([1,3,1,1,2,3]),Int32Array.from([1,3,1,3,2,1]),Int32Array.from([1,1,2,3,1,3]),Int32Array.from([1,3,2,1,1,3]),Int32Array.from([1,3,2,3,1,1]),Int32Array.from([2,1,1,3,1,3]),Int32Array.from([2,3,1,1,1,3]),Int32Array.from([2,3,1,3,1,1]),Int32Array.from([1,1,2,1,3,3]),Int32Array.from([1,1,2,3,3,1]),Int32Array.from([1,3,2,1,3,1]),Int32Array.from([1,1,3,1,2,3]),Int32Array.from([1,1,3,3,2,1]),Int32Array.from([1,3,3,1,2,1]),Int32Array.from([3,1,3,1,2,1]),Int32Array.from([2,1,1,3,3,1]),Int32Array.from([2,3,1,1,3,1]),Int32Array.from([2,1,3,1,1,3]),Int32Array.from([2,1,3,3,1,1]),Int32Array.from([2,1,3,1,3,1]),Int32Array.from([3,1,1,1,2,3]),Int32Array.from([3,1,1,3,2,1]),Int32Array.from([3,3,1,1,2,1]),Int32Array.from([3,1,2,1,1,3]),Int32Array.from([3,1,2,3,1,1]),Int32Array.from([3,3,2,1,1,1]),Int32Array.from([3,1,4,1,1,1]),Int32Array.from([2,2,1,4,1,1]),Int32Array.from([4,3,1,1,1,1]),Int32Array.from([1,1,1,2,2,4]),Int32Array.from([1,1,1,4,2,2]),Int32Array.from([1,2,1,1,2,4]),Int32Array.from([1,2,1,4,2,1]),Int32Array.from([1,4,1,1,2,2]),Int32Array.from([1,4,1,2,2,1]),Int32Array.from([1,1,2,2,1,4]),Int32Array.from([1,1,2,4,1,2]),Int32Array.from([1,2,2,1,1,4]),Int32Array.from([1,2,2,4,1,1]),Int32Array.from([1,4,2,1,1,2]),Int32Array.from([1,4,2,2,1,1]),Int32Array.from([2,4,1,2,1,1]),Int32Array.from([2,2,1,1,1,4]),Int32Array.from([4,1,3,1,1,1]),Int32Array.from([2,4,1,1,1,2]),Int32Array.from([1,3,4,1,1,1]),Int32Array.from([1,1,1,2,4,2]),Int32Array.from([1,2,1,1,4,2]),Int32Array.from([1,2,1,2,4,1]),Int32Array.from([1,1,4,2,1,2]),Int32Array.from([1,2,4,1,1,2]),Int32Array.from([1,2,4,2,1,1]),Int32Array.from([4,1,1,2,1,2]),Int32Array.from([4,2,1,1,1,2]),Int32Array.from([4,2,1,2,1,1]),Int32Array.from([2,1,2,1,4,1]),Int32Array.from([2,1,4,1,2,1]),Int32Array.from([4,1,2,1,2,1]),Int32Array.from([1,1,1,1,4,3]),Int32Array.from([1,1,1,3,4,1]),Int32Array.from([1,3,1,1,4,1]),Int32Array.from([1,1,4,1,1,3]),Int32Array.from([1,1,4,3,1,1]),Int32Array.from([4,1,1,1,1,3]),Int32Array.from([4,1,1,3,1,1]),Int32Array.from([1,1,3,1,4,1]),Int32Array.from([1,1,4,1,3,1]),Int32Array.from([3,1,1,1,4,1]),Int32Array.from([4,1,1,1,3,1]),Int32Array.from([2,1,1,4,1,2]),Int32Array.from([2,1,1,2,1,4]),Int32Array.from([2,1,1,2,3,2]),Int32Array.from([2,3,3,1,1,1,2])],V.MAX_AVG_VARIANCE=.25,V.MAX_INDIVIDUAL_VARIA
12NCE=.7,V.CODE_SHIFT=98,V.CODE_CODE_C=99,V.CODE_CODE_B=100,V.CODE_CODE_A=101,V.CODE_FNC_1=102,V.CODE_FNC_2=97,V.CODE_FNC_3=96,V.CODE_FNC_4_A=101,V.CODE_FNC_4_B=100,V.CODE_START_A=103,V.CODE_START_B=104,V.CODE_START_C=105,V.CODE_STOP=106;class Bt extends vt{constructor(t=!1,e=!1){super(),this.usingCheckDigit=t,this.extendedMode=e,this.decodeRowResult="",this.counters=new Int32Array(9)}decodeRow(t,e,n){let r=this.counters;r.fill(0),this.decodeRowResult="";let i=Bt.findAsteriskPattern(e,r),s=e.getNextSet(i[1]),o=e.getSize(),a,l;do{Bt.recordPattern(e,s,r);let T=Bt.toNarrowWidePattern(r);if(T<0)throw new b;a=Bt.patternToChar(T),this.decodeRowResult+=a,l=s;for(let S of r)s+=S;s=e.getNextSet(s)}while(a!=="*");this.decodeRowResult=this.decodeRowResult.substring(0,this.decodeRowResult.length-1);let c=0;for(let T of r)c+=T;let f=s-l-c;if(s!==o&&f*2<c)throw new b;if(this.usingCheckDigit){let T=this.decodeRowResult.length-1,S=0;for(let O=0;O<T;O++)S+=Bt.ALPHABET_STRING.indexOf(this.decodeRowResult.charAt(O));if(this.decodeRowResult.charAt(T)!==Bt.ALPHABET_STRING.charAt(S%43))throw new et;this.decodeRowResult=this.decodeRowResult.substring(0,T)}if(this.decodeRowResult.length===0)throw new b;let d;this.extendedMode?d=Bt.decodeExtended(this.decodeRowResult):d=this.decodeRowResult;let C=(i[1]+i[0])/2,p=l+c/2;return new jt(d,null,0,[new W(C,t),new W(p,t)],z.CODE_39,new Date().getTime())}static findAsteriskPattern(t,e){let n=t.getSize(),r=t.getNextSet(0),i=0,s=r,o=!1,a=e.length;for(let l=r;l<n;l++)if(t.get(l)!==o)e[i]++;else{if(i===a-1){if(this.toNarrowWidePattern(e)===Bt.ASTERISK_ENCODING&&t.isRange(Math.max(0,s-Math.floor((l-s)/2)),s,!1))return[s,l];s+=e[0]+e[1],e.copyWithin(0,2,2+i-1),e[i-1]=0,e[i]=0,i--}else i++;e[i]=1,o=!o}throw new b}static toNarrowWidePattern(t){let e=t.length,n=0,r;do{let i=2147483647;for(let a of t)a<i&&a>n&&(i=a);n=i,r=0;let s=0,o=0;for(let a=0;a<e;a++){let l=t[a];l>n&&(o|=1<<e-1-a,r++,s+=l)}if(r===3){for(let a=0;a<e&&r>0;a++){let l=t[a];if(l>n&&(r--,l*2>=s))return-1}return o}}while(r>3);return-1}static patternToChar(t){for(let e=0;e<Bt.CHARACTER_ENCODINGS.length;e++)if(Bt.CHARACTER_ENCODINGS[e]===t)return Bt.ALPHABET_STRING.charAt(e);if(t===Bt.ASTERISK_ENCODING)return"*";throw new b}static decodeExtended(t){let e=t.length,n="";for(let r=0;r<e;r++){let i=t.charAt(r);if(i==="+"||i==="$"||i==="%"||i==="/"){let s=t.charAt(r+1),o="\0";switch(i){case"+":if(s>="A"&&s<="Z")o=String.fromCharCode(s.charCodeAt(0)+32);else throw new x;break;case"$":if(s>="A"&&s<="Z")o=String.fromCharCode(s.charCodeAt(0)-64);else throw new x;break;case"%":if(s>="A"&&s<="E")o=String.fromCharCode(s.charCodeAt(0)-38);else if(s>="F"&&s<="J")o=String.fromCharCode(s.charCodeAt(0)-11);else if(s>="K"&&s<="O")o=String.fromCharCode(s.charCodeAt(0)+16);else if(s>="P"&&s<="T")o=String.fromCharCode(s.charCodeAt(0)+43);else if(s==="U")o="\0";else if(s==="V")o="@";else if(s==="W")o="`";else if(s==="X"||s==="Y"||s==="Z")o="�";else throw new x;break;case"/":if(s>="A"&&s<="O")o=String.fromCharCode(s.charCodeAt(0)-32);else if(s==="Z")o=":";else throw new x;break}n+=o,r++}else n+=i}return n}}Bt.ALPHABET_STRING="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%",Bt.CHARACTER_ENCODINGS=[52,289,97,352,49,304,112,37,292,100,265,73,328,25,280,88,13,268,76,28,259,67,322,19,274,82,7,262,70,22,385,193,448,145,400,208,133,388,196,168,162,138,42],Bt.ASTERISK_ENCODING=148;class Et extends vt{constructor(){super(...arguments),this.narrowLineWidth=-1}decodeRow(t,e,n){let r=this.decodeStart(e),i=this.decodeEnd(e),s=new wt;Et.decodeMiddle(e,r[1],i[0],s);let o=s.toString(),a=null;n!=null&&(a=n.get(gt.ALLOWED_LENGTHS)),a==null&&(a=Et.DEFAULT_ALLOWED_LENGTHS);let l=o.length,c=!1,f=0;for(let p of a){if(l===p){c=!0;break}p>f&&(f=p)}if(!c&&l>f&&(c=!0),!c)throw new x;const d=[new W(r[1],t),new W(i[0],t)];return new jt(o,null,0,d,z.ITF,new Date().getTime())}static decodeMiddle(t,e,n,r){let i=new Int32Array(10),s=new Int32Array(5),o=new Int32Array(5);for(i.fill(0),s.fill(0),o.fill(0);e<n;){vt.recordPattern(t,e,i);for(let l=0;l<5;l++){let c=2*l;s[l]=i[c],o[l]=i[c+1]}let a=Et.decodeDigit(s);r.append(a.toString()),a=this.decodeDigit(o),r.append(a.toString()),i.forEac
12h(function(l){e+=l})}}decodeStart(t){let e=Et.skipWhiteSpace(t),n=Et.findGuardPattern(t,e,Et.START_PATTERN);return this.narrowLineWidth=(n[1]-n[0])/4,this.validateQuietZone(t,n[0]),n}validateQuietZone(t,e){let n=this.narrowLineWidth*10;n=n<e?n:e;for(let r=e-1;n>0&&r>=0&&!t.get(r);r--)n--;if(n!==0)throw new b}static skipWhiteSpace(t){const e=t.getSize(),n=t.getNextSet(0);if(n===e)throw new b;return n}decodeEnd(t){t.reverse();try{let e=Et.skipWhiteSpace(t),n;try{n=Et.findGuardPattern(t,e,Et.END_PATTERN_REVERSED[0])}catch(i){i instanceof b&&(n=Et.findGuardPattern(t,e,Et.END_PATTERN_REVERSED[1]))}this.validateQuietZone(t,n[0]);let r=n[0];return n[0]=t.getSize()-n[1],n[1]=t.getSize()-r,n}finally{t.reverse()}}static findGuardPattern(t,e,n){let r=n.length,i=new Int32Array(r),s=t.getSize(),o=!1,a=0,l=e;i.fill(0);for(let c=e;c<s;c++)if(t.get(c)!==o)i[a]++;else{if(a===r-1){if(vt.patternMatchVariance(i,n,Et.MAX_INDIVIDUAL_VARIANCE)<Et.MAX_AVG_VARIANCE)return[l,c];l+=i[0]+i[1],rt.arraycopy(i,2,i,0,a-1),i[a-1]=0,i[a]=0,a--}else a++;i[a]=1,o=!o}throw new b}static decodeDigit(t){let e=Et.MAX_AVG_VARIANCE,n=-1,r=Et.PATTERNS.length;for(let i=0;i<r;i++){let s=Et.PATTERNS[i],o=vt.patternMatchVariance(t,s,Et.MAX_INDIVIDUAL_VARIANCE);o<e?(e=o,n=i):o===e&&(n=-1)}if(n>=0)return n%10;throw new b}}Et.PATTERNS=[Int32Array.from([1,1,2,2,1]),Int32Array.from([2,1,1,1,2]),Int32Array.from([1,2,1,1,2]),Int32Array.from([2,2,1,1,1]),Int32Array.from([1,1,2,1,2]),Int32Array.from([2,1,2,1,1]),Int32Array.from([1,2,2,1,1]),Int32Array.from([1,1,1,2,2]),Int32Array.from([2,1,1,2,1]),Int32Array.from([1,2,1,2,1]),Int32Array.from([1,1,3,3,1]),Int32Array.from([3,1,1,1,3]),Int32Array.from([1,3,1,1,3]),Int32Array.from([3,3,1,1,1]),Int32Array.from([1,1,3,1,3]),Int32Array.from([3,1,3,1,1]),Int32Array.from([1,3,3,1,1]),Int32Array.from([1,1,1,3,3]),Int32Array.from([3,1,1,3,1]),Int32Array.from([1,3,1,3,1])],Et.MAX_AVG_VARIANCE=.38,Et.MAX_INDIVIDUAL_VARIANCE=.5,Et.DEFAULT_ALLOWED_LENGTHS=[6,8,10,12,14],Et.START_PATTERN=Int32Array.from([1,1,1,1]),Et.END_PATTERN_REVERSED=[Int32Array.from([1,1,2]),Int32Array.from([1,1,3])];class Ot extends vt{constructor(){super(...arguments),this.decodeRowStringBuffer=""}static findStartGuardPattern(t){let e=!1,n,r=0,i=Int32Array.from([0,0,0]);for(;!e;){i=Int32Array.from([0,0,0]),n=Ot.findGuardPattern(t,r,!1,this.START_END_PATTERN,i);let s=n[0];r=n[1];let o=s-(r-s);o>=0&&(e=t.isRange(o,s,!1))}return n}static checkChecksum(t){return Ot.checkStandardUPCEANChecksum(t)}static checkStandardUPCEANChecksum(t){let e=t.length;if(e===0)return!1;let n=parseInt(t.charAt(e-1),10);return Ot.getStandardUPCEANChecksum(t.substring(0,e-1))===n}static getStandardUPCEANChecksum(t){let e=t.length,n=0;for(let r=e-1;r>=0;r-=2){let i=t.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new x;n+=i}n*=3;for(let r=e-2;r>=0;r-=2){let i=t.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new x;n+=i}return(1e3-n)%10}static decodeEnd(t,e){return Ot.findGuardPattern(t,e,!1,Ot.START_END_PATTERN,new Int32Array(Ot.START_END_PATTERN.length).fill(0))}static findGuardPatternWithoutCounters(t,e,n,r){return this.findGuardPattern(t,e,n,r,new Int32Array(r.length))}static findGuardPattern(t,e,n,r,i){let s=t.getSize();e=n?t.getNextUnset(e):t.getNextSet(e);let o=0,a=e,l=r.length,c=n;for(let f=e;f<s;f++)if(t.get(f)!==c)i[o]++;else{if(o===l-1){if(vt.patternMatchVariance(i,r,Ot.MAX_INDIVIDUAL_VARIANCE)<Ot.MAX_AVG_VARIANCE)return Int32Array.from([a,f]);a+=i[0]+i[1];let d=i.slice(2,i.length-1);for(let C=0;C<o-1;C++)i[C]=d[C];i[o-1]=0,i[o]=0,o--}else o++;i[o]=1,c=!c}throw new b}static decodeDigit(t,e,n,r){this.recordPattern(t,n,e);let i=this.MAX_AVG_VARIANCE,s=-1,o=r.length;for(let a=0;a<o;a++){let l=r[a],c=vt.patternMatchVariance(e,l,Ot.MAX_INDIVIDUAL_VARIANCE);c<i&&(i=c,s=a)}if(s>=0)return s;throw new b}}Ot.MAX_AVG_VARIANCE=.48,Ot.MAX_INDIVIDUAL_VARIANCE=.7,Ot.START_END_PATTERN=Int32Array.from([1,1,1]),Ot.MIDDLE_PATTERN=Int32Array.from([1,1,1,1,1]),Ot.END_PATTERN=Int32Array.from([1,1,1,1,1,1]),Ot.L_PATTERNS=[Int32Array.from([3,2,1,1]),Int32Array.from([2,2,2,1]),Int32Array.from([2,1,2,2]),Int32Array.from([1,4,1,1]),Int32Array.from([1,1,3,2]),Int32Array.from([1,2,3,1]),Int32Array.from([1,1,1,4]),Int32Array.from([1,3,1,2]),Int32Array.from([1,2,1,3]),Int32Array.from([3,1,1,2])];class sn{constructor(){this.CHECK_DIGIT_ENCODINGS=[24,20,18,17,12,6,3,10,9,5],this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(t,e,n){let r=this.decodeRowStringBuffer,i=this.decodeMiddle(e,n,r),s=r.toString(),o=sn.parseExtensionString(s),a=[new W((n[0]+n[1])/2,t),new W(i,t)],l=new jt(s,null,0,a,z.UPC_EAN_EXTENSION,new Date().getTime());return o!=null&&l.putAllMetadata(o),l}decodeMiddle(t,e,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=t.getSize(),s=e[1],o=0;for(let l=0;l<5&&s<i;l++){let c=Ot.decodeDigit(t,r,s,Ot.L_AND_G_PATTERNS);n+=String.fromCharCode(48+c%10);for(let f of r)s+=f;c>=10&&(o|=1<<4-l),l!==4&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(n.length!==5)throw new b;let a=this.determineCheckDigit(o);if(sn.extensionChecksum(n.toString())!==a)throw new b;return s}static extensionChecksum(t){let e=t.length,n=0;for(let r=e-2;r>=0;r-=2)n+=t.charAt(r).charCodeAt(0)-48;n*=3;for(let r=e-1;r>=0;r-=2)n+=t.charAt(r).charCodeAt(0)-48;return n*=3,n%10}determineCheckDigit(t){for(let e=0;e<10;e++)if(t===this.CHECK_DIGIT_ENCODINGS[e])return e;throw new b}static parseExtensionString(t){if(t.length!==5)return null;let e=sn.parseExtension5String(t);return e==null?null:new Map([[Ut.SUGGESTED_PRICE,e]])}static parseExtension5String(t){let e;switch(t.charAt(0)){case"0":e="£";break;case"5":e="$";break;case"9":switch(t){case"90000":return null;case"99991":return"0.00";case"99990":return"Used"}e="";break;default:e="";break}let n=parseInt(t.substring(1)),r=(n/100).toString(),i=n%100,s=i<10?"0"+i:i.toString();return e+r+"."+s}}class kn{constructor(){this.decodeMiddleCounters=Int32Array.from([0,0,0,0]),this.decodeRowStringBuffer=""}decodeRow(t,e,n){let r=this.decodeRowStringBuffer,i=this.decodeMiddle(e,n,r),s=r.toString(),o=kn.parseExtensionString(s),a=[new W((n[0]+n[1])/2,t),new W(i,t)],l=new jt(s,null,0,a,z.UPC_EAN_EXTENSION,new Date().getTime());return o!=null&&l.putAllMetadata(o),l}decodeMiddle(t,e,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=t.getSize(),s=e[1],o=0;for(let a=0;a<2&&s<i;a++){let l=Ot.decodeDigit(t,r,s,Ot.L_AND_G_PATTERNS);n+=String.fromCharCode(48+l%10);for(let c of r)s+=c;l>=10&&(o|=1<<1-a),a!==1&&(s=t.getNextSet(s),s=t.getNextUnset(s))}if(n.length!==2)throw new b;if(parseInt(n.toString())%4!==o)throw new b;return s}static parseExtensionString(t){return t.length!==2?null:new Map([[Ut.ISSUE_NUMBER,parseInt(t)]])}}class cr{static decodeRow(t,e,n){let r=Ot.findGuardPattern(e,n,!1,this.EXTENSION_START_PATTERN,new Int32Array(this.EXTENSION_START_PATTERN.length).fill(0));try{return new sn().decodeRow(t,e,r)}catch{return new kn().decodeRow(t,e,r)}}}
12cr.EXTENSION_START_PATTERN=Int32Array.from([1,1,2]);class ct extends Ot{constructor(){super(),this.decodeRowStringBuffer="",ct.L_AND_G_PATTERNS=ct.L_PATTERNS.map(t=>Int32Array.from(t));for(let t=10;t<20;t++){let e=ct.L_PATTERNS[t-10],n=new Int32Array(e.length);for(let r=0;r<e.length;r++)n[r]=e[e.length-r-1];ct.L_AND_G_PATTERNS[t]=n}}decodeRow(t,e,n){let r=ct.findStartGuardPattern(e),i=n==null?null:n.get(gt.NEED_RESULT_POINT_CALLBACK);if(i!=null){const v=new W((r[0]+r[1])/2,t);i.foundPossibleResultPoint(v)}let s=this.decodeMiddle(e,r,this.decodeRowStringBuffer),o=s.rowOffset,a=s.resultString;if(i!=null){const v=new W(o,t);i.foundPossibleResultPoint(v)}let l=this.decodeEnd(e,o);if(i!=null){const v=new W((l[0]+l[1])/2,t);i.foundPossibleResultPoint(v)}let c=l[1],f=c+(c-l[0]);if(f>=e.getSize()||!e.isRange(c,f,!1))throw new b;let d=a.toString();if(d.length<8)throw new x;if(!ct.checkChecksum(d))throw new et;let C=(r[1]+r[0])/2,p=(l[1]+l[0])/2,T=this.getBarcodeFormat(),S=[new W(C,t),new W(p,t)],O=new jt(d,null,0,S,T,new Date().getTime()),B=0;try{let v=cr.decodeRow(t,e,l[1]);O.putMetadata(Ut.UPC_EAN_EXTENSION,v.getText()),O.putAllMetadata(v.getResultMetadata()),O.addResultPoints(v.getResultPoints()),B=v.getText().length}catch{}let k=n==null?null:n.get(gt.ALLOWED_EAN_EXTENSIONS);if(k!=null){let v=!1;for(let nt in k)if(B.toString()===nt){v=!0;break}if(!v)throw new b}return O}decodeEnd(t,e){return ct.findGuardPattern(t,e,!1,ct.START_END_PATTERN,new Int32Array(ct.START_END_PATTERN.length).fill(0))}static checkChecksum(t){return ct.checkStandardUPCEANChecksum(t)}static checkStandardUPCEANChecksum(t){let e=t.length;if(e===0)return!1;let n=parseInt(t.charAt(e-1),10);return ct.getStandardUPCEANChecksum(t.substring(0,e-1))===n}static getStandardUPCEANChecksum(t){let e=t.length,n=0;for(let r=e-1;r>=0;r-=2){let i=t.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new x;n+=i}n*=3;for(let r=e-2;r>=0;r-=2){let i=t.charAt(r).charCodeAt(0)-48;if(i<0||i>9)throw new x;n+=i}return(1e3-n)%10}}class ke extends ct{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(t,e,n){let r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=t.getSize(),s=e[1],o=0;for(let l=0;l<6&&s<i;l++){let c=ct.decodeDigit(t,r,s,ct.L_AND_G_PATTERNS);n+=String.fromCharCode(48+c%10);for(let f of r)s+=f;c>=10&&(o|=1<<5-l)}
12n=ke.determineFirstDigit(n,o),s=ct.findGuardPattern(t,s,!0,ct.MIDDLE_PATTERN,new Int32Array(ct.MIDDLE_PATTERN.length).fill(0))[1];for(let l=0;l<6&&s<i;l++){let c=ct.decodeDigit(t,r,s,ct.L_PATTERNS);n+=String.fromCharCode(48+c);for(let f of r)s+=f}return{rowOffset:s,resultString:n}}getBarcodeFormat(){return z.EAN_13}static determineFirstDigit(t,e){for(let n=0;n<10;n++)if(e===this.FIRST_DIGIT_ENCODINGS[n])return t=String.fromCharCode(48+n)+t,t;throw new b}}ke.FIRST_DIGIT_ENCODINGS=[0,11,13,14,19,25,28,21,22,26];class hr extends ct{constructor(){super(),this.decodeMiddleCounters=Int32Array.from([0,0,0,0])}decodeMiddle(t,e,n){const r=this.decodeMiddleCounters;r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=t.getSize(),s=e[1];for(let a=0;a<4&&s<i;a++){let l=ct.decodeDigit(t,r,s,ct.L_PATTERNS);n+=String.fromCharCode(48+l);for(let c of r)s+=c}s=ct.findGuardPattern(t,s,!0,ct.MIDDLE_PATTERN,new Int32Array(ct.MIDDLE_PATTERN.length).fill(0))[1];for(let a=0;a<4&&s<i;a++){let l=ct.decodeDigit(t,r,s,ct.L_PATTERNS);n+=String.fromCharCode(48+l);for(let c of r)s+=c}return{rowOffset:s,resultString:n}}getBarcodeFormat(){return z.EAN_8}}class ur extends ct{constructor(){super(...arguments),this.ean13Reader=new ke}getBarcodeFormat(){return z.UPC_A}decode(t,e){return this.maybeReturnResult(this.ean13Reader.decode(t))}decodeRow(t,e,n){return this.maybeReturnResult(this.ean13Reader.decodeRow(t,e,n))}decodeMiddle(t,e,n){return this.ean13Reader.decodeMiddle(t,e,n)}maybeReturnResult(t){let e=t.getText();if(e.charAt(0)==="0"){let n=new jt(e.substring(1),null,null,t.getResultPoints(),z.UPC_A);return t.getResultMetadata()!=null&&n.putAllMetadata(t.getResultMetadata()),n}else throw new b}reset(){this.ean13Reader.reset()}}class fe extends ct{constructor(){super(),this.decodeMiddleCounters=new Int32Array(4)}decodeMiddle(t,e,n){const r=this.decodeMiddleCounters.map(l=>l);r[0]=0,r[1]=0,r[2]=0,r[3]=0;const i=t.getSize();let s=e[1],o=0;for(let l=0;l<6&&s<i;l++){const c=fe.decodeDigit(t,r,s,fe.L_AND_G_PATTERNS);n+=String.fromCharCode(48+c%10);for(let f of r)s+=f;c>=10&&(o|=1<<5-l)}let a=fe.determineNumSysAndCheckDigit(n,o);return{rowOffset:s,resultString:a}}decodeEnd(t,e){return fe.findGuardPatternWithoutCounters(t,e,!0,fe.MIDDLE_END_PATTERN)}checkChecksum(t){return ct.checkChecksum(fe.convertUPCEtoUPCA(t))}static determineNumSysAndCheckDigit(t,e){for(let n=0;n<=1;n++)for(let r=0;r<10;r++)if(e===this.NUMSYS_AND_CHECK_DIGIT_PATTERNS[n][r]){let i=String.fromCharCode(48+n),s=String.fromCharCode(48+r);return i+t+s}throw b.getNotFoundInstance()}getBarcodeFormat(){return z.UPC_E}static convertUPCEtoUPCA(t){const e=t.slice(1,7).split("").map(i=>i.charCodeAt(0)),n=new wt;n.append(t.charAt(0));let r=e[5];switch(r){case 0:case 1:case 2:n.appendChars(e,0,2),n.append(r),n.append("0000"),n.appendChars(e,2,3);break;case 3:n.appendChars(e,0,3),n.append("00000"),n.appendChars(e,3,2);break;case 4:n.appendChars(e,0,4),n.append("00000"),n.append(e[4]);break;default:n.appendChars(e,0,5),n.append("0000"),n.append(r);break}return t.length>=8&&n.append(t.charAt(7)),n.toString()}}fe.MIDDLE_END_PATTERN=Int32Array.from([1,1,1,1,1,1]),fe.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,26])];class Fn extends vt{constructor(t){super();let e=t==null?null:t.get(gt.POSSIBLE_FORMATS),n=[];I(e)?(n.push(new ke),n.push(new ur),n.push(new hr),n.push(new fe)):(e.indexOf(z.EAN_13)>-1&&n.push(new ke),e.indexOf(z.UPC_A)>-1&&n.push(new ur),e.indexOf(z.EAN_8)>-1&&n.push(new hr),e.indexOf(z.UPC_E)>-1&&n.push(new fe)),this.readers=n}decodeRow(t,e,n){for(let r of this.readers)try{const i=r.decodeRow(t,e,n),s=i.getBarcodeFormat()===z.EAN_13&&i.getText().charAt(0)==="0",o=n==null?null:n.get(gt.POSSIBLE_FORMATS),a=o==null||o.includes(z.UPC_A);if(s&&a){const l=i.getRawBytes(),c=new jt(i.getText().substring(1),l,l?l.length:null,i.getResultPoints(),z.UPC_A);return c.putAllMetadata(i.getResultMetadata()),c}return i}catch{}throw new b}reset(){for(let t of this.readers)t.reset()}}class Yt extends vt{constructor(){super(),this.decodeFinderCounters=new Int32Array(4),this.dataCharacterCounters=new Int32Array(8),this.oddRoundingErrors=new Array(4),this.evenRoundingErrors=new Array(4),this.oddCounts=new Array(this.dataCharacterCounters.length/2),this.evenCounts=new Array(this.dataCharacterCounters.length/2)}getDecodeFinderCounters(){return this.decodeFinderCounters}getDataCharacterCounters(){return this.dataCharacterCounters}getOddRoundingErrors(){return this.oddRoundingErrors}getEvenRoundingErrors(){return this.evenRoundingErrors}getOddCounts(){return this.oddCounts}getEvenCounts(){return this.evenCounts}parseFinderValue(t,e){for(let n=0;n<e.length;
12n++)if(vt.patternMatchVariance(t,e[n],Yt.MAX_INDIVIDUAL_VARIANCE)<Yt.MAX_AVG_VARIANCE)return n;throw new b}static count(t){return st.sum(new Int32Array(t))}static increment(t,e){let n=0,r=e[0];for(let i=1;i<t.length;i++)e[i]>r&&(r=e[i],n=i);t[n]++}static decrement(t,e){let n=0,r=e[0];for(let i=1;i<t.length;i++)e[i]<r&&(r=e[i],n=i);t[n]--}static isFinderPattern(t){let e=t[0]+t[1],n=e+t[2]+t[3],r=e/n;if(r>=Yt.MIN_FINDER_PATTERN_RATIO&&r<=Yt.MAX_FINDER_PATTERN_RATIO){let i=Number.MAX_SAFE_INTEGER,s=Number.MIN_SAFE_INTEGER;for(let o of t)o>s&&(s=o),o<i&&(i=o);return s<10*i}return!1}}Yt.MAX_AVG_VARIANCE=.2,Yt.MAX_INDIVIDUAL_VARIANCE=.45,Yt.MIN_FINDER_PATTERN_RATIO=9.5/12,Yt.MAX_FINDER_PATTERN_RATIO=12.5/14;class Xe{constructor(t,e){this.value=t,this.checksumPortion=e}getValue(){return this.value}getChecksumPortion(){return this.checksumPortion}toString(){return this.value+"("+this.checksumPortion+")"}equals(t){if(!(t instanceof Xe))return!1;const e=t;return this.value===e.value&&this.checksumPortion===e.checksumPortion}hashCode(){return this.value^this.checksumPortion}}class Cn{constructor(t,e,n,r,i){this.value=t,this.startEnd=e,this.value=t,this.startEnd=e,this.resultPoints=new Array,this.resultPoints.push(new W(n,i)),this.resultPoints.push(new W(r,i))}getValue(){return this.value}getStartEnd(){return this.startEnd}getResultPoints(){return this.resultPoints}equals(t){if(!(t instanceof Cn))return!1;const e=t;return this.value===e.value}hashCode(){return this.value}}class Ae{constructor(){}static getRSSvalue(t,e,n){let r=0;for(let a of t)r+=a;let i=0,s=0,o=t.length;for(let a=0;a<o-1;a++){let l;for(l=1,s|=1<<a;l<t[a];l++,s&=~(1<<a)){let c=Ae.combins(r-l-1,o-a-2);if(n&&s===0&&r-l-(o-a-1)>=o-a-1&&(c-=Ae.combins(r-l-(o-a),o-a-2)),o-a-1>1){let f=0;for(let d=r-l-(o-a-2);d>e;d--)f+=Ae.combins(r-l-d-1,o-a-3);c-=f*(o-1-a)}else r-l>e&&c--;i+=c}r-=l}return i}static combins(t,e){let n,r;t-e>e?(r=e,n=t-e):(r=t-e,n=e);let i=1,s=1;for(let o=t;o>n;o--)i*=o,s<=r&&(i/=s,s++);for(;s<=r;)i/=s,s++;return i}}class Vr{static buildBitArray(t){let e=t.length*2-1;t[t.length-1].getRightChar()==null&&(e-=1);let n=12*e,r=new at(n),i=0,o=t[0].getRightChar().getValue();for(let a=11;a>=0;--a)o&1<<a&&r.set(i),i++;for(let a=1;a<t.length;++a){let l=t[a],c=l.getLeftChar().getValue();for(let f=11;f>=0;--f)c&1<<f&&r.set(i),i++;if(l.getRightChar()!=null){let f=l.getRightChar().getValue();for(let d=11;d>=0;--d)f&1<<d&&r.set(i),i++}}return r}}class Fe{constructor(t,e){e?this.decodedInformation=null:(this.finished=t,this.decodedInformation=e)}getDecodedInformation(){return this.decodedInformation}isFinished(){return this.finished}}class Un{constructor(t){this.newPosition=t}getNewPosition(){return this.newPosition}}class te extends Un{constructor(t,e){super(t),this.value=e}getValue(){return this.value}isFNC1(){return this.value===te.FNC1}}te.FNC1="$";class Ue extends Un{constructor(t,e,n){super(t),n?(this.remaining=!0,this.remainingValue=this.remainingValue):(this.remaining=!1,this.remainingValue=0),this.newString=e}getNewString(){return this.newString}isRemaining(){return this.remaining}getRemainingValue(){return this.remainingValue}}class ae extends Un{constructor(t,e,n){if(super(t),e<0||e>10||n<0||n>10)throw new x;this.firstDigit=e,this.secondDigit=n}getFirstDigit(){return this.firstDigit}getSecondDigit(){return this.secondDigit}getValue(){return this.firstDigit*10+this.secondDigit}isFirstDigitFNC1(){return this.firstDigit===ae.FNC1}isSecondDigitFNC1(){return this.secondDigit===ae.FNC1}isAnyFNC1(){return this.firstDigit===ae.FNC1||this.secondDigit===ae.FNC1}}ae.FNC1=10;class H{constructor(){}static parseFieldsInGeneralPurpose(t){if(!t)return null;if(t.length<2)throw new b;let e=t.substring(0,2);for(let i of H.TWO_DIGIT_DATA_LENGTH)if(i[0]===e)return i[1]===H.VARIABLE_LENGTH?H.processVariableAI(2,i[2],t):H.processFixedAI(2,i[1],t);
12if(t.length<3)throw new b;let n=t.substring(0,3);for(let i of H.THREE_DIGIT_DATA_LENGTH)if(i[0]===n)return i[1]===H.VARIABLE_LENGTH?H.processVariableAI(3,i[2],t):H.processFixedAI(3,i[1],t);for(let i of H.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH)if(i[0]===n)return i[1]===H.VARIABLE_LENGTH?H.processVariableAI(4,i[2],t):H.processFixedAI(4,i[1],t);if(t.length<4)throw new b;let r=t.substring(0,4);for(let i of H.FOUR_DIGIT_DATA_LENGTH)if(i[0]===r)return i[1]===H.VARIABLE_LENGTH?H.processVariableAI(4,i[2],t):H.processFixedAI(4,i[1],t);throw new b}static processFixedAI(t,e,n){if(n.length<t)throw new b;let r=n.substring(0,t);if(n.length<t+e)throw new b;let i=n.substring(t,t+e),s=n.substring(t+e),o="("+r+")"+i,a=H.parseFieldsInGeneralPurpose(s);return a==null?o:o+a}static processVariableAI(t,e,n){let r=n.substring(0,t),i;n.length<t+e?i=n.length:i=t+e;let s=n.substring(t,i),o=n.substring(i),a="("+r+")"+s,l=H.parseFieldsInGeneralPurpose(o);return l==null?a:a+l}}H.VARIABLE_LENGTH=[],H.TWO_DIGIT_DATA_LENGTH=[["00",18],["01",14],["02",14],["10",H.VARIABLE_LENGTH,20],["11",6],["12",6],["13",6],["15",6],["17",6],["20",2],["21",H.VARIABLE_LENGTH,20],["22",H.VARIABLE_LENGTH,29],["30",H.VARIABLE_LENGTH,8],["37",H.VARIABLE_LENGTH,8],["90",H.VARIABLE_LENGTH,30],["91",H.VARIABLE_LENGTH,30],["92",H.VARIABLE_LENGTH,30],["93",H.VARIABLE_LENGTH,30],["94",H.VARIABLE_LENGTH,30],["95",H.VARIABLE_LENGTH,30],["96",H.VARIABLE_LENGTH,30],["97",H.VARIABLE_LENGTH,3],["98",H.VARIABLE_LENGTH,30],["99",H.VARIABLE_LENGTH,30]],H.THREE_DIGIT_DATA_LENGTH=[["240",H.VARIABLE_LENGTH,30],["241",H.VARIABLE_LENGTH,30],["242",H.VARIABLE_LENGTH,6],["250",H.VARIABLE_LENGTH,30],["251",H.VARIABLE_LENGTH,30],["253",H.VARIABLE_LENGTH,17],["254",H.VARIABLE_LENGTH,20],["400",H.VARIABLE_LENGTH,30],["401",H.VARIABLE_LENGTH,30],["402",17],["403",H.VARIABLE_LENGTH,30],["410",13],["411",13],["412",13],["413",13],["414",13],["420",H.VARIABLE_LENGTH,20],["421",H.VARIABLE_LENGTH,15],["422",3],["423",H.VARIABLE_LENGTH,15],["424",3],["425",3],["426",3]],H.THREE_DIGIT_PLUS_DIGIT_DATA_LENGTH=[["310",6],["311",6],["312",6],["313",6],["314",6],["315",6],["316",6],["320",6],["321",6],["322",6],["323",6],["324",6],["325",6],["326",6],["327",6],["328",6],["329",6],["330",6],["331",6],["332",6],["333",6],["334",6],["335",6],["336",6],["340",6],["341",6],["342",6],["343",6],["344",6],["345",6],["346",6],["347",6],["348",6],["349",6],["350",6],["351",6],["352",6],["353",6],["354",6],["355",6],["356",6],["357",6],["360",6],["361",6],["362",6],["363",6],["364",6],["365",6],["366",6],["367",6],["368",6],["369",6],["390",H.VARIABLE_LENGTH,15],["391",H.VARIABLE_LENGTH,18],["392",H.VARIABLE_LENGTH,15],["393",H.VARIABLE_LENGTH,18],["703",H.VARIABLE_LENGTH,30]],H.FOUR_DIGIT_DATA_LENGTH=[["7001",13],["7002",H.VARIABLE_LENGTH,30],["7003",10],["8001",14],["8002",H.VARIABLE_LENGTH,20],["8003",H.VARIABLE_LENGTH,30],["8004",H.VARIABLE_LENGTH,30],["8005",6],["8006",18],["8007",H.VARIABLE_LENGTH,30],["8008",H.VARIABLE_LENGTH,12],["8018",18],["8020",H.VARIABLE_LENGTH,25],["8100",6],["8101",10],["8102",2],["8110",H.VARIABLE_LENGTH,70],["8200",H.VARIABLE_LENGTH,70]];class Ye{constructor(t){this.buffer=new wt,this.information=t}decodeAllCodes(t,e){let n=e,r=null;do{let i=this.decodeGeneralPurposeField(n,r),s=H.parseFieldsInGeneralPurpose(i.getNewString());if(s!=null&&t.append(s),i.isRemaining()?r=""+i.getRemainingValue():r=null,n===i.getNewPosition())break;n=i.getNewPosition()}while(!0);return t.toString()}isStillNumeric(t){if(t+7>this.information.getSize())return t+4<=this.information.getSize();for(let e=t;e<t+3;++e)if(this.information.get(e))return!0;return this.information.get(t+3)}decodeNumeric(t){if(t+7>this.information.getSize()){let i=this.extractNumericValueFromBitArray(t,4);return i===0?new ae(this.information.getSize(),ae.FNC1,ae.FNC1):new ae(this.information.getSize(),i-1,ae.FNC1)}let e=this.extractNumericValueFromBitArray(t,7),n=(e-8)/11,r=(e-8)%11;return new ae(t+7,n,r)}extractNumericValueFromBitArray(t,e){return Ye.extractNumericValueFromBitArray(this.information,t,e)}static extractNumericValueFromBitArray(t,e,n){let r=0;for(let i=0;i<n;++i)t.get(e+i)&&(r|=1<<n-i-1);return r}decodeGeneralPurposeField(t,e){this.buffer.setLengthToZero(),e!=null&&this.buffer.append(e),this.current.setPosition(t);let n=this.parseBlocks();return n!=null&&n.isRemaining()?new Ue(this.current.getPosition(),this.buffer.toString(),n.getRemainingValue()):new Ue(this.current.getPosition(),this.buffer.toString())}parseBlocks(){let t,e;do{let n=this.current.getPosition();if(this.current.isAlpha()?(e=this.parseAlphaBlock(),t=e.isFinished()):this.current.isIsoIec646()?(e=this.parseIsoIec646Block(),t=e.isFinished()):(e=this.parseNumericBlock(),t=e.isFinished()),!(n!==this.current.getPosition())&&!t)break}while(!t);return e.getDecodedInformation()}parseNumericBlock(){for(;this.isStillNumeric(this.current.getPosition());){let t=this.decodeNumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFirstDigitFNC1()){let e;return t.isSecondDigitFNC1()?e=new Ue(this.current.getPosition(),this.buffer.toString()):e=new Ue(this.current.getPosition(),this.buffer.toString(),t.getSecondDigit()),new Fe(!0,e)}if(this.buffer.append(t.getFirstDigit()),t.isSecondDigitFNC1()){let e=new Ue(this.current.getPosition(),this.buffer.toString());return new Fe(!0,e)}this.buffer.append(t.getSecondDigit())}return this.isNumericToAlphaNumericLatch(this.current.getPosition())&&(this.current.setAlpha(),this.current.incrementPosition(4)),new Fe(!1)}parseIsoIec646Block(){for(;this.isStillIsoIec646(this.current.getPosition());){let t=this.decodeIsoIec646(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){let e=new Ue(this.current.getPosition(),this.buffer.toString());return new Fe(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setAlpha()),new Fe(!1)}parseAlphaBlock(){for(;this.isStillAlpha(this.current.getPosition());){let t=this.decodeAlphanumeric(this.current.getPosition());if(this.current.setPosition(t.getNewPosition()),t.isFNC1()){let e=new Ue(this.current.getPosition(),this.buffer.toString());return new Fe(!0,e)}this.buffer.append(t.getValue())}return this.isAlphaOr646ToNumericLatch(this.current.getPosition())?(this.current.incrementPosition(3),this.current.setNumeric()):this.isAlphaTo646ToAlphaLatch(this.current.getPosition())&&(this.current.getPosition()+5<this.information.getSize()?this.current.incrementPosition(5):this.current.setPosition(this.information.getSize()),this.current.setIsoIec646()),new Fe(!1)}isStillIsoIec646(t){if(t+5>this.information.getSize())return!1;let e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;
12if(t+7>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<116)return!0;if(t+8>this.information.getSize())return!1;let r=this.extractNumericValueFromBitArray(t,8);return r>=232&&r<253}decodeIsoIec646(t){let e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new te(t+5,te.FNC1);if(e>=5&&e<15)return new te(t+5,"0"+(e-5));let n=this.extractNumericValueFromBitArray(t,7);if(n>=64&&n<90)return new te(t+7,""+(n+1));if(n>=90&&n<116)return new te(t+7,""+(n+7));let r=this.extractNumericValueFromBitArray(t,8),i;switch(r){case 232:i="!";break;case 233:i='"';break;case 234:i="%";break;case 235:i="&";break;case 236:i="'";break;case 237:i="(";break;case 238:i=")";break;case 239:i="*";break;case 240:i="+";break;case 241:i=",";break;case 242:i="-";break;case 243:i=".";break;case 244:i="/";break;case 245:i=":";break;case 246:i=";";break;case 247:i="<";break;case 248:i="=";break;case 249:i=">";break;case 250:i="?";break;case 251:i="_";break;case 252:i=" ";break;default:throw new x}return new te(t+8,i)}isStillAlpha(t){if(t+5>this.information.getSize())return!1;let e=this.extractNumericValueFromBitArray(t,5);if(e>=5&&e<16)return!0;if(t+6>this.information.getSize())return!1;let n=this.extractNumericValueFromBitArray(t,6);return n>=16&&n<63}decodeAlphanumeric(t){let e=this.extractNumericValueFromBitArray(t,5);if(e===15)return new te(t+5,te.FNC1);if(e>=5&&e<15)return new te(t+5,"0"+(e-5));let n=this.extractNumericValueFromBitArray(t,6);if(n>=32&&n<58)return new te(t+6,""+(n+33));let r;switch(n){case 58:r="*";break;case 59:r=",";break;case 60:r="-";break;case 61:r=".";break;case 62:r="/";break;default:throw new we("Decoding invalid alphanumeric value: "+n)}return new te(t+6,r)}isAlphaTo646ToAlphaLatch(t){if(t+1>this.information.getSize())return!1;for(let e=0;e<5&&e+t<this.information.getSize();++e)if(e===2){if(!this.information.get(t+2))return!1}else if(this.information.get(t+e))return!1;return!0}isAlphaOr646ToNumericLatch(t){if(t+3>this.information.getSize())return!1;for(let e=t;e<t+3;++e)if(this.information.get(e))return!1;return!0}isNumericToAlphaNumericLatch(t){if(t+1>this.information.getSize())return!1;for(let e=0;e<4&&e+t<this.information.getSize();++e)if(this.information.get(t+e))return!1;return!0}}class xn{constructor(t){this.information=t,this.generalDecoder=new Ye(t)}getInformation(){return this.information}getGeneralDecoder(){return this.generalDecoder}}class ee extends xn{constructor(t){super(t)}encodeCompressedGtin(t,e){t.append("(01)");let n=t.length();t.append("9"),this.encodeCompressedGtinWithoutAI(t,e,n)}encodeCompressedGtinWithoutAI(t,e,n){for(let r=0;r<4;++r){let i=this.getGeneralDecoder().extractNumericValueFromBitArray(e+10*r,10);i/100===0&&t.append("0"),i/10===0&&t.append("0"),t.append(i)}ee.appendCheckDigit(t,n)}static appendCheckDigit(t,e){let n=0;for(let r=0;r<13;r++){let i=t.charAt(r+e).charCodeAt(0)-48;n+=r&1?i:3*i}n=10-n%10,n===10&&(n=0),t.append(n)}}ee.GTIN_SIZE=40;class ze extends ee{constructor(t){super(t)}parseInformation(){let t=new wt;t.append("(01)");let e=t.length(),n=this.getGeneralDecoder().extractNumericValueFromBitArray(ze.HEADER_SIZE,4);return t.append(n),this.encodeCompressedGtinWithoutAI(t,ze.HEADER_SIZE+4,e),this.getGeneralDecoder().decodeAllCodes(t,ze.HEADER_SIZE+44)}}ze.HEADER_SIZE=4;class mn extends xn{constructor(t){super(t)}parseInformation(){let t=new wt;return this.getGeneralDecoder().decodeAllCodes(t,mn.HEADER_SIZE)}}mn.HEADER_SIZE=5;class In extends ee{constructor(t){super(t)}encodeCompressedWeight(t,e,n){let r=this.getGeneralDecoder().extractNumericValueFromBitArray(e,n);this.addWeightCode(t,r);let i=this.checkWeight(r),s=1e5;for(let o=0;o<5;++o)i/s===0&&t.append("0"),s/=10;t.append(i)}}class Ee extends In{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()!=Ee.HEADER_SIZE+In.GTIN_SIZE+Ee.WEIGHT_SIZE)throw new b;let t=new wt;return this.encodeCompressedGtin(t,Ee.HEADER_SIZE),this.encodeCompressedWeight(t,Ee.HEADER_SIZE+In.GTIN_SIZE,Ee.WEIGHT_SIZE),t.toString()}}Ee.HEADER_SIZE=5,Ee.WEIGHT_SIZE=15;class Gr extends Ee{constructor(t){super(t)}addWeightCode(t,e){t.append("(3103)")}checkWeight(t){return t}}
12class Hr extends Ee{constructor(t){super(t)}addWeightCode(t,e){e<1e4?t.append("(3202)"):t.append("(3203)")}checkWeight(t){return t<1e4?t:t-1e4}}class Ce extends ee{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()<Ce.HEADER_SIZE+ee.GTIN_SIZE)throw new b;let t=new wt;this.encodeCompressedGtin(t,Ce.HEADER_SIZE);let e=this.getGeneralDecoder().extractNumericValueFromBitArray(Ce.HEADER_SIZE+ee.GTIN_SIZE,Ce.LAST_DIGIT_SIZE);t.append("(392"),t.append(e),t.append(")");let n=this.getGeneralDecoder().decodeGeneralPurposeField(Ce.HEADER_SIZE+ee.GTIN_SIZE+Ce.LAST_DIGIT_SIZE,null);return t.append(n.getNewString()),t.toString()}}Ce.HEADER_SIZE=8,Ce.LAST_DIGIT_SIZE=2;class Qt extends ee{constructor(t){super(t)}parseInformation(){if(this.getInformation().getSize()<Qt.HEADER_SIZE+ee.GTIN_SIZE)throw new b;let t=new wt;this.encodeCompressedGtin(t,Qt.HEADER_SIZE);let e=this.getGeneralDecoder().extractNumericValueFromBitArray(Qt.HEADER_SIZE+ee.GTIN_SIZE,Qt.LAST_DIGIT_SIZE);t.append("(393"),t.append(e),t.append(")");let n=this.getGeneralDecoder().extractNumericValueFromBitArray(Qt.HEADER_SIZE+ee.GTIN_SIZE+Qt.LAST_DIGIT_SIZE,Qt.FIRST_THREE_DIGITS_SIZE);n/100==0&&t.append("0"),n/10==0&&t.append("0"),t.append(n);let r=this.getGeneralDecoder().decodeGeneralPurposeField(Qt.HEADER_SIZE+ee.GTIN_SIZE+Qt.LAST_DIGIT_SIZE+Qt.FIRST_THREE_DIGITS_SIZE,null);return t.append(r.getNewString()),t.toString()}}Qt.HEADER_SIZE=8,Qt.LAST_DIGIT_SIZE=2,Qt.FIRST_THREE_DIGITS_SIZE=10;class Nt extends In{constructor(t,e,n){super(t),this.dateCode=n,this.firstAIdigits=e}parseInformation(){if(this.getInformation().getSize()!=Nt.HEADER_SIZE+Nt.GTIN_SIZE+Nt.WEIGHT_SIZE+Nt.DATE_SIZE)throw new b;let t=new wt;return this.encodeCompressedGtin(t,Nt.HEADER_SIZE),this.encodeCompressedWeight(t,Nt.HEADER_SIZE+Nt.GTIN_SIZE,Nt.WEIGHT_SIZE),this.encodeCompressedDate(t,Nt.HEADER_SIZE+Nt.GTIN_SIZE+Nt.WEIGHT_SIZE),t.toString()}encodeCompressedDate(t,e){let n=this.getGeneralDecoder().extractNumericValueFromBitArray(e,Nt.DATE_SIZE);if(n==38400)return;t.append("("),t.append(this.dateCode),t.append(")");let r=n%32;n/=32;let i=n%12+1;n/=12;let s=n;s/10==0&&t.append("0"),t.append(s),i/10==0&&t.append("0"),t.append(i),r/10==0&&t.append("0"),t.append(r)}addWeightCode(t,e){t.append("("),t.append(this.firstAIdigits),t.append(e/1e5),t.append(")")}checkWeight(t){return t%1e5}}Nt.HEADER_SIZE=8,Nt.WEIGHT_SIZE=20,Nt.DATE_SIZE=16;function fr(u){try{if(u.get(1))return new ze(u);if(!u.get(2))return new mn(u);switch(Ye.extractNumericValueFromBitArray(u,1,4)){case 4:return new Gr(u);case 5:return new Hr(u)}switch(Ye.extractNumericValueFromBitArray(u,1,5)){case 12:return new Ce(u);case 13:return new Qt(u)}switch(Ye.extractNumericValueFromBitArray(u,1,7)){case 56:return new Nt(u,"310","11");case 57:return new Nt(u,"320","11");case 58:return new Nt(u,"310","13");case 59:return new Nt(u,"320","13");case 60:return new Nt(u,"310","15");case 61:return new Nt(u,"320","15");case 62:return new Nt(u,"310","17");case 63:return new Nt(u,"320","17")}}catch(t){throw console.log(t),new we("unknown decoder: "+u)}}class be{constructor(t,e,n,r){this.leftchar=t,this.rightchar=e,this.finderpattern=n,this.maybeLast=r}mayBeLast(){return this.maybeLast}getLeftChar(){return this.leftchar}getRightChar(){return this.rightchar}getFinderPattern(){return this.finderpattern}mustBeLast(){return this.rightchar==null}toString(){return"[ "+this.leftchar+", "+this.rightchar+" : "+(this.finderpattern==null?"null":this.finderpattern.getValue())+" ]"}static equals(t,e){return t instanceof be?be.equalsOrNull(t.leftchar,e.leftchar)&&be.equalsOrNull(t.rightchar,e.rightchar)&&be.equalsOrNull(t.finderpattern,e.finderpattern):!1}static equalsOrNull(t,e){return t===null?e===null:be.equals(t,e)}hashCode(){return this.leftchar.getValue()^this.rightchar.getValue()^this.finderpattern.getValue()}}class Vn{constructor(t,e,n){this.pairs=t,this.rowNumber=e,this.wasReversed=n}getPairs(){return this.pairs}getRowNumber(){return this.rowNumber}isReversed(){return this.wasReversed}isEquivalent(t){return this.checkEqualitity(this,t)}toString(){return"{ "+this.pairs+" }"}equals(t,e){return t instanceof Vn?this.checkEqualitity(t,e)&&t.wasReversed===e.wasReversed:!1}checkEqualitity(t,e){if(!t||!e)return;let n;return t.forEach((r,i)=>{e.forEach(s=>{r.getLeftChar().getValue()===s.getLeftChar().getValue()&&r.getRightChar().getValue()===s.getRightChar().getValue()&&r.getFinderPatter().getValue()===s.getFinderPatter().getValue()&&(n=!0)})}),n}}class M extends Yt{constructor(t){super(...arguments),this.pairs=new Array(M.MAX_PAIRS),this.rows=new Array,this.startEnd=[2],this.verbose=t===!0}decodeRow(t,e,n){this.pairs.length=0,this.startFromEven=!1;try{return M.constructResult(this.decodeRow2pairs(t,e))}catch(r){this.verbose&&console.log(r)}return this.pairs.length=0,this.startFromEven=!0,M.constructResult(this.decodeRow2pairs(t,e))}reset(){this.pairs.length=0,this.rows.length=0}decodeRow2pairs(t,e){let n=!1;for(;!n;)try{this.pairs.push(this.retrieveNextPair(e,this.pairs,t))}catch(i){if(i instanceof b){if(!this.pairs.length)throw new b;n=!0}}if(this.checkChecksum())return this.pairs;let r;if(this.rows.length?r=!0:r=!1,this.storeRow(t,!1),r){let i=this.checkRowsBoolean(!1);if(i!=null||(i=this.checkRowsBoolean(!0),i!=null))return i}throw new b}checkRowsBoolean(t){if(this.rows.length>25)return this.rows.length=0,null;this.pairs.length=0,t&&(this.rows=this.rows.reverse());let e=null;try{e=this.checkRows(new Array,0)}catch(n){this.verbose&&console.log(n)}return t&&(this.rows=this.rows.reverse()),e}checkRows(t,e){for(let n=e;n<this.rows.length;n++){let r=this.rows[n];this.pairs.length=0;for(let s of t)this.pairs.push(s.getPairs());if(this.pairs.push(r.getPairs()),!M.isValidSequence(this.pairs))continue;if(this.checkChecksum())return this.pairs;let i=new Array(t);i.push(r);try{return this.checkRows(i,n+1)}catch(s){this.verbose&&console.log(s)}}throw new b}static isValidSequence(t){for(let e of M.FINDER_PATTERN_SEQUENCES){if(t.length>e.length)continue;let n=!0;for(let r=0;r<t.length;r++)if(t[r].getFinderPattern().getValue()!=e[r]){n=!1;break}if(n)return!0}return!1}storeRow(t,e){let n=0,r=!1,i=!1;for(;n<this.rows.length;){let s=this.rows[n];if(s.getRowNumber()>t){i=s.isEquivalent(this.pairs);break}r=s.isEquivalent(this.pairs),n++}i||r||M.isPartialRow(this.pairs,this.rows)||(this.rows.push(n,new Vn(this.pairs,t,e)),this.removePartialRows(this.pairs,this.rows))}removePartialRows(t,e){for(let n of e)if(n.getPairs().length!==t.length){for(let r of n.getPairs())for(let i of t)if(be.equals(r,i))break}}static isPartialRow(t,e){for(let n of e){let r=!0;for(let i of t){let s=!1;for(let o of n.getPairs())if(i.equals(o)){s=!0;break}if(!s){r=!1;break}}if(r)return!0}return!1}getRows(){return this.rows}static constructResult(t){let e=Vr.buildBitArray(t),r=fr(e).parseInformation(),i=t[0].getFinderPattern().getResultPoints(),s=t[t.length-1].getFinderPattern().getResultPoints(),o=[i[0],i[1],s[0],s[1]];return new jt(r,null,null,o,z.RSS_EXPANDED,null)}checkChecksum(){let t=this.pairs.get(0),e=t.getLeftChar(),n=t.getRightChar();if(n==null)return!1;let r=n.getChecksumPortion(),i=2;
12for(let o=1;o<this.pairs.size();++o){let a=this.pairs.get(o);r+=a.getLeftChar().getChecksumPortion(),i++;let l=a.getRightChar();l!=null&&(r+=l.getChecksumPortion(),i++)}return r%=211,211*(i-4)+r==e.getValue()}static getNextSecondBar(t,e){let n;return t.get(e)?(n=t.getNextUnset(e),n=t.getNextSet(n)):(n=t.getNextSet(e),n=t.getNextUnset(n)),n}retrieveNextPair(t,e,n){let r=e.length%2==0;this.startFromEven&&(r=!r);let i,s=!0,o=-1;do this.findNextPair(t,e,o),i=this.parseFoundFinderPattern(t,n,r),i==null?o=M.getNextSecondBar(t,this.startEnd[0]):s=!1;while(s);let a=this.decodeDataCharacter(t,i,r,!0);if(!this.isEmptyPair(e)&&e[e.length-1].mustBeLast())throw new b;let l;try{l=this.decodeDataCharacter(t,i,r,!1)}catch(c){l=null,this.verbose&&console.log(c)}return new be(a,l,i,!0)}isEmptyPair(t){return t.length===0}findNextPair(t,e,n){let r=this.getDecodeFinderCounters();r[0]=0,r[1]=0,r[2]=0,r[3]=0;let i=t.getSize(),s;n>=0?s=n:this.isEmptyPair(e)?s=0:s=e[e.length-1].getFinderPattern().getStartEnd()[1];let o=e.length%2!=0;this.startFromEven&&(o=!o);let a=!1;for(;s<i&&(a=!t.get(s),!!a);)s++;let l=0,c=s;for(let f=s;f<i;f++)if(t.get(f)!=a)r[l]++;else{if(l==3){if(o&&M.reverseCounters(r),M.isFinderPattern(r)){this.startEnd[0]=c,this.startEnd[1]=f;return}o&&M.reverseCounters(r),c+=r[0]+r[1],r[0]=r[2],r[1]=r[3],r[2]=0,r[3]=0,l--}else l++;r[l]=1,a=!a}throw new b}static reverseCounters(t){let e=t.length;for(let n=0;n<e/2;++n){let r=t[n];t[n]=t[e-n-1],t[e-n-1]=r}}parseFoundFinderPattern(t,e,n){let r,i,s;if(n){let l=this.startEnd[0]-1;for(;l>=0&&!t.get(l);)l--;l++,r=this.startEnd[0]-l,i=l,s=this.startEnd[1]}else i=this.startEnd[0],s=t.getNextUnset(this.startEnd[1]+1),r=s-this.startEnd[1];let o=this.getDecodeFinderCounters();rt.arraycopy(o,0,o,1,o.length-1),o[0]=r;let a;try{a=this.parseFinderValue(o,M.FINDER_PATTERNS)}catch{return null}return new Cn(a,[i,s],i,s,e)}decodeDataCharacter(t,e,n,r){let i=this.getDataCharacterCounters();for(let mt=0;mt<i.length;mt++)i[mt]=0;if(r)M.recordPatternInReverse(t,e.getStartEnd()[0],i);else{M.recordPattern(t,e.getStartEnd()[1],i);for(let mt=0,Xt=i.length-1;mt<Xt;mt++,Xt--){let se=i[mt];i[mt]=i[Xt],i[Xt]=se}}let s=17,o=st.sum(new Int32Array(i))/s,a=(e.getStartEnd()[1]-e.getStartEnd()[0])/15;if(Math.abs(o-a)/a>.3)throw new b;let l=this.getOddCounts(),c=this.getEvenCounts(),f=this.getOddRoundingErrors(),d=this.getEvenRoundingErrors();for(let mt=0;mt<i.length;mt++){let Xt=1*i[mt]/o,se=Xt+.5;if(se<1){if(Xt<.3)throw new b;se=1}else if(se>8){if(Xt>8.7)throw new b;se=8}let Qe=mt/2;mt&1?(c[Qe]=se,d[Qe]=Xt-se):(l[Qe]=se,f[Qe]=Xt-se)}this.adjustOddEvenCounts(s);let C=4*e.getValue()+(n?0:2)+(r?0:1)-1,p=0,T=0;for(let mt=l.length-1;mt>=0;mt--){if(M.isNotA1left(e,n,r)){let Xt=M.WEIGHTS[C][2*mt];T+=l[mt]*Xt}p+=l[mt]}let S=0;for(let mt=c.length-1;mt>=0;mt--)if(M.isNotA1left(e,n,r)){let Xt=M.WEIGHTS[C][2*mt+1];S+=c[mt]*Xt}let O=T+S;if(p&1||p>13||p<4)throw new b;let B=(13-p)/2,k=M.SYMBOL_WIDEST[B],v=9-k,nt=Ae.getRSSvalue(l,k,!0),Q=Ae.getRSSvalue(c,v,!1),re=M.EVEN_TOTAL_SUBSET[B],de=M.GSUM[B],ie=nt*re+Q+de;return new Xe(ie,O)}static isNotA1left(t,e,n){return!(t.getValue()==0&&e&&n)}adjustOddEvenCounts(t){let e=st.sum(new Int32Array(this.getOddCounts())),n=st.sum(new Int32Array(this.getEvenCounts())),r=!1,i=!1;e>13?i=!0:e<4&&(r=!0);let s=!1,o=!1;n>13?o=!0:n<4&&(s=!0);let a=e+n-t,l=(e&1)==1,c=(n&1)==0;if(a==1)if(l){if(c)throw new b;i=!0}else{if(!c)throw new b;o=!0}else if(a==-1)if(l){if(c)throw new b;r=!0}else{if(!c)throw new b;s=!0}else if(a==0){if(l){if(!c)throw new b;e<n?(r=!0,o=!0):(i=!0,s=!0)}else if(c)throw new b}else throw new b;if(r){if(i)throw new b;M.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(i&&M.decrement(this.getOddCounts(),this.getOddRoundingErrors()),s){if(o)throw new b;M.increment(this.getEvenCounts(),this.getOddRoundingErrors())}o&&M.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}M.SYMBOL_WIDEST=[7,5,4,3,1],M.EVEN_TOTAL_SUBSET=[4,20,52,104,204],M.GSUM=[0,348,1388,2948,3988],M.FINDER_PATTERNS=[Int32Array.from([1,8,4,1]),Int32Array.from([3,6,4,1]),Int32Array.from([3,4,6,1]),Int32Array.from([3,2,8,1]),Int32Array.from([2,6,5,1]),Int32Array.from([2,2,9,1])],M.WEIGHTS=[[1,3,9,27,81,32,96,77],[20,60,180,118,143,7,21,63],[189,145,13,39,117,140,209,205],[193,157,49,147,19,57,171,9
121],[62,186,136,197,169,85,44,132],[185,133,188,142,4,12,36,108],[113,128,173,97,80,29,87,50],[150,28,84,41,123,158,52,156],[46,138,203,187,139,206,196,166],[76,17,51,153,37,111,122,155],[43,129,176,106,107,110,119,146],[16,48,144,10,30,90,59,177],[109,116,137,200,178,112,125,164],[70,210,208,202,184,130,179,115],[134,191,151,31,93,68,204,190],[148,22,66,198,172,94,71,2],[6,18,54,162,64,192,154,40],[120,149,25,75,14,42,126,167],[79,26,78,23,69,207,199,175],[103,98,83,38,114,131,182,124],[161,61,183,127,170,88,53,159],[55,165,73,8,24,72,5,15],[45,135,194,160,58,174,100,89]],M.FINDER_PAT_A=0,M.FINDER_PAT_B=1,M.FINDER_PAT_C=2,M.FINDER_PAT_D=3,M.FINDER_PAT_E=4,M.FINDER_PAT_F=5,M.FINDER_PATTERN_SEQUENCES=[[M.FINDER_PAT_A,M.FINDER_PAT_A],[M.FINDER_PAT_A,M.FINDER_PAT_B,M.FINDER_PAT_B],[M.FINDER_PAT_A,M.FINDER_PAT_C,M.FINDER_PAT_B,M.FINDER_PAT_D],[M.FINDER_PAT_A,M.FINDER_PAT_E,M.FINDER_PAT_B,M.FINDER_PAT_D,M.FINDER_PAT_C],[M.FINDER_PAT_A,M.FINDER_PAT_E,M.FINDER_PAT_B,M.FINDER_PAT_D,M.FINDER_PAT_D,M.FINDER_PAT_F],[M.FINDER_PAT_A,M.FINDER_PAT_E,M.FINDER_PAT_B,M.FINDER_PAT_D,M.FINDER_PAT_E,M.FINDER_PAT_F,M.FINDER_PAT_F],[M.FINDER_PAT_A,M.FINDER_PAT_A,M.FINDER_PAT_B,M.FINDER_PAT_B,M.FINDER_PAT_C,M.FINDER_PAT_C,M.FINDER_PAT_D,M.FINDER_PAT_D],[M.FINDER_PAT_A,M.FINDER_PAT_A,M.FINDER_PAT_B,M.FINDER_PAT_B,M.FINDER_PAT_C,M.FINDER_PAT_C,M.FINDER_PAT_D,M.FINDER_PAT_E,M.FINDER_PAT_E],[M.FINDER_PAT_A,M.FINDER_PAT_A,M.FINDER_PAT_B,M.FINDER_PAT_B,M.FINDER_PAT_C,M.FINDER_PAT_C,M.FINDER_PAT_D,M.FINDER_PAT_E,M.FINDER_PAT_F,M.FINDER_PAT_F],[M.FINDER_PAT_A,M.FINDER_PAT_A,M.FINDER_PAT_B,M.FINDER_PAT_B,M.FINDER_PAT_C,M.FINDER_PAT_D,M.FINDER_PAT_D,M.FINDER_PAT_E,M.FINDER_PAT_E,M.FINDER_PAT_F,M.FINDER_PAT_F]],M.MAX_PAIRS=11;class Wr extends Xe{constructor(t,e,n){super(t,e),this.count=0,this.finderPattern=n}getFinderPattern(){return this.finderPattern}getCount(){return this.count}incrementCount(){this.count++}}class Rt extends Yt{constructor(){super(...arguments),this.possibleLeftPairs=[],this.possibleRightPairs=[]}decodeRow(t,e,n){const r=this.decodePair(e,!1,t,n);Rt.addOrTally(this.possibleLeftPairs,r),e.reverse();let i=this.decodePair(e,!0,t,n);Rt.addOrTally(this.possibleRightPairs,i),e.reverse();for(let s of this.possibleLeftPairs)if(s.getCount()>1){for(let o of this.possibleRightPairs)if(o.getCount()>1&&Rt.checkChecksum(s,o))return Rt.constructResult(s,o)}throw new b}static addOrTally(t,e){if(e==null)return;let n=!1;for(let r of t)if(r.getValue()===e.getValue()){r.incrementCount(),n=!0;break}n||t.push(e)}reset(){this.possibleLeftPairs.length=0,this.possibleRightPairs.length=0}static constructResult(t,e){let n=4537077*t.getValue()+e.getValue(),r=new String(n).toString(),i=new wt;for(let l=13-r.length;l>0;l--)i.append("0");i.append(r);let s=0;for(let l=0;l<13;l++){let c=i.charAt(l).charCodeAt(0)-48;s+=l&1?c:3*c}s=10-s%10,s===10&&(s=0),i.append(s.toString());let o=t.getFinderPattern().getResultPoints(),a=e.getFinderPattern().getResultPoints();return new jt(i.toString(),null,0,[o[0],o[1],a[0],a[1]],z.RSS_14,new Date().getTime())}static checkChecksum(t,e){let n=(t.getChecksumPortion()+16*e.getChecksumPortion())%79,r=9*t.getFinderPattern().getValue()+e.getFinderPattern().getValue();return r>72&&r--,r>8&&r--,n===r}decodePair(t,e,n,r){try{let i=this.findFinderPattern(t,e),s=this.parseFoundFinderPattern(t,n,e,i),o=r==null?null:r.get(gt.NEED_RESULT_POINT_CALLBACK);if(o!=null){let c=(i[0]+i[1])/2;e&&(c=t.getSize()-1-c),o.foundPossibleResultPoint(new W(c,n))}let a=this.decodeDataCharacter(t,s,!0),l=this.decodeDataCharacter(t,s,!1);return new Wr(1597*a.getValue()+l.getValue(),a.getChecksumPortion()+4*l.getChecksumPortion(),s)}catch{return null}}decodeDataCharacter(t,e,n){let r=this.getDataCharacterCounters();for(let S=0;S<r.length;S++)r[S]=0;if(n)vt.recordPatternInReverse(t,e.getStartEnd()[0],r);else{vt.recordPattern(t,e.getStartEnd()[1]+1,r);for(let S=0,O=r.length-1;S<O;S++,O--){let B=r[S];r[S]=r[O],r[O]=B}}let i=n?16:15,s=st.sum(new Int32Array(r))/i,o=this.getOddCounts(),a=this.getEvenCounts(),l=this.getOddRoundingErrors(),c=this.getEvenRoundingErrors();for(let S=0;S<r.length;S++){let O=r[S]/s,B=Math.floor(O+.5);B<1?B=1:B>8&&(B=8);let k=Math.floor(S/2);S&1?(a[k]=B,c[k]=O-B):(o[k]=B,l[k]=O-B)}this.adjustOddEvenCounts(n,i);let f=0,d=0;for(let S=o.length-1;S>=0;S--)d*=9,d+=o[S],f+=o[S];let C=0,p=0;for(let S=a.length-1;S>=0;S--)C*=9,C+=a[S],p+=a[S];let T=d+3*C;if(n){if(f&1||f>12||f<4)throw new b;let S=(12-f)/2,O=Rt.OUTSIDE_ODD_WIDEST[S],B=9-O,k=Ae.getRSSvalue(o,O,!1),v=Ae.getRSSvalue(
12a,B,!0),nt=Rt.OUTSIDE_EVEN_TOTAL_SUBSET[S],Q=Rt.OUTSIDE_GSUM[S];return new Xe(k*nt+v+Q,T)}else{if(p&1||p>10||p<4)throw new b;let S=(10-p)/2,O=Rt.INSIDE_ODD_WIDEST[S],B=9-O,k=Ae.getRSSvalue(o,O,!0),v=Ae.getRSSvalue(a,B,!1),nt=Rt.INSIDE_ODD_TOTAL_SUBSET[S],Q=Rt.INSIDE_GSUM[S];return new Xe(v*nt+k+Q,T)}}findFinderPattern(t,e){let n=this.getDecodeFinderCounters();n[0]=0,n[1]=0,n[2]=0,n[3]=0;let r=t.getSize(),i=!1,s=0;for(;s<r&&(i=!t.get(s),e!==i);)s++;let o=0,a=s;for(let l=s;l<r;l++)if(t.get(l)!==i)n[o]++;else{if(o===3){if(Yt.isFinderPattern(n))return[a,l];a+=n[0]+n[1],n[0]=n[2],n[1]=n[3],n[2]=0,n[3]=0,o--}else o++;n[o]=1,i=!i}throw new b}parseFoundFinderPattern(t,e,n,r){let i=t.get(r[0]),s=r[0]-1;for(;s>=0&&i!==t.get(s);)s--;s++;const o=r[0]-s,a=this.getDecodeFinderCounters(),l=new Int32Array(a.length);rt.arraycopy(a,0,l,1,a.length-1),l[0]=o;const c=this.parseFinderValue(l,Rt.FINDER_PATTERNS);let f=s,d=r[1];return n&&(f=t.getSize()-1-f,d=t.getSize()-1-d),new Cn(c,[s,r[1]],f,d,e)}adjustOddEvenCounts(t,e){let n=st.sum(new Int32Array(this.getOddCounts())),r=st.sum(new Int32Array(this.getEvenCounts())),i=!1,s=!1,o=!1,a=!1;t?(n>12?s=!0:n<4&&(i=!0),r>12?a=!0:r<4&&(o=!0)):(n>11?s=!0:n<5&&(i=!0),r>10?a=!0:r<4&&(o=!0));let l=n+r-e,c=(n&1)===(t?1:0),f=(r&1)===1;if(l===1)if(c){if(f)throw new b;s=!0}else{if(!f)throw new b;a=!0}else if(l===-1)if(c){if(f)throw new b;i=!0}else{if(!f)throw new b;o=!0}else if(l===0){if(c){if(!f)throw new b;n<r?(i=!0,a=!0):(s=!0,o=!0)}else if(f)throw new b}else throw new b;if(i){if(s)throw new b;Yt.increment(this.getOddCounts(),this.getOddRoundingErrors())}if(s&&Yt.decrement(this.getOddCounts(),this.getOddRoundingErrors()),o){if(a)throw new b;Yt.increment(this.getEvenCounts(),this.getOddRoundingErrors())}a&&Yt.decrement(this.getEvenCounts(),this.getEvenRoundingErrors())}}Rt.OUTSIDE_EVEN_TOTAL_SUBSET=[1,10,34,70,126],Rt.INSIDE_ODD_TOTAL_SUBSET=[4,20,48,81],Rt.OUTSIDE_GSUM=[0,161,961,2015,2715],Rt.INSIDE_GSUM=[0,336,1036,1516],Rt.OUTSIDE_ODD_WIDEST=[8,6,4,3,1],Rt.INSIDE_ODD_WIDEST=[2,4,6,8],Rt.FINDER_PATTERNS=[Int32Array.from([3,8,2,1]),Int32Array.from([3,5,5,1]),Int32Array.from([3,3,7,1]),Int32Array.from([3,1,9,1]),Int32Array.from([2,7,4,1]),Int32Array.from([2,5,6,1]),Int32Array.from([2,3,8,1]),Int32Array.from([1,5,7,1]),Int32Array.from([1,3,9,1])];class Ze extends vt{constructor(t,e){super(),this.readers=[],this.verbose=e===!0;const n=t?t.get(gt.POSSIBLE_FORMATS):null,r=t&&t.get(gt.ASSUME_CODE_39_CHECK_DIGIT)!==void 0;n?((n.includes(z.EAN_13)||n.includes(z.UPC_A)||n.includes(z.EAN_8)||n.includes(z.UPC_E))&&this.readers.push(new Fn(t)),n.includes(z.CODE_39)&&this.readers.push(new Bt(r)),n.includes(z.CODE_128)&&this.readers.push(new V),n.includes(z.ITF)&&this.readers.push(new Et),n.includes(z.RSS_14)&&this.readers.push(new Rt),n.includes(z.RSS_EXPANDED)&&this.readers.push(new M(this.verbose))):(this.readers.push(new Fn(t)),this.readers.push(new Bt),this.readers.push(new Fn(t)),this.readers.push(new V),this.readers.push(new Et),this.readers.push(new Rt),this.readers.push(new M(this.verbose)))}decodeRow(t,e,n){for(let r=0;r<this.readers.length;r++)try{return this.readers[r].decodeRow(t,e,n)}catch{}throw new b}reset(){this.readers.forEach(t=>t.reset())}}class Xr extends Le{constructor(t=500,e){super(new Ze(e),t,e)}}class ut{constructor(t,e,n){this.ecCodewords=t,this.ecBlocks=[e],n&&this.ecBlocks.push(n)}getECCodewords(){return this.ecCodewords}getECBlocks(){return this.ecBlocks}}class ht{constructor(t,e){this.count=t,this.dataCodewords=e}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class it{constructor(t,e,n,r,i,s){this.versionNumber=t,this.symbolSizeRows=e,this.symbolSizeColumns=n,this.dataRegionSizeRows=r,this.dataRegionSizeColumns=i,this.ecBlocks=s;let o=0;const a=s.getECCodewords(),l=s.getECBlocks();for(let c of l)o+=c.getCount()*(c.getDataCodewords()+a);this.totalCodewords=o}getVersionNumber(){return this.versionNumber}getSymbolSizeRows(){return this.symbolSizeRows}getSymbolSizeColumns(){return this.symbolSizeColumns}getDataRegionSizeRows(){return this.dataRegionSizeRows}getDataRegionSizeColumns(){return this.dataRegionSizeColumns}getTotalCodewords(){return this.totalCodewords}getECBlocks(){return this.ecBlocks}static getVersionForDimensions(t,e){if(t&1||e&1)throw new x;for(let n of it.VERSIONS)if(n.symbolSizeRows===t&&n.symbolSizeColumns===e)return n;throw new x}toString(){return""+this.versionNumber}static buildVersions(){return[new it(1,10,10,8,8,new ut(5,new ht(1,3))),new it(2,12,12,10,10,new ut(7,new ht(1,5))),new it(3,14,14,12,12,new ut(10,new ht(1,8))),new it(4,16,16,14,14,new ut(12,new ht(1,12))),new it(5,18,18,16,16,new ut(14,new ht(1,18))),new it(6,20,20,18,18,new ut(18,new ht(1,22))),new it(7,22,22,20,20,new ut(20,new ht(1,30))),new it(8,24,24,22,22,new ut(24,new ht(1,36))),new it(9,26,26,24,24,new ut(28,new ht(1,44))),new it(10,32,32,14,14,new ut(36,new ht(1,62))),new it(11,36,36,16,16,new ut(42,new ht(1,86))),new it(12,40,40,18,18,new ut(48,new ht(1,114))),new it(13,44,44,20,20,new ut(56,new ht(1,144))),new it(14,48,48,22,22,new ut(68,new ht(1,174))),new it(15,52,52,24,24,new ut(42,new ht(2,102))),new it(16,64,64,14,14,new ut(56,new ht(2,140))),new it(17,72,72,16,16,new ut(36,new ht(4,92))),new it(18,80,80,18,18,new ut(48,new ht(4,114))),new it(19,88,88,20,20,new ut(56,new ht(4,144))),new it(20,96,96,22,22,new ut(68,new ht(4,174))),new it(21,104,104,24,24,new ut(56,new ht(6,136))),new it(22,120,120,18,18,new ut(68,new ht(6,175))),new it(23,132,132,20,20,new ut(62,new ht(8,163))),new it(24,144,144,22,22,new ut(62,new ht(8,156),new ht(2,155))),new it(25,8,18,6,16,new ut(7,new ht(1,5))),new it(26,8,32,6,14,new ut(11,new ht(1,10))),new it(27,12,26,10,24,new ut(14,new ht(1,16))),new it(28,12,36,10,16,new ut(18,new ht(1,22))),new it(29,16,36,14,16,new ut(24,new ht(1,32))),new it(30,16,48,14,22,new ut(28,new ht(1,49)))]}}it.VERSIONS=it.buildVersions();class Gn{constructor(t){const e=t.getHeight();if(e<8||e>144||e&1)throw new x;this.version=Gn.readVersion(t),this.mappingBitMatrix=this.extractDataRegion(t),this.readMappingMatrix=new kt(this.mappingBitMatrix.getWidth(),this.mappingBitMatrix.getHeight())}getVersion(){return this.version}static readVersion(t){const e=t.getHeight(),n=t.getWidth();return it.getVersionForDimensions(e,n)}readCodewords(){const t=new Int8Array(this.version.getTotalCodewords());let e=0,n=4,r=0;const i=this.mappingBitMatrix.getHeight(),s=this.mappingBitMatrix.getWidth();let o=!1,a=!1,l=!1,c=!1;do if(n===i&&r===0&&!o)t[e++]=this.readCorner1(i,s)&255,n-=2,r+=2,o=!0;else if(n===i-2&&r===0&&s&3&&!a)t[e++]=this.readCorner2(i,s)&255,n-=2,r+=2,a=!0;else if(n===i+4&&r===2&&!(s&7)&&!l)t[e++]=this.readCorner3(i,s)&255,n-=2,r+=2,l=!0;else if(n===i-2&&r===0&&(s&7)===4&&!c)t[e++]=this.readCorner4(i,s)&255,n-=2,r+=2,c=!0;else{do n<i&&r>=0&&!this.readMappingMatrix.get(r,n)&&(t[e++]=this.readUtah(n,r,i,s)&255),n-=2,r+=2;while(n>=0&&r<s);n+=1,r+=3;do n>=0&&r<s&&!this.readMappingMatrix.get(r,n)&&(t[e++]=this.readUtah(n,r,i,s)&255),n+=2,r-=2;while(n<i&&r>=0);n+=3,r+=1}while(n<i||r<s);if(e!==this.version.getTotalCodewords())throw new x;return t}readModule(t,e,n,r){return t<0&&(t+=n,e+=4-(n+4&7)),e<0&&(e+=r,t+=4-(r+4&7)),this.readMappingMatrix.set(e,t),this.mappingBitMatrix.get(e,t)}readUtah(t,e,n,r){let i=0;return this.readModule(t-2,e-2,n,r)&&(i|=1),i<<=1,this.readModule(t-2,e-1,n,r)&&(i|=1),i<<=1,this.readModule(t-1,e-2,n,r)&&(i|=1),i<<=1,this.readModule(t-1,e-1,n,r)&&(i|=1),i<<=1,this.readModule(t-1,e,n,r)&&(i|=1),i<<=1,this.readModule(t,e-2,n,r)&&(i|=1),i<<=1,this.readModule(t,e-1,n,r)&&(i|=1),i<<=1,this.readModule(t,e,n,r)&&(i|=1),i}readCorner1(t,e){let n=0;return this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,1,t,e)&&(n|=1),n<<=1,this.readModule(t-1,2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(2,e-1,t,e)&&(n|=1),n<<=1,this.readModule(3,e-1,t,e)&&(n|=1),n}readCorner2(t,e){let n=0;return this.readModule(t-3,0,t,e)&&(n|=1),n<<=1,this.readModule(t-2,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(0,e-4,t,e)&&(n|=1),n<<=1,this.readModule(0,e-3,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n}readCorner3(t,e){let n=0;return this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(0,e-3,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-3,t,e)&&(n|=1),n<<=1,this.readModule(1,e-2,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n}readCorner4(t,e){let n=0;return this.readModule(t-3,0,t,e)&&(n|=1),n<<=1,this.readModule(t-2,0,t,e)&&(n|=1),n<<=1,this.readModule(t-1,0,t,e)&&(n|=1),n<<=1,this.readModule(0,e-2,t,e)&&(n|=1),n<<=1,this.readModule(0,e-1,t,e)&&(n|=1),n<<=1,this.readModule(1,e-1,t,e)&&(n|=1),n<<=1,this.readModule(2,e-1,t,e)&&(n|=1),n<<=1,this.readModule(3,e-1,t,e)&&(n|=1),n}extractDataRegion(t){const e=this.version.getSymbolSizeRows(),n=this.version.getSymbolSizeColumns();if(t.getHeight()!==e)throw new D("Dimension of bitMatrix must match the version size");const r=this.version.getDataRegionSizeRows(),i=this.version.getDataRegionSizeColumns(),s=e/r|0,o=n/i|0,a=s*r,l=o*i,c=new kt(l,a);for(let f=0;f<s;++f){const d=f*r;for(let C=0;C<o;++C){const p=C*i;for(let T=0;T<r;++T){const S=f*(r+2)+1+T,O=d+T;for(let B=0;B<i;++B){const k=C*(i+2)+1+B;if(t.get(k,S)){const v=p+B;c.set(v,O)}}}}}return c}}
12class Hn{constructor(t,e){this.numDataCodewords=t,this.codewords=e}static getDataBlocks(t,e){const n=e.getECBlocks();let r=0;const i=n.getECBlocks();for(let T of i)r+=T.getCount();const s=new Array(r);let o=0;for(let T of i)for(let S=0;S<T.getCount();S++){const O=T.getDataCodewords(),B=n.getECCodewords()+O;s[o++]=new Hn(O,new Uint8Array(B))}const l=s[0].codewords.length-n.getECCodewords(),c=l-1;let f=0;for(let T=0;T<c;T++)for(let S=0;S<o;S++)s[S].codewords[T]=t[f++];const d=e.getVersionNumber()===24,C=d?8:o;for(let T=0;T<C;T++)s[T].codewords[l-1]=t[f++];const p=s[0].codewords.length;for(let T=l;T<p;T++)for(let S=0;S<o;S++){const O=d?(S+8)%o:S,B=d&&O>7?T-1:T;s[O].codewords[B]=t[f++]}if(f!==t.length)throw new D;return s}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}class Wn{constructor(t){this.bytes=t,this.byteOffset=0,this.bitOffset=0}getBitOffset(){return this.bitOffset}getByteOffset(){return this.byteOffset}readBits(t){if(t<1||t>32||t>this.available())throw new D(""+t);let e=0,n=this.bitOffset,r=this.byteOffset;const i=this.bytes;if(n>0){const s=8-n,o=t<s?t:s,a=s-o,l=255>>8-o<<a;e=(i[r]&l)>>a,t-=o,n+=o,n===8&&(n=0,r++)}if(t>0){for(;t>=8;)e=e<<8|i[r]&255,r++,t-=8;if(t>0){const s=8-t,o=255>>s<<s;e=e<<t|(i[r]&o)>>s,n+=t}}return this.bitOffset=n,this.byteOffset=r,e}available(){return 8*(this.bytes.length-this.byteOffset)-this.bitOffset}}var Pt;(function(u){u[u.PAD_ENCODE=0]="PAD_ENCODE",u[u.ASCII_ENCODE=1]="ASCII_ENCODE",u[u.C40_ENCODE=2]="C40_ENCODE",u[u.TEXT_ENCODE=3]="TEXT_ENCODE",u[u.ANSIX12_ENCODE=4]="ANSIX12_ENCODE",u[u.EDIFACT_ENCODE=5]="EDIFACT_ENCODE",u[u.BASE256_ENCODE=6]="BASE256_ENCODE"})(Pt||(Pt={}));class De{static decode(t){const e=new Wn(t),n=new wt,r=new wt,i=new Array;let s=Pt.ASCII_ENCODE;do if(s===Pt.ASCII_ENCODE)s=this.decodeAsciiSegment(e,n,r);else{switch(s){case Pt.C40_ENCODE:this.decodeC40Segment(e,n);break;case Pt.TEXT_ENCODE:this.decodeTextSegment(e,n);break;case Pt.ANSIX12_ENCODE:this.decodeAnsiX12Segment(e,n);break;case Pt.EDIFACT_ENCODE:this.decodeEdifactSegment(e,n);break;case Pt.BASE256_ENCODE:this.decodeBase256Segment(e,n,i);break;default:throw new x}s=Pt.ASCII_ENCODE}while(s!==Pt.PAD_ENCODE&&e.available()>0);return r.length()>0&&n.append(r.toString()),new en(t,n.toString(),i.length===0?null:i,null)}static decodeAsciiSegment(t,e,n){let r=!1;do{let i=t.readBits(8);if(i===0)throw new x;if(i<=128)return r&&(i+=128),e.append(String.fromCharCode(i-1)),Pt.ASCII_ENCODE;if(i===129)return Pt.PAD_ENCODE;if(i<=229){const s=i-130;s<10&&e.append("0"),e.append(""+s)}else switch(i){case 230:return Pt.C40_ENCODE;case 231:return Pt.BASE256_ENCODE;case 232:e.append("�");break;case 233:case 234:break;case 235:r=!0;break;case 236:e.append("[)>�05�"),n.insert(0,"��");break;case 237:e.append("[)>�06�"),n.insert(0,"��");break;case 238:return Pt.ANSIX12_ENCODE;case 239:return Pt.TEXT_ENCODE;case 240:return Pt.EDIFACT_ENCODE;case 241:break;default:if(i!==254||t.available()!==0)throw new x;break}}while(t.available()>0);return Pt.ASCII_ENCODE}static decodeC40Segment(t,e){let n=!1;const r=[];let i=0;do{if(t.available()===8)return;const s=t.readBits(8);if(s===254)return;this.parseTwoBytes(s,t.readBits(8),r);for(let o=0;o<3;o++){const a=r[o];switch(i){case 0:if(a<3)i=a+1;else if(a<this.C40_BASIC_SET_CHARS.length){const l=this.C40_BASIC_SET_CHARS[a];n?(e.append(String.fromCharCode(l.charCodeAt(0)+128)),n=!1):e.append(l)}else throw new x;break;case 1:n?(e.append(String.fromCharCode(a+128)),n=!1):e.append(String.fromCharCode(a)),i=0;break;case 2:if(a<this.C40_SHIFT2_SET_CHARS.length){const l=this.C40_SHIFT2_SET_CHARS[a];n?(e.append(String.fromCharCode(l.charCodeAt(0)+128)),n=!1):e.append(l)}else switch(a){case 27:e.append("�");break;case 30:n=!0;break;default:throw new x}i=0;break;case 3:n?(e.append(String.fromCharCode(a+224)),n=!1):e.append(String.fromCharCode(a+96)),i=0;break;default:throw new x}}}while(t.available()>0)}static decodeTextSegment(t,e){let n=!1,r=[],i=0;do{if(t.available()===8)return;const s=t.readBits(8);if(s===254)return;this.parseTwoBytes(s,t.readBits(8),r);for(let o=0;o<3;o++){const a=r[o];switch(i){case 0:if(a<3)i=a+1;else if(a<this.TEXT_BASIC_SET_CHARS.length){const l=this.TEXT_BASIC_SET_CHARS[a];n?(e.append(String.fromCharCode(l.charCodeAt(0)+128)),n=!1):e.append(l)}else throw new x;break;case 1:n?(e.append(String.fromCharCode(a+128)),n=!1):e.append(String.fromCharCode(a)),i=0;break;case 2:if(a<this.TEXT_SHIFT2_SET_CHARS.length){const l=this.TEXT_SHIFT2_SET_CHARS[a];n?(e.append(String.fromCharCode(l.charCodeAt(0)+128)),n=!1):e.append(l)}else switch(a){case 27:e.append("�");break;case 30:n=!0;break;default:throw new x}i=0;break;case 3:if(a<this.TEXT_SHIFT3_SET_CHARS.length){const l=this.TEXT_SHIFT3_SET_CHARS[a];n?(e.append(String.fromCharCode(l.charCodeAt(0)+128)),n=!1):e.append(l),i=0}else throw new x;break;default:throw new x}}}while(t.available()>0)}static decodeAnsiX12Segment(t,e){const n=[];do{if(t.available()===8)return;const r=t.readBits(8);if(r===254)return;this.parseTwoBytes(r,t.readBits(8),n);for(let i=0;i<3;i++){const s=n[i];switch(s){case 0:e.append("\r");break;case 1:e.append("*");break;case 2:e.append(">");break;case 3:e.append(" ");break;default:if(s<14)e.append(String.fromCharCode(s+44));else if(s<40)e.append(String.fromCharCode(s+51));else throw new x;break}}}while(t.available()>0)}static parseTwoBytes(t,e,n){let r=(t<<8)+e-1,i=Math.floor(r/1600);n[0]=i,r-=i*1600,i=Math.floor(r/40),n[1]=i,n[2]=r-i*40}static decodeEdifactSegment(t,e){do{if(t.available()<=16)return;for(let n=0;n<4;n++){let r=t.readBits(6);if(r===31){const i=8-t.getBitOffset();i!==8&&t.readBits(i);return}
12r&32||(r|=64),e.append(String.fromCharCode(r))}}while(t.available()>0)}static decodeBase256Segment(t,e,n){let r=1+t.getByteOffset();const i=this.unrandomize255State(t.readBits(8),r++);let s;if(i===0?s=t.available()/8|0:i<250?s=i:s=250*(i-249)+this.unrandomize255State(t.readBits(8),r++),s<0)throw new x;const o=new Uint8Array(s);for(let a=0;a<s;a++){if(t.available()<8)throw new x;o[a]=this.unrandomize255State(t.readBits(8),r++)}n.push(o);try{e.append(Jt.decode(o,q.ISO88591))}catch(a){throw new we("Platform does not support required encoding: "+a.message)}}static unrandomize255State(t,e){const n=149*e%255+1,r=t-n;return r>=0?r:r+256}}De.C40_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"],De.C40_SHIFT2_SET_CHARS=["!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","@","[","\\","]","^","_"],De.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"],De.TEXT_SHIFT2_SET_CHARS=De.C40_SHIFT2_SET_CHARS,De.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","{","|","}","~","�"];class Yr{constructor(){this.rsDecoder=new rn(lt.DATA_MATRIX_FIELD_256)}decode(t){const e=new Gn(t),n=e.getVersion(),r=e.readCodewords(),i=Hn.getDataBlocks(r,n);let s=0;for(let l of i)s+=l.getNumDataCodewords();const o=new Uint8Array(s),a=i.length;for(let l=0;l<a;l++){const c=i[l],f=c.getCodewords(),d=c.getNumDataCodewords();this.correctErrors(f,d);for(let C=0;C<d;C++)o[C*a+l]=f[C]}return De.decode(o)}correctErrors(t,e){const n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch{throw new et}for(let r=0;r<e;r++)t[r]=n[r]}}class Mt{constructor(t){this.image=t,this.rectangleDetector=new ye(this.image)}detect(){const t=this.rectangleDetector.detect();let e=this.detectSolid1(t);if(e=this.detectSolid2(e),e[3]=this.correctTopRight(e),!e[3])throw new b;e=this.shiftToModuleCenter(e);const n=e[0],r=e[1],i=e[2],s=e[3];let o=this.transitionsBetween(n,s)+1,a=this.transitionsBetween(i,s)+1;(o&1)===1&&(o+=1),(a&1)===1&&(a+=1),4*o<7*a&&4*a<7*o&&(o=a=Math.max(o,a));let l=Mt.sampleGrid(this.image,n,r,i,s,o,a);return new An(l,[n,r,i,s])}static shiftPoint(t,e,n){let r=(e.getX()-t.getX())/(n+1),i=(e.getY()-t.getY())/(n+1);return new W(t.getX()+r,t.getY()+i)}static moveAway(t,e,n){let r=t.getX(),i=t.getY();return r<e?r-=1:r+=1,i<n?i-=1:i+=1,new W(r,i)}detectSolid1(t){let e=t[0],n=t[1],r=t[3],i=t[2],s=this.transitionsBetween(e,n),o=this.transitionsBetween(n,r),a=this.transitionsBetween(r,i),l=this.transitionsBetween(i,e),c=s,f=[i,e,n,r];return c>o&&(c=o,f[0]=e,f[1]=n,f[2]=r,f[3]=i),c>a&&(c=a,f[0]=n,f[1]=r,f[2]=i,f[3]=e),c>l&&(f[0]=r,f[1]=i,f[2]=e,f[3]=n),f}detectSolid2(t){let e=t[0],n=t[1],r=t[2],i=t[3],s=this.transitionsBetween(e,i),o=Mt.shiftPoint(n,r,(s+1)*4),a=Mt.shiftPoint(r,n,(s+1)*4),l=this.transitionsBetween(o,e),c=this.transitionsBetween(a,i);return l<c?(t[0]=e,t[1]=n,t[2]=r,t[3]=i):(t[0]=n,t[1]=r,t[2]=i,t[3]=e),t}correctTopRight(t){let e=t[0],n=t[1],r=t[2],i=t[3],s=this.transitionsBetween(e,i),o=this.transitionsBetween(n,i),a=Mt.shiftPoint(e,n,(o+1)*4),l=Mt.shiftPoint(r,n,(s+1)*4);s=this.transitionsBetween(a,i),o=this.transitionsBetween(l,i);let c=new W(i.getX()+(r.getX()-n.getX())/(s+1),i.getY()+(r.getY()-n.getY())/(s+1)),f=new W(i.getX()+(e.getX()-n.getX())/(o+1),i.getY()+(e.getY()-n.getY())/(o+1));if(!this.isValid(c))return this.isValid(f)?f:null;if(!this.isValid(f))return c;let d=this.transitionsBetween(a,c)+this.transitionsBetween(l,c),C=this.transitionsBetween(a,f)+this.transitionsBetween(l,f);return d>C?c:f}shiftToModuleCenter(t){let e=t[0],n=t[1],r=t[2],i=t[3],s=this.transitionsBetween(e,i)+1,o=this.transitionsBetween(r,i)+1,a=Mt.shiftPoint(e,n,o*4),l=Mt.shiftPoint(r,n,s*4);s=this.transitionsBetween(a,i)+1,o=this.transitionsBetween(l,i)+1,(s&1)===1&&(s+=1),(o&1)===1&&(o+=1);let c=(e.getX()+n.getX()+r.getX()+i.getX())/4,f=(e.getY()+n.getY()+r.getY()+i.getY())/4;e=Mt.moveAway(e,c,f),n=Mt.moveAway(n,c,f),r=Mt.moveAway(r,c,f),i=Mt.moveAway(i,c,f);let d,C;return a=Mt.shiftPoint(e,n,o*4),a=Mt.shiftPoint(a,i,s*4),d=Mt.shiftPoint(n,e,o*4),d=Mt.shiftPoint(d,r,s*4),l=Mt.shiftPoint(r,i,o*4),l=Mt.shiftPoint(l,n,s*4),C=Mt.shiftPoint(i,r,o*4),C=Mt.shiftPoint(C,e,s*4),[a,d,l,C]}isValid(t){return t.getX()>=0&&t.getX()<this.image.getWidth()&&t.getY()>0&&t.getY()<this.image.getHeight()}static sampleGrid(t,e,n,r,i,s,o){return Re.getInstance().sampleGrid(t,s,o,.5,.5,s-.5,.5,s-.5,o-.5,.5,o-.5,e.getX(),e.getY(),i.getX(),i.getY(),r.getX(),r.getY(),n.getX(),n.getY())}transitionsBetween(t,e){let n=Math.trunc(t.getX()),r=Math.trunc(t.getY()),i=Math.trunc(e.getX()),s=Math.trunc(e.getY()),o=Math.abs(s-r)>Math.abs(i-n);if(o){let T=n;n=r,r=T,T=i,i=s,s=T}let a=Math.abs(i-n),l=Math.abs(s-r),c=-a/2,f=r<s?1:-1,d=n<i?1:-1,C=0,p=this.image.get(o?r:n,o?n:r);for(let T=n,S=r;T!==i;T+=d){let O=this.image.get(o?S:T,o?T:S);if(O!==p&&(C++,p=O),c+=l,c>0){if(S===s)break;S+=f,c-=a}}return C}}class Me{constructor(){this.decoder=new Yr}decode(t,e=null){let n,r;if(e!=null&&e.has(gt.PURE_BARCODE)){const l=Me.extractPureBits(t.getBlackMatrix());n=this.decoder.decode(l),r=Me.NO_POINTS}else{const l=new Mt(t.getBlackMatrix()).detect();n=this.decoder.decode(l.getBits()),r=l.getPoints()}const i=n.getRawBytes(),s=new jt(n.getText(),i,8*i.length,r,z.DATA_MATRIX,rt.currentTimeMillis()),o=n.getByteSegments();o!=null&&s.putMetadata(Ut.BYTE_SEGMENTS,o);const a=n.getECLevel();return a!=null&&s.putMetadata(Ut.ERROR_CORRECTION_LEVEL,a),s}reset(){}static extractPureBits(t){const e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e==null||n==null)throw new b;const r=this.moduleSize(e,t);let i=e[1];const s=n[1];let o=e[0];const l=(n[0]-o+1)/r,c=(s-i+1)/r;if(l<=0||c<=0)throw new b;const f=r/2;i+=f,o+=f;const d=new kt(l,c);for(let C=0;C<c;C++){const p=i+C*r;
vendor: 5,493 bytes, line 12
12for(let T=0;T<l;T++)t.get(o+T*r,p)&&d.set(T,C)}return d}static moduleSize(t,e){const n=e.getWidth();let r=t[0];const i=t[1];for(;r<n&&e.get(r,i);)r++;if(r===n)throw new b;const s=r-t[0];if(s===0)throw new b;return s}}Me.NO_POINTS=[];class zr extends Le{constructor(t=500){super(new Me,t)}}var Ke;(function(u){u[u.L=0]="L",u[u.M=1]="M",u[u.Q=2]="Q",u[u.H=3]="H"})(Ke||(Ke={}));class yt{constructor(t,e,n){this.value=t,this.stringValue=e,this.bits=n,yt.FOR_BITS.set(n,this),yt.FOR_VALUE.set(t,this)}getValue(){return this.value}getBits(){return this.bits}static fromString(t){switch(t){case"L":return yt.L;case"M":return yt.M;case"Q":return yt.Q;case"H":return yt.H;default:throw new L(t+"not available")}}toString(){return this.stringValue}equals(t){if(!(t instanceof yt))return!1;const e=t;return this.value===e.value}static forBits(t){if(t<0||t>=yt.FOR_BITS.size)throw new D;return yt.FOR_BITS.get(t)}}yt.FOR_BITS=new Map,yt.FOR_VALUE=new Map,yt.L=new yt(Ke.L,"L",1),yt.M=new yt(Ke.M,"M",0),yt.Q=new yt(Ke.Q,"Q",3),yt.H=new yt(Ke.H,"H",2);class zt{constructor(t){this.errorCorrectionLevel=yt.forBits(t>>3&3),this.dataMask=t&7}static numBitsDiffering(t,e){return j.bitCount(t^e)}static decodeFormatInformation(t,e){const n=zt.doDecodeFormatInformation(t,e);return n!==null?n:zt.doDecodeFormatInformation(t^zt.FORMAT_INFO_MASK_QR,e^zt.FORMAT_INFO_MASK_QR)}static doDecodeFormatInformation(t,e){let n=Number.MAX_SAFE_INTEGER,r=0;for(const i of zt.FORMAT_INFO_DECODE_LOOKUP){const s=i[0];if(s===t||s===e)return new zt(i[1]);let o=zt.numBitsDiffering(t,s);o<n&&(r=i[1],n=o),t!==e&&(o=zt.numBitsDiffering(e,s),o<n&&(r=i[1],n=o))}return n<=3?new zt(r):null}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getDataMask(){return this.dataMask}hashCode(){return this.errorCorrectionLevel.getBits()<<3|this.dataMask}equals(t){if(!(t instanceof zt))return!1;const e=t;return this.errorCorrectionLevel===e.errorCorrectionLevel&&this.dataMask===e.dataMask}}zt.FORMAT_INFO_MASK_QR=21522,zt.FORMAT_INFO_DECODE_LOOKUP=[Int32Array.from([21522,0]),Int32Array.from([20773,1]),Int32Array.from([24188,2]),Int32Array.from([23371,3]),Int32Array.from([17913,4]),Int32Array.from([16590,5]),Int32Array.from([20375,6]),Int32Array.from([19104,7]),Int32Array.from([30660,8]),Int32Array.from([29427,9]),Int32Array.from([32170,10]),Int32Array.from([30877,11]),Int32Array.from([26159,12]),Int32Array.from([25368,13]),Int32Array.from([27713,14]),Int32Array.from([26998,15]),Int32Array.from([5769,16]),Int32Array.from([5054,17]),Int32Array.from([7399,18]),Int32Array.from([6608,19]),Int32Array.from([1890,20]),Int32Array.from([597,21]),Int32Array.from([3340,22]),Int32Array.from([2107,23]),Int32Array.from([13663,24]),Int32Array.from([12392,25]),Int32Array.from([16177,26]),Int32Array.from([14854,27]),Int32Array.from([9396,28]),Int32Array.from([8579,29]),Int32Array.from([11994,30]),Int32Array.from([11245,31])];class N{constructor(t,...e){this.ecCodewordsPerBlock=t,this.ecBlocks=e}getECCodewordsPerBlock(){return this.ecCodewordsPerBlock}getNumBlocks(){let t=0;const e=this.ecBlocks;for(const n of e)t+=n.getCount();return t}getTotalECCodewords(){return this.ecCodewordsPerBlock*this.getNumBlocks()}getECBlocks(){return this.ecBlocks}}class E{constructor(t,e){this.count=t,this.dataCodewords=e}getCount(){return this.count}getDataCodewords(){return this.dataCodewords}}class X{constructor(t,e,...n){this.versionNumber=t,this.alignmentPatternCenters=e,this.ecBlocks=n;let r=0;const i=n[0].getECCodewordsPerBlock(),s=n[0].getECBlocks();for(const o of s)r+=o.getCount()*(o.getDataCodewords()+i);this.totalCodewords=r}getVersionNumber(){return this.versionNumber}getAlignmentPatternCenters(){return this.alignmentPatternCenters}getTotalCodewords(){return this.totalCodewords}getDimensionForVersion(){return 17+4*this.versionNumber}getECBlocksForLevel(t){return this.ecBlocks[t.getValue()]}static getProvisionalVersionForDimension(t){if(t%4!==1)throw new x;try{return this.getVersionForNumber((t-17)/4)}catch{throw new x}}static getVersionForNumber(t){if(t<1||t>40)throw new D;return X.VERSIONS[t-1]}static decodeVersionInformation(t){let e=Number.MAX_SAFE_INTEGER,n=0;for(let r=0;r<X.VERSION_DECODE_INFO.length;r++){const i=X.VERSION_DECODE_INFO[r];if(i===t)return X.getVersionForNumber(r+7);const s=zt.numBitsDiffering(t,i);s<e&&(n=r+7,e=s)}return e<=3?X.getVersionForNumber(n):null}buildFunctionPattern(){const t=this.getDimensionForVersion(),e=new kt(t);e.setRegion(0,0,9,9),e.setRegion(t-8,0,8,9),e.setRegion(0,t-8,9,8);const n=this.alignmentPatternCenters.length;for(let r=0;r<n;r++){const i=this.alignmentPatternCenters[r]-2;for(let s=0;s<n;s++)r===0&&(s===0||s===n-1)||r===n-1&&s===0||e.setRegion(this.alignmentPatternCenters[s]-2,i,5,5)}return e.setRegion(6,9,1,t-17),e.setRegion(9,6,t-17,1),this.versionNumber>6&&(e.setRegion(t-11,0,3,6),e.setRegion(0,t-11,6,3)),e}toString(){return""+this.versionNumber}}X.VERSION_DECODE_INFO=Int32Array.from([31892,34236,39577,42195,48118,51042,55367,58893,63784,68472,70749,76311,79154,84390,87683,92361,96236,102084,102881,110507,110734,117786,119615,126325,127568,133589,136944,141498,145311,150283,152622,158308,161089,167017]),X.VERSIONS=[new X(1,new Int32Array(0),new N(7,new E(1,19)),new N(10,new E(1,16)),new N(13,new E(1,13)),new N(17,new E(1,9))),new X(2,Int32Array.from([6,18]),new N(10,new E(1,34)),new N(16,new E(1,28)),new N(22,new E(1,22)),new N(28,new E(1,16))),new X(3,Int32Array.from([6,22]),new N(15,new E(1,55)),new N(26,new E(1,44)),new N(18,new E(2,17)
12),new N(22,new E(2,13))),new X(4,Int32Array.from([6,26]),new N(20,new E(1,80)),new N(18,new E(2,32)),new N(26,new E(2,24)),new N(16,new E(4,9))),new X(5,Int32Array.from([6,30]),new N(26,new E(1,108)),new N(24,new E(2,43)),new N(18,new E(2,15),new E(2,16)),new N(22,new E(2,11),new E(2,12))),new X(6,Int32Array.from([6,34]),new N(18,new E(2,68)),new N(16,new E(4,27)),new N(24,new E(4,19)),new N(28,new E(4,15))),new X(7,Int32Array.from([6,22,38]),new N(20,new E(2,78)),new N(18,new E(4,31)),new N(18,new E(2,14),new E(4,15)),new N(26,new E(4,13),new E(1,14))),new X(8,Int32Array.from([6,24,42]),new N(24,new E(2,97)),new N(22,new E(2,38),new E(2,39)),new N(22,new E(4,18),new E(2,19)),new N(26,new E(4,14),new E(2,15))),new X(9,Int32Array.from([6,26,46]),new N(30,new E(2,116)),new N(22,new E(3,36),new E(2,37)),new N(20,new E(4,16),new E(4,17)),new N(24,new E(4,12),new E(4,13))),new X(10,Int32Array.from([6,28,50]),new N(18,new E(2,68),new E(2,69)),new N(26,new E(4,43),new E(1,44)),new N(24,new E(6,19),new E(2,20)),new N(28,new E(6,15),new E(2,16))),new X(11,Int32Array.from([6,30,54]),new N(20,new E(4,81)),new N(30,new E(1,50),new E(4,51)),new N(28,new E(4,22),new E(4,23)),new N(24,new E(3,12),new E(8,13))),new X(12,Int32Array.from([6,32,58]),new N(24,new E(2,92),new E(2,93)),new N(22,new E(6,36),new E(2,37)),new N(26,new E(4,20),new E(6,21)),new N(28,new E(7,14),new E(4,15))),new X(13,Int32Array.from([6,34,62]),new N(26,new E(4,107)),new N(22,new E(8,37),new E(1,38)),new N(24,new E(8,20),new E(4,21)),new N(22,new E(12,11),new E(4,12))),new X(14,Int32Array.from([6,26,46,66]),new N(30,new E(3,115),new E(1,116)),new N(24,new E(4,40),new E(5,41)),new N(20,new E(11,16),new E(5,17)),new N(24,new E(11,12),new E(5,13))),new X(15,Int32Array.from([6,26,48,70]),new N(22,new E(5,87),new E(1,88)),new N(24,new E(5,41),new E(5,42)),new N(30,new E(5,24),new E(7,25)),new N(24,new E(11,12),new E(7,13))),new X(16,Int32Array.from([6,26,50,74]),new N(24,new E(5,98),new E(1,99)),new N(28,new E(7,45),new E(3,46)),new N(24,new E(15,19),new E(2,20)),new N(30,new E(3,15),new E(13,16))),new X(17,Int32Array.from([6,30,54,78]),new N(28,new E(1,107),new E(5,108)),new N(28,new E(10,46),new E(1,47)),new N(28,new E(1,22),new E(15,23)),new N(28,new E(2,14),new E(17,15))),new X(18,Int32Array.from([6,30,56,82]),new N(30,new E(5,120),new E(1,121)),new N(26,new E(9,43),new E(4,44)),new N(28,new E(17,22),new E(1,23)),new N(28,new E(2,14),new E(19,15))),new X(19,Int32Array.from([6,30,58,86]),new N(28,new E(3,113),new E(4,114)),new N(26,new E(3,44),new E(11,45)),new N(26,new E(17,21),new E(4,22)),new N(26,new E(9,13),new E(16,14))),new X(20,Int32Array.from([6,34,62,90]),new N(28,new E(3,107),new E(5,108)),new N(26,new E(3,41),new E(13,42)),new N(30,new E(15,24),new E(5,25)),new N(28,new E(15,15),new E(10,16))),new X(21,Int32Array.from([6,28,50,72,94]),new N(28,new E(4,116),new E(4,117)),new N(26,new E(17,42)),new N(28,new E(17,22),new E(6,23)),new N(30,new E(19,16),new E(6,17))),new X(22,Int32Array.from([6,26,50,74,98]),new N(28,new E(2,111),new E(7,112)),new N(28,new E(17,46)),new N(30,new E(7,24),new E(16,25)),new N(24,new E(34,13))),new X(23,Int32Array.from([6,30,54,78,102]),new N(30,new E(4,121),new E(5,122)),new N(28,new E(4,47),new E(14,48)),new N(30,new E(11,24),new E(14,25)),new N(30,new E(16,15),new E(14,16))),new X(24,Int32Array.from([6,28,54,80,106]),new N(30,new E(6,117),new E(4,118)),new N(28,new E(6,45),new E(14,46)),new N(30,new E(11,24),new E(16,25)),new N(30,new E(30,16),new E(2,17))),new X(25,Int32Array.from([6,32,58,84,110]),new N(26,new E(8,106),new E(4,107)),new N(28,new E(8,47),new E(13,48)),new N(30,new E(7,24),new E(22,25)),new N(30,new E(22,15),new E(13,16))),new X(26,Int32Array.from([6,30,58,86,114]),new N(28,new E(10,114),new E(2,115)),new N(28,new E(19,46),new E(4,47)),new N(28,new E(28,22),new E(6,23)),new N(30,new E(33,16),new E(4,17))),new X(27,Int32Array.from([6,34,62,90,118]),new N(30,new E(8,122),new E(4,123)),new N(28,new E(22,45),new E(3,46)),new N(30,new E(8,23),new E(26,24)),new N(30,new E(12,15),new E(28,16))),new X(28,Int32Array.from([6,26,50,74,98,122]),new N(30,new E(3,117),new E(10,118)),new N(28,new E(3,45),new E(23,46)),new N(30,new E(4,24),new E(31,25)),new N(30,new E(11,15),new E(31,16))),new X(29,Int32Array.from([6,30,54,78,102,126]),new N(30,new E(7,116),new E(7,117)),new N(28,new E(21,45),new E(7,46)),new N(30,new E(1,23),new E(37,24)),new N(30,new E(19,15),new E(26,16))),new X(30,Int32Array.from([6,26,52,78,104,130]),new N(30,new E(5,115),new E(10,116)),new N(28,new E(19,47),new E(10,48)),new N(30,new E(15,24),new E(25,25)),new N(30,new E(23,15),new E(25,16))),new X(31,Int32Array.from([6,30,56,82,108,134]),new N(30,new E(13,115),new E(3,116)),new N(28,new E(2,46),new E(29,47)),new N(30,new E(42,24),new E(1,25)),new N(30,new E(23,15),new E(28,16))),new X(32,Int32Array.from([6,34,60,86,112,138]),new N(30,new E(17,115)),new N(28,new E(10,46),new E(23,47)),new N(30,new E(10,24),new E(35,25)),new N(30,new E(19,15),new E(35,16))),new X(33,Int32Array.from([6,30,58,86,114,142]),new N(30,new E(17,115),new E(1,116)),new N(28,new E(14,46),new E(21,47)),new N(30,new E(29,24),new E(19,25)),new N(30,new E(11,15),new E(46,16))),new X(34,Int32Array.from([6,34,62,90,118,146]),new N(30,new E(13,115),new E(6,116)),new N(28,new E(14,46),new E(23,47)),new N(30,new E(44,24),new E(7,25)),new N(30,new E(59,16),new E(1,17))),new X(35,Int32Array.from([6,30,54,78,102,126,150]),new N(30,new E(12,121),new E(7,122)),new N(28,new E(12,47),new E(26,48)),new N(30,new E(39,24),new E(14,25)),new N(30,new E(22,15),new E(41,16))),new X(36,Int32Array.from([6,24,50,76,102,128,154]),new N(30,new E(6,121),new E(14,122)),new N(28,new E(6,47),new E(34,48)),new N(30,new E(46,24),new E(10,25)),new N(30,new E(2,15),new E(64,16))),new X(37,Int32Array.from([6,28,54,80,106,132,158]),new N(30,new E(17,122),new E(4,123)),new N(28,new E(29,46),new E(14,47)),new N(30,new E(49,24),new E(10,25)),new N(30,new E(24,15),new E(46,16))),new X(38,Int32Array.from([6,32,58,84,110,136,162]),new N(30,new E(4,122),new E(18,123)),new N(28,new E(13,46),new E(32,47)),new N(30,new E(48,24),new E(14,25)),new N(30,new E(42,15),new E(32,16))),new X(39,Int32Array.from([6,26,54,82,110,138,166]),new N(30,new E(20,117),new E(4,118)),new N(28,new E(40,47),new E(7,48)),new N(30,new E(43,24),new E(22,25)),new N(30,new E(10,15),new E(67,16))),new X(40,Int32Array.from([6,30,58,86,114,142,170]),new N(30,new E(19,118),new E(6,119)),new N(28,new E(18,47),new E(31,48)),new N(30,new E(34,24),new E(34,25)),new N(30,new E(20,15),new E(61,16)))];var xt;(function(u){u[u.DATA_MASK_000=0]="DATA_MASK_000",u[u.DATA_MASK_001=1]="DATA_MASK_001",u[u.DATA_MASK_010=2]="DATA_MASK_010",u[u.DATA_MASK_011=3]="DATA_MASK_011",u[u.DATA_MASK_100=4]="DATA_MASK_100",u[u.DATA_MASK_101=5]="DATA_MASK_101",u[u.DATA_MASK_110=6]="DATA_MASK_110",u[u.DATA_MASK_111=7]="DATA_MASK_111"})(xt||(xt={}));class le{constructor(t,e){this.value=t,this.isMasked=e}unmaskBitMatrix(t,e){for(let n=0;n<e;n++)for(let r=0;r<e;r++)this.isMasked(n,r)&&t.flip(r,n)}}le.values=new Map([[xt.DATA_MASK_000,new le(xt.DATA_MASK_000,(u,t)=>(u+t&1)===0)],[xt.DATA_MASK_001,new le(xt.DATA_MASK_001,(u,t)=>(u&1)===0)],[xt.DATA_MASK_010,new le(xt.DATA_MASK_010,(u,t)=>t%3===0)],[xt.DATA_MASK_011,new le(xt.DATA_MASK_011,(u,t)=>(u+t)%3===0)],[xt.DATA_MASK_100,new le(xt.DATA_MASK_100,(u,t)=>(Math.floor(u/2)+Math.floor(t/3)&1)===0)],[xt.DATA_MASK_101,new le(xt.DATA_MASK_101,(u,t)=>u*t%6===0)],[xt.DATA_MASK_110,new le(xt.DATA_MASK_110,(u,t)=>u*t%6<3)],[xt.DATA_MASK_111,new le(xt.DATA_MASK_111,(u,t)=>(u+t+u*t%3&1)===0)]]);class Zr{constructor(t){const e=t.getHeight();if(e<21||(e&3)!==1)throw new x;this.bitMatrix=t}readFormatInformation(){if(this.parsedFormatInfo!==null&&this.parsedFormatInfo!==void 0)return this.parsedFormatInfo;let t=0;for(let i=0;i<6;i++)t=this.copyBit(i,8,t);t=this.copyBit(7,8,t),t=this.copyBit(8,8,t),t=this.copyBit(8,7,t);for(let i=5;i>=0;i--)t=this.copyBit(8,i,t);const e=this.bitMatrix.getHeight();let n=0;const r=e-7;for(let i=e-1;i>=r;i--)n=this.copyBit(8,i,n);for(let i=e-8;i<e;i++)n=this.copyBit(i,8,n);if(this.parsedFormatInfo=zt.decodeFormatInformation(t,n),this.parsedFormatInfo!==null)return this.parsedFormatInfo;throw new x}readVersion(){if(this.parsedVersion!==null&&this.parsedVersion!==void 0)return this.parsedVersion;const t=this.bitMatrix.getHeight(),e=Math.floor((t-17)/4);if(e<=6)return X.getVersionForNumber(e);let n=0;const r=t-11;for(let s=5;s>=0;s--)for(let o=t-9;o>=r;o--)n=this.copyBit(o,s,n);let i=X.decodeVersionInformation(n);if(i!==null&&i.getDimensionForVersion()===t)return this.parsedVersion=i,i;n=0;for(let s=5;s>=0;s--)for(let o=t-9;o>=r;o--)n=this.copyBit(s,o,n);if(i=X.decodeVersionInformation(n),i!==null&&i.getDimensionForVersion()===t)return this.parsedVersion=i,i;throw new x}copyBit(t,e,n){return(this.isMirror?this.bitMatrix.get(e,t):this.bitMatrix.get(t,e))?n<<1|1:n<<1}readCodewords(){const t=this.readFormatInformation(),e=this.readVersion(),n=le.values.get(t.getDataMask()),r
12=this.bitMatrix.getHeight();n.unmaskBitMatrix(this.bitMatrix,r);const i=e.buildFunctionPattern();let s=!0;const o=new Uint8Array(e.getTotalCodewords());let a=0,l=0,c=0;for(let f=r-1;f>0;f-=2){f===6&&f--;for(let d=0;d<r;d++){const C=s?r-1-d:d;for(let p=0;p<2;p++)i.get(f-p,C)||(c++,l<<=1,this.bitMatrix.get(f-p,C)&&(l|=1),c===8&&(o[a++]=l,c=0,l=0))}s=!s}if(a!==e.getTotalCodewords())throw new x;return o}remask(){if(this.parsedFormatInfo===null)return;const t=le.values[this.parsedFormatInfo.getDataMask()],e=this.bitMatrix.getHeight();t.unmaskBitMatrix(this.bitMatrix,e)}setMirror(t){this.parsedVersion=null,this.parsedFormatInfo=null,this.isMirror=t}mirror(){const t=this.bitMatrix;for(let e=0,n=t.getWidth();e<n;e++)for(let r=e+1,i=t.getHeight();r<i;r++)t.get(e,r)!==t.get(r,e)&&(t.flip(r,e),t.flip(e,r))}}class Xn{constructor(t,e){this.numDataCodewords=t,this.codewords=e}static getDataBlocks(t,e,n){if(t.length!==e.getTotalCodewords())throw new D;const r=e.getECBlocksForLevel(n);let i=0;const s=r.getECBlocks();for(const p of s)i+=p.getCount();const o=new Array(i);let a=0;for(const p of s)for(let T=0;T<p.getCount();T++){const S=p.getDataCodewords(),O=r.getECCodewordsPerBlock()+S;o[a++]=new Xn(S,new Uint8Array(O))}const l=o[0].codewords.length;let c=o.length-1;for(;c>=0&&o[c].codewords.length!==l;)c--;c++;const f=l-r.getECCodewordsPerBlock();let d=0;for(let p=0;p<f;p++)for(let T=0;T<a;T++)o[T].codewords[p]=t[d++];for(let p=c;p<a;p++)o[p].codewords[f]=t[d++];const C=o[0].codewords.length;for(let p=f;p<C;p++)for(let T=0;T<a;T++){const S=T<c?p:p+1;o[T].codewords[S]=t[d++]}return o}getNumDataCodewords(){return this.numDataCodewords}getCodewords(){return this.codewords}}var ce;(function(u){u[u.TERMINATOR=0]="TERMINATOR",u[u.NUMERIC=1]="NUMERIC",u[u.ALPHANUMERIC=2]="ALPHANUMERIC",u[u.STRUCTURED_APPEND=3]="STRUCTURED_APPEND",u[u.BYTE=4]="BYTE",u[u.ECI=5]="ECI",u[u.KANJI=6]="KANJI",u[u.FNC1_FIRST_POSITION=7]="FNC1_FIRST_POSITION",u[u.FNC1_SECOND_POSITION=8]="FNC1_SECOND_POSITION",u[u.HANZI=9]="HANZI"})(ce||(ce={}));class Y{constructor(t,e,n,r){this.value=t,this.stringValue=e,this.characterCountBitsForVersions=n,this.bits=r,Y.FOR_BITS.set(r,this),Y.FOR_VALUE.set(t,this)}static forBits(t){const e=Y.FOR_BITS.get(t);if(e===void 0)throw new D;return e}getCharacterCountBits(t){const e=t.getVersionNumber();let n;return e<=9?n=0:e<=26?n=1:n=2,this.characterCountBitsForVersions[n]}getValue(){return this.value}getBits(){return this.bits}equals(t){if(!(t instanceof Y))return!1;const e=t;return this.value===e.value}toString(){return this.stringValue}}Y.FOR_BITS=new Map,Y.FOR_VALUE=new Map,Y.TERMINATOR=new Y(ce.TERMINATOR,"TERMINATOR",Int32Array.from([0,0,0]),0),Y.NUMERIC=new Y(ce.NUMERIC,"NUMERIC",Int32Array.from([10,12,14]),1),Y.ALPHANUMERIC=new Y(ce.ALPHANUMERIC,"ALPHANUMERIC",Int32Array.from([9,11,13]),2),Y.STRUCTURED_APPEND=new Y(ce.STRUCTURED_APPEND,"STRUCTURED_APPEND",Int32Array.from([0,0,0]),3),Y.BYTE=new Y(ce.BYTE,"BYTE",Int32Array.from([8,16,16]),4),Y.ECI=new Y(ce.ECI,"ECI",Int32Array.from([0,0,0]),7),Y.KANJI=new Y(ce.KANJI,"KANJI",Int32Array.from([8,10,12]),8),Y.FNC1_FIRST_POSITION=new Y(ce.FNC1_FIRST_POSITION,"FNC1_FIRST_POSITION",Int32Array.from([0,0,0]),5),Y.FNC1_SECOND_POSITION=new Y(ce.FNC1_SECOND_POSITION,"FNC1_SECOND_POSITION",Int32Array.from([0,0,0]),9),Y.HANZI=new Y(ce.HANZI,"HANZI",Int32Array.from([8,10,12]),13);class _t{static decode(t,e,n,r){const i=new Wn(t);let s=new wt;const o=new Array;let a=-1,l=-1;try{let c=null,f=!1,d;do{if(i.available()<4)d=Y.TERMINATOR;else{const C=i.readBits(4);d=Y.forBits(C)}switch(d){case Y.TERMINATOR:break;case Y.FNC1_FIRST_POSITION:case Y.FNC1_SECOND_POSITION:f=!0;break;case Y.STRUCTURED_APPEND:if(i.available()<16)throw new x;a=i.readBits(8),l=i.readBits(8);break;case Y.ECI:const C=_t.parseECIValue(i);if(c=F.getCharacterSetECIByValue(C),c===null)throw new x;break;case Y.HANZI:const p=i.readBits(4),T=i.readBits(d.getCharacterCountBits(e));p===_t.GB2312_SUBSET&&_t.decodeHanziSegment(i,s,T);break;default:const S=i.readBits(d.getCharacterCountBits(e));switch(d){case Y.NUMERIC:_t.decodeNumericSegment(i,s,S);break;case Y.ALPHANUMERIC:_t.decodeAlphanumericSegment(i,s,S,f);break;case Y.BYTE:_t.decodeByteSegment(i,s,S,c,o,r);break;case Y.KANJI:_t.decodeKanjiSegment(i,s,S);break;default:throw new x}break}}while(d!==Y.TERMINATOR)}catch{throw new x}return new en(t,s.toString(),o.length===0?null:o,n===null?null:n.toString(),a,l)}static decodeHanziSegment(t,e,n){if(n*13>t.available())throw new x;
12const r=new Uint8Array(2*n);let i=0;for(;n>0;){const s=t.readBits(13);let o=s/96<<8&4294967295|s%96;o<959?o+=41377:o+=42657,r[i]=o>>8&255,r[i+1]=o&255,i+=2,n--}try{e.append(Jt.decode(r,q.GB2312))}catch(s){throw new x(s)}}static decodeKanjiSegment(t,e,n){if(n*13>t.available())throw new x;const r=new Uint8Array(2*n);let i=0;for(;n>0;){const s=t.readBits(13);let o=s/192<<8&4294967295|s%192;o<7936?o+=33088:o+=49472,r[i]=o>>8,r[i+1]=o,i+=2,n--}try{e.append(Jt.decode(r,q.SHIFT_JIS))}catch(s){throw new x(s)}}static decodeByteSegment(t,e,n,r,i,s){if(8*n>t.available())throw new x;const o=new Uint8Array(n);for(let l=0;l<n;l++)o[l]=t.readBits(8);let a;r===null?a=q.guessEncoding(o,s):a=r.getName();try{e.append(Jt.decode(o,a))}catch(l){throw new x(l)}i.push(o)}static toAlphaNumericChar(t){if(t>=_t.ALPHANUMERIC_CHARS.length)throw new x;return _t.ALPHANUMERIC_CHARS[t]}static decodeAlphanumericSegment(t,e,n,r){const i=e.length();for(;n>1;){if(t.available()<11)throw new x;const s=t.readBits(11);e.append(_t.toAlphaNumericChar(Math.floor(s/45))),e.append(_t.toAlphaNumericChar(s%45)),n-=2}if(n===1){if(t.available()<6)throw new x;e.append(_t.toAlphaNumericChar(t.readBits(6)))}if(r)for(let s=i;s<e.length();s++)e.charAt(s)==="%"&&(s<e.length()-1&&e.charAt(s+1)==="%"?e.deleteCharAt(s+1):e.setCharAt(s,"�"))}static decodeNumericSegment(t,e,n){for(;n>=3;){if(t.available()<10)throw new x;const r=t.readBits(10);if(r>=1e3)throw new x;e.append(_t.toAlphaNumericChar(Math.floor(r/100))),e.append(_t.toAlphaNumericChar(Math.floor(r/10)%10)),e.append(_t.toAlphaNumericChar(r%10)),n-=3}if(n===2){if(t.available()<7)throw new x;const r=t.readBits(7);if(r>=100)throw new x;e.append(_t.toAlphaNumericChar(Math.floor(r/10))),e.append(_t.toAlphaNumericChar(r%10))}else if(n===1){if(t.available()<4)throw new x;const r=t.readBits(4);if(r>=10)throw new x;e.append(_t.toAlphaNumericChar(r))}}static parseECIValue(t){const e=t.readBits(8);if(!(e&128))return e&127;if((e&192)===128){const n=t.readBits(8);return(e&63)<<8&4294967295|n}if((e&224)===192){const n=t.readBits(16);return(e&31)<<16&4294967295|n}throw new x}}_t.ALPHANUMERIC_CHARS="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",_t.GB2312_SUBSET=1;class dr{constructor(t){this.mirrored=t}isMirrored(){return this.mirrored}applyMirroredCorrection(t){if(!this.mirrored||t===null||t.length<3)return;const e=t[0];t[0]=t[2],t[2]=e}}class Kr{constructor(){this.rsDecoder=new rn(lt.QR_CODE_FIELD_256)}decodeBooleanArray(t,e){return this.decodeBitMatrix(kt.parseFromBooleanArray(t),e)}decodeBitMatrix(t,e){const n=new Zr(t);let r=null;try{return this.decodeBitMatrixParser(n,e)}catch(i){r=i}try{n.remask(),n.setMirror(!0),n.readVersion(),n.readFormatInformation(),n.mirror();const i=this.decodeBitMatrixParser(n,e);return i.setOther(new dr(!0)),i}catch(i){throw r!==null?r:i}}decodeBitMatrixParser(t,e){const n=t.readVersion(),r=t.readFormatInformation().getErrorCorrectionLevel(),i=t.readCodewords(),s=Xn.getDataBlocks(i,n,r);let o=0;for(const c of s)o+=c.getNumDataCodewords();const a=new Uint8Array(o);let l=0;for(const c of s){const f=c.getCodewords(),d=c.getNumDataCodewords();this.correctErrors(f,d);for(let C=0;C<d;C++)a[l++]=f[C]}return _t.decode(a,n,r,e)}correctErrors(t,e){const n=new Int32Array(t);try{this.rsDecoder.decode(n,t.length-e)}catch{throw new et}for(let r=0;r<e;r++)t[r]=n[r]}}class Yn extends W{constructor(t,e,n){super(t,e),this.estimatedModuleSize=n}aboutEquals(t,e,n){if(Math.abs(e-this.getY())<=t&&Math.abs(n-this.getX())<=t){const r=Math.abs(t-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1}combineEstimate(t,e,n){const r=(this.getX()+e)/2,i=(this.getY()+t)/2,s=(this.estimatedModuleSize+n)/2;return new Yn(r,i,s)}}class pn{constructor(t,e,n,r,i,s,o){this.image=t,this.startX=e,this.startY=n,this.width=r,this.height=i,this.moduleSize=s,this.resultPointCallback=o,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(3)}find(){const t=this.startX,e=this.height,n=this.width,r=t+n,i=this.startY+e/2,s=new Int32Array(3),o=this.image;for(let a=0;a<e;a++){const l=i+(a&1?-Math.floor((a+1)/2):Math.floor((a+1)/2));s[0]=0,s[1]=0,s[2]=0;let c=t;
12for(;c<r&&!o.get(c,l);)c++;let f=0;for(;c<r;){if(o.get(c,l))if(f===1)s[1]++;else if(f===2){if(this.foundPatternCross(s)){const d=this.handlePossibleCenter(s,l,c);if(d!==null)return d}s[0]=s[2],s[1]=1,s[2]=0,f=1}else s[++f]++;else f===1&&f++,s[f]++;c++}if(this.foundPatternCross(s)){const d=this.handlePossibleCenter(s,l,r);if(d!==null)return d}}if(this.possibleCenters.length!==0)return this.possibleCenters[0];throw new b}static centerFromEnd(t,e){return e-t[2]-t[1]/2}foundPatternCross(t){const e=this.moduleSize,n=e/2;for(let r=0;r<3;r++)if(Math.abs(e-t[r])>=n)return!1;return!0}crossCheckVertical(t,e,n,r){const i=this.image,s=i.getHeight(),o=this.crossCheckStateCount;o[0]=0,o[1]=0,o[2]=0;let a=t;for(;a>=0&&i.get(e,a)&&o[1]<=n;)o[1]++,a--;if(a<0||o[1]>n)return NaN;for(;a>=0&&!i.get(e,a)&&o[0]<=n;)o[0]++,a--;if(o[0]>n)return NaN;for(a=t+1;a<s&&i.get(e,a)&&o[1]<=n;)o[1]++,a++;if(a===s||o[1]>n)return NaN;for(;a<s&&!i.get(e,a)&&o[2]<=n;)o[2]++,a++;if(o[2]>n)return NaN;const l=o[0]+o[1]+o[2];return 5*Math.abs(l-r)>=2*r?NaN:this.foundPatternCross(o)?pn.centerFromEnd(o,a):NaN}handlePossibleCenter(t,e,n){const r=t[0]+t[1]+t[2],i=pn.centerFromEnd(t,n),s=this.crossCheckVertical(e,i,2*t[1],r);if(!isNaN(s)){const o=(t[0]+t[1]+t[2])/3;for(const l of this.possibleCenters)if(l.aboutEquals(o,s,i))return l.combineEstimate(s,i,o);const a=new Yn(i,s,o);this.possibleCenters.push(a),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(a)}return null}}class zn extends W{constructor(t,e,n,r){super(t,e),this.estimatedModuleSize=n,this.count=r,r===void 0&&(this.count=1)}getEstimatedModuleSize(){return this.estimatedModuleSize}getCount(){return this.count}aboutEquals(t,e,n){if(Math.abs(e-this.getY())<=t&&Math.abs(n-this.getX())<=t){const r=Math.abs(t-this.estimatedModuleSize);return r<=1||r<=this.estimatedModuleSize}return!1}combineEstimate(t,e,n){const r=this.count+1,i=(this.count*this.getX()+e)/r,s=(this.count*this.getY()+t)/r,o=(this.count*this.estimatedModuleSize+n)/r;return new zn(i,s,o,r)}}class jr{constructor(t){this.bottomLeft=t[0],this.topLeft=t[1],this.topRight=t[2]}getBottomLeft(){return this.bottomLeft}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}}class Vt{constructor(t,e){this.image=t,this.resultPointCallback=e,this.possibleCenters=[],this.crossCheckStateCount=new Int32Array(5),this.resultPointCallback=e}getImage(){return this.image}getPossibleCenters(){return this.possibleCenters}find(t){const e=t!=null&&t.get(gt.TRY_HARDER)!==void 0,n=t!=null&&t.get(gt.PURE_BARCODE)!==void 0,r=this.image,i=r.getHeight(),s=r.getWidth();let o=Math.floor(3*i/(4*Vt.MAX_MODULES));(o<Vt.MIN_SKIP||e)&&(o=Vt.MIN_SKIP);let a=!1;const l=new Int32Array(5);for(let f=o-1;f<i&&!a;f+=o){l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0;let d=0;for(let C=0;C<s;C++)if(r.get(C,f))(d&1)===1&&d++,l[d]++;else if(d&1)l[d]++;else if(d===4)if(Vt.foundPatternCross(l)){if(this.handlePossibleCenter(l,f,C,n)===!0)if(o=2,this.hasSkipped===!0)a=this.haveMultiplyConfirmedCenters();else{const T=this.findRowSkip();T>l[2]&&(f+=T-l[2]-o,C=s-1)}else{l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,d=3;continue}d=0,l[0]=0,l[1]=0,l[2]=0,l[3]=0,l[4]=0}else l[0]=l[2],l[1]=l[3],l[2]=l[4],l[3]=1,l[4]=0,d=3;else l[++d]++;Vt.foundPatternCross(l)&&this.handlePossibleCenter(l,f,s,n)===!0&&(o=l[0],this.hasSkipped&&(a=this.haveMultiplyConfirmedCenters()))}const c=this.selectBestPatterns();return W.orderBestPatterns(c),new jr(c)}static centerFromEnd(t,e){return e-t[4]-t[3]-t[2]/2}static foundPatternCross(t){let e=0;for(let i=0;i<5;i++){const s=t[i];if(s===0)return!1;e+=s}if(e<7)return!1;const n=e/7,r=n/2;return Math.abs(n-t[0])<r&&Math.abs(n-t[1])<r&&Math.abs(3*n-t[2])<3*r&&Math.abs(n-t[3])<r&&Math.abs(n-t[4])<r}getCrossCheckStateCount(){const t=this.crossCheckStateCount;return t[0]=0,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t}crossCheckDiagonal(t,e,n,r){const i=this.getCrossCheckStateCount();let s=0;const o=this.image;for(;t>=s&&e>=s&&o.get(e-s,t-s);)i[2]++,s++;if(t<s||e<s)return!1;for(;t>=s&&e>=s&&!o.get(e-s,t-s)&&i[1]<=n;)i[1]++,s++;if(t<s||e<s||i[1]>n)return!1;for(;t>=s&&e>=s&&o.get(e-s,t-s)&&i[0]<=n;)i[0]++,s++;if(i[0]>n)return!1;const a=o.getHeight(),l=o.getWidth();for(s=1;t+s<a&&e+s<l&&o.get(e+s,t+s);)i[2]++,s++;if(t+s>=a||e+s>=l)return!1;for(;t+s<a&&e+s<l&&!o.get(e+s,t+s)&&i[3]<n;)i[3]++,s++;if(t+s>=a||e+s>=l||i[3]>=n)return!1;for(;t+s<a&&e+s<l&&o.get(e+s,t+s)&&i[4]<n;)i[4]++,s++;if(i[4]>=n)return!1;const c=i[0]+i[1]+i[2]+i[3]+i[4];
vendor: 4,108 bytes, line 12
12return Math.abs(c-r)<2*r&&Vt.foundPatternCross(i)}crossCheckVertical(t,e,n,r){const i=this.image,s=i.getHeight(),o=this.getCrossCheckStateCount();let a=t;for(;a>=0&&i.get(e,a);)o[2]++,a--;if(a<0)return NaN;for(;a>=0&&!i.get(e,a)&&o[1]<=n;)o[1]++,a--;if(a<0||o[1]>n)return NaN;for(;a>=0&&i.get(e,a)&&o[0]<=n;)o[0]++,a--;if(o[0]>n)return NaN;for(a=t+1;a<s&&i.get(e,a);)o[2]++,a++;if(a===s)return NaN;for(;a<s&&!i.get(e,a)&&o[3]<n;)o[3]++,a++;if(a===s||o[3]>=n)return NaN;for(;a<s&&i.get(e,a)&&o[4]<n;)o[4]++,a++;if(o[4]>=n)return NaN;const l=o[0]+o[1]+o[2]+o[3]+o[4];return 5*Math.abs(l-r)>=2*r?NaN:Vt.foundPatternCross(o)?Vt.centerFromEnd(o,a):NaN}crossCheckHorizontal(t,e,n,r){const i=this.image,s=i.getWidth(),o=this.getCrossCheckStateCount();let a=t;for(;a>=0&&i.get(a,e);)o[2]++,a--;if(a<0)return NaN;for(;a>=0&&!i.get(a,e)&&o[1]<=n;)o[1]++,a--;if(a<0||o[1]>n)return NaN;for(;a>=0&&i.get(a,e)&&o[0]<=n;)o[0]++,a--;if(o[0]>n)return NaN;for(a=t+1;a<s&&i.get(a,e);)o[2]++,a++;if(a===s)return NaN;for(;a<s&&!i.get(a,e)&&o[3]<n;)o[3]++,a++;if(a===s||o[3]>=n)return NaN;for(;a<s&&i.get(a,e)&&o[4]<n;)o[4]++,a++;if(o[4]>=n)return NaN;const l=o[0]+o[1]+o[2]+o[3]+o[4];return 5*Math.abs(l-r)>=r?NaN:Vt.foundPatternCross(o)?Vt.centerFromEnd(o,a):NaN}handlePossibleCenter(t,e,n,r){const i=t[0]+t[1]+t[2]+t[3]+t[4];let s=Vt.centerFromEnd(t,n),o=this.crossCheckVertical(e,Math.floor(s),t[2],i);if(!isNaN(o)&&(s=this.crossCheckHorizontal(Math.floor(s),Math.floor(o),t[2],i),!isNaN(s)&&(!r||this.crossCheckDiagonal(Math.floor(o),Math.floor(s),t[2],i)))){const a=i/7;let l=!1;const c=this.possibleCenters;for(let f=0,d=c.length;f<d;f++){const C=c[f];if(C.aboutEquals(a,o,s)){c[f]=C.combineEstimate(o,s,a),l=!0;break}}if(!l){const f=new zn(s,o,a);c.push(f),this.resultPointCallback!==null&&this.resultPointCallback!==void 0&&this.resultPointCallback.foundPossibleResultPoint(f)}return!0}return!1}findRowSkip(){if(this.possibleCenters.length<=1)return 0;let e=null;for(const n of this.possibleCenters)if(n.getCount()>=Vt.CENTER_QUORUM)if(e==null)e=n;else return this.hasSkipped=!0,Math.floor((Math.abs(e.getX()-n.getX())-Math.abs(e.getY()-n.getY()))/2);return 0}haveMultiplyConfirmedCenters(){let t=0,e=0;const n=this.possibleCenters.length;for(const s of this.possibleCenters)s.getCount()>=Vt.CENTER_QUORUM&&(t++,e+=s.getEstimatedModuleSize());if(t<3)return!1;const r=e/n;let i=0;for(const s of this.possibleCenters)i+=Math.abs(s.getEstimatedModuleSize()-r);return i<=.05*e}selectBestPatterns(){const t=this.possibleCenters.length;if(t<3)throw new b;const e=this.possibleCenters;let n;if(t>3){let r=0,i=0;for(const a of this.possibleCenters){const l=a.getEstimatedModuleSize();r+=l,i+=l*l}n=r/t;let s=Math.sqrt(i/t-n*n);e.sort((a,l)=>{const c=Math.abs(l.getEstimatedModuleSize()-n),f=Math.abs(a.getEstimatedModuleSize()-n);return c<f?-1:c>f?1:0});const o=Math.max(.2*n,s);for(let a=0;a<e.length&&e.length>3;a++){const l=e[a];Math.abs(l.getEstimatedModuleSize()-n)>o&&(e.splice(a,1),a--)}}if(e.length>3){let r=0;for(const i of e)r+=i.getEstimatedModuleSize();n=r/e.length,e.sort((i,s)=>{if(s.getCount()===i.getCount()){const o=Math.abs(s.getEstimatedModuleSize()-n),a=Math.abs(i.getEstimatedModuleSize()-n);return o<a?1:o>a?-1:0}else return s.getCount()-i.getCount()}),e.splice(3)}return[e[0],e[1],e[2]]}}Vt.CENTER_QUORUM=2,Vt.MIN_SKIP=3,Vt.MAX_MODULES=57;class on{constructor(t){this.image=t}getImage(){return this.image}getResultPointCallback(){return this.resultPointCallback}detect(t){this.resultPointCallback=t==null?null:t.get(gt.NEED_RESULT_POINT_CALLBACK);const n=new Vt(this.image,this.resultPointCallback).find(t);return this.processFinderPatternInfo(n)}processFinderPatternInfo(t){const e=t.getTopLeft(),n=t.getTopRight(),r=t.getBottomLeft(),i=this.calculateModuleSize(e,n,r);if(i<1)throw new b("No pattern found in proccess finder.");const s=on.computeDimension(e,n,r,i),o=X.getProvisionalVersionForDimension(s),a=o.getDimensionForVersion()-7;let l=null;if(o.getAlignmentPatternCenters().length>0){const C=n.getX()-e.getX()+r.getX(),p=n.getY()-e.getY()+r.getY(),T=1-3/a,S=Math.floor(e.getX()+T*(C-e.getX())),O=M
12ath.floor(e.getY()+T*(p-e.getY()));for(let B=4;B<=16;B<<=1)try{l=this.findAlignmentInRegion(i,S,O,B);break}catch(k){if(!(k instanceof b))throw k}}const c=on.createTransform(e,n,r,l,s),f=on.sampleGrid(this.image,c,s);let d;return l===null?d=[r,e,n]:d=[r,e,n,l],new An(f,d)}static createTransform(t,e,n,r,i){const s=i-3.5;let o,a,l,c;return r!==null?(o=r.getX(),a=r.getY(),l=s-3,c=l):(o=e.getX()-t.getX()+n.getX(),a=e.getY()-t.getY()+n.getY(),l=s,c=s),ue.quadrilateralToQuadrilateral(3.5,3.5,s,3.5,l,c,3.5,s,t.getX(),t.getY(),e.getX(),e.getY(),o,a,n.getX(),n.getY())}static sampleGrid(t,e,n){return Re.getInstance().sampleGridWithTransform(t,n,n,e)}static computeDimension(t,e,n,r){const i=st.round(W.distance(t,e)/r),s=st.round(W.distance(t,n)/r);let o=Math.floor((i+s)/2)+7;switch(o&3){case 0:o++;break;case 2:o--;break;case 3:throw new b("Dimensions could be not found.")}return o}calculateModuleSize(t,e,n){return(this.calculateModuleSizeOneWay(t,e)+this.calculateModuleSizeOneWay(t,n))/2}calculateModuleSizeOneWay(t,e){const n=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(t.getX()),Math.floor(t.getY()),Math.floor(e.getX()),Math.floor(e.getY())),r=this.sizeOfBlackWhiteBlackRunBothWays(Math.floor(e.getX()),Math.floor(e.getY()),Math.floor(t.getX()),Math.floor(t.getY()));return isNaN(n)?r/7:isNaN(r)?n/7:(n+r)/14}sizeOfBlackWhiteBlackRunBothWays(t,e,n,r){let i=this.sizeOfBlackWhiteBlackRun(t,e,n,r),s=1,o=t-(n-t);o<0?(s=t/(t-o),o=0):o>=this.image.getWidth()&&(s=(this.image.getWidth()-1-t)/(o-t),o=this.image.getWidth()-1);let a=Math.floor(e-(r-e)*s);return s=1,a<0?(s=e/(e-a),a=0):a>=this.image.getHeight()&&(s=(this.image.getHeight()-1-e)/(a-e),a=this.image.getHeight()-1),o=Math.floor(t+(o-t)*s),i+=this.sizeOfBlackWhiteBlackRun(t,e,o,a),i-1}sizeOfBlackWhiteBlackRun(t,e,n,r){const i=Math.abs(r-e)>Math.abs(n-t);if(i){let C=t;t=e,e=C,C=n,n=r,r=C}const s=Math.abs(n-t),o=Math.abs(r-e);let a=-s/2;const l=t<n?1:-1,c=e<r?1:-1;let f=0;const d=n+l;for(let C=t,p=e;C!==d;C+=l){const T=i?p:C,S=i?C:p;if(f===1===this.image.get(T,S)){if(f===2)return st.distance(C,p,t,e);f++}if(a+=o,a>0){if(p===r)break;p+=c,a-=s}}return f===2?st.distance(n+l,r,t,e):NaN}findAlignmentInRegion(t,e,n,r){const i=Math.floor(r*t),s=Math.max(0,e-i),o=Math.min(this.image.getWidth()-1,e+i);if(o-s<t*3)throw new b("Alignment top exceeds estimated module size.");const a=Math.max(0,n-i),l=Math.min(this.image.getHeight()-1,n+i);if(l-a<t*3)throw new b("Alignment bottom exceeds estimated module size.");return new pn(this.image,s,a,o-s,l-a,t,this.resultPointCallback).find()}}class ve{constructor(){this.decoder=new Kr}getDecoder(){return this.decoder}decode(t,e){let n,r;if(e!=null&&e.get(gt.PURE_BARCODE)!==void 0){const a=ve.extractPureBits(t.getBlackMatrix());n=this.decoder.decodeBitMatrix(a,e),r=ve.NO_POINTS}else{const a=new on(t.getBlackMatrix()).detect(e);n=this.decoder.decodeBitMatrix(a.getBits(),e),r=a.getPoints()}n.getOther()instanceof dr&&n.getOther().applyMirroredCorrection(r);const i=new jt(n.getText(),n.getRawBytes(),void 0,r,z.QR_CODE,void 0),s=n.getByteSegments();s!==null&&i.putMetadata(Ut.BYTE_SEGMENTS,s);const o=n.getECLevel();return o!==null&&i.putMetadata(Ut.ERROR_CORRECTION_LEVEL,o),n.hasStructuredAppend()&&(i.putMetadata(Ut.STRUCTURED_APPEND_SEQUENCE,n.getStructuredAppendSequenceNumber()),i.putMetadata(Ut.STRUCTURED_APPEND_PARITY,n.getStructuredAppendParity())),i}reset(){}static extractPureBits(t){const e=t.getTopLeftOnBit(),n=t.getBottomRightOnBit();if(e===null||n===null)throw new b;const r=this.moduleSize(e,t);let i=e[1],s=n[1],o=e[0],a=n[0];if(o>=a||i>=s)throw new b;if(s-i!==a-o&&(a=o+(s-i),a>=t.getWidth()))throw new b;const l=Math.round((a-o+1)/r),c=Math.round((s-i+1)/r);if(l<=0||c<=0)throw new b;if(c!==l)throw new b;const f=Math.floor(r/2);i+=f,o+=f;const d=o+Math.floor((l-1)*r)-a;if(d>0){if(d>f)throw new b;o-=d}const C=i+Math.floor((c-1)*r)-s;if(C>0){if(C>f)throw new b;i-=C}const p=new kt(l,c);for(let T=0;T<c;T++){const S=i+Math.floor(T*r);for(let O=0;O<l;O++)t.get(o+Math.floor(O*r),S)&&p.set(O,T)}return p}static moduleSize(t,e){const n=e.getHeight(),r=e.getWidth();let i=t[0],s=t[1],o=!0,a=0;for(;i<r&&s<n;){if(o!==e.get(i,s)){if(++a===5)break;o=!o}i++,s++}if(i===r||s===n)throw new b;return(i-t[0])/7}}ve.NO_POINTS=new Array;class K{PDF417Common(){}static getBitCountSum(t){return st.sum(t)}static toIntArray(t){if(t==null||!t.length)return K.EMPTY_INT_ARRAY;const e=new Int32Array(t.length);let n=0;for(const r of t)e[n++]=r;return e}static getCodeword(t){const e=It.binarySearch(K.SYMBOL_TABLE,t&262143);return e<0?-1:(K.CODEWORD_TABLE[e]-1)%K.NUMBER_OF_CODEWORDS}}K.NUMBER_OF_CODEWORDS=929,K.MAX_CODEWORDS_IN_BARCODE=K.NUMBER_OF_CODEWORDS-1,K.MIN_ROWS_IN_BARCODE=3,K.MAX_ROWS_IN_BARCODE=90,K.MODULES_IN_CODEWORD=17,K.MODULES_IN_STOP_PATTERN=18,K.BARS_IN_MODULE=8,K.EMPTY_INT_ARRAY=new Int32Array([]),K
vendor: 18,272 bytes, line 12
12.SYMBOL_TABLE=Int32Array.from([66142,66170,66206,66236,66290,66292,66350,66382,66396,66454,66470,66476,66594,66600,66614,66626,66628,66632,66640,66654,66662,66668,66682,66690,66718,66720,66748,66758,66776,66798,66802,66804,66820,66824,66832,66846,66848,66876,66880,66936,66950,66956,66968,66992,67006,67022,67036,67042,67044,67048,67062,67118,67150,67164,67214,67228,67256,67294,67322,67350,67366,67372,67398,67404,67416,67438,67474,67476,67490,67492,67496,67510,67618,67624,67650,67656,67664,67678,67686,67692,67706,67714,67716,67728,67742,67744,67772,67782,67788,67800,67822,67826,67828,67842,67848,67870,67872,67900,67904,67960,67974,67992,68016,68030,68046,68060,68066,68068,68072,68086,68104,68112,68126,68128,68156,68160,68216,68336,68358,68364,68376,68400,68414,68448,68476,68494,68508,68536,68546,68548,68552,68560,68574,68582,68588,68654,68686,68700,68706,68708,68712,68726,68750,68764,68792,68802,68804,68808,68816,68830,68838,68844,68858,68878,68892,68920,68976,68990,68994,68996,69e3,69008,69022,69024,69052,69062,69068,69080,69102,69106,69108,69142,69158,69164,69190,69208,69230,69254,69260,69272,69296,69310,69326,69340,69386,69394,69396,69410,69416,69430,69442,69444,69448,69456,69470,69478,69484,69554,69556,69666,69672,69698,69704,69712,69726,69754,69762,69764,69776,69790,69792,69820,69830,69836,69848,69870,69874,69876,69890,69918,69920,69948,69952,70008,70022,70040,70064,70078,70094,70108,70114,70116,70120,70134,70152,70174,70176,70264,70384,70412,70448,70462,70496,70524,70542,70556,70584,70594,70600,70608,70622,70630,70636,70664,70672,70686,70688,70716,70720,70776,70896,71136,71180,71192,71216,71230,71264,71292,71360,71416,71452,71480,71536,71550,71554,71556,71560,71568,71582,71584,71612,71622,71628,71640,71662,71726,71732,71758,71772,71778,71780,71784,71798,71822,71836,71864,71874,71880,71888,71902,71910,71916,71930,71950,71964,71992,72048,72062,72066,72068,72080,72094,72096,72124,72134,72140,72152,72174,72178,72180,72206,72220,72248,72304,72318,72416,72444,72456,72464,72478,72480,72508,72512,72568,72588,72600,72624,72638,72654,72668,72674,72676,72680,72694,72726,72742,72748,72774,72780,72792,72814,72838,72856,72880,72894,72910,72924,72930,72932,72936,72950,72966,72972,72984,73008,73022,73056,73084,73102,73116,73144,73156,73160,73168,73182,73190,73196,73210,73226,73234,73236,73250,73252,73256,73270,73282,73284,73296,73310,73318,73324,73346,73348,73352,73360,73374,73376,73404,73414,73420,73432,73454,73498,73518,73522,73524,73550,73564,73570,73572,73576,73590,73800,73822,73858,73860,73872,73886,73888,73916,73944,73970,73972,73992,74014,74016,74044,74048,74104,74118,74136,74160,74174,74210,74212,74216,74230,74244,74256,74270,74272,74360,74480,74502,74508,74544,74558,74592,74620,74638,74652,74680,74690,74696,74704,74726,74732,74782,74784,74812,74992,75232,75288,75326,75360,75388,75456,75512,75576,75632,75646,75650,75652,75664,75678,75680,75708,75718,75724,75736,75758,75808,75836,75840,75896,76016,76256,76736,76824,76848,76862,76896,76924,76992,77048,77296,77340,77368,77424,77438,77536,77564,77572,77576,77584,77600,77628,77632,77688,77702,77708,77720,77744,77758,77774,77788,77870,77902,77916,77922,77928,77966,77980,78008,78018,78024,78032,78046,78060,78074,78094,78136,78192,78206,78210,78212,78224,78238,78240,78268,78278,78284,78296,78322,78324,78350,78364,78448,78462,78560,78588,78600,78622,78624,78652,78656,78712,78726,78744,78768,78782,78798,78812,78818,78820,78824,78838,78862,78876,78904,78960,78974,79072,79100,79296,79352,79368,79376,79390,79392,79420,79424,79480,79600,79628,79640,79664,79678,79712,79740,79772,79800,79810,79812,79816,79824,79838,79846,79852,79894,79910,79916,79942,79948,79960,79982,79988,80006,80024,80048,80062,80078,80092,80098,80100,80104,80134,80140,80176,80190,80224,80252,80270,80284,80312,80328,80336,80350,80358,80364,80378,80390,80396,80408,80432,80446,80480,80508,80576,80632,80654,80668,80696,80752,80766,80776,80784,80798,80800,80828,80844,80856,80878,80882,80884,80914,80916,80930,80932,80936,80950,80962,80968,80976,80990,80998,81004,81026,81028,81040,81054,81056,81084,81094,81100,81112,81134,81154,81156,81160,81168,81182,81184,81212,81216,81272,81286,81292,81304,81328,81342,81358,81372,81380,81384,81398,81434,81454,81458,81460,81486,81500,81506,81508,81512,81526,81550,81564,81592,81602,81604,81608,81616,81630,81638,81644,81702,81708,81722,81734,81740,81752,81774,81778,81780,82050,82078,82080,82108,82180,82184,82192,82206,82208,82236,82240,82296,82316,82328,82352,82366,82402,82404,82408,82440,82448,82462,82464,82492,82496,82552,82672,82694,82700,82712,82736,82750,82784,82812,82830,82882,82884,82888,82896,82918,82924,82952,82960,82974,82976,83004,83008,83064,83184,83424,83468,83480,83504,83518,83552,83580,83648,83704,83740,83768,83824,83838,83842,83844,83848,83856,83872,83900,83910,83916,83928,83950,83984,84e3,84028,84032,84088,84208,84448,84928,85040,85054,85088,85116,85184,85240,85488,85560,85616,85630,85728,85756,85764,85768,85776,85790,85792,85820,85824,85880,85894,85900,85912,85936,85966,85980,86048,86080,86136,86256,86496,86976,88160,88188,88256,88312,88560,89056,89200,89214,89312,89340,89536,89592,89608,89616,89632,89664,89720,89840,89868,89880,89904,89952,89980,89998,90012,90040,90190,90204,90254,90268,90296,90306,90308,90312,90334,90382,90396,90424,90480,90494,90500,90504,90512,90526,90528,90556,90566,90572,90584,90610,90612,90638,90652,90680,90736,90750,90848,90876,90884,90888,90896,90910,90912,90940,90944,91e3,91014,91020,91032,91056,91070,91086,91100,91106,91108,91112,91126,91150,91164,91192,91248,91262,91360,91388,91584,91640,91664,91678,91680,91708,91712,91768,91888,91928,91952,91966,92e3,92028,92046,92060,92088,92098,92100,92104,92112,92126,92134,92140,92188,92216,92272,92384,92412,92608,92664,93168,93200,93214,93216,93244,93248,93304,93424,93664,93720,93744,93758,93792,93820,93888,93944,93980,94008,94064,94078,94084,94088,94096,94110,94112,94140,94150,94156,94168,94246,94252,94278,94284,94296,94318,94342,94348,94360,94384,94398,94414,94428,94440,94470,94476,94488,94512,94526,94560,94588,94606,94620,94648,94658,94660,94664,94672,94686,94694,94700,94714,94726,94732,94744,94768,94782,94816,94844,94912,94968,94990,95004,95032,95088,95102,95112,95120,95134,95136,95164,95180,95192,95214,95218,95220,95244,95256,95280,95294,95328,95356,95424,95480,95728,95758,95772,95800,95856,95870,95968,95996,96008,96016,96030,96032,96060,96064,96120,96152,96176,96190,96220,96226,96228,96232,96290,96292,96296,96310,96322,96324,96328,96336,96350,96358,96364,96386,96388,96392,96400,96414,96416,96444,96454,96460,96472,96494,96498,96500,96514,96516,96520,96528,96542,96544,96572,96576,96632,96646,96652,96664,96688,96702,96718,96732,96738,96740,96744,96758,96772,96776,96784,96798,96800,96828,96832,96888,97008,97030,97036,97048,97072,97086,97120,97148,97166,97180,97208,97220,97224,97232,97246,97254,97260,97326,97330,97332,97358,97372,97378,97380,97384,97398,97422,97436,97464,97474,97476,97480,97488,97502,97510,97516,97550,97564,97592,97648,97666,97668,97672,97680,97694,97696,97724,97734,97740,97752,97774,97830,97836,97850,97862,97868,97880,97902,97906,97908,97926,97932,97944,97968,97998,98012,98018,98020,98024,98038,98618,98674,98676,98838,98854,98874,98892,98904,98926,98930,98932,98968,99006,99042,99044,99048,99062,99166,99194,99246,99286,99350,99366,99372,99386,99398,99416,99438,99442,99444,99462,99504,99518,99534,99548,99554,99556,99560,99574,99590,99596,99608,99632,99646,99680,99708,99726,99740,99768,99778,99780,99784,99792,99806,99814,99820,99834,99858,99860,99874,99880,99894,99906,99920,99934,99962,99970,99972,99976,99984,99998,1e5,100028,100038,100044,100056,100078,100082,100084,100142,100174,100188,100246,100262,100268,100306,100308,100390,100396,100410,100422,100428,100440,100462,100466,100468,100486,100504,100528,100542,100558,100572,100578,100580,100584,100598,100620,100656,100670,100704,100732,100750,100792,100802,100808,100816,100830,100838,100844,100858,100888,100912,100926,100960,100988,101056,101112,101148,101176,101232,101246,101250,101252,101256,101264,101278,101280,101308,101318,101324,101336,101358,101362,101364,101410,101412,101416,101430,101442,101448,101456,101470,101478,101498,101506,101508,101520,101534,101536,101564,101580,101618,101620,101636,101640,101648,101662,101664,101692,101696,101752,101766,101784,101838,101858,101860,101864,101934,101938,101940,101966,101980,101986,101988,101992,102030,102044,102072,102082,102084,102088,102096,102138,102166,102182,102188,102214,102220,102232,102254,102282,102290,102292,102306,102308,102312,102326,102444,102458,102470,102476,102488,102514,102516,102534,102552,102576,102590,102606,102620,102626,102632,102646,102662,102668,102704,102718,102752,102780,102798,102812,102840,102850,102856,102864,102878,102886,102892,102906,102936,102974,103008,103036,103104,103160,103224,103280,103294,103298,103300,103312,103326,103328,103356,103366,103372,103384,103406,103410,103412,103472,103486,103520,103548,103616,103672,103920,103992,104048,104062,104160,104188,104194,104196,104200,104208,104224,104252,104256,104312,104326,104332,104344,104368,104382,104398,104412,104418,104420,104424,104482,104484,104514,104520,104528,104542,104550,104570,104578,104580,104592,104606,104608,104636,104652,104690,104692,104706,104712,104734,104736,104764,104768,104824,104838,104856,104910,104930,104932,104936,104968,104976,104990,104992,105020,105024,105080,105200,105240,105278,105312,105372,105410,105412,105416,105424,105446,105518,105524,105550,105564,105570,105572,105576,105614,105628,105656,105666,105672,105680,105702,105722,105742,105756,105784,105840,105854,105858,105860,105864,105872,105888,105932,105970,105972,106006,106022,106028,106054,106060,106072,106100,106118,106124,106136,106160,106174,106190,106210,106212,106216,106250,106258,106260,106274,106276,106280,106306,106308,106312,106320,106334,106348,106394,106414,106418,106420,106566,106572,106610,106612,106630,106636,106648,106672,106686,106722,106724,106728,106742,106758,106764,106776,106800,106814,106848,106876,106894,106908,106936,106946,106948,106952,106960,106974,106982,106988,107032,107056,107070,107104,107132,107200,107256,107292,107320,107376,107390,107394,107396,107400,107408,107422,107424,107452,107462,107468,107480,107502,107506,107508,107544,107568,107582,107616,107644,107712,107768,108016,108060,108088,108144,108158,108256,108284,108290,108292,108296,108304,108318,108320,108348,108352,108408,108422,108428,108440,108464,108478,108494,108508,108514,108516,108520,108592,108640,108668,108736,108792,109040,109536,109680,109694,109792,109820,110016,110072,110084,110088,110096,110112,110140,110144,110200,110320,110342,110348,110360,110384,110398,110432,110460,110478,110492,110520,110532,110536,110544,110558,110658,110686,110714,110722,110724,110728,110736,110750,110752,110780,110796,110834,110836,110850,110852,110856,110864,110878,110880,110908,110912,110968,110982,111e3,111054,111074,111076,111080,111108,111112,111120,111134,111136,111164,111168,111224,111344,111372,111422,111456,111516,111554,111556,111560,111568,111590,111632,111646,111648,111676,111680,111736,111856,112096,112152,112224,112252,112320,112440,112514,112516,112520,112528,112542,112544,112588,112686,112718,112732,112782,112796,112824,112834,112836,112840,112848,112870,112890,112910,112924,112952,113008,113022,113026,113028,113032,113040,113054,113056,113100,113138,113140,113166,113180,113208,113264,113278,113376,113404,113416,113424,113440,113468,113472,113560,113614,113634,113636,113640,113686,113702,113708,113734,113740,113752,113778,113780,113798,113804,113816,113840,113854,113870,113890,113892,113896,113926,113932,113944,113968,113982,114016,114044,114076,114114,114116,114120,114128,114150,114170,114194,114196,114210,114212,114216,114242,114244,114248,114256,114270,114278,114306,114308,114312,114320,114334,114336,114364,114380,114420,114458,114478,114482,114484,114510,114524,114530,114532,114536,114842,114866,114868,114970,114994,114996,115042,115044,115048,115062,115130,115226,115250,115252,115278,115292,115298,115300,115304,115318,115342,115394,115396,115400,115408,115422,115430,115436,115450,115478,115494,115514,115526,115532,115570,115572,115738,115758,115762,115764,115790,115804,115810,115812,115816,115830,115854,115868,115896,115906,115912,115920,115934,115942,115948,115962,115996,116024,116080,116094,116098,116100,116104,116112,116126,116128,116156,116166,116172,116184,116206,116210,116212,116246,116262,116268,116282,116294,116300,116312,116334,116338,116340,116358,116364,116376,116400,116414,116430,116444,116450,116452,116456,116498,116500,116514,116520,116534,116546,116548,116552,116560,116574,116582,116588,116602,116654,116694,116714,116762,116782,116786,116788,116814,116828,116834,116836,116840,116854,116878,116892,116920,116930,116936,116944,116958,116966,116972,116986,117006,117048,117104,117118,117122,117124,117136,117150,117152,117180,117190,117196,117208,117230,117234,117236,117304,117360,117374,117472,117500,117506,117508,117512,117520,117536,117564,117568,117624,117638,117644,117656,117680,117694,117710,117724,117730,117732,117736,117750,117782,117798,117804,117818,117830,117848,117874,117876,117894,117936,117950,117966,117986,117988,117992,118022,118028,118040,118064,118078,118112,118140,118172,118210,118212,118216,118224,118238,118246,118266,118306,118312,118338,118352,118366,118374,118394,118402,118404,118408,118416,118430,118432,118460,118476,118514,118516,118574,118578,118580,118606,118620,118626,118628,118632,118678,118694,118700,118730,118738,118740,118830,118834,118836,118862,118876,118882,118884,118888,118902,118926,118940,118968,118978,118980,118984,118992,119006,119014,119020,119034,119068,119096,119152,119166,119170,119172,119176,119184,119198,119200,119228,119238,119244,119256,119278,119282,119284,119324,119352,119408,119422,119520,119548,119554,119556,119560,119568,119582,119584,119612,119616,119672,119686,119692,119704,119728,119742,119758,119772,119778,119780,119784,119798,119920,119934,120032,120060,120256,120312,120324,120328,120336,120352,120384,120440,120560,120582,120588,120600,120624,120638,120672,120700,120718,120732,120760,120770,120772,120776,120784,120798,120806,120812,120870,120876,120890,120902,120908,120920,120946,120948,120966,120972,120984,121008,121022,121038,121058,121060,121064,121078,121100,121112,121136,121150,121184,121212,121244,121282,121284,121288,121296,121318,121338,121356,121368,121392,121406,121440,121468,121536,121592,121656,121730,121732,121736,121744,121758,121760,121804,121842,121844,121890,121922,121924,121928,121936,121950,121958,121978,121986,121988,121992,122e3,122014,122016,122044,122060,122098,122100,122116,122120,122128,122142,122144,122172,122176,122232,122246,122264,122318,122338,122340,122344,122414,122418,122420,122446,122460,122466,122468,122472,122510,122524,122552,122562,122564,122568,122576,122598,122618,122646,122662,122668,122694,122700,122712,122738,122740,122762,122770,122772,122786,122788,122792,123018,123026,123028,123042,123044,123048,123062,123098,123146,123154,123156,123170,123172,123176,123190,123202,123204,123208,123216,123238,123244,123258,123290,123314,123316,123402,123410,123412,123426,123428,123432,123446,123458,123464,123472,123486,123494,123500,123514,123522,123524,123528,123536,123552,123580,123590,123596,123608,123630,123634,123636,123674,123698,123700,123740,123746,123748,123752,123834,123914,123922,123924,123938,123944,123958,123970,123976,123984,123998,124006,124012,124026,124034,124036,124048,124062,124064,124092,124102,124108,124120,124142,124146,124148,124162,124164,124168,124176,124190,124192,124220,124224,124280,124294,124300,124312,124336,124350,124366,124380,124386,124388,124392,124406,124442,124462,124466,124468,124494,124508,124514,124520,124558,124572,124600,124610,124612,124616,124624,124646,124666,124694,124710,124716,124730,124742,124748,124760,124786,124788,124818,124820,124834,124836,124840,124854,124946,124948,124962,124964,124968,124982,124994,124996,125e3,125008,125022,125030,125036,125050,125058,125060,125064,125072,125086,125088,125116,125126,125132,125144,125166,125170,125172,125186,125188,125192,125200,125216,125244,125248,125304,125318,125324,125336,125360,125374,125390,125404,125410,125412,125416,125430,125444,125448,125456,125472,125504,125560,125680,125702,125708,125720,125744,125758,125792,125820,125838,125852,125880,125890,125892,125896,125904,125918,125926,125932,125978,125998,126002,126004,126030,126044,126050,126052,126056,126094,126108,126136,126146,126148,126152,126160,126182,126202,126222,126236,126264,126320,126334,126338,126340,126344,126352,126366,126368,126412,126450,126452,126486,126502,126508,126522,126534,126540,126552,126574,126578,126580,126598,126604,126616,126640,126654,126670,126684,126690,126692,126696,126738,126754,126756,126760,126774,126786,126788,126792,126800,126814,126822,126828,126842,126894,126898,126900,126934,127126,127142,127148,127162,127178,127186,127188,127254,127270,127276,127290,127302,127308,127320,127342,127346,127348,127370,127378,127380,127394,127396,127400,127450,127510,127526,127532,127546,127558,127576,127598,127602,127604,127622,127628,127640,127664,127678,127694,127708,127714,127716,127720,127734,127754,127762,127764,127778,127784,127810,127812,127816,127824,127838,127846,127866,127898,127918,127922,127924,128022,128038,128044,128058,128070,128076,128088,128110,128114,128116,128134,128140,128152,128176,128190,128206,128220,128226,128228,128232,128246,128262,128268,128280,128304,128318,128352,128380,128398,128412,128440,128450,128452,128456,128464,128478,128486,128492,128506,128522,128530,128532,128546,128548,128552,128566,128578,128580,128584,128592,128606,128614,128634,128642,128644,128648,128656,128670,128672,128700,128716,128754,128756,128794,128814,128818,128820,128846,128860,128866,128868,128872,128886,128918,128934,128940,128954,128978,128980,129178,129198,129202,129204,129238,129258,129306,129326,129330,129332,129358,129372,129378,129380,129384,129398,129430,129446,129452,129466,129482,129490,129492,129562,129582,129586,129588,129614,129628,129634,129636,129640,129654,129678,129692,129720,129730,129732,129736,129744,129758,129766,129772,129814,129830,129836,129850,129862,129868,129880,129902,129906,129908,129930,129938,129940,129954,129956,129960,129974,130010]),
12K
vendor: 12,868 bytes, line 12
12.CODEWORD_TABLE=Int32Array.from([2627,1819,2622,2621,1813,1812,2729,2724,2723,2779,2774,2773,902,896,908,868,865,861,859,2511,873,871,1780,835,2493,825,2491,842,837,844,1764,1762,811,810,809,2483,807,2482,806,2480,815,814,813,812,2484,817,816,1745,1744,1742,1746,2655,2637,2635,2626,2625,2623,2628,1820,2752,2739,2737,2728,2727,2725,2730,2785,2783,2778,2777,2775,2780,787,781,747,739,736,2413,754,752,1719,692,689,681,2371,678,2369,700,697,694,703,1688,1686,642,638,2343,631,2341,627,2338,651,646,643,2345,654,652,1652,1650,1647,1654,601,599,2322,596,2321,594,2319,2317,611,610,608,606,2324,603,2323,615,614,612,1617,1616,1614,1612,616,1619,1618,2575,2538,2536,905,901,898,909,2509,2507,2504,870,867,864,860,2512,875,872,1781,2490,2489,2487,2485,1748,836,834,832,830,2494,827,2492,843,841,839,845,1765,1763,2701,2676,2674,2653,2648,2656,2634,2633,2631,2629,1821,2638,2636,2770,2763,2761,2750,2745,2753,2736,2735,2733,2731,1848,2740,2738,2786,2784,591,588,576,569,566,2296,1590,537,534,526,2276,522,2274,545,542,539,548,1572,1570,481,2245,466,2242,462,2239,492,485,482,2249,496,494,1534,1531,1528,1538,413,2196,406,2191,2188,425,419,2202,415,2199,432,430,427,1472,1467,1464,433,1476,1474,368,367,2160,365,2159,362,2157,2155,2152,378,377,375,2166,372,2165,369,2162,383,381,379,2168,1419,1418,1416,1414,385,1411,384,1423,1422,1420,1424,2461,802,2441,2439,790,786,783,794,2409,2406,2403,750,742,738,2414,756,753,1720,2367,2365,2362,2359,1663,693,691,684,2373,680,2370,702,699,696,704,1690,1687,2337,2336,2334,2332,1624,2329,1622,640,637,2344,634,2342,630,2340,650,648,645,2346,655,653,1653,1651,1649,1655,2612,2597,2595,2571,2568,2565,2576,2534,2529,2526,1787,2540,2537,907,904,900,910,2503,2502,2500,2498,1768,2495,1767,2510,2508,2506,869,866,863,2513,876,874,1782,2720,2713,2711,2697,2694,2691,2702,2672,2670,2664,1828,2678,2675,2647,2646,2644,2642,1823,2639,1822,2654,2652,2650,2657,2771,1855,2765,2762,1850,1849,2751,2749,2747,2754,353,2148,344,342,336,2142,332,2140,345,1375,1373,306,2130,299,2128,295,2125,319,314,311,2132,1354,1352,1349,1356,262,257,2101,253,2096,2093,274,273,267,2107,263,2104,280,278,275,1316,1311,1308,1320,1318,2052,202,2050,2044,2040,219,2063,212,2060,208,2055,224,221,2066,1260,1258,1252,231,1248,229,1266,1264,1261,1268,155,1998,153,1996,1994,1991,1988,165,164,2007,162,2006,159,2003,2e3,172,171,169,2012,166,2010,1186,1184,1182,1179,175,1176,173,1192,1191,1189,1187,176,1194,1193,2313,2307,2305,592,589,2294,2292,2289,578,572,568,2297,580,1591,2272,2267,2264,1547,538,536,529,2278,525,2275,547,544,541,1574,1571,2237,2235,2229,1493,2225,1489,478,2247,470,2244,465,2241,493,488,484,2250,498,495,1536,1533,1530,1539,2187,2186,2184,2182,1432,2179,1430,2176,1427,414,412,2197,409,2195,405,2193,2190,426,424,421,2203,418,2201,431,429,1473,1471,1469,1466,434,1477,1475,2478,2472,2470,2459,2457,2454,2462,803,2437,2432,2429,1726,2443,2440,792,789,785,2401,2399,2393,1702,2389,1699,2411,2408,2405,745,741,2415,758,755,1721,2358,2357,2355,2353,1661,2350,1660,2347,1657,2368,2366,2364,2361,1666,690,687,2374,683,2372,701,698,705,1691,1689,2619,2617,2610,2608,2605,2613,2593,2588,2585,1803,2599,2596,2563,2561,2555,1797,2551,1795,2573,2570,2567,2577,2525,2524,2522,2520,1786,2517,1785,2514,1783,2535,2533,2531,2528,1788,2541,2539,906,903,911,2721,1844,2715,2712,1838,1836,2699,2696,2693,2703,1827,1826,1824,2673,2671,2669,2666,1829,2679,2677,1858,1857,2772,1854,1853,1851,1856,2766,2764,143,1987,139,1986,135,133,131,1984,128,1983,125,1981,138,137,136,1985,1133,1132,1130,112,110,1974,107,1973,104,1971,1969,122,121,119,117,1977,114,1976,124,1115,1114,1112,1110,1117,1116,84,83,1953,81,1952,78,1950,1948,1945,94,93,91,1959,88,1958,85,1955,99,97,95,1961,1086,1085,1083,1081,1078,100,1090,1089,1087,1091,49,47,1917,44,1915,1913,1910,1907,59,1926,56,1925,53,1922,1919,66,64,1931,61,1929,1042,1040,1038,71,1035,70,1032,68,1048,1047,1045,1043,1050,1049,12,10,1869,1867,1864,1861,21,1880,19,1877,1874,1871,28,1888,25,1886,22,1883,982,980,977,974,32,30,991,989,987,984,34,995,994,992,2151,2150,2147,2146,2144,356,355,354,2149,2139,2138,2136,2134,1359,343,341,338,2143,335,2141,348,347,346,1376,1374,2124,2123,2121,2119,1326,2116,1324,310,308,305,2131,302,2129,298,2127,320,318,316,313,2133,322,321,1355,1353,1351,1357,2092,2091,2089,2087,1276,2084,1274,2081,1271,259,2102,256,2100,252,2098,2095,272,269,2108,266,2106,281,279,277,1317,1315,1313,1310,282,1321,1319,2039,2037,2035,2032,1203,2029,1200,1197,207,2053,205,2051,201,2049,2046,2043,220,218,2064,215,2062,211,2059,228,226,223,2069,1259,1257,1254,232,1251,230,1267,1265,1263,2316,2315,2312,2311,2309,2314,2304,2303,2301,2299,1593,2308,2306,590,2288,2287,2285,2283,1578,2280,1577,2295,2293,2291,579,577,574,571,2298,582,581,1592,2263,2262,2260,2258,1545,2255,1544,2252,1541,2273,2271,2269,2266,1550,535,532,2279,528,2277,546,543,549,1575,1573,2224,2222,2220,1486,2217,1485,2214,1482,1479,2238,2236,2234,2231,1496,2228,1492,480,477,2248,473,2246,469,2243,490,487,2251,497,1537,1535,1532,2477,2476,2474,2479,2469,2468,2466,2464,1730,2473,2471,2453,2452,2450,2448,1729,2445,1728,2460,2458,2456,2463,805,804,2428,2427,2425,2423,1725,2420,1724,2417,1722,2438,2436,2434,2431,1727,2444,2442,793,791,788,795,2388,2386,2384,1697,2381,1696,2378,1694,1692,2402,2400,2398,2395,1703,2392,1701,2412,2410,2407,751,748,744,2416,759,757,1807,2620,2618,1806,1805,2611,2609,2607,2614,1802,1801,1799,2594,2592,2590,2587,1804,2600,2598,1794,1793,1791,1789,2564,2562,2560,2557,1798,2554,1796,2574,2572,2569,2578,1847,1846,2722,1843,1842,1840,1845,2716,2714,1835,1834,1832,1830,1839,1837,2700,2698,2695,2704,1817,1811,1810,897,862,1777,829,826,838,1760,1758,808,2481,1741,1740,1738,1743,2624,1818,2726,2776,782,740,737,1715,686,679,695,1682,1680,639,628,2339,647,644,1645,1643,1640,1648,602,600,597,595,2320,593,2318,609,607,604,1611,1610,1608,1606,613,1615,1613,2328,926,924,892,886,899,857,850,2505,1778,824,823,821,819,2488,818,2486,833,831,828,840,1761,1759,2649,2632,2630,2746,2734,2732,2782,2781,570,567,1587,531,527,523,540,1566,1564,476,467,463,2240,486,483,1524,1521,1518,1529,411,403,2192,399,2189,423,416,1462,1457,1454,428,1468,1465,2210,366,363,2158,360,2156,357,2153,376,373,370,2163,1410,1409,1407,1405,382,1402,380,1417,1415,1412,1421,2175,2174,777,774,771,784,732,725,722,2404,743,1716,676,674,668,2363,665,2360,685,1684,1681,626,624,622,2335,620,2333,617,2330,641,635,649,1646,1644,1642,2566,928,925,2530,2527,894,891,888,2501,2499,2496,858,856,854,851,1779,2692,2668,2665,2645,2643,2640,2651,2768,2759,2757,2744,2743,2741,2748,352,1382,340,337,333,1371,1369,307,300,296,2126,315,312,1347,1342,1350,261,258,250,2097,246,2094,271,268,264,1306,1301,1298,276,1312,1309,2115,203,2048,195,2045,191,2041,213,209,2056,1246,1244,1238,225,1234,222,1256,1253,1249,1262,2080,2079,154,1997,150,1995,147,1992,1989,163,160,2004,156,2001,1175,1174,1172,1170,1167,170,1164,167,1185,1183,1180,1177,174,1190,1188,2025,2024,2022,587,586,564,559,556,2290,573,1588,520,518,512,2268,508,2265,530,1568,1565,461,457,2233,450,2230,446,2226,479,471,489,1526,1523,1520,397,395,2185,392,2183,389,2180,2177,410,2194,402,422,1463,1461,1459,1456,1470,2455,799,2433,2430,779,776,773,2397,2394,2390,734,728,724,746,1717,2356,2354,2351,2348,1658,677,675,673,670,667,688,1685,1683,2606,2589,2586,2559,2556,2552,927,2523,2521,2518,2515,1784,2532,895,893,890,2718,2709,2707,2689,2687,2684,2663,2662,2660,2658,1825,2667,2769,1852,2760,2758,142,141,1139,1138,134,132,129,126,1982,1129,1128,1126,1131,113,111,108,105,1972,101,1970,120,118,115,1109,1108,1106,1104,123,1113,1111,82,79,1951,75,1949,72,1946,92,89,86,1956,1077,1076,1074,1072,98,1069,96,1084,1082,1079,1088,1968,1967,48,45,1916,42,1914,39,1911,1908,60,57,54,1923,50,1920,1031,1030,1028,1026,67,1023,65,1020,62,1041,1039,1036,1033,69,1046,1044,1944,1943,1941,11,9,1868,7,1865,1862,1859,20,1878,16,1875,13,1872,970,968,966,963,29,960,26,23,983,981,978,975,33,971,31,990,988,985,1906,1904,1902,993,351,2145,1383,331,330,328,326,2137,323,2135,339,1372,1370,294,293,291,289,2122,286,2120,283,2117,309,303,317,1348,1346,1344,245,244,242,2090,239,2088,236,2085,2082,260,2099,249,270,1307,1305,1303,1300,1314,189,2038,186,2036,183,2033,2030,2026,206,198,2047,194,216,1247,1245,1243,1240,227,1237,1255,2310,2302,2300,2286,2284,2281,565,563,561,558,575,1589,2261,2259,2256,2253,1542,521,519,517,514,2270,511,533,1569,1567,2223,2221,2218,2215,1483,2211,1480,459,456,453,2232,449,474,491,1527,1525,1522,2475,2467,2465,2451,2449,2446,801,800,2426,2424,2421,2418,1723,2435,780,778,775,2387,2385,2382,2379,1695,2375,1693,2396,735,733,730,727,749,1718,2616,2615,2604,2603,2601,2584,2583,2581,2579,1800,2591,2550,2549,2547,2545,1792,2542,1790,2558,929,2719,1841,2710,2708,1833,1831,2690,2688,2686,1815,1809,1808,1774,1756,1754,1737,1736,1734,1739,1816,1711,1676,1674,633,629,1638,1636,1633,1641,598,1605,1604,1602,1600,605,1609,1607,2327,887,853,1775,822,820,1757,1755,1584,524,1560,1558,468,464,1514,1511,1508,1519,408,404,400,1452,1447,1444,417,1458,1455,2208,364,361,358,2154,1401,1400,1398,1396,374,1393,371,1408,1406,1403,1413,2173,2172,772,726,723,1712,672,669,666,682,1678,1675,625,623,621,618,2331,636,632,1639,1637,1635,920,918,884,880,889,849,848,847,846,2497,855,852,1776,2641,2742,2787,1380,334,1367,1365,301,297,1340,1338,1335,1343,255,251,247,1296,1291,1288,265,1302,1299,2113,204,196,192,2042,1232,1230,1224,214,1220,210,1242,1239,1235,1250,2077,2075,151,148,1993,144,1990,1163,1162,1160,1158,1155,161,1152,157,1173,1171,1168,1165,168,1181,1178,2021,2020,2018,2023,585,560,557,1585,516,509,1562,1559,458,447,2227,472,1516,1513,1510,398,396,393,390,2181,386,2178,407,1453,1451,1449,1446,420,1460,2209,769,764,720,712,2391,729,1713,664,663,661,659,2352,656,2349,671,1679,1677,2553,922,919,2519,2516,885,883,881,2685,2661,2659,2767,2756,2755,140,1137,1136,130,127,1125,1124,1122,1127,109,106,102,1103,1102,1100,1098,116,1107,1105,1980,80,76,73,1947,1068,1067,1065,1063,90,1060,87,1075,1073,1070,1080,1966,1965,46,43,40,1912,36,1909,1019,1018,1016,1014,58,1011,55,1008,51,1029,1027,1024,1021,63,1037,1034,1940,1939,1937,1942,8,1866,4,1863,1,1860,956,954,952,949,946,17,14,969,967,964,961,27,957,24,979,976,972,1901,1900,1898,1896,986,1905,1903,350,349,1381,329,327,324,1368,1366,292,290,287,284,2118,304,1341,1339,1337,1345,243,240,237,2086,233,2083,254,1297,1295,1293,1290,1304,2114,190,187,184,2034,180,2031,177,2027,199,1233,1231,1229,1226,217,1223,1241,2078,2076,584,555,554,552,550,2282,562,1586,507,506,504,502,2257,499,2254,515,1563,1561,445,443,441,2219,438,2216,435,2212,460,454,475,1517,1515,1512,2447,798,797,2422,2419,770,768,766,2383,2380,2376,721,719,717,714,731,1714,2602,2582,2580,2548,2546,2543,923,921,2717,2706,2705,2683,2682,2680,1771,1752,1750,1733,1732,1731,1735,1814,1707,1670,1668,1631,1629,1626,1634,1599,1598,1596,1594,1603,1601,2326,1772,1753,1751,1581,1554,1552,1504,1501,1498,1509,1442,1437,1434,401,1448,1445,2206,1392,1391,1389,1387,1384,359,1399,1397,1394,1404,2171,2170,1708,1672,1669,619,1632,1630,1628,1773,1378,1363,1361,1333,1328,1336,1286,1281,1278,248,1292,1289,2111,1218,1216,1210,197,1206,193,1228,1225,1221,1236,2073,2071,1151,1150,1148,1146,152,1143,149,1140,145,1161,1159,1156,1153,158,1169,1166,2017,2016,2014,2019,1582,510,1556,1553,452,448,1506,1500,394,391,387,1443,1441,1439,1436,1450,2207,765,716,713,1709,662,660,657,1673,1671,916,914,879,878,877,882,1135,1134,1121,1120,1118,1123,1097,1096,1094,1092,103,1101,1099,1979,1059,1058,1056,1054,77,1051,74,1066,1064,1061,1071,1964,1963,1007,1006,1004,1002,999,41,996,37,1017,1015,1012,1009,52,1025,1022,1936,1935,1933,1938,942,940,938,935,932,5,2,955,953,950,947,18,943,15,965,962,958,1895,1894,1892,1890,973,1899,1897,1379,325,1364,1362,288,285,1334,1332,1330,241,238,234,1287,1285,1283,1280,1294,2112,188,185,181,178,2028,1219,1217,1215,1212,200,1209,1227,2074,2072,583,553,551,1583,505,503,500,513,1557,1555,444,442,439,436,2213,455,451,1507,1505,1502,796,763,762,760,767,711,710,708,706,2377,718,715,1710,2544,917,915,2681,1627,1597,1595,2325,1769,1749,1747,1499,1438,1435,2204,1390,1388,1385,1395,2169,2167,1704,1665,1662,1625,1623,1620,1770,1329,1282,1279,2109,1214,1207,1222,2068,2065,1149,1147,1144,1141,146,1157,1154,2013,2011,2008,2015,1579,1549,1546,1495,1487,1433,1431,1428,1425,388,1440,2205,1705,658,1667,1664,1119,1095,1093,1978,1057,1055,1052,1062,1962,1960,1005,1003,1e3,997,38,1013,1010,1932,1930,1927,1934,941,939,936,933,6,930,3,951,948,944,1889,1887,1884,1881,959,1893,1891,35,1377,1360,1358,1327,1325,1322,1331,1277,1275,1272,1269,235,1284,2110,1205,1204,1201,1198,182,1195,179,1213,2070,2067,1580,501,1551,1548,440,437,1497,1494,1490,1503,761,709,707,1706,913,912,2198,1386,2164,2161,1621,1766,2103,1208,2058,2054,1145,1142,2005,2002,1999,2009,1488,1429,1426,2200,1698,1659,1656,1975,1053,1957,1954,1001,998,1924,1921,1918,1928,937,934,931,1879,1876,1873,1870,945,1885,1882,1323,1273,1270,2105,1202,1199,1196,1211,2061,2057,1576,1543,1540,1484,1481,1478,1491,1700]);class q
vendor: 330 bytes, line 12
12r{constructor(t,e){this.bits=t,this.points=e}getBits(){return this.bits}getPoints(){return this.points}}class ${static detectMultiple(t,e,n){let r=t.getBlackMatrix(),i=$.detect(n,r);return i.length||(r=r.clone(),r.rotate180(),i=$.detect(n,r)),new qr(r,i)}static detect(t,e){const n=new Array;let r=0,i=0,s=!1;for(;r<e.getHeight();
12){const o=$.findVertices(e,r,i);if(o[0]==null&&o[3]==null){if(!s)break;s=!1,i=0;for(const a of n)a[1]!=null&&(r=Math.trunc(Math.max(r,a[1].getY()))),a[3]!=null&&(r=Math.max(r,Math.trunc(a[3].getY())));r+=$.ROW_STEP;continue}if(s=!0,n.push(o),!t)break;o[2]!=null?(i=Math.trunc(o[2].getX()),r=Math.trunc(o[2].getY())):(i=Math.trunc(o[4].getX()),r=Math.trunc(o[4].getY()))}return n}static findVertices(t,e,n){const r=t.getHeight(),i=t.getWidth(),s=new Array(8);return $.copyToResult(s,$.findRowsWithPattern(t,r,i,e,n,$.START_PATTERN),$.INDEXES_START_PATTERN),s[4]!=null&&(n=Math.trunc(s[4].getX()),e=Math.trunc(s[4].getY())),$.copyToResult(s,$.findRowsWithPattern(t,r,i,e,n,$.STOP_PATTERN),$.INDEXES_STOP_PATTERN),s}static copyToResult(t,e,n){for(let r=0;r<n.length;r++)t[n[r]]=e[r]}static findRowsWithPattern(t,e,n,r,i,s){const o=new Array(4);let a=!1;const l=new Int32Array(s.length);for(;r<e;r+=$.ROW_STEP){let f=$.findGuardPattern(t,i,r,n,!1,s,l);if(f!=null){for(;r>0;){const d=$.findGuardPattern(t,i,--r,n,!1,s,l);if(d!=null)f=d;else{r++;break}}o[0]=new W(f[0],r),o[1]=new W(f[1],r),a=!0;break}}let c=r+1;if(a){let f=0,d=Int32Array.from([Math.trunc(o[0].getX()),Math.trunc(o[1].getX())]);for(;c<e;c++){const C=$.findGuardPattern(t,d[0],c,n,!1,s,l);if(C!=null&&Math.abs(d[0]-C[0])<$.MAX_PATTERN_DRIFT&&Math.abs(d[1]-C[1])<$.MAX_PATTERN_DRIFT)d=C,f=0;else{if(f>$.SKIPPED_ROW_COUNT_MAX)break;f++}}
vendor: 10,197 bytes, line 12
12c-=f+1,o[2]=new W(d[0],c),o[3]=new W(d[1],c)}return c-r<$.BARCODE_MIN_HEIGHT&&It.fill(o,null),o}static findGuardPattern(t,e,n,r,i,s,o){It.fillWithin(o,0,o.length,0);let a=e,l=0;for(;t.get(a,n)&&a>0&&l++<$.MAX_PIXEL_DRIFT;)a--;let c=a,f=0,d=s.length;for(let C=i;c<r;c++)if(t.get(c,n)!==C)o[f]++;else{if(f===d-1){if($.patternMatchVariance(o,s,$.MAX_INDIVIDUAL_VARIANCE)<$.MAX_AVG_VARIANCE)return new Int32Array([a,c]);a+=o[0]+o[1],rt.arraycopy(o,2,o,0,f-1),o[f-1]=0,o[f]=0,f--}else f++;o[f]=1,C=!C}return f===d-1&&$.patternMatchVariance(o,s,$.MAX_INDIVIDUAL_VARIANCE)<$.MAX_AVG_VARIANCE?new Int32Array([a,c-1]):null}static patternMatchVariance(t,e,n){let r=t.length,i=0,s=0;for(let l=0;l<r;l++)i+=t[l],s+=e[l];if(i<s)return 1/0;let o=i/s;n*=o;let a=0;for(let l=0;l<r;l++){let c=t[l],f=e[l]*o,d=c>f?c-f:f-c;if(d>n)return 1/0;a+=d}return a/i}}$.INDEXES_START_PATTERN=Int32Array.from([0,4,1,5]),$.INDEXES_STOP_PATTERN=Int32Array.from([6,2,7,3]),$.MAX_AVG_VARIANCE=.42,$.MAX_INDIVIDUAL_VARIANCE=.8,$.START_PATTERN=Int32Array.from([8,1,1,1,1,1,1,3]),$.STOP_PATTERN=Int32Array.from([7,1,1,3,1,1,1,2,1]),$.MAX_PIXEL_DRIFT=3,$.MAX_PATTERN_DRIFT=5,$.SKIPPED_ROW_COUNT_MAX=25,$.ROW_STEP=5,$.BARCODE_MIN_HEIGHT=10;class Ht{constructor(t,e){if(e.length===0)throw new D;this.field=t;let n=e.length;if(n>1&&e[0]===0){let r=1;for(;r<n&&e[r]===0;)r++;r===n?this.coefficients=new Int32Array([0]):(this.coefficients=new Int32Array(n-r),rt.arraycopy(e,r,this.coefficients,0,this.coefficients.length))}else this.coefficients=e}getCoefficients(){return this.coefficients}getDegree(){return this.coefficients.length-1}isZero(){return this.coefficients[0]===0}getCoefficient(t){return this.coefficients[this.coefficients.length-1-t]}evaluateAt(t){if(t===0)return this.getCoefficient(0);if(t===1){let r=0;for(let i of this.coefficients)r=this.field.add(r,i);return r}let e=this.coefficients[0],n=this.coefficients.length;for(let r=1;r<n;r++)e=this.field.add(this.field.multiply(t,e),this.coefficients[r]);return e}add(t){if(!this.field.equals(t.field))throw new D("ModulusPolys do not have same ModulusGF field");if(this.isZero())return t;if(t.isZero())return this;let e=this.coefficients,n=t.coefficients;if(e.length>n.length){let s=e;e=n,n=s}let r=new Int32Array(n.length),i=n.length-e.length;rt.arraycopy(n,0,r,0,i);for(let s=i;s<n.length;s++)r[s]=this.field.add(e[s-i],n[s]);return new Ht(this.field,r)}subtract(t){if(!this.field.equals(t.field))throw new D("ModulusPolys do not have same ModulusGF field");return t.isZero()?this:this.add(t.negative())}multiply(t){return t instanceof Ht?this.multiplyOther(t):this.multiplyScalar(t)}multiplyOther(t){if(!this.field.equals(t.field))throw new D("ModulusPolys do not have same ModulusGF field");if(this.isZero()||t.isZero())return new Ht(this.field,new Int32Array([0]));let e=this.coefficients,n=e.length,r=t.coefficients,i=r.length,s=new Int32Array(n+i-1);for(let o=0;o<n;o++){let a=e[o];for(let l=0;l<i;l++)s[o+l]=this.field.add(s[o+l],this.field.multiply(a,r[l]))}return new Ht(this.field,s)}negative(){let t=this.coefficients.length,e=new Int32Array(t);for(let n=0;n<t;n++)e[n]=this.field.subtract(0,this.coefficients[n]);return new Ht(this.field,e)}multiplyScalar(t){if(t===0)return new Ht(this.field,new Int32Array([0]));if(t===1)return this;let e=this.coefficients.length,n=new Int32Array(e);for(let r=0;r<e;r++)n[r]=this.field.multiply(this.coefficients[r],t);return new Ht(this.field,n)}multiplyByMonomial(t,e){if(t<0)throw new D;if(e===0)return new Ht(this.field,new Int32Array([0]));let n=this.coefficients.length,r=new Int32Array(n+t);for(let i=0;i<n;i++)r[i]=this.field.multiply(this.coefficients[i],e);return new Ht(this.field,r)}toString(){let t=new wt;for(let e=this.getDegree();e>=0;e--){let n=this.getCoefficient(e);n!==0&&(n<0?(t.append(" - "),n=-n):t.length()>0&&t.append(" + "),(e===0||n!==1)&&t.append(n),e!==0&&(e===1?t.append("x"):(t.append("x^"),t.append(e))))}return t.toString()}}class Qr{add(t,e){return(t+e)%this.modulus}subtract(t,e){return(this.modulus+t-e)%this.modulus}exp(t){return this.expTable[t]}log(t){if(t===0)throw new D;return this.logTable[t]}inverse(t){if(t===0)throw new gn;return this.expTable[this.modulus-this.logTable[t]-1]}multiply(t,e){return t===0||e===0?0:this.expTable[(this.logTable[t]+this.logTable[e])%(this.modulus-1)]}getSize(){return this.modulus}equals(t){return t===this}}class Zn extends Qr{constructor(t,e){super(),this.modulus=t,this.expTable=new Int32Array(t),this.logTable=new Int32Array(t);let n=1;for(let r=0;r<t;r++)this.expTable[r]=n,n=n*e%t;for(let r=0;r<t-1;r++)this.logTable[this.expTable[r]]=r;this.zero=new Ht(this,new Int32Array([0])),this.one=new Ht(this,new Int32Array([1]))}getZero(){return this.zero}getOne(){return this.one}buildMonomial(t,e){if(t<0)throw new D;if(e===0)return this.zero;let n=new Int32Array(t+1);return n[0]=e,new Ht(this,n)}}Zn.PDF417_GF=new Zn(K.NUMBER_OF_CODEWORDS,3);class gr{constructor(){this.field=Zn.PDF417_GF}decode(t,e,n){let r=new Ht(this.field,t),i=new Int32Array(e),s=!1;for(let p=e;p>0;p--){let T=r.evaluateAt(this.field.exp(p));i[e-p]=T,T!==0&&(s=!0)}if(!s)return 0;let o=this.field.getOne();if(n!=null)for(const p of n){let T=this.field.exp(t.length-1-p),S=new Ht(this.field,new Int32Array([this.field.subtract(0,T),1]));o=o.multiply(S)}let a=new Ht(this.field,i),l=this.runEuclideanAlgorithm(this.field.buildMonomial(e,1),a,e),c=l[0],f=l[1],d=this.findErrorLocations(c),C=this.findErrorMagnitudes(f,c,d);for(let p=0;p<d.length;p++){let T=t.length-1-this.field.log(d[p]);if(T<0)throw et.getChecksumInstance();t[T]=this.field.subtract(t[T],C[p])}return d.length}runEuclideanAlgorithm(t,e,n){if(t.getDegree()<e.getDegree()){let d=t;t=e,e=d}let r=t,i=e,s=this.field.getZero(),o=this.field.getOne();for(;i.getDegree()>=Math.round(n/2);){let d=r,C=s;if(r=i,s=o,r.isZero())throw et.getChecksumInstance();i=d;let p=this.field.getZero(),T=r.getCoefficient(r.getDegree()),S=this.field.inverse(T);for(;i.getDegree()>=r.getDegree()&&!i.isZero();){let O=i.getDegree()-r.getDegree(),B=this.field.multiply(i.getCoefficient(i.getDegree()),S);p=p.add(this.field.buildMonomial(O,B)),i=i.subtract(r.multiplyByMonomial(O,B))}o=p.multiply(s).subtract(C).negative()}let a=o.getCoefficient(0);if(a===0)throw et.getChecksumInstance();let l=this.field.inverse(a),c=o.multiply(l),f=i.multiply(l);return[c,f]}findErrorLocations(t){let e=t.getDegree(),n=new Int32Array(e),r=0;for(let i=1;i<this.field.getSize()&&r<e;i++)t.evaluateAt(i)===0&&(n[r]=this.field.inverse(i),r++);if(r!==e)throw et.getChecksumInstance();return n}findErrorMagnitudes(t,e,n){let r=e.getDegree(),i=new Int32Array(r);for(let l=1;l<=r;l++)i[r-l]=this.field.multiply(l,e.getCoefficient(l));let s=new Ht(this.field,i),o=n.length,a=new Int32Array(o);for(let l=0;l<o;l++){let c=this.field.inverse(n[l]),f=this.field.subtract(0,t.evaluateAt(c)),d=this.field.inverse(s.evaluateAt(c));a[l]=this.field.multiply(f,d)}return a}}class xe{constructor(t,e,n,r,i){t instanceof xe?this.constructor_2(t):this.constructor_1(t,e,n,r,i)}constructor_1(t,e,n,r,i){const s=e==null||n==null,o=r==null||i==null;if(s&&o)throw new b;s?(e=new W(0,r.getY()),n=new W(0,i.getY())):o&&(r=new W(t.getWidth()-1,e.getY()),i=new W(t.getWidth()-1,n.getY())),this.image=t,this.topLeft=e,this.bottomLeft=n,this.topRight=r,this.bottomRight=i,this.minX=Math.trunc(Math.min(e.getX(),n.getX())),this.maxX=Math.trunc(Math.max(r.getX(),i.getX())),this.minY=Math.trunc(Math.min(e.getY(),r.getY())),this.maxY=Math.trunc(Math.max(n.getY(),i.getY()))}constructor_2(t){this.image=t.image,this.topLeft=t.getTopLeft(),this.bottomLeft=t.getBottomLeft(),this.topRight=t.getTopRight(),this.bottomRight=t.getBottomRight(),this.minX=t.getMinX(),this.maxX=t.getMaxX(),this.minY=t.getMinY(),this.maxY=t.getMaxY()}static merge(t,e){return t==null?e:e==null?t:new xe(t.image,t.topLeft,t.bottomLeft,e.topRight,e.bottomRight)}addMissingRows(t,e,n){let r=this.topLeft,i=this.bottomLeft,s=this.topRight,o=this.bottomRight;if(t>0){let a=n?this.topLeft:this.topRight,l=Math.trunc(a.getY()-t);l<0&&(l=0);let c=new W(a.getX(),l);n?r=c:s=c}if(e>0){let a=n?this.bottomLeft:this.bottomRight,l=Math.trunc(a.getY()+e);l>=this.image.getHeight()&&(l=this.image.getHeight()-1);let c=new W(a.getX(),l);n?i=c:o=c}return new xe(this.image,r,i,s,o)}getMinX(){return this.minX}getMaxX(){return this.maxX}getMinY(){return this.minY}getMaxY(){return this.maxY}getTopLeft(){return this.topLeft}getTopRight(){return this.topRight}getBottomLeft(){return this.bottomLeft}getBottomRight(){return this.bottomRight}}class Jr{constructor(t,e,n,r){this.columnCount=t,this.errorCorrectionLevel=r,this.rowCountUpperPart=e,this.rowCountLowerPart=n,this.rowCount=e+n}getColumnCount(){return this.columnCount}getErrorCorrectionLevel(){return this.errorCorrectionLevel}getRowCount(){return this.rowCount}getRowCountUpperPart(){return this.rowCountUpperPart}getRowCountLowerPart(){return this.rowCountLowerPart}}class an{constructor(){this.buffer=""}static form(t,e){let n=-1;function r(s,o,a,l,c,f){if(s==="%%")return"%";if(e[++n]===void 0)return;s=l?parseInt(l.substr(1)):void 0;let d=c?parseInt(c.substr(1)):void 0,C;switch(f){case"s":C=e[n];break;case"c":C=e[n][0];break;case"f":C=parseFloat(e[n]).toFixed(s);break;case"p":C=parseFloat(e[n]).toPrecision(s);break;case"e":C=parseFloat(e[n]).toExponential(s);break;case"x":C=parseInt(e[n]).toString(d||16);break;case"d":C=parseFloat(parseInt(e[n],d||10).toPrecision(s)).toFixed(0);break}C=typeof C=="object"?JSON.stringify(C):(+C).toString(d);let p=parseInt(a),T=a&&a[0]+""=="0"?"0":" ";for(;C.length<p;)C=o!==void 0?C+T:T+C;return C}let i=/%(-)?(0?[0-9]+)?([.][0-9]+)?([#][0-9]+)?([scfpexd%])/g;return t.replace(i,r)}format(t,...e){this.buffer+=an.form(t,e)}toString(){return this.buffer}}class ln{constructor(t){this.boundingBox=new xe(t),this.codewords=new Array(t.getMaxY()-t.getMinY()+1)}getCodewordNearby(t){let e=this.getCodeword(t);if(e!=null)return e;for(let n=1;n<ln.MAX_NEARBY_DISTANCE;n++){let r=this.imageRowToCodewordIndex(t)-n;if(r>=0&&(e=this.codewords[r],e!=null)||(r=this.imageRowToCodewordIndex(t)+n,r<this.codewords.length&&(e=this.codewords[r],e!=null)))return e}return null}imageRowToCodewordIndex(t){return t-this.boundingBox.getMinY()}
12setCodeword(t,e){this.codewords[this.imageRowToCodewordIndex(t)]=e}getCodeword(t){return this.codewords[this.imageRowToCodewordIndex(t)]}getBoundingBox(){return this.boundingBox}getCodewords(){return this.codewords}toString(){const t=new an;let e=0;for(const n of this.codewords){if(n==null){t.format("%3d: | %n",e++);continue}t.format("%3d: %3d|%3d%n",e++,n.getRowNumber(),n.getValue())}return t.toString()}}ln.MAX_NEARBY_DISTANCE=5;class cn{constructor(){this.values=new Map}setValue(t){t=Math.trunc(t);let e=this.values.get(t);e==null&&(e=0),e++,this.values.set(t,e)}getValue(){let t=-1,e=new Array;for(const[n,r]of this.values.entries()){const i={getKey:()=>n,getValue:()=>r};i.getValue()>t?(t=i.getValue(),e=[],e.push(i.getKey())):i.getValue()===t&&e.push(i.getKey())}return K.toIntArray(e)}getConfidence(t){return this.values.get(t)}}class wr extends ln{constructor(t,e){super(t),this._isLeft=e}setRowNumbers(){for(let t of this.getCodewords())t!=null&&t.setRowNumberAsRowIndicatorColumn()}adjustCompleteIndicatorColumnRowNumbers(t){let e=this.getCodewords();this.setRowNumbers(),this.removeIncorrectCodewords(e,t);let n=this.getBoundingBox(),r=this._isLeft?n.getTopLeft():n.getTopRight(),i=this._isLeft?n.getBottomLeft():n.getBottomRight(),s=this.imageRowToCodewordIndex(Math.trunc(r.getY())),o=this.imageRowToCodewordIndex(Math.trunc(i.getY())),a=-1,l=1,c=0;for(let f=s;f<o;f++){if(e[f]==null)continue;let d=e[f],C=d.getRowNumber()-a;if(C===0)c++;else if(C===1)l=Math.max(l,c),c=1,a=d.getRowNumber();else if(C<0||d.getRowNumber()>=t.getRowCount()||C>f)e[f]=null;else{let p;l>2?p=(l-2)*C:p=C;let T=p>=f;for(let S=1;S<=p&&!T;S++)T=e[f-S]!=null;T?e[f]=null:(a=d.getRowNumber(),c=1)}}}getRowHeights(){let t=this.getBarcodeMetadata();if(t==null)return null;this.adjustIncompleteIndicatorColumnRowNumbers(t);let e=new Int32Array(t.getRowCount());for(let n of this.getCodewords())if(n!=null){let r=n.getRowNumber();if(r>=e.length)continue;e[r]++}return e}adjustIncompleteIndicatorColumnRowNumbers(t){let e=this.getBoundingBox(),n=this._isLeft?e.getTopLeft():e.getTopRight(),r=this._isLeft?e.getBottomLeft():e.getBottomRight(),i=this.imageRowToCodewordIndex(Math.trunc(n.getY())),s=this.imageRowToCodewordIndex(Math.trunc(r.getY())),o=this.getCodewords(),a=-1;for(let l=i;l<s;l++){if(o[l]==null)continue;let c=o[l];c.setRowNumberAsRowIndicatorColumn();let f=c.getRowNumber()-a;f===0||(f===1?a=c.getRowNumber():c.getRowNumber()>=t.getRowCount()?o[l]=null:a=c.getRowNumber())}}getBarcodeMetadata(){let t=this.getCodewords(),e=new cn,n=new cn,r=new cn,i=new cn;for(let o of t){if(o==null)continue;o.setRowNumberAsRowIndicatorColumn();let a=o.getValue()%30,l=o.getRowNumber();switch(this._isLeft||(l+=2),l%3){case 0:n.setValue(a*3+1);break;case 1:i.setValue(a/3),r.setValue(a%3);break;case 2:e.setValue(a+1);break}}if(e.getValue().length===0||n.getValue().length===0||r.getValue().length===0||i.getValue().length===0||e.getValue()[0]<1||n.getValue()[0]+r.getValue()[0]<K.MIN_ROWS_IN_BARCODE||n.getValue()[0]+r.getValue()[0]>K.MAX_ROWS_IN_BARCODE)return null;let s=new Jr(e.getValue()[0],n.getValue()[0],r.getValue()[0],i.getValue()[0]);return this.removeIncorrectCodewords(t,s),s}removeIncorrectCodewords(t,e){for(let n=0;n<t.length;n++){let r=t[n];if(t[n]==null)continue;let i=r.getValue()%30,s=r.getRowNumber();if(s>e.getRowCount()){t[n]=null;continue}switch(this._isLeft||(s+=2),s%3){case 0:i*3+1!==e.getRowCountUpperPart()&&(t[n]=null);break;case 1:(Math.trunc(i/3)!==e.getErrorCorrectionLevel()||i%3!==e.getRowCountLowerPart())&&(t[n]=null);break;case 2:i+1!==e.getColumnCount()&&(t[n]=null);break}}}isLeft(){return this._isLeft}toString(){return"IsLeft: "+this._isLeft+` 13`+super.toString()}}class hn{constructor(t,e){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=t,this.barcodeColumnCount=t.getColumnCount(),this.boundingBox=e,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let t=K.MAX_CODEWORDS_IN_BARCODE,e;do e=t,t=this.adjustRowNumbersAndGetCount();while(t>0&&t<e);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(t){t!=null&&t.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let t=this.adjustRowNumbersByRow();if(t===0)return 0;for(let e=1;e<this.barcodeColumnCount+1;e++){let n=this.detectionResultColumns[e].getCodewords();for(let r=0;r<n.length;r++)n[r]!=null&&(n[r].hasValidRowNumber()||this.adjustRowNumbers(e,r,n))}return t}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}
13adjustRowNumbersFromBothRI(){if(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)return;let t=this.detectionResultColumns[0].getCodewords(),e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<t.length;n++)if(t[n]!=null&&e[n]!=null&&t[n].getRowNumber()===e[n].getRowNumber())for(let r=1;r<=this.barcodeColumnCount;r++){let i=this.detectionResultColumns[r].getCodewords()[n];i!=null&&(i.setRowNumber(t[n].getRowNumber()),i.hasValidRowNumber()||(this.detectionResultColumns[r].getCodewords()[n]=null))}}adjustRowNumbersFromRRI(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;let t=0,e=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<e.length;n++){if(e[n]==null)continue;let r=e[n].getRowNumber(),i=0;for(let s=this.barcodeColumnCount+1;s>0&&i<this.ADJUST_ROW_NUMBER_SKIP;s--){let o=this.detectionResultColumns[s].getCodewords()[n];o!=null&&(i=hn.adjustRowNumberIfValid(r,i,o),o.hasValidRowNumber()||t++)}}return t}adjustRowNumbersFromLRI(){if(this.detectionResultColumns[0]==null)return 0;let t=0,e=this.detectionResultColumns[0].getCodewords();for(let n=0;n<e.length;n++){if(e[n]==null)continue;let r=e[n].getRowNumber(),i=0;for(let s=1;s<this.barcodeColumnCount+1&&i<this.ADJUST_ROW_NUMBER_SKIP;s++){let o=this.detectionResultColumns[s].getCodewords()[n];o!=null&&(i=hn.adjustRowNumberIfValid(r,i,o),o.hasValidRowNumber()||t++)}}return t}static adjustRowNumberIfValid(t,e,n){return n==null||n.hasValidRowNumber()||(n.isValidRowNumber(t)?(n.setRowNumber(t),e=0):++e),e}adjustRowNumbers(t,e,n){if(!this.detectionResultColumns[t-1])return;let r=n[e],i=this.detectionResultColumns[t-1].getCodewords(),s=i;this.detectionResultColumns[t+1]!=null&&(s=this.detectionResultColumns[t+1].getCodewords());let o=new Array(14);o[2]=i[e],o[3]=s[e],e>0&&(o[0]=n[e-1],o[4]=i[e-1],o[5]=s[e-1]),e>1&&(o[8]=n[e-2],o[10]=i[e-2],o[11]=s[e-2]),e<n.length-1&&(o[1]=n[e+1],o[6]=i[e+1],o[7]=s[e+1]),e<n.length-2&&(o[9]=n[e+2],o[12]=i[e+2],o[13]=s[e+2]);for(let a of o)if(hn.adjustRowNumber(r,a))return}static adjustRowNumber(t,e){return e==null?!1:e.hasValidRowNumber()&&e.getBucket()===t.getBucket()?(t.setRowNumber(e.getRowNumber()),!0):!1}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(t){this.boundingBox=t}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(t,e){this.detectionResultColumns[t]=e}getDetectionResultColumn(t){return this.detectionResultColumns[t]}toString(){let t=this.detectionResultColumns[0];t==null&&(t=this.detectionResultColumns[this.barcodeColumnCount+1]);let e=new an;for(let n=0;n<t.getCodewords().length;n++){e.format("CW %3d:",n);for(let r=0;r<this.barcodeColumnCount+2;r++){if(this.detectionResultColumns[r]==null){e.format(" | ");continue}let i=this.detectionResultColumns[r].getCodewords()[n];if(i==null){e.format(" | ");continue}e.format(" %3d|%3d",i.getRowNumber(),i.getValue())}e.format("%n")}return e.toString()}}class un{constructor(t,e,n,r){this.rowNumber=un.BARCODE_ROW_UNKNOWN,this.startX=Math.trunc(t),this.endX=Math.trunc(e),this.bucket=Math.trunc(n),this.value=Math.trunc(r)}hasValidRowNumber(){return this.isValidRowNumber(this.rowNumber)}isValidRowNumber(t){return t!==un.BARCODE_ROW_UNKNOWN&&this.bucket===t%3*3}setRowNumberAsRowIndicatorColumn(){this.rowNumber=Math.trunc(Math.trunc(this.value/30)*3+Math.trunc(this.bucket/3))}getWidth(){return this.endX-this.startX}getStartX(){return this.startX}getEndX(){return this.endX}getBucket(){return this.bucket}getValue(){return this.value}getRowNumber(){return this.rowNumber}setRowNumber(t){this.rowNumber=t}toString(){return this.rowNumber+"|"+this.value}}un.BARCODE_ROW_UNKNOWN=-1;class ne{static initialize(){for(let t=0;t<K.SYMBOL_TABLE.length;t++){let e=K.SYMBOL_TABLE[t],n=e&1;for(let r=0;r<K.BARS_IN_MODULE;r++){let i=0;for(;(e&1)===n;)i+=1,e>>=1;n=e&1,ne.RATIOS_TABLE[t]||(ne.RATIOS_TABLE[t]=new Array(K.BARS_IN_MODULE)),ne.RATIOS_TABLE[t][K.BARS_IN_MODULE-r-1]=Math.fround(i/K.MODULES_IN_CODEWORD)}}this.bSymbolTableReady=!0}static getDecodedValue(t){let e=ne.getDecodedCodewordValue(ne.sampleBitCounts(t));return e!==-1?e:ne.getClosestDecodedValue(t)}static sampleBitCounts(t){let e=st.sum(t),n=new Int32Array(K.BARS_IN_MODULE),r=0,i=0;for(let s=0;s<K.MODULES_IN_CODEWORD;s++){let o=e/(2*K.MODULES_IN_CODEWORD)+s*e/K.MODULES_IN_CODEWORD;i+t[r]<=o&&(i+=t[r],r++),n[r]++}return n}static getDecodedCodewordValue(t){let e=ne.getBitValue(t);return K.getCodeword(e)===-1?-1:e}static getBitValue(t){let e=0;for(let n=0;n<t.length;n++)for(let r=0;r<t[n];r++)e=e<<1|(n%2===0?1:0);return Math.trunc(e)}static getClosestDecodedValue(t){let e=st.sum(t),n=new Array(K.BARS_IN_MODULE);if(e>1)for(let s=0;s<n.length;s++)n[s]=Math.fround(t[s]/e);let r=wn.MAX_VALUE,i=-1;this.bSymbolTableReady||ne.initialize();for(let s=0;s<ne.RATIOS_TABLE.length;s++){let o=0,a=ne.RATIOS_TABLE[s];for(let l=0;l<K.BARS_IN_MODULE;l++){let c=Math.fround(a[l]-n[l]);if(o+=Math.fround(c*c),o>=r)break}o<r&&(r=o,i=K.SYMBOL_TABLE[s])}return i}}ne.bSymbolTableReady=!1,ne.RATIOS_TABLE=new Array(K.SYMBOL_TABLE.length).map(u=>
13new Array(K.BARS_IN_MODULE));class Ar{constructor(){this.segmentCount=-1,this.fileSize=-1,this.timestamp=-1,this.checksum=-1}getSegmentIndex(){return this.segmentIndex}setSegmentIndex(t){this.segmentIndex=t}getFileId(){return this.fileId}setFileId(t){this.fileId=t}getOptionalData(){return this.optionalData}setOptionalData(t){this.optionalData=t}isLastSegment(){return this.lastSegment}setLastSegment(t){this.lastSegment=t}getSegmentCount(){return this.segmentCount}setSegmentCount(t){this.segmentCount=t}getSender(){return this.sender||null}setSender(t){this.sender=t}getAddressee(){return this.addressee||null}setAddressee(t){this.addressee=t}getFileName(){return this.fileName}setFileName(t){this.fileName=t}getFileSize(){return this.fileSize}setFileSize(t){this.fileSize=t}getChecksum(){return this.checksum}setChecksum(t){this.checksum=t}getTimestamp(){return this.timestamp}setTimestamp(t){this.timestamp=t}}class Er{static parseLong(t,e=void 0){return parseInt(t,e)}}class Cr extends m{}Cr.kind="NullPointerException";class $r{writeBytes(t){this.writeBytesOffset(t,0,t.length)}writeBytesOffset(t,e,n){if(t==null)throw new Cr;if(e<0||e>t.length||n<0||e+n>t.length||e+n<0)throw new ge;if(n===0)return;for(let r=0;r<n;r++)this.write(t[e+r])}flush(){}close(){}}class ti extends m{}class ei extends $r{constructor(t=32){if(super(),this.count=0,t<0)throw new D("Negative initial size: "+t);this.buf=new Uint8Array(t)}ensureCapacity(t){t-this.buf.length>0&&this.grow(t)}grow(t){let n=this.buf.length<<1;if(n-t<0&&(n=t),n<0){if(t<0)throw new ti;n=j.MAX_VALUE}this.buf=It.copyOfUint8Array(this.buf,n)}write(t){this.ensureCapacity(this.count+1),this.buf[this.count]=t,this.count+=1}writeBytesOffset(t,e,n){if(e<0||e>t.length||n<0||e+n-t.length>0)throw new ge;this.ensureCapacity(this.count+n),rt.arraycopy(t,e,this.buf,this.count,n),this.count+=n}writeTo(t){t.writeBytesOffset(this.buf,0,this.count)}reset(){this.count=0}toByteArray(){return It.copyOfUint8Array(this.buf,this.count)}size(){return this.count}toString(t){return t?typeof t=="string"?this.toString_string(t):this.toString_number(t):this.toString_void()}toString_void(){return new String(this.buf).toString()}toString_string(t){return new String(this.buf).toString()}toString_number(t){return new String(this.buf).toString()}close(){}}var At;(function(u){u[u.ALPHA=0]="ALPHA",u[u.LOWER=1]="LOWER",u[u.MIXED=2]="MIXED",u[u.PUNCT=3]="PUNCT",u[u.ALPHA_SHIFT=4]="ALPHA_SHIFT",u[u.PUNCT_SHIFT=5]="PUNCT_SHIFT"})(At||(At={}));function mr(){if(typeof window<"u")return window.BigInt||null;if(typeof globalThis<"u")return globalThis.BigInt||null;if(typeof self<"u")return self.BigInt||null;throw new Error("Can't search globals for BigInt!")}let yn;function Be(u){if(typeof yn>"u"&&(yn=mr()),yn===null)throw new Error("BigInt is not supported!");return yn(u)}function ni(){let u=[];u[0]=Be(1);let t=Be(900);u[1]=t;for(let e=2;e<16;e++)u[e]=u[e-1]*t;return u}class _{static decode(t,e){let n=new wt(""),r=F.ISO8859_1;n.enableDecoding(r);let i=1,s=t[i++],o=new Ar;for(;i<t[0];){switch(s){case _.TEXT_COMPACTION_MODE_LATCH:i=_.textCompaction(t,i,n);break;case _.BYTE_COMPACTION_MODE_LATCH:case _.BYTE_COMPACTION_MODE_LATCH_6:i=_.byteCompaction(s,t,r,i,n);break;case _.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:n.append(t[i++]);break;case _.NUMERIC_COMPACTION_MODE_LATCH:i=_.numericCompaction(t,i,n);break;case _.ECI_CHARSET:F.getCharacterSetECIByValue(t[i++]);break;case _.ECI_GENERAL_PURPOSE:i+=2;break;case _.ECI_USER_DEFINED:i++;break;case _.BEGIN_MACRO_PDF417_CONTROL_BLOCK:i=_.decodeMacroBlock(t,i,o);break;case _.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case _.MACRO_PDF417_TERMINATOR:throw new x;default:i--,i=_.textCompaction(t,i,n);break}if(i<t.length)s=t[i++];else throw x.getFormatInstance()}if(n.length()===0)throw x.getFormatInstance();let a=new en(null,n.toString(),null,e);return a.setOther(o),a}static decodeMacroBlock(t,e,n){if(e+_.NUMBER_OF_SEQUENCE_CODEWORDS>t[0])throw x.getFormatInstance();let r=new Int32Array(_.NUMBER_OF_SEQUENCE_CODEWORDS);for(let o=0;o<_.NUMBER_OF_SEQUENCE_CODEWORDS;o++,e++)r[o]=t[e];n.setSegmentIndex(j.parseInt(_.decodeBase900toBase10(r,_.NUMBER_OF_SEQUENCE_CODEWORDS)));let i=new wt;
13e=_.textCompaction(t,e,i),n.setFileId(i.toString());let s=-1;for(t[e]===_.BEGIN_MACRO_PDF417_OPTIONAL_FIELD&&(s=e+1);e<t[0];)switch(t[e]){case _.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:switch(e++,t[e]){case _.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME:let o=new wt;e=_.textCompaction(t,e+1,o),n.setFileName(o.toString());break;case _.MACRO_PDF417_OPTIONAL_FIELD_SENDER:let a=new wt;e=_.textCompaction(t,e+1,a),n.setSender(a.toString());break;case _.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE:let l=new wt;e=_.textCompaction(t,e+1,l),n.setAddressee(l.toString());break;case _.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT:let c=new wt;e=_.numericCompaction(t,e+1,c),n.setSegmentCount(j.parseInt(c.toString()));break;case _.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP:let f=new wt;e=_.numericCompaction(t,e+1,f),n.setTimestamp(Er.parseLong(f.toString()));break;case _.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM:let d=new wt;e=_.numericCompaction(t,e+1,d),n.setChecksum(j.parseInt(d.toString()));break;case _.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE:let C=new wt;e=_.numericCompaction(t,e+1,C),n.setFileSize(Er.parseLong(C.toString()));break;default:throw x.getFormatInstance()}break;case _.MACRO_PDF417_TERMINATOR:e++,n.setLastSegment(!0);break;default:throw x.getFormatInstance()}if(s!==-1){let o=e-s;n.isLastSegment()&&o--,n.setOptionalData(It.copyOfRange(t,s,s+o))}return e}static textCompaction(t,e,n){let r=new Int32Array((t[0]-e)*2),i=new Int32Array((t[0]-e)*2),s=0,o=!1;for(;e<t[0]&&!o;){let a=t[e++];if(a<_.TEXT_COMPACTION_MODE_LATCH)r[s]=a/30,r[s+1]=a%30,s+=2;else switch(a){case _.TEXT_COMPACTION_MODE_LATCH:r[s++]=_.TEXT_COMPACTION_MODE_LATCH;break;case _.BYTE_COMPACTION_MODE_LATCH:case _.BYTE_COMPACTION_MODE_LATCH_6:case _.NUMERIC_COMPACTION_MODE_LATCH:case _.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case _.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case _.MACRO_PDF417_TERMINATOR:e--,o=!0;break;case _.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r[s]=_.MODE_SHIFT_TO_BYTE_COMPACTION_MODE,a=t[e++],i[s]=a,s++;break}}return _.decodeTextCompaction(r,i,s,n),e}static decodeTextCompaction(t,e,n,r){let i=At.ALPHA,s=At.ALPHA,o=0;for(;o<n;){let a=t[o],l="";switch(i){case At.ALPHA:if(a<26)l=String.fromCharCode(65+a);else switch(a){case 26:l=" ";break;case _.LL:i=At.LOWER;break;case _.ML:i=At.MIXED;break;case _.PS:s=i,i=At.PUNCT_SHIFT;break;case _.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[o]);break;case _.TEXT_COMPACTION_MODE_LATCH:i=At.ALPHA;break}break;case At.LOWER:if(a<26)l=String.fromCharCode(97+a);else switch(a){case 26:l=" ";break;case _.AS:s=i,i=At.ALPHA_SHIFT;break;case _.ML:i=At.MIXED;break;case _.PS:s=i,i=At.PUNCT_SHIFT;break;case _.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[o]);break;case _.TEXT_COMPACTION_MODE_LATCH:i=At.ALPHA;break}break;case At.MIXED:if(a<_.PL)l=_.MIXED_CHARS[a];else switch(a){case _.PL:i=At.PUNCT;break;case 26:l=" ";break;case _.LL:i=At.LOWER;break;case _.AL:i=At.ALPHA;break;case _.PS:s=i,i=At.PUNCT_SHIFT;break;case _.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[o]);break;case _.TEXT_COMPACTION_MODE_LATCH:i=At.ALPHA;break}break;case At.PUNCT:if(a<_.PAL)l=_.PUNCT_CHARS[a];else switch(a){case _.PAL:i=At.ALPHA;break;case _.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[o]);break;case _.TEXT_COMPACTION_MODE_LATCH:i=At.ALPHA;break}break;case At.ALPHA_SHIFT:if(i=s,a<26)l=String.fromCharCode(65+a);else switch(a){case 26:l=" ";break;case _.TEXT_COMPACTION_MODE_LATCH:i=At.ALPHA;break}break;case At.PUNCT_SHIFT:if(i=s,a<_.PAL)l=_.PUNCT_CHARS[a];else switch(a){case _.PAL:i=At.ALPHA;break;case _.MODE_SHIFT_TO_BYTE_COMPACTION_MODE:r.append(e[o]);break;case _.TEXT_COMPACTION_MODE_LATCH:i=At.ALPHA;break}break}l!==""&&r.append(l),o++}}static byteCompaction(t,e,n,r,i){let s=new ei,o=0,a=0,l=!1;switch(t){case _.BYTE_COMPACTION_MODE_LATCH:let c=new Int32Array(6),f=e[r++];for(;r<e[0]&&!l;)switch(c[o++]=f,a=900*a+f,f=e[r++],f){case _.TEXT_COMPACTION_MODE_LATCH:case _.BYTE_COMPACTION_MODE_LATCH:case _.NUMERIC_COMPACTION_MODE_LATCH:case _.BYTE_COMPACTION_MODE_LATCH_6:case _.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case _.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case _.MACRO_PDF417_TERMINATOR:r--,l=!0;break;default:if(o%5===0&&o>0){for(let d=0;d<6;++d)s.write(Number(Be(a)>>Be(8*(5-d))));a=0,o=0}break}r===e[0]&&f<_.TEXT_COMPACTION_MODE_LATCH&&(c[o++]=f);for(let d=0;d<o;d++)s.write(c[d]);break;case _.BYTE_COMPACTION_MODE_LATCH_6:for(;r<e[0]&&!l;){let d=e[r++];if(d<_.TEXT_COMPACTION_MODE_LATCH)o++,a=900*a+d;else switch(d){case _.TEXT_COMPACTION_MODE_LATCH:case _.BYTE_COMPACTION_MODE_LATCH:case _.NUMERIC_COMPACTION_MODE_LATCH:case _.BYTE_COMPACTION_MODE_LATCH_6:case _.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case _.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case _.MACRO_PDF417_TERMINATOR:r--,l=!0;break}if(o%5===0&&o>0){for(let C=0;C<6;++C)s.write(Number(Be(a)>>Be(8*(5-C))));a=0,o=0}}break}return i.append(Jt.decode(s.toByteArray(),n)),r}static numericCompaction(t,e,n){let r=0,i=!1,s=new Int32Array(_.MAX_NUMERIC_CODEWORDS);for(;e<t[0]&&!i;){let o=t[e++];if(e===t[0]&&(i=!0),o<_.TEXT_COMPACTION_MODE_LATCH)s[r]=o,r++;else switch(o){case _.TEXT_COMPACTION_MODE_LATCH:case _.BYTE_COMPACTION_MODE_LATCH:case _.BYTE_COMPACTION_MODE_LATCH_6:case _.BEGIN_MACRO_PDF417_CONTROL_BLOCK:case _.BEGIN_MACRO_PDF417_OPTIONAL_FIELD:case _.MACRO_PDF417_TERMINATOR:e--,i=!0;break}(r%_.MAX_NUMERIC_CODEWORDS===0||o===_.NUMERIC_COMPACTION_MODE_LATCH||i)&&r>0&&(n.append(_.decodeBase900toBase10(s,r)),r=0)}return e}static decodeBase900toBase10(t,e){let n=Be(0);for(let i=0;i<e;i++)n+=_.EXP900[e-i-1]*Be(t[i]);let r=n.toString();if(r.charAt(0)!=="1")throw new x;return r.substring(1)}}_.TEXT_COMPACTION_MODE_LATCH=900,_.BYTE_COMPACTION_MODE_LATCH=901,_.NUMERIC_COMPACTION_MODE_LATCH=902,_.BYTE_COMPACTION_MODE_LATCH_6=924,_.ECI_USER_DEFINED=925,_.ECI_GENERAL_PURPOSE=926,_.ECI_CHARSET=927,_.BEGIN_MACRO_PDF417_CONTROL_BLOCK=928,_.BEGIN_MACRO_PDF417_OPTIONAL_FIELD=923,_.MACRO_PDF417_TERMINATOR=922,_.MODE_SHIFT_TO_BYTE_COMPACTION_MODE=913,_.MAX_NUMERIC_CODEWORDS=15,_.MACRO_PDF417_OPTIONAL_FIELD_FILE_NAME=0,_.MACRO_PDF417_OPTIONAL_FIELD_SEGMENT_COUNT=1,_.MACRO_PDF417_OPTIONAL_FIELD_TIME_STAMP=2,_.MACRO_PDF417_OPTIONAL_FIELD_SENDER=3,_.MACRO_PDF417_OPTIONAL_FIELD_ADDRESSEE=4,_.MACRO_PDF417_OPTIONAL_FIELD_FILE_SIZE=5,_.MACRO_PDF417_OPTIONAL_FIELD_CHECKSUM=6,_.PL=25,_.LL=27,_.AS=27,_.ML=28,_.AL=28,_.PS=29,_.PAL=29,_.PUNCT_CHARS=`;<>@[\\]_\`~!\r ,: 14-.$/"|*()?{}'`,_.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",_.EXP900=mr()?ni():[],_.NUMBER_OF_SEQUENCE_CODEWORDS=2;class tt{constructor(){}static decode(t,e,n,r,i,s,o){let a=new xe(t,e,n,r,i),l=null,c=null,f;for(let p=!0;;p=!1){if(e!=null&&(l=tt.getRowIndicatorColumn(t,a,e,!0,s,o)),r!=null&&(c=tt.getRowIndicatorColumn(t,a,r,!1,s,o)),f=tt.merge(l,c),f==null)throw b.getNotFoundInstance();let T=f.getBoundingBox();if(p&&T!=null&&(T.getMinY()<a.getMinY()||T.getMaxY()>a.getMaxY()))a=T;else break}f.setBoundingBox(a);let d=f.getBarcodeColumnCount()+1;f.setDetectionResultColumn(0,l),f.setDetectionResultColumn(d,c);let C=l!=null;for(let p=1;p<=d;p++){let T=C?p:d-p;if(f.getDetectionResultColumn(T)!==void 0)continue;let S;
14T===0||T===d?S=new wr(a,T===0):S=new ln(a),f.setDetectionResultColumn(T,S);let O=-1,B=O;for(let k=a.getMinY();k<=a.getMaxY();k++){if(O=tt.getStartColumn(f,T,k,C),O<0||O>a.getMaxX()){if(B===-1)continue;O=B}let v=tt.detectCodeword(t,a.getMinX(),a.getMaxX(),C,O,k,s,o);v!=null&&(S.setCodeword(k,v),B=O,s=Math.min(s,v.getWidth()),o=Math.max(o,v.getWidth()))}}return tt.createDecoderResult(f)}static merge(t,e){if(t==null&&e==null)return null;let n=tt.getBarcodeMetadata(t,e);if(n==null)return null;let r=xe.merge(tt.adjustBoundingBox(t),tt.adjustBoundingBox(e));return new hn(n,r)}static adjustBoundingBox(t){if(t==null)return null;let e=t.getRowHeights();if(e==null)return null;let n=tt.getMax(e),r=0;for(let o of e)if(r+=n-o,o>0)break;let i=t.getCodewords();for(let o=0;r>0&&i[o]==null;o++)r--;let s=0;for(let o=e.length-1;o>=0&&(s+=n-e[o],!(e[o]>0));o--);for(let o=i.length-1;s>0&&i[o]==null;o--)s--;return t.getBoundingBox().addMissingRows(r,s,t.isLeft())}static getMax(t){let e=-1;for(let n of t)e=Math.max(e,n);return e}static getBarcodeMetadata(t,e){let n;if(t==null||(n=t.getBarcodeMetadata())==null)return e==null?null:e.getBarcodeMetadata();let r;return e==null||(r=e.getBarcodeMetadata())==null?n:n.getColumnCount()!==r.getColumnCount()&&n.getErrorCorrectionLevel()!==r.getErrorCorrectionLevel()&&n.getRowCount()!==r.getRowCount()?null:n}static getRowIndicatorColumn(t,e,n,r,i,s){let o=new wr(e,r);for(let a=0;a<2;a++){let l=a===0?1:-1,c=Math.trunc(Math.trunc(n.getX()));for(let f=Math.trunc(Math.trunc(n.getY()));f<=e.getMaxY()&&f>=e.getMinY();f+=l){let d=tt.detectCodeword(t,0,t.getWidth(),r,c,f,i,s);d!=null&&(o.setCodeword(f,d),r?c=d.getStartX():c=d.getEndX())}}return o}static adjustCodewordCount(t,e){let n=e[0][1],r=n.getValue(),i=t.getBarcodeColumnCount()*t.getBarcodeRowCount()-tt.getNumberOfECCodeWords(t.getBarcodeECLevel());if(r.length===0){if(i<1||i>K.MAX_CODEWORDS_IN_BARCODE)throw b.getNotFoundInstance();n.setValue(i)}else r[0]!==i&&n.setValue(i)}static createDecoderResult(t){let e=tt.createBarcodeMatrix(t);tt.adjustCodewordCount(t,e);let n=new Array,r=new Int32Array(t.getBarcodeRowCount()*t.getBarcodeColumnCount()),i=[],s=new Array;for(let a=0;a<t.getBarcodeRowCount();a++)for(let l=0;l<t.getBarcodeColumnCount();l++){let c=e[a][l+1].getValue(),f=a*t.getBarcodeColumnCount()+l;c.length===0?n.push(f):c.length===1?r[f]=c[0]:(s.push(f),i.push(c))}let o=new Array(i.length);for(let a=0;a<o.length;a++)o[a]=i[a];return tt.createDecoderResultFromAmbiguousValues(t.getBarcodeECLevel(),r,K.toIntArray(n),K.toIntArray(s),o)}static createDecoderResultFromAmbiguousValues(t,e,n,r,i){let s=new Int32Array(r.length),o=100;for(;o-- >0;){for(let a=0;a<s.length;a++)e[r[a]]=i[a][s[a]];try{return tt.decodeCodewords(e,t,n)}catch(a){if(!(a instanceof et))throw a}if(s.length===0)throw et.getChecksumInstance();for(let a=0;a<s.length;a++)if(s[a]<i[a].length-1){s[a]++;break}else if(s[a]=0,a===s.length-1)throw et.getChecksumInstance()}throw et.getChecksumInstance()}static createBarcodeMatrix(t){let e=Array.from({length:t.getBarcodeRowCount()},()=>new Array(t.getBarcodeColumnCount()+2));for(let r=0;r<e.length;r++)for(let i=0;i<e[r].length;i++)e[r][i]=new cn;let n=0;for(let r of t.getDetectionResultColumns()){if(r!=null){for(let i of r.getCodewords())if(i!=null){let s=i.getRowNumber();if(s>=0){if(s>=e.length)continue;e[s][n].setValue(i.getValue())}}}n++}return e}static isValidBarcodeColumn(t,e){return e>=0&&e<=t.getBarcodeColumnCount()+1}static getStartColumn(t,e,n,r){let i=r?1:-1,s=null;if(tt.isValidBarcodeColumn(t,e-i)&&(s=t.getDetectionResultColumn(e-i).getCodeword(n)),s!=null)return r?s.getEndX():s.getStartX();if(s=t.getDetectionResultColumn(e).getCodewordNearby(n),s!=null)return r?s.getStartX():s.getEndX();if(tt.isValidBarcodeColumn(t,e-i)&&(s=t.getDetectionResultColumn(e-i).getCodewordNearby(n)),s!=null)return r?s.getEndX():s.getStartX();let o=0;for(;tt.isValidBarcodeColumn(t,e-i);){e-=i;for(let a of t.getDetectionResultColumn(e).getCodewords())if(a!=null)return(r?a.getEndX():a.getStartX())+i*o*(a.getEndX()-a.getStartX());o++}return r?t.getBoundingBox().getMinX():t.getBoundingBox().getMaxX()}static detectCodeword(t,e,n,r,i,s,o,a){i=tt.adjustCodewordStartColumn(t,e,n,r,i,s);let l=tt.getModuleBitCount(t,e,n,r,i,s);if(l==null)return null;
14let c,f=st.sum(l);if(r)c=i+f;else{for(let p=0;p<l.length/2;p++){let T=l[p];l[p]=l[l.length-1-p],l[l.length-1-p]=T}c=i,i=c-f}if(!tt.checkCodewordSkew(f,o,a))return null;let d=ne.getDecodedValue(l),C=K.getCodeword(d);return C===-1?null:new un(i,c,tt.getCodewordBucketNumber(d),C)}static getModuleBitCount(t,e,n,r,i,s){let o=i,a=new Int32Array(8),l=0,c=r?1:-1,f=r;for(;(r?o<n:o>=e)&&l<a.length;)t.get(o,s)===f?(a[l]++,o+=c):(l++,f=!f);return l===a.length||o===(r?n:e)&&l===a.length-1?a:null}static getNumberOfECCodeWords(t){return 2<<t}static adjustCodewordStartColumn(t,e,n,r,i,s){let o=i,a=r?-1:1;for(let l=0;l<2;l++){for(;(r?o>=e:o<n)&&r===t.get(o,s);){if(Math.abs(i-o)>tt.CODEWORD_SKEW_SIZE)return i;o+=a}a=-a,r=!r}return o}static checkCodewordSkew(t,e,n){return e-tt.CODEWORD_SKEW_SIZE<=t&&t<=n+tt.CODEWORD_SKEW_SIZE}static decodeCodewords(t,e,n){if(t.length===0)throw x.getFormatInstance();let r=1<<e+1,i=tt.correctErrors(t,n,r);tt.verifyCodewordCount(t,r);let s=_.decode(t,""+e);return s.setErrorsCorrected(i),s.setErasures(n.length),s}static correctErrors(t,e,n){if(e!=null&&e.length>n/2+tt.MAX_ERRORS||n<0||n>tt.MAX_EC_CODEWORDS)throw et.getChecksumInstance();return tt.errorCorrection.decode(t,n,e)}static verifyCodewordCount(t,e){if(t.length<4)throw x.getFormatInstance();let n=t[0];if(n>t.length)throw x.getFormatInstance();if(n===0)if(e<t.length)t[0]=t.length-e;else throw x.getFormatInstance()}static getBitCountForCodeword(t){let e=new Int32Array(8),n=0,r=e.length-1;for(;!((t&1)!==n&&(n=t&1,r--,r<0));)e[r]++,t>>=1;return e}static getCodewordBucketNumber(t){return t instanceof Int32Array?this.getCodewordBucketNumber_Int32Array(t):this.getCodewordBucketNumber_number(t)}static getCodewordBucketNumber_number(t){return tt.getCodewordBucketNumber(tt.getBitCountForCodeword(t))}static getCodewordBucketNumber_Int32Array(t){return(t[0]-t[2]+t[4]-t[6]+9)%9}static toString(t){let e=new an;for(let n=0;n<t.length;n++){e.format("Row %2d: ",n);for(let r=0;r<t[n].length;r++){let i=t[n][r];i.getValue().length===0?e.format(" ",null):e.format("%4d(%2d)",i.getValue()[0],i.getConfidence(i.getValue()[0]))}e.format("%n")}return e.toString()}}tt.CODEWORD_SKEW_SIZE=2,tt.MAX_ERRORS=3,tt.MAX_EC_CODEWORDS=512,tt.errorCorrection=new gr;class Wt{decode(t,e=null){let n=Wt.decode(t,e,!1);if(n==null||n.length===0||n[0]==null)throw b.getNotFoundInstance();return n[0]}decodeMultiple(t,e=null){try{return Wt.decode(t,e,!0)}catch(n){throw n instanceof x||n instanceof et?b.getNotFoundInstance():n}}static decode(t,e,n){const r=new Array,i=$.detectMultiple(t,e,n);for(const s of i.getPoints()){const o=tt.decode(i.getBits(),s[4],s[5],s[6],s[7],Wt.getMinCodewordWidth(s),Wt.getMaxCodewordWidth(s)),a=new jt(o.getText(),o.getRawBytes(),void 0,s,z.PDF_417);a.putMetadata(Ut.ERROR_CORRECTION_LEVEL,o.getECLevel());const l=o.getOther();l!=null&&a.putMetadata(Ut.PDF417_EXTRA_METADATA,l),r.push(a)}return r.map(s=>s)}static getMaxWidth(t,e){return t==null||e==null?0:Math.trunc(Math.abs(t.getX()-e.getX()))}static getMinWidth(t,e){return t==null||e==null?j.MAX_VALUE:Math.trunc(Math.abs(t.getX()-e.getX()))}static getMaxCodewordWidth(t){return Math.floor(Math.max(Math.max(Wt.getMaxWidth(t[0],t[4]),Wt.getMaxWidth(t[6],t[2])*K.MODULES_IN_CODEWORD/K.MODULES_IN_STOP_PATTERN),Math.max(Wt.getMaxWidth(t[1],t[5]),Wt.getMaxWidth(t[7],t[3])*K.MODULES_IN_CODEWORD/K.MODULES_IN_STOP_PATTERN)))}static getMinCodewordWidth(t){return Math.floor(Math.min(Math.min(Wt.getMinWidth(t[0],t[4]),Wt.getMinWidth(t[6],t[2])*K.MODULES_IN_CODEWORD/K.MODULES_IN_STOP_PATTERN),Math.min(Wt.getMinWidth(t[1],t[5]),Wt.getMinWidth(t[7],t[3])*K.MODULES_IN_CODEWORD/K.MODULES_IN_STOP_PATTERN)))}reset(){}}class Tn extends m{}Tn.kind="ReaderException";class Ir{constructor(t,e){this.verbose=t===!0,e&&this.setHints(e)}decode(t,e){return e&&this.setHints(e),this.decodeInternal(t)}decodeWithState(t){return(this.readers===null||this.readers===void 0)&&this.setHints(null),this.decodeInternal(t)}setHints(t){this.hints=t;const e=!I(t)&&t.get(gt.TRY_HARDER)===!0,n=I(t)?null:t.get(gt.POSSIBLE_FORMATS),r=new Array;if(!I(n)){const i=n.some(s=>s===z.UPC_A||s===z.UPC_E||s===z.EAN_13||s===z.EAN_8||s===z.CODABAR||s===z.CODE_39||s===z.CODE_93||s===z.CODE_128||s===z.ITF||s===z.RSS_14||s===z.RSS_EXPANDED);i&&!e&&r.push(new Ze(t,this.verbose)),n.includes(z.QR_CODE)&&r.push(new ve),n.includes(z.DATA_MATRIX)&&r.push(new Me),n.includes(z.AZTEC)&&r.push(new En),n.includes(z.PDF_417)&&r.push(new Wt),i&&e&&r.push(new Ze(t,this.verbose))}r.length===0&&(e||r.push(new Ze(t,this.verbose)),r.push(new ve),r.push(new Me),r.push(new En),r.push(new Wt),e&&r.push(new Ze(t,this.verbose))),this.readers=r}reset(){if(this.readers!==null)for(const t of this.readers)t.reset()}decodeInternal(t){if(this.readers===null)throw new Tn("No readers where selected, nothing can be read.");for(const e of this.readers)try{return e.decode(t,this.hints)}catch(n){if(n instanceof Tn)continue}throw new b("No MultiFormat Readers were able to detect the code.")}}class ri extends Le{constructor(t=null,e=500){const n=new Ir;n.setHints(t),super(n,e)}decodeBitmap(t){return this.reader.decodeWithState(t)}}class ii extends Le{constructor(t=500){super(new Wt,t)}}class si extends Le{constructor(t=500){super(new ve,t)}}var Kn;(function(u){u[u.ERROR_CORRECTION=0]="ERROR_CORRECTION",u[u.CHARACTER_SET=1]="CHARACTER_SET",u[u.DATA_MATRIX_SHAPE=2]="DATA_MATRIX_SHAPE",u[u.MIN_SIZE=3]="MIN_SIZE",u[u.MAX_SIZE=4]="MAX_SIZE",u[u.MARGIN=5]="MARGIN",u[u.PDF417_COMPACT=6]="PDF417_COMPACT",u[u.PDF417_COMPACTION=7]="PDF417_COMPACTION",u[u.PDF417_DIMENSIONS=8]="PDF417_DIMENSIONS",u[u.AZTEC_LAYERS=9]="AZTEC_LAYERS",u[u.QR_VERSION=10]="QR_VERSION"})(Kn||(Kn={}));var Lt=Kn;class jn{constructor(t){this.field=t,this.cachedGenerators=[],this.cachedGenerators.push(new $t(t,Int32Array.from([1])))}buildGenerator(t){const e=this.cachedGenerators;if(t>=e.length){let n=e[e.length-1];const r=this.field;for(let i=e.length;i<=t;i++){const s=n.multiply(new $t(r,Int32Array.from([1,r.exp(i-1+r.getGeneratorBase())])));e.push(s),n=s}}return e[t]}encode(t,e){if(e===0)throw new D("No error correction bytes");const n=t.length-e;if(n<=0)throw new D("No data bytes provided");const r=this.buildGenerator(e),i=new Int32Array(n);rt.arraycopy(t,0,i,0,n);let s=new $t(this.field,i);s=s.multiplyByMonomial(e,1);const a=s.divide(r)[1].getCoefficients(),l=e-a.length;for(let c=0;c<l;c++)t[n+c]=0;rt.arraycopy(a,0,t,n+l,a.length)}}class bt{constructor(){}
14static applyMaskPenaltyRule1(t){return bt.applyMaskPenaltyRule1Internal(t,!0)+bt.applyMaskPenaltyRule1Internal(t,!1)}static applyMaskPenaltyRule2(t){let e=0;const n=t.getArray(),r=t.getWidth(),i=t.getHeight();for(let s=0;s<i-1;s++){const o=n[s];for(let a=0;a<r-1;a++){const l=o[a];l===o[a+1]&&l===n[s+1][a]&&l===n[s+1][a+1]&&e++}}return bt.N2*e}static applyMaskPenaltyRule3(t){let e=0;const n=t.getArray(),r=t.getWidth(),i=t.getHeight();for(let s=0;s<i;s++)for(let o=0;o<r;o++){const a=n[s];o+6<r&&a[o]===1&&a[o+1]===0&&a[o+2]===1&&a[o+3]===1&&a[o+4]===1&&a[o+5]===0&&a[o+6]===1&&(bt.isWhiteHorizontal(a,o-4,o)||bt.isWhiteHorizontal(a,o+7,o+11))&&e++,s+6<i&&n[s][o]===1&&n[s+1][o]===0&&n[s+2][o]===1&&n[s+3][o]===1&&n[s+4][o]===1&&n[s+5][o]===0&&n[s+6][o]===1&&(bt.isWhiteVertical(n,o,s-4,s)||bt.isWhiteVertical(n,o,s+7,s+11))&&e++}return e*bt.N3}static isWhiteHorizontal(t,e,n){e=Math.max(e,0),n=Math.min(n,t.length);for(let r=e;r<n;r++)if(t[r]===1)return!1;return!0}static isWhiteVertical(t,e,n,r){n=Math.max(n,0),r=Math.min(r,t.length);for(let i=n;i<r;i++)if(t[i][e]===1)return!1;return!0}static applyMaskPenaltyRule4(t){let e=0;const n=t.getArray(),r=t.getWidth(),i=t.getHeight();for(let a=0;a<i;a++){const l=n[a];for(let c=0;c<r;c++)l[c]===1&&e++}const s=t.getHeight()*t.getWidth();return Math.floor(Math.abs(e*2-s)*10/s)*bt.N4}static getDataMaskBit(t,e,n){let r,i;switch(t){case 0:r=n+e&1;break;case 1:r=n&1;break;case 2:r=e%3;break;case 3:r=(n+e)%3;break;case 4:r=Math.floor(n/2)+Math.floor(e/3)&1;break;case 5:i=n*e,r=(i&1)+i%3;break;case 6:i=n*e,r=(i&1)+i%3&1;break;case 7:i=n*e,r=i%3+(n+e&1)&1;break;default:throw new D("Invalid mask pattern: "+t)}return r===0}static applyMaskPenaltyRule1Internal(t,e){let n=0;const r=e?t.getHeight():t.getWidth(),i=e?t.getWidth():t.getHeight(),s=t.getArray();for(let o=0;o<r;o++){let a=0,l=-1;for(let c=0;c<i;c++){const f=e?s[o][c]:s[c][o];f===l?a++:(a>=5&&(n+=bt.N1+(a-5)),a=1,l=f)}a>=5&&(n+=bt.N1+(a-5))}return n}}bt.N1=3,bt.N2=3,bt.N3=40,bt.N4=10;class Sn{constructor(t,e){this.width=t,this.height=e;const n=new Array(e);for(let r=0;r!==e;r++)n[r]=new Uint8Array(t);this.bytes=n}getHeight(){return this.height}getWidth(){return this.width}get(t,e){return this.bytes[e][t]}getArray(){return this.bytes}setNumber(t,e,n){this.bytes[e][t]=n}setBoolean(t,e,n){this.bytes[e][t]=n?1:0}clear(t){for(const e of this.bytes)It.fill(e,t)}equals(t){if(!(t instanceof Sn))return!1;const e=t;if(this.width!==e.width||this.height!==e.height)return!1;for(let n=0,r=this.height;n<r;++n){const i=this.bytes[n],s=e.bytes[n];for(let o=0,a=this.width;o<a;++o)if(i[o]!==s[o])return!1}return!0}toString(){const t=new wt;for(let e=0,n=this.height;e<n;++e){const r=this.bytes[e];for(let i=0,s=this.width;i<s;++i)switch(r[i]){case 0:t.append(" 0");break;case 1:t.append(" 1");break;default:t.append(" ");break}t.append(` 15`)}return t.toString()}}class Ve{constructor(){this.maskPattern=-1}getMode(){return this.mode}getECLevel(){return this.ecLevel}getVersion(){return this.version}getMaskPattern(){return this.maskPattern}getMatrix(){return this.matrix}toString(){const t=new wt;return t.append(`<< 16`),t.append(" mode: "),t.append(this.mode?this.mode.toString():"null"),t.append(` 17 ecLevel: `),t.append(this.ecLevel?this.ecLevel.toString():"null"),t.append(` 18 version: `),t.append(this.version?this.version.toString():"null"),t.append(` 19 maskPattern: `),t.append(this.maskPattern.toString()),this.matrix?(t.append(` 20 matrix: 21`),t.append(this.matrix.toString())):t.append(` 22 matrix: null 23`),t.append(`>> 24`),t.toString()}setMode(t){this.mode=t}setECLevel(t){this.ecLevel=t}setVersion(t){this.version=t}setMaskPattern(t){this.maskPattern=t}setMatrix(t){this.matrix=t}static isValidMaskPattern(t){return t>=0&&t<Ve.NUM_MASK_PATTERNS}}Ve.NUM_MASK_PATTERNS=8;class Ct extends m{}Ct.kind="WriterException";class Z{constructor(){}static clearMatrix(t){t.clear(255)}static buildMatrix(t,e,n,r,i){Z.clearMatrix(i),Z.embedBasicPatterns(n,i),Z.embedTypeInfo(e,r,i),Z.maybeEmbedVersionInfo(n,i),Z.embedDataBits(t,r,i)}static embedBasicPatterns(t,e){Z.embedPositionDetectionPatternsAndSeparators(e),Z.embedDarkD
24otAtLeftBottomCorner(e),Z.maybeEmbedPositionAdjustmentPatterns(t,e),Z.embedTimingPatterns(e)}static embedTypeInfo(t,e,n){const r=new at;Z.makeTypeInfoBits(t,e,r);for(let i=0,s=r.getSize();i<s;++i){const o=r.get(r.getSize()-1-i),a=Z.TYPE_INFO_COORDINATES[i],l=a[0],c=a[1];if(n.setBoolean(l,c,o),i<8){const f=n.getWidth()-i-1;n.setBoolean(f,8,o)}else{const d=n.getHeight()-7+(i-8);n.setBoolean(8,d,o)}}}static maybeEmbedVersionInfo(t,e){if(t.getVersionNumber()<7)return;const n=new at;Z.makeVersionInfoBits(t,n);let r=6*3-1;for(let i=0;i<6;++i)for(let s=0;s<3;++s){const o=n.get(r);r--,e.setBoolean(i,e.getHeight()-11+s,o),e.setBoolean(e.getHeight()-11+s,i,o)}}static embedDataBits(t,e,n){let r=0,i=-1,s=n.getWidth()-1,o=n.getHeight()-1;for(;s>0;){for(s===6&&(s-=1);o>=0&&o<n.getHeight();){for(let a=0;a<2;++a){const l=s-a;if(!Z.isEmpty(n.get(l,o)))continue;let c;r<t.getSize()?(c=t.get(r),++r):c=!1,e!==255&&bt.getDataMaskBit(e,l,o)&&(c=!c),n.setBoolean(l,o,c)}o+=i}i=-i,o+=i,s-=2}if(r!==t.getSize())throw new Ct("Not all bits consumed: "+r+"/"+t.getSize())}static findMSBSet(t){return 32-j.numberOfLeadingZeros(t)}static calculateBCHCode(t,e){if(e===0)throw new D("0 polynomial");const n=Z.findMSBSet(e);for(t<<=n-1;Z.findMSBSet(t)>=n;)t^=e<<Z.findMSBSet(t)-n;return t}static makeTypeInfoBits(t,e,n){if(!Ve.isValidMaskPattern(e))throw new Ct("Invalid mask pattern");const r=t.getBits()<<3|e;n.appendBits(r,5);const i=Z.calculateBCHCode(r,Z.TYPE_INFO_POLY);n.appendBits(i,10);const s=new at;if(s.appendBits(Z.TYPE_INFO_MASK_PATTERN,15),n.xor(s),n.getSize()!==15)throw new Ct("should not happen but we got: "+n.getSize())}static makeVersionInfoBits(t,e){e.appendBits(t.getVersionNumber(),6);const n=Z.calculateBCHCode(t.getVersionNumber(),Z.VERSION_INFO_POLY);if(e.appendBits(n,12),e.getSize()!==18)throw new Ct("should not happen but we got: "+e.getSize())}static isEmpty(t){return t===255}static embedTimingPatterns(t){for(let e=8;e<t.getWidth()-8;++e){const n=(e+1)%2;Z.isEmpty(t.get(e,6))&&t.setNumber(e,6,n),Z.isEmpty(t.get(6,e))&&t.setNumber(6,e,n)}}static embedDarkDotAtLeftBottomCorner(t){if(t.get(8,t.getHeight()-8)===0)throw new Ct;t.setNumber(8,t.getHeight()-8,1)}static embedHorizontalSeparationPattern(t,e,n){for(let r=0;r<8;++r){if(!Z.isEmpty(n.get(t+r,e)))throw new Ct;n.setNumber(t+r,e,0)}}static embedVerticalSeparationPattern(t,e,n){for(let r=0;r<7;++r){if(!Z.isEmpty(n.get(t,e+r)))throw new Ct;n.setNumber(t,e+r,0)}}static embedPositionAdjustmentPattern(t,e,n){for(let r=0;r<5;++r){const i=Z.POSITION_ADJUSTMENT_PATTERN[r];for(let s=0;s<5;++s)n.setNumber(t+s,e+r,i[s])}}static embedPositionDetectionPattern(t,e,n){for(let r=0;r<7;++r){const i=Z.POSITION_DETECTION_PATTERN[r];for(let s=0;s<7;++s)n.setNumber(t+s,e+r,i[s])}}static embedPositionDetectionPatternsAndSeparators(t){const e=Z.POSITION_DETECTION_PATTERN[0].length;Z.embedPositionDetectionPattern(0,0,t),Z.embedPositionDetectionPattern(t.getWidth()-e,0,t),Z.embedPositionDetectionPattern(0,t.getWidth()-e,t);const n=8;Z.embedHorizontalSeparationPattern(0,n-1,t),Z.embedHorizontalSeparationPattern(t.getWidth()-n,n-1,t),Z.embedHorizontalSeparationPattern(0,t.getWidth()-n,t);const r=7;Z.embedVerticalSeparationPattern(r,0,t),Z.embedVerticalSeparationPattern(t.getHeight()-r-1,0,t),Z.embedVerticalSeparationPattern(r,t.getHeight()-r,t)}static maybeEmbedPositionAdjustmentPatterns(t,e){if(t.getVersionNumber()<2)return;const n=t.getVersionNumber()-1,r=Z.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n];for(let i=0,s=r.length;i!==s;i++){const o=r[i];if(o>=0)for(let a=0;a!==s;a++){const l=r[a];l>=0&&Z.isEmpty(e.get(l,o))&&Z.embedPositionAdjustmentPattern(l-2,o-2,e)}}}}Z.POSITION_DETECTION_PATTERN=Array.from([Int32Array.from([1,1,1,1,1,1,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,1,1,1,0,1]),Int32Array.from([1,0,0,0,0,0,1]),Int32Array.from([1,1,1,1,1,1,1])]),Z.PO
vendor: 4,412 bytes, line 24
24SITION_ADJUSTMENT_PATTERN=Array.from([Int32Array.from([1,1,1,1,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,0,1,0,1]),Int32Array.from([1,0,0,0,1]),Int32Array.from([1,1,1,1,1])]),Z.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE=Array.from([Int32Array.from([-1,-1,-1,-1,-1,-1,-1]),Int32Array.from([6,18,-1,-1,-1,-1,-1]),Int32Array.from([6,22,-1,-1,-1,-1,-1]),Int32Array.from([6,26,-1,-1,-1,-1,-1]),Int32Array.from([6,30,-1,-1,-1,-1,-1]),Int32Array.from([6,34,-1,-1,-1,-1,-1]),Int32Array.from([6,22,38,-1,-1,-1,-1]),Int32Array.from([6,24,42,-1,-1,-1,-1]),Int32Array.from([6,26,46,-1,-1,-1,-1]),Int32Array.from([6,28,50,-1,-1,-1,-1]),Int32Array.from([6,30,54,-1,-1,-1,-1]),Int32Array.from([6,32,58,-1,-1,-1,-1]),Int32Array.from([6,34,62,-1,-1,-1,-1]),Int32Array.from([6,26,46,66,-1,-1,-1]),Int32Array.from([6,26,48,70,-1,-1,-1]),Int32Array.from([6,26,50,74,-1,-1,-1]),Int32Array.from([6,30,54,78,-1,-1,-1]),Int32Array.from([6,30,56,82,-1,-1,-1]),Int32Array.from([6,30,58,86,-1,-1,-1]),Int32Array.from([6,34,62,90,-1,-1,-1]),Int32Array.from([6,28,50,72,94,-1,-1]),Int32Array.from([6,26,50,74,98,-1,-1]),Int32Array.from([6,30,54,78,102,-1,-1]),Int32Array.from([6,28,54,80,106,-1,-1]),Int32Array.from([6,32,58,84,110,-1,-1]),Int32Array.from([6,30,58,86,114,-1,-1]),Int32Array.from([6,34,62,90,118,-1,-1]),Int32Array.from([6,26,50,74,98,122,-1]),Int32Array.from([6,30,54,78,102,126,-1]),Int32Array.from([6,26,52,78,104,130,-1]),Int32Array.from([6,30,56,82,108,134,-1]),Int32Array.from([6,34,60,86,112,138,-1]),Int32Array.from([6,30,58,86,114,142,-1]),Int32Array.from([6,34,62,90,118,146,-1]),Int32Array.from([6,30,54,78,102,126,150]),Int32Array.from([6,24,50,76,102,128,154]),Int32Array.from([6,28,54,80,106,132,158]),Int32Array.from([6,32,58,84,110,136,162]),Int32Array.from([6,26,54,82,110,138,166]),Int32Array.from([6,30,58,86,114,142,170])]),Z.TYPE_INFO_COORDINATES=Array.from([Int32Array.from([8,0]),Int32Array.from([8,1]),Int32Array.from([8,2]),Int32Array.from([8,3]),Int32Array.from([8,4]),Int32Array.from([8,5]),Int32Array.from([8,7]),Int32Array.from([8,8]),Int32Array.from([7,8]),Int32Array.from([5,8]),Int32Array.from([4,8]),Int32Array.from([3,8]),Int32Array.from([2,8]),Int32Array.from([1,8]),Int32Array.from([0,8])]),Z.VERSION_INFO_POLY=7973,Z.TYPE_INFO_POLY=1335,Z.TYPE_INFO_MASK_PATTERN=21522;class oi{constructor(t,e){this.dataBytes=t,this.errorCorrectionBytes=e}getDataBytes(){return this.dataBytes}getErrorCorrectionBytes(){return this.errorCorrectionBytes}}class Tt{constructor(){}static calculateMaskPenalty(t){return bt.applyMaskPenaltyRule1(t)+bt.applyMaskPenaltyRule2(t)+bt.applyMaskPenaltyRule3(t)+bt.applyMaskPenaltyRule4(t)}static encode(t,e,n=null){let r=Tt.DEFAULT_BYTE_MODE_ENCODING;const i=n!==null&&n.get(Lt.CHARACTER_SET)!==void 0;i&&(r=n.get(Lt.CHARACTER_SET).toString());const s=this.chooseMode(t,r),o=new at;if(s===Y.BYTE&&(i||Tt.DEFAULT_BYTE_MODE_ENCODING!==r)){const k=F.getCharacterSetECIByName(r);k!==void 0&&this.appendECI(k,o)}this.appendModeInfo(s,o);const a=new at;this.appendBytes(t,s,a,r);let l;if(n!==null&&n.get(Lt.QR_VERSION)!==void 0){const k=Number.parseInt(n.get(Lt.QR_VERSION).toString(),10);l=X.getVersionForNumber(k);const v=this.calculateBitsNeeded(s,o,a,l);if(!this.willFit(v,l,e))throw new Ct("Data too big for requested version")}else l=this.recommendVersion(e,s,o,a);const c=new at;c.appendBitArray(o);const f=s===Y.BYTE?a.getSizeInBytes():t.length;this.appendLengthInfo(f,l,s,c),c.appendBitArray(a);const d=l.getECBlocksForLevel(e),C=l.getTotalCodewords()-d.getTotalECCodewords();this.terminateBits(C,c);const p=this.interleaveWithECBytes(c,l.getTotalCodewords(),C,d.getNumBlocks()),T=new Ve;T.setECLevel(e),T.setMode(s),T.setVersion(l);const S=l.getDimensionForVersion(),O=new Sn(S,S),B=this.chooseMaskPattern(p,e,l,O);return T.setMaskPattern(B),Z.buildMatrix(p,e,l,B,O),T.setMatrix(O),T}static recommendVersion(t,e,n,r){const i=this.calculateBitsNeeded(e,n,r,X.getVersionForNumber(1)),s=this.chooseVersion(i,t),o=this.calculateBitsNeeded(e,n,r,s);return this.chooseVersion(o,t)}static calculateBitsNeeded(t,e,n,r){return e.getSize()+t.getCharacterCountBits(r)+n.getSize()}static getAlphanumericCode(t){return t<Tt.ALPHANUMERIC_TABLE.length?Tt.ALPHANUMERIC_TABLE[t]:-1}static chooseMode(t,e=null){if(F.SJIS.getName()===e&&this.isOnlyDoubleByteKanji(t))return Y.KANJI;let n=!1,r=!1;for(let i=0,s=t.length;i<s;++i){const o=t.charAt(i);if(Tt.isDigit(o))n=!0;
24else if(this.getAlphanumericCode(o.charCodeAt(0))!==-1)r=!0;else return Y.BYTE}return r?Y.ALPHANUMERIC:n?Y.NUMERIC:Y.BYTE}static isOnlyDoubleByteKanji(t){let e;try{e=Jt.encode(t,F.SJIS)}catch{return!1}const n=e.length;if(n%2!==0)return!1;for(let r=0;r<n;r+=2){const i=e[r]&255;if((i<129||i>159)&&(i<224||i>235))return!1}return!0}static chooseMaskPattern(t,e,n,r){let i=Number.MAX_SAFE_INTEGER,s=-1;for(let o=0;o<Ve.NUM_MASK_PATTERNS;o++){Z.buildMatrix(t,e,n,o,r);let a=this.calculateMaskPenalty(r);a<i&&(i=a,s=o)}return s}static chooseVersion(t,e){for(let n=1;n<=40;n++){const r=X.getVersionForNumber(n);if(Tt.willFit(t,r,e))return r}throw new Ct("Data too big")}static willFit(t,e,n){const r=e.getTotalCodewords(),s=e.getECBlocksForLevel(n).getTotalECCodewords(),o=r-s,a=(t+7)/8;return o>=a}static terminateBits(t,e){const n=t*8;if(e.getSize()>n)throw new Ct("data bits cannot fit in the QR Code"+e.getSize()+" > "+n);for(let s=0;s<4&&e.getSize()<n;++s)e.appendBit(!1);const r=e.getSize()&7;if(r>0)for(let s=r;s<8;s++)e.appendBit(!1);const i=t-e.getSizeInBytes();for(let s=0;s<i;++s)e.appendBits(s&1?17:236,8);if(e.getSize()!==n)throw new Ct("Bits size does not equal capacity")}static getNumDataBytesAndNumECBytesForBlockID(t,e,n,r,i,s){if(r>=n)throw new Ct("Block ID too large");const o=t%n,a=n-o,l=Math.floor(t/n),c=l+1,f=Math.floor(e/n),d=f+1,C=l-f,p=c-d;if(C!==p)throw new Ct("EC bytes mismatch");if(n!==a+o)throw new Ct("RS blocks mismatch");if(t!==(f+C)*a+(d+p)*o)throw new Ct("Total bytes mismatch");r<a?(i[0]=f,s[0]=C):(i[0]=d,s[0]=p)}static interleaveWithECBytes(t,e,n,r){if(t.getSizeInBytes()!==n)throw new Ct("Number of bits and data bytes does not match");let i=0,s=0,o=0;const a=new Array;for(let c=0;c<r;++c){const f=new Int32Array(1),d=new Int32Array(1);Tt.getNumDataBytesAndNumECBytesForBlockID(e,n,r,c,f,d);const C=f[0],p=new Uint8Array(C);t.toBytes(8*i,p,0,C);const T=Tt.generateECBytes(p,d[0]);a.push(new oi(p,T)),s=Math.max(s,C),o=Math.max(o,T.length),i+=f[0]}if(n!==i)throw new Ct("Data bytes does not match offset");const l=new at;for(let c=0;c<s;++c)for(const f of a){const d=f.getDataBytes();c<d.length&&l.appendBits(d[c],8)}for(let c=0;c<o;++c)for(const f of a){const d=f.getErrorCorrectionBytes();c<d.length&&l.appendBits(d[c],8)}if(e!==l.getSizeInBytes())throw new Ct("Interleaving error: "+e+" and "+l.getSizeInBytes()+" differ.");return l}static generateECBytes(t,e){const n=t.length,r=new Int32Array(n+e);for(let s=0;s<n;s++)r[s]=t[s]&255;new jn(lt.QR_CODE_FIELD_256).encode(r,e);const i=new Uint8Array(e);for(let s=0;s<e;s++)i[s]=r[n+s];return i}static appendModeInfo(t,e){e.appendBits(t.getBits(),4)}static appendLengthInfo(t,e,n,r){const i=n.getCharacterCountBits(e);if(t>=1<<i)throw new Ct(t+" is bigger than "+((1<<i)-1));r.appendBits(t,i)}static appendBytes(t,e,n,r){switch(e){case Y.NUMERIC:Tt.appendNumericBytes(t,n);break;case Y.ALPHANUMERIC:Tt.appendAlphanumericBytes(t,n);break;case Y.BYTE:Tt.append8BitBytes(t,n,r);break;case Y.KANJI:Tt.appendKanjiBytes(t,n);break;default:throw new Ct("Invalid mode: "+e)}}static getDigit(t){return t.charCodeAt(0)-48}static isDigit(t){const e=Tt.getDigit(t);return e>=0&&e<=9}static appendNumericBytes(t,e){const n=t.length;let r=0;for(;r<n;){const i=Tt.getDigit(t.charAt(r));if(r+2<n){const s=Tt.getDigit(t.charAt(r+1)),o=Tt.getDigit(t.charAt(r+2));e.appendBits(i*100+s*10+o,10),r+=3}else if(r+1<n){const s=Tt.getDigit(t.charAt(r+1));e.appendBits(i*10+s,7),r+=2}else e.appendBits(i,4),r++}}static appendAlphanumericBytes(t,e){const n=t.length;let r=0;for(;r<n;){const i=Tt.getAlphanumericCode(t.charCodeAt(r));if(i===-1)throw new Ct;if(r+1<n){const s=Tt.getAlphanumericCode(t.charCodeAt(r+1));if(s===-1)throw new Ct;e.appendBits(i*45+s,11),r+=2}else e.appendBits(i,6),r++}}static append8BitBytes(t,e,n){let r;try{r=Jt.encode(t,n)}catch(i){throw new Ct(i)}for(let i=0,s=r.length;i!==s;i++){const o=r[i];e.appendBits(o,8)}}static appendKanjiBytes(t,e){let n;try{n=Jt.encode(t,F.SJIS)}catch(i){throw new Ct(i)}const r=n.length;for(let i=0;i<r;i+=2){const s=n[i]&255,o=n[i+1]&255,a=s<<8&4294967295|o;let l=-1;if(a>=33088&&a<=40956?l=a-33088:a>=57408&&a<=60351&&(l=a-49472),l===-1)throw new Ct("Invalid byte sequence");const c=(l>>8)*192+(l&255);e.appendBits(c,13)}}static appendECI(t,e){e.appendBits(Y.ECI.getBits(),4),e.appendBits(t.getValue(),8)}}Tt.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]),Tt.DEFAULT_BYTE_MODE_ENCODING=F.UTF8.getName();class Ge{write(t,e,n,r=null){if(t.length===0)throw new D("Found empty contents");if(e<0||n<0)throw new D("Requested dimensions are too small: "+e+"x"+n);let i=yt.L,s=Ge.QUIET_ZONE_SIZE;r!==null&&(r.get(Lt.ERROR_CORRECTION)!==void 0&&(i=yt.fromString(r.get(Lt.ERROR_CORRECTION).toString())),r.get(Lt.MARGIN)!==void 0&&(s=Number.parseInt(r.get(Lt.MARGIN).toString(),10)));const o=Tt.encode(t,i,r);return this.renderResult(o,e,n,s)}writeToDom(t,e,n,r,i=null){typeof t=="string"&&(t=document.querySelector(t));const s=this.write(e,n,r,i);t&&t.appendChild(s)}renderResult(t,e,n,r){const i=t.getMatrix();if(i===null)throw new we;const s=i.getWidth(),o=i.getHeight(),a=s+r*2,l=o+r*2,c=Math.max(e,a),f=Math.max(n,l),d=Math.min(Math.floor(c/a),Math.floor(f/l)),C=Math.floor((c-s*d)/2),p=Math.floor((f-o*d)/2),T=this.createSVGElement(c,f);for(let S=0,O=p;S<o;S++,O+=d)for(let B=0,k=C;B<s;B++,k+=d)if(i.get(B,S)===1){const v=this.createSvgRectElement(k,O,d,d);T.appendChild(v)}return T}createSVGElement(t,e){const n=document.createElementNS(Ge.SVG_NS,"svg");return n.setAttributeNS(null,"height",t.toString()),n.setAttributeNS(null,"width",e.toString()),n}createSvgRectElement(t,e,n,r){const i=document.createElementNS(Ge.SVG_NS,"rect");return i.setAttributeNS(null,"x",t.toString()),i.setAttributeNS(null,"y",e.toString()),i.setAttributeNS(null,"height",n.toString()),i.setAttributeNS(null,"width",r.toString()),i.setAttributeNS(null,"fill","#000000"),i}}Ge.QUIET_ZONE_SIZE=4,Ge.SVG_NS="http://www.w3.org/2000/svg";class je{encode(t,e,n,r,i){if(t.length===0)throw new D("Found empty contents");if(e!==z.QR_CODE)throw new D("Can only encode QR_CODE, but got "+e);if(n<0||r<0)throw new D(`Requested dimensions are too small: ${n}x${r}`);let s=yt.L,o=je.QUIET_ZONE_SIZE;i!==null&&(i.get(Lt.ERROR_CORRECTION)!==void 0&&(s=yt.fromString(i.get(Lt.ERROR_CORRECTION).toString())),i.get(Lt.MARGIN)!==void 0&&(o=Number.parseInt(i.get(Lt.MARGIN).toString(),10)));const a=Tt.encode(t,s,i);return je.renderResult(a,n,r,o)}static renderResult(t,e,n,r){const i=t.getMatrix();if(i===null)throw new we;const s=i.getWidth(),o=i.getHeight(),a=s+r*2,l=o+r*2,c=Math.max(e,a),f=Math.max(n,l),d=Math.min(Math.floor(c/a),Math.floor(f/l)),C=Math.floor((c-s*d)/2),p=Math.floor((f-o*d)/2),T=new kt(c,f);for(let S=0,O=p;S<o;S++,O+=d)for(let B=0,k=C;B<s;B++,k+=d)i.get(B,S)===1&&T.setRegion(k,O,d,d);return T}}je.QUIET_ZONE_SIZE=4;class ai{encode(t,e,n,r,i){let s;switch(e){case z.QR_CODE:s=new je;break;default:throw new D("No encoder available for format "+e)}return s.encode(t,e,n,r,i)}}class me extends tn{constructor(t,e,n,r,i,s,o,a){if(super(s,o),this.yuvData=t,this.dataWidth=e,this.dataHeight=n,this.left=r,this.top=i,r+s>e||i+o>n)throw new D("Crop rectangle does not fit within image data.");a&&this.reverseHorizontal(s,o)}getRow(t,e){if(t<0||t>=this.getHeight())throw new D("Requested row is outside the image: "+t);const n=this.getWidth();(e==null||e.length<n)&&(e=new Uint8ClampedArray(n));const r=(t+this.top)*this.dataWidth+this.left;return rt.arraycopy(this.yuvData,r,e,0,n),e}getMatrix(){const t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.yuvData;const n=t*e,r=new Uint8ClampedArray(n);let i=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return rt.arraycopy(this.yuvData,i,r,0,n),r;for(let s=0;s<e;s++){const o=s*t;rt.arraycopy(this.yuvData,i,r,o,t),i+=this.dataWidth}return r}isCropSupported(){return!0}crop(t,e,n,r){return new me(this.yuvData,this.dataWidth,this.dataHeight,this.left+t,this.top+e,n,r,!1)}renderThumbnail(){const t=this.getWidth()/me.THUMBNAIL_SCALE_FACTOR,e=this.getHeight()/me.THUMBNAIL_SCALE_FACTOR,n=new Int32Array(t*e),r=this.yuvData;let i=this.top*this.dataWidth+this.left;for(let s=0;s<e;s++){const o=s*t;for(let a=0;a<t;a++){const l=r[i+a*me.THUMBNAIL_SCALE_FACTOR]&255;n[o+a]=4278190080|l*65793}i+=this.dataWidth*me.THUMBNAIL_SCALE_FACTOR}return n}getThumbnailWidth(){return this.getWidth()/me.THUMBNAIL_SCALE_FACTOR}getThumbnailHeight(){return this.getHeight()/me.THUMBNAIL_SCALE_FACTOR}reverseHorizontal(t,e){const n=this.yuvData;for(let r=0,i=this.top*this.dataWidth+this.left;r<e;r++,i+=this.dataWidth){const s=i+t/2;
24for(let o=i,a=i+t-1;o<s;o++,a--){const l=n[o];n[o]=n[a],n[a]=l}}}invert(){return new _e(this)}}me.THUMBNAIL_SCALE_FACTOR=2;class qn extends tn{constructor(t,e,n,r,i,s,o){if(super(e,n),this.dataWidth=r,this.dataHeight=i,this.left=s,this.top=o,t.BYTES_PER_ELEMENT===4){const a=e*n,l=new Uint8ClampedArray(a);for(let c=0;c<a;c++){const f=t[c],d=f>>16&255,C=f>>7&510,p=f&255;l[c]=(d+C+p)/4&255}this.luminances=l}else this.luminances=t;if(r===void 0&&(this.dataWidth=e),i===void 0&&(this.dataHeight=n),s===void 0&&(this.left=0),o===void 0&&(this.top=0),this.left+e>this.dataWidth||this.top+n>this.dataHeight)throw new D("Crop rectangle does not fit within image data.")}getRow(t,e){if(t<0||t>=this.getHeight())throw new D("Requested row is outside the image: "+t);const n=this.getWidth();(e==null||e.length<n)&&(e=new Uint8ClampedArray(n));const r=(t+this.top)*this.dataWidth+this.left;return rt.arraycopy(this.luminances,r,e,0,n),e}getMatrix(){const t=this.getWidth(),e=this.getHeight();if(t===this.dataWidth&&e===this.dataHeight)return this.luminances;const n=t*e,r=new Uint8ClampedArray(n);let i=this.top*this.dataWidth+this.left;if(t===this.dataWidth)return rt.arraycopy(this.luminances,i,r,0,n),r;for(let s=0;s<e;s++){const o=s*t;rt.arraycopy(this.luminances,i,r,o,t),i+=this.dataWidth}return r}isCropSupported(){return!0}crop(t,e,n,r){return new qn(this.luminances,n,r,this.dataWidth,this.dataHeight,this.left+t,this.top+e)}invert(){return new _e(this)}}class pr extends F{static forName(t){return this.getCharacterSetECIByName(t)}}class Qn{}Qn.ISO_8859_1=F.ISO8859_1;class yr{isCompact(){return this.compact}setCompact(t){this.compact=t}getSize(){return this.size}setSize(t){this.size=t}getLayers(){return this.layers}setLayers(t){this.layers=t}getCodeWords(){return this.codeWords}setCodeWords(t){this.codeWords=t}getMatrix(){return this.matrix}setMatrix(t){this.matrix=t}}class Tr{static singletonList(t){return[t]}static min(t,e){return t.sort(e)[0]}}class li{constructor(t){this.previous=t}getPrevious(){return this.previous}}class qe extends li{constructor(t,e,n){super(t),this.value=e,this.bitCount=n}appendTo(t,e){t.appendBits(this.value,this.bitCount)}add(t,e){return new qe(this,t,e)}addBinaryShift(t,e){return console.warn("addBinaryShift on SimpleToken, this simply returns a copy of this token"),new qe(this,t,e)}toString(){let t=this.value&(1<<this.bitCount)-1;return t|=1<<this.bitCount,"<"+j.toBinaryString(t|1<<this.bitCount).substring(1)+">"}}class Jn extends qe{constructor(t,e,n){super(t,0,0),this.binaryShiftStart=e,this.binaryShiftByteCount=n}appendTo(t,e){for(let n=0;n<this.binaryShiftByteCount;n++)(n===0||n===31&&this.binaryShiftByteCount<=62)&&(t.appendBits(31,5),this.binaryShiftByteCount>62?t.appendBits(this.binaryShiftByteCount-31,16):n===0?t.appendBits(Math.min(this.binaryShiftByteCount,31),5):t.appendBits(this.binaryShiftByteCount-31,5)),t.appendBits(e[this.binaryShiftStart+n],8)}addBinaryShift(t,e){return new Jn(this,t,e)}toString(){return"<"+this.binaryShiftStart+"::"+(this.binaryShiftStart+this.binaryShiftByteCount-1)+">"}}function ci(u,t,e){return new Jn(u,t,e)}function fn(u,t,e){return new qe(u,t,e)}const hi=["UPPER","LOWER","DIGIT","MIXED","PUNCT"],Pe=0,Nn=1,he=2,Sr=3,Ie=4,ui=new qe(null,0,0),$n=[Int32Array.from([0,(5<<16)+28,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(9<<16)+480+14,0,(5<<16)+30,(5<<16)+29,656318]),Int32Array.from([(4<<16)+14,(9<<16)+448+28,0,(9<<16)+448+29,932798]),Int32Array.from([(5<<16)+29,(5<<16)+28,656318,0,(5<<16)+30]),Int32Array.from([(5<<16)+31,656380,656382,656381,0])];function fi(u){for(let t of u)It.fill(t,-1);return u[Pe][Ie]=0,u[Nn][Ie]=0,u[Nn][Pe]=28,u[Sr][Ie]=0,u[he][Ie]=0,u[he][Pe]=15,u}const Nr=fi(It.createInt32Array(6,6));class pe{constructor(t,e,n,r){this.token=t,this.mode=e,this.binaryShiftByteCount=n,this.bitCount=r}getMode(){return this.mode}getToken(){return this.token}getBinaryShiftByteCount(){return this.binaryShiftByteCount}getBitCount(){return this.bitCount}latchAndAppend(t,e){let n=this.bitCount,r=this.token;if(t!==this.mode){let s=$n[this.mode][t];r=fn(r,s&65535,s>>16),n+=s>>16}let i=t===he?4:5;return r=fn(r,e,i),new pe(r,t,0,n+i)}shiftAndAppend(t,e){let n=this.token,r=this.mode===he?4:5;return n=fn(n,Nr[this.mode][t],r),n=fn(n,e,5),new pe(n,this.mode,0,this.bitCount+r+5)}addBinaryShiftChar(t){let e=this.token,n=this.mode,r=this.bitCount;if(this.mode===Ie||this.mode===he){let o=$n[n][Pe];e=fn(e,o&65535,o>>16),r+=o>>16,n=Pe}let i=this.binaryShiftByteCount===0||this.binaryShiftByteCount===31?18:this.binaryShiftByteCount===62?9:8,s=new pe(e,n,this.binaryShiftByteCount+1,r+i);return s.binaryShiftByteCount===2078&&(s=s.endBinaryShift(t+1)),s}endBinaryShift(t){if(this.binaryShiftByteCount===0)return this;let e=this.token;return e=ci(e,t-this.binaryShiftByteCount,this.binaryShiftByteCount),new pe(e,this.mode,0,this.bitCount)}
24isBetterThanOrEqualTo(t){let e=this.bitCount+($n[this.mode][t.mode]>>16);return this.binaryShiftByteCount<t.binaryShiftByteCount?e+=pe.calculateBinaryShiftCost(t)-pe.calculateBinaryShiftCost(this):this.binaryShiftByteCount>t.binaryShiftByteCount&&t.binaryShiftByteCount>0&&(e+=10),e<=t.bitCount}toBitArray(t){let e=[];for(let r=this.endBinaryShift(t.length).token;r!==null;r=r.getPrevious())e.unshift(r);let n=new at;for(const r of e)r.appendTo(n,t);return n}toString(){return q.format("%s bits=%d bytes=%d",hi[this.mode],this.bitCount,this.binaryShiftByteCount)}static calculateBinaryShiftCost(t){return t.binaryShiftByteCount>62?21:t.binaryShiftByteCount>31?20:t.binaryShiftByteCount>0?10:0}}pe.INITIAL_STATE=new pe(ui,Pe,0,0);function di(u){const t=q.getCharCode(" "),e=q.getCharCode("."),n=q.getCharCode(",");u[Pe][t]=1;const r=q.getCharCode("Z"),i=q.getCharCode("A");for(let d=i;d<=r;d++)u[Pe][d]=d-i+2;u[Nn][t]=1;const s=q.getCharCode("z"),o=q.getCharCode("a");for(let d=o;d<=s;d++)u[Nn][d]=d-o+2;u[he][t]=1;const a=q.getCharCode("9"),l=q.getCharCode("0");for(let d=l;d<=a;d++)u[he][d]=d-l+2;u[he][n]=12,u[he][e]=13;const c=["\0"," ","�","�","�","�","�","�","\x07","\b"," ",` 25`,"\v","\f","\r","\x1B","�","�","�","�","@","\\","^","_","`","|","~","�"];for(let d=0;d<c.length;d++)u[Sr][q.getCharCode(c[d])]=d;const f=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let d=0;d<f.length;d++)q.getCharCode(f[d])>0&&(u[Ie][q.getCharCode(f[d])]=d);return u}const tr=di(It.createInt32Array(5,256));class dn{constructor(t){this.text=t}encode(){const t=q.getCharCode(" "),e=q.getCharCode(` 26`);let n=Tr.singletonList(pe.INITIAL_STATE);for(let i=0;i<this.text.length;i++){let s,o=i+1<this.text.length?this.text[i+1]:0;switch(this.text[i]){case q.getCharCode("\r"):s=o===e?2:0;break;case q.getCharCode("."):s=o===t?3:0;break;case q.getCharCode(","):s=o===t?4:0;break;case q.getCharCode(":"):s=o===t?5:0;break;default:s=0}s>0?(n=dn.updateStateListForPair(n,i,s),i++):n=this.updateStateListForChar(n,i)}return Tr.min(n,(i,s)=>i.getBitCount()-s.getBitCount()).toBitArray(this.text)}updateStateListForChar(t,e){const n=[];for(let r of t)this.updateStateForChar(r,e,n);return dn.simplifyStates(n)}updateStateForChar(t,e,n){let r=this.text[e]&255,i=tr[t.getMode()][r]>0,s=null;for(let o=0;o<=Ie;o++){let a=tr[o][r];if(a>0){if(s==null&&(s=t.endBinaryShift(e)),!i||o===t.getMode()||o===he){const l=s.latchAndAppend(o,a);n.push(l)}if(!i&&Nr[t.getMode()][o]>=0){const l=s.shiftAndAppend(o,a);n.push(l)}}}if(t.getBinaryShiftByteCount()>0||tr[t.getMode()][r]===0){let o=t.addBinaryShiftChar(e);n.push(o)}}static updateStateListForPair(t,e,n){const r=[];for(let i of t)this.updateStateForPair(i,e,n,r);return this.simplifyStates(r)}static updateStateForPair(t,e,n,r){let i=t.endBinaryShift(e);if(r.push(i.latchAndAppend(Ie,n)),t.getMode()!==Ie&&r.push(i.shiftAndAppend(Ie,n)),n===3||n===4){let s=i.latchAndAppend(he,16-n).latchAndAppend(he,1);r.push(s)}if(t.getBinaryShiftByteCount()>0){let s=t.addBinaryShiftChar(e).addBinaryShiftChar(e+1);r.push(s)}}static simplifyStates(t){let e=[];for(const n of t){let r=!0;for(const i of e){if(i.isBetterThanOrEqualTo(n)){r=!1;break}n.isBetterThanOrEqualTo(i)&&(e=e.filter(s=>s!==i))}r&&e.push(n)}return e}}class ot{constructor(){}static encodeBytes(t){return ot.encode(t,ot.DEFAULT_EC_PERCENT,ot.DEFAULT_AZTEC_LAYERS)}static encode(t,e,n){let r=new dn(t).encode(),i=j.truncDivision(r.getSize()*e,100)+11,s=r.getSize()+i,o,a,l,c,f;if(n!==ot.DEFAULT_AZTEC_LAYERS){if(o=n<0,a=Math.abs(n),a>(o?ot.MAX_NB_BITS_COMPACT:ot.MAX_NB_BITS))throw new D(q.format("Illegal value %s for layers",n));l=ot.totalBitsInLayer(a,o),c=ot.WORD_SIZE[a];let v=l-l%c;if(f=ot.stuffBits(r,c),f.getSize()+i>v)throw new D("Data to large for user specified layer");if(o&&f.getSize()>c*64)throw new D("Data to large for user specified layer")}else{c=0,f=null;for(let v=0;;v++){if(v>ot.MAX_NB_BITS)throw new D("Data too large for an Aztec code");if(o=v<=3,a=o?v+1:v,l=ot.totalBitsInLayer(a,o),s>l)continue;(f==null||c!==ot.WORD_SIZE[a])&&(c=ot.WORD_SIZE[a],f=ot.stuffBits(r,c));let nt=l-l%c;if(!(o&&f.getSize()>c*64)&&f.getSize()+i<=nt)break}}let d=ot.generateCheckWords(f,l,c),C=f.getSize()/c,p=ot.generateModeMessage(o,a,C),T=(o?11:14)+a*4,S=new Int32Array(T),O;if(o){O=T;for(let v=0;v<S.length;v++)S[v]=v}else{O=T+1+2*j.truncDivision(j.truncDivision(T,2)-1,15);let v=j.truncDivision(T,2),nt=j.truncDivision(O,2);for(let Q=0;Q<v;Q++){let re=Q+j.truncDivision(Q,15);S[v-Q-1]=nt-re-1,S[v+Q]=nt+re+1}}let B=new kt(O);for(let v=0,nt=0;v<a;v++){let Q=(a-v)*4+(o?9:12);for(let re=0;re<Q;re++){let de=re*2;for(let ie=0;ie<2;ie++)d.get(nt+de+ie)&&B.set(S[v*2+ie],S[v*2+re]),d.get(nt+Q*2+de+ie)&&B.set(S[v*2+re],S[T-1-v*2-ie]),d.get(nt+Q*4+de+ie)&&B.set(S[T-1-v*2-ie],S[T-1-v*2-re]),d.get(nt+Q*6+de+ie)&&B.set(S[T-1-v*2-re],S[v*2+ie])}nt+=Q*8}if(ot.drawModeMessage(B,o,O,p),o)ot.drawBullsEye(B,j.truncDivision(O,2),5);else{ot.drawBullsEye(B,j.truncDivision(O,2),7);for(let v=0,nt=0;v<j.truncDivision(T,2)-1;v+=15,nt+=16)for(let Q=j.truncDivision(O,2)&1;Q<O;Q+=2)B.set(j.truncDivision(O,2)-nt,Q),B.set(j.truncDivision(O,2)+nt,Q),B.set(Q,j.truncDivision(O,2)-nt),B.set(Q,j.truncDivision(O,2)+nt)}let k=new yr;
vendor: 2,685 bytes, line 26
26return k.setCompact(o),k.setSize(O),k.setLayers(a),k.setCodeWords(C),k.setMatrix(B),k}static drawBullsEye(t,e,n){for(let r=0;r<n;r+=2)for(let i=e-r;i<=e+r;i++)t.set(i,e-r),t.set(i,e+r),t.set(e-r,i),t.set(e+r,i);t.set(e-n,e-n),t.set(e-n+1,e-n),t.set(e-n,e-n+1),t.set(e+n,e-n),t.set(e+n,e-n+1),t.set(e+n,e+n-1)}static generateModeMessage(t,e,n){let r=new at;return t?(r.appendBits(e-1,2),r.appendBits(n-1,6),r=ot.generateCheckWords(r,28,4)):(r.appendBits(e-1,5),r.appendBits(n-1,11),r=ot.generateCheckWords(r,40,4)),r}static drawModeMessage(t,e,n,r){let i=j.truncDivision(n,2);if(e)for(let s=0;s<7;s++){let o=i-3+s;r.get(s)&&t.set(o,i-5),r.get(s+7)&&t.set(i+5,o),r.get(20-s)&&t.set(o,i+5),r.get(27-s)&&t.set(i-5,o)}else for(let s=0;s<10;s++){let o=i-5+s+j.truncDivision(s,5);r.get(s)&&t.set(o,i-7),r.get(s+10)&&t.set(i+7,o),r.get(29-s)&&t.set(o,i+7),r.get(39-s)&&t.set(i-7,o)}}static generateCheckWords(t,e,n){let r=t.getSize()/n,i=new jn(ot.getGF(n)),s=j.truncDivision(e,n),o=ot.bitsToWords(t,n,s);i.encode(o,s-r);let a=e%n,l=new at;l.appendBits(0,a);for(const c of Array.from(o))l.appendBits(c,n);return l}static bitsToWords(t,e,n){let r=new Int32Array(n),i,s;for(i=0,s=t.getSize()/e;i<s;i++){let o=0;for(let a=0;a<e;a++)o|=t.get(i*e+a)?1<<e-a-1:0;r[i]=o}return r}static getGF(t){switch(t){case 4:return lt.AZTEC_PARAM;case 6:return lt.AZTEC_DATA_6;case 8:return lt.AZTEC_DATA_8;case 10:return lt.AZTEC_DATA_10;case 12:return lt.AZTEC_DATA_12;default:throw new D("Unsupported word size "+t)}}static stuffBits(t,e){let n=new at,r=t.getSize(),i=(1<<e)-2;for(let s=0;s<r;s+=e){let o=0;for(let a=0;a<e;a++)(s+a>=r||t.get(s+a))&&(o|=1<<e-1-a);(o&i)===i?(n.appendBits(o&i,e),s--):o&i?n.appendBits(o,e):(n.appendBits(o|1,e),s--)}return n}static totalBitsInLayer(t,e){return((e?88:112)+16*t)*t}}ot.DEFAULT_EC_PERCENT=33,ot.DEFAULT_AZTEC_LAYERS=0,ot.MAX_NB_BITS=32,ot.MAX_NB_BITS_COMPACT=4,ot.WORD_SIZE=Int32Array.from([4,6,6,8,8,8,8,8,8,10,10,10,10,10,10,10,10,10,10,10,10,10,10,12,12,12,12,12,12,12,12,12,12]);class _n{encode(t,e,n,r){return this.encodeWithHints(t,e,n,r,null)}encodeWithHints(t,e,n,r,i){let s=Qn.ISO_8859_1,o=ot.DEFAULT_EC_PERCENT,a=ot.DEFAULT_AZTEC_LAYERS;return i!=null&&(i.has(Lt.CHARACTER_SET)&&(s=pr.forName(i.get(Lt.CHARACTER_SET).toString())),i.has(Lt.ERROR_CORRECTION)&&(o=j.parseInt(i.get(Lt.ERROR_CORRECTION).toString())),i.has(Lt.AZTEC_LAYERS)&&(a=j.parseInt(i.get(Lt.AZTEC_LAYERS).toString()))),_n.encodeLayers(t,e,n,r,s,o,a)}static encodeLayers(t,e,n,r,i,s,o){if(e!==z.AZTEC)throw new D("Can only encode AZTEC, but got "+e);let a=ot.encode(q.getBytes(t,i),s,o);return _n.renderResult(a,n,r)}static renderResult(t,e,n){let r=t.getMatrix();if(r==null)throw new we;
26let i=r.getWidth(),s=r.getHeight(),o=Math.max(e,i),a=Math.max(n,s),l=Math.min(o/i,a/s),c=(o-i*l)/2,f=(a-s*l)/2,d=new kt(o,a);for(let C=0,p=f;C<s;C++,p+=l)for(let T=0,S=c;T<i;T++,S+=l)r.get(T,C)&&d.setRegion(S,p,l,l);return d}}h.AbstractExpandedDecoder=xn,h.ArgumentException=L,h.ArithmeticException=gn,h.AztecCode=yr,h.AztecCodeReader=En,h.AztecCodeWriter=_n,h.AztecDecoder=pt,h.AztecDetector=lr,h.AztecDetectorResult=or,h.AztecEncoder=ot,h.AztecHighLevelEncoder=dn,h.AztecPoint=qt,h.BarcodeFormat=z,h.Binarizer=Zt,h.BinaryBitmap=dt,h.BitArray=at,h.BitMatrix=kt,h.BitSource=Wn,h.BrowserAztecCodeReader=xr,h.BrowserBarcodeReader=Xr,h.BrowserCodeReader=Le,h.BrowserDatamatrixCodeReader=zr,h.BrowserMultiFormatReader=ri,h.BrowserPDF417Reader=ii,h.BrowserQRCodeReader=si,h.BrowserQRCodeSvgWriter=Ge,h.CharacterSetECI=F,h.ChecksumException=et,h.Code128Reader=V,h.Code39Reader=Bt,h.DataMatrixDecodedBitStreamParser=De,h.DataMatrixReader=Me,h.DecodeHintType=gt,h.DecoderResult=en,h.DefaultGridSampler=ar,h.DetectorResult=An,h.EAN13Reader=ke,h.EncodeHintType=Lt,h.Exception=m,h.FormatException=x,h.GenericGF=lt,h.GenericGFPoly=$t,h.GlobalHistogramBinarizer=Ft,h.GridSampler=Ln,h.GridSamplerInstance=Re,h.HTMLCanvasElementLuminanceSource=Oe,h.HybridBinarizer=J,h.ITFReader=Et,h.IllegalArgumentException=D,h.IllegalStateException=we,h.InvertedLuminanceSource=_e,h.LuminanceSource=tn,h.MathUtils=st,h.MultiFormatOneDReader=Ze,h.MultiFormatReader=Ir,h.MultiFormatWriter=ai,h.NotFoundException=b,h.OneDReader=vt,h.PDF417DecodedBitStreamParser=_,h.PDF417DecoderErrorCorrection=gr,h.PDF417Reader=Wt,h.PDF417ResultMetadata=Ar,h.PerspectiveTransform=ue,h.PlanarYUVLuminanceSource=me,h.QRCodeByteMatrix=Sn,h.QRCodeDataMask=le,h.QRCodeDecodedBitStreamParser=_t,h.QRCodeDecoderErrorCorrectionLevel=yt,h.QRCodeDecoderFormatInformation=zt,h.QRCodeEncoder=Tt,h.QRCodeEncoderQRCode=Ve,h.QRCodeMaskUtil=bt,h.QRCodeMatrixUtil=Z,h.QRCodeMode=Y,h.QRCodeReader=ve,h.QRCodeVersion=X,h.QRCodeWriter=je,h.RGBLuminanceSource=qn,h.RSS14Reader=Rt,h.RSSExpandedReader=M,h.ReaderException=Tn,h.ReedSolomonDecoder=rn,h.ReedSolomonEncoder=jn,h.ReedSolomonException=We,h.Result=jt,h.ResultMetadataType=Ut,h.ResultPoint=W,h.StringUtils=q,h.UnsupportedOperationException=He,h.VideoInputDevice=sr,h.WhiteRectangleDetector=ye,h.WriterException=Ct,h.ZXingArrays=It,h.ZXingCharset=pr,h.ZXingInteger=j,h.ZXingStandardCharsets=Qn,h.ZXingStringBuilder=wt,h.ZXingStringEncoding=Jt,h.ZXingSystem=rt,h.createAbstractExpandedDecoder=fr,Object.defineProperty(h,"__esModule",{value:!0})})})(nr,nr.exports);var St=nr.exports;const Ni=mi(St),_i=Ii({__proto__:null,default:Ni},[St]);var br=function(){function w(g,h,I){if(this.formatMap=new Map([[G.QR_CODE,St.BarcodeFormat.QR_CODE],[G.AZTEC,St.BarcodeFormat.AZTEC],[G.CODABAR,St.BarcodeFormat.CODABAR],[G.CODE_39,St.BarcodeFormat.CODE_39],[G.CODE_93,St.BarcodeFormat.CODE_93],[G.CODE_128,St.BarcodeFormat.CODE_128],[G.DATA_MATRIX,St.BarcodeFormat.DATA_MATRIX],[G.MAXICODE,St.BarcodeFormat.MAXICODE],[G.ITF,St.BarcodeFormat.ITF],[G.EAN_13,St.BarcodeFormat.EAN_13],[G.EAN_8,St.BarcodeFormat.EAN_8],[G.PDF_417,St.BarcodeFormat.PDF_417],[G.RSS_14,St.BarcodeFormat.RSS_14],[G.RSS_EXPANDED,St.BarcodeFormat.RSS_EXPANDED],[G.UPC_A,St.BarcodeFormat.UPC_A],[G.UPC_E,St.BarcodeFormat.UPC_E],[G.UPC_EAN_EXTENSION,St.BarcodeFormat.UPC_EAN_EXTENSION]]),this.reverseFormatMap=this.createReverseFormatMap(),!_i)throw"Use html5qrcode.min.js without edit, ZXing not found.";this.verbose=h,this.logger=I;var y=this.createZXingFormats(g),A=new Map;A.set(St.DecodeHintType.POSSIBLE_FORMATS,y),A.set(St.DecodeHintType.TRY_HARDER,!1),this.hints=A}return w.prototype.decodeAsync=function(g){var h=this;return new Promise(function(I,y){try{I(h.decode(g))}catch(A){y(A)}})},w.prototype.decode=function(g){var h=new St.MultiFormatReader(this.verbose,this.hints),I=new St.HTMLCanvasElementLuminanceSource(g),y=new St.BinaryBitmap(new St.HybridBinarizer(I)),A=h.decode(y);return{text:A.text,format:kr.create(this.toHtml5QrcodeSupportedFormats(A.format)),debugData:this.createDebugData()}},w.prototype.createReverseFormatMap=function(){var g=new Map;
26return this.formatMap.forEach(function(h,I,y){g.set(h,I)}),g},w.prototype.toHtml5QrcodeSupportedFormats=function(g){if(!this.reverseFormatMap.has(g))throw"reverseFormatMap doesn't have ".concat(g);return this.reverseFormatMap.get(g)},w.prototype.createZXingFormats=function(g){for(var h=[],I=0,y=g;I<y.length;I++){var A=y[I];this.formatMap.has(A)?h.push(this.formatMap.get(A)):this.logger.logError("".concat(A," is not supported by")+"ZXingHtml5QrcodeShim")}return h},w.prototype.createDebugData=function(){return{decoderName:"zxing-js"}},w}(),Oi=function(w,g,h,I){function y(A){return A instanceof h?A:new h(function(R){R(A)})}return new(h||(h=Promise))(function(A,R){function U(L){try{m(I.next(L))}catch(D){R(D)}}function P(L){try{m(I.throw(L))}catch(D){R(D)}}function m(L){L.done?A(L.value):y(L.value).then(U,P)}m((I=I.apply(w,g||[])).next())})},Ri=function(w,g){var h={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},I,y,A,R;return R={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function U(m){return function(L){return P([m,L])}}function P(m){if(I)throw new TypeError("Generator is already executing.");for(;R&&(R=0,m[0]&&(h=0)),h;)try{if(I=1,y&&(A=m[0]&2?y.return:m[0]?y.throw||((A=y.return)&&A.call(y),0):y.next)&&!(A=A.call(y,m[1])).done)return A;switch(y=0,A&&(m=[m[0]&2,A.value]),m[0]){case 0:case 1:A=m;break;case 4:return h.label++,{value:m[1],done:!1};case 5:h.label++,y=m[1],m=[0];continue;case 7:m=h.ops.pop(),h.trys.pop();continue;default:if(A=h.trys,!(A=A.length>0&&A[A.length-1])&&(m[0]===6||m[0]===2)){h=0;continue}if(m[0]===3&&(!A||m[1]>A[0]&&m[1]<A[3])){h.label=m[1];break}if(m[0]===6&&h.label<A[1]){h.label=A[1],A=m;break}if(A&&h.label<A[2]){h.label=A[2],h.ops.push(m);break}A[2]&&h.ops.pop(),h.trys.pop();continue}m=g.call(w,h)}catch(L){m=[6,L],y=0}finally{I=A=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},Dr=function(){function w(g,h,I){if(this.formatMap=new Map([[G.QR_CODE,"qr_code"],[G.AZTEC,"aztec"],[G.CODABAR,"codabar"],[G.CODE_39,"code_39"],[G.CODE_93,"code_93"],[G.CODE_128,"code_128"],[G.DATA_MATRIX,"data_matrix"],[G.ITF,"itf"],[G.EAN_13,"ean_13"],[G.EAN_8,"ean_8"],[G.PDF_417,"pdf417"],[G.UPC_A,"upc_a"],[G.UPC_E,"upc_e"]]),this.reverseFormatMap=this.createReverseFormatMap(),!w.isSupported())throw"Use html5qrcode.min.js without edit, Use BarcodeDetectorDelegate only if it isSupported();";this.verbose=h,this.logger=I;var y=this.createBarcodeDetectorFormats(g);if(this.detector=new BarcodeDetector(y),!this.detector)throw"BarcodeDetector detector not supported"}return w.isSupported=function(){if(!("BarcodeDetector"in window))return!1;var g=new BarcodeDetector({formats:["qr_code"]});return typeof g<"u"},w.prototype.decodeAsync=function(g){return Oi(this,void 0,void 0,function(){var h,I;return Ri(this,function(y){switch(y.label){case 0:return[4,this.detector.detect(g)];case 1:if(h=y.sent(),!h||h.length===0)throw"No barcode or QR code detected.";return I=this.selectLargestBarcode(h),[2,{text:I.rawValue,format:kr.create(this.toHtml5QrcodeSupportedFormats(I.format)),debugData:this.createDebugData()}]}})})},w.prototype.selectLargestBarcode=function(g){for(var h=null,I=0,y=0,A=g;y<A.length;y++){var R=A[y],U=R.boundingBox.width*R.boundingBox.height;U>I&&(I=U,h=R)}if(!h)throw"No largest barcode found";return h},w.prototype.createBarcodeDetectorFormats=function(g){for(var h=[],I=0,y=g;I<y.length;I++){var A=y[I];this.formatMap.has(A)?h.push(this.formatMap.get(A)):this.logger.warn("".concat(A," is not supported by")+"BarcodeDetectorDelegate")}return{formats:h}},w.prototype.toHtml5QrcodeSupportedFormats=function(g){if(!this.reverseFormatMap.has(g))throw"reverseFormatMap doesn't have ".concat(g);return this.reverseFormatMap.get(g)},w.prototype.createReverseFormatMap=function(){var g=new Map;return this.formatMap.forEach(function(h,I,y){g.set(h,I)}),g},w.prototype.createDebugData=function(){return{decoderName:"BarcodeDetector"}},w}(),Mr=function(w,g,h,I){function y(A){return A instanceof h?A:new h(function(R){R(A)})}return new(h||(h=Promise))(function(A,R){function U(L){try{m(I.next(L))}catch(D){R(D)}}function P(L){try{m(I.throw(L))}catch(D){R(D)}}function m(L){L.done?A(L.value):y(L.value).then(U,P)}m((I=I.apply(w,g||[])).next())})},vr=function(w,g){var h={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},I,y,A,R;return R={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function U(m){return function(L){return P([m,L])}}
26function P(m){if(I)throw new TypeError("Generator is already executing.");for(;R&&(R=0,m[0]&&(h=0)),h;)try{if(I=1,y&&(A=m[0]&2?y.return:m[0]?y.throw||((A=y.return)&&A.call(y),0):y.next)&&!(A=A.call(y,m[1])).done)return A;switch(y=0,A&&(m=[m[0]&2,A.value]),m[0]){case 0:case 1:A=m;break;case 4:return h.label++,{value:m[1],done:!1};case 5:h.label++,y=m[1],m=[0];continue;case 7:m=h.ops.pop(),h.trys.pop();continue;default:if(A=h.trys,!(A=A.length>0&&A[A.length-1])&&(m[0]===6||m[0]===2)){h=0;continue}if(m[0]===3&&(!A||m[1]>A[0]&&m[1]<A[3])){h.label=m[1];break}if(m[0]===6&&h.label<A[1]){h.label=A[1],A=m;break}if(A&&h.label<A[2]){h.label=A[2],h.ops.push(m);break}A[2]&&h.ops.pop(),h.trys.pop();continue}m=g.call(w,h)}catch(L){m=[6,L],y=0}finally{I=A=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},bi=function(){function w(g,h,I,y){this.EXECUTIONS_TO_REPORT_PERFORMANCE=100,this.executions=0,this.executionResults=[],this.wasPrimaryDecoderUsedInLastDecode=!1,this.verbose=I,h&&Dr.isSupported()?(this.primaryDecoder=new Dr(g,I,y),this.secondaryDecoder=new br(g,I,y)):this.primaryDecoder=new br(g,I,y)}return w.prototype.decodeAsync=function(g){return Mr(this,void 0,void 0,function(){var h;return vr(this,function(I){switch(I.label){case 0:h=performance.now(),I.label=1;case 1:return I.trys.push([1,,3,4]),[4,this.getDecoder().decodeAsync(g)];case 2:return[2,I.sent()];case 3:return this.possiblyLogPerformance(h),[7];case 4:return[2]}})})},w.prototype.decodeRobustlyAsync=function(g){return Mr(this,void 0,void 0,function(){var h,I;return vr(this,function(y){switch(y.label){case 0:h=performance.now(),y.label=1;case 1:return y.trys.push([1,3,4,5]),[4,this.primaryDecoder.decodeAsync(g)];case 2:return[2,y.sent()];case 3:if(I=y.sent(),this.secondaryDecoder)return[2,this.secondaryDecoder.decodeAsync(g)];throw I;case 4:return this.possiblyLogPerformance(h),[7];case 5:return[2]}})})},w.prototype.getDecoder=function(){return this.secondaryDecoder?this.wasPrimaryDecoderUsedInLastDecode===!1?(this.wasPrimaryDecoderUsedInLastDecode=!0,this.primaryDecoder):(this.wasPrimaryDecoderUsedInLastDecode=!1,this.secondaryDecoder):this.primaryDecoder},w.prototype.possiblyLogPerformance=function(g){if(this.verbose){var h=performance.now()-g;this.executionResults.push(h),this.executions++,this.possiblyFlushPerformanceReport()}},w.prototype.possiblyFlushPerformanceReport=function(){if(!(this.executions<this.EXECUTIONS_TO_REPORT_PERFORMANCE)){for(var g=0,h=0,I=this.executionResults;h<I.length;h++){var y=I[h];g+=y}var A=g/this.executionResults.length;console.log("".concat(A," ms for ").concat(this.executionResults.length," last runs.")),this.executions=0,this.executionResults=[]}},w}(),ir=function(){var w=function(g,h){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,y){I.__proto__=y}||function(I,y){for(var A in y)Object.prototype.hasOwnProperty.call(y,A)&&(I[A]=y[A])},w(g,h)};return function(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");w(g,h);function I(){this.constructor=g}g.prototype=h===null?Object.create(h):(I.prototype=h.prototype,new I)}}(),Rn=function(w,g,h,I){function y(A){return A instanceof h?A:new h(function(R){R(A)})}return new(h||(h=Promise))(function(A,R){function U(L){try{m(I.next(L))}catch(D){R(D)}}function P(L){try{m(I.throw(L))}catch(D){R(D)}}function m(L){L.done?A(L.value):y(L.value).then(U,P)}m((I=I.apply(w,g||[])).next())})},bn=function(w,g){var h={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},I,y,A,R;return R={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function U(m){return function(L){return P([m,L])}}function P(m){if(I)throw new TypeError("Generator is already executing.");for(;R&&(R=0,m[0]&&(h=0)),h;)try{if(I=1,y&&(A=m[0]&2?y.return:m[0]?y.throw||((A=y.return)&&A.call(y),0):y.next)&&!(A=A.call(y,m[1])).done)return A;switch(y=0,A&&(m=[m[0]&2,A.value]),m[0]){case 0:case 1:A=m;break;case 4:return h.label++,{value:m[1],done:!1};case 5:h.label++,y=m[1],m=[0];continue;case 7:m=h.ops.pop(),h.trys.pop();continue;default:if(A=h.trys,!(A=A.length>0&&A[A.length-1])&&(m[0]===6||m[0]===2)){h=0;continue}if(m[0]===3&&(!A||m[1]>A[0]&&m[1]<A[3])){h.label=m[1];break}if(m[0]===6&&h.label<A[1]){h.label=A[1],A=m;break}if(A&&h.label<A[2]){h.label=A[2],h.ops.push(m);break}A[2]&&h.ops.pop(),h.trys.pop();continue}m=g.call(w,h)}catch(L){m=[6,L],y=0}finally{I=A=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},Ur=function(){function w(g,h){this.name=g,this.track=h}return w.prototype.isSupported=function(){return this.track.getCapabilities?this.name in this.track.getCapabilities():!1},w.prototype.apply=function(g){var h={};h[this.name]=g;var I={advanced:[h]};return this.track.applyConstraints(I)},w.prototype.value=function(){var g=this.track.getSettings();if(this.name in g){var h=g[this.name];return h}return null},w}(),Di=function(w){ir(g,w);function g(h,I){return w.call(this,h,I)||this}return g.prototype.min=function(){return this.getCapabilities().min},g.prototype.max=function(){return this.getCapabilities().max},g.prototype.step=function(){return this.getCapabilities().step},g.prototype.apply=function(h){var I={};I[this.name]=h;var y={advanced:[I]};return this.track.applyConstraints(y)},g.prototype.getCapabilities=function(){this.failIfNotSupported();var h=this.track.getCapabilities(),I=h[this.name];return{min:I.min,max:I.max,step:I.step}},g.prototype.failIfNotSupported=function(){if(!this.isSupported())throw new Error("".concat(this.name," capability not supported"))},g}(Ur),Mi=function(w){ir(g,w);function g(h){return w.call(this,"zoom",h)||this}return g}(Di),vi=function(w){ir(g,w);function g(h){return w.call(this,"torch",h)||this}return g}(Ur),Bi=function(){function w(g){this.track=g}return w.prototype.zoomFeature=function(){return new Mi(this.track)},w.prototype.torchFeature=function(){return new vi(this.track)},w}(),Pi=function(){function w(g,h,I){this.isClosed=!1,this.parentElement=g,this.mediaStream=h,this.callbacks=I,this.surface=this.createVideoElement(this.parentElement.clientWidth),g.append(this.surface)}return w.prototype.createVideoElement=function(g){var h=document.createElement("video");return h.style.width="".concat(g,"px"),h.style.display="block",h.muted=!0,h.setAttribute("muted","true"),h.playsInl
26ine=!0,h},w.prototype.setupSurface=function(){var g=this;this.surface.onabort=function(){throw"RenderedCameraImpl video surface onabort() called"},this.surface.onerror=function(){throw"RenderedCameraImpl video surface onerror() called"};var h=function(){var I=g.surface.clientWidth,y=g.surface.clientHeight;g.callbacks.onRenderSurfaceReady(I,y),g.surface.removeEventListener("playing",h)};this.surface.addEventListener("playing",h),this.surface.srcObject=this.mediaStream,this.surface.play()},w.create=function(g,h,I,y){return Rn(this,void 0,void 0,function(){var A,R;return bn(this,function(U){switch(U.label){case 0:return A=new w(g,h,y),I.aspectRatio?(R={aspectRatio:I.aspectRatio},[4,A.getFirstTrackOrFail().applyConstraints(R)]):[3,2];case 1:U.sent(),U.label=2;case 2:return A.setupSurface(),[2,A]}})})},w.prototype.failIfClosed=function(){if(this.isClosed)throw"The RenderedCamera has already been closed."},w.prototype.getFirstTrackOrFail=function(){if(this.failIfClosed(),this.mediaStream.getVideoTracks().length===0)throw"No video tracks found";return this.mediaStream.getVideoTracks()[0]},w.prototype.pause=function(){this.failIfClosed(),this.surface.pause()},w.prototype.resume=function(g){this.failIfClosed();var h=this,I=function(){setTimeout(g,200),h.surface.removeEventListener("playing",I)};this.surface.addEventListener("playing",I),this.surface.play()},w.prototype.isPaused=function(){return this.failIfClosed(),this.surface.paused},w.prototype.getSurface=function(){return this.failIfClosed(),this.surface},w.prototype.getRunningTrackCapabilities=function(){return this.getFirstTrackOrFail().getCapabilities()},w.prototype.getRunningTrackSettings=function(){return this.getFirstTrackOrFail().getSettings()},w.prototype.applyVideoConstraints=function(g){return Rn(this,void 0,void 0,function(){return bn(this,function(h){if("aspectRatio"in g)throw"Changing 'aspectRatio' in run-time is not yet supported.";return[2,this.getFirstTrackOrFail().applyConstraints(g)]})})},w.prototype.close=function(){if(this.isClosed)return Promise.resolve();var g=this;return new Promise(function(h,I){var y=g.mediaStream.getVideoTracks(),A=y.length,R=0;g.mediaStream.getVideoTracks().forEach(function(U){g.mediaStream.removeTrack(U),U.stop(),++R,R>=A&&(g.isClosed=!0,g.parentElement.removeChild(g.surface),h())})})},w.prototype.getCapabilities=function(){return new Bi(this.getFirstTrackOrFail())},w}(),Li=function(){function w(g){this.mediaStream=g}return w.prototype.render=function(g,h,I){return Rn(this,void 0,void 0,function(){return bn(this,function(y){return[2,Pi.create(g,this.mediaStream,h,I)]})})},w.create=function(g){return Rn(this,void 0,void 0,function(){var h,I;return bn(this,function(y){switch(y.label){case 0:if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return h={audio:!1,video:g},[4,navigator.mediaDevices.getUserMedia(h)];case 1:return I=y.sent(),[2,new w(I)]}})})},w}(),Br=function(w,g,h,I){function y(A){return A instanceof h?A:new h(function(R){R(A)})}return new(h||(h=Promise))(function(A,R){function U(L){try{m(I.next(L))}catch(D){R(D)}}function P(L){try{m(I.throw(L))}catch(D){R(D)}}function m(L){L.done?A(L.value):y(L.value).then(U,P)}m((I=I.apply(w,g||[])).next())})},Pr=function(w,g){var h={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},I,y,A,R;return R={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function U(m){return function(L){return P([m,L])}}function P(m){if(I)throw new TypeError("Generator is already executing.");for(;R&&(R=0,m[0]&&(h=0)),h;)try{if(I=1,y&&(A=m[0]&2?y.return:m[0]?y.throw||((A=y.return)&&A.call(y),0):y.next)&&!(A=A.call(y,m[1])).done)return A;switch(y=0,A&&(m=[m[0]&2,A.value]),m[0]){case 0:case 1:A=m;break;case 4:return h.label++,{value:m[1],done:!1};case 5:h.label++,y=m[1],m=[0];continue;case 7:m=h.ops.pop(),h.trys.pop();continue;default:if(A=h.trys,!(A=A.length>0&&A[A.length-1])&&(m[0]===6||m[0]===2)){h=0;continue}if(m[0]===3&&(!A||m[1]>A[0]&&m[1]<A[3])){h.label=m[1];break}if(m[0]===6&&h.label<A[1]){h.label=A[1],A=m;break}if(A&&h.label<A[2]){h.label=A[2],h.ops.push(m);break}A[2]&&h.ops.pop(),h.trys.pop();continue}m=g.call(w,h)}catch(L){m=[6,L],y=0}finally{I=A=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},ki=function(){function w(){}return w.failIfNotSupported=function(){return Br(this,void 0,void 0,function(){return Pr(this,function(g){if(!navigator.mediaDevices)throw"navigator.mediaDevices not supported";return[2,new w]})})},w.prototype.create=function(g){return Br(this,void 0,void 0,function(){return Pr(this,function(h){return[2,Li.create(g)]})})},w}(),Fi=function(w,g,h,I){function y(A){return A instanceof h?A:new h(function(R){R(A)})}return new(h||(h=Promise))(function(A,R){function U(L){try{m(I.next(L))}catch(D){R(D)}}function P(L){try{m(I.throw(L))}catch(D){R(D)}}function m(L){L.done?A(L.value):y(L.value).then(U,P)}m((I=I.apply(w,g||[])).next())})},Ui=function(w,g){var h={label:0,sent:function(){if(A[0]&1)throw A[1];return A[1]},trys:[],ops:[]},I,y,A,R;return R={next:U(0),throw:U(1),return:U(2)},typeof Symbol=="function"&&(R[Symbol.iterator]=function(){return this}),R;function U(m){return function(L){return P([m,L])}}
26function P(m){if(I)throw new TypeError("Generator is already executing.");for(;R&&(R=0,m[0]&&(h=0)),h;)try{if(I=1,y&&(A=m[0]&2?y.return:m[0]?y.throw||((A=y.return)&&A.call(y),0):y.next)&&!(A=A.call(y,m[1])).done)return A;switch(y=0,A&&(m=[m[0]&2,A.value]),m[0]){case 0:case 1:A=m;break;case 4:return h.label++,{value:m[1],done:!1};case 5:h.label++,y=m[1],m=[0];continue;case 7:m=h.ops.pop(),h.trys.pop();continue;default:if(A=h.trys,!(A=A.length>0&&A[A.length-1])&&(m[0]===6||m[0]===2)){h=0;continue}if(m[0]===3&&(!A||m[1]>A[0]&&m[1]<A[3])){h.label=m[1];break}if(m[0]===6&&h.label<A[1]){h.label=A[1],A=m;break}if(A&&h.label<A[2]){h.label=A[2],h.ops.push(m);break}A[2]&&h.ops.pop(),h.trys.pop();continue}m=g.call(w,h)}catch(L){m=[6,L],y=0}finally{I=A=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}},xi=function(){function w(){}return w.retrieve=function(){if(navigator.mediaDevices)return w.getCamerasFromMediaDevices();var g=MediaStreamTrack;return MediaStreamTrack&&g.getSources?w.getCamerasFromMediaStreamTrack():w.rejectWithError()},w.rejectWithError=function(){var g=$e.unableToQuerySupportedDevices();return w.isHttpsOrLocalhost()||(g=$e.insecureContextCameraQueryError()),Promise.reject(g)},w.isHttpsOrLocalhost=function(){if(location.protocol==="https:")return!0;var g=location.host.split(":")[0];return g==="127.0.0.1"||g==="localhost"},w.getCamerasFromMediaDevices=function(){return Fi(this,void 0,void 0,function(){var g,h,I,y,A,R,U;return Ui(this,function(P){switch(P.label){case 0:return g=function(m){for(var L=m.getVideoTracks(),D=0,dt=L;D<dt.length;D++){var et=dt[D];et.enabled=!1,et.stop(),m.removeTrack(et)}},[4,navigator.mediaDevices.getUserMedia({audio:!1,video:!0})];case 1:return h=P.sent(),[4,navigator.mediaDevices.enumerateDevices()];case 2:for(I=P.sent(),y=[],A=0,R=I;A<R.length;A++)U=R[A],U.kind==="videoinput"&&y.push({id:U.deviceId,label:U.label});return g(h),[2,y]}})})},w.getCamerasFromMediaStreamTrack=function(){return new Promise(function(g,h){var I=function(A){for(var R=[],U=0,P=A;U<P.length;U++){var m=P[U];m.kind==="video"&&R.push({id:m.id,label:m.label})}g(R)},y=MediaStreamTrack;y.getSources(I)})},w}(),Dt;(function(w){w[w.UNKNOWN=0]="UNKNOWN",w[w.NOT_STARTED=1]="NOT_STARTED",w[w.SCANNING=2]="SCANNING",w[w.PAUSED=3]="PAUSED"})(Dt||(Dt={}));var Vi=function(){function w(){this.state=Dt.NOT_STARTED,this.onGoingTransactionNewState=Dt.UNKNOWN}return w.prototype.directTransition=function(g){this.failIfTransitionOngoing(),this.validateTransition(g),this.state=g},w.prototype.startTransition=function(g){return this.failIfTransitionOngoing(),this.validateTransition(g),this.onGoingTransactionNewState=g,this},w.prototype.execute=function(){if(this.onGoingTransactionNewState===Dt.UNKNOWN)throw"Transaction is already cancelled, cannot execute().";var g=this.onGoingTransactionNewState;this.onGoingTransactionNewState=Dt.UNKNOWN,this.directTransition(g)},w.prototype.cancel=function(){if(this.onGoingTransactionNewState===Dt.UNKNOWN)throw"Transaction is already cancelled, cannot cancel().";this.onGoingTransactionNewState=Dt.UNKNOWN},w.prototype.getState=function(){return this.state},w.prototype.failIfTransitionOngoing=function(){if(this.onGoingTransactionNewState!==Dt.UNKNOWN)throw"Cannot transition to a new state, already under transition"},w.prototype.validateTransition=function(g){switch(this.state){case Dt.UNKNOWN:throw"Transition from unknown is not allowed";case Dt.NOT_STARTED:this.failIfNewStateIs(g,[Dt.PAUSED]);break;case Dt.SCANNING:break;case Dt.PAUSED:break}},w.prototype.failIfNewStateIs=function(g,h){for(var I=0,y=h;I<y.length;I++){var A=y[I];if(g===A)throw"Cannot transition from ".concat(this.state," to ").concat(g)}},w}(),Gi=function(){function w(g){this.stateManager=g}return w.prototype.startTransition=function(g){return this.stateManager.startTransition(g)},w.prototype.directTransition=function(g){this.stateManager.directTransition(g)},w.prototype.getState=function(){return this.stateManager.getState()},w.prototype.canScanFile=function(){return this.stateManager.getState()===Dt.NOT_STARTED},w.prototype.isScanning=function(){return this.stateManager.getState()!==Dt.NOT_STARTED},w.prototype.isStrictlyScanning=function(){return this.stateManager.getState()===Dt.SCANNING},w.prototype.isPaused=function(){return this.stateManager.getState()===Dt.PAUSED},w}(),Hi=function(){function w(){}return w.create=function(){return new Gi(new Vi)},w}
26(),Wi=function(){var w=function(g,h){return w=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(I,y){I.__proto__=y}||function(I,y){for(var A in y)Object.prototype.hasOwnProperty.call(y,A)&&(I[A]=y[A])},w(g,h)};return function(g,h){if(typeof h!="function"&&h!==null)throw new TypeError("Class extends value "+String(h)+" is not a constructor or null");w(g,h);function I(){this.constructor=g}g.prototype=h===null?Object.create(h):(I.prototype=h.prototype,new I)}}(),oe=function(w){Wi(g,w);function g(){return w!==null&&w.apply(this,arguments)||this}return g.DEFAULT_WIDTH=300,g.DEFAULT_WIDTH_OFFSET=2,g.FILE_SCAN_MIN_HEIGHT=300,g.FILE_SCAN_HIDDEN_CANVAS_PADDING=100,g.MIN_QR_BOX_SIZE=50,g.SHADED_LEFT=1,g.SHADED_RIGHT=2,g.SHADED_TOP=3,g.SHADED_BOTTOM=4,g.SHADED_REGION_ELEMENT_ID="qr-shaded-region",g.VERBOSE=!1,g.BORDER_SHADER_DEFAULT_COLOR="#ffffff",g.BORDER_SHADER_MATCH_COLOR="rgb(90, 193, 56)",g}(yi),Xi=function(){function w(g,h){this.logger=h,this.fps=oe.SCAN_DEFAULT_FPS,g?(g.fps&&(this.fps=g.fps),this.disableFlip=g.disableFlip===!0,this.qrbox=g.qrbox,this.aspectRatio=g.aspectRatio,this.videoConstraints=g.videoConstraints):this.disableFlip=oe.DEFAULT_DISABLE_FLIP}return w.prototype.isMediaStreamConstraintsValid=function(){return this.videoConstraints?Fr.isMediaStreamConstraintsValid(this.videoConstraints,this.logger):(this.logger.logError("Empty videoConstraints",!0),!1)},w.prototype.isShadedBoxEnabled=function(){return!Te(this.qrbox)},w.create=function(g,h){return new w(g,h)},w}(),Ji=function(){function w(g,h){if(this.element=null,this.canvasElement=null,this.scannerPausedUiElement=null,this.hasBorderShaders=null,this.borderShaders=null,this.qrMatch=null,this.renderedCamera=null,this.qrRegion=null,this.context=null,this.lastScanImageFile=null,this.isScanning=!1,!document.getElementById(g))throw"HTML Element with id=".concat(g," not found");this.elementId=g,this.verbose=!1;var I;typeof h=="boolean"?this.verbose=h===!0:h&&(I=h,this.verbose=I.verbose===!0,I.experimentalFeatures),this.logger=new Si(this.verbose),this.qrcode=new bi(this.getSupportedFormats(h),this.getUseBarCodeDetectorIfSupported(I),this.verbose,this.logger),this.foreverScanTimeout,this.shouldScan=!0,this.stateManagerProxy=Hi.create()}return w.prototype.start=function(g,h,I,y){var A=this;if(!g)throw"cameraIdOrConfig is required";if(!I||typeof I!="function")throw"qrCodeSuccessCallback is required and should be a function.";var R;y?R=y:R=this.verbose?this.logger.log:function(){};var U=Xi.create(h,this.logger);this.clearElement();var P=!1;U.videoConstraints&&(U.isMediaStreamConstraintsValid()?P=!0:this.logger.logError("'videoConstraints' is not valid 'MediaStreamConstraints, it will be ignored.'",!0));var m=P,L=document.getElementById(this.elementId);L.clientWidth?L.clientWidth:oe.DEFAULT_WIDTH,L.style.position="relative",this.shouldScan=!0,this.element=L;var D=this,dt=this.stateManagerProxy.startTransition(Dt.SCANNING);return new Promise(function(et,Zt){var rt=m?U.videoConstraints:D.createVideoConstraints(g);if(!rt){dt.cancel(),Zt("videoConstraints should be defined");return}var ge={};(!m||U.aspectRatio)&&(ge.aspectRatio=U.aspectRatio);var Se={onRenderSurfaceReady:function(It,j){D.setupUi(It,j,U),D.isScanning=!0,D.foreverScan(U,I,R)}};ki.failIfNotSupported().then(function(It){It.create(rt).then(function(j){return j.render(A.element,ge,Se).then(function(at){D.renderedCamera=at,dt.execute(),et(null)}).catch(function(at){dt.cancel(),Zt(at)})}).catch(function(j){dt.cancel(),Zt($e.errorGettingUserMedia(j))})}).catch(function(It){dt.cancel(),Zt($e.cameraStreamingNotSupported())})})},w.prototype.pause=function(g){if(!this.stateManagerProxy.isStrictlyScanning())throw"Cannot pause, scanner is not scanning.";this.stateManagerProxy.directTransition(Dt.PAUSED),this.showPausedState(),(Te(g)||g!==!0)&&(g=!1),g&&this.renderedCamera&&this.renderedCamera.pause()},w.prototype.resume=function(){if(!this.stateManagerProxy.isPaused())throw"Cannot result, scanner is not paused.";if(!this.renderedCamera)throw"renderedCamera doesn't exist while trying resume()";var g=this,h=function(){g.stateManagerProxy.directTransition(Dt.SCANNING),g.hidePausedState()};if(!this.renderedCamera.isPaused()){h();return}this.renderedCamera.resume(function(){h()})},w.prototype.getState=function(){return this.stateManagerProxy.getState()},w.prototype.stop=function(){var g=this;if(!this.stateManagerProxy.isScanning())throw"Cannot stop, scanner is not running or paused.";var h=this.stateManagerProxy.startTransition(Dt.NOT_STARTED);this.shouldScan=!1,this.foreverScanTimeout&&clearTimeout(this.foreverScanTimeout);var I=function(){if(g.element){var A=document.getElementById(oe.SHADED_REGION_ELEMENT_ID);A&&g.element.removeChild(A)}},y=this;return this.renderedCamera.close().then(function(){return y.renderedCamera=null,y.element&&(y.element.removeChild(y.canvasElement),y.canvasElement=null),I(),y.qrRegion&&(y.qrRegion=null),y.context&&(y.context=null),h.execute(),y.hidePausedState(),y.isScanning=!1,Promise.resolve()})},w.prototype.scanFile=function(g,h){return this.scanFileV2(g,h).then(function(I){return I.decodedText})},w.prototype.scanFileV2=function(g,h){var I=this;if(!g||!(g instanceof File))throw"imageFile argument is mandatory and should be instance of File. Use 'event.target.files[0]'.";if(Te(h)&&(h=!0),!this.stateManagerProxy.canScanFile())throw"Cannot start file scan - ongoing camera scan";return new Promise(function(y,A){I.possiblyCloseLastScanImageFile(),I.clearElement(),I.lastScanImageFile=URL.createObjectURL(g);var R=new Image;R.onload=function(){var U=R.width,P=R.height,m=document.getElementById(I.elementId),L=m.clientWidth?m.clientWidth:oe.DEFAULT_WIDTH,D=Math.max(m.clientHeight?m.clientHeight:P,oe.FILE_SCAN_MIN_HEIGHT),dt=I.computeCanvasDrawConfig(U,P,L,D);if(h){var et=I.createCanvasElement(L,D,"qr-canvas-visible");et.style.display="inline-block",m.appendChild(et);var Zt=et.getContext("2d");if(!Zt)throw"Unable to get 2d context from canvas";Zt.canvas.width=L,Zt.canvas.height=D,Zt.drawImage(R,0,0,U,P,dt.x,dt.y,dt.width,dt.height)}var rt=oe.FILE_SCAN_HIDDEN_CANVAS_PADDING,ge=Math.max(R.width,dt.width),Se=Math.max(R.height,dt.height),It=ge+2*rt,j=Se+2*rt,at=I.createCanvasElement(It,j);m.appendChild(at);var Ne=at.getContext("2d");if(!Ne)throw"Unable to get 2d context from canvas";Ne.canvas.width=It,Ne.canvas.height=j,Ne.drawImage(R,0,0,U,P,rt,rt,ge,Se);try{I.qrcode.decodeRobustlyAsync(at).then(function(gt){y(Rr.createFromQrcodeResult(gt))}).catch(A)}
26catch(gt){A("QR code parse error, error = ".concat(gt))}},R.onerror=A,R.onabort=A,R.onstalled=A,R.onsuspend=A,R.src=URL.createObjectURL(g)})},w.prototype.clear=function(){this.clearElement()},w.getCameras=function(){return xi.retrieve()},w.prototype.getRunningTrackCapabilities=function(){return this.getRenderedCameraOrFail().getRunningTrackCapabilities()},w.prototype.getRunningTrackSettings=function(){return this.getRenderedCameraOrFail().getRunningTrackSettings()},w.prototype.getRunningTrackCameraCapabilities=function(){return this.getRenderedCameraOrFail().getCapabilities()},w.prototype.applyVideoConstraints=function(g){if(g){if(!Fr.isMediaStreamConstraintsValid(g,this.logger))throw"invalid videoConstaints passed, check logs for more details"}else throw"videoConstaints is required argument.";return this.getRenderedCameraOrFail().applyVideoConstraints(g)},w.prototype.getRenderedCameraOrFail=function(){if(this.renderedCamera==null)throw"Scanning is not in running state, call this API only when QR code scanning using camera is in running state.";return this.renderedCamera},w.prototype.getSupportedFormats=function(g){var h=[G.QR_CODE,G.AZTEC,G.CODABAR,G.CODE_39,G.CODE_93,G.CODE_128,G.DATA_MATRIX,G.MAXICODE,G.ITF,G.EAN_13,G.EAN_8,G.PDF_417,G.RSS_14,G.RSS_EXPANDED,G.UPC_A,G.UPC_E,G.UPC_EAN_EXTENSION];if(!g||typeof g=="boolean"||!g.formatsToSupport)return h;if(!Array.isArray(g.formatsToSupport))throw"configOrVerbosityFlag.formatsToSupport should be undefined or an array.";if(g.formatsToSupport.length===0)throw"Atleast 1 formatsToSupport is needed.";for(var I=[],y=0,A=g.formatsToSupport;y<A.length;y++){var R=A[y];pi(R)?I.push(R):this.logger.warn("Invalid format: ".concat(R," passed in config, ignoring."))}if(I.length===0)throw"None of formatsToSupport match supported values.";return I},w.prototype.getUseBarCodeDetectorIfSupported=function(g){if(Te(g))return!0;if(!Te(g.useBarCodeDetectorIfSupported))return g.useBarCodeDetectorIfSupported!==!1;if(Te(g.experimentalFeatures))return!0;var h=g.experimentalFeatures;return Te(h.useBarCodeDetectorIfSupported)?!0:h.useBarCodeDetectorIfSupported!==!1},w.prototype.validateQrboxSize=function(g,h,I){var y=this,A=I.qrbox;this.validateQrboxConfig(A);var R=this.toQrdimensions(g,h,A),U=function(m){if(m<oe.MIN_QR_BOX_SIZE)throw"minimum size of 'config.qrbox' dimension value is"+" ".concat(oe.MIN_QR_BOX_SIZE,"px.")},P=function(m){return m>g&&(y.logger.warn("`qrbox.width` or `qrbox` is larger than the width of the root element. The width will be truncated to the width of root element."),m=g),m};U(R.width),U(R.height),R.width=P(R.width)},w.prototype.validateQrboxConfig=function(g){if(typeof g!="number"&&typeof g!="function"&&(g.width===void 0||g.height===void 0))throw"Invalid instance of QrDimensions passed for 'config.qrbox'. Both 'width' and 'height' should be set."},w.prototype.toQrdimensions=function(g,h,I){if(typeof I=="number")return{width:I,height:I};if(typeof I=="function")try{return I(g,h)}catch(y){throw new Error("qrbox config was passed as a function but it failed with unknown error"+y)}return I},w.prototype.setupUi=function(g,h,I){I.isShadedBoxEnabled()&&this.validateQrboxSize(g,h,I);var y=Te(I.qrbox)?{width:g,height:h}:I.qrbox;this.validateQrboxConfig(y);var A=this.toQrdimensions(g,h,y);A.height>h&&this.logger.warn("[Html5Qrcode] config.qrbox has height that isgreater than the height of the video stream. Shading will be ignored");var R=I.isShadedBoxEnabled()&&A.height<=h,U={x:0,y:0,width:g,height:h},P=R?this.getShadedRegionBounds(g,h,A):U,m=this.createCanvasElement(P.width,P.height),L={willReadFrequently:!0},D=m.getContext("2d",L);D.canvas.width=P.width,D.canvas.height=P.height,this.element.append(m),R&&this.possiblyInsertShadingElement(this.element,g,h,A),this.createScannerPausedUiElement(this.element),this.qrRegion=P,this.context=D,this.canvasElement=m},w.prototype.createScannerPausedUiElement=function(g){var h=document.createElement("div");h.innerText=$e.scannerPaused(),h.style.display="none",h.style.position="absolute",h.style.top="0px",h.style.zIndex="1",h.style.background="rgba(9, 9, 9, 0.46)",h.style.color="#FFECEC",h.style.textAlign="center",h.style.width="100%",g.appendChild(h),this.scannerPausedUiElement=h},w.prototype.scanContext=function(g,h){var I=this;return this.stateManagerProxy.isPaused()?Promise.resolve(!1):this.qrcode.decodeAsync(this.canvasElement).then(function(y){return g(y.text,Rr.createFromQrcodeResult(y)),I.possiblyUpdateShaders(!0),!0}).catch(function(y){I.possiblyUpdateShaders(!1);var A=$e.codeParseError(y);return h(A,Ti.createFrom(A)),!1})},w.prototype.foreverScan=function(g,h,I){var y=this;if(this.shouldScan&&this.renderedCamera){var A=this.renderedCamera.getSurface(),R=A.videoWidth/A.clientWidth,U=A.videoHeight/A.clientHeight;if(!this.qrRegion)throw"qrRegion undefined when localMediaStream is ready.";var P=this.qrRegion.width*R,m=this.qrRegion.height*U,L=this.qrRegion.x*R,D=this.qrRegion.y*U;this.context.drawImage(A,L,D,P,m,0,0,this.qrRegion.width,this.qrRegion.height);var dt=function(){y.foreverScanTimeout=setTimeout(function(){y.foreverScan(g,h,I)},y.getTimeoutFps(g.fps))};this.scanContext(h,I).then(function(et){!et&&g.disableFlip!==!0?(y.context.translate(y.context.canvas.width,0),y.context.scale(-1,1),y.scanContext(h,I).finally(function(){dt()})):dt()}).catch(function(et){y.logger.logError("Error happend while scanning context",et),dt()})}},w.prototype.createVideoConstraints=function(g){if(typeof g=="string")return{deviceId:{exact:g}};if(typeof g=="object"){var h="facingMode",I="deviceId",y={user:!0,environment:!0},A="exact",R=function(Zt){if(Zt in y)return!0;
26throw"config has invalid 'facingMode' value = "+"'".concat(Zt,"'")},U=Object.keys(g);if(U.length!==1)throw"'cameraIdOrConfig' object should have exactly 1 key,"+" if passed as an object, found ".concat(U.length," keys");var P=Object.keys(g)[0];if(P!==h&&P!==I)throw"Only '".concat(h,"' and '").concat(I,"' ")+" are supported for 'cameraIdOrConfig'";if(P===h){var m=g.facingMode;if(typeof m=="string"){if(R(m))return{facingMode:m}}else if(typeof m=="object")if(A in m){if(R(m["".concat(A)]))return{facingMode:{exact:m["".concat(A)]}}}else throw"'facingMode' should be string or object with"+" ".concat(A," as key.");else{var L=typeof m;throw"Invalid type of 'facingMode' = ".concat(L)}}else{var D=g.deviceId;if(typeof D=="string")return{deviceId:D};if(typeof D=="object"){if(A in D)return{deviceId:{exact:D["".concat(A)]}};throw"'deviceId' should be string or object with"+" ".concat(A," as key.")}else{var dt=typeof D;throw"Invalid type of 'deviceId' = ".concat(dt)}}}var et=typeof g;throw"Invalid type of 'cameraIdOrConfig' = ".concat(et)},w.prototype.computeCanvasDrawConfig=function(g,h,I,y){if(g<=I&&h<=y){var A=(I-g)/2,R=(y-h)/2;return{x:A,y:R,width:g,height:h}}else{var U=g,P=h;return g>I&&(h=I/g*h,g=I),h>y&&(g=y/h*g,h=y),this.logger.log("Image downsampled from "+"".concat(U,"X").concat(P)+" to ".concat(g,"X").concat(h,".")),this.computeCanvasDrawConfig(g,h,I,y)}},w.prototype.clearElement=function(){if(this.stateManagerProxy.isScanning())throw"Cannot clear while scan is ongoing, close it first.";var g=document.getElementById(this.elementId);g&&(g.innerHTML="")},w.prototype.possiblyUpdateShaders=function(g){this.qrMatch!==g&&(this.hasBorderShaders&&this.borderShaders&&this.borderShaders.length&&this.borderShaders.forEach(function(h){h.style.backgroundColor=g?oe.BORDER_SHADER_MATCH_COLOR:oe.BORDER_SHADER_DEFAULT_COLOR}),this.qrMatch=g)},w.prototype.possiblyCloseLastScanImageFile=function(){this.lastScanImageFile&&(URL.revokeObjectURL(this.lastScanImageFile),this.lastScanImageFile=null)},w.prototype.createCanvasElement=function(g,h,I){var y=g,A=h,R=document.createElement("canvas");return R.style.width="".concat(y,"px"),R.style.height="".concat(A,"px"),R.style.display="none",R.id=Te(I)?"qr-canvas":I,R},w.prototype.getShadedRegionBounds=function(g,h,I){if(I.width>g||I.height>h)throw"'config.qrbox' dimensions should not be greater than the dimensions of the root HTML element.";return{x:(g-I.width)/2,y:(h-I.height)/2,width:I.width,height:I.height}},w.prototype.possiblyInsertShadingElement=function(g,h,I,y){if(!(h-y.width<1||I-y.height<1)){var A=document.createElement("div");A.style.position="absolute";var R=(h-y.width)/2,U=(I-y.height)/2;if(A.style.borderLeft="".concat(R,"px solid rgba(0, 0, 0, 0.48)"),A.style.borderRight="".concat(R,"px solid rgba(0, 0, 0, 0.48)"),A.style.borderTop="".concat(U,"px solid rgba(0, 0, 0, 0.48)"),A.style.borderBottom="".concat(U,"px solid rgba(0, 0, 0, 0.48)"),A.style.boxSizing="border-box",A.style.top="0px",A.style.bottom="0px",A.style.left="0px",A.style.right="0px",A.id="".concat(oe.SHADED_REGION_ELEMENT_ID),h-y.width<11||I-y.height<11)this.hasBorderShaders=!1;else{var P=5,m=40;this.insertShaderBorders(A,m,P,-P,null,0,!0),this.insertShaderBorders(A,m,P,-P,null,0,!1),this.insertShaderBorders(A,m,P,null,-P,0,!0),this.insertShaderBorders(A,m,P,null,-P,0,!1),this.insertShaderBorders(A,P,m+P,-P,null,-P,!0),this.insertShaderBorders(A,P,m+P,null,-P,-P,!0),this.insertShaderBorders(A,P,m+P,-P,null,-P,!1),this.insertShaderBorders(A,P,m+P,null,-P,-P,!1),this.hasBorderShaders=!0}g.append(A)}},w.prototype.insertShaderBorders=function(g,h,I,y,A,R,U){var P=document.createElement("div");P.style.position="absolute",P.style.backgroundColor=oe.BORDER_SHADER_DEFAULT_COLOR,P.style.width="".concat(h,"px"),P.style.height="".concat(I,"px"),y!==null&&(P.style.top="".concat(y,"px")),A!==null&&(P.style.bottom="".concat(A,"px")),U?P.style.left="".concat(R,"px"):P.style.right="".concat(R,"px"),this.borderShaders||(this.borderShaders=[]),this.borderShaders.push(P),g.appendChild(P)},w.prototype.showPausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="block"},w.prototype.hidePausedState=function(){if(!this.scannerPausedUiElement)throw"[internal error] scanner paused UI element not found";this.scannerPausedUiElement.style.display="none"},w.prototype.getTimeoutFps=function(g){return 1e3/g},w}(),Lr;
26(function(w){w[w.STATUS_DEFAULT=0]="STATUS_DEFAULT",w[w.STATUS_SUCCESS=1]="STATUS_SUCCESS",w[w.STATUS_WARNING=2]="STATUS_WARNING",w[w.STATUS_REQUESTING_PERMISSION=3]="STATUS_REQUESTING_PERMISSION"})(Lr||(Lr={}));var Dn;(function(w){w[w.BACK=1]="BACK",w[w.FRONT=2]="FRONT"})(Dn||(Dn={}));var Mn;(function(w){w[w.PORTRAIT=1]="PORTRAIT",w[w.LANDSCAPE=2]="LANDSCAPE",w[w.ADAPTIVE=3]="ADAPTIVE"})(Mn||(Mn={}));var vn;(function(w){w[w.ALL=17]="ALL"})(vn||(vn={}));const Yi=Object.assign(Object.assign({},G),vn);var rr;(function(w){w.ZXING="zxing",w.MLKIT="mlkit"})(rr||(rr={}));const zi=[{selector:".scanner-container-display",css:"display: block;"},{selector:".scanner-dialog",css:"display: none; position: fixed; z-index: 999; left: 0; top: 0; width: 100%; height: 100%; overflow: auto; background-color: rgba(0,0,0,0.4);"},{selector:".scanner-dialog-inner",css:"background-color: #fefefe; margin: 2% auto; padding: 20px; border: 1px solid #888; width: 96%;"},{selector:".close-button",css:"color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer;"},{selector:".close-button:hover",css:"color: #222;"},{selector:".scanner-container-full-width",css:"width: 100%;"}];function Zi(w){const g="custom-style-os-cap-barcode";let h=document.getElementById(g);if(h||(h=document.createElement("style"),h.type="text/css",h.id=g,document.head.appendChild(h)),h.sheet){for(;h.sheet.cssRules.length;)h.sheet.deleteRule(0);for(const{selector:I,css:y}of w)h.sheet.insertRule(`${I} { ${y} }`)}else{h.textContent="";for(const{selector:I,css:y}of w)h.textContent+=`${I} { ${y} }`}}const Ki=Ai("CapacitorBarcodeScanner",{web:()=>(Zi(zi),Ei(()=>import("./web-Brw6WZih.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8])).then(w=>new w.CapacitorBarcodeScannerWeb))});class ji{static async scanBarcode(g){return g.scanInstructions=g.scanInstructions||" ",g.scanButton=g.scanButton||!1,g.scanText=g.scanText||" ",g.cameraDirection=g.cameraDirection||Dn.BACK,g.scanOrientation=g.scanOrientation||Mn.ADAPTIVE,Ki.scanBarcode(g)}}const $i=Object.freeze(Object.defineProperty({__proto__:null,CapacitorBarcodeScanner:ji,get CapacitorBarcodeScannerAndroidScanningLibrary(){return rr},get CapacitorBarcodeScannerCameraDirection(){return Dn},get CapacitorBarcodeScannerScanOrientation(){return Mn},CapacitorBarcodeScannerTypeHint:Yi,get CapacitorBarcodeScannerTypeHintALLOption(){return vn}},Symbol.toStringTag,{value:"Module"}));export{Mn as C,Ji as H,Yi as a,$i as i};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.