"use strict";letuQRCode;!function(){functiono(o){this.mode=u.MODE_8BIT_BYTE,this.data=o}functione(o,e){this.typeNumber=o,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=newArray}functionr(o,e){if(null==o.length)thrownewError(o.length+"/"+e);for(varr=0;r<o.length&&0==o[r];)r++;this.num=newArray(o.length-r+e);for(vart=0;t<o.length-r;t++)this.num[t]=o[t+r]}functiont(o,e){this.totalCount=o,this.dataCount=e}functioni(){this.buffer=newArray,this.length=0}functionn(){functiono(t,i,n){t().then(o=>{i(o)}).catch(o=>{n(o)}).finally(()=>{if(e.length){constr=e.shift();o(r.task,r.resolve,r.reject)}elser=!1})}lete=this.waitingQueue=[],r=this.isRunning=!1;this.exec=function(t){returnnewPromise((i,n)=>{r?e.push({task:t,resolve:i,reject:n}):(r=!0,o(t,i,n))})}}functiona(o,e){varr=this.data="",t=this.size=200,i=this.typeNumber=-1,n=(this.errorCorrectLevel=d.H,this.useDynamicSize=!1,this.dynamicSize=void0,this.margin=0),u=(this.backgroundColor="#FFFFFF",this.backgroundImageSrc=void0,this.backgroundImageWidth=void0),s=this.backgroundImageHeight=void0,g=this.backgroundImageX=void0,l=this.backgroundImageY=void0,h=(this.backgroundImageAlpha=1,this.backgroundImageBorderRadius=0,this.foregroundColor="#000000",this.foregroundImageSrc=void0,this.foregroundImageWidth=void0),m=this.foregroundImageHeight=void0,c=this.foregroundImageX=void0,f=this.foregroundImageY=void0,v=this.foregroundImagePadding=0,p=(this.foregroundImageBackgroundColor="#FFFFFF",this.foregroundImageBorderRadius=0),C=this.foregroundImageShadowOffsetX=0,b=this.foregroundImageShadowOffsetY=0,y=this.foregroundImageShadowBlur=0,I=(this.foregroundImageShadowColor="#808080",this.positionProbeBackgroundColor=void0),k=this.positionProbeForegroundColor=void0,w=(this.positionProbeImageSrc=void0,this.positionProbeLeftUpperImageSrc=void0),S=this.positionProbeRightUpperImageSrc=void0,P=this.positionProbeLeftLowerImageSrc=void0,B=this.separatorColor=void0,T=this.positionAdjustBackgroundColor=void0,L=this.positionAdjustForegroundColor=void0,A=(this.positionAdjustImageSrc=void0,this.timingBackgroundColor=void0),D=this.timingForegroundColor=void0,E=this.typeNumberBackgroundColor=void0,N=this.typeNumberForegroundColor=void0,x=this.darkBlockColor=void0,R=(this.patterns=[],this.canvasContext=void0);this.queue=!1,this.modules=[],this.moduleCount=0,this.drawModules=[];Object.defineProperties(this,{data:{get:()=>(""!==r&&void0!==r||console.error("[uQRCode]: data must be set!"),r),set(o){r=o}},size:{get:()=>t,set(o){t=Number(o)}},typeNumber:{get:()=>i,set(o){i=Number(o)}},margin:{get:()=>n,set(o){n=Number(o)}},backgroundImageWidth:{get(){returnvoid0===u?this.dynamicSize:this.useDynamicSize?this.dynamicSize/this.size*u:u},set(o){u=Number(o)}},backgroundImageHeight:{get(){returnvoid0===s?this.dynamicSize:this.useDynamicSize?this.dynamicSize/this.size*s:s},set(o){s=Number(o)}},backgroundImageX:{get(){returnvoid0===g?0:this.useDynamicSize?this.dynamicSize/this.size*g:g},set(o){g=Number(o)}},backgroundImageY:{get(){returnvoid0===l?0:this.useDynamicSize?this.dynamicSize/this.size*l:l},set(o){l=Number(o)}},foregroundImageWidth:{get(){returnvoid0===h?(this.dynamicSize-2*this.margin)/4:this.useDynamicSize?this.dynamicSize/this.size*h:h},set(o){h=Number(o)}},foregroundImageHeight:{get(){returnvoid0===m?(this.dynamicSize-2*this.margin)/4:this.useDynamicSize?this.dynamicSize/this.size*m:m},set(o){m=Number(o)}},foregroundImageX:{get(){returnvoid0===c?this.dynamicSize/2-this.foregroundImageWidth/2:this.useDynamicSize?this.dynamicSize/this.size*c:c},set(o){c=Number(o)}},foregroundImageY:{get(){returnvoid0===f?this.dynamicSize/2-this.foregroundImageHeight/2:this.useDynamicSize?this.dynamicSize/this.size*f:f},set(o){f=Number(o)}},foregroundImagePadding:{get(){returnthis.useDynamicSize?this.dynamicSize/this.size*v:v},set(o){v=Number(o)}},foregroundImageBorderRadius:{get(){returnthis.useDynamicSize?this.dynamicSize/this.size*p:p},set(o){p=Number(o)}},foregroundImageShadowOffsetX:{get(){returnthis.useDynamicSize?this.dynamicSize/this.size*C:C},set(o){C=Number(o)}},foregroundImageShadowOffsetY:{get(){returnthis.useDynamicSize?this.dynamicSize/this.size*b:b},set(o){b=Number(o)}},foregroundImageShadowBlur:{get(){returnthis.useDynamicSize?this.dynamicSize/this.size*y:y},set(o){y=Number(o)}},positionProbeBackgroundColor:{get(){returnI||this.backgroundColor},set(o){I=o}},positionProbeForegroundColor:{get(){returnk||this.foregroundColor},set(o){k=o}},positionProbeLeftUpperImageSrc:{get(){returnw||this.positionProbeImageSrc},set(o){w=o}},positionProbeRightUpperImageSrc:{get(){returnS||this.positionProbeImageSrc},set(o){S=o}},positionProbeLeftLowerImageSrc:{get(){returnP||this.positionProbeImageSrc},set(o){P=o}},separatorColor:{get(){returnB||this.backgroundColor},set(o){B=o}},positionAdjustBackgroundColor:{get(){returnT||this.backgroundColor},set(o){T=o}},positionAdjustForegroundColor:{get(){returnL||this.foregroundColor},set(o){L=o}},timingBackgroundColor:{get(){returnA||this.backgroundColor},set(o){A=o}},timingForegroundColor:{get(){returnD||this.foregroundColor},set(o){D=o}},typeNumberBackgroundColor:{get(){returnE||this.backgroundColor},set(o){E=o}},typeNumberForegroundColor:{get(){returnN||this.foregroundColor},set(o){N=o}},darkBlockColor:{get(){returnx||this.foregroundColor},set(o){x=o}},canvasContext:{get:()=>(void0===R&&console.error("[uQRCode]: use drawCanvas, you need to set the canvasContext!"),R),set(o){R=a.getCanvasContext(o)}}}),o&&this.setOptions(o),e&&(this.canvasContext=a.getCanvasContext(e))}o.prototype={getLength:function(o){returnthis.data.length},write:function(o){for(vare=0;e<this.data.length;e++)o.put(this.data.charCodeAt(e),8)}},e.prototype={addData:function(e){varr=newo(e);this.dataList.push(r),this.dataCache=null},isDark:function(o,e){if(o<0||this.moduleCount<=o||e<0||this.moduleCount<=e)thrownewError(o+","+e);returnthis.modules[o][e]},getModuleCount:function(){returnthis.moduleCount},make:function(){if(this.typeNumber<1){varo=1;for(o=1;o<40;o++){for(vare=t.getRSBlocks(o,this.errorCorrectLevel),r=newi,n=0,a=0;a<e.length;a++)n+=e[a].dataCount;for(a=0;a<this.dataList.length;a++){varu=this.dataList[a];r.put(u.mode,4),r.put(u.getLength(),g.getLengthInBits(u.mode,o)),u.write(r)}if(r.getLengthInBits()<=8*n)break}this.typeNumber=o}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(o,r){this.moduleCount=4*this.typeNumber+17,this.modules=newArray(this.moduleCount);for(vart=0;t<this.moduleCount;t++){this.modules[t]=newArray(this.moduleCount);for(vari=0;i<this.moduleCount;i++)this.modules[t][i]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(o,r),this.typeNumber>=7&&this.setupTypeNumber(o),null==this.dataCache&&(this.dataCache=e.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,r)},setupPositionProbePattern:function(o,e){for(varr=-1;r<=7;r++)if(!(o+r<=-1||this.moduleCount<=o+r))for(vart=-1;t<=7;t++)e+t<=-1||this.moduleCount<=e+t||(this.modules[o+r][e+t]=0<=r&&r<=6&&(0==t||6==t)||0<=t&&t<=6&&(0==r||6==r)||2<=r&&r<=4&&2<=t&&t<=4)},getBestMaskPattern:function(){for(varo=0,e=0,r=0;r<8;r++){this.makeImpl(!0,r);vart=g.getLostPoint(this);(0==r||o>t)&&(o=t,e=r)}returne},createMovieClip:function(o,e,r){vart=o.createEmptyMovieClip(e,r),i=1;this.make();for(varn=0;n<this.modules.length;n++)for(vara=n*i,u=0;u<this.modules[n].length;u++){vard=u*i,s=this.modules[n][u];s&&(t.beginFill(0,100),t.moveTo(d,a),t.lineTo(d+i,a),t.lineTo(d+i,a+i),t.lineTo(d,a+i),t.endFill())}returnt},setupTimingPattern:function(){for(varo=8;o<this.moduleCount-8;o++)null==this.modules[o][6]&&(this.modules[o][6]=o%2==0);for(vare=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(varo=g.getPatternPosition(this.typeNumber),e=0;e<o.length;e++)for(varr=0;r<o.length;r++){vart=o[e],i=o[r];if(null==this.modules[t][i])for(varn=-2;n<=2;n++)for(vara=-2;a<=2;a++)this.modules[t+n][i+a]=-2==n||2==n||-2==a||2==a||0==n&&0==a}},setupTypeNumber:function(o){for(vare=g.getBCHTypeNumber(this.typeNumber),r=0;r<18;r++){vart=!o&&1==(e>>r&1);this.modules[Math.floor(r/3)][r%3+this.moduleCount-8-3]=t}for(r=0;r<18;r++){t=!o&&1==(e>>r&1);this.modules[r%3+this.moduleCount-8-3][Math.floor(r/3)]=t}},setupTypeInfo:function(o,e){for(varr=this.errorCorrectLevel<<3|e,t=g.getBCHTypeInfo(r),i=0;i<15;i++){varn=!o&&1==(t>>i&1);i<6?this.modules[i][8]=n:i<8?this.modules[i+1][8]=n:this.modules[this.moduleCount-15+i][8]=n}for(i=0;i<15;i++){n=!o&&1==(t>>i&1);i<8?this.modules[8][this.moduleCount-i-1]=n:i<9?this.modules[8][15-i-1+1]=n:this.modules[8][15-i-1]=n}this.modules[this.moduleCount-8][8]=!o},mapData:function(o,e){for(varr=-1,t=this.moduleCount-1,i=7,n=0,a=this.moduleCount-1;a>0;a-=2)for(6==a&&a--;;){for(varu=0;u<2;u++)if(null==this.modules[t][a-u]){vard=!1;n<o.length&&(d=1==(o[n]>>>i&1));vars=g.getMask(e,t,a-u);s&&(d=!d),this.modules[t][a-u]=d,i--,-1==i&&(n++,i=7)}if(t+=r,t<0||this.moduleCount<=t){t-=r,r=-r;break}}}},e.PAD0=236,e.PAD1=17,e.createData=function(o,r,n){for(vara=t.getRSBlocks(o,r),u=newi,d=0;d<n.length;d++){vars=n[d];u.put(s.mode,4),u.put(s.getLength(),g.getLengthInBits(s.mode,o)),s.write(u)}varl=0;for(d=0;d<a.length;d++)l+=a[d].dataCount;if(u.getLengthInBits()>8*l)thrownewError("code length overflow. ("+u.getLengthInBits()+">"+8*l+")");for(u.getLengthInBits()+4<=8*l&&u.put(0,4);u.getLengthInBits()%8!=0;)u.putBit(!1);for(;!(u.getLengthInBits()>=8*l||(u.put(e.PAD0,8),u.getLengthInBits()>=8*l));)u.put(e.PAD1,8);returne.createBytes(u,a)},e.createBytes=function(o,e){for(vart=0,i=0,n=0,a=newArray(e.length),u=newArray(e.length),d=0;d<e.length;d++){vars=e[d].dataCount,l=e[d].totalCount-s;i=Math.max(i,s),n=Math.max(n,l),a[d]=newArray(s);for(varh=0;h<a[d].length;h++)a[d][h]=255&o.buffer[h+t];t+=s;varm=g.getErrorCorrectPolynomial(l),c=newr(a[d],m.getLength()-1),f=c.mod(m);u[d]=newArray(m.getLength()-1);for(h=0;h<u[d].length;h++){varv=h+f.getLength()-u[d].length;u[d][h]=v>=0?f.get(v):0}}varp=0;for(h=0;h<e.length;h++)p+=e[h].totalCount;varC=newArray(p),b=0;for(h=0;h<i;h++)for(d=0;d<e.length;d++)h<a[d].length&&(C[b++]=a[d][h]);for(h=0;h<n;h++)for(d=0;d<e.length;d++)h<u[d].length&&(C[b++]=u[d][h]);returnC};for(varu={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},d={L:1,M:0,Q:3,H:2},s={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},g={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(o){for(vare=o<<10;g.getBCHDigit(e)-g.getBCHDigit(g.G15)>=0;)e^=g.G15<<g.getBCHDigit(e)-g.getBCHDigit(g.G15);return(o<<10|e)^g.G15_MASK},getBCHTypeNumber:function(o){for(vare=o<<12;g.getBCHDigit(e)-g.getBCHDigit(g.G18)>=0;)e^=g.G18<<g.getBCHDigit(e)-g.getBCHDigit(g.G18);returno<<12|e},getBCHDigit:function(o){for(vare=0;0!=o;)e++,o>>>=1;returne},getPatternPosition:function(o){returng.PATTERN_POSITION_TABLE[o-1]},getMask:function(o,e,r){switch(o){cases.PATTERN000:return(e+r)%2==0;cases.PATTERN001:returne%2==0;cases.PATTERN010:returnr%3==0;cases.PATTERN011:return(e+r)%3==0;cases.PATTERN100:return(Math.floor(e/2)+Math.floor(r/3))%2==0;cases.PATTERN101:returne*r%2+e*r%3==0;cases.PATTERN110:return(e*r%2+e*r%3)%2==0;cases.PATTERN111:return(e*r%3+(e+r)%2)%2==0;default:thrownewError("bad maskPattern:"+o)}},getErrorCorrectPolynomial:function(o){for(vare=newr([1],0),t=0;t<o;t++)e=e.multiply(newr([1,l.gexp(t)],0));returne},getLengthInBits:function(o,e){if(1<=e&&e<10)switch(o){caseu.MODE_NUMBER:return10;caseu.MODE_ALPHA_NUM:return9;caseu.MODE_8BIT_BYTE:caseu.MODE_KANJI:return8;default:thrownewError("mode:"+o)}elseif(e<27)switch(o){caseu.MODE_NUMBER:return12;caseu.MODE_ALPHA_NUM:return11;caseu.MODE_8BIT_BYTE:return16;caseu.MODE_KANJI:return10;default:thrownewError("mode:"+o)}else{if(!(e<41))thrownewError("type:"+e);switch(o){caseu.MODE_NUMBER:return14;caseu.MODE_ALPHA_NUM:return13;caseu.MODE_8BIT_BYTE:return16;caseu.MODE_KANJI:return12;default:thrownewError("mode:"+o)}}},getLostPoint:function(o){for(vare=o.getModuleCount(),r=0,t=0;t<e;t++)for(vari=0;i<e;i++){for(varn=0,a=o.isDark(t,i),u=-1;u<=1;u++)if(!(t+u<0||e<=t+u))for(vard=-1;d<=1;d++)i+d<0||e<=i+d||0==u&&0==d||a==o.isDark(t+u,i+d)&&n++;n>5&&(r+=3+n-5)}for(t=0;t<e-1;t++)for(i=0;i<e-1;i++){vars=0;o.isDark(t,i)&&s++,o.isDark(t+1,i)&&s++,o.isDark(t,i+1)&&s++,o.isDark(t+1,i+1)&&s++,0!=s&&4!=s||(r+=3)}for(t=0;t<e;t++)for(i=0;i<e-6;i++)o.isDark(t,i)&&!o.isDark(t,i+1)&&o.isDark(t,i+2)&&o.isDark(t,i+3)&&o.isDark(t,i+4)&&!o.isDark(t,i+5)&&o.isDark(t,i+6)&&(r+=40);for(i=0;i<e;i++)for(t=0;t<e-6;t++)o.isDark(t,i)&&!o.isDark(t+1,i)&&o.isDark(t+2,i)&&o.isDark(t+3,i)&&o.isDark(t+4,i)&&!o.isDark(t+5,i)&&o.isDark(t+6,i)&&(r+=40);varg=0;for(i=0;i<e;i++)for(t=0;t<e;t++)o.isDark(t,i)&&g++;varl=Math.abs(100*g/e/e-50)/5;returnr+=10*l,r}},l={glog:function(o){if(o<1)thrownewError("glog("+o+")");returnl.LOG_TABLE[o]},gexp:function(o){for(;o<0;)o+=255;for(;o>=256;)o-=255;returnl.EXP_TABLE[o]},EXP_TABLE:newArray(256),LOG_TABLE:newArray(256)},h=0;h<8;h++)l.EXP_TABLE[h]=1<<h;for(h=8;h<256;h++)l.EXP_TABLE[h]=l.EXP_TABLE[h-4]^l.EXP_TABLE[h-5]^l.EXP_TABLE[h-6]^l.EXP_TABLE[h-8];for(h=0;h<255;h++)l.LOG_TABLE[l.EXP_TABLE[h]]=h;r.prototype={get:function(o){returnthis.num[o]},getLength:function(){returnthis.num.length},multiply:function(o){for(vare=newArray(this.getLength()+o.getLength()-1),t=0;t<this.getLength();t++)for(vari=0;i<o.getLength();i++)e[t+i]^=l.gexp(l.glog(this.get(t))+l.glog(o.get(i)));returnnewr(e,0)},mod:function(o){if(this.getLength()-o.getLength()<0)returnthis;for(vare=l.glog(this.get(0))-l.glog(o.get(0)),t=newArray(this.getLength()),i=0;i<this.getLength();i++)t[i]=this.get(i);for(i=0;i<o.getLength();i++)t[i]^=l.gexp(l.glog(o.get(i))+e);returnnewr(t,0).mod(o)}},t.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],t.getRSBlocks=function(o,e){varr=t.getRsBlockTable(o,e);if(null==r)thrownewError("bad rs block @ typeNumber:"+o+"/errorCorrectLevel:"+e);for(vari=r.length/3,n=newArray,a=0;a<i;a++)for(varu=r[3*a+0],d=r[3*a+1],s=r[3*a+2],g=0;g<u;g++)n.push(newt(d,s));returnn},t.getRsBlockTable=function(o,e){switch(e){cased.L:returnt.RS_BLOCK_TABLE[4*(o-1)+0];cased.M:returnt.RS_BLOCK_TABLE[4*(o-1)+1];cased.Q:returnt.RS_BLOCK_TABLE[4*(o-1)+2];cased.H:returnt.RS_BLOCK_TABLE[4*(o-1)+3];default:return}},i.prototype={get:function(o){vare=Math.floor(o/8);return1==(this.buffer[e]>>>7-o%8&1)},put:function(o,e){for(varr=0;r<e;r++)this.putBit(1==(o>>>e-r-1&1))},getLengthInBits:function(){returnthis.length},putBit:function(o){vare=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),o&&(this.buffer[e]|=128>>>this.length%8),this.length++}},a.errorCorrectLevel=d,a.queue=newn,a.queueLoadImage=newn,a.isQueueLoadImage=!1,a.loadImageCache=[],a.utf16To8=function(o){for(vare,r="",t=0;t<o.length;t++)e=o.charCodeAt(t),e>=1&&e<=127?r+=o.charAt(t):e>2047?(r+=String.fromCharCode(224|e>>12&15),r+=String.fromCharCode(128|e>>6&63),r+=String.fromCharCode(128|e>>0&63)):(r+=String.fromCharCode(192|e>>6&31),r+=String.fromCharCode(128|e>>0&63));returnr},a.deepReplace=function(o={},e={},r=!1){lett;t=r?o:{...o};for(letoine){vari=e[o];null!=i&&(i.constructor==Object?t[o]=this.deepReplace(t[o],i):i.constructor!=String||i?t[o]=i:t[o]=t[o])}returnt},a.getSomePropertyToNewObject=function(o={},e=[]){letr={};returne.forEach(e=>{r[e]=o[e]}),r},a.getCanvasContext=function(o){returno.setFillStyle=o.setFillStyle||function(e){o.fillStyle=e},o.setFontSize=o.setFontSize||function(e){o.font=`${e}px`},o.setTextAlign=o.setTextAlign||function(e){o.textAlign=e},o.setTextBaseline=o.setTextBaseline||function(e){o.textBaseline=e},o.draw=o.draw||function(o,e){e&&e()},o},a.getLoadImage=function(o){return"function"==typeofo?function(e,r=!1){returna.isQueueLoadImage?a.queueLoadImage.exec(()=>newPromise((t,i)=>{setTimeout(()=>{constr=a.loadImageCache.find(o=>o.src==e);r?t(r.img):o(e).then(o=>{a.loadImageCache.push({src:e,img:o}),t(o)}).catch(o=>{i(o)})},r?150:10)})):o(e)}:function(o){returnPromise.resolve(o)}};varm=a.loadImage=function(o){returnPromise.resolve(o)};Object.defineProperty(a,"loadImage",{get:()=>m,set(o){m=a.getLoadImage(o)}}),a.prototype={setOptions(o){vare,r,t,i,n,u,d,s,g,l,h,m,c,f,v,p,C,b,y,I,k,w,S,P,B,T,L,A,D,E,N,x,R,z,_,M,O,F,j,H,X,Y,U,Q,G,K,W,q,J,$,V,Z,oo,eo,ro,to,io,no,ao,uo,so,go,lo,ho,mo,co,fo,vo,po,Co,bo,yo,Io,ko,wo,So,Po,Bo,To,Lo,Ao,Do,Eo,No,xo;o&&a.deepReplace(this,{data:o.data||o.text,size:o.size,typeNumber:o.typeNumber,errorCorrectLevel:o.errorCorrectLevel,useDynamicSize:o.useDynamicSize,margin:o.margin,backgroundColor:o.backgroundColor||(null===(e=o.background)||void0===e?void0:e.color),backgroundImageSrc:o.backgroundImageSrc||(null===(r=o.background)||void0===r?void0:null===(t=r.image)||void0===t?void0:t.src),backgroundImageWidth:o.backgroundImageWidth||(null===(i=o.background)||void0===i?void0:null===(n=i.image)||void0===n?void0:n.width),backgroundImageHeight:o.backgroundImageHeight||(null===(u=o.background)||void0===u?void0:null===(d=u.image)||void0===d?void0:d.height),backgroundImageX:o.backgroundImageX||(null===(s=o.background)||void0===s?void0:null===(g=s.image)||void0===g?void0:g.x),backgroundImageY:o.backgroundImageY||(null===(l=o.background)||void0===l?void0:null===(h=l.image)||void0===h?void0:h.y),backgroundImageAlpha:o.backgroundImageAlpha||(null===(m=o.background)||void0===m?void0:null===(c=m.image)||void0===c?void0:c.alpha),backgroundImageBorderRadius:o.backgroundImageBorderRadius||(null===(f=o.background)||void0===f?void0:null===(v=f.image)||void0===v?void0:v.borderRadius),foregroundColor:o.foregroundColor||(null===(p=o.foreground)||void0===p?void0:p.color),foregroundImageSrc:o.foregroundImageSrc||(null===(C=o.foreground)||void0===C?void0:null===(b=C.image)||void0===b?void0:b.src),foregroundImageWidth:o.foregroundImageWidth||(null===(y=o.foreground)||void0===y?void0:null===(I=y.image)||void0===I?void0:I.width),foregroundImageHeight:o.foregroundImageHeight||(null===(k=o.foreground)||void0===k?void0:null===(w=k.image)||void0===w?void0:w.height),foregroundImageX:o.foregroundImageX||(null===(S=o.foreground)||void0===S?void0:null===(P=S.image)||void0===P?void0:P.x),foregroundImageY:o.foregroundImageY||(null===(B=o.foreground)||void0===B?void0:null===(T=B.image)||void0===T?void0:T.y),foregroundImagePadding:o.foregroundImagePadding||(null===(L=o.foreground)||void0===L?void0:null===(A=L.image)||void0===A?void0:A.padding),foregroundImageBackgroundColor:o.foregroundImageBackgroundColor||(null===(D=o.foreground)||void0===D?void0:null===(E=D.image)||void0===E?void0:E.backgroundColor),foregroundImageBorderRadius:o.foregroundImageBorderRadius||(null===(N=o.foreground)||void0===N?void0:null===(x=N.image)||void0===x?void0:x.borderRadius),foregroundImageShadowOffsetX:o.foregroundImageShadowOffsetX||(null===(R=o.foreground)||void0===R?void0:null===(z=R.image)||void0===z?void0:z.shadowOffsetX),foregroundImageShadowOffsetY:o.foregroundImageShadowOffsetY||(null===(_=o.foreground)||void0===_?void0:null===(M=_.image)||void0===M?void0:M.shadowOffsetY),foregroundImageShadowBlur:o.foregroundImageShadowBlur||(null===(O=o.foreground)||void0===O?void0:null===(F=O.image)||void0===F?void0:F.shadowBlur),foregroundImageShadowColor:o.foregroundImageShadowColor||(null===(j=o.foreground)||void0===j?void0:null===(H=j.image)||void0===H?void0:H.shadowColor),positionProbeBackgroundColor:o.positionProbeBackgroundColor||(null===(X=o.positionProbe)||void0===X?void0:X.backgroundColor)||(null===(Y=o.positionDetection)||void0===Y?void0:Y.backgroundColor),positionProbeForegroundColor:o.positionProbeForegroundColor||(null===(U=o.positionProbe)||void0===U?void0:U.foregroundColor)||(null===(Q=o.positionDetection)||void0===Q?void0:Q.foregroundColor),positionProbeImageSrc:o.positionProbeImageSrc||(null===(G=o.art)||void0===G?void0:null===(K=G.positionProbe)||void0===K?void0:K.imageSrc)||(null===(W=o.art)||void0===W?void0:null===(q=W.positionDetection)||void0===q?void0:q.image),positionProbeLeftUpperImageSrc:o.positionProbeLeftUpperImageSrc||(null===(J=o.art)||void0===J?void0:null===($=J.positionProbe)||void0===$?void0:null===(V=$.leftUpper)||void0===V?void0:V.imageSrc)||(null===(Z=o.art)||void0===Z?void0:null===(oo=Z.positionDetection)||void0===oo?void0:null===(eo=oo.upperLeft)||void0===eo?void0:eo.image),positionProbeRightUpperImageSrc:o.positionProbeRightUpperImageSrc||(null===(ro=o.art)||void0===ro?void0:null===(to=ro.positionProbe)||void0===to?void0:null===(io=to.rightUpper)||void0===io?void0:io.imageSrc)||(null===(no=o.art)||void0===no?void0:null===(ao=no.positionDetection)||void0===ao?void0:null===(uo=ao.upperRight)||void0===uo?void0:uo.image),positionProbeLeftLowerImageSrc:o.positionProbeLeftLowerImageSrc||(null===(so=o.art)||void0===so?void0:null===(go=so.positionProbe)||void0===go?void0:null===(lo=go.leftLower)||void0===lo?void0:lo.imageSrc)||(null===(ho=o.art)||void0===ho?void0:null===(mo=ho.positionDetection)||void0===mo?void0:null===(co=mo.lowerLeft)||void0===co?void0:co.image),separatorColor:o.separatorColor||(null===(fo=o.separator)||void0===fo?void0:fo.color),positionAdjustBackgroundColor:o.positionAdjustBackgroundColor||(null===(vo=o.positionAdjust)||void0===vo?void0:vo.backgroundColor)||(null===(po=o.alignment)||void0===po?void0:po.backgroundColor),positionAdjustForegroundColor:o.positionAdjustForegroundColor||(null===(Co=o.positionAdjust)||void0===Co?void0:Co.foregroundColor)||(null===(bo=o.alignment)||void0===bo?void0:bo.foregroundColor),positionAdjustImageSrc:o.positionAdjustImageSrc||(null===(yo=o.art)||void0===yo?void0:null===(Io=yo.positionAdjust)||void0===Io?void0:Io.imageSrc)||(null===(ko=o.art)||void0===ko?void0:null===(wo=ko.alignment)||void0===wo?void0:wo.image),timingBackgroundColor:o.timingBackgroundColor||(null===(So=o.timing)||void0===So?void0:So.backgroundColor),timingForegroundColor:o.timingForegroundColor||(null===(Po=o.timing)||void0===Po?void0:Po.foregroundColor),typeNumberBackgroundColor:o.typeNumberBackgroundColor||(null===(Bo=o.typeNumber)||void0===Bo?void0:Bo.backgroundColor)||(null===(To=o.versionInformation)||void0===To?void0:To.backgroundColor),typeNumberForegroundColor:o.typeNumberForegroundColor||(null===(Lo=o.typeNumber)||void0===Lo?void0:Lo.foregroundColor)||(null===(Ao=o.versionInformation)||void0===Ao?void0:Ao.foregroundColor),darkBlockColor:o.darkBlockColor||(null===(Do=o.darkBlock)||void0===Do?void0:Do.color),patterns:o.patterns||(null===(Eo=o.art)||void0===Eo?void0:Eo.patterns)||(null===(No=o.art)||void0===No?void0:null===(xo=No.shape)||void0===xo?void0:xo.map(o=>(o.imageSrc=o.image,o))),queue:o.queue},!0)},make(){this.foregroundColor===this.backgroundColor&&console.error("[uQRCode]: foregroundColor and backgroundColor cannot be the same!");varo=newe(this.typeNumber,this.errorCorrectLevel);o.addData(a.utf16To8(this.data.toString())),o.make(),this.typeNumber=o.typeNumber,this.modules=o.modules,this.moduleCount=o.moduleCount;varr=this.size-2*this.margin;this.dynamicSize=Math.ceil(r/o.moduleCount)*o.moduleCount+2*this.margin,this.useDynamicSize||(this.dynamicSize=this.size),this.paintData(),this.paintPositionProbe(),this.paintSeparator(),this.paintTiming(),this.paintPositionAdjust(),this.paintDarkBlock(),this.paintTypeNumber(),this.getDrawModules()},paintData(){let{dynamicSize:o,margin:e,backgroundColor:r,foregroundColor:t,modules:i,moduleCount:n}=this,a=(o-2*e)/n;for(varu=0;u<n;u++)for(vard=0;d<n;d++){vars=i[u][d];i[u][d]=s?{size:a,x:d*a+e,y:u*a+e,type:["foreground"],color:t,isBlack:!0,isDrawn:!1}:{size:a,x:d*a+e,y:u*a+e,type:["background"],color:r,isBlack:!1,isDrawn:!1}}},paintPositionProbe(){let{modules:o,moduleCount:e,positionProbeBackgroundColor:r,positionProbeForegroundColor:t}=this,i=[[0,0,1],[1,0,1],[2,0,1],[3,0,1],[4,0,1],[5,0,1],[6,0,1],[0,1,1],[1,1,0],[2,1,0],[3,1,0],[4,1,0],[5,1,0],[6,1,1],[0,2,1],[1,2,0],[2,2,1],[3,2,1],[4,2,1],[5,2,0],[6,2,1],[0,3,1],[1,3,0],[2,3,1],[3,3,1],[4,3,1],[5,3,0],[6,3,1],[0,4,1],[1,4,0],[2,4,1],[3,4,1],[4,4,1],[5,4,0],[6,4,1],[0,5,1],[1,5,0],[2,5,0],[3,5,0],[4,5,0],[5,5,0],[6,5,1],[0,6,1],[1,6,1],[2,6,1],[3,6,1],[4,6,1],[5,6,1],[6,6,1]],n=e-7;i.forEach(e=>{vari=o[e[0]][e[1]],a=o[e[0]+n][e[1]],u=o[e[0]][e[1]+n];u.type.push("positionProbe"),a.type.push("positionProbe"),i.type.push("positionProbe"),i.color=1==e[2]?t:r,a.color=1==e[2]?t:r,u.color=1==e[2]?t:r})},paintSeparator(){let{modules:o,moduleCount:e,separatorColor:r}=this;[[7,0],[7,1],[7,2],[7,3],[7,4],[7,5],[7,6],[7,7],[0,7],[1,7],[2,7],[3,7],[4,7],[5,7],[6,7]].forEach(t=>{vari=o[t[0]][t[1]],n=o[e-t[0]-1][t[1]],a=o[t[0]][e-t[1]-1];a.type.push("separator"),n.type.push("separator"),i.type.push("separator"),i.color=r,n.color=r,a.color=r})},paintPositionAdjust(){let{typeNumber:o,modules:e,moduleCount:r,foregroundColor:t,backgroundColor:i,positionAdjustForegroundColor:n,positionAdjustBackgroundColor:a,timingForegroundColor:u,timingBackgroundColor:d}=this;consts=[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],g=s[o-1];if(g){consto=[[-2,-2,1],[-1,-2,1],[0,-2,1],[1,-2,1],[2,-2,1],[-2,-1,1],[-1,-1,0],[0,-1,0],[1,-1,0],[2,-1,1],[-2,0,1],[-1,0,0],[0,0,1],[1,0,0],[2,0,1],[-2,1,1],[-1,1,0],[0,1,0],[1,1,0],[2,1,1],[-2,2,1],[-1,2,1],[0,2,1],[1,2,1],[2,2,1]],s=g.length;for(letl=0;l<s;l++)for(leth=0;h<s;h++){let{x:s,y:m}={x:g[l],y:g[h]};s<9&&m<9||s>r-9-1&&m<9||m>r-9-1&&s<9||o.forEach(o=>{varr=e[s+o[0]][m+o[1]];r.type.push("positionAdjust"),r.type.includes("timing")?1==o[2]?r.color=n==t?u:n:r.color=n==t&&a==i?d:a:r.color=1==o[2]?n:a})}}},paintTiming(){let{modules:o,moduleCount:e,timingForegroundColor:r,timingBackgroundColor:t}=this,i=e-16;for(lete=0;e<i;e++){varn=o[6][8+e],a=o[8+e][6];n.type.push("timing"),a.type.push("timing"),n.color=1&e^1?r:t,a.color=1&e^1?r:t}},paintDarkBlock(){let{modules:o,moduleCount:e,darkBlockColor:r}=this;vart=o[e-7-1][8];t.type.push("darkBlock"),t.color=r},paintTypeNumber(){let{typeNumber:o,modules:e,moduleCount:r,typeNumberBackgroundColor:t,typeNumberForegroundColor:i}=this;if(o<7)returne;constn=[0,0,0,0,0,0,0,"000111110010010100","001000010110111100","001001101010011001","001010010011010011","001011101111110110","001100011101100010","001101100001000111","001110011000001101","001111100100101000","010000101101111000","010001010001011101","010010101000010111","010011010100110010","010100100110100110","010101011010000011","010110100011001001","010111011111101100","011000111011000100","011001000111100001","011010111110101011","011011000010001110","011100110000011010","011101001100111111","011110110101110101","011111001001010000","100000100111010101","100001011011110000","100010100010111010","100011011110011111","100100101100001011","100101010000101110","100110101001100100","100111010101000001","101000110001101001"];leta=n[o]+n[o],u=[r-11,r-10,r-9],d=[[5,u[2]],[5,u[1]],[5,u[0]],[4,u[2]],[4,u[1]],[4,u[0]],[3,u[2]],[3,u[1]],[3,u[0]],[2,u[2]],[2,u[1]],[2,u[0]],[1,u[2]],[1,u[1]],[1,u[0]],[0,u[2]],[0,u[1]],[0,u[0]],[u[2],5],[u[1],5],[u[0],5],[u[2],4],[u[1],4],[u[0],4],[u[2],3],[u[1],3],[u[0],3],[u[2],2],[u[1],2],[u[0],2],[u[2],1],[u[1],1],[u[0],1],[u[2],0],[u[1],0],[u[0],0]];d.forEach((o,r)=>{varn=e[o[0]][o[1]];n.type.push("typeNumber"),n.color="1"==a[r]?i:t})},getDrawModules(){leto=this.drawModules=[],{modules:e,moduleCount:r,dynamicSize:t,backgroundColor:i,backgroundImageSrc:n,backgroundImageX:a,backgroundImageY:u,backgroundImageWidth:d,backgroundImageHeight:s,backgroundImageAlpha:g,backgroundImageBorderRadius:l,positionProbeLeftUpperImageSrc:h,positionProbeRightUpperImageSrc:m,positionProbeLeftLowerImageSrc:c,positionAdjustImageSrc:f,patterns:v,foregroundImageSrc:p,foregroundImageX:C,foregroundImageY:b,foregroundImageWidth:y,foregroundImageHeight:I,foregroundImagePadding:k,foregroundImageBackgroundColor:w,foregroundImageBorderRadius:S,foregroundImageShadowOffsetX:P,foregroundImageShadowOffsetY:B,foregroundImageShadowBlur:T,foregroundImageShadowColor:L}=this;if(i&&o.push({name:"background",type:"block",color:i,x:0,y:0,width:t,height:t}),n&&o.push({name:"backgroundImage",type:"image",imageSrc:n,imageSource:"backgroundImageSrc",x:a,y:u,width:d,height:s,alpha:g,borderRadius:l}),h){o.push({name:"foreground",type:"image",imageSrc:h,imageSource:"positionProbeLeftUpperImageSrc",x:e[0][0].x,y:e[0][0].y,width:e[0][7].x-e[0][0].x,height:e[7][0].y-e[0][0].y});for(varA=0;A<7;A++)for(varD=0;D<7;D++){varE=e[A][D];E.isDrawn=!0}}if(m){o.push({name:"foreground",type:"image",imageSrc:m,imageSource:"positionProbeRightUpperImageSrc",x:e[0][r-7].x,y:e[0][r-7].y,width:e[0][r-1].x-e[0][r-7-1].x,height:e[7][r-7-1].y-e[0][r-7].y});for(A=0;A<7;A++)for(D=7;D>0;D--){E=e[A][r-D];E.isDrawn=!0}}if(c){o.push({name:"foreground",type:"image",imageSrc:c,imageSource:"positionProbeLeftLowerImageSrc",x:e[r-7][0].x,y:e[r-7][0].y,width:e[r-7][7].x-e[r-7][0].x,height:e[r-1][0].y-e[r-7-1][0].y});for(A=7;A>0;A--)for(D=0;D<7;D++){E=e[r-A][D];E.isDrawn=!0}}if(f){lett=[];for(varN=0;N<r;N++)for(varx=0;x<r;x++){E=e[N][x];if(E.type.includes("positionAdjust")&&!E.isSign){for(varR={x:E.x,y:E.y,rowIndex:N,columnIndex:x},z=1;;){var_=e[N+z][x];if(!_.type.includes("positionAdjust"))break;z++}for(varM=1;;){_=e[N][x+M];if(!_.type.includes("positionAdjust"))break;M++}R.width=e[N][x+M].x-e[N][x].x,R.height=e[N+z][x].y-e[N][x].y,R.relativeLastRowIndex=z,R.relativeLastColumnIndex=M;for(A=0;A<z;A++)for(D=0;D<M;D++){varO=e[N+A][x+D];O.isSign=!0}t.push(R)}}t.forEach(r=>{o.push({name:"foreground",type:"image",imageSrc:f,imageSource:"positionAdjustImageSrc",x:r.x,y:r.y,width:r.width,height:r.height});for(vart=0;t<r.relativeLastRowIndex;t++)for(vari=0;i<r.relativeLastColumnIndex;i++){varn=e[r.rowIndex+t][r.columnIndex+i];n.isDrawn=!0}})}varF=v.filter(o=>o.imageSrc);if(F.length>0)for(A=0;A<F.length;A++){varj=F[A];for(N=0;N<r;N++)for(x=0;x<r;x++){E=e[N][x];if(!E.isDrawn&&(!j.isRandom||j.isRandom&&1==parseInt(2*Math.random()))){varH=j.matrix.length,X=j.matrix[0].length,Y=!0;if(N+H<=r&&x+X<=r)for(varU=0;U<H&&Y;U++)for(varQ=0;Q<X&&Y;Q++){varG=j.matrix[U][Q],K=e[N+U][x+Q];Y=1==G&&1==K.isBlack&&!K.isDrawn||(0==G&&0==K.isBlack&&!K.isDrawn||null==G&&!K.isDrawn)}elseY=!1;if(Y){o.push({name:"foreground",type:"image",imageSrc:j.imageSrc,imageSource:`patterns[${A}].imageSrc`,x:E.x,y:E.y,width:E.size*X,height:E.size*H});for(U=0;U<H;U++)for(Q=0;Q<X;Q++){G=j.matrix[U][Q],K=e[N+U][x+Q];null!=G&&(K.isDrawn=!0)}}}}}for(N=0;N<r;N++)for(x=0;x<r;x++){E=e[N][x];E.isDrawn||E.color==i||(o.push({name:"foreground",type:"block",color:E.color,x:E.x,y:E.y,width:E.size,height:E.size}),E.isDrawn=!0)}p&&o.push({name:"foregroundImage",type:"image",imageSrc:p,imageSource:"foregroundImageSrc",x:C,y:b,width:y,height:I,padding:k,backgroundColor:w,borderRadius:S,shadowOffsetX:P,shadowOffsetY:B,shadowBlur:T,shadowColor:L})},drawCanvas(){let{drawModules:o,canvasContext:e,foregroundColor:r,backgroundColor:t,queue:i}=this;if(r===t)returnPromise.reject({errmsg:"[uQRCode]: foregroundColor and backgroundColor cannot be the same!"});letn=async(r,t)=>{e.draw(!1);letn=!1;for(varu=0;u<o.length;u++){vard=o[u];switch(e.save(),d.type){case"block":e.setFillStyle(d.color),e.fillRect(d.x,d.y,d.width,d.height);break;case"image":if("backgroundImage"===d.name){vars=d.x,g=d.y,l=d.width,h=d.height,m=d.borderRadius;l<2*m&&(m=l/2),h<2*m&&(m=h/2),e.globalAlpha=d.alpha,e.beginPath(),e.moveTo(s+m,g),e.arcTo(s+l,g,s+l,g+h,m),e.arcTo(s+l,g+h,s,g+h,m),e.arcTo(s,g+h,s,g,m),e.arcTo(s,g,s+l,g,m),e.closePath(),e.strokeStyle="rgba(0,0,0,0)",e.stroke(),e.clip()}elseif("foregroundImage"===d.name){s=d.x,g=d.y,l=d.width,h=d.height,m=d.borderRadius;l<2*m&&(m=l/2),h<2*m&&(m=h/2);varc=d.x-d.padding,f=d.y-d.padding,v=d.width+2*d.padding,p=d.height+2*d.padding,C=v/l*m;v<2*C&&(C=v/2),p<2*C&&(C=p/2),e.save(),e.shadowOffsetX=d.shadowOffsetX,e.shadowOffsetY=d.shadowOffsetY,e.shadowBlur=d.shadowBlur,e.shadowColor=d.shadowColor,e.beginPath(),e.moveTo(c+C,f),e.arcTo(c+v,f,c+v,f+p,C),e.arcTo(c+v,f+p,c,f+p,C),e.arcTo(c,f+p,c,f,C),e.arcTo(c,f,c+v,f,C),e.closePath(),e.setFillStyle(d.backgroundColor),e.fill(),e.restore(),e.beginPath(),e.moveTo(c+C,f),e.arcTo(c+v,f,c+v,f+p,C),e.arcTo(c+v,f+p,c,f+p,C),e.arcTo(c,f+p,c,f,C),e.arcTo(c,f,c+v,f,C),e.closePath(),e.setFillStyle(d.padding>0?d.backgroundColor:"rgba(0,0,0,0)"),e.fill(),e.beginPath(),e.moveTo(s+m,g),e.arcTo(s+l,g,s+l,g+h,m),e.arcTo(s+l,g+h,s,g+h,m),e.arcTo(s,g+h,s,g,m),e.arcTo(s,g,s+l,g,m),e.closePath(),e.strokeStyle="rgba(0,0,0,0)",e.stroke(),e.clip()}try{varb=awaita.loadImage(d.imageSrc);e.drawImage(b,d.x,d.y,d.width,d.height)}catch(o){console.error(`[uQRCode]: ${d.imageSource} invalid!`),t({errmsg:`[uQRCode]: ${d.imageSource} invalid!`}),n=!0}}if(n)return;i&&e.draw(!0),e.restore()}e.draw(!0),setTimeout(r,150)};returnnewPromise((o,e)=>{i?a.queue.exec(()=>newPromise((o,e)=>{n(o,e)})).then(()=>{setTimeout(o,150)}).catch(o=>{e(o)}):n(o,e)})},draw(){returnthis.drawCanvas()}},uQRCode=a,uQRCode.export=function(){varo,e;o="undefined"!=typeofwindow?window:global,e=uQRCode,"undefined"!=typeofmodule&&"object"==typeofexports?module.exports=e:"function"==typeofdefine&&(define.amd||define.cmd)?define(function(){returne}):o.UQRCode=e}}();
> `vue3`推荐使用`npm`安装,非`npm`安装直接引入`uqrcode.js`文件如果出现报错:`SyntaxError: The requested module 'uqrcode.js' does not provide an export named 'default'`,在`uqrcode.js`文件中最后一行添加`export default uQRCode`即可。
thrownewError('Wechat official account ticket not found, please referer to: https://uniapp.dcloud.net.cn/uniCloud/uni-id-pages.html#login-by-weixin-h5')