index-83eefeb2.js 27 KB

12345678
  1. var _e=Object.defineProperty;var Ht=Object.getOwnPropertySymbols;var De=Object.prototype.hasOwnProperty,He=Object.prototype.propertyIsEnumerable;var kt=(M,N,A)=>N in M?_e(M,N,{enumerable:!0,configurable:!0,writable:!0,value:A}):M[N]=A,zt=(M,N)=>{for(var A in N||(N={}))De.call(N,A)&&kt(M,A,N[A]);if(Ht)for(var A of Ht(N))He.call(N,A)&&kt(M,A,N[A]);return M};var pt=(M,N,A)=>new Promise((z,V)=>{var x=T=>{try{F(A.next(T))}catch(K){V(K)}},j=T=>{try{F(A.throw(T))}catch(K){V(K)}},F=T=>T.done?z(T.value):Promise.resolve(T.value).then(x,j);F((A=A.apply(M,N)).next())});import{D as ke,aE as ze,d as Fe,r as Ke,n as Je,j as Ye,u as mt,_ as Oe,o as Ft,l as Ve,c as je,aV as Qe,ax as qe,__tla as $e}from"./index-b5895273.js";import{d as Ze,__tla as Xe}from"./download-801edd56.js";let Kt,We=Promise.all([(()=>{try{return $e}catch(M){}})(),(()=>{try{return Xe}catch(M){}})()]).then(()=>pt(void 0,null,function*(){var M=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},N={},A={};let z;const V=[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];A.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17},A.getSymbolTotalCodewords=function(t){return V[t]},A.getBCHDigit=function(t){let e=0;for(;t!==0;)e++,t>>>=1;return e},A.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');z=t},A.isKanjiModeEnabled=function(){return typeof z<"u"},A.toSJIS=function(t){return z(t)};var x={};(function(t){t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2};function e(o){if(typeof o!="string")throw new Error("Param is not a string");switch(o.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw new Error("Unknown EC Level: "+o)}}t.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},t.from=function(o,r){if(t.isValid(o))return o;try{return e(o)}catch(n){return r}}})(x);function j(){this.buffer=[],this.length=0}j.prototype={get:function(t){const e=Math.floor(t/8);return(this.buffer[e]>>>7-t%8&1)===1},put:function(t,e){for(let o=0;o<e;o++)this.putBit((t>>>e-o-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(t){const e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}};var F=j;function T(t){if(!t||t<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=t,this.data=new Uint8Array(t*t),this.reservedBit=new Uint8Array(t*t)}T.prototype.set=function(t,e,o,r){const n=t*this.size+e;this.data[n]=o,r&&(this.reservedBit[n]=!0)},T.prototype.get=function(t,e){return this.data[t*this.size+e]},T.prototype.xor=function(t,e,o){this.data[t*this.size+e]^=o},T.prototype.isReserved=function(t,e){return this.reservedBit[t*this.size+e]};var K=T,wt={};(function(t){const e=A.getSymbolSize;t.getRowColCoords=function(o){if(o===1)return[];const r=Math.floor(o/7)+2,n=e(o),i=n===145?26:Math.ceil((n-13)/(2*r-2))*2,a=[n-7];for(let s=1;s<r-1;s++)a[s]=a[s-1]-i;return a.push(6),a.reverse()},t.getPositions=function(o){const r=[],n=t.getRowColCoords(o),i=n.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||r.push([n[a],n[s]]);return r}})(wt);var yt={};const Jt=A.getSymbolSize,Et=7;yt.getPositions=function(t){const e=Jt(t);return[[0,0],[e-Et,0],[0,e-Et]]};var vt={};(function(t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const e={N1:3,N2:3,N3:40,N4:10};t.isValid=function(r){return r!=null&&r!==""&&!isNaN(r)&&r>=0&&r<=7},t.from=function(r){return t.isValid(r)?parseInt(r,10):void 0},t.getPenaltyN1=function(r){const n=r.size;let i=0,a=0,s=0,u=null,l=null;for(let f=0;f<n;f++){a=s=0,u=l=null;for(let w=0;w<n;w++){let c=r.get(f,w);c===u?a++:(a>=5&&(i+=e.N1+(a-5)),u=c,a=1),c=r.get(w,f),c===l?s++:(s>=5&&(i+=e.N1+(s-5)),l=c,s=1)}a>=5&&(i+=e.N1+(a-5)),s>=5&&(i+=e.N1+(s-5))}return i},t.getPenaltyN2=function(r){const n=r.size;let i=0;for(let a=0;a<n-1;a++)for(let s=0;s<n-1;s++){const u=r.get(a,s)+r.get(a,s+1)+r.get(a+1,s)+r.get(a+1,s+1);(u===4||u===0)&&i++}return i*e.N2},t.getPenaltyN3=function(r){const n=r.size;let i=0,a=0,s=0;for(let u=0;u<n;u++){a=s=0;for(let l=0;l<n;l++)a=a<<1&2047|r.get(u,l),l>=10&&(a===1488||a===93)&&i++,s=s<<1&2047|r.get(l,u),l>=10&&(s===1488||s===93)&&i++}return i*e.N3},t.getPenaltyN4=function(r){let n=0;const i=r.data.length;for(let a=0;a<i;a++)n+=r.data[a];return Math.abs(Math.ceil(n*100/i/5)-10)*e.N4};function o(r,n,i){switch(r){case t.Patterns.PATTERN000:return(n+i)%2===0;case t.Patterns.PATTERN001:return n%2===0;case t.Patterns.PATTERN010:return i%3===0;case t.Patterns.PATTERN011:return(n+i)%3===0;case t.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(i/3))%2===0;case t.Patterns.PATTERN101:return n*i%2+n*i%3===0;case t.Patterns.PATTERN110:return(n*i%2+n*i%3)%2===0;case t.Patterns.PATTERN111:return(n*i%3+(n+i)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}t.applyMask=function(r,n){const i=n.size;for(let a=0;a<i;a++)for(let s=0;s<i;s++)n.isReserved(s,a)||n.xor(s,a,o(r,s,a))},t.getBestMask=function(r,n){const i=Object.keys(t.Patterns).length;let a=0,s=1/0;for(let u=0;u<i;u++){n(u),t.applyMask(u,r);const l=t.getPenaltyN1(r)+t.getPenaltyN2(r)+t.getPenaltyN3(r)+t.getPenaltyN4(r);t.applyMask(u,r),l<s&&(s=l,a=u)}return a}})(vt);var Q={};const S=x,q=[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],$=[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];Q.getBlocksCount=function(t,e){switch(e){case S.L:return q[(t-1)*4+0];case S.M:return q[(t-1)*4+1];case S.Q:return q[(t-1)*4+2];case S.H:return q[(t-1)*4+3];default:return}},Q.getTotalCodewordsCount=function(t,e){switch(e){case S.L:return $[(t-1)*4+0];case S.M:return $[(t-1)*4+1];case S.Q:return $[(t-1)*4+2];case S.H:return $[(t-1)*4+3];default:return}};var At={},Z={};const J=new Uint8Array(512),X=new Uint8Array(256);(function(){let t=1;for(let e=0;e<255;e++)J[e]=t,X[t]=e,t<<=1,t&256&&(t^=285);for(let e=255;e<512;e++)J[e]=J[e-255]})(),Z.log=function(t){if(t<1)throw new Error("log("+t+")");return X[t]},Z.exp=function(t){return J[t]},Z.mul=function(t,e){return t===0||e===0?0:J[X[t]+X[e]]},function(t){const e=Z;t.mul=function(o,r){const n=new Uint8Array(o.length+r.length-1);for(let i=0;i<o.length;i++)for(let a=0;a<r.length;a++)n[i+a]^=e.mul(o[i],r[a]);return n},t.mod=function(o,r){let n=new Uint8Array(o);for(;n.length-r.length>=0;){const i=n[0];for(let s=0;s<r.length;s++)n[s]^=e.mul(r[s],i);let a=0;for(;a<n.length&&n[a]===0;)a++;n=n.slice(a)}return n},t.generateECPolynomial=function(o){let r=new Uint8Array([1]);for(let n=0;n<o;n++)r=t.mul(r,new Uint8Array([1,e.exp(n)]));return r}}(At);const Ct=At;function et(t){this.genPoly=void 0,this.degree=t,this.degree&&this.initialize(this.degree)}et.prototype.initialize=function(t){this.degree=t,this.genPoly=Ct.generateECPolynomial(this.degree)},et.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const e=new Uint8Array(t.length+this.degree);e.set(t);const o=Ct.mod(e,this.genPoly),r=this.degree-o.length;if(r>0){const n=new Uint8Array(this.degree);return n.set(o,r),n}return o};var Yt=et,Bt={},U={},nt={};nt.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var P={};const Nt="[0-9]+",Ot="[A-Z $%*+\\-./:]+";let Y="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Y=Y.replace(/u/g,"\\u");const Vt="(?:(?![A-Z0-9 $%*+\\-./:]|"+Y+`)(?:.|[\r
  2. ]))+`;P.KANJI=new RegExp(Y,"g"),P.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),P.BYTE=new RegExp(Vt,"g"),P.NUMERIC=new RegExp(Nt,"g"),P.ALPHANUMERIC=new RegExp(Ot,"g");const jt=new RegExp("^"+Y+"$"),Qt=new RegExp("^"+Nt+"$"),qt=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");P.testKanji=function(t){return jt.test(t)},P.testNumeric=function(t){return Qt.test(t)},P.testAlphanumeric=function(t){return qt.test(t)},function(t){const e=nt,o=P;t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(n,i){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!e.isValid(i))throw new Error("Invalid version: "+i);return i>=1&&i<10?n.ccBits[0]:i<27?n.ccBits[1]:n.ccBits[2]},t.getBestModeForData=function(n){return o.testNumeric(n)?t.NUMERIC:o.testAlphanumeric(n)?t.ALPHANUMERIC:o.testKanji(n)?t.KANJI:t.BYTE},t.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},t.isValid=function(n){return n&&n.bit&&n.ccBits};function r(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw new Error("Unknown mode: "+n)}}t.from=function(n,i){if(t.isValid(n))return n;try{return r(n)}catch(a){return i}}}(U),function(t){const e=A,o=Q,r=x,n=U,i=nt,a=7973,s=e.getBCHDigit(a);function u(c,y,h){for(let E=1;E<=40;E++)if(y<=t.getCapacity(E,h,c))return E}function l(c,y){return n.getCharCountIndicator(c,y)+4}function f(c,y){let h=0;return c.forEach(function(E){const B=l(E.mode,y);h+=B+E.getBitsLength()}),h}function w(c,y){for(let h=1;h<=40;h++)if(f(c,h)<=t.getCapacity(h,y,n.MIXED))return h}t.from=function(c,y){return i.isValid(c)?parseInt(c,10):y},t.getCapacity=function(c,y,h){if(!i.isValid(c))throw new Error("Invalid QR Code version");typeof h>"u"&&(h=n.BYTE);const E=e.getSymbolTotalCodewords(c),B=o.getTotalCodewordsCount(c,y),g=(E-B)*8;if(h===n.MIXED)return g;const p=g-l(h,c);switch(h){case n.NUMERIC:return Math.floor(p/10*3);case n.ALPHANUMERIC:return Math.floor(p/11*2);case n.KANJI:return Math.floor(p/13);case n.BYTE:default:return Math.floor(p/8)}},t.getBestVersionForData=function(c,y){let h;const E=r.from(y,r.M);if(Array.isArray(c)){if(c.length>1)return w(c,E);if(c.length===0)return 1;h=c[0]}else h=c;return u(h.mode,h.getLength(),E)},t.getEncodedBits=function(c){if(!i.isValid(c)||c<7)throw new Error("Invalid QR Code version");let y=c<<12;for(;e.getBCHDigit(y)-s>=0;)y^=a<<e.getBCHDigit(y)-s;return c<<12|y}}(Bt);var It={};const rt=A,Mt=1335,$t=21522,Tt=rt.getBCHDigit(Mt);It.getEncodedBits=function(t,e){const o=t.bit<<3|e;let r=o<<10;for(;rt.getBCHDigit(r)-Tt>=0;)r^=Mt<<rt.getBCHDigit(r)-Tt;return(o<<10|r)^$t};var Pt={};const Zt=U;function _(t){this.mode=Zt.NUMERIC,this.data=t.toString()}_.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)},_.prototype.getLength=function(){return this.data.length},_.prototype.getBitsLength=function(){return _.getBitsLength(this.data.length)},_.prototype.write=function(t){let e,o,r;for(e=0;e+3<=this.data.length;e+=3)o=this.data.substr(e,3),r=parseInt(o,10),t.put(r,10);const n=this.data.length-e;n>0&&(o=this.data.substr(e),r=parseInt(o,10),t.put(r,n*3+1))};var Xt=_;const Wt=U,ot=["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 D(t){this.mode=Wt.ALPHANUMERIC,this.data=t}D.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)},D.prototype.getLength=function(){return this.data.length},D.prototype.getBitsLength=function(){return D.getBitsLength(this.data.length)},D.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let o=ot.indexOf(this.data[e])*45;o+=ot.indexOf(this.data[e+1]),t.put(o,11)}this.data.length%2&&t.put(ot.indexOf(this.data[e]),6)};var Gt=D,te=function(t){for(var e=[],o=t.length,r=0;r<o;r++){var n=t.charCodeAt(r);if(n>=55296&&n<=56319&&o>r+1){var i=t.charCodeAt(r+1);i>=56320&&i<=57343&&(n=(n-55296)*1024+i-56320+65536,r+=1)}if(n<128){e.push(n);continue}if(n<2048){e.push(n>>6|192),e.push(n&63|128);continue}if(n<55296||n>=57344&&n<65536){e.push(n>>12|224),e.push(n>>6&63|128),e.push(n&63|128);continue}if(n>=65536&&n<=1114111){e.push(n>>18|240),e.push(n>>12&63|128),e.push(n>>6&63|128),e.push(n&63|128);continue}e.push(239,191,189)}return new Uint8Array(e).buffer};const ee=te,ne=U;function H(t){this.mode=ne.BYTE,typeof t=="string"&&(t=ee(t)),this.data=new Uint8Array(t)}H.getBitsLength=function(t){return t*8},H.prototype.getLength=function(){return this.data.length},H.prototype.getBitsLength=function(){return H.getBitsLength(this.data.length)},H.prototype.write=function(t){for(let e=0,o=this.data.length;e<o;e++)t.put(this.data[e],8)};var re=H;const oe=U,ie=A;function k(t){this.mode=oe.KANJI,this.data=t}k.getBitsLength=function(t){return t*13},k.prototype.getLength=function(){return this.data.length},k.prototype.getBitsLength=function(){return k.getBitsLength(this.data.length)},k.prototype.write=function(t){let e;for(e=0;e<this.data.length;e++){let o=ie.toSJIS(this.data[e]);if(o>=33088&&o<=40956)o-=33088;else if(o>=57408&&o<=60351)o-=49472;else throw new Error("Invalid SJIS character: "+this.data[e]+`
  3. Make sure your charset is UTF-8`);o=(o>>>8&255)*192+(o&255),t.put(o,13)}};var ae=k,bt={exports:{}};(function(t){var e={single_source_shortest_paths:function(o,r,n){var i={},a={};a[r]=0;var s=e.PriorityQueue.make();s.push(r,0);for(var u,l,f,w,c,y,h,E,B;!s.empty();){u=s.pop(),l=u.value,w=u.cost,c=o[l]||{};for(f in c)c.hasOwnProperty(f)&&(y=c[f],h=w+y,E=a[f],B=typeof a[f]>"u",(B||E>h)&&(a[f]=h,s.push(f,h),i[f]=l))}if(typeof n<"u"&&typeof a[n]>"u"){var g=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(g)}return i},extract_shortest_path_from_predecessor_list:function(o,r){for(var n=[],i=r;i;)n.push(i),o[i],i=o[i];return n.reverse(),n},find_path:function(o,r,n){var i=e.single_source_shortest_paths(o,r,n);return e.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(o){var r=e.PriorityQueue,n={},i;o=o||{};for(i in r)r.hasOwnProperty(i)&&(n[i]=r[i]);return n.queue=[],n.sorter=o.sorter||r.default_sorter,n},default_sorter:function(o,r){return o.cost-r.cost},push:function(o,r){var n={value:o,cost:r};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};t.exports=e})(bt);var se=bt.exports;(function(t){const e=U,o=Xt,r=Gt,n=re,i=ae,a=P,s=A,u=se;function l(g){return unescape(encodeURIComponent(g)).length}function f(g,p,d){const m=[];let v;for(;(v=g.exec(d))!==null;)m.push({data:v[0],index:v.index,mode:p,length:v[0].length});return m}function w(g){const p=f(a.NUMERIC,e.NUMERIC,g),d=f(a.ALPHANUMERIC,e.ALPHANUMERIC,g);let m,v;return s.isKanjiModeEnabled()?(m=f(a.BYTE,e.BYTE,g),v=f(a.KANJI,e.KANJI,g)):(m=f(a.BYTE_KANJI,e.BYTE,g),v=[]),p.concat(d,m,v).sort(function(C,I){return C.index-I.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function c(g,p){switch(p){case e.NUMERIC:return o.getBitsLength(g);case e.ALPHANUMERIC:return r.getBitsLength(g);case e.KANJI:return i.getBitsLength(g);case e.BYTE:return n.getBitsLength(g)}}function y(g){return g.reduce(function(p,d){const m=p.length-1>=0?p[p.length-1]:null;return m&&m.mode===d.mode?(p[p.length-1].data+=d.data,p):(p.push(d),p)},[])}function h(g){const p=[];for(let d=0;d<g.length;d++){const m=g[d];switch(m.mode){case e.NUMERIC:p.push([m,{data:m.data,mode:e.ALPHANUMERIC,length:m.length},{data:m.data,mode:e.BYTE,length:m.length}]);break;case e.ALPHANUMERIC:p.push([m,{data:m.data,mode:e.BYTE,length:m.length}]);break;case e.KANJI:p.push([m,{data:m.data,mode:e.BYTE,length:l(m.data)}]);break;case e.BYTE:p.push([{data:m.data,mode:e.BYTE,length:l(m.data)}])}}return p}function E(g,p){const d={},m={start:{}};let v=["start"];for(let C=0;C<g.length;C++){const I=g[C],b=[];for(let tt=0;tt<I.length;tt++){const R=I[tt],O=""+C+tt;b.push(O),d[O]={node:R,lastCount:0},m[O]={};for(let dt=0;dt<v.length;dt++){const L=v[dt];d[L]&&d[L].node.mode===R.mode?(m[L][O]=c(d[L].lastCount+R.length,R.mode)-c(d[L].lastCount,R.mode),d[L].lastCount+=R.length):(d[L]&&(d[L].lastCount=R.length),m[L][O]=c(R.length,R.mode)+4+e.getCharCountIndicator(R.mode,p))}}v=b}for(let C=0;C<v.length;C++)m[v[C]].end=0;return{map:m,table:d}}function B(g,p){let d;const m=e.getBestModeForData(g);if(d=e.from(p,m),d!==e.BYTE&&d.bit<m.bit)throw new Error('"'+g+'" cannot be encoded with mode '+e.toString(d)+`.
  4. Suggested mode is: `+e.toString(m));switch(d===e.KANJI&&!s.isKanjiModeEnabled()&&(d=e.BYTE),d){case e.NUMERIC:return new o(g);case e.ALPHANUMERIC:return new r(g);case e.KANJI:return new i(g);case e.BYTE:return new n(g)}}t.fromArray=function(g){return g.reduce(function(p,d){return typeof d=="string"?p.push(B(d,null)):d.data&&p.push(B(d.data,d.mode)),p},[])},t.fromString=function(g,p){const d=w(g,s.isKanjiModeEnabled()),m=h(d),v=E(m,p),C=u.find_path(v.map,"start","end"),I=[];for(let b=1;b<C.length-1;b++)I.push(v.table[C[b]].node);return t.fromArray(y(I))},t.rawSplit=function(g){return t.fromArray(w(g,s.isKanjiModeEnabled()))}})(Pt);const W=A,it=x,ue=F,ce=K,le=wt,fe=yt,at=vt,st=Q,he=Yt,G=Bt,ge=It,de=U,ut=Pt;function pe(t,e){const o=t.size,r=fe.getPositions(e);for(let n=0;n<r.length;n++){const i=r[n][0],a=r[n][1];for(let s=-1;s<=7;s++)if(!(i+s<=-1||o<=i+s))for(let u=-1;u<=7;u++)a+u<=-1||o<=a+u||(s>=0&&s<=6&&(u===0||u===6)||u>=0&&u<=6&&(s===0||s===6)||s>=2&&s<=4&&u>=2&&u<=4?t.set(i+s,a+u,!0,!0):t.set(i+s,a+u,!1,!0))}}function me(t){const e=t.size;for(let o=8;o<e-8;o++){const r=o%2===0;t.set(o,6,r,!0),t.set(6,o,r,!0)}}function we(t,e){const o=le.getPositions(e);for(let r=0;r<o.length;r++){const n=o[r][0],i=o[r][1];for(let a=-2;a<=2;a++)for(let s=-2;s<=2;s++)a===-2||a===2||s===-2||s===2||a===0&&s===0?t.set(n+a,i+s,!0,!0):t.set(n+a,i+s,!1,!0)}}function ye(t,e){const o=t.size,r=G.getEncodedBits(e);let n,i,a;for(let s=0;s<18;s++)n=Math.floor(s/3),i=s%3+o-8-3,a=(r>>s&1)===1,t.set(n,i,a,!0),t.set(i,n,a,!0)}function ct(t,e,o){const r=t.size,n=ge.getEncodedBits(e,o);let i,a;for(i=0;i<15;i++)a=(n>>i&1)===1,i<6?t.set(i,8,a,!0):i<8?t.set(i+1,8,a,!0):t.set(r-15+i,8,a,!0),i<8?t.set(8,r-i-1,a,!0):i<9?t.set(8,15-i-1+1,a,!0):t.set(8,15-i-1,a,!0);t.set(r-8,8,1,!0)}function Ee(t,e){const o=t.size;let r=-1,n=o-1,i=7,a=0;for(let s=o-1;s>0;s-=2)for(s===6&&s--;;){for(let u=0;u<2;u++)if(!t.isReserved(n,s-u)){let l=!1;a<e.length&&(l=(e[a]>>>i&1)===1),t.set(n,s-u,l),i--,i===-1&&(a++,i=7)}if(n+=r,n<0||o<=n){n-=r,r=-r;break}}}function ve(t,e,o){const r=new ue;o.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),de.getCharCountIndicator(u.mode,t)),u.write(r)});const n=W.getSymbolTotalCodewords(t),i=st.getTotalCodewordsCount(t,e),a=(n-i)*8;for(r.getLengthInBits()+4<=a&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const s=(a-r.getLengthInBits())/8;for(let u=0;u<s;u++)r.put(u%2?17:236,8);return Ae(r,t,e)}function Ae(t,e,o){const r=W.getSymbolTotalCodewords(e),n=st.getTotalCodewordsCount(e,o),i=r-n,a=st.getBlocksCount(e,o),s=r%a,u=a-s,l=Math.floor(r/a),f=Math.floor(i/a),w=f+1,c=l-f,y=new he(c);let h=0;const E=new Array(a),B=new Array(a);let g=0;const p=new Uint8Array(t.buffer);for(let I=0;I<a;I++){const b=I<u?f:w;E[I]=p.slice(h,h+b),B[I]=y.encode(E[I]),h+=b,g=Math.max(g,b)}const d=new Uint8Array(r);let m=0,v,C;for(v=0;v<g;v++)for(C=0;C<a;C++)v<E[C].length&&(d[m++]=E[C][v]);for(v=0;v<c;v++)for(C=0;C<a;C++)d[m++]=B[C][v];return d}function Ce(t,e,o,r){let n;if(Array.isArray(t))n=ut.fromArray(t);else if(typeof t=="string"){let l=e;if(!l){const f=ut.rawSplit(t);l=G.getBestVersionForData(f,o)}n=ut.fromString(t,l||40)}else throw new Error("Invalid data");const i=G.getBestVersionForData(n,o);if(!i)throw new Error("The amount of data is too big to be stored in a QR Code");if(!e)e=i;else if(e<i)throw new Error(`
  5. The chosen QR Code version cannot contain this amount of data.
  6. Minimum version required to store current data is: `+i+`.
  7. `);const a=ve(e,o,n),s=W.getSymbolSize(e),u=new ce(s);return pe(u,e),me(u),we(u,e),ct(u,o,0),e>=7&&ye(u,e),Ee(u,a),isNaN(r)&&(r=at.getBestMask(u,ct.bind(null,u,o))),at.applyMask(r,u),ct(u,o,r),{modules:u,version:e,errorCorrectionLevel:o,maskPattern:r,segments:n}}N.create=function(t,e){if(typeof t>"u"||t==="")throw new Error("No input text");let o=it.M,r,n;return typeof e<"u"&&(o=it.from(e.errorCorrectionLevel,it.M),r=G.from(e.version),n=at.from(e.maskPattern),e.toSJISFunc&&W.setToSJISFunction(e.toSJISFunc)),Ce(t,r,o,n)};var Rt={},lt={};(function(t){function e(o){if(typeof o=="number"&&(o=o.toString()),typeof o!="string")throw new Error("Color should be defined as hex string");let r=o.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+o);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(i){return[i,i]}))),r.length===6&&r.push("F","F");const n=parseInt(r.join(""),16);return{r:n>>24&255,g:n>>16&255,b:n>>8&255,a:n&255,hex:"#"+r.slice(0,6).join("")}}t.getOptions=function(o){o||(o={}),o.color||(o.color={});const r=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,n=o.width&&o.width>=21?o.width:void 0,i=o.scale||4;return{width:n,scale:n?4:i,margin:r,color:{dark:e(o.color.dark||"#000000ff"),light:e(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},t.getScale=function(o,r){return r.width&&r.width>=o+r.margin*2?r.width/(o+r.margin*2):r.scale},t.getImageWidth=function(o,r){const n=t.getScale(o,r);return Math.floor((o+r.margin*2)*n)},t.qrToImageData=function(o,r,n){const i=r.modules.size,a=r.modules.data,s=t.getScale(i,n),u=Math.floor((i+n.margin*2)*s),l=n.margin*s,f=[n.color.light,n.color.dark];for(let w=0;w<u;w++)for(let c=0;c<u;c++){let y=(w*u+c)*4,h=n.color.light;if(w>=l&&c>=l&&w<u-l&&c<u-l){const E=Math.floor((w-l)/s),B=Math.floor((c-l)/s);h=f[a[E*i+B]?1:0]}o[y++]=h.r,o[y++]=h.g,o[y++]=h.b,o[y]=h.a}}})(lt),function(t){const e=lt;function o(n,i,a){n.clearRect(0,0,i.width,i.height),i.style||(i.style={}),i.height=a,i.width=a,i.style.height=a+"px",i.style.width=a+"px"}function r(){try{return document.createElement("canvas")}catch(n){throw new Error("You need to specify a canvas element")}}t.render=function(n,i,a){let s=a,u=i;typeof s>"u"&&(!i||!i.getContext)&&(s=i,i=void 0),i||(u=r()),s=e.getOptions(s);const l=e.getImageWidth(n.modules.size,s),f=u.getContext("2d"),w=f.createImageData(l,l);return e.qrToImageData(w.data,n,s),o(f,u,l),f.putImageData(w,0,0),u},t.renderToDataURL=function(n,i,a){let s=a;typeof s>"u"&&(!i||!i.getContext)&&(s=i,i=void 0),s||(s={});const u=t.render(n,i,s),l=s.type||"image/png",f=s.rendererOpts||{};return u.toDataURL(l,f.quality)}}(Rt);var Lt={};const Be=lt;function St(t,e){const o=t.a/255,r=e+'="'+t.hex+'"';return o<1?r+" "+e+'-opacity="'+o.toFixed(2).slice(1)+'"':r}function ft(t,e,o){let r=t+e;return typeof o<"u"&&(r+=" "+o),r}function Ne(t,e,o){let r="",n=0,i=!1,a=0;for(let s=0;s<t.length;s++){const u=Math.floor(s%e),l=Math.floor(s/e);!u&&!i&&(i=!0),t[s]?(a++,s>0&&u>0&&t[s-1]||(r+=i?ft("M",u+o,.5+l+o):ft("m",n,0),n=0,i=!1),u+1<e&&t[s+1]||(r+=ft("h",a),a=0)):n++}return r}Lt.render=function(t,e,o){const r=Be.getOptions(e),n=t.modules.size,i=t.modules.data,a=n+r.margin*2,s=r.color.light.a?"<path "+St(r.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",u="<path "+St(r.color.dark,"stroke")+' d="'+Ne(i,n,r.margin)+'"/>',l='viewBox="0 0 '+a+" "+a+'"',f='<svg xmlns="http://www.w3.org/2000/svg" '+(r.width?'width="'+r.width+'" height="'+r.width+'" ':"")+l+' shape-rendering="crispEdges">'+s+u+`</svg>
  8. `;return typeof o=="function"&&o(null,f),f};const Ie=M,ht=N,Ut=Rt,Me=Lt;function gt(t,e,o,r,n){const i=[].slice.call(arguments,1),a=i.length,s=typeof i[a-1]=="function";if(!s&&!Ie())throw new Error("Callback required as last argument");if(s){if(a<2)throw new Error("Too few arguments provided");a===2?(n=o,o=e,e=r=void 0):a===3&&(e.getContext&&typeof n>"u"?(n=r,r=void 0):(n=r,r=o,o=e,e=void 0))}else{if(a<1)throw new Error("Too few arguments provided");return a===1?(o=e,e=r=void 0):a===2&&!e.getContext&&(r=o,o=e,e=void 0),new Promise(function(u,l){try{const f=ht.create(o,r);u(t(f,e,r))}catch(f){l(f)}})}try{const u=ht.create(o,r);n(null,t(u,e,r))}catch(u){n(u)}}ht.create;var xt=gt.bind(null,Ut.render),Te=gt.bind(null,Ut.renderToDataURL);gt.bind(null,function(t,e,o){return Me.render(t,o)});const Pe=({canvas:t,content:e,width:o=0,options:r={}})=>{const n=ke(r);return n.errorCorrectionLevel=n.errorCorrectionLevel||Re(e),be(e,n).then(i=>(n.scale=o===0?void 0:o/i*4,xt(t,e,n)))};function be(t,e){const o=document.createElement("canvas");return xt(o,t,e).then(()=>o.width)}function Re(t){return t.length>36?"M":t.length>16?"Q":"H"}const Le=({canvas:t,logo:e})=>{if(!e)return new Promise(p=>{p(t.toDataURL())});const o=t.width,{logoSize:r=.15,bgColor:n="#ffffff",borderSize:i=.05,crossOrigin:a,borderRadius:s=8,logoRadius:u=0}=e,l=ze(e)?e:e.src,f=o*r,w=o*(1-r)/2,c=o*(r+i),y=o*(1-r-i)/2,h=t.getContext("2d");if(!h)return;_t(h)(y,y,c,c,s),h.fillStyle=n,h.fill();const E=new Image;(a||u)&&E.setAttribute("crossOrigin",a||"anonymous"),E.src=l;const B=p=>{h.drawImage(p,w,w,f,f)},g=p=>{const d=document.createElement("canvas");d.width=w+f,d.height=w+f;const m=d.getContext("2d");if(!m||!h||(m.drawImage(p,w,w,f,f),_t(h)(w,w,f,f,u),!h))return;const v=h.createPattern(d,"no-repeat");v&&(h.fillStyle=v,h.fill())};return new Promise(p=>{E.onload=()=>{u?g(E):B(E),p(t.toDataURL())}})};function _t(t){return(e,o,r,n,i)=>{const a=Math.min(r,n);return i>a/2&&(i=a/2),t.beginPath(),t.moveTo(e+i,o),t.arcTo(e+r,o,e+r,o+n,i),t.arcTo(e+r,o+n,e,o+n,i),t.arcTo(e,o+n,e,o,i),t.arcTo(e,o,e+r,o,i),t.closePath(),t}}const Se=t=>Pe(t).then(()=>t).then(Le),Ue=Fe({name:"QrCode",props:{value:{type:[String,Array],default:null},options:{type:Object,default:null},width:{type:Number,default:200},logo:{type:[String,Object],default:""},tag:{type:String,default:"canvas",validator:t=>["canvas","img"].includes(t)}},emits:{done:t=>!!t,error:t=>!!t},setup(t,{emit:e}){const o=Ke(null);function r(){return pt(this,null,function*(){try{const{tag:i,value:a,options:s={},width:u,logo:l}=t,f=String(a),w=mt(o);if(!w)return;if(i==="canvas"){const c=yield Se({canvas:w,width:u,logo:l,content:f,options:s||{}});e("done",{url:c,ctx:w.getContext("2d")});return}if(i==="img"){const c=yield Te(f,zt({errorCorrectionLevel:"H",width:u},s));mt(o).src=c,e("done",{url:c})}}catch(i){e("error",i)}})}function n(i){let a="";const s=mt(o);s instanceof HTMLCanvasElement?a=s.toDataURL():s instanceof HTMLImageElement&&(a=s.src),a&&Ze({url:a,fileName:i})}return Je(r),Ye(t,()=>{r()},{deep:!0}),{wrapRef:o,download:n}}});function xe(t,e,o,r,n,i){return Ft(),Ve("div",null,[(Ft(),je(Qe(t.tag),{ref:"wrapRef"},null,512))])}let Dt;Dt=Oe(Ue,[["render",xe]]),Kt=qe(Dt)}));export{Kt as Q,We as __tla};