var bt=(r,o,i)=>new Promise((e,t)=>{var n=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?e(u.value):Promise.resolve(u.value).then(n,s);a((i=i.apply(r,o)).next())});import{b0 as ge,a$ as Y,b1 as he,bf as me}from"./bootstrap-DToyB3NB.js";import{$ as we,bJ as Ce,a5 as ye,Y as Ee,bK as pe,a4 as oe,P as Be,av as Re,ab as ie,x as Mt,aD as j,ac as x,a8 as tt,ai as O,aj as $,a7 as U,aa as Ae}from"../jse/index-index-DT9LOzen.js";import{T as Te}from"./auth-title-Diu1viqg.js";var z={},et,St;function Ne(){return St||(St=1,et=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then}),et}var nt={},D={},Lt;function k(){if(Lt)return D;Lt=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 D.getSymbolSize=function(e){if(!e)throw new Error('"version" cannot be null or undefined');if(e<1||e>40)throw new Error('"version" should be in range from 1 to 40');return e*4+17},D.getSymbolTotalCodewords=function(e){return o[e]},D.getBCHDigit=function(i){let e=0;for(;i!==0;)e++,i>>>=1;return e},D.setToSJISFunction=function(e){if(typeof e!="function")throw new Error('"toSJISFunc" is not a valid function.');r=e},D.isKanjiModeEnabled=function(){return typeof r!="undefined"},D.toSJIS=function(e){return r(e)},D}var rt={},_t;function Tt(){return _t||(_t=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(e){return e&&typeof e.bit!="undefined"&&e.bit>=0&&e.bit<4},r.from=function(e,t){if(r.isValid(e))return e;try{return o(e)}catch(n){return t}}}(rt)),rt}var ot,vt;function Pe(){if(vt)return ot;vt=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 e=0;e>>i-e-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++}},ot=r,ot}var it,qt;function Ie(){if(qt)return it;qt=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,e,t){const n=o*this.size+i;this.data[n]=e,t&&(this.reservedBit[n]=!0)},r.prototype.get=function(o,i){return this.data[o*this.size+i]},r.prototype.xor=function(o,i,e){this.data[o*this.size+i]^=e},r.prototype.isReserved=function(o,i){return this.reservedBit[o*this.size+i]},it=r,it}var st={},Dt;function be(){return Dt||(Dt=1,function(r){const o=k().getSymbolSize;r.getRowColCoords=function(e){if(e===1)return[];const t=Math.floor(e/7)+2,n=o(e),s=n===145?26:Math.ceil((n-13)/(2*t-2))*2,a=[n-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 n=t.size;let s=0,a=0,u=0,c=null,d=null;for(let p=0;p=5&&(s+=o.N1+(a-5)),c=l,a=1),l=t.get(h,p),l===d?u++:(u>=5&&(s+=o.N1+(u-5)),d=l,u=1)}a>=5&&(s+=o.N1+(a-5)),u>=5&&(s+=o.N1+(u-5))}return s},r.getPenaltyN2=function(t){const n=t.size;let s=0;for(let a=0;a=10&&(a===1488||a===93)&&s++,u=u<<1&2047|t.get(d,c),d>=10&&(u===1488||u===93)&&s++}return s*o.N3},r.getPenaltyN4=function(t){let n=0;const s=t.data.length;for(let u=0;u=0;){const s=n[0];for(let u=0;u0){const a=new Uint8Array(this.degree);return a.set(n,s),a}return n},lt=o,lt}var ft={},dt={},gt={},Kt;function ue(){return Kt||(Kt=1,gt.isValid=function(o){return!isNaN(o)&&o>=1&&o<=40}),gt}var L={},Jt;function ae(){if(Jt)return L;Jt=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 e="(?:(?![A-Z0-9 $%*+\\-./:]|"+i+`)(?:.|[\r ]))+`;L.KANJI=new RegExp(i,"g"),L.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),L.BYTE=new RegExp(e,"g"),L.NUMERIC=new RegExp(r,"g"),L.ALPHANUMERIC=new RegExp(o,"g");const t=new RegExp("^"+i+"$"),n=new RegExp("^"+r+"$"),s=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");return L.testKanji=function(u){return t.test(u)},L.testNumeric=function(u){return n.test(u)},L.testAlphanumeric=function(u){return s.test(u)},L}var Yt;function F(){return Yt||(Yt=1,function(r){const o=ue(),i=ae();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(n,s){if(!n.ccBits)throw new Error("Invalid mode: "+n);if(!o.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?n.ccBits[0]:s<27?n.ccBits[1]:n.ccBits[2]},r.getBestModeForData=function(n){return i.testNumeric(n)?r.NUMERIC:i.testAlphanumeric(n)?r.ALPHANUMERIC:i.testKanji(n)?r.KANJI:r.BYTE},r.toString=function(n){if(n&&n.id)return n.id;throw new Error("Invalid mode")},r.isValid=function(n){return n&&n.bit&&n.ccBits};function e(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(n,s){if(r.isValid(n))return n;try{return e(n)}catch(a){return s}}}(dt)),dt}var jt;function qe(){return jt||(jt=1,function(r){const o=k(),i=se(),e=Tt(),t=F(),n=ue(),s=7973,a=o.getBCHDigit(s);function u(h,l,P){for(let I=1;I<=40;I++)if(l<=r.getCapacity(I,P,h))return I}function c(h,l){return t.getCharCountIndicator(h,l)+4}function d(h,l){let P=0;return h.forEach(function(I){const M=c(I.mode,l);P+=M+I.getBitsLength()}),P}function p(h,l){for(let P=1;P<=40;P++)if(d(h,P)<=r.getCapacity(P,l,t.MIXED))return P}r.from=function(l,P){return n.isValid(l)?parseInt(l,10):P},r.getCapacity=function(l,P,I){if(!n.isValid(l))throw new Error("Invalid QR Code version");typeof I=="undefined"&&(I=t.BYTE);const M=o.getSymbolTotalCodewords(l),A=i.getTotalCodewordsCount(l,P),b=(M-A)*8;if(I===t.MIXED)return b;const T=b-c(I,l);switch(I){case t.NUMERIC:return Math.floor(T/10*3);case t.ALPHANUMERIC:return Math.floor(T/11*2);case t.KANJI:return Math.floor(T/13);case t.BYTE:default:return Math.floor(T/8)}},r.getBestVersionForData=function(l,P){let I;const M=e.from(P,e.M);if(Array.isArray(l)){if(l.length>1)return p(l,M);if(l.length===0)return 1;I=l[0]}else I=l;return u(I.mode,I.getLength(),M)},r.getEncodedBits=function(l){if(!n.isValid(l)||l<7)throw new Error("Invalid QR Code version");let P=l<<12;for(;o.getBCHDigit(P)-a>=0;)P^=s<=0;)u^=o<0&&(n=this.data.substr(t),s=parseInt(n,10),e.put(s,a*3+1))},wt=o,wt}var Ct,Qt;function ke(){if(Qt)return Ct;Qt=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(e){this.mode=r.ALPHANUMERIC,this.data=e}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 n;for(n=0;n+2<=this.data.length;n+=2){let s=o.indexOf(this.data[n])*45;s+=o.indexOf(this.data[n+1]),t.put(s,11)}this.data.length%2&&t.put(o.indexOf(this.data[n]),6)},Ct=i,Ct}var yt,Gt;function Fe(){if(Gt)return yt;Gt=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(e){return e*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 e=0,t=this.data.length;e=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+` Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}},Et=i,Et}var pt={exports:{}},Zt;function ze(){return Zt||(Zt=1,function(r){var o={single_source_shortest_paths:function(i,e,t){var n={},s={};s[e]=0;var a=o.PriorityQueue.make();a.push(e,0);for(var u,c,d,p,h,l,P,I,M;!a.empty();){u=a.pop(),c=u.value,p=u.cost,h=i[c]||{};for(d in h)h.hasOwnProperty(d)&&(l=h[d],P=p+l,I=s[d],M=typeof s[d]=="undefined",(M||I>P)&&(s[d]=P,a.push(d,P),n[d]=c))}if(typeof t!="undefined"&&typeof s[t]=="undefined"){var A=["Could not find a path from ",e," to ",t,"."].join("");throw new Error(A)}return n},extract_shortest_path_from_predecessor_list:function(i,e){for(var t=[],n=e;n;)t.push(n),i[n],n=i[n];return t.reverse(),t},find_path:function(i,e,t){var n=o.single_source_shortest_paths(i,e,t);return o.extract_shortest_path_from_predecessor_list(n,t)},PriorityQueue:{make:function(i){var e=o.PriorityQueue,t={},n;i=i||{};for(n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t.queue=[],t.sorter=i.sorter||e.default_sorter,t},default_sorter:function(i,e){return i.cost-e.cost},push:function(i,e){var t={value:i,cost:e};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}(pt)),pt.exports}var Xt;function He(){return Xt||(Xt=1,function(r){const o=F(),i=Ue(),e=ke(),t=Fe(),n=Ve(),s=ae(),a=k(),u=ze();function c(A){return unescape(encodeURIComponent(A)).length}function d(A,b,T){const B=[];let S;for(;(S=A.exec(T))!==null;)B.push({data:S[0],index:S.index,mode:b,length:S[0].length});return B}function p(A){const b=d(s.NUMERIC,o.NUMERIC,A),T=d(s.ALPHANUMERIC,o.ALPHANUMERIC,A);let B,S;return a.isKanjiModeEnabled()?(B=d(s.BYTE,o.BYTE,A),S=d(s.KANJI,o.KANJI,A)):(B=d(s.BYTE_KANJI,o.BYTE,A),S=[]),b.concat(T,B,S).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,b){switch(b){case o.NUMERIC:return i.getBitsLength(A);case o.ALPHANUMERIC:return e.getBitsLength(A);case o.KANJI:return n.getBitsLength(A);case o.BYTE:return t.getBitsLength(A)}}function l(A){return A.reduce(function(b,T){const B=b.length-1>=0?b[b.length-1]:null;return B&&B.mode===T.mode?(b[b.length-1].data+=T.data,b):(b.push(T),b)},[])}function P(A){const b=[];for(let T=0;T=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 P(g){const y=g.size;for(let C=8;C>w&1)===1,g.set(R,m,E,!0),g.set(m,R,E,!0)}function A(g,y,C){const f=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(f-15+m,8,E,!0),m<8?g.set(8,f-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(f-8,8,1,!0)}function b(g,y){const C=g.size;let f=-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 q=!1;E>>m&1)===1),g.set(R,w-N,q),m--,m===-1&&(E++,m=7)}if(R+=f,R<0||C<=R){R-=f,f=-f;break}}}function T(g,y,C){const f=new i;C.forEach(function(N){f.put(N.mode.bit,4),f.put(N.getLength(),p.getCharCountIndicator(N.mode,g)),N.write(f)});const R=r.getSymbolTotalCodewords(g),m=a.getTotalCodewordsCount(g,y),E=(R-m)*8;for(f.getLengthInBits()+4<=E&&f.put(0,4);f.getLengthInBits()%8!==0;)f.putBit(0);const w=(E-f.getLengthInBits())/8;for(let N=0;N=7&&M(N,y),b(N,E),isNaN(f)&&(f=s.getBestMask(N,A.bind(null,N,C))),s.applyMask(f,N),A(N,C,f),{modules:N,version:y,errorCorrectionLevel:C,maskPattern:f,segments:R}}return nt.create=function(y,C){if(typeof y=="undefined"||y==="")throw new Error("No input text");let f=o.M,R,m;return typeof C!="undefined"&&(f=o.from(C.errorCorrectionLevel,o.M),R=c.from(C.version),m=s.from(C.maskPattern),C.toSJISFunc&&r.setToSJISFunction(C.toSJISFunc)),S(y,R,f,m)},nt}var Bt={},Rt={},te;function ce(){return te||(te=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 e=i.slice().replace("#","").split("");if(e.length<3||e.length===5||e.length>8)throw new Error("Invalid hex color: "+i);(e.length===3||e.length===4)&&(e=Array.prototype.concat.apply([],e.map(function(n){return[n,n]}))),e.length===6&&e.push("F","F");const t=parseInt(e.join(""),16);return{r:t>>24&255,g:t>>16&255,b:t>>8&255,a:t&255,hex:"#"+e.slice(0,6).join("")}}r.getOptions=function(e){e||(e={}),e.color||(e.color={});const t=typeof e.margin=="undefined"||e.margin===null||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,s=e.scale||4;return{width:n,scale:n?4:s,margin:t,color:{dark:o(e.color.dark||"#000000ff"),light:o(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},r.getScale=function(e,t){return t.width&&t.width>=e+t.margin*2?t.width/(e+t.margin*2):t.scale},r.getImageWidth=function(e,t){const n=r.getScale(e,t);return Math.floor((e+t.margin*2)*n)},r.qrToImageData=function(e,t,n){const s=t.modules.size,a=t.modules.data,u=r.getScale(s,n),c=Math.floor((s+n.margin*2)*u),d=n.margin*u,p=[n.color.light,n.color.dark];for(let h=0;h=d&&l>=d&&h0&&h>0&&t[p-1]||(a+=c?i("M",h+s,.5+l+s):i("m",u,0),u=0,c=!1),h+1':"",l="',P='viewBox="0 0 '+p+" "+p+'"',M=''+h+l+` `;return typeof a=="function"&&a(null,M),M},At}var re;function je(){if(re)return z;re=1;const r=Ne(),o=Ke(),i=Je(),e=Ye();function t(n,s,a,u,c){const d=[].slice.call(arguments,1),p=d.length,h=typeof d[p-1]=="function";if(!h&&!r())throw new Error("Callback required as last argument");if(h){if(p<2)throw new Error("Too few arguments provided");p===2?(c=a,a=s,s=u=void 0):p===3&&(s.getContext&&typeof c=="undefined"?(c=u,u=void 0):(c=u,u=a,a=s,s=void 0))}else{if(p<1)throw new Error("Too few arguments provided");return p===1?(a=s,s=u=void 0):p===2&&!s.getContext&&(u=a,a=s,s=void 0),new Promise(function(l,P){try{const I=o.create(a,u);l(n(I,s,u))}catch(I){P(I)}})}try{const l=o.create(a,u);c(null,n(l,s,u))}catch(l){c(l)}}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(n,s,a){return e.render(n,a)}),z}var Oe=je();const $e=we(Oe);function Qe(r,o){const i=Ce(r),e=ye("");return Ee(i,t=>bt(null,null,function*(){i.value&&pe&&(e.value=yield $e.toDataURL(t,o))}),{immediate:!0}),e}const Ge={class:"text-muted-foreground"},We={class:"flex-col-center mt-6"},Ze=["src"],Xe={class:"text-muted-foreground mt-4 text-sm"},xe=oe({name:"AuthenticationQrCodeLogin",__name:"qrcode-login",props:{loading:{type:Boolean,default:!1},loginPath:{default:"/auth/login"},title:{default:""},subTitle:{default:""},submitButtonText:{default:""},description:{default:""}},setup(r){const o=r,i=ge(),e=Be("https://vben.vvbin.cn"),t=Qe(e,{errorCorrectionLevel:"H",margin:4});function n(){i.push(o.loginPath)}return(s,a)=>(ie(),Re("div",null,[Mt(Te,null,{desc:x(()=>[j("span",Ge,[tt(s.$slots,"subTitle",{},()=>[O($(s.subTitle||U(Y)("authentication.qrcodeSubtitle")),1)])])]),default:x(()=>[tt(s.$slots,"title",{},()=>[O($(s.title||U(Y)("authentication.welcomeBack"))+" 📱 ",1)])]),_:3}),j("div",We,[j("img",{src:U(t),alt:"qrcode",class:"w-1/2"},null,8,Ze),j("p",Xe,[tt(s.$slots,"description",{},()=>[O($(s.description||U(Y)("authentication.qrcodePrompt")),1)])])]),Mt(U(he),{class:"mt-4 w-full",variant:"outline",onClick:a[0]||(a[0]=u=>n())},{default:x(()=>[O($(U(Y)("common.back")),1)]),_:1})]))}}),on=oe({name:"QrCodeLogin",__name:"qrcode-login",setup(r){return(o,i)=>(ie(),Ae(U(xe),{"login-path":U(me)},null,8,["login-path"]))}});export{on as default};