painter-kernel
Version:
painter 核心逻辑库
1 lines • 32.2 kB
JavaScript
var t={563:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default=function t(e){e=e.trim();for(var r=new Array,s="+",i="",o=e.length,n=0;n<o;++n){if("."===e[n]||!isNaN(Number(e[n]))&&" "!==e[n])i+=e[n];else if("("===e[n]){for(var c=1,a=n;c>0;)"("===e[a+=1]&&(c+=1),")"===e[a]&&(c-=1);i=""+t(e.slice(n+1,a)),n=a}if(isNaN(Number(e[n]))&&"."!==e[n]||n===o-1){var h=parseFloat(i);switch(s){case"+":r.push(h);break;case"-":r.push(-h);break;case"*":r.push(r.pop()*h);break;case"/":r.push(r.pop()/h)}s=e[n],i=""}}for(var l=0;r.length;)l+=r.pop();return l}},834:(t,e)=>{function r(t){for(var e=[],r=[],s=0,i=t.substring(0,t.length-1).split("%,");s<i.length;s++){var o=i[s];e.push(o.substring(0,o.lastIndexOf(" ")).trim()),r.push(parseInt(o.slice(o.lastIndexOf(" ")))/100)}return{colors:e,percents:r}}Object.defineProperty(e,"__esModule",{value:!0}),e.doGradient=e.isGradient=void 0,e.isGradient=function(t){return!(!t||!t.startsWith("linear")&&!t.startsWith("radial"))},e.doGradient=function(t,e,s,i){t.startsWith("linear")?function(t,e,s,i){var o=function(t,e,r){var s,i=t.match(/([-]?\d{1,3})deg/),o=i&&i[1]?parseFloat(i[1]):0;switch(o){case 0:s=[0,-r/2,0,r/2];break;case 90:s=[e/2,0,-e/2,0];break;case-90:s=[-e/2,0,e/2,0];break;case 180:s=[0,r/2,0,-r/2];break;case-180:s=[0,-r/2,0,r/2];break;default:var n=0,c=0,a=0,h=0;o>0&&o<90?(a=-(n=e/2-(e/2*Math.tan((90-o)*Math.PI*2/360)-r/2)*Math.sin(2*(90-o)*Math.PI*2/360)/2),c=-(h=Math.tan((90-o)*Math.PI*2/360)*n)):o>-180&&o<-90?(a=-(n=-e/2+(e/2*Math.tan((90-o)*Math.PI*2/360)-r/2)*Math.sin(2*(90-o)*Math.PI*2/360)/2),c=-(h=Math.tan((90-o)*Math.PI*2/360)*n)):o>90&&o<180?(a=-(n=e/2+(-e/2*Math.tan((90-o)*Math.PI*2/360)-r/2)*Math.sin(2*(90-o)*Math.PI*2/360)/2),c=-(h=Math.tan((90-o)*Math.PI*2/360)*n)):(a=-(n=-e/2-(-e/2*Math.tan((90-o)*Math.PI*2/360)-r/2)*Math.sin(2*(90-o)*Math.PI*2/360)/2),c=-(h=Math.tan((90-o)*Math.PI*2/360)*n)),s=[n,c,a,h]}return s}(s,t,e),n=i.createLinearGradient(o[0],o[1],o[2],o[3]),c=s.match(/linear-gradient\((.+)\)/);if(c){for(var a=c[1],h=r(a.substring(a.indexOf(",")+1)),l=0;l<h.colors.length;l++)n.addColorStop(h.percents[l],h.colors[l]);i.fillStyle=n}}(e,s,t,i):t.startsWith("radial")&&function(t,e,s,i){var o=s.match(/radial-gradient\((.+)\)/);if(o){for(var n=r(o[1]),c=i.createRadialGradient(0,0,0,0,0,t<e?e/2:t/2),a=0;a<n.colors.length;a++)c.addColorStop(n.percents[a],n.colors[a]);i.fillStyle=c}}(e,s,t,i)}},779:function(t,e,r){var s=this&&this.__assign||function(){return(s=Object.assign||function(t){for(var e,r=1,s=arguments.length;r<s;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__awaiter||function(t,e,r,s){return new(r||(r=Promise))((function(i,o){function n(t){try{a(s.next(t))}catch(t){o(t)}}function c(t){try{a(s.throw(t))}catch(t){o(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(n,c)}a((s=s.apply(t,e||[])).next())}))},o=this&&this.__generator||function(t,e){var r,s,i,o,n={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function c(o){return function(c){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;n;)try{if(r=1,s&&(i=2&o[0]?s.return:o[0]?s.throw||((i=s.return)&&i.call(s),0):s.next)&&!(i=i.call(s,o[1])).done)return i;switch(s=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return n.label++,{value:o[1],done:!1};case 5:n.label++,s=o[1],o=[0];continue;case 7:o=n.ops.pop(),n.trys.pop();continue;default:if(!((i=(i=n.trys).length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){n=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){n.label=o[1];break}if(6===o[0]&&n.label<i[1]){n.label=i[1],i=o;break}if(i&&n.label<i[2]){n.label=i[2],n.ops.push(o);break}i[2]&&n.ops.pop(),n.trys.pop();continue}o=e.call(t,n)}catch(t){o=[6,t],s=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,c])}}};Object.defineProperty(e,"__esModule",{value:!0}),e.Pen=e.clearPenCache=e.penCache=void 0;var n=r(536),c=r(834),a=r(593),h=/[^\u0020-\u007E\u00A0-\u00BE\u2E80-\uA4CF\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFFEF\u0080-\u009F\u2000-\u201f\u2026\u2022\u20ac\r\n]$/;e.penCache={viewRect:{},textLines:{}},e.clearPenCache=function(t){t?(e.penCache.viewRect[t]=null,e.penCache.textLines[t]=null):(e.penCache.viewRect={},e.penCache.textLines={})};var l=function(){function t(t,e){this.ctx=t,this.data=e,this.ctx=t,this.data=e,this.style={width:0,height:0}}return t.prototype.paint=function(t){return i(this,void 0,void 0,(function(){var e,r,s;return o(this,(function(i){switch(i.label){case 0:return this.style={width:a.toPx(this.data.width),height:a.toPx(this.data.height)},[4,this._background()];case 1:i.sent(),e=0,r=this.data.views,i.label=2;case 2:return e<r.length?(s=r[e],[4,this._drawAbsolute(s)]):[3,5];case 3:i.sent(),i.label=4;case 4:return e++,[3,2];case 5:return t&&t(),[2]}}))}))},t.prototype._background=function(){return i(this,void 0,void 0,(function(){var t,e,r,s,i;return o(this,(function(o){switch(o.label){case 0:return this.ctx.save(),t=this.style,e=t.width,r=t.height,s=this.data.background,this.ctx.translate(e/2,r/2),this._doClip(this.data.borderRadius,e,r),s?[3,1]:(this.ctx.fillStyle="transparent",this.ctx.fillRect(-e/2,-r/2,e,r),[3,5]);case 1:return s.startsWith("#")||s.startsWith("rgba")||"transparent"===s.toLowerCase()?(this.ctx.fillStyle=s,this.ctx.fillRect(-e/2,-r/2,e,r),[3,5]):[3,2];case 2:return c.isGradient(s)?(c.doGradient(s,e,r,this.ctx),this.ctx.fillRect(-e/2,-r/2,e,r),[3,5]):[3,3];case 3:return[4,a.injection.loadImage(s)];case 4:(i=o.sent().img)&&this.ctx.drawImage(i,-e/2,-r/2,e,r),o.label=5;case 5:return this.ctx.restore(),[2]}}))}))},t.prototype._drawAbsolute=function(t){var r=this;return new Promise((function(n){return i(r,void 0,void 0,(function(){var r;return o(this,(function(i){switch(i.label){case 0:if(!t||!t.type)return[2];switch(Array.isArray(t.css)&&(t.css=Object.assign.apply(Object,t.css)),t.type){case"image":return[3,1];case"text":return[3,3];case"inlineText":return[3,5];case"rect":return[3,7];case"qrcode":return[3,9]}return[3,11];case 1:return[4,this._drawAbsImage(t)];case 2:return i.sent(),[3,15];case 3:return[4,this._fillAbsText(t)];case 4:return i.sent(),[3,15];case 5:return[4,this._fillAbsInlineText(t)];case 6:return i.sent(),[3,15];case 7:return[4,this._drawAbsRect(t)];case 8:return i.sent(),[3,15];case 9:return[4,this._drawQRCode(t)];case 10:return i.sent(),[3,15];case 11:return a.injection.customActions[t.type]?(r=a.injection.customActions[t.type].layout(t,JSON.parse(JSON.stringify(e.penCache.viewRect||{}))),t.rect=s(s({},r),{height:r.bottom-r.top,width:r.right-r.left}),t.id&&(e.penCache.viewRect[t.id]=JSON.parse(JSON.stringify(t.rect))),this.ctx.save(),[4,a.injection.customActions[t.type].draw(t,this.ctx)]):[3,13];case 12:return i.sent(),this.ctx.restore(),[3,14];case 13:console.log("ignore",t.type),i.label=14;case 14:return[3,15];case 15:return n(),[2]}}))}))}))},t.prototype._border=function(t){var e=t.borderRadius,r=void 0===e?0:e,s=t.width,i=t.height,o=t.borderWidth,n=void 0===o?0:o,c=t.borderStyle,h=void 0===c?"solid":c,l=0,f=0,d=0,u=0,x=Math.min(s,i);if(r)if("string"==typeof r){var g=r.split(/\s+/);4===g.length?(l=Math.min(a.toPx(g[0],x),s/2,i/2),f=Math.min(a.toPx(g[1],x),s/2,i/2),d=Math.min(a.toPx(g[2],x),s/2,i/2),u=Math.min(a.toPx(g[3],x),s/2,i/2)):l=f=d=u=Math.min(a.toPx(g[0],x),s/2,i/2)}else l=f=d=u=Math.min(a.toPx(r),s/2,i/2);var p=n?a.toPx(n,x):0;this.ctx.lineWidth=p,"dashed"===h?this.ctx.setLineDash([4*p/3,4*p/3]):"dotted"===h&&this.ctx.setLineDash([p,p]);var v="solid"!==h;this.ctx.beginPath(),v&&0===l&&this.ctx.moveTo(-s/2-p,-i/2-p/2),0!==l&&this.ctx.arc(-s/2+l,-i/2+l,l+p/2,1*Math.PI,1.5*Math.PI),this.ctx.lineTo(0===f?v?s/2:s/2+p/2:s/2-f,-i/2-p/2),v&&0===f&&this.ctx.moveTo(s/2+p/2,-i/2-p),0!==f&&this.ctx.arc(s/2-f,-i/2+f,f+p/2,1.5*Math.PI,2*Math.PI),this.ctx.lineTo(s/2+p/2,0===d?v?i/2:i/2+p/2:i/2-d),v&&0===d&&this.ctx.moveTo(s/2+p,i/2+p/2),0!==d&&this.ctx.arc(s/2-d,i/2-d,d+p/2,0,.5*Math.PI),this.ctx.lineTo(0===u?v?-s/2:-s/2-p/2:-s/2+u,i/2+p/2),v&&0===u&&this.ctx.moveTo(-s/2-p/2,i/2+p),0!==u&&this.ctx.arc(-s/2+u,i/2-u,u+p/2,.5*Math.PI,1*Math.PI),this.ctx.lineTo(-s/2-p/2,0===l?v?-i/2:-i/2-p/2:-i/2+l),v&&0===l&&this.ctx.moveTo(-s/2-p,-i/2-p/2),v||this.ctx.closePath()},t.prototype._doClip=function(t,e,r,s){t&&e&&r&&(this.ctx.globalAlpha=0,this.ctx.fillStyle="white",this._border({borderRadius:t,width:e,height:r,borderStyle:s}),this.ctx.fill(),this.ctx.clip(),this.ctx.globalAlpha=1)},t.prototype._doBorder=function(t,e,r){if(t.css){var s=t.css,i=s.borderRadius,o=s.borderWidth,n=s.borderColor,c=s.borderStyle;o&&(this.ctx.save(),this._preProcess(t,!0),this.ctx.strokeStyle=n||"black",this._border({borderRadius:i,width:e,height:r,borderWidth:o,borderStyle:c}),this.ctx.stroke(),this.ctx.restore())}},t.prototype._preProcess=function(t,r){var s,i,o,n,c=0,h=this._doPaddings(t);switch(t.type){case"text":for(var l=String(t.text).split("\n"),f=0;f<l.length;++f)""===l[f]&&(l[f]=" ");var d=t.css.fontWeight||"400",u=t.css.fontStyle||"italic"===t.css.textStyle||"oblique"===t.css.textStyle?t.css.textStyle:"normal";t.css.fontSize||(t.css.fontSize="20rpx");var x=a.toPx(t.css.fontSize);this.ctx.font=u+" "+d+" "+x+'px "'+(t.css.fontFamily||"sans-serif")+'"';var g=0,p=[];for(f=0;f<l.length;++f){var v=this.ctx.measureText(l[f]).width,b=x+h[1]+h[3],y=t.css.width?a.toPx(t.css.width,this.style.width)-h[1]-h[3]:v;y<b&&(y=b),c=y>c?y:c,g+=w=Math.ceil(v/y),p[f]=w}g="number"==typeof t.css.maxLines&&t.css.maxLines<g?t.css.maxLines:g,s=(P=t.css.lineHeight?a.toPx(t.css.lineHeight):a.toPx(t.css.fontSize))*g,i={lines:g,lineHeight:P,textArray:l,linesArray:p};break;case"inlineText":g=0,v=0;var w,P=0,m=t.textList||[];for(f=0;f<m.length;f++){var S=m[f],_=(d=S.css.fontWeight||"400",S.css.textStyle||"normal");S.css.fontSize||(S.css.fontSize="20rpx"),this.ctx.font=_+" "+d+" "+a.toPx(S.css.fontSize)+'px "'+(S.css.fontFamily||"sans-serif")+'"',v+=this.ctx.measureText(S.text).width;var k=S.css.lineHeight?a.toPx(S.css.lineHeight):a.toPx(S.css.fontSize);P=Math.max(P,k)}c=t.css.width?a.toPx(t.css.width,this.style.width)-h[1]-h[3]:v,s=P*(g+=w=Math.ceil(v/c)),i={lines:g,lineHeight:P};break;case"image":var M=a.injection.getRatio();t.css&&(t.css.width||(t.css.width="auto"),t.css.height||(t.css.height="auto")),!t.css||"auto"===t.css.width&&"auto"===t.css.height?(c=Math.round(t.sWidth/M),s=Math.round(t.sHeight/M)):"auto"===t.css.width?(s=a.toPx(t.css.height,this.style.height),c=t.sWidth/t.sHeight*s):"auto"===t.css.height?(c=a.toPx(t.css.width,this.style.width),s=t.sHeight/t.sWidth*c):(c=a.toPx(t.css.width,this.style.width),s=a.toPx(t.css.height,this.style.height));break;default:if(!t.css.width||!t.css.height)return void console.error("You should set width and height");c=a.toPx(t.css.width,this.style.width),s=a.toPx(t.css.height,this.style.height)}if(t.css&&t.css.right)if("string"==typeof t.css.right)o=this.style.width-a.toPx(t.css.right,this.style.width);else{var C=t.css.right;o=this.style.width-a.toPx(C[0],this.style.width)-(e.penCache.viewRect[C[1]]?e.penCache.viewRect[C[1]].width*(C[2]||1):0)}else if(t.css&&t.css.left)if("string"==typeof t.css.left)o=a.toPx(t.css.left,this.style.width);else{var T=t.css.left;o=a.toPx(T[0],this.style.width)+(e.penCache.viewRect[T[1]]?e.penCache.viewRect[T[1]].width*(T[2]||1):0)}else o=0;if(t.css&&t.css.bottom)n=this.style.height-s-a.toPx(t.css.bottom,this.style.height);else if(t.css&&t.css.top)if("string"==typeof t.css.top)n=a.toPx(t.css.top,this.style.height);else{var R=t.css.top;n=a.toPx(R[0],this.style.height)+(e.penCache.viewRect[R[1]]?e.penCache.viewRect[R[1]].height*(R[2]||1):0)}else n=0;var I=t.css&&t.css.rotate?this._getAngle(t.css.rotate):0,A=t.css&&t.css.align?t.css.align:t.css&&t.css.right?"right":"left",j=t.css&&t.css.verticalAlign?t.css.verticalAlign:"top",W=0;switch(A){case"center":W=o;break;case"right":W=o-c/2;break;default:W=o+c/2}var O=0;switch(j){case"center":O=n;break;case"bottom":O=n-s/2;break;default:O=n+s/2}this.ctx.translate(W,O);var F=o;"center"===A?F=o-c/2:"right"===A&&(F=o-c);var z=n;return"center"===j?z=n-s/2:"bottom"===j&&(z=n-s),t.rect?(t.rect.left=F,t.rect.top=z,t.rect.right=F+c,t.rect.bottom=z+s,t.rect.x=t.css&&t.css.right?o-c:o,t.rect.y=n):t.rect={left:F,top:z,right:F+c,bottom:z+s,x:t.css&&t.css.right?o-c:o,y:n},t.rect.left=t.rect.left-h[3],t.rect.top=t.rect.top-h[0],t.rect.right=t.rect.right+h[1],t.rect.bottom=t.rect.bottom+h[2],"text"===t.type&&(t.rect.minWidth=a.toPx(t.css.fontSize)+h[1]+h[3]),this.ctx.rotate(I),!r&&t.css&&t.css.borderRadius&&"rect"!==t.type&&this._doClip(t.css.borderRadius,c,s,t.css.borderStyle),this._doShadow(t),t.id&&(e.penCache.viewRect[t.id]={width:c,height:s,left:t.rect.left,top:t.rect.top,right:t.rect.right,bottom:t.rect.bottom}),{width:c,height:s,x:o,y:n,extra:i}},t.prototype._doPaddings=function(t){var e=(t.css?t.css:{}).padding,r=void 0===e?"":e,s=[0,0,0,0];if(r)if("string"==typeof r){var i,o,n=r.split(/\s+/);1===n.length&&(s=[i=a.toPx(n[0]),i,i,i]),2===n.length&&(s=[i=a.toPx(n[0]),o=a.toPx(n[1]),i,o]),3===n.length&&(s=[i=a.toPx(n[0]),o=a.toPx(n[1]),a.toPx(n[2]),o]),4===n.length&&(s=[i=a.toPx(n[0]),o=a.toPx(n[1]),a.toPx(n[2]),a.toPx(n[3])])}else s=[r,r,r,r];return s},t.prototype._doBackground=function(t){this.ctx.save();var e=this._preProcess(t,!0),r=e.width,s=e.height,i=t.css.background,o=this._doPaddings(t),n=r+o[1]+o[3],a=s+o[0]+o[2];this._doClip(t.css.borderRadius,n,a,t.css.borderStyle),c.isGradient(String(i))?c.doGradient(String(i),n,a,this.ctx):this.ctx.fillStyle=String(i),this.ctx.fillRect(-n/2,-a/2,n,a),this.ctx.restore()},t.prototype._drawQRCode=function(t){this.ctx.save();var e=this._preProcess(t),r=e.width,s=e.height;n.api.draw(t.content,this.ctx,-r/2,-s/2,r,s,t.css.background?String(t.css.background):"",t.css.color),this.ctx.restore(),this._doBorder(t,r,s)},t.prototype._drawAbsImage=function(t){return i(this,void 0,void 0,(function(){var e,r,s,i,n,c,h,l,f,d,u,x,g;return o(this,(function(o){switch(o.label){case 0:return t.url?(this.ctx.save(),[4,a.injection.loadImage(t.url)]):[2];case 1:return e=o.sent(),r=e.img,s=e.width,i=e.height,t.sHeight=i,t.sWidth=s,r?(n=this._preProcess(t),c=n.width,h=n.height,l=t.sWidth,f=t.sHeight,d=0,u=0,x=c/h,g=t.sWidth/t.sHeight,x>=g?(f=l/x,u=Math.round((t.sHeight-f)/2)):(l=f*x,d=Math.round((t.sWidth-l)/2)),t.css&&"scaleToFill"===t.css.mode?this.ctx.drawImage(r,-c/2,-h/2,c,h):(this.ctx.drawImage(r,d,u,l,f,-c/2,-h/2,c,h),t.rect.startX=d/t.sWidth,t.rect.startY=u/t.sHeight,t.rect.endX=(d+l)/t.sWidth,t.rect.endY=(u+f)/t.sHeight),this.ctx.restore(),this._doBorder(t,c,h),[2]):[2]}}))}))},t.prototype._fillAbsText=function(t){var r,s;if(t.text){t.css.background&&this._doBackground(t),this.ctx.save();var i=this._preProcess(t,Boolean(t.css.background&&t.css.borderRadius)),o=i.width,n=i.height,c=i.extra;if(this.ctx.fillStyle=t.css.color||"black",t.id&&e.penCache.textLines[t.id]){this.ctx.textAlign=t.css.textAlign?t.css.textAlign:"left";for(var l=0,f=e.penCache.textLines[t.id];l<f.length;l++){var d=(_=f[l]).measuredWith,u=_.text,x=_.x,g=_.y,p=_.textDecoration;if("stroke"===t.css.textStyle?this.ctx.strokeText(u,x,g,d):this.ctx.fillText(u,x,g,d),p){var v=a.toPx(t.css.fontSize);this.ctx.lineWidth=v/13,this.ctx.beginPath(),(r=this.ctx).moveTo.apply(r,p.moveTo),(s=this.ctx).lineTo.apply(s,p.lineTo),this.ctx.closePath(),this.ctx.strokeStyle=t.css.color,this.ctx.stroke()}}}else{var b=c,y=b.lines,w=b.lineHeight,P=b.textArray,m=b.linesArray;if(t.id){for(var S=0,_=0;_<P.length;++_){var k=this.ctx.measureText(P[_]).width;S=k>S?k:S}e.penCache.viewRect[t.id].width=o?S<o?S:o:S}for(var M=0,C=(v=a.toPx(t.css.fontSize),0);C<P.length;++C){var T=Math.ceil(P[C].length/m[C]),R=0,I=0;for(_=0;_<m[C]&&!(M>=y);++_){for(I=T,u=a.substr(P[C],R,I),d=this.ctx.measureText(u).width;R+I<=P[C].length&&(o-d>v||d-o>v);){if(d<o)u=a.substr(P[C],R,++I),h.test(u)&&(u=a.substr(P[C],R,++I));else{if(u.length<=1)break;u=a.substr(P[C],R,--I),h.test(u)&&(u=a.substr(P[C],R,--I))}d=this.ctx.measureText(u).width}if(R+=u.length,M===y-1&&(C<P.length-1||R<P[C].length)){for(;this.ctx.measureText(u+"...").width>o&&!(u.length<=1);)u=a.substring(u,0,u.length-(h.test(u)?2:1));u+="...",d=this.ctx.measureText(u).width}this.ctx.textAlign=t.css.textAlign?t.css.textAlign:"left",x=void 0;var A=void 0;switch(t.css.textAlign){case"center":A=(x=0)-d/2;break;case"right":A=(x=o/2)-d;break;default:A=x=-o/2}g=-n/2+(0===M?v:v+M*w),M++,"stroke"===t.css.textStyle?this.ctx.strokeText(u,x,g,d):this.ctx.fillText(u,x,g,d),p=void 0,t.css.textDecoration&&"string"==typeof t.css.textDecoration&&(this.ctx.lineWidth=v/13,this.ctx.beginPath(),/\bunderline\b/.test(t.css.textDecoration)&&(this.ctx.moveTo(A,g),this.ctx.lineTo(A+d,g),p={moveTo:[A,g],lineTo:[A+d,g]}),/\boverline\b/.test(t.css.textDecoration)&&(this.ctx.moveTo(A,g-v),this.ctx.lineTo(A+d,g-v),p={moveTo:[A,g-v],lineTo:[A+d,g-v]}),/\bline-through\b/.test(t.css.textDecoration)&&(this.ctx.moveTo(A,g-v/3),this.ctx.lineTo(A+d,g-v/3),p={moveTo:[A,g-v/3],lineTo:[A+d,g-v/3]}),this.ctx.closePath(),this.ctx.strokeStyle=t.css.color,this.ctx.stroke()),t.id&&(e.penCache.textLines[t.id]?e.penCache.textLines[t.id].push({text:u,x,y:g,measuredWith:d,textDecoration:p}):e.penCache.textLines[t.id]=[{text:u,x,y:g,measuredWith:d,textDecoration:p}])}}}this.ctx.restore(),this._doBorder(t,o,n)}},t.prototype._fillAbsInlineText=function(t){if(t.textList){t.css.background&&this._doBackground(t),this.ctx.save();for(var e,r,s,i=this._preProcess(t,t.css.background&&t.css.borderRadius),o=i.width,n=i.height,c=i.extra,h=(c.lines,c.lineHeight),l=-o/2,f=0,d=l,u=o,x=0;x<t.textList.length;x++)for(var g=t.textList[x],p=0,v=0,b=g.text.length,y=this.ctx.measureText(g.text).width,w=Math.ceil(y/b);v<b;){for(;(v-p+1)*w<u&&v<b;)v++;var P=a.substr(g.text,p,v-p),m=-n/2+a.toPx(g.css.fontSize)+f*h;this.ctx.font=(void 0,void 0,r=(e=g.css).fontWeight||"400",s=e.textStyle||"normal",e.fontSize||(e.fontSize="20rpx"),s+" "+r+" "+a.toPx(e.fontSize)+'px "'+(e.fontFamily||"sans-serif")+'"'),this.ctx.fillStyle=g.css.color||"black",this.ctx.textAlign="left","stroke"===g.css.textStyle?this.ctx.strokeText(P,d,m):this.ctx.fillText(P,d,m);var S=this.ctx.measureText(P).width,_=a.toPx(g.css.fontSize);g.css.textDecoration&&(this.ctx.lineWidth=_/13,this.ctx.beginPath(),/\bunderline\b/.test(g.css.textDecoration)&&(this.ctx.moveTo(d,m),this.ctx.lineTo(d+S,m)),/\boverline\b/.test(g.css.textDecoration)&&(this.ctx.moveTo(d,m-_),this.ctx.lineTo(d+S,m-_)),/\bline-through\b/.test(g.css.textDecoration)&&(this.ctx.moveTo(d,m-_/3),this.ctx.lineTo(d+S,m-_/3)),this.ctx.closePath(),this.ctx.strokeStyle=g.css.color,this.ctx.stroke()),p=v,d+=S,((u-=S)<=0||u<w)&&(u=o,d=l,f++)}this.ctx.restore(),this._doBorder(t,o,n)}},t.prototype._drawAbsRect=function(t){this.ctx.save();var e=this._preProcess(t),r=e.width,s=e.height;c.isGradient(t.css.color)?c.doGradient(t.css.color,r,s,this.ctx):this.ctx.fillStyle=t.css.color;var i=t.css,o=i.borderRadius,n=i.borderStyle,a=i.borderWidth;this._border({borderRadius:o,width:r,height:s,borderWidth:a,borderStyle:n}),this.ctx.fill(),this.ctx.restore(),this._doBorder(t,r,s)},t.prototype._doShadow=function(t){if(t.css&&(t.css.shadow||t.css.boxShadow)){var e=(t.css.boxShadow||t.css.shadow).replace(/,\s+/g,",").split(/\s+/);e.length>4?console.error("shadow don't spread option"):(this.ctx.shadowOffsetX=parseInt(e[0],10),this.ctx.shadowOffsetY=parseInt(e[1],10),this.ctx.shadowBlur=parseInt(e[2],10),this.ctx.shadowColor=e[3])}},t.prototype._getAngle=function(t){return Number(t)*Math.PI/180},t}();e.Pen=l},536:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.api=void 0;var r,s,i,o,n,c,a=[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],l=[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],f=[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],u=[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],x=[],g=[],p=[],v=[],b=[],y=2;function w(t,e){var r;t>e&&(r=t,t=e,e=r),r=e,r*=e,r+=e,r>>=1,v[r+=t]=1}function P(t,e){var r;for(p[t+s*e]=1,r=-2;r<2;r++)p[t+r+s*(e-2)]=1,p[t-2+s*(e+r+1)]=1,p[t+2+s*(e+r)]=1,p[t+r+1+s*(e+2)]=1;for(r=0;r<2;r++)w(t-1,e+r),w(t+1,e-r),w(t-r,e-1),w(t+r,e+1)}function m(t){for(;t>=255;)t=((t-=255)>>8)+(255&t);return t}var S=[];function _(t,e,r,s){var i,o,n;for(i=0;i<s;i++)x[r+i]=0;for(i=0;i<e;i++){if(255!=(n=d[x[t+i]^x[r]]))for(o=1;o<s;o++)x[r+o-1]=x[r+o]^u[m(n+S[s-o])];else for(o=r;o<r+s;o++)x[o]=x[o+1];x[r+s-1]=255==n?0:u[m(n+S[0])]}}function k(t,e){var r;return t>e&&(r=t,t=e,e=r),r=e,r+=e*e,r>>=1,v[r+=t]}function M(t){var e,r,i,o;switch(t){case 0:for(r=0;r<s;r++)for(e=0;e<s;e++)e+r&1||k(e,r)||(p[e+r*s]^=1);break;case 1:for(r=0;r<s;r++)for(e=0;e<s;e++)1&r||k(e,r)||(p[e+r*s]^=1);break;case 2:for(r=0;r<s;r++)for(i=0,e=0;e<s;e++,i++)3==i&&(i=0),i||k(e,r)||(p[e+r*s]^=1);break;case 3:for(o=0,r=0;r<s;r++,o++)for(3==o&&(o=0),i=o,e=0;e<s;e++,i++)3==i&&(i=0),i||k(e,r)||(p[e+r*s]^=1);break;case 4:for(r=0;r<s;r++)for(i=0,o=r>>1&1,e=0;e<s;e++,i++)3==i&&(i=0,o=!o),o||k(e,r)||(p[e+r*s]^=1);break;case 5:for(o=0,r=0;r<s;r++,o++)for(3==o&&(o=0),i=0,e=0;e<s;e++,i++)3==i&&(i=0),(e&r&1)+!(!i|!o)||k(e,r)||(p[e+r*s]^=1);break;case 6:for(o=0,r=0;r<s;r++,o++)for(3==o&&(o=0),i=0,e=0;e<s;e++,i++)3==i&&(i=0),(e&r&1)+(i&&i==o)&1||k(e,r)||(p[e+r*s]^=1);break;case 7:for(o=0,r=0;r<s;r++,o++)for(3==o&&(o=0),i=0,e=0;e<s;e++,i++)3==i&&(i=0),(i&&i==o)+(e+r&1)&1||k(e,r)||(p[e+r*s]^=1)}}function C(t){var e,r=0;for(e=0;e<=t;e++)b[e]>=5&&(r+=3+b[e]-5);for(e=3;e<t-1;e+=2)b[e-2]==b[e+2]&&b[e+2]==b[e-1]&&b[e-1]==b[e+1]&&3*b[e-1]==b[e]&&(0==b[e-3]||e+3>t||3*b[e-3]>=4*b[e]||3*b[e+3]>=4*b[e])&&(r+=40);return r}function T(){var t,e,r,i,o,n=0,c=0;for(e=0;e<s-1;e++)for(t=0;t<s-1;t++)(p[t+s*e]&&p[t+1+s*e]&&p[t+s*(e+1)]&&p[t+1+s*(e+1)]||!(p[t+s*e]||p[t+1+s*e]||p[t+s*(e+1)]||p[t+1+s*(e+1)]))&&(n+=3);for(e=0;e<s;e++){for(b[0]=0,r=i=t=0;t<s;t++)(o=p[t+s*e])==i?b[r]++:b[++r]=1,c+=(i=o)?1:-1;n+=C(r)}c<0&&(c=-c);var a=c,h=0;for(a+=a<<2,a<<=1;a>s*s;)a-=s*s,h++;for(n+=10*h,t=0;t<s;t++){for(b[0]=0,r=i=e=0;e<s;e++)(o=p[t+s*e])==i?b[r]++:b[++r]=1,i=o;n+=C(r)}return n}var R,I=null;e.api={get ecclevel(){return y},set ecclevel(t){y=t},get size(){return R},set size(t){R=t},get canvas(){return I},set canvas(t){I=t},getFrame:function(t){return function(t){var e,b,C,R,I,A,j,W;R=t.length,r=0;do{if(r++,C=4*(y-1)+16*(r-1),i=f[C++],o=f[C++],n=f[C++],c=f[C],R<=(C=n*(i+o)+o-3+(r<=9)))break}while(r<40);for(s=17+4*r,I=n+(n+c)*(i+o)+o,R=0;R<I;R++)g[R]=0;for(x=t.slice(0),R=0;R<s*s;R++)p[R]=0;for(R=0;R<(s*(s+1)+1)/2;R++)v[R]=0;for(R=0;R<3;R++){for(C=0,b=0,1==R&&(C=s-7),2==R&&(b=s-7),p[b+3+s*(C+3)]=1,e=0;e<6;e++)p[b+e+s*C]=1,p[b+s*(C+e+1)]=1,p[b+6+s*(C+e)]=1,p[b+e+1+s*(C+6)]=1;for(e=1;e<5;e++)w(b+e,C+1),w(b+1,C+e+1),w(b+5,C+e),w(b+e+1,C+5);for(e=2;e<4;e++)p[b+e+s*(C+2)]=1,p[b+2+s*(C+e+1)]=1,p[b+4+s*(C+e)]=1,p[b+e+1+s*(C+4)]=1}if(r>1)for(R=a[r],b=s-7;;){for(e=s-7;e>R-3&&(P(e,b),!(e<R));)e-=R;if(b<=R+9)break;P(6,b-=R),P(b,6)}for(p[8+s*(s-8)]=1,b=0;b<7;b++)w(7,b),w(s-8,b),w(7,b+s-7);for(e=0;e<8;e++)w(e,7),w(e+s-8,7),w(e,s-8);for(e=0;e<9;e++)w(e,8);for(e=0;e<8;e++)w(e+s-8,8),w(8,e);for(b=0;b<7;b++)w(8,b+s-7);for(e=0;e<s-14;e++)1&e?(w(8+e,6),w(6,8+e)):(p[8+e+6*s]=1,p[6+s*(8+e)]=1);if(r>6)for(R=h[r-7],C=17,e=0;e<6;e++)for(b=0;b<3;b++,C--)1&(C>11?r>>C-12:R>>C)?(p[5-e+s*(2-b+s-11)]=1,p[2-b+s-11+s*(5-e)]=1):(w(5-e,2-b+s-11),w(2-b+s-11,5-e));for(b=0;b<s;b++)for(e=0;e<=b;e++)p[e+s*b]&&w(e,b);for(I=x.length,A=0;A<I;A++)g[A]=x.charCodeAt(A);if(x=g.slice(0),I>=(e=n*(i+o)+o)-2&&(I=e-2,r>9&&I--),A=I,r>9){for(x[A+2]=0,x[A+3]=0;A--;)R=x[A],x[A+3]|=255&R<<4,x[A+2]=R>>4;x[2]|=255&I<<4,x[1]=I>>4,x[0]=64|I>>12}else{for(x[A+1]=0,x[A+2]=0;A--;)R=x[A],x[A+2]|=255&R<<4,x[A+1]=R>>4;x[1]|=255&I<<4,x[0]=64|I>>4}for(A=I+3-(r<10);A<e;)x[A++]=236,x[A++]=17;for(S[0]=1,A=0;A<c;A++){for(S[A+1]=1,j=A;j>0;j--)S[j]=S[j]?S[j-1]^u[m(d[S[j]]+A)]:S[j-1];S[0]=u[m(d[S[0]]+A)]}for(A=0;A<=c;A++)S[A]=d[S[A]];for(C=e,b=0,A=0;A<i;A++)_(b,n,C,c),b+=n,C+=c;for(A=0;A<o;A++)_(b,n+1,C,c),b+=n+1,C+=c;for(b=0,A=0;A<n;A++){for(j=0;j<i;j++)g[b++]=x[A+j*n];for(j=0;j<o;j++)g[b++]=x[i*n+A+j*(n+1)]}for(j=0;j<o;j++)g[b++]=x[i*n+A+j*(n+1)];for(A=0;A<c;A++)for(j=0;j<i+o;j++)g[b++]=x[e+A+j*c];for(x=g,e=b=s-1,C=I=1,W=(n+c)*(i+o)+o,A=0;A<W;A++)for(R=x[A],j=0;j<8;j++,R<<=1){128&R&&(p[e+s*b]=1);do{I?e--:(e++,C?0!=b?b--:(C=!C,6==(e-=2)&&(e--,b=9)):b!=s-1?b++:(C=!C,6==(e-=2)&&(e--,b-=8))),I=!I}while(k(e,b))}for(x=p.slice(0),R=0,b=3e4,C=0;C<8&&(M(C),(e=T())<b&&(b=e,R=C),7!=R);C++)p=x.slice(0);for(R!=C&&M(R),b=l[R+(y-1<<3)],C=0;C<8;C++,b>>=1)1&b&&(p[s-1-C+8*s]=1,C<6?p[8+s*C]=1:p[8+s*(C+1)]=1);for(C=0;C<7;C++,b>>=1)1&b&&(p[8+s*(s-7+C)]=1,C?p[6-C+8*s]=1:p[7+8*s]=1);return p}(t)},utf16to8:function(t){var e,r,s,i;for(e="",s=t.length,r=0;r<s;r++)(i=t.charCodeAt(r))>=1&&i<=127?e+=t.charAt(r):i>2047?(e+=String.fromCharCode(224|i>>12&15),e+=String.fromCharCode(128|i>>6&63),e+=String.fromCharCode(128|i>>0&63)):(e+=String.fromCharCode(192|i>>6&31),e+=String.fromCharCode(128|i>>0&63));return e},draw:function(t,e,r,i,o,n,c,a,h,l){if(y=l||y,e){var f=Math.min(o,n);t=this.utf16to8(t);var d=this.getFrame(t),u=f/s;c&&(e.fillStyle=c,e.fillRect(r,i,o,o)),e.fillStyle=a||"black";for(var x=0;x<s;x++)for(var g=0;g<s;g++)d[g*s+x]&&e.fillRect(r+u*x,i+u*g,u,u)}else console.warn("No canvas provided to draw QR code in!")}}},593:function(t,e,r){var s=this&&this.__assign||function(){return(s=Object.assign||function(t){for(var e,r=1,s=arguments.length;r<s;r++)for(var i in e=arguments[r])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t}).apply(this,arguments)},i=this&&this.__spreadArray||function(t,e){for(var r=0,s=e.length,i=t.length;r<s;r++,i++)t[i]=e[r];return t},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.substring=e.substr=e.initInjection=e.injection=e.setStringPrototype=e.toPx=void 0;var n=o(r(563)),c=r(779),a=.5,h=1,l=function(t,e){void 0===e&&(e=100);var r=/-?[0-9]+(\.[0-9]+)?(rpx|px|%)/.exec(t);if(!t||!r)return console.error("The size: "+t+" is illegal"),"0";var s=r[2],i=parseFloat(t),o=0;return"rpx"===s?o=Math.round(i*(a||.5)*(h||1)):"px"===s?o=Math.round(i*(h||1)):"%"===s&&(o=Math.round(i*e/100)),String(o)};e.toPx=function(t,e){if("number"==typeof t)return t;if("0"===t)return 0;var r=/^calc\((.+)\)$/.exec(t);if(r&&r[1]){var s=r[1].replace(/([^\s\(\+\-\*\/]+)\.(left|right|bottom|top|width|height)/g,(function(t){var e=t.split("."),r=e[0],s=e[1];return c.penCache.viewRect[r]?c.penCache.viewRect[r][s]:0})).replace(/-?[0-9]+(\.[0-9]+)?(rpx|px|%)/g,(function(t){return l(t,e)}));return n.default(s)}return Number(l(t,e))},e.setStringPrototype=function(t,e){void 0===t&&(t=.5),void 0===e&&(e=1),a=t,h=e},e.injection={loadImage:function(t){return Promise.resolve({img:t,width:0,height:0})},getRatio:function(){return 1},customActions:{}},e.initInjection=function(t){e.injection=s(s({},e.injection),t)},e.substr=function(t,e,r){if(void 0===e)return t.toString();if("number"!=typeof e||"number"!=typeof r&&void 0!==r)return"";var s=i([],t);return s.length+e<0&&(e=0),void 0===r||e<0&&e+r>0?s.slice(e).join(""):s.slice(e,e+r).join("")},e.substring=function(t,e,r){var s;if(void 0===e)return t.toString();if("number"!=typeof e||"number"!=typeof r&&void 0!==r)return"";e>0||(e=0),r>0||void 0===r||(r=0);var o=i([],t),n=o.length;return e>n&&(e=n),r>n&&(r=n),r<e&&(e=(s=[r,e])[0],r=s[1]),o.slice(e,r).join("")}}},e={};function r(s){var i=e[s];if(void 0!==i)return i.exports;var o=e[s]={exports:{}};return t[s].call(o.exports,o,o.exports,r),o.exports}var s={};(()=>{var t=s;Object.defineProperty(t,"X$",{value:!0}),t.Gm=t.BM=t.y1=t.I8=t.aR=t.C5=void 0;var e=r(593);Object.defineProperty(t,"C5",{enumerable:!0,get:function(){return e.setStringPrototype}}),Object.defineProperty(t,"aR",{enumerable:!0,get:function(){return e.toPx}}),Object.defineProperty(t,"I8",{enumerable:!0,get:function(){return e.initInjection}});var i=r(779);Object.defineProperty(t,"y1",{enumerable:!0,get:function(){return i.penCache}}),Object.defineProperty(t,"BM",{enumerable:!0,get:function(){return i.clearPenCache}}),Object.defineProperty(t,"Gm",{enumerable:!0,get:function(){return i.Pen}})})();var i=s.Gm,o=s.X$,n=s.BM,c=s.I8,a=s.y1,h=s.C5,l=s.aR;export{i as Pen,o as __esModule,n as clearPenCache,c as initInjection,a as penCache,h as setStringPrototype,l as toPx};