Files
securebit-chat/dist/qr-local.js
T

34 lines
459 KiB
JavaScript
Raw Normal View History

var r0=Object.create;var ca=Object.defineProperty;var i0=Object.getOwnPropertyDescriptor;var s0=Object.getOwnPropertyNames;var o0=Object.getPrototypeOf,a0=Object.prototype.hasOwnProperty;var Se=(r,a)=>()=>{try{return a||r((a={exports:{}}).exports,a),a.exports}catch(s){throw a=0,s}};var l0=(r,a,s,f)=>{if(a&&typeof a=="object"||typeof a=="function")for(let d of s0(a))!a0.call(r,d)&&d!==s&&ca(r,d,{get:()=>a[d],enumerable:!(f=i0(a,d))||f.enumerable});return r};var Br=(r,a,s)=>(s=r!=null?r0(o0(r)):{},l0(a||!r||!r.__esModule?ca(s,"default",{value:r,enumerable:!0}):s,r));var ua=Se((Rd,fa)=>{fa.exports=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}});var En=Se(Ln=>{var Ns,c0=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];Ln.getSymbolSize=function(a){if(!a)throw new Error('"version" cannot be null or undefined');if(a<1||a>40)throw new Error('"version" should be in range from 1 to 40');return a*4+17};Ln.getSymbolTotalCodewords=function(a){return c0[a]};Ln.getBCHDigit=function(r){let a=0;for(;r!==0;)a++,r>>>=1;return a};Ln.setToSJISFunction=function(a){if(typeof a!="function")throw new Error('"toSJISFunc" is not a valid function.');Ns=a};Ln.isKanjiModeEnabled=function(){return typeof Ns<"u"};Ln.toSJIS=function(a){return Ns(a)}});var Ii=Se(Lt=>{Lt.L={bit:1};Lt.M={bit:0};Lt.Q={bit:3};Lt.H={bit:2};function f0(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"l":case"low":return Lt.L;case"m":case"medium":return Lt.M;case"q":case"quartile":return Lt.Q;case"h":case"high":return Lt.H;default:throw new Error("Unknown EC Level: "+r)}}Lt.isValid=function(a){return a&&typeof a.bit<"u"&&a.bit>=0&&a.bit<4};Lt.from=function(a,s){if(Lt.isValid(a))return a;try{return f0(a)}catch{return s}}});var ga=Se((Bd,da)=>{function ha(){this.buffer=[],this.length=0}ha.prototype={get:function(r){let a=Math.floor(r/8);return(this.buffer[a]>>>7-r%8&1)===1},put:function(r,a){for(let s=0;s<a;s++)this.putBit((r>>>a-s-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(r){let a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),r&&(this.buffer[a]|=128>>>this.length%8),this.length++}};da.exports=ha});var wa=Se((Ld,xa)=>{function Lr(r){if(!r||r<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=r,this.data=new Uint8Array(r*r),this.reservedBit=new Uint8Array(r*r)}Lr.prototype.set=function(r,a,s,f){let d=r*this.size+a;this.data[d]=s,f&&(this.reservedBit[d]=!0)};Lr.prototype.get=function(r,a){return this.data[r*this.size+a]};Lr.prototype.xor=function(r,a,s){this.data[r*this.size+a]^=s};Lr.prototype.isReserved=function(r,a){return this.reservedBit[r*this.size+a]};xa.exports=Lr});var pa=Se(bi=>{var u0=En().getSymbolSize;bi.getRowColCoords=function(a){if(a===1)return[];let s=Math.floor(a/7)+2,f=u0(a),d=f===145?26:Math.ceil((f-13)/(2*s-2))*2,h=[f-7];for(let p=1;p<s-1;p++)h[p]=h[p-1]-d;return h.push(6),h.reverse()};bi.getPositions=function(a){let s=[],f=bi.getRowColCoords(a),d=f.length;for(let h=0;h<d;h++)for(let p=0;p<d;p++)h===0&&p===0||h===0&&p===d-1||h===d-1&&p===0||s.push([f[h],f[p]]);return s}});var ma=Se(Ea=>{var h0=En().getSymbolSize,Aa=7;Ea.getPositions=function(a){let s=h0(a);return[[0,0],[s-Aa,0],[0,s-Aa]]}});var Ca=Se(Pe=>{Pe.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};var kn={N1:3,N2:3,N3:40,N4:10};Pe.isValid=function(a){return a!=null&&a!==""&&!isNaN(a)&&a>=0&&a<=7};Pe.from=function(a){return Pe.isValid(a)?parseInt(a,10):void 0};Pe.getPenaltyN1=function(a){let s=a.size,f=0,d=0,h=0,p=null,A=null;for(let y=0;y<s;y++){d=h=0,p=A=null;for(let x=0;x<s;x++){let _=a.get(y,x);_===p?d++:(d>=5&&(f+=kn.N1+(d-5)),p=_,d=1),_=a.get(x,y),_===A?h++:(h>=5&&(f+=kn.N1+(h-5)),A=_,h=1)}d>=5&&(f+=kn.N1+(d-5)),h>=5&&(f+=kn.N1+(h-5))}return f};Pe.getPenaltyN2=function(a){let s=a.size,f=0;for(let d=0;d<s-1;d++)for(let h=0;h<s-1;h+
]))+`;an.KANJI=new RegExp(Fr,"g");an.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");an.BYTE=new RegExp(x0,"g");an.NUMERIC=new RegExp(Na,"g");an.ALPHANUMERIC=new RegExp(g0,"g");var w0=new RegExp("^"+Fr+"$"),p0=new RegExp("^"+Na+"$"),A0=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");an.testKanji=function(a){return w0.test(a)};an.testNumeric=function(a){return p0.test(a)};an.testAlphanumeric=function(a){return A0.test(a)}});var Cn=Se(Qe=>{var E0=vs(),Ls=Bs();Qe.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]};Qe.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]};Qe.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]};Qe.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]};Qe.MIXED={bit:-1};Qe.getCharCountIndicator=function(a,s){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!E0.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?a.ccBits[0]:s<27?a.ccBits[1]:a.ccBits[2]};Qe.getBestModeForData=function(a){return Ls.testNumeric(a)?Qe.NUMERIC:Ls.testAlphanumeric(a)?Qe.ALPHANUMERIC:Ls.testKanji(a)?Qe.KANJI:Qe.BYTE};Qe.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")};Qe.isValid=function(a){return a&&a.bit&&a.ccBits};function m0(r){if(typeof r!="string")throw new Error("Param is not a string");switch(r.toLowerCase()){case"numeric":return Qe.NUMERIC;case"alphanumeric":return Qe.ALPHANUMERIC;case"kanji":return Qe.KANJI;case"byte":return Qe.BYTE;default:throw new Error("Unknown mode: "+r)}}Qe.from=function(a,s){if(Qe.isValid(a))return a;try{return m0(a)}catch{return s}}});var va=Se(Pn=>{var Oi=En(),C0=Os(),Ma=Ii(),_n=Cn(),ks=vs(),Ra=7973,Oa=Oi.getBCHDigit(Ra);function _0(r,a,s){for(let f=1;f<=40;f++)if(a<=Pn.getCapacity(f,s,r))return f}function Da(r,a){return _n.getCharCountIndicator(r,a)+4}function y0(r,a){let s=0;return r.forEach(function(f){let d=Da(f.mode,a);s+=d+f.getBitsLength()}),s}function I0(r,a){for(let s=1;s<=40;s++)if(y0(r,s)<=Pn.getCapacity(s,a,_n.MIXED))return s}Pn.from=function(a,s){return ks.isValid(a)?parseInt(a,10):s};Pn.getCapacity=function(a,s,f){if(!ks.isValid(a))throw new Error("Invalid QR Code version");typeof f>"u"&&(f=_n.BYTE);let d=Oi.getSymbolTotalCodewords(a),h=C0.getTotalCodewordsCount(a,s),p=(d-h)*8;if(f===_n.MIXED)return p;let A=p-Da(f,a);switch(f){case _n.NUMERIC:return Math.floor(A/10*3);case _n.ALPHANUMERIC:return Math.floor(A/11*2);case _n.KANJI:return Math.floor(A/13);case _n.BYTE:default:return Math.floor(A/8)}};Pn.getBestVersionForData=function(a,s){let f,d=Ma.from(s,Ma.M);if(Array.isArray(a)){if(a.length>1)return I0(a,d);if(a.length===0)return 1;f=a[0]}else f=a;return _0(f.mode,f.getLength(),d)};Pn.getEncodedBits=function(a){if(!ks.isValid(a)||a<7)throw new Error("Invalid QR Code version");let s=a<<12;for(;Oi.getBCHDigit(s)-Oa>=0;)s^=Ra<<Oi.getBCHDigit(s)-Oa;return a<<12|s}});var Pa=Se(ka=>{var Ps=En(),La=1335,b0=21522,Ba=Ps.getBCHDigit(La);ka.getEncodedBits=function(a,s){let f=a.bit<<3|s,d=f<<10;for(;Ps.getBCHDigit(d)-Ba>=0;)d^=La<<Ps.getBCHDigit(d)-Ba;return(f<<10|d)^b0}});var Ua=Se((Zd,Fa)=>{var S0=Cn();function ir(r){this.mode=S0.NUMERIC,this.data=r.toString()}ir.getBitsLength=function(a){return 10*Math.floor(a/3)+(a%3?a%3*3+1:0)};ir.prototype.getLength=function(){return this.data.length};ir.prototype.getBitsLength=function(){return ir.getBitsLength(this.data.length)};ir.prototype.write=function(a){let s,f,d;for(s=0;s+3<=this.data.length;s+=3)f=this.data.substr(s,3),d=parseInt(f,10),a.put(d,10);let h=this.data.length-s;h>0&&(f=this.data.substr(s),d=parseInt(f,10),a.put(d,h*3+1))};Fa.exports=ir});var Ha=Se((Qd,za)=>{var T0=Cn(),Fs=["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"," ","$","%","*","+","-",".","/",":"];function sr(r){this.mode=T0.ALPHANUMERIC,this.data=r}sr.getBitsLength=function(a){return 11*Math.floor(a/2)+6*(a%2)};sr.prototype.getLength=function(){return this.data.length};sr.prototype.getBitsLength=function(){return sr.getBitsLength(this.data.length)};sr.prototype.write=function(a){let s;for(s=0;s+2<=this.data.length;s+=2){let f=Fs.indexOf(this.data[s])*45;f+=
Make sure your charset is UTF-8`);s=(s>>>8&255)*192+(s&255),r.put(s,13)}};Ga.exports=ar});var Ya=Se((Jd,Us)=>{"use strict";var Ur={single_source_shortest_paths:function(r,a,s){var f={},d={};d[a]=0;var h=Ur.PriorityQueue.make();h.push(a,0);for(var p,A,y,x,_,v,R,N,V;!h.empty();){p=h.pop(),A=p.value,x=p.cost,_=r[A]||{};for(y in _)_.hasOwnProperty(y)&&(v=_[y],R=x+v,N=d[y],V=typeof d[y]>"u",(V||N>R)&&(d[y]=R,h.push(y,R),f[y]=A))}if(typeof s<"u"&&typeof d[s]>"u"){var K=["Could not find a path from ",a," to ",s,"."].join("");throw new Error(K)}return f},extract_shortest_path_from_predecessor_list:function(r,a){for(var s=[],f=a,d;f;)s.push(f),d=r[f],f=r[f];return s.reverse(),s},find_path:function(r,a,s){var f=Ur.single_source_shortest_paths(r,a,s);return Ur.extract_shortest_path_from_predecessor_list(f,s)},PriorityQueue:{make:function(r){var a=Ur.PriorityQueue,s={},f;r=r||{};for(f in a)a.hasOwnProperty(f)&&(s[f]=a[f]);return s.queue=[],s.sorter=r.sorter||a.default_sorter,s},default_sorter:function(r,a){return r.cost-a.cost},push:function(r,a){var s={value:r,cost:a};this.queue.push(s),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};typeof Us<"u"&&(Us.exports=Ur)});var el=Se(lr=>{var Me=Cn(),Qa=Ua(),Ka=Ha(),qa=Xa(),Ja=ja(),zr=Bs(),Ri=En(),R0=Ya();function Wa(r){return unescape(encodeURIComponent(r)).length}function Hr(r,a,s){let f=[],d;for(;(d=r.exec(s))!==null;)f.push({data:d[0],index:d.index,mode:a,length:d[0].length});return f}function $a(r){let a=Hr(zr.NUMERIC,Me.NUMERIC,r),s=Hr(zr.ALPHANUMERIC,Me.ALPHANUMERIC,r),f,d;return Ri.isKanjiModeEnabled()?(f=Hr(zr.BYTE,Me.BYTE,r),d=Hr(zr.KANJI,Me.KANJI,r)):(f=Hr(zr.BYTE_KANJI,Me.BYTE,r),d=[]),a.concat(s,f,d).sort(function(p,A){return p.index-A.index}).map(function(p){return{data:p.data,mode:p.mode,length:p.length}})}function zs(r,a){switch(a){case Me.NUMERIC:return Qa.getBitsLength(r);case Me.ALPHANUMERIC:return Ka.getBitsLength(r);case Me.KANJI:return Ja.getBitsLength(r);case Me.BYTE:return qa.getBitsLength(r)}}function D0(r){return r.reduce(function(a,s){let f=a.length-1>=0?a[a.length-1]:null;return f&&f.mode===s.mode?(a[a.length-1].data+=s.data,a):(a.push(s),a)},[])}function v0(r){let a=[];for(let s=0;s<r.length;s++){let f=r[s];switch(f.mode){case Me.NUMERIC:a.push([f,{data:f.data,mode:Me.ALPHANUMERIC,length:f.length},{data:f.data,mode:Me.BYTE,length:f.length}]);break;case Me.ALPHANUMERIC:a.push([f,{data:f.data,mode:Me.BYTE,length:f.length}]);break;case Me.KANJI:a.push([f,{data:f.data,mode:Me.BYTE,length:Wa(f.data)}]);break;case Me.BYTE:a.push([{data:f.data,mode:Me.BYTE,length:Wa(f.data)}])}}return a}function B0(r,a){let s={},f={start:{}},d=["start"];for(let h=0;h<r.length;h++){let p=r[h],A=[];for(let y=0;y<p.length;y++){let x=p[y],_=""+h+y;A.push(_),s[_]={node:x,lastCount:0},f[_]={};for(let v=0;v<d.length;v++){let R=d[v];s[R]&&s[R].node.mode===x.mode?(f[R][_]=zs(s[R].lastCount+x.length,x.mode)-zs(s[R].lastCount,x.mode),s[R].lastCount+=x.length):(s[R]&&(s[R].lastCount=x.length),f[R][_]=zs(x.length,x.mode)+4+Me.getCharCountIndicator(x.mode,a))}}d=A}for(let h=0;h<d.length;h++)f[d[h]].end=0;return{map:f,table:s}}function Za(r,a){let s,f=Me.getBestModeForData(r);if(s=Me.from(a,f),s!==Me.BYTE&&s.bit<f.bit)throw new Error('"'+r+'" cannot be encoded with mode '+Me.toString(s)+`.
Suggested mode is: `+Me.toString(f));switch(s===Me.KANJI&&!Ri.isKanjiModeEnabled()&&(s=Me.BYTE),s){case Me.NUMERIC:return new Qa(r);case Me.ALPHANUMERIC:return new Ka(r);case Me.KANJI:return new Ja(r);case Me.BYTE:return new qa(r)}}lr.fromArray=function(a){return a.reduce(function(s,f){return typeof f=="string"?s.push(Za(f,null)):f.data&&s.push(Za(f.data,f.mode)),s},[])};lr.fromString=function(a,s){let f=$a(a,Ri.isKanjiModeEnabled()),d=v0(f),h=B0(d,s),p=R0.find_path(h.map,"start","end"),A=[];for(let y=1;y<p.length-1;y++)A.push(h.table[p[y]].node);return lr.fromArray(D0(A))};lr.rawSplit=function(a){return lr.fromArray($a(a,Ri.isKanjiModeEnabled()))}});var nl=Se(tl=>{var vi=En(),Hs=Ii(),L0=ga(),k0=wa(),P0=pa(),F0=ma(),Gs=Ca(),js=Os(),U0=Sa(),Di=va(),z0=Pa(),H0=Cn(),Vs=el();function V0(r,a){let s=r.size,f=F0.getPositions(a);for(let d=0;d<f.length;d++){let h=f[d][0],p=f[d][1];for(let A=-1;A<=7;A++)if(!(h+A<=-1||s<=h+A))for(let y=-1;y<=7;y++)p+y<=-1||s<=p+y||(A>=0&&A<=6&&(y===0||y===6)||y>=0&&y<=6&&(A===0||A===6)||A>=2&&A<=4&&y>=2&&y<=4?r.set(h+A,p+y,!0,!0):r.set(h+A,p+y,!1,!0))}}function X0(r){let a=r.size;for(let s=8;s<a-8;s++){let f=s%2===0;r.set(s,6,f,!0),r.set(6,s,f,!0)}}function G0(r,a){let s=P0.getPositions(a);for(let f=0;f<s.length;f++){let d=s[f][0],h=s[f][1];for(let p=-2;p<=2;p++)for(let A=-2;A<=2;A++)p===-2||p===2||A===-2||A===2||p===0&&A===0?r.set(d+p,h+A,!0,!0):r.set(d+p,h+A,!1,!0)}}function j0(r,a){let s=r.size,f=Di.getEncodedBits(a),d,h,p;for(let A=0;A<18;A++)d=Math.floor(A/3),h=A%3+s-8-3,p=(f>>A&1)===1,r.set(d,h,p,!0),r.set(h,d,p,!0)}function Xs(r,a,s){let f=r.size,d=z0.getEncodedBits(a,s),h,p;for(h=0;h<15;h++)p=(d>>h&1)===1,h<6?r.set(h,8,p,!0):h<8?r.set(h+1,8,p,!0):r.set(f-15+h,8,p,!0),h<8?r.set(8,f-h-1,p,!0):h<9?r.set(8,15-h-1+1,p,!0):r.set(8,15-h-1,p,!0);r.set(f-8,8,1,!0)}function Y0(r,a){let s=r.size,f=-1,d=s-1,h=7,p=0;for(let A=s-1;A>0;A-=2)for(A===6&&A--;;){for(let y=0;y<2;y++)if(!r.isReserved(d,A-y)){let x=!1;p<a.length&&(x=(a[p]>>>h&1)===1),r.set(d,A-y,x),h--,h===-1&&(p++,h=7)}if(d+=f,d<0||s<=d){d-=f,f=-f;break}}}function W0(r,a,s){let f=new L0;s.forEach(function(y){f.put(y.mode.bit,4),f.put(y.getLength(),H0.getCharCountIndicator(y.mode,r)),y.write(f)});let d=vi.getSymbolTotalCodewords(r),h=js.getTotalCodewordsCount(r,a),p=(d-h)*8;for(f.getLengthInBits()+4<=p&&f.put(0,4);f.getLengthInBits()%8!==0;)f.putBit(0);let A=(p-f.getLengthInBits())/8;for(let y=0;y<A;y++)f.put(y%2?17:236,8);return Z0(f,r,a)}function Z0(r,a,s){let f=vi.getSymbolTotalCodewords(a),d=js.getTotalCodewordsCount(a,s),h=f-d,p=js.getBlocksCount(a,s),A=f%p,y=p-A,x=Math.floor(f/p),_=Math.floor(h/p),v=_+1,R=x-_,N=new U0(R),V=0,K=new Array(p),H=new Array(p),U=0,W=new Uint8Array(r.buffer);for(let O=0;O<p;O++){let le=O<y?_:v;K[O]=W.slice(V,V+le),H[O]=N.encode(K[O]),V+=le,U=Math.max(U,le)}let te=new Uint8Array(f),z=0,L,Y;for(L=0;L<U;L++)for(Y=0;Y<p;Y++)L<K[Y].length&&(te[z++]=K[Y][L]);for(L=0;L<R;L++)for(Y=0;Y<p;Y++)te[z++]=H[Y][L];return te}function Q0(r,a,s,f){let d;if(Array.isArray(r))d=Vs.fromArray(r);else if(typeof r=="string"){let x=a;if(!x){let _=Vs.rawSplit(r);x=Di.getBestVersionForData(_,s)}d=Vs.fromString(r,x||40)}else throw new Error("Invalid data");let h=Di.getBestVersionForData(d,s);if(!h)throw new Error("The amount of data is too big to be stored in a QR Code");if(!a)a=h;else if(a<h)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+h+`.
`);let p=W0(a,s,d),A=vi.getSymbolSize(a),y=new k0(A);return V0(y,a),X0(y),G0(y,a),Xs(y,s,0),a>=7&&j0(y,a),Y0(y,p),isNaN(f)&&(f=Gs.getBestMask(y,Xs.bind(null,y,s))),Gs.applyMask(f,y),Xs(y,s,f),{modules:y,version:a,errorCorrectionLevel:s,maskPattern:f,segments:d}}tl.create=function(a,s){if(typeof a>"u"||a==="")throw new Error("No input text");let f=Hs.M,d,h;return typeof s<"u"&&(f=Hs.from(s.errorCorrectionLevel,Hs.M),d=Di.from(s.version),h=Gs.from(s.maskPattern),s.toSJISFunc&&vi.setToSJISFunction(s.toSJISFunc)),Q0(a,d,f,h)}});var Ys=Se(Fn=>{function rl(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let a=r.slice().replace("#","").split("");if(a.length<3||a.length===5||a.length>8)throw new Error("Invalid hex color: "+r);(a.length===3||a.length===4)&&(a=Array.prototype.concat.apply([],a.map(function(f){return[f,f]}))),a.length===6&&a.push("F","F");let s=parseInt(a.join(""),16);return{r:s>>24&255,g:s>>16&255,b:s>>8&255,a:s&255,hex:"#"+a.slice(0,6).join("")}}Fn.getOptions=function(a){a||(a={}),a.color||(a.color={});let s=typeof a.margin>"u"||a.margin===null||a.margin<0?4:a.margin,f=a.width&&a.width>=21?a.width:void 0,d=a.scale||4;return{width:f,scale:f?4:d,margin:s,color:{dark:rl(a.color.dark||"#000000ff"),light:rl(a.color.light||"#ffffffff")},type:a.type,rendererOpts:a.rendererOpts||{}}};Fn.getScale=function(a,s){return s.width&&s.width>=a+s.margin*2?s.width/(a+s.margin*2):s.scale};Fn.getImageWidth=function(a,s){let f=Fn.getScale(a,s);return Math.floor((a+s.margin*2)*f)};Fn.qrToImageData=function(a,s,f){let d=s.modules.size,h=s.modules.data,p=Fn.getScale(d,f),A=Math.floor((d+f.margin*2)*p),y=f.margin*p,x=[f.color.light,f.color.dark];for(let _=0;_<A;_++)for(let v=0;v<A;v++){let R=(_*A+v)*4,N=f.color.light;if(_>=y&&v>=y&&_<A-y&&v<A-y){let V=Math.floor((_-y)/p),K=Math.floor((v-y)/p);N=x[h[V*d+K]?1:0]}a[R++]=N.r,a[R++]=N.g,a[R++]=N.b,a[R]=N.a}}});var il=Se(Bi=>{var Ws=Ys();function K0(r,a,s){r.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=s,a.width=s,a.style.height=s+"px",a.style.width=s+"px"}function q0(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}Bi.render=function(a,s,f){let d=f,h=s;typeof d>"u"&&(!s||!s.getContext)&&(d=s,s=void 0),s||(h=q0()),d=Ws.getOptions(d);let p=Ws.getImageWidth(a.modules.size,d),A=h.getContext("2d"),y=A.createImageData(p,p);return Ws.qrToImageData(y.data,a,d),K0(A,h,p),A.putImageData(y,0,0),h};Bi.renderToDataURL=function(a,s,f){let d=f;typeof d>"u"&&(!s||!s.getContext)&&(d=s,s=void 0),d||(d={});let h=Bi.render(a,s,d),p=d.type||"image/png",A=d.rendererOpts||{};return h.toDataURL(p,A.quality)}});var al=Se(ol=>{var J0=Ys();function sl(r,a){let s=r.a/255,f=a+'="'+r.hex+'"';return s<1?f+" "+a+'-opacity="'+s.toFixed(2).slice(1)+'"':f}function Zs(r,a,s){let f=r+a;return typeof s<"u"&&(f+=" "+s),f}function $0(r,a,s){let f="",d=0,h=!1,p=0;for(let A=0;A<r.length;A++){let y=Math.floor(A%a),x=Math.floor(A/a);!y&&!h&&(h=!0),r[A]?(p++,A>0&&y>0&&r[A-1]||(f+=h?Zs("M",y+s,.5+x+s):Zs("m",d,0),d=0,h=!1),y+1<a&&r[A+1]||(f+=Zs("h",p),p=0)):d++}return f}ol.render=function(a,s,f){let d=J0.getOptions(s),h=a.modules.size,p=a.modules.data,A=h+d.margin*2,y=d.color.light.a?"<path "+sl(d.color.light,"fill")+' d="M0 0h'+A+"v"+A+'H0z"/>':"",x="<path "+sl(d.color.dark,"stroke")+' d="'+$0(p,h,d.margin)+'"/>',_='viewBox="0 0 '+A+" "+A+'"',R='<svg xmlns="http://www.w3.org/2000/svg" '+(d.width?'width="'+d.width+'" height="'+d.width+'" ':"")+_+' shape-rendering="crispEdges">'+y+x+`</svg>
`;return typeof f=="function"&&f(null,R),R}});var cl=Se(Vr=>{var ef=ua(),Qs=nl(),ll=il(),tf=al();function Ks(r,a,s,f,d){let h=[].slice.call(arguments,1),p=h.length,A=typeof h[p-1]=="function";if(!A&&!ef())throw new Error("Callback required as last argument");if(A){if(p<2)throw new Error("Too few arguments provided");p===2?(d=s,s=a,a=f=void 0):p===3&&(a.getContext&&typeof d>"u"?(d=f,f=void 0):(d=f,f=s,s=a,a=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(s=a,a=f=void 0):p===2&&!a.getContext&&(f=s,s=a,a=void 0),new Promise(function(y,x){try{let _=Qs.create(s,f);y(r(_,a,f))}catch(_){x(_)}})}try{let y=Qs.create(s,f);d(null,r(y,a,f))}catch(y){d(y)}}Vr.create=Qs.create;Vr.toCanvas=Ks.bind(null,ll.render);Vr.toDataURL=Ks.bind(null,ll.renderToDataURL);Vr.toString=Ks.bind(null,function(r,a,s){return tf.render(r,s)})});var xl=Se((Fi,gl)=>{(function(r,a){typeof Fi=="object"&&typeof gl<"u"?a(Fi):typeof define=="function"&&define.amd?define(["exports"],a):(r=typeof globalThis<"u"?globalThis:r||self,a(r.ZXing={}))})(Fi,(function(r){"use strict";function a(E){return E==null}var s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,e){E.__proto__=e}||function(E,e){for(var t in e)e.hasOwnProperty(t)&&(E[t]=e[t])};function f(E,e){s(E,e);function t(){this.constructor=E}E.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}function d(E,e){var t=Object.setPrototypeOf;t?t(E,e):E.__proto__=e}function h(E,e){e===void 0&&(e=E.constructor);var t=Error.captureStackTrace;t&&t(E,e)}var p=(function(E){f(e,E);function e(t){var n=this.constructor,i=E.call(this,t)||this;return Object.defineProperty(i,"name",{value:n.name,enumerable:!1}),d(i,n.prototype),h(i),i}return e})(Error);class A extends p{constructor(e=void 0){super(e),this.message=e}getKind(){return this.constructor.kind}}A.kind="Exception";class y extends A{}y.kind="ArgumentException";class x extends A{}x.kind="IllegalArgumentException";class _{constructor(e){if(this.binarizer=e,e===null)throw new x("Binarizer must be non-null.")}getWidth(){return this.binarizer.getWidth()}getHeight(){return this.binarizer.getHeight()}getBlackRow(e,t){return this.binarizer.getBlackRow(e,t)}getBlackMatrix(){return(this.matrix===null||this.matrix===void 0)&&(this.matrix=this.binarizer.getBlackMatrix()),this.matrix}isCropSupported(){return this.binarizer.getLuminanceSource().isCropSupported()}crop(e,t,n,i){let o=this.binarizer.getLuminanceSource().crop(e,t,n,i);return new _(this.binarizer.createBinarizer(o))}isRotateSupported(){return this.binarizer.getLuminanceSource().isRotateSupported()}rotateCounterClockwise(){let e=this.binarizer.getLuminanceSource().rotateCounterClockwise();return new _(this.binarizer.createBinarizer(e))}rotateCounterClockwise45(){let e=this.binarizer.getLuminanceSource().rotateCounterClockwise45();return new _(this.binarizer.createBinarizer(e))}toString(){try{return this.getBlackMatrix().toString()}catch{return""}}}class v extends A{static getChecksumInstance(){return new v}}v.kind="ChecksumException";class R{constructor(e){this.source=e}getLuminanceSource(){return this.source}getWidth(){return this.source.getWidth()}getHeight(){return this.source.getHeight()}}class N{static arraycopy(e,t,n,i,o){for(;o--;)n[i++]=e[t++]}static currentTimeMillis(){return Date.now()}}class V extends A{}V.kind="IndexOutOfBoundsException";class K extends V{constructor(e=void 0,t=void 0){super(t),this.index=e,this.message=t}}K.kind="ArrayIndexOutOfBoundsException";class H{static fill(e,t){for(let n=0,i=e.length;n<i;n++)e[n]=t}static fillWithin(e,t,n,i){H.rangeCheck(e.length,t,n);for(let o=t;o<n;o++)e[o]=i}static rangeCheck(e,t,n){if(t>n)throw new x("fromIndex("+t+") > toIndex("+n+")");if(t<0)throw new K(t);if(n>e)throw new K(n)}static asList(...e){return e}static create(e,t,n){return Array.from({length:e}).map(o=>Array.from({length:t}).fill(n))}static createInt32Array(e,t,n){return Array.from({length:e}).map(o=>Int32Array.from({length:t}).fill(n))}static equals(e,t){if(!e||!t||!e.length||!t.length||e.length!==t.length)return!1;for(let n=0,i=e.length;
`||e.charAt(g)==="\r"){if(o>l){if(c===-1)c=o-l;else if(o-l!==c)throw new x("row lengths do not match");l=o,u++}g++}else if(e.substring(g,g+t.length)===t)g+=t.length,i[o]=!0,o++;else if(e.substring(g,g+n.length)===n)g+=n.length,i[o]=!1,o++;else throw new x("illegal character encountered: "+e.substring(g));if(o>l){if(c===-1)c=o-l;else if(o-l!==c)throw new x("row lengths do not match");u++}let w=new $(c,u);for(let m=0;m<o;m++)i[m]&&w.set(Math.floor(m%c),Math.floor(m/c));return w}get(e,t){let n=t*this.rowSize+Math.floor(e/32);return(this.bits[n]>>>(e&31)&1)!==0}set(e,t){let n=t*this.rowSize+Math.floor(e/32);this.bits[n]|=1<<(e&31)&4294967295}unset(e,t){let n=t*this.rowSize+Math.floor(e/32);this.bits[n]&=~(1<<(e&31)&4294967295)}flip(e,t){let n=t*this.rowSize+Math.floor(e/32);this.bits[n]^=1<<(e&31)&4294967295}xor(e){if(this.width!==e.getWidth()||this.height!==e.getHeight()||this.rowSize!==e.getRowSize())throw new x("input matrix dimensions do not match");let t=new W(Math.floor(this.width/32)+1),n=this.rowSize,i=this.bits;for(let o=0,l=this.height;o<l;o++){let c=o*n,u=e.getRow(o,t).getBitArray();for(let g=0;g<n;g++)i[c+g]^=u[g]}}clear(){let e=this.bits,t=e.length;for(let n=0;n<t;n++)e[n]=0}setRegion(e,t,n,i){if(t<0||e<0)throw new x("Left and top must be nonnegative");if(i<1||n<1)throw new x("Height and width must be at least 1");let o=e+n,l=t+i;if(l>this.height||o>this.width)throw new x("The region must fit inside the matrix");let c=this.rowSize,u=this.bits;for(let g=t;g<l;g++){let w=g*c;for(let m=e;m<o;m++)u[w+Math.floor(m/32)]|=1<<(m&31)&4294967295}}getRow(e,t){t==null||t.getSize()<this.width?t=new W(this.width):t.clear();let n=this.rowSize,i=this.bits,o=e*n;for(let l=0;l<n;l++)t.setBulk(l*32,i[o+l]);return t}setRow(e,t){N.arraycopy(t.getBitArray(),0,this.bits,e*this.rowSize,this.rowSize)}rotate180(){let e=this.getWidth(),t=this.getHeight(),n=new W(e),i=new W(e);for(let o=0,l=Math.floor((t+1)/2);o<l;o++)n=this.getRow(o,n),i=this.getRow(t-1-o,i),n.reverse(),i.reverse(),this.setRow(o,i),this.setRow(t-1-o,n)}getEnclosingRectangle(){let e=this.width,t=this.height,n=this.rowSize,i=this.bits,o=e,l=t,c=-1,u=-1;for(let g=0;g<t;g++)for(let w=0;w<n;w++){let m=i[g*n+w];if(m!==0){if(g<l&&(l=g),g>u&&(u=g),w*32<o){let C=0;for(;(m<<31-C&4294967295)===0;)C++;w*32+C<o&&(o=w*32+C)}if(w*32+31>c){let C=31;for(;!(m>>>C);)C--;w*32+C>c&&(c=w*32+C)}}}return c<o||u<l?null:Int32Array.from([o,l,c-o+1,u-l+1])}getTopLeftOnBit(){let e=this.rowSize,t=this.bits,n=0;for(;n<t.length&&t[n]===0;)n++;if(n===t.length)return null;let i=n/e,o=n%e*32,l=t[n],c=0;for(;(l<<31-c&4294967295)===0;)c++;return o+=c,Int32Array.from([o,i])}getBottomRightOnBit(){let e=this.rowSize,t=this.bits,n=t.length-1;for(;n>=0&&t[n]===0;)n--;if(n<0)return null;let i=Math.floor(n/e),o=Math.floor(n%e)*32,l=t[n],c=31;for(;!(l>>>c);)c--;return o+=c,Int32Array.from([o,i])}getWidth(){return this.width}getHeight(){return this.height}getRowSize(){return this.rowSize}equals(e){if(!(e instanceof $))return!1;let t=e;return this.width===t.width&&this.height===t.height&&this.rowSize===t.rowSize&&H.equals(this.bits,t.bits)}hashCode(){let e=this.width;return e=31*e+this.width,e=31*e+this.height,e=31*e+this.rowSize,e=31*e+H.hashCode(this.bits),e}toString(e="X ",t=" ",n=`
`){return this.buildToString(e,t,n)}buildToString(e,t,n){let i=new G;for(let o=0,l=this.height;o<l;o++){for(let c=0,u=this.width;c<u;c++)i.append(this.get(c,o)?e:t);i.append(n)}return i.toString()}clone(){return new $(this.width,this.height,this.rowSize,this.bits.slice())}}class M extends A{static getNotFoundInstance(){return new M}}M.kind="NotFoundException";class ue extends R{constructor(e){super(e),this.luminances=ue.EMPTY,this.buckets=new Int32Array(ue.LUMINANCE_BUCKETS)}getBlackRow(e,t){let n=this.getLuminanceSource(),i=n.getWidth();t==null||t.getSize()<i?t=new W(i):t.clear(),this.initArrays(i);let o=n.getRow(e,this.luminances),l=this.buckets;for(let u=0;u<i;u++)l[(o[u]&255)>>ue.LUMINANCE_SHIFT]++;let c=ue.estimateBlackPoint(l);if(i<3)for(let u=0;u<i;u++)(o[u]&255)<c&&t.set(u);else{let u=o[0]&255,g=o[1]&255;for(let w=1;w<i-1;w++){let m=o[w+1]&255;(g*4-u-m)/2<c&&t.set(w),u=g,g=m}}return t}getBlackMatrix(){let e=this.getLuminanceSource(),t=e.getWidth(),n=e.getHeight(),i=new $(t,n);this.initArrays(t);let o=this.buckets;for(let u=1;u<5;u++){let g=Math.floor(n*u/5),w=e.getRow(g,this.luminances),m=Math.floor(t*4/5);for(let C=Math.floor(t/5);C<m;C++){let b=w[C]&255;o[b>>ue.LUMINANCE_SHIFT]++}}let l=ue.estimateBlackPoint(o),c=e.getMatrix();for(let u=0;u<n;u++){let g=u*t;for(let w=0;w<t;w++)(c[g+w]&255)<l&&i.set(w,u)}return i}createBinarizer(e){return new ue(e)}initArrays(e){this.luminances.length<e&&(this.luminances=new Uint8ClampedArray(e));let t=this.buckets;for(let n=0;n<ue.LUMINANCE_BUCKETS;n++)t[n]=0}static estimateBlackPoint(e){let t=e.length,n=0,i=0,o=0;for(let w=0;w<t;w++)e[w]>o&&(i=w,o=e[w]),e[w]>n&&(n=e[w]);let l=0,c=0;for(let w=0;w<t;w++){let m=w-i,C=e[w]*m*m;C>c&&(l=w,c=C)}if(i>l){let w=i;i=l,l=w}if(l-i<=t/16)throw new M;let u=l-1,g=-1;for(let w=l-1;w>i;w--){let m=w-i,C=m*m*(l-w)*(n-e[w]);C>g&&(u=w,g=C)}return u<<ue.LUMINANCE_SHIFT}}ue.LUMINANCE_BITS=5,ue.LUMINANCE_SHIFT=8-ue.LUMINANCE_BITS,ue.LUMINANCE_BUCKETS=1<<ue.LUMINANCE_BITS,ue.EMPTY=Uint8ClampedArray.from([0]);class q extends ue{constructor(e){super(e),this.matrix=null}getBlackMatrix(){if(this.matrix!==null)return this.matrix;let e=this.getLuminanceSource(),t=e.getWidth(),n=e.getHeight();if(t>=q.MINIMUM_DIMENSION&&n>=q.MINIMUM_DIMENSION){let i=e.getMatrix(),o=t>>q.BLOCK_SIZE_POWER;(t&q.BLOCK_SIZE_MASK)!==0&&o++;let l=n>>q.BLOCK_SIZE_POWER;(n&q.BLOCK_SIZE_MASK)!==0&&l++;let c=q.calculateBlackPoints(i,o,l,t,n),u=new $(t,n);q.calculateThresholdForBlock(i,o,l,t,n,c,u),this.matrix=u}else this.matrix=super.getBlackMatrix();return this.matrix}createBinarizer(e){return new q(e)}static calculateThresholdForBlock(e,t,n,i,o,l,c){let u=o-q.BLOCK_SIZE,g=i-q.BLOCK_SIZE;for(let w=0;w<n;w++){let m=w<<q.BLOCK_SIZE_POWER;m>u&&(m=u);let C=q.cap(w,2,n-3);for(let b=0;b<t;b++){let S=b<<q.BLOCK_SIZE_POWER;S>g&&(S=g);let T=q.cap(b,2,t-3),D=0;for(let Z=-2;Z<=2;Z++){let Q=l[C+Z];D+=Q[T-2]+Q[T-1]+Q[T]+Q[T+1]+Q[T+2]}let F=D/25;q.thresholdBlock(e,S,m,F,i,c)}}}static cap(e,t,n){return e<t?t:e>n?n:e}static thresholdBlock(e,t,n,i,o,l){for(let c=0,u=n*o+t;c<q.BLOCK_SIZE;c++,u+=o)for(let g=0;g<q.BLOCK_SIZE;g++)(e[u+g]&255)<=i&&l.set(t+g,n+c)}static calculateBlackPoints(e,t,n,i,o){let l=o-q.BLOCK_SIZE,c=i-q.BLOCK_SIZE,u=new Array(n);for(let g=0;g<n;g++){u[g]=new Int32Array(t);let w=g<<q.BLOCK_SIZE_POWER;w>l&&(w=l);for(let m=0;m<t;m++){let C=m<<q.BLOCK_SIZE_POWER;C>c&&(C=c);let b=0,S=255,T=0;for(let F=0,Z=w*i+C;F<q.BLOCK_SIZE;F++,Z+=i){for(let Q=0;Q<q.BLOCK_SIZE;Q++){let j=e[Z+Q]&255;b+=j,j<S&&(S=j),j>T&&(T=j)}if(T-S>q.MIN_DYNAMIC_RANGE)for(F++,Z+=i;F<q.BLOCK_SIZE;F++,Z+=i)for(let Q=0;Q<q.BLOCK_SIZE;Q++)b+=e[Z+Q]&255}let D=b>>q.BLOCK_SIZE_POWER*2;if(T-S<=q.MIN_DYNAMIC_RANGE&&(D=S/2,g>0&&m>0)){let F=(u[g-1][m]+2*u[g][m-1]+u[g-1][m-1])/4;S<F&&(D=F)}u[g][m]=D}}return u}}q.BLOCK_SIZE_POWER=3,q.BLOCK_SIZE=1<<q.BLOCK_SIZE_POWER,q.BLOCK_SIZE_MASK=q.BLOCK_SIZE-1,q.MINIMUM_DIMENSION=q.BLOCK_SIZE*5,q.MIN_DYNAMIC_RANGE=24;class xe{constructor(e,t){this.width=e,this.height=t}getWidth(){return this.width}getHeight(){return this.height}isCropSupported(){return!1}crop(e,t,n,i){throw new le("This luminan
`)}return t.toString()}}class st extends xe{constructor(e){super(e.getWidth(),e.getHeight()),this.delegate=e}getRow(e,t){let n=this.delegate.getRow(e,t),i=this.getWidth();for(let o=0;o<i;o++)n[o]=255-(n[o]&255);return n}getMatrix(){let e=this.delegate.getMatrix(),t=this.getWidth()*this.getHeight(),n=new Uint8ClampedArray(t);for(let i=0;i<t;i++)n[i]=255-(e[i]&255);return n}isCropSupported(){return this.delegate.isCropSupported()}crop(e,t,n,i){return new st(this.delegate.crop(e,t,n,i))}isRotateSupported(){return this.delegate.isRotateSupported()}invert(){return this.delegate}rotateCounterClockwise(){return new st(this.delegate.rotateCounterClockwise())}rotateCounterClockwise45(){return new st(this.delegate.rotateCounterClockwise45())}}class zt extends xe{constructor(e){super(e.width,e.height),this.canvas=e,this.tempCanvasElement=null,this.buffer=zt.makeBufferFromCanvasImageData(e)}static makeBufferFromCanvasImageData(e){let t=e.getContext("2d").getImageData(0,0,e.width,e.height);return zt.toGrayscaleBuffer(t.data,e.width,e.height)}static toGrayscaleBuffer(e,t,n){let i=new Uint8ClampedArray(t*n);for(let o=0,l=0,c=e.length;o<c;o+=4,l++){let u;if(e[o+3]===0)u=255;else{let w=e[o],m=e[o+1],C=e[o+2];u=306*w+601*m+117*C+512>>10}i[l]=u}return i}getRow(e,t){if(e<0||e>=this.getHeight())throw new x("Requested row is outside the image: "+e);let n=this.getWidth(),i=e*n;return t===null?t=this.buffer.slice(i,i+n):(t.length<n&&(t=new Uint8ClampedArray(n)),t.set(this.buffer.slice(i,i+n))),t}getMatrix(){return this.buffer}isCropSupported(){return!0}crop(e,t,n,i){return super.crop(e,t,n,i),this}isRotateSupported(){return!0}rotateCounterClockwise(){return this.rotate(-90),this}rotateCounterClockwise45(){return this.rotate(-45),this}getTempCanvasElement(){if(this.tempCanvasElement===null){let e=this.canvas.ownerDocument.createElement("canvas");e.width=this.canvas.width,e.height=this.canvas.height,this.tempCanvasElement=e}return this.tempCanvasElement}rotate(e){let t=this.getTempCanvasElement(),n=t.getContext("2d"),i=e*zt.DEGREE_TO_RADIANS,o=this.canvas.width,l=this.canvas.height,c=Math.ceil(Math.abs(Math.cos(i))*o+Math.abs(Math.sin(i))*l),u=Math.ceil(Math.abs(Math.sin(i))*o+Math.abs(Math.cos(i))*l);return t.width=c,t.height=u,n.translate(c/2,u/2),n.rotate(i),n.drawImage(this.canvas,o/-2,l/-2),this.buffer=zt.makeBufferFromCanvasImageData(t),this}invert(){return new st(this)}}zt.DEGREE_TO_RADIANS=Math.PI/180;class Cr{constructor(e,t,n){this.deviceId=e,this.label=t,this.kind="videoinput",this.groupId=n||void 0}toJSON(){return{kind:this.kind,groupId:this.groupId,deviceId:this.deviceId,label:this.label}}}var $e=(globalThis||global||self||window||void 0)&&(globalThis||global||self||window||void 0).__awaiter||function(E,e,t,n){function i(o){return o instanceof t?o:new t(function(l){l(o)})}return new(t||(t=Promise))(function(o,l){function c(w){try{g(n.next(w))}catch(m){l(m)}}function u(w){try{g(n.throw(w))}catch(m){l(m)}}function g(w){w.done?o(w.value):i(w.value).then(c,u)}g((n=n.apply(E,e||[])).next())})};class Ht{constructor(e,t=500,n){this.reader=e,this.timeBetweenScansMillis=t,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(e){this._timeBetweenDecodingAttempts=e<0?0:e}set hints(e){this._hints=e||null}get hints(){return this._hints}listVideoInputDevices(){return $e(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.");let e=yield navigator.mediaDevices.enumerateDevices(),t=[];for(let n of e){let i=n.kind==="video"?"videoinput":n.kind;if(i!=="videoinput")continue;let o=n.deviceId||n.id,l=n.label||`V
`,"\\13","\f","\r","\\33","\\34","\\35","\\36","\\37","@","\\","^","_","`","|","~","\\177","CTRL_LL","CTRL_UL","CTRL_PL","CTRL_BS"],Le.PUNCT_TABLE=["","\r",`\r
`,". ",", ",": ","!",'"',"#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}","CTRL_UL"],Le.DIGIT_TABLE=["CTRL_PS"," ","0","1","2","3","4","5","6","7","8","9",",",".","CTRL_UL","CTRL_US"];class Ce{constructor(){}static round(e){return e===NaN?0:e<=Number.MIN_SAFE_INTEGER?Number.MIN_SAFE_INTEGER:e>=Number.MAX_SAFE_INTEGER?Number.MAX_SAFE_INTEGER:e+(e<0?-.5:.5)|0}static distance(e,t,n,i){let o=e-n,l=t-i;return Math.sqrt(o*o+l*l)}static sum(e){let t=0;for(let n=0,i=e.length;n!==i;n++){let o=e[n];t+=o}return t}}class hi{static floatToIntBits(e){return e}}hi.MAX_VALUE=Number.MAX_SAFE_INTEGER;class ie{constructor(e,t){this.x=e,this.y=t}getX(){return this.x}getY(){return this.y}equals(e){if(e instanceof ie){let t=e;return this.x===t.x&&this.y===t.y}return!1}hashCode(){return 31*hi.floatToIntBits(this.x)+hi.floatToIntBits(this.y)}toString(){return"("+this.x+","+this.y+")"}static orderBestPatterns(e){let t=this.distance(e[0],e[1]),n=this.distance(e[1],e[2]),i=this.distance(e[0],e[2]),o,l,c;if(n>=t&&n>=i?(l=e[0],o=e[1],c=e[2]):i>=n&&i>=t?(l=e[1],o=e[0],c=e[2]):(l=e[2],o=e[0],c=e[1]),this.crossProductZ(o,l,c)<0){let u=o;o=c,c=u}e[0]=o,e[1]=l,e[2]=c}static distance(e,t){return Ce.distance(e.x,e.y,t.x,t.y)}static crossProductZ(e,t,n){let i=t.x,o=t.y;return(n.x-i)*(e.y-o)-(n.y-o)*(e.x-i)}}class di{constructor(e,t){this.bits=e,this.points=t}getBits(){return this.bits}getPoints(){return this.points}}class Xo extends di{constructor(e,t,n,i,o){super(e,t),this.compact=n,this.nbDatablocks=i,this.nbLayers=o}getNbLayers(){return this.nbLayers}getNbDatablocks(){return this.nbDatablocks}isCompact(){return this.compact}}class on{constructor(e,t,n,i){this.image=e,this.height=e.getHeight(),this.width=e.getWidth(),t==null&&(t=on.INIT_SIZE),n==null&&(n=e.getWidth()/2|0),i==null&&(i=e.getHeight()/2|0);let o=t/2|0;if(this.leftInit=n-o,this.rightInit=n+o,this.upInit=i-o,this.downInit=i+o,this.upInit<0||this.leftInit<0||this.downInit>=this.height||this.rightInit>=this.width)throw new M}detect(){let e=this.leftInit,t=this.rightInit,n=this.upInit,i=this.downInit,o=!1,l=!0,c=!1,u=!1,g=!1,w=!1,m=!1,C=this.width,b=this.height;for(;l;){l=!1;let S=!0;for(;(S||!u)&&t<C;)S=this.containsBlackPoint(n,i,t,!1),S?(t++,l=!0,u=!0):u||t++;if(t>=C){o=!0;break}let T=!0;for(;(T||!g)&&i<b;)T=this.containsBlackPoint(e,t,i,!0),T?(i++,l=!0,g=!0):g||i++;if(i>=b){o=!0;break}let D=!0;for(;(D||!w)&&e>=0;)D=this.containsBlackPoint(n,i,e,!1),D?(e--,l=!0,w=!0):w||e--;if(e<0){o=!0;break}let F=!0;for(;(F||!m)&&n>=0;)F=this.containsBlackPoint(e,t,n,!0),F?(n--,l=!0,m=!0):m||n--;if(n<0){o=!0;break}l&&(c=!0)}if(!o&&c){let S=t-e,T=null;for(let Q=1;T===null&&Q<S;Q++)T=this.getBlackPointOnSegment(e,i-Q,e+Q,i);if(T==null)throw new M;let D=null;for(let Q=1;D===null&&Q<S;Q++)D=this.getBlackPointOnSegment(e,n+Q,e+Q,n);if(D==null)throw new M;let F=null;for(let Q=1;F===null&&Q<S;Q++)F=this.getBlackPointOnSegment(t,n+Q,t-Q,n);if(F==null)throw new M;let Z=null;for(let Q=1;Z===null&&Q<S;Q++)Z=this.getBlackPointOnSegment(t,i-Q,t-Q,i);if(Z==null)throw new M;return this.centerEdges(Z,T,F,D)}else throw new M}getBlackPointOnSegment(e,t,n,i){let o=Ce.round(Ce.distance(e,t,n,i)),l=(n-e)/o,c=(i-t)/o,u=this.image;for(let g=0;g<o;g++){let w=Ce.round(e+g*l),m=Ce.round(t+g*c);if(u.get(w,m))return new ie(w,m)}return null}centerEdges(e,t,n,i){let o=e.getX(),l=e.getY(),c=t.getX(),u=t.getY(),g=n.getX(),w=n.getY(),m=i.getX(),C=i.getY(),b=on.CORR;return o<this.width/2?[new ie(m-b,C+b),new ie(c+b,u+b),new ie(g-b,w-b),new ie(o+b,l-b)]:[new ie(m+b,C+b),new ie(c+b,u-b),new ie(g-b,w+b),new ie(o-b,l-b)]}containsBlackPoint(e,t,n,i){let o=this.image;if(i){for(let l=e;l<=t;l++)if(o.get(l,n))return!0}else for(let l=e;l<=t;l++)if(o.get(n,l))return!0;return!1}}on.INIT_SIZE=10,on.CORR=1;class ls{static checkAndNudgePoints(e,t){let n=e.getWidth(),i=e.getHeight(),o=!0;for(let l=0;l<t.length&&o;l+=2){let c=Math.floor(t[l]),u=Math.floor(t[l+1]);if(c<-1||c>n||u<-1||u>i)throw new M;o=!1,c===-1?(t[l]=0,o=!0):c===n&&(t[l]=n-1,o=!0),u===-1?(t[l+1]=0,o=!0):u===i&&(t[l+1]=i-1,o=!0)}o=!0;for(let l=t.leng
`+super.toString()}}class Or{constructor(e,t){this.ADJUST_ROW_NUMBER_SKIP=2,this.barcodeMetadata=e,this.barcodeColumnCount=e.getColumnCount(),this.boundingBox=t,this.detectionResultColumns=new Array(this.barcodeColumnCount+2)}getDetectionResultColumns(){this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[0]),this.adjustIndicatorColumnRowNumbers(this.detectionResultColumns[this.barcodeColumnCount+1]);let e=fe.MAX_CODEWORDS_IN_BARCODE,t;do t=e,e=this.adjustRowNumbersAndGetCount();while(e>0&&e<t);return this.detectionResultColumns}adjustIndicatorColumnRowNumbers(e){e?.adjustCompleteIndicatorColumnRowNumbers(this.barcodeMetadata)}adjustRowNumbersAndGetCount(){let e=this.adjustRowNumbersByRow();if(e===0)return 0;for(let t=1;t<this.barcodeColumnCount+1;t++){let n=this.detectionResultColumns[t].getCodewords();for(let i=0;i<n.length;i++)n[i]!=null&&(n[i].hasValidRowNumber()||this.adjustRowNumbers(t,i,n))}return e}adjustRowNumbersByRow(){return this.adjustRowNumbersFromBothRI(),this.adjustRowNumbersFromLRI()+this.adjustRowNumbersFromRRI()}adjustRowNumbersFromBothRI(){if(this.detectionResultColumns[0]==null||this.detectionResultColumns[this.barcodeColumnCount+1]==null)return;let e=this.detectionResultColumns[0].getCodewords(),t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<e.length;n++)if(e[n]!=null&&t[n]!=null&&e[n].getRowNumber()===t[n].getRowNumber())for(let i=1;i<=this.barcodeColumnCount;i++){let o=this.detectionResultColumns[i].getCodewords()[n];o!=null&&(o.setRowNumber(e[n].getRowNumber()),o.hasValidRowNumber()||(this.detectionResultColumns[i].getCodewords()[n]=null))}}adjustRowNumbersFromRRI(){if(this.detectionResultColumns[this.barcodeColumnCount+1]==null)return 0;let e=0,t=this.detectionResultColumns[this.barcodeColumnCount+1].getCodewords();for(let n=0;n<t.length;n++){if(t[n]==null)continue;let i=t[n].getRowNumber(),o=0;for(let l=this.barcodeColumnCount+1;l>0&&o<this.ADJUST_ROW_NUMBER_SKIP;l--){let c=this.detectionResultColumns[l].getCodewords()[n];c!=null&&(o=Or.adjustRowNumberIfValid(i,o,c),c.hasValidRowNumber()||e++)}}return e}adjustRowNumbersFromLRI(){if(this.detectionResultColumns[0]==null)return 0;let e=0,t=this.detectionResultColumns[0].getCodewords();for(let n=0;n<t.length;n++){if(t[n]==null)continue;let i=t[n].getRowNumber(),o=0;for(let l=1;l<this.barcodeColumnCount+1&&o<this.ADJUST_ROW_NUMBER_SKIP;l++){let c=this.detectionResultColumns[l].getCodewords()[n];c!=null&&(o=Or.adjustRowNumberIfValid(i,o,c),c.hasValidRowNumber()||e++)}}return e}static adjustRowNumberIfValid(e,t,n){return n==null||n.hasValidRowNumber()||(n.isValidRowNumber(e)?(n.setRowNumber(e),t=0):++t),t}adjustRowNumbers(e,t,n){if(!this.detectionResultColumns[e-1])return;let i=n[t],o=this.detectionResultColumns[e-1].getCodewords(),l=o;this.detectionResultColumns[e+1]!=null&&(l=this.detectionResultColumns[e+1].getCodewords());let c=new Array(14);c[2]=o[t],c[3]=l[t],t>0&&(c[0]=n[t-1],c[4]=o[t-1],c[5]=l[t-1]),t>1&&(c[8]=n[t-2],c[10]=o[t-2],c[11]=l[t-2]),t<n.length-1&&(c[1]=n[t+1],c[6]=o[t+1],c[7]=l[t+1]),t<n.length-2&&(c[9]=n[t+2],c[12]=o[t+2],c[13]=l[t+2]);for(let u of c)if(Or.adjustRowNumber(i,u))return}static adjustRowNumber(e,t){return t==null?!1:t.hasValidRowNumber()&&t.getBucket()===e.getBucket()?(e.setRowNumber(t.getRowNumber()),!0):!1}getBarcodeColumnCount(){return this.barcodeColumnCount}getBarcodeRowCount(){return this.barcodeMetadata.getRowCount()}getBarcodeECLevel(){return this.barcodeMetadata.getErrorCorrectionLevel()}setBoundingBox(e){this.boundingBox=e}getBoundingBox(){return this.boundingBox}setDetectionResultColumn(e,t){this.detectionResultColumns[e]=t}getDetectionResultColumn(e){return this.detectionResultColumns[e]}toString(){let e=this.detectionResultColumns[0];e==null&&(e=this.detectionResultColumns[this.barcodeColumnCount+1]);let t=new Tr;for(let n=0;n<e.getCodewords().length;n++){t.format("CW %3d:",n);for(let i=0;i<this.barcodeColumnCount+2;i++){if(this.detectionResultColumns[i]==null){t.format(" | ");continue}let o=this.detectionResultColumns[i].getCodewords()[n];if(o==null
-.$/"|*()?{}'`,P.MIXED_CHARS="0123456789&\r ,:#-.$/+%*=^",P.EXP900=na()?X1():[],P.NUMBER_OF_SEQUENCE_CODEWORDS=2;class ge{constructor(){}static decode(e,t,n,i,o,l,c){let u=new Dn(e,t,n,i,o),g=null,w=null,m;for(let S=!0;;S=!1){if(t!=null&&(g=ge.getRowIndicatorColumn(e,u,t,!0,l,c)),i!=null&&(w=ge.getRowIndicatorColumn(e,u,i,!1,l,c)),m=ge.merge(g,w),m==null)throw M.getNotFoundInstance();let T=m.getBoundingBox();if(S&&T!=null&&(T.getMinY()<u.getMinY()||T.getMaxY()>u.getMaxY()))u=T;else break}m.setBoundingBox(u);let C=m.getBarcodeColumnCount()+1;m.setDetectionResultColumn(0,g),m.setDetectionResultColumn(C,w);let b=g!=null;for(let S=1;S<=C;S++){let T=b?S:C-S;if(m.getDetectionResultColumn(T)!==void 0)continue;let D;T===0||T===C?D=new Jo(u,T===0):D=new Nr(u),m.setDetectionResultColumn(T,D);let F=-1,Z=F;for(let Q=u.getMinY();Q<=u.getMaxY();Q++){if(F=ge.getStartColumn(m,T,Q,b),F<0||F>u.getMaxX()){if(Z===-1)continue;F=Z}let j=ge.detectCodeword(e,u.getMinX(),u.getMaxX(),b,F,Q,l,c);j!=null&&(D.setCodeword(Q,j),Z=F,l=Math.min(l,j.getWidth()),c=Math.max(c,j.getWidth()))}}return ge.createDecoderResult(m)}static merge(e,t){if(e==null&&t==null)return null;let n=ge.getBarcodeMetadata(e,t);if(n==null)return null;let i=Dn.merge(ge.adjustBoundingBox(e),ge.adjustBoundingBox(t));return new Or(n,i)}static adjustBoundingBox(e){if(e==null)return null;let t=e.getRowHeights();if(t==null)return null;let n=ge.getMax(t),i=0;for(let c of t)if(i+=n-c,c>0)break;let o=e.getCodewords();for(let c=0;i>0&&o[c]==null;c++)i--;let l=0;for(let c=t.length-1;c>=0&&(l+=n-t[c],!(t[c]>0));c--);for(let c=o.length-1;l>0&&o[c]==null;c--)l--;return e.getBoundingBox().addMissingRows(i,l,e.isLeft())}static getMax(e){let t=-1;for(let n of e)t=Math.max(t,n);return t}static getBarcodeMetadata(e,t){let n;if(e==null||(n=e.getBarcodeMetadata())==null)return t==null?null:t.getBarcodeMetadata();let i;return t==null||(i=t.getBarcodeMetadata())==null?n:n.getColumnCount()!==i.getColumnCount()&&n.getErrorCorrectionLevel()!==i.getErrorCorrectionLevel()&&n.getRowCount()!==i.getRowCount()?null:n}static getRowIndicatorColumn(e,t,n,i,o,l){let c=new Jo(t,i);for(let u=0;u<2;u++){let g=u===0?1:-1,w=Math.trunc(Math.trunc(n.getX()));for(let m=Math.trunc(Math.trunc(n.getY()));m<=t.getMaxY()&&m>=t.getMinY();m+=g){let C=ge.detectCodeword(e,0,e.getWidth(),i,w,m,o,l);C!=null&&(c.setCodeword(m,C),i?w=C.getStartX():w=C.getEndX())}}return c}static adjustCodewordCount(e,t){let n=t[0][1],i=n.getValue(),o=e.getBarcodeColumnCount()*e.getBarcodeRowCount()-ge.getNumberOfECCodeWords(e.getBarcodeECLevel());if(i.length===0){if(o<1||o>fe.MAX_CODEWORDS_IN_BARCODE)throw M.getNotFoundInstance();n.setValue(o)}else i[0]!==o&&n.setValue(o)}static createDecoderResult(e){let t=ge.createBarcodeMatrix(e);ge.adjustCodewordCount(e,t);let n=new Array,i=new Int32Array(e.getBarcodeRowCount()*e.getBarcodeColumnCount()),o=[],l=new Array;for(let u=0;u<e.getBarcodeRowCount();u++)for(let g=0;g<e.getBarcodeColumnCount();g++){let w=t[u][g+1].getValue(),m=u*e.getBarcodeColumnCount()+g;w.length===0?n.push(m):w.length===1?i[m]=w[0]:(l.push(m),o.push(w))}let c=new Array(o.length);for(let u=0;u<c.length;u++)c[u]=o[u];return ge.createDecoderResultFromAmbiguousValues(e.getBarcodeECLevel(),i,fe.toIntArray(n),fe.toIntArray(l),c)}static createDecoderResultFromAmbiguousValues(e,t,n,i,o){let l=new Int32Array(i.length),c=100;for(;c-- >0;){for(let u=0;u<l.length;u++)t[i[u]]=o[u][l[u]];try{return ge.decodeCodewords(t,e,n)}catch(u){if(!(u instanceof v))throw u}if(l.length===0)throw v.getChecksumInstance();for(let u=0;u<l.length;u++)if(l[u]<o[u].length-1){l[u]++;break}else if(l[u]=0,u===l.length-1)throw v.getChecksumInstance()}throw v.getChecksumInstance()}static createBarcodeMatrix(e){let t=Array.from({length:e.getBarcodeRowCount()},()=>new Array(e.getBarcodeColumnCount()+2));for(let i=0;i<t.length;i++)for(let o=0;o<t[i].length;o++)t[i][o]=new Mr;let n=0;for(let i of e.getDetectionResultColumns()){if(i!=null){for(let o of i.getCodewords())if(o!=null){let l=o.getRowNumber();if(l>=0){if(l>=t.length)continue;t[l][n].setValue(o.getValue())}}}n++}return t
`)}return e.toString()}}class vn{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(){let e=new G;return e.append(`<<
`),e.append(" mode: "),e.append(this.mode?this.mode.toString():"null"),e.append(`
ecLevel: `),e.append(this.ecLevel?this.ecLevel.toString():"null"),e.append(`
version: `),e.append(this.version?this.version.toString():"null"),e.append(`
maskPattern: `),e.append(this.maskPattern.toString()),this.matrix?(e.append(`
matrix:
`),e.append(this.matrix.toString())):e.append(`
matrix: null
`),e.append(`>>
`),e.toString()}setMode(e){this.mode=e}setECLevel(e){this.ecLevel=e}setVersion(e){this.version=e}setMaskPattern(e){this.maskPattern=e}setMatrix(e){this.matrix=e}static isValidMaskPattern(e){return e>=0&&e<vn.NUM_MASK_PATTERNS}}vn.NUM_MASK_PATTERNS=8;class ve extends A{}ve.kind="WriterException";class ce{constructor(){}static clearMatrix(e){e.clear(255)}static buildMatrix(e,t,n,i,o){ce.clearMatrix(o),ce.embedBasicPatterns(n,o),ce.embedTypeInfo(t,i,o),ce.maybeEmbedVersionInfo(n,o),ce.embedDataBits(e,i,o)}static embedBasicPatterns(e,t){ce.embedPositionDetectionPatternsAndSeparators(t),ce.embedDarkDotAtLeftBottomCorner(t),ce.maybeEmbedPositionAdjustmentPatterns(e,t),ce.embedTimingPatterns(t)}static embedTypeInfo(e,t,n){let i=new W;ce.makeTypeInfoBits(e,t,i);for(let o=0,l=i.getSize();o<l;++o){let c=i.get(i.getSize()-1-o),u=ce.TYPE_INFO_COORDINATES[o],g=u[0],w=u[1];if(n.setBoolean(g,w,c),o<8){let m=n.getWidth()-o-1;n.setBoolean(m,8,c)}else{let C=n.getHeight()-7+(o-8);n.setBoolean(8,C,c)}}}static maybeEmbedVersionInfo(e,t){if(e.getVersionNumber()<7)return;let n=new W;ce.makeVersionInfoBits(e,n);let i=17;for(let o=0;o<6;++o)for(let l=0;l<3;++l){let c=n.get(i);i--,t.setBoolean(o,t.getHeight()-11+l,c),t.setBoolean(t.getHeight()-11+l,o,c)}}static embedDataBits(e,t,n){let i=0,o=-1,l=n.getWidth()-1,c=n.getHeight()-1;for(;l>0;){for(l===6&&(l-=1);c>=0&&c<n.getHeight();){for(let u=0;u<2;++u){let g=l-u;if(!ce.isEmpty(n.get(g,c)))continue;let w;i<e.getSize()?(w=e.get(i),++i):w=!1,t!==255&&je.getDataMaskBit(t,g,c)&&(w=!w),n.setBoolean(g,c,w)}c+=o}o=-o,c+=o,l-=2}if(i!==e.getSize())throw new ve("Not all bits consumed: "+i+"/"+e.getSize())}static findMSBSet(e){return 32-U.numberOfLeadingZeros(e)}static calculateBCHCode(e,t){if(t===0)throw new x("0 polynomial");let n=ce.findMSBSet(t);for(e<<=n-1;ce.findMSBSet(e)>=n;)e^=t<<ce.findMSBSet(e)-n;return e}static makeTypeInfoBits(e,t,n){if(!vn.isValidMaskPattern(t))throw new ve("Invalid mask pattern");let i=e.getBits()<<3|t;n.appendBits(i,5);let o=ce.calculateBCHCode(i,ce.TYPE_INFO_POLY);n.appendBits(o,10);let l=new W;if(l.appendBits(ce.TYPE_INFO_MASK_PATTERN,15),n.xor(l),n.getSize()!==15)throw new ve("should not happen but we got: "+n.getSize())}static makeVersionInfoBits(e,t){t.appendBits(e.getVersionNumber(),6);let n=ce.calculateBCHCode(e.getVersionNumber(),ce.VERSION_INFO_POLY);if(t.appendBits(n,12),t.getSize()!==18)throw new ve("should not happen but we got: "+t.getSize())}static isEmpty(e){return e===255}static embedTimingPatterns(e){for(let t=8;t<e.getWidth()-8;++t){let n=(t+1)%2;ce.isEmpty(e.get(t,6))&&e.setNumber(t,6,n),ce.isEmpty(e.get(6,t))&&e.setNumber(6,t,n)}}static embedDarkDotAtLeftBottomCorner(e){if(e.get(8,e.getHeight()-8)===0)throw new ve;e.setNumber(8,e.getHeight()-8,1)}static embedHorizontalSeparationPattern(e,t,n){for(let i=0;i<8;++i){if(!ce.isEmpty(n.get(e+i,t)))throw new ve;n.setNumber(e+i,t,0)}}static embedVerticalSeparationPattern(e,t,n){for(let i=0;i<7;++i){if(!ce.isEmpty(n.get(e,t+i)))throw new ve;n.setNumber(e,t+i,0)}}static embedPositionAdjustmentPattern(e,t,n){for(let i=0;i<5;++i){let o=ce.POSITION_ADJUSTMENT_PATTERN[i];for(let l=0;l<5;++l)n.setNumber(e+l,t+i,o[l])}}static embedPositionDetectionPattern(e,t,n){for(let i=0;i<7;++i){let o=ce.POSITION_DETECTION_PATTERN[i];for(let l=0;l<7;++l)n.setNumber(e+l,t+i,o[l])}}static embedPositionDetectionPatternsAndSeparators(e){let t=ce.POSITION_DETECTION_PATTERN[0].length;ce.embedPositionDetectionPattern(0,0,e),ce.embedPositionDetectionPattern(e.getWidth()-t,0,e),ce.embedPositionDetectionPattern(0,e.getWidth()-t,e);let n=8;ce.embedHorizontalSeparationPattern(0,n-1,e),ce.embedHorizontalSeparationPattern(e.getWidth()-n,n-1,e),ce.embedHorizontalSeparationPattern(0,e.getWidth()-n,e);let i=7;ce.embedVerticalSeparationPattern(i,0,e),ce.embedVerticalSeparationPattern(e.getHeight()-i-1,0,e),ce.embedVerticalSeparationPattern(i,e.getHeight()-i,e)}static maybeEmbedPositionAdjustmentPatterns(e,t){if(e.getVersionNumber()<2)return;let n=e.getVersionNumber()-1,i=ce.POSITION_ADJUSTMENT_PATTERN_COORDINATE_TABLE[n];for(let o=0,l=i.length;o!==l;o++
`,"\v","\f","\r","\x1B","","","","","@","\\","^","_","`","|","~","\x7F"];for(let C=0;C<w.length;C++)E[aa][k.getCharCode(w[C])]=C;let m=["\0","\r","\0","\0","\0","\0","!","'","#","$","%","&","'","(",")","*","+",",","-",".","/",":",";","<","=",">","?","[","]","{","}"];for(let C=0;C<m.length;C++)k.getCharCode(m[C])>0&&(E[Jt][k.getCharCode(m[C])]=C);return E}let Ts=e0(H.createInt32Array(5,256));class vr{constructor(e){this.text=e}encode(){let e=k.getCharCode(" "),t=k.getCharCode(`
`),n=oa.singletonList($t.INITIAL_STATE);for(let o=0;o<this.text.length;o++){let l,c=o+1<this.text.length?this.text[o+1]:0;switch(this.text[o]){case k.getCharCode("\r"):l=c===t?2:0;break;case k.getCharCode("."):l=c===e?3:0;break;case k.getCharCode(","):l=c===e?4:0;break;case k.getCharCode(":"):l=c===e?5:0;break;default:l=0}l>0?(n=vr.updateStateListForPair(n,o,l),o++):n=this.updateStateListForChar(n,o)}return oa.min(n,(o,l)=>o.getBitCount()-l.getBitCount()).toBitArray(this.text)}updateStateListForChar(e,t){let n=[];for(let i of e)this.updateStateForChar(i,t,n);return vr.simplifyStates(n)}updateStateForChar(e,t,n){let i=this.text[t]&255,o=Ts[e.getMode()][i]>0,l=null;for(let c=0;c<=Jt;c++){let u=Ts[c][i];if(u>0){if(l==null&&(l=e.endBinaryShift(t)),!o||c===e.getMode()||c===Bt){let g=l.latchAndAppend(c,u);n.push(g)}if(!o&&la[e.getMode()][c]>=0){let g=l.shiftAndAppend(c,u);n.push(g)}}}if(e.getBinaryShiftByteCount()>0||Ts[e.getMode()][i]===0){let c=e.addBinaryShiftChar(t);n.push(c)}}static updateStateListForPair(e,t,n){let i=[];for(let o of e)this.updateStateForPair(o,t,n,i);return this.simplifyStates(i)}static updateStateForPair(e,t,n,i){let o=e.endBinaryShift(t);if(i.push(o.latchAndAppend(Jt,n)),e.getMode()!==Jt&&i.push(o.shiftAndAppend(Jt,n)),n===3||n===4){let l=o.latchAndAppend(Bt,16-n).latchAndAppend(Bt,1);i.push(l)}if(e.getBinaryShiftByteCount()>0){let l=e.addBinaryShiftChar(t).addBinaryShiftChar(t+1);i.push(l)}}static simplifyStates(e){let t=[];for(let n of e){let i=!0;for(let o of t){if(o.isBetterThanOrEqualTo(n)){i=!1;break}n.isBetterThanOrEqualTo(o)&&(t=t.filter(l=>l!==o))}i&&t.push(n)}return t}}class _e{constructor(){}static encodeBytes(e){return _e.encode(e,_e.DEFAULT_EC_PERCENT,_e.DEFAULT_AZTEC_LAYERS)}static encode(e,t,n){let i=new vr(e).encode(),o=U.truncDivision(i.getSize()*t,100)+11,l=i.getSize()+o,c,u,g,w,m;if(n!==_e.DEFAULT_AZTEC_LAYERS){if(c=n<0,u=Math.abs(n),u>(c?_e.MAX_NB_BITS_COMPACT:_e.MAX_NB_BITS))throw new x(k.format("Illegal value %s for layers",n));g=_e.totalBitsInLayer(u,c),w=_e.WORD_SIZE[u];let j=g-g%w;if(m=_e.stuffBits(i,w),m.getSize()+o>j)throw new x("Data to large for user specified layer");if(c&&m.getSize()>w*64)throw new x("Data to large for user specified layer")}else{w=0,m=null;for(let j=0;;j++){if(j>_e.MAX_NB_BITS)throw new x("Data too large for an Aztec code");if(c=j<=3,u=c?j+1:j,g=_e.totalBitsInLayer(u,c),l>g)continue;(m==null||w!==_e.WORD_SIZE[u])&&(w=_e.WORD_SIZE[u],m=_e.stuffBits(i,w));let we=g-g%w;if(!(c&&m.getSize()>w*64)&&m.getSize()+o<=we)break}}let C=_e.generateCheckWords(m,g,w),b=m.getSize()/w,S=_e.generateModeMessage(c,u,b),T=(c?11:14)+u*4,D=new Int32Array(T),F;if(c){F=T;for(let j=0;j<D.length;j++)D[j]=j}else{F=T+1+2*U.truncDivision(U.truncDivision(T,2)-1,15);let j=U.truncDivision(T,2),we=U.truncDivision(F,2);for(let he=0;he<j;he++){let mt=he+U.truncDivision(he,15);D[j-he-1]=we-mt-1,D[j+he]=we+mt+1}}let Z=new $(F);for(let j=0,we=0;j<u;j++){let he=(u-j)*4+(c?9:12);for(let mt=0;mt<he;mt++){let Gt=mt*2;for(let Ct=0;Ct<2;Ct++)C.get(we+Gt+Ct)&&Z.set(D[j*2+Ct],D[j*2+mt]),C.get(we+he*2+Gt+Ct)&&Z.set(D[j*2+mt],D[T-1-j*2-Ct]),C.get(we+he*4+Gt+Ct)&&Z.set(D[T-1-j*2-Ct],D[T-1-j*2-mt]),C.get(we+he*6+Gt+Ct)&&Z.set(D[T-1-j*2-mt],D[j*2+Ct])}we+=he*8}if(_e.drawModeMessage(Z,c,F,S),c)_e.drawBullsEye(Z,U.truncDivision(F,2),5);else{_e.drawBullsEye(Z,U.truncDivision(F,2),7);for(let j=0,we=0;j<U.truncDivision(T,2)-1;j+=15,we+=16)for(let he=U.truncDivision(F,2)&1;he<F;he+=2)Z.set(U.truncDivision(F,2)-we,he),Z.set(U.truncDivision(F,2)+we,he),Z.set(he,U.truncDivision(F,2)-we),Z.set(he,U.truncDivision(F,2)+we)}let Q=new sa;return Q.setCompact(c),Q.setSize(F),Q.setLayers(u),Q.setCodeWords(b),Q.setMatrix(Z),Q}static drawBullsEye(e,t,n){for(let i=0;i<n;i+=2)for(let o=t-i;o<=t+i;o++)e.set(o,t-i),e.set(o,t+i),e.set(t-i,o),e.set(t+i,o);e.set(t-n,t-n),e.set(t-n+1,t-n),e.set(t-n,t-n+1),e.set(t+n,t-n),e.set(t+n,t-n+1),e.set(t+n,t+n-1)}static generateModeMessage(e,t,n){let i=new W;return e?(i.appendBits(t-1,2),i.appendBits(n-1,6),i=_e.generateCheckWords(i,28,4)):(i.appendBits(t-1,5),i.appendBits(n-1,11),i=_e.gener
/*! Bundled license information:
pako/dist/pako.esm.mjs:
(*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) *)
*/
//# sourceMappingURL=qr-local.js.map