var le=Object.defineProperty;var At=Object.getOwnPropertySymbols;var fe=Object.prototype.hasOwnProperty,de=Object.prototype.propertyIsEnumerable;var Tt=(r,o,i)=>o in r?le(r,o,{enumerable:!0,configurable:!0,writable:!0,value:i}):r[o]=i,It=(r,o)=>{for(var i in o||(o={}))fe.call(o,i)&&Tt(r,i,o[i]);if(At)for(var i of At(o))de.call(o,i)&&Tt(r,i,o[i]);return r};var St=(r,o,i)=>new Promise((n,t)=>{var e=u=>{try{a(i.next(u))}catch(c){t(c)}},s=u=>{try{a(i.throw(u))}catch(c){t(c)}},a=u=>u.done?n(u.value):Promise.resolve(u.value).then(e,s);a((i=i.apply(r,o)).next())});import{Q as ge,a as he,w as me}from"./index-BFfnEkVs.js";import{d as we,f as Ce,u as $,o as Ee,w as ye,aq as pe,ar as Mt,aB as Be,aQ as Re}from"./vue-vendor-Be68asQ6.js";import{a as on,h as Ae}from"./antd-vue-vendor-DcqS7Wvq.js";import{downloadByUrl as Te}from"./download-CjoX0_mR.js";var z={},W,Pt;function Ie(){return Pt||(Pt=1,W=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),W}var X={},_={},Nt;function U(){if(Nt)return _;Nt=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 _.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},_.getSymbolTotalCodewords=function(n){return o[n]},_.getBCHDigit=function(i){let n=0;for(;i!==0;)n++,i>>>=1;return n},_.setToSJISFunction=function(n){if(typeof n!="function")throw new Error('"toSJISFunc" is not a valid function.');r=n},_.isKanjiModeEnabled=function(){return typeof r!="undefined"},_.toSJIS=function(n){return r(n)},_}var Z={},bt;function Et(){return bt||(bt=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!="undefined"&&n.bit>=0&&n.bit<4},r.from=function(n,t){if(r.isValid(n))return n;try{return o(n)}catch(e){return t}}}(Z)),Z}var x,Lt;function Se(){if(Lt)return x;Lt=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-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++}},x=r,x}var tt,vt;function Me(){if(vt)return tt;vt=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]},tt=r,tt}var et={},Dt;function Pe(){return Dt||(Dt=1,function(r){const o=U().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=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,l=null;for(let d=0;d=5&&(s+=o.N1+(a-5)),c=f,a=1),f=t.get(g,d),f===l?u++:(u>=5&&(s+=o.N1+(u-5)),l=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=10&&(a===1488||a===93)&&s++,u=u<<1&2047|t.get(l,c),l>=10&&(u===1488||u===93)&&s++}return s*o.N3},r.getPenaltyN4=function(t){let e=0;const s=t.data.length;for(let u=0;u=0;){const s=e[0];for(let u=0;u0){const a=new Uint8Array(this.degree);return a.set(e,s),a}return e},it=o,it}var st={},ut={},at={},Vt;function oe(){return Vt||(Vt=1,at.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40}),at}var L={},Ht;function ie(){if(Ht)return L;Ht=1;const r="[0-9]+",o="[A-Z $%*+\\-./:]+";let i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";i=i.replace(/u/g,"\\u");const n="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r ]))+`;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 Kt;function F(){return Kt||(Kt=1,function(r){const o=oe(),i=ie();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(a){return s}}}(ut)),ut}var Jt;function qe(){return Jt||(Jt=1,function(r){const o=U(),i=re(),n=Et(),t=F(),e=oe(),s=7973,a=o.getBCHDigit(s);function u(g,f,w){for(let S=1;S<=40;S++)if(f<=r.getCapacity(S,w,g))return S}function c(g,f){return t.getCharCountIndicator(g,f)+4}function l(g,f){let w=0;return g.forEach(function(S){const N=c(S.mode,f);w+=N+S.getBitsLength()}),w}function d(g,f){for(let w=1;w<=40;w++)if(l(g,w)<=r.getCapacity(w,f,t.MIXED))return w}r.from=function(f,w){return e.isValid(f)?parseInt(f,10):w},r.getCapacity=function(f,w,S){if(!e.isValid(f))throw new Error("Invalid QR Code version");typeof S=="undefined"&&(S=t.BYTE);const N=o.getSymbolTotalCodewords(f),T=i.getTotalCodewordsCount(f,w),M=(N-T)*8;if(S===t.MIXED)return M;const p=M-c(S,f);switch(S){case t.NUMERIC:return Math.floor(p/10*3);case t.ALPHANUMERIC:return Math.floor(p/11*2);case t.KANJI:return Math.floor(p/13);case t.BYTE:default:return Math.floor(p/8)}},r.getBestVersionForData=function(f,w){let S;const N=n.from(w,n.M);if(Array.isArray(f)){if(f.length>1)return d(f,N);if(f.length===0)return 1;S=f[0]}else S=f;return u(S.mode,S.getLength(),N)},r.getEncodedBits=function(f){if(!e.isValid(f)||f<7)throw new Error("Invalid QR Code version");let w=f<<12;for(;o.getBCHDigit(w)-a>=0;)w^=s<=0;)u^=o<0&&(e=this.data.substr(t),s=parseInt(e,10),n.put(s,a*3+1))},ft=o,ft}var dt,Yt;function Fe(){if(Yt)return dt;Yt=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.prototype.write=function(t){let e;for(e=0;e+2<=this.data.length;e+=2){let s=o.indexOf(this.data[e])*45;s+=o.indexOf(this.data[e+1]),t.put(s,11)}this.data.length%2&&t.put(o.indexOf(this.data[e]),6)},dt=i,dt}var gt,Qt;function ke(){if(Qt)return gt;Qt=1;const r=F();function o(i){this.mode=r.BYTE,typeof i=="string"?this.data=new TextEncoder().encode(i):this.data=new Uint8Array(i)}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(i){for(let n=0,t=this.data.length;n=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)}},ht=i,ht}var O={exports:{}},un=O.exports,$t;function Ve(){return $t||($t=1,function(r){"use strict";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,l,d,g,f,w,S,N;!a.empty();){u=a.pop(),c=u.value,d=u.cost,g=i[c]||{};for(l in g)g.hasOwnProperty(l)&&(f=g[l],w=d+f,S=s[l],N=typeof s[l]=="undefined",(N||S>w)&&(s[l]=w,a.push(l,w),e[l]=c))}if(typeof t!="undefined"&&typeof s[t]=="undefined"){var T=["Could not find a path from ",n," to ",t,"."].join("");throw new Error(T)}return e},extract_shortest_path_from_predecessor_list:function(i,n){for(var t=[],e=n,s;e;)t.push(e),s=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}(O)),O.exports}var Wt;function He(){return Wt||(Wt=1,function(r){const o=F(),i=Ue(),n=Fe(),t=ke(),e=ze(),s=ie(),a=U(),u=Ve();function c(T){return unescape(encodeURIComponent(T)).length}function l(T,M,p){const B=[];let b;for(;(b=T.exec(p))!==null;)B.push({data:b[0],index:b.index,mode:M,length:b[0].length});return B}function d(T){const M=l(s.NUMERIC,o.NUMERIC,T),p=l(s.ALPHANUMERIC,o.ALPHANUMERIC,T);let B,b;return a.isKanjiModeEnabled()?(B=l(s.BYTE,o.BYTE,T),b=l(s.KANJI,o.KANJI,T)):(B=l(s.BYTE_KANJI,o.BYTE,T),b=[]),M.concat(p,B,b).sort(function(R,y){return R.index-y.index}).map(function(R){return{data:R.data,mode:R.mode,length:R.length}})}function g(T,M){switch(M){case o.NUMERIC:return i.getBitsLength(T);case o.ALPHANUMERIC:return n.getBitsLength(T);case o.KANJI:return e.getBitsLength(T);case o.BYTE:return t.getBitsLength(T)}}function f(T){return T.reduce(function(M,p){const B=M.length-1>=0?M[M.length-1]:null;return B&&B.mode===p.mode?(M[M.length-1].data+=p.data,M):(M.push(p),M)},[])}function w(T){const M=[];for(let p=0;p=0&&E<=6&&(P===0||P===6)||P>=0&&P<=6&&(E===0||E===6)||E>=2&&E<=4&&P>=2&&P<=4?m.set(C+E,A+P,!0,!0):m.set(C+E,A+P,!1,!0))}}function w(m){const R=m.size;for(let y=8;y>E&1)===1,m.set(I,C,A,!0),m.set(C,I,A,!0)}function T(m,R,y){const h=m.size,I=l.getEncodedBits(R,y);let C,A;for(C=0;C<15;C++)A=(I>>C&1)===1,C<6?m.set(C,8,A,!0):C<8?m.set(C+1,8,A,!0):m.set(h-15+C,8,A,!0),C<8?m.set(8,h-C-1,A,!0):C<9?m.set(8,15-C-1+1,A,!0):m.set(8,15-C-1,A,!0);m.set(h-8,8,1,!0)}function M(m,R){const y=m.size;let h=-1,I=y-1,C=7,A=0;for(let E=y-1;E>0;E-=2)for(E===6&&E--;;){for(let P=0;P<2;P++)if(!m.isReserved(I,E-P)){let q=!1;A>>C&1)===1),m.set(I,E-P,q),C--,C===-1&&(A++,C=7)}if(I+=h,I<0||y<=I){I-=h,h=-h;break}}}function p(m,R,y){const h=new i;y.forEach(function(P){h.put(P.mode.bit,4),h.put(P.getLength(),d.getCharCountIndicator(P.mode,m)),P.write(h)});const I=r.getSymbolTotalCodewords(m),C=a.getTotalCodewordsCount(m,R),A=(I-C)*8;for(h.getLengthInBits()+4<=A&&h.put(0,4);h.getLengthInBits()%8!==0;)h.putBit(0);const E=(A-h.getLengthInBits())/8;for(let P=0;P=7&&N(P,R),M(P,A),isNaN(h)&&(h=s.getBestMask(P,T.bind(null,P,y))),s.applyMask(h,P),T(P,y,h),{modules:P,version:R,errorCorrectionLevel:y,maskPattern:h,segments:I}}return X.create=function(R,y){if(typeof R=="undefined"||R==="")throw new Error("No input text");let h=o.M,I,C;return typeof y!="undefined"&&(h=o.from(y.errorCorrectionLevel,o.M),I=c.from(y.version),C=s.from(y.maskPattern),y.toSJISFunc&&r.setToSJISFunction(y.toSJISFunc)),b(R,I,h,C)},X}var mt={},wt={},Zt;function se(){return Zt||(Zt=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=="undefined"||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),l=e.margin*u,d=[e.color.light,e.color.dark];for(let g=0;g=l&&f>=l&&g0&&g>0&&t[d-1]||(a+=c?i("M",g+s,.5+f+s):i("m",u,0),u=0,c=!1),g+1':"",f="',w='viewBox="0 0 '+d+" "+d+'"',N=''+g+f+` `;return typeof a=="function"&&a(null,N),N},Ct}var ee;function je(){if(ee)return z;ee=1;const r=Ie(),o=Ke(),i=Je(),n=Oe();function t(e,s,a,u,c){const l=[].slice.call(arguments,1),d=l.length,g=typeof l[d-1]=="function";if(!g&&!r())throw new Error("Callback required as last argument");if(g){if(d<2)throw new Error("Too few arguments provided");d===2?(c=a,a=s,s=u=void 0):d===3&&(s.getContext&&typeof c=="undefined"?(c=u,u=void 0):(c=u,u=a,a=s,s=void 0))}else{if(d<1)throw new Error("Too few arguments provided");return d===1?(a=s,s=u=void 0):d===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(f,w){try{const S=o.create(a,u);f(e(S,s,u))}catch(S){w(S)}})}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 yt=je();const Ye=({canvas:r,content:o,width:i=0,options:n={}})=>{const t=Ae(n);return t.errorCorrectionLevel=t.errorCorrectionLevel||Ge(o),Qe(o,t).then(e=>(t.scale=i===0?void 0:i/e*4,yt.toCanvas(r,o,t)))};function Qe(r,o){const i=document.createElement("canvas");return yt.toCanvas(i,r,o).then(()=>i.width)}function Ge(r){return r.length>36?"M":r.length>16?"Q":"H"}const $e=({canvas:r,logo:o})=>{if(!o)return new Promise(M=>{M(r.toDataURL())});const i=r.width,{logoSize:n=.15,bgColor:t="#ffffff",borderSize:e=.05,crossOrigin:s,borderRadius:a=8,logoRadius:u=0}=o,c=ge(o)?o:o.src,l=i*n,d=i*(1-n)/2,g=i*(n+e),f=i*(1-n-e)/2,w=r.getContext("2d");if(!w)return;ne(w)(f,f,g,g,a),w.fillStyle=t,w.fill();const S=new Image;(s||u)&&S.setAttribute("crossOrigin",s||"anonymous"),S.src=c;const N=M=>{w.drawImage(M,d,d,l,l)},T=M=>{const p=document.createElement("canvas");p.width=d+l,p.height=d+l;const B=p.getContext("2d");if(!B||!w||(B.drawImage(M,d,d,l,l),ne(w)(d,d,l,l,u),!w))return;const b=w.createPattern(p,"no-repeat");b&&(w.fillStyle=b,w.fill())};return new Promise(M=>{S.onload=()=>{u?T(S):N(S),M(r.toDataURL())}})};function ne(r){return(o,i,n,t,e)=>{const s=Math.min(n,t);return e>s/2&&(e=s/2),r.beginPath(),r.moveTo(o+e,i),r.arcTo(o+n,i,o+n,i+t,e),r.arcTo(o+n,i+t,o,i+t,e),r.arcTo(o,i+t,o,i,e),r.arcTo(o,i,o+n,i,e),r.closePath(),r}}const We=r=>Ye(r).then(()=>r).then($e),Xe=we({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:r=>["canvas","img"].includes(r)}},emits:{done:r=>!!r,error:r=>!!r},setup(r,{emit:o}){const i=Ce(null);function n(){return St(this,null,function*(){try{const{tag:e,value:s,options:a={},width:u,logo:c}=r,l=String(s),d=$(i);if(l==null||l===""||!d)return;if(e==="canvas"){const g=yield We({canvas:d,width:u,logo:c,content:l,options:a||{}});o("done",{url:g,ctx:d.getContext("2d")});return}if(e==="img"){const g=yield yt.toDataURL(l,It({errorCorrectionLevel:"H",width:u},a));$(i).src=g,o("done",{url:g})}}catch(e){o("error",e)}})}function t(e){let s="";const a=$(i);a instanceof HTMLCanvasElement?s=a.toDataURL():a instanceof HTMLImageElement&&(s=a.src),s&&Te({url:s,fileName:e})}return Ee(n),ye(r,()=>{n()},{deep:!0}),{wrapRef:i,download:t}}});function Ze(r,o,i,n,t,e){return Mt(),pe("div",null,[(Mt(),Be(Re(r.tag),{ref:"wrapRef"},null,512))])}const xe=he(Xe,[["render",Ze]]),an=me(xe);export{an as Q};