H5-ThreeDoorder/unpackage/dist/build/web/static/js/pages-pages-recharge-rechar...

1 line
92 KiB
JavaScript

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-pages-recharge-rechargeSubgift-QR_code"],{"02ee":function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("6f47"),r={name:"lime-painter-view",mixins:[(0,n.children)("painter"),(0,n.parent)("painter")],props:{css:[String,Object]},data:function(){return{type:"view",el:{css:{},views:[]}}},mounted:function(){}};e.default=r},"03e2":function(t,e,i){"use strict";i.r(e);var n=i("6ea9"),r=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},"04fe":function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("64aa");var n={props:{board:Object,pathType:String,fileType:{type:String,default:"png"},quality:{type:Number,default:1},css:[String,Object],width:[Number,String],height:[Number,String],pixelRatio:Number,customStyle:String,isCanvasToTempFilePath:Boolean,sleep:{type:Number,default:1e3/30},beforeDelay:{type:Number,default:100},afterDelay:{type:Number,default:100},useCORS:Boolean}};e.default=n},"0893":function(t,e,i){var n=i("b3a4");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var r=i("967d").default;r("50bfbd2a",n,!0,{sourceMap:!1,shadowMode:!1})},"156d":function(t,e,i){"use strict";(function(t){i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("aa9c"),i("7a76"),i("c9b5"),i("bf0f");var n={};(function(){function e(t){this.mode=r.MODE_8BIT_BYTE,this.data=t}function i(t,e){this.typeNumber=t,this.errorCorrectLevel=e,this.modules=null,this.moduleCount=0,this.dataCache=null,this.dataList=new Array}e.prototype={getLength:function(t){return this.data.length},write:function(t){for(var e=0;e<this.data.length;e++)t.put(this.data.charCodeAt(e),8)}},i.prototype={addData:function(t){var i=new e(t);this.dataList.push(i),this.dataCache=null},isDark:function(t,e){if(t<0||this.moduleCount<=t||e<0||this.moduleCount<=e)throw new Error(t+","+e);return this.modules[t][e]},getModuleCount:function(){return this.moduleCount},make:function(){if(this.typeNumber<1){var t=1;for(t=1;t<40;t++){for(var e=d.getRSBlocks(t,this.errorCorrectLevel),i=new f,n=0,r=0;r<e.length;r++)n+=e[r].dataCount;for(r=0;r<this.dataList.length;r++){var o=this.dataList[r];i.put(o.mode,4),i.put(o.getLength(),s.getLengthInBits(o.mode,t)),o.write(i)}if(i.getLengthInBits()<=8*n)break}this.typeNumber=t}this.makeImpl(!1,this.getBestMaskPattern())},makeImpl:function(t,e){this.moduleCount=4*this.typeNumber+17,this.modules=new Array(this.moduleCount);for(var n=0;n<this.moduleCount;n++){this.modules[n]=new Array(this.moduleCount);for(var r=0;r<this.moduleCount;r++)this.modules[n][r]=null}this.setupPositionProbePattern(0,0),this.setupPositionProbePattern(this.moduleCount-7,0),this.setupPositionProbePattern(0,this.moduleCount-7),this.setupPositionAdjustPattern(),this.setupTimingPattern(),this.setupTypeInfo(t,e),this.typeNumber>=7&&this.setupTypeNumber(t),null==this.dataCache&&(this.dataCache=i.createData(this.typeNumber,this.errorCorrectLevel,this.dataList)),this.mapData(this.dataCache,e)},setupPositionProbePattern:function(t,e){for(var i=-1;i<=7;i++)if(!(t+i<=-1||this.moduleCount<=t+i))for(var n=-1;n<=7;n++)e+n<=-1||this.moduleCount<=e+n||(this.modules[t+i][e+n]=0<=i&&i<=6&&(0==n||6==n)||0<=n&&n<=6&&(0==i||6==i)||2<=i&&i<=4&&2<=n&&n<=4)},getBestMaskPattern:function(){for(var t=0,e=0,i=0;i<8;i++){this.makeImpl(!0,i);var n=s.getLostPoint(this);(0==i||t>n)&&(t=n,e=i)}return e},createMovieClip:function(t,e,i){var n=t.createEmptyMovieClip(e,i);this.make();for(var r=0;r<this.modules.length;r++)for(var o=1*r,a=0;a<this.modules[r].length;a++){var s=1*a,h=this.modules[r][a];h&&(n.beginFill(0,100),n.moveTo(s,o),n.lineTo(s+1,o),n.lineTo(s+1,o+1),n.lineTo(s,o+1),n.endFill())}return n},setupTimingPattern:function(){for(var t=8;t<this.moduleCount-8;t++)null==this.modules[t][6]&&(this.modules[t][6]=t%2==0);for(var e=8;e<this.moduleCount-8;e++)null==this.modules[6][e]&&(this.modules[6][e]=e%2==0)},setupPositionAdjustPattern:function(){for(var t=s.getPatternPosition(this.typeNumber),e=0;e<t.length;e++)for(var i=0;i<t.length;i++){var n=t[e],r=t[i];if(null==this.modules[n][r])for(var o=-2;o<=2;o++)for(var a=-2;a<=2;a++)this.modules[n+o][r+a]=-2==o||2==o||-2==a||2==a||0==o&&0==a}},setupTypeNumber:function(t){for(var e=s.getBCHTypeNumber(this.typeNumber),i=0;i<18;i++){var n=!t&&1==(e>>i&1);this.modules[Math.floor(i/3)][i%3+this.moduleCount-8-3]=n}for(i=0;i<18;i++){n=!t&&1==(e>>i&1);this.modules[i%3+this.moduleCount-8-3][Math.floor(i/3)]=n}},setupTypeInfo:function(t,e){for(var i=this.errorCorrectLevel<<3|e,n=s.getBCHTypeInfo(i),r=0;r<15;r++){var o=!t&&1==(n>>r&1);r<6?this.modules[r][8]=o:r<8?this.modules[r+1][8]=o:this.modules[this.moduleCount-15+r][8]=o}for(r=0;r<15;r++){o=!t&&1==(n>>r&1);r<8?this.modules[8][this.moduleCount-r-1]=o:r<9?this.modules[8][15-r-1+1]=o:this.modules[8][15-r-1]=o}this.modules[this.moduleCount-8][8]=!t},mapData:function(t,e){for(var i=-1,n=this.moduleCount-1,r=7,o=0,a=this.moduleCount-1;a>0;a-=2){6==a&&a--;while(1){for(var h=0;h<2;h++)if(null==this.modules[n][a-h]){var c=!1;o<t.length&&(c=1==(t[o]>>>r&1));var u=s.getMask(e,n,a-h);u&&(c=!c),this.modules[n][a-h]=c,r--,-1==r&&(o++,r=7)}if(n+=i,n<0||this.moduleCount<=n){n-=i,i=-i;break}}}}},i.PAD0=236,i.PAD1=17,i.createData=function(t,e,n){for(var r=d.getRSBlocks(t,e),o=new f,a=0;a<n.length;a++){var h=n[a];o.put(h.mode,4),o.put(h.getLength(),s.getLengthInBits(h.mode,t)),h.write(o)}var c=0;for(a=0;a<r.length;a++)c+=r[a].dataCount;if(o.getLengthInBits()>8*c)throw new Error("code length overflow. ("+o.getLengthInBits()+">"+8*c+")");o.getLengthInBits()+4<=8*c&&o.put(0,4);while(o.getLengthInBits()%8!=0)o.putBit(!1);while(1){if(o.getLengthInBits()>=8*c)break;if(o.put(i.PAD0,8),o.getLengthInBits()>=8*c)break;o.put(i.PAD1,8)}return i.createBytes(o,r)},i.createBytes=function(t,e){for(var i=0,n=0,r=0,o=new Array(e.length),a=new Array(e.length),h=0;h<e.length;h++){var c=e[h].dataCount,d=e[h].totalCount-c;n=Math.max(n,c),r=Math.max(r,d),o[h]=new Array(c);for(var f=0;f<o[h].length;f++)o[h][f]=255&t.buffer[f+i];i+=c;var l=s.getErrorCorrectPolynomial(d),p=new u(o[h],l.getLength()-1),g=p.mod(l);a[h]=new Array(l.getLength()-1);for(f=0;f<a[h].length;f++){var v=f+g.getLength()-a[h].length;a[h][f]=v>=0?g.get(v):0}}var m=0;for(f=0;f<e.length;f++)m+=e[f].totalCount;var b=new Array(m),y=0;for(f=0;f<n;f++)for(h=0;h<e.length;h++)f<o[h].length&&(b[y++]=o[h][f]);for(f=0;f<r;f++)for(h=0;h<e.length;h++)f<a[h].length&&(b[y++]=a[h][f]);return b};for(var r={MODE_NUMBER:1,MODE_ALPHA_NUM:2,MODE_8BIT_BYTE:4,MODE_KANJI:8},o={L:1,M:0,Q:3,H:2},a={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7},s={PATTERN_POSITION_TABLE:[[],[6,18],[6,22],[6,26],[6,30],[6,34],[6,22,38],[6,24,42],[6,26,46],[6,28,50],[6,30,54],[6,32,58],[6,34,62],[6,26,46,66],[6,26,48,70],[6,26,50,74],[6,30,54,78],[6,30,56,82],[6,30,58,86],[6,34,62,90],[6,28,50,72,94],[6,26,50,74,98],[6,30,54,78,102],[6,28,54,80,106],[6,32,58,84,110],[6,30,58,86,114],[6,34,62,90,118],[6,26,50,74,98,122],[6,30,54,78,102,126],[6,26,52,78,104,130],[6,30,56,82,108,134],[6,34,60,86,112,138],[6,30,58,86,114,142],[6,34,62,90,118,146],[6,30,54,78,102,126,150],[6,24,50,76,102,128,154],[6,28,54,80,106,132,158],[6,32,58,84,110,136,162],[6,26,54,82,110,138,166],[6,30,58,86,114,142,170]],G15:1335,G18:7973,G15_MASK:21522,getBCHTypeInfo:function(t){var e=t<<10;while(s.getBCHDigit(e)-s.getBCHDigit(s.G15)>=0)e^=s.G15<<s.getBCHDigit(e)-s.getBCHDigit(s.G15);return(t<<10|e)^s.G15_MASK},getBCHTypeNumber:function(t){var e=t<<12;while(s.getBCHDigit(e)-s.getBCHDigit(s.G18)>=0)e^=s.G18<<s.getBCHDigit(e)-s.getBCHDigit(s.G18);return t<<12|e},getBCHDigit:function(t){var e=0;while(0!=t)e++,t>>>=1;return e},getPatternPosition:function(t){return s.PATTERN_POSITION_TABLE[t-1]},getMask:function(t,e,i){switch(t){case a.PATTERN000:return(e+i)%2==0;case a.PATTERN001:return e%2==0;case a.PATTERN010:return i%3==0;case a.PATTERN011:return(e+i)%3==0;case a.PATTERN100:return(Math.floor(e/2)+Math.floor(i/3))%2==0;case a.PATTERN101:return e*i%2+e*i%3==0;case a.PATTERN110:return(e*i%2+e*i%3)%2==0;case a.PATTERN111:return(e*i%3+(e+i)%2)%2==0;default:throw new Error("bad maskPattern:"+t)}},getErrorCorrectPolynomial:function(t){for(var e=new u([1],0),i=0;i<t;i++)e=e.multiply(new u([1,h.gexp(i)],0));return e},getLengthInBits:function(t,e){if(1<=e&&e<10)switch(t){case r.MODE_NUMBER:return 10;case r.MODE_ALPHA_NUM:return 9;case r.MODE_8BIT_BYTE:return 8;case r.MODE_KANJI:return 8;default:throw new Error("mode:"+t)}else if(e<27)switch(t){case r.MODE_NUMBER:return 12;case r.MODE_ALPHA_NUM:return 11;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 10;default:throw new Error("mode:"+t)}else{if(!(e<41))throw new Error("type:"+e);switch(t){case r.MODE_NUMBER:return 14;case r.MODE_ALPHA_NUM:return 13;case r.MODE_8BIT_BYTE:return 16;case r.MODE_KANJI:return 12;default:throw new Error("mode:"+t)}}},getLostPoint:function(t){for(var e=t.getModuleCount(),i=0,n=0;n<e;n++)for(var r=0;r<e;r++){for(var o=0,a=t.isDark(n,r),s=-1;s<=1;s++)if(!(n+s<0||e<=n+s))for(var h=-1;h<=1;h++)r+h<0||e<=r+h||0==s&&0==h||a==t.isDark(n+s,r+h)&&o++;o>5&&(i+=3+o-5)}for(n=0;n<e-1;n++)for(r=0;r<e-1;r++){var c=0;t.isDark(n,r)&&c++,t.isDark(n+1,r)&&c++,t.isDark(n,r+1)&&c++,t.isDark(n+1,r+1)&&c++,0!=c&&4!=c||(i+=3)}for(n=0;n<e;n++)for(r=0;r<e-6;r++)t.isDark(n,r)&&!t.isDark(n,r+1)&&t.isDark(n,r+2)&&t.isDark(n,r+3)&&t.isDark(n,r+4)&&!t.isDark(n,r+5)&&t.isDark(n,r+6)&&(i+=40);for(r=0;r<e;r++)for(n=0;n<e-6;n++)t.isDark(n,r)&&!t.isDark(n+1,r)&&t.isDark(n+2,r)&&t.isDark(n+3,r)&&t.isDark(n+4,r)&&!t.isDark(n+5,r)&&t.isDark(n+6,r)&&(i+=40);var u=0;for(r=0;r<e;r++)for(n=0;n<e;n++)t.isDark(n,r)&&u++;var d=Math.abs(100*u/e/e-50)/5;return i+=10*d,i}},h={glog:function(t){if(t<1)throw new Error("glog("+t+")");return h.LOG_TABLE[t]},gexp:function(t){while(t<0)t+=255;while(t>=256)t-=255;return h.EXP_TABLE[t]},EXP_TABLE:new Array(256),LOG_TABLE:new Array(256)},c=0;c<8;c++)h.EXP_TABLE[c]=1<<c;for(c=8;c<256;c++)h.EXP_TABLE[c]=h.EXP_TABLE[c-4]^h.EXP_TABLE[c-5]^h.EXP_TABLE[c-6]^h.EXP_TABLE[c-8];for(c=0;c<255;c++)h.LOG_TABLE[h.EXP_TABLE[c]]=c;function u(t,e){if(void 0==t.length)throw new Error(t.length+"/"+e);var i=0;while(i<t.length&&0==t[i])i++;this.num=new Array(t.length-i+e);for(var n=0;n<t.length-i;n++)this.num[n]=t[n+i]}function d(t,e){this.totalCount=t,this.dataCount=e}function f(){this.buffer=new Array,this.length=0}u.prototype={get:function(t){return this.num[t]},getLength:function(){return this.num.length},multiply:function(t){for(var e=new Array(this.getLength()+t.getLength()-1),i=0;i<this.getLength();i++)for(var n=0;n<t.getLength();n++)e[i+n]^=h.gexp(h.glog(this.get(i))+h.glog(t.get(n)));return new u(e,0)},mod:function(t){if(this.getLength()-t.getLength()<0)return this;for(var e=h.glog(this.get(0))-h.glog(t.get(0)),i=new Array(this.getLength()),n=0;n<this.getLength();n++)i[n]=this.get(n);for(n=0;n<t.getLength();n++)i[n]^=h.gexp(h.glog(t.get(n))+e);return new u(i,0).mod(t)}},d.RS_BLOCK_TABLE=[[1,26,19],[1,26,16],[1,26,13],[1,26,9],[1,44,34],[1,44,28],[1,44,22],[1,44,16],[1,70,55],[1,70,44],[2,35,17],[2,35,13],[1,100,80],[2,50,32],[2,50,24],[4,25,9],[1,134,108],[2,67,43],[2,33,15,2,34,16],[2,33,11,2,34,12],[2,86,68],[4,43,27],[4,43,19],[4,43,15],[2,98,78],[4,49,31],[2,32,14,4,33,15],[4,39,13,1,40,14],[2,121,97],[2,60,38,2,61,39],[4,40,18,2,41,19],[4,40,14,2,41,15],[2,146,116],[3,58,36,2,59,37],[4,36,16,4,37,17],[4,36,12,4,37,13],[2,86,68,2,87,69],[4,69,43,1,70,44],[6,43,19,2,44,20],[6,43,15,2,44,16],[4,101,81],[1,80,50,4,81,51],[4,50,22,4,51,23],[3,36,12,8,37,13],[2,116,92,2,117,93],[6,58,36,2,59,37],[4,46,20,6,47,21],[7,42,14,4,43,15],[4,133,107],[8,59,37,1,60,38],[8,44,20,4,45,21],[12,33,11,4,34,12],[3,145,115,1,146,116],[4,64,40,5,65,41],[11,36,16,5,37,17],[11,36,12,5,37,13],[5,109,87,1,110,88],[5,65,41,5,66,42],[5,54,24,7,55,25],[11,36,12],[5,122,98,1,123,99],[7,73,45,3,74,46],[15,43,19,2,44,20],[3,45,15,13,46,16],[1,135,107,5,136,108],[10,74,46,1,75,47],[1,50,22,15,51,23],[2,42,14,17,43,15],[5,150,120,1,151,121],[9,69,43,4,70,44],[17,50,22,1,51,23],[2,42,14,19,43,15],[3,141,113,4,142,114],[3,70,44,11,71,45],[17,47,21,4,48,22],[9,39,13,16,40,14],[3,135,107,5,136,108],[3,67,41,13,68,42],[15,54,24,5,55,25],[15,43,15,10,44,16],[4,144,116,4,145,117],[17,68,42],[17,50,22,6,51,23],[19,46,16,6,47,17],[2,139,111,7,140,112],[17,74,46],[7,54,24,16,55,25],[34,37,13],[4,151,121,5,152,122],[4,75,47,14,76,48],[11,54,24,14,55,25],[16,45,15,14,46,16],[6,147,117,4,148,118],[6,73,45,14,74,46],[11,54,24,16,55,25],[30,46,16,2,47,17],[8,132,106,4,133,107],[8,75,47,13,76,48],[7,54,24,22,55,25],[22,45,15,13,46,16],[10,142,114,2,143,115],[19,74,46,4,75,47],[28,50,22,6,51,23],[33,46,16,4,47,17],[8,152,122,4,153,123],[22,73,45,3,74,46],[8,53,23,26,54,24],[12,45,15,28,46,16],[3,147,117,10,148,118],[3,73,45,23,74,46],[4,54,24,31,55,25],[11,45,15,31,46,16],[7,146,116,7,147,117],[21,73,45,7,74,46],[1,53,23,37,54,24],[19,45,15,26,46,16],[5,145,115,10,146,116],[19,75,47,10,76,48],[15,54,24,25,55,25],[23,45,15,25,46,16],[13,145,115,3,146,116],[2,74,46,29,75,47],[42,54,24,1,55,25],[23,45,15,28,46,16],[17,145,115],[10,74,46,23,75,47],[10,54,24,35,55,25],[19,45,15,35,46,16],[17,145,115,1,146,116],[14,74,46,21,75,47],[29,54,24,19,55,25],[11,45,15,46,46,16],[13,145,115,6,146,116],[14,74,46,23,75,47],[44,54,24,7,55,25],[59,46,16,1,47,17],[12,151,121,7,152,122],[12,75,47,26,76,48],[39,54,24,14,55,25],[22,45,15,41,46,16],[6,151,121,14,152,122],[6,75,47,34,76,48],[46,54,24,10,55,25],[2,45,15,64,46,16],[17,152,122,4,153,123],[29,74,46,14,75,47],[49,54,24,10,55,25],[24,45,15,46,46,16],[4,152,122,18,153,123],[13,74,46,32,75,47],[48,54,24,14,55,25],[42,45,15,32,46,16],[20,147,117,4,148,118],[40,75,47,7,76,48],[43,54,24,22,55,25],[10,45,15,67,46,16],[19,148,118,6,149,119],[18,75,47,31,76,48],[34,54,24,34,55,25],[20,45,15,61,46,16]],d.getRSBlocks=function(t,e){var i=d.getRsBlockTable(t,e);if(void 0==i)throw new Error("bad rs block @ typeNumber:"+t+"/errorCorrectLevel:"+e);for(var n=i.length/3,r=new Array,o=0;o<n;o++)for(var a=i[3*o+0],s=i[3*o+1],h=i[3*o+2],c=0;c<a;c++)r.push(new d(s,h));return r},d.getRsBlockTable=function(t,e){switch(e){case o.L:return d.RS_BLOCK_TABLE[4*(t-1)+0];case o.M:return d.RS_BLOCK_TABLE[4*(t-1)+1];case o.Q:return d.RS_BLOCK_TABLE[4*(t-1)+2];case o.H:return d.RS_BLOCK_TABLE[4*(t-1)+3];default:return}},f.prototype={get:function(t){var e=Math.floor(t/8);return 1==(this.buffer[e]>>>7-t%8&1)},put:function(t,e){for(var i=0;i<e;i++)this.putBit(1==(t>>>e-i-1&1))},getLengthInBits:function(){return this.length},putBit:function(t){var e=Math.floor(this.length/8);this.buffer.length<=e&&this.buffer.push(0),t&&(this.buffer[e]|=128>>>this.length%8),this.length++}},n={errorCorrectLevel:o,defaults:{size:354,margin:0,backgroundColor:"#ffffff",foregroundColor:"#000000",fileType:"png",errorCorrectLevel:o.H,typeNumber:-1},make:function(e){var n=this;return new Promise((function(r,o){var a={canvasId:e.canvasId,componentInstance:e.componentInstance,text:e.text,size:n.defaults.size,margin:n.defaults.margin,backgroundColor:n.defaults.backgroundColor,foregroundColor:n.defaults.foregroundColor,fileType:n.defaults.fileType,errorCorrectLevel:n.defaults.errorCorrectLevel,typeNumber:n.defaults.typeNumber};if(e)for(var s in e)a[s]=e[s];e=a,e.canvasId?function(){var t=new i(e.typeNumber,e.errorCorrectLevel);t.addData(function(t){for(var e,i="",n=0;n<t.length;n++)e=t.charCodeAt(n),e>=1&&e<=127?i+=t.charAt(n):e>2047?(i+=String.fromCharCode(224|e>>12&15),i+=String.fromCharCode(128|e>>6&63),i+=String.fromCharCode(128|e>>0&63)):(i+=String.fromCharCode(192|e>>6&31),i+=String.fromCharCode(128|e>>0&63));return i}(e.text)),t.make();var n=uni.createCanvasContext(e.canvasId,e.componentInstance);n.setFillStyle(e.backgroundColor),n.fillRect(0,0,e.size,e.size);for(var a=(e.size-2*e.margin)/t.getModuleCount(),s=a,h=0;h<t.getModuleCount();h++)for(var c=0;c<t.getModuleCount();c++){var u=t.isDark(h,c)?e.foregroundColor:e.backgroundColor;n.setFillStyle(u);var d=Math.round(c*a)+e.margin,f=Math.round(h*s)+e.margin,l=Math.ceil((c+1)*a)-Math.floor(c*a),p=Math.ceil((h+1)*a)-Math.floor(h*a);n.fillRect(d,f,l,p)}setTimeout((function(){n.draw(!1,function(){setTimeout((function(){uni.canvasToTempFilePath({canvasId:e.canvasId,fileType:e.fileType,width:e.size,height:e.size,destWidth:e.size,destHeight:e.size,success:function(t){var i,n=t.tempFilePath;i=n,e.success&&e.success(i),r(i)},fail:function(t){e.fail&&e.fail(t),o(t)},complete:function(t){e.complete&&e.complete(t)}},e.componentInstance)}),e.text.length+100)}())}),150)}():t.error("uQRCode: Please set canvasId!")}))}}})();var r=n;e.default=r}).call(this,i("ba7c")["default"])},"17c2":function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){}));var n=function(){var t=this.$createElement,e=this._self._c||t;return e("div")},r=[]},2106:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){}));var n=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{ref:"limepainter",staticClass:"lime-painter"},[t.canvasId&&t.size?i("v-uni-view",{style:t.styles},[t.use2dCanvas?i("v-uni-canvas",{staticClass:"lime-painter__canvas",style:t.size,attrs:{id:t.canvasId,type:"2d"}}):i("v-uni-canvas",{staticClass:"lime-painter__canvas",style:t.size,attrs:{"canvas-id":t.canvasId,id:t.canvasId,width:t.boardWidth*t.dpr,height:t.boardHeight*t.dpr}})],1):t._e(),t._t("default")],2)},r=[]},"3d5a":function(t,e,i){"use strict";var n=i("0893"),r=i.n(n);r.a},5549:function(t,e,i){"use strict";(function(t){i("6a54");var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.base64ToPath=function(t){var e=/^data:image\/(\w+);base64,/.exec(t)||[],i=(0,s.default)(e,2);i[1];return new Promise((function(e,i){for(var n=t.split(",")[0].split(":")[1].split(";")[0],r=atob(t.split(",")[1]),o=new ArrayBuffer(r.length),a=new Uint8Array(o),s=0;s<r.length;s++)a[s]=r.charCodeAt(s);e(URL.createObjectURL(new Blob([a],{type:n})))}))},e.compareVersion=function(t,e){t=t.split("."),e=e.split(".");var i=Math.max(t.length,e.length);while(t.length<i)t.push("0");while(e.length<i)e.push("0");for(var n=0;n<i;n++){var r=parseInt(t[n],10),o=parseInt(e[n],10);if(r>o)return 1;if(r<o)return-1}return 0},e.downloadFile=function(t){return t?new Promise((function(e,i){if(c[t])return i();c[t]=1,uni.downloadFile({url:t,success:function(t){e(t)},fail:function(t){i(t)}})})):Promise.reject({err:"no url"})},e.getImageInfo=function(e,i){var n=this;return new Promise(function(){var s=(0,a.default)((0,r.default)().mark((function a(s,u){var f;return(0,r.default)().wrap((function(r){while(1)switch(r.prev=r.next){case 0:if(f=e,!c[e]||!c[e].errMsg){r.next=5;break}s(c[e]),r.next=16;break;case 5:if(r.prev=5,!i){r.next=10;break}return r.next=9,d(e);case 9:f=r.sent;case 10:r.next=15;break;case 12:r.prev=12,r.t0=r["catch"](5),u((0,o.default)((0,o.default)({},r.t0),{},{src:f}));case 15:uni.getImageInfo({src:f,success:function(t){if(t.path=t.path.replace(/^\./,window.location.origin),n.canvas.createImage){var i=n.canvas.createImage();i.src=t.path,i.onload=function(){t.path=i,c[e]=t,s(c[e])},i.onerror=function(t){u({err:t,path:e})}}else h?s(t):(c[e]=t,s(c[e]))},fail:function(i){t.error({err:i,path:e}),u({err:i,path:e})}});case 16:case"end":return r.stop()}}),a,null,[[5,12]])})));return function(t,e){return s.apply(this,arguments)}}())},e.isBase64=void 0,e.isNumber=u,e.networkReg=void 0,e.pathToBase64=d,e.sleep=function(t){return new Promise((function(e){return setTimeout(e,t)}))},e.toPx=function t(e,i){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("number"===typeof e)return e;if(u(e))return 1*e;if("string"===typeof e){var r=/^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g,o=r.exec(e);if(!e||!o)return 0;var a=o[3];e=parseFloat(e);var s=0;return"rpx"===a?s=uni.upx2px(e):"px"===a?s=1*e:"%"===a?s=e*t(i)/100:"em"===a&&(s=e*t(i||14)),n?1*s.toFixed(2):Math.round(s)}return 0};var r=n(i("2634")),o=n(i("9b1b")),a=n(i("2fdc")),s=n(i("5de6"));i("5c47"),i("0506"),i("bf0f"),i("4626"),i("e838"),i("aa9c"),i("e966"),i("80e3"),i("4db2"),i("5ef2"),i("c976"),i("4d8f"),i("7b97"),i("668a"),i("c5b7"),i("8ff5"),i("2378"),i("641a"),i("64e0"),i("cce3"),i("efba"),i("d009"),i("bd7d"),i("7edd"),i("d798"),i("f547"),i("5e54"),i("b60a"),i("8c18"),i("12973"),i("f991"),i("198e"),i("8557"),i("63b1"),i("1954"),i("1cf1"),i("a1c1"),i("c9b5"),i("15d1"),i("d5c6"),i("5a56"),i("f074"),i("18f7"),i("de6c"),i("dc89"),i("2425");e.networkReg=/^(http|\/\/)/;e.isBase64=function(t){return/^data:image\/(\w+);base64/.test(t)};var h=["devtools"].includes(uni.getSystemInfoSync().platform),c={};function u(t){return/^-?\d+(\.\d+)?$/.test(t)}function d(t){return/^data:/.test(t)?t:new Promise((function(e,i){var n=new Image;n.setAttribute("crossOrigin","Anonymous"),n.onload=function(){var t=document.createElement("canvas");t.width=this.naturalWidth,t.height=this.naturalHeight,t.getContext("2d").drawImage(n,0,0);var i=t.toDataURL("image/png");e(i),t.height=t.width=0},n.src=t+"?v="+Math.random(),n.onerror=function(t){i(t)}}))}}).call(this,i("ba7c")["default"])},"6b5e":function(t,e,i){"use strict";i.r(e);var n=i("839f"),r=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},"6ea9":function(t,e,i){"use strict";(function(t){i("6a54");var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0,i("c223"),i("d4b5"),i("bf0f");n(i("156d"));var r,o=i("1bcb"),a={data:function(){return{path:"",base64Url:"",Base64Img:""}},onLoad:function(e){r=this,t.log(e["code_sn"],"转赠码");var i={code:e["code_sn"]};uni.showLoading({title:"正在生成分享码"}),(0,o.infoAPI)().then((function(e){(0,o.makeCodeAPI)({contents:"https://jc.agrimedia.cn/mkmk/index.html?bm_yq_code=".concat(e["data"]["userInfo"]["invite_code"],"&H5URL=https://jc.agrimedia.cn/privilege/pages/pages-recharge/shareRedEnvelopes/index&other=").concat(JSON.stringify(i))}).then((function(e){if(uni.hideLoading(),e){var i="data:image/png;base64,".concat(uni.arrayBufferToBase64(e));(0,o.getUpTokenAPI)().then((function(t){return r.uploadFilePromise(i,t["data"])})).then((function(e){var i=JSON.parse(e),n="https://img.agrimedia.cn/".concat(i.key);r["base64Url"]=n,t.log(r["Base64Img"],"二维码上传后")}))}}))}))},methods:{saveImageToPhotosAlbum:function(){downloadPics(this["Base64Img"])},success:function(e){var i=this;this["path"]=e,(0,o.getUpTokenAPI)().then((function(t){return i.uploadFilePromise(e,t["data"])})).then((function(e){var n=JSON.parse(e),r="https://img.agrimedia.cn/".concat(n.key);i["Base64Img"]=r,t.log(i["Base64Img"],"上传后")}))},uploadFilePromise:function(e,i){return new Promise((function(n,r){var o=uni.uploadFile({url:"https://up-z1.qiniup.com",filePath:e,name:"file",formData:{key:i.key,token:i.uptoken},success:function(e){n(e.data),t.log(e.data,"上传成功")},fail:function(e){t.log(e,"上传错误"),r()},onUploadProgress:function(e){t.log("upload",e)}});o.onProgressUpdate((function(t){}))}))}}};e.default=a}).call(this,i("ba7c")["default"])},"6f47":function(t,e,i){"use strict";var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.children=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e.indexKey;return{inject:(0,a.default)({},t,{default:null}),watch:{el:{handler:function(t,e){JSON.stringify(t)!=JSON.stringify(e)&&this.bindRelation()},deep:!0,immediate:!0},src:{handler:function(t,e){t!=e&&this.bindRelation()},immediate:!0},text:{handler:function(t,e){t!=e&&this.bindRelation()},immediate:!0},css:{handler:function(t,e){t!=e&&(this.el.css=("object"==(0,o.default)(t)?t:t&&Object.assign.apply(Object,(0,r.default)(s(t))))||{})},immediate:!0},replace:{handler:function(t,e){JSON.stringify(t)!=JSON.stringify(e)&&this.bindRelation()},deep:!0,immediate:!0}},created:function(){var e=this;this._uid||(this._uid=this._.uid),Object.defineProperty(this,"parent",{get:function(){return e[t]||[]}}),Object.defineProperty(this,"index",{get:function(){e.bindRelation();var t=e.parent;t=void 0===t?{}:t;var i=t.el;i=void 0===i?{}:i;var n=i.views,r=void 0===n?[]:n;return r.indexOf(e.el)}}),this.el.type=this.type,this.bindRelation()},beforeDestroy:function(){this.removeEl()},methods:{removeEl:function(){var t=this;this.parent&&(this.parent.el.views=this.parent.el.views.filter((function(e){return e._uid!==t._uid})))},bindRelation:function(){var t=this;if(this.el._uid||(this.el._uid=this._uid),["text","qrcode"].includes(this.type)&&(this.el.text=this.$slots&&this.$slots.default&&this.$slots.default[0].text||"".concat(this.text||"").replace(/\\n/g,"\n")),"image"==this.type&&(this.el.src=this.src),this.parent){var e=this.parent.el.views||[];-1!==e.indexOf(this.el)?this.parent.el.views=e.map((function(e){return e._uid==t._uid?t.el:e})):this.parent.el.views=[].concat((0,r.default)(e),[this.el])}}},mounted:function(){}}},e.parent=function(t){return{provide:function(){return(0,a.default)({},t,this)},data:function(){return{el:{css:{},views:[]}}},watch:{css:{handler:function(t){this.canvasId&&(this.el.css=("object"==(0,o.default)(t)?t:t&&Object.assign.apply(Object,(0,r.default)(s(t))))||{},this.canvasWidth=this.el.css&&this.el.css.width||this.canvasWidth,this.canvasHeight=this.el.css&&this.el.css.height||this.canvasHeight)},immediate:!0}}}};var r=n(i("b7c7")),o=n(i("fcf3")),a=n(i("39d8"));i("fd3c"),i("8f71"),i("bf0f"),i("5c47"),i("0506"),i("f7a5"),i("5ef2"),i("a1c1"),i("d4b5"),i("6a54"),i("4626"),i("c223");var s=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return t.split(";").filter((function(t){return t&&!/^[\n\s]+$/.test(t)})).map((function(t){var e=t.slice(0,t.indexOf(":")),i=t.slice(t.indexOf(":")+1);return(0,a.default)({},e.replace(/-([a-z])/g,(function(){return arguments[1].toUpperCase()})).replace(/\s+/g,""),i.replace(/^\s+/,"").replace(/\s+$/,"")||"")}))}},"72d6":function(t,e,i){"use strict";i.r(e);var n=i("02ee"),r=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},"786f":function(t,e,i){"use strict";i.r(e);var n=i("17c2"),r=i("6b5e");for(var o in r)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(o);var a=i("828b"),s=Object(a["a"])(r["default"],n["b"],n["c"],!1,null,"bef69f9a",null,!1,n["a"],void 0);e["default"]=s.exports},"7a9b":function(t,e,i){"use strict";i.r(e);var n=i("c5cb"),r=i.n(n);for(var o in n)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return n[t]}))}(o);e["default"]=r.a},"839f":function(t,e,i){"use strict";i("6a54"),Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=i("6f47"),r={name:"lime-painter-image",mixins:[(0,n.children)("painter")],props:{css:[String,Object],src:String},data:function(){return{type:"image",el:{css:{},src:null}}}};e.default=r},"884c":function(t,e,i){"use strict";i.d(e,"b",(function(){return r})),i.d(e,"c",(function(){return o})),i.d(e,"a",(function(){return n}));var n={lPainter:i("bc20").default,lPainterView:i("c366").default,lPainterImage:i("786f").default},r=function(){var t=this,e=t.$createElement,i=t._self._c||e;return i("v-uni-view",{staticClass:"content"},[i("v-uni-image",{staticStyle:{width:"100%",height:"100%"},attrs:{src:t.path}}),t.base64Url?i("v-uni-view",[i("l-painter",{attrs:{isCanvasToTempFilePath:!0,"custom-style":"position: fixed; left: 200%",css:"width: 100%; height:100%; background: linear-gradient(,#ff971b 0%, #ff5000 100%)"},on:{success:function(e){arguments[0]=e=t.$handleEvent(e),t.success.apply(void 0,arguments)}}},[i("l-painter-view",{attrs:{css:"box-sizing: border-box; background: #fff; border-radius: 16rpx; width: 670rpx; box-shadow: 0 20rpx 58rpx rgba(0,0,0,.15)"}},[i("l-painter-image",{attrs:{src:"https://img.agrimedia.cn/chwl/20230107-114906.png",css:"object-fit: cover;width: 100%; height: 100%;"}}),i("l-painter-image",{attrs:{src:t.base64Url,css:"object-fit: cover;width: 300rpx; height: 300rpx;position: fixed;left:50%;top:20%;transform: translate(-50%,-20%);"}})],1)],1)],1):t._e(),i("v-uni-canvas",{staticStyle:{position:"fixed",top:"-2000rpx",width:"200rpx",height:"200rpx",margin:"0 auto"},attrs:{"canvas-id":"qrcode"}}),i("v-uni-view",{staticClass:"footer_content"},[i("v-uni-view",{staticClass:"btn btn2",on:{click:function(e){arguments[0]=e=t.$handleEvent(e),t.saveImageToPhotosAlbum.apply(void 0,arguments)}}},[t._v("保存至本地")])],1)],1)},o=[]},9908:function(t,e,i){"use strict";i.r(e);var n=i("884c"),r=i("03e2");for(var o in r)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(o);i("c71a");var a=i("828b"),s=Object(a["a"])(r["default"],n["b"],n["c"],!1,null,"4b05a456",null,!1,n["a"],void 0);e["default"]=s.exports},b3a4:function(t,e,i){var n=i("c86c");e=n(!1),e.push([t.i,".lime-painter[data-v-56095063],\n.lime-painter__canvas[data-v-56095063]{\nwidth:100%;\n}",""]),t.exports=e},bc20:function(t,e,i){"use strict";i.r(e);var n=i("2106"),r=i("7a9b");for(var o in r)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(o);i("3d5a");var a=i("828b"),s=Object(a["a"])(r["default"],n["b"],n["c"],!1,null,"56095063",null,!1,n["a"],void 0);e["default"]=s.exports},bd59:function(t,e,i){var n=i("c2f9");n.__esModule&&(n=n.default),"string"===typeof n&&(n=[[t.i,n,""]]),n.locals&&(t.exports=n.locals);var r=i("967d").default;r("34bb8a7e",n,!0,{sourceMap:!1,shadowMode:!1})},c2f9:function(t,e,i){var n=i("c86c");e=n(!1),e.push([t.i,"uni-page-body[data-v-4b05a456],\n.content[data-v-4b05a456]{width:100%;height:100%}\n\n/* .footer_content{\n\twidth:100%;\n\t\t\tpadding-left: 24rpx;\n\tpadding-right: 24rpx;\n} */.btn[data-v-4b05a456]{\n\t/* width: 94%; */height:%?92?%;border-radius:%?46?%;font-size:%?32?%;line-height:%?92?%;text-align:center;width:%?680?%;left:50%;margin-left:%?-340?%}.btn2[data-v-4b05a456]{background:linear-gradient(141deg,#ffaf00,#f70);color:#fffbf2;position:fixed;bottom:%?148?%}",""]),t.exports=e},c366:function(t,e,i){"use strict";i.r(e);var n=i("f34d"),r=i("72d6");for(var o in r)["default"].indexOf(o)<0&&function(t){i.d(e,t,(function(){return r[t]}))}(o);var a=i("828b"),s=Object(a["a"])(r["default"],n["b"],n["c"],!1,null,"17c7b324",null,!1,n["a"],void 0);e["default"]=s.exports},c5cb:function(t,e,i){"use strict";(function(t){i("6a54");var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(i("2634")),o=n(i("2fdc"));i("c223"),i("dc8a"),i("d4b5"),i("bf0f"),i("5c47"),i("7a76"),i("c9b5"),i("a1c1");var a=i("6f47"),s=n(i("04fe")),h=i("5549"),c=n(i("e1c5")),u={name:"lime-painter",mixins:[s.default,(0,a.parent)("painter"),{}],data:function(){return{use2dCanvas:!1,canvasHeight:150,canvasWidth:null,parentWidth:0,inited:!1,progress:0,firstRender:0,done:!1}},computed:{styles:function(){return"".concat(this.size).concat(this.customStyle||"",";")},canvasId:function(){return"l-painter".concat(this._uid||this._.uid)},size:function(){if(this.boardWidth&&this.boardHeight)return"width:".concat(this.boardWidth,"px; height: ").concat(this.boardHeight,"px;")},dpr:function(){return this.pixelRatio||uni.getSystemInfoSync().pixelRatio},boardWidth:function(){var t=this.elements&&this.elements.css||this.elements||this,e=t.width,i=void 0===e?0:e,n=(0,h.toPx)(i||this.width);return n||Math.max(n,(0,h.toPx)(this.canvasWidth))},boardHeight:function(){var t=this.elements&&this.elements.css||this.elements||this,e=t.height,i=void 0===e?0:e,n=(0,h.toPx)(i||this.height);return n||Math.max(n,(0,h.toPx)(this.canvasHeight))},hasBoard:function(){return this.board&&Object.keys(this.board).length},elements:function(){return this.hasBoard?this.board:JSON.parse(JSON.stringify(this.el))}},watch:{},created:function(){var t=uni.getSystemInfoSync();t.SDKVersion,t.version,t.platform},mounted:function(){var t=this;return(0,o.default)((0,r.default)().mark((function e(){return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.next=2,(0,h.sleep)(30);case 2:return e.next=4,t.getParentWeith();case 4:t.$nextTick((function(){setTimeout((function(){t.$watch("elements",t.watchRender,{deep:!0,immediate:!0})}),30)}));case 5:case"end":return e.stop()}}),e)})))()},methods:{watchRender:function(t,e){var i=this;return(0,o.default)((0,r.default)().mark((function n(){return(0,r.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(t&&t.views&&(i.firstRender?i.firstRender:t.views.length)&&Object.keys(t).length&&JSON.stringify(t)!=JSON.stringify(e)){n.next=2;break}return n.abrupt("return");case 2:i.firstRender=1,clearTimeout(i.rendertimer),i.rendertimer=setTimeout((function(){i.render(t)}),i.beforeDelay);case 5:case"end":return n.stop()}}),n)})))()},setFilePath:function(t,e){var i=this;return(0,o.default)((0,r.default)().mark((function n(){var o,a,s,c;return(0,r.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=t,a=e||i,s=a.pathType,c=void 0===s?i.pathType:s,"base64"!=c||(0,h.isBase64)(t)){n.next=8;break}return n.next=5,(0,h.pathToBase64)(t);case 5:o=n.sent,n.next=12;break;case 8:if("url"!=c||!(0,h.isBase64)(t)){n.next=12;break}return n.next=11,(0,h.base64ToPath)(t);case 11:o=n.sent;case 12:return e&&e.isEmit&&i.$emit("success",o),n.abrupt("return",o);case 14:case"end":return n.stop()}}),n)})))()},getSize:function(t){var e=this;return(0,o.default)((0,r.default)().mark((function i(){var n,o,a,s;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(n=t.css||t,o=n.width,a=t.css||t,s=a.height,e.size){i.next=12;break}if(!o&&!s){i.next=10;break}return e.canvasWidth=o||e.canvasWidth,e.canvasHeight=s||e.canvasHeight,i.next=8,(0,h.sleep)(30);case 8:i.next=12;break;case 10:return i.next=12,e.getParentWeith();case 12:case"end":return i.stop()}}),i)})))()},canvasToTempFilePathSync:function(t){var e=this;this.stopWatch=this.$watch("done",(function(i){i&&(e.canvasToTempFilePath(t),e.stopWatch&&e.stopWatch())}),{immediate:!0})},getParentWeith:function(){var t=this;return new Promise((function(e){uni.createSelectorQuery().in(t).select(".lime-painter").boundingClientRect().exec((function(i){var n=i[0]||{},r=n.width,o=n.height;t.parentWidth=Math.ceil(r||0),t.canvasWidth=t.parentWidth||300,t.canvasHeight=o||t.canvasHeight||150,e(i[0])}))}))},render:function(){var e=arguments,i=this;return(0,o.default)((0,r.default)().mark((function n(){var o,a,s,u,d,f,l,p,g,v,m,b,y,w;return(0,r.default)().wrap((function(n){while(1)switch(n.prev=n.next){case 0:if(o=e.length>0&&void 0!==e[0]?e[0]:{},Object.keys(o).length){n.next=3;break}return n.abrupt("return",t.error("空对象"));case 3:return i.progress=0,i.done=!1,n.next=7,i.getSize(o);case 7:return n.next=9,i.getContext();case 9:if(a=n.sent,s=i.use2dCanvas,u=i.boardWidth,d=i.boardHeight,f=i.canvas,l=i.afterDelay,!s||f){n.next=13;break}return n.abrupt("return",Promise.reject(new Error("render: fail canvas has not been created")));case 13:return i.boundary={top:0,left:0,width:u,height:d},i.painter=null,i.painter||(p=o.css||o,g=p.width,v=o.css||o,v.height,!g&&i.parentWidth&&Object.assign(o,{width:i.parentWidth}),m={context:a,canvas:f,width:u,height:d,pixelRatio:i.dpr,useCORS:i.useCORS,createImage:h.getImageInfo.bind(i),listen:{onProgress:function(t){i.progress=t,i.$emit("progress",t)},onEffectFail:function(t){i.$emit("faill",t)}}},i.painter=new c.default(m)),n.next=18,i.painter.source(JSON.parse(JSON.stringify(o)));case 18:return b=n.sent,y=b.width,w=b.height,i.boundary.height=i.canvasHeight=w,i.boundary.width=i.canvasWidth=y,n.next=25,(0,h.sleep)(i.sleep);case 25:return i.painter.setContext(i.ctx),n.next=28,i.painter.render();case 28:return n.next=30,new Promise((function(t){return i.$nextTick(t)}));case 30:if(s){n.next=33;break}return n.next=33,i.canvasDraw();case 33:if(!l||!s){n.next=36;break}return n.next=36,(0,h.sleep)(l);case 36:return i.$emit("done"),i.done=!0,i.isCanvasToTempFilePath&&i.canvasToTempFilePath().then((function(t){i.$emit("success",t.tempFilePath)})).catch((function(t){i.$emit("fail",new Error(JSON.stringify(t)))})),n.abrupt("return",Promise.resolve({ctx:a,draw:i.painter,node:i.node}));case 40:case"end":return n.stop()}}),n)})))()},canvasDraw:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise((function(i,n){return t.ctx.draw(e,(function(){return setTimeout((function(){return i()}),t.afterDelay)}))}))},getContext:function(){var e=this;return(0,o.default)((0,r.default)().mark((function i(){var n,o,a;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(e.canvasWidth){i.next=4;break}return e.$emit("fail","painter no size"),t.error("painter no size: 请给画板或父级设置尺寸"),i.abrupt("return",Promise.reject());case 4:if(!e.ctx||!e.inited){i.next=6;break}return i.abrupt("return",Promise.resolve(e.ctx));case 6:if(n=e.type,o=e.use2dCanvas,e.dpr,e.boardWidth,e.boardHeight,a=function(){return new Promise((function(t){uni.createSelectorQuery().in(e).select("#".concat(e.canvasId)).boundingClientRect().exec((function(i){if(i){var n=uni.createCanvasContext(e.canvasId,e);e.inited||(e.inited=!0,e.use2dCanvas=!1,e.canvas=i),e.ctx=n,t(e.ctx)}}))}))},o){i.next=10;break}return i.abrupt("return",a());case 10:return i.abrupt("return",new Promise((function(t){uni.createSelectorQuery().in(e).select("#".concat(e.canvasId)).node().exec((function(i){var r=i[0].node;r||(e.use2dCanvas=!1,t(e.getContext()));var o=r.getContext(n);e.inited||(e.inited=!0,e.use2dCanvas=!0,e.canvas=r),e.ctx=o,t(e.ctx)}))})));case 11:case"end":return i.stop()}}),i)})))()},canvasToTempFilePath:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return new Promise(function(){var i=(0,o.default)((0,r.default)().mark((function i(n,a){var s,h,c,u,d,f,l,p,g,v,m,b,y,w,x,S,P;return(0,r.default)().wrap((function(i){while(1)switch(i.prev=i.next){case 0:if(s=t.use2dCanvas,h=t.canvasId,c=t.dpr,u=t.fileType,d=t.quality,f=function(){var e=(0,o.default)((0,r.default)().mark((function e(i){var o;return(0,r.default)().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.setFilePath(i.tempFilePath||i);case 3:o=e.sent,n(Object.assign(i,{tempFilePath:o})),e.next=10;break;case 7:e.prev=7,e.t0=e["catch"](0),t.$emit("fail",e.t0);case 10:case"end":return e.stop()}}),e,null,[[0,7]])})));return function(t){return e.apply(this,arguments)}}(),l=t.boundary||t,p=l.top,g=void 0===p?0:p,v=l.left,m=void 0===v?0:v,b=l.width,y=l.height,w=b*c,x=y*c,S=Object.assign({x:m,y:g,width:b,height:y,destWidth:w,destHeight:x,canvasId:h,fileType:u,quality:d,success:f,fail:a},e),!s){i.next=22;break}return i.prev=7,e.pathType||t.pathType||(e.pathType="url"),i.next=11,t.setFilePath(t.canvas.toDataURL("image/".concat(e.fileType||u).replace(/pg/,"peg"),e.quality||d),e);case 11:P=i.sent,e.success&&e.success({tempFilePath:P}),n({tempFilePath:P}),i.next=20;break;case 16:i.prev=16,i.t0=i["catch"](7),e.fail&&e.fail(i.t0),a(i.t0);case 20:i.next=23;break;case 22:uni.canvasToTempFilePath(S,t);case 23:case"end":return i.stop()}}),i,null,[[7,16]])})));return function(t,e){return i.apply(this,arguments)}}())}}};e.default=u}).call(this,i("ba7c")["default"])},c71a:function(t,e,i){"use strict";var n=i("bd59"),r=i.n(n);r.a},e1c5:function(t,e,i){"use strict";(function(t){var n=i("f5bd").default;Object.defineProperty(e,"__esModule",{value:!0}),e.default=e.Painter=void 0;var r=n(i("fcf3"));i("bf0f"),i("01a2"),i("e39c"),i("844d"),i("18f7"),i("de6c"),i("7a76"),i("c9b5"),i("aa9c"),i("5c47"),i("0506"),i("e838"),i("9db6"),i("2c10"),i("5ef2"),i("0c26"),i("20f3"),i("6a54"),i("8a8d"),i("f7a5"),i("08eb"),i("4626"),i("5ac7"),i("4100"),i("2797"),i("473f"),i("dc8a"),i("fd3c"),i("aa77"),i("a1c1"),i("c223"),i("c1a3"),i("1851"),i("8f71"),i("d4b5"),i("22b6");var o=function(){return o=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var r in e=arguments[i])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},o.apply(this,arguments)};function a(t,e,i,n){return new(i||(i=Promise))((function(r,o){function a(t){try{h(n.next(t))}catch(t){o(t)}}function s(t){try{h(n.throw(t))}catch(t){o(t)}}function h(t){var e;t.done?r(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,s)}h((n=n.apply(t,e||[])).next())}))}function s(t,e){var i,n,r,o,a={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(i)throw new TypeError("Generator is already executing.");for(;a;)try{if(i=1,n&&(r=2&o[0]?n.return:o[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,o[1])).done)return r;switch(n=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,n=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(r=a.trys,!((r=r.length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){a.label=o[1];break}if(6===o[0]&&a.label<r[1]){a.label=r[1],r=o;break}if(r&&a.label<r[2]){a.label=r[2],a.ops.push(o);break}r[2]&&a.ops.pop(),a.trys.pop();continue}o=e.call(t,a)}catch(t){o=[6,t],n=0}finally{i=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}var h={MP_WEIXIN:"mp-weixin",MP_QQ:"mp-qq",MP_ALIPAY:"mp-alipay",MP_BAIDU:"mp-baidu",MP_TOUTIAO:"mp-toutiao",MP_DINGDING:"mp-dingding",H5:"h5",WEB:"web",PLUS:"plus"},c=["contentSize","clientSize","borderSize","offsetSize"],u="view",d="text",f="image",l="qrcode",p="block",g={display:p,color:"#000000",lineHeight:"1.4em",fontSize:14,fontWeight:400,fontFamily:"sans-serif",lineCap:"butt",flexDirection:"row",flexWrap:"nowrap",textAlign:"left",alignItems:"flex-start",justifyContent:"flex-start",position:"static",transformOrigin:"center center"},v={upx2px:function(t){return window.innerWidth/750*t},getSystemInfoSync:function(){return{screenWidth:window.innerWidth}},getImageInfo:function(t){var e=t.src,i=t.success,n=t.fail,r=new Image;r.onload=function(){i({width:r.naturalWidth,height:r.naturalHeight,path:r.src,src:e})},r.onerror=n,r.src=e}},m="object"==("undefined"===typeof window?"undefined":(0,r.default)(window))?"undefined"==typeof uni||"undefined"!=typeof uni&&!uni.addInterceptor?h.WEB:h.H5:"object"==("undefined"===typeof swan?"undefined":(0,r.default)(swan))?h.MP_BAIDU:"object"==("undefined"===typeof tt?"undefined":(0,r.default)(tt))?h.MP_TOUTIAO:"object"==("undefined"===typeof plus?"undefined":(0,r.default)(plus))?h.PLUS:"object"==("undefined"===typeof wx?"undefined":(0,r.default)(wx))?h.MP_WEIXIN:void 0,b=m==h.MP_WEIXIN?wx:"undefined"!=typeof uni?uni.getImageInfo?{upx2px:function(t){return uni.upx2px(t)},getSystemInfoSync:function(){return uni.getSystemInfoSync()},getImageInfo:function(t){return uni.getImageInfo(t)},downloadFile:function(t){return uni.downloadFile(t)}}:Object.assign(uni,v):"undefined"!=typeof window?v:uni;if(!b.upx2px){var y=((b.getSystemInfoSync&&uni.getSystemInfoSync()).screenWidth||375)/750;b.upx2px=function(t){return y*t}}function w(t){return/^-?\d+(\.\d+)?$/.test(t)}function x(t,e,i){if("number"==typeof t)return t;if(w(t))return 1*t;if("string"==typeof t){var n=/^-?([0-9]+)?([.]{1}[0-9]+){0,1}(em|rpx|px|%)$/g.exec(t);if(!t||!n)return 0;var r=n[3];t=parseFloat(t);var o=0;return"rpx"===r?o=b.upx2px(t):"px"===r?o=1*t:"%"===r&&e?o=t*x(e)/100:"em"===r&&e&&(o=t*x(e||14)),1*o.toFixed(2)}return 0}function S(t){return/%$/.test(t)}function P(t){for(var e=[],i=[],n=0,r=t.substring(0,t.length-1).split("%,");n<r.length;n++){var o=r[n];e.push(o.substring(0,o.lastIndexOf(" ")).trim()),i.push(o.substring(o.lastIndexOf(" "),o.length)/100)}return{colors:e,percents:i}}function k(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function T(){return T=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},T.apply(this,arguments)}function B(t,e){return B=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},B(t,e)}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function I(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return C(t,e);var i=Object.prototype.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?C(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0;return function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function M(t){return"number"==typeof t}function O(t){return"auto"===t||null===t}function L(t){return/%$/.test(t)}var z,A=0,E=function(){function t(){k(this,"elements",[]),k(this,"afterElements",[]),k(this,"beforeElements",[]),k(this,"ids",[]),k(this,"width",0),k(this,"height",0),k(this,"top",0),k(this,"left",0),k(this,"pre",null),k(this,"offsetX",0),k(this,"offsetY",0),A++,this.id=A}var e=t.prototype;return e.fixedBind=function(t,e){void 0===e&&(e=0),this.container=e?t.parent:t.root,this.container.fixedLine=this,this.fixedAdd(t)},e.fixedAdd=function(t){this.elements.push(t);var e=t.computedStyle.zIndex;(void 0===e?0:e)>=0?this.afterElements.push(t):this.beforeElements.push(t),this.refreshLayout()},e.bind=function(t){this.container=t.parent,this.container.line=null,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),this.isInline=t.isInline(),this.container.line=this,this.outerWidth=t.parent&&t.parent.contentSize.width?t.parent.contentSize.width:1/0,this.add(t)},e.getPreLine=function(){return this.container.lines[this.container.lines.length-2]},e.canIEnter=function(t){return this.outerWidth||t.parent&&t.parent.contentSize.width,!((100*t.offsetSize.width+100*this.width)/100>this.outerWidth)||(this.closeLine(),!1)},e.closeLine=function(){delete this.container.line},e.add=function(t){this.ids.includes(t.id)||(this.ids.push(t.id),this.elements.push(t),this.refreshWidthHeight(t))},e.refreshWidthHeight=function(t){t.offsetSize.height>this.height&&(this.height=t.offsetSize.height),this.width+=t.offsetSize.width||0,(this.container.lineMaxWidth||0)<this.width&&(this.container.lineMaxWidth=this.width)},e.refreshXAlign=function(){if(this.isInline){var t=this.container.contentSize.width-this.width,e=this.container.style.textAlign;"center"===e?t/=2:"left"===e&&(t=0),this.offsetX=t}},e.getOffsetY=function(t){if(!t||!t.style)return 0;var e=(t.style||{}).verticalAlign;return"bottom"===e?this.height-t.contentSize.height:"middle"===e?(this.height-t.contentSize.height)/2:0},e.layout=function(t,e){for(var i in this.refreshXAlign(),this.pre?(this.top=this.pre.top+this.pre.height+this.offsetY,this.left=e+this.offsetX):(this.top=Math.max(this.top,this.container.contentSize.top,t)+this.offsetY,this.left=Math.max(this.left,this.container.contentSize.left,e)+this.offsetX),this.elements){var n=this.elements[i],r=this.elements[i-1],o=this.getOffsetY(n);n.style.top=this.top+o,n.style.left=r?r.offsetSize.left+r.offsetSize.width:this.left,n.getBoxPosition2()}},e.refreshLayout=function(){this.afterElements=this.afterElements.sort((function(t,e){return t.computedStyle.zIndex-e.computedStyle.zIndex})),this.beforeElements=this.beforeElements.sort((function(t,e){return t.computedStyle.zIndex-e.computedStyle.zIndex}))},t}(),R=((z={})["row"]={width:"width",contentWidth:"width",x:"x",y:"y",contentX:"left",height:"height",contentHeight:"height",marginLeft:"marginLeft"},z["column"]={width:"height",contentWidth:"height",x:"y",y:"x",contentX:"top",height:"width",contentHeight:"width",marginLeft:"marginTop"},z),_=function(e){var i,n;function r(){var t;return k(function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t=e.call(this)||this),"outerWidth",0),t.exactValue=0,t.flexTotal=0,t.key=null,t}n=e,(i=r).prototype=Object.create(n.prototype),i.prototype.constructor=i,B(i,n);var o=r.prototype;return o.bind=function(e){t.warn("[painter] flex-box 功能未完善谨慎使用"),this.container=e.parent,this.container.line=this,this.container.lines?(this.container.lines.push(this),this.pre=this.getPreLine(),this.top=this.pre.top+this.pre.height,this.left=this.container.contentSize.left):(this.top=this.container.contentSize.top,this.left=this.container.contentSize.left,this.container.lines=[this]),e.parent&&(this.key=R[e.parent.style.flexDirection]),this.initHeight(e),this.outerWidth=e.parent&&e.parent.contentSize[this.key.contentWidth]?e.parent.contentSize[this.key.contentWidth]:1/0,this.add(e)},o.add=function(t){this.ids.push(t.id),M(t.style.flex)?this.flexTotal+=t.style.flex:M(t.style[this.key.width])&&(this.exactValue+=t.contentSize[this.key.width]),this.elements.push(t),this.refreshWidthHeight(t),t.next||this.closeLine()},o.closeLine=function(){this.calcFlex()},o.initHeight=function(t){this[this.key.height]=0},o.calcFlex=function(){var t=this,e=this.container.contentSize[this.key.contentWidth];this.elements.forEach((function(i){var n=i.style.width||0;M(i.style.flex)&&(n=i.style.flex/t.flexTotal*(e-t.exactValue)),i.computedStyle[t.key.width]=n,delete i.line,delete i.lines,delete i.lineMaxWidth,i.getBoxWidthHeight()}))},o.refreshWidthHeight=function(t){this.container.style.alignItems&&!t.style.alignSelf&&(t.style.alignSelf=this.container.style.alignItems),t.contentSize[this.key.height]>this[this.key.height]&&(this[this.key.height]=t.offsetSize[this.key.height]),this[this.key.width]+=t.offsetSize[this.key.width];var e=Math.min(this[this.key.width],this.container.contentSize[this.key.width]);(this.container.lineMaxWidth||0)<e&&(this.container.lineMaxWidth=e)},o.refreshXAlign=function(){var t=this,e=this.elements.reduce((function(e,i){return e+i.offsetSize[t.key.width]}),0),i=this.outerWidth==1/0?0:this.outerWidth-Math.max(this[this.key.width],e),n=this.container.style.justifyContent;"center"===n?i/=2:"flex-start"===n?i=0:["space-between","space-around"].includes(n)&&(function(e,i){void 0===i&&(i=0),i/=t.elements.length+(e?-1:1),t.elements.forEach((function(n,r){var o;e&&!r||(n.style.margin?n.style.margin[t.key.marginLeft]+=i:n.style.margin=((o={})[t.key.marginLeft]=i,o))})),i=0}("space-between"==n,i),i=0),this.offsetX=i||0,this.refreshYAlign()},o.refreshYAlign=function(){if(1==this.container.lines.length)return 0;var t=this.container.lines.reduce((function(t,e){return t+e.height}),0);if("center"===this.container.style.alignItems){var e=(this.container.contentSize[this.key.contentHeight]-t)/(this.container.lines.length+1);this.container.lines.forEach((function(t){t.offsetY=e}))}if("flex-end"===this.container.style.alignItems){var i=this.container.contentSize[this.key.contentHeight]-t;this.container.lines[0].offsetY=i}},o.getOffsetY=function(t){return this.container.lines.length>1?0:"flex-end"===t.style.alignSelf?this.container.contentSize[this.key.contentHeight]-t.contentSize[this.key.height]:"center"===t.style.alignSelf?(this.container.contentSize[this.key.contentHeight]-t.contentSize[this.key.height])/2:0},r}(E),W=f,j=d,D=u,F=l,N="inline-block",H="flex",$="absolute",U="fixed",X=0,Y={left:null,top:null,width:null,height:null},J=function(){function e(t,e,i,n){var r=this;k(this,"id",X++),k(this,"style",{left:null,top:null,width:null,height:null}),k(this,"computedStyle",{}),k(this,"originStyle",{}),k(this,"children",{}),k(this,"layoutBox",T({},Y)),k(this,"contentSize",T({},Y)),k(this,"clientSize",T({},Y)),k(this,"borderSize",T({},Y)),k(this,"offsetSize",T({},Y)),this.ctx=n,this.root=i,e&&(this.parent=e),this.name=t.name||t.type,this.attributes=this.getAttributes(t);var o=this.getComputedStyle(t,e&&e.computedStyle);this.isAbsolute=o.position==$,this.isFixed=o.position==U,this.originStyle=o,Object.keys(o).forEach((function(t){Object.defineProperty(r.style,t,{configurable:!0,enumerable:!0,get:function(){return o[t]},set:function(e){o[t]=e}})}));var a={contentSize:T({},this.contentSize),clientSize:T({},this.clientSize),borderSize:T({},this.borderSize),offsetSize:T({},this.offsetSize)};Object.keys(a).forEach((function(t){Object.keys(r[t]).forEach((function(e){Object.defineProperty(r[t],e,{configurable:!0,enumerable:!0,get:function(){return a[t][e]},set:function(i){a[t][e]=i}})}))})),this.computedStyle=this.style}var i=e.prototype;return i.add=function(t){t.parent=this,this.children[t.id]=t},i.getChildren=function(){var t=this;return Object.keys(this.children).map((function(e){return t.children[e]}))},i.getLineRect=function(t,e){var i=e?e.lines:this.parent&&this.parent.lines;return i&&i.find((function(e){return e.ids.includes(t)}))||{width:0,height:0}},i.getComputedStyle=function(e,i){var n=["color","fontSize","lineHeight","verticalAlign","fontWeight","textAlign"],o=e.css,a=void 0===o?{}:o,s=e.type,h=void 0===s?D:s,c=T({},g);if([j,W,F].includes(h)&&!a.display&&(c.display=N),i)for(var u=0;u<n.length;u++){var d=n[u];(a[d]||i[d])&&(a[d]=a[d]||i[d])}for(var f=function(){var e=p[l],i=a[e];if(/-/.test(e)&&(e=e.replace(/-([a-z])/g,(function(t,e){return e.toUpperCase()})),c.key=i),/^(box|text)?shadow$/i.test(e)){var n=[];return i.replace(/((\d+(rpx|px)?\s+?){3})(.+)/,(function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];n=e[1].match(/\d+(rpx|px)?/g).map((function(t){return x(t)})).concat(e[4])})),/^text/.test(e)?c.textShadow=n:c.boxShadow=n,"continue"}if(/^border/i.test(e)&&!/radius$/i.test(e)){var o,s=e.match(/^border([BTRLa-z]+)?/)[0],u=e.match(/[W|S|C][a-z]+/),d=i.replace(/([\(,])\s+|\s+([\),])/g,"$1$2").split(" ").map((function(t){return/^\d/.test(t)?x(t,""):t}));return c[s]=((o={})[s+"Width"]=w(d[0])?d[0]:0,o[s+"Style"]=d[1]||"solid",o[s+"Color"]=d[2]||"black",o),1==d.length&&u&&(c[s][s+u[0]]=d[0]),"continue"}if(/^background(color)?$/i.test(e))return c.backgroundColor=i,"continue";if(/^objectPosition$/i.test(e))return c[e]=i.split(" "),"continue";if(/padding|margin|radius/i.test(e)){var f=/radius$/i.test(e),g=f?"borderRadius":e.match(/[a-z]+/)[0],v=[0,0,0,0].map((function(t,e){return f?["borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius"][e]:[g+"Top",g+"Right",g+"Bottom",g+"Left"][e]})),m="margin";if("padding"===e||e===m||/^(border)?radius$/i.test(e)){var b,y=(""+i).split(" ").map((function(t){return/^\d+(rpx|px)?$/.test(t)?x(t):e!=m&&/auto/.test(t)?0:t}),[])||[0],S=f?"borderRadius":e,P=y[0],k=y[1],T=y[2],B=y[3];c[S]=((b={})[v[0]]=O(P)?0:P,b[v[1]]=w(k)||O(k)?k:P,b[v[2]]=O(w(T)?T:P)?0:w(T)?T:P,b[v[3]]=w(B)?B:k||P,b)}else{var C;"object"==(0,r.default)(c[g])||(c[g]=((C={})[v[0]]=c[g]||0,C[v[1]]=c[g]||0,C[v[2]]=c[g]||0,C[v[3]]=c[g]||0,C)),c[g][e]=g==m&&O(i)||L(i)?i:x(i)}return"continue"}if(/^transform$/i.test(e))return c[e]={},i.replace(/([a-zA-Z]+)\(([0-9,-\.%rpxdeg\s]+)\)/g,(function(t,i,n){var r=n.split(",").map((function(t){return t.replace(/(^\s*)|(\s*$)/g,"")})),o=function(t,e){return t.includes("deg")?1*t:e&&!L(e)?x(t,e):t};i.includes("matrix")?c[e][i]=r.map((function(t){return 1*t})):i.includes("rotate")?c[e][i]=1*n.match(/^-?\d+(\.\d+)?/)[0]:/[X, Y]/.test(i)?c[e][i]=/[X]/.test(i)?o(r[0],a.width):o(r[0],a.height):(c[e][i+"X"]=o(r[0],a.width),c[e][i+"Y"]=o(r[1]||r[0],a.height))})),"continue";/^font$/i.test(e)&&t.warn("font 不支持简写"),/^left|top$/i.test(e)&&![$,U].includes(a.position)?c[e]=0:c[e]=/^[\d\.]+(px|rpx)?$/.test(i)?x(i):/em$/.test(i)&&h==j?x(i,a.fontSize):i},l=0,p=Object.keys(a);l<p.length;l++)f();return c},i.setPosition=function(t,e){var i={left:"width",top:"height",right:"width",bottom:"height"};Object.keys(i).forEach((function(n){var r="right"==n?"left":"top";["right","bottom"].includes(n)&&void 0!==t.style[n]&&"number"!=typeof t.originStyle[r]?t.style[r]=e[i[n]]-t.offsetSize[i[n]]-x(t.style[n],e[i[n]]):t.style[n]=x(t.style[n],e[i[n]])}))},i.getAttributes=function(t){var e=t.attributes||{};return(t.url||t.src)&&(e.src=e.src||t.url||t.src),t.replace&&(e.replace=t.replace),t.text&&(e.text=t.text),e},i.getOffsetSize=function(t,e,i){void 0===i&&(i=c[3]);var n=e||{},r=n.margin,o=(r=void 0===r?{}:r).marginLeft,a=void 0===o?0:o,s=r.marginTop,h=void 0===s?0:s,u=r.marginRight,d=void 0===u?0:u,f=r.marginBottom,l=void 0===f?0:f,p=n.padding,g=(p=void 0===p?{}:p).paddingLeft,v=void 0===g?0:g,m=p.paddingTop,b=void 0===m?0:m,y=p.paddingRight,w=void 0===y?0:y,x=p.paddingBottom,S=void 0===x?0:x,P=n.border,k=(P=void 0===P?{}:P).borderWidth,T=void 0===k?0:k,B=n.borderTop,C=(B=void 0===B?{}:B).borderTopWidth,I=void 0===C?T:C,M=n.borderBottom,O=(M=void 0===M?{}:M).borderBottomWidth,L=void 0===O?T:O,z=n.borderRight,A=(z=void 0===z?{}:z).borderRightWidth,E=void 0===A?T:A,R=n.borderLeft,_=(R=void 0===R?{}:R).borderLeftWidth,W=void 0===_?T:_,j=a<0&&d<0?Math.abs(a+d):0,D=h<0&&l<0?Math.abs(h+l):0,F=a>=0&&d<0,N=h>=0&&l<0;return i==c[0]&&(this[i].left=t.left+a+v+W+(F?2*-d:0),this[i].top=t.top+h+b+I+(N?2*-l:0),this[i].width=t.width+(this[i].widthAdd?0:j),this[i].height=t.height+(this[i].heightAdd?0:D),this[i].widthAdd=j,this[i].heightAdd=D),i==c[1]&&(this[i].left=t.left+a+W+(F<0?-d:0),this[i].top=t.top+h+I+(N?-l:0),this[i].width=t.width+v+w,this[i].height=t.height+b+S),i==c[2]&&(this[i].left=t.left+a+W/2+(F<0?-d:0),this[i].top=t.top+h+I/2+(N?-l:0),this[i].width=t.width+v+w+W/2+E/2,this[i].height=t.height+b+S+L/2+I/2),i==c[3]&&(this[i].left=t.left+(F<0?-d:0),this[i].top=t.top+(N?-l:0),this[i].width=t.width+v+w+W+E+a+d,this[i].height=t.height+b+S+L+I+l+h),this[i]},i.layoutBoxUpdate=function(t,e,i,n){var r=this;if(void 0===i&&(i=-1),"border-box"==e.boxSizing){var o=e||{},a=o.border,s=(a=void 0===a?{}:a).borderWidth,h=void 0===s?0:s,u=o.borderTop,d=(u=void 0===u?{}:u).borderTopWidth,f=void 0===d?h:d,l=o.borderBottom,p=(l=void 0===l?{}:l).borderBottomWidth,g=void 0===p?h:p,v=o.borderRight,m=(v=void 0===v?{}:v).borderRightWidth,b=void 0===m?h:m,y=o.borderLeft,w=(y=void 0===y?{}:y).borderLeftWidth,x=void 0===w?h:w,S=o.padding,P=(S=void 0===S?{}:S).paddingTop,k=void 0===P?0:P,T=S.paddingRight,B=void 0===T?0:T,C=S.paddingBottom,I=void 0===C?0:C,M=S.paddingLeft,O=void 0===M?0:M;i||(t.width-=O+B+b+x),1!==i||n||(t.height-=k+I+f+g)}this.layoutBox&&(c.forEach((function(i){return r.layoutBox[i]=r.getOffsetSize(t,e,i)})),this.layoutBox=Object.assign({},this.layoutBox,this.layoutBox.borderSize))},i.getBoxPosition2=function(){var t=this.computedStyle,e=this.fixedLine,i=this.lines,n=t.left,r=void 0===n?0:n,o=t.top,a=void 0===o?0:o,s=t.padding||{},h=s.paddingBottom,c=void 0===h?0:h,u=s.paddingRight,d=void 0===u?0:u,f=T({},this.contentSize,{left:r,top:a}),l=this.contentSize.top-this.offsetSize.top,p=this.contentSize.left-this.offsetSize.left;if(this.root.fixedLine&&!this.root.isDone){this.root.isDone=!0;for(var g,v=I(this.root.fixedLine.elements);!(g=v()).done;){var m=g.value;m.setPosition(m,this.root.offsetSize),m.getBoxPosition2()}}if(e)for(var b,y=I(e.elements);!(b=y()).done;){var w=b.value;w.setPosition(w,f),w.style.left+=r+p+d,w.style.top+=a+l+c,w.getBoxPosition2()}if(i)for(var x,S=I(i);!(x=S()).done;)x.value.layout(f.top+l,f.left+p);return this.layoutBoxUpdate(f,t),this.layoutBox},i.getBoxState=function(t,e){return this.isBlock(t)||this.isBlock(e)},i.isBlock=function(t){return void 0===t&&(t=this),t&&"block"==t.style.display},i.isFlex=function(t){return void 0===t&&(t=this),t&&t.style.display==H},i.isInFlow=function(){return!(this.isAbsolute||this.isFixed)},i.inFlexBox=function(t){return void 0===t&&(t=this),!!t.isInFlow()&&!!t.parent&&(!(!t.parent||t.parent.style.display!==H)||void 0)},i.isInline=function(t){return void 0===t&&(t=this),t&&t.style.display==N},i.contrastSize=function(t,e,i){var n=t;return i&&(n=Math.min(n,i)),e&&(n=Math.max(n,e)),n},i.measureText=function(t,e){var i=this.ctx.measureText(t),n=i.width,r=i.actualBoundingBoxAscent,o=i.actualBoundingBoxDescent;return{ascent:r,descent:o,width:n,fontHeight:r+o||.7*e+1}},i.getBoxWidthHeight=function(){var t=this,e=this.name,i=this.computedStyle,n=this.attributes,r=this.parent,o=void 0===r?{}:r,a=this.ctx,s=this.getChildren(),h=i.left,c=void 0===h?0:h,u=i.top,d=void 0===u?0:u,f=i.bottom,l=i.right,p=i.width,g=void 0===p?0:p,v=i.minWidth,m=i.maxWidth,b=i.minHeight,y=i.maxHeight,w=i.height,S=void 0===w?0:w,P=i.fontSize,k=void 0===P?14:P,T=i.fontWeight,B=i.fontFamily,C=i.fontStyle,I=i.position,M=i.lineClamp,O=i.lineHeight,z=i.padding,A=void 0===z?{}:z,R=i.margin,F=void 0===R?{}:R,N=i.border,H=(N=void 0===N?{}:N).borderWidth,U=void 0===H?0:H,X=i.borderRight,Y=(X=void 0===X?{}:X).borderRightWidth,J=void 0===Y?U:Y,G=i.borderLeft,q=(G=void 0===G?{}:G).borderLeftWidth,K=void 0===q?U:q,V=o.contentSize&&o.contentSize.width,Q=o.contentSize&&o.contentSize.height;if(L(g)&&V&&(g=x(g,V)),L(g)&&!V&&(g=null),L(S)&&Q&&(S=x(S,Q)),L(S)&&!Q&&(S=null),L(v)&&V&&(v=x(v,V)),L(m)&&V&&(m=x(m,V)),L(b)&&Q&&(b=x(b,Q)),L(y)&&Q&&(y=x(y,Q)),i.padding&&V)for(var Z in i.padding)Object.hasOwnProperty.call(i.padding,Z)&&(i.padding[Z]=x(i.padding[Z],V));var tt=A.paddingRight,et=void 0===tt?0:tt,it=A.paddingLeft,nt=void 0===it?0:it;if(i.margin&&[i.margin.marginLeft,i.margin.marginRight].includes("auto"))if(g){var rt=V&&V-g-et-nt-K-J||0;i.margin.marginLeft==i.margin.marginRight?i.margin.marginLeft=i.margin.marginRight=rt/2:"auto"==i.margin.marginLeft?i.margin.marginLeft=rt:i.margin.marginRight=rt}else i.margin.marginLeft=i.margin.marginRight=0;var ot=F.marginRight,at=void 0===ot?0:ot,st=F.marginLeft,ht={width:g,height:S,left:0,top:0},ct=nt+et+K+J+(void 0===st?0:st)+at;if(e==j&&!this.attributes.widths){var ut=n.text||"";a.save(),a.setFonts({fontFamily:B,fontSize:k,fontWeight:T,fontStyle:C});var dt=new Map;ut.split("\n").map((function(e){var i=e.split("").map((function(e){var i=dt.get(e);if(i)return i;var n=t.measureText(e,k).width;return dt.set(e,n),n})),n=t.measureText(e,k),r=n.fontHeight,o=n.ascent,a=n.descent;t.attributes.fontHeight=r,t.attributes.ascent=o,t.attributes.descent=a,t.attributes.widths||(t.attributes.widths=[]),t.attributes.widths.push({widths:i,total:i.reduce((function(t,e){return t+e}),0)})})),a.restore()}if(e==W&&null==g){var ft=n.width,lt=n.height;ht.width=this.contrastSize(Math.round(ft*S/lt)||0,v,m),this.layoutBoxUpdate(ht,i,0)}if(e==j&&null==g){var pt=this.attributes.widths,gt=Math.max.apply(Math,pt.map((function(t){return t.total})));o&&V>0&&(gt>V||this.isBlock(this))&&!this.isAbsolute&&!this.isFixed&&(gt=V-ct),ht.width=this.contrastSize(gt,v,m),this.layoutBoxUpdate(ht,i,0)}if(e==j&&(o.style.flex||!this.attributes.lines)){var vt=this.attributes.widths.length;this.attributes.widths.forEach((function(t){return t.widths.reduce((function(t,e,i){return t+e>ht.width?(vt++,e):t+e}),0)})),vt=M&&vt>M?M:vt,this.attributes.lines=vt}if(e==W&&null==S){var mt=n.width,bt=n.height;ht.height=this.contrastSize(x(ht.width*bt/mt)||0,b,y),this.layoutBoxUpdate(ht,i,1)}e==j&&null==S&&(O=x(O,k),ht.height=this.contrastSize(x(this.attributes.lines*O),b,y),this.layoutBoxUpdate(ht,i,1,!0)),o&&o.children&&V&&([D,j].includes(e)&&this.isFlex()||e==D&&this.isBlock(this)&&this.isInFlow())&&(ht.width=this.contrastSize(V-ct,v,m),this.layoutBoxUpdate(ht,i)),g&&!L(g)&&(ht.width=this.contrastSize(g,v,m),this.layoutBoxUpdate(ht,i,0)),S&&!L(S)&&(ht.height=this.contrastSize(ht.height,b,y),this.layoutBoxUpdate(ht,i,1));var yt=0;if(s.length){var wt=null;s.forEach((function(e,n){e.getBoxWidthHeight();var r=s[n+1];if(r&&r.isInFlow()&&(e.next=r),e.isInFlow()&&!e.inFlexBox()){var o=t.getBoxState(wt,e);t.line&&t.line.canIEnter(e)&&!o?t.line.add(e):(new E).bind(e),wt=e}else e.inFlexBox()?t.line&&(t.line.canIEnter(e)||"nowrap"==i.flexWrap)?t.line.add(e):(new _).bind(e):e.isFixed?t.root.fixedLine?t.root.fixedLine.fixedAdd(e):(new E).fixedBind(e):t.fixedLine?t.fixedLine.fixedAdd(e):(new E).fixedBind(e,1)})),this.lines&&(yt=this.lines.reduce((function(t,e){return t+e.height}),0))}var xt=0,St=0;if(!g&&(this.isAbsolute||this.isFixed)&&V){var Pt=I==$?V:this.root.width,kt=Pt-(L(c)?x(c,Pt):c)-(L(l)?x(l,Pt):l);xt=i.left?kt:this.lineMaxWidth}if(!S&&(null!=d?d:this.isAbsolute||this.isFixed&&Q)){var Tt=I==$?Q:this.root.height,Bt=Tt-(L(d)?x(d,Tt):d)-(L(f)?x(f,Tt):f);St=i.top?Bt:0}if(g&&!L(g)||ht.width||(ht.width=xt||this.contrastSize((this.isBlock(this)&&!this.isInFlow()?V||o.lineMaxWidth:this.lineMaxWidth)||this.lineMaxWidth,v,m),this.layoutBoxUpdate(ht,i,0)),S||!yt&&!St||(ht.height=St||this.contrastSize(yt,b,y),this.layoutBoxUpdate(ht,i)),i.borderRadius&&this.borderSize&&this.borderSize.width)for(var Z in i.borderRadius)Object.hasOwnProperty.call(i.borderRadius,Z)&&(i.borderRadius[Z]=x(i.borderRadius[Z],this.borderSize.width));return this.layoutBox},i.layout=function(){return this.getBoxWidthHeight(),this.root.offsetSize=this.offsetSize,this.getBoxPosition2(),this.offsetSize},e}(),G=function(){var e,i,n,r,o,a,s=[0,11,15,19,23,27,31,16,18,20,22,24,26,28,20,22,24,24,26,28,28,22,24,24,26,26,28,28,24,24,26,26,26,28,28,24,26,26,26,28,28],h=[3220,1468,2713,1235,3062,1890,2119,1549,2344,2936,1117,2583,1330,2470,1667,2249,2028,3780,481,4011,142,3098,831,3445,592,2517,1776,2234,1951,2827,1070,2660,1345,3177],c=[30660,29427,32170,30877,26159,25368,27713,26998,21522,20773,24188,23371,17913,16590,20375,19104,13663,12392,16177,14854,9396,8579,11994,11245,5769,5054,7399,6608,1890,597,3340,2107],u=[1,0,19,7,1,0,16,10,1,0,13,13,1,0,9,17,1,0,34,10,1,0,28,16,1,0,22,22,1,0,16,28,1,0,55,15,1,0,44,26,2,0,17,18,2,0,13,22,1,0,80,20,2,0,32,18,2,0,24,26,4,0,9,16,1,0,108,26,2,0,43,24,2,2,15,18,2,2,11,22,2,0,68,18,4,0,27,16,4,0,19,24,4,0,15,28,2,0,78,20,4,0,31,18,2,4,14,18,4,1,13,26,2,0,97,24,2,2,38,22,4,2,18,22,4,2,14,26,2,0,116,30,3,2,36,22,4,4,16,20,4,4,12,24,2,2,68,18,4,1,43,26,6,2,19,24,6,2,15,28,4,0,81,20,1,4,50,30,4,4,22,28,3,8,12,24,2,2,92,24,6,2,36,22,4,6,20,26,7,4,14,28,4,0,107,26,8,1,37,22,8,4,20,24,12,4,11,22,3,1,115,30,4,5,40,24,11,5,16,20,11,5,12,24,5,1,87,22,5,5,41,24,5,7,24,30,11,7,12,24,5,1,98,24,7,3,45,28,15,2,19,24,3,13,15,30,1,5,107,28,10,1,46,28,1,15,22,28,2,17,14,28,5,1,120,30,9,4,43,26,17,1,22,28,2,19,14,28,3,4,113,28,3,11,44,26,17,4,21,26,9,16,13,26,3,5,107,28,3,13,41,26,15,5,24,30,15,10,15,28,4,4,116,28,17,0,42,26,17,6,22,28,19,6,16,30,2,7,111,28,17,0,46,28,7,16,24,30,34,0,13,24,4,5,121,30,4,14,47,28,11,14,24,30,16,14,15,30,6,4,117,30,6,14,45,28,11,16,24,30,30,2,16,30,8,4,106,26,8,13,47,28,7,22,24,30,22,13,15,30,10,2,114,28,19,4,46,28,28,6,22,28,33,4,16,30,8,4,122,30,22,3,45,28,8,26,23,30,12,28,15,30,3,10,117,30,3,23,45,28,4,31,24,30,11,31,15,30,7,7,116,30,21,7,45,28,1,37,23,30,19,26,15,30,5,10,115,30,19,10,47,28,15,25,24,30,23,25,15,30,13,3,115,30,2,29,46,28,42,1,24,30,23,28,15,30,17,0,115,30,10,23,46,28,10,35,24,30,19,35,15,30,17,1,115,30,14,21,46,28,29,19,24,30,11,46,15,30,13,6,115,30,14,23,46,28,44,7,24,30,59,1,16,30,12,7,121,30,12,26,47,28,39,14,24,30,22,41,15,30,6,14,121,30,6,34,47,28,46,10,24,30,2,64,15,30,17,4,122,30,29,14,46,28,49,10,24,30,24,46,15,30,4,18,122,30,13,32,46,28,48,14,24,30,42,32,15,30,20,4,117,30,40,7,47,28,43,22,24,30,10,67,15,30,19,6,118,30,18,31,47,28,34,34,24,30,20,61,15,30],d=[255,0,1,25,2,50,26,198,3,223,51,238,27,104,199,75,4,100,224,14,52,141,239,129,28,193,105,248,200,8,76,113,5,138,101,47,225,36,15,33,53,147,142,218,240,18,130,69,29,181,194,125,106,39,249,185,201,154,9,120,77,228,114,166,6,191,139,98,102,221,48,253,226,152,37,179,16,145,34,136,54,208,148,206,143,150,219,189,241,210,19,92,131,56,70,64,30,66,182,163,195,72,126,110,107,58,40,84,250,133,186,61,202,94,155,159,10,21,121,43,78,212,229,172,115,243,167,87,7,112,192,247,140,128,99,13,103,74,222,237,49,197,254,24,227,165,153,119,38,184,180,124,17,68,146,217,35,32,137,46,55,63,209,91,149,188,207,205,144,135,151,178,220,252,190,97,242,86,211,171,20,42,93,158,132,60,57,83,71,109,65,162,31,45,67,216,183,123,164,118,196,23,73,236,127,12,111,246,108,161,59,82,41,157,85,170,251,96,134,177,187,204,62,90,203,89,95,176,156,169,160,81,11,245,22,235,122,117,44,215,79,174,213,233,230,231,173,232,116,214,244,234,168,80,88,175],f=[1,2,4,8,16,32,64,128,29,58,116,232,205,135,19,38,76,152,45,90,180,117,234,201,143,3,6,12,24,48,96,192,157,39,78,156,37,74,148,53,106,212,181,119,238,193,159,35,70,140,5,10,20,40,80,160,93,186,105,210,185,111,222,161,95,190,97,194,153,47,94,188,101,202,137,15,30,60,120,240,253,231,211,187,107,214,177,127,254,225,223,163,91,182,113,226,217,175,67,134,17,34,68,136,13,26,52,104,208,189,103,206,129,31,62,124,248,237,199,147,59,118,236,197,151,51,102,204,133,23,46,92,184,109,218,169,79,158,33,66,132,21,42,84,168,77,154,41,82,164,85,170,73,146,57,114,228,213,183,115,230,209,191,99,198,145,63,126,252,229,215,179,123,246,241,255,227,219,171,75,150,49,98,196,149,55,110,220,165,87,174,65,130,25,50,100,200,141,7,14,28,56,112,224,221,167,83,166,81,162,89,178,121,242,249,239,195,155,43,86,172,69,138,9,18,36,72,144,61,122,244,245,247,243,251,235,203,139,11,22,44,88,176,125,250,233,207,131,27,54,108,216,173,71,142,0],l=[],p=[],g=[],v=[],m=[],b=2;function y(t,e){var i;t>e&&(i=t,t=e,e=i),i=e,i*=e,i+=e,i>>=1,v[i+=t]=1}function w(t,e){var n;for(g[t+i*e]=1,n=-2;n<2;n++)g[t+n+i*(e-2)]=1,g[t-2+i*(e+n+1)]=1,g[t+2+i*(e+n)]=1,g[t+n+1+i*(e+2)]=1;for(n=0;n<2;n++)y(t-1,e+n),y(t+1,e-n),y(t-n,e-1),y(t+n,e+1)}function x(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var S=[];function P(t,e,i,n){var r,o,a;for(r=0;r<n;r++)l[i+r]=0;for(r=0;r<e;r++){if(255!=(a=d[l[t+r]^l[i]]))for(o=1;o<n;o++)l[i+o-1]=l[i+o]^f[x(a+S[n-o])];else for(o=i;o<i+n;o++)l[o]=l[o+1];l[i+n-1]=255==a?0:f[x(a+S[0])]}}function k(t,e){var i;return t>e&&(i=t,t=e,e=i),i=e,i+=e*e,i>>=1,v[i+=t]}function T(t){var e,n,r,o;switch(t){case 0:for(n=0;n<i;n++)for(e=0;e<i;e++)e+n&1||k(e,n)||(g[e+n*i]^=1);break;case 1:for(n=0;n<i;n++)for(e=0;e<i;e++)1&n||k(e,n)||(g[e+n*i]^=1);break;case 2:for(n=0;n<i;n++)for(r=0,e=0;e<i;e++,r++)3==r&&(r=0),r||k(e,n)||(g[e+n*i]^=1);break;case 3:for(o=0,n=0;n<i;n++,o++)for(3==o&&(o=0),r=o,e=0;e<i;e++,r++)3==r&&(r=0),r||k(e,n)||(g[e+n*i]^=1);break;case 4:for(n=0;n<i;n++)for(r=0,o=n>>1&1,e=0;e<i;e++,r++)3==r&&(r=0,o=!o),o||k(e,n)||(g[e+n*i]^=1);break;case 5:for(o=0,n=0;n<i;n++,o++)for(3==o&&(o=0),r=0,e=0;e<i;e++,r++)3==r&&(r=0),(e&n&1)+!(!r|!o)||k(e,n)||(g[e+n*i]^=1);break;case 6:for(o=0,n=0;n<i;n++,o++)for(3==o&&(o=0),r=0,e=0;e<i;e++,r++)3==r&&(r=0),(e&n&1)+(r&&r==o)&1||k(e,n)||(g[e+n*i]^=1);break;case 7:for(o=0,n=0;n<i;n++,o++)for(3==o&&(o=0),r=0,e=0;e<i;e++,r++)3==r&&(r=0),(r&&r==o)+(e+n&1)&1||k(e,n)||(g[e+n*i]^=1)}}function B(t){var e,i=0;for(e=0;e<=t;e++)m[e]>=5&&(i+=3+m[e]-5);for(e=3;e<t-1;e+=2)m[e-2]==m[e+2]&&m[e+2]==m[e-1]&&m[e-1]==m[e+1]&&3*m[e-1]==m[e]&&(0==m[e-3]||e+3>t||3*m[e-3]>=4*m[e]||3*m[e+3]>=4*m[e])&&(i+=40);return i}function C(){var t,e,n,r,o,a=0,s=0;for(e=0;e<i-1;e++)for(t=0;t<i-1;t++)(g[t+i*e]&&g[t+1+i*e]&&g[t+i*(e+1)]&&g[t+1+i*(e+1)]||!(g[t+i*e]||g[t+1+i*e]||g[t+i*(e+1)]||g[t+1+i*(e+1)]))&&(a+=3);for(e=0;e<i;e++){for(m[0]=0,n=r=t=0;t<i;t++)(o=g[t+i*e])==r?m[n]++:m[++n]=1,s+=(r=o)?1:-1;a+=B(n)}s<0&&(s=-s);var h=s,c=0;for(h+=h<<2,h<<=1;h>i*i;)h-=i*i,c++;for(a+=10*c,t=0;t<i;t++){for(m[0]=0,n=r=e=0;e<i;e++)(o=g[t+i*e])==r?m[n]++:m[++n]=1,r=o;a+=B(n)}return a}var I=null;return{api:{get ecclevel(){return b},set ecclevel(t){b=t},get size(){return _size},set size(t){_size=t},get canvas(){return I},set canvas(t){I=t},getFrame:function(t){return function(t){var m,B,I,M,O,L,z,A;M=t.length,e=0;do{if(e++,I=4*(b-1)+16*(e-1),n=u[I++],r=u[I++],o=u[I++],a=u[I],M<=(I=o*(n+r)+r-3+(e<=9)))break}while(e<40);for(i=17+4*e,O=o+(o+a)*(n+r)+r,M=0;M<O;M++)p[M]=0;for(l=t.slice(0),M=0;M<i*i;M++)g[M]=0;for(M=0;M<(i*(i+1)+1)/2;M++)v[M]=0;for(M=0;M<3;M++){for(I=0,B=0,1==M&&(I=i-7),2==M&&(B=i-7),g[B+3+i*(I+3)]=1,m=0;m<6;m++)g[B+m+i*I]=1,g[B+i*(I+m+1)]=1,g[B+6+i*(I+m)]=1,g[B+m+1+i*(I+6)]=1;for(m=1;m<5;m++)y(B+m,I+1),y(B+1,I+m+1),y(B+5,I+m),y(B+m+1,I+5);for(m=2;m<4;m++)g[B+m+i*(I+2)]=1,g[B+2+i*(I+m+1)]=1,g[B+4+i*(I+m)]=1,g[B+m+1+i*(I+4)]=1}if(e>1)for(M=s[e],B=i-7;;){for(m=i-7;m>M-3&&(w(m,B),!(m<M));)m-=M;if(B<=M+9)break;w(6,B-=M),w(B,6)}for(g[8+i*(i-8)]=1,B=0;B<7;B++)y(7,B),y(i-8,B),y(7,B+i-7);for(m=0;m<8;m++)y(m,7),y(m+i-8,7),y(m,i-8);for(m=0;m<9;m++)y(m,8);for(m=0;m<8;m++)y(m+i-8,8),y(8,m);for(B=0;B<7;B++)y(8,B+i-7);for(m=0;m<i-14;m++)1&m?(y(8+m,6),y(6,8+m)):(g[8+m+6*i]=1,g[6+i*(8+m)]=1);if(e>6)for(M=h[e-7],I=17,m=0;m<6;m++)for(B=0;B<3;B++,I--)1&(I>11?e>>I-12:M>>I)?(g[5-m+i*(2-B+i-11)]=1,g[2-B+i-11+i*(5-m)]=1):(y(5-m,2-B+i-11),y(2-B+i-11,5-m));for(B=0;B<i;B++)for(m=0;m<=B;m++)g[m+i*B]&&y(m,B);for(O=l.length,L=0;L<O;L++)p[L]=l.charCodeAt(L);if(l=p.slice(0),O>=(m=o*(n+r)+r)-2&&(O=m-2,e>9&&O--),L=O,e>9){for(l[L+2]=0,l[L+3]=0;L--;)M=l[L],l[L+3]|=255&M<<4,l[L+2]=M>>4;l[2]|=255&O<<4,l[1]=O>>4,l[0]=64|O>>12}else{for(l[L+1]=0,l[L+2]=0;L--;)M=l[L],l[L+2]|=255&M<<4,l[L+1]=M>>4;l[1]|=255&O<<4,l[0]=64|O>>4}for(L=O+3-(e<10);L<m;)l[L++]=236,l[L++]=17;for(S[0]=1,L=0;L<a;L++){for(S[L+1]=1,z=L;z>0;z--)S[z]=S[z]?S[z-1]^f[x(d[S[z]]+L)]:S[z-1];S[0]=f[x(d[S[0]]+L)]}for(L=0;L<=a;L++)S[L]=d[S[L]];for(I=m,B=0,L=0;L<n;L++)P(B,o,I,a),B+=o,I+=a;for(L=0;L<r;L++)P(B,o+1,I,a),B+=o+1,I+=a;for(B=0,L=0;L<o;L++){for(z=0;z<n;z++)p[B++]=l[L+z*o];for(z=0;z<r;z++)p[B++]=l[n*o+L+z*(o+1)]}for(z=0;z<r;z++)p[B++]=l[n*o+L+z*(o+1)];for(L=0;L<a;L++)for(z=0;z<n+r;z++)p[B++]=l[m+L+z*a];for(l=p,m=B=i-1,I=O=1,A=(o+a)*(n+r)+r,L=0;L<A;L++)for(M=l[L],z=0;z<8;z++,M<<=1){128&M&&(g[m+i*B]=1);do{O?m--:(m++,I?0!=B?B--:(I=!I,6==(m-=2)&&(m--,B=9)):B!=i-1?B++:(I=!I,6==(m-=2)&&(m--,B-=8))),O=!O}while(k(m,B))}for(l=g.slice(0),M=0,B=3e4,I=0;I<8&&(T(I),(m=C())<B&&(B=m,M=I),7!=M);I++)g=l.slice(0);for(M!=I&&T(M),B=c[M+(b-1<<3)],I=0;I<8;I++,B>>=1)1&B&&(g[i-1-I+8*i]=1,I<6?g[8+i*I]=1:g[8+i*(I+1)]=1);for(I=0;I<7;I++,B>>=1)1&B&&(g[8+i*(i-7+I)]=1,I?g[6-I+8*i]=1:g[7+8*i]=1);return g}(t)},utf16to8:function(t){var e,i,n,r;for(e="",n=t.length,i=0;i<n;i++)(r=t.charCodeAt(i))>=1&&r<=127?e+=t.charAt(i):r>2047?(e+=String.fromCharCode(224|r>>12&15),e+=String.fromCharCode(128|r>>6&63),e+=String.fromCharCode(128|r>>0&63)):(e+=String.fromCharCode(192|r>>6&31),e+=String.fromCharCode(128|r>>0&63));return e},draw:function(e,n,r,o,a){n.drawView(r,o);var s=n.ctx,h=r.contentSize,c=h.width,u=h.height,d=h.left,f=h.top;o.borderRadius,o.backgroundColor;var l=o.color,p=void 0===l?"#000000":l;if(o.border,r.contentSize.left,r.borderSize.left,r.contentSize.top,r.borderSize.top,b=a||b,s){s.save(),n.setOpacity(o),n.setTransform(r,o);var g=Math.min(c,u);e=this.utf16to8(e);var v=this.getFrame(e),m=g/i;s.setFillStyle(p);for(var y=0;y<i;y++)for(var w=0;w<i;w++)v[w*i+y]&&s.fillRect(d+m*y,f+m*w,m,m);s.restore(),n.setBorder(r,o)}else t.warn("No canvas provided to draw QR code in!")}}}}(),q=d,K=l,V=u,Q="middle",Z=function(){function e(t){var e,i=this;this.v="1.9.3.5",this.id=null,this.pixelRatio=1,this.width=0,this.height=0,this.sleep=1e3/30,this.count=0,this.isRate=!1,this.isDraw=!0,this.isCache=!0,this.fixed="",this.useCORS=!1,this.imageBus=[],this.createImage=function(t,e){return new Promise((function(i,n){if(window){var r=new Image;e&&r.setAttribute("crossOrigin","Anonymous"),r.src=t,r.onload=function(){i({width:r.naturalWidth||r.width,height:r.naturalHeight||r.height,path:r,src:this.src})},r.onerror=function(t){n(t)}}else n({fail:"getImageInfo fail",src:t})}))},this.options=t,Object.assign(this,t),this.ctx=((e=t.context).setFonts=function(t){var i=t.fontFamily,n=void 0===i?"sans-serif":i,r=t.fontSize,o=void 0===r?14:r,a=t.fontWeight,s=void 0===a?"normal":a,c=t.fontStyle,u=void 0===c?"normal":c;m==h.MP_TOUTIAO&&(s="bold"==s?"bold":"",u="italic"==u?"italic":""),e.font="".concat(u," ").concat(s," ").concat(Math.round(o),"px ").concat(n)},e.draw&&e.setFillStyle?e:Object.assign(e,{setStrokeStyle:function(t){e.strokeStyle=t},setLineWidth:function(t){e.lineWidth=t},setLineCap:function(t){e.lineCap=t},setFillStyle:function(t){e.fillStyle=t},setFontSize:function(t){e.font="".concat(String(t),"px sans-serif")},setGlobalAlpha:function(t){e.globalAlpha=t},setLineJoin:function(t){e.lineJoin=t},setTextAlign:function(t){e.textAlign=t},setMiterLimit:function(t){e.miterLimit=t},setShadow:function(t,i,n,r){e.shadowOffsetX=t,e.shadowOffsetY=i,e.shadowBlur=n,e.shadowColor=r},setTextBaseline:function(t){e.textBaseline=t},createCircularGradient:function(){},draw:function(){}})),this.progress=0,this.root={width:t.width,height:t.height,fontSizeRate:1,fixedLine:null},this.size=this.root;var n=0;Object.defineProperty(this,"progress",{configurable:!0,set:function(t){n=t,i.lifecycle("onProgress",t/i.count)},get:function(){return n||0}})}return e.prototype.lifecycle=function(t,e){this.options.listen&&this.options.listen[t]&&this.options.listen[t](e)},e.prototype.setContext=function(t){t&&(this.ctx=t)},e.prototype.init=function(){(this.canvas.height||h.WEB==m)&&(this.canvas.height=this.size.height*this.pixelRatio,this.canvas.width=this.size.width*this.pixelRatio,this.ctx.scale(this.pixelRatio,this.pixelRatio))},e.prototype.clear=function(){this.ctx.clearRect(0,0,this.size.width,this.size.height)},e.prototype.clipPath=function(t,e,i,n,r,o,a){void 0===o&&(o=!1),void 0===a&&(a=!1);var s=this.ctx;if(/polygon/.test(r)){var h=r.match(/-?\d+(rpx|px|%)?\s+-?\d+(rpx|px|%)?/g)||[];s.beginPath(),h.map((function(r){var o=r.split(" "),a=o[0],s=o[1];return[x(a,i)+t,x(s,n)+e]})).forEach((function(t,e){0==e?s.moveTo(t[0],t[1]):s.lineTo(t[0],t[1])})),s.closePath(),a&&s.stroke(),o&&s.fill()}},e.prototype.roundRect=function(t,e,i,n,r,o,a){if(void 0===o&&(o=!1),void 0===a&&(a=!1),!(r<0)){var s=this.ctx;if(s.beginPath(),r){var h=r||{},c=h.borderTopLeftRadius,u=void 0===c?r||0:c,d=h.borderTopRightRadius,f=void 0===d?r||0:d,l=h.borderBottomRightRadius,p=void 0===l?r||0:l,g=h.borderBottomLeftRadius,v=void 0===g?r||0:g;s.arc(t+i-p,e+n-p,p,0,.5*Math.PI),s.lineTo(t+v,e+n),s.arc(t+v,e+n-v,v,.5*Math.PI,Math.PI),s.lineTo(t,e+u),s.arc(t+u,e+u,u,Math.PI,1.5*Math.PI),s.lineTo(t+i-f,e),s.arc(t+i-f,e+f,f,1.5*Math.PI,2*Math.PI),s.lineTo(t+i,e+n-p)}else s.rect(t,e,i,n);s.closePath(),a&&s.stroke(),o&&s.fill()}},e.prototype.setTransform=function(t,e){var i=e.transform,n=e.transformOrigin,r=this.ctx,o=i||{},a=o.scaleX,s=void 0===a?1:a,h=o.scaleY,c=void 0===h?1:h,u=o.translateX,d=void 0===u?0:u,f=o.translateY,l=void 0===f?0:f,p=o.rotate,g=void 0===p?0:p,v=o.skewX,m=void 0===v?0:v,b=o.skewY,y=void 0===b?0:b,S=t.left,P=t.top,k=t.width,T=t.height;d=x(d,k)||0,l=x(l,T)||0;var B={top:x("0%",1),center:x("50%",1),bottom:x("100%",1)},C={left:x("0%",1),center:x("50%",1),right:x("100%",1)};if(n=n.split(" ").filter((function(t,e){return e<2})).reduce((function(t,e){if(/\d+/.test(e)){var i=x(e,1)/(/px|rpx$/.test(e)?w(t.x)?T:k:1);return w(t.x)?Object.assign(t,{y:i}):Object.assign(t,{x:i})}return w(C[e])&&!w(t.x)?Object.assign(t,{x:C[e]}):Object.assign(t,{y:B[e]||.5})}),{}),(d||l)&&r.translate(d,l),(s||c)&&r.scale(s,c),g){var I=S+k*n.x,M=P+T*n.y;r.translate(I,M),r.rotate(g*Math.PI/180),r.translate(-I,-M)}(m||y)&&r.transform(1,Math.tan(y*Math.PI/180),Math.tan(m*Math.PI/180),1,0,0)},e.prototype.setBackground=function(t,e,i,n,r){var o=this.ctx;t&&"transparent"!=t?function(t){return!(!t||!t.startsWith("linear")&&!t.startsWith("radial"))}(t)?function(t,e,i,n,r,o){t.startsWith("linear")?function(t,e,i,n,r,o){for(var a=function(t,e,i,n,r){void 0===n&&(n=0),void 0===r&&(r=0);var o=t.match(/([-]?\d{1,3})deg/),a=o&&o[1]?parseFloat(o[1]):0;if(a>=360&&(a-=360),a<0&&(a+=360),0===(a=Math.round(a)))return{x0:Math.round(e/2)+n,y0:i+r,x1:Math.round(e/2)+n,y1:r};if(180===a)return{x0:Math.round(e/2)+n,y0:r,x1:Math.round(e/2)+n,y1:i+r};if(90===a)return{x0:n,y0:Math.round(i/2)+r,x1:e+n,y1:Math.round(i/2)+r};if(270===a)return{x0:e+n,y0:Math.round(i/2)+r,x1:n,y1:Math.round(i/2)+r};var s=Math.round(180*Math.asin(e/Math.sqrt(Math.pow(e,2)+Math.pow(i,2)))/Math.PI);if(a===s)return{x0:n,y0:i+r,x1:e+n,y1:r};if(a===180-s)return{x0:n,y0:r,x1:e+n,y1:i+r};if(a===180+s)return{x0:e+n,y0:r,x1:n,y1:i+r};if(a===360-s)return{x0:e+n,y0:i+r,x1:n,y1:r};var h,c=0,u=0,d=0,f=0;if(a<s||a>180-s&&a<180||a>180&&a<180+s||a>360-s){var l=a*Math.PI/180,p=a<s||a>360-s?i/2:-i/2,g=Math.tan(l)*p,v=a<s||a>180-s&&a<180?e/2-g:-e/2-g;c=-(d=g+(h=Math.pow(Math.sin(l),2)*v)),u=-(f=p+h/Math.tan(l))}(a>s&&a<90||a>90&&a<90+s||a>180+s&&a<270||a>270&&a<360-s)&&(l=(90-a)*Math.PI/180,g=a>s&&a<90||a>90&&a<90+s?e/2:-e/2,p=Math.tan(l)*g,v=a>s&&a<90||a>270&&a<360-s?i/2-p:-i/2-p,c=-(d=g+(h=Math.pow(Math.sin(l),2)*v)/Math.tan(l)),u=-(f=p+h));return c=Math.round(c+e/2)+n,u=Math.round(i/2-u)+r,d=Math.round(d+e/2)+n,f=Math.round(i/2-f)+r,{x0:c,y0:u,x1:d,y1:f}}(r,t,e,i,n),s=a.x0,h=a.y0,c=a.x1,u=a.y1,d=o.createLinearGradient(s,h,c,u),f=r.match(/linear-gradient\((.+)\)/)[1],l=P(f.substring(f.indexOf(",")+1)),p=0;p<l.colors.length;p++)d.addColorStop(l.percents[p],l.colors[p]);o.setFillStyle(d)}(e,i,n,r,t,o):t.startsWith("radial")&&function(t,e,i,n,r,o){for(var a=P(r.match(/radial-gradient\((.+)\)/)[1]),s=Math.round(t/2)+i,h=Math.round(e/2)+n,c=o.createRadialGradient(s,h,0,s,h,Math.max(t,e)/2),u=0;u<a.colors.length;u++)c.addColorStop(a.percents[u],a.colors[u]);o.setFillStyle(c)}(e,i,n,r,t,o)}(t,e,i,n,r,o):o.setFillStyle(t):[h.MP_TOUTIAO,h.MP_BAIDU].includes(m)?o.setFillStyle("rgba(0,0,0,0)"):o.setFillStyle("transparent")},e.prototype.setShadow=function(t){var e=t.boxShadow,i=void 0===e?[]:e,n=this.ctx;if(i.length){var r=i[0],o=i[1],a=i[2],s=i[3];n.setShadow(r,o,a,s)}},e.prototype.setBorder=function(t,e){var i=this.ctx,n=t.width,r=t.height,o=t.left,a=t.top,s=e.border,h=e.borderBottom,c=e.borderTop,u=e.borderRight,d=e.borderLeft,f=e.borderRadius,l=e.lineCap,p=s||{},g=p.borderWidth,v=void 0===g?0:g,b=p.borderStyle,y=p.borderColor,w=h||{},x=w.borderBottomWidth,S=void 0===x?v:x,P=w.borderBottomStyle,k=void 0===P?b:P,T=w.borderBottomColor,B=void 0===T?y:T,C=c||{},I=C.borderTopWidth,M=void 0===I?v:I,O=C.borderTopStyle,L=void 0===O?b:O,z=C.borderTopColor,A=void 0===z?y:z,E=u||{},R=E.borderRightWidth,_=void 0===R?v:R,W=E.borderRightStyle,j=void 0===W?b:W,D=E.borderRightColor,F=void 0===D?y:D,N=d||{},H=N.borderLeftWidth,$=void 0===H?v:H,U=N.borderLeftStyle,X=void 0===U?b:U,Y=N.borderLeftColor,J=void 0===Y?y:Y,G=f||{},q=G.borderTopLeftRadius,K=void 0===q?f||0:q,V=G.borderTopRightRadius,Q=void 0===V?f||0:V,Z=G.borderBottomRightRadius,tt=void 0===Z?f||0:Z,et=G.borderBottomLeftRadius,it=void 0===et?f||0:et;if(h||d||c||u||s){var nt=function(t,e,n){"dashed"==e?/mp/.test(m)?i.setLineDash([Math.ceil(4*t/3),Math.ceil(4*t/3)]):i.setLineDash([Math.ceil(6*t),Math.ceil(6*t)]):"dotted"==e&&i.setLineDash([t,t]),i.setStrokeStyle(n)},rt=function(t,e,n,r,o,a,s,h,c,u,d,f,p,g,v){i.save(),i.setLineCap(v?"square":l),i.setLineWidth(f),nt(f,p,g),i.beginPath(),i.arc(t,e,s,Math.PI*c,Math.PI*u),i.lineTo(n,r),i.arc(o,a,h,Math.PI*u,Math.PI*d),i.stroke(),i.restore()};if(i.save(),s&&!h&&!d&&!c&&!u)return i.setLineWidth(v),nt(v,b,y),this.roundRect(o,a,n,r,f,!1,!!y),void i.restore();S&&rt(o+n-tt,a+r-tt,o+it,a+r,o+it,a+r-it,tt,it,.25,.5,.75,S,k,B,$&&_),$&&rt(o+it,a+r-it,o,a+K,o+K,a+K,it,K,.75,1,1.25,$,X,J,M&&S),M&&rt(o+K,a+K,o+n-Q,a,o+n-Q,a+Q,K,Q,1.25,1.5,1.75,M,L,A,$&&_),_&&rt(o+n-Q,a+Q,o+n,a+r-tt,o+n-tt,a+r-tt,Q,tt,1.75,2,.25,_,j,F,M&&S)}},e.prototype.setOpacity=function(t){var e=t.opacity,i=void 0===e?1:e;this.ctx.setGlobalAlpha(i)},e.prototype.drawPattern=function(t,e,i){return a(this,void 0,void 0,(function(){var n=this;return s(this,(function(r){return[2,new Promise((function(r,o){n.drawView(e,i,!0,!1,!0);var a=n,s=a.ctx;a.canvas;var h=e.width,c=e.height,u=e.left,d=e.top,f=i||{},l=f.borderRadius,p=void 0===l?0:l,g=f.backgroundImage,v=f.backgroundRepeat,m=void 0===v?"repeat":v;g&&function(t){var o=s.createPattern(t.src,m);s.setFillStyle(o),n.roundRect(u,d,h,c,p,!0,!1),n.setBorder(e,i),r()}(t)}))]}))}))},e.prototype.drawView=function(t,e,i,n,r){void 0===i&&(i=!0),void 0===n&&(n=!0),void 0===r&&(r=!0);var o=this.ctx,a=t.width,s=t.height,h=t.left,c=t.top,u=e||{},d=u.borderRadius,f=void 0===d?0:d,l=u.backgroundColor,p=void 0===l?"transparent":l,g=u.overflow;e.opacity&&this.setOpacity(e),this.setTransform(t,e),r&&(o.save(),this.setShadow(e)),i&&this.setBackground(p,a,s,h,c),e.clipPath?this.clipPath(h,c,a,s,e.clipPath,i,!1):this.roundRect(h,c,a,s,f,i,!1),r&&o.restore(),n&&this.setBorder(t,e),"hidden"==g&&o.clip()},e.prototype.drawImage=function(t,e,i,n){return void 0===e&&(e={}),void 0===i&&(i={}),void 0===n&&(n=!0),a(this,void 0,void 0,(function(){var r=this;return s(this,(function(o){switch(o.label){case 0:return[4,new Promise((function(o,c){return a(r,void 0,void 0,(function(){var r,a,c,u,d,f,l,p,g,v,b,y,w,P,k,T,B,C,I,M,O,L=this;return s(this,(function(s){return r=this.ctx,a=i.borderRadius,c=void 0===a?0:a,u=i.backgroundColor,d=void 0===u?"transparent":u,f=i.objectFit,l=void 0===f?"fill":f,p=i.backgroundSize,g=void 0===p?"fill":p,v=i.objectPosition,b=i.backgroundPosition,y=i.boxShadow,i.backgroundImage&&(l=g,v=b),y&&this.drawView(e,Object.assign(i,{backgroundColor:d||y&&(d||"#ffffff")}),!0,!1,!0),w=e.width,P=e.height,k=e.left,T=e.top,r.save(),B=e.contentSize.left-e.borderSize.left,C=e.contentSize.top-e.borderSize.top,n||(this.setOpacity(i),this.setTransform(e,i),this.setBackground(d,w,P,k,T),this.roundRect(k,T,w,P,c,!!(c||!y&&d),!1)),k+=B,T+=C,r.clip(),I=function(t){if("fill"!==l){var i=function(t,e,i){var n=t.objectFit,r=t.objectPosition,o=e.width/e.height,a=i.width/i.height,s=1;"contain"==n&&o>=a||"cover"==n&&o<a?s=e.height/i.height:("contain"==n&&o<a||"cover"==n&&o>=a)&&(s=e.width/i.width);var h=i.width*s,c=i.height*s,u=r||[],d=u[0],f=u[1],l=/^\d+px|rpx$/.test(d)?x(d,e.width):(e.width-h)*(S(d)?x(d,1):{left:0,center:.5,right:1}[d||"center"]),p=/^\d+px|rpx$/.test(f)?x(f,e.height):(e.height-c)*(S(f)?x(f,1):{top:0,center:.5,bottom:1}[f||"center"]),g=function(t,e){return[(t-l)/s,(e-p)/s]},v=g(0,0),m=v[0],b=v[1],y=g(e.width,e.height),w=y[0],P=y[1];return{sx:Math.max(m,0),sy:Math.max(b,0),sw:Math.min(w-m,i.width),sh:Math.min(P-b,i.height),dx:Math.max(l,0),dy:Math.max(p,0),dw:Math.min(h,e.width),dh:Math.min(c,e.height)}}({objectFit:l,objectPosition:v},e.contentSize,t),n=i.sx,o=i.sy,a=i.sh,s=i.sw,c=i.dx,u=i.dy,d=i.dh,f=i.dw;m==h.MP_BAIDU?r.drawImage(t.src,c+k,u+T,f,d,n,o,s,a):r.drawImage(t.src,n,o,s,a,c+k,u+T,f,d)}else r.drawImage(t.src,k,T,w,P)},M=function(){r.restore(),L.drawView(e,i,!1,!0,!1),o(1)},O=function(t){I(t),M()},O(t),[2]}))}))}))];case 1:return o.sent(),[2]}}))}))},e.prototype.drawText=function(t,e,i,n){var r=this.ctx,o=e.borderSize,a=e.contentSize,s=e.left,h=e.top,c=a.width,u=a.height,d=a.left-o.left,f=a.top-o.top,l=i.color,p=void 0===l?"#000000":l,g=i.lineHeight,v=void 0===g?"1.4em":g,m=i.fontSize,b=void 0===m?14:m,y=i.fontWeight,w=i.fontFamily,S=i.fontStyle,P=i.textAlign,k=void 0===P?"left":P,T=i.verticalAlign,B=void 0===T?Q:T,C=i.backgroundColor,I=i.lineClamp,M=i.backgroundClip,O=i.textShadow,L=i.textDecoration;if(this.drawView(e,i,M!=q),v=x(v,b),t){r.save(),this.setShadow({boxShadow:O}),s+=d,h+=f;var z=n.fontHeight,A=n.descent+n.ascent;switch(r.setFonts({fontFamily:w,fontSize:b,fontWeight:y,fontStyle:S}),r.setTextBaseline(A?Q:B),r.setTextAlign(k),M?this.setBackground(C,c,u,s,h):r.setFillStyle(p),k){case"left":break;case"center":s+=.5*c;break;case"right":s+=c}var E=n.lines*v,R=Math.ceil((u-E)/2);switch(R<0&&(R=0),B){case"top":break;case Q:h+=R;break;case"bottom":h+=2*R}var _=(v-z)/2,W=function(t){var e=r.measureText(t),i=e.actualBoundingBoxDescent,n=void 0===i?0:i,o=e.actualBoundingBoxAscent;return"top"==B?{fix:A?void 0===o?0:o:0,lineY:A?2*_:_}:B==Q?{fix:A?v/2+n/4:v/2,lineY:(v-z)/2}:"bottom"==B?{fix:A?v-n:v+_,lineY:0}:{fix:0,height:0,lineY:0}},j=function(t,e,i){var o=t;switch(k){case"left":o+=i;break;case"center":o=(t-=i/2)+i;break;case"right":o=t,t-=i}if(L){r.setLineWidth(b/13),r.beginPath();var a=.1*n.fontHeight;/\bunderline\b/.test(L)&&(r.moveTo(t,e+a),r.lineTo(o,e+a)),/\boverline\b/.test(L)&&(A||(e-=_),r.moveTo(t,e-n.fontHeight-a),r.lineTo(o,e-n.fontHeight-a)),/\bline-through\b/.test(L)&&(r.moveTo(t,e-.5*n.fontHeight),r.lineTo(o,e-.5*n.fontHeight)),r.closePath(),r.setStrokeStyle(p),r.stroke()}};if(!n.widths||1==n.widths.length&&n.widths[0].total<=a.width){var D=W(t),F=D.fix,N=D.lineY;return r.fillText(t,s,h+F),j(s,(h+=v)-N,n&&n.widths&&n.widths[0].total||n.text),r.restore(),void this.setBorder(e,i)}for(var H=t.split(""),$=h,U=s,X="",Y=0,J=0;J<=H.length;J++){var G=H[J]||"",K="\n"===G,V=""==G,Z=X+(G=K?"":G),tt=r.measureText(Z).width;if(Y>=I)break;if(U=s,tt>a.width||K||V){if(Y++,X=V&&tt<=a.width?Z:X,Y===I&&tt>c){for(;r.measureText("".concat(X,"...")).width>a.width&&!(X.length<=1);)X=X.substring(0,X.length-1);X+="..."}var et=W(X);if(F=et.fix,N=et.lineY,r.fillText(X,U,h+F),j(U,(h+=v)-N,tt),X=G,h>$+u)break}else X=Z}r.restore()}},e.prototype.source=function(e){return a(this,void 0,void 0,(function(){var i,n,r,o=this;return s(this,(function(a){switch(a.label){case 0:if(this.node=null,i=+new Date,"{}"==JSON.stringify(e))return[2];if(!e.type)for(n in e.type=V,e.css=e.css||{},e)["views","children","type","css"].includes(n)||(e.css[n]=e[n],delete e[n]);return e.css&&!e.css.width&&(e.css||(e.css={})),[4,this.create(e)];case 1:return(r=a.sent())?(this.size=r.layout()||{},this.node=r,this.onEffectFinished().then((function(t){return o.lifecycle("onEffectSuccess",t)})).catch((function(t){return o.lifecycle("onEffectFail",t)})),t.log("布局用时:"+(+new Date-i)+"ms"),[2,this.size]):[2,t.warn("no node")]}}))}))},e.prototype.getImageInfo=function(t){return this.imageBus[t]||(this.imageBus[t]=this.createImage(t,this.useCORS)),this.imageBus[t]},e.prototype.create=function(t,e){return a(this,void 0,void 0,(function(){var i,n,r,a,h,c,u,d,f,l,p,g,v,m,b,y,w;return s(this,(function(s){switch(s.label){case 0:if(i="image"==t.type,n=[q,K].includes(t.type),r=t.css||{},a=r.backgroundImage,h=r.display,i&&!t.src&&!t.url||n&&!t.text)return[2];if("none"==h)return[2];if(n&&(t.text=String(t.text)),!(i||t.type==V&&a))return[3,4];c=i?t.src:"",u=/url\((.+)\)/.exec(a),a&&u&&u[1]&&(c=u[1]||""),s.label=1;case 1:return s.trys.push([1,3,,4]),[4,this.getImageInfo(c)];case 2:return d=s.sent(),f=d.width,l=d.height,!(p=d.path)&&i?[2]:(p&&(t.attributes=Object.assign(t.attributes||{},{width:f,height:l,path:p,src:p,naturalSrc:c})),[3,4]);case 3:return g=s.sent(),t.type!=V?[2]:(this.lifecycle("onEffectFail",o(o({},g),{src:c})),[3,4]);case 4:if(this.count+=1,v=new J(t,e,this.root,this.ctx),!(m=t.views||t.children))return[3,8];b=0,s.label=5;case 5:return b<m.length?(y=m[b],[4,this.create(y,v)]):[3,8];case 6:(w=s.sent())&&v.add(w),s.label=7;case 7:return b++,[3,5];case 8:return[2,v]}}))}))},e.prototype.drawNode=function(t,e){return void 0===e&&(e=!1),a(this,void 0,void 0,(function(){var i,n,r,o,a,h,c,u,d,f,l,p,g,v,m,b,y,w,x,S;return s(this,(function(s){switch(s.label){case 0:return i=t.layoutBox,n=t.computedStyle,r=t.attributes,o=t.name,a=t.children,h=t.fixedLine,c=t.attributes,u=c.src,d=c.text,["fixed"].includes(n.position)&&!e?[2]:(this.ctx.save(),o!==V?[3,7]:u?n.backgroundRepeat?[4,this.drawPattern(r,i,n)]:[3,2]:[3,5]);case 1:return s.sent(),[3,4];case 2:return[4,this.drawImage(r,i,n,!1)];case 3:s.sent(),s.label=4;case 4:return[3,6];case 5:this.drawView(i,n),s.label=6;case 6:return[3,10];case 7:return"image"===o&&u?[4,this.drawImage(r,i,n,!1)]:[3,9];case 8:return s.sent(),[3,10];case 9:o===q?this.drawText(d,i,n,r):o===K&&G.api&&G.api.draw(d,this,i,n),s.label=10;case 10:if(this.progress+=1,l=(f=h||{}).beforeElements,p=f.afterElements,!l)return[3,14];g=0,v=l,s.label=11;case 11:return g<v.length?(S=v[g],[4,this.drawNode(S)]):[3,14];case 12:s.sent(),s.label=13;case 13:return g++,[3,11];case 14:if(!a)return[3,18];m=Object.values?Object.values(a):Object.keys(a).map((function(t){return a[t]})),b=0,y=m,s.label=15;case 15:return b<y.length?"absolute"===(S=y[b]).computedStyle.position?[3,17]:[4,this.drawNode(S)]:[3,18];case 16:s.sent(),s.label=17;case 17:return b++,[3,15];case 18:if(!p)return[3,22];w=0,x=p,s.label=19;case 19:return w<x.length?(S=x[w],[4,this.drawNode(S)]):[3,22];case 20:s.sent(),s.label=21;case 21:return w++,[3,19];case 22:return this.ctx.restore(),[2]}}))}))},e.prototype.render=function(e){var i=this;return void 0===e&&(e=30),new Promise((function(n,r){return a(i,void 0,void 0,(function(){var i,o,a,h,c,u,d,f,l,p;return s(this,(function(s){switch(s.label){case 0:return i=+new Date,this.init(),[4,(g=e,void 0===g&&(g=0),new Promise((function(t){return setTimeout(t,g)})))];case 1:s.sent(),s.label=2;case 2:if(s.trys.push([2,14,,15]),!this.node)return[3,12];if(o=this.root.fixedLine||{},a=o.beforeElements,h=o.afterElements,!a)return[3,6];c=0,u=a,s.label=3;case 3:return c<u.length?(l=u[c],[4,this.drawNode(l,!0)]):[3,6];case 4:s.sent(),s.label=5;case 5:return c++,[3,3];case 6:return[4,this.drawNode(this.node)];case 7:if(s.sent(),!h)return[3,11];d=0,f=h,s.label=8;case 8:return d<f.length?(l=f[d],[4,this.drawNode(l,!0)]):[3,11];case 9:s.sent(),s.label=10;case 10:return d++,[3,8];case 11:return n(this.node),[3,13];case 12:this.lifecycle("onEffectFail","node is empty"),s.label=13;case 13:return[3,15];case 14:return p=s.sent(),this.lifecycle("onEffectFail",p),r(p),[3,15];case 15:return t.log("渲染用时:"+(+new Date-i-30)+"ms"),[2]}var g}))}))}))},e.prototype.onEffectFinished=function(){var t=this,e=Object.keys(this.imageBus).map((function(e){return t.imageBus[e]}));return Promise.all(e)},e.prototype.destroy=function(){this.node=[]},e.prototype.save=function(t){try{var e=t||{},i=e.fileType,n=void 0===i?"png":i,r=e.quality,o=void 0===r?1:r;return this.canvas.toDataURL("image/".concat(n),o)}catch(t){return this.lifecycle("onEffectFail","image cross domain"),t}},e}();e.default=e.Painter=Z,h.WEB==m&&(window.Painter=Z)}).call(this,i("ba7c")["default"])},f34d:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"c",(function(){return r})),i.d(e,"a",(function(){}));var n=function(){var t=this.$createElement,e=this._self._c||t;return e("v-uni-view",[this._t("default")],2)},r=[]}}]);