You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paopao-ce/web/dist/assets/qrcode-CFCLo2rZ.js

9 lines
24 KiB

import{g as te}from"./copy-to-clipboard-DgsYVcxl.js";import{r as ee}from"./dijkstrajs-C00ieaqj.js";var V={},Q,Bt;function ne(){return Bt||(Bt=1,Q=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),Q}var $={},F={},At;function v(){if(At)return F;At=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 F.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},F.getSymbolTotalCodewords=function(n){return o[n]},F.getBCHDigit=function(u){let n=0;for(;u!==0;)n++,u>>>=1;return n},F.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');r=n},F.isKanjiModeEnabled=function(){return typeof r<"u"},F.toSJIS=function(n){return r(n)},F}var W={},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(u){if(typeof u!="string")throw new Error("Param is not a string");switch(u.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: "+u)}}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}}}(W)),W}var Z,pt;function re(){if(pt)return Z;pt=1;function r(){this.buffer=[],this.length=0}return r.prototype={get:function(o){const u=Math.floor(o/8);return(this.buffer[u]>>>7-o%8&1)===1},put:function(o,u){for(let n=0;n<u;n++)this.putBit((o>>>u-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(o){const u=Math.floor(this.length/8);this.buffer.length<=u&&this.buffer.push(0),o&&(this.buffer[u]|=128>>>this.length%8),this.length++}},Z=r,Z}var X,It;function oe(){if(It)return X;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,u,n,t){const e=o*this.size+u;this.data[e]=n,t&&(this.reservedBit[e]=!0)},r.prototype.get=function(o,u){return this.data[o*this.size+u]},r.prototype.xor=function(o,u,n){this.data[o*this.size+u]^=n},r.prototype.isReserved=function(o,u){return this.reservedBit[o*this.size+u]},X=r,X}var x={},Tt;function ie(){return Tt||(Tt=1,function(r){const o=v().getSymbolSize;r.getRowColCoords=function(n){if(n===1)return[];const t=Math.floor(n/7)+2,e=o(n),i=e===145?26:Math.ceil((e-13)/(2*t-2))*2,a=[e-7];for(let s=1;s<t-1;s++)a[s]=a[s-1]-i;return a.push(6),a.reverse()},r.getPositions=function(n){const t=[],e=r.getRowColCoords(n),i=e.length;for(let a=0;a<i;a++)for(let s=0;s<i;s++)a===0&&s===0||a===0&&s===i-1||a===i-1&&s===0||t.push([e[a],e[s]]);return t}}(x)),x}var tt={},Nt;function ue(){if(Nt)return tt;Nt=1;const r=v().getSymbolSize,o=7;return tt.getPositions=function(n){const t=r(n);return[[0,0],[t-o,0],[0,t-o]]},tt}var et={},Mt;function se(){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 i=0,a=0,s=0,c=null,E=null;for(let p=0;p<e;p++){a=s=0,c=E=null;for(let y=0;y<e;y++){let f=t.get(p,y);f===c?a++:(a>=5&&(i+=o.N1+(a-5)),c=f,a=1),f=t.get(y,p),f===E?s++:(s>=5&&(i+=o.N1+(s-5)),E=f,s=1)}a>=5&&(i+=o.N1+(a-5)),s>=5&&(i+=o.N1+(s-5))}return i},r.getPenaltyN2=function(t){const e=t.size;let i=0;for(let a=0;a<e-1;a++)for(let s=0;s<e-1;s++){const c=t.get(a,s)+t.get(a,s+1)+t.get(a+1,s)+t.get(a+1,s+1);(c===4||c===0)&&i++}return i*o.N2},r.getPenaltyN3=function(t){const e=t.size;let i=0,a=0,s=0;for(let c=0;c<e;c++){a=s=0;for(let E=0;E<e;E++)a=a<<1&2047|t.get(c,E),E>=10&&(a===1488||a===93)&&i++,s=s<<1&2047|t.get(E,c),E>=10&&(s===1488||s===93)&&i++}return i*o.N3},r.getPenaltyN4=function(t){let e=0;const i=t.data.length;for(let s=0;s<i;s++)e+=t.data[s];return Math.abs(Math.ceil(e*100/i/5)-10)*o.N4};function u(n,t,e){switch(n){case r.Patterns.PATTERN000:return(t+e)%2===0;case r.Patterns.PATTERN001:return t%2===0;case r.Patterns.PATTERN010:return e%3===0;case r.Patterns.PATTERN011:return(t+e)%3===0;case r.Patterns.PATTERN100:return(Math.floor(t/2)+Math.floor(e/3))%2===0;case r.Patterns.PATTERN101:return t*e%2+t*e%3===0;case r.Patterns.PATTERN110:return(t*e%2+t*e%3)%2===0;case r.Patterns.PATTERN111:return(t*e%3+(t+e)%2)%2===0;default:throw new Error("bad maskPattern:"+n)}}r.applyMask=function(t,e){const i=e.size;for(let a=0;a<i;a++)for(let s=0;s<i;s++)e.isReserved(s,a)||e.xor(s,a,u(t,s,a))},r.getBestMask=function(t,e){const i=Object.keys(r.Patterns).length;let a=0,s=1/0;for(let c=0;c<i;c++){e(c),r.applyMask(c,t);const E=r.getPenaltyN1(t)+r.getPenaltyN2(t)+r.getPenaltyN3(t)+r.getPenaltyN4(t);r.applyMask(c,t),E<s&&(s=E,a=c)}return a}}(et)),et}var Y={},St;function Gt(){if(St)return Y;St=1;const r=wt(),o=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],u=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];return Y.getBlocksCount=function(t,e){switch(e){case r.L:return o[(t-1)*4+0];case r.M:return o[(t-1)*4+1];case r.Q:return o[(t-1)*4+2];case r.H:return o[(t-1)*4+3];default:return}},Y.getTotalCodewordsCount=function(t,e){switch(e){case r.L:return u[(t-1)*4+0];case r.M:return u[(t-1)*4+1];case r.Q:return u[(t-1)*4+2];case r.H:return u[(t-1)*4+3];default:return}},Y}var nt={},H={},Pt;function ae(){if(Pt)return H;Pt=1;const r=new Uint8Array(512),o=new Uint8Array(256);return function(){let n=1;for(let t=0;t<255;t++)r[t]=n,o[n]=t,n<<=1,n&256&&(n^=285);for(let t=255;t<512;t++)r[t]=r[t-255]}(),H.log=function(n){if(n<1)throw new Error("log("+n+")");return o[n]},H.exp=function(n){return r[n]},H.mul=function(n,t){return n===0||t===0?0:r[o[n]+o[t]]},H}var bt;function ce(){return bt||(bt=1,function(r){const o=ae();r.mul=function(n,t){const e=new Uint8Array(n.length+t.length-1);for(let i=0;i<n.length;i++)for(let a=0;a<t.length;a++)e[i+a]^=o.mul(n[i],t[a]);return e},r.mod=function(n,t){let e=new Uint8Array(n);for(;e.length-t.length>=0;){const i=e[0];for(let s=0;s<t.length;s++)e[s]^=o.mul(t[s],i);let a=0;for(;a<e.length&&e[a]===0;)a++;e=e.slice(a)}return e},r.generateECPolynomial=function(n){let t=new Uint8Array([1]);for(let e=0;e<n;e++)t=r.mul(t,new Uint8Array([1,o.exp(e)]));return t}}(nt)),nt}var rt,Lt;function le(){if(Lt)return rt;Lt=1;const r=ce();function o(u){this.genPoly=void 0,this.degree=u,this.degree&&this.initialize(this.degree)}return o.prototype.initialize=function(n){this.degree=n,this.genPoly=r.generateECPolynomial(this.degree)},o.prototype.encode=function(n){if(!this.genPoly)throw new Error("Encoder not initialized");const t=new Uint8Array(n.length+this.degree);t.set(n);const e=r.mod(t,this.genPoly),i=this.degree-e.length;if(i>0){const a=new Uint8Array(this.degree);return a.set(e,i),a}return e},rt=o,rt}var ot={},it={},ut={},Dt;function Qt(){return Dt||(Dt=1,ut.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40}),ut}var L={},qt;function $t(){if(qt)return L;qt=1;const r="[0-9]+",o="[A-Z $%*+\\-./:]+";let u="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";u=u.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+u+`)(?:.|[\r
]))+`;L.KANJI=new RegExp(u,"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("^"+u+"$"),e=new RegExp("^"+r+"$"),i=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return L.testKanji=function(s){return t.test(s)},L.testNumeric=function(s){return e.test(s)},L.testAlphanumeric=function(s){return i.test(s)},L}var Ut;function k(){return Ut||(Ut=1,function(r){const o=Qt(),u=$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,i){if(!e.ccBits)throw new Error("Invalid mode: "+e);if(!o.isValid(i))throw new Error("Invalid version: "+i);return i>=1&&i<10?e.ccBits[0]:i<27?e.ccBits[1]:e.ccBits[2]},r.getBestModeForData=function(e){return u.testNumeric(e)?r.NUMERIC:u.testAlphanumeric(e)?r.ALPHANUMERIC:u.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,i){if(r.isValid(e))return e;try{return n(e)}catch{return i}}}(it)),it}var Ft;function fe(){return Ft||(Ft=1,function(r){const o=v(),u=Gt(),n=wt(),t=k(),e=Qt(),i=7973,a=o.getBCHDigit(i);function s(y,f,M){for(let S=1;S<=40;S++)if(f<=r.getCapacity(S,M,y))return S}function c(y,f){return t.getCharCountIndicator(y,f)+4}function E(y,f){let M=0;return y.forEach(function(S){const b=c(S.mode,f);M+=b+S.getBitsLength()}),M}function p(y,f){for(let M=1;M<=40;M++)if(E(y,M)<=r.getCapacity(M,f,t.MIXED))return M}r.from=function(f,M){return e.isValid(f)?parseInt(f,10):M},r.getCapacity=function(f,M,S){if(!e.isValid(f))throw new Error("Invalid QR Code version");typeof S>"u"&&(S=t.BYTE);const b=o.getSymbolTotalCodewords(f),I=u.getTotalCodewordsCount(f,M),N=(b-I)*8;if(S===t.MIXED)return N;const R=N-c(S,f);switch(S){case t.NUMERIC:return Math.floor(R/10*3);case t.ALPHANUMERIC:return Math.floor(R/11*2);case t.KANJI:return Math.floor(R/13);case t.BYTE:default:return Math.floor(R/8)}},r.getBestVersionForData=function(f,M){let S;const b=n.from(M,n.M);if(Array.isArray(f)){if(f.length>1)return p(f,b);if(f.length===0)return 1;S=f[0]}else S=f;return s(S.mode,S.getLength(),b)},r.getEncodedBits=function(f){if(!e.isValid(f)||f<7)throw new Error("Invalid QR Code version");let M=f<<12;for(;o.getBCHDigit(M)-a>=0;)M^=i<<o.getBCHDigit(M)-a;return f<<12|M}}(ot)),ot}var st={},vt;function de(){if(vt)return st;vt=1;const r=v(),o=1335,u=21522,n=r.getBCHDigit(o);return st.getEncodedBits=function(e,i){const a=e.bit<<3|i;let s=a<<10;for(;r.getBCHDigit(s)-n>=0;)s^=o<<r.getBCHDigit(s)-n;return(a<<10|s)^u},st}var at={},ct,kt;function ge(){if(kt)return ct;kt=1;const r=k();function o(u){this.mode=r.NUMERIC,this.data=u.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,i;for(t=0;t+3<=this.data.length;t+=3)e=this.data.substr(t,3),i=parseInt(e,10),n.put(i,10);const a=this.data.length-t;a>0&&(e=this.data.substr(t),i=parseInt(e,10),n.put(i,a*3+1))},ct=o,ct}var lt,zt;function he(){if(zt)return lt;zt=1;const r=k(),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 u(n){this.mode=r.ALPHANUMERIC,this.data=n}return u.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},u.prototype.getLength=function(){return this.data.length},u.prototype.getBitsLength=function(){return u.getBitsLength(this.data.length)},u.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let i=o.indexOf(this.data[e])*45;i+=o.indexOf(this.data[e+1]),t.put(i,11)}this.data.length%2&&t.put(o.indexOf(this.data[e]),6)},lt=u,lt}var ft,Vt;function me(){if(Vt)return ft;Vt=1;const r=k();function o(u){this.mode=r.BYTE,typeof u=="string"?this.data=new TextEncoder().encode(u):this.data=new Uint8Array(u)}return o.getBitsLength=function(n){return n*8},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(u){for(let n=0,t=this.data.length;n<t;n++)u.put(this.data[n],8)},ft=o,ft}var dt,Kt;function we(){if(Kt)return dt;Kt=1;const r=k(),o=v();function u(n){this.mode=r.KANJI,this.data=n}return u.getBitsLength=function(t){return t*13},u.prototype.getLength=function(){return this.data.length},u.prototype.getBitsLength=function(){return u.getBitsLength(this.data.length)},u.prototype.write=function(n){let t;for(t=0;t<this.data.length;t++){let e=o.toSJIS(this.data[t]);if(e>=33088&&e<=40956)e-=33088;else if(e>=57408&&e<=60351)e-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
Make sure your charset is UTF-8`);e=(e>>>8&255)*192+(e&255),n.put(e,13)}},dt=u,dt}var Ht;function Ce(){return Ht||(Ht=1,function(r){const o=k(),u=ge(),n=he(),t=me(),e=we(),i=$t(),a=v(),s=ee();function c(I){return unescape(encodeURIComponent(I)).length}function E(I,N,R){const B=[];let P;for(;(P=I.exec(R))!==null;)B.push({data:P[0],index:P.index,mode:N,length:P[0].length});return B}function p(I){const N=E(i.NUMERIC,o.NUMERIC,I),R=E(i.ALPHANUMERIC,o.ALPHANUMERIC,I);let B,P;return a.isKanjiModeEnabled()?(B=E(i.BYTE,o.BYTE,I),P=E(i.KANJI,o.KANJI,I)):(B=E(i.BYTE_KANJI,o.BYTE,I),P=[]),N.concat(R,B,P).sort(function(w,m){return w.index-m.index}).map(function(w){return{data:w.data,mode:w.mode,length:w.length}})}function y(I,N){switch(N){case o.NUMERIC:return u.getBitsLength(I);case o.ALPHANUMERIC:return n.getBitsLength(I);case o.KANJI:return e.getBitsLength(I);case o.BYTE:return t.getBitsLength(I)}}function f(I){return I.reduce(function(N,R){const B=N.length-1>=0?N[N.length-1]:null;return B&&B.mode===R.mode?(N[N.length-1].data+=R.data,N):(N.push(R),N)},[])}function M(I){const N=[];for(let R=0;R<I.length;R++){const B=I[R];switch(B.mode){case o.NUMERIC:N.push([B,{data:B.data,mode:o.ALPHANUMERIC,length:B.length},{data:B.data,mode:o.BYTE,length:B.length}]);break;case o.ALPHANUMERIC:N.push([B,{data:B.data,mode:o.BYTE,length:B.length}]);break;case o.KANJI:N.push([B,{data:B.data,mode:o.BYTE,length:c(B.data)}]);break;case o.BYTE:N.push([{data:B.data,mode:o.BYTE,length:c(B.data)}])}}return N}function S(I,N){const R={},B={start:{}};let P=["start"];for(let d=0;d<I.length;d++){const w=I[d],m=[];for(let l=0;l<w.length;l++){const A=w[l],g=""+d+l;m.push(g),R[g]={node:A,lastCount:0},B[g]={};for(let C=0;C<P.length;C++){const h=P[C];R[h]&&R[h].node.mode===A.mode?(B[h][g]=y(R[h].lastCount+A.length,A.mode)-y(R[h].lastCount,A.mode),R[h].lastCount+=A.length):(R[h]&&(R[h].lastCount=A.length),B[h][g]=y(A.length,A.mode)+4+o.getCharCountIndicator(A.mode,N))}}P=m}for(let d=0;d<P.length;d++)B[P[d]].end=0;return{map:B,table:R}}function b(I,N){let R;const B=o.getBestModeForData(I);if(R=o.from(N,B),R!==o.BYTE&&R.bit<B.bit)throw new Error('"'+I+'" cannot be encoded with mode '+o.toString(R)+`.
Suggested mode is: `+o.toString(B));switch(R===o.KANJI&&!a.isKanjiModeEnabled()&&(R=o.BYTE),R){case o.NUMERIC:return new u(I);case o.ALPHANUMERIC:return new n(I);case o.KANJI:return new e(I);case o.BYTE:return new t(I)}}r.fromArray=function(N){return N.reduce(function(R,B){return typeof B=="string"?R.push(b(B,null)):B.data&&R.push(b(B.data,B.mode)),R},[])},r.fromString=function(N,R){const B=p(N,a.isKanjiModeEnabled()),P=M(B),d=S(P,R),w=s.find_path(d.map,"start","end"),m=[];for(let l=1;l<w.length-1;l++)m.push(d.table[w[l]].node);return r.fromArray(f(m))},r.rawSplit=function(N){return r.fromArray(p(N,a.isKanjiModeEnabled()))}}(at)),at}var Jt;function Ee(){if(Jt)return $;Jt=1;const r=v(),o=wt(),u=re(),n=oe(),t=ie(),e=ue(),i=se(),a=Gt(),s=le(),c=fe(),E=de(),p=k(),y=Ce();function f(d,w){const m=d.size,l=e.getPositions(w);for(let A=0;A<l.length;A++){const g=l[A][0],C=l[A][1];for(let h=-1;h<=7;h++)if(!(g+h<=-1||m<=g+h))for(let T=-1;T<=7;T++)C+T<=-1||m<=C+T||(h>=0&&h<=6&&(T===0||T===6)||T>=0&&T<=6&&(h===0||h===6)||h>=2&&h<=4&&T>=2&&T<=4?d.set(g+h,C+T,!0,!0):d.set(g+h,C+T,!1,!0))}}function M(d){const w=d.size;for(let m=8;m<w-8;m++){const l=m%2===0;d.set(m,6,l,!0),d.set(6,m,l,!0)}}function S(d,w){const m=t.getPositions(w);for(let l=0;l<m.length;l++){const A=m[l][0],g=m[l][1];for(let C=-2;C<=2;C++)for(let h=-2;h<=2;h++)C===-2||C===2||h===-2||h===2||C===0&&h===0?d.set(A+C,g+h,!0,!0):d.set(A+C,g+h,!1,!0)}}function b(d,w){const m=d.size,l=c.getEncodedBits(w);let A,g,C;for(let h=0;h<18;h++)A=Math.floor(h/3),g=h%3+m-8-3,C=(l>>h&1)===1,d.set(A,g,C,!0),d.set(g,A,C,!0)}function I(d,w,m){const l=d.size,A=E.getEncodedBits(w,m);let g,C;for(g=0;g<15;g++)C=(A>>g&1)===1,g<6?d.set(g,8,C,!0):g<8?d.set(g+1,8,C,!0):d.set(l-15+g,8,C,!0),g<8?d.set(8,l-g-1,C,!0):g<9?d.set(8,15-g-1+1,C,!0):d.set(8,15-g-1,C,!0);d.set(l-8,8,1,!0)}function N(d,w){const m=d.size;let l=-1,A=m-1,g=7,C=0;for(let h=m-1;h>0;h-=2)for(h===6&&h--;;){for(let T=0;T<2;T++)if(!d.isReserved(A,h-T)){let U=!1;C<w.length&&(U=(w[C]>>>g&1)===1),d.set(A,h-T,U),g--,g===-1&&(C++,g=7)}if(A+=l,A<0||m<=A){A-=l,l=-l;break}}}function R(d,w,m){const l=new u;m.forEach(function(T){l.put(T.mode.bit,4),l.put(T.getLength(),p.getCharCountIndicator(T.mode,d)),T.write(l)});const A=r.getSymbolTotalCodewords(d),g=a.getTotalCodewordsCount(d,w),C=(A-g)*8;for(l.getLengthInBits()+4<=C&&l.put(0,4);l.getLengthInBits()%8!==0;)l.putBit(0);const h=(C-l.getLengthInBits())/8;for(let T=0;T<h;T++)l.put(T%2?17:236,8);return B(l,d,w)}function B(d,w,m){const l=r.getSymbolTotalCodewords(w),A=a.getTotalCodewordsCount(w,m),g=l-A,C=a.getBlocksCount(w,m),h=l%C,T=C-h,U=Math.floor(l/C),K=Math.floor(g/C),Zt=K+1,Ct=U-K,Xt=new s(Ct);let _=0;const J=new Array(C),Et=new Array(C);let O=0;const xt=new Uint8Array(d.buffer);for(let z=0;z<C;z++){const G=z<T?K:Zt;J[z]=xt.slice(_,_+G),Et[z]=Xt.encode(J[z]),_+=G,O=Math.max(O,G)}const j=new Uint8Array(l);let yt=0,D,q;for(D=0;D<O;D++)for(q=0;q<C;q++)D<J[q].length&&(j[yt++]=J[q][D]);for(D=0;D<Ct;D++)for(q=0;q<C;q++)j[yt++]=Et[q][D];return j}function P(d,w,m,l){let A;if(Array.isArray(d))A=y.fromArray(d);else if(typeof d=="string"){let U=w;if(!U){const K=y.rawSplit(d);U=c.getBestVersionForData(K,m)}A=y.fromString(d,U||40)}else throw new Error("Invalid data");const g=c.getBestVersionForData(A,m);if(!g)throw new Error("The amount of data is too big to be stored in a QR Code");if(!w)w=g;else if(w<g)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+g+`.
`);const C=R(w,m,A),h=r.getSymbolSize(w),T=new n(h);return f(T,w),M(T),S(T,w),I(T,m,0),w>=7&&b(T,w),N(T,C),isNaN(l)&&(l=i.getBestMask(T,I.bind(null,T,m))),i.applyMask(l,T),I(T,m,l),{modules:T,version:w,errorCorrectionLevel:m,maskPattern:l,segments:A}}return $.create=function(w,m){if(typeof w>"u"||w==="")throw new Error("No input text");let l=o.M,A,g;return typeof m<"u"&&(l=o.from(m.errorCorrectionLevel,o.M),A=c.from(m.version),g=i.from(m.maskPattern),m.toSJISFunc&&r.setToSJISFunction(m.toSJISFunc)),P(w,A,l,g)},$}var gt={},ht={},Yt;function Wt(){return Yt||(Yt=1,function(r){function o(u){if(typeof u=="number"&&(u=u.toString()),typeof u!="string")throw new Error("Color should be defined as hex string");let n=u.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+u);(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,i=n.scale||4;return{width:e,scale:e?4:i,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 i=t.modules.size,a=t.modules.data,s=r.getScale(i,e),c=Math.floor((i+e.margin*2)*s),E=e.margin*s,p=[e.color.light,e.color.dark];for(let y=0;y<c;y++)for(let f=0;f<c;f++){let M=(y*c+f)*4,S=e.color.light;if(y>=E&&f>=E&&y<c-E&&f<c-E){const b=Math.floor((y-E)/s),I=Math.floor((f-E)/s);S=p[a[b*i+I]?1:0]}n[M++]=S.r,n[M++]=S.g,n[M++]=S.b,n[M]=S.a}}}(ht)),ht}var _t;function ye(){return _t||(_t=1,function(r){const o=Wt();function u(t,e,i){t.clearRect(0,0,e.width,e.height),e.style||(e.style={}),e.height=i,e.width=i,e.style.height=i+"px",e.style.width=i+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}r.render=function(e,i,a){let s=a,c=i;typeof s>"u"&&(!i||!i.getContext)&&(s=i,i=void 0),i||(c=n()),s=o.getOptions(s);const E=o.getImageWidth(e.modules.size,s),p=c.getContext("2d"),y=p.createImageData(E,E);return o.qrToImageData(y.data,e,s),u(p,c,E),p.putImageData(y,0,0),c},r.renderToDataURL=function(e,i,a){let s=a;typeof s>"u"&&(!i||!i.getContext)&&(s=i,i=void 0),s||(s={});const c=r.render(e,i,s),E=s.type||"image/png",p=s.rendererOpts||{};return c.toDataURL(E,p.quality)}}(gt)),gt}var mt={},Ot;function Be(){if(Ot)return mt;Ot=1;const r=Wt();function o(t,e){const i=t.a/255,a=e+'="'+t.hex+'"';return i<1?a+" "+e+'-opacity="'+i.toFixed(2).slice(1)+'"':a}function u(t,e,i){let a=t+e;return typeof i<"u"&&(a+=" "+i),a}function n(t,e,i){let a="",s=0,c=!1,E=0;for(let p=0;p<t.length;p++){const y=Math.floor(p%e),f=Math.floor(p/e);!y&&!c&&(c=!0),t[p]?(E++,p>0&&y>0&&t[p-1]||(a+=c?u("M",y+i,.5+f+i):u("m",s,0),s=0,c=!1),y+1<e&&t[p+1]||(a+=u("h",E),E=0)):s++}return a}return mt.render=function(e,i,a){const s=r.getOptions(i),c=e.modules.size,E=e.modules.data,p=c+s.margin*2,y=s.color.light.a?"<path "+o(s.color.light,"fill")+' d="M0 0h'+p+"v"+p+'H0z"/>':"",f="<path "+o(s.color.dark,"stroke")+' d="'+n(E,c,s.margin)+'"/>',M='viewBox="0 0 '+p+" "+p+'"',b='<svg xmlns="http://www.w3.org/2000/svg" '+(s.width?'width="'+s.width+'" height="'+s.width+'" ':"")+M+' shape-rendering="crispEdges">'+y+f+`</svg>
`;return typeof a=="function"&&a(null,b),b},mt}var jt;function Ae(){if(jt)return V;jt=1;const r=ne(),o=Ee(),u=ye(),n=Be();function t(e,i,a,s,c){const E=[].slice.call(arguments,1),p=E.length,y=typeof E[p-1]=="function";if(!y&&!r())throw new Error("Callback required as last argument");if(y){if(p<2)throw new Error("Too few arguments provided");p===2?(c=a,a=i,i=s=void 0):p===3&&(i.getContext&&typeof c>"u"?(c=s,s=void 0):(c=s,s=a,a=i,i=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(a=i,i=s=void 0):p===2&&!i.getContext&&(s=a,a=i,i=void 0),new Promise(function(f,M){try{const S=o.create(a,s);f(e(S,i,s))}catch(S){M(S)}})}try{const f=o.create(a,s);c(null,e(f,i,s))}catch(f){c(f)}}return V.create=o.create,V.toCanvas=t.bind(null,u.render),V.toDataURL=t.bind(null,u.renderToDataURL),V.toString=t.bind(null,function(e,i,a){return n.render(e,a)}),V}var Re=Ae();const Te=te(Re);export{Te as Q};