niucloud-admin/niucloud/public/admin/assets/preview-d7c90f24.js
全栈小学生 a0528dc947 update admin
2023-06-21 18:37:59 +08:00

9 lines
29 KiB
JavaScript

import{g as Yt,r as D,a4 as Ot,w as jt,m as K,n as Z,a1 as Y,q as F,L as H,u as P,F as N,E as M,K as X,I as At,T as ut,D as It}from"./base-d2ce4248.js";/* empty css *//* empty css */import{E as Gt,b as Qt}from"./el-radio-b620ac73.js";/* empty css *//* empty css */import{J as Wt,v as O}from"./event-f83e96f5.js";import{t as S}from"./index-578c83eb.js";import{u as Zt}from"./vue-router-d3dc2686.js";import{g as Xt}from"./weapp-50d6994b.js";import{Z as te}from"./index-057b5f2c.js";import{a as Tt,d as ee}from"./storage-e62e496d.js";import{l as ne}from"./diy-5772e48d.js";import{a as Nt}from"./index-3118dac6.js";import{E as oe}from"./index-9997ff5d.js";import{E as re}from"./index-953c712f.js";import{a as ie,E as se}from"./index-f579a83b.js";import{E as ae}from"./index-3ae544fb.js";import"./common-dd6d00bb.js";import"./common-2cf17469.js";import"./el-overlay-7451f13b.js";import"./index-28969730.js";import"./focus-trap-b41dd321.js";import"./index-758a5fe7.js";import"./index-92c8bc76.js";import"./_plugin-vue_export-helper-c27b6911.js";import"./el-tooltip-58212670.js";import"./el-avatar-4397f45a.js";import"./_Uint8Array-6ca580e8.js";import"./_initCloneObject-5fe9c070.js";var Q={},ue=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},Pt={},v={};let Et;const le=[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];v.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};v.getSymbolTotalCodewords=function(t){return le[t]};v.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};v.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');Et=t};v.isKanjiModeEnabled=function(){return typeof Et<"u"};v.toSJIS=function(t){return Et(t)};var rt={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+i)}}e.isValid=function(r){return r&&typeof r.bit<"u"&&r.bit>=0&&r.bit<4},e.from=function(r,n){if(e.isValid(r))return r;try{return t(r)}catch{return n}}})(rt);function Rt(){this.buffer=[],this.length=0}Rt.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let i=0;i<t;i++)this.putBit((e>>>t-i-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var ce=Rt;function W(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}W.prototype.set=function(e,t,i,r){const n=e*this.size+t;this.data[n]=i,r&&(this.reservedBit[n]=!0)};W.prototype.get=function(e,t){return this.data[e*this.size+t]};W.prototype.xor=function(e,t,i){this.data[e*this.size+t]^=i};W.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var fe=W,Lt={};(function(e){const t=v.getSymbolSize;e.getRowColCoords=function(r){if(r===1)return[];const n=Math.floor(r/7)+2,o=t(r),s=o===145?26:Math.ceil((o-13)/(2*n-2))*2,a=[o-7];for(let u=1;u<n-1;u++)a[u]=a[u-1]-s;return a.push(6),a.reverse()},e.getPositions=function(r){const n=[],o=e.getRowColCoords(r),s=o.length;for(let a=0;a<s;a++)for(let u=0;u<s;u++)a===0&&u===0||a===0&&u===s-1||a===s-1&&u===0||n.push([o[a],o[u]]);return n}})(Lt);var Dt={};const de=v.getSymbolSize,vt=7;Dt.getPositions=function(t){const i=de(t);return[[0,0],[i-vt,0],[0,i-vt]]};var Ut={};(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(n){return n!=null&&n!==""&&!isNaN(n)&&n>=0&&n<=7},e.from=function(n){return e.isValid(n)?parseInt(n,10):void 0},e.getPenaltyN1=function(n){const o=n.size;let s=0,a=0,u=0,l=null,d=null;for(let B=0;B<o;B++){a=u=0,l=d=null;for(let m=0;m<o;m++){let g=n.get(B,m);g===l?a++:(a>=5&&(s+=t.N1+(a-5)),l=g,a=1),g=n.get(m,B),g===d?u++:(u>=5&&(s+=t.N1+(u-5)),d=g,u=1)}a>=5&&(s+=t.N1+(a-5)),u>=5&&(s+=t.N1+(u-5))}return s},e.getPenaltyN2=function(n){const o=n.size;let s=0;for(let a=0;a<o-1;a++)for(let u=0;u<o-1;u++){const l=n.get(a,u)+n.get(a,u+1)+n.get(a+1,u)+n.get(a+1,u+1);(l===4||l===0)&&s++}return s*t.N2},e.getPenaltyN3=function(n){const o=n.size;let s=0,a=0,u=0;for(let l=0;l<o;l++){a=u=0;for(let d=0;d<o;d++)a=a<<1&2047|n.get(l,d),d>=10&&(a===1488||a===93)&&s++,u=u<<1&2047|n.get(d,l),d>=10&&(u===1488||u===93)&&s++}return s*t.N3},e.getPenaltyN4=function(n){let o=0;const s=n.data.length;for(let u=0;u<s;u++)o+=n.data[u];return Math.abs(Math.ceil(o*100/s/5)-10)*t.N4};function i(r,n,o){switch(r){case e.Patterns.PATTERN000:return(n+o)%2===0;case e.Patterns.PATTERN001:return n%2===0;case e.Patterns.PATTERN010:return o%3===0;case e.Patterns.PATTERN011:return(n+o)%3===0;case e.Patterns.PATTERN100:return(Math.floor(n/2)+Math.floor(o/3))%2===0;case e.Patterns.PATTERN101:return n*o%2+n*o%3===0;case e.Patterns.PATTERN110:return(n*o%2+n*o%3)%2===0;case e.Patterns.PATTERN111:return(n*o%3+(n+o)%2)%2===0;default:throw new Error("bad maskPattern:"+r)}}e.applyMask=function(n,o){const s=o.size;for(let a=0;a<s;a++)for(let u=0;u<s;u++)o.isReserved(u,a)||o.xor(u,a,i(n,u,a))},e.getBestMask=function(n,o){const s=Object.keys(e.Patterns).length;let a=0,u=1/0;for(let l=0;l<s;l++){o(l),e.applyMask(l,n);const d=e.getPenaltyN1(n)+e.getPenaltyN2(n)+e.getPenaltyN3(n)+e.getPenaltyN4(n);e.applyMask(l,n),d<u&&(u=d,a=l)}return a}})(Ut);var it={};const k=rt,tt=[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],et=[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];it.getBlocksCount=function(t,i){switch(i){case k.L:return tt[(t-1)*4+0];case k.M:return tt[(t-1)*4+1];case k.Q:return tt[(t-1)*4+2];case k.H:return tt[(t-1)*4+3];default:return}};it.getTotalCodewordsCount=function(t,i){switch(i){case k.L:return et[(t-1)*4+0];case k.M:return et[(t-1)*4+1];case k.Q:return et[(t-1)*4+2];case k.H:return et[(t-1)*4+3];default:return}};var Ft={},st={};const j=new Uint8Array(512),nt=new Uint8Array(256);(function(){let t=1;for(let i=0;i<255;i++)j[i]=t,nt[t]=i,t<<=1,t&256&&(t^=285);for(let i=255;i<512;i++)j[i]=j[i-255]})();st.log=function(t){if(t<1)throw new Error("log("+t+")");return nt[t]};st.exp=function(t){return j[t]};st.mul=function(t,i){return t===0||i===0?0:j[nt[t]+nt[i]]};(function(e){const t=st;e.mul=function(r,n){const o=new Uint8Array(r.length+n.length-1);for(let s=0;s<r.length;s++)for(let a=0;a<n.length;a++)o[s+a]^=t.mul(r[s],n[a]);return o},e.mod=function(r,n){let o=new Uint8Array(r);for(;o.length-n.length>=0;){const s=o[0];for(let u=0;u<n.length;u++)o[u]^=t.mul(n[u],s);let a=0;for(;a<o.length&&o[a]===0;)a++;o=o.slice(a)}return o},e.generateECPolynomial=function(r){let n=new Uint8Array([1]);for(let o=0;o<r;o++)n=e.mul(n,new Uint8Array([1,t.exp(o)]));return n}})(Ft);const kt=Ft;function Ct(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}Ct.prototype.initialize=function(t){this.degree=t,this.genPoly=kt.generateECPolynomial(this.degree)};Ct.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const i=new Uint8Array(t.length+this.degree);i.set(t);const r=kt.mod(i,this.genPoly),n=this.degree-r.length;if(n>0){const o=new Uint8Array(this.degree);return o.set(r,n),o}return r};var ge=Ct,Vt={},V={},Bt={};Bt.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var R={};const zt="[0-9]+",he="[A-Z $%*+\\-./:]+";let G="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";G=G.replace(/u/g,"\\u");const me="(?:(?![A-Z0-9 $%*+\\-./:]|"+G+`)(?:.|[\r
]))+`;R.KANJI=new RegExp(G,"g");R.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");R.BYTE=new RegExp(me,"g");R.NUMERIC=new RegExp(zt,"g");R.ALPHANUMERIC=new RegExp(he,"g");const pe=new RegExp("^"+G+"$"),we=new RegExp("^"+zt+"$"),ye=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");R.testKanji=function(t){return pe.test(t)};R.testNumeric=function(t){return we.test(t)};R.testAlphanumeric=function(t){return ye.test(t)};(function(e){const t=Bt,i=R;e.NUMERIC={id:"Numeric",bit:1<<0,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:1<<1,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:1<<2,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:1<<3,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(o,s){if(!o.ccBits)throw new Error("Invalid mode: "+o);if(!t.isValid(s))throw new Error("Invalid version: "+s);return s>=1&&s<10?o.ccBits[0]:s<27?o.ccBits[1]:o.ccBits[2]},e.getBestModeForData=function(o){return i.testNumeric(o)?e.NUMERIC:i.testAlphanumeric(o)?e.ALPHANUMERIC:i.testKanji(o)?e.KANJI:e.BYTE},e.toString=function(o){if(o&&o.id)return o.id;throw new Error("Invalid mode")},e.isValid=function(o){return o&&o.bit&&o.ccBits};function r(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+n)}}e.from=function(o,s){if(e.isValid(o))return o;try{return r(o)}catch{return s}}})(V);(function(e){const t=v,i=it,r=rt,n=V,o=Bt,s=1<<12|1<<11|1<<10|1<<9|1<<8|1<<5|1<<2|1<<0,a=t.getBCHDigit(s);function u(m,g,p){for(let w=1;w<=40;w++)if(g<=e.getCapacity(w,p,m))return w}function l(m,g){return n.getCharCountIndicator(m,g)+4}function d(m,g){let p=0;return m.forEach(function(w){const b=l(w.mode,g);p+=b+w.getBitsLength()}),p}function B(m,g){for(let p=1;p<=40;p++)if(d(m,p)<=e.getCapacity(p,g,n.MIXED))return p}e.from=function(g,p){return o.isValid(g)?parseInt(g,10):p},e.getCapacity=function(g,p,w){if(!o.isValid(g))throw new Error("Invalid QR Code version");typeof w>"u"&&(w=n.BYTE);const b=t.getSymbolTotalCodewords(g),h=i.getTotalCodewordsCount(g,p),y=(b-h)*8;if(w===n.MIXED)return y;const f=y-l(w,g);switch(w){case n.NUMERIC:return Math.floor(f/10*3);case n.ALPHANUMERIC:return Math.floor(f/11*2);case n.KANJI:return Math.floor(f/13);case n.BYTE:default:return Math.floor(f/8)}},e.getBestVersionForData=function(g,p){let w;const b=r.from(p,r.M);if(Array.isArray(g)){if(g.length>1)return B(g,b);if(g.length===0)return 1;w=g[0]}else w=g;return u(w.mode,w.getLength(),b)},e.getEncodedBits=function(g){if(!o.isValid(g)||g<7)throw new Error("Invalid QR Code version");let p=g<<12;for(;t.getBCHDigit(p)-a>=0;)p^=s<<t.getBCHDigit(p)-a;return g<<12|p}})(Vt);var Ht={};const ht=v,Kt=1<<10|1<<8|1<<5|1<<4|1<<2|1<<1|1<<0,Ee=1<<14|1<<12|1<<10|1<<4|1<<1,Mt=ht.getBCHDigit(Kt);Ht.getEncodedBits=function(t,i){const r=t.bit<<3|i;let n=r<<10;for(;ht.getBCHDigit(n)-Mt>=0;)n^=Kt<<ht.getBCHDigit(n)-Mt;return(r<<10|n)^Ee};var Jt={};const Ce=V;function J(e){this.mode=Ce.NUMERIC,this.data=e.toString()}J.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};J.prototype.getLength=function(){return this.data.length};J.prototype.getBitsLength=function(){return J.getBitsLength(this.data.length)};J.prototype.write=function(t){let i,r,n;for(i=0;i+3<=this.data.length;i+=3)r=this.data.substr(i,3),n=parseInt(r,10),t.put(n,10);const o=this.data.length-i;o>0&&(r=this.data.substr(i),n=parseInt(r,10),t.put(n,o*3+1))};var Be=J;const _e=V,lt=["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 $(e){this.mode=_e.ALPHANUMERIC,this.data=e}$.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};$.prototype.getLength=function(){return this.data.length};$.prototype.getBitsLength=function(){return $.getBitsLength(this.data.length)};$.prototype.write=function(t){let i;for(i=0;i+2<=this.data.length;i+=2){let r=lt.indexOf(this.data[i])*45;r+=lt.indexOf(this.data[i+1]),t.put(r,11)}this.data.length%2&&t.put(lt.indexOf(this.data[i]),6)};var be=$,Ae=function(t){for(var i=[],r=t.length,n=0;n<r;n++){var o=t.charCodeAt(n);if(o>=55296&&o<=56319&&r>n+1){var s=t.charCodeAt(n+1);s>=56320&&s<=57343&&(o=(o-55296)*1024+s-56320+65536,n+=1)}if(o<128){i.push(o);continue}if(o<2048){i.push(o>>6|192),i.push(o&63|128);continue}if(o<55296||o>=57344&&o<65536){i.push(o>>12|224),i.push(o>>6&63|128),i.push(o&63|128);continue}if(o>=65536&&o<=1114111){i.push(o>>18|240),i.push(o>>12&63|128),i.push(o>>6&63|128),i.push(o&63|128);continue}i.push(239,191,189)}return new Uint8Array(i).buffer};const Ie=Ae,Te=V;function x(e){this.mode=Te.BYTE,typeof e=="string"&&(e=Ie(e)),this.data=new Uint8Array(e)}x.getBitsLength=function(t){return t*8};x.prototype.getLength=function(){return this.data.length};x.prototype.getBitsLength=function(){return x.getBitsLength(this.data.length)};x.prototype.write=function(e){for(let t=0,i=this.data.length;t<i;t++)e.put(this.data[t],8)};var Ne=x;const ve=V,Me=v;function q(e){this.mode=ve.KANJI,this.data=e}q.getBitsLength=function(t){return t*13};q.prototype.getLength=function(){return this.data.length};q.prototype.getBitsLength=function(){return q.getBitsLength(this.data.length)};q.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let i=Me.toSJIS(this.data[t]);if(i>=33088&&i<=40956)i-=33088;else if(i>=57408&&i<=60351)i-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
Make sure your charset is UTF-8`);i=(i>>>8&255)*192+(i&255),e.put(i,13)}};var Se=q,mt={},Pe={get exports(){return mt},set exports(e){mt=e}};(function(e){var t={single_source_shortest_paths:function(i,r,n){var o={},s={};s[r]=0;var a=t.PriorityQueue.make();a.push(r,0);for(var u,l,d,B,m,g,p,w,b;!a.empty();){u=a.pop(),l=u.value,B=u.cost,m=i[l]||{};for(d in m)m.hasOwnProperty(d)&&(g=m[d],p=B+g,w=s[d],b=typeof s[d]>"u",(b||w>p)&&(s[d]=p,a.push(d,p),o[d]=l))}if(typeof n<"u"&&typeof s[n]>"u"){var h=["Could not find a path from ",r," to ",n,"."].join("");throw new Error(h)}return o},extract_shortest_path_from_predecessor_list:function(i,r){for(var n=[],o=r;o;)n.push(o),i[o],o=i[o];return n.reverse(),n},find_path:function(i,r,n){var o=t.single_source_shortest_paths(i,r,n);return t.extract_shortest_path_from_predecessor_list(o,n)},PriorityQueue:{make:function(i){var r=t.PriorityQueue,n={},o;i=i||{};for(o in r)r.hasOwnProperty(o)&&(n[o]=r[o]);return n.queue=[],n.sorter=i.sorter||r.default_sorter,n},default_sorter:function(i,r){return i.cost-r.cost},push:function(i,r){var n={value:i,cost:r};this.queue.push(n),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(Pe);(function(e){const t=V,i=Be,r=be,n=Ne,o=Se,s=R,a=v,u=mt;function l(h){return unescape(encodeURIComponent(h)).length}function d(h,y,f){const c=[];let E;for(;(E=h.exec(f))!==null;)c.push({data:E[0],index:E.index,mode:y,length:E[0].length});return c}function B(h){const y=d(s.NUMERIC,t.NUMERIC,h),f=d(s.ALPHANUMERIC,t.ALPHANUMERIC,h);let c,E;return a.isKanjiModeEnabled()?(c=d(s.BYTE,t.BYTE,h),E=d(s.KANJI,t.KANJI,h)):(c=d(s.BYTE_KANJI,t.BYTE,h),E=[]),y.concat(f,c,E).sort(function(_,I){return _.index-I.index}).map(function(_){return{data:_.data,mode:_.mode,length:_.length}})}function m(h,y){switch(y){case t.NUMERIC:return i.getBitsLength(h);case t.ALPHANUMERIC:return r.getBitsLength(h);case t.KANJI:return o.getBitsLength(h);case t.BYTE:return n.getBitsLength(h)}}function g(h){return h.reduce(function(y,f){const c=y.length-1>=0?y[y.length-1]:null;return c&&c.mode===f.mode?(y[y.length-1].data+=f.data,y):(y.push(f),y)},[])}function p(h){const y=[];for(let f=0;f<h.length;f++){const c=h[f];switch(c.mode){case t.NUMERIC:y.push([c,{data:c.data,mode:t.ALPHANUMERIC,length:c.length},{data:c.data,mode:t.BYTE,length:c.length}]);break;case t.ALPHANUMERIC:y.push([c,{data:c.data,mode:t.BYTE,length:c.length}]);break;case t.KANJI:y.push([c,{data:c.data,mode:t.BYTE,length:l(c.data)}]);break;case t.BYTE:y.push([{data:c.data,mode:t.BYTE,length:l(c.data)}])}}return y}function w(h,y){const f={},c={start:{}};let E=["start"];for(let C=0;C<h.length;C++){const _=h[C],I=[];for(let A=0;A<_.length;A++){const T=_[A],z=""+C+A;I.push(z),f[z]={node:T,lastCount:0},c[z]={};for(let U=0;U<E.length;U++){const L=E[U];f[L]&&f[L].node.mode===T.mode?(c[L][z]=m(f[L].lastCount+T.length,T.mode)-m(f[L].lastCount,T.mode),f[L].lastCount+=T.length):(f[L]&&(f[L].lastCount=T.length),c[L][z]=m(T.length,T.mode)+4+t.getCharCountIndicator(T.mode,y))}}E=I}for(let C=0;C<E.length;C++)c[E[C]].end=0;return{map:c,table:f}}function b(h,y){let f;const c=t.getBestModeForData(h);if(f=t.from(y,c),f!==t.BYTE&&f.bit<c.bit)throw new Error('"'+h+'" cannot be encoded with mode '+t.toString(f)+`.
Suggested mode is: `+t.toString(c));switch(f===t.KANJI&&!a.isKanjiModeEnabled()&&(f=t.BYTE),f){case t.NUMERIC:return new i(h);case t.ALPHANUMERIC:return new r(h);case t.KANJI:return new o(h);case t.BYTE:return new n(h)}}e.fromArray=function(y){return y.reduce(function(f,c){return typeof c=="string"?f.push(b(c,null)):c.data&&f.push(b(c.data,c.mode)),f},[])},e.fromString=function(y,f){const c=B(y,a.isKanjiModeEnabled()),E=p(c),C=w(E,f),_=u.find_path(C.map,"start","end"),I=[];for(let A=1;A<_.length-1;A++)I.push(C.table[_[A]].node);return e.fromArray(g(I))},e.rawSplit=function(y){return e.fromArray(B(y,a.isKanjiModeEnabled()))}})(Jt);const at=v,ct=rt,Re=ce,Le=fe,De=Lt,Ue=Dt,pt=Ut,wt=it,Fe=ge,ot=Vt,ke=Ht,Ve=V,ft=Jt;function ze(e,t){const i=e.size,r=Ue.getPositions(t);for(let n=0;n<r.length;n++){const o=r[n][0],s=r[n][1];for(let a=-1;a<=7;a++)if(!(o+a<=-1||i<=o+a))for(let u=-1;u<=7;u++)s+u<=-1||i<=s+u||(a>=0&&a<=6&&(u===0||u===6)||u>=0&&u<=6&&(a===0||a===6)||a>=2&&a<=4&&u>=2&&u<=4?e.set(o+a,s+u,!0,!0):e.set(o+a,s+u,!1,!0))}}function He(e){const t=e.size;for(let i=8;i<t-8;i++){const r=i%2===0;e.set(i,6,r,!0),e.set(6,i,r,!0)}}function Ke(e,t){const i=De.getPositions(t);for(let r=0;r<i.length;r++){const n=i[r][0],o=i[r][1];for(let s=-2;s<=2;s++)for(let a=-2;a<=2;a++)s===-2||s===2||a===-2||a===2||s===0&&a===0?e.set(n+s,o+a,!0,!0):e.set(n+s,o+a,!1,!0)}}function Je(e,t){const i=e.size,r=ot.getEncodedBits(t);let n,o,s;for(let a=0;a<18;a++)n=Math.floor(a/3),o=a%3+i-8-3,s=(r>>a&1)===1,e.set(n,o,s,!0),e.set(o,n,s,!0)}function dt(e,t,i){const r=e.size,n=ke.getEncodedBits(t,i);let o,s;for(o=0;o<15;o++)s=(n>>o&1)===1,o<6?e.set(o,8,s,!0):o<8?e.set(o+1,8,s,!0):e.set(r-15+o,8,s,!0),o<8?e.set(8,r-o-1,s,!0):o<9?e.set(8,15-o-1+1,s,!0):e.set(8,15-o-1,s,!0);e.set(r-8,8,1,!0)}function $e(e,t){const i=e.size;let r=-1,n=i-1,o=7,s=0;for(let a=i-1;a>0;a-=2)for(a===6&&a--;;){for(let u=0;u<2;u++)if(!e.isReserved(n,a-u)){let l=!1;s<t.length&&(l=(t[s]>>>o&1)===1),e.set(n,a-u,l),o--,o===-1&&(s++,o=7)}if(n+=r,n<0||i<=n){n-=r,r=-r;break}}}function xe(e,t,i){const r=new Re;i.forEach(function(u){r.put(u.mode.bit,4),r.put(u.getLength(),Ve.getCharCountIndicator(u.mode,e)),u.write(r)});const n=at.getSymbolTotalCodewords(e),o=wt.getTotalCodewordsCount(e,t),s=(n-o)*8;for(r.getLengthInBits()+4<=s&&r.put(0,4);r.getLengthInBits()%8!==0;)r.putBit(0);const a=(s-r.getLengthInBits())/8;for(let u=0;u<a;u++)r.put(u%2?17:236,8);return qe(r,e,t)}function qe(e,t,i){const r=at.getSymbolTotalCodewords(t),n=wt.getTotalCodewordsCount(t,i),o=r-n,s=wt.getBlocksCount(t,i),a=r%s,u=s-a,l=Math.floor(r/s),d=Math.floor(o/s),B=d+1,m=l-d,g=new Fe(m);let p=0;const w=new Array(s),b=new Array(s);let h=0;const y=new Uint8Array(e.buffer);for(let _=0;_<s;_++){const I=_<u?d:B;w[_]=y.slice(p,p+I),b[_]=g.encode(w[_]),p+=I,h=Math.max(h,I)}const f=new Uint8Array(r);let c=0,E,C;for(E=0;E<h;E++)for(C=0;C<s;C++)E<w[C].length&&(f[c++]=w[C][E]);for(E=0;E<m;E++)for(C=0;C<s;C++)f[c++]=b[C][E];return f}function Ye(e,t,i,r){let n;if(Array.isArray(e))n=ft.fromArray(e);else if(typeof e=="string"){let l=t;if(!l){const d=ft.rawSplit(e);l=ot.getBestVersionForData(d,i)}n=ft.fromString(e,l||40)}else throw new Error("Invalid data");const o=ot.getBestVersionForData(n,i);if(!o)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=o;else if(t<o)throw new Error(`
The chosen QR Code version cannot contain this amount of data.
Minimum version required to store current data is: `+o+`.
`);const s=xe(t,i,n),a=at.getSymbolSize(t),u=new Le(a);return ze(u,t),He(u),Ke(u,t),dt(u,i,0),t>=7&&Je(u,t),$e(u,s),isNaN(r)&&(r=pt.getBestMask(u,dt.bind(null,u,i))),pt.applyMask(r,u),dt(u,i,r),{modules:u,version:t,errorCorrectionLevel:i,maskPattern:r,segments:n}}Pt.create=function(t,i){if(typeof t>"u"||t==="")throw new Error("No input text");let r=ct.M,n,o;return typeof i<"u"&&(r=ct.from(i.errorCorrectionLevel,ct.M),n=ot.from(i.version),o=pt.from(i.maskPattern),i.toSJISFunc&&at.setToSJISFunction(i.toSJISFunc)),Ye(t,n,r,o)};var $t={},_t={};(function(e){function t(i){if(typeof i=="number"&&(i=i.toString()),typeof i!="string")throw new Error("Color should be defined as hex string");let r=i.slice().replace("#","").split("");if(r.length<3||r.length===5||r.length>8)throw new Error("Invalid hex color: "+i);(r.length===3||r.length===4)&&(r=Array.prototype.concat.apply([],r.map(function(o){return[o,o]}))),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("")}}e.getOptions=function(r){r||(r={}),r.color||(r.color={});const n=typeof r.margin>"u"||r.margin===null||r.margin<0?4:r.margin,o=r.width&&r.width>=21?r.width:void 0,s=r.scale||4;return{width:o,scale:o?4:s,margin:n,color:{dark:t(r.color.dark||"#000000ff"),light:t(r.color.light||"#ffffffff")},type:r.type,rendererOpts:r.rendererOpts||{}}},e.getScale=function(r,n){return n.width&&n.width>=r+n.margin*2?n.width/(r+n.margin*2):n.scale},e.getImageWidth=function(r,n){const o=e.getScale(r,n);return Math.floor((r+n.margin*2)*o)},e.qrToImageData=function(r,n,o){const s=n.modules.size,a=n.modules.data,u=e.getScale(s,o),l=Math.floor((s+o.margin*2)*u),d=o.margin*u,B=[o.color.light,o.color.dark];for(let m=0;m<l;m++)for(let g=0;g<l;g++){let p=(m*l+g)*4,w=o.color.light;if(m>=d&&g>=d&&m<l-d&&g<l-d){const b=Math.floor((m-d)/u),h=Math.floor((g-d)/u);w=B[a[b*s+h]?1:0]}r[p++]=w.r,r[p++]=w.g,r[p++]=w.b,r[p]=w.a}}})(_t);(function(e){const t=_t;function i(n,o,s){n.clearRect(0,0,o.width,o.height),o.style||(o.style={}),o.height=s,o.width=s,o.style.height=s+"px",o.style.width=s+"px"}function r(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(o,s,a){let u=a,l=s;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),s||(l=r()),u=t.getOptions(u);const d=t.getImageWidth(o.modules.size,u),B=l.getContext("2d"),m=B.createImageData(d,d);return t.qrToImageData(m.data,o,u),i(B,l,d),B.putImageData(m,0,0),l},e.renderToDataURL=function(o,s,a){let u=a;typeof u>"u"&&(!s||!s.getContext)&&(u=s,s=void 0),u||(u={});const l=e.render(o,s,u),d=u.type||"image/png",B=u.rendererOpts||{};return l.toDataURL(d,B.quality)}})($t);var xt={};const Oe=_t;function St(e,t){const i=e.a/255,r=t+'="'+e.hex+'"';return i<1?r+" "+t+'-opacity="'+i.toFixed(2).slice(1)+'"':r}function gt(e,t,i){let r=e+t;return typeof i<"u"&&(r+=" "+i),r}function je(e,t,i){let r="",n=0,o=!1,s=0;for(let a=0;a<e.length;a++){const u=Math.floor(a%t),l=Math.floor(a/t);!u&&!o&&(o=!0),e[a]?(s++,a>0&&u>0&&e[a-1]||(r+=o?gt("M",u+i,.5+l+i):gt("m",n,0),n=0,o=!1),u+1<t&&e[a+1]||(r+=gt("h",s),s=0)):n++}return r}xt.render=function(t,i,r){const n=Oe.getOptions(i),o=t.modules.size,s=t.modules.data,a=o+n.margin*2,u=n.color.light.a?"<path "+St(n.color.light,"fill")+' d="M0 0h'+a+"v"+a+'H0z"/>':"",l="<path "+St(n.color.dark,"stroke")+' d="'+je(s,o,n.margin)+'"/>',d='viewBox="0 0 '+a+" "+a+'"',m='<svg xmlns="http://www.w3.org/2000/svg" '+(n.width?'width="'+n.width+'" height="'+n.width+'" ':"")+d+' shape-rendering="crispEdges">'+u+l+`</svg>
`;return typeof r=="function"&&r(null,m),m};const Ge=ue,yt=Pt,qt=$t,Qe=xt;function bt(e,t,i,r,n){const o=[].slice.call(arguments,1),s=o.length,a=typeof o[s-1]=="function";if(!a&&!Ge())throw new Error("Callback required as last argument");if(a){if(s<2)throw new Error("Too few arguments provided");s===2?(n=i,i=t,t=r=void 0):s===3&&(t.getContext&&typeof n>"u"?(n=r,r=void 0):(n=r,r=i,i=t,t=void 0))}else{if(s<1)throw new Error("Too few arguments provided");return s===1?(i=t,t=r=void 0):s===2&&!t.getContext&&(r=i,i=t,t=void 0),new Promise(function(u,l){try{const d=yt.create(i,r);u(e(d,t,r))}catch(d){l(d)}})}try{const u=yt.create(i,r);n(null,e(u,t,r))}catch(u){n(u)}}Q.create=yt.create;Q.toCanvas=bt.bind(null,qt.render);Q.toDataURL=bt.bind(null,qt.renderToDataURL);Q.toString=bt.bind(null,function(e,t,i){return Qe.render(e,i)});const We={class:"main-container w-[375px] mx-auto my-[20px] relative"},Ze={class:"flex h-full"},Xe=["src"],tn={class:"w-[375px] border border-slate-100 bg-body pt-[20px] px-[20px]"},en={class:"font-bold text-xl mb-[40px]"},nn={class:"mb-[20px] flex flex-col"},on={class:"mb-[10px]"},rn={key:0,class:"w-[400px] absolute bg-body top-[10%] -right-[450px]"},sn={class:"info-wrap mt-[20px]"},an={class:"text-gray-400"},Vn=Yt({__name:"preview",setup(e){const t=D(""),i=D(""),r=D(""),n=D(""),o=D(!1),s=D(!1),a=D(!1),u=D(0);new Date().getTime();const l=Zt();l.query.id=l.query.id||0,l.query.name=l.query.name||"",te().then(f=>{i.value=f.data.wap_domain,t.value=f.data.wap_url,B()});const d=()=>{t.value=i.value+"/wap",B(),Tt.set({key:"wap_domain",data:t.value}),s.value=!0,a.value=!1},B=()=>{let f=Tt.get("siteInfo"),c="";f&&(c=f.site_code),ne({id:l.query.id,name:l.query.name}).then(E=>{let C=E.data;n.value=`${t.value}/${C.page}&mode=preview&site_id=${c}`,Q.toDataURL(n.value,{errorCorrectionLevel:"L",margin:0,width:100}).then(_=>{r.value=_})})},m=()=>{if(n.value){var f=new Date().getTime(),c=f-u.value;c<1e3?(a.value=!0,s.value=!1,n.value="",r.value=""):(a.value=!1,s.value=!0),o.value=!0}},g=Ot({qr_code:""}),p=D("weapp");Xt().then(f=>{if(f.code==1){let c=f.data;g.qr_code=c.qr_code}});const{copy:w,isSupported:b,copied:h}=Wt(),y=f=>{b.value||Nt({message:S("notSupportCopy"),type:"warning"}),w(f)};return jt(h,()=>{h.value&&Nt({message:S("copySuccess"),type:"success"})}),(f,c)=>{const E=oe,C=re,_=Gt,I=Qt,A=ie,T=ae,z=se;return K(),Z("div",We,[Y(F("div",Ze,[Y(F("iframe",{class:"w-[375px] border border-slate-100 bg-gray-100",src:n.value,frameborder:"0",id:"previewIframe",onLoad:m},null,40,Xe),[[O,s.value]]),Y(F("div",tn,[F("div",en,H(P(S)("developTitle")),1),F("div",nn,[F("text",on,H(P(S)("wapDomain")),1),N(E,{modelValue:i.value,"onUpdate:modelValue":c[0]||(c[0]=U=>i.value=U),placeholder:P(S)("wapDomainPlaceholder"),clearable:""},null,8,["modelValue","placeholder"])]),N(C,{type:"primary",onClick:d},{default:M(()=>[X(H(P(S)("confirm")),1)]),_:1})],512),[[O,a.value]]),s.value?(K(),Z("div",rn,[F("div",sn,[N(z,{"label-width":"40px",class:"px-[20px]"},{default:M(()=>[N(A,{label:P(S)("preview")},{default:M(()=>[N(I,{modelValue:p.value,"onUpdate:modelValue":c[1]||(c[1]=U=>p.value=U)},{default:M(()=>[N(_,{label:"weapp"},{default:M(()=>[X(H(P(S)("weapp")),1)]),_:1}),N(_,{label:"wechat"},{default:M(()=>[X(H(P(S)("wechat")),1)]),_:1})]),_:1},8,["modelValue"])]),_:1},8,["label"]),p.value=="wechat"?(K(),Z(At,{key:0},[Y(N(A,{label:P(S)("link")},{default:M(()=>[N(E,{readonly:"",value:n.value},{append:M(()=>[N(C,{onClick:c[2]||(c[2]=U=>y(n.value)),class:"bg-primary copy"},{default:M(()=>[X(H(P(S)("copy")),1)]),_:1})]),_:1},8,["value"])]),_:1},8,["label"]),[[O,n.value]]),Y(N(A,{label:" "},{default:M(()=>[N(T,{src:r.value},null,8,["src"])]),_:1},512),[[O,r.value]])],64)):ut("",!0),p.value=="weapp"?(K(),Z(At,{key:1},[g.qr_code?(K(),It(A,{key:0,label:" "},{default:M(()=>[N(T,{class:"w-[100px] h-[100px]",src:P(ee)(g.qr_code)},null,8,["src"])]),_:1})):(K(),It(A,{key:1,label:" "},{default:M(()=>[F("span",an,H(P(S)("weappNotSet")),1)]),_:1}))],64)):ut("",!0)]),_:1})])])):ut("",!0)],512),[[O,o.value]])])}}});export{Vn as default};