Files
filecodebox/themes/2024/assets/clipboard-aAV_Ai6k.js
T
2025-03-16 22:24:17 +08:00

22 lines
20 KiB
Python

import{c as B,d as F,D as R,r as _,E as $,o as V,F as X,G as Z,H as x,u as j}from"./index-DQoikpv-.js";/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oe=B("ClipboardListIcon",[["rect",{width:"8",height:"4",x:"8",y:"2",rx:"1",ry:"1",key:"tgr4d6"}],["path",{d:"M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2",key:"116196"}],["path",{d:"M12 11h4",key:"1jrz19"}],["path",{d:"M12 16h4",key:"n85exb"}],["path",{d:"M8 11h.01",key:"1dfujw"}],["path",{d:"M8 16h.01",key:"18s6g9"}]]);/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ie=B("EyeIcon",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
* @license lucide-vue-next v0.445.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const se=B("ShieldCheckIcon",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/*!
* qrcode.vue v3.6.0
* A Vue.js component to generate QRCode. Both support Vue 2 and Vue 3
* © 2017-PRESENT @scopewu(https://github.com/scopewu)
* MIT License.
*/var A=function(){return A=Object.assign||function(l){for(var c,u=1,f=arguments.length;u<f;u++){c=arguments[u];for(var h in c)Object.prototype.hasOwnProperty.call(c,h)&&(l[h]=c[h])}return l},A.apply(this,arguments)};var b;(function(o){var l=function(){function a(e,r,t,n){if(this.version=e,this.errorCorrectionLevel=r,this.modules=[],this.isFunction=[],e<a.MIN_VERSION||e>a.MAX_VERSION)throw new RangeError("Version value out of range");if(n<-1||n>7)throw new RangeError("Mask value out of range");this.size=e*4+17;for(var i=[],s=0;s<this.size;s++)i.push(!1);for(var s=0;s<this.size;s++)this.modules.push(i.slice()),this.isFunction.push(i.slice());this.drawFunctionPatterns();var d=this.addEccAndInterleave(t);if(this.drawCodewords(d),n==-1)for(var g=1e9,s=0;s<8;s++){this.applyMask(s),this.drawFormatBits(s);var M=this.getPenaltyScore();M<g&&(n=s,g=M),this.applyMask(s)}f(0<=n&&n<=7),this.mask=n,this.applyMask(n),this.drawFormatBits(n),this.isFunction=[]}return a.encodeText=function(e,r){var t=o.QrSegment.makeSegments(e);return a.encodeSegments(t,r)},a.encodeBinary=function(e,r){var t=o.QrSegment.makeBytes(e);return a.encodeSegments([t],r)},a.encodeSegments=function(e,r,t,n,i,s){if(t===void 0&&(t=1),n===void 0&&(n=40),i===void 0&&(i=-1),s===void 0&&(s=!0),!(a.MIN_VERSION<=t&&t<=n&&n<=a.MAX_VERSION)||i<-1||i>7)throw new RangeError("Invalid value");var d,g;for(d=t;;d++){var M=a.getNumDataCodewords(d,r)*8,E=h.getTotalBits(e,d);if(E<=M){g=E;break}if(d>=n)throw new RangeError("Data too long")}for(var C=0,p=[a.Ecc.MEDIUM,a.Ecc.QUARTILE,a.Ecc.HIGH];C<p.length;C++){var m=p[C];s&&g<=a.getNumDataCodewords(d,m)*8&&(r=m)}for(var v=[],w=0,S=e;w<S.length;w++){var y=S[w];c(y.mode.modeBits,4,v),c(y.numChars,y.mode.numCharCountBits(d),v);for(var P=0,N=y.getData();P<N.length;P++){var T=N[P];v.push(T)}}f(v.length==g);var z=a.getNumDataCodewords(d,r)*8;f(v.length<=z),c(0,Math.min(4,z-v.length),v),c(0,(8-v.length%8)%8,v),f(v.length%8==0);for(var I=236;v.length<z;I^=253)c(I,8,v);for(var D=[];D.length*8<v.length;)D.push(0);return v.forEach(function(k,L){return D[L>>>3]|=k<<7-(L&7)}),new a(d,r,D,i)},a.prototype.getModule=function(e,r){return 0<=e&&e<this.size&&0<=r&&r<this.size&&this.modules[r][e]},a.prototype.getModules=function(){return this.modules},a.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 r=this.getAlignmentPatternPositions(),t=r.length,e=0;e<t;e++)for(var n=0;n<t;n++)e==0&&n==0||e==0&&n==t-1||e==t-1&&n==0||this.drawAlignmentPattern(r[e],r[n]);this.drawFormatBits(0),this.drawVersion()},a.prototype.drawFormatBits=function(e){for(var r=this.errorCorrectionLevel.formatBits<<3|e,t=r,n=0;n<10;n++)t=t<<1^(t>>>9)*1335;var i=(r<<10|t)^21522;f(i>>>15==0);for(var n=0;n<=5;n++)this.setFunctionModule(8,n,u(i,n));this.setFunctionModule(8,7,u(i,6)),this.setFunctionModule(8,8,u(i,7)),this.setFunctionModule(7,8,u(i,8));for(var n=9;n<15;n++)this.setFunctionModule(14-n,8,u(i,n));for(var n=0;n<8;n++)this.setFunctionModule(this.size-1-n,8,u(i,n));for(var n=8;n<15;n++)this.setFunctionModule(8,this.size-15+n,u(i,n));this.setFunctionModule(8,this.size-8,!0)},a.prototype.drawVersion=function(){if(!(this.version<7)){for(var e=this.version,r=0;r<12;r++)e=e<<1^(e>>>11)*7973;var t=this.version<<12|e;f(t>>>18==0);for(var r=0;r<18;r++){var n=u(t,r),i=this.size-11+r%3,s=Math.floor(r/3);this.setFunctionModule(i,s,n),this.setFunctionModule(s,i,n)}}},a.prototype.drawFinderPattern=function(e,r){for(var t=-4;t<=4;t++)for(var n=-4;n<=4;n++){var i=Math.max(Math.abs(n),Math.abs(t)),s=e+n,d=r+t;0<=s&&s<this.size&&0<=d&&d<this.size&&this.setFunctionModule(s,d,i!=2&&i!=4)}},a.prototype.drawAlignmentPattern=function(e,r){for(var t=-2;t<=2;t++)for(var n=-2;n<=2;n++)this.setFunctionModule(e+n,r+t,Math.max(Math.abs(n),Math.abs(t))!=1)},a.prototype.setFunctionModule=function(e,r,t){this.modules[r][e]=t,this.isFunction[r][e]=!0},a.prototype.addEccAndInterleave=function(e){var r=this.version,t=this.errorCorrectionLevel;if(e.length!=a.getNumDataCodewords(r,t))throw new RangeError("Invalid argument");for(var n=a.NUM_ERROR_CORRECTION_BLOCKS[t.ordinal][r],i=a.ECC_CODEWORDS_PER_BLOCK[t.ordinal][r],s=Math.floor(a.getNumRawDataModules(r)/8),d=n-s%n,g=Math.floor(s/n),M=[],E=a.reedSolomonComputeDivisor(i),C=0,p=0;C<n;C++){var m=e.slice(p,p+g-i+(C<d?0:1));p+=m.length;var v=a.reedSolomonComputeRemainder(m,E);C<d&&m.push(0),M.push(m.concat(v))}for(var w=[],S=function(y){M.forEach(function(P,N){(y!=g-i||N>=d)&&w.push(P[y])})},C=0;C<M[0].length;C++)S(C);return f(w.length==s),w},a.prototype.drawCodewords=function(e){if(e.length!=Math.floor(a.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");for(var r=0,t=this.size-1;t>=1;t-=2){t==6&&(t=5);for(var n=0;n<this.size;n++)for(var i=0;i<2;i++){var s=t-i,d=(t+1&2)==0,g=d?this.size-1-n:n;!this.isFunction[g][s]&&r<e.length*8&&(this.modules[g][s]=u(e[r>>>3],7-(r&7)),r++)}}f(r==e.length*8)},a.prototype.applyMask=function(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(var r=0;r<this.size;r++)for(var t=0;t<this.size;t++){var n=void 0;switch(e){case 0:n=(t+r)%2==0;break;case 1:n=r%2==0;break;case 2:n=t%3==0;break;case 3:n=(t+r)%3==0;break;case 4:n=(Math.floor(t/3)+Math.floor(r/2))%2==0;break;case 5:n=t*r%2+t*r%3==0;break;case 6:n=(t*r%2+t*r%3)%2==0;break;case 7:n=((t+r)%2+t*r%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[r][t]&&n&&(this.modules[r][t]=!this.modules[r][t])}},a.prototype.getPenaltyScore=function(){for(var e=0,r=0;r<this.size;r++){for(var t=!1,n=0,i=[0,0,0,0,0,0,0],s=0;s<this.size;s++)this.modules[r][s]==t?(n++,n==5?e+=a.PENALTY_N1:n>5&&e++):(this.finderPenaltyAddHistory(n,i),t||(e+=this.finderPenaltyCountPatterns(i)*a.PENALTY_N3),t=this.modules[r][s],n=1);e+=this.finderPenaltyTerminateAndCount(t,n,i)*a.PENALTY_N3}for(var s=0;s<this.size;s++){for(var t=!1,d=0,i=[0,0,0,0,0,0,0],r=0;r<this.size;r++)this.modules[r][s]==t?(d++,d==5?e+=a.PENALTY_N1:d>5&&e++):(this.finderPenaltyAddHistory(d,i),t||(e+=this.finderPenaltyCountPatterns(i)*a.PENALTY_N3),t=this.modules[r][s],d=1);e+=this.finderPenaltyTerminateAndCount(t,d,i)*a.PENALTY_N3}for(var r=0;r<this.size-1;r++)for(var s=0;s<this.size-1;s++){var g=this.modules[r][s];g==this.modules[r][s+1]&&g==this.modules[r+1][s]&&g==this.modules[r+1][s+1]&&(e+=a.PENALTY_N2)}for(var M=0,E=0,C=this.modules;E<C.length;E++){var p=C[E];M=p.reduce(function(w,S){return w+(S?1:0)},M)}var m=this.size*this.size,v=Math.ceil(Math.abs(M*20-m*10)/m)-1;return f(0<=v&&v<=9),e+=v*a.PENALTY_N4,f(0<=e&&e<=2568888),e},a.prototype.getAlignmentPatternPositions=function(){if(this.version==1)return[];for(var e=Math.floor(this.version/7)+2,r=Math.floor((this.version*8+e*3+5)/(e*4-4))*2,t=[6],n=this.size-7;t.length<e;n-=r)t.splice(1,0,n);return t},a.getNumRawDataModules=function(e){if(e<a.MIN_VERSION||e>a.MAX_VERSION)throw new RangeError("Version number out of range");var r=(16*e+128)*e+64;if(e>=2){var t=Math.floor(e/7)+2;r-=(25*t-10)*t-55,e>=7&&(r-=36)}return f(208<=r&&r<=29648),r},a.getNumDataCodewords=function(e,r){return Math.floor(a.getNumRawDataModules(e)/8)-a.ECC_CODEWORDS_PER_BLOCK[r.ordinal][e]*a.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][e]},a.reedSolomonComputeDivisor=function(e){if(e<1||e>255)throw new RangeError("Degree out of range");for(var r=[],t=0;t<e-1;t++)r.push(0);r.push(1);for(var n=1,t=0;t<e;t++){for(var i=0;i<r.length;i++)r[i]=a.reedSolomonMultiply(r[i],n),i+1<r.length&&(r[i]^=r[i+1]);n=a.reedSolomonMultiply(n,2)}return r},a.reedSolomonComputeRemainder=function(e,r){for(var t=r.map(function(g){return 0}),n=function(g){var M=g^t.shift();t.push(0),r.forEach(function(E,C){return t[C]^=a.reedSolomonMultiply(E,M)})},i=0,s=e;i<s.length;i++){var d=s[i];n(d)}return t},a.reedSolomonMultiply=function(e,r){if(e>>>8||r>>>8)throw new RangeError("Byte out of range");for(var t=0,n=7;n>=0;n--)t=t<<1^(t>>>7)*285,t^=(r>>>n&1)*e;return f(t>>>8==0),t},a.prototype.finderPenaltyCountPatterns=function(e){var r=e[1];f(r<=this.size*3);var t=r>0&&e[2]==r&&e[3]==r*3&&e[4]==r&&e[5]==r;return(t&&e[0]>=r*4&&e[6]>=r?1:0)+(t&&e[6]>=r*4&&e[0]>=r?1:0)},a.prototype.finderPenaltyTerminateAndCount=function(e,r,t){return e&&(this.finderPenaltyAddHistory(r,t),r=0),r+=this.size,this.finderPenaltyAddHistory(r,t),this.finderPenaltyCountPatterns(t)},a.prototype.finderPenaltyAddHistory=function(e,r){r[0]==0&&(e+=this.size),r.pop(),r.unshift(e)},a.MIN_VERSION=1,a.MAX_VERSION=40,a.PENALTY_N1=3,a.PENALTY_N2=3,a.PENALTY_N3=40,a.PENALTY_N4=10,a.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]],a.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]],a}();o.QrCode=l;function c(a,e,r){if(e<0||e>31||a>>>e)throw new RangeError("Value out of range");for(var t=e-1;t>=0;t--)r.push(a>>>t&1)}function u(a,e){return(a>>>e&1)!=0}function f(a){if(!a)throw new Error("Assertion error")}var h=function(){function a(e,r,t){if(this.mode=e,this.numChars=r,this.bitData=t,r<0)throw new RangeError("Invalid argument");this.bitData=t.slice()}return a.makeBytes=function(e){for(var r=[],t=0,n=e;t<n.length;t++){var i=n[t];c(i,8,r)}return new a(a.Mode.BYTE,e.length,r)},a.makeNumeric=function(e){if(!a.isNumeric(e))throw new RangeError("String contains non-numeric characters");for(var r=[],t=0;t<e.length;){var n=Math.min(e.length-t,3);c(parseInt(e.substring(t,t+n),10),n*3+1,r),t+=n}return new a(a.Mode.NUMERIC,e.length,r)},a.makeAlphanumeric=function(e){if(!a.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");var r=[],t;for(t=0;t+2<=e.length;t+=2){var n=a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t))*45;n+=a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),c(n,11,r)}return t<e.length&&c(a.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,r),new a(a.Mode.ALPHANUMERIC,e.length,r)},a.makeSegments=function(e){return e==""?[]:a.isNumeric(e)?[a.makeNumeric(e)]:a.isAlphanumeric(e)?[a.makeAlphanumeric(e)]:[a.makeBytes(a.toUtf8ByteArray(e))]},a.makeEci=function(e){var r=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)c(e,8,r);else if(e<16384)c(2,2,r),c(e,14,r);else if(e<1e6)c(6,3,r),c(e,21,r);else throw new RangeError("ECI assignment value out of range");return new a(a.Mode.ECI,0,r)},a.isNumeric=function(e){return a.NUMERIC_REGEX.test(e)},a.isAlphanumeric=function(e){return a.ALPHANUMERIC_REGEX.test(e)},a.prototype.getData=function(){return this.bitData.slice()},a.getTotalBits=function(e,r){for(var t=0,n=0,i=e;n<i.length;n++){var s=i[n],d=s.mode.numCharCountBits(r);if(s.numChars>=1<<d)return 1/0;t+=4+d+s.bitData.length}return t},a.toUtf8ByteArray=function(e){e=encodeURI(e);for(var r=[],t=0;t<e.length;t++)e.charAt(t)!="%"?r.push(e.charCodeAt(t)):(r.push(parseInt(e.substring(t+1,t+3),16)),t+=2);return r},a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",a}();o.QrSegment=h})(b||(b={}));(function(o){(function(l){var c=function(){function u(f,h){this.ordinal=f,this.formatBits=h}return u.LOW=new u(0,1),u.MEDIUM=new u(1,0),u.QUARTILE=new u(2,3),u.HIGH=new u(3,2),u}();l.Ecc=c})(o.QrCode||(o.QrCode={}))})(b||(b={}));(function(o){(function(l){var c=function(){function u(f,h){this.modeBits=f,this.numBitsCharCount=h}return u.prototype.numCharCountBits=function(f){return this.numBitsCharCount[Math.floor((f+7)/17)]},u.NUMERIC=new u(1,[10,12,14]),u.ALPHANUMERIC=new u(2,[9,11,13]),u.BYTE=new u(4,[8,16,16]),u.KANJI=new u(8,[8,10,12]),u.ECI=new u(7,[0,0,0]),u}();l.Mode=c})(o.QrSegment||(o.QrSegment={}))})(b||(b={}));var O=b,Q="L",U={L:O.QrCode.Ecc.LOW,M:O.QrCode.Ecc.MEDIUM,Q:O.QrCode.Ecc.QUARTILE,H:O.QrCode.Ecc.HIGH},ee=function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0}();function H(o){return o in U}function K(o,l){l===void 0&&(l=0);var c=[];return o.forEach(function(u,f){var h=null;u.forEach(function(a,e){if(!a&&h!==null){c.push("M".concat(h+l," ").concat(f+l,"h").concat(e-h,"v1H").concat(h+l,"z")),h=null;return}if(e===u.length-1){if(!a)return;h===null?c.push("M".concat(e+l,",").concat(f+l," h1v1H").concat(e+l,"z")):c.push("M".concat(h+l,",").concat(f+l," h").concat(e+1-h,"v1H").concat(h+l,"z"));return}a&&h===null&&(h=e)})}),c.join("")}function W(o,l,c,u){var f=u.width,h=u.height,a=u.x,e=u.y,r=o.length+c*2,t=Math.floor(l*.1),n=r/l,i=(f||t)*n,s=(h||t)*n,d=a==null?o.length/2-i/2:a*n,g=e==null?o.length/2-s/2:e*n,M=null;if(u.excavate){var E=Math.floor(d),C=Math.floor(g),p=Math.ceil(i+d-E),m=Math.ceil(s+g-C);M={x:E,y:C,w:p,h:m}}return{x:d,y:g,h:s,w:i,excavation:M}}function q(o,l){return o.slice().map(function(c,u){return u<l.y||u>=l.y+l.h?c:c.map(function(f,h){return h<l.x||h>=l.x+l.w?f:!1})})}var G={value:{type:String,required:!0,default:""},size:{type:Number,default:100},level:{type:String,default:Q,validator:function(o){return H(o)}},background:{type:String,default:"#fff"},foreground:{type:String,default:"#000"},margin:{type:Number,required:!1,default:0},imageSettings:{type:Object,required:!1,default:function(){return{}}},gradient:{type:Boolean,required:!1,default:!1},gradientType:{type:String,required:!1,default:"linear",validator:function(o){return["linear","radial"].indexOf(o)>-1}},gradientStartColor:{type:String,required:!1,default:"#000"},gradientEndColor:{type:String,required:!1,default:"#fff"}},re=A(A({},G),{renderAs:{type:String,required:!1,default:"canvas",validator:function(o){return["canvas","svg"].indexOf(o)>-1}}}),te=F({name:"QRCodeSvg",props:G,setup:function(o){var l=_(0),c=_(""),u,f=function(){var a=o.value,e=o.level,r=o.margin,t=r>>>0,n=H(e)?e:Q,i=O.QrCode.encodeText(a,U[n]).getModules();if(l.value=i.length+t*2,o.imageSettings.src){var s=W(i,o.size,t,o.imageSettings);u={x:s.x+t,y:s.y+t,width:s.w,height:s.h},s.excavation&&(i=q(i,s.excavation))}c.value=K(i,t)},h=function(){if(!o.gradient)return null;var a=o.gradientType==="linear"?{x1:"0%",y1:"0%",x2:"100%",y2:"100%"}:{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%"};return R(o.gradientType==="linear"?"linearGradient":"radialGradient",A({id:"qr-gradient"},a),[R("stop",{offset:"0%",style:{stopColor:o.gradientStartColor}}),R("stop",{offset:"100%",style:{stopColor:o.gradientEndColor}})])};return f(),$(f),function(){return R("svg",{width:o.size,height:o.size,"shape-rendering":"crispEdges",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 ".concat(l.value," ").concat(l.value)},[R("defs",{},[h()]),R("rect",{width:"100%",height:"100%",fill:o.background}),R("path",{fill:o.gradient?"url(#qr-gradient)":o.foreground,d:c.value}),o.imageSettings.src&&R("image",A({href:o.imageSettings.src},u))])}}}),ae=F({name:"QRCodeCanvas",props:G,setup:function(o,l){var c=_(null),u=_(null),f=function(){var a=o.value,e=o.level,r=o.size,t=o.margin,n=o.background,i=o.foreground,s=o.gradient,d=o.gradientType,g=o.gradientStartColor,M=o.gradientEndColor,E=t>>>0,C=H(e)?e:Q,p=c.value;if(p){var m=p.getContext("2d");if(m){var v=O.QrCode.encodeText(a,U[C]).getModules(),w=v.length+E*2,S=u.value,y={x:0,y:0,width:0,height:0},P=o.imageSettings.src&&S!=null&&S.naturalWidth!==0&&S.naturalHeight!==0;if(P){var N=W(v,o.size,E,o.imageSettings);y={x:N.x+E,y:N.y+E,width:N.w,height:N.h},N.excavation&&(v=q(v,N.excavation))}var T=window.devicePixelRatio||1,z=r/w*T;if(p.height=p.width=r*T,m.scale(z,z),m.fillStyle=n,m.fillRect(0,0,w,w),s){var I=void 0;d==="linear"?I=m.createLinearGradient(0,0,w,w):I=m.createRadialGradient(w/2,w/2,0,w/2,w/2,w/2),I.addColorStop(0,g),I.addColorStop(1,M),m.fillStyle=I}else m.fillStyle=i;ee?m.fill(new Path2D(K(v,E))):v.forEach(function(D,k){D.forEach(function(L,J){L&&m.fillRect(J+E,k+E,1,1)})}),P&&m.drawImage(S,y.x,y.y,y.width,y.height)}}};V(f),$(f);var h=l.attrs.style;return function(){return R(X,[R("canvas",A(A({},l.attrs),{ref:c,style:A(A({},h),{width:"".concat(o.size,"px"),height:"".concat(o.size,"px")})})),o.imageSettings.src&&R("img",{ref:u,src:o.imageSettings.src,style:{display:"none"},onLoad:f})])}}}),ue=F({name:"Qrcode",render:function(){var o=this.$props,l=o.renderAs,c=o.value,u=o.size,f=o.margin,h=o.level,a=o.background,e=o.foreground,r=o.imageSettings,t=o.gradient,n=o.gradientType,i=o.gradientStartColor,s=o.gradientEndColor;return R(l==="svg"?te:ae,{value:c,size:u,margin:f,level:h,background:a,foreground:e,imageSettings:r,gradient:t,gradientType:n,gradientStartColor:i,gradientEndColor:s})},props:re});const le=Z("fileData",()=>{const o=x(JSON.parse(localStorage.getItem("receiveData")||"[]")||[]),l=x(JSON.parse(localStorage.getItem("shareData")||"[]")||[]);function c(){localStorage.setItem("receiveData",JSON.stringify(o)),localStorage.setItem("shareData",JSON.stringify(l))}function u(e){o.unshift(e),c()}function f(e){l.unshift(e),c()}function h(e){o.splice(e,1),c()}function a(e){l.splice(e,1),c()}return{receiveData:o,shareData:l,save:c,addShareData:f,addReceiveData:u,deleteReceiveData:h,deleteShareData:a}}),Y=async(o,l={})=>{const{successMsg:c="复制成功",errorMsg:u="复制失败,请手动复制",showMsg:f=!0}=l,h=j();try{if(navigator.clipboard&&navigator.clipboard.writeText)return await navigator.clipboard.writeText(o),f&&h.showAlert(c,"success"),!0;const a=document.createElement("textarea");a.value=o,a.style.position="fixed",a.style.opacity="0",document.body.appendChild(a),a.select();const e=document.execCommand("copy");if(document.body.removeChild(a),e)return f&&h.showAlert(c,"success"),!0;throw new Error("execCommand copy failed")}catch(a){return console.error("复制失败:",a),f&&h.showAlert(u,"error"),!1}},ce=async o=>{const l=`${window.location.origin}/#/?code=${o}`;return Y(l,{successMsg:"取件链接已复制到剪贴板",errorMsg:"复制失败,请手动复制取件链接"})},fe=async o=>Y(o,{successMsg:"取件码已复制到剪贴板",errorMsg:"复制失败,请手动复制取件码"}),he=async o=>{const l=`wget ${window.location.origin}/share/select?code=${o}`;return Y(l,{successMsg:"wget命令已复制到剪贴板",errorMsg:"复制失败,请手动复制wget命令"})};export{oe as C,ie as E,ue as Q,se as S,he as a,ce as b,fe as c,Y as d,le as u};