import{b as Pe}from"./canvas@2.11.2-f05bd587.js";import{g as Ce,l as Re,u as Ee}from"./js-binary-schema-parser@2.0.3-9e47f7a8.js";var N=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Ve(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Ye(e){if(e.__esModule)return e;var u=e.default;if(typeof u=="function"){var n=function c(){return this instanceof c?Reflect.construct(u,arguments,this.constructor):u.apply(this,arguments)};n.prototype=u.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(c){var v=Object.getOwnPropertyDescriptor(e,c);Object.defineProperty(n,c,v.get?v:{enumerable:!0,get:function(){return e[c]}})}),n}var Be={},Jt={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.QRMath=e.QRUtil=e.QRMaskPattern=e.QRErrorCorrectLevel=e.QRCodeModel=void 0;function u(o,t,a){var s=c(t),r=o-1,i=0;switch(a){case e.QRErrorCorrectLevel.L:i=B[r][0];break;case e.QRErrorCorrectLevel.M:i=B[r][1];break;case e.QRErrorCorrectLevel.Q:i=B[r][2];break;case e.QRErrorCorrectLevel.H:i=B[r][3];break}return s<=i}function n(o,t){for(var a=1,s=c(o),r=0,i=B.length;rB.length)throw new Error("Too long data");return a}function c(o){var t=encodeURI(o).toString().replace(/\%[0-9a-fA-F]{2}/g,"a");return t.length+(t.length!=Number(o)?3:0)}var v=function(){function o(t){this.mode=g.MODE_8BIT_BYTE,this.parsedData=[],this.data=t;for(var a=[],s=0,r=this.data.length;s65536?(i[0]=240|(f&1835008)>>>18,i[1]=128|(f&258048)>>>12,i[2]=128|(f&4032)>>>6,i[3]=128|f&63):f>2048?(i[0]=224|(f&61440)>>>12,i[1]=128|(f&4032)>>>6,i[2]=128|f&63):f>128?(i[0]=192|(f&1984)>>>6,i[1]=128|f&63):i[0]=f,a.push(i)}this.parsedData=Array.prototype.concat.apply([],a),this.parsedData.length!=this.data.length&&(this.parsedData.unshift(191),this.parsedData.unshift(187),this.parsedData.unshift(239))}return o.prototype.getLength=function(){return this.parsedData.length},o.prototype.write=function(t){for(var a=0,s=this.parsedData.length;a40)throw new Error("Invalid QR version: "+this.typeNumber);if(!u(this.typeNumber,t,this.errorCorrectLevel))throw new Error("Data is too long for QR version: "+this.typeNumber)}var a=new v(t);this.dataList.push(a),this.dataCache=void 0},o.prototype.isDark=function(t,a){if(t<0||this.moduleCount<=t||a<0||this.moduleCount<=a)throw new Error(t+","+a);return this.modules[t][a]},o.prototype.getModuleCount=function(){return this.moduleCount},o.prototype.make=function(){this.makeImpl(!1,this.getBestMaskPattern())},o.prototype.makeImpl=function(t,a){this.moduleCount=this.typeNumber*4+17,this.modules=new Array(this.moduleCount);for(var s=0;s=7&&this.setupTypeNumber(t),this.dataCache==null&&(this.dataCache=o.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,a)},o.prototype.setupPositionProbePattern=function(t,a){for(var s=-1;s<=7;s++)if(!(t+s<=-1||this.moduleCount<=t+s))for(var r=-1;r<=7;r++)a+r<=-1||this.moduleCount<=a+r||(0<=s&&s<=6&&(r==0||r==6)||0<=r&&r<=6&&(s==0||s==6)||2<=s&&s<=4&&2<=r&&r<=4?this.modules[t+s][a+r]=!0:this.modules[t+s][a+r]=!1)},o.prototype.getBestMaskPattern=function(){if(Number.isInteger(this.maskPattern)&&Object.values(e.QRMaskPattern).includes(this.maskPattern))return this.maskPattern;for(var t=0,a=0,s=0;s<8;s++){this.makeImpl(!0,s);var r=P.getLostPoint(this);(s==0||t>r)&&(t=r,a=s)}return a},o.prototype.setupTimingPattern=function(){for(var t=8;t>s&1)==1;this.modules[Math.floor(s/3)][s%3+this.moduleCount-8-3]=r}for(var s=0;s<18;s++){var r=!t&&(a>>s&1)==1;this.modules[s%3+this.moduleCount-8-3][Math.floor(s/3)]=r}},o.prototype.setupTypeInfo=function(t,a){for(var s=this.errorCorrectLevel<<3|a,r=P.getBCHTypeInfo(s),i=0;i<15;i++){var f=!t&&(r>>i&1)==1;i<6?this.modules[i][8]=f:i<8?this.modules[i+1][8]=f:this.modules[this.moduleCount-15+i][8]=f}for(var i=0;i<15;i++){var f=!t&&(r>>i&1)==1;i<8?this.modules[8][this.moduleCount-i-1]=f:i<9?this.modules[8][15-i-1+1]=f:this.modules[8][15-i-1]=f}this.modules[this.moduleCount-8][8]=!t},o.prototype.mapData=function(t,a){for(var s=-1,r=this.moduleCount-1,i=7,f=0,l=this.moduleCount-1;l>0;l-=2)for(l==6&&l--;;){for(var p=0;p<2;p++)if(this.modules[r][l-p]==null){var m=!1;f>>i&1)==1);var _=P.getMask(a,r,l-p);_&&(m=!m),this.modules[r][l-p]=m,i--,i==-1&&(f++,i=7)}if(r+=s,r<0||this.moduleCount<=r){r-=s,s=-s;break}}},o.createData=function(t,a,s){for(var r=D.getRSBlocks(t,a),i=new E,f=0;fp*8)throw new Error("code length overflow. ("+i.getLengthInBits()+">"+p*8+")");for(i.getLengthInBits()+4<=p*8&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(!1);for(;!(i.getLengthInBits()>=p*8||(i.put(o.PAD0,8),i.getLengthInBits()>=p*8));)i.put(o.PAD1,8);return o.createBytes(i,r)},o.createBytes=function(t,a){for(var s=0,r=0,i=0,f=new Array(a.length),l=new Array(a.length),p=0;p=0?h.get(L):0}}for(var R=0,y=0;y=0;)a^=o.G15<=0;)a^=o.G18<>>=1;return a},o.getPatternPosition=function(t){return o.PATTERN_POSITION_TABLE[t-1]},o.getMask=function(t,a,s){switch(t){case e.QRMaskPattern.PATTERN000:return(a+s)%2==0;case e.QRMaskPattern.PATTERN001:return a%2==0;case e.QRMaskPattern.PATTERN010:return s%3==0;case e.QRMaskPattern.PATTERN011:return(a+s)%3==0;case e.QRMaskPattern.PATTERN100:return(Math.floor(a/2)+Math.floor(s/3))%2==0;case e.QRMaskPattern.PATTERN101:return a*s%2+a*s%3==0;case e.QRMaskPattern.PATTERN110:return(a*s%2+a*s%3)%2==0;case e.QRMaskPattern.PATTERN111:return(a*s%3+(a+s)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},o.getErrorCorrectPolynomial=function(t){for(var a=new w([1],0),s=0;s5&&(s+=3+f-5)}for(var r=0;r=256;)t-=255;return o.EXP_TABLE[t]},o.EXP_TABLE=new Array(256),o.LOG_TABLE=new Array(256),o._constructor=function(){for(var t=0;t<8;t++)o.EXP_TABLE[t]=1<>>7-t%8&1)==1},o.prototype.put=function(t,a){for(var s=0;s>>a-s-1&1)==1)},o.prototype.getLengthInBits=function(){return this.length},o.prototype.putBit=function(t){var a=Math.floor(this.length/8);this.buffer.length<=a&&this.buffer.push(0),t&&(this.buffer[a]|=128>>>this.length%8),this.length++},o}(),B=[[17,14,11,7],[32,26,20,14],[53,42,32,24],[78,62,46,34],[106,84,60,44],[134,106,74,58],[154,122,86,64],[192,152,108,84],[230,180,130,98],[271,213,151,119],[321,251,177,137],[367,287,203,155],[425,331,241,177],[458,362,258,194],[520,412,292,220],[586,450,322,250],[644,504,364,280],[718,560,394,310],[792,624,442,338],[858,666,482,382],[929,711,509,403],[1003,779,565,439],[1091,857,611,461],[1171,911,661,511],[1273,997,715,535],[1367,1059,751,593],[1465,1125,805,625],[1528,1190,868,658],[1628,1264,908,698],[1732,1370,982,742],[1840,1452,1030,790],[1952,1538,1112,842],[2068,1628,1168,898],[2188,1722,1228,958],[2303,1809,1283,983],[2431,1911,1351,1051],[2563,1989,1423,1093],[2699,2099,1499,1139],[2809,2213,1579,1219],[2953,2331,1663,1273]]})(Jt);var It={},pe={},Ft={};Object.defineProperty(Ft,"__esModule",{value:!0});Ft.deinterlace=void 0;Ft.deinterlace=function(e,u){for(var n=new Array(e.length),c=e.length/u,v=function(D,E){var B=e.slice(E*u,(E+1)*u);n.splice.apply(n,[D*u,u].concat(B))},d=[0,4,2,1],g=[8,8,4,2],P=0,b=0;b<4;b++)for(var w=d[b];w>=w,p-=w,o>g||o==D)break;if(o==P){w=a+1,b=(1<P;)f[_++]=i[o],o=r[o];m=i[o]&255,f[_++]=m,g>Zt,Ae=Wt<>3,Xt=6,Le=1<>3);var r,i;for(r=0;r>=rt,n[r][1]>>=rt,n[r][2]>>=rt,n[r][3]=r}function w(r,i,f,l,p){n[i][0]-=r*(n[i][0]-f)/Dt,n[i][1]-=r*(n[i][1]-l)/Dt,n[i][2]-=r*(n[i][2]-p)/Dt}function D(r,i,f,l,p){for(var m=Math.abs(i-r),_=Math.min(i+r,Q),y=i+1,T=i-1,M=1,h,L;y<_||T>m;)L=g[M++],y<_&&(h=n[y++],h[0]-=L*(h[0]-f)/lt,h[1]-=L*(h[1]-l)/lt,h[2]-=L*(h[2]-p)/lt),T>m&&(h=n[T--],h[0]-=L*(h[0]-f)/lt,h[1]-=L*(h[1]-l)/lt,h[2]-=L*(h[2]-p)/lt)}function E(r,i,f){var l=2147483647,p=l,m=-1,_=m,y,T,M,h,L;for(y=0;y>me-rt),h>Zt,d[y]-=L,v[y]+=L<>1,i=_+1;i>1,i=_+1;i<256;i++)c[i]=le}function o(r,i,f){for(var l,p,m,_=1e3,y=-1,T=c[i],M=T-1;T=0;)T=_?T=Q:(T++,m<0&&(m=-m),l=p[0]-r,l<0&&(l=-l),m+=l,m<_&&(l=p[2]-f,l<0&&(l=-l),m+=l,m<_&&(_=m,y=p[3])))),M>=0&&(p=n[M],m=i-p[1],m>=_?M=-1:(M--,m<0&&(m=-m),l=p[0]-r,l<0&&(l=-l),m+=l,m<_&&(l=p[2]-f,l<0&&(l=-l),m+=l,m<_&&(_=m,y=p[3]))));return y}function t(){var r,i=e.length,f=30+(u-1)/3,l=i/(3*u),p=~~(l/De),m=Dt,_=ke,y=_>>Xt;for(y<=1&&(y=0),r=0;r=i&&(A-=i),r++,p===0&&(p=1),r%p===0)for(m-=m/f,_-=_/Ie,y=_>>Xt,y<=1&&(y=0),R=0;R=254&&T(A)}function p(R){m(bt),E=a+2,o=!0,L(a,R)}function m(R){for(var A=0;A=0){Z=q-F,F===0&&(Z=1);do if((F-=Z)<0&&(F+=q),g[F]===C){z=P[F];continue t}while(g[F]>=0)}L(z,A),z=Y,E<1<0&&(R.writeByte(D),R.writeBytes(d,0,D),D=0)}function M(R){return(1<0?b|=R<=8;)l(b&255,A),b>>=8,w-=8;if((E>B||o)&&(o?(B=M(f=t),o=!1):(++f,f==Tt?B=1<0;)l(b&255,A),b>>=8,w-=8;T(A)}}this.encode=y}var Ge=Ne,Ue=Oe,He=Ge;function G(){this.page=-1,this.pages=[],this.newPage()}G.pageSize=4096;G.charMap={};for(var At=0;At<256;At++)G.charMap[At]=String.fromCharCode(At);G.prototype.newPage=function(){this.pages[++this.page]=new Uint8Array(G.pageSize),this.cursor=0};G.prototype.getData=function(){for(var e="",u=0;u=G.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=e};G.prototype.writeUTFBytes=function(e){for(var u=e.length,n=0;n=0&&(this.dispose=e)};I.prototype.setRepeat=function(e){this.repeat=e};I.prototype.setTransparent=function(e){this.transparent=e};I.prototype.addFrame=function(e){this.image=e,this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null,this.getImagePixels(),this.analyzePixels(),this.globalPalette===!0&&(this.globalPalette=this.colorTab),this.firstFrame&&(this.writeHeader(),this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),!this.firstFrame&&!this.globalPalette&&this.writePalette(),this.writePixels(),this.firstFrame=!1};I.prototype.finish=function(){this.out.writeByte(59)};I.prototype.setQuality=function(e){e<1&&(e=1),this.sample=e};I.prototype.setDither=function(e){e===!0&&(e="FloydSteinberg"),this.dither=e};I.prototype.setGlobalPalette=function(e){this.globalPalette=e};I.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette};I.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")};I.prototype.analyzePixels=function(){this.colorTab||(this.neuQuant=new Ue(this.pixels,this.sample),this.neuQuant.buildColormap(),this.colorTab=this.neuQuant.getColormap()),this.dither?this.ditherPixels(this.dither.replace("-serpentine",""),this.dither.match(/-serpentine/)!==null):this.indexPixels(),this.pixels=null,this.colorDepth=8,this.palSize=7,this.transparent!==null&&(this.transIndex=this.findClosest(this.transparent,!0))};I.prototype.indexPixels=function(e){var u=this.pixels.length/3;this.indexedPixels=new Uint8Array(u);for(var n=0,c=0;c=0&&y+D=0&&T+w>16,(e&65280)>>8,e&255,u)};I.prototype.findClosestRGB=function(e,u,n,c){if(this.colorTab===null)return-1;if(this.neuQuant&&!c)return this.neuQuant.lookupRGB(e,u,n);for(var v=0,d=256*256*256,g=this.colorTab.length,P=0,b=0;P=0&&(u=this.dispose&7),u<<=2,this.out.writeByte(0|u|0|e),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)};I.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame||this.globalPalette?this.out.writeByte(0):this.out.writeByte(128|this.palSize)};I.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)};I.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes("NETSCAPE2.0"),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)};I.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);for(var e=3*256-this.colorTab.length,u=0;u>8&255)};I.prototype.writePixels=function(){var e=new He(this.width,this.height,this.indexedPixels,this.colorDepth);e.encode(this.out)};I.prototype.stream=function(){return this.out};var je=I,kt=N&&N.__assign||function(){return kt=Object.assign||function(e){for(var u,n=1,c=arguments.length;n0&&d[d.length-1])&&(w[0]===6||w[0]===2)){n=0;continue}if(w[0]===3&&(!d||w[1]>d[0]&&w[1]1)throw new Error("dotScale should be in range (0, 1].");n.components.data.scale=n.dotScale,n.components.timing.scale=n.dotScale,n.components.alignment.scale=n.dotScale}this.options=n,this.canvas=J.createCanvas(u.size,u.size),this.canvasContext=this.canvas.getContext("2d"),this.qrCode=new Mt.QRCodeModel(-1,this.options.correctLevel),Number.isInteger(this.options.maskPattern)&&(this.qrCode.maskPattern=this.options.maskPattern),Number.isInteger(this.options.version)&&(this.qrCode.typeNumber=this.options.version),this.qrCode.addData(this.options.text),this.qrCode.make()}return e.prototype.draw=function(){var u=this;return new Promise(function(n){return u._draw().then(n)})},e.prototype._clear=function(){this.canvasContext.clearRect(0,0,this.canvas.width,this.canvas.height)},e._prepareRoundedCornerClip=function(u,n,c,v,d,g){u.beginPath(),u.moveTo(n,c),u.arcTo(n+v,c,n+v,c+d,g),u.arcTo(n+v,c+d,n,c+d,g),u.arcTo(n,c+d,n,c,g),u.arcTo(n,c,n+v,c,g),u.closePath()},e._getAverageRGB=function(u){var n=5,c={r:0,g:0,b:0},v,d,g=-4,P={r:0,g:0,b:0},b=0;d=u.naturalHeight||u.height,v=u.naturalWidth||u.width;var w=J.createCanvas(v,d),D=w.getContext("2d");if(!D)return c;D.drawImage(u,0,0);var E;try{E=D.getImageData(0,0,v,d)}catch{return c}for(;(g+=n*4)200||E.data[g+1]>200||E.data[g+2]>200||(++b,P.r+=E.data[g],P.g+=E.data[g+1],P.b+=E.data[g+2]);return P.r=~~(P.r/b),P.g=~~(P.g/b),P.b=~~(P.b/b),P},e._drawDot=function(u,n,c,v,d,g){d===void 0&&(d=0),g===void 0&&(g=1),u.fillRect((n+d)*v,(c+d)*v,g*v,g*v)},e._drawAlignProtector=function(u,n,c,v){u.clearRect((n-2)*v,(c-2)*v,5*v,5*v),u.fillRect((n-2)*v,(c-2)*v,5*v,5*v)},e._drawAlign=function(u,n,c,v,d,g,P,b){d===void 0&&(d=0),g===void 0&&(g=1);var w=u.fillStyle;u.fillStyle=P,new Array(4).fill(0).map(function(D,E){e._drawDot(u,n-2+E,c-2,v,d,g),e._drawDot(u,n+2,c-2+E,v,d,g),e._drawDot(u,n+2-E,c+2,v,d,g),e._drawDot(u,n-2,c+2-E,v,d,g)}),e._drawDot(u,n,c,v,d,g),b||(u.fillStyle="rgba(255, 255, 255, 0.6)",new Array(2).fill(0).map(function(D,E){e._drawDot(u,n-1+E,c-1,v,d,g),e._drawDot(u,n+1,c-1+E,v,d,g),e._drawDot(u,n+1-E,c+1,v,d,g),e._drawDot(u,n-1,c+1-E,v,d,g)})),u.fillStyle=w},e.prototype._draw=function(){var u,n,c,v,d,g,P,b,w,D,E,B,o,t,a,s,r,i,f;return ze(this,void 0,void 0,function(){var l,p,m,_,y,T,M,h,L,R,A,C,Y,F,z,Z,q,K,ut,ft,ht,k,W,ct,yt,x,at,xt,O,S,Ot,nt,$t,X,k,St,Nt,Vt,U,Yt,k,$,H,j,_t,Gt,k,Ut,qt,Ht,te,k,$,H,j,ee,vt,tt,gt,et,dt,Pt,re,V,ot,pt,st,jt,Ct,ie,ae,zt,ne;return Ke(this,function(mt){switch(mt.label){case 0:if(l=(u=this.qrCode)===null||u===void 0?void 0:u.moduleCount,p=this.options.size,m=this.options.margin,(m<0||m*2>=p)&&(m=0),_=Math.ceil(m),y=p-2*m,T=this.options.whiteMargin,M=this.options.backgroundDimming,h=Math.ceil(y/l),L=h*l,R=L+2*_,A=J.createCanvas(R,R),C=A.getContext("2d"),this._clear(),C.save(),C.translate(_,_),Y=J.createCanvas(R,R),F=Y.getContext("2d"),z=null,Z=[],!this.options.gifBackground)return[3,1];if(q=ge.parseGIF(this.options.gifBackground),z=q,Z=ge.decompressFrames(q,!0),this.options.autoColor){for(K=0,ut=0,ft=0,ht=0,k=0;k200||W[1]>200||W[2]>200)&&(W[0]===0&&W[1]===0&&W[2]===0||(ht++,K+=W[0],ut+=W[1],ft+=W[2]));K=~~(K/ht),ut=~~(ut/ht),ft=~~(ft/ht),this.options.colorDark="rgb("+K+","+ut+","+ft+")"}return[3,4];case 1:return this.options.backgroundImage?[4,J.loadImage(this.options.backgroundImage)]:[3,3];case 2:return ct=mt.sent(),this.options.autoColor&&(yt=e._getAverageRGB(ct),this.options.colorDark="rgb("+yt.r+","+yt.g+","+yt.b+")"),F.drawImage(ct,0,0,ct.width,ct.height,0,0,R,R),F.rect(0,0,R,R),F.fillStyle=M,F.fill(),[3,4];case 3:F.rect(0,0,R,R),F.fillStyle=this.options.colorLight,F.fill(),mt.label=4;case 4:for(x=Mt.QRUtil.getPatternPosition(this.qrCode.typeNumber),at=((c=(n=this.options.components)===null||n===void 0?void 0:n.data)===null||c===void 0?void 0:c.scale)||Lt,xt=(1-at)*.5,O=0;O=l-8)||S>=l-8&&O<8,$t=O==6&&S>=8&&S<=l-8||S==6&&O>=8&&O<=l-8,X=nt||$t,k=1;k=x[k]-2&&O<=x[k]+2&&S>=x[k]-2&&S<=x[k]+2;St=S*h+(X?0:xt*h),Nt=O*h+(X?0:xt*h),C.strokeStyle=Ot?this.options.colorDark:this.options.colorLight,C.lineWidth=.5,C.fillStyle=Ot?this.options.colorDark:"rgba(255, 255, 255, 0.6)",x.length===0?X||C.fillRect(St,Nt,(X?1:at)*h,(X?1:at)*h):(Vt=S=l-4-5&&O=l-4-5,!X&&!Vt&&C.fillRect(St,Nt,(X?1:at)*h,(X?1:at)*h))}if(U=x[x.length-1],Yt="rgba(255, 255, 255, 0.6)",C.fillStyle=Yt,C.fillRect(0,0,8*h,8*h),C.fillRect(0,(l-8)*h,8*h,8*h),C.fillRect((l-8)*h,0,8*h,8*h),!((d=(v=this.options.components)===null||v===void 0?void 0:v.timing)===null||d===void 0)&&d.protectors&&(C.fillRect(8*h,6*h,(l-8-8)*h,h),C.fillRect(6*h,8*h,h,(l-8-8)*h)),!((P=(g=this.options.components)===null||g===void 0?void 0:g.cornerAlignment)===null||P===void 0)&&P.protectors&&e._drawAlignProtector(C,U,U,h),!((w=(b=this.options.components)===null||b===void 0?void 0:b.alignment)===null||w===void 0)&&w.protectors){for(k=0;k=1)&&(vt=.2),tt<0&&(tt=0),gt<0&&(gt=0),et=L*vt,dt=.5*(R-et),Pt=dt,C.restore(),C.fillStyle="#FFFFFF",C.save(),e._prepareRoundedCornerClip(C,dt-tt,Pt-tt,et+2*tt,et+2*tt,gt+tt),C.clip(),re=C.globalCompositeOperation,C.globalCompositeOperation="destination-out",C.fill(),C.globalCompositeOperation=re,C.restore(),C.save(),e._prepareRoundedCornerClip(C,dt,Pt,et,et,gt),C.clip(),C.drawImage(ee,dt,Pt,et,et),C.restore(),C.save(),C.translate(_,_),mt.label=6;case 6:if(z){if(Z.forEach(function(it){V||(V=new Je.default(p,p),V.setDelay(it.delay),V.setRepeat(0));var Rt=it.dims,Et=Rt.width,Bt=Rt.height;ot||(ot=J.createCanvas(Et,Bt),pt=ot.getContext("2d"),pt.rect(0,0,ot.width,ot.height),pt.fillStyle="#ffffff",pt.fill()),(!st||!Ct||Et!==st.width||Bt!==st.height)&&(st=J.createCanvas(Et,Bt),jt=st.getContext("2d"),Ct=jt.createImageData(Et,Bt)),Ct.data.set(it.patch),jt.putImageData(Ct,0,0),pt.drawImage(st,it.dims.left,it.dims.top);var oe=J.createCanvas(R,R),wt=oe.getContext("2d");wt.drawImage(ot,0,0,R,R),wt.rect(0,0,R,R),wt.fillStyle=M,wt.fill(),wt.drawImage(A,0,0,R,R);var Kt=J.createCanvas(p,p),se=Kt.getContext("2d");se.drawImage(oe,0,0,p,p),V.addFrame(se.getImageData(0,0,Kt.width,Kt.height).data)}),!V)throw new Error("No frames.");return V.finish(),de(this.canvas)?(ie=V.stream().toFlattenUint8Array(),ae=ie.reduce(function(it,Rt){return it+String.fromCharCode(Rt)},""),[2,Promise.resolve("data:image/gif;base64,"+window.btoa(ae))]):[2,Promise.resolve(Buffer.from(V.stream().toFlattenUint8Array()))]}else return F.drawImage(A,0,0,R,R),C.drawImage(Y,-_,-_,R,R),zt=J.createCanvas(p,p),ne=zt.getContext("2d"),ne.drawImage(A,0,0,p,p),this.canvas=zt,de(this.canvas)?[2,Promise.resolve(this.canvas.toDataURL())]:[2,Promise.resolve(this.canvas.toBuffer())]}})})},e.CorrectLevel=Mt.QRErrorCorrectLevel,e.defaultComponentOptions={data:{scale:1},timing:{scale:1,protectors:!1},alignment:{scale:1,protectors:!1},cornerAlignment:{scale:1,protectors:!0}},e.defaultOptions={text:"",size:400,margin:20,colorDark:"#000000",colorLight:"#ffffff",correctLevel:Mt.QRErrorCorrectLevel.M,backgroundImage:void 0,backgroundDimming:"rgba(0,0,0,0)",logoImage:void 0,logoScale:.2,logoMargin:4,logoCornerRadius:8,whiteMargin:!0,components:e.defaultComponentOptions,autoColor:!0},e}();It.AwesomeQR=We;function de(e){try{return e instanceof HTMLElement}catch{return typeof e=="object"&&e.nodeType===1&&typeof e.style=="object"&&typeof e.ownerDocument=="object"}}(function(e){var u=N&&N.__createBinding||(Object.create?function(v,d,g,P){P===void 0&&(P=g),Object.defineProperty(v,P,{enumerable:!0,get:function(){return d[g]}})}:function(v,d,g,P){P===void 0&&(P=g),v[P]=d[g]}),n=N&&N.__exportStar||function(v,d){for(var g in v)g!=="default"&&!d.hasOwnProperty(g)&&u(d,v,g)};Object.defineProperty(e,"__esModule",{value:!0}),n(Jt,e);var c=It;Object.defineProperty(e,"AwesomeQR",{enumerable:!0,get:function(){return c.AwesomeQR}})})(Be);export{Ye as a,N as c,Ve as g,Be as l};