2025-09-15 11:39:16 +08:00
import { R as te } from "./index-BNmigxWy.js" ; import { r as ee } from "./galois-field-CkUIqpA6.js" ; var z = { } , Q , Bt ; function ne ( ) { return Bt || ( Bt = 1 , Q = function ( ) { return typeof Promise == "function" && Promise . prototype && Promise . prototype . then } ) , Q } var G = { } , U = { } , pt ; function _ ( ) { if ( pt ) return U ; pt = 1 ; let r ; const o = [ 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 ] ; return U . getSymbolSize = function ( n ) { if ( ! n ) throw new Error ( '"version" cannot be null or undefined' ) ; if ( n < 1 || n > 40 ) throw new Error ( '"version" should be in range from 1 to 40' ) ; return n * 4 + 17 } , U . getSymbolTotalCodewords = function ( n ) { return o [ n ] } , U . getBCHDigit = function ( i ) { let n = 0 ; for ( ; i !== 0 ; ) n ++ , i >>>= 1 ; return n } , U . setToSJISFunction = function ( n ) { if ( typeof n != "function" ) throw new Error ( '"toSJISFunc" is not a valid function.' ) ; r = n } , U . isKanjiModeEnabled = function ( ) { return typeof r < "u" } , U . toSJIS = function ( n ) { return r ( n ) } , U } var $ = { } , Rt ; function wt ( ) { return Rt || ( Rt = 1 , function ( r ) { r . L = { bit : 1 } , r . M = { bit : 0 } , r . Q = { bit : 3 } , r . H = { bit : 2 } ; function o ( i ) { if ( typeof i != "string" ) throw new Error ( "Param is not a string" ) ; switch ( i . toLowerCase ( ) ) { case "l" : case "low" : return r . L ; case "m" : case "medium" : return r . M ; case "q" : case "quartile" : return r . Q ; case "h" : case "high" : return r . H ; default : throw new Error ( "Unknown EC Level: " + i ) } } r . isValid = function ( n ) { return n && typeof n . bit < "u" && n . bit >= 0 && n . bit < 4 } , r . from = function ( n , t ) { if ( r . isValid ( n ) ) return n ; try { return o ( n ) } catch { return t } } } ( $ ) ) , $ } var W , At ; function re ( ) { if ( At ) return W ; At = 1 ; function r ( ) { this . buffer = [ ] , this . length = 0 } return r . prototype = { get : function ( o ) { const i = Math . floor ( o / 8 ) ; return ( this . buffer [ i ] >>> 7 - o % 8 & 1 ) === 1 } , put : function ( o , i ) { for ( let n = 0 ; n < i ; n ++ ) this . putBit ( ( o >>> i - n - 1 & 1 ) === 1 ) } , getLengthInBits : function ( ) { return this . length } , putBit : function ( o ) { const i = Math . floor ( this . length / 8 ) ; this . buffer . length <= i && this . buffer . push ( 0 ) , o && ( this . buffer [ i ] |= 128 >>> this . length % 8 ) , this . length ++ } } , W = r , W } var Z , It ; function oe ( ) { if ( It ) return Z ; It = 1 ; function r ( o ) { if ( ! o || o < 1 ) throw new Error ( "BitMatrix size must be defined and greater than 0" ) ; this . size = o , this . data = new Uint8Array ( o * o ) , this . reservedBit = new Uint8Array ( o * o ) } return r . prototype . set = function ( o , i , n , t ) { const e = o * this . size + i ; this . data [ e ] = n , t && ( this . reservedBit [ e ] = ! 0 ) } , r . prototype . get = function ( o , i ) { return this . data [ o * this . size + i ] } , r . prototype . xor = function ( o , i , n ) { this . data [ o * this . size + i ] ^= n } , r . prototype . isReserved = function ( o , i ) { return this . reservedBit [ o * this . size + i ] } , Z = r , Z } var X = { } , Nt ; function ie ( ) { return Nt || ( Nt = 1 , function ( r ) { const o = _ ( ) . getSymbolSize ; r . getRowColCoords = function ( n ) { if ( n === 1 ) return [ ] ; const t = Math . floor ( n / 7 ) + 2 , e = o ( n ) , s = e === 145 ? 26 : Math . ceil ( ( e - 13 ) / ( 2 * t - 2 ) ) * 2 , a = [ e - 7 ] ; for ( let u = 1 ; u < t - 1 ; u ++ ) a [ u ] = a [ u - 1 ] - s ; return a . push ( 6 ) , a . reverse ( ) } , r . getPositions = function ( n ) { const t = [ ] , e = r . getRowColCoords ( n ) , s = e . length ; for ( let a = 0 ; a < s ; a ++ ) for ( let u = 0 ; u < s ; u ++ ) a === 0 && u === 0 || a === 0 && u === s - 1 || a === s - 1 && u === 0 || t . push ( [ e [ a ] , e [ u ] ] ) ; return t } } ( X ) ) , X } var x = { } , Tt ; function se ( ) { if ( Tt ) return x ; Tt = 1 ; const r = _ ( ) . getSymbolSize , o = 7 ; return x . getPositions = function ( n ) { const t = r ( n ) ; return [ [ 0 , 0 ] , [ t - o , 0 ] , [ 0 , t - o ] ] } , x } var tt = { } , Mt ; function ue ( ) { return Mt || ( Mt = 1 , function ( r ) { r . Patterns = { PATTERN000 : 0 , PATTERN001 : 1 , PATTERN010 : 2 , PATTERN011 : 3 , PATTERN100 : 4 , PATTERN101 : 5 , PATTERN110 : 6 , PATTERN111 : 7 } ; const o = { N1 : 3 , N2 : 3 , N3 : 40 , N4 : 10 } ; r . isValid = function ( t ) { return t != null && t !== "" && ! isNaN ( t ) && t >= 0 && t <= 7 } , r . from = function ( t ) { return r . isValid ( t ) ? parseInt ( t , 10 ) : void 0 } , r . getPenaltyN1 = function ( t ) { const e = t . size ; let s = 0 , a = 0 , u = 0 , c = null , d = null ; for ( let B = 0 ; B < e ; B ++ ) { a = u = 0 , c = d = null ; for ( let h = 0 ; h < e ; h ++ ) { let f = t . get ( B , h ) ; f === c ? a ++ : ( a >= 5 && ( s += o . N1 + ( a - 5 ) ) , c = f , a = 1 ) , f = t . get ( h , B ) , f === d ? u ++ : ( u >= 5 && ( s += o . N1 + ( u - 5 ) ) , d = f , u = 1 ) } a >= 5 && ( s += o . N1 + ( a - 5 ) ) , u >= 5 && ( s += o . N1 + ( u - 5 ) ) } return s } , r . getPenaltyN2 = function ( t ) { const e = t . size ; let s = 0 ; for ( let a = 0 ; a < e - 1 ; a ++ ) for ( let u = 0 ; u < e - 1 ; u ++ ) { const c = t . get ( a , u ) + t . get ( a , u + 1 ) + t . get ( a + 1 , u ) + t . get ( a + 1 , u + 1 ) ; ( c === 4 || c === 0 ) && s ++ } return s * o . N2 } , r . getPenaltyN3 = function ( t ) { const e = t . size ; let s = 0 , a = 0 , u = 0 ; for ( let c = 0 ; c < e ; c ++ ) { a = u = 0 ; for ( let d = 0 ; d < e ; d ++ ) a = a << 1 & 2047 | t . get ( c , d ) , d >= 10 && (
2025-09-11 00:16:29 +08:00
] ) ) + ` ;L.KANJI=new RegExp(i,"g"),L.BYTE_KANJI=new RegExp("[^A-Z0-9 $ %*+ \\ -./:]+","g"),L.BYTE=new RegExp(n,"g"),L.NUMERIC=new RegExp(r,"g"),L.ALPHANUMERIC=new RegExp(o,"g");const t=new RegExp("^"+i+" $ "),e=new RegExp("^"+r+" $ "),s=new RegExp("^[A-Z0-9 $ %*+ \\ -./:]+ $ ");return L.testKanji=function(u){return t.test(u)},L.testNumeric=function(u){return e.test(u)},L.testAlphanumeric=function(u){return s.test(u)},L}var qt;function F(){return qt||(qt=1,function(r){const o=Gt(),i= $ t();r.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},r.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},r.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},r.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},r.MIXED={bit:-1},r.getCharCountIndicator=function(e,s){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!o.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?e.ccBits[0]:s<27?e.ccBits[1]:e.ccBits[2]},r.getBestModeForData=function(e){return i.testNumeric(e)?r.NUMERIC:i.testAlphanumeric(e)?r.ALPHANUMERIC:i.testKanji(e)?r.KANJI:r.BYTE},r.toString=function(e){if(e&&e.id)return e.id;throw new Error("Invalid mode")},r.isValid=function(e){return e&&e.bit&&e.ccBits};function n(t){if(typeof t!="string")throw new Error("Param is not a string");switch(t.toLowerCase()){case"numeric":return r.NUMERIC;case"alphanumeric":return r.ALPHANUMERIC;case"kanji":return r.KANJI;case"byte":return r.BYTE;default:throw new Error("Unknown mode: "+t)}}r.from=function(e,s){if(r.isValid(e))return e;try{return n(e)}catch{return s}}}(ot)),ot}var vt;function fe(){return vt||(vt=1,function(r){const o=_(),i=Qt(),n=wt(),t=F(),e=Gt(),s=7973,a=o.getBCHDigit(s);function u(h,f,T){for(let M=1;M<=40;M++)if(f<=r.getCapacity(M,T,h))return M}function c(h,f){return t.getCharCountIndicator(h,f)+4}function d(h,f){let T=0;return h.forEach(function(M){const S=c(M.mode,f);T+=S+M.getBitsLength()}),T}function B(h,f){for(let T=1;T<=40;T++)if(d(h,T)<=r.getCapacity(T,f,t.MIXED))return T}r.from=function(f,T){return e.isValid(f)?parseInt(f,10):T},r.getCapacity=function(f,T,M){if(!e.isValid(f))throw new Error("Invalid QR Code version");typeof M>"u"&&(M=t.BYTE);const S=o.getSymbolTotalCodewords(f),A=i.getTotalCodewordsCount(f,T),P=(S-A)*8;if(M===t.MIXED)return P;const I=P-c(M,f);switch(M){case t.NUMERIC:return Math.floor(I/10*3);case t.ALPHANUMERIC:return Math.floor(I/11*2);case t.KANJI:return Math.floor(I/13);case t.BYTE:default:return Math.floor(I/8)}},r.getBestVersionForData=function(f,T){let M;const S=n.from(T,n.M);if(Array.isArray(f)){if(f.length>1)return B(f,S);if(f.length===0)return 1;M=f[0]}else M=f;return u(M.mode,M.getLength(),S)},r.getEncodedBits=function(f){if(!e.isValid(f)||f<7)throw new Error("Invalid QR Code version");let T=f<<12;for(;o.getBCHDigit(T)-a>=0;)T^=s<<o.getBCHDigit(T)-a;return f<<12|T}}(rt)),rt}var st={},Ut;function le(){if(Ut)return st;Ut=1;const r=_(),o=1335,i=21522,n=r.getBCHDigit(o);return st.getEncodedBits=function(e,s){const a=e.bit<<3|s;let u=a<<10;for(;r.getBCHDigit(u)-n>=0;)u^=o<<r.getBCHDigit(u)-n;return(a<<10|u)^i},st}var ut={},at,_t;function de(){if(_t)return at;_t=1;const r=F();function o(i){this.mode=r.NUMERIC,this.data=i.toString()}return o.getBitsLength=function(n){return 10*Math.floor(n/3)+(n%3?n%3*3+1:0)},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(n){let t,e,s;for(t=0;t+3<=this.data.length;t+=3)e=this.data.substr(t,3),s=parseInt(e,10),n.put(s,10);const a=this.data.length-t;a>0&&(e=this.data.substr(t),s=parseInt(e,10),n.put(s,a*3+1))},at=o,at}var ct,Ft;function ge(){if(Ft)return ct;Ft=1;const r=F(),o=["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 i(n){this.mode=r.ALPHANUMERIC,this.data=n}return i.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototy
Make sure your charset is UTF - 8 ` );e=(e>>>8&255)*192+(e&255),n.put(e,13)}},lt=i,lt}var dt={exports:{}},Vt;function we(){return Vt||(Vt=1,function(r){var o={single_source_shortest_paths:function(i,n,t){var e={},s={};s[n]=0;var a=o.PriorityQueue.make();a.push(n,0);for(var u,c,d,B,h,f,T,M,S;!a.empty();){u=a.pop(),c=u.value,B=u.cost,h=i[c]||{};for(d in h)h.hasOwnProperty(d)&&(f=h[d],T=B+f,M=s[d],S=typeof s[d]>"u",(S||M>T)&&(s[d]=T,a.push(d,T),e[d]=c))}if(typeof t<"u"&&typeof s[t]>"u"){var A=["Could not find a path from ",n," to ",t,"."].join("");throw new Error(A)}return e},extract_shortest_path_from_predecessor_list:function(i,n){for(var t=[],e=n;e;)t.push(e),i[e],e=i[e];return t.reverse(),t},find_path:function(i,n,t){var e=o.single_source_shortest_paths(i,n,t);return o.extract_shortest_path_from_predecessor_list(e,t)},PriorityQueue:{make:function(i){var n=o.PriorityQueue,t={},e;i=i||{};for(e in n)n.hasOwnProperty(e)&&(t[e]=n[e]);return t.queue=[],t.sorter=i.sorter||n.default_sorter,t},default_sorter:function(i,n){return i.cost-n.cost},push:function(i,n){var t={value:i,cost:n};this.queue.push(t),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};r.exports=o}(dt)),dt.exports}var Kt;function Ce(){return Kt||(Kt=1,function(r){const o=F(),i=de(),n=ge(),t=he(),e=me(),s= $ t(),a=_(),u=we();function c(A){return unescape(encodeURIComponent(A)).length}function d(A,P,I){const p=[];let b;for(;(b=A.exec(I))!==null;)p.push({data:b[0],index:b.index,mode:P,length:b[0].length});return p}function B(A){const P=d(s.NUMERIC,o.NUMERIC,A),I=d(s.ALPHANUMERIC,o.ALPHANUMERIC,A);let p,b;return a.isKanjiModeEnabled()?(p=d(s.BYTE,o.BYTE,A),b=d(s.KANJI,o.KANJI,A)):(p=d(s.BYTE_KANJI,o.BYTE,A),b=[]),P.concat(I,p,b).sort(function(y,C){return y.index-C.index}).map(function(y){return{data:y.data,mode:y.mode,length:y.length}})}function h(A,P){switch(P){case o.NUMERIC:return i.getBitsLength(A);case o.ALPHANUMERIC:return n.getBitsLength(A);case o.KANJI:return e.getBitsLength(A);case o.BYTE:return t.getBitsLength(A)}}function f(A){return A.reduce(function(P,I){const p=P.length-1>=0?P[P.length-1]:null;return p&&p.mode===I.mode?(P[P.length-1].data+=I.data,P):(P.push(I),P)},[])}function T(A){const P=[];for(let I=0;I<A.length;I++){const p=A[I];switch(p.mode){case o.NUMERIC:P.push([p,{data:p.data,mode:o.ALPHANUMERIC,length:p.length},{data:p.data,mode:o.BYTE,length:p.length}]);break;case o.ALPHANUMERIC:P.push([p,{data:p.data,mode:o.BYTE,length:p.length}]);break;case o.KANJI:P.push([p,{data:p.data,mode:o.BYTE,length:c(p.data)}]);break;case o.BYTE:P.push([{data:p.data,mode:o.BYTE,length:c(p.data)}])}}return P}function M(A,P){const I={},p={start:{}};let b=["start"];for(let g=0;g<A.length;g++){const y=A[g],C=[];for(let l=0;l<y.length;l++){const R=y[l],m=""+g+l;C.push(m),I[m]={node:R,lastCount:0},p[m]={};for(let E=0;E<b.length;E++){const w=b[E];I[w]&&I[w].node.mode===R.mode?(p[w][m]=h(I[w].lastCount+R.length,R.mode)-h(I[w].lastCount,R.mode),I[w].lastCount+=R.length):(I[w]&&(I[w].lastCount=R.length),p[w][m]=h(R.length,R.mode)+4+o.getCharCountIndicator(R.mode,P))}}b=C}for(let g=0;g<b.length;g++)p[b[g]].end=0;return{map:p,table:I}}function S(A,P){let I;const p=o.getBestModeForData(A);if(I=o.from(P,p),I!==o.BYTE&&I.bit<p.bit)throw new Error('"'+A+'" cannot be encoded with mode '+o.toString(I)+ ` .
Suggested mode is : ` +o.toString(p));switch(I===o.KANJI&&!a.isKanjiModeEnabled()&&(I=o.BYTE),I){case o.NUMERIC:return new i(A);case o.ALPHANUMERIC:return new n(A);case o.KANJI:return new e(A);case o.BYTE:return new t(A)}}r.fromArray=function(P){return P.reduce(function(I,p){return typeof p=="string"?I.push(S(p,null)):p.data&&I.push(S(p.data,p.mode)),I},[])},r.fromString=function(P,I){const p=B(P,a.isKanjiModeEnabled()),b=T(p),g=M(b,I),y=u.find_path(g.map,"start","end"),C=[];for(let l=1;l<y.length-1;l++)C.push(g.table[y[l]].node);return r.fromArray(f(C))},r.rawSplit=function(P){return r.fromArray(B(P,a.isKanjiModeEnabled()))}}(ut)),ut}var Ht;function ye(){if(Ht)return G;Ht=1;const r=_(),o=wt(),i=re(),n=oe(),t=ie(),e=se(),s=ue(),a=Qt(),u=ce(),c=fe(),d=le(),B=F(),h=Ce();function f(g,y){const C=g.size,l=e.getPositions(y);for(let R=0;R<l.length;R++){const m=l[R][0],E=l[R][1];for(let w=-1;w<=7;w++)if(!(m+w<=-1||C<=m+w))for(let N=-1;N<=7;N++)E+N<=-1||C<=E+N||(w>=0&&w<=6&&(N===0||N===6)||N>=0&&N<=6&&(w===0||w===6)||w>=2&&w<=4&&N>=2&&N<=4?g.set(m+w,E+N,!0,!0):g.set(m+w,E+N,!1,!0))}}function T(g){const y=g.size;for(let C=8;C<y-8;C++){const l=C%2===0;g.set(C,6,l,!0),g.set(6,C,l,!0)}}function M(g,y){const C=t.getPositions(y);for(let l=0;l<C.length;l++){const R=C[l][0],m=C[l][1];for(let E=-2;E<=2;E++)for(let w=-2;w<=2;w++)E===-2||E===2||w===-2||w===2||E===0&&w===0?g.set(R+E,m+w,!0,!0):g.set(R+E,m+w,!1,!0)}}function S(g,y){const C=g.size,l=c.getEncodedBits(y);let R,m,E;for(let w=0;w<18;w++)R=Math.floor(w/3),m=w%3+C-8-3,E=(l>>w&1)===1,g.set(R,m,E,!0),g.set(m,R,E,!0)}function A(g,y,C){const l=g.size,R=d.getEncodedBits(y,C);let m,E;for(m=0;m<15;m++)E=(R>>m&1)===1,m<6?g.set(m,8,E,!0):m<8?g.set(m+1,8,E,!0):g.set(l-15+m,8,E,!0),m<8?g.set(8,l-m-1,E,!0):m<9?g.set(8,15-m-1+1,E,!0):g.set(8,15-m-1,E,!0);g.set(l-8,8,1,!0)}function P(g,y){const C=g.size;let l=-1,R=C-1,m=7,E=0;for(let w=C-1;w>0;w-=2)for(w===6&&w--;;){for(let N=0;N<2;N++)if(!g.isReserved(R,w-N)){let v=!1;E<y.length&&(v=(y[E]>>>m&1)===1),g.set(R,w-N,v),m--,m===-1&&(E++,m=7)}if(R+=l,R<0||C<=R){R-=l,l=-l;break}}}function I(g,y,C){const l=new i;C.forEach(function(N){l.put(N.mode.bit,4),l.put(N.getLength(),B.getCharCountIndicator(N.mode,g)),N.write(l)});const R=r.getSymbolTotalCodewords(g),m=a.getTotalCodewordsCount(g,y),E=(R-m)*8;for(l.getLengthInBits()+4<=E&&l.put(0,4);l.getLengthInBits()%8!==0;)l.putBit(0);const w=(E-l.getLengthInBits())/8;for(let N=0;N<w;N++)l.put(N%2?17:236,8);return p(l,g,y)}function p(g,y,C){const l=r.getSymbolTotalCodewords(y),R=a.getTotalCodewordsCount(y,C),m=l-R,E=a.getBlocksCount(y,C),w=l%E,N=E-w,v=Math.floor(l/E),V=Math.floor(m/E),Zt=V+1,Ct=v-V,Xt=new u(Ct);let J=0;const K=new Array(E),yt=new Array(E);let Y=0;const xt=new Uint8Array(g.buffer);for(let k=0;k<E;k++){const O=k<N?V:Zt;K[k]=xt.slice(J,J+O),yt[k]=Xt.encode(K[k]),J+=O,Y=Math.max(Y,O)}const j=new Uint8Array(l);let Et=0,D,q;for(D=0;D<Y;D++)for(q=0;q<E;q++)D<K[q].length&&(j[Et++]=K[q][D]);for(D=0;D<Ct;D++)for(q=0;q<E;q++)j[Et++]=yt[q][D];return j}function b(g,y,C,l){let R;if(Array.isArray(g))R=h.fromArray(g);else if(typeof g=="string"){let v=y;if(!v){const V=h.rawSplit(g);v=c.getBestVersionForData(V,C)}R=h.fromString(g,v||40)}else throw new Error("Invalid data");const m=c.getBestVersionForData(R,C);if(!m)throw new Error("The amount of data is too big to be stored in a QR Code");if(!y)y=m;else if(y<m)throw new Error( `
The chosen QR Code version cannot contain this amount of data .
Minimum version required to store current data is : ` +m+ ` .
` );const E=I(y,C,R),w=r.getSymbolSize(y),N=new n(w);return f(N,y),T(N),M(N,y),A(N,C,0),y>=7&&S(N,y),P(N,E),isNaN(l)&&(l=s.getBestMask(N,A.bind(null,N,C))),s.applyMask(l,N),A(N,C,l),{modules:N,version:y,errorCorrectionLevel:C,maskPattern:l,segments:R}}return G.create=function(y,C){if(typeof y>"u"||y==="")throw new Error("No input text");let l=o.M,R,m;return typeof C<"u"&&(l=o.from(C.errorCorrectionLevel,o.M),R=c.from(C.version),m=s.from(C.maskPattern),C.toSJISFunc&&r.setToSJISFunction(C.toSJISFunc)),b(y,R,l,m)},G}var gt={},ht={},Jt;function Wt(){return Jt||(Jt=1,function(r){function o(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let n=i.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+i);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(e){return[e,e]}))),n.length===6&&n.push("F","F");const t=parseInt(n.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+n.slice(0,6).join("")}}r.getOptions=function(n){n||(n={}),n.color||(n.color={});const t=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,e=n.width&&n.width>=21?n.width:void 0,s=n.scale||4;return{width:e,scale:e?4:s,margin:t,color:{dark:o(n.color.dark||"#000000ff"),light:o(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},r.getScale=function(n,t){return t.width&&t.width>=n+t.margin*2?t.width/(n+t.margin*2):t.scale},r.getImageWidth=function(n,t){const e=r.getScale(n,t);return Math.floor((n+t.margin*2)*e)},r.qrToImageData=function(n,t,e){const s=t.modules.size,a=t.modules.data,u=r.getScale(s,e),c=Math.floor((s+e.margin*2)*u),d=e.margin*u,B=[e.color.light,e.color.dark];for(let h=0;h<c;h++)for(let f=0;f<c;f++){let T=(h*c+f)*4,M=e.color.light;if(h>=d&&f>=d&&h<c-d&&f<c-d){const S=Math.floor((h-d)/u),A=Math.floor((f-d)/u);M=B[a[S*s+A]?1:0]}n[T++]=M.r,n[T++]=M.g,n[T++]=M.b,n[T]=M.a}}}(ht)),ht}var Yt;function Ee(){return Yt||(Yt=1,function(r){const o=Wt();function i(t,e,s){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=s,e.width=s,e.style.height=s+"px",e.style.width=s+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(e,s,a){let u=a,c=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(c=n()),u=o.getOptions(u);const d=o.getImageWidth(e.modules.size,u),B=c.getContext("2d"),h=B.createImageData(d,d);return o.qrToImageData(h.data,e,u),i(B,c,d),B.putImageData(h,0,0),c},r.renderToDataURL=function(e,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const c=r.render(e,s,u),d=u.type||"image/png",B=u.rendererOpts||{};return c.toDataURL(d,B.quality)}}(gt)),gt}var mt={},jt;function Be(){if(jt)return mt;jt=1;const r=Wt();function o(t,e){const s=t.a/255,a=e+'="'+t.hex+'"';return s<1?a+" "+e+'-opacity="'+s.toFixed(2).slice(1)+'"':a}function i(t,e,s){let a=t+e;return typeof s<"u"&&(a+=" "+s),a}function n(t,e,s){let a="",u=0,c=!1,d=0;for(let B=0;B<t.length;B++){const h=Math.floor(B%e),f=Math.floor(B/e);!h&&!c&&(c=!0),t[B]?(d++,B>0&&h>0&&t[B-1]||(a+=c?i("M",h+s,.5+f+s):i("m",u,0),u=0,c=!1),h+1<e&&t[B+1]||(a+=i("h",d),d=0)):u++}return a}return mt.render=function(e,s,a){const u=r.getOptions(s),c=e.modules.size,d=e.modules.data,B=c+u.margin*2,h=u.color.light.a?"<path "+o(u.color.light,"fill")+' d="M0 0h'+B+"v"+B+'H0z"/>':"",f="<path "+o(u.color.dark,"stroke")+' d="'+n(d,c,u.margin)+'"/>',T='viewBox="0 0 '+B+" "+B+'"',S='<svg xmlns="http://www.w3.org/2000/svg" '+(u.width?'width="'+u.width+'" height="'+u.width+'" ':"")+T+' shape-rendering="crispEdges">'+h+f+ ` < / s v g >
` ;return typeof a=="function"&&a(null,S),S},mt}var Ot;function pe(){if(Ot)return z;Ot=1;const r=ne(),o=ye(),i=Ee(),n=Be();function t(e,s,a,u,c){const d=[].slice.call(arguments,1),B=d.length,h=typeof d[B-1]=="function";if(!h&&!r())throw new Error("Callback required as last argument");if(h){if(B<2)throw new Error("Too few arguments provided");B===2?(c=a,a=s,s=u=void 0):B===3&&(s.getContext&&typeof c>"u"?(c=u,u=void 0):(c=u,u=a,a=s,s=void 0))}else{if(B<1)throw new Error("Too few arguments provided");return B===1?(a=s,s=u=void 0):B===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(f,T){try{const M=o.create(a,u);f(e(M,s,u))}catch(M){T(M)}})}try{const f=o.create(a,u);c(null,e(f,s,u))}catch(f){c(f)}}return z.create=o.create,z.toCanvas=t.bind(null,i.render),z.toDataURL=t.bind(null,i.renderToDataURL),z.toString=t.bind(null,function(e,s,a){return n.render(e,a)}),z}var Re=pe();const Ne=te(Re);export{Ne as Q};