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.
evshop_api/public/adm/assets/qrcode.vue.esm-bb08dbc7.js

7 lines
24 KiB

import{m as ve,_ as he,E as V,n as Te,o as ze,c as Be,x as Oe,q as ce}from"./axios-af3cbc8d.js";import{t as ae,i as me,n as Ie,p as ke,j as G,f as Le,U as be}from"./el-button-858ad767.js";import{a6 as Fe,ai as De,b as x,i as ne,d as L,j as re,u as X,m as y,F as U,E as oe,o as pe,v as ge,n as Ee,e as k,f as Ue,W as q,c as Y,s as se,a2 as ie,y as P,p as $e,r as Ce,K as Qe,k as He,a3 as Ke,aE as fe,q as Ye,aB as Ve,G as Ge,S as We,J as xe,h as Xe,P as qe,Y as K}from"./index-0e6d4bc2.js";import{f as D}from"./order-e39e1edf.js";import{f as Je}from"./vnode-387d5d97.js";const Ze=(o,c,d)=>Je(o.subTree).filter(l=>{var n;return De(l)&&((n=l.type)==null?void 0:n.name)===c&&!!l.component}).map(l=>l.component.uid).map(l=>d[l]).filter(l=>!!l),je=(o,c)=>{const d={},f=Fe([]);return{children:f,addChild:n=>{d[n.uid]=n,f.value=Ze(o,c,d)},removeChild:n=>{delete d[n],f.value=f.value.filter(e=>e.uid!==n)}}},J=Symbol("tabsRootContextKey"),et=x({tabs:{type:ne(Array),default:()=>ve([])}}),we="ElTabBar",tt=L({name:we}),at=L({...tt,props:et,setup(o,{expose:c}){const d=o,f=q(),v=re(J);v||ae(we,"<el-tabs><el-tab-bar /></el-tabs>");const l=X("tabs"),n=y(),e=y(),t=()=>{let r=0,s=0;const i=["top","bottom"].includes(v.props.tabPosition)?"width":"height",u=i==="width"?"x":"y",b=u==="x"?"left":"top";return d.tabs.every(E=>{var w,h;const C=(h=(w=f.parent)==null?void 0:w.refs)==null?void 0:h[`tab-${E.uid}`];if(!C)return!1;if(!E.active)return!0;r=C[`offset${D(b)}`],s=C[`client${D(i)}`];const N=window.getComputedStyle(C);return i==="width"&&(d.tabs.length>1&&(s-=Number.parseFloat(N.paddingLeft)+Number.parseFloat(N.paddingRight)),r+=Number.parseFloat(N.paddingLeft)),!1}),{[i]:`${s}px`,transform:`translate${D(u)}(${r}px)`}},a=()=>e.value=t();return U(()=>d.tabs,async()=>{await oe(),a()},{immediate:!0}),me(n,()=>a()),c({ref:n,update:a}),(r,s)=>(pe(),ge("div",{ref_key:"barRef",ref:n,class:Ee([k(l).e("active-bar"),k(l).is(k(v).props.tabPosition)]),style:Ue(e.value)},null,6))}});var nt=he(at,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-bar.vue"]]);const rt=x({panes:{type:ne(Array),default:()=>ve([])},currentName:{type:[String,Number],default:""},editable:Boolean,type:{type:String,values:["card","border-card",""],default:""},stretch:Boolean}),ot={tabClick:(o,c,d)=>d instanceof Event,tabRemove:(o,c)=>c instanceof Event},de="ElTabNav",st=L({name:de,props:rt,emits:ot,setup(o,{expose:c,emit:d}){const f=q(),v=re(J);v||ae(de,"<el-tabs><tab-nav /></el-tabs>");const l=X("tabs"),n=Ie(),e=ke(),t=y(),a=y(),r=y(),s=y(),i=y(!1),u=y(0),b=y(!1),E=y(!0),w=Y(()=>["top","bottom"].includes(v.props.tabPosition)?"width":"height"),h=Y(()=>({transform:`translate${w.value==="width"?"X":"Y"}(-${u.value}px)`})),C=()=>{if(!t.value)return;const p=t.value[`offset${D(w.value)}`],M=u.value;if(!M)return;const m=M>p?M-p:0;u.value=m},N=()=>{if(!t.value||!a.value)return;const p=a.value[`offset${D(w.value)}`],M=t.value[`offset${D(w.value)}`],m=u.value;if(p-m<=M)return;const _=p-m>M*2?m+M:p-M;u.value=_},g=async()=>{const p=a.value;if(!i.value||!r.value||!t.value||!p)return;await oe();const M=r.value.querySelector(".is-active");if(!M)return;const m=t.value,_=["top","bottom"].includes(v.props.tabPosition),R=M.getBoundingClientRect(),S=m.getBoundingClientRect(),z=_?p.offsetWidth-S.width:p.offsetHeight-S.height,B=u.value;let A=B;_?(R.left<S.left&&(A=B-(S.left-R.left)),R.right>S.right&&(A=B+R.right-S.right)):(R.top<S.top&&(A=B-(S.top-R.top)),R.bottom>S.bottom&&(A=B+(R.bottom-S.bottom))),A=Math.max(A,0),u.value=Math.min(A,z)},T=()=>{var p;if(!a.value||!t.value)return;o.stretch&&((p=s.value)==null||p.update());const M=a.value[`offset${D(w.value)}`],m=t.value[`offset${D(w.value)}`],_=u.value;m<M?(i.value=i.value||{},i.value.prev=_,i.value.next=_+m<M,M-_<m&&(u.value=M-m)):(i.value=!1,_>0&&(u.value=0))},F=p=>{const M=p.code,{up:m,down:_,left:R,right:S}=G;if(![m,_,R,S].includes(M))return;const z=Array.from(p.currentTarget.querySelectorAll("[role=tab]:not(.is-disabled)")),B=z.indexOf(p.target);let A;M===R||M===m?B===0?A=z.length-1:A=B-1:B<z.length-1?A=B+1:A=0,z[A].focus({preventScroll:!0}),z[A].click(),O()},O=()=>{E.value&&(b.value=!0)},I=()=>b.value=!1;return U(n,p=>{p==="hidden"?E.value=!1:p==="visible"&&setTimeout(()=>E.value=!0,50)}),U(e,p=>{p?setTimeout(()=>E.value=!0,50):E.value=!1}),me(r,T),se(()=>setTimeout(()=>g(),0)),ie(()=>T()),c({scrollToActiveTab:g,removeFocus:I}),U(()=>o.panes,()=>f.update(),{flush:"post",deep:!0}),()=>{const p=i.value?[P("span",{class:[l.e("nav-prev"),l.is("disabled",!i.value.prev)],onClick:C},[P(V,null,{default:()=>[P(Te,null,null)]})]),P("span",{class:[l.e("nav-next"),l.is("disabled",!i.value.next)],onClick:N},[P(V,null,{default:()=>[P(ze,null,null)]})])]:null,M=o.panes.map((m,_)=>{var R,S,z,B;const A=m.uid,Z=m.props.disabled,j=(S=(R=m.props.name)!=null?R:m.index)!=null?S:`${_}`,ee=!Z&&(m.isClosable||o.editable);m.index=`${_}`;const Se=ee?P(V,{class:"is-icon-close",onClick:$=>d("tabRemove",m,$)},{default:()=>[P(Be,null,null)]}):null,Ae=((B=(z=m.slots).label)==null?void 0:B.call(z))||m.props.label,ye=!Z&&m.active?0:-1;return P("div",{ref:`tab-${A}`,class:[l.e("item"),l.is(v.props.tabPosition),l.is("active",m.active),l.is("disabled",Z),l.is("closable",ee),l.is("focus",b.value)],id:`tab-${j}`,key:`tab-${A}`,"aria-controls":`pane-${j}`,role:"tab","aria-selected":m.active,tabindex:ye,onFocus:()=>O(),onBlur:()=>I(),onClick:$=>{I(),d("tabClick",m,j,$)},onKeydown:$=>{ee&&($.code===G.delete||$.code===G.backspace)&&d("tabRemove",m,$)}},[Ae,Se])});return P("div",{ref:r,class:[l.e("nav-wrap"),l.is("scrollable",!!i.value),l.is(v.props.tabPosition)]},[p,P("div",{class:l.e("nav-scroll"),ref:t},[P("div",{class:[l.e("nav"),l.is(v.props.tabPosition),l.is("stretch",o.stretch&&["top","bottom"].includes(v.props.tabPosition))],ref:a,style:h.value,role:"tablist",onKeydown:F},[o.type?null:P(nt,{ref:s,tabs:[...o.panes]},null),M])])])}}}),it=x({type:{type:String,values:["card","border-card",""],default:""},activeName:{type:[String,Number]},closable:Boolean,addable:Boolean,modelValue:{type:[String,Number]},editable:Boolean,tabPosition:{type:String,values:["top","right","bottom","left"],default:"top"},beforeLeave:{type:ne(Function),default:()=>!0},stretch:Boolean}),te=o=>Qe(o)||He(o),lt={[be]:o=>te(o),tabClick:(o,c)=>c instanceof Event,tabChange:o=>te(o),edit:(o,c)=>["remove","add"].includes(c),tabRemove:o=>te(o),tabAdd:()=>!0};var ut=L({name:"ElTabs",props:it,emits:lt,setup(o,{emit:c,slots:d,expose:f}){var v,l;const n=X("tabs"),{children:e,addChild:t,removeChild:a}=je(q(),"ElTabPane"),r=y(),s=y((l=(v=o.modelValue)!=null?v:o.activeName)!=null?l:"0"),i=h=>{s.value=h,c(be,h),c("tabChange",h)},u=async h=>{var C,N,g;if(!(s.value===h||ce(h)))try{await((C=o.beforeLeave)==null?void 0:C.call(o,h,s.value))!==!1&&(i(h),(g=(N=r.value)==null?void 0:N.removeFocus)==null||g.call(N))}catch{}},b=(h,C,N)=>{h.props.disabled||(u(C),c("tabClick",h,N))},E=(h,C)=>{h.props.disabled||ce(h.props.name)||(C.stopPropagation(),c("edit",h.props.name,"remove"),c("tabRemove",h.props.name))},w=()=>{c("edit",void 0,"add"),c("tabAdd")};return Le({from:'"activeName"',replacement:'"model-value" or "v-model"',scope:"ElTabs",version:"2.3.0",ref:"https://element-plus.org/en-US/component/tabs.html#attributes",type:"Attribute"},Y(()=>!!o.activeName)),U(()=>o.activeName,h=>u(h)),U(()=>o.modelValue,h=>u(h)),U(s,async()=>{var h;await oe(),(h=r.value)==null||h.scrollToActiveTab()}),$e(J,{props:o,currentName:s,registerPane:t,unregisterPane:a}),f({currentName:s}),()=>{const h=o.editable||o.addable?P("span",{class:n.e("new-tab"),tabindex:"0",onClick:w,onKeydown:g=>{g.code===G.enter&&w()}},[P(V,{class:n.is("icon-plus")},{default:()=>[P(Oe,null,null)]})]):null,C=P("div",{class:[n.e("header"),n.is(o.tabPosition)]},[h,P(st,{ref:r,currentName:s.value,editable:o.editable,type:o.type,panes:e.value,stretch:o.stretch,onTabClick:b,onTabRemove:E},null)]),N=P("div",{class:n.e("content")},[Ce(d,"default")]);return P("div",{class:[n.b(),n.m(o.tabPosition),{[n.m("card")]:o.type==="card",[n.m("border-card")]:o.type==="border-card"}]},[...o.tabPosition!=="bottom"?[C,N]:[N,C]])}}});const ct=x({label:{type:String,default:""},name:{type:[String,Number]},closable:Boolean,disabled:Boolean,lazy:Boolean}),ft=["id","aria-hidden","aria-labelledby"],Ne="ElTabPane",dt=L({name:Ne}),vt=L({...dt,props:ct,setup(o){const c=o,d=q(),f=Ke(),v=re(J);v||ae(Ne,"usage: <el-tabs><el-tab-pane /></el-tabs/>");const l=X("tab-pane"),n=y(),e=Y(()=>c.closable||v.props.closable),t=fe(()=>{var u;return v.currentName.value===((u=c.name)!=null?u:n.value)}),a=y(t.value),r=Y(()=>{var u;return(u=c.name)!=null?u:n.value}),s=fe(()=>!c.lazy||a.value||t.value);U(t,u=>{u&&(a.value=!0)});const i=Ye({uid:d.uid,slots:f,props:c,paneName:r,active:t,index:n,isClosable:e});return se(()=>{v.registerPane(i)}),Ve(()=>{v.unregisterPane(i.uid)}),(u,b)=>k(s)?Ge((pe(),ge("div",{key:0,id:`pane-${k(r)}`,class:Ee(k(l).b()),role:"tabpanel","aria-hidden":!k(t),"aria-labelledby":`tab-${k(r)}`},[Ce(u.$slots,"default")],10,ft)),[[We,k(t)]]):xe("v-if",!0)}});var Me=he(vt,[["__file","/home/runner/work/element-plus/element-plus/packages/components/tabs/src/tab-pane.vue"]]);const Mt=Xe(ut,{TabPane:Me}),Pt=qe(Me);const Rt=""+new URL("front-4f5f6873.png",import.meta.url).href,_t=""+new URL("back-807cf0a8.png",import.meta.url).href;/*!
* qrcode.vue v3.4.0
* A Vue.js component to generate QRCode.
* © 2017-2023 @scopewu(https://github.com/scopewu)
* MIT License.
*/var W=function(){return W=Object.assign||function(c){for(var d,f=1,v=arguments.length;f<v;f++){d=arguments[f];for(var l in d)Object.prototype.hasOwnProperty.call(d,l)&&(c[l]=d[l])}return c},W.apply(this,arguments)},Q;(function(o){var c=function(){function n(e,t,a,r){if(this.version=e,this.errorCorrectionLevel=t,this.modules=[],this.isFunction=[],e<n.MIN_VERSION||e>n.MAX_VERSION)throw new RangeError("Version value out of range");if(r<-1||r>7)throw new RangeError("Mask value out of range");this.size=e*4+17;for(var s=[],i=0;i<this.size;i++)s.push(!1);for(var i=0;i<this.size;i++)this.modules.push(s.slice()),this.isFunction.push(s.slice());this.drawFunctionPatterns();var u=this.addEccAndInterleave(a);if(this.drawCodewords(u),r==-1)for(var b=1e9,i=0;i<8;i++){this.applyMask(i),this.drawFormatBits(i);var E=this.getPenaltyScore();E<b&&(r=i,b=E),this.applyMask(i)}v(0<=r&&r<=7),this.mask=r,this.applyMask(r),this.drawFormatBits(r),this.isFunction=[]}return n.encodeText=function(e,t){var a=o.QrSegment.makeSegments(e);return n.encodeSegments(a,t)},n.encodeBinary=function(e,t){var a=o.QrSegment.makeBytes(e);return n.encodeSegments([a],t)},n.encodeSegments=function(e,t,a,r,s,i){if(a===void 0&&(a=1),r===void 0&&(r=40),s===void 0&&(s=-1),i===void 0&&(i=!0),!(n.MIN_VERSION<=a&&a<=r&&r<=n.MAX_VERSION)||s<-1||s>7)throw new RangeError("Invalid value");var u,b;for(u=a;;u++){var E=n.getNumDataCodewords(u,t)*8,w=l.getTotalBits(e,u);if(w<=E){b=w;break}if(u>=r)throw new RangeError("Data too long")}for(var h=0,C=[n.Ecc.MEDIUM,n.Ecc.QUARTILE,n.Ecc.HIGH];h<C.length;h++){var N=C[h];i&&b<=n.getNumDataCodewords(u,N)*8&&(t=N)}for(var g=[],T=0,F=e;T<F.length;T++){var O=F[T];d(O.mode.modeBits,4,g),d(O.numChars,O.mode.numCharCountBits(u),g);for(var I=0,p=O.getData();I<p.length;I++){var M=p[I];g.push(M)}}v(g.length==b);var m=n.getNumDataCodewords(u,t)*8;v(g.length<=m),d(0,Math.min(4,m-g.length),g),d(0,(8-g.length%8)%8,g),v(g.length%8==0);for(var _=236;g.length<m;_^=253)d(_,8,g);for(var R=[];R.length*8<g.length;)R.push(0);return g.forEach(function(S,z){return R[z>>>3]|=S<<7-(z&7)}),new n(u,t,R,s)},n.prototype.getModule=function(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]},n.prototype.getModules=function(){return this.modules},n.prototype.drawFunctionPatterns=function(){for(var e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);for(var t=this.getAlignmentPatternPositions(),a=t.length,e=0;e<a;e++)for(var r=0;r<a;r++)e==0&&r==0||e==0&&r==a-1||e==a-1&&r==0||this.drawAlignmentPattern(t[e],t[r]);this.drawFormatBits(0),this.drawVersion()},n.prototype.drawFormatBits=function(e){for(var t=this.errorCorrectionLevel.formatBits<<3|e,a=t,r=0;r<10;r++)a=a<<1^(a>>>9)*1335;var s=(t<<10|a)^21522;v(s>>>15==0);for(var r=0;r<=5;r++)this.setFunctionModule(8,r,f(s,r));this.setFunctionModule(8,7,f(s,6)),this.setFunctionModule(8,8,f(s,7)),this.setFunctionModule(7,8,f(s,8));for(var r=9;r<15;r++)this.setFunctionModule(14-r,8,f(s,r));for(var r=0;r<8;r++)this.setFunctionModule(this.size-1-r,8,f(s,r));for(var r=8;r<15;r++)this.setFunctionModule(8,this.size-15+r,f(s,r));this.setFunctionModule(8,this.size-8,!0)},n.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,t=0;t<12;t++)e=e<<1^(e>>>11)*7973;var a=this.version<<12|e;v(a>>>18==0);for(var t=0;t<18;t++){var r=f(a,t),s=this.size-11+t%3,i=Math.floor(t/3);this.setFunctionModule(s,i,r),this.setFunctionModule(i,s,r)}}},n.prototype.drawFinderPattern=function(e,t){for(var a=-4;a<=4;a++)for(var r=-4;r<=4;r++){var s=Math.max(Math.abs(r),Math.abs(a)),i=e+r,u=t+a;0<=i&&i<this.size&&0<=u&&u<this.size&&this.setFunctionModule(i,u,s!=2&&s!=4)}},n.prototype.drawAlignmentPattern=function(e,t){for(var a=-2;a<=2;a++)for(var r=-2;r<=2;r++)this.setFunctionModule(e+r,t+a,Math.max(Math.abs(r),Math.abs(a))!=1)},n.prototype.setFunctionModule=function(e,t,a){this.modules[t][e]=a,this.isFunction[t][e]=!0},n.prototype.addEccAndInterleave=function(e){var t=this.version,a=this.errorCorrectionLevel;if(e.length!=n.getNumDataCodewords(t,a))throw new RangeError("Invalid argument");for(var r=n.NUM_ERROR_CORRECTION_BLOCKS[a.ordinal][t],s=n.ECC_CODEWORDS_PER_BLOCK[a.ordinal][t],i=Math.floor(n.getNumRawDataModules(t)/8),u=r-i%r,b=Math.floor(i/r),E=[],w=n.reedSolomonComputeDivisor(s),h=0,C=0;h<r;h++){var N=e.slice(C,C+b-s+(h<u?0:1));C+=N.length;var g=n.reedSolomonComputeRemainder(N,w);h<u&&N.push(0),E.push(N.concat(g))}for(var T=[],F=function(O){E.forEach(function(I,p){(O!=b-s||p>=u)&&T.push(I[O])})},h=0;h<E[0].length;h++)F(h);return v(T.length==i),T},n.prototype.drawCodewords=function(e){if(e.length!=Math.floor(n.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");for(var t=0,a=this.size-1;a>=1;a-=2){a==6&&(a=5);for(var r=0;r<this.size;r++)for(var s=0;s<2;s++){var i=a-s,u=(a+1&2)==0,b=u?this.size-1-r:r;!this.isFunction[b][i]&&t<e.length*8&&(this.modules[b][i]=f(e[t>>>3],7-(t&7)),t++)}}v(t==e.length*8)},n.prototype.applyMask=function(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(var t=0;t<this.size;t++)for(var a=0;a<this.size;a++){var r=void 0;switch(e){case 0:r=(a+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=a%3==0;break;case 3:r=(a+t)%3==0;break;case 4:r=(Math.floor(a/3)+Math.floor(t/2))%2==0;break;case 5:r=a*t%2+a*t%3==0;break;case 6:r=(a*t%2+a*t%3)%2==0;break;case 7:r=((a+t)%2+a*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][a]&&r&&(this.modules[t][a]=!this.modules[t][a])}},n.prototype.getPenaltyScore=function(){for(var e=0,t=0;t<this.size;t++){for(var a=!1,r=0,s=[0,0,0,0,0,0,0],i=0;i<this.size;i++)this.modules[t][i]==a?(r++,r==5?e+=n.PENALTY_N1:r>5&&e++):(this.finderPenaltyAddHistory(r,s),a||(e+=this.finderPenaltyCountPatterns(s)*n.PENALTY_N3),a=this.modules[t][i],r=1);e+=this.finderPenaltyTerminateAndCount(a,r,s)*n.PENALTY_N3}for(var i=0;i<this.size;i++){for(var a=!1,u=0,s=[0,0,0,0,0,0,0],t=0;t<this.size;t++)this.modules[t][i]==a?(u++,u==5?e+=n.PENALTY_N1:u>5&&e++):(this.finderPenaltyAddHistory(u,s),a||(e+=this.finderPenaltyCountPatterns(s)*n.PENALTY_N3),a=this.modules[t][i],u=1);e+=this.finderPenaltyTerminateAndCount(a,u,s)*n.PENALTY_N3}for(var t=0;t<this.size-1;t++)for(var i=0;i<this.size-1;i++){var b=this.modules[t][i];b==this.modules[t][i+1]&&b==this.modules[t+1][i]&&b==this.modules[t+1][i+1]&&(e+=n.PENALTY_N2)}for(var E=0,w=0,h=this.modules;w<h.length;w++){var C=h[w];E=C.reduce(function(T,F){return T+(F?1:0)},E)}var N=this.size*this.size,g=Math.ceil(Math.abs(E*20-N*10)/N)-1;return v(0<=g&&g<=9),e+=g*n.PENALTY_N4,v(0<=e&&e<=2568888),e},n.prototype.getAlignmentPatternPositions=function(){if(this.version==1)return[];for(var e=Math.floor(this.version/7)+2,t=this.version==32?26:Math.ceil((this.version*4+4)/(e*2-2))*2,a=[6],r=this.size-7;a.length<e;r-=t)a.splice(1,0,r);return a},n.getNumRawDataModules=function(e){if(e<n.MIN_VERSION||e>n.MAX_VERSION)throw new RangeError("Version number out of range");var t=(16*e+128)*e+64;if(e>=2){var a=Math.floor(e/7)+2;t-=(25*a-10)*a-55,e>=7&&(t-=36)}return v(208<=t&&t<=29648),t},n.getNumDataCodewords=function(e,t){return Math.floor(n.getNumRawDataModules(e)/8)-n.ECC_CODEWORDS_PER_BLOCK[t.ordinal][e]*n.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][e]},n.reedSolomonComputeDivisor=function(e){if(e<1||e>255)throw new RangeError("Degree out of range");for(var t=[],a=0;a<e-1;a++)t.push(0);t.push(1);for(var r=1,a=0;a<e;a++){for(var s=0;s<t.length;s++)t[s]=n.reedSolomonMultiply(t[s],r),s+1<t.length&&(t[s]^=t[s+1]);r=n.reedSolomonMultiply(r,2)}return t},n.reedSolomonComputeRemainder=function(e,t){for(var a=t.map(function(b){return 0}),r=function(b){var E=b^a.shift();a.push(0),t.forEach(function(w,h){return a[h]^=n.reedSolomonMultiply(w,E)})},s=0,i=e;s<i.length;s++){var u=i[s];r(u)}return a},n.reedSolomonMultiply=function(e,t){if(e>>>8||t>>>8)throw new RangeError("Byte out of range");for(var a=0,r=7;r>=0;r--)a=a<<1^(a>>>7)*285,a^=(t>>>r&1)*e;return v(a>>>8==0),a},n.prototype.finderPenaltyCountPatterns=function(e){var t=e[1];v(t<=this.size*3);var a=t>0&&e[2]==t&&e[3]==t*3&&e[4]==t&&e[5]==t;return(a&&e[0]>=t*4&&e[6]>=t?1:0)+(a&&e[6]>=t*4&&e[0]>=t?1:0)},n.prototype.finderPenaltyTerminateAndCount=function(e,t,a){return e&&(this.finderPenaltyAddHistory(t,a),t=0),t+=this.size,this.finderPenaltyAddHistory(t,a),this.finderPenaltyCountPatterns(a)},n.prototype.finderPenaltyAddHistory=function(e,t){t[0]==0&&(e+=this.size),t.pop(),t.unshift(e)},n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],n}();o.QrCode=c;function d(n,e,t){if(e<0||e>31||n>>>e)throw new RangeError("Value out of range");for(var a=e-1;a>=0;a--)t.push(n>>>a&1)}function f(n,e){return(n>>>e&1)!=0}function v(n){if(!n)throw new Error("Assertion error")}var l=function(){function n(e,t,a){if(this.mode=e,this.numChars=t,this.bitData=a,t<0)throw new RangeError("Invalid argument");this.bitData=a.slice()}return n.makeBytes=function(e){for(var t=[],a=0,r=e;a<r.length;a++){var s=r[a];d(s,8,t)}return new n(n.Mode.BYTE,e.length,t)},n.makeNumeric=function(e){if(!n.isNumeric(e))throw new RangeError("String contains non-numeric characters");for(var t=[],a=0;a<e.length;){var r=Math.min(e.length-a,3);d(parseInt(e.substring(a,a+r),10),r*3+1,t),a+=r}return new n(n.Mode.NUMERIC,e.length,t)},n.makeAlphanumeric=function(e){if(!n.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");var t=[],a;for(a=0;a+2<=e.length;a+=2){var r=n.ALPHANUMERIC_CHARSET.indexOf(e.charAt(a))*45;r+=n.ALPHANUMERIC_CHARSET.indexOf(e.charAt(a+1)),d(r,11,t)}return a<e.length&&d(n.ALPHANUMERIC_CHARSET.indexOf(e.charAt(a)),6,t),new n(n.Mode.ALPHANUMERIC,e.length,t)},n.makeSegments=function(e){return e==""?[]:n.isNumeric(e)?[n.makeNumeric(e)]:n.isAlphanumeric(e)?[n.makeAlphanumeric(e)]:[n.makeBytes(n.toUtf8ByteArray(e))]},n.makeEci=function(e){var t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<1<<7)d(e,8,t);else if(e<1<<14)d(2,2,t),d(e,14,t);else if(e<1e6)d(6,3,t),d(e,21,t);else throw new RangeError("ECI assignment value out of range");return new n(n.Mode.ECI,0,t)},n.isNumeric=function(e){return n.NUMERIC_REGEX.test(e)},n.isAlphanumeric=function(e){return n.ALPHANUMERIC_REGEX.test(e)},n.prototype.getData=function(){return this.bitData.slice()},n.getTotalBits=function(e,t){for(var a=0,r=0,s=e;r<s.length;r++){var i=s[r],u=i.mode.numCharCountBits(t);if(i.numChars>=1<<u)return 1/0;a+=4+u+i.bitData.length}return a},n.toUtf8ByteArray=function(e){e=encodeURI(e);for(var t=[],a=0;a<e.length;a++)e.charAt(a)!="%"?t.push(e.charCodeAt(a)):(t.push(parseInt(e.substring(a+1,a+3),16)),a+=2);return t},n.NUMERIC_REGEX=/^[0-9]*$/,n.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,n.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",n}();o.QrSegment=l})(Q||(Q={}));(function(o){(function(c){var d=function(){function f(v,l){this.ordinal=v,this.formatBits=l}return f.LOW=new f(0,1),f.MEDIUM=new f(1,0),f.QUARTILE=new f(2,3),f.HIGH=new f(3,2),f}();c.Ecc=d})(o.QrCode||(o.QrCode={}))})(Q||(Q={}));(function(o){(function(c){var d=function(){function f(v,l){this.modeBits=v,this.numBitsCharCount=l}return f.prototype.numCharCountBits=function(v){return this.numBitsCharCount[Math.floor((v+7)/17)]},f.NUMERIC=new f(1,[10,12,14]),f.ALPHANUMERIC=new f(2,[9,11,13]),f.BYTE=new f(4,[8,16,16]),f.KANJI=new f(8,[8,10,12]),f.ECI=new f(7,[0,0,0]),f}();c.Mode=d})(o.QrSegment||(o.QrSegment={}))})(Q||(Q={}));var H=Q,Pe="H",le={L:H.QrCode.Ecc.LOW,M:H.QrCode.Ecc.MEDIUM,Q:H.QrCode.Ecc.QUARTILE,H:H.QrCode.Ecc.HIGH},ht=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function Re(o){return o in le}function _e(o,c){c===void 0&&(c=0);var d=[];return o.forEach(function(f,v){var l=null;f.forEach(function(n,e){if(!n&&l!==null){d.push("M".concat(l+c," ").concat(v+c,"h").concat(e-l,"v1H").concat(l+c,"z")),l=null;return}if(e===f.length-1){if(!n)return;l===null?d.push("M".concat(e+c,",").concat(v+c," h1v1H").concat(e+c,"z")):d.push("M".concat(l+c,",").concat(v+c," h").concat(e+1-l,"v1H").concat(l+c,"z"));return}n&&l===null&&(l=e)})}),d.join("")}var ue={value:{type:String,required:!0,default:""},size:{type:Number,default:100},level:{type:String,default:Pe,validator:function(o){return Re(o)}},background:{type:String,default:"#fff"},foreground:{type:String,default:"#000"},margin:{type:Number,required:!1,default:0}},mt=W(W({},ue),{renderAs:{type:String,required:!1,default:"canvas",validator:function(o){return["canvas","svg"].indexOf(o)>-1}}}),bt=L({name:"QRCodeSvg",props:ue,setup:function(o){var c=y(0),d=y(""),f=function(){var v=o.value,l=o.level,n=o.margin,e=H.QrCode.encodeText(v,le[l]).getModules();c.value=e.length+n*2,d.value=_e(e,n)};return f(),ie(f),function(){return K("svg",{width:o.size,height:o.size,"shape-rendering":"crispEdges",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(c.value," ").concat(c.value)},[K("path",{fill:o.background,d:"M0,0 h".concat(c.value,"v").concat(c.value,"H0z")}),K("path",{fill:o.foreground,d:d.value})])}}}),pt=L({name:"QRCodeCanvas",props:ue,setup:function(o){var c=y(null),d=function(){var f=o.value,v=o.level,l=o.size,n=o.margin,e=o.background,t=o.foreground,a=c.value;if(a){var r=a.getContext("2d");if(r){var s=H.QrCode.encodeText(f,le[v]).getModules(),i=s.length+n*2,u=window.devicePixelRatio||1,b=l/i*u;a.height=a.width=l*u,r.scale(b,b),r.fillStyle=e,r.fillRect(0,0,i,i),r.fillStyle=t,ht?r.fill(new Path2D(_e(s,n))):s.forEach(function(E,w){E.forEach(function(h,C){h&&r.fillRect(C+n,w+n,1,1)})})}}};return se(d),ie(d),function(){return K("canvas",{ref:c,style:{width:"".concat(o.size,"px"),height:"".concat(o.size,"px")}})}}}),St=L({name:"Qrcode",render:function(){var o=this.$props,c=o.renderAs,d=o.value,f=o.size,v=o.margin,l=o.level,n=o.background,e=o.foreground,t=f>>>0,a=v>>>0,r=Re(l)?l:Pe;return K(c==="svg"?bt:pt,{value:d,size:t,margin:a,level:r,background:n,foreground:e})},props:mt});export{Pt as E,St as Q,Rt as _,_t as a,Mt as b};